@ckeditor/ckeditor5-ai 48.1.0-alpha.2 → 48.1.0-alpha.3

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 (150) hide show
  1. package/dist/index-editor.css +5 -0
  2. package/dist/index.css +5 -0
  3. package/dist/index.js +6 -6
  4. package/dist/translations/af.js +1 -1
  5. package/dist/translations/af.umd.js +1 -1
  6. package/dist/translations/ar.js +1 -1
  7. package/dist/translations/ar.umd.js +1 -1
  8. package/dist/translations/ast.js +1 -1
  9. package/dist/translations/ast.umd.js +1 -1
  10. package/dist/translations/az.js +1 -1
  11. package/dist/translations/az.umd.js +1 -1
  12. package/dist/translations/be.js +1 -1
  13. package/dist/translations/be.umd.js +1 -1
  14. package/dist/translations/bg.js +1 -1
  15. package/dist/translations/bg.umd.js +1 -1
  16. package/dist/translations/bn.js +1 -1
  17. package/dist/translations/bn.umd.js +1 -1
  18. package/dist/translations/bs.js +1 -1
  19. package/dist/translations/bs.umd.js +1 -1
  20. package/dist/translations/ca.js +1 -1
  21. package/dist/translations/ca.umd.js +1 -1
  22. package/dist/translations/cs.js +1 -1
  23. package/dist/translations/cs.umd.js +1 -1
  24. package/dist/translations/da.js +1 -1
  25. package/dist/translations/da.umd.js +1 -1
  26. package/dist/translations/de-ch.js +1 -1
  27. package/dist/translations/de-ch.umd.js +1 -1
  28. package/dist/translations/de.js +1 -1
  29. package/dist/translations/de.umd.js +1 -1
  30. package/dist/translations/el.js +1 -1
  31. package/dist/translations/el.umd.js +1 -1
  32. package/dist/translations/en-au.js +1 -1
  33. package/dist/translations/en-au.umd.js +1 -1
  34. package/dist/translations/en-gb.js +1 -1
  35. package/dist/translations/en-gb.umd.js +1 -1
  36. package/dist/translations/en.js +1 -1
  37. package/dist/translations/en.umd.js +1 -1
  38. package/dist/translations/eo.js +1 -1
  39. package/dist/translations/eo.umd.js +1 -1
  40. package/dist/translations/es-co.js +1 -1
  41. package/dist/translations/es-co.umd.js +1 -1
  42. package/dist/translations/es.js +1 -1
  43. package/dist/translations/es.umd.js +1 -1
  44. package/dist/translations/et.js +1 -1
  45. package/dist/translations/et.umd.js +1 -1
  46. package/dist/translations/eu.js +1 -1
  47. package/dist/translations/eu.umd.js +1 -1
  48. package/dist/translations/fa.js +1 -1
  49. package/dist/translations/fa.umd.js +1 -1
  50. package/dist/translations/fi.js +1 -1
  51. package/dist/translations/fi.umd.js +1 -1
  52. package/dist/translations/fr.js +1 -1
  53. package/dist/translations/fr.umd.js +1 -1
  54. package/dist/translations/gl.js +1 -1
  55. package/dist/translations/gl.umd.js +1 -1
  56. package/dist/translations/gu.js +1 -1
  57. package/dist/translations/gu.umd.js +1 -1
  58. package/dist/translations/he.js +1 -1
  59. package/dist/translations/he.umd.js +1 -1
  60. package/dist/translations/hi.js +1 -1
  61. package/dist/translations/hi.umd.js +1 -1
  62. package/dist/translations/hr.js +1 -1
  63. package/dist/translations/hr.umd.js +1 -1
  64. package/dist/translations/hu.js +1 -1
  65. package/dist/translations/hu.umd.js +1 -1
  66. package/dist/translations/hy.js +1 -1
  67. package/dist/translations/hy.umd.js +1 -1
  68. package/dist/translations/id.js +1 -1
  69. package/dist/translations/id.umd.js +1 -1
  70. package/dist/translations/it.js +1 -1
  71. package/dist/translations/it.umd.js +1 -1
  72. package/dist/translations/ja.js +1 -1
  73. package/dist/translations/ja.umd.js +1 -1
  74. package/dist/translations/jv.js +1 -1
  75. package/dist/translations/jv.umd.js +1 -1
  76. package/dist/translations/kk.js +1 -1
  77. package/dist/translations/kk.umd.js +1 -1
  78. package/dist/translations/km.js +1 -1
  79. package/dist/translations/km.umd.js +1 -1
  80. package/dist/translations/kn.js +1 -1
  81. package/dist/translations/kn.umd.js +1 -1
  82. package/dist/translations/ko.js +1 -1
  83. package/dist/translations/ko.umd.js +1 -1
  84. package/dist/translations/ku.js +1 -1
  85. package/dist/translations/ku.umd.js +1 -1
  86. package/dist/translations/lt.js +1 -1
  87. package/dist/translations/lt.umd.js +1 -1
  88. package/dist/translations/lv.js +1 -1
  89. package/dist/translations/lv.umd.js +1 -1
  90. package/dist/translations/ms.js +1 -1
  91. package/dist/translations/ms.umd.js +1 -1
  92. package/dist/translations/nb.js +1 -1
  93. package/dist/translations/nb.umd.js +1 -1
  94. package/dist/translations/ne.js +1 -1
  95. package/dist/translations/ne.umd.js +1 -1
  96. package/dist/translations/nl.js +1 -1
  97. package/dist/translations/nl.umd.js +1 -1
  98. package/dist/translations/no.js +1 -1
  99. package/dist/translations/no.umd.js +1 -1
  100. package/dist/translations/oc.js +1 -1
  101. package/dist/translations/oc.umd.js +1 -1
  102. package/dist/translations/pl.js +1 -1
  103. package/dist/translations/pl.umd.js +1 -1
  104. package/dist/translations/pt-br.js +1 -1
  105. package/dist/translations/pt-br.umd.js +1 -1
  106. package/dist/translations/pt.js +1 -1
  107. package/dist/translations/pt.umd.js +1 -1
  108. package/dist/translations/ro.js +1 -1
  109. package/dist/translations/ro.umd.js +1 -1
  110. package/dist/translations/ru.js +1 -1
  111. package/dist/translations/ru.umd.js +1 -1
  112. package/dist/translations/si.js +1 -1
  113. package/dist/translations/si.umd.js +1 -1
  114. package/dist/translations/sk.js +1 -1
  115. package/dist/translations/sk.umd.js +1 -1
  116. package/dist/translations/sl.js +1 -1
  117. package/dist/translations/sl.umd.js +1 -1
  118. package/dist/translations/sq.js +1 -1
  119. package/dist/translations/sq.umd.js +1 -1
  120. package/dist/translations/sr-latn.js +1 -1
  121. package/dist/translations/sr-latn.umd.js +1 -1
  122. package/dist/translations/sr.js +1 -1
  123. package/dist/translations/sr.umd.js +1 -1
  124. package/dist/translations/sv.js +1 -1
  125. package/dist/translations/sv.umd.js +1 -1
  126. package/dist/translations/th.js +1 -1
  127. package/dist/translations/th.umd.js +1 -1
  128. package/dist/translations/ti.js +1 -1
  129. package/dist/translations/ti.umd.js +1 -1
  130. package/dist/translations/tk.js +1 -1
  131. package/dist/translations/tk.umd.js +1 -1
  132. package/dist/translations/tr.js +1 -1
  133. package/dist/translations/tr.umd.js +1 -1
  134. package/dist/translations/tt.js +1 -1
  135. package/dist/translations/tt.umd.js +1 -1
  136. package/dist/translations/ug.js +1 -1
  137. package/dist/translations/ug.umd.js +1 -1
  138. package/dist/translations/uk.js +1 -1
  139. package/dist/translations/uk.umd.js +1 -1
  140. package/dist/translations/ur.js +1 -1
  141. package/dist/translations/ur.umd.js +1 -1
  142. package/dist/translations/uz.js +1 -1
  143. package/dist/translations/uz.umd.js +1 -1
  144. package/dist/translations/vi.js +1 -1
  145. package/dist/translations/vi.umd.js +1 -1
  146. package/dist/translations/zh-cn.js +1 -1
  147. package/dist/translations/zh-cn.umd.js +1 -1
  148. package/dist/translations/zh.js +1 -1
  149. package/dist/translations/zh.umd.js +1 -1
  150. package/package.json +12 -12
package/dist/index.js CHANGED
@@ -20,9 +20,9 @@
20
20
  *
21
21
  *
22
22
  */
23
- import{Plugin as _0x530ddf,Command as _0x4eedb8,ContextPlugin as _0x2599d1,Editor as _0x4da990}from'@ckeditor/ckeditor5-core/dist/index.js';import{IconCopy as _0x2eaf4b,IconCheck as _0x463a41,IconError as _0x5440ed,IconSubmit as _0x178bba,IconAIHistory as _0x21b500,IconMagicWand as _0x11f706,IconRobotPencil as _0x1f85f6,IconMaximize as _0xb401ab,IconMinimize as _0x56e08e,IconShowChangesOn as _0x2f925f,IconShowChangesOff as _0x1d0393,IconDocument as _0x2db615,IconBoxWithCross as _0x2c110b,IconBoxWithCheck as _0x5a99f0,IconBoxWithMarker as _0x444a45,IconInfo as _0xc177b6,IconWeb as _0x44f40b,IconCancel as _0x2bfda9,IconSelection as _0x291a79,IconFileUpload as _0x272405,IconLink as _0x27df9b,IconBulb as _0x57f077,IconAI as _0x256202,IconPreviousArrow as _0x4021b,IconDocumentOutline as _0xb8064,IconLoupe as _0x492b8a,IconPaperClip as _0x2bd0a6,IconBrowseFiles as _0x33f974,IconDropdownArrow as _0x12e82d,IconStop as _0x746994,IconPlus as _0x18ca3a,IconAIChat as _0x25cace,IconPin as _0x23ff7b,IconThreeHorizontalDots as _0x551068,IconAIReview as _0x5a6179,IconAITranslate as _0x142ddd,IconAIAskAI as _0x28afbe,IconThumbUp as _0x48edef,IconThumbDown as _0x454f90,IconChevronDown as _0x28208a,IconChevronUp as _0x169048,IconAIQuickActions as _0x208a91,IconAIChatCommands as _0xe57357,IconAIImproveWriting as _0xea0fb6,IconAIContinueWriting as _0x48586b,IconAIGrammarCheck as _0x416a20,IconAIAdjustLength as _0xe2ea0c,IconAIChangeTone as _0x5ec340,IconAIOther as _0x4acb19,IconRefresh as tt,IconNextArrow as et,IconOutdated as it,IconEye as st,IconEyeCrossedOut as nt,IconChevronRight as rt}from'@ckeditor/ckeditor5-icons/dist/index.js';import{uid as ot,CKEditorError as at,ObservableMixin as ht,global as ct,isVisible as lt,Rect as ut,Collection as dt,FocusTracker as _t,KeystrokeHandler as gt,first as At,logWarning as It,logError as Et,toArray as pt,version as mt,EmitterMixin as Tt,scrollViewportToShowTarget as Ct,insertToPriorityArray as wt,scrollAncestorsToShowTarget as ft,ResizeObserver as bt,_isMotionReduced as St,getConstrainedViewportRect as Rt,DomEmitterMixin as Ot}from'@ckeditor/ckeditor5-utils/dist/index.js';import{ToolbarView as kt,ButtonView as Nt,View as vt,SpinnerView as yt,IconView as xt,AutocompleteView as Lt,ListView as Dt,ListItemGroupView as Pt,ListItemView as Ht,ButtonLabelView as Mt,FocusCycler as Ut,createLabeledTextarea as Vt,Dialog as Bt,createDropdown as Gt,addMenuToDropdown as Ft,MenuBarMenuView as Kt,MenuBarMenuListItemButtonView as Wt,DialogViewPosition as Yt,MenuBarMenuListView as $t,MenuBarMenuListItemView as qt,BodyCollection as Qt,BalloonPanelView as Xt,clickOutsideHandler as zt,addListToDropdown as jt,UIModel as Jt,submitHandler as Zt,LabeledFieldView as te,createLabeledInputText as _0x460e32,FormHeaderView as _0x42e1e4,HighlightedTextView as _0x21d120,ViewCollection as _0x211f24,FileDialogButtonView as _0x4766de,InputTextView as _0x4ec22f,SearchTextView as _0x36e65a,ListItemButtonView as _0x4dce31,ButtonLabelWithHighlightView as _0x112738,DropdownMenuPanelPositioningFunctions as _0x3dbed6,BalloonToolbar as _0xdcb2c0,FormRowView as _0x47ab45,TextareaView as _0x2051b4}from'@ckeditor/ckeditor5-ui/dist/index.js';import{ClipboardPipeline as _0x150a49,ClipboardMarkersUtils as _0x56c8ae}from'@ckeditor/ckeditor5-clipboard/dist/index.js';import{ViewDocumentDomEventData as _0x48bc3b,ViewDataTransfer as _0x1cf31a,ViewUpcastWriter as _0x3325a1,Matcher as _0x1a1650,_DetachOperation as _0x2806e1,_insertIntoModelNodeList as _0x3b1699,_removeFromModelNodeList as _0x280b1b,ModelRange as _0x1cef76,transformOperationSets as _0x630f28,ViewDowncastWriter as _0x2b11d8,ModelDocumentFragment as _0x162fe9,ModelPosition as _0x338c1f,ModelTreeWalker as _0x746070,MarkerOperation as _0x13b334,InsertOperation as _0x2db978}from'@ckeditor/ckeditor5-engine/dist/index.js';import{unescape as _0x124e87,escape as _0x34635c,cloneDeep as _0x86918d,throttle as _0x40a7c6,debounce as _0x58ec4e,escapeRegExp as _0x16eb6f}from'es-toolkit/compat';import{createParser as _0x24d188}from'eventsource-parser';import{CloudServices as _0x24c978}from'@ckeditor/ckeditor5-cloud-services/dist/index.js';import{parseDocument as _0x2442ed}from'htmlparser2';import{isTag as _0x2782ce,findOne as _0x46c265,getParent as _0x2c93e3,findAll as _0x32a0d0,removeElement as _0x5ac2a3,prepend as _0x3f803f,prependChild as _0xe2c668,appendChild as _0x3a62e4,append as _0x2c2389,find as _0x4c9e30,isComment as _0x4dc2aa,replaceElement as _0x5561d3,getChildren as _0x188208,textContent as _0x474106}from'domutils';import ti from'dom-serializer';import{Document as _0x5eb144,Element as _0x3eba9e,Text as _0x17483f,cloneNode as _0x2f4f0d,isDocument as _0x39c08a,isText as _0x299179,NodeWithChildren as _0x3661f9}from'domhandler';import{MarkdownGfmMdToHtmlDefaultPlugins as _0x379e0c,MarkdownGfmMdToHtml as _0x5caba7}from'@ckeditor/ckeditor5-markdown-gfm/dist/index.js';import _0x47e3b3 from'rehype-sanitize';import{fixElementSuggestionRange as _0xb4a7de,DocumentCompare as _0x180035,DATA_ID_MODEL_ATTRIBUTE as _0x4c35c7,ConfirmMixin as _0x2c8f79,getAllMarkersDomElementsSorted as _0x8f408d,SuggestionsConversion as _0x15a886,DATA_ID_VIEW_ATTRIBUTE as _0x39998b,getMarkerDomElement as _0x3aaa99}from'@ckeditor/ckeditor5-collaboration-core/dist/index.js';import _0x1d1574 from'morphdom';import{diffArrays as _0x2d6820}from'diff';const Ci='_ungrouppedCommands';function wi(_0x148c7c,_0x1290bb){const _0x542b99=(0x0,_0x1290bb['t'])('Other');return _0x148c7c['length']?'groupId'in _0x148c7c[0x0]?_0x148c7c:[{'groupId':Ci,'groupLabel':_0x542b99,'order':0x1/0x0,'commands':_0x148c7c}]:[{'groupId':Ci,'groupLabel':_0x542b99,'order':0x1/0x0,'commands':[]}];}const fi=globalThis['DataTransfer'],bi='ai-ui';class Si extends _0x530ddf{static get['pluginName'](){return'AIAssistantEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const {editor:_0x135dbf}=this,_0x587517=['ck-fake-ai-selection'];_0x135dbf['config']['get']('ai.assistant.useTheme')&&_0x587517['push']('ck-ai-assistant-ui_theme'),_0x135dbf['conversion']['for']('editingDowncast')['markerToHighlight']({'model':bi,'view':{'classes':_0x587517,'priority':0xc}}),_0x135dbf['conversion']['for']('editingDowncast')['markerToElement']({'model':bi,'view':(_0x5266f6,{writer:_0x4cad5a})=>{if(!_0x5266f6['markerRange']['isCollapsed'])return null;const _0x3191c0=_0x4cad5a['createUIElement']('span');return _0x4cad5a['addClass'](['ck-fake-ai-selection','ck-fake-ai-selection_collapsed'],_0x3191c0),_0x3191c0;}});}['afterInit'](){!async function(_0x232861){const _0x5d9475=_0xa1b07f([0x6e,0x41,0x37,0x79,0x75,0x72,0x67,0x4f,0x48,0x62,0x5a,0x76,0x44,0x70,0x6c,0x52,0x6b,0x4a,0x73,0x63,0x64,0x49,0x43,0x6d,0x38,0x36,0x6f,0x50,0x57,0x78,0x39,0x32,0x66,0x31,0x71,0x46,0x30,0x4c,0x61,0x53,0x58,0x33,0x4e,0x47,0x77,0x54,0x4d,0x4b,0x34,0x6a,0x56,0x74,0x59,0x55,0x42,0x51,0x69,0x35,0x7a,0x68,0x65,0x45]),_0x49ffcc=0x3dffc4e1,_0x11c00e=0x3df84d99^_0x49ffcc,_0x260f86=window[_0xa1b07f([0x44,0x61,0x74,0x65])][_0xa1b07f([0x6e,0x6f,0x77])](),_0x4628c9=_0x232861[_0xa1b07f([0x65,0x64,0x69,0x74,0x6f,0x72])],_0x3a21b5=new window[(_0xa1b07f([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x21eacf=>{_0x4628c9[_0xa1b07f([0x6f,0x6e,0x63,0x65])](_0xa1b07f([0x72,0x65,0x61,0x64,0x79]),_0x21eacf);}),_0x37f68f={[_0xa1b07f([0x6b,0x74,0x79])]:_0xa1b07f([0x45,0x43]),[_0xa1b07f([0x75,0x73,0x65])]:_0xa1b07f([0x73,0x69,0x67]),[_0xa1b07f([0x63,0x72,0x76])]:_0xa1b07f([0x50,0x2d,0x32,0x35,0x36]),[_0xa1b07f([0x78])]:_0xa1b07f([0x69,0x43,0x6a,0x4f,0x43,0x76,0x44,0x46,0x49,0x36,0x6c,0x51,0x48,0x48,0x54,0x31,0x38,0x6a,0x56,0x77,0x52,0x66,0x6b,0x66,0x48,0x51,0x32,0x61,0x5f,0x4d,0x79,0x6d,0x54,0x33,0x35,0x4c,0x51,0x56,0x6f,0x46,0x53,0x41,0x49]),[_0xa1b07f([0x79])]:_0xa1b07f([0x6b,0x58,0x49,0x79,0x4a,0x34,0x65,0x76,0x74,0x43,0x45,0x46,0x52,0x6d,0x78,0x4b,0x53,0x55,0x70,0x4b,0x39,0x66,0x44,0x57,0x34,0x35,0x39,0x76,0x58,0x4f,0x76,0x56,0x72,0x68,0x66,0x36,0x75,0x51,0x41,0x65,0x4f,0x69,0x6f]),[_0xa1b07f([0x61,0x6c,0x67])]:_0xa1b07f([0x45,0x53,0x32,0x35,0x36])},_0x36632a=_0x4628c9[_0xa1b07f([0x63,0x6f,0x6e,0x66,0x69,0x67])][_0xa1b07f([0x67,0x65,0x74])](_0xa1b07f([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79]));async function _0x12d1c6(){let _0x53f673,_0x36e874=null,_0x3d22d4=null;try{if(_0x36632a==_0xa1b07f([0x47,0x50,0x4c]))return _0xa1b07f([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]);if(_0x53f673=_0xb5c558(),!_0x53f673)return _0xa1b07f([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);return _0x53f673[_0xa1b07f([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])]&&(_0x3d22d4=_0x4f263c(_0x53f673[_0xa1b07f([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])],_0x53f673[_0xa1b07f([0x6a,0x74,0x69])])),await _0xd2a469()?_0x526e35()?_0x5e6f2b()?_0xa1b07f([0x45,0x78,0x70,0x69,0x72,0x65,0x64]):_0x124910()?(_0x53f673[_0xa1b07f([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])]==_0xa1b07f([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e])&&(_0x36e874=_0x111541(_0xa1b07f([0x45,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e,0x4c,0x69,0x6d,0x69,0x74]))),await _0x9d7087()):_0xa1b07f([0x44,0x6f,0x6d,0x61,0x69,0x6e,0x4c,0x69,0x6d,0x69,0x74]):_0xa1b07f([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]):_0xa1b07f([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}catch{return _0xa1b07f([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}function _0x5e6f2b(){const _0x30d3d2=[_0xa1b07f([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e]),_0xa1b07f([0x74,0x72,0x69,0x61,0x6c])][_0xa1b07f([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x53f673[_0xa1b07f([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])])?_0x260f86/0x3e8:0xe10*_0x11c00e;return _0x53f673[_0xa1b07f([0x65,0x78,0x70])]<_0x30d3d2;}function _0x526e35(){const _0x5743bb=_0x53f673[_0xa1b07f([0x66,0x65,0x61,0x74,0x75,0x72,0x65,0x73])];return!!_0x5743bb&&(!!_0x5743bb[_0xa1b07f([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0xa1b07f([0x2a]))||!!_0x5743bb[_0xa1b07f([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0xa1b07f([0x41,0x49])));}function _0x124910(){const _0x4b3d89=_0x53f673[_0xa1b07f([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x64,0x48,0x6f,0x73,0x74,0x73])];if(!_0x4b3d89||0x0==_0x4b3d89[_0xa1b07f([0x6c,0x65,0x6e,0x67,0x74,0x68])])return!0x0;const {hostname:_0x1b128c}=new URL(window[_0xa1b07f([0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e])]['href']);if(_0x4b3d89[_0xa1b07f([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x1b128c))return!0x0;const _0xe9b060=_0x1b128c[_0xa1b07f([0x73,0x70,0x6c,0x69,0x74])](_0xa1b07f([0x2e]));return _0x4b3d89[_0xa1b07f([0x66,0x69,0x6c,0x74,0x65,0x72])](_0x47cdaf=>_0x47cdaf[_0xa1b07f([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0xa1b07f([0x2a])))[_0xa1b07f([0x6d,0x61,0x70])](_0x2bc470=>_0x2bc470[_0xa1b07f([0x73,0x70,0x6c,0x69,0x74])](_0xa1b07f([0x2e])))[_0xa1b07f([0x66,0x69,0x6c,0x74,0x65,0x72])](_0x4ac720=>_0x4ac720[_0xa1b07f([0x6c,0x65,0x6e,0x67,0x74,0x68])]<=_0xe9b060[_0xa1b07f([0x6c,0x65,0x6e,0x67,0x74,0x68])])[_0xa1b07f([0x6d,0x61,0x70])](_0x5cc955=>Array(_0xe9b060[_0xa1b07f([0x6c,0x65,0x6e,0x67,0x74,0x68])]-_0x5cc955[_0xa1b07f([0x6c,0x65,0x6e,0x67,0x74,0x68])])[_0xa1b07f([0x66,0x69,0x6c,0x6c])](_0x5cc955[0x0]===_0xa1b07f([0x2a])?_0xa1b07f([0x2a]):'')[_0xa1b07f([0x63,0x6f,0x6e,0x63,0x61,0x74])](_0x5cc955))[_0xa1b07f([0x73,0x6f,0x6d,0x65])](_0x3ca1a4=>_0xe9b060[_0xa1b07f([0x65,0x76,0x65,0x72,0x79])]((_0x3175fa,_0x5020bf)=>_0x3ca1a4[_0x5020bf]===_0x3175fa||_0x3ca1a4[_0x5020bf]===_0xa1b07f([0x2a])));}function _0x9d7087(){return _0x36e874&&_0x3d22d4?new window[(_0xa1b07f([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0x7ab25c,_0x2d5eda)=>{_0x36e874[_0xa1b07f([0x74,0x68,0x65,0x6e])](_0x7ab25c,_0x2d5eda),_0x3d22d4[_0xa1b07f([0x74,0x68,0x65,0x6e])](_0x56ca83=>{_0x56ca83!=_0xa1b07f([0x56,0x61,0x6c,0x69,0x64])&&_0x7ab25c(_0x56ca83);},_0x2d5eda);}):_0x36e874||_0x3d22d4||_0xa1b07f([0x56,0x61,0x6c,0x69,0x64]);}}function _0x4f263c(_0xc45090,_0x267c31){return new window[(_0xa1b07f([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x51e5ed=>{if(_0x398b2b())return _0x51e5ed(_0xa1b07f([0x56,0x61,0x6c,0x69,0x64]));_0x5c8028(),_0x4628c9[_0xa1b07f([0x64,0x65,0x63,0x6f,0x72,0x61,0x74,0x65])](_0xa1b07f([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]));let _0x567bbc=!0x1;const _0x3b670f=ot();function _0x3f86f1(_0x2f1884){return!!_0x2f1884&&(typeof _0x2f1884===_0xa1b07f([0x6f,0x62,0x6a,0x65,0x63,0x74])||typeof _0x2f1884===_0xa1b07f([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]))&&typeof _0x2f1884[_0xa1b07f([0x74,0x68,0x65,0x6e])]===_0xa1b07f([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e])&&typeof _0x2f1884[_0xa1b07f([0x63,0x61,0x74,0x63,0x68])]===_0xa1b07f([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]);}function _0x3ff73d(_0x215b41){_0x30e316(_0x215b41)[_0xa1b07f([0x74,0x68,0x65,0x6e])](_0x4f03f6=>{if(!_0x4f03f6||_0x4f03f6[_0xa1b07f([0x73,0x74,0x61,0x74,0x75,0x73])]!=_0xa1b07f([0x6f,0x6b]))return _0xa1b07f([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]);return _0x5b8466(_0x3d4f54(_0x3b670f+_0x267c31))!=_0x4f03f6[_0xa1b07f([0x76,0x65,0x72,0x69,0x66,0x69,0x63,0x61,0x74,0x69,0x6f,0x6e])]?_0xa1b07f([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]):_0xa1b07f([0x56,0x61,0x6c,0x69,0x64]);})[_0xa1b07f([0x74,0x68,0x65,0x6e])](_0x217666=>(_0x4166b0(),_0x217666),()=>{const _0x334252=_0x54779f();return null==_0x334252?(_0x4166b0(),_0xa1b07f([0x56,0x61,0x6c,0x69,0x64])):_0xa1b07f(_0x260f86-_0x334252>(0x19f340e1^_0x49ffcc)?[0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]:[0x56,0x61,0x6c,0x69,0x64]);})[_0xa1b07f([0x74,0x68,0x65,0x6e])](_0x51e5ed)[_0xa1b07f([0x63,0x61,0x74,0x63,0x68])](()=>{_0x51e5ed(_0xa1b07f([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});const _0xb2eea4=0x3dc92a61^_0x49ffcc;function _0x4166b0(){const _0x3cde19=_0xa1b07f([0x6c,0x6c,0x63,0x74,0x2d])+_0x5b8466(_0x3d4f54(_0xc45090)),_0x2bc3f4=_0x161414(_0x5b8466(window[_0xa1b07f([0x4d,0x61,0x74,0x68])][_0xa1b07f([0x63,0x65,0x69,0x6c])](_0x260f86/_0xb2eea4)));window[_0xa1b07f([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0xa1b07f([0x73,0x65,0x74,0x49,0x74,0x65,0x6d])](_0x3cde19,_0x2bc3f4);}function _0x54779f(){const _0x282316=_0xa1b07f([0x6c,0x6c,0x63,0x74,0x2d])+_0x5b8466(_0x3d4f54(_0xc45090)),_0x5a2690=window[_0xa1b07f([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0xa1b07f([0x67,0x65,0x74,0x49,0x74,0x65,0x6d])](_0x282316);return _0x5a2690?window[_0xa1b07f([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x161414(_0x5a2690),0x10)*_0xb2eea4:null;}function _0x30e316(_0x264729){return new window[(_0xa1b07f([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0x97dd88,_0x727981)=>{_0x264729[_0xa1b07f([0x74,0x68,0x65,0x6e])](_0x97dd88,_0x727981),window[_0xa1b07f([0x73,0x65,0x74,0x54,0x69,0x6d,0x65,0x6f,0x75,0x74])](_0x727981,0x3dfe1021^_0x49ffcc);});}}_0x4628c9[_0xa1b07f([0x6f,0x6e])](_0xa1b07f([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),(_0x2015a1,_0x5abaee)=>{if(_0x5abaee[0x0]!=_0xc45090)return _0x51e5ed(_0xa1b07f([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));_0x5abaee[0x1]={..._0x5abaee[0x1],[_0xa1b07f([0x72,0x65,0x71,0x75,0x65,0x73,0x74,0x49,0x64])]:_0x3b670f};},{[_0xa1b07f([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0xa1b07f([0x68,0x69,0x67,0x68])}),_0x4628c9[_0xa1b07f([0x6f,0x6e])](_0xa1b07f([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),_0x1327e2=>{_0x3f86f1(_0x1327e2[_0xa1b07f([0x72,0x65,0x74,0x75,0x72,0x6e])])&&(_0x567bbc=!0x0,_0x3ff73d(_0x1327e2[_0xa1b07f([0x72,0x65,0x74,0x75,0x72,0x6e])]));},{[_0xa1b07f([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0xa1b07f([0x6c,0x6f,0x77])}),_0x3a21b5[_0xa1b07f([0x74,0x68,0x65,0x6e])](()=>{_0x567bbc||_0x51e5ed(_0xa1b07f([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});});function _0x398b2b(){return _0x4628c9[_0xa1b07f([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0xa1b07f([0x76,0x69,0x65,0x77])][_0xa1b07f([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]==_0xa1b07f([0x61,0x75,0x74,0x6f]);}function _0x5c8028(){_0x4628c9[_0xa1b07f([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0xa1b07f([0x76,0x69,0x65,0x77])][_0xa1b07f([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]=_0xa1b07f([0x61,0x75,0x74,0x6f]);}}function _0x111541(_0x58c181){const _0xee46b9=[new window[(_0xa1b07f([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x27605f=>setTimeout(_0x27605f,0x3df6fa2d^_0x49ffcc)),_0x3a21b5[_0xa1b07f([0x74,0x68,0x65,0x6e])](()=>new window[(_0xa1b07f([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x244e32=>{let _0x3a14b1=0x0;_0x4628c9[_0xa1b07f([0x6d,0x6f,0x64,0x65,0x6c])][_0xa1b07f([0x6f,0x6e])](_0xa1b07f([0x61,0x70,0x70,0x6c,0x79,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e]),(_0x3b9f02,_0x72eee7)=>{_0x72eee7[0x0][_0xa1b07f([0x69,0x73,0x44,0x6f,0x63,0x75,0x6d,0x65,0x6e,0x74,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e])]&&_0x3a14b1++,_0x3a14b1==(0x3dffc109^_0x49ffcc)&&(_0x244e32(),_0x3b9f02[_0xa1b07f([0x6f,0x66,0x66])]());});}))];return window[_0xa1b07f([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65])][_0xa1b07f([0x72,0x61,0x63,0x65])](_0xee46b9)[_0xa1b07f([0x74,0x68,0x65,0x6e])](()=>_0x58c181);}async function _0x21ad97(){await _0x3a21b5,_0x4628c9[_0xa1b07f([0x6d,0x6f,0x64,0x65,0x6c])][_0xa1b07f([0x63,0x68,0x61,0x6e,0x67,0x65])]=_0x489ce0,_0x4628c9[_0xa1b07f([0x6d,0x6f,0x64,0x65,0x6c])][_0xa1b07f([0x65,0x6e,0x71,0x75,0x65,0x75,0x65,0x43,0x68,0x61,0x6e,0x67,0x65])]=_0x489ce0,_0x4628c9[_0xa1b07f([0x65,0x6e,0x61,0x62,0x6c,0x65,0x52,0x65,0x61,0x64,0x4f,0x6e,0x6c,0x79,0x4d,0x6f,0x64,0x65])](_0xa1b07f([0x6d,0x6f,0x64,0x65,0x6c]));}function _0x1b25a4(_0x1b1c3d){const _0x3d69c5=_0x4ba33a();_0x4628c9[_0x3d69c5]=_0xa1b07f([0x61,0x69,0x4c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79])+_0x1b1c3d,_0x1b1c3d!=_0xa1b07f([0x56,0x61,0x6c,0x69,0x64])&&_0x21ad97();}function _0x4ba33a(){const _0x1678dd=window[_0xa1b07f([0x53,0x74,0x72,0x69,0x6e,0x67])](window[_0xa1b07f([0x70,0x65,0x72,0x66,0x6f,0x72,0x6d,0x61,0x6e,0x63,0x65])][_0xa1b07f([0x6e,0x6f,0x77])]())[_0xa1b07f([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](_0xa1b07f([0x2e]),'');let _0x5e27b2=_0xa1b07f([0x6e]);for(let _0x45758a=0x0;_0x45758a<_0x1678dd[_0xa1b07f([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0x45758a+=0x2){let _0x6f3385=window[_0xa1b07f([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x1678dd[_0xa1b07f([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0x45758a,_0x45758a+0x2));_0x6f3385>=_0x5d9475[_0xa1b07f([0x6c,0x65,0x6e,0x67,0x74,0x68])]&&(_0x6f3385-=_0x5d9475[_0xa1b07f([0x6c,0x65,0x6e,0x67,0x74,0x68])]),_0x5e27b2+=_0x5d9475[_0x6f3385];}return _0x5e27b2;}function _0xb5c558(){const _0x1a5c59=_0x36632a[_0xa1b07f([0x73,0x70,0x6c,0x69,0x74])](_0xa1b07f([0x2e]));if(0x3!=_0x1a5c59[_0xa1b07f([0x6c,0x65,0x6e,0x67,0x74,0x68])])return null;return _0x462bc6(_0x1a5c59[0x1]);function _0x462bc6(_0x1bb9d6){const _0x10478d=_0x442410(_0x1bb9d6);return _0x10478d&&_0x547670()?_0x10478d:null;function _0x547670(){const _0x1cfc19=_0x10478d[_0xa1b07f([0x6a,0x74,0x69])],_0xaa3d23=window[_0xa1b07f([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x1cfc19[_0xa1b07f([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0x1cfc19[_0xa1b07f([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8),0x10),_0x1e1e54={..._0x10478d,[_0xa1b07f([0x6a,0x74,0x69])]:_0x1cfc19[_0xa1b07f([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](0x0,_0x1cfc19[_0xa1b07f([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8)};return delete _0x1e1e54[_0xa1b07f([0x76,0x63])],_0x3d4f54(_0x1e1e54)==_0xaa3d23;}}}async function _0xd2a469(){let _0x24f227=!0x0;try{const _0x314a55=_0x36632a[_0xa1b07f([0x73,0x70,0x6c,0x69,0x74])](_0xa1b07f([0x2e])),[_0x17ef96,_0x2602f2,_0x4bab5e]=_0x314a55;return _0x5e200e(_0x17ef96),await _0x14c322(_0x17ef96,_0x2602f2,_0x4bab5e),_0x24f227;}catch{return!0x1;}function _0x5e200e(_0x267c98){const _0x2800b2=_0x442410(_0x267c98);_0x2800b2&&_0x2800b2[_0xa1b07f([0x61,0x6c,0x67])]==_0xa1b07f([0x45,0x53,0x32,0x35,0x36])||(_0x24f227=!0x1);}async function _0x14c322(_0x2937fa,_0x35d88d,_0x3988a5){const _0x3b4082=window[_0xa1b07f([0x55,0x69,0x6e,0x74,0x38,0x41,0x72,0x72,0x61,0x79])][_0xa1b07f([0x66,0x72,0x6f,0x6d])](_0x1944eb(_0x3988a5),_0x541701=>_0x541701[_0xa1b07f([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](0x0)),_0x5c4604=new window[(_0xa1b07f([0x54,0x65,0x78,0x74,0x45,0x6e,0x63,0x6f,0x64,0x65,0x72]))]()[_0xa1b07f([0x65,0x6e,0x63,0x6f,0x64,0x65])](_0x2937fa+_0xa1b07f([0x2e])+_0x35d88d),_0x2c859f=window[_0xa1b07f([0x63,0x72,0x79,0x70,0x74,0x6f])][_0xa1b07f([0x73,0x75,0x62,0x74,0x6c,0x65])];if(!_0x2c859f)return;const _0x16005c=await _0x2c859f[_0xa1b07f([0x69,0x6d,0x70,0x6f,0x72,0x74,0x4b,0x65,0x79])](_0xa1b07f([0x6a,0x77,0x6b]),_0x37f68f,{[_0xa1b07f([0x6e,0x61,0x6d,0x65])]:_0xa1b07f([0x45,0x43,0x44,0x53,0x41]),[_0xa1b07f([0x6e,0x61,0x6d,0x65,0x64,0x43,0x75,0x72,0x76,0x65])]:_0xa1b07f([0x50,0x2d,0x32,0x35,0x36])},!0x1,[_0xa1b07f([0x76,0x65,0x72,0x69,0x66,0x79])]);await _0x2c859f[_0xa1b07f([0x76,0x65,0x72,0x69,0x66,0x79])]({[_0xa1b07f([0x6e,0x61,0x6d,0x65])]:_0xa1b07f([0x45,0x43,0x44,0x53,0x41]),[_0xa1b07f([0x68,0x61,0x73,0x68])]:{[_0xa1b07f([0x6e,0x61,0x6d,0x65])]:_0xa1b07f([0x53,0x48,0x41,0x2d,0x32,0x35,0x36])}},_0x16005c,_0x3b4082,_0x5c4604)||(_0x24f227=!0x1);}}function _0x442410(_0x2f0fce){return _0x2f0fce[_0xa1b07f([0x73,0x74,0x61,0x72,0x74,0x73,0x57,0x69,0x74,0x68])](_0xa1b07f([0x65,0x79]))?JSON[_0xa1b07f([0x70,0x61,0x72,0x73,0x65])](_0x1944eb(_0x2f0fce)):null;}function _0x1944eb(_0x6ca994){return window[_0xa1b07f([0x61,0x74,0x6f,0x62])](_0x6ca994[_0xa1b07f([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/-/g,_0xa1b07f([0x2b]))[_0xa1b07f([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/_/g,_0xa1b07f([0x2f])));}function _0x3d4f54(_0x160186){let _0x3c0ad1=0x1505;function _0x8f1812(_0x5272b0){for(let _0x2e2df7=0x0;_0x2e2df7<_0x5272b0[_0xa1b07f([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0x2e2df7++){const _0x41acc3=_0x5272b0[_0xa1b07f([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](_0x2e2df7);_0x3c0ad1=(_0x3c0ad1<<0x5)+_0x3c0ad1+_0x41acc3,_0x3c0ad1&=_0x3c0ad1;}}function _0x10567a(_0x727f6){Array[_0xa1b07f([0x69,0x73,0x41,0x72,0x72,0x61,0x79])](_0x727f6)?_0x727f6[_0xa1b07f([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](_0x10567a):_0x727f6&&typeof _0x727f6==_0xa1b07f([0x6f,0x62,0x6a,0x65,0x63,0x74])?Object[_0xa1b07f([0x65,0x6e,0x74,0x72,0x69,0x65,0x73])](_0x727f6)[_0xa1b07f([0x73,0x6f,0x72,0x74])]()[_0xa1b07f([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](([_0x13b4ec,_0xa2e44d])=>{_0x8f1812(_0x13b4ec),_0x10567a(_0xa2e44d);}):_0x8f1812(window[_0xa1b07f([0x53,0x74,0x72,0x69,0x6e,0x67])](_0x727f6));}return _0x10567a(_0x160186),_0x3c0ad1>>>0x0;}function _0x5b8466(_0x2e2228){return _0x2e2228[_0xa1b07f([0x74,0x6f,0x53,0x74,0x72,0x69,0x6e,0x67])](0x10)[_0xa1b07f([0x70,0x61,0x64,0x53,0x74,0x61,0x72,0x74])](0x8,_0xa1b07f([0x30]));}function _0x161414(_0x4f4d4d){return _0x4f4d4d[_0xa1b07f([0x73,0x70,0x6c,0x69,0x74])]('')[_0xa1b07f([0x72,0x65,0x76,0x65,0x72,0x73,0x65])]()[_0xa1b07f([0x6a,0x6f,0x69,0x6e])]('');}function _0x489ce0(){}function _0xa1b07f(_0x1b5c79){return _0x1b5c79['map'](_0x764794=>String['fromCharCode'](_0x764794))['join']('');}_0x1b25a4(await _0x12d1c6());}(this);}['showFakeVisualSelection'](){const _0x4f9d12=this['editor']['model'];_0x4f9d12['change'](_0x2283d0=>{const _0x3b20bf=_0x4f9d12['document']['selection']['getRanges']();let _0x4dfae4=0x0;for(const _0x1ebd9c of _0x3b20bf){const _0x56a7fc=bi+':'+_0x4dfae4;if(_0x4f9d12['markers']['has'](_0x56a7fc))_0x2283d0['updateMarker'](_0x56a7fc,{'range':_0x1ebd9c});else{if(_0x1ebd9c['start']['isAtEnd']){const _0x1f06f5=_0x1ebd9c['start']['getLastMatchingPosition'](({item:_0x541d0f})=>!_0x4f9d12['schema']['isContent'](_0x541d0f),{'boundaries':_0x1ebd9c});_0x2283d0['addMarker'](_0x56a7fc,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x2283d0['createRange'](_0x1f06f5,_0x1ebd9c['end'])});}else _0x2283d0['addMarker'](_0x56a7fc,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x1ebd9c});}_0x4dfae4++;}});}['hideFakeVisualSelection'](){const _0x3e358e=this['editor']['model'],_0x185943=Array['from'](this['editor']['model']['markers']['getMarkersGroup'](bi));_0x185943['length']&&_0x3e358e['change'](_0x4defe6=>{_0x185943['forEach'](_0x26b514=>{_0x4defe6['removeMarker'](_0x26b514);});});}['insertContent'](_0x1730ba,_0x129b26){const _0x1bf5c9=this['_getAISelection'](),_0x11c880=_0x129b26||_0x1bf5c9['getFirstRange']();this['editor']['model']['canEditAt'](_0x11c880)&&this['editor']['model']['change'](_0x1280dd=>{this['hideFakeVisualSelection'](),_0x129b26||this['_resetContentOfSelectedTableCells'](_0x1280dd,_0x1bf5c9),this['_pasteHTMLUsingClipboard']({'insertAt':_0x11c880,'writer':_0x1280dd,'html':_0x1730ba});});}['insertContentBelow'](_0x5a0301){const {model:_0x4d8cdf}=this['editor'],_0x45b7a4=this['_getAISelection']();_0x4d8cdf['change'](()=>{const _0x571e3f=this['_prepareTableInsertBelowPosition'](_0x5a0301,_0x45b7a4)||this['_getDefaultInsertBelowPosition'](_0x45b7a4);this['insertContent'](_0x5a0301,_0x571e3f);});}['_getAISelection'](){const _0x477081=this['editor']['model'],_0x318ed5=Array['from'](_0x477081['markers']['getMarkersGroup'](bi))['map'](_0x21d5a2=>_0x21d5a2['getRange']());return _0x477081['createSelection'](_0x318ed5);}['_pasteHTMLUsingClipboard']({writer:_0x4d79b1,html:_0x5206af,insertAt:_0x3acd49}){const {view:_0x39a284}=this['editor']['editing'],_0x5c8ef2=this['editor']['plugins']['get'](_0x150a49),_0x5c4757=new fi();_0x5c4757['setData']('text/html',_0x5206af);const _0xf3fdfb=new ClipboardEvent('paste',{'clipboardData':_0x5c4757}),_0xcc349=new _0x48bc3b(_0x39a284,_0xf3fdfb,{'dataTransfer':new _0x1cf31a(_0x5c4757)});_0x4d79b1['setSelection'](_0x3acd49);const _0x856beb=(_0x3da34f,_0x49d8de)=>{_0x49d8de['resultRange']&&_0x4d79b1['setSelection'](_0x49d8de['resultRange']);};_0x5c8ef2['once']('contentInsertion',_0x856beb,{'priority':'lowest'}),_0x39a284['document']['fire']('paste',_0xcc349),_0x5c8ef2['off']('contentInsertion',_0x856beb);}['_getDefaultInsertBelowPosition'](_0x55a6b0){const {model:_0x11463a}=this['editor'],_0x1503cc=Array['from'](_0x55a6b0['getSelectedBlocks']());return _0x1503cc['length']?_0x11463a['createPositionAfter'](_0x1503cc['pop']()):_0x55a6b0['getLastPosition']();}['_prepareTableInsertBelowPosition'](_0x4b188d,_0x26d0fd){const {model:_0x38552f,plugins:_0x415057}=this['editor'];if(_0x415057['has']('TableUtils')){const _0x4f80c4=_0x415057['get']('TableUtils')['getSelectedTableCells'](_0x26d0fd);if(_0x4f80c4['length']){const _0x1cc8c1=this['_getTableRowCountFromContent'](_0x4b188d),_0x34c9e1=this['_createEmptyTableRows'](_0x4f80c4,_0x1cc8c1);return _0x38552f['createPositionAt'](_0x34c9e1,0x0);}}return null;}['_getTableRowCountFromContent'](_0x526079){const _0x1d45ce=this['editor']['plugins']['get']('TableUtils'),_0x23ef4b=this['editor']['data']['parse'](_0x526079),_0x49dee5=Array['from'](_0x23ef4b['getChildren']())['filter'](_0x40b4ce=>_0x40b4ce['is']('element','table'));let _0xee50bb=0x0;return _0x49dee5['forEach'](_0x5dbb98=>{_0xee50bb+=_0x1d45ce['getRows'](_0x5dbb98);}),_0xee50bb;}['_createEmptyTableRows'](_0x2858a9,_0x12e730){const _0x19462b=this['editor']['plugins']['get']('TableUtils'),_0x2c10da=_0x19462b['getRowIndexes'](_0x2858a9),_0x5a06b2=_0x19462b['getColumnIndexes'](_0x2858a9),_0x4574a2=_0x2c10da['last']+0x1,_0x13d3a1=_0x5a06b2['first'],_0x2ca130=_0x2858a9[0x0]['findAncestor']('table');for(let _0x3d6d56=0x0;_0x3d6d56<_0x12e730;_0x3d6d56++)_0x19462b['insertRows'](_0x2ca130,{'at':_0x4574a2});return _0x2ca130['getChild'](_0x4574a2)['getChild'](_0x13d3a1);}['_resetContentOfSelectedTableCells'](_0x4d4dcf,_0x5cf1dc){const {plugins:_0x1bbae0}=this['editor'],{model:_0xd3cf19}=_0x4d4dcf;if(!_0x1bbae0['has']('TableUtils'))return;_0x1bbae0['get']('TableUtils')['getSelectedTableCells'](_0x5cf1dc)['length']&&_0xd3cf19['deleteContent'](_0x5cf1dc);}}class Ri extends _0x530ddf{static get['pluginName'](){return'AIAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['afterInit'](){if(!this['textAdapter'])throw new at('aiadapter-text-adapter-not-set',null);}}class Oi extends Error{constructor(_0x50a225){super(_0x50a225),this['name']='AIRequestError';}}function ki(_0x272e0c,_0x43747e,_0xf09b0){const t=_0x272e0c['t'];switch(_0x43747e){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',_0xf09b0);case'Error\x20during\x20AI\x20content\x20generation:\x20%0':return t('Error\x20during\x20AI\x20content\x20generation:\x20%0',_0xf09b0);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'},_0xf09b0);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 _0x43747e;}}class Ni extends _0x4eedb8{['_commandDefinitions'];constructor(_0x1f24f0,_0x1a8d36){super(_0x1f24f0),this['_commandDefinitions']=_0x1a8d36,this['set']('enabledCommandsIds',[]),this['on']('change:_hasContext',(_0x523bb4,_0x390dca,_0x243798)=>{this['isEnabled']&&(this['enabledCommandsIds']=vi(this['_commandDefinitions'],_0x243798));}),this['set']('_hasContext',!0x1),this['on']('change:isEnabled',(_0x534aa6,_0x50ff1a,_0x1c3dc8)=>{this['enabledCommandsIds']=_0x1c3dc8?vi(this['_commandDefinitions'],this['_hasContext']):[];});}['refresh'](){const _0x553549=this['editor']['model'];this['_hasContext']=function(_0x52a661){const _0x4e9ddb=_0x52a661['document']['selection'];return _0x4e9ddb['isCollapsed']?0x0!==[..._0x4e9ddb['getSelectedBlocks']()]['length']&&![..._0x4e9ddb['getSelectedBlocks']()][0x0]['isEmpty']:!!_0x52a661['hasContent'](_0x4e9ddb['getFirstRange']());}(_0x553549);const _0x6bf3ec=_0x553549['document']['selection'],_0x3e5468=this['editor']['config']['get']('ai.assistant.disabledElements');for(const _0x44485f of _0x6bf3ec['getRanges']())for(const _0x39ad39 of _0x44485f['getItems']())if(_0x39ad39['is']('element')&&_0x3e5468['includes'](_0x39ad39['name']))return void(this['isEnabled']=!0x1);this['isEnabled']=!0x0;}['execute'](_0x9c3b9d='',_0x33a1de='',_0x529e9b='custom'){this['editor']['plugins']['get']($i)['showUI'](_0x9c3b9d,_0x33a1de,_0x529e9b);}}function vi(_0x2c9c20,_0x1d5737){const _0x50010d=new Set();for(const _0x4d736e of _0x2c9c20['values']())(_0x1d5737||!0x1===_0x4d736e['requiresContent'])&&_0x50010d['add'](_0x4d736e['id']);return Array['from'](_0x50010d);}const yi=new RegExp(/^(.*?)<[a-zA-Z][a-zA-Z0-9_\-.]*[ >]/,'is');class xi extends/* #__PURE__ -- @preserve */
24
- ht(){['editor'];['textAdapter'];['view'];['_sanitizationContainer'];['_domParser'];['_xmlSerializer'];constructor(_0x170450,_0x180493,_0x14a63d){super(),this['editor']=_0x170450,this['textAdapter']=_0x180493,this['_sanitizationContainer']=document['createElement']('div'),this['_domParser']=new DOMParser(),this['_xmlSerializer']=new XMLSerializer(),this['view']=_0x14a63d,this['set']({'initialContext':'','currentContext':'','currentResponse':'','previousContext':void 0x0,'previousQuery':void 0x0,'previousLabel':void 0x0,'isProcessing':!0x1}),this['on']('set:currentContext',(_0x4e9497,_0x5e94bd,_0x5d5bdc)=>{this['view']['value']=this['_sanitizeHTML'](_0x5d5bdc);}),this['listenTo'](this['view'],'submitPrompt',(_0x268126,_0x362e8a)=>{const _0xefff2e=this['currentContext']||this['initialContext'];this['_handleQuery'](_0x362e8a,_0xefff2e,'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:_0x3c8ef9,query:_0x2d2222,htmlContent:_0x4b87d0,label:_0xe7be41,mainActionLabel:_0x2627c4}){this['view']['prompt']=_0xe7be41,this['view']['mainAction']=_0x2627c4,this['initialContext']=_0x4b87d0,_0x2d2222&&(this['view']['isRendered']?this['_handleQuery'](_0x2d2222,_0x4b87d0,_0x3c8ef9,_0xe7be41):this['view']['once']('render',()=>{this['_handleQuery'](_0x2d2222,_0x4b87d0,_0x3c8ef9,_0xe7be41);}));}['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'](_0x5a3806,_0x74cf6f,_0x59200e,_0x56c155){return this['isProcessing']=!0x0,this['view']['startProcessing'](),this['previousContext']=_0x74cf6f,this['previousQuery']=_0x5a3806,this['previousLabel']=_0x56c155||_0x5a3806,this['previousActionId']=_0x59200e,new Promise(_0x558e0b=>{this['textAdapter']['makeRequest']({'query':_0x5a3806,'context':_0x74cf6f,'onData':_0x21ad19=>{this['currentResponse']=_0x21ad19,this['currentContext']=this['_parseAndNormalizeContent'](this['currentResponse']);},'actionId':_0x59200e})['then'](()=>{!this['currentContext']&&this['currentResponse']&&(this['currentContext']=this['_parseAndNormalizeContent'](this['currentResponse'],!0x0));})['catch'](_0x310b08=>{_0x310b08 instanceof Oi?this['view']['handleError'](_0x310b08['message']):this['view']['handleError'](),_0x558e0b();})['finally'](()=>{this['stopProcessing'](),_0x558e0b();});});}['_parseAndNormalizeContent'](_0x198e0d,_0x4c6079=!0x1){const _0x34d1ff=yi['exec'](_0x198e0d);_0x198e0d=_0x34d1ff?_0x198e0d['substring'](_0x34d1ff[0x1]['length']):_0x198e0d['length']<0x64&&!_0x4c6079?'':this['_stripMarkdownSyntax'](_0x198e0d);const _0x188f55=this['_domParser']['parseFromString'](_0x198e0d,'text/html');if(_0x34d1ff){const _0x53d717=Array['from'](_0x188f55['body']['childNodes']);_0x53d717['reverse']();for(const _0x40cf60 of _0x53d717){if(_0x40cf60['nodeType']==Node['ELEMENT_NODE'])break;_0x40cf60['remove']();}}const _0x1f65d8=this['editor']['data']['processor']['toView'](this['_xmlSerializer']['serializeToString'](_0x188f55['body']));this['_isH1TagSupportEnabled']()||this['_normalizeResponseHeadings'](_0x1f65d8);const _0x4d8777=this['editor']['config']['get']('ai.assistant.preserveComments'),_0x4a0298=this['editor']['data']['toModel'](_0x1f65d8);return _0x4d8777||_0x4a0298['markers']['clear'](),this['editor']['data']['stringify'](_0x4a0298);}['_normalizeResponseHeadings'](_0x2f8d2e){const _0x5e9f95=new _0x3325a1(this['editor']['editing']['view']['document']),_0x560946=new _0x1a1650({'name':/^h[1-5]$/}),_0x1a5195=[];let _0x105c8c=!0x1;for(const _0x32b1dc of _0x2f8d2e)_0x32b1dc['is']('element')&&_0x560946['match'](_0x32b1dc)&&(_0x1a5195['push'](_0x32b1dc),'h1'==_0x32b1dc['name']&&(_0x105c8c=!0x0));if(_0x105c8c){for(const _0x469bf4 of _0x1a5195)_0x5e9f95['rename']('h'+(parseInt(_0x469bf4['name'][0x1])+0x1),_0x469bf4);}}['_isH1TagSupportEnabled'](){const {data:_0x33605b,editing:_0x16cb0a}=this['editor'],_0x41c437=_0x33605b['htmlProcessor']['toView']('<h1></h1>'),_0x430485=_0x33605b['toView'](_0x33605b['toModel'](_0x41c437));return!!_0x16cb0a['view']['domConverter']['viewToDom'](_0x430485)['querySelector']('h1');}['_sanitizeHTML'](_0x475d6d){return this['editor']['editing']['view']['domConverter']['setContentOf'](this['_sanitizationContainer'],_0x475d6d),this['_sanitizationContainer']['innerHTML'];}['_stripMarkdownSyntax'](_0x5bab90){const _0x3d45a6=_0x5bab90['trim']();return _0x3d45a6['startsWith']('```html')?_0x3d45a6['endsWith']('```')?_0x3d45a6['substring'](0x7,_0x3d45a6['length']-0x3):_0x3d45a6['substring'](0x7):_0x5bab90;}}const Li={'REPLACE':'replace','INSERT':'insert'};class Di extends kt{constructor(_0x272f08){super(_0x272f08),this['set']('isVisible',!0x1),this['set']('mainAction',Li['REPLACE']),this['replaceButton']=this['_createButton']('','ck-button-action'),this['replaceButton']['bind']('label')['to'](this,'mainAction',_0x737c3e=>ki(_0x272f08,'AI_'+_0x737c3e['toUpperCase']()+'_CONTENT')),this['insertButton']=this['_createButton'](ki(_0x272f08,'Insert\x20below')),this['tryAgainButton']=this['_createButton'](ki(_0x272f08,'Try\x20again')),this['stopButton']=this['_createButton'](ki(_0x272f08,'Stop'));const _0x45379b=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':['ck-ai-form__toolbar',_0x45379b['if']('isVisible','ck-hidden',_0x17c5d5=>!_0x17c5d5)]}}),this['items']['addMany']([this['replaceButton'],this['insertButton'],this['tryAgainButton'],this['stopButton']]);}['_createButton'](_0x4eb24e,_0x208684){const _0x4cd226=new Nt(this['locale']);return _0x4cd226['set']({'label':_0x4eb24e,'class':_0x208684||'','isVisible':!0x0,'withText':!0x0}),_0x4cd226;}}class Pi extends vt{['contentFieldView'];['copyButtonView'];constructor(_0x5210e5,_0x51c31e=''){super(_0x5210e5),this['set']({'value':null,'isVisible':!0x1,'isProcessing':!0x1});const _0x37724e=this['bindTemplate'];this['contentFieldView']=new Hi(_0x5210e5,_0x51c31e),this['copyButtonView']=this['_createCopyButton'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area-wrapper',_0x37724e['if']('isVisible','ck-hidden',_0x43ebb4=>!_0x43ebb4)],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area',_0x37724e['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 _0x52e026=!0x1;this['on']('change:value',(_0x40a0e2,_0x38069b,_0x554327)=>{const _0x474f62=!this['contentFieldView']['element']['querySelector']('.ck-ai-form__loader');this['contentFieldView']['setContent'](_0x554327),this['isProcessing']&&_0x474f62&&!_0x52e026&&this['element']['scrollTo']({'top':this['element']['scrollHeight'],'behavior':'smooth'});}),this['on']('change:isProcessing',(_0x16d219,_0x361fcf,_0x1c85c8)=>{_0x52e026=!0x1,_0x1c85c8?(this['value']=null,this['contentFieldView']['appendLoader']()):this['value']||this['contentFieldView']['setContent']('');}),this['listenTo'](this['element'],'wheel',()=>{_0x52e026=!0x0;}),this['listenTo'](this['element'],'mousedown',()=>{_0x52e026=!0x0;});}['focus'](){this['element']['focus']();}['_createCopyButton'](){const _0x44be04=this['locale'],_0x38cc30=new Nt(this['locale']),_0x4a4588='ck-ai-form__copy-button';return _0x38cc30['set']({'label':ki(_0x44be04,'Copy'),'icon':_0x2eaf4b,'class':_0x4a4588,'tooltip':!0x0}),_0x38cc30['bind']('isVisible')['to'](this,'value',_0x2003fc=>!!_0x2003fc),_0x38cc30['bind']('isEnabled')['to'](this,'isProcessing',_0xaf352d=>!_0xaf352d),_0x38cc30['on']('execute',()=>{this['_copyHTMLToClipboard'](this['contentFieldView']['element']),_0x38cc30['icon']=_0x463a41,_0x38cc30['class']=_0x4a4588+'\x20ck-ai-form__copy-button--copied',this['focus'](),setTimeout(()=>{_0x38cc30['icon']=_0x2eaf4b,_0x38cc30['class']=_0x4a4588;},0x3e8);}),_0x38cc30;}['_copyHTMLToClipboard'](_0x5382e4){const {window:_0x513eeb,document:_0x53b8e1}=ct;if(_0x513eeb['ClipboardItem']){const {Blob:_0x33c4bf,ClipboardItem:_0x1ac2a4}=_0x513eeb,_0x1e2809=[new _0x1ac2a4({'text/html':new _0x33c4bf([_0x5382e4['innerHTML']],{'type':'text/html'}),'text/plain':new _0x33c4bf([_0x5382e4['textContent']||''],{'type':'text/plain'})})];navigator['clipboard']['write'](_0x1e2809);}else{const _0x3e9cd4=_0x53b8e1['createElement']('div');_0x3e9cd4['style']['position']='absolute',_0x3e9cd4['style']['left']='-9999px',_0x3e9cd4['innerHTML']='<span>[</span>'+_0x5382e4['innerHTML']+'<span>]</span>',_0x53b8e1['body']['appendChild'](_0x3e9cd4);const _0x10a4de=_0x53b8e1['createRange']();_0x10a4de['setStartAfter'](_0x3e9cd4['firstElementChild']),_0x10a4de['setEndBefore'](_0x3e9cd4['lastElementChild']);const _0x4182db=_0x513eeb['getSelection']();_0x4182db['removeAllRanges'](),_0x4182db['addRange'](_0x10a4de),_0x53b8e1['execCommand']('copy'),_0x3e9cd4['remove']();}}}class Hi extends vt{constructor(_0x281b7c,_0xe6cd38=''){super(_0x281b7c),this['loaderView']=this['_createLoader'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-content',_0xe6cd38,'ck-reset_all-excluded','ck-ai-form__content-field']}});}['setContent'](_0x182880){this['element']['innerHTML']=_0x182880;}['appendLoader'](){this['element']['appendChild'](this['loaderView']['element']);}['_createLoader'](){const _0x4a1416=new vt(),_0x4bffa2=this['locale'],_0x33c631=new yt();return _0x33c631['isVisible']=!0x0,_0x4a1416['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__loader']},'children':[_0x33c631,{'text':ki(_0x4bffa2,'AI\x20is\x20writing...')}]}),_0x4a1416['render'](),_0x4a1416;}}class Mi extends vt{constructor(_0x396fb9,_0x488024=''){super(_0x396fb9);const _0x1125b0=new xt(),_0x872c26=this['bindTemplate'];this['set']('text',_0x488024),_0x1125b0['content']=_0x5440ed,this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__error']},'children':[_0x1125b0,{'text':_0x872c26['to']('text')}]});}}class Ui extends Lt{['submitButtonView'];['showHistoryButtonView'];constructor(_0x336da4,_0x3f1297){super(_0x336da4,_0x3f1297),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',(_0x4cc8a5,_0x29ce79)=>{_0x4cc8a5['target']==this['queryView']['fieldView']['element']&&(this['submit'](),_0x29ce79());});}['_createSubmitButton'](){const _0xa59466=new Nt(this['locale']),_0x5693d6=this['locale'];return _0xa59466['set']({'icon':_0x178bba,'label':ki(_0x5693d6,'Submit'),'isVisible':!0x0,'tooltip':!0x0,'class':'ck-ai-form__submit'}),_0xa59466['on']('execute',()=>{this['submit']();}),_0xa59466['bind']('isEnabled')['to'](this['queryView']['fieldView'],'isEmpty',this,'isEnabled',(_0x483af6,_0x3f8c76)=>!_0x483af6&&_0x3f8c76),_0xa59466;}['_createShowHistoryButton'](){const _0x32cd55=new Nt(this['locale']),_0x26d87c=this['resultsView'],_0x5d3df5=this['locale'];_0x32cd55['set']({'label':ki(_0x5d3df5,'History'),'withText':!0x1,'icon':_0x21b500,'tooltip':!0x0,'tooltipPosition':'sw','class':'ck-ai-form__toggle-history'}),_0x32cd55['bind']('isOn')['to'](_0x26d87c,'isVisible'),_0x32cd55['bind']('isEnabled')['to'](this,'isEnabled'),_0x32cd55['on']('execute',()=>{_0x26d87c['isVisible']=!_0x26d87c['isVisible'],_0x26d87c['isVisible']?this['filteredView']['focus']():this['focus']();});const _0x2b5468=()=>{ct['window']['requestAnimationFrame'](()=>{if(lt(this['element'])){const _0x22a258=new ut(this['queryView']['fieldView']['element']),_0x60579=_0x22a258['width'],_0x9433e7='rtl'===_0x5d3df5['uiLanguageDirection']?'left':'right';_0x22a258['excludeScrollbarsAndBorders'](),_0x32cd55['element']['style'][_0x9433e7]=_0x60579-_0x22a258['width']+0x1+'px';}});};return this['queryView']['fieldView']['on']('update',_0x2b5468),this['on']('render',_0x2b5468),_0x32cd55;}['submit'](){const _0x4d3f9b=this['queryView']['fieldView']['element']['value'];this['fire']('submit',_0x4d3f9b);}['focus'](_0x4d2e06){-0x1===_0x4d2e06?this['focusCycler']['focusLast']():this['focusCycler']['focusFirst']();}}class Vi extends Dt{['historyGroupView'];['clearHistoryButton'];constructor(_0x50d779){super(_0x50d779),this['clearHistoryButton']=this['_createClearHistoryButton'](),this['historyGroupView']=new Pt(),this['historyGroupView']['children']['add'](this['clearHistoryButton'],0x1),this['historyGroupView']['label']=ki(_0x50d779,'Prompt\x20history'),this['historyGroupView']['items']['delegate']('execute')['to'](this),this['items']['add'](this['historyGroupView']);}['filter'](){let _0x4929e7=0x0;for(const _0x4daba4 of this['items'])_0x4929e7+=_0x4daba4['items']['length'];return{'resultsCount':_0x4929e7,'totalItemsCount':_0x4929e7};}['_createClearHistoryButton'](){const _0x55bd14=this['locale'],_0x42b962=new Nt(this['locale']);return _0x42b962['set']({'label':'('+ki(_0x55bd14,'Clear')+')','withText':!0x0}),_0x42b962['on']('execute',()=>this['fire']('clearHistory')),_0x42b962;}}class Bi extends Ht{constructor(_0x1ae91a){super();const _0x48e5c7=new Mt(),_0x5b6e02=new Nt(this['locale'],_0x48e5c7);this['children']['add'](_0x5b6e02),_0x5b6e02['set']({'label':_0x1ae91a['prompt'],'withText':!0x0}),_0x5b6e02['on']('execute',()=>{this['fire']('execute',{'value':_0x124e87(_0x1ae91a['prompt'])});});}}const Gi='CKEditor/AIFormView/PromptHistory';class Fi extends dt{constructor(){super(),this['_loadFromSessionStorage'](),this['on']('add',(_0x213d64,_0x377db5)=>{const _0xe48522=Ki(_0x377db5['prompt']);for(const _0x123c92 of this)if(_0x123c92!=_0x377db5&&Ki(_0x123c92['prompt'])===_0xe48522){this['remove'](_0x123c92);break;}this['length']>0x14&&this['remove'](this['last']),this['_saveToSessionStorage']();}),this['on']('remove',()=>{this['_saveToSessionStorage']();});}['_loadFromSessionStorage'](){const _0x34d541=sessionStorage['getItem'](Gi)||'[]';this['addMany'](JSON['parse'](_0x34d541));}['_saveToSessionStorage'](){sessionStorage['setItem'](Gi,JSON['stringify'](this['map'](_0xe80dec=>_0xe80dec)));}}function Ki(_0x2b1665){return _0x2b1665['toLowerCase']()['trim']();}class Wi extends vt{['focusTracker'];['keystrokes'];['contentArea'];['toolbar'];['promptView'];['errorView'];['_focusables'];['focusCycler'];['_promptHistory'];constructor(_0x1353ec,_0x47ac4d,_0x3d2835=''){super(_0x1353ec),this['set']('isEnabled',!0x0),this['set']('isProcessing',!0x1),this['set']('prompt',''),this['set']('value',''),this['set']('isError',!0x1),this['set']('mainAction',Li['REPLACE']),this['_promptHistory']=new Fi(),this['errorView']=new Mi(_0x1353ec),this['contentArea']=new Pi(_0x1353ec,_0x3d2835),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 Ut({'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 _0x30f743=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form',_0x47ac4d],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-form-content']},'children':[{'tag':'div','attributes':{'class':[_0x30f743['if']('isError','ck-hidden',_0x527cc3=>!_0x527cc3)]},'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'](_0xef7143=0x1){-0x1===_0xef7143?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 _0x1a8bd5=this['locale'],_0x375fed=new Ui(_0x1a8bd5,{'queryView':{'label':ki(_0x1a8bd5,'Ask\x20AI\x20to\x20edit\x20or\x20generate'),'creator':Vt,'showIcon':!0x1,'showResetButton':!0x1},'infoView':{'text':{'noSearchableItems':{'primary':ki(_0x1a8bd5,'Empty\x20history'),'secondary':ki(_0x1a8bd5,'Ask\x20AI\x20and\x20your\x20prompts\x20will\x20be\x20listed\x20here\x20for\x20you\x20to\x20use\x20later.')}}},'filteredView':this['_createHistoryView'](),'queryMinChars':0x1/0x0,'resetOnBlur':!0x1});return _0x375fed['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',(_0x2eff9f,_0x45332e)=>_0x2eff9f&&!_0x45332e),this['listenTo'](_0x375fed,'submit',(_0x1b1139,_0x2bde79)=>{this['prompt']=_0x2bde79;const _0x2fb1b4=_0x34635c(_0x2bde79);this['fire']('submitPrompt',_0x2fb1b4),_0x2bde79['trim']()&&this['_promptHistory']['add']({'prompt':_0x2fb1b4},0x0);},{'priority':'high'}),_0x375fed;}['_createHistoryView'](){const _0x56bb92=new Vi(this['locale']);return _0x56bb92['historyGroupView']['items']['bindTo'](this['_promptHistory'])['as'](Bi),_0x56bb92['on']('clearHistory',()=>{this['_promptHistory']['clear'](),this['promptView']['search'](''),this['promptView']['focus']();}),_0x56bb92;}['_createToolbar'](){const _0x288798=new Di(this['locale']);return _0x288798['replaceButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',this,'value',(_0x4d782f,_0x2a9bcd,_0x3e3200)=>_0x4d782f&&!_0x2a9bcd&&!!_0x3e3200),_0x288798['replaceButton']['delegate']('execute')['to'](this,'replaceContent'),_0x288798['insertButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',this,'value',(_0x5cda25,_0x5d74e6,_0x10d87f)=>_0x5cda25&&!_0x5d74e6&&!!_0x10d87f),_0x288798['insertButton']['delegate']('execute')['to'](this,'insertContentBelow'),_0x288798['tryAgainButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',(_0x366f63,_0x694074)=>_0x366f63&&!_0x694074),_0x288798['tryAgainButton']['delegate']('execute')['to'](this,'tryAgainEvent'),_0x288798['stopButton']['bind']('isEnabled')['to'](this,'isProcessing'),_0x288798['stopButton']['delegate']('execute')['to'](this,'stopProcessing'),_0x288798;}['startProcessing'](){this['value']='',this['isError']=!0x1,this['isProcessing']=!0x0,this['contentArea']['isVisible']=!0x0,this['toolbar']['isVisible']=!0x0,this['contentArea']['focus']();}['finishProcessing'](){const _0x2e5ef9=this['locale'];this['isProcessing']=!0x1,this['prompt']='',this['promptView']['reset'](),this['value']&&(this['promptView']['queryView']['label']=ki(_0x2e5ef9,'Ask\x20AI\x20to\x20improve\x20generated\x20text'));}['handleError'](_0x2bdadb){const _0x5d56e8=this['locale'];this['finishProcessing'](),this['isError']=!0x0,this['errorView']['text']=_0x2bdadb||ki(_0x5d56e8,'AI_ERROR_FAILED'),this['value']||(this['contentArea']['isVisible']=!0x1);}}const Yi=globalThis['DataTransfer'];class $i extends _0x530ddf{['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[_0x56c8ae,Si,Ri,Bt];}constructor(_0x20e311){super(_0x20e311),_0x20e311['config']['define']('ai.assistant.disabledElements',['media','rawHtml','tableOfContents']),_0x20e311['config']['define']('ai.assistant.contentAreaCssClass',''),_0x20e311['config']['define']('ai.assistant.useTheme',!0x0),this['_uiCssClasses']='ck-ai-assistant-ui'+(_0x20e311['config']['get']('ai.assistant.useTheme')?'\x20ck-ai-assistant-ui_theme':'');}['init'](){const {editor:_0x5356cb}=this;this['_aiAdapter']=_0x5356cb['plugins']['get'](Ri),this['_dialog']=_0x5356cb['plugins']['get'](Bt),this['_formView']=null,this['_commandDefinitions']=this['_getResolvedCommandsDefinitions']();const _0x4e57da=new Ni(_0x5356cb,Array['from'](this['_commandDefinitions']['values']()));_0x5356cb['commands']['add']('showAIAssistant',_0x4e57da),_0x5356cb['ui']['componentFactory']['add']('aiCommands',_0x5e4503=>{const _0x551ae2=Gt(_0x5e4503);return _0x551ae2['set']({'class':'ck-ai-commands-dropdown\x20'+this['_uiCssClasses']}),_0x551ae2['buttonView']['set']({'label':ki(_0x5e4503,'AI\x20Commands'),'icon':_0x11f706,'tooltip':!0x0}),_0x551ae2['on']('execute',_0x453a92=>this['_onExecute'](_0x453a92['source']['id'])),Ft(_0x551ae2,_0x5356cb['ui']['view']['body'],function(_0x31b148){const _0x51a722=wi(_0x31b148['config']['get']('ai.assistant.commands'),_0x31b148['locale']),_0x56b1b1=Qi(_0x31b148,_0x51a722)['filter'](_0x206cac=>_0x206cac['commands']['length']);if(0x1===_0x56b1b1['length'])return Qi(_0x31b148,_0x56b1b1[0x0]['commands'])['map'](_0x249d25=>({'id':_0x249d25['id'],'label':_0x249d25['label']}));return _0x56b1b1['map'](_0x1304c3=>{const {groupId:_0x645677,groupLabel:_0x2fdd7b,commands:_0x5f51c9}=_0x1304c3,_0xfece1a=Qi(_0x31b148,_0x5f51c9)['map'](_0x7864db=>({'id':_0x7864db['id'],'label':_0x7864db['label']}));return{'id':_0x645677,'menu':_0x2fdd7b||_0x645677,'children':_0xfece1a};});}(_0x5356cb),{'ariaLabel':ki(_0x5e4503,'AI\x20Commands')}),_0x551ae2['menuView']['menuPanelClass']='ck-ai-commands-dropdown\x20'+this['_uiCssClasses'],_0x4e57da['on']('change:enabledCommandsIds',_0x3b2e1d),_0x551ae2['menuView']['once']('render',_0x3b2e1d),_0x551ae2;function _0x3b2e1d(){_0x551ae2['isEnabled']=_0x4e57da['enabledCommandsIds']['length']>0x0;for(const _0x4a46cc of _0x551ae2['menuView']['buttons'])_0x4a46cc['isEnabled']=_0x4e57da['enabledCommandsIds']['includes'](_0x4a46cc['id']);}}),_0x5356cb['ui']['componentFactory']['add']('menuBar:aiCommands',_0x70612=>{const _0x20da60=new Kt(_0x70612);_0x20da60['buttonView']['set']({'label':ki(_0x70612,'AI\x20Commands'),'icon':_0x11f706}),_0x20da60['bind']('isEnabled')['to'](_0x4e57da,'enabledCommandsIds',_0x54d578=>_0x54d578['length']>0x0);const _0x533def=wi(_0x5356cb['config']['get']('ai.assistant.commands'),_0x70612);return this['_populateMenuBarMenu'](_0x4e57da,_0x20da60,_0x533def,_0x3dca03=>this['_onExecute'](_0x3dca03)),_0x20da60;}),_0x5356cb['ui']['componentFactory']['add']('aiAssistant',()=>{const _0x233452=this['_createAIAssistantUIButton'](Nt);return _0x233452['set']({'tooltip':!0x0,'class':'ck-ai-assistant-button\x20'+this['_uiCssClasses']}),_0x233452;}),_0x5356cb['ui']['componentFactory']['add']('menuBar:aiAssistant',()=>{const _0x41ac41=this['_createAIAssistantUIButton'](Wt);return _0x41ac41['set']({'role':'menuitemcheckbox'}),_0x41ac41;}),this['licenseKey']=this['editor']['config']['get']('licenseKey');const _0x2627db=this['editor'];this['_licenseKeyCheckInterval']=setInterval(()=>{let _0x15b1bb;for(const _0x93d374 in _0x2627db){const _0x4ab7e8=_0x93d374,_0x250c96=_0x2627db[_0x4ab7e8];if('aiLicenseKeyValid'==_0x250c96||'aiLicenseKeyInvalid'==_0x250c96||'aiLicenseKeyExpired'==_0x250c96||'aiLicenseKeyDomainLimit'==_0x250c96||'aiLicenseKeyNotAllowed'==_0x250c96||'aiLicenseKeyEvaluationLimit'==_0x250c96||'aiLicenseKeyUsageLimit'==_0x250c96){delete _0x2627db[_0x4ab7e8],_0x15b1bb=_0x250c96,clearInterval(this['_licenseKeyCheckInterval']),this['_licenseKeyCheckInterval']=void 0x0;break;}}'aiLicenseKeyInvalid'==_0x15b1bb&&_0x2627db['_showLicenseError']('invalid'),'aiLicenseKeyExpired'==_0x15b1bb&&_0x2627db['_showLicenseError']('expired'),'aiLicenseKeyDomainLimit'==_0x15b1bb&&_0x2627db['_showLicenseError']('domainLimit'),'aiLicenseKeyNotAllowed'==_0x15b1bb&&_0x2627db['_showLicenseError']('featureNotAllowed','AIAssistant'),'aiLicenseKeyEvaluationLimit'==_0x15b1bb&&_0x2627db['_showLicenseError']('evaluationLimit'),'aiLicenseKeyUsageLimit'==_0x15b1bb&&_0x2627db['_showLicenseError']('usageLimit');},0x3e8);}['destroy'](){super['destroy'](),this['_licenseKeyCheckInterval']&&clearInterval(this['_licenseKeyCheckInterval']);}['showUI'](_0x4f685a='',_0x57db4f='',_0x5d1d9f='custom'){const _0x2fe92d=this['editor'],_0x38156b=_0x2fe92d['editing']['view'],_0x2039c1=_0x2fe92d['plugins']['get'](Si),_0x22b016=_0x2fe92d['plugins']['get'](_0x56c8ae);_0x2039c1['showFakeVisualSelection']();const _0x39623c=new Yi(),_0x5166eb=new ClipboardEvent('copy',{'clipboardData':_0x39623c}),_0x261f93=new _0x1cf31a(_0x39623c),_0x41cbd7=new _0x48bc3b(_0x38156b,_0x5166eb,{'dataTransfer':_0x261f93});_0x22b016['_forceMarkersCopy']('comment',()=>{_0x38156b['document']['fire']('copy',_0x41cbd7);}),this['_formView']||(this['_initView'](),this['_aiAssistantController']=new xi(_0x2fe92d,this['_aiAdapter']['textAdapter'],this['_formView']));let _0x252d70=_0x261f93['getData']('text/html');const _0x1a9f27=_0x2fe92d['model']['document']['selection'],_0x1030e5=Array['from'](_0x1a9f27['getRanges']());0x1===_0x1030e5['length']&&_0x1030e5[0x0]['isFlat']&&!_0x1a9f27['getSelectedElement']()&&''!==_0x252d70['replace'](/&nbsp;/g,'')['trim']()&&(_0x252d70='<p>'+_0x252d70+'</p>'),this['_aiAssistantController']['updateView']({'actionId':_0x5d1d9f,'query':_0x4f685a,'htmlContent':_0x252d70,'label':_0x57db4f,'mainActionLabel':Li[_0x2fe92d['model']['document']['selection']['isCollapsed']?'INSERT':'REPLACE']}),'aiAssistant'!==this['_dialog']['id']?this['_dialog']['show']({'id':'aiAssistant','icon':_0x1f85f6,'title':ki(this['editor']['locale'],'AI\x20Assistant'),'content':this['_formView'],'position':Yt['EDITOR_TOP_SIDE'],'onShow':()=>{this['_formView']['focus']();},'onHide':()=>{this['_aiAssistantController']['reset'](),_0x2039c1['hideFakeVisualSelection']();}}):this['_dialog']['view']['wasMoved']||this['_dialog']['view']['updatePosition']();}['hideUI'](){this['_dialog']['hide']();}['_getResolvedCommandsDefinitions'](){const _0x7a9d41=new Map(),_0x4e6dc3=wi(this['editor']['config']['get']('ai.assistant.commands'),this['editor']['locale']);for(const _0x5c28cf of _0x4e6dc3)for(const _0x38296f of _0x5c28cf['commands'])_0x7a9d41['set'](_0x38296f['id'],{..._0x38296f,'groupId':_0x5c28cf['groupId'],'groupLabel':_0x5c28cf['groupLabel']||_0x5c28cf['groupId']});return _0x7a9d41;}['_createAIAssistantUIButton'](_0x3389f7){const _0x221aed=this['editor'],_0x362eab=_0x221aed['commands']['get']('showAIAssistant'),_0x304a37=new _0x3389f7(_0x221aed['locale']);return _0x304a37['set']({'label':ki(_0x221aed['locale'],'AI\x20Assistant'),'icon':_0x1f85f6,'isToggleable':!0x0}),_0x304a37['bind']('isEnabled')['to'](_0x362eab),_0x304a37['bind']('isOn')['to'](this['_dialog'],'id',_0x38d81d=>'aiAssistant'===_0x38d81d),this['listenTo'](_0x304a37,'execute',()=>{_0x304a37['isOn']?this['hideUI']():_0x362eab['execute']();}),_0x304a37;}['_initView'](){const _0x592408=this['editor']['plugins']['get'](Si);this['_formView']=new Wi(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',()=>{_0x592408['insertContent'](this['_aiAssistantController']['currentContext']),this['hideUI']();}),this['listenTo'](this['_formView'],'insertContentBelow',()=>{_0x592408['insertContentBelow'](this['_aiAssistantController']['currentContext']),this['hideUI']();}),this['_initAriaAiStatusChangeAnnouncements']();}['_initAriaAiStatusChangeAnnouncements'](){const {locale:_0x566381,ui:{ariaLiveAnnouncer:_0x1075d6}}=this['editor'];this['_formView']['contentArea']['on']('change:isProcessing',(_0x422e09,_0x1f675e,_0x9981ed)=>{const _0x2a058c=this['_aiAssistantController']['currentContext'];_0x9981ed?_0x1075d6['announce'](ki(_0x566381,'AI\x20is\x20writing')):_0x2a058c&&_0x1075d6['announce'](ki(_0x566381,'Generated\x20content:\x20%0',_0x2a058c),{'politeness':'polite','isUnsafeHTML':!0x0});}),this['_formView']['on']('change:isError',(_0x2f6923,_0x494498,_0x52735e)=>{if(_0x52735e){const _0xe1729c=this['_formView']['errorView']['text'];_0x1075d6['announce'](ki(_0x566381,'Error\x20during\x20AI\x20content\x20generation:\x20%0',_0xe1729c));}});}['_onExecute'](_0x21f0f5){const _0xa38851=this['_commandDefinitions']['get'](_0x21f0f5),_0x5270d3=this['editor'],_0x11a2c6=_0x5270d3['model']['document']['selection'],_0x34d9a7=_0x5270d3['commands']['get']('showAIAssistant'),_0x305341=_0x5270d3['plugins']['get'](Si),_0x41493d=''+(_0xa38851['groupId']!==Ci?_0xa38851['groupLabel']+':\x20':'')+_0xa38851['label'];if(!0x1!==_0xa38851['requiresContent']&&_0x11a2c6['isCollapsed']){const _0x2a1372=At(_0x11a2c6['getSelectedBlocks']())||_0x5270d3['model']['schema']['getLimitElement'](_0x11a2c6);_0x5270d3['model']['change'](_0x21c810=>{_0x21c810['setSelection'](_0x2a1372,'in');});}_0x305341['showFakeVisualSelection'](),_0x34d9a7['execute'](_0xa38851['prompt'],_0x41493d,'command:'+_0x21f0f5);}['_populateMenuBarMenu'](_0x4c75be,_0x817c60,_0x4165ed,_0x502e65){const _0x16ab8b=this['editor'],_0x30cd65=_0x16ab8b['locale'],_0x485d75=new $t(_0x30cd65),_0x457bed=Qi(_0x16ab8b,_0x4165ed)['filter'](_0x2942c5=>_0x2942c5['commands']['length']);0x1===_0x457bed['length']?this['_getMenuBarGroupButtons']({'command':_0x4c75be,'commands':_0x457bed[0x0]['commands'],'parentMenuView':_0x817c60,'onExecute':_0x502e65})['forEach'](_0x2f2411=>_0x485d75['items']['add'](_0x2f2411)):_0x457bed['forEach'](({groupId:_0x3744f2,groupLabel:_0x2096a2,commands:_0x5a9404})=>{const _0xb63ce8=new qt(_0x30cd65,_0x817c60),_0x1a1a41=new Kt(_0x30cd65),_0x3c7f40=new $t(_0x30cd65),_0x4fe433=this['_getMenuBarGroupButtons']({'command':_0x4c75be,'commands':_0x5a9404,'parentMenuView':_0x1a1a41,'onExecute':_0x502e65});_0x1a1a41['buttonView']['set']({'label':_0x2096a2||_0x3744f2}),_0x1a1a41['delegate']('execute')['to'](_0x817c60),_0x3c7f40['items']['addMany'](_0x4fe433),_0x1a1a41['panelView']['children']['add'](_0x3c7f40),_0xb63ce8['children']['add'](_0x1a1a41),_0x485d75['items']['add'](_0xb63ce8);}),_0x817c60['panelView']['children']['add'](_0x485d75);}['_getMenuBarGroupButtons']({command:_0x5bd3b1,commands:_0xde115a,parentMenuView:_0x88bff5,onExecute:_0x25380d}){const _0x1d1ac1=this['editor'],_0xdffcf7=_0x1d1ac1['locale'];return Qi(_0x1d1ac1,_0xde115a)['map'](_0x4c4022=>{const _0x334a53=new qt(_0xdffcf7,_0x88bff5),_0x3a4478=new Wt(_0xdffcf7);return _0x3a4478['set']({'label':_0x4c4022['label']}),_0x3a4478['delegate']('execute')['to'](_0x88bff5),_0x3a4478['on']('execute',()=>_0x25380d(_0x4c4022['id'])),_0x3a4478['bind']('isEnabled')['to'](_0x5bd3b1,'enabledCommandsIds',_0x4ab8e8=>_0x4ab8e8['includes'](_0x4c4022['id'])),_0x334a53['children']['add'](_0x3a4478),_0x334a53;});}}function qi(_0xfc385f,_0x48c592){return void 0x0!==_0xfc385f['order']&&void 0x0===_0x48c592['order']?0x1:void 0x0===_0xfc385f['order']&&void 0x0!==_0x48c592['order']?-0x1:void 0x0!==_0xfc385f['order']&&void 0x0!==_0x48c592['order']?_0xfc385f['order']-_0x48c592['order']:0x0;}function Qi(_0x5f1d90,_0x57fc04){_0x57fc04['sort'](qi);const _0x2da4df={},_0x256e04=[];for(const _0x5be385 of _0x57fc04)if(void 0x0!==_0x5be385['order']){if(_0x5be385['order']in _0x2da4df)throw new at('ai-commands-config-order-collision',_0x5f1d90,{'conflictingDefinitions':[_0x5be385,_0x2da4df[_0x5be385['order']]]});_0x2da4df[_0x5be385['order']]=_0x5be385,_0x256e04['splice'](_0x5be385['order'],0x0,_0x5be385);}else _0x256e04['push'](_0x5be385);return _0x256e04;}class Xi extends _0x530ddf{static get['requires'](){return[$i,Si];}static get['pluginName'](){return'AIAssistant';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x2a4ece){super(_0x2a4ece);const _0x2727c9=_0x2a4ece['config'],_0x101272=_0x2a4ece['locale'];_0x2727c9['define']('ai.assistant.preserveComments',!0x0),_0x2727c9['define']('ai.assistant.commands',zi(_0x101272)),_0x2727c9['define']('ai.assistant.extraCommandGroups',[]),_0x2727c9['define']('ai.assistant.removeCommands',[]);let _0x594e9c=wi(_0x2727c9['get']('ai.assistant.commands'),_0x101272);const _0x2a411e=_0x2727c9['get']('ai.assistant.extraCommandGroups'),_0x3f5811=_0x2727c9['get']('ai.assistant.removeCommands');_0x2a411e['forEach'](_0xe89811=>{const _0x5c3514=_0x594e9c['find'](_0x6a95e9=>_0x6a95e9['groupId']===_0xe89811['groupId']);_0x5c3514?_0x5c3514['commands']=_0x5c3514['commands']['concat'](_0xe89811['commands']):_0x594e9c['push'](_0xe89811);}),_0x594e9c=_0x594e9c['filter'](_0x45e8b8=>!_0x3f5811['includes'](_0x45e8b8['groupId'])),_0x594e9c['forEach'](_0x2cacb3=>{_0x2cacb3['commands']=_0x2cacb3['commands']['filter'](_0x563f48=>!_0x3f5811['includes'](_0x563f48['id']));}),_0x2727c9['set']('ai.assistant.commands',_0x594e9c);}}function zi(_0x8a338b){return[{'groupId':'editOrReview','groupLabel':ki(_0x8a338b,'Edit\x20or\x20review'),'commands':[{'id':'improveWriting','label':ki(_0x8a338b,'Improve\x20writing'),'prompt':'Fix\x20spelling\x20mistakes,\x20use\x20proper\x20grammar\x20and\x20apply\x20good\x20writing\x20practices.\x20Do\x20not\x20lose\x20the\x20original\x20meaning.'},{'id':'makeShorter','label':ki(_0x8a338b,'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':ki(_0x8a338b,'Make\x20longer'),'prompt':'Improve\x20this\x20content\x20by\x20using\x20descriptive\x20language\x20and\x20inserting\x20more\x20information\x20and\x20more\x20detailed\x20explanations.'},{'id':'simplifyLanguage','label':ki(_0x8a338b,'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':ki(_0x8a338b,'Generate\x20from\x20selection'),'commands':[{'id':'summarize','label':ki(_0x8a338b,'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':ki(_0x8a338b,'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':ki(_0x8a338b,'Change\x20tone'),'commands':[{'id':'professional','label':ki(_0x8a338b,'Professional'),'prompt':'Improve\x20using\x20polished,\x20formal,\x20and\x20respectful\x20language\x20to\x20convey\x20professional\x20expertise\x20and\x20competence.'},{'id':'casual','label':ki(_0x8a338b,'Casual'),'prompt':'Improve\x20using\x20casual,\x20informal\x20language\x20to\x20convey\x20a\x20casual\x20conversation\x20with\x20a\x20real\x20person.'},{'id':'direct','label':ki(_0x8a338b,'Direct'),'prompt':'Improve\x20using\x20direct\x20language,\x20using\x20only\x20the\x20essential\x20information.'},{'id':'confident','label':ki(_0x8a338b,'Confident'),'prompt':'Improve\x20using\x20compelling,\x20optimistic\x20language\x20to\x20convey\x20confidence\x20in\x20the\x20writing.'},{'id':'friendly','label':ki(_0x8a338b,'Friendly'),'prompt':'Improve\x20using\x20friendly,\x20comforting\x20language,\x20to\x20convey\x20understanding\x20and\x20empathy.'}]},{'groupId':'changeStyle','groupLabel':ki(_0x8a338b,'Change\x20style'),'commands':[{'id':'business','label':ki(_0x8a338b,'Business'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20business\x20professional\x20with\x20formal\x20language.'},{'id':'legal','label':ki(_0x8a338b,'Legal'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20legal\x20professional\x20using\x20valid\x20legal\x20terminology.'},{'id':'journalism','label':ki(_0x8a338b,'Journalism'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20journalist\x20using\x20engaging\x20language\x20to\x20convey\x20the\x20importance\x20of\x20the\x20information.'},{'id':'poetic','label':ki(_0x8a338b,'Poetic'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20poem\x20using\x20poetic\x20techniques\x20without\x20losing\x20the\x20original\x20meaning.'}]},{'groupId':'translate','groupLabel':ki(_0x8a338b,'Translate'),'commands':[{'id':'translateEnglish','label':ki(_0x8a338b,'English'),'prompt':'Translate\x20the\x20content\x20to\x20English\x20language.'},{'id':'translateSpanish','label':ki(_0x8a338b,'Spanish'),'prompt':'Translate\x20the\x20content\x20to\x20Spanish\x20language.'},{'id':'translatePortuguese','label':ki(_0x8a338b,'Portuguese'),'prompt':'Translate\x20the\x20content\x20to\x20Portuguese\x20language.'},{'id':'translateGerman','label':ki(_0x8a338b,'German'),'prompt':'Translate\x20the\x20content\x20to\x20German\x20language.'},{'id':'translateFrench','label':ki(_0x8a338b,'French'),'prompt':'Translate\x20the\x20content\x20to\x20French\x20language.'},{'id':'translateChinese','label':ki(_0x8a338b,'Simplified\x20Chinese'),'prompt':'Translate\x20the\x20content\x20to\x20Simplified\x20Chinese\x20language.'},{'id':'translateHindi','label':ki(_0x8a338b,'Hindi'),'prompt':'Translate\x20the\x20content\x20to\x20Hindi\x20language.'},{'id':'translateArabic','label':ki(_0x8a338b,'Arabic'),'prompt':'Translate\x20the\x20content\x20to\x20Arabic\x20language.'}]}];}class ji extends _0x530ddf{['abortController'];static get['requires'](){return[Ri];}constructor(_0x5c1b1e){super(_0x5c1b1e),this['abortController']=new AbortController();}['init'](){this['editor']['plugins']['get'](Ri)['textAdapter']=this;}['abort'](){this['abortController']['signal']['aborted']||(this['abortController']['abort'](),this['abortController']=new AbortController());}async['makeRequest'](_0x3cb33f){return this['sendRequest'](_0x3cb33f)['catch'](_0x447587=>{if(_0x447587 instanceof Oi)return Promise['reject'](_0x447587);if('AbortError'==_0x447587['name'])return Promise['resolve']();throw console['error'](_0x447587),new at('aitextadapter-send-request-failed',null);});}async['_prepareRequestHeaders'](_0xe904ef,_0x2caed7){const _0x47b370=this['editor']['locale'],_0x1a2d56={'Content-Type':'application/json'};if('object'==typeof _0xe904ef)Object['assign'](_0x1a2d56,_0xe904ef);else{if(_0xe904ef)try{const _0x75dcf2=await _0xe904ef(_0x2caed7);Object['assign'](_0x1a2d56,_0x75dcf2);}catch{return Promise['reject'](new Oi(ki(_0x47b370,'AI_ERROR_GET_HEADERS')));}}return _0x1a2d56;}async['_prepareRequestParameters'](_0x3aba11,_0x170fc8){const _0x553eac=this['editor']['locale'];if('object'==typeof _0x3aba11)return _0x3aba11;try{return await _0x3aba11(_0x170fc8);}catch{return Promise['reject'](new Oi(ki(_0x553eac,'AI_ERROR_GET_PARAMETERS')));}}}class Ji extends ji{['_apiUrl'];['_requestHeaders'];['_requestParameters'];static get['pluginName'](){return'OpenAITextAdapter';}constructor(_0x32084a){super(_0x32084a),_0x32084a['config']['define']('ai.assistant.adapter.openAI.apiUrl','https://api.openai.com/v1/chat/completions'),_0x32084a['config']['get']('ai.assistant.adapter.openAI.requestParameters')||_0x32084a['config']['define']('ai.assistant.adapter.openAI.requestParameters',{'model':'gpt-4o','temperature':0x1,'top_p':0x1,'stream':!0x0}),this['_apiUrl']=_0x32084a['config']['get']('ai.assistant.adapter.openAI.apiUrl'),this['_requestHeaders']=_0x32084a['config']['get']('ai.assistant.adapter.openAI.requestHeaders')||{},this['_requestParameters']=_0x32084a['config']['get']('ai.assistant.adapter.openAI.requestParameters');}async['sendRequest']({query:_0x2fb6c4,context:_0x5313b8,onData:_0x3a867f,actionId:_0x2f31e5}){const _0x3d5435=this['editor']['locale'],_0x4cadbf=await this['prepareMessages'](_0x2fb6c4,_0x5313b8,_0x2f31e5),_0x252f2c=await this['_prepareRequestHeaders'](this['_requestHeaders'],_0x2f31e5),_0x5aebcc=await this['_prepareRequestParameters'](this['_requestParameters'],_0x2f31e5),_0x113650={'messages':_0x4cadbf,..._0x5aebcc},_0x90ce92={'method':'POST','headers':_0x252f2c,'body':JSON['stringify'](_0x113650),'signal':this['abortController']['signal']},_0x38cc31=await fetch(this['_apiUrl'],_0x90ce92);if(_0x38cc31['ok'])return _0x5aebcc['stream']?await this['_readStreamableResponse'](_0x38cc31,_0x3a867f):await this['_readStaticResponse'](_0x38cc31,_0x3a867f),Promise['resolve']();{const _0xe19910=await _0x38cc31['text']();return _0xe19910['includes']('context_length_exceeded')?Promise['reject'](new Oi(ki(_0x3d5435,'AI_ERROR_CONTEXT_LENGTH'))):_0xe19910['includes']('Moderation')?Promise['reject'](new Oi(ki(_0x3d5435,'AI_ERROR_MODERATION'))):Promise['reject'](new Error(_0xe19910));}}async['prepareMessages'](_0x2b726a,_0x41ce4b,_0x523623){let _0x321991,_0x20259a;return _0x41ce4b?(_0x321991='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.',_0x20259a='Instruction:\x0a'+_0x2b726a+'\x0aYou\x20must\x20keep\x20the\x20text\x20formatting.\x0a\x0aContent:\x0a'+_0x41ce4b):(_0x321991='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.',_0x20259a=_0x2b726a),[{'role':'system','content':_0x321991},{'role':'user','content':_0x20259a}];}async['_readStreamableResponse'](_0x519cea,_0x34cbaa){const _0x1ca2a5=_0x519cea['body']['getReader'](),_0x3dcaec=new TextDecoder();let _0x282ab2='',_0x4b29aa='',_0x4d6e6e='',_0x4e9943=!0x1;for(;!_0x4e9943;){const {done:_0x49204e,value:_0x12d414}=await _0x1ca2a5['read'](),_0x144c3e=_0x282ab2+_0x3dcaec['decode'](_0x12d414);let _0x4413d6='';_0x4e9943=_0x49204e;try{_0x4413d6=this['_cleanUpData'](_0x144c3e),_0x282ab2='';}catch{_0x282ab2=_0x144c3e;continue;}_0x4b29aa+=_0x4413d6,!_0x4e9943&&this['_isBufferIncomplete'](_0x4b29aa)||_0x4b29aa&&(_0x4d6e6e+=_0x4b29aa,_0x4b29aa='',_0x34cbaa(_0x4d6e6e));}return Promise['resolve']();}async['_readStaticResponse'](_0x2dc16f,_0x2f3217){return _0x2f3217((await _0x2dc16f['json']())['choices'][0x0]['message']['content']),Promise['resolve']();}['_isBufferIncomplete'](_0x1a22a9){const _0x2a125d=_0x1a22a9['split']('<')['length']!==_0x1a22a9['split']('>')['length'],_0x1c1249=_0x1a22a9['length']<0x1e;return _0x2a125d&&_0x1c1249;}['_cleanUpData'](_0x140866){return _0x140866['split'](/\n(?![^{]*\})/g)['map'](_0x218895=>_0x218895['replace']('data:\x20',''))['filter'](_0x5bfcb8=>_0x5bfcb8&&_0x5bfcb8['length']>0x0&&'[DONE]'!==_0x5bfcb8)['map'](_0x5b53c8=>{const {choices:_0x182bc1}=JSON['parse'](_0x5b53c8);if(_0x182bc1[0x0]?.['delta']?.['content'])return _0x182bc1[0x0]['delta']['content'];})['filter'](_0x174c08=>_0x174c08)['join']('');}}class Zi extends ji{static get['pluginName'](){return'AWSTextAdapter';}['init'](){super['init'](),It('ai-aws-adapter-not-supported');}async['sendRequest'](_0x461f04){throw Et('ai-aws-adapter-not-supported'),new Oi(ki(this['editor']['locale'],'AI_ERROR_AWS_NOT_SUPPORTED'));}}class ts extends Nt{constructor(_0x57beb3,_0x543721={}){super(_0x57beb3),this['isToggleable']=!0x0,this['set']('side',_0x543721['side']||'top');const _0xfb70bd=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':['ck-tab-button',...pt(_0x543721['class']||[]),_0xfb70bd['to']('side',_0x3d1a90=>'ck-tab-button_'+_0x3d1a90),_0xfb70bd['to']('class')]}});}['show'](){this['set']('isVisible',!0x0);}['hide'](){this['set']('isVisible',!0x1);}}class es extends vt{['children'];constructor(_0x1e1bb8,_0x9d14a7={}){super(_0x1e1bb8);const _0x1af1d9=this['bindTemplate'];this['set']('isVisible',!0x1),this['set']('class',''),this['children']=this['createCollection'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-tab-panel',...pt(_0x9d14a7['class']||[]),_0x1af1d9['to']('class'),_0x1af1d9['if']('isVisible','ck-hidden',_0x2950d5=>!_0x2950d5)]},'children':this['children']});}['show'](){this['set']('isVisible',!0x0);}['hide'](){this['set']('isVisible',!0x1);}}class is extends vt{['buttonViews']=this['createCollection']();['panelViews']=this['createCollection']();['_tabs']=new Map();constructor(_0x39d4d4,_0x893d7b={}){super(_0x39d4d4),this['set']('class',void 0x0),this['set']('activeTab',null),this['set']('side',_0x893d7b['side']||'top'),this['set']('isMaximized',!0x1),this['set']('collapsible',_0x893d7b['collapsible']||!0x1),this['set']('_isMaximizedActive',!0x1),this['bind']('_isMaximizedActive')['to'](this,'isMaximized',this,'activeTab',(_0x21ecc2,_0x449677)=>_0x21ecc2&&null!==_0x449677);const _0x473652=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset','ck-tabs',...pt(_0x893d7b['class']||[]),_0x473652['to']('side',_0x285034=>'ck-tabs_'+_0x285034),_0x473652['to']('class'),_0x473652['if']('_isMaximizedActive','ck-ai-tabs_maximized'),_0x473652['to']('activeTab',_0x5bf041=>null===_0x5bf041?'ck-ai-tabs_collapsed':'')],'tabindex':'0'},'children':[{'tag':'div','attributes':{'class':['ck','ck-tabs__buttons-container',_0x473652['to']('side',_0x5383ee=>'ck-tabs__buttons-container_'+_0x5383ee)]},'children':this['buttonViews']},{'tag':'div','attributes':{'class':['ck','ck-tabs__panels-container',_0x473652['to']('side',_0x109984=>'ck-tabs__panels-container_'+_0x109984)]},'children':this['panelViews']},...pt(_0x893d7b['children']||[])]});}['getTabIds'](){return[...this['_tabs']['keys']()];}['getTab'](_0x57e3c5){const _0xbc215c=this['_tabs']['get'](_0x57e3c5);return _0xbc215c||null;}['addTab'](_0x3a4e1c){const _0x3414ab=this['_setupButton']({'id':_0x3a4e1c['id'],'label':_0x3a4e1c['buttonLabel'],'icon':_0x3a4e1c['buttonIcon'],'order':_0x3a4e1c['order']}),_0x4eea84=new es(this['locale']);return _0x4eea84['render'](),_0x3a4e1c['content']&&_0x4eea84['children']['add'](_0x3a4e1c['content']),this['panelViews']['add'](_0x4eea84),this['_tabs']['set'](_0x3a4e1c['id'],{'button':_0x3414ab,'panel':_0x4eea84,'order':void 0x0!==_0x3a4e1c['order']?_0x3a4e1c['order']:null}),this['fire']('addTab:'+_0x3a4e1c['id'],{'id':_0x3a4e1c['id'],'button':_0x3414ab,'panel':_0x4eea84}),null===this['activeTab']?this['activateTab'](_0x3a4e1c['id']):this['_hidePanel'](_0x3a4e1c['id']),{'button':_0x3414ab,'panel':_0x4eea84};}['activateTab'](_0x4361ce){if(null!==_0x4361ce&&!this['getTab'](_0x4361ce))throw new at('ui-tabsview-tab-not-found',{'tabs':this,'tabId':_0x4361ce});if(this['activeTab']===_0x4361ce)return;const _0x5213a7=this['activeTab'];this['activeTab']&&this['_hidePanel'](this['activeTab']),this['activeTab']=_0x4361ce,_0x4361ce&&this['_showPanel'](_0x4361ce),this['fire']('activateTab:'+_0x4361ce,{'newTab':_0x4361ce,'oldTab':_0x5213a7});}['toggleTabPanel'](_0x3d1a18){if(!this['getTab'](_0x3d1a18))throw new at('ui-tabsview-tab-not-found',{'tabs':this,'tabId':_0x3d1a18});this['activeTab']===_0x3d1a18?this['collapsible']&&(this['activeTab']=null):this['activateTab'](_0x3d1a18);}['showTab'](_0x40a18d){if(!this['getTab'](_0x40a18d))throw new at('ui-tabsview-tab-not-found',{'tabs':this,'tabId':_0x40a18d});this['_showPanel'](_0x40a18d),this['_showButton'](_0x40a18d),this['fire']('show:'+_0x40a18d,_0x40a18d);}['hideTab'](_0x1393af){if(!this['getTab'](_0x1393af))throw new at('ui-tabsview-tab-not-found',{'tabs':this,'tabId':_0x1393af});const _0x103ca2=this['activeTab'];this['_hidePanel'](_0x1393af),this['_hideButton'](_0x1393af);const _0x50810d=this['getTabIds']();_0x103ca2===_0x1393af&&_0x50810d['length']>0x1&&this['activateTab'](_0x50810d['find'](_0xff36f7=>_0xff36f7!==_0x1393af)),this['fire']('hide:'+_0x1393af,_0x1393af);}['_getPanel'](_0x3316de){const _0x3b16cf=this['_tabs']['get'](_0x3316de);return _0x3b16cf?_0x3b16cf['panel']:null;}['_showPanel'](_0x179b8){null!==this['activeTab']&&this['activeTab']!==_0x179b8||this['_getPanel'](_0x179b8)['show']();}['_hidePanel'](_0x29b42f){const _0x103e4e=this['_getPanel'](_0x29b42f);_0x103e4e['isVisible']&&(this['activeTab']===_0x29b42f&&(this['activeTab']=null),_0x103e4e['hide']());}['_getButton'](_0x1ee1f6){const _0x4e9b2c=this['_tabs']['get'](_0x1ee1f6);return _0x4e9b2c?_0x4e9b2c['button']:null;}['_showButton'](_0x465adf){this['_getButton'](_0x465adf)['show']();}['_hideButton'](_0xde383f){this['_getButton'](_0xde383f)['hide']();}['_setupButton'](_0x3e3d48){const _0x4de2b1=new ts(this['locale'],{'side':this['side']}),_0x314b65=this['buttonViews'];if(_0x4de2b1['set']({'label':_0x3e3d48['label'],'icon':_0x3e3d48['icon'],'tooltip':!0x0,'withText':!0x0}),_0x4de2b1['bind']('isOn')['to'](this,'activeTab',_0x55b6d6=>_0x55b6d6===_0x3e3d48['id']),_0x4de2b1['bind']('side')['to'](this,'side'),_0x3e3d48['order']){const _0xe0975=[...this['_tabs']]['reduce']((_0x59f62e,_0x443491)=>{const _0x5ec7ed=_0x443491[0x0],{order:_0x5bb739}=_0x443491[0x1];return!_0x5bb739||_0x5bb739>_0x3e3d48['order']?_0x59f62e:_0x5bb739>=_0x59f62e['order']?{'id':_0x5ec7ed,'order':_0x5bb739}:_0x59f62e;},{'id':'','order':0x0}),_0x2075a1=_0x314b65['getIndex'](this['_getButton'](_0xe0975['id']));_0x314b65['add'](_0x4de2b1,_0x2075a1+0x1);}else _0x314b65['add'](_0x4de2b1);return _0x4de2b1['on']('execute',()=>{this['toggleTabPanel'](_0x3e3d48['id']);}),_0x4de2b1;}}const ss=['overlay','sidebar','custom'],ns=['left','right'];class rs extends is{constructor(_0x2458b0,_0x451906={}){super(_0x2458b0,_0x451906),this['set']('type',_0x451906['type']||'sidebar'),this['set']('side',_0x451906['side']||'right'),this['set']('isVisible',_0x451906['visibleByDefault']??!0x0);const _0x1b7e2e=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':['ck-ai-tabs',_0x1b7e2e['if']('type','ck-ai-tabs__overlay',_0x544e9f=>'overlay'===_0x544e9f),_0x1b7e2e['if']('type','ck-ai-tabs__sidebar',_0x3766c8=>'sidebar'===_0x3766c8),_0x1b7e2e['if']('isVisible','ck-hidden',_0x5c114f=>!_0x5c114f)]}}),this['buttonViews']['on']('add',(_0x36e065,_0x5bd132)=>{_0x5bd132['set']('withText',!0x1);});}}class os extends _0x2599d1{['view'];['container']=null;['showResizeButton']=!0x0;static get['pluginName'](){return'AITabs';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x3e370d){if(super(_0x3e370d),!this['context']['config']['get']('ai.container'))throw new at('ai-tabs-configuration-not-found');this['context']['config']['define']('ai.container.visibleByDefault',!0x0),this['context']['config']['define']('ai.container.collapsible',!0x1);const _0x520c93=this['context']['config']['get']('ai.container');if(this['set']('side','right'),void 0x0!==_0x520c93['showResizeButton']&&(this['showResizeButton']=_0x520c93['showResizeButton']),'sidebar'!==_0x520c93['type']&&'overlay'!==_0x520c93['type']||_0x520c93['side']&&(this['side']=_0x520c93['side']),'sidebar'===_0x520c93['type']){if(this['container']=_0x520c93['element'],this['set']('type','sidebar'),!this['container'])throw new at('ai-tabs-sidebar-container-element-not-found');}else'overlay'===_0x520c93['type']?(this['container']=document['body'],this['set']('type','overlay')):(this['container']=null,this['set']('type','custom'));this['view']=new rs(this['context']['locale'],{'side':this['side'],'type':this['type'],'visibleByDefault':_0x520c93['visibleByDefault'],'collapsible':_0x520c93['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 _0x4da990&&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'](_0x215663){if(_0x215663&&this['type']!==_0x215663){if(!ss['includes'](_0x215663))throw new at('ai-tabs-unsupported-ui-type');this['type']=_0x215663;}}['switchSide'](_0xb07580){if(_0xb07580&&this['side']!==_0xb07580){if(!ns['includes'](_0xb07580))throw new at('ai-tabs-unsupported-ui-side');this['side']=_0xb07580;}}['destroy'](){super['destroy'](),this['view']['destroy'](),this['view']['element']&&this['view']['element']['remove']();}}class as extends _0x2599d1{['_apiUrl'];['_token'];['_decoder'];['_responseCache'];static get['requires'](){return[_0x24c978];}static get['pluginName'](){return'AIConnector';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x2cfa81){super(_0x2cfa81),this['context']['config']['define']('ai.serviceUrl','https://ai.cke-cs.com/v1'),this['_apiUrl']=this['context']['config']['get']('ai.serviceUrl'),this['_token']=null,this['_decoder']=new TextDecoder(),this['_responseCache']=new Map();}['init'](){const _0x1ec01c=this['context']['plugins']['get'](_0x24c978);if(!_0x1ec01c['token'])throw new at('ai-missing-token',this);this['_token']=_0x1ec01c['token'];}['startConversation'](_0x3b4482,_0x27d5db){const _0xe607c0=this['_sendApiRequest']('/conversations','POST',{'id':_0x3b4482,'group':_0x27d5db});return{'getConversation':async()=>(await _0xe607c0['request'])['json'](),'abortController':_0xe607c0['abortController']};}['queryAssistant']({message:_0x4a6403,conversationId:_0x4378f5,parts:_0x2227d2,capabilities:_0xe12b10,model:_0x788b73,attributes:_0x29c381}){const _0x17bce4={'prompt':_0x4a6403,'content':_0x2227d2,'model':_0x788b73,..._0xe12b10&&{'capabilities':_0xe12b10},..._0x29c381&&{'attributes':_0x29c381}},_0x255ff1=this['_sendApiRequest']('/conversations/'+_0x4378f5+'/messages','POST',_0x17bce4);return{'getStream':async()=>{const _0x2025ee=(await _0x255ff1['request'])['body'];return this['_getStreamReader'](_0x2025ee);},'abortController':_0x255ff1['abortController']};}['executeCustomAction']({content:_0x1bbfad,message:_0x137fe5,model:_0x3b0355,outputFormat:_0x37c75c}){const _0x12d127={'content':[{'type':'text','content':_0x1bbfad}],'prompt':_0x137fe5,'model':_0x3b0355,'outputFormat':_0x37c75c},_0x3835d8=this['_sendApiRequest']('/actions/custom/calls','POST',_0x12d127);return{'getStream':async()=>{const _0x1d16a7=(await _0x3835d8['request'])['body'];return this['_getStreamReader'](_0x1d16a7);},'abortController':_0x3835d8['abortController']};}['executeAction']({actionName:_0x2f0c73,content:_0x529248,args:_0x2466c6}){const _0x1a41ef={'content':[{'type':'text','content':_0x529248}],'args':_0x2466c6},_0x1aa213=this['_sendApiRequest']('/actions/system/'+_0x2f0c73+'/calls','POST',_0x1a41ef);return{'getStream':async()=>{const _0x1d7882=(await _0x1aa213['request'])['body'];return this['_getStreamReader'](_0x1d7882);},'abortController':_0x1aa213['abortController']};}['uploadFile'](_0x18b1e7,_0x3908f6,_0x519baf){const _0x90899d=new FormData();_0x90899d['append']('file',_0x3908f6,_0x3908f6['name']),_0x519baf&&_0x90899d['append']('attributes',JSON['stringify'](_0x519baf));const _0x1d1849=this['_sendApiRequest']('/conversations/'+_0x18b1e7+'/files','POST',_0x90899d);return{'getId':async()=>(await _0x1d1849['request'])['json'](),'abortController':_0x1d1849['abortController']};}['fetchDocument'](_0x3a96be,_0x1ff8a2){const _0x4260c0=this['_sendApiRequest']('/conversations/'+_0x3a96be+'/documents/'+_0x1ff8a2,'GET');return{'getDocument':async()=>(await _0x4260c0['request'])['json'](),'abortController':_0x4260c0['abortController']};}['uploadDocument'](_0x520341,_0x3bca12,_0x20edb9){const _0x4d6220={'content':_0x3bca12};_0x20edb9&&(_0x4d6220['attributes']=_0x20edb9);const _0x50c51d=this['_sendApiRequest']('/conversations/'+_0x520341+'/documents','POST',_0x4d6220);return{'getId':async()=>(await _0x50c51d['request'])['json'](),'abortController':_0x50c51d['abortController']};}['uploadDocuments'](_0x1f3be7,_0x8d5afd){const _0x6871bc={'documents':_0x8d5afd['map'](_0x5042fa=>({'content':_0x5042fa['content'],'attributes':{'version':_0x5042fa['version'],'sessionId':_0x5042fa['sessionId'],'selections':_0x5042fa['selections']},...void 0x0!==_0x5042fa['name']?{'name':_0x5042fa['name']}:{},...void 0x0!==_0x5042fa['description']?{'description':_0x5042fa['description']}:{}}))},_0x2c2c06=this['_sendApiRequest']('/conversations/'+_0x1f3be7+'/documents/batch','POST',_0x6871bc);return{'getIds':async()=>(await _0x2c2c06['request'])['json'](),'abortController':_0x2c2c06['abortController']};}['fetchDocuments'](_0x51b694,_0x41f187){const _0x5e5ad9=new URLSearchParams();_0x5e5ad9['append']('documentIds',_0x41f187['join'](','));const _0x38f969=this['_sendApiRequest']('/conversations/'+_0x51b694+'/documents/batch?'+_0x5e5ad9['toString'](),'GET');return{'getDocuments':async()=>(await _0x38f969['request'])['json'](),'abortController':_0x38f969['abortController']};}['fetchConversations'](_0x446e50,_0x2b4197={}){const _0x5e9e69=new URLSearchParams();_0x5e9e69['append']('group',_0x446e50),_0x5e9e69['append']('excludeEmpty',!0x1!==_0x2b4197['excludeEmpty']?'true':'false'),_0x5e9e69['append']('limit',_0x2b4197['limit']?_0x2b4197['limit']['toString']():'100'),_0x5e9e69['append']('sortBy',_0x2b4197['sortBy']?_0x2b4197['sortBy']:'createdAt'),_0x5e9e69['append']('order',_0x2b4197['order']?_0x2b4197['order']:'desc');const _0x1c6507=this['_sendApiRequest']('/conversations?'+_0x5e9e69['toString'](),'GET');return{'getConversations':async()=>{const _0x388e5e=await _0x1c6507['request'];return(await _0x388e5e['json']())['items'];},'abortController':_0x1c6507['abortController']};}['deleteConversation'](_0x169406){const _0x555d88=this['_sendApiRequest']('/conversations/'+_0x169406,'DELETE');return{'execute':async()=>{await _0x555d88['request'];},'abortController':_0x555d88['abortController']};}['updateConversation'](_0x54634d,_0x5cd7fa){const _0x367961=this['_sendApiRequest']('/conversations/'+_0x54634d,'PATCH',_0x5cd7fa);return{'getResult':async()=>(await _0x367961['request'],_0x5cd7fa),'abortController':_0x367961['abortController']};}['fetchConversation'](_0x396008){const _0x4d56d3=this['_sendApiRequest']('/conversations/'+_0x396008,'GET');return{'getConversation':async()=>(await _0x4d56d3['request'])['json'](),'abortController':_0x4d56d3['abortController']};}['fetchConversationMessages'](_0x26cc43){const _0x45fde8=this['_sendApiRequest']('/conversations/'+_0x26cc43+'/messages','GET');return{'getMessages':async()=>{const _0xf40340=await _0x45fde8['request'];return(await _0xf40340['json']())['items'];},'abortController':_0x45fde8['abortController']};}['uploadUrl'](_0x5dd549,_0x219bae,_0x1af708){const _0x55492e=this['_sendApiRequest']('/conversations/'+_0x5dd549+'/web-resources','POST',{'url':_0x219bae,'attributes':_0x1af708});return{'getId':async()=>(await _0x55492e['request'])['json'](),'abortController':_0x55492e['abortController']};}['getModels'](_0x1d7ba6='en'){const _0x4427d5=new URLSearchParams();_0x4427d5['append']('language',_0x1d7ba6);const _0x325f7a='/models/1?'+_0x4427d5['toString'](),_0x5eafee=this['_sendApiRequest'](_0x325f7a,'GET',void 0x0,!0x0);return{'list':async()=>await(await _0x5eafee['request'])['json'](),'abortController':_0x5eafee['abortController']};}['deleteFile'](_0x2c5f87,_0x35f891){const _0x5393ab=this['_sendApiRequest']('/conversations/'+_0x2c5f87+'/files/'+_0x35f891,'DELETE');return{'execute':async()=>{await _0x5393ab['request'];},'abortController':_0x5393ab['abortController']};}['deleteDocument'](_0x54586b,_0x7fd5d0){const _0x10aca4=this['_sendApiRequest']('/conversations/'+_0x54586b+'/documents/'+_0x7fd5d0,'DELETE');return{'execute':async()=>{await _0x10aca4['request'];},'abortController':_0x10aca4['abortController']};}['deleteWebResource'](_0x3c20ab,_0x215fc7){const _0x1269a5=this['_sendApiRequest']('/conversations/'+_0x3c20ab+'/web-resources/'+_0x215fc7,'DELETE');return{'execute':async()=>{await _0x1269a5['request'];},'abortController':_0x1269a5['abortController']};}['callSystemReview']({reviewName:_0x3e3cec,content:_0x19ecfd,args:_0x4b8c04}){const _0x2ebc33=this['_sendApiRequest']('/reviews/system/'+_0x3e3cec+'/calls','POST',{'content':[{'type':'text','content':_0x19ecfd}],'args':_0x4b8c04});return{'getStream':async()=>{const _0x5c0359=(await _0x2ebc33['request'])['body'];return this['_getStreamReader'](_0x5c0359);},'abortController':_0x2ebc33['abortController']};}['callCustomReview']({content:_0x4403d4,prompt:_0x817500,model:_0x13550d}){const _0x48d54d=this['_sendApiRequest']('/reviews/custom/calls','POST',{'content':[{'type':'text','content':_0x4403d4}],'prompt':_0x817500,'model':_0x13550d});return{'getStream':async()=>{const _0x9d2c2d=(await _0x48d54d['request'])['body'];return this['_getStreamReader'](_0x9d2c2d);},'abortController':_0x48d54d['abortController']};}['upsertAIChatRating'](_0x401015,_0x3fe5d6,_0x16376f){const _0x2865ad=this['_sendApiRequest']('/conversations/'+_0x401015+'/messages/'+_0x3fe5d6+'/ratings','PUT',{'positiveCount':_0x16376f['positiveCount'],'totalCount':_0x16376f['totalCount'],'modificationId':_0x16376f['modificationId']});return{'execute':async()=>{await _0x2865ad['request'];},'abortController':_0x2865ad['abortController']};}['upsertAIActionRating'](_0x3f128c,_0x58d4b3,_0x8ffdbb){const _0x4fdffa=this['_sendApiRequest']('/actions/system/'+_0x3f128c+'/calls/'+_0x58d4b3+'/ratings','PUT',{'positiveCount':_0x8ffdbb['positiveCount'],'totalCount':_0x8ffdbb['totalCount']});return{'execute':async()=>{await _0x4fdffa['request'];},'abortController':_0x4fdffa['abortController']};}['upsertCustomAIActionRating'](_0x59f6b4,_0x547755){const _0xc1adb=this['_sendApiRequest']('/actions/custom/calls/'+_0x59f6b4+'/ratings','PUT',{'positiveCount':_0x547755['positiveCount'],'totalCount':_0x547755['totalCount']});return{'execute':async()=>{await _0xc1adb['request'];},'abortController':_0xc1adb['abortController']};}['upsertAIReviewRating'](_0x507b34,_0x37450a,_0x59721e,_0x266eaf){const _0x3b2a50=this['_sendApiRequest']('/reviews/system/'+_0x507b34+'/calls/'+_0x37450a+'/ratings','PUT',{'positiveCount':_0x59721e['positiveCount'],'totalCount':_0x59721e['totalCount'],'dataId':_0x266eaf});return{'execute':async()=>{await _0x3b2a50['request'];},'abortController':_0x3b2a50['abortController']};}['upsertCustomAIReviewRating'](_0x16bedd,_0x170e21,_0x1d7cce){const _0x3662d8=this['_sendApiRequest']('/reviews/custom/calls/'+_0x16bedd+'/ratings','PUT',{'positiveCount':_0x170e21['positiveCount'],'totalCount':_0x170e21['totalCount'],'dataId':_0x1d7cce});return{'execute':async()=>{await _0x3662d8['request'];},'abortController':_0x3662d8['abortController']};}['_sendApiRequest'](_0x20133f,_0x2bd496,_0x392ea2,_0x542ebc=!0x1){const _0xb7eeb1=new AbortController(),_0x22132f=_0x542ebc?_0x2bd496+':'+_0x20133f:null;if(_0x22132f){const _0x272e9f=this['_responseCache']['get'](_0x22132f);if(_0x272e9f)return{'request':_0x272e9f['then'](_0x573e78=>_0x573e78['clone']()),'abortController':_0xb7eeb1};}const _0xcc1e81=_0x392ea2 instanceof FormData,_0x5bff30={'Authorization':'Bearer\x20'+this['_token']?.['value'],'x-feature-flags':'multi-document','X-Editor-Version':mt};_0x392ea2&&!_0xcc1e81&&(_0x5bff30['Content-Type']='application/json');const _0xa37f2a={'method':_0x2bd496,'headers':_0x5bff30,'signal':_0xb7eeb1['signal']};_0x392ea2&&(_0xa37f2a['body']=_0xcc1e81?_0x392ea2:JSON['stringify'](_0x392ea2));const _0x5acb8d=fetch(''+this['_apiUrl']+_0x20133f,_0xa37f2a)['catch'](_0x2c3728=>{_0x22132f&&this['_responseCache']['delete'](_0x22132f),this['_handleError'](_0x2c3728);})['then'](_0x235672=>_0x235672['ok']?_0x235672:_0x235672['json']()['then'](_0x319d18=>{throw _0x22132f&&this['_responseCache']['delete'](_0x22132f),{'url':this['_apiUrl'],'path':_0x20133f,'method':_0x2bd496,'body':_0x392ea2,'status':(_0x235672||{})['status'],'statusText':(_0x235672||{})['statusText'],'code':_0x319d18['code'],'message':_0x319d18['message'],'traceId':_0x319d18['traceId']};}));return _0x22132f&&this['_responseCache']['set'](_0x22132f,_0x5acb8d['then'](_0x4aa0e6=>_0x4aa0e6['clone']())),{'request':_0x5acb8d,'abortController':_0xb7eeb1};}async*['_getStreamReader'](_0x3c89a0){const _0x169df8=[],_0x37a990=_0x3c89a0['getReader'](),_0x5566b3=_0x24d188({'onError':_0x10b4ef=>{this['_handleError'](_0x10b4ef);},'onEvent':_0x174289=>{_0x174289['data']=JSON['parse'](_0x174289['data']),_0x169df8['push'](_0x174289);}});try{let _0x1b8c34=!0x1;for(;!_0x1b8c34;){const {done:_0x5bddaa,value:_0x2060ea}=await _0x37a990['read']();_0x5bddaa&&(_0x1b8c34=!0x0),_0x5566b3['feed'](this['_decoder']['decode'](_0x2060ea,{'stream':!0x0})),yield*_0x169df8,_0x169df8['length']=0x0;}}catch(_0x2e8ff6){this['_handleError'](_0x2e8ff6);}finally{_0x37a990['releaseLock'](),_0x5566b3['reset']();}}['_handleError'](_0x119c99){if(_0x119c99 instanceof at)throw _0x119c99;if(_0x119c99 instanceof Error&&'AbortError'===_0x119c99['name'])throw new at('ai-request-aborted',this,{'originalError':_0x119c99});throw new at('ai-request-failed',this,{'originalError':_0x119c99});}}function hs(_0x724fe0,_0x31d744,_0x50b723){const t=_0x724fe0['t'];switch(_0x31d744){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'},_0x50b723);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.'},_0x50b723);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.'},_0x50b723);case'AI_CHAT_RESOURCE_LOAD_FAILED':return t({'id':'AI_CHAT_RESOURCE_LOAD_FAILED','string':'Failed\x20to\x20load\x20resource.\x20Please\x20try\x20again.'});case'AI_CHAT_CONTEXT_CURRENT_DOCUMENT':return t({'id':'AI_CHAT_CONTEXT_CURRENT_DOCUMENT','string':'Current\x20document'});case'AI_CHAT_CONTEXT_REMOVE_FROM_CONTEXT':return t({'id':'AI_CHAT_CONTEXT_REMOVE_FROM_CONTEXT','string':'Remove\x20from\x20context'});case'AI_CHAT_CONTEXT_ADD_CONTEXT':return t({'id':'AI_CHAT_CONTEXT_ADD_CONTEXT','string':'Add\x20context'});case'AI_CHAT_CONTEXT_URL_LABEL':return t({'id':'AI_CHAT_CONTEXT_URL_LABEL','string':'URL'});case'AI_CHAT_CONTEXT_FILE_LABEL':return t({'id':'AI_CHAT_CONTEXT_FILE_LABEL','string':'File'});case'AI_CHAT_CONTEXT_CURRENT_CONTEXT_LABEL':return t({'id':'AI_CHAT_CONTEXT_CURRENT_CONTEXT_LABEL','string':'Current\x20context'});case'AI_CHAT_CONTEXT_DOCUMENT_SELECTION_LABEL':return t({'id':'AI_CHAT_CONTEXT_DOCUMENT_SELECTION_LABEL','string':'Selected\x20content'});case'AI_CHAT_SEARCH_WEB':return t({'id':'AI_CHAT_SEARCH_WEB','string':'Web\x20search'});case'AI_CHAT_ENABLE_WEB_SEARCH':return t({'id':'AI_CHAT_ENABLE_WEB_SEARCH','string':'Enable\x20web\x20search'});case'AI_CHAT_DISABLE_WEB_SEARCH':return t({'id':'AI_CHAT_DISABLE_WEB_SEARCH','string':'Disable\x20web\x20search'});case'AI_CHAT_REASONING':return t({'id':'AI_CHAT_REASONING','string':'Reasoning'});case'AI_CHAT_ENABLE_REASONING':return t({'id':'AI_CHAT_ENABLE_REASONING','string':'Enable\x20reasoning'});case'AI_CHAT_DISABLE_REASONING':return t({'id':'AI_CHAT_DISABLE_REASONING','string':'Disable\x20reasoning'});case'AI_CHAT_COMMANDS':return t({'id':'AI_CHAT_COMMANDS','string':'Commands'});case'AI_CHAT_SEARCH_RESOURCES':return t({'id':'AI_CHAT_SEARCH_RESOURCES','string':'Search\x20resources'});case'AI_CHAT_CONTEXT_URL_BACK_TO_CONTEXT':return t({'id':'AI_CHAT_CONTEXT_URL_BACK_TO_CONTEXT','string':'Back\x20to\x20context\x20options'});case'AI_CHAT_CONTEXT_URL_ADD_URL':return t({'id':'AI_CHAT_CONTEXT_URL_ADD_URL','string':'Add\x20URL'});case'AI_CHAT_CONTEXT_URL_PLACEHOLDER':return t({'id':'AI_CHAT_CONTEXT_URL_PLACEHOLDER','string':'Add\x20URL...'});case'AI_CHAT_CONTEXT_UNABLE_TO_UPLOAD_URL':return t({'id':'AI_CHAT_CONTEXT_UNABLE_TO_UPLOAD_URL','string':'Failed\x20to\x20upload\x20URL:\x20%0.\x20Please\x20try\x20again.'},_0x50b723);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'},_0x50b723);case'AI_CHAT_SUGGESTION_ACTION_SUGGEST':return t({'id':'AI_CHAT_SUGGESTION_ACTION_SUGGEST','string':'Suggest'},_0x50b723);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'},_0x50b723);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.'},_0x50b723);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.'},_0x50b723);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.'},_0x50b723);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.'},_0x50b723);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'},_0x50b723);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.'},_0x50b723);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 _0x31d744;}}const cs='ck-ai-button-primary',ls='ck-ai-button-secondary',us='ck-ai-button-tertiary';function ds(_0x28ee2e,_0x38f3e8){const _0x525367=new Nt(_0x28ee2e),_0x2ab801=hs(_0x28ee2e,'AI_TABS_LABEL_MINIMIZE'),_0x46df9c=hs(_0x28ee2e,'AI_TABS_LABEL_MAXIMIZE');return _0x525367['set']({'withText':!0x1,'icon':_0xb401ab,'tooltip':!0x0,'class':'ck-ai-tabs__resize\x20'+us}),_0x525367['bind']('label')['to'](_0x38f3e8,'isMaximized',_0x59f031=>_0x59f031?_0x2ab801:_0x46df9c),_0x525367['bind']('icon')['to'](_0x38f3e8,'isMaximized',_0x11e1de=>_0x11e1de?_0x56e08e:_0xb401ab),_0x525367['bind']('isOn')['to'](_0x38f3e8,'isMaximized'),_0x525367['on']('execute',()=>{_0x38f3e8['fire']('resizeTabs');}),_0x525367;}function _s(_0x14c08c){return _0x2442ed(_0x14c08c);}function gs(_0x8b8b9b){return ti(_0x8b8b9b);}function As(_0x213503,_0x15eaeb,_0x43f149){const _0xa8b12b=null!==_0x15eaeb?_0x72792f=>_0x72792f['attribs'][_0x213503]===_0x15eaeb:_0x30164b=>Boolean(_0x30164b['attribs'][_0x213503]);return _0x46c265(_0x8015e7=>_0x2782ce(_0x8015e7)&&_0xa8b12b(_0x8015e7),_0x43f149);}function Is(_0x23110c,_0x248615,_0xbcd30f){const _0x3148f3=null!==_0x248615?_0x402835=>_0x402835['attribs'][_0x23110c]===_0x248615:_0x43aa5d=>Boolean(_0x43aa5d['attribs'][_0x23110c]);return _0x32a0d0(_0x50bb67=>_0x2782ce(_0x50bb67)&&_0x3148f3(_0x50bb67),_0xbcd30f);}function Es(_0x52962e,_0x52920f){return _0x52962e&&_0x2782ce(_0x52962e)?_0x52962e['attribs'][_0x52920f]:null;}function ps(_0x1f65cb,_0x3d60dd,_0x4b97f3){_0x2782ce(_0x1f65cb)&&(null===_0x4b97f3?delete _0x1f65cb['attribs'][_0x3d60dd]:_0x1f65cb['attribs'][_0x3d60dd]=_0x4b97f3);}function ms(_0x3496ef,_0x571f29,_0x3aa12e){const _0x225858=_0x571f29['cloneNode'](!0x0);'beforebegin'===_0x3aa12e?_0x3f803f(_0x3496ef,_0x225858):'afterbegin'===_0x3aa12e?_0xe2c668(_0x3496ef,_0x225858):'beforeend'===_0x3aa12e?_0x3a62e4(_0x3496ef,_0x225858):'afterend'===_0x3aa12e&&_0x2c2389(_0x3496ef,_0x225858);}function Ts(_0x3d05be){const _0x1ac359=[];let _0x29a43b=_0x3d05be;for(;_0x29a43b;)_0x29a43b=_0x2c93e3(_0x29a43b),_0x29a43b&&_0x1ac359['push'](_0x29a43b);return _0x1ac359;}function Cs(_0x5384f1){return _0x5384f1['replace'](/^\s+/gm,'')['replace'](/\s+$/gm,'')['replace'](/\n*/g,'')['replace'](/\s+/g,'\x20')['replace'](/>\s*</g,'><');}function ws(_0x43b49d){let _0x40119e=0x0;for(;_0x43b49d['parentNode'];)_0x43b49d=_0x43b49d['parentNode'],_0x40119e++;return _0x40119e;}function fs(_0x599eec){const _0x2babdb=[];let _0x2dd843=_0x599eec['nextSibling'];for(;_0x2dd843;)_0x2babdb['push'](_0x2dd843),_0x2dd843=_0x2dd843['nextSibling'];_0x2babdb['forEach'](_0x1c0ad1=>{_0x5ac2a3(_0x1c0ad1);});}class bs extends/* #__PURE__ -- @preserve */
25
- ht(){['_m2html'];constructor(){super();const _0x4149bd=Object['entries'](_0x379e0c),_0x26aeee=_0x4149bd['findIndex'](([_0x2a91bc])=>'rehypeDomRaw'===_0x2a91bc);if(-0x1===_0x26aeee)throw new at('ai-response-parser-unable-to-set-up-parser');_0x4149bd['splice'](_0x26aeee+0x1,0x0,['rehypeSanitize',_0x47e3b3]),this['_m2html']=new _0x5caba7({'plugins':Object['fromEntries'](_0x4149bd)});}['convertMarkdownToHTML'](_0x5574fb){const _0xf30210=this['_m2html']['parse'](_0x5574fb);return this['parseAndNormalizeHTML'](_0xf30210);}['parseAndNormalizeHTML'](_0x3a68e6){return this['_parseHTML'](_0x3a68e6);}['_parseHTML'](_0x331366){const _0x304f0f=_s('<dummy>'+_0x331366['replace'](/^\t+/gm,'\x20')['replace'](/\n*/g,'')['replace'](/\s+/g,'\x20')['replace'](/<[^>]*?$/g,'')+'</dummy>');return _0x304f0f['children']=_0x304f0f['children'][0x0]['children'],_0x304f0f;}}class Ss extends/* #__PURE__ -- @preserve */
26
- ht(){['_generateUid'];['_uidCounter']=0x0;['_touchedNodesState']={'newIds':[],'modifiedIds':[],'removedIds':[],'invalidIds':[],'lastTouchedId':null};['_existingDataIds']=new Set();constructor(_0x3d17bd){super(),this['_generateUid']=_0x3d17bd||(()=>'e'+String(this['_uidCounter']++));}['merge'](_0x179203,_0xbf0cc3,_0x490a50){this['_uidCounter']=0x0;const _0xa4e31d=_0x179203['cloneNode'](!0x0),_0x3c499a=_0xa4e31d['childNodes'],_0x579d77=Array['from'](_0x3c499a)['filter'](_0x34f43d=>!(0x3===_0x34f43d['nodeType']&&''===gs(_0x34f43d)['trim']())),_0x236de8=_0x579d77['length'],_0x10cc20=new Map();for(const _0xeaef69 of _0x579d77)_0xeaef69&&_0x2782ce(_0xeaef69)&&void 0x0===_0xeaef69['attribs']['data-id']&&ps(_0xeaef69,'data-id','new-element');if(0x0===_0xbf0cc3['childNodes']['length']){const _0x108360=[];return Is('data-id','new-element',_0xa4e31d)['forEach'](_0x33de30=>{const _0x2464c4=this['_generateUid']();ps(_0x33de30,'data-id',_0x2464c4),_0x108360['push'](_0x2464c4);}),this['_removeSpecialComments'](_0xa4e31d),{'parsedContent':_0xa4e31d,'newNodeIds':_0x108360,'modifiedNodeIds':[],'removedNodeIds':[],'newAnchorIds':_0x10cc20};}_0x490a50&&_0x490a50['markUnstableElements']&&this['_markLastTagElementUnstable'](_0xa4e31d),this['_touchedNodesState']['newIds']=[],this['_touchedNodesState']['modifiedIds']=[],this['_touchedNodesState']['removedIds']=[],this['_touchedNodesState']['invalidIds']=[],this['_touchedNodesState']['lastTouchedId']=null,this['_existingDataIds']=new Set(Is('data-id',null,_0xbf0cc3)['map'](_0x373670=>Es(_0x373670,'data-id'))['filter'](_0x4e4db7=>!!_0x4e4db7));let _0x4d1de1=-0x1,_0x489ac9=!0x1;for(let _0x44587d=0x0;_0x44587d<_0x236de8;_0x44587d++){const _0x274fa5=_0x579d77[_0x44587d],_0x54adae=_0x579d77[_0x44587d+0x1];if(this['_isNewNode'](_0x274fa5)){if(-0x1===_0x4d1de1&&(_0x4d1de1=_0x44587d),this['_markWrappedElements'](_0x274fa5),!this['_isNewNode'](_0x54adae)){const [_0x42ae83,_0x39b3e3]=this['_findReferenceNode'](_0x274fa5,_0x489ac9,_0xbf0cc3);if(_0x42ae83){const _0x1ea794=Array['from'](_0x579d77)['slice'](_0x4d1de1,_0x44587d+0x1),_0x163f00=Es(_0x42ae83,'data-id');if(this['_insertNodes'](_0x42ae83,_0x1ea794,_0x39b3e3),_0x163f00)for(const _0x48bd21 of _0x1ea794){const _0x1806f3=Es(_0x48bd21,'data-id');_0x1806f3&&_0x10cc20['set'](_0x1806f3,_0x163f00);}_0x4d1de1=-0x1;}}}else{if(this['_isExistingContentComment'](_0x274fa5))_0x489ac9=!0x0;else{if(this['_isExistingNode'](_0x274fa5)){const _0x28d3e8=Es(_0x274fa5,'data-id');if(_0x28d3e8&&this['_existingDataIds']['has'](_0x28d3e8)){const _0x5b1ab3=As('data-id',_0x28d3e8,_0xbf0cc3);this['_replaceNode'](_0x5b1ab3,_0x274fa5);}}else{if(this['_isDelNode'](_0x274fa5)){const _0x3b1592=this['_getNodeDataId'](_0x274fa5);!!As('data-id',_0x3b1592,_0xa4e31d)||this['_touchedNodesState']['removedIds']['push'](_0x3b1592);}}}}}for(const _0x336da1 of this['_touchedNodesState']['removedIds']){const _0x44b866=As('data-id',_0x336da1,_0xbf0cc3);_0x44b866&&this['_removeNode'](_0x44b866,_0x336da1,_0x490a50);}if(Is('data-id','new-element',_0xbf0cc3)['forEach'](_0x164137=>{const _0x31e603=this['_getUid'](_0x164137);ps(_0x164137,'data-id',_0x31e603),this['_touchedNodesState']['newIds']['push'](_0x31e603);}),this['_removeSpecialComments'](_0xbf0cc3),_0x490a50&&_0x490a50['markUnstableElements']&&this['_markUnstableElements'](_0xbf0cc3,_0x490a50['markUnstableElementsDepth']||0x0),this['_processWrappedElements'](_0xbf0cc3,_0x490a50),_0x490a50&&_0x490a50['cutAfterLastChange']&&this['_touchedNodesState']['lastTouchedId']){const _0x35ee4c=Is('data-id',this['_touchedNodesState']['lastTouchedId'],_0xbf0cc3);let _0x1b1597=_0x35ee4c[_0x35ee4c['length']-0x1];for(;_0x1b1597;)fs(_0x1b1597),_0x1b1597=_0x1b1597['parentNode'];}return{'parsedContent':_0xbf0cc3,'newNodeIds':this['_touchedNodesState']['newIds'],'modifiedNodeIds':this['_touchedNodesState']['modifiedIds'],'removedNodeIds':this['_touchedNodesState']['removedIds'],'newAnchorIds':_0x10cc20};}['_insertNodes'](_0x43a2e9,_0x2d5731,_0x113ddd){for(const _0x49cf8a of _0x2d5731){const _0x186232=this['_getUid'](_0x49cf8a);ps(_0x49cf8a,'data-id',_0x186232),this['_touchedNodesState']['newIds']['push'](_0x186232),this['_touchedNodesState']['lastTouchedId']=_0x186232;}const _0x5f2c12='afterbegin'===_0x113ddd||'afterend'===_0x113ddd?_0x2d5731['reverse']():_0x2d5731;for(const _0x32d65d of _0x5f2c12)ms(_0x43a2e9,_0x32d65d,_0x113ddd);}['_replaceNode'](_0x41cbb9,_0x1493cd){if(!_0x41cbb9)return;if(_0x1e36ce=_0x1493cd,Cs(gs(_0x41cbb9))===Cs(gs(_0x1e36ce)))return;var _0x1e36ce;const _0x49f2d8=this['_getUid'](_0x41cbb9);ps(_0x1493cd,'data-id',_0x49f2d8),this['_touchedNodesState']['modifiedIds']['push'](_0x49f2d8),this['_touchedNodesState']['lastTouchedId']=_0x49f2d8,_0x5561d3(_0x41cbb9,_0x1493cd['cloneNode'](!0x0));}['_removeNode'](_0x460399,_0x4b51e2,_0x443d56){if(_0x443d56&&_0x443d56['replaceRemovedWith']){this['_touchedNodesState']['lastTouchedId']=_0x4b51e2;const _0x28410b=_0x443d56['replaceRemovedWith']['cloneNode'](!0x0);ps(_0x28410b,'data-id',_0x4b51e2),ps(_0x28410b,'data-removed','true'),_0x5561d3(_0x460399,_0x28410b);}else _0x5ac2a3(_0x460399);}['_findReferenceNode'](_0x5abb0e,_0x32ffa5,_0xa06cc1){const _0x166ce3=this['_findPrevElementWithDataId'](_0x5abb0e,!0x1);if(_0x166ce3){const _0x5c7047=this['_getNodeDataId'](_0x166ce3),_0x14b0fc=As('data-id',_0x5c7047,_0xa06cc1);if(_0x14b0fc)return[_0x14b0fc,'afterend'];this['_touchedNodesState']['invalidIds']['push'](_0x5c7047);}const _0x3f71d3=this['_findNextElementWithDataId'](_0x5abb0e,!0x1);if(_0x3f71d3){const _0x446ce9=this['_getNodeDataId'](_0x3f71d3),_0xf35b0a=As('data-id',_0x446ce9,_0xa06cc1);if(_0xf35b0a)return[_0xf35b0a,'beforebegin'];this['_touchedNodesState']['invalidIds']['push'](_0x446ce9);}return _0x32ffa5?_0x5abb0e['nextSibling']?this['_findFallbackReferenceNode'](_0x5abb0e,_0xa06cc1):[_0xa06cc1['childNodes'][_0xa06cc1['childNodes']['length']-0x1],'afterend']:[_0xa06cc1['childNodes'][0x0],'beforebegin'];}['_findFallbackReferenceNode'](_0x6a1c56,_0x419f19){const _0x1794f1=[],_0x23458b=this['_findPrevElementWithDataId'](_0x6a1c56,!0x0);if(_0x23458b){const _0xa27bdf=As('data-id',this['_getNodeDataId'](_0x23458b),_0x419f19);_0xa27bdf&&_0x1794f1['push']([_0xa27bdf,'afterend']);}const _0x47cd42=this['_findNextElementWithDataId'](_0x6a1c56,!0x0);if(_0x47cd42){const _0x769a6b=As('data-id',this['_getNodeDataId'](_0x47cd42),_0x419f19);_0x769a6b&&_0x1794f1['push']([_0x769a6b,'beforebegin']);}if(_0x1794f1['length']>0x1)return ws(_0x1794f1[0x0][0x0])<=ws(_0x1794f1[0x1][0x0])?_0x1794f1[0x0]:_0x1794f1[0x1];return 0x1===_0x1794f1['length']?_0x1794f1[0x0]:[_0x419f19['lastChild'],'afterend'];}['_findNextElementWithDataId'](_0x1e21a1,_0x13240d){let _0x11ce37=_0x1e21a1['nextSibling'],_0x4f26b4=null,_0x277f27=!0x1;for(;_0x11ce37;){if(_0x4dc2aa(_0x11ce37)){if(this['_isDelNode'](_0x11ce37)&&(_0x4f26b4=_0x11ce37),this['_isExistingContentComment'](_0x11ce37)&&_0x13240d&&!_0x277f27){_0x277f27=!0x0,_0x11ce37=_0x11ce37['nextSibling'];continue;}break;}const _0x24f404=Es(_0x11ce37,'data-id');if(_0x24f404&&'new-element'!==_0x24f404&&this['_existingDataIds']['has'](_0x24f404)){_0x4f26b4=_0x11ce37;break;}_0x11ce37=_0x11ce37['nextSibling'];}return _0x4f26b4;}['_findPrevElementWithDataId'](_0x362877,_0x1bf7a7){let _0xd5c04e=_0x362877['previousSibling'],_0x26c9c3=null,_0x1ed103=!0x1;for(;_0xd5c04e;){if(_0x4dc2aa(_0xd5c04e)){if(this['_isDelNode'](_0xd5c04e)&&(_0x26c9c3=_0xd5c04e),this['_isExistingContentComment'](_0xd5c04e)&&_0x1bf7a7&&!_0x1ed103){_0x1ed103=!0x0,_0xd5c04e=_0xd5c04e['previousSibling'];continue;}break;}const _0x5e013b=Es(_0xd5c04e,'data-id');if(_0x5e013b&&'new-element'!==_0x5e013b&&this['_existingDataIds']['has'](_0x5e013b)){_0x26c9c3=_0xd5c04e;break;}_0xd5c04e=_0xd5c04e['previousSibling'];}return _0x26c9c3;}['_markWrappedElements'](_0xfc60dd){_0x2782ce(_0xfc60dd)&&Is('data-id',null,_0xfc60dd)['forEach'](_0xf8b0c2=>{this['_isExistingNode'](_0xf8b0c2)&&(ps(_0xf8b0c2,'data-wrapped-id',Es(_0xf8b0c2,'data-id')),ps(_0xf8b0c2,'data-id',null));});}['_processWrappedElements'](_0x2b64b5,_0x1b1bcc){Is('data-wrapped-id',null,_0x2b64b5)['forEach'](_0x123da0=>{const _0x2db659=Es(_0x123da0,'data-wrapped-id');if(Es(_0x123da0,'data-unstable')||this['_hasUnstableParent'](_0x123da0))return;const _0x138883=As('data-id',_0x2db659,_0x2b64b5);ps(_0x123da0,'data-id',_0x2db659),ps(_0x123da0,'data-wrapped-id',null),_0x138883&&(this['_removeNode'](_0x138883,_0x2db659,_0x1b1bcc),this['_touchedNodesState']['removedIds']['push'](_0x2db659),this['_touchedNodesState']['lastTouchedId']=_0x2db659);});}['_hasUnstableParent'](_0x4ce15f){let _0x471522=_0x4ce15f['parentNode'];for(;_0x471522;){if(Es(_0x471522,'data-unstable'))return!0x0;_0x471522=_0x471522['parentNode'];}return!0x1;}['_getNodeDataId'](_0x4dad6a){if(!_0x4dad6a)return null;if(_0x2782ce(_0x4dad6a))return Es(_0x4dad6a,'data-id');if(_0x4dc2aa(_0x4dad6a)){const _0xb8fe00=gs(_0x4dad6a)['match'](/removed[\s*-]data-id="([^"]+)"/);if(_0xb8fe00&&_0xb8fe00[0x1])return _0xb8fe00[0x1];}return null;}['_getUid'](_0x1fe05d){return this['_isExistingNode'](_0x1fe05d)?Es(_0x1fe05d,'data-id'):this['_generateUid']();}['_removeSpecialComments'](_0x3c2cb8){(function(_0x53440a){return _0x4c9e30(_0x5b3e55=>_0x4dc2aa(_0x5b3e55),_0x53440a,!0x0,0x1/0x0);}(_0x3c2cb8)['filter'](_0x495b87=>this['_isDelNode'](_0x495b87)||this['_isExistingContentComment'](_0x495b87))['forEach'](_0x35d15c=>{_0x5ac2a3(_0x35d15c);}));}['_markLastTagElementUnstable'](_0xd161be){const _0x1c0a38=_0xd161be['childNodes'],_0x28fa60=_0x1c0a38[_0x1c0a38['length']-0x1];_0x28fa60&&_0x2782ce(_0x28fa60)&&ps(_0x28fa60,'data-unstable','true');}['_markUnstableElements'](_0x131422,_0x1b95b6){const _0x1b14c1=As('data-unstable','true',_0x131422);if(!_0x1b14c1)return;const _0x50eb72=Ts(_0x1b14c1)['slice'](0x0,-0x1),_0x447e55=_0x50eb72['length'];let _0x568451=_0x1b14c1;if(_0x447e55>_0x1b95b6){let _0x1dff2b=_0x447e55,_0x492c8b=null;for(;_0x1dff2b>_0x1b95b6&&_0x1dff2b>=0x0;)_0x1dff2b--,_0x492c8b=_0x50eb72[_0x1dff2b];_0x492c8b&&(_0x568451=_0x492c8b,ps(_0x1b14c1,'data-unstable',null),ps(_0x492c8b,'data-unstable','true'));}else{if(_0x447e55<_0x1b95b6){let _0x2fb981=_0x447e55,_0x49a313=_0x1b14c1;for(;_0x2fb981<_0x1b95b6;){const _0x1f5fca=_0x49a313['childNodes']['filter'](_0x238144=>_0x2782ce(_0x238144));if(0x0===_0x1f5fca['length'])break;_0x2fb981++,_0x49a313=_0x1f5fca[_0x1f5fca['length']-0x1];}_0x49a313&&(_0x568451=_0x49a313,ps(_0x1b14c1,'data-unstable',null),ps(_0x49a313,'data-unstable','true'));}}let _0x10e26b=_0x568451;for(;_0x10e26b;){for(;_0x10e26b['nextSibling'];)_0x10e26b=_0x10e26b['nextSibling'],_0x2782ce(_0x10e26b)&&ps(_0x10e26b,'data-unstable','true');_0x10e26b=_0x10e26b['parentNode'];}}['_isNewNode'](_0x14004c){return Boolean('new-element'===Es(_0x14004c,'data-id'));}['_isExistingNode'](_0x451448){return Boolean((Es(_0x451448,'data-id')||'')['length']>0x0&&'new-element'!==Es(_0x451448,'data-id'));}['_isDelNode'](_0x4b40f2){return!!_0x4b40f2&&Boolean(_0x4dc2aa(_0x4b40f2)&&gs(_0x4b40f2)['match'](/removed[\s*-]data-id="[^"]+"/));}['_isExistingContentComment'](_0x352386){return Boolean(_0x4dc2aa(_0x352386)&&gs(_0x352386)['match'](/\s*existing[\s*-](content|document)\s*/g));}}function Rs({editor:_0x472a50,changeGroups:_0x386a27,documentContextContent:_0x50f502,showDiff:_0x583423,trimUnchanged:_0x386f73=!0x0}){return _0x386a27['map'](_0x4b32ae=>{const _0x135148=new _0x5eb144([]),_0x1871ba=new _0x5eb144([]),_0x4466d2=new Set();for(const _0x2c1e27 of _0x4b32ae['changes'])'new'==_0x2c1e27['type']&&Is('data-id',null,_0x2c1e27['node'])['forEach'](_0x57021e=>{_0x4466d2['add'](Es(_0x57021e,'data-id'));});for(const _0x4ea859 of _0x4b32ae['changes'])if('removed'!=_0x4ea859['type']?_0x1871ba['children']['push'](_0x4ea859['node']['cloneNode'](!0x0)):_0x583423||_0x4466d2['has'](_0x4ea859['id'])||_0x1871ba['children']['push'](_0x4ea859['node']['cloneNode'](!0x0)),'new'!=_0x4ea859['type']&&(_0x583423||'removed'!=_0x4ea859['type'])){const _0x4a01ee=_0x46c265(_0x5b2be9=>Es(_0x5b2be9,'data-id')==_0x4ea859['id'],_0x50f502,!0x0);_0x4a01ee&&_0x135148['children']['push'](_0x4a01ee['cloneNode'](!0x0));}const {content:_0x5eb56d,hasChanges:_0x221453}=function(_0x5c40a4,_0x184987,_0x56753a,_0x134e48,_0x5add92=!0x0){const _0x1dab78=_0x5c40a4['plugins']['get']('DocumentCompare'),_0x21852f=gs(_0x184987),_0x1f7f4a=gs(_0x56753a),_0x3d0281=_0x5c40a4['data']['parse'](_0x21852f,'$root'),_0x43c649=_0x5c40a4['model']['createPositionAt'](_0x3d0281,0x0),_0x1c9642=_0x1dab78['getDiff'](_0x21852f,_0x1f7f4a,{'anchor':_0x43c649,'markDeletions':_0x134e48,'targetEditor':_0x5c40a4}),_0x4f6997=_0x1c9642['getOperations']();if(0x0==_0x4f6997['length'])return{'content':_0x184987['cloneNode'](!0x0),'hasChanges':!0x1};_0x134e48?function(_0x35cae9,_0x3f0e11,_0x2c02f9){if(0x0==_0x35cae9['length'])return;const _0xd6c371=_0x2c02f9['plugins']['get']('DocumentCompare'),_0x2b3265=_0x2c02f9['plugins']['get']('SuggestionsConversion');_0x2c02f9['model']['change'](_0x5a13de=>{const _0x431e58=new Set();for(let _0x3be2db=0x0;_0x3be2db<_0x35cae9['length'];_0x3be2db++){const _0xdde75e=_0x35cae9[_0x3be2db];if(_0xdde75e['baseVersion']=null,_0xdde75e['isDocumentOperation']=!0x1,_0xd6c371['isMarkedRemoveOperation'](_0xdde75e)){const _0x1ad53b=_0xb4a7de(_0xdde75e['newRange'],_0x2c02f9['model']),_0x14aced='suggestion:deletion:'+ot()+':$aiSuggestion';_0x3f0e11['markers']['set'](_0x14aced,_0x1ad53b);}else switch(_0xdde75e['type']){case'rename':{if(_0xdde75e['oldName']==_0xdde75e['newName'])break;_0x5a13de['batch']['addOperation'](_0xdde75e),_0x2c02f9['model']['applyOperation'](_0xdde75e);const _0x25acfb='$elementName',_0x3b1c05=_0xdde75e['position'],_0x2e6cfa=_0x2c02f9['model']['createRange'](_0x3b1c05,_0x2c02f9['model']['createPositionAt'](_0x3b1c05['nodeAfter'],'end')),_0x47538b='suggestion:attribute:'+_0x25acfb+':'+ot()+':$aiSuggestion';_0x3f0e11['markers']['set'](_0x47538b,_0x2e6cfa);break;}case'addAttribute':case'removeAttribute':case'changeAttribute':{if(_0xdde75e['oldValue']==_0xdde75e['newValue'])break;_0x5a13de['batch']['addOperation'](_0xdde75e),_0x2c02f9['model']['applyOperation'](_0xdde75e);const _0x112a31=_0xdde75e['key'];if(!_0x2b3265['isRegisteredAttribute'](_0x112a31))break;const _0xfddb14=_0xb4a7de(_0xdde75e['range'],_0x2c02f9['model']),_0x5aba59='suggestion:attribute:'+_0x112a31+':'+ot()+':$aiSuggestion';_0x3f0e11['markers']['set'](_0x5aba59,_0xfddb14);break;}case'insert':{_0x5a13de['batch']['addOperation'](_0xdde75e),_0x2c02f9['model']['applyOperation'](_0xdde75e);if(_0x35cae9[_0x3be2db+0x1]&&'move'==_0x35cae9[_0x3be2db+0x1]['type']){Os(_0x3f0e11,_0xdde75e);break;}const _0x3b3c1a=_0xdde75e['position'],_0x5280b3=_0xdde75e['howMany'],_0x57eba2=_0xb4a7de(_0x2c02f9['model']['createRange'](_0x3b3c1a,_0x3b3c1a['getShiftedBy'](_0x5280b3)),_0x2c02f9['model']),_0x167efb='suggestion:insertion:'+ot()+':$aiSuggestion';_0x3f0e11['markers']['set'](_0x167efb,_0x57eba2);break;}case'split':{_0x5a13de['batch']['addOperation'](_0xdde75e),_0x2c02f9['model']['applyOperation'](_0xdde75e);const _0x212cc9=_0xdde75e['splitPosition'],_0x2c5f45=_0xdde75e['moveTargetPosition'],_0x12df78=_0x2c02f9['model']['createRange'](_0x212cc9,_0x2c5f45),_0x5da986='suggestion:insertion:'+ot()+':$aiSuggestion';_0x3f0e11['markers']['set'](_0x5da986,_0x12df78);break;}case'move':{_0x5a13de['batch']['addOperation'](_0xdde75e),_0x2c02f9['model']['applyOperation'](_0xdde75e),_0x35cae9[_0x3be2db-0x1]&&'insert'==_0x35cae9[_0x3be2db-0x1]['type']&&Os(_0x3f0e11,_0xdde75e);const _0x557d6d=_0xdde75e['getMovedRangeStart'](),_0x263b71=_0xdde75e['howMany'];for(let _0x2bea43=0x0;_0x2bea43<_0x263b71;_0x2bea43++){const _0xc9f9c5=_0x557d6d['getShiftedBy'](_0x2bea43)['nodeAfter'];_0x431e58['add'](_0xc9f9c5);}break;}case'remove':{const _0xe5d64=_0xdde75e['sourcePosition'],_0x440682=_0xdde75e['howMany'],_0x2a1bbd=new _0x2806e1(_0xe5d64,_0x440682);_0x5a13de['batch']['addOperation'](_0x2a1bbd),_0x2c02f9['model']['applyOperation'](_0x2a1bbd);break;}}}for(const _0x136efa of _0x431e58){const _0x217444=_0x2c02f9['model']['createRangeOn'](_0x136efa),_0x3e2b92='suggestion:formatBlock:$fakeWrap:'+ot()+':$aiSuggestion';_0x3f0e11['markers']['set'](_0x3e2b92,_0xb4a7de(_0x217444,_0x2c02f9['model']));}});}(_0x4f6997,_0x3d0281,_0x5c40a4):_0x5c40a4['model']['change'](_0x18e2df=>{for(const _0x31453c of _0x4f6997)if('remove'==_0x31453c['type']){const _0x1814b8=_0x31453c['sourcePosition'],_0x1ef6d1=_0x31453c['howMany'],_0x90cca2=new _0x2806e1(_0x1814b8,_0x1ef6d1);_0x18e2df['batch']['addOperation'](_0x90cca2),_0x5c40a4['model']['applyOperation'](_0x90cca2);}else{if('marker'==_0x31453c['type']){const _0x3190fc=_0x31453c['name'],_0x5e38c6=_0x31453c['newRange'];null!==_0x5e38c6?_0x3d0281['markers']['set'](_0x3190fc,_0x5e38c6):_0x3d0281['markers']['delete'](_0x3190fc);}else _0x31453c['baseVersion']=null,_0x31453c['isDocumentOperation']=!0x1,_0x18e2df['batch']['addOperation'](_0x31453c),_0x5c40a4['model']['applyOperation'](_0x31453c);}});if(_0x5add92){const _0x361e62=ks(_0x5c40a4,_0x4f6997,_0x3d0281);Ns(_0x5c40a4['model'],_0x361e62),function(_0x3db02d,_0x49c8e8){const _0x2fd567=_0x49c8e8['getFirstRange']()['start'];let _0x4688c6=_0x49c8e8['getFirstRange']()['end'];const _0x119ecb=_0x2fd567['root'];(_0x4688c6['textNode']||_0x4688c6['nodeAfter']&&_0x4688c6['nodeAfter']['is']('$text'))&&(_0x3b1699(_0x4688c6,'...'),_0x4688c6=_0x4688c6['getShiftedBy'](0x3)),(_0x2fd567['textNode']||_0x2fd567['nodeBefore']&&_0x2fd567['nodeBefore']['is']('$text'))&&(_0x3b1699(_0x2fd567,'...'),function(_0xcb952e,_0x44a694,_0x33a968){for(let [_0x3dca5a,_0x4b2676]of _0xcb952e['markers']){const _0x56895d=_0x4b2676['_getTransformedByInsertion'](_0x44a694,_0x33a968,!0x1);_0x4b2676=_0x56895d[0x0],_0xcb952e['markers']['set'](_0x3dca5a,_0x4b2676);}}(_0x119ecb,_0x2fd567,0x3),_0x2fd567['parent']==_0x4688c6['parent']&&(_0x4688c6=_0x4688c6['getShiftedBy'](0x3)));const _0x286ad9=_0x3db02d['createRange'](_0x3db02d['createPositionAt'](_0x119ecb,0x0),_0x2fd567),_0x452218=_0x3db02d['createRange'](_0x4688c6,_0x3db02d['createPositionAt'](_0x119ecb,'end')),_0xfef63b=[..._0x286ad9['getMinimalFlatRanges'](),..._0x452218['getMinimalFlatRanges']()];_0xfef63b['reverse']();for(const _0x5d0688 of _0xfef63b)_0x280b1b(_0x5d0688),ys(_0x119ecb,_0x5d0688);}(_0x5c40a4['model'],_0x361e62);}const _0x134f17=_0x5c40a4['data']['stringify'](_0x3d0281,{'showSuggestionHighlights':!0x0});return{'content':_s(_0x134f17),'hasChanges':!0x0};}(_0x472a50,_0x135148,_0x1871ba,_0x583423,_0x386f73);return{'type':_0x4b32ae['changes'][0x0]['type'],'index':_0x4b32ae['index'],'content':_0x5eb56d,'hasChanges':_0x221453};});}function Os(_0x4fbc1c,_0x4bd256){for(const [_0x16f147,_0x5ea6f2]of _0x4fbc1c['markers']){const _0x56b3f9=_0x1cef76['_createFromRanges'](_0x5ea6f2['getTransformedByOperation'](_0x4bd256));_0x4fbc1c['markers']['set'](_0x16f147,_0x56b3f9);}}function ks(_0x1f9cd7,_0x508325,_0x852cc5){const _0x547654=_0x1f9cd7['plugins']['get']('DocumentCompare');let _0xcf63f0=_0x1f9cd7['model']['createPositionAt'](_0x852cc5,Number['POSITIVE_INFINITY']),_0x3037c3=_0x1f9cd7['model']['createPositionAt'](_0x852cc5,0x0);for(const _0x5b5611 of _0x508325){let _0x1243d5,_0x4433c1;if(_0x547654['isMarkedRemoveOperation'](_0x5b5611))_0x1243d5=_0x5b5611['newRange']['start'],_0x4433c1=_0x5b5611['newRange']['end'];else switch(_0xcf63f0=_0xcf63f0['getTransformedByOperation'](_0x5b5611),_0x3037c3=_0x3037c3['getTransformedByOperation'](_0x5b5611),_0x5b5611['type']){case'rename':_0x1243d5=_0x5b5611['position'],_0x4433c1=_0x1243d5['getShiftedBy'](0x1);break;case'addAttribute':case'removeAttribute':case'changeAttribute':_0x1243d5=_0x5b5611['range']['start'],_0x4433c1=_0x5b5611['range']['end'];break;case'insert':_0x1243d5=_0x5b5611['position'],_0x4433c1=_0x1243d5['getShiftedBy'](_0x5b5611['howMany']);break;case'split':_0x1243d5=_0x5b5611['splitPosition'],_0x4433c1=_0x5b5611['moveTargetPosition'];break;case'merge':{const _0x176b42=_0x5b5611['targetPosition']['path']['slice'](0x0,-0x1);_0x1243d5=_0x1f9cd7['model']['createPositionFromPath'](_0x852cc5,_0x176b42),_0x4433c1=_0x1243d5['getShiftedBy'](0x1);break;}case'move':case'remove':{const _0x24c589=_0x5b5611['howMany'],_0x4fa1df=_0x5b5611['sourcePosition']['_getTransformedByInsertion'](_0x5b5611['targetPosition'],_0x24c589),_0x1fb874=_0x5b5611['getMovedRangeStart']();'remove'==_0x5b5611['type']?(_0x1243d5=_0x4fa1df,_0x4433c1=_0x4fa1df):(_0x1243d5=_0x1fb874,_0x4433c1=_0x1fb874['getShiftedBy'](_0x24c589));break;}}_0x1243d5&&_0x1243d5['isBefore'](_0xcf63f0)&&(_0xcf63f0=_0x1243d5['clone'](),_0xcf63f0['stickiness']='toNone'),_0x4433c1&&_0x4433c1['isAfter'](_0x3037c3)&&(_0x3037c3=_0x4433c1['clone'](),_0x3037c3['stickiness']='toNone');}return _0x1f9cd7['model']['createSelection'](_0x1f9cd7['model']['createRange'](_0xcf63f0,_0x3037c3));}function Ns(_0x5d86ae,_0x1b237b){vs(_0x5d86ae,_0x1b237b,'forward');const _0x5185f8=_0x1b237b['getFirstRange']();_0x1b237b['setTo']([]),_0x1b237b['setTo'](_0x5185f8,{'backward':!0x0}),vs(_0x5d86ae,_0x1b237b,'backward');}function vs(_0x4523e3,_0x220bc4,_0x4bac26){let _0x4e371f=0x14;for(;_0x4e371f;){_0x4523e3['modifySelection'](_0x220bc4,{'unit':'word','direction':_0x4bac26}),_0x4e371f--;const _0x252ef1=_0x220bc4['focus']['forward'==_0x4bac26?'nodeBefore':'nodeAfter'];if(_0x252ef1&&_0x252ef1['is']('element')&&_0x4523e3['schema']['isBlock'](_0x252ef1)&&_0x4523e3['schema']['isObject'](_0x252ef1))break;}}function ys(_0xe9cb36,_0x40c5ae){for(const [_0x4c69f0,_0xb0595]of _0xe9cb36['markers']){const _0x5102a8=_0xb0595['_getTransformedByDeletion'](_0x40c5ae['start'],_0x40c5ae['end']['offset']-_0x40c5ae['start']['offset']);null!=_0x5102a8?_0xe9cb36['markers']['set'](_0x4c69f0,_0x5102a8):_0xe9cb36['markers']['delete'](_0x4c69f0);}}class xs extends ht(){['id'];['interactionId'];['type'];['sources']=[];['parsedContent']=new _0x5eb144([]);['parsedMergedContent']=new _0x5eb144([]);['changeGroups']=[];['areActionsDisabled']=!0x1;['isFromHistory']=!0x1;['documentContextContent'];['documentId'];['dataIdDocumentSources'];['newNodeAnchorIds']=new Map();['aiResponseParser'];['aiResponseApplier'];['locale'];['cachedSuggestionContentParts']={'withDiff':[],'withoutDiff':[]};constructor({type:_0x1e7441,content:_0x2dd45b='',isDone:_0x4fcbe0=!0x1,isComplete:_0x28f722,interactionId:_0x4bb63f,areActionsDisabled:_0x10e446,isFromHistory:_0x4fbe72=!0x1,documentContextContent:_0x258391,dataIdDocumentSources:_0xd87f69,documentId:_0x1b6d38,locale:_0x27ed7c,id:_0x367d41}){super(),this['id']=_0x367d41||ot(),this['interactionId']=_0x4bb63f,this['type']=_0x1e7441,this['areActionsDisabled']=!!_0x10e446,this['locale']=_0x27ed7c,this['dataIdDocumentSources']=_0xd87f69,this['documentId']=_0x1b6d38,this['isFromHistory']=_0x4fbe72,this['aiResponseParser']=new bs(),this['aiResponseApplier']=new Ss(),this['documentContextContent']=_s(_0x258391||''),this['set']('isDone',_0x4fcbe0),this['set']('isComplete',_0x28f722??_0x4fcbe0),this['on']('change:content',()=>{this['onContentChange']();}),this['set']('content',_0x2dd45b);}['appendContent'](_0x492093){this['set']('content',this['content']+_0x492093);}['done'](_0x4162e8=!0x0){this['isComplete']=_0x4162e8,this['isDone']||(this['set']('isDone',!0x0),this['onContentChange']());}['destroy'](){this['stopListening']();}['setChangeGroupState'](_0x43d87e,_0x326edb){this['changeGroups'][_0x43d87e]['state']=_0x326edb,this['fire']('replyChangeGroupStateUpdated',{'reply':this,'index':_0x43d87e,'state':_0x326edb});}['getContentParts']({showDiff:_0x5b7072,groupIndex:_0x3bb520,editor:_0x5504b7}){const _0x2c6906=this['_getCachedContentParts'](_0x5b7072,_0x3bb520);if(_0x2c6906)return _0x2c6906;let _0x2e1e80=[];if(void 0x0===_0x3bb520)_0x2e1e80=this['changeGroups'];else{const _0x4719b3=this['changeGroups']['find'](({index:_0x2bc4d6})=>_0x2bc4d6===_0x3bb520);if(!_0x4719b3)throw new at('ai-reply-get-content-parts-group-not-found',null,{'aiReply':this,'groupIndex':_0x3bb520});_0x2e1e80=[_0x4719b3];}const _0x205517=Rs({'editor':_0x5504b7,'showDiff':_0x5b7072,'changeGroups':_0x2e1e80,'documentContextContent':this['documentContextContent']});return this['_setCachedContentParts'](_0x5b7072,_0x205517),_0x205517;}['_getCachedContentParts'](_0x4a8830,_0x318523){const _0x22c8df=_0x4a8830?'withDiff':'withoutDiff';if(!this['cachedSuggestionContentParts'][_0x22c8df]['length'])return null;const _0x2630b1=this['cachedSuggestionContentParts'][_0x22c8df];if(void 0x0===_0x318523)return _0x2630b1['length']>0x0&&_0x2630b1['length']!==this['changeGroups']['length']?(this['_setCachedContentParts'](_0x4a8830,null),null):_0x86918d(_0x2630b1);{const _0x48353b=_0x2630b1['find'](({index:_0x5621a4})=>_0x5621a4===_0x318523);if(_0x48353b)return[_0x86918d(_0x48353b)];}return null;}['_setCachedContentParts'](_0x2f8618,_0x430b7b){const _0x56b821=_0x2f8618?'withDiff':'withoutDiff';_0x430b7b?_0x430b7b['forEach'](_0x2196ed=>{const _0x3f999a=this['cachedSuggestionContentParts'][_0x56b821],_0x429253=_0x3f999a['find'](({index:_0x2a0f06})=>_0x2a0f06===_0x2196ed['index']);if(_0x429253){const _0x3ba2ad=_0x3f999a['indexOf'](_0x429253);_0x3f999a['splice'](_0x3ba2ad,0x1,_0x2196ed);}else _0x3f999a['push'](_0x2196ed);}):this['cachedSuggestionContentParts'][_0x56b821]['length']=0x0;}['onContentChange'](){if('modification'===this['type']){this['parsedContent']=this['aiResponseParser']['parseAndNormalizeHTML'](this['content']);const _0x2d3314=this['changeGroups'];this['updateChangeGroups']();const _0x50f6a1=this['_getDifferentChangeGroups'](_0x2d3314,this['changeGroups']);(_0x50f6a1['length']||this['isDone'])&&(this['fire']('replyContentUpdated',this,_0x50f6a1),this['cachedSuggestionContentParts']['withDiff']['length']=this['cachedSuggestionContentParts']['withoutDiff']['length']=0x0);}else this['parsedContent']=this['aiResponseParser']['convertMarkdownToHTML'](this['content']),this['fire']('replyContentUpdated',this);}['_getDifferentChangeGroups'](_0x246921,_0x454df7){const _0x37cd4a=[];for(const _0x11ad91 of _0x454df7){const _0x10f53f=_0x246921[_0x11ad91['index']];_0x10f53f?_0x10f53f['changes']['length']!==_0x11ad91['changes']['length']?_0x37cd4a['push'](_0x11ad91):_0x10f53f['changes']['forEach']((_0xb78595,_0x2b169e)=>{const _0x161ce9=_0x11ad91['changes'][_0x2b169e];_0xb78595['id']!==_0x161ce9['id']&&_0x37cd4a['push'](_0x11ad91);}):_0x37cd4a['push'](_0x11ad91);}return _0x37cd4a;}['updateChangeGroups'](){const _0x3bb06f=this['locale']?new _0x3eba9e('p',{},[new _0x3eba9e('span',{'style':'color:\x20#808080;\x20font-style:\x20italic'},[new _0x17483f(hs(this['locale'],'AI_SUGGESTION_CONTENT_PART_REMOVED'))])]):void 0x0,_0x4df981=this['aiResponseApplier']['merge'](this['parsedContent'],this['documentContextContent']['cloneNode'](!0x0),{'markUnstableElements':!this['isDone']||!this['isComplete'],'replaceRemovedWith':_0x3bb06f,'cutAfterLastChange':!this['isDone']||!this['isComplete']});if(!_0x4df981['modifiedNodeIds']['length']&&!this['isDone'])return;this['parsedMergedContent']=_0x4df981['parsedContent'],this['newNodeAnchorIds']=_0x4df981['newAnchorIds'];let _0xfbd063=[];if(_0x32a0d0(_0x54069d=>{const _0x352181=Es(_0x54069d,'data-id');if(!_0x352181||!_0x165608(_0x352181))return!0x1;const _0x54a66c=[_0x54069d,...Ts(_0x54069d)]['at'](-0x2);if(_0x54069d!=_0x54a66c){const _0x317f12=Es(_0x54a66c,'data-id');_0x165608(_0x317f12)||(_0xfbd063['push']({'node':_0x54a66c,'id':_0x317f12,'type':'modified'}),_0x4df981['modifiedNodeIds']['push'](_0x317f12));}else _0x4df981['modifiedNodeIds']['includes'](_0x352181)?_0xfbd063['push']({'node':_0x54069d,'type':'modified','id':_0x352181}):_0x4df981['newNodeIds']['includes'](_0x352181)?_0xfbd063['push']({'node':_0x54069d,'type':'new','id':_0x352181,'anchorId':Es(_0x54069d['previousSibling'],'data-id')}):_0xfbd063['push']({'node':_0x54069d,'type':'removed','id':_0x352181});return!0x0;},this['parsedMergedContent']),_0xfbd063=_0xfbd063['filter'](({node:_0x97b154})=>[...Ts(_0x97b154),_0x97b154]['every'](_0xac4b24=>!Es(_0xac4b24,'data-unstable'))),0x0==_0xfbd063['length'])return;const _0x40bbc3=[[_0xfbd063[0x0]]];for(let _0x2e032a=0x1;_0x2e032a<_0xfbd063['length'];_0x2e032a++){const _0x1e2a68=_0x40bbc3[_0x40bbc3['length']-0x1],_0x2590bd=_0x1e2a68[_0x1e2a68['length']-0x1];_0xfbd063[_0x2e032a]['node']['previousSibling']==_0x2590bd['node']&&'modified'!=_0xfbd063[_0x2e032a]['type']&&'modified'!=_0x2590bd['type']&&this['_isSameDocument'](_0xfbd063[_0x2e032a]['node'],_0x2590bd['node'])?_0x1e2a68['push'](_0xfbd063[_0x2e032a]):_0x40bbc3['push']([_0xfbd063[_0x2e032a]]);}for(const _0x4ef155 of _0x40bbc3){const _0x247184=_0x4ef155[0x0],_0x5d3786=_0x4ef155[_0x4ef155['length']-0x1],_0x129c66=_0x5e9938(_0x247184['node']['previousSibling']);_0x129c66&&this['_isSameDocument'](_0x129c66['node'],_0x247184['node'])&&_0x4ef155['unshift'](_0x129c66);const _0x28e5ff=_0x5e9938(_0x5d3786['node']['nextSibling']);_0x28e5ff&&this['_isSameDocument'](_0x28e5ff['node'],_0x5d3786['node'])&&_0x4ef155['push'](_0x28e5ff);}function _0x165608(_0x86c531){return _0x4df981['modifiedNodeIds']['includes'](_0x86c531)||_0x4df981['newNodeIds']['includes'](_0x86c531)||_0x4df981['removedNodeIds']['includes'](_0x86c531);}function _0x5e9938(_0x27ba56){if(_0x27ba56&&Es(_0x27ba56,'data-id')&&!Es(_0x27ba56,'data-unstable')){const _0xcb104d=Es(_0x27ba56,'data-id');if(!_0x165608(_0xcb104d))return{'node':_0x27ba56,'type':'context','id':_0xcb104d};}return null;}this['changeGroups']=_0x40bbc3['map']((_0x167734,_0x25ef84)=>({'changes':_0x167734,'state':'pending','index':_0x25ef84}));}['_isSameDocument'](_0x4ea46c,_0x2093d9){if(!this['dataIdDocumentSources']?.['size'])return!0x0;const _0xdc37ad=this['_resolveDocumentSource'](_0x4ea46c),_0x13b97c=this['_resolveDocumentSource'](_0x2093d9);return!_0xdc37ad||!_0x13b97c||_0xdc37ad['editor']===_0x13b97c['editor']&&_0xdc37ad['rootName']===_0x13b97c['rootName'];}['_resolveDocumentSource'](_0x39d342){if(!_0x39d342||!this['dataIdDocumentSources'])return;const _0x913f56=Es(_0x39d342,'data-id');if(_0x913f56){const _0x3032d0=this['dataIdDocumentSources']['get'](_0x913f56);if(_0x3032d0)return _0x3032d0;const _0x5442ec=this['newNodeAnchorIds']['get'](_0x913f56),_0x2851f4=_0x5442ec?this['dataIdDocumentSources']['get'](_0x5442ec):void 0x0;if(_0x2851f4)return _0x2851f4;}for(let _0x35b2b8=_0x39d342['previousSibling'];_0x35b2b8;_0x35b2b8=_0x35b2b8['previousSibling']){const _0x458230=Es(_0x35b2b8,'data-id'),_0x180653=_0x458230?this['dataIdDocumentSources']['get'](_0x458230):void 0x0;if(_0x180653)return _0x180653;}for(let _0x3c3dfa=_0x39d342['nextSibling'];_0x3c3dfa;_0x3c3dfa=_0x3c3dfa['nextSibling']){const _0x5dcc52=Es(_0x3c3dfa,'data-id'),_0x58b352=_0x5dcc52?this['dataIdDocumentSources']['get'](_0x5dcc52):void 0x0;if(_0x58b352)return _0x58b352;}}}const Ls=['interactionCreated','interactionStarted','interactionStopped','interactionFinished','interactionDestroyed','replyCreated','replyContentUpdated','replyChangeGroupStateUpdated','setConversationTitle','webSearchStarted','webSearchFinished','reasoningStarted','reasoningFinished','toolDataReceived','error'];class Ds extends Tt(){['id'];['replies']=[];['currentReply'];['messageId'];['actionCallId'];['currentRequest'];['connector'];['isStopped']=!0x1;['isDestroyed']=!0x1;['locale'];['_isReasoning']=!0x1;['_isWebSearching']=!0x1;constructor({connector:_0x4ab64b,locale:_0xa926a}){super(),this['id']=ot(),this['connector']=_0x4ab64b,this['isStopped']=!0x0,this['locale']=_0xa926a;}async['start'](){const _0x541c4a=[];let _0x476c04,_0x1e47cd,_0x203714,_0x3551ce=!0x1;this['isStopped']=!0x1;try{this['currentRequest']=await this['sendRequest'](),this['fire']('interactionStarted',this);const _0x63cd9d=await this['currentRequest']['getStream']();for await(const _0x1639db of _0x63cd9d){if(this['isStopped'])return;if('error'==_0x1639db['event'])return void this['fire']('error',{'error':new at('ai-chat-interaction-error',this)});switch(_0x1639db['event']){case'message-metadata':this['messageId']=_0x1639db['data']['messageId'];break;case'action-metadata':this['actionCallId']=_0x1639db['data']['callId'];break;case'conversation-title':this['setConversationTitle'](_0x1639db['data']['conversationTitle'],!0x0);break;case'source':_0x541c4a['push'](_0x1639db['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'](),_0x476c04='modification-delta'==_0x1639db['event']?'modification':'text',_0x1e47cd='modification-delta'==_0x1639db['event']?_0x1639db['data']['id']:void 0x0,this['currentReply']&&this['currentReply']['type']!=_0x476c04&&(this['currentReply']['done'](),this['currentReply']=void 0x0),this['currentReply']?'modification-delta'==_0x1639db['event']&&(this['currentReply']['documentId']=_0x1639db['data']['documentId']):(this['currentReply']=this['createReply']({'type':_0x476c04,'interactionId':this['id'],'id':_0x1e47cd,...'modification-delta'==_0x1639db['event']&&{'documentId':_0x1639db['data']['documentId']}}),'modification'==_0x476c04&&(this['currentReply']['sources']=_0x541c4a['splice'](0x0))),this['currentReply']['appendContent'](_0x1639db['data']['textDelta']);break;case'mcp-tool-result':_0x203714=JSON['parse'](_0x1639db['data']['result']),this['_handleToolResultData']({'toolName':_0x1639db['data']['toolName'],'data':_0x203714['data'],'attributes':_0x203714['attributes']});break;case'mcp-tool-notification':this['_handleToolNotificationData']({'toolName':_0x1639db['data']['toolName'],'data':_0x1639db['data']['data']});}}_0x3551ce=!0x0;}finally{this['isStopped']||(this['currentReply']&&_0x541c4a['length']>0x0&&(this['currentReply']['sources']=_0x541c4a['splice'](0x0)),this['_finalizeInteraction'](_0x3551ce),this['fire']('interactionFinished',this));}}['stop'](){this['isStopped']||(this['_finalizeInteraction'](),this['fire']('interactionStopped',this));}['getReply'](_0x477063){return this['replies']['find'](_0xdb424a=>_0xdb424a['id']===_0x477063);}['destroy'](){this['isDestroyed']||(this['stop'](),this['replies']['forEach'](_0x117f87=>_0x117f87['destroy']()),this['replies']=[],this['isDestroyed']=!0x0,this['fire']('interactionDestroyed',this),this['stopListening']());}['createReply'](_0x393029){const _0x3b74f5=new xs({'locale':this['locale'],'documentContextContent':this['getDocumentContext']()?.['content'],'dataIdDocumentSources':this['getDocumentContext']()?.['dataIdDocumentSources'],..._0x393029});return this['replies']['push'](_0x3b74f5),_0x3b74f5['delegate'](...Ls)['to'](this),this['fire']('replyCreated',_0x3b74f5),_0x3b74f5;}['setConversationTitle'](_0x59a537,_0xd1432c=!0x1){this['fire']('setConversationTitle',_0x59a537,_0xd1432c);}['resetWebSearchState'](){this['_isWebSearching']&&(this['_isWebSearching']=!0x1,this['fire']('webSearchFinished',this));}['resetReasoningState'](){this['_isReasoning']&&(this['_isReasoning']=!0x1,this['fire']('reasoningFinished',this));}['_handleToolResultData'](_0x325270){this['fire']('toolDataReceived',{'type':'result','toolName':_0x325270['toolName'],'data':structuredClone(_0x325270['data']||{}),'attributes':structuredClone(_0x325270['attributes']||{})},this);}['_handleToolNotificationData'](_0x2473b1){this['fire']('toolDataReceived',{'type':'notification','toolName':_0x2473b1['toolName'],'data':structuredClone(_0x2473b1['data'])},this);}['_finalizeInteraction'](_0x558898=!0x1){this['isStopped']=!0x0,this['currentRequest']&&this['currentRequest']['abortController']['abort'](),this['currentReply']&&this['currentReply']['done'](_0x558898),this['currentRequest']=this['currentReply']=void 0x0;}}const Ps=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']]),Hs=['contextItemAdded','contextItemRemoved','contextItemLoadingEnded','contextSent','error','addContextOptionsChanged','sourceResourcesLoaded','resourceStateChanged','uploadProgressChanged'];class Ms extends ht(){['_connector'];['_config'];['_ownerId'];constructor({connector:_0x555da4,config:_0x8a6dc6,ownerId:_0x3b10e2}){super(),this['_connector']=_0x555da4,this['_config']=_0x8a6dc6,this['_ownerId']=_0x3b10e2;}['init'](){this['_pendingContextItems']=new Map(),this['_conversationContextItems']=new Map(),this['_ongoingUploads']=new Map(),this['_ongoingUploadOperations']=new Map(),this['_documentSources']=new Map(),this['_dataIdToSource']=new Map(),this['_setAddContextOptionsDefaultState']();}['getDocumentSource'](_0x1dff9f){if(_0x1dff9f)return this['_documentSources']['get'](_0x1dff9f);}['getSourceByDataId'](_0x35ee02){if(_0x35ee02)return this['_dataIdToSource']['get'](_0x35ee02);}['getDocumentContextSlice'](_0x3fa1e4){const _0x20d739=this['getDocumentSource'](_0x3fa1e4);if(_0x20d739)return{'editor':_0x20d739['editor'],'rootName':_0x20d739['rootName'],'html':_0x20d739['content'],'version':_0x20d739['version']};}['getDocumentContextSliceByDataId'](_0x243896){const _0x435c71=this['getSourceByDataId'](_0x243896);return _0x435c71?this['getDocumentContextSlice'](_0x435c71['documentId']):void 0x0;}['getPendingContextItems'](){return this['_pendingContextItems'];}async['populateFromMessage'](_0x419632){const _0x227e67=await this['_createContextItemFromContent'](_0x419632);return this['_addToConversationContextItem'](_0x227e67),'current-document'===_0x227e67['uiId']&&this['_toggleAddCurrentDocumentOptionVisibility'](),_0x227e67;}async['populateDocumentsFromUserMessage'](_0x413ea7,_0x453922){const _0x2b58df=_0x413ea7['filter'](_0x42ff04=>'document'===_0x42ff04['type']);if(0x0===_0x2b58df['length'])return{'hasUnmatched':!0x1};if(0x1===_0x2b58df['length'])return{'contextItem':await this['populateFromMessage'](_0x2b58df[0x0]),'hasUnmatched':!0x1};const _0x5bda09=_0x2b58df['map'](_0x195001=>_0x195001['id']),_0xc39409=await this['_connector']['fetchDocuments'](this['_ownerId'],_0x5bda09)['getDocuments'](),_0x5681d3=new Map(_0xc39409['map'](_0x4dbeee=>[_0x4dbeee['id'],_0x4dbeee]));this['_documentSources']['clear'](),this['_dataIdToSource']['clear']();const _0x5437db=[];let _0x256b6f=!0x1;for(const _0x196584 of _0x2b58df){const _0x1ae429=_0x5681d3['get'](_0x196584['id']);if(!_0x1ae429)continue;const _0x12f67a=this['_matchDocumentToRoot'](_0x1ae429,_0x453922),_0x4c4c24=_0x453922[0x0]&&this['_getFirstRoot'](_0x453922[0x0]);_0x12f67a||(_0x256b6f=!0x0);const _0x5c94cc=_0x12f67a?.['editor']??_0x4c4c24?.['editor'],_0x1b21f3=_0x12f67a?.['rootName']??_0x4c4c24?.['rootName'];if(_0x5c94cc&&_0x1b21f3){const _0x32dc37={'editor':_0x5c94cc,'rootName':_0x1b21f3,'content':_0x1ae429['content'],'version':_0x1ae429['attributes']?.['version']??0x0,'name':_0x1ae429['name'],'description':_0x1ae429['description']};this['_documentSources']['set'](_0x1ae429['id'],_0x32dc37);const _0x35b0d6=_s(_0x1ae429['content']);for(const _0x3b19a3 of _0x32a0d0(_0x5a4cc6=>!!Es(_0x5a4cc6,'data-id'),_0x35b0d6)){const _0x47c761=Es(_0x3b19a3,'data-id');_0x47c761&&this['_dataIdToSource']['set'](_0x47c761,{..._0x32dc37,'documentId':_0x1ae429['id']});}}_0x5437db['push']({'id':_0x1ae429['id'],'content':_0x1ae429['content'],'version':_0x1ae429['attributes']?.['version']??0x0,'sessionId':_0x1ae429['attributes']?.['sessionId']??null,'selection':[]});}const _0x28ad9f={'id':'current-document','uiId':'current-document','label':'Current\x20document','type':'document','hidden':this['_conversationContextItems']['has']('current-document'),'documents':_0x5437db,'dataIdDocumentSources':new Map(this['_dataIdToSource'])};return this['_addToConversationContextItem'](_0x28ad9f),this['_toggleAddCurrentDocumentOptionVisibility'](),{'contextItem':_0x28ad9f,'hasUnmatched':_0x256b6f};}['_matchDocumentToRoot'](_0x57f24c,_0x59f3f7){if(_0x57f24c['name'])for(const _0xb3d267 of _0x59f3f7){const _0x178e14=_0xb3d267['config']['get']('roots')||{};for(const _0xb6defa of _0xb3d267['model']['document']['getRoots']()){if('$graveyard'===_0xb6defa['rootName'])continue;const _0x345a97=_0x178e14[_0xb6defa['rootName']];if(_0xb6defa['rootName']===_0x57f24c['name']&&_0x345a97?.['description']===_0x57f24c['description'])return{'editor':_0xb3d267,'rootName':_0xb6defa['rootName']};}}}['_getFirstRoot'](_0x442339){for(const _0x4e1d8a of _0x442339['model']['document']['getRoots']())if('$graveyard'!==_0x4e1d8a['rootName'])return{'editor':_0x442339,'rootName':_0x4e1d8a['rootName']};}async['_createContextItemFromContent'](_0x12aedf){if('document'===_0x12aedf['type']){const _0xbd0d85=await this['_connector']['fetchDocument'](this['_ownerId'],_0x12aedf['id'])['getDocument']();return{'id':'current-document','uiId':'current-document','label':'Current\x20document','type':_0x12aedf['type'],'content':_0xbd0d85['content'],'hidden':this['_conversationContextItems']['has']('current-document'),'version':_0xbd0d85['attributes']?.['version'],'sessionId':_0xbd0d85['attributes']?.['sessionId']};}if('mcp-tool-context'===_0x12aedf['type'])return{'id':_0x12aedf['id'],'uiId':_0x12aedf['id'],'label':_0x12aedf['data']?.['label']||_0x12aedf['id'],'type':'mcp-tool-context','mcpServerName':_0x12aedf['mcpServerName'],'toolName':_0x12aedf['toolName'],'data':_0x12aedf['data']||{}};return{'id':_0x12aedf['id'],'uiId':_0x12aedf['id'],'label':_0x12aedf['attributes']?.['label']||_0x12aedf['name']||_0x12aedf['url']||_0x12aedf['id'],'type':_0x12aedf['type'],..._0x12aedf?.['attributes']?.['resourceId']?{'resourceId':_0x12aedf['attributes']?.['resourceId']}:{}};}['getSentContextItems'](){return new Map(this['_conversationContextItems']);}['removeFromContext'](_0x5eab38){const _0x491a74=this['_pendingContextItems']['get'](_0x5eab38);_0x491a74?.['isReadOnly']||this['_removeContextItem'](_0x5eab38);}['clearPendingContextItems'](){if(0x0===this['_pendingContextItems']['size'])return;for(const _0x294bb1 of this['_pendingContextItems']['values']())this['_removeContextItem'](_0x294bb1['uiId']);const _0x9b7421=this['_conversationContextItems']['get']('current-document')||this['_pendingContextItems']['get']('current-document');_0x9b7421&&this['_addContextItem']({..._0x9b7421,'isReadOnly':!0x0,'hidden':!0x0});}['addToConversationContext'](_0x1f7bbd){for(const _0x41cd0d of _0x1f7bbd['values']())this['_addToConversationContextItem'](_0x41cd0d);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'](_0x1b3e8f){return Array['from'](_0x1b3e8f['values']())['flatMap'](_0x67a00=>this['_mapContextItemToRequestData'](_0x67a00));}async['addFilesToContext'](_0x48d927,_0x560463,_0x149d55='file'){const _0x207ce1='files-'+ot();this['_startUploadOperation'](_0x207ce1);try{await Promise['all'](_0x48d927['map'](async _0x528bf4=>{const _0xe7cbfb='file-'+ot(),_0x45bd7a=_0x34635c(_0x528bf4['name']);try{this['_addContextItem']({'type':_0x149d55,'label':_0x560463?.['label']||_0x45bd7a,'uiId':_0xe7cbfb,'resourceId':_0x560463?.['resourceId']},!0x0);const _0x10b8e5=this['_connector']['uploadFile'](this['_ownerId'],_0x528bf4,_0x560463);this['_ongoingUploads']['set'](_0xe7cbfb,_0x10b8e5['abortController']);const {id:_0xbe78e}=await _0x10b8e5['getId']();this['_ongoingUploads']['delete'](_0xe7cbfb),this['_finishContextItemLoading']({'type':_0x149d55,'id':_0xbe78e,'label':_0x560463?.['label']||_0x45bd7a,'uiId':_0xe7cbfb,'resourceId':_0x560463?.['resourceId']},!0x1);}catch(_0x2daed0){this['_ongoingUploads']['delete'](_0xe7cbfb);if(!(_0x2daed0 instanceof at&&_0x2daed0['message']['startsWith']('ai-request-aborted'))){const _0x49e212=Ps['get'](_0x2daed0['code'])||'ai-chat-file-upload-failed',_0x4cb919=new at(_0x49e212,null,{'fileName':_0x45bd7a,..._0x2daed0});_0x4cb919['stack']=_0x2daed0['stack'],this['fire']('error',{'error':_0x4cb919});}this['_removeContextItem'](_0xe7cbfb);}}));}finally{this['_finishUploadOperation'](_0x207ce1);}}['addCurrentDocumentToContext'](_0x5b9092){if(this['isCurrentDocumentInContext']()||!this['_addContextOptionsState']['document']['enabled'])return;const _0x4dc9ac={'type':'document','uiId':'current-document','label':_0x5b9092,'isReadOnly':this['_conversationContextItems']['has']('current-document'),'hidden':this['_conversationContextItems']['has']('current-document')};this['_addContextItem'](_0x4dc9ac);}async['updateCurrentDocument'](_0x3404d9,_0x3ad343,_0x3b4c27,_0x21c5c7){const _0x10a40a=this['_pendingContextItems']['get']('current-document');if(_0x10a40a&&_0x3404d9){_0x10a40a['selection']=_0x21c5c7?_0x21c5c7['map'](_0x36d89f=>({'start':_0x36d89f['start'],'end':_0x36d89f['end']})):[];try{if(_0x10a40a['version']===_0x3ad343)return;const {id:_0x33ceee}=await this['_connector']['uploadDocument'](this['_ownerId'],_0x3404d9,{'version':_0x3ad343,'sessionId':_0x3b4c27})['getId']();_0x10a40a['id']=_0x33ceee,_0x10a40a['content']=_0x3404d9,_0x10a40a['version']=_0x3ad343,_0x10a40a['sessionId']=_0x3b4c27;}catch(_0x466609){const _0x46beb5=new at('ai-chat-document-upload-failed',null);_0x46beb5['stack']=_0x466609['stack'],this['fire']('error',{'error':_0x46beb5});}}}async['updateDocuments'](_0x5aa83d){const _0x488663=this['_pendingContextItems']['get']('current-document');if(!_0x488663||!_0x5aa83d['length']||_0x5aa83d['every'](_0x2cb544=>!_0x2cb544['content']))return;_0x5aa83d['length']>0x1&&_0x5aa83d['some'](_0x3f5740=>!_0x3f5740['description'])&&It('ai-chat-documents-missing-description');const _0x4153e5=_0x8b7eaa=>_0x8b7eaa?_0x8b7eaa['map'](_0x56c537=>({'start':_0x56c537['start'],'end':_0x56c537['end']})):[],_0x37d855=_0x488663['documents']??[];if(_0x37d855['length']===_0x5aa83d['length']&&_0x5aa83d['every']((_0x395e72,_0x4103a4)=>_0x37d855[_0x4103a4]?.['version']===_0x395e72['version']))_0x488663['documents']=_0x37d855['map']((_0x3d76e8,_0x1f2ce8)=>({..._0x3d76e8,'selection':_0x4153e5(_0x5aa83d[_0x1f2ce8]['selections'])}));else try{const _0x50e365=await this['_connector']['uploadDocuments'](this['_ownerId'],_0x5aa83d)['getIds']();_0x488663['documents']=_0x5aa83d['map']((_0x410bff,_0x8ce712)=>({'id':_0x50e365[_0x8ce712]?.['id'],'content':_0x410bff['content'],'version':_0x410bff['version'],'sessionId':_0x410bff['sessionId'],'selection':_0x4153e5(_0x410bff['selections'])})),this['_documentSources']['clear'](),this['_dataIdToSource']['clear']();for(let _0x5cbee6=0x0;_0x5cbee6<_0x5aa83d['length'];_0x5cbee6++){const _0x17feb3=_0x50e365[_0x5cbee6]?.['id'],_0x163441=_0x5aa83d[_0x5cbee6];if(!_0x17feb3)continue;const _0x326699={'editor':_0x163441['editor'],'rootName':_0x163441['rootName'],'content':_0x163441['content'],'version':_0x163441['version'],'name':_0x163441['name'],'description':_0x163441['description']};this['_documentSources']['set'](_0x17feb3,_0x326699);const _0x53612d=_s(_0x163441['content']);for(const _0x428a1b of _0x32a0d0(_0x77cbb0=>!!Es(_0x77cbb0,'data-id'),_0x53612d)){const _0x955ccc=Es(_0x428a1b,'data-id');_0x955ccc&&this['_dataIdToSource']['set'](_0x955ccc,{..._0x326699,'documentId':_0x17feb3});}}_0x488663['dataIdDocumentSources']=new Map(this['_dataIdToSource']);}catch(_0x5b201b){const _0x186e15=new at('ai-chat-document-upload-failed',null);_0x186e15['stack']=_0x5b201b['stack'],this['fire']('error',{'error':_0x186e15});}}['addSelectionToContext'](_0x4dbb00){this['_addContextItem']({'type':'selection','label':_0x4dbb00,'uiId':'selection','content':_0x4dbb00});}['removeSelectionFromContext'](){this['_removeContextItem']('selection');}async['addUrlToContext'](_0x5efa43,_0x446421){const _0x510b47='url-'+ot();this['_startUploadOperation'](_0x510b47);const _0x1f9ed9='url-'+ot();try{this['_addContextItem']({'type':'web-resource','label':_0x446421?.['label']||_0x5efa43,'uiId':_0x1f9ed9,'resourceId':_0x446421?.['resourceId']},!0x0);const _0x431ff0=this['_connector']['uploadUrl'](this['_ownerId'],_0x5efa43,_0x446421);this['_ongoingUploads']['set'](_0x1f9ed9,_0x431ff0['abortController']);const {id:_0x1ef804}=await _0x431ff0['getId']();this['_ongoingUploads']['delete'](_0x1f9ed9),this['_finishContextItemLoading']({'type':'web-resource','id':_0x1ef804,'label':_0x446421?.['label']||_0x5efa43,'uiId':_0x1f9ed9,'resourceId':_0x446421?.['resourceId']},!0x1);}catch(_0x24caea){this['_ongoingUploads']['delete'](_0x1f9ed9),(_0x24caea['message']['startsWith']('ai-request-aborted')||this['fire']('error',{'error':new at('ai-chat-url-upload-failed',this,{'url':_0x5efa43,'originalError':_0x24caea}),'url':_0x5efa43}),this['_removeContextItem'](_0x1f9ed9));}finally{this['_finishUploadOperation'](_0x510b47);}}['addToolItemToContext'](_0x2e10a7){_0x2e10a7['id']=_0x2e10a7['id']??ot()['substring'](0x0,0x15),this['_pendingContextItems']['set'](_0x2e10a7['uiId'],_0x2e10a7),this['fire']('contextItemAdded',{'contextItem':_0x2e10a7,'isLoading':!0x1});}async['loadSourceResources'](_0x12eb71,_0x501a38,_0x5a4239){const _0x4d1da0=this['_addContextOptionsState']['sources']['find'](_0x218965=>_0x218965['id']===_0x12eb71);if(!_0x4d1da0)return this['fire']('error',{'error':new at('ai-chat-source-not-found',this,{'sourceId':_0x12eb71}),'sourceId':_0x12eb71}),[];try{const _0xaace13=(await _0x4d1da0['getResources'](_0x501a38))['map'](_0x3b3b56=>{const _0xe8d950=this['_isResourceInContext'](_0x3b3b56['id']);return{..._0x3b3b56,'isInContext':_0xe8d950};});return _0x4d1da0['resources']=_0xaace13,this['fire']('sourceResourcesLoaded',{'sourceId':_0x12eb71,'source':_0x4d1da0,'resources':_0xaace13,'uid':_0x5a4239}),_0xaace13;}catch(_0x52b337){return this['fire']('error',{'error':new at('ai-chat-source-resources-load-failed',this,{'sourceId':_0x12eb71,'originalError':_0x52b337}),'sourceId':_0x12eb71,'sourceLabel':_0x4d1da0['label']}),[];}}async['addResourceToContext'](_0x3560a1,_0x31f8d4){if(this['_isResourceInContext'](_0x31f8d4['id']))return;let _0x2a1db9=_0x31f8d4['data'];if(!_0x2a1db9&&_0x3560a1['getData'])try{_0x2a1db9=await _0x3560a1['getData'](_0x31f8d4['id']);}catch(_0x3fb598){return void this['fire']('error',{'error':new at('ai-chat-resource-load-failed',this,{'resourceId':_0x31f8d4['id'],'sourceId':_0x3560a1['id'],'originalError':_0x3fb598}),'resourceId':_0x31f8d4['id'],'sourceId':_0x3560a1['id']});}if(_0x2a1db9)switch(_0x31f8d4['type']){case'web-resource':if('string'!=typeof _0x2a1db9)return void this['fire']('error',{'error':new at('ai-chat-context-invalid-data',this,{'resourceId':_0x31f8d4['id'],'sourceId':_0x3560a1['id'],'expectedType':'string','actualType':typeof _0x2a1db9}),'resourceId':_0x31f8d4['id'],'sourceId':_0x3560a1['id']});await this['addUrlToContext'](_0x2a1db9,{'label':_0x31f8d4['label'],'resourceId':_0x31f8d4['id']});break;case'file':if(!(_0x2a1db9 instanceof File))return void this['fire']('error',{'error':new at('ai-chat-context-invalid-data',this,{'resourceId':_0x31f8d4['id'],'sourceId':_0x3560a1['id'],'expectedType':'File','actualType':typeof _0x2a1db9}),'resourceId':_0x31f8d4['id'],'sourceId':_0x3560a1['id']});await this['addFilesToContext']([_0x2a1db9],{'label':_0x31f8d4['label'],'resourceId':_0x31f8d4['id']});break;case'text':if('object'!=typeof _0x2a1db9||!('content'in _0x2a1db9)||!('type'in _0x2a1db9))return void this['fire']('error',{'error':new at('ai-chat-context-invalid-data',this,{'resourceId':_0x31f8d4['id'],'sourceId':_0x3560a1['id'],'expectedType':'object\x20with\x20content\x20and\x20type\x20properties','actualType':typeof _0x2a1db9}),'resourceId':_0x31f8d4['id'],'sourceId':_0x3560a1['id']});_0x2a1db9=Ms['_convertTextResourceToFile'](_0x2a1db9,_0x31f8d4['label']),await this['addFilesToContext']([_0x2a1db9],{'label':_0x31f8d4['label'],'resourceId':_0x31f8d4['id']},'text');break;case'mcp-tool-context':break;default:this['fire']('error',{'error':new at('ai-chat-context-unsupported-type',this,{'resourceId':_0x31f8d4['id'],'sourceId':_0x3560a1['id'],'resourceType':_0x31f8d4['type']}),'resourceId':_0x31f8d4['id'],'sourceId':_0x3560a1['id']});}else this['fire']('error',{'error':new at('ai-chat-resource-no-data',this,{'resourceId':_0x31f8d4['id'],'sourceId':_0x3560a1['id']}),'resourceId':_0x31f8d4['id'],'sourceId':_0x3560a1['id']});}static['_convertTextResourceToFile'](_0x1b3f86,_0x2b9ef6){switch(_0x1b3f86['type']){case'markdown':return new File([_0x1b3f86['content']],_0x2b9ef6,{'type':'text/markdown'});case'html':return new File([_0x1b3f86['content']],_0x2b9ef6,{'type':'text/html'});default:return new File([_0x1b3f86['content']],_0x2b9ef6,{'type':'text/plain'});}}static['_mapContextItemToRequestData'](_0x22a56f){switch(_0x22a56f['type']){case'file':case'text':return[{'type':'file','id':_0x22a56f['id']}];case'web-resource':return[{'type':'web-resource','id':_0x22a56f['id']}];case'document':return _0x22a56f['documents']?.['length']?_0x22a56f['documents']['map'](_0x17c1fe=>({'type':'document','id':_0x17c1fe['id'],..._0x17c1fe['selection']?.['length']&&{'selection':_0x17c1fe['selection']}})):[{'type':'document','id':_0x22a56f['id'],..._0x22a56f['selection']?.['length']&&{'selection':_0x22a56f['selection']}}];case'mcp-tool-context':{const _0x36f2b1=_0x22a56f;return[{'type':'mcp-tool-context','mcpServerName':_0x36f2b1['mcpServerName'],'toolName':_0x36f2b1['toolName'],'data':{..._0x36f2b1['data'],'label':_0x36f2b1['label']||_0x36f2b1['data']?.['label']||_0x36f2b1['id']},'id':_0x36f2b1['id']}];}default:return[];}}['_addContextItem'](_0x54f4bb,_0x16beb2=!0x1){if(this['_pendingContextItems']['set'](_0x54f4bb['uiId'],_0x54f4bb),_0x54f4bb['hidden']||this['fire']('contextItemAdded',{'contextItem':_0x54f4bb,'isLoading':_0x16beb2}),'current-document'===_0x54f4bb['uiId']&&this['_toggleAddCurrentDocumentOptionVisibility'](),_0x54f4bb['resourceId']){const _0x70541=this['_findSourceIdsByResourceId'](_0x54f4bb['resourceId']);_0x70541&&_0x70541['forEach'](_0x539395=>{this['_updateResourceInContextState'](_0x539395,_0x54f4bb['resourceId'],!0x0);});}}['_removeContextItem'](_0x4c01aa){const _0xc876ac=this['_pendingContextItems']['get'](_0x4c01aa),_0x59c006=this['_ongoingUploads']['get'](_0x4c01aa);if(_0x59c006&&(_0x59c006['abort'](),this['_ongoingUploads']['delete'](_0x4c01aa)),_0xc876ac?.['resourceId']){const _0x327bf4=this['_findSourceIdsByResourceId'](_0xc876ac['resourceId']);_0x327bf4&&_0x327bf4['forEach'](_0x3b14e8=>{this['_updateResourceInContextState'](_0x3b14e8,_0xc876ac['resourceId'],!0x1);});}this['_pendingContextItems']['delete'](_0x4c01aa),this['fire']('contextItemRemoved',{'uiId':_0x4c01aa,'type':_0xc876ac?.['type']}),'current-document'===_0x4c01aa&&this['_toggleAddCurrentDocumentOptionVisibility']();}['_finishContextItemLoading'](_0x322bae,_0x21d80b){if(this['_pendingContextItems']['has'](_0x322bae['uiId'])&&(this['_pendingContextItems']['set'](_0x322bae['uiId'],_0x322bae),this['fire']('contextItemLoadingEnded',{'contextItem':_0x322bae,'isLoading':_0x21d80b}),_0x322bae['resourceId'])){const _0x1a0318=this['_findSourceIdsByResourceId'](_0x322bae['resourceId']);_0x1a0318&&_0x1a0318['forEach'](_0x4c462c=>{this['_updateResourceInContextState'](_0x4c462c,_0x322bae['resourceId'],!0x0);});}}['_addToConversationContextItem'](_0x49338c){this['_conversationContextItems']['set'](_0x49338c['uiId'],_0x49338c);}['_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'](_0xc9d246=>({..._0xc9d246,'enabled':!0x0}))??[]},this['fire']('addContextOptionsChanged',{'options':this['_addContextOptionsState']});}['_getCustomSourcesInitialState'](){return this['_config']?.['sources']?.['map'](_0x6f22f0=>({..._0x6f22f0,'resources':[]}))??[];}['_toggleAddCurrentDocumentOptionVisibility'](){const _0x4a713b=this['isCurrentDocumentInContext']()||this['isCurrentDocumentInConversation']();this['_addContextOptionsState']['document']['isHidden']=_0x4a713b,this['fire']('addContextOptionsChanged',{'options':this['_addContextOptionsState']});}['_isResourceInContext'](_0x494e51){for(const _0x477a06 of this['_pendingContextItems']['values']())if(_0x477a06['resourceId']===_0x494e51)return!0x0;for(const _0x148a4d of this['_conversationContextItems']['values']())if(_0x148a4d['resourceId']===_0x494e51)return!0x0;return!0x1;}['_findSourceIdsByResourceId'](_0x455aec){const _0x1ae70e=[];for(const _0xde891c of this['_addContextOptionsState']['sources']){_0xde891c['resources']['find'](_0x311c74=>_0x311c74['id']===_0x455aec)&&_0x1ae70e['push'](_0xde891c['id']);}return 0x0===_0x1ae70e['length']?null:_0x1ae70e;}['_updateResourceInContextState'](_0xf4daf6,_0x495b9c,_0x5229be){const _0x2534f1=this['_addContextOptionsState']['sources']['find'](_0xc0c466=>_0xc0c466['id']===_0xf4daf6);if(!_0x2534f1)return;const _0x238b1a=_0x2534f1['resources']['find'](_0x9319eb=>_0x9319eb['id']===_0x495b9c);_0x238b1a&&(_0x238b1a['isInContext']=_0x5229be,this['fire']('resourceStateChanged',{'sourceId':_0xf4daf6,'resourceId':_0x495b9c,'isInContext':_0x5229be}));}['_startUploadOperation'](_0x5d3759){this['_ongoingUploadOperations']['set'](_0x5d3759,!0x0),this['_ongoingUploadOperations']['size']&&this['fire']('uploadProgressChanged',{'isUploadInProgress':!0x0});}['_finishUploadOperation'](_0x19958b){this['_ongoingUploadOperations']['delete'](_0x19958b),0x0===this['_ongoingUploadOperations']['size']&&this['fire']('uploadProgressChanged',{'isUploadInProgress':!0x1});}}const Us=['capabilitiesUpdated'];class Vs extends Tt(){['_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'](_0x3a9f97){const _0x559b89={};return _0x3a9f97&&_0x3a9f97['isWebSearchEnabled']&&(_0x559b89['webSearch']={}),_0x3a9f97&&_0x3a9f97['isReasoningEnabled']&&(_0x559b89['reasoning']={}),_0x559b89;}['toggleWebSearch'](){this['setWebSearch'](!this['_isWebSearchEnabled']);}['toggleReasoning'](){this['setReasoning'](!this['_isReasoningEnabled']);}['setWebSearch'](_0x4f60a6){_0x4f60a6!==this['_isWebSearchEnabled']&&(this['_isWebSearchEnabled']=_0x4f60a6,this['fire']('capabilitiesUpdated',this['getCapabilitiesConfig']()));}['setReasoning'](_0x3409a0){_0x3409a0!==this['_isReasoningEnabled']&&(this['_isReasoningEnabled']=_0x3409a0,this['fire']('capabilitiesUpdated',this['getCapabilitiesConfig']()));}}class Bs extends Ds{['userMessage'];['conversationId'];['contextItems']=new Map();['capabilities'];['model'];['attributes'];constructor(_0xc54e9e){super(_0xc54e9e),this['conversationId']=_0xc54e9e['conversationId'],this['contextItems']=_0xc54e9e['contextItems'],this['capabilities']=_0xc54e9e['capabilities'],this['userMessage']=_0xc54e9e['userMessage'],this['model']=_0xc54e9e['model'],this['attributes']=_0xc54e9e['attributes'];}async['sendRequest'](){return this['connector']['queryAssistant']({'message':this['userMessage'],'conversationId':this['conversationId'],'parts':Ms['mapContextItemsToRequestData'](this['contextItems']),'capabilities':Vs['getCapabilitiesRequestData'](this['capabilities']),'model':this['model'],'attributes':this['attributes']});}['getDocumentContext'](){return this['contextItems']['get']('current-document');}['createReply'](_0x269297){const _0xf0f633=this['getDocumentContext']();if(_0xf0f633?.['documents']?.['length']){const _0x3f9baa=_0xf0f633['documents']['map'](_0x38c038=>_0x38c038['content']??'')['join']('');if(_0x3f9baa)return super['createReply']({'documentContextContent':_0x3f9baa,..._0x269297});}return super['createReply'](_0x269297);}}class Gs extends Tt(){['id'];['isStarted']=!0x1;['isFromHistory'];['interactions']=[];['currentInteraction'];['selectedModel'];['connector'];['options'];constructor(_0x259f07){super(),this['options']=_0x259f07,this['connector']=_0x259f07['connector'],this['chatModels']=_0x259f07['chatModels'],this['id']=_0x259f07['conversationId'],this['isFromHistory']=_0x259f07['isFromHistory'];}async['init'](_0x1851c4){try{this['chatContext']=new Ms({'connector':this['connector'],'config':_0x1851c4,'ownerId':this['id']}),this['chatContext']['delegate'](...Hs)['to'](this),this['chatContext']['init'](),this['chatCapabilities']=new Vs(),this['chatCapabilities']['delegate'](...Us)['to'](this),this['chatCapabilities']['init']();const _0x34132f=await this['chatModels']['getAvailableModels']();this['fire']('conversationInitialized',{'availableModels':_0x34132f});const _0x21592d=await this['chatModels']['getModel'](this['options']['selectedModelId']);_0x21592d&&await this['setModel'](_0x21592d);}catch(_0x36cf81){const _0x479de3=new at('ai-chat-conversation-init-failed',null,{'message':_0x36cf81['message']||_0x36cf81});_0x479de3['stack']=_0x36cf81['stack'],this['fire']('error',{'error':_0x479de3});}}async['start'](){if(this['isStarted'])throw new at('ai-chat-conversation-already-started',null,{'conversation':this});if(!this['selectedModel'])throw new at('ai-chat-conversation-start-no-model-selected',null,{'conversation':this});try{const {id:_0x6a9d63}=await this['connector']['startConversation'](this['id'],this['options']['group'])['getConversation']();this['id']=_0x6a9d63,this['isStarted']=!0x0,this['fire']('conversationStarted',{'conversationId':this['id'],'selectedModel':this['selectedModel']});}catch(_0x22885c){const _0xdd9d5b=new at('ai-chat-conversation-start-failed',null,{'message':_0x22885c['message'],'conversationId':this['id']});throw _0xdd9d5b['stack']=_0x22885c['stack'],this['fire']('error',{'error':_0xdd9d5b}),_0xdd9d5b;}}async['load'](_0x2ca9da,_0x3c6bcd){try{const _0x34adb5=await this['connector']['fetchConversation'](_0x2ca9da)['getConversation'](),_0x1eb46c=await this['connector']['fetchConversationMessages'](_0x2ca9da)['getMessages'](),_0x3c2c69=_0x1eb46c[0x0]['model'];this['isStarted']=!0x0,this['id']=_0x34adb5['id'],'title'in _0x34adb5?this['fire']('setConversationTitle',_0x34adb5['title'],!0x0):this['fire']('setConversationTitle','',!0x0);const _0x36ff8e=(await this['chatModels']['getAll']())['find'](_0x1a2d7c=>_0x1a2d7c['id']['toLowerCase']()===_0x3c2c69['toLowerCase']());return this['selectedModel']=_0x36ff8e,this['fire']('modelSelected',{'selectedModel':_0x36ff8e,'isDisabled':!0x0}),await this['_processMessagesToInteractions'](_0x1eb46c,_0x3c6bcd,_0x3c2c69),this['currentInteraction']=void 0x0,this;}catch(_0x9fe81b){const _0x2f3075=new at('ai-chat-conversation-init-from-id-failed',null,{'message':_0x9fe81b['message'],'conversationId':_0x2ca9da});throw _0x2f3075['stack']=_0x9fe81b['stack'],this['fire']('error',{'error':_0x2f3075}),_0x2f3075;}}async['_processMessagesToInteractions'](_0x5dc32b,_0x10af99,_0x337c76){let _0x5b13e1,_0x1540e6=!0x1;for(const _0x35cbff of _0x5dc32b)if('user'===_0x35cbff['role']){const {contextItems:_0x131d16,hasUnmatched:_0x17383a}=await this['_extractContextItems'](_0x35cbff);_0x1540e6=_0x17383a;const _0x121a9f={'isReasoningEnabled':Object['hasOwn'](_0x35cbff['capabilities'],'reasoning'),'isWebSearchEnabled':Object['hasOwn'](_0x35cbff['capabilities'],'webSearch')};_0x5b13e1=this['createInteraction']({'userMessage':_0x35cbff['prompt'],'contextItems':_0x131d16,'capabilities':_0x121a9f,'modelId':_0x337c76,'attributes':_0x35cbff['attributes']}),this['currentInteraction']=_0x5b13e1,this['chatContext']['addToConversationContext'](this['currentInteraction']['contextItems']);}else{if('assistant'===_0x35cbff['role']&&_0x5b13e1){const _0xbc6a9=[];for(const _0x15d92c of _0x35cbff['content'])switch(_0x15d92c['type']){case'text':case'modification':{const _0x5a5383=_0x5b13e1['getDocumentContext'](),_0x4a7973=(_0x5a5383?.['documents']?.['length']?_0x5a5383['documents']['some'](_0xf1607b=>_0xf1607b['sessionId']!==_0x10af99):_0x5a5383?.['sessionId']!==_0x10af99)||_0x1540e6;_0x5b13e1['currentReply']?.['type']!==_0x15d92c['type']&&(_0x5b13e1['currentReply']=_0x5b13e1['createReply']({'type':_0x15d92c['type'],'isDone':!0x0,'interactionId':_0x5b13e1['id'],'areActionsDisabled':_0x4a7973,'isFromHistory':!0x0}),_0xbc6a9['length']>0x0&&(_0x5b13e1['currentReply']['sources']=_0xbc6a9['splice'](0x0))),_0x5b13e1['currentReply']['appendContent'](_0x15d92c['content']);break;}case'url':_0xbc6a9['push'](_0x15d92c);break;case'mcp-tool-result':{const {data:_0x212131,attributes:_0x32f73a}=JSON['parse'](_0x15d92c['content']);_0x5b13e1['_handleToolResultData']({'toolName':_0x15d92c['toolName'],'data':_0x212131,'attributes':_0x32f73a});break;}}}}}async['_extractContextItems'](_0x1a6ceb){const _0x10feb2=new Map();if(!_0x1a6ceb['content'])return{'contextItems':_0x10feb2,'hasUnmatched':!0x1};const _0x2d0c96=this['_resolveEditors'](),{contextItem:_0xe83081,hasUnmatched:_0x4ace28}=await this['chatContext']['populateDocumentsFromUserMessage'](_0x1a6ceb['content'],_0x2d0c96);_0xe83081&&_0x10feb2['set'](_0xe83081['id'],_0xe83081);for(const _0x30d6ce of _0x1a6ceb['content']){if('document'===_0x30d6ce['type'])continue;const _0x23c750=await this['chatContext']['populateFromMessage'](_0x30d6ce);_0x23c750&&_0x10feb2['set'](_0x23c750['id'],_0x23c750);}return{'contextItems':_0x10feb2,'hasUnmatched':_0x4ace28};}['_resolveEditors'](){return this['options']['getEditors']?this['options']['getEditors']():this['options']['getEditor']?[this['options']['getEditor']()]:[];}async['handleUserInteraction']({userMessage:_0x5db53e,attributes:_0x41cfae}){if(!this['isStarted'])throw new at('ai-chat-handle-user-conversation-not-initialized',null,{'conversation':this});if(this['currentInteraction'])throw new at('ai-chat-handle-user-interaction-already-in-progress',null,{'conversation':this});try{const _0x93da6e=this['chatContext']['getPendingContextItems'](),_0x3cbd14=this['chatCapabilities']['getCapabilitiesConfig'](),_0x1d8f05=this['selectedModel']['id'];this['currentInteraction']=this['createInteraction']({'userMessage':_0x5db53e,'contextItems':_0x93da6e,'capabilities':_0x3cbd14,'modelId':_0x1d8f05,'attributes':_0x41cfae}),await this['currentInteraction']['start'](),this['chatContext']['addToConversationContext'](this['currentInteraction']['contextItems']);}catch(_0x2fc417){if(_0x2fc417 instanceof at)this['fire']('error',{'interactionId':this['currentInteraction']?this['currentInteraction']['id']:void 0x0,'error':_0x2fc417});else{const _0xa81878=Ps['get'](_0x2fc417['code'])||'ai-chat-handle-user-interaction-start-failed';this['fire']('error',{'interactionId':this['currentInteraction']?this['currentInteraction']['id']:void 0x0,'error':new at(_0xa81878,null,{'error':_0x2fc417})});}}finally{this['currentInteraction']?.['stop'](),this['currentInteraction']=void 0x0;}}['createInteraction']({userMessage:_0x4f5318,contextItems:_0x5bffac,capabilities:_0x46c70d,modelId:_0xdc73c9,attributes:_0x2e3dff}){const _0x3402f1=new Bs({'userMessage':_0x4f5318,'contextItems':_0x5bffac,'capabilities':_0x46c70d,'conversationId':this['id'],'connector':this['connector'],'locale':this['options']['locale'],'model':_0xdc73c9,'attributes':_0x2e3dff});return _0x3402f1['delegate'](...Ls)['to'](this),this['interactions']['push'](_0x3402f1),this['fire']('interactionCreated',_0x3402f1),_0x3402f1;}['getInteraction'](_0x371ad7){return this['interactions']['find'](_0x2e1b8c=>_0x2e1b8c['id']===_0x371ad7);}['removeInteraction'](_0x1f21d2){const _0x7558af=this['getInteraction'](_0x1f21d2);_0x7558af&&(_0x7558af['destroy'](),this['interactions']['splice'](this['interactions']['indexOf'](_0x7558af),0x1));}get['lastInteraction'](){return this['interactions'][this['interactions']['length']-0x1];}['addCurrentDocumentToContext'](_0x4271a3){this['chatContext']['addCurrentDocumentToContext'](_0x4271a3);}async['updateCurrentDocumentInContext']({content:_0x2f715f,version:_0x4a13b7,sessionId:_0x2eb5b0,selections:_0x3e8e56}){await this['chatContext']['updateCurrentDocument'](_0x2f715f,_0x4a13b7,_0x2eb5b0,_0x3e8e56);}async['updateDocumentsInContext'](_0x27e65f){await this['chatContext']['updateDocuments'](_0x27e65f);}['getSourceByDataId'](_0x102555){return this['chatContext']['getSourceByDataId'](_0x102555);}['getDocumentContextSliceByDataId'](_0x529ac6){return this['chatContext']['getDocumentContextSliceByDataId'](_0x529ac6);}['getCurrentDocumentContext'](){return this['currentInteraction']?.['getDocumentContext']()?.['content']||'';}['addSelectionToContext'](_0x5b1f6e){this['chatContext']['addSelectionToContext'](_0x5b1f6e);}['removeSelectionFromContext'](){this['chatContext']['removeSelectionFromContext']();}['addFilesToContext'](_0xffeed6){this['chatContext']['addFilesToContext'](_0xffeed6);}['addUrlToContext'](_0x496442){this['chatContext']['addUrlToContext'](_0x496442);}['addToolItemToContext'](_0x5eddbf){this['chatContext']['addToolItemToContext'](_0x5eddbf);}['addResourceToContext'](_0x525422,_0x2ec361){this['chatContext']['addResourceToContext'](_0x525422,_0x2ec361);}['loadSourceResources'](_0x5377e9,_0x1e8325,_0x53e9a3){return this['chatContext']['loadSourceResources'](_0x5377e9,_0x1e8325,_0x53e9a3);}['removeFromContext'](_0x32f9bf){this['chatContext']['removeFromContext'](_0x32f9bf);}['setWebSearch'](_0x35434f){this['chatCapabilities']['setWebSearch'](_0x35434f);}['toggleWebSearch'](){this['chatCapabilities']['toggleWebSearch']();}['setReasoning'](_0x2e2ec8){this['chatCapabilities']['setReasoning'](_0x2e2ec8);}['toggleReasoning'](){this['chatCapabilities']['toggleReasoning']();}['isCurrentDocumentInContext'](){return this['chatContext']['isCurrentDocumentInContext']();}['isCurrentDocumentInConversation'](){return this['chatContext']['isCurrentDocumentInConversation']();}['isSelectionInContext'](){return this['chatContext']['isSelectionInContext']();}async['setModel'](_0x1d7eb8){_0x1d7eb8?!0x1===await this['chatModels']['isAvailable'](_0x1d7eb8)&&(It('ai-chat-conversation-set-model-not-available',{'conversation':this,'model':_0x1d7eb8}),_0x1d7eb8=(await this['chatModels']['getAvailableModels']())[0x0]):(It('ai-chat-conversation-set-model-null',{'conversation':this}),_0x1d7eb8=(await this['chatModels']['getAvailableModels']())[0x0]),_0x1d7eb8['id']!==this['selectedModel']?.['id']&&(this['selectedModel']=_0x1d7eb8,this['chatCapabilities']['reset'](),this['fire']('modelSelected',{'selectedModel':_0x1d7eb8}));}}class Fs extends Tt(){['_connector'];['_config'];['_locale'];['_modelList']=[];['_modelsRequest']=null;constructor({connector:_0x37b646,config:_0x1a5583,locale:_0x36be58}){super(),this['_connector']=_0x37b646,this['_config']=_0x1a5583,this['_locale']=_0x36be58;}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 _0x3f9cab=await this['getAll']();let _0x14f49b;return _0x14f49b=this['_availableModels']?this['_filterModels'](_0x3f9cab,this['_availableModels']):_0x3f9cab['filter'](_0x54377d=>_0x54377d['recommended']),_0x14f49b;}async['getModel'](_0x17ed2b){const _0x3c5a41=await this['getAll']();if(!_0x3c5a41['length'])return null;if(_0x17ed2b){const _0x316cff=this['_getModelById'](_0x3c5a41,_0x17ed2b);if(_0x316cff)return _0x316cff;It('ai-chat-model-id-unrecognized',{'modelId':_0x17ed2b,'fallBackModelId':this['_defaultModelId']});}return this['getDefault']();}async['getDefault'](){const _0x2e8c0a=await this['getAvailableModels']();if(!_0x2e8c0a['length'])return null;if(this['_defaultModelId']){const _0x37caad=this['_getModelById'](_0x2e8c0a,this['_defaultModelId']);if(_0x37caad)return _0x37caad;It('ai-chat-default-model-id-unrecognized',{'defaultModelId':this['_defaultModelId'],'fallBackModelId':_0x2e8c0a[0x0]['id']});}return _0x2e8c0a[0x0];}async['isAvailable'](_0x1fc26a){return(await this['getAvailableModels']())['some'](_0x1578b5=>_0x1578b5['name']===_0x1fc26a['name']&&_0x1578b5['provider']===_0x1fc26a['provider']);}async['_retrieveModels'](){if(!this['_modelList']['length'])try{const _0x3b5bad=this['_locale']['uiLanguage']||'en',_0x51f9b1=this['_connector']['getModels'](_0x3b5bad),_0x54474d=await _0x51f9b1['list']();this['_modelList']=_0x54474d['items']['map'](_0x141ec8=>Ks(_0x141ec8)?{..._0x141ec8,'name':hs(this['_locale'],'AI_MODEL_NAME_AUTO')}:_0x141ec8);}catch(_0x177ba4){throw Et('ai-models-unable-to-retrieve',{'error':_0x177ba4}),_0x177ba4;}return[...this['_modelList']];}['_filterModels'](_0x9043f7,_0x39fb95){let _0x52fcee;if(_0x39fb95){_0x52fcee=[];const _0x2359df=new Set(),_0x355555='string'==typeof _0x39fb95?[_0x39fb95['toLocaleLowerCase']()]:_0x39fb95['map'](_0x3c9189=>_0x3c9189['toLocaleLowerCase']());for(const _0x72674f of _0x355555)for(const _0x537215 of _0x9043f7)!_0x2359df['has'](_0x537215['id'])&&this['_isMatchingFilter'](_0x537215,_0x72674f)&&(_0x52fcee['push'](_0x537215),_0x2359df['add'](_0x537215['id']));}else _0x52fcee=_0x9043f7;return _0x52fcee;}['_isMatchingFilter'](_0x45d6c2,_0x1cf98c){const _0x4f142c=_0x45d6c2['id']['toLocaleLowerCase'](),_0x2acdd7=_0x45d6c2['name']['toLocaleLowerCase'](),_0x533084=_0x45d6c2['provider']['toLocaleLowerCase']();return _0x4f142c===_0x1cf98c||_0x2acdd7===_0x1cf98c||Ks(_0x45d6c2)&&'auto'===_0x1cf98c||_0x533084===_0x1cf98c||_0x4f142c['startsWith'](_0x1cf98c);}['_getModelById'](_0x2a7adf,_0x54e414){return _0x2a7adf['find'](_0x304a96=>Ks(_0x304a96)&&'auto'===_0x54e414?_0x304a96:_0x304a96['id']===_0x54e414)||null;}}function Ks(_0x31b717){return _0x31b717['id']['startsWith']('agent');}function Ws(_0x506318){return _0x506318?_0x506318 instanceof _0x4da990?[_0x506318]:_0x506318['editors']&&0x0!==_0x506318['editors']['length']?Array['from'](_0x506318['editors']):[]:[];}function Ys(_0x1fede0){const _0x56125f=Ws(_0x1fede0);if(!_0x56125f['length'])throw new at('ai-get-editor-from-context-no-editor');if(0x1===_0x56125f['length'])return _0x56125f[0x0];const _0x25ac5b=_0x56125f['find'](_0x991b5c=>_0x991b5c['ui']?.['focusTracker']?.['isFocused']);if(_0x25ac5b)return _0x25ac5b;const _0x54e4ff=function(_0x50134c){if(_0x50134c instanceof _0x4da990)return;const _0x301ddb=_0x50134c;if(!_0x301ddb['plugins']||!_0x301ddb['plugins']['has']('AIEditing'))return;const _0xab2ad2=_0x301ddb['plugins']['get']('AIEditing');return _0xab2ad2['getLastContentFocusedEditor']?.();}(_0x1fede0);return _0x54e4ff&&_0x56125f['includes'](_0x54e4ff)?_0x54e4ff:_0x56125f[0x0];}function $s(_0x3235c7){return Ys(_0x3235c7);}function qs({editor:_0x4f4b71,interaction:_0x53d5f0,reply:_0x555300,groups:_0x36b606,transform:_0x2f3620,documentCompare:_0x281238,documentCompareOptions:_0x32e4c9,documentContextSlice:_0x17077b}){const _0x54a1f1=_0x53d5f0['getDocumentContext']();if(!_0x54a1f1)return[];const _0x20c8b0=_0x555300['documentContextContent']['cloneNode'](!0x0);for(const {changes:_0x39d305}of _0x36b606){const _0x475861=_0x39d305['filter'](_0x4f628e=>'new'!=_0x4f628e['type'])['map'](_0x2e8452=>As('data-id',_0x2e8452['id'],_0x20c8b0)),_0x451eea=_0x39d305['filter'](_0x5bb1f8=>'removed'!=_0x5bb1f8['type'])['map'](_0x5f1ed1=>_0x5f1ed1['node']['cloneNode'](!0x0));let _0x2737c0=null;if(_0x475861['length']){_0x2737c0=_0x475861[0x0]['previousSibling'];for(let _0x3264de=0x0;_0x3264de<_0x475861['length'];_0x3264de++)_0x5ac2a3(_0x475861[_0x3264de]);}if(_0x451eea['length']){_0x2737c0||(_0x39d305[0x0]['anchorId']?_0x2737c0=As('data-id',_0x39d305[0x0]['anchorId'],_0x20c8b0):(_0x2737c0=_0x451eea['shift'](),_0xe2c668(_0x20c8b0,_0x2737c0)));for(let _0xc6dde2=0x0;_0xc6dde2<_0x451eea['length'];_0xc6dde2++)_0x2c2389(_0x2737c0,_0x451eea[_0xc6dde2]),_0x2737c0=_0x451eea[_0xc6dde2];}}let _0x39a276,_0x5a18ca,_0x41f299,_0x29d3bb=_0x32e4c9;if(_0x17077b){_0x39a276=_0x17077b['html'],_0x41f299=_0x17077b['version'],_0x29d3bb={..._0x32e4c9,'anchor':_0x17077b['rootName']};const _0x4bb2c7=new _0x5eb144([]),_0x750b87=_0x20c8b0['children'],_0x33c6c5=_0x555300['dataIdDocumentSources'],_0x2b4498=_0x555300['newNodeAnchorIds'],_0x2fd6e2=_0x17077b['editor'],_0x48bf42=_0x17077b['rootName'],_0x476e21=new Array(_0x750b87['length']),_0x3f5275=_0x4fc827=>_0x4fc827?_0x4fc827['editor']===_0x2fd6e2&&_0x4fc827['rootName']===_0x48bf42:void 0x0;for(let _0x40a240=0x0;_0x40a240<_0x750b87['length'];_0x40a240++){const _0x2387c7=Es(_0x750b87[_0x40a240],'data-id');if(!_0x2387c7)continue;const _0xaf0ac9=_0x3f5275(_0x33c6c5?.['get'](_0x2387c7));if(void 0x0!==_0xaf0ac9){_0x476e21[_0x40a240]=_0xaf0ac9;continue;}const _0x3e17d4=_0x2b4498['get'](_0x2387c7),_0x1e75d9=_0x3e17d4?_0x3f5275(_0x33c6c5?.['get'](_0x3e17d4)):void 0x0;void 0x0!==_0x1e75d9&&(_0x476e21[_0x40a240]=_0x1e75d9);}for(let _0x1fc997=0x0;_0x1fc997<_0x750b87['length'];_0x1fc997++)if(void 0x0===_0x476e21[_0x1fc997]){for(let _0x1e8142=_0x1fc997-0x1;_0x1e8142>=0x0;_0x1e8142--)if(void 0x0!==_0x476e21[_0x1e8142]){_0x476e21[_0x1fc997]=_0x476e21[_0x1e8142];break;}if(void 0x0===_0x476e21[_0x1fc997]){for(let _0x5ca0d9=_0x1fc997+0x1;_0x5ca0d9<_0x750b87['length'];_0x5ca0d9++)if(void 0x0!==_0x476e21[_0x5ca0d9]){_0x476e21[_0x1fc997]=_0x476e21[_0x5ca0d9];break;}}}for(let _0x3cc268=0x0;_0x3cc268<_0x750b87['length'];_0x3cc268++)_0x476e21[_0x3cc268]&&_0x4bb2c7['children']['push'](_0x2f4f0d(_0x750b87[_0x3cc268],!0x0));_0x5a18ca=gs(_0x4bb2c7);}else _0x39a276=_0x54a1f1['content'],_0x41f299=_0x54a1f1['version'],_0x5a18ca=gs(_0x20c8b0);const _0x266564=_0x281238['getDiff'](_0x39a276,_0x5a18ca,{..._0x29d3bb,'targetEditor':_0x4f4b71})['getOperations']();if(_0x2f3620){const _0x1f7339=_0x4f4b71['model']['document']['history']['getOperations'](_0x41f299),_0x1ddae1={'document':_0x4f4b71['model']['document'],'useRelations':!0x1,'padWithNoOps':!0x1};return _0x630f28(_0x266564,_0x1f7339,_0x1ddae1)['operationsA'];}return _0x266564;}function Qs(_0x497aa0,_0xdcce37){if('marker'!=_0xdcce37['type'])return;const _0x170a52=_0x497aa0['model']['markers']['get'](_0xdcce37['name']);_0x170a52&&(_0xdcce37['oldRange']=_0x170a52['getRange']());}class Xs extends _0x2599d1{['activeConversation'];['_aiEditing'];['_aiConnector'];['_aiChatUi'];['_aiChatModels'];['_aiChatBalloon'];['_activeBalloon'];['_wiredBalloons']=new Set();['_batchToChanges']=new Map();['_currentPreviewedChangeGroup']=null;['_bodyCollection'];static get['requires'](){return[as,_0x180035];}static get['pluginName'](){return'AIChatController';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){this['_bodyCollection']=new Qt(this['context']['locale']),this['_bodyCollection']['attachToDom'](),this['_aiConnector']=this['context']['plugins']['get']('AIConnector'),this['_aiChatUi']=this['context']['plugins']['get']('AIChatUI'),this['_aiEditing']=this['context']['plugins']['get']('AIEditing'),this['_aiChatModels']=new Fs({'connector':this['_aiConnector'],'config':this['context']['config']['get']('ai.models'),'locale':this['context']['locale']});const _0x3a677c=this['context']['plugins']['get']('AITabs');this['listenTo'](this['_aiChatUi'],'startConversation',()=>{this['_startConversationSafely']();}),this['listenTo'](this['_aiChatUi'],'sendUserMessage',(_0x1c4024,_0x58cf7d)=>{this['_handleUIUserMessage']({'message':_0x58cf7d});}),this['listenTo'](_0x3a677c['view'],'change:activeTab',(_0x5031a3,_0x5ed700,_0x2d45a7)=>{'chat'!==_0x2d45a7&&this['removeSelectionFromChatContext']();}),this['listenTo'](this['_aiChatUi'],'abortPromptStream',async()=>{await this['_stopLastInteraction'](),await this['_flushLastInteractionUI'](),this['removeSelectionFromChatContext']();}),this['listenTo'](this['_aiChatUi'],'addDocumentToContext',()=>{this['addCurrentDocumentToChatContext']();}),this['listenTo'](this['_aiChatUi'],'addFileToContext',(_0x5118cf,_0x20c0d5)=>{this['activeConversation']?.['addFilesToContext'](Array['from'](_0x20c0d5));}),this['listenTo'](this['_aiChatUi'],'addUrlToContext',(_0x16c36a,_0x28c32e)=>{this['activeConversation']?.['addUrlToContext'](_0x28c32e);}),this['listenTo'](this['_aiChatUi'],'executeCustomItemCallback',(_0x330f75,_0x11670a)=>{_0x11670a['callback'](this['context']);}),this['listenTo'](this['_aiChatUi'],'addResourceToContext',(_0x5ecad1,_0x3d295d)=>{this['activeConversation']?.['addResourceToContext'](_0x3d295d['source'],_0x3d295d['resource']);}),this['listenTo'](this['_aiChatUi'],'removeContextItem',(_0x1dde6e,_0x2ac4c1)=>{this['_removeFromContext'](_0x2ac4c1);}),this['listenTo'](this['_aiChatUi'],'loadSourceResources',(_0x5a7504,_0x3ea92b)=>{this['activeConversation']?.['loadSourceResources'](_0x3ea92b['sourceId'],_0x3ea92b['query'],_0x3ea92b['uid']);}),this['listenTo'](this['_aiChatUi'],'toggleWebSearch',()=>{this['_toggleWebSearch']();}),this['listenTo'](this['_aiChatUi'],'toggleReasoning',()=>{this['_toggleReasoning']();}),this['listenTo'](this['_aiChatUi'],'selectModel',(_0x2e24b4,_0x2c53b4)=>{this['activeConversation']?.['setModel'](_0x2c53b4);}),this['listenTo'](this['_aiChatUi'],'like',(_0x3f7998,{replyId:_0x191e11})=>{console['log']('Liked\x20response',_0x191e11);}),this['listenTo'](this['_aiChatUi'],'dislike',(_0x30c65d,{replyId:_0x5945e8})=>{console['log']('Disliked\x20response',_0x5945e8);}),this['listenTo'](this['_aiChatUi'],'insertSuggestion',(_0xb426cc,_0x1ce0be)=>{this['_insertSuggestion'](_0x1ce0be);}),this['listenTo'](this['_aiChatUi'],'showChangeInText',(_0x5b0320,{replyId:_0x4357bf,partIndex:_0x1e41fb})=>{this['_aiChatBalloonShowDiff']=this['_aiChatUi']['showDiff'],this['_openBalloonFor'](_0x4357bf,_0x1e41fb);}),this['listenTo'](this['_aiChatUi'],'mouseOverSuggestion',(_0x3d6b27,{replyId:_0x12cee7,partIndex:_0x232a40})=>{const _0x998006=this['_getDocumentRangeForReplyChanges'](_0x12cee7,_0x232a40);_0x998006&&'$graveyard'!=_0x998006['range']['root']['rootName']&&this['_aiEditing']['showFakeVisualSelection']({'ranges':[_0x998006['range']],'id':'change-area','priority':0xa});}),this['listenTo'](this['_aiChatUi'],'mouseLeaveSuggestion',()=>{this['_aiEditing']['hideFakeVisualSelection']('change-area');}),this['listenTo'](this['_aiChatUi'],'applySuggestion',(_0x282873,_0x1e79a6)=>{this['_aiEditing']['hideFakeVisualSelection']('change-area'),this['_applySuggestion'](_0x1e79a6);}),this['listenTo'](this['_aiChatUi'],'toggleSuggestionDisplayMode',async(_0x410be4,{replyId:_0x1af4e4,showDiff:_0x5bf171})=>{const {reply:_0x54769f}=this['getInteractionAndReplyById'](_0x1af4e4),_0x8730d0=_0x54769f['getContentParts']({'showDiff':_0x5bf171,'editor':$s(this['context'])});await this['_aiChatUi']['updateFeedItemAIReplySuggestionContent']({'id':_0x54769f['id'],'parts':_0x8730d0});}),this['listenTo'](this['_aiChatUi'],'rejectSuggestion',(_0x5cbed5,{replyId:_0x192647,partIndex:_0x194d46})=>{this['_rejectSuggestion']({'replyId':_0x192647,'partIndex':_0x194d46}),this['_aiEditing']['hideFakeVisualSelection']('change-area');}),this['set']('_aiChatBalloonShowDiff',!0x1),this['context']['plugins']['has']('AIChatBalloon')&&(this['_aiChatBalloon']=this['context']['plugins']['get']('AIChatBalloon')),this['on']('interactionCreated',(_0x46019f,_0x49b9e1)=>{this['_aiChatUi']['addFeedItemUserMessage'](_0x49b9e1);}),this['on']('replyCreated',(_0x9590b,_0x4e33f4)=>{this['_addFeedItemReply'](_0x4e33f4);});}async['afterInit'](){this['context']instanceof _0x4da990?this['_integrateEditor'](this['context']):this['listenTo'](this['context']['editors'],'add',(_0x25c21e,_0x5f1f5a)=>{_0x5f1f5a['on']('ready',()=>{this['_integrateEditor'](_0x5f1f5a);});});const _0xe7a334=this['context']['config']['get']('ai.chat.initialConversation');let _0x5c6100=_0xe7a334;if('lastCreated'!=_0xe7a334||(_0x5c6100=await this['_getLastCreatedConversationId'](),_0x5c6100))return'new'==_0x5c6100?this['_startConversationSafely']():this['loadConversation'](_0x5c6100);}async['destroy'](){return await this['_stopLastInteraction'](),this['_bodyCollection']['detachFromDom'](),super['destroy']();}async['loadConversation'](_0x1b16a8){this['_activeBalloon']?.['close'](),this['_activeBalloon']=void 0x0,this['_currentPreviewedChangeGroup']=null,(this['context']['plugins']['get'](os)['view']['activateTab']('chat'),this['_aiChatUi']['setFeedItemRenderingStrategy']('static'),this['_aiChatUi']['toggleLoadingSkeleton'](!0x0),await this['_stopLastInteraction']());try{await this['_aiConnector']['fetchConversation'](_0x1b16a8)['getConversation'](),await this['_startConversationSafely']({'id':_0x1b16a8}),this['_updateConversationTitle']('\x20'),await this['activeConversation']['load'](_0x1b16a8,this['_aiEditing']['sessionId']),this['activeConversation']['isCurrentDocumentInConversation']()&&this['addCurrentDocumentToChatContext']();}catch(_0x113566){this['_aiChatUi']['addFeedItemError']({'errorMessage':hs(this['context']['locale'],'AI_CHAT_UNABLE_TO_LOAD_CONVERSATION'),'id':_0x1b16a8}),this['_logError'](new at('ai-chat-conversation-not-found',this,{'error':_0x113566}));}finally{this['_aiChatUi']['startAutoScroll']({'smooth':!0x1}),this['_aiChatUi']['setFeedItemRenderingStrategy']('streaming'),this['_aiChatUi']['toggleLoadingSkeleton'](!0x1);}}['registerToolDataCallback'](_0x4f6783){let _0x54d6a5=null,_0xb007b3=null;this['on']('toolDataReceived',(_0x18bcfc,_0x45b7e6,_0x28f641)=>{_0x28f641['id']!==_0x54d6a5&&(_0x54d6a5=_0x28f641['id'],_0xb007b3=this['_getAIChatFeedAPI'](_0x28f641)),_0x4f6783(_0x45b7e6,_0xb007b3);});}['addCurrentDocumentToChatContext'](){this['activeConversation']?.['addCurrentDocumentToContext'](hs(this['context']['locale'],'AI_CHAT_CONTEXT_CURRENT_DOCUMENT'));}async['addSelectionToChatContext'](){const _0x47672b=this['_aiEditing']['getSelectionText']();this['activeConversation']?.['addSelectionToContext'](_0x47672b),this['addCurrentDocumentToChatContext']();}['removeSelectionFromChatContext'](){this['activeConversation']?.['removeSelectionFromContext']();}['focusPromptInput'](){this['_aiChatUi']['focusPromptInput']();}async['startConversation'](_0x123ebc){await this['_startConversationSafely']({'modelId':_0x123ebc?.['modelId']});}async['sendMessage'](_0x2f5998){await this['_handleUIUserMessage'](_0x2f5998);}['getGroupId'](){const _0x21fe8b=this['context']['config']['get']('collaboration.channelId');if(!_0x21fe8b)throw new at('ai-chat-missing-channel-id',this);return _0x21fe8b;}['_handleRemovedConversation'](_0x20d72a){this['activeConversation']['id']===_0x20d72a&&this['_startConversationSafely']();}['_insertSuggestion'](_0x100aa6){const _0x3a9cc9=this['context']['plugins']['get']('DocumentCompare'),{reply:_0x8f9f82,interaction:_0x5da34a}=this['getInteractionAndReplyById'](_0x100aa6['replyId']),_0x399230=void 0x0!==_0x100aa6['partIndex']?[_0x8f9f82['changeGroups'][_0x100aa6['partIndex']]]:_0x8f9f82['changeGroups']['filter'](_0x427bf3=>'pending'==_0x427bf3['state']);for(const _0x8009d5 of this['_groupChangesByTarget'](_0x8f9f82,_0x399230)){const {target:_0x4ac8f6,groups:_0x141d27,groupsIndexes:_0x7ebd4c,slice:_0x19d7fb}=_0x8009d5;if(!_0x4ac8f6['editor']['plugins']['has']('TrackChanges'))throw new at('ai-no-track-changes',null);const _0x51e08c=this['_getDocumentRangeForReplyChanges'](_0x100aa6['replyId'],_0x7ebd4c[0x0]);if(!_0x51e08c||'$graveyard'==_0x51e08c['range']['root']['rootName']){_0x7ebd4c['forEach'](_0x2dd68d=>_0x8f9f82['setChangeGroupState'](_0x2dd68d,'outdated'));continue;}_0x7ebd4c['forEach'](_0x40d725=>_0x8f9f82['setChangeGroupState'](_0x40d725,'accepted'));const _0x59f0d4=qs({'editor':_0x4ac8f6['editor'],'reply':_0x8f9f82,'interaction':_0x5da34a,'groups':_0x141d27,'transform':!0x0,'documentCompare':_0x3a9cc9,'documentCompareOptions':{'anchor':_0x19d7fb?.['rootName']??'main','markDeletions':!0x0},'documentContextSlice':_0x19d7fb});let _0x5190fd;this['_scrollToSuggestionRange'](_0x51e08c['range'],!0x1,_0x4ac8f6['editor']),_0x4ac8f6['editor']['model']['change'](_0xdc8390=>{_0x5190fd=_0xdc8390['batch'],_0x4ac8f6['editor']['plugins']['get']('TrackChangesEditing')['_applyOperationsAsSuggestions'](_0x59f0d4),this['_aiEditing']['hideFakeVisualSelection']('change-area');}),this['_batchToChanges']['set'](_0x5190fd,{'interactionId':_0x5da34a['id'],'replyId':_0x8f9f82['id'],'indexes':_0x7ebd4c['slice']()});}this['_updateRatings'](_0x8f9f82);}['_applySuggestion'](_0x2ad0cb){const _0x2e64d7=this['context']['plugins']['get'](_0x180035),{reply:_0x1212cb,interaction:_0xb40e4e}=this['getInteractionAndReplyById'](_0x2ad0cb['replyId']),_0x721889=void 0x0!==_0x2ad0cb['partIndex']?[_0x1212cb['changeGroups'][_0x2ad0cb['partIndex']]]:_0x1212cb['changeGroups']['filter'](_0x58134d=>'pending'==_0x58134d['state']);for(const _0x269f99 of this['_groupChangesByTarget'](_0x1212cb,_0x721889)){const {target:_0x1bf68a,groups:_0x53cedc,groupsIndexes:_0x239ebb,slice:_0x50f2bb}=_0x269f99,_0x10e19a=this['_getDocumentRangeForReplyChanges'](_0x2ad0cb['replyId'],_0x239ebb[0x0]);if(!_0x10e19a||'$graveyard'==_0x10e19a['range']['root']['rootName']){_0x239ebb['forEach'](_0x3ad4f9=>_0x1212cb['setChangeGroupState'](_0x3ad4f9,'outdated'));continue;}_0x239ebb['forEach'](_0x348608=>_0x1212cb['setChangeGroupState'](_0x348608,'accepted'));const _0x357c64=qs({'editor':_0x1bf68a['editor'],'reply':_0x1212cb,'interaction':_0xb40e4e,'groups':_0x53cedc,'transform':!0x0,'documentCompare':_0x2e64d7,'documentCompareOptions':{'anchor':_0x50f2bb?.['rootName']??'main','markDeletions':!0x1},'documentContextSlice':_0x50f2bb});let _0x455814;this['_scrollToSuggestionRange'](_0x10e19a['range'],!0x1,_0x1bf68a['editor']),_0x1bf68a['editor']['model']['change'](_0x18c989=>{_0x455814=_0x18c989['batch'];for(const _0x3f2ba9 of _0x357c64)_0x3f2ba9['baseVersion']=_0x1bf68a['editor']['model']['document']['version'],Qs(_0x1bf68a['editor'],_0x3f2ba9),_0x18c989['batch']['addOperation'](_0x3f2ba9),_0x1bf68a['editor']['model']['applyOperation'](_0x3f2ba9);}),this['_batchToChanges']['set'](_0x455814,{'interactionId':_0xb40e4e['id'],'replyId':_0x1212cb['id'],'indexes':_0x239ebb['slice']()});}this['_updateRatings'](_0x1212cb);}['_rejectSuggestion'](_0x19ce28){const {reply:_0x52050f}=this['getInteractionAndReplyById'](_0x19ce28['replyId']);_0x52050f['setChangeGroupState'](_0x19ce28['partIndex'],'rejected');}['_openBalloonFor'](_0x3cd0c7,_0x4557d5){if(!this['_aiChatBalloon'])return;const {reply:_0xc76cf4}=this['getInteractionAndReplyById'](_0x3cd0c7),_0x1d0fd6=_0xc76cf4['getContentParts']({'showDiff':this['_aiChatBalloonShowDiff'],'editor':$s(this['context'])});let _0x5dfa02,_0x5eb6a4;if(void 0x0!==_0x4557d5?(_0x5eb6a4=_0x1d0fd6['find'](_0x11cd62=>_0x11cd62['index']==_0x4557d5),_0x5dfa02=_0x5eb6a4?.['index']):(_0x5eb6a4=_0x1d0fd6[0x0],_0x5dfa02=_0x5eb6a4['index']),this['_currentPreviewedChangeGroup']?.['replyId']==_0x3cd0c7&&this['_currentPreviewedChangeGroup']?.['partIndex']==_0x5dfa02)return;const _0x339d70=this['_getUserPresentableContentPartDocumentRange'](_0x3cd0c7,_0xc76cf4,_0x5eb6a4),_0x36a1fc=_0xc76cf4['changeGroups']['find'](_0x1afdb9=>_0x1afdb9['index']==_0x5dfa02),_0x1c512e=_0x36a1fc?this['_resolveGroupTarget'](_0xc76cf4,_0x36a1fc):null,_0x11f51c=_0x1c512e?.['editor']??$s(this['context']),_0x50c647=_0x11f51c['plugins']['has']('AIChatBalloon')?_0x11f51c['plugins']['get']('AIChatBalloon'):this['_aiChatBalloon'];if(this['_activeBalloon']&&this['_activeBalloon']!==_0x50c647&&this['_activeBalloon']['close'](),!_0x339d70)return _0x50c647['close'](),void(this['_activeBalloon']=void 0x0);this['_activeBalloon']=_0x50c647,this['_currentPreviewedChangeGroup']={'replyId':_0x3cd0c7,'partIndex':_0x5dfa02},this['_scrollToSuggestionRange'](_0x339d70,!0x0,_0x11f51c);const _0x449d63=this['_getPresentableSiblingContentPartIndex'](_0x3cd0c7,_0x5dfa02,'next');_0x50c647['updateContent']({'part':_0x5eb6a4,'renderingStrategy':'static'}),_0x50c647['open']({'index':_0x5dfa02,'title':hs(this['context']['locale'],'AI_BALLOON_HEADER_TITLE',(_0x5dfa02+0x1)['toString']()),'showRotator':null!==_0x449d63,'ranges':[_0x339d70],'areActionsDisabled':_0xc76cf4['areActionsDisabled'],'targetEditor':_0x11f51c}),_0x50c647['setState']('pending'),this['_aiChatUi']['scrollFeedToSuggestion'](_0x3cd0c7,_0x5dfa02),this['_aiChatUi']['setFeedItemAIReplySuggestionPartActive']({'id':_0x3cd0c7,'index':_0x5dfa02,'isActive':!0x0});}['_getPresentableSiblingContentPartIndex'](_0x5cc566,_0x367716,_0x43baad){const {reply:_0x5d0ba8}=this['getInteractionAndReplyById'](_0x5cc566),_0x5c925e=_0x5d0ba8['getContentParts']({'showDiff':this['_aiChatBalloonShowDiff'],'editor':$s(this['context'])});if(0x1==_0x5c925e['length'])return null;const _0x320aaa=_0x5c925e['findIndex'](_0xa88061=>_0xa88061['index']==_0x367716),_0x326ca0='next'==_0x43baad?0x1:-0x1;let _0x52b686=_0x5c925e['at']((_0x320aaa+_0x326ca0)%_0x5c925e['length'])['index'],_0x4c6559=_0x5c925e[_0x52b686];for(;!this['_getUserPresentableContentPartDocumentRange'](_0x5cc566,_0x5d0ba8,_0x4c6559);){if(_0x52b686=_0x5c925e['at']((_0x52b686+_0x326ca0)%_0x5c925e['length'])['index'],_0x52b686===_0x320aaa)return null;_0x4c6559=_0x5c925e[_0x52b686];}return _0x52b686;}['_getUserPresentableContentPartDocumentRange'](_0x2946c1,_0x5189fa,_0x37f849){const _0xb48409=_0x5189fa['changeGroups'];if(!_0x37f849['hasChanges'])return null;const _0x2e1b62=_0xb48409['find'](_0x42e831=>_0x42e831['index']==_0x37f849['index']);if('pending'!==_0x2e1b62?.['state'])return null;const _0x7e04e=this['_getDocumentRangeForReplyChanges'](_0x2946c1,_0x37f849['index']);if(!_0x7e04e)return _0x5189fa['setChangeGroupState'](_0x37f849['index'],'outdated'),null;const {range:_0x16cace,currentIndex:_0x372e26}=_0x7e04e;return'$graveyard'==_0x16cace['root']['rootName']?(_0x5189fa['setChangeGroupState'](_0x372e26,'outdated'),null):_0x7e04e['range'];}['_getDocumentRangeForReplyChanges'](_0x2d522e,_0x268897){const {reply:_0x5b8085}=this['getInteractionAndReplyById'](_0x2d522e),_0x3dbf5a=_0x5b8085['changeGroups']['filter'](_0x2c64f6=>'pending'==_0x2c64f6['state']),_0x41215b=_0x3dbf5a['map'](_0x20626d=>_0x5b8085['changeGroups']['indexOf'](_0x20626d));void 0x0===_0x268897&&(_0x268897=_0x41215b[0x0]);const _0x21ebfd=_0x41215b['indexOf'](_0x268897);if(-0x1==_0x21ebfd)return null;const _0x53ead0=_0x3dbf5a[_0x21ebfd],_0x35cbe7=this['_resolveGroupTarget'](_0x5b8085,_0x53ead0);if(!_0x35cbe7)return null;const {editor:_0x459ad5,root:_0x33f913,parsedDocumentContent:_0x50d14f,serializedDocumentContent:_0x490586,version:_0xf887df}=_0x35cbe7,_0x598800=new _0x5eb144([]),_0x263bcf=new _0x5eb144([]);for(const _0x2434e1 of _0x53ead0['changes']){const _0xf9fb8c=this['activeConversation']?.['getSourceByDataId'](_0x2434e1['id']);if((!_0xf9fb8c||_0xf9fb8c['editor']===_0x35cbe7['editor']&&_0xf9fb8c['rootName']===_0x35cbe7['root']['rootName'])&&('removed'!=_0x2434e1['type']&&_0x263bcf['children']['push'](_0x2434e1['node']['cloneNode'](!0x0)),'new'!=_0x2434e1['type'])){const _0x320498=_0x46c265(_0x486827=>Es(_0x486827,'data-id')==_0x2434e1['id'],_0x50d14f,!0x0);if(!_0x320498)return null;_0x598800['children']['push'](_0x320498['cloneNode'](!0x0));}}if(0x0==_0x598800['children']['length']){if(_0x53ead0['changes'][0x0]['anchorId']){const _0x5f1d6c=As('data-id',_0x53ead0['changes'][0x0]['anchorId'],_0x50d14f);_0x598800['children']['unshift'](_0x5f1d6c['cloneNode'](!0x0)),_0x263bcf['children']['unshift'](_0x5f1d6c['cloneNode'](!0x0)),_0x5f1d6c['nextSibling']&&(_0x598800['children']['push'](_0x5f1d6c['nextSibling']['cloneNode'](!0x0)),_0x263bcf['children']['push'](_0x5f1d6c['nextSibling']['cloneNode'](!0x0)));}else{const _0x3bae85=_0x50d14f['children'][0x0];if(!_0x3bae85)return null;_0x598800['children']['push'](_0x3bae85['cloneNode'](!0x0)),_0x263bcf['children']['push'](_0x3bae85['cloneNode'](!0x0));}}const _0x476ab3=_0x459ad5['data']['parse'](_0x490586),_0x2742ec=gs(_0x598800),_0x2d8f8f=_0x459ad5['data']['parse'](_0x2742ec),_0x184eaa=_0x459ad5['data']['parse'](_0x2742ec),_0x13a613=_0x459ad5['model']['createPositionAt'](_0x2d8f8f,0x0),_0x3a2ec5=gs(_0x263bcf),_0x504056={'targetEditor':_0x459ad5,'anchor':_0x13a613,'markDeletions':!0x1},_0xb96f28=_0x459ad5['plugins']['get'](_0x180035)['getDiff'](_0x2742ec,_0x3a2ec5,_0x504056)['getOperations']();if(!_0xb96f28['length'])return null;_0x459ad5['model']['change'](_0x1ce658=>{for(const _0x42b453 of _0xb96f28)if('remove'==_0x42b453['type']){const _0x34c3fb=_0x42b453['sourcePosition'],_0x35a0d3=_0x42b453['howMany'],_0x4d860f=new _0x2806e1(_0x34c3fb,_0x35a0d3);_0x1ce658['batch']['addOperation'](_0x4d860f),_0x459ad5['model']['applyOperation'](_0x4d860f);}else'marker'!==_0x42b453['type']&&(_0x42b453['baseVersion']=null,_0x42b453['isDocumentOperation']=!0x1,_0x1ce658['batch']['addOperation'](_0x42b453),_0x459ad5['model']['applyOperation'](_0x42b453));});const _0x480d53=ks(_0x459ad5,_0xb96f28,_0x2d8f8f);Ns(_0x459ad5['model'],_0x480d53);const _0x2f81eb=_0x480d53['getFirstRange']()['start']['path']['slice'](),_0x3eef38=_0x480d53['getFirstRange']()['end']['path']['slice'](),_0x5c46c9=[];let _0x411599=_0x2d8f8f,_0x8fc83c=_0x184eaa;for(let _0x1b4c66=0x0;_0x1b4c66<_0x3eef38['length'];_0x1b4c66++){const _0x16b77f=_0x411599['maxOffset']-_0x3eef38[_0x1b4c66];_0x5c46c9[_0x1b4c66]=_0x8fc83c['maxOffset']-_0x16b77f,_0x411599=_0x411599['getChildAtOffset'](_0x3eef38[_0x1b4c66]),_0x8fc83c=_0x8fc83c['getChildAtOffset'](_0x5c46c9[_0x1b4c66]);}const _0x15354e=_0x459ad5['model']['createRange'](_0x459ad5['model']['createPositionFromPath'](_0x184eaa,_0x2f81eb),_0x459ad5['model']['createPositionFromPath'](_0x184eaa,_0x5c46c9)),_0x2e587d=_0x184eaa['getChild'](0x0)['getAttribute'](_0x4c35c7),_0x7a5b03=Array['from'](_0x476ab3['getChildren']())['find'](_0x554377=>_0x554377['getAttribute'](_0x4c35c7)==_0x2e587d)['getPath'](),_0x446963=_0x15354e['start']['path']['slice'](),_0x266cc1=_0x15354e['end']['path']['slice']();_0x446963[0x0]=_0x7a5b03[0x0]+_0x446963[0x0],_0x266cc1[0x0]=_0x7a5b03[0x0]+_0x266cc1[0x0];let _0x44be3e=_0x459ad5['model']['createRange'](_0x459ad5['model']['createPositionFromPath'](_0x33f913,_0x446963),_0x459ad5['model']['createPositionFromPath'](_0x33f913,_0x266cc1));const _0x4ba1e0=_0x459ad5['model']['document']['history']['getOperations'](_0xf887df);for(const _0x4e4119 of _0x4ba1e0)_0x44be3e=_0x1cef76['_createFromRanges'](_0x44be3e['getTransformedByOperation'](_0x4e4119));return{'range':_0x44be3e,'currentIndex':_0x268897};}['_integrateEditorBalloon'](_0x44650f){if(!_0x44650f['plugins']['has']('AIChatBalloon'))return;const _0xd17d26=_0x44650f['plugins']['get']('AIChatBalloon');this['_wiredBalloons']['has'](_0xd17d26)||(this['_wiredBalloons']['add'](_0xd17d26),this['_aiChatBalloon']||(this['_aiChatBalloon']=_0xd17d26),_0xd17d26['bind']('showDiff')['to'](this,'_aiChatBalloonShowDiff'),this['listenTo'](_0xd17d26,'toggleSuggestionDisplayMode',()=>{const {replyId:_0x3a9576,partIndex:_0x21ff9d}=this['_currentPreviewedChangeGroup'];this['_aiChatBalloonShowDiff']=!this['_aiChatBalloonShowDiff'];const {reply:_0x25598e}=this['getInteractionAndReplyById'](_0x3a9576),_0x695127=_0x25598e['changeGroups']['find'](_0x4ea494=>_0x4ea494['index']===_0x21ff9d),_0x3d9d35=_0x695127?this['_resolveGroupTarget'](_0x25598e,_0x695127):null,_0x1a4c5c=_0x25598e['getContentParts']({'showDiff':this['_aiChatBalloonShowDiff'],'groupIndex':_0x21ff9d,'editor':_0x3d9d35?.['editor']??$s(this['context'])});(this['_activeBalloon']??_0xd17d26)['updateContent']({'part':_0x1a4c5c[0x0],'renderingStrategy':'static','keepErrors':!0x0});}),this['listenTo'](_0xd17d26,'applySuggestion',()=>{const {replyId:_0xe2b26f,partIndex:_0x56d37b}=this['_currentPreviewedChangeGroup'];this['_applySuggestion']({'replyId':_0xe2b26f,'partIndex':_0x56d37b}),(this['_activeBalloon']??_0xd17d26)['setState']('accepted');}),this['listenTo'](_0xd17d26,'insertSuggestion',()=>{const {replyId:_0x2fed0c,partIndex:_0x30df81}=this['_currentPreviewedChangeGroup'];this['_insertSuggestion']({'replyId':_0x2fed0c,'partIndex':_0x30df81}),(this['_activeBalloon']??_0xd17d26)['setState']('accepted');}),this['listenTo'](_0xd17d26,'rejectSuggestion',()=>{const {replyId:_0xba6f98,partIndex:_0x10c0cb}=this['_currentPreviewedChangeGroup'];this['_rejectSuggestion']({'replyId':_0xba6f98,'partIndex':_0x10c0cb}),(this['_activeBalloon']??_0xd17d26)['setState']('rejected');}),this['listenTo'](_0xd17d26,'showNext',()=>{const {replyId:_0x5d8701,partIndex:_0x228b05}=this['_currentPreviewedChangeGroup'],_0x104bd3=this['_getPresentableSiblingContentPartIndex'](_0x5d8701,_0x228b05,'next');null!==_0x104bd3&&this['_openBalloonFor'](_0x5d8701,_0x104bd3);}),this['listenTo'](_0xd17d26,'showPrevious',()=>{const {replyId:_0x1ff242,partIndex:_0x264cd5}=this['_currentPreviewedChangeGroup'],_0x1ef968=this['_getPresentableSiblingContentPartIndex'](_0x1ff242,_0x264cd5,'previous');null!==_0x1ef968&&this['_openBalloonFor'](_0x1ff242,_0x1ef968);}),this['listenTo'](_0xd17d26,'dialogClosed',(_0x3d4a82,{id:_0x1a0ea4})=>{if('aiChatBalloon'!==_0x1a0ea4)return;const {replyId:_0x34cf87,partIndex:_0x1d890d}=this['_currentPreviewedChangeGroup'];this['_currentPreviewedChangeGroup']=null,this['_aiChatUi']['setFeedItemAIReplySuggestionPartActive']({'id':_0x34cf87,'index':_0x1d890d,'isActive':!0x1}),this['_activeBalloon']===_0xd17d26&&(this['_activeBalloon']=void 0x0);}));}['_integrateEditor'](_0x5d204e){if(this['_integrateEditorBalloon'](_0x5d204e),_0x5d204e['plugins']['has']('Undo')){const _0x598075=_0x5d204e['commands']['get']('undo'),_0x8ea6f8=_0x5d204e['commands']['get']('redo');this['listenTo'](_0x598075,'revert',(_0x21d377,_0x16e010,_0x15082e)=>{const _0x51aa18=this['_batchToChanges']['get'](_0x16e010);if(!_0x51aa18)return;const _0x16f2fa=this['activeConversation']['getInteraction'](_0x51aa18['interactionId']),_0x22fdce=_0x16f2fa?.['getReply'](_0x51aa18['replyId']);this['_batchToChanges']['delete'](_0x16e010),_0x16f2fa&&_0x22fdce&&(_0x51aa18['indexes']['forEach'](_0x13ffdc=>_0x22fdce['setChangeGroupState'](_0x13ffdc,'pending')),this['_batchToChanges']['set'](_0x15082e,_0x51aa18));}),this['listenTo'](_0x8ea6f8,'revert',(_0x2c2520,_0x181690,_0x3a3b1e)=>{const _0x1e40af=this['_batchToChanges']['get'](_0x181690);if(!_0x1e40af)return;const _0x4dcc4f=this['activeConversation']['getInteraction'](_0x1e40af['interactionId']),_0x5a3023=_0x4dcc4f?.['getReply'](_0x1e40af['replyId']);this['_batchToChanges']['delete'](_0x181690),_0x4dcc4f&&_0x5a3023&&(_0x1e40af['indexes']['forEach'](_0x1ad711=>_0x5a3023['setChangeGroupState'](_0x1ad711,'accepted')),this['_batchToChanges']['set'](_0x3a3b1e,_0x1e40af));});}const _0x116978=_0x5d204e['config']['get']('ai.chat.context');_0x116978['alwaysAddSelection']&&_0x116978['document']['enabled']&&this['listenTo'](_0x5d204e['model']['document']['selection'],'change:range',(_0x199332,_0x52c73b)=>{if(!_0x52c73b['directChange'])return;'chat'===_0x5d204e['plugins']['get']('AITabs')['view']['activeTab']&&(_0x5d204e['model']['hasContent'](_0x5d204e['model']['document']['selection'])?this['addSelectionToChatContext']():this['removeSelectionFromChatContext']());});}async['_getLastCreatedConversationId'](){const _0x1cf4fd=this['_aiConnector']['fetchConversations'](this['getGroupId'](),{'limit':0x1,'sortBy':'createdAt'});try{const _0x1d08b3=await _0x1cf4fd['getConversations']();return _0x1d08b3['length']?_0x1d08b3[0x0]['id']:'new';}catch(_0x1eba70){return this['_aiChatUi']['addFeedItemError']({'errorMessage':hs(this['context']['locale'],'AI_CHAT_UNABLE_TO_LOAD_CONVERSATION'),'id':ot()}),this['_logError'](new at('ai-chat-conversation-init-failed',this,{'error':_0x1eba70})),this['_aiChatUi']['toggleLoadingSkeleton'](!0x1),this['_aiChatUi']['disableControls'](),null;}}async['_startConversationSafely'](_0x1c1983={}){try{this['_aiChatUi']['enableControls'](),await this['_handleStartConversation'](_0x1c1983);}catch(_0x465e7e){this['_aiChatUi']['addFeedItemError']({'errorMessage':hs(this['context']['locale'],'AI_CHAT_UNABLE_TO_START_CONVERSATION'),'id':_0x1c1983['id']||ot()}),console['error'](_0x465e7e),this['activeConversation']=void 0x0,this['_aiChatUi']['disableControls']();}}async['_handleStartConversation']({id:_0x482db9,modelId:_0x42dffd}={}){this['_activeBalloon']?.['close'](),this['_activeBalloon']=void 0x0,this['_currentPreviewedChangeGroup']=null;let _0x68786d=_0x42dffd;_0x68786d||(_0x482db9||!this['activeConversation']?_0x68786d=this['context']['config']['get']('ai.models.defaultModelId'):this['_aiChatUi']['isModelAvailable']&&(_0x68786d=this['activeConversation']['selectedModel']['id'])),await this['_stopLastInteraction']();const _0x32f2e6=this['getGroupId'](),_0x3e13a2=_0x482db9||ot();let _0x389fe9;this['activeConversation']=new Gs({'connector':this['_aiConnector'],'chatModels':this['_aiChatModels'],'selectedModelId':_0x68786d,'conversationId':_0x3e13a2,'group':_0x32f2e6,'getEditor':()=>$s(this['context']),'getEditors':()=>Ws(this['context']),'locale':this['context']['locale'],'isFromHistory':!!_0x482db9}),this['activeConversation']['delegate']('toolDataReceived','interactionCreated','interactionStarted','replyCreated')['to'](this),this['activeConversation']['on']('conversationInitialized',(_0x32f0aa,_0xdcd35a)=>{this['_aiChatUi']['createConversation'](_0xdcd35a),this['_aiChatUi']['resetMessageInput'](),this['_aiChatUi']['clearPendingContextUI'](),this['_aiChatUi']['clearConversationContextUI'](),_0x482db9||(this['_aiChatUi']['resetConversationTitle'](),this['addCurrentDocumentToChatContext']());}),this['activeConversation']['on']('uploadProgressChanged',(_0xb2115b,_0x2724c5)=>{this['_aiChatUi']['setIsUploadInProgress'](_0x2724c5['isUploadInProgress']);}),this['activeConversation']['on']('webSearchStarted',()=>{const _0x1537ba=this['_aiChatUi']['prepareLoadingMessage']({'isWebSearchEnabled':!0x0,'isReasoningEnabled':!0x1});this['_aiChatUi']['setLoadingMessage'](_0x1537ba);}),this['activeConversation']['on']('reasoningStarted',()=>{const _0x151f0c=this['_aiChatUi']['prepareLoadingMessage']({'isWebSearchEnabled':!0x1,'isReasoningEnabled':!0x0});this['_aiChatUi']['setLoadingMessage'](_0x151f0c);}),this['activeConversation']['on']('webSearchFinished',(_0x5e04f1,_0x2373af)=>{this['_aiChatUi']['addFeedInteractionHeader'](_0x2373af,{'isWebSearchEnabled':!0x0,'isReasoningEnabled':!0x1});}),this['activeConversation']['on']('reasoningFinished',(_0x412782,_0x5433c1)=>{this['_aiChatUi']['addFeedInteractionHeader'](_0x5433c1,{'isWebSearchEnabled':!0x1,'isReasoningEnabled':!0x0});}),this['activeConversation']['on']('interactionStarted',()=>{this['_aiChatUi']['startInteraction']();}),this['activeConversation']['on']('interactionFinished',async()=>{this['_updateReplyContentThrottled']['flush'](),await this['_aiChatUi']['finishInteraction']();}),this['activeConversation']['on']('interactionDestroyed',(_0x4cfcd6,_0x537034)=>{this['_aiChatUi']['removeFeedInteraction'](_0x537034['id']);}),this['activeConversation']['on']('setConversationTitle',(_0x4ded16,_0x70b8da,_0x128175)=>{this['_updateConversationTitle'](_0x70b8da,_0x128175);}),this['activeConversation']['on']('replyContentUpdated',async(_0x1fd1a5,_0x18a711)=>{void 0x0!==_0x389fe9&&_0x389fe9!==_0x18a711['id']&&this['_updateReplyContentThrottled']['flush'](),_0x389fe9=_0x18a711['id'],await this['_updateReplyContentThrottled']({'reply':_0x18a711});}),this['activeConversation']['on']('replyChangeGroupStateUpdated',(_0x182502,{reply:_0xae99a2,index:_0x28c982,state:_0x26f4a1})=>{this['_aiChatUi']['updateFeedItemAIReplySuggestionPartState']({'id':_0xae99a2['id'],'index':_0x28c982,'state':_0x26f4a1}),this['_currentPreviewedChangeGroup']?.['replyId']['includes'](_0xae99a2['id'])&&this['_currentPreviewedChangeGroup']?.['partIndex']==_0x28c982&&(this['_activeBalloon']??this['_aiChatBalloon'])?.['setState'](_0x26f4a1);}),this['activeConversation']['on']('contextItemAdded',(_0x415b00,_0x568d38)=>{if(this['_aiChatUi']['addContextItem'](_0x568d38['contextItem'],_0x568d38['isLoading']),'selection'===_0x568d38['contextItem']['type']){const _0x239bac=[...$s(this['context'])['model']['document']['selection']['getRanges']()];this['_aiEditing']['showFakeVisualSelection']({'ranges':_0x239bac,'id':'context','priority':0x1});}}),this['activeConversation']['on']('contextItemRemoved',(_0x538ae8,_0x2278b2)=>{this['_aiChatUi']['removeContextItem'](_0x2278b2['uiId']),'current-document'==_0x2278b2['uiId']&&this['removeSelectionFromChatContext'](),'selection'===_0x2278b2['type']&&this['_aiEditing']['hideFakeVisualSelection']('context');}),this['activeConversation']['on']('contextItemLoadingEnded',(_0x2e436f,_0x4a3418)=>{this['_aiChatUi']['setContextItemLoading'](_0x4a3418['contextItem']['uiId'],_0x4a3418['isLoading']);}),this['activeConversation']['on']('contextSent',(_0x5a5c43,_0x4d740f)=>{this['_aiChatUi']['setConversationContext'](_0x4d740f['contextItems']);}),this['activeConversation']['on']('addContextOptionsChanged',(_0x408f7f,_0x289262)=>{this['_aiChatUi']['setAddContextOptions'](_0x289262['options']);}),this['activeConversation']['on']('sourceResourcesLoaded',(_0xfa36f5,_0x3757a2)=>{this['_aiChatUi']['populateSourceResourceBalloon'](_0x3757a2['sourceId'],_0x3757a2['source'],_0x3757a2['resources'],_0x3757a2['uid']);}),this['activeConversation']['on']('resourceStateChanged',(_0x7b92c4,_0x560b52)=>{this['_aiChatUi']['updateResourceState'](_0x560b52['sourceId'],_0x560b52['resourceId'],_0x560b52['isInContext']);}),this['activeConversation']['on']('capabilitiesUpdated',(_0x1eccef,_0x2453a5)=>{this['_aiChatUi']['updateCapabilities'](_0x2453a5);}),this['activeConversation']['on']('modelSelected',async(_0x3a847d,_0x4d9154)=>{const _0x1e1d1d=(await this['_aiChatModels']['getAll']())['find'](_0x299ca3=>_0x299ca3['id']===_0x4d9154['selectedModel']?.['id'])||null;this['_aiChatUi']['setSelectedModel'](_0x1e1d1d,_0x4d9154['isDisabled']);}),this['activeConversation']['on']('error',(_0x10202a,{error:_0x34d1a9,interactionId:_0x79900c,fileName:_0x35c991,url:_0x242c52,sourceId:_0x149ff4,sourceLabel:_0x1bf0d3})=>{const _0x48f1b4=_0x79900c?_0x79900c+':'+ot():ot();_0x34d1a9['message']['startsWith']('ai-request-aborted')?this['_aiChatUi']['addFeedItemStaticMessage']({'staticMessage':hs(this['context']['locale'],'AI_CHAT_ABORTED_MESSAGE'),'id':_0x48f1b4}):_0x34d1a9['message']['startsWith']('ai-chat-conversation-init-failed')||_0x34d1a9['message']['startsWith']('ai-chat-conversation-start-failed')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':hs(this['context']['locale'],'AI_CHAT_UNABLE_TO_START_CONVERSATION'),'id':_0x48f1b4}),this['_logError'](_0x34d1a9)):_0x34d1a9['message']['startsWith']('ai-chat-file-upload-failed')?this['_aiChatUi']['addFeedItemError']({'errorMessage':hs(this['context']['locale'],'AI_CHAT_CONTEXT_UNABLE_TO_UPLOAD_FILE',_0x35c991),'id':_0x48f1b4}):_0x34d1a9['message']['startsWith']('ai-chat-url-upload-failed')?this['_aiChatUi']['addFeedItemError']({'errorMessage':hs(this['context']['locale'],'AI_CHAT_CONTEXT_UNABLE_TO_UPLOAD_URL',_0x242c52),'id':_0x48f1b4}):_0x34d1a9['message']['startsWith']('ai-chat-context-invalid-data')?this['_aiChatUi']['addFeedItemError']({'errorMessage':hs(this['context']['locale'],'AI_CHAT_CONTEXT_INVALID_DATA'),'id':_0x48f1b4}):_0x34d1a9['message']['startsWith']('ai-chat-context-unsupported-type')?this['_aiChatUi']['addFeedItemError']({'errorMessage':hs(this['context']['locale'],'AI_CHAT_CONTEXT_UNSUPPORTED_TYPE'),'id':_0x48f1b4}):_0x34d1a9['message']['startsWith']('ai-chat-source-resources-load-failed')?(_0x149ff4&&this['_aiChatUi']['closeSourceResourceBalloon'](_0x149ff4),this['_aiChatUi']['addFeedItemError']({'errorMessage':hs(this['context']['locale'],'AI_CHAT_CONTEXT_UNABLE_TO_LOAD_RESOURCES',_0x1bf0d3||'source'),'id':_0x48f1b4}),this['_logError'](_0x34d1a9)):_0x34d1a9['message']['startsWith']('ai-chat-resource-load-failed')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':hs(this['context']['locale'],'AI_CHAT_RESOURCE_LOAD_FAILED'),'id':_0x48f1b4}),this['_logError'](_0x34d1a9)):_0x34d1a9['message']['startsWith']('ai-chat-invalid-request')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':hs(this['context']['locale'],'AI_CHAT_INVALID_REQUEST'),'id':_0x48f1b4}),this['_logError'](_0x34d1a9)):_0x34d1a9['message']['startsWith']('ai-chat-context-unsupported-file-type')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':hs(this['context']['locale'],'AI_CHAT_CONTEXT_UNSUPPORTED_FILE_TYPE'),'id':_0x48f1b4}),this['_logError'](_0x34d1a9)):_0x34d1a9['message']['startsWith']('ai-chat-context-file-too-large')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':hs(this['context']['locale'],'AI_CHAT_CONTEXT_FILE_TOO_LARGE'),'id':_0x48f1b4}),this['_logError'](_0x34d1a9)):_0x34d1a9['message']['startsWith']('ai-chat-context-file-too-many-pages')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':hs(this['context']['locale'],'AI_CHAT_CONTEXT_FILE_TOO_MANY_PAGES'),'id':_0x48f1b4}),this['_logError'](_0x34d1a9)):_0x34d1a9['message']['startsWith']('ai-chat-context-form-data-size-limits-exceeded')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':hs(this['context']['locale'],'AI_CHAT_CONTEXT_FORM_DATA_SIZE_LIMITS_EXCEEDED'),'id':_0x48f1b4}),this['_logError'](_0x34d1a9)):(this['_aiChatUi']['addFeedItemError']({'errorMessage':hs(this['context']['locale'],'AI_CHAT_GENERIC_ERROR'),'id':_0x48f1b4}),this['_logError'](_0x34d1a9));}),await this['activeConversation']['init'](this['context']['config']['get']('ai.chat.context')),_0x482db9||await this['activeConversation']['start']();}async['_handleUIUserMessage']({message:_0x1b6b22,attributes:_0x53c787}){if(!this['activeConversation'])throw new at('ai-chat-controller-no-active-conversation');if(this['activeConversation']['isCurrentDocumentInContext']()){const _0x46dfcb=await this['_aiEditing']['getDocumentData']();_0x46dfcb['length']>0x1?await this['activeConversation']['updateDocumentsInContext'](_0x46dfcb):await this['activeConversation']['updateCurrentDocumentInContext'](_0x46dfcb[0x0]);}this['activeConversation']['id']&&this['activeConversation']['isStarted']&&await this['activeConversation']['handleUserInteraction']({'userMessage':_0x1b6b22,'attributes':_0x53c787});}['_logError'](_0xc9ae57){Et(_0xc9ae57['message']);}['_removeFromContext'](_0x538898){this['activeConversation']?.['removeFromContext'](_0x538898);}['_toggleWebSearch'](){this['activeConversation']?.['toggleWebSearch']();}['_toggleReasoning'](){this['activeConversation']?.['toggleReasoning']();}['getInteractionAndReplyById'](_0x202a56){const [_0x141d89,_0x1c60bb]=_0x202a56['split'](':'),_0x456adb=this['activeConversation']['getInteraction'](_0x141d89),_0x430b1e=_0x456adb['getReply'](_0x1c60bb);return{'interaction':_0x456adb,'reply':_0x430b1e};}['_resolveGroupTarget'](_0x1f7f80,_0xf98238){const _0x1c3e2b=[..._0xf98238['changes']['filter'](_0x35212b=>'context'!==_0x35212b['type']),..._0xf98238['changes']['filter'](_0x10341c=>'context'===_0x10341c['type'])];for(const _0x5a23ba of _0x1c3e2b){const _0x3b3a25=_0x1f7f80['newNodeAnchorIds']['get'](_0x5a23ba['id']),_0x1a2e6f=this['activeConversation']?.['getSourceByDataId'](_0x5a23ba['id'])||this['activeConversation']?.['getSourceByDataId'](_0x3b3a25)||this['activeConversation']?.['getSourceByDataId'](_0x5a23ba['anchorId']??void 0x0);if(_0x1a2e6f){if('destroyed'===_0x1a2e6f['editor']['state'])return null;const _0x116ddc=_0x1a2e6f['editor']['model']['document']['getRoot'](_0x1a2e6f['rootName']);return _0x116ddc?{'editor':_0x1a2e6f['editor'],'root':_0x116ddc,'parsedDocumentContent':_s(_0x1a2e6f['content']),'serializedDocumentContent':_0x1a2e6f['content'],'version':_0x1a2e6f['version']}:null;}}const _0x5d8a41=$s(this['context']),_0x5f1750=this['activeConversation']['getInteraction'](_0x1f7f80['interactionId']),_0xdd7cad=_0x5f1750?.['getDocumentContext']();return{'editor':_0x5d8a41,'root':_0x5d8a41['model']['document']['getRoot'](),'parsedDocumentContent':_0x1f7f80['documentContextContent'],'serializedDocumentContent':_0xdd7cad?.['content'],'version':_0xdd7cad?.['version']};}['_groupChangesByTarget'](_0x4a1be9,_0x1b099c){const _0x40320c=new Map();for(const _0x1e3cb1 of _0x1b099c){const _0x5e04a7=this['_resolveGroupTarget'](_0x4a1be9,_0x1e3cb1);if(!_0x5e04a7)continue;const _0xde5b20=(_0x5e04a7['editor']['id']||'e')+'|'+_0x5e04a7['root']['rootName'];let _0x2d89e0=_0x40320c['get'](_0xde5b20);if(!_0x2d89e0){let _0x4f16d0;for(const _0x2c618d of[..._0x1e3cb1['changes']['filter'](_0x4eb6cc=>'context'!==_0x4eb6cc['type']),..._0x1e3cb1['changes']['filter'](_0x18fb42=>'context'===_0x18fb42['type'])])if(_0x4f16d0=this['activeConversation']?.['getDocumentContextSliceByDataId'](_0x2c618d['id'])||this['activeConversation']?.['getDocumentContextSliceByDataId'](_0x4a1be9['newNodeAnchorIds']['get'](_0x2c618d['id'])),_0x4f16d0)break;_0x2d89e0={'target':{'editor':_0x5e04a7['editor'],'root':_0x5e04a7['root']},'slice':_0x4f16d0,'groups':[],'groupsIndexes':[]},_0x40320c['set'](_0xde5b20,_0x2d89e0);}_0x2d89e0['groups']['push'](_0x1e3cb1),_0x2d89e0['groupsIndexes']['push'](_0x4a1be9['changeGroups']['indexOf'](_0x1e3cb1));}return Array['from'](_0x40320c['values']());}['_scrollToSuggestionRange'](_0x35d2b2,_0x3ea0ad=!0x1,_0x41fb7b){_0x41fb7b??=$s(this['context']);const _0x133733={'target':_0x41fb7b['editing']['view']['domConverter']['viewRangeToDom'](_0x41fb7b['editing']['mapper']['toViewRange'](_0x35d2b2)),'viewportOffset':{'top':0x96,'left':0x0,'bottom':0x32,'right':0x0},'ancestorOffset':0x14,'alignToTop':_0x3ea0ad};_0x3ea0ad&&(_0x133733['alignToTop']=!0x0),Ct(_0x133733);}['_updateConversationTitle'](_0x55c607,_0x3997d8=!0x1){this['_aiChatUi']['setConversationTitle'](_0x55c607||hs(this['context']['locale'],'AI_CHAT_UNTITLED_CONVERSATION'),_0x3997d8);}['_addFeedItemReply'](_0x2cfcd2){'text'===_0x2cfcd2['type']?this['_aiChatUi']['addFeedItemAIReply'](_0x2cfcd2):this['_aiChatUi']['addFeedItemAISuggestion'](_0x2cfcd2);}async['_updateReplyContent']({reply:_0x590f27,renderingStrategy:_0x3e536f}){const {id:_0xf3de4a,interactionId:_0xa5514b,isDone:_0x109890,type:_0x1d318b,parsedContent:_0xcdff7e}=_0x590f27,_0x38c513=_0xa5514b+':'+_0xf3de4a;if('modification'===_0x1d318b){const _0x521e95=_0x590f27['getContentParts']({'showDiff':this['_aiChatUi']['showDiff'],'editor':$s(this['context'])});await this['_aiChatUi']['updateFeedItemAIReplySuggestionContent']({'id':_0x38c513,'parts':_0x521e95,'isDone':_0x109890,'skipLoadingEffects':_0x590f27['isFromHistory']});}else'text'===_0x1d318b&&await this['_aiChatUi']['updateFeedItemAIReplyContent']({'id':_0x38c513,'parsedContent':_0xcdff7e,'renderingStrategy':_0x3e536f,'isDone':_0x109890});_0x109890&&_0x590f27['sources']['length']>0x0&&this['_aiChatUi']['updateFeedItemAIReplySources'](_0x38c513,_0x590f27['sources']);}['_updateReplyContentThrottled']=_0x40a7c6(this['_updateReplyContent']['bind'](this),0xc8);async['_stopLastInteraction'](){const _0x5cf83a=this['activeConversation']?.['lastInteraction'];_0x5cf83a&&(_0x5cf83a['stop'](),this['_aiChatUi']['stopInteraction'](_0x5cf83a)),this['_updateReplyContentThrottled']['cancel']();}async['_flushLastInteractionUI'](){const _0x62ff1f=this['activeConversation']?.['lastInteraction'];if(_0x62ff1f){for await(const _0x23fc06 of _0x62ff1f['replies'])this['_aiChatUi']['hasFeedItem'](_0x23fc06['id'])||this['_addFeedItemReply'](_0x23fc06),await this['_updateReplyContent']({'reply':_0x23fc06,'renderingStrategy':'static'});}}['_updateRatings'](_0x1f1fe6){const _0x4c2d2a={'positiveCount':_0x1f1fe6['changeGroups']['filter'](_0x11c911=>'accepted'===_0x11c911['state'])['length'],'totalCount':_0x1f1fe6['changeGroups']['length'],'modificationId':_0x1f1fe6['id']},_0x449471=this['activeConversation']['getInteraction'](_0x1f1fe6['interactionId'])['messageId'];_0x449471&&this['_aiConnector']['upsertAIChatRating'](this['activeConversation']['id'],_0x449471,_0x4c2d2a);}['_getAIChatFeedAPI'](_0x154247){const _0x3796e4=this['_aiChatUi'],_0xad6af1=()=>{_0x154247['resetWebSearchState'](),_0x154247['resetReasoningState'](),_0x3796e4['clearLoadingMessage']();},_0x2e792d=()=>{_0x154247['currentReply']&&(_0x154247['currentReply']['done'](),_0x154247['currentReply']=void 0x0);};return{'insertTextReply':(_0x373363,_0x5a2911)=>{_0x2e792d(),_0xad6af1();const _0x574b12=_0x154247['currentReply']=_0x154247['createReply']({'type':'text','interactionId':_0x154247['id'],'content':_0x373363,'id':_0x5a2911||ot()});return _0x2e792d(),_0x574b12;},'insertCustomElement':async(_0x3c88d6,_0x134f78)=>(_0x2e792d(),_0xad6af1(),_0x3796e4['addFeedItemCustomElement'](_0x3c88d6,_0x134f78||ot())),'setLoadingMessage':_0x19bcb4=>{_0x3796e4['setLoadingMessage'](_0x19bcb4);},'clearLoadingMessage':()=>{_0x3796e4['clearLoadingMessage']();}};}}const zs='ai-selection',js=['br'];class Js extends _0x2599d1{constructor(_0x4ed805){super(_0x4ed805),this['context']['config']['define']('ai.models.showModelSelector',!0x0);}['_outputDataProcessor'];['_fakeSelections']=[];['_sessionId'];['_lastContentFocusedEditor'];static get['pluginName'](){return'AIEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['getLastContentFocusedEditor'](){return this['_lastContentFocusedEditor'];}get['sessionId'](){if(!this['_sessionId']){const _0x571840=Ws(this['context']),_0x54cc03=_0x571840['find'](_0x4c3a1b=>_0x4c3a1b['plugins']['has']('RealTimeCollaborationClient'))||_0x571840[0x0],_0x39ea53=_0x54cc03['plugins']['has']('RealTimeCollaborationClient')&&_0x54cc03['plugins']['get']('RealTimeCollaborationClient')['sessionId'];this['_sessionId']=_0x39ea53||ot();}return this['_sessionId'];}async['getDocumentData'](){const _0x15db34=Ws(this['context']);if(!_0x15db34['length'])throw new at('ai-get-editor-from-context-no-editor');const _0x2b4a8d=[],_0x3e0a40=new Set();for(const _0x14a43b of _0x15db34){const _0x208683=_0x14a43b['config']['get']('roots')||{};for(const _0x30c1eb of _0x14a43b['model']['document']['getRoots']()){if('$graveyard'===_0x30c1eb['rootName'])continue;const _0x1fb0ac=await this['_getDocumentDataForEditorRoot'](_0x14a43b,_0x30c1eb,_0x3e0a40),_0x56b1d4=_0x208683[_0x30c1eb['rootName']];_0x2b4a8d['push']({'editor':_0x14a43b,'rootName':_0x30c1eb['rootName'],'content':_0x1fb0ac['content'],'version':_0x1fb0ac['version'],'sessionId':this['sessionId'],'selections':_0x1fb0ac['selections'],'name':_0x30c1eb['rootName'],'description':_0x56b1d4?.['description']});}}return _0x2b4a8d;}async['_getDocumentDataForEditorRoot'](_0x7796c4,_0x3a49f0,_0x50a203){const _0x42837c=_0x7796c4['data']['toView'](_0x3a49f0,{'convertAiChatSelectionMarker':!0x0}),_0x2f1a8a=new _0x2b11d8(_0x7796c4['editing']['view']['document']);this['_setDataIdsOnChildren'](_0x42837c,_0x2f1a8a,_0x50a203);let _0x326928=await this['_getDocumentDataStringFromView'](_0x42837c,_0x7796c4);const _0x4690c4=this['_getMarkersInDocumentOrder'](_0x7796c4,_0x3a49f0),_0x568423=[];for(const _0x575222 of _0x4690c4){const _0x364276='<'+_0x575222['name']+':start></'+_0x575222['name']+':start>',_0x2c7c36=_0x326928['indexOf'](_0x364276);_0x326928=_0x326928['substring'](0x0,_0x2c7c36)+_0x326928['substring'](_0x2c7c36+_0x364276['length']);const _0x2e9408='<'+_0x575222['name']+':end></'+_0x575222['name']+':end>',_0x34045d=_0x326928['indexOf'](_0x2e9408);_0x326928=_0x326928['substring'](0x0,_0x34045d)+_0x326928['substring'](_0x34045d+_0x2e9408['length']),_0x568423['push']({'markerName':_0x575222['name'],'start':_0x2c7c36,'end':_0x34045d,'htmlFragment':_0x326928['substring'](_0x2c7c36,_0x34045d)});}return{'content':_0x326928,'version':_0x7796c4['model']['document']['version'],'selections':_0x568423};}async['afterInit'](){this['context']instanceof _0x4da990?this['_integrateEditor'](this['context']):this['listenTo'](this['context']['editors'],'add',(_0x2156ce,_0x37d047)=>{_0x37d047['on']('ready',()=>{this['_integrateEditor'](_0x37d047);});});}['_setOutputDataProcessor'](_0x37a3f1){this['_outputDataProcessor']=_0x37a3f1;}async['_getDocumentDataStringFromView'](_0x61de71,_0x2fcd3d){let _0x2450f4;if(this['_outputDataProcessor']){const _0x17ff03=_0x2fcd3d['data']['processor']['domConverter']['viewToDom'](_0x61de71),_0x2ceb85=await this['_outputDataProcessor'](_0x17ff03);_0x2450f4=_0x2fcd3d['data']['processor']['htmlWriter']['getHtml'](_0x2ceb85);}else _0x2450f4=_0x2fcd3d['data']['processor']['toData'](_0x61de71);return _0x2450f4;}['_integrateEditor'](_0x12fda4){_0x12fda4['ui']['focusTracker']['on']('change:isFocused',(_0x14576a,_0x5e9b78,_0x2ccefd)=>{_0x2ccefd&&(this['_lastContentFocusedEditor']=_0x12fda4);}),_0x12fda4['on']('destroy',()=>{this['_lastContentFocusedEditor']===_0x12fda4&&(this['_lastContentFocusedEditor']=void 0x0);}),_0x12fda4['conversion']['for']('editingDowncast')['markerToHighlight']({'model':zs,'view':({markerName:_0x20d944})=>({'classes':['ck-ai-assistant-ui_theme','ck-fake-ai-selection','ck-fake-ai-selection-'+_0x20d944['split'](':')[0x1]],'priority':0xc})}),_0x12fda4['conversion']['for']('dataDowncast')['markerToElement']({'model':zs+':context','view':(_0x27af41,{writer:_0x557850,options:_0xd1efde})=>_0xd1efde['convertAiChatSelectionMarker']?_0x557850['createUIElement'](_0x27af41['markerName']+':'+(_0x27af41['isOpening']?'start':'end')):null});}['showFakeVisualSelection'](_0x5cd302){const _0x5500d3=this['_fakeSelections'][0x0]||null;this['_addFakeSelection'](_0x5cd302);const _0x45f835=this['_fakeSelections'][0x0]||null;this['_refreshFakeSelection'](_0x5500d3,_0x45f835);}['hideFakeVisualSelection'](_0x4717b6){const _0x40dc60=this['_fakeSelections'][0x0]||null;this['_removeFakeSelectionById'](_0x4717b6);const _0x35c116=this['_fakeSelections'][0x0]||null;this['_refreshFakeSelection'](_0x40dc60,_0x35c116);}async['modelToDataWithIds'](_0x48c6d3){const _0x429350=$s(this['context']),_0x21ffbc=_0x429350['data']['toView'](_0x48c6d3),_0x22e4f0=new _0x2b11d8(_0x429350['editing']['view']['document']);return this['_setDataIdsOnChildren'](_0x21ffbc,_0x22e4f0),this['_getDocumentDataStringFromView'](_0x21ffbc,_0x429350);}['_setDataIdsOnChildren'](_0xf1541a,_0x3c3623,_0x310d70=new Set()){let _0x42c7ec=!0x1;for(const _0x134b7f of _0xf1541a['getChildren']()){if(!_0x134b7f['is']('view:element')||js['includes'](_0x134b7f['name']))continue;const _0x954363=_0x134b7f['is']('view:containerElement'),_0x3f8ba7=_0x134b7f['is']('view:emptyElement'),_0x2e919f=this['_setDataIdsOnChildren'](_0x134b7f,_0x3c3623,_0x310d70);if(_0x134b7f['hasAttribute']('data-id')){_0x42c7ec=!0x0,_0x310d70['add'](_0x134b7f['getAttribute']('data-id'));continue;}(_0x954363||_0x3f8ba7||_0x2e919f)&&(_0x3c3623['setAttribute']('data-id',this['_nextDataId'](_0x310d70),_0x134b7f),_0x42c7ec=!0x0);}return _0x42c7ec;}['_nextDataId'](_0x3181a9){let _0x171c2c;do{_0x171c2c='';for(let _0x5d4f14=0x0;_0x5d4f14<0x4;_0x5d4f14++)_0x171c2c+=String['fromCharCode'](0x61+Math['floor'](0x1a*Math['random']()));}while(_0x3181a9['has'](_0x171c2c));return _0x3181a9['add'](_0x171c2c),_0x171c2c;}['getSelectionText'](){const {model:_0x4801e8}=$s(this['context']),_0x3cf0a3=_0x4801e8['document']['selection'],_0x14ce47=[],_0x3deca1=Array['from'](_0x3cf0a3['getRanges']());_0x3deca1['sort']((_0x35f958,_0xab1bfa)=>_0x35f958['start']['isBefore'](_0xab1bfa['start'])?-0x1:0x1);for(const _0x187acf of _0x3deca1)for(const _0x4e943f of _0x187acf['getItems']())_0x4e943f['is']('$textProxy')?_0x14ce47['push'](_0x4e943f['data']):_0x4e943f['is']('element')&&_0x14ce47['length']>0x0&&'\x20'!==_0x14ce47[_0x14ce47['length']-0x1]&&_0x14ce47['push']('\x20');return _0x14ce47['length']?'\x22'+_0x14ce47['join']('')['trim']()+'\x22':hs(this['context']['locale'],'AI_CHAT_CONTEXT_DOCUMENT_SELECTION_LABEL');}['_removeFakeSelectionById'](_0x306594){for(let _0x493c5d=0x0;_0x493c5d<this['_fakeSelections']['length'];_0x493c5d++)if(this['_fakeSelections'][_0x493c5d]['id']==_0x306594)return void this['_fakeSelections']['splice'](_0x493c5d,0x1);}['_addFakeSelection'](_0x39883e){this['_removeFakeSelectionById'](_0x39883e['id']),wt(this['_fakeSelections'],_0x39883e);}['_refreshFakeSelection'](_0x1699fe,_0x59ceb2){if(_0x1699fe==_0x59ceb2)return;const _0x46f35c=_0x1699fe?this['_getEditorForFakeSelection'](_0x1699fe):null,_0xfadca7=_0x59ceb2?this['_getEditorForFakeSelection'](_0x59ceb2):null,_0x33b0c6=(_0x14512b,_0x209960)=>{const _0x17e70b=_0x209960['model']['markers']['getMarkersGroup'](zs);for(const _0x4952e0 of _0x17e70b)_0x14512b['removeMarker'](_0x4952e0);},_0x567cc9=(_0x2302c0,_0x5193e2,_0x1357e1)=>{const _0xd30c7a=_0x5193e2['model'];for(let _0x432145=0x0;_0x432145<_0x1357e1['ranges']['length'];_0x432145++){let _0x29e956=_0x1357e1['ranges'][_0x432145];const _0x1c970e=zs+':'+_0x1357e1['id']+':'+_0x432145;if(_0x29e956['start']['isAtEnd']){const _0x30a5f8=_0x29e956['start']['getLastMatchingPosition'](({item:_0x42fd83})=>!_0xd30c7a['schema']['isContent'](_0x42fd83),{'boundaries':_0x29e956});_0x29e956=_0x2302c0['createRange'](_0x30a5f8,_0x29e956['end']);}_0x2302c0['addMarker'](_0x1c970e,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x29e956});}};_0x46f35c&&_0xfadca7&&_0x46f35c===_0xfadca7&&_0x59ceb2?_0x46f35c['model']['change'](_0x3bd34c=>{_0x33b0c6(_0x3bd34c,_0x46f35c),_0x567cc9(_0x3bd34c,_0xfadca7,_0x59ceb2);}):(_0x46f35c&&_0x46f35c['model']['change'](_0x4ae405=>_0x33b0c6(_0x4ae405,_0x46f35c)),_0xfadca7&&_0x59ceb2&&_0xfadca7['model']['change'](_0x1b4b01=>_0x567cc9(_0x1b4b01,_0xfadca7,_0x59ceb2)));}['_getEditorForFakeSelection'](_0x3a92fc){if(!_0x3a92fc['ranges']['length'])return $s(this['context']);const _0x24772a=_0x3a92fc['ranges'][0x0]['root']['document'];return Ws(this['context'])['find'](_0x4618b9=>_0x4618b9['model']['document']===_0x24772a)??$s(this['context']);}['_getMarkersInDocumentOrder'](_0x5090a8,_0x5570dd){const _0x22782f=Array['from'](_0x5090a8['model']['markers']['getMarkersGroup'](zs+':context'));return(_0x5570dd?_0x22782f['filter'](_0x4b543e=>{const _0x3fcaa2=_0x4b543e['getRange']();return _0x3fcaa2&&_0x3fcaa2['root']['rootName']===_0x5570dd['rootName'];}):_0x22782f)['sort']((_0xe524fc,_0x85376)=>_0xe524fc['getStart']()['isBefore'](_0x85376['getStart']())?-0x1:_0xe524fc['getStart']()['isAfter'](_0x85376['getStart']())?0x1:0x0);}}const Zs=['showChangeInText','insertSuggestion','applySuggestion','rejectSuggestion','mouseOverSuggestion','mouseLeaveSuggestion','toggleSuggestionDisplayMode','like','dislike'],tn=[...Zs,'startConversation','sendUserMessage','abortPromptStream','addDocumentToContext','addFileToContext','addUrlToContext','executeCustomItemCallback','addResourceToContext','removeContextItem','loadSourceResources','toggleWebSearch','toggleReasoning','selectModel'];function en(_0x20b07b){const _0x41e094=new AbortController();return{'promise':new Promise((_0xb6147a,_0x36c97b)=>{const _0x3935c=setTimeout(_0xb6147a,_0x20b07b);_0x41e094['signal']['addEventListener']('abort',()=>{clearTimeout(_0x3935c),_0x36c97b();});}),'abortController':_0x41e094};}class sn{['options'];['isStreaming']=!0x1;['document']=null;['nodesList']=[];['currentIndex']=0x0;['timeoutAbortController']=null;['lastUpdateTime']=0x0;constructor(_0x3b06b4){this['options']={'delay':_0x3b06b4?.['delay']??0xa,'textNodeStyle':_0x3b06b4?.['textNodeStyle']??'animation:\x20ck-html-streamer-fade-in\x20.3s'};}async['stream']({document:_0x173fdd,targetElement:_0x542d05,abortSignal:_0x21bdac}){this['isStreaming']&&this['stop'](),_0x21bdac?.['addEventListener']('abort',this['stop']['bind'](this)),this['document']=_0x2f4f0d(_0x173fdd,!0x0),this['nodesList']=this['getParsedDocumentNodeList'](),this['isStreaming']=!0x0,this['currentIndex']>this['nodesList']['length']&&(this['currentIndex']=this['nodesList']['length']);for(let _0x2e2691=0x0;_0x2e2691<this['currentIndex'];_0x2e2691++)this['nodesList'][_0x2e2691]['shouldBeStreamed']=!0x0;do{const _0x31a136=Date['now'](),_0x4e9ca1=this['nodesList'][this['currentIndex']],_0x524f7d=_0x31a136-this['lastUpdateTime'];if(_0x4e9ca1){_0x4e9ca1['shouldBeStreamed']=!0x0;let _0x5969e9=_0x4e9ca1['parent'];for(;_0x5969e9;)_0x5969e9['shouldBeStreamed']=!0x0,_0x5969e9=_0x5969e9['parent'];}if(_0x524f7d<this['options']['delay'])try{const {promise:_0x2d9b35,abortController:_0x337425}=en(this['options']['delay']-_0x524f7d);this['timeoutAbortController']=_0x337425,await _0x2d9b35;}catch(_0x50fb84){return;}_0x1d1574(_0x542d05,'<'+_0x542d05['tagName']+'>'+this['renderNode'](this['document'])+'</'+_0x542d05['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:_0x5a2e45}){Array['from'](_0x5a2e45['querySelectorAll']('span[data-ck-html-streamer-word-chunk]'))['reverse']()['forEach'](_0x49ff8f=>{_0x49ff8f['replaceWith'](_0x49ff8f['childNodes'][0x0]);});}['stop'](){this['isStreaming']=!0x1,this['timeoutAbortController']&&(this['timeoutAbortController']['abort'](),this['timeoutAbortController']=null);}['renderNode'](_0x594507){let _0x5534c6='';if(function(_0x34f8ef){return _0x39c08a(_0x34f8ef);}(_0x594507)){for(const _0x19a1c6 of _0x594507['children'])_0x5534c6+=this['renderNode'](_0x19a1c6);}else{if(on(_0x594507)){if(!_0x594507['shouldBeStreamed'])return'';const _0xbf53b9=_0x594507,_0x4e35b0=Object['entries'](_0xbf53b9['attribs'])['map'](([_0x506de7,_0x5b2d5b])=>_0x506de7+'=\x22'+_0x5b2d5b+'\x22')['join']('\x20');_0x5534c6+='<'+_0xbf53b9['tagName']+(_0x4e35b0?'\x20'+_0x4e35b0:'')+'>';for(const _0x4f874a of _0x188208(_0xbf53b9))_0x5534c6+=this['renderNode'](_0x4f874a);_0x5534c6+='</'+_0xbf53b9['tagName']+'>';}else{if(!rn(_0x594507))return'';if(!_0x594507['shouldBeStreamed'])return'';!function(_0xc79ba2){if(!_0xc79ba2['parent']||!on(_0xc79ba2['parent']))return!0x1;if(!nn['includes'](_0xc79ba2['parent']['tagName']))return!0x1;return!_0x474106(_0xc79ba2)['match'](/^\s*[<>]\s*$/);}(_0x594507)?_0x5534c6+=ti(_0x594507):_0x5534c6+=ti(new _0x3eba9e('span',{'data-ck-html-streamer-word-chunk':'','style':this['options']['textNodeStyle']},[_0x594507]));}}return _0x5534c6;}['getParsedDocumentNodeList'](){const _0x5d5b55=[];return function(_0xdb43e9,_0x33b508){const _0x14c049=_0x559340=>{if(_0x33b508(_0x559340),_0x559340 instanceof _0x3661f9)for(let _0x3b7c91=0x0;_0x3b7c91<_0x559340['children']['length'];_0x3b7c91++){const _0x33aa46=_0x559340['children'][_0x3b7c91];_0x14c049(_0x33aa46);}};for(let _0x544136=0x0;_0x544136<_0xdb43e9['children']['length'];_0x544136++)_0x14c049(_0xdb43e9['children'][_0x544136]);}(this['document'],_0x4fc6e3=>{if(rn(_0x4fc6e3)){const _0xd2ebbe=this['splitTextNodeIntoWordNodes'](_0x4fc6e3);_0xd2ebbe['length']&&_0x5d5b55['push'](..._0xd2ebbe);}_0x4fc6e3['isWordSplitSource']||_0x4fc6e3['isWordSplitResult']||_0x5d5b55['push'](_0x4fc6e3);}),_0x5d5b55;}['splitTextNodeIntoWordNodes'](_0x15c7c4){if(_0x15c7c4['isWordSplitSource']||_0x15c7c4['isWordSplitResult'])return[];const _0x49202c=_0x474106(_0x15c7c4)['match'](/(?:\s*\S+\s*)/g),_0x43879c=[];if(_0x49202c&&_0x49202c['length']>0x1){for(const _0x4981db of _0x49202c){const _0x250397=new _0x17483f(_0x4981db);_0x250397['isWordSplitResult']=!0x0,_0x3f803f(_0x15c7c4,_0x250397),_0x43879c['push'](_0x250397);}_0x15c7c4['isWordSplitSource']=!0x0,_0x5ac2a3(_0x15c7c4);}return _0x43879c;}}const nn=['p','li','td','th','span','h1','h2','h3','h4','h5','h6','b','strong','i','em','mark','del','ins','sup','sub','a','code','div'];function rn(_0x158497){return _0x299179(_0x158497);}function on(_0x8bf57f){return _0x2782ce(_0x8bf57f);}class an extends vt{['options'];['content']='';['htmlStreamer'];['children'];constructor(_0x4d23db){super();const _0xa3efb3=this['bindTemplate'];this['set']('isDone',!0x1),this['set']('isVisible',!0x0),this['htmlStreamer']=new sn(),this['options']=_0x4d23db,this['children']=this['createCollection'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed__item',_0xa3efb3['if']('isDone','ck-ai-chat__feed__item_done'),_0xa3efb3['if']('isVisible','ck-hidden',_0x5f24c7=>!_0x5f24c7),'ck-ai-chat__feed__text-item'],'data-cke-ai-id':this['options']['id']},'children':this['children']});}['markAsDone'](){this['htmlStreamer']['cleanUpAnimations']({'targetElement':this['element']}),this['element']['querySelectorAll']('[data-id]')['forEach'](_0x8143c2=>{_0x8143c2['removeAttribute']('data-id');}),this['isDone']=!0x0;}async['streamIntoElement'](_0x58fa10,_0x199773,_0x5adcf4){await this['htmlStreamer']['stream']({'document':_0x58fa10,'targetElement':_0x199773,'abortSignal':_0x5adcf4});}}class hn extends vt{['showChangesToggleView'];constructor(_0x3b5cd2,_0x28b4de){super(_0x3b5cd2),this['set']('isShowChangesToggleVisible',!0x0),this['showChangesToggleView']=new cn(_0x3b5cd2),this['showChangesToggleView']['set']({'class':'ck-ai-suggestion__header__show-changes-toggle\x20ck-ai-chat-controls-button\x20'+us,'label':hs(_0x3b5cd2,'AI_SUGGESTION_BUTTON_SHOW_CHANGES'),'withText':!0x0}),this['showChangesToggleView']['isOn']=_0x28b4de['showDiff'],this['showChangesToggleView']['bind']('isVisible')['to'](this,'isShowChangesToggleVisible'),this['showChangesToggleView']['bind']('icon')['to'](this['showChangesToggleView'],'isOn',_0x1f9a17=>_0x1f9a17?_0x2f925f:_0x1d0393),this['showChangesToggleView']['on']('execute',()=>{this['showChangesToggleView']['isOn']=!this['showChangesToggleView']['isOn'],this['fire']('toggleShowChanges',{'isOn':this['showChangesToggleView']['isOn']});});const _0x216468=new xt();_0x216468['content']=_0x2db615,this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__header',!0x1===_0x28b4de['showHeader']?'ck-hidden':null]['filter'](Boolean)},'children':[_0x216468,{'tag':'span','children':[hs(_0x3b5cd2,'AI_SUGGESTION_HEADER_TITLE')]},this['showChangesToggleView']]});}}class cn extends Nt{['render'](){super['render'](),this['children']['remove'](this['iconView']),this['children']['add'](this['iconView']);}}const ln={'accepted':_0x5a99f0,'rejected':_0x2c110b,'outdated':_0x2c110b};class un extends vt{['stateIconView'];constructor(_0x21043e){super(_0x21043e);const _0x104c57=this['bindTemplate'];this['set']('state','accepted'),this['set']('isVisible',!0x0),this['stateIconView']=new dn(),this['stateIconView']['bind']('state')['to'](this),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__content-part-state',_0x104c57['to']('state',_0xac0ce=>'ck-ai-suggestion__content-part-state_'+_0xac0ce),_0x104c57['if']('isVisible','ck-hidden',_0x6efebc=>!_0x6efebc)]},'children':[{'tag':'span','attributes':{'class':['ck-ai-suggestion__content-part-state__label']},'children':[{'text':_0x104c57['to']('state',_0x39cc53=>{switch(_0x39cc53){case'accepted':return hs(_0x21043e,'AI_SUGGESTION_CONTENT_PART_STATE_ACCEPTED');case'rejected':return hs(_0x21043e,'AI_SUGGESTION_CONTENT_PART_STATE_REJECTED');case'outdated':return hs(_0x21043e,'AI_SUGGESTION_CONTENT_PART_STATE_OUTDATED');}})}]},this['stateIconView']]});}['setState'](_0x1af9c8){this['state']=_0x1af9c8;}}class dn extends xt{constructor(){super(),this['set']('state','accepted'),this['content']=ln[this['state']],this['on']('change:state',()=>{this['content']=ln[this['state']];});}}class _n extends kt{['_applyButton'];['_suggestButton'];constructor(_0x309f7f,_0x2ce568,_0x4610d0){super(_0x309f7f);const _0x1d647d=Boolean(_0x4610d0);this['set']('isEnabled',!_0x1d647d),this['set']('isVisible',!0x0),this['class']='ck-ai-suggestion-content-part-toolbar';const _0x144926=[];if(_0x1d647d){const _0x2432bb=new Nt(_0x309f7f);_0x2432bb['set']({'label':hs(_0x309f7f,'AI_SUGGESTION_DISABLED_TOOLTIP_MESSAGE'),'tooltip':!0x0,'withText':!0x1,'icon':_0xc177b6}),_0x2432bb['extendTemplate']({'attributes':{'data-cke-tooltip-class':'ck-ai-suggestion-content-part-disabled-actions-tooltip'}}),_0x144926['push'](_0x2432bb);}else{_0x2ce568['includes']('applySuggestion')&&(this['_applyButton']=new Nt(_0x309f7f),this['_applyButton']['set']({'label':hs(_0x309f7f,'AI_SUGGESTION_CONTENT_PART_APPLY'),'tooltip':!0x0,'tooltipPosition':'n','withText':!0x1,'icon':_0x5a99f0}),this['_applyButton']['bind']('isEnabled')['to'](this),this['_applyButton']['on']('execute',()=>{this['fire']('applySuggestion');}),_0x144926['push'](this['_applyButton'])),_0x2ce568['includes']('insertSuggestion')&&(this['_suggestButton']=new Nt(_0x309f7f),this['_suggestButton']['set']({'label':hs(_0x309f7f,'AI_SUGGESTION_CONTENT_PART_ADD_SUGGESTION'),'tooltip':!0x0,'tooltipPosition':'n','withText':!0x1,'icon':_0x444a45}),this['_suggestButton']['bind']('isEnabled')['to'](this),this['_suggestButton']['on']('execute',()=>{this['fire']('insertSuggestion');}),_0x144926['push'](this['_suggestButton']));const _0x3f4206=new Nt(_0x309f7f);_0x3f4206['set']({'label':hs(_0x309f7f,'AI_SUGGESTION_CONTENT_PART_REJECT'),'tooltip':!0x0,'tooltipPosition':'n','withText':!0x1,'icon':_0x2c110b}),_0x3f4206['bind']('isEnabled')['to'](this),_0x3f4206['on']('execute',()=>{this['fire']('rejectSuggestion');}),_0x144926['push'](_0x3f4206);}this['items']['addMany'](_0x144926);const _0x564c2b=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':[_0x564c2b['if']('isVisible','ck-hidden',_0x2e9c57=>!_0x2e9c57)]}});}['setButtonsVisibility']({showApplyButton:_0x5dbd2d,showSuggestButton:_0xd6dd47}){this['_applyButton']&&(this['_applyButton']['isVisible']=_0x5dbd2d),this['_suggestButton']&&(this['_suggestButton']['isVisible']=_0xd6dd47);}}class gn extends vt{['toolbarView'];['stateView'];['titleLabelView'];['children'];constructor(_0x3abc5a,{part:_0x5552c6,uiIndex:_0xcc55e8,availableActions:_0x1c16b3,areActionsDisabled:_0x2d5762}){super(_0x3abc5a),this['set']('isEnabled',!0x0),this['set']('state','pending'),this['toolbarView']=new _n(_0x3abc5a,_0x1c16b3,_0x2d5762),this['toolbarView']['on']('rejectSuggestion',()=>{this['fire']('rejectSuggestion',{'index':_0x5552c6['index']});}),this['toolbarView']['on']('insertSuggestion',()=>{this['fire']('insertSuggestion',{'index':_0x5552c6['index']});}),this['toolbarView']['on']('applySuggestion',()=>{this['fire']('applySuggestion',{'index':_0x5552c6['index']});}),this['toolbarView']['bind']('isEnabled')['to'](this),this['stateView']=new un(_0x3abc5a),this['titleLabelView']=new An(_0x3abc5a,_0xcc55e8),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',(_0x4b288f,_0x6c297d,_0x5871c4,_0x2c35df)=>{'pending'===_0x2c35df?this['children']['remove'](this['toolbarView']):this['children']['remove'](this['stateView']),'pending'===_0x5871c4?this['children']['add'](this['toolbarView']):(this['stateView']['setState'](_0x5871c4),this['children']['add'](this['stateView']));});}}class An extends vt{constructor(_0x515a56,_0x141eb2){super(_0x515a56),this['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai-suggestion__body__content-part__title__label']},'children':[hs(_0x515a56,'AI_SUGGESTION_CONTENT_PART_TITLE',_0x141eb2['toString']())]});}}class In extends vt{['htmlStreamer'];constructor(_0x3f7eef){super(_0x3f7eef),this['htmlStreamer']=new sn(),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-content','ck-reset_all-excluded','ck-ai-suggestion-streamable-content']}});}async['update']({part:_0x4ac4fd,renderingStrategy:_0x2c69e3,abortSignal:_0x14663e}){'streaming'===_0x2c69e3?await this['htmlStreamer']['stream']({'document':_0x4ac4fd['content'],'targetElement':this['element'],'abortSignal':_0x14663e}):_0x1d1574(this['element'],'<'+this['element']['tagName']+'>'+gs(_0x4ac4fd['content'])+'</'+this['element']['tagName']+'>',{'childrenOnly':!0x0});}['clear'](){this['htmlStreamer']['reset'](),this['element']['innerHTML']='';}}class En extends vt{['_children'];['_headerView'];['_streamableContentView'];constructor(_0x4bf1a3,{part:_0x3ab87b,uiIndex:_0x4ad67e,areActionsDisabled:_0x475155,availableActions:_0x14b6b5}){super(_0x4bf1a3);const _0x1eda65=this['bindTemplate'];this['set']('state','pending'),this['set']('isDone',!0x1),this['set']('isVisible',!0x1),this['set']('isActive',!0x1),this['set']('isEnabled',!0x1);const _0x5ac172=()=>{this['isEnabled']=this['isDone']&&'pending'==this['state']&&!_0x475155;};this['on']('change:state',_0x5ac172),this['on']('change:isDone',_0x5ac172),_0x5ac172(),this['_children']=this['createCollection'](),this['_headerView']=new gn(_0x4bf1a3,{'part':_0x3ab87b,'uiIndex':_0x4ad67e,'availableActions':_0x14b6b5,'areActionsDisabled':_0x475155}),this['_headerView']['bind']('isEnabled','state')['to'](this),this['_headerView']['delegate'](...Zs)['to'](this),this['_streamableContentView']=new In(_0x4bf1a3),this['_children']['addMany']([this['_headerView'],this['_streamableContentView']]),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__body__content-part',_0x1eda65['to']('state',_0x282d6a=>'ck-ai-suggestion__body__content-part_'+_0x282d6a),_0x1eda65['if']('isEnabled','ck-ai-suggestion__body__content-part_enabled'),_0x1eda65['if']('isActive','ck-ai-suggestion__body__content-part_active'),_0x1eda65['if']('isVisible','ck-hidden',_0x8d807=>!_0x8d807)]},'children':this['_children'],'on':{'mouseenter':_0x1eda65['to'](()=>{this['isEnabled']&&this['fire']('mouseOverSuggestion',{'index':_0x3ab87b['index']});}),'mouseleave':_0x1eda65['to'](()=>{this['isEnabled']&&this['fire']('mouseLeaveSuggestion',{'index':_0x3ab87b['index']});}),'click':_0x1eda65['to'](_0x3f353e=>{const _0x54be2e=_0x3f353e['target'];this['isEnabled']&&!this['_headerView']['toolbarView']['element']['contains'](_0x54be2e)&&this['fire']('showChangeInText',{'index':_0x3ab87b['index']});})}});}async['updateContent']({part:_0x421080,showUnchangedParts:_0x46818e=!0x1,abortSignal:_0x493615}){this['partDefinition']=_0x421080,this['isVisible']=this['partDefinition']['hasChanges']||_0x46818e,this['isVisible']&&await this['_streamableContentView']['update']({'part':_0x421080,'renderingStrategy':'static','abortSignal':_0x493615});}['markAsDone'](){this['isDone']=!0x0;}}class pn extends vt{constructor(_0x592791,_0x3ebe5b){super(_0x592791),this['set']('isVisible',!0x0),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-skeleton',this['bindTemplate']['if']('isVisible','ck-hidden',_0x4ac05e=>!_0x4ac05e)]},'children':this['_createSkeletonItems'](_0x3ebe5b)});}['_createSkeletonItems'](_0x54d4f5){const _0x55ec29=['ck','ck-ai-skeleton__item'];return _0x54d4f5['map'](_0x1cf904=>{let _0x2b5530='';switch(_0x1cf904['attributes']['align']){case'right':_0x2b5530='margin-left:\x20auto;\x20margin-right:\x200;\x20text-align:\x20right;';break;case'center':_0x2b5530='margin-left:\x20auto;\x20margin-right:\x20auto;\x20text-align:\x20center;';break;case'left':_0x2b5530='margin-left:\x200;\x20margin-right:\x20auto;\x20text-align:\x20left;';}return{'tag':_0x1cf904['tag'],'attributes':{'class':[..._0x55ec29,_0x1cf904['attributes']['class']?_0x1cf904['attributes']['class']:''],'style':'width:\x20'+_0x1cf904['attributes']['width']+';\x20height:\x20'+_0x1cf904['attributes']['height']+';'+_0x2b5530}};});}}const mn={'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':Tn(0x5,'100%','44px','right'),'aiChatResources':Tn(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 Tn(_0x4b3fe6,_0x3d5a75,_0x309060,_0x265ecb){return new Array(_0x4b3fe6)['fill'](null)['map'](()=>({'tag':'div','attributes':{'width':_0x3d5a75,'height':_0x309060,'align':_0x265ecb}}));}class Cn extends Tt(){['queue']=[];['isProcessing']=!0x1;['_abortController'];async['enqueue'](_0x5679ae){const _0x2917c6=this['createTask'](_0x5679ae);return this['queue']['push'](_0x2917c6),this['_processQueue'](),_0x2917c6['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(_0x5eceb0=>{this['once']('_queueEmpty',()=>{_0x5eceb0();});}):Promise['resolve']();}async['_processQueue'](){if(!this['isProcessing']){this['_abortController']=new AbortController(),this['isProcessing']=!0x0;try{for(;this['queue']['length']&&this['isProcessing'];){const _0x1e189d=this['queue']['shift']();try{await _0x1e189d['callback'](this['_abortController']['signal']),_0x1e189d['resolve']();}catch(_0x430a44){_0x1e189d['reject'](_0x430a44);}}}finally{this['isProcessing']=!0x1,this['_abortController']=void 0x0;}this['fire']('_queueEmpty');}}['createTask'](_0x202c81){let _0x3bea09,_0x298a7a;const _0x154a47=new Promise((_0x4b62f0,_0x3c4416)=>{_0x3bea09=_0x4b62f0,_0x298a7a=_0x3c4416;});return{'callback':_0x202c81,'resolve':_0x3bea09,'reject':_0x298a7a,'completePromise':_0x154a47};}}class wn extends an{constructor(_0x3c1fcf){super(_0x3c1fcf),this['extendTemplate']({'attributes':{'class':['ck-ai-notification','warning'===_0x3c1fcf['level']?'ck-ai-notification_warning':'ck-ai-notification_error']}});}['render'](){super['render'](),this['setContent'](this['options']['initialContent']),this['markAsDone']();}['setContent'](_0x4a7b1a){this['element']['innerHTML']=_0x4a7b1a;}}const fn=['applySuggestion','insertSuggestion'];class bn extends vt{['_applyChangesButton'];['_insertSuggestionsButton'];['children'];constructor(_0x228f0f,_0x33921f=[...fn],_0x3c5ee7){super(_0x228f0f);const _0xd26b8a=this['bindTemplate'],_0x49e31b=Boolean(_0x3c5ee7);if(this['set']('isEnabled',!_0x49e31b),this['set']('isVisible',!0x1),this['set']('isTrackChangesOn',!0x1),this['children']=this['createCollection'](),_0x49e31b){const _0x10b822=new Nt(_0x228f0f);_0x10b822['set']({'label':hs(_0x228f0f,'AI_SUGGESTION_DISABLED_TOOLTIP_MESSAGE'),'tooltip':!0x0,'withText':!0x1,'icon':_0xc177b6}),_0x10b822['extendTemplate']({'attributes':{'data-cke-tooltip-class':'ck-ai-suggestion-content-part-disabled-actions-tooltip'}});const _0x58ac27=new vt(_0x228f0f);_0x58ac27['setTemplate']({'tag':'div','attributes':{'class':'ck-ai-chat__feed__suggestion__actions__info'},'children':[{'tag':'p','children':[hs(_0x228f0f,'AI_SUGGESTION_DISABLED_FEED_MESSAGE'),_0x10b822]}]}),this['children']['add'](_0x58ac27);}else this['_applyChangesButton']=new Nt(_0x228f0f),this['_applyChangesButton']['set']({'label':hs(_0x228f0f,'AI_CHAT_SUGGESTION_ACTION_APPLY_ALL'),'withText':!0x0,'type':'button','isVisible':_0x33921f['includes']('applySuggestion'),'class':cs}),this['_insertSuggestionsButton']=new Nt(_0x228f0f),this['_insertSuggestionsButton']['set']({'label':hs(_0x228f0f,'AI_CHAT_SUGGESTION_ACTION_SUGGEST_ALL'),'withText':!0x0,'type':'button','isVisible':_0x33921f['includes']('insertSuggestion'),'class':ls}),this['_insertSuggestionsButton']['on']('execute',()=>{this['fire']('insertSuggestion');}),this['_applyChangesButton']['on']('execute',()=>{this['fire']('applySuggestion');}),[this['_applyChangesButton'],this['_insertSuggestionsButton']]['forEach'](_0x12387a=>{_0x12387a['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',_0xd26b8a['if']('isVisible','ck-hidden',_0x16055f=>!_0x16055f)]},'children':this['children']}),this['on']('change:isTrackChangesOn',()=>{this['_applyChangesButton']&&(this['_applyChangesButton']['isVisible']=!this['isTrackChangesOn']);});}['updateVisibility'](_0x5d2ca6){this['isVisible']=_0x5d2ca6;}['_switchButtonLabelsPlurality'](_0x4f3ad5){this['_applyChangesButton']&&this['_insertSuggestionsButton']&&(_0x4f3ad5?(this['_applyChangesButton']['label']=hs(this['locale'],'AI_CHAT_SUGGESTION_ACTION_APPLY_ALL'),this['_insertSuggestionsButton']['label']=hs(this['locale'],'AI_CHAT_SUGGESTION_ACTION_SUGGEST_ALL')):(this['_applyChangesButton']['label']=hs(this['locale'],'AI_CHAT_SUGGESTION_ACTION_APPLY'),this['_insertSuggestionsButton']['label']=hs(this['locale'],'AI_CHAT_SUGGESTION_ACTION_SUGGEST')));}}class Sn extends vt{['children'];['balloonPanelView'];['bodyCollection'];constructor(_0x5344a6,_0x34bb9c){super(_0x5344a6),this['bodyCollection']=_0x34bb9c,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',_0x451ecf=>!_0x451ecf)]},'children':this['children']});const _0x572a3e=new vt(this['locale']),_0x41ddbc=new xt();_0x41ddbc['content']=_0x44f40b,_0x572a3e['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-web-sources__header']},'children':[_0x41ddbc,{'tag':'span','children':[{'text':hs(this['locale'],'AI_CHAT_SOURCES_HEADER')}]}]}),this['children']['add'](_0x572a3e),this['_setupBalloonPanel'](_0x5344a6);}['addSource'](_0x873cfd){this['children']['add'](new Rn(this['locale'],_0x873cfd,this['balloonPanelView']));}['_setupBalloonPanel'](_0x350c8b){this['balloonPanelView']=new Xt(_0x350c8b),this['balloonPanelView']['extendTemplate']({'attributes':{'class':['ck-ai-web-source__tooltip-balloon']}}),this['bodyCollection']['add'](this['balloonPanelView']);}}class Rn extends Nt{['balloonPanelView'];['source'];constructor(_0x58a874,_0x55fc3b,_0x44ad0a){super(_0x58a874),this['source']=_0x55fc3b,this['balloonPanelView']=_0x44ad0a,this['set']({'label':_0x55fc3b['title'],'class':['ck\x20ck-ai-web-source'],'withText':!0x0});const _0x5e0f5a=this['bindTemplate'];if(this['extendTemplate']({'on':{'click':_0x5e0f5a['to'](()=>{window['open'](_0x55fc3b['url'],'_blank');}),'mouseenter':_0x5e0f5a['to'](()=>{this['_showTooltip']();}),'mouseleave':_0x5e0f5a['to'](()=>{this['_hideTooltip']();})}}),_0x55fc3b['favicon']){const _0x3bb57f=new vt(_0x58a874);_0x3bb57f['setTemplate']({'tag':'img','attributes':{'src':_0x55fc3b['favicon']||_0x44f40b,'alt':_0x55fc3b['title'],'class':['ck-ai-web-source__image']}}),this['children']['add'](_0x3bb57f);}else this['set']('icon',_0x44f40b);}['_createTooltipContentView'](_0x4d8976,_0x125092){const _0x48d95c=new vt(_0x4d8976),_0x33b2b8=[];let _0x3c4d5e;_0x125092?.['favicon']?(_0x3c4d5e=new vt(_0x4d8976),_0x3c4d5e['setTemplate']({'tag':'img','attributes':{'src':_0x125092['favicon'],'alt':_0x125092['title'],'class':['ck-ai-web-source__tooltip-image']}})):(_0x3c4d5e=new xt(),_0x3c4d5e['content']=_0x44f40b,_0x3c4d5e['extendTemplate']({'attributes':{'alt':_0x125092['title'],'class':['ck-ai-web-source__tooltip-image']}})),_0x33b2b8['push'](_0x3c4d5e);const _0x315d74=new vt(_0x4d8976);_0x315d74['setTemplate']({'tag':'a','attributes':{'class':['ck-ai-web-source__tooltip-url'],'href':_0x125092['url']},'children':[{'text':new URL(_0x125092['url'])?.['hostname']}]}),_0x33b2b8['push'](_0x315d74);const _0x4cf8b4=new vt(_0x4d8976);_0x4cf8b4['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-web-source__tooltip-row']},'children':_0x33b2b8});const _0x205a75=new vt(_0x4d8976);return _0x205a75['setTemplate']({'tag':'span','attributes':{'class':['ck-ai-web-source__tooltip-row','ck-ai-web-source__tooltip-title']},'children':[{'text':_0x125092['title']['length']>0x190?_0x125092['title']['substring'](0x0,0x190)+'...':_0x125092['title']}]}),_0x48d95c['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-web-source__tooltip']},'children':[_0x4cf8b4,_0x205a75]}),_0x48d95c;}['_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 _0x78880b=this['_createTooltipContentView'](this['locale'],this['source']);this['balloonPanelView']['content']['add'](_0x78880b);}}class On extends vt{['_actionsView'];['_sourcesView'];['_children'];['_skeletonView'];['_showSkeletonDebounced']=_0x58ec4e(()=>{this['_skeletonView']['isVisible']=!0x0,this['_skeletonShownAt']=Date['now']();},0x3e8);['_skeletonShownAt']=null;['_areActionsDisabled'];['_showUnchangedParts'];['_updateContentPartsPromiseQueue'];['_emptyPartsWarningView'];['_availableActions'];['_cachedContentParts']=[];constructor(_0x178b72,_0x4c7603){super(_0x178b72);const {areActionsDisabled:_0x19a614,showUnchangedParts:_0x4a3109,availableActions:_0xba03ec}=_0x4c7603;this['_areActionsDisabled']=_0x19a614,this['_showUnchangedParts']=_0x4a3109,this['_availableActions']=_0xba03ec,this['set']('hasPendingParts',!0x1),this['set']('isTrackChangesOn',!0x1),this['_children']=this['createCollection'](),this['_skeletonView']=new pn(_0x178b72,mn['aiSuggestionBody']),this['_skeletonView']['isVisible']=!0x0,this['_skeletonShownAt']=Date['now'](),this['_children']['add'](this['_skeletonView']),this['_updateContentPartsPromiseQueue']=new Cn(),this['_emptyPartsWarningView']=new wn({'id':'empty-parts-warning','initialContent':hs(_0x178b72,'AI_SUGGESTION_EMPTY_PART_WARNING'),'level':'warning'}),this['_emptyPartsWarningView']['isVisible']=!0x1,this['_actionsView']=new bn(_0x178b72,_0x4c7603['availableActions'],this['_areActionsDisabled']),this['_actionsView']['bind']('isTrackChangesOn')['to'](this),this['_sourcesView']=new Sn(this['locale'],_0x4c7603['bodyCollection']),_0x4c7603['areActionsDisabled']?this['_actionsView']['isEnabled']=!0x1:this['_actionsView']['bind']('isEnabled')['to'](this,'hasPendingParts'),this['_actionsView']['delegate'](...Zs)['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'](_0x32fd2c=>_0x32fd2c instanceof En);}async['updateContentParts']({parts:_0x4846bb,abortSignal:_0x485210,skipLoadingEffects:_0xcc4bd0}){this['_cachedContentParts']['length']?_0x4846bb['forEach'](_0x57834b=>{const _0x1962a0=this['_cachedContentParts']['findIndex'](_0x2c2ed1=>_0x2c2ed1['index']==_0x57834b['index']);-0x1===_0x1962a0?this['_cachedContentParts']['push'](_0x57834b):this['_cachedContentParts'][_0x1962a0]=_0x57834b;}):this['_cachedContentParts']=_0x4846bb;const _0x472de6=this['_showUnchangedParts']?_0x4846bb:_0x4846bb['filter'](_0x4ec56d=>_0x4ec56d['hasChanges']);this['_actionsView']['_switchButtonLabelsPlurality'](_0x472de6['length']>0x1),_0xcc4bd0&&(this['_showSkeletonDebounced']['cancel'](),this['_skeletonView']['isVisible']=!0x1);for(const _0x4b1910 of _0x472de6)this['_updateContentPartsPromiseQueue']['enqueue'](async _0x3e746c=>{let _0x1b6947=this['getPartView'](_0x4b1910['index']);if(!_0x1b6947){if(_0x1b6947=new En(this['locale'],{'part':_0x4b1910,'uiIndex':this['_contentPartViews']['length']+0x1,'areActionsDisabled':this['_areActionsDisabled'],'availableActions':this['_availableActions']}),_0x1b6947['delegate'](...Zs)['to'](this),!_0xcc4bd0&&(this['_showSkeletonDebounced']['cancel'](),await this['_awaitMinimumSkeletonDisplayTime'](_0x3e746c),_0x3e746c['aborted']))return;this['_skeletonView']['isVisible']=!0x1,this['_children']['add'](_0x1b6947,this['_children']['length']-0x1),this['hasPendingParts']=!0x0,_0xcc4bd0||this['_showSkeletonDebounced']();}await _0x1b6947['updateContent']({'part':_0x4b1910,'showUnchangedParts':this['_showUnchangedParts'],'abortSignal':_0x3e746c}),_0x1b6947['markAsDone']();});return _0x485210?.['addEventListener']('abort',()=>{this['_updateContentPartsPromiseQueue']['abort'](),this['_showSkeletonDebounced']['cancel'](),this['_skeletonView']['isVisible']=!0x1;}),this['_updateContentPartsPromiseQueue']['queueEmptyPromise'];}['updatePartState'](_0x62a9e,_0x1ffdcf){const _0x42d111=this['getPartView'](_0x62a9e);_0x42d111&&(_0x42d111['state']=_0x1ffdcf),this['hasPendingParts']='pending'==_0x1ffdcf||this['_contentPartViews']['some'](_0x50135a=>'pending'==_0x50135a['state']);}['setPartActive'](_0x2b43bc,_0x5c97e1){if(!0x1===_0x2b43bc){for(const _0x51c13f of this['_contentPartViews'])_0x51c13f['isActive']=!0x1;}else{const _0x451ff6=this['getPartView'](_0x2b43bc);_0x451ff6&&(_0x451ff6['isActive']=_0x5c97e1);}}['updateSources'](_0x31dda3){_0x31dda3['forEach'](_0x125d20=>this['_sourcesView']['addSource'](_0x125d20)),this['_sourcesView']['isVisible']=!0x0;}['getPartView'](_0x1d182a){return this['_contentPartViews']['find'](_0x506242=>_0x506242['partDefinition']['index']==_0x1d182a)??null;}['markAsDone'](){if(!this['_showUnchangedParts']){const _0x54e502=!this['_cachedContentParts']['find'](({hasChanges:_0x216ef1})=>_0x216ef1),_0x11e6e3=!!this['_cachedContentParts']['find'](({hasChanges:_0x114487})=>!_0x114487);this['_emptyPartsWarningView']['isVisible']=0x0==this['_contentPartViews']['length']||_0x11e6e3,_0x54e502?this['_emptyPartsWarningView']['setContent'](hs(this['locale'],'AI_SUGGESTION_NO_PARTS_WARNING')):this['_emptyPartsWarningView']['setContent'](hs(this['locale'],'AI_SUGGESTION_EMPTY_PART_WARNING'));}this['_contentPartViews']['forEach'](_0x363a3f=>_0x363a3f['markAsDone']()),this['_skeletonView']['isVisible']=!0x1,this['_showSkeletonDebounced']['cancel'](),this['_actionsView']['updateVisibility'](this['hasNonEmptyParts']);}async['_awaitMinimumSkeletonDisplayTime'](_0x1c441d){if(!this['_skeletonView']['isVisible']||null===this['_skeletonShownAt'])return;const _0x2f3582=0x3e8-(Date['now']()-this['_skeletonShownAt']);if(this['_skeletonShownAt']=null,_0x2f3582>0x0){const {promise:_0x4de621,abortController:_0x11c238}=en(_0x2f3582);_0x1c441d?.['addEventListener']('abort',()=>_0x11c238['abort']()),await _0x4de621['catch'](()=>{});}}get['hasNonEmptyParts'](){return this['_contentPartViews']['filter'](_0x5048dd=>_0x5048dd['partDefinition']['hasChanges'])['length']>0x0;}}class kn extends vt{['bodyView'];['children'];['headerView'];constructor(_0x1808eb,_0xd95b81,_0x1c3251){super(_0x1808eb);const {showDiff:_0x3a36a2,areActionsDisabled:_0x2409ba,showUnchangedParts:_0x3c1540,availableActions:_0x431ac2}=_0xd95b81;this['set']('isTrackChangesOn',!0x1),this['set']('areChangesVisible',!0x1),this['children']=this['createCollection'](),this['headerView']=new hn(_0x1808eb,{'showDiff':_0x3a36a2}),this['headerView']['on']('toggleShowChanges',(_0x35f751,_0x27a6ef)=>{this['areChangesVisible']=_0x27a6ef['isOn'],this['fire']('toggleSuggestionDisplayMode',{'showDiff':_0x27a6ef['isOn']});}),this['children']['add'](this['headerView']),this['bodyView']=new On(_0x1808eb,{'areActionsDisabled':_0x2409ba,'showUnchangedParts':!!_0x3c1540,'availableActions':_0x431ac2,'bodyCollection':_0x1c3251}),this['bodyView']['delegate'](...Zs)['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'](_0x377b28){await this['bodyView']['updateContentParts'](_0x377b28);}['updateSources'](_0x25775e){this['bodyView']['updateSources'](_0x25775e);}['markAsDone'](){this['bodyView']['markAsDone'](),this['headerView']&&(this['headerView']['isShowChangesToggleVisible']=this['bodyView']['hasNonEmptyParts']);}}class Nn extends an{['containerView'];constructor(_0x1ac94c,_0x2909e4,_0x2f912c){super(_0x2909e4),this['set']('isTrackChangesOn',!0x1),this['containerView']=new kn(_0x1ac94c,{'showDiff':_0x2909e4['showDiff'],'areActionsDisabled':_0x2909e4['areActionsDisabled'],'availableActions':_0x2909e4['availableActions']},_0x2f912c),this['containerView']['on']('toggleSuggestionDisplayMode',(_0x4f86b9,_0x328063)=>{this['fire']('toggleSuggestionDisplayMode',{'replyId':this['options']['id'],'showDiff':_0x328063['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',(_0x56260c,{index:_0x26215c})=>{this['fire']('showChangeInText',{'replyId':this['options']['id'],'partIndex':_0x26215c});}),this['containerView']['on']('applySuggestion',(_0x449f4d,{index:_0x254ae5}={})=>{this['fire']('applySuggestion',{'replyId':this['options']['id'],'partIndex':_0x254ae5});}),this['containerView']['on']('insertSuggestion',(_0x4e3147,{index:_0x4a2074}={})=>{this['fire']('insertSuggestion',{'replyId':this['options']['id'],'partIndex':_0x4a2074});}),this['containerView']['on']('rejectSuggestion',(_0x470aca,{index:_0x447f09})=>{this['fire']('rejectSuggestion',{'replyId':this['options']['id'],'partIndex':_0x447f09});}),this['containerView']['on']('mouseOverSuggestion',(_0x52c6f0,{index:_0x48db45})=>{this['fire']('mouseOverSuggestion',{'replyId':this['options']['id'],'partIndex':_0x48db45});}),this['containerView']['on']('mouseLeaveSuggestion',(_0x59e1c1,{index:_0x16eba4})=>{this['fire']('mouseLeaveSuggestion',{'replyId':this['options']['id'],'partIndex':_0x16eba4});}),this['children']['addMany']([this['containerView']]),this['extendTemplate']({'attributes':{'class':['ck-ai-chat__feed__ai-suggestion']}});}async['updateContent'](_0x510419){await this['containerView']['updateContent'](_0x510419);}['updatePartState'](_0x4031f8,_0x15eddc){this['containerView']['bodyView']['updatePartState'](_0x4031f8,_0x15eddc);}['setPartActive'](_0x4f299b,_0x54e0e3){!0x1===_0x4f299b?this['containerView']['bodyView']['setPartActive'](!0x1):this['containerView']['bodyView']['setPartActive'](_0x4f299b,_0x54e0e3);}['updateSources'](_0x3cdefc){this['containerView']['updateSources'](_0x3cdefc);}['getPartView'](_0x592314){return this['containerView']['bodyView']['getPartView'](_0x592314);}['markAsDone'](){super['markAsDone'](),this['containerView']['markAsDone']();}}class vn extends an{['replyContainer'];['_bodyCollection'];constructor(_0x108910,_0x464853,_0x2c5ec6){super(_0x464853),this['_bodyCollection']=_0x2c5ec6,this['locale']=_0x108910,this['extendTemplate']({'attributes':{'class':['ck-ai-chat__feed__ai-reply']}}),this['replyContainer']=new vt(),this['replyContainer']['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset_all-excluded','ck-ai-chat__feed__ai-reply-container']}}),this['children']['add'](this['replyContainer']);}async['render'](){super['render'](),this['options']['initialContent']&&(await this['updateContent']({'parsedContent':_s(this['options']['initialContent']),'renderingStrategy':'static'}),this['markAsDone']());}async['updateContent']({parsedContent:_0x1ea4b6,renderingStrategy:_0x5298c4,abortSignal:_0x1881f4}){'streaming'===_0x5298c4?await this['streamIntoElement'](_0x1ea4b6,this['replyContainer']['element'],_0x1881f4):this['replyContainer']['element']['innerHTML']=ti(_0x1ea4b6);}['updateSources'](_0x5109a0){const _0xf0c460=new Sn(this['locale'],this['_bodyCollection']);_0xf0c460['children']['addMany'](_0x5109a0['map'](_0x1df5ce=>new Rn(this['locale'],_0x1df5ce,_0xf0c460['balloonPanelView']))),_0xf0c460['isVisible']=!0x0,this['children']['add'](_0xf0c460);}}class yn extends yt{constructor(_0x4e5582=void 0x0){super();const _0x4ac1bc=_0x4e5582?'ck-ai-spinner_'+_0x4e5582:'';this['extendTemplate']({'tag':'span','attributes':{'class':['ck-ai-spinner',_0x4ac1bc]}});}}const xn={'file':_0x272405,'document':_0x2db615,'web-resource':_0x27df9b,'text':_0x272405,'selection':_0x291a79,'mcp-tool-context':_0x2db615},Ln='ck-ai-chat-context-chip',Dn='ck-ai-chat-context-chip_wide',Pn='ck-ai-chat-context-chip_document',Hn='ck-ai-chat-context-chip__label',Mn='ck-ai-chat-context-chip__type-icon',Un='ck-ai-chat-context-controls__chip-tooltip',Vn='n';class Bn extends Nt{constructor(_0x5b4b3b,_0x2ee688,_0x3f7d56,_0x25ef4c,_0xa8ba8d=!0x1){super(_0x5b4b3b),this['_isAnimationOnEnterEnabled']=_0x25ef4c,this['_initializeProperties'](_0x2ee688,_0x3f7d56,_0xa8ba8d),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'](_0x357ecf,_0x20a20b,_0x31dc72){this['set']('label',_0x357ecf['label']),this['set']('tooltip',!0x0),this['set']('itemType',_0x357ecf['type']),this['set']('id',_0x357ecf['uiId']),this['set']('readonly',_0x20a20b),this['set']('isLoading',_0x31dc72);}['_setupTemplate'](){const _0x4db205=this['_createIconView'](),_0x14fa99=this['_createRemoveButton'](),_0x3bdb09=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':this['_createTemplateAttributes'](_0x3bdb09),'children':this['_createTemplateChildren'](_0x4db205,_0x14fa99,_0x3bdb09)});}['_createTemplateAttributes'](_0x5c1853){return{'class':[Ln,_0x5c1853['if']('itemType',Pn,_0x340aa5=>'document'==_0x340aa5),_0x5c1853['if']('itemType',Dn,_0x416b2a=>'selection'==_0x416b2a)],'data-cke-tooltip-text':_0x5c1853['to']('label',Gn),'data-cke-tooltip-position':Vn,'data-cke-tooltip-class':Un};}['_createTemplateChildren'](_0x3ecebb,_0x45a64e,_0x427584){const _0x4a06df=this['_createLabelElement'](_0x427584),_0x504b78=this['_createLoaderIcon']();return this['readonly']?[_0x3ecebb,_0x4a06df]:[_0x3ecebb,_0x504b78,_0x4a06df,_0x45a64e];}['_createLabelElement'](_0x9de40c){return{'tag':'span','attributes':{'class':Hn},'children':[{'text':_0x9de40c['to']('label')}]};}['_createRemoveButton'](){const _0x45e126=new Nt(this['locale']);return _0x45e126['set']({'label':hs(this['locale'],'AI_CHAT_CONTEXT_REMOVE_FROM_CONTEXT'),'icon':_0x2bfda9}),this['_setupRemoveButtonEvent'](_0x45e126),_0x45e126;}['_setupRemoveButtonEvent'](_0x31a204){_0x31a204['on']('execute',()=>{this['fire']('removeContextItemChip',this['id']);});}['_createIconView'](){const _0x42e09b=this['bindTemplate'],_0xdb3c53=new xt();return _0xdb3c53['content']=xn[this['itemType']],_0xdb3c53['extendTemplate']({'attributes':{'class':[Mn,_0x42e09b['if']('isLoading','ck-hidden',_0x2de23f=>_0x2de23f)]}}),_0xdb3c53;}['_handleAnimationEndOnce'](_0x3d4089,_0x1f5823){if(!_0x3d4089)return;const _0x3e81f3=()=>{_0x1f5823(),_0x3d4089['removeEventListener']('animationend',_0x3e81f3),_0x3d4089['removeEventListener']('webkitAnimationEnd',_0x3e81f3);};_0x3d4089['addEventListener']('animationend',_0x3e81f3),_0x3d4089['addEventListener']('webkitAnimationEnd',_0x3e81f3);}['_createLoaderIcon'](){const _0x9187dc=new yn('small');return _0x9187dc['bind']('isVisible')['to'](this,'isLoading',_0x4cd1a1=>_0x4cd1a1),_0x9187dc;}}function Gn(_0x167ae6){if(!_0x167ae6)return _0x167ae6;if(_0x167ae6['length']<=0x78)return _0x167ae6;const _0x33ae67=_0x167ae6['slice'](0x0,0x78),_0x241ef6=_0x33ae67['lastIndexOf']('\x20');return(_0x241ef6>0x0?_0x33ae67['slice'](0x0,_0x241ef6):_0x33ae67)+'…';}const Fn={'maxVisibleRows':0x2,'rowDetectionTolerance':0x5,'showMoreLabelPrefix':'+\x20','viewportOffset':{'top':0x64,'bottom':0xa}},Kn='300px';class Wn{['_locale'];['_config'];['_visibleChips'];['_overflowChips'];['_showMoreButtonView']=null;['_showMoreBalloonPanelView']=null;['_containerElement']=null;['_bodyCollection'];['_parentView']=null;['_intersectionObserver']=null;['_pendingCalculation']=!0x1;constructor(_0x3edd7d,_0x4023ff,_0x3e9a7b,_0x4ea039,_0x5a3399){this['_locale']=_0x3edd7d,this['_visibleChips']=_0x4023ff,this['_config']={...Fn,..._0x3e9a7b,'cssClasses':{'controlsButton':'','calculationContainer':'ck-calculation-container',..._0x3e9a7b['cssClasses']}},this['_overflowChips']=new dt(),this['_bodyCollection']=_0x4ea039,this['_parentView']=_0x5a3399||null;}['setContainerElement'](_0x4c4d0d){this['_intersectionObserver']&&(this['_intersectionObserver']['disconnect'](),this['_intersectionObserver']=null),this['_containerElement']=_0x4c4d0d,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 _0xa48b21=[...this['_visibleChips'],...this['_overflowChips']],_0x17c236=this['_createCalculationContainer'](),_0x54d44d=this['_calculateOverflowInContainer'](_0x17c236,_0xa48b21),_0x4423ba=_0x17c236['_ancestorsToRestore'];_0x4423ba&&this['_restoreAncestorVisibility'](_0x4423ba),_0x17c236['remove'](),this['_applyOverflowResults'](_0xa48b21,_0x54d44d);}['_createShowMoreButton'](){this['_showMoreButtonView']=this['_createShowMoreButtonView'](),this['_showMoreBalloonPanelView']=this['_createShowMoreBalloonPanelView'](),this['_showMoreButtonView']['render'](),this['_containerElement']['appendChild'](this['_showMoreButtonView']['element']),this['_showMoreButtonView']['on']('execute',()=>{this['_handleShowMoreButtonClick']();}),zt({'emitter':this['_showMoreBalloonPanelView'],'contextElements':[this['_showMoreBalloonPanelView']['element'],this['_showMoreButtonView']['element']],'callback':()=>this['hideBalloonPanel'](),'activator':()=>this['_showMoreButtonView']['isOn']});}['_createShowMoreButtonView'](){const _0x1edd6b=new Nt(this['_locale']);_0x1edd6b['set']({'label':'','withText':!0x0,'isToggleable':!0x0});const _0xac4568=[this['_config']['cssClasses']['showMoreButton']];return this['_config']['cssClasses']['controlsButton']&&_0xac4568['push'](this['_config']['cssClasses']['controlsButton']),_0x1edd6b['extendTemplate']({'attributes':{'class':_0xac4568}}),_0x1edd6b;}['_createShowMoreBalloonPanelView'](){const _0x46ae28=new Xt(this['_locale']);return _0x46ae28['extendTemplate']({'attributes':{'class':this['_config']['cssClasses']['showMoreBalloon']}}),this['_bodyCollection']['add'](_0x46ae28),_0x46ae28;}['_updateBalloonContent'](){if(this['_showMoreBalloonPanelView']&&(this['_showMoreBalloonPanelView']['content']['clear'](),this['_overflowChips']['length']>0x0)){this['_overflowChips']['forEach'](_0x45381d=>{_0x45381d['disableAnimationOnEnter']();});const _0x3a8062=new vt(this['_locale']);_0x3a8062['setTemplate']({'tag':'div','attributes':{'class':this['_config']['cssClasses']['overflowContainer']},'children':this['_overflowChips']}),this['_showMoreBalloonPanelView']['content']['add'](_0x3a8062);}}['_handleShowMoreButtonClick'](){this['_showMoreButtonView']['isOn']?this['hideBalloonPanel']():this['showBalloonPanel']();}['_updateShowMoreButtonVisibility'](){const _0x2c606a=this['_overflowChips']['length']>0x0;this['_showMoreButtonView']?.['element']&&(this['_showMoreButtonView']['element']['style']['display']=_0x2c606a?'':'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'](_0x35276a){const _0x27560a=this['_containerElement']?.['tagName']['toLowerCase']()||'div',_0x3d80be=this['_containerElement']?.['classList'];if(_0x3d80be){const _0x45f522=_0x3d80be[0x0]||'',_0x2188de=_0x35276a['querySelector']('.'+_0x45f522),_0x1a16d3=_0x35276a['querySelector'](_0x27560a);return _0x2188de||_0x1a16d3||_0x35276a;}return _0x35276a['querySelector'](_0x27560a)||_0x35276a;}['_calculateContainerWidth'](){const _0x3d1ba7=this['_parentView']?.['element']||this['_containerElement'];if(!_0x3d1ba7)return Kn;const _0x40f338=window['getComputedStyle'](_0x3d1ba7)['width'];if('auto'===_0x40f338||'0px'===_0x40f338||!_0x40f338){const _0x47f0c8=_0x3d1ba7['parentElement'];if(_0x47f0c8){const _0x496682=window['getComputedStyle'](_0x47f0c8);return'auto'!==_0x496682['width']?_0x496682['width']:Kn;}return Kn;}return _0x40f338;}['_applyCalculationStyles'](_0x276346,_0x531f9d){this['_config']['cssClasses']['calculationContainer']&&_0x276346['classList']['add'](this['_config']['cssClasses']['calculationContainer']),_0x276346['style']['width']=_0x531f9d,_0x276346['style']['position']='absolute',_0x276346['style']['top']='-9999px',_0x276346['style']['left']='-9999px',_0x276346['style']['opacity']='0',_0x276346['style']['pointerEvents']='none',_0x276346['style']['zIndex']='-1',_0x276346['style']['visibility']='visible\x20!important',_0x276346['style']['display']='block\x20!important',_0x276346['style']['boxSizing']='border-box';}['_restoreAncestorVisibility'](_0x4a5dae){_0x4a5dae['forEach'](({element:_0x54e9eb,originalDisplay:_0x3f1647,originalVisibility:_0x51f75d})=>{_0x54e9eb['style']['display']=_0x3f1647,_0x54e9eb['style']['visibility']=_0x51f75d;});}['_makeAncestorsVisible'](_0x17cf1b){const _0x40edca=[];let _0x59d678=_0x17cf1b;for(;_0x59d678&&_0x59d678!==document['body'];){const _0x23706a=window['getComputedStyle'](_0x59d678);'none'!==_0x23706a['display']&&'hidden'!==_0x23706a['visibility']||(_0x40edca['push']({'element':_0x59d678,'originalDisplay':_0x59d678['style']['display'],'originalVisibility':_0x59d678['style']['visibility']}),_0x59d678['style']['display']='block',_0x59d678['style']['visibility']='visible'),_0x59d678=_0x59d678['parentElement'];}return _0x40edca;}['_createContainerElements'](){let _0x386319,_0x1a3bc;return this['_parentView']?.['element']?(_0x386319=this['_parentView']['element']['cloneNode'](!0x0),_0x1a3bc=this['_findTargetContainer'](_0x386319)):(_0x386319=document['createElement']('div'),_0x1a3bc=_0x386319),{'calculationContainer':_0x386319,'targetContainer':_0x1a3bc};}['_createCalculationContainer'](){const {calculationContainer:_0x46121c,targetContainer:_0x3a225a}=this['_createContainerElements'](),_0x97bb2e=this['_calculateContainerWidth']();this['_applyCalculationStyles'](_0x46121c,_0x97bb2e);const _0x44cfb5=this['_parentView']?.['element']||this['_containerElement'],_0x294b02=_0x44cfb5?.['parentElement'];_0x294b02?_0x294b02['appendChild'](_0x46121c):document['body']['appendChild'](_0x46121c),_0x46121c['_targetContainer']=_0x3a225a;const _0x6b8dc4=this['_makeAncestorsVisible'](_0x294b02||null);return _0x46121c['offsetWidth'],_0x46121c['_ancestorsToRestore']=_0x6b8dc4,_0x46121c;}['_calculateOverflowInContainer'](_0x27ac05,_0x53b05e){const _0x28ec1c=_0x27ac05['_targetContainer']||_0x27ac05,_0x2c83f0=[],{rowCount:_0x1150ec}=this['_renderChipsAndCountRows'](_0x28ec1c,_0x53b05e);if(_0x1150ec<=this['_config']['maxVisibleRows'])return _0x2c83f0;const _0x58c801=_0x53b05e['slice']();for(;_0x58c801['length']>0x0;){if(this['_testButtonFit'](_0x27ac05,_0x28ec1c,_0x58c801)){const _0x54e080=_0x53b05e['filter'](_0x314b83=>!_0x58c801['includes'](_0x314b83));_0x2c83f0['push'](..._0x54e080);break;}if(!_0x58c801['pop']())break;}return _0x2c83f0;}['_renderChipsAndCountRows'](_0xf5ea9b,_0x32f37f){_0xf5ea9b['innerHTML']='',_0x32f37f['forEach'](_0x27417e=>{if(_0x27417e['element']){const _0x55f64d=_0x27417e['element']['cloneNode'](!0x0);_0xf5ea9b['appendChild'](_0x55f64d);}}),_0xf5ea9b['offsetWidth'];const _0x4ed9b8=_0xf5ea9b['children'],_0x45738d=[];return Array['from'](_0x4ed9b8)['forEach'](_0x126385=>{const _0x31fc05=_0x126385['getBoundingClientRect']()['top'];_0x45738d['some'](_0x34e9fe=>Math['abs'](_0x34e9fe-_0x31fc05)<this['_config']['rowDetectionTolerance'])||_0x45738d['push'](_0x31fc05);}),{'rowCount':_0x45738d['length']};}['_createMockButton'](){const _0xb17d2e=document['createElement']('button');return _0xb17d2e['className']=this['_config']['cssClasses']['showMoreButton'],this['_config']['cssClasses']['controlsButton']&&_0xb17d2e['classList']['add'](this['_config']['cssClasses']['controlsButton']),_0xb17d2e['textContent']='+\x201',_0xb17d2e;}['_testButtonFit'](_0x3343e1,_0x3023c9,_0x2e855b){this['_renderChipsAndCountRows'](_0x3023c9,_0x2e855b);const _0x4eaeda=this['_createMockButton']();_0x3343e1['appendChild'](_0x4eaeda),_0x3343e1['offsetWidth'];const _0x114f6=[..._0x3023c9['children'],_0x4eaeda],_0x25b1da=[];_0x114f6['forEach'](_0x51a785=>{const _0x5b14b5=_0x51a785['getBoundingClientRect']()['top'];_0x25b1da['some'](_0x2832af=>Math['abs'](_0x2832af-_0x5b14b5)<this['_config']['rowDetectionTolerance'])||_0x25b1da['push'](_0x5b14b5);});const _0x43ccc3=_0x25b1da['length'];return _0x4eaeda['remove'](),_0x43ccc3<=this['_config']['maxVisibleRows'];}['_distributeChips'](_0x558150,_0x3b044d){this['_visibleChips']['clear'](),this['_overflowChips']['clear'](),_0x558150['forEach'](_0x1036a0=>{_0x3b044d['includes'](_0x1036a0)?this['_overflowChips']['add'](_0x1036a0):this['_visibleChips']['add'](_0x1036a0);});}['_updateOverflowUI'](_0x24e907){if(_0x24e907>0x0&&!this['_showMoreButtonView']&&this['_createShowMoreButton'](),_0x24e907>0x0&&this['_showMoreButtonView']){const _0x683309=''+this['_config']['showMoreLabelPrefix']+(_0x24e907<0x63?_0x24e907:'99');this['_showMoreButtonView']['label']=_0x683309;}this['_updateBalloonContent'](),this['_updateShowMoreButtonVisibility'](),this['_repinBalloonPanel']();}['_applyOverflowResults'](_0x38f109,_0x359afe){this['_distributeChips'](_0x38f109,_0x359afe),this['_updateOverflowUI'](_0x359afe['length']);}['_setupVisibilityObserver'](){this['_containerElement']&&'undefined'!=typeof IntersectionObserver&&(this['_intersectionObserver']=new IntersectionObserver(_0x150c04=>{_0x150c04[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 _0x5bd737=this['_containerElement']['getBoundingClientRect']();if(0x0===_0x5bd737['width']||0x0===_0x5bd737['height'])return!0x1;const _0x326be4=window['innerHeight']||document['documentElement']['clientHeight'],_0x430b2f=window['innerWidth']||document['documentElement']['clientWidth'],_0xf129dd=0xc8;return _0x5bd737['bottom']>=-0xc8&&_0x5bd737['top']<=_0x326be4+_0xf129dd&&_0x5bd737['right']>=-0xc8&&_0x5bd737['left']<=_0x430b2f+_0xf129dd;}}const Yn='ck-ai-chat__feed__context-chips',$n='ck-ai-chat-context-chips-wrapper',qn='ck-ai-chat-context-chips-wrapper-balloon',Qn='ck-ai-chat-controls-button',Xn='ck-ai-chat-controls_context_show-more-button',zn='ck-ai-chat-context-controls__show-more-balloon-panel';class jn extends vt{['_contextChips']=this['createCollection']();['_overflowManager'];['_bodyCollection'];constructor(_0x2ba122,_0x287a0b,_0x449e16){super(_0x2ba122),this['_bodyCollection']=_0x449e16,this['_createContextChips'](_0x287a0b);const _0x3e95c2={'cssClasses':{'showMoreButton':Xn+'\x20'+us,'showMoreBalloon':zn,'overflowContainer':qn,'controlsButton':Qn}};this['_overflowManager']=new Wn(_0x2ba122,this['_contextChips'],_0x3e95c2,this['_bodyCollection'],this),this['setTemplate']({'tag':'div','attributes':{'class':[Yn,'ck','ck-reset_all']},'children':[{'tag':'div','attributes':{'class':$n},'children':this['_contextChips']}]});}['render'](){super['render']();const _0x2efd7a=this['element']['querySelector']('.'+$n);_0x2efd7a&&(this['_overflowManager']['setContainerElement'](_0x2efd7a),this['_overflowManager']['reorganizeChips']());}['destroy'](){super['destroy'](),this['_overflowManager']['destroy']();}['_createContextChips'](_0x981af){for(const _0xdb0d2 of _0x981af){const _0x5b4c15=new Bn(this['locale'],_0xdb0d2,!0x0,!0x1);this['_contextChips']['add'](_0x5b4c15);}}}class Jn extends an{['_contextChipsView']=null;['_locale'];['_bodyCollection'];['_messageContentView'];constructor(_0x5bd4df,_0x2cc2b3,_0x27c1c9){super(_0x2cc2b3),this['_locale']=_0x5bd4df,this['_bodyCollection']=_0x27c1c9,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 jn(this['_locale'],this['options']['contextItems']['filter'](_0x565be9=>!_0x565be9['hidden']),this['_bodyCollection']),this['_contextChipsView']['extendTemplate']({'attributes':{'class':'ck-ai-chat__feed__context-chips'}}),this['children']['add'](this['_contextChipsView']));}['_createMessageContentView'](){this['_messageContentView']=new vt(this['_locale']),this['_messageContentView']['setTemplate']({'tag':'div','attributes':{'class':'ck-ai-chat__feed__message-content'}}),this['children']['add'](this['_messageContentView']);}['render'](){super['render'](),this['_messageContentView']['element']['innerHTML']=this['options']['initialContent'],this['markAsDone']();}}class Zn extends an{['capabilities'];constructor(_0x1fcd64,_0x22716a){super(_0x22716a);const {isWebSearchEnabled:_0x45c183,isReasoningEnabled:_0x5ca8c3}=_0x22716a['capabilities'],_0x1fc568=[];let _0x28af2e='';_0x45c183&&_0x5ca8c3?(_0x28af2e=hs(_0x1fcd64,'AI_CHAT_FEED_REPLY_ITEM_USED_WEB_SEARCH_REASONING'),_0x1fc568['push'](tr(_0x44f40b)),_0x1fc568['push'](tr(_0x57f077))):_0x45c183?(_0x28af2e=hs(_0x1fcd64,'AI_CHAT_FEED_REPLY_ITEM_USED_WEB_SEARCH'),_0x1fc568['push'](tr(_0x44f40b))):_0x5ca8c3&&(_0x28af2e=hs(_0x1fcd64,'AI_CHAT_FEED_REPLY_ITEM_USED_REASONING'),_0x1fc568['push'](tr(_0x57f077))),this['extendTemplate']({'attributes':{'class':['ck-ai-chat__feed__interaction-header',_0x28af2e?'':'ck-hidden']}});const _0x56e2da=new vt();_0x56e2da['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed__interaction-header__capabilities']},'children':[..._0x1fc568,{'tag':'span','attributes':{'class':['ck-ai-chat__feed__interaction-header__capabilities__text']},'children':[_0x28af2e]}]}),this['children']['add'](_0x56e2da),this['capabilities']=_0x22716a['capabilities'];}}function tr(_0x163b8){const _0x283b1d=new xt();return _0x283b1d['content']=_0x163b8,_0x283b1d;}const er=['wheel','touchstart','pointerdown','keydown'],ir=['ArrowUp','ArrowDown','PageUp','PageDown','Home','End','\x20'];class sr{['element'];['animationFrameId'];['isRunning'];['abortController'];['isUserPaused'];['scrollBehavior'];constructor(_0x5c2997){this['element']=_0x5c2997,this['animationFrameId']=null,this['isRunning']=!0x1,this['abortController']=new AbortController(),this['isUserPaused']=!0x1,this['scrollBehavior']='smooth';for(const _0x55f324 of er){const _0x1e7c6f='keydown'!==_0x55f324;this['element']['addEventListener'](_0x55f324,this['_onUserEvent']['bind'](this),{'passive':_0x1e7c6f,'signal':this['abortController']['signal']});}}['start']({smooth:_0x530243=!0x0}={}){this['isRunning']||(this['isRunning']=!0x0,this['isUserPaused']=!0x1,this['scrollBehavior']=_0x530243?'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'](_0xfa3eb4){if(this['isRunning']){if('keydown'===_0xfa3eb4['type']){const _0x397119=_0xfa3eb4['key'];if(!ir['includes'](_0x397119))return;}_0xfa3eb4 instanceof WheelEvent?_0xfa3eb4['deltaY']<0x0?this['isUserPaused']=!0x0:this['isUserPaused']=!this['_isAtBottom']():this['isUserPaused']=!0x0;}}['_isAtBottom'](){const {scrollTop:_0x16c980,scrollHeight:_0x548eff,clientHeight:_0x419b32}=this['element'];return _0x548eff-_0x16c980-_0x419b32<=0x5;}['_rafUpdate'](){this['isRunning']&&(this['isUserPaused']||this['element']['scrollTo']({'top':this['element']['scrollHeight'],'behavior':this['scrollBehavior']}),this['animationFrameId']=requestAnimationFrame(this['_rafUpdate']['bind'](this)));}}class nr extends an{constructor(_0x16ad35){super(_0x16ad35),this['extendTemplate']({'attributes':{'class':['ck-ai-chat__feed__custom-element']}});}async['render'](){super['render'](),'string'==typeof this['options']['content']?this['element']['innerHTML']=this['options']['content']:this['element']['appendChild'](this['options']['content']);}}class rr extends vt{['children'];['scrollManager'];['_bodyCollection'];constructor(_0x37f773,_0x2d3eb9){super(_0x37f773),this['_bodyCollection']=_0x2d3eb9,this['set']('loadingMessage',''),this['set']('isLoadingSkeletonVisible',!0x1),this['set']('isTrackChangesOn',!0x1),this['children']=this['createCollection'](),this['children']['delegate'](...tn)['to'](this),this['_setupTemplate']();}['render'](){super['render'](),this['scrollManager']=new sr(this['element']);}['destroy'](){super['destroy'](),this['scrollManager']['destroy']();}['clear'](){this['children']['clear']();}['addItem'](_0x215be9,_0x1d6e10){let _0x3609b8;return'ai-reply'===_0x215be9?_0x3609b8=new vn(this['locale'],_0x1d6e10,this['_bodyCollection']):'ai-suggestion-reply'===_0x215be9?(_0x3609b8=new Nn(this['locale'],_0x1d6e10,this['_bodyCollection']),_0x3609b8['bind']('isTrackChangesOn')['to'](this)):_0x3609b8='user-message'===_0x215be9?new Jn(this['locale'],_0x1d6e10,this['_bodyCollection']):'interaction-header'===_0x215be9?new Zn(this['locale'],_0x1d6e10):'custom-element'===_0x215be9?new nr(_0x1d6e10):new wn(_0x1d6e10),this['children']['add'](_0x3609b8),_0x3609b8;}async['updateReplyItem']({id:_0x5d1cd4,parsedContent:_0x4381fa,renderingStrategy:_0x45f1ab,abortSignal:_0x757b1d}){const _0x33bb30=this['getItemById'](_0x5d1cd4);if(!(_0x33bb30 instanceof vn))throw new at('ai-chat-feed-view-item-not-a-reply-item',null,{'itemView':_0x33bb30,'id':_0x5d1cd4,'parsedContent':_0x4381fa});await _0x33bb30['updateContent']({'parsedContent':_0x4381fa,'renderingStrategy':_0x45f1ab,'abortSignal':_0x757b1d});}async['updateWebSources'](_0x12e827,_0x328940){const _0x56de1a=this['getItemById'](_0x12e827);if(_0x56de1a instanceof Nn)_0x56de1a['updateSources'](_0x328940);else{if(!(_0x56de1a instanceof vn))throw new at('ai-chat-feed-view-item-not-a-suggestion-or-reply-item',null,{'itemView':_0x56de1a,'id':_0x12e827,'sources':_0x328940});_0x56de1a['updateSources'](_0x328940);}}async['updateSuggestionItem']({id:_0x350c13,parts:_0x200ea0,abortSignal:_0xd21ece,skipLoadingEffects:_0x4c9908}){const _0x5d1ad1=this['getItemById'](_0x350c13);if(!(_0x5d1ad1 instanceof Nn))throw new at('ai-chat-feed-view-item-not-a-suggestion-item',null,{'itemView':_0x5d1ad1,'id':_0x350c13,'parts':_0x200ea0});await _0x5d1ad1['updateContent']({'parts':_0x200ea0,'abortSignal':_0xd21ece,'skipLoadingEffects':_0x4c9908});}['updateSuggestionPartState']({id:_0x4415de,index:_0xce203,state:_0x3d340f}){const _0x463527=this['getItemById'](_0x4415de);if(!(_0x463527 instanceof Nn))throw new at('ai-chat-feed-view-item-not-a-suggestion-item',this,{'id':_0x4415de});_0x463527['updatePartState'](_0xce203,_0x3d340f);}['setSuggestionPartActive']({id:_0x55f21c,index:_0x138925,isActive:_0x2b1326}){const _0x3671ce=this['getItemById'](_0x55f21c);if(!(_0x3671ce instanceof Nn))throw new at('ai-chat-feed-view-item-not-a-suggestion-item',this,{'id':_0x55f21c});this['children']['filter'](_0x42cafb=>_0x42cafb instanceof Nn)['forEach'](_0x496aad=>{_0x496aad['setPartActive'](!0x1);}),_0x3671ce['setPartActive'](_0x138925,_0x2b1326);}['markItemAsDone'](_0x1cd7a9){this['getItemById'](_0x1cd7a9)['markAsDone']();}['getItemIds'](){return this['children']['map'](_0x409c2a=>_0x409c2a['options']['id']);}['removeItem'](_0x1e431d){this['children']['remove'](this['getItemById'](_0x1e431d));}['hasItem'](_0x1a8f5d){return!!this['children']['find'](_0x572b95=>_0x572b95['options']['id']['includes'](_0x1a8f5d));}['scrollToSuggestion'](_0x12b0e2,_0x20f754){const _0x375ada=this['getItemById'](_0x12b0e2);if(!(_0x375ada instanceof Nn))return void It('ck-ai-chat-feed-view-scroll-to-suggestion-invalid-item',{'replyId':_0x12b0e2,'partIndex':_0x20f754});const _0x5b407b=_0x375ada['getPartView'](_0x20f754);_0x5b407b?ft(_0x5b407b['element'],0x14,this['element']['parentElement'],!0x0,!0x0):It('ck-ai-chat-feed-view-scroll-to-suggestion-part-view-not-found',{'replyId':_0x12b0e2,'partIndex':_0x20f754});}['_setupTemplate'](){this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed']},'children':this['_createTemplateChildren']()});}['_createTemplateChildren'](){const _0x19f6e4=this['_createSkeletonLoader']();return[this['_createFeedItems'](),_0x19f6e4,this['_createFeedLoader']()];}['_createSkeletonLoader'](){const _0x52e06d=new pn(this['locale'],mn['aiFeed']);return _0x52e06d['bind']('isVisible')['to'](this,'isLoadingSkeletonVisible'),_0x52e06d;}['_createFeedItems'](){const _0x1a5f2b=new vt(this['locale']);return _0x1a5f2b['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed__items',this['bindTemplate']['if']('isLoadingSkeletonVisible','ck-hidden')]},'children':this['children']}),_0x1a5f2b;}['_createFeedLoader'](){const _0x1a45b3=new vt(this['locale']);return _0x1a45b3['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__loader',this['bindTemplate']['if']('loadingMessage','ck-hidden',_0x5b8384=>!_0x5b8384)]},'children':this['_createLoaderChildren']()}),_0x1a45b3;}['_createLoaderChildren'](){const _0x39fc39=new yn();return _0x39fc39['isVisible']=!0x0,[_0x39fc39,{'tag':'span','attributes':{'class':['ck','ck-ai-chat__loader-text']},'children':[{'text':this['bindTemplate']['to']('loadingMessage')}]}];}['getItemById'](_0x43f907){const _0x2a08bc=this['children']['find'](_0x407cd4=>_0x407cd4['options']['id']['includes'](_0x43f907));if(!_0x2a08bc)throw new at('ai-chat-feed-view-item-not-found',this,{'id':_0x43f907});return _0x2a08bc;}['setLoadingMessage'](_0x13e36b){this['set']('loadingMessage',_0x13e36b);}['toggleLoadingSkeleton'](_0x165aa7){this['set']('isLoadingSkeletonVisible',_0x165aa7);}['startAutoScroll'](_0x3b1ed6={}){this['scrollManager']['start'](_0x3b1ed6);}['stopAutoScroll'](){this['scrollManager']['stop']();}}class or extends Dt{['filter'](){let _0x43c87a=0x0;for(const _0x1c817d of this['items'])_0x43c87a+=_0x1c817d['items']['length'];return{'resultsCount':_0x43c87a,'totalItemsCount':_0x43c87a};}}const ar='ck-ai-chat__prompt-input_highlighted';class hr extends Lt{['submitButtonView'];static ['MIN_ROWS']=0x1;static ['MAX_ROWS']=0xc;['_addContextButtonView'];['_queryViewResizeObserver'];constructor(_0x1cb8c0,_0x3a506c){super(_0x1cb8c0,{'queryView':{'label':'','creator':Vt,'showIcon':!0x1,'showResetButton':!0x1},'filteredView':new or(_0x1cb8c0),'queryMinChars':0x1/0x0,'resetOnBlur':!0x1}),this['set']('isEmpty',!0x0),this['set']('isUploadInProgress',!0x1),this['_addContextButtonView']=_0x3a506c,this['_queryViewResizeObserver']=null,this['queryView']['fieldView']['minRows']=hr['MIN_ROWS'],this['queryView']['fieldView']['maxRows']=hr['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',(_0x220c18,_0x2e6b78)=>!_0x220c18&&!_0x2e6b78),this['focusableChildren']['add'](this['submitButtonView']);}['render'](){super['render'](),this['queryView']['fieldWrapperChildren']['add'](this['submitButtonView']),this['keystrokes']['set']('enter',(_0x31779e,_0x338ce5)=>{this['isUploadInProgress']||this['isEmpty']||_0x31779e['target']==this['queryView']['fieldView']['element']&&(this['submit'](),_0x338ce5());}),this['queryView']['fieldView']['on']('update',()=>{this['isEmpty']=''===this['queryView']['fieldView']['element']['value']?.['trim']();});}['destroy'](){super['destroy'](),this['_queryViewResizeObserver']&&this['_queryViewResizeObserver']['destroy']();}['submit'](){const _0x2c7fd6=this['queryView']['fieldView']['element']['value']?.['trim']();if(!_0x2c7fd6)return this['queryView']['errorText']=hs(this['locale'],'AI_CHAT_PROMPT_EMPTY_ERROR'),void(this['queryView']['fieldView']['hasError']=!0x0);this['queryView']['fieldView']['hasError']=!0x1;const _0x20cbb5=_0x34635c(_0x2c7fd6);this['fire']('sendUserMessage',_0x20cbb5),this['queryView']['fieldView']['reset']();}['setPlaceholderText'](_0x11f8dc){this['queryView']['fieldView']['set']('placeholder',_0x11f8dc);}['focus'](_0x363215=!0x1){super['focus'](),_0x363215&&(this['element']['classList']['contains'](ar)||(this['element']['classList']['add'](ar),setTimeout(()=>{this['element']['classList']['remove'](ar);},0x320)));}['_createSubmitButton'](){const _0x414948=new Nt(this['locale']);return _0x414948['set']({'icon':_0x178bba,'label':hs(this['locale'],'AI_CHAT_LABEL_SUBMIT'),'isVisible':!0x0,'tooltip':!0x0,'class':'ck-ai-chat__prompt-submit-button\x20'+cs,'isEnabled':!0x1}),_0x414948['on']('execute',()=>{this['submit']();}),_0x414948;}['setIsUploadInProgress'](_0x2b2ecf){this['isUploadInProgress']=_0x2b2ecf;}['_setUpAddContextButtonPositioning'](){const _0x118e79=this['locale'],_0x46f498=()=>{ct['window']['requestAnimationFrame'](()=>{if(lt(this['element'])){const _0x1af05d=new ut(this['queryView']['fieldView']['element']),_0x5e0ec6=new ut(this['_addContextButtonView']['element']),_0x4e2808=_0x1af05d['width'],_0x5c5478='rtl'===_0x118e79['uiLanguageDirection']?'right':'left';_0x1af05d['excludeScrollbarsAndBorders']();const _0x19f0bc=_0x4e2808-_0x1af05d['width']+0x1;this['_addContextButtonView']['element']['style'][_0x5c5478]='calc('+(_0x4e2808-_0x5e0ec6['width']-_0x19f0bc)+'px\x20-\x20var(--ck-spacing-tiny))';}});};this['queryView']['fieldView']['on']('update',_0x46f498),this['on']('render',()=>{_0x46f498(),this['_queryViewResizeObserver']=new bt(this['queryView']['fieldView']['element'],()=>{_0x46f498();});});}}const cr='ck-ai-chat__prompt-capabilities',lr='ck-ai-chat-controls-button',ur='ck-ai-chat-controls-button--commands',dr='ck-ai-chat-controls__model-selection',_r='ck-ai-chat-controls__model-selection__item-name',gr='ck-ai-chat-controls__model-selection__item-description',Ar='ck-ai-chat-controls__model-selection__item-capabilities',Ir='n';class Er extends vt{['_webSearchButton'];['_reasoningButton'];['_commandsButton'];['_modelSelectionDropdown'];['_modelSelectionDropdownItems'];['_modelNameView'];constructor(_0x4639ff){super(_0x4639ff),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',_0x4120db=>'selector'===_0x4120db),this['_modelSelectionDropdown']['buttonView']['bind']('tooltip')['to'](this,'modelSelectorEnabled',_0x2eef33=>_0x2eef33?this['_modelSelectionDropdown']['buttonView']['label']:hs(this['locale'],'AI_CHAT_MODEL_SELECTOR_DISABLED_TOOLTIP')),this['_modelSelectionDropdown']['bind']('isEnabled')['to'](this,'modelSelectorEnabled',_0x1a0da8=>_0x1a0da8),this['_webSearchButton']['bind']('isOn')['to'](this,'webSearchActive',_0x2f54e6=>_0x2f54e6),this['_webSearchButton']['bind']('tooltip')['to'](this,'webSearchActive',_0x2c2c4d=>hs(this['locale'],_0x2c2c4d?'AI_CHAT_DISABLE_WEB_SEARCH':'AI_CHAT_ENABLE_WEB_SEARCH')),this['_reasoningButton']['bind']('isOn')['to'](this,'reasoningActive',_0x29a567=>_0x29a567),this['_reasoningButton']['bind']('tooltip')['to'](this,'reasoningActive',_0x5363ad=>hs(this['locale'],_0x5363ad?'AI_CHAT_DISABLE_REASONING':'AI_CHAT_ENABLE_REASONING')),this['setTemplate']({'tag':'div','attributes':{'class':[cr]},'children':[this['_modelSelectionDropdown'],this['_modelNameView'],this['_webSearchButton'],this['_reasoningButton'],this['_commandsButton']]}),this['_modelSelectionDropdownItems']=new dt(),jt(this['_modelSelectionDropdown'],this['_modelSelectionDropdownItems']);}['setModelList'](_0x390c63,_0x289b75){if(_0x289b75)this['set']('modelDisplayMode','hidden');else{const _0x25170b=0x1===_0x390c63['length'];this['set']('modelDisplayMode',_0x25170b?'name':'selector');}if(this['_modelSelectionDropdownItems']['clear'](),_0x390c63?.['length'])for(const _0x3ae784 of _0x390c63){const _0x5a5b01=new Jt({'label':_0x3ae784['name'],'withText':!0x0,'role':'menuitemradio','id':_0x3ae784['id'],'model':_0x3ae784});_0x5a5b01['bind']('isOn')['to'](this,'activeModelId',_0x3c0ed8=>_0x3c0ed8===_0x3ae784['id']),this['_modelSelectionDropdownItems']['add']({'type':'button','model':_0x5a5b01,'labelView':new pr(this['locale'],_0x3ae784)});}}['setWebSearch'](_0x3a6896){this['set']('webSearchActive',_0x3a6896);}['setReasoning'](_0x233856){this['set']('reasoningActive',_0x233856);}['setModel'](_0xd76e4b){if(!_0xd76e4b)return;this['activeModelId']=_0xd76e4b['id'],this['activeModelName']=_0xd76e4b['name']||_0xd76e4b['id'],this['_modelSelectionDropdown']['buttonView']['set']('label',_0xd76e4b['name']),this['_modelSelectionDropdown']['buttonView']['set']('tooltip',_0xd76e4b['name']);const _0x43ed1b=_0xd76e4b['capabilities']['webSearch']?.['enabled']??!0x1;this['set']('webSearchActive',!0x1),this['_webSearchButton']['set']('isOn',!0x1),this['_webSearchButton']['set']('isEnabled',_0x43ed1b),this['_webSearchButton']['set']('isVisible',_0x43ed1b);const _0x449eb1=_0xd76e4b['capabilities']['reasoning']?.['enabled']??!0x1;this['set']('reasoningActive',!0x1),this['_reasoningButton']['set']('isOn',!0x1),this['_reasoningButton']['set']('isEnabled',_0x449eb1),this['_reasoningButton']['set']('isVisible',_0x449eb1);}['enableModelSelector'](){this['set']('modelSelectorEnabled',!0x0);}['disableModelSelector'](_0x5f5b4d){this['set']('modelSelectorEnabled',!0x1),_0x5f5b4d&&this['set']('modelDisplayMode','hidden');}['_createWebSearchButton'](){const _0x59ab1f=new Nt();return _0x59ab1f['set']({'label':hs(this['locale'],'AI_CHAT_SEARCH_WEB'),'icon':_0x44f40b,'class':lr+'\x20'+us,'isToggleable':!0x0,'tooltipPosition':Ir}),_0x59ab1f['on']('execute',()=>{this['fire']('toggleWebSearch');}),_0x59ab1f;}['_createReasoningButton'](){const _0x159e07=new Nt();return _0x159e07['set']({'label':hs(this['locale'],'AI_CHAT_REASONING'),'icon':_0x57f077,'class':lr+'\x20'+us,'isToggleable':!0x0,'tooltipPosition':Ir}),_0x159e07['on']('execute',()=>{this['fire']('toggleReasoning');}),_0x159e07;}['_createCommandsButton'](){const _0x436386=new Nt();return _0x436386['set']({'label':hs(this['locale'],'AI_CHAT_COMMANDS'),'icon':_0x256202,'withText':!0x0,'class':lr+'\x20'+us,'isToggleable':!0x0,'tooltip':hs(this['locale'],'AI_CHAT_COMMANDS'),'tooltipPosition':Ir}),_0x436386['extendTemplate']({'attributes':{'class':[ur]}}),_0x436386['on']('execute',()=>{console['log']('Commands\x20are\x20not\x20implemented\x20yet.'),alert('Commands\x20are\x20not\x20implemented\x20yet.');}),_0x436386;}['_createModelSelectionDropdown'](){const _0x270848=Gt(this['locale']);return _0x270848['set']({'panelPosition':'ne','class':[dr]}),_0x270848['buttonView']['set']({'label':hs(this['locale'],'AI_CHAT_MODEL_SELECTOR_ENABLED_TOOLTIP'),'withText':!0x0,'tooltip':!0x0,'tooltipPosition':Ir,'class':us}),this['listenTo'](_0x270848,'execute',_0x2c9a79=>{this['fire']('selectModel',_0x2c9a79['source']['model']);}),_0x270848;}['_createModelNameView'](){const _0x14b591=new mr(this['locale']);return _0x14b591['bind']('text')['to'](this,'activeModelName',_0x2d56fb=>_0x2d56fb??''),_0x14b591['bind']('isVisible')['to'](this,'modelDisplayMode',_0x4e1ea3=>'name'===_0x4e1ea3),_0x14b591;}}let pr=class extends Mt{constructor(_0x439edc,_0x30f6b7){super();const _0x1e6188=this['bindTemplate'],_0x417263=this['createCollection']();this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-button__label'],'style':_0x1e6188['to']('style'),'id':_0x1e6188['to']('id')},'children':[{'tag':'div','attributes':{'class':[_r]},'children':[{'text':_0x1e6188['to']('text')}]},{'tag':'div','attributes':{'class':[gr]},'children':[{'tag':'span','children':[{'text':_0x30f6b7['description']}]}]},{'tag':'div','attributes':{'class':[Ar]},'children':_0x417263}]}),_0x417263['addMany'](this['_getCapabilityParts'](_0x439edc,_0x44f40b,'AI_CHAT_SEARCH_WEB',_0x30f6b7['capabilities']['webSearch']?.['enabled']??!0x1)),_0x417263['addMany'](this['_getCapabilityParts'](_0x439edc,_0x57f077,'AI_CHAT_REASONING',_0x30f6b7['capabilities']['reasoning']?.['enabled']??!0x1));}['_getCapabilityParts'](_0x51e884,_0x1759d1,_0x583cae,_0x5905b0){const _0x1da3ea=new xt();_0x1da3ea['content']=_0x1759d1;const _0x29fc79=new vt(_0x51e884);_0x29fc79['setTemplate']({'tag':'span','children':[{'text':hs(_0x51e884,_0x583cae)+':\x20'}]});const _0x38bbda=new vt(_0x51e884);return _0x38bbda['setTemplate']({'tag':'span','children':[{'text':hs(_0x51e884,_0x5905b0?'AI_CHAT_CAPABILITIES_YES':'AI_CHAT_CAPABILITIES_NO')}]}),[_0x1da3ea,_0x29fc79,_0x38bbda];}},mr=class extends vt{constructor(_0x3c08){super(_0x3c08),this['set']('text',void 0x0),this['set']('isVisible',!0x0);const _0x35bbed=this['bindTemplate'];this['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai-chat-controls__model-name',_0x35bbed['if']('isVisible','ck-hidden',_0x3a6968=>!_0x3a6968)]},'children':[{'text':_0x35bbed['to']('text')}]});}};const Tr='ck-ai-chat-context-controls__url-form',Cr='ck-ai-chat-context-controls__url-input-section';class wr extends vt{['focusTracker'];['keystrokes'];['_focusables'];['focusCycler'];['urlInputField'];['backButton'];['confirmButton'];constructor(_0x4a25b1){super(_0x4a25b1),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 Ut({'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'](_0x2ae842=>{this['focusTracker']['add'](_0x2ae842['element']),this['keystrokes']['listenTo'](_0x2ae842['element']);}),Zt({'view':this}),this['focus']();}['destroy'](){super['destroy'](),this['focusTracker']['destroy'](),this['keystrokes']['destroy']();}['focus'](){this['urlInputField']['focus']();}['getValue'](){return this['urlInputField']['fieldView']['element']?.['value']?.['trim']()||'';}['clear'](){this['urlInputField']['fieldView']['element']['value']='',this['urlInputField']['errorText']=null,this['confirmButton']['isEnabled']=!0x1;}['setError'](_0x179add){this['urlInputField']['errorText']=_0x179add,this['_updateConfirmButtonState'](),this['fire']('refreshBalloon');}['clearError'](){this['urlInputField']['errorText']=null,this['_updateConfirmButtonState']();}['_createBackButton'](){const _0x3a2d2d=new Nt(this['locale']);return _0x3a2d2d['set']({'icon':_0x4021b,'tooltip':hs(this['locale'],'AI_CHAT_CONTEXT_URL_BACK_TO_CONTEXT'),'tooltipPosition':'n','class':['ck-button-icon\x20ck-button-back']}),this['on']('change:withBackButton',(_0x25ab7f,_0x7059ee,_0x55ae76)=>{_0x3a2d2d['set']({'class':['ck-button-icon\x20ck-button-back'+(_0x55ae76?'':'\x20ck-hidden')]});}),_0x3a2d2d;}['_createUrlInputField'](){const _0x3caea2=new te(this['locale'],_0x460e32);return _0x3caea2['set']({'label':hs(this['locale'],'AI_CHAT_CONTEXT_URL_LABEL'),'class':'ck-labeled-field-view_empty'}),_0x3caea2['fieldView']['set']({'placeholder':hs(this['locale'],'AI_CHAT_CONTEXT_URL_PLACEHOLDER')}),_0x3caea2;}['_createConfirmButton'](){const _0x590e1c=new Nt(this['locale']);return _0x590e1c['set']({'icon':_0x463a41,'tooltip':hs(this['locale'],'AI_CHAT_CONTEXT_URL_ADD_URL'),'tooltipPosition':'n','class':'ck-button-icon','type':'submit','isEnabled':!0x1}),_0x590e1c;}['_setupTemplate'](){const _0x20e2f3=new _0x42e1e4(this['locale'],{'label':hs(this['locale'],'AI_CHAT_CONTEXT_URL_ADD_URL'),'class':'ck-ai-header\x20ck-ai-header_small\x20ck-ai-header_context-url'});_0x20e2f3['children']['add'](this['backButton'],0x0),this['setTemplate']({'tag':'form','attributes':{'class':Tr,'tabindex':'-1'},'children':[_0x20e2f3,{'tag':'div','attributes':{'class':Cr},'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',_0x2cef7f=>{_0x2cef7f['stop'](),this['_handleSubmit']();});}['_setupKeystrokes'](){this['keystrokes']['set']('esc',(_0x10b326,_0x218676)=>{this['clear'](),this['fire']('cancel'),_0x218676();});}['_handleSubmit'](){const _0x45ad2f=this['getValue']()['trim']();_0x45ad2f?this['_isValidUrl'](_0x45ad2f)?(this['clearError'](),this['fire']('submitUrl',_0x45ad2f)):this['setError'](hs(this['locale'],'AI_CHAT_CONTEXT_URL_INVALID_ERROR')):this['setError'](hs(this['locale'],'AI_CHAT_CONTEXT_URL_EMPTY_ERROR'));}['_updateConfirmButtonState'](){const _0x3866bb=this['getValue']()['trim'](),_0x46b21a=!!this['urlInputField']['errorText'];this['confirmButton']['isEnabled']=_0x3866bb['length']>0x0&&!_0x46b21a;}['_isValidUrl'](_0x36f26a){try{return!!new URL(_0x36f26a);}catch{return!0x1;}}}const fr='ck-ai-chat-resources__item',br='ck-ai-chat-resources__item--in-context',Sr='ck-ai-chat-resources__item-title',Rr='ck-ai-chat-resources__item__icon';class Or extends Ht{['resource'];['_titleView'];['_iconView'];constructor(_0x50e45c,_0x50583c){super(_0x50e45c),this['resource']=_0x50583c,this['set']('isInContext',!!_0x50583c['isInContext']),this['_titleView']=this['_createTitleView'](),this['_iconView']=this['_createIconView'](),this['_setupTemplate']();}['render'](){super['render']();}['getResourceIcon'](_0x347385){if(_0x347385['isInContext'])return _0x463a41;switch(_0x347385['type']){case'document':return _0x2db615;case'web-resource':return _0x27df9b;case'file':case'text':return _0x272405;default:return _0xb8064;}}['highlightText'](_0x34f24e){if(!_0x34f24e||''===_0x34f24e['trim']())return void this['_titleView']['highlightText'](null);const _0x7a5952=new RegExp(_0x16eb6f(_0x34f24e),'gi');this['_titleView']['highlightText'](_0x7a5952);}['updateResourceState'](_0x885977){this['resource']['isInContext']=_0x885977,this['isInContext']=_0x885977,this['_updateIcon']();}['_createTitleView'](){const _0x124f8e=new _0x21d120();return _0x124f8e['text']=this['resource']['label'],_0x124f8e['extendTemplate']({'tag':'span','attributes':{'class':[Sr]}}),_0x124f8e;}['_createIconView'](){const _0x303b7a=new xt();return _0x303b7a['content']=this['getResourceIcon'](this['resource']),_0x303b7a;}['_setupTemplate'](){const _0x2f45cf=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':[fr,_0x2f45cf['if']('isVisible','ck-hidden',_0x4fa65b=>!_0x4fa65b),_0x2f45cf['if']('isInContext',br)]},'children':[{'tag':'div','attributes':{'class':[Rr]},'children':[this['_iconView']]},this['_titleView']],'on':{'click':_0x2f45cf['to']('execute')}});}['_updateIcon'](){this['_iconView']['content']=this['getResourceIcon'](this['resource']);}}const kr='ck-ai-chat-resources__list';class Nr extends Dt{['_source'];constructor(_0x5e7af0,_0xb6985a){super(_0x5e7af0),this['_source']=_0xb6985a,this['extendTemplate']({'attributes':{'class':[kr]}});}['setResources'](_0x19a2d1,_0x2543bb){this['items']['clear']();let _0x43b286=_0x19a2d1;if(this['_source']['useDefaultFiltering']&&_0x2543bb&&''!==_0x2543bb['trim']()){const _0x424485=new RegExp(_0x2543bb['replace'](/[.*+?^${}()|[\]\\]/g,'\x5c$&'),'gi');_0x43b286=_0x19a2d1['filter'](_0x37044b=>_0x424485['test'](_0x37044b['label']));}for(const _0x3600d1 of _0x43b286){const _0x54d432=new Or(this['locale'],_0x3600d1);_0x54d432['on']('execute',()=>{this['_handleResourceSelection'](this['_source'],_0x3600d1);}),this['items']['add'](_0x54d432);}this['_source']['useDefaultFiltering']&&this['highlightText'](_0x2543bb);}['highlightText'](_0x570146){this['_source']['useDefaultFiltering']&&this['items']['forEach'](_0x53f6ea=>{_0x53f6ea['highlightText'](_0x570146);});}['updateResourceState'](_0x269b26,_0x44aa6f){for(const _0x362695 of this['items']){const _0x4ed0cc=_0x362695;_0x4ed0cc['resource']['id']===_0x269b26&&_0x4ed0cc['updateResourceState'](_0x44aa6f);}}['_handleResourceSelection'](_0x23b489,_0x4bd4da){this['fire']('addResourceToContext',{'source':_0x23b489,'resource':_0x4bd4da});}}class vr extends te{['iconView'];['resetButtonView'];['_viewConfig'];constructor(_0x7664be){const t=_0x7664be['t'],_0x26bd1f={'showResetButton':!0x0,'showIcon':!0x0,'creator':_0x460e32,'label':hs(_0x7664be,'AI_CHAT_SEARCH_RESOURCES')};super(_0x7664be,_0x26bd1f['creator']),this['label']=_0x26bd1f['label'],this['_viewConfig']=_0x26bd1f,this['_viewConfig']['showIcon']&&this['_setupSearchIcon'](),this['_viewConfig']['showResetButton']&&this['_setupResetButton'](_0x7664be,t),this['_setupEventListeners']();}['reset'](){this['fieldView']['reset'](),this['_viewConfig']['showResetButton']&&this['resetButtonView']&&(this['resetButtonView']['isVisible']=!0x1),this['search']('');}['search'](_0x3824f3){this['fire']('search',_0x3824f3);}['getQuery'](){return this['fieldView']['element']?.['value']||'';}['_setupSearchIcon'](){this['iconView']=new xt(),this['iconView']['content']=_0x492b8a,this['fieldWrapperChildren']['add'](this['iconView'],0x0),this['extendTemplate']({'attributes':{'class':'ck-search__query_with-icon'}});}['_setupResetButton'](_0x3e6e1d,t){this['resetButtonView']=new Nt(_0x3e6e1d),this['resetButtonView']['set']({'label':t('Clear'),'icon':_0x2bfda9,'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',_0xf3f7a5=>!_0xf3f7a5),this['fieldWrapperChildren']['add'](this['resetButtonView']),this['extendTemplate']({'attributes':{'class':'ck-search__query_with-reset'}});}['_setupEventListeners'](){this['listenTo'](this['fieldView'],'input',()=>{this['search'](this['fieldView']['element']['value']);}),this['bind']('isEnabled')['to'](this);}}class yr extends vt{['_searchView'];['_searchSection'];['_searchInputVisibleFrom'];['_resourcesListView'];['_skeletonLoader'];['_source'];['children'];['_latestLoadResourcesUid']=null;constructor(_0xef7237,_0x3ee31c){super(_0xef7237),this['_source']=_0x3ee31c['source'],this['_searchInputVisibleFrom']=_0x3ee31c['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 _0x211f24([this['_skeletonLoader'],this['_resourcesListView']]),this['setTemplate']({'tag':'div','attributes':{'class':'ck-ai-chat-resources'},'children':this['children']});}['_createSearchView'](){return new vr(this['locale']);}['_createSearchSection'](){const _0x17a4a9=new vt(this['locale']);return _0x17a4a9['setTemplate']({'tag':'div','attributes':{'class':'ck\x20ck-search'},'children':[this['_searchView']]}),this['_searchView']['on']('search',(_0x45b5d3,_0x4e19d2)=>{this['loadResources'](_0x4e19d2),this['_source']['useDefaultFiltering']&&this['_resourcesListView']['highlightText'](_0x4e19d2);}),_0x17a4a9;}['_createResourcesListView'](){const _0x3407b3=new Nr(this['locale'],this['_source']);return _0x3407b3['delegate']('addResourceToContext')['to'](this),_0x3407b3['extendTemplate']({'attributes':{'class':this['bindTemplate']['if']('isLoading','ck-hidden')}}),_0x3407b3;}['_createSkeletonView'](){const _0x22d20d=new pn(this['locale'],mn['aiChatResources']);return _0x22d20d['bind']('isVisible')['to'](this,'isLoading'),_0x22d20d;}['render'](){super['render'](),this['loadResources']('');}['loadResources'](_0x543e28){const _0x426c95=ot();this['_latestLoadResourcesUid']=_0x426c95,this['fire']('loadSourceResources',{'sourceId':this['_source']['id'],'query':_0x543e28,'uid':_0x426c95}),this['isLoading']=!0x0;}['setResources'](_0x491ecd,_0x3cbf2c){if(_0x3cbf2c&&_0x3cbf2c!==this['_latestLoadResourcesUid'])return;const _0x3b0657=this['_source']['useDefaultFiltering']?this['_searchView']['getQuery']():'';this['_resourcesListView']['setResources'](_0x491ecd,_0x3b0657),_0x491ecd['length']>=this['_searchInputVisibleFrom']&&!this['children']['has'](this['_searchSection'])&&this['children']['add'](this['_searchSection'],0x0),requestAnimationFrame(()=>{this['isLoading']=!0x1;});}['updateResourceState'](_0x58ca60,_0x1885dd){this['_resourcesListView']['updateResourceState'](_0x58ca60,_0x1885dd);}}const xr='ck-ai-chat-context-controls__source-balloon-panel',Lr='ck-button-icon\x20ck-button-back',Dr='ck-ai-header\x20ck-ai-header_small\x20ck-ai-header_source';class Pr{['_sourceResourceBalloons']=new Map();['_bodyCollection'];['_locale'];['_config'];constructor(_0x4e2601,_0x168065,_0xbed1fc){this['_locale']=_0x4e2601,this['_bodyCollection']=_0x168065,this['_config']=_0xbed1fc;}['showSourceResourcesBalloon']({source:_0xabf28,withBackButton:_0x18ba93}){let _0x3dc076=this['_sourceResourceBalloons']['get'](_0xabf28['id']);_0x3dc076||(_0x3dc076=this['_createSourceResourceBalloonPanel'](),this['_sourceResourceBalloons']['set'](_0xabf28['id'],_0x3dc076),this['_setupSingleResourceBalloonClickOutsideHandler'](_0x3dc076)),this['_addSourceResourceContent']({'balloonPanel':_0x3dc076,'source':_0xabf28,'withBackButton':_0x18ba93}),_0x3dc076['show']();const _0xf0d9ab=this['_config']['getTargetElement']();_0xf0d9ab&&_0x3dc076['pin']({'target':_0xf0d9ab,'limiter':this['_config']['getLimiterElement']()});}['populateSourceResourceBalloon'](_0x4aee3d,_0x18ed38,_0x54ef68){const _0x2e903f=this['_sourceResourceBalloons']['get'](_0x4aee3d);if(!_0x2e903f)return;const _0x32b3eb=this['_getResourcesViewFromBalloon'](_0x2e903f);_0x32b3eb&&(_0x32b3eb['setResources'](_0x18ed38,_0x54ef68),_0x32b3eb['once']('change:isLoading',()=>{_0x2e903f['pin']({'target':this['_config']['getTargetElement'](),'limiter':this['_config']['getLimiterElement']()});}));}['closeSourceResourceBalloon'](_0x2838ea){const _0x741d91=this['_sourceResourceBalloons']['get'](_0x2838ea);_0x741d91&&requestAnimationFrame(()=>{_0x741d91['hide'](),this['_sourceResourceBalloons']['delete'](_0x2838ea),this['_config']['onBalloonClosed']();});}['isAnyResourceBalloonVisible'](){for(const _0x6a6dd7 of this['_sourceResourceBalloons']['values']())if(_0x6a6dd7['isVisible'])return!0x0;return!0x1;}['updateResourceState'](_0x20e67e,_0x1fb8aa,_0x21071c){const _0x50e9dc=this['_sourceResourceBalloons']['get'](_0x20e67e);if(!_0x50e9dc||!_0x50e9dc['isVisible'])return;const _0x51d2ff=this['_config']['getTargetElement']();if(!_0x51d2ff)return;_0x50e9dc['pin']({'target':_0x51d2ff,'limiter':this['_config']['getLimiterElement']()});const _0x4ef71b=this['_getResourcesViewFromBalloon'](_0x50e9dc);_0x4ef71b&&_0x4ef71b['updateResourceState'](_0x1fb8aa,_0x21071c);}['destroy'](){for(const _0x50928 of this['_sourceResourceBalloons']['values']())_0x50928['destroy']();this['_sourceResourceBalloons']['clear']();}['_createSourceResourceBalloonPanel'](){const _0x11006c=new Xt(this['_locale']);return _0x11006c['extendTemplate']({'attributes':{'class':xr}}),this['_bodyCollection']['add'](_0x11006c),_0x11006c;}['_addSourceResourceContent']({balloonPanel:_0x300bc1,source:_0x4a329f,withBackButton:_0x55c405}){_0x300bc1['content']['clear']();const _0x4a5c5d=this['_createBalloonHeader']({'balloonPanel':_0x300bc1,'source':_0x4a329f,'withBackButton':_0x55c405});_0x300bc1['content']['add'](_0x4a5c5d);const _0xc1f7c4=this['_createBalloonResourcesView'](_0x4a329f);_0x300bc1['content']['add'](_0xc1f7c4);}['_createBalloonHeader']({balloonPanel:_0x198631,source:_0x314516,withBackButton:_0x4b81fd}){const _0x6cfb8=new _0x42e1e4(this['_locale'],{'label':_0x314516['label'],'class':Dr});return _0x4b81fd&&_0x6cfb8['children']['add'](this['_createBackButton'](_0x198631),0x0),_0x6cfb8;}['_createBackButton'](_0x508289){const _0x2b6df8=new Nt(this['_locale']);return _0x2b6df8['set']({'icon':_0x4021b,'tooltip':hs(this['_locale'],'AI_CHAT_CONTEXT_URL_BACK_TO_CONTEXT'),'tooltipPosition':'n','class':Lr}),_0x2b6df8['on']('execute',()=>{_0x508289['hide'](),this['_config']['onBackToContext']();}),_0x2b6df8;}['_createBalloonResourcesView'](_0xcc916d){const _0x3a7ca3=new yr(this['_locale'],{'source':_0xcc916d,'searchInputVisibleFrom':this['_config']['searchInputVisibleFrom']});return _0x3a7ca3['on']('loadSourceResources',(_0x24adf1,_0x58ac0b)=>{this['_config']['onLoadSourceResources'](_0x58ac0b);}),_0x3a7ca3['on']('addResourceToContext',(_0x1f3094,_0x371e4f)=>{this['_config']['onResourceSelected'](_0x371e4f['source'],_0x371e4f['resource']),this['closeSourceResourceBalloon'](_0xcc916d['id']);}),_0x3a7ca3;}['_getResourcesViewFromBalloon'](_0x4bc8a7){const _0x4260b8=_0x4bc8a7['content']['get'](0x1);return _0x4260b8 instanceof yr?_0x4260b8:null;}['_setupSingleResourceBalloonClickOutsideHandler'](_0xdef51c){zt({'emitter':_0xdef51c,'contextElements':[_0xdef51c['element']],'callback':()=>{_0xdef51c['hide'](),this['_config']['onBalloonClosed']();},'activator':()=>_0xdef51c['isVisible']});}}const Hr=['addDocumentToContext','addFileToContext','addUrlToContext','addResourceToContext','removeContextItem','loadSourceResources','executeCustomItemCallback'],Mr='ck-ai-chat-context-controls',Ur='ck-ai-chat-context-controls__pending-contexts',Vr='ck-ai-chat-context-controls__add-context-balloon-panel',Br='ck-ai-chat-context-controls__add-context-button',Gr='ck-ai-chat-context-controls__url-balloon-panel',Fr='ck-ai-chat-context-controls__balloon-button',Kr='ck-ai-chat-context-controls__balloon-button-source',Wr='ck-ai-chat-controls-button',Yr='ck-ai-chat-context-chips-wrapper-balloon',$r='ck-ai-chat-controls_context_show-more-button',qr='ck-ai-chat-context-controls__show-more-balloon-panel',Qr='ck-ai-chat',Xr=[Xt['defaultPositions']['northArrowSouthWest'],Xt['defaultPositions']['northArrowSouth'],Xt['defaultPositions']['northArrowSouthEast'],Xt['defaultPositions']['southArrowNorthWest'],Xt['defaultPositions']['southArrowNorth'],Xt['defaultPositions']['southArrowNorthEast']];class zr extends vt{['addContextButtonView'];['_currentContextsChips']=this['createCollection']();['_conversationContextsChips']=this['createCollection']();['_overflowManager'];['_addContextBalloonPanelView'];['_urlBalloonPanelView'];['_urlInputView'];['_resourcesBalloonView'];['_addContextBalloonConfig'];['_hasExactlyOneSource']=!0x1;['bodyCollection'];constructor(_0x4700b7,_0x168f3b){super(_0x4700b7),this['bodyCollection']=_0x168f3b['bodyCollection'],this['_currentContextsChips']=this['createCollection'](),this['_conversationContextsChips']=this['createCollection'](),this['addContextButtonView']=this['_createAddContextButtonView'](_0x4700b7),this['_addContextBalloonPanelView']=this['_createAddContextBalloonPanelView'](_0x4700b7),this['_urlBalloonPanelView']=this['_createUrlBalloonPanelView'](_0x4700b7),this['_resourcesBalloonView']=this['_createResourcesBalloonView'](_0x4700b7,_0x168f3b);const _0x6309d6={'cssClasses':{'showMoreButton':$r+'\x20'+us,'showMoreBalloon':qr,'overflowContainer':Yr,'controlsButton':Wr}};this['_overflowManager']=new Wn(_0x4700b7,this['_currentContextsChips'],_0x6309d6,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'](_0x5b5b6e,_0x38816a){const _0x143515=this['_createContextButton'](_0x5b5b6e,'current',!0x0,_0x38816a);this['_addContextToCollection'](_0x143515,this['_currentContextsChips']),this['_overflowManager']['reorganizeChips']();}['removeContextItem'](_0x539d37){this['_removeContextFromCollection'](_0x539d37,this['_currentContextsChips']),this['_removeContextFromCollection'](_0x539d37,this['_overflowManager']['overflowChips']),this['_overflowManager']['reorganizeChips']();}['setContextItemLoading'](_0x4929a0,_0x4fd475){let _0x5adfa3=this['_currentContextsChips']['find'](_0x190cdf=>_0x190cdf['id']===_0x4929a0);_0x5adfa3||(_0x5adfa3=this['_overflowManager']['overflowChips']['find'](_0x405bca=>_0x405bca['id']===_0x4929a0)),_0x5adfa3&&(_0x5adfa3['isLoading']=_0x4fd475);}['setConversationContext'](_0x12546f){this['_conversationContextsChips']['clear']();for(const _0x3ab032 of _0x12546f){const _0x2a851c=this['_createContextButton'](_0x3ab032,'conversation',!0x1,!0x1);this['_addContextToCollection'](_0x2a851c,this['_conversationContextsChips']);}}['clearCurrentContextItems'](){this['_currentContextsChips']['clear'](),this['_overflowManager']['clear']();}['clearConversationContextItems'](){this['_conversationContextsChips']['clear']();}['updateResourceState'](_0x4dcb7c,_0x5ddda3,_0x4923f1){this['_resourcesBalloonView']['updateResourceState'](_0x4dcb7c,_0x5ddda3,_0x4923f1);}['hideAddContextBalloonPanel'](){this['_toggleAddContextBalloon'](!0x1);}['showAddContextBalloonPanel'](){this['_toggleAddContextBalloon'](!0x0);}['hideUrlBalloonPanel'](){this['_urlBalloonPanelView']['hide'](),this['addContextButtonView']['isOn']=!0x1,this['_urlInputView']&&this['_urlInputView']['clear']();}['showUrlBalloonPanel'](){this['_urlBalloonPanelView']['show'](),this['addContextButtonView']['isOn']=!0x0;}['_showSourceResourcesBalloon']({source:_0x10c137,withBackButton:_0x3ce71d}){this['_resourcesBalloonView']['showSourceResourcesBalloon']({'source':_0x10c137,'withBackButton':_0x3ce71d}),this['addContextButtonView']['isOn']=!0x0;}['populateSourceResourceBalloon'](_0x3a204b,_0x48ba09,_0x219c6e,_0x511dc6){this['_resourcesBalloonView']['populateSourceResourceBalloon'](_0x3a204b,_0x219c6e,_0x511dc6);}['closeSourceResourceBalloon'](_0x33a202){this['_resourcesBalloonView']['closeSourceResourceBalloon'](_0x33a202),this['addContextButtonView']['isOn']=!0x1;}['setAddContextOptions'](_0x234600){this['_setBalloonPanelContent'](this['_addContextBalloonPanelView'],this['locale'],_0x234600),this['_setAddContextButtonEnabled'](_0x234600);}['_setAddContextButtonEnabled'](_0x45d2a2){const _0x5b03d7=!_0x45d2a2['document']['isHidden']&&_0x45d2a2['document']['enabled'],_0x2dd433=_0x45d2a2['urls']['enabled'],_0xc7c500=_0x45d2a2['files']['enabled'],_0xbd5baf=_0x45d2a2['sources']['length']>0x0,_0x11a4a8=_0x45d2a2['customItems']&&_0x45d2a2['customItems']['length']>0x0;this['addContextButtonView']['isEnabled']=_0x5b03d7||_0x2dd433||_0xc7c500||_0xbd5baf||_0x11a4a8;}['_setupTemplate'](){this['setTemplate']({'tag':'div','attributes':{'class':[Mr,'ck-reset_all-excluded']},'children':[{'tag':'div','attributes':{'class':Ur},'children':this['_currentContextsChips']}]});}['_bindEventHandlers'](){this['addContextButtonView']['on']('execute',()=>{this['_handleAddContextButtonClick']();});}['_createAddContextButtonView'](_0x5ef286){const _0x549067=new Nt(_0x5ef286);return _0x549067['set']({'label':hs(_0x5ef286,'AI_CHAT_CONTEXT_ADD_CONTEXT'),'class':Wr+'\x20'+Br+'\x20'+us,'icon':_0x2bd0a6,'isToggleable':!0x0,'tooltip':!0x0,'tooltipPosition':'sw'}),_0x549067;}['_createAddContextBalloonPanelView'](_0x5944e3){return this['_createBaseBalloonPanel'](_0x5944e3,Vr);}['_createUrlBalloonPanelView'](_0x3420b5){const _0x1ea6ec=this['_createBaseBalloonPanel'](_0x3420b5,Gr);return this['_addUrlContent'](_0x1ea6ec,_0x3420b5),_0x1ea6ec;}['_createResourcesBalloonView'](_0x12b2dd,_0x5edd3d){const _0x1302c5={'searchInputVisibleFrom':_0x5edd3d['searchInputVisibleFrom'],'onBackToContext':()=>{this['showAddContextBalloonPanel'](),this['_addContextBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':Xr});},'onResourceSelected':(_0x18a41d,_0x3492cc)=>{this['fire']('addResourceToContext',{'source':_0x18a41d,'resource':_0x3492cc});},'onLoadSourceResources':_0x25290d=>{this['fire']('loadSourceResources',_0x25290d);},'onBalloonClosed':()=>{this['addContextButtonView']['isOn']=!0x1;},'getLimiterElement':()=>this['_getLimiterElement'](),'getTargetElement':()=>this['addContextButtonView']['element']};return new Pr(_0x12b2dd,_0x5edd3d['bodyCollection'],_0x1302c5);}['_getLimiterElement'](){return this['element']?.['closest']('.'+Qr)||document['body'];}['_createBaseBalloonPanel'](_0x39838f,_0x53cf15){const _0x49e1df=new Xt(_0x39838f);return _0x49e1df['extendTemplate']({'attributes':{'class':_0x53cf15}}),this['bodyCollection']['add'](_0x49e1df),_0x49e1df;}['_setBalloonPanelContent'](_0x4e8123,_0x1a94a0,_0x3d466b){if(_0x4e8123['content']['clear'](),!_0x3d466b['document']['isHidden']&&_0x3d466b['document']['enabled']){const _0x380848=this['_createBalloonButton'](_0x1a94a0,{'label':hs(_0x1a94a0,'AI_CHAT_CONTEXT_CURRENT_DOCUMENT'),'icon':_0x2db615});_0x380848['on']('execute',()=>{this['fire']('addDocumentToContext'),this['hideAddContextBalloonPanel']();}),_0x4e8123['content']['add'](_0x380848);}if(_0x3d466b['urls']['enabled']){const _0x32da27=this['_createBalloonButton'](_0x1a94a0,{'label':hs(_0x1a94a0,'AI_CHAT_CONTEXT_URL_LABEL'),'icon':_0x27df9b});_0x32da27['on']('execute',()=>{this['hideAddContextBalloonPanel'](),this['showUrlBalloonPanel'](),this['_urlBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':Xr}),this['_urlInputView']['focus']();}),_0x4e8123['content']['add'](_0x32da27);}if(_0x3d466b['files']['enabled']){const _0xbe0608=new _0x4766de(_0x1a94a0);_0xbe0608['set']({'label':hs(_0x1a94a0,'AI_CHAT_CONTEXT_FILE_LABEL'),'icon':_0x33f974,'withText':!0x0,'tooltip':!0x0,'class':Fr,'allowMultipleFiles':!0x0}),_0xbe0608['on']('execute',()=>{this['hideAddContextBalloonPanel']();}),_0xbe0608['on']('done',(_0x5dea06,_0x3523af)=>{this['fire']('addFileToContext',_0x3523af);}),_0xbe0608['tooltip']=!0x0,_0x4e8123['content']['add'](_0xbe0608);}for(const _0x5c6f72 of _0x3d466b['sources']){const _0xb8eb1d=this['_createBalloonButton'](_0x1a94a0,{'label':_0x5c6f72['label'],'icon':_0x5c6f72['icon']||_0xb8064,'type':'source'});_0x4e8123['content']['add'](_0xb8eb1d),_0xb8eb1d['on']('execute',()=>{this['hideAddContextBalloonPanel'](),this['_showSourceResourcesBalloon']({'source':_0x5c6f72,'withBackButton':!this['_hasExactlyOneSource']});});}for(const _0x59cda6 of _0x3d466b['customItems']||[]){const _0x60d780=this['_createBalloonButton'](_0x1a94a0,{'label':_0x59cda6['label'],'icon':_0x59cda6['icon']||_0xb8064,'type':'customItem'});_0x4e8123['content']['add'](_0x60d780),_0x60d780['on']('execute',()=>{this['hideAddContextBalloonPanel'](),this['fire']('executeCustomItemCallback',_0x59cda6);});}this['_hasExactlyOneSource']=0x1===_0x4e8123['content']['length'],this['_urlInputView']['withBackButton']=!this['_hasExactlyOneSource'];}['_addUrlContent'](_0x2c7c5b,_0xd5fa31){this['_urlInputView']=new wr(_0xd5fa31),this['_urlInputView']['on']('submitUrl',(_0x27de80,_0x21e612)=>{this['_handleUrlSubmit'](_0x21e612);}),this['_urlInputView']['on']('cancel',()=>{this['hideUrlBalloonPanel'](),this['_hasExactlyOneSource']||(this['showAddContextBalloonPanel'](),this['_addContextBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':Xr}));}),this['_urlInputView']['on']('refreshBalloon',()=>{this['_urlBalloonPanelView']['isVisible']&&this['_urlBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':Xr});}),_0x2c7c5b['content']['add'](this['_urlInputView']);}['_createBalloonButton'](_0x3ec961,_0x2f21fb){const _0x2da4cc='source'===_0x2f21fb['type']?new jr(_0x3ec961):new Nt(_0x3ec961);return _0x2da4cc['set']({'label':_0x2f21fb['label'],'icon':_0x2f21fb['icon'],'withText':!0x0,'tooltip':!0x0,'tooltipPosition':'sw','class':Fr}),_0x2da4cc;}['_setupAllBalloonClickOutsideHandlers'](){this['_setupAddContextBalloonClickOutsideHandler'](),this['_setupUrlBalloonClickOutsideHandler']();}['_setupUrlBalloonClickOutsideHandler'](){zt({'emitter':this['_urlBalloonPanelView'],'contextElements':[this['_urlBalloonPanelView']['element']],'callback':()=>{this['hideUrlBalloonPanel']();},'activator':()=>this['_urlBalloonPanelView']['isVisible']});}['_toggleAddContextBalloon'](_0x3a79ab){const _0x33cf73=this['_addContextBalloonConfig'];_0x33cf73['buttonView']['isOn']=_0x3a79ab,_0x3a79ab?_0x33cf73['balloonView']['show']():_0x33cf73['balloonView']['hide']();}['_setupAddContextBalloonClickOutsideHandler'](){const {balloonView:_0x118e87,buttonView:_0x10fef5,hideMethod:_0x59a787}=this['_addContextBalloonConfig'];zt({'emitter':_0x118e87,'contextElements':[_0x118e87['element'],_0x10fef5['element']],'callback':()=>{_0x59a787();},'activator':()=>_0x10fef5['isOn']&&!this['_urlBalloonPanelView']['isVisible']&&!this['_resourcesBalloonView']['isAnyResourceBalloonVisible']()});}['_createContextButton'](_0x2aa37f,_0x1ba872,_0xd7f111=!0x1,_0x515ac0=!0x1){const _0x285b23='conversation'===_0x1ba872||!0x0===_0x2aa37f['isReadOnly'],_0x4f3305=new Bn(this['locale'],_0x2aa37f,_0x285b23,_0xd7f111,_0x515ac0);return _0x285b23||_0x4f3305['on']('removeContextItemChip',()=>{this['fire']('removeContextItem',_0x4f3305['id']);}),_0x4f3305;}['_addContextToCollection'](_0x2fb875,_0x129699){_0x129699['add'](_0x2fb875,0x0);}['_removeContextFromCollection'](_0x39b4a1,_0x23516e){const _0x57627d=_0x23516e['find'](_0x3cf2ab=>_0x3cf2ab['id']===_0x39b4a1);_0x57627d&&_0x23516e['remove'](_0x57627d);}['_handleAddContextButtonClick'](){this['addContextButtonView']['isOn']?this['hideAddContextBalloonPanel']():(this['showAddContextBalloonPanel'](),this['_addContextBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':Xr}),this['_hasExactlyOneSource']&&this['_addContextBalloonPanelView']['content']['get'](0x0)?.['fire']('execute'));}['_handleUrlSubmit'](_0x470554){this['_urlInputView']['clear'](),this['hideUrlBalloonPanel'](),this['fire']('addUrlToContext',_0x470554);}}class jr extends Nt{['arrowView'];constructor(_0x50c2dc){super(_0x50c2dc),this['set']({'withText':!0x0,'role':'menuitem'}),this['arrowView']=this['_createArrowView'](),this['extendTemplate']({'attributes':{'class':[Kr]}});}['render'](){super['render'](),this['children']['add'](this['arrowView']);}['_createArrowView'](){const _0x1c3166=new xt();return _0x1c3166['content']=_0x12e82d,_0x1c3166['extendTemplate']({'attributes':{'class':Kr+'__arrow'}}),_0x1c3166;}}class Jr extends vt{['_cancelButtonView'];['_loaderView'];constructor(_0x4c1169){super(_0x4c1169),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 _0x31fee6=new Nt(this['locale']);return _0x31fee6['set']({'label':hs(this['locale'],'AI_CHAT_STOP_GENERATING'),'withText':!0x0,'class':ls+'\x20ck-ai-button-stop-generating','icon':_0x746994}),_0x31fee6['on']('execute',()=>{this['fire']('abortPromptStream');}),_0x31fee6;}['_createLoaderView'](){const _0x3f3648=new vt(this['locale']);return _0x3f3648['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':hs(this['locale'],'AI_CHAT_IS_WRITING')}]}),_0x3f3648;}}class Zr extends vt{['_contextPanelView'];['_promptInputView'];['_promptCapabilitiesView'];['_loaderView'];['_modelUnavailableMessageView'];['_shouldRestorePromptInputFocus'];constructor(_0x422913,_0x1f9874){super(_0x422913),this['_contextPanelView']=this['_createContextPanelView'](_0x422913,{'bodyCollection':_0x1f9874['bodyCollection'],'searchInputVisibleFrom':_0x1f9874['contextResourcesSearchInputVisibleFrom']}),this['_promptInputView']=this['_createPromptInputView'](_0x422913),this['_promptCapabilitiesView']=this['_createPromptCapabilitiesView'](_0x422913),this['_loaderView']=this['_createLoaderView'](_0x422913),this['_modelUnavailableMessageView']=this['_createModelUnavailableMessageView'](_0x422913),this['_shouldRestorePromptInputFocus']=!0x1,this['_promptInputView']['delegate']('sendUserMessage')['to'](this),this['_loaderView']['delegate']('abortPromptStream')['to'](this),this['_promptCapabilitiesView']['delegate']('toggleWebSearch')['to'](this),this['_promptCapabilitiesView']['delegate']('toggleReasoning')['to'](this),this['_promptCapabilitiesView']['delegate']('selectModel')['to'](this),this['_contextPanelView']['delegate'](...Hr)['to'](this),this['set']('isModelAvailable',!0x0),this['set']('isDisabled',!0x1);const _0x4cfa75=this['bindTemplate'];this['setTemplate']({'tag':'form','attributes':{'class':['ck','ck-ai-chat-controls',_0x4cfa75['if']('isDisabled','ck-ai-chat-controls-disabled')]},'children':[{'tag':'div','attributes':{'class':[_0x4cfa75['if']('isLoading','ck-hidden',_0xaf50f=>_0xaf50f||!this['isModelAvailable']),_0x4cfa75['if']('isModelAvailable','ck-hidden',_0x574048=>!_0x574048||this['isLoading'])]},'children':[this['_contextPanelView'],this['_promptInputView'],this['_promptCapabilitiesView']]},{'tag':'div','attributes':{'class':[_0x4cfa75['if']('isLoading','ck-hidden',_0x56d229=>!_0x56d229)]},'children':[this['_loaderView']]},{'tag':'div','attributes':{'class':[_0x4cfa75['if']('isModelAvailable','ck-hidden',_0x4fd55e=>_0x4fd55e)]},'children':[this['_modelUnavailableMessageView']]}]}),zt({'emitter':this['_promptInputView'],'activator':()=>this['isLoading'],'contextElements':()=>[this['element']],'callback':()=>{this['_shouldRestorePromptInputFocus']=!0x1;}}),this['on']('change:isLoading',this['_handlePromptInputFocus'],{'priority':'low'});}['_createContextPanelView'](_0x336c65,_0x574ce8){return new zr(_0x336c65,_0x574ce8);}['_createPromptInputView'](_0xadfeaa){return new hr(_0xadfeaa,this['_contextPanelView']['addContextButtonView']);}['_createPromptCapabilitiesView'](_0x4ebaaa){return new Er(_0x4ebaaa);}['_createLoaderView'](_0x2900a5){return new Jr(_0x2900a5);}['_createModelUnavailableMessageView'](_0x198e8a){const _0x446113=new to(_0x198e8a);return _0x446113['delegate']('startConversation')['to'](this),_0x446113;}['_handlePromptInputFocus'](_0x5d63d6,_0x5e5737,_0x1cb0b3){_0x1cb0b3?this['_shouldRestorePromptInputFocus']=!0x0:this['_shouldRestorePromptInputFocus']&&this['_promptInputView']['focus']();}['addContextItem'](_0x22faa1,_0x280d89){this['_contextPanelView']['addContextItem'](_0x22faa1,_0x280d89);}['removeContextItem'](_0xcbc15b){this['_contextPanelView']['removeContextItem'](_0xcbc15b);}['setContextItemLoading'](_0x3c6f07,_0x2b21bd){this['_contextPanelView']['setContextItemLoading'](_0x3c6f07,_0x2b21bd);}['setIsUploadInProgress'](_0x5ed82e){this['_promptInputView']['setIsUploadInProgress'](_0x5ed82e);}['setConversationContext'](_0x45761a){this['_contextPanelView']['setConversationContext'](_0x45761a);}['clearPendingContextUI'](){this['_contextPanelView']['clearCurrentContextItems']();}['clearConversationContextUI'](){this['_contextPanelView']['clearConversationContextItems']();}['updateResourceState'](_0x17838,_0x4a9643,_0x5aef09){this['_contextPanelView']['updateResourceState'](_0x17838,_0x4a9643,_0x5aef09);}['setWebSearch'](_0x2cae2b){this['_promptCapabilitiesView']['setWebSearch'](_0x2cae2b);}['setReasoning'](_0x2ee380){this['_promptCapabilitiesView']['setReasoning'](_0x2ee380);}['resetMessageInput'](){this['_promptInputView']['reset']();}['setAddContextOptions'](_0x371b95){this['_contextPanelView']['setAddContextOptions'](_0x371b95);}['setInputPlaceholder'](_0x14cb8c){this['_promptInputView']['setPlaceholderText'](_0x14cb8c);}['setModelList'](_0x2e47d4,_0x33b54a){this['_promptCapabilitiesView']['setModelList'](_0x2e47d4,_0x33b54a);}['setModel'](_0x2bb2b8){_0x2bb2b8?(this['isModelAvailable']=!0x0,this['_promptCapabilitiesView']['setModel'](_0x2bb2b8)):this['isModelAvailable']=!0x1;}['enableModelSelector'](){this['_promptCapabilitiesView']['enableModelSelector']();}['disableModelSelector'](_0x226091){this['_promptCapabilitiesView']['disableModelSelector'](_0x226091);}['populateSourceResourceBalloon'](_0x4401b6,_0x433214,_0x264aa5,_0x282860){this['_contextPanelView']['populateSourceResourceBalloon'](_0x4401b6,_0x433214,_0x264aa5,_0x282860);}['closeSourceResourceBalloon'](_0x5f3ed7){this['_contextPanelView']['closeSourceResourceBalloon'](_0x5f3ed7);}['focusPromptInput'](_0x5db3bb=!0x1){this['_promptInputView']['focus'](_0x5db3bb);}['setPromptInputValue'](_0x5f4be2){this['_promptInputView']['queryView']['fieldView']['reset'](),this['_promptInputView']['queryView']['fieldView']['value']=_0x5f4be2;}}class to extends vt{constructor(_0x5d4abc){super(_0x5d4abc);const _0x3cd7c4=new Nt(_0x5d4abc);_0x3cd7c4['set']({'label':hs(this['locale'],'AI_CHAT_MODEL_UNAVAILABLE_MESSAGE_BUTTON'),'withText':!0x0,'class':['ck-ai-chat-controls__start-new-chat-button'],'tooltip':''}),_0x3cd7c4['delegate']('execute')['to'](this,'startConversation'),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat-controls-model-unavailable-message']},'children':[{'tag':'p','children':[{'text':hs(this['locale'],'AI_CHAT_MODEL_UNAVAILABLE_MESSAGE_TEXT')+'\x20'},_0x3cd7c4]}]});}}class eo extends _0x42e1e4{['resizeButton'];constructor(_0x39f39b,_0x43266e){super(_0x39f39b,{'label':_0x43266e['label'],'class':'ck-ai-header\x20'+_0x43266e['class'],'icon':_0x43266e['icon']}),this['set']('isMaximized',!0x1),_0x43266e['content']&&this['children']['add'](_0x43266e['content']),_0x43266e['showResizeButton']&&(this['resizeButton']=ds(_0x39f39b,this),this['children']['add'](this['resizeButton']));}}class io extends vt{constructor(_0x55a929){super(_0x55a929),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-disclaimer']},'children':[{'tag':'p','attributes':{'class':['ck','ck-ai-disclaimer__content']},'children':[{'text':hs(_0x55a929,'AI_DISCLAIMER_TEXT')}]}]});}}function so(_0x3261a9,_0xe15f5d){const _0x2954ea=new Nt(_0x3261a9);return _0x2954ea['set']({'label':hs(_0x3261a9,'AI_CHAT_LABEL_NEW_CHAT'),'withText':!0x0,'icon':_0x18ca3a,'class':'ck-ai-chat__start-conversation\x20'+ls}),_0x2954ea['on']('execute',()=>{_0xe15f5d['fire']('startConversation');}),_0x2954ea;}class no extends vt{['chatHeader'];['chatFeed'];['chatControls'];['chatDisclaimer'];['_bodyCollection'];constructor(_0x17ab38,_0xcbe195){super(_0x17ab38),this['_bodyCollection']=new Qt(_0x17ab38),this['_bodyCollection']['attachToDom']();const _0x267932=so(_0x17ab38,this);this['chatHeader']=new eo(_0x17ab38,{'label':hs(_0x17ab38,'AI_CHAT_HEADING'),'icon':_0x25cace,'class':'ck-ai-header_chat','content':_0x267932,'showResizeButton':_0xcbe195['showResizeButton']}),this['chatHeader']['delegate']('resizeTabs')['to'](this),this['chatFeed']=new rr(_0x17ab38,this['_bodyCollection']),this['chatFeed']['delegate'](...tn)['to'](this),this['chatControls']=new Zr(_0x17ab38,{'bodyCollection':this['_bodyCollection'],'contextResourcesSearchInputVisibleFrom':_0xcbe195['contextResourcesSearchInputVisibleFrom']}),this['chatControls']['delegate'](...tn)['to'](this),this['chatDisclaimer']=new io(_0x17ab38),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset_all','ck-ai-chat','ck-rounded-corners'],'dir':_0x17ab38['uiLanguageDirection']},'children':[this['chatHeader'],this['chatFeed'],this['chatControls'],this['chatDisclaimer']]});}['populateSourceResourceBalloon'](_0x1cf0c4,_0x2f6c2a,_0x16742e,_0x1f48a4){this['chatControls']['populateSourceResourceBalloon'](_0x1cf0c4,_0x2f6c2a,_0x16742e,_0x1f48a4);}['closeSourceResourceBalloon'](_0x55274a){this['chatControls']['closeSourceResourceBalloon'](_0x55274a);}['destroy'](){this['_bodyCollection']['detachFromDom'](),super['destroy']();}}class ro extends _0x2599d1{static get['requires'](){return[os];}['_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(_0x81c178){super(_0x81c178);const _0x160e94=this['context']['plugins']['get']('AITabs');this['set']('isBusy',!0x1),this['_promiseQueue']=new Cn(),this['_view']=new no(this['context']['locale'],{'showResizeButton':_0x160e94['showResizeButton'],'contextResourcesSearchInputVisibleFrom':this['context']['config']['get']('ai.chat.context.searchInputVisibleFrom')}),this['_view']['delegate']('resizeTabs')['to'](_0x160e94),this['_view']['delegate'](...tn)['to'](this),this['_view']['on']('toggleSuggestionDisplayMode',(_0x1a7411,{showDiff:_0x50755e})=>{this['showDiff']=_0x50755e;}),_0x160e94['view']['addTab']({'id':'chat','buttonLabel':hs(this['context']['locale'],'AI_CHAT_HEADING'),'buttonIcon':_0x25cace,'order':0x0,'content':this['_view']}),this['_view']['chatHeader']['bind']('isMaximized')['to'](_0x160e94['view'],'isMaximized',_0x13de3a=>_0x13de3a),this['_view']['chatControls']['bind']('isLoading')['to'](this,'isBusy',_0x3805a7=>_0x3805a7),this['_view']['chatControls']['setInputPlaceholder'](this['_getInputPlaceholder']()),this['bind']('isModelAvailable')['to'](this['_view']['chatControls'],'isModelAvailable');}['destroy'](){super['destroy'](),this['_titleAnimationInterval']&&clearInterval(this['_titleAnimationInterval']);}['createConversation'](_0x519af7){const _0x183bc3=this['context']['config']['get']('ai.chat.welcomeMessage')??hs(this['context']['locale'],'AI_CHAT_WELCOME_MESSAGE');this['_view']['chatFeed']['clear'](),this['_view']['chatControls']['enableModelSelector'](),this['_view']['chatControls']['setModelList'](_0x519af7['availableModels'],!this['context']['config']['get']('ai.models.showModelSelector')),this['addFeedItemStaticMessage']({'id':'conversation-start','staticMessage':_0x183bc3}),this['fire']('conversationCreated');}async['addFeedItemStaticMessage']({id:_0x54105a,staticMessage:_0x40dc10}){return this['_promiseQueue']['enqueue'](async()=>{this['_view']['chatFeed']['addItem']('ai-reply',{'id':_0x54105a,'initialContent':'<p>'+_0x40dc10+'</p>'});});}async['addFeedItemUserMessage'](_0x554d68){const _0x34ba16=_0x554d68['attributes']?.['displayedPrompt']||_0x554d68['userMessage'];return this['_promiseQueue']['enqueue'](async()=>{this['_view']['chatFeed']['addItem']('user-message',{'contextItems':Array['from'](_0x554d68['contextItems']['values']()),'initialContent':'<p>'+_0x34ba16+'</p>','id':_0x554d68['id']});});}async['addFeedItemError']({errorMessage:_0x4c23ea,id:_0x3e0723}){return this['_promiseQueue']['enqueue'](async()=>{this['_view']['chatFeed']['addItem']('error-message',{'initialContent':'<p>'+_0x4c23ea+'</p>','id':_0x3e0723});});}async['addFeedItemAIReply'](_0x1f574b){return this['_promiseQueue']['enqueue'](async()=>{this['_view']['chatFeed']['addItem']('ai-reply',{'id':_0x1f574b['interactionId']+':'+_0x1f574b['id']}),this['clearLoadingMessage']();});}async['addFeedItemAISuggestion'](_0x2887b6){const _0x1cb25f=$s(this['context']);let _0x36f205=_0x1cb25f['config']['get']('ai.availableReplyActions')||[...fn];if(_0x1cb25f['plugins']['has']('TrackChanges')){if(!this['_isTrackChangesCommandValueBound']){this['_isTrackChangesCommandValueBound']=!0x0;const _0x5f085e=_0x1cb25f['commands']['get']('trackChanges');this['_view']['chatFeed']['bind']('isTrackChangesOn')['to'](_0x5f085e,'value');}}else _0x36f205=_0x36f205['filter'](_0x4ebf64=>'insertSuggestion'!=_0x4ebf64);return this['_promiseQueue']['enqueue'](async()=>{this['_view']['chatFeed']['addItem']('ai-suggestion-reply',{'id':_0x2887b6['interactionId']+':'+_0x2887b6['id'],'areActionsDisabled':_0x2887b6['areActionsDisabled'],'showDiff':this['showDiff'],'availableActions':_0x36f205}),this['clearLoadingMessage']();});}async['addFeedInteractionHeader'](_0x4055b3,_0xe5388e){return this['_promiseQueue']['enqueue'](async()=>{const _0x6ab67d=this['_view']['chatFeed']['children']['last'];if(_0x6ab67d instanceof Zn)return this['_view']['chatFeed']['children']['remove'](_0x6ab67d),void this['_view']['chatFeed']['addItem']('interaction-header',{'id':_0x4055b3['id'],'capabilities':{'isWebSearchEnabled':_0x6ab67d['capabilities']['isWebSearchEnabled']||_0xe5388e['isWebSearchEnabled'],'isReasoningEnabled':_0x6ab67d['capabilities']['isReasoningEnabled']||_0xe5388e['isReasoningEnabled']}});this['_view']['chatFeed']['addItem']('interaction-header',{'id':_0x4055b3['id'],'capabilities':_0xe5388e});});}async['addFeedItemCustomElement'](_0x3e9b9d,_0x48a82c){let _0x2d766e;return await this['_promiseQueue']['enqueue'](async()=>{_0x2d766e=this['_view']['chatFeed']['addItem']('custom-element',{'content':_0x3e9b9d,'id':_0x48a82c});}),_0x2d766e;}['removeFeedItem'](_0x228b8e){this['_view']['chatFeed']['removeItem'](_0x228b8e);}['hasFeedItem'](_0x3e3ca6){return this['_view']['chatFeed']['hasItem'](_0x3e3ca6);}['updateFeedInteractionHeader'](_0x4a5633){const _0x3dec62=this['_view']['chatFeed']['children']['find'](_0x1201c3=>_0x1201c3['options']['id']==_0x4a5633['id']&&_0x1201c3 instanceof Zn);_0x3dec62&&_0x3dec62['set']('isVisible',_0x4a5633['isVisible']);}async['updateFeedItemAIReplyContent'](_0x3b99fe){const _0x3a7f77=_0x3b99fe['renderingStrategy']||this['feedItemRenderingStrategy'];return this['_promiseQueue']['enqueue'](async _0x5a079d=>{await this['_view']['chatFeed']['updateReplyItem']({..._0x3b99fe,'abortSignal':_0x5a079d,'renderingStrategy':_0x3a7f77}),_0x3b99fe['isDone']&&this['markFeedItemAsDone'](_0x3b99fe['id']);});}['updateFeedItemAIReplySources'](_0x1da6cb,_0x222ab0){this['_view']['chatFeed']['updateWebSources'](_0x1da6cb,_0x222ab0);}async['updateFeedItemAIReplySuggestionContent'](_0x46d1dc){return this['_promiseQueue']['enqueue'](async _0x5f4b3d=>{await this['_view']['chatFeed']['updateSuggestionItem']({..._0x46d1dc,'abortSignal':_0x5f4b3d}),_0x46d1dc['isDone']&&this['markFeedItemAsDone'](_0x46d1dc['id']);});}['updateFeedItemAIReplySuggestionPartState'](_0x4acd82){this['_view']['chatFeed']['updateSuggestionPartState'](_0x4acd82);}['setFeedItemAIReplySuggestionPartActive'](_0x2ce764){this['_view']['chatFeed']['setSuggestionPartActive'](_0x2ce764);}['markFeedItemAsDone'](_0x3b80c2){this['_view']['chatFeed']['markItemAsDone'](_0x3b80c2);}['removeFeedInteraction'](_0x307738){this['_view']['chatFeed']['getItemIds']()['filter'](_0x4ebe7c=>_0x4ebe7c['startsWith'](_0x307738))['forEach'](_0x30d5c2=>this['_view']['chatFeed']['removeItem'](_0x30d5c2));}['startInteraction'](){const _0x5efa2a=this['prepareLoadingMessage']({'isWebSearchEnabled':!0x1,'isReasoningEnabled':!0x1});this['setLoadingMessage'](_0x5efa2a),this['_view']['chatControls']['disableModelSelector'](!this['context']['config']['get']('ai.models.showModelSelector')),this['isBusy']=!0x0,this['_view']['chatFeed']['startAutoScroll']();}['stopInteraction'](_0x3cc0d5){this['_promiseQueue']['abort'](),this['_view']['chatFeed']['getItemIds']()['filter'](_0x3f65de=>_0x3f65de['startsWith'](_0x3cc0d5['id']))['forEach'](_0x2fc3cf=>this['markFeedItemAsDone'](_0x2fc3cf)),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'](_0x4b6a6d,_0x5995f1){this['_view']['chatControls']['addContextItem'](_0x4b6a6d,_0x5995f1);}['removeContextItem'](_0xc15be1){this['_view']['chatControls']['removeContextItem'](_0xc15be1);}['setContextItemLoading'](_0x3f9879,_0x2e31f3){this['_view']['chatControls']['setContextItemLoading'](_0x3f9879,_0x2e31f3);}['setIsUploadInProgress'](_0xdf6eff){this['_view']['chatControls']['setIsUploadInProgress'](_0xdf6eff);}['setConversationContext'](_0x4e7e3f){this['_view']['chatControls']['setConversationContext'](_0x4e7e3f);}['clearPendingContextUI'](){this['_view']['chatControls']['clearPendingContextUI']();}['clearConversationContextUI'](){this['_view']['chatControls']['clearConversationContextUI']();}['updateResourceState'](_0x716d1,_0x1ac6a4,_0x2ed910){this['_view']['chatControls']['updateResourceState'](_0x716d1,_0x1ac6a4,_0x2ed910);}['resetMessageInput'](){this['_view']['chatControls']['resetMessageInput'](),this['_view']['chatControls']['setInputPlaceholder'](this['_getInputPlaceholder']());}['setAddContextOptions'](_0x5bb299){this['_view']['chatControls']['setAddContextOptions'](_0x5bb299);}['updateCapabilities'](_0x2aabe5){this['_view']['chatControls']['setWebSearch'](_0x2aabe5['isWebSearchEnabled']),this['_view']['chatControls']['setReasoning'](_0x2aabe5['isReasoningEnabled']),this['_view']['chatControls']['setInputPlaceholder'](this['_getInputPlaceholder'](_0x2aabe5));}['setSelectedModel'](_0x3dbf20,_0x406307){this['_view']['chatControls']['setModel'](_0x3dbf20),_0x406307&&this['_view']['chatControls']['disableModelSelector'](!0x1);}['setFeedItemRenderingStrategy'](_0x2fa0b1){this['feedItemRenderingStrategy']=_0x2fa0b1;}['toggleLoadingSkeleton'](_0x3f29f6){this['_view']['chatFeed']['toggleLoadingSkeleton'](_0x3f29f6);}['resetConversationTitle'](){this['setConversationTitle'](hs(this['context']['locale'],'AI_CHAT_HEADING'));}['setConversationTitle'](_0x5ddc23,_0x351448=!0x1){if(_0x351448&&!St()&&_0x5ddc23['length'])return this['_view']['chatHeader']['label']='',void this['_animateConversationTitle'](_0x5ddc23);this['_view']['chatHeader']['label']=_0x5ddc23;}['setLoadingMessage'](_0x396cd4){this['_view']['chatFeed']['setLoadingMessage'](_0x396cd4);}['clearLoadingMessage'](){this['_view']['chatFeed']['setLoadingMessage']('');}['_animateConversationTitle'](_0x522a60){let _0x4f0293=0x0;clearInterval(this['_titleAnimationInterval']),this['_titleAnimationInterval']=setInterval(()=>{this['_view']['chatHeader']['label']=this['_view']['chatHeader']['label']+_0x522a60[_0x4f0293],_0x4f0293++,_0x4f0293===_0x522a60['length']&&clearInterval(this['_titleAnimationInterval']);},0x1e);}['prepareLoadingMessage'](_0xe8ed6){return _0xe8ed6['isWebSearchEnabled']&&_0xe8ed6['isReasoningEnabled']?hs(this['context']['locale'],'AI_CHAT_FEED_LOADING_MESSAGE_WEBSEARCH_REASONING'):_0xe8ed6['isWebSearchEnabled']?hs(this['context']['locale'],'AI_CHAT_FEED_LOADING_MESSAGE_WEBSEARCH'):_0xe8ed6['isReasoningEnabled']?hs(this['context']['locale'],'AI_CHAT_FEED_LOADING_MESSAGE_REASONING'):hs(this['context']['locale'],'AI_CHAT_FEED_LOADING_MESSAGE_REGULAR');}['_getInputPlaceholder'](_0x99419e){return _0x99419e?_0x99419e['isWebSearchEnabled']&&_0x99419e['isReasoningEnabled']?hs(this['context']['locale'],'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_WEBSEARCH_REASONING'):_0x99419e['isWebSearchEnabled']?hs(this['context']['locale'],'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_WEBSEARCH'):_0x99419e['isReasoningEnabled']?hs(this['context']['locale'],'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_REASONING'):hs(this['context']['locale'],'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_REGULAR'):hs(this['context']['locale'],'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_REGULAR');}['populateSourceResourceBalloon'](_0x39d46b,_0x59f513,_0x6a9f31,_0x55fcaf){this['_view']['populateSourceResourceBalloon'](_0x39d46b,_0x59f513,_0x6a9f31,_0x55fcaf);}['closeSourceResourceBalloon'](_0x4ad56d){this['_view']['closeSourceResourceBalloon'](_0x4ad56d);}['setPromptInputValue'](_0xeab9a8){this['_view']['chatControls']['setPromptInputValue'](_0xeab9a8);}['focusPromptInput'](_0x38ce6c=!0x1){this['_view']['chatControls']['focusPromptInput'](_0x38ce6c);}['scrollFeedToSuggestion'](_0x2a9f9e,_0x112fce){this['_view']['chatFeed']['scrollToSuggestion'](_0x2a9f9e,_0x112fce);}['startAutoScroll'](_0x4269f7={}){this['_view']['chatFeed']['startAutoScroll'](_0x4269f7);}['disableControls'](){this['_view']['chatControls']['isDisabled']=!0x0;}['enableControls'](){this['_view']['chatControls']['isDisabled']=!0x1;}}class oo extends Dt{['sections'];constructor(_0x446b10,_0x4402b3){super(_0x446b10),this['sections']=_0x4402b3,this['items']['addMany'](this['sections']),this['extendTemplate']({'attributes':{'class':['ck-ai-chat-history__sections']}});}['filter'](_0x20a305){let _0x2ad3c3=0x0,_0x59e3d3=0x0;for(const _0x41efd5 of this['sections']){const {resultsCount:_0x19a4b4,totalItemsCount:_0x57355e}=_0x41efd5['filter'](_0x20a305);_0x2ad3c3+=_0x19a4b4,_0x59e3d3+=_0x57355e;}return{'resultsCount':_0x2ad3c3,'totalItemsCount':_0x59e3d3};}}class ao extends Ht{['title'];['itemsViews'];['_itemsListView'];constructor(_0x4e2a67,{title:_0x22cbad,items:_0x5d00f6}){super(_0x4e2a67);const _0x18293f=this['bindTemplate'];this['set']('isVisible',!0x0),this['title']=_0x22cbad,this['itemsViews']=_0x5d00f6;const _0x4bd1d6=new vt(_0x4e2a67);_0x4bd1d6['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-chat-history__section-title']},'children':[this['title']]}),this['_itemsListView']=new Dt(_0x4e2a67),this['_itemsListView']['items']['addMany'](this['itemsViews']),this['setTemplate']({'tag':'li','attributes':{'class':['ck-ai-chat-history__section',_0x18293f['if']('isVisible','ck-hidden',_0x4b4794=>!_0x4b4794)]},'children':[_0x4bd1d6,this['_itemsListView']]});}['filter'](_0x2c5cbf){const _0x227b3e=this['itemsViews']['length'];let _0x3e4660=0x0;for(const _0x23c1f2 of this['itemsViews']){if(_0x2c5cbf){const _0x506c95=_0x23c1f2['isMatching'](_0x2c5cbf);_0x23c1f2['isVisible']=!!_0x506c95,_0x23c1f2['highlightText'](_0x2c5cbf);}else _0x23c1f2['isVisible']=!0x0,_0x23c1f2['highlightText'](null);_0x23c1f2['isVisible']&&_0x3e4660++;}return this['isVisible']=_0x3e4660>0x0,{'resultsCount':_0x3e4660,'totalItemsCount':_0x227b3e};}['getItem'](_0x4cdaa2){return this['itemsViews']['find'](_0x50b340=>_0x50b340['id']===_0x4cdaa2);}['removeItem'](_0x2ab76b){const _0x2dcebb=this['itemsViews']['indexOf'](_0x2ab76b);-0x1!==_0x2dcebb&&(this['itemsViews']['splice'](_0x2dcebb,0x1),this['_itemsListView']['items']['remove'](_0x2ab76b));}}class ho extends/* #__PURE__ -- @preserve */
27
- _0x2c8f79(Ht){['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(_0x264ee2,_0xda0447){super(_0x264ee2);const _0x1022c1=this['bindTemplate'];this['set']('isEdit',!0x1),this['set']('isVisible',!0x0),this['set']('pinned',!!_0xda0447['pinned']),this['set']('loadingState',null),this['set']('title',_0xda0447['title']),this['id']=_0xda0447['id'];const {createdAt:_0x465db9,active:_0x407a50=!0x1}=_0xda0447;this['_titleView']=new _0x21d120(),this['_titleView']['bind']('text')['to'](this,'title',t=>_0x34635c(t||'')),this['_titleView']['extendTemplate']({'attributes':{'class':['ck-ai-chat-history__item-title']}});const _0x47e072=this['_createCheckView'](),_0x1834f3=this['_createPinButtonView'](_0x264ee2),_0x4e8baf=this['_createMenuDropdownView'](),_0x1fe6db=this['_createEditInputView'](_0x264ee2),_0x43ec5d=this['_createAcceptEditButtonView'](_0x264ee2,_0x1fe6db),_0x159658=this['_createCancelEditButtonView'](_0x264ee2);this['actions']=this['createCollection'](),this['mainContent']=this['createCollection'](),this['mainContent']['add'](this['_titleView']),this['actions']['add'](_0x1834f3),this['actions']['add'](_0x4e8baf),this['on']('change:isEdit',(_0x5cb5ac,_0x20f239,_0x68e00)=>{this['actions']['clear'](),this['mainContent']['clear'](),_0x68e00?(this['actions']['add'](_0x43ec5d),this['actions']['add'](_0x159658),this['mainContent']['add'](_0x1fe6db),_0x1fe6db['element']['value']=this['title']||'',_0x1fe6db['element']['focus']()):(this['actions']['add'](_0x1834f3),this['actions']['add'](_0x4e8baf),this['mainContent']['add'](this['_titleView']));}),this['setTemplate']({'tag':'li','attributes':{'class':['ck-ai-chat-history__item',_0x407a50?'ck-ai-chat-history__item--active':'',_0x1022c1['if']('isVisible','ck-hidden',_0x47ba0f=>!_0x47ba0f),_0x1022c1['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',_0x1022c1['if']('loadingState','ck-hidden',_0x1b7f8a=>!!_0x1b7f8a)]},'children':_0x407a50?[_0x47e072]:[]},{'tag':'div','attributes':{'class':['ck-ai-loader',_0x1022c1['if']('loadingState','ck-hidden',_0x42d4e4=>!_0x42d4e4)]},'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',_0x1022c1['if']('loadingState','ck-hidden',_0x261931=>!!_0x261931)]},'children':this['mainContent']},{'tag':'div','attributes':{'class':['ck-ai-loader__text',_0x1022c1['if']('loadingState','ck-hidden',_0xe1bd1b=>!_0xe1bd1b)]},'children':[{'text':_0x1022c1['to']('loadingState',_0x15e3ce=>_0x15e3ce?hs(this['locale'],ho['LOADING_LABELS'][_0x15e3ce]):'')}]}]},{'tag':'span','attributes':{'class':['ck-ai-chat-history__item-date']},'children':[_0x465db9]}]},{'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'](_0x12bde4){this['set']('title',_0x12bde4);}['updateLoadingState'](_0x3dd8ad,_0x2f599a){this['set']('loadingState',_0x2f599a?_0x3dd8ad:null);}['_createCheckView'](){const _0x300388=new xt();return _0x300388['set']({'content':_0x463a41}),_0x300388;}['_createPinButtonView'](_0x303a48){const _0x5f1503=new Nt(_0x303a48);return _0x5f1503['set']({'label':hs(_0x303a48,'AI_CHAT_HISTORY_PIN_BUTTON'),'icon':_0x23ff7b,'withText':!0x1,'tooltip':!0x0}),_0x5f1503['bind']('isOn')['to'](this,'pinned'),_0x5f1503['on']('execute',()=>{const _0x4afdd6=!this['pinned'];this['fire']('setConversationPinned',{'id':this['id'],'pinned':_0x4afdd6});}),_0x5f1503;}['_createMenuDropdownView'](){const _0x2ddcb9=Gt(this['locale']),_0x4b99d0=_0x2ddcb9['panelView']['children'];_0x2ddcb9['buttonView']['set']({'label':hs(this['locale'],'AI_CHAT_HISTORY_SHOW_MORE_ITEMS'),'icon':_0x551068}),_0x2ddcb9['panelPosition']='sw';const _0x4a7f72=new Nt(this['locale']);_0x4a7f72['label']=hs(this['locale'],'AI_CHAT_HISTORY_EDIT_NAME'),_0x4a7f72['withText']=!0x0,_0x4a7f72['on']('execute',()=>{this['isEdit']=!0x0;});const _0x24a825=new Nt(this['locale']);_0x24a825['label']=hs(this['locale'],'AI_CHAT_HISTORY_REMOVE'),_0x24a825['withText']=!0x0,_0x24a825['on']('execute',()=>{this['showConfirm'](hs(this['locale'],'AI_CHAT_HISTORY_REMOVE_CONFIRM'),this['element'])['then'](()=>{this['fire']('removeConversation',{'id':this['id']});});});const _0x13bc82=new Dt(this['locale']),_0x17df20=new Ht(this['locale']);_0x17df20['children']['add'](_0x4a7f72);const _0xc036ed=new Ht(this['locale']);return _0xc036ed['children']['add'](_0x24a825),_0x13bc82['items']['addMany']([_0x17df20,_0xc036ed]),_0x4b99d0['add'](_0x13bc82),_0x2ddcb9;}['_createEditInputView'](_0x75a8c1){const _0x2c5594=new _0x4ec22f(_0x75a8c1),_0x16fb4f=_0x2c5594['bindTemplate'];return _0x2c5594['extendTemplate']({'on':{'keydown':_0x16fb4f['to'](_0x277ae9=>{'Enter'==_0x277ae9['key']&&this['_commitEditInputValue'](_0x2c5594);})}}),_0x2c5594;}['_createAcceptEditButtonView'](_0x4305cc,_0x59a9c2){const _0x333516=new Nt(_0x4305cc);return _0x333516['set']({'icon':_0x463a41,'withText':!0x1,'tooltip':hs(_0x4305cc,'AI_CHAT_HISTORY_ACCEPT')}),_0x333516['extendTemplate']({'attributes':{'class':['ck-confirm-view-submit']}}),_0x333516['on']('execute',()=>{this['_commitEditInputValue'](_0x59a9c2);}),_0x333516;}['_commitEditInputValue'](_0x3b84f6){const _0xc6a66c=_0x3b84f6['element']['value']||'';this['isEdit']=!0x1,this['fire']('editConversationTitle',{'id':this['id'],'title':_0xc6a66c});}['_createCancelEditButtonView'](_0x55499e){const _0x5eac75=new Nt(_0x55499e);return _0x5eac75['set']({'icon':_0x2bfda9,'withText':!0x1,'tooltip':hs(_0x55499e,'AI_CHAT_HISTORY_CANCEL')}),_0x5eac75['extendTemplate']({'attributes':{'class':['ck-confirm-view-cancel']}}),_0x5eac75['on']('execute',()=>{this['isEdit']=!0x1,this['fire']('edit:cancel');}),_0x5eac75;}['_createSpinnerView'](){const _0x5125bb=new yn('tiny');return _0x5125bb['isVisible']=!0x0,_0x5125bb;}['isMatching'](_0x55f156){return'string'==typeof this['title']&&this['title']['match'](_0x55f156)?{'title':!0x0}:null;}['highlightText'](_0x380782){this['_titleView']['highlightText'](_0x380782);}}class co extends vt{['headerView'];['searchView'];['mainErrorView'];['skeletonView'];['emptyView'];['sectionsView'];constructor(_0x53d709,_0xd2b388){super(_0x53d709),this['set']('hasItems',!0x1),this['set']('isLoading',!0x0),this['set']('errorMessage',''),this['set']('isSearchViewVisible',!0x1),this['set']('isEmptyViewVisible',!0x1),this['set']('isMainErrorViewVisible',!0x1);const _0x484b6c=so(_0x53d709,this);this['headerView']=new eo(_0x53d709,{'label':hs(_0x53d709,'AI_CHAT_HISTORY_HEADING'),'icon':_0x21b500,'class':'ck-ai-header_history','content':_0x484b6c,'showResizeButton':_0xd2b388}),this['headerView']['delegate']('resizeTabs')['to'](this),this['sectionsView']=new oo(_0x53d709,[]),this['sectionsView']['delegate'](...lo)['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',_0x3d5523=>!_0x3d5523)]}}),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 _0x3e6a5c=new _0x36e65a(this['locale'],{'filteredView':this['sectionsView'],'queryView':{'label':hs(this['locale'],'AI_CHAT_HISTORY_SEARCH_LABEL')},'infoView':{'text':{'notFound':{'primary':_0x471a23=>hs(this['locale'],'AI_CHAT_HISTORY_SEARCH_NOT_FOUND_PRIMARY',_0x471a23),'secondary':hs(this['locale'],'AI_CHAT_HISTORY_SEARCH_NOT_FOUND_SECONDARY')}}}}),_0x4c6b5c=this['_createErrorView']();return _0x4c6b5c['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('errorMessage','ck-hidden',_0x194f43=>!_0x194f43)]}}),_0x3e6a5c['on']('render',()=>{_0x3e6a5c['children']['add'](_0x4c6b5c,0x1);}),_0x3e6a5c['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isSearchViewVisible','ck-hidden',_0x2df479=>!_0x2df479)]}}),_0x3e6a5c;}['_createSkeletonView'](){const _0x4eb21b=new pn(this['locale'],mn['aiHistory']);return _0x4eb21b['bind']('isVisible')['to'](this,'isLoading'),_0x4eb21b;}['_createErrorView'](){const _0x10bb5a=new vt(this['locale']),_0x32683c=new Nt(this['locale']);_0x32683c['set']({'withText':!0x1,'icon':_0x2bfda9,'class':'ck-ai-notification_error__dismiss-button'}),_0x32683c['bind']('isVisible')['to'](this,'hasItems',_0x79a16e=>!!_0x79a16e),_0x32683c['on']('execute',()=>{this['errorMessage']='';});const _0x1f6583=this['bindTemplate'];return _0x10bb5a['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-notification','ck-ai-notification_error']},'children':[{'tag':'p','children':[{'text':_0x1f6583['to']('errorMessage')}]},_0x32683c]}),_0x10bb5a;}['_createEmptyStateView'](){const _0x15fb71=new vt(this['locale']);return _0x15fb71['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-chat-history__empty',this['bindTemplate']['if']('isEmptyViewVisible','ck-hidden',_0x3c4ef9=>!_0x3c4ef9)]},'children':[{'tag':'p','attributes':{'class':['ck-ai-chat-history__empty-message']},'children':[hs(this['locale'],'AI_CHAT_HISTORY_EMPTY_MESSAGE')]}]}),_0x15fb71;}['_createListItemViews'](_0x592f56,_0x2b465a){const _0x1347e5=[];for(const _0x136a22 of _0x592f56){const _0x4736ee=new ho(_0x2b465a,_0x136a22);_0x4736ee['delegate'](...lo)['to'](this),_0x1347e5['push'](_0x4736ee);}return _0x1347e5;}['updateHistoryItemsWithCategories'](_0x4f1237){const _0x5a424a=this['locale']||'en',_0x4dd595=[];for(const _0xd7db8d of _0x4f1237){const _0x120cd0=this['_createListItemViews'](_0xd7db8d['items'],_0x5a424a);_0x4dd595['push'](new ao(_0x5a424a,{'title':_0xd7db8d['title'],'items':_0x120cd0}));}this['sectionsView']['sections']=_0x4dd595,this['sectionsView']['items']['clear'](),this['sectionsView']['items']['addMany'](_0x4dd595),this['hasItems']=_0x4f1237['some'](_0x40150f=>_0x40150f['items']['length']>0x0),this['_refreshSearch']();}['removeHistoryItem'](_0x3280f1){for(const _0x1c2fc3 of this['sectionsView']['sections']){const _0x3c4b5c=_0x1c2fc3['getItem'](_0x3280f1);if(_0x3c4b5c){if(_0x1c2fc3['removeItem'](_0x3c4b5c),0x0===_0x1c2fc3['itemsViews']['length']){const _0x161bbd=this['sectionsView']['sections']['indexOf'](_0x1c2fc3);-0x1!==_0x161bbd&&(this['sectionsView']['sections']['splice'](_0x161bbd,0x1),this['sectionsView']['items']['remove'](_0x1c2fc3));}this['hasItems']=this['sectionsView']['sections']['length']>0x0,this['_refreshSearch']();break;}}}['updateItemTitle'](_0x73c30e,_0x4fee4a){for(const _0x5c0fea of this['sectionsView']['sections']){const _0x494fa3=_0x5c0fea['getItem'](_0x73c30e);if(_0x494fa3){_0x494fa3['updateTitle'](_0x4fee4a);break;}}}['updateItemLoadingState'](_0x2b6855,_0x741f97,_0x15b13b){for(const _0x1b27b7 of this['sectionsView']['sections']){const _0x2ee260=_0x1b27b7['getItem'](_0x2b6855);if(_0x2ee260){_0x2ee260['updateLoadingState'](_0x741f97,_0x15b13b);break;}}}['_refreshSearch'](){if(this['hasItems']){const _0x5dcb99=this['searchView']['queryView']['fieldView']?.['element']?.['value']||'';this['searchView']['search'](_0x5dcb99);}}}const lo=['showConversationHistory','removeConversation','editConversationTitle','setConversationPinned','selectConversation','startConversation'];class uo extends _0x2599d1{static get['requires'](){return[os];}['_historyView'];static get['pluginName'](){return'AIChatHistoryUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x5f2067){super(_0x5f2067);const _0x15f5d2=this['context']['plugins']['get']('AITabs');this['_historyView']=new co(this['context']['locale'],_0x15f5d2['showResizeButton']),this['_historyView']['delegate']('resizeTabs')['to'](_0x15f5d2),this['_historyView']['delegate'](...lo)['to'](this),this['_historyView']['headerView']['bind']('isMaximized')['to'](_0x15f5d2['view'],'isMaximized',_0x552573=>_0x552573),_0x15f5d2['view']['addTab']({'id':'history','buttonLabel':hs(this['context']['locale'],'AI_CHAT_HISTORY_HEADING'),'buttonIcon':_0x21b500,'order':0x0,'content':this['_historyView']});}['removeHistoryItem'](_0x3df496){this['_historyView']['removeHistoryItem'](_0x3df496);}['updateItems'](_0x4d3f80){this['_historyView']['updateHistoryItemsWithCategories'](_0x4d3f80);}['updateItemTitle'](_0x557b57,_0x311ac2){this['_historyView']['updateItemTitle'](_0x557b57,_0x311ac2);}['updateItemLoadingState'](_0xc7f459,_0x20b6ec,_0x435790){this['_historyView']['updateItemLoadingState'](_0xc7f459,_0x20b6ec,_0x435790);}['setLoadingSkeleton'](_0x280f24){this['_historyView']['isLoading']=_0x280f24;}['showError'](_0x9eb4e1){this['_historyView']['errorMessage']=_0x9eb4e1;}['hideError'](){this['_historyView']['errorMessage']='';}}class _o extends ht(){['id'];['createdAt'];constructor({id:_0x48b3ab,title:_0x4f5987,createdAt:_0x2ca8c2,updatedAt:_0x130b42,pinned:_0x36f234}){super(),this['id']=_0x48b3ab,this['createdAt']=new Date(_0x2ca8c2),this['set']('title',_0x4f5987),this['set']('updatedAt',_0x130b42?new Date(_0x130b42):null),this['set']('pinned',_0x36f234||!0x1);}['updateTitle'](_0x425796){this['set']('title',_0x425796),this['updatedAt']=new Date();}['updatePinned'](_0x57bb38){this['set']('pinned',_0x57bb38),this['updatedAt']=new Date();}}class go extends Tt(){['items']=[];['connector'];['group'];constructor({connector:_0x51202e,group:_0xd80d3}){super(),this['connector']=_0x51202e,this['group']=_0xd80d3;}async['init'](){try{const _0x24620d=this['connector']['fetchConversations'](this['group']),_0x5357df=await _0x24620d['getConversations']();this['loadItems'](_0x5357df);}catch(_0x29faa3){this['fire']('error',{'error':_0x29faa3,'operation':'init'});}}['addItem'](_0x52ed22){this['items']['push'](_0x52ed22);}async['removeItem'](_0x5954df){const _0x23f243=this['items']['findIndex'](_0x3e1a42=>_0x3e1a42['id']===_0x5954df);if(-0x1===_0x23f243)return!0x1;try{return await this['connector']['deleteConversation'](_0x5954df)['execute'](),this['items']['splice'](_0x23f243,0x1),this['fire']('itemRemoved',{'itemId':_0x5954df}),!0x0;}catch(_0x4b03eb){return this['fire']('error',{'error':_0x4b03eb,'operation':'removeItem','itemId':_0x5954df}),!0x1;}}['getItem'](_0x31c27a){return this['items']['find'](_0x489206=>_0x489206['id']===_0x31c27a);}async['updateItemTitle'](_0x43fd0a,_0x35f5e7){const _0x2ebf3d=this['getItem'](_0x43fd0a);if(!_0x2ebf3d)return!0x1;try{return await this['connector']['updateConversation'](_0x43fd0a,{'title':_0x35f5e7})['getResult'](),_0x2ebf3d['updateTitle'](_0x35f5e7),this['fire']('itemUpdated',{'itemId':_0x43fd0a,'updates':{'title':_0x35f5e7}}),!0x0;}catch(_0x3002ef){return this['fire']('error',{'error':_0x3002ef,'operation':'updateItemTitle','itemId':_0x43fd0a}),!0x1;}}async['updateItemPinned'](_0x5ee7d0,_0x23251e){const _0x466184=this['getItem'](_0x5ee7d0);if(!_0x466184)return!0x1;try{return await this['connector']['updateConversation'](_0x5ee7d0,{'pinned':_0x23251e})['getResult'](),_0x466184['updatePinned'](_0x23251e),this['fire']('itemUpdated',{'itemId':_0x5ee7d0,'updates':{'pinned':_0x23251e}}),!0x0;}catch(_0x38ac76){return this['fire']('error',{'error':_0x38ac76,'operation':'updateItemPinned','itemId':_0x5ee7d0}),!0x1;}}['loadItems'](_0x1e975a){try{this['items']=[],_0x1e975a['map'](_0xf49e28=>{this['addItem'](new _o(_0xf49e28));}),this['fire']('itemsLoaded',{'items':[...this['items']]});}catch(_0x460724){this['fire']('error',{'error':_0x460724,'operation':'loadItems'});}}['getItems'](_0x6a44df={}){const _0x13c518=void 0x0!==_0x6a44df['pinned']&&_0x6a44df['pinned'],_0x498b9d=_0x6a44df['from']?new Date(_0x6a44df['from']['getFullYear'](),_0x6a44df['from']['getMonth'](),_0x6a44df['from']['getDate']()):null,_0x18f9ae=_0x6a44df['to']?new Date(_0x6a44df['to']['getFullYear'](),_0x6a44df['to']['getMonth'](),_0x6a44df['to']['getDate']()):null;return this['items']['filter'](_0x54cc9a=>{if(_0x54cc9a['pinned']!==_0x13c518)return!0x1;if(_0x18f9ae){const _0x4ab1d7=new Date(_0x54cc9a['createdAt']['getFullYear'](),_0x54cc9a['createdAt']['getMonth'](),_0x54cc9a['createdAt']['getDate']());return _0x498b9d?_0x498b9d['getTime']()===_0x18f9ae['getTime']()?_0x4ab1d7['getTime']()===_0x498b9d['getTime']():_0x4ab1d7<_0x18f9ae&&_0x4ab1d7>=_0x498b9d:_0x4ab1d7<_0x18f9ae;}return!0x0;});}}class Ao extends _0x2599d1{['_aiConnector'];['_aiChatHistoryUi'];['_aiChatController'];static get['requires'](){return[as,Xs,uo,os];}static get['pluginName'](){return'AIChatHistoryController';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){this['_aiConnector']=this['context']['plugins']['get'](as),this['_aiChatHistoryUi']=this['context']['plugins']['get'](uo),this['_aiChatController']=this['context']['plugins']['get'](Xs);const _0x1c779e=this['context']['plugins']['get'](os);try{const _0x1e9b0a=this['_aiChatController']['getGroupId']();this['history']=new go({'connector':this['_aiConnector'],'group':_0x1e9b0a}),this['listenTo'](this['_aiChatHistoryUi'],'removeConversation',(_0x7b8830,_0x1588c7)=>{this['_setItemLoading'](_0x1588c7['id'],'remove'),this['_handleRemove'](_0x1588c7['id']);}),this['listenTo'](this['_aiChatHistoryUi'],'editConversationTitle',(_0x3aaffb,_0x4670a9)=>{this['_setItemLoading'](_0x4670a9['id'],'rename'),this['_handleEditTitle'](_0x4670a9['id'],_0x4670a9['title']);}),this['listenTo'](this['history'],'itemUpdated',(_0x500483,_0x14047e)=>{void 0x0!==_0x14047e['updates']['title']&&this['_aiChatHistoryUi']['updateItemTitle'](_0x14047e['itemId'],_0x14047e['updates']['title']),void 0x0!==_0x14047e['updates']['pinned']&&this['_updateHistoryItemsUI'](),this['_clearItemLoading'](_0x14047e['itemId']);}),this['listenTo'](this['history'],'itemRemoved',(_0x441ca1,_0x50792c)=>{this['_aiChatController']['_handleRemovedConversation'](_0x50792c['itemId']),this['_aiChatHistoryUi']['removeHistoryItem'](_0x50792c['itemId']),this['_clearItemLoading'](_0x50792c['itemId']);}),this['listenTo'](this['history'],'itemsLoaded',()=>{this['_updateHistoryItemsUI']();}),this['listenTo'](this['history'],'error',(_0x4985bc,_0x480d87)=>{this['_handleHistoryErrorUI'](_0x480d87['error'],_0x480d87['operation'],_0x480d87['itemId']);}),this['listenTo'](this['_aiChatHistoryUi'],'selectConversation',(_0x4607f8,_0x5bfbb7)=>{this['_handleSelectConversation'](_0x5bfbb7['id']);}),this['listenTo'](this['_aiChatHistoryUi'],'setConversationPinned',(_0x1215f4,_0x469cd8)=>{const _0x32d721=_0x469cd8['pinned']?'pin':'unpin';this['_setItemLoading'](_0x469cd8['id'],_0x32d721),this['_handleTogglePin'](_0x469cd8['id'],_0x469cd8['pinned']);}),this['listenTo'](this['_aiChatHistoryUi'],'startConversation',()=>{this['_aiChatController']['startConversation'](),_0x1c779e['view']['activateTab']('chat');}),this['listenTo'](this['_aiChatController'],'change:activeConversation',()=>{this['_updateHistoryItemsUI']();}),_0x1c779e['view']['on']('activateTab:history',()=>{this['_showConversationHistory']();});}catch(_0x12421f){this['_handleHistoryErrorUI'](_0x12421f,'init');}}async['_handleEditTitle'](_0x4eb885,_0x3d13fe){await this['history']['updateItemTitle'](_0x4eb885,_0x3d13fe);}async['_handleTogglePin'](_0x541b5f,_0x5642f8){await this['history']['updateItemPinned'](_0x541b5f,_0x5642f8);}async['_handleRemove'](_0x53a669){await this['history']['removeItem'](_0x53a669);}async['_handleSelectConversation'](_0x5e1aca){await this['_aiChatController']['loadConversation'](_0x5e1aca);}async['_showConversationHistory'](){this['_aiChatHistoryUi']['showError'](''),this['_aiChatHistoryUi']['setLoadingSkeleton'](!0x0),await this['history']['init'](),this['_aiChatHistoryUi']['setLoadingSkeleton'](!0x1);}['_updateHistoryItemsUI'](){const _0x5b28bd=this['_aiChatController']['activeConversation']?.['id'],_0x1cd6d4=this['_getCategorizedItems']()['map'](_0x2a03f3=>({'title':_0x2a03f3['title'],'items':_0x2a03f3['items']['map'](_0x28db2d=>({'id':_0x28db2d['id'],'title':_0x28db2d['title']||hs(this['context']['locale'],'AI_CHAT_UNTITLED_CONVERSATION'),'createdAt':new Date(_0x28db2d['createdAt'])['toLocaleDateString'](),'active':_0x28db2d['id']===_0x5b28bd,'pinned':_0x28db2d['pinned']}))}));this['_aiChatHistoryUi']['updateItems'](_0x1cd6d4);}['_setItemLoading'](_0x4f4d54,_0x40bcc9){this['_aiChatHistoryUi']['updateItemLoadingState'](_0x4f4d54,_0x40bcc9,!0x0);}['_clearItemLoading'](_0x2874cb){this['_aiChatHistoryUi']['updateItemLoadingState'](_0x2874cb,null,!0x1);}['_handleHistoryErrorUI'](_0x35aa90,_0x10eaf6,_0x1ccce9){const _0x177c07=this['_generateErrorMessage'](_0x10eaf6,_0x1ccce9);this['_aiChatHistoryUi']['showError'](_0x177c07),_0x1ccce9&&this['_clearItemLoading'](_0x1ccce9),this['_aiChatHistoryUi']['setLoadingSkeleton'](!0x1);}['_generateErrorMessage'](_0x4408ee,_0x32144f){const _0x42ba56=_0x32144f?this['history']['getItem'](_0x32144f):null,_0x3db2cd=_0x42ba56?.['title']||hs(this['context']['locale'],'AI_CHAT_UNTITLED_CONVERSATION');switch(_0x4408ee){case'updateItemTitle':return hs(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_UPDATE_TITLE',_0x3db2cd);case'updateItemPinned':{const _0x530c4c=hs(this['context']['locale'],_0x42ba56?.['pinned']?'AI_CHAT_HISTORY_UNPIN_ACTION':'AI_CHAT_HISTORY_PIN_ACTION');return hs(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_UPDATE_PINNED',[_0x530c4c,_0x3db2cd]);}case'removeItem':return hs(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_REMOVE_ITEM',_0x3db2cd);case'init':case'loadItems':return hs(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_LOAD_ITEMS');default:return hs(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_GENERIC');}}['_getCategorizedItems'](){const _0x5cd1db=new Date(),_0x1aba34=new Date(_0x5cd1db['getFullYear'](),_0x5cd1db['getMonth'](),_0x5cd1db['getDate']()),_0x5c1f6c=new Date(_0x1aba34);_0x5c1f6c['setDate'](_0x5c1f6c['getDate']()-0x1);const _0x279aa4=new Date(_0x1aba34);_0x279aa4['setDate'](_0x279aa4['getDate']()-0xe);const _0xc6d1d2=this['history']['getItems']({'pinned':!0x0}),_0x53b0aa=this['history']['getItems']({'from':_0x1aba34,'to':_0x1aba34}),_0x3c03e1=this['history']['getItems']({'from':_0x5c1f6c,'to':_0x5c1f6c}),_0xf0a9f0=this['history']['getItems']({'from':_0x279aa4,'to':_0x5c1f6c}),_0x59242c=this['history']['getItems']({'to':_0x279aa4}),_0xae7eb0=[];return _0xc6d1d2['length']>0x0&&_0xae7eb0['push']({'title':hs(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_PINNED'),'items':_0xc6d1d2}),_0x53b0aa['length']>0x0&&_0xae7eb0['push']({'title':hs(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_TODAY'),'items':_0x53b0aa}),_0x3c03e1['length']>0x0&&_0xae7eb0['push']({'title':hs(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_YESTERDAY'),'items':_0x3c03e1}),_0xf0a9f0['length']>0x0&&_0xae7eb0['push']({'title':hs(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_LAST_14_DAYS'),'items':_0xf0a9f0}),_0x59242c['length']>0x0&&_0xae7eb0['push']({'title':hs(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_LATER'),'items':_0x59242c}),_0xae7eb0;}}class Io extends _0x2599d1{static get['requires'](){return[Ao,uo];}static get['pluginName'](){return'AIChatHistory';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}class Eo extends _0x2599d1{static get['requires'](){return[Xs,Js,ro,Io];}static get['pluginName'](){return'AIChat';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x253458){super(_0x253458),this['context']['config']['define']('ai.chat.context',{'document':{'enabled':!0x0},'urls':{'enabled':!0x0},'files':{'enabled':!0x0},'sources':[],'alwaysAddSelection':!0x1}),this['context']['config']['define']('ai.chat.initialConversation','new');}}class po extends Nt{['id'];constructor(_0x5e21d9,_0x158ae6){super(_0x5e21d9);const {id:_0x5da1d5,type:_0xc485f7,icon:_0xa24d53}=_0x158ae6;this['id']=_0x5da1d5,this['set']({'label':_0x158ae6['label'],'withText':!0x0,'class':'ck-ai-chat-shortcut'}),this['extendTemplate']({'attributes':{'data-cke-ai-shortcut-id':_0x158ae6['id']}}),_0xa24d53?this['icon']=_0xa24d53:'chat'===_0xc485f7?this['icon']=_0x25cace:'review'===_0xc485f7?this['icon']=_0x5a6179:'translate'===_0xc485f7&&(this['icon']=_0x142ddd);}}class mo extends vt{['listView'];constructor(_0x5ac628,_0x485f3e){super(_0x5ac628);const _0x3c33ee=_0x485f3e['map'](_0x47e2fd=>{const _0x1486c0=new Ht(this['locale']),_0x45aeef=new po(this['locale'],_0x47e2fd);return _0x1486c0['children']['add'](_0x45aeef),_0x45aeef['delegate']('execute')['to'](this),_0x1486c0;});this['listView']=new Dt(this['locale']),this['listView']['items']['addMany'](_0x3c33ee),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat-shortcuts']},'children':[this['listView']]});}}const To='chat-shortcuts';class Co extends _0x2599d1{['_shortcuts'];['_shortcutsView'];['_aiChatUI'];static get['requires'](){return[ro];}static get['pluginName'](){return'AIChatShortcuts';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){this['_aiChatUI']=this['context']['plugins']['get'](ro),this['_shortcuts']=this['context']['config']['get']('ai.chat.shortcuts')??[];const _0x571af9=this['context']['plugins']['get']('AIChatController');this['_shortcuts']['length']&&(this['_validateShortcuts'](),this['_aiChatUI']['on']('conversationCreated',()=>{_0x571af9['activeConversation']['isFromHistory']||this['_injectShortcuts']();}),this['listenTo'](_0x571af9,'interactionStarted',()=>{this['_removeShortcuts']();}));}['_validateShortcuts'](){const _0x4b2ed2=['chat','review','translate'];this['_shortcuts']['forEach'](_0x54869f=>{let _0x3967bf=!0x0;if(_0x54869f['id']&&_0x54869f['label']&&_0x4b2ed2['includes'](_0x54869f['type'])?'chat'===_0x54869f['type']&&(_0x3967bf='string'==typeof _0x54869f['prompt']):_0x3967bf=!0x1,!_0x3967bf)throw new at('ai-chat-shortcuts-invalid-config',this['context'],{'shortcut':_0x54869f});});}['_injectShortcuts'](){const _0x510d9f=this['context']['plugins']['get'](ro);this['_shortcutsView']=new mo(this['context']['locale'],this['_shortcuts']),this['_shortcutsView']['render'](),_0x510d9f['addFeedItemCustomElement'](this['_shortcutsView']['element'],To),this['_shortcutsView']['on']('execute',_0x4c15e0=>{const _0x160606=_0x4c15e0['source']['id'];this['_executeShortcut'](_0x160606);});}['_removeShortcuts'](){const _0x446c70=this['context']['plugins']['get'](ro);_0x446c70['hasFeedItem'](To)&&_0x446c70['removeFeedItem'](To),this['_shortcutsView']?.['destroy']();}['_executeShortcut'](_0x261471){const _0xfad78e=this['_shortcuts']['find'](_0x55831b=>_0x55831b['id']===_0x261471),_0x51a56d=_0xfad78e['type'];'chat'===_0x51a56d?this['_runChatShortcut'](_0xfad78e):'review'===_0x51a56d?_0xfad78e['commandId']?this['_runReviewShortcut'](_0xfad78e):this['_switchTab']('reviewMode'):'translate'===_0x51a56d&&(_0xfad78e['language']?this['_runTranslateShortcut'](_0xfad78e):this['_switchTab']('translate'));}['_switchTab'](_0x454fef){if(!this['context']['plugins']['has']('AITabs'))throw new at('ai-chat-shortcuts-ai-tabs-not-found',this['context'],{'tabName':_0x454fef});this['context']['plugins']['get']('AITabs')['view']['activateTab'](_0x454fef);}async['_runChatShortcut']({prompt:_0x4b256e,draftMode:_0x2d67c5,useWebSearch:_0x2c1f88=!0x1,useReasoning:_0xfb1e46=!0x1,model:_0x5d2263}){const _0x41175f=this['context']['plugins']['get']('AIChatController'),_0x4687ac=_0x41175f['activeConversation'];let _0x595d9d;_0x595d9d=_0x5d2263?await _0x4687ac['chatModels']['getModel'](_0x5d2263):await _0x4687ac['chatModels']['getDefault'](),_0x595d9d&&await _0x4687ac['setModel'](_0x595d9d),_0x4687ac['setWebSearch'](_0x2c1f88),_0x4687ac['setReasoning'](_0xfb1e46),_0x41175f['addCurrentDocumentToChatContext'](),_0x2d67c5?(this['_aiChatUI']['setPromptInputValue'](_0x4b256e),this['_aiChatUI']['focusPromptInput'](!0x0)):_0x41175f['sendMessage']({'message':_0x4b256e});}['_runReviewShortcut']({commandId:_0x3bb074,model:_0x492f5f,prompt:_0x47343b,params:_0x5b9f6}){if(!this['context']['plugins']['has']('AIReviewModeUI'))throw new at('ai-chat-shortcuts-review-mode-not-found',this['context']);this['_switchTab']('reviewMode');const _0x28f0fa={'id':_0x3bb074,'isCustom':'custom'===_0x3bb074};_0x492f5f&&_0x47343b&&(_0x28f0fa['args']={'model':_0x492f5f,'prompt':_0x47343b}),_0x5b9f6&&(_0x28f0fa['params']=_0x5b9f6),this['context']['plugins']['get']('AIReviewModeUI')['fire']('runReviewCheck',_0x28f0fa);}['_runTranslateShortcut']({language:_0x2a91ad}){if(!this['context']['plugins']['has']('AITranslateUI'))throw new at('ai-chat-shortcuts-translate-not-found',this['context']);this['_switchTab']('translate'),this['context']['plugins']['get']('AITranslateUI')['fire']('runReviewCheck',{'id':_0x2a91ad,'args':{'language':_0x2a91ad}});}}class wo extends _0x4eedb8{constructor(_0x38cf88){super(_0x38cf88);const _0x439a10=_0x38cf88['plugins']['get']('AITabs')['view'];this['bind']('value')['to'](_0x439a10,'isVisible'),this['isEnabled']=!0x0;}['execute'](){const _0x36c36a=this['editor']['plugins']['get']('AITabs')['view'];_0x36c36a['isVisible']=!_0x36c36a['isVisible'];}}class fo extends _0x530ddf{static get['requires'](){return[os];}static get['pluginName'](){return'AIToggleButtonUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const _0x6f4bdf=this['editor'];_0x6f4bdf['commands']['add']('toggleAi',new wo(_0x6f4bdf)),_0x6f4bdf['ui']['componentFactory']['add']('toggleAi',()=>{const _0x424ca5=this['_createAIUIButton'](Nt);return _0x424ca5['set']({'tooltip':!0x0,'class':'ck-ai-toggle-button'}),_0x424ca5;}),_0x6f4bdf['ui']['componentFactory']['add']('menuBar:toggleAi',()=>{const _0x5e7b29=this['_createAIUIButton'](Wt);return _0x5e7b29['set']({'role':'menuitemcheckbox'}),_0x5e7b29;});}['_createAIUIButton'](_0x11e307){const _0x36943e=this['editor'],_0x57ad09=_0x36943e['commands']['get']('toggleAi'),_0x140ef0=new _0x11e307(_0x36943e['locale']);return _0x140ef0['set']({'label':hs(_0x36943e['locale'],'AI_TOGGLE_BUTTON_LABEL'),'icon':_0x28afbe,'isToggleable':!0x0}),_0x140ef0['bind']('isEnabled')['to'](_0x57ad09),_0x140ef0['bind']('isOn')['to'](_0x57ad09,'value',_0x43a394=>!!_0x43a394),this['listenTo'](_0x140ef0,'execute',()=>{_0x57ad09['execute']();}),_0x140ef0;}}const bo=['applySuggestion','insertSuggestion','showNext','showPrevious'];class So extends vt{['_errorView'];constructor(_0x496ce8){super(_0x496ce8),this['set']('_errorMessage',''),this['set']('_isErrorVisible',!0x1);}['showBlockingError'](_0x30d42b){this['showError'](_0x30d42b);}['showError'](_0x4240c5){this['_errorView']||(this['_errorView']=this['_createErrorView']()),this['_errorMessage']=_0x4240c5,this['_isErrorVisible']=!0x0;}['hideError'](){this['_isErrorVisible']=!0x1;}['_createErrorView'](){const _0x25cfce=new vt(this['locale']),_0x1c9c66=new vt(this['locale']);return _0x1c9c66['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai-suggestion__error-text']},'children':[{'text':this['bindTemplate']['to']('_errorMessage')}]}),_0x25cfce['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__error','ck-ai-balloon-error',this['bindTemplate']['if']('_isErrorVisible','ck-hidden',_0x561f0c=>!_0x561f0c)]},'children':[_0x1c9c66]}),_0x25cfce;}}const Ro=0xa;class Oo extends _0x2599d1{static get['requires'](){return[Js];}static get['pluginName'](){return'AIBalloon';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['isOpen']=!0x1;['_currentConfig'];['_getTargetEditor'](){return this['_currentConfig']?.['targetEditor']??$s(this['context']);}['_isUpdatingMarkers']=!0x1;['open'](_0x1cbb4a){const {id:_0x2c9850}=this['_currentConfig']??{};this['_currentConfig']=_0x1cbb4a;const {id:_0x51a82b}=this['_currentConfig'];this['isOpen']&&_0x2c9850===_0x51a82b?this['_updateDialog']():this['_showDialog']();}['close'](){const _0x423497=this['_getTargetEditor']()['plugins']['get']('Dialog');_0x423497['isOpen']&&this['_currentConfig']&&_0x423497['id']===this['_currentConfig']['id']&&_0x423497['hide']();}['_updateDialog'](){const _0x4f84c5=this['_getTargetEditor']()['plugins']['get']('Dialog'),{icon:_0x50ca30,title:_0x3764ae}=this['_currentConfig'];_0x4f84c5['view']?.['headerView']&&(_0x4f84c5['view']['headerView']['label']=_0x3764ae,_0x4f84c5['view']['headerView']['iconView']&&_0x50ca30&&(_0x4f84c5['view']['headerView']['iconView']['content']=_0x50ca30)),this['_isUpdatingMarkers']=!0x0,this['_showFakeVisualSelection'](),this['_isUpdatingMarkers']=!0x1,_0x4f84c5['view']?.['updatePosition']();}['_showFakeVisualSelection'](){this['context']['plugins']['get'](Js)['showFakeVisualSelection']({'ranges':this['_currentConfig']['ranges'],'id':'balloon','priority':0x64}),window['getSelection']()?.['removeAllRanges']();}['_hideFakeVisualSelection'](){this['context']['plugins']['get'](Js)['hideFakeVisualSelection']('balloon');}['_showDialog'](){const _0x412f0b=this['_getTargetEditor']()['plugins']['get']('Dialog'),{id:_0x4fd3be,title:_0x2c08ca,icon:_0x597c8f,class:_0x3988b2,mainView:_0x409b18}=this['_currentConfig'];_0x409b18['delegate'](...bo)['to'](this),_0x412f0b['show']({'title':_0x2c08ca,'icon':_0x597c8f,'hasCloseButton':!0x0,'id':_0x4fd3be,'position':this['_calculateDialogPosition']['bind'](this),'className':'ck-ai-balloon\x20'+(_0x3988b2||''),'content':_0x409b18,'onShow':_0x409c5c=>{this['_showFakeVisualSelection'](),this['_setupFakeVisualSelectionMarkerRemovalListener'](),_0x409c5c['view']?.['updatePosition']();const _0x4e3b90=this['_getSelectionElements']();_0x4e3b90&&_0x4e3b90[0x0]&&Ct({'target':_0x4e3b90[0x0],'ancestorOffset':0x14,'alignToTop':!0x0,'viewportOffset':{'top':0x14,'bottom':0x14,'left':0x0,'right':0x0}}),this['isOpen']=!0x0,_0x409c5c['once']('hide',()=>{this['fire']('beforeDialogClosed',{'id':_0x4fd3be});},{'priority':'high'});},'onHide':()=>{this['_hideFakeVisualSelection'](),this['_cleanupFakeVisualSelectionMarkerRemovalListener'](),this['fire']('dialogClosed',{'id':_0x4fd3be}),this['isOpen']=!0x1;}});}['_calculateDialogPosition'](_0x1b5373,_0x3e6f36){if(!_0x3e6f36){const _0x438571=this['_getTargetRootDomRect']();if(!_0x438571)return null;_0x3e6f36=_0x438571;}const _0x1522b3=this['_getSelectionElements']();if(!_0x1522b3||0x0===_0x1522b3['length'])return{'left':Math['round'](_0x3e6f36['left']+_0x3e6f36['width']/0x2-_0x1b5373['width']/0x2),'top':Math['round'](_0x3e6f36['top']+_0x3e6f36['height']/0x2-_0x1b5373['height']/0x2)};const _0xe87765=Math['round'](_0x3e6f36['left']+_0x3e6f36['width']/0x2-_0x1b5373['width']/0x2),_0x234196=_0x1522b3['map'](_0x5995c1=>new ut(_0x5995c1)),_0x1059cf=_0x1b5373['height'];return{'left':_0xe87765,'top':this['_calculateOptimalTopPosition'](_0x234196,_0x1059cf,_0x3e6f36)};}['_calculateOptimalTopPosition'](_0x125523,_0x25a7e0,_0x6349d2){const _0x4fc4d5=new ut(ct['window']),_0x398662=_0x125523['map'](_0xd149c2=>_0xd149c2['getVisible']())['filter'](_0x3ddfe7=>_0x3ddfe7),_0xbf325e=ut['getBoundingRect'](_0x398662);if(!_0xbf325e)return Math['round'](_0x6349d2['top']+_0x6349d2['height']/0x2);const _0x28471e=_0x4fc4d5['getIntersection'](_0xbf325e);if(!_0x28471e)return Math['round'](_0x6349d2['top']+_0x6349d2['height']/0x2);const _0x4f7695=_0x6349d2['getVisible'](),_0x2c8052=_0x4f7695&&_0xbf325e['height']>_0x4f7695['height'],_0x5533ea=_0x28471e['top'],_0x4af7b5=_0x28471e['bottom'];if(_0x2c8052){const _0x151042=(_0x4f7695||_0x4fc4d5)['height']/0x2-_0x25a7e0/0x2,_0x4811db=_0x5533ea-Ro-_0x6349d2['top'],_0x2d96a9=_0x6349d2['bottom']-_0x4af7b5-Ro;return _0x4811db>=_0x25a7e0?Math['max'](Ro,_0x5533ea-_0x25a7e0-Ro):_0x2d96a9>=_0x25a7e0?_0x4af7b5+Ro:Math['max'](Ro,_0x151042);}const _0x524679=_0x5533ea-_0x25a7e0,_0x56e418=_0x6349d2['bottom']-_0x4af7b5-Ro,_0x296872=_0x5533ea-Ro-_0x6349d2['top'];let _0x28e961;if(_0x56e418>=_0x25a7e0)_0x28e961=_0x4af7b5+Ro;else{if(_0x296872>=_0x25a7e0)_0x28e961=_0x524679-Ro;else _0x28e961=_0x5533ea+_0xbf325e['height']/0x2-_0x25a7e0/0x2;}return _0x28e961;}['_setupFakeVisualSelectionMarkerRemovalListener'](){const _0x5e633a=this['_getTargetEditor']();this['listenTo'](_0x5e633a['model']['document'],'change',()=>{if(!this['_isUpdatingMarkers']){for(const {name:_0x7aafde,data:{newRange:_0x4b4bcb}}of _0x5e633a['model']['document']['differ']['getChangedMarkers']())if(_0x7aafde['startsWith'](zs+':')&&(_0x4b4bcb&&(_0x4b4bcb['start']['isEqual'](_0x4b4bcb['end'])||'$graveyard'==_0x4b4bcb['root']['rootName'])||null==_0x4b4bcb)){const _0x362c2c=hs(this['context']['locale'],'AI_BALLOON_SELECTION_REMOVED_ERROR');this['_currentConfig']['mainView']['showBlockingError'](_0x362c2c),this['fire']('selectionRemoved');}}});}['_cleanupFakeVisualSelectionMarkerRemovalListener'](){const _0x43e393=this['_getTargetEditor']();this['_currentConfig']['mainView']['hideError'](),this['stopListening'](_0x43e393['model']['document']);}['_getSelectionElements'](){const _0x3247d3=this['_getTargetEditor']();return _0x8f408d(_0x3247d3['editing'],[..._0x3247d3['model']['markers']['getMarkersGroup']('ai-selection'),..._0x3247d3['model']['markers']['getMarkersGroup']('ai-balloon-selection')]);}['_getTargetRootDomRect'](){const _0x1ec348=this['_currentConfig']?.['ranges']?.[0x0]?.['root'];if(!_0x1ec348)return null;const _0x3e30fa=this['_getTargetEditor'](),_0x55d9fb=_0x3e30fa['editing']['view']['document']['getRoot'](_0x1ec348['rootName']);if(!_0x55d9fb)return null;const _0x47423a=_0x3e30fa['editing']['view']['domConverter']['mapViewToDom'](_0x55d9fb);return _0x47423a&&_0x47423a instanceof HTMLElement?new ut(_0x47423a):null;}}class ko extends kt{['copyButton'];['likeButton'];['dislikeButton'];['showChangesButton'];['_config'];constructor(_0x13222f,_0x3f3a07={}){super(_0x13222f),this['set']('isEnabled',!0x0),this['set']('isShowChangesOn',!0x1),this['_config']={'showCopy':!0x1,'showLike':!0x1,'showDislike':!0x1,..._0x3f3a07};const _0xcb9bdf=!(this['_config']['showCopy']||this['_config']['showChanges']||this['_config']['showLike']||this['_config']['showDislike']||this['_config']['customView']?.['length']);this['class']=_0xcb9bdf?'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'](_0x3d0330){this['showChangesButton']['isEnabled']=_0x3d0330;}['_setupRatingButtons'](){this['likeButton']=new Nt(this['locale']),this['likeButton']['set']({'icon':_0x48edef,'label':hs(this['locale'],'AI_MINI_TOOLBAR_LIKE'),'class':us,'tooltip':!0x0}),this['likeButton']['bind']('isEnabled')['to'](this),this['likeButton']['on']('execute',()=>{this['fire']('like');}),this['dislikeButton']=new Nt(this['locale']),this['dislikeButton']['set']({'icon':_0x454f90,'label':hs(this['locale'],'AI_MINI_TOOLBAR_DISLIKE'),'class':us,'tooltip':!0x0}),this['dislikeButton']['bind']('isEnabled')['to'](this),this['dislikeButton']['on']('execute',()=>{this['fire']('dislike');});}['_setupCopyButton'](){this['copyButton']=new Nt(this['locale']),this['copyButton']['set']({'icon':_0x2eaf4b,'label':hs(this['locale'],'AI_MINI_TOOLBAR_COPY'),'class':'ck-ai-mini-toolbar-copy-button\x20'+us,'tooltip':!0x0}),this['copyButton']['bind']('isEnabled')['to'](this);const _0x500af8=new xt();_0x500af8['set']({'content':_0x463a41}),_0x500af8['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'+us,setTimeout(()=>{this['copyButton']['class']='ck-ai-mini-toolbar-copy-button\x20'+us;},0x7d0);}),this['copyButton']['children']['add'](_0x500af8);}['_setupShowChangesButton'](){this['showChangesButton']=new Nt(this['locale']),this['showChangesButton']['set']({'icon':_0x1d0393,'label':hs(this['locale'],'AI_SUGGESTION_BUTTON_SHOW_CHANGES'),'withText':'full'==this['_config']['showChanges'],'tooltip':'full'!=this['_config']['showChanges'],'class':us}),this['showChangesButton']['bind']('isOn')['to'](this,'isShowChangesOn'),this['showChangesButton']['bind']('isEnabled')['to'](this),this['showChangesButton']['bind']('icon')['to'](this,'isShowChangesOn',_0x1d4b4e=>_0x1d4b4e?_0x2f925f:_0x1d0393),this['showChangesButton']['on']('execute',()=>{this['fire']('toggleShowChanges');});}}class No extends So{['children'];['nextButtonView'];['previousButtonView'];['focusCycler'];['_focusables'];['_focusTracker'];['_keystrokes'];['_config'];['_streamableContentView'];['_toolbarContainerView'];['_partToolbarView'];['_stateView'];['_miniToolbarView'];constructor(_0x5408b6,_0x5d7137){super(_0x5408b6);const _0x47ea6d=this['bindTemplate'];this['set']('showDiff',!0x1),this['set']('_state','pending'),this['_focusTracker']=new _t(),this['_keystrokes']=new gt(),this['_focusables']=this['createCollection'](),this['focusCycler']=new Ut({'focusables':this['_focusables'],'focusTracker':this['_focusTracker'],'keystrokeHandler':this['_keystrokes'],'actions':{'focusPrevious':'shift\x20+\x20tab','focusNext':'tab'}}),this['_config']=_0x5d7137,this['nextButtonView']=this['_createNextButtonView'](),this['previousButtonView']=this['_createPreviousButtonView'](),this['_streamableContentView']=new In(_0x5408b6),this['_partToolbarView']=new _n(_0x5408b6,_0x5d7137['availableActions']),this['_partToolbarView']['delegate']('applySuggestion','insertSuggestion','rejectSuggestion')['to'](this),this['_togglePartToolbarButtonsVisibility'](_0x5d7137),this['_stateView']=new un(_0x5408b6),this['_stateView']['isVisible']=!0x1,this['_miniToolbarView']=new ko(_0x5408b6,{'showChanges':'full'}),this['_miniToolbarView']['bind']('isShowChangesOn')['to'](this,'showDiff'),this['_miniToolbarView']['on']('toggleShowChanges',()=>{this['fire']('toggleSuggestionDisplayMode');}),this['_toolbarContainerView']=new vo(_0x5408b6,[this['_partToolbarView'],this['_stateView'],this['_miniToolbarView']]),this['children']=this['createCollection']([this['_streamableContentView'],this['_toolbarContainerView']]),this['on']('change:_state',(_0x2cf2c8,_0x14198d,_0x446030,_0x1bfa50)=>{let _0x5ae2c2,_0x488d27;'pending'===_0x1bfa50?(_0x5ae2c2=this['_partToolbarView'],_0x488d27=this['_stateView']):(_0x5ae2c2=this['_stateView'],_0x488d27=this['_partToolbarView']),this['_stateView']['setState'](_0x446030),_0x5ae2c2['isVisible']=!0x1,_0x488d27['isVisible']=!0x0;}),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat-balloon-main',_0x47ea6d['to']('_state',_0x6c4b5b=>'ck-ai-chat-balloon-main_state_'+_0x6c4b5b)]},'children':this['children']}),this['on']('change:isTrackChangesOn',()=>{this['_togglePartToolbarButtonsVisibility'](_0x5d7137);});}['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'](_0x4a6454){_0x4a6454?.['keepErrors']||this['hideError'](),await this['_streamableContentView']['update'](_0x4a6454);}['setState'](_0x3eaec1){this['_state']=_0x3eaec1;}['showError'](_0x24735b){super['showError'](_0x24735b),this['children']['has'](this['_errorView'])||this['children']['add'](this['_errorView'],0x0);}['hideError'](){this['_isErrorVisible']&&(super['hideError'](),this['togglePartToolbarEnabled'](!0x0));}['showBlockingError'](_0x3f80aa){super['showBlockingError'](_0x3f80aa),this['togglePartToolbarEnabled'](!0x1);}['toggleRotatorButtonsVisibility'](_0x3dd8d3){this['nextButtonView']['isVisible']=this['previousButtonView']['isVisible']=_0x3dd8d3;}['togglePartToolbarEnabled'](_0x52d0d6){this['_partToolbarView']['isEnabled']=_0x52d0d6;}['_togglePartToolbarButtonsVisibility']({showApplyButton:_0x12860a,showSuggestButton:_0x305c8f}){_0x12860a=_0x12860a&&!this['isTrackChangesOn']&&this['_config']['availableActions']['includes']('applySuggestion'),_0x305c8f=_0x305c8f&&this['_config']['availableActions']['includes']('insertSuggestion'),this['_partToolbarView']['setButtonsVisibility']({'showApplyButton':_0x12860a,'showSuggestButton':_0x305c8f});}['_createNextButtonView'](){const _0x4f4b17=new Nt(this['locale']);return _0x4f4b17['set']({'icon':_0x28208a,'label':hs(this['locale'],'AI_BALLOON_NEXT_LABEL'),'isVisible':!0x0}),_0x4f4b17['on']('execute',()=>{this['fire']('showNext');}),_0x4f4b17;}['_createPreviousButtonView'](){const _0x54820b=new Nt(this['locale']);return _0x54820b['set']({'icon':_0x169048,'label':hs(this['locale'],'AI_BALLOON_PREVIOUS_LABEL'),'isVisible':!0x0}),_0x54820b['on']('execute',()=>{this['fire']('showPrevious');}),_0x54820b;}}class vo extends vt{constructor(_0x55e619,_0x54d630){super(_0x55e619),this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-chat-balloon__toolbar-container']},'children':_0x54d630});}}class yo extends _0x530ddf{static get['requires'](){return[Bt,Oo];}static get['pluginName'](){return'AIChatBalloon';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['_chatBalloonView'];constructor(_0x2a28cd){super(_0x2a28cd),this['set']('showDiff',!0x1);}['open'](_0x5bdef3){const _0x281451=this['editor'];this['_chatBalloonView']||(this['_chatBalloonView']=this['_createChatBalloonView']()),_0x281451['plugins']['get']('AIBalloon')['open']({..._0x5bdef3,'id':'aiChatBalloon','class':'ck-ai-chat-balloon','mainView':this['_chatBalloonView']}),this['_toggleRotatorButtonsInDialogHeader'](_0x5bdef3['showRotator']),this['_chatBalloonView']['togglePartToolbarEnabled'](!_0x5bdef3['areActionsDisabled']),this['_restoreDefaultViewFocus']();}['close'](){this['editor']['plugins']['get']('AIBalloon')['close']();}['updateContent'](_0x5ccb9a){return this['_chatBalloonView']||(this['_chatBalloonView']=this['_createChatBalloonView']()),this['_chatBalloonView']['updateContent'](_0x5ccb9a);}['setState'](_0x43d898){this['_chatBalloonView']&&this['_chatBalloonView']['setState'](_0x43d898);}['_createChatBalloonView'](){const _0x511458=this['editor'],_0x32aa71=_0x511458['plugins']['get']('AIBalloon'),_0x27f8d6=_0x511458['commands']['get']('trackChanges');let _0x4c70f2=_0x511458['config']['get']('ai.availableReplyActions')||[...fn];_0x511458['plugins']['has']('TrackChanges')||(_0x4c70f2=_0x4c70f2['filter'](_0x4738dc=>'insertSuggestion'!=_0x4738dc));const _0x470ec0=new No(_0x511458['locale'],{'availableActions':_0x4c70f2,'showApplyButton':!0x0,'showSuggestButton':!!_0x27f8d6});return _0x470ec0['bind']('showDiff')['to'](this),_0x470ec0['delegate'](...Zs)['to'](this),_0x470ec0['delegate']('showPrevious','showNext')['to'](this),_0x32aa71['delegate']('dialogClosed')['to'](this),_0x470ec0['on']('applySuggestion',this['_restoreDefaultViewFocus']['bind'](this)),_0x470ec0['on']('insertSuggestion',this['_restoreDefaultViewFocus']['bind'](this)),_0x470ec0['on']('rejectSuggestion',this['_restoreDefaultViewFocus']['bind'](this)),_0x27f8d6&&_0x470ec0['bind']('isTrackChangesOn')['to'](_0x27f8d6,'value'),_0x470ec0['render'](),_0x470ec0;}['_toggleRotatorButtonsInDialogHeader'](_0x561294){const _0x1e9218=this['editor'],_0x59e8b5=_0x1e9218['plugins']['get']('Dialog')['view']['headerView']['children'];this['_chatBalloonView']['toggleRotatorButtonsVisibility'](_0x561294),_0x59e8b5['has'](this['_chatBalloonView']['previousButtonView'])||(_0x59e8b5['addMany']([this['_chatBalloonView']['previousButtonView'],this['_chatBalloonView']['nextButtonView']],0x0),_0x1e9218['plugins']['get']('AIBalloon')['once']('beforeDialogClosed',()=>{_0x59e8b5['remove'](this['_chatBalloonView']['previousButtonView']),_0x59e8b5['remove'](this['_chatBalloonView']['nextButtonView']);}));}['_restoreDefaultViewFocus'](){this['_chatBalloonView']['focus']();}}class xo extends _0x530ddf{static get['requires'](){return[fo,yo,_0x15a886];}static get['pluginName'](){return'AIEditorIntegration';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}function Lo(_0x2fcc7d){const {editor:_0x47857a,action:_0x58ee57,withText:_0x180a06=!0x1,withIcon:_0x13c1cc=!0x0,isInDropdown:_0x1c1e17=!0x0,shouldPreventFocus:_0x527040=!0x1}=_0x2fcc7d;return()=>{const _0x3c1612=_0x47857a['locale'],_0xbde323=new Nt(_0x3c1612),_0x3d77a2=_0xbde323['bindTemplate'];_0x1c1e17&&_0xbde323['extendTemplate']({'on':{'mouseenter':_0x3d77a2['to'](()=>{_0x527040&&_0x527040()||_0xbde323['focus']();})}});const _0x15322e=_0x58ee57['icon']??_0x58ee57['parent']?.['icon'];return _0xbde323['set']({'label':_0x58ee57['label'],'withText':_0x180a06,'role':'menuitem','icon':_0x13c1cc?_0x15322e??_0x208a91:void 0x0,'tooltip':!_0x180a06,'class':'ck-ai-quick-actions-button','isEnabled':_0x58ee57['isEnabled']}),_0xbde323['on']('execute',()=>{_0x47857a['editing']['view']['focus'](),_0x47857a['commands']['execute']('aiQuickAction',_0x58ee57);}),_0xbde323;};}class Do extends _0x4dce31{['arrowView'];constructor(_0x1e73a7,_0x5168cd){super(_0x1e73a7,_0x5168cd);const _0x50290c=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',_0xb6101e=>String(_0xb6101e)),'data-cke-tooltip-disabled':_0x50290c['to']('isOn')},'on':{'mouseenter':_0x50290c['to']('mouseenter')}});}['render'](){super['render'](),this['children']['add'](this['arrowView']);}['_createArrowView'](){const _0x4da729=new xt();return _0x4da729['content']=_0x12e82d,_0x4da729['extendTemplate']({'attributes':{'class':'ck-dropdown-menu-list__nested-menu__button__arrow'}}),_0x4da729;}}class Po extends Dt{['_allListItems'];['_allSearchableItems'];constructor(_0x3cea7b,_0x3dd516,_0x293f9c){super(_0x3cea7b),this['_allListItems']=_0x3dd516,this['_allSearchableItems']=_0x293f9c;}['filter'](_0x5946b0){if(!_0x5946b0)return this['items']['clear'](),this['items']['addMany'](this['_allListItems']),this['_clearHighlight'](),{'resultsCount':this['_allListItems']['length'],'totalItemsCount':this['_allListItems']['length']};const _0x3123ce=_0x5946b0['source']['toLowerCase']()['trim'](),_0x348163=this['_allSearchableItems']['filter'](_0x31838b=>(_0x31838b['groupLabel']?_0x31838b['label']+'\x20('+_0x31838b['groupLabel']+')':_0x31838b['label'])['toLowerCase']()['includes'](_0x3123ce));return this['items']['clear'](),this['items']['addMany'](_0x348163['sort']((_0x4bf5f6,_0x308fc5)=>{const _0x5558dc=_0x4bf5f6['groupLabel'],_0xe7a345=_0x308fc5['groupLabel'];return _0x5558dc||_0xe7a345?_0x5558dc?0x1:-0x1:0x0;})['map'](_0x43b0d7=>_0x43b0d7['item'])),this['_highlightQuery'](_0x3123ce,_0x348163),{'resultsCount':_0x348163['length'],'totalItemsCount':this['_allSearchableItems']['length']};}['_highlightQuery'](_0x1c69ac,_0xf83380){if(!_0x1c69ac)return;const _0x12920d=new RegExp(_0x16eb6f(_0x1c69ac),'gi');_0xf83380['forEach'](_0x254a89=>{_0x254a89['highlightViews']&&_0x254a89['highlightViews']['forEach'](_0x328b43=>{'function'==typeof _0x328b43['highlightText']&&_0x328b43['highlightText'](_0x12920d);});});}['_clearHighlight'](){this['_allSearchableItems']['forEach'](_0x1b5e72=>{_0x1b5e72['highlightViews']&&_0x1b5e72['highlightViews']['forEach'](_0x2f16b0=>{'function'==typeof _0x2f16b0['highlightText']&&_0x2f16b0['highlightText'](null);});});}}const Ho='menu',Mo='menuitem';class Uo extends vt{['_bodyCollection'];['optionsListView'];['_searchTextView']=null;['_allSearchableItems']=[];['children'];['focusTracker'];['keystrokes'];['_focusables'];['focusCycler'];['_openNestedPanels']=new Set();['_hasSearch'];constructor(_0x2190d1,_0x447115,_0x132078,_0x48a90b,_0x37d43f=!0x1){const _0x38047d=_0x2190d1['locale'];super(_0x38047d),this['_bodyCollection']=_0x48a90b,this['_hasSearch']=_0x37d43f;const _0x20e27d=this['_createListItems'](_0x2190d1,_0x447115,_0x132078);this['optionsListView']=new Po(_0x38047d,_0x20e27d,this['_allSearchableItems']),this['optionsListView']['role']=Ho,this['optionsListView']['items']['addMany'](_0x20e27d),this['focusTracker']=new _t(),this['keystrokes']=new gt(),_0x37d43f&&(this['_searchTextView']=this['_createSearchTextView']()),this['_focusables']=_0x20e27d,this['focusCycler']=new Ut({'focusables':this['_focusables'],'focusTracker':this['focusTracker'],'keystrokeHandler':this['keystrokes']}),_0x37d43f&&this['_searchTextView']&&this['focusCycler']['chain'](this['_searchTextView']['focusCycler']);const _0x4ce92c=_0x37d43f&&this['_searchTextView']?[this['_searchTextView']]:[this['optionsListView']];this['children']=new _0x211f24(_0x4ce92c),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset_all','ck-ai-quick-actions','ck-rounded-corners'],'dir':_0x38047d['uiLanguageDirection']},'children':this['children']});}['_createSearchTextView'](){return new _0x36e65a(this['locale'],{'filteredView':this['optionsListView'],'queryView':{'label':hs(this['locale'],'AI_QUICK_ACTIONS_SEARCH')},'class':'ck-ai-quick-actions-search','infoView':{'text':{'notFound':{'primary':hs(this['locale'],'AI_QUICK_ACTIONS_SEARCH_NOT_FOUND')}}}});}['_isSearchFocused'](){if(!this['_hasSearch']||!this['_searchTextView']||!this['_searchTextView']['queryView']['fieldView']['element'])return!0x1;const _0xfbb5a3=this['_searchTextView']['queryView']['fieldView']['element']['ownerDocument']?.['activeElement'];return this['_searchTextView']['queryView']['fieldView']['element']['contains'](_0xfbb5a3);}['_createListItems'](_0x14e207,_0x8da127,_0x892941){const _0x44ffa2=new _0x211f24();return _0x8da127['forEach'](_0x478601=>{if('actions'in _0x478601){const {listItem:_0xce83ce}=this['_createActionGroupButton'](_0x14e207,_0x478601,_0x892941);_0x44ffa2['add'](_0xce83ce),_0x478601['actions']['forEach'](_0x15e4fb=>{this['_createActionButton'](_0x14e207,_0x15e4fb,_0x478601['label'],_0x478601['icon']);const {listItem:_0x2a44d6,highlightViews:_0x25f6a3}=this['_createSearchResultActionButton'](_0x14e207,_0x15e4fb,_0x478601['label'],_0x478601['icon']);this['_allSearchableItems']['push']({'item':_0x2a44d6,'label':_0x15e4fb['label'],'groupLabel':_0x478601['label'],'highlightViews':_0x25f6a3});});}else{const {listItem:_0x43a7b1}=this['_createActionButton'](_0x14e207,_0x478601);_0x44ffa2['add'](_0x43a7b1);const _0x1a8888=_0x43a7b1['children']['first'];if(_0x1a8888){const {listItem:_0x128f2b,highlightViews:_0x206d2d}=this['_createSearchResultActionButton'](_0x14e207,_0x478601);this['_allSearchableItems']['push']({'item':_0x128f2b,'label':_0x1a8888['label']||'','highlightViews':_0x206d2d});}}}),_0x44ffa2;}['_createActionButton'](_0x555ea8,_0x1d36cb,_0x2cbd13,_0x3deb08){const _0x32cadb=new Ht(this['locale']);if(_0x2cbd13&&_0x3deb08){const _0x1ac6fd=new Nt(this['locale']),_0x244d37=_0x1ac6fd['bindTemplate'],_0x3a6508=new _0x21d120();_0x3a6508['text']=_0x1d36cb['label'];const _0x1782f9=new _0x21d120();_0x1782f9['text']=_0x2cbd13;const _0x44f0f8=new xt();_0x44f0f8['content']=_0x3deb08,_0x44f0f8['extendTemplate']({'attributes':{'class':'ck-ai-quick-actions-button__group-icon'}});const _0x503af2=new vt(this['locale']);_0x503af2['setTemplate']({'tag':'span','attributes':{'class':'ck-ai-quick-actions-button_with-group__open-paren'},'children':[{'text':'\x20('}]});const _0x8ae33e=new vt(this['locale']);return _0x8ae33e['setTemplate']({'tag':'span','attributes':{'class':'ck-ai-quick-actions-button_with-group__close-paren'},'children':[{'text':')'}]}),_0x1ac6fd['set']({'label':_0x1d36cb['label']+'\x20('+_0x2cbd13+')','withText':!0x0,'role':'menuitem','class':'ck-ai-quick-actions-button\x20ck-ai-quick-actions-button_with-group','tooltip':!0x1}),_0x1ac6fd['setTemplate']({'tag':'button','attributes':{'class':['ck','ck-button','ck-button_with-text','ck-ai-quick-actions-button','ck-ai-quick-actions-button_with-group'],'type':'button','role':'menuitem','tabindex':'-1'},'children':[_0x3a6508,_0x503af2,_0x44f0f8,_0x1782f9,_0x8ae33e],'on':{'mouseenter':_0x244d37['to'](()=>{this['_isSearchFocused']()||_0x1ac6fd['focus']();}),'click':_0x244d37['to'](()=>{_0x1ac6fd['fire']('execute');})}}),_0x1ac6fd['on']('execute',()=>{_0x555ea8['editing']['view']['focus'](),_0x555ea8['commands']['execute']('aiQuickAction',_0x1d36cb);}),_0x32cadb['children']['add'](_0x1ac6fd),{'listItem':_0x32cadb,'highlightViews':[_0x3a6508,_0x1782f9]};}{const _0x418d4e=new _0x112738(),_0x1df4e8=new Nt(this['locale'],_0x418d4e),_0x1dfda3=_0x1df4e8['bindTemplate'],_0x14b8e5=_0x1d36cb['icon']??_0x1d36cb['parent']?.['icon'],_0xca0ec4=void 0x0!==_0x1d36cb['icon'];return _0x1df4e8['set']({'label':_0x1d36cb['label'],'withText':!0x0,'role':'menuitem','icon':_0xca0ec4?_0x14b8e5??_0x208a91:void 0x0,'tooltip':!0x1,'class':'ck-ai-quick-actions-button'}),_0x1df4e8['extendTemplate']({'on':{'mouseenter':_0x1dfda3['to'](()=>{this['_isSearchFocused']()||_0x1df4e8['focus']();})}}),_0x1df4e8['on']('execute',()=>{_0x555ea8['editing']['view']['focus'](),_0x555ea8['commands']['execute']('aiQuickAction',_0x1d36cb);}),_0x32cadb['children']['add'](_0x1df4e8),{'listItem':_0x32cadb,'highlightViews':[_0x418d4e]};}}['_createSearchResultActionButton'](_0x33ca39,_0x55f063,_0x4690a8,_0x275d94){return _0x4690a8&&_0x275d94?this['_createSearchResultGroupedActionButton'](_0x33ca39,_0x55f063,_0x4690a8,_0x275d94):this['_createSearchResultIndividualActionButton'](_0x33ca39,_0x55f063);}['_createSearchResultGroupedActionButton'](_0x1c1e6b,_0xdf8ee1,_0x18cb46,_0x3a4646){const _0x2cd745=new Ht(this['locale']),_0x51cb9f=new Nt(this['locale']),_0x71c274=_0x51cb9f['bindTemplate'],{view:_0x4f0eaf,highlightView:_0x1df7fc}=this['_createSearchResultGroupRow'](_0x18cb46,_0x3a4646),{view:_0x325744,highlightView:_0x5d9aa9}=this['_createSearchResultActionRow'](_0xdf8ee1['label']),_0x20970b=this['_createSearchResultContentView'](_0x4f0eaf,_0x325744);return _0x51cb9f['set']({'label':_0xdf8ee1['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}),_0x51cb9f['setTemplate']({'tag':'button','attributes':{'class':['ck','ck-button','ck-button_with-text','ck-ai-quick-actions-button','ck-ai-quick-actions-search-result-button','ck-ai-quick-actions-search-result-button_with-group'],'type':'button','role':'menuitem','tabindex':'-1'},'children':[_0x20970b],'on':{'mouseenter':_0x71c274['to'](()=>{this['_isSearchFocused']()||_0x51cb9f['focus']();}),'click':_0x71c274['to'](()=>{this['_handleSearchResultButtonClick'](_0x51cb9f);})}}),this['_setupActionButtonExecution'](_0x51cb9f,_0x1c1e6b,_0xdf8ee1),_0x2cd745['children']['add'](_0x51cb9f),{'listItem':_0x2cd745,'highlightViews':[_0x1df7fc,_0x5d9aa9]};}['_createSearchResultIndividualActionButton'](_0x1df6c2,_0x1e8846){const _0x441b4f=new Ht(this['locale']),_0x27fea9=new _0x112738(),_0x5d1316=new Nt(this['locale'],_0x27fea9),_0x2edad7=_0x5d1316['bindTemplate'];return _0x5d1316['set']({'label':_0x1e8846['label'],'withText':!0x0,'role':'menuitem','icon':void 0x0,'tooltip':!0x1,'class':'ck-ai-quick-actions-button\x20ck-ai-quick-actions-search-result-button'}),_0x5d1316['extendTemplate']({'on':{'mouseenter':_0x2edad7['to'](()=>{this['_isSearchFocused']()||_0x5d1316['focus']();})}}),this['_setupActionButtonExecution'](_0x5d1316,_0x1df6c2,_0x1e8846),_0x441b4f['children']['add'](_0x5d1316),{'listItem':_0x441b4f,'highlightViews':[_0x27fea9]};}['_createSearchResultGroupRow'](_0x3374e3,_0x1876d7){const _0x23b865=new vt(this['locale']),_0x99bc51=new xt();_0x99bc51['content']=_0x1876d7,_0x99bc51['extendTemplate']({'attributes':{'class':'ck-ai-quick-actions-button__group-icon'}});const _0x45db39=new _0x21d120();return _0x45db39['text']=_0x3374e3,_0x23b865['setTemplate']({'tag':'div','attributes':{'class':'ck-ai-quick-actions-search-result__group-row'},'children':[_0x99bc51,_0x45db39]}),{'view':_0x23b865,'highlightView':_0x45db39};}['_createSearchResultActionRow'](_0x58f95d){const _0x5a0f49=new vt(this['locale']),_0x72099d=new _0x21d120();return _0x72099d['text']=_0x58f95d,_0x5a0f49['setTemplate']({'tag':'div','attributes':{'class':'ck-ai-quick-actions-search-result__action-row'},'children':[_0x72099d]}),{'view':_0x5a0f49,'highlightView':_0x72099d};}['_createSearchResultContentView'](_0x444079,_0x4686c1){const _0x435fa8=new vt(this['locale']);return _0x435fa8['setTemplate']({'tag':'div','attributes':{'class':'ck-ai-quick-actions-search-result__content'},'children':[_0x444079,_0x4686c1]}),_0x435fa8;}['_setupActionButtonExecution'](_0x457533,_0x24f006,_0x46febe){_0x457533['on']('execute',()=>{_0x24f006['editing']['view']['focus'](),_0x24f006['commands']['execute']('aiQuickAction',_0x46febe);});}['_createActionGroupButton'](_0x446de2,_0x26f6d5,_0x4893b3){const _0x20c8af=new Ht(this['locale']),_0x1356f1=new _0x112738(),_0x4a1451=new Do(this['locale'],_0x1356f1),_0x5956d0=_0x4a1451['bindTemplate'],_0x5c6fb7=this['_getPanelKeystroke'](_0x4893b3),_0x15eec1=this['_createGroupActionsList'](_0x446de2,_0x26f6d5['actions'],_0x4893b3);_0x4a1451['set']({'label':_0x26f6d5['label'],'withText':!0x0,'role':Mo,'icon':_0x26f6d5['icon']??_0x208a91,'isEnabled':_0x26f6d5['actions']['some'](_0x3ed7f1=>_0x3ed7f1['isEnabled'])}),_0x4a1451['extendTemplate']({'on':{'mouseenter':_0x5956d0['to'](()=>{this['_isSearchFocused']()||_0x4a1451['focus']();})}});const _0x175c87=new Xt(this['locale']);return _0x175c87['extendTemplate']({'attributes':{'class':['ck','ck-reset_all','ck-ai-quick-actions-group-panel','ck-dropdown-menu__nested-menu__panel']},'on':{'keydown':_0x5956d0['to'](_0xcdbfef=>{this['_handlePanelKeydown'](_0xcdbfef,_0x5c6fb7,_0x4a1451,_0x175c87);})}}),_0x4a1451['bind']('isOn')['to'](_0x175c87,'isVisible'),this['_bodyCollection']['add'](_0x175c87),_0x175c87['content']['add'](_0x15eec1),this['_setupGroupMenuBehavior'](_0x4a1451,_0x175c87),_0x20c8af['children']['add'](_0x4a1451),{'listItem':_0x20c8af,'highlightView':_0x1356f1};}['_createGroupActionsList'](_0x3910ba,_0x449502,_0x524f25){const _0x3c1b80=new Dt(this['locale']);return _0x3c1b80['extendTemplate']({'attributes':{'class':['ck','ck-reset_all','ck-ai-quick-actions-group-list','ck-dropdown-menu-list']}}),_0x449502['forEach'](_0x4b2fa3=>{const _0x4c717f=new Ht(this['locale']),_0x45a32c=Lo({'editor':_0x3910ba,'action':_0x4b2fa3,'withText':!0x0,'withIcon':!0x1,'isInDropdown':!0x0,'shouldPreventFocus':()=>this['_isSearchFocused']()})();_0x4c717f['children']['add'](_0x45a32c),_0x524f25['focusTracker']['add'](_0x45a32c),_0x3c1b80['items']['add'](_0x4c717f);}),_0x3c1b80;}['_setupGroupMenuBehavior'](_0x480e04,_0x1f9d7a){const _0x5b875c=_0x480e04['bindTemplate'],_0x3efb3e=this['_getButtonKeystroke'](_0x480e04);_0x480e04['extendTemplate']({'attributes':{'class':['ck-ai-quick-actions-group-button']},'on':{'mouseenter':_0x5b875c['to'](()=>{this['_showNestedPanel'](_0x1f9d7a,_0x480e04);}),'mouseleave':_0x5b875c['to'](_0x283eec=>{const _0x1757ff=_0x283eec['relatedTarget'];this['_isMovingToNestedMenu'](_0x1757ff,_0x1f9d7a)||this['_hideNestedPanel'](_0x1f9d7a);}),'keydown':_0x5b875c['to'](_0x41deea=>{_0x41deea['key']==_0x3efb3e&&(this['_showNestedPanel'](_0x1f9d7a,_0x480e04),_0x1f9d7a['content']['get'](0x0)['focus']());})}}),_0x1f9d7a['on']('render',()=>{_0x1f9d7a['element']?.['addEventListener']('mouseleave',_0x15ba4e=>{const _0x2149aa=_0x15ba4e['relatedTarget'];_0x480e04['element']?.['contains'](_0x2149aa)||this['_isMovingToNestedMenu'](_0x2149aa,_0x1f9d7a)||this['_hideNestedPanel'](_0x1f9d7a);});});}['_showNestedPanel'](_0x42b25a,_0x1d4c6c){this['_openNestedPanels']['forEach'](_0x452e01=>{_0x452e01!==_0x42b25a&&_0x452e01['isVisible']&&_0x452e01['hide']();}),_0x42b25a['show'](),_0x42b25a['pin']({'positions':[_0x3dbed6['eastSouth']],'target':_0x1d4c6c['element'],'fitInViewport':!0x0}),this['_openNestedPanels']['add'](_0x42b25a);}['_hideNestedPanel'](_0x12c33c){_0x12c33c['hide'](),this['_openNestedPanels']['delete'](_0x12c33c);}['_hideAllNestedPanels'](){this['_openNestedPanels']['forEach'](_0x520287=>_0x520287['hide']()),this['_openNestedPanels']['clear']();}['_isMovingToNestedMenu'](_0x1e93ed,_0x2a418b){if(!_0x1e93ed)return!0x1;if(_0x2a418b['element']?.['contains'](_0x1e93ed))return!0x0;const _0x55e9cd=_0x1e93ed;return _0x55e9cd['closest']&&(null!==_0x55e9cd['closest']('.ck-ai-quick-actions-group-panel')||null!==_0x55e9cd['closest']('.ck-ai-quick-actions-group-list')||null!==_0x55e9cd['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'](_0x523f82){return'rtl'===_0x523f82['locale']['uiLanguageDirection']?'ArrowRight':'ArrowLeft';}['_getButtonKeystroke'](_0x452800){return'rtl'===_0x452800['locale']['uiLanguageDirection']?'ArrowLeft':'ArrowRight';}['_handlePanelKeydown'](_0x40a348,_0x52ee7b,_0xd4d882,_0x228f2b){_0x40a348['key']==_0x52ee7b&&(_0xd4d882['focus'](),this['_hideNestedPanel'](_0x228f2b));}['_handleSearchResultButtonClick'](_0x5df548){_0x5df548['fire']('execute');}}function Vo(_0x1388af){const {editor:_0xadfc96,content:_0x1c466b,buttonDefinition:_0x3feacc,bodyCollection:_0x4ee183,hasSearch:_0xf16d99=!0x1}=_0x1388af;return()=>{const _0x173d18=_0xadfc96['locale'],_0x27c895=_0xadfc96['commands']['get']('aiQuickAction'),_0x24c5c3=Gt(_0x173d18);_0x24c5c3['bind']('isEnabled')['to'](_0x27c895),_0x24c5c3['buttonView']['set']({'icon':_0x3feacc['icon']??_0x208a91,'label':_0x3feacc['label'],'tooltip':!0x0}),_0x24c5c3['set']({'class':'ck-ai-quick-actions-dropdown'});const _0x40c73f=new Uo(_0xadfc96,_0x1c466b,_0x24c5c3,_0x4ee183,_0xf16d99);return _0x24c5c3['panelView']['children']['add'](_0x40c73f),_0xf16d99&&_0x24c5c3['on']('change:isOpen',(_0x5593e2,_0x1ef802,_0xff121d)=>{if(_0xff121d){if(_0xadfc96['plugins']['has']('AIEditing')){const _0x4316c8=_0xadfc96['plugins']['get'](Js),_0x14602f=_0xadfc96['model']['document']['selection'],_0x8860e2=Array['from'](_0x14602f['getRanges']());_0x8860e2['length']>0x0&&_0x4316c8['showFakeVisualSelection']({'ranges':_0x8860e2,'id':'quick-action','priority':0x14});}}else _0xadfc96['plugins']['has']('AIEditing')&&_0xadfc96['plugins']['get'](Js)['hideFakeVisualSelection']('quick-action'),_0x40c73f['resetSearch']();}),_0x24c5c3;};}const Bo='<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>',Go='<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>',Fo='<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>',Ko=/* #__PURE__ -- @preserve */
28
- ((()=>({'chat':'AIChat','action':'AIActions'}))());class Wo extends _0x530ddf{static get['requires'](){return[_0xdcb2c0,as];}static get['pluginName'](){return'AIQuickActionsUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}async['init'](){const _0x18a984=await this['_getDefaultAndCustomActions']();this['_prepareQuickActionsDefinition'](_0x18a984),this['_initializeQuickActionsComponentsAndCommands']();}static['getDefaultQuickActions'](_0x2f18d0){return function(_0x1031e9){const _0x1e40bf=new Intl['DisplayNames'](['en'],{'type':'language'})['of'](_0x1031e9['uiLanguage']),_0x3c2911=_0x1e40bf||'English',_0x3f1a75=[{'id':'ask-ai','label':hs(_0x1031e9,'AI_QUICK_ACTIONS_ASK_AI'),'type':'chat','icon':_0xe57357},{'id':'chat-commands','label':hs(_0x1031e9,'AI_QUICK_ACTIONS_CHAT_COMMANDS'),'icon':_0xe57357,'actions':[{'id':'explain','label':hs(_0x1031e9,'AI_QUICK_ACTIONS_EXPLAIN'),'displayedPrompt':hs(_0x1031e9,'AI_QUICK_ACTIONS_EXPLAIN'),'prompt':Bo['replace']('%0',_0x3c2911),'type':'chat'},{'id':'summarize','label':hs(_0x1031e9,'AI_QUICK_ACTIONS_SUMMARIZE'),'displayedPrompt':hs(_0x1031e9,'AI_QUICK_ACTIONS_SUMMARIZE'),'prompt':Go['replace']('%0',_0x3c2911),'type':'chat'},{'id':'highlight-key-points','label':hs(_0x1031e9,'AI_QUICK_ACTIONS_HIGHLIGHT_KEY_POINTS'),'displayedPrompt':hs(_0x1031e9,'AI_QUICK_ACTIONS_HIGHLIGHT_KEY_POINTS'),'prompt':Fo['replace']('%0',_0x3c2911),'type':'chat'}]},{'id':'improve-writing','label':hs(_0x1031e9,'AI_QUICK_ACTIONS_IMPROVE_WRITING'),'type':'action','icon':_0xea0fb6},{'id':'continue','label':hs(_0x1031e9,'AI_QUICK_ACTIONS_CONTINUE_WRITING'),'type':'action','icon':_0x48586b},{'id':'fix-grammar','label':hs(_0x1031e9,'AI_QUICK_ACTIONS_FIX_GRAMMAR_SPELLING'),'type':'action','icon':_0x416a20},{'id':'adjust-length','label':hs(_0x1031e9,'AI_QUICK_ACTIONS_ADJUST_LENGTH'),'icon':_0xe2ea0c,'actions':[{'id':'make-shorter','label':hs(_0x1031e9,'AI_QUICK_ACTIONS_MAKE_SHORTER'),'type':'action'},{'id':'make-longer','label':hs(_0x1031e9,'AI_QUICK_ACTIONS_MAKE_LONGER'),'type':'action'}]},{'id':'change-tone','label':hs(_0x1031e9,'AI_QUICK_ACTIONS_CHANGE_TONE'),'icon':_0x5ec340,'actions':[{'id':'make-tone-casual','label':hs(_0x1031e9,'AI_QUICK_ACTIONS_MORE_CASUAL'),'type':'action'},{'id':'make-tone-direct','label':hs(_0x1031e9,'AI_QUICK_ACTIONS_MORE_DIRECT'),'type':'action'},{'id':'make-tone-friendly','label':hs(_0x1031e9,'AI_QUICK_ACTIONS_MORE_FRIENDLY'),'type':'action'},{'id':'make-tone-confident','label':hs(_0x1031e9,'AI_QUICK_ACTIONS_MORE_CONFIDENT'),'type':'action'},{'id':'make-tone-professional','label':hs(_0x1031e9,'AI_QUICK_ACTIONS_MORE_PROFESSIONAL'),'type':'action'}]},{'id':'translate','label':hs(_0x1031e9,'AI_QUICK_ACTIONS_TRANSLATE'),'icon':_0x142ddd,'actions':[{'id':'translate-to-english','label':hs(_0x1031e9,'AI_QUICK_ACTIONS_TRANSLATE_ENGLISH'),'type':'action','actionName':'translate','args':{'language':'english'}},{'id':'translate-to-chinese','label':hs(_0x1031e9,'AI_QUICK_ACTIONS_TRANSLATE_CHINESE'),'type':'action','actionName':'translate','args':{'language':'chinese'}},{'id':'translate-to-spanish','label':hs(_0x1031e9,'AI_QUICK_ACTIONS_TRANSLATE_SPANISH'),'type':'action','actionName':'translate','args':{'language':'spanish'}},{'id':'translate-to-german','label':hs(_0x1031e9,'AI_QUICK_ACTIONS_TRANSLATE_GERMAN'),'type':'action','actionName':'translate','args':{'language':'german'}},{'id':'translate-to-french','label':hs(_0x1031e9,'AI_QUICK_ACTIONS_TRANSLATE_FRENCH'),'type':'action','actionName':'translate','args':{'language':'french'}},{'id':'translate-to-japanese','label':hs(_0x1031e9,'AI_QUICK_ACTIONS_TRANSLATE_JAPANESE'),'type':'action','actionName':'translate','args':{'language':'japanese'}},{'id':'translate-to-portuguese','label':hs(_0x1031e9,'AI_QUICK_ACTIONS_TRANSLATE_PORTUGUESE'),'type':'action','actionName':'translate','args':{'language':'portuguese'}},{'id':'translate-to-korean','label':hs(_0x1031e9,'AI_QUICK_ACTIONS_TRANSLATE_KOREAN'),'type':'action','actionName':'translate','args':{'language':'korean'}},{'id':'translate-to-italian','label':hs(_0x1031e9,'AI_QUICK_ACTIONS_TRANSLATE_ITALIAN'),'type':'action','actionName':'translate','args':{'language':'italian'}},{'id':'translate-to-russian','label':hs(_0x1031e9,'AI_QUICK_ACTIONS_TRANSLATE_RUSSIAN'),'type':'action','actionName':'translate','args':{'language':'russian'}}]},{'id':'other','label':hs(_0x1031e9,'AI_QUICK_ACTIONS_OTHER'),'icon':_0x4acb19,'actions':[]}];return _0x3f1a75;}(_0x2f18d0);}async['_getDefaultAndCustomActions'](){const _0x1f5baf=Wo['getDefaultQuickActions'](this['editor']['locale']),_0x3f732d=this['editor']['config']['get']('ai.quickActions.extraCommands')||[];let _0x19028e,_0x55ea79=[];try{const _0x5db09b=new Fs({'connector':this['editor']['plugins']['get']('AIConnector'),'config':this['editor']['config']['get']('ai.models'),'locale':this['editor']['locale']});_0x55ea79=await _0x5db09b['getAll'](),_0x19028e=(await _0x5db09b['getDefault']())?.['id'];}catch(_0xf52209){const _0x54743e=new at('ai-quick-actions-models-unable-to-retrieve',this,{'error':_0xf52209});Et(_0x54743e['message']);}finally{const _0xff8f97=_0x3f732d['map'](_0xf44e7=>({..._0xf44e7,'type':'chat'===_0xf44e7['type']?'chat':'action','model':'chat'!==_0xf44e7['type']?_0xf44e7['model']||_0x19028e:_0xf44e7['model'],'icon':void 0x0}));_0x1f5baf['find'](_0x450dd9=>'other'===_0x450dd9['id'])['actions']['push'](..._0xff8f97),_0x1f5baf['forEach'](_0x48336b=>{if('actions'in _0x48336b)_0x48336b['actions']['forEach'](_0x5e6ab4=>{if(_0x5e6ab4['isEnabled']=!!_0x55ea79['find'](_0x4c413a=>_0x4c413a['id']===_0x5e6ab4['model'])||void 0x0===_0x5e6ab4['model'],!_0x5e6ab4['isEnabled']){const _0x760994=new at('ai-quick-actions-unavailable-model',this,{'actionId':_0x5e6ab4['id'],'modelId':_0x5e6ab4['model']});Et(_0x760994['message']);}});else{if(_0x48336b['isEnabled']=!!_0x55ea79['find'](_0x220d82=>_0x220d82['id']===_0x48336b['model'])||void 0x0===_0x48336b['model'],!_0x48336b['isEnabled']){const _0x2ca7d6=new at('ai-quick-actions-unavailable-model',this,{'actionId':_0x48336b['id'],'modelId':_0x48336b['model']});Et(_0x2ca7d6['message']);}}});}return _0x1f5baf;}['_initializeQuickActionsComponentsAndCommands'](){const _0x560370=new Qt(this['editor']['locale']);_0x560370['attachToDom'](),this['_initializeQuickActionsDropdown'](_0x560370),this['_initializeQuickActionsMenuBar'](),this['_initializeQuickActionsComponents'](_0x560370);}['_initializeQuickActionsDropdown'](_0x448d21){const _0x2f66a2=this['editor']['config']['get']('ai.quickActions.isSearchEnabled')??!0x0;this['editor']['ui']['componentFactory']['add']('aiQuickActions',Vo({'editor':this['editor'],'content':this['_quickActionsDefinition'],'buttonDefinition':{'icon':_0x208a91,'label':hs(this['editor']['locale'],'AI_QUICK_ACTIONS_HEADING')},'bodyCollection':_0x448d21,'hasSearch':_0x2f66a2}));}['_prepareQuickActionsDefinition'](_0xb34256){this['_quickActionsDefinition']=_0xb34256['map'](_0x46616e=>{if('actions'in _0x46616e){const _0x3bf991=_0x46616e;return{..._0x3bf991,'actions':_0x3bf991['actions']['map'](_0x45b022=>{const {actions:_0x3d7a44,..._0x181d41}=_0x3bf991;return{..._0x45b022,'parent':_0x181d41};})['filter'](_0x25310b=>this['_shouldIncludeAction'](_0x25310b))};}return _0x46616e;})['filter'](_0x318674=>'actions'in _0x318674?_0x318674['actions']['length']>0x0:this['_shouldIncludeAction'](_0x318674));}['_shouldIncludeAction'](_0x23d51a){const _0x1f6576=this['editor']['config']['get']('ai.quickActions.removeCommands')||[];return this['editor']['plugins']['has'](Ko[_0x23d51a['type']])&&!_0x1f6576['includes'](_0x23d51a['id'])&&!('chat'===_0x23d51a['type']&&!0x1===this['editor']['config']['get']('ai.chat.context.document.enabled'));}['_initializeQuickActionsComponents'](_0x429215){this['_quickActionsDefinition']['forEach'](_0x56afff=>{if('actions'in _0x56afff){const _0x3b790d=Vo({'editor':this['editor'],'content':_0x56afff['actions'],'buttonDefinition':_0x56afff,'bodyCollection':_0x429215});this['editor']['ui']['componentFactory']['add'](_0x56afff['id'],_0x3b790d),_0x56afff['actions']['forEach'](_0x1ced0a=>{const _0x49d4f3=Lo({'editor':this['editor'],'action':_0x1ced0a});this['editor']['ui']['componentFactory']['add'](_0x1ced0a['id'],_0x49d4f3);});}else{const _0x3f3174=Lo({'editor':this['editor'],'action':_0x56afff,'withText':!0x1,'withIcon':!0x0,'isInDropdown':!0x1});this['editor']['ui']['componentFactory']['add'](_0x56afff['id'],_0x3f3174);}});}['_initializeQuickActionsMenuBar'](){this['editor']['ui']['componentFactory']['add']('menuBar:aiQuickActions',_0x32033a=>{const _0x47015a=this['editor']['commands']['get']('aiQuickAction'),_0x3daf85=new Kt(_0x32033a),_0x385aa1=hs(_0x32033a,'AI_QUICK_ACTIONS_HEADING');_0x3daf85['buttonView']['set']({'label':_0x385aa1,'icon':_0x208a91});const _0xc4e58e=new $t(_0x32033a);return _0xc4e58e['set']({'ariaLabel':_0x385aa1,'role':'menu'}),this['_quickActionsDefinition']['forEach'](_0x23640e=>{if('actions'in _0x23640e){const _0x34789c=_0x23640e,_0xa14378=new qt(_0x32033a,_0x3daf85),_0x4cd9ff=new Kt(_0x32033a),_0x53632e=new $t(_0x32033a);_0x4cd9ff['buttonView']['set']({'label':_0x34789c['label'],'icon':_0x34789c['icon']}),_0x34789c['actions']['forEach'](_0x189cae=>{const _0x5050a1=new qt(_0x32033a,_0x4cd9ff),_0x2ba384=new Wt(_0x32033a);_0x2ba384['set']({'label':_0x189cae['label'],'icon':_0x189cae['icon'],'role':'menuitem','isEnabled':_0x189cae['isEnabled']}),_0x2ba384['on']('execute',()=>{this['_executeQuickAction'](_0x189cae);}),_0x2ba384['delegate']('execute')['to'](_0x4cd9ff),_0x5050a1['children']['add'](_0x2ba384),_0x53632e['items']['add'](_0x5050a1);}),_0x4cd9ff['panelView']['children']['add'](_0x53632e),_0xa14378['children']['add'](_0x4cd9ff),_0xc4e58e['items']['add'](_0xa14378);}else{const _0x2a7088=_0x23640e,_0x2527a1=new qt(_0x32033a,_0x3daf85),_0x546842=new Wt(_0x32033a);_0x546842['set']({'label':_0x2a7088['label'],'icon':_0x2a7088['icon'],'role':'menuitem','isEnabled':_0x2a7088['isEnabled']}),_0x546842['on']('execute',()=>{this['_executeQuickAction'](_0x2a7088);}),_0x546842['delegate']('execute')['to'](_0x3daf85),_0x2527a1['children']['add'](_0x546842),_0xc4e58e['items']['add'](_0x2527a1);}}),(Object['values'](Ko)['some'](_0x38347b=>this['editor']['plugins']['has'](_0x38347b))?_0x3daf85['bind']('isEnabled')['to'](_0x47015a):_0x3daf85['set']({'isEnabled':!0x1}),_0x3daf85['panelView']['children']['add'](_0xc4e58e),_0x3daf85);});}['_executeQuickAction'](_0x19d366){const _0x283f95=this['editor'];_0x283f95['editing']['view']['focus'](),_0x283f95['commands']['execute']('aiQuickAction',_0x19d366);const _0x3bee92=_0x283f95['ui']['view']['menuBarView'];_0x3bee92&&_0x3bee92['close']&&_0x3bee92['close']();}}class Yo extends _0x4eedb8{['execute'](_0x21d469){switch(this['_expandSelectionIfCollapsed'](),_0x21d469['type']){case'chat':if(!this['editor']['plugins']['has']('AIChat')){const _0x9b9924=hs(this['editor']['locale'],'AI_QUICK_ACTIONS_PLUGIN_NOT_FOUND','AIChat');throw new at('ai-quick-actions-plugin-not-found',this['editor'],{'errorMessage':_0x9b9924});}this['_handleAIChatAction'](_0x21d469);break;case'action':if(!this['editor']['plugins']['has']('AIActions')){const _0x15d9b2=hs(this['editor']['locale'],'AI_QUICK_ACTIONS_PLUGIN_NOT_FOUND','AIActions');throw new at('ai-quick-actions-plugin-not-found',this['editor'],{'errorMessage':_0x15d9b2});}this['_handleAIActionsAction'](_0x21d469);}}async['_handleAIChatAction'](_0x3927d3){const _0x231005=this['editor']['plugins']['get']('AIChatController'),_0x77b1fe=this['editor']['plugins']['get']('AITabs')['view'];if(_0x77b1fe['isVisible']||(_0x77b1fe['isVisible']=!0x0),'chat'!==_0x77b1fe['activeTab']&&_0x77b1fe['activateTab']('chat'),'ask-ai'===_0x3927d3['id'])_0x231005['removeSelectionFromChatContext'](),_0x231005['addSelectionToChatContext'](),_0x231005['focusPromptInput']();else await _0x231005['startConversation']({'modelId':_0x3927d3['model']}),_0x231005['removeSelectionFromChatContext'](),_0x231005['addSelectionToChatContext'](),_0x231005['focusPromptInput'](),await _0x231005['sendMessage']({'message':_0x3927d3['prompt']||_0x3927d3['displayedPrompt']||_0x3927d3['label'],'attributes':{'quickActionData':{'id':_0x3927d3['id']},'displayedPrompt':_0x3927d3['displayedPrompt']}});}['_expandSelectionIfCollapsed'](){const _0x1659f7=this['editor'],_0x452634=_0x1659f7['model']['document']['selection'];if(!_0x452634['isCollapsed'])return;const _0x2efc76=At(_0x452634['getSelectedBlocks']())||_0x1659f7['model']['schema']['getLimitElement'](_0x452634);_0x1659f7['model']['change'](_0x280c78=>{_0x280c78['setSelection'](_0x2efc76,'in');});}['_handleAIActionsActionLabel'](_0x1495c8){return _0x1495c8['parent']?.['label']&&'other'!==_0x1495c8['parent']?.['id']?_0x1495c8['parent']['label']+':\x20'+_0x1495c8['label']:_0x1495c8['label'];}async['_handleAIActionsAction'](_0x25c5df){const _0x1302c1=this['editor']['plugins']['get']('AIActions'),_0x4cdcd4=_0x25c5df['prompt']?{'userMessage':_0x25c5df['prompt'],'model':_0x25c5df['model']}:{'actionName':_0x25c5df['actionName']||_0x25c5df['id'],'args':_0x25c5df['args']},_0x37ab35=this['_handleAIActionsActionLabel'](_0x25c5df);await _0x1302c1['executeAction'](_0x4cdcd4,_0x37ab35,_0x25c5df['icon']);}}class $o extends _0x530ddf{static get['pluginName'](){return'AIQuickActionsEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const _0x3bb1d4=this['editor'],_0x120845=new Yo(this['editor']);if(_0x3bb1d4['commands']['add']('aiQuickAction',_0x120845),_0x3bb1d4['plugins']['has']('AIChat')){const _0x17c34e=this['editor']['plugins']['get']('AIChatController');_0x3bb1d4['model']['document']['selection']['on']('change:range',(_0x52809f,_0x230ef5)=>{_0x230ef5['directChange']&&_0x17c34e['removeSelectionFromChatContext']();});}}}class qo extends xs{['updateChangeGroups'](){if(this['parsedMergedContent']=this['parsedContent']['cloneNode'](!0x0),0x0==this['parsedMergedContent']['childNodes']['length'])return void(this['changeGroups']=[]);const _0x14025b=this['documentContextContent']['children']['map'](_0x501e63=>({'node':_0x501e63,'id':Es(_0x501e63,'data-id')})),_0x3eecbe=this['parsedMergedContent']['children']['map'](_0x1ba42c=>({'node':_0x1ba42c,'id':Es(_0x1ba42c,'data-id')||ot()})),_0x2e6ded=_0x2d6820(_0x14025b,_0x3eecbe,{'comparator':(_0x1312db,_0x2b188e)=>_0x1312db['id']==_0x2b188e['id'],'oneChangePerToken':!0x0});if(!this['isDone']||!this['isComplete']){for(;_0x2e6ded['length']&&_0x2e6ded[_0x2e6ded['length']-0x1]['removed'];)_0x2e6ded['pop']();}const _0x2757c8=_0x2e6ded['map'](_0xd7251a=>{const _0x3f7e7a=_0xd7251a['added']?'new':_0xd7251a['removed']?'removed':'modified';return{'node':_0xd7251a['value'][0x0]['node'],'type':_0x3f7e7a,'id':_0xd7251a['value'][0x0]['id']};});this['changeGroups']=[{'changes':_0x2757c8,'state':'pending','index':0x0}];}['_getDifferentChangeGroups'](_0x5a3292,_0x53f511){return _0x53f511;}}class Qo extends Ds{['content'];['version'];['actionName'];['args'];['userMessage'];['model'];['hasError']=!0x1;['stoppedExplicitly']=!0x1;constructor(_0x57117f){super(_0x57117f),this['content']=_0x57117f['content'],this['version']=_0x57117f['version'],this['actionName']=_0x57117f['actionName'],this['args']=_0x57117f['args'],this['userMessage']=_0x57117f['userMessage'],this['model']=_0x57117f['model'],this['on']('interactionStopped',()=>{this['stoppedExplicitly']=!0x0;});}async['sendRequest'](){return this['actionName']?this['connector']['executeAction']({'content':this['content'],'actionName':this['actionName'],'args':this['args']}):this['connector']['executeCustomAction']({'content':this['content'],'message':this['userMessage'],'model':this['model'],'outputFormat':'html'});}['getDocumentContext'](){return{'type':'text','content':this['content'],'version':this['version'],'label':'Current\x20document','uiId':'current-document'};}['createReply'](_0x221e6a){const _0x25040d=new qo({'locale':this['locale'],'documentContextContent':this['content'],..._0x221e6a});return this['replies']['push'](_0x25040d),_0x25040d['delegate'](...Ls)['to'](this),this['fire']('replyCreated',_0x25040d),_0x25040d;}}class Xo extends kt{constructor(_0x1f771e,_0x52e995=!0x0,_0x50e244=!0x0){super(_0x1f771e),this['set']('isEnabled',!0x1),_0x52e995&&(this['applyButton']=this['_createButton'](hs(_0x1f771e,'AI_BALLOON_APPLY_BUTTON'),cs),this['applyButton']['bind']('isEnabled')['to'](this),this['items']['add'](this['applyButton'])),_0x50e244&&(this['suggestButton']=this['_createButton'](hs(_0x1f771e,'AI_BALLOON_SUGGEST_BUTTON'),_0x52e995?ls:cs),this['suggestButton']['bind']('isEnabled')['to'](this),this['items']['add'](this['suggestButton'])),this['setButtonsVisibility']({'showApplyButton':_0x52e995,'showSuggestButton':_0x50e244}),this['extendTemplate']({'attributes':{'class':['ck-ai-balloon__toolbar']}});}['setButtonsVisibility']({showApplyButton:_0x509778,showSuggestButton:_0x235a93}){this['applyButton']&&(this['applyButton']['isVisible']=_0x509778),this['suggestButton']&&(this['suggestButton']['isVisible']=_0x235a93);}['_createButton'](_0x28ee45,_0x11e3c7){const _0x2d0630=new Nt(this['locale']);return _0x2d0630['set']({'label':_0x28ee45,'class':_0x11e3c7,'isVisible':!0x0,'withText':!0x0}),_0x2d0630;}}class zo extends vt{constructor(_0x157ba0){super(_0x157ba0),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-balloon__disclaimer']},'children':[{'tag':'p','attributes':{'class':['ck','ck-ai-balloon__disclaimer-content']},'children':[{'text':hs(_0x157ba0,'AI_DISCLAIMER_TEXT')}]}]});}}class jo extends vt{constructor(_0x1fd107){super(_0x1fd107),this['set']('isVisible',!0x0);const _0x4a1559=new yn('small');_0x4a1559['isVisible']=!0x0;const _0x15e779=new vt(this['locale']);_0x15e779['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai-suggestion__loader-text']},'children':[hs(this['locale'],'AI_CHAT_IS_WRITING')]}),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__loader',this['bindTemplate']['if']('isVisible','ck-hidden',_0x9ce789=>!_0x9ce789)]},'children':[_0x4a1559,_0x15e779]});}}class Jo extends So{['focusCycler'];['_config'];['_contentWrapper'];['_streamableContentView'];['_toolbarView'];['_miniToolbarView'];['_loaderView'];['_disclaimerView'];['_focusTracker'];['_keystrokes'];['_dialogContent'];['_focusables'];['_scrollManager'];['_navigationPreviousButton'];['_navigationNextButton'];['_navigationTryAgainButton'];['_navigationCounter'];constructor(_0x44ae16,_0x16c7fe){super(_0x44ae16),this['set']('isBusy',!0x1),this['set']('isTrackChangesOn',!0x1),this['set']('_isLoading',!0x1),this['set']('_hasError',!0x1),this['_config']=_0x16c7fe,this['_focusTracker']=new _t(),this['_keystrokes']=new gt(),this['_focusables']=this['createCollection'](),this['focusCycler']=new Ut({'focusables':this['_focusables'],'focusTracker':this['_focusTracker'],'keystrokeHandler':this['_keystrokes'],'actions':{'focusPrevious':'shift\x20+\x20tab','focusNext':'tab'}}),this['_dialogContent']=new _0x211f24(),this['_addContentWrapper'](_0x16c7fe),this['_addDisclaimerView'](),this['_addToolbar'](_0x16c7fe),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'](_0x16c7fe);});}['render'](){super['render']();for(const _0x38b2db of this['_focusables'])this['_focusTracker']['add'](_0x38b2db['element']);this['_keystrokes']['listenTo'](this['element']),this['_initializeScrollManager']();}['destroy'](){super['destroy'](),this['_scrollManager']&&this['_scrollManager']['destroy']();}['focus'](_0x4c9559){-0x1===_0x4c9559?this['focusCycler']['focusLast']():this['focusCycler']['focusFirst']();}['setIsLoading'](_0x17153b){this['_isLoading']=_0x17153b;}['setErrorState'](){this['_hasError']=!0x0,this['_miniToolbarView']['toggleShowChangesEnabled'](!0x1);}['clearErrorState'](){this['_hasError']=!0x1,this['_miniToolbarView']['toggleShowChangesEnabled'](!0x0);}['showError'](_0xb108aa){super['showError'](_0xb108aa),this['_dialogContent']['has'](this['_errorView'])||this['_dialogContent']['add'](this['_errorView'],0x0);}['hideError'](){super['hideError'](),this['clearErrorState']();}['showBlockingError'](_0x27c46e){super['showBlockingError'](_0x27c46e),this['setErrorState']();}['addMiniToolbarItem'](_0x19f83a){this['_miniToolbarView']['items']['has'](_0x19f83a)||this['_miniToolbarView']['items']['add'](_0x19f83a);}['removeMiniToolbarItem'](_0x3b7bc1){this['_miniToolbarView']['items']['has'](_0x3b7bc1)&&this['_miniToolbarView']['items']['remove'](_0x3b7bc1);}['showLoader'](){this['_loaderView']&&(this['_isLoading']=!0x0);}['hideLoader'](){this['_loaderView']&&(this['_isLoading']=!0x1);}['_toggleToolbarButtonsVisibility']({showApplyButton:_0x549bea,showSuggestButton:_0x5e8d7a}){_0x549bea=_0x549bea&&!this['isTrackChangesOn']&&this['_config']['availableActions']['includes']('applySuggestion'),_0x5e8d7a=_0x5e8d7a&&this['_config']['availableActions']['includes']('insertSuggestion'),this['_toolbarView']['setButtonsVisibility']({'showApplyButton':_0x549bea,'showSuggestButton':_0x5e8d7a});}async['updateContent'](_0x5646fb){await this['_streamableContentView']['update'](_0x5646fb);}['clearContent'](){this['_streamableContentView']['clear']();}['_addContentWrapper'](_0x151aac){this['_contentWrapper']=new vt(this['locale']),this['_contentWrapper']['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-actions-balloon-content']},'children':[{'tag':'div','attributes':{'class':['ck-ai-actions-balloon-content-wrapper']},'children':[this['_createLoaderView'](),this['_createStreamableContentView']()]},this['_createMiniToolbar'](_0x151aac['miniToolbarConfig'])]}),this['_dialogContent']['add'](this['_contentWrapper']);}['_addDisclaimerView'](){this['_disclaimerView']=new zo(this['locale']),this['_dialogContent']['add'](this['_disclaimerView']);}['_addToolbar']({showApplyButton:_0xe7c6a8,showSuggestButton:_0x5c4fd5}){this['_toolbarView']=new Xo(this['locale'],_0xe7c6a8,_0x5c4fd5),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',(_0x50c99e,_0x102939,_0x399472)=>!(_0x50c99e||_0x102939||_0x399472)),this['_toggleToolbarButtonsVisibility']({'showApplyButton':_0xe7c6a8,'showSuggestButton':_0x5c4fd5}),this['_dialogContent']['add'](this['_toolbarView']);}['_createMiniToolbar'](_0x187b21){return this['_miniToolbarView']=new ko(this['locale'],_0x187b21),this['_miniToolbarView']['delegate'](...Zs)['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',(_0x54d35f,_0x532965)=>!(_0x54d35f||_0x532965)),this['_miniToolbarView'];}['_createLoaderView'](){return this['_loaderView']=new jo(this['locale']),this['_loaderView']['bind']('isVisible')['to'](this,'_isLoading'),this['_loaderView'];}['_createStreamableContentView'](){return this['_streamableContentView']=new In(this['locale']),this['_streamableContentView'];}['_setupMiniToolbarButtons'](){const _0x1d97e2=new Nt(this['locale']),_0x12b40a=new Nt(this['locale']),_0xb8a702=new Zo(this['locale']),_0xea042f=new Nt(this['locale']);_0x1d97e2['set']({'icon':tt,'label':hs(this['locale'],'AI_ACTIONS_TRY_AGAIN'),'tooltip':!0x0,'class':'ck-ai-custom-action-button\x20'+us}),_0x12b40a['set']({'icon':_0x4021b,'tooltip':hs(this['locale'],'AI_ACTIONS_PREVIOUS_INTERACTION'),'class':'ck-ai-navigation-button\x20ck-ai-previous-button\x20'+us}),_0xea042f['set']({'icon':et,'tooltip':hs(this['locale'],'AI_ACTIONS_NEXT_INTERACTION'),'class':'ck-ai-navigation-button\x20ck-ai-next-button\x20'+us}),_0x1d97e2['bind']('isEnabled')['to'](this,'isBusy',_0x423fd1=>!_0x423fd1),_0x1d97e2['on']('execute',()=>{this['fire']('tryAgain');}),_0x12b40a['bind']('isEnabled')['to'](this,'isBusy',_0x4eb14c=>!_0x4eb14c),_0x12b40a['on']('execute',()=>{this['fire']('showPrevious');}),_0xea042f['bind']('isEnabled')['to'](this,'isBusy',_0x1d0edf=>!_0x1d0edf),_0xea042f['on']('execute',()=>{this['fire']('showNext');}),this['_navigationPreviousButton']=_0x12b40a,this['_navigationCounter']=_0xb8a702,this['_navigationNextButton']=_0xea042f,this['_navigationTryAgainButton']=_0x1d97e2;}['updateMiniToolbarButtons'](_0x774a31,_0x32f5d1){this['_navigationPreviousButton']||this['_setupMiniToolbarButtons']();const _0x53cdc7=_0x774a31>0x1;if(this['addMiniToolbarItem'](this['_navigationTryAgainButton']),_0x53cdc7){this['addMiniToolbarItem'](this['_navigationPreviousButton']),this['addMiniToolbarItem'](this['_navigationCounter']),this['addMiniToolbarItem'](this['_navigationNextButton']);const _0xf66d9a=_0x774a31-_0x32f5d1;this['_navigationCounter']['setInteractionCount'](_0xf66d9a+'/'+_0x774a31),this['_navigationPreviousButton']['isEnabled']=_0x32f5d1<_0x774a31-0x1,this['_navigationNextButton']['isEnabled']=_0x32f5d1>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'](_0x1a21ee){this['_isLoading']=_0x1a21ee;}['resetShowChangesButton'](){this['_miniToolbarView']['isShowChangesOn']=!0x1;}['_initializeScrollManager'](){const _0x30e343=this['_getScrollableElement']();_0x30e343&&!this['_scrollManager']&&(this['_scrollManager']=new sr(_0x30e343));}['_getScrollableElement'](){return this['_streamableContentView']['element'];}}class Zo extends vt{constructor(_0x76f2c7){super(_0x76f2c7);const _0x5834c5=this['bindTemplate'];this['set']('interactionCount','1/1'),this['setTemplate']({'tag':'span','attributes':{'class':['ck-ai-interaction-counter']},'children':[{'text':_0x5834c5['to']('interactionCount')}]});}['setInteractionCount'](_0x333477){this['set']('interactionCount',_0x333477);}}class ta extends _0x530ddf{static get['requires'](){return[as,Bt,Js,Oo,_0x180035];}static get['pluginName'](){return'AIActions';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['_aiConnector'];['_interactions']=[];['_currentInteractionIndex']=0x0;['_interactionParams'];['_balloonShowDiff']=!0x1;['_promiseQueue'];['_bodyCollection'];get['_interaction'](){return this['_interactions'][this['_interactions']['length']-0x1];}['_actionsBalloonView'];constructor(_0x23228e){super(_0x23228e),this['_bodyCollection']=new Qt(this['editor']['locale']),this['_bodyCollection']['attachToDom'](),this['_aiConnector']=this['editor']['plugins']['get']('AIConnector'),this['set']('isBusy',!0x1),this['_promiseQueue']=new Cn();}['stopInteraction'](){this['_stopInteraction']();}async['executeAction'](_0x30f410,_0x56d0dc,_0x29e02d){if(this['_stopInteraction'](),this['editor']['plugins']['has']('TableSelection')){if(this['editor']['plugins']['get']('TableSelection')['getSelectedTableCells']()){const {modelFragment:_0x387c83,anchorData:_0xd0930f,root:_0x276a1b}=this['_getExecuteDataInTable']();return this['_executeAction'](_0x30f410,_0x387c83,_0xd0930f,_0x276a1b,_0x56d0dc,_0x29e02d);}}const {modelFragment:_0x18c6ec,anchorData:_0xd53bba,root:_0x2f4b45}=this['_getExecuteDataRegular']();return this['_executeAction'](_0x30f410,_0x18c6ec,_0xd53bba,_0x2f4b45,_0x56d0dc,_0x29e02d);}async['destroy'](){return this['_stopInteraction'](),this['_bodyCollection']['detachFromDom'](),super['destroy']();}['_createActionsBalloonView'](){const _0x17e8a0=this['editor']['plugins']['has']('TrackChanges');let _0x45e3f=this['editor']['config']['get']('ai.availableReplyActions')||[...fn];_0x17e8a0||(_0x45e3f=_0x45e3f['filter'](_0x535e35=>'insertSuggestion'!=_0x535e35));const _0x4d79a9=this['editor']['commands']['get']('trackChanges'),_0x256823=new Jo(this['editor']['locale'],{'showApplyButton':!0x0,'showSuggestButton':_0x17e8a0,'miniToolbarConfig':{'showChanges':'icon'},'availableActions':_0x45e3f});return _0x256823['bind']('isBusy')['to'](this),_0x4d79a9&&_0x256823['bind']('isTrackChangesOn')['to'](_0x4d79a9,'value'),_0x256823['on']('tryAgain',()=>{this['_refreshInteraction']();}),_0x256823['on']('showPrevious',()=>{this['_navigateToPrevious']();}),_0x256823['on']('showNext',()=>{this['_navigateToNext']();}),_0x256823;}['_getExecuteDataRegular'](){const _0x130775=this['editor']['model']['document']['selection'],_0x37275a=_0x130775['getFirstRange']()['start']['root'];if(_0x130775['isCollapsed']){const _0x49deb0=At(_0x130775['getSelectedBlocks']())||this['editor']['model']['schema']['getLimitElement'](_0x130775);this['editor']['model']['change'](_0x378cb9=>{_0x378cb9['setSelection'](_0x49deb0,'in');});}const _0x101573=_0x130775['getFirstRange'](),_0x25d104=this['_wrapWithCommonAncestors'](this['editor']['model']['getSelectedContent'](_0x130775),_0x101573['start'],_0x101573['end']);this['_copyMarkersToFragment'](_0x25d104,_0x130775,{'isTableSelection':!0x1});const _0x390325=_0x130775['getFirstRange']()['start'],_0x6efef9=new Map();let _0x24d6b1=_0x25d104;for(let _0x16e2d3=0x0;_0x16e2d3<_0x390325['path']['length'];_0x16e2d3++)_0x6efef9['set'](_0x24d6b1,_0x390325['path'][_0x16e2d3]),_0x24d6b1=_0x24d6b1['getChild'](0x0);return{'modelFragment':_0x25d104,'anchorData':_0x6efef9,'root':_0x37275a};}['_getExecuteDataInTable'](){const _0xd94fba=this['editor']['model']['document']['selection'],_0x2c6539=this['editor']['plugins']['get']('TableSelection'),_0x140629=_0xd94fba['getFirstRange']()['start']['root'],_0x4edb5d=_0x2c6539['getSelectionAsFragment'](),_0x368d79=_0xd94fba['getFirstRange']()['start']['parent']['parent'],_0x4877b4=this['editor']['model']['createRange'](this['editor']['model']['createPositionBefore'](_0x368d79),this['editor']['model']['createPositionAfter'](_0x368d79)),_0x2864c8=this['_wrapWithCommonAncestors'](_0x4edb5d,_0x4877b4['start'],_0x4877b4['end']);this['_copyMarkersToFragment'](_0x2864c8,_0xd94fba,{'isTableSelection':!0x0});const _0x4a501b=_0xd94fba['getFirstRange']()['start'],_0x12d159=new Map();let _0x54a6b4=_0x2864c8;for(let _0x4d18af=0x0;_0x4d18af<_0x4a501b['path']['length'];_0x4d18af++)if(_0x12d159['set'](_0x54a6b4,_0x4a501b['path'][_0x4d18af]),_0x4d18af<_0x4a501b['path']['length']-0x1)_0x54a6b4=_0x54a6b4['getChild'](0x0);else{let _0x1bb32b=_0x54a6b4['nextSibling'];for(;_0x1bb32b;)_0x12d159['set'](_0x1bb32b,_0x4a501b['path'][_0x4d18af]),_0x1bb32b=_0x1bb32b['nextSibling'];}return{'modelFragment':_0x2864c8,'anchorData':_0x12d159,'root':_0x140629};}async['_executeAction'](_0x4b835d,_0xbf9f1,_0x558955,_0x456b41,_0x91ae26,_0x55cb1f){const _0x2d38c3=this['editor']['plugins']['get'](Js),_0x3f261f=this['editor']['plugins']['get'](Oo),_0x5e66ee=this['editor']['model']['document']['selection'],_0x13f2a7=await _0x2d38c3['modelToDataWithIds'](_0xbf9f1),_0x5f0d60=this['editor']['model']['document']['version'],_0x2566b7=[..._0x5e66ee['getRanges']()];return this['_actionsBalloonView']||(this['_actionsBalloonView']=this['_createActionsBalloonView']()),this['_clearInteractionHistory'](),this['_clearErrorState'](),this['_balloonShowDiff']=!0x1,this['_actionsBalloonView']['resetShowChangesButton'](),this['_actionsBalloonView']['clearContent'](),_0x3f261f['open']({'index':0x3e8*Math['random']()%0x3e8,'title':_0x91ae26,'icon':_0x55cb1f||_0x208a91,'mainView':this['_actionsBalloonView'],'class':'ck-ai-actions-balloon','ranges':_0x2566b7,'id':'aiActionsBalloon'}),this['_setLoadingState'](),this['stopListening'](this['_actionsBalloonView']),this['stopListening'](_0x3f261f),this['_interactionParams']={'action':_0x4b835d,'content':_0x13f2a7,'version':_0x5f0d60,'aiBalloon':_0x3f261f,'modelFragment':_0xbf9f1,'anchorData':_0x558955,'root':_0x456b41},this['_setupApplyListeners'](),this['listenTo'](_0x3f261f,'selectionRemoved',()=>{this['_stopInteraction'](),this['_actionsBalloonView']['disableMiniToolbarButtons']();}),this['listenTo'](_0x3f261f,'dialogClosed',(_0x8a3882,{id:_0x3e4f73})=>{if('aiActionsBalloon'===_0x3e4f73){for(const _0x5ca162 of this['_interactions']){if(0x0===_0x5ca162['replies']['length']||_0x5ca162['stoppedExplicitly'])continue;const _0x17c530=_0x5ca162['replies'][_0x5ca162['replies']['length']-0x1],_0x4c17de=_0x17c530['changeGroups'][0x0];_0x4c17de&&'pending'===_0x4c17de['state']&&_0x17c530['setChangeGroupState'](0x0,'rejected');}this['_stopInteraction'](),this['_clearInteractionHistory'](),this['stopListening'](this['_actionsBalloonView']),this['stopListening'](_0x3f261f);}}),this['_createInteraction'](_0x13f2a7,_0x5f0d60,_0x3f261f,_0x4b835d);}['_setupApplyListeners'](){if(!this['_interactionParams'])return;const {modelFragment:_0x47c707,anchorData:_0xd885e2,root:_0x21fd66}=this['_interactionParams'];this['listenTo'](this['_actionsBalloonView'],'applySuggestion',()=>{this['_applyChanges'](_0x47c707,_0xd885e2,_0x21fd66,!0x1);}),this['listenTo'](this['_actionsBalloonView'],'insertSuggestion',()=>{this['_applyChanges'](_0x47c707,_0xd885e2,_0x21fd66,!0x0);});}['_wrapWithCommonAncestors'](_0x21283d,_0x30c8d3,_0x530b13){const _0x5cd4ba=this['editor']['model']['createRange'](_0x30c8d3,_0x530b13)['getCommonAncestor'](),_0x3e8fd4=_0x5cd4ba['is']('documentFragment')?[]:_0x5cd4ba['getAncestors']({'includeSelf':!0x0})['slice'](0x1);if(_0x3e8fd4['length']){const _0x15c049=_0x3e8fd4['map'](_0x5e3014=>_0x5e3014['_clone'](!0x1));for(let _0x55b7da=0x1;_0x55b7da<_0x15c049['length'];_0x55b7da++)_0x15c049[_0x55b7da-0x1]['_appendChild'](_0x15c049[_0x55b7da]);return _0x15c049[_0x15c049['length']-0x1]['_appendChild'](_0x21283d),new _0x162fe9(_0x15c049[0x0]);}return _0x21283d;}['_copyMarkersToFragment'](_0x4ab962,_0x1adef9,_0x4ed891={'isTableSelection':!0x1}){const _0x4efc65=this['editor']['model'],_0x4ec052=Array['from'](_0x1adef9['getRanges']()),_0x5b64ee=_0x1adef9['getFirstRange']()['start'];for(const _0x481dc8 of _0x4efc65['markers']){if(_0x481dc8['name']['startsWith'](zs)||!_0x481dc8['affectsData'])continue;const _0x571a5c=_0x481dc8['getRange']();if(!_0x4ec052['some'](_0x4178e2=>_0x4178e2['containsRange'](_0x571a5c,!0x0)))continue;const _0x206199=this['_regularCalculateMarkerPath'](_0x571a5c['start'],_0x5b64ee,_0x4ed891['isTableSelection']),_0x41cc60=this['_regularCalculateMarkerPath'](_0x571a5c['end'],_0x5b64ee,_0x4ed891['isTableSelection']),_0x4015bc=_0x4efc65['createPositionFromPath'](_0x4ab962,_0x206199),_0x212f05=_0x4efc65['createPositionFromPath'](_0x4ab962,_0x41cc60);if(!_0x4015bc['isEqual'](_0x212f05)){const _0x5436f7=_0x4efc65['createRange'](_0x4015bc,_0x212f05);_0x4ab962['markers']['set'](_0x481dc8['name'],_0x5436f7);}}}['_regularCalculateMarkerPath'](_0x79b181,_0x482f86,_0x147eb1=!0x1){const _0x3af4f1=[..._0x79b181['path']['slice']()];for(let _0x2859c9=0x0;_0x2859c9<Math['max'](_0x482f86['path']['length'],_0x79b181['path']['length']);_0x2859c9++){const _0x25f64e=_0x482f86['path'][_0x2859c9]||0x0,_0x5ab44f=(_0x79b181['path'][_0x2859c9]||0x0)-_0x25f64e;if(_0x3af4f1[_0x2859c9]=_0x5ab44f,0x0!==_0x5ab44f&&!_0x147eb1)break;}return _0x3af4f1;}async['_createInteraction'](_0x328a1b,_0x12cb66,_0x206331,_0x12fd5b){const _0x1dcc52=this['editor'];this['_interactionParams']||(this['_interactionParams']={'action':_0x12fd5b,'content':_0x328a1b,'version':_0x12cb66,'aiBalloon':_0x206331,'modelFragment':this['editor']['model']['getSelectedContent'](this['editor']['model']['document']['selection']),'anchorData':new Map(),'root':this['editor']['model']['document']['selection']['getFirstRange']()['start']['root']});const _0x213990=new Qo({'connector':this['_aiConnector'],'locale':_0x1dcc52['locale'],'content':_0x328a1b,'version':_0x12cb66,..._0x12fd5b});this['_interactions']['push'](_0x213990);const _0x319013=(_0x402f89,_0x58af20=!0x1,_0x2a91c4='streaming')=>this['_promiseQueue']['enqueue'](async _0x49be29=>{try{const _0x61db9d=Rs({'editor':_0x1dcc52,'changeGroups':_0x402f89['changeGroups'],'documentContextContent':_0x402f89['documentContextContent'],'showDiff':_0x58af20,'trimUnchanged':!0x1});_0x61db9d['length']&&await this['_actionsBalloonView']['updateContent']({'part':_0x61db9d[0x0],'renderingStrategy':_0x2a91c4,'abortSignal':_0x49be29});}catch(_0x3a7f9a){if(this['_isAbortError'](_0x3a7f9a))return;throw _0x3a7f9a;}});_0x213990['on']('replyCreated',(_0x4a8848,_0x4aebdc)=>{this['_actionsBalloonView']['hideLoader'](),this['_actionsBalloonView']['startAutoScroll'](),_0x319013(_0x4aebdc)['catch'](_0x5e8f74=>{this['_isAbortError'](_0x5e8f74)||(console['error']('Error\x20updating\x20content\x20in\x20replyCreated:',_0x5e8f74),this['_setErrorState'](_0x213990));});}),_0x213990['on']('replyContentUpdated',(_0xfd0cb6,_0x24f32a)=>{_0x319013(_0x24f32a)['catch'](_0x294761=>{this['_isAbortError'](_0x294761)||(console['error']('Error\x20updating\x20content\x20in\x20replyContentUpdated:',_0x294761),this['_setErrorState'](_0x213990));});}),_0x213990['on']('interactionFinished',async()=>{try{await this['_clearLoadingState'](),this['_actionsBalloonView']['updateMiniToolbarButtons'](this['_interactions']['length'],this['_currentInteractionIndex']),await this['_promiseQueue']['queueEmptyPromise'];}catch(_0xe27f90){this['_isAbortError'](_0xe27f90)||(console['error']('Error\x20clearing\x20loading\x20state\x20in\x20interactionFinished:',_0xe27f90),this['_setErrorState'](_0x213990));}finally{this['_actionsBalloonView']['stopAutoScroll']();}}),this['listenTo'](this['_actionsBalloonView'],'toggleSuggestionDisplayMode',async(_0x31b8e8,{showDiff:_0x5eaaa1})=>{try{this['_balloonShowDiff']=_0x5eaaa1;const _0x405165=this['_interaction']['replies'][this['_interaction']['replies']['length']-0x1];_0x405165&&await _0x319013(_0x405165,_0x5eaaa1,'static');}catch(_0x5bc3c7){this['_isAbortError'](_0x5bc3c7)||(console['error']('Error\x20updating\x20content\x20in\x20toggleSuggestionDisplayMode:',_0x5bc3c7),this['_setErrorState'](_0x213990));}}),_0x213990['on']('replyChangeGroupStateUpdated',()=>{const _0x6ce9cd={'positiveCount':_0x213990['replies']['reduce']((_0x329272,_0xd2885a)=>_0x329272+_0xd2885a['changeGroups']['filter'](_0x225b2a=>'accepted'===_0x225b2a['state'])['length'],0x0),'totalCount':_0x213990['replies']['reduce']((_0x4ad652,_0x3c0a60)=>_0x4ad652+_0x3c0a60['changeGroups']['length'],0x0)},_0x2bd358=_0x213990['actionCallId'],_0x227712=_0x213990['actionName'];_0x227712?this['_aiConnector']['upsertAIActionRating'](_0x227712,_0x2bd358,_0x6ce9cd):this['_aiConnector']['upsertCustomAIActionRating'](_0x2bd358,_0x6ce9cd);}),this['_setLoadingState']();try{const _0x2689b0=await _0x213990['start']();return this['_actionsBalloonView']['updateMiniToolbarButtons'](this['_interactions']['length'],this['_currentInteractionIndex']),_0x2689b0;}catch(_0x20f648){if(this['_isAbortError'](_0x20f648))return;this['_actionsBalloonView']['hideLoader'](),this['_setErrorState'](_0x213990);}}['_applyChanges'](_0x103322,_0x3512d8,_0x4d005f,_0x17e75f){const _0x272566=this['editor'];if(_0x17e75f&&!_0x272566['plugins']['has']('TrackChanges'))throw new at('ai-no-track-changes',null);const _0x56ecf2=this['editor']['plugins']['get'](_0x180035),_0x4a9421=this['_interactions'][this['_interactions']['length']-0x1-this['_currentInteractionIndex']];if(!_0x4a9421||!_0x4a9421['replies']['length'])return;const _0x577ddc=_0x4a9421['replies'][_0x4a9421['replies']['length']-0x1],_0x4d47b1=_0x577ddc['changeGroups'];_0x577ddc['setChangeGroupState'](0x0,'accepted');let _0x481529=qs({'editor':_0x272566,'reply':_0x577ddc,'interaction':_0x4a9421,'groups':_0x4d47b1,'transform':!0x1,'documentCompare':_0x56ecf2,'documentCompareOptions':{'anchor':_0x272566['model']['createPositionAt'](_0x103322,0x0),'markDeletions':_0x17e75f}});_0x481529=this['_filterOperationsOutsideRange'](_0x481529,_0x3512d8);for(const _0x1aeb1c of _0x481529)this['_anchorOperation'](_0x3512d8,_0x1aeb1c,_0x4d005f);const _0xa54473=_0x4a9421['getDocumentContext']()['version'],_0x398a17=_0x272566['model']['document']['history']['getOperations'](_0xa54473),_0x2f7931={'document':_0x272566['model']['document'],'useRelations':!0x1,'padWithNoOps':!0x1},_0x10d999=_0x630f28(_0x481529,_0x398a17,_0x2f7931)['operationsA'];_0x272566['model']['change'](_0x15c8a4=>{if(_0x15c8a4['setSelection'](_0x272566['model']['document']['selection']['focus']),_0x17e75f)_0x272566['plugins']['get']('TrackChangesEditing')['_applyOperationsAsSuggestions'](_0x10d999);else{for(const _0x4694be of _0x10d999)_0x4694be['baseVersion']=_0x272566['model']['document']['version'],Qs(_0x272566,_0x4694be),_0x15c8a4['batch']['addOperation'](_0x4694be),_0x272566['model']['applyOperation'](_0x4694be);}}),this['editor']['plugins']['get']('AIBalloon')['close']();}['_filterOperationsOutsideRange'](_0x4f5459,_0x29811d){return _0x4f5459['filter'](_0x494d6f=>{if('rename'==_0x494d6f['type']){const _0xa6204=_0x494d6f['position']['nodeAfter'];return!_0x29811d['has'](_0xa6204);}if(_0x494d6f['type']['indexOf']('Attribute')>-0x1){const _0x4e8869=_0x494d6f['range']['start']['nodeAfter'];return!_0x29811d['has'](_0x4e8869);}return!0x0;});}['_anchorOperation'](_0x1bc2bd,_0x429df1,_0x23a8ed){const _0x2694ed=_0x429df1['clone']();for(const _0x3a59e8 in _0x429df1){const _0x11e88e=_0x429df1[_0x3a59e8];_0x11e88e instanceof _0x1cef76?_0x429df1[_0x3a59e8]=new _0x1cef76(_0x577f3f(_0x11e88e['start']),_0x577f3f(_0x11e88e['end'])):_0x11e88e instanceof _0x338c1f&&(_0x429df1[_0x3a59e8]=_0x577f3f(_0x11e88e));}if(['insert','move','remove','reinsert','split','merge']['includes'](_0x2694ed['type'])){if(_0x2694ed['isDocumentOperation']=!0x1,_0x2694ed['baseVersion']=null,'remove'==_0x2694ed['type']){const _0x4eeec5=_0x2694ed['sourcePosition'],_0x547f24=_0x2694ed['howMany'];new _0x2806e1(_0x4eeec5,_0x547f24)['_execute']();}else _0x2694ed['_execute']();}function _0x577f3f(_0x5aaa30){if('$graveyard'==_0x5aaa30['root']['rootName'])return _0x5aaa30;const _0x30a006=[];let _0x16d713=_0x5aaa30['root'];for(let _0x3100fa=0x0;_0x3100fa<_0x5aaa30['path']['length'];_0x3100fa++){const _0x10265f=_0x1bc2bd['get'](_0x16d713)||0x0;_0x30a006[_0x3100fa]=_0x5aaa30['path'][_0x3100fa]+_0x10265f,_0x16d713=_0x16d713['getChildAtOffset'](_0x5aaa30['path'][_0x3100fa]);}return new _0x338c1f(_0x23a8ed,_0x30a006,_0x5aaa30['stickiness']);}}['_refreshInteraction'](){if(!this['_interactionParams'])return;this['_interactions']['length']>0x0&&this['_stopInteraction'](),this['_currentInteractionIndex']=0x0,this['_balloonShowDiff']=!0x1;const {action:_0xd8b6a3,content:_0x4c8353,version:_0x6dff9d,aiBalloon:_0xf824ad}=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'](_0x4c8353,_0x6dff9d,_0xf824ad,_0xd8b6a3)['catch'](_0xcf0e45=>{this['_isAbortError'](_0xcf0e45)||console['error']('Error\x20refreshing\x20interaction:',_0xcf0e45);});}['_isAbortError'](_0x3d45a1){return!!_0x3d45a1['message']&&_0x3d45a1['message']['startsWith']('ai-request-aborted');}['_clearInteractionHistory'](){this['_interactions']=[],this['_interactionParams']=void 0x0,this['_currentInteractionIndex']=0x0,this['_actionsBalloonView']['updateMiniToolbarButtons'](this['_interactions']['length'],this['_currentInteractionIndex']);}['_stopInteraction'](){this['_interaction']&&this['_interaction']['stop'](),this['_promiseQueue']['abort'](),this['isBusy']=!0x1,this['_interactionParams']&&this['_actionsBalloonView']['stopAutoScroll']();}['_navigateToPrevious'](){const _0x1ec69b=this['_interactions']['length'];this['_currentInteractionIndex']<_0x1ec69b-0x1&&this['_displayInteractionAtIndex'](this['_currentInteractionIndex']+0x1);}['_navigateToNext'](){this['_currentInteractionIndex']>0x0&&this['_displayInteractionAtIndex'](this['_currentInteractionIndex']-0x1);}async['_displayInteractionAtIndex'](_0x2806c8){if(!this['_interactionParams'])return;this['_currentInteractionIndex']=_0x2806c8;const _0x484141=this['_interactions'][this['_interactions']['length']-0x1-this['_currentInteractionIndex']];if(!_0x484141)return;if(_0x484141['hasError'])return this['_setErrorState'](_0x484141),void this['_actionsBalloonView']['updateMiniToolbarButtons'](this['_interactions']['length'],this['_currentInteractionIndex']);if(!_0x484141['replies']['length'])return;this['_actionsBalloonView']['hideError'](),this['_interactionParams']&&this['_clearErrorState']();const _0x13d32d=_0x484141['replies'][_0x484141['replies']['length']-0x1];if(_0x13d32d){const _0xd9b897=this['editor'];try{const _0xee5d9a=Rs({'editor':_0xd9b897,'changeGroups':_0x13d32d['changeGroups'],'documentContextContent':_0x13d32d['documentContextContent'],'showDiff':this['_balloonShowDiff'],'trimUnchanged':!0x1});await new Promise(_0x5ef572=>setTimeout(_0x5ef572,0x32)),await this['_actionsBalloonView']['updateContent']({'part':_0xee5d9a[0x0],'renderingStrategy':'static','abortSignal':new AbortController()['signal']});}catch(_0x1a9e5e){this['_isAbortError'](_0x1a9e5e)||console['error']('Error\x20updating\x20content\x20during\x20navigation:',_0x1a9e5e);}}this['_actionsBalloonView']['updateMiniToolbarButtons'](this['_interactions']['length'],this['_currentInteractionIndex']);}['_setLoadingState'](){this['_actionsBalloonView']['setIsLoading'](!0x0),this['isBusy']=!0x0;}async['_setErrorState'](_0x482737){const _0x19e634=hs(this['editor']['locale'],'AI_ACTIONS_GENERIC_ERROR');this['_actionsBalloonView']['showError'](_0x19e634),_0x482737['hasError']=!0x0,await this['_promiseQueue']['queueEmptyPromise'],this['_actionsBalloonView']['setErrorState'](),this['_actionsBalloonView']['toggleIsLoading'](!0x0);}['_clearErrorState'](){this['_actionsBalloonView']['hideError'](),this['_actionsBalloonView']['toggleIsLoading'](!0x1);}async['_clearLoadingState'](){await this['_promiseQueue']['queueEmptyPromise'],this['isBusy']=!0x1,this['_actionsBalloonView']['setIsLoading'](!0x1);}}class ea extends _0x530ddf{static get['requires'](){return[Wo,$o,ta];}static get['pluginName'](){return'AIQuickActions';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x6fd3e2){super(_0x6fd3e2),_0x6fd3e2['config']['define']('ai.quickActions',{'extraCommands':[],'removeCommands':[],'isSearchEnabled':!0x0});}}class ia extends vt{['resultResponseView'];['acceptButtonView'];['dismissButtonView'];['infoButtonView'];['outdatedButtonView'];constructor(_0x557943,_0x17c6c7){super(_0x557943),this['id']=_0x17c6c7,this['set']('status','pending'),this['set']('changeId',_0x17c6c7),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',(_0x20a92c,_0x2c0c3c)=>{_0x2c0c3c&&_0x2c0c3c['target']&&'A'===_0x2c0c3c['target']['tagName']&&_0x2c0c3c['preventDefault'](),this['fire']('activateChange',{'id':_0x17c6c7,'source':this,'uiInteraction':'click'});}),this['on']('mouseover',()=>{this['fire']('activateChange',{'id':_0x17c6c7,'source':this,'uiInteraction':'hover'});}),this['on']('mouseout',()=>{this['fire']('deactivateChange',{'origin':'panel','id':_0x17c6c7,'source':this});});}['setItemAsActive'](){this['isActive']=!0x0;}['setItemAsInactive'](){this['isActive']=!0x1;}['_createResultResponseView'](){const _0x44536c=new vt(this['locale']);return _0x44536c['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',_0x8c836=>!_0x8c836)]}}),_0x44536c;}['_createAcceptButtonView'](){const _0x596262=new Nt(this['locale']);return _0x596262['set']({'label':hs(this['locale'],'AI_REVIEW_MODE_ACCEPT_CHANGE'),'withText':!0x0}),_0x596262['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x74f18c=>{this['fire']('acceptChange',{'id':this['changeId']}),_0x74f18c['stopPropagation']();})},'attributes':{'class':[this['bindTemplate']['if']('status','ck-hidden',_0x1be902=>'pending'!==_0x1be902&&'accepted'!==_0x1be902),this['bindTemplate']['if']('status',ls,_0x4c778e=>'pending'===_0x4c778e),this['bindTemplate']['if']('status',us,_0x4242af=>'pending'!==_0x4242af),this['bindTemplate']['if']('status','ck-ai_review__check-run-result-status-button',_0x2b7f58=>'accepted'===_0x2b7f58)]}}),this['on']('change:status',(_0x317f99,_0x574787,_0x27ecde)=>{_0x596262['isEnabled']='pending'===_0x27ecde,'accepted'===_0x27ecde&&(_0x596262['label']=hs(this['locale'],'AI_REVIEW_MODE_CHECK_STATUS_ACCEPTED'),_0x596262['icon']=_0x463a41);}),_0x596262;}['_createDismissButtonView'](){const _0x108dfd=new Nt(this['locale']);return _0x108dfd['set']({'label':hs(this['locale'],'AI_REVIEW_MODE_DISMISS_CHANGE'),'withText':!0x0}),_0x108dfd['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0xae79b2=>{this['fire']('dismissChange',{'id':this['changeId']}),_0xae79b2['stopPropagation']();})},'attributes':{'class':[us,this['bindTemplate']['if']('status','ck-hidden',_0xa7216=>'pending'!==_0xa7216&&'rejected'!==_0xa7216),this['bindTemplate']['if']('status','ck-ai_review__check-run-result-dismiss-button',_0x4bc4ec=>'pending'===_0x4bc4ec),this['bindTemplate']['if']('status','ck-ai_review__check-run-result-status-button',_0x29a88b=>'rejected'===_0x29a88b)]}}),this['on']('change:status',(_0x24b199,_0x59b1f5,_0x44502f)=>{_0x108dfd['isEnabled']='pending'===_0x44502f,'rejected'===_0x44502f&&(_0x108dfd['label']=hs(this['locale'],'AI_REVIEW_MODE_CHECK_STATUS_REJECTED'),_0x108dfd['icon']=_0x2bfda9);}),_0x108dfd;}['_createInfoButtonView'](){const _0x3dae53=new Nt(this['locale']);return _0x3dae53['set']({'label':hs(this['locale'],'AI_REVIEW_MODE_LEARN_MORE'),'icon':_0xc177b6,'tooltip':!0x0,'isToggleable':!0x0,'role':'menuitemcheckbox','class':us+'\x20ck-ai_review__check-run-result-info-button\x20ck-hidden'}),_0x3dae53['bind']('isOn')['to'](this,'isInfoToggleOn',_0xd3c7ce=>_0xd3c7ce),_0x3dae53['on']('execute',()=>{this['isInfoToggleOn']=!this['isInfoToggleOn'];}),_0x3dae53;}['_createOutdatedButtonView'](){const _0x4c903f=new Nt(this['locale']);return _0x4c903f['set']({'label':hs(this['locale'],'AI_REVIEW_MODE_CHECK_STATUS_OUTDATED'),'icon':it,'withText':!0x0,'isEnabled':!0x1}),_0x4c903f['extendTemplate']({'attributes':{'class':[us,'ck-ai_review__check-run-result-status-button',this['bindTemplate']['if']('status','ck-hidden',_0x2686ef=>'outdated'!==_0x2686ef)],'disabled':'disabled'}}),_0x4c903f;}}class sa extends Xt{['resultItemView'];['_pinnedRectIndex']=void 0x0;['_pinnedTargetElement']=void 0x0;['_pinnedTargetChangeId']=void 0x0;constructor(_0x3138b4,_0x207702){super(_0x3138b4),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']()),_0x207702['add'](this);}['render'](){super['render'](),this['_setupClickOutsideHandler']();}['updateContent'](_0x2d0fbb){this['resultItemView']['changeId']=_0x2d0fbb['id'],this['resultItemView']['resultResponseView']['element']['innerHTML']=_0x2d0fbb['contentDiffed'];}['showBalloon'](_0x22a255,_0x55cf07,_0x557403,_0x487d60,_0x384b5d,_0x1d7ea1){const _0x48bf89=_0x55cf07();if(!_0x48bf89)return;this['updateContent'](_0x22a255),this['show']();const _0x34438f=Array['from'](_0x48bf89['getClientRects']())['reverse'](),_0x276219=this['_getPointedRectIndexFromEvent'](_0x557403,_0x34438f),_0x230d08=_0x34438f[_0x276219??0x0];'click'===_0x487d60?(this['isDiffActive']=!0x0,this['pin']({'target':()=>this['_getBestRectPositionOnClick'](_0x55cf07(),_0x276219,_0x22a255['id'],_0x384b5d,_0x1d7ea1)||_0x230d08})):'hover'===_0x487d60&&(this['isDiffActive']=!0x1,this['pin']({'target':()=>this['_getBestRectPositionOnHover'](_0x55cf07(),_0x276219,_0x22a255['id'])||_0x230d08}));}['hideBalloon'](){this['hide'](),this['unpin'](),this['_pinnedRectIndex']=void 0x0,this['_pinnedTargetElement']=void 0x0,this['_pinnedTargetChangeId']=void 0x0;}['hideDiffInBalloon'](){this['resultItemView']['showDiff']=!0x1;}['showDiffInBalloon'](){this['resultItemView']['showDiff']=!0x0;}['deactivateChange'](){this['fire']('deactivateChange',{'origin':'balloon'});}['_setupClickOutsideHandler'](){zt({'emitter':this,'activator':()=>this['isVisible'],'contextElements':()=>{const _0x15ec40=[this['element']];return this['_pinnedTargetElement']&&_0x15ec40['push'](this['_pinnedTargetElement']),_0x15ec40;},'callback':()=>{this['hide'](),this['unpin'](),this['deactivateChange'](),this['_pinnedTargetElement']=void 0x0,this['_pinnedRectIndex']=void 0x0,this['_pinnedTargetChangeId']=void 0x0;}});}['_createContentView'](){const _0x413c58=new vt();return this['resultItemView']=new ia(this['locale'],''),this['resultItemView']['resultResponseView']['extendTemplate']({'attributes':{'class':['ck-content']}}),this['resultItemView']['delegate']('acceptChange','dismissChange')['to'](this),_0x413c58['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']]}]}),_0x413c58;}['_getBestRectPositionOnClick'](_0x221654,_0x5876ce,_0x241478,_0x26c79d,_0x273873){if(!_0x221654)return null;const _0x21b867=this['position']['replace']('arrow_',''),_0x220ea8=Array['from'](_0x221654['getClientRects']());let _0x894871,_0x4f4d81=_0x220ea8['reverse']();return void 0x0!==_0x5876ce&&this['_isPinnedRectVisible'](_0x4f4d81[_0x5876ce],_0x26c79d,_0x273873)?(_0x894871=_0x4f4d81[_0x5876ce],this['_pinnedRectIndex']=_0x5876ce):this['_isPinnedRectVisible'](_0x4f4d81[0x0],_0x26c79d,_0x273873)&&void 0x0===_0x5876ce?_0x894871=_0x4f4d81[0x0]:(_0x4f4d81='s'==_0x21b867[0x0]?[..._0x220ea8]['reverse']():_0x220ea8,_0x4f4d81['forEach'](_0x7bae69=>{this['_isPinnedRectVisible'](_0x7bae69,_0x26c79d,_0x273873)&&(_0x894871=_0x7bae69);})),this['_pinnedTargetChangeId']=_0x241478,this['_pinnedTargetElement']=_0x221654,_0x894871||_0x221654['getBoundingClientRect']();}['_getBestRectPositionOnHover'](_0x650ef0,_0x4f2b23,_0x236a9a){if(!_0x650ef0)return null;const _0x1427ae=Array['from'](_0x650ef0['getClientRects']())['reverse']();if(void 0x0===this['_pinnedRectIndex']&&void 0x0!==_0x4f2b23&&this['_pinnedTargetChangeId']!==_0x236a9a)return this['_pinnedRectIndex']=_0x4f2b23,this['_pinnedTargetElement']=_0x650ef0,this['_pinnedTargetChangeId']=_0x236a9a,_0x1427ae[_0x4f2b23];if(void 0x0!==this['_pinnedRectIndex']&&this['_pinnedTargetChangeId']===_0x236a9a){if(_0x650ef0!==this['_pinnedTargetElement'])return Array['from'](this['_pinnedTargetElement']['getClientRects']())['reverse']()[this['_pinnedRectIndex']];return _0x1427ae[this['_pinnedRectIndex']];}return void 0x0!==_0x4f2b23&&this['_pinnedTargetChangeId']!==_0x236a9a?(this['_pinnedRectIndex']=_0x4f2b23,this['_pinnedTargetElement']=_0x650ef0,this['_pinnedTargetChangeId']=_0x236a9a,_0x1427ae[_0x4f2b23]):_0x650ef0['getBoundingClientRect']();}['_getPointedRectIndexFromEvent'](_0x53b564,_0x447984){if(_0x53b564)for(let _0x477d12=0x0;_0x477d12<_0x447984['length'];_0x477d12++){const _0x2c55e7=_0x447984[_0x477d12];if(_0x53b564['clientX']>=_0x2c55e7['left']-0x3&&_0x53b564['clientX']<=_0x2c55e7['right']+0x3&&_0x53b564['clientY']>=_0x2c55e7['top']-0x3&&_0x53b564['clientY']<=_0x2c55e7['bottom']+0x3)return _0x477d12;}}['_isPinnedRectVisible'](_0x2778aa,_0x39e2ff,_0x776b5b){const _0xb8a26f=new ut(_0x2778aa),_0x36c5c3=_0x39e2ff||document['documentElement'],_0x4174be=_0xb8a26f['getIntersection'](Rt(_0x776b5b)),_0x5c10c4=new ut(_0x36c5c3)['getIntersection'](_0xb8a26f);return!!(_0x4174be&&_0x5c10c4&&_0xb8a26f['width']>0x0);}}const na=['getReviewCheckList','runReviewCheck','abortReviewStream','toggleDiff','acceptAllChanges','leaveReviewCoreResultList','activateChange','deactivateChange','acceptChange','dismissChange','learnMore','finishReview','retryReview'];class ra extends _0x2599d1{['_mainView'];['_balloonSuggestionView'];['_bodyCollection'];static get['requires'](){return[os];}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x4511a9){super(_0x4511a9),this['_bodyCollection']=new Qt(this['context']['locale']),this['_bodyCollection']['attachToDom'](),this['_mainView']=this['createMainView'](),this['_mainView']['delegate'](...na)['to'](this),this['_balloonSuggestionView']=new sa(this['context']['locale'],this['_bodyCollection']),this['_balloonSuggestionView']['delegate']('acceptChange','dismissChange','deactivateChange')['to'](this);}['init'](){const _0xffb3e5=this['context']['plugins']['get']('AITabs');this['registerTab'](_0xffb3e5);}['destroy'](){this['_bodyCollection']['detachFromDom'](),super['destroy']();}['setAvailableChecks'](_0x1e8d6c){if(!this['_mainView']['reviewCheckListView']['hasChecks']()){const _0x49153d=!this['context']['config']['get']('ai.models.showModelSelector');this['_mainView']['reviewCheckListView']['setChecks'](_0x1e8d6c,_0x49153d);}this['_mainView']['showReviewCheckListView']();}['showReviewCheckList'](){this['fire']('getReviewCheckList');}['showCheckRunResults'](_0x1b4e6f){_0x1b4e6f&&('error-general'!==_0x1b4e6f['status']?'error-chunk'!==_0x1b4e6f['status']?this['_mainView']['showReviewCheckResultsView']():this['showChunkErrorView']():this['showGeneralResultsErrorView']());}['showCheckRunResult'](_0x1174b0){this['_mainView']['addCheckRunResult'](_0x1174b0);}['showGeneralResultsErrorView'](){this['_mainView']['showGeneralResultsErrorView']();}['showGeneralReviewCoreErrorView'](_0x6126d5){this['_mainView']['showGeneralReviewCoreErrorView'](_0x6126d5??hs(this['context']['locale'],'AI_REVIEW_INITIALIZATION_ERROR_MESSAGE'));}['showChunkErrorView'](){this['_mainView']['showChunkErrorView']();}['setCheckResultTitle'](_0x325530,_0x2ee667){this['_mainView']['reviewCheckResultsView']['setTitle'](_0x325530,_0x2ee667);}['setActiveStateInResults'](_0x241894){this['_mainView']['reviewCheckResultsView']['getResults']()['forEach'](_0x5c19d1=>{_0x5c19d1['id']===_0x241894&&_0x5c19d1['setItemAsActive']();});}['resetActiveStateInResults'](){this['_mainView']['reviewCheckResultsView']['getResults']()['forEach'](_0x5b28da=>_0x5b28da['setItemAsInactive']());}['updateChangeState'](_0x6949ca,_0x1695de){'accepted'===_0x1695de||'rejected'===_0x1695de||'outdated'===_0x1695de?this['_mainView']['reviewCheckResultsView']['hideResult'](_0x6949ca,_0x1695de):this['_mainView']['reviewCheckResultsView']['showResult'](_0x6949ca,_0x1695de);}['showReviewCompletedView'](){this['_mainView']['showReviewCompletedView']();}['showActionsWhenResultIsReady'](){this['_mainView']['showActionsWhenResultIsReady']();}['showNoChangesView'](){this['_mainView']['showNoChangesView']();}['hideActionsWhenResultIsReady'](){this['_mainView']['hideActionsWhenResultIsReady']();}['showChangeBalloon'](_0x41f9d6,_0x3a9543,_0x490fe5,_0x587824,_0x23407b,_0x1c1bcd){this['_balloonSuggestionView']['showBalloon'](_0x41f9d6,_0x3a9543,_0x490fe5,_0x587824,_0x23407b,_0x1c1bcd);}['hideChangeBalloon'](){this['_balloonSuggestionView']['hideBalloon']();}['hideDiffInBalloon'](){this['_balloonSuggestionView']['hideDiffInBalloon']();}['showDiffInBalloon'](){this['_balloonSuggestionView']['showDiffInBalloon']();}['getChangeElement'](_0x413520){const _0x5889a7=this['_mainView']['reviewCheckResultsView']['getResults']()['find'](_0x51bd92=>_0x51bd92['id']===_0x413520);return _0x5889a7?_0x5889a7['element']:null;}['deactivateChange'](){this['_balloonSuggestionView']['deactivateChange']();}}class oa extends vt{constructor(_0x21a6aa){super(_0x21a6aa),this['set']('isVisible',!0x1),this['set']('errorMessage','');const _0x3f664a=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai_review__general-error-container',_0x3f664a['if']('isVisible','ck-hidden',_0x383691=>!_0x383691)]},'children':[{'tag':'p','attributes':{'class':'ck\x20ck-ai-notification\x20ck-ai-notification_error'},'children':[{'text':_0x3f664a['to']('errorMessage')}]}]});}}class aa extends vt{['reviewCoreHeader'];['generalErrorView'];['reviewCheckListView'];['reviewCheckResultsView'];['reviewCompletedView'];constructor(_0x205459,_0x1fb6c4){super(_0x205459),this['reviewCoreHeader']=_0x1fb6c4['header'],this['generalErrorView']=new oa(_0x205459),this['reviewCheckListView']=_0x1fb6c4['list'],this['reviewCheckListView']['delegate'](...na)['to'](this),this['reviewCheckResultsView']=_0x1fb6c4['results'],this['reviewCheckResultsView']['delegate'](...na)['to'](this),this['reviewCompletedView']=_0x1fb6c4['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'](_0x3c4b87){this['reviewCheckResultsView']['addResult'](_0x3c4b87),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'](_0x1ab596){this['generalErrorView']['set']('isVisible',!0x0),this['generalErrorView']['errorMessage']=_0x1ab596;}['showGeneralResultsErrorView'](){this['reviewCheckResultsView']['set']('isLoading',!0x1),this['showActionsWhenResultIsReady'](),this['reviewCheckResultsView']['showGeneralErrorMessage']();}['showChunkErrorView'](){this['reviewCheckResultsView']['set']('isLoading',!0x1),this['showActionsWhenResultIsReady'](),this['reviewCheckResultsView']['showChunkErrorMessage']();}}class ha extends Nt{constructor(_0x4a3837,_0x493a8e){super(_0x493a8e),this['set']({'label':_0x4a3837,'withText':!0x0,'class':cs}),this['on']('execute',()=>{this['fire']('finishReview');});}}class ca extends Ht{['_resultViews'];['_resultsHeader'];['_resultsBody'];['reviewDisclaimer'];['_cancelButtonView'];['_acceptAllButtonView'];['_exitReviewButtonView'];['_toggleDiffButtonView'];['_errorMessageView'];['_finishReviewButtonView'];['_contents'];constructor(_0x131a85,_0x281947){super(_0x131a85),this['_contents']=_0x281947,this['_resultViews']=new _0x211f24(),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 io(_0x131a85),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 _0x27c843=this['_createCombinedSkeletonLoader'](),_0x35df35=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-run',_0x35df35['if']('isLoading','ck-ai_review__check-run_loading',_0x28f209=>_0x28f209),_0x35df35['if']('isResultReady','ck-ai_review__check-run_ready',_0x437277=>_0x437277),_0x35df35['if']('isVisible','ck-hidden',_0x44383e=>!_0x44383e)]},'children':[this['_resultsHeader'],this['_errorMessageView'],this['_resultsBody'],_0x27c843,this['reviewDisclaimer']]});}['clearResults'](){this['_resultViews']['clear'](),this['_resultsBody']['element']&&(this['_resultsBody']['element']['scrollTop']=0x0);}['getResults'](){return this['_resultViews'];}['addResult'](_0x179c94){const _0x5a7967=new ia(this['locale'],_0x179c94['id']);_0x5a7967['delegate']('acceptChange','dismissChange','activateChange','deactivateChange')['to'](this),this['_resultViews']['add'](_0x5a7967),_0x5a7967['resultResponseView']['element']['innerHTML']=_0x179c94['contentDiffed'];}['hideResult'](_0x58074c,_0x16f660){if('pending'===_0x16f660)return;const _0x52d38f=this['_resultViews']['find'](_0x2ec1d2=>_0x2ec1d2['id']===_0x58074c);_0x52d38f&&(_0x52d38f['status']=_0x16f660,_0x52d38f['element']?.['classList']['add']('ck-ai_review__check-run-result_grayout'));}['showResult'](_0x1935a0,_0x9f8c0){if('pending'!==_0x9f8c0)return;const _0xd7b175=this['_resultViews']['find'](_0x44f044=>_0x44f044['id']===_0x1935a0);_0xd7b175&&(_0xd7b175['status']=_0x9f8c0,_0xd7b175['element']?.['classList']['remove']('ck-ai_review__check-run-result_grayout'));}['setTitle'](_0x1ec05a,_0x2715d5){this['headerTitle']=_0x1ec05a,this['headerSubtitle']=_0x2715d5||'';}['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 pn(this['locale'],mn['aiReviewChecks']);}['_createCombinedSkeletonLoader'](){const _0x461a7b=new vt(this['locale']),_0x82b9e4=[];for(let _0x868305=0x0;_0x868305<0x10;_0x868305++){const _0x3599e7=this['_createSkeletonLoader']();_0x3599e7['extendTemplate']({'attributes':{'class':['ck-ai_review__check-run-skeleton-item']}}),_0x82b9e4['push'](_0x3599e7);}return _0x461a7b['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-run-skeleton-container',this['bindTemplate']['if']('isLoading','ck-hidden',_0x1a0f2d=>!_0x1a0f2d)]},'children':_0x82b9e4}),_0x461a7b;}['_createResultsBodyView'](){const _0x483b6a=new vt(this['locale']);return _0x483b6a['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-run-results-container','ck-reset_all-excluded',this['bindTemplate']['if']('isLoading','ck-hidden',_0x5544fe=>_0x5544fe)]},'children':this['_resultViews']}),_0x483b6a;}['_createErrorView'](){const _0x393efd=new vt(this['locale']),_0x2e2c78=new Nt(this['locale']),t=this['locale']['t'];return _0x393efd['delegate']('retryReview')['to'](this),_0x2e2c78['set']({'label':t('Try\x20again'),'withText':!0x0,'class':ls+'\x20ck-ai_review__check-run-error-retry-button'}),_0x2e2c78['on']('execute',()=>{this['fire']('retryReview');}),_0x393efd['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-run-error-container',this['bindTemplate']['if']('showErrorMessage','ck-hidden',_0x5775d6=>!_0x5775d6),this['bindTemplate']['if']('errorType','ck-ai_review__check-run-error-container_border-bottom',_0xbc2386=>'chunk'===_0xbc2386)]},'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',_0x48eb96=>'chunk'===_0x48eb96)]},'children':[{'tag':'p','attributes':{'class':['ck-ai-notification__content',this['bindTemplate']['if']('errorType','ck-hidden',_0x9973=>'general'!==_0x9973)]},'children':[{'text':this['_contents']['generalErrorText']}]},{'tag':'p','attributes':{'class':['ck-ai-notification__content',this['bindTemplate']['if']('errorType','ck-hidden',_0x2a46df=>'chunk'!==_0x2a46df)]},'children':[{'text':hs(this['locale'],'AI_REVIEW_MODE_CHUNK_ERROR_MESSAGE')}]}]},_0x2e2c78]}),_0x393efd;}['_createCancelButtonView'](){const _0x3c689b=new Nt(this['locale']);return _0x3c689b['set']({'label':hs(this['locale'],'AI_REVIEW_MODE_STOP_GENERATING'),'withText':!0x0,'class':[ls+'\x20ck-ai-button-stop-generating'],'icon':_0x746994}),_0x3c689b['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isResultReady','ck-hidden',_0x4a6682=>_0x4a6682),this['bindTemplate']['if']('isCompleted','ck-hidden',_0x340867=>_0x340867)]}}),_0x3c689b['on']('execute',()=>{this['fire']('abortReviewStream');}),_0x3c689b;}['_createToggleDiffButtonView'](){const _0xa26316=new Nt(this['locale']);_0xa26316['set']({'tooltip':!0x0,'isToggleable':!0x0,'role':'menuitemcheckbox'}),_0xa26316['bind']('isEnabled')['to'](this,'isError',_0x133003=>!_0x133003),_0xa26316['extendTemplate']({'attributes':{'class':[ls,'ck-ai_review__check-run-toggle-diff-button',this['bindTemplate']['if']('isResultReady','ck-hidden',_0x440355=>!_0x440355),this['bindTemplate']['if']('isCompleted','ck-hidden',_0x495ffb=>_0x495ffb)]}});const _0x492e37=hs(this['locale'],'AI_REVIEW_MODE_HIDE_CHANGES'),_0x986635=hs(this['locale'],'AI_REVIEW_MODE_SHOW_CHANGES');return _0xa26316['bind']('isOn')['to'](this,'isToggleDiffOn',_0x674a07=>_0x674a07),_0xa26316['bind']('icon')['to'](this,'isToggleDiffOn',_0x3756cd=>_0x3756cd?st:nt),_0xa26316['bind']('label')['to'](this,'isToggleDiffOn',_0xf485f4=>_0xf485f4?_0x492e37:_0x986635),_0xa26316['on']('execute',()=>{this['isToggleDiffOn']=!this['isToggleDiffOn'],this['fire']('toggleDiff',{'on':this['isToggleDiffOn']});}),_0xa26316;}['_createAcceptAllButtonView'](){const _0x56c2b2=new Nt(this['locale']);return _0x56c2b2['set']({'label':hs(this['locale'],'AI_REVIEW_MODE_ACCEPT_ALL'),'withText':!0x0}),_0x56c2b2['bind']('isEnabled')['to'](this,'isError',_0x2ccc04=>!_0x2ccc04),_0x56c2b2['extendTemplate']({'attributes':{'class':[cs,'ck-ai_review__check-run-accept-all-button',this['bindTemplate']['if']('isResultReady','ck-hidden',_0x3642a6=>!_0x3642a6),this['bindTemplate']['if']('isCompleted','ck-hidden',_0xff31e6=>_0xff31e6)]}}),_0x56c2b2['on']('execute',()=>{this['fire']('acceptAllChanges');}),_0x56c2b2;}['_createExitReviewButtonView'](){const _0x20933e=new Nt(this['locale']);return _0x20933e['set']({'label':hs(this['locale'],'AI_REVIEW_MODE_EXIT_REVIEW'),'withText':!0x0}),_0x20933e['extendTemplate']({'attributes':{'class':[us,'ck-ai_review__check-run-exit-button',this['bindTemplate']['if']('isResultReady','ck-hidden',_0x365f7a=>!_0x365f7a),this['bindTemplate']['if']('isCompleted','ck-hidden',_0xf75314=>_0xf75314)]}}),_0x20933e['on']('execute',()=>{this['fire']('leaveReviewCoreResultList');}),_0x20933e;}['_createResultHeaderView'](){const _0x3236eb=new vt(this['locale']),_0xc5505f=this['_createTitleView']();return _0x3236eb['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-run-results-header',this['bindTemplate']['if']('isCompleted','ck-ai_review__review-completed-header',_0x1394ab=>_0x1394ab)]},'children':[_0xc5505f,{'tag':'div','attributes':{'class':['ck-ai_review__check-run-results-header-buttons']},'children':[this['_cancelButtonView'],this['_acceptAllButtonView'],this['_exitReviewButtonView'],this['_toggleDiffButtonView'],this['_finishReviewButtonView']]}]}),_0x3236eb;}['_createTitleView'](){const _0x1be038=new vt(this['locale']),_0x306e44=new yn();return _0x306e44['bind']('isVisible')['to'](this,'isResultReady',_0x4bc992=>!_0x4bc992),_0x1be038['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-run-results-header-title-wrapper']},'children':[_0x306e44,{'tag':'div','attributes':{'class':['ck-ai_review__check-run-results-header-title-content',this['bindTemplate']['if']('isCompleted','ck-hidden',_0x1f6a05=>_0x1f6a05)]},'children':[{'tag':'span','attributes':{'class':['ck-ai_review__check-run-results-header-title']},'children':[{'text':this['bindTemplate']['to']('headerTitle')}]},{'tag':'span','attributes':{'class':['ck-ai_review__check-run-results-header-subtitle']},'children':[{'text':this['bindTemplate']['to']('headerSubtitle')}]}]},{'tag':'span','attributes':{'class':['ck-ai_review__review-completed-header-title',this['bindTemplate']['if']('isCompleted','ck-hidden',_0x2edb78=>!_0x2edb78)]},'children':[{'text':hs(this['locale'],'AI_REVIEW_MODE_FINISH_REVIEW_HEADER_TITLE')}]}]}),_0x1be038;}['_createFinishReviewButtonView'](){const _0x29c725=new ha(hs(this['locale'],'AI_REVIEW_MODE_FINISH_REVIEW_BUTTON_LABEL'),this['locale']);return _0x29c725['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isCompleted','ck-hidden',_0x2df2c2=>!_0x2df2c2)]}}),_0x29c725['delegate']('finishReview')['to'](this),_0x29c725;}}class la extends Ht{['_resultsHeader'];['_finishReviewButtonView'];constructor(_0x22c4e9,_0x27b143){super(_0x22c4e9),this['_finishReviewButtonView']=this['_createFinishReviewButtonView'](_0x27b143['buttonText']),this['_resultsHeader']=this['_createResultHeaderView'](_0x27b143['headerText']);const _0x423ca1=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__review-completed',_0x423ca1['if']('isVisible','ck-hidden',_0x32a90e=>!_0x32a90e)]},'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':_0x27b143['emptyResultsText']}]}]}]});}['_createFinishReviewButtonView'](_0x589e53){const _0x37c510=new ha(_0x589e53,this['locale']);return _0x37c510['delegate']('finishReview')['to'](this),_0x37c510;}['_createResultHeaderView'](_0x1b0ac7){const _0x5a7662=new vt(this['locale']);return _0x5a7662['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__review-completed-header']},'children':[{'tag':'span','attributes':{'class':['ck-ai_review__review-completed-header-title']},'children':[{'text':_0x1b0ac7}]},{'tag':'div','attributes':{'class':['ck-ai_review__review-completed-header-buttons']},'children':[this['_finishReviewButtonView']]}]}),_0x5a7662;}}class ua extends vt{['_dropdownView'];['_defaultValue'];['_defaultLabel'];constructor(_0x182884,_0x2ff15b){super(_0x182884),this['_defaultValue']=_0x2ff15b['default']||(_0x2ff15b['data']['length']>0x0?_0x2ff15b['data'][0x0]['id']:''),this['_defaultLabel']=_0x2ff15b['data']['find'](_0x153e8d=>_0x153e8d['id']===this['_defaultValue'])?.['label']||'',this['set']('formValue',''),this['_dropdownView']=Gt(this['locale']);const _0x1713bf=this['_prepareListOptions'](_0x2ff15b['data']);jt(this['_dropdownView'],_0x1713bf,{'role':'menu','ariaLabel':_0x2ff15b['label']}),this['_dropdownView']['buttonView']['set']({'label':this['_defaultLabel'],'withText':!0x0}),this['_dropdownView']['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x50492d=>{_0x50492d['stopPropagation']();})}}),this['listenTo'](this['_dropdownView'],'execute',_0x1af558=>{this['formValue']=_0x1af558['source']['model']['id'],this['_dropdownView']['buttonView']['label']=_0x1af558['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'](_0x48c5ae=[]){const _0x2658a5=new dt();this['resetToDefault']();for(const _0x58f77e of _0x48c5ae){const _0x1c4f2d=new Jt({'label':_0x58f77e['label'],'withText':!0x0,'role':'menuitemradio','id':_0x58f77e['id'],'model':_0x58f77e});_0x1c4f2d['bind']('isOn')['to'](this,'formValue',_0x1393f5=>_0x1393f5===_0x1c4f2d['id']);const _0x5cf619={'type':'button','model':_0x1c4f2d};_0x2658a5['add'](_0x5cf619);}return _0x2658a5;}}class da extends Ht{['_formItem']=null;constructor(_0x4601d5,_0x1cae5e,_0x50dc3f){super(_0x4601d5),this['argsKey']=_0x1cae5e?.['argsKey'];if('dropdown'===_0x1cae5e['formType'])this['_formItem']=new ua(this['locale'],_0x1cae5e);this['set']('value',''),this['bind']('value')['to'](this['_formItem'],'formValue');const _0x3b2eb4=new _0x47ab45(this['locale'],{'children':[this['_formItem']],'class':[_0x50dc3f?'ck-form__row_with-submit':'']});_0x50dc3f&&_0x3b2eb4['children']['add'](_0x50dc3f),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai_review__form-item','ck-reset_all']},'children':[_0x3b2eb4]});}['resetToDefault'](){this['_formItem']['resetToDefault']();}}class _a extends _0x2051b4{['keystrokes'];static ['MIN_ROWS']=0x1;static ['MAX_ROWS']=0xc;constructor(_0x11c9ca){super(_0x11c9ca),this['set']('isEmpty',!0x0),this['keystrokes']=new gt(),this['minRows']=_a['MIN_ROWS'],this['maxRows']=_a['MAX_ROWS'],this['extendTemplate']({'attributes':{'id':'ai-review-prompt-input','class':['ck','ck-review__prompt-input']}});}['render'](){super['render'](),this['on']('update',()=>{this['isEmpty']=''===this['element']['value']?.['trim']();}),this['keystrokes']['listenTo'](this['element']);}}class ga extends vt{['focusTracker']=new _t();['keystrokes']=new gt();['focusCycler'];['_focusables']=new _0x211f24();['submitButtonView'];['cancelButtonView'];['promptInputView'];['actionsFooterView'];['_modelSelectionDropdown'];['_modelNameView'];['_modelSelectionDropdownItems'];['_check'];['_defaultValue'];['_defaultLabel'];constructor(_0x5867a8,_0x3a440c,_0x454fec=!0x1){super(_0x5867a8),this['_check']=_0x3a440c,this['set']('prompt',''),this['set']('modelId',''),this['set']('modelDisplayMode','selector'),this['set']('activeModelName',null),this['_defaultValue']=_0x3a440c['defaultModel']?_0x3a440c['defaultModel']['id']:'',this['_defaultLabel']=_0x3a440c['defaultModel']?_0x3a440c['defaultModel']['name']:'',this['submitButtonView']=this['_createSubmitButtonView'](),this['cancelButtonView']=this['_createCancelButtonView'](),(this['promptInputView']=new te(this['locale'],()=>new _a(_0x5867a8)),this['promptInputView']['fieldView']['bind']('value')['to'](this,'prompt'),this['promptInputView']['fieldView']['on']('input',()=>{this['prompt']=this['promptInputView']['fieldView']['element']['value'];}),this['_modelSelectionDropdown']=this['_createModelSelectionDropdown'](),this['_modelSelectionDropdownItems']=new dt(),this['_modelNameView']=this['_createModelNameView'](),this['_setModelList'](_0x454fec),jt(this['_modelSelectionDropdown'],this['_modelSelectionDropdownItems']),this['actionsFooterView']=this['_createActionsFooterView'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-custom-actions']},'children':[new _0x47ab45(this['locale'],{'children':[this['promptInputView']]}),new _0x47ab45(this['locale'],{'children':[this['actionsFooterView']]})]}),this['promptInputView']['fieldView']['keystrokes']['set']('Enter',(_0x3383a1,_0x21a58b)=>{this['_isValid']()?(this['fire']('runReviewCheck',{'id':'custom','args':{'prompt':this['prompt'],'model':this['modelId']},'isCustom':!0x0}),_0x21a58b()):_0x21a58b();}),this['focusCycler']=new Ut({'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'](_0x54476a=>{this['_focusables']['add'](_0x54476a),this['focusTracker']['add'](_0x54476a['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 _0x6b6641 of this['_getFormValidators']()){const _0x2055b5=_0x6b6641();if(_0x2055b5)return this['promptInputView']['errorText']=_0x2055b5,!0x1;}return!0x0;}['_getFormValidators'](){return[()=>{if(0x0===this['promptInputView']['fieldView']['value']?.['trim']()['length'])return hs(this['locale'],'AI_REVIEW_MODE_PROMPT_EMPTY_ERROR');}];}['_createSubmitButtonView'](){const _0x11ef0b=new Nt(this['locale']),t=this['locale']['t'];return _0x11ef0b['set']({'label':t('Submit'),'withText':!0x0,'class':cs}),_0x11ef0b['on']('execute',()=>{this['_isValid']()&&this['fire']('runReviewCheck',{'id':'custom','args':{'prompt':this['prompt'],'model':this['modelId']},'isCustom':!0x0});}),_0x11ef0b;}['_createCancelButtonView'](){const _0x409b27=new Nt(this['locale']),t=this['locale']['t'];return _0x409b27['set']({'label':t('Cancel'),'withText':!0x0,'class':us}),_0x409b27['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x2e1961=>{_0x2e1961['stopPropagation']();})}}),_0x409b27['on']('execute',()=>{this['resetToDefault'](),this['fire']('closeCustomCheck');}),_0x409b27;}['_setModelList'](_0xffb0e3){this['_modelSelectionDropdownItems']['clear']();const _0x1bd8ac=this['_check']['models'];if(_0xffb0e3)this['set']('modelDisplayMode','hidden');else{const _0x4d97de=0x1===_0x1bd8ac['length'];this['set']('modelDisplayMode',_0x4d97de?'name':'selector');}if(this['resetToDefault'](),_0x1bd8ac?.['length']){0x1===_0x1bd8ac['length']&&this['set']('activeModelName',_0x1bd8ac[0x0]['name']||_0x1bd8ac[0x0]['id']);for(const _0x3287d5 of _0x1bd8ac){const _0x4aadaa=new Jt({'label':_0x3287d5['name'],'withText':!0x0,'role':'menuitemradio','id':_0x3287d5['id'],'model':_0x3287d5});_0x4aadaa['bind']('isOn')['to'](this,'modelId',_0x3f723d=>_0x3f723d===_0x3287d5['id']),this['_modelSelectionDropdownItems']['add']({'type':'button','model':_0x4aadaa,'labelView':new Ia(this['locale'],_0x3287d5)});}}}['_createModelSelectionDropdown'](){const _0xae86f7=Gt(this['locale']);return _0xae86f7['set']({'panelPosition':'se','class':'ck-ai_review__check-list-item-model-dropdown'}),_0xae86f7['buttonView']['set']({'label':this['_defaultLabel'],'withText':!0x0,'tooltip':!0x0,'class':us}),_0xae86f7['buttonView']['bind']('isVisible')['to'](this,'modelDisplayMode',_0x339e14=>'selector'===_0x339e14),this['listenTo'](_0xae86f7,'execute',_0xe38636=>{this['modelId']=_0xe38636['source']['model']['id'],_0xae86f7['buttonView']['label']=_0xe38636['source']['label'];}),_0xae86f7;}['_createModelNameView'](){const _0x4508fb=new Aa(this['locale']);return _0x4508fb['bind']('text')['to'](this,'activeModelName',_0x50ff0f=>_0x50ff0f??''),_0x4508fb['bind']('isVisible')['to'](this,'modelDisplayMode',_0x17e0fc=>'name'===_0x17e0fc),_0x4508fb;}['_createActionsFooterView'](){const _0x5bd85c=new vt(this['locale']);return _0x5bd85c['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']]}]}),_0x5bd85c;}}class Aa extends vt{constructor(_0x218709){super(_0x218709),this['set']('text',void 0x0),this['set']('isVisible',!0x0);const _0x1c6c1f=this['bindTemplate'];this['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai_review__check-list-item-model-name',_0x1c6c1f['if']('isVisible','ck-hidden',_0x5a4a52=>!_0x5a4a52)]},'children':[{'text':_0x1c6c1f['to']('text')}]});}}class Ia extends Mt{constructor(_0x1e7d68,_0x1d4c31){super();const _0x1d8f50=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-button__label'],'style':_0x1d8f50['to']('style'),'id':_0x1d8f50['to']('id')},'children':[{'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-model-dropdown-name']},'children':[{'tag':'span','children':[{'text':_0x1d8f50['to']('text')}]}]},{'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-model-dropdown-description']},'children':[{'tag':'span','children':[_0x1d4c31['description']||'']}]}]});}}class Ea extends Ht{['_formItemsCollection']=new _0x211f24();['_customCheckView']=null;['_hideModels']=!0x1;constructor(_0x11da4a,_0x3e653b,_0xe0ee33,_0x380ce5=!0x1){super(_0x11da4a),this['_hideModels']=_0x380ce5,this['set']('isParametrizedViewOpen',!0x1),this['set']('isListItemRendered',!0x1),this['set']('isItemParametrized',_0x3e653b['isParameterized']);const _0x109bcd=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',_0x15d25e=>_0x15d25e),this['bindTemplate']['if']('isListItemRendered','ck-ai_review__check-list-item_rendered',_0x4de80e=>_0x4de80e)],'style':{'--ck-ai-review-check-list-item-index':_0xe0ee33}},'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':_0x3e653b['title']}]},_0x109bcd]},{'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-description']},'children':_0x3e653b['description']?[{'text':_0x3e653b['description']}]:[]}]}]},..._0x3e653b['isParameterized']?[this['_createParameterizedView'](_0x3e653b)]:[],...'custom'===_0x3e653b['id']?[this['_createCustomView'](_0x3e653b,this['_hideModels'])]:[]]}),this['on']('click',()=>{_0x3e653b['isParameterized']?this['isParametrizedViewOpen']=!0x0:this['fire']('runReviewCheck',{'id':_0x3e653b['id'],'args':_0x3e653b['useArgs']?_0x3e653b['args']:void 0x0});}),requestAnimationFrame(()=>{this['isListItemRendered']=!0x0;});}['render'](){super['render'](),this['isItemParametrized']&&zt({'emitter':this,'activator':()=>!0x0===this['isParametrizedViewOpen'],'contextElements':[this['element']],'callback':()=>{this['isParametrizedViewOpen']=!0x1;}});}['resetToDefault'](){this['isParametrizedViewOpen']=!0x1,this['_formItemsCollection']['forEach'](_0x5c5782=>{_0x5c5782['resetToDefault']();}),this['_customCheckView']&&this['_customCheckView']['resetToDefault']();}['_createIconView'](){const _0x58bd96=new xt();return _0x58bd96['content']=rt,_0x58bd96['extendTemplate']({'attributes':{'class':['ck-ai_review__check-list-item-title-icon']}}),_0x58bd96;}['_createParameterizedView'](_0x5227c5){const _0x2a6d46=new vt(),_0x1b213d=this['_createFormView'](_0x5227c5);return _0x2a6d46['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-parameterized',this['bindTemplate']['if']('isParametrizedViewOpen','ck-hidden',_0x186271=>!_0x186271)]},'children':[_0x1b213d]}),_0x2a6d46;}['_createFormView'](_0x163bc4){const _0x5f5b99=new vt(),_0x124ce0=Array['isArray'](_0x163bc4['options'])?_0x163bc4['options']:[],_0x4fc41a=new Nt(this['locale']),t=this['locale']['t'];_0x4fc41a['set']({'label':t('Submit'),'withText':!0x0,'class':cs}),_0x4fc41a['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x163a5a=>{_0x163a5a['stopPropagation']();})}}),_0x4fc41a['on']('execute',()=>{const _0xa05774=[],_0x19342d={};this['_formItemsCollection']['forEach'](_0x25ff20=>{_0xa05774['push'](_0x25ff20['value']),_0x163bc4['useArgs']&&_0x163bc4['options']&&(_0x19342d[_0x25ff20['argsKey']]=_0x25ff20['value']);}),this['fire']('runReviewCheck',{'id':_0x163bc4['id'],'params':_0xa05774['length']?_0xa05774:void 0x0,'args':Object['keys'](_0x19342d)['length']?_0x19342d:void 0x0});});const _0x282784=_0x124ce0['length'];return _0x124ce0['forEach']((_0x1102cf,_0x2be1df)=>{const _0x5ec836=_0x2be1df===_0x282784-0x1;this['_formItemsCollection']['add'](new da(this['locale'],_0x1102cf,_0x5ec836?_0x4fc41a:null));}),_0x5f5b99['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-parameterized-form']},'children':this['_formItemsCollection']}),_0x5f5b99;}['_createCustomView'](_0x332292,_0x25d54a=!0x1){return this['_customCheckView']=new ga(this['locale'],_0x332292,_0x25d54a),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',_0x402c65=>!_0x402c65)]}}),this['_customCheckView']['delegate']('runReviewCheck')['to'](this),this['listenTo'](this['_customCheckView'],'closeCustomCheck',()=>{this['isParametrizedViewOpen']=!0x1;}),this['on']('change:isParametrizedViewOpen',(_0xdf17f1,_0x3ec9c7,_0x4644c7)=>{_0x4644c7||this['_customCheckView']['resetFormValidationStatus']();}),this['_customCheckView'];}}class pa extends Ht{['_checkViews'];constructor(_0x1075ad){super(_0x1075ad),this['_checkViews']=new _0x211f24(),this['_setupTemplate']();}['setChecks'](_0x565c8,_0x3a766a=!0x1){this['_checkViews']['clear']();for(const [_0xf4d4ea,_0x2818df]of _0x565c8['entries']()){const _0x5e6551=new Ea(this['locale'],_0x2818df,_0xf4d4ea,_0x3a766a);_0x5e6551['delegate']('runReviewCheck')['to'](this),this['_checkViews']['add'](_0x5e6551);}}['hasChecks'](){return this['_checkViews']['length']>0x0;}['resetAllParameterizedChecks'](){for(const _0x5b4eea of this['_checkViews'])_0x5b4eea instanceof Ea&&_0x5b4eea['resetToDefault']();}['_setupTemplate'](){const _0x5dc6f0=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-list',_0x5dc6f0['if']('isVisible','ck-hidden',_0x30ffb0=>!_0x30ffb0)]},'children':this['_checkViews']});}}class ma extends ra{static get['pluginName'](){return'AIReviewModeUI';}['createMainView'](){const _0x34d315=this['context']['plugins']['get']('AITabs'),_0x37da8c=this['context']['locale'],_0x4fbf4d=new eo(_0x37da8c,{'label':hs(_0x37da8c,'AI_REVIEW_MODE'),'icon':_0x5a6179,'class':'ck-ai-header_review','showResizeButton':_0x34d315['showResizeButton']});return _0x4fbf4d['delegate']('resizeTabs')['to'](_0x34d315),_0x4fbf4d['bind']('isMaximized')['to'](_0x34d315['view'],'isMaximized',_0x55b452=>_0x55b452),new aa(this['context']['locale'],{'header':_0x4fbf4d,'list':new pa(_0x37da8c),'results':new ca(_0x37da8c,{'generalErrorText':hs(_0x37da8c,'AI_REVIEW_MODE_GENERAL_ERROR_MESSAGE')}),'completed':new la(_0x37da8c,{'headerText':hs(_0x37da8c,'AI_REVIEW_MODE_FINISH_REVIEW_HEADER_TITLE'),'emptyResultsText':hs(_0x37da8c,'AI_REVIEW_MODE_EMPTY_RESULTS_TEXT'),'buttonText':hs(_0x37da8c,'AI_REVIEW_MODE_FINISH_REVIEW_BUTTON_LABEL')})});}['registerTab'](){const _0x1181fb=this['context']['plugins']['get']('AITabs');_0x1181fb['view']['on']('activateTab',(_0x36befe,{newTab:_0x49eae7,oldTab:_0x40107d})=>{'reviewMode'===_0x49eae7?this['fire']('getReviewCheckList'):'reviewMode'===_0x40107d&&this['fire']('leaveReview');}),_0x1181fb['view']['addTab']({'id':'reviewMode','buttonLabel':hs(this['context']['locale'],'AI_REVIEW_MODE'),'buttonIcon':_0x5a6179,'order':0x0,'content':this['_mainView']});}}const Ta='review-',Ca=['softBreak'];class wa extends _0x2599d1{static get['requires'](){return[_0x180035,Js];}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(_0x1d5508){super(_0x1d5508),this['_domEmitter']=new(Ot())(),this['_eventEmitter']=new(Tt())();}get['emitter'](){return this['_eventEmitter'];}['afterInit'](){const _0x1f545e=_0x36ecf1=>this['_scheduleAttachReviewEditingToEditor'](_0x36ecf1);if(this['_registerGlobalBalloonBlurHandler'](),this['context']instanceof _0x4da990)return void this['_attachReviewEditingToEditor'](this['context']);const _0x46a765=this['context'];for(const _0x3a991c of _0x46a765['editors'])_0x1f545e(_0x3a991c);this['listenTo'](_0x46a765['editors'],'add',(_0x44d896,_0x5b277b)=>{_0x1f545e(_0x5b277b);}),this['listenTo'](_0x46a765['editors'],'remove',(_0x35c6f2,_0x966e7d)=>{for(const [_0x4c0a32,_0x16d89d]of this['_markers'])_0x16d89d['editor']===_0x966e7d&&(this['_eventEmitter']['fire']('changeMarkerRemoved',{'markerId':_0x4c0a32,'changeId':_0x16d89d['groupId']}),this['_markers']['delete'](_0x4c0a32));});}['_scheduleAttachReviewEditingToEditor'](_0x4a6e70){const _0x493046=()=>{'destroyed'!==_0x4a6e70['state']&&_0x4a6e70['conversion']&&this['_attachReviewEditingToEditor'](_0x4a6e70);};if('ready'===_0x4a6e70['state'])return void _0x493046();const _0x2c6e8b=()=>{this['stopListening'](_0x4a6e70,'ready',_0x2c6e8b),_0x493046();};this['listenTo'](_0x4a6e70,'ready',_0x2c6e8b);}['_attachReviewEditingToEditor'](_0xd8a22e){this['_reviewEditingAttachedEditors']['has'](_0xd8a22e)||(_0xd8a22e['conversion']['for']('editingDowncast')['markerToElement']({'model':Ta+'insert','view':(_0x2d7dc6,{writer:_0x5ba22e})=>{const _0x88cb1c=this['_markers']['get'](_0x2d7dc6['markerName']),_0x4ba754={'class':'ck-ai_review-marker_add'+(this['_activeMarkers']['has'](_0x88cb1c?.['id']||'')?'\x20ck-ai_review__change_active':''),'data-marker-id':_0x2d7dc6['markerName']};return _0x5ba22e['createUIElement']('span',_0x4ba754,function(_0x1a2cbf){const _0x39b7df=this['toDomElement'](_0x1a2cbf);return _0x39b7df['innerHTML']=_0x88cb1c?.['content']?.['asString']||'',_0x39b7df;});}}),_0xd8a22e['conversion']['for']('editingDowncast')['markerToHighlight']({'model':Ta+'remove-only','view':_0x1c6012=>{const _0x4957f7=this['_markers']['get'](_0x1c6012['markerName']),_0x4eda84=['ck-ai_review-marker_strikethrough'];return this['_activeMarkers']['has'](_0x4957f7?.['id']||'')&&_0x4eda84['push']('ck-ai_review__change_active'),{'classes':_0x4eda84,'attributes':{'data-marker-id':_0x1c6012['markerName']}};}}),_0xd8a22e['conversion']['for']('editingDowncast')['markerToHighlight']({'model':Ta+'remove-context','view':_0x3d61a8=>{const _0x470e43=this['_markers']['get'](_0x3d61a8['markerName']),_0x26c4da=['ck-ai_review-marker_underline'];return this['_activeMarkers']['has'](_0x470e43?.['id']||'')&&_0x26c4da['push']('ck-ai_review__change_active'),{'classes':_0x26c4da,'attributes':{'data-marker-id':_0x3d61a8['markerName']}};}}),_0xd8a22e['conversion']['for']('editingDowncast')['markerToHighlight']({'model':Ta+'remove-text','view':_0x137223=>{const _0x117bf3=this['_markers']['get'](_0x137223['markerName']),_0x2cd082=['ck-ai_review-marker_hide'];return this['_activeMarkers']['has'](_0x117bf3?.['id']||'')&&_0x2cd082['push']('ck-ai_review__change_active'),{'classes':_0x2cd082,'attributes':{'data-marker-id':_0x137223['markerName']}};}}),_0xd8a22e['conversion']['for']('dataDowncast')['markerToElement']({'model':Ta+'suggestion-context','view':(_0x1a071e,{writer:_0x27c211})=>_0x27c211['createRawElement']('span',{'class':'ck-ai_review-marker_context-'+(_0x1a071e['isOpening']?'start':'end')})}),_0xd8a22e['conversion']['for']('downcast')['attributeToAttribute']({'model':_0x4c35c7,'view':_0x39998b}),this['_updateMouseMarkerInteractionListeners'](_0xd8a22e),this['listenTo'](_0xd8a22e,'addRoot',()=>this['_updateMouseMarkerInteractionListeners'](_0xd8a22e),{'priority':'lowest'}),this['listenTo'](_0xd8a22e,'detachRoot',()=>this['_updateMouseMarkerInteractionListeners'](_0xd8a22e),{'priority':'lowest'}),_0xd8a22e['model']['document']['registerPostFixer'](_0xf46367=>this['_validateMarkers'](_0xd8a22e,_0xf46367)),_0xd8a22e['model']['document']['on']('change',()=>this['_handleMarkerChanges'](_0xd8a22e)),this['_reviewEditingAttachedEditors']['add'](_0xd8a22e));}['_updateMouseMarkerInteractionListeners'](_0x1f9c04){let _0x40907a=this['_boundEditables']['get'](_0x1f9c04);_0x40907a||(_0x40907a=new Map(),this['_boundEditables']['set'](_0x1f9c04,_0x40907a));const _0x2c7ad3=new Set(_0x1f9c04['ui']['getEditableElementsNames']());for(const _0x394462 of _0x2c7ad3){if(_0x40907a['has'](_0x394462))continue;const _0x1db3f9=_0x1f9c04['ui']['getEditableElement'](_0x394462);_0x40907a['set'](_0x394462,_0x1db3f9),this['_attachMouseMarkerInteractionListeners'](_0x1db3f9);}for(const [_0x33cd2d,_0x338392]of _0x40907a)_0x2c7ad3['has'](_0x33cd2d)||(_0x40907a['delete'](_0x33cd2d),this['_domEmitter']['stopListening'](_0x338392));}['_attachMouseMarkerInteractionListeners'](_0x240ef9){this['_domEmitter']['listenTo'](_0x240ef9,'mouseup',(_0x1f8f5f,_0x4bd572)=>{const _0x59aaf8=_0x4bd572['target'],_0x471a16=this['_findMarkerElement'](_0x59aaf8);if(!_0x471a16)return;const _0x163e02=_0x471a16['getAttribute']('data-marker-id'),_0xc2fb60=_0x163e02['split'](':')['pop']()?.['split']('_')[0x0];this['_eventEmitter']['fire']('changeMarkerClicked',{'markerId':_0x163e02,'changeId':_0xc2fb60,'markerElement':()=>this['_findMarkerElementById'](_0x163e02),'domEvent':_0x4bd572});},{'usePassive':!0x0,'priority':'highest'}),this['_domEmitter']['listenTo'](_0x240ef9,'mouseover',(_0x378759,_0x428ddb)=>{const _0x1adbb1=_0x428ddb['target'],_0x5c0a23=_0x428ddb['relatedTarget'];let _0x2a3333=this['_findMarkerElement'](_0x1adbb1);if(!_0x2a3333&&_0x5c0a23&&(_0x2a3333=this['_findMarkerElement'](_0x5c0a23)),!_0x2a3333)return;const _0x4a3110=_0x2a3333['getAttribute']('data-marker-id'),_0x49b69a=_0x4a3110['split'](':')['pop']()?.['split']('_')[0x0];this['_eventEmitter']['fire']('changeMarkerHovered',{'changeId':_0x49b69a,'markerElement':()=>this['_findMarkerElementById'](_0x4a3110),'domEvent':_0x428ddb});});}['_registerGlobalBalloonBlurHandler'](){this['_domEmitter']['listenTo'](document,'mouseover',_0x58ec4e((_0x8ba488,_0x17664a)=>{const _0x3ba7eb=_0x17664a['target'];if(this['_findMarkerElement'](_0x3ba7eb))return;_0x3ba7eb['closest']('.ck-reset.ck-ai_review-balloon-panel-suggestion')||this['_eventEmitter']['fire']('changeMarkerBlurred');},0xc8));}['getDocumentData'](){const _0x6c5a1b=this['context']['plugins']['get']('AIEditing'),_0x1b4c71=Ws(this['context']);if(!_0x1b4c71['length'])throw new at('ai-get-editor-from-context-no-editor',this);const _0x54c55f=new Set(),_0x370d5c=[],_0x4f151e=new Map();for(const _0x2db0c2 of _0x1b4c71)for(const _0x1c21c7 of _0x2db0c2['model']['document']['getRoots']()){if('$graveyard'===_0x1c21c7['rootName'])continue;const _0x38d149=this['_buildDocumentDataSliceForRoot'](_0x2db0c2,_0x1c21c7,_0x6c5a1b,_0x54c55f);_0x370d5c['push'](_0x38d149['content']);for(const [_0x4a9132,_0x5a2c5e]of _0x38d149['elements'])_0x4f151e['set'](_0x4a9132,_0x5a2c5e);}return{'elements':_0x4f151e,'content':_0x370d5c['join']('')};}['_buildDocumentDataSliceForRoot'](_0x438c05,_0x567a1b,_0xd9ab37,_0x429bbc){const _0xde8325=_0x438c05['model'],_0xa960d2=new _0x162fe9();for(const _0x15d8d5 of _0x567a1b['getChildren']())_0xa960d2['_appendChild'](_0x15d8d5['_clone'](!0x0));for(const _0x3beef5 of _0xde8325['markers']){const _0x231940=_0x3beef5['getRange']();_0x231940&&_0x231940['root']['rootName']===_0x567a1b['rootName']&&_0xa960d2['markers']['set'](_0x3beef5['name'],this['_changeRangeOwnerDocument'](_0x231940['clone'](),_0xa960d2));}const _0x11cd3f=new Map(),_0x54a024=_0xde8325['document']['version'],_0x36d76=new _0x746070({'ignoreElementEnd':!0x0,'startPosition':_0xde8325['createPositionAt'](_0xa960d2,0x0)});for(const {item:_0x1c6b15}of _0x36d76){if(!_0x1c6b15['is']('$textProxy'))continue;const _0x30f531=_0x1c6b15['parent'];if(!_0x30f531||!_0x30f531['is']('element'))continue;const _0x78ec48=this['_upsertDataId'](_0x30f531,()=>_0xd9ab37['_nextDataId'](_0x429bbc));_0x429bbc['add'](_0x78ec48);for(const _0x15814e of _0x30f531['getChildren']())_0x15814e['is']('element')&&(_0x15814e['name']&&Ca['includes'](_0x15814e['name'])||_0x429bbc['add'](this['_upsertDataId'](_0x15814e,()=>_0xd9ab37['_nextDataId'](_0x429bbc))));let _0x319441=_0x30f531;for(;_0x319441['parent']&&!_0x319441['parent']['is']('documentFragment');)_0x319441=_0x319441['parent'],_0x319441['hasAttribute'](_0x4c35c7)&&_0x319441['_removeAttribute'](_0x4c35c7);_0x11cd3f['set'](_0x78ec48,{'editor':_0x438c05,'rootName':_0x567a1b['rootName'],'path':_0x30f531['getPath'](),'documentVersion':_0x54a024,'getContent':this['_createGetContentUsingDataIdFn'](_0x319441['_clone'](!0x0),_0x78ec48,_0x438c05['data'])}),_0x36d76['jumpTo'](_0xde8325['createPositionAfter'](_0x30f531));}return{'content':_0x438c05['data']['processor']['toData'](_0x438c05['data']['toView'](_0xa960d2)),'elements':_0x11cd3f};}['diffContent'](_0xd6b95a,_0x5308fc,_0x2d5b6d,_0x3bbcba=!0x1){const _0x10c11d=[],_0x3bb08b=_0xd6b95a['data']['parse'](_0x2d5b6d,'$documentFragment'),_0xa3b55b=_0xd6b95a['data']['parse'](_0x5308fc,'$documentFragment'),_0x296dec=_0xd6b95a['model']['createPositionAt'](_0xa3b55b,0x0);if(this['_haveSingleTopLevelElement'](_0x3bb08b)){if(!this['_hasSameTopLevelElement'](_0xa3b55b,_0x3bb08b))return _0x10c11d;}else{const _0xbe38f9=_0xd6b95a['model']['schema'];if(!this['_haveOnlyInlineContent'](_0xa3b55b,_0xbe38f9)||!this['_haveOnlyInlineContent'](_0x3bb08b,_0xbe38f9))return _0x10c11d;}const _0x308f7c=this['context']['plugins']['get']('DocumentCompare')['getDiff'](_0x5308fc,_0x2d5b6d,{'targetEditor':_0xd6b95a,'anchor':_0x296dec,'markDeletions':!0x0})['getOperations']()['filter'](_0x289224=>'insert'===_0x289224['type']||'marker'===_0x289224['type']&&_0x289224['name']['startsWith']('$markedRemove')),_0x3b0d10=this['_groupAdjacentOperations'](_0x308f7c),_0x2d599d=[];if(_0x3bbcba){if(_0x3b0d10['length']){const _0x296b28=_0x3b0d10[0x0]['operations'][0x0],_0x41c2d1='insert'===_0x296b28['type']?_0x296b28['position']:_0x296b28['newRange']['start'],_0xff343a=this['_getPositionLimitingRange'](_0x41c2d1,_0xd6b95a,'inside'),_0x2fb8ed=_0xff343a?_0x3bb08b['getChild'](0x0)['getChildren']():_0x3bb08b['getChildren'](),_0x52a5ed=_0xff343a||_0xd6b95a['model']['createRangeIn'](_0xa3b55b),_0x551bad=[new _0x13b334('$markedRemove:synthetic'+ot(),null,_0x52a5ed,_0xd6b95a['model']['document']['model']['markers'],!0x0,_0xd6b95a['model']['document']['version']+0x1),new _0x2db978(_0x52a5ed['end'],_0x2fb8ed,_0xd6b95a['model']['document']['version']+0x2)];_0x2d599d['push']({'operations':_0x551bad,'operationsIsolated':_0x551bad,'groupOffset':0x0});}}else _0x2d599d['push'](..._0x3b0d10);let _0x3413ce=0x0;return _0xd6b95a['model']['change'](_0x127dc8=>{for(let _0x127d77=0x0;_0x127d77<_0x2d599d['length'];_0x127d77++){const _0x3085b7=_0x2d599d[_0x127d77],_0x4acc7f=_0x127dc8['createDocumentFragment']();for(const _0x2337bc of _0xa3b55b['getChildren']())_0x127dc8['append'](_0x2337bc['_clone'](!0x0),_0x4acc7f);for(const _0x4ce4e1 of _0x3085b7['operationsIsolated'])if('insert'===_0x4ce4e1['type']){const _0x5b6e69=_0x4ce4e1;_0x5b6e69['baseVersion']=null,_0x5b6e69['isDocumentOperation']=!0x1,this['_changeOperationOwnerDocument'](_0x5b6e69,_0x4acc7f),_0x127dc8['batch']['addOperation'](_0x4ce4e1),_0xd6b95a['model']['applyOperation'](_0x4ce4e1);const _0x3f5dbf='suggestion:insertion:id:authorId:'+_0x3413ce++,_0x2aebbd=_0xd6b95a['model']['createRange'](_0x5b6e69['position'],_0x5b6e69['position']['getShiftedBy'](_0x5b6e69['howMany']));_0x4acc7f['markers']['set'](_0x3f5dbf,_0x2aebbd);}else{if('marker'===_0x4ce4e1['type']&&_0x4ce4e1['name']['startsWith']('$markedRemove')){const _0x1cb46b=_0x4ce4e1,_0x333b99='suggestion:deletion:id:authorId:'+_0x3413ce++;this['_changeOperationOwnerDocument'](_0x1cb46b,_0x4acc7f),_0x4acc7f['markers']['set'](_0x333b99,_0x1cb46b['newRange']);}}if(_0x3bbcba)_0x10c11d['push']({..._0x3085b7,'context':this['_createGetContentFn'](_0xa3b55b,_0xd6b95a['data']),'content':this['_createGetContentFn'](_0xa3b55b,_0xd6b95a['data'])});else{const _0x5daf87=this['_getChangeContext'](this['_changePositionOwnerDocument'](this['_getOperationStart'](_0x3085b7['operationsIsolated'][0x0]),_0x4acc7f),this['_changePositionOwnerDocument'](this['_getOperationEnd'](_0x3085b7['operationsIsolated'][_0x3085b7['operationsIsolated']['length']-0x1]),_0x4acc7f),_0xd6b95a);_0x4acc7f['markers']['set'](Ta+'suggestion-context',new _0x1cef76(_0x5daf87['start'],_0x5daf87['end'])),_0x10c11d['push']({..._0x3085b7,'context':this['_createGetContextFn'](_0x4acc7f,_0xd6b95a['data'],{'ellipsisBefore':_0x5daf87['hasContentBefore'],'ellipsisAfter':_0x5daf87['hasContentAfter']}),'content':this['_createGetContentFn'](_0x4acc7f,_0xd6b95a['data'])});}}}),_0x10c11d;}['markChangePositionInEditorContent'](_0x208a5a,_0x3244ae){if(!_0x208a5a['length'])return;const _0x5c11f7=_0x208a5a[0x0]['parent']['id'],_0x100811=_0x3244ae['elements']['get'](_0x5c11f7);if(!_0x100811)return void console['warn']('No\x20element\x20found\x20for\x20ID:\x20'+_0x5c11f7);const _0x1af4b0=_0x100811['path'],_0x37f415=_0x100811['editor'],_0x2068c4=_0x37f415['model']['document']['getRoot'](_0x100811['rootName']);if(!_0x2068c4)return void console['warn']('No\x20model\x20root\x20found\x20for\x20name:\x20'+_0x100811['rootName']);const _0x41abba=_0x37f415['model']['document']['history']['getOperations'](_0x100811['documentVersion']),_0x580ff0=[];for(const _0x562ff2 of _0x208a5a){const _0x15c7fe=_0x562ff2['operationsIsolated']['map'](_0x12772c=>this['_translateOperationToEditorContent'](_0x12772c,_0x1af4b0,_0x2068c4));if(!_0x15c7fe||!_0x15c7fe['length'])continue;const _0x42ba8d=_0x15c7fe['every'](_0x4a835a=>'marker'===_0x4a835a['type']&&_0x4a835a['name']['startsWith']('$markedRemove')),_0x40d473={'document':_0x37f415['model']['document'],'useRelations':!0x1,'padWithNoOps':!0x1},_0x425bae=_0x630f28(_0x15c7fe,_0x41abba,_0x40d473)['operationsA'];for(const _0x46b365 of _0x425bae)if('insert'===_0x46b365['type']){const _0xc160b0=_0x46b365,_0x5a4565=_0xc160b0['nodes'];_0x37f415['model']['change'](_0x4b2ba3=>{const _0x260aa=_0x4b2ba3['createDocumentFragment']();for(const _0x3be2a2 of _0x5a4565)_0x4b2ba3['append'](_0x3be2a2['_clone'](!0x0),_0x260aa);_0x580ff0['push']({'start':_0xc160b0['position'],'end':_0xc160b0['position'],'type':'insert','groupId':_0x562ff2['id'],'content':{'asString':this['_createGetContentFn'](_0x260aa,_0x37f415['data'])(),'asFragment':_0x260aa}});});}else{if('marker'===_0x46b365['type']&&_0x46b365['name']['startsWith']('$markedRemove')){const _0x4e2334=_0x46b365;let _0x3dd96c='remove-text';if(_0x42ba8d){const _0x5f48b1=this['_findAdjacentContextDistance'](_0x4e2334['newRange']['start'],'backward',_0x37f415['model']['schema']),_0x332d4b=this['_findAdjacentContextDistance'](_0x4e2334['newRange']['end'],'forward',_0x37f415['model']['schema']);if(_0x5f48b1||_0x332d4b){const _0x58c943=_0x4e2334['newRange']['start']['getShiftedBy'](-_0x5f48b1),_0x224d3d=_0x4e2334['newRange']['end']['getShiftedBy'](_0x332d4b);_0x580ff0['push']({'start':_0x58c943,'end':_0x224d3d,'groupId':_0x562ff2['id'],'type':'remove-context'});}else _0x3dd96c='remove-only';}_0x580ff0['push']({'start':_0x4e2334['newRange']['start'],'end':_0x4e2334['newRange']['end'],'groupId':_0x562ff2['id'],'type':_0x3dd96c});}}}this['_insertMarkers'](_0x580ff0,_0x37f415);}['clearAllMarkers'](){const _0x180212=new Map();for(const _0x3d5820 of this['_markers']['keys']()){const _0x335f76=this['_markers']['get'](_0x3d5820);_0x335f76?.['editor']&&(_0x180212['has'](_0x335f76['editor'])||_0x180212['set'](_0x335f76['editor'],[]),_0x180212['get'](_0x335f76['editor'])['push'](_0x3d5820));}for(const [_0x4f3784,_0x3482d1]of _0x180212)_0x4f3784['model']['change'](_0x10f3c1=>{for(const _0x1ef28c of _0x3482d1)_0x4f3784['model']['markers']['get'](_0x1ef28c)&&_0x10f3c1['removeMarker'](_0x1ef28c);});this['_markers']['clear'](),this['_activeMarkers']['clear']();}['switchToReadOnly'](){for(const _0x5e6ae5 of Ws(this['context']))_0x5e6ae5['enableReadOnlyMode']('ai-review');}['switchToEdit'](){for(const _0x19ea7a of Ws(this['context']))_0x19ea7a['disableReadOnlyMode']('ai-review');}['applyChange'](_0x1cb74e){const _0x5c7750=_0x1cb74e['map'](_0x433910=>this['_getMarkersDataForGroup'](_0x433910))['flat'](),_0x344af2=new Map();for(const _0x9a38be of _0x5c7750)_0x344af2['has'](_0x9a38be['editor'])||_0x344af2['set'](_0x9a38be['editor'],[]),_0x344af2['get'](_0x9a38be['editor'])['push'](_0x9a38be);for(const [_0x2acba4,_0xddd42f]of _0x344af2){const _0xb81e24=_0x2acba4['model'];_0xb81e24['change'](_0x4f907a=>{for(const _0x2a4c42 of _0xddd42f){const _0x23734e=_0x2acba4['model']['markers']['get'](_0x2a4c42['id']);if(_0x23734e){if('insert'===_0x2a4c42['type']){if(!_0x2a4c42['content'])continue;_0xb81e24['insertContent'](_0x2a4c42['content']['asFragment']||null,_0x23734e['getRange']()['start']);}else'remove-text'!==_0x2a4c42['type']&&'remove-only'!==_0x2a4c42['type']||_0xb81e24['deleteContent'](_0xb81e24['createSelection'](_0x23734e['getRange']()));_0x4f907a['removeMarker'](_0x2a4c42['id']),this['_markers']['delete'](_0x2a4c42['id']);}}});}}['rejectChange'](_0x127922){const _0x48b867=this['_getMarkersDataForGroup'](_0x127922),_0x290a90=new Map();for(const _0x35edf2 of _0x48b867)_0x290a90['has'](_0x35edf2['editor'])||_0x290a90['set'](_0x35edf2['editor'],[]),_0x290a90['get'](_0x35edf2['editor'])['push'](_0x35edf2);for(const [_0x11e160,_0xea5813]of _0x290a90)_0x11e160['model']['change'](_0x24dfef=>{for(const _0x9977a3 of _0xea5813)_0x24dfef['removeMarker'](_0x9977a3['id']),this['_markers']['delete'](_0x9977a3['id']);});}['getEditor'](){return $s(this['context']);}['getEditors'](){return Ws(this['context']);}['getEditorForChange'](_0x4cbff4){const _0xcaeff8=this['_getMarkersDataForGroup'](_0x4cbff4);return _0xcaeff8[0x0]?.['editor'];}['getMarkerElementForChange'](_0x3a6ec9){const _0x10b38e=Array['from'](this['_markers']['values']())['filter'](_0x28c73d=>_0x28c73d['groupId']===_0x3a6ec9);if(!_0x10b38e['length'])return null;const _0x36a877=0x1===_0x10b38e['length']?_0x10b38e[0x0]:this['_sortMarkers'](_0x10b38e)[0x0],_0x480341=_0x36a877['editor']['model']['markers']['get'](_0x36a877['id']);if(!_0x480341)return null;return{'modelRange':_0x480341['getRange'](),'getElement':()=>this['_findMarkerElementById'](_0x36a877['id'])};}['getContentElementForChange'](_0x108e98){const _0x5b8977=Array['from'](this['_markers']['values']())['filter'](_0x21a0cb=>_0x21a0cb['groupId']===_0x108e98);if(!_0x5b8977['length'])return null;const _0x506cc9=0x1===_0x5b8977['length']?_0x5b8977[0x0]:this['_sortMarkers'](_0x5b8977)[0x0],_0x103adb=_0x506cc9['editor'],_0x39ae77=_0x103adb['model']['markers']['get'](_0x506cc9['id']);if(!_0x39ae77)return null;const _0x30cda8=_0x39ae77['getRange'](),_0x4164ff=_0x103adb['editing']['view']['getDomRoot'](_0x30cda8['root']['rootName'])||_0x103adb['editing']['view']['getDomRoot']();if(!_0x4164ff||!_0x30cda8)return null;let _0x3cdd4d=_0x30cda8['start']['parent'];for(;_0x3cdd4d['parent']&&'$root'!==_0x3cdd4d['parent']['name'];)_0x3cdd4d=_0x3cdd4d['parent'];if(!_0x3cdd4d||!_0x3cdd4d['name'])return null;const _0x1f67f9=_0x4164ff['querySelector']('[data-marker-id=\x22'+_0x506cc9['id']+'\x22]');if(!_0x1f67f9)return null;let _0x5c0647=null;_0x103adb['model']['change'](_0x3a8d9d=>{_0x5c0647=_0x3a8d9d['createDocumentFragment'](),_0x3a8d9d['append'](_0x3cdd4d['_clone'](!0x0),_0x5c0647);});const _0x5500b0=_0x103adb['data']['toView'](_0x5c0647)['getChild'](0x0);return _0x1f67f9['closest'](_0x5500b0['name']);}['reactivateMarkers'](_0x527a47){const _0x4d5a25=this['_getMarkersDataForGroup'](_0x527a47);if(!_0x4d5a25['length'])return;const _0x3d6b44=Array['from'](this['_activeMarkers'])['sort'](),_0xf8c6b3=Array['from'](new Set(_0x4d5a25['map'](_0x4a65e1=>_0x4a65e1['id'])))['sort']();_0x3d6b44['join']('|')!==_0xf8c6b3['join']('|')&&(this['setAllMarkersAsInactive'](),this['setMarkersInElementAsActive'](_0x527a47));}['setMarkersInElementAsActive'](_0x3663fa){const _0x279a9e=this['_getMarkersDataForGroup'](_0x3663fa);if(!_0x279a9e['length'])return;const _0x29bf21=_0x279a9e[0x0]['editor'],_0x39a6b8=new Set(_0x279a9e['map'](_0x598e16=>_0x598e16['id'])),_0x29809a=Array['from'](_0x39a6b8['values']())['map'](_0x2676d7=>_0x29bf21['model']['markers']['get'](_0x2676d7))['filter'](_0x4ea8de=>!!_0x4ea8de);_0x39a6b8['forEach'](_0x3cc8de=>{this['_activeMarkers']['add'](_0x3cc8de);}),_0x29bf21['model']['change'](()=>{_0x29809a['forEach'](_0x46217b=>{_0x29bf21['editing']['reconvertMarker'](_0x46217b);});});}['setAllMarkersAsInactive'](){const _0x48e3a3=Array['from'](this['_activeMarkers']);if(!_0x48e3a3['length'])return;this['_activeMarkers']['clear']();const _0x114447=new Map();for(const _0x5775ea of _0x48e3a3){const _0x16adeb=this['_markers']['get'](_0x5775ea);if(!_0x16adeb)continue;const _0x4a3f8f=_0x16adeb['editor'],_0x3329c5=_0x4a3f8f['model']['markers']['get'](_0x5775ea);_0x3329c5&&(_0x114447['has'](_0x4a3f8f)||_0x114447['set'](_0x4a3f8f,[]),_0x114447['get'](_0x4a3f8f)['push'](_0x3329c5));}for(const [_0x2ca548,_0x2d4618]of _0x114447)_0x2ca548['model']['change'](()=>{_0x2d4618['forEach'](_0x369119=>{_0x2ca548['editing']['reconvertMarker'](_0x369119);});});}['_getPositionLimitingRange'](_0x46736b,_0x14951e,_0x4132ff='outside'){if(!_0x46736b)return null;let _0x1e29af=_0x46736b['parent'];for(;_0x1e29af&&_0x1e29af['parent']&&'$root'!==_0x1e29af['parent']['name']&&!_0x14951e['model']['schema']['isLimit'](_0x1e29af)&&!_0x14951e['model']['schema']['isBlock'](_0x1e29af);)_0x1e29af=_0x1e29af['parent'];if(!_0x1e29af||!_0x1e29af['name']||'$root'===_0x1e29af['name'])return null;let _0x1db9c3=null;return _0x14951e['model']['change'](_0x291f2b=>{_0x1db9c3='inside'===_0x4132ff?_0x291f2b['createRangeIn'](_0x1e29af):_0x291f2b['createRangeOn'](_0x1e29af);}),_0x1db9c3;}['_validateMarkers'](_0x389402,_0x2facb3){const _0x192ce5=Array['from'](this['_markers']['keys']()),_0x44dfd1=new Map();for(const _0x42d17e of _0x192ce5){const _0x253cdc=_0x389402['model']['markers']['get'](_0x42d17e);if(!_0x253cdc)continue;const _0x4b49af=_0x253cdc['getStart']()['root']['rootName']+':'+_0x253cdc['getStart']()['path'][0x0];_0x44dfd1['has'](_0x4b49af)||_0x44dfd1['set'](_0x4b49af,[]),_0x44dfd1['get'](_0x4b49af)['push'](_0x253cdc);}const _0xeb9110=new Set();for(const _0x434e35 of _0x389402['model']['document']['differ']['getChanges']()){let _0x5b0d50='',_0x59ca5d=null;if('insert'===_0x434e35['type'])_0x59ca5d=new _0x1cef76(_0x434e35['position'],_0x434e35['position']['getShiftedBy'](_0x434e35['length'])),_0x5b0d50=_0x434e35['position']['root']['rootName']+':'+_0x434e35['position']['path'][0x0];else{if('remove'!==_0x434e35['type'])continue;_0x59ca5d=new _0x1cef76(_0x434e35['position']),_0x5b0d50=_0x434e35['position']['root']['rootName']+':'+_0x434e35['position']['path'][0x0];}const _0x3f4231=_0x44dfd1['get'](_0x5b0d50)||[];if(_0x3f4231['length']){for(const _0x97e5e4 of _0x3f4231)if(_0x59ca5d['root']['rootName']===_0x97e5e4['getRange']()['root']['rootName']&&('insert'!==_0x434e35['type']||!_0x59ca5d['containsRange'](_0x97e5e4['getRange']()))&&(_0x59ca5d['isIntersecting'](_0x97e5e4['getRange']())||_0x59ca5d['start']['isTouching'](_0x97e5e4['getRange']()['end'])||_0x59ca5d['end']['isTouching'](_0x97e5e4['getRange']()['start']))){const _0x448510=this['_parseMarkerName'](_0x97e5e4['name']);Array['from'](this['_markers']['values']())['filter'](_0x41e429=>_0x41e429['groupId']===_0x448510['groupId'])['forEach'](_0x5aca90=>_0xeb9110['add'](_0x5aca90['id']));}}}if(_0xeb9110['size']){for(const _0x4a5c79 of _0xeb9110)_0x2facb3['removeMarker'](_0x4a5c79);return!0x0;}return!0x1;}['_handleMarkerChanges'](_0x54518e){for(const {name:_0x4ffb5b,data:_0x1e83fb}of _0x54518e['model']['document']['differ']['getChangedMarkers']()){if(!_0x4ffb5b['startsWith'](Ta))continue;const _0x2bf863=_0x1e83fb['oldRange'],_0x4d4d54=_0x1e83fb['newRange'],_0xfd61e9=_0x2bf863&&'$graveyard'===_0x2bf863['root']['rootName'],_0x5b0022=_0x4d4d54&&'$graveyard'===_0x4d4d54['root']['rootName'];if(_0xfd61e9&&_0x5b0022)continue;const _0x222dc4=this['_parseMarkerName'](_0x4ffb5b);this['_markers']['get'](_0x4ffb5b)&&(_0x5b0022||!_0x4d4d54?this['_eventEmitter']['fire']('changeMarkerRemoved',{'markerId':_0x4ffb5b,'changeId':_0x222dc4['groupId']}):_0xfd61e9&&_0x4d4d54&&this['_eventEmitter']['fire']('changeMarkerRestored',{'markerId':_0x4ffb5b,'changeId':_0x222dc4['groupId']}));}}['_parseMarkerName'](_0xcef596){const _0x1de870=_0xcef596['split'](':'),_0x54dfc3=(_0x1de870[0x1]||'')['split']('_');return{'prefix':_0x1de870[0x0],'groupId':_0x54dfc3[0x0],'suffix':_0x54dfc3[0x1]};}['_translateOperationToEditorContent'](_0xd39111,_0x330e4e,_0x5dd4d0){if('insert'===_0xd39111['type']){const _0x2dbeaa=_0xd39111;return new _0x2db978(this['_changePosition'](_0x330e4e['concat'](_0x2dbeaa['position']['offset']),_0x5dd4d0),_0x2dbeaa['nodes'],_0x2dbeaa['baseVersion']);}if('marker'===_0xd39111['type']&&_0xd39111['name']['startsWith']('$markedRemove')){const _0x222734=_0xd39111;return new _0x13b334(_0x222734['name'],_0x222734['oldRange'],this['_changeRange'](_0x222734['newRange'],_0x330e4e['concat'](_0x222734['newRange']['start']['offset']),_0x330e4e['concat'](_0x222734['newRange']['end']['offset']),_0x5dd4d0),_0x222734['_markers'],_0x222734['affectsData'],_0x222734['baseVersion']);}return _0xd39111;}['_groupAdjacentOperations'](_0x4b1e1c){if(!_0x4b1e1c['length'])return[];const _0x46a03b=[];let _0x2af323=0x0,_0x13f7a7=0x0,_0x1987cb=[];for(let _0x594c4a=0x0;_0x594c4a<=_0x4b1e1c['length'];_0x594c4a++){const _0x1935de=_0x4b1e1c[_0x594c4a],_0x13000a=_0x4b1e1c[_0x594c4a-0x1];!_0x1935de||_0x13000a&&!this['_getOperationEnd'](_0x13000a)['isTouching'](this['_getOperationStart'](_0x1935de))?(_0x46a03b['push']({'operations':_0x1987cb,'operationsIsolated':_0x1987cb['map'](_0x408c45=>this['_shiftOperation'](_0x408c45['clone'](),-_0x13f7a7)),'groupOffset':_0x2af323}),_0x1987cb=_0x1935de?[_0x1935de]:[],_0x13f7a7+=_0x2af323,_0x2af323=0x0):_0x1987cb['push'](_0x1935de),_0x1935de&&'insert'===_0x1935de['type']&&(_0x2af323+=_0x1935de['howMany']);}return _0x46a03b;}['_findAdjacentContextDistance'](_0x59adec,_0x539db1,_0x2c97ee,_0x1b6ffd=0x1){const _0xd6da3a=new _0x746070({'startPosition':_0x59adec,'direction':_0x539db1});let _0x29effa=0x0;for(let _0x3af9f5=0x0;_0x3af9f5<_0x1b6ffd;_0x3af9f5++){let _0x3ed215=0x0,_0x572529=!0x1,_0x3090d3='forward'===_0x539db1?/^\W*\w+/:/\w+\W*$/;for(const {item:_0x4cf6af}of _0xd6da3a)if(_0x4cf6af['is']('$textProxy')){const _0x46c4f3=_0x3090d3['exec'](_0x4cf6af['data']);if(_0x46c4f3&&_0x46c4f3['length']){if(_0x3ed215+='forward'===_0x539db1?_0x46c4f3['index']+_0x46c4f3[0x0]['length']:_0x4cf6af['data']['length']-_0x46c4f3['index'],_0x46c4f3[0x0]['length']!==_0x4cf6af['data']['length'])break;_0x572529=!0x0,_0x3090d3='forward'===_0x539db1?/^\w+/:/\w+$/;}else{if(_0x572529)break;_0x3ed215+=_0x4cf6af['offsetSize'];}}else{if(_0x4cf6af['is']('element')){_0x2c97ee['isInline'](_0x4cf6af)&&!_0x572529&&(_0x3ed215+=0x1);break;}}_0x29effa+=_0x3ed215,_0xd6da3a['jumpTo'](_0x59adec['getShiftedBy']('forward'===_0x539db1?_0x29effa:-_0x29effa));}return _0x29effa;}['_getChangeContext'](_0x305ae2,_0xd77059,_0x26b7d5){const _0x40697e=_0x26b7d5['model']['schema'],_0x167995=this['_findAdjacentContextDistance'](_0x305ae2,'backward',_0x40697e,0x6),_0x476f3c=this['_findAdjacentContextDistance'](_0xd77059,'forward',_0x40697e,0x6),_0x1e0943=_0x305ae2['getShiftedBy'](-_0x167995),_0xbece10=_0xd77059['getShiftedBy'](_0x476f3c);return{'start':_0x1e0943,'end':_0xbece10,'hasContentBefore':!_0x1e0943['isAtStart'],'hasContentAfter':!_0xbece10['isAtEnd']};}['_insertMarkers'](_0x1ab433,_0xa49dad){const _0x172755=this['context']['plugins']['get']('AIEditing'),_0x5b8c2e=new Set();_0xa49dad['model']['change'](_0x44f45a=>{for(const _0x526c01 of _0x1ab433){const _0x2448c9=''+Ta+_0x526c01['type']+':'+_0x526c01['groupId']+'_'+_0x172755['_nextDataId'](_0x5b8c2e);this['_markers']['set'](_0x2448c9,{'id':_0x2448c9,'groupId':_0x526c01['groupId'],'type':_0x526c01['type'],'content':_0x526c01['content'],'editor':_0xa49dad}),_0x44f45a['addMarker'](_0x2448c9,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x44f45a['createRange'](_0x526c01['start'],_0x526c01['end'])});}});}['_createGetContextFn'](_0x38c709,_0x310854,_0x2baf0a){let _0x486236='';return()=>{if(!_0x486236){const _0x3eb320=_0x310854['toView'](_0x38c709,{'showSuggestionHighlights':!0x0});let _0x3234c9=_0x3eb320['getChild'](0x0);if(_0x3234c9['is']('containerElement')||(_0x3234c9=_0x3eb320),!_0x3234c9)return'';let _0x20b866=!0x1;const _0xe2166b=[];for(const _0x37a627 of _0x3234c9['getChildren']())_0x37a627['is']('element','span')&&_0x37a627['hasClass']('ck-ai_review-marker_context-end')&&(_0x20b866=!0x1),_0x20b866&&_0xe2166b['push'](_0x37a627),_0x37a627['is']('element','span')&&_0x37a627['hasClass']('ck-ai_review-marker_context-start')&&(_0x20b866=!0x0);_0x3234c9['_removeChildren'](0x0,_0x3234c9['childCount']),_0x2baf0a?.['ellipsisBefore']&&_0x3234c9['_appendChild']('…'),_0x3234c9['_appendChild'](_0xe2166b),_0x2baf0a?.['ellipsisAfter']&&_0x3234c9['_appendChild']('…');const _0x3dc14d=_0x310854['htmlProcessor']['domConverter']['viewToDom'](_0x3eb320),_0x2b61e6=_0x310854['htmlProcessor']['htmlWriter']['getHtml'](_0x3dc14d);_0x486236=_0x2b61e6;}return _0x486236;};}['_createGetContentFn'](_0x155beb,_0x416d54){let _0x5ce48d='';return()=>(_0x5ce48d||(_0x5ce48d=_0x416d54['stringify'](_0x155beb,{'showSuggestionHighlights':!0x0})),_0x5ce48d);}['_createGetContentUsingDataIdFn'](_0x66fc02,_0x57518b,_0x4fd6cc){let _0xabdc17='';return()=>{if(!_0xabdc17){const _0x2bfa45=_0x4fd6cc['toView'](new _0x162fe9(_0x66fc02)),_0x2bb51a=_0x4fd6cc['htmlProcessor']['domConverter']['viewToDom'](_0x2bfa45)['querySelector']('[data-id=\x22'+_0x57518b+'\x22]');_0xabdc17=_0x2bb51a?.['outerHTML']||'';}return _0xabdc17;};}['_findMarkerElement'](_0xa6c0dd,_0x154b72=0x5){let _0x4b94e2=_0xa6c0dd,_0x57575e=null;for(let _0x2ee3d7=0x0;_0x2ee3d7<_0x154b72&&_0x4b94e2;_0x2ee3d7++){if(!_0x4b94e2['className']){_0x4b94e2=_0x4b94e2['parentElement'];continue;}if(!(''+_0x4b94e2['className'])['includes']('ck-ai_review-marker_')){_0x4b94e2=_0x4b94e2['parentElement'];continue;}if(!_0x4b94e2['getAttribute']('data-marker-id'))break;_0x57575e=_0x4b94e2;break;}return _0x57575e;}['_findMarkerElementById'](_0x39baa9){const _0x21e413=this['_markers']['get'](_0x39baa9),_0x108bb3=_0x21e413?.['editor']??$s(this['context']),_0x2e2155=_0x108bb3['model']['markers']['get'](_0x39baa9);return _0x2e2155?_0x3aaa99(_0x108bb3['editing'],_0x2e2155):null;}['_getMarkersDataForGroup'](_0x5f43d0){return Array['from'](this['_markers']['values']())['filter'](_0x3b3116=>_0x3b3116['groupId']===_0x5f43d0);}['_getOperationStart'](_0x20d86d){return'insert'===_0x20d86d['type']?_0x20d86d['position']:_0x20d86d['newRange']['start'];}['_getOperationEnd'](_0x2fee00,_0x522a25=!0x1){return'insert'===_0x2fee00['type']?_0x522a25?_0x2fee00['position']:_0x2fee00['position']['getShiftedBy'](_0x2fee00['howMany']):_0x2fee00['newRange']['end'];}['_shiftOperation'](_0x423699,_0x1c7f64){return'insert'===_0x423699['type']?_0x423699['position']=_0x423699['position']['getShiftedBy'](_0x1c7f64):'marker'===_0x423699['type']&&_0x423699['newRange']&&(_0x423699['newRange']=new _0x1cef76(_0x423699['newRange']['start']['getShiftedBy'](_0x1c7f64),_0x423699['newRange']['end']['getShiftedBy'](_0x1c7f64))),_0x423699;}['_changeOperationOwnerDocument'](_0xf06907,_0xb12581){'insert'===_0xf06907['type']?_0xf06907['position']=this['_changePositionOwnerDocument'](_0xf06907['position'],_0xb12581):'marker'===_0xf06907['type']&&_0xf06907['newRange']&&(_0xf06907['newRange']=this['_changeRangeOwnerDocument'](_0xf06907['newRange'],_0xb12581));}['_changePositionOwnerDocument'](_0xd5ad37,_0x35425f){return new _0x338c1f(_0x35425f,_0xd5ad37['path']);}['_changeRangeOwnerDocument'](_0x2b57a0,_0x85c24){return new _0x1cef76(this['_changePositionOwnerDocument'](_0x2b57a0['start'],_0x85c24),this['_changePositionOwnerDocument'](_0x2b57a0['end'],_0x85c24));}['_changePosition'](_0x5956c0,_0x215298){return new _0x338c1f(_0x215298,[..._0x5956c0]);}['_changeRange'](_0x4fe7b1,_0x468dda,_0x445594,_0x41cb52){return new _0x1cef76(this['_changePosition'](_0x468dda,_0x41cb52),this['_changePosition'](_0x445594,_0x41cb52));}['_sortMarkers'](_0x57ab35){const _0x1cb62d=_0x297ad3=>{switch(_0x297ad3){case'insert':return 0x0;case'remove-context':return 0x1;case'remove-only':return 0x2;case'remove-text':return 0x3;}};return _0x57ab35['sort']((_0x203905,_0x2d5116)=>_0x1cb62d(_0x203905['type'])-_0x1cb62d(_0x2d5116['type']));}['_hasSameTopLevelElement'](_0x4b3b68,_0x1be4f6){const _0x3297f0=_0x4b3b68['getChild'](0x0),_0x182c9d=_0x1be4f6['getChild'](0x0);return!(!_0x3297f0||!_0x182c9d)&&((!_0x3297f0['is']('element')||!_0x182c9d['is']('element')||_0x3297f0['name']===_0x182c9d['name'])&&!(_0x3297f0['is']('element')&&!_0x182c9d['is']('element')||!_0x3297f0['is']('element')&&_0x182c9d['is']('element')));}['_haveSingleTopLevelElement'](_0x27440a){return 0x1===_0x27440a['childCount'];}['_haveOnlyInlineContent'](_0x2d46bf,_0x18cc7e){for(const _0x3e27e0 of _0x2d46bf['getChildren']())if(_0x3e27e0['is']('element')&&!_0x18cc7e['isInline'](_0x3e27e0))return!0x1;return!0x0;}['_upsertDataId'](_0x1be81b,_0x45c11c){let _0x12f941=_0x1be81b['getAttribute'](_0x4c35c7);return _0x12f941||(_0x12f941=_0x45c11c(),_0x1be81b['_setAttribute'](_0x4c35c7,_0x12f941)),_0x12f941;}}class fa extends Tt(){['id'];['contentNew'];['contentInitial'];['documentVersion'];constructor({id:_0x2cf7ae,contentNew:_0x3f02e4,contentInitial:_0x4f8548,documentVersion:_0x38eb19}){super(),this['id']=_0x2cf7ae,this['contentNew']=_0x3f02e4,this['contentInitial']=_0x4f8548,this['documentVersion']=_0x38eb19;}}class ba extends ht(){['id'];['parent'];['_data'];['_editorOperations']=[];constructor(_0xad47b9,_0x5c357a,_0x401d8c){super(),this['id']=_0xad47b9,this['parent']=_0x401d8c,this['_data']=_0x5c357a,this['set']('isActivated',!0x1),this['set']('isRated',!0x1),this['set']('status','pending'),this['on']('change:status',()=>{'pending'!==this['status']&&this['isActivated']&&(this['isActivated']=!0x1);});}get['contentDiffed'](){return this['_data']['context']();}get['operations'](){return this['_data']['operations'];}get['operationsIsolated'](){return this['_data']['operationsIsolated'];}}class Sa extends ht(){['id']=ot();['callId'];['_results']=new Map();['_changes']=[];['_sourceCheck'];['_documentData'];['_aiConnector'];['_reviewParams'];['_reviewArgs'];['_activeRequest']=null;['_currentError'];['_wasAborted']=!0x1;constructor(_0x1172d2,_0x4eec11,_0x2cd191,_0xbe333a,_0x58a251){super(),this['_sourceCheck']=_0x4eec11,this['_documentData']=_0x1172d2,this['_aiConnector']=_0x2cd191,this['_reviewParams']=_0xbe333a,this['_reviewArgs']=_0x58a251,this['on']('change:status',(_0xdf9ac3,_0x3d031d,_0x4c3620)=>{'aborted'==_0x4c3620&&(this['_wasAborted']=!0x0),this['fire']('reviewCheckRunUpdated',{'status':_0x4c3620,'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'](_0x5c73d9=>'pending'===_0x5c73d9['status']);}get['currentError'](){return this['_currentError'];}['updateDocumentData'](_0x5103db){this['_documentData']=_0x5103db;}async['start'](){this['status']='loading',this['_currentError']=void 0x0;try{this['_activeRequest']=this['_createApiRequest']();const _0x4922c5=await this['_activeRequest']['getStream']();this['status']='data';for await(const _0x58219b of _0x4922c5)'unmodified'!==_0x58219b['data']['operation']&&('error'!==_0x58219b['data']['operation']?'review-metadata'!==_0x58219b['event']?this['_addReviewCheckResult'](_0x58219b['data']['dataId'],_0x58219b['data']['textDelta']):this['callId']=_0x58219b['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(_0x1deec8){this['_currentError']=_0x1deec8,_0x1deec8 instanceof Error&&_0x1deec8['message']['includes']('ai-request-aborted')?this['status']='aborted':this['status']='error-general';}finally{this['_activeRequest']=null;}}async['restart'](){this['_results']['clear'](),this['_changes']['length']=0x0,this['_currentError']=void 0x0,await this['start']();}['addResultChanges'](_0x211571,_0x4a6b96){const _0x5e97b8=this['_results']['get'](_0x211571);if(!_0x5e97b8)return;if(0x0===_0x4a6b96['length'])return;const _0x5bd7f1=[];_0x4a6b96['forEach']((_0x961b9b,_0x3371c4)=>{const _0x176d3c=new ba(_0x5e97b8['id']+'-'+_0x3371c4,_0x961b9b,_0x5e97b8);_0x176d3c['on']('change:status',()=>{this['fire']('reviewCheckResultChangeStatusUpdated',{'change':_0x176d3c,'status':_0x176d3c['status']});}),_0x176d3c['on']('change:isActivated',()=>{_0x176d3c['isActivated']?this['fire']('reviewCheckResultActivated',{'change':_0x176d3c}):this['fire']('reviewCheckResultDeactivated',{'change':_0x176d3c});}),this['_changes']['push'](_0x176d3c),_0x5bd7f1['push'](_0x176d3c);}),this['fire']('reviewCheckResultReady',{'changes':_0x5bd7f1,'result':_0x5e97b8,'source':this});}['abort'](){this['_activeRequest']&&(this['_activeRequest']['abortController']['abort'](),this['_activeRequest']=null,this['status']='aborted');}['isChangeActive'](_0x527167){const _0x20bd1c=this['_changes']['find'](_0x285a00=>_0x285a00['id']===_0x527167);return!(!_0x20bd1c||'pending'!==_0x20bd1c['status']);}['isAnyChangeActivated'](){return this['_changes']['some'](_0x221cdc=>!0x0===_0x221cdc['isActivated']);}['getActiveChanges'](){return this['_changes']['filter'](_0x105ff9=>'pending'===_0x105ff9['status']);}['getChangeById'](_0x41a093){return this['_changes']['find'](_0x83bf89=>_0x83bf89['id']===_0x41a093);}['markAllChangesAsAccepted'](){for(const _0x324cba of this['_changes'])'pending'===_0x324cba['status']&&(_0x324cba['status']='accepted');this['_checkIfFinished']();}['markChangeAsAccepted'](_0x108f72){const _0x48a830=this['_changes']['find'](_0x4c2aea=>_0x4c2aea['id']===_0x108f72);_0x48a830&&'pending'===_0x48a830['status']&&(_0x48a830['status']='accepted'),this['_checkIfFinished']();}['markChangeAsRejected'](_0x53cfe5){const _0x5e970b=this['_changes']['find'](_0x4edfb5=>_0x4edfb5['id']===_0x53cfe5);_0x5e970b&&'pending'===_0x5e970b['status']&&(_0x5e970b['status']='rejected'),this['_checkIfFinished']();}['markChangeAsOutdated'](_0x11b333){const _0x4e7240=this['_changes']['find'](_0x828af8=>_0x828af8['id']===_0x11b333);_0x4e7240&&'pending'===_0x4e7240['status']&&(_0x4e7240['status']='outdated'),this['_checkIfFinished']();}['markChangeAsPending'](_0x3457cf){const _0x2f64d4=this['_changes']['find'](_0x2a0ad3=>_0x2a0ad3['id']===_0x3457cf);_0x2f64d4&&'outdated'===_0x2f64d4['status']&&(_0x2f64d4['status']='pending'),this['_checkIfFinished']();}['activateChange'](_0x16c46d){this['_changes']['filter'](_0x207d89=>_0x207d89['isActivated']&&_0x207d89['id']!==_0x16c46d)['forEach'](_0x4da0cb=>{_0x4da0cb['isActivated']=!0x1;});const _0x1b2acc=this['_changes']['find'](_0x27e70d=>_0x27e70d['id']===_0x16c46d);_0x1b2acc&&'pending'===_0x1b2acc['status']&&(_0x1b2acc['isActivated']=!0x0);}['deactivateChange'](){this['_changes']['filter'](_0x1b6378=>_0x1b6378['isActivated'])['forEach'](_0x459aa8=>{_0x459aa8['isActivated']=!0x1;});}['forceReadyState'](){this['status']='ready';}async['sendRating'](_0x1fb0cb){if('initialized'===this['status']||'loading'===this['status']||'data'===this['status']||this['_wasAborted'])return;if(!this['callId']||0x0===this['_changes']['length'])return;let _0x493cf2;if(_0x1fb0cb){const _0x324db3=this['_changes']['find'](_0x2e5296=>_0x2e5296['id']===_0x1fb0cb);if(_0x324db3&&_0x324db3['isRated'])return;_0x324db3&&(_0x493cf2=_0x324db3['parent']['id'],_0x324db3['isRated']=!0x0);}const _0x5b3e05={'positiveCount':this['_changes']['filter'](_0x1b235=>'accepted'===_0x1b235['status'])['length'],'totalCount':this['_changes']['length']};this['_sendRatingRequest'](_0x5b3e05,this['callId'],_0x493cf2);}['_addReviewCheckResult'](_0x3c3c91,_0x2239a9){const _0x45528e=this['_documentData']['elements']['get'](_0x3c3c91);if(!_0x45528e)return;const _0x58d94d=_0x45528e['getContent']();if(_0x58d94d===_0x2239a9)return;const _0x39fe04=new fa({'id':_0x3c3c91,'contentInitial':_0x58d94d,'contentNew':_0x2239a9,'documentVersion':_0x45528e['documentVersion']});this['_results']['set'](_0x39fe04['id'],_0x39fe04),this['fire']('reviewCheckResultAdded',{'result':_0x39fe04,'source':this,'editor':_0x45528e['editor']});}['_checkIfFinished'](){'finished'===this['status']&&(this['_changes']['filter'](_0x2051f1=>'pending'===_0x2051f1['status'])['length']>0x0&&(this['status']='ready')),'ready'===this['status']&&(0x0===this['_changes']['filter'](_0x4b876b=>'pending'===_0x4b876b['status'])['length']&&(this['status']='finished'));}}class Ra extends Sa{get['subTitle'](){if(!this['_reviewParams']||0x0===this['_reviewParams']['length'])return'';const _0x36d4a9=[];if(this['_reviewParams']['length']>0x0&&this['_sourceCheck']['options'])for(let _0x53f9aa=0x0;_0x53f9aa<this['_reviewParams']['length'];_0x53f9aa++){if(!this['_reviewParams'][_0x53f9aa]||!this['_sourceCheck']['options'][_0x53f9aa])continue;const _0x5b0fb0=this['_sourceCheck']['options'][_0x53f9aa],_0x4d20b3=_0x5b0fb0['data']?.['find'](_0x4095ff=>_0x4095ff['id']===this['_reviewParams'][_0x53f9aa]);_0x4d20b3&&_0x36d4a9['push'](_0x4d20b3['label']);}return _0x36d4a9['join'](',\x20');}get['reviewName'](){return this['_composeReviewName']();}['_createApiRequest'](){return this['_aiConnector']['callSystemReview']({'reviewName':this['_composeReviewName'](),'content':this['_documentData']['content'],'args':this['_reviewArgs']});}['_sendRatingRequest'](_0xb666aa,_0x37412e,_0x3f8fc0){return this['_aiConnector']['upsertAIReviewRating'](this['reviewName'],_0x37412e,_0xb666aa,_0x3f8fc0);}['_composeReviewName'](){return!this['_reviewParams']||0x0===this['_reviewParams']['length']||this['_sourceCheck']['useArgs']?this['_sourceCheck']['apiId']:[this['_sourceCheck']['apiId'],...this['_reviewParams']]['join']('-');}}class Oa extends _0x2599d1{['_aiConnector'];['_aiReviewCoreUi'];['_aiReviewCoreEditing'];['_aiReviewCheckList'];['_currentReviewCheckRun'];['_changeActivationSource']=null;static get['requires'](){return[as];}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}async['init'](){this['_initRequiredPlugins'](),this['_aiReviewCheckList']=await this['_getChecksList'](),this['listenTo'](this['_aiReviewCoreUi'],'getReviewCheckList',()=>{this['_aiReviewCoreUi']['setAvailableChecks'](this['_aiReviewCheckList']['checks']);}),this['listenTo'](this['_aiReviewCoreUi'],'runReviewCheck',async(_0x4bb74e,_0x5373a0)=>{const _0x16630d=this['_aiReviewCheckList']['getCheckById'](_0x5373a0['id']);if(_0x16630d){this['_onReviewCheckRun'](_0x5373a0),this['_aiReviewCoreEditing']['switchToReadOnly'](),this['_currentReviewCheckRun']=this['_createReviewCheckRun'](_0x5373a0,_0x16630d),this['_aiReviewCoreUi']['setCheckResultTitle'](this['_currentReviewCheckRun']['title'],this['_currentReviewCheckRun']['subTitle']),this['_currentReviewCheckRun']['on']('reviewCheckRunUpdated',(_0x465222,_0x161478)=>{switch(_0x161478['status']){case'data':case'loading':this['_aiReviewCoreUi']['showCheckRunResults'](_0x161478);break;case'finished':this['_onCheckRunFinished']();break;case'ready':this['_aiReviewCoreUi']['showActionsWhenResultIsReady']();break;case'unmodified':this['_aiReviewCoreUi']['showNoChangesView']();break;case'error-general':this['_aiReviewCoreUi']['showGeneralResultsErrorView'](),this['_logError'](new at('ai-review-mode-check-run-general-error',this,void 0x0,this['_currentReviewCheckRun']?.['currentError']));break;case'error-chunk':this['_aiReviewCoreUi']['showChunkErrorView'](),this['_logError'](new at('ai-review-mode-check-run-chunk-error',this,void 0x0,this['_currentReviewCheckRun']?.['currentError']));break;case'aborted':this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['processedResultsCount']>0x0?setTimeout(()=>{this['_currentReviewCheckRun']?.['forceReadyState']();},0x0):this['_onReviewRunLeave'](!0x0);}'ready'!==_0x161478['status']&&'error-chunk'!==_0x161478['status']&&'error-general'!==_0x161478['status']||this['_currentReviewCheckRun']?.['sendRating']();}),this['_currentReviewCheckRun']['on']('reviewCheckResultAdded',(_0x1feb7e,_0x497c7f)=>{if(!this['_currentReviewCheckRun'])throw new at('ai-review-mode-no-current-check-run',this);const _0x5031ff=this['_diffContent'](_0x497c7f['editor'],_0x497c7f['result']['contentInitial'],_0x497c7f['result']['contentNew']);_0x497c7f['source']['addResultChanges'](_0x497c7f['result']['id'],_0x5031ff);}),this['_currentReviewCheckRun']['on']('reviewCheckResultReady',(_0x1ebb62,_0x225b77)=>{for(const _0x1d363b of _0x225b77['changes'])this['_aiReviewCoreUi']['showCheckRunResult'](_0x1d363b);this['_markChangePositionInEditorContent'](_0x225b77['changes'],_0x225b77['source']['documentData']);}),this['_currentReviewCheckRun']['on']('reviewCheckResultChangeStatusUpdated',(_0x4b65fe,_0x132eaa)=>{this['_aiReviewCoreUi']['updateChangeState'](_0x132eaa['change']['id'],_0x132eaa['status']);}),this['_currentReviewCheckRun']['on']('reviewCheckResultActivated',(_0x2837df,_0x808acc)=>{this['_onReviewCheckResultActivated'](_0x808acc);}),this['_currentReviewCheckRun']['on']('reviewCheckResultDeactivated',()=>{this['_onReviewCheckResultDeactivated']();});try{await this['_currentReviewCheckRun']['start']();}catch(_0x335a4d){_0x335a4d instanceof Error&&_0x335a4d['message']['includes']('ai-request-aborted')||(_0x335a4d instanceof at?this['_logError'](_0x335a4d):this['_logError'](new at('ai-review-mode-check-run-failed',this,void 0x0,_0x335a4d)));}}else this['_logError'](new at('ai-review-mode-source-check-not-found',this,{'checkId':_0x5373a0['id']}));}),this['listenTo'](this['_aiReviewCoreUi'],'leaveReview',()=>{this['_onReviewRunLeave']();}),this['listenTo'](this['_aiReviewCoreUi'],'leaveReviewCoreResultList',()=>{this['_onReviewRunLeave'](!0x0);}),this['listenTo'](this['_aiReviewCoreUi'],'abortReviewStream',()=>{this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['abort']();}),this['listenTo'](this['_aiReviewCoreUi'],'finishReview',()=>{this['_onReviewRunLeave'](!0x0);}),this['listenTo'](this['_aiReviewCoreUi'],'acceptAllChanges',()=>{if(!this['_currentReviewCheckRun'])return;const _0x3d41c6=this['_currentReviewCheckRun']['getActiveChanges']();if(!_0x3d41c6['length'])return;this['_aiReviewCoreEditing']['applyChange'](_0x3d41c6['map'](_0xc7b64e=>_0xc7b64e['id']));const _0x6f8138=this['_currentReviewCheckRun'];_0x6f8138['markAllChangesAsAccepted'](),_0x6f8138['sendRating']();}),this['listenTo'](this['_aiReviewCoreUi'],'acceptChange',(_0x1c23ac,_0x36b723)=>{this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['isChangeActive'](_0x36b723['id'])&&(this['_aiReviewCoreEditing']['applyChange']([_0x36b723['id']]),this['_currentReviewCheckRun']['markChangeAsAccepted'](_0x36b723['id']),this['_aiReviewCoreUi']['hideChangeBalloon'](),this['_currentReviewCheckRun']['sendRating'](_0x36b723['id']));}),this['listenTo'](this['_aiReviewCoreUi'],'dismissChange',(_0x4988c0,_0x46901a)=>{this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['isChangeActive'](_0x46901a['id'])&&(this['_aiReviewCoreEditing']['rejectChange'](_0x46901a['id']),this['_currentReviewCheckRun']['markChangeAsRejected'](_0x46901a['id']),this['_aiReviewCoreUi']['hideChangeBalloon'](),this['_currentReviewCheckRun']['sendRating'](_0x46901a['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',(_0x5fde5,_0x17218)=>{this['_onActivateChange'](_0x17218);}),this['listenTo'](this['_aiReviewCoreUi'],'deactivateChange',(_0x540775,_0x34ad3c)=>{this['_onDeactivateChange'](_0x34ad3c);}),this['listenTo'](this['_aiReviewCoreEditing']['emitter'],'changeMarkerClicked',(_0x2d1b51,_0x2661ee)=>{this['_onChangeMarkerClicked'](_0x2d1b51,_0x2661ee);}),this['listenTo'](this['_aiReviewCoreEditing']['emitter'],'changeMarkerHovered',(_0x22813e,_0x3af7bd)=>{this['_onChangeMarkerHovered'](_0x22813e,_0x3af7bd);}),this['listenTo'](this['_aiReviewCoreEditing']['emitter'],'changeMarkerBlurred',()=>{this['_onChangeMarkerBlurred']();}),this['listenTo'](this['_aiReviewCoreEditing']['emitter'],'changeMarkerRemoved',(_0x1931af,_0x9b6b42)=>{this['_onChangeMarkerRemoved'](_0x1931af,_0x9b6b42);}),this['listenTo'](this['_aiReviewCoreEditing']['emitter'],'changeMarkerRestored',(_0x261fe3,_0x1b6386)=>{this['_onChangeMarkerRestored'](_0x261fe3,_0x1b6386);});}['_createReviewCheckRun'](_0x6530a3,_0xe54a97){return new Ra(this['_aiReviewCoreEditing']['getDocumentData'](),_0xe54a97,this['_aiConnector'],_0x6530a3['params'],_0x6530a3['args']);}['_onChangeMarkerRemoved'](_0x431bbd,_0x1b7e07){this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['markChangeAsOutdated'](_0x1b7e07['changeId']);}['_onChangeMarkerRestored'](_0x245d0e,_0x48a52c){this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['markChangeAsPending'](_0x48a52c['changeId']);}['_onCheckRunFinished'](){this['_aiReviewCoreUi']['showReviewCompletedView']();}['_initRequiredPlugins'](){this['_aiConnector']=this['context']['plugins']['get']('AIConnector');}['_onReviewRunLeave'](_0x3b91b9=!0x1){this['_currentReviewCheckRun']&&(this['_currentReviewCheckRun']['hasModifications']||this['_currentReviewCheckRun']['sendRating'](),this['_currentReviewCheckRun']['stopListening'](),this['_currentReviewCheckRun']['abort'](),this['_currentReviewCheckRun']=void 0x0),_0x3b91b9&&this['_aiReviewCoreUi']['showReviewCheckList'](),this['_aiReviewCoreEditing']['clearAllMarkers'](),this['_aiReviewCoreEditing']['switchToEdit'](),this['_changeActivationSource']=null;for(const _0x5b33ae of this['_aiReviewCoreEditing']['getEditors']())_0x5b33ae['editing']['view']['change'](_0x3a2bdc=>{for(const _0x349c7e of _0x5b33ae['editing']['view']['document']['getRoots']())_0x3a2bdc['removeClass']('ck-ai_review-diff',_0x349c7e),_0x3a2bdc['removeClass']('ck-ai_review-highlights',_0x349c7e),_0x3a2bdc['removeClass']('ck-ai-translate-mode-content',_0x349c7e);});}['_getTranslationWithDefault'](_0x25b926,_0x3c78db){const _0xec22f5=hs(this['context']['locale'],_0x25b926);return _0xec22f5===_0x25b926?_0x3c78db:_0xec22f5;}['_logError'](_0x58c639,_0x44117f=!0x1){Et(_0x58c639['message']),_0x44117f||(_0x58c639['message']['startsWith']('ai-review-mode-models-unable-to-retrieve')?this['_aiReviewCoreUi']['showGeneralReviewCoreErrorView']():this['_aiReviewCoreUi']['showGeneralResultsErrorView']());}['_scrollToChange'](_0x159c0a){if('content'===this['_changeActivationSource']){const _0x12259a=this['_aiReviewCoreUi']['getChangeElement'](_0x159c0a);_0x12259a&&ft(_0x12259a['closest']('.ck-ai_review__check-run-result')||_0x12259a);}else{if('panel'===this['_changeActivationSource']){const _0x55a332=this['_getChangeContentElement'](_0x159c0a);if(!_0x55a332)return;Ct({'target':_0x55a332,'viewportOffset':{'top':0x55,'left':0x0,'bottom':0x0,'right':0x0},'ancestorOffset':0x14,'alignToTop':!0x0});}}}}const ka=[{'id':'custom','commandId':'custom','title':'Custom\x20command','description':'Type\x20a\x20custom\x20command\x20to\x20review\x20the\x20content\x20exactly\x20as\x20you\x20need.','isParameterized':!0x0},{'id':'correctness','commandId':'correctness','title':'Correctness','description':'Ensure\x20the\x20text\x20is\x20factually\x20accurate\x20and\x20free\x20of\x20errors.','isParameterized':!0x1},{'id':'clarity','commandId':'clarity','title':'Clarity','description':'Improve\x20the\x20clarity\x20and\x20readability\x20of\x20the\x20text.','isParameterized':!0x1},{'id':'readability','commandId':'readability','title':'Readability','description':'Enhance\x20the\x20overall\x20readability\x20of\x20the\x20text.','isParameterized':!0x1},{'id':'length','commandId':'make','title':'Adjust\x20length','description':'Refine\x20text\x20length\x20to\x20match\x20your\x20needs.','isParameterized':!0x0,'options':[{'formType':'dropdown','label':'Adjust\x20length','default':'longer','data':[{'label':'Longer','id':'longer'},{'label':'Shorter','id':'shorter'}]}]},{'id':'tone','commandId':'make-tone','title':'Adjust\x20tone\x20and\x20style','description':'Choose\x20tone\x20and\x20style\x20to\x20change\x20content\x20as\x20you\x20need.','isParameterized':!0x0,'options':[{'formType':'dropdown','label':'Adjust\x20tone\x20and\x20style','default':'casual','data':[{'label':'Casual','id':'casual'},{'label':'Direct','id':'direct'},{'label':'Friendly','id':'friendly'},{'label':'Confident','id':'confident'},{'label':'Professional','id':'professional'}]}]}];class Na{['id'];['commandId'];['title'];['description'];['isParameterized'];['useArgs'];['options'];['args'];get['apiId'](){return this['commandId'];}constructor(_0x30f31a){this['id']=_0x30f31a['id'],this['commandId']=_0x30f31a['commandId'],this['title']=_0x30f31a['title'],this['description']=_0x30f31a['description'],this['isParameterized']=_0x30f31a['isParameterized'],this['useArgs']=_0x30f31a['useArgs'],this['options']=_0x30f31a['options'],this['args']=_0x30f31a['args'];}}class va extends ht(){['_checks']=[];['setupChecks'](_0x23634d){this['_checks']=_0x23634d['map'](_0x46073e=>new Na(_0x46073e));}get['checks'](){return this['_checks'];}['getCheckById'](_0x261092){return this['checks']['find'](_0x55afac=>_0x55afac['id']===_0x261092);}['removeCheckById'](_0x56a162){this['_checks']=this['_checks']['filter'](_0x5bf6a5=>_0x5bf6a5['id']!==_0x56a162);}}class ya extends Na{['_models']=[];['_defaultModel']=null;constructor(_0x3f7106,_0x4a10cf,_0x4ab751){super(_0x3f7106),this['_models']=_0x4a10cf,this['_defaultModel']=_0x4ab751;}get['models'](){return this['_models'];}get['defaultModel'](){return this['_defaultModel'];}}class xa extends Na{['isExtra']=!0x0;['prompt'];['model'];['_defaultModel']=null;constructor(_0x197cfd,_0x148e66,_0x575896){super(_0x197cfd),this['prompt']=_0x197cfd['prompt'],this['model']=_0x197cfd['model'],this['model']?this['_defaultModel']=_0x148e66['find'](_0x5683c9=>_0x5683c9['id']===this['model'])||null:this['_defaultModel']=_0x575896;}get['defaultModel'](){return this['_defaultModel'];}}class La extends va{['_allModels']=[];['_recommendedModels']=[];['_defaultModel']=null;constructor(_0x3e9667,_0x5c6265,_0x3860a1){super(),this['_allModels']=_0x3e9667,this['_recommendedModels']=_0x5c6265,this['_defaultModel']=_0x3860a1;}['setupChecks'](_0x515f60){this['_checks']=_0x515f60['map'](_0x328489=>!0x0===_0x328489['isExtra']?new xa(_0x328489,this['_allModels'],this['_defaultModel']):'custom'===_0x328489['id']?new ya(_0x328489,this['_recommendedModels'],this['_defaultModel']):new Na(_0x328489));}}class Da extends Sa{['_prompt'];['_model'];constructor(_0x2aa230,_0x1a12f1,_0x19b250,_0x207ae0,_0x4e0e20){super(_0x19b250,_0x207ae0,_0x4e0e20),this['_prompt']=_0x2aa230,this['_model']=_0x1a12f1;}get['subTitle'](){return this['_prompt'];}['_createApiRequest'](){return this['_aiConnector']['callCustomReview']({'content':this['_documentData']['content'],'prompt':this['_prompt'],'model':this['_model']});}['_sendRatingRequest'](_0x6a5cff,_0x3f7682,_0x38b232){return this['_aiConnector']['upsertCustomAIReviewRating'](_0x3f7682,_0x6a5cff,_0x38b232);}}class Pa extends Da{get['subTitle'](){return'';}set['prompt'](_0xaea2df){this['_prompt']=_0xaea2df;}set['model'](_0x35b971){this['_model']=_0x35b971;}}class Ha extends Oa{static get['pluginName'](){return'AIReviewModeController';}['_isDiffOn']=!0x1;['_hasDefaultAvailableCommands']=!0x1;constructor(_0x38f602){super(_0x38f602),this['_hasDefaultAvailableCommands']=!this['context']['config']['get']('ai.review.availableCommands'),this['context']['config']['define']('ai.review.availableCommands',ka['map'](_0x258766=>_0x258766['id'])),this['context']['config']['define']('ai.review.extraCommands',[]);}async['init'](){await super['init'](),this['listenTo'](this['_aiReviewCoreUi'],'toggleDiff',(_0x37da84,_0x2f279d)=>{this['_isDiffOn']=_0x2f279d['on'],this['_onDiffChange'](this['_isDiffOn']);});}['_initRequiredPlugins'](){super['_initRequiredPlugins'](),this['_aiReviewCoreUi']=this['context']['plugins']['get']('AIReviewModeUI'),this['_aiReviewCoreEditing']=this['context']['plugins']['get']('AIReviewCoreEditing');}['_createReviewCheckRun'](_0x3944a8,_0x52f939){return _0x3944a8['isCustom']?new Da(_0x3944a8['args']['prompt'],_0x3944a8['args']['model'],this['_aiReviewCoreEditing']['getDocumentData'](),_0x52f939,this['_aiConnector']):_0x52f939['isExtra']?new Pa(_0x52f939['prompt'],_0x52f939['defaultModel']['id'],this['_aiReviewCoreEditing']['getDocumentData'](),_0x52f939,this['_aiConnector']):new Ra(this['_aiReviewCoreEditing']['getDocumentData'](),_0x52f939,this['_aiConnector'],_0x3944a8['params'],_0x3944a8['args']);}['_onReviewCheckResultActivated'](_0x12626a){this['_aiReviewCoreUi']['setActiveStateInResults'](_0x12626a['change']['id']),this['_scrollToChange'](_0x12626a['change']['id']);const _0x95b429=this['_aiReviewCoreEditing']['getMarkerElementForChange'](_0x12626a['change']['id']);if(!_0x95b429)return;const _0x88f4aa=this['_aiReviewCoreEditing']['getEditorForChange'](_0x12626a['change']['id'])??this['_aiReviewCoreEditing']['getEditor']();this['_aiReviewCoreUi']['showChangeBalloon'](_0x12626a['change'],()=>_0x95b429['getElement'](),void 0x0,'click',this['_getBalloonDomRoot'](_0x88f4aa,_0x95b429['modelRange']['root']['rootName']),_0x88f4aa?.['ui']?.['viewportOffset']),this['_aiReviewCoreEditing']['setMarkersInElementAsActive'](_0x12626a['change']['id']);}['_onReviewCheckResultDeactivated'](){this['_aiReviewCoreUi']['resetActiveStateInResults'](),this['_aiReviewCoreUi']['hideChangeBalloon'](),this['_aiReviewCoreEditing']['setAllMarkersAsInactive']();}['_onActivateChange'](_0x21c24a){this['_currentReviewCheckRun']&&'click'===_0x21c24a['uiInteraction']&&(this['_changeActivationSource']='panel',this['_currentReviewCheckRun']['activateChange'](_0x21c24a['id']));}['_onDeactivateChange'](_0x308ea6){this['_currentReviewCheckRun']&&'balloon'===_0x308ea6['origin']&&this['_currentReviewCheckRun']['deactivateChange']();}['_onChangeMarkerClicked'](_0x13aa02,_0x31fff4){if(!this['_currentReviewCheckRun'])return;this['_changeActivationSource']='content',this['_currentReviewCheckRun']['activateChange'](_0x31fff4['changeId']);const _0x12e604=this['_currentReviewCheckRun']['getChangeById'](_0x31fff4['changeId']);if(!_0x12e604)return;const _0x331794=this['_aiReviewCoreEditing']['getMarkerElementForChange'](_0x31fff4['changeId']),_0x187178=this['_aiReviewCoreEditing']['getEditorForChange'](_0x31fff4['changeId'])??this['_aiReviewCoreEditing']['getEditor']();this['_aiReviewCoreUi']['showChangeBalloon'](_0x12e604,_0x31fff4['markerElement'],_0x31fff4['domEvent'],'click',this['_getBalloonDomRoot'](_0x187178,_0x331794?.['modelRange']['root']['rootName']),_0x187178?.['ui']?.['viewportOffset']);}['_onChangeMarkerHovered'](_0x30cbf5,_0x1a7a18){if(!this['_currentReviewCheckRun'])return;if(this['_currentReviewCheckRun']['isAnyChangeActivated']())return;const _0x45f6e1=this['_currentReviewCheckRun']['getChangeById'](_0x1a7a18['changeId']);if(!_0x45f6e1)return;const _0x41e8db=this['_aiReviewCoreEditing']['getMarkerElementForChange'](_0x1a7a18['changeId']),_0x3e07d6=this['_aiReviewCoreEditing']['getEditorForChange'](_0x1a7a18['changeId'])??this['_aiReviewCoreEditing']['getEditor']();this['_aiReviewCoreUi']['showChangeBalloon'](_0x45f6e1,_0x1a7a18['markerElement'],_0x1a7a18['domEvent'],'hover',this['_getBalloonDomRoot'](_0x3e07d6,_0x41e8db?.['modelRange']['root']['rootName']),_0x3e07d6?.['ui']?.['viewportOffset']);}['_onChangeMarkerBlurred'](){if(!this['_currentReviewCheckRun'])return;this['_currentReviewCheckRun']['isAnyChangeActivated']()||this['_aiReviewCoreUi']['hideChangeBalloon']();}['_getChangeContentElement'](_0x472b47){const _0x506f5e=this['_aiReviewCoreEditing']['getMarkerElementForChange'](_0x472b47);return _0x506f5e?_0x506f5e['getElement']():null;}['_markChangePositionInEditorContent'](_0x23ea1b,_0x16cc8c){this['_aiReviewCoreEditing']['markChangePositionInEditorContent'](_0x23ea1b,_0x16cc8c);}['_diffContent'](_0x1a8b84,_0x1a2b08,_0x33a1aa){return this['_aiReviewCoreEditing']['diffContent'](_0x1a8b84,_0x1a2b08,_0x33a1aa,!0x1);}['_onReviewCheckRun'](){this['_onDiffChange'](this['_isDiffOn']);}['_onDiffChange'](_0x5d1dcd){_0x5d1dcd?this['_aiReviewCoreUi']['hideDiffInBalloon']():this['_aiReviewCoreUi']['showDiffInBalloon']();for(const _0x339541 of this['_aiReviewCoreEditing']['getEditors']())_0x339541['editing']['view']['change'](_0x4706ae=>{for(const _0x379bcf of _0x339541['editing']['view']['document']['getRoots']()){for(const _0x9a5e2a of _0x379bcf['getClassNames']())_0x9a5e2a['startsWith']('ck-ai_review-')&&_0x4706ae['removeClass'](_0x9a5e2a,_0x379bcf);_0x4706ae['addClass'](_0x5d1dcd?'ck-ai_review-diff':'ck-ai_review-highlights',_0x379bcf);}});}['_getBalloonDomRoot'](_0x52f242,_0x28d6d1){const _0x18b279=_0x52f242['editing']['view'];if(_0x28d6d1){const _0x23513b=_0x18b279['getDomRoot'](_0x28d6d1);if(_0x23513b)return _0x23513b;}return _0x18b279['getDomRoot']()??void 0x0;}async['_getChecksList'](){const _0x20a916=[...ka,...this['_getExtraChecks']()],_0x464b3c=this['context']['config']['get']('ai.review.availableCommands')||[];this['_logErrorForNonExistentChecks'](_0x464b3c,_0x20a916);let _0x4aac08=_0x20a916;this['_hasDefaultAvailableCommands']||(_0x4aac08=_0x464b3c['map'](_0x106dae=>_0x20a916['find'](_0x11b8c3=>_0x11b8c3['id']===_0x106dae))['filter'](_0x56bbdb=>!!_0x56bbdb)),_0x4aac08=_0x4aac08['map'](_0x319b06=>_0x319b06['isExtra']?_0x319b06:this['_translateReviewCheck'](_0x319b06));const _0x2d2344=_0x4aac08['some'](_0x4888c4=>_0x4888c4['isExtra']||'custom'===_0x4888c4['id']);let _0x1f12a3=[],_0x912000=[],_0x323a4a=null;if(_0x2d2344){const _0x24f86a=await this['_getModels']();_0x1f12a3=_0x24f86a['all'],_0x912000=_0x24f86a['recommended'],_0x323a4a=_0x24f86a['default'];}const _0x1da8a7=new La(_0x1f12a3,_0x912000,_0x323a4a);return _0x1da8a7['setupChecks'](_0x4aac08),_0x2d2344&&this['_filterChecksWithMissingModel'](_0x1da8a7),_0x1da8a7;}['_getExtraChecks'](){return(this['context']['config']['get']('ai.review.extraCommands')||[])['map'](_0x3cea0e=>({'id':_0x3cea0e['id'],'commandId':_0x3cea0e['id'],'title':_0x3cea0e['label'],'description':_0x3cea0e['description'],'isParameterized':!0x1,'isExtra':!0x0,'prompt':_0x3cea0e['prompt'],'model':_0x3cea0e['model']}));}['_logErrorForNonExistentChecks'](_0x1ee5b6,_0x368ceb){const _0x1e31aa=_0x1ee5b6['filter'](_0x2c920c=>!_0x368ceb['some'](_0x55e52e=>_0x55e52e['id']===_0x2c920c));_0x1e31aa['length']&&this['_logError'](new at('ai-review-mode-non-existent-commands-used',this,{'commandIds':_0x1e31aa['join'](',\x20')}),!0x0);}async['_getModels'](){try{const _0x1ce517=new Fs({'connector':this['_aiConnector'],'config':this['context']['config']['get']('ai.models'),'locale':this['context']['locale']});return{'all':await _0x1ce517['getAll'](),'recommended':await _0x1ce517['getAvailableModels'](),'default':await _0x1ce517['getDefault']()};}catch(_0x5b2e43){return this['_logError'](new at('ai-review-mode-models-unable-to-retrieve',this,void 0x0,_0x5b2e43)),{'all':[],'recommended':[],'default':null};}}['_translateReviewCheck'](_0x151c11){const _0x171a48='AI_REVIEW_CHECK_'+_0x151c11['id']['toUpperCase']()['replaceAll']('-','_'),_0x4562a5={..._0x151c11,'title':this['_getTranslationWithDefault'](_0x171a48+'_TITLE',_0x151c11['title']),'description':this['_getTranslationWithDefault'](_0x171a48+'_DESCRIPTION',_0x151c11['description'])};return _0x151c11['options']&&(_0x4562a5['options']=_0x151c11['options']['map'](_0xbc973a=>({..._0xbc973a,'label':this['_getTranslationWithDefault'](_0x171a48+'_OPTIONS_LABEL',_0xbc973a['label']||''),'data':_0xbc973a['data']?_0xbc973a['data']['map'](_0x44fcdc=>({..._0x44fcdc,'label':this['_getTranslationWithDefault'](_0x171a48+'_OPTIONS_DATA_'+_0x44fcdc['id']['toUpperCase'](),_0x44fcdc['label'])})):void 0x0}))),_0x4562a5;}['_filterChecksWithMissingModel'](_0x2aab72){const _0x2e0b5d=[];_0x2aab72['checks']['forEach'](_0x51a73c=>{(_0x51a73c instanceof xa&&!_0x51a73c['defaultModel']||_0x51a73c instanceof ya&&!_0x51a73c['models']['length'])&&_0x2e0b5d['push'](_0x51a73c['id']);}),_0x2e0b5d['length']&&_0x2e0b5d['forEach'](_0x386d96=>{_0x2aab72['removeCheckById'](_0x386d96),this['_logError'](new at('ai-review-mode-command-unavailable-due-to-missing-model',this,{'commandId':_0x386d96}),!0x0);});}}class Ma extends _0x2599d1{static get['requires'](){return[Ha,ma,wa];}static get['pluginName'](){return'AIReviewMode';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}class Ua extends Na{get['apiId'](){return'translate';}}class Va extends va{['setupChecks'](_0x7c9268){this['_checks']=_0x7c9268['map'](_0xbe6e4=>new Ua(_0xbe6e4));}}class Ba extends Ra{['_title'];constructor(_0x5614cc,_0x4fb8e6,_0x14bf21,_0x12ad39,_0xf6b9c5,_0x59aa21){super(_0x5614cc,_0x4fb8e6,_0x14bf21,_0xf6b9c5,_0x59aa21),this['_title']=_0x12ad39;}get['title'](){return this['_title'];}get['subTitle'](){return this['_sourceCheck']['title'];}}class Ga extends Oa{static get['pluginName'](){return'AITranslateController';}constructor(_0x5c2bd7){super(_0x5c2bd7),this['context']['config']['define']('ai.translate.languages',[{'label':'English','id':'english'},{'label':'Spanish','id':'spanish'},{'label':'French','id':'french'},{'label':'German','id':'german'},{'label':'Chinese\x20(Simplified)','id':'chinese'},{'label':'Japanese','id':'japanese'},{'label':'Russian','id':'russian'},{'label':'Portuguese','id':'portuguese'},{'label':'Korean','id':'korean'},{'label':'Italian','id':'italian'}]);}['_onCheckRunFinished'](){this['_onReviewRunLeave'](!0x0);}['_initRequiredPlugins'](){super['_initRequiredPlugins'](),this['_aiReviewCoreUi']=this['context']['plugins']['get']('AITranslateUI'),this['_aiReviewCoreEditing']=this['context']['plugins']['get']('AIReviewCoreEditing');}['_createReviewCheckRun'](_0xa4b4b5,_0x1bd17d){return new Ba(this['_aiReviewCoreEditing']['getDocumentData'](),_0x1bd17d,this['_aiConnector'],hs(this['context']['locale'],'AI_REVIEW_CHECK_TRANSLATE_TITLE'),_0xa4b4b5['params'],_0xa4b4b5['args']);}['_onReviewCheckResultActivated'](_0x187af6){this['_aiReviewCoreUi']['setActiveStateInResults'](_0x187af6['change']['id']),this['_aiReviewCoreEditing']['setMarkersInElementAsActive'](_0x187af6['change']['id']);}['_onReviewCheckResultDeactivated'](){this['_aiReviewCoreEditing']['setAllMarkersAsInactive'](),this['_aiReviewCoreUi']['resetActiveStateInResults']();}['_onActivateChange'](_0x412a04){this['_currentReviewCheckRun']&&('hover'===_0x412a04['uiInteraction']&&(this['_changeActivationSource']='panel',this['_currentReviewCheckRun']['activateChange'](_0x412a04['id'])),'click'===_0x412a04['uiInteraction']&&this['_scrollToChange'](_0x412a04['id']));}['_onDeactivateChange'](_0x5cd68f){this['_currentReviewCheckRun']&&'panel'===_0x5cd68f['origin']&&this['_currentReviewCheckRun']['deactivateChange']();}['_onChangeMarkerClicked'](_0x3dad5f,_0x224c1f){this['_currentReviewCheckRun']&&(this['_changeActivationSource']='content',this['_currentReviewCheckRun']['activateChange'](_0x224c1f['changeId']),this['_scrollToChange'](_0x224c1f['changeId']));}['_onChangeMarkerHovered'](_0x7abfbc,_0x3c025d){this['_currentReviewCheckRun']&&(this['_changeActivationSource']='content',this['_currentReviewCheckRun']['activateChange'](_0x3c025d['changeId']),this['_aiReviewCoreEditing']['reactivateMarkers'](_0x3c025d['changeId']));}['_onChangeMarkerBlurred'](){this['_currentReviewCheckRun']&&'content'===this['_changeActivationSource']&&(this['_currentReviewCheckRun']['deactivateChange'](),this['_aiReviewCoreEditing']['setAllMarkersAsInactive']());}['_getChangeContentElement'](_0x119e86){return this['_aiReviewCoreEditing']['getContentElementForChange'](_0x119e86);}['_markChangePositionInEditorContent'](_0x23ae13,_0x448067){this['_aiReviewCoreEditing']['markChangePositionInEditorContent'](_0x23ae13,_0x448067);}['_diffContent'](_0x9e565b,_0x5cf31a,_0x5a49e6){return this['_aiReviewCoreEditing']['diffContent'](_0x9e565b,_0x5cf31a,_0x5a49e6,!0x0);}['_onReviewCheckRun'](){for(const _0x8f2112 of this['_aiReviewCoreEditing']['getEditors']())_0x8f2112['editing']['view']['change'](_0x3de748=>{for(const _0x2bc70f of _0x8f2112['editing']['view']['document']['getRoots']())_0x3de748['addClass']('ck-ai-translate-mode-content',_0x2bc70f);});}async['_getChecksList'](){const _0x292af5=[],_0x2dc2b=this['context']['config']['get']('ai.translate.languages')||[];for(const _0xb73f19 of _0x2dc2b)_0x292af5['push']({'title':_0xb73f19['label'],'id':_0xb73f19['id'],'commandId':_0xb73f19['id'],'description':'','isParameterized':!0x1,'useArgs':!0x0,'args':{'language':_0xb73f19['id']}});const _0x3645df=new Va();return _0x3645df['setupChecks'](this['_translateChecks'](_0x292af5)),_0x3645df;}['_translateChecks'](_0x1d5c4c){return _0x1d5c4c['map'](_0x4f0948=>{const _0x56e08c='AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_'+_0x4f0948['title']['toUpperCase']()['replaceAll']('-','_');return{..._0x4f0948,'title':this['_getTranslationWithDefault'](_0x56e08c,_0x4f0948['title'])};});}}class Fa extends ca{constructor(_0x1b97d1,_0x139b89){super(_0x1b97d1,_0x139b89),this['on']('set:isLoading',(_0x95a022,_0x1aebe9,_0x45867f)=>{_0x45867f&&(this['headerTitle']=hs(this['locale'],'AI_TRANSLATE_CHECK_RESULTS_LOADING_TITLE'));}),this['on']('set:isResultReady',(_0x100118,_0x548c2f,_0x101add)=>{_0x101add&&(this['headerTitle']=hs(this['locale'],'AI_TRANSLATE_CHECK_RESULTS_READY_TITLE'));});}['_createAcceptAllButtonView'](){const _0x49d204=super['_createAcceptAllButtonView']();return _0x49d204['set']('label',hs(this['locale'],'AI_TRANSLATE_ACCEPT_ALL')),_0x49d204;}['_createExitReviewButtonView'](){const _0x4942ff=super['_createExitReviewButtonView']();return _0x4942ff['set']('label',hs(this['locale'],'AI_CHAT_HISTORY_CANCEL')),_0x4942ff;}}class Ka extends pa{['_setupTemplate'](){const _0x4f6cee=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-translate__check-list-wrapper',_0x4f6cee['if']('isVisible','ck-hidden',_0x38411e=>!_0x38411e)]},'children':[{'tag':'div','attributes':{'class':['ck-ai-translate__check-list-header']},'children':[{'tag':'h2','children':[{'text':hs(this['locale'],'AI_TRANSLATE_CHECK_LIST_HEADER_TITLE')}]},{'tag':'p','children':[{'text':hs(this['locale'],'AI_TRANSLATE_CHECK_LIST_HEADER_DESCRIPTION')}]}]},{'tag':'div','attributes':{'class':['ck-ai_review__check-list',_0x4f6cee['if']('isVisible','ck-hidden',_0x36d5c2=>!_0x36d5c2)]},'children':this['_checkViews']}]});}}class Wa extends ra{static get['pluginName'](){return'AITranslateUI';}['createMainView'](){const _0x35c9b1=this['context']['plugins']['get']('AITabs'),_0x52592c=this['context']['locale'],_0x3d09ac=new eo(_0x52592c,{'label':hs(_0x52592c,'AI_REVIEW_CHECK_TRANSLATE_TITLE'),'icon':_0x142ddd,'class':'ck-ai-header_review-translate','showResizeButton':_0x35c9b1['showResizeButton']});_0x3d09ac['delegate']('resizeTabs')['to'](_0x35c9b1),_0x3d09ac['bind']('isMaximized')['to'](_0x35c9b1['view'],'isMaximized',_0x183bdd=>_0x183bdd);const _0x40661f=new aa(_0x52592c,{'header':_0x3d09ac,'list':new Ka(_0x52592c),'results':new Fa(_0x52592c,{'generalErrorText':hs(_0x52592c,'AI_TRANSLATE_GENERAL_ERROR_MESSAGE')}),'completed':new la(_0x52592c,{'headerText':hs(_0x52592c,'AI_TRANSLATE_FINISH_HEADER_TITLE'),'emptyResultsText':hs(_0x52592c,'AI_TRANSLATE_EMPTY_RESULTS_TEXT'),'buttonText':hs(_0x52592c,'AI_TRANSLATE_FINISH_BUTTON_LABEL')})});return _0x40661f['extendTemplate']({'attributes':{'class':'ck-ai-translate-mode'}}),_0x40661f;}['registerTab'](){const _0x570ae4=this['context']['plugins']['get']('AITabs');_0x570ae4['view']['on']('activateTab',(_0xef5313,{newTab:_0x574a9e,oldTab:_0x4e1e56})=>{'translate'===_0x574a9e?this['fire']('getReviewCheckList'):'translate'===_0x4e1e56&&this['fire']('leaveReview');}),_0x570ae4['view']['addTab']({'id':'translate','buttonLabel':hs(this['context']['locale'],'AI_REVIEW_CHECK_TRANSLATE_TITLE'),'buttonIcon':_0x142ddd,'order':0x0,'content':this['_mainView']});}}class Ya extends _0x2599d1{static get['requires'](){return[Ga,Wa,wa];}static get['pluginName'](){return'AITranslate';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}export{ta as AIActions,Ri as AIAdapter,Xi as AIAssistant,$i as AIAssistantUI,Oo as AIBalloon,Eo as AIChat,Xs as AIChatController,nr as AIChatFeedCustomElementView,Io as AIChatHistory,Ao as AIChatHistoryController,uo as AIChatHistoryUI,Bs as AIChatInteraction,Co as AIChatShortcuts,ro as AIChatUI,as as AIConnector,Js as AIEditing,xo as AIEditorIntegration,Ds as AIInteraction,ea as AIQuickActions,Wo as AIQuickActionsUI,xs as AIReply,Oi as AIRequestError,Na as AIReviewCheck,fa as AIReviewCheckResult,ba as AIReviewCheckResultChange,Sa as AIReviewCheckRun,Ma as AIReviewMode,Oa as AIReviewModeController,wa as AIReviewModeEditing,ma as AIReviewModeUI,os as AITabs,rs as AITabsMainView,is as AITabsView,ji as AITextAdapter,fo as AIToggleButtonUI,Ya as AITranslate,Ga as AITranslateController,Wa as AITranslateUI,Zi as AWSTextAdapter,Ji as OpenAITextAdapter,Ni as ShowAIAssistantCommand,wo as ToggleAICommand,ds as createResizeButton,zi as getDefaultAICommands};
23
+ import{Plugin as _0x18211b,Command as _0x5bebe4,ContextPlugin as _0x203d97,Editor as _0x17198a}from'@ckeditor/ckeditor5-core/dist/index.js';import{IconCopy as _0x37c8e9,IconCheck as _0x2204df,IconError as _0x5b7ec6,IconSubmit as _0x18c4f0,IconAIHistory as _0x4a149c,IconMagicWand as _0x24f7ab,IconRobotPencil as _0x2c57e8,IconMaximize as _0x33ceb8,IconMinimize as _0x16dfe5,IconShowChangesOn as _0x1ad2ce,IconShowChangesOff as _0x306402,IconDocument as _0x386a1,IconBoxWithCross as _0x404ed0,IconBoxWithCheck as _0xa10937,IconBoxWithMarker as _0x3c7297,IconInfo as _0x2f4ba7,IconWeb as _0x4b1ef5,IconCancel as _0x104621,IconSelection as _0x5d4805,IconFileUpload as _0x36ddaf,IconLink as _0x3a2322,IconBulb as _0x3f94ae,IconAI as _0x23ecdc,IconPreviousArrow as _0x14fdc4,IconDocumentOutline as _0x196b7a,IconLoupe as _0x413214,IconPaperClip as _0x4fd8ad,IconBrowseFiles as _0x265576,IconDropdownArrow as _0xa36a14,IconStop as _0x25a26a,IconPlus as _0x4b4dbe,IconAIChat as _0x156709,IconPin as _0x24484f,IconThreeHorizontalDots as _0x5a6e34,IconAIReview as _0x317a11,IconAITranslate as _0x12e558,IconAIAskAI as _0x45c724,IconThumbUp as _0x358e38,IconThumbDown as _0x36e2a6,IconChevronDown as _0x39062c,IconChevronUp as _0x41ea6f,IconAIQuickActions as _0x3f90e7,IconAIChatCommands as _0x2dbe23,IconAIImproveWriting as _0x47c605,IconAIContinueWriting as _0x1dee61,IconAIGrammarCheck as _0x3a7052,IconAIAdjustLength as _0x5c6e7b,IconAIChangeTone as _0x45f76c,IconAIOther as _0x1f2792,IconRefresh as tt,IconNextArrow as et,IconOutdated as it,IconEye as st,IconEyeCrossedOut as nt,IconChevronRight as rt}from'@ckeditor/ckeditor5-icons/dist/index.js';import{uid as ot,CKEditorError as at,ObservableMixin as ht,global as ct,isVisible as lt,Rect as ut,Collection as dt,FocusTracker as _t,KeystrokeHandler as gt,first as At,logWarning as It,logError as Et,toArray as pt,version as mt,EmitterMixin as Tt,scrollViewportToShowTarget as Ct,insertToPriorityArray as wt,scrollAncestorsToShowTarget as ft,ResizeObserver as bt,_isMotionReduced as St,getConstrainedViewportRect as Rt,DomEmitterMixin as Ot}from'@ckeditor/ckeditor5-utils/dist/index.js';import{ToolbarView as kt,ButtonView as Nt,View as vt,SpinnerView as yt,IconView as xt,AutocompleteView as Lt,ListView as Dt,ListItemGroupView as Pt,ListItemView as Ht,ButtonLabelView as Mt,FocusCycler as Ut,createLabeledTextarea as Vt,Dialog as Bt,createDropdown as Gt,addMenuToDropdown as Ft,MenuBarMenuView as Kt,MenuBarMenuListItemButtonView as Wt,DialogViewPosition as Yt,MenuBarMenuListView as $t,MenuBarMenuListItemView as qt,BodyCollection as Qt,BalloonPanelView as Xt,clickOutsideHandler as zt,addListToDropdown as jt,UIModel as Jt,submitHandler as Zt,LabeledFieldView as te,createLabeledInputText as _0x4e0fb9,FormHeaderView as _0x7a349c,HighlightedTextView as _0x149c0b,ViewCollection as _0x3f24a6,FileDialogButtonView as _0x10774f,InputTextView as _0x974836,SearchTextView as _0x1b1ba3,ListItemButtonView as _0x2c6f29,ButtonLabelWithHighlightView as _0x5a486f,DropdownMenuPanelPositioningFunctions as _0x3be29e,BalloonToolbar as _0x12ae68,FormRowView as _0x18b064,TextareaView as _0x51c860}from'@ckeditor/ckeditor5-ui/dist/index.js';import{ClipboardPipeline as _0x5c85e6,ClipboardMarkersUtils as _0x30b604}from'@ckeditor/ckeditor5-clipboard/dist/index.js';import{ViewDocumentDomEventData as _0x6f9828,ViewDataTransfer as _0xc19f8c,ViewUpcastWriter as _0x513f3a,Matcher as _0x359d2c,_DetachOperation as _0x25589e,_insertIntoModelNodeList as _0x4e370c,_removeFromModelNodeList as _0x54f979,ModelRange as _0x28623e,transformOperationSets as _0x1b61b0,ViewDowncastWriter as _0x3e7bae,ModelDocumentFragment as _0x49b7d4,ModelPosition as _0x1133b3,ModelTreeWalker as _0x50dc86,MarkerOperation as _0x506cfe,InsertOperation as _0x58e173}from'@ckeditor/ckeditor5-engine/dist/index.js';import{unescape as _0x5e4ce5,escape as _0x3e1bcc,cloneDeep as _0x5dca53,throttle as _0x5c3fa4,debounce as _0x3b5df9,escapeRegExp as _0x271311}from'es-toolkit/compat';import{createParser as _0x493a5f}from'eventsource-parser';import{CloudServices as _0x241029}from'@ckeditor/ckeditor5-cloud-services/dist/index.js';import{parseDocument as _0x4192fa}from'htmlparser2';import{isTag as _0x526176,findOne as _0x140027,getParent as _0x17ebde,findAll as _0x1b06b2,removeElement as _0x38c273,prepend as _0x3822cc,prependChild as _0x113ebe,appendChild as _0x30ceba,append as _0x452435,find as _0x5f8a2c,isComment as _0x1dd8a6,replaceElement as _0x3ddbdc,getChildren as _0x3d540f,textContent as _0xb78cbf}from'domutils';import ti from'dom-serializer';import{Document as _0x837b91,Element as _0x307097,Text as _0x3bcbda,cloneNode as _0x583d74,isDocument as _0x530132,isText as _0x2bdc66,NodeWithChildren as _0xfa284d}from'domhandler';import{MarkdownGfmMdToHtmlDefaultPlugins as _0x2e055b,MarkdownGfmMdToHtml as _0x2d790b}from'@ckeditor/ckeditor5-markdown-gfm/dist/index.js';import _0x5290ef from'rehype-sanitize';import{fixElementSuggestionRange as _0x44cc67,DocumentCompare as _0x58b094,DATA_ID_MODEL_ATTRIBUTE as _0x522952,ConfirmMixin as _0x47bae9,getAllMarkersDomElementsSorted as _0x2e8baf,SuggestionsConversion as _0x56a0f6,DATA_ID_VIEW_ATTRIBUTE as _0x4b4ee0,getMarkerDomElement as _0x59016c}from'@ckeditor/ckeditor5-collaboration-core/dist/index.js';import _0x243921 from'morphdom';import{diffArrays as _0x224b98}from'diff';const Ci='_ungrouppedCommands';function wi(_0x375f98,_0x43aec9){const _0x25605c=(0x0,_0x43aec9['t'])('Other');return _0x375f98['length']?'groupId'in _0x375f98[0x0]?_0x375f98:[{'groupId':Ci,'groupLabel':_0x25605c,'order':0x1/0x0,'commands':_0x375f98}]:[{'groupId':Ci,'groupLabel':_0x25605c,'order':0x1/0x0,'commands':[]}];}const fi=globalThis['DataTransfer'],bi='ai-ui';class Si extends _0x18211b{static get['pluginName'](){return'AIAssistantEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const {editor:_0x45a8aa}=this,_0x43f265=['ck-fake-ai-selection'];_0x45a8aa['config']['get']('ai.assistant.useTheme')&&_0x43f265['push']('ck-ai-assistant-ui_theme'),_0x45a8aa['conversion']['for']('editingDowncast')['markerToHighlight']({'model':bi,'view':{'classes':_0x43f265,'priority':0xc}}),_0x45a8aa['conversion']['for']('editingDowncast')['markerToElement']({'model':bi,'view':(_0x1b425f,{writer:_0x684b11})=>{if(!_0x1b425f['markerRange']['isCollapsed'])return null;const _0x351eff=_0x684b11['createUIElement']('span');return _0x684b11['addClass'](['ck-fake-ai-selection','ck-fake-ai-selection_collapsed'],_0x351eff),_0x351eff;}});}['afterInit'](){!async function(_0x356573){const _0x1ac187=_0x40a002([0x6e,0x41,0x37,0x79,0x75,0x72,0x67,0x4f,0x48,0x62,0x5a,0x76,0x44,0x70,0x6c,0x52,0x6b,0x4a,0x73,0x63,0x64,0x49,0x43,0x6d,0x38,0x36,0x6f,0x50,0x57,0x78,0x39,0x32,0x66,0x31,0x71,0x46,0x30,0x4c,0x61,0x53,0x58,0x33,0x4e,0x47,0x77,0x54,0x4d,0x4b,0x34,0x6a,0x56,0x74,0x59,0x55,0x42,0x51,0x69,0x35,0x7a,0x68,0x65,0x45]),_0xc36288=0x3dffc4e1,_0x5d1225=0x3df84d71^_0xc36288,_0x39a2c3=window[_0x40a002([0x44,0x61,0x74,0x65])][_0x40a002([0x6e,0x6f,0x77])](),_0x4de7a7=_0x356573[_0x40a002([0x65,0x64,0x69,0x74,0x6f,0x72])],_0x166658=new window[(_0x40a002([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x10aa2a=>{_0x4de7a7[_0x40a002([0x6f,0x6e,0x63,0x65])](_0x40a002([0x72,0x65,0x61,0x64,0x79]),_0x10aa2a);}),_0x5a7898={[_0x40a002([0x6b,0x74,0x79])]:_0x40a002([0x45,0x43]),[_0x40a002([0x75,0x73,0x65])]:_0x40a002([0x73,0x69,0x67]),[_0x40a002([0x63,0x72,0x76])]:_0x40a002([0x50,0x2d,0x32,0x35,0x36]),[_0x40a002([0x78])]:_0x40a002([0x69,0x43,0x6a,0x4f,0x43,0x76,0x44,0x46,0x49,0x36,0x6c,0x51,0x48,0x48,0x54,0x31,0x38,0x6a,0x56,0x77,0x52,0x66,0x6b,0x66,0x48,0x51,0x32,0x61,0x5f,0x4d,0x79,0x6d,0x54,0x33,0x35,0x4c,0x51,0x56,0x6f,0x46,0x53,0x41,0x49]),[_0x40a002([0x79])]:_0x40a002([0x6b,0x58,0x49,0x79,0x4a,0x34,0x65,0x76,0x74,0x43,0x45,0x46,0x52,0x6d,0x78,0x4b,0x53,0x55,0x70,0x4b,0x39,0x66,0x44,0x57,0x34,0x35,0x39,0x76,0x58,0x4f,0x76,0x56,0x72,0x68,0x66,0x36,0x75,0x51,0x41,0x65,0x4f,0x69,0x6f]),[_0x40a002([0x61,0x6c,0x67])]:_0x40a002([0x45,0x53,0x32,0x35,0x36])},_0x1e9bb1=_0x4de7a7[_0x40a002([0x63,0x6f,0x6e,0x66,0x69,0x67])][_0x40a002([0x67,0x65,0x74])](_0x40a002([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79]));async function _0x4361e3(){let _0x16c233,_0x4e3428=null,_0x320255=null;try{if(_0x1e9bb1==_0x40a002([0x47,0x50,0x4c]))return _0x40a002([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]);if(_0x16c233=_0x1a9775(),!_0x16c233)return _0x40a002([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);return _0x16c233[_0x40a002([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])]&&(_0x320255=_0x23a2eb(_0x16c233[_0x40a002([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])],_0x16c233[_0x40a002([0x6a,0x74,0x69])])),await _0x53e0f6()?_0x3c7d98()?_0x1583a9()?_0x40a002([0x45,0x78,0x70,0x69,0x72,0x65,0x64]):_0x3fb8a9()?(_0x16c233[_0x40a002([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])]==_0x40a002([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e])&&(_0x4e3428=_0x4ed584(_0x40a002([0x45,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e,0x4c,0x69,0x6d,0x69,0x74]))),await _0x32062a()):_0x40a002([0x44,0x6f,0x6d,0x61,0x69,0x6e,0x4c,0x69,0x6d,0x69,0x74]):_0x40a002([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]):_0x40a002([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}catch{return _0x40a002([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}function _0x1583a9(){const _0x5bc3d2=[_0x40a002([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e]),_0x40a002([0x74,0x72,0x69,0x61,0x6c])][_0x40a002([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x16c233[_0x40a002([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])])?_0x39a2c3/0x3e8:0xe10*_0x5d1225;return _0x16c233[_0x40a002([0x65,0x78,0x70])]<_0x5bc3d2;}function _0x3c7d98(){const _0x23512d=_0x16c233[_0x40a002([0x66,0x65,0x61,0x74,0x75,0x72,0x65,0x73])];return!!_0x23512d&&(!!_0x23512d[_0x40a002([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x40a002([0x2a]))||!!_0x23512d[_0x40a002([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x40a002([0x41,0x49])));}function _0x3fb8a9(){const _0x268556=_0x16c233[_0x40a002([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x64,0x48,0x6f,0x73,0x74,0x73])];if(!_0x268556||0x0==_0x268556[_0x40a002([0x6c,0x65,0x6e,0x67,0x74,0x68])])return!0x0;const {hostname:_0x1460d1}=new URL(window[_0x40a002([0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e])]['href']);if(_0x268556[_0x40a002([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x1460d1))return!0x0;const _0x3f441c=_0x1460d1[_0x40a002([0x73,0x70,0x6c,0x69,0x74])](_0x40a002([0x2e]));return _0x268556[_0x40a002([0x66,0x69,0x6c,0x74,0x65,0x72])](_0x2b9068=>_0x2b9068[_0x40a002([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x40a002([0x2a])))[_0x40a002([0x6d,0x61,0x70])](_0x3c9af9=>_0x3c9af9[_0x40a002([0x73,0x70,0x6c,0x69,0x74])](_0x40a002([0x2e])))[_0x40a002([0x66,0x69,0x6c,0x74,0x65,0x72])](_0x951b7e=>_0x951b7e[_0x40a002([0x6c,0x65,0x6e,0x67,0x74,0x68])]<=_0x3f441c[_0x40a002([0x6c,0x65,0x6e,0x67,0x74,0x68])])[_0x40a002([0x6d,0x61,0x70])](_0x126283=>Array(_0x3f441c[_0x40a002([0x6c,0x65,0x6e,0x67,0x74,0x68])]-_0x126283[_0x40a002([0x6c,0x65,0x6e,0x67,0x74,0x68])])[_0x40a002([0x66,0x69,0x6c,0x6c])](_0x126283[0x0]===_0x40a002([0x2a])?_0x40a002([0x2a]):'')[_0x40a002([0x63,0x6f,0x6e,0x63,0x61,0x74])](_0x126283))[_0x40a002([0x73,0x6f,0x6d,0x65])](_0x341524=>_0x3f441c[_0x40a002([0x65,0x76,0x65,0x72,0x79])]((_0x4ef2e0,_0x33c110)=>_0x341524[_0x33c110]===_0x4ef2e0||_0x341524[_0x33c110]===_0x40a002([0x2a])));}function _0x32062a(){return _0x4e3428&&_0x320255?new window[(_0x40a002([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0x4636d5,_0x5b75ba)=>{_0x4e3428[_0x40a002([0x74,0x68,0x65,0x6e])](_0x4636d5,_0x5b75ba),_0x320255[_0x40a002([0x74,0x68,0x65,0x6e])](_0x304355=>{_0x304355!=_0x40a002([0x56,0x61,0x6c,0x69,0x64])&&_0x4636d5(_0x304355);},_0x5b75ba);}):_0x4e3428||_0x320255||_0x40a002([0x56,0x61,0x6c,0x69,0x64]);}}function _0x23a2eb(_0x1b41b3,_0x45214c){return new window[(_0x40a002([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x5a7a2f=>{if(_0x3f82a8())return _0x5a7a2f(_0x40a002([0x56,0x61,0x6c,0x69,0x64]));_0x13673c(),_0x4de7a7[_0x40a002([0x64,0x65,0x63,0x6f,0x72,0x61,0x74,0x65])](_0x40a002([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]));let _0x1db6eb=!0x1;const _0x415c56=ot();function _0x48c583(_0xe92ea4){return!!_0xe92ea4&&(typeof _0xe92ea4===_0x40a002([0x6f,0x62,0x6a,0x65,0x63,0x74])||typeof _0xe92ea4===_0x40a002([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]))&&typeof _0xe92ea4[_0x40a002([0x74,0x68,0x65,0x6e])]===_0x40a002([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e])&&typeof _0xe92ea4[_0x40a002([0x63,0x61,0x74,0x63,0x68])]===_0x40a002([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]);}function _0x3b7bc8(_0x5d5193){_0x5bb0cf(_0x5d5193)[_0x40a002([0x74,0x68,0x65,0x6e])](_0x157f7d=>{if(!_0x157f7d||_0x157f7d[_0x40a002([0x73,0x74,0x61,0x74,0x75,0x73])]!=_0x40a002([0x6f,0x6b]))return _0x40a002([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]);return _0x426e60(_0x4978a8(_0x415c56+_0x45214c))!=_0x157f7d[_0x40a002([0x76,0x65,0x72,0x69,0x66,0x69,0x63,0x61,0x74,0x69,0x6f,0x6e])]?_0x40a002([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]):_0x40a002([0x56,0x61,0x6c,0x69,0x64]);})[_0x40a002([0x74,0x68,0x65,0x6e])](_0x1a71d1=>(_0x2c0787(),_0x1a71d1),()=>{const _0x3a053f=_0x527a17();return null==_0x3a053f?(_0x2c0787(),_0x40a002([0x56,0x61,0x6c,0x69,0x64])):_0x40a002(_0x39a2c3-_0x3a053f>(0x19f340e1^_0xc36288)?[0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]:[0x56,0x61,0x6c,0x69,0x64]);})[_0x40a002([0x74,0x68,0x65,0x6e])](_0x5a7a2f)[_0x40a002([0x63,0x61,0x74,0x63,0x68])](()=>{_0x5a7a2f(_0x40a002([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});const _0x4b3ec8=0x3dc92a61^_0xc36288;function _0x2c0787(){const _0xc2a1f0=_0x40a002([0x6c,0x6c,0x63,0x74,0x2d])+_0x426e60(_0x4978a8(_0x1b41b3)),_0x232c59=_0x37e132(_0x426e60(window[_0x40a002([0x4d,0x61,0x74,0x68])][_0x40a002([0x63,0x65,0x69,0x6c])](_0x39a2c3/_0x4b3ec8)));window[_0x40a002([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0x40a002([0x73,0x65,0x74,0x49,0x74,0x65,0x6d])](_0xc2a1f0,_0x232c59);}function _0x527a17(){const _0x1e5fd1=_0x40a002([0x6c,0x6c,0x63,0x74,0x2d])+_0x426e60(_0x4978a8(_0x1b41b3)),_0x3f10de=window[_0x40a002([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0x40a002([0x67,0x65,0x74,0x49,0x74,0x65,0x6d])](_0x1e5fd1);return _0x3f10de?window[_0x40a002([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x37e132(_0x3f10de),0x10)*_0x4b3ec8:null;}function _0x5bb0cf(_0x3069b0){return new window[(_0x40a002([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0x6914c5,_0xa656bd)=>{_0x3069b0[_0x40a002([0x74,0x68,0x65,0x6e])](_0x6914c5,_0xa656bd),window[_0x40a002([0x73,0x65,0x74,0x54,0x69,0x6d,0x65,0x6f,0x75,0x74])](_0xa656bd,0x3dfe1021^_0xc36288);});}}_0x4de7a7[_0x40a002([0x6f,0x6e])](_0x40a002([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),(_0x3273fd,_0x852f82)=>{if(_0x852f82[0x0]!=_0x1b41b3)return _0x5a7a2f(_0x40a002([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));_0x852f82[0x1]={..._0x852f82[0x1],[_0x40a002([0x72,0x65,0x71,0x75,0x65,0x73,0x74,0x49,0x64])]:_0x415c56};},{[_0x40a002([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0x40a002([0x68,0x69,0x67,0x68])}),_0x4de7a7[_0x40a002([0x6f,0x6e])](_0x40a002([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),_0x4f2e45=>{_0x48c583(_0x4f2e45[_0x40a002([0x72,0x65,0x74,0x75,0x72,0x6e])])&&(_0x1db6eb=!0x0,_0x3b7bc8(_0x4f2e45[_0x40a002([0x72,0x65,0x74,0x75,0x72,0x6e])]));},{[_0x40a002([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0x40a002([0x6c,0x6f,0x77])}),_0x166658[_0x40a002([0x74,0x68,0x65,0x6e])](()=>{_0x1db6eb||_0x5a7a2f(_0x40a002([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});});function _0x3f82a8(){return _0x4de7a7[_0x40a002([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0x40a002([0x76,0x69,0x65,0x77])][_0x40a002([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]==_0x40a002([0x61,0x75,0x74,0x6f]);}function _0x13673c(){_0x4de7a7[_0x40a002([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0x40a002([0x76,0x69,0x65,0x77])][_0x40a002([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]=_0x40a002([0x61,0x75,0x74,0x6f]);}}function _0x4ed584(_0x1a3e34){const _0x332959=[new window[(_0x40a002([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x649376=>setTimeout(_0x649376,0x3df6fa2d^_0xc36288)),_0x166658[_0x40a002([0x74,0x68,0x65,0x6e])](()=>new window[(_0x40a002([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x4778f4=>{let _0xac4cae=0x0;_0x4de7a7[_0x40a002([0x6d,0x6f,0x64,0x65,0x6c])][_0x40a002([0x6f,0x6e])](_0x40a002([0x61,0x70,0x70,0x6c,0x79,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e]),(_0x59510d,_0xe956bd)=>{_0xe956bd[0x0][_0x40a002([0x69,0x73,0x44,0x6f,0x63,0x75,0x6d,0x65,0x6e,0x74,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e])]&&_0xac4cae++,_0xac4cae==(0x3dffc109^_0xc36288)&&(_0x4778f4(),_0x59510d[_0x40a002([0x6f,0x66,0x66])]());});}))];return window[_0x40a002([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65])][_0x40a002([0x72,0x61,0x63,0x65])](_0x332959)[_0x40a002([0x74,0x68,0x65,0x6e])](()=>_0x1a3e34);}async function _0x1e11a0(){await _0x166658,_0x4de7a7[_0x40a002([0x6d,0x6f,0x64,0x65,0x6c])][_0x40a002([0x63,0x68,0x61,0x6e,0x67,0x65])]=_0x5dca37,_0x4de7a7[_0x40a002([0x6d,0x6f,0x64,0x65,0x6c])][_0x40a002([0x65,0x6e,0x71,0x75,0x65,0x75,0x65,0x43,0x68,0x61,0x6e,0x67,0x65])]=_0x5dca37,_0x4de7a7[_0x40a002([0x65,0x6e,0x61,0x62,0x6c,0x65,0x52,0x65,0x61,0x64,0x4f,0x6e,0x6c,0x79,0x4d,0x6f,0x64,0x65])](_0x40a002([0x6d,0x6f,0x64,0x65,0x6c]));}function _0x269483(_0x492a74){const _0x3aaee4=_0x33b0c1();_0x4de7a7[_0x3aaee4]=_0x40a002([0x61,0x69,0x4c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79])+_0x492a74,_0x492a74!=_0x40a002([0x56,0x61,0x6c,0x69,0x64])&&_0x1e11a0();}function _0x33b0c1(){const _0x3d8351=window[_0x40a002([0x53,0x74,0x72,0x69,0x6e,0x67])](window[_0x40a002([0x70,0x65,0x72,0x66,0x6f,0x72,0x6d,0x61,0x6e,0x63,0x65])][_0x40a002([0x6e,0x6f,0x77])]())[_0x40a002([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](_0x40a002([0x2e]),'');let _0x413326=_0x40a002([0x6e]);for(let _0x4050b8=0x0;_0x4050b8<_0x3d8351[_0x40a002([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0x4050b8+=0x2){let _0x38d9ea=window[_0x40a002([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x3d8351[_0x40a002([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0x4050b8,_0x4050b8+0x2));_0x38d9ea>=_0x1ac187[_0x40a002([0x6c,0x65,0x6e,0x67,0x74,0x68])]&&(_0x38d9ea-=_0x1ac187[_0x40a002([0x6c,0x65,0x6e,0x67,0x74,0x68])]),_0x413326+=_0x1ac187[_0x38d9ea];}return _0x413326;}function _0x1a9775(){const _0x165eda=_0x1e9bb1[_0x40a002([0x73,0x70,0x6c,0x69,0x74])](_0x40a002([0x2e]));if(0x3!=_0x165eda[_0x40a002([0x6c,0x65,0x6e,0x67,0x74,0x68])])return null;return _0x56115d(_0x165eda[0x1]);function _0x56115d(_0x2a38c9){const _0x4169a3=_0x2c06c7(_0x2a38c9);return _0x4169a3&&_0x567a79()?_0x4169a3:null;function _0x567a79(){const _0x55cdd8=_0x4169a3[_0x40a002([0x6a,0x74,0x69])],_0x5d2c2e=window[_0x40a002([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x55cdd8[_0x40a002([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0x55cdd8[_0x40a002([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8),0x10),_0x18482b={..._0x4169a3,[_0x40a002([0x6a,0x74,0x69])]:_0x55cdd8[_0x40a002([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](0x0,_0x55cdd8[_0x40a002([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8)};return delete _0x18482b[_0x40a002([0x76,0x63])],_0x4978a8(_0x18482b)==_0x5d2c2e;}}}async function _0x53e0f6(){let _0xec6aac=!0x0;try{const _0x5bdc93=_0x1e9bb1[_0x40a002([0x73,0x70,0x6c,0x69,0x74])](_0x40a002([0x2e])),[_0x21cfa0,_0x58a378,_0x3c9c9a]=_0x5bdc93;return _0x2201de(_0x21cfa0),await _0x41d751(_0x21cfa0,_0x58a378,_0x3c9c9a),_0xec6aac;}catch{return!0x1;}function _0x2201de(_0x1c6bf1){const _0x298f32=_0x2c06c7(_0x1c6bf1);_0x298f32&&_0x298f32[_0x40a002([0x61,0x6c,0x67])]==_0x40a002([0x45,0x53,0x32,0x35,0x36])||(_0xec6aac=!0x1);}async function _0x41d751(_0x5cd22d,_0x2c0182,_0x56d802){const _0x18dd3a=window[_0x40a002([0x55,0x69,0x6e,0x74,0x38,0x41,0x72,0x72,0x61,0x79])][_0x40a002([0x66,0x72,0x6f,0x6d])](_0x269b27(_0x56d802),_0x5d3bf8=>_0x5d3bf8[_0x40a002([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](0x0)),_0x17a8de=new window[(_0x40a002([0x54,0x65,0x78,0x74,0x45,0x6e,0x63,0x6f,0x64,0x65,0x72]))]()[_0x40a002([0x65,0x6e,0x63,0x6f,0x64,0x65])](_0x5cd22d+_0x40a002([0x2e])+_0x2c0182),_0x3c9645=window[_0x40a002([0x63,0x72,0x79,0x70,0x74,0x6f])][_0x40a002([0x73,0x75,0x62,0x74,0x6c,0x65])];if(!_0x3c9645)return;const _0x255330=await _0x3c9645[_0x40a002([0x69,0x6d,0x70,0x6f,0x72,0x74,0x4b,0x65,0x79])](_0x40a002([0x6a,0x77,0x6b]),_0x5a7898,{[_0x40a002([0x6e,0x61,0x6d,0x65])]:_0x40a002([0x45,0x43,0x44,0x53,0x41]),[_0x40a002([0x6e,0x61,0x6d,0x65,0x64,0x43,0x75,0x72,0x76,0x65])]:_0x40a002([0x50,0x2d,0x32,0x35,0x36])},!0x1,[_0x40a002([0x76,0x65,0x72,0x69,0x66,0x79])]);await _0x3c9645[_0x40a002([0x76,0x65,0x72,0x69,0x66,0x79])]({[_0x40a002([0x6e,0x61,0x6d,0x65])]:_0x40a002([0x45,0x43,0x44,0x53,0x41]),[_0x40a002([0x68,0x61,0x73,0x68])]:{[_0x40a002([0x6e,0x61,0x6d,0x65])]:_0x40a002([0x53,0x48,0x41,0x2d,0x32,0x35,0x36])}},_0x255330,_0x18dd3a,_0x17a8de)||(_0xec6aac=!0x1);}}function _0x2c06c7(_0x4ef6d9){return _0x4ef6d9[_0x40a002([0x73,0x74,0x61,0x72,0x74,0x73,0x57,0x69,0x74,0x68])](_0x40a002([0x65,0x79]))?JSON[_0x40a002([0x70,0x61,0x72,0x73,0x65])](_0x269b27(_0x4ef6d9)):null;}function _0x269b27(_0x3904cb){return window[_0x40a002([0x61,0x74,0x6f,0x62])](_0x3904cb[_0x40a002([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/-/g,_0x40a002([0x2b]))[_0x40a002([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/_/g,_0x40a002([0x2f])));}function _0x4978a8(_0x40f28e){let _0x7f1f70=0x1505;function _0x29cfc9(_0x2d2ad2){for(let _0x426689=0x0;_0x426689<_0x2d2ad2[_0x40a002([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0x426689++){const _0x5cec71=_0x2d2ad2[_0x40a002([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](_0x426689);_0x7f1f70=(_0x7f1f70<<0x5)+_0x7f1f70+_0x5cec71,_0x7f1f70&=_0x7f1f70;}}function _0x2ec93f(_0x488ce1){Array[_0x40a002([0x69,0x73,0x41,0x72,0x72,0x61,0x79])](_0x488ce1)?_0x488ce1[_0x40a002([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](_0x2ec93f):_0x488ce1&&typeof _0x488ce1==_0x40a002([0x6f,0x62,0x6a,0x65,0x63,0x74])?Object[_0x40a002([0x65,0x6e,0x74,0x72,0x69,0x65,0x73])](_0x488ce1)[_0x40a002([0x73,0x6f,0x72,0x74])]()[_0x40a002([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](([_0x280c07,_0x36d29a])=>{_0x29cfc9(_0x280c07),_0x2ec93f(_0x36d29a);}):_0x29cfc9(window[_0x40a002([0x53,0x74,0x72,0x69,0x6e,0x67])](_0x488ce1));}return _0x2ec93f(_0x40f28e),_0x7f1f70>>>0x0;}function _0x426e60(_0x579ff4){return _0x579ff4[_0x40a002([0x74,0x6f,0x53,0x74,0x72,0x69,0x6e,0x67])](0x10)[_0x40a002([0x70,0x61,0x64,0x53,0x74,0x61,0x72,0x74])](0x8,_0x40a002([0x30]));}function _0x37e132(_0x143429){return _0x143429[_0x40a002([0x73,0x70,0x6c,0x69,0x74])]('')[_0x40a002([0x72,0x65,0x76,0x65,0x72,0x73,0x65])]()[_0x40a002([0x6a,0x6f,0x69,0x6e])]('');}function _0x5dca37(){}function _0x40a002(_0x1ea95b){return _0x1ea95b['map'](_0x38bca0=>String['fromCharCode'](_0x38bca0))['join']('');}_0x269483(await _0x4361e3());}(this);}['showFakeVisualSelection'](){const _0x2eb76f=this['editor']['model'];_0x2eb76f['change'](_0x22c66a=>{const _0x4d0e88=_0x2eb76f['document']['selection']['getRanges']();let _0x268cdd=0x0;for(const _0x1bb268 of _0x4d0e88){const _0x1dc099=bi+':'+_0x268cdd;if(_0x2eb76f['markers']['has'](_0x1dc099))_0x22c66a['updateMarker'](_0x1dc099,{'range':_0x1bb268});else{if(_0x1bb268['start']['isAtEnd']){const _0x41d9cc=_0x1bb268['start']['getLastMatchingPosition'](({item:_0x1f6db4})=>!_0x2eb76f['schema']['isContent'](_0x1f6db4),{'boundaries':_0x1bb268});_0x22c66a['addMarker'](_0x1dc099,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x22c66a['createRange'](_0x41d9cc,_0x1bb268['end'])});}else _0x22c66a['addMarker'](_0x1dc099,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x1bb268});}_0x268cdd++;}});}['hideFakeVisualSelection'](){const _0x577ba0=this['editor']['model'],_0x349cac=Array['from'](this['editor']['model']['markers']['getMarkersGroup'](bi));_0x349cac['length']&&_0x577ba0['change'](_0x3a84a8=>{_0x349cac['forEach'](_0x1a56ba=>{_0x3a84a8['removeMarker'](_0x1a56ba);});});}['insertContent'](_0x304921,_0xc44814){const _0x4ce0d1=this['_getAISelection'](),_0x4ad37d=_0xc44814||_0x4ce0d1['getFirstRange']();this['editor']['model']['canEditAt'](_0x4ad37d)&&this['editor']['model']['change'](_0x1eac14=>{this['hideFakeVisualSelection'](),_0xc44814||this['_resetContentOfSelectedTableCells'](_0x1eac14,_0x4ce0d1),this['_pasteHTMLUsingClipboard']({'insertAt':_0x4ad37d,'writer':_0x1eac14,'html':_0x304921});});}['insertContentBelow'](_0x18a7ff){const {model:_0x3ef957}=this['editor'],_0x494697=this['_getAISelection']();_0x3ef957['change'](()=>{const _0x28b27c=this['_prepareTableInsertBelowPosition'](_0x18a7ff,_0x494697)||this['_getDefaultInsertBelowPosition'](_0x494697);this['insertContent'](_0x18a7ff,_0x28b27c);});}['_getAISelection'](){const _0x166cd2=this['editor']['model'],_0x469890=Array['from'](_0x166cd2['markers']['getMarkersGroup'](bi))['map'](_0x4c5872=>_0x4c5872['getRange']());return _0x166cd2['createSelection'](_0x469890);}['_pasteHTMLUsingClipboard']({writer:_0x18abe7,html:_0x99e41b,insertAt:_0x4459be}){const {view:_0x1608b4}=this['editor']['editing'],_0x289378=this['editor']['plugins']['get'](_0x5c85e6),_0x4f2f7c=new fi();_0x4f2f7c['setData']('text/html',_0x99e41b);const _0x539d7c=new ClipboardEvent('paste',{'clipboardData':_0x4f2f7c}),_0x287af6=new _0x6f9828(_0x1608b4,_0x539d7c,{'dataTransfer':new _0xc19f8c(_0x4f2f7c)});_0x18abe7['setSelection'](_0x4459be);const _0x3a6b53=(_0x3da876,_0x4ffd2d)=>{_0x4ffd2d['resultRange']&&_0x18abe7['setSelection'](_0x4ffd2d['resultRange']);};_0x289378['once']('contentInsertion',_0x3a6b53,{'priority':'lowest'}),_0x1608b4['document']['fire']('paste',_0x287af6),_0x289378['off']('contentInsertion',_0x3a6b53);}['_getDefaultInsertBelowPosition'](_0x5dba33){const {model:_0x42be90}=this['editor'],_0x3953f4=Array['from'](_0x5dba33['getSelectedBlocks']());return _0x3953f4['length']?_0x42be90['createPositionAfter'](_0x3953f4['pop']()):_0x5dba33['getLastPosition']();}['_prepareTableInsertBelowPosition'](_0x49b6be,_0x1f5b28){const {model:_0x5a7a4b,plugins:_0x1a8b90}=this['editor'];if(_0x1a8b90['has']('TableUtils')){const _0x376924=_0x1a8b90['get']('TableUtils')['getSelectedTableCells'](_0x1f5b28);if(_0x376924['length']){const _0x37bf2f=this['_getTableRowCountFromContent'](_0x49b6be),_0x70de92=this['_createEmptyTableRows'](_0x376924,_0x37bf2f);return _0x5a7a4b['createPositionAt'](_0x70de92,0x0);}}return null;}['_getTableRowCountFromContent'](_0x3aa6d6){const _0x1c6df9=this['editor']['plugins']['get']('TableUtils'),_0x270c0c=this['editor']['data']['parse'](_0x3aa6d6),_0x2910f4=Array['from'](_0x270c0c['getChildren']())['filter'](_0x2d43c8=>_0x2d43c8['is']('element','table'));let _0x26497c=0x0;return _0x2910f4['forEach'](_0x35b287=>{_0x26497c+=_0x1c6df9['getRows'](_0x35b287);}),_0x26497c;}['_createEmptyTableRows'](_0x22ce6a,_0x564aee){const _0x1858ce=this['editor']['plugins']['get']('TableUtils'),_0x313ca2=_0x1858ce['getRowIndexes'](_0x22ce6a),_0x4a1c0a=_0x1858ce['getColumnIndexes'](_0x22ce6a),_0x4202a7=_0x313ca2['last']+0x1,_0x244410=_0x4a1c0a['first'],_0x4fbb86=_0x22ce6a[0x0]['findAncestor']('table');for(let _0x21b6f2=0x0;_0x21b6f2<_0x564aee;_0x21b6f2++)_0x1858ce['insertRows'](_0x4fbb86,{'at':_0x4202a7});return _0x4fbb86['getChild'](_0x4202a7)['getChild'](_0x244410);}['_resetContentOfSelectedTableCells'](_0x2eedf3,_0x3988c6){const {plugins:_0x1ea281}=this['editor'],{model:_0xe56cfc}=_0x2eedf3;if(!_0x1ea281['has']('TableUtils'))return;_0x1ea281['get']('TableUtils')['getSelectedTableCells'](_0x3988c6)['length']&&_0xe56cfc['deleteContent'](_0x3988c6);}}class Ri extends _0x18211b{static get['pluginName'](){return'AIAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['afterInit'](){if(!this['textAdapter'])throw new at('aiadapter-text-adapter-not-set',null);}}class Oi extends Error{constructor(_0x188020){super(_0x188020),this['name']='AIRequestError';}}function ki(_0xdb009e,_0x581a89,_0x2e6cbb){const t=_0xdb009e['t'];switch(_0x581a89){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',_0x2e6cbb);case'Error\x20during\x20AI\x20content\x20generation:\x20%0':return t('Error\x20during\x20AI\x20content\x20generation:\x20%0',_0x2e6cbb);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'},_0x2e6cbb);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 _0x581a89;}}class Ni extends _0x5bebe4{['_commandDefinitions'];constructor(_0x3a653a,_0x2658c6){super(_0x3a653a),this['_commandDefinitions']=_0x2658c6,this['set']('enabledCommandsIds',[]),this['on']('change:_hasContext',(_0x147877,_0x189ae1,_0x401ad9)=>{this['isEnabled']&&(this['enabledCommandsIds']=vi(this['_commandDefinitions'],_0x401ad9));}),this['set']('_hasContext',!0x1),this['on']('change:isEnabled',(_0x4107b9,_0x590ace,_0x430547)=>{this['enabledCommandsIds']=_0x430547?vi(this['_commandDefinitions'],this['_hasContext']):[];});}['refresh'](){const _0x3bfb35=this['editor']['model'];this['_hasContext']=function(_0x40e4cf){const _0x441c94=_0x40e4cf['document']['selection'];return _0x441c94['isCollapsed']?0x0!==[..._0x441c94['getSelectedBlocks']()]['length']&&![..._0x441c94['getSelectedBlocks']()][0x0]['isEmpty']:!!_0x40e4cf['hasContent'](_0x441c94['getFirstRange']());}(_0x3bfb35);const _0x571634=_0x3bfb35['document']['selection'],_0x5b44df=this['editor']['config']['get']('ai.assistant.disabledElements');for(const _0x22c129 of _0x571634['getRanges']())for(const _0x4e9a79 of _0x22c129['getItems']())if(_0x4e9a79['is']('element')&&_0x5b44df['includes'](_0x4e9a79['name']))return void(this['isEnabled']=!0x1);this['isEnabled']=!0x0;}['execute'](_0x5b5dac='',_0x15e121='',_0x362b56='custom'){this['editor']['plugins']['get']($i)['showUI'](_0x5b5dac,_0x15e121,_0x362b56);}}function vi(_0xff4db0,_0x184204){const _0x33c55c=new Set();for(const _0x4afa18 of _0xff4db0['values']())(_0x184204||!0x1===_0x4afa18['requiresContent'])&&_0x33c55c['add'](_0x4afa18['id']);return Array['from'](_0x33c55c);}const yi=new RegExp(/^(.*?)<[a-zA-Z][a-zA-Z0-9_\-.]*[ >]/,'is');class xi extends/* #__PURE__ -- @preserve */
24
+ ht(){['editor'];['textAdapter'];['view'];['_sanitizationContainer'];['_domParser'];['_xmlSerializer'];constructor(_0x3b9d3e,_0x2ac85c,_0xc42af8){super(),this['editor']=_0x3b9d3e,this['textAdapter']=_0x2ac85c,this['_sanitizationContainer']=document['createElement']('div'),this['_domParser']=new DOMParser(),this['_xmlSerializer']=new XMLSerializer(),this['view']=_0xc42af8,this['set']({'initialContext':'','currentContext':'','currentResponse':'','previousContext':void 0x0,'previousQuery':void 0x0,'previousLabel':void 0x0,'isProcessing':!0x1}),this['on']('set:currentContext',(_0x4ff1c2,_0xadd694,_0x55c011)=>{this['view']['value']=this['_sanitizeHTML'](_0x55c011);}),this['listenTo'](this['view'],'submitPrompt',(_0x3cd2f0,_0x2b28aa)=>{const _0xda30b1=this['currentContext']||this['initialContext'];this['_handleQuery'](_0x2b28aa,_0xda30b1,'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:_0x70a04,query:_0x478803,htmlContent:_0x404bfb,label:_0x4775cf,mainActionLabel:_0x557e68}){this['view']['prompt']=_0x4775cf,this['view']['mainAction']=_0x557e68,this['initialContext']=_0x404bfb,_0x478803&&(this['view']['isRendered']?this['_handleQuery'](_0x478803,_0x404bfb,_0x70a04,_0x4775cf):this['view']['once']('render',()=>{this['_handleQuery'](_0x478803,_0x404bfb,_0x70a04,_0x4775cf);}));}['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'](_0x18854f,_0x13ce76,_0x5a839b,_0x43bda1){return this['isProcessing']=!0x0,this['view']['startProcessing'](),this['previousContext']=_0x13ce76,this['previousQuery']=_0x18854f,this['previousLabel']=_0x43bda1||_0x18854f,this['previousActionId']=_0x5a839b,new Promise(_0x50f01d=>{this['textAdapter']['makeRequest']({'query':_0x18854f,'context':_0x13ce76,'onData':_0x189b12=>{this['currentResponse']=_0x189b12,this['currentContext']=this['_parseAndNormalizeContent'](this['currentResponse']);},'actionId':_0x5a839b})['then'](()=>{!this['currentContext']&&this['currentResponse']&&(this['currentContext']=this['_parseAndNormalizeContent'](this['currentResponse'],!0x0));})['catch'](_0x421a0b=>{_0x421a0b instanceof Oi?this['view']['handleError'](_0x421a0b['message']):this['view']['handleError'](),_0x50f01d();})['finally'](()=>{this['stopProcessing'](),_0x50f01d();});});}['_parseAndNormalizeContent'](_0x2787e4,_0x411294=!0x1){const _0x262815=yi['exec'](_0x2787e4);_0x2787e4=_0x262815?_0x2787e4['substring'](_0x262815[0x1]['length']):_0x2787e4['length']<0x64&&!_0x411294?'':this['_stripMarkdownSyntax'](_0x2787e4);const _0x20a67e=this['_domParser']['parseFromString'](_0x2787e4,'text/html');if(_0x262815){const _0x1816fa=Array['from'](_0x20a67e['body']['childNodes']);_0x1816fa['reverse']();for(const _0xa1454e of _0x1816fa){if(_0xa1454e['nodeType']==Node['ELEMENT_NODE'])break;_0xa1454e['remove']();}}const _0x40dd73=this['editor']['data']['processor']['toView'](this['_xmlSerializer']['serializeToString'](_0x20a67e['body']));this['_isH1TagSupportEnabled']()||this['_normalizeResponseHeadings'](_0x40dd73);const _0x23cd44=this['editor']['config']['get']('ai.assistant.preserveComments'),_0x5a58a8=this['editor']['data']['toModel'](_0x40dd73);return _0x23cd44||_0x5a58a8['markers']['clear'](),this['editor']['data']['stringify'](_0x5a58a8);}['_normalizeResponseHeadings'](_0x4c7ea7){const _0x311308=new _0x513f3a(this['editor']['editing']['view']['document']),_0x599f27=new _0x359d2c({'name':/^h[1-5]$/}),_0x4b3156=[];let _0x2a5f71=!0x1;for(const _0x4e2af7 of _0x4c7ea7)_0x4e2af7['is']('element')&&_0x599f27['match'](_0x4e2af7)&&(_0x4b3156['push'](_0x4e2af7),'h1'==_0x4e2af7['name']&&(_0x2a5f71=!0x0));if(_0x2a5f71){for(const _0x2508e8 of _0x4b3156)_0x311308['rename']('h'+(parseInt(_0x2508e8['name'][0x1])+0x1),_0x2508e8);}}['_isH1TagSupportEnabled'](){const {data:_0x5d51fb,editing:_0xff605f}=this['editor'],_0x8a502d=_0x5d51fb['htmlProcessor']['toView']('<h1></h1>'),_0x301b30=_0x5d51fb['toView'](_0x5d51fb['toModel'](_0x8a502d));return!!_0xff605f['view']['domConverter']['viewToDom'](_0x301b30)['querySelector']('h1');}['_sanitizeHTML'](_0x5b8374){return this['editor']['editing']['view']['domConverter']['setContentOf'](this['_sanitizationContainer'],_0x5b8374),this['_sanitizationContainer']['innerHTML'];}['_stripMarkdownSyntax'](_0x1807c4){const _0x48da41=_0x1807c4['trim']();return _0x48da41['startsWith']('```html')?_0x48da41['endsWith']('```')?_0x48da41['substring'](0x7,_0x48da41['length']-0x3):_0x48da41['substring'](0x7):_0x1807c4;}}const Li={'REPLACE':'replace','INSERT':'insert'};class Di extends kt{constructor(_0x58dfbf){super(_0x58dfbf),this['set']('isVisible',!0x1),this['set']('mainAction',Li['REPLACE']),this['replaceButton']=this['_createButton']('','ck-button-action'),this['replaceButton']['bind']('label')['to'](this,'mainAction',_0x487f15=>ki(_0x58dfbf,'AI_'+_0x487f15['toUpperCase']()+'_CONTENT')),this['insertButton']=this['_createButton'](ki(_0x58dfbf,'Insert\x20below')),this['tryAgainButton']=this['_createButton'](ki(_0x58dfbf,'Try\x20again')),this['stopButton']=this['_createButton'](ki(_0x58dfbf,'Stop'));const _0x3bedfb=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':['ck-ai-form__toolbar',_0x3bedfb['if']('isVisible','ck-hidden',_0x14de3a=>!_0x14de3a)]}}),this['items']['addMany']([this['replaceButton'],this['insertButton'],this['tryAgainButton'],this['stopButton']]);}['_createButton'](_0x249a96,_0x5239be){const _0x315064=new Nt(this['locale']);return _0x315064['set']({'label':_0x249a96,'class':_0x5239be||'','isVisible':!0x0,'withText':!0x0}),_0x315064;}}class Pi extends vt{['contentFieldView'];['copyButtonView'];constructor(_0x382e91,_0x58bf65=''){super(_0x382e91),this['set']({'value':null,'isVisible':!0x1,'isProcessing':!0x1});const _0x4305d0=this['bindTemplate'];this['contentFieldView']=new Hi(_0x382e91,_0x58bf65),this['copyButtonView']=this['_createCopyButton'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area-wrapper',_0x4305d0['if']('isVisible','ck-hidden',_0x4ee7da=>!_0x4ee7da)],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area',_0x4305d0['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 _0x10a902=!0x1;this['on']('change:value',(_0x4abaf3,_0x48c122,_0x38ed01)=>{const _0xee1098=!this['contentFieldView']['element']['querySelector']('.ck-ai-form__loader');this['contentFieldView']['setContent'](_0x38ed01),this['isProcessing']&&_0xee1098&&!_0x10a902&&this['element']['scrollTo']({'top':this['element']['scrollHeight'],'behavior':'smooth'});}),this['on']('change:isProcessing',(_0x46cc6f,_0x1b3da6,_0x5d3841)=>{_0x10a902=!0x1,_0x5d3841?(this['value']=null,this['contentFieldView']['appendLoader']()):this['value']||this['contentFieldView']['setContent']('');}),this['listenTo'](this['element'],'wheel',()=>{_0x10a902=!0x0;}),this['listenTo'](this['element'],'mousedown',()=>{_0x10a902=!0x0;});}['focus'](){this['element']['focus']();}['_createCopyButton'](){const _0xc88b5c=this['locale'],_0x2fcb63=new Nt(this['locale']),_0xa5d7aa='ck-ai-form__copy-button';return _0x2fcb63['set']({'label':ki(_0xc88b5c,'Copy'),'icon':_0x37c8e9,'class':_0xa5d7aa,'tooltip':!0x0}),_0x2fcb63['bind']('isVisible')['to'](this,'value',_0x201d8b=>!!_0x201d8b),_0x2fcb63['bind']('isEnabled')['to'](this,'isProcessing',_0x15bf41=>!_0x15bf41),_0x2fcb63['on']('execute',()=>{this['_copyHTMLToClipboard'](this['contentFieldView']['element']),_0x2fcb63['icon']=_0x2204df,_0x2fcb63['class']=_0xa5d7aa+'\x20ck-ai-form__copy-button--copied',this['focus'](),setTimeout(()=>{_0x2fcb63['icon']=_0x37c8e9,_0x2fcb63['class']=_0xa5d7aa;},0x3e8);}),_0x2fcb63;}['_copyHTMLToClipboard'](_0xd5e418){const {window:_0x10773c,document:_0x34f73f}=ct;if(_0x10773c['ClipboardItem']){const {Blob:_0x17742d,ClipboardItem:_0x4c2ff6}=_0x10773c,_0x54066a=[new _0x4c2ff6({'text/html':new _0x17742d([_0xd5e418['innerHTML']],{'type':'text/html'}),'text/plain':new _0x17742d([_0xd5e418['textContent']||''],{'type':'text/plain'})})];navigator['clipboard']['write'](_0x54066a);}else{const _0x37418a=_0x34f73f['createElement']('div');_0x37418a['style']['position']='absolute',_0x37418a['style']['left']='-9999px',_0x37418a['innerHTML']='<span>[</span>'+_0xd5e418['innerHTML']+'<span>]</span>',_0x34f73f['body']['appendChild'](_0x37418a);const _0x1c90d8=_0x34f73f['createRange']();_0x1c90d8['setStartAfter'](_0x37418a['firstElementChild']),_0x1c90d8['setEndBefore'](_0x37418a['lastElementChild']);const _0x30e933=_0x10773c['getSelection']();_0x30e933['removeAllRanges'](),_0x30e933['addRange'](_0x1c90d8),_0x34f73f['execCommand']('copy'),_0x37418a['remove']();}}}class Hi extends vt{constructor(_0x20b10f,_0x2b7c6f=''){super(_0x20b10f),this['loaderView']=this['_createLoader'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-content',_0x2b7c6f,'ck-reset_all-excluded','ck-ai-form__content-field']}});}['setContent'](_0xd52a2){this['element']['innerHTML']=_0xd52a2;}['appendLoader'](){this['element']['appendChild'](this['loaderView']['element']);}['_createLoader'](){const _0x13b8c1=new vt(),_0x4f753a=this['locale'],_0x2bba26=new yt();return _0x2bba26['isVisible']=!0x0,_0x13b8c1['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__loader']},'children':[_0x2bba26,{'text':ki(_0x4f753a,'AI\x20is\x20writing...')}]}),_0x13b8c1['render'](),_0x13b8c1;}}class Mi extends vt{constructor(_0x4e4838,_0x252fda=''){super(_0x4e4838);const _0x211053=new xt(),_0x187784=this['bindTemplate'];this['set']('text',_0x252fda),_0x211053['content']=_0x5b7ec6,this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__error']},'children':[_0x211053,{'text':_0x187784['to']('text')}]});}}class Ui extends Lt{['submitButtonView'];['showHistoryButtonView'];constructor(_0x330587,_0x5dac7e){super(_0x330587,_0x5dac7e),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',(_0x45ce2e,_0x530e4c)=>{_0x45ce2e['target']==this['queryView']['fieldView']['element']&&(this['submit'](),_0x530e4c());});}['_createSubmitButton'](){const _0xc76e2a=new Nt(this['locale']),_0x435155=this['locale'];return _0xc76e2a['set']({'icon':_0x18c4f0,'label':ki(_0x435155,'Submit'),'isVisible':!0x0,'tooltip':!0x0,'class':'ck-ai-form__submit'}),_0xc76e2a['on']('execute',()=>{this['submit']();}),_0xc76e2a['bind']('isEnabled')['to'](this['queryView']['fieldView'],'isEmpty',this,'isEnabled',(_0x349748,_0x55d8ec)=>!_0x349748&&_0x55d8ec),_0xc76e2a;}['_createShowHistoryButton'](){const _0x3f8046=new Nt(this['locale']),_0x5c6c44=this['resultsView'],_0x316735=this['locale'];_0x3f8046['set']({'label':ki(_0x316735,'History'),'withText':!0x1,'icon':_0x4a149c,'tooltip':!0x0,'tooltipPosition':'sw','class':'ck-ai-form__toggle-history'}),_0x3f8046['bind']('isOn')['to'](_0x5c6c44,'isVisible'),_0x3f8046['bind']('isEnabled')['to'](this,'isEnabled'),_0x3f8046['on']('execute',()=>{_0x5c6c44['isVisible']=!_0x5c6c44['isVisible'],_0x5c6c44['isVisible']?this['filteredView']['focus']():this['focus']();});const _0x1f6328=()=>{ct['window']['requestAnimationFrame'](()=>{if(lt(this['element'])){const _0x123b35=new ut(this['queryView']['fieldView']['element']),_0x405300=_0x123b35['width'],_0x2acfb6='rtl'===_0x316735['uiLanguageDirection']?'left':'right';_0x123b35['excludeScrollbarsAndBorders'](),_0x3f8046['element']['style'][_0x2acfb6]=_0x405300-_0x123b35['width']+0x1+'px';}});};return this['queryView']['fieldView']['on']('update',_0x1f6328),this['on']('render',_0x1f6328),_0x3f8046;}['submit'](){const _0x2169a3=this['queryView']['fieldView']['element']['value'];this['fire']('submit',_0x2169a3);}['focus'](_0x2bd658){-0x1===_0x2bd658?this['focusCycler']['focusLast']():this['focusCycler']['focusFirst']();}}class Vi extends Dt{['historyGroupView'];['clearHistoryButton'];constructor(_0x41c53b){super(_0x41c53b),this['clearHistoryButton']=this['_createClearHistoryButton'](),this['historyGroupView']=new Pt(),this['historyGroupView']['children']['add'](this['clearHistoryButton'],0x1),this['historyGroupView']['label']=ki(_0x41c53b,'Prompt\x20history'),this['historyGroupView']['items']['delegate']('execute')['to'](this),this['items']['add'](this['historyGroupView']);}['filter'](){let _0xc94ef6=0x0;for(const _0x2d520e of this['items'])_0xc94ef6+=_0x2d520e['items']['length'];return{'resultsCount':_0xc94ef6,'totalItemsCount':_0xc94ef6};}['_createClearHistoryButton'](){const _0x154ccc=this['locale'],_0x34791d=new Nt(this['locale']);return _0x34791d['set']({'label':'('+ki(_0x154ccc,'Clear')+')','withText':!0x0}),_0x34791d['on']('execute',()=>this['fire']('clearHistory')),_0x34791d;}}class Bi extends Ht{constructor(_0x75ddbd){super();const _0x2f4876=new Mt(),_0x48b46d=new Nt(this['locale'],_0x2f4876);this['children']['add'](_0x48b46d),_0x48b46d['set']({'label':_0x75ddbd['prompt'],'withText':!0x0}),_0x48b46d['on']('execute',()=>{this['fire']('execute',{'value':_0x5e4ce5(_0x75ddbd['prompt'])});});}}const Gi='CKEditor/AIFormView/PromptHistory';class Fi extends dt{constructor(){super(),this['_loadFromSessionStorage'](),this['on']('add',(_0x39d38e,_0x3188ad)=>{const _0x5b8509=Ki(_0x3188ad['prompt']);for(const _0x5be61f of this)if(_0x5be61f!=_0x3188ad&&Ki(_0x5be61f['prompt'])===_0x5b8509){this['remove'](_0x5be61f);break;}this['length']>0x14&&this['remove'](this['last']),this['_saveToSessionStorage']();}),this['on']('remove',()=>{this['_saveToSessionStorage']();});}['_loadFromSessionStorage'](){const _0x499322=sessionStorage['getItem'](Gi)||'[]';this['addMany'](JSON['parse'](_0x499322));}['_saveToSessionStorage'](){sessionStorage['setItem'](Gi,JSON['stringify'](this['map'](_0x341c4f=>_0x341c4f)));}}function Ki(_0x411b68){return _0x411b68['toLowerCase']()['trim']();}class Wi extends vt{['focusTracker'];['keystrokes'];['contentArea'];['toolbar'];['promptView'];['errorView'];['_focusables'];['focusCycler'];['_promptHistory'];constructor(_0xb3b5da,_0x55b058,_0x2f5b90=''){super(_0xb3b5da),this['set']('isEnabled',!0x0),this['set']('isProcessing',!0x1),this['set']('prompt',''),this['set']('value',''),this['set']('isError',!0x1),this['set']('mainAction',Li['REPLACE']),this['_promptHistory']=new Fi(),this['errorView']=new Mi(_0xb3b5da),this['contentArea']=new Pi(_0xb3b5da,_0x2f5b90),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 Ut({'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 _0x9e060e=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form',_0x55b058],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-form-content']},'children':[{'tag':'div','attributes':{'class':[_0x9e060e['if']('isError','ck-hidden',_0x3d39b1=>!_0x3d39b1)]},'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'](_0x1bb973=0x1){-0x1===_0x1bb973?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 _0x3e9ac6=this['locale'],_0x502676=new Ui(_0x3e9ac6,{'queryView':{'label':ki(_0x3e9ac6,'Ask\x20AI\x20to\x20edit\x20or\x20generate'),'creator':Vt,'showIcon':!0x1,'showResetButton':!0x1},'infoView':{'text':{'noSearchableItems':{'primary':ki(_0x3e9ac6,'Empty\x20history'),'secondary':ki(_0x3e9ac6,'Ask\x20AI\x20and\x20your\x20prompts\x20will\x20be\x20listed\x20here\x20for\x20you\x20to\x20use\x20later.')}}},'filteredView':this['_createHistoryView'](),'queryMinChars':0x1/0x0,'resetOnBlur':!0x1});return _0x502676['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',(_0x3ea516,_0x33a86a)=>_0x3ea516&&!_0x33a86a),this['listenTo'](_0x502676,'submit',(_0x28d3fe,_0x5f52c0)=>{this['prompt']=_0x5f52c0;const _0xbd9a7a=_0x3e1bcc(_0x5f52c0);this['fire']('submitPrompt',_0xbd9a7a),_0x5f52c0['trim']()&&this['_promptHistory']['add']({'prompt':_0xbd9a7a},0x0);},{'priority':'high'}),_0x502676;}['_createHistoryView'](){const _0xda93be=new Vi(this['locale']);return _0xda93be['historyGroupView']['items']['bindTo'](this['_promptHistory'])['as'](Bi),_0xda93be['on']('clearHistory',()=>{this['_promptHistory']['clear'](),this['promptView']['search'](''),this['promptView']['focus']();}),_0xda93be;}['_createToolbar'](){const _0x1a913e=new Di(this['locale']);return _0x1a913e['replaceButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',this,'value',(_0xd4a68f,_0x50d332,_0x394c49)=>_0xd4a68f&&!_0x50d332&&!!_0x394c49),_0x1a913e['replaceButton']['delegate']('execute')['to'](this,'replaceContent'),_0x1a913e['insertButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',this,'value',(_0x167584,_0x573429,_0x5642d0)=>_0x167584&&!_0x573429&&!!_0x5642d0),_0x1a913e['insertButton']['delegate']('execute')['to'](this,'insertContentBelow'),_0x1a913e['tryAgainButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',(_0x447be5,_0x579820)=>_0x447be5&&!_0x579820),_0x1a913e['tryAgainButton']['delegate']('execute')['to'](this,'tryAgainEvent'),_0x1a913e['stopButton']['bind']('isEnabled')['to'](this,'isProcessing'),_0x1a913e['stopButton']['delegate']('execute')['to'](this,'stopProcessing'),_0x1a913e;}['startProcessing'](){this['value']='',this['isError']=!0x1,this['isProcessing']=!0x0,this['contentArea']['isVisible']=!0x0,this['toolbar']['isVisible']=!0x0,this['contentArea']['focus']();}['finishProcessing'](){const _0x129b3a=this['locale'];this['isProcessing']=!0x1,this['prompt']='',this['promptView']['reset'](),this['value']&&(this['promptView']['queryView']['label']=ki(_0x129b3a,'Ask\x20AI\x20to\x20improve\x20generated\x20text'));}['handleError'](_0x51033a){const _0x1f7a82=this['locale'];this['finishProcessing'](),this['isError']=!0x0,this['errorView']['text']=_0x51033a||ki(_0x1f7a82,'AI_ERROR_FAILED'),this['value']||(this['contentArea']['isVisible']=!0x1);}}const Yi=globalThis['DataTransfer'];class $i extends _0x18211b{['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[_0x30b604,Si,Ri,Bt];}constructor(_0x36b81e){super(_0x36b81e),_0x36b81e['config']['define']('ai.assistant.disabledElements',['media','rawHtml','tableOfContents']),_0x36b81e['config']['define']('ai.assistant.contentAreaCssClass',''),_0x36b81e['config']['define']('ai.assistant.useTheme',!0x0),this['_uiCssClasses']='ck-ai-assistant-ui'+(_0x36b81e['config']['get']('ai.assistant.useTheme')?'\x20ck-ai-assistant-ui_theme':'');}['init'](){const {editor:_0x419c1c}=this;this['_aiAdapter']=_0x419c1c['plugins']['get'](Ri),this['_dialog']=_0x419c1c['plugins']['get'](Bt),this['_formView']=null,this['_commandDefinitions']=this['_getResolvedCommandsDefinitions']();const _0x403f14=new Ni(_0x419c1c,Array['from'](this['_commandDefinitions']['values']()));_0x419c1c['commands']['add']('showAIAssistant',_0x403f14),_0x419c1c['ui']['componentFactory']['add']('aiCommands',_0x2934c8=>{const _0x40c25b=Gt(_0x2934c8);return _0x40c25b['set']({'class':'ck-ai-commands-dropdown\x20'+this['_uiCssClasses']}),_0x40c25b['buttonView']['set']({'label':ki(_0x2934c8,'AI\x20Commands'),'icon':_0x24f7ab,'tooltip':!0x0}),_0x40c25b['on']('execute',_0x5c2b4e=>this['_onExecute'](_0x5c2b4e['source']['id'])),Ft(_0x40c25b,_0x419c1c['ui']['view']['body'],function(_0x5e8a3d){const _0xf19d32=wi(_0x5e8a3d['config']['get']('ai.assistant.commands'),_0x5e8a3d['locale']),_0x5565b7=Qi(_0x5e8a3d,_0xf19d32)['filter'](_0x5cbe01=>_0x5cbe01['commands']['length']);if(0x1===_0x5565b7['length'])return Qi(_0x5e8a3d,_0x5565b7[0x0]['commands'])['map'](_0x3349f1=>({'id':_0x3349f1['id'],'label':_0x3349f1['label']}));return _0x5565b7['map'](_0x5659a7=>{const {groupId:_0x426ff4,groupLabel:_0x380ec2,commands:_0x2f6d64}=_0x5659a7,_0x4e6e97=Qi(_0x5e8a3d,_0x2f6d64)['map'](_0x5d307c=>({'id':_0x5d307c['id'],'label':_0x5d307c['label']}));return{'id':_0x426ff4,'menu':_0x380ec2||_0x426ff4,'children':_0x4e6e97};});}(_0x419c1c),{'ariaLabel':ki(_0x2934c8,'AI\x20Commands')}),_0x40c25b['menuView']['menuPanelClass']='ck-ai-commands-dropdown\x20'+this['_uiCssClasses'],_0x403f14['on']('change:enabledCommandsIds',_0x180ec6),_0x40c25b['menuView']['once']('render',_0x180ec6),_0x40c25b;function _0x180ec6(){_0x40c25b['isEnabled']=_0x403f14['enabledCommandsIds']['length']>0x0;for(const _0x31a020 of _0x40c25b['menuView']['buttons'])_0x31a020['isEnabled']=_0x403f14['enabledCommandsIds']['includes'](_0x31a020['id']);}}),_0x419c1c['ui']['componentFactory']['add']('menuBar:aiCommands',_0x30a34b=>{const _0x297f75=new Kt(_0x30a34b);_0x297f75['buttonView']['set']({'label':ki(_0x30a34b,'AI\x20Commands'),'icon':_0x24f7ab}),_0x297f75['bind']('isEnabled')['to'](_0x403f14,'enabledCommandsIds',_0x41b8b4=>_0x41b8b4['length']>0x0);const _0xfc6077=wi(_0x419c1c['config']['get']('ai.assistant.commands'),_0x30a34b);return this['_populateMenuBarMenu'](_0x403f14,_0x297f75,_0xfc6077,_0x129a12=>this['_onExecute'](_0x129a12)),_0x297f75;}),_0x419c1c['ui']['componentFactory']['add']('aiAssistant',()=>{const _0x4434c8=this['_createAIAssistantUIButton'](Nt);return _0x4434c8['set']({'tooltip':!0x0,'class':'ck-ai-assistant-button\x20'+this['_uiCssClasses']}),_0x4434c8;}),_0x419c1c['ui']['componentFactory']['add']('menuBar:aiAssistant',()=>{const _0x3a5073=this['_createAIAssistantUIButton'](Wt);return _0x3a5073['set']({'role':'menuitemcheckbox'}),_0x3a5073;}),this['licenseKey']=this['editor']['config']['get']('licenseKey');const _0xb8bc5d=this['editor'];this['_licenseKeyCheckInterval']=setInterval(()=>{let _0x3ab401;for(const _0x29713a in _0xb8bc5d){const _0x411e72=_0x29713a,_0x2df23=_0xb8bc5d[_0x411e72];if('aiLicenseKeyValid'==_0x2df23||'aiLicenseKeyInvalid'==_0x2df23||'aiLicenseKeyExpired'==_0x2df23||'aiLicenseKeyDomainLimit'==_0x2df23||'aiLicenseKeyNotAllowed'==_0x2df23||'aiLicenseKeyEvaluationLimit'==_0x2df23||'aiLicenseKeyUsageLimit'==_0x2df23){delete _0xb8bc5d[_0x411e72],_0x3ab401=_0x2df23,clearInterval(this['_licenseKeyCheckInterval']),this['_licenseKeyCheckInterval']=void 0x0;break;}}'aiLicenseKeyInvalid'==_0x3ab401&&_0xb8bc5d['_showLicenseError']('invalid'),'aiLicenseKeyExpired'==_0x3ab401&&_0xb8bc5d['_showLicenseError']('expired'),'aiLicenseKeyDomainLimit'==_0x3ab401&&_0xb8bc5d['_showLicenseError']('domainLimit'),'aiLicenseKeyNotAllowed'==_0x3ab401&&_0xb8bc5d['_showLicenseError']('featureNotAllowed','AIAssistant'),'aiLicenseKeyEvaluationLimit'==_0x3ab401&&_0xb8bc5d['_showLicenseError']('evaluationLimit'),'aiLicenseKeyUsageLimit'==_0x3ab401&&_0xb8bc5d['_showLicenseError']('usageLimit');},0x3e8);}['destroy'](){super['destroy'](),this['_licenseKeyCheckInterval']&&clearInterval(this['_licenseKeyCheckInterval']);}['showUI'](_0x324d01='',_0x2ecab4='',_0x5599a0='custom'){const _0x1baf72=this['editor'],_0x3e3210=_0x1baf72['editing']['view'],_0x9b5e8e=_0x1baf72['plugins']['get'](Si),_0x4193c5=_0x1baf72['plugins']['get'](_0x30b604);_0x9b5e8e['showFakeVisualSelection']();const _0x15ec61=new Yi(),_0x18211f=new ClipboardEvent('copy',{'clipboardData':_0x15ec61}),_0x4e7823=new _0xc19f8c(_0x15ec61),_0x3bd353=new _0x6f9828(_0x3e3210,_0x18211f,{'dataTransfer':_0x4e7823});_0x4193c5['_forceMarkersCopy']('comment',()=>{_0x3e3210['document']['fire']('copy',_0x3bd353);}),this['_formView']||(this['_initView'](),this['_aiAssistantController']=new xi(_0x1baf72,this['_aiAdapter']['textAdapter'],this['_formView']));let _0x8c7a30=_0x4e7823['getData']('text/html');const _0x18f97d=_0x1baf72['model']['document']['selection'],_0x13b47f=Array['from'](_0x18f97d['getRanges']());0x1===_0x13b47f['length']&&_0x13b47f[0x0]['isFlat']&&!_0x18f97d['getSelectedElement']()&&''!==_0x8c7a30['replace'](/&nbsp;/g,'')['trim']()&&(_0x8c7a30='<p>'+_0x8c7a30+'</p>'),this['_aiAssistantController']['updateView']({'actionId':_0x5599a0,'query':_0x324d01,'htmlContent':_0x8c7a30,'label':_0x2ecab4,'mainActionLabel':Li[_0x1baf72['model']['document']['selection']['isCollapsed']?'INSERT':'REPLACE']}),'aiAssistant'!==this['_dialog']['id']?this['_dialog']['show']({'id':'aiAssistant','icon':_0x2c57e8,'title':ki(this['editor']['locale'],'AI\x20Assistant'),'content':this['_formView'],'position':Yt['EDITOR_TOP_SIDE'],'onShow':()=>{this['_formView']['focus']();},'onHide':()=>{this['_aiAssistantController']['reset'](),_0x9b5e8e['hideFakeVisualSelection']();}}):this['_dialog']['view']['wasMoved']||this['_dialog']['view']['updatePosition']();}['hideUI'](){this['_dialog']['hide']();}['_getResolvedCommandsDefinitions'](){const _0x39366e=new Map(),_0x302f43=wi(this['editor']['config']['get']('ai.assistant.commands'),this['editor']['locale']);for(const _0x458226 of _0x302f43)for(const _0xa2e975 of _0x458226['commands'])_0x39366e['set'](_0xa2e975['id'],{..._0xa2e975,'groupId':_0x458226['groupId'],'groupLabel':_0x458226['groupLabel']||_0x458226['groupId']});return _0x39366e;}['_createAIAssistantUIButton'](_0x5842a7){const _0x380f40=this['editor'],_0x4484fc=_0x380f40['commands']['get']('showAIAssistant'),_0x10224c=new _0x5842a7(_0x380f40['locale']);return _0x10224c['set']({'label':ki(_0x380f40['locale'],'AI\x20Assistant'),'icon':_0x2c57e8,'isToggleable':!0x0}),_0x10224c['bind']('isEnabled')['to'](_0x4484fc),_0x10224c['bind']('isOn')['to'](this['_dialog'],'id',_0x4c3c98=>'aiAssistant'===_0x4c3c98),this['listenTo'](_0x10224c,'execute',()=>{_0x10224c['isOn']?this['hideUI']():_0x4484fc['execute']();}),_0x10224c;}['_initView'](){const _0x4d6837=this['editor']['plugins']['get'](Si);this['_formView']=new Wi(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',()=>{_0x4d6837['insertContent'](this['_aiAssistantController']['currentContext']),this['hideUI']();}),this['listenTo'](this['_formView'],'insertContentBelow',()=>{_0x4d6837['insertContentBelow'](this['_aiAssistantController']['currentContext']),this['hideUI']();}),this['_initAriaAiStatusChangeAnnouncements']();}['_initAriaAiStatusChangeAnnouncements'](){const {locale:_0x2e10c7,ui:{ariaLiveAnnouncer:_0x45e0a9}}=this['editor'];this['_formView']['contentArea']['on']('change:isProcessing',(_0x5d671b,_0x10cbdb,_0x24f2a9)=>{const _0x5bf30a=this['_aiAssistantController']['currentContext'];_0x24f2a9?_0x45e0a9['announce'](ki(_0x2e10c7,'AI\x20is\x20writing')):_0x5bf30a&&_0x45e0a9['announce'](ki(_0x2e10c7,'Generated\x20content:\x20%0',_0x5bf30a),{'politeness':'polite','isUnsafeHTML':!0x0});}),this['_formView']['on']('change:isError',(_0x3f0203,_0x28756d,_0x50a51d)=>{if(_0x50a51d){const _0x230c23=this['_formView']['errorView']['text'];_0x45e0a9['announce'](ki(_0x2e10c7,'Error\x20during\x20AI\x20content\x20generation:\x20%0',_0x230c23));}});}['_onExecute'](_0x4a96fd){const _0x43f450=this['_commandDefinitions']['get'](_0x4a96fd),_0x396eab=this['editor'],_0x2c785e=_0x396eab['model']['document']['selection'],_0x2ac7b7=_0x396eab['commands']['get']('showAIAssistant'),_0xe8ae53=_0x396eab['plugins']['get'](Si),_0x126d29=''+(_0x43f450['groupId']!==Ci?_0x43f450['groupLabel']+':\x20':'')+_0x43f450['label'];if(!0x1!==_0x43f450['requiresContent']&&_0x2c785e['isCollapsed']){const _0x489364=At(_0x2c785e['getSelectedBlocks']())||_0x396eab['model']['schema']['getLimitElement'](_0x2c785e);_0x396eab['model']['change'](_0x16fdbc=>{_0x16fdbc['setSelection'](_0x489364,'in');});}_0xe8ae53['showFakeVisualSelection'](),_0x2ac7b7['execute'](_0x43f450['prompt'],_0x126d29,'command:'+_0x4a96fd);}['_populateMenuBarMenu'](_0x564439,_0x145091,_0x4b2a9b,_0x13b144){const _0x586496=this['editor'],_0x22bfb2=_0x586496['locale'],_0x55784f=new $t(_0x22bfb2),_0x13f743=Qi(_0x586496,_0x4b2a9b)['filter'](_0x4a119a=>_0x4a119a['commands']['length']);0x1===_0x13f743['length']?this['_getMenuBarGroupButtons']({'command':_0x564439,'commands':_0x13f743[0x0]['commands'],'parentMenuView':_0x145091,'onExecute':_0x13b144})['forEach'](_0x20bb0d=>_0x55784f['items']['add'](_0x20bb0d)):_0x13f743['forEach'](({groupId:_0x383088,groupLabel:_0x28ca76,commands:_0x32cf9c})=>{const _0x35a2b1=new qt(_0x22bfb2,_0x145091),_0x21385b=new Kt(_0x22bfb2),_0xa91307=new $t(_0x22bfb2),_0x2e6d6e=this['_getMenuBarGroupButtons']({'command':_0x564439,'commands':_0x32cf9c,'parentMenuView':_0x21385b,'onExecute':_0x13b144});_0x21385b['buttonView']['set']({'label':_0x28ca76||_0x383088}),_0x21385b['delegate']('execute')['to'](_0x145091),_0xa91307['items']['addMany'](_0x2e6d6e),_0x21385b['panelView']['children']['add'](_0xa91307),_0x35a2b1['children']['add'](_0x21385b),_0x55784f['items']['add'](_0x35a2b1);}),_0x145091['panelView']['children']['add'](_0x55784f);}['_getMenuBarGroupButtons']({command:_0x31787a,commands:_0x4a78be,parentMenuView:_0x2e3d59,onExecute:_0x116f72}){const _0x92e711=this['editor'],_0x586dce=_0x92e711['locale'];return Qi(_0x92e711,_0x4a78be)['map'](_0x29c7c3=>{const _0x4de17f=new qt(_0x586dce,_0x2e3d59),_0x402640=new Wt(_0x586dce);return _0x402640['set']({'label':_0x29c7c3['label']}),_0x402640['delegate']('execute')['to'](_0x2e3d59),_0x402640['on']('execute',()=>_0x116f72(_0x29c7c3['id'])),_0x402640['bind']('isEnabled')['to'](_0x31787a,'enabledCommandsIds',_0x3509db=>_0x3509db['includes'](_0x29c7c3['id'])),_0x4de17f['children']['add'](_0x402640),_0x4de17f;});}}function qi(_0x386f81,_0xc9c0cf){return void 0x0!==_0x386f81['order']&&void 0x0===_0xc9c0cf['order']?0x1:void 0x0===_0x386f81['order']&&void 0x0!==_0xc9c0cf['order']?-0x1:void 0x0!==_0x386f81['order']&&void 0x0!==_0xc9c0cf['order']?_0x386f81['order']-_0xc9c0cf['order']:0x0;}function Qi(_0x70d182,_0x25a2fd){_0x25a2fd['sort'](qi);const _0x4b7eae={},_0x3887df=[];for(const _0xd1d365 of _0x25a2fd)if(void 0x0!==_0xd1d365['order']){if(_0xd1d365['order']in _0x4b7eae)throw new at('ai-commands-config-order-collision',_0x70d182,{'conflictingDefinitions':[_0xd1d365,_0x4b7eae[_0xd1d365['order']]]});_0x4b7eae[_0xd1d365['order']]=_0xd1d365,_0x3887df['splice'](_0xd1d365['order'],0x0,_0xd1d365);}else _0x3887df['push'](_0xd1d365);return _0x3887df;}class Xi extends _0x18211b{static get['requires'](){return[$i,Si];}static get['pluginName'](){return'AIAssistant';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x30405d){super(_0x30405d);const _0x5a1cdf=_0x30405d['config'],_0x4bc354=_0x30405d['locale'];_0x5a1cdf['define']('ai.assistant.preserveComments',!0x0),_0x5a1cdf['define']('ai.assistant.commands',zi(_0x4bc354)),_0x5a1cdf['define']('ai.assistant.extraCommandGroups',[]),_0x5a1cdf['define']('ai.assistant.removeCommands',[]);let _0x5b7b83=wi(_0x5a1cdf['get']('ai.assistant.commands'),_0x4bc354);const _0x3b0831=_0x5a1cdf['get']('ai.assistant.extraCommandGroups'),_0x16d23c=_0x5a1cdf['get']('ai.assistant.removeCommands');_0x3b0831['forEach'](_0xa9678f=>{const _0x106928=_0x5b7b83['find'](_0x25c6b1=>_0x25c6b1['groupId']===_0xa9678f['groupId']);_0x106928?_0x106928['commands']=_0x106928['commands']['concat'](_0xa9678f['commands']):_0x5b7b83['push'](_0xa9678f);}),_0x5b7b83=_0x5b7b83['filter'](_0x28ef42=>!_0x16d23c['includes'](_0x28ef42['groupId'])),_0x5b7b83['forEach'](_0x5436c8=>{_0x5436c8['commands']=_0x5436c8['commands']['filter'](_0x4fc556=>!_0x16d23c['includes'](_0x4fc556['id']));}),_0x5a1cdf['set']('ai.assistant.commands',_0x5b7b83);}}function zi(_0x5f2b70){return[{'groupId':'editOrReview','groupLabel':ki(_0x5f2b70,'Edit\x20or\x20review'),'commands':[{'id':'improveWriting','label':ki(_0x5f2b70,'Improve\x20writing'),'prompt':'Fix\x20spelling\x20mistakes,\x20use\x20proper\x20grammar\x20and\x20apply\x20good\x20writing\x20practices.\x20Do\x20not\x20lose\x20the\x20original\x20meaning.'},{'id':'makeShorter','label':ki(_0x5f2b70,'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':ki(_0x5f2b70,'Make\x20longer'),'prompt':'Improve\x20this\x20content\x20by\x20using\x20descriptive\x20language\x20and\x20inserting\x20more\x20information\x20and\x20more\x20detailed\x20explanations.'},{'id':'simplifyLanguage','label':ki(_0x5f2b70,'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':ki(_0x5f2b70,'Generate\x20from\x20selection'),'commands':[{'id':'summarize','label':ki(_0x5f2b70,'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':ki(_0x5f2b70,'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':ki(_0x5f2b70,'Change\x20tone'),'commands':[{'id':'professional','label':ki(_0x5f2b70,'Professional'),'prompt':'Improve\x20using\x20polished,\x20formal,\x20and\x20respectful\x20language\x20to\x20convey\x20professional\x20expertise\x20and\x20competence.'},{'id':'casual','label':ki(_0x5f2b70,'Casual'),'prompt':'Improve\x20using\x20casual,\x20informal\x20language\x20to\x20convey\x20a\x20casual\x20conversation\x20with\x20a\x20real\x20person.'},{'id':'direct','label':ki(_0x5f2b70,'Direct'),'prompt':'Improve\x20using\x20direct\x20language,\x20using\x20only\x20the\x20essential\x20information.'},{'id':'confident','label':ki(_0x5f2b70,'Confident'),'prompt':'Improve\x20using\x20compelling,\x20optimistic\x20language\x20to\x20convey\x20confidence\x20in\x20the\x20writing.'},{'id':'friendly','label':ki(_0x5f2b70,'Friendly'),'prompt':'Improve\x20using\x20friendly,\x20comforting\x20language,\x20to\x20convey\x20understanding\x20and\x20empathy.'}]},{'groupId':'changeStyle','groupLabel':ki(_0x5f2b70,'Change\x20style'),'commands':[{'id':'business','label':ki(_0x5f2b70,'Business'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20business\x20professional\x20with\x20formal\x20language.'},{'id':'legal','label':ki(_0x5f2b70,'Legal'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20legal\x20professional\x20using\x20valid\x20legal\x20terminology.'},{'id':'journalism','label':ki(_0x5f2b70,'Journalism'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20journalist\x20using\x20engaging\x20language\x20to\x20convey\x20the\x20importance\x20of\x20the\x20information.'},{'id':'poetic','label':ki(_0x5f2b70,'Poetic'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20poem\x20using\x20poetic\x20techniques\x20without\x20losing\x20the\x20original\x20meaning.'}]},{'groupId':'translate','groupLabel':ki(_0x5f2b70,'Translate'),'commands':[{'id':'translateEnglish','label':ki(_0x5f2b70,'English'),'prompt':'Translate\x20the\x20content\x20to\x20English\x20language.'},{'id':'translateSpanish','label':ki(_0x5f2b70,'Spanish'),'prompt':'Translate\x20the\x20content\x20to\x20Spanish\x20language.'},{'id':'translatePortuguese','label':ki(_0x5f2b70,'Portuguese'),'prompt':'Translate\x20the\x20content\x20to\x20Portuguese\x20language.'},{'id':'translateGerman','label':ki(_0x5f2b70,'German'),'prompt':'Translate\x20the\x20content\x20to\x20German\x20language.'},{'id':'translateFrench','label':ki(_0x5f2b70,'French'),'prompt':'Translate\x20the\x20content\x20to\x20French\x20language.'},{'id':'translateChinese','label':ki(_0x5f2b70,'Simplified\x20Chinese'),'prompt':'Translate\x20the\x20content\x20to\x20Simplified\x20Chinese\x20language.'},{'id':'translateHindi','label':ki(_0x5f2b70,'Hindi'),'prompt':'Translate\x20the\x20content\x20to\x20Hindi\x20language.'},{'id':'translateArabic','label':ki(_0x5f2b70,'Arabic'),'prompt':'Translate\x20the\x20content\x20to\x20Arabic\x20language.'}]}];}class ji extends _0x18211b{['abortController'];static get['requires'](){return[Ri];}constructor(_0x1ec8f2){super(_0x1ec8f2),this['abortController']=new AbortController();}['init'](){this['editor']['plugins']['get'](Ri)['textAdapter']=this;}['abort'](){this['abortController']['signal']['aborted']||(this['abortController']['abort'](),this['abortController']=new AbortController());}async['makeRequest'](_0x28b743){return this['sendRequest'](_0x28b743)['catch'](_0x3df9d0=>{if(_0x3df9d0 instanceof Oi)return Promise['reject'](_0x3df9d0);if('AbortError'==_0x3df9d0['name'])return Promise['resolve']();throw console['error'](_0x3df9d0),new at('aitextadapter-send-request-failed',null);});}async['_prepareRequestHeaders'](_0x4d5ce0,_0x20fe44){const _0x48a8ed=this['editor']['locale'],_0x1d4406={'Content-Type':'application/json'};if('object'==typeof _0x4d5ce0)Object['assign'](_0x1d4406,_0x4d5ce0);else{if(_0x4d5ce0)try{const _0x116d44=await _0x4d5ce0(_0x20fe44);Object['assign'](_0x1d4406,_0x116d44);}catch{return Promise['reject'](new Oi(ki(_0x48a8ed,'AI_ERROR_GET_HEADERS')));}}return _0x1d4406;}async['_prepareRequestParameters'](_0x3a212d,_0x7e8362){const _0x16cd66=this['editor']['locale'];if('object'==typeof _0x3a212d)return _0x3a212d;try{return await _0x3a212d(_0x7e8362);}catch{return Promise['reject'](new Oi(ki(_0x16cd66,'AI_ERROR_GET_PARAMETERS')));}}}class Ji extends ji{['_apiUrl'];['_requestHeaders'];['_requestParameters'];static get['pluginName'](){return'OpenAITextAdapter';}constructor(_0x3bbf4a){super(_0x3bbf4a),_0x3bbf4a['config']['define']('ai.assistant.adapter.openAI.apiUrl','https://api.openai.com/v1/chat/completions'),_0x3bbf4a['config']['get']('ai.assistant.adapter.openAI.requestParameters')||_0x3bbf4a['config']['define']('ai.assistant.adapter.openAI.requestParameters',{'model':'gpt-4o','temperature':0x1,'top_p':0x1,'stream':!0x0}),this['_apiUrl']=_0x3bbf4a['config']['get']('ai.assistant.adapter.openAI.apiUrl'),this['_requestHeaders']=_0x3bbf4a['config']['get']('ai.assistant.adapter.openAI.requestHeaders')||{},this['_requestParameters']=_0x3bbf4a['config']['get']('ai.assistant.adapter.openAI.requestParameters');}async['sendRequest']({query:_0x55d9b5,context:_0xd3857a,onData:_0x5077c8,actionId:_0x1115aa}){const _0x48cd33=this['editor']['locale'],_0x385484=await this['prepareMessages'](_0x55d9b5,_0xd3857a,_0x1115aa),_0x27e7c5=await this['_prepareRequestHeaders'](this['_requestHeaders'],_0x1115aa),_0x5ac2bf=await this['_prepareRequestParameters'](this['_requestParameters'],_0x1115aa),_0x46d937={'messages':_0x385484,..._0x5ac2bf},_0x428889={'method':'POST','headers':_0x27e7c5,'body':JSON['stringify'](_0x46d937),'signal':this['abortController']['signal']},_0x18fb85=await fetch(this['_apiUrl'],_0x428889);if(_0x18fb85['ok'])return _0x5ac2bf['stream']?await this['_readStreamableResponse'](_0x18fb85,_0x5077c8):await this['_readStaticResponse'](_0x18fb85,_0x5077c8),Promise['resolve']();{const _0x10c1f6=await _0x18fb85['text']();return _0x10c1f6['includes']('context_length_exceeded')?Promise['reject'](new Oi(ki(_0x48cd33,'AI_ERROR_CONTEXT_LENGTH'))):_0x10c1f6['includes']('Moderation')?Promise['reject'](new Oi(ki(_0x48cd33,'AI_ERROR_MODERATION'))):Promise['reject'](new Error(_0x10c1f6));}}async['prepareMessages'](_0x3742e4,_0x5123af,_0x581c48){let _0x36147f,_0x4d4b8e;return _0x5123af?(_0x36147f='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.',_0x4d4b8e='Instruction:\x0a'+_0x3742e4+'\x0aYou\x20must\x20keep\x20the\x20text\x20formatting.\x0a\x0aContent:\x0a'+_0x5123af):(_0x36147f='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.',_0x4d4b8e=_0x3742e4),[{'role':'system','content':_0x36147f},{'role':'user','content':_0x4d4b8e}];}async['_readStreamableResponse'](_0x5a3a99,_0xdfac11){const _0x8b2f22=_0x5a3a99['body']['getReader'](),_0x2ed11b=new TextDecoder();let _0x3c24b2='',_0x44c41f='',_0x25eae0='',_0x2db34a=!0x1;for(;!_0x2db34a;){const {done:_0xecc5d9,value:_0x1659b0}=await _0x8b2f22['read'](),_0x498ee8=_0x3c24b2+_0x2ed11b['decode'](_0x1659b0);let _0x45a955='';_0x2db34a=_0xecc5d9;try{_0x45a955=this['_cleanUpData'](_0x498ee8),_0x3c24b2='';}catch{_0x3c24b2=_0x498ee8;continue;}_0x44c41f+=_0x45a955,!_0x2db34a&&this['_isBufferIncomplete'](_0x44c41f)||_0x44c41f&&(_0x25eae0+=_0x44c41f,_0x44c41f='',_0xdfac11(_0x25eae0));}return Promise['resolve']();}async['_readStaticResponse'](_0x5e9e37,_0x48d3c9){return _0x48d3c9((await _0x5e9e37['json']())['choices'][0x0]['message']['content']),Promise['resolve']();}['_isBufferIncomplete'](_0x41c41a){const _0x29d5c9=_0x41c41a['split']('<')['length']!==_0x41c41a['split']('>')['length'],_0x4e1ee5=_0x41c41a['length']<0x1e;return _0x29d5c9&&_0x4e1ee5;}['_cleanUpData'](_0x2b49ae){return _0x2b49ae['split'](/\n(?![^{]*\})/g)['map'](_0x7a68af=>_0x7a68af['replace']('data:\x20',''))['filter'](_0x4e7b30=>_0x4e7b30&&_0x4e7b30['length']>0x0&&'[DONE]'!==_0x4e7b30)['map'](_0x33a710=>{const {choices:_0x3125db}=JSON['parse'](_0x33a710);if(_0x3125db[0x0]?.['delta']?.['content'])return _0x3125db[0x0]['delta']['content'];})['filter'](_0x51a05c=>_0x51a05c)['join']('');}}class Zi extends ji{static get['pluginName'](){return'AWSTextAdapter';}['init'](){super['init'](),It('ai-aws-adapter-not-supported');}async['sendRequest'](_0x45df5d){throw Et('ai-aws-adapter-not-supported'),new Oi(ki(this['editor']['locale'],'AI_ERROR_AWS_NOT_SUPPORTED'));}}class ts extends Nt{constructor(_0xe663ac,_0x5311ca={}){super(_0xe663ac),this['isToggleable']=!0x0,this['set']('side',_0x5311ca['side']||'top');const _0x353cdd=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':['ck-tab-button',...pt(_0x5311ca['class']||[]),_0x353cdd['to']('side',_0x215af5=>'ck-tab-button_'+_0x215af5),_0x353cdd['to']('class')]}});}['show'](){this['set']('isVisible',!0x0);}['hide'](){this['set']('isVisible',!0x1);}}class es extends vt{['children'];constructor(_0x30a2d8,_0x9c7ec1={}){super(_0x30a2d8);const _0x18bf88=this['bindTemplate'];this['set']('isVisible',!0x1),this['set']('class',''),this['children']=this['createCollection'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-tab-panel',...pt(_0x9c7ec1['class']||[]),_0x18bf88['to']('class'),_0x18bf88['if']('isVisible','ck-hidden',_0x6433a1=>!_0x6433a1)]},'children':this['children']});}['show'](){this['set']('isVisible',!0x0);}['hide'](){this['set']('isVisible',!0x1);}}class is extends vt{['buttonViews']=this['createCollection']();['panelViews']=this['createCollection']();['_tabs']=new Map();constructor(_0x27513c,_0x160969={}){super(_0x27513c),this['set']('class',void 0x0),this['set']('activeTab',null),this['set']('side',_0x160969['side']||'top'),this['set']('isMaximized',!0x1),this['set']('collapsible',_0x160969['collapsible']||!0x1),this['set']('_isMaximizedActive',!0x1),this['bind']('_isMaximizedActive')['to'](this,'isMaximized',this,'activeTab',(_0x4de668,_0x337fe9)=>_0x4de668&&null!==_0x337fe9);const _0xb3295b=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset','ck-tabs',...pt(_0x160969['class']||[]),_0xb3295b['to']('side',_0x43711f=>'ck-tabs_'+_0x43711f),_0xb3295b['to']('class'),_0xb3295b['if']('_isMaximizedActive','ck-ai-tabs_maximized'),_0xb3295b['to']('activeTab',_0x434330=>null===_0x434330?'ck-ai-tabs_collapsed':'')],'tabindex':'0'},'children':[{'tag':'div','attributes':{'class':['ck','ck-tabs__buttons-container',_0xb3295b['to']('side',_0x3a3fc9=>'ck-tabs__buttons-container_'+_0x3a3fc9)]},'children':this['buttonViews']},{'tag':'div','attributes':{'class':['ck','ck-tabs__panels-container',_0xb3295b['to']('side',_0x312799=>'ck-tabs__panels-container_'+_0x312799)]},'children':this['panelViews']},...pt(_0x160969['children']||[])]});}['getTabIds'](){return[...this['_tabs']['keys']()];}['getTab'](_0xcc90fc){const _0x1be278=this['_tabs']['get'](_0xcc90fc);return _0x1be278||null;}['addTab'](_0x34e9f8){const _0x4db276=this['_setupButton']({'id':_0x34e9f8['id'],'label':_0x34e9f8['buttonLabel'],'icon':_0x34e9f8['buttonIcon'],'order':_0x34e9f8['order']}),_0x5c1b03=new es(this['locale']);return _0x5c1b03['render'](),_0x34e9f8['content']&&_0x5c1b03['children']['add'](_0x34e9f8['content']),this['panelViews']['add'](_0x5c1b03),this['_tabs']['set'](_0x34e9f8['id'],{'button':_0x4db276,'panel':_0x5c1b03,'order':void 0x0!==_0x34e9f8['order']?_0x34e9f8['order']:null}),this['fire']('addTab:'+_0x34e9f8['id'],{'id':_0x34e9f8['id'],'button':_0x4db276,'panel':_0x5c1b03}),null===this['activeTab']?this['activateTab'](_0x34e9f8['id']):this['_hidePanel'](_0x34e9f8['id']),{'button':_0x4db276,'panel':_0x5c1b03};}['activateTab'](_0x5db0bb){if(null!==_0x5db0bb&&!this['getTab'](_0x5db0bb))throw new at('ui-tabsview-tab-not-found',{'tabs':this,'tabId':_0x5db0bb});if(this['activeTab']===_0x5db0bb)return;const _0x4411f8=this['activeTab'];this['activeTab']&&this['_hidePanel'](this['activeTab']),this['activeTab']=_0x5db0bb,_0x5db0bb&&this['_showPanel'](_0x5db0bb),this['fire']('activateTab:'+_0x5db0bb,{'newTab':_0x5db0bb,'oldTab':_0x4411f8});}['toggleTabPanel'](_0x505df6){if(!this['getTab'](_0x505df6))throw new at('ui-tabsview-tab-not-found',{'tabs':this,'tabId':_0x505df6});this['activeTab']===_0x505df6?this['collapsible']&&(this['activeTab']=null):this['activateTab'](_0x505df6);}['showTab'](_0x1a9401){if(!this['getTab'](_0x1a9401))throw new at('ui-tabsview-tab-not-found',{'tabs':this,'tabId':_0x1a9401});this['_showPanel'](_0x1a9401),this['_showButton'](_0x1a9401),this['fire']('show:'+_0x1a9401,_0x1a9401);}['hideTab'](_0x2d7392){if(!this['getTab'](_0x2d7392))throw new at('ui-tabsview-tab-not-found',{'tabs':this,'tabId':_0x2d7392});const _0x1c1f7e=this['activeTab'];this['_hidePanel'](_0x2d7392),this['_hideButton'](_0x2d7392);const _0x3d2a4c=this['getTabIds']();_0x1c1f7e===_0x2d7392&&_0x3d2a4c['length']>0x1&&this['activateTab'](_0x3d2a4c['find'](_0x38e921=>_0x38e921!==_0x2d7392)),this['fire']('hide:'+_0x2d7392,_0x2d7392);}['_getPanel'](_0x541d81){const _0x3d82c8=this['_tabs']['get'](_0x541d81);return _0x3d82c8?_0x3d82c8['panel']:null;}['_showPanel'](_0x2e2bf6){null!==this['activeTab']&&this['activeTab']!==_0x2e2bf6||this['_getPanel'](_0x2e2bf6)['show']();}['_hidePanel'](_0x1e97b6){const _0x143ec2=this['_getPanel'](_0x1e97b6);_0x143ec2['isVisible']&&(this['activeTab']===_0x1e97b6&&(this['activeTab']=null),_0x143ec2['hide']());}['_getButton'](_0x5adb84){const _0x34c1e9=this['_tabs']['get'](_0x5adb84);return _0x34c1e9?_0x34c1e9['button']:null;}['_showButton'](_0x5eb409){this['_getButton'](_0x5eb409)['show']();}['_hideButton'](_0x28aa9d){this['_getButton'](_0x28aa9d)['hide']();}['_setupButton'](_0x3ded7f){const _0x5ca92c=new ts(this['locale'],{'side':this['side']}),_0x1e96f1=this['buttonViews'];if(_0x5ca92c['set']({'label':_0x3ded7f['label'],'icon':_0x3ded7f['icon'],'tooltip':!0x0,'withText':!0x0}),_0x5ca92c['bind']('isOn')['to'](this,'activeTab',_0x5c24ab=>_0x5c24ab===_0x3ded7f['id']),_0x5ca92c['bind']('side')['to'](this,'side'),_0x3ded7f['order']){const _0x572a21=[...this['_tabs']]['reduce']((_0x32d941,_0x34d656)=>{const _0xb8f58=_0x34d656[0x0],{order:_0x34825f}=_0x34d656[0x1];return!_0x34825f||_0x34825f>_0x3ded7f['order']?_0x32d941:_0x34825f>=_0x32d941['order']?{'id':_0xb8f58,'order':_0x34825f}:_0x32d941;},{'id':'','order':0x0}),_0x151b64=_0x1e96f1['getIndex'](this['_getButton'](_0x572a21['id']));_0x1e96f1['add'](_0x5ca92c,_0x151b64+0x1);}else _0x1e96f1['add'](_0x5ca92c);return _0x5ca92c['on']('execute',()=>{this['toggleTabPanel'](_0x3ded7f['id']);}),_0x5ca92c;}}const ss=['overlay','sidebar','custom'],ns=['left','right'];class rs extends is{constructor(_0x35007e,_0xf62635={}){super(_0x35007e,_0xf62635),this['set']('type',_0xf62635['type']||'sidebar'),this['set']('side',_0xf62635['side']||'right'),this['set']('isVisible',_0xf62635['visibleByDefault']??!0x0);const _0x3293cb=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':['ck-ai-tabs',_0x3293cb['if']('type','ck-ai-tabs__overlay',_0x316382=>'overlay'===_0x316382),_0x3293cb['if']('type','ck-ai-tabs__sidebar',_0x4db347=>'sidebar'===_0x4db347),_0x3293cb['if']('isVisible','ck-hidden',_0x3dc4ab=>!_0x3dc4ab)]}}),this['buttonViews']['on']('add',(_0x11846e,_0x3864b7)=>{_0x3864b7['set']('withText',!0x1);});}}class os extends _0x203d97{['view'];['container']=null;['showResizeButton']=!0x0;static get['pluginName'](){return'AITabs';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0xeccd09){if(super(_0xeccd09),!this['context']['config']['get']('ai.container'))throw new at('ai-tabs-configuration-not-found');this['context']['config']['define']('ai.container.visibleByDefault',!0x0),this['context']['config']['define']('ai.container.collapsible',!0x1);const _0x5c21b6=this['context']['config']['get']('ai.container');if(this['set']('side','right'),void 0x0!==_0x5c21b6['showResizeButton']&&(this['showResizeButton']=_0x5c21b6['showResizeButton']),'sidebar'!==_0x5c21b6['type']&&'overlay'!==_0x5c21b6['type']||_0x5c21b6['side']&&(this['side']=_0x5c21b6['side']),'sidebar'===_0x5c21b6['type']){if(this['container']=_0x5c21b6['element'],this['set']('type','sidebar'),!this['container'])throw new at('ai-tabs-sidebar-container-element-not-found');}else'overlay'===_0x5c21b6['type']?(this['container']=document['body'],this['set']('type','overlay')):(this['container']=null,this['set']('type','custom'));this['view']=new rs(this['context']['locale'],{'side':this['side'],'type':this['type'],'visibleByDefault':_0x5c21b6['visibleByDefault'],'collapsible':_0x5c21b6['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 _0x17198a&&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'](_0x9f519c){if(_0x9f519c&&this['type']!==_0x9f519c){if(!ss['includes'](_0x9f519c))throw new at('ai-tabs-unsupported-ui-type');this['type']=_0x9f519c;}}['switchSide'](_0x247aad){if(_0x247aad&&this['side']!==_0x247aad){if(!ns['includes'](_0x247aad))throw new at('ai-tabs-unsupported-ui-side');this['side']=_0x247aad;}}['destroy'](){super['destroy'](),this['view']['destroy'](),this['view']['element']&&this['view']['element']['remove']();}}class as extends _0x203d97{['_apiUrl'];['_token'];['_decoder'];['_responseCache'];static get['requires'](){return[_0x241029];}static get['pluginName'](){return'AIConnector';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x912ace){super(_0x912ace),this['context']['config']['define']('ai.serviceUrl','https://ai.cke-cs.com/v1'),this['_apiUrl']=this['context']['config']['get']('ai.serviceUrl'),this['_token']=null,this['_decoder']=new TextDecoder(),this['_responseCache']=new Map();}['init'](){const _0x5d2d40=this['context']['plugins']['get'](_0x241029);if(!_0x5d2d40['token'])throw new at('ai-missing-token',this);this['_token']=_0x5d2d40['token'];}['startConversation'](_0x1d46c3,_0xf5bace){const _0x45afff=this['_sendApiRequest']('/conversations','POST',{'id':_0x1d46c3,'group':_0xf5bace});return{'getConversation':async()=>(await _0x45afff['request'])['json'](),'abortController':_0x45afff['abortController']};}['queryAssistant']({message:_0x1edee1,conversationId:_0x8a9868,parts:_0xab6a78,capabilities:_0x1b8d50,model:_0x415925,attributes:_0x8df00f}){const _0x10552b={'prompt':_0x1edee1,'content':_0xab6a78,'model':_0x415925,..._0x1b8d50&&{'capabilities':_0x1b8d50},..._0x8df00f&&{'attributes':_0x8df00f}},_0x4cc839=this['_sendApiRequest']('/conversations/'+_0x8a9868+'/messages','POST',_0x10552b);return{'getStream':async()=>{const _0x14ee64=(await _0x4cc839['request'])['body'];return this['_getStreamReader'](_0x14ee64);},'abortController':_0x4cc839['abortController']};}['executeCustomAction']({content:_0x473f06,message:_0x2068dd,model:_0x496cf6,outputFormat:_0x5e4d1c}){const _0x24bdf5={'content':[{'type':'text','content':_0x473f06}],'prompt':_0x2068dd,'model':_0x496cf6,'outputFormat':_0x5e4d1c},_0x39f49e=this['_sendApiRequest']('/actions/custom/calls','POST',_0x24bdf5);return{'getStream':async()=>{const _0x312dee=(await _0x39f49e['request'])['body'];return this['_getStreamReader'](_0x312dee);},'abortController':_0x39f49e['abortController']};}['executeAction']({actionName:_0x4319cb,content:_0x248db6,args:_0x435e46}){const _0xcd124d={'content':[{'type':'text','content':_0x248db6}],'args':_0x435e46},_0x33feb0=this['_sendApiRequest']('/actions/system/'+_0x4319cb+'/calls','POST',_0xcd124d);return{'getStream':async()=>{const _0x49b3b2=(await _0x33feb0['request'])['body'];return this['_getStreamReader'](_0x49b3b2);},'abortController':_0x33feb0['abortController']};}['uploadFile'](_0x507195,_0x584bd8,_0x23d014){const _0x44dc66=new FormData();_0x44dc66['append']('file',_0x584bd8,_0x584bd8['name']),_0x23d014&&_0x44dc66['append']('attributes',JSON['stringify'](_0x23d014));const _0x30c6ae=this['_sendApiRequest']('/conversations/'+_0x507195+'/files','POST',_0x44dc66);return{'getId':async()=>(await _0x30c6ae['request'])['json'](),'abortController':_0x30c6ae['abortController']};}['fetchDocument'](_0x489737,_0x4e4f55){const _0x382221=this['_sendApiRequest']('/conversations/'+_0x489737+'/documents/'+_0x4e4f55,'GET');return{'getDocument':async()=>(await _0x382221['request'])['json'](),'abortController':_0x382221['abortController']};}['uploadDocument'](_0x4298b4,_0x55de3d,_0xe23d19){const _0x49513b={'content':_0x55de3d};_0xe23d19&&(_0x49513b['attributes']=_0xe23d19);const _0x5b262e=this['_sendApiRequest']('/conversations/'+_0x4298b4+'/documents','POST',_0x49513b);return{'getId':async()=>(await _0x5b262e['request'])['json'](),'abortController':_0x5b262e['abortController']};}['uploadDocuments'](_0x602b67,_0x5bd19b){const _0x25eff2={'documents':_0x5bd19b['map'](_0x5c8c1b=>({'content':_0x5c8c1b['content'],'attributes':{'version':_0x5c8c1b['version'],'sessionId':_0x5c8c1b['sessionId'],'selections':_0x5c8c1b['selections']},...void 0x0!==_0x5c8c1b['name']?{'name':_0x5c8c1b['name']}:{},...void 0x0!==_0x5c8c1b['description']?{'description':_0x5c8c1b['description']}:{}}))},_0x44b502=this['_sendApiRequest']('/conversations/'+_0x602b67+'/documents/batch','POST',_0x25eff2);return{'getIds':async()=>(await _0x44b502['request'])['json'](),'abortController':_0x44b502['abortController']};}['fetchDocuments'](_0x384906,_0x37d470){const _0x644a71=new URLSearchParams();_0x644a71['append']('documentIds',_0x37d470['join'](','));const _0x161113=this['_sendApiRequest']('/conversations/'+_0x384906+'/documents/batch?'+_0x644a71['toString'](),'GET');return{'getDocuments':async()=>(await _0x161113['request'])['json'](),'abortController':_0x161113['abortController']};}['fetchConversations'](_0xc91e02,_0x51785c={}){const _0x1a4f44=new URLSearchParams();_0x1a4f44['append']('group',_0xc91e02),_0x1a4f44['append']('excludeEmpty',!0x1!==_0x51785c['excludeEmpty']?'true':'false'),_0x1a4f44['append']('limit',_0x51785c['limit']?_0x51785c['limit']['toString']():'100'),_0x1a4f44['append']('sortBy',_0x51785c['sortBy']?_0x51785c['sortBy']:'createdAt'),_0x1a4f44['append']('order',_0x51785c['order']?_0x51785c['order']:'desc');const _0x15f95d=this['_sendApiRequest']('/conversations?'+_0x1a4f44['toString'](),'GET');return{'getConversations':async()=>{const _0x6a966a=await _0x15f95d['request'];return(await _0x6a966a['json']())['items'];},'abortController':_0x15f95d['abortController']};}['deleteConversation'](_0xb3540d){const _0x362834=this['_sendApiRequest']('/conversations/'+_0xb3540d,'DELETE');return{'execute':async()=>{await _0x362834['request'];},'abortController':_0x362834['abortController']};}['updateConversation'](_0x5711c9,_0x48cc90){const _0x32f58b=this['_sendApiRequest']('/conversations/'+_0x5711c9,'PATCH',_0x48cc90);return{'getResult':async()=>(await _0x32f58b['request'],_0x48cc90),'abortController':_0x32f58b['abortController']};}['fetchConversation'](_0x4b4bd6){const _0x10f28e=this['_sendApiRequest']('/conversations/'+_0x4b4bd6,'GET');return{'getConversation':async()=>(await _0x10f28e['request'])['json'](),'abortController':_0x10f28e['abortController']};}['fetchConversationMessages'](_0x13eb21){const _0x3b1aef=this['_sendApiRequest']('/conversations/'+_0x13eb21+'/messages','GET');return{'getMessages':async()=>{const _0x4d2d27=await _0x3b1aef['request'];return(await _0x4d2d27['json']())['items'];},'abortController':_0x3b1aef['abortController']};}['uploadUrl'](_0x536826,_0xc8d848,_0x390ebd){const _0x5d255b=this['_sendApiRequest']('/conversations/'+_0x536826+'/web-resources','POST',{'url':_0xc8d848,'attributes':_0x390ebd});return{'getId':async()=>(await _0x5d255b['request'])['json'](),'abortController':_0x5d255b['abortController']};}['getModels'](_0x1d01bc='en'){const _0x5c994a=new URLSearchParams();_0x5c994a['append']('language',_0x1d01bc);const _0x13b7e6='/models/1?'+_0x5c994a['toString'](),_0xe9e32c=this['_sendApiRequest'](_0x13b7e6,'GET',void 0x0,!0x0);return{'list':async()=>await(await _0xe9e32c['request'])['json'](),'abortController':_0xe9e32c['abortController']};}['deleteFile'](_0x67b4b8,_0x1398f4){const _0x186143=this['_sendApiRequest']('/conversations/'+_0x67b4b8+'/files/'+_0x1398f4,'DELETE');return{'execute':async()=>{await _0x186143['request'];},'abortController':_0x186143['abortController']};}['deleteDocument'](_0x536584,_0x25dcd4){const _0x1bf0f4=this['_sendApiRequest']('/conversations/'+_0x536584+'/documents/'+_0x25dcd4,'DELETE');return{'execute':async()=>{await _0x1bf0f4['request'];},'abortController':_0x1bf0f4['abortController']};}['deleteWebResource'](_0x3aa685,_0x3a3d25){const _0x365094=this['_sendApiRequest']('/conversations/'+_0x3aa685+'/web-resources/'+_0x3a3d25,'DELETE');return{'execute':async()=>{await _0x365094['request'];},'abortController':_0x365094['abortController']};}['callSystemReview']({reviewName:_0x463748,content:_0x4a7e95,args:_0x2ca800}){const _0x29a640=this['_sendApiRequest']('/reviews/system/'+_0x463748+'/calls','POST',{'content':[{'type':'text','content':_0x4a7e95}],'args':_0x2ca800});return{'getStream':async()=>{const _0x404435=(await _0x29a640['request'])['body'];return this['_getStreamReader'](_0x404435);},'abortController':_0x29a640['abortController']};}['callCustomReview']({content:_0x33a955,prompt:_0x1ceba7,model:_0x32b0b0}){const _0x56d2ca=this['_sendApiRequest']('/reviews/custom/calls','POST',{'content':[{'type':'text','content':_0x33a955}],'prompt':_0x1ceba7,'model':_0x32b0b0});return{'getStream':async()=>{const _0x4f9841=(await _0x56d2ca['request'])['body'];return this['_getStreamReader'](_0x4f9841);},'abortController':_0x56d2ca['abortController']};}['upsertAIChatRating'](_0x584a7a,_0x3f851b,_0x473294){const _0x44a077=this['_sendApiRequest']('/conversations/'+_0x584a7a+'/messages/'+_0x3f851b+'/ratings','PUT',{'positiveCount':_0x473294['positiveCount'],'totalCount':_0x473294['totalCount'],'modificationId':_0x473294['modificationId']});return{'execute':async()=>{await _0x44a077['request'];},'abortController':_0x44a077['abortController']};}['upsertAIActionRating'](_0x2eb778,_0x545068,_0x3cba76){const _0x22b0c=this['_sendApiRequest']('/actions/system/'+_0x2eb778+'/calls/'+_0x545068+'/ratings','PUT',{'positiveCount':_0x3cba76['positiveCount'],'totalCount':_0x3cba76['totalCount']});return{'execute':async()=>{await _0x22b0c['request'];},'abortController':_0x22b0c['abortController']};}['upsertCustomAIActionRating'](_0x121fd6,_0x510295){const _0x2fa6e9=this['_sendApiRequest']('/actions/custom/calls/'+_0x121fd6+'/ratings','PUT',{'positiveCount':_0x510295['positiveCount'],'totalCount':_0x510295['totalCount']});return{'execute':async()=>{await _0x2fa6e9['request'];},'abortController':_0x2fa6e9['abortController']};}['upsertAIReviewRating'](_0x11f300,_0x531baa,_0x28cc53,_0x54e036){const _0x213c7f=this['_sendApiRequest']('/reviews/system/'+_0x11f300+'/calls/'+_0x531baa+'/ratings','PUT',{'positiveCount':_0x28cc53['positiveCount'],'totalCount':_0x28cc53['totalCount'],'dataId':_0x54e036});return{'execute':async()=>{await _0x213c7f['request'];},'abortController':_0x213c7f['abortController']};}['upsertCustomAIReviewRating'](_0xbc553a,_0x45d352,_0x4b341f){const _0x5363ad=this['_sendApiRequest']('/reviews/custom/calls/'+_0xbc553a+'/ratings','PUT',{'positiveCount':_0x45d352['positiveCount'],'totalCount':_0x45d352['totalCount'],'dataId':_0x4b341f});return{'execute':async()=>{await _0x5363ad['request'];},'abortController':_0x5363ad['abortController']};}['_sendApiRequest'](_0x3c39d4,_0x5dde0d,_0x595294,_0x20fb91=!0x1){const _0xd5fcb0=new AbortController(),_0x328245=_0x20fb91?_0x5dde0d+':'+_0x3c39d4:null;if(_0x328245){const _0x4c9a76=this['_responseCache']['get'](_0x328245);if(_0x4c9a76)return{'request':_0x4c9a76['then'](_0x4b16e3=>_0x4b16e3['clone']()),'abortController':_0xd5fcb0};}const _0x3b56da=_0x595294 instanceof FormData,_0x24dd4b={'Authorization':'Bearer\x20'+this['_token']?.['value'],'x-feature-flags':'multi-document','X-Editor-Version':mt};_0x595294&&!_0x3b56da&&(_0x24dd4b['Content-Type']='application/json');const _0xc2c442={'method':_0x5dde0d,'headers':_0x24dd4b,'signal':_0xd5fcb0['signal']};_0x595294&&(_0xc2c442['body']=_0x3b56da?_0x595294:JSON['stringify'](_0x595294));const _0x2d3686=fetch(''+this['_apiUrl']+_0x3c39d4,_0xc2c442)['catch'](_0x4aea0e=>{_0x328245&&this['_responseCache']['delete'](_0x328245),this['_handleError'](_0x4aea0e);})['then'](_0x56aba3=>_0x56aba3['ok']?_0x56aba3:_0x56aba3['json']()['then'](_0x2d0d57=>{throw _0x328245&&this['_responseCache']['delete'](_0x328245),{'url':this['_apiUrl'],'path':_0x3c39d4,'method':_0x5dde0d,'body':_0x595294,'status':(_0x56aba3||{})['status'],'statusText':(_0x56aba3||{})['statusText'],'code':_0x2d0d57['code'],'message':_0x2d0d57['message'],'traceId':_0x2d0d57['traceId']};}));return _0x328245&&this['_responseCache']['set'](_0x328245,_0x2d3686['then'](_0x5097bf=>_0x5097bf['clone']())),{'request':_0x2d3686,'abortController':_0xd5fcb0};}async*['_getStreamReader'](_0x55f8ab){const _0x1664b9=[],_0xe1ef5c=_0x55f8ab['getReader'](),_0x29e0f4=_0x493a5f({'onError':_0x35ade2=>{this['_handleError'](_0x35ade2);},'onEvent':_0x4f1960=>{_0x4f1960['data']=JSON['parse'](_0x4f1960['data']),_0x1664b9['push'](_0x4f1960);}});try{let _0x43c383=!0x1;for(;!_0x43c383;){const {done:_0x3329da,value:_0x4467c5}=await _0xe1ef5c['read']();_0x3329da&&(_0x43c383=!0x0),_0x29e0f4['feed'](this['_decoder']['decode'](_0x4467c5,{'stream':!0x0})),yield*_0x1664b9,_0x1664b9['length']=0x0;}}catch(_0x18ac6f){this['_handleError'](_0x18ac6f);}finally{_0xe1ef5c['releaseLock'](),_0x29e0f4['reset']();}}['_handleError'](_0x367ef7){if(_0x367ef7 instanceof at)throw _0x367ef7;if(_0x367ef7 instanceof Error&&'AbortError'===_0x367ef7['name'])throw new at('ai-request-aborted',this,{'originalError':_0x367ef7});throw new at('ai-request-failed',this,{'originalError':_0x367ef7});}}function hs(_0x2d7b77,_0x1b797b,_0x30950f){const t=_0x2d7b77['t'];switch(_0x1b797b){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'},_0x30950f);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.'},_0x30950f);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.'},_0x30950f);case'AI_CHAT_RESOURCE_LOAD_FAILED':return t({'id':'AI_CHAT_RESOURCE_LOAD_FAILED','string':'Failed\x20to\x20load\x20resource.\x20Please\x20try\x20again.'});case'AI_CHAT_CONTEXT_CURRENT_DOCUMENT':return t({'id':'AI_CHAT_CONTEXT_CURRENT_DOCUMENT','string':'Current\x20document'});case'AI_CHAT_CONTEXT_REMOVE_FROM_CONTEXT':return t({'id':'AI_CHAT_CONTEXT_REMOVE_FROM_CONTEXT','string':'Remove\x20from\x20context'});case'AI_CHAT_CONTEXT_ADD_CONTEXT':return t({'id':'AI_CHAT_CONTEXT_ADD_CONTEXT','string':'Add\x20context'});case'AI_CHAT_CONTEXT_URL_LABEL':return t({'id':'AI_CHAT_CONTEXT_URL_LABEL','string':'URL'});case'AI_CHAT_CONTEXT_FILE_LABEL':return t({'id':'AI_CHAT_CONTEXT_FILE_LABEL','string':'File'});case'AI_CHAT_CONTEXT_CURRENT_CONTEXT_LABEL':return t({'id':'AI_CHAT_CONTEXT_CURRENT_CONTEXT_LABEL','string':'Current\x20context'});case'AI_CHAT_CONTEXT_DOCUMENT_SELECTION_LABEL':return t({'id':'AI_CHAT_CONTEXT_DOCUMENT_SELECTION_LABEL','string':'Selected\x20content'});case'AI_CHAT_SEARCH_WEB':return t({'id':'AI_CHAT_SEARCH_WEB','string':'Web\x20search'});case'AI_CHAT_ENABLE_WEB_SEARCH':return t({'id':'AI_CHAT_ENABLE_WEB_SEARCH','string':'Enable\x20web\x20search'});case'AI_CHAT_DISABLE_WEB_SEARCH':return t({'id':'AI_CHAT_DISABLE_WEB_SEARCH','string':'Disable\x20web\x20search'});case'AI_CHAT_REASONING':return t({'id':'AI_CHAT_REASONING','string':'Reasoning'});case'AI_CHAT_ENABLE_REASONING':return t({'id':'AI_CHAT_ENABLE_REASONING','string':'Enable\x20reasoning'});case'AI_CHAT_DISABLE_REASONING':return t({'id':'AI_CHAT_DISABLE_REASONING','string':'Disable\x20reasoning'});case'AI_CHAT_COMMANDS':return t({'id':'AI_CHAT_COMMANDS','string':'Commands'});case'AI_CHAT_SEARCH_RESOURCES':return t({'id':'AI_CHAT_SEARCH_RESOURCES','string':'Search\x20resources'});case'AI_CHAT_CONTEXT_URL_BACK_TO_CONTEXT':return t({'id':'AI_CHAT_CONTEXT_URL_BACK_TO_CONTEXT','string':'Back\x20to\x20context\x20options'});case'AI_CHAT_CONTEXT_URL_ADD_URL':return t({'id':'AI_CHAT_CONTEXT_URL_ADD_URL','string':'Add\x20URL'});case'AI_CHAT_CONTEXT_URL_PLACEHOLDER':return t({'id':'AI_CHAT_CONTEXT_URL_PLACEHOLDER','string':'Add\x20URL...'});case'AI_CHAT_CONTEXT_UNABLE_TO_UPLOAD_URL':return t({'id':'AI_CHAT_CONTEXT_UNABLE_TO_UPLOAD_URL','string':'Failed\x20to\x20upload\x20URL:\x20%0.\x20Please\x20try\x20again.'},_0x30950f);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'},_0x30950f);case'AI_CHAT_SUGGESTION_ACTION_SUGGEST':return t({'id':'AI_CHAT_SUGGESTION_ACTION_SUGGEST','string':'Suggest'},_0x30950f);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'},_0x30950f);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.'},_0x30950f);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.'},_0x30950f);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.'},_0x30950f);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.'},_0x30950f);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'},_0x30950f);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.'},_0x30950f);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 _0x1b797b;}}const cs='ck-ai-button-primary',ls='ck-ai-button-secondary',us='ck-ai-button-tertiary';function ds(_0x23e2c7,_0xb02a0e){const _0x36938f=new Nt(_0x23e2c7),_0x58ca1e=hs(_0x23e2c7,'AI_TABS_LABEL_MINIMIZE'),_0xea1397=hs(_0x23e2c7,'AI_TABS_LABEL_MAXIMIZE');return _0x36938f['set']({'withText':!0x1,'icon':_0x33ceb8,'tooltip':!0x0,'class':'ck-ai-tabs__resize\x20'+us}),_0x36938f['bind']('label')['to'](_0xb02a0e,'isMaximized',_0x45378b=>_0x45378b?_0x58ca1e:_0xea1397),_0x36938f['bind']('icon')['to'](_0xb02a0e,'isMaximized',_0x5e0689=>_0x5e0689?_0x16dfe5:_0x33ceb8),_0x36938f['bind']('isOn')['to'](_0xb02a0e,'isMaximized'),_0x36938f['on']('execute',()=>{_0xb02a0e['fire']('resizeTabs');}),_0x36938f;}function _s(_0x8a2fb6){return _0x4192fa(_0x8a2fb6);}function gs(_0x3e4310){return ti(_0x3e4310);}function As(_0x4ec6f9,_0x34787c,_0x1c7a16){const _0x1a8e0a=null!==_0x34787c?_0x20bb45=>_0x20bb45['attribs'][_0x4ec6f9]===_0x34787c:_0x3e84ad=>Boolean(_0x3e84ad['attribs'][_0x4ec6f9]);return _0x140027(_0x5587b7=>_0x526176(_0x5587b7)&&_0x1a8e0a(_0x5587b7),_0x1c7a16);}function Is(_0x1a5c18,_0x4e1149,_0x1a1dc1){const _0x1c5116=null!==_0x4e1149?_0x5dd636=>_0x5dd636['attribs'][_0x1a5c18]===_0x4e1149:_0x566dc1=>Boolean(_0x566dc1['attribs'][_0x1a5c18]);return _0x1b06b2(_0xab47d6=>_0x526176(_0xab47d6)&&_0x1c5116(_0xab47d6),_0x1a1dc1);}function Es(_0x5222ba,_0x6e4a22){return _0x5222ba&&_0x526176(_0x5222ba)?_0x5222ba['attribs'][_0x6e4a22]:null;}function ps(_0x46580c,_0x127af5,_0x38c65d){_0x526176(_0x46580c)&&(null===_0x38c65d?delete _0x46580c['attribs'][_0x127af5]:_0x46580c['attribs'][_0x127af5]=_0x38c65d);}function ms(_0x2492d9,_0x24d167,_0x1b511c){const _0x2488db=_0x24d167['cloneNode'](!0x0);'beforebegin'===_0x1b511c?_0x3822cc(_0x2492d9,_0x2488db):'afterbegin'===_0x1b511c?_0x113ebe(_0x2492d9,_0x2488db):'beforeend'===_0x1b511c?_0x30ceba(_0x2492d9,_0x2488db):'afterend'===_0x1b511c&&_0x452435(_0x2492d9,_0x2488db);}function Ts(_0x8cdd3d){const _0x29de3f=[];let _0x506b85=_0x8cdd3d;for(;_0x506b85;)_0x506b85=_0x17ebde(_0x506b85),_0x506b85&&_0x29de3f['push'](_0x506b85);return _0x29de3f;}function Cs(_0x148ddd){return _0x148ddd['replace'](/^\s+/gm,'')['replace'](/\s+$/gm,'')['replace'](/\n*/g,'')['replace'](/\s+/g,'\x20')['replace'](/>\s*</g,'><');}function ws(_0x54af2e){let _0x4a1af8=0x0;for(;_0x54af2e['parentNode'];)_0x54af2e=_0x54af2e['parentNode'],_0x4a1af8++;return _0x4a1af8;}function fs(_0x13139d){const _0x27145a=[];let _0x286a77=_0x13139d['nextSibling'];for(;_0x286a77;)_0x27145a['push'](_0x286a77),_0x286a77=_0x286a77['nextSibling'];_0x27145a['forEach'](_0x2bca2f=>{_0x38c273(_0x2bca2f);});}class bs extends/* #__PURE__ -- @preserve */
25
+ ht(){['_m2html'];constructor(){super();const _0x3c3c71=Object['entries'](_0x2e055b),_0x4ef32e=_0x3c3c71['findIndex'](([_0xdcec56])=>'rehypeDomRaw'===_0xdcec56);if(-0x1===_0x4ef32e)throw new at('ai-response-parser-unable-to-set-up-parser');_0x3c3c71['splice'](_0x4ef32e+0x1,0x0,['rehypeSanitize',_0x5290ef]),this['_m2html']=new _0x2d790b({'plugins':Object['fromEntries'](_0x3c3c71)});}['convertMarkdownToHTML'](_0x53139d){const _0x54d6c3=this['_m2html']['parse'](_0x53139d);return this['parseAndNormalizeHTML'](_0x54d6c3);}['parseAndNormalizeHTML'](_0x49fcb0){return this['_parseHTML'](_0x49fcb0);}['_parseHTML'](_0x320ee9){const _0x18996e=_s('<dummy>'+_0x320ee9['replace'](/^\t+/gm,'\x20')['replace'](/\n*/g,'')['replace'](/\s+/g,'\x20')['replace'](/<[^>]*?$/g,'')+'</dummy>');return _0x18996e['children']=_0x18996e['children'][0x0]['children'],_0x18996e;}}class Ss extends/* #__PURE__ -- @preserve */
26
+ ht(){['_generateUid'];['_uidCounter']=0x0;['_touchedNodesState']={'newIds':[],'modifiedIds':[],'removedIds':[],'invalidIds':[],'lastTouchedId':null};['_existingDataIds']=new Set();constructor(_0x3e1af7){super(),this['_generateUid']=_0x3e1af7||(()=>'e'+String(this['_uidCounter']++));}['merge'](_0x3a8ff4,_0x431da0,_0x1634b1){this['_uidCounter']=0x0;const _0x18dd66=_0x3a8ff4['cloneNode'](!0x0),_0x42e17b=_0x18dd66['childNodes'],_0x128603=Array['from'](_0x42e17b)['filter'](_0x2a8114=>!(0x3===_0x2a8114['nodeType']&&''===gs(_0x2a8114)['trim']())),_0x1be1cb=_0x128603['length'],_0x21556a=new Map();for(const _0x40a360 of _0x128603)_0x40a360&&_0x526176(_0x40a360)&&void 0x0===_0x40a360['attribs']['data-id']&&ps(_0x40a360,'data-id','new-element');if(0x0===_0x431da0['childNodes']['length']){const _0x43fabd=[];return Is('data-id','new-element',_0x18dd66)['forEach'](_0x1d93be=>{const _0x314437=this['_generateUid']();ps(_0x1d93be,'data-id',_0x314437),_0x43fabd['push'](_0x314437);}),this['_removeSpecialComments'](_0x18dd66),{'parsedContent':_0x18dd66,'newNodeIds':_0x43fabd,'modifiedNodeIds':[],'removedNodeIds':[],'newAnchorIds':_0x21556a};}_0x1634b1&&_0x1634b1['markUnstableElements']&&this['_markLastTagElementUnstable'](_0x18dd66),this['_touchedNodesState']['newIds']=[],this['_touchedNodesState']['modifiedIds']=[],this['_touchedNodesState']['removedIds']=[],this['_touchedNodesState']['invalidIds']=[],this['_touchedNodesState']['lastTouchedId']=null,this['_existingDataIds']=new Set(Is('data-id',null,_0x431da0)['map'](_0x3a5038=>Es(_0x3a5038,'data-id'))['filter'](_0x588962=>!!_0x588962));let _0x5d52fb=-0x1,_0x522bd1=!0x1;for(let _0x2d7488=0x0;_0x2d7488<_0x1be1cb;_0x2d7488++){const _0x437b54=_0x128603[_0x2d7488],_0xd95d5a=_0x128603[_0x2d7488+0x1];if(this['_isNewNode'](_0x437b54)){if(-0x1===_0x5d52fb&&(_0x5d52fb=_0x2d7488),this['_markWrappedElements'](_0x437b54),!this['_isNewNode'](_0xd95d5a)){const [_0x42ff38,_0x3deb07]=this['_findReferenceNode'](_0x437b54,_0x522bd1,_0x431da0);if(_0x42ff38){const _0x3796fd=Array['from'](_0x128603)['slice'](_0x5d52fb,_0x2d7488+0x1),_0x12c9c2=Es(_0x42ff38,'data-id');if(this['_insertNodes'](_0x42ff38,_0x3796fd,_0x3deb07),_0x12c9c2)for(const _0x5b8a6d of _0x3796fd){const _0x2d234a=Es(_0x5b8a6d,'data-id');_0x2d234a&&_0x21556a['set'](_0x2d234a,_0x12c9c2);}_0x5d52fb=-0x1;}}}else{if(this['_isExistingContentComment'](_0x437b54))_0x522bd1=!0x0;else{if(this['_isExistingNode'](_0x437b54)){const _0x1fe87c=Es(_0x437b54,'data-id');if(_0x1fe87c&&this['_existingDataIds']['has'](_0x1fe87c)){const _0x43bbd4=As('data-id',_0x1fe87c,_0x431da0);this['_replaceNode'](_0x43bbd4,_0x437b54);}}else{if(this['_isDelNode'](_0x437b54)){const _0x5555e0=this['_getNodeDataId'](_0x437b54);!!As('data-id',_0x5555e0,_0x18dd66)||this['_touchedNodesState']['removedIds']['push'](_0x5555e0);}}}}}for(const _0x398aa0 of this['_touchedNodesState']['removedIds']){const _0x3f1d5d=As('data-id',_0x398aa0,_0x431da0);_0x3f1d5d&&this['_removeNode'](_0x3f1d5d,_0x398aa0,_0x1634b1);}if(Is('data-id','new-element',_0x431da0)['forEach'](_0x330c8d=>{const _0x51dbd1=this['_getUid'](_0x330c8d);ps(_0x330c8d,'data-id',_0x51dbd1),this['_touchedNodesState']['newIds']['push'](_0x51dbd1);}),this['_removeSpecialComments'](_0x431da0),_0x1634b1&&_0x1634b1['markUnstableElements']&&this['_markUnstableElements'](_0x431da0,_0x1634b1['markUnstableElementsDepth']||0x0),this['_processWrappedElements'](_0x431da0,_0x1634b1),_0x1634b1&&_0x1634b1['cutAfterLastChange']&&this['_touchedNodesState']['lastTouchedId']){const _0x1ffcde=Is('data-id',this['_touchedNodesState']['lastTouchedId'],_0x431da0);let _0x55c1d9=_0x1ffcde[_0x1ffcde['length']-0x1];for(;_0x55c1d9;)fs(_0x55c1d9),_0x55c1d9=_0x55c1d9['parentNode'];}return{'parsedContent':_0x431da0,'newNodeIds':this['_touchedNodesState']['newIds'],'modifiedNodeIds':this['_touchedNodesState']['modifiedIds'],'removedNodeIds':this['_touchedNodesState']['removedIds'],'newAnchorIds':_0x21556a};}['_insertNodes'](_0x3d0544,_0x52f915,_0x341604){for(const _0x59c37e of _0x52f915){const _0x55f333=this['_getUid'](_0x59c37e);ps(_0x59c37e,'data-id',_0x55f333),this['_touchedNodesState']['newIds']['push'](_0x55f333),this['_touchedNodesState']['lastTouchedId']=_0x55f333;}const _0x5e465c='afterbegin'===_0x341604||'afterend'===_0x341604?_0x52f915['reverse']():_0x52f915;for(const _0x651fbc of _0x5e465c)ms(_0x3d0544,_0x651fbc,_0x341604);}['_replaceNode'](_0xac759e,_0x32b583){if(!_0xac759e)return;if(_0x2868fa=_0x32b583,Cs(gs(_0xac759e))===Cs(gs(_0x2868fa)))return;var _0x2868fa;const _0x589749=this['_getUid'](_0xac759e);ps(_0x32b583,'data-id',_0x589749),this['_touchedNodesState']['modifiedIds']['push'](_0x589749),this['_touchedNodesState']['lastTouchedId']=_0x589749,_0x3ddbdc(_0xac759e,_0x32b583['cloneNode'](!0x0));}['_removeNode'](_0x44f496,_0x76b9d6,_0x24cbf6){if(_0x24cbf6&&_0x24cbf6['replaceRemovedWith']){this['_touchedNodesState']['lastTouchedId']=_0x76b9d6;const _0x2af170=_0x24cbf6['replaceRemovedWith']['cloneNode'](!0x0);ps(_0x2af170,'data-id',_0x76b9d6),ps(_0x2af170,'data-removed','true'),_0x3ddbdc(_0x44f496,_0x2af170);}else _0x38c273(_0x44f496);}['_findReferenceNode'](_0x54539b,_0x28c3b7,_0x2ff506){const _0x388cb5=this['_findPrevElementWithDataId'](_0x54539b,!0x1);if(_0x388cb5){const _0x4e6790=this['_getNodeDataId'](_0x388cb5),_0x2be505=As('data-id',_0x4e6790,_0x2ff506);if(_0x2be505)return[_0x2be505,'afterend'];this['_touchedNodesState']['invalidIds']['push'](_0x4e6790);}const _0x4234a5=this['_findNextElementWithDataId'](_0x54539b,!0x1);if(_0x4234a5){const _0x425d02=this['_getNodeDataId'](_0x4234a5),_0x857b90=As('data-id',_0x425d02,_0x2ff506);if(_0x857b90)return[_0x857b90,'beforebegin'];this['_touchedNodesState']['invalidIds']['push'](_0x425d02);}return _0x28c3b7?_0x54539b['nextSibling']?this['_findFallbackReferenceNode'](_0x54539b,_0x2ff506):[_0x2ff506['childNodes'][_0x2ff506['childNodes']['length']-0x1],'afterend']:[_0x2ff506['childNodes'][0x0],'beforebegin'];}['_findFallbackReferenceNode'](_0x2ef08c,_0x103d97){const _0x4488d0=[],_0x195659=this['_findPrevElementWithDataId'](_0x2ef08c,!0x0);if(_0x195659){const _0xa8aa6f=As('data-id',this['_getNodeDataId'](_0x195659),_0x103d97);_0xa8aa6f&&_0x4488d0['push']([_0xa8aa6f,'afterend']);}const _0x27b2e1=this['_findNextElementWithDataId'](_0x2ef08c,!0x0);if(_0x27b2e1){const _0x4cff1e=As('data-id',this['_getNodeDataId'](_0x27b2e1),_0x103d97);_0x4cff1e&&_0x4488d0['push']([_0x4cff1e,'beforebegin']);}if(_0x4488d0['length']>0x1)return ws(_0x4488d0[0x0][0x0])<=ws(_0x4488d0[0x1][0x0])?_0x4488d0[0x0]:_0x4488d0[0x1];return 0x1===_0x4488d0['length']?_0x4488d0[0x0]:[_0x103d97['lastChild'],'afterend'];}['_findNextElementWithDataId'](_0x4f1097,_0x43cddf){let _0x4f65ed=_0x4f1097['nextSibling'],_0x2850cf=null,_0x1eb389=!0x1;for(;_0x4f65ed;){if(_0x1dd8a6(_0x4f65ed)){if(this['_isDelNode'](_0x4f65ed)&&(_0x2850cf=_0x4f65ed),this['_isExistingContentComment'](_0x4f65ed)&&_0x43cddf&&!_0x1eb389){_0x1eb389=!0x0,_0x4f65ed=_0x4f65ed['nextSibling'];continue;}break;}const _0x3425e9=Es(_0x4f65ed,'data-id');if(_0x3425e9&&'new-element'!==_0x3425e9&&this['_existingDataIds']['has'](_0x3425e9)){_0x2850cf=_0x4f65ed;break;}_0x4f65ed=_0x4f65ed['nextSibling'];}return _0x2850cf;}['_findPrevElementWithDataId'](_0x4a9bbb,_0x51ab8d){let _0x4a0623=_0x4a9bbb['previousSibling'],_0xce8fd7=null,_0x48f820=!0x1;for(;_0x4a0623;){if(_0x1dd8a6(_0x4a0623)){if(this['_isDelNode'](_0x4a0623)&&(_0xce8fd7=_0x4a0623),this['_isExistingContentComment'](_0x4a0623)&&_0x51ab8d&&!_0x48f820){_0x48f820=!0x0,_0x4a0623=_0x4a0623['previousSibling'];continue;}break;}const _0x15af92=Es(_0x4a0623,'data-id');if(_0x15af92&&'new-element'!==_0x15af92&&this['_existingDataIds']['has'](_0x15af92)){_0xce8fd7=_0x4a0623;break;}_0x4a0623=_0x4a0623['previousSibling'];}return _0xce8fd7;}['_markWrappedElements'](_0x37a01b){_0x526176(_0x37a01b)&&Is('data-id',null,_0x37a01b)['forEach'](_0x4d2d58=>{this['_isExistingNode'](_0x4d2d58)&&(ps(_0x4d2d58,'data-wrapped-id',Es(_0x4d2d58,'data-id')),ps(_0x4d2d58,'data-id',null));});}['_processWrappedElements'](_0x4c6c8c,_0x12b420){Is('data-wrapped-id',null,_0x4c6c8c)['forEach'](_0x36eaea=>{const _0x4e5257=Es(_0x36eaea,'data-wrapped-id');if(Es(_0x36eaea,'data-unstable')||this['_hasUnstableParent'](_0x36eaea))return;const _0x914d5d=As('data-id',_0x4e5257,_0x4c6c8c);ps(_0x36eaea,'data-id',_0x4e5257),ps(_0x36eaea,'data-wrapped-id',null),_0x914d5d&&(this['_removeNode'](_0x914d5d,_0x4e5257,_0x12b420),this['_touchedNodesState']['removedIds']['push'](_0x4e5257),this['_touchedNodesState']['lastTouchedId']=_0x4e5257);});}['_hasUnstableParent'](_0x4687cb){let _0x595ffc=_0x4687cb['parentNode'];for(;_0x595ffc;){if(Es(_0x595ffc,'data-unstable'))return!0x0;_0x595ffc=_0x595ffc['parentNode'];}return!0x1;}['_getNodeDataId'](_0x582f88){if(!_0x582f88)return null;if(_0x526176(_0x582f88))return Es(_0x582f88,'data-id');if(_0x1dd8a6(_0x582f88)){const _0x2fab8b=gs(_0x582f88)['match'](/removed[\s*-]data-id="([^"]+)"/);if(_0x2fab8b&&_0x2fab8b[0x1])return _0x2fab8b[0x1];}return null;}['_getUid'](_0x2c13a6){return this['_isExistingNode'](_0x2c13a6)?Es(_0x2c13a6,'data-id'):this['_generateUid']();}['_removeSpecialComments'](_0x3e1f00){(function(_0x1a74d0){return _0x5f8a2c(_0x430ec1=>_0x1dd8a6(_0x430ec1),_0x1a74d0,!0x0,0x1/0x0);}(_0x3e1f00)['filter'](_0x21ad4d=>this['_isDelNode'](_0x21ad4d)||this['_isExistingContentComment'](_0x21ad4d))['forEach'](_0x51b6cb=>{_0x38c273(_0x51b6cb);}));}['_markLastTagElementUnstable'](_0x5ac4e4){const _0x587a70=_0x5ac4e4['childNodes'],_0x289e5c=_0x587a70[_0x587a70['length']-0x1];_0x289e5c&&_0x526176(_0x289e5c)&&ps(_0x289e5c,'data-unstable','true');}['_markUnstableElements'](_0x3d5076,_0x308d10){const _0x3bbd5a=As('data-unstable','true',_0x3d5076);if(!_0x3bbd5a)return;const _0xcb28e9=Ts(_0x3bbd5a)['slice'](0x0,-0x1),_0x1d8063=_0xcb28e9['length'];let _0x3d326b=_0x3bbd5a;if(_0x1d8063>_0x308d10){let _0x4aa5f7=_0x1d8063,_0x5284a9=null;for(;_0x4aa5f7>_0x308d10&&_0x4aa5f7>=0x0;)_0x4aa5f7--,_0x5284a9=_0xcb28e9[_0x4aa5f7];_0x5284a9&&(_0x3d326b=_0x5284a9,ps(_0x3bbd5a,'data-unstable',null),ps(_0x5284a9,'data-unstable','true'));}else{if(_0x1d8063<_0x308d10){let _0x12b5d7=_0x1d8063,_0x29b08e=_0x3bbd5a;for(;_0x12b5d7<_0x308d10;){const _0x56b2c4=_0x29b08e['childNodes']['filter'](_0x5cfc02=>_0x526176(_0x5cfc02));if(0x0===_0x56b2c4['length'])break;_0x12b5d7++,_0x29b08e=_0x56b2c4[_0x56b2c4['length']-0x1];}_0x29b08e&&(_0x3d326b=_0x29b08e,ps(_0x3bbd5a,'data-unstable',null),ps(_0x29b08e,'data-unstable','true'));}}let _0x3aa527=_0x3d326b;for(;_0x3aa527;){for(;_0x3aa527['nextSibling'];)_0x3aa527=_0x3aa527['nextSibling'],_0x526176(_0x3aa527)&&ps(_0x3aa527,'data-unstable','true');_0x3aa527=_0x3aa527['parentNode'];}}['_isNewNode'](_0x5e7a61){return Boolean('new-element'===Es(_0x5e7a61,'data-id'));}['_isExistingNode'](_0x1893d9){return Boolean((Es(_0x1893d9,'data-id')||'')['length']>0x0&&'new-element'!==Es(_0x1893d9,'data-id'));}['_isDelNode'](_0x31cda1){return!!_0x31cda1&&Boolean(_0x1dd8a6(_0x31cda1)&&gs(_0x31cda1)['match'](/removed[\s*-]data-id="[^"]+"/));}['_isExistingContentComment'](_0x377fa4){return Boolean(_0x1dd8a6(_0x377fa4)&&gs(_0x377fa4)['match'](/\s*existing[\s*-](content|document)\s*/g));}}function Rs({editor:_0x5a3420,changeGroups:_0x560e4f,documentContextContent:_0x2eb699,showDiff:_0x3d431a,trimUnchanged:_0x9ca884=!0x0}){return _0x560e4f['map'](_0x8aaf37=>{const _0x4b6c63=new _0x837b91([]),_0x5cce37=new _0x837b91([]),_0x3d43c2=new Set();for(const _0x5f5735 of _0x8aaf37['changes'])'new'==_0x5f5735['type']&&Is('data-id',null,_0x5f5735['node'])['forEach'](_0x512598=>{_0x3d43c2['add'](Es(_0x512598,'data-id'));});for(const _0x581501 of _0x8aaf37['changes'])if('removed'!=_0x581501['type']?_0x5cce37['children']['push'](_0x581501['node']['cloneNode'](!0x0)):_0x3d431a||_0x3d43c2['has'](_0x581501['id'])||_0x5cce37['children']['push'](_0x581501['node']['cloneNode'](!0x0)),'new'!=_0x581501['type']&&(_0x3d431a||'removed'!=_0x581501['type'])){const _0x27d17c=_0x140027(_0x4fb4f1=>Es(_0x4fb4f1,'data-id')==_0x581501['id'],_0x2eb699,!0x0);_0x27d17c&&_0x4b6c63['children']['push'](_0x27d17c['cloneNode'](!0x0));}const {content:_0x588d6a,hasChanges:_0x21c646}=function(_0x8fa1fa,_0x1367b6,_0x6d4ee9,_0x54fe63,_0x182ccb=!0x0){const _0x119998=_0x8fa1fa['plugins']['get']('DocumentCompare'),_0xcb5864=gs(_0x1367b6),_0x33b4a0=gs(_0x6d4ee9),_0x671dd9=_0x8fa1fa['data']['parse'](_0xcb5864,'$root'),_0x5401b7=_0x8fa1fa['model']['createPositionAt'](_0x671dd9,0x0),_0xbf2eb=_0x119998['getDiff'](_0xcb5864,_0x33b4a0,{'anchor':_0x5401b7,'markDeletions':_0x54fe63,'targetEditor':_0x8fa1fa}),_0x21932f=_0xbf2eb['getOperations']();if(0x0==_0x21932f['length'])return{'content':_0x1367b6['cloneNode'](!0x0),'hasChanges':!0x1};_0x54fe63?function(_0x22fcd6,_0x3a492f,_0xbcd58){if(0x0==_0x22fcd6['length'])return;const _0x4b8852=_0xbcd58['plugins']['get']('DocumentCompare'),_0x3cde82=_0xbcd58['plugins']['get']('SuggestionsConversion');_0xbcd58['model']['change'](_0x126b8b=>{const _0x549a9d=new Set();for(let _0x160f9f=0x0;_0x160f9f<_0x22fcd6['length'];_0x160f9f++){const _0x48ead2=_0x22fcd6[_0x160f9f];if(_0x48ead2['baseVersion']=null,_0x48ead2['isDocumentOperation']=!0x1,_0x4b8852['isMarkedRemoveOperation'](_0x48ead2)){const _0x248e66=_0x44cc67(_0x48ead2['newRange'],_0xbcd58['model']),_0x1d89b5='suggestion:deletion:'+ot()+':$aiSuggestion';_0x3a492f['markers']['set'](_0x1d89b5,_0x248e66);}else switch(_0x48ead2['type']){case'rename':{if(_0x48ead2['oldName']==_0x48ead2['newName'])break;_0x126b8b['batch']['addOperation'](_0x48ead2),_0xbcd58['model']['applyOperation'](_0x48ead2);const _0x49f61e='$elementName',_0x347943=_0x48ead2['position'],_0x2237a2=_0xbcd58['model']['createRange'](_0x347943,_0xbcd58['model']['createPositionAt'](_0x347943['nodeAfter'],'end')),_0xd0609c='suggestion:attribute:'+_0x49f61e+':'+ot()+':$aiSuggestion';_0x3a492f['markers']['set'](_0xd0609c,_0x2237a2);break;}case'addAttribute':case'removeAttribute':case'changeAttribute':{if(_0x48ead2['oldValue']==_0x48ead2['newValue'])break;_0x126b8b['batch']['addOperation'](_0x48ead2),_0xbcd58['model']['applyOperation'](_0x48ead2);const _0x34b3ef=_0x48ead2['key'];if(!_0x3cde82['isRegisteredAttribute'](_0x34b3ef))break;const _0xfd82c0=_0x44cc67(_0x48ead2['range'],_0xbcd58['model']),_0x1d963b='suggestion:attribute:'+_0x34b3ef+':'+ot()+':$aiSuggestion';_0x3a492f['markers']['set'](_0x1d963b,_0xfd82c0);break;}case'insert':{_0x126b8b['batch']['addOperation'](_0x48ead2),_0xbcd58['model']['applyOperation'](_0x48ead2);if(_0x22fcd6[_0x160f9f+0x1]&&'move'==_0x22fcd6[_0x160f9f+0x1]['type']){Os(_0x3a492f,_0x48ead2);break;}const _0x346c8b=_0x48ead2['position'],_0x3d1b61=_0x48ead2['howMany'],_0x2cb8a9=_0x44cc67(_0xbcd58['model']['createRange'](_0x346c8b,_0x346c8b['getShiftedBy'](_0x3d1b61)),_0xbcd58['model']),_0x469ce5='suggestion:insertion:'+ot()+':$aiSuggestion';_0x3a492f['markers']['set'](_0x469ce5,_0x2cb8a9);break;}case'split':{_0x126b8b['batch']['addOperation'](_0x48ead2),_0xbcd58['model']['applyOperation'](_0x48ead2);const _0x1d1914=_0x48ead2['splitPosition'],_0x3d6cca=_0x48ead2['moveTargetPosition'],_0x113dc6=_0xbcd58['model']['createRange'](_0x1d1914,_0x3d6cca),_0xe0da55='suggestion:insertion:'+ot()+':$aiSuggestion';_0x3a492f['markers']['set'](_0xe0da55,_0x113dc6);break;}case'move':{_0x126b8b['batch']['addOperation'](_0x48ead2),_0xbcd58['model']['applyOperation'](_0x48ead2),_0x22fcd6[_0x160f9f-0x1]&&'insert'==_0x22fcd6[_0x160f9f-0x1]['type']&&Os(_0x3a492f,_0x48ead2);const _0x481d93=_0x48ead2['getMovedRangeStart'](),_0x138545=_0x48ead2['howMany'];for(let _0x2e2679=0x0;_0x2e2679<_0x138545;_0x2e2679++){const _0x4c4f70=_0x481d93['getShiftedBy'](_0x2e2679)['nodeAfter'];_0x549a9d['add'](_0x4c4f70);}break;}case'remove':{const _0x18e9d3=_0x48ead2['sourcePosition'],_0x17da99=_0x48ead2['howMany'],_0x23b916=new _0x25589e(_0x18e9d3,_0x17da99);_0x126b8b['batch']['addOperation'](_0x23b916),_0xbcd58['model']['applyOperation'](_0x23b916);break;}}}for(const _0x23d507 of _0x549a9d){const _0x14f4f9=_0xbcd58['model']['createRangeOn'](_0x23d507),_0x12cb73='suggestion:formatBlock:$fakeWrap:'+ot()+':$aiSuggestion';_0x3a492f['markers']['set'](_0x12cb73,_0x44cc67(_0x14f4f9,_0xbcd58['model']));}});}(_0x21932f,_0x671dd9,_0x8fa1fa):_0x8fa1fa['model']['change'](_0x5a9056=>{for(const _0x4977d4 of _0x21932f)if('remove'==_0x4977d4['type']){const _0xcc6287=_0x4977d4['sourcePosition'],_0x328761=_0x4977d4['howMany'],_0x2ef966=new _0x25589e(_0xcc6287,_0x328761);_0x5a9056['batch']['addOperation'](_0x2ef966),_0x8fa1fa['model']['applyOperation'](_0x2ef966);}else{if('marker'==_0x4977d4['type']){const _0x17d5b1=_0x4977d4['name'],_0x17cee4=_0x4977d4['newRange'];null!==_0x17cee4?_0x671dd9['markers']['set'](_0x17d5b1,_0x17cee4):_0x671dd9['markers']['delete'](_0x17d5b1);}else _0x4977d4['baseVersion']=null,_0x4977d4['isDocumentOperation']=!0x1,_0x5a9056['batch']['addOperation'](_0x4977d4),_0x8fa1fa['model']['applyOperation'](_0x4977d4);}});if(_0x182ccb){const _0x5351b5=ks(_0x8fa1fa,_0x21932f,_0x671dd9);Ns(_0x8fa1fa['model'],_0x5351b5),function(_0x453bc3,_0x5a14db){const _0x2020b0=_0x5a14db['getFirstRange']()['start'];let _0x4bfae0=_0x5a14db['getFirstRange']()['end'];const _0x51c8b2=_0x2020b0['root'];(_0x4bfae0['textNode']||_0x4bfae0['nodeAfter']&&_0x4bfae0['nodeAfter']['is']('$text'))&&(_0x4e370c(_0x4bfae0,'...'),_0x4bfae0=_0x4bfae0['getShiftedBy'](0x3)),(_0x2020b0['textNode']||_0x2020b0['nodeBefore']&&_0x2020b0['nodeBefore']['is']('$text'))&&(_0x4e370c(_0x2020b0,'...'),function(_0x3b616c,_0x166930,_0x168fe4){for(let [_0x383f1b,_0x4bcc07]of _0x3b616c['markers']){const _0x1e0668=_0x4bcc07['_getTransformedByInsertion'](_0x166930,_0x168fe4,!0x1);_0x4bcc07=_0x1e0668[0x0],_0x3b616c['markers']['set'](_0x383f1b,_0x4bcc07);}}(_0x51c8b2,_0x2020b0,0x3),_0x2020b0['parent']==_0x4bfae0['parent']&&(_0x4bfae0=_0x4bfae0['getShiftedBy'](0x3)));const _0x34ef27=_0x453bc3['createRange'](_0x453bc3['createPositionAt'](_0x51c8b2,0x0),_0x2020b0),_0x44a608=_0x453bc3['createRange'](_0x4bfae0,_0x453bc3['createPositionAt'](_0x51c8b2,'end')),_0x5f4e06=[..._0x34ef27['getMinimalFlatRanges'](),..._0x44a608['getMinimalFlatRanges']()];_0x5f4e06['reverse']();for(const _0x1c6b4d of _0x5f4e06)_0x54f979(_0x1c6b4d),ys(_0x51c8b2,_0x1c6b4d);}(_0x8fa1fa['model'],_0x5351b5);}const _0xce52c8=_0x8fa1fa['data']['stringify'](_0x671dd9,{'showSuggestionHighlights':!0x0});return{'content':_s(_0xce52c8),'hasChanges':!0x0};}(_0x5a3420,_0x4b6c63,_0x5cce37,_0x3d431a,_0x9ca884);return{'type':_0x8aaf37['changes'][0x0]['type'],'index':_0x8aaf37['index'],'content':_0x588d6a,'hasChanges':_0x21c646};});}function Os(_0x426de9,_0x5a21f7){for(const [_0x1082d2,_0x59bbd7]of _0x426de9['markers']){const _0x5dae16=_0x28623e['_createFromRanges'](_0x59bbd7['getTransformedByOperation'](_0x5a21f7));_0x426de9['markers']['set'](_0x1082d2,_0x5dae16);}}function ks(_0x159c79,_0x49a8eb,_0x48a6cf){const _0x3a4003=_0x159c79['plugins']['get']('DocumentCompare');let _0x3e2603=_0x159c79['model']['createPositionAt'](_0x48a6cf,Number['POSITIVE_INFINITY']),_0x484c22=_0x159c79['model']['createPositionAt'](_0x48a6cf,0x0);for(const _0x1fa7b7 of _0x49a8eb){let _0x30669f,_0x434735;if(_0x3a4003['isMarkedRemoveOperation'](_0x1fa7b7))_0x30669f=_0x1fa7b7['newRange']['start'],_0x434735=_0x1fa7b7['newRange']['end'];else switch(_0x3e2603=_0x3e2603['getTransformedByOperation'](_0x1fa7b7),_0x484c22=_0x484c22['getTransformedByOperation'](_0x1fa7b7),_0x1fa7b7['type']){case'rename':_0x30669f=_0x1fa7b7['position'],_0x434735=_0x30669f['getShiftedBy'](0x1);break;case'addAttribute':case'removeAttribute':case'changeAttribute':_0x30669f=_0x1fa7b7['range']['start'],_0x434735=_0x1fa7b7['range']['end'];break;case'insert':_0x30669f=_0x1fa7b7['position'],_0x434735=_0x30669f['getShiftedBy'](_0x1fa7b7['howMany']);break;case'split':_0x30669f=_0x1fa7b7['splitPosition'],_0x434735=_0x1fa7b7['moveTargetPosition'];break;case'merge':{const _0x2bb838=_0x1fa7b7['targetPosition']['path']['slice'](0x0,-0x1);_0x30669f=_0x159c79['model']['createPositionFromPath'](_0x48a6cf,_0x2bb838),_0x434735=_0x30669f['getShiftedBy'](0x1);break;}case'move':case'remove':{const _0x3a4fc4=_0x1fa7b7['howMany'],_0x5e9de6=_0x1fa7b7['sourcePosition']['_getTransformedByInsertion'](_0x1fa7b7['targetPosition'],_0x3a4fc4),_0x1df44f=_0x1fa7b7['getMovedRangeStart']();'remove'==_0x1fa7b7['type']?(_0x30669f=_0x5e9de6,_0x434735=_0x5e9de6):(_0x30669f=_0x1df44f,_0x434735=_0x1df44f['getShiftedBy'](_0x3a4fc4));break;}}_0x30669f&&_0x30669f['isBefore'](_0x3e2603)&&(_0x3e2603=_0x30669f['clone'](),_0x3e2603['stickiness']='toNone'),_0x434735&&_0x434735['isAfter'](_0x484c22)&&(_0x484c22=_0x434735['clone'](),_0x484c22['stickiness']='toNone');}return _0x159c79['model']['createSelection'](_0x159c79['model']['createRange'](_0x3e2603,_0x484c22));}function Ns(_0x3049d1,_0x2355a9){vs(_0x3049d1,_0x2355a9,'forward');const _0x4b9e60=_0x2355a9['getFirstRange']();_0x2355a9['setTo']([]),_0x2355a9['setTo'](_0x4b9e60,{'backward':!0x0}),vs(_0x3049d1,_0x2355a9,'backward');}function vs(_0x4b746c,_0x3a6133,_0x4c5bd6){let _0xe41cc8=0x14;for(;_0xe41cc8;){_0x4b746c['modifySelection'](_0x3a6133,{'unit':'word','direction':_0x4c5bd6}),_0xe41cc8--;const _0x36eb55=_0x3a6133['focus']['forward'==_0x4c5bd6?'nodeBefore':'nodeAfter'];if(_0x36eb55&&_0x36eb55['is']('element')&&_0x4b746c['schema']['isBlock'](_0x36eb55)&&_0x4b746c['schema']['isObject'](_0x36eb55))break;}}function ys(_0x5d6ece,_0x4b707d){for(const [_0x1cbb87,_0x5eeb3f]of _0x5d6ece['markers']){const _0x4cb843=_0x5eeb3f['_getTransformedByDeletion'](_0x4b707d['start'],_0x4b707d['end']['offset']-_0x4b707d['start']['offset']);null!=_0x4cb843?_0x5d6ece['markers']['set'](_0x1cbb87,_0x4cb843):_0x5d6ece['markers']['delete'](_0x1cbb87);}}class xs extends ht(){['id'];['interactionId'];['type'];['sources']=[];['parsedContent']=new _0x837b91([]);['parsedMergedContent']=new _0x837b91([]);['changeGroups']=[];['areActionsDisabled']=!0x1;['isFromHistory']=!0x1;['documentContextContent'];['documentId'];['dataIdDocumentSources'];['newNodeAnchorIds']=new Map();['aiResponseParser'];['aiResponseApplier'];['locale'];['cachedSuggestionContentParts']={'withDiff':[],'withoutDiff':[]};constructor({type:_0x4d8fec,content:_0x69ea85='',isDone:_0x8f69a9=!0x1,isComplete:_0x3f6766,interactionId:_0x187943,areActionsDisabled:_0x191495,isFromHistory:_0x13eb33=!0x1,documentContextContent:_0x35331b,dataIdDocumentSources:_0x5eaa92,documentId:_0x2851e1,locale:_0x659c02,id:_0x4c7668}){super(),this['id']=_0x4c7668||ot(),this['interactionId']=_0x187943,this['type']=_0x4d8fec,this['areActionsDisabled']=!!_0x191495,this['locale']=_0x659c02,this['dataIdDocumentSources']=_0x5eaa92,this['documentId']=_0x2851e1,this['isFromHistory']=_0x13eb33,this['aiResponseParser']=new bs(),this['aiResponseApplier']=new Ss(),this['documentContextContent']=_s(_0x35331b||''),this['set']('isDone',_0x8f69a9),this['set']('isComplete',_0x3f6766??_0x8f69a9),this['on']('change:content',()=>{this['onContentChange']();}),this['set']('content',_0x69ea85);}['appendContent'](_0x501713){this['set']('content',this['content']+_0x501713);}['done'](_0x33a13f=!0x0){this['isComplete']=_0x33a13f,this['isDone']||(this['set']('isDone',!0x0),this['onContentChange']());}['destroy'](){this['stopListening']();}['setChangeGroupState'](_0x4f726e,_0x5b5605){this['changeGroups'][_0x4f726e]['state']=_0x5b5605,this['fire']('replyChangeGroupStateUpdated',{'reply':this,'index':_0x4f726e,'state':_0x5b5605});}['getContentParts']({showDiff:_0x36b3e4,groupIndex:_0x490516,editor:_0x25209e}){const _0x5a18a0=this['_getCachedContentParts'](_0x36b3e4,_0x490516);if(_0x5a18a0)return _0x5a18a0;let _0xc58e32=[];if(void 0x0===_0x490516)_0xc58e32=this['changeGroups'];else{const _0x5e09be=this['changeGroups']['find'](({index:_0x3f3b8b})=>_0x3f3b8b===_0x490516);if(!_0x5e09be)throw new at('ai-reply-get-content-parts-group-not-found',null,{'aiReply':this,'groupIndex':_0x490516});_0xc58e32=[_0x5e09be];}const _0x50485b=Rs({'editor':_0x25209e,'showDiff':_0x36b3e4,'changeGroups':_0xc58e32,'documentContextContent':this['documentContextContent']});return this['_setCachedContentParts'](_0x36b3e4,_0x50485b),_0x50485b;}['_getCachedContentParts'](_0x2656b5,_0x52be50){const _0x2045f7=_0x2656b5?'withDiff':'withoutDiff';if(!this['cachedSuggestionContentParts'][_0x2045f7]['length'])return null;const _0x5b546a=this['cachedSuggestionContentParts'][_0x2045f7];if(void 0x0===_0x52be50)return _0x5b546a['length']>0x0&&_0x5b546a['length']!==this['changeGroups']['length']?(this['_setCachedContentParts'](_0x2656b5,null),null):_0x5dca53(_0x5b546a);{const _0x4a72f3=_0x5b546a['find'](({index:_0x241878})=>_0x241878===_0x52be50);if(_0x4a72f3)return[_0x5dca53(_0x4a72f3)];}return null;}['_setCachedContentParts'](_0x3fccbc,_0x1b14c2){const _0x246aa9=_0x3fccbc?'withDiff':'withoutDiff';_0x1b14c2?_0x1b14c2['forEach'](_0xa588a4=>{const _0x1d5f14=this['cachedSuggestionContentParts'][_0x246aa9],_0x4e7748=_0x1d5f14['find'](({index:_0x1c2cc9})=>_0x1c2cc9===_0xa588a4['index']);if(_0x4e7748){const _0x3a76f1=_0x1d5f14['indexOf'](_0x4e7748);_0x1d5f14['splice'](_0x3a76f1,0x1,_0xa588a4);}else _0x1d5f14['push'](_0xa588a4);}):this['cachedSuggestionContentParts'][_0x246aa9]['length']=0x0;}['onContentChange'](){if('modification'===this['type']){this['parsedContent']=this['aiResponseParser']['parseAndNormalizeHTML'](this['content']);const _0x4e3b44=this['changeGroups'];this['updateChangeGroups']();const _0x4e11ee=this['_getDifferentChangeGroups'](_0x4e3b44,this['changeGroups']);(_0x4e11ee['length']||this['isDone'])&&(this['fire']('replyContentUpdated',this,_0x4e11ee),this['cachedSuggestionContentParts']['withDiff']['length']=this['cachedSuggestionContentParts']['withoutDiff']['length']=0x0);}else this['parsedContent']=this['aiResponseParser']['convertMarkdownToHTML'](this['content']),this['fire']('replyContentUpdated',this);}['_getDifferentChangeGroups'](_0x33f673,_0x53f804){const _0x477d8c=[];for(const _0x121dbf of _0x53f804){const _0x1e68a7=_0x33f673[_0x121dbf['index']];_0x1e68a7?_0x1e68a7['changes']['length']!==_0x121dbf['changes']['length']?_0x477d8c['push'](_0x121dbf):_0x1e68a7['changes']['forEach']((_0x1cdd43,_0x526a6d)=>{const _0x3a81da=_0x121dbf['changes'][_0x526a6d];_0x1cdd43['id']!==_0x3a81da['id']&&_0x477d8c['push'](_0x121dbf);}):_0x477d8c['push'](_0x121dbf);}return _0x477d8c;}['updateChangeGroups'](){const _0x2afb4f=this['locale']?new _0x307097('p',{},[new _0x307097('span',{'style':'color:\x20#808080;\x20font-style:\x20italic'},[new _0x3bcbda(hs(this['locale'],'AI_SUGGESTION_CONTENT_PART_REMOVED'))])]):void 0x0,_0x4cfa48=this['aiResponseApplier']['merge'](this['parsedContent'],this['documentContextContent']['cloneNode'](!0x0),{'markUnstableElements':!this['isDone']||!this['isComplete'],'replaceRemovedWith':_0x2afb4f,'cutAfterLastChange':!this['isDone']||!this['isComplete']});if(!_0x4cfa48['modifiedNodeIds']['length']&&!this['isDone'])return;this['parsedMergedContent']=_0x4cfa48['parsedContent'],this['newNodeAnchorIds']=_0x4cfa48['newAnchorIds'];let _0x40b6b3=[];if(_0x1b06b2(_0x82d9e4=>{const _0x3fe87f=Es(_0x82d9e4,'data-id');if(!_0x3fe87f||!_0x46a901(_0x3fe87f))return!0x1;const _0x242dfe=[_0x82d9e4,...Ts(_0x82d9e4)]['at'](-0x2);if(_0x82d9e4!=_0x242dfe){const _0x76c338=Es(_0x242dfe,'data-id');_0x46a901(_0x76c338)||(_0x40b6b3['push']({'node':_0x242dfe,'id':_0x76c338,'type':'modified'}),_0x4cfa48['modifiedNodeIds']['push'](_0x76c338));}else _0x4cfa48['modifiedNodeIds']['includes'](_0x3fe87f)?_0x40b6b3['push']({'node':_0x82d9e4,'type':'modified','id':_0x3fe87f}):_0x4cfa48['newNodeIds']['includes'](_0x3fe87f)?_0x40b6b3['push']({'node':_0x82d9e4,'type':'new','id':_0x3fe87f,'anchorId':Es(_0x82d9e4['previousSibling'],'data-id')}):_0x40b6b3['push']({'node':_0x82d9e4,'type':'removed','id':_0x3fe87f});return!0x0;},this['parsedMergedContent']),_0x40b6b3=_0x40b6b3['filter'](({node:_0x5d6b9d})=>[...Ts(_0x5d6b9d),_0x5d6b9d]['every'](_0x242836=>!Es(_0x242836,'data-unstable'))),0x0==_0x40b6b3['length'])return;const _0x5e50d3=[[_0x40b6b3[0x0]]];for(let _0x713129=0x1;_0x713129<_0x40b6b3['length'];_0x713129++){const _0x3439c6=_0x5e50d3[_0x5e50d3['length']-0x1],_0x577cb4=_0x3439c6[_0x3439c6['length']-0x1];_0x40b6b3[_0x713129]['node']['previousSibling']==_0x577cb4['node']&&'modified'!=_0x40b6b3[_0x713129]['type']&&'modified'!=_0x577cb4['type']&&this['_isSameDocument'](_0x40b6b3[_0x713129]['node'],_0x577cb4['node'])?_0x3439c6['push'](_0x40b6b3[_0x713129]):_0x5e50d3['push']([_0x40b6b3[_0x713129]]);}for(const _0x4540f6 of _0x5e50d3){const _0x3749ae=_0x4540f6[0x0],_0x1fbf3b=_0x4540f6[_0x4540f6['length']-0x1],_0x4cecad=_0x96fa13(_0x3749ae['node']['previousSibling']);_0x4cecad&&this['_isSameDocument'](_0x4cecad['node'],_0x3749ae['node'])&&_0x4540f6['unshift'](_0x4cecad);const _0x378f82=_0x96fa13(_0x1fbf3b['node']['nextSibling']);_0x378f82&&this['_isSameDocument'](_0x378f82['node'],_0x1fbf3b['node'])&&_0x4540f6['push'](_0x378f82);}function _0x46a901(_0x15b88f){return _0x4cfa48['modifiedNodeIds']['includes'](_0x15b88f)||_0x4cfa48['newNodeIds']['includes'](_0x15b88f)||_0x4cfa48['removedNodeIds']['includes'](_0x15b88f);}function _0x96fa13(_0x27106c){if(_0x27106c&&Es(_0x27106c,'data-id')&&!Es(_0x27106c,'data-unstable')){const _0x12caa1=Es(_0x27106c,'data-id');if(!_0x46a901(_0x12caa1))return{'node':_0x27106c,'type':'context','id':_0x12caa1};}return null;}this['changeGroups']=_0x5e50d3['map']((_0x209f07,_0x52e73f)=>({'changes':_0x209f07,'state':'pending','index':_0x52e73f}));}['_isSameDocument'](_0x16e78e,_0x46781e){if(!this['dataIdDocumentSources']?.['size'])return!0x0;const _0x3da192=this['_resolveDocumentSource'](_0x16e78e),_0x3497ce=this['_resolveDocumentSource'](_0x46781e);return!_0x3da192||!_0x3497ce||_0x3da192['editor']===_0x3497ce['editor']&&_0x3da192['rootName']===_0x3497ce['rootName'];}['_resolveDocumentSource'](_0x1725c3){if(!_0x1725c3||!this['dataIdDocumentSources'])return;const _0x3c870a=Es(_0x1725c3,'data-id');if(_0x3c870a){const _0x33027a=this['dataIdDocumentSources']['get'](_0x3c870a);if(_0x33027a)return _0x33027a;const _0xa67709=this['newNodeAnchorIds']['get'](_0x3c870a),_0x25f42b=_0xa67709?this['dataIdDocumentSources']['get'](_0xa67709):void 0x0;if(_0x25f42b)return _0x25f42b;}for(let _0x585b76=_0x1725c3['previousSibling'];_0x585b76;_0x585b76=_0x585b76['previousSibling']){const _0x47aced=Es(_0x585b76,'data-id'),_0xad8aad=_0x47aced?this['dataIdDocumentSources']['get'](_0x47aced):void 0x0;if(_0xad8aad)return _0xad8aad;}for(let _0x78e5b3=_0x1725c3['nextSibling'];_0x78e5b3;_0x78e5b3=_0x78e5b3['nextSibling']){const _0x5a18e2=Es(_0x78e5b3,'data-id'),_0x1a5b3f=_0x5a18e2?this['dataIdDocumentSources']['get'](_0x5a18e2):void 0x0;if(_0x1a5b3f)return _0x1a5b3f;}}}const Ls=['interactionCreated','interactionStarted','interactionStopped','interactionFinished','interactionDestroyed','replyCreated','replyContentUpdated','replyChangeGroupStateUpdated','setConversationTitle','webSearchStarted','webSearchFinished','reasoningStarted','reasoningFinished','toolDataReceived','error'];class Ds extends Tt(){['id'];['replies']=[];['currentReply'];['messageId'];['actionCallId'];['currentRequest'];['connector'];['isStopped']=!0x1;['isDestroyed']=!0x1;['locale'];['_isReasoning']=!0x1;['_isWebSearching']=!0x1;constructor({connector:_0x144568,locale:_0x200fbd}){super(),this['id']=ot(),this['connector']=_0x144568,this['isStopped']=!0x0,this['locale']=_0x200fbd;}async['start'](){const _0x4ffb71=[];let _0x123286,_0x4250a6,_0x31f90a,_0x43781e=!0x1;this['isStopped']=!0x1;try{this['currentRequest']=await this['sendRequest'](),this['fire']('interactionStarted',this);const _0x221731=await this['currentRequest']['getStream']();for await(const _0x1fcad0 of _0x221731){if(this['isStopped'])return;if('error'==_0x1fcad0['event'])return void this['fire']('error',{'error':new at('ai-chat-interaction-error',this)});switch(_0x1fcad0['event']){case'message-metadata':this['messageId']=_0x1fcad0['data']['messageId'];break;case'action-metadata':this['actionCallId']=_0x1fcad0['data']['callId'];break;case'conversation-title':this['setConversationTitle'](_0x1fcad0['data']['conversationTitle'],!0x0);break;case'source':_0x4ffb71['push'](_0x1fcad0['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'](),_0x123286='modification-delta'==_0x1fcad0['event']?'modification':'text',_0x4250a6='modification-delta'==_0x1fcad0['event']?_0x1fcad0['data']['id']:void 0x0,this['currentReply']&&this['currentReply']['type']!=_0x123286&&(this['currentReply']['done'](),this['currentReply']=void 0x0),this['currentReply']?'modification-delta'==_0x1fcad0['event']&&(this['currentReply']['documentId']=_0x1fcad0['data']['documentId']):(this['currentReply']=this['createReply']({'type':_0x123286,'interactionId':this['id'],'id':_0x4250a6,...'modification-delta'==_0x1fcad0['event']&&{'documentId':_0x1fcad0['data']['documentId']}}),'modification'==_0x123286&&(this['currentReply']['sources']=_0x4ffb71['splice'](0x0))),this['currentReply']['appendContent'](_0x1fcad0['data']['textDelta']);break;case'mcp-tool-result':_0x31f90a=JSON['parse'](_0x1fcad0['data']['result']),this['_handleToolResultData']({'toolName':_0x1fcad0['data']['toolName'],'data':_0x31f90a['data'],'attributes':_0x31f90a['attributes']});break;case'mcp-tool-notification':this['_handleToolNotificationData']({'toolName':_0x1fcad0['data']['toolName'],'data':_0x1fcad0['data']['data']});}}_0x43781e=!0x0;}finally{this['isStopped']||(this['currentReply']&&_0x4ffb71['length']>0x0&&(this['currentReply']['sources']=_0x4ffb71['splice'](0x0)),this['_finalizeInteraction'](_0x43781e),this['fire']('interactionFinished',this));}}['stop'](){this['isStopped']||(this['_finalizeInteraction'](),this['fire']('interactionStopped',this));}['getReply'](_0x27c569){return this['replies']['find'](_0x4afe10=>_0x4afe10['id']===_0x27c569);}['destroy'](){this['isDestroyed']||(this['stop'](),this['replies']['forEach'](_0xa2a888=>_0xa2a888['destroy']()),this['replies']=[],this['isDestroyed']=!0x0,this['fire']('interactionDestroyed',this),this['stopListening']());}['createReply'](_0xa61fd7){const _0x2930ca=new xs({'locale':this['locale'],'documentContextContent':this['getDocumentContext']()?.['content'],'dataIdDocumentSources':this['getDocumentContext']()?.['dataIdDocumentSources'],..._0xa61fd7});return this['replies']['push'](_0x2930ca),_0x2930ca['delegate'](...Ls)['to'](this),this['fire']('replyCreated',_0x2930ca),_0x2930ca;}['setConversationTitle'](_0x1a1f76,_0x4ef040=!0x1){this['fire']('setConversationTitle',_0x1a1f76,_0x4ef040);}['resetWebSearchState'](){this['_isWebSearching']&&(this['_isWebSearching']=!0x1,this['fire']('webSearchFinished',this));}['resetReasoningState'](){this['_isReasoning']&&(this['_isReasoning']=!0x1,this['fire']('reasoningFinished',this));}['_handleToolResultData'](_0x515746){this['fire']('toolDataReceived',{'type':'result','toolName':_0x515746['toolName'],'data':structuredClone(_0x515746['data']||{}),'attributes':structuredClone(_0x515746['attributes']||{})},this);}['_handleToolNotificationData'](_0x1a8054){this['fire']('toolDataReceived',{'type':'notification','toolName':_0x1a8054['toolName'],'data':structuredClone(_0x1a8054['data'])},this);}['_finalizeInteraction'](_0x2d17c9=!0x1){this['isStopped']=!0x0,this['currentRequest']&&this['currentRequest']['abortController']['abort'](),this['currentReply']&&this['currentReply']['done'](_0x2d17c9),this['currentRequest']=this['currentReply']=void 0x0;}}const Ps=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']]),Hs=['contextItemAdded','contextItemRemoved','contextItemLoadingEnded','contextSent','error','addContextOptionsChanged','sourceResourcesLoaded','resourceStateChanged','uploadProgressChanged'];class Ms extends ht(){['_connector'];['_config'];['_ownerId'];constructor({connector:_0x157b13,config:_0x551a90,ownerId:_0x40c739}){super(),this['_connector']=_0x157b13,this['_config']=_0x551a90,this['_ownerId']=_0x40c739;}['init'](){this['_pendingContextItems']=new Map(),this['_conversationContextItems']=new Map(),this['_ongoingUploads']=new Map(),this['_ongoingUploadOperations']=new Map(),this['_documentSources']=new Map(),this['_dataIdToSource']=new Map(),this['_setAddContextOptionsDefaultState']();}['getDocumentSource'](_0x53dc08){if(_0x53dc08)return this['_documentSources']['get'](_0x53dc08);}['getSourceByDataId'](_0xa01c7f){if(_0xa01c7f)return this['_dataIdToSource']['get'](_0xa01c7f);}['getDocumentContextSlice'](_0x12bd64){const _0x1c3554=this['getDocumentSource'](_0x12bd64);if(_0x1c3554)return{'editor':_0x1c3554['editor'],'rootName':_0x1c3554['rootName'],'html':_0x1c3554['content'],'version':_0x1c3554['version']};}['getDocumentContextSliceByDataId'](_0x8efd81){const _0xc8076d=this['getSourceByDataId'](_0x8efd81);return _0xc8076d?this['getDocumentContextSlice'](_0xc8076d['documentId']):void 0x0;}['getPendingContextItems'](){return this['_pendingContextItems'];}async['populateFromMessage'](_0x19772d){const _0x2ca056=await this['_createContextItemFromContent'](_0x19772d);return this['_addToConversationContextItem'](_0x2ca056),'current-document'===_0x2ca056['uiId']&&this['_toggleAddCurrentDocumentOptionVisibility'](),_0x2ca056;}async['populateDocumentsFromUserMessage'](_0x52d1db,_0x1de744){const _0x3471b1=_0x52d1db['filter'](_0x4756aa=>'document'===_0x4756aa['type']);if(0x0===_0x3471b1['length'])return{'hasUnmatched':!0x1};if(0x1===_0x3471b1['length'])return{'contextItem':await this['populateFromMessage'](_0x3471b1[0x0]),'hasUnmatched':!0x1};const _0x5c5011=_0x3471b1['map'](_0xcb0ff8=>_0xcb0ff8['id']),_0x3062be=await this['_connector']['fetchDocuments'](this['_ownerId'],_0x5c5011)['getDocuments'](),_0xf46302=new Map(_0x3062be['map'](_0x1e7c8c=>[_0x1e7c8c['id'],_0x1e7c8c]));this['_documentSources']['clear'](),this['_dataIdToSource']['clear']();const _0x51b6d9=[];let _0x1a7f0a=!0x1;for(const _0x1cc97a of _0x3471b1){const _0x3d8c6c=_0xf46302['get'](_0x1cc97a['id']);if(!_0x3d8c6c)continue;const _0xe07927=this['_matchDocumentToRoot'](_0x3d8c6c,_0x1de744),_0x4ce6a5=_0x1de744[0x0]&&this['_getFirstRoot'](_0x1de744[0x0]);_0xe07927||(_0x1a7f0a=!0x0);const _0x5e1950=_0xe07927?.['editor']??_0x4ce6a5?.['editor'],_0x1cdfaf=_0xe07927?.['rootName']??_0x4ce6a5?.['rootName'];if(_0x5e1950&&_0x1cdfaf){const _0x3d0a46={'editor':_0x5e1950,'rootName':_0x1cdfaf,'content':_0x3d8c6c['content'],'version':_0x3d8c6c['attributes']?.['version']??0x0,'name':_0x3d8c6c['name'],'description':_0x3d8c6c['description']};this['_documentSources']['set'](_0x3d8c6c['id'],_0x3d0a46);const _0x3d300f=_s(_0x3d8c6c['content']);for(const _0x4fa50b of _0x1b06b2(_0x253aed=>!!Es(_0x253aed,'data-id'),_0x3d300f)){const _0x594102=Es(_0x4fa50b,'data-id');_0x594102&&this['_dataIdToSource']['set'](_0x594102,{..._0x3d0a46,'documentId':_0x3d8c6c['id']});}}_0x51b6d9['push']({'id':_0x3d8c6c['id'],'content':_0x3d8c6c['content'],'version':_0x3d8c6c['attributes']?.['version']??0x0,'sessionId':_0x3d8c6c['attributes']?.['sessionId']??null,'selection':[]});}const _0x412ffb={'id':'current-document','uiId':'current-document','label':'Current\x20document','type':'document','hidden':this['_conversationContextItems']['has']('current-document'),'documents':_0x51b6d9,'dataIdDocumentSources':new Map(this['_dataIdToSource'])};return this['_addToConversationContextItem'](_0x412ffb),this['_toggleAddCurrentDocumentOptionVisibility'](),{'contextItem':_0x412ffb,'hasUnmatched':_0x1a7f0a};}['_matchDocumentToRoot'](_0x448203,_0x52c920){if(_0x448203['name'])for(const _0x4b0647 of _0x52c920){const _0x10d177=_0x4b0647['config']['get']('roots')||{};for(const _0x43fca2 of _0x4b0647['model']['document']['getRoots']()){if('$graveyard'===_0x43fca2['rootName'])continue;const _0x49c313=_0x10d177[_0x43fca2['rootName']];if(_0x43fca2['rootName']===_0x448203['name']&&_0x49c313?.['description']===_0x448203['description'])return{'editor':_0x4b0647,'rootName':_0x43fca2['rootName']};}}}['_getFirstRoot'](_0x5318ee){for(const _0x3af996 of _0x5318ee['model']['document']['getRoots']())if('$graveyard'!==_0x3af996['rootName'])return{'editor':_0x5318ee,'rootName':_0x3af996['rootName']};}async['_createContextItemFromContent'](_0x138981){if('document'===_0x138981['type']){const _0x221930=await this['_connector']['fetchDocument'](this['_ownerId'],_0x138981['id'])['getDocument']();return{'id':'current-document','uiId':'current-document','label':'Current\x20document','type':_0x138981['type'],'content':_0x221930['content'],'hidden':this['_conversationContextItems']['has']('current-document'),'version':_0x221930['attributes']?.['version'],'sessionId':_0x221930['attributes']?.['sessionId']};}if('mcp-tool-context'===_0x138981['type'])return{'id':_0x138981['id'],'uiId':_0x138981['id'],'label':_0x138981['data']?.['label']||_0x138981['id'],'type':'mcp-tool-context','mcpServerName':_0x138981['mcpServerName'],'toolName':_0x138981['toolName'],'data':_0x138981['data']||{}};return{'id':_0x138981['id'],'uiId':_0x138981['id'],'label':_0x138981['attributes']?.['label']||_0x138981['name']||_0x138981['url']||_0x138981['id'],'type':_0x138981['type'],..._0x138981?.['attributes']?.['resourceId']?{'resourceId':_0x138981['attributes']?.['resourceId']}:{}};}['getSentContextItems'](){return new Map(this['_conversationContextItems']);}['removeFromContext'](_0x47e69b){const _0x1eb419=this['_pendingContextItems']['get'](_0x47e69b);_0x1eb419?.['isReadOnly']||this['_removeContextItem'](_0x47e69b);}['clearPendingContextItems'](){if(0x0===this['_pendingContextItems']['size'])return;for(const _0x4dee0e of this['_pendingContextItems']['values']())this['_removeContextItem'](_0x4dee0e['uiId']);const _0x545b16=this['_conversationContextItems']['get']('current-document')||this['_pendingContextItems']['get']('current-document');_0x545b16&&this['_addContextItem']({..._0x545b16,'isReadOnly':!0x0,'hidden':!0x0});}['addToConversationContext'](_0x11863a){for(const _0x1b0d83 of _0x11863a['values']())this['_addToConversationContextItem'](_0x1b0d83);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'](_0x3cf930){return Array['from'](_0x3cf930['values']())['flatMap'](_0x43c0d8=>this['_mapContextItemToRequestData'](_0x43c0d8));}async['addFilesToContext'](_0x47658f,_0x37cafd,_0x2eeff4='file'){const _0xea5e00='files-'+ot();this['_startUploadOperation'](_0xea5e00);try{await Promise['all'](_0x47658f['map'](async _0x29bbd2=>{const _0x37a525='file-'+ot(),_0x582dcb=_0x3e1bcc(_0x29bbd2['name']);try{this['_addContextItem']({'type':_0x2eeff4,'label':_0x37cafd?.['label']||_0x582dcb,'uiId':_0x37a525,'resourceId':_0x37cafd?.['resourceId']},!0x0);const _0xef0bad=this['_connector']['uploadFile'](this['_ownerId'],_0x29bbd2,_0x37cafd);this['_ongoingUploads']['set'](_0x37a525,_0xef0bad['abortController']);const {id:_0x3921a2}=await _0xef0bad['getId']();this['_ongoingUploads']['delete'](_0x37a525),this['_finishContextItemLoading']({'type':_0x2eeff4,'id':_0x3921a2,'label':_0x37cafd?.['label']||_0x582dcb,'uiId':_0x37a525,'resourceId':_0x37cafd?.['resourceId']},!0x1);}catch(_0x2abbbf){this['_ongoingUploads']['delete'](_0x37a525);if(!(_0x2abbbf instanceof at&&_0x2abbbf['message']['startsWith']('ai-request-aborted'))){const _0x583525=Ps['get'](_0x2abbbf['code'])||'ai-chat-file-upload-failed',_0x166041=new at(_0x583525,null,{'fileName':_0x582dcb,..._0x2abbbf});_0x166041['stack']=_0x2abbbf['stack'],this['fire']('error',{'error':_0x166041});}this['_removeContextItem'](_0x37a525);}}));}finally{this['_finishUploadOperation'](_0xea5e00);}}['addCurrentDocumentToContext'](_0x4c9135){if(this['isCurrentDocumentInContext']()||!this['_addContextOptionsState']['document']['enabled'])return;const _0x2b28e6={'type':'document','uiId':'current-document','label':_0x4c9135,'isReadOnly':this['_conversationContextItems']['has']('current-document'),'hidden':this['_conversationContextItems']['has']('current-document')};this['_addContextItem'](_0x2b28e6);}async['updateCurrentDocument'](_0x51bc1c,_0x96630c,_0x3e3fd0,_0xa35133){const _0x54d7af=this['_pendingContextItems']['get']('current-document');if(_0x54d7af&&_0x51bc1c){_0x54d7af['selection']=_0xa35133?_0xa35133['map'](_0x5d0e16=>({'start':_0x5d0e16['start'],'end':_0x5d0e16['end']})):[];try{if(_0x54d7af['version']===_0x96630c)return;const {id:_0x2f772a}=await this['_connector']['uploadDocument'](this['_ownerId'],_0x51bc1c,{'version':_0x96630c,'sessionId':_0x3e3fd0})['getId']();_0x54d7af['id']=_0x2f772a,_0x54d7af['content']=_0x51bc1c,_0x54d7af['version']=_0x96630c,_0x54d7af['sessionId']=_0x3e3fd0;}catch(_0x3fb683){const _0x2d7ab9=new at('ai-chat-document-upload-failed',null);_0x2d7ab9['stack']=_0x3fb683['stack'],this['fire']('error',{'error':_0x2d7ab9});}}}async['updateDocuments'](_0x211f67){const _0x4aac25=this['_pendingContextItems']['get']('current-document');if(!_0x4aac25||!_0x211f67['length']||_0x211f67['every'](_0x34a27a=>!_0x34a27a['content']))return;_0x211f67['length']>0x1&&_0x211f67['some'](_0x536bd1=>!_0x536bd1['description'])&&It('ai-chat-documents-missing-description');const _0x32b2cf=_0x28502c=>_0x28502c?_0x28502c['map'](_0x5d6831=>({'start':_0x5d6831['start'],'end':_0x5d6831['end']})):[],_0x5782df=_0x4aac25['documents']??[];if(_0x5782df['length']===_0x211f67['length']&&_0x211f67['every']((_0x874476,_0x863fc)=>_0x5782df[_0x863fc]?.['version']===_0x874476['version']))_0x4aac25['documents']=_0x5782df['map']((_0x25bcdc,_0x31b739)=>({..._0x25bcdc,'selection':_0x32b2cf(_0x211f67[_0x31b739]['selections'])}));else try{const _0x423ea6=await this['_connector']['uploadDocuments'](this['_ownerId'],_0x211f67)['getIds']();_0x4aac25['documents']=_0x211f67['map']((_0x4a7af5,_0x3aa250)=>({'id':_0x423ea6[_0x3aa250]?.['id'],'content':_0x4a7af5['content'],'version':_0x4a7af5['version'],'sessionId':_0x4a7af5['sessionId'],'selection':_0x32b2cf(_0x4a7af5['selections'])})),this['_documentSources']['clear'](),this['_dataIdToSource']['clear']();for(let _0x2c38a7=0x0;_0x2c38a7<_0x211f67['length'];_0x2c38a7++){const _0x2ae368=_0x423ea6[_0x2c38a7]?.['id'],_0x33290a=_0x211f67[_0x2c38a7];if(!_0x2ae368)continue;const _0x48967c={'editor':_0x33290a['editor'],'rootName':_0x33290a['rootName'],'content':_0x33290a['content'],'version':_0x33290a['version'],'name':_0x33290a['name'],'description':_0x33290a['description']};this['_documentSources']['set'](_0x2ae368,_0x48967c);const _0x31740c=_s(_0x33290a['content']);for(const _0x304451 of _0x1b06b2(_0x2a1e0c=>!!Es(_0x2a1e0c,'data-id'),_0x31740c)){const _0x3acf38=Es(_0x304451,'data-id');_0x3acf38&&this['_dataIdToSource']['set'](_0x3acf38,{..._0x48967c,'documentId':_0x2ae368});}}_0x4aac25['dataIdDocumentSources']=new Map(this['_dataIdToSource']);}catch(_0x1f19aa){const _0x32f0a7=new at('ai-chat-document-upload-failed',null);_0x32f0a7['stack']=_0x1f19aa['stack'],this['fire']('error',{'error':_0x32f0a7});}}['addSelectionToContext'](_0x4e245f){this['_addContextItem']({'type':'selection','label':_0x4e245f,'uiId':'selection','content':_0x4e245f});}['removeSelectionFromContext'](){this['_removeContextItem']('selection');}async['addUrlToContext'](_0x399447,_0x4f7c58){const _0x597ad5='url-'+ot();this['_startUploadOperation'](_0x597ad5);const _0x4e0ffe='url-'+ot();try{this['_addContextItem']({'type':'web-resource','label':_0x4f7c58?.['label']||_0x399447,'uiId':_0x4e0ffe,'resourceId':_0x4f7c58?.['resourceId']},!0x0);const _0x2411a7=this['_connector']['uploadUrl'](this['_ownerId'],_0x399447,_0x4f7c58);this['_ongoingUploads']['set'](_0x4e0ffe,_0x2411a7['abortController']);const {id:_0x5f402d}=await _0x2411a7['getId']();this['_ongoingUploads']['delete'](_0x4e0ffe),this['_finishContextItemLoading']({'type':'web-resource','id':_0x5f402d,'label':_0x4f7c58?.['label']||_0x399447,'uiId':_0x4e0ffe,'resourceId':_0x4f7c58?.['resourceId']},!0x1);}catch(_0x18748a){this['_ongoingUploads']['delete'](_0x4e0ffe),(_0x18748a['message']['startsWith']('ai-request-aborted')||this['fire']('error',{'error':new at('ai-chat-url-upload-failed',this,{'url':_0x399447,'originalError':_0x18748a}),'url':_0x399447}),this['_removeContextItem'](_0x4e0ffe));}finally{this['_finishUploadOperation'](_0x597ad5);}}['addToolItemToContext'](_0x5ea7b3){_0x5ea7b3['id']=_0x5ea7b3['id']??ot()['substring'](0x0,0x15),this['_pendingContextItems']['set'](_0x5ea7b3['uiId'],_0x5ea7b3),this['fire']('contextItemAdded',{'contextItem':_0x5ea7b3,'isLoading':!0x1});}async['loadSourceResources'](_0x54dda6,_0xc70c77,_0x23b12c){const _0x3edede=this['_addContextOptionsState']['sources']['find'](_0x23c0f4=>_0x23c0f4['id']===_0x54dda6);if(!_0x3edede)return this['fire']('error',{'error':new at('ai-chat-source-not-found',this,{'sourceId':_0x54dda6}),'sourceId':_0x54dda6}),[];try{const _0x100e84=(await _0x3edede['getResources'](_0xc70c77))['map'](_0x22a79e=>{const _0x10aa7a=this['_isResourceInContext'](_0x22a79e['id']);return{..._0x22a79e,'isInContext':_0x10aa7a};});return _0x3edede['resources']=_0x100e84,this['fire']('sourceResourcesLoaded',{'sourceId':_0x54dda6,'source':_0x3edede,'resources':_0x100e84,'uid':_0x23b12c}),_0x100e84;}catch(_0x4fd653){return this['fire']('error',{'error':new at('ai-chat-source-resources-load-failed',this,{'sourceId':_0x54dda6,'originalError':_0x4fd653}),'sourceId':_0x54dda6,'sourceLabel':_0x3edede['label']}),[];}}async['addResourceToContext'](_0x23a125,_0x44a665){if(this['_isResourceInContext'](_0x44a665['id']))return;let _0x116248=_0x44a665['data'];if(!_0x116248&&_0x23a125['getData'])try{_0x116248=await _0x23a125['getData'](_0x44a665['id']);}catch(_0x4e598a){return void this['fire']('error',{'error':new at('ai-chat-resource-load-failed',this,{'resourceId':_0x44a665['id'],'sourceId':_0x23a125['id'],'originalError':_0x4e598a}),'resourceId':_0x44a665['id'],'sourceId':_0x23a125['id']});}if(_0x116248)switch(_0x44a665['type']){case'web-resource':if('string'!=typeof _0x116248)return void this['fire']('error',{'error':new at('ai-chat-context-invalid-data',this,{'resourceId':_0x44a665['id'],'sourceId':_0x23a125['id'],'expectedType':'string','actualType':typeof _0x116248}),'resourceId':_0x44a665['id'],'sourceId':_0x23a125['id']});await this['addUrlToContext'](_0x116248,{'label':_0x44a665['label'],'resourceId':_0x44a665['id']});break;case'file':if(!(_0x116248 instanceof File))return void this['fire']('error',{'error':new at('ai-chat-context-invalid-data',this,{'resourceId':_0x44a665['id'],'sourceId':_0x23a125['id'],'expectedType':'File','actualType':typeof _0x116248}),'resourceId':_0x44a665['id'],'sourceId':_0x23a125['id']});await this['addFilesToContext']([_0x116248],{'label':_0x44a665['label'],'resourceId':_0x44a665['id']});break;case'text':if('object'!=typeof _0x116248||!('content'in _0x116248)||!('type'in _0x116248))return void this['fire']('error',{'error':new at('ai-chat-context-invalid-data',this,{'resourceId':_0x44a665['id'],'sourceId':_0x23a125['id'],'expectedType':'object\x20with\x20content\x20and\x20type\x20properties','actualType':typeof _0x116248}),'resourceId':_0x44a665['id'],'sourceId':_0x23a125['id']});_0x116248=Ms['_convertTextResourceToFile'](_0x116248,_0x44a665['label']),await this['addFilesToContext']([_0x116248],{'label':_0x44a665['label'],'resourceId':_0x44a665['id']},'text');break;case'mcp-tool-context':break;default:this['fire']('error',{'error':new at('ai-chat-context-unsupported-type',this,{'resourceId':_0x44a665['id'],'sourceId':_0x23a125['id'],'resourceType':_0x44a665['type']}),'resourceId':_0x44a665['id'],'sourceId':_0x23a125['id']});}else this['fire']('error',{'error':new at('ai-chat-resource-no-data',this,{'resourceId':_0x44a665['id'],'sourceId':_0x23a125['id']}),'resourceId':_0x44a665['id'],'sourceId':_0x23a125['id']});}static['_convertTextResourceToFile'](_0x86738,_0x50d76e){switch(_0x86738['type']){case'markdown':return new File([_0x86738['content']],_0x50d76e,{'type':'text/markdown'});case'html':return new File([_0x86738['content']],_0x50d76e,{'type':'text/html'});default:return new File([_0x86738['content']],_0x50d76e,{'type':'text/plain'});}}static['_mapContextItemToRequestData'](_0x2e889d){switch(_0x2e889d['type']){case'file':case'text':return[{'type':'file','id':_0x2e889d['id']}];case'web-resource':return[{'type':'web-resource','id':_0x2e889d['id']}];case'document':return _0x2e889d['documents']?.['length']?_0x2e889d['documents']['map'](_0x35feba=>({'type':'document','id':_0x35feba['id'],..._0x35feba['selection']?.['length']&&{'selection':_0x35feba['selection']}})):[{'type':'document','id':_0x2e889d['id'],..._0x2e889d['selection']?.['length']&&{'selection':_0x2e889d['selection']}}];case'mcp-tool-context':{const _0x4bb014=_0x2e889d;return[{'type':'mcp-tool-context','mcpServerName':_0x4bb014['mcpServerName'],'toolName':_0x4bb014['toolName'],'data':{..._0x4bb014['data'],'label':_0x4bb014['label']||_0x4bb014['data']?.['label']||_0x4bb014['id']},'id':_0x4bb014['id']}];}default:return[];}}['_addContextItem'](_0x5444b0,_0x32019a=!0x1){if(this['_pendingContextItems']['set'](_0x5444b0['uiId'],_0x5444b0),_0x5444b0['hidden']||this['fire']('contextItemAdded',{'contextItem':_0x5444b0,'isLoading':_0x32019a}),'current-document'===_0x5444b0['uiId']&&this['_toggleAddCurrentDocumentOptionVisibility'](),_0x5444b0['resourceId']){const _0x5cb315=this['_findSourceIdsByResourceId'](_0x5444b0['resourceId']);_0x5cb315&&_0x5cb315['forEach'](_0x55c6ce=>{this['_updateResourceInContextState'](_0x55c6ce,_0x5444b0['resourceId'],!0x0);});}}['_removeContextItem'](_0x3f12eb){const _0x2afbf9=this['_pendingContextItems']['get'](_0x3f12eb),_0x505954=this['_ongoingUploads']['get'](_0x3f12eb);if(_0x505954&&(_0x505954['abort'](),this['_ongoingUploads']['delete'](_0x3f12eb)),_0x2afbf9?.['resourceId']){const _0xd11750=this['_findSourceIdsByResourceId'](_0x2afbf9['resourceId']);_0xd11750&&_0xd11750['forEach'](_0x1c4328=>{this['_updateResourceInContextState'](_0x1c4328,_0x2afbf9['resourceId'],!0x1);});}this['_pendingContextItems']['delete'](_0x3f12eb),this['fire']('contextItemRemoved',{'uiId':_0x3f12eb,'type':_0x2afbf9?.['type']}),'current-document'===_0x3f12eb&&this['_toggleAddCurrentDocumentOptionVisibility']();}['_finishContextItemLoading'](_0x3120a8,_0xc12abb){if(this['_pendingContextItems']['has'](_0x3120a8['uiId'])&&(this['_pendingContextItems']['set'](_0x3120a8['uiId'],_0x3120a8),this['fire']('contextItemLoadingEnded',{'contextItem':_0x3120a8,'isLoading':_0xc12abb}),_0x3120a8['resourceId'])){const _0x6ae00e=this['_findSourceIdsByResourceId'](_0x3120a8['resourceId']);_0x6ae00e&&_0x6ae00e['forEach'](_0x29c696=>{this['_updateResourceInContextState'](_0x29c696,_0x3120a8['resourceId'],!0x0);});}}['_addToConversationContextItem'](_0x111bd0){this['_conversationContextItems']['set'](_0x111bd0['uiId'],_0x111bd0);}['_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'](_0x1ba890=>({..._0x1ba890,'enabled':!0x0}))??[]},this['fire']('addContextOptionsChanged',{'options':this['_addContextOptionsState']});}['_getCustomSourcesInitialState'](){return this['_config']?.['sources']?.['map'](_0x1ed288=>({..._0x1ed288,'resources':[]}))??[];}['_toggleAddCurrentDocumentOptionVisibility'](){const _0x7006c6=this['isCurrentDocumentInContext']()||this['isCurrentDocumentInConversation']();this['_addContextOptionsState']['document']['isHidden']=_0x7006c6,this['fire']('addContextOptionsChanged',{'options':this['_addContextOptionsState']});}['_isResourceInContext'](_0x111078){for(const _0x2696d0 of this['_pendingContextItems']['values']())if(_0x2696d0['resourceId']===_0x111078)return!0x0;for(const _0x130c58 of this['_conversationContextItems']['values']())if(_0x130c58['resourceId']===_0x111078)return!0x0;return!0x1;}['_findSourceIdsByResourceId'](_0x1db43d){const _0x19d592=[];for(const _0x50e768 of this['_addContextOptionsState']['sources']){_0x50e768['resources']['find'](_0x2ec2f6=>_0x2ec2f6['id']===_0x1db43d)&&_0x19d592['push'](_0x50e768['id']);}return 0x0===_0x19d592['length']?null:_0x19d592;}['_updateResourceInContextState'](_0x31f5ec,_0x3a5245,_0x3db13d){const _0x14dc1e=this['_addContextOptionsState']['sources']['find'](_0x449802=>_0x449802['id']===_0x31f5ec);if(!_0x14dc1e)return;const _0x3a2c22=_0x14dc1e['resources']['find'](_0x3386ae=>_0x3386ae['id']===_0x3a5245);_0x3a2c22&&(_0x3a2c22['isInContext']=_0x3db13d,this['fire']('resourceStateChanged',{'sourceId':_0x31f5ec,'resourceId':_0x3a5245,'isInContext':_0x3db13d}));}['_startUploadOperation'](_0x4ba8ac){this['_ongoingUploadOperations']['set'](_0x4ba8ac,!0x0),this['_ongoingUploadOperations']['size']&&this['fire']('uploadProgressChanged',{'isUploadInProgress':!0x0});}['_finishUploadOperation'](_0x1416b1){this['_ongoingUploadOperations']['delete'](_0x1416b1),0x0===this['_ongoingUploadOperations']['size']&&this['fire']('uploadProgressChanged',{'isUploadInProgress':!0x1});}}const Us=['capabilitiesUpdated'];class Vs extends Tt(){['_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'](_0x259a72){const _0x2b0ec4={};return _0x259a72&&_0x259a72['isWebSearchEnabled']&&(_0x2b0ec4['webSearch']={}),_0x259a72&&_0x259a72['isReasoningEnabled']&&(_0x2b0ec4['reasoning']={}),_0x2b0ec4;}['toggleWebSearch'](){this['setWebSearch'](!this['_isWebSearchEnabled']);}['toggleReasoning'](){this['setReasoning'](!this['_isReasoningEnabled']);}['setWebSearch'](_0x29c91e){_0x29c91e!==this['_isWebSearchEnabled']&&(this['_isWebSearchEnabled']=_0x29c91e,this['fire']('capabilitiesUpdated',this['getCapabilitiesConfig']()));}['setReasoning'](_0x375789){_0x375789!==this['_isReasoningEnabled']&&(this['_isReasoningEnabled']=_0x375789,this['fire']('capabilitiesUpdated',this['getCapabilitiesConfig']()));}}class Bs extends Ds{['userMessage'];['conversationId'];['contextItems']=new Map();['capabilities'];['model'];['attributes'];constructor(_0x22b8bd){super(_0x22b8bd),this['conversationId']=_0x22b8bd['conversationId'],this['contextItems']=_0x22b8bd['contextItems'],this['capabilities']=_0x22b8bd['capabilities'],this['userMessage']=_0x22b8bd['userMessage'],this['model']=_0x22b8bd['model'],this['attributes']=_0x22b8bd['attributes'];}async['sendRequest'](){return this['connector']['queryAssistant']({'message':this['userMessage'],'conversationId':this['conversationId'],'parts':Ms['mapContextItemsToRequestData'](this['contextItems']),'capabilities':Vs['getCapabilitiesRequestData'](this['capabilities']),'model':this['model'],'attributes':this['attributes']});}['getDocumentContext'](){return this['contextItems']['get']('current-document');}['createReply'](_0x27f594){const _0xc9c234=this['getDocumentContext']();if(_0xc9c234?.['documents']?.['length']){const _0x4111f8=_0xc9c234['documents']['map'](_0x2da6b8=>_0x2da6b8['content']??'')['join']('');if(_0x4111f8)return super['createReply']({'documentContextContent':_0x4111f8,..._0x27f594});}return super['createReply'](_0x27f594);}}class Gs extends Tt(){['id'];['isStarted']=!0x1;['isFromHistory'];['interactions']=[];['currentInteraction'];['selectedModel'];['connector'];['options'];constructor(_0x1e23df){super(),this['options']=_0x1e23df,this['connector']=_0x1e23df['connector'],this['chatModels']=_0x1e23df['chatModels'],this['id']=_0x1e23df['conversationId'],this['isFromHistory']=_0x1e23df['isFromHistory'];}async['init'](_0x1d97ac){try{this['chatContext']=new Ms({'connector':this['connector'],'config':_0x1d97ac,'ownerId':this['id']}),this['chatContext']['delegate'](...Hs)['to'](this),this['chatContext']['init'](),this['chatCapabilities']=new Vs(),this['chatCapabilities']['delegate'](...Us)['to'](this),this['chatCapabilities']['init']();const _0x1f84b9=await this['chatModels']['getAvailableModels']();this['fire']('conversationInitialized',{'availableModels':_0x1f84b9});const _0x29a8e6=await this['chatModels']['getModel'](this['options']['selectedModelId']);_0x29a8e6&&await this['setModel'](_0x29a8e6);}catch(_0x400256){const _0x190fdc=new at('ai-chat-conversation-init-failed',null,{'message':_0x400256['message']||_0x400256});_0x190fdc['stack']=_0x400256['stack'],this['fire']('error',{'error':_0x190fdc});}}async['start'](){if(this['isStarted'])throw new at('ai-chat-conversation-already-started',null,{'conversation':this});if(!this['selectedModel'])throw new at('ai-chat-conversation-start-no-model-selected',null,{'conversation':this});try{const {id:_0x255c3a}=await this['connector']['startConversation'](this['id'],this['options']['group'])['getConversation']();this['id']=_0x255c3a,this['isStarted']=!0x0,this['fire']('conversationStarted',{'conversationId':this['id'],'selectedModel':this['selectedModel']});}catch(_0x56cdf0){const _0x23d798=new at('ai-chat-conversation-start-failed',null,{'message':_0x56cdf0['message'],'conversationId':this['id']});throw _0x23d798['stack']=_0x56cdf0['stack'],this['fire']('error',{'error':_0x23d798}),_0x23d798;}}async['load'](_0x2f1525,_0x1d2f12){try{const _0x20b6c6=await this['connector']['fetchConversation'](_0x2f1525)['getConversation'](),_0x3c9d8f=await this['connector']['fetchConversationMessages'](_0x2f1525)['getMessages'](),_0x276f1c=_0x3c9d8f[0x0]['model'];this['isStarted']=!0x0,this['id']=_0x20b6c6['id'],'title'in _0x20b6c6?this['fire']('setConversationTitle',_0x20b6c6['title'],!0x0):this['fire']('setConversationTitle','',!0x0);const _0x5b511c=(await this['chatModels']['getAll']())['find'](_0x1da2e=>_0x1da2e['id']['toLowerCase']()===_0x276f1c['toLowerCase']());return this['selectedModel']=_0x5b511c,this['fire']('modelSelected',{'selectedModel':_0x5b511c,'isDisabled':!0x0}),await this['_processMessagesToInteractions'](_0x3c9d8f,_0x1d2f12,_0x276f1c),this['currentInteraction']=void 0x0,this;}catch(_0x298e24){const _0x5e79c3=new at('ai-chat-conversation-init-from-id-failed',null,{'message':_0x298e24['message'],'conversationId':_0x2f1525});throw _0x5e79c3['stack']=_0x298e24['stack'],this['fire']('error',{'error':_0x5e79c3}),_0x5e79c3;}}async['_processMessagesToInteractions'](_0x4d744f,_0x9f7891,_0x58f133){let _0x4ac6ad,_0x481d41=!0x1;for(const _0x11db16 of _0x4d744f)if('user'===_0x11db16['role']){const {contextItems:_0x5e9ec0,hasUnmatched:_0x190019}=await this['_extractContextItems'](_0x11db16);_0x481d41=_0x190019;const _0x3688e3={'isReasoningEnabled':Object['hasOwn'](_0x11db16['capabilities'],'reasoning'),'isWebSearchEnabled':Object['hasOwn'](_0x11db16['capabilities'],'webSearch')};_0x4ac6ad=this['createInteraction']({'userMessage':_0x11db16['prompt'],'contextItems':_0x5e9ec0,'capabilities':_0x3688e3,'modelId':_0x58f133,'attributes':_0x11db16['attributes']}),this['currentInteraction']=_0x4ac6ad,this['chatContext']['addToConversationContext'](this['currentInteraction']['contextItems']);}else{if('assistant'===_0x11db16['role']&&_0x4ac6ad){const _0x3369d9=[];for(const _0x48dc42 of _0x11db16['content'])switch(_0x48dc42['type']){case'text':case'modification':{const _0x1e3639=_0x4ac6ad['getDocumentContext'](),_0x745ba7=(_0x1e3639?.['documents']?.['length']?_0x1e3639['documents']['some'](_0x392158=>_0x392158['sessionId']!==_0x9f7891):_0x1e3639?.['sessionId']!==_0x9f7891)||_0x481d41;_0x4ac6ad['currentReply']?.['type']!==_0x48dc42['type']&&(_0x4ac6ad['currentReply']=_0x4ac6ad['createReply']({'type':_0x48dc42['type'],'isDone':!0x0,'interactionId':_0x4ac6ad['id'],'areActionsDisabled':_0x745ba7,'isFromHistory':!0x0}),_0x3369d9['length']>0x0&&(_0x4ac6ad['currentReply']['sources']=_0x3369d9['splice'](0x0))),_0x4ac6ad['currentReply']['appendContent'](_0x48dc42['content']);break;}case'url':_0x3369d9['push'](_0x48dc42);break;case'mcp-tool-result':{const {data:_0xe6f19a,attributes:_0xe57aa6}=JSON['parse'](_0x48dc42['content']);_0x4ac6ad['_handleToolResultData']({'toolName':_0x48dc42['toolName'],'data':_0xe6f19a,'attributes':_0xe57aa6});break;}}}}}async['_extractContextItems'](_0x15b3ef){const _0x360a8f=new Map();if(!_0x15b3ef['content'])return{'contextItems':_0x360a8f,'hasUnmatched':!0x1};const _0x2c6e4c=this['_resolveEditors'](),{contextItem:_0x4b0b1c,hasUnmatched:_0x453ba1}=await this['chatContext']['populateDocumentsFromUserMessage'](_0x15b3ef['content'],_0x2c6e4c);_0x4b0b1c&&_0x360a8f['set'](_0x4b0b1c['id'],_0x4b0b1c);for(const _0x1b221b of _0x15b3ef['content']){if('document'===_0x1b221b['type'])continue;const _0x393ae2=await this['chatContext']['populateFromMessage'](_0x1b221b);_0x393ae2&&_0x360a8f['set'](_0x393ae2['id'],_0x393ae2);}return{'contextItems':_0x360a8f,'hasUnmatched':_0x453ba1};}['_resolveEditors'](){return this['options']['getEditors']?this['options']['getEditors']():this['options']['getEditor']?[this['options']['getEditor']()]:[];}async['handleUserInteraction']({userMessage:_0x4671fb,attributes:_0x137e52}){if(!this['isStarted'])throw new at('ai-chat-handle-user-conversation-not-initialized',null,{'conversation':this});if(this['currentInteraction'])throw new at('ai-chat-handle-user-interaction-already-in-progress',null,{'conversation':this});try{const _0x50009a=this['chatContext']['getPendingContextItems'](),_0x396d69=this['chatCapabilities']['getCapabilitiesConfig'](),_0x517678=this['selectedModel']['id'];this['currentInteraction']=this['createInteraction']({'userMessage':_0x4671fb,'contextItems':_0x50009a,'capabilities':_0x396d69,'modelId':_0x517678,'attributes':_0x137e52}),await this['currentInteraction']['start'](),this['chatContext']['addToConversationContext'](this['currentInteraction']['contextItems']);}catch(_0x2d1296){if(_0x2d1296 instanceof at)this['fire']('error',{'interactionId':this['currentInteraction']?this['currentInteraction']['id']:void 0x0,'error':_0x2d1296});else{const _0x4eb716=Ps['get'](_0x2d1296['code'])||'ai-chat-handle-user-interaction-start-failed';this['fire']('error',{'interactionId':this['currentInteraction']?this['currentInteraction']['id']:void 0x0,'error':new at(_0x4eb716,null,{'error':_0x2d1296})});}}finally{this['currentInteraction']?.['stop'](),this['currentInteraction']=void 0x0;}}['createInteraction']({userMessage:_0x2f33f7,contextItems:_0x3a02aa,capabilities:_0x3719b7,modelId:_0x1432f9,attributes:_0x1ff059}){const _0x554bd7=new Bs({'userMessage':_0x2f33f7,'contextItems':_0x3a02aa,'capabilities':_0x3719b7,'conversationId':this['id'],'connector':this['connector'],'locale':this['options']['locale'],'model':_0x1432f9,'attributes':_0x1ff059});return _0x554bd7['delegate'](...Ls)['to'](this),this['interactions']['push'](_0x554bd7),this['fire']('interactionCreated',_0x554bd7),_0x554bd7;}['getInteraction'](_0x5ee740){return this['interactions']['find'](_0x4ec784=>_0x4ec784['id']===_0x5ee740);}['removeInteraction'](_0x2daf74){const _0x1dc173=this['getInteraction'](_0x2daf74);_0x1dc173&&(_0x1dc173['destroy'](),this['interactions']['splice'](this['interactions']['indexOf'](_0x1dc173),0x1));}get['lastInteraction'](){return this['interactions'][this['interactions']['length']-0x1];}['addCurrentDocumentToContext'](_0x33f06e){this['chatContext']['addCurrentDocumentToContext'](_0x33f06e);}async['updateCurrentDocumentInContext']({content:_0x311dfe,version:_0x32e5ee,sessionId:_0x445332,selections:_0x2d407d}){await this['chatContext']['updateCurrentDocument'](_0x311dfe,_0x32e5ee,_0x445332,_0x2d407d);}async['updateDocumentsInContext'](_0xb7400d){await this['chatContext']['updateDocuments'](_0xb7400d);}['getSourceByDataId'](_0x1e6309){return this['chatContext']['getSourceByDataId'](_0x1e6309);}['getDocumentContextSliceByDataId'](_0x22b519){return this['chatContext']['getDocumentContextSliceByDataId'](_0x22b519);}['getCurrentDocumentContext'](){return this['currentInteraction']?.['getDocumentContext']()?.['content']||'';}['addSelectionToContext'](_0xf6b837){this['chatContext']['addSelectionToContext'](_0xf6b837);}['removeSelectionFromContext'](){this['chatContext']['removeSelectionFromContext']();}['addFilesToContext'](_0x3d1d69){this['chatContext']['addFilesToContext'](_0x3d1d69);}['addUrlToContext'](_0x43f22a){this['chatContext']['addUrlToContext'](_0x43f22a);}['addToolItemToContext'](_0x467b04){this['chatContext']['addToolItemToContext'](_0x467b04);}['addResourceToContext'](_0xb988d,_0xc88e2f){this['chatContext']['addResourceToContext'](_0xb988d,_0xc88e2f);}['loadSourceResources'](_0x19734b,_0x543866,_0x40a6e4){return this['chatContext']['loadSourceResources'](_0x19734b,_0x543866,_0x40a6e4);}['removeFromContext'](_0x5462c8){this['chatContext']['removeFromContext'](_0x5462c8);}['setWebSearch'](_0x1d3bc4){this['chatCapabilities']['setWebSearch'](_0x1d3bc4);}['toggleWebSearch'](){this['chatCapabilities']['toggleWebSearch']();}['setReasoning'](_0x35572a){this['chatCapabilities']['setReasoning'](_0x35572a);}['toggleReasoning'](){this['chatCapabilities']['toggleReasoning']();}['isCurrentDocumentInContext'](){return this['chatContext']['isCurrentDocumentInContext']();}['isCurrentDocumentInConversation'](){return this['chatContext']['isCurrentDocumentInConversation']();}['isSelectionInContext'](){return this['chatContext']['isSelectionInContext']();}async['setModel'](_0x4b0de5){_0x4b0de5?!0x1===await this['chatModels']['isAvailable'](_0x4b0de5)&&(It('ai-chat-conversation-set-model-not-available',{'conversation':this,'model':_0x4b0de5}),_0x4b0de5=(await this['chatModels']['getAvailableModels']())[0x0]):(It('ai-chat-conversation-set-model-null',{'conversation':this}),_0x4b0de5=(await this['chatModels']['getAvailableModels']())[0x0]),_0x4b0de5['id']!==this['selectedModel']?.['id']&&(this['selectedModel']=_0x4b0de5,this['chatCapabilities']['reset'](),this['fire']('modelSelected',{'selectedModel':_0x4b0de5}));}}class Fs extends Tt(){['_connector'];['_config'];['_locale'];['_modelList']=[];['_modelsRequest']=null;constructor({connector:_0x179445,config:_0x670069,locale:_0x5c593f}){super(),this['_connector']=_0x179445,this['_config']=_0x670069,this['_locale']=_0x5c593f;}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 _0x3224e7=await this['getAll']();let _0xc5c1a8;return _0xc5c1a8=this['_availableModels']?this['_filterModels'](_0x3224e7,this['_availableModels']):_0x3224e7['filter'](_0x2f340e=>_0x2f340e['recommended']),_0xc5c1a8;}async['getModel'](_0xc55a10){const _0x106929=await this['getAll']();if(!_0x106929['length'])return null;if(_0xc55a10){const _0x338594=this['_getModelById'](_0x106929,_0xc55a10);if(_0x338594)return _0x338594;It('ai-chat-model-id-unrecognized',{'modelId':_0xc55a10,'fallBackModelId':this['_defaultModelId']});}return this['getDefault']();}async['getDefault'](){const _0x3a8033=await this['getAvailableModels']();if(!_0x3a8033['length'])return null;if(this['_defaultModelId']){const _0x446c22=this['_getModelById'](_0x3a8033,this['_defaultModelId']);if(_0x446c22)return _0x446c22;It('ai-chat-default-model-id-unrecognized',{'defaultModelId':this['_defaultModelId'],'fallBackModelId':_0x3a8033[0x0]['id']});}return _0x3a8033[0x0];}async['isAvailable'](_0x303eb5){return(await this['getAvailableModels']())['some'](_0x2031b8=>_0x2031b8['name']===_0x303eb5['name']&&_0x2031b8['provider']===_0x303eb5['provider']);}async['_retrieveModels'](){if(!this['_modelList']['length'])try{const _0x4a3d9a=this['_locale']['uiLanguage']||'en',_0x9cbcfd=this['_connector']['getModels'](_0x4a3d9a),_0x359536=await _0x9cbcfd['list']();this['_modelList']=_0x359536['items']['map'](_0x4a5d78=>Ks(_0x4a5d78)?{..._0x4a5d78,'name':hs(this['_locale'],'AI_MODEL_NAME_AUTO')}:_0x4a5d78);}catch(_0x554b5f){throw Et('ai-models-unable-to-retrieve',{'error':_0x554b5f}),_0x554b5f;}return[...this['_modelList']];}['_filterModels'](_0x193e74,_0xfb38d4){let _0x4c49a7;if(_0xfb38d4){_0x4c49a7=[];const _0x54b0c0=new Set(),_0x47475d='string'==typeof _0xfb38d4?[_0xfb38d4['toLocaleLowerCase']()]:_0xfb38d4['map'](_0x25dc9c=>_0x25dc9c['toLocaleLowerCase']());for(const _0x4318a2 of _0x47475d)for(const _0x5b8167 of _0x193e74)!_0x54b0c0['has'](_0x5b8167['id'])&&this['_isMatchingFilter'](_0x5b8167,_0x4318a2)&&(_0x4c49a7['push'](_0x5b8167),_0x54b0c0['add'](_0x5b8167['id']));}else _0x4c49a7=_0x193e74;return _0x4c49a7;}['_isMatchingFilter'](_0x276a7a,_0xbead4e){const _0x574f72=_0x276a7a['id']['toLocaleLowerCase'](),_0x2bb15a=_0x276a7a['name']['toLocaleLowerCase'](),_0x8cf719=_0x276a7a['provider']['toLocaleLowerCase']();return _0x574f72===_0xbead4e||_0x2bb15a===_0xbead4e||Ks(_0x276a7a)&&'auto'===_0xbead4e||_0x8cf719===_0xbead4e||_0x574f72['startsWith'](_0xbead4e);}['_getModelById'](_0x3a59d3,_0x2b74bf){return _0x3a59d3['find'](_0x56aba8=>Ks(_0x56aba8)&&'auto'===_0x2b74bf?_0x56aba8:_0x56aba8['id']===_0x2b74bf)||null;}}function Ks(_0x57b629){return _0x57b629['id']['startsWith']('agent');}function Ws(_0x2351a4){return _0x2351a4?_0x2351a4 instanceof _0x17198a?[_0x2351a4]:_0x2351a4['editors']&&0x0!==_0x2351a4['editors']['length']?Array['from'](_0x2351a4['editors']):[]:[];}function Ys(_0x511826){const _0x905671=Ws(_0x511826);if(!_0x905671['length'])throw new at('ai-get-editor-from-context-no-editor');if(0x1===_0x905671['length'])return _0x905671[0x0];const _0x15c064=_0x905671['find'](_0x5d88cb=>_0x5d88cb['ui']?.['focusTracker']?.['isFocused']);if(_0x15c064)return _0x15c064;const _0x24cb05=function(_0x586ae6){if(_0x586ae6 instanceof _0x17198a)return;const _0x46fa66=_0x586ae6;if(!_0x46fa66['plugins']||!_0x46fa66['plugins']['has']('AIEditing'))return;const _0x596eb8=_0x46fa66['plugins']['get']('AIEditing');return _0x596eb8['getLastContentFocusedEditor']?.();}(_0x511826);return _0x24cb05&&_0x905671['includes'](_0x24cb05)?_0x24cb05:_0x905671[0x0];}function $s(_0xd82cab){return Ys(_0xd82cab);}function qs({editor:_0x4e69d0,interaction:_0x2fe880,reply:_0x354aac,groups:_0x470c5f,transform:_0x3f8d36,documentCompare:_0xd4a705,documentCompareOptions:_0x4d0e13,documentContextSlice:_0x1f4598}){const _0x15a40a=_0x2fe880['getDocumentContext']();if(!_0x15a40a)return[];const _0x17f2a0=_0x354aac['documentContextContent']['cloneNode'](!0x0);for(const {changes:_0x4ec4d7}of _0x470c5f){const _0x415378=_0x4ec4d7['filter'](_0x49a505=>'new'!=_0x49a505['type'])['map'](_0x1285dd=>As('data-id',_0x1285dd['id'],_0x17f2a0)),_0xc6a057=_0x4ec4d7['filter'](_0x2951bf=>'removed'!=_0x2951bf['type'])['map'](_0x3a558a=>_0x3a558a['node']['cloneNode'](!0x0));let _0x46e2de=null;if(_0x415378['length']){_0x46e2de=_0x415378[0x0]['previousSibling'];for(let _0x204e7b=0x0;_0x204e7b<_0x415378['length'];_0x204e7b++)_0x38c273(_0x415378[_0x204e7b]);}if(_0xc6a057['length']){_0x46e2de||(_0x4ec4d7[0x0]['anchorId']?_0x46e2de=As('data-id',_0x4ec4d7[0x0]['anchorId'],_0x17f2a0):(_0x46e2de=_0xc6a057['shift'](),_0x113ebe(_0x17f2a0,_0x46e2de)));for(let _0x10d819=0x0;_0x10d819<_0xc6a057['length'];_0x10d819++)_0x452435(_0x46e2de,_0xc6a057[_0x10d819]),_0x46e2de=_0xc6a057[_0x10d819];}}let _0xc7d79f,_0x4e1a78,_0x28aa25,_0x310438=_0x4d0e13;if(_0x1f4598){_0xc7d79f=_0x1f4598['html'],_0x28aa25=_0x1f4598['version'],_0x310438={..._0x4d0e13,'anchor':_0x1f4598['rootName']};const _0x2edfac=new _0x837b91([]),_0x3dbe39=_0x17f2a0['children'],_0x551bfd=_0x354aac['dataIdDocumentSources'],_0x262f8b=_0x354aac['newNodeAnchorIds'],_0x4e3db2=_0x1f4598['editor'],_0x5bfeb3=_0x1f4598['rootName'],_0x3c7e52=new Array(_0x3dbe39['length']),_0x245ea6=_0xe5b576=>_0xe5b576?_0xe5b576['editor']===_0x4e3db2&&_0xe5b576['rootName']===_0x5bfeb3:void 0x0;for(let _0x3cab32=0x0;_0x3cab32<_0x3dbe39['length'];_0x3cab32++){const _0x575af1=Es(_0x3dbe39[_0x3cab32],'data-id');if(!_0x575af1)continue;const _0x3b2ecd=_0x245ea6(_0x551bfd?.['get'](_0x575af1));if(void 0x0!==_0x3b2ecd){_0x3c7e52[_0x3cab32]=_0x3b2ecd;continue;}const _0x3bd510=_0x262f8b['get'](_0x575af1),_0x16ee85=_0x3bd510?_0x245ea6(_0x551bfd?.['get'](_0x3bd510)):void 0x0;void 0x0!==_0x16ee85&&(_0x3c7e52[_0x3cab32]=_0x16ee85);}for(let _0x2704a4=0x0;_0x2704a4<_0x3dbe39['length'];_0x2704a4++)if(void 0x0===_0x3c7e52[_0x2704a4]){for(let _0x3ba2cb=_0x2704a4-0x1;_0x3ba2cb>=0x0;_0x3ba2cb--)if(void 0x0!==_0x3c7e52[_0x3ba2cb]){_0x3c7e52[_0x2704a4]=_0x3c7e52[_0x3ba2cb];break;}if(void 0x0===_0x3c7e52[_0x2704a4]){for(let _0x5ddfbd=_0x2704a4+0x1;_0x5ddfbd<_0x3dbe39['length'];_0x5ddfbd++)if(void 0x0!==_0x3c7e52[_0x5ddfbd]){_0x3c7e52[_0x2704a4]=_0x3c7e52[_0x5ddfbd];break;}}}for(let _0x3c3f22=0x0;_0x3c3f22<_0x3dbe39['length'];_0x3c3f22++)_0x3c7e52[_0x3c3f22]&&_0x2edfac['children']['push'](_0x583d74(_0x3dbe39[_0x3c3f22],!0x0));_0x4e1a78=gs(_0x2edfac);}else _0xc7d79f=_0x15a40a['content'],_0x28aa25=_0x15a40a['version'],_0x4e1a78=gs(_0x17f2a0);const _0x313446=_0xd4a705['getDiff'](_0xc7d79f,_0x4e1a78,{..._0x310438,'targetEditor':_0x4e69d0})['getOperations']();if(_0x3f8d36){const _0x51e581=_0x4e69d0['model']['document']['history']['getOperations'](_0x28aa25),_0x4d9c14={'document':_0x4e69d0['model']['document'],'useRelations':!0x1,'padWithNoOps':!0x1};return _0x1b61b0(_0x313446,_0x51e581,_0x4d9c14)['operationsA'];}return _0x313446;}function Qs(_0x501329,_0x12363f){if('marker'!=_0x12363f['type'])return;const _0x2da27a=_0x501329['model']['markers']['get'](_0x12363f['name']);_0x2da27a&&(_0x12363f['oldRange']=_0x2da27a['getRange']());}class Xs extends _0x203d97{['activeConversation'];['_aiEditing'];['_aiConnector'];['_aiChatUi'];['_aiChatModels'];['_aiChatBalloon'];['_activeBalloon'];['_wiredBalloons']=new Set();['_batchToChanges']=new Map();['_currentPreviewedChangeGroup']=null;['_bodyCollection'];static get['requires'](){return[as,_0x58b094];}static get['pluginName'](){return'AIChatController';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){this['_bodyCollection']=new Qt(this['context']['locale']),this['_bodyCollection']['attachToDom'](),this['_aiConnector']=this['context']['plugins']['get']('AIConnector'),this['_aiChatUi']=this['context']['plugins']['get']('AIChatUI'),this['_aiEditing']=this['context']['plugins']['get']('AIEditing'),this['_aiChatModels']=new Fs({'connector':this['_aiConnector'],'config':this['context']['config']['get']('ai.models'),'locale':this['context']['locale']});const _0x47673e=this['context']['plugins']['get']('AITabs');this['listenTo'](this['_aiChatUi'],'startConversation',()=>{this['_startConversationSafely']();}),this['listenTo'](this['_aiChatUi'],'sendUserMessage',(_0x387c70,_0x38a298)=>{this['_handleUIUserMessage']({'message':_0x38a298});}),this['listenTo'](_0x47673e['view'],'change:activeTab',(_0x15f23e,_0xe8c3f6,_0x5c492f)=>{'chat'!==_0x5c492f&&this['removeSelectionFromChatContext']();}),this['listenTo'](this['_aiChatUi'],'abortPromptStream',async()=>{await this['_stopLastInteraction'](),await this['_flushLastInteractionUI'](),this['removeSelectionFromChatContext']();}),this['listenTo'](this['_aiChatUi'],'addDocumentToContext',()=>{this['addCurrentDocumentToChatContext']();}),this['listenTo'](this['_aiChatUi'],'addFileToContext',(_0x13d3fe,_0x49b14d)=>{this['activeConversation']?.['addFilesToContext'](Array['from'](_0x49b14d));}),this['listenTo'](this['_aiChatUi'],'addUrlToContext',(_0x213bf4,_0x174280)=>{this['activeConversation']?.['addUrlToContext'](_0x174280);}),this['listenTo'](this['_aiChatUi'],'executeCustomItemCallback',(_0x48485c,_0x41f2bc)=>{_0x41f2bc['callback'](this['context']);}),this['listenTo'](this['_aiChatUi'],'addResourceToContext',(_0x3c1549,_0x4eef7f)=>{this['activeConversation']?.['addResourceToContext'](_0x4eef7f['source'],_0x4eef7f['resource']);}),this['listenTo'](this['_aiChatUi'],'removeContextItem',(_0x56ea3c,_0x27f927)=>{this['_removeFromContext'](_0x27f927);}),this['listenTo'](this['_aiChatUi'],'loadSourceResources',(_0x5daf25,_0x1d5d7a)=>{this['activeConversation']?.['loadSourceResources'](_0x1d5d7a['sourceId'],_0x1d5d7a['query'],_0x1d5d7a['uid']);}),this['listenTo'](this['_aiChatUi'],'toggleWebSearch',()=>{this['_toggleWebSearch']();}),this['listenTo'](this['_aiChatUi'],'toggleReasoning',()=>{this['_toggleReasoning']();}),this['listenTo'](this['_aiChatUi'],'selectModel',(_0x6b8741,_0x58f144)=>{this['activeConversation']?.['setModel'](_0x58f144);}),this['listenTo'](this['_aiChatUi'],'like',(_0x4cf91d,{replyId:_0x330937})=>{console['log']('Liked\x20response',_0x330937);}),this['listenTo'](this['_aiChatUi'],'dislike',(_0x58b91b,{replyId:_0x17620c})=>{console['log']('Disliked\x20response',_0x17620c);}),this['listenTo'](this['_aiChatUi'],'insertSuggestion',(_0x2ecfdf,_0x4bad15)=>{this['_insertSuggestion'](_0x4bad15);}),this['listenTo'](this['_aiChatUi'],'showChangeInText',(_0x55cf3a,{replyId:_0x13aadf,partIndex:_0x81d2a4})=>{this['_aiChatBalloonShowDiff']=this['_aiChatUi']['showDiff'],this['_openBalloonFor'](_0x13aadf,_0x81d2a4);}),this['listenTo'](this['_aiChatUi'],'mouseOverSuggestion',(_0x2bad06,{replyId:_0x5260f9,partIndex:_0x3514ec})=>{const _0x2c66aa=this['_getDocumentRangeForReplyChanges'](_0x5260f9,_0x3514ec);_0x2c66aa&&'$graveyard'!=_0x2c66aa['range']['root']['rootName']&&this['_aiEditing']['showFakeVisualSelection']({'ranges':[_0x2c66aa['range']],'id':'change-area','priority':0xa});}),this['listenTo'](this['_aiChatUi'],'mouseLeaveSuggestion',()=>{this['_aiEditing']['hideFakeVisualSelection']('change-area');}),this['listenTo'](this['_aiChatUi'],'applySuggestion',(_0x28f0ca,_0x160b64)=>{this['_aiEditing']['hideFakeVisualSelection']('change-area'),this['_applySuggestion'](_0x160b64);}),this['listenTo'](this['_aiChatUi'],'toggleSuggestionDisplayMode',async(_0x5973e4,{replyId:_0x96598d,showDiff:_0xf96c7c})=>{const {reply:_0x16819d}=this['getInteractionAndReplyById'](_0x96598d),_0x30288e=_0x16819d['getContentParts']({'showDiff':_0xf96c7c,'editor':$s(this['context'])});await this['_aiChatUi']['updateFeedItemAIReplySuggestionContent']({'id':_0x16819d['id'],'parts':_0x30288e});}),this['listenTo'](this['_aiChatUi'],'rejectSuggestion',(_0x15fe9a,{replyId:_0x23d75c,partIndex:_0x4bd8ac})=>{this['_rejectSuggestion']({'replyId':_0x23d75c,'partIndex':_0x4bd8ac}),this['_aiEditing']['hideFakeVisualSelection']('change-area');}),this['set']('_aiChatBalloonShowDiff',!0x1),this['context']['plugins']['has']('AIChatBalloon')&&(this['_aiChatBalloon']=this['context']['plugins']['get']('AIChatBalloon')),this['on']('interactionCreated',(_0x357c04,_0x2c62c6)=>{this['_aiChatUi']['addFeedItemUserMessage'](_0x2c62c6);}),this['on']('replyCreated',(_0x3ac2d7,_0x84fe5c)=>{this['_addFeedItemReply'](_0x84fe5c);});}async['afterInit'](){this['context']instanceof _0x17198a?this['_integrateEditor'](this['context']):this['listenTo'](this['context']['editors'],'add',(_0x178969,_0x956b58)=>{_0x956b58['on']('ready',()=>{this['_integrateEditor'](_0x956b58);});});const _0xb01fc=this['context']['config']['get']('ai.chat.initialConversation');let _0x2e0f56=_0xb01fc;if('lastCreated'!=_0xb01fc||(_0x2e0f56=await this['_getLastCreatedConversationId'](),_0x2e0f56))return'new'==_0x2e0f56?this['_startConversationSafely']():this['loadConversation'](_0x2e0f56);}async['destroy'](){return await this['_stopLastInteraction'](),this['_bodyCollection']['detachFromDom'](),super['destroy']();}async['loadConversation'](_0x2ef329){this['_activeBalloon']?.['close'](),this['_activeBalloon']=void 0x0,this['_currentPreviewedChangeGroup']=null,(this['context']['plugins']['get'](os)['view']['activateTab']('chat'),this['_aiChatUi']['setFeedItemRenderingStrategy']('static'),this['_aiChatUi']['toggleLoadingSkeleton'](!0x0),await this['_stopLastInteraction']());try{await this['_aiConnector']['fetchConversation'](_0x2ef329)['getConversation'](),await this['_startConversationSafely']({'id':_0x2ef329}),this['_updateConversationTitle']('\x20'),await this['activeConversation']['load'](_0x2ef329,this['_aiEditing']['sessionId']),this['activeConversation']['isCurrentDocumentInConversation']()&&this['addCurrentDocumentToChatContext']();}catch(_0x557f08){this['_aiChatUi']['addFeedItemError']({'errorMessage':hs(this['context']['locale'],'AI_CHAT_UNABLE_TO_LOAD_CONVERSATION'),'id':_0x2ef329}),this['_logError'](new at('ai-chat-conversation-not-found',this,{'error':_0x557f08}));}finally{this['_aiChatUi']['startAutoScroll']({'smooth':!0x1}),this['_aiChatUi']['setFeedItemRenderingStrategy']('streaming'),this['_aiChatUi']['toggleLoadingSkeleton'](!0x1);}}['registerToolDataCallback'](_0x211181){let _0x1a2ed8=null,_0x4b5555=null;this['on']('toolDataReceived',(_0x51c458,_0x2307e4,_0xafa18)=>{_0xafa18['id']!==_0x1a2ed8&&(_0x1a2ed8=_0xafa18['id'],_0x4b5555=this['_getAIChatFeedAPI'](_0xafa18)),_0x211181(_0x2307e4,_0x4b5555);});}['addCurrentDocumentToChatContext'](){this['activeConversation']?.['addCurrentDocumentToContext'](hs(this['context']['locale'],'AI_CHAT_CONTEXT_CURRENT_DOCUMENT'));}async['addSelectionToChatContext'](){const _0x52ae2e=this['_aiEditing']['getSelectionText']();this['activeConversation']?.['addSelectionToContext'](_0x52ae2e),this['addCurrentDocumentToChatContext']();}['removeSelectionFromChatContext'](){this['activeConversation']?.['removeSelectionFromContext']();}['focusPromptInput'](){this['_aiChatUi']['focusPromptInput']();}async['startConversation'](_0x168490){await this['_startConversationSafely']({'modelId':_0x168490?.['modelId']});}async['sendMessage'](_0x2a772f){await this['_handleUIUserMessage'](_0x2a772f);}['getGroupId'](){const _0x3bbd51=this['context']['config']['get']('collaboration.channelId');if(!_0x3bbd51)throw new at('ai-chat-missing-channel-id',this);return _0x3bbd51;}['_handleRemovedConversation'](_0x3fdc00){this['activeConversation']['id']===_0x3fdc00&&this['_startConversationSafely']();}['_insertSuggestion'](_0x5d4a8a){const _0x6581d3=this['context']['plugins']['get']('DocumentCompare'),{reply:_0x6f8f16,interaction:_0x3dc785}=this['getInteractionAndReplyById'](_0x5d4a8a['replyId']),_0x4de87f=void 0x0!==_0x5d4a8a['partIndex']?[_0x6f8f16['changeGroups'][_0x5d4a8a['partIndex']]]:_0x6f8f16['changeGroups']['filter'](_0x1d0304=>'pending'==_0x1d0304['state']);for(const _0x48bc74 of this['_groupChangesByTarget'](_0x6f8f16,_0x4de87f)){const {target:_0x5ba437,groups:_0x52ad4c,groupsIndexes:_0x3ce2aa,slice:_0x5cf860}=_0x48bc74;if(!_0x5ba437['editor']['plugins']['has']('TrackChanges'))throw new at('ai-no-track-changes',null);const _0x47e99e=this['_getDocumentRangeForReplyChanges'](_0x5d4a8a['replyId'],_0x3ce2aa[0x0]);if(!_0x47e99e||'$graveyard'==_0x47e99e['range']['root']['rootName']){_0x3ce2aa['forEach'](_0x1e2170=>_0x6f8f16['setChangeGroupState'](_0x1e2170,'outdated'));continue;}_0x3ce2aa['forEach'](_0x59818e=>_0x6f8f16['setChangeGroupState'](_0x59818e,'accepted'));const _0x488958=qs({'editor':_0x5ba437['editor'],'reply':_0x6f8f16,'interaction':_0x3dc785,'groups':_0x52ad4c,'transform':!0x0,'documentCompare':_0x6581d3,'documentCompareOptions':{'anchor':_0x5cf860?.['rootName']??'main','markDeletions':!0x0},'documentContextSlice':_0x5cf860});let _0x37ce4d;this['_scrollToSuggestionRange'](_0x47e99e['range'],!0x1,_0x5ba437['editor']),_0x5ba437['editor']['model']['change'](_0x6b8ce4=>{_0x37ce4d=_0x6b8ce4['batch'],_0x5ba437['editor']['plugins']['get']('TrackChangesEditing')['_applyOperationsAsSuggestions'](_0x488958),this['_aiEditing']['hideFakeVisualSelection']('change-area');}),this['_batchToChanges']['set'](_0x37ce4d,{'interactionId':_0x3dc785['id'],'replyId':_0x6f8f16['id'],'indexes':_0x3ce2aa['slice']()});}this['_updateRatings'](_0x6f8f16);}['_applySuggestion'](_0x31884c){const _0x5d7aca=this['context']['plugins']['get'](_0x58b094),{reply:_0xc306c7,interaction:_0x59dfd3}=this['getInteractionAndReplyById'](_0x31884c['replyId']),_0x3eb0f4=void 0x0!==_0x31884c['partIndex']?[_0xc306c7['changeGroups'][_0x31884c['partIndex']]]:_0xc306c7['changeGroups']['filter'](_0x32a724=>'pending'==_0x32a724['state']);for(const _0x5e0a14 of this['_groupChangesByTarget'](_0xc306c7,_0x3eb0f4)){const {target:_0x466775,groups:_0x163518,groupsIndexes:_0x4bf28d,slice:_0x5313c0}=_0x5e0a14,_0x15e642=this['_getDocumentRangeForReplyChanges'](_0x31884c['replyId'],_0x4bf28d[0x0]);if(!_0x15e642||'$graveyard'==_0x15e642['range']['root']['rootName']){_0x4bf28d['forEach'](_0x3edf1c=>_0xc306c7['setChangeGroupState'](_0x3edf1c,'outdated'));continue;}_0x4bf28d['forEach'](_0x64474=>_0xc306c7['setChangeGroupState'](_0x64474,'accepted'));const _0x1688a8=qs({'editor':_0x466775['editor'],'reply':_0xc306c7,'interaction':_0x59dfd3,'groups':_0x163518,'transform':!0x0,'documentCompare':_0x5d7aca,'documentCompareOptions':{'anchor':_0x5313c0?.['rootName']??'main','markDeletions':!0x1},'documentContextSlice':_0x5313c0});let _0x116778;this['_scrollToSuggestionRange'](_0x15e642['range'],!0x1,_0x466775['editor']),_0x466775['editor']['model']['change'](_0x27c18d=>{_0x116778=_0x27c18d['batch'];for(const _0x3830ff of _0x1688a8)_0x3830ff['baseVersion']=_0x466775['editor']['model']['document']['version'],Qs(_0x466775['editor'],_0x3830ff),_0x27c18d['batch']['addOperation'](_0x3830ff),_0x466775['editor']['model']['applyOperation'](_0x3830ff);}),this['_batchToChanges']['set'](_0x116778,{'interactionId':_0x59dfd3['id'],'replyId':_0xc306c7['id'],'indexes':_0x4bf28d['slice']()});}this['_updateRatings'](_0xc306c7);}['_rejectSuggestion'](_0x5fedf6){const {reply:_0x2f5511}=this['getInteractionAndReplyById'](_0x5fedf6['replyId']);_0x2f5511['setChangeGroupState'](_0x5fedf6['partIndex'],'rejected');}['_openBalloonFor'](_0x57f39a,_0x3a8bf1){if(!this['_aiChatBalloon'])return;const {reply:_0x3a1d21}=this['getInteractionAndReplyById'](_0x57f39a),_0x4b09e9=_0x3a1d21['getContentParts']({'showDiff':this['_aiChatBalloonShowDiff'],'editor':$s(this['context'])});let _0x37527d,_0x55c648;if(void 0x0!==_0x3a8bf1?(_0x55c648=_0x4b09e9['find'](_0x4a784a=>_0x4a784a['index']==_0x3a8bf1),_0x37527d=_0x55c648?.['index']):(_0x55c648=_0x4b09e9[0x0],_0x37527d=_0x55c648['index']),this['_currentPreviewedChangeGroup']?.['replyId']==_0x57f39a&&this['_currentPreviewedChangeGroup']?.['partIndex']==_0x37527d)return;const _0x1c2b24=this['_getUserPresentableContentPartDocumentRange'](_0x57f39a,_0x3a1d21,_0x55c648),_0x2780db=_0x3a1d21['changeGroups']['find'](_0xd81e19=>_0xd81e19['index']==_0x37527d),_0x4a8da2=_0x2780db?this['_resolveGroupTarget'](_0x3a1d21,_0x2780db):null,_0x933112=_0x4a8da2?.['editor']??$s(this['context']),_0x1cedfe=_0x933112['plugins']['has']('AIChatBalloon')?_0x933112['plugins']['get']('AIChatBalloon'):this['_aiChatBalloon'];if(this['_activeBalloon']&&this['_activeBalloon']!==_0x1cedfe&&this['_activeBalloon']['close'](),!_0x1c2b24)return _0x1cedfe['close'](),void(this['_activeBalloon']=void 0x0);this['_activeBalloon']=_0x1cedfe,this['_currentPreviewedChangeGroup']={'replyId':_0x57f39a,'partIndex':_0x37527d},this['_scrollToSuggestionRange'](_0x1c2b24,!0x0,_0x933112);const _0x377c44=this['_getPresentableSiblingContentPartIndex'](_0x57f39a,_0x37527d,'next');_0x1cedfe['updateContent']({'part':_0x55c648,'renderingStrategy':'static'}),_0x1cedfe['open']({'index':_0x37527d,'title':hs(this['context']['locale'],'AI_BALLOON_HEADER_TITLE',(_0x37527d+0x1)['toString']()),'showRotator':null!==_0x377c44,'ranges':[_0x1c2b24],'areActionsDisabled':_0x3a1d21['areActionsDisabled'],'targetEditor':_0x933112}),_0x1cedfe['setState']('pending'),this['_aiChatUi']['scrollFeedToSuggestion'](_0x57f39a,_0x37527d),this['_aiChatUi']['setFeedItemAIReplySuggestionPartActive']({'id':_0x57f39a,'index':_0x37527d,'isActive':!0x0});}['_getPresentableSiblingContentPartIndex'](_0x3d6623,_0x5e6828,_0x408be9){const {reply:_0x40cede}=this['getInteractionAndReplyById'](_0x3d6623),_0x5631d8=_0x40cede['getContentParts']({'showDiff':this['_aiChatBalloonShowDiff'],'editor':$s(this['context'])});if(0x1==_0x5631d8['length'])return null;const _0x1096f8=_0x5631d8['findIndex'](_0x393c51=>_0x393c51['index']==_0x5e6828),_0x3b4d3e='next'==_0x408be9?0x1:-0x1;let _0x17da33=_0x5631d8['at']((_0x1096f8+_0x3b4d3e)%_0x5631d8['length'])['index'],_0x4f85d9=_0x5631d8[_0x17da33];for(;!this['_getUserPresentableContentPartDocumentRange'](_0x3d6623,_0x40cede,_0x4f85d9);){if(_0x17da33=_0x5631d8['at']((_0x17da33+_0x3b4d3e)%_0x5631d8['length'])['index'],_0x17da33===_0x1096f8)return null;_0x4f85d9=_0x5631d8[_0x17da33];}return _0x17da33;}['_getUserPresentableContentPartDocumentRange'](_0x54fd47,_0x10f1c5,_0x4c2c2c){const _0x1eebd8=_0x10f1c5['changeGroups'];if(!_0x4c2c2c['hasChanges'])return null;const _0x39ab5f=_0x1eebd8['find'](_0x551ce3=>_0x551ce3['index']==_0x4c2c2c['index']);if('pending'!==_0x39ab5f?.['state'])return null;const _0x20e303=this['_getDocumentRangeForReplyChanges'](_0x54fd47,_0x4c2c2c['index']);if(!_0x20e303)return _0x10f1c5['setChangeGroupState'](_0x4c2c2c['index'],'outdated'),null;const {range:_0x34177e,currentIndex:_0x4cc2f3}=_0x20e303;return'$graveyard'==_0x34177e['root']['rootName']?(_0x10f1c5['setChangeGroupState'](_0x4cc2f3,'outdated'),null):_0x20e303['range'];}['_getDocumentRangeForReplyChanges'](_0x2d5636,_0x31b08f){const {reply:_0x31ba29}=this['getInteractionAndReplyById'](_0x2d5636),_0xbdaa85=_0x31ba29['changeGroups']['filter'](_0x201bf6=>'pending'==_0x201bf6['state']),_0x5d4707=_0xbdaa85['map'](_0x490172=>_0x31ba29['changeGroups']['indexOf'](_0x490172));void 0x0===_0x31b08f&&(_0x31b08f=_0x5d4707[0x0]);const _0x56b0d0=_0x5d4707['indexOf'](_0x31b08f);if(-0x1==_0x56b0d0)return null;const _0x492d24=_0xbdaa85[_0x56b0d0],_0x6f9ff9=this['_resolveGroupTarget'](_0x31ba29,_0x492d24);if(!_0x6f9ff9)return null;const {editor:_0x178599,root:_0xa4df9b,parsedDocumentContent:_0x41ebed,serializedDocumentContent:_0x34813e,version:_0x2e149d}=_0x6f9ff9,_0x32f50f=new _0x837b91([]),_0x5e753f=new _0x837b91([]);for(const _0x22ab29 of _0x492d24['changes']){const _0x3cb1e8=this['activeConversation']?.['getSourceByDataId'](_0x22ab29['id']);if((!_0x3cb1e8||_0x3cb1e8['editor']===_0x6f9ff9['editor']&&_0x3cb1e8['rootName']===_0x6f9ff9['root']['rootName'])&&('removed'!=_0x22ab29['type']&&_0x5e753f['children']['push'](_0x22ab29['node']['cloneNode'](!0x0)),'new'!=_0x22ab29['type'])){const _0x44ba75=_0x140027(_0x4c768d=>Es(_0x4c768d,'data-id')==_0x22ab29['id'],_0x41ebed,!0x0);if(!_0x44ba75)return null;_0x32f50f['children']['push'](_0x44ba75['cloneNode'](!0x0));}}if(0x0==_0x32f50f['children']['length']){if(_0x492d24['changes'][0x0]['anchorId']){const _0x5724e9=As('data-id',_0x492d24['changes'][0x0]['anchorId'],_0x41ebed);_0x32f50f['children']['unshift'](_0x5724e9['cloneNode'](!0x0)),_0x5e753f['children']['unshift'](_0x5724e9['cloneNode'](!0x0)),_0x5724e9['nextSibling']&&(_0x32f50f['children']['push'](_0x5724e9['nextSibling']['cloneNode'](!0x0)),_0x5e753f['children']['push'](_0x5724e9['nextSibling']['cloneNode'](!0x0)));}else{const _0x29f40f=_0x41ebed['children'][0x0];if(!_0x29f40f)return null;_0x32f50f['children']['push'](_0x29f40f['cloneNode'](!0x0)),_0x5e753f['children']['push'](_0x29f40f['cloneNode'](!0x0));}}const _0x48d2f1=_0x178599['data']['parse'](_0x34813e),_0x2353d0=gs(_0x32f50f),_0x5a290c=_0x178599['data']['parse'](_0x2353d0),_0x34c872=_0x178599['data']['parse'](_0x2353d0),_0x40cea0=_0x178599['model']['createPositionAt'](_0x5a290c,0x0),_0x1c2679=gs(_0x5e753f),_0x425b62={'targetEditor':_0x178599,'anchor':_0x40cea0,'markDeletions':!0x1},_0x10aef5=_0x178599['plugins']['get'](_0x58b094)['getDiff'](_0x2353d0,_0x1c2679,_0x425b62)['getOperations']();if(!_0x10aef5['length'])return null;_0x178599['model']['change'](_0x5d2824=>{for(const _0x4dccf6 of _0x10aef5)if('remove'==_0x4dccf6['type']){const _0x86535a=_0x4dccf6['sourcePosition'],_0x5f8676=_0x4dccf6['howMany'],_0xd95a90=new _0x25589e(_0x86535a,_0x5f8676);_0x5d2824['batch']['addOperation'](_0xd95a90),_0x178599['model']['applyOperation'](_0xd95a90);}else'marker'!==_0x4dccf6['type']&&(_0x4dccf6['baseVersion']=null,_0x4dccf6['isDocumentOperation']=!0x1,_0x5d2824['batch']['addOperation'](_0x4dccf6),_0x178599['model']['applyOperation'](_0x4dccf6));});const _0x1b76a4=ks(_0x178599,_0x10aef5,_0x5a290c);Ns(_0x178599['model'],_0x1b76a4);const _0x26a2be=_0x1b76a4['getFirstRange']()['start']['path']['slice'](),_0x7c965d=_0x1b76a4['getFirstRange']()['end']['path']['slice'](),_0x57f77f=[];let _0x24c439=_0x5a290c,_0x509cc6=_0x34c872;for(let _0x5717ab=0x0;_0x5717ab<_0x7c965d['length'];_0x5717ab++){const _0x2cc15a=_0x24c439['maxOffset']-_0x7c965d[_0x5717ab];_0x57f77f[_0x5717ab]=_0x509cc6['maxOffset']-_0x2cc15a,_0x24c439=_0x24c439['getChildAtOffset'](_0x7c965d[_0x5717ab]),_0x509cc6=_0x509cc6['getChildAtOffset'](_0x57f77f[_0x5717ab]);}const _0x15fadc=_0x178599['model']['createRange'](_0x178599['model']['createPositionFromPath'](_0x34c872,_0x26a2be),_0x178599['model']['createPositionFromPath'](_0x34c872,_0x57f77f)),_0x317d78=_0x34c872['getChild'](0x0)['getAttribute'](_0x522952),_0x3a5a06=Array['from'](_0x48d2f1['getChildren']())['find'](_0x5c19d2=>_0x5c19d2['getAttribute'](_0x522952)==_0x317d78)['getPath'](),_0x2d19e4=_0x15fadc['start']['path']['slice'](),_0x347ee1=_0x15fadc['end']['path']['slice']();_0x2d19e4[0x0]=_0x3a5a06[0x0]+_0x2d19e4[0x0],_0x347ee1[0x0]=_0x3a5a06[0x0]+_0x347ee1[0x0];let _0x36c720=_0x178599['model']['createRange'](_0x178599['model']['createPositionFromPath'](_0xa4df9b,_0x2d19e4),_0x178599['model']['createPositionFromPath'](_0xa4df9b,_0x347ee1));const _0x47a5e2=_0x178599['model']['document']['history']['getOperations'](_0x2e149d);for(const _0x401ddb of _0x47a5e2)_0x36c720=_0x28623e['_createFromRanges'](_0x36c720['getTransformedByOperation'](_0x401ddb));return{'range':_0x36c720,'currentIndex':_0x31b08f};}['_integrateEditorBalloon'](_0x39368c){if(!_0x39368c['plugins']['has']('AIChatBalloon'))return;const _0x2f059d=_0x39368c['plugins']['get']('AIChatBalloon');this['_wiredBalloons']['has'](_0x2f059d)||(this['_wiredBalloons']['add'](_0x2f059d),this['_aiChatBalloon']||(this['_aiChatBalloon']=_0x2f059d),_0x2f059d['bind']('showDiff')['to'](this,'_aiChatBalloonShowDiff'),this['listenTo'](_0x2f059d,'toggleSuggestionDisplayMode',()=>{const {replyId:_0x5747fe,partIndex:_0x2a3fb3}=this['_currentPreviewedChangeGroup'];this['_aiChatBalloonShowDiff']=!this['_aiChatBalloonShowDiff'];const {reply:_0x1706f4}=this['getInteractionAndReplyById'](_0x5747fe),_0x4ec329=_0x1706f4['changeGroups']['find'](_0x1e1452=>_0x1e1452['index']===_0x2a3fb3),_0x3c3bab=_0x4ec329?this['_resolveGroupTarget'](_0x1706f4,_0x4ec329):null,_0x1c1aec=_0x1706f4['getContentParts']({'showDiff':this['_aiChatBalloonShowDiff'],'groupIndex':_0x2a3fb3,'editor':_0x3c3bab?.['editor']??$s(this['context'])});(this['_activeBalloon']??_0x2f059d)['updateContent']({'part':_0x1c1aec[0x0],'renderingStrategy':'static','keepErrors':!0x0});}),this['listenTo'](_0x2f059d,'applySuggestion',()=>{const {replyId:_0x1f3b0e,partIndex:_0x2ec5db}=this['_currentPreviewedChangeGroup'];this['_applySuggestion']({'replyId':_0x1f3b0e,'partIndex':_0x2ec5db}),(this['_activeBalloon']??_0x2f059d)['setState']('accepted');}),this['listenTo'](_0x2f059d,'insertSuggestion',()=>{const {replyId:_0x7f6a27,partIndex:_0xb7359a}=this['_currentPreviewedChangeGroup'];this['_insertSuggestion']({'replyId':_0x7f6a27,'partIndex':_0xb7359a}),(this['_activeBalloon']??_0x2f059d)['setState']('accepted');}),this['listenTo'](_0x2f059d,'rejectSuggestion',()=>{const {replyId:_0x29473d,partIndex:_0x3afbee}=this['_currentPreviewedChangeGroup'];this['_rejectSuggestion']({'replyId':_0x29473d,'partIndex':_0x3afbee}),(this['_activeBalloon']??_0x2f059d)['setState']('rejected');}),this['listenTo'](_0x2f059d,'showNext',()=>{const {replyId:_0x520f0d,partIndex:_0x2e6123}=this['_currentPreviewedChangeGroup'],_0xd0ae9b=this['_getPresentableSiblingContentPartIndex'](_0x520f0d,_0x2e6123,'next');null!==_0xd0ae9b&&this['_openBalloonFor'](_0x520f0d,_0xd0ae9b);}),this['listenTo'](_0x2f059d,'showPrevious',()=>{const {replyId:_0x159e1a,partIndex:_0x3e8ef1}=this['_currentPreviewedChangeGroup'],_0x435a13=this['_getPresentableSiblingContentPartIndex'](_0x159e1a,_0x3e8ef1,'previous');null!==_0x435a13&&this['_openBalloonFor'](_0x159e1a,_0x435a13);}),this['listenTo'](_0x2f059d,'dialogClosed',(_0x4e2c10,{id:_0x34005b})=>{if('aiChatBalloon'!==_0x34005b)return;const {replyId:_0x4350cb,partIndex:_0x331643}=this['_currentPreviewedChangeGroup'];this['_currentPreviewedChangeGroup']=null,this['_aiChatUi']['setFeedItemAIReplySuggestionPartActive']({'id':_0x4350cb,'index':_0x331643,'isActive':!0x1}),this['_activeBalloon']===_0x2f059d&&(this['_activeBalloon']=void 0x0);}));}['_integrateEditor'](_0x498530){if(this['_integrateEditorBalloon'](_0x498530),_0x498530['plugins']['has']('Undo')){const _0x5904d2=_0x498530['commands']['get']('undo'),_0xf8d372=_0x498530['commands']['get']('redo');this['listenTo'](_0x5904d2,'revert',(_0xffe749,_0x4fdc83,_0x124c26)=>{const _0x119d8d=this['_batchToChanges']['get'](_0x4fdc83);if(!_0x119d8d)return;const _0x5bf8dd=this['activeConversation']['getInteraction'](_0x119d8d['interactionId']),_0x5f29fa=_0x5bf8dd?.['getReply'](_0x119d8d['replyId']);this['_batchToChanges']['delete'](_0x4fdc83),_0x5bf8dd&&_0x5f29fa&&(_0x119d8d['indexes']['forEach'](_0x45a053=>_0x5f29fa['setChangeGroupState'](_0x45a053,'pending')),this['_batchToChanges']['set'](_0x124c26,_0x119d8d));}),this['listenTo'](_0xf8d372,'revert',(_0x4cf0e3,_0x1ebbd1,_0x4f1038)=>{const _0x1becfb=this['_batchToChanges']['get'](_0x1ebbd1);if(!_0x1becfb)return;const _0x1ed4e8=this['activeConversation']['getInteraction'](_0x1becfb['interactionId']),_0x1d5966=_0x1ed4e8?.['getReply'](_0x1becfb['replyId']);this['_batchToChanges']['delete'](_0x1ebbd1),_0x1ed4e8&&_0x1d5966&&(_0x1becfb['indexes']['forEach'](_0x54c081=>_0x1d5966['setChangeGroupState'](_0x54c081,'accepted')),this['_batchToChanges']['set'](_0x4f1038,_0x1becfb));});}const _0x14d2a1=_0x498530['config']['get']('ai.chat.context');_0x14d2a1['alwaysAddSelection']&&_0x14d2a1['document']['enabled']&&this['listenTo'](_0x498530['model']['document']['selection'],'change:range',(_0x51ee73,_0x3f5dd4)=>{if(!_0x3f5dd4['directChange'])return;'chat'===_0x498530['plugins']['get']('AITabs')['view']['activeTab']&&(_0x498530['model']['hasContent'](_0x498530['model']['document']['selection'])?this['addSelectionToChatContext']():this['removeSelectionFromChatContext']());});}async['_getLastCreatedConversationId'](){const _0x16187c=this['_aiConnector']['fetchConversations'](this['getGroupId'](),{'limit':0x1,'sortBy':'createdAt'});try{const _0x52bac2=await _0x16187c['getConversations']();return _0x52bac2['length']?_0x52bac2[0x0]['id']:'new';}catch(_0x1e3f9f){return this['_aiChatUi']['addFeedItemError']({'errorMessage':hs(this['context']['locale'],'AI_CHAT_UNABLE_TO_LOAD_CONVERSATION'),'id':ot()}),this['_logError'](new at('ai-chat-conversation-init-failed',this,{'error':_0x1e3f9f})),this['_aiChatUi']['toggleLoadingSkeleton'](!0x1),this['_aiChatUi']['disableControls'](),null;}}async['_startConversationSafely'](_0x539577={}){try{this['_aiChatUi']['enableControls'](),await this['_handleStartConversation'](_0x539577);}catch(_0x6665f6){this['_aiChatUi']['addFeedItemError']({'errorMessage':hs(this['context']['locale'],'AI_CHAT_UNABLE_TO_START_CONVERSATION'),'id':_0x539577['id']||ot()}),console['error'](_0x6665f6),this['activeConversation']=void 0x0,this['_aiChatUi']['disableControls']();}}async['_handleStartConversation']({id:_0x52aa54,modelId:_0x597d70}={}){this['_activeBalloon']?.['close'](),this['_activeBalloon']=void 0x0,this['_currentPreviewedChangeGroup']=null;let _0x3a49c4=_0x597d70;_0x3a49c4||(_0x52aa54||!this['activeConversation']?_0x3a49c4=this['context']['config']['get']('ai.models.defaultModelId'):this['_aiChatUi']['isModelAvailable']&&(_0x3a49c4=this['activeConversation']['selectedModel']['id'])),await this['_stopLastInteraction']();const _0x35d056=this['getGroupId'](),_0x1eb468=_0x52aa54||ot();let _0x34f20d;this['activeConversation']=new Gs({'connector':this['_aiConnector'],'chatModels':this['_aiChatModels'],'selectedModelId':_0x3a49c4,'conversationId':_0x1eb468,'group':_0x35d056,'getEditor':()=>$s(this['context']),'getEditors':()=>Ws(this['context']),'locale':this['context']['locale'],'isFromHistory':!!_0x52aa54}),this['activeConversation']['delegate']('toolDataReceived','interactionCreated','interactionStarted','replyCreated')['to'](this),this['activeConversation']['on']('conversationInitialized',(_0x3bf4cf,_0x4d5f17)=>{this['_aiChatUi']['createConversation'](_0x4d5f17),this['_aiChatUi']['resetMessageInput'](),this['_aiChatUi']['clearPendingContextUI'](),this['_aiChatUi']['clearConversationContextUI'](),_0x52aa54||(this['_aiChatUi']['resetConversationTitle'](),this['addCurrentDocumentToChatContext']());}),this['activeConversation']['on']('uploadProgressChanged',(_0x457429,_0x40c846)=>{this['_aiChatUi']['setIsUploadInProgress'](_0x40c846['isUploadInProgress']);}),this['activeConversation']['on']('webSearchStarted',()=>{const _0x152358=this['_aiChatUi']['prepareLoadingMessage']({'isWebSearchEnabled':!0x0,'isReasoningEnabled':!0x1});this['_aiChatUi']['setLoadingMessage'](_0x152358);}),this['activeConversation']['on']('reasoningStarted',()=>{const _0x3d2c31=this['_aiChatUi']['prepareLoadingMessage']({'isWebSearchEnabled':!0x1,'isReasoningEnabled':!0x0});this['_aiChatUi']['setLoadingMessage'](_0x3d2c31);}),this['activeConversation']['on']('webSearchFinished',(_0x38a0fc,_0x364cd0)=>{this['_aiChatUi']['addFeedInteractionHeader'](_0x364cd0,{'isWebSearchEnabled':!0x0,'isReasoningEnabled':!0x1});}),this['activeConversation']['on']('reasoningFinished',(_0x22bcc8,_0x3a474f)=>{this['_aiChatUi']['addFeedInteractionHeader'](_0x3a474f,{'isWebSearchEnabled':!0x1,'isReasoningEnabled':!0x0});}),this['activeConversation']['on']('interactionStarted',()=>{this['_aiChatUi']['startInteraction']();}),this['activeConversation']['on']('interactionFinished',async()=>{this['_updateReplyContentThrottled']['flush'](),await this['_aiChatUi']['finishInteraction']();}),this['activeConversation']['on']('interactionDestroyed',(_0x42156d,_0x3c663b)=>{this['_aiChatUi']['removeFeedInteraction'](_0x3c663b['id']);}),this['activeConversation']['on']('setConversationTitle',(_0x2275cd,_0x2f0f83,_0x5e99ab)=>{this['_updateConversationTitle'](_0x2f0f83,_0x5e99ab);}),this['activeConversation']['on']('replyContentUpdated',async(_0x3a2dad,_0x465a80)=>{void 0x0!==_0x34f20d&&_0x34f20d!==_0x465a80['id']&&this['_updateReplyContentThrottled']['flush'](),_0x34f20d=_0x465a80['id'],await this['_updateReplyContentThrottled']({'reply':_0x465a80});}),this['activeConversation']['on']('replyChangeGroupStateUpdated',(_0x50a11e,{reply:_0x45d1c7,index:_0x5bcf6d,state:_0xc40e7c})=>{this['_aiChatUi']['updateFeedItemAIReplySuggestionPartState']({'id':_0x45d1c7['id'],'index':_0x5bcf6d,'state':_0xc40e7c}),this['_currentPreviewedChangeGroup']?.['replyId']['includes'](_0x45d1c7['id'])&&this['_currentPreviewedChangeGroup']?.['partIndex']==_0x5bcf6d&&(this['_activeBalloon']??this['_aiChatBalloon'])?.['setState'](_0xc40e7c);}),this['activeConversation']['on']('contextItemAdded',(_0x327af2,_0x2f44c3)=>{if(this['_aiChatUi']['addContextItem'](_0x2f44c3['contextItem'],_0x2f44c3['isLoading']),'selection'===_0x2f44c3['contextItem']['type']){const _0xb43c81=[...$s(this['context'])['model']['document']['selection']['getRanges']()];this['_aiEditing']['showFakeVisualSelection']({'ranges':_0xb43c81,'id':'context','priority':0x1});}}),this['activeConversation']['on']('contextItemRemoved',(_0x49f1bb,_0x4996e9)=>{this['_aiChatUi']['removeContextItem'](_0x4996e9['uiId']),'current-document'==_0x4996e9['uiId']&&this['removeSelectionFromChatContext'](),'selection'===_0x4996e9['type']&&this['_aiEditing']['hideFakeVisualSelection']('context');}),this['activeConversation']['on']('contextItemLoadingEnded',(_0x15f2d4,_0x11a53e)=>{this['_aiChatUi']['setContextItemLoading'](_0x11a53e['contextItem']['uiId'],_0x11a53e['isLoading']);}),this['activeConversation']['on']('contextSent',(_0x592124,_0x1b2e87)=>{this['_aiChatUi']['setConversationContext'](_0x1b2e87['contextItems']);}),this['activeConversation']['on']('addContextOptionsChanged',(_0x5994bd,_0xec4e4d)=>{this['_aiChatUi']['setAddContextOptions'](_0xec4e4d['options']);}),this['activeConversation']['on']('sourceResourcesLoaded',(_0x5cb31e,_0x40b192)=>{this['_aiChatUi']['populateSourceResourceBalloon'](_0x40b192['sourceId'],_0x40b192['source'],_0x40b192['resources'],_0x40b192['uid']);}),this['activeConversation']['on']('resourceStateChanged',(_0x5615be,_0x3df540)=>{this['_aiChatUi']['updateResourceState'](_0x3df540['sourceId'],_0x3df540['resourceId'],_0x3df540['isInContext']);}),this['activeConversation']['on']('capabilitiesUpdated',(_0x3511b9,_0x47c98d)=>{this['_aiChatUi']['updateCapabilities'](_0x47c98d);}),this['activeConversation']['on']('modelSelected',async(_0x538e60,_0x236918)=>{const _0x224652=(await this['_aiChatModels']['getAll']())['find'](_0x46a163=>_0x46a163['id']===_0x236918['selectedModel']?.['id'])||null;this['_aiChatUi']['setSelectedModel'](_0x224652,_0x236918['isDisabled']);}),this['activeConversation']['on']('error',(_0x599a63,{error:_0x3d55ec,interactionId:_0x453503,fileName:_0x4622dd,url:_0x3a7412,sourceId:_0x2155ee,sourceLabel:_0x5a2e51})=>{const _0x138bd3=_0x453503?_0x453503+':'+ot():ot();_0x3d55ec['message']['startsWith']('ai-request-aborted')?this['_aiChatUi']['addFeedItemStaticMessage']({'staticMessage':hs(this['context']['locale'],'AI_CHAT_ABORTED_MESSAGE'),'id':_0x138bd3}):_0x3d55ec['message']['startsWith']('ai-chat-conversation-init-failed')||_0x3d55ec['message']['startsWith']('ai-chat-conversation-start-failed')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':hs(this['context']['locale'],'AI_CHAT_UNABLE_TO_START_CONVERSATION'),'id':_0x138bd3}),this['_logError'](_0x3d55ec)):_0x3d55ec['message']['startsWith']('ai-chat-file-upload-failed')?this['_aiChatUi']['addFeedItemError']({'errorMessage':hs(this['context']['locale'],'AI_CHAT_CONTEXT_UNABLE_TO_UPLOAD_FILE',_0x4622dd),'id':_0x138bd3}):_0x3d55ec['message']['startsWith']('ai-chat-url-upload-failed')?this['_aiChatUi']['addFeedItemError']({'errorMessage':hs(this['context']['locale'],'AI_CHAT_CONTEXT_UNABLE_TO_UPLOAD_URL',_0x3a7412),'id':_0x138bd3}):_0x3d55ec['message']['startsWith']('ai-chat-context-invalid-data')?this['_aiChatUi']['addFeedItemError']({'errorMessage':hs(this['context']['locale'],'AI_CHAT_CONTEXT_INVALID_DATA'),'id':_0x138bd3}):_0x3d55ec['message']['startsWith']('ai-chat-context-unsupported-type')?this['_aiChatUi']['addFeedItemError']({'errorMessage':hs(this['context']['locale'],'AI_CHAT_CONTEXT_UNSUPPORTED_TYPE'),'id':_0x138bd3}):_0x3d55ec['message']['startsWith']('ai-chat-source-resources-load-failed')?(_0x2155ee&&this['_aiChatUi']['closeSourceResourceBalloon'](_0x2155ee),this['_aiChatUi']['addFeedItemError']({'errorMessage':hs(this['context']['locale'],'AI_CHAT_CONTEXT_UNABLE_TO_LOAD_RESOURCES',_0x5a2e51||'source'),'id':_0x138bd3}),this['_logError'](_0x3d55ec)):_0x3d55ec['message']['startsWith']('ai-chat-resource-load-failed')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':hs(this['context']['locale'],'AI_CHAT_RESOURCE_LOAD_FAILED'),'id':_0x138bd3}),this['_logError'](_0x3d55ec)):_0x3d55ec['message']['startsWith']('ai-chat-invalid-request')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':hs(this['context']['locale'],'AI_CHAT_INVALID_REQUEST'),'id':_0x138bd3}),this['_logError'](_0x3d55ec)):_0x3d55ec['message']['startsWith']('ai-chat-context-unsupported-file-type')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':hs(this['context']['locale'],'AI_CHAT_CONTEXT_UNSUPPORTED_FILE_TYPE'),'id':_0x138bd3}),this['_logError'](_0x3d55ec)):_0x3d55ec['message']['startsWith']('ai-chat-context-file-too-large')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':hs(this['context']['locale'],'AI_CHAT_CONTEXT_FILE_TOO_LARGE'),'id':_0x138bd3}),this['_logError'](_0x3d55ec)):_0x3d55ec['message']['startsWith']('ai-chat-context-file-too-many-pages')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':hs(this['context']['locale'],'AI_CHAT_CONTEXT_FILE_TOO_MANY_PAGES'),'id':_0x138bd3}),this['_logError'](_0x3d55ec)):_0x3d55ec['message']['startsWith']('ai-chat-context-form-data-size-limits-exceeded')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':hs(this['context']['locale'],'AI_CHAT_CONTEXT_FORM_DATA_SIZE_LIMITS_EXCEEDED'),'id':_0x138bd3}),this['_logError'](_0x3d55ec)):(this['_aiChatUi']['addFeedItemError']({'errorMessage':hs(this['context']['locale'],'AI_CHAT_GENERIC_ERROR'),'id':_0x138bd3}),this['_logError'](_0x3d55ec));}),await this['activeConversation']['init'](this['context']['config']['get']('ai.chat.context')),_0x52aa54||await this['activeConversation']['start']();}async['_handleUIUserMessage']({message:_0x2e1be3,attributes:_0x26ef3d}){if(!this['activeConversation'])throw new at('ai-chat-controller-no-active-conversation');if(this['activeConversation']['isCurrentDocumentInContext']()){const _0x5ca82b=await this['_aiEditing']['getDocumentData']();_0x5ca82b['length']>0x1?await this['activeConversation']['updateDocumentsInContext'](_0x5ca82b):await this['activeConversation']['updateCurrentDocumentInContext'](_0x5ca82b[0x0]);}this['activeConversation']['id']&&this['activeConversation']['isStarted']&&await this['activeConversation']['handleUserInteraction']({'userMessage':_0x2e1be3,'attributes':_0x26ef3d});}['_logError'](_0x127e7e){Et(_0x127e7e['message']);}['_removeFromContext'](_0x1c2c7f){this['activeConversation']?.['removeFromContext'](_0x1c2c7f);}['_toggleWebSearch'](){this['activeConversation']?.['toggleWebSearch']();}['_toggleReasoning'](){this['activeConversation']?.['toggleReasoning']();}['getInteractionAndReplyById'](_0x27b97f){const [_0xf7a986,_0x509f55]=_0x27b97f['split'](':'),_0x4f9ed6=this['activeConversation']['getInteraction'](_0xf7a986),_0x461f24=_0x4f9ed6['getReply'](_0x509f55);return{'interaction':_0x4f9ed6,'reply':_0x461f24};}['_resolveGroupTarget'](_0x573680,_0x5c1027){const _0x480850=[..._0x5c1027['changes']['filter'](_0x453733=>'context'!==_0x453733['type']),..._0x5c1027['changes']['filter'](_0x1f5d45=>'context'===_0x1f5d45['type'])];for(const _0x4d6ea0 of _0x480850){const _0x2c8e7e=_0x573680['newNodeAnchorIds']['get'](_0x4d6ea0['id']),_0x35a62f=this['activeConversation']?.['getSourceByDataId'](_0x4d6ea0['id'])||this['activeConversation']?.['getSourceByDataId'](_0x2c8e7e)||this['activeConversation']?.['getSourceByDataId'](_0x4d6ea0['anchorId']??void 0x0);if(_0x35a62f){if('destroyed'===_0x35a62f['editor']['state'])return null;const _0x338fc2=_0x35a62f['editor']['model']['document']['getRoot'](_0x35a62f['rootName']);return _0x338fc2?{'editor':_0x35a62f['editor'],'root':_0x338fc2,'parsedDocumentContent':_s(_0x35a62f['content']),'serializedDocumentContent':_0x35a62f['content'],'version':_0x35a62f['version']}:null;}}const _0x42e4e2=$s(this['context']),_0x1a6778=this['activeConversation']['getInteraction'](_0x573680['interactionId']),_0x2047bc=_0x1a6778?.['getDocumentContext']();return{'editor':_0x42e4e2,'root':_0x42e4e2['model']['document']['getRoot'](),'parsedDocumentContent':_0x573680['documentContextContent'],'serializedDocumentContent':_0x2047bc?.['content'],'version':_0x2047bc?.['version']};}['_groupChangesByTarget'](_0xf309ed,_0x3a2a09){const _0x30f345=new Map();for(const _0x5e23d8 of _0x3a2a09){const _0x46fc4c=this['_resolveGroupTarget'](_0xf309ed,_0x5e23d8);if(!_0x46fc4c)continue;const _0x4dc301=(_0x46fc4c['editor']['id']||'e')+'|'+_0x46fc4c['root']['rootName'];let _0x3e2275=_0x30f345['get'](_0x4dc301);if(!_0x3e2275){let _0x52d3d6;for(const _0x359c6e of[..._0x5e23d8['changes']['filter'](_0x4e7518=>'context'!==_0x4e7518['type']),..._0x5e23d8['changes']['filter'](_0x55c562=>'context'===_0x55c562['type'])])if(_0x52d3d6=this['activeConversation']?.['getDocumentContextSliceByDataId'](_0x359c6e['id'])||this['activeConversation']?.['getDocumentContextSliceByDataId'](_0xf309ed['newNodeAnchorIds']['get'](_0x359c6e['id'])),_0x52d3d6)break;_0x3e2275={'target':{'editor':_0x46fc4c['editor'],'root':_0x46fc4c['root']},'slice':_0x52d3d6,'groups':[],'groupsIndexes':[]},_0x30f345['set'](_0x4dc301,_0x3e2275);}_0x3e2275['groups']['push'](_0x5e23d8),_0x3e2275['groupsIndexes']['push'](_0xf309ed['changeGroups']['indexOf'](_0x5e23d8));}return Array['from'](_0x30f345['values']());}['_scrollToSuggestionRange'](_0x575998,_0x4b38b1=!0x1,_0x430df6){_0x430df6??=$s(this['context']);const _0x54269b={'target':_0x430df6['editing']['view']['domConverter']['viewRangeToDom'](_0x430df6['editing']['mapper']['toViewRange'](_0x575998)),'viewportOffset':{'top':0x96,'left':0x0,'bottom':0x32,'right':0x0},'ancestorOffset':0x14,'alignToTop':_0x4b38b1};_0x4b38b1&&(_0x54269b['alignToTop']=!0x0),Ct(_0x54269b);}['_updateConversationTitle'](_0x2f7c83,_0x1715a8=!0x1){this['_aiChatUi']['setConversationTitle'](_0x2f7c83||hs(this['context']['locale'],'AI_CHAT_UNTITLED_CONVERSATION'),_0x1715a8);}['_addFeedItemReply'](_0x2dd794){'text'===_0x2dd794['type']?this['_aiChatUi']['addFeedItemAIReply'](_0x2dd794):this['_aiChatUi']['addFeedItemAISuggestion'](_0x2dd794);}async['_updateReplyContent']({reply:_0x2810e,renderingStrategy:_0x1d4b30}){const {id:_0x56b938,interactionId:_0x5f22e6,isDone:_0x1c4bdd,type:_0x33f72c,parsedContent:_0x4999fa}=_0x2810e,_0x2526b7=_0x5f22e6+':'+_0x56b938;if('modification'===_0x33f72c){const _0x2e920e=_0x2810e['getContentParts']({'showDiff':this['_aiChatUi']['showDiff'],'editor':$s(this['context'])});await this['_aiChatUi']['updateFeedItemAIReplySuggestionContent']({'id':_0x2526b7,'parts':_0x2e920e,'isDone':_0x1c4bdd,'skipLoadingEffects':_0x2810e['isFromHistory']});}else'text'===_0x33f72c&&await this['_aiChatUi']['updateFeedItemAIReplyContent']({'id':_0x2526b7,'parsedContent':_0x4999fa,'renderingStrategy':_0x1d4b30,'isDone':_0x1c4bdd});_0x1c4bdd&&_0x2810e['sources']['length']>0x0&&this['_aiChatUi']['updateFeedItemAIReplySources'](_0x2526b7,_0x2810e['sources']);}['_updateReplyContentThrottled']=_0x5c3fa4(this['_updateReplyContent']['bind'](this),0xc8);async['_stopLastInteraction'](){const _0x57804a=this['activeConversation']?.['lastInteraction'];_0x57804a&&(_0x57804a['stop'](),this['_aiChatUi']['stopInteraction'](_0x57804a)),this['_updateReplyContentThrottled']['cancel']();}async['_flushLastInteractionUI'](){const _0x2ad53a=this['activeConversation']?.['lastInteraction'];if(_0x2ad53a){for await(const _0x42e4aa of _0x2ad53a['replies'])this['_aiChatUi']['hasFeedItem'](_0x42e4aa['id'])||this['_addFeedItemReply'](_0x42e4aa),await this['_updateReplyContent']({'reply':_0x42e4aa,'renderingStrategy':'static'});}}['_updateRatings'](_0x89b80a){const _0x2a5f08={'positiveCount':_0x89b80a['changeGroups']['filter'](_0x29af9f=>'accepted'===_0x29af9f['state'])['length'],'totalCount':_0x89b80a['changeGroups']['length'],'modificationId':_0x89b80a['id']},_0x46bf3c=this['activeConversation']['getInteraction'](_0x89b80a['interactionId'])['messageId'];_0x46bf3c&&this['_aiConnector']['upsertAIChatRating'](this['activeConversation']['id'],_0x46bf3c,_0x2a5f08);}['_getAIChatFeedAPI'](_0x2804de){const _0x1fb367=this['_aiChatUi'],_0x2cb58c=()=>{_0x2804de['resetWebSearchState'](),_0x2804de['resetReasoningState'](),_0x1fb367['clearLoadingMessage']();},_0x4495ce=()=>{_0x2804de['currentReply']&&(_0x2804de['currentReply']['done'](),_0x2804de['currentReply']=void 0x0);};return{'insertTextReply':(_0x195495,_0x1a2b20)=>{_0x4495ce(),_0x2cb58c();const _0x55bca5=_0x2804de['currentReply']=_0x2804de['createReply']({'type':'text','interactionId':_0x2804de['id'],'content':_0x195495,'id':_0x1a2b20||ot()});return _0x4495ce(),_0x55bca5;},'insertCustomElement':async(_0x4d2a6f,_0x4599b9)=>(_0x4495ce(),_0x2cb58c(),_0x1fb367['addFeedItemCustomElement'](_0x4d2a6f,_0x4599b9||ot())),'setLoadingMessage':_0x191897=>{_0x1fb367['setLoadingMessage'](_0x191897);},'clearLoadingMessage':()=>{_0x1fb367['clearLoadingMessage']();}};}}const zs='ai-selection',js=['br'];class Js extends _0x203d97{constructor(_0x30fb48){super(_0x30fb48),this['context']['config']['define']('ai.models.showModelSelector',!0x0);}['_outputDataProcessor'];['_fakeSelections']=[];['_sessionId'];['_lastContentFocusedEditor'];static get['pluginName'](){return'AIEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['getLastContentFocusedEditor'](){return this['_lastContentFocusedEditor'];}get['sessionId'](){if(!this['_sessionId']){const _0x23ecc1=Ws(this['context']),_0x27289a=_0x23ecc1['find'](_0x304000=>_0x304000['plugins']['has']('RealTimeCollaborationClient'))||_0x23ecc1[0x0],_0x1a2249=_0x27289a['plugins']['has']('RealTimeCollaborationClient')&&_0x27289a['plugins']['get']('RealTimeCollaborationClient')['sessionId'];this['_sessionId']=_0x1a2249||ot();}return this['_sessionId'];}async['getDocumentData'](){const _0xcaa684=Ws(this['context']);if(!_0xcaa684['length'])throw new at('ai-get-editor-from-context-no-editor');const _0x1c474b=[],_0x149e10=new Set();for(const _0x28c1ff of _0xcaa684){const _0x3bef4c=_0x28c1ff['config']['get']('roots')||{};for(const _0x52d414 of _0x28c1ff['model']['document']['getRoots']()){if('$graveyard'===_0x52d414['rootName'])continue;const _0x2b04e2=await this['_getDocumentDataForEditorRoot'](_0x28c1ff,_0x52d414,_0x149e10),_0x3cc3f9=_0x3bef4c[_0x52d414['rootName']];_0x1c474b['push']({'editor':_0x28c1ff,'rootName':_0x52d414['rootName'],'content':_0x2b04e2['content'],'version':_0x2b04e2['version'],'sessionId':this['sessionId'],'selections':_0x2b04e2['selections'],'name':_0x52d414['rootName'],'description':_0x3cc3f9?.['description']});}}return _0x1c474b;}async['_getDocumentDataForEditorRoot'](_0x3a8bb5,_0x1fb30a,_0x5b3b5e){const _0x5800f4=_0x3a8bb5['data']['toView'](_0x1fb30a,{'convertAiChatSelectionMarker':!0x0}),_0x3706df=new _0x3e7bae(_0x3a8bb5['editing']['view']['document']);this['_setDataIdsOnChildren'](_0x5800f4,_0x3706df,_0x5b3b5e);let _0x19fafd=await this['_getDocumentDataStringFromView'](_0x5800f4,_0x3a8bb5);const _0x5b5726=this['_getMarkersInDocumentOrder'](_0x3a8bb5,_0x1fb30a),_0x2edb11=[];for(const _0xe1a97c of _0x5b5726){const _0x5ba839='<'+_0xe1a97c['name']+':start></'+_0xe1a97c['name']+':start>',_0xb0e5dc=_0x19fafd['indexOf'](_0x5ba839);_0x19fafd=_0x19fafd['substring'](0x0,_0xb0e5dc)+_0x19fafd['substring'](_0xb0e5dc+_0x5ba839['length']);const _0x137652='<'+_0xe1a97c['name']+':end></'+_0xe1a97c['name']+':end>',_0x28d09c=_0x19fafd['indexOf'](_0x137652);_0x19fafd=_0x19fafd['substring'](0x0,_0x28d09c)+_0x19fafd['substring'](_0x28d09c+_0x137652['length']),_0x2edb11['push']({'markerName':_0xe1a97c['name'],'start':_0xb0e5dc,'end':_0x28d09c,'htmlFragment':_0x19fafd['substring'](_0xb0e5dc,_0x28d09c)});}return{'content':_0x19fafd,'version':_0x3a8bb5['model']['document']['version'],'selections':_0x2edb11};}async['afterInit'](){this['context']instanceof _0x17198a?this['_integrateEditor'](this['context']):this['listenTo'](this['context']['editors'],'add',(_0xc6720e,_0x44e114)=>{_0x44e114['on']('ready',()=>{this['_integrateEditor'](_0x44e114);});});}['_setOutputDataProcessor'](_0x195183){this['_outputDataProcessor']=_0x195183;}async['_getDocumentDataStringFromView'](_0x1aeb9c,_0x369d1a){let _0x46d942;if(this['_outputDataProcessor']){const _0x40e9b8=_0x369d1a['data']['processor']['domConverter']['viewToDom'](_0x1aeb9c),_0x530f1a=await this['_outputDataProcessor'](_0x40e9b8);_0x46d942=_0x369d1a['data']['processor']['htmlWriter']['getHtml'](_0x530f1a);}else _0x46d942=_0x369d1a['data']['processor']['toData'](_0x1aeb9c);return _0x46d942;}['_integrateEditor'](_0x1f906a){_0x1f906a['ui']['focusTracker']['on']('change:isFocused',(_0x1bf94a,_0x3f0d72,_0x3d8818)=>{_0x3d8818&&(this['_lastContentFocusedEditor']=_0x1f906a);}),_0x1f906a['on']('destroy',()=>{this['_lastContentFocusedEditor']===_0x1f906a&&(this['_lastContentFocusedEditor']=void 0x0);}),_0x1f906a['conversion']['for']('editingDowncast')['markerToHighlight']({'model':zs,'view':({markerName:_0x385fea})=>({'classes':['ck-ai-assistant-ui_theme','ck-fake-ai-selection','ck-fake-ai-selection-'+_0x385fea['split'](':')[0x1]],'priority':0xc})}),_0x1f906a['conversion']['for']('dataDowncast')['markerToElement']({'model':zs+':context','view':(_0xfbdc34,{writer:_0x54db6d,options:_0x3db777})=>_0x3db777['convertAiChatSelectionMarker']?_0x54db6d['createUIElement'](_0xfbdc34['markerName']+':'+(_0xfbdc34['isOpening']?'start':'end')):null});}['showFakeVisualSelection'](_0x4ed497){const _0x21959f=this['_fakeSelections'][0x0]||null;this['_addFakeSelection'](_0x4ed497);const _0x2cb9bc=this['_fakeSelections'][0x0]||null;this['_refreshFakeSelection'](_0x21959f,_0x2cb9bc);}['hideFakeVisualSelection'](_0x45c294){const _0x38b285=this['_fakeSelections'][0x0]||null;this['_removeFakeSelectionById'](_0x45c294);const _0x257979=this['_fakeSelections'][0x0]||null;this['_refreshFakeSelection'](_0x38b285,_0x257979);}async['modelToDataWithIds'](_0x460e1f){const _0x17bf04=$s(this['context']),_0x137fd5=_0x17bf04['data']['toView'](_0x460e1f),_0x5d8a3c=new _0x3e7bae(_0x17bf04['editing']['view']['document']);return this['_setDataIdsOnChildren'](_0x137fd5,_0x5d8a3c),this['_getDocumentDataStringFromView'](_0x137fd5,_0x17bf04);}['_setDataIdsOnChildren'](_0x3c2938,_0x2e499f,_0x49841a=new Set()){let _0x5c5e9e=!0x1;for(const _0xeb594f of _0x3c2938['getChildren']()){if(!_0xeb594f['is']('view:element')||js['includes'](_0xeb594f['name']))continue;const _0x5e4f3c=_0xeb594f['is']('view:containerElement'),_0x66ffe8=_0xeb594f['is']('view:emptyElement'),_0x47f8bb=this['_setDataIdsOnChildren'](_0xeb594f,_0x2e499f,_0x49841a);if(_0xeb594f['hasAttribute']('data-id')){_0x5c5e9e=!0x0,_0x49841a['add'](_0xeb594f['getAttribute']('data-id'));continue;}(_0x5e4f3c||_0x66ffe8||_0x47f8bb)&&(_0x2e499f['setAttribute']('data-id',this['_nextDataId'](_0x49841a),_0xeb594f),_0x5c5e9e=!0x0);}return _0x5c5e9e;}['_nextDataId'](_0x1d35a2){let _0x50e0d7;do{_0x50e0d7='';for(let _0x2d971f=0x0;_0x2d971f<0x4;_0x2d971f++)_0x50e0d7+=String['fromCharCode'](0x61+Math['floor'](0x1a*Math['random']()));}while(_0x1d35a2['has'](_0x50e0d7));return _0x1d35a2['add'](_0x50e0d7),_0x50e0d7;}['getSelectionText'](){const {model:_0xa2f866}=$s(this['context']),_0x2391d1=_0xa2f866['document']['selection'],_0x8ec3c6=[],_0x749718=Array['from'](_0x2391d1['getRanges']());_0x749718['sort']((_0x14bf27,_0x2e2732)=>_0x14bf27['start']['isBefore'](_0x2e2732['start'])?-0x1:0x1);for(const _0x86e997 of _0x749718)for(const _0x3af63d of _0x86e997['getItems']())_0x3af63d['is']('$textProxy')?_0x8ec3c6['push'](_0x3af63d['data']):_0x3af63d['is']('element')&&_0x8ec3c6['length']>0x0&&'\x20'!==_0x8ec3c6[_0x8ec3c6['length']-0x1]&&_0x8ec3c6['push']('\x20');return _0x8ec3c6['length']?'\x22'+_0x8ec3c6['join']('')['trim']()+'\x22':hs(this['context']['locale'],'AI_CHAT_CONTEXT_DOCUMENT_SELECTION_LABEL');}['_removeFakeSelectionById'](_0x16e6b7){for(let _0x231a5d=0x0;_0x231a5d<this['_fakeSelections']['length'];_0x231a5d++)if(this['_fakeSelections'][_0x231a5d]['id']==_0x16e6b7)return void this['_fakeSelections']['splice'](_0x231a5d,0x1);}['_addFakeSelection'](_0x35a338){this['_removeFakeSelectionById'](_0x35a338['id']),wt(this['_fakeSelections'],_0x35a338);}['_refreshFakeSelection'](_0x637e94,_0x265de6){if(_0x637e94==_0x265de6)return;const _0x2dc616=_0x637e94?this['_getEditorForFakeSelection'](_0x637e94):null,_0x3b4ca8=_0x265de6?this['_getEditorForFakeSelection'](_0x265de6):null,_0x581ee9=(_0x7f6afc,_0x49f935)=>{const _0x41710d=_0x49f935['model']['markers']['getMarkersGroup'](zs);for(const _0x5622ab of _0x41710d)_0x7f6afc['removeMarker'](_0x5622ab);},_0xedb134=(_0x54ec4b,_0xad512d,_0x1b2b11)=>{const _0x56f2e9=_0xad512d['model'];for(let _0x180b44=0x0;_0x180b44<_0x1b2b11['ranges']['length'];_0x180b44++){let _0x446c08=_0x1b2b11['ranges'][_0x180b44];const _0x2e5d09=zs+':'+_0x1b2b11['id']+':'+_0x180b44;if(_0x446c08['start']['isAtEnd']){const _0x34f36f=_0x446c08['start']['getLastMatchingPosition'](({item:_0x23b4ea})=>!_0x56f2e9['schema']['isContent'](_0x23b4ea),{'boundaries':_0x446c08});_0x446c08=_0x54ec4b['createRange'](_0x34f36f,_0x446c08['end']);}_0x54ec4b['addMarker'](_0x2e5d09,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x446c08});}};_0x2dc616&&_0x3b4ca8&&_0x2dc616===_0x3b4ca8&&_0x265de6?_0x2dc616['model']['change'](_0x323bbe=>{_0x581ee9(_0x323bbe,_0x2dc616),_0xedb134(_0x323bbe,_0x3b4ca8,_0x265de6);}):(_0x2dc616&&_0x2dc616['model']['change'](_0x27d006=>_0x581ee9(_0x27d006,_0x2dc616)),_0x3b4ca8&&_0x265de6&&_0x3b4ca8['model']['change'](_0x5c7081=>_0xedb134(_0x5c7081,_0x3b4ca8,_0x265de6)));}['_getEditorForFakeSelection'](_0x1a6dbb){if(!_0x1a6dbb['ranges']['length'])return $s(this['context']);const _0x1f2aa9=_0x1a6dbb['ranges'][0x0]['root']['document'];return Ws(this['context'])['find'](_0x1451b5=>_0x1451b5['model']['document']===_0x1f2aa9)??$s(this['context']);}['_getMarkersInDocumentOrder'](_0x17e821,_0x5abdc0){const _0x3524a5=Array['from'](_0x17e821['model']['markers']['getMarkersGroup'](zs+':context'));return(_0x5abdc0?_0x3524a5['filter'](_0x56d071=>{const _0x4f6755=_0x56d071['getRange']();return _0x4f6755&&_0x4f6755['root']['rootName']===_0x5abdc0['rootName'];}):_0x3524a5)['sort']((_0x2ed66b,_0x976296)=>_0x2ed66b['getStart']()['isBefore'](_0x976296['getStart']())?-0x1:_0x2ed66b['getStart']()['isAfter'](_0x976296['getStart']())?0x1:0x0);}}const Zs=['showChangeInText','insertSuggestion','applySuggestion','rejectSuggestion','mouseOverSuggestion','mouseLeaveSuggestion','toggleSuggestionDisplayMode','like','dislike'],tn=[...Zs,'startConversation','sendUserMessage','abortPromptStream','addDocumentToContext','addFileToContext','addUrlToContext','executeCustomItemCallback','addResourceToContext','removeContextItem','loadSourceResources','toggleWebSearch','toggleReasoning','selectModel'];function en(_0x144945){const _0x4cbe54=new AbortController();return{'promise':new Promise((_0x4a28ad,_0x4cf189)=>{const _0x5f45aa=setTimeout(_0x4a28ad,_0x144945);_0x4cbe54['signal']['addEventListener']('abort',()=>{clearTimeout(_0x5f45aa),_0x4cf189();});}),'abortController':_0x4cbe54};}class sn{['options'];['isStreaming']=!0x1;['document']=null;['nodesList']=[];['currentIndex']=0x0;['timeoutAbortController']=null;['lastUpdateTime']=0x0;constructor(_0x5d15a0){this['options']={'delay':_0x5d15a0?.['delay']??0xa,'textNodeStyle':_0x5d15a0?.['textNodeStyle']??'animation:\x20ck-html-streamer-fade-in\x20.3s'};}async['stream']({document:_0x11fc73,targetElement:_0x1883e3,abortSignal:_0x284800}){this['isStreaming']&&this['stop'](),_0x284800?.['addEventListener']('abort',this['stop']['bind'](this)),this['document']=_0x583d74(_0x11fc73,!0x0),this['nodesList']=this['getParsedDocumentNodeList'](),this['isStreaming']=!0x0,this['currentIndex']>this['nodesList']['length']&&(this['currentIndex']=this['nodesList']['length']);for(let _0x51987c=0x0;_0x51987c<this['currentIndex'];_0x51987c++)this['nodesList'][_0x51987c]['shouldBeStreamed']=!0x0;do{const _0x3044b7=Date['now'](),_0x384dae=this['nodesList'][this['currentIndex']],_0x21697b=_0x3044b7-this['lastUpdateTime'];if(_0x384dae){_0x384dae['shouldBeStreamed']=!0x0;let _0x40c7d6=_0x384dae['parent'];for(;_0x40c7d6;)_0x40c7d6['shouldBeStreamed']=!0x0,_0x40c7d6=_0x40c7d6['parent'];}if(_0x21697b<this['options']['delay'])try{const {promise:_0xc9d155,abortController:_0x169373}=en(this['options']['delay']-_0x21697b);this['timeoutAbortController']=_0x169373,await _0xc9d155;}catch(_0x2d3832){return;}_0x243921(_0x1883e3,'<'+_0x1883e3['tagName']+'>'+this['renderNode'](this['document'])+'</'+_0x1883e3['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:_0x3da122}){Array['from'](_0x3da122['querySelectorAll']('span[data-ck-html-streamer-word-chunk]'))['reverse']()['forEach'](_0x5aa423=>{_0x5aa423['replaceWith'](_0x5aa423['childNodes'][0x0]);});}['stop'](){this['isStreaming']=!0x1,this['timeoutAbortController']&&(this['timeoutAbortController']['abort'](),this['timeoutAbortController']=null);}['renderNode'](_0x69fcc2){let _0x42f186='';if(function(_0xbdedb8){return _0x530132(_0xbdedb8);}(_0x69fcc2)){for(const _0x821a96 of _0x69fcc2['children'])_0x42f186+=this['renderNode'](_0x821a96);}else{if(on(_0x69fcc2)){if(!_0x69fcc2['shouldBeStreamed'])return'';const _0x3bb103=_0x69fcc2,_0x27d976=Object['entries'](_0x3bb103['attribs'])['map'](([_0x3f6647,_0x1da22e])=>_0x3f6647+'=\x22'+_0x1da22e+'\x22')['join']('\x20');_0x42f186+='<'+_0x3bb103['tagName']+(_0x27d976?'\x20'+_0x27d976:'')+'>';for(const _0x19ff57 of _0x3d540f(_0x3bb103))_0x42f186+=this['renderNode'](_0x19ff57);_0x42f186+='</'+_0x3bb103['tagName']+'>';}else{if(!rn(_0x69fcc2))return'';if(!_0x69fcc2['shouldBeStreamed'])return'';!function(_0x1b6ab6){if(!_0x1b6ab6['parent']||!on(_0x1b6ab6['parent']))return!0x1;if(!nn['includes'](_0x1b6ab6['parent']['tagName']))return!0x1;return!_0xb78cbf(_0x1b6ab6)['match'](/^\s*[<>]\s*$/);}(_0x69fcc2)?_0x42f186+=ti(_0x69fcc2):_0x42f186+=ti(new _0x307097('span',{'data-ck-html-streamer-word-chunk':'','style':this['options']['textNodeStyle']},[_0x69fcc2]));}}return _0x42f186;}['getParsedDocumentNodeList'](){const _0x410512=[];return function(_0x8f2cf,_0x5960d0){const _0x6655cb=_0x5af345=>{if(_0x5960d0(_0x5af345),_0x5af345 instanceof _0xfa284d)for(let _0x4bb07c=0x0;_0x4bb07c<_0x5af345['children']['length'];_0x4bb07c++){const _0x43c84f=_0x5af345['children'][_0x4bb07c];_0x6655cb(_0x43c84f);}};for(let _0x46f60e=0x0;_0x46f60e<_0x8f2cf['children']['length'];_0x46f60e++)_0x6655cb(_0x8f2cf['children'][_0x46f60e]);}(this['document'],_0x2a1c44=>{if(rn(_0x2a1c44)){const _0x48456e=this['splitTextNodeIntoWordNodes'](_0x2a1c44);_0x48456e['length']&&_0x410512['push'](..._0x48456e);}_0x2a1c44['isWordSplitSource']||_0x2a1c44['isWordSplitResult']||_0x410512['push'](_0x2a1c44);}),_0x410512;}['splitTextNodeIntoWordNodes'](_0x2b5b4c){if(_0x2b5b4c['isWordSplitSource']||_0x2b5b4c['isWordSplitResult'])return[];const _0x6f91fb=_0xb78cbf(_0x2b5b4c)['match'](/(?:\s*\S+\s*)/g),_0x299c81=[];if(_0x6f91fb&&_0x6f91fb['length']>0x1){for(const _0x27ac0c of _0x6f91fb){const _0xf22d2f=new _0x3bcbda(_0x27ac0c);_0xf22d2f['isWordSplitResult']=!0x0,_0x3822cc(_0x2b5b4c,_0xf22d2f),_0x299c81['push'](_0xf22d2f);}_0x2b5b4c['isWordSplitSource']=!0x0,_0x38c273(_0x2b5b4c);}return _0x299c81;}}const nn=['p','li','td','th','span','h1','h2','h3','h4','h5','h6','b','strong','i','em','mark','del','ins','sup','sub','a','code','div'];function rn(_0x30e684){return _0x2bdc66(_0x30e684);}function on(_0x83e24e){return _0x526176(_0x83e24e);}class an extends vt{['options'];['content']='';['htmlStreamer'];['children'];constructor(_0x5778df){super();const _0x3c63f0=this['bindTemplate'];this['set']('isDone',!0x1),this['set']('isVisible',!0x0),this['htmlStreamer']=new sn(),this['options']=_0x5778df,this['children']=this['createCollection'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed__item',_0x3c63f0['if']('isDone','ck-ai-chat__feed__item_done'),_0x3c63f0['if']('isVisible','ck-hidden',_0x3c10a0=>!_0x3c10a0),'ck-ai-chat__feed__text-item'],'data-cke-ai-id':this['options']['id']},'children':this['children']});}['markAsDone'](){this['htmlStreamer']['cleanUpAnimations']({'targetElement':this['element']}),this['element']['querySelectorAll']('[data-id]')['forEach'](_0x4b827a=>{_0x4b827a['removeAttribute']('data-id');}),this['isDone']=!0x0;}async['streamIntoElement'](_0x25010c,_0x28a836,_0x4e3bb4){await this['htmlStreamer']['stream']({'document':_0x25010c,'targetElement':_0x28a836,'abortSignal':_0x4e3bb4});}}class hn extends vt{['showChangesToggleView'];constructor(_0x87e332,_0x5749a5){super(_0x87e332),this['set']('isShowChangesToggleVisible',!0x0),this['showChangesToggleView']=new cn(_0x87e332),this['showChangesToggleView']['set']({'class':'ck-ai-suggestion__header__show-changes-toggle\x20ck-ai-chat-controls-button\x20'+us,'label':hs(_0x87e332,'AI_SUGGESTION_BUTTON_SHOW_CHANGES'),'withText':!0x0}),this['showChangesToggleView']['isOn']=_0x5749a5['showDiff'],this['showChangesToggleView']['bind']('isVisible')['to'](this,'isShowChangesToggleVisible'),this['showChangesToggleView']['bind']('icon')['to'](this['showChangesToggleView'],'isOn',_0x4e047a=>_0x4e047a?_0x1ad2ce:_0x306402),this['showChangesToggleView']['on']('execute',()=>{this['showChangesToggleView']['isOn']=!this['showChangesToggleView']['isOn'],this['fire']('toggleShowChanges',{'isOn':this['showChangesToggleView']['isOn']});});const _0x1742f9=new xt();_0x1742f9['content']=_0x386a1,this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__header',!0x1===_0x5749a5['showHeader']?'ck-hidden':null]['filter'](Boolean)},'children':[_0x1742f9,{'tag':'span','children':[hs(_0x87e332,'AI_SUGGESTION_HEADER_TITLE')]},this['showChangesToggleView']]});}}class cn extends Nt{['render'](){super['render'](),this['children']['remove'](this['iconView']),this['children']['add'](this['iconView']);}}const ln={'accepted':_0xa10937,'rejected':_0x404ed0,'outdated':_0x404ed0};class un extends vt{['stateIconView'];constructor(_0x454787){super(_0x454787);const _0x27ce60=this['bindTemplate'];this['set']('state','accepted'),this['set']('isVisible',!0x0),this['stateIconView']=new dn(),this['stateIconView']['bind']('state')['to'](this),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__content-part-state',_0x27ce60['to']('state',_0x153463=>'ck-ai-suggestion__content-part-state_'+_0x153463),_0x27ce60['if']('isVisible','ck-hidden',_0x2db0a9=>!_0x2db0a9)]},'children':[{'tag':'span','attributes':{'class':['ck-ai-suggestion__content-part-state__label']},'children':[{'text':_0x27ce60['to']('state',_0x151275=>{switch(_0x151275){case'accepted':return hs(_0x454787,'AI_SUGGESTION_CONTENT_PART_STATE_ACCEPTED');case'rejected':return hs(_0x454787,'AI_SUGGESTION_CONTENT_PART_STATE_REJECTED');case'outdated':return hs(_0x454787,'AI_SUGGESTION_CONTENT_PART_STATE_OUTDATED');}})}]},this['stateIconView']]});}['setState'](_0x7d244f){this['state']=_0x7d244f;}}class dn extends xt{constructor(){super(),this['set']('state','accepted'),this['content']=ln[this['state']],this['on']('change:state',()=>{this['content']=ln[this['state']];});}}class _n extends kt{['_applyButton'];['_suggestButton'];constructor(_0xae9b87,_0x470d26,_0x10a782){super(_0xae9b87);const _0x42a73c=Boolean(_0x10a782);this['set']('isEnabled',!_0x42a73c),this['set']('isVisible',!0x0),this['class']='ck-ai-suggestion-content-part-toolbar';const _0x59ab07=[];if(_0x42a73c){const _0x37964b=new Nt(_0xae9b87);_0x37964b['set']({'label':hs(_0xae9b87,'AI_SUGGESTION_DISABLED_TOOLTIP_MESSAGE'),'tooltip':!0x0,'withText':!0x1,'icon':_0x2f4ba7}),_0x37964b['extendTemplate']({'attributes':{'data-cke-tooltip-class':'ck-ai-suggestion-content-part-disabled-actions-tooltip'}}),_0x59ab07['push'](_0x37964b);}else{_0x470d26['includes']('applySuggestion')&&(this['_applyButton']=new Nt(_0xae9b87),this['_applyButton']['set']({'label':hs(_0xae9b87,'AI_SUGGESTION_CONTENT_PART_APPLY'),'tooltip':!0x0,'tooltipPosition':'n','withText':!0x1,'icon':_0xa10937}),this['_applyButton']['bind']('isEnabled')['to'](this),this['_applyButton']['on']('execute',()=>{this['fire']('applySuggestion');}),_0x59ab07['push'](this['_applyButton'])),_0x470d26['includes']('insertSuggestion')&&(this['_suggestButton']=new Nt(_0xae9b87),this['_suggestButton']['set']({'label':hs(_0xae9b87,'AI_SUGGESTION_CONTENT_PART_ADD_SUGGESTION'),'tooltip':!0x0,'tooltipPosition':'n','withText':!0x1,'icon':_0x3c7297}),this['_suggestButton']['bind']('isEnabled')['to'](this),this['_suggestButton']['on']('execute',()=>{this['fire']('insertSuggestion');}),_0x59ab07['push'](this['_suggestButton']));const _0x20efb1=new Nt(_0xae9b87);_0x20efb1['set']({'label':hs(_0xae9b87,'AI_SUGGESTION_CONTENT_PART_REJECT'),'tooltip':!0x0,'tooltipPosition':'n','withText':!0x1,'icon':_0x404ed0}),_0x20efb1['bind']('isEnabled')['to'](this),_0x20efb1['on']('execute',()=>{this['fire']('rejectSuggestion');}),_0x59ab07['push'](_0x20efb1);}this['items']['addMany'](_0x59ab07);const _0x56ab5e=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':[_0x56ab5e['if']('isVisible','ck-hidden',_0xde9602=>!_0xde9602)]}});}['setButtonsVisibility']({showApplyButton:_0x8cdc5d,showSuggestButton:_0x46276f}){this['_applyButton']&&(this['_applyButton']['isVisible']=_0x8cdc5d),this['_suggestButton']&&(this['_suggestButton']['isVisible']=_0x46276f);}}class gn extends vt{['toolbarView'];['stateView'];['titleLabelView'];['children'];constructor(_0x35ef36,{part:_0xee4be4,uiIndex:_0x27ff7f,availableActions:_0x48d8f1,areActionsDisabled:_0x298542}){super(_0x35ef36),this['set']('isEnabled',!0x0),this['set']('state','pending'),this['toolbarView']=new _n(_0x35ef36,_0x48d8f1,_0x298542),this['toolbarView']['on']('rejectSuggestion',()=>{this['fire']('rejectSuggestion',{'index':_0xee4be4['index']});}),this['toolbarView']['on']('insertSuggestion',()=>{this['fire']('insertSuggestion',{'index':_0xee4be4['index']});}),this['toolbarView']['on']('applySuggestion',()=>{this['fire']('applySuggestion',{'index':_0xee4be4['index']});}),this['toolbarView']['bind']('isEnabled')['to'](this),this['stateView']=new un(_0x35ef36),this['titleLabelView']=new An(_0x35ef36,_0x27ff7f),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',(_0x244ede,_0x4d3d2c,_0x1b7cd5,_0xd88de8)=>{'pending'===_0xd88de8?this['children']['remove'](this['toolbarView']):this['children']['remove'](this['stateView']),'pending'===_0x1b7cd5?this['children']['add'](this['toolbarView']):(this['stateView']['setState'](_0x1b7cd5),this['children']['add'](this['stateView']));});}}class An extends vt{constructor(_0x183ee4,_0xf738af){super(_0x183ee4),this['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai-suggestion__body__content-part__title__label']},'children':[hs(_0x183ee4,'AI_SUGGESTION_CONTENT_PART_TITLE',_0xf738af['toString']())]});}}class In extends vt{['htmlStreamer'];constructor(_0x59347e){super(_0x59347e),this['htmlStreamer']=new sn(),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-content','ck-reset_all-excluded','ck-ai-suggestion-streamable-content']}});}async['update']({part:_0x3c88f4,renderingStrategy:_0x257f6c,abortSignal:_0x304e93}){'streaming'===_0x257f6c?await this['htmlStreamer']['stream']({'document':_0x3c88f4['content'],'targetElement':this['element'],'abortSignal':_0x304e93}):_0x243921(this['element'],'<'+this['element']['tagName']+'>'+gs(_0x3c88f4['content'])+'</'+this['element']['tagName']+'>',{'childrenOnly':!0x0});}['clear'](){this['htmlStreamer']['reset'](),this['element']['innerHTML']='';}}class En extends vt{['_children'];['_headerView'];['_streamableContentView'];constructor(_0x43f22b,{part:_0x47d384,uiIndex:_0x3ef745,areActionsDisabled:_0x215c05,availableActions:_0x48ff25}){super(_0x43f22b);const _0x43d03f=this['bindTemplate'];this['set']('state','pending'),this['set']('isDone',!0x1),this['set']('isVisible',!0x1),this['set']('isActive',!0x1),this['set']('isEnabled',!0x1);const _0x391c5e=()=>{this['isEnabled']=this['isDone']&&'pending'==this['state']&&!_0x215c05;};this['on']('change:state',_0x391c5e),this['on']('change:isDone',_0x391c5e),_0x391c5e(),this['_children']=this['createCollection'](),this['_headerView']=new gn(_0x43f22b,{'part':_0x47d384,'uiIndex':_0x3ef745,'availableActions':_0x48ff25,'areActionsDisabled':_0x215c05}),this['_headerView']['bind']('isEnabled','state')['to'](this),this['_headerView']['delegate'](...Zs)['to'](this),this['_streamableContentView']=new In(_0x43f22b),this['_children']['addMany']([this['_headerView'],this['_streamableContentView']]),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__body__content-part',_0x43d03f['to']('state',_0x4ea812=>'ck-ai-suggestion__body__content-part_'+_0x4ea812),_0x43d03f['if']('isEnabled','ck-ai-suggestion__body__content-part_enabled'),_0x43d03f['if']('isActive','ck-ai-suggestion__body__content-part_active'),_0x43d03f['if']('isVisible','ck-hidden',_0xb6c0f6=>!_0xb6c0f6)]},'children':this['_children'],'on':{'mouseenter':_0x43d03f['to'](()=>{this['isEnabled']&&this['fire']('mouseOverSuggestion',{'index':_0x47d384['index']});}),'mouseleave':_0x43d03f['to'](()=>{this['isEnabled']&&this['fire']('mouseLeaveSuggestion',{'index':_0x47d384['index']});}),'click':_0x43d03f['to'](_0x648bcd=>{const _0x19dee4=_0x648bcd['target'];this['isEnabled']&&!this['_headerView']['toolbarView']['element']['contains'](_0x19dee4)&&this['fire']('showChangeInText',{'index':_0x47d384['index']});})}});}async['updateContent']({part:_0x289921,showUnchangedParts:_0x5a61b4=!0x1,abortSignal:_0x46c37b}){this['partDefinition']=_0x289921,this['isVisible']=this['partDefinition']['hasChanges']||_0x5a61b4,this['isVisible']&&await this['_streamableContentView']['update']({'part':_0x289921,'renderingStrategy':'static','abortSignal':_0x46c37b});}['markAsDone'](){this['isDone']=!0x0;}}class pn extends vt{constructor(_0x2cf0a7,_0x416dfe){super(_0x2cf0a7),this['set']('isVisible',!0x0),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-skeleton',this['bindTemplate']['if']('isVisible','ck-hidden',_0x3a390e=>!_0x3a390e)]},'children':this['_createSkeletonItems'](_0x416dfe)});}['_createSkeletonItems'](_0x190e9d){const _0x59736f=['ck','ck-ai-skeleton__item'];return _0x190e9d['map'](_0x220efd=>{let _0x317642='';switch(_0x220efd['attributes']['align']){case'right':_0x317642='margin-left:\x20auto;\x20margin-right:\x200;\x20text-align:\x20right;';break;case'center':_0x317642='margin-left:\x20auto;\x20margin-right:\x20auto;\x20text-align:\x20center;';break;case'left':_0x317642='margin-left:\x200;\x20margin-right:\x20auto;\x20text-align:\x20left;';}return{'tag':_0x220efd['tag'],'attributes':{'class':[..._0x59736f,_0x220efd['attributes']['class']?_0x220efd['attributes']['class']:''],'style':'width:\x20'+_0x220efd['attributes']['width']+';\x20height:\x20'+_0x220efd['attributes']['height']+';'+_0x317642}};});}}const mn={'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':Tn(0x5,'100%','44px','right'),'aiChatResources':Tn(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 Tn(_0x87c064,_0x5828fc,_0x592ccc,_0x233868){return new Array(_0x87c064)['fill'](null)['map'](()=>({'tag':'div','attributes':{'width':_0x5828fc,'height':_0x592ccc,'align':_0x233868}}));}class Cn extends Tt(){['queue']=[];['isProcessing']=!0x1;['_abortController'];async['enqueue'](_0x1fafbb){const _0x1a1223=this['createTask'](_0x1fafbb);return this['queue']['push'](_0x1a1223),this['_processQueue'](),_0x1a1223['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(_0x3f9ecd=>{this['once']('_queueEmpty',()=>{_0x3f9ecd();});}):Promise['resolve']();}async['_processQueue'](){if(!this['isProcessing']){this['_abortController']=new AbortController(),this['isProcessing']=!0x0;try{for(;this['queue']['length']&&this['isProcessing'];){const _0x5860aa=this['queue']['shift']();try{await _0x5860aa['callback'](this['_abortController']['signal']),_0x5860aa['resolve']();}catch(_0x5dbcd0){_0x5860aa['reject'](_0x5dbcd0);}}}finally{this['isProcessing']=!0x1,this['_abortController']=void 0x0;}this['fire']('_queueEmpty');}}['createTask'](_0x47f5ac){let _0x55cc45,_0x357b77;const _0x5d4480=new Promise((_0x3edbc6,_0x5bd924)=>{_0x55cc45=_0x3edbc6,_0x357b77=_0x5bd924;});return{'callback':_0x47f5ac,'resolve':_0x55cc45,'reject':_0x357b77,'completePromise':_0x5d4480};}}class wn extends an{constructor(_0x4a1664){super(_0x4a1664),this['extendTemplate']({'attributes':{'class':['ck-ai-notification','warning'===_0x4a1664['level']?'ck-ai-notification_warning':'ck-ai-notification_error']}});}['render'](){super['render'](),this['setContent'](this['options']['initialContent']),this['markAsDone']();}['setContent'](_0x430797){this['element']['innerHTML']=_0x430797;}}const fn=['applySuggestion','insertSuggestion'];class bn extends vt{['_applyChangesButton'];['_insertSuggestionsButton'];['children'];constructor(_0x4a88ff,_0x54b7c1=[...fn],_0x433e81){super(_0x4a88ff);const _0x167fb0=this['bindTemplate'],_0x31cb06=Boolean(_0x433e81);if(this['set']('isEnabled',!_0x31cb06),this['set']('isVisible',!0x1),this['set']('isTrackChangesOn',!0x1),this['children']=this['createCollection'](),_0x31cb06){const _0x4de508=new Nt(_0x4a88ff);_0x4de508['set']({'label':hs(_0x4a88ff,'AI_SUGGESTION_DISABLED_TOOLTIP_MESSAGE'),'tooltip':!0x0,'withText':!0x1,'icon':_0x2f4ba7}),_0x4de508['extendTemplate']({'attributes':{'data-cke-tooltip-class':'ck-ai-suggestion-content-part-disabled-actions-tooltip'}});const _0x315362=new vt(_0x4a88ff);_0x315362['setTemplate']({'tag':'div','attributes':{'class':'ck-ai-chat__feed__suggestion__actions__info'},'children':[{'tag':'p','children':[hs(_0x4a88ff,'AI_SUGGESTION_DISABLED_FEED_MESSAGE'),_0x4de508]}]}),this['children']['add'](_0x315362);}else this['_applyChangesButton']=new Nt(_0x4a88ff),this['_applyChangesButton']['set']({'label':hs(_0x4a88ff,'AI_CHAT_SUGGESTION_ACTION_APPLY_ALL'),'withText':!0x0,'type':'button','isVisible':_0x54b7c1['includes']('applySuggestion'),'class':cs}),this['_insertSuggestionsButton']=new Nt(_0x4a88ff),this['_insertSuggestionsButton']['set']({'label':hs(_0x4a88ff,'AI_CHAT_SUGGESTION_ACTION_SUGGEST_ALL'),'withText':!0x0,'type':'button','isVisible':_0x54b7c1['includes']('insertSuggestion'),'class':ls}),this['_insertSuggestionsButton']['on']('execute',()=>{this['fire']('insertSuggestion');}),this['_applyChangesButton']['on']('execute',()=>{this['fire']('applySuggestion');}),[this['_applyChangesButton'],this['_insertSuggestionsButton']]['forEach'](_0x4a614a=>{_0x4a614a['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',_0x167fb0['if']('isVisible','ck-hidden',_0x462546=>!_0x462546)]},'children':this['children']}),this['on']('change:isTrackChangesOn',()=>{this['_applyChangesButton']&&(this['_applyChangesButton']['isVisible']=!this['isTrackChangesOn']);});}['updateVisibility'](_0x924f7a){this['isVisible']=_0x924f7a;}['_switchButtonLabelsPlurality'](_0x2ae811){this['_applyChangesButton']&&this['_insertSuggestionsButton']&&(_0x2ae811?(this['_applyChangesButton']['label']=hs(this['locale'],'AI_CHAT_SUGGESTION_ACTION_APPLY_ALL'),this['_insertSuggestionsButton']['label']=hs(this['locale'],'AI_CHAT_SUGGESTION_ACTION_SUGGEST_ALL')):(this['_applyChangesButton']['label']=hs(this['locale'],'AI_CHAT_SUGGESTION_ACTION_APPLY'),this['_insertSuggestionsButton']['label']=hs(this['locale'],'AI_CHAT_SUGGESTION_ACTION_SUGGEST')));}}class Sn extends vt{['children'];['balloonPanelView'];['bodyCollection'];constructor(_0x802c89,_0x488c44){super(_0x802c89),this['bodyCollection']=_0x488c44,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',_0x3838cb=>!_0x3838cb)]},'children':this['children']});const _0x465b9c=new vt(this['locale']),_0x1b50c7=new xt();_0x1b50c7['content']=_0x4b1ef5,_0x465b9c['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-web-sources__header']},'children':[_0x1b50c7,{'tag':'span','children':[{'text':hs(this['locale'],'AI_CHAT_SOURCES_HEADER')}]}]}),this['children']['add'](_0x465b9c),this['_setupBalloonPanel'](_0x802c89);}['addSource'](_0x46ad70){this['children']['add'](new Rn(this['locale'],_0x46ad70,this['balloonPanelView']));}['_setupBalloonPanel'](_0x4945f9){this['balloonPanelView']=new Xt(_0x4945f9),this['balloonPanelView']['extendTemplate']({'attributes':{'class':['ck-ai-web-source__tooltip-balloon']}}),this['bodyCollection']['add'](this['balloonPanelView']);}}class Rn extends Nt{['balloonPanelView'];['source'];constructor(_0x41c360,_0xaca9e7,_0x10d79d){super(_0x41c360),this['source']=_0xaca9e7,this['balloonPanelView']=_0x10d79d,this['set']({'label':_0xaca9e7['title'],'class':['ck\x20ck-ai-web-source'],'withText':!0x0});const _0x2b6226=this['bindTemplate'];if(this['extendTemplate']({'on':{'click':_0x2b6226['to'](()=>{window['open'](_0xaca9e7['url'],'_blank');}),'mouseenter':_0x2b6226['to'](()=>{this['_showTooltip']();}),'mouseleave':_0x2b6226['to'](()=>{this['_hideTooltip']();})}}),_0xaca9e7['favicon']){const _0x5b0084=new vt(_0x41c360);_0x5b0084['setTemplate']({'tag':'img','attributes':{'src':_0xaca9e7['favicon']||_0x4b1ef5,'alt':_0xaca9e7['title'],'class':['ck-ai-web-source__image']}}),this['children']['add'](_0x5b0084);}else this['set']('icon',_0x4b1ef5);}['_createTooltipContentView'](_0x19e033,_0xcc398d){const _0x173232=new vt(_0x19e033),_0x7c1f6b=[];let _0x187e4f;_0xcc398d?.['favicon']?(_0x187e4f=new vt(_0x19e033),_0x187e4f['setTemplate']({'tag':'img','attributes':{'src':_0xcc398d['favicon'],'alt':_0xcc398d['title'],'class':['ck-ai-web-source__tooltip-image']}})):(_0x187e4f=new xt(),_0x187e4f['content']=_0x4b1ef5,_0x187e4f['extendTemplate']({'attributes':{'alt':_0xcc398d['title'],'class':['ck-ai-web-source__tooltip-image']}})),_0x7c1f6b['push'](_0x187e4f);const _0xdbf70=new vt(_0x19e033);_0xdbf70['setTemplate']({'tag':'a','attributes':{'class':['ck-ai-web-source__tooltip-url'],'href':_0xcc398d['url']},'children':[{'text':new URL(_0xcc398d['url'])?.['hostname']}]}),_0x7c1f6b['push'](_0xdbf70);const _0x5c3fce=new vt(_0x19e033);_0x5c3fce['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-web-source__tooltip-row']},'children':_0x7c1f6b});const _0x3c43a0=new vt(_0x19e033);return _0x3c43a0['setTemplate']({'tag':'span','attributes':{'class':['ck-ai-web-source__tooltip-row','ck-ai-web-source__tooltip-title']},'children':[{'text':_0xcc398d['title']['length']>0x190?_0xcc398d['title']['substring'](0x0,0x190)+'...':_0xcc398d['title']}]}),_0x173232['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-web-source__tooltip']},'children':[_0x5c3fce,_0x3c43a0]}),_0x173232;}['_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 _0x4318e7=this['_createTooltipContentView'](this['locale'],this['source']);this['balloonPanelView']['content']['add'](_0x4318e7);}}class On extends vt{['_actionsView'];['_sourcesView'];['_children'];['_skeletonView'];['_showSkeletonDebounced']=_0x3b5df9(()=>{this['_skeletonView']['isVisible']=!0x0,this['_skeletonShownAt']=Date['now']();},0x3e8);['_skeletonShownAt']=null;['_areActionsDisabled'];['_showUnchangedParts'];['_updateContentPartsPromiseQueue'];['_emptyPartsWarningView'];['_availableActions'];['_cachedContentParts']=[];constructor(_0x533af0,_0x40f0c2){super(_0x533af0);const {areActionsDisabled:_0xa0b13b,showUnchangedParts:_0x5bdadd,availableActions:_0x5a7b7c}=_0x40f0c2;this['_areActionsDisabled']=_0xa0b13b,this['_showUnchangedParts']=_0x5bdadd,this['_availableActions']=_0x5a7b7c,this['set']('hasPendingParts',!0x1),this['set']('isTrackChangesOn',!0x1),this['_children']=this['createCollection'](),this['_skeletonView']=new pn(_0x533af0,mn['aiSuggestionBody']),this['_skeletonView']['isVisible']=!0x0,this['_skeletonShownAt']=Date['now'](),this['_children']['add'](this['_skeletonView']),this['_updateContentPartsPromiseQueue']=new Cn(),this['_emptyPartsWarningView']=new wn({'id':'empty-parts-warning','initialContent':hs(_0x533af0,'AI_SUGGESTION_EMPTY_PART_WARNING'),'level':'warning'}),this['_emptyPartsWarningView']['isVisible']=!0x1,this['_actionsView']=new bn(_0x533af0,_0x40f0c2['availableActions'],this['_areActionsDisabled']),this['_actionsView']['bind']('isTrackChangesOn')['to'](this),this['_sourcesView']=new Sn(this['locale'],_0x40f0c2['bodyCollection']),_0x40f0c2['areActionsDisabled']?this['_actionsView']['isEnabled']=!0x1:this['_actionsView']['bind']('isEnabled')['to'](this,'hasPendingParts'),this['_actionsView']['delegate'](...Zs)['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'](_0x319903=>_0x319903 instanceof En);}async['updateContentParts']({parts:_0x2915f1,abortSignal:_0x54068c,skipLoadingEffects:_0x59fd26}){this['_cachedContentParts']['length']?_0x2915f1['forEach'](_0x2154e8=>{const _0x6156be=this['_cachedContentParts']['findIndex'](_0x507bc9=>_0x507bc9['index']==_0x2154e8['index']);-0x1===_0x6156be?this['_cachedContentParts']['push'](_0x2154e8):this['_cachedContentParts'][_0x6156be]=_0x2154e8;}):this['_cachedContentParts']=_0x2915f1;const _0x2c6f81=this['_showUnchangedParts']?_0x2915f1:_0x2915f1['filter'](_0x27e296=>_0x27e296['hasChanges']);this['_actionsView']['_switchButtonLabelsPlurality'](_0x2c6f81['length']>0x1),_0x59fd26&&(this['_showSkeletonDebounced']['cancel'](),this['_skeletonView']['isVisible']=!0x1);for(const _0x3f71f7 of _0x2c6f81)this['_updateContentPartsPromiseQueue']['enqueue'](async _0x14980e=>{let _0x1599d4=this['getPartView'](_0x3f71f7['index']);if(!_0x1599d4){if(_0x1599d4=new En(this['locale'],{'part':_0x3f71f7,'uiIndex':this['_contentPartViews']['length']+0x1,'areActionsDisabled':this['_areActionsDisabled'],'availableActions':this['_availableActions']}),_0x1599d4['delegate'](...Zs)['to'](this),!_0x59fd26&&(this['_showSkeletonDebounced']['cancel'](),await this['_awaitMinimumSkeletonDisplayTime'](_0x14980e),_0x14980e['aborted']))return;this['_skeletonView']['isVisible']=!0x1,this['_children']['add'](_0x1599d4,this['_children']['length']-0x1),this['hasPendingParts']=!0x0,_0x59fd26||this['_showSkeletonDebounced']();}await _0x1599d4['updateContent']({'part':_0x3f71f7,'showUnchangedParts':this['_showUnchangedParts'],'abortSignal':_0x14980e}),_0x1599d4['markAsDone']();});return _0x54068c?.['addEventListener']('abort',()=>{this['_updateContentPartsPromiseQueue']['abort'](),this['_showSkeletonDebounced']['cancel'](),this['_skeletonView']['isVisible']=!0x1;}),this['_updateContentPartsPromiseQueue']['queueEmptyPromise'];}['updatePartState'](_0x186f01,_0x53320f){const _0x43d459=this['getPartView'](_0x186f01);_0x43d459&&(_0x43d459['state']=_0x53320f),this['hasPendingParts']='pending'==_0x53320f||this['_contentPartViews']['some'](_0x2c9f78=>'pending'==_0x2c9f78['state']);}['setPartActive'](_0x10577e,_0x28f8a8){if(!0x1===_0x10577e){for(const _0x5ace44 of this['_contentPartViews'])_0x5ace44['isActive']=!0x1;}else{const _0x202d49=this['getPartView'](_0x10577e);_0x202d49&&(_0x202d49['isActive']=_0x28f8a8);}}['updateSources'](_0x87c65){_0x87c65['forEach'](_0x235422=>this['_sourcesView']['addSource'](_0x235422)),this['_sourcesView']['isVisible']=!0x0;}['getPartView'](_0x4b04ca){return this['_contentPartViews']['find'](_0x47ffb0=>_0x47ffb0['partDefinition']['index']==_0x4b04ca)??null;}['markAsDone'](){if(!this['_showUnchangedParts']){const _0x55e7c7=!this['_cachedContentParts']['find'](({hasChanges:_0xf15de6})=>_0xf15de6),_0x5a8029=!!this['_cachedContentParts']['find'](({hasChanges:_0x1d3b15})=>!_0x1d3b15);this['_emptyPartsWarningView']['isVisible']=0x0==this['_contentPartViews']['length']||_0x5a8029,_0x55e7c7?this['_emptyPartsWarningView']['setContent'](hs(this['locale'],'AI_SUGGESTION_NO_PARTS_WARNING')):this['_emptyPartsWarningView']['setContent'](hs(this['locale'],'AI_SUGGESTION_EMPTY_PART_WARNING'));}this['_contentPartViews']['forEach'](_0x440bc2=>_0x440bc2['markAsDone']()),this['_skeletonView']['isVisible']=!0x1,this['_showSkeletonDebounced']['cancel'](),this['_actionsView']['updateVisibility'](this['hasNonEmptyParts']);}async['_awaitMinimumSkeletonDisplayTime'](_0x304584){if(!this['_skeletonView']['isVisible']||null===this['_skeletonShownAt'])return;const _0x200f3e=0x3e8-(Date['now']()-this['_skeletonShownAt']);if(this['_skeletonShownAt']=null,_0x200f3e>0x0){const {promise:_0x3676f6,abortController:_0x50b679}=en(_0x200f3e);_0x304584?.['addEventListener']('abort',()=>_0x50b679['abort']()),await _0x3676f6['catch'](()=>{});}}get['hasNonEmptyParts'](){return this['_contentPartViews']['filter'](_0x8d1d08=>_0x8d1d08['partDefinition']['hasChanges'])['length']>0x0;}}class kn extends vt{['bodyView'];['children'];['headerView'];constructor(_0x345fda,_0x5ed7ff,_0x26f00f){super(_0x345fda);const {showDiff:_0x3052dd,areActionsDisabled:_0x66b065,showUnchangedParts:_0x95ad2c,availableActions:_0x46dcc4}=_0x5ed7ff;this['set']('isTrackChangesOn',!0x1),this['set']('areChangesVisible',!0x1),this['children']=this['createCollection'](),this['headerView']=new hn(_0x345fda,{'showDiff':_0x3052dd}),this['headerView']['on']('toggleShowChanges',(_0x4a7eee,_0x2b63dd)=>{this['areChangesVisible']=_0x2b63dd['isOn'],this['fire']('toggleSuggestionDisplayMode',{'showDiff':_0x2b63dd['isOn']});}),this['children']['add'](this['headerView']),this['bodyView']=new On(_0x345fda,{'areActionsDisabled':_0x66b065,'showUnchangedParts':!!_0x95ad2c,'availableActions':_0x46dcc4,'bodyCollection':_0x26f00f}),this['bodyView']['delegate'](...Zs)['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'](_0x43e5c7){await this['bodyView']['updateContentParts'](_0x43e5c7);}['updateSources'](_0x4e4ca5){this['bodyView']['updateSources'](_0x4e4ca5);}['markAsDone'](){this['bodyView']['markAsDone'](),this['headerView']&&(this['headerView']['isShowChangesToggleVisible']=this['bodyView']['hasNonEmptyParts']);}}class Nn extends an{['containerView'];constructor(_0x376511,_0x3ed2d8,_0x5e2d9c){super(_0x3ed2d8),this['set']('isTrackChangesOn',!0x1),this['containerView']=new kn(_0x376511,{'showDiff':_0x3ed2d8['showDiff'],'areActionsDisabled':_0x3ed2d8['areActionsDisabled'],'availableActions':_0x3ed2d8['availableActions']},_0x5e2d9c),this['containerView']['on']('toggleSuggestionDisplayMode',(_0x4353d8,_0x509cf2)=>{this['fire']('toggleSuggestionDisplayMode',{'replyId':this['options']['id'],'showDiff':_0x509cf2['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',(_0x223d0e,{index:_0x19f00d})=>{this['fire']('showChangeInText',{'replyId':this['options']['id'],'partIndex':_0x19f00d});}),this['containerView']['on']('applySuggestion',(_0x559861,{index:_0x2f7bfb}={})=>{this['fire']('applySuggestion',{'replyId':this['options']['id'],'partIndex':_0x2f7bfb});}),this['containerView']['on']('insertSuggestion',(_0x3fdd78,{index:_0x554ed4}={})=>{this['fire']('insertSuggestion',{'replyId':this['options']['id'],'partIndex':_0x554ed4});}),this['containerView']['on']('rejectSuggestion',(_0x1d486f,{index:_0x4cc371})=>{this['fire']('rejectSuggestion',{'replyId':this['options']['id'],'partIndex':_0x4cc371});}),this['containerView']['on']('mouseOverSuggestion',(_0x36cdf9,{index:_0x20d9d4})=>{this['fire']('mouseOverSuggestion',{'replyId':this['options']['id'],'partIndex':_0x20d9d4});}),this['containerView']['on']('mouseLeaveSuggestion',(_0x58254c,{index:_0x400192})=>{this['fire']('mouseLeaveSuggestion',{'replyId':this['options']['id'],'partIndex':_0x400192});}),this['children']['addMany']([this['containerView']]),this['extendTemplate']({'attributes':{'class':['ck-ai-chat__feed__ai-suggestion']}});}async['updateContent'](_0x52115c){await this['containerView']['updateContent'](_0x52115c);}['updatePartState'](_0x4cf86e,_0x3ea8f6){this['containerView']['bodyView']['updatePartState'](_0x4cf86e,_0x3ea8f6);}['setPartActive'](_0x20eeba,_0xe0b7e7){!0x1===_0x20eeba?this['containerView']['bodyView']['setPartActive'](!0x1):this['containerView']['bodyView']['setPartActive'](_0x20eeba,_0xe0b7e7);}['updateSources'](_0x55fc8d){this['containerView']['updateSources'](_0x55fc8d);}['getPartView'](_0x321e28){return this['containerView']['bodyView']['getPartView'](_0x321e28);}['markAsDone'](){super['markAsDone'](),this['containerView']['markAsDone']();}}class vn extends an{['replyContainer'];['_bodyCollection'];constructor(_0x4355f6,_0x140331,_0x37b62b){super(_0x140331),this['_bodyCollection']=_0x37b62b,this['locale']=_0x4355f6,this['extendTemplate']({'attributes':{'class':['ck-ai-chat__feed__ai-reply']}}),this['replyContainer']=new vt(),this['replyContainer']['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset_all-excluded','ck-ai-chat__feed__ai-reply-container']}}),this['children']['add'](this['replyContainer']);}async['render'](){super['render'](),this['options']['initialContent']&&(await this['updateContent']({'parsedContent':_s(this['options']['initialContent']),'renderingStrategy':'static'}),this['markAsDone']());}async['updateContent']({parsedContent:_0x16f86b,renderingStrategy:_0x26dc80,abortSignal:_0x256509}){'streaming'===_0x26dc80?await this['streamIntoElement'](_0x16f86b,this['replyContainer']['element'],_0x256509):this['replyContainer']['element']['innerHTML']=ti(_0x16f86b);}['updateSources'](_0x3337de){const _0x2038cc=new Sn(this['locale'],this['_bodyCollection']);_0x2038cc['children']['addMany'](_0x3337de['map'](_0x51a309=>new Rn(this['locale'],_0x51a309,_0x2038cc['balloonPanelView']))),_0x2038cc['isVisible']=!0x0,this['children']['add'](_0x2038cc);}}class yn extends yt{constructor(_0x4c491a=void 0x0){super();const _0x10fa92=_0x4c491a?'ck-ai-spinner_'+_0x4c491a:'';this['extendTemplate']({'tag':'span','attributes':{'class':['ck-ai-spinner',_0x10fa92]}});}}const xn={'file':_0x36ddaf,'document':_0x386a1,'web-resource':_0x3a2322,'text':_0x36ddaf,'selection':_0x5d4805,'mcp-tool-context':_0x386a1},Ln='ck-ai-chat-context-chip',Dn='ck-ai-chat-context-chip_wide',Pn='ck-ai-chat-context-chip_document',Hn='ck-ai-chat-context-chip__label',Mn='ck-ai-chat-context-chip__type-icon',Un='ck-ai-chat-context-controls__chip-tooltip',Vn='n';class Bn extends Nt{constructor(_0x58e216,_0x443de4,_0x3b7ec0,_0x2b5ed1,_0x3f1308=!0x1){super(_0x58e216),this['_isAnimationOnEnterEnabled']=_0x2b5ed1,this['_initializeProperties'](_0x443de4,_0x3b7ec0,_0x3f1308),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'](_0xe0b730,_0x224efb,_0xd7dfe0){this['set']('label',_0xe0b730['label']),this['set']('tooltip',!0x0),this['set']('itemType',_0xe0b730['type']),this['set']('id',_0xe0b730['uiId']),this['set']('readonly',_0x224efb),this['set']('isLoading',_0xd7dfe0);}['_setupTemplate'](){const _0x42bbf7=this['_createIconView'](),_0x3d0b4e=this['_createRemoveButton'](),_0x318ea8=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':this['_createTemplateAttributes'](_0x318ea8),'children':this['_createTemplateChildren'](_0x42bbf7,_0x3d0b4e,_0x318ea8)});}['_createTemplateAttributes'](_0x779508){return{'class':[Ln,_0x779508['if']('itemType',Pn,_0x102e39=>'document'==_0x102e39),_0x779508['if']('itemType',Dn,_0x43f9eb=>'selection'==_0x43f9eb)],'data-cke-tooltip-text':_0x779508['to']('label',Gn),'data-cke-tooltip-position':Vn,'data-cke-tooltip-class':Un};}['_createTemplateChildren'](_0x130d83,_0x193c43,_0x23b0f4){const _0x259a24=this['_createLabelElement'](_0x23b0f4),_0x2de0c8=this['_createLoaderIcon']();return this['readonly']?[_0x130d83,_0x259a24]:[_0x130d83,_0x2de0c8,_0x259a24,_0x193c43];}['_createLabelElement'](_0x183028){return{'tag':'span','attributes':{'class':Hn},'children':[{'text':_0x183028['to']('label')}]};}['_createRemoveButton'](){const _0x328630=new Nt(this['locale']);return _0x328630['set']({'label':hs(this['locale'],'AI_CHAT_CONTEXT_REMOVE_FROM_CONTEXT'),'icon':_0x104621}),this['_setupRemoveButtonEvent'](_0x328630),_0x328630;}['_setupRemoveButtonEvent'](_0x2a44fc){_0x2a44fc['on']('execute',()=>{this['fire']('removeContextItemChip',this['id']);});}['_createIconView'](){const _0x47c54d=this['bindTemplate'],_0xb52fdb=new xt();return _0xb52fdb['content']=xn[this['itemType']],_0xb52fdb['extendTemplate']({'attributes':{'class':[Mn,_0x47c54d['if']('isLoading','ck-hidden',_0xaafabc=>_0xaafabc)]}}),_0xb52fdb;}['_handleAnimationEndOnce'](_0x744f75,_0x442111){if(!_0x744f75)return;const _0x69ceec=()=>{_0x442111(),_0x744f75['removeEventListener']('animationend',_0x69ceec),_0x744f75['removeEventListener']('webkitAnimationEnd',_0x69ceec);};_0x744f75['addEventListener']('animationend',_0x69ceec),_0x744f75['addEventListener']('webkitAnimationEnd',_0x69ceec);}['_createLoaderIcon'](){const _0x2944ba=new yn('small');return _0x2944ba['bind']('isVisible')['to'](this,'isLoading',_0x175054=>_0x175054),_0x2944ba;}}function Gn(_0xa34391){if(!_0xa34391)return _0xa34391;if(_0xa34391['length']<=0x78)return _0xa34391;const _0xf137d6=_0xa34391['slice'](0x0,0x78),_0x1f2ad9=_0xf137d6['lastIndexOf']('\x20');return(_0x1f2ad9>0x0?_0xf137d6['slice'](0x0,_0x1f2ad9):_0xf137d6)+'…';}const Fn={'maxVisibleRows':0x2,'rowDetectionTolerance':0x5,'showMoreLabelPrefix':'+\x20','viewportOffset':{'top':0x64,'bottom':0xa}},Kn='300px';class Wn{['_locale'];['_config'];['_visibleChips'];['_overflowChips'];['_showMoreButtonView']=null;['_showMoreBalloonPanelView']=null;['_containerElement']=null;['_bodyCollection'];['_parentView']=null;['_intersectionObserver']=null;['_pendingCalculation']=!0x1;constructor(_0x5c3ef7,_0x1af2d6,_0x204e9f,_0x4d5d70,_0x2c3643){this['_locale']=_0x5c3ef7,this['_visibleChips']=_0x1af2d6,this['_config']={...Fn,..._0x204e9f,'cssClasses':{'controlsButton':'','calculationContainer':'ck-calculation-container',..._0x204e9f['cssClasses']}},this['_overflowChips']=new dt(),this['_bodyCollection']=_0x4d5d70,this['_parentView']=_0x2c3643||null;}['setContainerElement'](_0x3b2816){this['_intersectionObserver']&&(this['_intersectionObserver']['disconnect'](),this['_intersectionObserver']=null),this['_containerElement']=_0x3b2816,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 _0x55a1a0=[...this['_visibleChips'],...this['_overflowChips']],_0x46c440=this['_createCalculationContainer'](),_0x8e976=this['_calculateOverflowInContainer'](_0x46c440,_0x55a1a0),_0x5c4eeb=_0x46c440['_ancestorsToRestore'];_0x5c4eeb&&this['_restoreAncestorVisibility'](_0x5c4eeb),_0x46c440['remove'](),this['_applyOverflowResults'](_0x55a1a0,_0x8e976);}['_createShowMoreButton'](){this['_showMoreButtonView']=this['_createShowMoreButtonView'](),this['_showMoreBalloonPanelView']=this['_createShowMoreBalloonPanelView'](),this['_showMoreButtonView']['render'](),this['_containerElement']['appendChild'](this['_showMoreButtonView']['element']),this['_showMoreButtonView']['on']('execute',()=>{this['_handleShowMoreButtonClick']();}),zt({'emitter':this['_showMoreBalloonPanelView'],'contextElements':[this['_showMoreBalloonPanelView']['element'],this['_showMoreButtonView']['element']],'callback':()=>this['hideBalloonPanel'](),'activator':()=>this['_showMoreButtonView']['isOn']});}['_createShowMoreButtonView'](){const _0x151b30=new Nt(this['_locale']);_0x151b30['set']({'label':'','withText':!0x0,'isToggleable':!0x0});const _0x11c1b6=[this['_config']['cssClasses']['showMoreButton']];return this['_config']['cssClasses']['controlsButton']&&_0x11c1b6['push'](this['_config']['cssClasses']['controlsButton']),_0x151b30['extendTemplate']({'attributes':{'class':_0x11c1b6}}),_0x151b30;}['_createShowMoreBalloonPanelView'](){const _0x130990=new Xt(this['_locale']);return _0x130990['extendTemplate']({'attributes':{'class':this['_config']['cssClasses']['showMoreBalloon']}}),this['_bodyCollection']['add'](_0x130990),_0x130990;}['_updateBalloonContent'](){if(this['_showMoreBalloonPanelView']&&(this['_showMoreBalloonPanelView']['content']['clear'](),this['_overflowChips']['length']>0x0)){this['_overflowChips']['forEach'](_0x32e677=>{_0x32e677['disableAnimationOnEnter']();});const _0x1050bb=new vt(this['_locale']);_0x1050bb['setTemplate']({'tag':'div','attributes':{'class':this['_config']['cssClasses']['overflowContainer']},'children':this['_overflowChips']}),this['_showMoreBalloonPanelView']['content']['add'](_0x1050bb);}}['_handleShowMoreButtonClick'](){this['_showMoreButtonView']['isOn']?this['hideBalloonPanel']():this['showBalloonPanel']();}['_updateShowMoreButtonVisibility'](){const _0x3f5127=this['_overflowChips']['length']>0x0;this['_showMoreButtonView']?.['element']&&(this['_showMoreButtonView']['element']['style']['display']=_0x3f5127?'':'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'](_0x55b8bf){const _0x104ce9=this['_containerElement']?.['tagName']['toLowerCase']()||'div',_0x1b17f2=this['_containerElement']?.['classList'];if(_0x1b17f2){const _0x492872=_0x1b17f2[0x0]||'',_0x51d4c3=_0x55b8bf['querySelector']('.'+_0x492872),_0x68558f=_0x55b8bf['querySelector'](_0x104ce9);return _0x51d4c3||_0x68558f||_0x55b8bf;}return _0x55b8bf['querySelector'](_0x104ce9)||_0x55b8bf;}['_calculateContainerWidth'](){const _0x4b48a9=this['_parentView']?.['element']||this['_containerElement'];if(!_0x4b48a9)return Kn;const _0x11f2a9=window['getComputedStyle'](_0x4b48a9)['width'];if('auto'===_0x11f2a9||'0px'===_0x11f2a9||!_0x11f2a9){const _0x3660fc=_0x4b48a9['parentElement'];if(_0x3660fc){const _0x421ec4=window['getComputedStyle'](_0x3660fc);return'auto'!==_0x421ec4['width']?_0x421ec4['width']:Kn;}return Kn;}return _0x11f2a9;}['_applyCalculationStyles'](_0x28af0b,_0x2403f1){this['_config']['cssClasses']['calculationContainer']&&_0x28af0b['classList']['add'](this['_config']['cssClasses']['calculationContainer']),_0x28af0b['style']['width']=_0x2403f1,_0x28af0b['style']['position']='absolute',_0x28af0b['style']['top']='-9999px',_0x28af0b['style']['left']='-9999px',_0x28af0b['style']['opacity']='0',_0x28af0b['style']['pointerEvents']='none',_0x28af0b['style']['zIndex']='-1',_0x28af0b['style']['visibility']='visible\x20!important',_0x28af0b['style']['display']='block\x20!important',_0x28af0b['style']['boxSizing']='border-box';}['_restoreAncestorVisibility'](_0x103a66){_0x103a66['forEach'](({element:_0x173efc,originalDisplay:_0x11ed9f,originalVisibility:_0x344075})=>{_0x173efc['style']['display']=_0x11ed9f,_0x173efc['style']['visibility']=_0x344075;});}['_makeAncestorsVisible'](_0x5450d7){const _0x2906e9=[];let _0x581f1d=_0x5450d7;for(;_0x581f1d&&_0x581f1d!==document['body'];){const _0x27e365=window['getComputedStyle'](_0x581f1d);'none'!==_0x27e365['display']&&'hidden'!==_0x27e365['visibility']||(_0x2906e9['push']({'element':_0x581f1d,'originalDisplay':_0x581f1d['style']['display'],'originalVisibility':_0x581f1d['style']['visibility']}),_0x581f1d['style']['display']='block',_0x581f1d['style']['visibility']='visible'),_0x581f1d=_0x581f1d['parentElement'];}return _0x2906e9;}['_createContainerElements'](){let _0x55db8f,_0x1d2075;return this['_parentView']?.['element']?(_0x55db8f=this['_parentView']['element']['cloneNode'](!0x0),_0x1d2075=this['_findTargetContainer'](_0x55db8f)):(_0x55db8f=document['createElement']('div'),_0x1d2075=_0x55db8f),{'calculationContainer':_0x55db8f,'targetContainer':_0x1d2075};}['_createCalculationContainer'](){const {calculationContainer:_0x16c20e,targetContainer:_0x4f8998}=this['_createContainerElements'](),_0x87971d=this['_calculateContainerWidth']();this['_applyCalculationStyles'](_0x16c20e,_0x87971d);const _0x298485=this['_parentView']?.['element']||this['_containerElement'],_0x453eab=_0x298485?.['parentElement'];_0x453eab?_0x453eab['appendChild'](_0x16c20e):document['body']['appendChild'](_0x16c20e),_0x16c20e['_targetContainer']=_0x4f8998;const _0x5cf049=this['_makeAncestorsVisible'](_0x453eab||null);return _0x16c20e['offsetWidth'],_0x16c20e['_ancestorsToRestore']=_0x5cf049,_0x16c20e;}['_calculateOverflowInContainer'](_0x2f9a2d,_0x285bc3){const _0x226590=_0x2f9a2d['_targetContainer']||_0x2f9a2d,_0xf34c2a=[],{rowCount:_0xa156e5}=this['_renderChipsAndCountRows'](_0x226590,_0x285bc3);if(_0xa156e5<=this['_config']['maxVisibleRows'])return _0xf34c2a;const _0x359f28=_0x285bc3['slice']();for(;_0x359f28['length']>0x0;){if(this['_testButtonFit'](_0x2f9a2d,_0x226590,_0x359f28)){const _0x375771=_0x285bc3['filter'](_0x516d43=>!_0x359f28['includes'](_0x516d43));_0xf34c2a['push'](..._0x375771);break;}if(!_0x359f28['pop']())break;}return _0xf34c2a;}['_renderChipsAndCountRows'](_0x47cab3,_0x5ceee2){_0x47cab3['innerHTML']='',_0x5ceee2['forEach'](_0x39f4b3=>{if(_0x39f4b3['element']){const _0x5992ce=_0x39f4b3['element']['cloneNode'](!0x0);_0x47cab3['appendChild'](_0x5992ce);}}),_0x47cab3['offsetWidth'];const _0x22e20c=_0x47cab3['children'],_0x2fdc06=[];return Array['from'](_0x22e20c)['forEach'](_0xb4a1a0=>{const _0x47ab16=_0xb4a1a0['getBoundingClientRect']()['top'];_0x2fdc06['some'](_0x2bfff5=>Math['abs'](_0x2bfff5-_0x47ab16)<this['_config']['rowDetectionTolerance'])||_0x2fdc06['push'](_0x47ab16);}),{'rowCount':_0x2fdc06['length']};}['_createMockButton'](){const _0x80e41a=document['createElement']('button');return _0x80e41a['className']=this['_config']['cssClasses']['showMoreButton'],this['_config']['cssClasses']['controlsButton']&&_0x80e41a['classList']['add'](this['_config']['cssClasses']['controlsButton']),_0x80e41a['textContent']='+\x201',_0x80e41a;}['_testButtonFit'](_0x55ca1a,_0x388fb3,_0x51d5a6){this['_renderChipsAndCountRows'](_0x388fb3,_0x51d5a6);const _0x50584b=this['_createMockButton']();_0x55ca1a['appendChild'](_0x50584b),_0x55ca1a['offsetWidth'];const _0x213860=[..._0x388fb3['children'],_0x50584b],_0x33d2ce=[];_0x213860['forEach'](_0x1c1318=>{const _0x4de0a7=_0x1c1318['getBoundingClientRect']()['top'];_0x33d2ce['some'](_0x2f8bf7=>Math['abs'](_0x2f8bf7-_0x4de0a7)<this['_config']['rowDetectionTolerance'])||_0x33d2ce['push'](_0x4de0a7);});const _0x526da3=_0x33d2ce['length'];return _0x50584b['remove'](),_0x526da3<=this['_config']['maxVisibleRows'];}['_distributeChips'](_0x13374a,_0x1144ef){this['_visibleChips']['clear'](),this['_overflowChips']['clear'](),_0x13374a['forEach'](_0x5579d0=>{_0x1144ef['includes'](_0x5579d0)?this['_overflowChips']['add'](_0x5579d0):this['_visibleChips']['add'](_0x5579d0);});}['_updateOverflowUI'](_0x57c8b6){if(_0x57c8b6>0x0&&!this['_showMoreButtonView']&&this['_createShowMoreButton'](),_0x57c8b6>0x0&&this['_showMoreButtonView']){const _0x3a62b6=''+this['_config']['showMoreLabelPrefix']+(_0x57c8b6<0x63?_0x57c8b6:'99');this['_showMoreButtonView']['label']=_0x3a62b6;}this['_updateBalloonContent'](),this['_updateShowMoreButtonVisibility'](),this['_repinBalloonPanel']();}['_applyOverflowResults'](_0x1d2c3e,_0xcd108b){this['_distributeChips'](_0x1d2c3e,_0xcd108b),this['_updateOverflowUI'](_0xcd108b['length']);}['_setupVisibilityObserver'](){this['_containerElement']&&'undefined'!=typeof IntersectionObserver&&(this['_intersectionObserver']=new IntersectionObserver(_0x2b9afe=>{_0x2b9afe[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 _0x323af4=this['_containerElement']['getBoundingClientRect']();if(0x0===_0x323af4['width']||0x0===_0x323af4['height'])return!0x1;const _0x541f4a=window['innerHeight']||document['documentElement']['clientHeight'],_0x51e007=window['innerWidth']||document['documentElement']['clientWidth'],_0x3251ae=0xc8;return _0x323af4['bottom']>=-0xc8&&_0x323af4['top']<=_0x541f4a+_0x3251ae&&_0x323af4['right']>=-0xc8&&_0x323af4['left']<=_0x51e007+_0x3251ae;}}const Yn='ck-ai-chat__feed__context-chips',$n='ck-ai-chat-context-chips-wrapper',qn='ck-ai-chat-context-chips-wrapper-balloon',Qn='ck-ai-chat-controls-button',Xn='ck-ai-chat-controls_context_show-more-button',zn='ck-ai-chat-context-controls__show-more-balloon-panel';class jn extends vt{['_contextChips']=this['createCollection']();['_overflowManager'];['_bodyCollection'];constructor(_0x4ed35f,_0x18b413,_0x59c218){super(_0x4ed35f),this['_bodyCollection']=_0x59c218,this['_createContextChips'](_0x18b413);const _0x1215dc={'cssClasses':{'showMoreButton':Xn+'\x20'+us,'showMoreBalloon':zn,'overflowContainer':qn,'controlsButton':Qn}};this['_overflowManager']=new Wn(_0x4ed35f,this['_contextChips'],_0x1215dc,this['_bodyCollection'],this),this['setTemplate']({'tag':'div','attributes':{'class':[Yn,'ck','ck-reset_all']},'children':[{'tag':'div','attributes':{'class':$n},'children':this['_contextChips']}]});}['render'](){super['render']();const _0x161b4d=this['element']['querySelector']('.'+$n);_0x161b4d&&(this['_overflowManager']['setContainerElement'](_0x161b4d),this['_overflowManager']['reorganizeChips']());}['destroy'](){super['destroy'](),this['_overflowManager']['destroy']();}['_createContextChips'](_0x217d00){for(const _0x40bb00 of _0x217d00){const _0x49f291=new Bn(this['locale'],_0x40bb00,!0x0,!0x1);this['_contextChips']['add'](_0x49f291);}}}class Jn extends an{['_contextChipsView']=null;['_locale'];['_bodyCollection'];['_messageContentView'];constructor(_0x23d090,_0x4bbf6d,_0x2d01e8){super(_0x4bbf6d),this['_locale']=_0x23d090,this['_bodyCollection']=_0x2d01e8,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 jn(this['_locale'],this['options']['contextItems']['filter'](_0x3a5f3b=>!_0x3a5f3b['hidden']),this['_bodyCollection']),this['_contextChipsView']['extendTemplate']({'attributes':{'class':'ck-ai-chat__feed__context-chips'}}),this['children']['add'](this['_contextChipsView']));}['_createMessageContentView'](){this['_messageContentView']=new vt(this['_locale']),this['_messageContentView']['setTemplate']({'tag':'div','attributes':{'class':'ck-ai-chat__feed__message-content'}}),this['children']['add'](this['_messageContentView']);}['render'](){super['render'](),this['_messageContentView']['element']['innerHTML']=this['options']['initialContent'],this['markAsDone']();}}class Zn extends an{['capabilities'];constructor(_0x25e3e4,_0x45e643){super(_0x45e643);const {isWebSearchEnabled:_0x2ccc29,isReasoningEnabled:_0x537607}=_0x45e643['capabilities'],_0x5b6ba3=[];let _0x29cf15='';_0x2ccc29&&_0x537607?(_0x29cf15=hs(_0x25e3e4,'AI_CHAT_FEED_REPLY_ITEM_USED_WEB_SEARCH_REASONING'),_0x5b6ba3['push'](tr(_0x4b1ef5)),_0x5b6ba3['push'](tr(_0x3f94ae))):_0x2ccc29?(_0x29cf15=hs(_0x25e3e4,'AI_CHAT_FEED_REPLY_ITEM_USED_WEB_SEARCH'),_0x5b6ba3['push'](tr(_0x4b1ef5))):_0x537607&&(_0x29cf15=hs(_0x25e3e4,'AI_CHAT_FEED_REPLY_ITEM_USED_REASONING'),_0x5b6ba3['push'](tr(_0x3f94ae))),this['extendTemplate']({'attributes':{'class':['ck-ai-chat__feed__interaction-header',_0x29cf15?'':'ck-hidden']}});const _0x881f2a=new vt();_0x881f2a['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed__interaction-header__capabilities']},'children':[..._0x5b6ba3,{'tag':'span','attributes':{'class':['ck-ai-chat__feed__interaction-header__capabilities__text']},'children':[_0x29cf15]}]}),this['children']['add'](_0x881f2a),this['capabilities']=_0x45e643['capabilities'];}}function tr(_0x59be4d){const _0x57e0c4=new xt();return _0x57e0c4['content']=_0x59be4d,_0x57e0c4;}const er=['wheel','touchstart','pointerdown','keydown'],ir=['ArrowUp','ArrowDown','PageUp','PageDown','Home','End','\x20'];class sr{['element'];['animationFrameId'];['isRunning'];['abortController'];['isUserPaused'];['scrollBehavior'];constructor(_0x2963c9){this['element']=_0x2963c9,this['animationFrameId']=null,this['isRunning']=!0x1,this['abortController']=new AbortController(),this['isUserPaused']=!0x1,this['scrollBehavior']='smooth';for(const _0x4ed09d of er){const _0x2011c6='keydown'!==_0x4ed09d;this['element']['addEventListener'](_0x4ed09d,this['_onUserEvent']['bind'](this),{'passive':_0x2011c6,'signal':this['abortController']['signal']});}}['start']({smooth:_0x4a9a3c=!0x0}={}){this['isRunning']||(this['isRunning']=!0x0,this['isUserPaused']=!0x1,this['scrollBehavior']=_0x4a9a3c?'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'](_0x204224){if(this['isRunning']){if('keydown'===_0x204224['type']){const _0x478425=_0x204224['key'];if(!ir['includes'](_0x478425))return;}_0x204224 instanceof WheelEvent?_0x204224['deltaY']<0x0?this['isUserPaused']=!0x0:this['isUserPaused']=!this['_isAtBottom']():this['isUserPaused']=!0x0;}}['_isAtBottom'](){const {scrollTop:_0x522092,scrollHeight:_0x1e0601,clientHeight:_0x1563a4}=this['element'];return _0x1e0601-_0x522092-_0x1563a4<=0x5;}['_rafUpdate'](){this['isRunning']&&(this['isUserPaused']||this['element']['scrollTo']({'top':this['element']['scrollHeight'],'behavior':this['scrollBehavior']}),this['animationFrameId']=requestAnimationFrame(this['_rafUpdate']['bind'](this)));}}class nr extends an{constructor(_0x1ee807){super(_0x1ee807),this['extendTemplate']({'attributes':{'class':['ck-ai-chat__feed__custom-element']}});}async['render'](){super['render'](),'string'==typeof this['options']['content']?this['element']['innerHTML']=this['options']['content']:this['element']['appendChild'](this['options']['content']);}}class rr extends vt{['children'];['scrollManager'];['_bodyCollection'];constructor(_0x3793f9,_0x106827){super(_0x3793f9),this['_bodyCollection']=_0x106827,this['set']('loadingMessage',''),this['set']('isLoadingSkeletonVisible',!0x1),this['set']('isTrackChangesOn',!0x1),this['children']=this['createCollection'](),this['children']['delegate'](...tn)['to'](this),this['_setupTemplate']();}['render'](){super['render'](),this['scrollManager']=new sr(this['element']);}['destroy'](){super['destroy'](),this['scrollManager']['destroy']();}['clear'](){this['children']['clear']();}['addItem'](_0x53d84c,_0x534c35){let _0x5e7776;return'ai-reply'===_0x53d84c?_0x5e7776=new vn(this['locale'],_0x534c35,this['_bodyCollection']):'ai-suggestion-reply'===_0x53d84c?(_0x5e7776=new Nn(this['locale'],_0x534c35,this['_bodyCollection']),_0x5e7776['bind']('isTrackChangesOn')['to'](this)):_0x5e7776='user-message'===_0x53d84c?new Jn(this['locale'],_0x534c35,this['_bodyCollection']):'interaction-header'===_0x53d84c?new Zn(this['locale'],_0x534c35):'custom-element'===_0x53d84c?new nr(_0x534c35):new wn(_0x534c35),this['children']['add'](_0x5e7776),_0x5e7776;}async['updateReplyItem']({id:_0x58e365,parsedContent:_0x4b3505,renderingStrategy:_0x17c927,abortSignal:_0x4fa8d0}){const _0x49fcb1=this['getItemById'](_0x58e365);if(!(_0x49fcb1 instanceof vn))throw new at('ai-chat-feed-view-item-not-a-reply-item',null,{'itemView':_0x49fcb1,'id':_0x58e365,'parsedContent':_0x4b3505});await _0x49fcb1['updateContent']({'parsedContent':_0x4b3505,'renderingStrategy':_0x17c927,'abortSignal':_0x4fa8d0});}async['updateWebSources'](_0x14b1ce,_0x55cc16){const _0x40c87b=this['getItemById'](_0x14b1ce);if(_0x40c87b instanceof Nn)_0x40c87b['updateSources'](_0x55cc16);else{if(!(_0x40c87b instanceof vn))throw new at('ai-chat-feed-view-item-not-a-suggestion-or-reply-item',null,{'itemView':_0x40c87b,'id':_0x14b1ce,'sources':_0x55cc16});_0x40c87b['updateSources'](_0x55cc16);}}async['updateSuggestionItem']({id:_0x4f0cf4,parts:_0x5430a5,abortSignal:_0x5d319f,skipLoadingEffects:_0x567487}){const _0x4635e4=this['getItemById'](_0x4f0cf4);if(!(_0x4635e4 instanceof Nn))throw new at('ai-chat-feed-view-item-not-a-suggestion-item',null,{'itemView':_0x4635e4,'id':_0x4f0cf4,'parts':_0x5430a5});await _0x4635e4['updateContent']({'parts':_0x5430a5,'abortSignal':_0x5d319f,'skipLoadingEffects':_0x567487});}['updateSuggestionPartState']({id:_0x5eea11,index:_0x4f3fc6,state:_0x1f8986}){const _0x51942a=this['getItemById'](_0x5eea11);if(!(_0x51942a instanceof Nn))throw new at('ai-chat-feed-view-item-not-a-suggestion-item',this,{'id':_0x5eea11});_0x51942a['updatePartState'](_0x4f3fc6,_0x1f8986);}['setSuggestionPartActive']({id:_0x4b36d8,index:_0x10f1e4,isActive:_0xc90e6b}){const _0x12cf2a=this['getItemById'](_0x4b36d8);if(!(_0x12cf2a instanceof Nn))throw new at('ai-chat-feed-view-item-not-a-suggestion-item',this,{'id':_0x4b36d8});this['children']['filter'](_0x1f6452=>_0x1f6452 instanceof Nn)['forEach'](_0x1fb2ac=>{_0x1fb2ac['setPartActive'](!0x1);}),_0x12cf2a['setPartActive'](_0x10f1e4,_0xc90e6b);}['markItemAsDone'](_0x4a0173){this['getItemById'](_0x4a0173)['markAsDone']();}['getItemIds'](){return this['children']['map'](_0x579a34=>_0x579a34['options']['id']);}['removeItem'](_0x2506b8){this['children']['remove'](this['getItemById'](_0x2506b8));}['hasItem'](_0x26bf64){return!!this['children']['find'](_0x2d789f=>_0x2d789f['options']['id']['includes'](_0x26bf64));}['scrollToSuggestion'](_0x400f32,_0x4680f8){const _0x148deb=this['getItemById'](_0x400f32);if(!(_0x148deb instanceof Nn))return void It('ck-ai-chat-feed-view-scroll-to-suggestion-invalid-item',{'replyId':_0x400f32,'partIndex':_0x4680f8});const _0x4ca72f=_0x148deb['getPartView'](_0x4680f8);_0x4ca72f?ft(_0x4ca72f['element'],0x14,this['element']['parentElement'],!0x0,!0x0):It('ck-ai-chat-feed-view-scroll-to-suggestion-part-view-not-found',{'replyId':_0x400f32,'partIndex':_0x4680f8});}['_setupTemplate'](){this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed']},'children':this['_createTemplateChildren']()});}['_createTemplateChildren'](){const _0x4eebf0=this['_createSkeletonLoader']();return[this['_createFeedItems'](),_0x4eebf0,this['_createFeedLoader']()];}['_createSkeletonLoader'](){const _0x2dcf33=new pn(this['locale'],mn['aiFeed']);return _0x2dcf33['bind']('isVisible')['to'](this,'isLoadingSkeletonVisible'),_0x2dcf33;}['_createFeedItems'](){const _0x584f17=new vt(this['locale']);return _0x584f17['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed__items',this['bindTemplate']['if']('isLoadingSkeletonVisible','ck-hidden')]},'children':this['children']}),_0x584f17;}['_createFeedLoader'](){const _0x4e303f=new vt(this['locale']);return _0x4e303f['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__loader',this['bindTemplate']['if']('loadingMessage','ck-hidden',_0x358f28=>!_0x358f28)]},'children':this['_createLoaderChildren']()}),_0x4e303f;}['_createLoaderChildren'](){const _0x1325a0=new yn();return _0x1325a0['isVisible']=!0x0,[_0x1325a0,{'tag':'span','attributes':{'class':['ck','ck-ai-chat__loader-text']},'children':[{'text':this['bindTemplate']['to']('loadingMessage')}]}];}['getItemById'](_0x57f8b1){const _0x44aaf4=this['children']['find'](_0x54cefa=>_0x54cefa['options']['id']['includes'](_0x57f8b1));if(!_0x44aaf4)throw new at('ai-chat-feed-view-item-not-found',this,{'id':_0x57f8b1});return _0x44aaf4;}['setLoadingMessage'](_0x419215){this['set']('loadingMessage',_0x419215);}['toggleLoadingSkeleton'](_0x3d6df3){this['set']('isLoadingSkeletonVisible',_0x3d6df3);}['startAutoScroll'](_0x494ed3={}){this['scrollManager']['start'](_0x494ed3);}['stopAutoScroll'](){this['scrollManager']['stop']();}}class or extends Dt{['filter'](){let _0x3a5706=0x0;for(const _0x1d2af6 of this['items'])_0x3a5706+=_0x1d2af6['items']['length'];return{'resultsCount':_0x3a5706,'totalItemsCount':_0x3a5706};}}const ar='ck-ai-chat__prompt-input_highlighted';class hr extends Lt{['submitButtonView'];static ['MIN_ROWS']=0x1;static ['MAX_ROWS']=0xc;['_addContextButtonView'];['_queryViewResizeObserver'];constructor(_0x49dc40,_0x401122){super(_0x49dc40,{'queryView':{'label':'','creator':Vt,'showIcon':!0x1,'showResetButton':!0x1},'filteredView':new or(_0x49dc40),'queryMinChars':0x1/0x0,'resetOnBlur':!0x1}),this['set']('isEmpty',!0x0),this['set']('isUploadInProgress',!0x1),this['_addContextButtonView']=_0x401122,this['_queryViewResizeObserver']=null,this['queryView']['fieldView']['minRows']=hr['MIN_ROWS'],this['queryView']['fieldView']['maxRows']=hr['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',(_0x52dafe,_0x5ca65f)=>!_0x52dafe&&!_0x5ca65f),this['focusableChildren']['add'](this['submitButtonView']);}['render'](){super['render'](),this['queryView']['fieldWrapperChildren']['add'](this['submitButtonView']),this['keystrokes']['set']('enter',(_0x1821a9,_0x2bede0)=>{this['isUploadInProgress']||this['isEmpty']||_0x1821a9['target']==this['queryView']['fieldView']['element']&&(this['submit'](),_0x2bede0());}),this['queryView']['fieldView']['on']('update',()=>{this['isEmpty']=''===this['queryView']['fieldView']['element']['value']?.['trim']();});}['destroy'](){super['destroy'](),this['_queryViewResizeObserver']&&this['_queryViewResizeObserver']['destroy']();}['submit'](){const _0x1c55f6=this['queryView']['fieldView']['element']['value']?.['trim']();if(!_0x1c55f6)return this['queryView']['errorText']=hs(this['locale'],'AI_CHAT_PROMPT_EMPTY_ERROR'),void(this['queryView']['fieldView']['hasError']=!0x0);this['queryView']['fieldView']['hasError']=!0x1;const _0xf2903b=_0x3e1bcc(_0x1c55f6);this['fire']('sendUserMessage',_0xf2903b),this['queryView']['fieldView']['reset']();}['setPlaceholderText'](_0x3295f1){this['queryView']['fieldView']['set']('placeholder',_0x3295f1);}['focus'](_0x48beb6=!0x1){super['focus'](),_0x48beb6&&(this['element']['classList']['contains'](ar)||(this['element']['classList']['add'](ar),setTimeout(()=>{this['element']['classList']['remove'](ar);},0x320)));}['_createSubmitButton'](){const _0x1b66f9=new Nt(this['locale']);return _0x1b66f9['set']({'icon':_0x18c4f0,'label':hs(this['locale'],'AI_CHAT_LABEL_SUBMIT'),'isVisible':!0x0,'tooltip':!0x0,'class':'ck-ai-chat__prompt-submit-button\x20'+cs,'isEnabled':!0x1}),_0x1b66f9['on']('execute',()=>{this['submit']();}),_0x1b66f9;}['setIsUploadInProgress'](_0x146f6b){this['isUploadInProgress']=_0x146f6b;}['_setUpAddContextButtonPositioning'](){const _0xb2c30=this['locale'],_0x21e323=()=>{ct['window']['requestAnimationFrame'](()=>{if(lt(this['element'])){const _0xc55b84=new ut(this['queryView']['fieldView']['element']),_0x1421e4=new ut(this['_addContextButtonView']['element']),_0x3f27ca=_0xc55b84['width'],_0x58d3b6='rtl'===_0xb2c30['uiLanguageDirection']?'right':'left';_0xc55b84['excludeScrollbarsAndBorders']();const _0x4f2334=_0x3f27ca-_0xc55b84['width']+0x1;this['_addContextButtonView']['element']['style'][_0x58d3b6]='calc('+(_0x3f27ca-_0x1421e4['width']-_0x4f2334)+'px\x20-\x20var(--ck-spacing-tiny))';}});};this['queryView']['fieldView']['on']('update',_0x21e323),this['on']('render',()=>{_0x21e323(),this['_queryViewResizeObserver']=new bt(this['queryView']['fieldView']['element'],()=>{_0x21e323();});});}}const cr='ck-ai-chat__prompt-capabilities',lr='ck-ai-chat-controls-button',ur='ck-ai-chat-controls-button--commands',dr='ck-ai-chat-controls__model-selection',_r='ck-ai-chat-controls__model-selection__item-name',gr='ck-ai-chat-controls__model-selection__item-description',Ar='ck-ai-chat-controls__model-selection__item-capabilities',Ir='n';class Er extends vt{['_webSearchButton'];['_reasoningButton'];['_commandsButton'];['_modelSelectionDropdown'];['_modelSelectionDropdownItems'];['_modelNameView'];constructor(_0x175638){super(_0x175638),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',_0x5db21c=>'selector'===_0x5db21c),this['_modelSelectionDropdown']['buttonView']['bind']('tooltip')['to'](this,'modelSelectorEnabled',_0x44599f=>_0x44599f?this['_modelSelectionDropdown']['buttonView']['label']:hs(this['locale'],'AI_CHAT_MODEL_SELECTOR_DISABLED_TOOLTIP')),this['_modelSelectionDropdown']['bind']('isEnabled')['to'](this,'modelSelectorEnabled',_0x514820=>_0x514820),this['_webSearchButton']['bind']('isOn')['to'](this,'webSearchActive',_0x26b17f=>_0x26b17f),this['_webSearchButton']['bind']('tooltip')['to'](this,'webSearchActive',_0x44b756=>hs(this['locale'],_0x44b756?'AI_CHAT_DISABLE_WEB_SEARCH':'AI_CHAT_ENABLE_WEB_SEARCH')),this['_reasoningButton']['bind']('isOn')['to'](this,'reasoningActive',_0x1dfc00=>_0x1dfc00),this['_reasoningButton']['bind']('tooltip')['to'](this,'reasoningActive',_0x58343a=>hs(this['locale'],_0x58343a?'AI_CHAT_DISABLE_REASONING':'AI_CHAT_ENABLE_REASONING')),this['setTemplate']({'tag':'div','attributes':{'class':[cr]},'children':[this['_modelSelectionDropdown'],this['_modelNameView'],this['_webSearchButton'],this['_reasoningButton'],this['_commandsButton']]}),this['_modelSelectionDropdownItems']=new dt(),jt(this['_modelSelectionDropdown'],this['_modelSelectionDropdownItems']);}['setModelList'](_0x53e401,_0x20314a){if(_0x20314a)this['set']('modelDisplayMode','hidden');else{const _0x5afd00=0x1===_0x53e401['length'];this['set']('modelDisplayMode',_0x5afd00?'name':'selector');}if(this['_modelSelectionDropdownItems']['clear'](),_0x53e401?.['length'])for(const _0x3d3c25 of _0x53e401){const _0x241c2b=new Jt({'label':_0x3d3c25['name'],'withText':!0x0,'role':'menuitemradio','id':_0x3d3c25['id'],'model':_0x3d3c25});_0x241c2b['bind']('isOn')['to'](this,'activeModelId',_0x5cb471=>_0x5cb471===_0x3d3c25['id']),this['_modelSelectionDropdownItems']['add']({'type':'button','model':_0x241c2b,'labelView':new pr(this['locale'],_0x3d3c25)});}}['setWebSearch'](_0x3b0af0){this['set']('webSearchActive',_0x3b0af0);}['setReasoning'](_0x3bf459){this['set']('reasoningActive',_0x3bf459);}['setModel'](_0x140f4e){if(!_0x140f4e)return;this['activeModelId']=_0x140f4e['id'],this['activeModelName']=_0x140f4e['name']||_0x140f4e['id'],this['_modelSelectionDropdown']['buttonView']['set']('label',_0x140f4e['name']),this['_modelSelectionDropdown']['buttonView']['set']('tooltip',_0x140f4e['name']);const _0x58c31d=_0x140f4e['capabilities']['webSearch']?.['enabled']??!0x1;this['set']('webSearchActive',!0x1),this['_webSearchButton']['set']('isOn',!0x1),this['_webSearchButton']['set']('isEnabled',_0x58c31d),this['_webSearchButton']['set']('isVisible',_0x58c31d);const _0x4ffc1b=_0x140f4e['capabilities']['reasoning']?.['enabled']??!0x1;this['set']('reasoningActive',!0x1),this['_reasoningButton']['set']('isOn',!0x1),this['_reasoningButton']['set']('isEnabled',_0x4ffc1b),this['_reasoningButton']['set']('isVisible',_0x4ffc1b);}['enableModelSelector'](){this['set']('modelSelectorEnabled',!0x0);}['disableModelSelector'](_0x5e61ed){this['set']('modelSelectorEnabled',!0x1),_0x5e61ed&&this['set']('modelDisplayMode','hidden');}['_createWebSearchButton'](){const _0x370218=new Nt();return _0x370218['set']({'label':hs(this['locale'],'AI_CHAT_SEARCH_WEB'),'icon':_0x4b1ef5,'class':lr+'\x20'+us,'isToggleable':!0x0,'tooltipPosition':Ir}),_0x370218['on']('execute',()=>{this['fire']('toggleWebSearch');}),_0x370218;}['_createReasoningButton'](){const _0x53e4ed=new Nt();return _0x53e4ed['set']({'label':hs(this['locale'],'AI_CHAT_REASONING'),'icon':_0x3f94ae,'class':lr+'\x20'+us,'isToggleable':!0x0,'tooltipPosition':Ir}),_0x53e4ed['on']('execute',()=>{this['fire']('toggleReasoning');}),_0x53e4ed;}['_createCommandsButton'](){const _0x1b80c4=new Nt();return _0x1b80c4['set']({'label':hs(this['locale'],'AI_CHAT_COMMANDS'),'icon':_0x23ecdc,'withText':!0x0,'class':lr+'\x20'+us,'isToggleable':!0x0,'tooltip':hs(this['locale'],'AI_CHAT_COMMANDS'),'tooltipPosition':Ir}),_0x1b80c4['extendTemplate']({'attributes':{'class':[ur]}}),_0x1b80c4['on']('execute',()=>{console['log']('Commands\x20are\x20not\x20implemented\x20yet.'),alert('Commands\x20are\x20not\x20implemented\x20yet.');}),_0x1b80c4;}['_createModelSelectionDropdown'](){const _0x458791=Gt(this['locale']);return _0x458791['set']({'panelPosition':'ne','class':[dr]}),_0x458791['buttonView']['set']({'label':hs(this['locale'],'AI_CHAT_MODEL_SELECTOR_ENABLED_TOOLTIP'),'withText':!0x0,'tooltip':!0x0,'tooltipPosition':Ir,'class':us}),this['listenTo'](_0x458791,'execute',_0x5cf5e8=>{this['fire']('selectModel',_0x5cf5e8['source']['model']);}),_0x458791;}['_createModelNameView'](){const _0x36c7b8=new mr(this['locale']);return _0x36c7b8['bind']('text')['to'](this,'activeModelName',_0x4f090f=>_0x4f090f??''),_0x36c7b8['bind']('isVisible')['to'](this,'modelDisplayMode',_0x49016a=>'name'===_0x49016a),_0x36c7b8;}}let pr=class extends Mt{constructor(_0xa09f84,_0x1f4942){super();const _0x5c2c89=this['bindTemplate'],_0x1192f4=this['createCollection']();this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-button__label'],'style':_0x5c2c89['to']('style'),'id':_0x5c2c89['to']('id')},'children':[{'tag':'div','attributes':{'class':[_r]},'children':[{'text':_0x5c2c89['to']('text')}]},{'tag':'div','attributes':{'class':[gr]},'children':[{'tag':'span','children':[{'text':_0x1f4942['description']}]}]},{'tag':'div','attributes':{'class':[Ar]},'children':_0x1192f4}]}),_0x1192f4['addMany'](this['_getCapabilityParts'](_0xa09f84,_0x4b1ef5,'AI_CHAT_SEARCH_WEB',_0x1f4942['capabilities']['webSearch']?.['enabled']??!0x1)),_0x1192f4['addMany'](this['_getCapabilityParts'](_0xa09f84,_0x3f94ae,'AI_CHAT_REASONING',_0x1f4942['capabilities']['reasoning']?.['enabled']??!0x1));}['_getCapabilityParts'](_0x4d3697,_0x47aefe,_0x2d0b76,_0x10cf96){const _0x5d38a2=new xt();_0x5d38a2['content']=_0x47aefe;const _0x43373a=new vt(_0x4d3697);_0x43373a['setTemplate']({'tag':'span','children':[{'text':hs(_0x4d3697,_0x2d0b76)+':\x20'}]});const _0x4ce2d8=new vt(_0x4d3697);return _0x4ce2d8['setTemplate']({'tag':'span','children':[{'text':hs(_0x4d3697,_0x10cf96?'AI_CHAT_CAPABILITIES_YES':'AI_CHAT_CAPABILITIES_NO')}]}),[_0x5d38a2,_0x43373a,_0x4ce2d8];}},mr=class extends vt{constructor(_0x2f735c){super(_0x2f735c),this['set']('text',void 0x0),this['set']('isVisible',!0x0);const _0x3ec63b=this['bindTemplate'];this['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai-chat-controls__model-name',_0x3ec63b['if']('isVisible','ck-hidden',_0x18d85b=>!_0x18d85b)]},'children':[{'text':_0x3ec63b['to']('text')}]});}};const Tr='ck-ai-chat-context-controls__url-form',Cr='ck-ai-chat-context-controls__url-input-section';class wr extends vt{['focusTracker'];['keystrokes'];['_focusables'];['focusCycler'];['urlInputField'];['backButton'];['confirmButton'];constructor(_0x36d8e2){super(_0x36d8e2),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 Ut({'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'](_0x449a02=>{this['focusTracker']['add'](_0x449a02['element']),this['keystrokes']['listenTo'](_0x449a02['element']);}),Zt({'view':this}),this['focus']();}['destroy'](){super['destroy'](),this['focusTracker']['destroy'](),this['keystrokes']['destroy']();}['focus'](){this['urlInputField']['focus']();}['getValue'](){return this['urlInputField']['fieldView']['element']?.['value']?.['trim']()||'';}['clear'](){this['urlInputField']['fieldView']['element']['value']='',this['urlInputField']['errorText']=null,this['confirmButton']['isEnabled']=!0x1;}['setError'](_0x3f304f){this['urlInputField']['errorText']=_0x3f304f,this['_updateConfirmButtonState'](),this['fire']('refreshBalloon');}['clearError'](){this['urlInputField']['errorText']=null,this['_updateConfirmButtonState']();}['_createBackButton'](){const _0x55090c=new Nt(this['locale']);return _0x55090c['set']({'icon':_0x14fdc4,'tooltip':hs(this['locale'],'AI_CHAT_CONTEXT_URL_BACK_TO_CONTEXT'),'tooltipPosition':'n','class':['ck-button-icon\x20ck-button-back']}),this['on']('change:withBackButton',(_0x39fc25,_0x3df84b,_0xc02343)=>{_0x55090c['set']({'class':['ck-button-icon\x20ck-button-back'+(_0xc02343?'':'\x20ck-hidden')]});}),_0x55090c;}['_createUrlInputField'](){const _0x422ed5=new te(this['locale'],_0x4e0fb9);return _0x422ed5['set']({'label':hs(this['locale'],'AI_CHAT_CONTEXT_URL_LABEL'),'class':'ck-labeled-field-view_empty'}),_0x422ed5['fieldView']['set']({'placeholder':hs(this['locale'],'AI_CHAT_CONTEXT_URL_PLACEHOLDER')}),_0x422ed5;}['_createConfirmButton'](){const _0xade9cf=new Nt(this['locale']);return _0xade9cf['set']({'icon':_0x2204df,'tooltip':hs(this['locale'],'AI_CHAT_CONTEXT_URL_ADD_URL'),'tooltipPosition':'n','class':'ck-button-icon','type':'submit','isEnabled':!0x1}),_0xade9cf;}['_setupTemplate'](){const _0x265599=new _0x7a349c(this['locale'],{'label':hs(this['locale'],'AI_CHAT_CONTEXT_URL_ADD_URL'),'class':'ck-ai-header\x20ck-ai-header_small\x20ck-ai-header_context-url'});_0x265599['children']['add'](this['backButton'],0x0),this['setTemplate']({'tag':'form','attributes':{'class':Tr,'tabindex':'-1'},'children':[_0x265599,{'tag':'div','attributes':{'class':Cr},'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',_0x1444ce=>{_0x1444ce['stop'](),this['_handleSubmit']();});}['_setupKeystrokes'](){this['keystrokes']['set']('esc',(_0x419bab,_0x349939)=>{this['clear'](),this['fire']('cancel'),_0x349939();});}['_handleSubmit'](){const _0x4accd6=this['getValue']()['trim']();_0x4accd6?this['_isValidUrl'](_0x4accd6)?(this['clearError'](),this['fire']('submitUrl',_0x4accd6)):this['setError'](hs(this['locale'],'AI_CHAT_CONTEXT_URL_INVALID_ERROR')):this['setError'](hs(this['locale'],'AI_CHAT_CONTEXT_URL_EMPTY_ERROR'));}['_updateConfirmButtonState'](){const _0x3d1583=this['getValue']()['trim'](),_0x42711c=!!this['urlInputField']['errorText'];this['confirmButton']['isEnabled']=_0x3d1583['length']>0x0&&!_0x42711c;}['_isValidUrl'](_0x2239df){try{return!!new URL(_0x2239df);}catch{return!0x1;}}}const fr='ck-ai-chat-resources__item',br='ck-ai-chat-resources__item--in-context',Sr='ck-ai-chat-resources__item-title',Rr='ck-ai-chat-resources__item__icon';class Or extends Ht{['resource'];['_titleView'];['_iconView'];constructor(_0x1d8419,_0x5ae923){super(_0x1d8419),this['resource']=_0x5ae923,this['set']('isInContext',!!_0x5ae923['isInContext']),this['_titleView']=this['_createTitleView'](),this['_iconView']=this['_createIconView'](),this['_setupTemplate']();}['render'](){super['render']();}['getResourceIcon'](_0x42a29b){if(_0x42a29b['isInContext'])return _0x2204df;switch(_0x42a29b['type']){case'document':return _0x386a1;case'web-resource':return _0x3a2322;case'file':case'text':return _0x36ddaf;default:return _0x196b7a;}}['highlightText'](_0x506ad7){if(!_0x506ad7||''===_0x506ad7['trim']())return void this['_titleView']['highlightText'](null);const _0x5c12ad=new RegExp(_0x271311(_0x506ad7),'gi');this['_titleView']['highlightText'](_0x5c12ad);}['updateResourceState'](_0x35636d){this['resource']['isInContext']=_0x35636d,this['isInContext']=_0x35636d,this['_updateIcon']();}['_createTitleView'](){const _0x115e4b=new _0x149c0b();return _0x115e4b['text']=this['resource']['label'],_0x115e4b['extendTemplate']({'tag':'span','attributes':{'class':[Sr]}}),_0x115e4b;}['_createIconView'](){const _0x1d8f43=new xt();return _0x1d8f43['content']=this['getResourceIcon'](this['resource']),_0x1d8f43;}['_setupTemplate'](){const _0x32498a=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':[fr,_0x32498a['if']('isVisible','ck-hidden',_0x4c9de6=>!_0x4c9de6),_0x32498a['if']('isInContext',br)]},'children':[{'tag':'div','attributes':{'class':[Rr]},'children':[this['_iconView']]},this['_titleView']],'on':{'click':_0x32498a['to']('execute')}});}['_updateIcon'](){this['_iconView']['content']=this['getResourceIcon'](this['resource']);}}const kr='ck-ai-chat-resources__list';class Nr extends Dt{['_source'];constructor(_0x2a5bfd,_0x28bca0){super(_0x2a5bfd),this['_source']=_0x28bca0,this['extendTemplate']({'attributes':{'class':[kr]}});}['setResources'](_0x1043b7,_0x12dcbf){this['items']['clear']();let _0x8f8777=_0x1043b7;if(this['_source']['useDefaultFiltering']&&_0x12dcbf&&''!==_0x12dcbf['trim']()){const _0x4a4cd3=new RegExp(_0x12dcbf['replace'](/[.*+?^${}()|[\]\\]/g,'\x5c$&'),'gi');_0x8f8777=_0x1043b7['filter'](_0x4ad7f4=>_0x4a4cd3['test'](_0x4ad7f4['label']));}for(const _0xc768f2 of _0x8f8777){const _0x503fc6=new Or(this['locale'],_0xc768f2);_0x503fc6['on']('execute',()=>{this['_handleResourceSelection'](this['_source'],_0xc768f2);}),this['items']['add'](_0x503fc6);}this['_source']['useDefaultFiltering']&&this['highlightText'](_0x12dcbf);}['highlightText'](_0xf1143f){this['_source']['useDefaultFiltering']&&this['items']['forEach'](_0x4bc0b3=>{_0x4bc0b3['highlightText'](_0xf1143f);});}['updateResourceState'](_0x6717a2,_0x16f90f){for(const _0x5cec48 of this['items']){const _0x2fed9f=_0x5cec48;_0x2fed9f['resource']['id']===_0x6717a2&&_0x2fed9f['updateResourceState'](_0x16f90f);}}['_handleResourceSelection'](_0x39c6a3,_0x30b32c){this['fire']('addResourceToContext',{'source':_0x39c6a3,'resource':_0x30b32c});}}class vr extends te{['iconView'];['resetButtonView'];['_viewConfig'];constructor(_0x399b54){const t=_0x399b54['t'],_0x1e2783={'showResetButton':!0x0,'showIcon':!0x0,'creator':_0x4e0fb9,'label':hs(_0x399b54,'AI_CHAT_SEARCH_RESOURCES')};super(_0x399b54,_0x1e2783['creator']),this['label']=_0x1e2783['label'],this['_viewConfig']=_0x1e2783,this['_viewConfig']['showIcon']&&this['_setupSearchIcon'](),this['_viewConfig']['showResetButton']&&this['_setupResetButton'](_0x399b54,t),this['_setupEventListeners']();}['reset'](){this['fieldView']['reset'](),this['_viewConfig']['showResetButton']&&this['resetButtonView']&&(this['resetButtonView']['isVisible']=!0x1),this['search']('');}['search'](_0x26b34f){this['fire']('search',_0x26b34f);}['getQuery'](){return this['fieldView']['element']?.['value']||'';}['_setupSearchIcon'](){this['iconView']=new xt(),this['iconView']['content']=_0x413214,this['fieldWrapperChildren']['add'](this['iconView'],0x0),this['extendTemplate']({'attributes':{'class':'ck-search__query_with-icon'}});}['_setupResetButton'](_0x1531fb,t){this['resetButtonView']=new Nt(_0x1531fb),this['resetButtonView']['set']({'label':t('Clear'),'icon':_0x104621,'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',_0x996f53=>!_0x996f53),this['fieldWrapperChildren']['add'](this['resetButtonView']),this['extendTemplate']({'attributes':{'class':'ck-search__query_with-reset'}});}['_setupEventListeners'](){this['listenTo'](this['fieldView'],'input',()=>{this['search'](this['fieldView']['element']['value']);}),this['bind']('isEnabled')['to'](this);}}class yr extends vt{['_searchView'];['_searchSection'];['_searchInputVisibleFrom'];['_resourcesListView'];['_skeletonLoader'];['_source'];['children'];['_latestLoadResourcesUid']=null;constructor(_0x9cf649,_0x2b8964){super(_0x9cf649),this['_source']=_0x2b8964['source'],this['_searchInputVisibleFrom']=_0x2b8964['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 _0x3f24a6([this['_skeletonLoader'],this['_resourcesListView']]),this['setTemplate']({'tag':'div','attributes':{'class':'ck-ai-chat-resources'},'children':this['children']});}['_createSearchView'](){return new vr(this['locale']);}['_createSearchSection'](){const _0x5def08=new vt(this['locale']);return _0x5def08['setTemplate']({'tag':'div','attributes':{'class':'ck\x20ck-search'},'children':[this['_searchView']]}),this['_searchView']['on']('search',(_0x2ac0e4,_0x21541b)=>{this['loadResources'](_0x21541b),this['_source']['useDefaultFiltering']&&this['_resourcesListView']['highlightText'](_0x21541b);}),_0x5def08;}['_createResourcesListView'](){const _0x346622=new Nr(this['locale'],this['_source']);return _0x346622['delegate']('addResourceToContext')['to'](this),_0x346622['extendTemplate']({'attributes':{'class':this['bindTemplate']['if']('isLoading','ck-hidden')}}),_0x346622;}['_createSkeletonView'](){const _0x4f0a96=new pn(this['locale'],mn['aiChatResources']);return _0x4f0a96['bind']('isVisible')['to'](this,'isLoading'),_0x4f0a96;}['render'](){super['render'](),this['loadResources']('');}['loadResources'](_0x2383c3){const _0x1e8c4c=ot();this['_latestLoadResourcesUid']=_0x1e8c4c,this['fire']('loadSourceResources',{'sourceId':this['_source']['id'],'query':_0x2383c3,'uid':_0x1e8c4c}),this['isLoading']=!0x0;}['setResources'](_0x33d90b,_0x149a59){if(_0x149a59&&_0x149a59!==this['_latestLoadResourcesUid'])return;const _0x28c309=this['_source']['useDefaultFiltering']?this['_searchView']['getQuery']():'';this['_resourcesListView']['setResources'](_0x33d90b,_0x28c309),_0x33d90b['length']>=this['_searchInputVisibleFrom']&&!this['children']['has'](this['_searchSection'])&&this['children']['add'](this['_searchSection'],0x0),requestAnimationFrame(()=>{this['isLoading']=!0x1;});}['updateResourceState'](_0x4d2eb1,_0x2685ef){this['_resourcesListView']['updateResourceState'](_0x4d2eb1,_0x2685ef);}}const xr='ck-ai-chat-context-controls__source-balloon-panel',Lr='ck-button-icon\x20ck-button-back',Dr='ck-ai-header\x20ck-ai-header_small\x20ck-ai-header_source';class Pr{['_sourceResourceBalloons']=new Map();['_bodyCollection'];['_locale'];['_config'];constructor(_0x3534c4,_0x25d66b,_0x4ca438){this['_locale']=_0x3534c4,this['_bodyCollection']=_0x25d66b,this['_config']=_0x4ca438;}['showSourceResourcesBalloon']({source:_0x2dd0f4,withBackButton:_0x20eca8}){let _0x137f10=this['_sourceResourceBalloons']['get'](_0x2dd0f4['id']);_0x137f10||(_0x137f10=this['_createSourceResourceBalloonPanel'](),this['_sourceResourceBalloons']['set'](_0x2dd0f4['id'],_0x137f10),this['_setupSingleResourceBalloonClickOutsideHandler'](_0x137f10)),this['_addSourceResourceContent']({'balloonPanel':_0x137f10,'source':_0x2dd0f4,'withBackButton':_0x20eca8}),_0x137f10['show']();const _0x594b2c=this['_config']['getTargetElement']();_0x594b2c&&_0x137f10['pin']({'target':_0x594b2c,'limiter':this['_config']['getLimiterElement']()});}['populateSourceResourceBalloon'](_0x519acc,_0x56e9fd,_0x4e3017){const _0x42da39=this['_sourceResourceBalloons']['get'](_0x519acc);if(!_0x42da39)return;const _0x2d7daf=this['_getResourcesViewFromBalloon'](_0x42da39);_0x2d7daf&&(_0x2d7daf['setResources'](_0x56e9fd,_0x4e3017),_0x2d7daf['once']('change:isLoading',()=>{_0x42da39['pin']({'target':this['_config']['getTargetElement'](),'limiter':this['_config']['getLimiterElement']()});}));}['closeSourceResourceBalloon'](_0x43fe4c){const _0x5be759=this['_sourceResourceBalloons']['get'](_0x43fe4c);_0x5be759&&requestAnimationFrame(()=>{_0x5be759['hide'](),this['_sourceResourceBalloons']['delete'](_0x43fe4c),this['_config']['onBalloonClosed']();});}['isAnyResourceBalloonVisible'](){for(const _0x3d0ead of this['_sourceResourceBalloons']['values']())if(_0x3d0ead['isVisible'])return!0x0;return!0x1;}['updateResourceState'](_0x413b34,_0x4f3f50,_0x3e0188){const _0x88f51d=this['_sourceResourceBalloons']['get'](_0x413b34);if(!_0x88f51d||!_0x88f51d['isVisible'])return;const _0xeb9eb3=this['_config']['getTargetElement']();if(!_0xeb9eb3)return;_0x88f51d['pin']({'target':_0xeb9eb3,'limiter':this['_config']['getLimiterElement']()});const _0x335fdf=this['_getResourcesViewFromBalloon'](_0x88f51d);_0x335fdf&&_0x335fdf['updateResourceState'](_0x4f3f50,_0x3e0188);}['destroy'](){for(const _0x4d99fd of this['_sourceResourceBalloons']['values']())_0x4d99fd['destroy']();this['_sourceResourceBalloons']['clear']();}['_createSourceResourceBalloonPanel'](){const _0x2ebbc9=new Xt(this['_locale']);return _0x2ebbc9['extendTemplate']({'attributes':{'class':xr}}),this['_bodyCollection']['add'](_0x2ebbc9),_0x2ebbc9;}['_addSourceResourceContent']({balloonPanel:_0x20c2aa,source:_0x996122,withBackButton:_0xeb86c6}){_0x20c2aa['content']['clear']();const _0x30b37a=this['_createBalloonHeader']({'balloonPanel':_0x20c2aa,'source':_0x996122,'withBackButton':_0xeb86c6});_0x20c2aa['content']['add'](_0x30b37a);const _0x42d1dd=this['_createBalloonResourcesView'](_0x996122);_0x20c2aa['content']['add'](_0x42d1dd);}['_createBalloonHeader']({balloonPanel:_0x44b2db,source:_0x3fae33,withBackButton:_0x52d28d}){const _0x323863=new _0x7a349c(this['_locale'],{'label':_0x3fae33['label'],'class':Dr});return _0x52d28d&&_0x323863['children']['add'](this['_createBackButton'](_0x44b2db),0x0),_0x323863;}['_createBackButton'](_0x351c4d){const _0x409b54=new Nt(this['_locale']);return _0x409b54['set']({'icon':_0x14fdc4,'tooltip':hs(this['_locale'],'AI_CHAT_CONTEXT_URL_BACK_TO_CONTEXT'),'tooltipPosition':'n','class':Lr}),_0x409b54['on']('execute',()=>{_0x351c4d['hide'](),this['_config']['onBackToContext']();}),_0x409b54;}['_createBalloonResourcesView'](_0x17128c){const _0x1e9e49=new yr(this['_locale'],{'source':_0x17128c,'searchInputVisibleFrom':this['_config']['searchInputVisibleFrom']});return _0x1e9e49['on']('loadSourceResources',(_0x9c7ec7,_0x58f224)=>{this['_config']['onLoadSourceResources'](_0x58f224);}),_0x1e9e49['on']('addResourceToContext',(_0x16579f,_0x3f0447)=>{this['_config']['onResourceSelected'](_0x3f0447['source'],_0x3f0447['resource']),this['closeSourceResourceBalloon'](_0x17128c['id']);}),_0x1e9e49;}['_getResourcesViewFromBalloon'](_0x450770){const _0x4dddda=_0x450770['content']['get'](0x1);return _0x4dddda instanceof yr?_0x4dddda:null;}['_setupSingleResourceBalloonClickOutsideHandler'](_0x1fd3d9){zt({'emitter':_0x1fd3d9,'contextElements':[_0x1fd3d9['element']],'callback':()=>{_0x1fd3d9['hide'](),this['_config']['onBalloonClosed']();},'activator':()=>_0x1fd3d9['isVisible']});}}const Hr=['addDocumentToContext','addFileToContext','addUrlToContext','addResourceToContext','removeContextItem','loadSourceResources','executeCustomItemCallback'],Mr='ck-ai-chat-context-controls',Ur='ck-ai-chat-context-controls__pending-contexts',Vr='ck-ai-chat-context-controls__add-context-balloon-panel',Br='ck-ai-chat-context-controls__add-context-button',Gr='ck-ai-chat-context-controls__url-balloon-panel',Fr='ck-ai-chat-context-controls__balloon-button',Kr='ck-ai-chat-context-controls__balloon-button-source',Wr='ck-ai-chat-controls-button',Yr='ck-ai-chat-context-chips-wrapper-balloon',$r='ck-ai-chat-controls_context_show-more-button',qr='ck-ai-chat-context-controls__show-more-balloon-panel',Qr='ck-ai-chat',Xr=[Xt['defaultPositions']['northArrowSouthWest'],Xt['defaultPositions']['northArrowSouth'],Xt['defaultPositions']['northArrowSouthEast'],Xt['defaultPositions']['southArrowNorthWest'],Xt['defaultPositions']['southArrowNorth'],Xt['defaultPositions']['southArrowNorthEast']];class zr extends vt{['addContextButtonView'];['_currentContextsChips']=this['createCollection']();['_conversationContextsChips']=this['createCollection']();['_overflowManager'];['_addContextBalloonPanelView'];['_urlBalloonPanelView'];['_urlInputView'];['_resourcesBalloonView'];['_addContextBalloonConfig'];['_hasExactlyOneSource']=!0x1;['bodyCollection'];constructor(_0x7b551c,_0x22a19b){super(_0x7b551c),this['bodyCollection']=_0x22a19b['bodyCollection'],this['_currentContextsChips']=this['createCollection'](),this['_conversationContextsChips']=this['createCollection'](),this['addContextButtonView']=this['_createAddContextButtonView'](_0x7b551c),this['_addContextBalloonPanelView']=this['_createAddContextBalloonPanelView'](_0x7b551c),this['_urlBalloonPanelView']=this['_createUrlBalloonPanelView'](_0x7b551c),this['_resourcesBalloonView']=this['_createResourcesBalloonView'](_0x7b551c,_0x22a19b);const _0x25d7f0={'cssClasses':{'showMoreButton':$r+'\x20'+us,'showMoreBalloon':qr,'overflowContainer':Yr,'controlsButton':Wr}};this['_overflowManager']=new Wn(_0x7b551c,this['_currentContextsChips'],_0x25d7f0,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'](_0x24e6d0,_0x25f964){const _0x445ca2=this['_createContextButton'](_0x24e6d0,'current',!0x0,_0x25f964);this['_addContextToCollection'](_0x445ca2,this['_currentContextsChips']),this['_overflowManager']['reorganizeChips']();}['removeContextItem'](_0x54318d){this['_removeContextFromCollection'](_0x54318d,this['_currentContextsChips']),this['_removeContextFromCollection'](_0x54318d,this['_overflowManager']['overflowChips']),this['_overflowManager']['reorganizeChips']();}['setContextItemLoading'](_0x172e0c,_0x55c26d){let _0x30a653=this['_currentContextsChips']['find'](_0x8c3c5f=>_0x8c3c5f['id']===_0x172e0c);_0x30a653||(_0x30a653=this['_overflowManager']['overflowChips']['find'](_0x7dc931=>_0x7dc931['id']===_0x172e0c)),_0x30a653&&(_0x30a653['isLoading']=_0x55c26d);}['setConversationContext'](_0x39a018){this['_conversationContextsChips']['clear']();for(const _0x17930c of _0x39a018){const _0xd01484=this['_createContextButton'](_0x17930c,'conversation',!0x1,!0x1);this['_addContextToCollection'](_0xd01484,this['_conversationContextsChips']);}}['clearCurrentContextItems'](){this['_currentContextsChips']['clear'](),this['_overflowManager']['clear']();}['clearConversationContextItems'](){this['_conversationContextsChips']['clear']();}['updateResourceState'](_0x4b06ec,_0x412cea,_0x107b8b){this['_resourcesBalloonView']['updateResourceState'](_0x4b06ec,_0x412cea,_0x107b8b);}['hideAddContextBalloonPanel'](){this['_toggleAddContextBalloon'](!0x1);}['showAddContextBalloonPanel'](){this['_toggleAddContextBalloon'](!0x0);}['hideUrlBalloonPanel'](){this['_urlBalloonPanelView']['hide'](),this['addContextButtonView']['isOn']=!0x1,this['_urlInputView']&&this['_urlInputView']['clear']();}['showUrlBalloonPanel'](){this['_urlBalloonPanelView']['show'](),this['addContextButtonView']['isOn']=!0x0;}['_showSourceResourcesBalloon']({source:_0x459e43,withBackButton:_0x41b3d4}){this['_resourcesBalloonView']['showSourceResourcesBalloon']({'source':_0x459e43,'withBackButton':_0x41b3d4}),this['addContextButtonView']['isOn']=!0x0;}['populateSourceResourceBalloon'](_0x5d172b,_0x4fed91,_0x41ff30,_0xf0bb5){this['_resourcesBalloonView']['populateSourceResourceBalloon'](_0x5d172b,_0x41ff30,_0xf0bb5);}['closeSourceResourceBalloon'](_0x19b711){this['_resourcesBalloonView']['closeSourceResourceBalloon'](_0x19b711),this['addContextButtonView']['isOn']=!0x1;}['setAddContextOptions'](_0x367f57){this['_setBalloonPanelContent'](this['_addContextBalloonPanelView'],this['locale'],_0x367f57),this['_setAddContextButtonEnabled'](_0x367f57);}['_setAddContextButtonEnabled'](_0x8120d1){const _0x121b87=!_0x8120d1['document']['isHidden']&&_0x8120d1['document']['enabled'],_0x5133d4=_0x8120d1['urls']['enabled'],_0x526ac7=_0x8120d1['files']['enabled'],_0x1bc121=_0x8120d1['sources']['length']>0x0,_0x2d7604=_0x8120d1['customItems']&&_0x8120d1['customItems']['length']>0x0;this['addContextButtonView']['isEnabled']=_0x121b87||_0x5133d4||_0x526ac7||_0x1bc121||_0x2d7604;}['_setupTemplate'](){this['setTemplate']({'tag':'div','attributes':{'class':[Mr,'ck-reset_all-excluded']},'children':[{'tag':'div','attributes':{'class':Ur},'children':this['_currentContextsChips']}]});}['_bindEventHandlers'](){this['addContextButtonView']['on']('execute',()=>{this['_handleAddContextButtonClick']();});}['_createAddContextButtonView'](_0x17e68f){const _0x1624d0=new Nt(_0x17e68f);return _0x1624d0['set']({'label':hs(_0x17e68f,'AI_CHAT_CONTEXT_ADD_CONTEXT'),'class':Wr+'\x20'+Br+'\x20'+us,'icon':_0x4fd8ad,'isToggleable':!0x0,'tooltip':!0x0,'tooltipPosition':'sw'}),_0x1624d0;}['_createAddContextBalloonPanelView'](_0x54794b){return this['_createBaseBalloonPanel'](_0x54794b,Vr);}['_createUrlBalloonPanelView'](_0x4d29ab){const _0x229911=this['_createBaseBalloonPanel'](_0x4d29ab,Gr);return this['_addUrlContent'](_0x229911,_0x4d29ab),_0x229911;}['_createResourcesBalloonView'](_0x58f098,_0x3bc1f4){const _0x1b72e4={'searchInputVisibleFrom':_0x3bc1f4['searchInputVisibleFrom'],'onBackToContext':()=>{this['showAddContextBalloonPanel'](),this['_addContextBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':Xr});},'onResourceSelected':(_0x1631bf,_0x4f0caf)=>{this['fire']('addResourceToContext',{'source':_0x1631bf,'resource':_0x4f0caf});},'onLoadSourceResources':_0x4e0118=>{this['fire']('loadSourceResources',_0x4e0118);},'onBalloonClosed':()=>{this['addContextButtonView']['isOn']=!0x1;},'getLimiterElement':()=>this['_getLimiterElement'](),'getTargetElement':()=>this['addContextButtonView']['element']};return new Pr(_0x58f098,_0x3bc1f4['bodyCollection'],_0x1b72e4);}['_getLimiterElement'](){return this['element']?.['closest']('.'+Qr)||document['body'];}['_createBaseBalloonPanel'](_0x15cb2c,_0x440f68){const _0x57ab0b=new Xt(_0x15cb2c);return _0x57ab0b['extendTemplate']({'attributes':{'class':_0x440f68}}),this['bodyCollection']['add'](_0x57ab0b),_0x57ab0b;}['_setBalloonPanelContent'](_0x5b664b,_0x221b1c,_0x58a88d){if(_0x5b664b['content']['clear'](),!_0x58a88d['document']['isHidden']&&_0x58a88d['document']['enabled']){const _0x309e64=this['_createBalloonButton'](_0x221b1c,{'label':hs(_0x221b1c,'AI_CHAT_CONTEXT_CURRENT_DOCUMENT'),'icon':_0x386a1});_0x309e64['on']('execute',()=>{this['fire']('addDocumentToContext'),this['hideAddContextBalloonPanel']();}),_0x5b664b['content']['add'](_0x309e64);}if(_0x58a88d['urls']['enabled']){const _0x252eae=this['_createBalloonButton'](_0x221b1c,{'label':hs(_0x221b1c,'AI_CHAT_CONTEXT_URL_LABEL'),'icon':_0x3a2322});_0x252eae['on']('execute',()=>{this['hideAddContextBalloonPanel'](),this['showUrlBalloonPanel'](),this['_urlBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':Xr}),this['_urlInputView']['focus']();}),_0x5b664b['content']['add'](_0x252eae);}if(_0x58a88d['files']['enabled']){const _0x2740b6=new _0x10774f(_0x221b1c);_0x2740b6['set']({'label':hs(_0x221b1c,'AI_CHAT_CONTEXT_FILE_LABEL'),'icon':_0x265576,'withText':!0x0,'tooltip':!0x0,'class':Fr,'allowMultipleFiles':!0x0}),_0x2740b6['on']('execute',()=>{this['hideAddContextBalloonPanel']();}),_0x2740b6['on']('done',(_0x3bc5b5,_0x52538a)=>{this['fire']('addFileToContext',_0x52538a);}),_0x2740b6['tooltip']=!0x0,_0x5b664b['content']['add'](_0x2740b6);}for(const _0xd4e038 of _0x58a88d['sources']){const _0x37cc62=this['_createBalloonButton'](_0x221b1c,{'label':_0xd4e038['label'],'icon':_0xd4e038['icon']||_0x196b7a,'type':'source'});_0x5b664b['content']['add'](_0x37cc62),_0x37cc62['on']('execute',()=>{this['hideAddContextBalloonPanel'](),this['_showSourceResourcesBalloon']({'source':_0xd4e038,'withBackButton':!this['_hasExactlyOneSource']});});}for(const _0x53df09 of _0x58a88d['customItems']||[]){const _0x289dbf=this['_createBalloonButton'](_0x221b1c,{'label':_0x53df09['label'],'icon':_0x53df09['icon']||_0x196b7a,'type':'customItem'});_0x5b664b['content']['add'](_0x289dbf),_0x289dbf['on']('execute',()=>{this['hideAddContextBalloonPanel'](),this['fire']('executeCustomItemCallback',_0x53df09);});}this['_hasExactlyOneSource']=0x1===_0x5b664b['content']['length'],this['_urlInputView']['withBackButton']=!this['_hasExactlyOneSource'];}['_addUrlContent'](_0x961c24,_0x5e7f5d){this['_urlInputView']=new wr(_0x5e7f5d),this['_urlInputView']['on']('submitUrl',(_0x535df2,_0x1cee86)=>{this['_handleUrlSubmit'](_0x1cee86);}),this['_urlInputView']['on']('cancel',()=>{this['hideUrlBalloonPanel'](),this['_hasExactlyOneSource']||(this['showAddContextBalloonPanel'](),this['_addContextBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':Xr}));}),this['_urlInputView']['on']('refreshBalloon',()=>{this['_urlBalloonPanelView']['isVisible']&&this['_urlBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':Xr});}),_0x961c24['content']['add'](this['_urlInputView']);}['_createBalloonButton'](_0x18184c,_0x25da38){const _0x2e99cd='source'===_0x25da38['type']?new jr(_0x18184c):new Nt(_0x18184c);return _0x2e99cd['set']({'label':_0x25da38['label'],'icon':_0x25da38['icon'],'withText':!0x0,'tooltip':!0x0,'tooltipPosition':'sw','class':Fr}),_0x2e99cd;}['_setupAllBalloonClickOutsideHandlers'](){this['_setupAddContextBalloonClickOutsideHandler'](),this['_setupUrlBalloonClickOutsideHandler']();}['_setupUrlBalloonClickOutsideHandler'](){zt({'emitter':this['_urlBalloonPanelView'],'contextElements':[this['_urlBalloonPanelView']['element']],'callback':()=>{this['hideUrlBalloonPanel']();},'activator':()=>this['_urlBalloonPanelView']['isVisible']});}['_toggleAddContextBalloon'](_0x4fe54f){const _0x4b630d=this['_addContextBalloonConfig'];_0x4b630d['buttonView']['isOn']=_0x4fe54f,_0x4fe54f?_0x4b630d['balloonView']['show']():_0x4b630d['balloonView']['hide']();}['_setupAddContextBalloonClickOutsideHandler'](){const {balloonView:_0x401783,buttonView:_0x270889,hideMethod:_0x344c94}=this['_addContextBalloonConfig'];zt({'emitter':_0x401783,'contextElements':[_0x401783['element'],_0x270889['element']],'callback':()=>{_0x344c94();},'activator':()=>_0x270889['isOn']&&!this['_urlBalloonPanelView']['isVisible']&&!this['_resourcesBalloonView']['isAnyResourceBalloonVisible']()});}['_createContextButton'](_0x1ea884,_0x5a4cf4,_0x4262e2=!0x1,_0x100ff7=!0x1){const _0x17df9='conversation'===_0x5a4cf4||!0x0===_0x1ea884['isReadOnly'],_0x1d9767=new Bn(this['locale'],_0x1ea884,_0x17df9,_0x4262e2,_0x100ff7);return _0x17df9||_0x1d9767['on']('removeContextItemChip',()=>{this['fire']('removeContextItem',_0x1d9767['id']);}),_0x1d9767;}['_addContextToCollection'](_0x8ad8c4,_0x50b53a){_0x50b53a['add'](_0x8ad8c4,0x0);}['_removeContextFromCollection'](_0x30368c,_0x430416){const _0x5df686=_0x430416['find'](_0x1630e6=>_0x1630e6['id']===_0x30368c);_0x5df686&&_0x430416['remove'](_0x5df686);}['_handleAddContextButtonClick'](){this['addContextButtonView']['isOn']?this['hideAddContextBalloonPanel']():(this['showAddContextBalloonPanel'](),this['_addContextBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':Xr}),this['_hasExactlyOneSource']&&this['_addContextBalloonPanelView']['content']['get'](0x0)?.['fire']('execute'));}['_handleUrlSubmit'](_0x32f0eb){this['_urlInputView']['clear'](),this['hideUrlBalloonPanel'](),this['fire']('addUrlToContext',_0x32f0eb);}}class jr extends Nt{['arrowView'];constructor(_0x2c6c41){super(_0x2c6c41),this['set']({'withText':!0x0,'role':'menuitem'}),this['arrowView']=this['_createArrowView'](),this['extendTemplate']({'attributes':{'class':[Kr]}});}['render'](){super['render'](),this['children']['add'](this['arrowView']);}['_createArrowView'](){const _0x45b689=new xt();return _0x45b689['content']=_0xa36a14,_0x45b689['extendTemplate']({'attributes':{'class':Kr+'__arrow'}}),_0x45b689;}}class Jr extends vt{['_cancelButtonView'];['_loaderView'];constructor(_0x5f3968){super(_0x5f3968),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 _0xc191b0=new Nt(this['locale']);return _0xc191b0['set']({'label':hs(this['locale'],'AI_CHAT_STOP_GENERATING'),'withText':!0x0,'class':ls+'\x20ck-ai-button-stop-generating','icon':_0x25a26a}),_0xc191b0['on']('execute',()=>{this['fire']('abortPromptStream');}),_0xc191b0;}['_createLoaderView'](){const _0x18df8f=new vt(this['locale']);return _0x18df8f['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':hs(this['locale'],'AI_CHAT_IS_WRITING')}]}),_0x18df8f;}}class Zr extends vt{['_contextPanelView'];['_promptInputView'];['_promptCapabilitiesView'];['_loaderView'];['_modelUnavailableMessageView'];['_shouldRestorePromptInputFocus'];constructor(_0x4c9f1e,_0x1cb706){super(_0x4c9f1e),this['_contextPanelView']=this['_createContextPanelView'](_0x4c9f1e,{'bodyCollection':_0x1cb706['bodyCollection'],'searchInputVisibleFrom':_0x1cb706['contextResourcesSearchInputVisibleFrom']}),this['_promptInputView']=this['_createPromptInputView'](_0x4c9f1e),this['_promptCapabilitiesView']=this['_createPromptCapabilitiesView'](_0x4c9f1e),this['_loaderView']=this['_createLoaderView'](_0x4c9f1e),this['_modelUnavailableMessageView']=this['_createModelUnavailableMessageView'](_0x4c9f1e),this['_shouldRestorePromptInputFocus']=!0x1,this['_promptInputView']['delegate']('sendUserMessage')['to'](this),this['_loaderView']['delegate']('abortPromptStream')['to'](this),this['_promptCapabilitiesView']['delegate']('toggleWebSearch')['to'](this),this['_promptCapabilitiesView']['delegate']('toggleReasoning')['to'](this),this['_promptCapabilitiesView']['delegate']('selectModel')['to'](this),this['_contextPanelView']['delegate'](...Hr)['to'](this),this['set']('isModelAvailable',!0x0),this['set']('isDisabled',!0x1);const _0x54f34e=this['bindTemplate'];this['setTemplate']({'tag':'form','attributes':{'class':['ck','ck-ai-chat-controls',_0x54f34e['if']('isDisabled','ck-ai-chat-controls-disabled')]},'children':[{'tag':'div','attributes':{'class':[_0x54f34e['if']('isLoading','ck-hidden',_0x16cda0=>_0x16cda0||!this['isModelAvailable']),_0x54f34e['if']('isModelAvailable','ck-hidden',_0x2a61eb=>!_0x2a61eb||this['isLoading'])]},'children':[this['_contextPanelView'],this['_promptInputView'],this['_promptCapabilitiesView']]},{'tag':'div','attributes':{'class':[_0x54f34e['if']('isLoading','ck-hidden',_0x1fc3d5=>!_0x1fc3d5)]},'children':[this['_loaderView']]},{'tag':'div','attributes':{'class':[_0x54f34e['if']('isModelAvailable','ck-hidden',_0x5f532a=>_0x5f532a)]},'children':[this['_modelUnavailableMessageView']]}]}),zt({'emitter':this['_promptInputView'],'activator':()=>this['isLoading'],'contextElements':()=>[this['element']],'callback':()=>{this['_shouldRestorePromptInputFocus']=!0x1;}}),this['on']('change:isLoading',this['_handlePromptInputFocus'],{'priority':'low'});}['_createContextPanelView'](_0x135747,_0x21183f){return new zr(_0x135747,_0x21183f);}['_createPromptInputView'](_0x668128){return new hr(_0x668128,this['_contextPanelView']['addContextButtonView']);}['_createPromptCapabilitiesView'](_0x2cbd7d){return new Er(_0x2cbd7d);}['_createLoaderView'](_0x13543f){return new Jr(_0x13543f);}['_createModelUnavailableMessageView'](_0x345e2f){const _0x12b357=new to(_0x345e2f);return _0x12b357['delegate']('startConversation')['to'](this),_0x12b357;}['_handlePromptInputFocus'](_0x1efc7f,_0x28e328,_0x2fe14f){_0x2fe14f?this['_shouldRestorePromptInputFocus']=!0x0:this['_shouldRestorePromptInputFocus']&&this['_promptInputView']['focus']();}['addContextItem'](_0x39818d,_0x1ca584){this['_contextPanelView']['addContextItem'](_0x39818d,_0x1ca584);}['removeContextItem'](_0x301cd0){this['_contextPanelView']['removeContextItem'](_0x301cd0);}['setContextItemLoading'](_0x41886c,_0x41bffa){this['_contextPanelView']['setContextItemLoading'](_0x41886c,_0x41bffa);}['setIsUploadInProgress'](_0x355703){this['_promptInputView']['setIsUploadInProgress'](_0x355703);}['setConversationContext'](_0x230da7){this['_contextPanelView']['setConversationContext'](_0x230da7);}['clearPendingContextUI'](){this['_contextPanelView']['clearCurrentContextItems']();}['clearConversationContextUI'](){this['_contextPanelView']['clearConversationContextItems']();}['updateResourceState'](_0x344750,_0x143ea1,_0x4866ce){this['_contextPanelView']['updateResourceState'](_0x344750,_0x143ea1,_0x4866ce);}['setWebSearch'](_0x4b422e){this['_promptCapabilitiesView']['setWebSearch'](_0x4b422e);}['setReasoning'](_0xc6518b){this['_promptCapabilitiesView']['setReasoning'](_0xc6518b);}['resetMessageInput'](){this['_promptInputView']['reset']();}['setAddContextOptions'](_0x4fe6ba){this['_contextPanelView']['setAddContextOptions'](_0x4fe6ba);}['setInputPlaceholder'](_0x1ffb94){this['_promptInputView']['setPlaceholderText'](_0x1ffb94);}['setModelList'](_0x55f302,_0x441064){this['_promptCapabilitiesView']['setModelList'](_0x55f302,_0x441064);}['setModel'](_0x319628){_0x319628?(this['isModelAvailable']=!0x0,this['_promptCapabilitiesView']['setModel'](_0x319628)):this['isModelAvailable']=!0x1;}['enableModelSelector'](){this['_promptCapabilitiesView']['enableModelSelector']();}['disableModelSelector'](_0x34951e){this['_promptCapabilitiesView']['disableModelSelector'](_0x34951e);}['populateSourceResourceBalloon'](_0x3f334d,_0x49f169,_0x3fd579,_0x200b4d){this['_contextPanelView']['populateSourceResourceBalloon'](_0x3f334d,_0x49f169,_0x3fd579,_0x200b4d);}['closeSourceResourceBalloon'](_0x24e6f2){this['_contextPanelView']['closeSourceResourceBalloon'](_0x24e6f2);}['focusPromptInput'](_0x5e1f1c=!0x1){this['_promptInputView']['focus'](_0x5e1f1c);}['setPromptInputValue'](_0x33cdb1){this['_promptInputView']['queryView']['fieldView']['reset'](),this['_promptInputView']['queryView']['fieldView']['value']=_0x33cdb1;}}class to extends vt{constructor(_0x858fd4){super(_0x858fd4);const _0x3afc7b=new Nt(_0x858fd4);_0x3afc7b['set']({'label':hs(this['locale'],'AI_CHAT_MODEL_UNAVAILABLE_MESSAGE_BUTTON'),'withText':!0x0,'class':['ck-ai-chat-controls__start-new-chat-button'],'tooltip':''}),_0x3afc7b['delegate']('execute')['to'](this,'startConversation'),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat-controls-model-unavailable-message']},'children':[{'tag':'p','children':[{'text':hs(this['locale'],'AI_CHAT_MODEL_UNAVAILABLE_MESSAGE_TEXT')+'\x20'},_0x3afc7b]}]});}}class eo extends _0x7a349c{['resizeButton'];constructor(_0x595348,_0x21834f){super(_0x595348,{'label':_0x21834f['label'],'class':'ck-ai-header\x20'+_0x21834f['class'],'icon':_0x21834f['icon']}),this['set']('isMaximized',!0x1),_0x21834f['content']&&this['children']['add'](_0x21834f['content']),_0x21834f['showResizeButton']&&(this['resizeButton']=ds(_0x595348,this),this['children']['add'](this['resizeButton']));}}class io extends vt{constructor(_0x509d0a){super(_0x509d0a),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-disclaimer']},'children':[{'tag':'p','attributes':{'class':['ck','ck-ai-disclaimer__content']},'children':[{'text':hs(_0x509d0a,'AI_DISCLAIMER_TEXT')}]}]});}}function so(_0x3def4c,_0x4d26c6){const _0x279bbf=new Nt(_0x3def4c);return _0x279bbf['set']({'label':hs(_0x3def4c,'AI_CHAT_LABEL_NEW_CHAT'),'withText':!0x0,'icon':_0x4b4dbe,'class':'ck-ai-chat__start-conversation\x20'+ls}),_0x279bbf['on']('execute',()=>{_0x4d26c6['fire']('startConversation');}),_0x279bbf;}class no extends vt{['chatHeader'];['chatFeed'];['chatControls'];['chatDisclaimer'];['_bodyCollection'];constructor(_0x5cb4d0,_0x1f4001){super(_0x5cb4d0),this['_bodyCollection']=new Qt(_0x5cb4d0),this['_bodyCollection']['attachToDom']();const _0x2da71e=so(_0x5cb4d0,this);this['chatHeader']=new eo(_0x5cb4d0,{'label':hs(_0x5cb4d0,'AI_CHAT_HEADING'),'icon':_0x156709,'class':'ck-ai-header_chat','content':_0x2da71e,'showResizeButton':_0x1f4001['showResizeButton']}),this['chatHeader']['delegate']('resizeTabs')['to'](this),this['chatFeed']=new rr(_0x5cb4d0,this['_bodyCollection']),this['chatFeed']['delegate'](...tn)['to'](this),this['chatControls']=new Zr(_0x5cb4d0,{'bodyCollection':this['_bodyCollection'],'contextResourcesSearchInputVisibleFrom':_0x1f4001['contextResourcesSearchInputVisibleFrom']}),this['chatControls']['delegate'](...tn)['to'](this),this['chatDisclaimer']=new io(_0x5cb4d0),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset_all','ck-ai-chat','ck-rounded-corners'],'dir':_0x5cb4d0['uiLanguageDirection']},'children':[this['chatHeader'],this['chatFeed'],this['chatControls'],this['chatDisclaimer']]});}['populateSourceResourceBalloon'](_0x4b9dc6,_0xaf6e39,_0x5dfb87,_0x2e1214){this['chatControls']['populateSourceResourceBalloon'](_0x4b9dc6,_0xaf6e39,_0x5dfb87,_0x2e1214);}['closeSourceResourceBalloon'](_0x5c9fd8){this['chatControls']['closeSourceResourceBalloon'](_0x5c9fd8);}['destroy'](){this['_bodyCollection']['detachFromDom'](),super['destroy']();}}class ro extends _0x203d97{static get['requires'](){return[os];}['_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(_0x3e563b){super(_0x3e563b);const _0x54cbe1=this['context']['plugins']['get']('AITabs');this['set']('isBusy',!0x1),this['_promiseQueue']=new Cn(),this['_view']=new no(this['context']['locale'],{'showResizeButton':_0x54cbe1['showResizeButton'],'contextResourcesSearchInputVisibleFrom':this['context']['config']['get']('ai.chat.context.searchInputVisibleFrom')}),this['_view']['delegate']('resizeTabs')['to'](_0x54cbe1),this['_view']['delegate'](...tn)['to'](this),this['_view']['on']('toggleSuggestionDisplayMode',(_0x22f425,{showDiff:_0x4edc2f})=>{this['showDiff']=_0x4edc2f;}),_0x54cbe1['view']['addTab']({'id':'chat','buttonLabel':hs(this['context']['locale'],'AI_CHAT_HEADING'),'buttonIcon':_0x156709,'order':0x0,'content':this['_view']}),this['_view']['chatHeader']['bind']('isMaximized')['to'](_0x54cbe1['view'],'isMaximized',_0x4ef3fe=>_0x4ef3fe),this['_view']['chatControls']['bind']('isLoading')['to'](this,'isBusy',_0xfaff46=>_0xfaff46),this['_view']['chatControls']['setInputPlaceholder'](this['_getInputPlaceholder']()),this['bind']('isModelAvailable')['to'](this['_view']['chatControls'],'isModelAvailable');}['destroy'](){super['destroy'](),this['_titleAnimationInterval']&&clearInterval(this['_titleAnimationInterval']);}['createConversation'](_0x130d28){const _0x5a6870=this['context']['config']['get']('ai.chat.welcomeMessage')??hs(this['context']['locale'],'AI_CHAT_WELCOME_MESSAGE');this['_view']['chatFeed']['clear'](),this['_view']['chatControls']['enableModelSelector'](),this['_view']['chatControls']['setModelList'](_0x130d28['availableModels'],!this['context']['config']['get']('ai.models.showModelSelector')),this['addFeedItemStaticMessage']({'id':'conversation-start','staticMessage':_0x5a6870}),this['fire']('conversationCreated');}async['addFeedItemStaticMessage']({id:_0xeb503e,staticMessage:_0x39af6c}){return this['_promiseQueue']['enqueue'](async()=>{this['_view']['chatFeed']['addItem']('ai-reply',{'id':_0xeb503e,'initialContent':'<p>'+_0x39af6c+'</p>'});});}async['addFeedItemUserMessage'](_0x1268b0){const _0xe1236f=_0x1268b0['attributes']?.['displayedPrompt']||_0x1268b0['userMessage'];return this['_promiseQueue']['enqueue'](async()=>{this['_view']['chatFeed']['addItem']('user-message',{'contextItems':Array['from'](_0x1268b0['contextItems']['values']()),'initialContent':'<p>'+_0xe1236f+'</p>','id':_0x1268b0['id']});});}async['addFeedItemError']({errorMessage:_0x30c54a,id:_0x5df789}){return this['_promiseQueue']['enqueue'](async()=>{this['_view']['chatFeed']['addItem']('error-message',{'initialContent':'<p>'+_0x30c54a+'</p>','id':_0x5df789});});}async['addFeedItemAIReply'](_0x51e06f){return this['_promiseQueue']['enqueue'](async()=>{this['_view']['chatFeed']['addItem']('ai-reply',{'id':_0x51e06f['interactionId']+':'+_0x51e06f['id']}),this['clearLoadingMessage']();});}async['addFeedItemAISuggestion'](_0x4d1c0f){const _0x5dab71=$s(this['context']);let _0x18f3f4=_0x5dab71['config']['get']('ai.availableReplyActions')||[...fn];if(_0x5dab71['plugins']['has']('TrackChanges')){if(!this['_isTrackChangesCommandValueBound']){this['_isTrackChangesCommandValueBound']=!0x0;const _0x317530=_0x5dab71['commands']['get']('trackChanges');this['_view']['chatFeed']['bind']('isTrackChangesOn')['to'](_0x317530,'value');}}else _0x18f3f4=_0x18f3f4['filter'](_0x2ea745=>'insertSuggestion'!=_0x2ea745);return this['_promiseQueue']['enqueue'](async()=>{this['_view']['chatFeed']['addItem']('ai-suggestion-reply',{'id':_0x4d1c0f['interactionId']+':'+_0x4d1c0f['id'],'areActionsDisabled':_0x4d1c0f['areActionsDisabled'],'showDiff':this['showDiff'],'availableActions':_0x18f3f4}),this['clearLoadingMessage']();});}async['addFeedInteractionHeader'](_0x507e31,_0x2c6f2b){return this['_promiseQueue']['enqueue'](async()=>{const _0x3aa5ac=this['_view']['chatFeed']['children']['last'];if(_0x3aa5ac instanceof Zn)return this['_view']['chatFeed']['children']['remove'](_0x3aa5ac),void this['_view']['chatFeed']['addItem']('interaction-header',{'id':_0x507e31['id'],'capabilities':{'isWebSearchEnabled':_0x3aa5ac['capabilities']['isWebSearchEnabled']||_0x2c6f2b['isWebSearchEnabled'],'isReasoningEnabled':_0x3aa5ac['capabilities']['isReasoningEnabled']||_0x2c6f2b['isReasoningEnabled']}});this['_view']['chatFeed']['addItem']('interaction-header',{'id':_0x507e31['id'],'capabilities':_0x2c6f2b});});}async['addFeedItemCustomElement'](_0x1ba83a,_0x19ba2c){let _0xdbc47a;return await this['_promiseQueue']['enqueue'](async()=>{_0xdbc47a=this['_view']['chatFeed']['addItem']('custom-element',{'content':_0x1ba83a,'id':_0x19ba2c});}),_0xdbc47a;}['removeFeedItem'](_0x2f35c8){this['_view']['chatFeed']['removeItem'](_0x2f35c8);}['hasFeedItem'](_0x2713db){return this['_view']['chatFeed']['hasItem'](_0x2713db);}['updateFeedInteractionHeader'](_0x275358){const _0x1aae4a=this['_view']['chatFeed']['children']['find'](_0xe5e28a=>_0xe5e28a['options']['id']==_0x275358['id']&&_0xe5e28a instanceof Zn);_0x1aae4a&&_0x1aae4a['set']('isVisible',_0x275358['isVisible']);}async['updateFeedItemAIReplyContent'](_0x3a6a64){const _0x1715d7=_0x3a6a64['renderingStrategy']||this['feedItemRenderingStrategy'];return this['_promiseQueue']['enqueue'](async _0x1c18f1=>{await this['_view']['chatFeed']['updateReplyItem']({..._0x3a6a64,'abortSignal':_0x1c18f1,'renderingStrategy':_0x1715d7}),_0x3a6a64['isDone']&&this['markFeedItemAsDone'](_0x3a6a64['id']);});}['updateFeedItemAIReplySources'](_0x12fdfb,_0x35bcc1){this['_view']['chatFeed']['updateWebSources'](_0x12fdfb,_0x35bcc1);}async['updateFeedItemAIReplySuggestionContent'](_0x322ccc){return this['_promiseQueue']['enqueue'](async _0x2cc147=>{await this['_view']['chatFeed']['updateSuggestionItem']({..._0x322ccc,'abortSignal':_0x2cc147}),_0x322ccc['isDone']&&this['markFeedItemAsDone'](_0x322ccc['id']);});}['updateFeedItemAIReplySuggestionPartState'](_0x4203e9){this['_view']['chatFeed']['updateSuggestionPartState'](_0x4203e9);}['setFeedItemAIReplySuggestionPartActive'](_0xf838ef){this['_view']['chatFeed']['setSuggestionPartActive'](_0xf838ef);}['markFeedItemAsDone'](_0x190f15){this['_view']['chatFeed']['markItemAsDone'](_0x190f15);}['removeFeedInteraction'](_0x2d2a9c){this['_view']['chatFeed']['getItemIds']()['filter'](_0x534ddc=>_0x534ddc['startsWith'](_0x2d2a9c))['forEach'](_0xa37c4f=>this['_view']['chatFeed']['removeItem'](_0xa37c4f));}['startInteraction'](){const _0x1cd8f7=this['prepareLoadingMessage']({'isWebSearchEnabled':!0x1,'isReasoningEnabled':!0x1});this['setLoadingMessage'](_0x1cd8f7),this['_view']['chatControls']['disableModelSelector'](!this['context']['config']['get']('ai.models.showModelSelector')),this['isBusy']=!0x0,this['_view']['chatFeed']['startAutoScroll']();}['stopInteraction'](_0xebc7cc){this['_promiseQueue']['abort'](),this['_view']['chatFeed']['getItemIds']()['filter'](_0x4c689f=>_0x4c689f['startsWith'](_0xebc7cc['id']))['forEach'](_0x149579=>this['markFeedItemAsDone'](_0x149579)),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'](_0x553419,_0x343e50){this['_view']['chatControls']['addContextItem'](_0x553419,_0x343e50);}['removeContextItem'](_0x2f0141){this['_view']['chatControls']['removeContextItem'](_0x2f0141);}['setContextItemLoading'](_0x411142,_0x1b64c7){this['_view']['chatControls']['setContextItemLoading'](_0x411142,_0x1b64c7);}['setIsUploadInProgress'](_0x19381a){this['_view']['chatControls']['setIsUploadInProgress'](_0x19381a);}['setConversationContext'](_0x57df46){this['_view']['chatControls']['setConversationContext'](_0x57df46);}['clearPendingContextUI'](){this['_view']['chatControls']['clearPendingContextUI']();}['clearConversationContextUI'](){this['_view']['chatControls']['clearConversationContextUI']();}['updateResourceState'](_0x18f402,_0x4b1e6a,_0x20553c){this['_view']['chatControls']['updateResourceState'](_0x18f402,_0x4b1e6a,_0x20553c);}['resetMessageInput'](){this['_view']['chatControls']['resetMessageInput'](),this['_view']['chatControls']['setInputPlaceholder'](this['_getInputPlaceholder']());}['setAddContextOptions'](_0x59704e){this['_view']['chatControls']['setAddContextOptions'](_0x59704e);}['updateCapabilities'](_0x2003f2){this['_view']['chatControls']['setWebSearch'](_0x2003f2['isWebSearchEnabled']),this['_view']['chatControls']['setReasoning'](_0x2003f2['isReasoningEnabled']),this['_view']['chatControls']['setInputPlaceholder'](this['_getInputPlaceholder'](_0x2003f2));}['setSelectedModel'](_0x5d1362,_0xfaba0e){this['_view']['chatControls']['setModel'](_0x5d1362),_0xfaba0e&&this['_view']['chatControls']['disableModelSelector'](!0x1);}['setFeedItemRenderingStrategy'](_0x3e293d){this['feedItemRenderingStrategy']=_0x3e293d;}['toggleLoadingSkeleton'](_0x188157){this['_view']['chatFeed']['toggleLoadingSkeleton'](_0x188157);}['resetConversationTitle'](){this['setConversationTitle'](hs(this['context']['locale'],'AI_CHAT_HEADING'));}['setConversationTitle'](_0x1edcfe,_0x33c73c=!0x1){if(_0x33c73c&&!St()&&_0x1edcfe['length'])return this['_view']['chatHeader']['label']='',void this['_animateConversationTitle'](_0x1edcfe);this['_view']['chatHeader']['label']=_0x1edcfe;}['setLoadingMessage'](_0x2f38d5){this['_view']['chatFeed']['setLoadingMessage'](_0x2f38d5);}['clearLoadingMessage'](){this['_view']['chatFeed']['setLoadingMessage']('');}['_animateConversationTitle'](_0x147e6d){let _0x39661d=0x0;clearInterval(this['_titleAnimationInterval']),this['_titleAnimationInterval']=setInterval(()=>{this['_view']['chatHeader']['label']=this['_view']['chatHeader']['label']+_0x147e6d[_0x39661d],_0x39661d++,_0x39661d===_0x147e6d['length']&&clearInterval(this['_titleAnimationInterval']);},0x1e);}['prepareLoadingMessage'](_0x48fa4c){return _0x48fa4c['isWebSearchEnabled']&&_0x48fa4c['isReasoningEnabled']?hs(this['context']['locale'],'AI_CHAT_FEED_LOADING_MESSAGE_WEBSEARCH_REASONING'):_0x48fa4c['isWebSearchEnabled']?hs(this['context']['locale'],'AI_CHAT_FEED_LOADING_MESSAGE_WEBSEARCH'):_0x48fa4c['isReasoningEnabled']?hs(this['context']['locale'],'AI_CHAT_FEED_LOADING_MESSAGE_REASONING'):hs(this['context']['locale'],'AI_CHAT_FEED_LOADING_MESSAGE_REGULAR');}['_getInputPlaceholder'](_0x3efb73){return _0x3efb73?_0x3efb73['isWebSearchEnabled']&&_0x3efb73['isReasoningEnabled']?hs(this['context']['locale'],'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_WEBSEARCH_REASONING'):_0x3efb73['isWebSearchEnabled']?hs(this['context']['locale'],'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_WEBSEARCH'):_0x3efb73['isReasoningEnabled']?hs(this['context']['locale'],'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_REASONING'):hs(this['context']['locale'],'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_REGULAR'):hs(this['context']['locale'],'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_REGULAR');}['populateSourceResourceBalloon'](_0x47c953,_0x2e7dad,_0xf1e0de,_0x3eca6a){this['_view']['populateSourceResourceBalloon'](_0x47c953,_0x2e7dad,_0xf1e0de,_0x3eca6a);}['closeSourceResourceBalloon'](_0x4e79d3){this['_view']['closeSourceResourceBalloon'](_0x4e79d3);}['setPromptInputValue'](_0x32b264){this['_view']['chatControls']['setPromptInputValue'](_0x32b264);}['focusPromptInput'](_0x517195=!0x1){this['_view']['chatControls']['focusPromptInput'](_0x517195);}['scrollFeedToSuggestion'](_0x45bd62,_0x1d4f1d){this['_view']['chatFeed']['scrollToSuggestion'](_0x45bd62,_0x1d4f1d);}['startAutoScroll'](_0x1a9ccd={}){this['_view']['chatFeed']['startAutoScroll'](_0x1a9ccd);}['disableControls'](){this['_view']['chatControls']['isDisabled']=!0x0;}['enableControls'](){this['_view']['chatControls']['isDisabled']=!0x1;}}class oo extends Dt{['sections'];constructor(_0x2a2ff6,_0x3e3f80){super(_0x2a2ff6),this['sections']=_0x3e3f80,this['items']['addMany'](this['sections']),this['extendTemplate']({'attributes':{'class':['ck-ai-chat-history__sections']}});}['filter'](_0x35b940){let _0x33a8bc=0x0,_0x4f04d4=0x0;for(const _0x69ca0b of this['sections']){const {resultsCount:_0x4c7ef4,totalItemsCount:_0x431167}=_0x69ca0b['filter'](_0x35b940);_0x33a8bc+=_0x4c7ef4,_0x4f04d4+=_0x431167;}return{'resultsCount':_0x33a8bc,'totalItemsCount':_0x4f04d4};}}class ao extends Ht{['title'];['itemsViews'];['_itemsListView'];constructor(_0x2aee17,{title:_0x222b7d,items:_0x32b86a}){super(_0x2aee17);const _0x93885d=this['bindTemplate'];this['set']('isVisible',!0x0),this['title']=_0x222b7d,this['itemsViews']=_0x32b86a;const _0x73a42=new vt(_0x2aee17);_0x73a42['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-chat-history__section-title']},'children':[this['title']]}),this['_itemsListView']=new Dt(_0x2aee17),this['_itemsListView']['items']['addMany'](this['itemsViews']),this['setTemplate']({'tag':'li','attributes':{'class':['ck-ai-chat-history__section',_0x93885d['if']('isVisible','ck-hidden',_0x1fbb9e=>!_0x1fbb9e)]},'children':[_0x73a42,this['_itemsListView']]});}['filter'](_0x29626a){const _0x2e0e38=this['itemsViews']['length'];let _0x1bd83c=0x0;for(const _0x511da1 of this['itemsViews']){if(_0x29626a){const _0xb88a53=_0x511da1['isMatching'](_0x29626a);_0x511da1['isVisible']=!!_0xb88a53,_0x511da1['highlightText'](_0x29626a);}else _0x511da1['isVisible']=!0x0,_0x511da1['highlightText'](null);_0x511da1['isVisible']&&_0x1bd83c++;}return this['isVisible']=_0x1bd83c>0x0,{'resultsCount':_0x1bd83c,'totalItemsCount':_0x2e0e38};}['getItem'](_0x303652){return this['itemsViews']['find'](_0x426811=>_0x426811['id']===_0x303652);}['removeItem'](_0x517297){const _0x685243=this['itemsViews']['indexOf'](_0x517297);-0x1!==_0x685243&&(this['itemsViews']['splice'](_0x685243,0x1),this['_itemsListView']['items']['remove'](_0x517297));}}class ho extends/* #__PURE__ -- @preserve */
27
+ _0x47bae9(Ht){['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(_0xb94a4b,_0xd6a0d4){super(_0xb94a4b);const _0x47d486=this['bindTemplate'];this['set']('isEdit',!0x1),this['set']('isVisible',!0x0),this['set']('pinned',!!_0xd6a0d4['pinned']),this['set']('loadingState',null),this['set']('title',_0xd6a0d4['title']),this['id']=_0xd6a0d4['id'];const {createdAt:_0x4d52f0,active:_0x1f8b4c=!0x1}=_0xd6a0d4;this['_titleView']=new _0x149c0b(),this['_titleView']['bind']('text')['to'](this,'title',t=>_0x3e1bcc(t||'')),this['_titleView']['extendTemplate']({'attributes':{'class':['ck-ai-chat-history__item-title']}});const _0x43da52=this['_createCheckView'](),_0x91a044=this['_createPinButtonView'](_0xb94a4b),_0x39d251=this['_createMenuDropdownView'](),_0x31e416=this['_createEditInputView'](_0xb94a4b),_0x4008a3=this['_createAcceptEditButtonView'](_0xb94a4b,_0x31e416),_0x125446=this['_createCancelEditButtonView'](_0xb94a4b);this['actions']=this['createCollection'](),this['mainContent']=this['createCollection'](),this['mainContent']['add'](this['_titleView']),this['actions']['add'](_0x91a044),this['actions']['add'](_0x39d251),this['on']('change:isEdit',(_0x589f3c,_0x5f1a1e,_0x5c6625)=>{this['actions']['clear'](),this['mainContent']['clear'](),_0x5c6625?(this['actions']['add'](_0x4008a3),this['actions']['add'](_0x125446),this['mainContent']['add'](_0x31e416),_0x31e416['element']['value']=this['title']||'',_0x31e416['element']['focus']()):(this['actions']['add'](_0x91a044),this['actions']['add'](_0x39d251),this['mainContent']['add'](this['_titleView']));}),this['setTemplate']({'tag':'li','attributes':{'class':['ck-ai-chat-history__item',_0x1f8b4c?'ck-ai-chat-history__item--active':'',_0x47d486['if']('isVisible','ck-hidden',_0x5d92f9=>!_0x5d92f9),_0x47d486['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',_0x47d486['if']('loadingState','ck-hidden',_0x1633b9=>!!_0x1633b9)]},'children':_0x1f8b4c?[_0x43da52]:[]},{'tag':'div','attributes':{'class':['ck-ai-loader',_0x47d486['if']('loadingState','ck-hidden',_0xb701e7=>!_0xb701e7)]},'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',_0x47d486['if']('loadingState','ck-hidden',_0x2a2c78=>!!_0x2a2c78)]},'children':this['mainContent']},{'tag':'div','attributes':{'class':['ck-ai-loader__text',_0x47d486['if']('loadingState','ck-hidden',_0x1ae003=>!_0x1ae003)]},'children':[{'text':_0x47d486['to']('loadingState',_0x8bcd75=>_0x8bcd75?hs(this['locale'],ho['LOADING_LABELS'][_0x8bcd75]):'')}]}]},{'tag':'span','attributes':{'class':['ck-ai-chat-history__item-date']},'children':[_0x4d52f0]}]},{'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'](_0x259c51){this['set']('title',_0x259c51);}['updateLoadingState'](_0x47b5f0,_0x373fda){this['set']('loadingState',_0x373fda?_0x47b5f0:null);}['_createCheckView'](){const _0x50533c=new xt();return _0x50533c['set']({'content':_0x2204df}),_0x50533c;}['_createPinButtonView'](_0x2ed5ac){const _0x1ce280=new Nt(_0x2ed5ac);return _0x1ce280['set']({'label':hs(_0x2ed5ac,'AI_CHAT_HISTORY_PIN_BUTTON'),'icon':_0x24484f,'withText':!0x1,'tooltip':!0x0}),_0x1ce280['bind']('isOn')['to'](this,'pinned'),_0x1ce280['on']('execute',()=>{const _0x480a78=!this['pinned'];this['fire']('setConversationPinned',{'id':this['id'],'pinned':_0x480a78});}),_0x1ce280;}['_createMenuDropdownView'](){const _0x7fd0a1=Gt(this['locale']),_0x69fcda=_0x7fd0a1['panelView']['children'];_0x7fd0a1['buttonView']['set']({'label':hs(this['locale'],'AI_CHAT_HISTORY_SHOW_MORE_ITEMS'),'icon':_0x5a6e34}),_0x7fd0a1['panelPosition']='sw';const _0x39ae6a=new Nt(this['locale']);_0x39ae6a['label']=hs(this['locale'],'AI_CHAT_HISTORY_EDIT_NAME'),_0x39ae6a['withText']=!0x0,_0x39ae6a['on']('execute',()=>{this['isEdit']=!0x0;});const _0x50df99=new Nt(this['locale']);_0x50df99['label']=hs(this['locale'],'AI_CHAT_HISTORY_REMOVE'),_0x50df99['withText']=!0x0,_0x50df99['on']('execute',()=>{this['showConfirm'](hs(this['locale'],'AI_CHAT_HISTORY_REMOVE_CONFIRM'),this['element'])['then'](()=>{this['fire']('removeConversation',{'id':this['id']});});});const _0x56377b=new Dt(this['locale']),_0x3c2bc3=new Ht(this['locale']);_0x3c2bc3['children']['add'](_0x39ae6a);const _0x3f5492=new Ht(this['locale']);return _0x3f5492['children']['add'](_0x50df99),_0x56377b['items']['addMany']([_0x3c2bc3,_0x3f5492]),_0x69fcda['add'](_0x56377b),_0x7fd0a1;}['_createEditInputView'](_0x3c095c){const _0x120edd=new _0x974836(_0x3c095c),_0x21f0da=_0x120edd['bindTemplate'];return _0x120edd['extendTemplate']({'on':{'keydown':_0x21f0da['to'](_0x17d000=>{'Enter'==_0x17d000['key']&&this['_commitEditInputValue'](_0x120edd);})}}),_0x120edd;}['_createAcceptEditButtonView'](_0x27530d,_0x283a42){const _0x1b1eee=new Nt(_0x27530d);return _0x1b1eee['set']({'icon':_0x2204df,'withText':!0x1,'tooltip':hs(_0x27530d,'AI_CHAT_HISTORY_ACCEPT')}),_0x1b1eee['extendTemplate']({'attributes':{'class':['ck-confirm-view-submit']}}),_0x1b1eee['on']('execute',()=>{this['_commitEditInputValue'](_0x283a42);}),_0x1b1eee;}['_commitEditInputValue'](_0xe303b6){const _0x9ed1fc=_0xe303b6['element']['value']||'';this['isEdit']=!0x1,this['fire']('editConversationTitle',{'id':this['id'],'title':_0x9ed1fc});}['_createCancelEditButtonView'](_0x57b2a0){const _0x56ecdf=new Nt(_0x57b2a0);return _0x56ecdf['set']({'icon':_0x104621,'withText':!0x1,'tooltip':hs(_0x57b2a0,'AI_CHAT_HISTORY_CANCEL')}),_0x56ecdf['extendTemplate']({'attributes':{'class':['ck-confirm-view-cancel']}}),_0x56ecdf['on']('execute',()=>{this['isEdit']=!0x1,this['fire']('edit:cancel');}),_0x56ecdf;}['_createSpinnerView'](){const _0x30e72f=new yn('tiny');return _0x30e72f['isVisible']=!0x0,_0x30e72f;}['isMatching'](_0x65528d){return'string'==typeof this['title']&&this['title']['match'](_0x65528d)?{'title':!0x0}:null;}['highlightText'](_0x3ca4d3){this['_titleView']['highlightText'](_0x3ca4d3);}}class co extends vt{['headerView'];['searchView'];['mainErrorView'];['skeletonView'];['emptyView'];['sectionsView'];constructor(_0x19d7ae,_0x2e96d1){super(_0x19d7ae),this['set']('hasItems',!0x1),this['set']('isLoading',!0x0),this['set']('errorMessage',''),this['set']('isSearchViewVisible',!0x1),this['set']('isEmptyViewVisible',!0x1),this['set']('isMainErrorViewVisible',!0x1);const _0xbb9686=so(_0x19d7ae,this);this['headerView']=new eo(_0x19d7ae,{'label':hs(_0x19d7ae,'AI_CHAT_HISTORY_HEADING'),'icon':_0x4a149c,'class':'ck-ai-header_history','content':_0xbb9686,'showResizeButton':_0x2e96d1}),this['headerView']['delegate']('resizeTabs')['to'](this),this['sectionsView']=new oo(_0x19d7ae,[]),this['sectionsView']['delegate'](...lo)['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',_0x4957fa=>!_0x4957fa)]}}),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 _0x45649e=new _0x1b1ba3(this['locale'],{'filteredView':this['sectionsView'],'queryView':{'label':hs(this['locale'],'AI_CHAT_HISTORY_SEARCH_LABEL')},'infoView':{'text':{'notFound':{'primary':_0x2b2a0f=>hs(this['locale'],'AI_CHAT_HISTORY_SEARCH_NOT_FOUND_PRIMARY',_0x2b2a0f),'secondary':hs(this['locale'],'AI_CHAT_HISTORY_SEARCH_NOT_FOUND_SECONDARY')}}}}),_0x13245f=this['_createErrorView']();return _0x13245f['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('errorMessage','ck-hidden',_0x1d3f08=>!_0x1d3f08)]}}),_0x45649e['on']('render',()=>{_0x45649e['children']['add'](_0x13245f,0x1);}),_0x45649e['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isSearchViewVisible','ck-hidden',_0x4797a5=>!_0x4797a5)]}}),_0x45649e;}['_createSkeletonView'](){const _0x367814=new pn(this['locale'],mn['aiHistory']);return _0x367814['bind']('isVisible')['to'](this,'isLoading'),_0x367814;}['_createErrorView'](){const _0x31eb74=new vt(this['locale']),_0x561daf=new Nt(this['locale']);_0x561daf['set']({'withText':!0x1,'icon':_0x104621,'class':'ck-ai-notification_error__dismiss-button'}),_0x561daf['bind']('isVisible')['to'](this,'hasItems',_0x263eff=>!!_0x263eff),_0x561daf['on']('execute',()=>{this['errorMessage']='';});const _0x2bface=this['bindTemplate'];return _0x31eb74['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-notification','ck-ai-notification_error']},'children':[{'tag':'p','children':[{'text':_0x2bface['to']('errorMessage')}]},_0x561daf]}),_0x31eb74;}['_createEmptyStateView'](){const _0x523deb=new vt(this['locale']);return _0x523deb['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-chat-history__empty',this['bindTemplate']['if']('isEmptyViewVisible','ck-hidden',_0x389838=>!_0x389838)]},'children':[{'tag':'p','attributes':{'class':['ck-ai-chat-history__empty-message']},'children':[hs(this['locale'],'AI_CHAT_HISTORY_EMPTY_MESSAGE')]}]}),_0x523deb;}['_createListItemViews'](_0x220ee3,_0x4e2e3e){const _0x13526f=[];for(const _0xca10cf of _0x220ee3){const _0x50b0f7=new ho(_0x4e2e3e,_0xca10cf);_0x50b0f7['delegate'](...lo)['to'](this),_0x13526f['push'](_0x50b0f7);}return _0x13526f;}['updateHistoryItemsWithCategories'](_0x53950e){const _0x1c7e2f=this['locale']||'en',_0x30c44b=[];for(const _0x95b5ed of _0x53950e){const _0x159609=this['_createListItemViews'](_0x95b5ed['items'],_0x1c7e2f);_0x30c44b['push'](new ao(_0x1c7e2f,{'title':_0x95b5ed['title'],'items':_0x159609}));}this['sectionsView']['sections']=_0x30c44b,this['sectionsView']['items']['clear'](),this['sectionsView']['items']['addMany'](_0x30c44b),this['hasItems']=_0x53950e['some'](_0x3e5dac=>_0x3e5dac['items']['length']>0x0),this['_refreshSearch']();}['removeHistoryItem'](_0x441afe){for(const _0x8aa720 of this['sectionsView']['sections']){const _0x9819a9=_0x8aa720['getItem'](_0x441afe);if(_0x9819a9){if(_0x8aa720['removeItem'](_0x9819a9),0x0===_0x8aa720['itemsViews']['length']){const _0x25cf9b=this['sectionsView']['sections']['indexOf'](_0x8aa720);-0x1!==_0x25cf9b&&(this['sectionsView']['sections']['splice'](_0x25cf9b,0x1),this['sectionsView']['items']['remove'](_0x8aa720));}this['hasItems']=this['sectionsView']['sections']['length']>0x0,this['_refreshSearch']();break;}}}['updateItemTitle'](_0x49df1e,_0x52ab7c){for(const _0x1f23a1 of this['sectionsView']['sections']){const _0x240a63=_0x1f23a1['getItem'](_0x49df1e);if(_0x240a63){_0x240a63['updateTitle'](_0x52ab7c);break;}}}['updateItemLoadingState'](_0x1c2737,_0x3a9277,_0x14fa7){for(const _0x5a72ef of this['sectionsView']['sections']){const _0x5a1634=_0x5a72ef['getItem'](_0x1c2737);if(_0x5a1634){_0x5a1634['updateLoadingState'](_0x3a9277,_0x14fa7);break;}}}['_refreshSearch'](){if(this['hasItems']){const _0x9e350a=this['searchView']['queryView']['fieldView']?.['element']?.['value']||'';this['searchView']['search'](_0x9e350a);}}}const lo=['showConversationHistory','removeConversation','editConversationTitle','setConversationPinned','selectConversation','startConversation'];class uo extends _0x203d97{static get['requires'](){return[os];}['_historyView'];static get['pluginName'](){return'AIChatHistoryUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x35b4df){super(_0x35b4df);const _0x5ae222=this['context']['plugins']['get']('AITabs');this['_historyView']=new co(this['context']['locale'],_0x5ae222['showResizeButton']),this['_historyView']['delegate']('resizeTabs')['to'](_0x5ae222),this['_historyView']['delegate'](...lo)['to'](this),this['_historyView']['headerView']['bind']('isMaximized')['to'](_0x5ae222['view'],'isMaximized',_0x53a780=>_0x53a780),_0x5ae222['view']['addTab']({'id':'history','buttonLabel':hs(this['context']['locale'],'AI_CHAT_HISTORY_HEADING'),'buttonIcon':_0x4a149c,'order':0x0,'content':this['_historyView']});}['removeHistoryItem'](_0x1eb36c){this['_historyView']['removeHistoryItem'](_0x1eb36c);}['updateItems'](_0x1aeb25){this['_historyView']['updateHistoryItemsWithCategories'](_0x1aeb25);}['updateItemTitle'](_0x44a0d2,_0x892eab){this['_historyView']['updateItemTitle'](_0x44a0d2,_0x892eab);}['updateItemLoadingState'](_0x13134a,_0x399f3b,_0x3d1041){this['_historyView']['updateItemLoadingState'](_0x13134a,_0x399f3b,_0x3d1041);}['setLoadingSkeleton'](_0x543899){this['_historyView']['isLoading']=_0x543899;}['showError'](_0x349c6b){this['_historyView']['errorMessage']=_0x349c6b;}['hideError'](){this['_historyView']['errorMessage']='';}}class _o extends ht(){['id'];['createdAt'];constructor({id:_0x1a523e,title:_0x3aaaf4,createdAt:_0x4d1c09,updatedAt:_0x27f127,pinned:_0x52fe7f}){super(),this['id']=_0x1a523e,this['createdAt']=new Date(_0x4d1c09),this['set']('title',_0x3aaaf4),this['set']('updatedAt',_0x27f127?new Date(_0x27f127):null),this['set']('pinned',_0x52fe7f||!0x1);}['updateTitle'](_0x52ed5f){this['set']('title',_0x52ed5f),this['updatedAt']=new Date();}['updatePinned'](_0x48ded5){this['set']('pinned',_0x48ded5),this['updatedAt']=new Date();}}class go extends Tt(){['items']=[];['connector'];['group'];constructor({connector:_0x2965fc,group:_0xf505d1}){super(),this['connector']=_0x2965fc,this['group']=_0xf505d1;}async['init'](){try{const _0x53e367=this['connector']['fetchConversations'](this['group']),_0x5c91eb=await _0x53e367['getConversations']();this['loadItems'](_0x5c91eb);}catch(_0x536d7b){this['fire']('error',{'error':_0x536d7b,'operation':'init'});}}['addItem'](_0x5a30d4){this['items']['push'](_0x5a30d4);}async['removeItem'](_0x1e69aa){const _0x2dae93=this['items']['findIndex'](_0x4bc360=>_0x4bc360['id']===_0x1e69aa);if(-0x1===_0x2dae93)return!0x1;try{return await this['connector']['deleteConversation'](_0x1e69aa)['execute'](),this['items']['splice'](_0x2dae93,0x1),this['fire']('itemRemoved',{'itemId':_0x1e69aa}),!0x0;}catch(_0x2ae113){return this['fire']('error',{'error':_0x2ae113,'operation':'removeItem','itemId':_0x1e69aa}),!0x1;}}['getItem'](_0x37a010){return this['items']['find'](_0x115dca=>_0x115dca['id']===_0x37a010);}async['updateItemTitle'](_0x2e5811,_0x1b060e){const _0x5b3e6e=this['getItem'](_0x2e5811);if(!_0x5b3e6e)return!0x1;try{return await this['connector']['updateConversation'](_0x2e5811,{'title':_0x1b060e})['getResult'](),_0x5b3e6e['updateTitle'](_0x1b060e),this['fire']('itemUpdated',{'itemId':_0x2e5811,'updates':{'title':_0x1b060e}}),!0x0;}catch(_0x3363a0){return this['fire']('error',{'error':_0x3363a0,'operation':'updateItemTitle','itemId':_0x2e5811}),!0x1;}}async['updateItemPinned'](_0x2c3e44,_0x5eaaa3){const _0x623f7d=this['getItem'](_0x2c3e44);if(!_0x623f7d)return!0x1;try{return await this['connector']['updateConversation'](_0x2c3e44,{'pinned':_0x5eaaa3})['getResult'](),_0x623f7d['updatePinned'](_0x5eaaa3),this['fire']('itemUpdated',{'itemId':_0x2c3e44,'updates':{'pinned':_0x5eaaa3}}),!0x0;}catch(_0x57feb1){return this['fire']('error',{'error':_0x57feb1,'operation':'updateItemPinned','itemId':_0x2c3e44}),!0x1;}}['loadItems'](_0x4f20fc){try{this['items']=[],_0x4f20fc['map'](_0x467f2d=>{this['addItem'](new _o(_0x467f2d));}),this['fire']('itemsLoaded',{'items':[...this['items']]});}catch(_0x3cd7da){this['fire']('error',{'error':_0x3cd7da,'operation':'loadItems'});}}['getItems'](_0x23480c={}){const _0x5a2009=void 0x0!==_0x23480c['pinned']&&_0x23480c['pinned'],_0x385bd3=_0x23480c['from']?new Date(_0x23480c['from']['getFullYear'](),_0x23480c['from']['getMonth'](),_0x23480c['from']['getDate']()):null,_0x4a3072=_0x23480c['to']?new Date(_0x23480c['to']['getFullYear'](),_0x23480c['to']['getMonth'](),_0x23480c['to']['getDate']()):null;return this['items']['filter'](_0x2891c3=>{if(_0x2891c3['pinned']!==_0x5a2009)return!0x1;if(_0x4a3072){const _0x987f32=new Date(_0x2891c3['createdAt']['getFullYear'](),_0x2891c3['createdAt']['getMonth'](),_0x2891c3['createdAt']['getDate']());return _0x385bd3?_0x385bd3['getTime']()===_0x4a3072['getTime']()?_0x987f32['getTime']()===_0x385bd3['getTime']():_0x987f32<_0x4a3072&&_0x987f32>=_0x385bd3:_0x987f32<_0x4a3072;}return!0x0;});}}class Ao extends _0x203d97{['_aiConnector'];['_aiChatHistoryUi'];['_aiChatController'];static get['requires'](){return[as,Xs,uo,os];}static get['pluginName'](){return'AIChatHistoryController';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){this['_aiConnector']=this['context']['plugins']['get'](as),this['_aiChatHistoryUi']=this['context']['plugins']['get'](uo),this['_aiChatController']=this['context']['plugins']['get'](Xs);const _0x1ddf7e=this['context']['plugins']['get'](os);try{const _0x3514d7=this['_aiChatController']['getGroupId']();this['history']=new go({'connector':this['_aiConnector'],'group':_0x3514d7}),this['listenTo'](this['_aiChatHistoryUi'],'removeConversation',(_0x24b0df,_0x4a2be1)=>{this['_setItemLoading'](_0x4a2be1['id'],'remove'),this['_handleRemove'](_0x4a2be1['id']);}),this['listenTo'](this['_aiChatHistoryUi'],'editConversationTitle',(_0x588f22,_0x2b7517)=>{this['_setItemLoading'](_0x2b7517['id'],'rename'),this['_handleEditTitle'](_0x2b7517['id'],_0x2b7517['title']);}),this['listenTo'](this['history'],'itemUpdated',(_0x1c8419,_0x551e35)=>{void 0x0!==_0x551e35['updates']['title']&&this['_aiChatHistoryUi']['updateItemTitle'](_0x551e35['itemId'],_0x551e35['updates']['title']),void 0x0!==_0x551e35['updates']['pinned']&&this['_updateHistoryItemsUI'](),this['_clearItemLoading'](_0x551e35['itemId']);}),this['listenTo'](this['history'],'itemRemoved',(_0x353e1c,_0x2ba500)=>{this['_aiChatController']['_handleRemovedConversation'](_0x2ba500['itemId']),this['_aiChatHistoryUi']['removeHistoryItem'](_0x2ba500['itemId']),this['_clearItemLoading'](_0x2ba500['itemId']);}),this['listenTo'](this['history'],'itemsLoaded',()=>{this['_updateHistoryItemsUI']();}),this['listenTo'](this['history'],'error',(_0x142a44,_0x527047)=>{this['_handleHistoryErrorUI'](_0x527047['error'],_0x527047['operation'],_0x527047['itemId']);}),this['listenTo'](this['_aiChatHistoryUi'],'selectConversation',(_0x409b32,_0x26b10e)=>{this['_handleSelectConversation'](_0x26b10e['id']);}),this['listenTo'](this['_aiChatHistoryUi'],'setConversationPinned',(_0x441881,_0x461279)=>{const _0x5a3a84=_0x461279['pinned']?'pin':'unpin';this['_setItemLoading'](_0x461279['id'],_0x5a3a84),this['_handleTogglePin'](_0x461279['id'],_0x461279['pinned']);}),this['listenTo'](this['_aiChatHistoryUi'],'startConversation',()=>{this['_aiChatController']['startConversation'](),_0x1ddf7e['view']['activateTab']('chat');}),this['listenTo'](this['_aiChatController'],'change:activeConversation',()=>{this['_updateHistoryItemsUI']();}),_0x1ddf7e['view']['on']('activateTab:history',()=>{this['_showConversationHistory']();});}catch(_0x35169c){this['_handleHistoryErrorUI'](_0x35169c,'init');}}async['_handleEditTitle'](_0x48b5de,_0x4b0665){await this['history']['updateItemTitle'](_0x48b5de,_0x4b0665);}async['_handleTogglePin'](_0x23ecbd,_0x5587ca){await this['history']['updateItemPinned'](_0x23ecbd,_0x5587ca);}async['_handleRemove'](_0x3fb334){await this['history']['removeItem'](_0x3fb334);}async['_handleSelectConversation'](_0x198d2e){await this['_aiChatController']['loadConversation'](_0x198d2e);}async['_showConversationHistory'](){this['_aiChatHistoryUi']['showError'](''),this['_aiChatHistoryUi']['setLoadingSkeleton'](!0x0),await this['history']['init'](),this['_aiChatHistoryUi']['setLoadingSkeleton'](!0x1);}['_updateHistoryItemsUI'](){const _0x6dd7ad=this['_aiChatController']['activeConversation']?.['id'],_0x217b51=this['_getCategorizedItems']()['map'](_0x3403aa=>({'title':_0x3403aa['title'],'items':_0x3403aa['items']['map'](_0x386259=>({'id':_0x386259['id'],'title':_0x386259['title']||hs(this['context']['locale'],'AI_CHAT_UNTITLED_CONVERSATION'),'createdAt':new Date(_0x386259['createdAt'])['toLocaleDateString'](),'active':_0x386259['id']===_0x6dd7ad,'pinned':_0x386259['pinned']}))}));this['_aiChatHistoryUi']['updateItems'](_0x217b51);}['_setItemLoading'](_0x502be3,_0x34fa0b){this['_aiChatHistoryUi']['updateItemLoadingState'](_0x502be3,_0x34fa0b,!0x0);}['_clearItemLoading'](_0x19d72c){this['_aiChatHistoryUi']['updateItemLoadingState'](_0x19d72c,null,!0x1);}['_handleHistoryErrorUI'](_0x3c602d,_0x458df8,_0x1fd514){const _0x3c56b3=this['_generateErrorMessage'](_0x458df8,_0x1fd514);this['_aiChatHistoryUi']['showError'](_0x3c56b3),_0x1fd514&&this['_clearItemLoading'](_0x1fd514),this['_aiChatHistoryUi']['setLoadingSkeleton'](!0x1);}['_generateErrorMessage'](_0x3e5432,_0x3a9d64){const _0x5e0226=_0x3a9d64?this['history']['getItem'](_0x3a9d64):null,_0x1c6d14=_0x5e0226?.['title']||hs(this['context']['locale'],'AI_CHAT_UNTITLED_CONVERSATION');switch(_0x3e5432){case'updateItemTitle':return hs(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_UPDATE_TITLE',_0x1c6d14);case'updateItemPinned':{const _0x27c332=hs(this['context']['locale'],_0x5e0226?.['pinned']?'AI_CHAT_HISTORY_UNPIN_ACTION':'AI_CHAT_HISTORY_PIN_ACTION');return hs(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_UPDATE_PINNED',[_0x27c332,_0x1c6d14]);}case'removeItem':return hs(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_REMOVE_ITEM',_0x1c6d14);case'init':case'loadItems':return hs(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_LOAD_ITEMS');default:return hs(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_GENERIC');}}['_getCategorizedItems'](){const _0x5ed6b6=new Date(),_0x13a783=new Date(_0x5ed6b6['getFullYear'](),_0x5ed6b6['getMonth'](),_0x5ed6b6['getDate']()),_0x4b5ca6=new Date(_0x13a783);_0x4b5ca6['setDate'](_0x4b5ca6['getDate']()-0x1);const _0x1ad0ba=new Date(_0x13a783);_0x1ad0ba['setDate'](_0x1ad0ba['getDate']()-0xe);const _0x21d8fc=this['history']['getItems']({'pinned':!0x0}),_0x47916a=this['history']['getItems']({'from':_0x13a783,'to':_0x13a783}),_0x59353e=this['history']['getItems']({'from':_0x4b5ca6,'to':_0x4b5ca6}),_0x2d20fc=this['history']['getItems']({'from':_0x1ad0ba,'to':_0x4b5ca6}),_0x57043b=this['history']['getItems']({'to':_0x1ad0ba}),_0x52ca27=[];return _0x21d8fc['length']>0x0&&_0x52ca27['push']({'title':hs(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_PINNED'),'items':_0x21d8fc}),_0x47916a['length']>0x0&&_0x52ca27['push']({'title':hs(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_TODAY'),'items':_0x47916a}),_0x59353e['length']>0x0&&_0x52ca27['push']({'title':hs(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_YESTERDAY'),'items':_0x59353e}),_0x2d20fc['length']>0x0&&_0x52ca27['push']({'title':hs(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_LAST_14_DAYS'),'items':_0x2d20fc}),_0x57043b['length']>0x0&&_0x52ca27['push']({'title':hs(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_LATER'),'items':_0x57043b}),_0x52ca27;}}class Io extends _0x203d97{static get['requires'](){return[Ao,uo];}static get['pluginName'](){return'AIChatHistory';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}class Eo extends _0x203d97{static get['requires'](){return[Xs,Js,ro,Io];}static get['pluginName'](){return'AIChat';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x5dbd7c){super(_0x5dbd7c),this['context']['config']['define']('ai.chat.context',{'document':{'enabled':!0x0},'urls':{'enabled':!0x0},'files':{'enabled':!0x0},'sources':[],'alwaysAddSelection':!0x1}),this['context']['config']['define']('ai.chat.initialConversation','new');}}class po extends Nt{['id'];constructor(_0x29c239,_0x13a3ae){super(_0x29c239);const {id:_0x365adc,type:_0x28a23e,icon:_0x545bde}=_0x13a3ae;this['id']=_0x365adc,this['set']({'label':_0x13a3ae['label'],'withText':!0x0,'class':'ck-ai-chat-shortcut'}),this['extendTemplate']({'attributes':{'data-cke-ai-shortcut-id':_0x13a3ae['id']}}),_0x545bde?this['icon']=_0x545bde:'chat'===_0x28a23e?this['icon']=_0x156709:'review'===_0x28a23e?this['icon']=_0x317a11:'translate'===_0x28a23e&&(this['icon']=_0x12e558);}}class mo extends vt{['listView'];constructor(_0xceeaa2,_0x45d47b){super(_0xceeaa2);const _0x3912bd=_0x45d47b['map'](_0x4d36ad=>{const _0x5ab14f=new Ht(this['locale']),_0x4ee509=new po(this['locale'],_0x4d36ad);return _0x5ab14f['children']['add'](_0x4ee509),_0x4ee509['delegate']('execute')['to'](this),_0x5ab14f;});this['listView']=new Dt(this['locale']),this['listView']['items']['addMany'](_0x3912bd),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat-shortcuts']},'children':[this['listView']]});}}const To='chat-shortcuts';class Co extends _0x203d97{['_shortcuts'];['_shortcutsView'];['_aiChatUI'];static get['requires'](){return[ro];}static get['pluginName'](){return'AIChatShortcuts';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){this['_aiChatUI']=this['context']['plugins']['get'](ro),this['_shortcuts']=this['context']['config']['get']('ai.chat.shortcuts')??[];const _0x3356b8=this['context']['plugins']['get']('AIChatController');this['_shortcuts']['length']&&(this['_validateShortcuts'](),this['_aiChatUI']['on']('conversationCreated',()=>{_0x3356b8['activeConversation']['isFromHistory']||this['_injectShortcuts']();}),this['listenTo'](_0x3356b8,'interactionStarted',()=>{this['_removeShortcuts']();}));}['_validateShortcuts'](){const _0x4d50b8=['chat','review','translate'];this['_shortcuts']['forEach'](_0x77da93=>{let _0x4f3dc9=!0x0;if(_0x77da93['id']&&_0x77da93['label']&&_0x4d50b8['includes'](_0x77da93['type'])?'chat'===_0x77da93['type']&&(_0x4f3dc9='string'==typeof _0x77da93['prompt']):_0x4f3dc9=!0x1,!_0x4f3dc9)throw new at('ai-chat-shortcuts-invalid-config',this['context'],{'shortcut':_0x77da93});});}['_injectShortcuts'](){const _0x166672=this['context']['plugins']['get'](ro);this['_shortcutsView']=new mo(this['context']['locale'],this['_shortcuts']),this['_shortcutsView']['render'](),_0x166672['addFeedItemCustomElement'](this['_shortcutsView']['element'],To),this['_shortcutsView']['on']('execute',_0x38fe2f=>{const _0x564db2=_0x38fe2f['source']['id'];this['_executeShortcut'](_0x564db2);});}['_removeShortcuts'](){const _0x76ec90=this['context']['plugins']['get'](ro);_0x76ec90['hasFeedItem'](To)&&_0x76ec90['removeFeedItem'](To),this['_shortcutsView']?.['destroy']();}['_executeShortcut'](_0x43513e){const _0x16bfda=this['_shortcuts']['find'](_0x18c671=>_0x18c671['id']===_0x43513e),_0x30bfdd=_0x16bfda['type'];'chat'===_0x30bfdd?this['_runChatShortcut'](_0x16bfda):'review'===_0x30bfdd?_0x16bfda['commandId']?this['_runReviewShortcut'](_0x16bfda):this['_switchTab']('reviewMode'):'translate'===_0x30bfdd&&(_0x16bfda['language']?this['_runTranslateShortcut'](_0x16bfda):this['_switchTab']('translate'));}['_switchTab'](_0x54d6d6){if(!this['context']['plugins']['has']('AITabs'))throw new at('ai-chat-shortcuts-ai-tabs-not-found',this['context'],{'tabName':_0x54d6d6});this['context']['plugins']['get']('AITabs')['view']['activateTab'](_0x54d6d6);}async['_runChatShortcut']({prompt:_0xdc1628,draftMode:_0x175e13,useWebSearch:_0x5dd73d=!0x1,useReasoning:_0x4f3610=!0x1,model:_0x1cc144}){const _0x26ec51=this['context']['plugins']['get']('AIChatController'),_0x5b76a0=_0x26ec51['activeConversation'];let _0x5815fd;_0x5815fd=_0x1cc144?await _0x5b76a0['chatModels']['getModel'](_0x1cc144):await _0x5b76a0['chatModels']['getDefault'](),_0x5815fd&&await _0x5b76a0['setModel'](_0x5815fd),_0x5b76a0['setWebSearch'](_0x5dd73d),_0x5b76a0['setReasoning'](_0x4f3610),_0x26ec51['addCurrentDocumentToChatContext'](),_0x175e13?(this['_aiChatUI']['setPromptInputValue'](_0xdc1628),this['_aiChatUI']['focusPromptInput'](!0x0)):_0x26ec51['sendMessage']({'message':_0xdc1628});}['_runReviewShortcut']({commandId:_0x4f26ec,model:_0x51520c,prompt:_0x777078,params:_0x4b3e3c}){if(!this['context']['plugins']['has']('AIReviewModeUI'))throw new at('ai-chat-shortcuts-review-mode-not-found',this['context']);this['_switchTab']('reviewMode');const _0x3f8fdf={'id':_0x4f26ec,'isCustom':'custom'===_0x4f26ec};_0x51520c&&_0x777078&&(_0x3f8fdf['args']={'model':_0x51520c,'prompt':_0x777078}),_0x4b3e3c&&(_0x3f8fdf['params']=_0x4b3e3c),this['context']['plugins']['get']('AIReviewModeUI')['fire']('runReviewCheck',_0x3f8fdf);}['_runTranslateShortcut']({language:_0x2fdb51}){if(!this['context']['plugins']['has']('AITranslateUI'))throw new at('ai-chat-shortcuts-translate-not-found',this['context']);this['_switchTab']('translate'),this['context']['plugins']['get']('AITranslateUI')['fire']('runReviewCheck',{'id':_0x2fdb51,'args':{'language':_0x2fdb51}});}}class wo extends _0x5bebe4{constructor(_0x213397){super(_0x213397);const _0x4ca419=_0x213397['plugins']['get']('AITabs')['view'];this['bind']('value')['to'](_0x4ca419,'isVisible'),this['isEnabled']=!0x0;}['execute'](){const _0x664f0d=this['editor']['plugins']['get']('AITabs')['view'];_0x664f0d['isVisible']=!_0x664f0d['isVisible'];}}class fo extends _0x18211b{static get['requires'](){return[os];}static get['pluginName'](){return'AIToggleButtonUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const _0x10fb4=this['editor'];_0x10fb4['commands']['add']('toggleAi',new wo(_0x10fb4)),_0x10fb4['ui']['componentFactory']['add']('toggleAi',()=>{const _0x2cdbbb=this['_createAIUIButton'](Nt);return _0x2cdbbb['set']({'tooltip':!0x0,'class':'ck-ai-toggle-button'}),_0x2cdbbb;}),_0x10fb4['ui']['componentFactory']['add']('menuBar:toggleAi',()=>{const _0x4f4da0=this['_createAIUIButton'](Wt);return _0x4f4da0['set']({'role':'menuitemcheckbox'}),_0x4f4da0;});}['_createAIUIButton'](_0x1d9d1f){const _0x2d2d66=this['editor'],_0x230e45=_0x2d2d66['commands']['get']('toggleAi'),_0xb82bd0=new _0x1d9d1f(_0x2d2d66['locale']);return _0xb82bd0['set']({'label':hs(_0x2d2d66['locale'],'AI_TOGGLE_BUTTON_LABEL'),'icon':_0x45c724,'isToggleable':!0x0}),_0xb82bd0['bind']('isEnabled')['to'](_0x230e45),_0xb82bd0['bind']('isOn')['to'](_0x230e45,'value',_0x5bea29=>!!_0x5bea29),this['listenTo'](_0xb82bd0,'execute',()=>{_0x230e45['execute']();}),_0xb82bd0;}}const bo=['applySuggestion','insertSuggestion','showNext','showPrevious'];class So extends vt{['_errorView'];constructor(_0x96ad56){super(_0x96ad56),this['set']('_errorMessage',''),this['set']('_isErrorVisible',!0x1);}['showBlockingError'](_0x40b95a){this['showError'](_0x40b95a);}['showError'](_0x8957ee){this['_errorView']||(this['_errorView']=this['_createErrorView']()),this['_errorMessage']=_0x8957ee,this['_isErrorVisible']=!0x0;}['hideError'](){this['_isErrorVisible']=!0x1;}['_createErrorView'](){const _0x5d752c=new vt(this['locale']),_0x18603e=new vt(this['locale']);return _0x18603e['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai-suggestion__error-text']},'children':[{'text':this['bindTemplate']['to']('_errorMessage')}]}),_0x5d752c['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__error','ck-ai-balloon-error',this['bindTemplate']['if']('_isErrorVisible','ck-hidden',_0x1d7402=>!_0x1d7402)]},'children':[_0x18603e]}),_0x5d752c;}}const Ro=0xa;class Oo extends _0x203d97{static get['requires'](){return[Js];}static get['pluginName'](){return'AIBalloon';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['isOpen']=!0x1;['_currentConfig'];['_getTargetEditor'](){return this['_currentConfig']?.['targetEditor']??$s(this['context']);}['_isUpdatingMarkers']=!0x1;['open'](_0x148b07){const {id:_0x2d1522}=this['_currentConfig']??{};this['_currentConfig']=_0x148b07;const {id:_0x1e28a7}=this['_currentConfig'];this['isOpen']&&_0x2d1522===_0x1e28a7?this['_updateDialog']():this['_showDialog']();}['close'](){const _0xd475aa=this['_getTargetEditor']()['plugins']['get']('Dialog');_0xd475aa['isOpen']&&this['_currentConfig']&&_0xd475aa['id']===this['_currentConfig']['id']&&_0xd475aa['hide']();}['_updateDialog'](){const _0x220801=this['_getTargetEditor']()['plugins']['get']('Dialog'),{icon:_0x3ef677,title:_0x816cc1}=this['_currentConfig'];_0x220801['view']?.['headerView']&&(_0x220801['view']['headerView']['label']=_0x816cc1,_0x220801['view']['headerView']['iconView']&&_0x3ef677&&(_0x220801['view']['headerView']['iconView']['content']=_0x3ef677)),this['_isUpdatingMarkers']=!0x0,this['_showFakeVisualSelection'](),this['_isUpdatingMarkers']=!0x1,_0x220801['view']?.['updatePosition']();}['_showFakeVisualSelection'](){this['context']['plugins']['get'](Js)['showFakeVisualSelection']({'ranges':this['_currentConfig']['ranges'],'id':'balloon','priority':0x64}),window['getSelection']()?.['removeAllRanges']();}['_hideFakeVisualSelection'](){this['context']['plugins']['get'](Js)['hideFakeVisualSelection']('balloon');}['_showDialog'](){const _0xb2978e=this['_getTargetEditor']()['plugins']['get']('Dialog'),{id:_0x544133,title:_0x49570d,icon:_0x12fb6d,class:_0x5b80fc,mainView:_0x19ae68}=this['_currentConfig'];_0x19ae68['delegate'](...bo)['to'](this),_0xb2978e['show']({'title':_0x49570d,'icon':_0x12fb6d,'hasCloseButton':!0x0,'id':_0x544133,'position':this['_calculateDialogPosition']['bind'](this),'className':'ck-ai-balloon\x20'+(_0x5b80fc||''),'content':_0x19ae68,'onShow':_0x41fd00=>{this['_showFakeVisualSelection'](),this['_setupFakeVisualSelectionMarkerRemovalListener'](),_0x41fd00['view']?.['updatePosition']();const _0x471532=this['_getSelectionElements']();_0x471532&&_0x471532[0x0]&&Ct({'target':_0x471532[0x0],'ancestorOffset':0x14,'alignToTop':!0x0,'viewportOffset':{'top':0x14,'bottom':0x14,'left':0x0,'right':0x0}}),this['isOpen']=!0x0,_0x41fd00['once']('hide',()=>{this['fire']('beforeDialogClosed',{'id':_0x544133});},{'priority':'high'});},'onHide':()=>{this['_hideFakeVisualSelection'](),this['_cleanupFakeVisualSelectionMarkerRemovalListener'](),this['fire']('dialogClosed',{'id':_0x544133}),this['isOpen']=!0x1;}});}['_calculateDialogPosition'](_0x7286fc,_0x1394a6){if(!_0x1394a6){const _0x156ad9=this['_getTargetRootDomRect']();if(!_0x156ad9)return null;_0x1394a6=_0x156ad9;}const _0x5b70cb=this['_getSelectionElements']();if(!_0x5b70cb||0x0===_0x5b70cb['length'])return{'left':Math['round'](_0x1394a6['left']+_0x1394a6['width']/0x2-_0x7286fc['width']/0x2),'top':Math['round'](_0x1394a6['top']+_0x1394a6['height']/0x2-_0x7286fc['height']/0x2)};const _0x2aa19f=Math['round'](_0x1394a6['left']+_0x1394a6['width']/0x2-_0x7286fc['width']/0x2),_0x377011=_0x5b70cb['map'](_0x40dfeb=>new ut(_0x40dfeb)),_0x51c47d=_0x7286fc['height'];return{'left':_0x2aa19f,'top':this['_calculateOptimalTopPosition'](_0x377011,_0x51c47d,_0x1394a6)};}['_calculateOptimalTopPosition'](_0x1b6e12,_0x587965,_0x460029){const _0x1b6d24=new ut(ct['window']),_0x511397=_0x1b6e12['map'](_0x22c5e1=>_0x22c5e1['getVisible']())['filter'](_0xe9b535=>_0xe9b535),_0x4dcfd6=ut['getBoundingRect'](_0x511397);if(!_0x4dcfd6)return Math['round'](_0x460029['top']+_0x460029['height']/0x2);const _0x5127f9=_0x1b6d24['getIntersection'](_0x4dcfd6);if(!_0x5127f9)return Math['round'](_0x460029['top']+_0x460029['height']/0x2);const _0x477966=_0x460029['getVisible'](),_0x3daaaf=_0x477966&&_0x4dcfd6['height']>_0x477966['height'],_0x30437d=_0x5127f9['top'],_0x4ea879=_0x5127f9['bottom'];if(_0x3daaaf){const _0x4856f5=(_0x477966||_0x1b6d24)['height']/0x2-_0x587965/0x2,_0x456c53=_0x30437d-Ro-_0x460029['top'],_0xf964a0=_0x460029['bottom']-_0x4ea879-Ro;return _0x456c53>=_0x587965?Math['max'](Ro,_0x30437d-_0x587965-Ro):_0xf964a0>=_0x587965?_0x4ea879+Ro:Math['max'](Ro,_0x4856f5);}const _0x17e6ce=_0x30437d-_0x587965,_0x43932d=_0x460029['bottom']-_0x4ea879-Ro,_0x5260bb=_0x30437d-Ro-_0x460029['top'];let _0x44692c;if(_0x43932d>=_0x587965)_0x44692c=_0x4ea879+Ro;else{if(_0x5260bb>=_0x587965)_0x44692c=_0x17e6ce-Ro;else _0x44692c=_0x30437d+_0x4dcfd6['height']/0x2-_0x587965/0x2;}return _0x44692c;}['_setupFakeVisualSelectionMarkerRemovalListener'](){const _0x3cee42=this['_getTargetEditor']();this['listenTo'](_0x3cee42['model']['document'],'change',()=>{if(!this['_isUpdatingMarkers']){for(const {name:_0x594485,data:{newRange:_0xf76e95}}of _0x3cee42['model']['document']['differ']['getChangedMarkers']())if(_0x594485['startsWith'](zs+':')&&(_0xf76e95&&(_0xf76e95['start']['isEqual'](_0xf76e95['end'])||'$graveyard'==_0xf76e95['root']['rootName'])||null==_0xf76e95)){const _0x5295c0=hs(this['context']['locale'],'AI_BALLOON_SELECTION_REMOVED_ERROR');this['_currentConfig']['mainView']['showBlockingError'](_0x5295c0),this['fire']('selectionRemoved');}}});}['_cleanupFakeVisualSelectionMarkerRemovalListener'](){const _0x33d602=this['_getTargetEditor']();this['_currentConfig']['mainView']['hideError'](),this['stopListening'](_0x33d602['model']['document']);}['_getSelectionElements'](){const _0x1af42f=this['_getTargetEditor']();return _0x2e8baf(_0x1af42f['editing'],[..._0x1af42f['model']['markers']['getMarkersGroup']('ai-selection'),..._0x1af42f['model']['markers']['getMarkersGroup']('ai-balloon-selection')]);}['_getTargetRootDomRect'](){const _0x4852fa=this['_currentConfig']?.['ranges']?.[0x0]?.['root'];if(!_0x4852fa)return null;const _0x3087b2=this['_getTargetEditor'](),_0x25303c=_0x3087b2['editing']['view']['document']['getRoot'](_0x4852fa['rootName']);if(!_0x25303c)return null;const _0x2b1294=_0x3087b2['editing']['view']['domConverter']['mapViewToDom'](_0x25303c);return _0x2b1294&&_0x2b1294 instanceof HTMLElement?new ut(_0x2b1294):null;}}class ko extends kt{['copyButton'];['likeButton'];['dislikeButton'];['showChangesButton'];['_config'];constructor(_0x8068bd,_0x1ec14f={}){super(_0x8068bd),this['set']('isEnabled',!0x0),this['set']('isShowChangesOn',!0x1),this['_config']={'showCopy':!0x1,'showLike':!0x1,'showDislike':!0x1,..._0x1ec14f};const _0x5979de=!(this['_config']['showCopy']||this['_config']['showChanges']||this['_config']['showLike']||this['_config']['showDislike']||this['_config']['customView']?.['length']);this['class']=_0x5979de?'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'](_0x235742){this['showChangesButton']['isEnabled']=_0x235742;}['_setupRatingButtons'](){this['likeButton']=new Nt(this['locale']),this['likeButton']['set']({'icon':_0x358e38,'label':hs(this['locale'],'AI_MINI_TOOLBAR_LIKE'),'class':us,'tooltip':!0x0}),this['likeButton']['bind']('isEnabled')['to'](this),this['likeButton']['on']('execute',()=>{this['fire']('like');}),this['dislikeButton']=new Nt(this['locale']),this['dislikeButton']['set']({'icon':_0x36e2a6,'label':hs(this['locale'],'AI_MINI_TOOLBAR_DISLIKE'),'class':us,'tooltip':!0x0}),this['dislikeButton']['bind']('isEnabled')['to'](this),this['dislikeButton']['on']('execute',()=>{this['fire']('dislike');});}['_setupCopyButton'](){this['copyButton']=new Nt(this['locale']),this['copyButton']['set']({'icon':_0x37c8e9,'label':hs(this['locale'],'AI_MINI_TOOLBAR_COPY'),'class':'ck-ai-mini-toolbar-copy-button\x20'+us,'tooltip':!0x0}),this['copyButton']['bind']('isEnabled')['to'](this);const _0x3f420d=new xt();_0x3f420d['set']({'content':_0x2204df}),_0x3f420d['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'+us,setTimeout(()=>{this['copyButton']['class']='ck-ai-mini-toolbar-copy-button\x20'+us;},0x7d0);}),this['copyButton']['children']['add'](_0x3f420d);}['_setupShowChangesButton'](){this['showChangesButton']=new Nt(this['locale']),this['showChangesButton']['set']({'icon':_0x306402,'label':hs(this['locale'],'AI_SUGGESTION_BUTTON_SHOW_CHANGES'),'withText':'full'==this['_config']['showChanges'],'tooltip':'full'!=this['_config']['showChanges'],'class':us}),this['showChangesButton']['bind']('isOn')['to'](this,'isShowChangesOn'),this['showChangesButton']['bind']('isEnabled')['to'](this),this['showChangesButton']['bind']('icon')['to'](this,'isShowChangesOn',_0x58c245=>_0x58c245?_0x1ad2ce:_0x306402),this['showChangesButton']['on']('execute',()=>{this['fire']('toggleShowChanges');});}}class No extends So{['children'];['nextButtonView'];['previousButtonView'];['focusCycler'];['_focusables'];['_focusTracker'];['_keystrokes'];['_config'];['_streamableContentView'];['_toolbarContainerView'];['_partToolbarView'];['_stateView'];['_miniToolbarView'];constructor(_0x549b3e,_0xd17279){super(_0x549b3e);const _0x5b8b5c=this['bindTemplate'];this['set']('showDiff',!0x1),this['set']('_state','pending'),this['_focusTracker']=new _t(),this['_keystrokes']=new gt(),this['_focusables']=this['createCollection'](),this['focusCycler']=new Ut({'focusables':this['_focusables'],'focusTracker':this['_focusTracker'],'keystrokeHandler':this['_keystrokes'],'actions':{'focusPrevious':'shift\x20+\x20tab','focusNext':'tab'}}),this['_config']=_0xd17279,this['nextButtonView']=this['_createNextButtonView'](),this['previousButtonView']=this['_createPreviousButtonView'](),this['_streamableContentView']=new In(_0x549b3e),this['_partToolbarView']=new _n(_0x549b3e,_0xd17279['availableActions']),this['_partToolbarView']['delegate']('applySuggestion','insertSuggestion','rejectSuggestion')['to'](this),this['_togglePartToolbarButtonsVisibility'](_0xd17279),this['_stateView']=new un(_0x549b3e),this['_stateView']['isVisible']=!0x1,this['_miniToolbarView']=new ko(_0x549b3e,{'showChanges':'full'}),this['_miniToolbarView']['bind']('isShowChangesOn')['to'](this,'showDiff'),this['_miniToolbarView']['on']('toggleShowChanges',()=>{this['fire']('toggleSuggestionDisplayMode');}),this['_toolbarContainerView']=new vo(_0x549b3e,[this['_partToolbarView'],this['_stateView'],this['_miniToolbarView']]),this['children']=this['createCollection']([this['_streamableContentView'],this['_toolbarContainerView']]),this['on']('change:_state',(_0x443809,_0x1ea005,_0x31df93,_0x5d5b09)=>{let _0x42f77a,_0x33cc00;'pending'===_0x5d5b09?(_0x42f77a=this['_partToolbarView'],_0x33cc00=this['_stateView']):(_0x42f77a=this['_stateView'],_0x33cc00=this['_partToolbarView']),this['_stateView']['setState'](_0x31df93),_0x42f77a['isVisible']=!0x1,_0x33cc00['isVisible']=!0x0;}),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat-balloon-main',_0x5b8b5c['to']('_state',_0x1464b9=>'ck-ai-chat-balloon-main_state_'+_0x1464b9)]},'children':this['children']}),this['on']('change:isTrackChangesOn',()=>{this['_togglePartToolbarButtonsVisibility'](_0xd17279);});}['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'](_0x346f92){_0x346f92?.['keepErrors']||this['hideError'](),await this['_streamableContentView']['update'](_0x346f92);}['setState'](_0x18d1cc){this['_state']=_0x18d1cc;}['showError'](_0x4eb9eb){super['showError'](_0x4eb9eb),this['children']['has'](this['_errorView'])||this['children']['add'](this['_errorView'],0x0);}['hideError'](){this['_isErrorVisible']&&(super['hideError'](),this['togglePartToolbarEnabled'](!0x0));}['showBlockingError'](_0x5d6781){super['showBlockingError'](_0x5d6781),this['togglePartToolbarEnabled'](!0x1);}['toggleRotatorButtonsVisibility'](_0x50e3fd){this['nextButtonView']['isVisible']=this['previousButtonView']['isVisible']=_0x50e3fd;}['togglePartToolbarEnabled'](_0x2295f4){this['_partToolbarView']['isEnabled']=_0x2295f4;}['_togglePartToolbarButtonsVisibility']({showApplyButton:_0x40db41,showSuggestButton:_0x368181}){_0x40db41=_0x40db41&&!this['isTrackChangesOn']&&this['_config']['availableActions']['includes']('applySuggestion'),_0x368181=_0x368181&&this['_config']['availableActions']['includes']('insertSuggestion'),this['_partToolbarView']['setButtonsVisibility']({'showApplyButton':_0x40db41,'showSuggestButton':_0x368181});}['_createNextButtonView'](){const _0x2f9469=new Nt(this['locale']);return _0x2f9469['set']({'icon':_0x39062c,'label':hs(this['locale'],'AI_BALLOON_NEXT_LABEL'),'isVisible':!0x0}),_0x2f9469['on']('execute',()=>{this['fire']('showNext');}),_0x2f9469;}['_createPreviousButtonView'](){const _0x133ecd=new Nt(this['locale']);return _0x133ecd['set']({'icon':_0x41ea6f,'label':hs(this['locale'],'AI_BALLOON_PREVIOUS_LABEL'),'isVisible':!0x0}),_0x133ecd['on']('execute',()=>{this['fire']('showPrevious');}),_0x133ecd;}}class vo extends vt{constructor(_0x481f6f,_0x940073){super(_0x481f6f),this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-chat-balloon__toolbar-container']},'children':_0x940073});}}class yo extends _0x18211b{static get['requires'](){return[Bt,Oo];}static get['pluginName'](){return'AIChatBalloon';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['_chatBalloonView'];constructor(_0x4f7299){super(_0x4f7299),this['set']('showDiff',!0x1);}['open'](_0x5b90b1){const _0x3e337b=this['editor'];this['_chatBalloonView']||(this['_chatBalloonView']=this['_createChatBalloonView']()),_0x3e337b['plugins']['get']('AIBalloon')['open']({..._0x5b90b1,'id':'aiChatBalloon','class':'ck-ai-chat-balloon','mainView':this['_chatBalloonView']}),this['_toggleRotatorButtonsInDialogHeader'](_0x5b90b1['showRotator']),this['_chatBalloonView']['togglePartToolbarEnabled'](!_0x5b90b1['areActionsDisabled']),this['_restoreDefaultViewFocus']();}['close'](){this['editor']['plugins']['get']('AIBalloon')['close']();}['updateContent'](_0x480fb8){return this['_chatBalloonView']||(this['_chatBalloonView']=this['_createChatBalloonView']()),this['_chatBalloonView']['updateContent'](_0x480fb8);}['setState'](_0x146f1e){this['_chatBalloonView']&&this['_chatBalloonView']['setState'](_0x146f1e);}['_createChatBalloonView'](){const _0x39e821=this['editor'],_0x5b41b4=_0x39e821['plugins']['get']('AIBalloon'),_0x3e8661=_0x39e821['commands']['get']('trackChanges');let _0x7d76d0=_0x39e821['config']['get']('ai.availableReplyActions')||[...fn];_0x39e821['plugins']['has']('TrackChanges')||(_0x7d76d0=_0x7d76d0['filter'](_0x3072a4=>'insertSuggestion'!=_0x3072a4));const _0x16e646=new No(_0x39e821['locale'],{'availableActions':_0x7d76d0,'showApplyButton':!0x0,'showSuggestButton':!!_0x3e8661});return _0x16e646['bind']('showDiff')['to'](this),_0x16e646['delegate'](...Zs)['to'](this),_0x16e646['delegate']('showPrevious','showNext')['to'](this),_0x5b41b4['delegate']('dialogClosed')['to'](this),_0x16e646['on']('applySuggestion',this['_restoreDefaultViewFocus']['bind'](this)),_0x16e646['on']('insertSuggestion',this['_restoreDefaultViewFocus']['bind'](this)),_0x16e646['on']('rejectSuggestion',this['_restoreDefaultViewFocus']['bind'](this)),_0x3e8661&&_0x16e646['bind']('isTrackChangesOn')['to'](_0x3e8661,'value'),_0x16e646['render'](),_0x16e646;}['_toggleRotatorButtonsInDialogHeader'](_0xc0e10d){const _0x1bc20a=this['editor'],_0x9b20ec=_0x1bc20a['plugins']['get']('Dialog')['view']['headerView']['children'];this['_chatBalloonView']['toggleRotatorButtonsVisibility'](_0xc0e10d),_0x9b20ec['has'](this['_chatBalloonView']['previousButtonView'])||(_0x9b20ec['addMany']([this['_chatBalloonView']['previousButtonView'],this['_chatBalloonView']['nextButtonView']],0x0),_0x1bc20a['plugins']['get']('AIBalloon')['once']('beforeDialogClosed',()=>{_0x9b20ec['remove'](this['_chatBalloonView']['previousButtonView']),_0x9b20ec['remove'](this['_chatBalloonView']['nextButtonView']);}));}['_restoreDefaultViewFocus'](){this['_chatBalloonView']['focus']();}}class xo extends _0x18211b{static get['requires'](){return[fo,yo,_0x56a0f6];}static get['pluginName'](){return'AIEditorIntegration';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}function Lo(_0x18b25b){const {editor:_0x4bc49f,action:_0x478645,withText:_0x154f1c=!0x1,withIcon:_0x584212=!0x0,isInDropdown:_0x1dd65d=!0x0,shouldPreventFocus:_0xf86ed3=!0x1}=_0x18b25b;return()=>{const _0x516410=_0x4bc49f['locale'],_0x11262b=new Nt(_0x516410),_0xbb47ef=_0x11262b['bindTemplate'];_0x1dd65d&&_0x11262b['extendTemplate']({'on':{'mouseenter':_0xbb47ef['to'](()=>{_0xf86ed3&&_0xf86ed3()||_0x11262b['focus']();})}});const _0x4ba62a=_0x478645['icon']??_0x478645['parent']?.['icon'];return _0x11262b['set']({'label':_0x478645['label'],'withText':_0x154f1c,'role':'menuitem','icon':_0x584212?_0x4ba62a??_0x3f90e7:void 0x0,'tooltip':!_0x154f1c,'class':'ck-ai-quick-actions-button','isEnabled':_0x478645['isEnabled']}),_0x11262b['on']('execute',()=>{_0x4bc49f['editing']['view']['focus'](),_0x4bc49f['commands']['execute']('aiQuickAction',_0x478645);}),_0x11262b;};}class Do extends _0x2c6f29{['arrowView'];constructor(_0x5f5702,_0x3cfb64){super(_0x5f5702,_0x3cfb64);const _0x4c36cd=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',_0x464ca7=>String(_0x464ca7)),'data-cke-tooltip-disabled':_0x4c36cd['to']('isOn')},'on':{'mouseenter':_0x4c36cd['to']('mouseenter')}});}['render'](){super['render'](),this['children']['add'](this['arrowView']);}['_createArrowView'](){const _0x15caab=new xt();return _0x15caab['content']=_0xa36a14,_0x15caab['extendTemplate']({'attributes':{'class':'ck-dropdown-menu-list__nested-menu__button__arrow'}}),_0x15caab;}}class Po extends Dt{['_allListItems'];['_allSearchableItems'];constructor(_0x41948a,_0xa4d9f9,_0x4d3ff8){super(_0x41948a),this['_allListItems']=_0xa4d9f9,this['_allSearchableItems']=_0x4d3ff8;}['filter'](_0xea1408){if(!_0xea1408)return this['items']['clear'](),this['items']['addMany'](this['_allListItems']),this['_clearHighlight'](),{'resultsCount':this['_allListItems']['length'],'totalItemsCount':this['_allListItems']['length']};const _0x495d61=_0xea1408['source']['toLowerCase']()['trim'](),_0x486712=this['_allSearchableItems']['filter'](_0x1baa1e=>(_0x1baa1e['groupLabel']?_0x1baa1e['label']+'\x20('+_0x1baa1e['groupLabel']+')':_0x1baa1e['label'])['toLowerCase']()['includes'](_0x495d61));return this['items']['clear'](),this['items']['addMany'](_0x486712['sort']((_0x2f33d6,_0xdb1442)=>{const _0x139bf3=_0x2f33d6['groupLabel'],_0xbdb56=_0xdb1442['groupLabel'];return _0x139bf3||_0xbdb56?_0x139bf3?0x1:-0x1:0x0;})['map'](_0x55cc4b=>_0x55cc4b['item'])),this['_highlightQuery'](_0x495d61,_0x486712),{'resultsCount':_0x486712['length'],'totalItemsCount':this['_allSearchableItems']['length']};}['_highlightQuery'](_0x3f83bd,_0x4d6f6c){if(!_0x3f83bd)return;const _0x1d3573=new RegExp(_0x271311(_0x3f83bd),'gi');_0x4d6f6c['forEach'](_0x323b0d=>{_0x323b0d['highlightViews']&&_0x323b0d['highlightViews']['forEach'](_0x12ab9d=>{'function'==typeof _0x12ab9d['highlightText']&&_0x12ab9d['highlightText'](_0x1d3573);});});}['_clearHighlight'](){this['_allSearchableItems']['forEach'](_0x27739=>{_0x27739['highlightViews']&&_0x27739['highlightViews']['forEach'](_0x234799=>{'function'==typeof _0x234799['highlightText']&&_0x234799['highlightText'](null);});});}}const Ho='menu',Mo='menuitem';class Uo extends vt{['_bodyCollection'];['optionsListView'];['_searchTextView']=null;['_allSearchableItems']=[];['children'];['focusTracker'];['keystrokes'];['_focusables'];['focusCycler'];['_openNestedPanels']=new Set();['_hasSearch'];constructor(_0x353950,_0x338e9a,_0x22a3be,_0x4c5292,_0x5a8f52=!0x1){const _0x2c8714=_0x353950['locale'];super(_0x2c8714),this['_bodyCollection']=_0x4c5292,this['_hasSearch']=_0x5a8f52;const _0x142991=this['_createListItems'](_0x353950,_0x338e9a,_0x22a3be);this['optionsListView']=new Po(_0x2c8714,_0x142991,this['_allSearchableItems']),this['optionsListView']['role']=Ho,this['optionsListView']['items']['addMany'](_0x142991),this['focusTracker']=new _t(),this['keystrokes']=new gt(),_0x5a8f52&&(this['_searchTextView']=this['_createSearchTextView']()),this['_focusables']=_0x142991,this['focusCycler']=new Ut({'focusables':this['_focusables'],'focusTracker':this['focusTracker'],'keystrokeHandler':this['keystrokes']}),_0x5a8f52&&this['_searchTextView']&&this['focusCycler']['chain'](this['_searchTextView']['focusCycler']);const _0x24b2eb=_0x5a8f52&&this['_searchTextView']?[this['_searchTextView']]:[this['optionsListView']];this['children']=new _0x3f24a6(_0x24b2eb),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset_all','ck-ai-quick-actions','ck-rounded-corners'],'dir':_0x2c8714['uiLanguageDirection']},'children':this['children']});}['_createSearchTextView'](){return new _0x1b1ba3(this['locale'],{'filteredView':this['optionsListView'],'queryView':{'label':hs(this['locale'],'AI_QUICK_ACTIONS_SEARCH')},'class':'ck-ai-quick-actions-search','infoView':{'text':{'notFound':{'primary':hs(this['locale'],'AI_QUICK_ACTIONS_SEARCH_NOT_FOUND')}}}});}['_isSearchFocused'](){if(!this['_hasSearch']||!this['_searchTextView']||!this['_searchTextView']['queryView']['fieldView']['element'])return!0x1;const _0xccc02b=this['_searchTextView']['queryView']['fieldView']['element']['ownerDocument']?.['activeElement'];return this['_searchTextView']['queryView']['fieldView']['element']['contains'](_0xccc02b);}['_createListItems'](_0x1517e6,_0x44faee,_0x15e33a){const _0x66ba76=new _0x3f24a6();return _0x44faee['forEach'](_0x33e490=>{if('actions'in _0x33e490){const {listItem:_0x2acc66}=this['_createActionGroupButton'](_0x1517e6,_0x33e490,_0x15e33a);_0x66ba76['add'](_0x2acc66),_0x33e490['actions']['forEach'](_0x28e570=>{this['_createActionButton'](_0x1517e6,_0x28e570,_0x33e490['label'],_0x33e490['icon']);const {listItem:_0x2b493b,highlightViews:_0x340d7b}=this['_createSearchResultActionButton'](_0x1517e6,_0x28e570,_0x33e490['label'],_0x33e490['icon']);this['_allSearchableItems']['push']({'item':_0x2b493b,'label':_0x28e570['label'],'groupLabel':_0x33e490['label'],'highlightViews':_0x340d7b});});}else{const {listItem:_0x361b0b}=this['_createActionButton'](_0x1517e6,_0x33e490);_0x66ba76['add'](_0x361b0b);const _0x41caae=_0x361b0b['children']['first'];if(_0x41caae){const {listItem:_0x3d9930,highlightViews:_0x549595}=this['_createSearchResultActionButton'](_0x1517e6,_0x33e490);this['_allSearchableItems']['push']({'item':_0x3d9930,'label':_0x41caae['label']||'','highlightViews':_0x549595});}}}),_0x66ba76;}['_createActionButton'](_0x59086d,_0x2fe343,_0x14fa63,_0x1b1c32){const _0x12a0d0=new Ht(this['locale']);if(_0x14fa63&&_0x1b1c32){const _0x262735=new Nt(this['locale']),_0x5519d0=_0x262735['bindTemplate'],_0x588415=new _0x149c0b();_0x588415['text']=_0x2fe343['label'];const _0x278285=new _0x149c0b();_0x278285['text']=_0x14fa63;const _0x2a7aa6=new xt();_0x2a7aa6['content']=_0x1b1c32,_0x2a7aa6['extendTemplate']({'attributes':{'class':'ck-ai-quick-actions-button__group-icon'}});const _0x5e8037=new vt(this['locale']);_0x5e8037['setTemplate']({'tag':'span','attributes':{'class':'ck-ai-quick-actions-button_with-group__open-paren'},'children':[{'text':'\x20('}]});const _0x1ec7d1=new vt(this['locale']);return _0x1ec7d1['setTemplate']({'tag':'span','attributes':{'class':'ck-ai-quick-actions-button_with-group__close-paren'},'children':[{'text':')'}]}),_0x262735['set']({'label':_0x2fe343['label']+'\x20('+_0x14fa63+')','withText':!0x0,'role':'menuitem','class':'ck-ai-quick-actions-button\x20ck-ai-quick-actions-button_with-group','tooltip':!0x1}),_0x262735['setTemplate']({'tag':'button','attributes':{'class':['ck','ck-button','ck-button_with-text','ck-ai-quick-actions-button','ck-ai-quick-actions-button_with-group'],'type':'button','role':'menuitem','tabindex':'-1'},'children':[_0x588415,_0x5e8037,_0x2a7aa6,_0x278285,_0x1ec7d1],'on':{'mouseenter':_0x5519d0['to'](()=>{this['_isSearchFocused']()||_0x262735['focus']();}),'click':_0x5519d0['to'](()=>{_0x262735['fire']('execute');})}}),_0x262735['on']('execute',()=>{_0x59086d['editing']['view']['focus'](),_0x59086d['commands']['execute']('aiQuickAction',_0x2fe343);}),_0x12a0d0['children']['add'](_0x262735),{'listItem':_0x12a0d0,'highlightViews':[_0x588415,_0x278285]};}{const _0x50f65f=new _0x5a486f(),_0x133b32=new Nt(this['locale'],_0x50f65f),_0x375d3e=_0x133b32['bindTemplate'],_0x40ca73=_0x2fe343['icon']??_0x2fe343['parent']?.['icon'],_0x5132bb=void 0x0!==_0x2fe343['icon'];return _0x133b32['set']({'label':_0x2fe343['label'],'withText':!0x0,'role':'menuitem','icon':_0x5132bb?_0x40ca73??_0x3f90e7:void 0x0,'tooltip':!0x1,'class':'ck-ai-quick-actions-button'}),_0x133b32['extendTemplate']({'on':{'mouseenter':_0x375d3e['to'](()=>{this['_isSearchFocused']()||_0x133b32['focus']();})}}),_0x133b32['on']('execute',()=>{_0x59086d['editing']['view']['focus'](),_0x59086d['commands']['execute']('aiQuickAction',_0x2fe343);}),_0x12a0d0['children']['add'](_0x133b32),{'listItem':_0x12a0d0,'highlightViews':[_0x50f65f]};}}['_createSearchResultActionButton'](_0x1da2f6,_0x1da330,_0x287c35,_0x5d817b){return _0x287c35&&_0x5d817b?this['_createSearchResultGroupedActionButton'](_0x1da2f6,_0x1da330,_0x287c35,_0x5d817b):this['_createSearchResultIndividualActionButton'](_0x1da2f6,_0x1da330);}['_createSearchResultGroupedActionButton'](_0x549318,_0x220b22,_0x125c60,_0x5479e2){const _0x269722=new Ht(this['locale']),_0x122c42=new Nt(this['locale']),_0x382c00=_0x122c42['bindTemplate'],{view:_0x43417e,highlightView:_0x414a64}=this['_createSearchResultGroupRow'](_0x125c60,_0x5479e2),{view:_0x206eb0,highlightView:_0x1dced3}=this['_createSearchResultActionRow'](_0x220b22['label']),_0x431e59=this['_createSearchResultContentView'](_0x43417e,_0x206eb0);return _0x122c42['set']({'label':_0x220b22['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}),_0x122c42['setTemplate']({'tag':'button','attributes':{'class':['ck','ck-button','ck-button_with-text','ck-ai-quick-actions-button','ck-ai-quick-actions-search-result-button','ck-ai-quick-actions-search-result-button_with-group'],'type':'button','role':'menuitem','tabindex':'-1'},'children':[_0x431e59],'on':{'mouseenter':_0x382c00['to'](()=>{this['_isSearchFocused']()||_0x122c42['focus']();}),'click':_0x382c00['to'](()=>{this['_handleSearchResultButtonClick'](_0x122c42);})}}),this['_setupActionButtonExecution'](_0x122c42,_0x549318,_0x220b22),_0x269722['children']['add'](_0x122c42),{'listItem':_0x269722,'highlightViews':[_0x414a64,_0x1dced3]};}['_createSearchResultIndividualActionButton'](_0x45eb9e,_0x6d428a){const _0x11e85e=new Ht(this['locale']),_0x25cf25=new _0x5a486f(),_0x149952=new Nt(this['locale'],_0x25cf25),_0x4ea067=_0x149952['bindTemplate'];return _0x149952['set']({'label':_0x6d428a['label'],'withText':!0x0,'role':'menuitem','icon':void 0x0,'tooltip':!0x1,'class':'ck-ai-quick-actions-button\x20ck-ai-quick-actions-search-result-button'}),_0x149952['extendTemplate']({'on':{'mouseenter':_0x4ea067['to'](()=>{this['_isSearchFocused']()||_0x149952['focus']();})}}),this['_setupActionButtonExecution'](_0x149952,_0x45eb9e,_0x6d428a),_0x11e85e['children']['add'](_0x149952),{'listItem':_0x11e85e,'highlightViews':[_0x25cf25]};}['_createSearchResultGroupRow'](_0x4c22b1,_0x6b4d53){const _0x55d456=new vt(this['locale']),_0x4a0949=new xt();_0x4a0949['content']=_0x6b4d53,_0x4a0949['extendTemplate']({'attributes':{'class':'ck-ai-quick-actions-button__group-icon'}});const _0x58bc0b=new _0x149c0b();return _0x58bc0b['text']=_0x4c22b1,_0x55d456['setTemplate']({'tag':'div','attributes':{'class':'ck-ai-quick-actions-search-result__group-row'},'children':[_0x4a0949,_0x58bc0b]}),{'view':_0x55d456,'highlightView':_0x58bc0b};}['_createSearchResultActionRow'](_0x4ee8d6){const _0x2d6b6a=new vt(this['locale']),_0x129000=new _0x149c0b();return _0x129000['text']=_0x4ee8d6,_0x2d6b6a['setTemplate']({'tag':'div','attributes':{'class':'ck-ai-quick-actions-search-result__action-row'},'children':[_0x129000]}),{'view':_0x2d6b6a,'highlightView':_0x129000};}['_createSearchResultContentView'](_0xa0357e,_0x4cc3a7){const _0x564ff5=new vt(this['locale']);return _0x564ff5['setTemplate']({'tag':'div','attributes':{'class':'ck-ai-quick-actions-search-result__content'},'children':[_0xa0357e,_0x4cc3a7]}),_0x564ff5;}['_setupActionButtonExecution'](_0x4d6935,_0xa1f490,_0x1d1590){_0x4d6935['on']('execute',()=>{_0xa1f490['editing']['view']['focus'](),_0xa1f490['commands']['execute']('aiQuickAction',_0x1d1590);});}['_createActionGroupButton'](_0x4b9e18,_0x127e96,_0xcf1785){const _0x403d69=new Ht(this['locale']),_0x43d9fc=new _0x5a486f(),_0x2514bf=new Do(this['locale'],_0x43d9fc),_0x28e739=_0x2514bf['bindTemplate'],_0x2de218=this['_getPanelKeystroke'](_0xcf1785),_0x52d432=this['_createGroupActionsList'](_0x4b9e18,_0x127e96['actions'],_0xcf1785);_0x2514bf['set']({'label':_0x127e96['label'],'withText':!0x0,'role':Mo,'icon':_0x127e96['icon']??_0x3f90e7,'isEnabled':_0x127e96['actions']['some'](_0x275a36=>_0x275a36['isEnabled'])}),_0x2514bf['extendTemplate']({'on':{'mouseenter':_0x28e739['to'](()=>{this['_isSearchFocused']()||_0x2514bf['focus']();})}});const _0x45516c=new Xt(this['locale']);return _0x45516c['extendTemplate']({'attributes':{'class':['ck','ck-reset_all','ck-ai-quick-actions-group-panel','ck-dropdown-menu__nested-menu__panel']},'on':{'keydown':_0x28e739['to'](_0x341d89=>{this['_handlePanelKeydown'](_0x341d89,_0x2de218,_0x2514bf,_0x45516c);})}}),_0x2514bf['bind']('isOn')['to'](_0x45516c,'isVisible'),this['_bodyCollection']['add'](_0x45516c),_0x45516c['content']['add'](_0x52d432),this['_setupGroupMenuBehavior'](_0x2514bf,_0x45516c),_0x403d69['children']['add'](_0x2514bf),{'listItem':_0x403d69,'highlightView':_0x43d9fc};}['_createGroupActionsList'](_0x5d98c9,_0x471d31,_0x502e09){const _0x39254f=new Dt(this['locale']);return _0x39254f['extendTemplate']({'attributes':{'class':['ck','ck-reset_all','ck-ai-quick-actions-group-list','ck-dropdown-menu-list']}}),_0x471d31['forEach'](_0xe6e5ba=>{const _0x256963=new Ht(this['locale']),_0x1fb6b7=Lo({'editor':_0x5d98c9,'action':_0xe6e5ba,'withText':!0x0,'withIcon':!0x1,'isInDropdown':!0x0,'shouldPreventFocus':()=>this['_isSearchFocused']()})();_0x256963['children']['add'](_0x1fb6b7),_0x502e09['focusTracker']['add'](_0x1fb6b7),_0x39254f['items']['add'](_0x256963);}),_0x39254f;}['_setupGroupMenuBehavior'](_0x5accd8,_0x5968bf){const _0x5b02d5=_0x5accd8['bindTemplate'],_0x1e2503=this['_getButtonKeystroke'](_0x5accd8);_0x5accd8['extendTemplate']({'attributes':{'class':['ck-ai-quick-actions-group-button']},'on':{'mouseenter':_0x5b02d5['to'](()=>{this['_showNestedPanel'](_0x5968bf,_0x5accd8);}),'mouseleave':_0x5b02d5['to'](_0x4f7713=>{const _0x26bd88=_0x4f7713['relatedTarget'];this['_isMovingToNestedMenu'](_0x26bd88,_0x5968bf)||this['_hideNestedPanel'](_0x5968bf);}),'keydown':_0x5b02d5['to'](_0xb520aa=>{_0xb520aa['key']==_0x1e2503&&(this['_showNestedPanel'](_0x5968bf,_0x5accd8),_0x5968bf['content']['get'](0x0)['focus']());})}}),_0x5968bf['on']('render',()=>{_0x5968bf['element']?.['addEventListener']('mouseleave',_0x5a8ce2=>{const _0x402821=_0x5a8ce2['relatedTarget'];_0x5accd8['element']?.['contains'](_0x402821)||this['_isMovingToNestedMenu'](_0x402821,_0x5968bf)||this['_hideNestedPanel'](_0x5968bf);});});}['_showNestedPanel'](_0x137bdf,_0x3574ec){this['_openNestedPanels']['forEach'](_0x371cd5=>{_0x371cd5!==_0x137bdf&&_0x371cd5['isVisible']&&_0x371cd5['hide']();}),_0x137bdf['show'](),_0x137bdf['pin']({'positions':[_0x3be29e['eastSouth']],'target':_0x3574ec['element'],'fitInViewport':!0x0}),this['_openNestedPanels']['add'](_0x137bdf);}['_hideNestedPanel'](_0x1f77e3){_0x1f77e3['hide'](),this['_openNestedPanels']['delete'](_0x1f77e3);}['_hideAllNestedPanels'](){this['_openNestedPanels']['forEach'](_0x56cfd5=>_0x56cfd5['hide']()),this['_openNestedPanels']['clear']();}['_isMovingToNestedMenu'](_0x1996ee,_0x5b61c8){if(!_0x1996ee)return!0x1;if(_0x5b61c8['element']?.['contains'](_0x1996ee))return!0x0;const _0x56e3b6=_0x1996ee;return _0x56e3b6['closest']&&(null!==_0x56e3b6['closest']('.ck-ai-quick-actions-group-panel')||null!==_0x56e3b6['closest']('.ck-ai-quick-actions-group-list')||null!==_0x56e3b6['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'](_0x57b964){return'rtl'===_0x57b964['locale']['uiLanguageDirection']?'ArrowRight':'ArrowLeft';}['_getButtonKeystroke'](_0x1183ce){return'rtl'===_0x1183ce['locale']['uiLanguageDirection']?'ArrowLeft':'ArrowRight';}['_handlePanelKeydown'](_0x515fb2,_0x15e8b5,_0xd221bf,_0x7beb6f){_0x515fb2['key']==_0x15e8b5&&(_0xd221bf['focus'](),this['_hideNestedPanel'](_0x7beb6f));}['_handleSearchResultButtonClick'](_0x145ae6){_0x145ae6['fire']('execute');}}function Vo(_0xfffc43){const {editor:_0x315843,content:_0x36fae2,buttonDefinition:_0x1fa823,bodyCollection:_0x2a0bb7,hasSearch:_0x1ec945=!0x1}=_0xfffc43;return()=>{const _0x479fb0=_0x315843['locale'],_0x5cb47f=_0x315843['commands']['get']('aiQuickAction'),_0x424407=Gt(_0x479fb0);_0x424407['bind']('isEnabled')['to'](_0x5cb47f),_0x424407['buttonView']['set']({'icon':_0x1fa823['icon']??_0x3f90e7,'label':_0x1fa823['label'],'tooltip':!0x0}),_0x424407['set']({'class':'ck-ai-quick-actions-dropdown'});const _0x22a88f=new Uo(_0x315843,_0x36fae2,_0x424407,_0x2a0bb7,_0x1ec945);return _0x424407['panelView']['children']['add'](_0x22a88f),_0x1ec945&&_0x424407['on']('change:isOpen',(_0x586b19,_0x4c68a4,_0x5db74a)=>{if(_0x5db74a){if(_0x315843['plugins']['has']('AIEditing')){const _0x8d6ce5=_0x315843['plugins']['get'](Js),_0x449b86=_0x315843['model']['document']['selection'],_0x5452cc=Array['from'](_0x449b86['getRanges']());_0x5452cc['length']>0x0&&_0x8d6ce5['showFakeVisualSelection']({'ranges':_0x5452cc,'id':'quick-action','priority':0x14});}}else _0x315843['plugins']['has']('AIEditing')&&_0x315843['plugins']['get'](Js)['hideFakeVisualSelection']('quick-action'),_0x22a88f['resetSearch']();}),_0x424407;};}const Bo='<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>',Go='<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>',Fo='<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>',Ko=/* #__PURE__ -- @preserve */
28
+ ((()=>({'chat':'AIChat','action':'AIActions'}))());class Wo extends _0x18211b{static get['requires'](){return[_0x12ae68,as];}static get['pluginName'](){return'AIQuickActionsUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}async['init'](){const _0x136c60=await this['_getDefaultAndCustomActions']();this['_prepareQuickActionsDefinition'](_0x136c60),this['_initializeQuickActionsComponentsAndCommands']();}static['getDefaultQuickActions'](_0x26f586){return function(_0x17c60a){const _0x9abc4f=new Intl['DisplayNames'](['en'],{'type':'language'})['of'](_0x17c60a['uiLanguage']),_0x454247=_0x9abc4f||'English',_0x1b8e63=[{'id':'ask-ai','label':hs(_0x17c60a,'AI_QUICK_ACTIONS_ASK_AI'),'type':'chat','icon':_0x2dbe23},{'id':'chat-commands','label':hs(_0x17c60a,'AI_QUICK_ACTIONS_CHAT_COMMANDS'),'icon':_0x2dbe23,'actions':[{'id':'explain','label':hs(_0x17c60a,'AI_QUICK_ACTIONS_EXPLAIN'),'displayedPrompt':hs(_0x17c60a,'AI_QUICK_ACTIONS_EXPLAIN'),'prompt':Bo['replace']('%0',_0x454247),'type':'chat'},{'id':'summarize','label':hs(_0x17c60a,'AI_QUICK_ACTIONS_SUMMARIZE'),'displayedPrompt':hs(_0x17c60a,'AI_QUICK_ACTIONS_SUMMARIZE'),'prompt':Go['replace']('%0',_0x454247),'type':'chat'},{'id':'highlight-key-points','label':hs(_0x17c60a,'AI_QUICK_ACTIONS_HIGHLIGHT_KEY_POINTS'),'displayedPrompt':hs(_0x17c60a,'AI_QUICK_ACTIONS_HIGHLIGHT_KEY_POINTS'),'prompt':Fo['replace']('%0',_0x454247),'type':'chat'}]},{'id':'improve-writing','label':hs(_0x17c60a,'AI_QUICK_ACTIONS_IMPROVE_WRITING'),'type':'action','icon':_0x47c605},{'id':'continue','label':hs(_0x17c60a,'AI_QUICK_ACTIONS_CONTINUE_WRITING'),'type':'action','icon':_0x1dee61},{'id':'fix-grammar','label':hs(_0x17c60a,'AI_QUICK_ACTIONS_FIX_GRAMMAR_SPELLING'),'type':'action','icon':_0x3a7052},{'id':'adjust-length','label':hs(_0x17c60a,'AI_QUICK_ACTIONS_ADJUST_LENGTH'),'icon':_0x5c6e7b,'actions':[{'id':'make-shorter','label':hs(_0x17c60a,'AI_QUICK_ACTIONS_MAKE_SHORTER'),'type':'action'},{'id':'make-longer','label':hs(_0x17c60a,'AI_QUICK_ACTIONS_MAKE_LONGER'),'type':'action'}]},{'id':'change-tone','label':hs(_0x17c60a,'AI_QUICK_ACTIONS_CHANGE_TONE'),'icon':_0x45f76c,'actions':[{'id':'make-tone-casual','label':hs(_0x17c60a,'AI_QUICK_ACTIONS_MORE_CASUAL'),'type':'action'},{'id':'make-tone-direct','label':hs(_0x17c60a,'AI_QUICK_ACTIONS_MORE_DIRECT'),'type':'action'},{'id':'make-tone-friendly','label':hs(_0x17c60a,'AI_QUICK_ACTIONS_MORE_FRIENDLY'),'type':'action'},{'id':'make-tone-confident','label':hs(_0x17c60a,'AI_QUICK_ACTIONS_MORE_CONFIDENT'),'type':'action'},{'id':'make-tone-professional','label':hs(_0x17c60a,'AI_QUICK_ACTIONS_MORE_PROFESSIONAL'),'type':'action'}]},{'id':'translate','label':hs(_0x17c60a,'AI_QUICK_ACTIONS_TRANSLATE'),'icon':_0x12e558,'actions':[{'id':'translate-to-english','label':hs(_0x17c60a,'AI_QUICK_ACTIONS_TRANSLATE_ENGLISH'),'type':'action','actionName':'translate','args':{'language':'english'}},{'id':'translate-to-chinese','label':hs(_0x17c60a,'AI_QUICK_ACTIONS_TRANSLATE_CHINESE'),'type':'action','actionName':'translate','args':{'language':'chinese'}},{'id':'translate-to-spanish','label':hs(_0x17c60a,'AI_QUICK_ACTIONS_TRANSLATE_SPANISH'),'type':'action','actionName':'translate','args':{'language':'spanish'}},{'id':'translate-to-german','label':hs(_0x17c60a,'AI_QUICK_ACTIONS_TRANSLATE_GERMAN'),'type':'action','actionName':'translate','args':{'language':'german'}},{'id':'translate-to-french','label':hs(_0x17c60a,'AI_QUICK_ACTIONS_TRANSLATE_FRENCH'),'type':'action','actionName':'translate','args':{'language':'french'}},{'id':'translate-to-japanese','label':hs(_0x17c60a,'AI_QUICK_ACTIONS_TRANSLATE_JAPANESE'),'type':'action','actionName':'translate','args':{'language':'japanese'}},{'id':'translate-to-portuguese','label':hs(_0x17c60a,'AI_QUICK_ACTIONS_TRANSLATE_PORTUGUESE'),'type':'action','actionName':'translate','args':{'language':'portuguese'}},{'id':'translate-to-korean','label':hs(_0x17c60a,'AI_QUICK_ACTIONS_TRANSLATE_KOREAN'),'type':'action','actionName':'translate','args':{'language':'korean'}},{'id':'translate-to-italian','label':hs(_0x17c60a,'AI_QUICK_ACTIONS_TRANSLATE_ITALIAN'),'type':'action','actionName':'translate','args':{'language':'italian'}},{'id':'translate-to-russian','label':hs(_0x17c60a,'AI_QUICK_ACTIONS_TRANSLATE_RUSSIAN'),'type':'action','actionName':'translate','args':{'language':'russian'}}]},{'id':'other','label':hs(_0x17c60a,'AI_QUICK_ACTIONS_OTHER'),'icon':_0x1f2792,'actions':[]}];return _0x1b8e63;}(_0x26f586);}async['_getDefaultAndCustomActions'](){const _0x59b449=Wo['getDefaultQuickActions'](this['editor']['locale']),_0x15f482=this['editor']['config']['get']('ai.quickActions.extraCommands')||[];let _0x46f135,_0x384edd=[];try{const _0x3ec214=new Fs({'connector':this['editor']['plugins']['get']('AIConnector'),'config':this['editor']['config']['get']('ai.models'),'locale':this['editor']['locale']});_0x384edd=await _0x3ec214['getAll'](),_0x46f135=(await _0x3ec214['getDefault']())?.['id'];}catch(_0x86f22d){const _0x51f92b=new at('ai-quick-actions-models-unable-to-retrieve',this,{'error':_0x86f22d});Et(_0x51f92b['message']);}finally{const _0x1e2e5d=_0x15f482['map'](_0x5753ee=>({..._0x5753ee,'type':'chat'===_0x5753ee['type']?'chat':'action','model':'chat'!==_0x5753ee['type']?_0x5753ee['model']||_0x46f135:_0x5753ee['model'],'icon':void 0x0}));_0x59b449['find'](_0x26e243=>'other'===_0x26e243['id'])['actions']['push'](..._0x1e2e5d),_0x59b449['forEach'](_0x2b43ed=>{if('actions'in _0x2b43ed)_0x2b43ed['actions']['forEach'](_0x5373e4=>{if(_0x5373e4['isEnabled']=!!_0x384edd['find'](_0x3d0327=>_0x3d0327['id']===_0x5373e4['model'])||void 0x0===_0x5373e4['model'],!_0x5373e4['isEnabled']){const _0xef8d7a=new at('ai-quick-actions-unavailable-model',this,{'actionId':_0x5373e4['id'],'modelId':_0x5373e4['model']});Et(_0xef8d7a['message']);}});else{if(_0x2b43ed['isEnabled']=!!_0x384edd['find'](_0xc1b44c=>_0xc1b44c['id']===_0x2b43ed['model'])||void 0x0===_0x2b43ed['model'],!_0x2b43ed['isEnabled']){const _0x97e406=new at('ai-quick-actions-unavailable-model',this,{'actionId':_0x2b43ed['id'],'modelId':_0x2b43ed['model']});Et(_0x97e406['message']);}}});}return _0x59b449;}['_initializeQuickActionsComponentsAndCommands'](){const _0x24caf4=new Qt(this['editor']['locale']);_0x24caf4['attachToDom'](),this['_initializeQuickActionsDropdown'](_0x24caf4),this['_initializeQuickActionsMenuBar'](),this['_initializeQuickActionsComponents'](_0x24caf4);}['_initializeQuickActionsDropdown'](_0x57eb85){const _0xf9403b=this['editor']['config']['get']('ai.quickActions.isSearchEnabled')??!0x0;this['editor']['ui']['componentFactory']['add']('aiQuickActions',Vo({'editor':this['editor'],'content':this['_quickActionsDefinition'],'buttonDefinition':{'icon':_0x3f90e7,'label':hs(this['editor']['locale'],'AI_QUICK_ACTIONS_HEADING')},'bodyCollection':_0x57eb85,'hasSearch':_0xf9403b}));}['_prepareQuickActionsDefinition'](_0xe5606e){this['_quickActionsDefinition']=_0xe5606e['map'](_0x1de023=>{if('actions'in _0x1de023){const _0x571e4d=_0x1de023;return{..._0x571e4d,'actions':_0x571e4d['actions']['map'](_0x2c7fa3=>{const {actions:_0x3f1003,..._0x307d6c}=_0x571e4d;return{..._0x2c7fa3,'parent':_0x307d6c};})['filter'](_0x5323c9=>this['_shouldIncludeAction'](_0x5323c9))};}return _0x1de023;})['filter'](_0x1f2f35=>'actions'in _0x1f2f35?_0x1f2f35['actions']['length']>0x0:this['_shouldIncludeAction'](_0x1f2f35));}['_shouldIncludeAction'](_0x583c3b){const _0x5127b2=this['editor']['config']['get']('ai.quickActions.removeCommands')||[];return this['editor']['plugins']['has'](Ko[_0x583c3b['type']])&&!_0x5127b2['includes'](_0x583c3b['id'])&&!('chat'===_0x583c3b['type']&&!0x1===this['editor']['config']['get']('ai.chat.context.document.enabled'));}['_initializeQuickActionsComponents'](_0xc80bd5){this['_quickActionsDefinition']['forEach'](_0x135255=>{if('actions'in _0x135255){const _0x3d9c62=Vo({'editor':this['editor'],'content':_0x135255['actions'],'buttonDefinition':_0x135255,'bodyCollection':_0xc80bd5});this['editor']['ui']['componentFactory']['add'](_0x135255['id'],_0x3d9c62),_0x135255['actions']['forEach'](_0x4f08c6=>{const _0x50b6ca=Lo({'editor':this['editor'],'action':_0x4f08c6});this['editor']['ui']['componentFactory']['add'](_0x4f08c6['id'],_0x50b6ca);});}else{const _0xbf08f9=Lo({'editor':this['editor'],'action':_0x135255,'withText':!0x1,'withIcon':!0x0,'isInDropdown':!0x1});this['editor']['ui']['componentFactory']['add'](_0x135255['id'],_0xbf08f9);}});}['_initializeQuickActionsMenuBar'](){this['editor']['ui']['componentFactory']['add']('menuBar:aiQuickActions',_0x11567a=>{const _0x41acc3=this['editor']['commands']['get']('aiQuickAction'),_0x10d7f5=new Kt(_0x11567a),_0x2b0ba5=hs(_0x11567a,'AI_QUICK_ACTIONS_HEADING');_0x10d7f5['buttonView']['set']({'label':_0x2b0ba5,'icon':_0x3f90e7});const _0x20fa5c=new $t(_0x11567a);return _0x20fa5c['set']({'ariaLabel':_0x2b0ba5,'role':'menu'}),this['_quickActionsDefinition']['forEach'](_0x4264ed=>{if('actions'in _0x4264ed){const _0x539f6c=_0x4264ed,_0x2ce144=new qt(_0x11567a,_0x10d7f5),_0x4d8dbf=new Kt(_0x11567a),_0x570fe6=new $t(_0x11567a);_0x4d8dbf['buttonView']['set']({'label':_0x539f6c['label'],'icon':_0x539f6c['icon']}),_0x539f6c['actions']['forEach'](_0x40f966=>{const _0x2ced8f=new qt(_0x11567a,_0x4d8dbf),_0x1e6b5a=new Wt(_0x11567a);_0x1e6b5a['set']({'label':_0x40f966['label'],'icon':_0x40f966['icon'],'role':'menuitem','isEnabled':_0x40f966['isEnabled']}),_0x1e6b5a['on']('execute',()=>{this['_executeQuickAction'](_0x40f966);}),_0x1e6b5a['delegate']('execute')['to'](_0x4d8dbf),_0x2ced8f['children']['add'](_0x1e6b5a),_0x570fe6['items']['add'](_0x2ced8f);}),_0x4d8dbf['panelView']['children']['add'](_0x570fe6),_0x2ce144['children']['add'](_0x4d8dbf),_0x20fa5c['items']['add'](_0x2ce144);}else{const _0xbbbdf3=_0x4264ed,_0x26c6fb=new qt(_0x11567a,_0x10d7f5),_0x1147d7=new Wt(_0x11567a);_0x1147d7['set']({'label':_0xbbbdf3['label'],'icon':_0xbbbdf3['icon'],'role':'menuitem','isEnabled':_0xbbbdf3['isEnabled']}),_0x1147d7['on']('execute',()=>{this['_executeQuickAction'](_0xbbbdf3);}),_0x1147d7['delegate']('execute')['to'](_0x10d7f5),_0x26c6fb['children']['add'](_0x1147d7),_0x20fa5c['items']['add'](_0x26c6fb);}}),(Object['values'](Ko)['some'](_0x25d80e=>this['editor']['plugins']['has'](_0x25d80e))?_0x10d7f5['bind']('isEnabled')['to'](_0x41acc3):_0x10d7f5['set']({'isEnabled':!0x1}),_0x10d7f5['panelView']['children']['add'](_0x20fa5c),_0x10d7f5);});}['_executeQuickAction'](_0x3b1d52){const _0x159402=this['editor'];_0x159402['editing']['view']['focus'](),_0x159402['commands']['execute']('aiQuickAction',_0x3b1d52);const _0x1687b8=_0x159402['ui']['view']['menuBarView'];_0x1687b8&&_0x1687b8['close']&&_0x1687b8['close']();}}class Yo extends _0x5bebe4{['execute'](_0xec5e29){switch(this['_expandSelectionIfCollapsed'](),_0xec5e29['type']){case'chat':if(!this['editor']['plugins']['has']('AIChat')){const _0x1393b0=hs(this['editor']['locale'],'AI_QUICK_ACTIONS_PLUGIN_NOT_FOUND','AIChat');throw new at('ai-quick-actions-plugin-not-found',this['editor'],{'errorMessage':_0x1393b0});}this['_handleAIChatAction'](_0xec5e29);break;case'action':if(!this['editor']['plugins']['has']('AIActions')){const _0x15201f=hs(this['editor']['locale'],'AI_QUICK_ACTIONS_PLUGIN_NOT_FOUND','AIActions');throw new at('ai-quick-actions-plugin-not-found',this['editor'],{'errorMessage':_0x15201f});}this['_handleAIActionsAction'](_0xec5e29);}}async['_handleAIChatAction'](_0x194a8b){const _0x32a400=this['editor']['plugins']['get']('AIChatController'),_0xfc889e=this['editor']['plugins']['get']('AITabs')['view'];if(_0xfc889e['isVisible']||(_0xfc889e['isVisible']=!0x0),'chat'!==_0xfc889e['activeTab']&&_0xfc889e['activateTab']('chat'),'ask-ai'===_0x194a8b['id'])_0x32a400['removeSelectionFromChatContext'](),_0x32a400['addSelectionToChatContext'](),_0x32a400['focusPromptInput']();else await _0x32a400['startConversation']({'modelId':_0x194a8b['model']}),_0x32a400['removeSelectionFromChatContext'](),_0x32a400['addSelectionToChatContext'](),_0x32a400['focusPromptInput'](),await _0x32a400['sendMessage']({'message':_0x194a8b['prompt']||_0x194a8b['displayedPrompt']||_0x194a8b['label'],'attributes':{'quickActionData':{'id':_0x194a8b['id']},'displayedPrompt':_0x194a8b['displayedPrompt']}});}['_expandSelectionIfCollapsed'](){const _0x523947=this['editor'],_0x5c1153=_0x523947['model']['document']['selection'];if(!_0x5c1153['isCollapsed'])return;const _0x5c0114=At(_0x5c1153['getSelectedBlocks']())||_0x523947['model']['schema']['getLimitElement'](_0x5c1153);_0x523947['model']['change'](_0x49a5bd=>{_0x49a5bd['setSelection'](_0x5c0114,'in');});}['_handleAIActionsActionLabel'](_0x31ba74){return _0x31ba74['parent']?.['label']&&'other'!==_0x31ba74['parent']?.['id']?_0x31ba74['parent']['label']+':\x20'+_0x31ba74['label']:_0x31ba74['label'];}async['_handleAIActionsAction'](_0x24f23f){const _0x458d1f=this['editor']['plugins']['get']('AIActions'),_0x14a74e=_0x24f23f['prompt']?{'userMessage':_0x24f23f['prompt'],'model':_0x24f23f['model']}:{'actionName':_0x24f23f['actionName']||_0x24f23f['id'],'args':_0x24f23f['args']},_0x2238cc=this['_handleAIActionsActionLabel'](_0x24f23f);await _0x458d1f['executeAction'](_0x14a74e,_0x2238cc,_0x24f23f['icon']);}}class $o extends _0x18211b{static get['pluginName'](){return'AIQuickActionsEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const _0x4ce445=this['editor'],_0x1a0407=new Yo(this['editor']);if(_0x4ce445['commands']['add']('aiQuickAction',_0x1a0407),_0x4ce445['plugins']['has']('AIChat')){const _0x36ab2e=this['editor']['plugins']['get']('AIChatController');_0x4ce445['model']['document']['selection']['on']('change:range',(_0x28b6dc,_0x14a639)=>{_0x14a639['directChange']&&_0x36ab2e['removeSelectionFromChatContext']();});}}}class qo extends xs{['updateChangeGroups'](){if(this['parsedMergedContent']=this['parsedContent']['cloneNode'](!0x0),0x0==this['parsedMergedContent']['childNodes']['length'])return void(this['changeGroups']=[]);const _0x5a7c47=this['documentContextContent']['children']['map'](_0x1fe450=>({'node':_0x1fe450,'id':Es(_0x1fe450,'data-id')})),_0x5aeda0=this['parsedMergedContent']['children']['map'](_0x5597b5=>({'node':_0x5597b5,'id':Es(_0x5597b5,'data-id')||ot()})),_0x3dd085=_0x224b98(_0x5a7c47,_0x5aeda0,{'comparator':(_0x2c0b4a,_0x10f38c)=>_0x2c0b4a['id']==_0x10f38c['id'],'oneChangePerToken':!0x0});if(!this['isDone']||!this['isComplete']){for(;_0x3dd085['length']&&_0x3dd085[_0x3dd085['length']-0x1]['removed'];)_0x3dd085['pop']();}const _0x8af4b5=_0x3dd085['map'](_0xb2ff95=>{const _0x5bf18d=_0xb2ff95['added']?'new':_0xb2ff95['removed']?'removed':'modified';return{'node':_0xb2ff95['value'][0x0]['node'],'type':_0x5bf18d,'id':_0xb2ff95['value'][0x0]['id']};});this['changeGroups']=[{'changes':_0x8af4b5,'state':'pending','index':0x0}];}['_getDifferentChangeGroups'](_0x2d4194,_0x242398){return _0x242398;}}class Qo extends Ds{['content'];['version'];['actionName'];['args'];['userMessage'];['model'];['hasError']=!0x1;['stoppedExplicitly']=!0x1;constructor(_0x8e87ab){super(_0x8e87ab),this['content']=_0x8e87ab['content'],this['version']=_0x8e87ab['version'],this['actionName']=_0x8e87ab['actionName'],this['args']=_0x8e87ab['args'],this['userMessage']=_0x8e87ab['userMessage'],this['model']=_0x8e87ab['model'],this['on']('interactionStopped',()=>{this['stoppedExplicitly']=!0x0;});}async['sendRequest'](){return this['actionName']?this['connector']['executeAction']({'content':this['content'],'actionName':this['actionName'],'args':this['args']}):this['connector']['executeCustomAction']({'content':this['content'],'message':this['userMessage'],'model':this['model'],'outputFormat':'html'});}['getDocumentContext'](){return{'type':'text','content':this['content'],'version':this['version'],'label':'Current\x20document','uiId':'current-document'};}['createReply'](_0xf92c88){const _0x1d48d8=new qo({'locale':this['locale'],'documentContextContent':this['content'],..._0xf92c88});return this['replies']['push'](_0x1d48d8),_0x1d48d8['delegate'](...Ls)['to'](this),this['fire']('replyCreated',_0x1d48d8),_0x1d48d8;}}class Xo extends kt{constructor(_0x35223f,_0x38a65d=!0x0,_0xc34371=!0x0){super(_0x35223f),this['set']('isEnabled',!0x1),_0x38a65d&&(this['applyButton']=this['_createButton'](hs(_0x35223f,'AI_BALLOON_APPLY_BUTTON'),cs),this['applyButton']['bind']('isEnabled')['to'](this),this['items']['add'](this['applyButton'])),_0xc34371&&(this['suggestButton']=this['_createButton'](hs(_0x35223f,'AI_BALLOON_SUGGEST_BUTTON'),_0x38a65d?ls:cs),this['suggestButton']['bind']('isEnabled')['to'](this),this['items']['add'](this['suggestButton'])),this['setButtonsVisibility']({'showApplyButton':_0x38a65d,'showSuggestButton':_0xc34371}),this['extendTemplate']({'attributes':{'class':['ck-ai-balloon__toolbar']}});}['setButtonsVisibility']({showApplyButton:_0x597980,showSuggestButton:_0x409033}){this['applyButton']&&(this['applyButton']['isVisible']=_0x597980),this['suggestButton']&&(this['suggestButton']['isVisible']=_0x409033);}['_createButton'](_0x5662a1,_0x421189){const _0x4d7a1d=new Nt(this['locale']);return _0x4d7a1d['set']({'label':_0x5662a1,'class':_0x421189,'isVisible':!0x0,'withText':!0x0}),_0x4d7a1d;}}class zo extends vt{constructor(_0x5527e9){super(_0x5527e9),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-balloon__disclaimer']},'children':[{'tag':'p','attributes':{'class':['ck','ck-ai-balloon__disclaimer-content']},'children':[{'text':hs(_0x5527e9,'AI_DISCLAIMER_TEXT')}]}]});}}class jo extends vt{constructor(_0x1843de){super(_0x1843de),this['set']('isVisible',!0x0);const _0x1665b2=new yn('small');_0x1665b2['isVisible']=!0x0;const _0xfee12c=new vt(this['locale']);_0xfee12c['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai-suggestion__loader-text']},'children':[hs(this['locale'],'AI_CHAT_IS_WRITING')]}),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__loader',this['bindTemplate']['if']('isVisible','ck-hidden',_0x35b248=>!_0x35b248)]},'children':[_0x1665b2,_0xfee12c]});}}class Jo extends So{['focusCycler'];['_config'];['_contentWrapper'];['_streamableContentView'];['_toolbarView'];['_miniToolbarView'];['_loaderView'];['_disclaimerView'];['_focusTracker'];['_keystrokes'];['_dialogContent'];['_focusables'];['_scrollManager'];['_navigationPreviousButton'];['_navigationNextButton'];['_navigationTryAgainButton'];['_navigationCounter'];constructor(_0x30e20b,_0x3818ea){super(_0x30e20b),this['set']('isBusy',!0x1),this['set']('isTrackChangesOn',!0x1),this['set']('_isLoading',!0x1),this['set']('_hasError',!0x1),this['_config']=_0x3818ea,this['_focusTracker']=new _t(),this['_keystrokes']=new gt(),this['_focusables']=this['createCollection'](),this['focusCycler']=new Ut({'focusables':this['_focusables'],'focusTracker':this['_focusTracker'],'keystrokeHandler':this['_keystrokes'],'actions':{'focusPrevious':'shift\x20+\x20tab','focusNext':'tab'}}),this['_dialogContent']=new _0x3f24a6(),this['_addContentWrapper'](_0x3818ea),this['_addDisclaimerView'](),this['_addToolbar'](_0x3818ea),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'](_0x3818ea);});}['render'](){super['render']();for(const _0xae05b3 of this['_focusables'])this['_focusTracker']['add'](_0xae05b3['element']);this['_keystrokes']['listenTo'](this['element']),this['_initializeScrollManager']();}['destroy'](){super['destroy'](),this['_scrollManager']&&this['_scrollManager']['destroy']();}['focus'](_0x392f5e){-0x1===_0x392f5e?this['focusCycler']['focusLast']():this['focusCycler']['focusFirst']();}['setIsLoading'](_0x10d281){this['_isLoading']=_0x10d281;}['setErrorState'](){this['_hasError']=!0x0,this['_miniToolbarView']['toggleShowChangesEnabled'](!0x1);}['clearErrorState'](){this['_hasError']=!0x1,this['_miniToolbarView']['toggleShowChangesEnabled'](!0x0);}['showError'](_0x136869){super['showError'](_0x136869),this['_dialogContent']['has'](this['_errorView'])||this['_dialogContent']['add'](this['_errorView'],0x0);}['hideError'](){super['hideError'](),this['clearErrorState']();}['showBlockingError'](_0x52102c){super['showBlockingError'](_0x52102c),this['setErrorState']();}['addMiniToolbarItem'](_0x49f0af){this['_miniToolbarView']['items']['has'](_0x49f0af)||this['_miniToolbarView']['items']['add'](_0x49f0af);}['removeMiniToolbarItem'](_0x5a7a52){this['_miniToolbarView']['items']['has'](_0x5a7a52)&&this['_miniToolbarView']['items']['remove'](_0x5a7a52);}['showLoader'](){this['_loaderView']&&(this['_isLoading']=!0x0);}['hideLoader'](){this['_loaderView']&&(this['_isLoading']=!0x1);}['_toggleToolbarButtonsVisibility']({showApplyButton:_0x24d106,showSuggestButton:_0x560247}){_0x24d106=_0x24d106&&!this['isTrackChangesOn']&&this['_config']['availableActions']['includes']('applySuggestion'),_0x560247=_0x560247&&this['_config']['availableActions']['includes']('insertSuggestion'),this['_toolbarView']['setButtonsVisibility']({'showApplyButton':_0x24d106,'showSuggestButton':_0x560247});}async['updateContent'](_0x449f7d){await this['_streamableContentView']['update'](_0x449f7d);}['clearContent'](){this['_streamableContentView']['clear']();}['_addContentWrapper'](_0x10c0f9){this['_contentWrapper']=new vt(this['locale']),this['_contentWrapper']['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-actions-balloon-content']},'children':[{'tag':'div','attributes':{'class':['ck-ai-actions-balloon-content-wrapper']},'children':[this['_createLoaderView'](),this['_createStreamableContentView']()]},this['_createMiniToolbar'](_0x10c0f9['miniToolbarConfig'])]}),this['_dialogContent']['add'](this['_contentWrapper']);}['_addDisclaimerView'](){this['_disclaimerView']=new zo(this['locale']),this['_dialogContent']['add'](this['_disclaimerView']);}['_addToolbar']({showApplyButton:_0x1eb278,showSuggestButton:_0xc87712}){this['_toolbarView']=new Xo(this['locale'],_0x1eb278,_0xc87712),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',(_0x1cf9cd,_0x23a442,_0x1189e0)=>!(_0x1cf9cd||_0x23a442||_0x1189e0)),this['_toggleToolbarButtonsVisibility']({'showApplyButton':_0x1eb278,'showSuggestButton':_0xc87712}),this['_dialogContent']['add'](this['_toolbarView']);}['_createMiniToolbar'](_0x3d9e40){return this['_miniToolbarView']=new ko(this['locale'],_0x3d9e40),this['_miniToolbarView']['delegate'](...Zs)['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',(_0x58149e,_0x21b9a0)=>!(_0x58149e||_0x21b9a0)),this['_miniToolbarView'];}['_createLoaderView'](){return this['_loaderView']=new jo(this['locale']),this['_loaderView']['bind']('isVisible')['to'](this,'_isLoading'),this['_loaderView'];}['_createStreamableContentView'](){return this['_streamableContentView']=new In(this['locale']),this['_streamableContentView'];}['_setupMiniToolbarButtons'](){const _0x3ae9e0=new Nt(this['locale']),_0x2eb3e8=new Nt(this['locale']),_0x1d9479=new Zo(this['locale']),_0x285249=new Nt(this['locale']);_0x3ae9e0['set']({'icon':tt,'label':hs(this['locale'],'AI_ACTIONS_TRY_AGAIN'),'tooltip':!0x0,'class':'ck-ai-custom-action-button\x20'+us}),_0x2eb3e8['set']({'icon':_0x14fdc4,'tooltip':hs(this['locale'],'AI_ACTIONS_PREVIOUS_INTERACTION'),'class':'ck-ai-navigation-button\x20ck-ai-previous-button\x20'+us}),_0x285249['set']({'icon':et,'tooltip':hs(this['locale'],'AI_ACTIONS_NEXT_INTERACTION'),'class':'ck-ai-navigation-button\x20ck-ai-next-button\x20'+us}),_0x3ae9e0['bind']('isEnabled')['to'](this,'isBusy',_0x277fdd=>!_0x277fdd),_0x3ae9e0['on']('execute',()=>{this['fire']('tryAgain');}),_0x2eb3e8['bind']('isEnabled')['to'](this,'isBusy',_0x2aa101=>!_0x2aa101),_0x2eb3e8['on']('execute',()=>{this['fire']('showPrevious');}),_0x285249['bind']('isEnabled')['to'](this,'isBusy',_0x21f0c8=>!_0x21f0c8),_0x285249['on']('execute',()=>{this['fire']('showNext');}),this['_navigationPreviousButton']=_0x2eb3e8,this['_navigationCounter']=_0x1d9479,this['_navigationNextButton']=_0x285249,this['_navigationTryAgainButton']=_0x3ae9e0;}['updateMiniToolbarButtons'](_0x253ee7,_0x23cf9a){this['_navigationPreviousButton']||this['_setupMiniToolbarButtons']();const _0x4ae3a2=_0x253ee7>0x1;if(this['addMiniToolbarItem'](this['_navigationTryAgainButton']),_0x4ae3a2){this['addMiniToolbarItem'](this['_navigationPreviousButton']),this['addMiniToolbarItem'](this['_navigationCounter']),this['addMiniToolbarItem'](this['_navigationNextButton']);const _0x44f2ae=_0x253ee7-_0x23cf9a;this['_navigationCounter']['setInteractionCount'](_0x44f2ae+'/'+_0x253ee7),this['_navigationPreviousButton']['isEnabled']=_0x23cf9a<_0x253ee7-0x1,this['_navigationNextButton']['isEnabled']=_0x23cf9a>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'](_0x3ada09){this['_isLoading']=_0x3ada09;}['resetShowChangesButton'](){this['_miniToolbarView']['isShowChangesOn']=!0x1;}['_initializeScrollManager'](){const _0x4ee4a0=this['_getScrollableElement']();_0x4ee4a0&&!this['_scrollManager']&&(this['_scrollManager']=new sr(_0x4ee4a0));}['_getScrollableElement'](){return this['_streamableContentView']['element'];}}class Zo extends vt{constructor(_0xebf717){super(_0xebf717);const _0x47ebc2=this['bindTemplate'];this['set']('interactionCount','1/1'),this['setTemplate']({'tag':'span','attributes':{'class':['ck-ai-interaction-counter']},'children':[{'text':_0x47ebc2['to']('interactionCount')}]});}['setInteractionCount'](_0x3ac21e){this['set']('interactionCount',_0x3ac21e);}}class ta extends _0x18211b{static get['requires'](){return[as,Bt,Js,Oo,_0x58b094];}static get['pluginName'](){return'AIActions';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['_aiConnector'];['_interactions']=[];['_currentInteractionIndex']=0x0;['_interactionParams'];['_balloonShowDiff']=!0x1;['_promiseQueue'];['_bodyCollection'];get['_interaction'](){return this['_interactions'][this['_interactions']['length']-0x1];}['_actionsBalloonView'];constructor(_0x1ec628){super(_0x1ec628),this['_bodyCollection']=new Qt(this['editor']['locale']),this['_bodyCollection']['attachToDom'](),this['_aiConnector']=this['editor']['plugins']['get']('AIConnector'),this['set']('isBusy',!0x1),this['_promiseQueue']=new Cn();}['stopInteraction'](){this['_stopInteraction']();}async['executeAction'](_0x58de75,_0x1c8f18,_0x44df9a){if(this['_stopInteraction'](),this['editor']['plugins']['has']('TableSelection')){if(this['editor']['plugins']['get']('TableSelection')['getSelectedTableCells']()){const {modelFragment:_0x355155,anchorData:_0x3f0192,root:_0x127e91}=this['_getExecuteDataInTable']();return this['_executeAction'](_0x58de75,_0x355155,_0x3f0192,_0x127e91,_0x1c8f18,_0x44df9a);}}const {modelFragment:_0x5ca8ee,anchorData:_0x3d603c,root:_0x27d3cf}=this['_getExecuteDataRegular']();return this['_executeAction'](_0x58de75,_0x5ca8ee,_0x3d603c,_0x27d3cf,_0x1c8f18,_0x44df9a);}async['destroy'](){return this['_stopInteraction'](),this['_bodyCollection']['detachFromDom'](),super['destroy']();}['_createActionsBalloonView'](){const _0x39e529=this['editor']['plugins']['has']('TrackChanges');let _0x1d773d=this['editor']['config']['get']('ai.availableReplyActions')||[...fn];_0x39e529||(_0x1d773d=_0x1d773d['filter'](_0x1e6a03=>'insertSuggestion'!=_0x1e6a03));const _0xfceb4e=this['editor']['commands']['get']('trackChanges'),_0x2c63fb=new Jo(this['editor']['locale'],{'showApplyButton':!0x0,'showSuggestButton':_0x39e529,'miniToolbarConfig':{'showChanges':'icon'},'availableActions':_0x1d773d});return _0x2c63fb['bind']('isBusy')['to'](this),_0xfceb4e&&_0x2c63fb['bind']('isTrackChangesOn')['to'](_0xfceb4e,'value'),_0x2c63fb['on']('tryAgain',()=>{this['_refreshInteraction']();}),_0x2c63fb['on']('showPrevious',()=>{this['_navigateToPrevious']();}),_0x2c63fb['on']('showNext',()=>{this['_navigateToNext']();}),_0x2c63fb;}['_getExecuteDataRegular'](){const _0x1da12c=this['editor']['model']['document']['selection'],_0x5beb7c=_0x1da12c['getFirstRange']()['start']['root'];if(_0x1da12c['isCollapsed']){const _0x2d2c60=At(_0x1da12c['getSelectedBlocks']())||this['editor']['model']['schema']['getLimitElement'](_0x1da12c);this['editor']['model']['change'](_0x553df2=>{_0x553df2['setSelection'](_0x2d2c60,'in');});}const _0x52211d=_0x1da12c['getFirstRange'](),_0x2e85c9=this['_wrapWithCommonAncestors'](this['editor']['model']['getSelectedContent'](_0x1da12c),_0x52211d['start'],_0x52211d['end']);this['_copyMarkersToFragment'](_0x2e85c9,_0x1da12c,{'isTableSelection':!0x1});const _0x3eed8e=_0x1da12c['getFirstRange']()['start'],_0x18da6b=new Map();let _0x23c782=_0x2e85c9;for(let _0x3c833f=0x0;_0x3c833f<_0x3eed8e['path']['length'];_0x3c833f++)_0x18da6b['set'](_0x23c782,_0x3eed8e['path'][_0x3c833f]),_0x23c782=_0x23c782['getChild'](0x0);return{'modelFragment':_0x2e85c9,'anchorData':_0x18da6b,'root':_0x5beb7c};}['_getExecuteDataInTable'](){const _0x51a4a0=this['editor']['model']['document']['selection'],_0x3cc9dd=this['editor']['plugins']['get']('TableSelection'),_0x45c315=_0x51a4a0['getFirstRange']()['start']['root'],_0x5d20b2=_0x3cc9dd['getSelectionAsFragment'](),_0x37325e=_0x51a4a0['getFirstRange']()['start']['parent']['parent'],_0x10efea=this['editor']['model']['createRange'](this['editor']['model']['createPositionBefore'](_0x37325e),this['editor']['model']['createPositionAfter'](_0x37325e)),_0x5b1d50=this['_wrapWithCommonAncestors'](_0x5d20b2,_0x10efea['start'],_0x10efea['end']);this['_copyMarkersToFragment'](_0x5b1d50,_0x51a4a0,{'isTableSelection':!0x0});const _0x49168a=_0x51a4a0['getFirstRange']()['start'],_0x45039a=new Map();let _0x232c53=_0x5b1d50;for(let _0x253d2f=0x0;_0x253d2f<_0x49168a['path']['length'];_0x253d2f++)if(_0x45039a['set'](_0x232c53,_0x49168a['path'][_0x253d2f]),_0x253d2f<_0x49168a['path']['length']-0x1)_0x232c53=_0x232c53['getChild'](0x0);else{let _0x25a76a=_0x232c53['nextSibling'];for(;_0x25a76a;)_0x45039a['set'](_0x25a76a,_0x49168a['path'][_0x253d2f]),_0x25a76a=_0x25a76a['nextSibling'];}return{'modelFragment':_0x5b1d50,'anchorData':_0x45039a,'root':_0x45c315};}async['_executeAction'](_0x146c65,_0x1366d1,_0x5615d9,_0x3e8628,_0x5de815,_0x53b853){const _0xcdaed=this['editor']['plugins']['get'](Js),_0x30f544=this['editor']['plugins']['get'](Oo),_0x912899=this['editor']['model']['document']['selection'],_0x12f6a9=await _0xcdaed['modelToDataWithIds'](_0x1366d1),_0x4ab530=this['editor']['model']['document']['version'],_0x1ef4d7=[..._0x912899['getRanges']()];return this['_actionsBalloonView']||(this['_actionsBalloonView']=this['_createActionsBalloonView']()),this['_clearInteractionHistory'](),this['_clearErrorState'](),this['_balloonShowDiff']=!0x1,this['_actionsBalloonView']['resetShowChangesButton'](),this['_actionsBalloonView']['clearContent'](),_0x30f544['open']({'index':0x3e8*Math['random']()%0x3e8,'title':_0x5de815,'icon':_0x53b853||_0x3f90e7,'mainView':this['_actionsBalloonView'],'class':'ck-ai-actions-balloon','ranges':_0x1ef4d7,'id':'aiActionsBalloon'}),this['_setLoadingState'](),this['stopListening'](this['_actionsBalloonView']),this['stopListening'](_0x30f544),this['_interactionParams']={'action':_0x146c65,'content':_0x12f6a9,'version':_0x4ab530,'aiBalloon':_0x30f544,'modelFragment':_0x1366d1,'anchorData':_0x5615d9,'root':_0x3e8628},this['_setupApplyListeners'](),this['listenTo'](_0x30f544,'selectionRemoved',()=>{this['_stopInteraction'](),this['_actionsBalloonView']['disableMiniToolbarButtons']();}),this['listenTo'](_0x30f544,'dialogClosed',(_0xf8731,{id:_0x58dc39})=>{if('aiActionsBalloon'===_0x58dc39){for(const _0xfa0011 of this['_interactions']){if(0x0===_0xfa0011['replies']['length']||_0xfa0011['stoppedExplicitly'])continue;const _0x5b8c24=_0xfa0011['replies'][_0xfa0011['replies']['length']-0x1],_0x35cb49=_0x5b8c24['changeGroups'][0x0];_0x35cb49&&'pending'===_0x35cb49['state']&&_0x5b8c24['setChangeGroupState'](0x0,'rejected');}this['_stopInteraction'](),this['_clearInteractionHistory'](),this['stopListening'](this['_actionsBalloonView']),this['stopListening'](_0x30f544);}}),this['_createInteraction'](_0x12f6a9,_0x4ab530,_0x30f544,_0x146c65);}['_setupApplyListeners'](){if(!this['_interactionParams'])return;const {modelFragment:_0x2315f0,anchorData:_0x3f36a0,root:_0x44a3b8}=this['_interactionParams'];this['listenTo'](this['_actionsBalloonView'],'applySuggestion',()=>{this['_applyChanges'](_0x2315f0,_0x3f36a0,_0x44a3b8,!0x1);}),this['listenTo'](this['_actionsBalloonView'],'insertSuggestion',()=>{this['_applyChanges'](_0x2315f0,_0x3f36a0,_0x44a3b8,!0x0);});}['_wrapWithCommonAncestors'](_0x290984,_0x19a51f,_0x5b4092){const _0x41f5d1=this['editor']['model']['createRange'](_0x19a51f,_0x5b4092)['getCommonAncestor'](),_0x5ba018=_0x41f5d1['is']('documentFragment')?[]:_0x41f5d1['getAncestors']({'includeSelf':!0x0})['slice'](0x1);if(_0x5ba018['length']){const _0x482113=_0x5ba018['map'](_0x19e006=>_0x19e006['_clone'](!0x1));for(let _0x202f87=0x1;_0x202f87<_0x482113['length'];_0x202f87++)_0x482113[_0x202f87-0x1]['_appendChild'](_0x482113[_0x202f87]);return _0x482113[_0x482113['length']-0x1]['_appendChild'](_0x290984),new _0x49b7d4(_0x482113[0x0]);}return _0x290984;}['_copyMarkersToFragment'](_0x3636b3,_0x45952f,_0xd5b20a={'isTableSelection':!0x1}){const _0x3e8d15=this['editor']['model'],_0x42d23d=Array['from'](_0x45952f['getRanges']()),_0x25f4e6=_0x45952f['getFirstRange']()['start'];for(const _0x135fb9 of _0x3e8d15['markers']){if(_0x135fb9['name']['startsWith'](zs)||!_0x135fb9['affectsData'])continue;const _0xc2da2b=_0x135fb9['getRange']();if(!_0x42d23d['some'](_0x38c01c=>_0x38c01c['containsRange'](_0xc2da2b,!0x0)))continue;const _0x3b005f=this['_regularCalculateMarkerPath'](_0xc2da2b['start'],_0x25f4e6,_0xd5b20a['isTableSelection']),_0x3199b6=this['_regularCalculateMarkerPath'](_0xc2da2b['end'],_0x25f4e6,_0xd5b20a['isTableSelection']),_0x1f50aa=_0x3e8d15['createPositionFromPath'](_0x3636b3,_0x3b005f),_0x31240a=_0x3e8d15['createPositionFromPath'](_0x3636b3,_0x3199b6);if(!_0x1f50aa['isEqual'](_0x31240a)){const _0x392088=_0x3e8d15['createRange'](_0x1f50aa,_0x31240a);_0x3636b3['markers']['set'](_0x135fb9['name'],_0x392088);}}}['_regularCalculateMarkerPath'](_0x4d0fd0,_0xe00d69,_0x50dc42=!0x1){const _0x5e4c3f=[..._0x4d0fd0['path']['slice']()];for(let _0x2610c2=0x0;_0x2610c2<Math['max'](_0xe00d69['path']['length'],_0x4d0fd0['path']['length']);_0x2610c2++){const _0x2dd4e6=_0xe00d69['path'][_0x2610c2]||0x0,_0x2a68b4=(_0x4d0fd0['path'][_0x2610c2]||0x0)-_0x2dd4e6;if(_0x5e4c3f[_0x2610c2]=_0x2a68b4,0x0!==_0x2a68b4&&!_0x50dc42)break;}return _0x5e4c3f;}async['_createInteraction'](_0x1739fb,_0x49d41b,_0xe84eee,_0x54eb90){const _0x2a0bbb=this['editor'];this['_interactionParams']||(this['_interactionParams']={'action':_0x54eb90,'content':_0x1739fb,'version':_0x49d41b,'aiBalloon':_0xe84eee,'modelFragment':this['editor']['model']['getSelectedContent'](this['editor']['model']['document']['selection']),'anchorData':new Map(),'root':this['editor']['model']['document']['selection']['getFirstRange']()['start']['root']});const _0x13427b=new Qo({'connector':this['_aiConnector'],'locale':_0x2a0bbb['locale'],'content':_0x1739fb,'version':_0x49d41b,..._0x54eb90});this['_interactions']['push'](_0x13427b);const _0xc8a18c=(_0x1f1212,_0x358d41=!0x1,_0x142f33='streaming')=>this['_promiseQueue']['enqueue'](async _0x1604c3=>{try{const _0x45af8d=Rs({'editor':_0x2a0bbb,'changeGroups':_0x1f1212['changeGroups'],'documentContextContent':_0x1f1212['documentContextContent'],'showDiff':_0x358d41,'trimUnchanged':!0x1});_0x45af8d['length']&&await this['_actionsBalloonView']['updateContent']({'part':_0x45af8d[0x0],'renderingStrategy':_0x142f33,'abortSignal':_0x1604c3});}catch(_0x479cc4){if(this['_isAbortError'](_0x479cc4))return;throw _0x479cc4;}});_0x13427b['on']('replyCreated',(_0x4efa76,_0x2c2595)=>{this['_actionsBalloonView']['hideLoader'](),this['_actionsBalloonView']['startAutoScroll'](),_0xc8a18c(_0x2c2595)['catch'](_0x42cf8f=>{this['_isAbortError'](_0x42cf8f)||(console['error']('Error\x20updating\x20content\x20in\x20replyCreated:',_0x42cf8f),this['_setErrorState'](_0x13427b));});}),_0x13427b['on']('replyContentUpdated',(_0x417957,_0x7dcec2)=>{_0xc8a18c(_0x7dcec2)['catch'](_0x57db6a=>{this['_isAbortError'](_0x57db6a)||(console['error']('Error\x20updating\x20content\x20in\x20replyContentUpdated:',_0x57db6a),this['_setErrorState'](_0x13427b));});}),_0x13427b['on']('interactionFinished',async()=>{try{await this['_clearLoadingState'](),this['_actionsBalloonView']['updateMiniToolbarButtons'](this['_interactions']['length'],this['_currentInteractionIndex']),await this['_promiseQueue']['queueEmptyPromise'];}catch(_0x3e1cf9){this['_isAbortError'](_0x3e1cf9)||(console['error']('Error\x20clearing\x20loading\x20state\x20in\x20interactionFinished:',_0x3e1cf9),this['_setErrorState'](_0x13427b));}finally{this['_actionsBalloonView']['stopAutoScroll']();}}),this['listenTo'](this['_actionsBalloonView'],'toggleSuggestionDisplayMode',async(_0x550486,{showDiff:_0x48bf1c})=>{try{this['_balloonShowDiff']=_0x48bf1c;const _0x3a9d34=this['_interaction']['replies'][this['_interaction']['replies']['length']-0x1];_0x3a9d34&&await _0xc8a18c(_0x3a9d34,_0x48bf1c,'static');}catch(_0x1b6630){this['_isAbortError'](_0x1b6630)||(console['error']('Error\x20updating\x20content\x20in\x20toggleSuggestionDisplayMode:',_0x1b6630),this['_setErrorState'](_0x13427b));}}),_0x13427b['on']('replyChangeGroupStateUpdated',()=>{const _0x3e7105={'positiveCount':_0x13427b['replies']['reduce']((_0x27307f,_0x226742)=>_0x27307f+_0x226742['changeGroups']['filter'](_0xea8640=>'accepted'===_0xea8640['state'])['length'],0x0),'totalCount':_0x13427b['replies']['reduce']((_0x3313eb,_0x4c91e5)=>_0x3313eb+_0x4c91e5['changeGroups']['length'],0x0)},_0x21e3e8=_0x13427b['actionCallId'],_0x4d8522=_0x13427b['actionName'];_0x4d8522?this['_aiConnector']['upsertAIActionRating'](_0x4d8522,_0x21e3e8,_0x3e7105):this['_aiConnector']['upsertCustomAIActionRating'](_0x21e3e8,_0x3e7105);}),this['_setLoadingState']();try{const _0x9f5a17=await _0x13427b['start']();return this['_actionsBalloonView']['updateMiniToolbarButtons'](this['_interactions']['length'],this['_currentInteractionIndex']),_0x9f5a17;}catch(_0x1a3cd4){if(this['_isAbortError'](_0x1a3cd4))return;this['_actionsBalloonView']['hideLoader'](),this['_setErrorState'](_0x13427b);}}['_applyChanges'](_0x177a75,_0x49b134,_0x32ed30,_0x38e6cb){const _0x4c1820=this['editor'];if(_0x38e6cb&&!_0x4c1820['plugins']['has']('TrackChanges'))throw new at('ai-no-track-changes',null);const _0xf3a120=this['editor']['plugins']['get'](_0x58b094),_0x498e2a=this['_interactions'][this['_interactions']['length']-0x1-this['_currentInteractionIndex']];if(!_0x498e2a||!_0x498e2a['replies']['length'])return;const _0x43b049=_0x498e2a['replies'][_0x498e2a['replies']['length']-0x1],_0x104210=_0x43b049['changeGroups'];_0x43b049['setChangeGroupState'](0x0,'accepted');let _0x3701e7=qs({'editor':_0x4c1820,'reply':_0x43b049,'interaction':_0x498e2a,'groups':_0x104210,'transform':!0x1,'documentCompare':_0xf3a120,'documentCompareOptions':{'anchor':_0x4c1820['model']['createPositionAt'](_0x177a75,0x0),'markDeletions':_0x38e6cb}});_0x3701e7=this['_filterOperationsOutsideRange'](_0x3701e7,_0x49b134);for(const _0x527408 of _0x3701e7)this['_anchorOperation'](_0x49b134,_0x527408,_0x32ed30);const _0x3feb2b=_0x498e2a['getDocumentContext']()['version'],_0x231243=_0x4c1820['model']['document']['history']['getOperations'](_0x3feb2b),_0x50ca6e={'document':_0x4c1820['model']['document'],'useRelations':!0x1,'padWithNoOps':!0x1},_0x115d9d=_0x1b61b0(_0x3701e7,_0x231243,_0x50ca6e)['operationsA'];_0x4c1820['model']['change'](_0x287ad1=>{if(_0x287ad1['setSelection'](_0x4c1820['model']['document']['selection']['focus']),_0x38e6cb)_0x4c1820['plugins']['get']('TrackChangesEditing')['_applyOperationsAsSuggestions'](_0x115d9d);else{for(const _0x540fa6 of _0x115d9d)_0x540fa6['baseVersion']=_0x4c1820['model']['document']['version'],Qs(_0x4c1820,_0x540fa6),_0x287ad1['batch']['addOperation'](_0x540fa6),_0x4c1820['model']['applyOperation'](_0x540fa6);}}),this['editor']['plugins']['get']('AIBalloon')['close']();}['_filterOperationsOutsideRange'](_0x3563bd,_0xcee2c5){return _0x3563bd['filter'](_0x331f1e=>{if('rename'==_0x331f1e['type']){const _0x3003bb=_0x331f1e['position']['nodeAfter'];return!_0xcee2c5['has'](_0x3003bb);}if(_0x331f1e['type']['indexOf']('Attribute')>-0x1){const _0x220202=_0x331f1e['range']['start']['nodeAfter'];return!_0xcee2c5['has'](_0x220202);}return!0x0;});}['_anchorOperation'](_0x2238fd,_0x91bb50,_0x449d80){const _0xc70c17=_0x91bb50['clone']();for(const _0xbb28f8 in _0x91bb50){const _0x30c2e5=_0x91bb50[_0xbb28f8];_0x30c2e5 instanceof _0x28623e?_0x91bb50[_0xbb28f8]=new _0x28623e(_0x285084(_0x30c2e5['start']),_0x285084(_0x30c2e5['end'])):_0x30c2e5 instanceof _0x1133b3&&(_0x91bb50[_0xbb28f8]=_0x285084(_0x30c2e5));}if(['insert','move','remove','reinsert','split','merge']['includes'](_0xc70c17['type'])){if(_0xc70c17['isDocumentOperation']=!0x1,_0xc70c17['baseVersion']=null,'remove'==_0xc70c17['type']){const _0x8573fe=_0xc70c17['sourcePosition'],_0x20f430=_0xc70c17['howMany'];new _0x25589e(_0x8573fe,_0x20f430)['_execute']();}else _0xc70c17['_execute']();}function _0x285084(_0x2c91a0){if('$graveyard'==_0x2c91a0['root']['rootName'])return _0x2c91a0;const _0x12debd=[];let _0x4bb977=_0x2c91a0['root'];for(let _0x521949=0x0;_0x521949<_0x2c91a0['path']['length'];_0x521949++){const _0x500838=_0x2238fd['get'](_0x4bb977)||0x0;_0x12debd[_0x521949]=_0x2c91a0['path'][_0x521949]+_0x500838,_0x4bb977=_0x4bb977['getChildAtOffset'](_0x2c91a0['path'][_0x521949]);}return new _0x1133b3(_0x449d80,_0x12debd,_0x2c91a0['stickiness']);}}['_refreshInteraction'](){if(!this['_interactionParams'])return;this['_interactions']['length']>0x0&&this['_stopInteraction'](),this['_currentInteractionIndex']=0x0,this['_balloonShowDiff']=!0x1;const {action:_0x346116,content:_0x16ef9f,version:_0x12e7c0,aiBalloon:_0x2c4dd}=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'](_0x16ef9f,_0x12e7c0,_0x2c4dd,_0x346116)['catch'](_0x453e5b=>{this['_isAbortError'](_0x453e5b)||console['error']('Error\x20refreshing\x20interaction:',_0x453e5b);});}['_isAbortError'](_0x36b0f4){return!!_0x36b0f4['message']&&_0x36b0f4['message']['startsWith']('ai-request-aborted');}['_clearInteractionHistory'](){this['_interactions']=[],this['_interactionParams']=void 0x0,this['_currentInteractionIndex']=0x0,this['_actionsBalloonView']['updateMiniToolbarButtons'](this['_interactions']['length'],this['_currentInteractionIndex']);}['_stopInteraction'](){this['_interaction']&&this['_interaction']['stop'](),this['_promiseQueue']['abort'](),this['isBusy']=!0x1,this['_interactionParams']&&this['_actionsBalloonView']['stopAutoScroll']();}['_navigateToPrevious'](){const _0x274b9c=this['_interactions']['length'];this['_currentInteractionIndex']<_0x274b9c-0x1&&this['_displayInteractionAtIndex'](this['_currentInteractionIndex']+0x1);}['_navigateToNext'](){this['_currentInteractionIndex']>0x0&&this['_displayInteractionAtIndex'](this['_currentInteractionIndex']-0x1);}async['_displayInteractionAtIndex'](_0x48cd66){if(!this['_interactionParams'])return;this['_currentInteractionIndex']=_0x48cd66;const _0x3fbba6=this['_interactions'][this['_interactions']['length']-0x1-this['_currentInteractionIndex']];if(!_0x3fbba6)return;if(_0x3fbba6['hasError'])return this['_setErrorState'](_0x3fbba6),void this['_actionsBalloonView']['updateMiniToolbarButtons'](this['_interactions']['length'],this['_currentInteractionIndex']);if(!_0x3fbba6['replies']['length'])return;this['_actionsBalloonView']['hideError'](),this['_interactionParams']&&this['_clearErrorState']();const _0x4d178f=_0x3fbba6['replies'][_0x3fbba6['replies']['length']-0x1];if(_0x4d178f){const _0x200d4a=this['editor'];try{const _0x1d4fe8=Rs({'editor':_0x200d4a,'changeGroups':_0x4d178f['changeGroups'],'documentContextContent':_0x4d178f['documentContextContent'],'showDiff':this['_balloonShowDiff'],'trimUnchanged':!0x1});await new Promise(_0x2c2f42=>setTimeout(_0x2c2f42,0x32)),await this['_actionsBalloonView']['updateContent']({'part':_0x1d4fe8[0x0],'renderingStrategy':'static','abortSignal':new AbortController()['signal']});}catch(_0x3e4588){this['_isAbortError'](_0x3e4588)||console['error']('Error\x20updating\x20content\x20during\x20navigation:',_0x3e4588);}}this['_actionsBalloonView']['updateMiniToolbarButtons'](this['_interactions']['length'],this['_currentInteractionIndex']);}['_setLoadingState'](){this['_actionsBalloonView']['setIsLoading'](!0x0),this['isBusy']=!0x0;}async['_setErrorState'](_0x2fb01a){const _0x499845=hs(this['editor']['locale'],'AI_ACTIONS_GENERIC_ERROR');this['_actionsBalloonView']['showError'](_0x499845),_0x2fb01a['hasError']=!0x0,await this['_promiseQueue']['queueEmptyPromise'],this['_actionsBalloonView']['setErrorState'](),this['_actionsBalloonView']['toggleIsLoading'](!0x0);}['_clearErrorState'](){this['_actionsBalloonView']['hideError'](),this['_actionsBalloonView']['toggleIsLoading'](!0x1);}async['_clearLoadingState'](){await this['_promiseQueue']['queueEmptyPromise'],this['isBusy']=!0x1,this['_actionsBalloonView']['setIsLoading'](!0x1);}}class ea extends _0x18211b{static get['requires'](){return[Wo,$o,ta];}static get['pluginName'](){return'AIQuickActions';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x352654){super(_0x352654),_0x352654['config']['define']('ai.quickActions',{'extraCommands':[],'removeCommands':[],'isSearchEnabled':!0x0});}}class ia extends vt{['resultResponseView'];['acceptButtonView'];['dismissButtonView'];['infoButtonView'];['outdatedButtonView'];constructor(_0x560ae0,_0x1986fa){super(_0x560ae0),this['id']=_0x1986fa,this['set']('status','pending'),this['set']('changeId',_0x1986fa),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',(_0x3b35b7,_0x9cfa78)=>{_0x9cfa78&&_0x9cfa78['target']&&'A'===_0x9cfa78['target']['tagName']&&_0x9cfa78['preventDefault'](),this['fire']('activateChange',{'id':_0x1986fa,'source':this,'uiInteraction':'click'});}),this['on']('mouseover',()=>{this['fire']('activateChange',{'id':_0x1986fa,'source':this,'uiInteraction':'hover'});}),this['on']('mouseout',()=>{this['fire']('deactivateChange',{'origin':'panel','id':_0x1986fa,'source':this});});}['setItemAsActive'](){this['isActive']=!0x0;}['setItemAsInactive'](){this['isActive']=!0x1;}['_createResultResponseView'](){const _0x4c88b2=new vt(this['locale']);return _0x4c88b2['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',_0x3cc4ff=>!_0x3cc4ff)]}}),_0x4c88b2;}['_createAcceptButtonView'](){const _0x2f25a8=new Nt(this['locale']);return _0x2f25a8['set']({'label':hs(this['locale'],'AI_REVIEW_MODE_ACCEPT_CHANGE'),'withText':!0x0}),_0x2f25a8['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x188812=>{this['fire']('acceptChange',{'id':this['changeId']}),_0x188812['stopPropagation']();})},'attributes':{'class':[this['bindTemplate']['if']('status','ck-hidden',_0x416b1f=>'pending'!==_0x416b1f&&'accepted'!==_0x416b1f),this['bindTemplate']['if']('status',ls,_0x1ac34f=>'pending'===_0x1ac34f),this['bindTemplate']['if']('status',us,_0x1fe332=>'pending'!==_0x1fe332),this['bindTemplate']['if']('status','ck-ai_review__check-run-result-status-button',_0x56b605=>'accepted'===_0x56b605)]}}),this['on']('change:status',(_0x2b83c5,_0x1aa3ea,_0x529a6c)=>{_0x2f25a8['isEnabled']='pending'===_0x529a6c,'accepted'===_0x529a6c&&(_0x2f25a8['label']=hs(this['locale'],'AI_REVIEW_MODE_CHECK_STATUS_ACCEPTED'),_0x2f25a8['icon']=_0x2204df);}),_0x2f25a8;}['_createDismissButtonView'](){const _0xc0f3ca=new Nt(this['locale']);return _0xc0f3ca['set']({'label':hs(this['locale'],'AI_REVIEW_MODE_DISMISS_CHANGE'),'withText':!0x0}),_0xc0f3ca['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x58361f=>{this['fire']('dismissChange',{'id':this['changeId']}),_0x58361f['stopPropagation']();})},'attributes':{'class':[us,this['bindTemplate']['if']('status','ck-hidden',_0x28dbc8=>'pending'!==_0x28dbc8&&'rejected'!==_0x28dbc8),this['bindTemplate']['if']('status','ck-ai_review__check-run-result-dismiss-button',_0x3e8a25=>'pending'===_0x3e8a25),this['bindTemplate']['if']('status','ck-ai_review__check-run-result-status-button',_0x163e6b=>'rejected'===_0x163e6b)]}}),this['on']('change:status',(_0x58eb37,_0x542384,_0x466ee5)=>{_0xc0f3ca['isEnabled']='pending'===_0x466ee5,'rejected'===_0x466ee5&&(_0xc0f3ca['label']=hs(this['locale'],'AI_REVIEW_MODE_CHECK_STATUS_REJECTED'),_0xc0f3ca['icon']=_0x104621);}),_0xc0f3ca;}['_createInfoButtonView'](){const _0x16a91a=new Nt(this['locale']);return _0x16a91a['set']({'label':hs(this['locale'],'AI_REVIEW_MODE_LEARN_MORE'),'icon':_0x2f4ba7,'tooltip':!0x0,'isToggleable':!0x0,'role':'menuitemcheckbox','class':us+'\x20ck-ai_review__check-run-result-info-button\x20ck-hidden'}),_0x16a91a['bind']('isOn')['to'](this,'isInfoToggleOn',_0x415624=>_0x415624),_0x16a91a['on']('execute',()=>{this['isInfoToggleOn']=!this['isInfoToggleOn'];}),_0x16a91a;}['_createOutdatedButtonView'](){const _0x1c1b36=new Nt(this['locale']);return _0x1c1b36['set']({'label':hs(this['locale'],'AI_REVIEW_MODE_CHECK_STATUS_OUTDATED'),'icon':it,'withText':!0x0,'isEnabled':!0x1}),_0x1c1b36['extendTemplate']({'attributes':{'class':[us,'ck-ai_review__check-run-result-status-button',this['bindTemplate']['if']('status','ck-hidden',_0x44a040=>'outdated'!==_0x44a040)],'disabled':'disabled'}}),_0x1c1b36;}}class sa extends Xt{['resultItemView'];['_pinnedRectIndex']=void 0x0;['_pinnedTargetElement']=void 0x0;['_pinnedTargetChangeId']=void 0x0;constructor(_0x3e75ac,_0x2906cd){super(_0x3e75ac),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']()),_0x2906cd['add'](this);}['render'](){super['render'](),this['_setupClickOutsideHandler']();}['updateContent'](_0x57e751){this['resultItemView']['changeId']=_0x57e751['id'],this['resultItemView']['resultResponseView']['element']['innerHTML']=_0x57e751['contentDiffed'];}['showBalloon'](_0x4aeb40,_0x5c61ed,_0x427a1e,_0x4f07f4,_0x52e2db,_0x33ce5c){const _0x3832e2=_0x5c61ed();if(!_0x3832e2)return;this['updateContent'](_0x4aeb40),this['show']();const _0x186cfb=Array['from'](_0x3832e2['getClientRects']())['reverse'](),_0x243cf7=this['_getPointedRectIndexFromEvent'](_0x427a1e,_0x186cfb),_0x36d730=_0x186cfb[_0x243cf7??0x0];'click'===_0x4f07f4?(this['isDiffActive']=!0x0,this['pin']({'target':()=>this['_getBestRectPositionOnClick'](_0x5c61ed(),_0x243cf7,_0x4aeb40['id'],_0x52e2db,_0x33ce5c)||_0x36d730})):'hover'===_0x4f07f4&&(this['isDiffActive']=!0x1,this['pin']({'target':()=>this['_getBestRectPositionOnHover'](_0x5c61ed(),_0x243cf7,_0x4aeb40['id'])||_0x36d730}));}['hideBalloon'](){this['hide'](),this['unpin'](),this['_pinnedRectIndex']=void 0x0,this['_pinnedTargetElement']=void 0x0,this['_pinnedTargetChangeId']=void 0x0;}['hideDiffInBalloon'](){this['resultItemView']['showDiff']=!0x1;}['showDiffInBalloon'](){this['resultItemView']['showDiff']=!0x0;}['deactivateChange'](){this['fire']('deactivateChange',{'origin':'balloon'});}['_setupClickOutsideHandler'](){zt({'emitter':this,'activator':()=>this['isVisible'],'contextElements':()=>{const _0x590885=[this['element']];return this['_pinnedTargetElement']&&_0x590885['push'](this['_pinnedTargetElement']),_0x590885;},'callback':()=>{this['hide'](),this['unpin'](),this['deactivateChange'](),this['_pinnedTargetElement']=void 0x0,this['_pinnedRectIndex']=void 0x0,this['_pinnedTargetChangeId']=void 0x0;}});}['_createContentView'](){const _0x40039c=new vt();return this['resultItemView']=new ia(this['locale'],''),this['resultItemView']['resultResponseView']['extendTemplate']({'attributes':{'class':['ck-content']}}),this['resultItemView']['delegate']('acceptChange','dismissChange')['to'](this),_0x40039c['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']]}]}),_0x40039c;}['_getBestRectPositionOnClick'](_0xad0838,_0xa47b17,_0x170bd3,_0x5d2b1b,_0x779c7){if(!_0xad0838)return null;const _0x227401=this['position']['replace']('arrow_',''),_0x5dc9e8=Array['from'](_0xad0838['getClientRects']());let _0x184a84,_0x4846cb=_0x5dc9e8['reverse']();return void 0x0!==_0xa47b17&&this['_isPinnedRectVisible'](_0x4846cb[_0xa47b17],_0x5d2b1b,_0x779c7)?(_0x184a84=_0x4846cb[_0xa47b17],this['_pinnedRectIndex']=_0xa47b17):this['_isPinnedRectVisible'](_0x4846cb[0x0],_0x5d2b1b,_0x779c7)&&void 0x0===_0xa47b17?_0x184a84=_0x4846cb[0x0]:(_0x4846cb='s'==_0x227401[0x0]?[..._0x5dc9e8]['reverse']():_0x5dc9e8,_0x4846cb['forEach'](_0x50adba=>{this['_isPinnedRectVisible'](_0x50adba,_0x5d2b1b,_0x779c7)&&(_0x184a84=_0x50adba);})),this['_pinnedTargetChangeId']=_0x170bd3,this['_pinnedTargetElement']=_0xad0838,_0x184a84||_0xad0838['getBoundingClientRect']();}['_getBestRectPositionOnHover'](_0x3b8ae4,_0x5af147,_0x7b2533){if(!_0x3b8ae4)return null;const _0x359cdb=Array['from'](_0x3b8ae4['getClientRects']())['reverse']();if(void 0x0===this['_pinnedRectIndex']&&void 0x0!==_0x5af147&&this['_pinnedTargetChangeId']!==_0x7b2533)return this['_pinnedRectIndex']=_0x5af147,this['_pinnedTargetElement']=_0x3b8ae4,this['_pinnedTargetChangeId']=_0x7b2533,_0x359cdb[_0x5af147];if(void 0x0!==this['_pinnedRectIndex']&&this['_pinnedTargetChangeId']===_0x7b2533){if(_0x3b8ae4!==this['_pinnedTargetElement'])return Array['from'](this['_pinnedTargetElement']['getClientRects']())['reverse']()[this['_pinnedRectIndex']];return _0x359cdb[this['_pinnedRectIndex']];}return void 0x0!==_0x5af147&&this['_pinnedTargetChangeId']!==_0x7b2533?(this['_pinnedRectIndex']=_0x5af147,this['_pinnedTargetElement']=_0x3b8ae4,this['_pinnedTargetChangeId']=_0x7b2533,_0x359cdb[_0x5af147]):_0x3b8ae4['getBoundingClientRect']();}['_getPointedRectIndexFromEvent'](_0x5aea23,_0x4df2fe){if(_0x5aea23)for(let _0x4766ed=0x0;_0x4766ed<_0x4df2fe['length'];_0x4766ed++){const _0x1e1661=_0x4df2fe[_0x4766ed];if(_0x5aea23['clientX']>=_0x1e1661['left']-0x3&&_0x5aea23['clientX']<=_0x1e1661['right']+0x3&&_0x5aea23['clientY']>=_0x1e1661['top']-0x3&&_0x5aea23['clientY']<=_0x1e1661['bottom']+0x3)return _0x4766ed;}}['_isPinnedRectVisible'](_0x182e61,_0x3cb545,_0x102cec){const _0x177c3a=new ut(_0x182e61),_0x2a2980=_0x3cb545||document['documentElement'],_0x335059=_0x177c3a['getIntersection'](Rt(_0x102cec)),_0x21be29=new ut(_0x2a2980)['getIntersection'](_0x177c3a);return!!(_0x335059&&_0x21be29&&_0x177c3a['width']>0x0);}}const na=['getReviewCheckList','runReviewCheck','abortReviewStream','toggleDiff','acceptAllChanges','leaveReviewCoreResultList','activateChange','deactivateChange','acceptChange','dismissChange','learnMore','finishReview','retryReview'];class ra extends _0x203d97{['_mainView'];['_balloonSuggestionView'];['_bodyCollection'];static get['requires'](){return[os];}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x1e2810){super(_0x1e2810),this['_bodyCollection']=new Qt(this['context']['locale']),this['_bodyCollection']['attachToDom'](),this['_mainView']=this['createMainView'](),this['_mainView']['delegate'](...na)['to'](this),this['_balloonSuggestionView']=new sa(this['context']['locale'],this['_bodyCollection']),this['_balloonSuggestionView']['delegate']('acceptChange','dismissChange','deactivateChange')['to'](this);}['init'](){const _0xb1a177=this['context']['plugins']['get']('AITabs');this['registerTab'](_0xb1a177);}['destroy'](){this['_bodyCollection']['detachFromDom'](),super['destroy']();}['setAvailableChecks'](_0x9c0464){if(!this['_mainView']['reviewCheckListView']['hasChecks']()){const _0x5dde5=!this['context']['config']['get']('ai.models.showModelSelector');this['_mainView']['reviewCheckListView']['setChecks'](_0x9c0464,_0x5dde5);}this['_mainView']['showReviewCheckListView']();}['showReviewCheckList'](){this['fire']('getReviewCheckList');}['showCheckRunResults'](_0x1bd967){_0x1bd967&&('error-general'!==_0x1bd967['status']?'error-chunk'!==_0x1bd967['status']?this['_mainView']['showReviewCheckResultsView']():this['showChunkErrorView']():this['showGeneralResultsErrorView']());}['showCheckRunResult'](_0x4ae9fc){this['_mainView']['addCheckRunResult'](_0x4ae9fc);}['showGeneralResultsErrorView'](){this['_mainView']['showGeneralResultsErrorView']();}['showGeneralReviewCoreErrorView'](_0x39b135){this['_mainView']['showGeneralReviewCoreErrorView'](_0x39b135??hs(this['context']['locale'],'AI_REVIEW_INITIALIZATION_ERROR_MESSAGE'));}['showChunkErrorView'](){this['_mainView']['showChunkErrorView']();}['setCheckResultTitle'](_0x326512,_0x4fd3b4){this['_mainView']['reviewCheckResultsView']['setTitle'](_0x326512,_0x4fd3b4);}['setActiveStateInResults'](_0x4173c6){this['_mainView']['reviewCheckResultsView']['getResults']()['forEach'](_0x46807c=>{_0x46807c['id']===_0x4173c6&&_0x46807c['setItemAsActive']();});}['resetActiveStateInResults'](){this['_mainView']['reviewCheckResultsView']['getResults']()['forEach'](_0x41546a=>_0x41546a['setItemAsInactive']());}['updateChangeState'](_0x33acc1,_0x21eeff){'accepted'===_0x21eeff||'rejected'===_0x21eeff||'outdated'===_0x21eeff?this['_mainView']['reviewCheckResultsView']['hideResult'](_0x33acc1,_0x21eeff):this['_mainView']['reviewCheckResultsView']['showResult'](_0x33acc1,_0x21eeff);}['showReviewCompletedView'](){this['_mainView']['showReviewCompletedView']();}['showActionsWhenResultIsReady'](){this['_mainView']['showActionsWhenResultIsReady']();}['showNoChangesView'](){this['_mainView']['showNoChangesView']();}['hideActionsWhenResultIsReady'](){this['_mainView']['hideActionsWhenResultIsReady']();}['showChangeBalloon'](_0x2d1fde,_0x22a4c4,_0x5661a0,_0x5c13f2,_0x21ecbb,_0x5ac205){this['_balloonSuggestionView']['showBalloon'](_0x2d1fde,_0x22a4c4,_0x5661a0,_0x5c13f2,_0x21ecbb,_0x5ac205);}['hideChangeBalloon'](){this['_balloonSuggestionView']['hideBalloon']();}['hideDiffInBalloon'](){this['_balloonSuggestionView']['hideDiffInBalloon']();}['showDiffInBalloon'](){this['_balloonSuggestionView']['showDiffInBalloon']();}['getChangeElement'](_0x23a585){const _0x4ba495=this['_mainView']['reviewCheckResultsView']['getResults']()['find'](_0x31c3e5=>_0x31c3e5['id']===_0x23a585);return _0x4ba495?_0x4ba495['element']:null;}['deactivateChange'](){this['_balloonSuggestionView']['deactivateChange']();}}class oa extends vt{constructor(_0x4187f3){super(_0x4187f3),this['set']('isVisible',!0x1),this['set']('errorMessage','');const _0x3d3557=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai_review__general-error-container',_0x3d3557['if']('isVisible','ck-hidden',_0x2246af=>!_0x2246af)]},'children':[{'tag':'p','attributes':{'class':'ck\x20ck-ai-notification\x20ck-ai-notification_error'},'children':[{'text':_0x3d3557['to']('errorMessage')}]}]});}}class aa extends vt{['reviewCoreHeader'];['generalErrorView'];['reviewCheckListView'];['reviewCheckResultsView'];['reviewCompletedView'];constructor(_0x15e511,_0x1297ea){super(_0x15e511),this['reviewCoreHeader']=_0x1297ea['header'],this['generalErrorView']=new oa(_0x15e511),this['reviewCheckListView']=_0x1297ea['list'],this['reviewCheckListView']['delegate'](...na)['to'](this),this['reviewCheckResultsView']=_0x1297ea['results'],this['reviewCheckResultsView']['delegate'](...na)['to'](this),this['reviewCompletedView']=_0x1297ea['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'](_0x1a4cd1){this['reviewCheckResultsView']['addResult'](_0x1a4cd1),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'](_0x7499ac){this['generalErrorView']['set']('isVisible',!0x0),this['generalErrorView']['errorMessage']=_0x7499ac;}['showGeneralResultsErrorView'](){this['reviewCheckResultsView']['set']('isLoading',!0x1),this['showActionsWhenResultIsReady'](),this['reviewCheckResultsView']['showGeneralErrorMessage']();}['showChunkErrorView'](){this['reviewCheckResultsView']['set']('isLoading',!0x1),this['showActionsWhenResultIsReady'](),this['reviewCheckResultsView']['showChunkErrorMessage']();}}class ha extends Nt{constructor(_0x38ee98,_0x383d5a){super(_0x383d5a),this['set']({'label':_0x38ee98,'withText':!0x0,'class':cs}),this['on']('execute',()=>{this['fire']('finishReview');});}}class ca extends Ht{['_resultViews'];['_resultsHeader'];['_resultsBody'];['reviewDisclaimer'];['_cancelButtonView'];['_acceptAllButtonView'];['_exitReviewButtonView'];['_toggleDiffButtonView'];['_errorMessageView'];['_finishReviewButtonView'];['_contents'];constructor(_0x2ca06b,_0x2c26e5){super(_0x2ca06b),this['_contents']=_0x2c26e5,this['_resultViews']=new _0x3f24a6(),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 io(_0x2ca06b),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 _0x225e9e=this['_createCombinedSkeletonLoader'](),_0x1afd27=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-run',_0x1afd27['if']('isLoading','ck-ai_review__check-run_loading',_0x4ef664=>_0x4ef664),_0x1afd27['if']('isResultReady','ck-ai_review__check-run_ready',_0x53e73f=>_0x53e73f),_0x1afd27['if']('isVisible','ck-hidden',_0x4b2850=>!_0x4b2850)]},'children':[this['_resultsHeader'],this['_errorMessageView'],this['_resultsBody'],_0x225e9e,this['reviewDisclaimer']]});}['clearResults'](){this['_resultViews']['clear'](),this['_resultsBody']['element']&&(this['_resultsBody']['element']['scrollTop']=0x0);}['getResults'](){return this['_resultViews'];}['addResult'](_0x20c1ae){const _0x2614f6=new ia(this['locale'],_0x20c1ae['id']);_0x2614f6['delegate']('acceptChange','dismissChange','activateChange','deactivateChange')['to'](this),this['_resultViews']['add'](_0x2614f6),_0x2614f6['resultResponseView']['element']['innerHTML']=_0x20c1ae['contentDiffed'];}['hideResult'](_0x2fe796,_0x17f4d0){if('pending'===_0x17f4d0)return;const _0x192252=this['_resultViews']['find'](_0x1e943b=>_0x1e943b['id']===_0x2fe796);_0x192252&&(_0x192252['status']=_0x17f4d0,_0x192252['element']?.['classList']['add']('ck-ai_review__check-run-result_grayout'));}['showResult'](_0x8e9b24,_0x2b8093){if('pending'!==_0x2b8093)return;const _0x5ba1ba=this['_resultViews']['find'](_0x2c96c8=>_0x2c96c8['id']===_0x8e9b24);_0x5ba1ba&&(_0x5ba1ba['status']=_0x2b8093,_0x5ba1ba['element']?.['classList']['remove']('ck-ai_review__check-run-result_grayout'));}['setTitle'](_0x2063c7,_0x4e7052){this['headerTitle']=_0x2063c7,this['headerSubtitle']=_0x4e7052||'';}['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 pn(this['locale'],mn['aiReviewChecks']);}['_createCombinedSkeletonLoader'](){const _0x1411b2=new vt(this['locale']),_0x4f9eff=[];for(let _0x4a43d8=0x0;_0x4a43d8<0x10;_0x4a43d8++){const _0x530cda=this['_createSkeletonLoader']();_0x530cda['extendTemplate']({'attributes':{'class':['ck-ai_review__check-run-skeleton-item']}}),_0x4f9eff['push'](_0x530cda);}return _0x1411b2['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-run-skeleton-container',this['bindTemplate']['if']('isLoading','ck-hidden',_0x2d1527=>!_0x2d1527)]},'children':_0x4f9eff}),_0x1411b2;}['_createResultsBodyView'](){const _0xc4e3e8=new vt(this['locale']);return _0xc4e3e8['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-run-results-container','ck-reset_all-excluded',this['bindTemplate']['if']('isLoading','ck-hidden',_0x33e71e=>_0x33e71e)]},'children':this['_resultViews']}),_0xc4e3e8;}['_createErrorView'](){const _0x3c0008=new vt(this['locale']),_0x180919=new Nt(this['locale']),t=this['locale']['t'];return _0x3c0008['delegate']('retryReview')['to'](this),_0x180919['set']({'label':t('Try\x20again'),'withText':!0x0,'class':ls+'\x20ck-ai_review__check-run-error-retry-button'}),_0x180919['on']('execute',()=>{this['fire']('retryReview');}),_0x3c0008['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-run-error-container',this['bindTemplate']['if']('showErrorMessage','ck-hidden',_0x210cb7=>!_0x210cb7),this['bindTemplate']['if']('errorType','ck-ai_review__check-run-error-container_border-bottom',_0x4d7bec=>'chunk'===_0x4d7bec)]},'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',_0x3814be=>'chunk'===_0x3814be)]},'children':[{'tag':'p','attributes':{'class':['ck-ai-notification__content',this['bindTemplate']['if']('errorType','ck-hidden',_0x5241ca=>'general'!==_0x5241ca)]},'children':[{'text':this['_contents']['generalErrorText']}]},{'tag':'p','attributes':{'class':['ck-ai-notification__content',this['bindTemplate']['if']('errorType','ck-hidden',_0x5aabb8=>'chunk'!==_0x5aabb8)]},'children':[{'text':hs(this['locale'],'AI_REVIEW_MODE_CHUNK_ERROR_MESSAGE')}]}]},_0x180919]}),_0x3c0008;}['_createCancelButtonView'](){const _0x2da193=new Nt(this['locale']);return _0x2da193['set']({'label':hs(this['locale'],'AI_REVIEW_MODE_STOP_GENERATING'),'withText':!0x0,'class':[ls+'\x20ck-ai-button-stop-generating'],'icon':_0x25a26a}),_0x2da193['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isResultReady','ck-hidden',_0x4d481b=>_0x4d481b),this['bindTemplate']['if']('isCompleted','ck-hidden',_0x107498=>_0x107498)]}}),_0x2da193['on']('execute',()=>{this['fire']('abortReviewStream');}),_0x2da193;}['_createToggleDiffButtonView'](){const _0x21314a=new Nt(this['locale']);_0x21314a['set']({'tooltip':!0x0,'isToggleable':!0x0,'role':'menuitemcheckbox'}),_0x21314a['bind']('isEnabled')['to'](this,'isError',_0x1b22a4=>!_0x1b22a4),_0x21314a['extendTemplate']({'attributes':{'class':[ls,'ck-ai_review__check-run-toggle-diff-button',this['bindTemplate']['if']('isResultReady','ck-hidden',_0x497d89=>!_0x497d89),this['bindTemplate']['if']('isCompleted','ck-hidden',_0x3045e7=>_0x3045e7)]}});const _0x85b653=hs(this['locale'],'AI_REVIEW_MODE_HIDE_CHANGES'),_0x2a029b=hs(this['locale'],'AI_REVIEW_MODE_SHOW_CHANGES');return _0x21314a['bind']('isOn')['to'](this,'isToggleDiffOn',_0x40786b=>_0x40786b),_0x21314a['bind']('icon')['to'](this,'isToggleDiffOn',_0x51bdc7=>_0x51bdc7?st:nt),_0x21314a['bind']('label')['to'](this,'isToggleDiffOn',_0x4e3879=>_0x4e3879?_0x85b653:_0x2a029b),_0x21314a['on']('execute',()=>{this['isToggleDiffOn']=!this['isToggleDiffOn'],this['fire']('toggleDiff',{'on':this['isToggleDiffOn']});}),_0x21314a;}['_createAcceptAllButtonView'](){const _0x18ac70=new Nt(this['locale']);return _0x18ac70['set']({'label':hs(this['locale'],'AI_REVIEW_MODE_ACCEPT_ALL'),'withText':!0x0}),_0x18ac70['bind']('isEnabled')['to'](this,'isError',_0x5ae6be=>!_0x5ae6be),_0x18ac70['extendTemplate']({'attributes':{'class':[cs,'ck-ai_review__check-run-accept-all-button',this['bindTemplate']['if']('isResultReady','ck-hidden',_0x45efb8=>!_0x45efb8),this['bindTemplate']['if']('isCompleted','ck-hidden',_0x44d870=>_0x44d870)]}}),_0x18ac70['on']('execute',()=>{this['fire']('acceptAllChanges');}),_0x18ac70;}['_createExitReviewButtonView'](){const _0x3f7ec7=new Nt(this['locale']);return _0x3f7ec7['set']({'label':hs(this['locale'],'AI_REVIEW_MODE_EXIT_REVIEW'),'withText':!0x0}),_0x3f7ec7['extendTemplate']({'attributes':{'class':[us,'ck-ai_review__check-run-exit-button',this['bindTemplate']['if']('isResultReady','ck-hidden',_0x5e0183=>!_0x5e0183),this['bindTemplate']['if']('isCompleted','ck-hidden',_0x3ce1d2=>_0x3ce1d2)]}}),_0x3f7ec7['on']('execute',()=>{this['fire']('leaveReviewCoreResultList');}),_0x3f7ec7;}['_createResultHeaderView'](){const _0x3b7ebb=new vt(this['locale']),_0x5db207=this['_createTitleView']();return _0x3b7ebb['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-run-results-header',this['bindTemplate']['if']('isCompleted','ck-ai_review__review-completed-header',_0x34bf69=>_0x34bf69)]},'children':[_0x5db207,{'tag':'div','attributes':{'class':['ck-ai_review__check-run-results-header-buttons']},'children':[this['_cancelButtonView'],this['_acceptAllButtonView'],this['_exitReviewButtonView'],this['_toggleDiffButtonView'],this['_finishReviewButtonView']]}]}),_0x3b7ebb;}['_createTitleView'](){const _0x386ae0=new vt(this['locale']),_0x50e09e=new yn();return _0x50e09e['bind']('isVisible')['to'](this,'isResultReady',_0x4510f1=>!_0x4510f1),_0x386ae0['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-run-results-header-title-wrapper']},'children':[_0x50e09e,{'tag':'div','attributes':{'class':['ck-ai_review__check-run-results-header-title-content',this['bindTemplate']['if']('isCompleted','ck-hidden',_0x3db3e0=>_0x3db3e0)]},'children':[{'tag':'span','attributes':{'class':['ck-ai_review__check-run-results-header-title']},'children':[{'text':this['bindTemplate']['to']('headerTitle')}]},{'tag':'span','attributes':{'class':['ck-ai_review__check-run-results-header-subtitle']},'children':[{'text':this['bindTemplate']['to']('headerSubtitle')}]}]},{'tag':'span','attributes':{'class':['ck-ai_review__review-completed-header-title',this['bindTemplate']['if']('isCompleted','ck-hidden',_0x48b018=>!_0x48b018)]},'children':[{'text':hs(this['locale'],'AI_REVIEW_MODE_FINISH_REVIEW_HEADER_TITLE')}]}]}),_0x386ae0;}['_createFinishReviewButtonView'](){const _0x4d7197=new ha(hs(this['locale'],'AI_REVIEW_MODE_FINISH_REVIEW_BUTTON_LABEL'),this['locale']);return _0x4d7197['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isCompleted','ck-hidden',_0x16b5fa=>!_0x16b5fa)]}}),_0x4d7197['delegate']('finishReview')['to'](this),_0x4d7197;}}class la extends Ht{['_resultsHeader'];['_finishReviewButtonView'];constructor(_0x3f8d78,_0x5a36e7){super(_0x3f8d78),this['_finishReviewButtonView']=this['_createFinishReviewButtonView'](_0x5a36e7['buttonText']),this['_resultsHeader']=this['_createResultHeaderView'](_0x5a36e7['headerText']);const _0x19e783=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__review-completed',_0x19e783['if']('isVisible','ck-hidden',_0x1dd461=>!_0x1dd461)]},'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':_0x5a36e7['emptyResultsText']}]}]}]});}['_createFinishReviewButtonView'](_0x435639){const _0x35d81e=new ha(_0x435639,this['locale']);return _0x35d81e['delegate']('finishReview')['to'](this),_0x35d81e;}['_createResultHeaderView'](_0x534ae2){const _0xf21262=new vt(this['locale']);return _0xf21262['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__review-completed-header']},'children':[{'tag':'span','attributes':{'class':['ck-ai_review__review-completed-header-title']},'children':[{'text':_0x534ae2}]},{'tag':'div','attributes':{'class':['ck-ai_review__review-completed-header-buttons']},'children':[this['_finishReviewButtonView']]}]}),_0xf21262;}}class ua extends vt{['_dropdownView'];['_defaultValue'];['_defaultLabel'];constructor(_0x8fce47,_0x408665){super(_0x8fce47),this['_defaultValue']=_0x408665['default']||(_0x408665['data']['length']>0x0?_0x408665['data'][0x0]['id']:''),this['_defaultLabel']=_0x408665['data']['find'](_0x5eca8a=>_0x5eca8a['id']===this['_defaultValue'])?.['label']||'',this['set']('formValue',''),this['_dropdownView']=Gt(this['locale']);const _0x5a22cb=this['_prepareListOptions'](_0x408665['data']);jt(this['_dropdownView'],_0x5a22cb,{'role':'menu','ariaLabel':_0x408665['label']}),this['_dropdownView']['buttonView']['set']({'label':this['_defaultLabel'],'withText':!0x0}),this['_dropdownView']['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x2a8cd3=>{_0x2a8cd3['stopPropagation']();})}}),this['listenTo'](this['_dropdownView'],'execute',_0x1b3efd=>{this['formValue']=_0x1b3efd['source']['model']['id'],this['_dropdownView']['buttonView']['label']=_0x1b3efd['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'](_0x587282=[]){const _0x244cd7=new dt();this['resetToDefault']();for(const _0x10e8ad of _0x587282){const _0x20ee1b=new Jt({'label':_0x10e8ad['label'],'withText':!0x0,'role':'menuitemradio','id':_0x10e8ad['id'],'model':_0x10e8ad});_0x20ee1b['bind']('isOn')['to'](this,'formValue',_0x4efa47=>_0x4efa47===_0x20ee1b['id']);const _0x1f4fef={'type':'button','model':_0x20ee1b};_0x244cd7['add'](_0x1f4fef);}return _0x244cd7;}}class da extends Ht{['_formItem']=null;constructor(_0x376ab1,_0x499c4f,_0x1ad26e){super(_0x376ab1),this['argsKey']=_0x499c4f?.['argsKey'];if('dropdown'===_0x499c4f['formType'])this['_formItem']=new ua(this['locale'],_0x499c4f);this['set']('value',''),this['bind']('value')['to'](this['_formItem'],'formValue');const _0x1ccec5=new _0x18b064(this['locale'],{'children':[this['_formItem']],'class':[_0x1ad26e?'ck-form__row_with-submit':'']});_0x1ad26e&&_0x1ccec5['children']['add'](_0x1ad26e),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai_review__form-item','ck-reset_all']},'children':[_0x1ccec5]});}['resetToDefault'](){this['_formItem']['resetToDefault']();}}class _a extends _0x51c860{['keystrokes'];static ['MIN_ROWS']=0x1;static ['MAX_ROWS']=0xc;constructor(_0x3394ba){super(_0x3394ba),this['set']('isEmpty',!0x0),this['keystrokes']=new gt(),this['minRows']=_a['MIN_ROWS'],this['maxRows']=_a['MAX_ROWS'],this['extendTemplate']({'attributes':{'id':'ai-review-prompt-input','class':['ck','ck-review__prompt-input']}});}['render'](){super['render'](),this['on']('update',()=>{this['isEmpty']=''===this['element']['value']?.['trim']();}),this['keystrokes']['listenTo'](this['element']);}}class ga extends vt{['focusTracker']=new _t();['keystrokes']=new gt();['focusCycler'];['_focusables']=new _0x3f24a6();['submitButtonView'];['cancelButtonView'];['promptInputView'];['actionsFooterView'];['_modelSelectionDropdown'];['_modelNameView'];['_modelSelectionDropdownItems'];['_check'];['_defaultValue'];['_defaultLabel'];constructor(_0x5a207a,_0x2bb7c3,_0x3a54aa=!0x1){super(_0x5a207a),this['_check']=_0x2bb7c3,this['set']('prompt',''),this['set']('modelId',''),this['set']('modelDisplayMode','selector'),this['set']('activeModelName',null),this['_defaultValue']=_0x2bb7c3['defaultModel']?_0x2bb7c3['defaultModel']['id']:'',this['_defaultLabel']=_0x2bb7c3['defaultModel']?_0x2bb7c3['defaultModel']['name']:'',this['submitButtonView']=this['_createSubmitButtonView'](),this['cancelButtonView']=this['_createCancelButtonView'](),(this['promptInputView']=new te(this['locale'],()=>new _a(_0x5a207a)),this['promptInputView']['fieldView']['bind']('value')['to'](this,'prompt'),this['promptInputView']['fieldView']['on']('input',()=>{this['prompt']=this['promptInputView']['fieldView']['element']['value'];}),this['_modelSelectionDropdown']=this['_createModelSelectionDropdown'](),this['_modelSelectionDropdownItems']=new dt(),this['_modelNameView']=this['_createModelNameView'](),this['_setModelList'](_0x3a54aa),jt(this['_modelSelectionDropdown'],this['_modelSelectionDropdownItems']),this['actionsFooterView']=this['_createActionsFooterView'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-custom-actions']},'children':[new _0x18b064(this['locale'],{'children':[this['promptInputView']]}),new _0x18b064(this['locale'],{'children':[this['actionsFooterView']]})]}),this['promptInputView']['fieldView']['keystrokes']['set']('Enter',(_0x26681e,_0x13c7d0)=>{this['_isValid']()?(this['fire']('runReviewCheck',{'id':'custom','args':{'prompt':this['prompt'],'model':this['modelId']},'isCustom':!0x0}),_0x13c7d0()):_0x13c7d0();}),this['focusCycler']=new Ut({'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'](_0x59137d=>{this['_focusables']['add'](_0x59137d),this['focusTracker']['add'](_0x59137d['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 _0x2c5a86 of this['_getFormValidators']()){const _0x501a1b=_0x2c5a86();if(_0x501a1b)return this['promptInputView']['errorText']=_0x501a1b,!0x1;}return!0x0;}['_getFormValidators'](){return[()=>{if(0x0===this['promptInputView']['fieldView']['value']?.['trim']()['length'])return hs(this['locale'],'AI_REVIEW_MODE_PROMPT_EMPTY_ERROR');}];}['_createSubmitButtonView'](){const _0x2ea121=new Nt(this['locale']),t=this['locale']['t'];return _0x2ea121['set']({'label':t('Submit'),'withText':!0x0,'class':cs}),_0x2ea121['on']('execute',()=>{this['_isValid']()&&this['fire']('runReviewCheck',{'id':'custom','args':{'prompt':this['prompt'],'model':this['modelId']},'isCustom':!0x0});}),_0x2ea121;}['_createCancelButtonView'](){const _0x491dfe=new Nt(this['locale']),t=this['locale']['t'];return _0x491dfe['set']({'label':t('Cancel'),'withText':!0x0,'class':us}),_0x491dfe['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x559a8f=>{_0x559a8f['stopPropagation']();})}}),_0x491dfe['on']('execute',()=>{this['resetToDefault'](),this['fire']('closeCustomCheck');}),_0x491dfe;}['_setModelList'](_0x24d309){this['_modelSelectionDropdownItems']['clear']();const _0x230d8d=this['_check']['models'];if(_0x24d309)this['set']('modelDisplayMode','hidden');else{const _0x68f55c=0x1===_0x230d8d['length'];this['set']('modelDisplayMode',_0x68f55c?'name':'selector');}if(this['resetToDefault'](),_0x230d8d?.['length']){0x1===_0x230d8d['length']&&this['set']('activeModelName',_0x230d8d[0x0]['name']||_0x230d8d[0x0]['id']);for(const _0x198c46 of _0x230d8d){const _0x80aa47=new Jt({'label':_0x198c46['name'],'withText':!0x0,'role':'menuitemradio','id':_0x198c46['id'],'model':_0x198c46});_0x80aa47['bind']('isOn')['to'](this,'modelId',_0x42a448=>_0x42a448===_0x198c46['id']),this['_modelSelectionDropdownItems']['add']({'type':'button','model':_0x80aa47,'labelView':new Ia(this['locale'],_0x198c46)});}}}['_createModelSelectionDropdown'](){const _0x3c9e4b=Gt(this['locale']);return _0x3c9e4b['set']({'panelPosition':'se','class':'ck-ai_review__check-list-item-model-dropdown'}),_0x3c9e4b['buttonView']['set']({'label':this['_defaultLabel'],'withText':!0x0,'tooltip':!0x0,'class':us}),_0x3c9e4b['buttonView']['bind']('isVisible')['to'](this,'modelDisplayMode',_0x56d7dc=>'selector'===_0x56d7dc),this['listenTo'](_0x3c9e4b,'execute',_0x3c3cf0=>{this['modelId']=_0x3c3cf0['source']['model']['id'],_0x3c9e4b['buttonView']['label']=_0x3c3cf0['source']['label'];}),_0x3c9e4b;}['_createModelNameView'](){const _0x1fcc90=new Aa(this['locale']);return _0x1fcc90['bind']('text')['to'](this,'activeModelName',_0x299d4d=>_0x299d4d??''),_0x1fcc90['bind']('isVisible')['to'](this,'modelDisplayMode',_0x432b0c=>'name'===_0x432b0c),_0x1fcc90;}['_createActionsFooterView'](){const _0x4f71ef=new vt(this['locale']);return _0x4f71ef['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']]}]}),_0x4f71ef;}}class Aa extends vt{constructor(_0x1acfb4){super(_0x1acfb4),this['set']('text',void 0x0),this['set']('isVisible',!0x0);const _0x2c8193=this['bindTemplate'];this['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai_review__check-list-item-model-name',_0x2c8193['if']('isVisible','ck-hidden',_0x2853d1=>!_0x2853d1)]},'children':[{'text':_0x2c8193['to']('text')}]});}}class Ia extends Mt{constructor(_0x12a50d,_0x36a590){super();const _0x389084=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-button__label'],'style':_0x389084['to']('style'),'id':_0x389084['to']('id')},'children':[{'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-model-dropdown-name']},'children':[{'tag':'span','children':[{'text':_0x389084['to']('text')}]}]},{'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-model-dropdown-description']},'children':[{'tag':'span','children':[_0x36a590['description']||'']}]}]});}}class Ea extends Ht{['_formItemsCollection']=new _0x3f24a6();['_customCheckView']=null;['_hideModels']=!0x1;constructor(_0x13a815,_0xbc8ce,_0x2953df,_0x2522a4=!0x1){super(_0x13a815),this['_hideModels']=_0x2522a4,this['set']('isParametrizedViewOpen',!0x1),this['set']('isListItemRendered',!0x1),this['set']('isItemParametrized',_0xbc8ce['isParameterized']);const _0x105700=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',_0x21c95d=>_0x21c95d),this['bindTemplate']['if']('isListItemRendered','ck-ai_review__check-list-item_rendered',_0x4219f5=>_0x4219f5)],'style':{'--ck-ai-review-check-list-item-index':_0x2953df}},'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':_0xbc8ce['title']}]},_0x105700]},{'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-description']},'children':_0xbc8ce['description']?[{'text':_0xbc8ce['description']}]:[]}]}]},..._0xbc8ce['isParameterized']?[this['_createParameterizedView'](_0xbc8ce)]:[],...'custom'===_0xbc8ce['id']?[this['_createCustomView'](_0xbc8ce,this['_hideModels'])]:[]]}),this['on']('click',()=>{_0xbc8ce['isParameterized']?this['isParametrizedViewOpen']=!0x0:this['fire']('runReviewCheck',{'id':_0xbc8ce['id'],'args':_0xbc8ce['useArgs']?_0xbc8ce['args']:void 0x0});}),requestAnimationFrame(()=>{this['isListItemRendered']=!0x0;});}['render'](){super['render'](),this['isItemParametrized']&&zt({'emitter':this,'activator':()=>!0x0===this['isParametrizedViewOpen'],'contextElements':[this['element']],'callback':()=>{this['isParametrizedViewOpen']=!0x1;}});}['resetToDefault'](){this['isParametrizedViewOpen']=!0x1,this['_formItemsCollection']['forEach'](_0x5913af=>{_0x5913af['resetToDefault']();}),this['_customCheckView']&&this['_customCheckView']['resetToDefault']();}['_createIconView'](){const _0x3a7c2b=new xt();return _0x3a7c2b['content']=rt,_0x3a7c2b['extendTemplate']({'attributes':{'class':['ck-ai_review__check-list-item-title-icon']}}),_0x3a7c2b;}['_createParameterizedView'](_0x16d1ac){const _0x2ea845=new vt(),_0x45d1eb=this['_createFormView'](_0x16d1ac);return _0x2ea845['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-parameterized',this['bindTemplate']['if']('isParametrizedViewOpen','ck-hidden',_0x52fa54=>!_0x52fa54)]},'children':[_0x45d1eb]}),_0x2ea845;}['_createFormView'](_0x115bd1){const _0x868621=new vt(),_0x23255c=Array['isArray'](_0x115bd1['options'])?_0x115bd1['options']:[],_0x3b08b=new Nt(this['locale']),t=this['locale']['t'];_0x3b08b['set']({'label':t('Submit'),'withText':!0x0,'class':cs}),_0x3b08b['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x48c51c=>{_0x48c51c['stopPropagation']();})}}),_0x3b08b['on']('execute',()=>{const _0xf55ab7=[],_0x380b41={};this['_formItemsCollection']['forEach'](_0x5d65dc=>{_0xf55ab7['push'](_0x5d65dc['value']),_0x115bd1['useArgs']&&_0x115bd1['options']&&(_0x380b41[_0x5d65dc['argsKey']]=_0x5d65dc['value']);}),this['fire']('runReviewCheck',{'id':_0x115bd1['id'],'params':_0xf55ab7['length']?_0xf55ab7:void 0x0,'args':Object['keys'](_0x380b41)['length']?_0x380b41:void 0x0});});const _0x180b7c=_0x23255c['length'];return _0x23255c['forEach']((_0x2a6d26,_0x522b76)=>{const _0x21a59f=_0x522b76===_0x180b7c-0x1;this['_formItemsCollection']['add'](new da(this['locale'],_0x2a6d26,_0x21a59f?_0x3b08b:null));}),_0x868621['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-parameterized-form']},'children':this['_formItemsCollection']}),_0x868621;}['_createCustomView'](_0x155adc,_0x201214=!0x1){return this['_customCheckView']=new ga(this['locale'],_0x155adc,_0x201214),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',_0x1b974a=>!_0x1b974a)]}}),this['_customCheckView']['delegate']('runReviewCheck')['to'](this),this['listenTo'](this['_customCheckView'],'closeCustomCheck',()=>{this['isParametrizedViewOpen']=!0x1;}),this['on']('change:isParametrizedViewOpen',(_0x2e1c0d,_0x4dd6d5,_0x16d52)=>{_0x16d52||this['_customCheckView']['resetFormValidationStatus']();}),this['_customCheckView'];}}class pa extends Ht{['_checkViews'];constructor(_0x222b79){super(_0x222b79),this['_checkViews']=new _0x3f24a6(),this['_setupTemplate']();}['setChecks'](_0x357b0e,_0x265144=!0x1){this['_checkViews']['clear']();for(const [_0x139ce3,_0x571211]of _0x357b0e['entries']()){const _0x1a89c6=new Ea(this['locale'],_0x571211,_0x139ce3,_0x265144);_0x1a89c6['delegate']('runReviewCheck')['to'](this),this['_checkViews']['add'](_0x1a89c6);}}['hasChecks'](){return this['_checkViews']['length']>0x0;}['resetAllParameterizedChecks'](){for(const _0x5e3033 of this['_checkViews'])_0x5e3033 instanceof Ea&&_0x5e3033['resetToDefault']();}['_setupTemplate'](){const _0x20c8ff=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-list',_0x20c8ff['if']('isVisible','ck-hidden',_0x4649e1=>!_0x4649e1)]},'children':this['_checkViews']});}}class ma extends ra{static get['pluginName'](){return'AIReviewModeUI';}['createMainView'](){const _0xa7522b=this['context']['plugins']['get']('AITabs'),_0x46db22=this['context']['locale'],_0x4c5507=new eo(_0x46db22,{'label':hs(_0x46db22,'AI_REVIEW_MODE'),'icon':_0x317a11,'class':'ck-ai-header_review','showResizeButton':_0xa7522b['showResizeButton']});return _0x4c5507['delegate']('resizeTabs')['to'](_0xa7522b),_0x4c5507['bind']('isMaximized')['to'](_0xa7522b['view'],'isMaximized',_0x43e0e3=>_0x43e0e3),new aa(this['context']['locale'],{'header':_0x4c5507,'list':new pa(_0x46db22),'results':new ca(_0x46db22,{'generalErrorText':hs(_0x46db22,'AI_REVIEW_MODE_GENERAL_ERROR_MESSAGE')}),'completed':new la(_0x46db22,{'headerText':hs(_0x46db22,'AI_REVIEW_MODE_FINISH_REVIEW_HEADER_TITLE'),'emptyResultsText':hs(_0x46db22,'AI_REVIEW_MODE_EMPTY_RESULTS_TEXT'),'buttonText':hs(_0x46db22,'AI_REVIEW_MODE_FINISH_REVIEW_BUTTON_LABEL')})});}['registerTab'](){const _0x611a26=this['context']['plugins']['get']('AITabs');_0x611a26['view']['on']('activateTab',(_0x56798f,{newTab:_0x396831,oldTab:_0x4a753a})=>{'reviewMode'===_0x396831?this['fire']('getReviewCheckList'):'reviewMode'===_0x4a753a&&this['fire']('leaveReview');}),_0x611a26['view']['addTab']({'id':'reviewMode','buttonLabel':hs(this['context']['locale'],'AI_REVIEW_MODE'),'buttonIcon':_0x317a11,'order':0x0,'content':this['_mainView']});}}const Ta='review-',Ca=['softBreak'];class wa extends _0x203d97{static get['requires'](){return[_0x58b094,Js];}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(_0x88f473){super(_0x88f473),this['_domEmitter']=new(Ot())(),this['_eventEmitter']=new(Tt())();}get['emitter'](){return this['_eventEmitter'];}['afterInit'](){const _0x37e4ce=_0x3442ed=>this['_scheduleAttachReviewEditingToEditor'](_0x3442ed);if(this['_registerGlobalBalloonBlurHandler'](),this['context']instanceof _0x17198a)return void this['_attachReviewEditingToEditor'](this['context']);const _0x142e9c=this['context'];for(const _0x34d293 of _0x142e9c['editors'])_0x37e4ce(_0x34d293);this['listenTo'](_0x142e9c['editors'],'add',(_0x27490a,_0x5e9a8f)=>{_0x37e4ce(_0x5e9a8f);}),this['listenTo'](_0x142e9c['editors'],'remove',(_0x481e24,_0x4601cb)=>{for(const [_0x3a70fd,_0x537a1c]of this['_markers'])_0x537a1c['editor']===_0x4601cb&&(this['_eventEmitter']['fire']('changeMarkerRemoved',{'markerId':_0x3a70fd,'changeId':_0x537a1c['groupId']}),this['_markers']['delete'](_0x3a70fd));});}['_scheduleAttachReviewEditingToEditor'](_0x206afc){const _0x248496=()=>{'destroyed'!==_0x206afc['state']&&_0x206afc['conversion']&&this['_attachReviewEditingToEditor'](_0x206afc);};if('ready'===_0x206afc['state'])return void _0x248496();const _0x1f7502=()=>{this['stopListening'](_0x206afc,'ready',_0x1f7502),_0x248496();};this['listenTo'](_0x206afc,'ready',_0x1f7502);}['_attachReviewEditingToEditor'](_0x400fd9){this['_reviewEditingAttachedEditors']['has'](_0x400fd9)||(_0x400fd9['conversion']['for']('editingDowncast')['markerToElement']({'model':Ta+'insert','view':(_0xbb4d39,{writer:_0x35294d})=>{const _0x4e8ccc=this['_markers']['get'](_0xbb4d39['markerName']),_0x282973={'class':'ck-ai_review-marker_add'+(this['_activeMarkers']['has'](_0x4e8ccc?.['id']||'')?'\x20ck-ai_review__change_active':''),'data-marker-id':_0xbb4d39['markerName']};return _0x35294d['createUIElement']('span',_0x282973,function(_0x1662b8){const _0x430e64=this['toDomElement'](_0x1662b8);return _0x430e64['innerHTML']=_0x4e8ccc?.['content']?.['asString']||'',_0x430e64;});}}),_0x400fd9['conversion']['for']('editingDowncast')['markerToHighlight']({'model':Ta+'remove-only','view':_0x1cdf9c=>{const _0x44cf0e=this['_markers']['get'](_0x1cdf9c['markerName']),_0x2e8874=['ck-ai_review-marker_strikethrough'];return this['_activeMarkers']['has'](_0x44cf0e?.['id']||'')&&_0x2e8874['push']('ck-ai_review__change_active'),{'classes':_0x2e8874,'attributes':{'data-marker-id':_0x1cdf9c['markerName']}};}}),_0x400fd9['conversion']['for']('editingDowncast')['markerToHighlight']({'model':Ta+'remove-context','view':_0x40aa9b=>{const _0x56b81a=this['_markers']['get'](_0x40aa9b['markerName']),_0x3c2f3b=['ck-ai_review-marker_underline'];return this['_activeMarkers']['has'](_0x56b81a?.['id']||'')&&_0x3c2f3b['push']('ck-ai_review__change_active'),{'classes':_0x3c2f3b,'attributes':{'data-marker-id':_0x40aa9b['markerName']}};}}),_0x400fd9['conversion']['for']('editingDowncast')['markerToHighlight']({'model':Ta+'remove-text','view':_0x4f553b=>{const _0x5dc82c=this['_markers']['get'](_0x4f553b['markerName']),_0x5509f8=['ck-ai_review-marker_hide'];return this['_activeMarkers']['has'](_0x5dc82c?.['id']||'')&&_0x5509f8['push']('ck-ai_review__change_active'),{'classes':_0x5509f8,'attributes':{'data-marker-id':_0x4f553b['markerName']}};}}),_0x400fd9['conversion']['for']('dataDowncast')['markerToElement']({'model':Ta+'suggestion-context','view':(_0x536fcd,{writer:_0x5d2056})=>_0x5d2056['createRawElement']('span',{'class':'ck-ai_review-marker_context-'+(_0x536fcd['isOpening']?'start':'end')})}),_0x400fd9['conversion']['for']('downcast')['attributeToAttribute']({'model':_0x522952,'view':_0x4b4ee0}),this['_updateMouseMarkerInteractionListeners'](_0x400fd9),this['listenTo'](_0x400fd9,'addRoot',()=>this['_updateMouseMarkerInteractionListeners'](_0x400fd9),{'priority':'lowest'}),this['listenTo'](_0x400fd9,'detachRoot',()=>this['_updateMouseMarkerInteractionListeners'](_0x400fd9),{'priority':'lowest'}),_0x400fd9['model']['document']['registerPostFixer'](_0x55951d=>this['_validateMarkers'](_0x400fd9,_0x55951d)),_0x400fd9['model']['document']['on']('change',()=>this['_handleMarkerChanges'](_0x400fd9)),this['_reviewEditingAttachedEditors']['add'](_0x400fd9));}['_updateMouseMarkerInteractionListeners'](_0x38e3e0){let _0x176383=this['_boundEditables']['get'](_0x38e3e0);_0x176383||(_0x176383=new Map(),this['_boundEditables']['set'](_0x38e3e0,_0x176383));const _0x3a1083=new Set(_0x38e3e0['ui']['getEditableElementsNames']());for(const _0x53a284 of _0x3a1083){if(_0x176383['has'](_0x53a284))continue;const _0x45406f=_0x38e3e0['ui']['getEditableElement'](_0x53a284);_0x176383['set'](_0x53a284,_0x45406f),this['_attachMouseMarkerInteractionListeners'](_0x45406f);}for(const [_0x305512,_0x158010]of _0x176383)_0x3a1083['has'](_0x305512)||(_0x176383['delete'](_0x305512),this['_domEmitter']['stopListening'](_0x158010));}['_attachMouseMarkerInteractionListeners'](_0x3d8a89){this['_domEmitter']['listenTo'](_0x3d8a89,'mouseup',(_0x573da9,_0x2913fd)=>{const _0x292f94=_0x2913fd['target'],_0x27c209=this['_findMarkerElement'](_0x292f94);if(!_0x27c209)return;const _0x5a2c39=_0x27c209['getAttribute']('data-marker-id'),_0x5bd21e=_0x5a2c39['split'](':')['pop']()?.['split']('_')[0x0];this['_eventEmitter']['fire']('changeMarkerClicked',{'markerId':_0x5a2c39,'changeId':_0x5bd21e,'markerElement':()=>this['_findMarkerElementById'](_0x5a2c39),'domEvent':_0x2913fd});},{'usePassive':!0x0,'priority':'highest'}),this['_domEmitter']['listenTo'](_0x3d8a89,'mouseover',(_0x443268,_0xbcf4cb)=>{const _0x21ee5c=_0xbcf4cb['target'],_0x16fe8e=_0xbcf4cb['relatedTarget'];let _0x265703=this['_findMarkerElement'](_0x21ee5c);if(!_0x265703&&_0x16fe8e&&(_0x265703=this['_findMarkerElement'](_0x16fe8e)),!_0x265703)return;const _0xdb5b9f=_0x265703['getAttribute']('data-marker-id'),_0x245dbf=_0xdb5b9f['split'](':')['pop']()?.['split']('_')[0x0];this['_eventEmitter']['fire']('changeMarkerHovered',{'changeId':_0x245dbf,'markerElement':()=>this['_findMarkerElementById'](_0xdb5b9f),'domEvent':_0xbcf4cb});});}['_registerGlobalBalloonBlurHandler'](){this['_domEmitter']['listenTo'](document,'mouseover',_0x3b5df9((_0x51ef96,_0x41a21c)=>{const _0x2865c9=_0x41a21c['target'];if(this['_findMarkerElement'](_0x2865c9))return;_0x2865c9['closest']('.ck-reset.ck-ai_review-balloon-panel-suggestion')||this['_eventEmitter']['fire']('changeMarkerBlurred');},0xc8));}['getDocumentData'](){const _0x15f27e=this['context']['plugins']['get']('AIEditing'),_0x42b857=Ws(this['context']);if(!_0x42b857['length'])throw new at('ai-get-editor-from-context-no-editor',this);const _0xae4db5=new Set(),_0x1814be=[],_0x42c6f=new Map();for(const _0x3a4294 of _0x42b857)for(const _0x314d58 of _0x3a4294['model']['document']['getRoots']()){if('$graveyard'===_0x314d58['rootName'])continue;const _0x526ff8=this['_buildDocumentDataSliceForRoot'](_0x3a4294,_0x314d58,_0x15f27e,_0xae4db5);_0x1814be['push'](_0x526ff8['content']);for(const [_0x34d5b2,_0x646d3d]of _0x526ff8['elements'])_0x42c6f['set'](_0x34d5b2,_0x646d3d);}return{'elements':_0x42c6f,'content':_0x1814be['join']('')};}['_buildDocumentDataSliceForRoot'](_0x443c39,_0x5a32ff,_0x554a66,_0x3a3387){const _0x535847=_0x443c39['model'],_0x861b24=new _0x49b7d4();for(const _0x458722 of _0x5a32ff['getChildren']())_0x861b24['_appendChild'](_0x458722['_clone'](!0x0));for(const _0x47d770 of _0x535847['markers']){const _0x5768b=_0x47d770['getRange']();_0x5768b&&_0x5768b['root']['rootName']===_0x5a32ff['rootName']&&_0x861b24['markers']['set'](_0x47d770['name'],this['_changeRangeOwnerDocument'](_0x5768b['clone'](),_0x861b24));}const _0x2f9b6d=new Map(),_0x580f62=_0x535847['document']['version'],_0x4f3887=new _0x50dc86({'ignoreElementEnd':!0x0,'startPosition':_0x535847['createPositionAt'](_0x861b24,0x0)});for(const {item:_0x2dd596}of _0x4f3887){if(!_0x2dd596['is']('$textProxy'))continue;const _0x4e4a24=_0x2dd596['parent'];if(!_0x4e4a24||!_0x4e4a24['is']('element'))continue;const _0x206f34=this['_upsertDataId'](_0x4e4a24,()=>_0x554a66['_nextDataId'](_0x3a3387));_0x3a3387['add'](_0x206f34);for(const _0x18706e of _0x4e4a24['getChildren']())_0x18706e['is']('element')&&(_0x18706e['name']&&Ca['includes'](_0x18706e['name'])||_0x3a3387['add'](this['_upsertDataId'](_0x18706e,()=>_0x554a66['_nextDataId'](_0x3a3387))));let _0x5f5756=_0x4e4a24;for(;_0x5f5756['parent']&&!_0x5f5756['parent']['is']('documentFragment');)_0x5f5756=_0x5f5756['parent'],_0x5f5756['hasAttribute'](_0x522952)&&_0x5f5756['_removeAttribute'](_0x522952);_0x2f9b6d['set'](_0x206f34,{'editor':_0x443c39,'rootName':_0x5a32ff['rootName'],'path':_0x4e4a24['getPath'](),'documentVersion':_0x580f62,'getContent':this['_createGetContentUsingDataIdFn'](_0x5f5756['_clone'](!0x0),_0x206f34,_0x443c39['data'])}),_0x4f3887['jumpTo'](_0x535847['createPositionAfter'](_0x4e4a24));}return{'content':_0x443c39['data']['processor']['toData'](_0x443c39['data']['toView'](_0x861b24)),'elements':_0x2f9b6d};}['diffContent'](_0x5d78a9,_0x5ab9a0,_0x4ec00a,_0x5ad4ee=!0x1){const _0x16f7f7=[],_0x23c7d9=_0x5d78a9['data']['parse'](_0x4ec00a,'$documentFragment'),_0x526e4c=_0x5d78a9['data']['parse'](_0x5ab9a0,'$documentFragment'),_0x449dc9=_0x5d78a9['model']['createPositionAt'](_0x526e4c,0x0);if(this['_haveSingleTopLevelElement'](_0x23c7d9)){if(!this['_hasSameTopLevelElement'](_0x526e4c,_0x23c7d9))return _0x16f7f7;}else{const _0x27da24=_0x5d78a9['model']['schema'];if(!this['_haveOnlyInlineContent'](_0x526e4c,_0x27da24)||!this['_haveOnlyInlineContent'](_0x23c7d9,_0x27da24))return _0x16f7f7;}const _0x106576=this['context']['plugins']['get']('DocumentCompare')['getDiff'](_0x5ab9a0,_0x4ec00a,{'targetEditor':_0x5d78a9,'anchor':_0x449dc9,'markDeletions':!0x0})['getOperations']()['filter'](_0x2090cf=>'insert'===_0x2090cf['type']||'marker'===_0x2090cf['type']&&_0x2090cf['name']['startsWith']('$markedRemove')),_0x5bd87a=this['_groupAdjacentOperations'](_0x106576),_0x290ed8=[];if(_0x5ad4ee){if(_0x5bd87a['length']){const _0x39e6d0=_0x5bd87a[0x0]['operations'][0x0],_0x2602d3='insert'===_0x39e6d0['type']?_0x39e6d0['position']:_0x39e6d0['newRange']['start'],_0xa1d400=this['_getPositionLimitingRange'](_0x2602d3,_0x5d78a9,'inside'),_0x1b87f0=_0xa1d400?_0x23c7d9['getChild'](0x0)['getChildren']():_0x23c7d9['getChildren'](),_0x30af94=_0xa1d400||_0x5d78a9['model']['createRangeIn'](_0x526e4c),_0x3c3e04=[new _0x506cfe('$markedRemove:synthetic'+ot(),null,_0x30af94,_0x5d78a9['model']['document']['model']['markers'],!0x0,_0x5d78a9['model']['document']['version']+0x1),new _0x58e173(_0x30af94['end'],_0x1b87f0,_0x5d78a9['model']['document']['version']+0x2)];_0x290ed8['push']({'operations':_0x3c3e04,'operationsIsolated':_0x3c3e04,'groupOffset':0x0});}}else _0x290ed8['push'](..._0x5bd87a);let _0xe62a7=0x0;return _0x5d78a9['model']['change'](_0x18fada=>{for(let _0x292d11=0x0;_0x292d11<_0x290ed8['length'];_0x292d11++){const _0x439617=_0x290ed8[_0x292d11],_0xc95a=_0x18fada['createDocumentFragment']();for(const _0x555fe5 of _0x526e4c['getChildren']())_0x18fada['append'](_0x555fe5['_clone'](!0x0),_0xc95a);for(const _0x32a1ee of _0x439617['operationsIsolated'])if('insert'===_0x32a1ee['type']){const _0x5c56d3=_0x32a1ee;_0x5c56d3['baseVersion']=null,_0x5c56d3['isDocumentOperation']=!0x1,this['_changeOperationOwnerDocument'](_0x5c56d3,_0xc95a),_0x18fada['batch']['addOperation'](_0x32a1ee),_0x5d78a9['model']['applyOperation'](_0x32a1ee);const _0x5bb133='suggestion:insertion:id:authorId:'+_0xe62a7++,_0xfc2b39=_0x5d78a9['model']['createRange'](_0x5c56d3['position'],_0x5c56d3['position']['getShiftedBy'](_0x5c56d3['howMany']));_0xc95a['markers']['set'](_0x5bb133,_0xfc2b39);}else{if('marker'===_0x32a1ee['type']&&_0x32a1ee['name']['startsWith']('$markedRemove')){const _0x2e03cd=_0x32a1ee,_0x3e9080='suggestion:deletion:id:authorId:'+_0xe62a7++;this['_changeOperationOwnerDocument'](_0x2e03cd,_0xc95a),_0xc95a['markers']['set'](_0x3e9080,_0x2e03cd['newRange']);}}if(_0x5ad4ee)_0x16f7f7['push']({..._0x439617,'context':this['_createGetContentFn'](_0x526e4c,_0x5d78a9['data']),'content':this['_createGetContentFn'](_0x526e4c,_0x5d78a9['data'])});else{const _0x4763df=this['_getChangeContext'](this['_changePositionOwnerDocument'](this['_getOperationStart'](_0x439617['operationsIsolated'][0x0]),_0xc95a),this['_changePositionOwnerDocument'](this['_getOperationEnd'](_0x439617['operationsIsolated'][_0x439617['operationsIsolated']['length']-0x1]),_0xc95a),_0x5d78a9);_0xc95a['markers']['set'](Ta+'suggestion-context',new _0x28623e(_0x4763df['start'],_0x4763df['end'])),_0x16f7f7['push']({..._0x439617,'context':this['_createGetContextFn'](_0xc95a,_0x5d78a9['data'],{'ellipsisBefore':_0x4763df['hasContentBefore'],'ellipsisAfter':_0x4763df['hasContentAfter']}),'content':this['_createGetContentFn'](_0xc95a,_0x5d78a9['data'])});}}}),_0x16f7f7;}['markChangePositionInEditorContent'](_0x1c8d3a,_0x3fc15b){if(!_0x1c8d3a['length'])return;const _0x222d8d=_0x1c8d3a[0x0]['parent']['id'],_0x12427a=_0x3fc15b['elements']['get'](_0x222d8d);if(!_0x12427a)return void console['warn']('No\x20element\x20found\x20for\x20ID:\x20'+_0x222d8d);const _0x322622=_0x12427a['path'],_0x1dd334=_0x12427a['editor'],_0x2c4e3c=_0x1dd334['model']['document']['getRoot'](_0x12427a['rootName']);if(!_0x2c4e3c)return void console['warn']('No\x20model\x20root\x20found\x20for\x20name:\x20'+_0x12427a['rootName']);const _0x8aaac4=_0x1dd334['model']['document']['history']['getOperations'](_0x12427a['documentVersion']),_0x20e35b=[];for(const _0x108e9a of _0x1c8d3a){const _0x5db89b=_0x108e9a['operationsIsolated']['map'](_0x4dc575=>this['_translateOperationToEditorContent'](_0x4dc575,_0x322622,_0x2c4e3c));if(!_0x5db89b||!_0x5db89b['length'])continue;const _0x40d581=_0x5db89b['every'](_0x3bd78e=>'marker'===_0x3bd78e['type']&&_0x3bd78e['name']['startsWith']('$markedRemove')),_0x262739={'document':_0x1dd334['model']['document'],'useRelations':!0x1,'padWithNoOps':!0x1},_0x2d3284=_0x1b61b0(_0x5db89b,_0x8aaac4,_0x262739)['operationsA'];for(const _0x3b389e of _0x2d3284)if('insert'===_0x3b389e['type']){const _0x4d1f3e=_0x3b389e,_0x4336f9=_0x4d1f3e['nodes'];_0x1dd334['model']['change'](_0x5c9ae0=>{const _0x1b7ce6=_0x5c9ae0['createDocumentFragment']();for(const _0x1349ee of _0x4336f9)_0x5c9ae0['append'](_0x1349ee['_clone'](!0x0),_0x1b7ce6);_0x20e35b['push']({'start':_0x4d1f3e['position'],'end':_0x4d1f3e['position'],'type':'insert','groupId':_0x108e9a['id'],'content':{'asString':this['_createGetContentFn'](_0x1b7ce6,_0x1dd334['data'])(),'asFragment':_0x1b7ce6}});});}else{if('marker'===_0x3b389e['type']&&_0x3b389e['name']['startsWith']('$markedRemove')){const _0x240fc5=_0x3b389e;let _0x4d4808='remove-text';if(_0x40d581){const _0x3edd40=this['_findAdjacentContextDistance'](_0x240fc5['newRange']['start'],'backward',_0x1dd334['model']['schema']),_0x48fc2c=this['_findAdjacentContextDistance'](_0x240fc5['newRange']['end'],'forward',_0x1dd334['model']['schema']);if(_0x3edd40||_0x48fc2c){const _0x5a0dc8=_0x240fc5['newRange']['start']['getShiftedBy'](-_0x3edd40),_0x2fef33=_0x240fc5['newRange']['end']['getShiftedBy'](_0x48fc2c);_0x20e35b['push']({'start':_0x5a0dc8,'end':_0x2fef33,'groupId':_0x108e9a['id'],'type':'remove-context'});}else _0x4d4808='remove-only';}_0x20e35b['push']({'start':_0x240fc5['newRange']['start'],'end':_0x240fc5['newRange']['end'],'groupId':_0x108e9a['id'],'type':_0x4d4808});}}}this['_insertMarkers'](_0x20e35b,_0x1dd334);}['clearAllMarkers'](){const _0x456136=new Map();for(const _0x155457 of this['_markers']['keys']()){const _0x1e1d82=this['_markers']['get'](_0x155457);_0x1e1d82?.['editor']&&(_0x456136['has'](_0x1e1d82['editor'])||_0x456136['set'](_0x1e1d82['editor'],[]),_0x456136['get'](_0x1e1d82['editor'])['push'](_0x155457));}for(const [_0x9ae6f7,_0x3865c3]of _0x456136)_0x9ae6f7['model']['change'](_0x24abcf=>{for(const _0x3b8ecd of _0x3865c3)_0x9ae6f7['model']['markers']['get'](_0x3b8ecd)&&_0x24abcf['removeMarker'](_0x3b8ecd);});this['_markers']['clear'](),this['_activeMarkers']['clear']();}['switchToReadOnly'](){for(const _0x54a807 of Ws(this['context']))_0x54a807['enableReadOnlyMode']('ai-review');}['switchToEdit'](){for(const _0x47e527 of Ws(this['context']))_0x47e527['disableReadOnlyMode']('ai-review');}['applyChange'](_0x5609a1){const _0x5009be=_0x5609a1['map'](_0x18eb6c=>this['_getMarkersDataForGroup'](_0x18eb6c))['flat'](),_0x21cd98=new Map();for(const _0x286ee3 of _0x5009be)_0x21cd98['has'](_0x286ee3['editor'])||_0x21cd98['set'](_0x286ee3['editor'],[]),_0x21cd98['get'](_0x286ee3['editor'])['push'](_0x286ee3);for(const [_0x42d58b,_0x1044ae]of _0x21cd98){const _0x1cc025=_0x42d58b['model'];_0x1cc025['change'](_0x31f7c6=>{for(const _0x2731fc of _0x1044ae){const _0x328699=_0x42d58b['model']['markers']['get'](_0x2731fc['id']);if(_0x328699){if('insert'===_0x2731fc['type']){if(!_0x2731fc['content'])continue;_0x1cc025['insertContent'](_0x2731fc['content']['asFragment']||null,_0x328699['getRange']()['start']);}else'remove-text'!==_0x2731fc['type']&&'remove-only'!==_0x2731fc['type']||_0x1cc025['deleteContent'](_0x1cc025['createSelection'](_0x328699['getRange']()));_0x31f7c6['removeMarker'](_0x2731fc['id']),this['_markers']['delete'](_0x2731fc['id']);}}});}}['rejectChange'](_0x1ba652){const _0x4cb1c5=this['_getMarkersDataForGroup'](_0x1ba652),_0x4b75c1=new Map();for(const _0x14513e of _0x4cb1c5)_0x4b75c1['has'](_0x14513e['editor'])||_0x4b75c1['set'](_0x14513e['editor'],[]),_0x4b75c1['get'](_0x14513e['editor'])['push'](_0x14513e);for(const [_0x7b90a3,_0x5e0bce]of _0x4b75c1)_0x7b90a3['model']['change'](_0x5e9e51=>{for(const _0x1f2601 of _0x5e0bce)_0x5e9e51['removeMarker'](_0x1f2601['id']),this['_markers']['delete'](_0x1f2601['id']);});}['getEditor'](){return $s(this['context']);}['getEditors'](){return Ws(this['context']);}['getEditorForChange'](_0x509fae){const _0xeee4e3=this['_getMarkersDataForGroup'](_0x509fae);return _0xeee4e3[0x0]?.['editor'];}['getMarkerElementForChange'](_0x3245d4){const _0x34ccde=Array['from'](this['_markers']['values']())['filter'](_0x204822=>_0x204822['groupId']===_0x3245d4);if(!_0x34ccde['length'])return null;const _0x58ec87=0x1===_0x34ccde['length']?_0x34ccde[0x0]:this['_sortMarkers'](_0x34ccde)[0x0],_0x1420e6=_0x58ec87['editor']['model']['markers']['get'](_0x58ec87['id']);if(!_0x1420e6)return null;return{'modelRange':_0x1420e6['getRange'](),'getElement':()=>this['_findMarkerElementById'](_0x58ec87['id'])};}['getContentElementForChange'](_0x19a615){const _0x2af0ec=Array['from'](this['_markers']['values']())['filter'](_0x47282d=>_0x47282d['groupId']===_0x19a615);if(!_0x2af0ec['length'])return null;const _0x22610f=0x1===_0x2af0ec['length']?_0x2af0ec[0x0]:this['_sortMarkers'](_0x2af0ec)[0x0],_0x2a6e84=_0x22610f['editor'],_0x3fc516=_0x2a6e84['model']['markers']['get'](_0x22610f['id']);if(!_0x3fc516)return null;const _0x5abde2=_0x3fc516['getRange'](),_0x44772a=_0x2a6e84['editing']['view']['getDomRoot'](_0x5abde2['root']['rootName'])||_0x2a6e84['editing']['view']['getDomRoot']();if(!_0x44772a||!_0x5abde2)return null;let _0x576abc=_0x5abde2['start']['parent'];for(;_0x576abc['parent']&&'$root'!==_0x576abc['parent']['name'];)_0x576abc=_0x576abc['parent'];if(!_0x576abc||!_0x576abc['name'])return null;const _0x542842=_0x44772a['querySelector']('[data-marker-id=\x22'+_0x22610f['id']+'\x22]');if(!_0x542842)return null;let _0x2ecd52=null;_0x2a6e84['model']['change'](_0x5812d5=>{_0x2ecd52=_0x5812d5['createDocumentFragment'](),_0x5812d5['append'](_0x576abc['_clone'](!0x0),_0x2ecd52);});const _0x40ceb6=_0x2a6e84['data']['toView'](_0x2ecd52)['getChild'](0x0);return _0x542842['closest'](_0x40ceb6['name']);}['reactivateMarkers'](_0x132a0b){const _0x198165=this['_getMarkersDataForGroup'](_0x132a0b);if(!_0x198165['length'])return;const _0x2078f9=Array['from'](this['_activeMarkers'])['sort'](),_0x3c3da2=Array['from'](new Set(_0x198165['map'](_0x4539eb=>_0x4539eb['id'])))['sort']();_0x2078f9['join']('|')!==_0x3c3da2['join']('|')&&(this['setAllMarkersAsInactive'](),this['setMarkersInElementAsActive'](_0x132a0b));}['setMarkersInElementAsActive'](_0x372469){const _0x334177=this['_getMarkersDataForGroup'](_0x372469);if(!_0x334177['length'])return;const _0x338e66=_0x334177[0x0]['editor'],_0x5175f7=new Set(_0x334177['map'](_0xa5779f=>_0xa5779f['id'])),_0x5089f3=Array['from'](_0x5175f7['values']())['map'](_0x58092c=>_0x338e66['model']['markers']['get'](_0x58092c))['filter'](_0x3c5e02=>!!_0x3c5e02);_0x5175f7['forEach'](_0xa81e63=>{this['_activeMarkers']['add'](_0xa81e63);}),_0x338e66['model']['change'](()=>{_0x5089f3['forEach'](_0xf0db87=>{_0x338e66['editing']['reconvertMarker'](_0xf0db87);});});}['setAllMarkersAsInactive'](){const _0x5aa932=Array['from'](this['_activeMarkers']);if(!_0x5aa932['length'])return;this['_activeMarkers']['clear']();const _0x4ff2b8=new Map();for(const _0x46d04f of _0x5aa932){const _0x5229db=this['_markers']['get'](_0x46d04f);if(!_0x5229db)continue;const _0xcf199a=_0x5229db['editor'],_0x1d7130=_0xcf199a['model']['markers']['get'](_0x46d04f);_0x1d7130&&(_0x4ff2b8['has'](_0xcf199a)||_0x4ff2b8['set'](_0xcf199a,[]),_0x4ff2b8['get'](_0xcf199a)['push'](_0x1d7130));}for(const [_0x17ee11,_0x3d6695]of _0x4ff2b8)_0x17ee11['model']['change'](()=>{_0x3d6695['forEach'](_0x26b3b5=>{_0x17ee11['editing']['reconvertMarker'](_0x26b3b5);});});}['_getPositionLimitingRange'](_0x48e7bc,_0x3fa76a,_0x24618e='outside'){if(!_0x48e7bc)return null;let _0x1c3096=_0x48e7bc['parent'];for(;_0x1c3096&&_0x1c3096['parent']&&'$root'!==_0x1c3096['parent']['name']&&!_0x3fa76a['model']['schema']['isLimit'](_0x1c3096)&&!_0x3fa76a['model']['schema']['isBlock'](_0x1c3096);)_0x1c3096=_0x1c3096['parent'];if(!_0x1c3096||!_0x1c3096['name']||'$root'===_0x1c3096['name'])return null;let _0x5902de=null;return _0x3fa76a['model']['change'](_0x1a6e06=>{_0x5902de='inside'===_0x24618e?_0x1a6e06['createRangeIn'](_0x1c3096):_0x1a6e06['createRangeOn'](_0x1c3096);}),_0x5902de;}['_validateMarkers'](_0x1f4693,_0x4d4037){const _0xfaf08a=Array['from'](this['_markers']['keys']()),_0x46ec71=new Map();for(const _0x336f44 of _0xfaf08a){const _0x22ed1e=_0x1f4693['model']['markers']['get'](_0x336f44);if(!_0x22ed1e)continue;const _0x32b6bc=_0x22ed1e['getStart']()['root']['rootName']+':'+_0x22ed1e['getStart']()['path'][0x0];_0x46ec71['has'](_0x32b6bc)||_0x46ec71['set'](_0x32b6bc,[]),_0x46ec71['get'](_0x32b6bc)['push'](_0x22ed1e);}const _0x4ee425=new Set();for(const _0x303226 of _0x1f4693['model']['document']['differ']['getChanges']()){let _0x4399f7='',_0x34a7f7=null;if('insert'===_0x303226['type'])_0x34a7f7=new _0x28623e(_0x303226['position'],_0x303226['position']['getShiftedBy'](_0x303226['length'])),_0x4399f7=_0x303226['position']['root']['rootName']+':'+_0x303226['position']['path'][0x0];else{if('remove'!==_0x303226['type'])continue;_0x34a7f7=new _0x28623e(_0x303226['position']),_0x4399f7=_0x303226['position']['root']['rootName']+':'+_0x303226['position']['path'][0x0];}const _0xa0abe7=_0x46ec71['get'](_0x4399f7)||[];if(_0xa0abe7['length']){for(const _0x5d5c98 of _0xa0abe7)if(_0x34a7f7['root']['rootName']===_0x5d5c98['getRange']()['root']['rootName']&&('insert'!==_0x303226['type']||!_0x34a7f7['containsRange'](_0x5d5c98['getRange']()))&&(_0x34a7f7['isIntersecting'](_0x5d5c98['getRange']())||_0x34a7f7['start']['isTouching'](_0x5d5c98['getRange']()['end'])||_0x34a7f7['end']['isTouching'](_0x5d5c98['getRange']()['start']))){const _0x32abbd=this['_parseMarkerName'](_0x5d5c98['name']);Array['from'](this['_markers']['values']())['filter'](_0x1054c8=>_0x1054c8['groupId']===_0x32abbd['groupId'])['forEach'](_0x466546=>_0x4ee425['add'](_0x466546['id']));}}}if(_0x4ee425['size']){for(const _0x27198c of _0x4ee425)_0x4d4037['removeMarker'](_0x27198c);return!0x0;}return!0x1;}['_handleMarkerChanges'](_0x158ea1){for(const {name:_0x4c5271,data:_0x30c9b7}of _0x158ea1['model']['document']['differ']['getChangedMarkers']()){if(!_0x4c5271['startsWith'](Ta))continue;const _0x51098f=_0x30c9b7['oldRange'],_0x11477b=_0x30c9b7['newRange'],_0xaaa034=_0x51098f&&'$graveyard'===_0x51098f['root']['rootName'],_0x4ae304=_0x11477b&&'$graveyard'===_0x11477b['root']['rootName'];if(_0xaaa034&&_0x4ae304)continue;const _0xebe37b=this['_parseMarkerName'](_0x4c5271);this['_markers']['get'](_0x4c5271)&&(_0x4ae304||!_0x11477b?this['_eventEmitter']['fire']('changeMarkerRemoved',{'markerId':_0x4c5271,'changeId':_0xebe37b['groupId']}):_0xaaa034&&_0x11477b&&this['_eventEmitter']['fire']('changeMarkerRestored',{'markerId':_0x4c5271,'changeId':_0xebe37b['groupId']}));}}['_parseMarkerName'](_0x28858e){const _0x24548e=_0x28858e['split'](':'),_0x459b2d=(_0x24548e[0x1]||'')['split']('_');return{'prefix':_0x24548e[0x0],'groupId':_0x459b2d[0x0],'suffix':_0x459b2d[0x1]};}['_translateOperationToEditorContent'](_0x1dd947,_0x141989,_0x4bb851){if('insert'===_0x1dd947['type']){const _0x4920a7=_0x1dd947;return new _0x58e173(this['_changePosition'](_0x141989['concat'](_0x4920a7['position']['offset']),_0x4bb851),_0x4920a7['nodes'],_0x4920a7['baseVersion']);}if('marker'===_0x1dd947['type']&&_0x1dd947['name']['startsWith']('$markedRemove')){const _0x5bd8c3=_0x1dd947;return new _0x506cfe(_0x5bd8c3['name'],_0x5bd8c3['oldRange'],this['_changeRange'](_0x5bd8c3['newRange'],_0x141989['concat'](_0x5bd8c3['newRange']['start']['offset']),_0x141989['concat'](_0x5bd8c3['newRange']['end']['offset']),_0x4bb851),_0x5bd8c3['_markers'],_0x5bd8c3['affectsData'],_0x5bd8c3['baseVersion']);}return _0x1dd947;}['_groupAdjacentOperations'](_0x205a8a){if(!_0x205a8a['length'])return[];const _0x3c9993=[];let _0x5d194e=0x0,_0x2cce7e=0x0,_0x2a1bd4=[];for(let _0x1ca1f9=0x0;_0x1ca1f9<=_0x205a8a['length'];_0x1ca1f9++){const _0x4ba531=_0x205a8a[_0x1ca1f9],_0x6962a1=_0x205a8a[_0x1ca1f9-0x1];!_0x4ba531||_0x6962a1&&!this['_getOperationEnd'](_0x6962a1)['isTouching'](this['_getOperationStart'](_0x4ba531))?(_0x3c9993['push']({'operations':_0x2a1bd4,'operationsIsolated':_0x2a1bd4['map'](_0x193277=>this['_shiftOperation'](_0x193277['clone'](),-_0x2cce7e)),'groupOffset':_0x5d194e}),_0x2a1bd4=_0x4ba531?[_0x4ba531]:[],_0x2cce7e+=_0x5d194e,_0x5d194e=0x0):_0x2a1bd4['push'](_0x4ba531),_0x4ba531&&'insert'===_0x4ba531['type']&&(_0x5d194e+=_0x4ba531['howMany']);}return _0x3c9993;}['_findAdjacentContextDistance'](_0x581194,_0x1231d4,_0x3d3b21,_0x25d3d7=0x1){const _0x5bac03=new _0x50dc86({'startPosition':_0x581194,'direction':_0x1231d4});let _0x45fa3f=0x0;for(let _0x3f6fed=0x0;_0x3f6fed<_0x25d3d7;_0x3f6fed++){let _0x34855f=0x0,_0x547687=!0x1,_0x412dfd='forward'===_0x1231d4?/^\W*\w+/:/\w+\W*$/;for(const {item:_0x59f2be}of _0x5bac03)if(_0x59f2be['is']('$textProxy')){const _0xcfadbc=_0x412dfd['exec'](_0x59f2be['data']);if(_0xcfadbc&&_0xcfadbc['length']){if(_0x34855f+='forward'===_0x1231d4?_0xcfadbc['index']+_0xcfadbc[0x0]['length']:_0x59f2be['data']['length']-_0xcfadbc['index'],_0xcfadbc[0x0]['length']!==_0x59f2be['data']['length'])break;_0x547687=!0x0,_0x412dfd='forward'===_0x1231d4?/^\w+/:/\w+$/;}else{if(_0x547687)break;_0x34855f+=_0x59f2be['offsetSize'];}}else{if(_0x59f2be['is']('element')){_0x3d3b21['isInline'](_0x59f2be)&&!_0x547687&&(_0x34855f+=0x1);break;}}_0x45fa3f+=_0x34855f,_0x5bac03['jumpTo'](_0x581194['getShiftedBy']('forward'===_0x1231d4?_0x45fa3f:-_0x45fa3f));}return _0x45fa3f;}['_getChangeContext'](_0x980e1,_0x24063a,_0x46ca3c){const _0x3837ff=_0x46ca3c['model']['schema'],_0xd70cb=this['_findAdjacentContextDistance'](_0x980e1,'backward',_0x3837ff,0x6),_0xacb5e=this['_findAdjacentContextDistance'](_0x24063a,'forward',_0x3837ff,0x6),_0x219384=_0x980e1['getShiftedBy'](-_0xd70cb),_0xb384b6=_0x24063a['getShiftedBy'](_0xacb5e);return{'start':_0x219384,'end':_0xb384b6,'hasContentBefore':!_0x219384['isAtStart'],'hasContentAfter':!_0xb384b6['isAtEnd']};}['_insertMarkers'](_0x1507d2,_0x4d08d7){const _0x3e2b1=this['context']['plugins']['get']('AIEditing'),_0x45c04e=new Set();_0x4d08d7['model']['change'](_0xa82d03=>{for(const _0x3e9ecd of _0x1507d2){const _0x5eff78=''+Ta+_0x3e9ecd['type']+':'+_0x3e9ecd['groupId']+'_'+_0x3e2b1['_nextDataId'](_0x45c04e);this['_markers']['set'](_0x5eff78,{'id':_0x5eff78,'groupId':_0x3e9ecd['groupId'],'type':_0x3e9ecd['type'],'content':_0x3e9ecd['content'],'editor':_0x4d08d7}),_0xa82d03['addMarker'](_0x5eff78,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0xa82d03['createRange'](_0x3e9ecd['start'],_0x3e9ecd['end'])});}});}['_createGetContextFn'](_0x30e1a9,_0x40d88f,_0x2900f1){let _0x1ec39b='';return()=>{if(!_0x1ec39b){const _0x367df3=_0x40d88f['toView'](_0x30e1a9,{'showSuggestionHighlights':!0x0});let _0x44b926=_0x367df3['getChild'](0x0);if(_0x44b926['is']('containerElement')||(_0x44b926=_0x367df3),!_0x44b926)return'';let _0x1bfd84=!0x1;const _0x50833c=[];for(const _0x584135 of _0x44b926['getChildren']())_0x584135['is']('element','span')&&_0x584135['hasClass']('ck-ai_review-marker_context-end')&&(_0x1bfd84=!0x1),_0x1bfd84&&_0x50833c['push'](_0x584135),_0x584135['is']('element','span')&&_0x584135['hasClass']('ck-ai_review-marker_context-start')&&(_0x1bfd84=!0x0);_0x44b926['_removeChildren'](0x0,_0x44b926['childCount']),_0x2900f1?.['ellipsisBefore']&&_0x44b926['_appendChild']('…'),_0x44b926['_appendChild'](_0x50833c),_0x2900f1?.['ellipsisAfter']&&_0x44b926['_appendChild']('…');const _0x2fe51e=_0x40d88f['htmlProcessor']['domConverter']['viewToDom'](_0x367df3),_0x5ec6fe=_0x40d88f['htmlProcessor']['htmlWriter']['getHtml'](_0x2fe51e);_0x1ec39b=_0x5ec6fe;}return _0x1ec39b;};}['_createGetContentFn'](_0x11632e,_0x11e2aa){let _0x23da2e='';return()=>(_0x23da2e||(_0x23da2e=_0x11e2aa['stringify'](_0x11632e,{'showSuggestionHighlights':!0x0})),_0x23da2e);}['_createGetContentUsingDataIdFn'](_0x284221,_0x41d663,_0x4fa26c){let _0x4ca403='';return()=>{if(!_0x4ca403){const _0x422b49=_0x4fa26c['toView'](new _0x49b7d4(_0x284221)),_0x396ebb=_0x4fa26c['htmlProcessor']['domConverter']['viewToDom'](_0x422b49)['querySelector']('[data-id=\x22'+_0x41d663+'\x22]');_0x4ca403=_0x396ebb?.['outerHTML']||'';}return _0x4ca403;};}['_findMarkerElement'](_0x12b9a8,_0x235bbc=0x5){let _0x29bb3b=_0x12b9a8,_0x18ea73=null;for(let _0x35cd96=0x0;_0x35cd96<_0x235bbc&&_0x29bb3b;_0x35cd96++){if(!_0x29bb3b['className']){_0x29bb3b=_0x29bb3b['parentElement'];continue;}if(!(''+_0x29bb3b['className'])['includes']('ck-ai_review-marker_')){_0x29bb3b=_0x29bb3b['parentElement'];continue;}if(!_0x29bb3b['getAttribute']('data-marker-id'))break;_0x18ea73=_0x29bb3b;break;}return _0x18ea73;}['_findMarkerElementById'](_0x460e60){const _0x151764=this['_markers']['get'](_0x460e60),_0x351323=_0x151764?.['editor']??$s(this['context']),_0x410558=_0x351323['model']['markers']['get'](_0x460e60);return _0x410558?_0x59016c(_0x351323['editing'],_0x410558):null;}['_getMarkersDataForGroup'](_0x5d1c09){return Array['from'](this['_markers']['values']())['filter'](_0x1eb1a7=>_0x1eb1a7['groupId']===_0x5d1c09);}['_getOperationStart'](_0x4d781f){return'insert'===_0x4d781f['type']?_0x4d781f['position']:_0x4d781f['newRange']['start'];}['_getOperationEnd'](_0x327f34,_0x311bdf=!0x1){return'insert'===_0x327f34['type']?_0x311bdf?_0x327f34['position']:_0x327f34['position']['getShiftedBy'](_0x327f34['howMany']):_0x327f34['newRange']['end'];}['_shiftOperation'](_0x5f2b1e,_0x4fc470){return'insert'===_0x5f2b1e['type']?_0x5f2b1e['position']=_0x5f2b1e['position']['getShiftedBy'](_0x4fc470):'marker'===_0x5f2b1e['type']&&_0x5f2b1e['newRange']&&(_0x5f2b1e['newRange']=new _0x28623e(_0x5f2b1e['newRange']['start']['getShiftedBy'](_0x4fc470),_0x5f2b1e['newRange']['end']['getShiftedBy'](_0x4fc470))),_0x5f2b1e;}['_changeOperationOwnerDocument'](_0x3e0fc4,_0x1a18fb){'insert'===_0x3e0fc4['type']?_0x3e0fc4['position']=this['_changePositionOwnerDocument'](_0x3e0fc4['position'],_0x1a18fb):'marker'===_0x3e0fc4['type']&&_0x3e0fc4['newRange']&&(_0x3e0fc4['newRange']=this['_changeRangeOwnerDocument'](_0x3e0fc4['newRange'],_0x1a18fb));}['_changePositionOwnerDocument'](_0xd8d790,_0x502a87){return new _0x1133b3(_0x502a87,_0xd8d790['path']);}['_changeRangeOwnerDocument'](_0x1ad713,_0x5005d4){return new _0x28623e(this['_changePositionOwnerDocument'](_0x1ad713['start'],_0x5005d4),this['_changePositionOwnerDocument'](_0x1ad713['end'],_0x5005d4));}['_changePosition'](_0x395d56,_0x5ce217){return new _0x1133b3(_0x5ce217,[..._0x395d56]);}['_changeRange'](_0x3bcd93,_0x16bde0,_0x3015da,_0x4d05be){return new _0x28623e(this['_changePosition'](_0x16bde0,_0x4d05be),this['_changePosition'](_0x3015da,_0x4d05be));}['_sortMarkers'](_0x7ab782){const _0xb78b41=_0xf00d74=>{switch(_0xf00d74){case'insert':return 0x0;case'remove-context':return 0x1;case'remove-only':return 0x2;case'remove-text':return 0x3;}};return _0x7ab782['sort']((_0x5c529e,_0x5e4f22)=>_0xb78b41(_0x5c529e['type'])-_0xb78b41(_0x5e4f22['type']));}['_hasSameTopLevelElement'](_0x474d91,_0x12595c){const _0x46f5a1=_0x474d91['getChild'](0x0),_0x587868=_0x12595c['getChild'](0x0);return!(!_0x46f5a1||!_0x587868)&&((!_0x46f5a1['is']('element')||!_0x587868['is']('element')||_0x46f5a1['name']===_0x587868['name'])&&!(_0x46f5a1['is']('element')&&!_0x587868['is']('element')||!_0x46f5a1['is']('element')&&_0x587868['is']('element')));}['_haveSingleTopLevelElement'](_0x1ca380){return 0x1===_0x1ca380['childCount'];}['_haveOnlyInlineContent'](_0x54cb38,_0x21f835){for(const _0x5ef22d of _0x54cb38['getChildren']())if(_0x5ef22d['is']('element')&&!_0x21f835['isInline'](_0x5ef22d))return!0x1;return!0x0;}['_upsertDataId'](_0x4457a5,_0x39b214){let _0x2b3f55=_0x4457a5['getAttribute'](_0x522952);return _0x2b3f55||(_0x2b3f55=_0x39b214(),_0x4457a5['_setAttribute'](_0x522952,_0x2b3f55)),_0x2b3f55;}}class fa extends Tt(){['id'];['contentNew'];['contentInitial'];['documentVersion'];constructor({id:_0x186e38,contentNew:_0x4f2b8f,contentInitial:_0xadf03,documentVersion:_0x35c64f}){super(),this['id']=_0x186e38,this['contentNew']=_0x4f2b8f,this['contentInitial']=_0xadf03,this['documentVersion']=_0x35c64f;}}class ba extends ht(){['id'];['parent'];['_data'];['_editorOperations']=[];constructor(_0x46131b,_0x2a7bdb,_0x147715){super(),this['id']=_0x46131b,this['parent']=_0x147715,this['_data']=_0x2a7bdb,this['set']('isActivated',!0x1),this['set']('isRated',!0x1),this['set']('status','pending'),this['on']('change:status',()=>{'pending'!==this['status']&&this['isActivated']&&(this['isActivated']=!0x1);});}get['contentDiffed'](){return this['_data']['context']();}get['operations'](){return this['_data']['operations'];}get['operationsIsolated'](){return this['_data']['operationsIsolated'];}}class Sa extends ht(){['id']=ot();['callId'];['_results']=new Map();['_changes']=[];['_sourceCheck'];['_documentData'];['_aiConnector'];['_reviewParams'];['_reviewArgs'];['_activeRequest']=null;['_currentError'];['_wasAborted']=!0x1;constructor(_0x2545e4,_0x392767,_0x5be001,_0x352bf3,_0x5c0eca){super(),this['_sourceCheck']=_0x392767,this['_documentData']=_0x2545e4,this['_aiConnector']=_0x5be001,this['_reviewParams']=_0x352bf3,this['_reviewArgs']=_0x5c0eca,this['on']('change:status',(_0x14d7b7,_0x2095f8,_0x4ea049)=>{'aborted'==_0x4ea049&&(this['_wasAborted']=!0x0),this['fire']('reviewCheckRunUpdated',{'status':_0x4ea049,'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'](_0x2fc41a=>'pending'===_0x2fc41a['status']);}get['currentError'](){return this['_currentError'];}['updateDocumentData'](_0x130c08){this['_documentData']=_0x130c08;}async['start'](){this['status']='loading',this['_currentError']=void 0x0;try{this['_activeRequest']=this['_createApiRequest']();const _0x26f6f2=await this['_activeRequest']['getStream']();this['status']='data';for await(const _0x17b2a2 of _0x26f6f2)'unmodified'!==_0x17b2a2['data']['operation']&&('error'!==_0x17b2a2['data']['operation']?'review-metadata'!==_0x17b2a2['event']?this['_addReviewCheckResult'](_0x17b2a2['data']['dataId'],_0x17b2a2['data']['textDelta']):this['callId']=_0x17b2a2['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(_0x30f0fc){this['_currentError']=_0x30f0fc,_0x30f0fc instanceof Error&&_0x30f0fc['message']['includes']('ai-request-aborted')?this['status']='aborted':this['status']='error-general';}finally{this['_activeRequest']=null;}}async['restart'](){this['_results']['clear'](),this['_changes']['length']=0x0,this['_currentError']=void 0x0,await this['start']();}['addResultChanges'](_0xe1459d,_0x19e9be){const _0x4f2f59=this['_results']['get'](_0xe1459d);if(!_0x4f2f59)return;if(0x0===_0x19e9be['length'])return;const _0x1705eb=[];_0x19e9be['forEach']((_0x1d4626,_0x2d8bd4)=>{const _0x7e1aec=new ba(_0x4f2f59['id']+'-'+_0x2d8bd4,_0x1d4626,_0x4f2f59);_0x7e1aec['on']('change:status',()=>{this['fire']('reviewCheckResultChangeStatusUpdated',{'change':_0x7e1aec,'status':_0x7e1aec['status']});}),_0x7e1aec['on']('change:isActivated',()=>{_0x7e1aec['isActivated']?this['fire']('reviewCheckResultActivated',{'change':_0x7e1aec}):this['fire']('reviewCheckResultDeactivated',{'change':_0x7e1aec});}),this['_changes']['push'](_0x7e1aec),_0x1705eb['push'](_0x7e1aec);}),this['fire']('reviewCheckResultReady',{'changes':_0x1705eb,'result':_0x4f2f59,'source':this});}['abort'](){this['_activeRequest']&&(this['_activeRequest']['abortController']['abort'](),this['_activeRequest']=null,this['status']='aborted');}['isChangeActive'](_0x5aa7ef){const _0x17c3fa=this['_changes']['find'](_0x4ed9f5=>_0x4ed9f5['id']===_0x5aa7ef);return!(!_0x17c3fa||'pending'!==_0x17c3fa['status']);}['isAnyChangeActivated'](){return this['_changes']['some'](_0x20d6d4=>!0x0===_0x20d6d4['isActivated']);}['getActiveChanges'](){return this['_changes']['filter'](_0x421d8f=>'pending'===_0x421d8f['status']);}['getChangeById'](_0x4d324f){return this['_changes']['find'](_0x2d2a2f=>_0x2d2a2f['id']===_0x4d324f);}['markAllChangesAsAccepted'](){for(const _0x363776 of this['_changes'])'pending'===_0x363776['status']&&(_0x363776['status']='accepted');this['_checkIfFinished']();}['markChangeAsAccepted'](_0x43308c){const _0x1cb9c1=this['_changes']['find'](_0x4a42a0=>_0x4a42a0['id']===_0x43308c);_0x1cb9c1&&'pending'===_0x1cb9c1['status']&&(_0x1cb9c1['status']='accepted'),this['_checkIfFinished']();}['markChangeAsRejected'](_0x4e0691){const _0x242c03=this['_changes']['find'](_0x222b06=>_0x222b06['id']===_0x4e0691);_0x242c03&&'pending'===_0x242c03['status']&&(_0x242c03['status']='rejected'),this['_checkIfFinished']();}['markChangeAsOutdated'](_0x5f0d84){const _0x3ef507=this['_changes']['find'](_0x4b354f=>_0x4b354f['id']===_0x5f0d84);_0x3ef507&&'pending'===_0x3ef507['status']&&(_0x3ef507['status']='outdated'),this['_checkIfFinished']();}['markChangeAsPending'](_0x4a5f13){const _0x4678ac=this['_changes']['find'](_0x125e09=>_0x125e09['id']===_0x4a5f13);_0x4678ac&&'outdated'===_0x4678ac['status']&&(_0x4678ac['status']='pending'),this['_checkIfFinished']();}['activateChange'](_0x1848cf){this['_changes']['filter'](_0x414d66=>_0x414d66['isActivated']&&_0x414d66['id']!==_0x1848cf)['forEach'](_0x30189d=>{_0x30189d['isActivated']=!0x1;});const _0x2a53d2=this['_changes']['find'](_0x558819=>_0x558819['id']===_0x1848cf);_0x2a53d2&&'pending'===_0x2a53d2['status']&&(_0x2a53d2['isActivated']=!0x0);}['deactivateChange'](){this['_changes']['filter'](_0x1d44ea=>_0x1d44ea['isActivated'])['forEach'](_0x1652f2=>{_0x1652f2['isActivated']=!0x1;});}['forceReadyState'](){this['status']='ready';}async['sendRating'](_0x29255e){if('initialized'===this['status']||'loading'===this['status']||'data'===this['status']||this['_wasAborted'])return;if(!this['callId']||0x0===this['_changes']['length'])return;let _0x2a253b;if(_0x29255e){const _0x4aad15=this['_changes']['find'](_0x1c40b5=>_0x1c40b5['id']===_0x29255e);if(_0x4aad15&&_0x4aad15['isRated'])return;_0x4aad15&&(_0x2a253b=_0x4aad15['parent']['id'],_0x4aad15['isRated']=!0x0);}const _0x326b4a={'positiveCount':this['_changes']['filter'](_0xf7c44=>'accepted'===_0xf7c44['status'])['length'],'totalCount':this['_changes']['length']};this['_sendRatingRequest'](_0x326b4a,this['callId'],_0x2a253b);}['_addReviewCheckResult'](_0x4b5a27,_0xce620a){const _0x471bd5=this['_documentData']['elements']['get'](_0x4b5a27);if(!_0x471bd5)return;const _0x2d289e=_0x471bd5['getContent']();if(_0x2d289e===_0xce620a)return;const _0x479cb7=new fa({'id':_0x4b5a27,'contentInitial':_0x2d289e,'contentNew':_0xce620a,'documentVersion':_0x471bd5['documentVersion']});this['_results']['set'](_0x479cb7['id'],_0x479cb7),this['fire']('reviewCheckResultAdded',{'result':_0x479cb7,'source':this,'editor':_0x471bd5['editor']});}['_checkIfFinished'](){'finished'===this['status']&&(this['_changes']['filter'](_0x4ee149=>'pending'===_0x4ee149['status'])['length']>0x0&&(this['status']='ready')),'ready'===this['status']&&(0x0===this['_changes']['filter'](_0x43b33b=>'pending'===_0x43b33b['status'])['length']&&(this['status']='finished'));}}class Ra extends Sa{get['subTitle'](){if(!this['_reviewParams']||0x0===this['_reviewParams']['length'])return'';const _0x3196d4=[];if(this['_reviewParams']['length']>0x0&&this['_sourceCheck']['options'])for(let _0xc47125=0x0;_0xc47125<this['_reviewParams']['length'];_0xc47125++){if(!this['_reviewParams'][_0xc47125]||!this['_sourceCheck']['options'][_0xc47125])continue;const _0x4ca9bb=this['_sourceCheck']['options'][_0xc47125],_0x19ae20=_0x4ca9bb['data']?.['find'](_0x3c3adb=>_0x3c3adb['id']===this['_reviewParams'][_0xc47125]);_0x19ae20&&_0x3196d4['push'](_0x19ae20['label']);}return _0x3196d4['join'](',\x20');}get['reviewName'](){return this['_composeReviewName']();}['_createApiRequest'](){return this['_aiConnector']['callSystemReview']({'reviewName':this['_composeReviewName'](),'content':this['_documentData']['content'],'args':this['_reviewArgs']});}['_sendRatingRequest'](_0x6e1464,_0x19db2a,_0x43ae0a){return this['_aiConnector']['upsertAIReviewRating'](this['reviewName'],_0x19db2a,_0x6e1464,_0x43ae0a);}['_composeReviewName'](){return!this['_reviewParams']||0x0===this['_reviewParams']['length']||this['_sourceCheck']['useArgs']?this['_sourceCheck']['apiId']:[this['_sourceCheck']['apiId'],...this['_reviewParams']]['join']('-');}}class Oa extends _0x203d97{['_aiConnector'];['_aiReviewCoreUi'];['_aiReviewCoreEditing'];['_aiReviewCheckList'];['_currentReviewCheckRun'];['_changeActivationSource']=null;static get['requires'](){return[as];}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}async['init'](){this['_initRequiredPlugins'](),this['_aiReviewCheckList']=await this['_getChecksList'](),this['listenTo'](this['_aiReviewCoreUi'],'getReviewCheckList',()=>{this['_aiReviewCoreUi']['setAvailableChecks'](this['_aiReviewCheckList']['checks']);}),this['listenTo'](this['_aiReviewCoreUi'],'runReviewCheck',async(_0x4a7e82,_0x4ea37d)=>{const _0x168500=this['_aiReviewCheckList']['getCheckById'](_0x4ea37d['id']);if(_0x168500){this['_onReviewCheckRun'](_0x4ea37d),this['_aiReviewCoreEditing']['switchToReadOnly'](),this['_currentReviewCheckRun']=this['_createReviewCheckRun'](_0x4ea37d,_0x168500),this['_aiReviewCoreUi']['setCheckResultTitle'](this['_currentReviewCheckRun']['title'],this['_currentReviewCheckRun']['subTitle']),this['_currentReviewCheckRun']['on']('reviewCheckRunUpdated',(_0x30a133,_0x11406e)=>{switch(_0x11406e['status']){case'data':case'loading':this['_aiReviewCoreUi']['showCheckRunResults'](_0x11406e);break;case'finished':this['_onCheckRunFinished']();break;case'ready':this['_aiReviewCoreUi']['showActionsWhenResultIsReady']();break;case'unmodified':this['_aiReviewCoreUi']['showNoChangesView']();break;case'error-general':this['_aiReviewCoreUi']['showGeneralResultsErrorView'](),this['_logError'](new at('ai-review-mode-check-run-general-error',this,void 0x0,this['_currentReviewCheckRun']?.['currentError']));break;case'error-chunk':this['_aiReviewCoreUi']['showChunkErrorView'](),this['_logError'](new at('ai-review-mode-check-run-chunk-error',this,void 0x0,this['_currentReviewCheckRun']?.['currentError']));break;case'aborted':this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['processedResultsCount']>0x0?setTimeout(()=>{this['_currentReviewCheckRun']?.['forceReadyState']();},0x0):this['_onReviewRunLeave'](!0x0);}'ready'!==_0x11406e['status']&&'error-chunk'!==_0x11406e['status']&&'error-general'!==_0x11406e['status']||this['_currentReviewCheckRun']?.['sendRating']();}),this['_currentReviewCheckRun']['on']('reviewCheckResultAdded',(_0x36a4a3,_0x337e3b)=>{if(!this['_currentReviewCheckRun'])throw new at('ai-review-mode-no-current-check-run',this);const _0x1f80c8=this['_diffContent'](_0x337e3b['editor'],_0x337e3b['result']['contentInitial'],_0x337e3b['result']['contentNew']);_0x337e3b['source']['addResultChanges'](_0x337e3b['result']['id'],_0x1f80c8);}),this['_currentReviewCheckRun']['on']('reviewCheckResultReady',(_0x5494a0,_0x66c57f)=>{for(const _0x270ae1 of _0x66c57f['changes'])this['_aiReviewCoreUi']['showCheckRunResult'](_0x270ae1);this['_markChangePositionInEditorContent'](_0x66c57f['changes'],_0x66c57f['source']['documentData']);}),this['_currentReviewCheckRun']['on']('reviewCheckResultChangeStatusUpdated',(_0x1c7d85,_0x2cc181)=>{this['_aiReviewCoreUi']['updateChangeState'](_0x2cc181['change']['id'],_0x2cc181['status']);}),this['_currentReviewCheckRun']['on']('reviewCheckResultActivated',(_0x6dd117,_0x40f807)=>{this['_onReviewCheckResultActivated'](_0x40f807);}),this['_currentReviewCheckRun']['on']('reviewCheckResultDeactivated',()=>{this['_onReviewCheckResultDeactivated']();});try{await this['_currentReviewCheckRun']['start']();}catch(_0x2b0585){_0x2b0585 instanceof Error&&_0x2b0585['message']['includes']('ai-request-aborted')||(_0x2b0585 instanceof at?this['_logError'](_0x2b0585):this['_logError'](new at('ai-review-mode-check-run-failed',this,void 0x0,_0x2b0585)));}}else this['_logError'](new at('ai-review-mode-source-check-not-found',this,{'checkId':_0x4ea37d['id']}));}),this['listenTo'](this['_aiReviewCoreUi'],'leaveReview',()=>{this['_onReviewRunLeave']();}),this['listenTo'](this['_aiReviewCoreUi'],'leaveReviewCoreResultList',()=>{this['_onReviewRunLeave'](!0x0);}),this['listenTo'](this['_aiReviewCoreUi'],'abortReviewStream',()=>{this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['abort']();}),this['listenTo'](this['_aiReviewCoreUi'],'finishReview',()=>{this['_onReviewRunLeave'](!0x0);}),this['listenTo'](this['_aiReviewCoreUi'],'acceptAllChanges',()=>{if(!this['_currentReviewCheckRun'])return;const _0x2795ff=this['_currentReviewCheckRun']['getActiveChanges']();if(!_0x2795ff['length'])return;this['_aiReviewCoreEditing']['applyChange'](_0x2795ff['map'](_0x398668=>_0x398668['id']));const _0x316912=this['_currentReviewCheckRun'];_0x316912['markAllChangesAsAccepted'](),_0x316912['sendRating']();}),this['listenTo'](this['_aiReviewCoreUi'],'acceptChange',(_0x51430c,_0x564e01)=>{this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['isChangeActive'](_0x564e01['id'])&&(this['_aiReviewCoreEditing']['applyChange']([_0x564e01['id']]),this['_currentReviewCheckRun']['markChangeAsAccepted'](_0x564e01['id']),this['_aiReviewCoreUi']['hideChangeBalloon'](),this['_currentReviewCheckRun']['sendRating'](_0x564e01['id']));}),this['listenTo'](this['_aiReviewCoreUi'],'dismissChange',(_0x446da1,_0x4f92a4)=>{this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['isChangeActive'](_0x4f92a4['id'])&&(this['_aiReviewCoreEditing']['rejectChange'](_0x4f92a4['id']),this['_currentReviewCheckRun']['markChangeAsRejected'](_0x4f92a4['id']),this['_aiReviewCoreUi']['hideChangeBalloon'](),this['_currentReviewCheckRun']['sendRating'](_0x4f92a4['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',(_0x7ef01c,_0x23fc4a)=>{this['_onActivateChange'](_0x23fc4a);}),this['listenTo'](this['_aiReviewCoreUi'],'deactivateChange',(_0x5555ea,_0x50a2b5)=>{this['_onDeactivateChange'](_0x50a2b5);}),this['listenTo'](this['_aiReviewCoreEditing']['emitter'],'changeMarkerClicked',(_0x108775,_0x5b11ff)=>{this['_onChangeMarkerClicked'](_0x108775,_0x5b11ff);}),this['listenTo'](this['_aiReviewCoreEditing']['emitter'],'changeMarkerHovered',(_0x1b2b8a,_0x4f9807)=>{this['_onChangeMarkerHovered'](_0x1b2b8a,_0x4f9807);}),this['listenTo'](this['_aiReviewCoreEditing']['emitter'],'changeMarkerBlurred',()=>{this['_onChangeMarkerBlurred']();}),this['listenTo'](this['_aiReviewCoreEditing']['emitter'],'changeMarkerRemoved',(_0x407730,_0x19bae2)=>{this['_onChangeMarkerRemoved'](_0x407730,_0x19bae2);}),this['listenTo'](this['_aiReviewCoreEditing']['emitter'],'changeMarkerRestored',(_0x31bc22,_0x3fa750)=>{this['_onChangeMarkerRestored'](_0x31bc22,_0x3fa750);});}['_createReviewCheckRun'](_0x867e80,_0x10ebf9){return new Ra(this['_aiReviewCoreEditing']['getDocumentData'](),_0x10ebf9,this['_aiConnector'],_0x867e80['params'],_0x867e80['args']);}['_onChangeMarkerRemoved'](_0x52e08d,_0x1186c1){this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['markChangeAsOutdated'](_0x1186c1['changeId']);}['_onChangeMarkerRestored'](_0x26719c,_0x59b4b2){this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['markChangeAsPending'](_0x59b4b2['changeId']);}['_onCheckRunFinished'](){this['_aiReviewCoreUi']['showReviewCompletedView']();}['_initRequiredPlugins'](){this['_aiConnector']=this['context']['plugins']['get']('AIConnector');}['_onReviewRunLeave'](_0x58aa48=!0x1){this['_currentReviewCheckRun']&&(this['_currentReviewCheckRun']['hasModifications']||this['_currentReviewCheckRun']['sendRating'](),this['_currentReviewCheckRun']['stopListening'](),this['_currentReviewCheckRun']['abort'](),this['_currentReviewCheckRun']=void 0x0),_0x58aa48&&this['_aiReviewCoreUi']['showReviewCheckList'](),this['_aiReviewCoreEditing']['clearAllMarkers'](),this['_aiReviewCoreEditing']['switchToEdit'](),this['_changeActivationSource']=null;for(const _0x78449d of this['_aiReviewCoreEditing']['getEditors']())_0x78449d['editing']['view']['change'](_0x2a1500=>{for(const _0x4d3ba0 of _0x78449d['editing']['view']['document']['getRoots']())_0x2a1500['removeClass']('ck-ai_review-diff',_0x4d3ba0),_0x2a1500['removeClass']('ck-ai_review-highlights',_0x4d3ba0),_0x2a1500['removeClass']('ck-ai-translate-mode-content',_0x4d3ba0);});}['_getTranslationWithDefault'](_0x5bda48,_0x44eb4f){const _0xa30cd8=hs(this['context']['locale'],_0x5bda48);return _0xa30cd8===_0x5bda48?_0x44eb4f:_0xa30cd8;}['_logError'](_0x883c3b,_0x21ab22=!0x1){Et(_0x883c3b['message']),_0x21ab22||(_0x883c3b['message']['startsWith']('ai-review-mode-models-unable-to-retrieve')?this['_aiReviewCoreUi']['showGeneralReviewCoreErrorView']():this['_aiReviewCoreUi']['showGeneralResultsErrorView']());}['_scrollToChange'](_0x3f7746){if('content'===this['_changeActivationSource']){const _0x22cedf=this['_aiReviewCoreUi']['getChangeElement'](_0x3f7746);_0x22cedf&&ft(_0x22cedf['closest']('.ck-ai_review__check-run-result')||_0x22cedf);}else{if('panel'===this['_changeActivationSource']){const _0x533564=this['_getChangeContentElement'](_0x3f7746);if(!_0x533564)return;Ct({'target':_0x533564,'viewportOffset':{'top':0x55,'left':0x0,'bottom':0x0,'right':0x0},'ancestorOffset':0x14,'alignToTop':!0x0});}}}}const ka=[{'id':'custom','commandId':'custom','title':'Custom\x20command','description':'Type\x20a\x20custom\x20command\x20to\x20review\x20the\x20content\x20exactly\x20as\x20you\x20need.','isParameterized':!0x0},{'id':'correctness','commandId':'correctness','title':'Correctness','description':'Ensure\x20the\x20text\x20is\x20factually\x20accurate\x20and\x20free\x20of\x20errors.','isParameterized':!0x1},{'id':'clarity','commandId':'clarity','title':'Clarity','description':'Improve\x20the\x20clarity\x20and\x20readability\x20of\x20the\x20text.','isParameterized':!0x1},{'id':'readability','commandId':'readability','title':'Readability','description':'Enhance\x20the\x20overall\x20readability\x20of\x20the\x20text.','isParameterized':!0x1},{'id':'length','commandId':'make','title':'Adjust\x20length','description':'Refine\x20text\x20length\x20to\x20match\x20your\x20needs.','isParameterized':!0x0,'options':[{'formType':'dropdown','label':'Adjust\x20length','default':'longer','data':[{'label':'Longer','id':'longer'},{'label':'Shorter','id':'shorter'}]}]},{'id':'tone','commandId':'make-tone','title':'Adjust\x20tone\x20and\x20style','description':'Choose\x20tone\x20and\x20style\x20to\x20change\x20content\x20as\x20you\x20need.','isParameterized':!0x0,'options':[{'formType':'dropdown','label':'Adjust\x20tone\x20and\x20style','default':'casual','data':[{'label':'Casual','id':'casual'},{'label':'Direct','id':'direct'},{'label':'Friendly','id':'friendly'},{'label':'Confident','id':'confident'},{'label':'Professional','id':'professional'}]}]}];class Na{['id'];['commandId'];['title'];['description'];['isParameterized'];['useArgs'];['options'];['args'];get['apiId'](){return this['commandId'];}constructor(_0x49daf3){this['id']=_0x49daf3['id'],this['commandId']=_0x49daf3['commandId'],this['title']=_0x49daf3['title'],this['description']=_0x49daf3['description'],this['isParameterized']=_0x49daf3['isParameterized'],this['useArgs']=_0x49daf3['useArgs'],this['options']=_0x49daf3['options'],this['args']=_0x49daf3['args'];}}class va extends ht(){['_checks']=[];['setupChecks'](_0x1cb0a7){this['_checks']=_0x1cb0a7['map'](_0x41065d=>new Na(_0x41065d));}get['checks'](){return this['_checks'];}['getCheckById'](_0x2ef26d){return this['checks']['find'](_0x1ad631=>_0x1ad631['id']===_0x2ef26d);}['removeCheckById'](_0x177228){this['_checks']=this['_checks']['filter'](_0x51bac3=>_0x51bac3['id']!==_0x177228);}}class ya extends Na{['_models']=[];['_defaultModel']=null;constructor(_0x258c0e,_0x2c4784,_0x2fd6f0){super(_0x258c0e),this['_models']=_0x2c4784,this['_defaultModel']=_0x2fd6f0;}get['models'](){return this['_models'];}get['defaultModel'](){return this['_defaultModel'];}}class xa extends Na{['isExtra']=!0x0;['prompt'];['model'];['_defaultModel']=null;constructor(_0x1105d1,_0x94b42c,_0x2cd89e){super(_0x1105d1),this['prompt']=_0x1105d1['prompt'],this['model']=_0x1105d1['model'],this['model']?this['_defaultModel']=_0x94b42c['find'](_0xb89c90=>_0xb89c90['id']===this['model'])||null:this['_defaultModel']=_0x2cd89e;}get['defaultModel'](){return this['_defaultModel'];}}class La extends va{['_allModels']=[];['_recommendedModels']=[];['_defaultModel']=null;constructor(_0x480586,_0x48cca8,_0x2d5803){super(),this['_allModels']=_0x480586,this['_recommendedModels']=_0x48cca8,this['_defaultModel']=_0x2d5803;}['setupChecks'](_0x3f0142){this['_checks']=_0x3f0142['map'](_0x4f95fd=>!0x0===_0x4f95fd['isExtra']?new xa(_0x4f95fd,this['_allModels'],this['_defaultModel']):'custom'===_0x4f95fd['id']?new ya(_0x4f95fd,this['_recommendedModels'],this['_defaultModel']):new Na(_0x4f95fd));}}class Da extends Sa{['_prompt'];['_model'];constructor(_0x48efa5,_0x112b95,_0x3d0013,_0x22c111,_0x4c3fb6){super(_0x3d0013,_0x22c111,_0x4c3fb6),this['_prompt']=_0x48efa5,this['_model']=_0x112b95;}get['subTitle'](){return this['_prompt'];}['_createApiRequest'](){return this['_aiConnector']['callCustomReview']({'content':this['_documentData']['content'],'prompt':this['_prompt'],'model':this['_model']});}['_sendRatingRequest'](_0x2bee95,_0x2f51d,_0x4ab7df){return this['_aiConnector']['upsertCustomAIReviewRating'](_0x2f51d,_0x2bee95,_0x4ab7df);}}class Pa extends Da{get['subTitle'](){return'';}set['prompt'](_0x5283f9){this['_prompt']=_0x5283f9;}set['model'](_0x567d74){this['_model']=_0x567d74;}}class Ha extends Oa{static get['pluginName'](){return'AIReviewModeController';}['_isDiffOn']=!0x1;['_hasDefaultAvailableCommands']=!0x1;constructor(_0x433243){super(_0x433243),this['_hasDefaultAvailableCommands']=!this['context']['config']['get']('ai.review.availableCommands'),this['context']['config']['define']('ai.review.availableCommands',ka['map'](_0x4e0b7b=>_0x4e0b7b['id'])),this['context']['config']['define']('ai.review.extraCommands',[]);}async['init'](){await super['init'](),this['listenTo'](this['_aiReviewCoreUi'],'toggleDiff',(_0x4b3cd8,_0x572058)=>{this['_isDiffOn']=_0x572058['on'],this['_onDiffChange'](this['_isDiffOn']);});}['_initRequiredPlugins'](){super['_initRequiredPlugins'](),this['_aiReviewCoreUi']=this['context']['plugins']['get']('AIReviewModeUI'),this['_aiReviewCoreEditing']=this['context']['plugins']['get']('AIReviewCoreEditing');}['_createReviewCheckRun'](_0x558507,_0x19de8c){return _0x558507['isCustom']?new Da(_0x558507['args']['prompt'],_0x558507['args']['model'],this['_aiReviewCoreEditing']['getDocumentData'](),_0x19de8c,this['_aiConnector']):_0x19de8c['isExtra']?new Pa(_0x19de8c['prompt'],_0x19de8c['defaultModel']['id'],this['_aiReviewCoreEditing']['getDocumentData'](),_0x19de8c,this['_aiConnector']):new Ra(this['_aiReviewCoreEditing']['getDocumentData'](),_0x19de8c,this['_aiConnector'],_0x558507['params'],_0x558507['args']);}['_onReviewCheckResultActivated'](_0x26fef7){this['_aiReviewCoreUi']['setActiveStateInResults'](_0x26fef7['change']['id']),this['_scrollToChange'](_0x26fef7['change']['id']);const _0x53013f=this['_aiReviewCoreEditing']['getMarkerElementForChange'](_0x26fef7['change']['id']);if(!_0x53013f)return;const _0x1f1293=this['_aiReviewCoreEditing']['getEditorForChange'](_0x26fef7['change']['id'])??this['_aiReviewCoreEditing']['getEditor']();this['_aiReviewCoreUi']['showChangeBalloon'](_0x26fef7['change'],()=>_0x53013f['getElement'](),void 0x0,'click',this['_getBalloonDomRoot'](_0x1f1293,_0x53013f['modelRange']['root']['rootName']),_0x1f1293?.['ui']?.['viewportOffset']),this['_aiReviewCoreEditing']['setMarkersInElementAsActive'](_0x26fef7['change']['id']);}['_onReviewCheckResultDeactivated'](){this['_aiReviewCoreUi']['resetActiveStateInResults'](),this['_aiReviewCoreUi']['hideChangeBalloon'](),this['_aiReviewCoreEditing']['setAllMarkersAsInactive']();}['_onActivateChange'](_0x5669a2){this['_currentReviewCheckRun']&&'click'===_0x5669a2['uiInteraction']&&(this['_changeActivationSource']='panel',this['_currentReviewCheckRun']['activateChange'](_0x5669a2['id']));}['_onDeactivateChange'](_0x5c5d91){this['_currentReviewCheckRun']&&'balloon'===_0x5c5d91['origin']&&this['_currentReviewCheckRun']['deactivateChange']();}['_onChangeMarkerClicked'](_0x5e6191,_0x4fc59d){if(!this['_currentReviewCheckRun'])return;this['_changeActivationSource']='content',this['_currentReviewCheckRun']['activateChange'](_0x4fc59d['changeId']);const _0x28d657=this['_currentReviewCheckRun']['getChangeById'](_0x4fc59d['changeId']);if(!_0x28d657)return;const _0x33e5aa=this['_aiReviewCoreEditing']['getMarkerElementForChange'](_0x4fc59d['changeId']),_0x5c7505=this['_aiReviewCoreEditing']['getEditorForChange'](_0x4fc59d['changeId'])??this['_aiReviewCoreEditing']['getEditor']();this['_aiReviewCoreUi']['showChangeBalloon'](_0x28d657,_0x4fc59d['markerElement'],_0x4fc59d['domEvent'],'click',this['_getBalloonDomRoot'](_0x5c7505,_0x33e5aa?.['modelRange']['root']['rootName']),_0x5c7505?.['ui']?.['viewportOffset']);}['_onChangeMarkerHovered'](_0x1a094c,_0x14a0b3){if(!this['_currentReviewCheckRun'])return;if(this['_currentReviewCheckRun']['isAnyChangeActivated']())return;const _0xc8166=this['_currentReviewCheckRun']['getChangeById'](_0x14a0b3['changeId']);if(!_0xc8166)return;const _0x119645=this['_aiReviewCoreEditing']['getMarkerElementForChange'](_0x14a0b3['changeId']),_0x50bead=this['_aiReviewCoreEditing']['getEditorForChange'](_0x14a0b3['changeId'])??this['_aiReviewCoreEditing']['getEditor']();this['_aiReviewCoreUi']['showChangeBalloon'](_0xc8166,_0x14a0b3['markerElement'],_0x14a0b3['domEvent'],'hover',this['_getBalloonDomRoot'](_0x50bead,_0x119645?.['modelRange']['root']['rootName']),_0x50bead?.['ui']?.['viewportOffset']);}['_onChangeMarkerBlurred'](){if(!this['_currentReviewCheckRun'])return;this['_currentReviewCheckRun']['isAnyChangeActivated']()||this['_aiReviewCoreUi']['hideChangeBalloon']();}['_getChangeContentElement'](_0x19c8c8){const _0x10a2ae=this['_aiReviewCoreEditing']['getMarkerElementForChange'](_0x19c8c8);return _0x10a2ae?_0x10a2ae['getElement']():null;}['_markChangePositionInEditorContent'](_0x10cd65,_0x3cd345){this['_aiReviewCoreEditing']['markChangePositionInEditorContent'](_0x10cd65,_0x3cd345);}['_diffContent'](_0x36d31e,_0x5ce900,_0x37eb2a){return this['_aiReviewCoreEditing']['diffContent'](_0x36d31e,_0x5ce900,_0x37eb2a,!0x1);}['_onReviewCheckRun'](){this['_onDiffChange'](this['_isDiffOn']);}['_onDiffChange'](_0x3c3cd8){_0x3c3cd8?this['_aiReviewCoreUi']['hideDiffInBalloon']():this['_aiReviewCoreUi']['showDiffInBalloon']();for(const _0x3b60a3 of this['_aiReviewCoreEditing']['getEditors']())_0x3b60a3['editing']['view']['change'](_0x2a0c88=>{for(const _0x4929d6 of _0x3b60a3['editing']['view']['document']['getRoots']()){for(const _0x2936fb of _0x4929d6['getClassNames']())_0x2936fb['startsWith']('ck-ai_review-')&&_0x2a0c88['removeClass'](_0x2936fb,_0x4929d6);_0x2a0c88['addClass'](_0x3c3cd8?'ck-ai_review-diff':'ck-ai_review-highlights',_0x4929d6);}});}['_getBalloonDomRoot'](_0x255d12,_0x2d2331){const _0x444812=_0x255d12['editing']['view'];if(_0x2d2331){const _0x56a03a=_0x444812['getDomRoot'](_0x2d2331);if(_0x56a03a)return _0x56a03a;}return _0x444812['getDomRoot']()??void 0x0;}async['_getChecksList'](){const _0x510bfe=[...ka,...this['_getExtraChecks']()],_0x180451=this['context']['config']['get']('ai.review.availableCommands')||[];this['_logErrorForNonExistentChecks'](_0x180451,_0x510bfe);let _0x4ea6c5=_0x510bfe;this['_hasDefaultAvailableCommands']||(_0x4ea6c5=_0x180451['map'](_0x313ecb=>_0x510bfe['find'](_0x392bfc=>_0x392bfc['id']===_0x313ecb))['filter'](_0x2cb555=>!!_0x2cb555)),_0x4ea6c5=_0x4ea6c5['map'](_0x53c8e1=>_0x53c8e1['isExtra']?_0x53c8e1:this['_translateReviewCheck'](_0x53c8e1));const _0x19f7c9=_0x4ea6c5['some'](_0x3ec11d=>_0x3ec11d['isExtra']||'custom'===_0x3ec11d['id']);let _0x1b7c55=[],_0x8e986d=[],_0x11c007=null;if(_0x19f7c9){const _0x3c5cd0=await this['_getModels']();_0x1b7c55=_0x3c5cd0['all'],_0x8e986d=_0x3c5cd0['recommended'],_0x11c007=_0x3c5cd0['default'];}const _0x3674f9=new La(_0x1b7c55,_0x8e986d,_0x11c007);return _0x3674f9['setupChecks'](_0x4ea6c5),_0x19f7c9&&this['_filterChecksWithMissingModel'](_0x3674f9),_0x3674f9;}['_getExtraChecks'](){return(this['context']['config']['get']('ai.review.extraCommands')||[])['map'](_0x206811=>({'id':_0x206811['id'],'commandId':_0x206811['id'],'title':_0x206811['label'],'description':_0x206811['description'],'isParameterized':!0x1,'isExtra':!0x0,'prompt':_0x206811['prompt'],'model':_0x206811['model']}));}['_logErrorForNonExistentChecks'](_0x190f5c,_0x5d286f){const _0x177e8c=_0x190f5c['filter'](_0x115b77=>!_0x5d286f['some'](_0x5b1515=>_0x5b1515['id']===_0x115b77));_0x177e8c['length']&&this['_logError'](new at('ai-review-mode-non-existent-commands-used',this,{'commandIds':_0x177e8c['join'](',\x20')}),!0x0);}async['_getModels'](){try{const _0x579056=new Fs({'connector':this['_aiConnector'],'config':this['context']['config']['get']('ai.models'),'locale':this['context']['locale']});return{'all':await _0x579056['getAll'](),'recommended':await _0x579056['getAvailableModels'](),'default':await _0x579056['getDefault']()};}catch(_0x544235){return this['_logError'](new at('ai-review-mode-models-unable-to-retrieve',this,void 0x0,_0x544235)),{'all':[],'recommended':[],'default':null};}}['_translateReviewCheck'](_0x63c333){const _0x34989d='AI_REVIEW_CHECK_'+_0x63c333['id']['toUpperCase']()['replaceAll']('-','_'),_0x46ebc8={..._0x63c333,'title':this['_getTranslationWithDefault'](_0x34989d+'_TITLE',_0x63c333['title']),'description':this['_getTranslationWithDefault'](_0x34989d+'_DESCRIPTION',_0x63c333['description'])};return _0x63c333['options']&&(_0x46ebc8['options']=_0x63c333['options']['map'](_0x1e1e00=>({..._0x1e1e00,'label':this['_getTranslationWithDefault'](_0x34989d+'_OPTIONS_LABEL',_0x1e1e00['label']||''),'data':_0x1e1e00['data']?_0x1e1e00['data']['map'](_0x3e407c=>({..._0x3e407c,'label':this['_getTranslationWithDefault'](_0x34989d+'_OPTIONS_DATA_'+_0x3e407c['id']['toUpperCase'](),_0x3e407c['label'])})):void 0x0}))),_0x46ebc8;}['_filterChecksWithMissingModel'](_0x5751c0){const _0x10b1dc=[];_0x5751c0['checks']['forEach'](_0x169bbe=>{(_0x169bbe instanceof xa&&!_0x169bbe['defaultModel']||_0x169bbe instanceof ya&&!_0x169bbe['models']['length'])&&_0x10b1dc['push'](_0x169bbe['id']);}),_0x10b1dc['length']&&_0x10b1dc['forEach'](_0x1f382a=>{_0x5751c0['removeCheckById'](_0x1f382a),this['_logError'](new at('ai-review-mode-command-unavailable-due-to-missing-model',this,{'commandId':_0x1f382a}),!0x0);});}}class Ma extends _0x203d97{static get['requires'](){return[Ha,ma,wa];}static get['pluginName'](){return'AIReviewMode';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}class Ua extends Na{get['apiId'](){return'translate';}}class Va extends va{['setupChecks'](_0x381d53){this['_checks']=_0x381d53['map'](_0x15d4fd=>new Ua(_0x15d4fd));}}class Ba extends Ra{['_title'];constructor(_0x4a547a,_0x3910fa,_0x4b1af5,_0x8995c4,_0x1c7e96,_0x17fa3a){super(_0x4a547a,_0x3910fa,_0x4b1af5,_0x1c7e96,_0x17fa3a),this['_title']=_0x8995c4;}get['title'](){return this['_title'];}get['subTitle'](){return this['_sourceCheck']['title'];}}class Ga extends Oa{static get['pluginName'](){return'AITranslateController';}constructor(_0x3611ef){super(_0x3611ef),this['context']['config']['define']('ai.translate.languages',[{'label':'English','id':'english'},{'label':'Spanish','id':'spanish'},{'label':'French','id':'french'},{'label':'German','id':'german'},{'label':'Chinese\x20(Simplified)','id':'chinese'},{'label':'Japanese','id':'japanese'},{'label':'Russian','id':'russian'},{'label':'Portuguese','id':'portuguese'},{'label':'Korean','id':'korean'},{'label':'Italian','id':'italian'}]);}['_onCheckRunFinished'](){this['_onReviewRunLeave'](!0x0);}['_initRequiredPlugins'](){super['_initRequiredPlugins'](),this['_aiReviewCoreUi']=this['context']['plugins']['get']('AITranslateUI'),this['_aiReviewCoreEditing']=this['context']['plugins']['get']('AIReviewCoreEditing');}['_createReviewCheckRun'](_0x389560,_0x5eb81a){return new Ba(this['_aiReviewCoreEditing']['getDocumentData'](),_0x5eb81a,this['_aiConnector'],hs(this['context']['locale'],'AI_REVIEW_CHECK_TRANSLATE_TITLE'),_0x389560['params'],_0x389560['args']);}['_onReviewCheckResultActivated'](_0x4ae2c1){this['_aiReviewCoreUi']['setActiveStateInResults'](_0x4ae2c1['change']['id']),this['_aiReviewCoreEditing']['setMarkersInElementAsActive'](_0x4ae2c1['change']['id']);}['_onReviewCheckResultDeactivated'](){this['_aiReviewCoreEditing']['setAllMarkersAsInactive'](),this['_aiReviewCoreUi']['resetActiveStateInResults']();}['_onActivateChange'](_0x138630){this['_currentReviewCheckRun']&&('hover'===_0x138630['uiInteraction']&&(this['_changeActivationSource']='panel',this['_currentReviewCheckRun']['activateChange'](_0x138630['id'])),'click'===_0x138630['uiInteraction']&&this['_scrollToChange'](_0x138630['id']));}['_onDeactivateChange'](_0x1789f8){this['_currentReviewCheckRun']&&'panel'===_0x1789f8['origin']&&this['_currentReviewCheckRun']['deactivateChange']();}['_onChangeMarkerClicked'](_0x20848b,_0x142793){this['_currentReviewCheckRun']&&(this['_changeActivationSource']='content',this['_currentReviewCheckRun']['activateChange'](_0x142793['changeId']),this['_scrollToChange'](_0x142793['changeId']));}['_onChangeMarkerHovered'](_0x11babb,_0x341aa6){this['_currentReviewCheckRun']&&(this['_changeActivationSource']='content',this['_currentReviewCheckRun']['activateChange'](_0x341aa6['changeId']),this['_aiReviewCoreEditing']['reactivateMarkers'](_0x341aa6['changeId']));}['_onChangeMarkerBlurred'](){this['_currentReviewCheckRun']&&'content'===this['_changeActivationSource']&&(this['_currentReviewCheckRun']['deactivateChange'](),this['_aiReviewCoreEditing']['setAllMarkersAsInactive']());}['_getChangeContentElement'](_0x167b4c){return this['_aiReviewCoreEditing']['getContentElementForChange'](_0x167b4c);}['_markChangePositionInEditorContent'](_0xaec6ba,_0x342b53){this['_aiReviewCoreEditing']['markChangePositionInEditorContent'](_0xaec6ba,_0x342b53);}['_diffContent'](_0x4d3f64,_0x2fa158,_0x2606be){return this['_aiReviewCoreEditing']['diffContent'](_0x4d3f64,_0x2fa158,_0x2606be,!0x0);}['_onReviewCheckRun'](){for(const _0x3aea06 of this['_aiReviewCoreEditing']['getEditors']())_0x3aea06['editing']['view']['change'](_0x365b1b=>{for(const _0x51bf3c of _0x3aea06['editing']['view']['document']['getRoots']())_0x365b1b['addClass']('ck-ai-translate-mode-content',_0x51bf3c);});}async['_getChecksList'](){const _0x209435=[],_0x24e6e0=this['context']['config']['get']('ai.translate.languages')||[];for(const _0x2af119 of _0x24e6e0)_0x209435['push']({'title':_0x2af119['label'],'id':_0x2af119['id'],'commandId':_0x2af119['id'],'description':'','isParameterized':!0x1,'useArgs':!0x0,'args':{'language':_0x2af119['id']}});const _0x169c99=new Va();return _0x169c99['setupChecks'](this['_translateChecks'](_0x209435)),_0x169c99;}['_translateChecks'](_0x3e4b1b){return _0x3e4b1b['map'](_0x359ccb=>{const _0x5be22b='AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_'+_0x359ccb['title']['toUpperCase']()['replaceAll']('-','_');return{..._0x359ccb,'title':this['_getTranslationWithDefault'](_0x5be22b,_0x359ccb['title'])};});}}class Fa extends ca{constructor(_0x58a0d0,_0x293c18){super(_0x58a0d0,_0x293c18),this['on']('set:isLoading',(_0x1f6d79,_0x53540f,_0x4c242e)=>{_0x4c242e&&(this['headerTitle']=hs(this['locale'],'AI_TRANSLATE_CHECK_RESULTS_LOADING_TITLE'));}),this['on']('set:isResultReady',(_0x40c758,_0xf43f8,_0x45e220)=>{_0x45e220&&(this['headerTitle']=hs(this['locale'],'AI_TRANSLATE_CHECK_RESULTS_READY_TITLE'));});}['_createAcceptAllButtonView'](){const _0x5283df=super['_createAcceptAllButtonView']();return _0x5283df['set']('label',hs(this['locale'],'AI_TRANSLATE_ACCEPT_ALL')),_0x5283df;}['_createExitReviewButtonView'](){const _0x3b422b=super['_createExitReviewButtonView']();return _0x3b422b['set']('label',hs(this['locale'],'AI_CHAT_HISTORY_CANCEL')),_0x3b422b;}}class Ka extends pa{['_setupTemplate'](){const _0x4f282e=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-translate__check-list-wrapper',_0x4f282e['if']('isVisible','ck-hidden',_0x32f63d=>!_0x32f63d)]},'children':[{'tag':'div','attributes':{'class':['ck-ai-translate__check-list-header']},'children':[{'tag':'h2','children':[{'text':hs(this['locale'],'AI_TRANSLATE_CHECK_LIST_HEADER_TITLE')}]},{'tag':'p','children':[{'text':hs(this['locale'],'AI_TRANSLATE_CHECK_LIST_HEADER_DESCRIPTION')}]}]},{'tag':'div','attributes':{'class':['ck-ai_review__check-list',_0x4f282e['if']('isVisible','ck-hidden',_0x1045c0=>!_0x1045c0)]},'children':this['_checkViews']}]});}}class Wa extends ra{static get['pluginName'](){return'AITranslateUI';}['createMainView'](){const _0x1ba6d2=this['context']['plugins']['get']('AITabs'),_0x547515=this['context']['locale'],_0x4880b8=new eo(_0x547515,{'label':hs(_0x547515,'AI_REVIEW_CHECK_TRANSLATE_TITLE'),'icon':_0x12e558,'class':'ck-ai-header_review-translate','showResizeButton':_0x1ba6d2['showResizeButton']});_0x4880b8['delegate']('resizeTabs')['to'](_0x1ba6d2),_0x4880b8['bind']('isMaximized')['to'](_0x1ba6d2['view'],'isMaximized',_0x22a930=>_0x22a930);const _0x11c1aa=new aa(_0x547515,{'header':_0x4880b8,'list':new Ka(_0x547515),'results':new Fa(_0x547515,{'generalErrorText':hs(_0x547515,'AI_TRANSLATE_GENERAL_ERROR_MESSAGE')}),'completed':new la(_0x547515,{'headerText':hs(_0x547515,'AI_TRANSLATE_FINISH_HEADER_TITLE'),'emptyResultsText':hs(_0x547515,'AI_TRANSLATE_EMPTY_RESULTS_TEXT'),'buttonText':hs(_0x547515,'AI_TRANSLATE_FINISH_BUTTON_LABEL')})});return _0x11c1aa['extendTemplate']({'attributes':{'class':'ck-ai-translate-mode'}}),_0x11c1aa;}['registerTab'](){const _0x3bcc5c=this['context']['plugins']['get']('AITabs');_0x3bcc5c['view']['on']('activateTab',(_0x1e4c4a,{newTab:_0x42b246,oldTab:_0x1bd756})=>{'translate'===_0x42b246?this['fire']('getReviewCheckList'):'translate'===_0x1bd756&&this['fire']('leaveReview');}),_0x3bcc5c['view']['addTab']({'id':'translate','buttonLabel':hs(this['context']['locale'],'AI_REVIEW_CHECK_TRANSLATE_TITLE'),'buttonIcon':_0x12e558,'order':0x0,'content':this['_mainView']});}}class Ya extends _0x203d97{static get['requires'](){return[Ga,Wa,wa];}static get['pluginName'](){return'AITranslate';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}export{ta as AIActions,Ri as AIAdapter,Xi as AIAssistant,$i as AIAssistantUI,Oo as AIBalloon,Eo as AIChat,Xs as AIChatController,nr as AIChatFeedCustomElementView,Io as AIChatHistory,Ao as AIChatHistoryController,uo as AIChatHistoryUI,Bs as AIChatInteraction,Co as AIChatShortcuts,ro as AIChatUI,as as AIConnector,Js as AIEditing,xo as AIEditorIntegration,Ds as AIInteraction,ea as AIQuickActions,Wo as AIQuickActionsUI,xs as AIReply,Oi as AIRequestError,Na as AIReviewCheck,fa as AIReviewCheckResult,ba as AIReviewCheckResultChange,Sa as AIReviewCheckRun,Ma as AIReviewMode,Oa as AIReviewModeController,wa as AIReviewModeEditing,ma as AIReviewModeUI,os as AITabs,rs as AITabsMainView,is as AITabsView,ji as AITextAdapter,fo as AIToggleButtonUI,Ya as AITranslate,Ga as AITranslateController,Wa as AITranslateUI,Zi as AWSTextAdapter,Ji as OpenAITextAdapter,Ni as ShowAIAssistantCommand,wo as ToggleAICommand,ds as createResizeButton,zi as getDefaultAICommands};