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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (148) hide show
  1. package/dist/index.js +6 -6
  2. package/dist/translations/af.js +1 -1
  3. package/dist/translations/af.umd.js +1 -1
  4. package/dist/translations/ar.js +1 -1
  5. package/dist/translations/ar.umd.js +1 -1
  6. package/dist/translations/ast.js +1 -1
  7. package/dist/translations/ast.umd.js +1 -1
  8. package/dist/translations/az.js +1 -1
  9. package/dist/translations/az.umd.js +1 -1
  10. package/dist/translations/be.js +1 -1
  11. package/dist/translations/be.umd.js +1 -1
  12. package/dist/translations/bg.js +1 -1
  13. package/dist/translations/bg.umd.js +1 -1
  14. package/dist/translations/bn.js +1 -1
  15. package/dist/translations/bn.umd.js +1 -1
  16. package/dist/translations/bs.js +1 -1
  17. package/dist/translations/bs.umd.js +1 -1
  18. package/dist/translations/ca.js +1 -1
  19. package/dist/translations/ca.umd.js +1 -1
  20. package/dist/translations/cs.js +1 -1
  21. package/dist/translations/cs.umd.js +1 -1
  22. package/dist/translations/da.js +1 -1
  23. package/dist/translations/da.umd.js +1 -1
  24. package/dist/translations/de-ch.js +1 -1
  25. package/dist/translations/de-ch.umd.js +1 -1
  26. package/dist/translations/de.js +1 -1
  27. package/dist/translations/de.umd.js +1 -1
  28. package/dist/translations/el.js +1 -1
  29. package/dist/translations/el.umd.js +1 -1
  30. package/dist/translations/en-au.js +1 -1
  31. package/dist/translations/en-au.umd.js +1 -1
  32. package/dist/translations/en-gb.js +1 -1
  33. package/dist/translations/en-gb.umd.js +1 -1
  34. package/dist/translations/en.js +1 -1
  35. package/dist/translations/en.umd.js +1 -1
  36. package/dist/translations/eo.js +1 -1
  37. package/dist/translations/eo.umd.js +1 -1
  38. package/dist/translations/es-co.js +1 -1
  39. package/dist/translations/es-co.umd.js +1 -1
  40. package/dist/translations/es.js +1 -1
  41. package/dist/translations/es.umd.js +1 -1
  42. package/dist/translations/et.js +1 -1
  43. package/dist/translations/et.umd.js +1 -1
  44. package/dist/translations/eu.js +1 -1
  45. package/dist/translations/eu.umd.js +1 -1
  46. package/dist/translations/fa.js +1 -1
  47. package/dist/translations/fa.umd.js +1 -1
  48. package/dist/translations/fi.js +1 -1
  49. package/dist/translations/fi.umd.js +1 -1
  50. package/dist/translations/fr.js +1 -1
  51. package/dist/translations/fr.umd.js +1 -1
  52. package/dist/translations/gl.js +1 -1
  53. package/dist/translations/gl.umd.js +1 -1
  54. package/dist/translations/gu.js +1 -1
  55. package/dist/translations/gu.umd.js +1 -1
  56. package/dist/translations/he.js +1 -1
  57. package/dist/translations/he.umd.js +1 -1
  58. package/dist/translations/hi.js +1 -1
  59. package/dist/translations/hi.umd.js +1 -1
  60. package/dist/translations/hr.js +1 -1
  61. package/dist/translations/hr.umd.js +1 -1
  62. package/dist/translations/hu.js +1 -1
  63. package/dist/translations/hu.umd.js +1 -1
  64. package/dist/translations/hy.js +1 -1
  65. package/dist/translations/hy.umd.js +1 -1
  66. package/dist/translations/id.js +1 -1
  67. package/dist/translations/id.umd.js +1 -1
  68. package/dist/translations/it.js +1 -1
  69. package/dist/translations/it.umd.js +1 -1
  70. package/dist/translations/ja.js +1 -1
  71. package/dist/translations/ja.umd.js +1 -1
  72. package/dist/translations/jv.js +1 -1
  73. package/dist/translations/jv.umd.js +1 -1
  74. package/dist/translations/kk.js +1 -1
  75. package/dist/translations/kk.umd.js +1 -1
  76. package/dist/translations/km.js +1 -1
  77. package/dist/translations/km.umd.js +1 -1
  78. package/dist/translations/kn.js +1 -1
  79. package/dist/translations/kn.umd.js +1 -1
  80. package/dist/translations/ko.js +1 -1
  81. package/dist/translations/ko.umd.js +1 -1
  82. package/dist/translations/ku.js +1 -1
  83. package/dist/translations/ku.umd.js +1 -1
  84. package/dist/translations/lt.js +1 -1
  85. package/dist/translations/lt.umd.js +1 -1
  86. package/dist/translations/lv.js +1 -1
  87. package/dist/translations/lv.umd.js +1 -1
  88. package/dist/translations/ms.js +1 -1
  89. package/dist/translations/ms.umd.js +1 -1
  90. package/dist/translations/nb.js +1 -1
  91. package/dist/translations/nb.umd.js +1 -1
  92. package/dist/translations/ne.js +1 -1
  93. package/dist/translations/ne.umd.js +1 -1
  94. package/dist/translations/nl.js +1 -1
  95. package/dist/translations/nl.umd.js +1 -1
  96. package/dist/translations/no.js +1 -1
  97. package/dist/translations/no.umd.js +1 -1
  98. package/dist/translations/oc.js +1 -1
  99. package/dist/translations/oc.umd.js +1 -1
  100. package/dist/translations/pl.js +1 -1
  101. package/dist/translations/pl.umd.js +1 -1
  102. package/dist/translations/pt-br.js +1 -1
  103. package/dist/translations/pt-br.umd.js +1 -1
  104. package/dist/translations/pt.js +1 -1
  105. package/dist/translations/pt.umd.js +1 -1
  106. package/dist/translations/ro.js +1 -1
  107. package/dist/translations/ro.umd.js +1 -1
  108. package/dist/translations/ru.js +1 -1
  109. package/dist/translations/ru.umd.js +1 -1
  110. package/dist/translations/si.js +1 -1
  111. package/dist/translations/si.umd.js +1 -1
  112. package/dist/translations/sk.js +1 -1
  113. package/dist/translations/sk.umd.js +1 -1
  114. package/dist/translations/sl.js +1 -1
  115. package/dist/translations/sl.umd.js +1 -1
  116. package/dist/translations/sq.js +1 -1
  117. package/dist/translations/sq.umd.js +1 -1
  118. package/dist/translations/sr-latn.js +1 -1
  119. package/dist/translations/sr-latn.umd.js +1 -1
  120. package/dist/translations/sr.js +1 -1
  121. package/dist/translations/sr.umd.js +1 -1
  122. package/dist/translations/sv.js +1 -1
  123. package/dist/translations/sv.umd.js +1 -1
  124. package/dist/translations/th.js +1 -1
  125. package/dist/translations/th.umd.js +1 -1
  126. package/dist/translations/ti.js +1 -1
  127. package/dist/translations/ti.umd.js +1 -1
  128. package/dist/translations/tk.js +1 -1
  129. package/dist/translations/tk.umd.js +1 -1
  130. package/dist/translations/tr.js +1 -1
  131. package/dist/translations/tr.umd.js +1 -1
  132. package/dist/translations/tt.js +1 -1
  133. package/dist/translations/tt.umd.js +1 -1
  134. package/dist/translations/ug.js +1 -1
  135. package/dist/translations/ug.umd.js +1 -1
  136. package/dist/translations/uk.js +1 -1
  137. package/dist/translations/uk.umd.js +1 -1
  138. package/dist/translations/ur.js +1 -1
  139. package/dist/translations/ur.umd.js +1 -1
  140. package/dist/translations/uz.js +1 -1
  141. package/dist/translations/uz.umd.js +1 -1
  142. package/dist/translations/vi.js +1 -1
  143. package/dist/translations/vi.umd.js +1 -1
  144. package/dist/translations/zh-cn.js +1 -1
  145. package/dist/translations/zh-cn.umd.js +1 -1
  146. package/dist/translations/zh.js +1 -1
  147. package/dist/translations/zh.umd.js +1 -1
  148. package/package.json +12 -12
package/dist/index.js CHANGED
@@ -20,9 +20,9 @@
20
20
  *
21
21
  *
22
22
  */
23
- import{Plugin as _0x5d673d,Command as _0x3279ff,ContextPlugin as _0x1c4dd1,Editor as _0x123c85}from'@ckeditor/ckeditor5-core/dist/index.js';import{IconCopy as _0x4e9d44,IconCheck as _0xaff33c,IconError as _0x3a5c75,IconSubmit as _0xc81d82,IconAIHistory as _0xa3f093,IconMagicWand as _0x1fcc24,IconRobotPencil as _0x4f1341,IconMaximize as _0x345c28,IconMinimize as _0x4b6c86,IconShowChangesOn as _0x5c77ce,IconShowChangesOff as _0x4fcfde,IconDocument as _0x22e392,IconBoxWithCross as _0x3576c0,IconBoxWithCheck as _0x3bc1d0,IconBoxWithMarker as _0x31116f,IconInfo as _0x3f9507,IconWeb as _0x3bebb8,IconCancel as _0x5adff9,IconSelection as _0x106841,IconFileUpload as _0x3f3bf7,IconLink as _0x5ea46a,IconBulb as _0x3cfa5e,IconAI as _0x61e59f,IconPreviousArrow as _0x216998,IconDocumentOutline as _0xc2c70c,IconLoupe as _0x126c35,IconPaperClip as _0x504f07,IconBrowseFiles as _0x4aafe4,IconDropdownArrow as _0x5abe6d,IconStop as _0x2c4109,IconPlus as _0x389c6e,IconAIChat as _0x434a83,IconPin as _0x38de8f,IconThreeHorizontalDots as _0x856848,IconAIReview as _0x2d3729,IconAITranslate as _0xc37e4b,IconAIAskAI as _0x5b171f,IconThumbUp as _0x4980f4,IconThumbDown as _0x91f3bb,IconChevronDown as _0x3bd23d,IconChevronUp as _0x534770,IconAIQuickActions as _0x215c21,IconAIChatCommands as _0x4a5201,IconAIImproveWriting as _0x1b95f5,IconAIContinueWriting as _0x10b153,IconAIGrammarCheck as _0x2254d0,IconAIAdjustLength as _0x2ced3e,IconAIChangeTone as _0x4df6c2,IconAIOther as _0x2aadf2,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 _0x42c81c,FormHeaderView as _0x484303,HighlightedTextView as _0x4a528a,ViewCollection as _0x54e610,FileDialogButtonView as _0x161cdc,InputTextView as _0x297cb9,SearchTextView as _0x3e041a,ListItemButtonView as _0xf7990c,ButtonLabelWithHighlightView as _0x5c7c99,DropdownMenuPanelPositioningFunctions as _0x478601,BalloonToolbar as _0x4f2bac,FormRowView as _0x5a557f,TextareaView as _0x2ea38e}from'@ckeditor/ckeditor5-ui/dist/index.js';import{ClipboardPipeline as _0xeecfb4,ClipboardMarkersUtils as _0x225221}from'@ckeditor/ckeditor5-clipboard/dist/index.js';import{ViewDocumentDomEventData as _0x4672e5,ViewDataTransfer as _0x407a3a,ViewUpcastWriter as _0x1137c7,Matcher as _0x37d468,_DetachOperation as _0x4178fd,_insertIntoModelNodeList as _0x4845d3,_removeFromModelNodeList as _0x405a98,ModelRange as _0x17fab8,transformOperationSets as _0x469e64,ViewDowncastWriter as _0x8976b4,ModelDocumentFragment as _0x1fef78,ModelPosition as _0x4de1b4,ModelTreeWalker as _0x5130a5,MarkerOperation as _0x46a18c,InsertOperation as _0x1ceeab}from'@ckeditor/ckeditor5-engine/dist/index.js';import{unescape as _0x2ee2a9,escape as _0x321d30,cloneDeep as _0x4a5b1c,throttle as _0x22e74a,debounce as _0x44e40b,escapeRegExp as _0x4f9813}from'es-toolkit/compat';import{createParser as _0xf9c35f}from'eventsource-parser';import{CloudServices as _0xba4000}from'@ckeditor/ckeditor5-cloud-services/dist/index.js';import{parseDocument as _0x5bff37}from'htmlparser2';import{isTag as _0x57c018,findOne as _0xa32e9a,getParent as _0xdb6626,findAll as _0x8f0e86,removeElement as _0x1085d4,prepend as _0x50c4bc,prependChild as _0x4778fe,appendChild as _0x3645b6,append as _0x1e8db8,find as _0x225c1c,isComment as _0xb3cb35,replaceElement as _0x27afaf,getChildren as _0x387748,textContent as _0x1ab110}from'domutils';import ti from'dom-serializer';import{Document as _0x553b91,Element as _0x6c2914,Text as _0x557dcc,cloneNode as _0x3eb68e,isDocument as _0x10a496,isText as _0x551b28,NodeWithChildren as _0x2078d3}from'domhandler';import{MarkdownGfmMdToHtmlDefaultPlugins as _0x3f407f,MarkdownGfmMdToHtml as _0x8f283}from'@ckeditor/ckeditor5-markdown-gfm/dist/index.js';import _0x55f728 from'rehype-sanitize';import{fixElementSuggestionRange as _0xc6d790,DocumentCompare as _0x216072,DATA_ID_MODEL_ATTRIBUTE as _0xf976ed,ConfirmMixin as _0x54c893,getAllMarkersDomElementsSorted as _0x4839b5,SuggestionsConversion as _0x20dfb2,DATA_ID_VIEW_ATTRIBUTE as _0x3a52f2,getMarkerDomElement as _0x2b3bd5}from'@ckeditor/ckeditor5-collaboration-core/dist/index.js';import _0x1f1589 from'morphdom';import{diffArrays as _0x335e37}from'diff';const Ci='_ungrouppedCommands';function wi(_0x5c6fb5,_0x29cf54){const _0x5e45fc=(0x0,_0x29cf54['t'])('Other');return _0x5c6fb5['length']?'groupId'in _0x5c6fb5[0x0]?_0x5c6fb5:[{'groupId':Ci,'groupLabel':_0x5e45fc,'order':0x1/0x0,'commands':_0x5c6fb5}]:[{'groupId':Ci,'groupLabel':_0x5e45fc,'order':0x1/0x0,'commands':[]}];}const fi=globalThis['DataTransfer'],bi='ai-ui';class Si extends _0x5d673d{static get['pluginName'](){return'AIAssistantEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const {editor:_0x1d356f}=this,_0x567339=['ck-fake-ai-selection'];_0x1d356f['config']['get']('ai.assistant.useTheme')&&_0x567339['push']('ck-ai-assistant-ui_theme'),_0x1d356f['conversion']['for']('editingDowncast')['markerToHighlight']({'model':bi,'view':{'classes':_0x567339,'priority':0xc}}),_0x1d356f['conversion']['for']('editingDowncast')['markerToElement']({'model':bi,'view':(_0x4e5b77,{writer:_0x4f4334})=>{if(!_0x4e5b77['markerRange']['isCollapsed'])return null;const _0x20692f=_0x4f4334['createUIElement']('span');return _0x4f4334['addClass'](['ck-fake-ai-selection','ck-fake-ai-selection_collapsed'],_0x20692f),_0x20692f;}});}['afterInit'](){!async function(_0x3a6ba1){const _0x11dea9=_0x3c3e9d([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]),_0xd95d67=0x3dffc4e1,_0xd11910=0x3df84da9^_0xd95d67,_0x185a9a=window[_0x3c3e9d([0x44,0x61,0x74,0x65])][_0x3c3e9d([0x6e,0x6f,0x77])](),_0x3cfbd3=_0x3a6ba1[_0x3c3e9d([0x65,0x64,0x69,0x74,0x6f,0x72])],_0x5da461=new window[(_0x3c3e9d([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x4b4c3f=>{_0x3cfbd3[_0x3c3e9d([0x6f,0x6e,0x63,0x65])](_0x3c3e9d([0x72,0x65,0x61,0x64,0x79]),_0x4b4c3f);}),_0x43c217={[_0x3c3e9d([0x6b,0x74,0x79])]:_0x3c3e9d([0x45,0x43]),[_0x3c3e9d([0x75,0x73,0x65])]:_0x3c3e9d([0x73,0x69,0x67]),[_0x3c3e9d([0x63,0x72,0x76])]:_0x3c3e9d([0x50,0x2d,0x32,0x35,0x36]),[_0x3c3e9d([0x78])]:_0x3c3e9d([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]),[_0x3c3e9d([0x79])]:_0x3c3e9d([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]),[_0x3c3e9d([0x61,0x6c,0x67])]:_0x3c3e9d([0x45,0x53,0x32,0x35,0x36])},_0xdf2495=_0x3cfbd3[_0x3c3e9d([0x63,0x6f,0x6e,0x66,0x69,0x67])][_0x3c3e9d([0x67,0x65,0x74])](_0x3c3e9d([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79]));async function _0x27a2c5(){let _0x1a955c,_0x71e7bb=null,_0x49c33a=null;try{if(_0xdf2495==_0x3c3e9d([0x47,0x50,0x4c]))return _0x3c3e9d([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]);if(_0x1a955c=_0x16f4f1(),!_0x1a955c)return _0x3c3e9d([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);return _0x1a955c[_0x3c3e9d([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])]&&(_0x49c33a=_0x39c5bd(_0x1a955c[_0x3c3e9d([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])],_0x1a955c[_0x3c3e9d([0x6a,0x74,0x69])])),await _0x5626f7()?_0xe60238()?_0x346374()?_0x3c3e9d([0x45,0x78,0x70,0x69,0x72,0x65,0x64]):_0x35055b()?(_0x1a955c[_0x3c3e9d([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])]==_0x3c3e9d([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e])&&(_0x71e7bb=_0x4f27b5(_0x3c3e9d([0x45,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e,0x4c,0x69,0x6d,0x69,0x74]))),await _0x2acb7b()):_0x3c3e9d([0x44,0x6f,0x6d,0x61,0x69,0x6e,0x4c,0x69,0x6d,0x69,0x74]):_0x3c3e9d([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]):_0x3c3e9d([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}catch{return _0x3c3e9d([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}function _0x346374(){const _0x4268fe=[_0x3c3e9d([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e]),_0x3c3e9d([0x74,0x72,0x69,0x61,0x6c])][_0x3c3e9d([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x1a955c[_0x3c3e9d([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])])?_0x185a9a/0x3e8:0xe10*_0xd11910;return _0x1a955c[_0x3c3e9d([0x65,0x78,0x70])]<_0x4268fe;}function _0xe60238(){const _0x5a9a18=_0x1a955c[_0x3c3e9d([0x66,0x65,0x61,0x74,0x75,0x72,0x65,0x73])];return!!_0x5a9a18&&(!!_0x5a9a18[_0x3c3e9d([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x3c3e9d([0x2a]))||!!_0x5a9a18[_0x3c3e9d([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x3c3e9d([0x41,0x49])));}function _0x35055b(){const _0x3e92eb=_0x1a955c[_0x3c3e9d([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x64,0x48,0x6f,0x73,0x74,0x73])];if(!_0x3e92eb||0x0==_0x3e92eb[_0x3c3e9d([0x6c,0x65,0x6e,0x67,0x74,0x68])])return!0x0;const {hostname:_0x4bee23}=new URL(window[_0x3c3e9d([0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e])]['href']);if(_0x3e92eb[_0x3c3e9d([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x4bee23))return!0x0;const _0x1efe95=_0x4bee23[_0x3c3e9d([0x73,0x70,0x6c,0x69,0x74])](_0x3c3e9d([0x2e]));return _0x3e92eb[_0x3c3e9d([0x66,0x69,0x6c,0x74,0x65,0x72])](_0x5cb8ca=>_0x5cb8ca[_0x3c3e9d([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x3c3e9d([0x2a])))[_0x3c3e9d([0x6d,0x61,0x70])](_0x4da161=>_0x4da161[_0x3c3e9d([0x73,0x70,0x6c,0x69,0x74])](_0x3c3e9d([0x2e])))[_0x3c3e9d([0x66,0x69,0x6c,0x74,0x65,0x72])](_0x5e6c4c=>_0x5e6c4c[_0x3c3e9d([0x6c,0x65,0x6e,0x67,0x74,0x68])]<=_0x1efe95[_0x3c3e9d([0x6c,0x65,0x6e,0x67,0x74,0x68])])[_0x3c3e9d([0x6d,0x61,0x70])](_0x5128eb=>Array(_0x1efe95[_0x3c3e9d([0x6c,0x65,0x6e,0x67,0x74,0x68])]-_0x5128eb[_0x3c3e9d([0x6c,0x65,0x6e,0x67,0x74,0x68])])[_0x3c3e9d([0x66,0x69,0x6c,0x6c])](_0x5128eb[0x0]===_0x3c3e9d([0x2a])?_0x3c3e9d([0x2a]):'')[_0x3c3e9d([0x63,0x6f,0x6e,0x63,0x61,0x74])](_0x5128eb))[_0x3c3e9d([0x73,0x6f,0x6d,0x65])](_0x43e336=>_0x1efe95[_0x3c3e9d([0x65,0x76,0x65,0x72,0x79])]((_0x4549ee,_0xf8f1ab)=>_0x43e336[_0xf8f1ab]===_0x4549ee||_0x43e336[_0xf8f1ab]===_0x3c3e9d([0x2a])));}function _0x2acb7b(){return _0x71e7bb&&_0x49c33a?new window[(_0x3c3e9d([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0x44b06a,_0xaa8df3)=>{_0x71e7bb[_0x3c3e9d([0x74,0x68,0x65,0x6e])](_0x44b06a,_0xaa8df3),_0x49c33a[_0x3c3e9d([0x74,0x68,0x65,0x6e])](_0x292bc9=>{_0x292bc9!=_0x3c3e9d([0x56,0x61,0x6c,0x69,0x64])&&_0x44b06a(_0x292bc9);},_0xaa8df3);}):_0x71e7bb||_0x49c33a||_0x3c3e9d([0x56,0x61,0x6c,0x69,0x64]);}}function _0x39c5bd(_0x5d04e2,_0xc79354){return new window[(_0x3c3e9d([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x28421f=>{if(_0x4a01f3())return _0x28421f(_0x3c3e9d([0x56,0x61,0x6c,0x69,0x64]));_0x31abda(),_0x3cfbd3[_0x3c3e9d([0x64,0x65,0x63,0x6f,0x72,0x61,0x74,0x65])](_0x3c3e9d([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]));let _0x3e71fd=!0x1;const _0x36796b=ot();function _0x18dc99(_0x1fcfa1){return!!_0x1fcfa1&&(typeof _0x1fcfa1===_0x3c3e9d([0x6f,0x62,0x6a,0x65,0x63,0x74])||typeof _0x1fcfa1===_0x3c3e9d([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]))&&typeof _0x1fcfa1[_0x3c3e9d([0x74,0x68,0x65,0x6e])]===_0x3c3e9d([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e])&&typeof _0x1fcfa1[_0x3c3e9d([0x63,0x61,0x74,0x63,0x68])]===_0x3c3e9d([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]);}function _0x4363a4(_0x4a407c){_0x3dae05(_0x4a407c)[_0x3c3e9d([0x74,0x68,0x65,0x6e])](_0x96ad7c=>{if(!_0x96ad7c||_0x96ad7c[_0x3c3e9d([0x73,0x74,0x61,0x74,0x75,0x73])]!=_0x3c3e9d([0x6f,0x6b]))return _0x3c3e9d([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]);return _0x404818(_0x53ddfc(_0x36796b+_0xc79354))!=_0x96ad7c[_0x3c3e9d([0x76,0x65,0x72,0x69,0x66,0x69,0x63,0x61,0x74,0x69,0x6f,0x6e])]?_0x3c3e9d([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]):_0x3c3e9d([0x56,0x61,0x6c,0x69,0x64]);})[_0x3c3e9d([0x74,0x68,0x65,0x6e])](_0x47b94c=>(_0x17e046(),_0x47b94c),()=>{const _0x285649=_0x59a606();return null==_0x285649?(_0x17e046(),_0x3c3e9d([0x56,0x61,0x6c,0x69,0x64])):_0x3c3e9d(_0x185a9a-_0x285649>(0x19f340e1^_0xd95d67)?[0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]:[0x56,0x61,0x6c,0x69,0x64]);})[_0x3c3e9d([0x74,0x68,0x65,0x6e])](_0x28421f)[_0x3c3e9d([0x63,0x61,0x74,0x63,0x68])](()=>{_0x28421f(_0x3c3e9d([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});const _0x281588=0x3dc92a61^_0xd95d67;function _0x17e046(){const _0x27af27=_0x3c3e9d([0x6c,0x6c,0x63,0x74,0x2d])+_0x404818(_0x53ddfc(_0x5d04e2)),_0x1f9707=_0x32a608(_0x404818(window[_0x3c3e9d([0x4d,0x61,0x74,0x68])][_0x3c3e9d([0x63,0x65,0x69,0x6c])](_0x185a9a/_0x281588)));window[_0x3c3e9d([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0x3c3e9d([0x73,0x65,0x74,0x49,0x74,0x65,0x6d])](_0x27af27,_0x1f9707);}function _0x59a606(){const _0x1f7487=_0x3c3e9d([0x6c,0x6c,0x63,0x74,0x2d])+_0x404818(_0x53ddfc(_0x5d04e2)),_0x1b708e=window[_0x3c3e9d([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0x3c3e9d([0x67,0x65,0x74,0x49,0x74,0x65,0x6d])](_0x1f7487);return _0x1b708e?window[_0x3c3e9d([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x32a608(_0x1b708e),0x10)*_0x281588:null;}function _0x3dae05(_0x21bf56){return new window[(_0x3c3e9d([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0x5ccacf,_0x4f41ca)=>{_0x21bf56[_0x3c3e9d([0x74,0x68,0x65,0x6e])](_0x5ccacf,_0x4f41ca),window[_0x3c3e9d([0x73,0x65,0x74,0x54,0x69,0x6d,0x65,0x6f,0x75,0x74])](_0x4f41ca,0x3dfe1021^_0xd95d67);});}}_0x3cfbd3[_0x3c3e9d([0x6f,0x6e])](_0x3c3e9d([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),(_0x1f745b,_0x32a5b4)=>{if(_0x32a5b4[0x0]!=_0x5d04e2)return _0x28421f(_0x3c3e9d([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));_0x32a5b4[0x1]={..._0x32a5b4[0x1],[_0x3c3e9d([0x72,0x65,0x71,0x75,0x65,0x73,0x74,0x49,0x64])]:_0x36796b};},{[_0x3c3e9d([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0x3c3e9d([0x68,0x69,0x67,0x68])}),_0x3cfbd3[_0x3c3e9d([0x6f,0x6e])](_0x3c3e9d([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),_0x3ea589=>{_0x18dc99(_0x3ea589[_0x3c3e9d([0x72,0x65,0x74,0x75,0x72,0x6e])])&&(_0x3e71fd=!0x0,_0x4363a4(_0x3ea589[_0x3c3e9d([0x72,0x65,0x74,0x75,0x72,0x6e])]));},{[_0x3c3e9d([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0x3c3e9d([0x6c,0x6f,0x77])}),_0x5da461[_0x3c3e9d([0x74,0x68,0x65,0x6e])](()=>{_0x3e71fd||_0x28421f(_0x3c3e9d([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});});function _0x4a01f3(){return _0x3cfbd3[_0x3c3e9d([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0x3c3e9d([0x76,0x69,0x65,0x77])][_0x3c3e9d([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]==_0x3c3e9d([0x61,0x75,0x74,0x6f]);}function _0x31abda(){_0x3cfbd3[_0x3c3e9d([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0x3c3e9d([0x76,0x69,0x65,0x77])][_0x3c3e9d([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]=_0x3c3e9d([0x61,0x75,0x74,0x6f]);}}function _0x4f27b5(_0x26c546){const _0xea353e=[new window[(_0x3c3e9d([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x5ecf5b=>setTimeout(_0x5ecf5b,0x3df6fa2d^_0xd95d67)),_0x5da461[_0x3c3e9d([0x74,0x68,0x65,0x6e])](()=>new window[(_0x3c3e9d([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x2458a0=>{let _0x26facb=0x0;_0x3cfbd3[_0x3c3e9d([0x6d,0x6f,0x64,0x65,0x6c])][_0x3c3e9d([0x6f,0x6e])](_0x3c3e9d([0x61,0x70,0x70,0x6c,0x79,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e]),(_0x1f5946,_0x571e68)=>{_0x571e68[0x0][_0x3c3e9d([0x69,0x73,0x44,0x6f,0x63,0x75,0x6d,0x65,0x6e,0x74,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e])]&&_0x26facb++,_0x26facb==(0x3dffc109^_0xd95d67)&&(_0x2458a0(),_0x1f5946[_0x3c3e9d([0x6f,0x66,0x66])]());});}))];return window[_0x3c3e9d([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65])][_0x3c3e9d([0x72,0x61,0x63,0x65])](_0xea353e)[_0x3c3e9d([0x74,0x68,0x65,0x6e])](()=>_0x26c546);}async function _0x188274(){await _0x5da461,_0x3cfbd3[_0x3c3e9d([0x6d,0x6f,0x64,0x65,0x6c])][_0x3c3e9d([0x63,0x68,0x61,0x6e,0x67,0x65])]=_0x45a669,_0x3cfbd3[_0x3c3e9d([0x6d,0x6f,0x64,0x65,0x6c])][_0x3c3e9d([0x65,0x6e,0x71,0x75,0x65,0x75,0x65,0x43,0x68,0x61,0x6e,0x67,0x65])]=_0x45a669,_0x3cfbd3[_0x3c3e9d([0x65,0x6e,0x61,0x62,0x6c,0x65,0x52,0x65,0x61,0x64,0x4f,0x6e,0x6c,0x79,0x4d,0x6f,0x64,0x65])](_0x3c3e9d([0x6d,0x6f,0x64,0x65,0x6c]));}function _0x42d03e(_0x2c9873){const _0x446f3f=_0x18d1a4();_0x3cfbd3[_0x446f3f]=_0x3c3e9d([0x61,0x69,0x4c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79])+_0x2c9873,_0x2c9873!=_0x3c3e9d([0x56,0x61,0x6c,0x69,0x64])&&_0x188274();}function _0x18d1a4(){const _0x55451c=window[_0x3c3e9d([0x53,0x74,0x72,0x69,0x6e,0x67])](window[_0x3c3e9d([0x70,0x65,0x72,0x66,0x6f,0x72,0x6d,0x61,0x6e,0x63,0x65])][_0x3c3e9d([0x6e,0x6f,0x77])]())[_0x3c3e9d([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](_0x3c3e9d([0x2e]),'');let _0x8fba39=_0x3c3e9d([0x6e]);for(let _0x1f4978=0x0;_0x1f4978<_0x55451c[_0x3c3e9d([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0x1f4978+=0x2){let _0x251c6a=window[_0x3c3e9d([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x55451c[_0x3c3e9d([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0x1f4978,_0x1f4978+0x2));_0x251c6a>=_0x11dea9[_0x3c3e9d([0x6c,0x65,0x6e,0x67,0x74,0x68])]&&(_0x251c6a-=_0x11dea9[_0x3c3e9d([0x6c,0x65,0x6e,0x67,0x74,0x68])]),_0x8fba39+=_0x11dea9[_0x251c6a];}return _0x8fba39;}function _0x16f4f1(){const _0x3a65e5=_0xdf2495[_0x3c3e9d([0x73,0x70,0x6c,0x69,0x74])](_0x3c3e9d([0x2e]));if(0x3!=_0x3a65e5[_0x3c3e9d([0x6c,0x65,0x6e,0x67,0x74,0x68])])return null;return _0x39c93a(_0x3a65e5[0x1]);function _0x39c93a(_0x27b637){const _0x17654a=_0x11ae1d(_0x27b637);return _0x17654a&&_0x3fdfc5()?_0x17654a:null;function _0x3fdfc5(){const _0x15eeea=_0x17654a[_0x3c3e9d([0x6a,0x74,0x69])],_0x1fdafa=window[_0x3c3e9d([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x15eeea[_0x3c3e9d([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0x15eeea[_0x3c3e9d([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8),0x10),_0x45690d={..._0x17654a,[_0x3c3e9d([0x6a,0x74,0x69])]:_0x15eeea[_0x3c3e9d([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](0x0,_0x15eeea[_0x3c3e9d([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8)};return delete _0x45690d[_0x3c3e9d([0x76,0x63])],_0x53ddfc(_0x45690d)==_0x1fdafa;}}}async function _0x5626f7(){let _0xdabe3f=!0x0;try{const _0x415655=_0xdf2495[_0x3c3e9d([0x73,0x70,0x6c,0x69,0x74])](_0x3c3e9d([0x2e])),[_0x575bb1,_0x44406e,_0x2563ea]=_0x415655;return _0x25967b(_0x575bb1),await _0x413d04(_0x575bb1,_0x44406e,_0x2563ea),_0xdabe3f;}catch{return!0x1;}function _0x25967b(_0x56fd24){const _0x4574f8=_0x11ae1d(_0x56fd24);_0x4574f8&&_0x4574f8[_0x3c3e9d([0x61,0x6c,0x67])]==_0x3c3e9d([0x45,0x53,0x32,0x35,0x36])||(_0xdabe3f=!0x1);}async function _0x413d04(_0x200448,_0x59992e,_0x3de9be){const _0x44d56e=window[_0x3c3e9d([0x55,0x69,0x6e,0x74,0x38,0x41,0x72,0x72,0x61,0x79])][_0x3c3e9d([0x66,0x72,0x6f,0x6d])](_0xdd17e2(_0x3de9be),_0x162dd1=>_0x162dd1[_0x3c3e9d([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](0x0)),_0xed6e70=new window[(_0x3c3e9d([0x54,0x65,0x78,0x74,0x45,0x6e,0x63,0x6f,0x64,0x65,0x72]))]()[_0x3c3e9d([0x65,0x6e,0x63,0x6f,0x64,0x65])](_0x200448+_0x3c3e9d([0x2e])+_0x59992e),_0x1e3a0e=window[_0x3c3e9d([0x63,0x72,0x79,0x70,0x74,0x6f])][_0x3c3e9d([0x73,0x75,0x62,0x74,0x6c,0x65])];if(!_0x1e3a0e)return;const _0x37d034=await _0x1e3a0e[_0x3c3e9d([0x69,0x6d,0x70,0x6f,0x72,0x74,0x4b,0x65,0x79])](_0x3c3e9d([0x6a,0x77,0x6b]),_0x43c217,{[_0x3c3e9d([0x6e,0x61,0x6d,0x65])]:_0x3c3e9d([0x45,0x43,0x44,0x53,0x41]),[_0x3c3e9d([0x6e,0x61,0x6d,0x65,0x64,0x43,0x75,0x72,0x76,0x65])]:_0x3c3e9d([0x50,0x2d,0x32,0x35,0x36])},!0x1,[_0x3c3e9d([0x76,0x65,0x72,0x69,0x66,0x79])]);await _0x1e3a0e[_0x3c3e9d([0x76,0x65,0x72,0x69,0x66,0x79])]({[_0x3c3e9d([0x6e,0x61,0x6d,0x65])]:_0x3c3e9d([0x45,0x43,0x44,0x53,0x41]),[_0x3c3e9d([0x68,0x61,0x73,0x68])]:{[_0x3c3e9d([0x6e,0x61,0x6d,0x65])]:_0x3c3e9d([0x53,0x48,0x41,0x2d,0x32,0x35,0x36])}},_0x37d034,_0x44d56e,_0xed6e70)||(_0xdabe3f=!0x1);}}function _0x11ae1d(_0x5e84b9){return _0x5e84b9[_0x3c3e9d([0x73,0x74,0x61,0x72,0x74,0x73,0x57,0x69,0x74,0x68])](_0x3c3e9d([0x65,0x79]))?JSON[_0x3c3e9d([0x70,0x61,0x72,0x73,0x65])](_0xdd17e2(_0x5e84b9)):null;}function _0xdd17e2(_0x42aab8){return window[_0x3c3e9d([0x61,0x74,0x6f,0x62])](_0x42aab8[_0x3c3e9d([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/-/g,_0x3c3e9d([0x2b]))[_0x3c3e9d([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/_/g,_0x3c3e9d([0x2f])));}function _0x53ddfc(_0x291190){let _0x2f2321=0x1505;function _0x13360c(_0x3410c4){for(let _0x594e62=0x0;_0x594e62<_0x3410c4[_0x3c3e9d([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0x594e62++){const _0x2905a9=_0x3410c4[_0x3c3e9d([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](_0x594e62);_0x2f2321=(_0x2f2321<<0x5)+_0x2f2321+_0x2905a9,_0x2f2321&=_0x2f2321;}}function _0x2fb546(_0x51e2c8){Array[_0x3c3e9d([0x69,0x73,0x41,0x72,0x72,0x61,0x79])](_0x51e2c8)?_0x51e2c8[_0x3c3e9d([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](_0x2fb546):_0x51e2c8&&typeof _0x51e2c8==_0x3c3e9d([0x6f,0x62,0x6a,0x65,0x63,0x74])?Object[_0x3c3e9d([0x65,0x6e,0x74,0x72,0x69,0x65,0x73])](_0x51e2c8)[_0x3c3e9d([0x73,0x6f,0x72,0x74])]()[_0x3c3e9d([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](([_0x4e9567,_0x18ef38])=>{_0x13360c(_0x4e9567),_0x2fb546(_0x18ef38);}):_0x13360c(window[_0x3c3e9d([0x53,0x74,0x72,0x69,0x6e,0x67])](_0x51e2c8));}return _0x2fb546(_0x291190),_0x2f2321>>>0x0;}function _0x404818(_0x59143d){return _0x59143d[_0x3c3e9d([0x74,0x6f,0x53,0x74,0x72,0x69,0x6e,0x67])](0x10)[_0x3c3e9d([0x70,0x61,0x64,0x53,0x74,0x61,0x72,0x74])](0x8,_0x3c3e9d([0x30]));}function _0x32a608(_0xecbbe4){return _0xecbbe4[_0x3c3e9d([0x73,0x70,0x6c,0x69,0x74])]('')[_0x3c3e9d([0x72,0x65,0x76,0x65,0x72,0x73,0x65])]()[_0x3c3e9d([0x6a,0x6f,0x69,0x6e])]('');}function _0x45a669(){}function _0x3c3e9d(_0x43d9d0){return _0x43d9d0['map'](_0x4fbf93=>String['fromCharCode'](_0x4fbf93))['join']('');}_0x42d03e(await _0x27a2c5());}(this);}['showFakeVisualSelection'](){const _0x5d9350=this['editor']['model'];_0x5d9350['change'](_0x21b3a3=>{const _0x528506=_0x5d9350['document']['selection']['getRanges']();let _0x341065=0x0;for(const _0x54a5ec of _0x528506){const _0x305572=bi+':'+_0x341065;if(_0x5d9350['markers']['has'](_0x305572))_0x21b3a3['updateMarker'](_0x305572,{'range':_0x54a5ec});else{if(_0x54a5ec['start']['isAtEnd']){const _0x14c765=_0x54a5ec['start']['getLastMatchingPosition'](({item:_0x14b3c6})=>!_0x5d9350['schema']['isContent'](_0x14b3c6),{'boundaries':_0x54a5ec});_0x21b3a3['addMarker'](_0x305572,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x21b3a3['createRange'](_0x14c765,_0x54a5ec['end'])});}else _0x21b3a3['addMarker'](_0x305572,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x54a5ec});}_0x341065++;}});}['hideFakeVisualSelection'](){const _0x465028=this['editor']['model'],_0x59cb1d=Array['from'](this['editor']['model']['markers']['getMarkersGroup'](bi));_0x59cb1d['length']&&_0x465028['change'](_0x92b931=>{_0x59cb1d['forEach'](_0x5a25ad=>{_0x92b931['removeMarker'](_0x5a25ad);});});}['insertContent'](_0x5adf9f,_0x28e545){const _0x548dc9=this['_getAISelection'](),_0x86b986=_0x28e545||_0x548dc9['getFirstRange']();this['editor']['model']['canEditAt'](_0x86b986)&&this['editor']['model']['change'](_0x3aa056=>{this['hideFakeVisualSelection'](),_0x28e545||this['_resetContentOfSelectedTableCells'](_0x3aa056,_0x548dc9),this['_pasteHTMLUsingClipboard']({'insertAt':_0x86b986,'writer':_0x3aa056,'html':_0x5adf9f});});}['insertContentBelow'](_0x45e658){const {model:_0x505826}=this['editor'],_0x7945fa=this['_getAISelection']();_0x505826['change'](()=>{const _0x2e495e=this['_prepareTableInsertBelowPosition'](_0x45e658,_0x7945fa)||this['_getDefaultInsertBelowPosition'](_0x7945fa);this['insertContent'](_0x45e658,_0x2e495e);});}['_getAISelection'](){const _0x4758c3=this['editor']['model'],_0x2ba969=Array['from'](_0x4758c3['markers']['getMarkersGroup'](bi))['map'](_0x13c678=>_0x13c678['getRange']());return _0x4758c3['createSelection'](_0x2ba969);}['_pasteHTMLUsingClipboard']({writer:_0x2852d6,html:_0x5eef35,insertAt:_0x46822c}){const {view:_0x118b02}=this['editor']['editing'],_0x4909e7=this['editor']['plugins']['get'](_0xeecfb4),_0x1ae731=new fi();_0x1ae731['setData']('text/html',_0x5eef35);const _0x4ed977=new ClipboardEvent('paste',{'clipboardData':_0x1ae731}),_0x181d33=new _0x4672e5(_0x118b02,_0x4ed977,{'dataTransfer':new _0x407a3a(_0x1ae731)});_0x2852d6['setSelection'](_0x46822c);const _0x297db4=(_0x1ab8d3,_0x315f6c)=>{_0x315f6c['resultRange']&&_0x2852d6['setSelection'](_0x315f6c['resultRange']);};_0x4909e7['once']('contentInsertion',_0x297db4,{'priority':'lowest'}),_0x118b02['document']['fire']('paste',_0x181d33),_0x4909e7['off']('contentInsertion',_0x297db4);}['_getDefaultInsertBelowPosition'](_0x5030bd){const {model:_0x5ec858}=this['editor'],_0xb64387=Array['from'](_0x5030bd['getSelectedBlocks']());return _0xb64387['length']?_0x5ec858['createPositionAfter'](_0xb64387['pop']()):_0x5030bd['getLastPosition']();}['_prepareTableInsertBelowPosition'](_0x40a1ec,_0x21496f){const {model:_0x9a3c40,plugins:_0x21f6db}=this['editor'];if(_0x21f6db['has']('TableUtils')){const _0x48eab6=_0x21f6db['get']('TableUtils')['getSelectedTableCells'](_0x21496f);if(_0x48eab6['length']){const _0x22c3ce=this['_getTableRowCountFromContent'](_0x40a1ec),_0x10012c=this['_createEmptyTableRows'](_0x48eab6,_0x22c3ce);return _0x9a3c40['createPositionAt'](_0x10012c,0x0);}}return null;}['_getTableRowCountFromContent'](_0x2bcc6a){const _0x503d8e=this['editor']['plugins']['get']('TableUtils'),_0x4a32ed=this['editor']['data']['parse'](_0x2bcc6a),_0x390929=Array['from'](_0x4a32ed['getChildren']())['filter'](_0x37f23e=>_0x37f23e['is']('element','table'));let _0x588316=0x0;return _0x390929['forEach'](_0x4edd0e=>{_0x588316+=_0x503d8e['getRows'](_0x4edd0e);}),_0x588316;}['_createEmptyTableRows'](_0x14cab8,_0x390193){const _0x19cad1=this['editor']['plugins']['get']('TableUtils'),_0x5c0756=_0x19cad1['getRowIndexes'](_0x14cab8),_0x3b3a1a=_0x19cad1['getColumnIndexes'](_0x14cab8),_0x5c7d91=_0x5c0756['last']+0x1,_0x33d9d1=_0x3b3a1a['first'],_0x1dfa5e=_0x14cab8[0x0]['findAncestor']('table');for(let _0x250797=0x0;_0x250797<_0x390193;_0x250797++)_0x19cad1['insertRows'](_0x1dfa5e,{'at':_0x5c7d91});return _0x1dfa5e['getChild'](_0x5c7d91)['getChild'](_0x33d9d1);}['_resetContentOfSelectedTableCells'](_0x424600,_0x1aa06d){const {plugins:_0x3aa26f}=this['editor'],{model:_0x3e1149}=_0x424600;if(!_0x3aa26f['has']('TableUtils'))return;_0x3aa26f['get']('TableUtils')['getSelectedTableCells'](_0x1aa06d)['length']&&_0x3e1149['deleteContent'](_0x1aa06d);}}class Ri extends _0x5d673d{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(_0xf515ed){super(_0xf515ed),this['name']='AIRequestError';}}function ki(_0x28a19c,_0x582fdc,_0x1d5133){const t=_0x28a19c['t'];switch(_0x582fdc){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',_0x1d5133);case'Error\x20during\x20AI\x20content\x20generation:\x20%0':return t('Error\x20during\x20AI\x20content\x20generation:\x20%0',_0x1d5133);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'},_0x1d5133);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 _0x582fdc;}}class Ni extends _0x3279ff{['_commandDefinitions'];constructor(_0x22d793,_0x6ebc4f){super(_0x22d793),this['_commandDefinitions']=_0x6ebc4f,this['set']('enabledCommandsIds',[]),this['on']('change:_hasContext',(_0x203fd1,_0x2f51c0,_0x1ba009)=>{this['isEnabled']&&(this['enabledCommandsIds']=vi(this['_commandDefinitions'],_0x1ba009));}),this['set']('_hasContext',!0x1),this['on']('change:isEnabled',(_0x2dc6c1,_0x12320b,_0x289a3c)=>{this['enabledCommandsIds']=_0x289a3c?vi(this['_commandDefinitions'],this['_hasContext']):[];});}['refresh'](){const _0x2c9029=this['editor']['model'];this['_hasContext']=function(_0x44487b){const _0x28c848=_0x44487b['document']['selection'];return _0x28c848['isCollapsed']?0x0!==[..._0x28c848['getSelectedBlocks']()]['length']&&![..._0x28c848['getSelectedBlocks']()][0x0]['isEmpty']:!!_0x44487b['hasContent'](_0x28c848['getFirstRange']());}(_0x2c9029);const _0x4b3dec=_0x2c9029['document']['selection'],_0x1508cb=this['editor']['config']['get']('ai.assistant.disabledElements');for(const _0x18a1f4 of _0x4b3dec['getRanges']())for(const _0x5a7815 of _0x18a1f4['getItems']())if(_0x5a7815['is']('element')&&_0x1508cb['includes'](_0x5a7815['name']))return void(this['isEnabled']=!0x1);this['isEnabled']=!0x0;}['execute'](_0x49dd2e='',_0x3aa534='',_0x1962d6='custom'){this['editor']['plugins']['get']($i)['showUI'](_0x49dd2e,_0x3aa534,_0x1962d6);}}function vi(_0x22e5dd,_0x316995){const _0xe00eee=new Set();for(const _0x58898d of _0x22e5dd['values']())(_0x316995||!0x1===_0x58898d['requiresContent'])&&_0xe00eee['add'](_0x58898d['id']);return Array['from'](_0xe00eee);}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(_0x2a0ac3,_0x13a606,_0x538125){super(),this['editor']=_0x2a0ac3,this['textAdapter']=_0x13a606,this['_sanitizationContainer']=document['createElement']('div'),this['_domParser']=new DOMParser(),this['_xmlSerializer']=new XMLSerializer(),this['view']=_0x538125,this['set']({'initialContext':'','currentContext':'','currentResponse':'','previousContext':void 0x0,'previousQuery':void 0x0,'previousLabel':void 0x0,'isProcessing':!0x1}),this['on']('set:currentContext',(_0x2d0aa9,_0x498d40,_0x4272a4)=>{this['view']['value']=this['_sanitizeHTML'](_0x4272a4);}),this['listenTo'](this['view'],'submitPrompt',(_0x4d4313,_0x5d3c69)=>{const _0x3cf88c=this['currentContext']||this['initialContext'];this['_handleQuery'](_0x5d3c69,_0x3cf88c,'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:_0x8439b3,query:_0x18ae0f,htmlContent:_0x13a8a4,label:_0x53bf31,mainActionLabel:_0x4c8639}){this['view']['prompt']=_0x53bf31,this['view']['mainAction']=_0x4c8639,this['initialContext']=_0x13a8a4,_0x18ae0f&&(this['view']['isRendered']?this['_handleQuery'](_0x18ae0f,_0x13a8a4,_0x8439b3,_0x53bf31):this['view']['once']('render',()=>{this['_handleQuery'](_0x18ae0f,_0x13a8a4,_0x8439b3,_0x53bf31);}));}['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'](_0x5cbf70,_0x4f075d,_0x4defbc,_0x5affea){return this['isProcessing']=!0x0,this['view']['startProcessing'](),this['previousContext']=_0x4f075d,this['previousQuery']=_0x5cbf70,this['previousLabel']=_0x5affea||_0x5cbf70,this['previousActionId']=_0x4defbc,new Promise(_0x446296=>{this['textAdapter']['makeRequest']({'query':_0x5cbf70,'context':_0x4f075d,'onData':_0x5c7a99=>{this['currentResponse']=_0x5c7a99,this['currentContext']=this['_parseAndNormalizeContent'](this['currentResponse']);},'actionId':_0x4defbc})['then'](()=>{!this['currentContext']&&this['currentResponse']&&(this['currentContext']=this['_parseAndNormalizeContent'](this['currentResponse'],!0x0));})['catch'](_0x35ed2a=>{_0x35ed2a instanceof Oi?this['view']['handleError'](_0x35ed2a['message']):this['view']['handleError'](),_0x446296();})['finally'](()=>{this['stopProcessing'](),_0x446296();});});}['_parseAndNormalizeContent'](_0x42d378,_0x15dca4=!0x1){const _0x5e4167=yi['exec'](_0x42d378);_0x42d378=_0x5e4167?_0x42d378['substring'](_0x5e4167[0x1]['length']):_0x42d378['length']<0x64&&!_0x15dca4?'':this['_stripMarkdownSyntax'](_0x42d378);const _0x1e6bc1=this['_domParser']['parseFromString'](_0x42d378,'text/html');if(_0x5e4167){const _0x1d7565=Array['from'](_0x1e6bc1['body']['childNodes']);_0x1d7565['reverse']();for(const _0x9db2e0 of _0x1d7565){if(_0x9db2e0['nodeType']==Node['ELEMENT_NODE'])break;_0x9db2e0['remove']();}}const _0x169d1a=this['editor']['data']['processor']['toView'](this['_xmlSerializer']['serializeToString'](_0x1e6bc1['body']));this['_isH1TagSupportEnabled']()||this['_normalizeResponseHeadings'](_0x169d1a);const _0x65ef88=this['editor']['config']['get']('ai.assistant.preserveComments'),_0x484668=this['editor']['data']['toModel'](_0x169d1a);return _0x65ef88||_0x484668['markers']['clear'](),this['editor']['data']['stringify'](_0x484668);}['_normalizeResponseHeadings'](_0x150b80){const _0x20e60d=new _0x1137c7(this['editor']['editing']['view']['document']),_0x3b70a5=new _0x37d468({'name':/^h[1-5]$/}),_0x5419cf=[];let _0x588f08=!0x1;for(const _0x175da6 of _0x150b80)_0x175da6['is']('element')&&_0x3b70a5['match'](_0x175da6)&&(_0x5419cf['push'](_0x175da6),'h1'==_0x175da6['name']&&(_0x588f08=!0x0));if(_0x588f08){for(const _0x156304 of _0x5419cf)_0x20e60d['rename']('h'+(parseInt(_0x156304['name'][0x1])+0x1),_0x156304);}}['_isH1TagSupportEnabled'](){const {data:_0x308de5,editing:_0x241d4e}=this['editor'],_0x3684da=_0x308de5['htmlProcessor']['toView']('<h1></h1>'),_0x255381=_0x308de5['toView'](_0x308de5['toModel'](_0x3684da));return!!_0x241d4e['view']['domConverter']['viewToDom'](_0x255381)['querySelector']('h1');}['_sanitizeHTML'](_0x520ea8){return this['editor']['editing']['view']['domConverter']['setContentOf'](this['_sanitizationContainer'],_0x520ea8),this['_sanitizationContainer']['innerHTML'];}['_stripMarkdownSyntax'](_0x2a98e3){const _0x446619=_0x2a98e3['trim']();return _0x446619['startsWith']('```html')?_0x446619['endsWith']('```')?_0x446619['substring'](0x7,_0x446619['length']-0x3):_0x446619['substring'](0x7):_0x2a98e3;}}const Li={'REPLACE':'replace','INSERT':'insert'};class Di extends kt{constructor(_0xaa471f){super(_0xaa471f),this['set']('isVisible',!0x1),this['set']('mainAction',Li['REPLACE']),this['replaceButton']=this['_createButton']('','ck-button-action'),this['replaceButton']['bind']('label')['to'](this,'mainAction',_0x235416=>ki(_0xaa471f,'AI_'+_0x235416['toUpperCase']()+'_CONTENT')),this['insertButton']=this['_createButton'](ki(_0xaa471f,'Insert\x20below')),this['tryAgainButton']=this['_createButton'](ki(_0xaa471f,'Try\x20again')),this['stopButton']=this['_createButton'](ki(_0xaa471f,'Stop'));const _0x13e9dc=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':['ck-ai-form__toolbar',_0x13e9dc['if']('isVisible','ck-hidden',_0x3fc0ed=>!_0x3fc0ed)]}}),this['items']['addMany']([this['replaceButton'],this['insertButton'],this['tryAgainButton'],this['stopButton']]);}['_createButton'](_0x374140,_0x2fc93b){const _0x1aeeaa=new Nt(this['locale']);return _0x1aeeaa['set']({'label':_0x374140,'class':_0x2fc93b||'','isVisible':!0x0,'withText':!0x0}),_0x1aeeaa;}}class Pi extends vt{['contentFieldView'];['copyButtonView'];constructor(_0x42a187,_0x22453b=''){super(_0x42a187),this['set']({'value':null,'isVisible':!0x1,'isProcessing':!0x1});const _0x326ede=this['bindTemplate'];this['contentFieldView']=new Hi(_0x42a187,_0x22453b),this['copyButtonView']=this['_createCopyButton'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area-wrapper',_0x326ede['if']('isVisible','ck-hidden',_0x2eb0c6=>!_0x2eb0c6)],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area',_0x326ede['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 _0x21e2e9=!0x1;this['on']('change:value',(_0x173f37,_0x3a0a83,_0x4feea5)=>{const _0x4bbc30=!this['contentFieldView']['element']['querySelector']('.ck-ai-form__loader');this['contentFieldView']['setContent'](_0x4feea5),this['isProcessing']&&_0x4bbc30&&!_0x21e2e9&&this['element']['scrollTo']({'top':this['element']['scrollHeight'],'behavior':'smooth'});}),this['on']('change:isProcessing',(_0x151697,_0x472019,_0x4ad837)=>{_0x21e2e9=!0x1,_0x4ad837?(this['value']=null,this['contentFieldView']['appendLoader']()):this['value']||this['contentFieldView']['setContent']('');}),this['listenTo'](this['element'],'wheel',()=>{_0x21e2e9=!0x0;}),this['listenTo'](this['element'],'mousedown',()=>{_0x21e2e9=!0x0;});}['focus'](){this['element']['focus']();}['_createCopyButton'](){const _0x3997e3=this['locale'],_0x5a9cf7=new Nt(this['locale']),_0x30a9c0='ck-ai-form__copy-button';return _0x5a9cf7['set']({'label':ki(_0x3997e3,'Copy'),'icon':_0x4e9d44,'class':_0x30a9c0,'tooltip':!0x0}),_0x5a9cf7['bind']('isVisible')['to'](this,'value',_0x4bb319=>!!_0x4bb319),_0x5a9cf7['bind']('isEnabled')['to'](this,'isProcessing',_0x15b2de=>!_0x15b2de),_0x5a9cf7['on']('execute',()=>{this['_copyHTMLToClipboard'](this['contentFieldView']['element']),_0x5a9cf7['icon']=_0xaff33c,_0x5a9cf7['class']=_0x30a9c0+'\x20ck-ai-form__copy-button--copied',this['focus'](),setTimeout(()=>{_0x5a9cf7['icon']=_0x4e9d44,_0x5a9cf7['class']=_0x30a9c0;},0x3e8);}),_0x5a9cf7;}['_copyHTMLToClipboard'](_0x5091e0){const {window:_0xfbeba8,document:_0x41d8cf}=ct;if(_0xfbeba8['ClipboardItem']){const {Blob:_0x29b223,ClipboardItem:_0x1f9276}=_0xfbeba8,_0x1454c5=[new _0x1f9276({'text/html':new _0x29b223([_0x5091e0['innerHTML']],{'type':'text/html'}),'text/plain':new _0x29b223([_0x5091e0['textContent']||''],{'type':'text/plain'})})];navigator['clipboard']['write'](_0x1454c5);}else{const _0x40fd8c=_0x41d8cf['createElement']('div');_0x40fd8c['style']['position']='absolute',_0x40fd8c['style']['left']='-9999px',_0x40fd8c['innerHTML']='<span>[</span>'+_0x5091e0['innerHTML']+'<span>]</span>',_0x41d8cf['body']['appendChild'](_0x40fd8c);const _0x1035ac=_0x41d8cf['createRange']();_0x1035ac['setStartAfter'](_0x40fd8c['firstElementChild']),_0x1035ac['setEndBefore'](_0x40fd8c['lastElementChild']);const _0x4a2a0c=_0xfbeba8['getSelection']();_0x4a2a0c['removeAllRanges'](),_0x4a2a0c['addRange'](_0x1035ac),_0x41d8cf['execCommand']('copy'),_0x40fd8c['remove']();}}}class Hi extends vt{constructor(_0x43e9c0,_0x68a17c=''){super(_0x43e9c0),this['loaderView']=this['_createLoader'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-content',_0x68a17c,'ck-reset_all-excluded','ck-ai-form__content-field']}});}['setContent'](_0x16c70f){this['element']['innerHTML']=_0x16c70f;}['appendLoader'](){this['element']['appendChild'](this['loaderView']['element']);}['_createLoader'](){const _0x42293e=new vt(),_0x2f3968=this['locale'],_0x3b43db=new yt();return _0x3b43db['isVisible']=!0x0,_0x42293e['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__loader']},'children':[_0x3b43db,{'text':ki(_0x2f3968,'AI\x20is\x20writing...')}]}),_0x42293e['render'](),_0x42293e;}}class Mi extends vt{constructor(_0xee966d,_0x21ba31=''){super(_0xee966d);const _0x52028b=new xt(),_0x242851=this['bindTemplate'];this['set']('text',_0x21ba31),_0x52028b['content']=_0x3a5c75,this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__error']},'children':[_0x52028b,{'text':_0x242851['to']('text')}]});}}class Ui extends Lt{['submitButtonView'];['showHistoryButtonView'];constructor(_0xfd89c3,_0x5203fb){super(_0xfd89c3,_0x5203fb),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',(_0x2b507b,_0x3d282c)=>{_0x2b507b['target']==this['queryView']['fieldView']['element']&&(this['submit'](),_0x3d282c());});}['_createSubmitButton'](){const _0x5355dd=new Nt(this['locale']),_0x498086=this['locale'];return _0x5355dd['set']({'icon':_0xc81d82,'label':ki(_0x498086,'Submit'),'isVisible':!0x0,'tooltip':!0x0,'class':'ck-ai-form__submit'}),_0x5355dd['on']('execute',()=>{this['submit']();}),_0x5355dd['bind']('isEnabled')['to'](this['queryView']['fieldView'],'isEmpty',this,'isEnabled',(_0x1cd38b,_0x4a6f56)=>!_0x1cd38b&&_0x4a6f56),_0x5355dd;}['_createShowHistoryButton'](){const _0x280009=new Nt(this['locale']),_0x5c5a36=this['resultsView'],_0x130621=this['locale'];_0x280009['set']({'label':ki(_0x130621,'History'),'withText':!0x1,'icon':_0xa3f093,'tooltip':!0x0,'tooltipPosition':'sw','class':'ck-ai-form__toggle-history'}),_0x280009['bind']('isOn')['to'](_0x5c5a36,'isVisible'),_0x280009['bind']('isEnabled')['to'](this,'isEnabled'),_0x280009['on']('execute',()=>{_0x5c5a36['isVisible']=!_0x5c5a36['isVisible'],_0x5c5a36['isVisible']?this['filteredView']['focus']():this['focus']();});const _0x3c2c5e=()=>{ct['window']['requestAnimationFrame'](()=>{if(lt(this['element'])){const _0x38cc4a=new ut(this['queryView']['fieldView']['element']),_0x1ce40e=_0x38cc4a['width'],_0x1b4ae5='rtl'===_0x130621['uiLanguageDirection']?'left':'right';_0x38cc4a['excludeScrollbarsAndBorders'](),_0x280009['element']['style'][_0x1b4ae5]=_0x1ce40e-_0x38cc4a['width']+0x1+'px';}});};return this['queryView']['fieldView']['on']('update',_0x3c2c5e),this['on']('render',_0x3c2c5e),_0x280009;}['submit'](){const _0x347494=this['queryView']['fieldView']['element']['value'];this['fire']('submit',_0x347494);}['focus'](_0xd790fb){-0x1===_0xd790fb?this['focusCycler']['focusLast']():this['focusCycler']['focusFirst']();}}class Vi extends Dt{['historyGroupView'];['clearHistoryButton'];constructor(_0x10bf36){super(_0x10bf36),this['clearHistoryButton']=this['_createClearHistoryButton'](),this['historyGroupView']=new Pt(),this['historyGroupView']['children']['add'](this['clearHistoryButton'],0x1),this['historyGroupView']['label']=ki(_0x10bf36,'Prompt\x20history'),this['historyGroupView']['items']['delegate']('execute')['to'](this),this['items']['add'](this['historyGroupView']);}['filter'](){let _0x5e3ae9=0x0;for(const _0x1e8409 of this['items'])_0x5e3ae9+=_0x1e8409['items']['length'];return{'resultsCount':_0x5e3ae9,'totalItemsCount':_0x5e3ae9};}['_createClearHistoryButton'](){const _0x4a3d00=this['locale'],_0x12f898=new Nt(this['locale']);return _0x12f898['set']({'label':'('+ki(_0x4a3d00,'Clear')+')','withText':!0x0}),_0x12f898['on']('execute',()=>this['fire']('clearHistory')),_0x12f898;}}class Bi extends Ht{constructor(_0x1a93e0){super();const _0x37e427=new Mt(),_0x83fc6e=new Nt(this['locale'],_0x37e427);this['children']['add'](_0x83fc6e),_0x83fc6e['set']({'label':_0x1a93e0['prompt'],'withText':!0x0}),_0x83fc6e['on']('execute',()=>{this['fire']('execute',{'value':_0x2ee2a9(_0x1a93e0['prompt'])});});}}const Gi='CKEditor/AIFormView/PromptHistory';class Fi extends dt{constructor(){super(),this['_loadFromSessionStorage'](),this['on']('add',(_0x80d644,_0x51eebf)=>{const _0x583238=Ki(_0x51eebf['prompt']);for(const _0x59f66d of this)if(_0x59f66d!=_0x51eebf&&Ki(_0x59f66d['prompt'])===_0x583238){this['remove'](_0x59f66d);break;}this['length']>0x14&&this['remove'](this['last']),this['_saveToSessionStorage']();}),this['on']('remove',()=>{this['_saveToSessionStorage']();});}['_loadFromSessionStorage'](){const _0xeae4b8=sessionStorage['getItem'](Gi)||'[]';this['addMany'](JSON['parse'](_0xeae4b8));}['_saveToSessionStorage'](){sessionStorage['setItem'](Gi,JSON['stringify'](this['map'](_0x5d41d8=>_0x5d41d8)));}}function Ki(_0x327991){return _0x327991['toLowerCase']()['trim']();}class Wi extends vt{['focusTracker'];['keystrokes'];['contentArea'];['toolbar'];['promptView'];['errorView'];['_focusables'];['focusCycler'];['_promptHistory'];constructor(_0x221ece,_0x3a0966,_0x5ef3eb=''){super(_0x221ece),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(_0x221ece),this['contentArea']=new Pi(_0x221ece,_0x5ef3eb),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 _0x3f3b4a=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form',_0x3a0966],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-form-content']},'children':[{'tag':'div','attributes':{'class':[_0x3f3b4a['if']('isError','ck-hidden',_0x4bfa6e=>!_0x4bfa6e)]},'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'](_0x1ab7a0=0x1){-0x1===_0x1ab7a0?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 _0x32acbc=this['locale'],_0x3aa4e0=new Ui(_0x32acbc,{'queryView':{'label':ki(_0x32acbc,'Ask\x20AI\x20to\x20edit\x20or\x20generate'),'creator':Vt,'showIcon':!0x1,'showResetButton':!0x1},'infoView':{'text':{'noSearchableItems':{'primary':ki(_0x32acbc,'Empty\x20history'),'secondary':ki(_0x32acbc,'Ask\x20AI\x20and\x20your\x20prompts\x20will\x20be\x20listed\x20here\x20for\x20you\x20to\x20use\x20later.')}}},'filteredView':this['_createHistoryView'](),'queryMinChars':0x1/0x0,'resetOnBlur':!0x1});return _0x3aa4e0['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',(_0x20602b,_0x3c8b60)=>_0x20602b&&!_0x3c8b60),this['listenTo'](_0x3aa4e0,'submit',(_0x436cc3,_0x17ed83)=>{this['prompt']=_0x17ed83;const _0x4d389b=_0x321d30(_0x17ed83);this['fire']('submitPrompt',_0x4d389b),_0x17ed83['trim']()&&this['_promptHistory']['add']({'prompt':_0x4d389b},0x0);},{'priority':'high'}),_0x3aa4e0;}['_createHistoryView'](){const _0x560d24=new Vi(this['locale']);return _0x560d24['historyGroupView']['items']['bindTo'](this['_promptHistory'])['as'](Bi),_0x560d24['on']('clearHistory',()=>{this['_promptHistory']['clear'](),this['promptView']['search'](''),this['promptView']['focus']();}),_0x560d24;}['_createToolbar'](){const _0x501765=new Di(this['locale']);return _0x501765['replaceButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',this,'value',(_0x5f10a6,_0x1f5b53,_0x15768a)=>_0x5f10a6&&!_0x1f5b53&&!!_0x15768a),_0x501765['replaceButton']['delegate']('execute')['to'](this,'replaceContent'),_0x501765['insertButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',this,'value',(_0x5a2e3c,_0x4dadf5,_0x11c32e)=>_0x5a2e3c&&!_0x4dadf5&&!!_0x11c32e),_0x501765['insertButton']['delegate']('execute')['to'](this,'insertContentBelow'),_0x501765['tryAgainButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',(_0x1c24d9,_0x2c5287)=>_0x1c24d9&&!_0x2c5287),_0x501765['tryAgainButton']['delegate']('execute')['to'](this,'tryAgainEvent'),_0x501765['stopButton']['bind']('isEnabled')['to'](this,'isProcessing'),_0x501765['stopButton']['delegate']('execute')['to'](this,'stopProcessing'),_0x501765;}['startProcessing'](){this['value']='',this['isError']=!0x1,this['isProcessing']=!0x0,this['contentArea']['isVisible']=!0x0,this['toolbar']['isVisible']=!0x0,this['contentArea']['focus']();}['finishProcessing'](){const _0xbe006=this['locale'];this['isProcessing']=!0x1,this['prompt']='',this['promptView']['reset'](),this['value']&&(this['promptView']['queryView']['label']=ki(_0xbe006,'Ask\x20AI\x20to\x20improve\x20generated\x20text'));}['handleError'](_0x58da80){const _0x3e99b9=this['locale'];this['finishProcessing'](),this['isError']=!0x0,this['errorView']['text']=_0x58da80||ki(_0x3e99b9,'AI_ERROR_FAILED'),this['value']||(this['contentArea']['isVisible']=!0x1);}}const Yi=globalThis['DataTransfer'];class $i extends _0x5d673d{['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[_0x225221,Si,Ri,Bt];}constructor(_0x46926b){super(_0x46926b),_0x46926b['config']['define']('ai.assistant.disabledElements',['media','rawHtml','tableOfContents']),_0x46926b['config']['define']('ai.assistant.contentAreaCssClass',''),_0x46926b['config']['define']('ai.assistant.useTheme',!0x0),this['_uiCssClasses']='ck-ai-assistant-ui'+(_0x46926b['config']['get']('ai.assistant.useTheme')?'\x20ck-ai-assistant-ui_theme':'');}['init'](){const {editor:_0x3bebad}=this;this['_aiAdapter']=_0x3bebad['plugins']['get'](Ri),this['_dialog']=_0x3bebad['plugins']['get'](Bt),this['_formView']=null,this['_commandDefinitions']=this['_getResolvedCommandsDefinitions']();const _0x1a183f=new Ni(_0x3bebad,Array['from'](this['_commandDefinitions']['values']()));_0x3bebad['commands']['add']('showAIAssistant',_0x1a183f),_0x3bebad['ui']['componentFactory']['add']('aiCommands',_0x5b77b0=>{const _0x4533f8=Gt(_0x5b77b0);return _0x4533f8['set']({'class':'ck-ai-commands-dropdown\x20'+this['_uiCssClasses']}),_0x4533f8['buttonView']['set']({'label':ki(_0x5b77b0,'AI\x20Commands'),'icon':_0x1fcc24,'tooltip':!0x0}),_0x4533f8['on']('execute',_0x5ed987=>this['_onExecute'](_0x5ed987['source']['id'])),Ft(_0x4533f8,_0x3bebad['ui']['view']['body'],function(_0x5afc33){const _0x2c55f9=wi(_0x5afc33['config']['get']('ai.assistant.commands'),_0x5afc33['locale']),_0xfd04a5=Qi(_0x5afc33,_0x2c55f9)['filter'](_0x865bef=>_0x865bef['commands']['length']);if(0x1===_0xfd04a5['length'])return Qi(_0x5afc33,_0xfd04a5[0x0]['commands'])['map'](_0x2bb1fa=>({'id':_0x2bb1fa['id'],'label':_0x2bb1fa['label']}));return _0xfd04a5['map'](_0x564d6c=>{const {groupId:_0x50f945,groupLabel:_0x518498,commands:_0x1e0042}=_0x564d6c,_0x13d78c=Qi(_0x5afc33,_0x1e0042)['map'](_0x3e4420=>({'id':_0x3e4420['id'],'label':_0x3e4420['label']}));return{'id':_0x50f945,'menu':_0x518498||_0x50f945,'children':_0x13d78c};});}(_0x3bebad),{'ariaLabel':ki(_0x5b77b0,'AI\x20Commands')}),_0x4533f8['menuView']['menuPanelClass']='ck-ai-commands-dropdown\x20'+this['_uiCssClasses'],_0x1a183f['on']('change:enabledCommandsIds',_0x4f0d38),_0x4533f8['menuView']['once']('render',_0x4f0d38),_0x4533f8;function _0x4f0d38(){_0x4533f8['isEnabled']=_0x1a183f['enabledCommandsIds']['length']>0x0;for(const _0x4bb8d9 of _0x4533f8['menuView']['buttons'])_0x4bb8d9['isEnabled']=_0x1a183f['enabledCommandsIds']['includes'](_0x4bb8d9['id']);}}),_0x3bebad['ui']['componentFactory']['add']('menuBar:aiCommands',_0x34a23c=>{const _0x30e3f2=new Kt(_0x34a23c);_0x30e3f2['buttonView']['set']({'label':ki(_0x34a23c,'AI\x20Commands'),'icon':_0x1fcc24}),_0x30e3f2['bind']('isEnabled')['to'](_0x1a183f,'enabledCommandsIds',_0x10b078=>_0x10b078['length']>0x0);const _0x5312ed=wi(_0x3bebad['config']['get']('ai.assistant.commands'),_0x34a23c);return this['_populateMenuBarMenu'](_0x1a183f,_0x30e3f2,_0x5312ed,_0x46dab3=>this['_onExecute'](_0x46dab3)),_0x30e3f2;}),_0x3bebad['ui']['componentFactory']['add']('aiAssistant',()=>{const _0x1a8116=this['_createAIAssistantUIButton'](Nt);return _0x1a8116['set']({'tooltip':!0x0,'class':'ck-ai-assistant-button\x20'+this['_uiCssClasses']}),_0x1a8116;}),_0x3bebad['ui']['componentFactory']['add']('menuBar:aiAssistant',()=>{const _0x468d49=this['_createAIAssistantUIButton'](Wt);return _0x468d49['set']({'role':'menuitemcheckbox'}),_0x468d49;}),this['licenseKey']=this['editor']['config']['get']('licenseKey');const _0x1b262e=this['editor'];this['_licenseKeyCheckInterval']=setInterval(()=>{let _0x3532b9;for(const _0x68b988 in _0x1b262e){const _0x3bbe44=_0x68b988,_0x480f0e=_0x1b262e[_0x3bbe44];if('aiLicenseKeyValid'==_0x480f0e||'aiLicenseKeyInvalid'==_0x480f0e||'aiLicenseKeyExpired'==_0x480f0e||'aiLicenseKeyDomainLimit'==_0x480f0e||'aiLicenseKeyNotAllowed'==_0x480f0e||'aiLicenseKeyEvaluationLimit'==_0x480f0e||'aiLicenseKeyUsageLimit'==_0x480f0e){delete _0x1b262e[_0x3bbe44],_0x3532b9=_0x480f0e,clearInterval(this['_licenseKeyCheckInterval']),this['_licenseKeyCheckInterval']=void 0x0;break;}}'aiLicenseKeyInvalid'==_0x3532b9&&_0x1b262e['_showLicenseError']('invalid'),'aiLicenseKeyExpired'==_0x3532b9&&_0x1b262e['_showLicenseError']('expired'),'aiLicenseKeyDomainLimit'==_0x3532b9&&_0x1b262e['_showLicenseError']('domainLimit'),'aiLicenseKeyNotAllowed'==_0x3532b9&&_0x1b262e['_showLicenseError']('featureNotAllowed','AIAssistant'),'aiLicenseKeyEvaluationLimit'==_0x3532b9&&_0x1b262e['_showLicenseError']('evaluationLimit'),'aiLicenseKeyUsageLimit'==_0x3532b9&&_0x1b262e['_showLicenseError']('usageLimit');},0x3e8);}['destroy'](){super['destroy'](),this['_licenseKeyCheckInterval']&&clearInterval(this['_licenseKeyCheckInterval']);}['showUI'](_0x550f00='',_0x24413f='',_0x5a98fe='custom'){const _0x5d619d=this['editor'],_0x5050c1=_0x5d619d['editing']['view'],_0x5a0697=_0x5d619d['plugins']['get'](Si),_0x4f17cd=_0x5d619d['plugins']['get'](_0x225221);_0x5a0697['showFakeVisualSelection']();const _0x3b49c7=new Yi(),_0x496a6b=new ClipboardEvent('copy',{'clipboardData':_0x3b49c7}),_0x10719a=new _0x407a3a(_0x3b49c7),_0x5150c4=new _0x4672e5(_0x5050c1,_0x496a6b,{'dataTransfer':_0x10719a});_0x4f17cd['_forceMarkersCopy']('comment',()=>{_0x5050c1['document']['fire']('copy',_0x5150c4);}),this['_formView']||(this['_initView'](),this['_aiAssistantController']=new xi(_0x5d619d,this['_aiAdapter']['textAdapter'],this['_formView']));let _0x466183=_0x10719a['getData']('text/html');const _0x4c69aa=_0x5d619d['model']['document']['selection'],_0x316066=Array['from'](_0x4c69aa['getRanges']());0x1===_0x316066['length']&&_0x316066[0x0]['isFlat']&&!_0x4c69aa['getSelectedElement']()&&''!==_0x466183['replace'](/&nbsp;/g,'')['trim']()&&(_0x466183='<p>'+_0x466183+'</p>'),this['_aiAssistantController']['updateView']({'actionId':_0x5a98fe,'query':_0x550f00,'htmlContent':_0x466183,'label':_0x24413f,'mainActionLabel':Li[_0x5d619d['model']['document']['selection']['isCollapsed']?'INSERT':'REPLACE']}),'aiAssistant'!==this['_dialog']['id']?this['_dialog']['show']({'id':'aiAssistant','icon':_0x4f1341,'title':ki(this['editor']['locale'],'AI\x20Assistant'),'content':this['_formView'],'position':Yt['EDITOR_TOP_SIDE'],'onShow':()=>{this['_formView']['focus']();},'onHide':()=>{this['_aiAssistantController']['reset'](),_0x5a0697['hideFakeVisualSelection']();}}):this['_dialog']['view']['wasMoved']||this['_dialog']['view']['updatePosition']();}['hideUI'](){this['_dialog']['hide']();}['_getResolvedCommandsDefinitions'](){const _0x111d20=new Map(),_0x5e3cea=wi(this['editor']['config']['get']('ai.assistant.commands'),this['editor']['locale']);for(const _0x112390 of _0x5e3cea)for(const _0x563e82 of _0x112390['commands'])_0x111d20['set'](_0x563e82['id'],{..._0x563e82,'groupId':_0x112390['groupId'],'groupLabel':_0x112390['groupLabel']||_0x112390['groupId']});return _0x111d20;}['_createAIAssistantUIButton'](_0x155ac8){const _0x2f2383=this['editor'],_0x342bcf=_0x2f2383['commands']['get']('showAIAssistant'),_0x9d7310=new _0x155ac8(_0x2f2383['locale']);return _0x9d7310['set']({'label':ki(_0x2f2383['locale'],'AI\x20Assistant'),'icon':_0x4f1341,'isToggleable':!0x0}),_0x9d7310['bind']('isEnabled')['to'](_0x342bcf),_0x9d7310['bind']('isOn')['to'](this['_dialog'],'id',_0x4049b4=>'aiAssistant'===_0x4049b4),this['listenTo'](_0x9d7310,'execute',()=>{_0x9d7310['isOn']?this['hideUI']():_0x342bcf['execute']();}),_0x9d7310;}['_initView'](){const _0x3356a0=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',()=>{_0x3356a0['insertContent'](this['_aiAssistantController']['currentContext']),this['hideUI']();}),this['listenTo'](this['_formView'],'insertContentBelow',()=>{_0x3356a0['insertContentBelow'](this['_aiAssistantController']['currentContext']),this['hideUI']();}),this['_initAriaAiStatusChangeAnnouncements']();}['_initAriaAiStatusChangeAnnouncements'](){const {locale:_0x46c6ea,ui:{ariaLiveAnnouncer:_0x255088}}=this['editor'];this['_formView']['contentArea']['on']('change:isProcessing',(_0x1b94c0,_0x12d663,_0x33454e)=>{const _0x59f6bc=this['_aiAssistantController']['currentContext'];_0x33454e?_0x255088['announce'](ki(_0x46c6ea,'AI\x20is\x20writing')):_0x59f6bc&&_0x255088['announce'](ki(_0x46c6ea,'Generated\x20content:\x20%0',_0x59f6bc),{'politeness':'polite','isUnsafeHTML':!0x0});}),this['_formView']['on']('change:isError',(_0x1c1e25,_0x45009b,_0x42d8df)=>{if(_0x42d8df){const _0x4dff03=this['_formView']['errorView']['text'];_0x255088['announce'](ki(_0x46c6ea,'Error\x20during\x20AI\x20content\x20generation:\x20%0',_0x4dff03));}});}['_onExecute'](_0x49466a){const _0x2fc6fe=this['_commandDefinitions']['get'](_0x49466a),_0x582bf9=this['editor'],_0x6f2590=_0x582bf9['model']['document']['selection'],_0x9152d6=_0x582bf9['commands']['get']('showAIAssistant'),_0x9f4c7b=_0x582bf9['plugins']['get'](Si),_0x3ee71b=''+(_0x2fc6fe['groupId']!==Ci?_0x2fc6fe['groupLabel']+':\x20':'')+_0x2fc6fe['label'];if(!0x1!==_0x2fc6fe['requiresContent']&&_0x6f2590['isCollapsed']){const _0x635dd7=At(_0x6f2590['getSelectedBlocks']())||_0x582bf9['model']['schema']['getLimitElement'](_0x6f2590);_0x582bf9['model']['change'](_0x5c9e17=>{_0x5c9e17['setSelection'](_0x635dd7,'in');});}_0x9f4c7b['showFakeVisualSelection'](),_0x9152d6['execute'](_0x2fc6fe['prompt'],_0x3ee71b,'command:'+_0x49466a);}['_populateMenuBarMenu'](_0x2c30ba,_0x575d09,_0x3ff1fc,_0x1d3aaf){const _0x43ed28=this['editor'],_0x562b4e=_0x43ed28['locale'],_0x4019d2=new $t(_0x562b4e),_0x576dcf=Qi(_0x43ed28,_0x3ff1fc)['filter'](_0x3b893d=>_0x3b893d['commands']['length']);0x1===_0x576dcf['length']?this['_getMenuBarGroupButtons']({'command':_0x2c30ba,'commands':_0x576dcf[0x0]['commands'],'parentMenuView':_0x575d09,'onExecute':_0x1d3aaf})['forEach'](_0x4bc0be=>_0x4019d2['items']['add'](_0x4bc0be)):_0x576dcf['forEach'](({groupId:_0x1107b9,groupLabel:_0x5c3d66,commands:_0xeddc92})=>{const _0x5173c8=new qt(_0x562b4e,_0x575d09),_0x58b13e=new Kt(_0x562b4e),_0xe4fa28=new $t(_0x562b4e),_0x318d54=this['_getMenuBarGroupButtons']({'command':_0x2c30ba,'commands':_0xeddc92,'parentMenuView':_0x58b13e,'onExecute':_0x1d3aaf});_0x58b13e['buttonView']['set']({'label':_0x5c3d66||_0x1107b9}),_0x58b13e['delegate']('execute')['to'](_0x575d09),_0xe4fa28['items']['addMany'](_0x318d54),_0x58b13e['panelView']['children']['add'](_0xe4fa28),_0x5173c8['children']['add'](_0x58b13e),_0x4019d2['items']['add'](_0x5173c8);}),_0x575d09['panelView']['children']['add'](_0x4019d2);}['_getMenuBarGroupButtons']({command:_0x4230f3,commands:_0x46ad3b,parentMenuView:_0x21100d,onExecute:_0x77426e}){const _0x441aaf=this['editor'],_0x5ea864=_0x441aaf['locale'];return Qi(_0x441aaf,_0x46ad3b)['map'](_0x22c83b=>{const _0x3536a8=new qt(_0x5ea864,_0x21100d),_0x1dfe30=new Wt(_0x5ea864);return _0x1dfe30['set']({'label':_0x22c83b['label']}),_0x1dfe30['delegate']('execute')['to'](_0x21100d),_0x1dfe30['on']('execute',()=>_0x77426e(_0x22c83b['id'])),_0x1dfe30['bind']('isEnabled')['to'](_0x4230f3,'enabledCommandsIds',_0x5b377f=>_0x5b377f['includes'](_0x22c83b['id'])),_0x3536a8['children']['add'](_0x1dfe30),_0x3536a8;});}}function qi(_0x2236ae,_0x133b0b){return void 0x0!==_0x2236ae['order']&&void 0x0===_0x133b0b['order']?0x1:void 0x0===_0x2236ae['order']&&void 0x0!==_0x133b0b['order']?-0x1:void 0x0!==_0x2236ae['order']&&void 0x0!==_0x133b0b['order']?_0x2236ae['order']-_0x133b0b['order']:0x0;}function Qi(_0x43ae29,_0x2eddaf){_0x2eddaf['sort'](qi);const _0x19fcd4={},_0x1860b8=[];for(const _0x1f286d of _0x2eddaf)if(void 0x0!==_0x1f286d['order']){if(_0x1f286d['order']in _0x19fcd4)throw new at('ai-commands-config-order-collision',_0x43ae29,{'conflictingDefinitions':[_0x1f286d,_0x19fcd4[_0x1f286d['order']]]});_0x19fcd4[_0x1f286d['order']]=_0x1f286d,_0x1860b8['splice'](_0x1f286d['order'],0x0,_0x1f286d);}else _0x1860b8['push'](_0x1f286d);return _0x1860b8;}class Xi extends _0x5d673d{static get['requires'](){return[$i,Si];}static get['pluginName'](){return'AIAssistant';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x1e8e6e){super(_0x1e8e6e);const _0x2b8587=_0x1e8e6e['config'],_0x45be16=_0x1e8e6e['locale'];_0x2b8587['define']('ai.assistant.preserveComments',!0x0),_0x2b8587['define']('ai.assistant.commands',zi(_0x45be16)),_0x2b8587['define']('ai.assistant.extraCommandGroups',[]),_0x2b8587['define']('ai.assistant.removeCommands',[]);let _0x1017c8=wi(_0x2b8587['get']('ai.assistant.commands'),_0x45be16);const _0xc46ab6=_0x2b8587['get']('ai.assistant.extraCommandGroups'),_0x5682af=_0x2b8587['get']('ai.assistant.removeCommands');_0xc46ab6['forEach'](_0x4eafaf=>{const _0x36472e=_0x1017c8['find'](_0x3f6432=>_0x3f6432['groupId']===_0x4eafaf['groupId']);_0x36472e?_0x36472e['commands']=_0x36472e['commands']['concat'](_0x4eafaf['commands']):_0x1017c8['push'](_0x4eafaf);}),_0x1017c8=_0x1017c8['filter'](_0x1823a2=>!_0x5682af['includes'](_0x1823a2['groupId'])),_0x1017c8['forEach'](_0x1c6ea1=>{_0x1c6ea1['commands']=_0x1c6ea1['commands']['filter'](_0x576d94=>!_0x5682af['includes'](_0x576d94['id']));}),_0x2b8587['set']('ai.assistant.commands',_0x1017c8);}}function zi(_0x4aa6e7){return[{'groupId':'editOrReview','groupLabel':ki(_0x4aa6e7,'Edit\x20or\x20review'),'commands':[{'id':'improveWriting','label':ki(_0x4aa6e7,'Improve\x20writing'),'prompt':'Fix\x20spelling\x20mistakes,\x20use\x20proper\x20grammar\x20and\x20apply\x20good\x20writing\x20practices.\x20Do\x20not\x20lose\x20the\x20original\x20meaning.'},{'id':'makeShorter','label':ki(_0x4aa6e7,'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(_0x4aa6e7,'Make\x20longer'),'prompt':'Improve\x20this\x20content\x20by\x20using\x20descriptive\x20language\x20and\x20inserting\x20more\x20information\x20and\x20more\x20detailed\x20explanations.'},{'id':'simplifyLanguage','label':ki(_0x4aa6e7,'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(_0x4aa6e7,'Generate\x20from\x20selection'),'commands':[{'id':'summarize','label':ki(_0x4aa6e7,'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(_0x4aa6e7,'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(_0x4aa6e7,'Change\x20tone'),'commands':[{'id':'professional','label':ki(_0x4aa6e7,'Professional'),'prompt':'Improve\x20using\x20polished,\x20formal,\x20and\x20respectful\x20language\x20to\x20convey\x20professional\x20expertise\x20and\x20competence.'},{'id':'casual','label':ki(_0x4aa6e7,'Casual'),'prompt':'Improve\x20using\x20casual,\x20informal\x20language\x20to\x20convey\x20a\x20casual\x20conversation\x20with\x20a\x20real\x20person.'},{'id':'direct','label':ki(_0x4aa6e7,'Direct'),'prompt':'Improve\x20using\x20direct\x20language,\x20using\x20only\x20the\x20essential\x20information.'},{'id':'confident','label':ki(_0x4aa6e7,'Confident'),'prompt':'Improve\x20using\x20compelling,\x20optimistic\x20language\x20to\x20convey\x20confidence\x20in\x20the\x20writing.'},{'id':'friendly','label':ki(_0x4aa6e7,'Friendly'),'prompt':'Improve\x20using\x20friendly,\x20comforting\x20language,\x20to\x20convey\x20understanding\x20and\x20empathy.'}]},{'groupId':'changeStyle','groupLabel':ki(_0x4aa6e7,'Change\x20style'),'commands':[{'id':'business','label':ki(_0x4aa6e7,'Business'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20business\x20professional\x20with\x20formal\x20language.'},{'id':'legal','label':ki(_0x4aa6e7,'Legal'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20legal\x20professional\x20using\x20valid\x20legal\x20terminology.'},{'id':'journalism','label':ki(_0x4aa6e7,'Journalism'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20journalist\x20using\x20engaging\x20language\x20to\x20convey\x20the\x20importance\x20of\x20the\x20information.'},{'id':'poetic','label':ki(_0x4aa6e7,'Poetic'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20poem\x20using\x20poetic\x20techniques\x20without\x20losing\x20the\x20original\x20meaning.'}]},{'groupId':'translate','groupLabel':ki(_0x4aa6e7,'Translate'),'commands':[{'id':'translateEnglish','label':ki(_0x4aa6e7,'English'),'prompt':'Translate\x20the\x20content\x20to\x20English\x20language.'},{'id':'translateSpanish','label':ki(_0x4aa6e7,'Spanish'),'prompt':'Translate\x20the\x20content\x20to\x20Spanish\x20language.'},{'id':'translatePortuguese','label':ki(_0x4aa6e7,'Portuguese'),'prompt':'Translate\x20the\x20content\x20to\x20Portuguese\x20language.'},{'id':'translateGerman','label':ki(_0x4aa6e7,'German'),'prompt':'Translate\x20the\x20content\x20to\x20German\x20language.'},{'id':'translateFrench','label':ki(_0x4aa6e7,'French'),'prompt':'Translate\x20the\x20content\x20to\x20French\x20language.'},{'id':'translateChinese','label':ki(_0x4aa6e7,'Simplified\x20Chinese'),'prompt':'Translate\x20the\x20content\x20to\x20Simplified\x20Chinese\x20language.'},{'id':'translateHindi','label':ki(_0x4aa6e7,'Hindi'),'prompt':'Translate\x20the\x20content\x20to\x20Hindi\x20language.'},{'id':'translateArabic','label':ki(_0x4aa6e7,'Arabic'),'prompt':'Translate\x20the\x20content\x20to\x20Arabic\x20language.'}]}];}class ji extends _0x5d673d{['abortController'];static get['requires'](){return[Ri];}constructor(_0x16c439){super(_0x16c439),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'](_0x307c7e){return this['sendRequest'](_0x307c7e)['catch'](_0x3da34f=>{if(_0x3da34f instanceof Oi)return Promise['reject'](_0x3da34f);if('AbortError'==_0x3da34f['name'])return Promise['resolve']();throw console['error'](_0x3da34f),new at('aitextadapter-send-request-failed',null);});}async['_prepareRequestHeaders'](_0x571670,_0x53c544){const _0x31ed91=this['editor']['locale'],_0x44a87c={'Content-Type':'application/json'};if('object'==typeof _0x571670)Object['assign'](_0x44a87c,_0x571670);else{if(_0x571670)try{const _0x4218b3=await _0x571670(_0x53c544);Object['assign'](_0x44a87c,_0x4218b3);}catch{return Promise['reject'](new Oi(ki(_0x31ed91,'AI_ERROR_GET_HEADERS')));}}return _0x44a87c;}async['_prepareRequestParameters'](_0x7cdbcf,_0x4960c7){const _0x537725=this['editor']['locale'];if('object'==typeof _0x7cdbcf)return _0x7cdbcf;try{return await _0x7cdbcf(_0x4960c7);}catch{return Promise['reject'](new Oi(ki(_0x537725,'AI_ERROR_GET_PARAMETERS')));}}}class Ji extends ji{['_apiUrl'];['_requestHeaders'];['_requestParameters'];static get['pluginName'](){return'OpenAITextAdapter';}constructor(_0x305ccb){super(_0x305ccb),_0x305ccb['config']['define']('ai.assistant.adapter.openAI.apiUrl','https://api.openai.com/v1/chat/completions'),_0x305ccb['config']['get']('ai.assistant.adapter.openAI.requestParameters')||_0x305ccb['config']['define']('ai.assistant.adapter.openAI.requestParameters',{'model':'gpt-4o','temperature':0x1,'top_p':0x1,'stream':!0x0}),this['_apiUrl']=_0x305ccb['config']['get']('ai.assistant.adapter.openAI.apiUrl'),this['_requestHeaders']=_0x305ccb['config']['get']('ai.assistant.adapter.openAI.requestHeaders')||{},this['_requestParameters']=_0x305ccb['config']['get']('ai.assistant.adapter.openAI.requestParameters');}async['sendRequest']({query:_0x559fa7,context:_0x30e4c5,onData:_0x429830,actionId:_0x3f6e78}){const _0x209c33=this['editor']['locale'],_0x472379=await this['prepareMessages'](_0x559fa7,_0x30e4c5,_0x3f6e78),_0x4f571c=await this['_prepareRequestHeaders'](this['_requestHeaders'],_0x3f6e78),_0x113a2f=await this['_prepareRequestParameters'](this['_requestParameters'],_0x3f6e78),_0xcd50c3={'messages':_0x472379,..._0x113a2f},_0x103ce6={'method':'POST','headers':_0x4f571c,'body':JSON['stringify'](_0xcd50c3),'signal':this['abortController']['signal']},_0x1b400e=await fetch(this['_apiUrl'],_0x103ce6);if(_0x1b400e['ok'])return _0x113a2f['stream']?await this['_readStreamableResponse'](_0x1b400e,_0x429830):await this['_readStaticResponse'](_0x1b400e,_0x429830),Promise['resolve']();{const _0x132f4a=await _0x1b400e['text']();return _0x132f4a['includes']('context_length_exceeded')?Promise['reject'](new Oi(ki(_0x209c33,'AI_ERROR_CONTEXT_LENGTH'))):_0x132f4a['includes']('Moderation')?Promise['reject'](new Oi(ki(_0x209c33,'AI_ERROR_MODERATION'))):Promise['reject'](new Error(_0x132f4a));}}async['prepareMessages'](_0x4145d1,_0x31e82f,_0x1a46cb){let _0x23deaf,_0x151b12;return _0x31e82f?(_0x23deaf='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.',_0x151b12='Instruction:\x0a'+_0x4145d1+'\x0aYou\x20must\x20keep\x20the\x20text\x20formatting.\x0a\x0aContent:\x0a'+_0x31e82f):(_0x23deaf='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.',_0x151b12=_0x4145d1),[{'role':'system','content':_0x23deaf},{'role':'user','content':_0x151b12}];}async['_readStreamableResponse'](_0x466d6b,_0x3b3ed8){const _0x173a05=_0x466d6b['body']['getReader'](),_0x57f534=new TextDecoder();let _0x2a6323='',_0x38e115='',_0x4f1c2f='',_0x1d7886=!0x1;for(;!_0x1d7886;){const {done:_0x41e637,value:_0x215bb3}=await _0x173a05['read'](),_0x69c1bb=_0x2a6323+_0x57f534['decode'](_0x215bb3);let _0x49c11b='';_0x1d7886=_0x41e637;try{_0x49c11b=this['_cleanUpData'](_0x69c1bb),_0x2a6323='';}catch{_0x2a6323=_0x69c1bb;continue;}_0x38e115+=_0x49c11b,!_0x1d7886&&this['_isBufferIncomplete'](_0x38e115)||_0x38e115&&(_0x4f1c2f+=_0x38e115,_0x38e115='',_0x3b3ed8(_0x4f1c2f));}return Promise['resolve']();}async['_readStaticResponse'](_0x4ed7af,_0x288da4){return _0x288da4((await _0x4ed7af['json']())['choices'][0x0]['message']['content']),Promise['resolve']();}['_isBufferIncomplete'](_0x579970){const _0x56566b=_0x579970['split']('<')['length']!==_0x579970['split']('>')['length'],_0x2392c0=_0x579970['length']<0x1e;return _0x56566b&&_0x2392c0;}['_cleanUpData'](_0x3b3c49){return _0x3b3c49['split'](/\n(?![^{]*\})/g)['map'](_0xff92ed=>_0xff92ed['replace']('data:\x20',''))['filter'](_0xb4a5a5=>_0xb4a5a5&&_0xb4a5a5['length']>0x0&&'[DONE]'!==_0xb4a5a5)['map'](_0x564fe0=>{const {choices:_0x3c0ec1}=JSON['parse'](_0x564fe0);if(_0x3c0ec1[0x0]?.['delta']?.['content'])return _0x3c0ec1[0x0]['delta']['content'];})['filter'](_0x498f7c=>_0x498f7c)['join']('');}}class Zi extends ji{static get['pluginName'](){return'AWSTextAdapter';}['init'](){super['init'](),It('ai-aws-adapter-not-supported');}async['sendRequest'](_0x3d4356){throw Et('ai-aws-adapter-not-supported'),new Oi(ki(this['editor']['locale'],'AI_ERROR_AWS_NOT_SUPPORTED'));}}class ts extends Nt{constructor(_0x4ed7dc,_0x152fe9={}){super(_0x4ed7dc),this['isToggleable']=!0x0,this['set']('side',_0x152fe9['side']||'top');const _0x1ea24e=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':['ck-tab-button',...pt(_0x152fe9['class']||[]),_0x1ea24e['to']('side',_0x1bdbd8=>'ck-tab-button_'+_0x1bdbd8),_0x1ea24e['to']('class')]}});}['show'](){this['set']('isVisible',!0x0);}['hide'](){this['set']('isVisible',!0x1);}}class es extends vt{['children'];constructor(_0x3802e6,_0x55a213={}){super(_0x3802e6);const _0xe60d79=this['bindTemplate'];this['set']('isVisible',!0x1),this['set']('class',''),this['children']=this['createCollection'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-tab-panel',...pt(_0x55a213['class']||[]),_0xe60d79['to']('class'),_0xe60d79['if']('isVisible','ck-hidden',_0x2386ef=>!_0x2386ef)]},'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(_0xa021a,_0x424648={}){super(_0xa021a),this['set']('class',void 0x0),this['set']('activeTab',null),this['set']('side',_0x424648['side']||'top'),this['set']('isMaximized',!0x1),this['set']('collapsible',_0x424648['collapsible']||!0x1),this['set']('_isMaximizedActive',!0x1),this['bind']('_isMaximizedActive')['to'](this,'isMaximized',this,'activeTab',(_0x489d30,_0x40431a)=>_0x489d30&&null!==_0x40431a);const _0x44316c=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset','ck-tabs',...pt(_0x424648['class']||[]),_0x44316c['to']('side',_0x5a56b6=>'ck-tabs_'+_0x5a56b6),_0x44316c['to']('class'),_0x44316c['if']('_isMaximizedActive','ck-ai-tabs_maximized'),_0x44316c['to']('activeTab',_0x7d2ac5=>null===_0x7d2ac5?'ck-ai-tabs_collapsed':'')],'tabindex':'0'},'children':[{'tag':'div','attributes':{'class':['ck','ck-tabs__buttons-container',_0x44316c['to']('side',_0x37f1fd=>'ck-tabs__buttons-container_'+_0x37f1fd)]},'children':this['buttonViews']},{'tag':'div','attributes':{'class':['ck','ck-tabs__panels-container',_0x44316c['to']('side',_0x5665d9=>'ck-tabs__panels-container_'+_0x5665d9)]},'children':this['panelViews']},...pt(_0x424648['children']||[])]});}['getTabIds'](){return[...this['_tabs']['keys']()];}['getTab'](_0x1cb5fb){const _0x30004b=this['_tabs']['get'](_0x1cb5fb);return _0x30004b||null;}['addTab'](_0x134883){const _0xddae77=this['_setupButton']({'id':_0x134883['id'],'label':_0x134883['buttonLabel'],'icon':_0x134883['buttonIcon'],'order':_0x134883['order']}),_0x23a467=new es(this['locale']);return _0x23a467['render'](),_0x134883['content']&&_0x23a467['children']['add'](_0x134883['content']),this['panelViews']['add'](_0x23a467),this['_tabs']['set'](_0x134883['id'],{'button':_0xddae77,'panel':_0x23a467,'order':void 0x0!==_0x134883['order']?_0x134883['order']:null}),this['fire']('addTab:'+_0x134883['id'],{'id':_0x134883['id'],'button':_0xddae77,'panel':_0x23a467}),null===this['activeTab']?this['activateTab'](_0x134883['id']):this['_hidePanel'](_0x134883['id']),{'button':_0xddae77,'panel':_0x23a467};}['activateTab'](_0xbd832b){if(null!==_0xbd832b&&!this['getTab'](_0xbd832b))throw new at('ui-tabsview-tab-not-found',{'tabs':this,'tabId':_0xbd832b});if(this['activeTab']===_0xbd832b)return;const _0x1731b8=this['activeTab'];this['activeTab']&&this['_hidePanel'](this['activeTab']),this['activeTab']=_0xbd832b,_0xbd832b&&this['_showPanel'](_0xbd832b),this['fire']('activateTab:'+_0xbd832b,{'newTab':_0xbd832b,'oldTab':_0x1731b8});}['toggleTabPanel'](_0x3e6a64){if(!this['getTab'](_0x3e6a64))throw new at('ui-tabsview-tab-not-found',{'tabs':this,'tabId':_0x3e6a64});this['activeTab']===_0x3e6a64?this['collapsible']&&(this['activeTab']=null):this['activateTab'](_0x3e6a64);}['showTab'](_0xa34d3){if(!this['getTab'](_0xa34d3))throw new at('ui-tabsview-tab-not-found',{'tabs':this,'tabId':_0xa34d3});this['_showPanel'](_0xa34d3),this['_showButton'](_0xa34d3),this['fire']('show:'+_0xa34d3,_0xa34d3);}['hideTab'](_0x1d6fb0){if(!this['getTab'](_0x1d6fb0))throw new at('ui-tabsview-tab-not-found',{'tabs':this,'tabId':_0x1d6fb0});const _0x3013f4=this['activeTab'];this['_hidePanel'](_0x1d6fb0),this['_hideButton'](_0x1d6fb0);const _0x467c3a=this['getTabIds']();_0x3013f4===_0x1d6fb0&&_0x467c3a['length']>0x1&&this['activateTab'](_0x467c3a['find'](_0x54512c=>_0x54512c!==_0x1d6fb0)),this['fire']('hide:'+_0x1d6fb0,_0x1d6fb0);}['_getPanel'](_0x195a86){const _0x1e6054=this['_tabs']['get'](_0x195a86);return _0x1e6054?_0x1e6054['panel']:null;}['_showPanel'](_0xbc8bda){null!==this['activeTab']&&this['activeTab']!==_0xbc8bda||this['_getPanel'](_0xbc8bda)['show']();}['_hidePanel'](_0x2c5c98){const _0x30f2b5=this['_getPanel'](_0x2c5c98);_0x30f2b5['isVisible']&&(this['activeTab']===_0x2c5c98&&(this['activeTab']=null),_0x30f2b5['hide']());}['_getButton'](_0x4d93b1){const _0x4e1d95=this['_tabs']['get'](_0x4d93b1);return _0x4e1d95?_0x4e1d95['button']:null;}['_showButton'](_0x107898){this['_getButton'](_0x107898)['show']();}['_hideButton'](_0x17f9d1){this['_getButton'](_0x17f9d1)['hide']();}['_setupButton'](_0x20b5de){const _0x5f1184=new ts(this['locale'],{'side':this['side']}),_0x221a09=this['buttonViews'];if(_0x5f1184['set']({'label':_0x20b5de['label'],'icon':_0x20b5de['icon'],'tooltip':!0x0,'withText':!0x0}),_0x5f1184['bind']('isOn')['to'](this,'activeTab',_0x30c5f3=>_0x30c5f3===_0x20b5de['id']),_0x5f1184['bind']('side')['to'](this,'side'),_0x20b5de['order']){const _0x267992=[...this['_tabs']]['reduce']((_0x3d15b4,_0x575950)=>{const _0x4c558d=_0x575950[0x0],{order:_0x436703}=_0x575950[0x1];return!_0x436703||_0x436703>_0x20b5de['order']?_0x3d15b4:_0x436703>=_0x3d15b4['order']?{'id':_0x4c558d,'order':_0x436703}:_0x3d15b4;},{'id':'','order':0x0}),_0x18402e=_0x221a09['getIndex'](this['_getButton'](_0x267992['id']));_0x221a09['add'](_0x5f1184,_0x18402e+0x1);}else _0x221a09['add'](_0x5f1184);return _0x5f1184['on']('execute',()=>{this['toggleTabPanel'](_0x20b5de['id']);}),_0x5f1184;}}const ss=['overlay','sidebar','custom'],ns=['left','right'];class rs extends is{constructor(_0x126eeb,_0x30126d={}){super(_0x126eeb,_0x30126d),this['set']('type',_0x30126d['type']||'sidebar'),this['set']('side',_0x30126d['side']||'right'),this['set']('isVisible',_0x30126d['visibleByDefault']??!0x0);const _0x28ed2c=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':['ck-ai-tabs',_0x28ed2c['if']('type','ck-ai-tabs__overlay',_0x57b5d2=>'overlay'===_0x57b5d2),_0x28ed2c['if']('type','ck-ai-tabs__sidebar',_0xa2535e=>'sidebar'===_0xa2535e),_0x28ed2c['if']('isVisible','ck-hidden',_0x1acce3=>!_0x1acce3)]}}),this['buttonViews']['on']('add',(_0x1ec7dc,_0x3333ed)=>{_0x3333ed['set']('withText',!0x1);});}}class os extends _0x1c4dd1{['view'];['container']=null;['showResizeButton']=!0x0;static get['pluginName'](){return'AITabs';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x101f6c){if(super(_0x101f6c),!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 _0x406328=this['context']['config']['get']('ai.container');if(this['set']('side','right'),void 0x0!==_0x406328['showResizeButton']&&(this['showResizeButton']=_0x406328['showResizeButton']),'sidebar'!==_0x406328['type']&&'overlay'!==_0x406328['type']||_0x406328['side']&&(this['side']=_0x406328['side']),'sidebar'===_0x406328['type']){if(this['container']=_0x406328['element'],this['set']('type','sidebar'),!this['container'])throw new at('ai-tabs-sidebar-container-element-not-found');}else'overlay'===_0x406328['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':_0x406328['visibleByDefault'],'collapsible':_0x406328['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 _0x123c85&&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'](_0x33522e){if(_0x33522e&&this['type']!==_0x33522e){if(!ss['includes'](_0x33522e))throw new at('ai-tabs-unsupported-ui-type');this['type']=_0x33522e;}}['switchSide'](_0x4d6ed2){if(_0x4d6ed2&&this['side']!==_0x4d6ed2){if(!ns['includes'](_0x4d6ed2))throw new at('ai-tabs-unsupported-ui-side');this['side']=_0x4d6ed2;}}['destroy'](){super['destroy'](),this['view']['destroy'](),this['view']['element']&&this['view']['element']['remove']();}}class as extends _0x1c4dd1{['_apiUrl'];['_token'];['_decoder'];['_responseCache'];static get['requires'](){return[_0xba4000];}static get['pluginName'](){return'AIConnector';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x33424b){super(_0x33424b),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 _0x51baf0=this['context']['plugins']['get'](_0xba4000);if(!_0x51baf0['token'])throw new at('ai-missing-token',this);this['_token']=_0x51baf0['token'];}['startConversation'](_0x64e7f9,_0x4489a1){const _0x1b687e=this['_sendApiRequest']('/conversations','POST',{'id':_0x64e7f9,'group':_0x4489a1});return{'getConversation':async()=>(await _0x1b687e['request'])['json'](),'abortController':_0x1b687e['abortController']};}['queryAssistant']({message:_0x2832df,conversationId:_0x5652ed,parts:_0x31effc,capabilities:_0xd93d07,model:_0x43d07f,attributes:_0x2cbf9c}){const _0x2ffcb8={'prompt':_0x2832df,'content':_0x31effc,'model':_0x43d07f,..._0xd93d07&&{'capabilities':_0xd93d07},..._0x2cbf9c&&{'attributes':_0x2cbf9c}},_0xd40b70=this['_sendApiRequest']('/conversations/'+_0x5652ed+'/messages','POST',_0x2ffcb8);return{'getStream':async()=>{const _0x481265=(await _0xd40b70['request'])['body'];return this['_getStreamReader'](_0x481265);},'abortController':_0xd40b70['abortController']};}['executeCustomAction']({content:_0x469ad6,message:_0x113493,model:_0x6863db,outputFormat:_0x558263}){const _0x43bfad={'content':[{'type':'text','content':_0x469ad6}],'prompt':_0x113493,'model':_0x6863db,'outputFormat':_0x558263},_0x336143=this['_sendApiRequest']('/actions/custom/calls','POST',_0x43bfad);return{'getStream':async()=>{const _0x5a66d0=(await _0x336143['request'])['body'];return this['_getStreamReader'](_0x5a66d0);},'abortController':_0x336143['abortController']};}['executeAction']({actionName:_0x38cdc8,content:_0x562fec,args:_0x4ed1e7}){const _0x120cbe={'content':[{'type':'text','content':_0x562fec}],'args':_0x4ed1e7},_0x17dc64=this['_sendApiRequest']('/actions/system/'+_0x38cdc8+'/calls','POST',_0x120cbe);return{'getStream':async()=>{const _0x33c630=(await _0x17dc64['request'])['body'];return this['_getStreamReader'](_0x33c630);},'abortController':_0x17dc64['abortController']};}['uploadFile'](_0x2b212c,_0x2f8682,_0x34d916){const _0x4cb45b=new FormData();_0x4cb45b['append']('file',_0x2f8682,_0x2f8682['name']),_0x34d916&&_0x4cb45b['append']('attributes',JSON['stringify'](_0x34d916));const _0x4c6a7b=this['_sendApiRequest']('/conversations/'+_0x2b212c+'/files','POST',_0x4cb45b);return{'getId':async()=>(await _0x4c6a7b['request'])['json'](),'abortController':_0x4c6a7b['abortController']};}['fetchDocument'](_0x4e6f58,_0x3a027e){const _0x2457b9=this['_sendApiRequest']('/conversations/'+_0x4e6f58+'/documents/'+_0x3a027e,'GET');return{'getDocument':async()=>(await _0x2457b9['request'])['json'](),'abortController':_0x2457b9['abortController']};}['uploadDocument'](_0xff2b71,_0x11df66,_0x2976bc){const _0x4b3f8f={'content':_0x11df66};_0x2976bc&&(_0x4b3f8f['attributes']=_0x2976bc);const _0x446140=this['_sendApiRequest']('/conversations/'+_0xff2b71+'/documents','POST',_0x4b3f8f);return{'getId':async()=>(await _0x446140['request'])['json'](),'abortController':_0x446140['abortController']};}['uploadDocuments'](_0x4523ff,_0x38de78){const _0x103533={'documents':_0x38de78['map'](_0x3e6a0b=>({'content':_0x3e6a0b['content'],'attributes':{'version':_0x3e6a0b['version'],'sessionId':_0x3e6a0b['sessionId'],'selections':_0x3e6a0b['selections']},...void 0x0!==_0x3e6a0b['name']?{'name':_0x3e6a0b['name']}:{},...void 0x0!==_0x3e6a0b['description']?{'description':_0x3e6a0b['description']}:{}}))},_0x21764e=this['_sendApiRequest']('/conversations/'+_0x4523ff+'/documents/batch','POST',_0x103533);return{'getIds':async()=>(await _0x21764e['request'])['json'](),'abortController':_0x21764e['abortController']};}['fetchDocuments'](_0x28ea8c,_0x1f7e2b){const _0x3f723f=new URLSearchParams();_0x3f723f['append']('documentIds',_0x1f7e2b['join'](','));const _0x2d3bc0=this['_sendApiRequest']('/conversations/'+_0x28ea8c+'/documents/batch?'+_0x3f723f['toString'](),'GET');return{'getDocuments':async()=>(await _0x2d3bc0['request'])['json'](),'abortController':_0x2d3bc0['abortController']};}['fetchConversations'](_0xa7ef51,_0x37ce2f={}){const _0x825ef9=new URLSearchParams();_0x825ef9['append']('group',_0xa7ef51),_0x825ef9['append']('excludeEmpty',!0x1!==_0x37ce2f['excludeEmpty']?'true':'false'),_0x825ef9['append']('limit',_0x37ce2f['limit']?_0x37ce2f['limit']['toString']():'100'),_0x825ef9['append']('sortBy',_0x37ce2f['sortBy']?_0x37ce2f['sortBy']:'createdAt'),_0x825ef9['append']('order',_0x37ce2f['order']?_0x37ce2f['order']:'desc');const _0x15a737=this['_sendApiRequest']('/conversations?'+_0x825ef9['toString'](),'GET');return{'getConversations':async()=>{const _0x4d2f3d=await _0x15a737['request'];return(await _0x4d2f3d['json']())['items'];},'abortController':_0x15a737['abortController']};}['deleteConversation'](_0x329978){const _0x52a481=this['_sendApiRequest']('/conversations/'+_0x329978,'DELETE');return{'execute':async()=>{await _0x52a481['request'];},'abortController':_0x52a481['abortController']};}['updateConversation'](_0x135ed9,_0x20cc9c){const _0x3d3dbf=this['_sendApiRequest']('/conversations/'+_0x135ed9,'PATCH',_0x20cc9c);return{'getResult':async()=>(await _0x3d3dbf['request'],_0x20cc9c),'abortController':_0x3d3dbf['abortController']};}['fetchConversation'](_0x1bfce5){const _0x115936=this['_sendApiRequest']('/conversations/'+_0x1bfce5,'GET');return{'getConversation':async()=>(await _0x115936['request'])['json'](),'abortController':_0x115936['abortController']};}['fetchConversationMessages'](_0x9e0a49){const _0x27a11a=this['_sendApiRequest']('/conversations/'+_0x9e0a49+'/messages','GET');return{'getMessages':async()=>{const _0x330e5a=await _0x27a11a['request'];return(await _0x330e5a['json']())['items'];},'abortController':_0x27a11a['abortController']};}['uploadUrl'](_0x10a3eb,_0x465858,_0x906871){const _0x2c46de=this['_sendApiRequest']('/conversations/'+_0x10a3eb+'/web-resources','POST',{'url':_0x465858,'attributes':_0x906871});return{'getId':async()=>(await _0x2c46de['request'])['json'](),'abortController':_0x2c46de['abortController']};}['getModels'](_0x50ed31='en'){const _0x4cb480=new URLSearchParams();_0x4cb480['append']('language',_0x50ed31);const _0x3d1395='/models/1?'+_0x4cb480['toString'](),_0x1af3e1=this['_sendApiRequest'](_0x3d1395,'GET',void 0x0,!0x0);return{'list':async()=>await(await _0x1af3e1['request'])['json'](),'abortController':_0x1af3e1['abortController']};}['deleteFile'](_0x51e009,_0x3647b0){const _0x4381ab=this['_sendApiRequest']('/conversations/'+_0x51e009+'/files/'+_0x3647b0,'DELETE');return{'execute':async()=>{await _0x4381ab['request'];},'abortController':_0x4381ab['abortController']};}['deleteDocument'](_0x13cec6,_0x265633){const _0x43d154=this['_sendApiRequest']('/conversations/'+_0x13cec6+'/documents/'+_0x265633,'DELETE');return{'execute':async()=>{await _0x43d154['request'];},'abortController':_0x43d154['abortController']};}['deleteWebResource'](_0x526d27,_0x1a6bb4){const _0x55c54e=this['_sendApiRequest']('/conversations/'+_0x526d27+'/web-resources/'+_0x1a6bb4,'DELETE');return{'execute':async()=>{await _0x55c54e['request'];},'abortController':_0x55c54e['abortController']};}['callSystemReview']({reviewName:_0x595bd5,content:_0x33519d,args:_0x1c0f62}){const _0x1e100d=this['_sendApiRequest']('/reviews/system/'+_0x595bd5+'/calls','POST',{'content':[{'type':'text','content':_0x33519d}],'args':_0x1c0f62});return{'getStream':async()=>{const _0x14d4dd=(await _0x1e100d['request'])['body'];return this['_getStreamReader'](_0x14d4dd);},'abortController':_0x1e100d['abortController']};}['callCustomReview']({content:_0x184925,prompt:_0x29bacb,model:_0x3c0da5}){const _0x544272=this['_sendApiRequest']('/reviews/custom/calls','POST',{'content':[{'type':'text','content':_0x184925}],'prompt':_0x29bacb,'model':_0x3c0da5});return{'getStream':async()=>{const _0x22049d=(await _0x544272['request'])['body'];return this['_getStreamReader'](_0x22049d);},'abortController':_0x544272['abortController']};}['upsertAIChatRating'](_0x45b3f2,_0x275078,_0x587193){const _0x52ad44=this['_sendApiRequest']('/conversations/'+_0x45b3f2+'/messages/'+_0x275078+'/ratings','PUT',{'positiveCount':_0x587193['positiveCount'],'totalCount':_0x587193['totalCount'],'modificationId':_0x587193['modificationId']});return{'execute':async()=>{await _0x52ad44['request'];},'abortController':_0x52ad44['abortController']};}['upsertAIActionRating'](_0x33cb8c,_0x4bf612,_0x416052){const _0x410de5=this['_sendApiRequest']('/actions/system/'+_0x33cb8c+'/calls/'+_0x4bf612+'/ratings','PUT',{'positiveCount':_0x416052['positiveCount'],'totalCount':_0x416052['totalCount']});return{'execute':async()=>{await _0x410de5['request'];},'abortController':_0x410de5['abortController']};}['upsertCustomAIActionRating'](_0x263170,_0x4a04ac){const _0x1b879a=this['_sendApiRequest']('/actions/custom/calls/'+_0x263170+'/ratings','PUT',{'positiveCount':_0x4a04ac['positiveCount'],'totalCount':_0x4a04ac['totalCount']});return{'execute':async()=>{await _0x1b879a['request'];},'abortController':_0x1b879a['abortController']};}['upsertAIReviewRating'](_0x4beef5,_0xdf60a8,_0x228642,_0x58141d){const _0x3d2b4c=this['_sendApiRequest']('/reviews/system/'+_0x4beef5+'/calls/'+_0xdf60a8+'/ratings','PUT',{'positiveCount':_0x228642['positiveCount'],'totalCount':_0x228642['totalCount'],'dataId':_0x58141d});return{'execute':async()=>{await _0x3d2b4c['request'];},'abortController':_0x3d2b4c['abortController']};}['upsertCustomAIReviewRating'](_0x89c4e9,_0xe0cce9,_0x4fe02a){const _0x2ea46b=this['_sendApiRequest']('/reviews/custom/calls/'+_0x89c4e9+'/ratings','PUT',{'positiveCount':_0xe0cce9['positiveCount'],'totalCount':_0xe0cce9['totalCount'],'dataId':_0x4fe02a});return{'execute':async()=>{await _0x2ea46b['request'];},'abortController':_0x2ea46b['abortController']};}['_sendApiRequest'](_0x21ef40,_0x1a80c1,_0x57ee20,_0x4ffa94=!0x1){const _0x10be5a=new AbortController(),_0xd6a130=_0x4ffa94?_0x1a80c1+':'+_0x21ef40:null;if(_0xd6a130){const _0x5990ba=this['_responseCache']['get'](_0xd6a130);if(_0x5990ba)return{'request':_0x5990ba['then'](_0x501df8=>_0x501df8['clone']()),'abortController':_0x10be5a};}const _0xe901cd=_0x57ee20 instanceof FormData,_0x25ac6f={'Authorization':'Bearer\x20'+this['_token']?.['value'],'x-feature-flags':'multi-document','X-Editor-Version':mt};_0x57ee20&&!_0xe901cd&&(_0x25ac6f['Content-Type']='application/json');const _0x2f11f7={'method':_0x1a80c1,'headers':_0x25ac6f,'signal':_0x10be5a['signal']};_0x57ee20&&(_0x2f11f7['body']=_0xe901cd?_0x57ee20:JSON['stringify'](_0x57ee20));const _0x2a089c=fetch(''+this['_apiUrl']+_0x21ef40,_0x2f11f7)['catch'](_0x24760a=>{_0xd6a130&&this['_responseCache']['delete'](_0xd6a130),this['_handleError'](_0x24760a);})['then'](_0x110c4c=>_0x110c4c['ok']?_0x110c4c:_0x110c4c['json']()['then'](_0x2c2fef=>{throw _0xd6a130&&this['_responseCache']['delete'](_0xd6a130),{'url':this['_apiUrl'],'path':_0x21ef40,'method':_0x1a80c1,'body':_0x57ee20,'status':(_0x110c4c||{})['status'],'statusText':(_0x110c4c||{})['statusText'],'code':_0x2c2fef['code'],'message':_0x2c2fef['message'],'traceId':_0x2c2fef['traceId']};}));return _0xd6a130&&this['_responseCache']['set'](_0xd6a130,_0x2a089c['then'](_0x16cc1b=>_0x16cc1b['clone']())),{'request':_0x2a089c,'abortController':_0x10be5a};}async*['_getStreamReader'](_0x35430e){const _0x57f00d=[],_0x43dfbe=_0x35430e['getReader'](),_0x4539fa=_0xf9c35f({'onError':_0x54ace7=>{this['_handleError'](_0x54ace7);},'onEvent':_0x32c0b1=>{_0x32c0b1['data']=JSON['parse'](_0x32c0b1['data']),_0x57f00d['push'](_0x32c0b1);}});try{let _0xf78238=!0x1;for(;!_0xf78238;){const {done:_0x352258,value:_0x4e87d3}=await _0x43dfbe['read']();_0x352258&&(_0xf78238=!0x0),_0x4539fa['feed'](this['_decoder']['decode'](_0x4e87d3,{'stream':!0x0})),yield*_0x57f00d,_0x57f00d['length']=0x0;}}catch(_0x4cc7eb){this['_handleError'](_0x4cc7eb);}finally{_0x43dfbe['releaseLock'](),_0x4539fa['reset']();}}['_handleError'](_0x555a36){if(_0x555a36 instanceof at)throw _0x555a36;if(_0x555a36 instanceof Error&&'AbortError'===_0x555a36['name'])throw new at('ai-request-aborted',this,{'originalError':_0x555a36});throw new at('ai-request-failed',this,{'originalError':_0x555a36});}}function hs(_0x10ef14,_0x1e7d79,_0x123df6){const t=_0x10ef14['t'];switch(_0x1e7d79){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'},_0x123df6);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.'},_0x123df6);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.'},_0x123df6);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.'},_0x123df6);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'},_0x123df6);case'AI_CHAT_SUGGESTION_ACTION_SUGGEST':return t({'id':'AI_CHAT_SUGGESTION_ACTION_SUGGEST','string':'Suggest'},_0x123df6);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'},_0x123df6);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.'},_0x123df6);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.'},_0x123df6);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.'},_0x123df6);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.'},_0x123df6);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'},_0x123df6);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.'},_0x123df6);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 _0x1e7d79;}}const cs='ck-ai-button-primary',ls='ck-ai-button-secondary',us='ck-ai-button-tertiary';function ds(_0x4630b4,_0x1daef9){const _0x2a3b3e=new Nt(_0x4630b4),_0x3e3391=hs(_0x4630b4,'AI_TABS_LABEL_MINIMIZE'),_0xda169c=hs(_0x4630b4,'AI_TABS_LABEL_MAXIMIZE');return _0x2a3b3e['set']({'withText':!0x1,'icon':_0x345c28,'tooltip':!0x0,'class':'ck-ai-tabs__resize\x20'+us}),_0x2a3b3e['bind']('label')['to'](_0x1daef9,'isMaximized',_0x381bdd=>_0x381bdd?_0x3e3391:_0xda169c),_0x2a3b3e['bind']('icon')['to'](_0x1daef9,'isMaximized',_0x41e74a=>_0x41e74a?_0x4b6c86:_0x345c28),_0x2a3b3e['bind']('isOn')['to'](_0x1daef9,'isMaximized'),_0x2a3b3e['on']('execute',()=>{_0x1daef9['fire']('resizeTabs');}),_0x2a3b3e;}function _s(_0x4a0a14){return _0x5bff37(_0x4a0a14);}function gs(_0xe16c86){return ti(_0xe16c86);}function As(_0x207693,_0x552239,_0x39964c){const _0x2ce42e=null!==_0x552239?_0x3b964a=>_0x3b964a['attribs'][_0x207693]===_0x552239:_0x320223=>Boolean(_0x320223['attribs'][_0x207693]);return _0xa32e9a(_0x52cc36=>_0x57c018(_0x52cc36)&&_0x2ce42e(_0x52cc36),_0x39964c);}function Is(_0x4aea16,_0x9712b0,_0x29661f){const _0x36ef57=null!==_0x9712b0?_0x3c2fb7=>_0x3c2fb7['attribs'][_0x4aea16]===_0x9712b0:_0x34c306=>Boolean(_0x34c306['attribs'][_0x4aea16]);return _0x8f0e86(_0x4a7e4a=>_0x57c018(_0x4a7e4a)&&_0x36ef57(_0x4a7e4a),_0x29661f);}function Es(_0x4c0e81,_0x30f9d4){return _0x4c0e81&&_0x57c018(_0x4c0e81)?_0x4c0e81['attribs'][_0x30f9d4]:null;}function ps(_0x3eafea,_0xd999b7,_0x194635){_0x57c018(_0x3eafea)&&(null===_0x194635?delete _0x3eafea['attribs'][_0xd999b7]:_0x3eafea['attribs'][_0xd999b7]=_0x194635);}function ms(_0x5d6063,_0x8b3637,_0x9d38e5){const _0x5ba8cc=_0x8b3637['cloneNode'](!0x0);'beforebegin'===_0x9d38e5?_0x50c4bc(_0x5d6063,_0x5ba8cc):'afterbegin'===_0x9d38e5?_0x4778fe(_0x5d6063,_0x5ba8cc):'beforeend'===_0x9d38e5?_0x3645b6(_0x5d6063,_0x5ba8cc):'afterend'===_0x9d38e5&&_0x1e8db8(_0x5d6063,_0x5ba8cc);}function Ts(_0x3c706f){const _0x541a82=[];let _0x40ca33=_0x3c706f;for(;_0x40ca33;)_0x40ca33=_0xdb6626(_0x40ca33),_0x40ca33&&_0x541a82['push'](_0x40ca33);return _0x541a82;}function Cs(_0x594696){return _0x594696['replace'](/^\s+/gm,'')['replace'](/\s+$/gm,'')['replace'](/\n*/g,'')['replace'](/\s+/g,'\x20')['replace'](/>\s*</g,'><');}function ws(_0x5c359d){let _0x32dc2c=0x0;for(;_0x5c359d['parentNode'];)_0x5c359d=_0x5c359d['parentNode'],_0x32dc2c++;return _0x32dc2c;}function fs(_0x1ce024){const _0x290bd0=[];let _0x1b58e5=_0x1ce024['nextSibling'];for(;_0x1b58e5;)_0x290bd0['push'](_0x1b58e5),_0x1b58e5=_0x1b58e5['nextSibling'];_0x290bd0['forEach'](_0x2cef2d=>{_0x1085d4(_0x2cef2d);});}class bs extends/* #__PURE__ -- @preserve */
25
- ht(){['_m2html'];constructor(){super();const _0x3b3ece=Object['entries'](_0x3f407f),_0x1cb5d0=_0x3b3ece['findIndex'](([_0x923e6e])=>'rehypeDomRaw'===_0x923e6e);if(-0x1===_0x1cb5d0)throw new at('ai-response-parser-unable-to-set-up-parser');_0x3b3ece['splice'](_0x1cb5d0+0x1,0x0,['rehypeSanitize',_0x55f728]),this['_m2html']=new _0x8f283({'plugins':Object['fromEntries'](_0x3b3ece)});}['convertMarkdownToHTML'](_0x3796e4){const _0x5e043d=this['_m2html']['parse'](_0x3796e4);return this['parseAndNormalizeHTML'](_0x5e043d);}['parseAndNormalizeHTML'](_0x43dfcd){return this['_parseHTML'](_0x43dfcd);}['_parseHTML'](_0x39e608){const _0x13bcd8=_s('<dummy>'+_0x39e608['replace'](/^\t+/gm,'\x20')['replace'](/\n*/g,'')['replace'](/\s+/g,'\x20')['replace'](/<[^>]*?$/g,'')+'</dummy>');return _0x13bcd8['children']=_0x13bcd8['children'][0x0]['children'],_0x13bcd8;}}class Ss extends/* #__PURE__ -- @preserve */
26
- ht(){['_generateUid'];['_uidCounter']=0x0;['_touchedNodesState']={'newIds':[],'modifiedIds':[],'removedIds':[],'invalidIds':[],'lastTouchedId':null};['_existingDataIds']=new Set();constructor(_0x36cd6e){super(),this['_generateUid']=_0x36cd6e||(()=>'e'+String(this['_uidCounter']++));}['merge'](_0x85595c,_0x479dd3,_0x37ec98){this['_uidCounter']=0x0;const _0x58e6d2=_0x85595c['cloneNode'](!0x0),_0x535878=_0x58e6d2['childNodes'],_0x50ab76=Array['from'](_0x535878)['filter'](_0x44ec9b=>!(0x3===_0x44ec9b['nodeType']&&''===gs(_0x44ec9b)['trim']())),_0x195b0d=_0x50ab76['length'],_0x4adf19=new Map();for(const _0x230364 of _0x50ab76)_0x230364&&_0x57c018(_0x230364)&&void 0x0===_0x230364['attribs']['data-id']&&ps(_0x230364,'data-id','new-element');if(0x0===_0x479dd3['childNodes']['length']){const _0xb8595c=[];return Is('data-id','new-element',_0x58e6d2)['forEach'](_0x5352db=>{const _0x47ae67=this['_generateUid']();ps(_0x5352db,'data-id',_0x47ae67),_0xb8595c['push'](_0x47ae67);}),this['_removeSpecialComments'](_0x58e6d2),{'parsedContent':_0x58e6d2,'newNodeIds':_0xb8595c,'modifiedNodeIds':[],'removedNodeIds':[],'newAnchorIds':_0x4adf19};}_0x37ec98&&_0x37ec98['markUnstableElements']&&this['_markLastTagElementUnstable'](_0x58e6d2),this['_touchedNodesState']['newIds']=[],this['_touchedNodesState']['modifiedIds']=[],this['_touchedNodesState']['removedIds']=[],this['_touchedNodesState']['invalidIds']=[],this['_touchedNodesState']['lastTouchedId']=null,this['_existingDataIds']=new Set(Is('data-id',null,_0x479dd3)['map'](_0x415de1=>Es(_0x415de1,'data-id'))['filter'](_0xabbcee=>!!_0xabbcee));let _0x32cad6=-0x1,_0x4c8fa8=!0x1;for(let _0x3327e9=0x0;_0x3327e9<_0x195b0d;_0x3327e9++){const _0x6c3833=_0x50ab76[_0x3327e9],_0x4c1c50=_0x50ab76[_0x3327e9+0x1];if(this['_isNewNode'](_0x6c3833)){if(-0x1===_0x32cad6&&(_0x32cad6=_0x3327e9),this['_markWrappedElements'](_0x6c3833),!this['_isNewNode'](_0x4c1c50)){const [_0x3020e7,_0x35cc78]=this['_findReferenceNode'](_0x6c3833,_0x4c8fa8,_0x479dd3);if(_0x3020e7){const _0x5948bc=Array['from'](_0x50ab76)['slice'](_0x32cad6,_0x3327e9+0x1),_0x3016a8=Es(_0x3020e7,'data-id');if(this['_insertNodes'](_0x3020e7,_0x5948bc,_0x35cc78),_0x3016a8)for(const _0x5e777a of _0x5948bc){const _0x367ed3=Es(_0x5e777a,'data-id');_0x367ed3&&_0x4adf19['set'](_0x367ed3,_0x3016a8);}_0x32cad6=-0x1;}}}else{if(this['_isExistingContentComment'](_0x6c3833))_0x4c8fa8=!0x0;else{if(this['_isExistingNode'](_0x6c3833)){const _0x3fc40f=Es(_0x6c3833,'data-id');if(_0x3fc40f&&this['_existingDataIds']['has'](_0x3fc40f)){const _0x20d106=As('data-id',_0x3fc40f,_0x479dd3);this['_replaceNode'](_0x20d106,_0x6c3833);}}else{if(this['_isDelNode'](_0x6c3833)){const _0x2f4cc3=this['_getNodeDataId'](_0x6c3833);!!As('data-id',_0x2f4cc3,_0x58e6d2)||this['_touchedNodesState']['removedIds']['push'](_0x2f4cc3);}}}}}for(const _0x20dd81 of this['_touchedNodesState']['removedIds']){const _0xc36ffa=As('data-id',_0x20dd81,_0x479dd3);_0xc36ffa&&this['_removeNode'](_0xc36ffa,_0x20dd81,_0x37ec98);}if(Is('data-id','new-element',_0x479dd3)['forEach'](_0x398511=>{const _0x3e826c=this['_getUid'](_0x398511);ps(_0x398511,'data-id',_0x3e826c),this['_touchedNodesState']['newIds']['push'](_0x3e826c);}),this['_removeSpecialComments'](_0x479dd3),_0x37ec98&&_0x37ec98['markUnstableElements']&&this['_markUnstableElements'](_0x479dd3,_0x37ec98['markUnstableElementsDepth']||0x0),this['_processWrappedElements'](_0x479dd3,_0x37ec98),_0x37ec98&&_0x37ec98['cutAfterLastChange']&&this['_touchedNodesState']['lastTouchedId']){const _0x6bdab5=Is('data-id',this['_touchedNodesState']['lastTouchedId'],_0x479dd3);let _0xdc44e2=_0x6bdab5[_0x6bdab5['length']-0x1];for(;_0xdc44e2;)fs(_0xdc44e2),_0xdc44e2=_0xdc44e2['parentNode'];}return{'parsedContent':_0x479dd3,'newNodeIds':this['_touchedNodesState']['newIds'],'modifiedNodeIds':this['_touchedNodesState']['modifiedIds'],'removedNodeIds':this['_touchedNodesState']['removedIds'],'newAnchorIds':_0x4adf19};}['_insertNodes'](_0x241c7d,_0x243877,_0x12434c){for(const _0x5eeef3 of _0x243877){const _0x45e4ce=this['_getUid'](_0x5eeef3);ps(_0x5eeef3,'data-id',_0x45e4ce),this['_touchedNodesState']['newIds']['push'](_0x45e4ce),this['_touchedNodesState']['lastTouchedId']=_0x45e4ce;}const _0x23b955='afterbegin'===_0x12434c||'afterend'===_0x12434c?_0x243877['reverse']():_0x243877;for(const _0x17989b of _0x23b955)ms(_0x241c7d,_0x17989b,_0x12434c);}['_replaceNode'](_0x4e14b3,_0x4088ad){if(!_0x4e14b3)return;if(_0x1010e3=_0x4088ad,Cs(gs(_0x4e14b3))===Cs(gs(_0x1010e3)))return;var _0x1010e3;const _0x22629c=this['_getUid'](_0x4e14b3);ps(_0x4088ad,'data-id',_0x22629c),this['_touchedNodesState']['modifiedIds']['push'](_0x22629c),this['_touchedNodesState']['lastTouchedId']=_0x22629c,_0x27afaf(_0x4e14b3,_0x4088ad['cloneNode'](!0x0));}['_removeNode'](_0x388aed,_0x38e550,_0x2e128b){if(_0x2e128b&&_0x2e128b['replaceRemovedWith']){this['_touchedNodesState']['lastTouchedId']=_0x38e550;const _0x14a0c1=_0x2e128b['replaceRemovedWith']['cloneNode'](!0x0);ps(_0x14a0c1,'data-id',_0x38e550),ps(_0x14a0c1,'data-removed','true'),_0x27afaf(_0x388aed,_0x14a0c1);}else _0x1085d4(_0x388aed);}['_findReferenceNode'](_0x565b6e,_0x22ff3c,_0x2a8db9){const _0x108663=this['_findPrevElementWithDataId'](_0x565b6e,!0x1);if(_0x108663){const _0x3e6d4c=this['_getNodeDataId'](_0x108663),_0xc43330=As('data-id',_0x3e6d4c,_0x2a8db9);if(_0xc43330)return[_0xc43330,'afterend'];this['_touchedNodesState']['invalidIds']['push'](_0x3e6d4c);}const _0x41f9c0=this['_findNextElementWithDataId'](_0x565b6e,!0x1);if(_0x41f9c0){const _0x4317ed=this['_getNodeDataId'](_0x41f9c0),_0x3e1a07=As('data-id',_0x4317ed,_0x2a8db9);if(_0x3e1a07)return[_0x3e1a07,'beforebegin'];this['_touchedNodesState']['invalidIds']['push'](_0x4317ed);}return _0x22ff3c?_0x565b6e['nextSibling']?this['_findFallbackReferenceNode'](_0x565b6e,_0x2a8db9):[_0x2a8db9['childNodes'][_0x2a8db9['childNodes']['length']-0x1],'afterend']:[_0x2a8db9['childNodes'][0x0],'beforebegin'];}['_findFallbackReferenceNode'](_0x5ca0b7,_0x21f6bb){const _0x2cbb80=[],_0x395859=this['_findPrevElementWithDataId'](_0x5ca0b7,!0x0);if(_0x395859){const _0x3325d9=As('data-id',this['_getNodeDataId'](_0x395859),_0x21f6bb);_0x3325d9&&_0x2cbb80['push']([_0x3325d9,'afterend']);}const _0x126e28=this['_findNextElementWithDataId'](_0x5ca0b7,!0x0);if(_0x126e28){const _0x29ae9b=As('data-id',this['_getNodeDataId'](_0x126e28),_0x21f6bb);_0x29ae9b&&_0x2cbb80['push']([_0x29ae9b,'beforebegin']);}if(_0x2cbb80['length']>0x1)return ws(_0x2cbb80[0x0][0x0])<=ws(_0x2cbb80[0x1][0x0])?_0x2cbb80[0x0]:_0x2cbb80[0x1];return 0x1===_0x2cbb80['length']?_0x2cbb80[0x0]:[_0x21f6bb['lastChild'],'afterend'];}['_findNextElementWithDataId'](_0x14a02a,_0x451430){let _0x225aea=_0x14a02a['nextSibling'],_0x102cfe=null,_0x7344cd=!0x1;for(;_0x225aea;){if(_0xb3cb35(_0x225aea)){if(this['_isDelNode'](_0x225aea)&&(_0x102cfe=_0x225aea),this['_isExistingContentComment'](_0x225aea)&&_0x451430&&!_0x7344cd){_0x7344cd=!0x0,_0x225aea=_0x225aea['nextSibling'];continue;}break;}const _0x37e83e=Es(_0x225aea,'data-id');if(_0x37e83e&&'new-element'!==_0x37e83e&&this['_existingDataIds']['has'](_0x37e83e)){_0x102cfe=_0x225aea;break;}_0x225aea=_0x225aea['nextSibling'];}return _0x102cfe;}['_findPrevElementWithDataId'](_0x35e6d3,_0x4af617){let _0x12631c=_0x35e6d3['previousSibling'],_0x29982a=null,_0xfcbd90=!0x1;for(;_0x12631c;){if(_0xb3cb35(_0x12631c)){if(this['_isDelNode'](_0x12631c)&&(_0x29982a=_0x12631c),this['_isExistingContentComment'](_0x12631c)&&_0x4af617&&!_0xfcbd90){_0xfcbd90=!0x0,_0x12631c=_0x12631c['previousSibling'];continue;}break;}const _0x1f92a5=Es(_0x12631c,'data-id');if(_0x1f92a5&&'new-element'!==_0x1f92a5&&this['_existingDataIds']['has'](_0x1f92a5)){_0x29982a=_0x12631c;break;}_0x12631c=_0x12631c['previousSibling'];}return _0x29982a;}['_markWrappedElements'](_0x1a484f){_0x57c018(_0x1a484f)&&Is('data-id',null,_0x1a484f)['forEach'](_0x312aa2=>{this['_isExistingNode'](_0x312aa2)&&(ps(_0x312aa2,'data-wrapped-id',Es(_0x312aa2,'data-id')),ps(_0x312aa2,'data-id',null));});}['_processWrappedElements'](_0x39cded,_0x4dc1dc){Is('data-wrapped-id',null,_0x39cded)['forEach'](_0x4f903b=>{const _0x414b19=Es(_0x4f903b,'data-wrapped-id');if(Es(_0x4f903b,'data-unstable')||this['_hasUnstableParent'](_0x4f903b))return;const _0x2f9b4a=As('data-id',_0x414b19,_0x39cded);ps(_0x4f903b,'data-id',_0x414b19),ps(_0x4f903b,'data-wrapped-id',null),_0x2f9b4a&&(this['_removeNode'](_0x2f9b4a,_0x414b19,_0x4dc1dc),this['_touchedNodesState']['removedIds']['push'](_0x414b19),this['_touchedNodesState']['lastTouchedId']=_0x414b19);});}['_hasUnstableParent'](_0x1093a4){let _0x29bc83=_0x1093a4['parentNode'];for(;_0x29bc83;){if(Es(_0x29bc83,'data-unstable'))return!0x0;_0x29bc83=_0x29bc83['parentNode'];}return!0x1;}['_getNodeDataId'](_0x24e82d){if(!_0x24e82d)return null;if(_0x57c018(_0x24e82d))return Es(_0x24e82d,'data-id');if(_0xb3cb35(_0x24e82d)){const _0x868e75=gs(_0x24e82d)['match'](/removed[\s*-]data-id="([^"]+)"/);if(_0x868e75&&_0x868e75[0x1])return _0x868e75[0x1];}return null;}['_getUid'](_0x38aa6c){return this['_isExistingNode'](_0x38aa6c)?Es(_0x38aa6c,'data-id'):this['_generateUid']();}['_removeSpecialComments'](_0x2821b5){(function(_0x38aaf9){return _0x225c1c(_0x2eb95c=>_0xb3cb35(_0x2eb95c),_0x38aaf9,!0x0,0x1/0x0);}(_0x2821b5)['filter'](_0x27e90b=>this['_isDelNode'](_0x27e90b)||this['_isExistingContentComment'](_0x27e90b))['forEach'](_0x39bb7f=>{_0x1085d4(_0x39bb7f);}));}['_markLastTagElementUnstable'](_0x5da1ea){const _0x3015ba=_0x5da1ea['childNodes'],_0x1ec9d5=_0x3015ba[_0x3015ba['length']-0x1];_0x1ec9d5&&_0x57c018(_0x1ec9d5)&&ps(_0x1ec9d5,'data-unstable','true');}['_markUnstableElements'](_0x4498ec,_0xa6856c){const _0x2a1691=As('data-unstable','true',_0x4498ec);if(!_0x2a1691)return;const _0x1a4989=Ts(_0x2a1691)['slice'](0x0,-0x1),_0x6bdf8f=_0x1a4989['length'];let _0x2d8421=_0x2a1691;if(_0x6bdf8f>_0xa6856c){let _0x349a6c=_0x6bdf8f,_0x11ad11=null;for(;_0x349a6c>_0xa6856c&&_0x349a6c>=0x0;)_0x349a6c--,_0x11ad11=_0x1a4989[_0x349a6c];_0x11ad11&&(_0x2d8421=_0x11ad11,ps(_0x2a1691,'data-unstable',null),ps(_0x11ad11,'data-unstable','true'));}else{if(_0x6bdf8f<_0xa6856c){let _0x4e66e1=_0x6bdf8f,_0x103546=_0x2a1691;for(;_0x4e66e1<_0xa6856c;){const _0x1ce9ea=_0x103546['childNodes']['filter'](_0x124d90=>_0x57c018(_0x124d90));if(0x0===_0x1ce9ea['length'])break;_0x4e66e1++,_0x103546=_0x1ce9ea[_0x1ce9ea['length']-0x1];}_0x103546&&(_0x2d8421=_0x103546,ps(_0x2a1691,'data-unstable',null),ps(_0x103546,'data-unstable','true'));}}let _0x198b00=_0x2d8421;for(;_0x198b00;){for(;_0x198b00['nextSibling'];)_0x198b00=_0x198b00['nextSibling'],_0x57c018(_0x198b00)&&ps(_0x198b00,'data-unstable','true');_0x198b00=_0x198b00['parentNode'];}}['_isNewNode'](_0x5ea585){return Boolean('new-element'===Es(_0x5ea585,'data-id'));}['_isExistingNode'](_0x5d69ae){return Boolean((Es(_0x5d69ae,'data-id')||'')['length']>0x0&&'new-element'!==Es(_0x5d69ae,'data-id'));}['_isDelNode'](_0x2912f2){return!!_0x2912f2&&Boolean(_0xb3cb35(_0x2912f2)&&gs(_0x2912f2)['match'](/removed[\s*-]data-id="[^"]+"/));}['_isExistingContentComment'](_0x5e026d){return Boolean(_0xb3cb35(_0x5e026d)&&gs(_0x5e026d)['match'](/\s*existing[\s*-](content|document)\s*/g));}}function Rs({editor:_0x13325c,changeGroups:_0x5c24a7,documentContextContent:_0x49a7dd,showDiff:_0x393b22,trimUnchanged:_0x6814a1=!0x0}){return _0x5c24a7['map'](_0x437d8e=>{const _0x28fb50=new _0x553b91([]),_0x500869=new _0x553b91([]),_0x34efb1=new Set();for(const _0x31bc3a of _0x437d8e['changes'])'new'==_0x31bc3a['type']&&Is('data-id',null,_0x31bc3a['node'])['forEach'](_0xe3ff1e=>{_0x34efb1['add'](Es(_0xe3ff1e,'data-id'));});for(const _0x1dfcc2 of _0x437d8e['changes'])if('removed'!=_0x1dfcc2['type']?_0x500869['children']['push'](_0x1dfcc2['node']['cloneNode'](!0x0)):_0x393b22||_0x34efb1['has'](_0x1dfcc2['id'])||_0x500869['children']['push'](_0x1dfcc2['node']['cloneNode'](!0x0)),'new'!=_0x1dfcc2['type']&&(_0x393b22||'removed'!=_0x1dfcc2['type'])){const _0x2e4b4a=_0xa32e9a(_0x572a9b=>Es(_0x572a9b,'data-id')==_0x1dfcc2['id'],_0x49a7dd,!0x0);_0x2e4b4a&&_0x28fb50['children']['push'](_0x2e4b4a['cloneNode'](!0x0));}const {content:_0x68e8b0,hasChanges:_0x26503b}=function(_0x464c75,_0x17aeb8,_0x49a120,_0x2145a2,_0x4b9811=!0x0){const _0xcf8227=_0x464c75['plugins']['get']('DocumentCompare'),_0x1a3402=gs(_0x17aeb8),_0x446d41=gs(_0x49a120),_0x38f73f=_0x464c75['data']['parse'](_0x1a3402,'$root'),_0x2d3ecb=_0x464c75['model']['createPositionAt'](_0x38f73f,0x0),_0x358065=_0xcf8227['getDiff'](_0x1a3402,_0x446d41,{'anchor':_0x2d3ecb,'markDeletions':_0x2145a2,'targetEditor':_0x464c75}),_0x55628e=_0x358065['getOperations']();if(0x0==_0x55628e['length'])return{'content':_0x17aeb8['cloneNode'](!0x0),'hasChanges':!0x1};_0x2145a2?function(_0x460249,_0x4728d5,_0x5f5bf4){if(0x0==_0x460249['length'])return;const _0x2bddf8=_0x5f5bf4['plugins']['get']('DocumentCompare'),_0x4b2eb9=_0x5f5bf4['plugins']['get']('SuggestionsConversion');_0x5f5bf4['model']['change'](_0x4092e0=>{const _0x5e976a=new Set();for(let _0x378123=0x0;_0x378123<_0x460249['length'];_0x378123++){const _0x3e5fe0=_0x460249[_0x378123];if(_0x3e5fe0['baseVersion']=null,_0x3e5fe0['isDocumentOperation']=!0x1,_0x2bddf8['isMarkedRemoveOperation'](_0x3e5fe0)){const _0x45174e=_0xc6d790(_0x3e5fe0['newRange'],_0x5f5bf4['model']),_0x842e05='suggestion:deletion:'+ot()+':$aiSuggestion';_0x4728d5['markers']['set'](_0x842e05,_0x45174e);}else switch(_0x3e5fe0['type']){case'rename':{if(_0x3e5fe0['oldName']==_0x3e5fe0['newName'])break;_0x4092e0['batch']['addOperation'](_0x3e5fe0),_0x5f5bf4['model']['applyOperation'](_0x3e5fe0);const _0x1d593='$elementName',_0x192714=_0x3e5fe0['position'],_0x1832da=_0x5f5bf4['model']['createRange'](_0x192714,_0x5f5bf4['model']['createPositionAt'](_0x192714['nodeAfter'],'end')),_0x32aeea='suggestion:attribute:'+_0x1d593+':'+ot()+':$aiSuggestion';_0x4728d5['markers']['set'](_0x32aeea,_0x1832da);break;}case'addAttribute':case'removeAttribute':case'changeAttribute':{if(_0x3e5fe0['oldValue']==_0x3e5fe0['newValue'])break;_0x4092e0['batch']['addOperation'](_0x3e5fe0),_0x5f5bf4['model']['applyOperation'](_0x3e5fe0);const _0x5857b4=_0x3e5fe0['key'];if(!_0x4b2eb9['isRegisteredAttribute'](_0x5857b4))break;const _0x21c7fe=_0xc6d790(_0x3e5fe0['range'],_0x5f5bf4['model']),_0x38e6f7='suggestion:attribute:'+_0x5857b4+':'+ot()+':$aiSuggestion';_0x4728d5['markers']['set'](_0x38e6f7,_0x21c7fe);break;}case'insert':{_0x4092e0['batch']['addOperation'](_0x3e5fe0),_0x5f5bf4['model']['applyOperation'](_0x3e5fe0);if(_0x460249[_0x378123+0x1]&&'move'==_0x460249[_0x378123+0x1]['type']){Os(_0x4728d5,_0x3e5fe0);break;}const _0x5a6719=_0x3e5fe0['position'],_0x210aaa=_0x3e5fe0['howMany'],_0x1cb26b=_0xc6d790(_0x5f5bf4['model']['createRange'](_0x5a6719,_0x5a6719['getShiftedBy'](_0x210aaa)),_0x5f5bf4['model']),_0x2cb7e6='suggestion:insertion:'+ot()+':$aiSuggestion';_0x4728d5['markers']['set'](_0x2cb7e6,_0x1cb26b);break;}case'split':{_0x4092e0['batch']['addOperation'](_0x3e5fe0),_0x5f5bf4['model']['applyOperation'](_0x3e5fe0);const _0x9e254e=_0x3e5fe0['splitPosition'],_0x8aa311=_0x3e5fe0['moveTargetPosition'],_0x5971f6=_0x5f5bf4['model']['createRange'](_0x9e254e,_0x8aa311),_0x22e8f1='suggestion:insertion:'+ot()+':$aiSuggestion';_0x4728d5['markers']['set'](_0x22e8f1,_0x5971f6);break;}case'move':{_0x4092e0['batch']['addOperation'](_0x3e5fe0),_0x5f5bf4['model']['applyOperation'](_0x3e5fe0),_0x460249[_0x378123-0x1]&&'insert'==_0x460249[_0x378123-0x1]['type']&&Os(_0x4728d5,_0x3e5fe0);const _0x2c8dff=_0x3e5fe0['getMovedRangeStart'](),_0x24a182=_0x3e5fe0['howMany'];for(let _0x3ff6ed=0x0;_0x3ff6ed<_0x24a182;_0x3ff6ed++){const _0x24d7b4=_0x2c8dff['getShiftedBy'](_0x3ff6ed)['nodeAfter'];_0x5e976a['add'](_0x24d7b4);}break;}case'remove':{const _0x1ad707=_0x3e5fe0['sourcePosition'],_0x452586=_0x3e5fe0['howMany'],_0x4c82ef=new _0x4178fd(_0x1ad707,_0x452586);_0x4092e0['batch']['addOperation'](_0x4c82ef),_0x5f5bf4['model']['applyOperation'](_0x4c82ef);break;}}}for(const _0x5a4b96 of _0x5e976a){const _0x589603=_0x5f5bf4['model']['createRangeOn'](_0x5a4b96),_0x171ef7='suggestion:formatBlock:$fakeWrap:'+ot()+':$aiSuggestion';_0x4728d5['markers']['set'](_0x171ef7,_0xc6d790(_0x589603,_0x5f5bf4['model']));}});}(_0x55628e,_0x38f73f,_0x464c75):_0x464c75['model']['change'](_0x21b596=>{for(const _0x2a7bd5 of _0x55628e)if('remove'==_0x2a7bd5['type']){const _0xce777e=_0x2a7bd5['sourcePosition'],_0x2d64b0=_0x2a7bd5['howMany'],_0x5402da=new _0x4178fd(_0xce777e,_0x2d64b0);_0x21b596['batch']['addOperation'](_0x5402da),_0x464c75['model']['applyOperation'](_0x5402da);}else{if('marker'==_0x2a7bd5['type']){const _0x15d4c3=_0x2a7bd5['name'],_0x6e2f8f=_0x2a7bd5['newRange'];null!==_0x6e2f8f?_0x38f73f['markers']['set'](_0x15d4c3,_0x6e2f8f):_0x38f73f['markers']['delete'](_0x15d4c3);}else _0x2a7bd5['baseVersion']=null,_0x2a7bd5['isDocumentOperation']=!0x1,_0x21b596['batch']['addOperation'](_0x2a7bd5),_0x464c75['model']['applyOperation'](_0x2a7bd5);}});if(_0x4b9811){const _0x576fa2=ks(_0x464c75,_0x55628e,_0x38f73f);Ns(_0x464c75['model'],_0x576fa2),function(_0x4d9a33,_0x82cffb){const _0x5957c0=_0x82cffb['getFirstRange']()['start'];let _0x510188=_0x82cffb['getFirstRange']()['end'];const _0x55a1b9=_0x5957c0['root'];(_0x510188['textNode']||_0x510188['nodeAfter']&&_0x510188['nodeAfter']['is']('$text'))&&(_0x4845d3(_0x510188,'...'),_0x510188=_0x510188['getShiftedBy'](0x3)),(_0x5957c0['textNode']||_0x5957c0['nodeBefore']&&_0x5957c0['nodeBefore']['is']('$text'))&&(_0x4845d3(_0x5957c0,'...'),function(_0x5cd4b0,_0x29fa89,_0x10a691){for(let [_0xf7798e,_0x4c1233]of _0x5cd4b0['markers']){const _0x2ad1bd=_0x4c1233['_getTransformedByInsertion'](_0x29fa89,_0x10a691,!0x1);_0x4c1233=_0x2ad1bd[0x0],_0x5cd4b0['markers']['set'](_0xf7798e,_0x4c1233);}}(_0x55a1b9,_0x5957c0,0x3),_0x5957c0['parent']==_0x510188['parent']&&(_0x510188=_0x510188['getShiftedBy'](0x3)));const _0x244553=_0x4d9a33['createRange'](_0x4d9a33['createPositionAt'](_0x55a1b9,0x0),_0x5957c0),_0xee30c8=_0x4d9a33['createRange'](_0x510188,_0x4d9a33['createPositionAt'](_0x55a1b9,'end')),_0x400da3=[..._0x244553['getMinimalFlatRanges'](),..._0xee30c8['getMinimalFlatRanges']()];_0x400da3['reverse']();for(const _0x36f049 of _0x400da3)_0x405a98(_0x36f049),ys(_0x55a1b9,_0x36f049);}(_0x464c75['model'],_0x576fa2);}const _0x469dad=_0x464c75['data']['stringify'](_0x38f73f,{'showSuggestionHighlights':!0x0});return{'content':_s(_0x469dad),'hasChanges':!0x0};}(_0x13325c,_0x28fb50,_0x500869,_0x393b22,_0x6814a1);return{'type':_0x437d8e['changes'][0x0]['type'],'index':_0x437d8e['index'],'content':_0x68e8b0,'hasChanges':_0x26503b};});}function Os(_0x3fcc8e,_0x381804){for(const [_0x12bc29,_0x307f10]of _0x3fcc8e['markers']){const _0x243b50=_0x17fab8['_createFromRanges'](_0x307f10['getTransformedByOperation'](_0x381804));_0x3fcc8e['markers']['set'](_0x12bc29,_0x243b50);}}function ks(_0x66e0f5,_0x2fdd1c,_0x4a31ae){const _0x2dcbc9=_0x66e0f5['plugins']['get']('DocumentCompare');let _0x5d231f=_0x66e0f5['model']['createPositionAt'](_0x4a31ae,Number['POSITIVE_INFINITY']),_0x178cc5=_0x66e0f5['model']['createPositionAt'](_0x4a31ae,0x0);for(const _0x751fd1 of _0x2fdd1c){let _0x25f50c,_0x502b8c;if(_0x2dcbc9['isMarkedRemoveOperation'](_0x751fd1))_0x25f50c=_0x751fd1['newRange']['start'],_0x502b8c=_0x751fd1['newRange']['end'];else switch(_0x5d231f=_0x5d231f['getTransformedByOperation'](_0x751fd1),_0x178cc5=_0x178cc5['getTransformedByOperation'](_0x751fd1),_0x751fd1['type']){case'rename':_0x25f50c=_0x751fd1['position'],_0x502b8c=_0x25f50c['getShiftedBy'](0x1);break;case'addAttribute':case'removeAttribute':case'changeAttribute':_0x25f50c=_0x751fd1['range']['start'],_0x502b8c=_0x751fd1['range']['end'];break;case'insert':_0x25f50c=_0x751fd1['position'],_0x502b8c=_0x25f50c['getShiftedBy'](_0x751fd1['howMany']);break;case'split':_0x25f50c=_0x751fd1['splitPosition'],_0x502b8c=_0x751fd1['moveTargetPosition'];break;case'merge':{const _0x42204d=_0x751fd1['targetPosition']['path']['slice'](0x0,-0x1);_0x25f50c=_0x66e0f5['model']['createPositionFromPath'](_0x4a31ae,_0x42204d),_0x502b8c=_0x25f50c['getShiftedBy'](0x1);break;}case'move':case'remove':{const _0x495ca6=_0x751fd1['howMany'],_0x584244=_0x751fd1['sourcePosition']['_getTransformedByInsertion'](_0x751fd1['targetPosition'],_0x495ca6),_0x3e45dc=_0x751fd1['getMovedRangeStart']();'remove'==_0x751fd1['type']?(_0x25f50c=_0x584244,_0x502b8c=_0x584244):(_0x25f50c=_0x3e45dc,_0x502b8c=_0x3e45dc['getShiftedBy'](_0x495ca6));break;}}_0x25f50c&&_0x25f50c['isBefore'](_0x5d231f)&&(_0x5d231f=_0x25f50c['clone'](),_0x5d231f['stickiness']='toNone'),_0x502b8c&&_0x502b8c['isAfter'](_0x178cc5)&&(_0x178cc5=_0x502b8c['clone'](),_0x178cc5['stickiness']='toNone');}return _0x66e0f5['model']['createSelection'](_0x66e0f5['model']['createRange'](_0x5d231f,_0x178cc5));}function Ns(_0x470608,_0x25c6b1){vs(_0x470608,_0x25c6b1,'forward');const _0x21ba87=_0x25c6b1['getFirstRange']();_0x25c6b1['setTo']([]),_0x25c6b1['setTo'](_0x21ba87,{'backward':!0x0}),vs(_0x470608,_0x25c6b1,'backward');}function vs(_0x5b6b57,_0x41be01,_0x35b215){let _0x250bf5=0x14;for(;_0x250bf5;){_0x5b6b57['modifySelection'](_0x41be01,{'unit':'word','direction':_0x35b215}),_0x250bf5--;const _0x13c25b=_0x41be01['focus']['forward'==_0x35b215?'nodeBefore':'nodeAfter'];if(_0x13c25b&&_0x13c25b['is']('element')&&_0x5b6b57['schema']['isBlock'](_0x13c25b)&&_0x5b6b57['schema']['isObject'](_0x13c25b))break;}}function ys(_0x1d457f,_0x2dfa0e){for(const [_0x7bfbe3,_0x1ed9f3]of _0x1d457f['markers']){const _0x57fbd6=_0x1ed9f3['_getTransformedByDeletion'](_0x2dfa0e['start'],_0x2dfa0e['end']['offset']-_0x2dfa0e['start']['offset']);null!=_0x57fbd6?_0x1d457f['markers']['set'](_0x7bfbe3,_0x57fbd6):_0x1d457f['markers']['delete'](_0x7bfbe3);}}class xs extends ht(){['id'];['interactionId'];['type'];['sources']=[];['parsedContent']=new _0x553b91([]);['parsedMergedContent']=new _0x553b91([]);['changeGroups']=[];['areActionsDisabled']=!0x1;['isFromHistory']=!0x1;['documentContextContent'];['documentId'];['dataIdDocumentSources'];['newNodeAnchorIds']=new Map();['aiResponseParser'];['aiResponseApplier'];['locale'];['cachedSuggestionContentParts']={'withDiff':[],'withoutDiff':[]};constructor({type:_0x950a23,content:_0x590ba9='',isDone:_0x1e03e4=!0x1,isComplete:_0x30ad0e,interactionId:_0x28abb2,areActionsDisabled:_0x5495a7,isFromHistory:_0x4a6b9d=!0x1,documentContextContent:_0x2386b0,dataIdDocumentSources:_0x19cdf0,documentId:_0x51160d,locale:_0x9c40c2,id:_0x5c7f7f}){super(),this['id']=_0x5c7f7f||ot(),this['interactionId']=_0x28abb2,this['type']=_0x950a23,this['areActionsDisabled']=!!_0x5495a7,this['locale']=_0x9c40c2,this['dataIdDocumentSources']=_0x19cdf0,this['documentId']=_0x51160d,this['isFromHistory']=_0x4a6b9d,this['aiResponseParser']=new bs(),this['aiResponseApplier']=new Ss(),this['documentContextContent']=_s(_0x2386b0||''),this['set']('isDone',_0x1e03e4),this['set']('isComplete',_0x30ad0e??_0x1e03e4),this['on']('change:content',()=>{this['onContentChange']();}),this['set']('content',_0x590ba9);}['appendContent'](_0x2d3db0){this['set']('content',this['content']+_0x2d3db0);}['done'](_0x13c7a1=!0x0){this['isComplete']=_0x13c7a1,this['isDone']||(this['set']('isDone',!0x0),this['onContentChange']());}['destroy'](){this['stopListening']();}['setChangeGroupState'](_0x545c60,_0x40e1d3){this['changeGroups'][_0x545c60]['state']=_0x40e1d3,this['fire']('replyChangeGroupStateUpdated',{'reply':this,'index':_0x545c60,'state':_0x40e1d3});}['getContentParts']({showDiff:_0x326d62,groupIndex:_0x45ecb5,editor:_0x14f0a1}){const _0x107d6e=this['_getCachedContentParts'](_0x326d62,_0x45ecb5);if(_0x107d6e)return _0x107d6e;let _0xd12012=[];if(void 0x0===_0x45ecb5)_0xd12012=this['changeGroups'];else{const _0x49a420=this['changeGroups']['find'](({index:_0x47012d})=>_0x47012d===_0x45ecb5);if(!_0x49a420)throw new at('ai-reply-get-content-parts-group-not-found',null,{'aiReply':this,'groupIndex':_0x45ecb5});_0xd12012=[_0x49a420];}const _0x2ce6cc=Rs({'editor':_0x14f0a1,'showDiff':_0x326d62,'changeGroups':_0xd12012,'documentContextContent':this['documentContextContent']});return this['_setCachedContentParts'](_0x326d62,_0x2ce6cc),_0x2ce6cc;}['_getCachedContentParts'](_0x34d6bb,_0x373660){const _0x6e3ea=_0x34d6bb?'withDiff':'withoutDiff';if(!this['cachedSuggestionContentParts'][_0x6e3ea]['length'])return null;const _0x45fe8c=this['cachedSuggestionContentParts'][_0x6e3ea];if(void 0x0===_0x373660)return _0x45fe8c['length']>0x0&&_0x45fe8c['length']!==this['changeGroups']['length']?(this['_setCachedContentParts'](_0x34d6bb,null),null):_0x4a5b1c(_0x45fe8c);{const _0x28b772=_0x45fe8c['find'](({index:_0x1d2291})=>_0x1d2291===_0x373660);if(_0x28b772)return[_0x4a5b1c(_0x28b772)];}return null;}['_setCachedContentParts'](_0x8d4946,_0x4507d0){const _0x1b60b3=_0x8d4946?'withDiff':'withoutDiff';_0x4507d0?_0x4507d0['forEach'](_0x1ef329=>{const _0x2afd0e=this['cachedSuggestionContentParts'][_0x1b60b3],_0x3679db=_0x2afd0e['find'](({index:_0x4e1881})=>_0x4e1881===_0x1ef329['index']);if(_0x3679db){const _0x786c79=_0x2afd0e['indexOf'](_0x3679db);_0x2afd0e['splice'](_0x786c79,0x1,_0x1ef329);}else _0x2afd0e['push'](_0x1ef329);}):this['cachedSuggestionContentParts'][_0x1b60b3]['length']=0x0;}['onContentChange'](){if('modification'===this['type']){this['parsedContent']=this['aiResponseParser']['parseAndNormalizeHTML'](this['content']);const _0x4addc2=this['changeGroups'];this['updateChangeGroups']();const _0x286baf=this['_getDifferentChangeGroups'](_0x4addc2,this['changeGroups']);(_0x286baf['length']||this['isDone'])&&(this['fire']('replyContentUpdated',this,_0x286baf),this['cachedSuggestionContentParts']['withDiff']['length']=this['cachedSuggestionContentParts']['withoutDiff']['length']=0x0);}else this['parsedContent']=this['aiResponseParser']['convertMarkdownToHTML'](this['content']),this['fire']('replyContentUpdated',this);}['_getDifferentChangeGroups'](_0x46d76f,_0x512b75){const _0x56c537=[];for(const _0x216347 of _0x512b75){const _0x2b6584=_0x46d76f[_0x216347['index']];_0x2b6584?_0x2b6584['changes']['length']!==_0x216347['changes']['length']?_0x56c537['push'](_0x216347):_0x2b6584['changes']['forEach']((_0x5d99a0,_0x34b0ac)=>{const _0x10f6fa=_0x216347['changes'][_0x34b0ac];_0x5d99a0['id']!==_0x10f6fa['id']&&_0x56c537['push'](_0x216347);}):_0x56c537['push'](_0x216347);}return _0x56c537;}['updateChangeGroups'](){const _0x20d466=this['locale']?new _0x6c2914('p',{},[new _0x6c2914('span',{'style':'color:\x20#808080;\x20font-style:\x20italic'},[new _0x557dcc(hs(this['locale'],'AI_SUGGESTION_CONTENT_PART_REMOVED'))])]):void 0x0,_0x228323=this['aiResponseApplier']['merge'](this['parsedContent'],this['documentContextContent']['cloneNode'](!0x0),{'markUnstableElements':!this['isDone']||!this['isComplete'],'replaceRemovedWith':_0x20d466,'cutAfterLastChange':!this['isDone']||!this['isComplete']});if(!_0x228323['modifiedNodeIds']['length']&&!this['isDone'])return;this['parsedMergedContent']=_0x228323['parsedContent'],this['newNodeAnchorIds']=_0x228323['newAnchorIds'];let _0x5bfedc=[];if(_0x8f0e86(_0x46b196=>{const _0x1b7d46=Es(_0x46b196,'data-id');if(!_0x1b7d46||!_0x3818be(_0x1b7d46))return!0x1;const _0x38ddc0=[_0x46b196,...Ts(_0x46b196)]['at'](-0x2);if(_0x46b196!=_0x38ddc0){const _0x5b53a9=Es(_0x38ddc0,'data-id');_0x3818be(_0x5b53a9)||(_0x5bfedc['push']({'node':_0x38ddc0,'id':_0x5b53a9,'type':'modified'}),_0x228323['modifiedNodeIds']['push'](_0x5b53a9));}else _0x228323['modifiedNodeIds']['includes'](_0x1b7d46)?_0x5bfedc['push']({'node':_0x46b196,'type':'modified','id':_0x1b7d46}):_0x228323['newNodeIds']['includes'](_0x1b7d46)?_0x5bfedc['push']({'node':_0x46b196,'type':'new','id':_0x1b7d46,'anchorId':Es(_0x46b196['previousSibling'],'data-id')}):_0x5bfedc['push']({'node':_0x46b196,'type':'removed','id':_0x1b7d46});return!0x0;},this['parsedMergedContent']),_0x5bfedc=_0x5bfedc['filter'](({node:_0x464ad0})=>[...Ts(_0x464ad0),_0x464ad0]['every'](_0x5395e5=>!Es(_0x5395e5,'data-unstable'))),0x0==_0x5bfedc['length'])return;const _0x2627da=[[_0x5bfedc[0x0]]];for(let _0x51293f=0x1;_0x51293f<_0x5bfedc['length'];_0x51293f++){const _0x500b6c=_0x2627da[_0x2627da['length']-0x1],_0x68ba98=_0x500b6c[_0x500b6c['length']-0x1];_0x5bfedc[_0x51293f]['node']['previousSibling']==_0x68ba98['node']&&'modified'!=_0x5bfedc[_0x51293f]['type']&&'modified'!=_0x68ba98['type']&&this['_isSameDocument'](_0x5bfedc[_0x51293f]['node'],_0x68ba98['node'])?_0x500b6c['push'](_0x5bfedc[_0x51293f]):_0x2627da['push']([_0x5bfedc[_0x51293f]]);}for(const _0x898a13 of _0x2627da){const _0x45cb9f=_0x898a13[0x0],_0x284bb0=_0x898a13[_0x898a13['length']-0x1],_0x563392=_0x225b37(_0x45cb9f['node']['previousSibling']);_0x563392&&this['_isSameDocument'](_0x563392['node'],_0x45cb9f['node'])&&_0x898a13['unshift'](_0x563392);const _0x59b154=_0x225b37(_0x284bb0['node']['nextSibling']);_0x59b154&&this['_isSameDocument'](_0x59b154['node'],_0x284bb0['node'])&&_0x898a13['push'](_0x59b154);}function _0x3818be(_0x27b116){return _0x228323['modifiedNodeIds']['includes'](_0x27b116)||_0x228323['newNodeIds']['includes'](_0x27b116)||_0x228323['removedNodeIds']['includes'](_0x27b116);}function _0x225b37(_0x570034){if(_0x570034&&Es(_0x570034,'data-id')&&!Es(_0x570034,'data-unstable')){const _0x4342d7=Es(_0x570034,'data-id');if(!_0x3818be(_0x4342d7))return{'node':_0x570034,'type':'context','id':_0x4342d7};}return null;}this['changeGroups']=_0x2627da['map']((_0x3fa6ab,_0x4f9491)=>({'changes':_0x3fa6ab,'state':'pending','index':_0x4f9491}));}['_isSameDocument'](_0x31fdef,_0x16339c){if(!this['dataIdDocumentSources']?.['size'])return!0x0;const _0x2703cc=this['_resolveDocumentSource'](_0x31fdef),_0x3feb07=this['_resolveDocumentSource'](_0x16339c);return!_0x2703cc||!_0x3feb07||_0x2703cc['editor']===_0x3feb07['editor']&&_0x2703cc['rootName']===_0x3feb07['rootName'];}['_resolveDocumentSource'](_0x54063d){if(!_0x54063d||!this['dataIdDocumentSources'])return;const _0x4881c0=Es(_0x54063d,'data-id');if(_0x4881c0){const _0x26ca5e=this['dataIdDocumentSources']['get'](_0x4881c0);if(_0x26ca5e)return _0x26ca5e;const _0x5d2e68=this['newNodeAnchorIds']['get'](_0x4881c0),_0x4cea54=_0x5d2e68?this['dataIdDocumentSources']['get'](_0x5d2e68):void 0x0;if(_0x4cea54)return _0x4cea54;}for(let _0x338d35=_0x54063d['previousSibling'];_0x338d35;_0x338d35=_0x338d35['previousSibling']){const _0x3e510d=Es(_0x338d35,'data-id'),_0x5e786b=_0x3e510d?this['dataIdDocumentSources']['get'](_0x3e510d):void 0x0;if(_0x5e786b)return _0x5e786b;}for(let _0x35767f=_0x54063d['nextSibling'];_0x35767f;_0x35767f=_0x35767f['nextSibling']){const _0x452907=Es(_0x35767f,'data-id'),_0x2d034d=_0x452907?this['dataIdDocumentSources']['get'](_0x452907):void 0x0;if(_0x2d034d)return _0x2d034d;}}}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:_0x2854a7,locale:_0x5dfae2}){super(),this['id']=ot(),this['connector']=_0x2854a7,this['isStopped']=!0x0,this['locale']=_0x5dfae2;}async['start'](){const _0x5191a5=[];let _0x368630,_0x2fbd3e,_0x1b4c62,_0x34d8d2=!0x1;this['isStopped']=!0x1;try{this['currentRequest']=await this['sendRequest'](),this['fire']('interactionStarted',this);const _0x1afc08=await this['currentRequest']['getStream']();for await(const _0x31aace of _0x1afc08){if(this['isStopped'])return;if('error'==_0x31aace['event'])return void this['fire']('error',{'error':new at('ai-chat-interaction-error',this)});switch(_0x31aace['event']){case'message-metadata':this['messageId']=_0x31aace['data']['messageId'];break;case'action-metadata':this['actionCallId']=_0x31aace['data']['callId'];break;case'conversation-title':this['setConversationTitle'](_0x31aace['data']['conversationTitle'],!0x0);break;case'source':_0x5191a5['push'](_0x31aace['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'](),_0x368630='modification-delta'==_0x31aace['event']?'modification':'text',_0x2fbd3e='modification-delta'==_0x31aace['event']?_0x31aace['data']['id']:void 0x0,this['currentReply']&&this['currentReply']['type']!=_0x368630&&(this['currentReply']['done'](),this['currentReply']=void 0x0),this['currentReply']?'modification-delta'==_0x31aace['event']&&(this['currentReply']['documentId']=_0x31aace['data']['documentId']):(this['currentReply']=this['createReply']({'type':_0x368630,'interactionId':this['id'],'id':_0x2fbd3e,...'modification-delta'==_0x31aace['event']&&{'documentId':_0x31aace['data']['documentId']}}),'modification'==_0x368630&&(this['currentReply']['sources']=_0x5191a5['splice'](0x0))),this['currentReply']['appendContent'](_0x31aace['data']['textDelta']);break;case'mcp-tool-result':_0x1b4c62=JSON['parse'](_0x31aace['data']['result']),this['_handleToolResultData']({'toolName':_0x31aace['data']['toolName'],'data':_0x1b4c62['data'],'attributes':_0x1b4c62['attributes']});break;case'mcp-tool-notification':this['_handleToolNotificationData']({'toolName':_0x31aace['data']['toolName'],'data':_0x31aace['data']['data']});}}_0x34d8d2=!0x0;}finally{this['isStopped']||(this['currentReply']&&_0x5191a5['length']>0x0&&(this['currentReply']['sources']=_0x5191a5['splice'](0x0)),this['_finalizeInteraction'](_0x34d8d2),this['fire']('interactionFinished',this));}}['stop'](){this['isStopped']||(this['_finalizeInteraction'](),this['fire']('interactionStopped',this));}['getReply'](_0x284b61){return this['replies']['find'](_0x53239b=>_0x53239b['id']===_0x284b61);}['destroy'](){this['isDestroyed']||(this['stop'](),this['replies']['forEach'](_0x3ff7d0=>_0x3ff7d0['destroy']()),this['replies']=[],this['isDestroyed']=!0x0,this['fire']('interactionDestroyed',this),this['stopListening']());}['createReply'](_0x4e8b91){const _0x5aed66=new xs({'locale':this['locale'],'documentContextContent':this['getDocumentContext']()?.['content'],'dataIdDocumentSources':this['getDocumentContext']()?.['dataIdDocumentSources'],..._0x4e8b91});return this['replies']['push'](_0x5aed66),_0x5aed66['delegate'](...Ls)['to'](this),this['fire']('replyCreated',_0x5aed66),_0x5aed66;}['setConversationTitle'](_0x48062b,_0x1df235=!0x1){this['fire']('setConversationTitle',_0x48062b,_0x1df235);}['resetWebSearchState'](){this['_isWebSearching']&&(this['_isWebSearching']=!0x1,this['fire']('webSearchFinished',this));}['resetReasoningState'](){this['_isReasoning']&&(this['_isReasoning']=!0x1,this['fire']('reasoningFinished',this));}['_handleToolResultData'](_0x1882f1){this['fire']('toolDataReceived',{'type':'result','toolName':_0x1882f1['toolName'],'data':structuredClone(_0x1882f1['data']||{}),'attributes':structuredClone(_0x1882f1['attributes']||{})},this);}['_handleToolNotificationData'](_0x3e7e8b){this['fire']('toolDataReceived',{'type':'notification','toolName':_0x3e7e8b['toolName'],'data':structuredClone(_0x3e7e8b['data'])},this);}['_finalizeInteraction'](_0x1f4ee0=!0x1){this['isStopped']=!0x0,this['currentRequest']&&this['currentRequest']['abortController']['abort'](),this['currentReply']&&this['currentReply']['done'](_0x1f4ee0),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:_0x53adda,config:_0x4f6939,ownerId:_0x4a2111}){super(),this['_connector']=_0x53adda,this['_config']=_0x4f6939,this['_ownerId']=_0x4a2111;}['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'](_0x2c8d83){if(_0x2c8d83)return this['_documentSources']['get'](_0x2c8d83);}['getSourceByDataId'](_0x4abbbf){if(_0x4abbbf)return this['_dataIdToSource']['get'](_0x4abbbf);}['getDocumentContextSlice'](_0x2b2084){const _0x4d7f2a=this['getDocumentSource'](_0x2b2084);if(_0x4d7f2a)return{'editor':_0x4d7f2a['editor'],'rootName':_0x4d7f2a['rootName'],'html':_0x4d7f2a['content'],'version':_0x4d7f2a['version']};}['getDocumentContextSliceByDataId'](_0x5725bf){const _0x50f2e9=this['getSourceByDataId'](_0x5725bf);return _0x50f2e9?this['getDocumentContextSlice'](_0x50f2e9['documentId']):void 0x0;}['getPendingContextItems'](){return this['_pendingContextItems'];}async['populateFromMessage'](_0x28d0ed){const _0x436ebf=await this['_createContextItemFromContent'](_0x28d0ed);return this['_addToConversationContextItem'](_0x436ebf),'current-document'===_0x436ebf['uiId']&&this['_toggleAddCurrentDocumentOptionVisibility'](),_0x436ebf;}async['populateDocumentsFromUserMessage'](_0x1ab1f4,_0x6f25bf){const _0xe0c32=_0x1ab1f4['filter'](_0x4700f1=>'document'===_0x4700f1['type']);if(0x0===_0xe0c32['length'])return{'hasUnmatched':!0x1};if(0x1===_0xe0c32['length'])return{'contextItem':await this['populateFromMessage'](_0xe0c32[0x0]),'hasUnmatched':!0x1};const _0x288a71=_0xe0c32['map'](_0x8b9ff1=>_0x8b9ff1['id']),_0x29ee84=await this['_connector']['fetchDocuments'](this['_ownerId'],_0x288a71)['getDocuments'](),_0x4d7617=new Map(_0x29ee84['map'](_0x4031db=>[_0x4031db['id'],_0x4031db]));this['_documentSources']['clear'](),this['_dataIdToSource']['clear']();const _0x777876=[];let _0x25f26a=!0x1;for(const _0x2d1c0d of _0xe0c32){const _0x44a6da=_0x4d7617['get'](_0x2d1c0d['id']);if(!_0x44a6da)continue;const _0x19bd27=this['_matchDocumentToRoot'](_0x44a6da,_0x6f25bf),_0x3053bb=_0x6f25bf[0x0]&&this['_getFirstRoot'](_0x6f25bf[0x0]);_0x19bd27||(_0x25f26a=!0x0);const _0x1332c8=_0x19bd27?.['editor']??_0x3053bb?.['editor'],_0x411d53=_0x19bd27?.['rootName']??_0x3053bb?.['rootName'];if(_0x1332c8&&_0x411d53){const _0x916335={'editor':_0x1332c8,'rootName':_0x411d53,'content':_0x44a6da['content'],'version':_0x44a6da['attributes']?.['version']??0x0,'name':_0x44a6da['name'],'description':_0x44a6da['description']};this['_documentSources']['set'](_0x44a6da['id'],_0x916335);const _0x36a01c=_s(_0x44a6da['content']);for(const _0x463650 of _0x8f0e86(_0x2c0c9e=>!!Es(_0x2c0c9e,'data-id'),_0x36a01c)){const _0x4d3aa1=Es(_0x463650,'data-id');_0x4d3aa1&&this['_dataIdToSource']['set'](_0x4d3aa1,{..._0x916335,'documentId':_0x44a6da['id']});}}_0x777876['push']({'id':_0x44a6da['id'],'content':_0x44a6da['content'],'version':_0x44a6da['attributes']?.['version']??0x0,'sessionId':_0x44a6da['attributes']?.['sessionId']??null,'selection':[]});}const _0x4c83f7={'id':'current-document','uiId':'current-document','label':'Current\x20document','type':'document','hidden':this['_conversationContextItems']['has']('current-document'),'documents':_0x777876,'dataIdDocumentSources':new Map(this['_dataIdToSource'])};return this['_addToConversationContextItem'](_0x4c83f7),this['_toggleAddCurrentDocumentOptionVisibility'](),{'contextItem':_0x4c83f7,'hasUnmatched':_0x25f26a};}['_matchDocumentToRoot'](_0x52534a,_0x242b75){if(_0x52534a['name'])for(const _0x4ac4a7 of _0x242b75){const _0x38d803=_0x4ac4a7['config']['get']('roots')||{};for(const _0x1749ba of _0x4ac4a7['model']['document']['getRoots']()){if('$graveyard'===_0x1749ba['rootName'])continue;const _0xf6b015=_0x38d803[_0x1749ba['rootName']];if(_0x1749ba['rootName']===_0x52534a['name']&&_0xf6b015?.['description']===_0x52534a['description'])return{'editor':_0x4ac4a7,'rootName':_0x1749ba['rootName']};}}}['_getFirstRoot'](_0x356165){for(const _0x2f2f21 of _0x356165['model']['document']['getRoots']())if('$graveyard'!==_0x2f2f21['rootName'])return{'editor':_0x356165,'rootName':_0x2f2f21['rootName']};}async['_createContextItemFromContent'](_0x312dfa){if('document'===_0x312dfa['type']){const _0xe11ca4=await this['_connector']['fetchDocument'](this['_ownerId'],_0x312dfa['id'])['getDocument']();return{'id':'current-document','uiId':'current-document','label':'Current\x20document','type':_0x312dfa['type'],'content':_0xe11ca4['content'],'hidden':this['_conversationContextItems']['has']('current-document'),'version':_0xe11ca4['attributes']?.['version'],'sessionId':_0xe11ca4['attributes']?.['sessionId']};}if('mcp-tool-context'===_0x312dfa['type'])return{'id':_0x312dfa['id'],'uiId':_0x312dfa['id'],'label':_0x312dfa['data']?.['label']||_0x312dfa['id'],'type':'mcp-tool-context','mcpServerName':_0x312dfa['mcpServerName'],'toolName':_0x312dfa['toolName'],'data':_0x312dfa['data']||{}};return{'id':_0x312dfa['id'],'uiId':_0x312dfa['id'],'label':_0x312dfa['attributes']?.['label']||_0x312dfa['name']||_0x312dfa['url']||_0x312dfa['id'],'type':_0x312dfa['type'],..._0x312dfa?.['attributes']?.['resourceId']?{'resourceId':_0x312dfa['attributes']?.['resourceId']}:{}};}['getSentContextItems'](){return new Map(this['_conversationContextItems']);}['removeFromContext'](_0x2d8641){const _0x1b68a0=this['_pendingContextItems']['get'](_0x2d8641);_0x1b68a0?.['isReadOnly']||this['_removeContextItem'](_0x2d8641);}['clearPendingContextItems'](){if(0x0===this['_pendingContextItems']['size'])return;for(const _0x16142a of this['_pendingContextItems']['values']())this['_removeContextItem'](_0x16142a['uiId']);const _0x2bd9a5=this['_conversationContextItems']['get']('current-document')||this['_pendingContextItems']['get']('current-document');_0x2bd9a5&&this['_addContextItem']({..._0x2bd9a5,'isReadOnly':!0x0,'hidden':!0x0});}['addToConversationContext'](_0x1bf6c7){for(const _0x21cf0d of _0x1bf6c7['values']())this['_addToConversationContextItem'](_0x21cf0d);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'](_0x3b4a74){return Array['from'](_0x3b4a74['values']())['flatMap'](_0x504200=>this['_mapContextItemToRequestData'](_0x504200));}async['addFilesToContext'](_0x532d59,_0x7b844c,_0x2f310c='file'){const _0x3015ad='files-'+ot();this['_startUploadOperation'](_0x3015ad);try{await Promise['all'](_0x532d59['map'](async _0xcdc93f=>{const _0xc0af7e='file-'+ot(),_0x484479=_0x321d30(_0xcdc93f['name']);try{this['_addContextItem']({'type':_0x2f310c,'label':_0x7b844c?.['label']||_0x484479,'uiId':_0xc0af7e,'resourceId':_0x7b844c?.['resourceId']},!0x0);const _0x499d90=this['_connector']['uploadFile'](this['_ownerId'],_0xcdc93f,_0x7b844c);this['_ongoingUploads']['set'](_0xc0af7e,_0x499d90['abortController']);const {id:_0x34d6e5}=await _0x499d90['getId']();this['_ongoingUploads']['delete'](_0xc0af7e),this['_finishContextItemLoading']({'type':_0x2f310c,'id':_0x34d6e5,'label':_0x7b844c?.['label']||_0x484479,'uiId':_0xc0af7e,'resourceId':_0x7b844c?.['resourceId']},!0x1);}catch(_0xabd6f5){this['_ongoingUploads']['delete'](_0xc0af7e);if(!(_0xabd6f5 instanceof at&&_0xabd6f5['message']['startsWith']('ai-request-aborted'))){const _0x9f964d=Ps['get'](_0xabd6f5['code'])||'ai-chat-file-upload-failed',_0x2c3004=new at(_0x9f964d,null,{'fileName':_0x484479,..._0xabd6f5});_0x2c3004['stack']=_0xabd6f5['stack'],this['fire']('error',{'error':_0x2c3004});}this['_removeContextItem'](_0xc0af7e);}}));}finally{this['_finishUploadOperation'](_0x3015ad);}}['addCurrentDocumentToContext'](_0x1dc3d2){if(this['isCurrentDocumentInContext']()||!this['_addContextOptionsState']['document']['enabled'])return;const _0x4a67da={'type':'document','uiId':'current-document','label':_0x1dc3d2,'isReadOnly':this['_conversationContextItems']['has']('current-document'),'hidden':this['_conversationContextItems']['has']('current-document')};this['_addContextItem'](_0x4a67da);}async['updateCurrentDocument'](_0x3f959c,_0x477315,_0x42bf6a,_0x3019ce){const _0x44c7ec=this['_pendingContextItems']['get']('current-document');if(_0x44c7ec&&_0x3f959c){_0x44c7ec['selection']=_0x3019ce?_0x3019ce['map'](_0x55c1db=>({'start':_0x55c1db['start'],'end':_0x55c1db['end']})):[];try{if(_0x44c7ec['version']===_0x477315)return;const {id:_0x17fef1}=await this['_connector']['uploadDocument'](this['_ownerId'],_0x3f959c,{'version':_0x477315,'sessionId':_0x42bf6a})['getId']();_0x44c7ec['id']=_0x17fef1,_0x44c7ec['content']=_0x3f959c,_0x44c7ec['version']=_0x477315,_0x44c7ec['sessionId']=_0x42bf6a;}catch(_0x19c8d3){const _0x4094c6=new at('ai-chat-document-upload-failed',null);_0x4094c6['stack']=_0x19c8d3['stack'],this['fire']('error',{'error':_0x4094c6});}}}async['updateDocuments'](_0x2621dd){const _0x1eddf8=this['_pendingContextItems']['get']('current-document');if(!_0x1eddf8||!_0x2621dd['length']||_0x2621dd['every'](_0x113b2b=>!_0x113b2b['content']))return;_0x2621dd['length']>0x1&&_0x2621dd['some'](_0x588f6d=>!_0x588f6d['description'])&&It('ai-chat-documents-missing-description');const _0x203227=_0x1a2a14=>_0x1a2a14?_0x1a2a14['map'](_0x4bc947=>({'start':_0x4bc947['start'],'end':_0x4bc947['end']})):[],_0x39a247=_0x1eddf8['documents']??[];if(_0x39a247['length']===_0x2621dd['length']&&_0x2621dd['every']((_0x1ecdfa,_0x7de57b)=>_0x39a247[_0x7de57b]?.['version']===_0x1ecdfa['version']))_0x1eddf8['documents']=_0x39a247['map']((_0x18958c,_0x40392c)=>({..._0x18958c,'selection':_0x203227(_0x2621dd[_0x40392c]['selections'])}));else try{const _0x37befb=await this['_connector']['uploadDocuments'](this['_ownerId'],_0x2621dd)['getIds']();_0x1eddf8['documents']=_0x2621dd['map']((_0x87d281,_0xe1ed40)=>({'id':_0x37befb[_0xe1ed40]?.['id'],'content':_0x87d281['content'],'version':_0x87d281['version'],'sessionId':_0x87d281['sessionId'],'selection':_0x203227(_0x87d281['selections'])})),this['_documentSources']['clear'](),this['_dataIdToSource']['clear']();for(let _0x34181b=0x0;_0x34181b<_0x2621dd['length'];_0x34181b++){const _0x5204a8=_0x37befb[_0x34181b]?.['id'],_0x422b26=_0x2621dd[_0x34181b];if(!_0x5204a8)continue;const _0x1bc40d={'editor':_0x422b26['editor'],'rootName':_0x422b26['rootName'],'content':_0x422b26['content'],'version':_0x422b26['version'],'name':_0x422b26['name'],'description':_0x422b26['description']};this['_documentSources']['set'](_0x5204a8,_0x1bc40d);const _0x3b51f8=_s(_0x422b26['content']);for(const _0x429e62 of _0x8f0e86(_0x2447c0=>!!Es(_0x2447c0,'data-id'),_0x3b51f8)){const _0x379ba8=Es(_0x429e62,'data-id');_0x379ba8&&this['_dataIdToSource']['set'](_0x379ba8,{..._0x1bc40d,'documentId':_0x5204a8});}}_0x1eddf8['dataIdDocumentSources']=new Map(this['_dataIdToSource']);}catch(_0x5645ea){const _0x36d911=new at('ai-chat-document-upload-failed',null);_0x36d911['stack']=_0x5645ea['stack'],this['fire']('error',{'error':_0x36d911});}}['addSelectionToContext'](_0x37532d){this['_addContextItem']({'type':'selection','label':_0x37532d,'uiId':'selection','content':_0x37532d});}['removeSelectionFromContext'](){this['_removeContextItem']('selection');}async['addUrlToContext'](_0x371fa0,_0x4316c1){const _0x30feaf='url-'+ot();this['_startUploadOperation'](_0x30feaf);const _0x3d0a03='url-'+ot();try{this['_addContextItem']({'type':'web-resource','label':_0x4316c1?.['label']||_0x371fa0,'uiId':_0x3d0a03,'resourceId':_0x4316c1?.['resourceId']},!0x0);const _0x426125=this['_connector']['uploadUrl'](this['_ownerId'],_0x371fa0,_0x4316c1);this['_ongoingUploads']['set'](_0x3d0a03,_0x426125['abortController']);const {id:_0x37bf5d}=await _0x426125['getId']();this['_ongoingUploads']['delete'](_0x3d0a03),this['_finishContextItemLoading']({'type':'web-resource','id':_0x37bf5d,'label':_0x4316c1?.['label']||_0x371fa0,'uiId':_0x3d0a03,'resourceId':_0x4316c1?.['resourceId']},!0x1);}catch(_0x23ec73){this['_ongoingUploads']['delete'](_0x3d0a03),(_0x23ec73['message']['startsWith']('ai-request-aborted')||this['fire']('error',{'error':new at('ai-chat-url-upload-failed',this,{'url':_0x371fa0,'originalError':_0x23ec73}),'url':_0x371fa0}),this['_removeContextItem'](_0x3d0a03));}finally{this['_finishUploadOperation'](_0x30feaf);}}['addToolItemToContext'](_0x4167de){_0x4167de['id']=_0x4167de['id']??ot()['substring'](0x0,0x15),this['_pendingContextItems']['set'](_0x4167de['uiId'],_0x4167de),this['fire']('contextItemAdded',{'contextItem':_0x4167de,'isLoading':!0x1});}async['loadSourceResources'](_0xdd91e9,_0x14006a,_0x41eb5e){const _0x256423=this['_addContextOptionsState']['sources']['find'](_0x353cd9=>_0x353cd9['id']===_0xdd91e9);if(!_0x256423)return this['fire']('error',{'error':new at('ai-chat-source-not-found',this,{'sourceId':_0xdd91e9}),'sourceId':_0xdd91e9}),[];try{const _0x5c946d=(await _0x256423['getResources'](_0x14006a))['map'](_0x11b0a9=>{const _0x286ae7=this['_isResourceInContext'](_0x11b0a9['id']);return{..._0x11b0a9,'isInContext':_0x286ae7};});return _0x256423['resources']=_0x5c946d,this['fire']('sourceResourcesLoaded',{'sourceId':_0xdd91e9,'source':_0x256423,'resources':_0x5c946d,'uid':_0x41eb5e}),_0x5c946d;}catch(_0x40ac75){return this['fire']('error',{'error':new at('ai-chat-source-resources-load-failed',this,{'sourceId':_0xdd91e9,'originalError':_0x40ac75}),'sourceId':_0xdd91e9,'sourceLabel':_0x256423['label']}),[];}}async['addResourceToContext'](_0x3b4268,_0x150309){if(this['_isResourceInContext'](_0x150309['id']))return;let _0x415b4c=_0x150309['data'];if(!_0x415b4c&&_0x3b4268['getData'])try{_0x415b4c=await _0x3b4268['getData'](_0x150309['id']);}catch(_0xc889ae){return void this['fire']('error',{'error':new at('ai-chat-resource-load-failed',this,{'resourceId':_0x150309['id'],'sourceId':_0x3b4268['id'],'originalError':_0xc889ae}),'resourceId':_0x150309['id'],'sourceId':_0x3b4268['id']});}if(_0x415b4c)switch(_0x150309['type']){case'web-resource':if('string'!=typeof _0x415b4c)return void this['fire']('error',{'error':new at('ai-chat-context-invalid-data',this,{'resourceId':_0x150309['id'],'sourceId':_0x3b4268['id'],'expectedType':'string','actualType':typeof _0x415b4c}),'resourceId':_0x150309['id'],'sourceId':_0x3b4268['id']});await this['addUrlToContext'](_0x415b4c,{'label':_0x150309['label'],'resourceId':_0x150309['id']});break;case'file':if(!(_0x415b4c instanceof File))return void this['fire']('error',{'error':new at('ai-chat-context-invalid-data',this,{'resourceId':_0x150309['id'],'sourceId':_0x3b4268['id'],'expectedType':'File','actualType':typeof _0x415b4c}),'resourceId':_0x150309['id'],'sourceId':_0x3b4268['id']});await this['addFilesToContext']([_0x415b4c],{'label':_0x150309['label'],'resourceId':_0x150309['id']});break;case'text':if('object'!=typeof _0x415b4c||!('content'in _0x415b4c)||!('type'in _0x415b4c))return void this['fire']('error',{'error':new at('ai-chat-context-invalid-data',this,{'resourceId':_0x150309['id'],'sourceId':_0x3b4268['id'],'expectedType':'object\x20with\x20content\x20and\x20type\x20properties','actualType':typeof _0x415b4c}),'resourceId':_0x150309['id'],'sourceId':_0x3b4268['id']});_0x415b4c=Ms['_convertTextResourceToFile'](_0x415b4c,_0x150309['label']),await this['addFilesToContext']([_0x415b4c],{'label':_0x150309['label'],'resourceId':_0x150309['id']},'text');break;case'mcp-tool-context':break;default:this['fire']('error',{'error':new at('ai-chat-context-unsupported-type',this,{'resourceId':_0x150309['id'],'sourceId':_0x3b4268['id'],'resourceType':_0x150309['type']}),'resourceId':_0x150309['id'],'sourceId':_0x3b4268['id']});}else this['fire']('error',{'error':new at('ai-chat-resource-no-data',this,{'resourceId':_0x150309['id'],'sourceId':_0x3b4268['id']}),'resourceId':_0x150309['id'],'sourceId':_0x3b4268['id']});}static['_convertTextResourceToFile'](_0x4600cf,_0x31967c){switch(_0x4600cf['type']){case'markdown':return new File([_0x4600cf['content']],_0x31967c,{'type':'text/markdown'});case'html':return new File([_0x4600cf['content']],_0x31967c,{'type':'text/html'});default:return new File([_0x4600cf['content']],_0x31967c,{'type':'text/plain'});}}static['_mapContextItemToRequestData'](_0x1d043a){switch(_0x1d043a['type']){case'file':case'text':return[{'type':'file','id':_0x1d043a['id']}];case'web-resource':return[{'type':'web-resource','id':_0x1d043a['id']}];case'document':return _0x1d043a['documents']?.['length']?_0x1d043a['documents']['map'](_0x5e7cc5=>({'type':'document','id':_0x5e7cc5['id'],..._0x5e7cc5['selection']?.['length']&&{'selection':_0x5e7cc5['selection']}})):[{'type':'document','id':_0x1d043a['id'],..._0x1d043a['selection']?.['length']&&{'selection':_0x1d043a['selection']}}];case'mcp-tool-context':{const _0x29e312=_0x1d043a;return[{'type':'mcp-tool-context','mcpServerName':_0x29e312['mcpServerName'],'toolName':_0x29e312['toolName'],'data':{..._0x29e312['data'],'label':_0x29e312['label']||_0x29e312['data']?.['label']||_0x29e312['id']},'id':_0x29e312['id']}];}default:return[];}}['_addContextItem'](_0x131db3,_0x2df801=!0x1){if(this['_pendingContextItems']['set'](_0x131db3['uiId'],_0x131db3),_0x131db3['hidden']||this['fire']('contextItemAdded',{'contextItem':_0x131db3,'isLoading':_0x2df801}),'current-document'===_0x131db3['uiId']&&this['_toggleAddCurrentDocumentOptionVisibility'](),_0x131db3['resourceId']){const _0xe0a70a=this['_findSourceIdsByResourceId'](_0x131db3['resourceId']);_0xe0a70a&&_0xe0a70a['forEach'](_0x296177=>{this['_updateResourceInContextState'](_0x296177,_0x131db3['resourceId'],!0x0);});}}['_removeContextItem'](_0x102350){const _0x343ef8=this['_pendingContextItems']['get'](_0x102350),_0x3f608d=this['_ongoingUploads']['get'](_0x102350);if(_0x3f608d&&(_0x3f608d['abort'](),this['_ongoingUploads']['delete'](_0x102350)),_0x343ef8?.['resourceId']){const _0x57f8f1=this['_findSourceIdsByResourceId'](_0x343ef8['resourceId']);_0x57f8f1&&_0x57f8f1['forEach'](_0x336883=>{this['_updateResourceInContextState'](_0x336883,_0x343ef8['resourceId'],!0x1);});}this['_pendingContextItems']['delete'](_0x102350),this['fire']('contextItemRemoved',{'uiId':_0x102350,'type':_0x343ef8?.['type']}),'current-document'===_0x102350&&this['_toggleAddCurrentDocumentOptionVisibility']();}['_finishContextItemLoading'](_0x65c99b,_0x5c14ba){if(this['_pendingContextItems']['has'](_0x65c99b['uiId'])&&(this['_pendingContextItems']['set'](_0x65c99b['uiId'],_0x65c99b),this['fire']('contextItemLoadingEnded',{'contextItem':_0x65c99b,'isLoading':_0x5c14ba}),_0x65c99b['resourceId'])){const _0x5f9c69=this['_findSourceIdsByResourceId'](_0x65c99b['resourceId']);_0x5f9c69&&_0x5f9c69['forEach'](_0x238cd6=>{this['_updateResourceInContextState'](_0x238cd6,_0x65c99b['resourceId'],!0x0);});}}['_addToConversationContextItem'](_0x50812c){this['_conversationContextItems']['set'](_0x50812c['uiId'],_0x50812c);}['_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'](_0xc652a3=>({..._0xc652a3,'enabled':!0x0}))??[]},this['fire']('addContextOptionsChanged',{'options':this['_addContextOptionsState']});}['_getCustomSourcesInitialState'](){return this['_config']?.['sources']?.['map'](_0x3fc4cb=>({..._0x3fc4cb,'resources':[]}))??[];}['_toggleAddCurrentDocumentOptionVisibility'](){const _0x16dbdd=this['isCurrentDocumentInContext']()||this['isCurrentDocumentInConversation']();this['_addContextOptionsState']['document']['isHidden']=_0x16dbdd,this['fire']('addContextOptionsChanged',{'options':this['_addContextOptionsState']});}['_isResourceInContext'](_0x379bad){for(const _0x5075d of this['_pendingContextItems']['values']())if(_0x5075d['resourceId']===_0x379bad)return!0x0;for(const _0x511077 of this['_conversationContextItems']['values']())if(_0x511077['resourceId']===_0x379bad)return!0x0;return!0x1;}['_findSourceIdsByResourceId'](_0x261ecf){const _0x4b0df7=[];for(const _0x3f470f of this['_addContextOptionsState']['sources']){_0x3f470f['resources']['find'](_0xed86b0=>_0xed86b0['id']===_0x261ecf)&&_0x4b0df7['push'](_0x3f470f['id']);}return 0x0===_0x4b0df7['length']?null:_0x4b0df7;}['_updateResourceInContextState'](_0x7d4cf0,_0x5c94c3,_0x3448f6){const _0x20a0a6=this['_addContextOptionsState']['sources']['find'](_0x532420=>_0x532420['id']===_0x7d4cf0);if(!_0x20a0a6)return;const _0x2ec8a0=_0x20a0a6['resources']['find'](_0x507bf4=>_0x507bf4['id']===_0x5c94c3);_0x2ec8a0&&(_0x2ec8a0['isInContext']=_0x3448f6,this['fire']('resourceStateChanged',{'sourceId':_0x7d4cf0,'resourceId':_0x5c94c3,'isInContext':_0x3448f6}));}['_startUploadOperation'](_0xab1276){this['_ongoingUploadOperations']['set'](_0xab1276,!0x0),this['_ongoingUploadOperations']['size']&&this['fire']('uploadProgressChanged',{'isUploadInProgress':!0x0});}['_finishUploadOperation'](_0x19ed9f){this['_ongoingUploadOperations']['delete'](_0x19ed9f),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'](_0x46763b){const _0x4c6a57={};return _0x46763b&&_0x46763b['isWebSearchEnabled']&&(_0x4c6a57['webSearch']={}),_0x46763b&&_0x46763b['isReasoningEnabled']&&(_0x4c6a57['reasoning']={}),_0x4c6a57;}['toggleWebSearch'](){this['setWebSearch'](!this['_isWebSearchEnabled']);}['toggleReasoning'](){this['setReasoning'](!this['_isReasoningEnabled']);}['setWebSearch'](_0x50fca0){_0x50fca0!==this['_isWebSearchEnabled']&&(this['_isWebSearchEnabled']=_0x50fca0,this['fire']('capabilitiesUpdated',this['getCapabilitiesConfig']()));}['setReasoning'](_0x4fc6e1){_0x4fc6e1!==this['_isReasoningEnabled']&&(this['_isReasoningEnabled']=_0x4fc6e1,this['fire']('capabilitiesUpdated',this['getCapabilitiesConfig']()));}}class Bs extends Ds{['userMessage'];['conversationId'];['contextItems']=new Map();['capabilities'];['model'];['attributes'];constructor(_0x3951c8){super(_0x3951c8),this['conversationId']=_0x3951c8['conversationId'],this['contextItems']=_0x3951c8['contextItems'],this['capabilities']=_0x3951c8['capabilities'],this['userMessage']=_0x3951c8['userMessage'],this['model']=_0x3951c8['model'],this['attributes']=_0x3951c8['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'](_0x2cc09b){const _0x2d2762=this['getDocumentContext']();if(_0x2d2762?.['documents']?.['length']){const _0x3d903c=_0x2d2762['documents']['map'](_0x1cfbf9=>_0x1cfbf9['content']??'')['join']('');if(_0x3d903c)return super['createReply']({'documentContextContent':_0x3d903c,..._0x2cc09b});}return super['createReply'](_0x2cc09b);}}class Gs extends Tt(){['id'];['isStarted']=!0x1;['isFromHistory'];['interactions']=[];['currentInteraction'];['selectedModel'];['connector'];['options'];constructor(_0x1057c4){super(),this['options']=_0x1057c4,this['connector']=_0x1057c4['connector'],this['chatModels']=_0x1057c4['chatModels'],this['id']=_0x1057c4['conversationId'],this['isFromHistory']=_0x1057c4['isFromHistory'];}async['init'](_0x1d95e5){try{this['chatContext']=new Ms({'connector':this['connector'],'config':_0x1d95e5,'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 _0x137e2c=await this['chatModels']['getAvailableModels']();this['fire']('conversationInitialized',{'availableModels':_0x137e2c});const _0x4ba210=await this['chatModels']['getModel'](this['options']['selectedModelId']);_0x4ba210&&await this['setModel'](_0x4ba210);}catch(_0x2e0d89){const _0x56c3ab=new at('ai-chat-conversation-init-failed',null,{'message':_0x2e0d89['message']||_0x2e0d89});_0x56c3ab['stack']=_0x2e0d89['stack'],this['fire']('error',{'error':_0x56c3ab});}}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:_0x5263ed}=await this['connector']['startConversation'](this['id'],this['options']['group'])['getConversation']();this['id']=_0x5263ed,this['isStarted']=!0x0,this['fire']('conversationStarted',{'conversationId':this['id'],'selectedModel':this['selectedModel']});}catch(_0x3e9469){const _0x30136f=new at('ai-chat-conversation-start-failed',null,{'message':_0x3e9469['message'],'conversationId':this['id']});throw _0x30136f['stack']=_0x3e9469['stack'],this['fire']('error',{'error':_0x30136f}),_0x30136f;}}async['load'](_0x360fd1,_0x2f4714){try{const _0x511558=await this['connector']['fetchConversation'](_0x360fd1)['getConversation'](),_0x4f9865=await this['connector']['fetchConversationMessages'](_0x360fd1)['getMessages'](),_0x3ed23b=_0x4f9865[0x0]['model'];this['isStarted']=!0x0,this['id']=_0x511558['id'],'title'in _0x511558?this['fire']('setConversationTitle',_0x511558['title'],!0x0):this['fire']('setConversationTitle','',!0x0);const _0x25f907=(await this['chatModels']['getAll']())['find'](_0x323db9=>_0x323db9['id']['toLowerCase']()===_0x3ed23b['toLowerCase']());return this['selectedModel']=_0x25f907,this['fire']('modelSelected',{'selectedModel':_0x25f907,'isDisabled':!0x0}),await this['_processMessagesToInteractions'](_0x4f9865,_0x2f4714,_0x3ed23b),this['currentInteraction']=void 0x0,this;}catch(_0x2ad24c){const _0x4e9883=new at('ai-chat-conversation-init-from-id-failed',null,{'message':_0x2ad24c['message'],'conversationId':_0x360fd1});throw _0x4e9883['stack']=_0x2ad24c['stack'],this['fire']('error',{'error':_0x4e9883}),_0x4e9883;}}async['_processMessagesToInteractions'](_0x53af23,_0xed6caf,_0x3153a4){let _0x43fb82,_0x414156=!0x1;for(const _0x45b499 of _0x53af23)if('user'===_0x45b499['role']){const {contextItems:_0x1d28d5,hasUnmatched:_0x1508b4}=await this['_extractContextItems'](_0x45b499);_0x414156=_0x1508b4;const _0x27fee5={'isReasoningEnabled':Object['hasOwn'](_0x45b499['capabilities'],'reasoning'),'isWebSearchEnabled':Object['hasOwn'](_0x45b499['capabilities'],'webSearch')};_0x43fb82=this['createInteraction']({'userMessage':_0x45b499['prompt'],'contextItems':_0x1d28d5,'capabilities':_0x27fee5,'modelId':_0x3153a4,'attributes':_0x45b499['attributes']}),this['currentInteraction']=_0x43fb82,this['chatContext']['addToConversationContext'](this['currentInteraction']['contextItems']);}else{if('assistant'===_0x45b499['role']&&_0x43fb82){const _0x19d3c1=[];for(const _0xb99c7b of _0x45b499['content'])switch(_0xb99c7b['type']){case'text':case'modification':{const _0x2a7a15=_0x43fb82['getDocumentContext'](),_0x5a1805=(_0x2a7a15?.['documents']?.['length']?_0x2a7a15['documents']['some'](_0x187cd8=>_0x187cd8['sessionId']!==_0xed6caf):_0x2a7a15?.['sessionId']!==_0xed6caf)||_0x414156;_0x43fb82['currentReply']?.['type']!==_0xb99c7b['type']&&(_0x43fb82['currentReply']=_0x43fb82['createReply']({'type':_0xb99c7b['type'],'isDone':!0x0,'interactionId':_0x43fb82['id'],'areActionsDisabled':_0x5a1805,'isFromHistory':!0x0}),_0x19d3c1['length']>0x0&&(_0x43fb82['currentReply']['sources']=_0x19d3c1['splice'](0x0))),_0x43fb82['currentReply']['appendContent'](_0xb99c7b['content']);break;}case'url':_0x19d3c1['push'](_0xb99c7b);break;case'mcp-tool-result':{const {data:_0x4e700b,attributes:_0x1f48b}=JSON['parse'](_0xb99c7b['content']);_0x43fb82['_handleToolResultData']({'toolName':_0xb99c7b['toolName'],'data':_0x4e700b,'attributes':_0x1f48b});break;}}}}}async['_extractContextItems'](_0x95f452){const _0x2d1744=new Map();if(!_0x95f452['content'])return{'contextItems':_0x2d1744,'hasUnmatched':!0x1};const _0x487b7a=this['_resolveEditors'](),{contextItem:_0x646e16,hasUnmatched:_0x1f05b8}=await this['chatContext']['populateDocumentsFromUserMessage'](_0x95f452['content'],_0x487b7a);_0x646e16&&_0x2d1744['set'](_0x646e16['id'],_0x646e16);for(const _0x1c625f of _0x95f452['content']){if('document'===_0x1c625f['type'])continue;const _0x1a4998=await this['chatContext']['populateFromMessage'](_0x1c625f);_0x1a4998&&_0x2d1744['set'](_0x1a4998['id'],_0x1a4998);}return{'contextItems':_0x2d1744,'hasUnmatched':_0x1f05b8};}['_resolveEditors'](){return this['options']['getEditors']?this['options']['getEditors']():this['options']['getEditor']?[this['options']['getEditor']()]:[];}async['handleUserInteraction']({userMessage:_0x54238b,attributes:_0x28a82}){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 _0xcf6123=this['chatContext']['getPendingContextItems'](),_0x40ad68=this['chatCapabilities']['getCapabilitiesConfig'](),_0x2fa99c=this['selectedModel']['id'];this['currentInteraction']=this['createInteraction']({'userMessage':_0x54238b,'contextItems':_0xcf6123,'capabilities':_0x40ad68,'modelId':_0x2fa99c,'attributes':_0x28a82}),await this['currentInteraction']['start'](),this['chatContext']['addToConversationContext'](this['currentInteraction']['contextItems']);}catch(_0x14bdea){if(_0x14bdea instanceof at)this['fire']('error',{'interactionId':this['currentInteraction']?this['currentInteraction']['id']:void 0x0,'error':_0x14bdea});else{const _0xfe0b9=Ps['get'](_0x14bdea['code'])||'ai-chat-handle-user-interaction-start-failed';this['fire']('error',{'interactionId':this['currentInteraction']?this['currentInteraction']['id']:void 0x0,'error':new at(_0xfe0b9,null,{'error':_0x14bdea})});}}finally{this['currentInteraction']?.['stop'](),this['currentInteraction']=void 0x0;}}['createInteraction']({userMessage:_0x4c862d,contextItems:_0x5bc1fd,capabilities:_0x237df8,modelId:_0x4d1a6c,attributes:_0x3ae1c4}){const _0x580406=new Bs({'userMessage':_0x4c862d,'contextItems':_0x5bc1fd,'capabilities':_0x237df8,'conversationId':this['id'],'connector':this['connector'],'locale':this['options']['locale'],'model':_0x4d1a6c,'attributes':_0x3ae1c4});return _0x580406['delegate'](...Ls)['to'](this),this['interactions']['push'](_0x580406),this['fire']('interactionCreated',_0x580406),_0x580406;}['getInteraction'](_0x4d65cb){return this['interactions']['find'](_0x3944fd=>_0x3944fd['id']===_0x4d65cb);}['removeInteraction'](_0x4eef1a){const _0x10e8e0=this['getInteraction'](_0x4eef1a);_0x10e8e0&&(_0x10e8e0['destroy'](),this['interactions']['splice'](this['interactions']['indexOf'](_0x10e8e0),0x1));}get['lastInteraction'](){return this['interactions'][this['interactions']['length']-0x1];}['addCurrentDocumentToContext'](_0x529bc3){this['chatContext']['addCurrentDocumentToContext'](_0x529bc3);}async['updateCurrentDocumentInContext']({content:_0x1ffa71,version:_0x5470c4,sessionId:_0x44c9d2,selections:_0x428c14}){await this['chatContext']['updateCurrentDocument'](_0x1ffa71,_0x5470c4,_0x44c9d2,_0x428c14);}async['updateDocumentsInContext'](_0x535499){await this['chatContext']['updateDocuments'](_0x535499);}['getSourceByDataId'](_0x2ce55a){return this['chatContext']['getSourceByDataId'](_0x2ce55a);}['getDocumentContextSliceByDataId'](_0x4afce3){return this['chatContext']['getDocumentContextSliceByDataId'](_0x4afce3);}['getCurrentDocumentContext'](){return this['currentInteraction']?.['getDocumentContext']()?.['content']||'';}['addSelectionToContext'](_0x74e529){this['chatContext']['addSelectionToContext'](_0x74e529);}['removeSelectionFromContext'](){this['chatContext']['removeSelectionFromContext']();}['addFilesToContext'](_0x5c4e4b){this['chatContext']['addFilesToContext'](_0x5c4e4b);}['addUrlToContext'](_0x2ab23e){this['chatContext']['addUrlToContext'](_0x2ab23e);}['addToolItemToContext'](_0x371435){this['chatContext']['addToolItemToContext'](_0x371435);}['addResourceToContext'](_0xa10645,_0x131f47){this['chatContext']['addResourceToContext'](_0xa10645,_0x131f47);}['loadSourceResources'](_0x301708,_0x26d71e,_0xcb159d){return this['chatContext']['loadSourceResources'](_0x301708,_0x26d71e,_0xcb159d);}['removeFromContext'](_0x5b9b23){this['chatContext']['removeFromContext'](_0x5b9b23);}['setWebSearch'](_0x211edf){this['chatCapabilities']['setWebSearch'](_0x211edf);}['toggleWebSearch'](){this['chatCapabilities']['toggleWebSearch']();}['setReasoning'](_0x326b80){this['chatCapabilities']['setReasoning'](_0x326b80);}['toggleReasoning'](){this['chatCapabilities']['toggleReasoning']();}['isCurrentDocumentInContext'](){return this['chatContext']['isCurrentDocumentInContext']();}['isCurrentDocumentInConversation'](){return this['chatContext']['isCurrentDocumentInConversation']();}['isSelectionInContext'](){return this['chatContext']['isSelectionInContext']();}async['setModel'](_0x4d45a9){_0x4d45a9?!0x1===await this['chatModels']['isAvailable'](_0x4d45a9)&&(It('ai-chat-conversation-set-model-not-available',{'conversation':this,'model':_0x4d45a9}),_0x4d45a9=(await this['chatModels']['getAvailableModels']())[0x0]):(It('ai-chat-conversation-set-model-null',{'conversation':this}),_0x4d45a9=(await this['chatModels']['getAvailableModels']())[0x0]),_0x4d45a9['id']!==this['selectedModel']?.['id']&&(this['selectedModel']=_0x4d45a9,this['chatCapabilities']['reset'](),this['fire']('modelSelected',{'selectedModel':_0x4d45a9}));}}class Fs extends Tt(){['_connector'];['_config'];['_locale'];['_modelList']=[];['_modelsRequest']=null;constructor({connector:_0x2df42f,config:_0x434d5f,locale:_0x1108db}){super(),this['_connector']=_0x2df42f,this['_config']=_0x434d5f,this['_locale']=_0x1108db;}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 _0x1e65c0=await this['getAll']();let _0x194798;return _0x194798=this['_availableModels']?this['_filterModels'](_0x1e65c0,this['_availableModels']):_0x1e65c0['filter'](_0x5bc48e=>_0x5bc48e['recommended']),_0x194798;}async['getModel'](_0x4e35fd){const _0x5b5179=await this['getAll']();if(!_0x5b5179['length'])return null;if(_0x4e35fd){const _0x67bc90=this['_getModelById'](_0x5b5179,_0x4e35fd);if(_0x67bc90)return _0x67bc90;It('ai-chat-model-id-unrecognized',{'modelId':_0x4e35fd,'fallBackModelId':this['_defaultModelId']});}return this['getDefault']();}async['getDefault'](){const _0x5b654a=await this['getAvailableModels']();if(!_0x5b654a['length'])return null;if(this['_defaultModelId']){const _0xf11ced=this['_getModelById'](_0x5b654a,this['_defaultModelId']);if(_0xf11ced)return _0xf11ced;It('ai-chat-default-model-id-unrecognized',{'defaultModelId':this['_defaultModelId'],'fallBackModelId':_0x5b654a[0x0]['id']});}return _0x5b654a[0x0];}async['isAvailable'](_0x12a904){return(await this['getAvailableModels']())['some'](_0x2328fe=>_0x2328fe['name']===_0x12a904['name']&&_0x2328fe['provider']===_0x12a904['provider']);}async['_retrieveModels'](){if(!this['_modelList']['length'])try{const _0x3292a6=this['_locale']['uiLanguage']||'en',_0x3f1e04=this['_connector']['getModels'](_0x3292a6),_0x53754a=await _0x3f1e04['list']();this['_modelList']=_0x53754a['items']['map'](_0x433583=>Ks(_0x433583)?{..._0x433583,'name':hs(this['_locale'],'AI_MODEL_NAME_AUTO')}:_0x433583);}catch(_0x22b36e){throw Et('ai-models-unable-to-retrieve',{'error':_0x22b36e}),_0x22b36e;}return[...this['_modelList']];}['_filterModels'](_0xad2a04,_0x34054f){let _0x31796c;if(_0x34054f){_0x31796c=[];const _0x1c200=new Set(),_0x4b7d7f='string'==typeof _0x34054f?[_0x34054f['toLocaleLowerCase']()]:_0x34054f['map'](_0x31a070=>_0x31a070['toLocaleLowerCase']());for(const _0x2088f7 of _0x4b7d7f)for(const _0x3a4425 of _0xad2a04)!_0x1c200['has'](_0x3a4425['id'])&&this['_isMatchingFilter'](_0x3a4425,_0x2088f7)&&(_0x31796c['push'](_0x3a4425),_0x1c200['add'](_0x3a4425['id']));}else _0x31796c=_0xad2a04;return _0x31796c;}['_isMatchingFilter'](_0x43ec1b,_0x5462db){const _0x5152fe=_0x43ec1b['id']['toLocaleLowerCase'](),_0x46508b=_0x43ec1b['name']['toLocaleLowerCase'](),_0x2bb37d=_0x43ec1b['provider']['toLocaleLowerCase']();return _0x5152fe===_0x5462db||_0x46508b===_0x5462db||Ks(_0x43ec1b)&&'auto'===_0x5462db||_0x2bb37d===_0x5462db||_0x5152fe['startsWith'](_0x5462db);}['_getModelById'](_0x330adc,_0xe2ec2c){return _0x330adc['find'](_0x2c802b=>Ks(_0x2c802b)&&'auto'===_0xe2ec2c?_0x2c802b:_0x2c802b['id']===_0xe2ec2c)||null;}}function Ks(_0x29ae45){return _0x29ae45['id']['startsWith']('agent');}function Ws(_0x432e35){return _0x432e35?_0x432e35 instanceof _0x123c85?[_0x432e35]:_0x432e35['editors']&&0x0!==_0x432e35['editors']['length']?Array['from'](_0x432e35['editors']):[]:[];}function Ys(_0x29e50e){const _0x3ba284=Ws(_0x29e50e);if(!_0x3ba284['length'])throw new at('ai-get-editor-from-context-no-editor');if(0x1===_0x3ba284['length'])return _0x3ba284[0x0];const _0x8c7b78=_0x3ba284['find'](_0x266897=>_0x266897['ui']?.['focusTracker']?.['isFocused']);if(_0x8c7b78)return _0x8c7b78;const _0x2a4a82=function(_0x41175e){if(_0x41175e instanceof _0x123c85)return;const _0x3fa56e=_0x41175e;if(!_0x3fa56e['plugins']||!_0x3fa56e['plugins']['has']('AIEditing'))return;const _0x22f2b3=_0x3fa56e['plugins']['get']('AIEditing');return _0x22f2b3['getLastContentFocusedEditor']?.();}(_0x29e50e);return _0x2a4a82&&_0x3ba284['includes'](_0x2a4a82)?_0x2a4a82:_0x3ba284[0x0];}function $s(_0x46ae63){return Ys(_0x46ae63);}function qs({editor:_0x4b6584,interaction:_0x40f8a3,reply:_0x4c2c56,groups:_0x1668e7,transform:_0x2f129e,documentCompare:_0x30355e,documentCompareOptions:_0x57ff44,documentContextSlice:_0x3669b}){const _0x292316=_0x40f8a3['getDocumentContext']();if(!_0x292316)return[];const _0x1daf90=_0x4c2c56['documentContextContent']['cloneNode'](!0x0);for(const {changes:_0x1066ca}of _0x1668e7){const _0x3a56aa=_0x1066ca['filter'](_0x441ab4=>'new'!=_0x441ab4['type'])['map'](_0x20e241=>As('data-id',_0x20e241['id'],_0x1daf90)),_0x3c60e5=_0x1066ca['filter'](_0x4d6574=>'removed'!=_0x4d6574['type'])['map'](_0x5c509e=>_0x5c509e['node']['cloneNode'](!0x0));let _0x1ebddf=null;if(_0x3a56aa['length']){_0x1ebddf=_0x3a56aa[0x0]['previousSibling'];for(let _0x4a254d=0x0;_0x4a254d<_0x3a56aa['length'];_0x4a254d++)_0x1085d4(_0x3a56aa[_0x4a254d]);}if(_0x3c60e5['length']){_0x1ebddf||(_0x1066ca[0x0]['anchorId']?_0x1ebddf=As('data-id',_0x1066ca[0x0]['anchorId'],_0x1daf90):(_0x1ebddf=_0x3c60e5['shift'](),_0x4778fe(_0x1daf90,_0x1ebddf)));for(let _0x208b04=0x0;_0x208b04<_0x3c60e5['length'];_0x208b04++)_0x1e8db8(_0x1ebddf,_0x3c60e5[_0x208b04]),_0x1ebddf=_0x3c60e5[_0x208b04];}}let _0x1b8580,_0x54c042,_0x3402cf,_0x5bf97a=_0x57ff44;if(_0x3669b){_0x1b8580=_0x3669b['html'],_0x3402cf=_0x3669b['version'],_0x5bf97a={..._0x57ff44,'anchor':_0x3669b['rootName']};const _0x2f8172=new _0x553b91([]),_0x276ec8=_0x1daf90['children'],_0x31146a=_0x4c2c56['dataIdDocumentSources'],_0x5675cd=_0x4c2c56['newNodeAnchorIds'],_0x23f20f=_0x3669b['editor'],_0x48aa31=_0x3669b['rootName'],_0x262657=new Array(_0x276ec8['length']),_0x47f3dd=_0x51e86d=>_0x51e86d?_0x51e86d['editor']===_0x23f20f&&_0x51e86d['rootName']===_0x48aa31:void 0x0;for(let _0x3b300b=0x0;_0x3b300b<_0x276ec8['length'];_0x3b300b++){const _0x4e0a2c=Es(_0x276ec8[_0x3b300b],'data-id');if(!_0x4e0a2c)continue;const _0xee6494=_0x47f3dd(_0x31146a?.['get'](_0x4e0a2c));if(void 0x0!==_0xee6494){_0x262657[_0x3b300b]=_0xee6494;continue;}const _0x1a40f0=_0x5675cd['get'](_0x4e0a2c),_0xea31f9=_0x1a40f0?_0x47f3dd(_0x31146a?.['get'](_0x1a40f0)):void 0x0;void 0x0!==_0xea31f9&&(_0x262657[_0x3b300b]=_0xea31f9);}for(let _0x54c81d=0x0;_0x54c81d<_0x276ec8['length'];_0x54c81d++)if(void 0x0===_0x262657[_0x54c81d]){for(let _0x54a09f=_0x54c81d-0x1;_0x54a09f>=0x0;_0x54a09f--)if(void 0x0!==_0x262657[_0x54a09f]){_0x262657[_0x54c81d]=_0x262657[_0x54a09f];break;}if(void 0x0===_0x262657[_0x54c81d]){for(let _0x406a00=_0x54c81d+0x1;_0x406a00<_0x276ec8['length'];_0x406a00++)if(void 0x0!==_0x262657[_0x406a00]){_0x262657[_0x54c81d]=_0x262657[_0x406a00];break;}}}for(let _0x550eb8=0x0;_0x550eb8<_0x276ec8['length'];_0x550eb8++)_0x262657[_0x550eb8]&&_0x2f8172['children']['push'](_0x3eb68e(_0x276ec8[_0x550eb8],!0x0));_0x54c042=gs(_0x2f8172);}else _0x1b8580=_0x292316['content'],_0x3402cf=_0x292316['version'],_0x54c042=gs(_0x1daf90);const _0x207a61=_0x30355e['getDiff'](_0x1b8580,_0x54c042,{..._0x5bf97a,'targetEditor':_0x4b6584})['getOperations']();if(_0x2f129e){const _0x56f6fe=_0x4b6584['model']['document']['history']['getOperations'](_0x3402cf),_0x3ddc14={'document':_0x4b6584['model']['document'],'useRelations':!0x1,'padWithNoOps':!0x1};return _0x469e64(_0x207a61,_0x56f6fe,_0x3ddc14)['operationsA'];}return _0x207a61;}function Qs(_0x2df372,_0xc6c2cf){if('marker'!=_0xc6c2cf['type'])return;const _0x1ba17d=_0x2df372['model']['markers']['get'](_0xc6c2cf['name']);_0x1ba17d&&(_0xc6c2cf['oldRange']=_0x1ba17d['getRange']());}class Xs extends _0x1c4dd1{['activeConversation'];['_aiEditing'];['_aiConnector'];['_aiChatUi'];['_aiChatModels'];['_aiChatBalloon'];['_activeBalloon'];['_wiredBalloons']=new Set();['_batchToChanges']=new Map();['_currentPreviewedChangeGroup']=null;['_bodyCollection'];static get['requires'](){return[as,_0x216072];}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 _0x5278fc=this['context']['plugins']['get']('AITabs');this['listenTo'](this['_aiChatUi'],'startConversation',()=>{this['_startConversationSafely']();}),this['listenTo'](this['_aiChatUi'],'sendUserMessage',(_0x236b4e,_0x374277)=>{this['_handleUIUserMessage']({'message':_0x374277});}),this['listenTo'](_0x5278fc['view'],'change:activeTab',(_0x295373,_0x8624c5,_0x27d336)=>{'chat'!==_0x27d336&&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',(_0x37374b,_0x2a352f)=>{this['activeConversation']?.['addFilesToContext'](Array['from'](_0x2a352f));}),this['listenTo'](this['_aiChatUi'],'addUrlToContext',(_0x19fefc,_0x5334b2)=>{this['activeConversation']?.['addUrlToContext'](_0x5334b2);}),this['listenTo'](this['_aiChatUi'],'executeCustomItemCallback',(_0x10edb5,_0x135a29)=>{_0x135a29['callback'](this['context']);}),this['listenTo'](this['_aiChatUi'],'addResourceToContext',(_0x10682a,_0x226763)=>{this['activeConversation']?.['addResourceToContext'](_0x226763['source'],_0x226763['resource']);}),this['listenTo'](this['_aiChatUi'],'removeContextItem',(_0x46f2b8,_0x129714)=>{this['_removeFromContext'](_0x129714);}),this['listenTo'](this['_aiChatUi'],'loadSourceResources',(_0x28f8d6,_0x3a8cac)=>{this['activeConversation']?.['loadSourceResources'](_0x3a8cac['sourceId'],_0x3a8cac['query'],_0x3a8cac['uid']);}),this['listenTo'](this['_aiChatUi'],'toggleWebSearch',()=>{this['_toggleWebSearch']();}),this['listenTo'](this['_aiChatUi'],'toggleReasoning',()=>{this['_toggleReasoning']();}),this['listenTo'](this['_aiChatUi'],'selectModel',(_0x4d87cd,_0x41d5d3)=>{this['activeConversation']?.['setModel'](_0x41d5d3);}),this['listenTo'](this['_aiChatUi'],'like',(_0x105a84,{replyId:_0x25e9b5})=>{console['log']('Liked\x20response',_0x25e9b5);}),this['listenTo'](this['_aiChatUi'],'dislike',(_0x44458d,{replyId:_0x4fea4c})=>{console['log']('Disliked\x20response',_0x4fea4c);}),this['listenTo'](this['_aiChatUi'],'insertSuggestion',(_0x7abeb0,_0x480d9b)=>{this['_insertSuggestion'](_0x480d9b);}),this['listenTo'](this['_aiChatUi'],'showChangeInText',(_0xae4a9,{replyId:_0x270c97,partIndex:_0x12225f})=>{this['_aiChatBalloonShowDiff']=this['_aiChatUi']['showDiff'],this['_openBalloonFor'](_0x270c97,_0x12225f);}),this['listenTo'](this['_aiChatUi'],'mouseOverSuggestion',(_0x1082ee,{replyId:_0x3d5489,partIndex:_0x483053})=>{const _0xbb72ad=this['_getDocumentRangeForReplyChanges'](_0x3d5489,_0x483053);_0xbb72ad&&'$graveyard'!=_0xbb72ad['range']['root']['rootName']&&this['_aiEditing']['showFakeVisualSelection']({'ranges':[_0xbb72ad['range']],'id':'change-area','priority':0xa});}),this['listenTo'](this['_aiChatUi'],'mouseLeaveSuggestion',()=>{this['_aiEditing']['hideFakeVisualSelection']('change-area');}),this['listenTo'](this['_aiChatUi'],'applySuggestion',(_0x5011d8,_0x20f048)=>{this['_aiEditing']['hideFakeVisualSelection']('change-area'),this['_applySuggestion'](_0x20f048);}),this['listenTo'](this['_aiChatUi'],'toggleSuggestionDisplayMode',async(_0x5135a6,{replyId:_0x22a194,showDiff:_0x35a4b1})=>{const {reply:_0x75430c}=this['getInteractionAndReplyById'](_0x22a194),_0x4696da=_0x75430c['getContentParts']({'showDiff':_0x35a4b1,'editor':$s(this['context'])});await this['_aiChatUi']['updateFeedItemAIReplySuggestionContent']({'id':_0x75430c['id'],'parts':_0x4696da});}),this['listenTo'](this['_aiChatUi'],'rejectSuggestion',(_0x4e159c,{replyId:_0xc460b0,partIndex:_0x199b9c})=>{this['_rejectSuggestion']({'replyId':_0xc460b0,'partIndex':_0x199b9c}),this['_aiEditing']['hideFakeVisualSelection']('change-area');}),this['set']('_aiChatBalloonShowDiff',!0x1),this['context']['plugins']['has']('AIChatBalloon')&&(this['_aiChatBalloon']=this['context']['plugins']['get']('AIChatBalloon')),this['on']('interactionCreated',(_0x2fe511,_0x4c3961)=>{this['_aiChatUi']['addFeedItemUserMessage'](_0x4c3961);}),this['on']('replyCreated',(_0x4b3ed2,_0x2c74db)=>{this['_addFeedItemReply'](_0x2c74db);});}async['afterInit'](){this['context']instanceof _0x123c85?this['_integrateEditor'](this['context']):this['listenTo'](this['context']['editors'],'add',(_0x209687,_0x34ea3d)=>{_0x34ea3d['on']('ready',()=>{this['_integrateEditor'](_0x34ea3d);});});const _0x3616c4=this['context']['config']['get']('ai.chat.initialConversation');let _0x5033ea=_0x3616c4;if('lastCreated'!=_0x3616c4||(_0x5033ea=await this['_getLastCreatedConversationId'](),_0x5033ea))return'new'==_0x5033ea?this['_startConversationSafely']():this['loadConversation'](_0x5033ea);}async['destroy'](){return await this['_stopLastInteraction'](),this['_bodyCollection']['detachFromDom'](),super['destroy']();}async['loadConversation'](_0x3d345a){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'](_0x3d345a)['getConversation'](),await this['_startConversationSafely']({'id':_0x3d345a}),this['_updateConversationTitle']('\x20'),await this['activeConversation']['load'](_0x3d345a,this['_aiEditing']['sessionId']),this['activeConversation']['isCurrentDocumentInConversation']()&&this['addCurrentDocumentToChatContext']();}catch(_0x44313b){this['_aiChatUi']['addFeedItemError']({'errorMessage':hs(this['context']['locale'],'AI_CHAT_UNABLE_TO_LOAD_CONVERSATION'),'id':_0x3d345a}),this['_logError'](new at('ai-chat-conversation-not-found',this,{'error':_0x44313b}));}finally{this['_aiChatUi']['startAutoScroll']({'smooth':!0x1}),this['_aiChatUi']['setFeedItemRenderingStrategy']('streaming'),this['_aiChatUi']['toggleLoadingSkeleton'](!0x1);}}['registerToolDataCallback'](_0x47b331){let _0x3fd114=null,_0x4c3a7f=null;this['on']('toolDataReceived',(_0xe52357,_0xb31d11,_0x5b5ae1)=>{_0x5b5ae1['id']!==_0x3fd114&&(_0x3fd114=_0x5b5ae1['id'],_0x4c3a7f=this['_getAIChatFeedAPI'](_0x5b5ae1)),_0x47b331(_0xb31d11,_0x4c3a7f);});}['addCurrentDocumentToChatContext'](){this['activeConversation']?.['addCurrentDocumentToContext'](hs(this['context']['locale'],'AI_CHAT_CONTEXT_CURRENT_DOCUMENT'));}async['addSelectionToChatContext'](){const _0x256c0c=this['_aiEditing']['getSelectionText']();this['activeConversation']?.['addSelectionToContext'](_0x256c0c),this['addCurrentDocumentToChatContext']();}['removeSelectionFromChatContext'](){this['activeConversation']?.['removeSelectionFromContext']();}['focusPromptInput'](){this['_aiChatUi']['focusPromptInput']();}async['startConversation'](_0x5dbbf1){await this['_startConversationSafely']({'modelId':_0x5dbbf1?.['modelId']});}async['sendMessage'](_0x427396){await this['_handleUIUserMessage'](_0x427396);}['getGroupId'](){const _0x455af4=this['context']['config']['get']('collaboration.channelId');if(!_0x455af4)throw new at('ai-chat-missing-channel-id',this);return _0x455af4;}['_handleRemovedConversation'](_0x31b8ec){this['activeConversation']['id']===_0x31b8ec&&this['_startConversationSafely']();}['_insertSuggestion'](_0xc67a51){const _0x509c82=this['context']['plugins']['get']('DocumentCompare'),{reply:_0x3507df,interaction:_0x4ee375}=this['getInteractionAndReplyById'](_0xc67a51['replyId']),_0x2996d6=void 0x0!==_0xc67a51['partIndex']?[_0x3507df['changeGroups'][_0xc67a51['partIndex']]]:_0x3507df['changeGroups']['filter'](_0xf759ae=>'pending'==_0xf759ae['state']);for(const _0x845eee of this['_groupChangesByTarget'](_0x3507df,_0x2996d6)){const {target:_0x383669,groups:_0x5b4c04,groupsIndexes:_0x22cb8e,slice:_0x45820e}=_0x845eee;if(!_0x383669['editor']['plugins']['has']('TrackChanges'))throw new at('ai-no-track-changes',null);const _0x5567df=this['_getDocumentRangeForReplyChanges'](_0xc67a51['replyId'],_0x22cb8e[0x0]);if(!_0x5567df||'$graveyard'==_0x5567df['range']['root']['rootName']){_0x22cb8e['forEach'](_0x55037d=>_0x3507df['setChangeGroupState'](_0x55037d,'outdated'));continue;}_0x22cb8e['forEach'](_0x4f7618=>_0x3507df['setChangeGroupState'](_0x4f7618,'accepted'));const _0x22e960=qs({'editor':_0x383669['editor'],'reply':_0x3507df,'interaction':_0x4ee375,'groups':_0x5b4c04,'transform':!0x0,'documentCompare':_0x509c82,'documentCompareOptions':{'anchor':_0x45820e?.['rootName']??'main','markDeletions':!0x0},'documentContextSlice':_0x45820e});let _0x4e5588;this['_scrollToSuggestionRange'](_0x5567df['range'],!0x1,_0x383669['editor']),_0x383669['editor']['model']['change'](_0x1d0cd0=>{_0x4e5588=_0x1d0cd0['batch'],_0x383669['editor']['plugins']['get']('TrackChangesEditing')['_applyOperationsAsSuggestions'](_0x22e960),this['_aiEditing']['hideFakeVisualSelection']('change-area');}),this['_batchToChanges']['set'](_0x4e5588,{'interactionId':_0x4ee375['id'],'replyId':_0x3507df['id'],'indexes':_0x22cb8e['slice']()});}this['_updateRatings'](_0x3507df);}['_applySuggestion'](_0x2bc30b){const _0x57babf=this['context']['plugins']['get'](_0x216072),{reply:_0x3a9b84,interaction:_0x536201}=this['getInteractionAndReplyById'](_0x2bc30b['replyId']),_0x41b1a0=void 0x0!==_0x2bc30b['partIndex']?[_0x3a9b84['changeGroups'][_0x2bc30b['partIndex']]]:_0x3a9b84['changeGroups']['filter'](_0x31eb1b=>'pending'==_0x31eb1b['state']);for(const _0x3e6dd3 of this['_groupChangesByTarget'](_0x3a9b84,_0x41b1a0)){const {target:_0x557c3b,groups:_0x1a7d8c,groupsIndexes:_0x5bc36c,slice:_0x59801f}=_0x3e6dd3,_0x4421cf=this['_getDocumentRangeForReplyChanges'](_0x2bc30b['replyId'],_0x5bc36c[0x0]);if(!_0x4421cf||'$graveyard'==_0x4421cf['range']['root']['rootName']){_0x5bc36c['forEach'](_0x1cc5cb=>_0x3a9b84['setChangeGroupState'](_0x1cc5cb,'outdated'));continue;}_0x5bc36c['forEach'](_0x5ae0ea=>_0x3a9b84['setChangeGroupState'](_0x5ae0ea,'accepted'));const _0x15128f=qs({'editor':_0x557c3b['editor'],'reply':_0x3a9b84,'interaction':_0x536201,'groups':_0x1a7d8c,'transform':!0x0,'documentCompare':_0x57babf,'documentCompareOptions':{'anchor':_0x59801f?.['rootName']??'main','markDeletions':!0x1},'documentContextSlice':_0x59801f});let _0x41913e;this['_scrollToSuggestionRange'](_0x4421cf['range'],!0x1,_0x557c3b['editor']),_0x557c3b['editor']['model']['change'](_0x1852a4=>{_0x41913e=_0x1852a4['batch'];for(const _0x41e0eb of _0x15128f)_0x41e0eb['baseVersion']=_0x557c3b['editor']['model']['document']['version'],Qs(_0x557c3b['editor'],_0x41e0eb),_0x1852a4['batch']['addOperation'](_0x41e0eb),_0x557c3b['editor']['model']['applyOperation'](_0x41e0eb);}),this['_batchToChanges']['set'](_0x41913e,{'interactionId':_0x536201['id'],'replyId':_0x3a9b84['id'],'indexes':_0x5bc36c['slice']()});}this['_updateRatings'](_0x3a9b84);}['_rejectSuggestion'](_0x34baca){const {reply:_0x4c7c10}=this['getInteractionAndReplyById'](_0x34baca['replyId']);_0x4c7c10['setChangeGroupState'](_0x34baca['partIndex'],'rejected');}['_openBalloonFor'](_0x23f8fd,_0x208ba1){if(!this['_aiChatBalloon'])return;const {reply:_0x16757d}=this['getInteractionAndReplyById'](_0x23f8fd),_0x26dfbd=_0x16757d['getContentParts']({'showDiff':this['_aiChatBalloonShowDiff'],'editor':$s(this['context'])});let _0x415dfb,_0x2a9592;if(void 0x0!==_0x208ba1?(_0x2a9592=_0x26dfbd['find'](_0x469a0f=>_0x469a0f['index']==_0x208ba1),_0x415dfb=_0x2a9592?.['index']):(_0x2a9592=_0x26dfbd[0x0],_0x415dfb=_0x2a9592['index']),this['_currentPreviewedChangeGroup']?.['replyId']==_0x23f8fd&&this['_currentPreviewedChangeGroup']?.['partIndex']==_0x415dfb)return;const _0x2c7fa8=this['_getUserPresentableContentPartDocumentRange'](_0x23f8fd,_0x16757d,_0x2a9592),_0x1b9d70=_0x16757d['changeGroups']['find'](_0x1ca92e=>_0x1ca92e['index']==_0x415dfb),_0x32ca73=_0x1b9d70?this['_resolveGroupTarget'](_0x16757d,_0x1b9d70):null,_0x527cc7=_0x32ca73?.['editor']??$s(this['context']),_0x4b9cc3=_0x527cc7['plugins']['has']('AIChatBalloon')?_0x527cc7['plugins']['get']('AIChatBalloon'):this['_aiChatBalloon'];if(this['_activeBalloon']&&this['_activeBalloon']!==_0x4b9cc3&&this['_activeBalloon']['close'](),!_0x2c7fa8)return _0x4b9cc3['close'](),void(this['_activeBalloon']=void 0x0);this['_activeBalloon']=_0x4b9cc3,this['_currentPreviewedChangeGroup']={'replyId':_0x23f8fd,'partIndex':_0x415dfb},this['_scrollToSuggestionRange'](_0x2c7fa8,!0x0,_0x527cc7);const _0x2ab5a2=this['_getPresentableSiblingContentPartIndex'](_0x23f8fd,_0x415dfb,'next');_0x4b9cc3['updateContent']({'part':_0x2a9592,'renderingStrategy':'static'}),_0x4b9cc3['open']({'index':_0x415dfb,'title':hs(this['context']['locale'],'AI_BALLOON_HEADER_TITLE',(_0x415dfb+0x1)['toString']()),'showRotator':null!==_0x2ab5a2,'ranges':[_0x2c7fa8],'areActionsDisabled':_0x16757d['areActionsDisabled'],'targetEditor':_0x527cc7}),_0x4b9cc3['setState']('pending'),this['_aiChatUi']['scrollFeedToSuggestion'](_0x23f8fd,_0x415dfb),this['_aiChatUi']['setFeedItemAIReplySuggestionPartActive']({'id':_0x23f8fd,'index':_0x415dfb,'isActive':!0x0});}['_getPresentableSiblingContentPartIndex'](_0x4e8250,_0x42838,_0x2386a0){const {reply:_0x1fe026}=this['getInteractionAndReplyById'](_0x4e8250),_0x523967=_0x1fe026['getContentParts']({'showDiff':this['_aiChatBalloonShowDiff'],'editor':$s(this['context'])});if(0x1==_0x523967['length'])return null;const _0x2e2199=_0x523967['findIndex'](_0x1637de=>_0x1637de['index']==_0x42838),_0x1042fc='next'==_0x2386a0?0x1:-0x1;let _0x558f57=_0x523967['at']((_0x2e2199+_0x1042fc)%_0x523967['length'])['index'],_0x23a275=_0x523967[_0x558f57];for(;!this['_getUserPresentableContentPartDocumentRange'](_0x4e8250,_0x1fe026,_0x23a275);){if(_0x558f57=_0x523967['at']((_0x558f57+_0x1042fc)%_0x523967['length'])['index'],_0x558f57===_0x2e2199)return null;_0x23a275=_0x523967[_0x558f57];}return _0x558f57;}['_getUserPresentableContentPartDocumentRange'](_0x429893,_0x445838,_0x2fba1d){const _0x4ae7cd=_0x445838['changeGroups'];if(!_0x2fba1d['hasChanges'])return null;const _0x4ef350=_0x4ae7cd['find'](_0x42cc76=>_0x42cc76['index']==_0x2fba1d['index']);if('pending'!==_0x4ef350?.['state'])return null;const _0xc99cd7=this['_getDocumentRangeForReplyChanges'](_0x429893,_0x2fba1d['index']);if(!_0xc99cd7)return _0x445838['setChangeGroupState'](_0x2fba1d['index'],'outdated'),null;const {range:_0x57bd6a,currentIndex:_0x36d622}=_0xc99cd7;return'$graveyard'==_0x57bd6a['root']['rootName']?(_0x445838['setChangeGroupState'](_0x36d622,'outdated'),null):_0xc99cd7['range'];}['_getDocumentRangeForReplyChanges'](_0x52c2c8,_0x34366a){const {reply:_0x131b4e}=this['getInteractionAndReplyById'](_0x52c2c8),_0x27cb9c=_0x131b4e['changeGroups']['filter'](_0x4580e6=>'pending'==_0x4580e6['state']),_0x2350c7=_0x27cb9c['map'](_0xc7bf19=>_0x131b4e['changeGroups']['indexOf'](_0xc7bf19));void 0x0===_0x34366a&&(_0x34366a=_0x2350c7[0x0]);const _0x389a46=_0x2350c7['indexOf'](_0x34366a);if(-0x1==_0x389a46)return null;const _0x5af5c2=_0x27cb9c[_0x389a46],_0xc4b144=this['_resolveGroupTarget'](_0x131b4e,_0x5af5c2);if(!_0xc4b144)return null;const {editor:_0x28d1f3,root:_0x218e28,parsedDocumentContent:_0x25f813,serializedDocumentContent:_0x5b3b9f,version:_0x466e7c}=_0xc4b144,_0x3e3e68=new _0x553b91([]),_0x988dec=new _0x553b91([]);for(const _0x466ec2 of _0x5af5c2['changes']){const _0x1fd633=this['activeConversation']?.['getSourceByDataId'](_0x466ec2['id']);if((!_0x1fd633||_0x1fd633['editor']===_0xc4b144['editor']&&_0x1fd633['rootName']===_0xc4b144['root']['rootName'])&&('removed'!=_0x466ec2['type']&&_0x988dec['children']['push'](_0x466ec2['node']['cloneNode'](!0x0)),'new'!=_0x466ec2['type'])){const _0x74c92f=_0xa32e9a(_0x297fbd=>Es(_0x297fbd,'data-id')==_0x466ec2['id'],_0x25f813,!0x0);if(!_0x74c92f)return null;_0x3e3e68['children']['push'](_0x74c92f['cloneNode'](!0x0));}}if(0x0==_0x3e3e68['children']['length']){if(_0x5af5c2['changes'][0x0]['anchorId']){const _0x5dc8ac=As('data-id',_0x5af5c2['changes'][0x0]['anchorId'],_0x25f813);_0x3e3e68['children']['unshift'](_0x5dc8ac['cloneNode'](!0x0)),_0x988dec['children']['unshift'](_0x5dc8ac['cloneNode'](!0x0)),_0x5dc8ac['nextSibling']&&(_0x3e3e68['children']['push'](_0x5dc8ac['nextSibling']['cloneNode'](!0x0)),_0x988dec['children']['push'](_0x5dc8ac['nextSibling']['cloneNode'](!0x0)));}else{const _0x4ccb55=_0x25f813['children'][0x0];if(!_0x4ccb55)return null;_0x3e3e68['children']['push'](_0x4ccb55['cloneNode'](!0x0)),_0x988dec['children']['push'](_0x4ccb55['cloneNode'](!0x0));}}const _0x232179=_0x28d1f3['data']['parse'](_0x5b3b9f),_0x24fe40=gs(_0x3e3e68),_0x4b7958=_0x28d1f3['data']['parse'](_0x24fe40),_0x16c961=_0x28d1f3['data']['parse'](_0x24fe40),_0x55e3b9=_0x28d1f3['model']['createPositionAt'](_0x4b7958,0x0),_0x1ca8ba=gs(_0x988dec),_0x34a09c={'targetEditor':_0x28d1f3,'anchor':_0x55e3b9,'markDeletions':!0x1},_0x19957a=_0x28d1f3['plugins']['get'](_0x216072)['getDiff'](_0x24fe40,_0x1ca8ba,_0x34a09c)['getOperations']();if(!_0x19957a['length'])return null;_0x28d1f3['model']['change'](_0x4fb3bc=>{for(const _0x3e7da7 of _0x19957a)if('remove'==_0x3e7da7['type']){const _0x4ebe0c=_0x3e7da7['sourcePosition'],_0x338995=_0x3e7da7['howMany'],_0x3cf7f0=new _0x4178fd(_0x4ebe0c,_0x338995);_0x4fb3bc['batch']['addOperation'](_0x3cf7f0),_0x28d1f3['model']['applyOperation'](_0x3cf7f0);}else'marker'!==_0x3e7da7['type']&&(_0x3e7da7['baseVersion']=null,_0x3e7da7['isDocumentOperation']=!0x1,_0x4fb3bc['batch']['addOperation'](_0x3e7da7),_0x28d1f3['model']['applyOperation'](_0x3e7da7));});const _0x2c7503=ks(_0x28d1f3,_0x19957a,_0x4b7958);Ns(_0x28d1f3['model'],_0x2c7503);const _0x10f5f9=_0x2c7503['getFirstRange']()['start']['path']['slice'](),_0x2881fd=_0x2c7503['getFirstRange']()['end']['path']['slice'](),_0x2813da=[];let _0x2c96d5=_0x4b7958,_0x3f4933=_0x16c961;for(let _0x320624=0x0;_0x320624<_0x2881fd['length'];_0x320624++){const _0x18d309=_0x2c96d5['maxOffset']-_0x2881fd[_0x320624];_0x2813da[_0x320624]=_0x3f4933['maxOffset']-_0x18d309,_0x2c96d5=_0x2c96d5['getChildAtOffset'](_0x2881fd[_0x320624]),_0x3f4933=_0x3f4933['getChildAtOffset'](_0x2813da[_0x320624]);}const _0x39a40b=_0x28d1f3['model']['createRange'](_0x28d1f3['model']['createPositionFromPath'](_0x16c961,_0x10f5f9),_0x28d1f3['model']['createPositionFromPath'](_0x16c961,_0x2813da)),_0x22cd1b=_0x16c961['getChild'](0x0)['getAttribute'](_0xf976ed),_0x2b2d3f=Array['from'](_0x232179['getChildren']())['find'](_0x492c6a=>_0x492c6a['getAttribute'](_0xf976ed)==_0x22cd1b)['getPath'](),_0x2f5403=_0x39a40b['start']['path']['slice'](),_0x14845a=_0x39a40b['end']['path']['slice']();_0x2f5403[0x0]=_0x2b2d3f[0x0]+_0x2f5403[0x0],_0x14845a[0x0]=_0x2b2d3f[0x0]+_0x14845a[0x0];let _0x4a7491=_0x28d1f3['model']['createRange'](_0x28d1f3['model']['createPositionFromPath'](_0x218e28,_0x2f5403),_0x28d1f3['model']['createPositionFromPath'](_0x218e28,_0x14845a));const _0x4018ac=_0x28d1f3['model']['document']['history']['getOperations'](_0x466e7c);for(const _0x31595a of _0x4018ac)_0x4a7491=_0x17fab8['_createFromRanges'](_0x4a7491['getTransformedByOperation'](_0x31595a));return{'range':_0x4a7491,'currentIndex':_0x34366a};}['_integrateEditorBalloon'](_0x45e684){if(!_0x45e684['plugins']['has']('AIChatBalloon'))return;const _0x135385=_0x45e684['plugins']['get']('AIChatBalloon');this['_wiredBalloons']['has'](_0x135385)||(this['_wiredBalloons']['add'](_0x135385),this['_aiChatBalloon']||(this['_aiChatBalloon']=_0x135385),_0x135385['bind']('showDiff')['to'](this,'_aiChatBalloonShowDiff'),this['listenTo'](_0x135385,'toggleSuggestionDisplayMode',()=>{const {replyId:_0x540b4a,partIndex:_0x2ee42f}=this['_currentPreviewedChangeGroup'];this['_aiChatBalloonShowDiff']=!this['_aiChatBalloonShowDiff'];const {reply:_0x3926f5}=this['getInteractionAndReplyById'](_0x540b4a),_0x56d917=_0x3926f5['changeGroups']['find'](_0x3e8d41=>_0x3e8d41['index']===_0x2ee42f),_0x312127=_0x56d917?this['_resolveGroupTarget'](_0x3926f5,_0x56d917):null,_0x3c6f2f=_0x3926f5['getContentParts']({'showDiff':this['_aiChatBalloonShowDiff'],'groupIndex':_0x2ee42f,'editor':_0x312127?.['editor']??$s(this['context'])});(this['_activeBalloon']??_0x135385)['updateContent']({'part':_0x3c6f2f[0x0],'renderingStrategy':'static','keepErrors':!0x0});}),this['listenTo'](_0x135385,'applySuggestion',()=>{const {replyId:_0x138a45,partIndex:_0x10a5fe}=this['_currentPreviewedChangeGroup'];this['_applySuggestion']({'replyId':_0x138a45,'partIndex':_0x10a5fe}),(this['_activeBalloon']??_0x135385)['setState']('accepted');}),this['listenTo'](_0x135385,'insertSuggestion',()=>{const {replyId:_0xf12a67,partIndex:_0x4260cd}=this['_currentPreviewedChangeGroup'];this['_insertSuggestion']({'replyId':_0xf12a67,'partIndex':_0x4260cd}),(this['_activeBalloon']??_0x135385)['setState']('accepted');}),this['listenTo'](_0x135385,'rejectSuggestion',()=>{const {replyId:_0x4cae3c,partIndex:_0x45cf52}=this['_currentPreviewedChangeGroup'];this['_rejectSuggestion']({'replyId':_0x4cae3c,'partIndex':_0x45cf52}),(this['_activeBalloon']??_0x135385)['setState']('rejected');}),this['listenTo'](_0x135385,'showNext',()=>{const {replyId:_0x5b257c,partIndex:_0x3adc22}=this['_currentPreviewedChangeGroup'],_0x98f8ff=this['_getPresentableSiblingContentPartIndex'](_0x5b257c,_0x3adc22,'next');null!==_0x98f8ff&&this['_openBalloonFor'](_0x5b257c,_0x98f8ff);}),this['listenTo'](_0x135385,'showPrevious',()=>{const {replyId:_0x3198fc,partIndex:_0x29bd5d}=this['_currentPreviewedChangeGroup'],_0x33ba0c=this['_getPresentableSiblingContentPartIndex'](_0x3198fc,_0x29bd5d,'previous');null!==_0x33ba0c&&this['_openBalloonFor'](_0x3198fc,_0x33ba0c);}),this['listenTo'](_0x135385,'dialogClosed',(_0x19f187,{id:_0xa41c84})=>{if('aiChatBalloon'!==_0xa41c84)return;const {replyId:_0x118aba,partIndex:_0x47e083}=this['_currentPreviewedChangeGroup'];this['_currentPreviewedChangeGroup']=null,this['_aiChatUi']['setFeedItemAIReplySuggestionPartActive']({'id':_0x118aba,'index':_0x47e083,'isActive':!0x1}),this['_activeBalloon']===_0x135385&&(this['_activeBalloon']=void 0x0);}));}['_integrateEditor'](_0x19fa05){if(this['_integrateEditorBalloon'](_0x19fa05),_0x19fa05['plugins']['has']('Undo')){const _0x512314=_0x19fa05['commands']['get']('undo'),_0x1d20b5=_0x19fa05['commands']['get']('redo');this['listenTo'](_0x512314,'revert',(_0x5cd6fa,_0x499b9b,_0xa84e28)=>{const _0x476c5a=this['_batchToChanges']['get'](_0x499b9b);if(!_0x476c5a)return;const _0x5476e7=this['activeConversation']['getInteraction'](_0x476c5a['interactionId']),_0x4d26c5=_0x5476e7?.['getReply'](_0x476c5a['replyId']);this['_batchToChanges']['delete'](_0x499b9b),_0x5476e7&&_0x4d26c5&&(_0x476c5a['indexes']['forEach'](_0x3e2b68=>_0x4d26c5['setChangeGroupState'](_0x3e2b68,'pending')),this['_batchToChanges']['set'](_0xa84e28,_0x476c5a));}),this['listenTo'](_0x1d20b5,'revert',(_0x281223,_0x14b333,_0x3a22a5)=>{const _0x1ae3d1=this['_batchToChanges']['get'](_0x14b333);if(!_0x1ae3d1)return;const _0xb15b15=this['activeConversation']['getInteraction'](_0x1ae3d1['interactionId']),_0x466c63=_0xb15b15?.['getReply'](_0x1ae3d1['replyId']);this['_batchToChanges']['delete'](_0x14b333),_0xb15b15&&_0x466c63&&(_0x1ae3d1['indexes']['forEach'](_0x291d63=>_0x466c63['setChangeGroupState'](_0x291d63,'accepted')),this['_batchToChanges']['set'](_0x3a22a5,_0x1ae3d1));});}const _0x5a25bb=_0x19fa05['config']['get']('ai.chat.context');_0x5a25bb['alwaysAddSelection']&&_0x5a25bb['document']['enabled']&&this['listenTo'](_0x19fa05['model']['document']['selection'],'change:range',(_0x38f2e2,_0x3f4504)=>{if(!_0x3f4504['directChange'])return;'chat'===_0x19fa05['plugins']['get']('AITabs')['view']['activeTab']&&(_0x19fa05['model']['hasContent'](_0x19fa05['model']['document']['selection'])?this['addSelectionToChatContext']():this['removeSelectionFromChatContext']());});}async['_getLastCreatedConversationId'](){const _0x33ffa8=this['_aiConnector']['fetchConversations'](this['getGroupId'](),{'limit':0x1,'sortBy':'createdAt'});try{const _0x32f6dd=await _0x33ffa8['getConversations']();return _0x32f6dd['length']?_0x32f6dd[0x0]['id']:'new';}catch(_0x55fe9b){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':_0x55fe9b})),this['_aiChatUi']['toggleLoadingSkeleton'](!0x1),this['_aiChatUi']['disableControls'](),null;}}async['_startConversationSafely'](_0x5b43a7={}){try{this['_aiChatUi']['enableControls'](),await this['_handleStartConversation'](_0x5b43a7);}catch(_0x339dcf){this['_aiChatUi']['addFeedItemError']({'errorMessage':hs(this['context']['locale'],'AI_CHAT_UNABLE_TO_START_CONVERSATION'),'id':_0x5b43a7['id']||ot()}),console['error'](_0x339dcf),this['activeConversation']=void 0x0,this['_aiChatUi']['disableControls']();}}async['_handleStartConversation']({id:_0x2a812e,modelId:_0x4301f0}={}){this['_activeBalloon']?.['close'](),this['_activeBalloon']=void 0x0,this['_currentPreviewedChangeGroup']=null;let _0x30d941=_0x4301f0;_0x30d941||(_0x2a812e||!this['activeConversation']?_0x30d941=this['context']['config']['get']('ai.models.defaultModelId'):this['_aiChatUi']['isModelAvailable']&&(_0x30d941=this['activeConversation']['selectedModel']['id'])),await this['_stopLastInteraction']();const _0x43cac7=this['getGroupId'](),_0x4f2e43=_0x2a812e||ot();let _0x228291;this['activeConversation']=new Gs({'connector':this['_aiConnector'],'chatModels':this['_aiChatModels'],'selectedModelId':_0x30d941,'conversationId':_0x4f2e43,'group':_0x43cac7,'getEditor':()=>$s(this['context']),'getEditors':()=>Ws(this['context']),'locale':this['context']['locale'],'isFromHistory':!!_0x2a812e}),this['activeConversation']['delegate']('toolDataReceived','interactionCreated','interactionStarted','replyCreated')['to'](this),this['activeConversation']['on']('conversationInitialized',(_0x2f0228,_0x50327f)=>{this['_aiChatUi']['createConversation'](_0x50327f),this['_aiChatUi']['resetMessageInput'](),this['_aiChatUi']['clearPendingContextUI'](),this['_aiChatUi']['clearConversationContextUI'](),_0x2a812e||(this['_aiChatUi']['resetConversationTitle'](),this['addCurrentDocumentToChatContext']());}),this['activeConversation']['on']('uploadProgressChanged',(_0x22570a,_0x4889eb)=>{this['_aiChatUi']['setIsUploadInProgress'](_0x4889eb['isUploadInProgress']);}),this['activeConversation']['on']('webSearchStarted',()=>{const _0x1e519b=this['_aiChatUi']['prepareLoadingMessage']({'isWebSearchEnabled':!0x0,'isReasoningEnabled':!0x1});this['_aiChatUi']['setLoadingMessage'](_0x1e519b);}),this['activeConversation']['on']('reasoningStarted',()=>{const _0x490ee3=this['_aiChatUi']['prepareLoadingMessage']({'isWebSearchEnabled':!0x1,'isReasoningEnabled':!0x0});this['_aiChatUi']['setLoadingMessage'](_0x490ee3);}),this['activeConversation']['on']('webSearchFinished',(_0x3ac8a7,_0x230f64)=>{this['_aiChatUi']['addFeedInteractionHeader'](_0x230f64,{'isWebSearchEnabled':!0x0,'isReasoningEnabled':!0x1});}),this['activeConversation']['on']('reasoningFinished',(_0x247585,_0x1cc1bb)=>{this['_aiChatUi']['addFeedInteractionHeader'](_0x1cc1bb,{'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',(_0x37ff1c,_0x2cc7e9)=>{this['_aiChatUi']['removeFeedInteraction'](_0x2cc7e9['id']);}),this['activeConversation']['on']('setConversationTitle',(_0x2ac04c,_0x24b81d,_0x2020c)=>{this['_updateConversationTitle'](_0x24b81d,_0x2020c);}),this['activeConversation']['on']('replyContentUpdated',async(_0x337ca1,_0x51018a)=>{void 0x0!==_0x228291&&_0x228291!==_0x51018a['id']&&this['_updateReplyContentThrottled']['flush'](),_0x228291=_0x51018a['id'],await this['_updateReplyContentThrottled']({'reply':_0x51018a});}),this['activeConversation']['on']('replyChangeGroupStateUpdated',(_0x15b3ff,{reply:_0x2ae444,index:_0x3b30d1,state:_0x5e0ed7})=>{this['_aiChatUi']['updateFeedItemAIReplySuggestionPartState']({'id':_0x2ae444['id'],'index':_0x3b30d1,'state':_0x5e0ed7}),this['_currentPreviewedChangeGroup']?.['replyId']['includes'](_0x2ae444['id'])&&this['_currentPreviewedChangeGroup']?.['partIndex']==_0x3b30d1&&(this['_activeBalloon']??this['_aiChatBalloon'])?.['setState'](_0x5e0ed7);}),this['activeConversation']['on']('contextItemAdded',(_0x5b7e79,_0x2e535c)=>{if(this['_aiChatUi']['addContextItem'](_0x2e535c['contextItem'],_0x2e535c['isLoading']),'selection'===_0x2e535c['contextItem']['type']){const _0x491b12=[...$s(this['context'])['model']['document']['selection']['getRanges']()];this['_aiEditing']['showFakeVisualSelection']({'ranges':_0x491b12,'id':'context','priority':0x1});}}),this['activeConversation']['on']('contextItemRemoved',(_0x24b762,_0xfcd8c4)=>{this['_aiChatUi']['removeContextItem'](_0xfcd8c4['uiId']),'current-document'==_0xfcd8c4['uiId']&&this['removeSelectionFromChatContext'](),'selection'===_0xfcd8c4['type']&&this['_aiEditing']['hideFakeVisualSelection']('context');}),this['activeConversation']['on']('contextItemLoadingEnded',(_0x3fcc4c,_0x6d72c1)=>{this['_aiChatUi']['setContextItemLoading'](_0x6d72c1['contextItem']['uiId'],_0x6d72c1['isLoading']);}),this['activeConversation']['on']('contextSent',(_0x57d2b1,_0x3013ab)=>{this['_aiChatUi']['setConversationContext'](_0x3013ab['contextItems']);}),this['activeConversation']['on']('addContextOptionsChanged',(_0x27b280,_0x3c772f)=>{this['_aiChatUi']['setAddContextOptions'](_0x3c772f['options']);}),this['activeConversation']['on']('sourceResourcesLoaded',(_0x109d71,_0x515b2d)=>{this['_aiChatUi']['populateSourceResourceBalloon'](_0x515b2d['sourceId'],_0x515b2d['source'],_0x515b2d['resources'],_0x515b2d['uid']);}),this['activeConversation']['on']('resourceStateChanged',(_0x467a55,_0x3729a4)=>{this['_aiChatUi']['updateResourceState'](_0x3729a4['sourceId'],_0x3729a4['resourceId'],_0x3729a4['isInContext']);}),this['activeConversation']['on']('capabilitiesUpdated',(_0x38de29,_0x459057)=>{this['_aiChatUi']['updateCapabilities'](_0x459057);}),this['activeConversation']['on']('modelSelected',async(_0x97823a,_0x24b0af)=>{const _0x3704e7=(await this['_aiChatModels']['getAll']())['find'](_0x497487=>_0x497487['id']===_0x24b0af['selectedModel']?.['id'])||null;this['_aiChatUi']['setSelectedModel'](_0x3704e7,_0x24b0af['isDisabled']);}),this['activeConversation']['on']('error',(_0x3823c4,{error:_0x109356,interactionId:_0x3c325f,fileName:_0x2b5fa2,url:_0x1df2ae,sourceId:_0x23c3a5,sourceLabel:_0x14de44})=>{const _0x3fc576=_0x3c325f?_0x3c325f+':'+ot():ot();_0x109356['message']['startsWith']('ai-request-aborted')?this['_aiChatUi']['addFeedItemStaticMessage']({'staticMessage':hs(this['context']['locale'],'AI_CHAT_ABORTED_MESSAGE'),'id':_0x3fc576}):_0x109356['message']['startsWith']('ai-chat-conversation-init-failed')||_0x109356['message']['startsWith']('ai-chat-conversation-start-failed')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':hs(this['context']['locale'],'AI_CHAT_UNABLE_TO_START_CONVERSATION'),'id':_0x3fc576}),this['_logError'](_0x109356)):_0x109356['message']['startsWith']('ai-chat-file-upload-failed')?this['_aiChatUi']['addFeedItemError']({'errorMessage':hs(this['context']['locale'],'AI_CHAT_CONTEXT_UNABLE_TO_UPLOAD_FILE',_0x2b5fa2),'id':_0x3fc576}):_0x109356['message']['startsWith']('ai-chat-url-upload-failed')?this['_aiChatUi']['addFeedItemError']({'errorMessage':hs(this['context']['locale'],'AI_CHAT_CONTEXT_UNABLE_TO_UPLOAD_URL',_0x1df2ae),'id':_0x3fc576}):_0x109356['message']['startsWith']('ai-chat-context-invalid-data')?this['_aiChatUi']['addFeedItemError']({'errorMessage':hs(this['context']['locale'],'AI_CHAT_CONTEXT_INVALID_DATA'),'id':_0x3fc576}):_0x109356['message']['startsWith']('ai-chat-context-unsupported-type')?this['_aiChatUi']['addFeedItemError']({'errorMessage':hs(this['context']['locale'],'AI_CHAT_CONTEXT_UNSUPPORTED_TYPE'),'id':_0x3fc576}):_0x109356['message']['startsWith']('ai-chat-source-resources-load-failed')?(_0x23c3a5&&this['_aiChatUi']['closeSourceResourceBalloon'](_0x23c3a5),this['_aiChatUi']['addFeedItemError']({'errorMessage':hs(this['context']['locale'],'AI_CHAT_CONTEXT_UNABLE_TO_LOAD_RESOURCES',_0x14de44||'source'),'id':_0x3fc576}),this['_logError'](_0x109356)):_0x109356['message']['startsWith']('ai-chat-resource-load-failed')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':hs(this['context']['locale'],'AI_CHAT_RESOURCE_LOAD_FAILED'),'id':_0x3fc576}),this['_logError'](_0x109356)):_0x109356['message']['startsWith']('ai-chat-invalid-request')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':hs(this['context']['locale'],'AI_CHAT_INVALID_REQUEST'),'id':_0x3fc576}),this['_logError'](_0x109356)):_0x109356['message']['startsWith']('ai-chat-context-unsupported-file-type')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':hs(this['context']['locale'],'AI_CHAT_CONTEXT_UNSUPPORTED_FILE_TYPE'),'id':_0x3fc576}),this['_logError'](_0x109356)):_0x109356['message']['startsWith']('ai-chat-context-file-too-large')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':hs(this['context']['locale'],'AI_CHAT_CONTEXT_FILE_TOO_LARGE'),'id':_0x3fc576}),this['_logError'](_0x109356)):_0x109356['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':_0x3fc576}),this['_logError'](_0x109356)):_0x109356['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':_0x3fc576}),this['_logError'](_0x109356)):(this['_aiChatUi']['addFeedItemError']({'errorMessage':hs(this['context']['locale'],'AI_CHAT_GENERIC_ERROR'),'id':_0x3fc576}),this['_logError'](_0x109356));}),await this['activeConversation']['init'](this['context']['config']['get']('ai.chat.context')),_0x2a812e||await this['activeConversation']['start']();}async['_handleUIUserMessage']({message:_0x4f0866,attributes:_0xa47d15}){if(!this['activeConversation'])throw new at('ai-chat-controller-no-active-conversation');if(this['activeConversation']['isCurrentDocumentInContext']()){const _0x2fd453=await this['_aiEditing']['getDocumentData']();_0x2fd453['length']>0x1?await this['activeConversation']['updateDocumentsInContext'](_0x2fd453):await this['activeConversation']['updateCurrentDocumentInContext'](_0x2fd453[0x0]);}this['activeConversation']['id']&&this['activeConversation']['isStarted']&&await this['activeConversation']['handleUserInteraction']({'userMessage':_0x4f0866,'attributes':_0xa47d15});}['_logError'](_0x45c254){Et(_0x45c254['message']);}['_removeFromContext'](_0x3fec0b){this['activeConversation']?.['removeFromContext'](_0x3fec0b);}['_toggleWebSearch'](){this['activeConversation']?.['toggleWebSearch']();}['_toggleReasoning'](){this['activeConversation']?.['toggleReasoning']();}['getInteractionAndReplyById'](_0x43b246){const [_0x327901,_0x441bad]=_0x43b246['split'](':'),_0x2ee50c=this['activeConversation']['getInteraction'](_0x327901),_0x7ec487=_0x2ee50c['getReply'](_0x441bad);return{'interaction':_0x2ee50c,'reply':_0x7ec487};}['_resolveGroupTarget'](_0x2e0397,_0x5236a0){const _0x145b37=[..._0x5236a0['changes']['filter'](_0x2ad787=>'context'!==_0x2ad787['type']),..._0x5236a0['changes']['filter'](_0x32365=>'context'===_0x32365['type'])];for(const _0x2cef4d of _0x145b37){const _0x515c34=_0x2e0397['newNodeAnchorIds']['get'](_0x2cef4d['id']),_0x461bf0=this['activeConversation']?.['getSourceByDataId'](_0x2cef4d['id'])||this['activeConversation']?.['getSourceByDataId'](_0x515c34)||this['activeConversation']?.['getSourceByDataId'](_0x2cef4d['anchorId']??void 0x0);if(_0x461bf0){if('destroyed'===_0x461bf0['editor']['state'])return null;const _0x3042b8=_0x461bf0['editor']['model']['document']['getRoot'](_0x461bf0['rootName']);return _0x3042b8?{'editor':_0x461bf0['editor'],'root':_0x3042b8,'parsedDocumentContent':_s(_0x461bf0['content']),'serializedDocumentContent':_0x461bf0['content'],'version':_0x461bf0['version']}:null;}}const _0x42ac5e=$s(this['context']),_0x6cb426=this['activeConversation']['getInteraction'](_0x2e0397['interactionId']),_0xc203b5=_0x6cb426?.['getDocumentContext']();return{'editor':_0x42ac5e,'root':_0x42ac5e['model']['document']['getRoot'](),'parsedDocumentContent':_0x2e0397['documentContextContent'],'serializedDocumentContent':_0xc203b5?.['content'],'version':_0xc203b5?.['version']};}['_groupChangesByTarget'](_0xe8e098,_0x3805b6){const _0xb59435=new Map();for(const _0x408e24 of _0x3805b6){const _0x3cdb03=this['_resolveGroupTarget'](_0xe8e098,_0x408e24);if(!_0x3cdb03)continue;const _0x114f0c=(_0x3cdb03['editor']['id']||'e')+'|'+_0x3cdb03['root']['rootName'];let _0x33d498=_0xb59435['get'](_0x114f0c);if(!_0x33d498){let _0x3d0f69;for(const _0x3e06a3 of[..._0x408e24['changes']['filter'](_0x2d7069=>'context'!==_0x2d7069['type']),..._0x408e24['changes']['filter'](_0x193482=>'context'===_0x193482['type'])])if(_0x3d0f69=this['activeConversation']?.['getDocumentContextSliceByDataId'](_0x3e06a3['id'])||this['activeConversation']?.['getDocumentContextSliceByDataId'](_0xe8e098['newNodeAnchorIds']['get'](_0x3e06a3['id'])),_0x3d0f69)break;_0x33d498={'target':{'editor':_0x3cdb03['editor'],'root':_0x3cdb03['root']},'slice':_0x3d0f69,'groups':[],'groupsIndexes':[]},_0xb59435['set'](_0x114f0c,_0x33d498);}_0x33d498['groups']['push'](_0x408e24),_0x33d498['groupsIndexes']['push'](_0xe8e098['changeGroups']['indexOf'](_0x408e24));}return Array['from'](_0xb59435['values']());}['_scrollToSuggestionRange'](_0x27665e,_0x1fc400=!0x1,_0x16b9fb){_0x16b9fb??=$s(this['context']);const _0x3b67ba={'target':_0x16b9fb['editing']['view']['domConverter']['viewRangeToDom'](_0x16b9fb['editing']['mapper']['toViewRange'](_0x27665e)),'viewportOffset':{'top':0x96,'left':0x0,'bottom':0x32,'right':0x0},'ancestorOffset':0x14,'alignToTop':_0x1fc400};_0x1fc400&&(_0x3b67ba['alignToTop']=!0x0),Ct(_0x3b67ba);}['_updateConversationTitle'](_0x3c71fb,_0x5ef6d6=!0x1){this['_aiChatUi']['setConversationTitle'](_0x3c71fb||hs(this['context']['locale'],'AI_CHAT_UNTITLED_CONVERSATION'),_0x5ef6d6);}['_addFeedItemReply'](_0x33290b){'text'===_0x33290b['type']?this['_aiChatUi']['addFeedItemAIReply'](_0x33290b):this['_aiChatUi']['addFeedItemAISuggestion'](_0x33290b);}async['_updateReplyContent']({reply:_0x3d890a,renderingStrategy:_0x299579}){const {id:_0x24179c,interactionId:_0x158f98,isDone:_0x7d6378,type:_0x2f5d4a,parsedContent:_0x256449}=_0x3d890a,_0xd5b741=_0x158f98+':'+_0x24179c;if('modification'===_0x2f5d4a){const _0x2932dc=_0x3d890a['getContentParts']({'showDiff':this['_aiChatUi']['showDiff'],'editor':$s(this['context'])});await this['_aiChatUi']['updateFeedItemAIReplySuggestionContent']({'id':_0xd5b741,'parts':_0x2932dc,'isDone':_0x7d6378,'skipLoadingEffects':_0x3d890a['isFromHistory']});}else'text'===_0x2f5d4a&&await this['_aiChatUi']['updateFeedItemAIReplyContent']({'id':_0xd5b741,'parsedContent':_0x256449,'renderingStrategy':_0x299579,'isDone':_0x7d6378});_0x7d6378&&_0x3d890a['sources']['length']>0x0&&this['_aiChatUi']['updateFeedItemAIReplySources'](_0xd5b741,_0x3d890a['sources']);}['_updateReplyContentThrottled']=_0x22e74a(this['_updateReplyContent']['bind'](this),0xc8);async['_stopLastInteraction'](){const _0x28aae9=this['activeConversation']?.['lastInteraction'];_0x28aae9&&(_0x28aae9['stop'](),this['_aiChatUi']['stopInteraction'](_0x28aae9)),this['_updateReplyContentThrottled']['cancel']();}async['_flushLastInteractionUI'](){const _0x38a081=this['activeConversation']?.['lastInteraction'];if(_0x38a081){for await(const _0x1e6604 of _0x38a081['replies'])this['_aiChatUi']['hasFeedItem'](_0x1e6604['id'])||this['_addFeedItemReply'](_0x1e6604),await this['_updateReplyContent']({'reply':_0x1e6604,'renderingStrategy':'static'});}}['_updateRatings'](_0x42f426){const _0x5aede7={'positiveCount':_0x42f426['changeGroups']['filter'](_0x433dc7=>'accepted'===_0x433dc7['state'])['length'],'totalCount':_0x42f426['changeGroups']['length'],'modificationId':_0x42f426['id']},_0x3fd522=this['activeConversation']['getInteraction'](_0x42f426['interactionId'])['messageId'];_0x3fd522&&this['_aiConnector']['upsertAIChatRating'](this['activeConversation']['id'],_0x3fd522,_0x5aede7);}['_getAIChatFeedAPI'](_0x54d304){const _0x5f204e=this['_aiChatUi'],_0x50f6bf=()=>{_0x54d304['resetWebSearchState'](),_0x54d304['resetReasoningState'](),_0x5f204e['clearLoadingMessage']();},_0x3f77ed=()=>{_0x54d304['currentReply']&&(_0x54d304['currentReply']['done'](),_0x54d304['currentReply']=void 0x0);};return{'insertTextReply':(_0x45c134,_0x4f5fb8)=>{_0x3f77ed(),_0x50f6bf();const _0x2bb8af=_0x54d304['currentReply']=_0x54d304['createReply']({'type':'text','interactionId':_0x54d304['id'],'content':_0x45c134,'id':_0x4f5fb8||ot()});return _0x3f77ed(),_0x2bb8af;},'insertCustomElement':async(_0x350bd5,_0x328793)=>(_0x3f77ed(),_0x50f6bf(),_0x5f204e['addFeedItemCustomElement'](_0x350bd5,_0x328793||ot())),'setLoadingMessage':_0x1f592a=>{_0x5f204e['setLoadingMessage'](_0x1f592a);},'clearLoadingMessage':()=>{_0x5f204e['clearLoadingMessage']();}};}}const zs='ai-selection',js=['br'];class Js extends _0x1c4dd1{constructor(_0x101d82){super(_0x101d82),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 _0x34b368=Ws(this['context']),_0x4d501a=_0x34b368['find'](_0x330029=>_0x330029['plugins']['has']('RealTimeCollaborationClient'))||_0x34b368[0x0],_0x4a9f42=_0x4d501a['plugins']['has']('RealTimeCollaborationClient')&&_0x4d501a['plugins']['get']('RealTimeCollaborationClient')['sessionId'];this['_sessionId']=_0x4a9f42||ot();}return this['_sessionId'];}async['getDocumentData'](){const _0x171e14=Ws(this['context']);if(!_0x171e14['length'])throw new at('ai-get-editor-from-context-no-editor');const _0x502f5e=[],_0x1c7149=new Set();for(const _0x5da7f1 of _0x171e14){const _0x286270=_0x5da7f1['config']['get']('roots')||{};for(const _0xb860bf of _0x5da7f1['model']['document']['getRoots']()){if('$graveyard'===_0xb860bf['rootName'])continue;const _0x1f860f=await this['_getDocumentDataForEditorRoot'](_0x5da7f1,_0xb860bf,_0x1c7149),_0x14ee9c=_0x286270[_0xb860bf['rootName']];_0x502f5e['push']({'editor':_0x5da7f1,'rootName':_0xb860bf['rootName'],'content':_0x1f860f['content'],'version':_0x1f860f['version'],'sessionId':this['sessionId'],'selections':_0x1f860f['selections'],'name':_0xb860bf['rootName'],'description':_0x14ee9c?.['description']});}}return _0x502f5e;}async['_getDocumentDataForEditorRoot'](_0x344135,_0x25f0aa,_0x344776){const _0x1ddaa3=_0x344135['data']['toView'](_0x25f0aa,{'convertAiChatSelectionMarker':!0x0}),_0x4402b1=new _0x8976b4(_0x344135['editing']['view']['document']);this['_setDataIdsOnChildren'](_0x1ddaa3,_0x4402b1,_0x344776),this['_persistExportedDataIdsToLiveModel'](_0x344135,_0x1ddaa3);let _0x3e4daa=await this['_getDocumentDataStringFromView'](_0x1ddaa3,_0x344135);const _0x27c2b2=this['_getMarkersInDocumentOrder'](_0x344135,_0x25f0aa),_0x1e4e31=[];for(const _0x5b9689 of _0x27c2b2){const _0x13842e='<'+_0x5b9689['name']+':start></'+_0x5b9689['name']+':start>',_0x79af45=_0x3e4daa['indexOf'](_0x13842e);_0x3e4daa=_0x3e4daa['substring'](0x0,_0x79af45)+_0x3e4daa['substring'](_0x79af45+_0x13842e['length']);const _0x10744f='<'+_0x5b9689['name']+':end></'+_0x5b9689['name']+':end>',_0x28edea=_0x3e4daa['indexOf'](_0x10744f);_0x3e4daa=_0x3e4daa['substring'](0x0,_0x28edea)+_0x3e4daa['substring'](_0x28edea+_0x10744f['length']),_0x1e4e31['push']({'markerName':_0x5b9689['name'],'start':_0x79af45,'end':_0x28edea,'htmlFragment':_0x3e4daa['substring'](_0x79af45,_0x28edea)});}return{'content':_0x3e4daa,'version':_0x344135['model']['document']['version'],'selections':_0x1e4e31};}async['afterInit'](){this['context']instanceof _0x123c85?this['_integrateEditor'](this['context']):this['listenTo'](this['context']['editors'],'add',(_0x988292,_0x290556)=>{_0x290556['on']('ready',()=>{this['_integrateEditor'](_0x290556);});});}['_setOutputDataProcessor'](_0x19d3e2){this['_outputDataProcessor']=_0x19d3e2;}async['_getDocumentDataStringFromView'](_0x3a5109,_0x249e74){let _0x248841;if(this['_outputDataProcessor']){const _0x5fd666=_0x249e74['data']['processor']['domConverter']['viewToDom'](_0x3a5109),_0x553c4c=await this['_outputDataProcessor'](_0x5fd666);_0x248841=_0x249e74['data']['processor']['htmlWriter']['getHtml'](_0x553c4c);}else _0x248841=_0x249e74['data']['processor']['toData'](_0x3a5109);return _0x248841;}['_integrateEditor'](_0x493741){_0x493741['ui']['focusTracker']['on']('change:isFocused',(_0x1575a9,_0x48b911,_0x382a85)=>{_0x382a85&&(this['_lastContentFocusedEditor']=_0x493741);}),_0x493741['on']('destroy',()=>{this['_lastContentFocusedEditor']===_0x493741&&(this['_lastContentFocusedEditor']=void 0x0);}),_0x493741['conversion']['for']('editingDowncast')['markerToHighlight']({'model':zs,'view':({markerName:_0x4e03c7})=>({'classes':['ck-ai-assistant-ui_theme','ck-fake-ai-selection','ck-fake-ai-selection-'+_0x4e03c7['split'](':')[0x1]],'priority':0xc})}),_0x493741['conversion']['for']('dataDowncast')['markerToElement']({'model':zs+':context','view':(_0x315abd,{writer:_0x6ec067,options:_0x3251cb})=>_0x3251cb['convertAiChatSelectionMarker']?_0x6ec067['createUIElement'](_0x315abd['markerName']+':'+(_0x315abd['isOpening']?'start':'end')):null});}['showFakeVisualSelection'](_0x492c65){const _0x4f3b9d=this['_fakeSelections'][0x0]||null;this['_addFakeSelection'](_0x492c65);const _0xff237c=this['_fakeSelections'][0x0]||null;this['_refreshFakeSelection'](_0x4f3b9d,_0xff237c);}['hideFakeVisualSelection'](_0x4db747){const _0x64ed6a=this['_fakeSelections'][0x0]||null;this['_removeFakeSelectionById'](_0x4db747);const _0x43f361=this['_fakeSelections'][0x0]||null;this['_refreshFakeSelection'](_0x64ed6a,_0x43f361);}async['modelToDataWithIds'](_0x856bd7){const _0x575cd7=$s(this['context']),_0x264f45=_0x575cd7['data']['toView'](_0x856bd7),_0x220418=new _0x8976b4(_0x575cd7['editing']['view']['document']);return this['_setDataIdsOnChildren'](_0x264f45,_0x220418),this['_getDocumentDataStringFromView'](_0x264f45,_0x575cd7);}['_setDataIdsOnChildren'](_0xa3e457,_0x28aabd,_0xb5356c=new Set()){let _0x44006d=!0x1;for(const _0x5e4412 of _0xa3e457['getChildren']()){if(!_0x5e4412['is']('view:element')||js['includes'](_0x5e4412['name']))continue;const _0x1b3841=_0x5e4412['is']('view:containerElement'),_0x372293=_0x5e4412['is']('view:emptyElement'),_0x201f91=this['_setDataIdsOnChildren'](_0x5e4412,_0x28aabd,_0xb5356c);if(_0x5e4412['hasAttribute']('data-id')){_0x44006d=!0x0,_0xb5356c['add'](_0x5e4412['getAttribute']('data-id'));continue;}(_0x1b3841||_0x372293||_0x201f91)&&(_0x28aabd['setAttribute']('data-id',this['_nextDataId'](_0xb5356c),_0x5e4412),_0x44006d=!0x0);}return _0x44006d;}['_persistExportedDataIdsToLiveModel'](_0x14c9ff,_0x1e9985){const _0x4e253e=_0x14c9ff['data']['mapper'];_0x14c9ff['model']['change'](_0x2e98d7=>{this['_persistExportedDataIdsToLiveModelRecursive'](_0x4e253e,_0x2e98d7,_0x1e9985);});}['_persistExportedDataIdsToLiveModelRecursive'](_0x29f1cc,_0x56348c,_0x5aa62d){for(const _0x346a83 of _0x5aa62d['getChildren']())if(_0x346a83['is']('view:element')){if(_0x346a83['hasAttribute']('data-id')){const _0x2cf4ba=_0x29f1cc['toModelElement'](_0x346a83);_0x2cf4ba&&_0x2cf4ba['is']('element')&&_0x56348c['setAttribute'](_0xf976ed,_0x346a83['getAttribute']('data-id'),_0x2cf4ba);}this['_persistExportedDataIdsToLiveModelRecursive'](_0x29f1cc,_0x56348c,_0x346a83);}}['_nextDataId'](_0x2ebb97){let _0x4d0ade;do{_0x4d0ade='';for(let _0x327dea=0x0;_0x327dea<0x4;_0x327dea++)_0x4d0ade+=String['fromCharCode'](0x61+Math['floor'](0x1a*Math['random']()));}while(_0x2ebb97['has'](_0x4d0ade));return _0x2ebb97['add'](_0x4d0ade),_0x4d0ade;}['getSelectionText'](){const {model:_0x5ce481}=$s(this['context']),_0x24e4d4=_0x5ce481['document']['selection'],_0x41c4d9=[],_0x227030=Array['from'](_0x24e4d4['getRanges']());_0x227030['sort']((_0x50b4c3,_0x5aafc5)=>_0x50b4c3['start']['isBefore'](_0x5aafc5['start'])?-0x1:0x1);for(const _0x46b4a2 of _0x227030)for(const _0x52d6aa of _0x46b4a2['getItems']())_0x52d6aa['is']('$textProxy')?_0x41c4d9['push'](_0x52d6aa['data']):_0x52d6aa['is']('element')&&_0x41c4d9['length']>0x0&&'\x20'!==_0x41c4d9[_0x41c4d9['length']-0x1]&&_0x41c4d9['push']('\x20');return _0x41c4d9['length']?'\x22'+_0x41c4d9['join']('')['trim']()+'\x22':hs(this['context']['locale'],'AI_CHAT_CONTEXT_DOCUMENT_SELECTION_LABEL');}['_removeFakeSelectionById'](_0x146794){for(let _0x188d6e=0x0;_0x188d6e<this['_fakeSelections']['length'];_0x188d6e++)if(this['_fakeSelections'][_0x188d6e]['id']==_0x146794)return void this['_fakeSelections']['splice'](_0x188d6e,0x1);}['_addFakeSelection'](_0x6d7f6e){this['_removeFakeSelectionById'](_0x6d7f6e['id']),wt(this['_fakeSelections'],_0x6d7f6e);}['_refreshFakeSelection'](_0x29afaf,_0x1c64a9){if(_0x29afaf==_0x1c64a9)return;const _0x4d8b82=_0x29afaf?this['_getEditorForFakeSelection'](_0x29afaf):null,_0x8a6b33=_0x1c64a9?this['_getEditorForFakeSelection'](_0x1c64a9):null,_0xce1bf2=(_0x2aab2a,_0x243f70)=>{const _0x32f3b0=_0x243f70['model']['markers']['getMarkersGroup'](zs);for(const _0x2b6b76 of _0x32f3b0)_0x2aab2a['removeMarker'](_0x2b6b76);},_0x12130d=(_0x286fe8,_0x131927,_0x1f3ed1)=>{const _0x41155b=_0x131927['model'];for(let _0x1d98a0=0x0;_0x1d98a0<_0x1f3ed1['ranges']['length'];_0x1d98a0++){let _0x25decb=_0x1f3ed1['ranges'][_0x1d98a0];const _0x46df52=zs+':'+_0x1f3ed1['id']+':'+_0x1d98a0;if(_0x25decb['start']['isAtEnd']){const _0x230612=_0x25decb['start']['getLastMatchingPosition'](({item:_0x2acd4b})=>!_0x41155b['schema']['isContent'](_0x2acd4b),{'boundaries':_0x25decb});_0x25decb=_0x286fe8['createRange'](_0x230612,_0x25decb['end']);}_0x286fe8['addMarker'](_0x46df52,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x25decb});}};_0x4d8b82&&_0x8a6b33&&_0x4d8b82===_0x8a6b33&&_0x1c64a9?_0x4d8b82['model']['change'](_0x773fc6=>{_0xce1bf2(_0x773fc6,_0x4d8b82),_0x12130d(_0x773fc6,_0x8a6b33,_0x1c64a9);}):(_0x4d8b82&&_0x4d8b82['model']['change'](_0x1e5888=>_0xce1bf2(_0x1e5888,_0x4d8b82)),_0x8a6b33&&_0x1c64a9&&_0x8a6b33['model']['change'](_0x552b9f=>_0x12130d(_0x552b9f,_0x8a6b33,_0x1c64a9)));}['_getEditorForFakeSelection'](_0x342518){if(!_0x342518['ranges']['length'])return $s(this['context']);const _0x178ba0=_0x342518['ranges'][0x0]['root']['document'];return Ws(this['context'])['find'](_0x4c8cdf=>_0x4c8cdf['model']['document']===_0x178ba0)??$s(this['context']);}['_getMarkersInDocumentOrder'](_0x3e2773,_0x5d270b){const _0x2b2841=Array['from'](_0x3e2773['model']['markers']['getMarkersGroup'](zs+':context'));return(_0x5d270b?_0x2b2841['filter'](_0x319373=>{const _0x5a5268=_0x319373['getRange']();return _0x5a5268&&_0x5a5268['root']['rootName']===_0x5d270b['rootName'];}):_0x2b2841)['sort']((_0x484eab,_0x2d9b74)=>_0x484eab['getStart']()['isBefore'](_0x2d9b74['getStart']())?-0x1:_0x484eab['getStart']()['isAfter'](_0x2d9b74['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(_0x14c758){const _0x113f43=new AbortController();return{'promise':new Promise((_0x2f190f,_0x40c045)=>{const _0xb64508=setTimeout(_0x2f190f,_0x14c758);_0x113f43['signal']['addEventListener']('abort',()=>{clearTimeout(_0xb64508),_0x40c045();});}),'abortController':_0x113f43};}class sn{['options'];['isStreaming']=!0x1;['document']=null;['nodesList']=[];['currentIndex']=0x0;['timeoutAbortController']=null;['lastUpdateTime']=0x0;constructor(_0x264aec){this['options']={'delay':_0x264aec?.['delay']??0xa,'textNodeStyle':_0x264aec?.['textNodeStyle']??'animation:\x20ck-html-streamer-fade-in\x20.3s'};}async['stream']({document:_0x5bbe04,targetElement:_0x32b928,abortSignal:_0x2642ba}){this['isStreaming']&&this['stop'](),_0x2642ba?.['addEventListener']('abort',this['stop']['bind'](this)),this['document']=_0x3eb68e(_0x5bbe04,!0x0),this['nodesList']=this['getParsedDocumentNodeList'](),this['isStreaming']=!0x0,this['currentIndex']>this['nodesList']['length']&&(this['currentIndex']=this['nodesList']['length']);for(let _0x3e863a=0x0;_0x3e863a<this['currentIndex'];_0x3e863a++)this['nodesList'][_0x3e863a]['shouldBeStreamed']=!0x0;do{const _0x1b75da=Date['now'](),_0x507ebf=this['nodesList'][this['currentIndex']],_0x1a40c4=_0x1b75da-this['lastUpdateTime'];if(_0x507ebf){_0x507ebf['shouldBeStreamed']=!0x0;let _0x1b3c96=_0x507ebf['parent'];for(;_0x1b3c96;)_0x1b3c96['shouldBeStreamed']=!0x0,_0x1b3c96=_0x1b3c96['parent'];}if(_0x1a40c4<this['options']['delay'])try{const {promise:_0x4510b8,abortController:_0x257c3e}=en(this['options']['delay']-_0x1a40c4);this['timeoutAbortController']=_0x257c3e,await _0x4510b8;}catch(_0x5b2cfe){return;}_0x1f1589(_0x32b928,'<'+_0x32b928['tagName']+'>'+this['renderNode'](this['document'])+'</'+_0x32b928['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:_0xf93bba}){Array['from'](_0xf93bba['querySelectorAll']('span[data-ck-html-streamer-word-chunk]'))['reverse']()['forEach'](_0x4ae0c9=>{_0x4ae0c9['replaceWith'](_0x4ae0c9['childNodes'][0x0]);});}['stop'](){this['isStreaming']=!0x1,this['timeoutAbortController']&&(this['timeoutAbortController']['abort'](),this['timeoutAbortController']=null);}['renderNode'](_0x3e9c95){let _0x332737='';if(function(_0x2e4714){return _0x10a496(_0x2e4714);}(_0x3e9c95)){for(const _0x268d5f of _0x3e9c95['children'])_0x332737+=this['renderNode'](_0x268d5f);}else{if(on(_0x3e9c95)){if(!_0x3e9c95['shouldBeStreamed'])return'';const _0xabf9b3=_0x3e9c95,_0x2e7cb6=Object['entries'](_0xabf9b3['attribs'])['map'](([_0x4ef0b0,_0x3d80bc])=>_0x4ef0b0+'=\x22'+_0x3d80bc+'\x22')['join']('\x20');_0x332737+='<'+_0xabf9b3['tagName']+(_0x2e7cb6?'\x20'+_0x2e7cb6:'')+'>';for(const _0x135772 of _0x387748(_0xabf9b3))_0x332737+=this['renderNode'](_0x135772);_0x332737+='</'+_0xabf9b3['tagName']+'>';}else{if(!rn(_0x3e9c95))return'';if(!_0x3e9c95['shouldBeStreamed'])return'';!function(_0x36a5db){if(!_0x36a5db['parent']||!on(_0x36a5db['parent']))return!0x1;if(!nn['includes'](_0x36a5db['parent']['tagName']))return!0x1;return!_0x1ab110(_0x36a5db)['match'](/^\s*[<>]\s*$/);}(_0x3e9c95)?_0x332737+=ti(_0x3e9c95):_0x332737+=ti(new _0x6c2914('span',{'data-ck-html-streamer-word-chunk':'','style':this['options']['textNodeStyle']},[_0x3e9c95]));}}return _0x332737;}['getParsedDocumentNodeList'](){const _0xfa1c48=[];return function(_0x41487e,_0x299f47){const _0x183322=_0x384dfe=>{if(_0x299f47(_0x384dfe),_0x384dfe instanceof _0x2078d3)for(let _0x249a5a=0x0;_0x249a5a<_0x384dfe['children']['length'];_0x249a5a++){const _0x29b704=_0x384dfe['children'][_0x249a5a];_0x183322(_0x29b704);}};for(let _0x46f77e=0x0;_0x46f77e<_0x41487e['children']['length'];_0x46f77e++)_0x183322(_0x41487e['children'][_0x46f77e]);}(this['document'],_0x47ea2c=>{if(rn(_0x47ea2c)){const _0x390fa8=this['splitTextNodeIntoWordNodes'](_0x47ea2c);_0x390fa8['length']&&_0xfa1c48['push'](..._0x390fa8);}_0x47ea2c['isWordSplitSource']||_0x47ea2c['isWordSplitResult']||_0xfa1c48['push'](_0x47ea2c);}),_0xfa1c48;}['splitTextNodeIntoWordNodes'](_0x4a7e61){if(_0x4a7e61['isWordSplitSource']||_0x4a7e61['isWordSplitResult'])return[];const _0x386241=_0x1ab110(_0x4a7e61)['match'](/(?:\s*\S+\s*)/g),_0x373539=[];if(_0x386241&&_0x386241['length']>0x1){for(const _0x22b83b of _0x386241){const _0xa35c3c=new _0x557dcc(_0x22b83b);_0xa35c3c['isWordSplitResult']=!0x0,_0x50c4bc(_0x4a7e61,_0xa35c3c),_0x373539['push'](_0xa35c3c);}_0x4a7e61['isWordSplitSource']=!0x0,_0x1085d4(_0x4a7e61);}return _0x373539;}}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(_0x597d6e){return _0x551b28(_0x597d6e);}function on(_0x58cd6c){return _0x57c018(_0x58cd6c);}class an extends vt{['options'];['content']='';['htmlStreamer'];['children'];constructor(_0x32cb82){super();const _0x25d489=this['bindTemplate'];this['set']('isDone',!0x1),this['set']('isVisible',!0x0),this['htmlStreamer']=new sn(),this['options']=_0x32cb82,this['children']=this['createCollection'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed__item',_0x25d489['if']('isDone','ck-ai-chat__feed__item_done'),_0x25d489['if']('isVisible','ck-hidden',_0x428455=>!_0x428455),'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'](_0x7f2cf1=>{_0x7f2cf1['removeAttribute']('data-id');}),this['isDone']=!0x0;}async['streamIntoElement'](_0x480115,_0xd8291b,_0x77415e){await this['htmlStreamer']['stream']({'document':_0x480115,'targetElement':_0xd8291b,'abortSignal':_0x77415e});}}class hn extends vt{['showChangesToggleView'];constructor(_0x73cf3d,_0xbed6a0){super(_0x73cf3d),this['set']('isShowChangesToggleVisible',!0x0),this['showChangesToggleView']=new cn(_0x73cf3d),this['showChangesToggleView']['set']({'class':'ck-ai-suggestion__header__show-changes-toggle\x20ck-ai-chat-controls-button\x20'+us,'label':hs(_0x73cf3d,'AI_SUGGESTION_BUTTON_SHOW_CHANGES'),'withText':!0x0}),this['showChangesToggleView']['isOn']=_0xbed6a0['showDiff'],this['showChangesToggleView']['bind']('isVisible')['to'](this,'isShowChangesToggleVisible'),this['showChangesToggleView']['bind']('icon')['to'](this['showChangesToggleView'],'isOn',_0x1913b1=>_0x1913b1?_0x5c77ce:_0x4fcfde),this['showChangesToggleView']['on']('execute',()=>{this['showChangesToggleView']['isOn']=!this['showChangesToggleView']['isOn'],this['fire']('toggleShowChanges',{'isOn':this['showChangesToggleView']['isOn']});});const _0x449a2f=new xt();_0x449a2f['content']=_0x22e392,this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__header',!0x1===_0xbed6a0['showHeader']?'ck-hidden':null]['filter'](Boolean)},'children':[_0x449a2f,{'tag':'span','children':[hs(_0x73cf3d,'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':_0x3bc1d0,'rejected':_0x3576c0,'outdated':_0x3576c0};class un extends vt{['stateIconView'];constructor(_0x331127){super(_0x331127);const _0x345759=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',_0x345759['to']('state',_0x4940ec=>'ck-ai-suggestion__content-part-state_'+_0x4940ec),_0x345759['if']('isVisible','ck-hidden',_0x2a3107=>!_0x2a3107)]},'children':[{'tag':'span','attributes':{'class':['ck-ai-suggestion__content-part-state__label']},'children':[{'text':_0x345759['to']('state',_0x3ad890=>{switch(_0x3ad890){case'accepted':return hs(_0x331127,'AI_SUGGESTION_CONTENT_PART_STATE_ACCEPTED');case'rejected':return hs(_0x331127,'AI_SUGGESTION_CONTENT_PART_STATE_REJECTED');case'outdated':return hs(_0x331127,'AI_SUGGESTION_CONTENT_PART_STATE_OUTDATED');}})}]},this['stateIconView']]});}['setState'](_0x1b7c0a){this['state']=_0x1b7c0a;}}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(_0x420700,_0x47e3a1,_0x31bfa9){super(_0x420700);const _0x55f43e=Boolean(_0x31bfa9);this['set']('isEnabled',!_0x55f43e),this['set']('isVisible',!0x0),this['class']='ck-ai-suggestion-content-part-toolbar';const _0x108ca7=[];if(_0x55f43e){const _0x254356=new Nt(_0x420700);_0x254356['set']({'label':hs(_0x420700,'AI_SUGGESTION_DISABLED_TOOLTIP_MESSAGE'),'tooltip':!0x0,'withText':!0x1,'icon':_0x3f9507}),_0x254356['extendTemplate']({'attributes':{'data-cke-tooltip-class':'ck-ai-suggestion-content-part-disabled-actions-tooltip'}}),_0x108ca7['push'](_0x254356);}else{_0x47e3a1['includes']('applySuggestion')&&(this['_applyButton']=new Nt(_0x420700),this['_applyButton']['set']({'label':hs(_0x420700,'AI_SUGGESTION_CONTENT_PART_APPLY'),'tooltip':!0x0,'tooltipPosition':'n','withText':!0x1,'icon':_0x3bc1d0}),this['_applyButton']['bind']('isEnabled')['to'](this),this['_applyButton']['on']('execute',()=>{this['fire']('applySuggestion');}),_0x108ca7['push'](this['_applyButton'])),_0x47e3a1['includes']('insertSuggestion')&&(this['_suggestButton']=new Nt(_0x420700),this['_suggestButton']['set']({'label':hs(_0x420700,'AI_SUGGESTION_CONTENT_PART_ADD_SUGGESTION'),'tooltip':!0x0,'tooltipPosition':'n','withText':!0x1,'icon':_0x31116f}),this['_suggestButton']['bind']('isEnabled')['to'](this),this['_suggestButton']['on']('execute',()=>{this['fire']('insertSuggestion');}),_0x108ca7['push'](this['_suggestButton']));const _0x55b25e=new Nt(_0x420700);_0x55b25e['set']({'label':hs(_0x420700,'AI_SUGGESTION_CONTENT_PART_REJECT'),'tooltip':!0x0,'tooltipPosition':'n','withText':!0x1,'icon':_0x3576c0}),_0x55b25e['bind']('isEnabled')['to'](this),_0x55b25e['on']('execute',()=>{this['fire']('rejectSuggestion');}),_0x108ca7['push'](_0x55b25e);}this['items']['addMany'](_0x108ca7);const _0x5b78d5=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':[_0x5b78d5['if']('isVisible','ck-hidden',_0x14b6ed=>!_0x14b6ed)]}});}['setButtonsVisibility']({showApplyButton:_0x4a3f9e,showSuggestButton:_0x335143}){this['_applyButton']&&(this['_applyButton']['isVisible']=_0x4a3f9e),this['_suggestButton']&&(this['_suggestButton']['isVisible']=_0x335143);}}class gn extends vt{['toolbarView'];['stateView'];['titleLabelView'];['children'];constructor(_0x3f8fb2,{part:_0x3969d0,uiIndex:_0x1ad886,availableActions:_0x5a8f1f,areActionsDisabled:_0x3629f6}){super(_0x3f8fb2),this['set']('isEnabled',!0x0),this['set']('state','pending'),this['toolbarView']=new _n(_0x3f8fb2,_0x5a8f1f,_0x3629f6),this['toolbarView']['on']('rejectSuggestion',()=>{this['fire']('rejectSuggestion',{'index':_0x3969d0['index']});}),this['toolbarView']['on']('insertSuggestion',()=>{this['fire']('insertSuggestion',{'index':_0x3969d0['index']});}),this['toolbarView']['on']('applySuggestion',()=>{this['fire']('applySuggestion',{'index':_0x3969d0['index']});}),this['toolbarView']['bind']('isEnabled')['to'](this),this['stateView']=new un(_0x3f8fb2),this['titleLabelView']=new An(_0x3f8fb2,_0x1ad886),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',(_0x8c0c20,_0x312400,_0x1d95da,_0x4a4491)=>{'pending'===_0x4a4491?this['children']['remove'](this['toolbarView']):this['children']['remove'](this['stateView']),'pending'===_0x1d95da?this['children']['add'](this['toolbarView']):(this['stateView']['setState'](_0x1d95da),this['children']['add'](this['stateView']));});}}class An extends vt{constructor(_0x4c0fb3,_0xc6e625){super(_0x4c0fb3),this['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai-suggestion__body__content-part__title__label']},'children':[hs(_0x4c0fb3,'AI_SUGGESTION_CONTENT_PART_TITLE',_0xc6e625['toString']())]});}}class In extends vt{['htmlStreamer'];constructor(_0x2f1bbc){super(_0x2f1bbc),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:_0x12a242,renderingStrategy:_0x5ac799,abortSignal:_0x41f368}){'streaming'===_0x5ac799?await this['htmlStreamer']['stream']({'document':_0x12a242['content'],'targetElement':this['element'],'abortSignal':_0x41f368}):_0x1f1589(this['element'],'<'+this['element']['tagName']+'>'+gs(_0x12a242['content'])+'</'+this['element']['tagName']+'>',{'childrenOnly':!0x0});}['clear'](){this['htmlStreamer']['reset'](),this['element']['innerHTML']='';}}class En extends vt{['_children'];['_headerView'];['_streamableContentView'];constructor(_0x4bdf06,{part:_0x483b8a,uiIndex:_0x575354,areActionsDisabled:_0x4771dc,availableActions:_0x84b056}){super(_0x4bdf06);const _0x4c8ffd=this['bindTemplate'];this['set']('state','pending'),this['set']('isDone',!0x1),this['set']('isVisible',!0x1),this['set']('isActive',!0x1),this['set']('isEnabled',!0x1);const _0x1c97d9=()=>{this['isEnabled']=this['isDone']&&'pending'==this['state']&&!_0x4771dc;};this['on']('change:state',_0x1c97d9),this['on']('change:isDone',_0x1c97d9),_0x1c97d9(),this['_children']=this['createCollection'](),this['_headerView']=new gn(_0x4bdf06,{'part':_0x483b8a,'uiIndex':_0x575354,'availableActions':_0x84b056,'areActionsDisabled':_0x4771dc}),this['_headerView']['bind']('isEnabled','state')['to'](this),this['_headerView']['delegate'](...Zs)['to'](this),this['_streamableContentView']=new In(_0x4bdf06),this['_children']['addMany']([this['_headerView'],this['_streamableContentView']]),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__body__content-part',_0x4c8ffd['to']('state',_0x4ea784=>'ck-ai-suggestion__body__content-part_'+_0x4ea784),_0x4c8ffd['if']('isEnabled','ck-ai-suggestion__body__content-part_enabled'),_0x4c8ffd['if']('isActive','ck-ai-suggestion__body__content-part_active'),_0x4c8ffd['if']('isVisible','ck-hidden',_0x12a65a=>!_0x12a65a)]},'children':this['_children'],'on':{'mouseenter':_0x4c8ffd['to'](()=>{this['isEnabled']&&this['fire']('mouseOverSuggestion',{'index':_0x483b8a['index']});}),'mouseleave':_0x4c8ffd['to'](()=>{this['isEnabled']&&this['fire']('mouseLeaveSuggestion',{'index':_0x483b8a['index']});}),'click':_0x4c8ffd['to'](_0x309d8d=>{const _0x55e1fc=_0x309d8d['target'];this['isEnabled']&&!this['_headerView']['toolbarView']['element']['contains'](_0x55e1fc)&&this['fire']('showChangeInText',{'index':_0x483b8a['index']});})}});}async['updateContent']({part:_0x51f7df,showUnchangedParts:_0xb9683c=!0x1,abortSignal:_0x36c1f6}){this['partDefinition']=_0x51f7df,this['isVisible']=this['partDefinition']['hasChanges']||_0xb9683c,this['isVisible']&&await this['_streamableContentView']['update']({'part':_0x51f7df,'renderingStrategy':'static','abortSignal':_0x36c1f6});}['markAsDone'](){this['isDone']=!0x0;}}class pn extends vt{constructor(_0x2712e3,_0x5df321){super(_0x2712e3),this['set']('isVisible',!0x0),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-skeleton',this['bindTemplate']['if']('isVisible','ck-hidden',_0x13b398=>!_0x13b398)]},'children':this['_createSkeletonItems'](_0x5df321)});}['_createSkeletonItems'](_0xf7a2f5){const _0x57a008=['ck','ck-ai-skeleton__item'];return _0xf7a2f5['map'](_0x5efded=>{let _0x44b69f='';switch(_0x5efded['attributes']['align']){case'right':_0x44b69f='margin-left:\x20auto;\x20margin-right:\x200;\x20text-align:\x20right;';break;case'center':_0x44b69f='margin-left:\x20auto;\x20margin-right:\x20auto;\x20text-align:\x20center;';break;case'left':_0x44b69f='margin-left:\x200;\x20margin-right:\x20auto;\x20text-align:\x20left;';}return{'tag':_0x5efded['tag'],'attributes':{'class':[..._0x57a008,_0x5efded['attributes']['class']?_0x5efded['attributes']['class']:''],'style':'width:\x20'+_0x5efded['attributes']['width']+';\x20height:\x20'+_0x5efded['attributes']['height']+';'+_0x44b69f}};});}}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(_0x42be67,_0x32c441,_0x2b63c8,_0x4f8643){return new Array(_0x42be67)['fill'](null)['map'](()=>({'tag':'div','attributes':{'width':_0x32c441,'height':_0x2b63c8,'align':_0x4f8643}}));}class Cn extends Tt(){['queue']=[];['isProcessing']=!0x1;['_abortController'];async['enqueue'](_0x1c58bf){const _0x552f44=this['createTask'](_0x1c58bf);return this['queue']['push'](_0x552f44),this['_processQueue'](),_0x552f44['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(_0x4524a8=>{this['once']('_queueEmpty',()=>{_0x4524a8();});}):Promise['resolve']();}async['_processQueue'](){if(!this['isProcessing']){this['_abortController']=new AbortController(),this['isProcessing']=!0x0;try{for(;this['queue']['length']&&this['isProcessing'];){const _0x10addb=this['queue']['shift']();try{await _0x10addb['callback'](this['_abortController']['signal']),_0x10addb['resolve']();}catch(_0xeac166){_0x10addb['reject'](_0xeac166);}}}finally{this['isProcessing']=!0x1,this['_abortController']=void 0x0;}this['fire']('_queueEmpty');}}['createTask'](_0x5a928b){let _0x57fe56,_0x5346fe;const _0xafcd8f=new Promise((_0x48c8eb,_0x22f68b)=>{_0x57fe56=_0x48c8eb,_0x5346fe=_0x22f68b;});return{'callback':_0x5a928b,'resolve':_0x57fe56,'reject':_0x5346fe,'completePromise':_0xafcd8f};}}class wn extends an{constructor(_0x153103){super(_0x153103),this['extendTemplate']({'attributes':{'class':['ck-ai-notification','warning'===_0x153103['level']?'ck-ai-notification_warning':'ck-ai-notification_error']}});}['render'](){super['render'](),this['setContent'](this['options']['initialContent']),this['markAsDone']();}['setContent'](_0x326c7c){this['element']['innerHTML']=_0x326c7c;}}const fn=['applySuggestion','insertSuggestion'];class bn extends vt{['_applyChangesButton'];['_insertSuggestionsButton'];['children'];constructor(_0x447446,_0x1816f5=[...fn],_0x24ee9f){super(_0x447446);const _0x301bff=this['bindTemplate'],_0x22e1ac=Boolean(_0x24ee9f);if(this['set']('isEnabled',!_0x22e1ac),this['set']('isVisible',!0x1),this['set']('isTrackChangesOn',!0x1),this['children']=this['createCollection'](),_0x22e1ac){const _0x1e73d2=new Nt(_0x447446);_0x1e73d2['set']({'label':hs(_0x447446,'AI_SUGGESTION_DISABLED_TOOLTIP_MESSAGE'),'tooltip':!0x0,'withText':!0x1,'icon':_0x3f9507}),_0x1e73d2['extendTemplate']({'attributes':{'data-cke-tooltip-class':'ck-ai-suggestion-content-part-disabled-actions-tooltip'}});const _0x5a0d9f=new vt(_0x447446);_0x5a0d9f['setTemplate']({'tag':'div','attributes':{'class':'ck-ai-chat__feed__suggestion__actions__info'},'children':[{'tag':'p','children':[hs(_0x447446,'AI_SUGGESTION_DISABLED_FEED_MESSAGE'),_0x1e73d2]}]}),this['children']['add'](_0x5a0d9f);}else this['_applyChangesButton']=new Nt(_0x447446),this['_applyChangesButton']['set']({'label':hs(_0x447446,'AI_CHAT_SUGGESTION_ACTION_APPLY_ALL'),'withText':!0x0,'type':'button','isVisible':_0x1816f5['includes']('applySuggestion'),'class':cs}),this['_insertSuggestionsButton']=new Nt(_0x447446),this['_insertSuggestionsButton']['set']({'label':hs(_0x447446,'AI_CHAT_SUGGESTION_ACTION_SUGGEST_ALL'),'withText':!0x0,'type':'button','isVisible':_0x1816f5['includes']('insertSuggestion'),'class':ls}),this['_insertSuggestionsButton']['on']('execute',()=>{this['fire']('insertSuggestion');}),this['_applyChangesButton']['on']('execute',()=>{this['fire']('applySuggestion');}),[this['_applyChangesButton'],this['_insertSuggestionsButton']]['forEach'](_0xb791b4=>{_0xb791b4['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',_0x301bff['if']('isVisible','ck-hidden',_0x938bc3=>!_0x938bc3)]},'children':this['children']}),this['on']('change:isTrackChangesOn',()=>{this['_applyChangesButton']&&(this['_applyChangesButton']['isVisible']=!this['isTrackChangesOn']);});}['updateVisibility'](_0x169216){this['isVisible']=_0x169216;}['_switchButtonLabelsPlurality'](_0x1c3602){this['_applyChangesButton']&&this['_insertSuggestionsButton']&&(_0x1c3602?(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(_0x5d6b5c,_0x12ee35){super(_0x5d6b5c),this['bodyCollection']=_0x12ee35,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',_0x13c9dd=>!_0x13c9dd)]},'children':this['children']});const _0x593d90=new vt(this['locale']),_0x2173af=new xt();_0x2173af['content']=_0x3bebb8,_0x593d90['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-web-sources__header']},'children':[_0x2173af,{'tag':'span','children':[{'text':hs(this['locale'],'AI_CHAT_SOURCES_HEADER')}]}]}),this['children']['add'](_0x593d90),this['_setupBalloonPanel'](_0x5d6b5c);}['addSource'](_0x6ed55a){this['children']['add'](new Rn(this['locale'],_0x6ed55a,this['balloonPanelView']));}['_setupBalloonPanel'](_0x386b40){this['balloonPanelView']=new Xt(_0x386b40),this['balloonPanelView']['extendTemplate']({'attributes':{'class':['ck-ai-web-source__tooltip-balloon']}}),this['bodyCollection']['add'](this['balloonPanelView']);}}class Rn extends Nt{['balloonPanelView'];['source'];constructor(_0x20a682,_0x566e05,_0x3404c8){super(_0x20a682),this['source']=_0x566e05,this['balloonPanelView']=_0x3404c8,this['set']({'label':_0x566e05['title'],'class':['ck\x20ck-ai-web-source'],'withText':!0x0});const _0x26be05=this['bindTemplate'];if(this['extendTemplate']({'on':{'click':_0x26be05['to'](()=>{window['open'](_0x566e05['url'],'_blank');}),'mouseenter':_0x26be05['to'](()=>{this['_showTooltip']();}),'mouseleave':_0x26be05['to'](()=>{this['_hideTooltip']();})}}),_0x566e05['favicon']){const _0x37d097=new vt(_0x20a682);_0x37d097['setTemplate']({'tag':'img','attributes':{'src':_0x566e05['favicon']||_0x3bebb8,'alt':_0x566e05['title'],'class':['ck-ai-web-source__image']}}),this['children']['add'](_0x37d097);}else this['set']('icon',_0x3bebb8);}['_createTooltipContentView'](_0xb3b2cb,_0x4a23f8){const _0x2aa855=new vt(_0xb3b2cb),_0x228c8c=[];let _0xc51c00;_0x4a23f8?.['favicon']?(_0xc51c00=new vt(_0xb3b2cb),_0xc51c00['setTemplate']({'tag':'img','attributes':{'src':_0x4a23f8['favicon'],'alt':_0x4a23f8['title'],'class':['ck-ai-web-source__tooltip-image']}})):(_0xc51c00=new xt(),_0xc51c00['content']=_0x3bebb8,_0xc51c00['extendTemplate']({'attributes':{'alt':_0x4a23f8['title'],'class':['ck-ai-web-source__tooltip-image']}})),_0x228c8c['push'](_0xc51c00);const _0x5eac4c=new vt(_0xb3b2cb);_0x5eac4c['setTemplate']({'tag':'a','attributes':{'class':['ck-ai-web-source__tooltip-url'],'href':_0x4a23f8['url']},'children':[{'text':new URL(_0x4a23f8['url'])?.['hostname']}]}),_0x228c8c['push'](_0x5eac4c);const _0x6db71=new vt(_0xb3b2cb);_0x6db71['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-web-source__tooltip-row']},'children':_0x228c8c});const _0x1139be=new vt(_0xb3b2cb);return _0x1139be['setTemplate']({'tag':'span','attributes':{'class':['ck-ai-web-source__tooltip-row','ck-ai-web-source__tooltip-title']},'children':[{'text':_0x4a23f8['title']['length']>0x190?_0x4a23f8['title']['substring'](0x0,0x190)+'...':_0x4a23f8['title']}]}),_0x2aa855['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-web-source__tooltip']},'children':[_0x6db71,_0x1139be]}),_0x2aa855;}['_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 _0x295b90=this['_createTooltipContentView'](this['locale'],this['source']);this['balloonPanelView']['content']['add'](_0x295b90);}}class On extends vt{['_actionsView'];['_sourcesView'];['_children'];['_skeletonView'];['_showSkeletonDebounced']=_0x44e40b(()=>{this['_skeletonView']['isVisible']=!0x0,this['_skeletonShownAt']=Date['now']();},0x3e8);['_skeletonShownAt']=null;['_areActionsDisabled'];['_showUnchangedParts'];['_updateContentPartsPromiseQueue'];['_emptyPartsWarningView'];['_availableActions'];['_cachedContentParts']=[];constructor(_0x1811d2,_0x89516a){super(_0x1811d2);const {areActionsDisabled:_0x406724,showUnchangedParts:_0x38a390,availableActions:_0x22ec48}=_0x89516a;this['_areActionsDisabled']=_0x406724,this['_showUnchangedParts']=_0x38a390,this['_availableActions']=_0x22ec48,this['set']('hasPendingParts',!0x1),this['set']('isTrackChangesOn',!0x1),this['_children']=this['createCollection'](),this['_skeletonView']=new pn(_0x1811d2,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(_0x1811d2,'AI_SUGGESTION_EMPTY_PART_WARNING'),'level':'warning'}),this['_emptyPartsWarningView']['isVisible']=!0x1,this['_actionsView']=new bn(_0x1811d2,_0x89516a['availableActions'],this['_areActionsDisabled']),this['_actionsView']['bind']('isTrackChangesOn')['to'](this),this['_sourcesView']=new Sn(this['locale'],_0x89516a['bodyCollection']),_0x89516a['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'](_0x119f6a=>_0x119f6a instanceof En);}async['updateContentParts']({parts:_0x382837,abortSignal:_0x532cf3,skipLoadingEffects:_0x556e08}){this['_cachedContentParts']['length']?_0x382837['forEach'](_0x5e9b3c=>{const _0x3d15a0=this['_cachedContentParts']['findIndex'](_0x4e554a=>_0x4e554a['index']==_0x5e9b3c['index']);-0x1===_0x3d15a0?this['_cachedContentParts']['push'](_0x5e9b3c):this['_cachedContentParts'][_0x3d15a0]=_0x5e9b3c;}):this['_cachedContentParts']=_0x382837;const _0x21502a=this['_showUnchangedParts']?_0x382837:_0x382837['filter'](_0x520842=>_0x520842['hasChanges']);this['_actionsView']['_switchButtonLabelsPlurality'](_0x21502a['length']>0x1),_0x556e08&&(this['_showSkeletonDebounced']['cancel'](),this['_skeletonView']['isVisible']=!0x1);for(const _0xb7afec of _0x21502a)this['_updateContentPartsPromiseQueue']['enqueue'](async _0x514990=>{let _0x3054ba=this['getPartView'](_0xb7afec['index']);if(!_0x3054ba){if(_0x3054ba=new En(this['locale'],{'part':_0xb7afec,'uiIndex':this['_contentPartViews']['length']+0x1,'areActionsDisabled':this['_areActionsDisabled'],'availableActions':this['_availableActions']}),_0x3054ba['delegate'](...Zs)['to'](this),!_0x556e08&&(this['_showSkeletonDebounced']['cancel'](),await this['_awaitMinimumSkeletonDisplayTime'](_0x514990),_0x514990['aborted']))return;this['_skeletonView']['isVisible']=!0x1,this['_children']['add'](_0x3054ba,this['_children']['length']-0x1),this['hasPendingParts']=!0x0,_0x556e08||this['_showSkeletonDebounced']();}await _0x3054ba['updateContent']({'part':_0xb7afec,'showUnchangedParts':this['_showUnchangedParts'],'abortSignal':_0x514990}),_0x3054ba['markAsDone']();});return _0x532cf3?.['addEventListener']('abort',()=>{this['_updateContentPartsPromiseQueue']['abort'](),this['_showSkeletonDebounced']['cancel'](),this['_skeletonView']['isVisible']=!0x1;}),this['_updateContentPartsPromiseQueue']['queueEmptyPromise'];}['updatePartState'](_0x39e6d1,_0x43ea9f){const _0x24e217=this['getPartView'](_0x39e6d1);_0x24e217&&(_0x24e217['state']=_0x43ea9f),this['hasPendingParts']='pending'==_0x43ea9f||this['_contentPartViews']['some'](_0x7fde86=>'pending'==_0x7fde86['state']);}['setPartActive'](_0x5672ed,_0x271f63){if(!0x1===_0x5672ed){for(const _0xf2db9b of this['_contentPartViews'])_0xf2db9b['isActive']=!0x1;}else{const _0x422d91=this['getPartView'](_0x5672ed);_0x422d91&&(_0x422d91['isActive']=_0x271f63);}}['updateSources'](_0x3eda77){_0x3eda77['forEach'](_0x5e300c=>this['_sourcesView']['addSource'](_0x5e300c)),this['_sourcesView']['isVisible']=!0x0;}['getPartView'](_0x550585){return this['_contentPartViews']['find'](_0x3d5401=>_0x3d5401['partDefinition']['index']==_0x550585)??null;}['markAsDone'](){if(!this['_showUnchangedParts']){const _0x54048b=!this['_cachedContentParts']['find'](({hasChanges:_0x34f282})=>_0x34f282),_0x4b046f=!!this['_cachedContentParts']['find'](({hasChanges:_0x343f76})=>!_0x343f76);this['_emptyPartsWarningView']['isVisible']=0x0==this['_contentPartViews']['length']||_0x4b046f,_0x54048b?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'](_0x3aea79=>_0x3aea79['markAsDone']()),this['_skeletonView']['isVisible']=!0x1,this['_showSkeletonDebounced']['cancel'](),this['_actionsView']['updateVisibility'](this['hasNonEmptyParts']);}async['_awaitMinimumSkeletonDisplayTime'](_0x2914a2){if(!this['_skeletonView']['isVisible']||null===this['_skeletonShownAt'])return;const _0xd60ebe=0x3e8-(Date['now']()-this['_skeletonShownAt']);if(this['_skeletonShownAt']=null,_0xd60ebe>0x0){const {promise:_0xa48331,abortController:_0x1b55ee}=en(_0xd60ebe);_0x2914a2?.['addEventListener']('abort',()=>_0x1b55ee['abort']()),await _0xa48331['catch'](()=>{});}}get['hasNonEmptyParts'](){return this['_contentPartViews']['filter'](_0x2d120b=>_0x2d120b['partDefinition']['hasChanges'])['length']>0x0;}}class kn extends vt{['bodyView'];['children'];['headerView'];constructor(_0x47d736,_0x302a67,_0x22d4d8){super(_0x47d736);const {showDiff:_0x154156,areActionsDisabled:_0x5399fe,showUnchangedParts:_0x415908,availableActions:_0xb612ff}=_0x302a67;this['set']('isTrackChangesOn',!0x1),this['set']('areChangesVisible',!0x1),this['children']=this['createCollection'](),this['headerView']=new hn(_0x47d736,{'showDiff':_0x154156}),this['headerView']['on']('toggleShowChanges',(_0x45d39f,_0x1130aa)=>{this['areChangesVisible']=_0x1130aa['isOn'],this['fire']('toggleSuggestionDisplayMode',{'showDiff':_0x1130aa['isOn']});}),this['children']['add'](this['headerView']),this['bodyView']=new On(_0x47d736,{'areActionsDisabled':_0x5399fe,'showUnchangedParts':!!_0x415908,'availableActions':_0xb612ff,'bodyCollection':_0x22d4d8}),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'](_0x17e51a){await this['bodyView']['updateContentParts'](_0x17e51a);}['updateSources'](_0x5d839b){this['bodyView']['updateSources'](_0x5d839b);}['markAsDone'](){this['bodyView']['markAsDone'](),this['headerView']&&(this['headerView']['isShowChangesToggleVisible']=this['bodyView']['hasNonEmptyParts']);}}class Nn extends an{['containerView'];constructor(_0x3fda0c,_0x49dfb6,_0x4b8e85){super(_0x49dfb6),this['set']('isTrackChangesOn',!0x1),this['containerView']=new kn(_0x3fda0c,{'showDiff':_0x49dfb6['showDiff'],'areActionsDisabled':_0x49dfb6['areActionsDisabled'],'availableActions':_0x49dfb6['availableActions']},_0x4b8e85),this['containerView']['on']('toggleSuggestionDisplayMode',(_0x5392cb,_0x4d8216)=>{this['fire']('toggleSuggestionDisplayMode',{'replyId':this['options']['id'],'showDiff':_0x4d8216['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',(_0x4ef92f,{index:_0x1f8c0c})=>{this['fire']('showChangeInText',{'replyId':this['options']['id'],'partIndex':_0x1f8c0c});}),this['containerView']['on']('applySuggestion',(_0x190b88,{index:_0x4c2b15}={})=>{this['fire']('applySuggestion',{'replyId':this['options']['id'],'partIndex':_0x4c2b15});}),this['containerView']['on']('insertSuggestion',(_0x3a7192,{index:_0x2e37d4}={})=>{this['fire']('insertSuggestion',{'replyId':this['options']['id'],'partIndex':_0x2e37d4});}),this['containerView']['on']('rejectSuggestion',(_0x18294c,{index:_0x1ba574})=>{this['fire']('rejectSuggestion',{'replyId':this['options']['id'],'partIndex':_0x1ba574});}),this['containerView']['on']('mouseOverSuggestion',(_0x1741cb,{index:_0x2e55a3})=>{this['fire']('mouseOverSuggestion',{'replyId':this['options']['id'],'partIndex':_0x2e55a3});}),this['containerView']['on']('mouseLeaveSuggestion',(_0x1ddda2,{index:_0x6be090})=>{this['fire']('mouseLeaveSuggestion',{'replyId':this['options']['id'],'partIndex':_0x6be090});}),this['children']['addMany']([this['containerView']]),this['extendTemplate']({'attributes':{'class':['ck-ai-chat__feed__ai-suggestion']}});}async['updateContent'](_0x24cd03){await this['containerView']['updateContent'](_0x24cd03);}['updatePartState'](_0x26bf56,_0x61476b){this['containerView']['bodyView']['updatePartState'](_0x26bf56,_0x61476b);}['setPartActive'](_0x4e94d5,_0x2ab505){!0x1===_0x4e94d5?this['containerView']['bodyView']['setPartActive'](!0x1):this['containerView']['bodyView']['setPartActive'](_0x4e94d5,_0x2ab505);}['updateSources'](_0x4eb5ff){this['containerView']['updateSources'](_0x4eb5ff);}['getPartView'](_0x381ac6){return this['containerView']['bodyView']['getPartView'](_0x381ac6);}['markAsDone'](){super['markAsDone'](),this['containerView']['markAsDone']();}}class vn extends an{['replyContainer'];['_bodyCollection'];constructor(_0x3dd966,_0x267d9a,_0x1278ea){super(_0x267d9a),this['_bodyCollection']=_0x1278ea,this['locale']=_0x3dd966,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:_0x25a4b2,renderingStrategy:_0xc830ed,abortSignal:_0x257866}){'streaming'===_0xc830ed?await this['streamIntoElement'](_0x25a4b2,this['replyContainer']['element'],_0x257866):this['replyContainer']['element']['innerHTML']=ti(_0x25a4b2);}['updateSources'](_0x1e14f4){const _0x3cba7b=new Sn(this['locale'],this['_bodyCollection']);_0x3cba7b['children']['addMany'](_0x1e14f4['map'](_0x2e0080=>new Rn(this['locale'],_0x2e0080,_0x3cba7b['balloonPanelView']))),_0x3cba7b['isVisible']=!0x0,this['children']['add'](_0x3cba7b);}}class yn extends yt{constructor(_0x377af5=void 0x0){super();const _0x190a8c=_0x377af5?'ck-ai-spinner_'+_0x377af5:'';this['extendTemplate']({'tag':'span','attributes':{'class':['ck-ai-spinner',_0x190a8c]}});}}const xn={'file':_0x3f3bf7,'document':_0x22e392,'web-resource':_0x5ea46a,'text':_0x3f3bf7,'selection':_0x106841,'mcp-tool-context':_0x22e392},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(_0x49dbcf,_0x2fe087,_0x7a7faf,_0x1b1711,_0x473377=!0x1){super(_0x49dbcf),this['_isAnimationOnEnterEnabled']=_0x1b1711,this['_initializeProperties'](_0x2fe087,_0x7a7faf,_0x473377),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'](_0xd77206,_0x146dd9,_0x3fb32f){this['set']('label',_0xd77206['label']),this['set']('tooltip',!0x0),this['set']('itemType',_0xd77206['type']),this['set']('id',_0xd77206['uiId']),this['set']('readonly',_0x146dd9),this['set']('isLoading',_0x3fb32f);}['_setupTemplate'](){const _0x5c581b=this['_createIconView'](),_0x2561aa=this['_createRemoveButton'](),_0x46ffbc=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':this['_createTemplateAttributes'](_0x46ffbc),'children':this['_createTemplateChildren'](_0x5c581b,_0x2561aa,_0x46ffbc)});}['_createTemplateAttributes'](_0x2ddf71){return{'class':[Ln,_0x2ddf71['if']('itemType',Pn,_0x21b6b4=>'document'==_0x21b6b4),_0x2ddf71['if']('itemType',Dn,_0x5b4080=>'selection'==_0x5b4080)],'data-cke-tooltip-text':_0x2ddf71['to']('label',Gn),'data-cke-tooltip-position':Vn,'data-cke-tooltip-class':Un};}['_createTemplateChildren'](_0x5a642c,_0x518ac4,_0x544995){const _0xc216f6=this['_createLabelElement'](_0x544995),_0x40c18d=this['_createLoaderIcon']();return this['readonly']?[_0x5a642c,_0xc216f6]:[_0x5a642c,_0x40c18d,_0xc216f6,_0x518ac4];}['_createLabelElement'](_0x32c3e6){return{'tag':'span','attributes':{'class':Hn},'children':[{'text':_0x32c3e6['to']('label')}]};}['_createRemoveButton'](){const _0x1ebd14=new Nt(this['locale']);return _0x1ebd14['set']({'label':hs(this['locale'],'AI_CHAT_CONTEXT_REMOVE_FROM_CONTEXT'),'icon':_0x5adff9}),this['_setupRemoveButtonEvent'](_0x1ebd14),_0x1ebd14;}['_setupRemoveButtonEvent'](_0x14a147){_0x14a147['on']('execute',()=>{this['fire']('removeContextItemChip',this['id']);});}['_createIconView'](){const _0x5587c0=this['bindTemplate'],_0x1294b5=new xt();return _0x1294b5['content']=xn[this['itemType']],_0x1294b5['extendTemplate']({'attributes':{'class':[Mn,_0x5587c0['if']('isLoading','ck-hidden',_0x1dadb0=>_0x1dadb0)]}}),_0x1294b5;}['_handleAnimationEndOnce'](_0x583519,_0x3507f8){if(!_0x583519)return;const _0x3d6d25=()=>{_0x3507f8(),_0x583519['removeEventListener']('animationend',_0x3d6d25),_0x583519['removeEventListener']('webkitAnimationEnd',_0x3d6d25);};_0x583519['addEventListener']('animationend',_0x3d6d25),_0x583519['addEventListener']('webkitAnimationEnd',_0x3d6d25);}['_createLoaderIcon'](){const _0x14898d=new yn('small');return _0x14898d['bind']('isVisible')['to'](this,'isLoading',_0x3471d5=>_0x3471d5),_0x14898d;}}function Gn(_0x453550){if(!_0x453550)return _0x453550;if(_0x453550['length']<=0x78)return _0x453550;const _0x787495=_0x453550['slice'](0x0,0x78),_0x208357=_0x787495['lastIndexOf']('\x20');return(_0x208357>0x0?_0x787495['slice'](0x0,_0x208357):_0x787495)+'…';}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(_0x2223d4,_0x2272af,_0x2557ed,_0x1473e0,_0x374757){this['_locale']=_0x2223d4,this['_visibleChips']=_0x2272af,this['_config']={...Fn,..._0x2557ed,'cssClasses':{'controlsButton':'','calculationContainer':'ck-calculation-container',..._0x2557ed['cssClasses']}},this['_overflowChips']=new dt(),this['_bodyCollection']=_0x1473e0,this['_parentView']=_0x374757||null;}['setContainerElement'](_0x33963a){this['_intersectionObserver']&&(this['_intersectionObserver']['disconnect'](),this['_intersectionObserver']=null),this['_containerElement']=_0x33963a,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 _0x187505=[...this['_visibleChips'],...this['_overflowChips']],_0x500595=this['_createCalculationContainer'](),_0x445511=this['_calculateOverflowInContainer'](_0x500595,_0x187505),_0x33dbf9=_0x500595['_ancestorsToRestore'];_0x33dbf9&&this['_restoreAncestorVisibility'](_0x33dbf9),_0x500595['remove'](),this['_applyOverflowResults'](_0x187505,_0x445511);}['_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 _0x4aa7be=new Nt(this['_locale']);_0x4aa7be['set']({'label':'','withText':!0x0,'isToggleable':!0x0});const _0x2d6777=[this['_config']['cssClasses']['showMoreButton']];return this['_config']['cssClasses']['controlsButton']&&_0x2d6777['push'](this['_config']['cssClasses']['controlsButton']),_0x4aa7be['extendTemplate']({'attributes':{'class':_0x2d6777}}),_0x4aa7be;}['_createShowMoreBalloonPanelView'](){const _0x3c4ac0=new Xt(this['_locale']);return _0x3c4ac0['extendTemplate']({'attributes':{'class':this['_config']['cssClasses']['showMoreBalloon']}}),this['_bodyCollection']['add'](_0x3c4ac0),_0x3c4ac0;}['_updateBalloonContent'](){if(this['_showMoreBalloonPanelView']&&(this['_showMoreBalloonPanelView']['content']['clear'](),this['_overflowChips']['length']>0x0)){this['_overflowChips']['forEach'](_0x24b670=>{_0x24b670['disableAnimationOnEnter']();});const _0x32b438=new vt(this['_locale']);_0x32b438['setTemplate']({'tag':'div','attributes':{'class':this['_config']['cssClasses']['overflowContainer']},'children':this['_overflowChips']}),this['_showMoreBalloonPanelView']['content']['add'](_0x32b438);}}['_handleShowMoreButtonClick'](){this['_showMoreButtonView']['isOn']?this['hideBalloonPanel']():this['showBalloonPanel']();}['_updateShowMoreButtonVisibility'](){const _0x59e393=this['_overflowChips']['length']>0x0;this['_showMoreButtonView']?.['element']&&(this['_showMoreButtonView']['element']['style']['display']=_0x59e393?'':'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'](_0x4d6755){const _0x46d109=this['_containerElement']?.['tagName']['toLowerCase']()||'div',_0x54e797=this['_containerElement']?.['classList'];if(_0x54e797){const _0x288e19=_0x54e797[0x0]||'',_0x27480a=_0x4d6755['querySelector']('.'+_0x288e19),_0x67612d=_0x4d6755['querySelector'](_0x46d109);return _0x27480a||_0x67612d||_0x4d6755;}return _0x4d6755['querySelector'](_0x46d109)||_0x4d6755;}['_calculateContainerWidth'](){const _0x18c9a4=this['_parentView']?.['element']||this['_containerElement'];if(!_0x18c9a4)return Kn;const _0x78c9b7=window['getComputedStyle'](_0x18c9a4)['width'];if('auto'===_0x78c9b7||'0px'===_0x78c9b7||!_0x78c9b7){const _0x1096b4=_0x18c9a4['parentElement'];if(_0x1096b4){const _0xc9c349=window['getComputedStyle'](_0x1096b4);return'auto'!==_0xc9c349['width']?_0xc9c349['width']:Kn;}return Kn;}return _0x78c9b7;}['_applyCalculationStyles'](_0x3255ed,_0x4780d7){this['_config']['cssClasses']['calculationContainer']&&_0x3255ed['classList']['add'](this['_config']['cssClasses']['calculationContainer']),_0x3255ed['style']['width']=_0x4780d7,_0x3255ed['style']['position']='absolute',_0x3255ed['style']['top']='-9999px',_0x3255ed['style']['left']='-9999px',_0x3255ed['style']['opacity']='0',_0x3255ed['style']['pointerEvents']='none',_0x3255ed['style']['zIndex']='-1',_0x3255ed['style']['visibility']='visible\x20!important',_0x3255ed['style']['display']='block\x20!important',_0x3255ed['style']['boxSizing']='border-box';}['_restoreAncestorVisibility'](_0x2a1712){_0x2a1712['forEach'](({element:_0x1eccf5,originalDisplay:_0x1465f1,originalVisibility:_0x4eec6e})=>{_0x1eccf5['style']['display']=_0x1465f1,_0x1eccf5['style']['visibility']=_0x4eec6e;});}['_makeAncestorsVisible'](_0x356593){const _0x3adb0d=[];let _0x5b001e=_0x356593;for(;_0x5b001e&&_0x5b001e!==document['body'];){const _0x2d618c=window['getComputedStyle'](_0x5b001e);'none'!==_0x2d618c['display']&&'hidden'!==_0x2d618c['visibility']||(_0x3adb0d['push']({'element':_0x5b001e,'originalDisplay':_0x5b001e['style']['display'],'originalVisibility':_0x5b001e['style']['visibility']}),_0x5b001e['style']['display']='block',_0x5b001e['style']['visibility']='visible'),_0x5b001e=_0x5b001e['parentElement'];}return _0x3adb0d;}['_createContainerElements'](){let _0x123ef8,_0x58ab98;return this['_parentView']?.['element']?(_0x123ef8=this['_parentView']['element']['cloneNode'](!0x0),_0x58ab98=this['_findTargetContainer'](_0x123ef8)):(_0x123ef8=document['createElement']('div'),_0x58ab98=_0x123ef8),{'calculationContainer':_0x123ef8,'targetContainer':_0x58ab98};}['_createCalculationContainer'](){const {calculationContainer:_0x326b10,targetContainer:_0x3efb54}=this['_createContainerElements'](),_0x4abec3=this['_calculateContainerWidth']();this['_applyCalculationStyles'](_0x326b10,_0x4abec3);const _0x5bfbff=this['_parentView']?.['element']||this['_containerElement'],_0x4f6421=_0x5bfbff?.['parentElement'];_0x4f6421?_0x4f6421['appendChild'](_0x326b10):document['body']['appendChild'](_0x326b10),_0x326b10['_targetContainer']=_0x3efb54;const _0x39a4d4=this['_makeAncestorsVisible'](_0x4f6421||null);return _0x326b10['offsetWidth'],_0x326b10['_ancestorsToRestore']=_0x39a4d4,_0x326b10;}['_calculateOverflowInContainer'](_0x4bee04,_0x89dfae){const _0x432747=_0x4bee04['_targetContainer']||_0x4bee04,_0x1e9420=[],{rowCount:_0x1d45fe}=this['_renderChipsAndCountRows'](_0x432747,_0x89dfae);if(_0x1d45fe<=this['_config']['maxVisibleRows'])return _0x1e9420;const _0x394805=_0x89dfae['slice']();for(;_0x394805['length']>0x0;){if(this['_testButtonFit'](_0x4bee04,_0x432747,_0x394805)){const _0x3840a2=_0x89dfae['filter'](_0x477e88=>!_0x394805['includes'](_0x477e88));_0x1e9420['push'](..._0x3840a2);break;}if(!_0x394805['pop']())break;}return _0x1e9420;}['_renderChipsAndCountRows'](_0x17f03c,_0x29eb06){_0x17f03c['innerHTML']='',_0x29eb06['forEach'](_0x4ae2f3=>{if(_0x4ae2f3['element']){const _0x1fc52d=_0x4ae2f3['element']['cloneNode'](!0x0);_0x17f03c['appendChild'](_0x1fc52d);}}),_0x17f03c['offsetWidth'];const _0x534994=_0x17f03c['children'],_0x37f37d=[];return Array['from'](_0x534994)['forEach'](_0x4d0418=>{const _0x41881b=_0x4d0418['getBoundingClientRect']()['top'];_0x37f37d['some'](_0x5f3309=>Math['abs'](_0x5f3309-_0x41881b)<this['_config']['rowDetectionTolerance'])||_0x37f37d['push'](_0x41881b);}),{'rowCount':_0x37f37d['length']};}['_createMockButton'](){const _0xfe98ba=document['createElement']('button');return _0xfe98ba['className']=this['_config']['cssClasses']['showMoreButton'],this['_config']['cssClasses']['controlsButton']&&_0xfe98ba['classList']['add'](this['_config']['cssClasses']['controlsButton']),_0xfe98ba['textContent']='+\x201',_0xfe98ba;}['_testButtonFit'](_0x4d6a8f,_0x43f94e,_0x4d7da1){this['_renderChipsAndCountRows'](_0x43f94e,_0x4d7da1);const _0x453159=this['_createMockButton']();_0x4d6a8f['appendChild'](_0x453159),_0x4d6a8f['offsetWidth'];const _0x2c1419=[..._0x43f94e['children'],_0x453159],_0x4db592=[];_0x2c1419['forEach'](_0x18b0f6=>{const _0x2a5e2e=_0x18b0f6['getBoundingClientRect']()['top'];_0x4db592['some'](_0x16be01=>Math['abs'](_0x16be01-_0x2a5e2e)<this['_config']['rowDetectionTolerance'])||_0x4db592['push'](_0x2a5e2e);});const _0x28af7a=_0x4db592['length'];return _0x453159['remove'](),_0x28af7a<=this['_config']['maxVisibleRows'];}['_distributeChips'](_0x455095,_0x512622){this['_visibleChips']['clear'](),this['_overflowChips']['clear'](),_0x455095['forEach'](_0x24eaab=>{_0x512622['includes'](_0x24eaab)?this['_overflowChips']['add'](_0x24eaab):this['_visibleChips']['add'](_0x24eaab);});}['_updateOverflowUI'](_0x499c5d){if(_0x499c5d>0x0&&!this['_showMoreButtonView']&&this['_createShowMoreButton'](),_0x499c5d>0x0&&this['_showMoreButtonView']){const _0x92937=''+this['_config']['showMoreLabelPrefix']+(_0x499c5d<0x63?_0x499c5d:'99');this['_showMoreButtonView']['label']=_0x92937;}this['_updateBalloonContent'](),this['_updateShowMoreButtonVisibility'](),this['_repinBalloonPanel']();}['_applyOverflowResults'](_0x28381c,_0xcb7445){this['_distributeChips'](_0x28381c,_0xcb7445),this['_updateOverflowUI'](_0xcb7445['length']);}['_setupVisibilityObserver'](){this['_containerElement']&&'undefined'!=typeof IntersectionObserver&&(this['_intersectionObserver']=new IntersectionObserver(_0x477dcf=>{_0x477dcf[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 _0x742992=this['_containerElement']['getBoundingClientRect']();if(0x0===_0x742992['width']||0x0===_0x742992['height'])return!0x1;const _0x3c2ace=window['innerHeight']||document['documentElement']['clientHeight'],_0x58c21a=window['innerWidth']||document['documentElement']['clientWidth'],_0x5644d0=0xc8;return _0x742992['bottom']>=-0xc8&&_0x742992['top']<=_0x3c2ace+_0x5644d0&&_0x742992['right']>=-0xc8&&_0x742992['left']<=_0x58c21a+_0x5644d0;}}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(_0x45fe79,_0x5cbbd0,_0x3bea0d){super(_0x45fe79),this['_bodyCollection']=_0x3bea0d,this['_createContextChips'](_0x5cbbd0);const _0x58444a={'cssClasses':{'showMoreButton':Xn+'\x20'+us,'showMoreBalloon':zn,'overflowContainer':qn,'controlsButton':Qn}};this['_overflowManager']=new Wn(_0x45fe79,this['_contextChips'],_0x58444a,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 _0x1f9835=this['element']['querySelector']('.'+$n);_0x1f9835&&(this['_overflowManager']['setContainerElement'](_0x1f9835),this['_overflowManager']['reorganizeChips']());}['destroy'](){super['destroy'](),this['_overflowManager']['destroy']();}['_createContextChips'](_0x165f33){for(const _0x45a240 of _0x165f33){const _0x418779=new Bn(this['locale'],_0x45a240,!0x0,!0x1);this['_contextChips']['add'](_0x418779);}}}class Jn extends an{['_contextChipsView']=null;['_locale'];['_bodyCollection'];['_messageContentView'];constructor(_0x3badb3,_0x32ecc2,_0x1b25cd){super(_0x32ecc2),this['_locale']=_0x3badb3,this['_bodyCollection']=_0x1b25cd,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'](_0xe4dc6f=>!_0xe4dc6f['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(_0x2ffec9,_0x3ac30b){super(_0x3ac30b);const {isWebSearchEnabled:_0x284b3a,isReasoningEnabled:_0xd8ea70}=_0x3ac30b['capabilities'],_0x189007=[];let _0x525933='';_0x284b3a&&_0xd8ea70?(_0x525933=hs(_0x2ffec9,'AI_CHAT_FEED_REPLY_ITEM_USED_WEB_SEARCH_REASONING'),_0x189007['push'](tr(_0x3bebb8)),_0x189007['push'](tr(_0x3cfa5e))):_0x284b3a?(_0x525933=hs(_0x2ffec9,'AI_CHAT_FEED_REPLY_ITEM_USED_WEB_SEARCH'),_0x189007['push'](tr(_0x3bebb8))):_0xd8ea70&&(_0x525933=hs(_0x2ffec9,'AI_CHAT_FEED_REPLY_ITEM_USED_REASONING'),_0x189007['push'](tr(_0x3cfa5e))),this['extendTemplate']({'attributes':{'class':['ck-ai-chat__feed__interaction-header',_0x525933?'':'ck-hidden']}});const _0x1ae53f=new vt();_0x1ae53f['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed__interaction-header__capabilities']},'children':[..._0x189007,{'tag':'span','attributes':{'class':['ck-ai-chat__feed__interaction-header__capabilities__text']},'children':[_0x525933]}]}),this['children']['add'](_0x1ae53f),this['capabilities']=_0x3ac30b['capabilities'];}}function tr(_0x5aa034){const _0x2561e5=new xt();return _0x2561e5['content']=_0x5aa034,_0x2561e5;}const er=['wheel','touchstart','pointerdown','keydown'],ir=['ArrowUp','ArrowDown','PageUp','PageDown','Home','End','\x20'];class sr{['element'];['animationFrameId'];['isRunning'];['abortController'];['isUserPaused'];['scrollBehavior'];constructor(_0x18a833){this['element']=_0x18a833,this['animationFrameId']=null,this['isRunning']=!0x1,this['abortController']=new AbortController(),this['isUserPaused']=!0x1,this['scrollBehavior']='smooth';for(const _0x19f110 of er){const _0x1bda8b='keydown'!==_0x19f110;this['element']['addEventListener'](_0x19f110,this['_onUserEvent']['bind'](this),{'passive':_0x1bda8b,'signal':this['abortController']['signal']});}}['start']({smooth:_0xca1f93=!0x0}={}){this['isRunning']||(this['isRunning']=!0x0,this['isUserPaused']=!0x1,this['scrollBehavior']=_0xca1f93?'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'](_0x3e3f34){if(this['isRunning']){if('keydown'===_0x3e3f34['type']){const _0x5e9ddc=_0x3e3f34['key'];if(!ir['includes'](_0x5e9ddc))return;}_0x3e3f34 instanceof WheelEvent?_0x3e3f34['deltaY']<0x0?this['isUserPaused']=!0x0:this['isUserPaused']=!this['_isAtBottom']():this['isUserPaused']=!0x0;}}['_isAtBottom'](){const {scrollTop:_0xfd406b,scrollHeight:_0xb50040,clientHeight:_0x3a9552}=this['element'];return _0xb50040-_0xfd406b-_0x3a9552<=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(_0x9875bf){super(_0x9875bf),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(_0x2b763a,_0x3fef5e){super(_0x2b763a),this['_bodyCollection']=_0x3fef5e,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'](_0x523023,_0x3d54b5){let _0x4c8c1b;return'ai-reply'===_0x523023?_0x4c8c1b=new vn(this['locale'],_0x3d54b5,this['_bodyCollection']):'ai-suggestion-reply'===_0x523023?(_0x4c8c1b=new Nn(this['locale'],_0x3d54b5,this['_bodyCollection']),_0x4c8c1b['bind']('isTrackChangesOn')['to'](this)):_0x4c8c1b='user-message'===_0x523023?new Jn(this['locale'],_0x3d54b5,this['_bodyCollection']):'interaction-header'===_0x523023?new Zn(this['locale'],_0x3d54b5):'custom-element'===_0x523023?new nr(_0x3d54b5):new wn(_0x3d54b5),this['children']['add'](_0x4c8c1b),_0x4c8c1b;}async['updateReplyItem']({id:_0x20fc32,parsedContent:_0x541cd9,renderingStrategy:_0x4da781,abortSignal:_0x55887e}){const _0x4f261a=this['getItemById'](_0x20fc32);if(!(_0x4f261a instanceof vn))throw new at('ai-chat-feed-view-item-not-a-reply-item',null,{'itemView':_0x4f261a,'id':_0x20fc32,'parsedContent':_0x541cd9});await _0x4f261a['updateContent']({'parsedContent':_0x541cd9,'renderingStrategy':_0x4da781,'abortSignal':_0x55887e});}async['updateWebSources'](_0x529226,_0x4d6042){const _0x1070ad=this['getItemById'](_0x529226);if(_0x1070ad instanceof Nn)_0x1070ad['updateSources'](_0x4d6042);else{if(!(_0x1070ad instanceof vn))throw new at('ai-chat-feed-view-item-not-a-suggestion-or-reply-item',null,{'itemView':_0x1070ad,'id':_0x529226,'sources':_0x4d6042});_0x1070ad['updateSources'](_0x4d6042);}}async['updateSuggestionItem']({id:_0x1e03ed,parts:_0x2c4529,abortSignal:_0xd340b8,skipLoadingEffects:_0x170bbf}){const _0x57330d=this['getItemById'](_0x1e03ed);if(!(_0x57330d instanceof Nn))throw new at('ai-chat-feed-view-item-not-a-suggestion-item',null,{'itemView':_0x57330d,'id':_0x1e03ed,'parts':_0x2c4529});await _0x57330d['updateContent']({'parts':_0x2c4529,'abortSignal':_0xd340b8,'skipLoadingEffects':_0x170bbf});}['updateSuggestionPartState']({id:_0x2aac70,index:_0x1ac74d,state:_0x584928}){const _0x9a3a21=this['getItemById'](_0x2aac70);if(!(_0x9a3a21 instanceof Nn))throw new at('ai-chat-feed-view-item-not-a-suggestion-item',this,{'id':_0x2aac70});_0x9a3a21['updatePartState'](_0x1ac74d,_0x584928);}['setSuggestionPartActive']({id:_0x2f9dc9,index:_0x4bc347,isActive:_0x252435}){const _0x2b1025=this['getItemById'](_0x2f9dc9);if(!(_0x2b1025 instanceof Nn))throw new at('ai-chat-feed-view-item-not-a-suggestion-item',this,{'id':_0x2f9dc9});this['children']['filter'](_0x26eefb=>_0x26eefb instanceof Nn)['forEach'](_0x411b6c=>{_0x411b6c['setPartActive'](!0x1);}),_0x2b1025['setPartActive'](_0x4bc347,_0x252435);}['markItemAsDone'](_0x5268e5){this['getItemById'](_0x5268e5)['markAsDone']();}['getItemIds'](){return this['children']['map'](_0x4e6ffb=>_0x4e6ffb['options']['id']);}['removeItem'](_0x333aaa){this['children']['remove'](this['getItemById'](_0x333aaa));}['hasItem'](_0x265ebe){return!!this['children']['find'](_0x5ea8e6=>_0x5ea8e6['options']['id']['includes'](_0x265ebe));}['scrollToSuggestion'](_0x4874fe,_0x2cbc13){const _0x5f1f0c=this['getItemById'](_0x4874fe);if(!(_0x5f1f0c instanceof Nn))return void It('ck-ai-chat-feed-view-scroll-to-suggestion-invalid-item',{'replyId':_0x4874fe,'partIndex':_0x2cbc13});const _0x3c8f75=_0x5f1f0c['getPartView'](_0x2cbc13);_0x3c8f75?ft(_0x3c8f75['element'],0x14,this['element']['parentElement'],!0x0,!0x0):It('ck-ai-chat-feed-view-scroll-to-suggestion-part-view-not-found',{'replyId':_0x4874fe,'partIndex':_0x2cbc13});}['_setupTemplate'](){this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed']},'children':this['_createTemplateChildren']()});}['_createTemplateChildren'](){const _0x26f2c9=this['_createSkeletonLoader']();return[this['_createFeedItems'](),_0x26f2c9,this['_createFeedLoader']()];}['_createSkeletonLoader'](){const _0x33308c=new pn(this['locale'],mn['aiFeed']);return _0x33308c['bind']('isVisible')['to'](this,'isLoadingSkeletonVisible'),_0x33308c;}['_createFeedItems'](){const _0x5a11d8=new vt(this['locale']);return _0x5a11d8['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed__items',this['bindTemplate']['if']('isLoadingSkeletonVisible','ck-hidden')]},'children':this['children']}),_0x5a11d8;}['_createFeedLoader'](){const _0x1b3d48=new vt(this['locale']);return _0x1b3d48['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__loader',this['bindTemplate']['if']('loadingMessage','ck-hidden',_0x35dc88=>!_0x35dc88)]},'children':this['_createLoaderChildren']()}),_0x1b3d48;}['_createLoaderChildren'](){const _0x244afd=new yn();return _0x244afd['isVisible']=!0x0,[_0x244afd,{'tag':'span','attributes':{'class':['ck','ck-ai-chat__loader-text']},'children':[{'text':this['bindTemplate']['to']('loadingMessage')}]}];}['getItemById'](_0x3b2f64){const _0x5ba384=this['children']['find'](_0x2ea5fa=>_0x2ea5fa['options']['id']['includes'](_0x3b2f64));if(!_0x5ba384)throw new at('ai-chat-feed-view-item-not-found',this,{'id':_0x3b2f64});return _0x5ba384;}['setLoadingMessage'](_0x3e1d23){this['set']('loadingMessage',_0x3e1d23);}['toggleLoadingSkeleton'](_0x44d806){this['set']('isLoadingSkeletonVisible',_0x44d806);}['startAutoScroll'](_0xcf8aaf={}){this['scrollManager']['start'](_0xcf8aaf);}['stopAutoScroll'](){this['scrollManager']['stop']();}}class or extends Dt{['filter'](){let _0x551bdd=0x0;for(const _0x4e3a05 of this['items'])_0x551bdd+=_0x4e3a05['items']['length'];return{'resultsCount':_0x551bdd,'totalItemsCount':_0x551bdd};}}const ar='ck-ai-chat__prompt-input_highlighted';class hr extends Lt{['submitButtonView'];static ['MIN_ROWS']=0x1;static ['MAX_ROWS']=0xc;['_addContextButtonView'];['_queryViewResizeObserver'];constructor(_0x4b549a,_0xa4d0c){super(_0x4b549a,{'queryView':{'label':'','creator':Vt,'showIcon':!0x1,'showResetButton':!0x1},'filteredView':new or(_0x4b549a),'queryMinChars':0x1/0x0,'resetOnBlur':!0x1}),this['set']('isEmpty',!0x0),this['set']('isUploadInProgress',!0x1),this['_addContextButtonView']=_0xa4d0c,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',(_0x8d7a45,_0x147ba3)=>!_0x8d7a45&&!_0x147ba3),this['focusableChildren']['add'](this['submitButtonView']);}['render'](){super['render'](),this['queryView']['fieldWrapperChildren']['add'](this['submitButtonView']),this['keystrokes']['set']('enter',(_0x15bcf9,_0x272e4c)=>{this['isUploadInProgress']||this['isEmpty']||_0x15bcf9['target']==this['queryView']['fieldView']['element']&&(this['submit'](),_0x272e4c());}),this['queryView']['fieldView']['on']('update',()=>{this['isEmpty']=''===this['queryView']['fieldView']['element']['value']?.['trim']();});}['destroy'](){super['destroy'](),this['_queryViewResizeObserver']&&this['_queryViewResizeObserver']['destroy']();}['submit'](){const _0x73f7ca=this['queryView']['fieldView']['element']['value']?.['trim']();if(!_0x73f7ca)return this['queryView']['errorText']=hs(this['locale'],'AI_CHAT_PROMPT_EMPTY_ERROR'),void(this['queryView']['fieldView']['hasError']=!0x0);this['queryView']['fieldView']['hasError']=!0x1;const _0x3053b4=_0x321d30(_0x73f7ca);this['fire']('sendUserMessage',_0x3053b4),this['queryView']['fieldView']['reset']();}['setPlaceholderText'](_0x45edae){this['queryView']['fieldView']['set']('placeholder',_0x45edae);}['focus'](_0x11fcb1=!0x1){super['focus'](),_0x11fcb1&&(this['element']['classList']['contains'](ar)||(this['element']['classList']['add'](ar),setTimeout(()=>{this['element']['classList']['remove'](ar);},0x320)));}['_createSubmitButton'](){const _0x2f9d50=new Nt(this['locale']);return _0x2f9d50['set']({'icon':_0xc81d82,'label':hs(this['locale'],'AI_CHAT_LABEL_SUBMIT'),'isVisible':!0x0,'tooltip':!0x0,'class':'ck-ai-chat__prompt-submit-button\x20'+cs,'isEnabled':!0x1}),_0x2f9d50['on']('execute',()=>{this['submit']();}),_0x2f9d50;}['setIsUploadInProgress'](_0x55399a){this['isUploadInProgress']=_0x55399a;}['_setUpAddContextButtonPositioning'](){const _0x59aa37=this['locale'],_0x210d3d=()=>{ct['window']['requestAnimationFrame'](()=>{if(lt(this['element'])){const _0x213d86=new ut(this['queryView']['fieldView']['element']),_0x214ef7=new ut(this['_addContextButtonView']['element']),_0x1355f0=_0x213d86['width'],_0x41f957='rtl'===_0x59aa37['uiLanguageDirection']?'right':'left';_0x213d86['excludeScrollbarsAndBorders']();const _0x421e35=_0x1355f0-_0x213d86['width']+0x1;this['_addContextButtonView']['element']['style'][_0x41f957]='calc('+(_0x1355f0-_0x214ef7['width']-_0x421e35)+'px\x20-\x20var(--ck-spacing-tiny))';}});};this['queryView']['fieldView']['on']('update',_0x210d3d),this['on']('render',()=>{_0x210d3d(),this['_queryViewResizeObserver']=new bt(this['queryView']['fieldView']['element'],()=>{_0x210d3d();});});}}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(_0x5c036b){super(_0x5c036b),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',_0x90c440=>'selector'===_0x90c440),this['_modelSelectionDropdown']['buttonView']['bind']('tooltip')['to'](this,'modelSelectorEnabled',_0xdf5ee7=>_0xdf5ee7?this['_modelSelectionDropdown']['buttonView']['label']:hs(this['locale'],'AI_CHAT_MODEL_SELECTOR_DISABLED_TOOLTIP')),this['_modelSelectionDropdown']['bind']('isEnabled')['to'](this,'modelSelectorEnabled',_0x153d81=>_0x153d81),this['_webSearchButton']['bind']('isOn')['to'](this,'webSearchActive',_0x5511cc=>_0x5511cc),this['_webSearchButton']['bind']('tooltip')['to'](this,'webSearchActive',_0x2ca58c=>hs(this['locale'],_0x2ca58c?'AI_CHAT_DISABLE_WEB_SEARCH':'AI_CHAT_ENABLE_WEB_SEARCH')),this['_reasoningButton']['bind']('isOn')['to'](this,'reasoningActive',_0x3d4986=>_0x3d4986),this['_reasoningButton']['bind']('tooltip')['to'](this,'reasoningActive',_0x56d0ca=>hs(this['locale'],_0x56d0ca?'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'](_0x4d1191,_0x223028){if(_0x223028)this['set']('modelDisplayMode','hidden');else{const _0x268f3c=0x1===_0x4d1191['length'];this['set']('modelDisplayMode',_0x268f3c?'name':'selector');}if(this['_modelSelectionDropdownItems']['clear'](),_0x4d1191?.['length'])for(const _0xdbb621 of _0x4d1191){const _0x97b756=new Jt({'label':_0xdbb621['name'],'withText':!0x0,'role':'menuitemradio','id':_0xdbb621['id'],'model':_0xdbb621});_0x97b756['bind']('isOn')['to'](this,'activeModelId',_0x3a47d3=>_0x3a47d3===_0xdbb621['id']),this['_modelSelectionDropdownItems']['add']({'type':'button','model':_0x97b756,'labelView':new pr(this['locale'],_0xdbb621)});}}['setWebSearch'](_0x92af94){this['set']('webSearchActive',_0x92af94);}['setReasoning'](_0x27bd37){this['set']('reasoningActive',_0x27bd37);}['setModel'](_0xa4f102){if(!_0xa4f102)return;this['activeModelId']=_0xa4f102['id'],this['activeModelName']=_0xa4f102['name']||_0xa4f102['id'],this['_modelSelectionDropdown']['buttonView']['set']('label',_0xa4f102['name']),this['_modelSelectionDropdown']['buttonView']['set']('tooltip',_0xa4f102['name']);const _0x541a7c=_0xa4f102['capabilities']['webSearch']?.['enabled']??!0x1;this['set']('webSearchActive',!0x1),this['_webSearchButton']['set']('isOn',!0x1),this['_webSearchButton']['set']('isEnabled',_0x541a7c),this['_webSearchButton']['set']('isVisible',_0x541a7c);const _0x172b21=_0xa4f102['capabilities']['reasoning']?.['enabled']??!0x1;this['set']('reasoningActive',!0x1),this['_reasoningButton']['set']('isOn',!0x1),this['_reasoningButton']['set']('isEnabled',_0x172b21),this['_reasoningButton']['set']('isVisible',_0x172b21);}['enableModelSelector'](){this['set']('modelSelectorEnabled',!0x0);}['disableModelSelector'](_0x14e55d){this['set']('modelSelectorEnabled',!0x1),_0x14e55d&&this['set']('modelDisplayMode','hidden');}['_createWebSearchButton'](){const _0x5778f0=new Nt();return _0x5778f0['set']({'label':hs(this['locale'],'AI_CHAT_SEARCH_WEB'),'icon':_0x3bebb8,'class':lr+'\x20'+us,'isToggleable':!0x0,'tooltipPosition':Ir}),_0x5778f0['on']('execute',()=>{this['fire']('toggleWebSearch');}),_0x5778f0;}['_createReasoningButton'](){const _0x54233c=new Nt();return _0x54233c['set']({'label':hs(this['locale'],'AI_CHAT_REASONING'),'icon':_0x3cfa5e,'class':lr+'\x20'+us,'isToggleable':!0x0,'tooltipPosition':Ir}),_0x54233c['on']('execute',()=>{this['fire']('toggleReasoning');}),_0x54233c;}['_createCommandsButton'](){const _0x20d50c=new Nt();return _0x20d50c['set']({'label':hs(this['locale'],'AI_CHAT_COMMANDS'),'icon':_0x61e59f,'withText':!0x0,'class':lr+'\x20'+us,'isToggleable':!0x0,'tooltip':hs(this['locale'],'AI_CHAT_COMMANDS'),'tooltipPosition':Ir}),_0x20d50c['extendTemplate']({'attributes':{'class':[ur]}}),_0x20d50c['on']('execute',()=>{console['log']('Commands\x20are\x20not\x20implemented\x20yet.'),alert('Commands\x20are\x20not\x20implemented\x20yet.');}),_0x20d50c;}['_createModelSelectionDropdown'](){const _0x320cec=Gt(this['locale']);return _0x320cec['set']({'panelPosition':'ne','class':[dr]}),_0x320cec['buttonView']['set']({'label':hs(this['locale'],'AI_CHAT_MODEL_SELECTOR_ENABLED_TOOLTIP'),'withText':!0x0,'tooltip':!0x0,'tooltipPosition':Ir,'class':us}),this['listenTo'](_0x320cec,'execute',_0x257c0e=>{this['fire']('selectModel',_0x257c0e['source']['model']);}),_0x320cec;}['_createModelNameView'](){const _0x429081=new mr(this['locale']);return _0x429081['bind']('text')['to'](this,'activeModelName',_0x386f28=>_0x386f28??''),_0x429081['bind']('isVisible')['to'](this,'modelDisplayMode',_0x1ecc34=>'name'===_0x1ecc34),_0x429081;}}let pr=class extends Mt{constructor(_0x5ee293,_0x386975){super();const _0x1f8167=this['bindTemplate'],_0xe1ad39=this['createCollection']();this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-button__label'],'style':_0x1f8167['to']('style'),'id':_0x1f8167['to']('id')},'children':[{'tag':'div','attributes':{'class':[_r]},'children':[{'text':_0x1f8167['to']('text')}]},{'tag':'div','attributes':{'class':[gr]},'children':[{'tag':'span','children':[{'text':_0x386975['description']}]}]},{'tag':'div','attributes':{'class':[Ar]},'children':_0xe1ad39}]}),_0xe1ad39['addMany'](this['_getCapabilityParts'](_0x5ee293,_0x3bebb8,'AI_CHAT_SEARCH_WEB',_0x386975['capabilities']['webSearch']?.['enabled']??!0x1)),_0xe1ad39['addMany'](this['_getCapabilityParts'](_0x5ee293,_0x3cfa5e,'AI_CHAT_REASONING',_0x386975['capabilities']['reasoning']?.['enabled']??!0x1));}['_getCapabilityParts'](_0x3b3ef9,_0x5077e7,_0xa0b798,_0xc6472a){const _0x5295fa=new xt();_0x5295fa['content']=_0x5077e7;const _0x3a33d0=new vt(_0x3b3ef9);_0x3a33d0['setTemplate']({'tag':'span','children':[{'text':hs(_0x3b3ef9,_0xa0b798)+':\x20'}]});const _0x4067e4=new vt(_0x3b3ef9);return _0x4067e4['setTemplate']({'tag':'span','children':[{'text':hs(_0x3b3ef9,_0xc6472a?'AI_CHAT_CAPABILITIES_YES':'AI_CHAT_CAPABILITIES_NO')}]}),[_0x5295fa,_0x3a33d0,_0x4067e4];}},mr=class extends vt{constructor(_0x4d795b){super(_0x4d795b),this['set']('text',void 0x0),this['set']('isVisible',!0x0);const _0x6b7c91=this['bindTemplate'];this['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai-chat-controls__model-name',_0x6b7c91['if']('isVisible','ck-hidden',_0x476493=>!_0x476493)]},'children':[{'text':_0x6b7c91['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(_0x2e7daa){super(_0x2e7daa),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'](_0x5be6c9=>{this['focusTracker']['add'](_0x5be6c9['element']),this['keystrokes']['listenTo'](_0x5be6c9['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'](_0x4ffc2a){this['urlInputField']['errorText']=_0x4ffc2a,this['_updateConfirmButtonState'](),this['fire']('refreshBalloon');}['clearError'](){this['urlInputField']['errorText']=null,this['_updateConfirmButtonState']();}['_createBackButton'](){const _0x491b52=new Nt(this['locale']);return _0x491b52['set']({'icon':_0x216998,'tooltip':hs(this['locale'],'AI_CHAT_CONTEXT_URL_BACK_TO_CONTEXT'),'tooltipPosition':'n','class':['ck-button-icon\x20ck-button-back']}),this['on']('change:withBackButton',(_0x74ee6f,_0x342f3e,_0x2ac3cb)=>{_0x491b52['set']({'class':['ck-button-icon\x20ck-button-back'+(_0x2ac3cb?'':'\x20ck-hidden')]});}),_0x491b52;}['_createUrlInputField'](){const _0x211bf8=new te(this['locale'],_0x42c81c);return _0x211bf8['set']({'label':hs(this['locale'],'AI_CHAT_CONTEXT_URL_LABEL'),'class':'ck-labeled-field-view_empty'}),_0x211bf8['fieldView']['set']({'placeholder':hs(this['locale'],'AI_CHAT_CONTEXT_URL_PLACEHOLDER')}),_0x211bf8;}['_createConfirmButton'](){const _0x3b4304=new Nt(this['locale']);return _0x3b4304['set']({'icon':_0xaff33c,'tooltip':hs(this['locale'],'AI_CHAT_CONTEXT_URL_ADD_URL'),'tooltipPosition':'n','class':'ck-button-icon','type':'submit','isEnabled':!0x1}),_0x3b4304;}['_setupTemplate'](){const _0x4a95b7=new _0x484303(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'});_0x4a95b7['children']['add'](this['backButton'],0x0),this['setTemplate']({'tag':'form','attributes':{'class':Tr,'tabindex':'-1'},'children':[_0x4a95b7,{'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',_0x276d05=>{_0x276d05['stop'](),this['_handleSubmit']();});}['_setupKeystrokes'](){this['keystrokes']['set']('esc',(_0x30fc3a,_0x1ec379)=>{this['clear'](),this['fire']('cancel'),_0x1ec379();});}['_handleSubmit'](){const _0x2b6532=this['getValue']()['trim']();_0x2b6532?this['_isValidUrl'](_0x2b6532)?(this['clearError'](),this['fire']('submitUrl',_0x2b6532)):this['setError'](hs(this['locale'],'AI_CHAT_CONTEXT_URL_INVALID_ERROR')):this['setError'](hs(this['locale'],'AI_CHAT_CONTEXT_URL_EMPTY_ERROR'));}['_updateConfirmButtonState'](){const _0x2ace8c=this['getValue']()['trim'](),_0x1297e4=!!this['urlInputField']['errorText'];this['confirmButton']['isEnabled']=_0x2ace8c['length']>0x0&&!_0x1297e4;}['_isValidUrl'](_0x34dbc5){try{return!!new URL(_0x34dbc5);}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(_0x35b52b,_0x18605d){super(_0x35b52b),this['resource']=_0x18605d,this['set']('isInContext',!!_0x18605d['isInContext']),this['_titleView']=this['_createTitleView'](),this['_iconView']=this['_createIconView'](),this['_setupTemplate']();}['render'](){super['render']();}['getResourceIcon'](_0x4f46f6){if(_0x4f46f6['isInContext'])return _0xaff33c;switch(_0x4f46f6['type']){case'document':return _0x22e392;case'web-resource':return _0x5ea46a;case'file':case'text':return _0x3f3bf7;default:return _0xc2c70c;}}['highlightText'](_0x207dfc){if(!_0x207dfc||''===_0x207dfc['trim']())return void this['_titleView']['highlightText'](null);const _0x29669b=new RegExp(_0x4f9813(_0x207dfc),'gi');this['_titleView']['highlightText'](_0x29669b);}['updateResourceState'](_0x5a4c0d){this['resource']['isInContext']=_0x5a4c0d,this['isInContext']=_0x5a4c0d,this['_updateIcon']();}['_createTitleView'](){const _0x432ede=new _0x4a528a();return _0x432ede['text']=this['resource']['label'],_0x432ede['extendTemplate']({'tag':'span','attributes':{'class':[Sr]}}),_0x432ede;}['_createIconView'](){const _0x30dad8=new xt();return _0x30dad8['content']=this['getResourceIcon'](this['resource']),_0x30dad8;}['_setupTemplate'](){const _0x5c1ec9=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':[fr,_0x5c1ec9['if']('isVisible','ck-hidden',_0x253edf=>!_0x253edf),_0x5c1ec9['if']('isInContext',br)]},'children':[{'tag':'div','attributes':{'class':[Rr]},'children':[this['_iconView']]},this['_titleView']],'on':{'click':_0x5c1ec9['to']('execute')}});}['_updateIcon'](){this['_iconView']['content']=this['getResourceIcon'](this['resource']);}}const kr='ck-ai-chat-resources__list';class Nr extends Dt{['_source'];constructor(_0x14cf31,_0x176912){super(_0x14cf31),this['_source']=_0x176912,this['extendTemplate']({'attributes':{'class':[kr]}});}['setResources'](_0x4edaee,_0x2a190f){this['items']['clear']();let _0x106a98=_0x4edaee;if(this['_source']['useDefaultFiltering']&&_0x2a190f&&''!==_0x2a190f['trim']()){const _0x880bd5=new RegExp(_0x2a190f['replace'](/[.*+?^${}()|[\]\\]/g,'\x5c$&'),'gi');_0x106a98=_0x4edaee['filter'](_0x431dc7=>_0x880bd5['test'](_0x431dc7['label']));}for(const _0x3adcb1 of _0x106a98){const _0x146ab6=new Or(this['locale'],_0x3adcb1);_0x146ab6['on']('execute',()=>{this['_handleResourceSelection'](this['_source'],_0x3adcb1);}),this['items']['add'](_0x146ab6);}this['_source']['useDefaultFiltering']&&this['highlightText'](_0x2a190f);}['highlightText'](_0x3073f7){this['_source']['useDefaultFiltering']&&this['items']['forEach'](_0x401e3a=>{_0x401e3a['highlightText'](_0x3073f7);});}['updateResourceState'](_0x3af3d5,_0x2f2925){for(const _0x1beaa4 of this['items']){const _0x530f9c=_0x1beaa4;_0x530f9c['resource']['id']===_0x3af3d5&&_0x530f9c['updateResourceState'](_0x2f2925);}}['_handleResourceSelection'](_0x50d52f,_0x9b46e2){this['fire']('addResourceToContext',{'source':_0x50d52f,'resource':_0x9b46e2});}}class vr extends te{['iconView'];['resetButtonView'];['_viewConfig'];constructor(_0x78f125){const t=_0x78f125['t'],_0x1de2d8={'showResetButton':!0x0,'showIcon':!0x0,'creator':_0x42c81c,'label':hs(_0x78f125,'AI_CHAT_SEARCH_RESOURCES')};super(_0x78f125,_0x1de2d8['creator']),this['label']=_0x1de2d8['label'],this['_viewConfig']=_0x1de2d8,this['_viewConfig']['showIcon']&&this['_setupSearchIcon'](),this['_viewConfig']['showResetButton']&&this['_setupResetButton'](_0x78f125,t),this['_setupEventListeners']();}['reset'](){this['fieldView']['reset'](),this['_viewConfig']['showResetButton']&&this['resetButtonView']&&(this['resetButtonView']['isVisible']=!0x1),this['search']('');}['search'](_0x3a6b5b){this['fire']('search',_0x3a6b5b);}['getQuery'](){return this['fieldView']['element']?.['value']||'';}['_setupSearchIcon'](){this['iconView']=new xt(),this['iconView']['content']=_0x126c35,this['fieldWrapperChildren']['add'](this['iconView'],0x0),this['extendTemplate']({'attributes':{'class':'ck-search__query_with-icon'}});}['_setupResetButton'](_0x3a4dc2,t){this['resetButtonView']=new Nt(_0x3a4dc2),this['resetButtonView']['set']({'label':t('Clear'),'icon':_0x5adff9,'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',_0x1a40c3=>!_0x1a40c3),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(_0x377bb2,_0x2c28cb){super(_0x377bb2),this['_source']=_0x2c28cb['source'],this['_searchInputVisibleFrom']=_0x2c28cb['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 _0x54e610([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 _0x2a9a4e=new vt(this['locale']);return _0x2a9a4e['setTemplate']({'tag':'div','attributes':{'class':'ck\x20ck-search'},'children':[this['_searchView']]}),this['_searchView']['on']('search',(_0x28340e,_0x591609)=>{this['loadResources'](_0x591609),this['_source']['useDefaultFiltering']&&this['_resourcesListView']['highlightText'](_0x591609);}),_0x2a9a4e;}['_createResourcesListView'](){const _0x5f03e4=new Nr(this['locale'],this['_source']);return _0x5f03e4['delegate']('addResourceToContext')['to'](this),_0x5f03e4['extendTemplate']({'attributes':{'class':this['bindTemplate']['if']('isLoading','ck-hidden')}}),_0x5f03e4;}['_createSkeletonView'](){const _0x3152aa=new pn(this['locale'],mn['aiChatResources']);return _0x3152aa['bind']('isVisible')['to'](this,'isLoading'),_0x3152aa;}['render'](){super['render'](),this['loadResources']('');}['loadResources'](_0x32b1d9){const _0xaa7ed=ot();this['_latestLoadResourcesUid']=_0xaa7ed,this['fire']('loadSourceResources',{'sourceId':this['_source']['id'],'query':_0x32b1d9,'uid':_0xaa7ed}),this['isLoading']=!0x0;}['setResources'](_0x54b3af,_0x284730){if(_0x284730&&_0x284730!==this['_latestLoadResourcesUid'])return;const _0x18cbde=this['_source']['useDefaultFiltering']?this['_searchView']['getQuery']():'';this['_resourcesListView']['setResources'](_0x54b3af,_0x18cbde),_0x54b3af['length']>=this['_searchInputVisibleFrom']&&!this['children']['has'](this['_searchSection'])&&this['children']['add'](this['_searchSection'],0x0),requestAnimationFrame(()=>{this['isLoading']=!0x1;});}['updateResourceState'](_0x3d812e,_0x3aaa57){this['_resourcesListView']['updateResourceState'](_0x3d812e,_0x3aaa57);}}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(_0x4712b9,_0x134278,_0x2f9339){this['_locale']=_0x4712b9,this['_bodyCollection']=_0x134278,this['_config']=_0x2f9339;}['showSourceResourcesBalloon']({source:_0x18c57d,withBackButton:_0x3f964f}){let _0x2cbf4c=this['_sourceResourceBalloons']['get'](_0x18c57d['id']);_0x2cbf4c||(_0x2cbf4c=this['_createSourceResourceBalloonPanel'](),this['_sourceResourceBalloons']['set'](_0x18c57d['id'],_0x2cbf4c),this['_setupSingleResourceBalloonClickOutsideHandler'](_0x2cbf4c)),this['_addSourceResourceContent']({'balloonPanel':_0x2cbf4c,'source':_0x18c57d,'withBackButton':_0x3f964f}),_0x2cbf4c['show']();const _0x698876=this['_config']['getTargetElement']();_0x698876&&_0x2cbf4c['pin']({'target':_0x698876,'limiter':this['_config']['getLimiterElement']()});}['populateSourceResourceBalloon'](_0x338977,_0x37df88,_0x3c4892){const _0x431666=this['_sourceResourceBalloons']['get'](_0x338977);if(!_0x431666)return;const _0x2da840=this['_getResourcesViewFromBalloon'](_0x431666);_0x2da840&&(_0x2da840['setResources'](_0x37df88,_0x3c4892),_0x2da840['once']('change:isLoading',()=>{_0x431666['pin']({'target':this['_config']['getTargetElement'](),'limiter':this['_config']['getLimiterElement']()});}));}['closeSourceResourceBalloon'](_0x21f5fc){const _0x51a495=this['_sourceResourceBalloons']['get'](_0x21f5fc);_0x51a495&&requestAnimationFrame(()=>{_0x51a495['hide'](),this['_sourceResourceBalloons']['delete'](_0x21f5fc),this['_config']['onBalloonClosed']();});}['isAnyResourceBalloonVisible'](){for(const _0x570448 of this['_sourceResourceBalloons']['values']())if(_0x570448['isVisible'])return!0x0;return!0x1;}['updateResourceState'](_0x21b3a4,_0x24ddc9,_0x11321b){const _0x49dcae=this['_sourceResourceBalloons']['get'](_0x21b3a4);if(!_0x49dcae||!_0x49dcae['isVisible'])return;const _0xb1297=this['_config']['getTargetElement']();if(!_0xb1297)return;_0x49dcae['pin']({'target':_0xb1297,'limiter':this['_config']['getLimiterElement']()});const _0x392739=this['_getResourcesViewFromBalloon'](_0x49dcae);_0x392739&&_0x392739['updateResourceState'](_0x24ddc9,_0x11321b);}['destroy'](){for(const _0x1c56f8 of this['_sourceResourceBalloons']['values']())_0x1c56f8['destroy']();this['_sourceResourceBalloons']['clear']();}['_createSourceResourceBalloonPanel'](){const _0x3032eb=new Xt(this['_locale']);return _0x3032eb['extendTemplate']({'attributes':{'class':xr}}),this['_bodyCollection']['add'](_0x3032eb),_0x3032eb;}['_addSourceResourceContent']({balloonPanel:_0x6f294b,source:_0x4f47bb,withBackButton:_0x44a93d}){_0x6f294b['content']['clear']();const _0x329485=this['_createBalloonHeader']({'balloonPanel':_0x6f294b,'source':_0x4f47bb,'withBackButton':_0x44a93d});_0x6f294b['content']['add'](_0x329485);const _0xb16e0f=this['_createBalloonResourcesView'](_0x4f47bb);_0x6f294b['content']['add'](_0xb16e0f);}['_createBalloonHeader']({balloonPanel:_0x5e27ff,source:_0x2117ff,withBackButton:_0x5e68a0}){const _0x2bef44=new _0x484303(this['_locale'],{'label':_0x2117ff['label'],'class':Dr});return _0x5e68a0&&_0x2bef44['children']['add'](this['_createBackButton'](_0x5e27ff),0x0),_0x2bef44;}['_createBackButton'](_0x5ee533){const _0x2703f0=new Nt(this['_locale']);return _0x2703f0['set']({'icon':_0x216998,'tooltip':hs(this['_locale'],'AI_CHAT_CONTEXT_URL_BACK_TO_CONTEXT'),'tooltipPosition':'n','class':Lr}),_0x2703f0['on']('execute',()=>{_0x5ee533['hide'](),this['_config']['onBackToContext']();}),_0x2703f0;}['_createBalloonResourcesView'](_0x422d4a){const _0xee1bfd=new yr(this['_locale'],{'source':_0x422d4a,'searchInputVisibleFrom':this['_config']['searchInputVisibleFrom']});return _0xee1bfd['on']('loadSourceResources',(_0xa17f14,_0x27d6fe)=>{this['_config']['onLoadSourceResources'](_0x27d6fe);}),_0xee1bfd['on']('addResourceToContext',(_0x31d3d6,_0x19f86a)=>{this['_config']['onResourceSelected'](_0x19f86a['source'],_0x19f86a['resource']),this['closeSourceResourceBalloon'](_0x422d4a['id']);}),_0xee1bfd;}['_getResourcesViewFromBalloon'](_0x30a1a5){const _0x5b5919=_0x30a1a5['content']['get'](0x1);return _0x5b5919 instanceof yr?_0x5b5919:null;}['_setupSingleResourceBalloonClickOutsideHandler'](_0xe059f8){zt({'emitter':_0xe059f8,'contextElements':[_0xe059f8['element']],'callback':()=>{_0xe059f8['hide'](),this['_config']['onBalloonClosed']();},'activator':()=>_0xe059f8['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(_0xfe353b,_0x566fa6){super(_0xfe353b),this['bodyCollection']=_0x566fa6['bodyCollection'],this['_currentContextsChips']=this['createCollection'](),this['_conversationContextsChips']=this['createCollection'](),this['addContextButtonView']=this['_createAddContextButtonView'](_0xfe353b),this['_addContextBalloonPanelView']=this['_createAddContextBalloonPanelView'](_0xfe353b),this['_urlBalloonPanelView']=this['_createUrlBalloonPanelView'](_0xfe353b),this['_resourcesBalloonView']=this['_createResourcesBalloonView'](_0xfe353b,_0x566fa6);const _0x1851e6={'cssClasses':{'showMoreButton':$r+'\x20'+us,'showMoreBalloon':qr,'overflowContainer':Yr,'controlsButton':Wr}};this['_overflowManager']=new Wn(_0xfe353b,this['_currentContextsChips'],_0x1851e6,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'](_0x5d3d2f,_0x2637e7){const _0x5c2c25=this['_createContextButton'](_0x5d3d2f,'current',!0x0,_0x2637e7);this['_addContextToCollection'](_0x5c2c25,this['_currentContextsChips']),this['_overflowManager']['reorganizeChips']();}['removeContextItem'](_0x3eff5a){this['_removeContextFromCollection'](_0x3eff5a,this['_currentContextsChips']),this['_removeContextFromCollection'](_0x3eff5a,this['_overflowManager']['overflowChips']),this['_overflowManager']['reorganizeChips']();}['setContextItemLoading'](_0x251da8,_0xfe6e90){let _0x38125b=this['_currentContextsChips']['find'](_0x452f00=>_0x452f00['id']===_0x251da8);_0x38125b||(_0x38125b=this['_overflowManager']['overflowChips']['find'](_0x41b7aa=>_0x41b7aa['id']===_0x251da8)),_0x38125b&&(_0x38125b['isLoading']=_0xfe6e90);}['setConversationContext'](_0x557c09){this['_conversationContextsChips']['clear']();for(const _0x1558f0 of _0x557c09){const _0x3b8e55=this['_createContextButton'](_0x1558f0,'conversation',!0x1,!0x1);this['_addContextToCollection'](_0x3b8e55,this['_conversationContextsChips']);}}['clearCurrentContextItems'](){this['_currentContextsChips']['clear'](),this['_overflowManager']['clear']();}['clearConversationContextItems'](){this['_conversationContextsChips']['clear']();}['updateResourceState'](_0x1ecbe6,_0x527e6b,_0x15fa2a){this['_resourcesBalloonView']['updateResourceState'](_0x1ecbe6,_0x527e6b,_0x15fa2a);}['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:_0x464665,withBackButton:_0x5aa770}){this['_resourcesBalloonView']['showSourceResourcesBalloon']({'source':_0x464665,'withBackButton':_0x5aa770}),this['addContextButtonView']['isOn']=!0x0;}['populateSourceResourceBalloon'](_0x707c51,_0x47c3d7,_0x3a670e,_0x8b42c4){this['_resourcesBalloonView']['populateSourceResourceBalloon'](_0x707c51,_0x3a670e,_0x8b42c4);}['closeSourceResourceBalloon'](_0x2eb71e){this['_resourcesBalloonView']['closeSourceResourceBalloon'](_0x2eb71e),this['addContextButtonView']['isOn']=!0x1;}['setAddContextOptions'](_0x10e2f2){this['_setBalloonPanelContent'](this['_addContextBalloonPanelView'],this['locale'],_0x10e2f2),this['_setAddContextButtonEnabled'](_0x10e2f2);}['_setAddContextButtonEnabled'](_0x2a1e31){const _0x17b0fb=!_0x2a1e31['document']['isHidden']&&_0x2a1e31['document']['enabled'],_0x34aaea=_0x2a1e31['urls']['enabled'],_0x4b7de7=_0x2a1e31['files']['enabled'],_0x30e153=_0x2a1e31['sources']['length']>0x0,_0x5bd93b=_0x2a1e31['customItems']&&_0x2a1e31['customItems']['length']>0x0;this['addContextButtonView']['isEnabled']=_0x17b0fb||_0x34aaea||_0x4b7de7||_0x30e153||_0x5bd93b;}['_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'](_0x2a2512){const _0x4d46b6=new Nt(_0x2a2512);return _0x4d46b6['set']({'label':hs(_0x2a2512,'AI_CHAT_CONTEXT_ADD_CONTEXT'),'class':Wr+'\x20'+Br+'\x20'+us,'icon':_0x504f07,'isToggleable':!0x0,'tooltip':!0x0,'tooltipPosition':'sw'}),_0x4d46b6;}['_createAddContextBalloonPanelView'](_0x5174e5){return this['_createBaseBalloonPanel'](_0x5174e5,Vr);}['_createUrlBalloonPanelView'](_0x5b4855){const _0x2043a0=this['_createBaseBalloonPanel'](_0x5b4855,Gr);return this['_addUrlContent'](_0x2043a0,_0x5b4855),_0x2043a0;}['_createResourcesBalloonView'](_0x274ce9,_0x48549b){const _0x489d2d={'searchInputVisibleFrom':_0x48549b['searchInputVisibleFrom'],'onBackToContext':()=>{this['showAddContextBalloonPanel'](),this['_addContextBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':Xr});},'onResourceSelected':(_0x541c76,_0x3a47a9)=>{this['fire']('addResourceToContext',{'source':_0x541c76,'resource':_0x3a47a9});},'onLoadSourceResources':_0xcb753e=>{this['fire']('loadSourceResources',_0xcb753e);},'onBalloonClosed':()=>{this['addContextButtonView']['isOn']=!0x1;},'getLimiterElement':()=>this['_getLimiterElement'](),'getTargetElement':()=>this['addContextButtonView']['element']};return new Pr(_0x274ce9,_0x48549b['bodyCollection'],_0x489d2d);}['_getLimiterElement'](){return this['element']?.['closest']('.'+Qr)||document['body'];}['_createBaseBalloonPanel'](_0x178258,_0x57d2d3){const _0x16fd6b=new Xt(_0x178258);return _0x16fd6b['extendTemplate']({'attributes':{'class':_0x57d2d3}}),this['bodyCollection']['add'](_0x16fd6b),_0x16fd6b;}['_setBalloonPanelContent'](_0x451cb9,_0xde0799,_0x5e56f6){if(_0x451cb9['content']['clear'](),!_0x5e56f6['document']['isHidden']&&_0x5e56f6['document']['enabled']){const _0x11d71f=this['_createBalloonButton'](_0xde0799,{'label':hs(_0xde0799,'AI_CHAT_CONTEXT_CURRENT_DOCUMENT'),'icon':_0x22e392});_0x11d71f['on']('execute',()=>{this['fire']('addDocumentToContext'),this['hideAddContextBalloonPanel']();}),_0x451cb9['content']['add'](_0x11d71f);}if(_0x5e56f6['urls']['enabled']){const _0x49ff22=this['_createBalloonButton'](_0xde0799,{'label':hs(_0xde0799,'AI_CHAT_CONTEXT_URL_LABEL'),'icon':_0x5ea46a});_0x49ff22['on']('execute',()=>{this['hideAddContextBalloonPanel'](),this['showUrlBalloonPanel'](),this['_urlBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':Xr}),this['_urlInputView']['focus']();}),_0x451cb9['content']['add'](_0x49ff22);}if(_0x5e56f6['files']['enabled']){const _0xcff1f3=new _0x161cdc(_0xde0799);_0xcff1f3['set']({'label':hs(_0xde0799,'AI_CHAT_CONTEXT_FILE_LABEL'),'icon':_0x4aafe4,'withText':!0x0,'tooltip':!0x0,'class':Fr,'allowMultipleFiles':!0x0}),_0xcff1f3['on']('execute',()=>{this['hideAddContextBalloonPanel']();}),_0xcff1f3['on']('done',(_0x558c90,_0x5e887a)=>{this['fire']('addFileToContext',_0x5e887a);}),_0xcff1f3['tooltip']=!0x0,_0x451cb9['content']['add'](_0xcff1f3);}for(const _0x21cb2c of _0x5e56f6['sources']){const _0x5f0c5f=this['_createBalloonButton'](_0xde0799,{'label':_0x21cb2c['label'],'icon':_0x21cb2c['icon']||_0xc2c70c,'type':'source'});_0x451cb9['content']['add'](_0x5f0c5f),_0x5f0c5f['on']('execute',()=>{this['hideAddContextBalloonPanel'](),this['_showSourceResourcesBalloon']({'source':_0x21cb2c,'withBackButton':!this['_hasExactlyOneSource']});});}for(const _0x316248 of _0x5e56f6['customItems']||[]){const _0x5b85fc=this['_createBalloonButton'](_0xde0799,{'label':_0x316248['label'],'icon':_0x316248['icon']||_0xc2c70c,'type':'customItem'});_0x451cb9['content']['add'](_0x5b85fc),_0x5b85fc['on']('execute',()=>{this['hideAddContextBalloonPanel'](),this['fire']('executeCustomItemCallback',_0x316248);});}this['_hasExactlyOneSource']=0x1===_0x451cb9['content']['length'],this['_urlInputView']['withBackButton']=!this['_hasExactlyOneSource'];}['_addUrlContent'](_0x2e0468,_0x5008cb){this['_urlInputView']=new wr(_0x5008cb),this['_urlInputView']['on']('submitUrl',(_0x43cb4f,_0x2bdafd)=>{this['_handleUrlSubmit'](_0x2bdafd);}),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});}),_0x2e0468['content']['add'](this['_urlInputView']);}['_createBalloonButton'](_0x289126,_0x4f6b12){const _0x16c9c6='source'===_0x4f6b12['type']?new jr(_0x289126):new Nt(_0x289126);return _0x16c9c6['set']({'label':_0x4f6b12['label'],'icon':_0x4f6b12['icon'],'withText':!0x0,'tooltip':!0x0,'tooltipPosition':'sw','class':Fr}),_0x16c9c6;}['_setupAllBalloonClickOutsideHandlers'](){this['_setupAddContextBalloonClickOutsideHandler'](),this['_setupUrlBalloonClickOutsideHandler']();}['_setupUrlBalloonClickOutsideHandler'](){zt({'emitter':this['_urlBalloonPanelView'],'contextElements':[this['_urlBalloonPanelView']['element']],'callback':()=>{this['hideUrlBalloonPanel']();},'activator':()=>this['_urlBalloonPanelView']['isVisible']});}['_toggleAddContextBalloon'](_0x185eef){const _0x20db8b=this['_addContextBalloonConfig'];_0x20db8b['buttonView']['isOn']=_0x185eef,_0x185eef?_0x20db8b['balloonView']['show']():_0x20db8b['balloonView']['hide']();}['_setupAddContextBalloonClickOutsideHandler'](){const {balloonView:_0x24baed,buttonView:_0xda3480,hideMethod:_0x1777e0}=this['_addContextBalloonConfig'];zt({'emitter':_0x24baed,'contextElements':[_0x24baed['element'],_0xda3480['element']],'callback':()=>{_0x1777e0();},'activator':()=>_0xda3480['isOn']&&!this['_urlBalloonPanelView']['isVisible']&&!this['_resourcesBalloonView']['isAnyResourceBalloonVisible']()});}['_createContextButton'](_0x529857,_0x41719d,_0x3b1add=!0x1,_0x5787b8=!0x1){const _0xb91e0f='conversation'===_0x41719d||!0x0===_0x529857['isReadOnly'],_0x225e88=new Bn(this['locale'],_0x529857,_0xb91e0f,_0x3b1add,_0x5787b8);return _0xb91e0f||_0x225e88['on']('removeContextItemChip',()=>{this['fire']('removeContextItem',_0x225e88['id']);}),_0x225e88;}['_addContextToCollection'](_0x53f811,_0x3442f7){_0x3442f7['add'](_0x53f811,0x0);}['_removeContextFromCollection'](_0x22b6e8,_0x22b69e){const _0x49a23d=_0x22b69e['find'](_0x407d22=>_0x407d22['id']===_0x22b6e8);_0x49a23d&&_0x22b69e['remove'](_0x49a23d);}['_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'](_0x3bacd9){this['_urlInputView']['clear'](),this['hideUrlBalloonPanel'](),this['fire']('addUrlToContext',_0x3bacd9);}}class jr extends Nt{['arrowView'];constructor(_0x37577b){super(_0x37577b),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 _0x1e54b4=new xt();return _0x1e54b4['content']=_0x5abe6d,_0x1e54b4['extendTemplate']({'attributes':{'class':Kr+'__arrow'}}),_0x1e54b4;}}class Jr extends vt{['_cancelButtonView'];['_loaderView'];constructor(_0x266c5b){super(_0x266c5b),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 _0x29c7d4=new Nt(this['locale']);return _0x29c7d4['set']({'label':hs(this['locale'],'AI_CHAT_STOP_GENERATING'),'withText':!0x0,'class':ls+'\x20ck-ai-button-stop-generating','icon':_0x2c4109}),_0x29c7d4['on']('execute',()=>{this['fire']('abortPromptStream');}),_0x29c7d4;}['_createLoaderView'](){const _0x35dc9b=new vt(this['locale']);return _0x35dc9b['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')}]}),_0x35dc9b;}}class Zr extends vt{['_contextPanelView'];['_promptInputView'];['_promptCapabilitiesView'];['_loaderView'];['_modelUnavailableMessageView'];['_shouldRestorePromptInputFocus'];constructor(_0x3aa9c1,_0x54e31c){super(_0x3aa9c1),this['_contextPanelView']=this['_createContextPanelView'](_0x3aa9c1,{'bodyCollection':_0x54e31c['bodyCollection'],'searchInputVisibleFrom':_0x54e31c['contextResourcesSearchInputVisibleFrom']}),this['_promptInputView']=this['_createPromptInputView'](_0x3aa9c1),this['_promptCapabilitiesView']=this['_createPromptCapabilitiesView'](_0x3aa9c1),this['_loaderView']=this['_createLoaderView'](_0x3aa9c1),this['_modelUnavailableMessageView']=this['_createModelUnavailableMessageView'](_0x3aa9c1),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 _0x1c0953=this['bindTemplate'];this['setTemplate']({'tag':'form','attributes':{'class':['ck','ck-ai-chat-controls',_0x1c0953['if']('isDisabled','ck-ai-chat-controls-disabled')]},'children':[{'tag':'div','attributes':{'class':[_0x1c0953['if']('isLoading','ck-hidden',_0x507efb=>_0x507efb||!this['isModelAvailable']),_0x1c0953['if']('isModelAvailable','ck-hidden',_0x5698a4=>!_0x5698a4||this['isLoading'])]},'children':[this['_contextPanelView'],this['_promptInputView'],this['_promptCapabilitiesView']]},{'tag':'div','attributes':{'class':[_0x1c0953['if']('isLoading','ck-hidden',_0x5e78c9=>!_0x5e78c9)]},'children':[this['_loaderView']]},{'tag':'div','attributes':{'class':[_0x1c0953['if']('isModelAvailable','ck-hidden',_0x270fe8=>_0x270fe8)]},'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'](_0xf1593d,_0xa50b65){return new zr(_0xf1593d,_0xa50b65);}['_createPromptInputView'](_0x3973a2){return new hr(_0x3973a2,this['_contextPanelView']['addContextButtonView']);}['_createPromptCapabilitiesView'](_0x387f20){return new Er(_0x387f20);}['_createLoaderView'](_0x16ea4f){return new Jr(_0x16ea4f);}['_createModelUnavailableMessageView'](_0x5bbb04){const _0x45265d=new to(_0x5bbb04);return _0x45265d['delegate']('startConversation')['to'](this),_0x45265d;}['_handlePromptInputFocus'](_0x18661a,_0xa24470,_0x3a3201){_0x3a3201?this['_shouldRestorePromptInputFocus']=!0x0:this['_shouldRestorePromptInputFocus']&&this['_promptInputView']['focus']();}['addContextItem'](_0x45643c,_0x20637b){this['_contextPanelView']['addContextItem'](_0x45643c,_0x20637b);}['removeContextItem'](_0x181ad2){this['_contextPanelView']['removeContextItem'](_0x181ad2);}['setContextItemLoading'](_0x50f72f,_0x5845e6){this['_contextPanelView']['setContextItemLoading'](_0x50f72f,_0x5845e6);}['setIsUploadInProgress'](_0x2d9029){this['_promptInputView']['setIsUploadInProgress'](_0x2d9029);}['setConversationContext'](_0x5257cb){this['_contextPanelView']['setConversationContext'](_0x5257cb);}['clearPendingContextUI'](){this['_contextPanelView']['clearCurrentContextItems']();}['clearConversationContextUI'](){this['_contextPanelView']['clearConversationContextItems']();}['updateResourceState'](_0x5a8b85,_0x4c55b4,_0x3c4e7e){this['_contextPanelView']['updateResourceState'](_0x5a8b85,_0x4c55b4,_0x3c4e7e);}['setWebSearch'](_0x3ec5d6){this['_promptCapabilitiesView']['setWebSearch'](_0x3ec5d6);}['setReasoning'](_0x1799f9){this['_promptCapabilitiesView']['setReasoning'](_0x1799f9);}['resetMessageInput'](){this['_promptInputView']['reset']();}['setAddContextOptions'](_0xbc6533){this['_contextPanelView']['setAddContextOptions'](_0xbc6533);}['setInputPlaceholder'](_0x4e0464){this['_promptInputView']['setPlaceholderText'](_0x4e0464);}['setModelList'](_0x131f7f,_0x4af5a8){this['_promptCapabilitiesView']['setModelList'](_0x131f7f,_0x4af5a8);}['setModel'](_0x3eaaa5){_0x3eaaa5?(this['isModelAvailable']=!0x0,this['_promptCapabilitiesView']['setModel'](_0x3eaaa5)):this['isModelAvailable']=!0x1;}['enableModelSelector'](){this['_promptCapabilitiesView']['enableModelSelector']();}['disableModelSelector'](_0x2f4ba1){this['_promptCapabilitiesView']['disableModelSelector'](_0x2f4ba1);}['populateSourceResourceBalloon'](_0x20202f,_0x272b4d,_0x5e8ffe,_0x2c9c43){this['_contextPanelView']['populateSourceResourceBalloon'](_0x20202f,_0x272b4d,_0x5e8ffe,_0x2c9c43);}['closeSourceResourceBalloon'](_0x598372){this['_contextPanelView']['closeSourceResourceBalloon'](_0x598372);}['focusPromptInput'](_0x4a82da=!0x1){this['_promptInputView']['focus'](_0x4a82da);}['setPromptInputValue'](_0x11bbca){this['_promptInputView']['queryView']['fieldView']['reset'](),this['_promptInputView']['queryView']['fieldView']['value']=_0x11bbca;}}class to extends vt{constructor(_0x438f3f){super(_0x438f3f);const _0x5ef71c=new Nt(_0x438f3f);_0x5ef71c['set']({'label':hs(this['locale'],'AI_CHAT_MODEL_UNAVAILABLE_MESSAGE_BUTTON'),'withText':!0x0,'class':['ck-ai-chat-controls__start-new-chat-button'],'tooltip':''}),_0x5ef71c['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'},_0x5ef71c]}]});}}class eo extends _0x484303{['resizeButton'];constructor(_0x4ac575,_0x52583d){super(_0x4ac575,{'label':_0x52583d['label'],'class':'ck-ai-header\x20'+_0x52583d['class'],'icon':_0x52583d['icon']}),this['set']('isMaximized',!0x1),_0x52583d['content']&&this['children']['add'](_0x52583d['content']),_0x52583d['showResizeButton']&&(this['resizeButton']=ds(_0x4ac575,this),this['children']['add'](this['resizeButton']));}}class io extends vt{constructor(_0x25972c){super(_0x25972c),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-disclaimer']},'children':[{'tag':'p','attributes':{'class':['ck','ck-ai-disclaimer__content']},'children':[{'text':hs(_0x25972c,'AI_DISCLAIMER_TEXT')}]}]});}}function so(_0x1f87a1,_0x3b5a57){const _0x16553e=new Nt(_0x1f87a1);return _0x16553e['set']({'label':hs(_0x1f87a1,'AI_CHAT_LABEL_NEW_CHAT'),'withText':!0x0,'icon':_0x389c6e,'class':'ck-ai-chat__start-conversation\x20'+ls}),_0x16553e['on']('execute',()=>{_0x3b5a57['fire']('startConversation');}),_0x16553e;}class no extends vt{['chatHeader'];['chatFeed'];['chatControls'];['chatDisclaimer'];['_bodyCollection'];constructor(_0x1c50d2,_0x31dc65){super(_0x1c50d2),this['_bodyCollection']=new Qt(_0x1c50d2),this['_bodyCollection']['attachToDom']();const _0x24a14e=so(_0x1c50d2,this);this['chatHeader']=new eo(_0x1c50d2,{'label':hs(_0x1c50d2,'AI_CHAT_HEADING'),'icon':_0x434a83,'class':'ck-ai-header_chat','content':_0x24a14e,'showResizeButton':_0x31dc65['showResizeButton']}),this['chatHeader']['delegate']('resizeTabs')['to'](this),this['chatFeed']=new rr(_0x1c50d2,this['_bodyCollection']),this['chatFeed']['delegate'](...tn)['to'](this),this['chatControls']=new Zr(_0x1c50d2,{'bodyCollection':this['_bodyCollection'],'contextResourcesSearchInputVisibleFrom':_0x31dc65['contextResourcesSearchInputVisibleFrom']}),this['chatControls']['delegate'](...tn)['to'](this),this['chatDisclaimer']=new io(_0x1c50d2),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset_all','ck-ai-chat','ck-rounded-corners'],'dir':_0x1c50d2['uiLanguageDirection']},'children':[this['chatHeader'],this['chatFeed'],this['chatControls'],this['chatDisclaimer']]});}['populateSourceResourceBalloon'](_0x42cc6d,_0x3431f8,_0x4885d6,_0x237a61){this['chatControls']['populateSourceResourceBalloon'](_0x42cc6d,_0x3431f8,_0x4885d6,_0x237a61);}['closeSourceResourceBalloon'](_0x44671c){this['chatControls']['closeSourceResourceBalloon'](_0x44671c);}['destroy'](){this['_bodyCollection']['detachFromDom'](),super['destroy']();}}class ro extends _0x1c4dd1{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(_0x436e05){super(_0x436e05);const _0x41281e=this['context']['plugins']['get']('AITabs');this['set']('isBusy',!0x1),this['_promiseQueue']=new Cn(),this['_view']=new no(this['context']['locale'],{'showResizeButton':_0x41281e['showResizeButton'],'contextResourcesSearchInputVisibleFrom':this['context']['config']['get']('ai.chat.context.searchInputVisibleFrom')}),this['_view']['delegate']('resizeTabs')['to'](_0x41281e),this['_view']['delegate'](...tn)['to'](this),this['_view']['on']('toggleSuggestionDisplayMode',(_0xedf49b,{showDiff:_0x3e786d})=>{this['showDiff']=_0x3e786d;}),_0x41281e['view']['addTab']({'id':'chat','buttonLabel':hs(this['context']['locale'],'AI_CHAT_HEADING'),'buttonIcon':_0x434a83,'order':0x0,'content':this['_view']}),this['_view']['chatHeader']['bind']('isMaximized')['to'](_0x41281e['view'],'isMaximized',_0x433435=>_0x433435),this['_view']['chatControls']['bind']('isLoading')['to'](this,'isBusy',_0xc2ec6e=>_0xc2ec6e),this['_view']['chatControls']['setInputPlaceholder'](this['_getInputPlaceholder']()),this['bind']('isModelAvailable')['to'](this['_view']['chatControls'],'isModelAvailable');}['destroy'](){super['destroy'](),this['_titleAnimationInterval']&&clearInterval(this['_titleAnimationInterval']);}['createConversation'](_0x65a7d2){const _0x3992c3=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'](_0x65a7d2['availableModels'],!this['context']['config']['get']('ai.models.showModelSelector')),this['addFeedItemStaticMessage']({'id':'conversation-start','staticMessage':_0x3992c3}),this['fire']('conversationCreated');}async['addFeedItemStaticMessage']({id:_0x1fb633,staticMessage:_0x3aef1e}){return this['_promiseQueue']['enqueue'](async()=>{this['_view']['chatFeed']['addItem']('ai-reply',{'id':_0x1fb633,'initialContent':'<p>'+_0x3aef1e+'</p>'});});}async['addFeedItemUserMessage'](_0x517bab){const _0xe124ac=_0x517bab['attributes']?.['displayedPrompt']||_0x517bab['userMessage'];return this['_promiseQueue']['enqueue'](async()=>{this['_view']['chatFeed']['addItem']('user-message',{'contextItems':Array['from'](_0x517bab['contextItems']['values']()),'initialContent':'<p>'+_0xe124ac+'</p>','id':_0x517bab['id']});});}async['addFeedItemError']({errorMessage:_0x56fbbe,id:_0x2ca2f2}){return this['_promiseQueue']['enqueue'](async()=>{this['_view']['chatFeed']['addItem']('error-message',{'initialContent':'<p>'+_0x56fbbe+'</p>','id':_0x2ca2f2});});}async['addFeedItemAIReply'](_0x66da4d){return this['_promiseQueue']['enqueue'](async()=>{this['_view']['chatFeed']['addItem']('ai-reply',{'id':_0x66da4d['interactionId']+':'+_0x66da4d['id']}),this['clearLoadingMessage']();});}async['addFeedItemAISuggestion'](_0x2cfddd){const _0x843bdc=$s(this['context']);let _0x464b21=_0x843bdc['config']['get']('ai.availableReplyActions')||[...fn];if(_0x843bdc['plugins']['has']('TrackChanges')){if(!this['_isTrackChangesCommandValueBound']){this['_isTrackChangesCommandValueBound']=!0x0;const _0xabaff1=_0x843bdc['commands']['get']('trackChanges');this['_view']['chatFeed']['bind']('isTrackChangesOn')['to'](_0xabaff1,'value');}}else _0x464b21=_0x464b21['filter'](_0x1c122b=>'insertSuggestion'!=_0x1c122b);return this['_promiseQueue']['enqueue'](async()=>{this['_view']['chatFeed']['addItem']('ai-suggestion-reply',{'id':_0x2cfddd['interactionId']+':'+_0x2cfddd['id'],'areActionsDisabled':_0x2cfddd['areActionsDisabled'],'showDiff':this['showDiff'],'availableActions':_0x464b21}),this['clearLoadingMessage']();});}async['addFeedInteractionHeader'](_0x5d1c81,_0x3f7707){return this['_promiseQueue']['enqueue'](async()=>{const _0x34fa98=this['_view']['chatFeed']['children']['last'];if(_0x34fa98 instanceof Zn)return this['_view']['chatFeed']['children']['remove'](_0x34fa98),void this['_view']['chatFeed']['addItem']('interaction-header',{'id':_0x5d1c81['id'],'capabilities':{'isWebSearchEnabled':_0x34fa98['capabilities']['isWebSearchEnabled']||_0x3f7707['isWebSearchEnabled'],'isReasoningEnabled':_0x34fa98['capabilities']['isReasoningEnabled']||_0x3f7707['isReasoningEnabled']}});this['_view']['chatFeed']['addItem']('interaction-header',{'id':_0x5d1c81['id'],'capabilities':_0x3f7707});});}async['addFeedItemCustomElement'](_0x27873e,_0x4296fa){let _0x58e761;return await this['_promiseQueue']['enqueue'](async()=>{_0x58e761=this['_view']['chatFeed']['addItem']('custom-element',{'content':_0x27873e,'id':_0x4296fa});}),_0x58e761;}['removeFeedItem'](_0x3161e0){this['_view']['chatFeed']['removeItem'](_0x3161e0);}['hasFeedItem'](_0x4f46b3){return this['_view']['chatFeed']['hasItem'](_0x4f46b3);}['updateFeedInteractionHeader'](_0x2c106b){const _0x135fa8=this['_view']['chatFeed']['children']['find'](_0x17298a=>_0x17298a['options']['id']==_0x2c106b['id']&&_0x17298a instanceof Zn);_0x135fa8&&_0x135fa8['set']('isVisible',_0x2c106b['isVisible']);}async['updateFeedItemAIReplyContent'](_0x564cc7){const _0x3f20fa=_0x564cc7['renderingStrategy']||this['feedItemRenderingStrategy'];return this['_promiseQueue']['enqueue'](async _0x539746=>{await this['_view']['chatFeed']['updateReplyItem']({..._0x564cc7,'abortSignal':_0x539746,'renderingStrategy':_0x3f20fa}),_0x564cc7['isDone']&&this['markFeedItemAsDone'](_0x564cc7['id']);});}['updateFeedItemAIReplySources'](_0x10f582,_0x59e10a){this['_view']['chatFeed']['updateWebSources'](_0x10f582,_0x59e10a);}async['updateFeedItemAIReplySuggestionContent'](_0x597229){return this['_promiseQueue']['enqueue'](async _0x43f4bc=>{await this['_view']['chatFeed']['updateSuggestionItem']({..._0x597229,'abortSignal':_0x43f4bc}),_0x597229['isDone']&&this['markFeedItemAsDone'](_0x597229['id']);});}['updateFeedItemAIReplySuggestionPartState'](_0x4e0698){this['_view']['chatFeed']['updateSuggestionPartState'](_0x4e0698);}['setFeedItemAIReplySuggestionPartActive'](_0x20775a){this['_view']['chatFeed']['setSuggestionPartActive'](_0x20775a);}['markFeedItemAsDone'](_0xa32187){this['_view']['chatFeed']['markItemAsDone'](_0xa32187);}['removeFeedInteraction'](_0x1da9dc){this['_view']['chatFeed']['getItemIds']()['filter'](_0x841713=>_0x841713['startsWith'](_0x1da9dc))['forEach'](_0xfb8d9=>this['_view']['chatFeed']['removeItem'](_0xfb8d9));}['startInteraction'](){const _0x4f8351=this['prepareLoadingMessage']({'isWebSearchEnabled':!0x1,'isReasoningEnabled':!0x1});this['setLoadingMessage'](_0x4f8351),this['_view']['chatControls']['disableModelSelector'](!this['context']['config']['get']('ai.models.showModelSelector')),this['isBusy']=!0x0,this['_view']['chatFeed']['startAutoScroll']();}['stopInteraction'](_0x2170be){this['_promiseQueue']['abort'](),this['_view']['chatFeed']['getItemIds']()['filter'](_0x18b7a2=>_0x18b7a2['startsWith'](_0x2170be['id']))['forEach'](_0x3e53f7=>this['markFeedItemAsDone'](_0x3e53f7)),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'](_0x13667f,_0x1bc2a0){this['_view']['chatControls']['addContextItem'](_0x13667f,_0x1bc2a0);}['removeContextItem'](_0x5bfe31){this['_view']['chatControls']['removeContextItem'](_0x5bfe31);}['setContextItemLoading'](_0x214c00,_0x98d0dc){this['_view']['chatControls']['setContextItemLoading'](_0x214c00,_0x98d0dc);}['setIsUploadInProgress'](_0x58e6c3){this['_view']['chatControls']['setIsUploadInProgress'](_0x58e6c3);}['setConversationContext'](_0x2ee0bb){this['_view']['chatControls']['setConversationContext'](_0x2ee0bb);}['clearPendingContextUI'](){this['_view']['chatControls']['clearPendingContextUI']();}['clearConversationContextUI'](){this['_view']['chatControls']['clearConversationContextUI']();}['updateResourceState'](_0x12a06a,_0x229478,_0x49c0ed){this['_view']['chatControls']['updateResourceState'](_0x12a06a,_0x229478,_0x49c0ed);}['resetMessageInput'](){this['_view']['chatControls']['resetMessageInput'](),this['_view']['chatControls']['setInputPlaceholder'](this['_getInputPlaceholder']());}['setAddContextOptions'](_0xe64740){this['_view']['chatControls']['setAddContextOptions'](_0xe64740);}['updateCapabilities'](_0x1df8e7){this['_view']['chatControls']['setWebSearch'](_0x1df8e7['isWebSearchEnabled']),this['_view']['chatControls']['setReasoning'](_0x1df8e7['isReasoningEnabled']),this['_view']['chatControls']['setInputPlaceholder'](this['_getInputPlaceholder'](_0x1df8e7));}['setSelectedModel'](_0x54dfde,_0x2d7d6f){this['_view']['chatControls']['setModel'](_0x54dfde),_0x2d7d6f&&this['_view']['chatControls']['disableModelSelector'](!0x1);}['setFeedItemRenderingStrategy'](_0x471d8d){this['feedItemRenderingStrategy']=_0x471d8d;}['toggleLoadingSkeleton'](_0x423ba0){this['_view']['chatFeed']['toggleLoadingSkeleton'](_0x423ba0);}['resetConversationTitle'](){this['setConversationTitle'](hs(this['context']['locale'],'AI_CHAT_HEADING'));}['setConversationTitle'](_0x115858,_0x26c3a7=!0x1){if(_0x26c3a7&&!St()&&_0x115858['length'])return this['_view']['chatHeader']['label']='',void this['_animateConversationTitle'](_0x115858);this['_view']['chatHeader']['label']=_0x115858;}['setLoadingMessage'](_0x190573){this['_view']['chatFeed']['setLoadingMessage'](_0x190573);}['clearLoadingMessage'](){this['_view']['chatFeed']['setLoadingMessage']('');}['_animateConversationTitle'](_0xa3fe55){let _0x438918=0x0;clearInterval(this['_titleAnimationInterval']),this['_titleAnimationInterval']=setInterval(()=>{this['_view']['chatHeader']['label']=this['_view']['chatHeader']['label']+_0xa3fe55[_0x438918],_0x438918++,_0x438918===_0xa3fe55['length']&&clearInterval(this['_titleAnimationInterval']);},0x1e);}['prepareLoadingMessage'](_0x2f561c){return _0x2f561c['isWebSearchEnabled']&&_0x2f561c['isReasoningEnabled']?hs(this['context']['locale'],'AI_CHAT_FEED_LOADING_MESSAGE_WEBSEARCH_REASONING'):_0x2f561c['isWebSearchEnabled']?hs(this['context']['locale'],'AI_CHAT_FEED_LOADING_MESSAGE_WEBSEARCH'):_0x2f561c['isReasoningEnabled']?hs(this['context']['locale'],'AI_CHAT_FEED_LOADING_MESSAGE_REASONING'):hs(this['context']['locale'],'AI_CHAT_FEED_LOADING_MESSAGE_REGULAR');}['_getInputPlaceholder'](_0x4fe542){return _0x4fe542?_0x4fe542['isWebSearchEnabled']&&_0x4fe542['isReasoningEnabled']?hs(this['context']['locale'],'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_WEBSEARCH_REASONING'):_0x4fe542['isWebSearchEnabled']?hs(this['context']['locale'],'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_WEBSEARCH'):_0x4fe542['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'](_0x365258,_0x5c3446,_0xfe27f2,_0x23e8f9){this['_view']['populateSourceResourceBalloon'](_0x365258,_0x5c3446,_0xfe27f2,_0x23e8f9);}['closeSourceResourceBalloon'](_0x3488ce){this['_view']['closeSourceResourceBalloon'](_0x3488ce);}['setPromptInputValue'](_0x57616e){this['_view']['chatControls']['setPromptInputValue'](_0x57616e);}['focusPromptInput'](_0x466f34=!0x1){this['_view']['chatControls']['focusPromptInput'](_0x466f34);}['scrollFeedToSuggestion'](_0x379ef0,_0x5455f5){this['_view']['chatFeed']['scrollToSuggestion'](_0x379ef0,_0x5455f5);}['startAutoScroll'](_0x5358d2={}){this['_view']['chatFeed']['startAutoScroll'](_0x5358d2);}['disableControls'](){this['_view']['chatControls']['isDisabled']=!0x0;}['enableControls'](){this['_view']['chatControls']['isDisabled']=!0x1;}}class oo extends Dt{['sections'];constructor(_0x385325,_0x4e8ca8){super(_0x385325),this['sections']=_0x4e8ca8,this['items']['addMany'](this['sections']),this['extendTemplate']({'attributes':{'class':['ck-ai-chat-history__sections']}});}['filter'](_0x18d05b){let _0xc20ac1=0x0,_0x207857=0x0;for(const _0x6df552 of this['sections']){const {resultsCount:_0x1dc3f1,totalItemsCount:_0x2216ca}=_0x6df552['filter'](_0x18d05b);_0xc20ac1+=_0x1dc3f1,_0x207857+=_0x2216ca;}return{'resultsCount':_0xc20ac1,'totalItemsCount':_0x207857};}}class ao extends Ht{['title'];['itemsViews'];['_itemsListView'];constructor(_0x1d498e,{title:_0x45951d,items:_0x1b1b59}){super(_0x1d498e);const _0x19ea03=this['bindTemplate'];this['set']('isVisible',!0x0),this['title']=_0x45951d,this['itemsViews']=_0x1b1b59;const _0x32fa0f=new vt(_0x1d498e);_0x32fa0f['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-chat-history__section-title']},'children':[this['title']]}),this['_itemsListView']=new Dt(_0x1d498e),this['_itemsListView']['items']['addMany'](this['itemsViews']),this['setTemplate']({'tag':'li','attributes':{'class':['ck-ai-chat-history__section',_0x19ea03['if']('isVisible','ck-hidden',_0xfb272a=>!_0xfb272a)]},'children':[_0x32fa0f,this['_itemsListView']]});}['filter'](_0x25132a){const _0x3a1529=this['itemsViews']['length'];let _0x26ca3c=0x0;for(const _0x47432d of this['itemsViews']){if(_0x25132a){const _0x34f397=_0x47432d['isMatching'](_0x25132a);_0x47432d['isVisible']=!!_0x34f397,_0x47432d['highlightText'](_0x25132a);}else _0x47432d['isVisible']=!0x0,_0x47432d['highlightText'](null);_0x47432d['isVisible']&&_0x26ca3c++;}return this['isVisible']=_0x26ca3c>0x0,{'resultsCount':_0x26ca3c,'totalItemsCount':_0x3a1529};}['getItem'](_0x3a90f6){return this['itemsViews']['find'](_0x379b72=>_0x379b72['id']===_0x3a90f6);}['removeItem'](_0x4a7c21){const _0x8c5a9=this['itemsViews']['indexOf'](_0x4a7c21);-0x1!==_0x8c5a9&&(this['itemsViews']['splice'](_0x8c5a9,0x1),this['_itemsListView']['items']['remove'](_0x4a7c21));}}class ho extends/* #__PURE__ -- @preserve */
27
- _0x54c893(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(_0x5ab116,_0x31f6b0){super(_0x5ab116);const _0x4d1ff7=this['bindTemplate'];this['set']('isEdit',!0x1),this['set']('isVisible',!0x0),this['set']('pinned',!!_0x31f6b0['pinned']),this['set']('loadingState',null),this['set']('title',_0x31f6b0['title']),this['id']=_0x31f6b0['id'];const {createdAt:_0x2769fd,active:_0xbd80b4=!0x1}=_0x31f6b0;this['_titleView']=new _0x4a528a(),this['_titleView']['bind']('text')['to'](this,'title',t=>_0x321d30(t||'')),this['_titleView']['extendTemplate']({'attributes':{'class':['ck-ai-chat-history__item-title']}});const _0x1849cc=this['_createCheckView'](),_0x3f2b47=this['_createPinButtonView'](_0x5ab116),_0x719cbb=this['_createMenuDropdownView'](),_0x2b8a67=this['_createEditInputView'](_0x5ab116),_0x4eb6b4=this['_createAcceptEditButtonView'](_0x5ab116,_0x2b8a67),_0x52d32e=this['_createCancelEditButtonView'](_0x5ab116);this['actions']=this['createCollection'](),this['mainContent']=this['createCollection'](),this['mainContent']['add'](this['_titleView']),this['actions']['add'](_0x3f2b47),this['actions']['add'](_0x719cbb),this['on']('change:isEdit',(_0x5dbe16,_0x14ef32,_0x101ed6)=>{this['actions']['clear'](),this['mainContent']['clear'](),_0x101ed6?(this['actions']['add'](_0x4eb6b4),this['actions']['add'](_0x52d32e),this['mainContent']['add'](_0x2b8a67),_0x2b8a67['element']['value']=this['title']||'',_0x2b8a67['element']['focus']()):(this['actions']['add'](_0x3f2b47),this['actions']['add'](_0x719cbb),this['mainContent']['add'](this['_titleView']));}),this['setTemplate']({'tag':'li','attributes':{'class':['ck-ai-chat-history__item',_0xbd80b4?'ck-ai-chat-history__item--active':'',_0x4d1ff7['if']('isVisible','ck-hidden',_0x106cc3=>!_0x106cc3),_0x4d1ff7['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',_0x4d1ff7['if']('loadingState','ck-hidden',_0x2783cc=>!!_0x2783cc)]},'children':_0xbd80b4?[_0x1849cc]:[]},{'tag':'div','attributes':{'class':['ck-ai-loader',_0x4d1ff7['if']('loadingState','ck-hidden',_0x3ef547=>!_0x3ef547)]},'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',_0x4d1ff7['if']('loadingState','ck-hidden',_0x3e81b2=>!!_0x3e81b2)]},'children':this['mainContent']},{'tag':'div','attributes':{'class':['ck-ai-loader__text',_0x4d1ff7['if']('loadingState','ck-hidden',_0x31e92d=>!_0x31e92d)]},'children':[{'text':_0x4d1ff7['to']('loadingState',_0x570b78=>_0x570b78?hs(this['locale'],ho['LOADING_LABELS'][_0x570b78]):'')}]}]},{'tag':'span','attributes':{'class':['ck-ai-chat-history__item-date']},'children':[_0x2769fd]}]},{'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'](_0x1f366c){this['set']('title',_0x1f366c);}['updateLoadingState'](_0x331e2b,_0x3c8301){this['set']('loadingState',_0x3c8301?_0x331e2b:null);}['_createCheckView'](){const _0x4885e1=new xt();return _0x4885e1['set']({'content':_0xaff33c}),_0x4885e1;}['_createPinButtonView'](_0x4f8097){const _0x52c834=new Nt(_0x4f8097);return _0x52c834['set']({'label':hs(_0x4f8097,'AI_CHAT_HISTORY_PIN_BUTTON'),'icon':_0x38de8f,'withText':!0x1,'tooltip':!0x0}),_0x52c834['bind']('isOn')['to'](this,'pinned'),_0x52c834['on']('execute',()=>{const _0x3b4748=!this['pinned'];this['fire']('setConversationPinned',{'id':this['id'],'pinned':_0x3b4748});}),_0x52c834;}['_createMenuDropdownView'](){const _0x144eb7=Gt(this['locale']),_0x36c9e6=_0x144eb7['panelView']['children'];_0x144eb7['buttonView']['set']({'label':hs(this['locale'],'AI_CHAT_HISTORY_SHOW_MORE_ITEMS'),'icon':_0x856848}),_0x144eb7['panelPosition']='sw';const _0x217742=new Nt(this['locale']);_0x217742['label']=hs(this['locale'],'AI_CHAT_HISTORY_EDIT_NAME'),_0x217742['withText']=!0x0,_0x217742['on']('execute',()=>{this['isEdit']=!0x0;});const _0x2bdfab=new Nt(this['locale']);_0x2bdfab['label']=hs(this['locale'],'AI_CHAT_HISTORY_REMOVE'),_0x2bdfab['withText']=!0x0,_0x2bdfab['on']('execute',()=>{this['showConfirm'](hs(this['locale'],'AI_CHAT_HISTORY_REMOVE_CONFIRM'),this['element'])['then'](()=>{this['fire']('removeConversation',{'id':this['id']});});});const _0x983c1c=new Dt(this['locale']),_0x478819=new Ht(this['locale']);_0x478819['children']['add'](_0x217742);const _0x418ca4=new Ht(this['locale']);return _0x418ca4['children']['add'](_0x2bdfab),_0x983c1c['items']['addMany']([_0x478819,_0x418ca4]),_0x36c9e6['add'](_0x983c1c),_0x144eb7;}['_createEditInputView'](_0xd31b63){const _0x3a7445=new _0x297cb9(_0xd31b63),_0x4c8222=_0x3a7445['bindTemplate'];return _0x3a7445['extendTemplate']({'on':{'keydown':_0x4c8222['to'](_0x309915=>{'Enter'==_0x309915['key']&&this['_commitEditInputValue'](_0x3a7445);})}}),_0x3a7445;}['_createAcceptEditButtonView'](_0x46e3a9,_0x14c2e5){const _0xa627f8=new Nt(_0x46e3a9);return _0xa627f8['set']({'icon':_0xaff33c,'withText':!0x1,'tooltip':hs(_0x46e3a9,'AI_CHAT_HISTORY_ACCEPT')}),_0xa627f8['extendTemplate']({'attributes':{'class':['ck-confirm-view-submit']}}),_0xa627f8['on']('execute',()=>{this['_commitEditInputValue'](_0x14c2e5);}),_0xa627f8;}['_commitEditInputValue'](_0x45e5ff){const _0x2f93d6=_0x45e5ff['element']['value']||'';this['isEdit']=!0x1,this['fire']('editConversationTitle',{'id':this['id'],'title':_0x2f93d6});}['_createCancelEditButtonView'](_0x3a84f1){const _0x1409b5=new Nt(_0x3a84f1);return _0x1409b5['set']({'icon':_0x5adff9,'withText':!0x1,'tooltip':hs(_0x3a84f1,'AI_CHAT_HISTORY_CANCEL')}),_0x1409b5['extendTemplate']({'attributes':{'class':['ck-confirm-view-cancel']}}),_0x1409b5['on']('execute',()=>{this['isEdit']=!0x1,this['fire']('edit:cancel');}),_0x1409b5;}['_createSpinnerView'](){const _0x21c28e=new yn('tiny');return _0x21c28e['isVisible']=!0x0,_0x21c28e;}['isMatching'](_0x67d5a1){return'string'==typeof this['title']&&this['title']['match'](_0x67d5a1)?{'title':!0x0}:null;}['highlightText'](_0x1e0070){this['_titleView']['highlightText'](_0x1e0070);}}class co extends vt{['headerView'];['searchView'];['mainErrorView'];['skeletonView'];['emptyView'];['sectionsView'];constructor(_0x234fdf,_0x37511b){super(_0x234fdf),this['set']('hasItems',!0x1),this['set']('isLoading',!0x0),this['set']('errorMessage',''),this['set']('isSearchViewVisible',!0x1),this['set']('isEmptyViewVisible',!0x1),this['set']('isMainErrorViewVisible',!0x1);const _0xe36b18=so(_0x234fdf,this);this['headerView']=new eo(_0x234fdf,{'label':hs(_0x234fdf,'AI_CHAT_HISTORY_HEADING'),'icon':_0xa3f093,'class':'ck-ai-header_history','content':_0xe36b18,'showResizeButton':_0x37511b}),this['headerView']['delegate']('resizeTabs')['to'](this),this['sectionsView']=new oo(_0x234fdf,[]),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',_0x37d48c=>!_0x37d48c)]}}),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 _0x471621=new _0x3e041a(this['locale'],{'filteredView':this['sectionsView'],'queryView':{'label':hs(this['locale'],'AI_CHAT_HISTORY_SEARCH_LABEL')},'infoView':{'text':{'notFound':{'primary':_0x31f428=>hs(this['locale'],'AI_CHAT_HISTORY_SEARCH_NOT_FOUND_PRIMARY',_0x31f428),'secondary':hs(this['locale'],'AI_CHAT_HISTORY_SEARCH_NOT_FOUND_SECONDARY')}}}}),_0x4ec874=this['_createErrorView']();return _0x4ec874['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('errorMessage','ck-hidden',_0x264d2a=>!_0x264d2a)]}}),_0x471621['on']('render',()=>{_0x471621['children']['add'](_0x4ec874,0x1);}),_0x471621['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isSearchViewVisible','ck-hidden',_0x4659d7=>!_0x4659d7)]}}),_0x471621;}['_createSkeletonView'](){const _0x1518b3=new pn(this['locale'],mn['aiHistory']);return _0x1518b3['bind']('isVisible')['to'](this,'isLoading'),_0x1518b3;}['_createErrorView'](){const _0x167c13=new vt(this['locale']),_0x10d888=new Nt(this['locale']);_0x10d888['set']({'withText':!0x1,'icon':_0x5adff9,'class':'ck-ai-notification_error__dismiss-button'}),_0x10d888['bind']('isVisible')['to'](this,'hasItems',_0x277a4c=>!!_0x277a4c),_0x10d888['on']('execute',()=>{this['errorMessage']='';});const _0x38e6cb=this['bindTemplate'];return _0x167c13['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-notification','ck-ai-notification_error']},'children':[{'tag':'p','children':[{'text':_0x38e6cb['to']('errorMessage')}]},_0x10d888]}),_0x167c13;}['_createEmptyStateView'](){const _0x107a33=new vt(this['locale']);return _0x107a33['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-chat-history__empty',this['bindTemplate']['if']('isEmptyViewVisible','ck-hidden',_0x53b0ba=>!_0x53b0ba)]},'children':[{'tag':'p','attributes':{'class':['ck-ai-chat-history__empty-message']},'children':[hs(this['locale'],'AI_CHAT_HISTORY_EMPTY_MESSAGE')]}]}),_0x107a33;}['_createListItemViews'](_0x5631db,_0x1c3c0e){const _0x1cc15f=[];for(const _0xd53173 of _0x5631db){const _0x3355f2=new ho(_0x1c3c0e,_0xd53173);_0x3355f2['delegate'](...lo)['to'](this),_0x1cc15f['push'](_0x3355f2);}return _0x1cc15f;}['updateHistoryItemsWithCategories'](_0x1f1d70){const _0x56ab16=this['locale']||'en',_0x14cd28=[];for(const _0x4006b8 of _0x1f1d70){const _0x411f65=this['_createListItemViews'](_0x4006b8['items'],_0x56ab16);_0x14cd28['push'](new ao(_0x56ab16,{'title':_0x4006b8['title'],'items':_0x411f65}));}this['sectionsView']['sections']=_0x14cd28,this['sectionsView']['items']['clear'](),this['sectionsView']['items']['addMany'](_0x14cd28),this['hasItems']=_0x1f1d70['some'](_0x16fc5c=>_0x16fc5c['items']['length']>0x0),this['_refreshSearch']();}['removeHistoryItem'](_0x307166){for(const _0x580070 of this['sectionsView']['sections']){const _0x48e579=_0x580070['getItem'](_0x307166);if(_0x48e579){if(_0x580070['removeItem'](_0x48e579),0x0===_0x580070['itemsViews']['length']){const _0x4bb2a3=this['sectionsView']['sections']['indexOf'](_0x580070);-0x1!==_0x4bb2a3&&(this['sectionsView']['sections']['splice'](_0x4bb2a3,0x1),this['sectionsView']['items']['remove'](_0x580070));}this['hasItems']=this['sectionsView']['sections']['length']>0x0,this['_refreshSearch']();break;}}}['updateItemTitle'](_0x5d81a1,_0x281357){for(const _0x55d114 of this['sectionsView']['sections']){const _0x8446b8=_0x55d114['getItem'](_0x5d81a1);if(_0x8446b8){_0x8446b8['updateTitle'](_0x281357);break;}}}['updateItemLoadingState'](_0x40a332,_0x1137ae,_0x79b82f){for(const _0xb1980d of this['sectionsView']['sections']){const _0x1dec72=_0xb1980d['getItem'](_0x40a332);if(_0x1dec72){_0x1dec72['updateLoadingState'](_0x1137ae,_0x79b82f);break;}}}['_refreshSearch'](){if(this['hasItems']){const _0x1d1635=this['searchView']['queryView']['fieldView']?.['element']?.['value']||'';this['searchView']['search'](_0x1d1635);}}}const lo=['showConversationHistory','removeConversation','editConversationTitle','setConversationPinned','selectConversation','startConversation'];class uo extends _0x1c4dd1{static get['requires'](){return[os];}['_historyView'];static get['pluginName'](){return'AIChatHistoryUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x1cb6ac){super(_0x1cb6ac);const _0x87849d=this['context']['plugins']['get']('AITabs');this['_historyView']=new co(this['context']['locale'],_0x87849d['showResizeButton']),this['_historyView']['delegate']('resizeTabs')['to'](_0x87849d),this['_historyView']['delegate'](...lo)['to'](this),this['_historyView']['headerView']['bind']('isMaximized')['to'](_0x87849d['view'],'isMaximized',_0x1d8123=>_0x1d8123),_0x87849d['view']['addTab']({'id':'history','buttonLabel':hs(this['context']['locale'],'AI_CHAT_HISTORY_HEADING'),'buttonIcon':_0xa3f093,'order':0x0,'content':this['_historyView']});}['removeHistoryItem'](_0x441d90){this['_historyView']['removeHistoryItem'](_0x441d90);}['updateItems'](_0x955785){this['_historyView']['updateHistoryItemsWithCategories'](_0x955785);}['updateItemTitle'](_0x8a7749,_0x17dcc7){this['_historyView']['updateItemTitle'](_0x8a7749,_0x17dcc7);}['updateItemLoadingState'](_0x54f5fd,_0x29892d,_0xb140d3){this['_historyView']['updateItemLoadingState'](_0x54f5fd,_0x29892d,_0xb140d3);}['setLoadingSkeleton'](_0x981cfb){this['_historyView']['isLoading']=_0x981cfb;}['showError'](_0xebd533){this['_historyView']['errorMessage']=_0xebd533;}['hideError'](){this['_historyView']['errorMessage']='';}}class _o extends ht(){['id'];['createdAt'];constructor({id:_0x4e5ea0,title:_0x1b111d,createdAt:_0x53c498,updatedAt:_0x483c20,pinned:_0x5d1f09}){super(),this['id']=_0x4e5ea0,this['createdAt']=new Date(_0x53c498),this['set']('title',_0x1b111d),this['set']('updatedAt',_0x483c20?new Date(_0x483c20):null),this['set']('pinned',_0x5d1f09||!0x1);}['updateTitle'](_0x36e695){this['set']('title',_0x36e695),this['updatedAt']=new Date();}['updatePinned'](_0x12f189){this['set']('pinned',_0x12f189),this['updatedAt']=new Date();}}class go extends Tt(){['items']=[];['connector'];['group'];constructor({connector:_0x1e5166,group:_0x4eb815}){super(),this['connector']=_0x1e5166,this['group']=_0x4eb815;}async['init'](){try{const _0x41621c=this['connector']['fetchConversations'](this['group']),_0x1beba3=await _0x41621c['getConversations']();this['loadItems'](_0x1beba3);}catch(_0x5735ed){this['fire']('error',{'error':_0x5735ed,'operation':'init'});}}['addItem'](_0x8cc9ea){this['items']['push'](_0x8cc9ea);}async['removeItem'](_0x41fb9c){const _0xcd0a52=this['items']['findIndex'](_0x244beb=>_0x244beb['id']===_0x41fb9c);if(-0x1===_0xcd0a52)return!0x1;try{return await this['connector']['deleteConversation'](_0x41fb9c)['execute'](),this['items']['splice'](_0xcd0a52,0x1),this['fire']('itemRemoved',{'itemId':_0x41fb9c}),!0x0;}catch(_0x295f8d){return this['fire']('error',{'error':_0x295f8d,'operation':'removeItem','itemId':_0x41fb9c}),!0x1;}}['getItem'](_0x5f1afc){return this['items']['find'](_0x5f4446=>_0x5f4446['id']===_0x5f1afc);}async['updateItemTitle'](_0x24e8c2,_0x543160){const _0x1445c5=this['getItem'](_0x24e8c2);if(!_0x1445c5)return!0x1;try{return await this['connector']['updateConversation'](_0x24e8c2,{'title':_0x543160})['getResult'](),_0x1445c5['updateTitle'](_0x543160),this['fire']('itemUpdated',{'itemId':_0x24e8c2,'updates':{'title':_0x543160}}),!0x0;}catch(_0x2c3f77){return this['fire']('error',{'error':_0x2c3f77,'operation':'updateItemTitle','itemId':_0x24e8c2}),!0x1;}}async['updateItemPinned'](_0x28009f,_0x5d0243){const _0x57504a=this['getItem'](_0x28009f);if(!_0x57504a)return!0x1;try{return await this['connector']['updateConversation'](_0x28009f,{'pinned':_0x5d0243})['getResult'](),_0x57504a['updatePinned'](_0x5d0243),this['fire']('itemUpdated',{'itemId':_0x28009f,'updates':{'pinned':_0x5d0243}}),!0x0;}catch(_0x41cc1d){return this['fire']('error',{'error':_0x41cc1d,'operation':'updateItemPinned','itemId':_0x28009f}),!0x1;}}['loadItems'](_0x3a5f84){try{this['items']=[],_0x3a5f84['map'](_0x1c0d5a=>{this['addItem'](new _o(_0x1c0d5a));}),this['fire']('itemsLoaded',{'items':[...this['items']]});}catch(_0x536287){this['fire']('error',{'error':_0x536287,'operation':'loadItems'});}}['getItems'](_0x6ce95={}){const _0x1b78e2=void 0x0!==_0x6ce95['pinned']&&_0x6ce95['pinned'],_0x563c57=_0x6ce95['from']?new Date(_0x6ce95['from']['getFullYear'](),_0x6ce95['from']['getMonth'](),_0x6ce95['from']['getDate']()):null,_0x584eaf=_0x6ce95['to']?new Date(_0x6ce95['to']['getFullYear'](),_0x6ce95['to']['getMonth'](),_0x6ce95['to']['getDate']()):null;return this['items']['filter'](_0x184f63=>{if(_0x184f63['pinned']!==_0x1b78e2)return!0x1;if(_0x584eaf){const _0x42ee51=new Date(_0x184f63['createdAt']['getFullYear'](),_0x184f63['createdAt']['getMonth'](),_0x184f63['createdAt']['getDate']());return _0x563c57?_0x563c57['getTime']()===_0x584eaf['getTime']()?_0x42ee51['getTime']()===_0x563c57['getTime']():_0x42ee51<_0x584eaf&&_0x42ee51>=_0x563c57:_0x42ee51<_0x584eaf;}return!0x0;});}}class Ao extends _0x1c4dd1{['_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 _0x12bbbe=this['context']['plugins']['get'](os);try{const _0x505cb2=this['_aiChatController']['getGroupId']();this['history']=new go({'connector':this['_aiConnector'],'group':_0x505cb2}),this['listenTo'](this['_aiChatHistoryUi'],'removeConversation',(_0x1902de,_0x1f9df9)=>{this['_setItemLoading'](_0x1f9df9['id'],'remove'),this['_handleRemove'](_0x1f9df9['id']);}),this['listenTo'](this['_aiChatHistoryUi'],'editConversationTitle',(_0x4b94c4,_0x143dbe)=>{this['_setItemLoading'](_0x143dbe['id'],'rename'),this['_handleEditTitle'](_0x143dbe['id'],_0x143dbe['title']);}),this['listenTo'](this['history'],'itemUpdated',(_0x111e3b,_0x245a7e)=>{void 0x0!==_0x245a7e['updates']['title']&&this['_aiChatHistoryUi']['updateItemTitle'](_0x245a7e['itemId'],_0x245a7e['updates']['title']),void 0x0!==_0x245a7e['updates']['pinned']&&this['_updateHistoryItemsUI'](),this['_clearItemLoading'](_0x245a7e['itemId']);}),this['listenTo'](this['history'],'itemRemoved',(_0x4c1611,_0x26d481)=>{this['_aiChatController']['_handleRemovedConversation'](_0x26d481['itemId']),this['_aiChatHistoryUi']['removeHistoryItem'](_0x26d481['itemId']),this['_clearItemLoading'](_0x26d481['itemId']);}),this['listenTo'](this['history'],'itemsLoaded',()=>{this['_updateHistoryItemsUI']();}),this['listenTo'](this['history'],'error',(_0x210232,_0x46fae9)=>{this['_handleHistoryErrorUI'](_0x46fae9['error'],_0x46fae9['operation'],_0x46fae9['itemId']);}),this['listenTo'](this['_aiChatHistoryUi'],'selectConversation',(_0x16cfaf,_0x80057f)=>{this['_handleSelectConversation'](_0x80057f['id']);}),this['listenTo'](this['_aiChatHistoryUi'],'setConversationPinned',(_0x3a68a0,_0x25705b)=>{const _0x5057cb=_0x25705b['pinned']?'pin':'unpin';this['_setItemLoading'](_0x25705b['id'],_0x5057cb),this['_handleTogglePin'](_0x25705b['id'],_0x25705b['pinned']);}),this['listenTo'](this['_aiChatHistoryUi'],'startConversation',()=>{this['_aiChatController']['startConversation'](),_0x12bbbe['view']['activateTab']('chat');}),this['listenTo'](this['_aiChatController'],'change:activeConversation',()=>{this['_updateHistoryItemsUI']();}),_0x12bbbe['view']['on']('activateTab:history',()=>{this['_showConversationHistory']();});}catch(_0x45ddd4){this['_handleHistoryErrorUI'](_0x45ddd4,'init');}}async['_handleEditTitle'](_0x198afd,_0xbdace5){await this['history']['updateItemTitle'](_0x198afd,_0xbdace5);}async['_handleTogglePin'](_0x2c9452,_0x32e515){await this['history']['updateItemPinned'](_0x2c9452,_0x32e515);}async['_handleRemove'](_0x10f9fa){await this['history']['removeItem'](_0x10f9fa);}async['_handleSelectConversation'](_0x15352c){await this['_aiChatController']['loadConversation'](_0x15352c);}async['_showConversationHistory'](){this['_aiChatHistoryUi']['showError'](''),this['_aiChatHistoryUi']['setLoadingSkeleton'](!0x0),await this['history']['init'](),this['_aiChatHistoryUi']['setLoadingSkeleton'](!0x1);}['_updateHistoryItemsUI'](){const _0x5e7309=this['_aiChatController']['activeConversation']?.['id'],_0x3ed2ad=this['_getCategorizedItems']()['map'](_0xbbbf8c=>({'title':_0xbbbf8c['title'],'items':_0xbbbf8c['items']['map'](_0xbd6498=>({'id':_0xbd6498['id'],'title':_0xbd6498['title']||hs(this['context']['locale'],'AI_CHAT_UNTITLED_CONVERSATION'),'createdAt':new Date(_0xbd6498['createdAt'])['toLocaleDateString'](),'active':_0xbd6498['id']===_0x5e7309,'pinned':_0xbd6498['pinned']}))}));this['_aiChatHistoryUi']['updateItems'](_0x3ed2ad);}['_setItemLoading'](_0x23e2c7,_0x39c33a){this['_aiChatHistoryUi']['updateItemLoadingState'](_0x23e2c7,_0x39c33a,!0x0);}['_clearItemLoading'](_0x368814){this['_aiChatHistoryUi']['updateItemLoadingState'](_0x368814,null,!0x1);}['_handleHistoryErrorUI'](_0x541984,_0x5baef0,_0x1979fa){const _0x306299=this['_generateErrorMessage'](_0x5baef0,_0x1979fa);this['_aiChatHistoryUi']['showError'](_0x306299),_0x1979fa&&this['_clearItemLoading'](_0x1979fa),this['_aiChatHistoryUi']['setLoadingSkeleton'](!0x1);}['_generateErrorMessage'](_0x407cac,_0x73635b){const _0x4244d5=_0x73635b?this['history']['getItem'](_0x73635b):null,_0x2cb257=_0x4244d5?.['title']||hs(this['context']['locale'],'AI_CHAT_UNTITLED_CONVERSATION');switch(_0x407cac){case'updateItemTitle':return hs(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_UPDATE_TITLE',_0x2cb257);case'updateItemPinned':{const _0x4ba4e2=hs(this['context']['locale'],_0x4244d5?.['pinned']?'AI_CHAT_HISTORY_UNPIN_ACTION':'AI_CHAT_HISTORY_PIN_ACTION');return hs(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_UPDATE_PINNED',[_0x4ba4e2,_0x2cb257]);}case'removeItem':return hs(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_REMOVE_ITEM',_0x2cb257);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 _0x1978c7=new Date(),_0x476a24=new Date(_0x1978c7['getFullYear'](),_0x1978c7['getMonth'](),_0x1978c7['getDate']()),_0x3f9106=new Date(_0x476a24);_0x3f9106['setDate'](_0x3f9106['getDate']()-0x1);const _0xfcae8b=new Date(_0x476a24);_0xfcae8b['setDate'](_0xfcae8b['getDate']()-0xe);const _0x26adfb=this['history']['getItems']({'pinned':!0x0}),_0x5e1bbf=this['history']['getItems']({'from':_0x476a24,'to':_0x476a24}),_0x55930e=this['history']['getItems']({'from':_0x3f9106,'to':_0x3f9106}),_0x588f05=this['history']['getItems']({'from':_0xfcae8b,'to':_0x3f9106}),_0x4a7d2e=this['history']['getItems']({'to':_0xfcae8b}),_0x1adf04=[];return _0x26adfb['length']>0x0&&_0x1adf04['push']({'title':hs(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_PINNED'),'items':_0x26adfb}),_0x5e1bbf['length']>0x0&&_0x1adf04['push']({'title':hs(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_TODAY'),'items':_0x5e1bbf}),_0x55930e['length']>0x0&&_0x1adf04['push']({'title':hs(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_YESTERDAY'),'items':_0x55930e}),_0x588f05['length']>0x0&&_0x1adf04['push']({'title':hs(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_LAST_14_DAYS'),'items':_0x588f05}),_0x4a7d2e['length']>0x0&&_0x1adf04['push']({'title':hs(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_LATER'),'items':_0x4a7d2e}),_0x1adf04;}}class Io extends _0x1c4dd1{static get['requires'](){return[Ao,uo];}static get['pluginName'](){return'AIChatHistory';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}class Eo extends _0x1c4dd1{static get['requires'](){return[Xs,Js,ro,Io];}static get['pluginName'](){return'AIChat';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x1d82d7){super(_0x1d82d7),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(_0x4186f9,_0x144fbf){super(_0x4186f9);const {id:_0x1fb094,type:_0x301281,icon:_0xdcd953}=_0x144fbf;this['id']=_0x1fb094,this['set']({'label':_0x144fbf['label'],'withText':!0x0,'class':'ck-ai-chat-shortcut'}),this['extendTemplate']({'attributes':{'data-cke-ai-shortcut-id':_0x144fbf['id']}}),_0xdcd953?this['icon']=_0xdcd953:'chat'===_0x301281?this['icon']=_0x434a83:'review'===_0x301281?this['icon']=_0x2d3729:'translate'===_0x301281&&(this['icon']=_0xc37e4b);}}class mo extends vt{['listView'];constructor(_0x25488c,_0x20aa09){super(_0x25488c);const _0x31853f=_0x20aa09['map'](_0x37c1f3=>{const _0x3d5eee=new Ht(this['locale']),_0x3bf39d=new po(this['locale'],_0x37c1f3);return _0x3d5eee['children']['add'](_0x3bf39d),_0x3bf39d['delegate']('execute')['to'](this),_0x3d5eee;});this['listView']=new Dt(this['locale']),this['listView']['items']['addMany'](_0x31853f),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat-shortcuts']},'children':[this['listView']]});}}const To='chat-shortcuts';class Co extends _0x1c4dd1{['_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 _0x50d357=this['context']['plugins']['get']('AIChatController');this['_shortcuts']['length']&&(this['_validateShortcuts'](),this['_aiChatUI']['on']('conversationCreated',()=>{_0x50d357['activeConversation']['isFromHistory']||this['_injectShortcuts']();}),this['listenTo'](_0x50d357,'interactionStarted',()=>{this['_removeShortcuts']();}));}['_validateShortcuts'](){const _0x2c189b=['chat','review','translate'];this['_shortcuts']['forEach'](_0x49ec5c=>{let _0x51497d=!0x0;if(_0x49ec5c['id']&&_0x49ec5c['label']&&_0x2c189b['includes'](_0x49ec5c['type'])?'chat'===_0x49ec5c['type']&&(_0x51497d='string'==typeof _0x49ec5c['prompt']):_0x51497d=!0x1,!_0x51497d)throw new at('ai-chat-shortcuts-invalid-config',this['context'],{'shortcut':_0x49ec5c});});}['_injectShortcuts'](){const _0x4909ed=this['context']['plugins']['get'](ro);this['_shortcutsView']=new mo(this['context']['locale'],this['_shortcuts']),this['_shortcutsView']['render'](),_0x4909ed['addFeedItemCustomElement'](this['_shortcutsView']['element'],To),this['_shortcutsView']['on']('execute',_0x4ebd63=>{const _0x9c1970=_0x4ebd63['source']['id'];this['_executeShortcut'](_0x9c1970);});}['_removeShortcuts'](){const _0x39e07f=this['context']['plugins']['get'](ro);_0x39e07f['hasFeedItem'](To)&&_0x39e07f['removeFeedItem'](To),this['_shortcutsView']?.['destroy']();}['_executeShortcut'](_0x419c47){const _0x172e25=this['_shortcuts']['find'](_0xdcbf5d=>_0xdcbf5d['id']===_0x419c47),_0x1f0300=_0x172e25['type'];'chat'===_0x1f0300?this['_runChatShortcut'](_0x172e25):'review'===_0x1f0300?_0x172e25['commandId']?this['_runReviewShortcut'](_0x172e25):this['_switchTab']('reviewMode'):'translate'===_0x1f0300&&(_0x172e25['language']?this['_runTranslateShortcut'](_0x172e25):this['_switchTab']('translate'));}['_switchTab'](_0xfee4e7){if(!this['context']['plugins']['has']('AITabs'))throw new at('ai-chat-shortcuts-ai-tabs-not-found',this['context'],{'tabName':_0xfee4e7});this['context']['plugins']['get']('AITabs')['view']['activateTab'](_0xfee4e7);}async['_runChatShortcut']({prompt:_0x112a8d,draftMode:_0x172f92,useWebSearch:_0x2e3a32=!0x1,useReasoning:_0x47ddb3=!0x1,model:_0x274e76}){const _0x158e57=this['context']['plugins']['get']('AIChatController'),_0x9696c4=_0x158e57['activeConversation'];let _0x46ee30;_0x46ee30=_0x274e76?await _0x9696c4['chatModels']['getModel'](_0x274e76):await _0x9696c4['chatModels']['getDefault'](),_0x46ee30&&await _0x9696c4['setModel'](_0x46ee30),_0x9696c4['setWebSearch'](_0x2e3a32),_0x9696c4['setReasoning'](_0x47ddb3),_0x158e57['addCurrentDocumentToChatContext'](),_0x172f92?(this['_aiChatUI']['setPromptInputValue'](_0x112a8d),this['_aiChatUI']['focusPromptInput'](!0x0)):_0x158e57['sendMessage']({'message':_0x112a8d});}['_runReviewShortcut']({commandId:_0x14cf61,model:_0x5d71e3,prompt:_0x3850d8,params:_0x13e3b5}){if(!this['context']['plugins']['has']('AIReviewModeUI'))throw new at('ai-chat-shortcuts-review-mode-not-found',this['context']);this['_switchTab']('reviewMode');const _0x204881={'id':_0x14cf61,'isCustom':'custom'===_0x14cf61};_0x5d71e3&&_0x3850d8&&(_0x204881['args']={'model':_0x5d71e3,'prompt':_0x3850d8}),_0x13e3b5&&(_0x204881['params']=_0x13e3b5),this['context']['plugins']['get']('AIReviewModeUI')['fire']('runReviewCheck',_0x204881);}['_runTranslateShortcut']({language:_0x380891}){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':_0x380891,'args':{'language':_0x380891}});}}class wo extends _0x3279ff{constructor(_0x4b6eb1){super(_0x4b6eb1);const _0x5a9d88=_0x4b6eb1['plugins']['get']('AITabs')['view'];this['bind']('value')['to'](_0x5a9d88,'isVisible'),this['isEnabled']=!0x0;}['execute'](){const _0x2c82a5=this['editor']['plugins']['get']('AITabs')['view'];_0x2c82a5['isVisible']=!_0x2c82a5['isVisible'];}}class fo extends _0x5d673d{static get['requires'](){return[os];}static get['pluginName'](){return'AIToggleButtonUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const _0xf3bc17=this['editor'];_0xf3bc17['commands']['add']('toggleAi',new wo(_0xf3bc17)),_0xf3bc17['ui']['componentFactory']['add']('toggleAi',()=>{const _0x3b6131=this['_createAIUIButton'](Nt);return _0x3b6131['set']({'tooltip':!0x0,'class':'ck-ai-toggle-button'}),_0x3b6131;}),_0xf3bc17['ui']['componentFactory']['add']('menuBar:toggleAi',()=>{const _0x13be21=this['_createAIUIButton'](Wt);return _0x13be21['set']({'role':'menuitemcheckbox'}),_0x13be21;});}['_createAIUIButton'](_0x38fbd3){const _0x42627d=this['editor'],_0xb974c6=_0x42627d['commands']['get']('toggleAi'),_0x2cd1c2=new _0x38fbd3(_0x42627d['locale']);return _0x2cd1c2['set']({'label':hs(_0x42627d['locale'],'AI_TOGGLE_BUTTON_LABEL'),'icon':_0x5b171f,'isToggleable':!0x0}),_0x2cd1c2['bind']('isEnabled')['to'](_0xb974c6),_0x2cd1c2['bind']('isOn')['to'](_0xb974c6,'value',_0x5f3c4e=>!!_0x5f3c4e),this['listenTo'](_0x2cd1c2,'execute',()=>{_0xb974c6['execute']();}),_0x2cd1c2;}}const bo=['applySuggestion','insertSuggestion','showNext','showPrevious'];class So extends vt{['_errorView'];constructor(_0xde78dc){super(_0xde78dc),this['set']('_errorMessage',''),this['set']('_isErrorVisible',!0x1);}['showBlockingError'](_0x2009d4){this['showError'](_0x2009d4);}['showError'](_0x5b672b){this['_errorView']||(this['_errorView']=this['_createErrorView']()),this['_errorMessage']=_0x5b672b,this['_isErrorVisible']=!0x0;}['hideError'](){this['_isErrorVisible']=!0x1;}['_createErrorView'](){const _0x5edb9d=new vt(this['locale']),_0x309e02=new vt(this['locale']);return _0x309e02['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai-suggestion__error-text']},'children':[{'text':this['bindTemplate']['to']('_errorMessage')}]}),_0x5edb9d['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__error','ck-ai-balloon-error',this['bindTemplate']['if']('_isErrorVisible','ck-hidden',_0x55f1e6=>!_0x55f1e6)]},'children':[_0x309e02]}),_0x5edb9d;}}const Ro=0xa;class Oo extends _0x1c4dd1{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'](_0x3ff1cd){const {id:_0x381c4a}=this['_currentConfig']??{};this['_currentConfig']=_0x3ff1cd;const {id:_0x437f26}=this['_currentConfig'];this['isOpen']&&_0x381c4a===_0x437f26?this['_updateDialog']():this['_showDialog']();}['close'](){const _0x11b384=this['_getTargetEditor']()['plugins']['get']('Dialog');_0x11b384['isOpen']&&this['_currentConfig']&&_0x11b384['id']===this['_currentConfig']['id']&&_0x11b384['hide']();}['_updateDialog'](){const _0x13eef7=this['_getTargetEditor']()['plugins']['get']('Dialog'),{icon:_0x44d07f,title:_0x3b197c}=this['_currentConfig'];_0x13eef7['view']?.['headerView']&&(_0x13eef7['view']['headerView']['label']=_0x3b197c,_0x13eef7['view']['headerView']['iconView']&&_0x44d07f&&(_0x13eef7['view']['headerView']['iconView']['content']=_0x44d07f)),this['_isUpdatingMarkers']=!0x0,this['_showFakeVisualSelection'](),this['_isUpdatingMarkers']=!0x1,_0x13eef7['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 _0x1c9962=this['_getTargetEditor']()['plugins']['get']('Dialog'),{id:_0x5e620f,title:_0x2badfd,icon:_0x2a240d,class:_0x45ffad,mainView:_0x4772f0}=this['_currentConfig'];_0x4772f0['delegate'](...bo)['to'](this),_0x1c9962['show']({'title':_0x2badfd,'icon':_0x2a240d,'hasCloseButton':!0x0,'id':_0x5e620f,'position':this['_calculateDialogPosition']['bind'](this),'className':'ck-ai-balloon\x20'+(_0x45ffad||''),'content':_0x4772f0,'onShow':_0x36626a=>{this['_showFakeVisualSelection'](),this['_setupFakeVisualSelectionMarkerRemovalListener'](),_0x36626a['view']?.['updatePosition']();const _0x29b5e9=this['_getSelectionElements']();_0x29b5e9&&_0x29b5e9[0x0]&&Ct({'target':_0x29b5e9[0x0],'ancestorOffset':0x14,'alignToTop':!0x0,'viewportOffset':{'top':0x14,'bottom':0x14,'left':0x0,'right':0x0}}),this['isOpen']=!0x0,_0x36626a['once']('hide',()=>{this['fire']('beforeDialogClosed',{'id':_0x5e620f});},{'priority':'high'});},'onHide':()=>{this['_hideFakeVisualSelection'](),this['_cleanupFakeVisualSelectionMarkerRemovalListener'](),this['fire']('dialogClosed',{'id':_0x5e620f}),this['isOpen']=!0x1;}});}['_calculateDialogPosition'](_0x35923c,_0x2b2974){if(!_0x2b2974){const _0x3f75db=this['_getTargetRootDomRect']();if(!_0x3f75db)return null;_0x2b2974=_0x3f75db;}const _0x5745be=this['_getSelectionElements']();if(!_0x5745be||0x0===_0x5745be['length'])return{'left':Math['round'](_0x2b2974['left']+_0x2b2974['width']/0x2-_0x35923c['width']/0x2),'top':Math['round'](_0x2b2974['top']+_0x2b2974['height']/0x2-_0x35923c['height']/0x2)};const _0x5d6bd2=Math['round'](_0x2b2974['left']+_0x2b2974['width']/0x2-_0x35923c['width']/0x2),_0x371850=_0x5745be['map'](_0x31c0f0=>new ut(_0x31c0f0)),_0x22c03d=_0x35923c['height'];return{'left':_0x5d6bd2,'top':this['_calculateOptimalTopPosition'](_0x371850,_0x22c03d,_0x2b2974)};}['_calculateOptimalTopPosition'](_0x5c977a,_0x37a56b,_0x576aad){const _0x99549d=new ut(ct['window']),_0x17e1af=_0x5c977a['map'](_0x3f29b2=>_0x3f29b2['getVisible']())['filter'](_0x45d351=>_0x45d351),_0x45cab3=ut['getBoundingRect'](_0x17e1af);if(!_0x45cab3)return Math['round'](_0x576aad['top']+_0x576aad['height']/0x2);const _0xc0febf=_0x99549d['getIntersection'](_0x45cab3);if(!_0xc0febf)return Math['round'](_0x576aad['top']+_0x576aad['height']/0x2);const _0x5adbba=_0x576aad['getVisible'](),_0x12ebeb=_0x5adbba&&_0x45cab3['height']>_0x5adbba['height'],_0x4979db=_0xc0febf['top'],_0x296352=_0xc0febf['bottom'];if(_0x12ebeb){const _0x1054c3=(_0x5adbba||_0x99549d)['height']/0x2-_0x37a56b/0x2,_0x27ff77=_0x4979db-Ro-_0x576aad['top'],_0xcf09a4=_0x576aad['bottom']-_0x296352-Ro;return _0x27ff77>=_0x37a56b?Math['max'](Ro,_0x4979db-_0x37a56b-Ro):_0xcf09a4>=_0x37a56b?_0x296352+Ro:Math['max'](Ro,_0x1054c3);}const _0xa9eccb=_0x4979db-_0x37a56b,_0x160e5e=_0x576aad['bottom']-_0x296352-Ro,_0xdd4e07=_0x4979db-Ro-_0x576aad['top'];let _0x12b8ef;if(_0x160e5e>=_0x37a56b)_0x12b8ef=_0x296352+Ro;else{if(_0xdd4e07>=_0x37a56b)_0x12b8ef=_0xa9eccb-Ro;else _0x12b8ef=_0x4979db+_0x45cab3['height']/0x2-_0x37a56b/0x2;}return _0x12b8ef;}['_setupFakeVisualSelectionMarkerRemovalListener'](){const _0x55e3ff=this['_getTargetEditor']();this['listenTo'](_0x55e3ff['model']['document'],'change',()=>{if(!this['_isUpdatingMarkers']){for(const {name:_0x5c1175,data:{newRange:_0x27d6b9}}of _0x55e3ff['model']['document']['differ']['getChangedMarkers']())if(_0x5c1175['startsWith'](zs+':')&&(_0x27d6b9&&(_0x27d6b9['start']['isEqual'](_0x27d6b9['end'])||'$graveyard'==_0x27d6b9['root']['rootName'])||null==_0x27d6b9)){const _0x435da1=hs(this['context']['locale'],'AI_BALLOON_SELECTION_REMOVED_ERROR');this['_currentConfig']['mainView']['showBlockingError'](_0x435da1),this['fire']('selectionRemoved');}}});}['_cleanupFakeVisualSelectionMarkerRemovalListener'](){const _0x399fc3=this['_getTargetEditor']();this['_currentConfig']['mainView']['hideError'](),this['stopListening'](_0x399fc3['model']['document']);}['_getSelectionElements'](){const _0x2b4f48=this['_getTargetEditor']();return _0x4839b5(_0x2b4f48['editing'],[..._0x2b4f48['model']['markers']['getMarkersGroup']('ai-selection'),..._0x2b4f48['model']['markers']['getMarkersGroup']('ai-balloon-selection')]);}['_getTargetRootDomRect'](){const _0x421a8d=this['_currentConfig']?.['ranges']?.[0x0]?.['root'];if(!_0x421a8d)return null;const _0x20dc2a=this['_getTargetEditor'](),_0x47821a=_0x20dc2a['editing']['view']['document']['getRoot'](_0x421a8d['rootName']);if(!_0x47821a)return null;const _0x164d2e=_0x20dc2a['editing']['view']['domConverter']['mapViewToDom'](_0x47821a);return _0x164d2e&&_0x164d2e instanceof HTMLElement?new ut(_0x164d2e):null;}}class ko extends kt{['copyButton'];['likeButton'];['dislikeButton'];['showChangesButton'];['_config'];constructor(_0x284ad9,_0x1583c8={}){super(_0x284ad9),this['set']('isEnabled',!0x0),this['set']('isShowChangesOn',!0x1),this['_config']={'showCopy':!0x1,'showLike':!0x1,'showDislike':!0x1,..._0x1583c8};const _0x3c9f67=!(this['_config']['showCopy']||this['_config']['showChanges']||this['_config']['showLike']||this['_config']['showDislike']||this['_config']['customView']?.['length']);this['class']=_0x3c9f67?'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'](_0x163ed3){this['showChangesButton']['isEnabled']=_0x163ed3;}['_setupRatingButtons'](){this['likeButton']=new Nt(this['locale']),this['likeButton']['set']({'icon':_0x4980f4,'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':_0x91f3bb,'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':_0x4e9d44,'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 _0x1314d4=new xt();_0x1314d4['set']({'content':_0xaff33c}),_0x1314d4['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'](_0x1314d4);}['_setupShowChangesButton'](){this['showChangesButton']=new Nt(this['locale']),this['showChangesButton']['set']({'icon':_0x4fcfde,'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',_0x17d06a=>_0x17d06a?_0x5c77ce:_0x4fcfde),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(_0x50f1f2,_0x2357dc){super(_0x50f1f2);const _0x2c9630=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']=_0x2357dc,this['nextButtonView']=this['_createNextButtonView'](),this['previousButtonView']=this['_createPreviousButtonView'](),this['_streamableContentView']=new In(_0x50f1f2),this['_partToolbarView']=new _n(_0x50f1f2,_0x2357dc['availableActions']),this['_partToolbarView']['delegate']('applySuggestion','insertSuggestion','rejectSuggestion')['to'](this),this['_togglePartToolbarButtonsVisibility'](_0x2357dc),this['_stateView']=new un(_0x50f1f2),this['_stateView']['isVisible']=!0x1,this['_miniToolbarView']=new ko(_0x50f1f2,{'showChanges':'full'}),this['_miniToolbarView']['bind']('isShowChangesOn')['to'](this,'showDiff'),this['_miniToolbarView']['on']('toggleShowChanges',()=>{this['fire']('toggleSuggestionDisplayMode');}),this['_toolbarContainerView']=new vo(_0x50f1f2,[this['_partToolbarView'],this['_stateView'],this['_miniToolbarView']]),this['children']=this['createCollection']([this['_streamableContentView'],this['_toolbarContainerView']]),this['on']('change:_state',(_0x164f1e,_0x51f2e7,_0x1f44ad,_0x145ed0)=>{let _0x16991f,_0x421a78;'pending'===_0x145ed0?(_0x16991f=this['_partToolbarView'],_0x421a78=this['_stateView']):(_0x16991f=this['_stateView'],_0x421a78=this['_partToolbarView']),this['_stateView']['setState'](_0x1f44ad),_0x16991f['isVisible']=!0x1,_0x421a78['isVisible']=!0x0;}),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat-balloon-main',_0x2c9630['to']('_state',_0x1c715f=>'ck-ai-chat-balloon-main_state_'+_0x1c715f)]},'children':this['children']}),this['on']('change:isTrackChangesOn',()=>{this['_togglePartToolbarButtonsVisibility'](_0x2357dc);});}['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'](_0x46a082){_0x46a082?.['keepErrors']||this['hideError'](),await this['_streamableContentView']['update'](_0x46a082);}['setState'](_0x25ae8f){this['_state']=_0x25ae8f;}['showError'](_0x1be89a){super['showError'](_0x1be89a),this['children']['has'](this['_errorView'])||this['children']['add'](this['_errorView'],0x0);}['hideError'](){this['_isErrorVisible']&&(super['hideError'](),this['togglePartToolbarEnabled'](!0x0));}['showBlockingError'](_0x5e0ea8){super['showBlockingError'](_0x5e0ea8),this['togglePartToolbarEnabled'](!0x1);}['toggleRotatorButtonsVisibility'](_0x540e6f){this['nextButtonView']['isVisible']=this['previousButtonView']['isVisible']=_0x540e6f;}['togglePartToolbarEnabled'](_0x3a8dd0){this['_partToolbarView']['isEnabled']=_0x3a8dd0;}['_togglePartToolbarButtonsVisibility']({showApplyButton:_0x5786c6,showSuggestButton:_0x4cdd74}){_0x5786c6=_0x5786c6&&!this['isTrackChangesOn']&&this['_config']['availableActions']['includes']('applySuggestion'),_0x4cdd74=_0x4cdd74&&this['_config']['availableActions']['includes']('insertSuggestion'),this['_partToolbarView']['setButtonsVisibility']({'showApplyButton':_0x5786c6,'showSuggestButton':_0x4cdd74});}['_createNextButtonView'](){const _0x37bc8b=new Nt(this['locale']);return _0x37bc8b['set']({'icon':_0x3bd23d,'label':hs(this['locale'],'AI_BALLOON_NEXT_LABEL'),'isVisible':!0x0}),_0x37bc8b['on']('execute',()=>{this['fire']('showNext');}),_0x37bc8b;}['_createPreviousButtonView'](){const _0x2eb60a=new Nt(this['locale']);return _0x2eb60a['set']({'icon':_0x534770,'label':hs(this['locale'],'AI_BALLOON_PREVIOUS_LABEL'),'isVisible':!0x0}),_0x2eb60a['on']('execute',()=>{this['fire']('showPrevious');}),_0x2eb60a;}}class vo extends vt{constructor(_0x36eacd,_0x2168cf){super(_0x36eacd),this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-chat-balloon__toolbar-container']},'children':_0x2168cf});}}class yo extends _0x5d673d{static get['requires'](){return[Bt,Oo];}static get['pluginName'](){return'AIChatBalloon';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['_chatBalloonView'];constructor(_0x8529a6){super(_0x8529a6),this['set']('showDiff',!0x1);}['open'](_0x543e52){const _0x48ae2b=this['editor'];this['_chatBalloonView']||(this['_chatBalloonView']=this['_createChatBalloonView']()),_0x48ae2b['plugins']['get']('AIBalloon')['open']({..._0x543e52,'id':'aiChatBalloon','class':'ck-ai-chat-balloon','mainView':this['_chatBalloonView']}),this['_toggleRotatorButtonsInDialogHeader'](_0x543e52['showRotator']),this['_chatBalloonView']['togglePartToolbarEnabled'](!_0x543e52['areActionsDisabled']),this['_restoreDefaultViewFocus']();}['close'](){this['editor']['plugins']['get']('AIBalloon')['close']();}['updateContent'](_0x2ba4a0){return this['_chatBalloonView']||(this['_chatBalloonView']=this['_createChatBalloonView']()),this['_chatBalloonView']['updateContent'](_0x2ba4a0);}['setState'](_0x3dc7a5){this['_chatBalloonView']&&this['_chatBalloonView']['setState'](_0x3dc7a5);}['_createChatBalloonView'](){const _0x5f09db=this['editor'],_0x490d73=_0x5f09db['plugins']['get']('AIBalloon'),_0x439b0a=_0x5f09db['commands']['get']('trackChanges');let _0x3e56b8=_0x5f09db['config']['get']('ai.availableReplyActions')||[...fn];_0x5f09db['plugins']['has']('TrackChanges')||(_0x3e56b8=_0x3e56b8['filter'](_0x4c7ff9=>'insertSuggestion'!=_0x4c7ff9));const _0x3be8bf=new No(_0x5f09db['locale'],{'availableActions':_0x3e56b8,'showApplyButton':!0x0,'showSuggestButton':!!_0x439b0a});return _0x3be8bf['bind']('showDiff')['to'](this),_0x3be8bf['delegate'](...Zs)['to'](this),_0x3be8bf['delegate']('showPrevious','showNext')['to'](this),_0x490d73['delegate']('dialogClosed')['to'](this),_0x3be8bf['on']('applySuggestion',this['_restoreDefaultViewFocus']['bind'](this)),_0x3be8bf['on']('insertSuggestion',this['_restoreDefaultViewFocus']['bind'](this)),_0x3be8bf['on']('rejectSuggestion',this['_restoreDefaultViewFocus']['bind'](this)),_0x439b0a&&_0x3be8bf['bind']('isTrackChangesOn')['to'](_0x439b0a,'value'),_0x3be8bf['render'](),_0x3be8bf;}['_toggleRotatorButtonsInDialogHeader'](_0x1cfdfb){const _0x3e3710=this['editor'],_0x1c0564=_0x3e3710['plugins']['get']('Dialog')['view']['headerView']['children'];this['_chatBalloonView']['toggleRotatorButtonsVisibility'](_0x1cfdfb),_0x1c0564['has'](this['_chatBalloonView']['previousButtonView'])||(_0x1c0564['addMany']([this['_chatBalloonView']['previousButtonView'],this['_chatBalloonView']['nextButtonView']],0x0),_0x3e3710['plugins']['get']('AIBalloon')['once']('beforeDialogClosed',()=>{_0x1c0564['remove'](this['_chatBalloonView']['previousButtonView']),_0x1c0564['remove'](this['_chatBalloonView']['nextButtonView']);}));}['_restoreDefaultViewFocus'](){this['_chatBalloonView']['focus']();}}class xo extends _0x5d673d{static get['requires'](){return[fo,yo,_0x20dfb2];}static get['pluginName'](){return'AIEditorIntegration';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}function Lo(_0xa0c475){const {editor:_0xdeaf60,action:_0x2a5c6e,withText:_0x513754=!0x1,withIcon:_0x2a3844=!0x0,isInDropdown:_0x57ae3a=!0x0,shouldPreventFocus:_0x3877b1=!0x1}=_0xa0c475;return()=>{const _0x50d896=_0xdeaf60['locale'],_0xf53213=new Nt(_0x50d896),_0x56e024=_0xf53213['bindTemplate'];_0x57ae3a&&_0xf53213['extendTemplate']({'on':{'mouseenter':_0x56e024['to'](()=>{_0x3877b1&&_0x3877b1()||_0xf53213['focus']();})}});const _0x4467c5=_0x2a5c6e['icon']??_0x2a5c6e['parent']?.['icon'];return _0xf53213['set']({'label':_0x2a5c6e['label'],'withText':_0x513754,'role':'menuitem','icon':_0x2a3844?_0x4467c5??_0x215c21:void 0x0,'tooltip':!_0x513754,'class':'ck-ai-quick-actions-button','isEnabled':_0x2a5c6e['isEnabled']}),_0xf53213['on']('execute',()=>{_0xdeaf60['editing']['view']['focus'](),_0xdeaf60['commands']['execute']('aiQuickAction',_0x2a5c6e);}),_0xf53213;};}class Do extends _0xf7990c{['arrowView'];constructor(_0x5981b3,_0x323bb7){super(_0x5981b3,_0x323bb7);const _0x5c7955=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',_0xbea353=>String(_0xbea353)),'data-cke-tooltip-disabled':_0x5c7955['to']('isOn')},'on':{'mouseenter':_0x5c7955['to']('mouseenter')}});}['render'](){super['render'](),this['children']['add'](this['arrowView']);}['_createArrowView'](){const _0x15d5aa=new xt();return _0x15d5aa['content']=_0x5abe6d,_0x15d5aa['extendTemplate']({'attributes':{'class':'ck-dropdown-menu-list__nested-menu__button__arrow'}}),_0x15d5aa;}}class Po extends Dt{['_allListItems'];['_allSearchableItems'];constructor(_0x4e9a2c,_0x11e3b0,_0x185f88){super(_0x4e9a2c),this['_allListItems']=_0x11e3b0,this['_allSearchableItems']=_0x185f88;}['filter'](_0x1eddb9){if(!_0x1eddb9)return this['items']['clear'](),this['items']['addMany'](this['_allListItems']),this['_clearHighlight'](),{'resultsCount':this['_allListItems']['length'],'totalItemsCount':this['_allListItems']['length']};const _0x23d3f9=_0x1eddb9['source']['toLowerCase']()['trim'](),_0x34ad3d=this['_allSearchableItems']['filter'](_0x38642a=>(_0x38642a['groupLabel']?_0x38642a['label']+'\x20('+_0x38642a['groupLabel']+')':_0x38642a['label'])['toLowerCase']()['includes'](_0x23d3f9));return this['items']['clear'](),this['items']['addMany'](_0x34ad3d['sort']((_0x3b6159,_0x3dc0a5)=>{const _0x5df1de=_0x3b6159['groupLabel'],_0xdfb59d=_0x3dc0a5['groupLabel'];return _0x5df1de||_0xdfb59d?_0x5df1de?0x1:-0x1:0x0;})['map'](_0x51a0f1=>_0x51a0f1['item'])),this['_highlightQuery'](_0x23d3f9,_0x34ad3d),{'resultsCount':_0x34ad3d['length'],'totalItemsCount':this['_allSearchableItems']['length']};}['_highlightQuery'](_0xfd3045,_0x22a185){if(!_0xfd3045)return;const _0x278423=new RegExp(_0x4f9813(_0xfd3045),'gi');_0x22a185['forEach'](_0x10ca7c=>{_0x10ca7c['highlightViews']&&_0x10ca7c['highlightViews']['forEach'](_0x78cfd5=>{'function'==typeof _0x78cfd5['highlightText']&&_0x78cfd5['highlightText'](_0x278423);});});}['_clearHighlight'](){this['_allSearchableItems']['forEach'](_0x35b5b5=>{_0x35b5b5['highlightViews']&&_0x35b5b5['highlightViews']['forEach'](_0x566c17=>{'function'==typeof _0x566c17['highlightText']&&_0x566c17['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(_0x350f0a,_0xa13bc9,_0xfbaf92,_0x409d26,_0x135bbd=!0x1){const _0x350912=_0x350f0a['locale'];super(_0x350912),this['_bodyCollection']=_0x409d26,this['_hasSearch']=_0x135bbd;const _0x45d056=this['_createListItems'](_0x350f0a,_0xa13bc9,_0xfbaf92);this['optionsListView']=new Po(_0x350912,_0x45d056,this['_allSearchableItems']),this['optionsListView']['role']=Ho,this['optionsListView']['items']['addMany'](_0x45d056),this['focusTracker']=new _t(),this['keystrokes']=new gt(),_0x135bbd&&(this['_searchTextView']=this['_createSearchTextView']()),this['_focusables']=_0x45d056,this['focusCycler']=new Ut({'focusables':this['_focusables'],'focusTracker':this['focusTracker'],'keystrokeHandler':this['keystrokes']}),_0x135bbd&&this['_searchTextView']&&this['focusCycler']['chain'](this['_searchTextView']['focusCycler']);const _0xb96a33=_0x135bbd&&this['_searchTextView']?[this['_searchTextView']]:[this['optionsListView']];this['children']=new _0x54e610(_0xb96a33),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset_all','ck-ai-quick-actions','ck-rounded-corners'],'dir':_0x350912['uiLanguageDirection']},'children':this['children']});}['_createSearchTextView'](){return new _0x3e041a(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 _0x108b1d=this['_searchTextView']['queryView']['fieldView']['element']['ownerDocument']?.['activeElement'];return this['_searchTextView']['queryView']['fieldView']['element']['contains'](_0x108b1d);}['_createListItems'](_0x1ab46e,_0x18a018,_0x5b57db){const _0x4c44c7=new _0x54e610();return _0x18a018['forEach'](_0x155472=>{if('actions'in _0x155472){const {listItem:_0x359b85}=this['_createActionGroupButton'](_0x1ab46e,_0x155472,_0x5b57db);_0x4c44c7['add'](_0x359b85),_0x155472['actions']['forEach'](_0x4e47ad=>{this['_createActionButton'](_0x1ab46e,_0x4e47ad,_0x155472['label'],_0x155472['icon']);const {listItem:_0x506b6d,highlightViews:_0x2c7f29}=this['_createSearchResultActionButton'](_0x1ab46e,_0x4e47ad,_0x155472['label'],_0x155472['icon']);this['_allSearchableItems']['push']({'item':_0x506b6d,'label':_0x4e47ad['label'],'groupLabel':_0x155472['label'],'highlightViews':_0x2c7f29});});}else{const {listItem:_0x31e693}=this['_createActionButton'](_0x1ab46e,_0x155472);_0x4c44c7['add'](_0x31e693);const _0x292264=_0x31e693['children']['first'];if(_0x292264){const {listItem:_0x378c89,highlightViews:_0x23ada4}=this['_createSearchResultActionButton'](_0x1ab46e,_0x155472);this['_allSearchableItems']['push']({'item':_0x378c89,'label':_0x292264['label']||'','highlightViews':_0x23ada4});}}}),_0x4c44c7;}['_createActionButton'](_0x5716a7,_0x31ad65,_0x5c6701,_0x38b862){const _0x51a5cc=new Ht(this['locale']);if(_0x5c6701&&_0x38b862){const _0x2fe207=new Nt(this['locale']),_0x306cf9=_0x2fe207['bindTemplate'],_0x15585f=new _0x4a528a();_0x15585f['text']=_0x31ad65['label'];const _0x4b28e1=new _0x4a528a();_0x4b28e1['text']=_0x5c6701;const _0x2101f3=new xt();_0x2101f3['content']=_0x38b862,_0x2101f3['extendTemplate']({'attributes':{'class':'ck-ai-quick-actions-button__group-icon'}});const _0x2d4104=new vt(this['locale']);_0x2d4104['setTemplate']({'tag':'span','attributes':{'class':'ck-ai-quick-actions-button_with-group__open-paren'},'children':[{'text':'\x20('}]});const _0x1c3c1e=new vt(this['locale']);return _0x1c3c1e['setTemplate']({'tag':'span','attributes':{'class':'ck-ai-quick-actions-button_with-group__close-paren'},'children':[{'text':')'}]}),_0x2fe207['set']({'label':_0x31ad65['label']+'\x20('+_0x5c6701+')','withText':!0x0,'role':'menuitem','class':'ck-ai-quick-actions-button\x20ck-ai-quick-actions-button_with-group','tooltip':!0x1}),_0x2fe207['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':[_0x15585f,_0x2d4104,_0x2101f3,_0x4b28e1,_0x1c3c1e],'on':{'mouseenter':_0x306cf9['to'](()=>{this['_isSearchFocused']()||_0x2fe207['focus']();}),'click':_0x306cf9['to'](()=>{_0x2fe207['fire']('execute');})}}),_0x2fe207['on']('execute',()=>{_0x5716a7['editing']['view']['focus'](),_0x5716a7['commands']['execute']('aiQuickAction',_0x31ad65);}),_0x51a5cc['children']['add'](_0x2fe207),{'listItem':_0x51a5cc,'highlightViews':[_0x15585f,_0x4b28e1]};}{const _0x398ae6=new _0x5c7c99(),_0x34cf2e=new Nt(this['locale'],_0x398ae6),_0x7a4897=_0x34cf2e['bindTemplate'],_0x190511=_0x31ad65['icon']??_0x31ad65['parent']?.['icon'],_0x3431a3=void 0x0!==_0x31ad65['icon'];return _0x34cf2e['set']({'label':_0x31ad65['label'],'withText':!0x0,'role':'menuitem','icon':_0x3431a3?_0x190511??_0x215c21:void 0x0,'tooltip':!0x1,'class':'ck-ai-quick-actions-button'}),_0x34cf2e['extendTemplate']({'on':{'mouseenter':_0x7a4897['to'](()=>{this['_isSearchFocused']()||_0x34cf2e['focus']();})}}),_0x34cf2e['on']('execute',()=>{_0x5716a7['editing']['view']['focus'](),_0x5716a7['commands']['execute']('aiQuickAction',_0x31ad65);}),_0x51a5cc['children']['add'](_0x34cf2e),{'listItem':_0x51a5cc,'highlightViews':[_0x398ae6]};}}['_createSearchResultActionButton'](_0x427926,_0xc00ccf,_0xaf4224,_0x2ffc3c){return _0xaf4224&&_0x2ffc3c?this['_createSearchResultGroupedActionButton'](_0x427926,_0xc00ccf,_0xaf4224,_0x2ffc3c):this['_createSearchResultIndividualActionButton'](_0x427926,_0xc00ccf);}['_createSearchResultGroupedActionButton'](_0x45606,_0x5cb9d6,_0x1f8c97,_0x50a770){const _0x32cbe2=new Ht(this['locale']),_0x5bdb40=new Nt(this['locale']),_0x4f0de0=_0x5bdb40['bindTemplate'],{view:_0x534e75,highlightView:_0x70277f}=this['_createSearchResultGroupRow'](_0x1f8c97,_0x50a770),{view:_0x90258f,highlightView:_0x281107}=this['_createSearchResultActionRow'](_0x5cb9d6['label']),_0x35be81=this['_createSearchResultContentView'](_0x534e75,_0x90258f);return _0x5bdb40['set']({'label':_0x5cb9d6['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}),_0x5bdb40['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':[_0x35be81],'on':{'mouseenter':_0x4f0de0['to'](()=>{this['_isSearchFocused']()||_0x5bdb40['focus']();}),'click':_0x4f0de0['to'](()=>{this['_handleSearchResultButtonClick'](_0x5bdb40);})}}),this['_setupActionButtonExecution'](_0x5bdb40,_0x45606,_0x5cb9d6),_0x32cbe2['children']['add'](_0x5bdb40),{'listItem':_0x32cbe2,'highlightViews':[_0x70277f,_0x281107]};}['_createSearchResultIndividualActionButton'](_0x53af10,_0x5791d1){const _0x171cf9=new Ht(this['locale']),_0x4a2f1e=new _0x5c7c99(),_0x501fa1=new Nt(this['locale'],_0x4a2f1e),_0x1e8768=_0x501fa1['bindTemplate'];return _0x501fa1['set']({'label':_0x5791d1['label'],'withText':!0x0,'role':'menuitem','icon':void 0x0,'tooltip':!0x1,'class':'ck-ai-quick-actions-button\x20ck-ai-quick-actions-search-result-button'}),_0x501fa1['extendTemplate']({'on':{'mouseenter':_0x1e8768['to'](()=>{this['_isSearchFocused']()||_0x501fa1['focus']();})}}),this['_setupActionButtonExecution'](_0x501fa1,_0x53af10,_0x5791d1),_0x171cf9['children']['add'](_0x501fa1),{'listItem':_0x171cf9,'highlightViews':[_0x4a2f1e]};}['_createSearchResultGroupRow'](_0x57eb57,_0x395347){const _0x76beed=new vt(this['locale']),_0x1a85b8=new xt();_0x1a85b8['content']=_0x395347,_0x1a85b8['extendTemplate']({'attributes':{'class':'ck-ai-quick-actions-button__group-icon'}});const _0x39e11a=new _0x4a528a();return _0x39e11a['text']=_0x57eb57,_0x76beed['setTemplate']({'tag':'div','attributes':{'class':'ck-ai-quick-actions-search-result__group-row'},'children':[_0x1a85b8,_0x39e11a]}),{'view':_0x76beed,'highlightView':_0x39e11a};}['_createSearchResultActionRow'](_0x142e73){const _0x1f5779=new vt(this['locale']),_0x431729=new _0x4a528a();return _0x431729['text']=_0x142e73,_0x1f5779['setTemplate']({'tag':'div','attributes':{'class':'ck-ai-quick-actions-search-result__action-row'},'children':[_0x431729]}),{'view':_0x1f5779,'highlightView':_0x431729};}['_createSearchResultContentView'](_0x2fe514,_0x24cf64){const _0xbbcf32=new vt(this['locale']);return _0xbbcf32['setTemplate']({'tag':'div','attributes':{'class':'ck-ai-quick-actions-search-result__content'},'children':[_0x2fe514,_0x24cf64]}),_0xbbcf32;}['_setupActionButtonExecution'](_0x17ef0b,_0x1831b2,_0x46f4b5){_0x17ef0b['on']('execute',()=>{_0x1831b2['editing']['view']['focus'](),_0x1831b2['commands']['execute']('aiQuickAction',_0x46f4b5);});}['_createActionGroupButton'](_0x4812b2,_0x31eece,_0x2ec9){const _0x1e9b23=new Ht(this['locale']),_0x1de9f9=new _0x5c7c99(),_0x22c9fd=new Do(this['locale'],_0x1de9f9),_0x21cbfb=_0x22c9fd['bindTemplate'],_0x112301=this['_getPanelKeystroke'](_0x2ec9),_0x475194=this['_createGroupActionsList'](_0x4812b2,_0x31eece['actions'],_0x2ec9);_0x22c9fd['set']({'label':_0x31eece['label'],'withText':!0x0,'role':Mo,'icon':_0x31eece['icon']??_0x215c21,'isEnabled':_0x31eece['actions']['some'](_0x129142=>_0x129142['isEnabled'])}),_0x22c9fd['extendTemplate']({'on':{'mouseenter':_0x21cbfb['to'](()=>{this['_isSearchFocused']()||_0x22c9fd['focus']();})}});const _0x3484b0=new Xt(this['locale']);return _0x3484b0['extendTemplate']({'attributes':{'class':['ck','ck-reset_all','ck-ai-quick-actions-group-panel','ck-dropdown-menu__nested-menu__panel']},'on':{'keydown':_0x21cbfb['to'](_0x3a540b=>{this['_handlePanelKeydown'](_0x3a540b,_0x112301,_0x22c9fd,_0x3484b0);})}}),_0x22c9fd['bind']('isOn')['to'](_0x3484b0,'isVisible'),this['_bodyCollection']['add'](_0x3484b0),_0x3484b0['content']['add'](_0x475194),this['_setupGroupMenuBehavior'](_0x22c9fd,_0x3484b0),_0x1e9b23['children']['add'](_0x22c9fd),{'listItem':_0x1e9b23,'highlightView':_0x1de9f9};}['_createGroupActionsList'](_0x120fea,_0x48fc6c,_0x3551d3){const _0x13ef44=new Dt(this['locale']);return _0x13ef44['extendTemplate']({'attributes':{'class':['ck','ck-reset_all','ck-ai-quick-actions-group-list','ck-dropdown-menu-list']}}),_0x48fc6c['forEach'](_0x5ad051=>{const _0x3c8817=new Ht(this['locale']),_0x50ffae=Lo({'editor':_0x120fea,'action':_0x5ad051,'withText':!0x0,'withIcon':!0x1,'isInDropdown':!0x0,'shouldPreventFocus':()=>this['_isSearchFocused']()})();_0x3c8817['children']['add'](_0x50ffae),_0x3551d3['focusTracker']['add'](_0x50ffae),_0x13ef44['items']['add'](_0x3c8817);}),_0x13ef44;}['_setupGroupMenuBehavior'](_0x3f70e3,_0x2329ff){const _0x4a0955=_0x3f70e3['bindTemplate'],_0x4981e6=this['_getButtonKeystroke'](_0x3f70e3);_0x3f70e3['extendTemplate']({'attributes':{'class':['ck-ai-quick-actions-group-button']},'on':{'mouseenter':_0x4a0955['to'](()=>{this['_showNestedPanel'](_0x2329ff,_0x3f70e3);}),'mouseleave':_0x4a0955['to'](_0x5ccf34=>{const _0x40785=_0x5ccf34['relatedTarget'];this['_isMovingToNestedMenu'](_0x40785,_0x2329ff)||this['_hideNestedPanel'](_0x2329ff);}),'keydown':_0x4a0955['to'](_0x1118a2=>{_0x1118a2['key']==_0x4981e6&&(this['_showNestedPanel'](_0x2329ff,_0x3f70e3),_0x2329ff['content']['get'](0x0)['focus']());})}}),_0x2329ff['on']('render',()=>{_0x2329ff['element']?.['addEventListener']('mouseleave',_0x540bba=>{const _0xb6d23=_0x540bba['relatedTarget'];_0x3f70e3['element']?.['contains'](_0xb6d23)||this['_isMovingToNestedMenu'](_0xb6d23,_0x2329ff)||this['_hideNestedPanel'](_0x2329ff);});});}['_showNestedPanel'](_0x4b859d,_0x5023b0){this['_openNestedPanels']['forEach'](_0x27d44d=>{_0x27d44d!==_0x4b859d&&_0x27d44d['isVisible']&&_0x27d44d['hide']();}),_0x4b859d['show'](),_0x4b859d['pin']({'positions':[_0x478601['eastSouth']],'target':_0x5023b0['element'],'fitInViewport':!0x0}),this['_openNestedPanels']['add'](_0x4b859d);}['_hideNestedPanel'](_0x3d7013){_0x3d7013['hide'](),this['_openNestedPanels']['delete'](_0x3d7013);}['_hideAllNestedPanels'](){this['_openNestedPanels']['forEach'](_0x1b1a81=>_0x1b1a81['hide']()),this['_openNestedPanels']['clear']();}['_isMovingToNestedMenu'](_0x5aa2d0,_0x215491){if(!_0x5aa2d0)return!0x1;if(_0x215491['element']?.['contains'](_0x5aa2d0))return!0x0;const _0x3327ea=_0x5aa2d0;return _0x3327ea['closest']&&(null!==_0x3327ea['closest']('.ck-ai-quick-actions-group-panel')||null!==_0x3327ea['closest']('.ck-ai-quick-actions-group-list')||null!==_0x3327ea['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'](_0x131133){return'rtl'===_0x131133['locale']['uiLanguageDirection']?'ArrowRight':'ArrowLeft';}['_getButtonKeystroke'](_0x7015cc){return'rtl'===_0x7015cc['locale']['uiLanguageDirection']?'ArrowLeft':'ArrowRight';}['_handlePanelKeydown'](_0x382c5c,_0x30bb38,_0x494566,_0x5bf912){_0x382c5c['key']==_0x30bb38&&(_0x494566['focus'](),this['_hideNestedPanel'](_0x5bf912));}['_handleSearchResultButtonClick'](_0x23e672){_0x23e672['fire']('execute');}}function Vo(_0x10499e){const {editor:_0x1f4cab,content:_0x47f5b5,buttonDefinition:_0xcf1329,bodyCollection:_0x3f80d5,hasSearch:_0x17f73e=!0x1}=_0x10499e;return()=>{const _0x459e21=_0x1f4cab['locale'],_0x1f171f=_0x1f4cab['commands']['get']('aiQuickAction'),_0x4e78c7=Gt(_0x459e21);_0x4e78c7['bind']('isEnabled')['to'](_0x1f171f),_0x4e78c7['buttonView']['set']({'icon':_0xcf1329['icon']??_0x215c21,'label':_0xcf1329['label'],'tooltip':!0x0}),_0x4e78c7['set']({'class':'ck-ai-quick-actions-dropdown'});const _0x1004a1=new Uo(_0x1f4cab,_0x47f5b5,_0x4e78c7,_0x3f80d5,_0x17f73e);return _0x4e78c7['panelView']['children']['add'](_0x1004a1),_0x17f73e&&_0x4e78c7['on']('change:isOpen',(_0x47fcb5,_0x6f64dc,_0x36bd54)=>{if(_0x36bd54){if(_0x1f4cab['plugins']['has']('AIEditing')){const _0x19c94c=_0x1f4cab['plugins']['get'](Js),_0x181a17=_0x1f4cab['model']['document']['selection'],_0x452d27=Array['from'](_0x181a17['getRanges']());_0x452d27['length']>0x0&&_0x19c94c['showFakeVisualSelection']({'ranges':_0x452d27,'id':'quick-action','priority':0x14});}}else _0x1f4cab['plugins']['has']('AIEditing')&&_0x1f4cab['plugins']['get'](Js)['hideFakeVisualSelection']('quick-action'),_0x1004a1['resetSearch']();}),_0x4e78c7;};}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 _0x5d673d{static get['requires'](){return[_0x4f2bac,as];}static get['pluginName'](){return'AIQuickActionsUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}async['init'](){const _0x2444d7=await this['_getDefaultAndCustomActions']();this['_prepareQuickActionsDefinition'](_0x2444d7),this['_initializeQuickActionsComponentsAndCommands']();}static['getDefaultQuickActions'](_0x205022){return function(_0x1060e1){const _0x18f021=new Intl['DisplayNames'](['en'],{'type':'language'})['of'](_0x1060e1['uiLanguage']),_0x1cfd9c=_0x18f021||'English',_0x1778c2=[{'id':'ask-ai','label':hs(_0x1060e1,'AI_QUICK_ACTIONS_ASK_AI'),'type':'chat','icon':_0x4a5201},{'id':'chat-commands','label':hs(_0x1060e1,'AI_QUICK_ACTIONS_CHAT_COMMANDS'),'icon':_0x4a5201,'actions':[{'id':'explain','label':hs(_0x1060e1,'AI_QUICK_ACTIONS_EXPLAIN'),'displayedPrompt':hs(_0x1060e1,'AI_QUICK_ACTIONS_EXPLAIN'),'prompt':Bo['replace']('%0',_0x1cfd9c),'type':'chat'},{'id':'summarize','label':hs(_0x1060e1,'AI_QUICK_ACTIONS_SUMMARIZE'),'displayedPrompt':hs(_0x1060e1,'AI_QUICK_ACTIONS_SUMMARIZE'),'prompt':Go['replace']('%0',_0x1cfd9c),'type':'chat'},{'id':'highlight-key-points','label':hs(_0x1060e1,'AI_QUICK_ACTIONS_HIGHLIGHT_KEY_POINTS'),'displayedPrompt':hs(_0x1060e1,'AI_QUICK_ACTIONS_HIGHLIGHT_KEY_POINTS'),'prompt':Fo['replace']('%0',_0x1cfd9c),'type':'chat'}]},{'id':'improve-writing','label':hs(_0x1060e1,'AI_QUICK_ACTIONS_IMPROVE_WRITING'),'type':'action','icon':_0x1b95f5},{'id':'continue','label':hs(_0x1060e1,'AI_QUICK_ACTIONS_CONTINUE_WRITING'),'type':'action','icon':_0x10b153},{'id':'fix-grammar','label':hs(_0x1060e1,'AI_QUICK_ACTIONS_FIX_GRAMMAR_SPELLING'),'type':'action','icon':_0x2254d0},{'id':'adjust-length','label':hs(_0x1060e1,'AI_QUICK_ACTIONS_ADJUST_LENGTH'),'icon':_0x2ced3e,'actions':[{'id':'make-shorter','label':hs(_0x1060e1,'AI_QUICK_ACTIONS_MAKE_SHORTER'),'type':'action'},{'id':'make-longer','label':hs(_0x1060e1,'AI_QUICK_ACTIONS_MAKE_LONGER'),'type':'action'}]},{'id':'change-tone','label':hs(_0x1060e1,'AI_QUICK_ACTIONS_CHANGE_TONE'),'icon':_0x4df6c2,'actions':[{'id':'make-tone-casual','label':hs(_0x1060e1,'AI_QUICK_ACTIONS_MORE_CASUAL'),'type':'action'},{'id':'make-tone-direct','label':hs(_0x1060e1,'AI_QUICK_ACTIONS_MORE_DIRECT'),'type':'action'},{'id':'make-tone-friendly','label':hs(_0x1060e1,'AI_QUICK_ACTIONS_MORE_FRIENDLY'),'type':'action'},{'id':'make-tone-confident','label':hs(_0x1060e1,'AI_QUICK_ACTIONS_MORE_CONFIDENT'),'type':'action'},{'id':'make-tone-professional','label':hs(_0x1060e1,'AI_QUICK_ACTIONS_MORE_PROFESSIONAL'),'type':'action'}]},{'id':'translate','label':hs(_0x1060e1,'AI_QUICK_ACTIONS_TRANSLATE'),'icon':_0xc37e4b,'actions':[{'id':'translate-to-english','label':hs(_0x1060e1,'AI_QUICK_ACTIONS_TRANSLATE_ENGLISH'),'type':'action','actionName':'translate','args':{'language':'english'}},{'id':'translate-to-chinese','label':hs(_0x1060e1,'AI_QUICK_ACTIONS_TRANSLATE_CHINESE'),'type':'action','actionName':'translate','args':{'language':'chinese'}},{'id':'translate-to-spanish','label':hs(_0x1060e1,'AI_QUICK_ACTIONS_TRANSLATE_SPANISH'),'type':'action','actionName':'translate','args':{'language':'spanish'}},{'id':'translate-to-german','label':hs(_0x1060e1,'AI_QUICK_ACTIONS_TRANSLATE_GERMAN'),'type':'action','actionName':'translate','args':{'language':'german'}},{'id':'translate-to-french','label':hs(_0x1060e1,'AI_QUICK_ACTIONS_TRANSLATE_FRENCH'),'type':'action','actionName':'translate','args':{'language':'french'}},{'id':'translate-to-japanese','label':hs(_0x1060e1,'AI_QUICK_ACTIONS_TRANSLATE_JAPANESE'),'type':'action','actionName':'translate','args':{'language':'japanese'}},{'id':'translate-to-portuguese','label':hs(_0x1060e1,'AI_QUICK_ACTIONS_TRANSLATE_PORTUGUESE'),'type':'action','actionName':'translate','args':{'language':'portuguese'}},{'id':'translate-to-korean','label':hs(_0x1060e1,'AI_QUICK_ACTIONS_TRANSLATE_KOREAN'),'type':'action','actionName':'translate','args':{'language':'korean'}},{'id':'translate-to-italian','label':hs(_0x1060e1,'AI_QUICK_ACTIONS_TRANSLATE_ITALIAN'),'type':'action','actionName':'translate','args':{'language':'italian'}},{'id':'translate-to-russian','label':hs(_0x1060e1,'AI_QUICK_ACTIONS_TRANSLATE_RUSSIAN'),'type':'action','actionName':'translate','args':{'language':'russian'}}]},{'id':'other','label':hs(_0x1060e1,'AI_QUICK_ACTIONS_OTHER'),'icon':_0x2aadf2,'actions':[]}];return _0x1778c2;}(_0x205022);}async['_getDefaultAndCustomActions'](){const _0x9f150e=Wo['getDefaultQuickActions'](this['editor']['locale']),_0x2f69c2=this['editor']['config']['get']('ai.quickActions.extraCommands')||[];let _0x341221,_0x150be3=[];try{const _0x30b930=new Fs({'connector':this['editor']['plugins']['get']('AIConnector'),'config':this['editor']['config']['get']('ai.models'),'locale':this['editor']['locale']});_0x150be3=await _0x30b930['getAll'](),_0x341221=(await _0x30b930['getDefault']())?.['id'];}catch(_0x17f113){const _0x11af2e=new at('ai-quick-actions-models-unable-to-retrieve',this,{'error':_0x17f113});Et(_0x11af2e['message']);}finally{const _0x435f2b=_0x2f69c2['map'](_0x2cd0d9=>({..._0x2cd0d9,'type':'chat'===_0x2cd0d9['type']?'chat':'action','model':'chat'!==_0x2cd0d9['type']?_0x2cd0d9['model']||_0x341221:_0x2cd0d9['model'],'icon':void 0x0}));_0x9f150e['find'](_0x323c73=>'other'===_0x323c73['id'])['actions']['push'](..._0x435f2b),_0x9f150e['forEach'](_0x4efd87=>{if('actions'in _0x4efd87)_0x4efd87['actions']['forEach'](_0x84c5dc=>{if(_0x84c5dc['isEnabled']=!!_0x150be3['find'](_0x8b8ed5=>_0x8b8ed5['id']===_0x84c5dc['model'])||void 0x0===_0x84c5dc['model'],!_0x84c5dc['isEnabled']){const _0x553278=new at('ai-quick-actions-unavailable-model',this,{'actionId':_0x84c5dc['id'],'modelId':_0x84c5dc['model']});Et(_0x553278['message']);}});else{if(_0x4efd87['isEnabled']=!!_0x150be3['find'](_0x93c155=>_0x93c155['id']===_0x4efd87['model'])||void 0x0===_0x4efd87['model'],!_0x4efd87['isEnabled']){const _0x5bd9df=new at('ai-quick-actions-unavailable-model',this,{'actionId':_0x4efd87['id'],'modelId':_0x4efd87['model']});Et(_0x5bd9df['message']);}}});}return _0x9f150e;}['_initializeQuickActionsComponentsAndCommands'](){const _0x14e708=new Qt(this['editor']['locale']);_0x14e708['attachToDom'](),this['_initializeQuickActionsDropdown'](_0x14e708),this['_initializeQuickActionsMenuBar'](),this['_initializeQuickActionsComponents'](_0x14e708);}['_initializeQuickActionsDropdown'](_0x7e4d){const _0x4eefa5=this['editor']['config']['get']('ai.quickActions.isSearchEnabled')??!0x0;this['editor']['ui']['componentFactory']['add']('aiQuickActions',Vo({'editor':this['editor'],'content':this['_quickActionsDefinition'],'buttonDefinition':{'icon':_0x215c21,'label':hs(this['editor']['locale'],'AI_QUICK_ACTIONS_HEADING')},'bodyCollection':_0x7e4d,'hasSearch':_0x4eefa5}));}['_prepareQuickActionsDefinition'](_0x7692b9){this['_quickActionsDefinition']=_0x7692b9['map'](_0x542fd9=>{if('actions'in _0x542fd9){const _0x5b7898=_0x542fd9;return{..._0x5b7898,'actions':_0x5b7898['actions']['map'](_0x2039d8=>{const {actions:_0x255bd0,..._0x17aaf0}=_0x5b7898;return{..._0x2039d8,'parent':_0x17aaf0};})['filter'](_0x36535f=>this['_shouldIncludeAction'](_0x36535f))};}return _0x542fd9;})['filter'](_0xead399=>'actions'in _0xead399?_0xead399['actions']['length']>0x0:this['_shouldIncludeAction'](_0xead399));}['_shouldIncludeAction'](_0x3b52e0){const _0x28027e=this['editor']['config']['get']('ai.quickActions.removeCommands')||[];return this['editor']['plugins']['has'](Ko[_0x3b52e0['type']])&&!_0x28027e['includes'](_0x3b52e0['id'])&&!('chat'===_0x3b52e0['type']&&!0x1===this['editor']['config']['get']('ai.chat.context.document.enabled'));}['_initializeQuickActionsComponents'](_0xf2818b){this['_quickActionsDefinition']['forEach'](_0x2e84b5=>{if('actions'in _0x2e84b5){const _0xc5de3d=Vo({'editor':this['editor'],'content':_0x2e84b5['actions'],'buttonDefinition':_0x2e84b5,'bodyCollection':_0xf2818b});this['editor']['ui']['componentFactory']['add'](_0x2e84b5['id'],_0xc5de3d),_0x2e84b5['actions']['forEach'](_0x29389c=>{const _0x289e79=Lo({'editor':this['editor'],'action':_0x29389c});this['editor']['ui']['componentFactory']['add'](_0x29389c['id'],_0x289e79);});}else{const _0x1a48d7=Lo({'editor':this['editor'],'action':_0x2e84b5,'withText':!0x1,'withIcon':!0x0,'isInDropdown':!0x1});this['editor']['ui']['componentFactory']['add'](_0x2e84b5['id'],_0x1a48d7);}});}['_initializeQuickActionsMenuBar'](){this['editor']['ui']['componentFactory']['add']('menuBar:aiQuickActions',_0x2cc5c9=>{const _0xd0d7a=this['editor']['commands']['get']('aiQuickAction'),_0x436cc0=new Kt(_0x2cc5c9),_0x133d6f=hs(_0x2cc5c9,'AI_QUICK_ACTIONS_HEADING');_0x436cc0['buttonView']['set']({'label':_0x133d6f,'icon':_0x215c21});const _0x2e0b90=new $t(_0x2cc5c9);return _0x2e0b90['set']({'ariaLabel':_0x133d6f,'role':'menu'}),this['_quickActionsDefinition']['forEach'](_0xe49ed0=>{if('actions'in _0xe49ed0){const _0x1bfc6c=_0xe49ed0,_0x389299=new qt(_0x2cc5c9,_0x436cc0),_0x2d867f=new Kt(_0x2cc5c9),_0x4facec=new $t(_0x2cc5c9);_0x2d867f['buttonView']['set']({'label':_0x1bfc6c['label'],'icon':_0x1bfc6c['icon']}),_0x1bfc6c['actions']['forEach'](_0x4ddd7a=>{const _0x365192=new qt(_0x2cc5c9,_0x2d867f),_0x3d2079=new Wt(_0x2cc5c9);_0x3d2079['set']({'label':_0x4ddd7a['label'],'icon':_0x4ddd7a['icon'],'role':'menuitem','isEnabled':_0x4ddd7a['isEnabled']}),_0x3d2079['on']('execute',()=>{this['_executeQuickAction'](_0x4ddd7a);}),_0x3d2079['delegate']('execute')['to'](_0x2d867f),_0x365192['children']['add'](_0x3d2079),_0x4facec['items']['add'](_0x365192);}),_0x2d867f['panelView']['children']['add'](_0x4facec),_0x389299['children']['add'](_0x2d867f),_0x2e0b90['items']['add'](_0x389299);}else{const _0x1146fd=_0xe49ed0,_0x22c569=new qt(_0x2cc5c9,_0x436cc0),_0x2aec3c=new Wt(_0x2cc5c9);_0x2aec3c['set']({'label':_0x1146fd['label'],'icon':_0x1146fd['icon'],'role':'menuitem','isEnabled':_0x1146fd['isEnabled']}),_0x2aec3c['on']('execute',()=>{this['_executeQuickAction'](_0x1146fd);}),_0x2aec3c['delegate']('execute')['to'](_0x436cc0),_0x22c569['children']['add'](_0x2aec3c),_0x2e0b90['items']['add'](_0x22c569);}}),(Object['values'](Ko)['some'](_0x27a85c=>this['editor']['plugins']['has'](_0x27a85c))?_0x436cc0['bind']('isEnabled')['to'](_0xd0d7a):_0x436cc0['set']({'isEnabled':!0x1}),_0x436cc0['panelView']['children']['add'](_0x2e0b90),_0x436cc0);});}['_executeQuickAction'](_0xb249e){const _0x266003=this['editor'];_0x266003['editing']['view']['focus'](),_0x266003['commands']['execute']('aiQuickAction',_0xb249e);const _0x1dccd7=_0x266003['ui']['view']['menuBarView'];_0x1dccd7&&_0x1dccd7['close']&&_0x1dccd7['close']();}}class Yo extends _0x3279ff{['execute'](_0x262a11){switch(this['_expandSelectionIfCollapsed'](),_0x262a11['type']){case'chat':if(!this['editor']['plugins']['has']('AIChat')){const _0x34a71a=hs(this['editor']['locale'],'AI_QUICK_ACTIONS_PLUGIN_NOT_FOUND','AIChat');throw new at('ai-quick-actions-plugin-not-found',this['editor'],{'errorMessage':_0x34a71a});}this['_handleAIChatAction'](_0x262a11);break;case'action':if(!this['editor']['plugins']['has']('AIActions')){const _0x49b203=hs(this['editor']['locale'],'AI_QUICK_ACTIONS_PLUGIN_NOT_FOUND','AIActions');throw new at('ai-quick-actions-plugin-not-found',this['editor'],{'errorMessage':_0x49b203});}this['_handleAIActionsAction'](_0x262a11);}}async['_handleAIChatAction'](_0x152e7c){const _0x4e48d7=this['editor']['plugins']['get']('AIChatController'),_0x466a06=this['editor']['plugins']['get']('AITabs')['view'];if(_0x466a06['isVisible']||(_0x466a06['isVisible']=!0x0),'chat'!==_0x466a06['activeTab']&&_0x466a06['activateTab']('chat'),'ask-ai'===_0x152e7c['id'])_0x4e48d7['removeSelectionFromChatContext'](),_0x4e48d7['addSelectionToChatContext'](),_0x4e48d7['focusPromptInput']();else await _0x4e48d7['startConversation']({'modelId':_0x152e7c['model']}),_0x4e48d7['removeSelectionFromChatContext'](),_0x4e48d7['addSelectionToChatContext'](),_0x4e48d7['focusPromptInput'](),await _0x4e48d7['sendMessage']({'message':_0x152e7c['prompt']||_0x152e7c['displayedPrompt']||_0x152e7c['label'],'attributes':{'quickActionData':{'id':_0x152e7c['id']},'displayedPrompt':_0x152e7c['displayedPrompt']}});}['_expandSelectionIfCollapsed'](){const _0x39d94a=this['editor'],_0x5c5892=_0x39d94a['model']['document']['selection'];if(!_0x5c5892['isCollapsed'])return;const _0x280bf2=At(_0x5c5892['getSelectedBlocks']())||_0x39d94a['model']['schema']['getLimitElement'](_0x5c5892);_0x39d94a['model']['change'](_0x2d6285=>{_0x2d6285['setSelection'](_0x280bf2,'in');});}['_handleAIActionsActionLabel'](_0x533488){return _0x533488['parent']?.['label']&&'other'!==_0x533488['parent']?.['id']?_0x533488['parent']['label']+':\x20'+_0x533488['label']:_0x533488['label'];}async['_handleAIActionsAction'](_0x231bb0){const _0x419812=this['editor']['plugins']['get']('AIActions'),_0x2a551c=_0x231bb0['prompt']?{'userMessage':_0x231bb0['prompt'],'model':_0x231bb0['model']}:{'actionName':_0x231bb0['actionName']||_0x231bb0['id'],'args':_0x231bb0['args']},_0x5c674a=this['_handleAIActionsActionLabel'](_0x231bb0);await _0x419812['executeAction'](_0x2a551c,_0x5c674a,_0x231bb0['icon']);}}class $o extends _0x5d673d{static get['pluginName'](){return'AIQuickActionsEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const _0x491183=this['editor'],_0x36b8ef=new Yo(this['editor']);if(_0x491183['commands']['add']('aiQuickAction',_0x36b8ef),_0x491183['plugins']['has']('AIChat')){const _0x9702da=this['editor']['plugins']['get']('AIChatController');_0x491183['model']['document']['selection']['on']('change:range',(_0x32c650,_0x5e8999)=>{_0x5e8999['directChange']&&_0x9702da['removeSelectionFromChatContext']();});}}}class qo extends xs{['updateChangeGroups'](){if(this['parsedMergedContent']=this['parsedContent']['cloneNode'](!0x0),0x0==this['parsedMergedContent']['childNodes']['length'])return void(this['changeGroups']=[]);const _0x5ea992=this['documentContextContent']['children']['map'](_0xbddda3=>({'node':_0xbddda3,'id':Es(_0xbddda3,'data-id')})),_0x484b9d=this['parsedMergedContent']['children']['map'](_0x4f25ab=>({'node':_0x4f25ab,'id':Es(_0x4f25ab,'data-id')||ot()})),_0x36bcf5=_0x335e37(_0x5ea992,_0x484b9d,{'comparator':(_0x34a826,_0x3430ed)=>_0x34a826['id']==_0x3430ed['id'],'oneChangePerToken':!0x0});if(!this['isDone']||!this['isComplete']){for(;_0x36bcf5['length']&&_0x36bcf5[_0x36bcf5['length']-0x1]['removed'];)_0x36bcf5['pop']();}const _0x36fb70=_0x36bcf5['map'](_0x1813e8=>{const _0x5799d2=_0x1813e8['added']?'new':_0x1813e8['removed']?'removed':'modified';return{'node':_0x1813e8['value'][0x0]['node'],'type':_0x5799d2,'id':_0x1813e8['value'][0x0]['id']};});this['changeGroups']=[{'changes':_0x36fb70,'state':'pending','index':0x0}];}['_getDifferentChangeGroups'](_0x53130f,_0x401c83){return _0x401c83;}}class Qo extends Ds{['content'];['version'];['actionName'];['args'];['userMessage'];['model'];['hasError']=!0x1;['stoppedExplicitly']=!0x1;constructor(_0x32ce30){super(_0x32ce30),this['content']=_0x32ce30['content'],this['version']=_0x32ce30['version'],this['actionName']=_0x32ce30['actionName'],this['args']=_0x32ce30['args'],this['userMessage']=_0x32ce30['userMessage'],this['model']=_0x32ce30['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'](_0x49a527){const _0x8498f=new qo({'locale':this['locale'],'documentContextContent':this['content'],..._0x49a527});return this['replies']['push'](_0x8498f),_0x8498f['delegate'](...Ls)['to'](this),this['fire']('replyCreated',_0x8498f),_0x8498f;}}class Xo extends kt{constructor(_0x286ae9,_0x5d5566=!0x0,_0x50d3c1=!0x0){super(_0x286ae9),this['set']('isEnabled',!0x1),_0x5d5566&&(this['applyButton']=this['_createButton'](hs(_0x286ae9,'AI_BALLOON_APPLY_BUTTON'),cs),this['applyButton']['bind']('isEnabled')['to'](this),this['items']['add'](this['applyButton'])),_0x50d3c1&&(this['suggestButton']=this['_createButton'](hs(_0x286ae9,'AI_BALLOON_SUGGEST_BUTTON'),_0x5d5566?ls:cs),this['suggestButton']['bind']('isEnabled')['to'](this),this['items']['add'](this['suggestButton'])),this['setButtonsVisibility']({'showApplyButton':_0x5d5566,'showSuggestButton':_0x50d3c1}),this['extendTemplate']({'attributes':{'class':['ck-ai-balloon__toolbar']}});}['setButtonsVisibility']({showApplyButton:_0x428aa5,showSuggestButton:_0x467133}){this['applyButton']&&(this['applyButton']['isVisible']=_0x428aa5),this['suggestButton']&&(this['suggestButton']['isVisible']=_0x467133);}['_createButton'](_0x4fd086,_0x54ed74){const _0x3a129f=new Nt(this['locale']);return _0x3a129f['set']({'label':_0x4fd086,'class':_0x54ed74,'isVisible':!0x0,'withText':!0x0}),_0x3a129f;}}class zo extends vt{constructor(_0x88c65e){super(_0x88c65e),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(_0x88c65e,'AI_DISCLAIMER_TEXT')}]}]});}}class jo extends vt{constructor(_0x269ac9){super(_0x269ac9),this['set']('isVisible',!0x0);const _0x4ac801=new yn('small');_0x4ac801['isVisible']=!0x0;const _0x5aaf59=new vt(this['locale']);_0x5aaf59['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',_0x3157a5=>!_0x3157a5)]},'children':[_0x4ac801,_0x5aaf59]});}}class Jo extends So{['focusCycler'];['_config'];['_contentWrapper'];['_streamableContentView'];['_toolbarView'];['_miniToolbarView'];['_loaderView'];['_disclaimerView'];['_focusTracker'];['_keystrokes'];['_dialogContent'];['_focusables'];['_scrollManager'];['_navigationPreviousButton'];['_navigationNextButton'];['_navigationTryAgainButton'];['_navigationCounter'];constructor(_0x28a2f4,_0x1dd469){super(_0x28a2f4),this['set']('isBusy',!0x1),this['set']('isTrackChangesOn',!0x1),this['set']('_isLoading',!0x1),this['set']('_hasError',!0x1),this['_config']=_0x1dd469,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 _0x54e610(),this['_addContentWrapper'](_0x1dd469),this['_addDisclaimerView'](),this['_addToolbar'](_0x1dd469),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'](_0x1dd469);});}['render'](){super['render']();for(const _0x36fb2d of this['_focusables'])this['_focusTracker']['add'](_0x36fb2d['element']);this['_keystrokes']['listenTo'](this['element']),this['_initializeScrollManager']();}['destroy'](){super['destroy'](),this['_scrollManager']&&this['_scrollManager']['destroy']();}['focus'](_0x5f957d){-0x1===_0x5f957d?this['focusCycler']['focusLast']():this['focusCycler']['focusFirst']();}['setIsLoading'](_0x48c5b5){this['_isLoading']=_0x48c5b5;}['setErrorState'](){this['_hasError']=!0x0,this['_miniToolbarView']['toggleShowChangesEnabled'](!0x1);}['clearErrorState'](){this['_hasError']=!0x1,this['_miniToolbarView']['toggleShowChangesEnabled'](!0x0);}['showError'](_0x18f08b){super['showError'](_0x18f08b),this['_dialogContent']['has'](this['_errorView'])||this['_dialogContent']['add'](this['_errorView'],0x0);}['hideError'](){super['hideError'](),this['clearErrorState']();}['showBlockingError'](_0x49938d){super['showBlockingError'](_0x49938d),this['setErrorState']();}['addMiniToolbarItem'](_0x66fb9){this['_miniToolbarView']['items']['has'](_0x66fb9)||this['_miniToolbarView']['items']['add'](_0x66fb9);}['removeMiniToolbarItem'](_0x50f4f8){this['_miniToolbarView']['items']['has'](_0x50f4f8)&&this['_miniToolbarView']['items']['remove'](_0x50f4f8);}['showLoader'](){this['_loaderView']&&(this['_isLoading']=!0x0);}['hideLoader'](){this['_loaderView']&&(this['_isLoading']=!0x1);}['_toggleToolbarButtonsVisibility']({showApplyButton:_0x411c77,showSuggestButton:_0x2ca7af}){_0x411c77=_0x411c77&&!this['isTrackChangesOn']&&this['_config']['availableActions']['includes']('applySuggestion'),_0x2ca7af=_0x2ca7af&&this['_config']['availableActions']['includes']('insertSuggestion'),this['_toolbarView']['setButtonsVisibility']({'showApplyButton':_0x411c77,'showSuggestButton':_0x2ca7af});}async['updateContent'](_0xd40da9){await this['_streamableContentView']['update'](_0xd40da9);}['clearContent'](){this['_streamableContentView']['clear']();}['_addContentWrapper'](_0x23028f){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'](_0x23028f['miniToolbarConfig'])]}),this['_dialogContent']['add'](this['_contentWrapper']);}['_addDisclaimerView'](){this['_disclaimerView']=new zo(this['locale']),this['_dialogContent']['add'](this['_disclaimerView']);}['_addToolbar']({showApplyButton:_0x38adc7,showSuggestButton:_0x5ed378}){this['_toolbarView']=new Xo(this['locale'],_0x38adc7,_0x5ed378),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',(_0x5d4926,_0x5b4558,_0x3cd7e8)=>!(_0x5d4926||_0x5b4558||_0x3cd7e8)),this['_toggleToolbarButtonsVisibility']({'showApplyButton':_0x38adc7,'showSuggestButton':_0x5ed378}),this['_dialogContent']['add'](this['_toolbarView']);}['_createMiniToolbar'](_0xf4ab13){return this['_miniToolbarView']=new ko(this['locale'],_0xf4ab13),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',(_0x1afeee,_0x5307b5)=>!(_0x1afeee||_0x5307b5)),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 _0x3cae7d=new Nt(this['locale']),_0x366f71=new Nt(this['locale']),_0x3e5cab=new Zo(this['locale']),_0x4f6eb4=new Nt(this['locale']);_0x3cae7d['set']({'icon':tt,'label':hs(this['locale'],'AI_ACTIONS_TRY_AGAIN'),'tooltip':!0x0,'class':'ck-ai-custom-action-button\x20'+us}),_0x366f71['set']({'icon':_0x216998,'tooltip':hs(this['locale'],'AI_ACTIONS_PREVIOUS_INTERACTION'),'class':'ck-ai-navigation-button\x20ck-ai-previous-button\x20'+us}),_0x4f6eb4['set']({'icon':et,'tooltip':hs(this['locale'],'AI_ACTIONS_NEXT_INTERACTION'),'class':'ck-ai-navigation-button\x20ck-ai-next-button\x20'+us}),_0x3cae7d['bind']('isEnabled')['to'](this,'isBusy',_0x39db95=>!_0x39db95),_0x3cae7d['on']('execute',()=>{this['fire']('tryAgain');}),_0x366f71['bind']('isEnabled')['to'](this,'isBusy',_0x5a0e33=>!_0x5a0e33),_0x366f71['on']('execute',()=>{this['fire']('showPrevious');}),_0x4f6eb4['bind']('isEnabled')['to'](this,'isBusy',_0x3d83f3=>!_0x3d83f3),_0x4f6eb4['on']('execute',()=>{this['fire']('showNext');}),this['_navigationPreviousButton']=_0x366f71,this['_navigationCounter']=_0x3e5cab,this['_navigationNextButton']=_0x4f6eb4,this['_navigationTryAgainButton']=_0x3cae7d;}['updateMiniToolbarButtons'](_0x4ec541,_0x382a26){this['_navigationPreviousButton']||this['_setupMiniToolbarButtons']();const _0x47417b=_0x4ec541>0x1;if(this['addMiniToolbarItem'](this['_navigationTryAgainButton']),_0x47417b){this['addMiniToolbarItem'](this['_navigationPreviousButton']),this['addMiniToolbarItem'](this['_navigationCounter']),this['addMiniToolbarItem'](this['_navigationNextButton']);const _0x22de7e=_0x4ec541-_0x382a26;this['_navigationCounter']['setInteractionCount'](_0x22de7e+'/'+_0x4ec541),this['_navigationPreviousButton']['isEnabled']=_0x382a26<_0x4ec541-0x1,this['_navigationNextButton']['isEnabled']=_0x382a26>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'](_0x1066a7){this['_isLoading']=_0x1066a7;}['resetShowChangesButton'](){this['_miniToolbarView']['isShowChangesOn']=!0x1;}['_initializeScrollManager'](){const _0x112c4b=this['_getScrollableElement']();_0x112c4b&&!this['_scrollManager']&&(this['_scrollManager']=new sr(_0x112c4b));}['_getScrollableElement'](){return this['_streamableContentView']['element'];}}class Zo extends vt{constructor(_0x1dcbd3){super(_0x1dcbd3);const _0x3c8f14=this['bindTemplate'];this['set']('interactionCount','1/1'),this['setTemplate']({'tag':'span','attributes':{'class':['ck-ai-interaction-counter']},'children':[{'text':_0x3c8f14['to']('interactionCount')}]});}['setInteractionCount'](_0x4057fe){this['set']('interactionCount',_0x4057fe);}}class ta extends _0x5d673d{static get['requires'](){return[as,Bt,Js,Oo,_0x216072];}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(_0x2e48cd){super(_0x2e48cd),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'](_0x12fc68,_0x3fade9,_0x1f8d22){if(this['_stopInteraction'](),this['editor']['plugins']['has']('TableSelection')){if(this['editor']['plugins']['get']('TableSelection')['getSelectedTableCells']()){const {modelFragment:_0x57c31d,anchorData:_0x22e57b,root:_0x5398e2}=this['_getExecuteDataInTable']();return this['_executeAction'](_0x12fc68,_0x57c31d,_0x22e57b,_0x5398e2,_0x3fade9,_0x1f8d22);}}const {modelFragment:_0x437b06,anchorData:_0x1bd0bc,root:_0x3db38b}=this['_getExecuteDataRegular']();return this['_executeAction'](_0x12fc68,_0x437b06,_0x1bd0bc,_0x3db38b,_0x3fade9,_0x1f8d22);}async['destroy'](){return this['_stopInteraction'](),this['_bodyCollection']['detachFromDom'](),super['destroy']();}['_createActionsBalloonView'](){const _0x41bec4=this['editor']['plugins']['has']('TrackChanges');let _0x697025=this['editor']['config']['get']('ai.availableReplyActions')||[...fn];_0x41bec4||(_0x697025=_0x697025['filter'](_0x555c5d=>'insertSuggestion'!=_0x555c5d));const _0x3662c2=this['editor']['commands']['get']('trackChanges'),_0x309f2e=new Jo(this['editor']['locale'],{'showApplyButton':!0x0,'showSuggestButton':_0x41bec4,'miniToolbarConfig':{'showChanges':'icon'},'availableActions':_0x697025});return _0x309f2e['bind']('isBusy')['to'](this),_0x3662c2&&_0x309f2e['bind']('isTrackChangesOn')['to'](_0x3662c2,'value'),_0x309f2e['on']('tryAgain',()=>{this['_refreshInteraction']();}),_0x309f2e['on']('showPrevious',()=>{this['_navigateToPrevious']();}),_0x309f2e['on']('showNext',()=>{this['_navigateToNext']();}),_0x309f2e;}['_getExecuteDataRegular'](){const _0x48f24e=this['editor']['model']['document']['selection'],_0x5d2062=_0x48f24e['getFirstRange']()['start']['root'];if(_0x48f24e['isCollapsed']){const _0x3d8d92=At(_0x48f24e['getSelectedBlocks']())||this['editor']['model']['schema']['getLimitElement'](_0x48f24e);this['editor']['model']['change'](_0x511178=>{_0x511178['setSelection'](_0x3d8d92,'in');});}const _0x56ef80=_0x48f24e['getFirstRange'](),_0x1367d7=this['_wrapWithCommonAncestors'](this['editor']['model']['getSelectedContent'](_0x48f24e),_0x56ef80['start'],_0x56ef80['end']);this['_copyMarkersToFragment'](_0x1367d7,_0x48f24e,{'isTableSelection':!0x1});const _0x20602f=_0x48f24e['getFirstRange']()['start'],_0x7711b0=new Map();let _0x55dcf5=_0x1367d7;for(let _0x58ccc0=0x0;_0x58ccc0<_0x20602f['path']['length'];_0x58ccc0++)_0x7711b0['set'](_0x55dcf5,_0x20602f['path'][_0x58ccc0]),_0x55dcf5=_0x55dcf5['getChild'](0x0);return{'modelFragment':_0x1367d7,'anchorData':_0x7711b0,'root':_0x5d2062};}['_getExecuteDataInTable'](){const _0x29cd0d=this['editor']['model']['document']['selection'],_0x2c12b6=this['editor']['plugins']['get']('TableSelection'),_0x5916c2=_0x29cd0d['getFirstRange']()['start']['root'],_0x19d14d=_0x2c12b6['getSelectionAsFragment'](),_0x967d26=_0x29cd0d['getFirstRange']()['start']['parent']['parent'],_0x4a0ab3=this['editor']['model']['createRange'](this['editor']['model']['createPositionBefore'](_0x967d26),this['editor']['model']['createPositionAfter'](_0x967d26)),_0x326b4a=this['_wrapWithCommonAncestors'](_0x19d14d,_0x4a0ab3['start'],_0x4a0ab3['end']);this['_copyMarkersToFragment'](_0x326b4a,_0x29cd0d,{'isTableSelection':!0x0});const _0x2396dd=_0x29cd0d['getFirstRange']()['start'],_0x2c8b82=new Map();let _0x55d6c7=_0x326b4a;for(let _0x2f9998=0x0;_0x2f9998<_0x2396dd['path']['length'];_0x2f9998++)if(_0x2c8b82['set'](_0x55d6c7,_0x2396dd['path'][_0x2f9998]),_0x2f9998<_0x2396dd['path']['length']-0x1)_0x55d6c7=_0x55d6c7['getChild'](0x0);else{let _0xb7bf03=_0x55d6c7['nextSibling'];for(;_0xb7bf03;)_0x2c8b82['set'](_0xb7bf03,_0x2396dd['path'][_0x2f9998]),_0xb7bf03=_0xb7bf03['nextSibling'];}return{'modelFragment':_0x326b4a,'anchorData':_0x2c8b82,'root':_0x5916c2};}async['_executeAction'](_0x50b78d,_0x295b31,_0x378103,_0x18d8b7,_0x55ecb9,_0x17e2a6){const _0x4edf6a=this['editor']['plugins']['get'](Js),_0x29af50=this['editor']['plugins']['get'](Oo),_0x42588f=this['editor']['model']['document']['selection'],_0x3f7de0=await _0x4edf6a['modelToDataWithIds'](_0x295b31),_0x2321ae=this['editor']['model']['document']['version'],_0x1d71eb=[..._0x42588f['getRanges']()];return this['_actionsBalloonView']||(this['_actionsBalloonView']=this['_createActionsBalloonView']()),this['_clearInteractionHistory'](),this['_clearErrorState'](),this['_balloonShowDiff']=!0x1,this['_actionsBalloonView']['resetShowChangesButton'](),this['_actionsBalloonView']['clearContent'](),_0x29af50['open']({'index':0x3e8*Math['random']()%0x3e8,'title':_0x55ecb9,'icon':_0x17e2a6||_0x215c21,'mainView':this['_actionsBalloonView'],'class':'ck-ai-actions-balloon','ranges':_0x1d71eb,'id':'aiActionsBalloon'}),this['_setLoadingState'](),this['stopListening'](this['_actionsBalloonView']),this['stopListening'](_0x29af50),this['_interactionParams']={'action':_0x50b78d,'content':_0x3f7de0,'version':_0x2321ae,'aiBalloon':_0x29af50,'modelFragment':_0x295b31,'anchorData':_0x378103,'root':_0x18d8b7},this['_setupApplyListeners'](),this['listenTo'](_0x29af50,'selectionRemoved',()=>{this['_stopInteraction'](),this['_actionsBalloonView']['disableMiniToolbarButtons']();}),this['listenTo'](_0x29af50,'dialogClosed',(_0x3ef6b8,{id:_0x5919fc})=>{if('aiActionsBalloon'===_0x5919fc){for(const _0xb5d115 of this['_interactions']){if(0x0===_0xb5d115['replies']['length']||_0xb5d115['stoppedExplicitly'])continue;const _0x36c437=_0xb5d115['replies'][_0xb5d115['replies']['length']-0x1],_0x31c823=_0x36c437['changeGroups'][0x0];_0x31c823&&'pending'===_0x31c823['state']&&_0x36c437['setChangeGroupState'](0x0,'rejected');}this['_stopInteraction'](),this['_clearInteractionHistory'](),this['stopListening'](this['_actionsBalloonView']),this['stopListening'](_0x29af50);}}),this['_createInteraction'](_0x3f7de0,_0x2321ae,_0x29af50,_0x50b78d);}['_setupApplyListeners'](){if(!this['_interactionParams'])return;const {modelFragment:_0x419c3b,anchorData:_0x8b3147,root:_0x2bfbf0}=this['_interactionParams'];this['listenTo'](this['_actionsBalloonView'],'applySuggestion',()=>{this['_applyChanges'](_0x419c3b,_0x8b3147,_0x2bfbf0,!0x1);}),this['listenTo'](this['_actionsBalloonView'],'insertSuggestion',()=>{this['_applyChanges'](_0x419c3b,_0x8b3147,_0x2bfbf0,!0x0);});}['_wrapWithCommonAncestors'](_0x263bee,_0x41c35b,_0x53d894){const _0x3255f3=this['editor']['model']['createRange'](_0x41c35b,_0x53d894)['getCommonAncestor'](),_0x61365d=_0x3255f3['is']('documentFragment')?[]:_0x3255f3['getAncestors']({'includeSelf':!0x0})['slice'](0x1);if(_0x61365d['length']){const _0x1a0877=_0x61365d['map'](_0x1dd8d9=>_0x1dd8d9['_clone'](!0x1));for(let _0x5a68f2=0x1;_0x5a68f2<_0x1a0877['length'];_0x5a68f2++)_0x1a0877[_0x5a68f2-0x1]['_appendChild'](_0x1a0877[_0x5a68f2]);return _0x1a0877[_0x1a0877['length']-0x1]['_appendChild'](_0x263bee),new _0x1fef78(_0x1a0877[0x0]);}return _0x263bee;}['_copyMarkersToFragment'](_0x1d2fd5,_0x12e00a,_0x5b290c={'isTableSelection':!0x1}){const _0x1f3c69=this['editor']['model'],_0x56caf0=Array['from'](_0x12e00a['getRanges']()),_0x25ab76=_0x12e00a['getFirstRange']()['start'];for(const _0x555e6b of _0x1f3c69['markers']){if(_0x555e6b['name']['startsWith'](zs)||!_0x555e6b['affectsData'])continue;const _0x368b4f=_0x555e6b['getRange']();if(!_0x56caf0['some'](_0xd321f9=>_0xd321f9['containsRange'](_0x368b4f,!0x0)))continue;const _0x5102a4=this['_regularCalculateMarkerPath'](_0x368b4f['start'],_0x25ab76,_0x5b290c['isTableSelection']),_0x1f8ae5=this['_regularCalculateMarkerPath'](_0x368b4f['end'],_0x25ab76,_0x5b290c['isTableSelection']),_0x3d0072=_0x1f3c69['createPositionFromPath'](_0x1d2fd5,_0x5102a4),_0x22c675=_0x1f3c69['createPositionFromPath'](_0x1d2fd5,_0x1f8ae5);if(!_0x3d0072['isEqual'](_0x22c675)){const _0x5c95f5=_0x1f3c69['createRange'](_0x3d0072,_0x22c675);_0x1d2fd5['markers']['set'](_0x555e6b['name'],_0x5c95f5);}}}['_regularCalculateMarkerPath'](_0x4e2aac,_0x31bf7a,_0x53bb8d=!0x1){const _0x16170f=[..._0x4e2aac['path']['slice']()];for(let _0x27ebd7=0x0;_0x27ebd7<Math['max'](_0x31bf7a['path']['length'],_0x4e2aac['path']['length']);_0x27ebd7++){const _0x400a03=_0x31bf7a['path'][_0x27ebd7]||0x0,_0x55f983=(_0x4e2aac['path'][_0x27ebd7]||0x0)-_0x400a03;if(_0x16170f[_0x27ebd7]=_0x55f983,0x0!==_0x55f983&&!_0x53bb8d)break;}return _0x16170f;}async['_createInteraction'](_0xd22036,_0x5e8c7c,_0x45b730,_0x2dfe54){const _0x531412=this['editor'];this['_interactionParams']||(this['_interactionParams']={'action':_0x2dfe54,'content':_0xd22036,'version':_0x5e8c7c,'aiBalloon':_0x45b730,'modelFragment':this['editor']['model']['getSelectedContent'](this['editor']['model']['document']['selection']),'anchorData':new Map(),'root':this['editor']['model']['document']['selection']['getFirstRange']()['start']['root']});const _0x178d58=new Qo({'connector':this['_aiConnector'],'locale':_0x531412['locale'],'content':_0xd22036,'version':_0x5e8c7c,..._0x2dfe54});this['_interactions']['push'](_0x178d58);const _0xa1491=(_0x2de8d2,_0x1eebf3=!0x1,_0x5cf581='streaming')=>this['_promiseQueue']['enqueue'](async _0x282120=>{try{const _0x21a454=Rs({'editor':_0x531412,'changeGroups':_0x2de8d2['changeGroups'],'documentContextContent':_0x2de8d2['documentContextContent'],'showDiff':_0x1eebf3,'trimUnchanged':!0x1});_0x21a454['length']&&await this['_actionsBalloonView']['updateContent']({'part':_0x21a454[0x0],'renderingStrategy':_0x5cf581,'abortSignal':_0x282120});}catch(_0x1f123f){if(this['_isAbortError'](_0x1f123f))return;throw _0x1f123f;}});_0x178d58['on']('replyCreated',(_0x362b28,_0x1fce32)=>{this['_actionsBalloonView']['hideLoader'](),this['_actionsBalloonView']['startAutoScroll'](),_0xa1491(_0x1fce32)['catch'](_0x21832a=>{this['_isAbortError'](_0x21832a)||(console['error']('Error\x20updating\x20content\x20in\x20replyCreated:',_0x21832a),this['_setErrorState'](_0x178d58));});}),_0x178d58['on']('replyContentUpdated',(_0xa3ffba,_0x12adef)=>{_0xa1491(_0x12adef)['catch'](_0x27f0d4=>{this['_isAbortError'](_0x27f0d4)||(console['error']('Error\x20updating\x20content\x20in\x20replyContentUpdated:',_0x27f0d4),this['_setErrorState'](_0x178d58));});}),_0x178d58['on']('interactionFinished',async()=>{try{await this['_clearLoadingState'](),this['_actionsBalloonView']['updateMiniToolbarButtons'](this['_interactions']['length'],this['_currentInteractionIndex']),await this['_promiseQueue']['queueEmptyPromise'];}catch(_0x2f7982){this['_isAbortError'](_0x2f7982)||(console['error']('Error\x20clearing\x20loading\x20state\x20in\x20interactionFinished:',_0x2f7982),this['_setErrorState'](_0x178d58));}finally{this['_actionsBalloonView']['stopAutoScroll']();}}),this['listenTo'](this['_actionsBalloonView'],'toggleSuggestionDisplayMode',async(_0x26eb17,{showDiff:_0x3ec4a4})=>{try{this['_balloonShowDiff']=_0x3ec4a4;const _0x16be02=this['_interaction']['replies'][this['_interaction']['replies']['length']-0x1];_0x16be02&&await _0xa1491(_0x16be02,_0x3ec4a4,'static');}catch(_0x5e9956){this['_isAbortError'](_0x5e9956)||(console['error']('Error\x20updating\x20content\x20in\x20toggleSuggestionDisplayMode:',_0x5e9956),this['_setErrorState'](_0x178d58));}}),_0x178d58['on']('replyChangeGroupStateUpdated',()=>{const _0x7ab85b={'positiveCount':_0x178d58['replies']['reduce']((_0x54f60b,_0x2d9b9a)=>_0x54f60b+_0x2d9b9a['changeGroups']['filter'](_0xc32113=>'accepted'===_0xc32113['state'])['length'],0x0),'totalCount':_0x178d58['replies']['reduce']((_0x2d4c53,_0x125e98)=>_0x2d4c53+_0x125e98['changeGroups']['length'],0x0)},_0x34d8ef=_0x178d58['actionCallId'],_0x38b561=_0x178d58['actionName'];_0x38b561?this['_aiConnector']['upsertAIActionRating'](_0x38b561,_0x34d8ef,_0x7ab85b):this['_aiConnector']['upsertCustomAIActionRating'](_0x34d8ef,_0x7ab85b);}),this['_setLoadingState']();try{const _0xfa41f7=await _0x178d58['start']();return this['_actionsBalloonView']['updateMiniToolbarButtons'](this['_interactions']['length'],this['_currentInteractionIndex']),_0xfa41f7;}catch(_0x5d0029){if(this['_isAbortError'](_0x5d0029))return;this['_actionsBalloonView']['hideLoader'](),this['_setErrorState'](_0x178d58);}}['_applyChanges'](_0x1766bc,_0x3782d9,_0x586227,_0x3fc75a){const _0x3df826=this['editor'];if(_0x3fc75a&&!_0x3df826['plugins']['has']('TrackChanges'))throw new at('ai-no-track-changes',null);const _0x32e5c3=this['editor']['plugins']['get'](_0x216072),_0x317c4a=this['_interactions'][this['_interactions']['length']-0x1-this['_currentInteractionIndex']];if(!_0x317c4a||!_0x317c4a['replies']['length'])return;const _0x40727d=_0x317c4a['replies'][_0x317c4a['replies']['length']-0x1],_0x5453a7=_0x40727d['changeGroups'];_0x40727d['setChangeGroupState'](0x0,'accepted');let _0x1a1eb4=qs({'editor':_0x3df826,'reply':_0x40727d,'interaction':_0x317c4a,'groups':_0x5453a7,'transform':!0x1,'documentCompare':_0x32e5c3,'documentCompareOptions':{'anchor':_0x3df826['model']['createPositionAt'](_0x1766bc,0x0),'markDeletions':_0x3fc75a}});_0x1a1eb4=this['_filterOperationsOutsideRange'](_0x1a1eb4,_0x3782d9);for(const _0x5ef1a3 of _0x1a1eb4)this['_anchorOperation'](_0x3782d9,_0x5ef1a3,_0x586227);const _0x1f16c0=_0x317c4a['getDocumentContext']()['version'],_0x477564=_0x3df826['model']['document']['history']['getOperations'](_0x1f16c0),_0x46a633={'document':_0x3df826['model']['document'],'useRelations':!0x1,'padWithNoOps':!0x1},_0x244a97=_0x469e64(_0x1a1eb4,_0x477564,_0x46a633)['operationsA'];_0x3df826['model']['change'](_0x19db2b=>{if(_0x19db2b['setSelection'](_0x3df826['model']['document']['selection']['focus']),_0x3fc75a)_0x3df826['plugins']['get']('TrackChangesEditing')['_applyOperationsAsSuggestions'](_0x244a97);else{for(const _0x5ab2a8 of _0x244a97)_0x5ab2a8['baseVersion']=_0x3df826['model']['document']['version'],Qs(_0x3df826,_0x5ab2a8),_0x19db2b['batch']['addOperation'](_0x5ab2a8),_0x3df826['model']['applyOperation'](_0x5ab2a8);}}),this['editor']['plugins']['get']('AIBalloon')['close']();}['_filterOperationsOutsideRange'](_0x3de620,_0xa6d58a){return _0x3de620['filter'](_0x394838=>{if('rename'==_0x394838['type']){const _0x3bb515=_0x394838['position']['nodeAfter'];return!_0xa6d58a['has'](_0x3bb515);}if(_0x394838['type']['indexOf']('Attribute')>-0x1){const _0x31229b=_0x394838['range']['start']['nodeAfter'];return!_0xa6d58a['has'](_0x31229b);}return!0x0;});}['_anchorOperation'](_0x5dffaf,_0x5f061d,_0x312e8c){const _0x28d776=_0x5f061d['clone']();for(const _0x4aef6d in _0x5f061d){const _0x2f9ebf=_0x5f061d[_0x4aef6d];_0x2f9ebf instanceof _0x17fab8?_0x5f061d[_0x4aef6d]=new _0x17fab8(_0x15b6a3(_0x2f9ebf['start']),_0x15b6a3(_0x2f9ebf['end'])):_0x2f9ebf instanceof _0x4de1b4&&(_0x5f061d[_0x4aef6d]=_0x15b6a3(_0x2f9ebf));}if(['insert','move','remove','reinsert','split','merge']['includes'](_0x28d776['type'])){if(_0x28d776['isDocumentOperation']=!0x1,_0x28d776['baseVersion']=null,'remove'==_0x28d776['type']){const _0x1cfedb=_0x28d776['sourcePosition'],_0x5c0c13=_0x28d776['howMany'];new _0x4178fd(_0x1cfedb,_0x5c0c13)['_execute']();}else _0x28d776['_execute']();}function _0x15b6a3(_0x18267c){if('$graveyard'==_0x18267c['root']['rootName'])return _0x18267c;const _0xb5ef9d=[];let _0x1be45f=_0x18267c['root'];for(let _0x4d3cd8=0x0;_0x4d3cd8<_0x18267c['path']['length'];_0x4d3cd8++){const _0x2b61c7=_0x5dffaf['get'](_0x1be45f)||0x0;_0xb5ef9d[_0x4d3cd8]=_0x18267c['path'][_0x4d3cd8]+_0x2b61c7,_0x1be45f=_0x1be45f['getChildAtOffset'](_0x18267c['path'][_0x4d3cd8]);}return new _0x4de1b4(_0x312e8c,_0xb5ef9d,_0x18267c['stickiness']);}}['_refreshInteraction'](){if(!this['_interactionParams'])return;this['_interactions']['length']>0x0&&this['_stopInteraction'](),this['_currentInteractionIndex']=0x0,this['_balloonShowDiff']=!0x1;const {action:_0x50ef7c,content:_0x19007b,version:_0xd4ed50,aiBalloon:_0x4a44cb}=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'](_0x19007b,_0xd4ed50,_0x4a44cb,_0x50ef7c)['catch'](_0x12008e=>{this['_isAbortError'](_0x12008e)||console['error']('Error\x20refreshing\x20interaction:',_0x12008e);});}['_isAbortError'](_0x360929){return!!_0x360929['message']&&_0x360929['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 _0x31315b=this['_interactions']['length'];this['_currentInteractionIndex']<_0x31315b-0x1&&this['_displayInteractionAtIndex'](this['_currentInteractionIndex']+0x1);}['_navigateToNext'](){this['_currentInteractionIndex']>0x0&&this['_displayInteractionAtIndex'](this['_currentInteractionIndex']-0x1);}async['_displayInteractionAtIndex'](_0x1282f3){if(!this['_interactionParams'])return;this['_currentInteractionIndex']=_0x1282f3;const _0x28bee0=this['_interactions'][this['_interactions']['length']-0x1-this['_currentInteractionIndex']];if(!_0x28bee0)return;if(_0x28bee0['hasError'])return this['_setErrorState'](_0x28bee0),void this['_actionsBalloonView']['updateMiniToolbarButtons'](this['_interactions']['length'],this['_currentInteractionIndex']);if(!_0x28bee0['replies']['length'])return;this['_actionsBalloonView']['hideError'](),this['_interactionParams']&&this['_clearErrorState']();const _0x5de715=_0x28bee0['replies'][_0x28bee0['replies']['length']-0x1];if(_0x5de715){const _0x21dad7=this['editor'];try{const _0x4ccb6a=Rs({'editor':_0x21dad7,'changeGroups':_0x5de715['changeGroups'],'documentContextContent':_0x5de715['documentContextContent'],'showDiff':this['_balloonShowDiff'],'trimUnchanged':!0x1});await new Promise(_0xe15a81=>setTimeout(_0xe15a81,0x32)),await this['_actionsBalloonView']['updateContent']({'part':_0x4ccb6a[0x0],'renderingStrategy':'static','abortSignal':new AbortController()['signal']});}catch(_0x2da6ad){this['_isAbortError'](_0x2da6ad)||console['error']('Error\x20updating\x20content\x20during\x20navigation:',_0x2da6ad);}}this['_actionsBalloonView']['updateMiniToolbarButtons'](this['_interactions']['length'],this['_currentInteractionIndex']);}['_setLoadingState'](){this['_actionsBalloonView']['setIsLoading'](!0x0),this['isBusy']=!0x0;}async['_setErrorState'](_0x11e8ad){const _0x274180=hs(this['editor']['locale'],'AI_ACTIONS_GENERIC_ERROR');this['_actionsBalloonView']['showError'](_0x274180),_0x11e8ad['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 _0x5d673d{static get['requires'](){return[Wo,$o,ta];}static get['pluginName'](){return'AIQuickActions';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x119f03){super(_0x119f03),_0x119f03['config']['define']('ai.quickActions',{'extraCommands':[],'removeCommands':[],'isSearchEnabled':!0x0});}}class ia extends vt{['resultResponseView'];['acceptButtonView'];['dismissButtonView'];['infoButtonView'];['outdatedButtonView'];constructor(_0x32664c,_0x11e109){super(_0x32664c),this['id']=_0x11e109,this['set']('status','pending'),this['set']('changeId',_0x11e109),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',(_0x26ff3c,_0x5b6c4e)=>{_0x5b6c4e&&_0x5b6c4e['target']&&'A'===_0x5b6c4e['target']['tagName']&&_0x5b6c4e['preventDefault'](),this['fire']('activateChange',{'id':_0x11e109,'source':this,'uiInteraction':'click'});}),this['on']('mouseover',()=>{this['fire']('activateChange',{'id':_0x11e109,'source':this,'uiInteraction':'hover'});}),this['on']('mouseout',()=>{this['fire']('deactivateChange',{'origin':'panel','id':_0x11e109,'source':this});});}['setItemAsActive'](){this['isActive']=!0x0;}['setItemAsInactive'](){this['isActive']=!0x1;}['_createResultResponseView'](){const _0x4adc4d=new vt(this['locale']);return _0x4adc4d['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',_0x1f5f1e=>!_0x1f5f1e)]}}),_0x4adc4d;}['_createAcceptButtonView'](){const _0x172f72=new Nt(this['locale']);return _0x172f72['set']({'label':hs(this['locale'],'AI_REVIEW_MODE_ACCEPT_CHANGE'),'withText':!0x0}),_0x172f72['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x558fbd=>{this['fire']('acceptChange',{'id':this['changeId']}),_0x558fbd['stopPropagation']();})},'attributes':{'class':[this['bindTemplate']['if']('status','ck-hidden',_0x234491=>'pending'!==_0x234491&&'accepted'!==_0x234491),this['bindTemplate']['if']('status',ls,_0x375d53=>'pending'===_0x375d53),this['bindTemplate']['if']('status',us,_0x373fae=>'pending'!==_0x373fae),this['bindTemplate']['if']('status','ck-ai_review__check-run-result-status-button',_0x519bce=>'accepted'===_0x519bce)]}}),this['on']('change:status',(_0x2fa067,_0x102abe,_0x414fb3)=>{_0x172f72['isEnabled']='pending'===_0x414fb3,'accepted'===_0x414fb3&&(_0x172f72['label']=hs(this['locale'],'AI_REVIEW_MODE_CHECK_STATUS_ACCEPTED'),_0x172f72['icon']=_0xaff33c);}),_0x172f72;}['_createDismissButtonView'](){const _0x442227=new Nt(this['locale']);return _0x442227['set']({'label':hs(this['locale'],'AI_REVIEW_MODE_DISMISS_CHANGE'),'withText':!0x0}),_0x442227['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x21932a=>{this['fire']('dismissChange',{'id':this['changeId']}),_0x21932a['stopPropagation']();})},'attributes':{'class':[us,this['bindTemplate']['if']('status','ck-hidden',_0x4d69f8=>'pending'!==_0x4d69f8&&'rejected'!==_0x4d69f8),this['bindTemplate']['if']('status','ck-ai_review__check-run-result-dismiss-button',_0x3c1677=>'pending'===_0x3c1677),this['bindTemplate']['if']('status','ck-ai_review__check-run-result-status-button',_0x3a882d=>'rejected'===_0x3a882d)]}}),this['on']('change:status',(_0x5f4de2,_0x4fae0e,_0x54361b)=>{_0x442227['isEnabled']='pending'===_0x54361b,'rejected'===_0x54361b&&(_0x442227['label']=hs(this['locale'],'AI_REVIEW_MODE_CHECK_STATUS_REJECTED'),_0x442227['icon']=_0x5adff9);}),_0x442227;}['_createInfoButtonView'](){const _0x2ed08e=new Nt(this['locale']);return _0x2ed08e['set']({'label':hs(this['locale'],'AI_REVIEW_MODE_LEARN_MORE'),'icon':_0x3f9507,'tooltip':!0x0,'isToggleable':!0x0,'role':'menuitemcheckbox','class':us+'\x20ck-ai_review__check-run-result-info-button\x20ck-hidden'}),_0x2ed08e['bind']('isOn')['to'](this,'isInfoToggleOn',_0x20fbc2=>_0x20fbc2),_0x2ed08e['on']('execute',()=>{this['isInfoToggleOn']=!this['isInfoToggleOn'];}),_0x2ed08e;}['_createOutdatedButtonView'](){const _0x3030fa=new Nt(this['locale']);return _0x3030fa['set']({'label':hs(this['locale'],'AI_REVIEW_MODE_CHECK_STATUS_OUTDATED'),'icon':it,'withText':!0x0,'isEnabled':!0x1}),_0x3030fa['extendTemplate']({'attributes':{'class':[us,'ck-ai_review__check-run-result-status-button',this['bindTemplate']['if']('status','ck-hidden',_0x3141b9=>'outdated'!==_0x3141b9)],'disabled':'disabled'}}),_0x3030fa;}}class sa extends Xt{['resultItemView'];['_pinnedRectIndex']=void 0x0;['_pinnedTargetElement']=void 0x0;['_pinnedTargetChangeId']=void 0x0;constructor(_0x38e825,_0x900cd0){super(_0x38e825),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']()),_0x900cd0['add'](this);}['render'](){super['render'](),this['_setupClickOutsideHandler']();}['updateContent'](_0x486173){this['resultItemView']['changeId']=_0x486173['id'],this['resultItemView']['resultResponseView']['element']['innerHTML']=_0x486173['contentDiffed'];}['showBalloon'](_0x5a909e,_0x2a96e9,_0x10f06d,_0x54d552,_0x30e5b8,_0x473d7b){const _0x3be487=_0x2a96e9();if(!_0x3be487)return;this['updateContent'](_0x5a909e),this['show']();const _0x469c74=Array['from'](_0x3be487['getClientRects']())['reverse'](),_0x2fc9e7=this['_getPointedRectIndexFromEvent'](_0x10f06d,_0x469c74),_0x40ed14=_0x469c74[_0x2fc9e7??0x0];'click'===_0x54d552?(this['isDiffActive']=!0x0,this['pin']({'target':()=>this['_getBestRectPositionOnClick'](_0x2a96e9(),_0x2fc9e7,_0x5a909e['id'],_0x30e5b8,_0x473d7b)||_0x40ed14})):'hover'===_0x54d552&&(this['isDiffActive']=!0x1,this['pin']({'target':()=>this['_getBestRectPositionOnHover'](_0x2a96e9(),_0x2fc9e7,_0x5a909e['id'])||_0x40ed14}));}['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 _0x1b2000=[this['element']];return this['_pinnedTargetElement']&&_0x1b2000['push'](this['_pinnedTargetElement']),_0x1b2000;},'callback':()=>{this['hide'](),this['unpin'](),this['deactivateChange'](),this['_pinnedTargetElement']=void 0x0,this['_pinnedRectIndex']=void 0x0,this['_pinnedTargetChangeId']=void 0x0;}});}['_createContentView'](){const _0x26de3d=new vt();return this['resultItemView']=new ia(this['locale'],''),this['resultItemView']['resultResponseView']['extendTemplate']({'attributes':{'class':['ck-content']}}),this['resultItemView']['delegate']('acceptChange','dismissChange')['to'](this),_0x26de3d['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']]}]}),_0x26de3d;}['_getBestRectPositionOnClick'](_0x3eba28,_0x336ea1,_0x1189dc,_0x57c7fc,_0x520b45){if(!_0x3eba28)return null;const _0x126b20=this['position']['replace']('arrow_',''),_0x27dc4f=Array['from'](_0x3eba28['getClientRects']());let _0x31381c,_0x543394=_0x27dc4f['reverse']();return void 0x0!==_0x336ea1&&this['_isPinnedRectVisible'](_0x543394[_0x336ea1],_0x57c7fc,_0x520b45)?(_0x31381c=_0x543394[_0x336ea1],this['_pinnedRectIndex']=_0x336ea1):this['_isPinnedRectVisible'](_0x543394[0x0],_0x57c7fc,_0x520b45)&&void 0x0===_0x336ea1?_0x31381c=_0x543394[0x0]:(_0x543394='s'==_0x126b20[0x0]?[..._0x27dc4f]['reverse']():_0x27dc4f,_0x543394['forEach'](_0x1e3cde=>{this['_isPinnedRectVisible'](_0x1e3cde,_0x57c7fc,_0x520b45)&&(_0x31381c=_0x1e3cde);})),this['_pinnedTargetChangeId']=_0x1189dc,this['_pinnedTargetElement']=_0x3eba28,_0x31381c||_0x3eba28['getBoundingClientRect']();}['_getBestRectPositionOnHover'](_0x34e28e,_0x1e868d,_0x3be05b){if(!_0x34e28e)return null;const _0x8e892f=Array['from'](_0x34e28e['getClientRects']())['reverse']();if(void 0x0===this['_pinnedRectIndex']&&void 0x0!==_0x1e868d&&this['_pinnedTargetChangeId']!==_0x3be05b)return this['_pinnedRectIndex']=_0x1e868d,this['_pinnedTargetElement']=_0x34e28e,this['_pinnedTargetChangeId']=_0x3be05b,_0x8e892f[_0x1e868d];if(void 0x0!==this['_pinnedRectIndex']&&this['_pinnedTargetChangeId']===_0x3be05b){if(_0x34e28e!==this['_pinnedTargetElement'])return Array['from'](this['_pinnedTargetElement']['getClientRects']())['reverse']()[this['_pinnedRectIndex']];return _0x8e892f[this['_pinnedRectIndex']];}return void 0x0!==_0x1e868d&&this['_pinnedTargetChangeId']!==_0x3be05b?(this['_pinnedRectIndex']=_0x1e868d,this['_pinnedTargetElement']=_0x34e28e,this['_pinnedTargetChangeId']=_0x3be05b,_0x8e892f[_0x1e868d]):_0x34e28e['getBoundingClientRect']();}['_getPointedRectIndexFromEvent'](_0x2c1faf,_0x3cf0da){if(_0x2c1faf)for(let _0x488829=0x0;_0x488829<_0x3cf0da['length'];_0x488829++){const _0x1959a7=_0x3cf0da[_0x488829];if(_0x2c1faf['clientX']>=_0x1959a7['left']-0x3&&_0x2c1faf['clientX']<=_0x1959a7['right']+0x3&&_0x2c1faf['clientY']>=_0x1959a7['top']-0x3&&_0x2c1faf['clientY']<=_0x1959a7['bottom']+0x3)return _0x488829;}}['_isPinnedRectVisible'](_0x42543c,_0x25a23c,_0x103080){const _0x5e7359=new ut(_0x42543c),_0x23d98c=_0x25a23c||document['documentElement'],_0x4c74b7=_0x5e7359['getIntersection'](Rt(_0x103080)),_0x20f7a6=new ut(_0x23d98c)['getIntersection'](_0x5e7359);return!!(_0x4c74b7&&_0x20f7a6&&_0x5e7359['width']>0x0);}}const na=['getReviewCheckList','runReviewCheck','abortReviewStream','toggleDiff','acceptAllChanges','leaveReviewCoreResultList','activateChange','deactivateChange','acceptChange','dismissChange','learnMore','finishReview','retryReview'];class ra extends _0x1c4dd1{['_mainView'];['_balloonSuggestionView'];['_bodyCollection'];static get['requires'](){return[os];}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x282fff){super(_0x282fff),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 _0x46906a=this['context']['plugins']['get']('AITabs');this['registerTab'](_0x46906a);}['destroy'](){this['_bodyCollection']['detachFromDom'](),super['destroy']();}['setAvailableChecks'](_0x10c6aa){if(!this['_mainView']['reviewCheckListView']['hasChecks']()){const _0x30e053=!this['context']['config']['get']('ai.models.showModelSelector');this['_mainView']['reviewCheckListView']['setChecks'](_0x10c6aa,_0x30e053);}this['_mainView']['showReviewCheckListView']();}['showReviewCheckList'](){this['fire']('getReviewCheckList');}['showCheckRunResults'](_0x564bb5){_0x564bb5&&('error-general'!==_0x564bb5['status']?'error-chunk'!==_0x564bb5['status']?this['_mainView']['showReviewCheckResultsView']():this['showChunkErrorView']():this['showGeneralResultsErrorView']());}['showCheckRunResult'](_0x455d50){this['_mainView']['addCheckRunResult'](_0x455d50);}['showGeneralResultsErrorView'](){this['_mainView']['showGeneralResultsErrorView']();}['showGeneralReviewCoreErrorView'](_0x23bb2a){this['_mainView']['showGeneralReviewCoreErrorView'](_0x23bb2a??hs(this['context']['locale'],'AI_REVIEW_INITIALIZATION_ERROR_MESSAGE'));}['showChunkErrorView'](){this['_mainView']['showChunkErrorView']();}['setCheckResultTitle'](_0x59798a,_0x597493){this['_mainView']['reviewCheckResultsView']['setTitle'](_0x59798a,_0x597493);}['setActiveStateInResults'](_0x9938b3){this['_mainView']['reviewCheckResultsView']['getResults']()['forEach'](_0x3f4ed1=>{_0x3f4ed1['id']===_0x9938b3&&_0x3f4ed1['setItemAsActive']();});}['resetActiveStateInResults'](){this['_mainView']['reviewCheckResultsView']['getResults']()['forEach'](_0x16bf08=>_0x16bf08['setItemAsInactive']());}['updateChangeState'](_0x58e7f5,_0x56a786){'accepted'===_0x56a786||'rejected'===_0x56a786||'outdated'===_0x56a786?this['_mainView']['reviewCheckResultsView']['hideResult'](_0x58e7f5,_0x56a786):this['_mainView']['reviewCheckResultsView']['showResult'](_0x58e7f5,_0x56a786);}['showReviewCompletedView'](){this['_mainView']['showReviewCompletedView']();}['showActionsWhenResultIsReady'](){this['_mainView']['showActionsWhenResultIsReady']();}['showNoChangesView'](){this['_mainView']['showNoChangesView']();}['hideActionsWhenResultIsReady'](){this['_mainView']['hideActionsWhenResultIsReady']();}['showChangeBalloon'](_0x29acdd,_0x5273e6,_0x41fce4,_0x23ec3c,_0x49fac8,_0x294c9e){this['_balloonSuggestionView']['showBalloon'](_0x29acdd,_0x5273e6,_0x41fce4,_0x23ec3c,_0x49fac8,_0x294c9e);}['hideChangeBalloon'](){this['_balloonSuggestionView']['hideBalloon']();}['hideDiffInBalloon'](){this['_balloonSuggestionView']['hideDiffInBalloon']();}['showDiffInBalloon'](){this['_balloonSuggestionView']['showDiffInBalloon']();}['getChangeElement'](_0x499b0a){const _0x4f4cb0=this['_mainView']['reviewCheckResultsView']['getResults']()['find'](_0x4abdef=>_0x4abdef['id']===_0x499b0a);return _0x4f4cb0?_0x4f4cb0['element']:null;}['deactivateChange'](){this['_balloonSuggestionView']['deactivateChange']();}}class oa extends vt{constructor(_0x35ca00){super(_0x35ca00),this['set']('isVisible',!0x1),this['set']('errorMessage','');const _0x43d54d=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai_review__general-error-container',_0x43d54d['if']('isVisible','ck-hidden',_0x11322d=>!_0x11322d)]},'children':[{'tag':'p','attributes':{'class':'ck\x20ck-ai-notification\x20ck-ai-notification_error'},'children':[{'text':_0x43d54d['to']('errorMessage')}]}]});}}class aa extends vt{['reviewCoreHeader'];['generalErrorView'];['reviewCheckListView'];['reviewCheckResultsView'];['reviewCompletedView'];constructor(_0x11e05f,_0xa32994){super(_0x11e05f),this['reviewCoreHeader']=_0xa32994['header'],this['generalErrorView']=new oa(_0x11e05f),this['reviewCheckListView']=_0xa32994['list'],this['reviewCheckListView']['delegate'](...na)['to'](this),this['reviewCheckResultsView']=_0xa32994['results'],this['reviewCheckResultsView']['delegate'](...na)['to'](this),this['reviewCompletedView']=_0xa32994['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'](_0x3bf3af){this['reviewCheckResultsView']['addResult'](_0x3bf3af),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'](_0x55b79d){this['generalErrorView']['set']('isVisible',!0x0),this['generalErrorView']['errorMessage']=_0x55b79d;}['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(_0x370c34,_0x7ab464){super(_0x7ab464),this['set']({'label':_0x370c34,'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(_0x5380c2,_0x20a8ce){super(_0x5380c2),this['_contents']=_0x20a8ce,this['_resultViews']=new _0x54e610(),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(_0x5380c2),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 _0x4835a8=this['_createCombinedSkeletonLoader'](),_0x404722=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-run',_0x404722['if']('isLoading','ck-ai_review__check-run_loading',_0x63dbe1=>_0x63dbe1),_0x404722['if']('isResultReady','ck-ai_review__check-run_ready',_0x1e2718=>_0x1e2718),_0x404722['if']('isVisible','ck-hidden',_0x297836=>!_0x297836)]},'children':[this['_resultsHeader'],this['_errorMessageView'],this['_resultsBody'],_0x4835a8,this['reviewDisclaimer']]});}['clearResults'](){this['_resultViews']['clear'](),this['_resultsBody']['element']&&(this['_resultsBody']['element']['scrollTop']=0x0);}['getResults'](){return this['_resultViews'];}['addResult'](_0x6bff04){const _0x4d284e=new ia(this['locale'],_0x6bff04['id']);_0x4d284e['delegate']('acceptChange','dismissChange','activateChange','deactivateChange')['to'](this),this['_resultViews']['add'](_0x4d284e),_0x4d284e['resultResponseView']['element']['innerHTML']=_0x6bff04['contentDiffed'];}['hideResult'](_0x4d118b,_0x3b54d3){if('pending'===_0x3b54d3)return;const _0x1bd888=this['_resultViews']['find'](_0x5b803e=>_0x5b803e['id']===_0x4d118b);_0x1bd888&&(_0x1bd888['status']=_0x3b54d3,_0x1bd888['element']?.['classList']['add']('ck-ai_review__check-run-result_grayout'));}['showResult'](_0x10d7ab,_0x7e6d32){if('pending'!==_0x7e6d32)return;const _0x840282=this['_resultViews']['find'](_0x4f03be=>_0x4f03be['id']===_0x10d7ab);_0x840282&&(_0x840282['status']=_0x7e6d32,_0x840282['element']?.['classList']['remove']('ck-ai_review__check-run-result_grayout'));}['setTitle'](_0x39118a,_0x586e97){this['headerTitle']=_0x39118a,this['headerSubtitle']=_0x586e97||'';}['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 _0x382c5b=new vt(this['locale']),_0x5839ef=[];for(let _0x1d0e1c=0x0;_0x1d0e1c<0x10;_0x1d0e1c++){const _0x134cff=this['_createSkeletonLoader']();_0x134cff['extendTemplate']({'attributes':{'class':['ck-ai_review__check-run-skeleton-item']}}),_0x5839ef['push'](_0x134cff);}return _0x382c5b['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-run-skeleton-container',this['bindTemplate']['if']('isLoading','ck-hidden',_0x17dd5d=>!_0x17dd5d)]},'children':_0x5839ef}),_0x382c5b;}['_createResultsBodyView'](){const _0x1f3a5c=new vt(this['locale']);return _0x1f3a5c['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-run-results-container','ck-reset_all-excluded',this['bindTemplate']['if']('isLoading','ck-hidden',_0x3aa5a8=>_0x3aa5a8)]},'children':this['_resultViews']}),_0x1f3a5c;}['_createErrorView'](){const _0x1bf577=new vt(this['locale']),_0x40d35f=new Nt(this['locale']),t=this['locale']['t'];return _0x1bf577['delegate']('retryReview')['to'](this),_0x40d35f['set']({'label':t('Try\x20again'),'withText':!0x0,'class':ls+'\x20ck-ai_review__check-run-error-retry-button'}),_0x40d35f['on']('execute',()=>{this['fire']('retryReview');}),_0x1bf577['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-run-error-container',this['bindTemplate']['if']('showErrorMessage','ck-hidden',_0x48f2e4=>!_0x48f2e4),this['bindTemplate']['if']('errorType','ck-ai_review__check-run-error-container_border-bottom',_0x21d1a3=>'chunk'===_0x21d1a3)]},'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',_0x19db43=>'chunk'===_0x19db43)]},'children':[{'tag':'p','attributes':{'class':['ck-ai-notification__content',this['bindTemplate']['if']('errorType','ck-hidden',_0x148320=>'general'!==_0x148320)]},'children':[{'text':this['_contents']['generalErrorText']}]},{'tag':'p','attributes':{'class':['ck-ai-notification__content',this['bindTemplate']['if']('errorType','ck-hidden',_0x48e5fe=>'chunk'!==_0x48e5fe)]},'children':[{'text':hs(this['locale'],'AI_REVIEW_MODE_CHUNK_ERROR_MESSAGE')}]}]},_0x40d35f]}),_0x1bf577;}['_createCancelButtonView'](){const _0x4f1684=new Nt(this['locale']);return _0x4f1684['set']({'label':hs(this['locale'],'AI_REVIEW_MODE_STOP_GENERATING'),'withText':!0x0,'class':[ls+'\x20ck-ai-button-stop-generating'],'icon':_0x2c4109}),_0x4f1684['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isResultReady','ck-hidden',_0x2e1605=>_0x2e1605),this['bindTemplate']['if']('isCompleted','ck-hidden',_0x4ee8b6=>_0x4ee8b6)]}}),_0x4f1684['on']('execute',()=>{this['fire']('abortReviewStream');}),_0x4f1684;}['_createToggleDiffButtonView'](){const _0x1a3358=new Nt(this['locale']);_0x1a3358['set']({'tooltip':!0x0,'isToggleable':!0x0,'role':'menuitemcheckbox'}),_0x1a3358['bind']('isEnabled')['to'](this,'isError',_0xc33dc9=>!_0xc33dc9),_0x1a3358['extendTemplate']({'attributes':{'class':[ls,'ck-ai_review__check-run-toggle-diff-button',this['bindTemplate']['if']('isResultReady','ck-hidden',_0x297842=>!_0x297842),this['bindTemplate']['if']('isCompleted','ck-hidden',_0x2b30d0=>_0x2b30d0)]}});const _0x19409f=hs(this['locale'],'AI_REVIEW_MODE_HIDE_CHANGES'),_0xe7ce49=hs(this['locale'],'AI_REVIEW_MODE_SHOW_CHANGES');return _0x1a3358['bind']('isOn')['to'](this,'isToggleDiffOn',_0x114826=>_0x114826),_0x1a3358['bind']('icon')['to'](this,'isToggleDiffOn',_0x2f7969=>_0x2f7969?st:nt),_0x1a3358['bind']('label')['to'](this,'isToggleDiffOn',_0x24b626=>_0x24b626?_0x19409f:_0xe7ce49),_0x1a3358['on']('execute',()=>{this['isToggleDiffOn']=!this['isToggleDiffOn'],this['fire']('toggleDiff',{'on':this['isToggleDiffOn']});}),_0x1a3358;}['_createAcceptAllButtonView'](){const _0x2a08e5=new Nt(this['locale']);return _0x2a08e5['set']({'label':hs(this['locale'],'AI_REVIEW_MODE_ACCEPT_ALL'),'withText':!0x0}),_0x2a08e5['bind']('isEnabled')['to'](this,'isError',_0x270563=>!_0x270563),_0x2a08e5['extendTemplate']({'attributes':{'class':[cs,'ck-ai_review__check-run-accept-all-button',this['bindTemplate']['if']('isResultReady','ck-hidden',_0x13453c=>!_0x13453c),this['bindTemplate']['if']('isCompleted','ck-hidden',_0x364f73=>_0x364f73)]}}),_0x2a08e5['on']('execute',()=>{this['fire']('acceptAllChanges');}),_0x2a08e5;}['_createExitReviewButtonView'](){const _0x13ed41=new Nt(this['locale']);return _0x13ed41['set']({'label':hs(this['locale'],'AI_REVIEW_MODE_EXIT_REVIEW'),'withText':!0x0}),_0x13ed41['extendTemplate']({'attributes':{'class':[us,'ck-ai_review__check-run-exit-button',this['bindTemplate']['if']('isResultReady','ck-hidden',_0x2aa5a9=>!_0x2aa5a9),this['bindTemplate']['if']('isCompleted','ck-hidden',_0x5211aa=>_0x5211aa)]}}),_0x13ed41['on']('execute',()=>{this['fire']('leaveReviewCoreResultList');}),_0x13ed41;}['_createResultHeaderView'](){const _0x33a4c7=new vt(this['locale']),_0x4af516=this['_createTitleView']();return _0x33a4c7['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-run-results-header',this['bindTemplate']['if']('isCompleted','ck-ai_review__review-completed-header',_0x1d25b2=>_0x1d25b2)]},'children':[_0x4af516,{'tag':'div','attributes':{'class':['ck-ai_review__check-run-results-header-buttons']},'children':[this['_cancelButtonView'],this['_acceptAllButtonView'],this['_exitReviewButtonView'],this['_toggleDiffButtonView'],this['_finishReviewButtonView']]}]}),_0x33a4c7;}['_createTitleView'](){const _0x144195=new vt(this['locale']),_0x1e3403=new yn();return _0x1e3403['bind']('isVisible')['to'](this,'isResultReady',_0x1e6ab5=>!_0x1e6ab5),_0x144195['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-run-results-header-title-wrapper']},'children':[_0x1e3403,{'tag':'div','attributes':{'class':['ck-ai_review__check-run-results-header-title-content',this['bindTemplate']['if']('isCompleted','ck-hidden',_0x53b698=>_0x53b698)]},'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',_0x117cf6=>!_0x117cf6)]},'children':[{'text':hs(this['locale'],'AI_REVIEW_MODE_FINISH_REVIEW_HEADER_TITLE')}]}]}),_0x144195;}['_createFinishReviewButtonView'](){const _0x590a0d=new ha(hs(this['locale'],'AI_REVIEW_MODE_FINISH_REVIEW_BUTTON_LABEL'),this['locale']);return _0x590a0d['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isCompleted','ck-hidden',_0x120cbf=>!_0x120cbf)]}}),_0x590a0d['delegate']('finishReview')['to'](this),_0x590a0d;}}class la extends Ht{['_resultsHeader'];['_finishReviewButtonView'];constructor(_0x12a308,_0x2e207f){super(_0x12a308),this['_finishReviewButtonView']=this['_createFinishReviewButtonView'](_0x2e207f['buttonText']),this['_resultsHeader']=this['_createResultHeaderView'](_0x2e207f['headerText']);const _0x4b45b7=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__review-completed',_0x4b45b7['if']('isVisible','ck-hidden',_0x8321e5=>!_0x8321e5)]},'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':_0x2e207f['emptyResultsText']}]}]}]});}['_createFinishReviewButtonView'](_0xc10418){const _0x5b9f9b=new ha(_0xc10418,this['locale']);return _0x5b9f9b['delegate']('finishReview')['to'](this),_0x5b9f9b;}['_createResultHeaderView'](_0x5bfb61){const _0x4cf0f3=new vt(this['locale']);return _0x4cf0f3['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':_0x5bfb61}]},{'tag':'div','attributes':{'class':['ck-ai_review__review-completed-header-buttons']},'children':[this['_finishReviewButtonView']]}]}),_0x4cf0f3;}}class ua extends vt{['_dropdownView'];['_defaultValue'];['_defaultLabel'];constructor(_0x2bd584,_0x4608e4){super(_0x2bd584),this['_defaultValue']=_0x4608e4['default']||(_0x4608e4['data']['length']>0x0?_0x4608e4['data'][0x0]['id']:''),this['_defaultLabel']=_0x4608e4['data']['find'](_0x2f653c=>_0x2f653c['id']===this['_defaultValue'])?.['label']||'',this['set']('formValue',''),this['_dropdownView']=Gt(this['locale']);const _0x5d3ed0=this['_prepareListOptions'](_0x4608e4['data']);jt(this['_dropdownView'],_0x5d3ed0,{'role':'menu','ariaLabel':_0x4608e4['label']}),this['_dropdownView']['buttonView']['set']({'label':this['_defaultLabel'],'withText':!0x0}),this['_dropdownView']['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x5d671e=>{_0x5d671e['stopPropagation']();})}}),this['listenTo'](this['_dropdownView'],'execute',_0x188177=>{this['formValue']=_0x188177['source']['model']['id'],this['_dropdownView']['buttonView']['label']=_0x188177['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'](_0x3ff049=[]){const _0x492036=new dt();this['resetToDefault']();for(const _0x404692 of _0x3ff049){const _0x56108c=new Jt({'label':_0x404692['label'],'withText':!0x0,'role':'menuitemradio','id':_0x404692['id'],'model':_0x404692});_0x56108c['bind']('isOn')['to'](this,'formValue',_0x55943e=>_0x55943e===_0x56108c['id']);const _0x2a28aa={'type':'button','model':_0x56108c};_0x492036['add'](_0x2a28aa);}return _0x492036;}}class da extends Ht{['_formItem']=null;constructor(_0x5a8c04,_0x43170e,_0x4b5845){super(_0x5a8c04),this['argsKey']=_0x43170e?.['argsKey'];if('dropdown'===_0x43170e['formType'])this['_formItem']=new ua(this['locale'],_0x43170e);this['set']('value',''),this['bind']('value')['to'](this['_formItem'],'formValue');const _0x6e9843=new _0x5a557f(this['locale'],{'children':[this['_formItem']],'class':[_0x4b5845?'ck-form__row_with-submit':'']});_0x4b5845&&_0x6e9843['children']['add'](_0x4b5845),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai_review__form-item','ck-reset_all']},'children':[_0x6e9843]});}['resetToDefault'](){this['_formItem']['resetToDefault']();}}class _a extends _0x2ea38e{['keystrokes'];static ['MIN_ROWS']=0x1;static ['MAX_ROWS']=0xc;constructor(_0xbce071){super(_0xbce071),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 _0x54e610();['submitButtonView'];['cancelButtonView'];['promptInputView'];['actionsFooterView'];['_modelSelectionDropdown'];['_modelNameView'];['_modelSelectionDropdownItems'];['_check'];['_defaultValue'];['_defaultLabel'];constructor(_0x3a87fa,_0x3c11e0,_0x161288=!0x1){super(_0x3a87fa),this['_check']=_0x3c11e0,this['set']('prompt',''),this['set']('modelId',''),this['set']('modelDisplayMode','selector'),this['set']('activeModelName',null),this['_defaultValue']=_0x3c11e0['defaultModel']?_0x3c11e0['defaultModel']['id']:'',this['_defaultLabel']=_0x3c11e0['defaultModel']?_0x3c11e0['defaultModel']['name']:'',this['submitButtonView']=this['_createSubmitButtonView'](),this['cancelButtonView']=this['_createCancelButtonView'](),(this['promptInputView']=new te(this['locale'],()=>new _a(_0x3a87fa)),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'](_0x161288),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 _0x5a557f(this['locale'],{'children':[this['promptInputView']]}),new _0x5a557f(this['locale'],{'children':[this['actionsFooterView']]})]}),this['promptInputView']['fieldView']['keystrokes']['set']('Enter',(_0x5f4ea6,_0x29eb1f)=>{this['_isValid']()?(this['fire']('runReviewCheck',{'id':'custom','args':{'prompt':this['prompt'],'model':this['modelId']},'isCustom':!0x0}),_0x29eb1f()):_0x29eb1f();}),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'](_0x3986c0=>{this['_focusables']['add'](_0x3986c0),this['focusTracker']['add'](_0x3986c0['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 _0x2897e3 of this['_getFormValidators']()){const _0x4e72cc=_0x2897e3();if(_0x4e72cc)return this['promptInputView']['errorText']=_0x4e72cc,!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 _0x4912dc=new Nt(this['locale']),t=this['locale']['t'];return _0x4912dc['set']({'label':t('Submit'),'withText':!0x0,'class':cs}),_0x4912dc['on']('execute',()=>{this['_isValid']()&&this['fire']('runReviewCheck',{'id':'custom','args':{'prompt':this['prompt'],'model':this['modelId']},'isCustom':!0x0});}),_0x4912dc;}['_createCancelButtonView'](){const _0x3c297a=new Nt(this['locale']),t=this['locale']['t'];return _0x3c297a['set']({'label':t('Cancel'),'withText':!0x0,'class':us}),_0x3c297a['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x677f42=>{_0x677f42['stopPropagation']();})}}),_0x3c297a['on']('execute',()=>{this['resetToDefault'](),this['fire']('closeCustomCheck');}),_0x3c297a;}['_setModelList'](_0x54393d){this['_modelSelectionDropdownItems']['clear']();const _0x214664=this['_check']['models'];if(_0x54393d)this['set']('modelDisplayMode','hidden');else{const _0x5000ca=0x1===_0x214664['length'];this['set']('modelDisplayMode',_0x5000ca?'name':'selector');}if(this['resetToDefault'](),_0x214664?.['length']){0x1===_0x214664['length']&&this['set']('activeModelName',_0x214664[0x0]['name']||_0x214664[0x0]['id']);for(const _0x37e318 of _0x214664){const _0x32d97b=new Jt({'label':_0x37e318['name'],'withText':!0x0,'role':'menuitemradio','id':_0x37e318['id'],'model':_0x37e318});_0x32d97b['bind']('isOn')['to'](this,'modelId',_0x53e171=>_0x53e171===_0x37e318['id']),this['_modelSelectionDropdownItems']['add']({'type':'button','model':_0x32d97b,'labelView':new Ia(this['locale'],_0x37e318)});}}}['_createModelSelectionDropdown'](){const _0x1ba75f=Gt(this['locale']);return _0x1ba75f['set']({'panelPosition':'se','class':'ck-ai_review__check-list-item-model-dropdown'}),_0x1ba75f['buttonView']['set']({'label':this['_defaultLabel'],'withText':!0x0,'tooltip':!0x0,'class':us}),_0x1ba75f['buttonView']['bind']('isVisible')['to'](this,'modelDisplayMode',_0x3f37b1=>'selector'===_0x3f37b1),this['listenTo'](_0x1ba75f,'execute',_0x25638f=>{this['modelId']=_0x25638f['source']['model']['id'],_0x1ba75f['buttonView']['label']=_0x25638f['source']['label'];}),_0x1ba75f;}['_createModelNameView'](){const _0x41aa0e=new Aa(this['locale']);return _0x41aa0e['bind']('text')['to'](this,'activeModelName',_0x587ad6=>_0x587ad6??''),_0x41aa0e['bind']('isVisible')['to'](this,'modelDisplayMode',_0x1e12af=>'name'===_0x1e12af),_0x41aa0e;}['_createActionsFooterView'](){const _0x595e0d=new vt(this['locale']);return _0x595e0d['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']]}]}),_0x595e0d;}}class Aa extends vt{constructor(_0x531e45){super(_0x531e45),this['set']('text',void 0x0),this['set']('isVisible',!0x0);const _0x306579=this['bindTemplate'];this['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai_review__check-list-item-model-name',_0x306579['if']('isVisible','ck-hidden',_0x22c199=>!_0x22c199)]},'children':[{'text':_0x306579['to']('text')}]});}}class Ia extends Mt{constructor(_0x43f4ec,_0x464674){super();const _0x5091e5=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-button__label'],'style':_0x5091e5['to']('style'),'id':_0x5091e5['to']('id')},'children':[{'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-model-dropdown-name']},'children':[{'tag':'span','children':[{'text':_0x5091e5['to']('text')}]}]},{'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-model-dropdown-description']},'children':[{'tag':'span','children':[_0x464674['description']||'']}]}]});}}class Ea extends Ht{['_formItemsCollection']=new _0x54e610();['_customCheckView']=null;['_hideModels']=!0x1;constructor(_0x355092,_0x25e852,_0x41e0fd,_0x4943cd=!0x1){super(_0x355092),this['_hideModels']=_0x4943cd,this['set']('isParametrizedViewOpen',!0x1),this['set']('isListItemRendered',!0x1),this['set']('isItemParametrized',_0x25e852['isParameterized']);const _0x2520fe=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',_0x461fbc=>_0x461fbc),this['bindTemplate']['if']('isListItemRendered','ck-ai_review__check-list-item_rendered',_0x2fa5cf=>_0x2fa5cf)],'style':{'--ck-ai-review-check-list-item-index':_0x41e0fd}},'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':_0x25e852['title']}]},_0x2520fe]},{'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-description']},'children':_0x25e852['description']?[{'text':_0x25e852['description']}]:[]}]}]},..._0x25e852['isParameterized']?[this['_createParameterizedView'](_0x25e852)]:[],...'custom'===_0x25e852['id']?[this['_createCustomView'](_0x25e852,this['_hideModels'])]:[]]}),this['on']('click',()=>{_0x25e852['isParameterized']?this['isParametrizedViewOpen']=!0x0:this['fire']('runReviewCheck',{'id':_0x25e852['id'],'args':_0x25e852['useArgs']?_0x25e852['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'](_0x147c0f=>{_0x147c0f['resetToDefault']();}),this['_customCheckView']&&this['_customCheckView']['resetToDefault']();}['_createIconView'](){const _0x6f8a68=new xt();return _0x6f8a68['content']=rt,_0x6f8a68['extendTemplate']({'attributes':{'class':['ck-ai_review__check-list-item-title-icon']}}),_0x6f8a68;}['_createParameterizedView'](_0x3336dc){const _0x44020e=new vt(),_0xc1d197=this['_createFormView'](_0x3336dc);return _0x44020e['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-parameterized',this['bindTemplate']['if']('isParametrizedViewOpen','ck-hidden',_0x10c073=>!_0x10c073)]},'children':[_0xc1d197]}),_0x44020e;}['_createFormView'](_0x3e8f43){const _0x7aac9c=new vt(),_0x2fe8b9=Array['isArray'](_0x3e8f43['options'])?_0x3e8f43['options']:[],_0x35695f=new Nt(this['locale']),t=this['locale']['t'];_0x35695f['set']({'label':t('Submit'),'withText':!0x0,'class':cs}),_0x35695f['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x5e0f56=>{_0x5e0f56['stopPropagation']();})}}),_0x35695f['on']('execute',()=>{const _0x1b0ec9=[],_0x3ee83c={};this['_formItemsCollection']['forEach'](_0x522d51=>{_0x1b0ec9['push'](_0x522d51['value']),_0x3e8f43['useArgs']&&_0x3e8f43['options']&&(_0x3ee83c[_0x522d51['argsKey']]=_0x522d51['value']);}),this['fire']('runReviewCheck',{'id':_0x3e8f43['id'],'params':_0x1b0ec9['length']?_0x1b0ec9:void 0x0,'args':Object['keys'](_0x3ee83c)['length']?_0x3ee83c:void 0x0});});const _0x687387=_0x2fe8b9['length'];return _0x2fe8b9['forEach']((_0x5b7795,_0x2723f3)=>{const _0x438148=_0x2723f3===_0x687387-0x1;this['_formItemsCollection']['add'](new da(this['locale'],_0x5b7795,_0x438148?_0x35695f:null));}),_0x7aac9c['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-parameterized-form']},'children':this['_formItemsCollection']}),_0x7aac9c;}['_createCustomView'](_0x312c04,_0x1fafa0=!0x1){return this['_customCheckView']=new ga(this['locale'],_0x312c04,_0x1fafa0),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',_0x3b385c=>!_0x3b385c)]}}),this['_customCheckView']['delegate']('runReviewCheck')['to'](this),this['listenTo'](this['_customCheckView'],'closeCustomCheck',()=>{this['isParametrizedViewOpen']=!0x1;}),this['on']('change:isParametrizedViewOpen',(_0x5ac5ff,_0x109fee,_0xf5fce5)=>{_0xf5fce5||this['_customCheckView']['resetFormValidationStatus']();}),this['_customCheckView'];}}class pa extends Ht{['_checkViews'];constructor(_0x27aa2b){super(_0x27aa2b),this['_checkViews']=new _0x54e610(),this['_setupTemplate']();}['setChecks'](_0x3382de,_0x74a854=!0x1){this['_checkViews']['clear']();for(const [_0x46b177,_0x3f1e1b]of _0x3382de['entries']()){const _0x4de4c5=new Ea(this['locale'],_0x3f1e1b,_0x46b177,_0x74a854);_0x4de4c5['delegate']('runReviewCheck')['to'](this),this['_checkViews']['add'](_0x4de4c5);}}['hasChecks'](){return this['_checkViews']['length']>0x0;}['resetAllParameterizedChecks'](){for(const _0x4dfb45 of this['_checkViews'])_0x4dfb45 instanceof Ea&&_0x4dfb45['resetToDefault']();}['_setupTemplate'](){const _0x433219=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-list',_0x433219['if']('isVisible','ck-hidden',_0x441462=>!_0x441462)]},'children':this['_checkViews']});}}class ma extends ra{static get['pluginName'](){return'AIReviewModeUI';}['createMainView'](){const _0x292134=this['context']['plugins']['get']('AITabs'),_0x5271e0=this['context']['locale'],_0x14e45b=new eo(_0x5271e0,{'label':hs(_0x5271e0,'AI_REVIEW_MODE'),'icon':_0x2d3729,'class':'ck-ai-header_review','showResizeButton':_0x292134['showResizeButton']});return _0x14e45b['delegate']('resizeTabs')['to'](_0x292134),_0x14e45b['bind']('isMaximized')['to'](_0x292134['view'],'isMaximized',_0x3212c4=>_0x3212c4),new aa(this['context']['locale'],{'header':_0x14e45b,'list':new pa(_0x5271e0),'results':new ca(_0x5271e0,{'generalErrorText':hs(_0x5271e0,'AI_REVIEW_MODE_GENERAL_ERROR_MESSAGE')}),'completed':new la(_0x5271e0,{'headerText':hs(_0x5271e0,'AI_REVIEW_MODE_FINISH_REVIEW_HEADER_TITLE'),'emptyResultsText':hs(_0x5271e0,'AI_REVIEW_MODE_EMPTY_RESULTS_TEXT'),'buttonText':hs(_0x5271e0,'AI_REVIEW_MODE_FINISH_REVIEW_BUTTON_LABEL')})});}['registerTab'](){const _0x12ee54=this['context']['plugins']['get']('AITabs');_0x12ee54['view']['on']('activateTab',(_0x564622,{newTab:_0x312c19,oldTab:_0x46b0fc})=>{'reviewMode'===_0x312c19?this['fire']('getReviewCheckList'):'reviewMode'===_0x46b0fc&&this['fire']('leaveReview');}),_0x12ee54['view']['addTab']({'id':'reviewMode','buttonLabel':hs(this['context']['locale'],'AI_REVIEW_MODE'),'buttonIcon':_0x2d3729,'order':0x0,'content':this['_mainView']});}}const Ta='review-',Ca=['softBreak'];class wa extends _0x1c4dd1{static get['requires'](){return[_0x216072,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(_0x4cc7b4){super(_0x4cc7b4),this['_domEmitter']=new(Ot())(),this['_eventEmitter']=new(Tt())();}get['emitter'](){return this['_eventEmitter'];}['afterInit'](){const _0x40b3c4=_0x521607=>this['_scheduleAttachReviewEditingToEditor'](_0x521607);if(this['_registerGlobalBalloonBlurHandler'](),this['context']instanceof _0x123c85)return void this['_attachReviewEditingToEditor'](this['context']);const _0x8e67f7=this['context'];for(const _0x2ec687 of _0x8e67f7['editors'])_0x40b3c4(_0x2ec687);this['listenTo'](_0x8e67f7['editors'],'add',(_0x503e73,_0xaf1808)=>{_0x40b3c4(_0xaf1808);}),this['listenTo'](_0x8e67f7['editors'],'remove',(_0x3f2df5,_0x4e8d14)=>{for(const [_0x5a3303,_0x73760b]of this['_markers'])_0x73760b['editor']===_0x4e8d14&&(this['_eventEmitter']['fire']('changeMarkerRemoved',{'markerId':_0x5a3303,'changeId':_0x73760b['groupId']}),this['_markers']['delete'](_0x5a3303));});}['_scheduleAttachReviewEditingToEditor'](_0x26304c){const _0x4fab34=()=>{'destroyed'!==_0x26304c['state']&&_0x26304c['conversion']&&this['_attachReviewEditingToEditor'](_0x26304c);};if('ready'===_0x26304c['state'])return void _0x4fab34();const _0x258bdb=()=>{this['stopListening'](_0x26304c,'ready',_0x258bdb),_0x4fab34();};this['listenTo'](_0x26304c,'ready',_0x258bdb);}['_attachReviewEditingToEditor'](_0x5a1d22){this['_reviewEditingAttachedEditors']['has'](_0x5a1d22)||(_0x5a1d22['conversion']['for']('editingDowncast')['markerToElement']({'model':Ta+'insert','view':(_0x4c28d4,{writer:_0x4cce5f})=>{const _0x4a733c=this['_markers']['get'](_0x4c28d4['markerName']),_0x4fdccf={'class':'ck-ai_review-marker_add'+(this['_activeMarkers']['has'](_0x4a733c?.['id']||'')?'\x20ck-ai_review__change_active':''),'data-marker-id':_0x4c28d4['markerName']};return _0x4cce5f['createUIElement']('span',_0x4fdccf,function(_0x53d1cb){const _0x4c77e7=this['toDomElement'](_0x53d1cb);return _0x4c77e7['innerHTML']=_0x4a733c?.['content']?.['asString']||'',_0x4c77e7;});}}),_0x5a1d22['conversion']['for']('editingDowncast')['markerToHighlight']({'model':Ta+'remove-only','view':_0x568256=>{const _0x379a95=this['_markers']['get'](_0x568256['markerName']),_0x5d529a=['ck-ai_review-marker_strikethrough'];return this['_activeMarkers']['has'](_0x379a95?.['id']||'')&&_0x5d529a['push']('ck-ai_review__change_active'),{'classes':_0x5d529a,'attributes':{'data-marker-id':_0x568256['markerName']}};}}),_0x5a1d22['conversion']['for']('editingDowncast')['markerToHighlight']({'model':Ta+'remove-context','view':_0x37ce4b=>{const _0x5c413c=this['_markers']['get'](_0x37ce4b['markerName']),_0x385257=['ck-ai_review-marker_underline'];return this['_activeMarkers']['has'](_0x5c413c?.['id']||'')&&_0x385257['push']('ck-ai_review__change_active'),{'classes':_0x385257,'attributes':{'data-marker-id':_0x37ce4b['markerName']}};}}),_0x5a1d22['conversion']['for']('editingDowncast')['markerToHighlight']({'model':Ta+'remove-text','view':_0x40b90d=>{const _0x52ff8f=this['_markers']['get'](_0x40b90d['markerName']),_0x1fb75e=['ck-ai_review-marker_hide'];return this['_activeMarkers']['has'](_0x52ff8f?.['id']||'')&&_0x1fb75e['push']('ck-ai_review__change_active'),{'classes':_0x1fb75e,'attributes':{'data-marker-id':_0x40b90d['markerName']}};}}),_0x5a1d22['conversion']['for']('dataDowncast')['markerToElement']({'model':Ta+'suggestion-context','view':(_0xc24fa2,{writer:_0x22f00f})=>_0x22f00f['createRawElement']('span',{'class':'ck-ai_review-marker_context-'+(_0xc24fa2['isOpening']?'start':'end')})}),_0x5a1d22['conversion']['for']('downcast')['attributeToAttribute']({'model':_0xf976ed,'view':_0x3a52f2}),this['_updateMouseMarkerInteractionListeners'](_0x5a1d22),this['listenTo'](_0x5a1d22,'addRoot',()=>this['_updateMouseMarkerInteractionListeners'](_0x5a1d22),{'priority':'lowest'}),this['listenTo'](_0x5a1d22,'detachRoot',()=>this['_updateMouseMarkerInteractionListeners'](_0x5a1d22),{'priority':'lowest'}),_0x5a1d22['model']['document']['registerPostFixer'](_0x462eb8=>this['_validateMarkers'](_0x5a1d22,_0x462eb8)),_0x5a1d22['model']['document']['on']('change',()=>this['_handleMarkerChanges'](_0x5a1d22)),this['_reviewEditingAttachedEditors']['add'](_0x5a1d22));}['_updateMouseMarkerInteractionListeners'](_0x333f78){let _0x10b8de=this['_boundEditables']['get'](_0x333f78);_0x10b8de||(_0x10b8de=new Map(),this['_boundEditables']['set'](_0x333f78,_0x10b8de));const _0x111558=new Set(_0x333f78['ui']['getEditableElementsNames']());for(const _0x3e0db4 of _0x111558){if(_0x10b8de['has'](_0x3e0db4))continue;const _0x47bb5e=_0x333f78['ui']['getEditableElement'](_0x3e0db4);_0x10b8de['set'](_0x3e0db4,_0x47bb5e),this['_attachMouseMarkerInteractionListeners'](_0x47bb5e);}for(const [_0x2716cb,_0x352a49]of _0x10b8de)_0x111558['has'](_0x2716cb)||(_0x10b8de['delete'](_0x2716cb),this['_domEmitter']['stopListening'](_0x352a49));}['_attachMouseMarkerInteractionListeners'](_0x4d3fc9){this['_domEmitter']['listenTo'](_0x4d3fc9,'mouseup',(_0x49206b,_0x4a4030)=>{const _0x35f66d=_0x4a4030['target'],_0x3bee27=this['_findMarkerElement'](_0x35f66d);if(!_0x3bee27)return;const _0xe5b140=_0x3bee27['getAttribute']('data-marker-id'),_0x475841=_0xe5b140['split'](':')['pop']()?.['split']('_')[0x0];this['_eventEmitter']['fire']('changeMarkerClicked',{'markerId':_0xe5b140,'changeId':_0x475841,'markerElement':()=>this['_findMarkerElementById'](_0xe5b140),'domEvent':_0x4a4030});},{'usePassive':!0x0,'priority':'highest'}),this['_domEmitter']['listenTo'](_0x4d3fc9,'mouseover',(_0x5589af,_0xc3ff02)=>{const _0x49538=_0xc3ff02['target'],_0x472dd3=_0xc3ff02['relatedTarget'];let _0x4c24b0=this['_findMarkerElement'](_0x49538);if(!_0x4c24b0&&_0x472dd3&&(_0x4c24b0=this['_findMarkerElement'](_0x472dd3)),!_0x4c24b0)return;const _0x65d1ad=_0x4c24b0['getAttribute']('data-marker-id'),_0x49165a=_0x65d1ad['split'](':')['pop']()?.['split']('_')[0x0];this['_eventEmitter']['fire']('changeMarkerHovered',{'changeId':_0x49165a,'markerElement':()=>this['_findMarkerElementById'](_0x65d1ad),'domEvent':_0xc3ff02});});}['_registerGlobalBalloonBlurHandler'](){this['_domEmitter']['listenTo'](document,'mouseover',_0x44e40b((_0x25d538,_0x2f8798)=>{const _0x21a78e=_0x2f8798['target'];if(this['_findMarkerElement'](_0x21a78e))return;_0x21a78e['closest']('.ck-reset.ck-ai_review-balloon-panel-suggestion')||this['_eventEmitter']['fire']('changeMarkerBlurred');},0xc8));}['getDocumentData'](){const _0x214da0=this['context']['plugins']['get']('AIEditing'),_0xf6e914=Ws(this['context']);if(!_0xf6e914['length'])throw new at('ai-get-editor-from-context-no-editor',this);const _0x523d12=new Set(),_0xda39be=[],_0x302351=new Map();for(const _0x36c6cb of _0xf6e914)for(const _0x5bc0d7 of _0x36c6cb['model']['document']['getRoots']()){if('$graveyard'===_0x5bc0d7['rootName'])continue;const _0x594368=this['_buildDocumentDataSliceForRoot'](_0x36c6cb,_0x5bc0d7,_0x214da0,_0x523d12);_0xda39be['push'](_0x594368['content']);for(const [_0x3a94a8,_0x31c852]of _0x594368['elements'])_0x302351['set'](_0x3a94a8,_0x31c852);}return{'elements':_0x302351,'content':_0xda39be['join']('')};}['_buildDocumentDataSliceForRoot'](_0x183cb3,_0x5dae5b,_0x5e40be,_0xfe765e){const _0x589213=_0x183cb3['model'],_0xcbddbc=new _0x1fef78();for(const _0x20f814 of _0x5dae5b['getChildren']())_0xcbddbc['_appendChild'](_0x20f814['_clone'](!0x0));for(const _0x37ceff of _0x589213['markers']){const _0x1a7c17=_0x37ceff['getRange']();_0x1a7c17&&_0x1a7c17['root']['rootName']===_0x5dae5b['rootName']&&_0xcbddbc['markers']['set'](_0x37ceff['name'],this['_changeRangeOwnerDocument'](_0x1a7c17['clone'](),_0xcbddbc));}const _0x166c24=new Map(),_0x2b71f6=_0x589213['document']['version'],_0x547ae8=new _0x5130a5({'ignoreElementEnd':!0x0,'startPosition':_0x589213['createPositionAt'](_0xcbddbc,0x0)});for(const {item:_0x19a75a}of _0x547ae8){if(!_0x19a75a['is']('$textProxy'))continue;const _0xd40afe=_0x19a75a['parent'];if(!_0xd40afe||!_0xd40afe['is']('element'))continue;const _0x5094a4=this['_upsertDataId'](_0xd40afe,()=>_0x5e40be['_nextDataId'](_0xfe765e));_0xfe765e['add'](_0x5094a4);for(const _0x1fcd2e of _0xd40afe['getChildren']())_0x1fcd2e['is']('element')&&(_0x1fcd2e['name']&&Ca['includes'](_0x1fcd2e['name'])||_0xfe765e['add'](this['_upsertDataId'](_0x1fcd2e,()=>_0x5e40be['_nextDataId'](_0xfe765e))));let _0x19e933=_0xd40afe;for(;_0x19e933['parent']&&!_0x19e933['parent']['is']('documentFragment');)_0x19e933=_0x19e933['parent'],_0x19e933['hasAttribute'](_0xf976ed)&&_0x19e933['_removeAttribute'](_0xf976ed);_0x166c24['set'](_0x5094a4,{'editor':_0x183cb3,'rootName':_0x5dae5b['rootName'],'path':_0xd40afe['getPath'](),'documentVersion':_0x2b71f6,'getContent':this['_createGetContentUsingDataIdFn'](_0x19e933['_clone'](!0x0),_0x5094a4,_0x183cb3['data'])}),_0x547ae8['jumpTo'](_0x589213['createPositionAfter'](_0xd40afe));}return{'content':_0x183cb3['data']['processor']['toData'](_0x183cb3['data']['toView'](_0xcbddbc)),'elements':_0x166c24};}['diffContent'](_0x1c63b2,_0x85a3b6,_0x3f7da2,_0x53618b=!0x1){const _0x298052=[],_0x5c5373=_0x1c63b2['data']['parse'](_0x3f7da2,'$documentFragment'),_0x1ab40b=_0x1c63b2['data']['parse'](_0x85a3b6,'$documentFragment'),_0xf5d55d=_0x1c63b2['model']['createPositionAt'](_0x1ab40b,0x0);if(this['_haveSingleTopLevelElement'](_0x5c5373)){if(!this['_hasSameTopLevelElement'](_0x1ab40b,_0x5c5373))return _0x298052;}else{const _0x13fba1=_0x1c63b2['model']['schema'];if(!this['_haveOnlyInlineContent'](_0x1ab40b,_0x13fba1)||!this['_haveOnlyInlineContent'](_0x5c5373,_0x13fba1))return _0x298052;}const _0x5850d9=this['context']['plugins']['get']('DocumentCompare')['getDiff'](_0x85a3b6,_0x3f7da2,{'targetEditor':_0x1c63b2,'anchor':_0xf5d55d,'markDeletions':!0x0})['getOperations']()['filter'](_0x189886=>'insert'===_0x189886['type']||'marker'===_0x189886['type']&&_0x189886['name']['startsWith']('$markedRemove')),_0x108514=this['_groupAdjacentOperations'](_0x5850d9),_0x22f7cd=[];if(_0x53618b){if(_0x108514['length']){const _0x12dfeb=_0x108514[0x0]['operations'][0x0],_0x51f225='insert'===_0x12dfeb['type']?_0x12dfeb['position']:_0x12dfeb['newRange']['start'],_0x5f065a=this['_getPositionLimitingRange'](_0x51f225,_0x1c63b2,'inside'),_0x4956b0=_0x5f065a?_0x5c5373['getChild'](0x0)['getChildren']():_0x5c5373['getChildren'](),_0x105a6d=_0x5f065a||_0x1c63b2['model']['createRangeIn'](_0x1ab40b),_0x1322fe=[new _0x46a18c('$markedRemove:synthetic'+ot(),null,_0x105a6d,_0x1c63b2['model']['document']['model']['markers'],!0x0,_0x1c63b2['model']['document']['version']+0x1),new _0x1ceeab(_0x105a6d['end'],_0x4956b0,_0x1c63b2['model']['document']['version']+0x2)];_0x22f7cd['push']({'operations':_0x1322fe,'operationsIsolated':_0x1322fe,'groupOffset':0x0});}}else _0x22f7cd['push'](..._0x108514);let _0xa823fb=0x0;return _0x1c63b2['model']['change'](_0x34dfa2=>{for(let _0x12aef3=0x0;_0x12aef3<_0x22f7cd['length'];_0x12aef3++){const _0x557b64=_0x22f7cd[_0x12aef3],_0x348839=_0x34dfa2['createDocumentFragment']();for(const _0x1b1a6f of _0x1ab40b['getChildren']())_0x34dfa2['append'](_0x1b1a6f['_clone'](!0x0),_0x348839);for(const _0x52b378 of _0x557b64['operationsIsolated'])if('insert'===_0x52b378['type']){const _0x4b6e36=_0x52b378;_0x4b6e36['baseVersion']=null,_0x4b6e36['isDocumentOperation']=!0x1,this['_changeOperationOwnerDocument'](_0x4b6e36,_0x348839),_0x34dfa2['batch']['addOperation'](_0x52b378),_0x1c63b2['model']['applyOperation'](_0x52b378);const _0x584135='suggestion:insertion:id:authorId:'+_0xa823fb++,_0xc3b00b=_0x1c63b2['model']['createRange'](_0x4b6e36['position'],_0x4b6e36['position']['getShiftedBy'](_0x4b6e36['howMany']));_0x348839['markers']['set'](_0x584135,_0xc3b00b);}else{if('marker'===_0x52b378['type']&&_0x52b378['name']['startsWith']('$markedRemove')){const _0xf85be3=_0x52b378,_0x2f8494='suggestion:deletion:id:authorId:'+_0xa823fb++;this['_changeOperationOwnerDocument'](_0xf85be3,_0x348839),_0x348839['markers']['set'](_0x2f8494,_0xf85be3['newRange']);}}if(_0x53618b)_0x298052['push']({..._0x557b64,'context':this['_createGetContentFn'](_0x1ab40b,_0x1c63b2['data']),'content':this['_createGetContentFn'](_0x1ab40b,_0x1c63b2['data'])});else{const _0xce7cec=this['_getChangeContext'](this['_changePositionOwnerDocument'](this['_getOperationStart'](_0x557b64['operationsIsolated'][0x0]),_0x348839),this['_changePositionOwnerDocument'](this['_getOperationEnd'](_0x557b64['operationsIsolated'][_0x557b64['operationsIsolated']['length']-0x1]),_0x348839),_0x1c63b2);_0x348839['markers']['set'](Ta+'suggestion-context',new _0x17fab8(_0xce7cec['start'],_0xce7cec['end'])),_0x298052['push']({..._0x557b64,'context':this['_createGetContextFn'](_0x348839,_0x1c63b2['data'],{'ellipsisBefore':_0xce7cec['hasContentBefore'],'ellipsisAfter':_0xce7cec['hasContentAfter']}),'content':this['_createGetContentFn'](_0x348839,_0x1c63b2['data'])});}}}),_0x298052;}['markChangePositionInEditorContent'](_0x532f1a,_0xbb8a55){if(!_0x532f1a['length'])return;const _0x4acfb7=_0x532f1a[0x0]['parent']['id'],_0x5a2bc1=_0xbb8a55['elements']['get'](_0x4acfb7);if(!_0x5a2bc1)return void console['warn']('No\x20element\x20found\x20for\x20ID:\x20'+_0x4acfb7);const _0x54f0ca=_0x5a2bc1['path'],_0x22fc22=_0x5a2bc1['editor'],_0x551a71=_0x22fc22['model']['document']['getRoot'](_0x5a2bc1['rootName']);if(!_0x551a71)return void console['warn']('No\x20model\x20root\x20found\x20for\x20name:\x20'+_0x5a2bc1['rootName']);const _0x5f139a=_0x22fc22['model']['document']['history']['getOperations'](_0x5a2bc1['documentVersion']),_0x9b3b5f=[];for(const _0xb8913c of _0x532f1a){const _0x39defa=_0xb8913c['operationsIsolated']['map'](_0x380107=>this['_translateOperationToEditorContent'](_0x380107,_0x54f0ca,_0x551a71));if(!_0x39defa||!_0x39defa['length'])continue;const _0x113dae=_0x39defa['every'](_0x38421a=>'marker'===_0x38421a['type']&&_0x38421a['name']['startsWith']('$markedRemove')),_0x1f5e94={'document':_0x22fc22['model']['document'],'useRelations':!0x1,'padWithNoOps':!0x1},_0x2474a1=_0x469e64(_0x39defa,_0x5f139a,_0x1f5e94)['operationsA'];for(const _0x41f00d of _0x2474a1)if('insert'===_0x41f00d['type']){const _0xbdcc2e=_0x41f00d,_0x55d2aa=_0xbdcc2e['nodes'];_0x22fc22['model']['change'](_0x1310ce=>{const _0x19a315=_0x1310ce['createDocumentFragment']();for(const _0x18e7f6 of _0x55d2aa)_0x1310ce['append'](_0x18e7f6['_clone'](!0x0),_0x19a315);_0x9b3b5f['push']({'start':_0xbdcc2e['position'],'end':_0xbdcc2e['position'],'type':'insert','groupId':_0xb8913c['id'],'content':{'asString':this['_createGetContentFn'](_0x19a315,_0x22fc22['data'])(),'asFragment':_0x19a315}});});}else{if('marker'===_0x41f00d['type']&&_0x41f00d['name']['startsWith']('$markedRemove')){const _0x13d956=_0x41f00d;let _0x2e349c='remove-text';if(_0x113dae){const _0x4c9b27=this['_findAdjacentContextDistance'](_0x13d956['newRange']['start'],'backward',_0x22fc22['model']['schema']),_0x2afb34=this['_findAdjacentContextDistance'](_0x13d956['newRange']['end'],'forward',_0x22fc22['model']['schema']);if(_0x4c9b27||_0x2afb34){const _0x1d2bcc=_0x13d956['newRange']['start']['getShiftedBy'](-_0x4c9b27),_0x21b8d2=_0x13d956['newRange']['end']['getShiftedBy'](_0x2afb34);_0x9b3b5f['push']({'start':_0x1d2bcc,'end':_0x21b8d2,'groupId':_0xb8913c['id'],'type':'remove-context'});}else _0x2e349c='remove-only';}_0x9b3b5f['push']({'start':_0x13d956['newRange']['start'],'end':_0x13d956['newRange']['end'],'groupId':_0xb8913c['id'],'type':_0x2e349c});}}}this['_insertMarkers'](_0x9b3b5f,_0x22fc22);}['clearAllMarkers'](){const _0x45df1b=new Map();for(const _0x157b5b of this['_markers']['keys']()){const _0x1d2eb5=this['_markers']['get'](_0x157b5b);_0x1d2eb5?.['editor']&&(_0x45df1b['has'](_0x1d2eb5['editor'])||_0x45df1b['set'](_0x1d2eb5['editor'],[]),_0x45df1b['get'](_0x1d2eb5['editor'])['push'](_0x157b5b));}for(const [_0x209229,_0x2a4c4b]of _0x45df1b)_0x209229['model']['change'](_0x418b91=>{for(const _0xbcf724 of _0x2a4c4b)_0x209229['model']['markers']['get'](_0xbcf724)&&_0x418b91['removeMarker'](_0xbcf724);});this['_markers']['clear'](),this['_activeMarkers']['clear']();}['switchToReadOnly'](){for(const _0x34104e of Ws(this['context']))_0x34104e['enableReadOnlyMode']('ai-review');}['switchToEdit'](){for(const _0x476c99 of Ws(this['context']))_0x476c99['disableReadOnlyMode']('ai-review');}['applyChange'](_0x36f01d){const _0x2ed7b3=_0x36f01d['map'](_0x357230=>this['_getMarkersDataForGroup'](_0x357230))['flat'](),_0x33eaa0=new Map();for(const _0x3cadfd of _0x2ed7b3)_0x33eaa0['has'](_0x3cadfd['editor'])||_0x33eaa0['set'](_0x3cadfd['editor'],[]),_0x33eaa0['get'](_0x3cadfd['editor'])['push'](_0x3cadfd);for(const [_0x5800b3,_0x4d1b4d]of _0x33eaa0){const _0x1eb66c=_0x5800b3['model'];_0x1eb66c['change'](_0x285d9c=>{for(const _0x87d700 of _0x4d1b4d){const _0x136a53=_0x5800b3['model']['markers']['get'](_0x87d700['id']);if(_0x136a53){if('insert'===_0x87d700['type']){if(!_0x87d700['content'])continue;_0x1eb66c['insertContent'](_0x87d700['content']['asFragment']||null,_0x136a53['getRange']()['start']);}else'remove-text'!==_0x87d700['type']&&'remove-only'!==_0x87d700['type']||_0x1eb66c['deleteContent'](_0x1eb66c['createSelection'](_0x136a53['getRange']()));_0x285d9c['removeMarker'](_0x87d700['id']),this['_markers']['delete'](_0x87d700['id']);}}});}}['rejectChange'](_0x21e68d){const _0x5712b9=this['_getMarkersDataForGroup'](_0x21e68d),_0x53f69c=new Map();for(const _0x5b6189 of _0x5712b9)_0x53f69c['has'](_0x5b6189['editor'])||_0x53f69c['set'](_0x5b6189['editor'],[]),_0x53f69c['get'](_0x5b6189['editor'])['push'](_0x5b6189);for(const [_0xe31729,_0x13c4cb]of _0x53f69c)_0xe31729['model']['change'](_0x4b7890=>{for(const _0x371fa7 of _0x13c4cb)_0x4b7890['removeMarker'](_0x371fa7['id']),this['_markers']['delete'](_0x371fa7['id']);});}['getEditor'](){return $s(this['context']);}['getEditors'](){return Ws(this['context']);}['getEditorForChange'](_0xaef3ea){const _0x344023=this['_getMarkersDataForGroup'](_0xaef3ea);return _0x344023[0x0]?.['editor'];}['getMarkerElementForChange'](_0x2519c0){const _0x128ed1=Array['from'](this['_markers']['values']())['filter'](_0x447ccf=>_0x447ccf['groupId']===_0x2519c0);if(!_0x128ed1['length'])return null;const _0x4a03d0=0x1===_0x128ed1['length']?_0x128ed1[0x0]:this['_sortMarkers'](_0x128ed1)[0x0],_0x524f7a=_0x4a03d0['editor']['model']['markers']['get'](_0x4a03d0['id']);if(!_0x524f7a)return null;return{'modelRange':_0x524f7a['getRange'](),'getElement':()=>this['_findMarkerElementById'](_0x4a03d0['id'])};}['getContentElementForChange'](_0x49c4f2){const _0x1c1141=Array['from'](this['_markers']['values']())['filter'](_0x4ba277=>_0x4ba277['groupId']===_0x49c4f2);if(!_0x1c1141['length'])return null;const _0x339620=0x1===_0x1c1141['length']?_0x1c1141[0x0]:this['_sortMarkers'](_0x1c1141)[0x0],_0x439e77=_0x339620['editor'],_0x56a264=_0x439e77['model']['markers']['get'](_0x339620['id']);if(!_0x56a264)return null;const _0x38b1f6=_0x56a264['getRange'](),_0x4719b1=_0x439e77['editing']['view']['getDomRoot'](_0x38b1f6['root']['rootName'])||_0x439e77['editing']['view']['getDomRoot']();if(!_0x4719b1||!_0x38b1f6)return null;let _0x51920f=_0x38b1f6['start']['parent'];for(;_0x51920f['parent']&&'$root'!==_0x51920f['parent']['name'];)_0x51920f=_0x51920f['parent'];if(!_0x51920f||!_0x51920f['name'])return null;const _0x25ae3f=_0x4719b1['querySelector']('[data-marker-id=\x22'+_0x339620['id']+'\x22]');if(!_0x25ae3f)return null;let _0x3d5a5a=null;_0x439e77['model']['change'](_0x5f3a0a=>{_0x3d5a5a=_0x5f3a0a['createDocumentFragment'](),_0x5f3a0a['append'](_0x51920f['_clone'](!0x0),_0x3d5a5a);});const _0xa6cbea=_0x439e77['data']['toView'](_0x3d5a5a)['getChild'](0x0);return _0x25ae3f['closest'](_0xa6cbea['name']);}['reactivateMarkers'](_0x4bb0d8){const _0x361628=this['_getMarkersDataForGroup'](_0x4bb0d8);if(!_0x361628['length'])return;const _0xfb5842=Array['from'](this['_activeMarkers'])['sort'](),_0x11f800=Array['from'](new Set(_0x361628['map'](_0x346d0a=>_0x346d0a['id'])))['sort']();_0xfb5842['join']('|')!==_0x11f800['join']('|')&&(this['setAllMarkersAsInactive'](),this['setMarkersInElementAsActive'](_0x4bb0d8));}['setMarkersInElementAsActive'](_0x513aa4){const _0x5ccbd9=this['_getMarkersDataForGroup'](_0x513aa4);if(!_0x5ccbd9['length'])return;const _0x15e79a=_0x5ccbd9[0x0]['editor'],_0x24d212=new Set(_0x5ccbd9['map'](_0x431453=>_0x431453['id'])),_0x3b1663=Array['from'](_0x24d212['values']())['map'](_0x4d1d18=>_0x15e79a['model']['markers']['get'](_0x4d1d18))['filter'](_0x5b715d=>!!_0x5b715d);_0x24d212['forEach'](_0x58752f=>{this['_activeMarkers']['add'](_0x58752f);}),_0x15e79a['model']['change'](()=>{_0x3b1663['forEach'](_0x122814=>{_0x15e79a['editing']['reconvertMarker'](_0x122814);});});}['setAllMarkersAsInactive'](){const _0x162f93=Array['from'](this['_activeMarkers']);if(!_0x162f93['length'])return;this['_activeMarkers']['clear']();const _0x12947f=new Map();for(const _0x5b997f of _0x162f93){const _0x341034=this['_markers']['get'](_0x5b997f);if(!_0x341034)continue;const _0x19d543=_0x341034['editor'],_0x49931b=_0x19d543['model']['markers']['get'](_0x5b997f);_0x49931b&&(_0x12947f['has'](_0x19d543)||_0x12947f['set'](_0x19d543,[]),_0x12947f['get'](_0x19d543)['push'](_0x49931b));}for(const [_0x48856d,_0xc55f9a]of _0x12947f)_0x48856d['model']['change'](()=>{_0xc55f9a['forEach'](_0x4dc1d4=>{_0x48856d['editing']['reconvertMarker'](_0x4dc1d4);});});}['_getPositionLimitingRange'](_0x25dd03,_0x4ab376,_0x54416a='outside'){if(!_0x25dd03)return null;let _0x2b00eb=_0x25dd03['parent'];for(;_0x2b00eb&&_0x2b00eb['parent']&&'$root'!==_0x2b00eb['parent']['name']&&!_0x4ab376['model']['schema']['isLimit'](_0x2b00eb)&&!_0x4ab376['model']['schema']['isBlock'](_0x2b00eb);)_0x2b00eb=_0x2b00eb['parent'];if(!_0x2b00eb||!_0x2b00eb['name']||'$root'===_0x2b00eb['name'])return null;let _0x1957c9=null;return _0x4ab376['model']['change'](_0x922223=>{_0x1957c9='inside'===_0x54416a?_0x922223['createRangeIn'](_0x2b00eb):_0x922223['createRangeOn'](_0x2b00eb);}),_0x1957c9;}['_validateMarkers'](_0x5165fe,_0xa3d426){const _0x1d411b=Array['from'](this['_markers']['keys']()),_0x99936f=new Map();for(const _0x37d7c4 of _0x1d411b){const _0x38c914=_0x5165fe['model']['markers']['get'](_0x37d7c4);if(!_0x38c914)continue;const _0x44001a=_0x38c914['getStart']()['root']['rootName']+':'+_0x38c914['getStart']()['path'][0x0];_0x99936f['has'](_0x44001a)||_0x99936f['set'](_0x44001a,[]),_0x99936f['get'](_0x44001a)['push'](_0x38c914);}const _0x4355dd=new Set();for(const _0x226595 of _0x5165fe['model']['document']['differ']['getChanges']()){let _0x153aee='',_0x3219a3=null;if('insert'===_0x226595['type'])_0x3219a3=new _0x17fab8(_0x226595['position'],_0x226595['position']['getShiftedBy'](_0x226595['length'])),_0x153aee=_0x226595['position']['root']['rootName']+':'+_0x226595['position']['path'][0x0];else{if('remove'!==_0x226595['type'])continue;_0x3219a3=new _0x17fab8(_0x226595['position']),_0x153aee=_0x226595['position']['root']['rootName']+':'+_0x226595['position']['path'][0x0];}const _0x352825=_0x99936f['get'](_0x153aee)||[];if(_0x352825['length']){for(const _0x11c1d9 of _0x352825)if(_0x3219a3['root']['rootName']===_0x11c1d9['getRange']()['root']['rootName']&&('insert'!==_0x226595['type']||!_0x3219a3['containsRange'](_0x11c1d9['getRange']()))&&(_0x3219a3['isIntersecting'](_0x11c1d9['getRange']())||_0x3219a3['start']['isTouching'](_0x11c1d9['getRange']()['end'])||_0x3219a3['end']['isTouching'](_0x11c1d9['getRange']()['start']))){const _0x2568b7=this['_parseMarkerName'](_0x11c1d9['name']);Array['from'](this['_markers']['values']())['filter'](_0x491b7c=>_0x491b7c['groupId']===_0x2568b7['groupId'])['forEach'](_0x440525=>_0x4355dd['add'](_0x440525['id']));}}}if(_0x4355dd['size']){for(const _0x5ada99 of _0x4355dd)_0xa3d426['removeMarker'](_0x5ada99);return!0x0;}return!0x1;}['_handleMarkerChanges'](_0x200e93){for(const {name:_0x7288ea,data:_0x2576c0}of _0x200e93['model']['document']['differ']['getChangedMarkers']()){if(!_0x7288ea['startsWith'](Ta))continue;const _0x33a240=_0x2576c0['oldRange'],_0x2cc872=_0x2576c0['newRange'],_0x20c745=_0x33a240&&'$graveyard'===_0x33a240['root']['rootName'],_0x121643=_0x2cc872&&'$graveyard'===_0x2cc872['root']['rootName'];if(_0x20c745&&_0x121643)continue;const _0x52d626=this['_parseMarkerName'](_0x7288ea);this['_markers']['get'](_0x7288ea)&&(_0x121643||!_0x2cc872?this['_eventEmitter']['fire']('changeMarkerRemoved',{'markerId':_0x7288ea,'changeId':_0x52d626['groupId']}):_0x20c745&&_0x2cc872&&this['_eventEmitter']['fire']('changeMarkerRestored',{'markerId':_0x7288ea,'changeId':_0x52d626['groupId']}));}}['_parseMarkerName'](_0x26ff5d){const _0x5c3978=_0x26ff5d['split'](':'),_0x3c3aad=(_0x5c3978[0x1]||'')['split']('_');return{'prefix':_0x5c3978[0x0],'groupId':_0x3c3aad[0x0],'suffix':_0x3c3aad[0x1]};}['_translateOperationToEditorContent'](_0xfdd541,_0x1cdf9e,_0x59e3d2){if('insert'===_0xfdd541['type']){const _0xb3e8c5=_0xfdd541;return new _0x1ceeab(this['_changePosition'](_0x1cdf9e['concat'](_0xb3e8c5['position']['offset']),_0x59e3d2),_0xb3e8c5['nodes'],_0xb3e8c5['baseVersion']);}if('marker'===_0xfdd541['type']&&_0xfdd541['name']['startsWith']('$markedRemove')){const _0x34705a=_0xfdd541;return new _0x46a18c(_0x34705a['name'],_0x34705a['oldRange'],this['_changeRange'](_0x34705a['newRange'],_0x1cdf9e['concat'](_0x34705a['newRange']['start']['offset']),_0x1cdf9e['concat'](_0x34705a['newRange']['end']['offset']),_0x59e3d2),_0x34705a['_markers'],_0x34705a['affectsData'],_0x34705a['baseVersion']);}return _0xfdd541;}['_groupAdjacentOperations'](_0x2178de){if(!_0x2178de['length'])return[];const _0x58dbf1=[];let _0x3c3a71=0x0,_0x1a1bdc=0x0,_0x44964f=[];for(let _0x5b2780=0x0;_0x5b2780<=_0x2178de['length'];_0x5b2780++){const _0x3fcda2=_0x2178de[_0x5b2780],_0xd0fa20=_0x2178de[_0x5b2780-0x1];!_0x3fcda2||_0xd0fa20&&!this['_getOperationEnd'](_0xd0fa20)['isTouching'](this['_getOperationStart'](_0x3fcda2))?(_0x58dbf1['push']({'operations':_0x44964f,'operationsIsolated':_0x44964f['map'](_0x48b2c9=>this['_shiftOperation'](_0x48b2c9['clone'](),-_0x1a1bdc)),'groupOffset':_0x3c3a71}),_0x44964f=_0x3fcda2?[_0x3fcda2]:[],_0x1a1bdc+=_0x3c3a71,_0x3c3a71=0x0):_0x44964f['push'](_0x3fcda2),_0x3fcda2&&'insert'===_0x3fcda2['type']&&(_0x3c3a71+=_0x3fcda2['howMany']);}return _0x58dbf1;}['_findAdjacentContextDistance'](_0x537ec2,_0x2741d6,_0x42a6e9,_0x2dfcaa=0x1){const _0x407eb6=new _0x5130a5({'startPosition':_0x537ec2,'direction':_0x2741d6});let _0x45c390=0x0;for(let _0x5e72df=0x0;_0x5e72df<_0x2dfcaa;_0x5e72df++){let _0x41d6d8=0x0,_0x1ad402=!0x1,_0x46cbb7='forward'===_0x2741d6?/^\W*\w+/:/\w+\W*$/;for(const {item:_0x3be237}of _0x407eb6)if(_0x3be237['is']('$textProxy')){const _0x61f72d=_0x46cbb7['exec'](_0x3be237['data']);if(_0x61f72d&&_0x61f72d['length']){if(_0x41d6d8+='forward'===_0x2741d6?_0x61f72d['index']+_0x61f72d[0x0]['length']:_0x3be237['data']['length']-_0x61f72d['index'],_0x61f72d[0x0]['length']!==_0x3be237['data']['length'])break;_0x1ad402=!0x0,_0x46cbb7='forward'===_0x2741d6?/^\w+/:/\w+$/;}else{if(_0x1ad402)break;_0x41d6d8+=_0x3be237['offsetSize'];}}else{if(_0x3be237['is']('element')){_0x42a6e9['isInline'](_0x3be237)&&!_0x1ad402&&(_0x41d6d8+=0x1);break;}}_0x45c390+=_0x41d6d8,_0x407eb6['jumpTo'](_0x537ec2['getShiftedBy']('forward'===_0x2741d6?_0x45c390:-_0x45c390));}return _0x45c390;}['_getChangeContext'](_0x195313,_0x25434c,_0x28469e){const _0x222111=_0x28469e['model']['schema'],_0x5c2533=this['_findAdjacentContextDistance'](_0x195313,'backward',_0x222111,0x6),_0x452d46=this['_findAdjacentContextDistance'](_0x25434c,'forward',_0x222111,0x6),_0x121d7a=_0x195313['getShiftedBy'](-_0x5c2533),_0x25c823=_0x25434c['getShiftedBy'](_0x452d46);return{'start':_0x121d7a,'end':_0x25c823,'hasContentBefore':!_0x121d7a['isAtStart'],'hasContentAfter':!_0x25c823['isAtEnd']};}['_insertMarkers'](_0x3fea93,_0x1056e0){const _0x5843b6=this['context']['plugins']['get']('AIEditing'),_0x436f4b=new Set();_0x1056e0['model']['change'](_0x8c037f=>{for(const _0xda3672 of _0x3fea93){const _0x30a7fe=''+Ta+_0xda3672['type']+':'+_0xda3672['groupId']+'_'+_0x5843b6['_nextDataId'](_0x436f4b);this['_markers']['set'](_0x30a7fe,{'id':_0x30a7fe,'groupId':_0xda3672['groupId'],'type':_0xda3672['type'],'content':_0xda3672['content'],'editor':_0x1056e0}),_0x8c037f['addMarker'](_0x30a7fe,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x8c037f['createRange'](_0xda3672['start'],_0xda3672['end'])});}});}['_createGetContextFn'](_0x127e74,_0x6a0445,_0x8bc31a){let _0x49be4b='';return()=>{if(!_0x49be4b){const _0x4b7272=_0x6a0445['toView'](_0x127e74,{'showSuggestionHighlights':!0x0});let _0x3707af=_0x4b7272['getChild'](0x0);if(_0x3707af['is']('containerElement')||(_0x3707af=_0x4b7272),!_0x3707af)return'';let _0x2a4c87=!0x1;const _0xcd02e9=[];for(const _0x324aed of _0x3707af['getChildren']())_0x324aed['is']('element','span')&&_0x324aed['hasClass']('ck-ai_review-marker_context-end')&&(_0x2a4c87=!0x1),_0x2a4c87&&_0xcd02e9['push'](_0x324aed),_0x324aed['is']('element','span')&&_0x324aed['hasClass']('ck-ai_review-marker_context-start')&&(_0x2a4c87=!0x0);_0x3707af['_removeChildren'](0x0,_0x3707af['childCount']),_0x8bc31a?.['ellipsisBefore']&&_0x3707af['_appendChild']('…'),_0x3707af['_appendChild'](_0xcd02e9),_0x8bc31a?.['ellipsisAfter']&&_0x3707af['_appendChild']('…');const _0x148c2e=_0x6a0445['htmlProcessor']['domConverter']['viewToDom'](_0x4b7272),_0x4b3a40=_0x6a0445['htmlProcessor']['htmlWriter']['getHtml'](_0x148c2e);_0x49be4b=_0x4b3a40;}return _0x49be4b;};}['_createGetContentFn'](_0xd95270,_0x5da12a){let _0x571d6e='';return()=>(_0x571d6e||(_0x571d6e=_0x5da12a['stringify'](_0xd95270,{'showSuggestionHighlights':!0x0})),_0x571d6e);}['_createGetContentUsingDataIdFn'](_0x3b2bf3,_0x3d2b37,_0xe6ba37){let _0x16d67a='';return()=>{if(!_0x16d67a){const _0x4e77ec=_0xe6ba37['toView'](new _0x1fef78(_0x3b2bf3)),_0x434913=_0xe6ba37['htmlProcessor']['domConverter']['viewToDom'](_0x4e77ec)['querySelector']('[data-id=\x22'+_0x3d2b37+'\x22]');_0x16d67a=_0x434913?.['outerHTML']||'';}return _0x16d67a;};}['_findMarkerElement'](_0x19928a,_0x4ddf87=0x5){let _0x51012a=_0x19928a,_0x1d9f8e=null;for(let _0x588e75=0x0;_0x588e75<_0x4ddf87&&_0x51012a;_0x588e75++){if(!_0x51012a['className']){_0x51012a=_0x51012a['parentElement'];continue;}if(!(''+_0x51012a['className'])['includes']('ck-ai_review-marker_')){_0x51012a=_0x51012a['parentElement'];continue;}if(!_0x51012a['getAttribute']('data-marker-id'))break;_0x1d9f8e=_0x51012a;break;}return _0x1d9f8e;}['_findMarkerElementById'](_0x554021){const _0xcf7f48=this['_markers']['get'](_0x554021),_0x1b4643=_0xcf7f48?.['editor']??$s(this['context']),_0x483b84=_0x1b4643['model']['markers']['get'](_0x554021);return _0x483b84?_0x2b3bd5(_0x1b4643['editing'],_0x483b84):null;}['_getMarkersDataForGroup'](_0x2d5c00){return Array['from'](this['_markers']['values']())['filter'](_0x33b83b=>_0x33b83b['groupId']===_0x2d5c00);}['_getOperationStart'](_0x2873e7){return'insert'===_0x2873e7['type']?_0x2873e7['position']:_0x2873e7['newRange']['start'];}['_getOperationEnd'](_0x4f38e1,_0x315586=!0x1){return'insert'===_0x4f38e1['type']?_0x315586?_0x4f38e1['position']:_0x4f38e1['position']['getShiftedBy'](_0x4f38e1['howMany']):_0x4f38e1['newRange']['end'];}['_shiftOperation'](_0x343bc6,_0x4d6084){return'insert'===_0x343bc6['type']?_0x343bc6['position']=_0x343bc6['position']['getShiftedBy'](_0x4d6084):'marker'===_0x343bc6['type']&&_0x343bc6['newRange']&&(_0x343bc6['newRange']=new _0x17fab8(_0x343bc6['newRange']['start']['getShiftedBy'](_0x4d6084),_0x343bc6['newRange']['end']['getShiftedBy'](_0x4d6084))),_0x343bc6;}['_changeOperationOwnerDocument'](_0xf87789,_0x1011f0){'insert'===_0xf87789['type']?_0xf87789['position']=this['_changePositionOwnerDocument'](_0xf87789['position'],_0x1011f0):'marker'===_0xf87789['type']&&_0xf87789['newRange']&&(_0xf87789['newRange']=this['_changeRangeOwnerDocument'](_0xf87789['newRange'],_0x1011f0));}['_changePositionOwnerDocument'](_0x1c2353,_0x34af9d){return new _0x4de1b4(_0x34af9d,_0x1c2353['path']);}['_changeRangeOwnerDocument'](_0x207db9,_0x3360ed){return new _0x17fab8(this['_changePositionOwnerDocument'](_0x207db9['start'],_0x3360ed),this['_changePositionOwnerDocument'](_0x207db9['end'],_0x3360ed));}['_changePosition'](_0x5876f6,_0x12eb24){return new _0x4de1b4(_0x12eb24,[..._0x5876f6]);}['_changeRange'](_0x34f7c8,_0x50afde,_0x448b45,_0x1c05c2){return new _0x17fab8(this['_changePosition'](_0x50afde,_0x1c05c2),this['_changePosition'](_0x448b45,_0x1c05c2));}['_sortMarkers'](_0xebd0bb){const _0x3959e9=_0x2ff100=>{switch(_0x2ff100){case'insert':return 0x0;case'remove-context':return 0x1;case'remove-only':return 0x2;case'remove-text':return 0x3;}};return _0xebd0bb['sort']((_0x5638f4,_0x454625)=>_0x3959e9(_0x5638f4['type'])-_0x3959e9(_0x454625['type']));}['_hasSameTopLevelElement'](_0x45d564,_0x104700){const _0x2f94ad=_0x45d564['getChild'](0x0),_0x5c26ef=_0x104700['getChild'](0x0);return!(!_0x2f94ad||!_0x5c26ef)&&((!_0x2f94ad['is']('element')||!_0x5c26ef['is']('element')||_0x2f94ad['name']===_0x5c26ef['name'])&&!(_0x2f94ad['is']('element')&&!_0x5c26ef['is']('element')||!_0x2f94ad['is']('element')&&_0x5c26ef['is']('element')));}['_haveSingleTopLevelElement'](_0x811e0a){return 0x1===_0x811e0a['childCount'];}['_haveOnlyInlineContent'](_0x354cf8,_0x26fb0f){for(const _0x769bb7 of _0x354cf8['getChildren']())if(_0x769bb7['is']('element')&&!_0x26fb0f['isInline'](_0x769bb7))return!0x1;return!0x0;}['_upsertDataId'](_0x3ab005,_0x3fda6f){let _0x27323c=_0x3ab005['getAttribute'](_0xf976ed);return _0x27323c||(_0x27323c=_0x3fda6f(),_0x3ab005['_setAttribute'](_0xf976ed,_0x27323c)),_0x27323c;}}class fa extends Tt(){['id'];['contentNew'];['contentInitial'];['documentVersion'];constructor({id:_0x4ff1bc,contentNew:_0x1e4a07,contentInitial:_0x1d3034,documentVersion:_0x426680}){super(),this['id']=_0x4ff1bc,this['contentNew']=_0x1e4a07,this['contentInitial']=_0x1d3034,this['documentVersion']=_0x426680;}}class ba extends ht(){['id'];['parent'];['_data'];['_editorOperations']=[];constructor(_0x5962f4,_0xb7ee3,_0x316f51){super(),this['id']=_0x5962f4,this['parent']=_0x316f51,this['_data']=_0xb7ee3,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(_0x3e537d,_0x1d994d,_0x399b3b,_0x2b9226,_0x55aa47){super(),this['_sourceCheck']=_0x1d994d,this['_documentData']=_0x3e537d,this['_aiConnector']=_0x399b3b,this['_reviewParams']=_0x2b9226,this['_reviewArgs']=_0x55aa47,this['on']('change:status',(_0x3343c1,_0x8770d1,_0x5cd7db)=>{'aborted'==_0x5cd7db&&(this['_wasAborted']=!0x0),this['fire']('reviewCheckRunUpdated',{'status':_0x5cd7db,'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'](_0x18a5e1=>'pending'===_0x18a5e1['status']);}get['currentError'](){return this['_currentError'];}['updateDocumentData'](_0x3b3756){this['_documentData']=_0x3b3756;}async['start'](){this['status']='loading',this['_currentError']=void 0x0;try{this['_activeRequest']=this['_createApiRequest']();const _0x3999a1=await this['_activeRequest']['getStream']();this['status']='data';for await(const _0x1c6a72 of _0x3999a1)'unmodified'!==_0x1c6a72['data']['operation']&&('error'!==_0x1c6a72['data']['operation']?'review-metadata'!==_0x1c6a72['event']?this['_addReviewCheckResult'](_0x1c6a72['data']['dataId'],_0x1c6a72['data']['textDelta']):this['callId']=_0x1c6a72['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(_0x1df7d0){this['_currentError']=_0x1df7d0,_0x1df7d0 instanceof Error&&_0x1df7d0['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'](_0x16f393,_0x3afb73){const _0x1a7e3=this['_results']['get'](_0x16f393);if(!_0x1a7e3)return;if(0x0===_0x3afb73['length'])return;const _0x25457b=[];_0x3afb73['forEach']((_0x2c2272,_0x240d44)=>{const _0x4e68d7=new ba(_0x1a7e3['id']+'-'+_0x240d44,_0x2c2272,_0x1a7e3);_0x4e68d7['on']('change:status',()=>{this['fire']('reviewCheckResultChangeStatusUpdated',{'change':_0x4e68d7,'status':_0x4e68d7['status']});}),_0x4e68d7['on']('change:isActivated',()=>{_0x4e68d7['isActivated']?this['fire']('reviewCheckResultActivated',{'change':_0x4e68d7}):this['fire']('reviewCheckResultDeactivated',{'change':_0x4e68d7});}),this['_changes']['push'](_0x4e68d7),_0x25457b['push'](_0x4e68d7);}),this['fire']('reviewCheckResultReady',{'changes':_0x25457b,'result':_0x1a7e3,'source':this});}['abort'](){this['_activeRequest']&&(this['_activeRequest']['abortController']['abort'](),this['_activeRequest']=null,this['status']='aborted');}['isChangeActive'](_0x4a3c65){const _0x313f69=this['_changes']['find'](_0x502af8=>_0x502af8['id']===_0x4a3c65);return!(!_0x313f69||'pending'!==_0x313f69['status']);}['isAnyChangeActivated'](){return this['_changes']['some'](_0x4a1a3d=>!0x0===_0x4a1a3d['isActivated']);}['getActiveChanges'](){return this['_changes']['filter'](_0x23cfda=>'pending'===_0x23cfda['status']);}['getChangeById'](_0x42762f){return this['_changes']['find'](_0x7d2174=>_0x7d2174['id']===_0x42762f);}['markAllChangesAsAccepted'](){for(const _0x254a89 of this['_changes'])'pending'===_0x254a89['status']&&(_0x254a89['status']='accepted');this['_checkIfFinished']();}['markChangeAsAccepted'](_0x495aae){const _0x1a93c7=this['_changes']['find'](_0x3ee0d4=>_0x3ee0d4['id']===_0x495aae);_0x1a93c7&&'pending'===_0x1a93c7['status']&&(_0x1a93c7['status']='accepted'),this['_checkIfFinished']();}['markChangeAsRejected'](_0x1f473b){const _0x489b65=this['_changes']['find'](_0x94e78d=>_0x94e78d['id']===_0x1f473b);_0x489b65&&'pending'===_0x489b65['status']&&(_0x489b65['status']='rejected'),this['_checkIfFinished']();}['markChangeAsOutdated'](_0x4210b6){const _0x4c87da=this['_changes']['find'](_0x5d8cc9=>_0x5d8cc9['id']===_0x4210b6);_0x4c87da&&'pending'===_0x4c87da['status']&&(_0x4c87da['status']='outdated'),this['_checkIfFinished']();}['markChangeAsPending'](_0x1ae31e){const _0x4bd5be=this['_changes']['find'](_0x15ce07=>_0x15ce07['id']===_0x1ae31e);_0x4bd5be&&'outdated'===_0x4bd5be['status']&&(_0x4bd5be['status']='pending'),this['_checkIfFinished']();}['activateChange'](_0xbbc004){this['_changes']['filter'](_0x41ac2b=>_0x41ac2b['isActivated']&&_0x41ac2b['id']!==_0xbbc004)['forEach'](_0x3928c2=>{_0x3928c2['isActivated']=!0x1;});const _0x62661e=this['_changes']['find'](_0x28edd1=>_0x28edd1['id']===_0xbbc004);_0x62661e&&'pending'===_0x62661e['status']&&(_0x62661e['isActivated']=!0x0);}['deactivateChange'](){this['_changes']['filter'](_0x2996a2=>_0x2996a2['isActivated'])['forEach'](_0x522fbf=>{_0x522fbf['isActivated']=!0x1;});}['forceReadyState'](){this['status']='ready';}async['sendRating'](_0x58e5bf){if('initialized'===this['status']||'loading'===this['status']||'data'===this['status']||this['_wasAborted'])return;if(!this['callId']||0x0===this['_changes']['length'])return;let _0x393f51;if(_0x58e5bf){const _0x434757=this['_changes']['find'](_0x5e3bb5=>_0x5e3bb5['id']===_0x58e5bf);if(_0x434757&&_0x434757['isRated'])return;_0x434757&&(_0x393f51=_0x434757['parent']['id'],_0x434757['isRated']=!0x0);}const _0x28e786={'positiveCount':this['_changes']['filter'](_0xf3d4c5=>'accepted'===_0xf3d4c5['status'])['length'],'totalCount':this['_changes']['length']};this['_sendRatingRequest'](_0x28e786,this['callId'],_0x393f51);}['_addReviewCheckResult'](_0x3eaef4,_0x3933e2){const _0x5c9241=this['_documentData']['elements']['get'](_0x3eaef4);if(!_0x5c9241)return;const _0x19a24a=_0x5c9241['getContent']();if(_0x19a24a===_0x3933e2)return;const _0x1c8963=new fa({'id':_0x3eaef4,'contentInitial':_0x19a24a,'contentNew':_0x3933e2,'documentVersion':_0x5c9241['documentVersion']});this['_results']['set'](_0x1c8963['id'],_0x1c8963),this['fire']('reviewCheckResultAdded',{'result':_0x1c8963,'source':this,'editor':_0x5c9241['editor']});}['_checkIfFinished'](){'finished'===this['status']&&(this['_changes']['filter'](_0x16fa89=>'pending'===_0x16fa89['status'])['length']>0x0&&(this['status']='ready')),'ready'===this['status']&&(0x0===this['_changes']['filter'](_0x13816d=>'pending'===_0x13816d['status'])['length']&&(this['status']='finished'));}}class Ra extends Sa{get['subTitle'](){if(!this['_reviewParams']||0x0===this['_reviewParams']['length'])return'';const _0xb29018=[];if(this['_reviewParams']['length']>0x0&&this['_sourceCheck']['options'])for(let _0x38fd90=0x0;_0x38fd90<this['_reviewParams']['length'];_0x38fd90++){if(!this['_reviewParams'][_0x38fd90]||!this['_sourceCheck']['options'][_0x38fd90])continue;const _0x241834=this['_sourceCheck']['options'][_0x38fd90],_0x5afe18=_0x241834['data']?.['find'](_0x100f9f=>_0x100f9f['id']===this['_reviewParams'][_0x38fd90]);_0x5afe18&&_0xb29018['push'](_0x5afe18['label']);}return _0xb29018['join'](',\x20');}get['reviewName'](){return this['_composeReviewName']();}['_createApiRequest'](){return this['_aiConnector']['callSystemReview']({'reviewName':this['_composeReviewName'](),'content':this['_documentData']['content'],'args':this['_reviewArgs']});}['_sendRatingRequest'](_0x4407e0,_0x5e26b3,_0xc7de99){return this['_aiConnector']['upsertAIReviewRating'](this['reviewName'],_0x5e26b3,_0x4407e0,_0xc7de99);}['_composeReviewName'](){return!this['_reviewParams']||0x0===this['_reviewParams']['length']||this['_sourceCheck']['useArgs']?this['_sourceCheck']['apiId']:[this['_sourceCheck']['apiId'],...this['_reviewParams']]['join']('-');}}class Oa extends _0x1c4dd1{['_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(_0x444a7f,_0x3dee49)=>{const _0x137f5e=this['_aiReviewCheckList']['getCheckById'](_0x3dee49['id']);if(_0x137f5e){this['_onReviewCheckRun'](_0x3dee49),this['_aiReviewCoreEditing']['switchToReadOnly'](),this['_currentReviewCheckRun']=this['_createReviewCheckRun'](_0x3dee49,_0x137f5e),this['_aiReviewCoreUi']['setCheckResultTitle'](this['_currentReviewCheckRun']['title'],this['_currentReviewCheckRun']['subTitle']),this['_currentReviewCheckRun']['on']('reviewCheckRunUpdated',(_0x49947c,_0x5f1be2)=>{switch(_0x5f1be2['status']){case'data':case'loading':this['_aiReviewCoreUi']['showCheckRunResults'](_0x5f1be2);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'!==_0x5f1be2['status']&&'error-chunk'!==_0x5f1be2['status']&&'error-general'!==_0x5f1be2['status']||this['_currentReviewCheckRun']?.['sendRating']();}),this['_currentReviewCheckRun']['on']('reviewCheckResultAdded',(_0x2d6090,_0x263c21)=>{if(!this['_currentReviewCheckRun'])throw new at('ai-review-mode-no-current-check-run',this);const _0x43d581=this['_diffContent'](_0x263c21['editor'],_0x263c21['result']['contentInitial'],_0x263c21['result']['contentNew']);_0x263c21['source']['addResultChanges'](_0x263c21['result']['id'],_0x43d581);}),this['_currentReviewCheckRun']['on']('reviewCheckResultReady',(_0x3a62e8,_0x11d180)=>{for(const _0x475467 of _0x11d180['changes'])this['_aiReviewCoreUi']['showCheckRunResult'](_0x475467);this['_markChangePositionInEditorContent'](_0x11d180['changes'],_0x11d180['source']['documentData']);}),this['_currentReviewCheckRun']['on']('reviewCheckResultChangeStatusUpdated',(_0x3be7c4,_0x342860)=>{this['_aiReviewCoreUi']['updateChangeState'](_0x342860['change']['id'],_0x342860['status']);}),this['_currentReviewCheckRun']['on']('reviewCheckResultActivated',(_0x13f0de,_0x3a199f)=>{this['_onReviewCheckResultActivated'](_0x3a199f);}),this['_currentReviewCheckRun']['on']('reviewCheckResultDeactivated',()=>{this['_onReviewCheckResultDeactivated']();});try{await this['_currentReviewCheckRun']['start']();}catch(_0x57f25f){_0x57f25f instanceof Error&&_0x57f25f['message']['includes']('ai-request-aborted')||(_0x57f25f instanceof at?this['_logError'](_0x57f25f):this['_logError'](new at('ai-review-mode-check-run-failed',this,void 0x0,_0x57f25f)));}}else this['_logError'](new at('ai-review-mode-source-check-not-found',this,{'checkId':_0x3dee49['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 _0x2c506b=this['_currentReviewCheckRun']['getActiveChanges']();if(!_0x2c506b['length'])return;this['_aiReviewCoreEditing']['applyChange'](_0x2c506b['map'](_0x1bc82d=>_0x1bc82d['id']));const _0x4033ba=this['_currentReviewCheckRun'];_0x4033ba['markAllChangesAsAccepted'](),_0x4033ba['sendRating']();}),this['listenTo'](this['_aiReviewCoreUi'],'acceptChange',(_0x3a9e64,_0xe3b67)=>{this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['isChangeActive'](_0xe3b67['id'])&&(this['_aiReviewCoreEditing']['applyChange']([_0xe3b67['id']]),this['_currentReviewCheckRun']['markChangeAsAccepted'](_0xe3b67['id']),this['_aiReviewCoreUi']['hideChangeBalloon'](),this['_currentReviewCheckRun']['sendRating'](_0xe3b67['id']));}),this['listenTo'](this['_aiReviewCoreUi'],'dismissChange',(_0x5e7244,_0x183f79)=>{this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['isChangeActive'](_0x183f79['id'])&&(this['_aiReviewCoreEditing']['rejectChange'](_0x183f79['id']),this['_currentReviewCheckRun']['markChangeAsRejected'](_0x183f79['id']),this['_aiReviewCoreUi']['hideChangeBalloon'](),this['_currentReviewCheckRun']['sendRating'](_0x183f79['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',(_0x66a5b,_0x125ace)=>{this['_onActivateChange'](_0x125ace);}),this['listenTo'](this['_aiReviewCoreUi'],'deactivateChange',(_0x203ffa,_0x75620e)=>{this['_onDeactivateChange'](_0x75620e);}),this['listenTo'](this['_aiReviewCoreEditing']['emitter'],'changeMarkerClicked',(_0x58f4d3,_0x42fdf9)=>{this['_onChangeMarkerClicked'](_0x58f4d3,_0x42fdf9);}),this['listenTo'](this['_aiReviewCoreEditing']['emitter'],'changeMarkerHovered',(_0x591e1f,_0x3d1fdb)=>{this['_onChangeMarkerHovered'](_0x591e1f,_0x3d1fdb);}),this['listenTo'](this['_aiReviewCoreEditing']['emitter'],'changeMarkerBlurred',()=>{this['_onChangeMarkerBlurred']();}),this['listenTo'](this['_aiReviewCoreEditing']['emitter'],'changeMarkerRemoved',(_0x1ad11b,_0x1a7be6)=>{this['_onChangeMarkerRemoved'](_0x1ad11b,_0x1a7be6);}),this['listenTo'](this['_aiReviewCoreEditing']['emitter'],'changeMarkerRestored',(_0x39fa62,_0x10c484)=>{this['_onChangeMarkerRestored'](_0x39fa62,_0x10c484);});}['_createReviewCheckRun'](_0x3e51e8,_0x57bd13){return new Ra(this['_aiReviewCoreEditing']['getDocumentData'](),_0x57bd13,this['_aiConnector'],_0x3e51e8['params'],_0x3e51e8['args']);}['_onChangeMarkerRemoved'](_0xa5885b,_0x55a249){this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['markChangeAsOutdated'](_0x55a249['changeId']);}['_onChangeMarkerRestored'](_0x608aa6,_0x3ed557){this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['markChangeAsPending'](_0x3ed557['changeId']);}['_onCheckRunFinished'](){this['_aiReviewCoreUi']['showReviewCompletedView']();}['_initRequiredPlugins'](){this['_aiConnector']=this['context']['plugins']['get']('AIConnector');}['_onReviewRunLeave'](_0x255edb=!0x1){this['_currentReviewCheckRun']&&(this['_currentReviewCheckRun']['hasModifications']||this['_currentReviewCheckRun']['sendRating'](),this['_currentReviewCheckRun']['stopListening'](),this['_currentReviewCheckRun']['abort'](),this['_currentReviewCheckRun']=void 0x0),_0x255edb&&this['_aiReviewCoreUi']['showReviewCheckList'](),this['_aiReviewCoreEditing']['clearAllMarkers'](),this['_aiReviewCoreEditing']['switchToEdit'](),this['_changeActivationSource']=null;for(const _0x4e00a0 of this['_aiReviewCoreEditing']['getEditors']())_0x4e00a0['editing']['view']['change'](_0x1a7b13=>{for(const _0x25c99b of _0x4e00a0['editing']['view']['document']['getRoots']())_0x1a7b13['removeClass']('ck-ai_review-diff',_0x25c99b),_0x1a7b13['removeClass']('ck-ai_review-highlights',_0x25c99b),_0x1a7b13['removeClass']('ck-ai-translate-mode-content',_0x25c99b);});}['_getTranslationWithDefault'](_0xd2fc03,_0x3c369e){const _0x24b71e=hs(this['context']['locale'],_0xd2fc03);return _0x24b71e===_0xd2fc03?_0x3c369e:_0x24b71e;}['_logError'](_0x240580,_0x14c9a6=!0x1){Et(_0x240580['message']),_0x14c9a6||(_0x240580['message']['startsWith']('ai-review-mode-models-unable-to-retrieve')?this['_aiReviewCoreUi']['showGeneralReviewCoreErrorView']():this['_aiReviewCoreUi']['showGeneralResultsErrorView']());}['_scrollToChange'](_0x95d5b1){if('content'===this['_changeActivationSource']){const _0xaa09cb=this['_aiReviewCoreUi']['getChangeElement'](_0x95d5b1);_0xaa09cb&&ft(_0xaa09cb['closest']('.ck-ai_review__check-run-result')||_0xaa09cb);}else{if('panel'===this['_changeActivationSource']){const _0x56731c=this['_getChangeContentElement'](_0x95d5b1);if(!_0x56731c)return;Ct({'target':_0x56731c,'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(_0x166dd3){this['id']=_0x166dd3['id'],this['commandId']=_0x166dd3['commandId'],this['title']=_0x166dd3['title'],this['description']=_0x166dd3['description'],this['isParameterized']=_0x166dd3['isParameterized'],this['useArgs']=_0x166dd3['useArgs'],this['options']=_0x166dd3['options'],this['args']=_0x166dd3['args'];}}class va extends ht(){['_checks']=[];['setupChecks'](_0x586873){this['_checks']=_0x586873['map'](_0x21cdb4=>new Na(_0x21cdb4));}get['checks'](){return this['_checks'];}['getCheckById'](_0x2923b3){return this['checks']['find'](_0xa01e2d=>_0xa01e2d['id']===_0x2923b3);}['removeCheckById'](_0x1227cd){this['_checks']=this['_checks']['filter'](_0x56cef1=>_0x56cef1['id']!==_0x1227cd);}}class ya extends Na{['_models']=[];['_defaultModel']=null;constructor(_0x37f957,_0x113c9c,_0xcf944e){super(_0x37f957),this['_models']=_0x113c9c,this['_defaultModel']=_0xcf944e;}get['models'](){return this['_models'];}get['defaultModel'](){return this['_defaultModel'];}}class xa extends Na{['isExtra']=!0x0;['prompt'];['model'];['_defaultModel']=null;constructor(_0x10ea56,_0x45e709,_0x221b16){super(_0x10ea56),this['prompt']=_0x10ea56['prompt'],this['model']=_0x10ea56['model'],this['model']?this['_defaultModel']=_0x45e709['find'](_0x12cb62=>_0x12cb62['id']===this['model'])||null:this['_defaultModel']=_0x221b16;}get['defaultModel'](){return this['_defaultModel'];}}class La extends va{['_allModels']=[];['_recommendedModels']=[];['_defaultModel']=null;constructor(_0x1ad16f,_0x2b084c,_0x7abf78){super(),this['_allModels']=_0x1ad16f,this['_recommendedModels']=_0x2b084c,this['_defaultModel']=_0x7abf78;}['setupChecks'](_0x5b1c67){this['_checks']=_0x5b1c67['map'](_0x59109d=>!0x0===_0x59109d['isExtra']?new xa(_0x59109d,this['_allModels'],this['_defaultModel']):'custom'===_0x59109d['id']?new ya(_0x59109d,this['_recommendedModels'],this['_defaultModel']):new Na(_0x59109d));}}class Da extends Sa{['_prompt'];['_model'];constructor(_0x14f540,_0x1378f0,_0x2edcbd,_0x43abbe,_0x4fb868){super(_0x2edcbd,_0x43abbe,_0x4fb868),this['_prompt']=_0x14f540,this['_model']=_0x1378f0;}get['subTitle'](){return this['_prompt'];}['_createApiRequest'](){return this['_aiConnector']['callCustomReview']({'content':this['_documentData']['content'],'prompt':this['_prompt'],'model':this['_model']});}['_sendRatingRequest'](_0x2b71ec,_0xf8c66b,_0x5d0245){return this['_aiConnector']['upsertCustomAIReviewRating'](_0xf8c66b,_0x2b71ec,_0x5d0245);}}class Pa extends Da{get['subTitle'](){return'';}set['prompt'](_0x45a96c){this['_prompt']=_0x45a96c;}set['model'](_0x5a7d9e){this['_model']=_0x5a7d9e;}}class Ha extends Oa{static get['pluginName'](){return'AIReviewModeController';}['_isDiffOn']=!0x1;['_hasDefaultAvailableCommands']=!0x1;constructor(_0x215984){super(_0x215984),this['_hasDefaultAvailableCommands']=!this['context']['config']['get']('ai.review.availableCommands'),this['context']['config']['define']('ai.review.availableCommands',ka['map'](_0x1a7463=>_0x1a7463['id'])),this['context']['config']['define']('ai.review.extraCommands',[]);}async['init'](){await super['init'](),this['listenTo'](this['_aiReviewCoreUi'],'toggleDiff',(_0x1ee1a5,_0x268a55)=>{this['_isDiffOn']=_0x268a55['on'],this['_onDiffChange'](this['_isDiffOn']);});}['_initRequiredPlugins'](){super['_initRequiredPlugins'](),this['_aiReviewCoreUi']=this['context']['plugins']['get']('AIReviewModeUI'),this['_aiReviewCoreEditing']=this['context']['plugins']['get']('AIReviewCoreEditing');}['_createReviewCheckRun'](_0x5cd6e0,_0x2dcd9f){return _0x5cd6e0['isCustom']?new Da(_0x5cd6e0['args']['prompt'],_0x5cd6e0['args']['model'],this['_aiReviewCoreEditing']['getDocumentData'](),_0x2dcd9f,this['_aiConnector']):_0x2dcd9f['isExtra']?new Pa(_0x2dcd9f['prompt'],_0x2dcd9f['defaultModel']['id'],this['_aiReviewCoreEditing']['getDocumentData'](),_0x2dcd9f,this['_aiConnector']):new Ra(this['_aiReviewCoreEditing']['getDocumentData'](),_0x2dcd9f,this['_aiConnector'],_0x5cd6e0['params'],_0x5cd6e0['args']);}['_onReviewCheckResultActivated'](_0x178534){this['_aiReviewCoreUi']['setActiveStateInResults'](_0x178534['change']['id']),this['_scrollToChange'](_0x178534['change']['id']);const _0x2d4af4=this['_aiReviewCoreEditing']['getMarkerElementForChange'](_0x178534['change']['id']);if(!_0x2d4af4)return;const _0x12f79f=this['_aiReviewCoreEditing']['getEditorForChange'](_0x178534['change']['id'])??this['_aiReviewCoreEditing']['getEditor']();this['_aiReviewCoreUi']['showChangeBalloon'](_0x178534['change'],()=>_0x2d4af4['getElement'](),void 0x0,'click',this['_getBalloonDomRoot'](_0x12f79f,_0x2d4af4['modelRange']['root']['rootName']),_0x12f79f?.['ui']?.['viewportOffset']),this['_aiReviewCoreEditing']['setMarkersInElementAsActive'](_0x178534['change']['id']);}['_onReviewCheckResultDeactivated'](){this['_aiReviewCoreUi']['resetActiveStateInResults'](),this['_aiReviewCoreUi']['hideChangeBalloon'](),this['_aiReviewCoreEditing']['setAllMarkersAsInactive']();}['_onActivateChange'](_0x49f876){this['_currentReviewCheckRun']&&'click'===_0x49f876['uiInteraction']&&(this['_changeActivationSource']='panel',this['_currentReviewCheckRun']['activateChange'](_0x49f876['id']));}['_onDeactivateChange'](_0x394855){this['_currentReviewCheckRun']&&'balloon'===_0x394855['origin']&&this['_currentReviewCheckRun']['deactivateChange']();}['_onChangeMarkerClicked'](_0x27af84,_0x1d5e09){if(!this['_currentReviewCheckRun'])return;this['_changeActivationSource']='content',this['_currentReviewCheckRun']['activateChange'](_0x1d5e09['changeId']);const _0x37fb17=this['_currentReviewCheckRun']['getChangeById'](_0x1d5e09['changeId']);if(!_0x37fb17)return;const _0x1002e2=this['_aiReviewCoreEditing']['getMarkerElementForChange'](_0x1d5e09['changeId']),_0xc85b65=this['_aiReviewCoreEditing']['getEditorForChange'](_0x1d5e09['changeId'])??this['_aiReviewCoreEditing']['getEditor']();this['_aiReviewCoreUi']['showChangeBalloon'](_0x37fb17,_0x1d5e09['markerElement'],_0x1d5e09['domEvent'],'click',this['_getBalloonDomRoot'](_0xc85b65,_0x1002e2?.['modelRange']['root']['rootName']),_0xc85b65?.['ui']?.['viewportOffset']);}['_onChangeMarkerHovered'](_0x15a339,_0x52d417){if(!this['_currentReviewCheckRun'])return;if(this['_currentReviewCheckRun']['isAnyChangeActivated']())return;const _0x2207d2=this['_currentReviewCheckRun']['getChangeById'](_0x52d417['changeId']);if(!_0x2207d2)return;const _0x28ce7d=this['_aiReviewCoreEditing']['getMarkerElementForChange'](_0x52d417['changeId']),_0xe3f1d7=this['_aiReviewCoreEditing']['getEditorForChange'](_0x52d417['changeId'])??this['_aiReviewCoreEditing']['getEditor']();this['_aiReviewCoreUi']['showChangeBalloon'](_0x2207d2,_0x52d417['markerElement'],_0x52d417['domEvent'],'hover',this['_getBalloonDomRoot'](_0xe3f1d7,_0x28ce7d?.['modelRange']['root']['rootName']),_0xe3f1d7?.['ui']?.['viewportOffset']);}['_onChangeMarkerBlurred'](){if(!this['_currentReviewCheckRun'])return;this['_currentReviewCheckRun']['isAnyChangeActivated']()||this['_aiReviewCoreUi']['hideChangeBalloon']();}['_getChangeContentElement'](_0x16e9a0){const _0xae2f80=this['_aiReviewCoreEditing']['getMarkerElementForChange'](_0x16e9a0);return _0xae2f80?_0xae2f80['getElement']():null;}['_markChangePositionInEditorContent'](_0x629013,_0x1d38f8){this['_aiReviewCoreEditing']['markChangePositionInEditorContent'](_0x629013,_0x1d38f8);}['_diffContent'](_0x4b9cc0,_0x5a7051,_0x58e4a9){return this['_aiReviewCoreEditing']['diffContent'](_0x4b9cc0,_0x5a7051,_0x58e4a9,!0x1);}['_onReviewCheckRun'](){this['_onDiffChange'](this['_isDiffOn']);}['_onDiffChange'](_0x5ee312){_0x5ee312?this['_aiReviewCoreUi']['hideDiffInBalloon']():this['_aiReviewCoreUi']['showDiffInBalloon']();for(const _0x5f374f of this['_aiReviewCoreEditing']['getEditors']())_0x5f374f['editing']['view']['change'](_0x2213a2=>{for(const _0x54fb87 of _0x5f374f['editing']['view']['document']['getRoots']()){for(const _0x541343 of _0x54fb87['getClassNames']())_0x541343['startsWith']('ck-ai_review-')&&_0x2213a2['removeClass'](_0x541343,_0x54fb87);_0x2213a2['addClass'](_0x5ee312?'ck-ai_review-diff':'ck-ai_review-highlights',_0x54fb87);}});}['_getBalloonDomRoot'](_0x4cf7ac,_0x464f21){const _0x1c971c=_0x4cf7ac['editing']['view'];if(_0x464f21){const _0x4aeec7=_0x1c971c['getDomRoot'](_0x464f21);if(_0x4aeec7)return _0x4aeec7;}return _0x1c971c['getDomRoot']()??void 0x0;}async['_getChecksList'](){const _0x17fb90=[...ka,...this['_getExtraChecks']()],_0x2c77cd=this['context']['config']['get']('ai.review.availableCommands')||[];this['_logErrorForNonExistentChecks'](_0x2c77cd,_0x17fb90);let _0x111cc3=_0x17fb90;this['_hasDefaultAvailableCommands']||(_0x111cc3=_0x2c77cd['map'](_0x393bf5=>_0x17fb90['find'](_0x8733cb=>_0x8733cb['id']===_0x393bf5))['filter'](_0x1005f6=>!!_0x1005f6)),_0x111cc3=_0x111cc3['map'](_0x3dbc7f=>_0x3dbc7f['isExtra']?_0x3dbc7f:this['_translateReviewCheck'](_0x3dbc7f));const _0x1c655c=_0x111cc3['some'](_0x16578e=>_0x16578e['isExtra']||'custom'===_0x16578e['id']);let _0x45257f=[],_0x378623=[],_0x7aca1c=null;if(_0x1c655c){const _0x25211a=await this['_getModels']();_0x45257f=_0x25211a['all'],_0x378623=_0x25211a['recommended'],_0x7aca1c=_0x25211a['default'];}const _0x5e0563=new La(_0x45257f,_0x378623,_0x7aca1c);return _0x5e0563['setupChecks'](_0x111cc3),_0x1c655c&&this['_filterChecksWithMissingModel'](_0x5e0563),_0x5e0563;}['_getExtraChecks'](){return(this['context']['config']['get']('ai.review.extraCommands')||[])['map'](_0x598606=>({'id':_0x598606['id'],'commandId':_0x598606['id'],'title':_0x598606['label'],'description':_0x598606['description'],'isParameterized':!0x1,'isExtra':!0x0,'prompt':_0x598606['prompt'],'model':_0x598606['model']}));}['_logErrorForNonExistentChecks'](_0x311c79,_0x46e320){const _0xa76810=_0x311c79['filter'](_0x1c499e=>!_0x46e320['some'](_0x71aedf=>_0x71aedf['id']===_0x1c499e));_0xa76810['length']&&this['_logError'](new at('ai-review-mode-non-existent-commands-used',this,{'commandIds':_0xa76810['join'](',\x20')}),!0x0);}async['_getModels'](){try{const _0x5f06f4=new Fs({'connector':this['_aiConnector'],'config':this['context']['config']['get']('ai.models'),'locale':this['context']['locale']});return{'all':await _0x5f06f4['getAll'](),'recommended':await _0x5f06f4['getAvailableModels'](),'default':await _0x5f06f4['getDefault']()};}catch(_0x32ec25){return this['_logError'](new at('ai-review-mode-models-unable-to-retrieve',this,void 0x0,_0x32ec25)),{'all':[],'recommended':[],'default':null};}}['_translateReviewCheck'](_0x1f4f93){const _0x6201f5='AI_REVIEW_CHECK_'+_0x1f4f93['id']['toUpperCase']()['replaceAll']('-','_'),_0x5a30ea={..._0x1f4f93,'title':this['_getTranslationWithDefault'](_0x6201f5+'_TITLE',_0x1f4f93['title']),'description':this['_getTranslationWithDefault'](_0x6201f5+'_DESCRIPTION',_0x1f4f93['description'])};return _0x1f4f93['options']&&(_0x5a30ea['options']=_0x1f4f93['options']['map'](_0x37b2db=>({..._0x37b2db,'label':this['_getTranslationWithDefault'](_0x6201f5+'_OPTIONS_LABEL',_0x37b2db['label']||''),'data':_0x37b2db['data']?_0x37b2db['data']['map'](_0x3584cd=>({..._0x3584cd,'label':this['_getTranslationWithDefault'](_0x6201f5+'_OPTIONS_DATA_'+_0x3584cd['id']['toUpperCase'](),_0x3584cd['label'])})):void 0x0}))),_0x5a30ea;}['_filterChecksWithMissingModel'](_0x214f51){const _0x47d72f=[];_0x214f51['checks']['forEach'](_0x2c90e1=>{(_0x2c90e1 instanceof xa&&!_0x2c90e1['defaultModel']||_0x2c90e1 instanceof ya&&!_0x2c90e1['models']['length'])&&_0x47d72f['push'](_0x2c90e1['id']);}),_0x47d72f['length']&&_0x47d72f['forEach'](_0x58e363=>{_0x214f51['removeCheckById'](_0x58e363),this['_logError'](new at('ai-review-mode-command-unavailable-due-to-missing-model',this,{'commandId':_0x58e363}),!0x0);});}}class Ma extends _0x1c4dd1{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'](_0x12bbcb){this['_checks']=_0x12bbcb['map'](_0x162175=>new Ua(_0x162175));}}class Ba extends Ra{['_title'];constructor(_0x1c106e,_0x3f56c9,_0x27b6e0,_0xea04d4,_0x396d91,_0x4f1238){super(_0x1c106e,_0x3f56c9,_0x27b6e0,_0x396d91,_0x4f1238),this['_title']=_0xea04d4;}get['title'](){return this['_title'];}get['subTitle'](){return this['_sourceCheck']['title'];}}class Ga extends Oa{static get['pluginName'](){return'AITranslateController';}constructor(_0x51a1b9){super(_0x51a1b9),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'](_0x42b403,_0x5467c9){return new Ba(this['_aiReviewCoreEditing']['getDocumentData'](),_0x5467c9,this['_aiConnector'],hs(this['context']['locale'],'AI_REVIEW_CHECK_TRANSLATE_TITLE'),_0x42b403['params'],_0x42b403['args']);}['_onReviewCheckResultActivated'](_0xda34d9){this['_aiReviewCoreUi']['setActiveStateInResults'](_0xda34d9['change']['id']),this['_aiReviewCoreEditing']['setMarkersInElementAsActive'](_0xda34d9['change']['id']);}['_onReviewCheckResultDeactivated'](){this['_aiReviewCoreEditing']['setAllMarkersAsInactive'](),this['_aiReviewCoreUi']['resetActiveStateInResults']();}['_onActivateChange'](_0x382f27){this['_currentReviewCheckRun']&&('hover'===_0x382f27['uiInteraction']&&(this['_changeActivationSource']='panel',this['_currentReviewCheckRun']['activateChange'](_0x382f27['id'])),'click'===_0x382f27['uiInteraction']&&this['_scrollToChange'](_0x382f27['id']));}['_onDeactivateChange'](_0x3dde74){this['_currentReviewCheckRun']&&'panel'===_0x3dde74['origin']&&this['_currentReviewCheckRun']['deactivateChange']();}['_onChangeMarkerClicked'](_0x54cf0c,_0x317715){this['_currentReviewCheckRun']&&(this['_changeActivationSource']='content',this['_currentReviewCheckRun']['activateChange'](_0x317715['changeId']),this['_scrollToChange'](_0x317715['changeId']));}['_onChangeMarkerHovered'](_0x5cc4cb,_0x197fad){this['_currentReviewCheckRun']&&(this['_changeActivationSource']='content',this['_currentReviewCheckRun']['activateChange'](_0x197fad['changeId']),this['_aiReviewCoreEditing']['reactivateMarkers'](_0x197fad['changeId']));}['_onChangeMarkerBlurred'](){this['_currentReviewCheckRun']&&'content'===this['_changeActivationSource']&&(this['_currentReviewCheckRun']['deactivateChange'](),this['_aiReviewCoreEditing']['setAllMarkersAsInactive']());}['_getChangeContentElement'](_0x278467){return this['_aiReviewCoreEditing']['getContentElementForChange'](_0x278467);}['_markChangePositionInEditorContent'](_0x2988a5,_0x5a03e5){this['_aiReviewCoreEditing']['markChangePositionInEditorContent'](_0x2988a5,_0x5a03e5);}['_diffContent'](_0x4057c2,_0x16b941,_0x42b7ee){return this['_aiReviewCoreEditing']['diffContent'](_0x4057c2,_0x16b941,_0x42b7ee,!0x0);}['_onReviewCheckRun'](){for(const _0x5b97ed of this['_aiReviewCoreEditing']['getEditors']())_0x5b97ed['editing']['view']['change'](_0x2d0328=>{for(const _0xd23d9d of _0x5b97ed['editing']['view']['document']['getRoots']())_0x2d0328['addClass']('ck-ai-translate-mode-content',_0xd23d9d);});}async['_getChecksList'](){const _0xd4dbeb=[],_0x225d56=this['context']['config']['get']('ai.translate.languages')||[];for(const _0x13f483 of _0x225d56)_0xd4dbeb['push']({'title':_0x13f483['label'],'id':_0x13f483['id'],'commandId':_0x13f483['id'],'description':'','isParameterized':!0x1,'useArgs':!0x0,'args':{'language':_0x13f483['id']}});const _0xb5b86c=new Va();return _0xb5b86c['setupChecks'](this['_translateChecks'](_0xd4dbeb)),_0xb5b86c;}['_translateChecks'](_0x5e87ed){return _0x5e87ed['map'](_0x492ec5=>{const _0x2dd817='AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_'+_0x492ec5['title']['toUpperCase']()['replaceAll']('-','_');return{..._0x492ec5,'title':this['_getTranslationWithDefault'](_0x2dd817,_0x492ec5['title'])};});}}class Fa extends ca{constructor(_0x27007d,_0x52d5a9){super(_0x27007d,_0x52d5a9),this['on']('set:isLoading',(_0x5596d9,_0xa5bc4d,_0x3fa4ea)=>{_0x3fa4ea&&(this['headerTitle']=hs(this['locale'],'AI_TRANSLATE_CHECK_RESULTS_LOADING_TITLE'));}),this['on']('set:isResultReady',(_0x22942c,_0x41fa93,_0x2618a2)=>{_0x2618a2&&(this['headerTitle']=hs(this['locale'],'AI_TRANSLATE_CHECK_RESULTS_READY_TITLE'));});}['_createAcceptAllButtonView'](){const _0x371d9f=super['_createAcceptAllButtonView']();return _0x371d9f['set']('label',hs(this['locale'],'AI_TRANSLATE_ACCEPT_ALL')),_0x371d9f;}['_createExitReviewButtonView'](){const _0x1d4ca4=super['_createExitReviewButtonView']();return _0x1d4ca4['set']('label',hs(this['locale'],'AI_CHAT_HISTORY_CANCEL')),_0x1d4ca4;}}class Ka extends pa{['_setupTemplate'](){const _0x36b83a=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-translate__check-list-wrapper',_0x36b83a['if']('isVisible','ck-hidden',_0x17c377=>!_0x17c377)]},'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',_0x36b83a['if']('isVisible','ck-hidden',_0x45a9db=>!_0x45a9db)]},'children':this['_checkViews']}]});}}class Wa extends ra{static get['pluginName'](){return'AITranslateUI';}['createMainView'](){const _0x49bdf4=this['context']['plugins']['get']('AITabs'),_0x3cdb40=this['context']['locale'],_0x1c83c0=new eo(_0x3cdb40,{'label':hs(_0x3cdb40,'AI_REVIEW_CHECK_TRANSLATE_TITLE'),'icon':_0xc37e4b,'class':'ck-ai-header_review-translate','showResizeButton':_0x49bdf4['showResizeButton']});_0x1c83c0['delegate']('resizeTabs')['to'](_0x49bdf4),_0x1c83c0['bind']('isMaximized')['to'](_0x49bdf4['view'],'isMaximized',_0x2fbe7b=>_0x2fbe7b);const _0x1911ef=new aa(_0x3cdb40,{'header':_0x1c83c0,'list':new Ka(_0x3cdb40),'results':new Fa(_0x3cdb40,{'generalErrorText':hs(_0x3cdb40,'AI_TRANSLATE_GENERAL_ERROR_MESSAGE')}),'completed':new la(_0x3cdb40,{'headerText':hs(_0x3cdb40,'AI_TRANSLATE_FINISH_HEADER_TITLE'),'emptyResultsText':hs(_0x3cdb40,'AI_TRANSLATE_EMPTY_RESULTS_TEXT'),'buttonText':hs(_0x3cdb40,'AI_TRANSLATE_FINISH_BUTTON_LABEL')})});return _0x1911ef['extendTemplate']({'attributes':{'class':'ck-ai-translate-mode'}}),_0x1911ef;}['registerTab'](){const _0x2b7bef=this['context']['plugins']['get']('AITabs');_0x2b7bef['view']['on']('activateTab',(_0x16939b,{newTab:_0x2ae208,oldTab:_0x54760a})=>{'translate'===_0x2ae208?this['fire']('getReviewCheckList'):'translate'===_0x54760a&&this['fire']('leaveReview');}),_0x2b7bef['view']['addTab']({'id':'translate','buttonLabel':hs(this['context']['locale'],'AI_REVIEW_CHECK_TRANSLATE_TITLE'),'buttonIcon':_0xc37e4b,'order':0x0,'content':this['_mainView']});}}class Ya extends _0x1c4dd1{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 _0x5e9f88,Command as _0x2086ab,ContextPlugin as _0xee6711,Editor as _0x4df290}from'@ckeditor/ckeditor5-core/dist/index.js';import{IconCopy as _0x4b3519,IconCheck as _0x2dfde3,IconError as _0x289a6d,IconSubmit as _0x4829f4,IconAIHistory as _0x154a8a,IconMagicWand as _0x55c72f,IconRobotPencil as _0x1dc2c8,IconMaximize as _0xb350fd,IconMinimize as _0x2a9f31,IconShowChangesOn as _0x3d65c1,IconShowChangesOff as _0x22e99c,IconDocument as _0x2c2579,IconBoxWithCross as _0x1c646a,IconBoxWithCheck as _0x4a57f7,IconBoxWithMarker as _0x5eaee5,IconInfo as _0x5800b6,IconWeb as _0x2cc2cd,IconCancel as _0x1a0f5,IconSelection as _0x338003,IconFileUpload as _0x50ae83,IconLink as _0x289d5e,IconBulb as _0x33f7c5,IconAI as _0x11d2a1,IconPreviousArrow as _0x15e3cb,IconDocumentOutline as _0x548fb2,IconLoupe as _0xb2c1fa,IconPaperClip as _0x2a741b,IconBrowseFiles as _0x58d7b2,IconDropdownArrow as _0x58875c,IconStop as _0x321021,IconPlus as _0x4ff6ca,IconAIChat as _0xf586bd,IconPin as _0x2208db,IconThreeHorizontalDots as _0x54c890,IconAIReview as _0x14d24d,IconAITranslate as _0x157c37,IconAIAskAI as _0x141f4b,IconThumbUp as _0x3cedbd,IconThumbDown as _0x59a55b,IconChevronDown as _0x2d691f,IconChevronUp as _0x3a1a88,IconAIQuickActions as _0x4b17ba,IconAIChatCommands as _0x3e3c44,IconAIImproveWriting as _0x3e538e,IconAIContinueWriting as _0x21142e,IconAIGrammarCheck as _0x4ab159,IconAIAdjustLength as _0x4645a8,IconAIChangeTone as _0x32d64c,IconAIOther as _0x4b2fde,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 _0x2b8667,FormHeaderView as _0x53b19c,HighlightedTextView as _0x2a3dc2,ViewCollection as _0x2fb855,FileDialogButtonView as _0x28782d,InputTextView as _0x185b23,SearchTextView as _0x43e87c,ListItemButtonView as _0x61e23f,ButtonLabelWithHighlightView as _0x5e2f36,DropdownMenuPanelPositioningFunctions as _0x5557ff,BalloonToolbar as _0x27055,FormRowView as _0x187262,TextareaView as _0x2b5bb8}from'@ckeditor/ckeditor5-ui/dist/index.js';import{ClipboardPipeline as _0x4e2b34,ClipboardMarkersUtils as _0x10520d}from'@ckeditor/ckeditor5-clipboard/dist/index.js';import{ViewDocumentDomEventData as _0x18b026,ViewDataTransfer as _0x3634b1,ViewUpcastWriter as _0x13c141,Matcher as _0x35aa82,_DetachOperation as _0x349a38,_insertIntoModelNodeList as _0xf2ea81,_removeFromModelNodeList as _0x2c3240,ModelRange as _0x2a951f,transformOperationSets as _0x5e674a,ViewDowncastWriter as _0x506174,ModelDocumentFragment as _0x19adab,ModelPosition as _0x53bf6b,ModelTreeWalker as _0x4820fe,MarkerOperation as _0x3113a4,InsertOperation as _0x304cb7}from'@ckeditor/ckeditor5-engine/dist/index.js';import{unescape as _0x43387b,escape as _0x28ca45,cloneDeep as _0x5c6558,throttle as _0x56a581,debounce as _0x18ec0f,escapeRegExp as _0x2052d8}from'es-toolkit/compat';import{createParser as _0x385587}from'eventsource-parser';import{CloudServices as _0x2f155f}from'@ckeditor/ckeditor5-cloud-services/dist/index.js';import{parseDocument as _0x595a67}from'htmlparser2';import{isTag as _0x60f0d2,findOne as _0x3f6b28,getParent as _0xe039c1,findAll as _0x364046,removeElement as _0x4529c2,prepend as _0x484771,prependChild as _0x57380b,appendChild as _0x1e9fbc,append as _0x5c974a,find as _0x1b48d2,isComment as _0x502ab9,replaceElement as _0x3a530c,getChildren as _0x5e79c1,textContent as _0x509c99}from'domutils';import ti from'dom-serializer';import{Document as _0x36408a,Element as _0x2b2f52,Text as _0x3f4e70,cloneNode as _0x51d407,isDocument as _0xcde254,isText as _0xbfd574,NodeWithChildren as _0x50edd4}from'domhandler';import{MarkdownGfmMdToHtmlDefaultPlugins as _0x404772,MarkdownGfmMdToHtml as _0x50fd49}from'@ckeditor/ckeditor5-markdown-gfm/dist/index.js';import _0x4927f8 from'rehype-sanitize';import{fixElementSuggestionRange as _0x2bb93e,DocumentCompare as _0x367c6c,DATA_ID_MODEL_ATTRIBUTE as _0x307282,ConfirmMixin as _0x47b513,getAllMarkersDomElementsSorted as _0x3359cb,SuggestionsConversion as _0x1da09b,DATA_ID_VIEW_ATTRIBUTE as _0x2af4e4,getMarkerDomElement as _0x40ecdc}from'@ckeditor/ckeditor5-collaboration-core/dist/index.js';import _0x2863b3 from'morphdom';import{diffArrays as _0x58b9fe}from'diff';const Ci='_ungrouppedCommands';function wi(_0x10133d,_0x551e69){const _0x37de81=(0x0,_0x551e69['t'])('Other');return _0x10133d['length']?'groupId'in _0x10133d[0x0]?_0x10133d:[{'groupId':Ci,'groupLabel':_0x37de81,'order':0x1/0x0,'commands':_0x10133d}]:[{'groupId':Ci,'groupLabel':_0x37de81,'order':0x1/0x0,'commands':[]}];}const fi=globalThis['DataTransfer'],bi='ai-ui';class Si extends _0x5e9f88{static get['pluginName'](){return'AIAssistantEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const {editor:_0x1a7dd2}=this,_0x2f7312=['ck-fake-ai-selection'];_0x1a7dd2['config']['get']('ai.assistant.useTheme')&&_0x2f7312['push']('ck-ai-assistant-ui_theme'),_0x1a7dd2['conversion']['for']('editingDowncast')['markerToHighlight']({'model':bi,'view':{'classes':_0x2f7312,'priority':0xc}}),_0x1a7dd2['conversion']['for']('editingDowncast')['markerToElement']({'model':bi,'view':(_0x33d235,{writer:_0x8e0eb})=>{if(!_0x33d235['markerRange']['isCollapsed'])return null;const _0x14c91c=_0x8e0eb['createUIElement']('span');return _0x8e0eb['addClass'](['ck-fake-ai-selection','ck-fake-ai-selection_collapsed'],_0x14c91c),_0x14c91c;}});}['afterInit'](){!async function(_0x31692a){const _0x44062c=_0x21fe8c([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]),_0x22d2f9=0x3dffc4e1,_0x2fb91a=0x3df84d81^_0x22d2f9,_0x2e12dd=window[_0x21fe8c([0x44,0x61,0x74,0x65])][_0x21fe8c([0x6e,0x6f,0x77])](),_0x55b3e7=_0x31692a[_0x21fe8c([0x65,0x64,0x69,0x74,0x6f,0x72])],_0x56172c=new window[(_0x21fe8c([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x392229=>{_0x55b3e7[_0x21fe8c([0x6f,0x6e,0x63,0x65])](_0x21fe8c([0x72,0x65,0x61,0x64,0x79]),_0x392229);}),_0x3b670a={[_0x21fe8c([0x6b,0x74,0x79])]:_0x21fe8c([0x45,0x43]),[_0x21fe8c([0x75,0x73,0x65])]:_0x21fe8c([0x73,0x69,0x67]),[_0x21fe8c([0x63,0x72,0x76])]:_0x21fe8c([0x50,0x2d,0x32,0x35,0x36]),[_0x21fe8c([0x78])]:_0x21fe8c([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]),[_0x21fe8c([0x79])]:_0x21fe8c([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]),[_0x21fe8c([0x61,0x6c,0x67])]:_0x21fe8c([0x45,0x53,0x32,0x35,0x36])},_0x2b5cc=_0x55b3e7[_0x21fe8c([0x63,0x6f,0x6e,0x66,0x69,0x67])][_0x21fe8c([0x67,0x65,0x74])](_0x21fe8c([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79]));async function _0x45a286(){let _0x3233d7,_0x42d701=null,_0x51ec69=null;try{if(_0x2b5cc==_0x21fe8c([0x47,0x50,0x4c]))return _0x21fe8c([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]);if(_0x3233d7=_0x37e7e9(),!_0x3233d7)return _0x21fe8c([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);return _0x3233d7[_0x21fe8c([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])]&&(_0x51ec69=_0x2c2799(_0x3233d7[_0x21fe8c([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])],_0x3233d7[_0x21fe8c([0x6a,0x74,0x69])])),await _0x4f16f9()?_0xbf8758()?_0x742b9c()?_0x21fe8c([0x45,0x78,0x70,0x69,0x72,0x65,0x64]):_0x4645df()?(_0x3233d7[_0x21fe8c([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])]==_0x21fe8c([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e])&&(_0x42d701=_0x142a99(_0x21fe8c([0x45,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e,0x4c,0x69,0x6d,0x69,0x74]))),await _0x223b9a()):_0x21fe8c([0x44,0x6f,0x6d,0x61,0x69,0x6e,0x4c,0x69,0x6d,0x69,0x74]):_0x21fe8c([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]):_0x21fe8c([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}catch{return _0x21fe8c([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}function _0x742b9c(){const _0x2f24cc=[_0x21fe8c([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e]),_0x21fe8c([0x74,0x72,0x69,0x61,0x6c])][_0x21fe8c([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x3233d7[_0x21fe8c([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])])?_0x2e12dd/0x3e8:0xe10*_0x2fb91a;return _0x3233d7[_0x21fe8c([0x65,0x78,0x70])]<_0x2f24cc;}function _0xbf8758(){const _0x3b4754=_0x3233d7[_0x21fe8c([0x66,0x65,0x61,0x74,0x75,0x72,0x65,0x73])];return!!_0x3b4754&&(!!_0x3b4754[_0x21fe8c([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x21fe8c([0x2a]))||!!_0x3b4754[_0x21fe8c([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x21fe8c([0x41,0x49])));}function _0x4645df(){const _0x25f943=_0x3233d7[_0x21fe8c([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x64,0x48,0x6f,0x73,0x74,0x73])];if(!_0x25f943||0x0==_0x25f943[_0x21fe8c([0x6c,0x65,0x6e,0x67,0x74,0x68])])return!0x0;const {hostname:_0x172a34}=new URL(window[_0x21fe8c([0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e])]['href']);if(_0x25f943[_0x21fe8c([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x172a34))return!0x0;const _0x2b79e2=_0x172a34[_0x21fe8c([0x73,0x70,0x6c,0x69,0x74])](_0x21fe8c([0x2e]));return _0x25f943[_0x21fe8c([0x66,0x69,0x6c,0x74,0x65,0x72])](_0x12934a=>_0x12934a[_0x21fe8c([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x21fe8c([0x2a])))[_0x21fe8c([0x6d,0x61,0x70])](_0x23a6d5=>_0x23a6d5[_0x21fe8c([0x73,0x70,0x6c,0x69,0x74])](_0x21fe8c([0x2e])))[_0x21fe8c([0x66,0x69,0x6c,0x74,0x65,0x72])](_0x5448f2=>_0x5448f2[_0x21fe8c([0x6c,0x65,0x6e,0x67,0x74,0x68])]<=_0x2b79e2[_0x21fe8c([0x6c,0x65,0x6e,0x67,0x74,0x68])])[_0x21fe8c([0x6d,0x61,0x70])](_0x11a322=>Array(_0x2b79e2[_0x21fe8c([0x6c,0x65,0x6e,0x67,0x74,0x68])]-_0x11a322[_0x21fe8c([0x6c,0x65,0x6e,0x67,0x74,0x68])])[_0x21fe8c([0x66,0x69,0x6c,0x6c])](_0x11a322[0x0]===_0x21fe8c([0x2a])?_0x21fe8c([0x2a]):'')[_0x21fe8c([0x63,0x6f,0x6e,0x63,0x61,0x74])](_0x11a322))[_0x21fe8c([0x73,0x6f,0x6d,0x65])](_0x35b1fd=>_0x2b79e2[_0x21fe8c([0x65,0x76,0x65,0x72,0x79])]((_0x252584,_0x1afd77)=>_0x35b1fd[_0x1afd77]===_0x252584||_0x35b1fd[_0x1afd77]===_0x21fe8c([0x2a])));}function _0x223b9a(){return _0x42d701&&_0x51ec69?new window[(_0x21fe8c([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0x30a320,_0xdbf745)=>{_0x42d701[_0x21fe8c([0x74,0x68,0x65,0x6e])](_0x30a320,_0xdbf745),_0x51ec69[_0x21fe8c([0x74,0x68,0x65,0x6e])](_0x2c53d6=>{_0x2c53d6!=_0x21fe8c([0x56,0x61,0x6c,0x69,0x64])&&_0x30a320(_0x2c53d6);},_0xdbf745);}):_0x42d701||_0x51ec69||_0x21fe8c([0x56,0x61,0x6c,0x69,0x64]);}}function _0x2c2799(_0x1a6efd,_0x1b2a45){return new window[(_0x21fe8c([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x29a19a=>{if(_0x2560cb())return _0x29a19a(_0x21fe8c([0x56,0x61,0x6c,0x69,0x64]));_0x25fa65(),_0x55b3e7[_0x21fe8c([0x64,0x65,0x63,0x6f,0x72,0x61,0x74,0x65])](_0x21fe8c([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]));let _0x9bff7a=!0x1;const _0x2abec4=ot();function _0x312c2e(_0x79ee8){return!!_0x79ee8&&(typeof _0x79ee8===_0x21fe8c([0x6f,0x62,0x6a,0x65,0x63,0x74])||typeof _0x79ee8===_0x21fe8c([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]))&&typeof _0x79ee8[_0x21fe8c([0x74,0x68,0x65,0x6e])]===_0x21fe8c([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e])&&typeof _0x79ee8[_0x21fe8c([0x63,0x61,0x74,0x63,0x68])]===_0x21fe8c([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]);}function _0x3fdfbe(_0x52556b){_0x45c623(_0x52556b)[_0x21fe8c([0x74,0x68,0x65,0x6e])](_0x3c9c36=>{if(!_0x3c9c36||_0x3c9c36[_0x21fe8c([0x73,0x74,0x61,0x74,0x75,0x73])]!=_0x21fe8c([0x6f,0x6b]))return _0x21fe8c([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]);return _0x4edfab(_0x185419(_0x2abec4+_0x1b2a45))!=_0x3c9c36[_0x21fe8c([0x76,0x65,0x72,0x69,0x66,0x69,0x63,0x61,0x74,0x69,0x6f,0x6e])]?_0x21fe8c([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]):_0x21fe8c([0x56,0x61,0x6c,0x69,0x64]);})[_0x21fe8c([0x74,0x68,0x65,0x6e])](_0x178b02=>(_0x5372e8(),_0x178b02),()=>{const _0xe054da=_0x2eb680();return null==_0xe054da?(_0x5372e8(),_0x21fe8c([0x56,0x61,0x6c,0x69,0x64])):_0x21fe8c(_0x2e12dd-_0xe054da>(0x19f340e1^_0x22d2f9)?[0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]:[0x56,0x61,0x6c,0x69,0x64]);})[_0x21fe8c([0x74,0x68,0x65,0x6e])](_0x29a19a)[_0x21fe8c([0x63,0x61,0x74,0x63,0x68])](()=>{_0x29a19a(_0x21fe8c([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});const _0x39ead0=0x3dc92a61^_0x22d2f9;function _0x5372e8(){const _0x17ff28=_0x21fe8c([0x6c,0x6c,0x63,0x74,0x2d])+_0x4edfab(_0x185419(_0x1a6efd)),_0xb9f2eb=_0x31cee0(_0x4edfab(window[_0x21fe8c([0x4d,0x61,0x74,0x68])][_0x21fe8c([0x63,0x65,0x69,0x6c])](_0x2e12dd/_0x39ead0)));window[_0x21fe8c([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0x21fe8c([0x73,0x65,0x74,0x49,0x74,0x65,0x6d])](_0x17ff28,_0xb9f2eb);}function _0x2eb680(){const _0x5519f6=_0x21fe8c([0x6c,0x6c,0x63,0x74,0x2d])+_0x4edfab(_0x185419(_0x1a6efd)),_0x3271cc=window[_0x21fe8c([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0x21fe8c([0x67,0x65,0x74,0x49,0x74,0x65,0x6d])](_0x5519f6);return _0x3271cc?window[_0x21fe8c([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x31cee0(_0x3271cc),0x10)*_0x39ead0:null;}function _0x45c623(_0xb10462){return new window[(_0x21fe8c([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0x301bae,_0x3a6435)=>{_0xb10462[_0x21fe8c([0x74,0x68,0x65,0x6e])](_0x301bae,_0x3a6435),window[_0x21fe8c([0x73,0x65,0x74,0x54,0x69,0x6d,0x65,0x6f,0x75,0x74])](_0x3a6435,0x3dfe1021^_0x22d2f9);});}}_0x55b3e7[_0x21fe8c([0x6f,0x6e])](_0x21fe8c([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),(_0x2b5bfc,_0x340cba)=>{if(_0x340cba[0x0]!=_0x1a6efd)return _0x29a19a(_0x21fe8c([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));_0x340cba[0x1]={..._0x340cba[0x1],[_0x21fe8c([0x72,0x65,0x71,0x75,0x65,0x73,0x74,0x49,0x64])]:_0x2abec4};},{[_0x21fe8c([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0x21fe8c([0x68,0x69,0x67,0x68])}),_0x55b3e7[_0x21fe8c([0x6f,0x6e])](_0x21fe8c([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),_0x254d08=>{_0x312c2e(_0x254d08[_0x21fe8c([0x72,0x65,0x74,0x75,0x72,0x6e])])&&(_0x9bff7a=!0x0,_0x3fdfbe(_0x254d08[_0x21fe8c([0x72,0x65,0x74,0x75,0x72,0x6e])]));},{[_0x21fe8c([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0x21fe8c([0x6c,0x6f,0x77])}),_0x56172c[_0x21fe8c([0x74,0x68,0x65,0x6e])](()=>{_0x9bff7a||_0x29a19a(_0x21fe8c([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});});function _0x2560cb(){return _0x55b3e7[_0x21fe8c([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0x21fe8c([0x76,0x69,0x65,0x77])][_0x21fe8c([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]==_0x21fe8c([0x61,0x75,0x74,0x6f]);}function _0x25fa65(){_0x55b3e7[_0x21fe8c([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0x21fe8c([0x76,0x69,0x65,0x77])][_0x21fe8c([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]=_0x21fe8c([0x61,0x75,0x74,0x6f]);}}function _0x142a99(_0x1ddbe9){const _0x4a3d42=[new window[(_0x21fe8c([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x11cf1e=>setTimeout(_0x11cf1e,0x3df6fa2d^_0x22d2f9)),_0x56172c[_0x21fe8c([0x74,0x68,0x65,0x6e])](()=>new window[(_0x21fe8c([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x35c4d0=>{let _0x5c0e7a=0x0;_0x55b3e7[_0x21fe8c([0x6d,0x6f,0x64,0x65,0x6c])][_0x21fe8c([0x6f,0x6e])](_0x21fe8c([0x61,0x70,0x70,0x6c,0x79,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e]),(_0x280928,_0x4d3d2a)=>{_0x4d3d2a[0x0][_0x21fe8c([0x69,0x73,0x44,0x6f,0x63,0x75,0x6d,0x65,0x6e,0x74,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e])]&&_0x5c0e7a++,_0x5c0e7a==(0x3dffc109^_0x22d2f9)&&(_0x35c4d0(),_0x280928[_0x21fe8c([0x6f,0x66,0x66])]());});}))];return window[_0x21fe8c([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65])][_0x21fe8c([0x72,0x61,0x63,0x65])](_0x4a3d42)[_0x21fe8c([0x74,0x68,0x65,0x6e])](()=>_0x1ddbe9);}async function _0x807d7d(){await _0x56172c,_0x55b3e7[_0x21fe8c([0x6d,0x6f,0x64,0x65,0x6c])][_0x21fe8c([0x63,0x68,0x61,0x6e,0x67,0x65])]=_0x474d5c,_0x55b3e7[_0x21fe8c([0x6d,0x6f,0x64,0x65,0x6c])][_0x21fe8c([0x65,0x6e,0x71,0x75,0x65,0x75,0x65,0x43,0x68,0x61,0x6e,0x67,0x65])]=_0x474d5c,_0x55b3e7[_0x21fe8c([0x65,0x6e,0x61,0x62,0x6c,0x65,0x52,0x65,0x61,0x64,0x4f,0x6e,0x6c,0x79,0x4d,0x6f,0x64,0x65])](_0x21fe8c([0x6d,0x6f,0x64,0x65,0x6c]));}function _0x5e1bb8(_0x36640d){const _0x557d2d=_0xa663af();_0x55b3e7[_0x557d2d]=_0x21fe8c([0x61,0x69,0x4c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79])+_0x36640d,_0x36640d!=_0x21fe8c([0x56,0x61,0x6c,0x69,0x64])&&_0x807d7d();}function _0xa663af(){const _0x37efd5=window[_0x21fe8c([0x53,0x74,0x72,0x69,0x6e,0x67])](window[_0x21fe8c([0x70,0x65,0x72,0x66,0x6f,0x72,0x6d,0x61,0x6e,0x63,0x65])][_0x21fe8c([0x6e,0x6f,0x77])]())[_0x21fe8c([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](_0x21fe8c([0x2e]),'');let _0x74a1b=_0x21fe8c([0x6e]);for(let _0x52b4b4=0x0;_0x52b4b4<_0x37efd5[_0x21fe8c([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0x52b4b4+=0x2){let _0x435229=window[_0x21fe8c([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x37efd5[_0x21fe8c([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0x52b4b4,_0x52b4b4+0x2));_0x435229>=_0x44062c[_0x21fe8c([0x6c,0x65,0x6e,0x67,0x74,0x68])]&&(_0x435229-=_0x44062c[_0x21fe8c([0x6c,0x65,0x6e,0x67,0x74,0x68])]),_0x74a1b+=_0x44062c[_0x435229];}return _0x74a1b;}function _0x37e7e9(){const _0x1bd328=_0x2b5cc[_0x21fe8c([0x73,0x70,0x6c,0x69,0x74])](_0x21fe8c([0x2e]));if(0x3!=_0x1bd328[_0x21fe8c([0x6c,0x65,0x6e,0x67,0x74,0x68])])return null;return _0x4fc896(_0x1bd328[0x1]);function _0x4fc896(_0x3debbe){const _0x151571=_0x34aff5(_0x3debbe);return _0x151571&&_0x3744ed()?_0x151571:null;function _0x3744ed(){const _0xc0afd=_0x151571[_0x21fe8c([0x6a,0x74,0x69])],_0x3b89ab=window[_0x21fe8c([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0xc0afd[_0x21fe8c([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0xc0afd[_0x21fe8c([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8),0x10),_0x59222f={..._0x151571,[_0x21fe8c([0x6a,0x74,0x69])]:_0xc0afd[_0x21fe8c([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](0x0,_0xc0afd[_0x21fe8c([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8)};return delete _0x59222f[_0x21fe8c([0x76,0x63])],_0x185419(_0x59222f)==_0x3b89ab;}}}async function _0x4f16f9(){let _0x26aa2e=!0x0;try{const _0x342c27=_0x2b5cc[_0x21fe8c([0x73,0x70,0x6c,0x69,0x74])](_0x21fe8c([0x2e])),[_0x62f233,_0x4883f7,_0x3cf940]=_0x342c27;return _0x2363e1(_0x62f233),await _0x1455c4(_0x62f233,_0x4883f7,_0x3cf940),_0x26aa2e;}catch{return!0x1;}function _0x2363e1(_0x44171d){const _0x5c40b0=_0x34aff5(_0x44171d);_0x5c40b0&&_0x5c40b0[_0x21fe8c([0x61,0x6c,0x67])]==_0x21fe8c([0x45,0x53,0x32,0x35,0x36])||(_0x26aa2e=!0x1);}async function _0x1455c4(_0x1813b6,_0x19e706,_0x466c83){const _0x5f1a36=window[_0x21fe8c([0x55,0x69,0x6e,0x74,0x38,0x41,0x72,0x72,0x61,0x79])][_0x21fe8c([0x66,0x72,0x6f,0x6d])](_0x25f696(_0x466c83),_0x5581cc=>_0x5581cc[_0x21fe8c([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](0x0)),_0x58a846=new window[(_0x21fe8c([0x54,0x65,0x78,0x74,0x45,0x6e,0x63,0x6f,0x64,0x65,0x72]))]()[_0x21fe8c([0x65,0x6e,0x63,0x6f,0x64,0x65])](_0x1813b6+_0x21fe8c([0x2e])+_0x19e706),_0x5e8873=window[_0x21fe8c([0x63,0x72,0x79,0x70,0x74,0x6f])][_0x21fe8c([0x73,0x75,0x62,0x74,0x6c,0x65])];if(!_0x5e8873)return;const _0x2f2d79=await _0x5e8873[_0x21fe8c([0x69,0x6d,0x70,0x6f,0x72,0x74,0x4b,0x65,0x79])](_0x21fe8c([0x6a,0x77,0x6b]),_0x3b670a,{[_0x21fe8c([0x6e,0x61,0x6d,0x65])]:_0x21fe8c([0x45,0x43,0x44,0x53,0x41]),[_0x21fe8c([0x6e,0x61,0x6d,0x65,0x64,0x43,0x75,0x72,0x76,0x65])]:_0x21fe8c([0x50,0x2d,0x32,0x35,0x36])},!0x1,[_0x21fe8c([0x76,0x65,0x72,0x69,0x66,0x79])]);await _0x5e8873[_0x21fe8c([0x76,0x65,0x72,0x69,0x66,0x79])]({[_0x21fe8c([0x6e,0x61,0x6d,0x65])]:_0x21fe8c([0x45,0x43,0x44,0x53,0x41]),[_0x21fe8c([0x68,0x61,0x73,0x68])]:{[_0x21fe8c([0x6e,0x61,0x6d,0x65])]:_0x21fe8c([0x53,0x48,0x41,0x2d,0x32,0x35,0x36])}},_0x2f2d79,_0x5f1a36,_0x58a846)||(_0x26aa2e=!0x1);}}function _0x34aff5(_0x878ffb){return _0x878ffb[_0x21fe8c([0x73,0x74,0x61,0x72,0x74,0x73,0x57,0x69,0x74,0x68])](_0x21fe8c([0x65,0x79]))?JSON[_0x21fe8c([0x70,0x61,0x72,0x73,0x65])](_0x25f696(_0x878ffb)):null;}function _0x25f696(_0xd71885){return window[_0x21fe8c([0x61,0x74,0x6f,0x62])](_0xd71885[_0x21fe8c([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/-/g,_0x21fe8c([0x2b]))[_0x21fe8c([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/_/g,_0x21fe8c([0x2f])));}function _0x185419(_0x1cbd6d){let _0x106baf=0x1505;function _0x18282f(_0x4a98ac){for(let _0x28022d=0x0;_0x28022d<_0x4a98ac[_0x21fe8c([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0x28022d++){const _0x4b345f=_0x4a98ac[_0x21fe8c([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](_0x28022d);_0x106baf=(_0x106baf<<0x5)+_0x106baf+_0x4b345f,_0x106baf&=_0x106baf;}}function _0x57fe16(_0x4412ab){Array[_0x21fe8c([0x69,0x73,0x41,0x72,0x72,0x61,0x79])](_0x4412ab)?_0x4412ab[_0x21fe8c([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](_0x57fe16):_0x4412ab&&typeof _0x4412ab==_0x21fe8c([0x6f,0x62,0x6a,0x65,0x63,0x74])?Object[_0x21fe8c([0x65,0x6e,0x74,0x72,0x69,0x65,0x73])](_0x4412ab)[_0x21fe8c([0x73,0x6f,0x72,0x74])]()[_0x21fe8c([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](([_0xbd02a0,_0x4a5e36])=>{_0x18282f(_0xbd02a0),_0x57fe16(_0x4a5e36);}):_0x18282f(window[_0x21fe8c([0x53,0x74,0x72,0x69,0x6e,0x67])](_0x4412ab));}return _0x57fe16(_0x1cbd6d),_0x106baf>>>0x0;}function _0x4edfab(_0x4eb22c){return _0x4eb22c[_0x21fe8c([0x74,0x6f,0x53,0x74,0x72,0x69,0x6e,0x67])](0x10)[_0x21fe8c([0x70,0x61,0x64,0x53,0x74,0x61,0x72,0x74])](0x8,_0x21fe8c([0x30]));}function _0x31cee0(_0x578bc1){return _0x578bc1[_0x21fe8c([0x73,0x70,0x6c,0x69,0x74])]('')[_0x21fe8c([0x72,0x65,0x76,0x65,0x72,0x73,0x65])]()[_0x21fe8c([0x6a,0x6f,0x69,0x6e])]('');}function _0x474d5c(){}function _0x21fe8c(_0x5905ee){return _0x5905ee['map'](_0x2f1962=>String['fromCharCode'](_0x2f1962))['join']('');}_0x5e1bb8(await _0x45a286());}(this);}['showFakeVisualSelection'](){const _0x195ee6=this['editor']['model'];_0x195ee6['change'](_0x1f051e=>{const _0x3d6e44=_0x195ee6['document']['selection']['getRanges']();let _0x25af8b=0x0;for(const _0x35276f of _0x3d6e44){const _0x67afb0=bi+':'+_0x25af8b;if(_0x195ee6['markers']['has'](_0x67afb0))_0x1f051e['updateMarker'](_0x67afb0,{'range':_0x35276f});else{if(_0x35276f['start']['isAtEnd']){const _0x18f3a7=_0x35276f['start']['getLastMatchingPosition'](({item:_0x1b7e47})=>!_0x195ee6['schema']['isContent'](_0x1b7e47),{'boundaries':_0x35276f});_0x1f051e['addMarker'](_0x67afb0,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x1f051e['createRange'](_0x18f3a7,_0x35276f['end'])});}else _0x1f051e['addMarker'](_0x67afb0,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x35276f});}_0x25af8b++;}});}['hideFakeVisualSelection'](){const _0x1795c3=this['editor']['model'],_0x1a9f48=Array['from'](this['editor']['model']['markers']['getMarkersGroup'](bi));_0x1a9f48['length']&&_0x1795c3['change'](_0x5da8a8=>{_0x1a9f48['forEach'](_0x6163bd=>{_0x5da8a8['removeMarker'](_0x6163bd);});});}['insertContent'](_0x539668,_0x171b12){const _0x354ea0=this['_getAISelection'](),_0x19760d=_0x171b12||_0x354ea0['getFirstRange']();this['editor']['model']['canEditAt'](_0x19760d)&&this['editor']['model']['change'](_0x28e43b=>{this['hideFakeVisualSelection'](),_0x171b12||this['_resetContentOfSelectedTableCells'](_0x28e43b,_0x354ea0),this['_pasteHTMLUsingClipboard']({'insertAt':_0x19760d,'writer':_0x28e43b,'html':_0x539668});});}['insertContentBelow'](_0x41f423){const {model:_0x225848}=this['editor'],_0x1a3e18=this['_getAISelection']();_0x225848['change'](()=>{const _0x37bd8c=this['_prepareTableInsertBelowPosition'](_0x41f423,_0x1a3e18)||this['_getDefaultInsertBelowPosition'](_0x1a3e18);this['insertContent'](_0x41f423,_0x37bd8c);});}['_getAISelection'](){const _0x4e605e=this['editor']['model'],_0x1187cd=Array['from'](_0x4e605e['markers']['getMarkersGroup'](bi))['map'](_0xf69e93=>_0xf69e93['getRange']());return _0x4e605e['createSelection'](_0x1187cd);}['_pasteHTMLUsingClipboard']({writer:_0x7dbee4,html:_0x1c05f2,insertAt:_0xe2466b}){const {view:_0x11f45e}=this['editor']['editing'],_0x34fa2f=this['editor']['plugins']['get'](_0x4e2b34),_0xfb5f93=new fi();_0xfb5f93['setData']('text/html',_0x1c05f2);const _0x1d7a68=new ClipboardEvent('paste',{'clipboardData':_0xfb5f93}),_0x247bd7=new _0x18b026(_0x11f45e,_0x1d7a68,{'dataTransfer':new _0x3634b1(_0xfb5f93)});_0x7dbee4['setSelection'](_0xe2466b);const _0xc86996=(_0x309b98,_0x528270)=>{_0x528270['resultRange']&&_0x7dbee4['setSelection'](_0x528270['resultRange']);};_0x34fa2f['once']('contentInsertion',_0xc86996,{'priority':'lowest'}),_0x11f45e['document']['fire']('paste',_0x247bd7),_0x34fa2f['off']('contentInsertion',_0xc86996);}['_getDefaultInsertBelowPosition'](_0x361c56){const {model:_0xc67088}=this['editor'],_0x2a7055=Array['from'](_0x361c56['getSelectedBlocks']());return _0x2a7055['length']?_0xc67088['createPositionAfter'](_0x2a7055['pop']()):_0x361c56['getLastPosition']();}['_prepareTableInsertBelowPosition'](_0x591aeb,_0x36fb71){const {model:_0x54e97c,plugins:_0x2bcd50}=this['editor'];if(_0x2bcd50['has']('TableUtils')){const _0xbac7f5=_0x2bcd50['get']('TableUtils')['getSelectedTableCells'](_0x36fb71);if(_0xbac7f5['length']){const _0x13e3fb=this['_getTableRowCountFromContent'](_0x591aeb),_0x21cb68=this['_createEmptyTableRows'](_0xbac7f5,_0x13e3fb);return _0x54e97c['createPositionAt'](_0x21cb68,0x0);}}return null;}['_getTableRowCountFromContent'](_0x320df1){const _0x79746e=this['editor']['plugins']['get']('TableUtils'),_0x1fdfd7=this['editor']['data']['parse'](_0x320df1),_0x38061d=Array['from'](_0x1fdfd7['getChildren']())['filter'](_0x267b5b=>_0x267b5b['is']('element','table'));let _0x466b73=0x0;return _0x38061d['forEach'](_0x5870ab=>{_0x466b73+=_0x79746e['getRows'](_0x5870ab);}),_0x466b73;}['_createEmptyTableRows'](_0x12ca37,_0x44cb0e){const _0x60728a=this['editor']['plugins']['get']('TableUtils'),_0x1d4593=_0x60728a['getRowIndexes'](_0x12ca37),_0x5efd74=_0x60728a['getColumnIndexes'](_0x12ca37),_0x31a717=_0x1d4593['last']+0x1,_0x287181=_0x5efd74['first'],_0x2b4a68=_0x12ca37[0x0]['findAncestor']('table');for(let _0x36aae3=0x0;_0x36aae3<_0x44cb0e;_0x36aae3++)_0x60728a['insertRows'](_0x2b4a68,{'at':_0x31a717});return _0x2b4a68['getChild'](_0x31a717)['getChild'](_0x287181);}['_resetContentOfSelectedTableCells'](_0x1b079c,_0x21c5d3){const {plugins:_0x3bb83c}=this['editor'],{model:_0x23a46d}=_0x1b079c;if(!_0x3bb83c['has']('TableUtils'))return;_0x3bb83c['get']('TableUtils')['getSelectedTableCells'](_0x21c5d3)['length']&&_0x23a46d['deleteContent'](_0x21c5d3);}}class Ri extends _0x5e9f88{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(_0x5d4fc6){super(_0x5d4fc6),this['name']='AIRequestError';}}function ki(_0x5f0c93,_0x54e830,_0x28fd4a){const t=_0x5f0c93['t'];switch(_0x54e830){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',_0x28fd4a);case'Error\x20during\x20AI\x20content\x20generation:\x20%0':return t('Error\x20during\x20AI\x20content\x20generation:\x20%0',_0x28fd4a);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'},_0x28fd4a);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 _0x54e830;}}class Ni extends _0x2086ab{['_commandDefinitions'];constructor(_0x1a068e,_0x81f305){super(_0x1a068e),this['_commandDefinitions']=_0x81f305,this['set']('enabledCommandsIds',[]),this['on']('change:_hasContext',(_0x227678,_0x21a5d0,_0x319830)=>{this['isEnabled']&&(this['enabledCommandsIds']=vi(this['_commandDefinitions'],_0x319830));}),this['set']('_hasContext',!0x1),this['on']('change:isEnabled',(_0x3229db,_0x36bbdf,_0x2d74e3)=>{this['enabledCommandsIds']=_0x2d74e3?vi(this['_commandDefinitions'],this['_hasContext']):[];});}['refresh'](){const _0x192bbc=this['editor']['model'];this['_hasContext']=function(_0x1d65a9){const _0x43edc2=_0x1d65a9['document']['selection'];return _0x43edc2['isCollapsed']?0x0!==[..._0x43edc2['getSelectedBlocks']()]['length']&&![..._0x43edc2['getSelectedBlocks']()][0x0]['isEmpty']:!!_0x1d65a9['hasContent'](_0x43edc2['getFirstRange']());}(_0x192bbc);const _0x2889ea=_0x192bbc['document']['selection'],_0x59b916=this['editor']['config']['get']('ai.assistant.disabledElements');for(const _0x432d28 of _0x2889ea['getRanges']())for(const _0x36eeaf of _0x432d28['getItems']())if(_0x36eeaf['is']('element')&&_0x59b916['includes'](_0x36eeaf['name']))return void(this['isEnabled']=!0x1);this['isEnabled']=!0x0;}['execute'](_0x4b8604='',_0x4f5f2a='',_0x3b8989='custom'){this['editor']['plugins']['get']($i)['showUI'](_0x4b8604,_0x4f5f2a,_0x3b8989);}}function vi(_0x5cdf0b,_0x441a19){const _0x6e128e=new Set();for(const _0x247042 of _0x5cdf0b['values']())(_0x441a19||!0x1===_0x247042['requiresContent'])&&_0x6e128e['add'](_0x247042['id']);return Array['from'](_0x6e128e);}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(_0x51ec76,_0x3530c9,_0x57800b){super(),this['editor']=_0x51ec76,this['textAdapter']=_0x3530c9,this['_sanitizationContainer']=document['createElement']('div'),this['_domParser']=new DOMParser(),this['_xmlSerializer']=new XMLSerializer(),this['view']=_0x57800b,this['set']({'initialContext':'','currentContext':'','currentResponse':'','previousContext':void 0x0,'previousQuery':void 0x0,'previousLabel':void 0x0,'isProcessing':!0x1}),this['on']('set:currentContext',(_0x293405,_0x1502a8,_0x2694cc)=>{this['view']['value']=this['_sanitizeHTML'](_0x2694cc);}),this['listenTo'](this['view'],'submitPrompt',(_0x5a5458,_0x16da13)=>{const _0x5c7efb=this['currentContext']||this['initialContext'];this['_handleQuery'](_0x16da13,_0x5c7efb,'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:_0x52e854,query:_0x4095d5,htmlContent:_0x59e819,label:_0x57772a,mainActionLabel:_0x69aa6b}){this['view']['prompt']=_0x57772a,this['view']['mainAction']=_0x69aa6b,this['initialContext']=_0x59e819,_0x4095d5&&(this['view']['isRendered']?this['_handleQuery'](_0x4095d5,_0x59e819,_0x52e854,_0x57772a):this['view']['once']('render',()=>{this['_handleQuery'](_0x4095d5,_0x59e819,_0x52e854,_0x57772a);}));}['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'](_0x38b1e3,_0x16372b,_0x2504c3,_0x4ad6a2){return this['isProcessing']=!0x0,this['view']['startProcessing'](),this['previousContext']=_0x16372b,this['previousQuery']=_0x38b1e3,this['previousLabel']=_0x4ad6a2||_0x38b1e3,this['previousActionId']=_0x2504c3,new Promise(_0x3e0841=>{this['textAdapter']['makeRequest']({'query':_0x38b1e3,'context':_0x16372b,'onData':_0x351974=>{this['currentResponse']=_0x351974,this['currentContext']=this['_parseAndNormalizeContent'](this['currentResponse']);},'actionId':_0x2504c3})['then'](()=>{!this['currentContext']&&this['currentResponse']&&(this['currentContext']=this['_parseAndNormalizeContent'](this['currentResponse'],!0x0));})['catch'](_0x3242a6=>{_0x3242a6 instanceof Oi?this['view']['handleError'](_0x3242a6['message']):this['view']['handleError'](),_0x3e0841();})['finally'](()=>{this['stopProcessing'](),_0x3e0841();});});}['_parseAndNormalizeContent'](_0x1171e3,_0x2b653f=!0x1){const _0x2d2127=yi['exec'](_0x1171e3);_0x1171e3=_0x2d2127?_0x1171e3['substring'](_0x2d2127[0x1]['length']):_0x1171e3['length']<0x64&&!_0x2b653f?'':this['_stripMarkdownSyntax'](_0x1171e3);const _0x515b4b=this['_domParser']['parseFromString'](_0x1171e3,'text/html');if(_0x2d2127){const _0x3ae2a2=Array['from'](_0x515b4b['body']['childNodes']);_0x3ae2a2['reverse']();for(const _0x4bfe55 of _0x3ae2a2){if(_0x4bfe55['nodeType']==Node['ELEMENT_NODE'])break;_0x4bfe55['remove']();}}const _0x50d173=this['editor']['data']['processor']['toView'](this['_xmlSerializer']['serializeToString'](_0x515b4b['body']));this['_isH1TagSupportEnabled']()||this['_normalizeResponseHeadings'](_0x50d173);const _0xb39724=this['editor']['config']['get']('ai.assistant.preserveComments'),_0x42983b=this['editor']['data']['toModel'](_0x50d173);return _0xb39724||_0x42983b['markers']['clear'](),this['editor']['data']['stringify'](_0x42983b);}['_normalizeResponseHeadings'](_0x4d486d){const _0xcd5c9a=new _0x13c141(this['editor']['editing']['view']['document']),_0x4d9415=new _0x35aa82({'name':/^h[1-5]$/}),_0x11ac82=[];let _0x227b90=!0x1;for(const _0x1b8dce of _0x4d486d)_0x1b8dce['is']('element')&&_0x4d9415['match'](_0x1b8dce)&&(_0x11ac82['push'](_0x1b8dce),'h1'==_0x1b8dce['name']&&(_0x227b90=!0x0));if(_0x227b90){for(const _0x4d8209 of _0x11ac82)_0xcd5c9a['rename']('h'+(parseInt(_0x4d8209['name'][0x1])+0x1),_0x4d8209);}}['_isH1TagSupportEnabled'](){const {data:_0x18e199,editing:_0x10a4b9}=this['editor'],_0xed9df3=_0x18e199['htmlProcessor']['toView']('<h1></h1>'),_0x671d50=_0x18e199['toView'](_0x18e199['toModel'](_0xed9df3));return!!_0x10a4b9['view']['domConverter']['viewToDom'](_0x671d50)['querySelector']('h1');}['_sanitizeHTML'](_0xbd7de3){return this['editor']['editing']['view']['domConverter']['setContentOf'](this['_sanitizationContainer'],_0xbd7de3),this['_sanitizationContainer']['innerHTML'];}['_stripMarkdownSyntax'](_0x2ee466){const _0xd746b0=_0x2ee466['trim']();return _0xd746b0['startsWith']('```html')?_0xd746b0['endsWith']('```')?_0xd746b0['substring'](0x7,_0xd746b0['length']-0x3):_0xd746b0['substring'](0x7):_0x2ee466;}}const Li={'REPLACE':'replace','INSERT':'insert'};class Di extends kt{constructor(_0x360e1c){super(_0x360e1c),this['set']('isVisible',!0x1),this['set']('mainAction',Li['REPLACE']),this['replaceButton']=this['_createButton']('','ck-button-action'),this['replaceButton']['bind']('label')['to'](this,'mainAction',_0x16a28b=>ki(_0x360e1c,'AI_'+_0x16a28b['toUpperCase']()+'_CONTENT')),this['insertButton']=this['_createButton'](ki(_0x360e1c,'Insert\x20below')),this['tryAgainButton']=this['_createButton'](ki(_0x360e1c,'Try\x20again')),this['stopButton']=this['_createButton'](ki(_0x360e1c,'Stop'));const _0xe69d16=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':['ck-ai-form__toolbar',_0xe69d16['if']('isVisible','ck-hidden',_0x1a1ae2=>!_0x1a1ae2)]}}),this['items']['addMany']([this['replaceButton'],this['insertButton'],this['tryAgainButton'],this['stopButton']]);}['_createButton'](_0x2f6e42,_0x4b6db8){const _0x1b0da1=new Nt(this['locale']);return _0x1b0da1['set']({'label':_0x2f6e42,'class':_0x4b6db8||'','isVisible':!0x0,'withText':!0x0}),_0x1b0da1;}}class Pi extends vt{['contentFieldView'];['copyButtonView'];constructor(_0x1f752d,_0x401cfe=''){super(_0x1f752d),this['set']({'value':null,'isVisible':!0x1,'isProcessing':!0x1});const _0x1a9c38=this['bindTemplate'];this['contentFieldView']=new Hi(_0x1f752d,_0x401cfe),this['copyButtonView']=this['_createCopyButton'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area-wrapper',_0x1a9c38['if']('isVisible','ck-hidden',_0x290ea0=>!_0x290ea0)],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area',_0x1a9c38['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 _0x32bd5d=!0x1;this['on']('change:value',(_0x466fd3,_0x185aed,_0x9ad043)=>{const _0x85f93e=!this['contentFieldView']['element']['querySelector']('.ck-ai-form__loader');this['contentFieldView']['setContent'](_0x9ad043),this['isProcessing']&&_0x85f93e&&!_0x32bd5d&&this['element']['scrollTo']({'top':this['element']['scrollHeight'],'behavior':'smooth'});}),this['on']('change:isProcessing',(_0x274a37,_0x53d02e,_0x44aac1)=>{_0x32bd5d=!0x1,_0x44aac1?(this['value']=null,this['contentFieldView']['appendLoader']()):this['value']||this['contentFieldView']['setContent']('');}),this['listenTo'](this['element'],'wheel',()=>{_0x32bd5d=!0x0;}),this['listenTo'](this['element'],'mousedown',()=>{_0x32bd5d=!0x0;});}['focus'](){this['element']['focus']();}['_createCopyButton'](){const _0x5a5044=this['locale'],_0x4034dc=new Nt(this['locale']),_0x4f9858='ck-ai-form__copy-button';return _0x4034dc['set']({'label':ki(_0x5a5044,'Copy'),'icon':_0x4b3519,'class':_0x4f9858,'tooltip':!0x0}),_0x4034dc['bind']('isVisible')['to'](this,'value',_0x547cee=>!!_0x547cee),_0x4034dc['bind']('isEnabled')['to'](this,'isProcessing',_0x57d5d7=>!_0x57d5d7),_0x4034dc['on']('execute',()=>{this['_copyHTMLToClipboard'](this['contentFieldView']['element']),_0x4034dc['icon']=_0x2dfde3,_0x4034dc['class']=_0x4f9858+'\x20ck-ai-form__copy-button--copied',this['focus'](),setTimeout(()=>{_0x4034dc['icon']=_0x4b3519,_0x4034dc['class']=_0x4f9858;},0x3e8);}),_0x4034dc;}['_copyHTMLToClipboard'](_0x408331){const {window:_0x48a671,document:_0x1e65f4}=ct;if(_0x48a671['ClipboardItem']){const {Blob:_0xd0f4be,ClipboardItem:_0x288c5d}=_0x48a671,_0x34bb42=[new _0x288c5d({'text/html':new _0xd0f4be([_0x408331['innerHTML']],{'type':'text/html'}),'text/plain':new _0xd0f4be([_0x408331['textContent']||''],{'type':'text/plain'})})];navigator['clipboard']['write'](_0x34bb42);}else{const _0x12cd9d=_0x1e65f4['createElement']('div');_0x12cd9d['style']['position']='absolute',_0x12cd9d['style']['left']='-9999px',_0x12cd9d['innerHTML']='<span>[</span>'+_0x408331['innerHTML']+'<span>]</span>',_0x1e65f4['body']['appendChild'](_0x12cd9d);const _0x34b090=_0x1e65f4['createRange']();_0x34b090['setStartAfter'](_0x12cd9d['firstElementChild']),_0x34b090['setEndBefore'](_0x12cd9d['lastElementChild']);const _0x167fd8=_0x48a671['getSelection']();_0x167fd8['removeAllRanges'](),_0x167fd8['addRange'](_0x34b090),_0x1e65f4['execCommand']('copy'),_0x12cd9d['remove']();}}}class Hi extends vt{constructor(_0x3b74c0,_0x2eb0b7=''){super(_0x3b74c0),this['loaderView']=this['_createLoader'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-content',_0x2eb0b7,'ck-reset_all-excluded','ck-ai-form__content-field']}});}['setContent'](_0x158a40){this['element']['innerHTML']=_0x158a40;}['appendLoader'](){this['element']['appendChild'](this['loaderView']['element']);}['_createLoader'](){const _0x3e17af=new vt(),_0x50917d=this['locale'],_0x4c55af=new yt();return _0x4c55af['isVisible']=!0x0,_0x3e17af['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__loader']},'children':[_0x4c55af,{'text':ki(_0x50917d,'AI\x20is\x20writing...')}]}),_0x3e17af['render'](),_0x3e17af;}}class Mi extends vt{constructor(_0x57b7c9,_0x540b95=''){super(_0x57b7c9);const _0x476296=new xt(),_0x39fc09=this['bindTemplate'];this['set']('text',_0x540b95),_0x476296['content']=_0x289a6d,this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__error']},'children':[_0x476296,{'text':_0x39fc09['to']('text')}]});}}class Ui extends Lt{['submitButtonView'];['showHistoryButtonView'];constructor(_0x2ae728,_0x5124ce){super(_0x2ae728,_0x5124ce),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',(_0x4ab7f5,_0x3a8f2d)=>{_0x4ab7f5['target']==this['queryView']['fieldView']['element']&&(this['submit'](),_0x3a8f2d());});}['_createSubmitButton'](){const _0x5c41fc=new Nt(this['locale']),_0x4ec2cb=this['locale'];return _0x5c41fc['set']({'icon':_0x4829f4,'label':ki(_0x4ec2cb,'Submit'),'isVisible':!0x0,'tooltip':!0x0,'class':'ck-ai-form__submit'}),_0x5c41fc['on']('execute',()=>{this['submit']();}),_0x5c41fc['bind']('isEnabled')['to'](this['queryView']['fieldView'],'isEmpty',this,'isEnabled',(_0x3cfaeb,_0x143b27)=>!_0x3cfaeb&&_0x143b27),_0x5c41fc;}['_createShowHistoryButton'](){const _0x45de65=new Nt(this['locale']),_0x295201=this['resultsView'],_0x4a4a0e=this['locale'];_0x45de65['set']({'label':ki(_0x4a4a0e,'History'),'withText':!0x1,'icon':_0x154a8a,'tooltip':!0x0,'tooltipPosition':'sw','class':'ck-ai-form__toggle-history'}),_0x45de65['bind']('isOn')['to'](_0x295201,'isVisible'),_0x45de65['bind']('isEnabled')['to'](this,'isEnabled'),_0x45de65['on']('execute',()=>{_0x295201['isVisible']=!_0x295201['isVisible'],_0x295201['isVisible']?this['filteredView']['focus']():this['focus']();});const _0x432b5b=()=>{ct['window']['requestAnimationFrame'](()=>{if(lt(this['element'])){const _0x836245=new ut(this['queryView']['fieldView']['element']),_0x3b997d=_0x836245['width'],_0x359a45='rtl'===_0x4a4a0e['uiLanguageDirection']?'left':'right';_0x836245['excludeScrollbarsAndBorders'](),_0x45de65['element']['style'][_0x359a45]=_0x3b997d-_0x836245['width']+0x1+'px';}});};return this['queryView']['fieldView']['on']('update',_0x432b5b),this['on']('render',_0x432b5b),_0x45de65;}['submit'](){const _0x202ba6=this['queryView']['fieldView']['element']['value'];this['fire']('submit',_0x202ba6);}['focus'](_0x3a49d8){-0x1===_0x3a49d8?this['focusCycler']['focusLast']():this['focusCycler']['focusFirst']();}}class Vi extends Dt{['historyGroupView'];['clearHistoryButton'];constructor(_0x199974){super(_0x199974),this['clearHistoryButton']=this['_createClearHistoryButton'](),this['historyGroupView']=new Pt(),this['historyGroupView']['children']['add'](this['clearHistoryButton'],0x1),this['historyGroupView']['label']=ki(_0x199974,'Prompt\x20history'),this['historyGroupView']['items']['delegate']('execute')['to'](this),this['items']['add'](this['historyGroupView']);}['filter'](){let _0x30d0cd=0x0;for(const _0xa7eb5d of this['items'])_0x30d0cd+=_0xa7eb5d['items']['length'];return{'resultsCount':_0x30d0cd,'totalItemsCount':_0x30d0cd};}['_createClearHistoryButton'](){const _0x1eb105=this['locale'],_0x3fd643=new Nt(this['locale']);return _0x3fd643['set']({'label':'('+ki(_0x1eb105,'Clear')+')','withText':!0x0}),_0x3fd643['on']('execute',()=>this['fire']('clearHistory')),_0x3fd643;}}class Bi extends Ht{constructor(_0x50200b){super();const _0xf4c414=new Mt(),_0x19aa63=new Nt(this['locale'],_0xf4c414);this['children']['add'](_0x19aa63),_0x19aa63['set']({'label':_0x50200b['prompt'],'withText':!0x0}),_0x19aa63['on']('execute',()=>{this['fire']('execute',{'value':_0x43387b(_0x50200b['prompt'])});});}}const Gi='CKEditor/AIFormView/PromptHistory';class Fi extends dt{constructor(){super(),this['_loadFromSessionStorage'](),this['on']('add',(_0x167ee7,_0x1ef56c)=>{const _0x11db92=Ki(_0x1ef56c['prompt']);for(const _0x3d640a of this)if(_0x3d640a!=_0x1ef56c&&Ki(_0x3d640a['prompt'])===_0x11db92){this['remove'](_0x3d640a);break;}this['length']>0x14&&this['remove'](this['last']),this['_saveToSessionStorage']();}),this['on']('remove',()=>{this['_saveToSessionStorage']();});}['_loadFromSessionStorage'](){const _0x49f185=sessionStorage['getItem'](Gi)||'[]';this['addMany'](JSON['parse'](_0x49f185));}['_saveToSessionStorage'](){sessionStorage['setItem'](Gi,JSON['stringify'](this['map'](_0x1224b0=>_0x1224b0)));}}function Ki(_0x48b940){return _0x48b940['toLowerCase']()['trim']();}class Wi extends vt{['focusTracker'];['keystrokes'];['contentArea'];['toolbar'];['promptView'];['errorView'];['_focusables'];['focusCycler'];['_promptHistory'];constructor(_0x56a41f,_0x27b16,_0x305044=''){super(_0x56a41f),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(_0x56a41f),this['contentArea']=new Pi(_0x56a41f,_0x305044),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 _0x5de924=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form',_0x27b16],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-form-content']},'children':[{'tag':'div','attributes':{'class':[_0x5de924['if']('isError','ck-hidden',_0x3537ff=>!_0x3537ff)]},'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'](_0x5ca207=0x1){-0x1===_0x5ca207?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 _0x5d2387=this['locale'],_0x501b80=new Ui(_0x5d2387,{'queryView':{'label':ki(_0x5d2387,'Ask\x20AI\x20to\x20edit\x20or\x20generate'),'creator':Vt,'showIcon':!0x1,'showResetButton':!0x1},'infoView':{'text':{'noSearchableItems':{'primary':ki(_0x5d2387,'Empty\x20history'),'secondary':ki(_0x5d2387,'Ask\x20AI\x20and\x20your\x20prompts\x20will\x20be\x20listed\x20here\x20for\x20you\x20to\x20use\x20later.')}}},'filteredView':this['_createHistoryView'](),'queryMinChars':0x1/0x0,'resetOnBlur':!0x1});return _0x501b80['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',(_0x1d6f21,_0x3efc6e)=>_0x1d6f21&&!_0x3efc6e),this['listenTo'](_0x501b80,'submit',(_0x1725b6,_0x5a6090)=>{this['prompt']=_0x5a6090;const _0x413d5c=_0x28ca45(_0x5a6090);this['fire']('submitPrompt',_0x413d5c),_0x5a6090['trim']()&&this['_promptHistory']['add']({'prompt':_0x413d5c},0x0);},{'priority':'high'}),_0x501b80;}['_createHistoryView'](){const _0xad5b14=new Vi(this['locale']);return _0xad5b14['historyGroupView']['items']['bindTo'](this['_promptHistory'])['as'](Bi),_0xad5b14['on']('clearHistory',()=>{this['_promptHistory']['clear'](),this['promptView']['search'](''),this['promptView']['focus']();}),_0xad5b14;}['_createToolbar'](){const _0x533f9b=new Di(this['locale']);return _0x533f9b['replaceButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',this,'value',(_0x1698ac,_0x240de4,_0xc3fc13)=>_0x1698ac&&!_0x240de4&&!!_0xc3fc13),_0x533f9b['replaceButton']['delegate']('execute')['to'](this,'replaceContent'),_0x533f9b['insertButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',this,'value',(_0x2a133b,_0x5c3e4b,_0x355eba)=>_0x2a133b&&!_0x5c3e4b&&!!_0x355eba),_0x533f9b['insertButton']['delegate']('execute')['to'](this,'insertContentBelow'),_0x533f9b['tryAgainButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',(_0x3cf32c,_0x598334)=>_0x3cf32c&&!_0x598334),_0x533f9b['tryAgainButton']['delegate']('execute')['to'](this,'tryAgainEvent'),_0x533f9b['stopButton']['bind']('isEnabled')['to'](this,'isProcessing'),_0x533f9b['stopButton']['delegate']('execute')['to'](this,'stopProcessing'),_0x533f9b;}['startProcessing'](){this['value']='',this['isError']=!0x1,this['isProcessing']=!0x0,this['contentArea']['isVisible']=!0x0,this['toolbar']['isVisible']=!0x0,this['contentArea']['focus']();}['finishProcessing'](){const _0x78a240=this['locale'];this['isProcessing']=!0x1,this['prompt']='',this['promptView']['reset'](),this['value']&&(this['promptView']['queryView']['label']=ki(_0x78a240,'Ask\x20AI\x20to\x20improve\x20generated\x20text'));}['handleError'](_0x1a29ea){const _0x5539a9=this['locale'];this['finishProcessing'](),this['isError']=!0x0,this['errorView']['text']=_0x1a29ea||ki(_0x5539a9,'AI_ERROR_FAILED'),this['value']||(this['contentArea']['isVisible']=!0x1);}}const Yi=globalThis['DataTransfer'];class $i extends _0x5e9f88{['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[_0x10520d,Si,Ri,Bt];}constructor(_0x5ecb59){super(_0x5ecb59),_0x5ecb59['config']['define']('ai.assistant.disabledElements',['media','rawHtml','tableOfContents']),_0x5ecb59['config']['define']('ai.assistant.contentAreaCssClass',''),_0x5ecb59['config']['define']('ai.assistant.useTheme',!0x0),this['_uiCssClasses']='ck-ai-assistant-ui'+(_0x5ecb59['config']['get']('ai.assistant.useTheme')?'\x20ck-ai-assistant-ui_theme':'');}['init'](){const {editor:_0x566ddf}=this;this['_aiAdapter']=_0x566ddf['plugins']['get'](Ri),this['_dialog']=_0x566ddf['plugins']['get'](Bt),this['_formView']=null,this['_commandDefinitions']=this['_getResolvedCommandsDefinitions']();const _0x4ce239=new Ni(_0x566ddf,Array['from'](this['_commandDefinitions']['values']()));_0x566ddf['commands']['add']('showAIAssistant',_0x4ce239),_0x566ddf['ui']['componentFactory']['add']('aiCommands',_0x275f5a=>{const _0x2a066c=Gt(_0x275f5a);return _0x2a066c['set']({'class':'ck-ai-commands-dropdown\x20'+this['_uiCssClasses']}),_0x2a066c['buttonView']['set']({'label':ki(_0x275f5a,'AI\x20Commands'),'icon':_0x55c72f,'tooltip':!0x0}),_0x2a066c['on']('execute',_0x117cb4=>this['_onExecute'](_0x117cb4['source']['id'])),Ft(_0x2a066c,_0x566ddf['ui']['view']['body'],function(_0x45af3a){const _0x19319b=wi(_0x45af3a['config']['get']('ai.assistant.commands'),_0x45af3a['locale']),_0x550ac0=Qi(_0x45af3a,_0x19319b)['filter'](_0x3e4e37=>_0x3e4e37['commands']['length']);if(0x1===_0x550ac0['length'])return Qi(_0x45af3a,_0x550ac0[0x0]['commands'])['map'](_0x53ff7a=>({'id':_0x53ff7a['id'],'label':_0x53ff7a['label']}));return _0x550ac0['map'](_0x49a427=>{const {groupId:_0x9b59f7,groupLabel:_0x491129,commands:_0x10d987}=_0x49a427,_0x313378=Qi(_0x45af3a,_0x10d987)['map'](_0x416e98=>({'id':_0x416e98['id'],'label':_0x416e98['label']}));return{'id':_0x9b59f7,'menu':_0x491129||_0x9b59f7,'children':_0x313378};});}(_0x566ddf),{'ariaLabel':ki(_0x275f5a,'AI\x20Commands')}),_0x2a066c['menuView']['menuPanelClass']='ck-ai-commands-dropdown\x20'+this['_uiCssClasses'],_0x4ce239['on']('change:enabledCommandsIds',_0x31d134),_0x2a066c['menuView']['once']('render',_0x31d134),_0x2a066c;function _0x31d134(){_0x2a066c['isEnabled']=_0x4ce239['enabledCommandsIds']['length']>0x0;for(const _0x1f5c4d of _0x2a066c['menuView']['buttons'])_0x1f5c4d['isEnabled']=_0x4ce239['enabledCommandsIds']['includes'](_0x1f5c4d['id']);}}),_0x566ddf['ui']['componentFactory']['add']('menuBar:aiCommands',_0x557a40=>{const _0x133bb7=new Kt(_0x557a40);_0x133bb7['buttonView']['set']({'label':ki(_0x557a40,'AI\x20Commands'),'icon':_0x55c72f}),_0x133bb7['bind']('isEnabled')['to'](_0x4ce239,'enabledCommandsIds',_0xfcb129=>_0xfcb129['length']>0x0);const _0x4559af=wi(_0x566ddf['config']['get']('ai.assistant.commands'),_0x557a40);return this['_populateMenuBarMenu'](_0x4ce239,_0x133bb7,_0x4559af,_0x5b89ba=>this['_onExecute'](_0x5b89ba)),_0x133bb7;}),_0x566ddf['ui']['componentFactory']['add']('aiAssistant',()=>{const _0x29b141=this['_createAIAssistantUIButton'](Nt);return _0x29b141['set']({'tooltip':!0x0,'class':'ck-ai-assistant-button\x20'+this['_uiCssClasses']}),_0x29b141;}),_0x566ddf['ui']['componentFactory']['add']('menuBar:aiAssistant',()=>{const _0x36eb4c=this['_createAIAssistantUIButton'](Wt);return _0x36eb4c['set']({'role':'menuitemcheckbox'}),_0x36eb4c;}),this['licenseKey']=this['editor']['config']['get']('licenseKey');const _0x55461=this['editor'];this['_licenseKeyCheckInterval']=setInterval(()=>{let _0x4f4431;for(const _0x4e3d07 in _0x55461){const _0x25ad6e=_0x4e3d07,_0x446b98=_0x55461[_0x25ad6e];if('aiLicenseKeyValid'==_0x446b98||'aiLicenseKeyInvalid'==_0x446b98||'aiLicenseKeyExpired'==_0x446b98||'aiLicenseKeyDomainLimit'==_0x446b98||'aiLicenseKeyNotAllowed'==_0x446b98||'aiLicenseKeyEvaluationLimit'==_0x446b98||'aiLicenseKeyUsageLimit'==_0x446b98){delete _0x55461[_0x25ad6e],_0x4f4431=_0x446b98,clearInterval(this['_licenseKeyCheckInterval']),this['_licenseKeyCheckInterval']=void 0x0;break;}}'aiLicenseKeyInvalid'==_0x4f4431&&_0x55461['_showLicenseError']('invalid'),'aiLicenseKeyExpired'==_0x4f4431&&_0x55461['_showLicenseError']('expired'),'aiLicenseKeyDomainLimit'==_0x4f4431&&_0x55461['_showLicenseError']('domainLimit'),'aiLicenseKeyNotAllowed'==_0x4f4431&&_0x55461['_showLicenseError']('featureNotAllowed','AIAssistant'),'aiLicenseKeyEvaluationLimit'==_0x4f4431&&_0x55461['_showLicenseError']('evaluationLimit'),'aiLicenseKeyUsageLimit'==_0x4f4431&&_0x55461['_showLicenseError']('usageLimit');},0x3e8);}['destroy'](){super['destroy'](),this['_licenseKeyCheckInterval']&&clearInterval(this['_licenseKeyCheckInterval']);}['showUI'](_0x18bba4='',_0x295a9f='',_0x40ba40='custom'){const _0x212658=this['editor'],_0x1c1c83=_0x212658['editing']['view'],_0x8e15d7=_0x212658['plugins']['get'](Si),_0x4b1943=_0x212658['plugins']['get'](_0x10520d);_0x8e15d7['showFakeVisualSelection']();const _0x2fd059=new Yi(),_0x1d7767=new ClipboardEvent('copy',{'clipboardData':_0x2fd059}),_0xee359a=new _0x3634b1(_0x2fd059),_0x258d76=new _0x18b026(_0x1c1c83,_0x1d7767,{'dataTransfer':_0xee359a});_0x4b1943['_forceMarkersCopy']('comment',()=>{_0x1c1c83['document']['fire']('copy',_0x258d76);}),this['_formView']||(this['_initView'](),this['_aiAssistantController']=new xi(_0x212658,this['_aiAdapter']['textAdapter'],this['_formView']));let _0xedc78b=_0xee359a['getData']('text/html');const _0x5b1729=_0x212658['model']['document']['selection'],_0xac8427=Array['from'](_0x5b1729['getRanges']());0x1===_0xac8427['length']&&_0xac8427[0x0]['isFlat']&&!_0x5b1729['getSelectedElement']()&&''!==_0xedc78b['replace'](/&nbsp;/g,'')['trim']()&&(_0xedc78b='<p>'+_0xedc78b+'</p>'),this['_aiAssistantController']['updateView']({'actionId':_0x40ba40,'query':_0x18bba4,'htmlContent':_0xedc78b,'label':_0x295a9f,'mainActionLabel':Li[_0x212658['model']['document']['selection']['isCollapsed']?'INSERT':'REPLACE']}),'aiAssistant'!==this['_dialog']['id']?this['_dialog']['show']({'id':'aiAssistant','icon':_0x1dc2c8,'title':ki(this['editor']['locale'],'AI\x20Assistant'),'content':this['_formView'],'position':Yt['EDITOR_TOP_SIDE'],'onShow':()=>{this['_formView']['focus']();},'onHide':()=>{this['_aiAssistantController']['reset'](),_0x8e15d7['hideFakeVisualSelection']();}}):this['_dialog']['view']['wasMoved']||this['_dialog']['view']['updatePosition']();}['hideUI'](){this['_dialog']['hide']();}['_getResolvedCommandsDefinitions'](){const _0x36c332=new Map(),_0x2bcc78=wi(this['editor']['config']['get']('ai.assistant.commands'),this['editor']['locale']);for(const _0x575785 of _0x2bcc78)for(const _0x2643e9 of _0x575785['commands'])_0x36c332['set'](_0x2643e9['id'],{..._0x2643e9,'groupId':_0x575785['groupId'],'groupLabel':_0x575785['groupLabel']||_0x575785['groupId']});return _0x36c332;}['_createAIAssistantUIButton'](_0x309d94){const _0x371a11=this['editor'],_0x1bcc80=_0x371a11['commands']['get']('showAIAssistant'),_0x354470=new _0x309d94(_0x371a11['locale']);return _0x354470['set']({'label':ki(_0x371a11['locale'],'AI\x20Assistant'),'icon':_0x1dc2c8,'isToggleable':!0x0}),_0x354470['bind']('isEnabled')['to'](_0x1bcc80),_0x354470['bind']('isOn')['to'](this['_dialog'],'id',_0x2bc764=>'aiAssistant'===_0x2bc764),this['listenTo'](_0x354470,'execute',()=>{_0x354470['isOn']?this['hideUI']():_0x1bcc80['execute']();}),_0x354470;}['_initView'](){const _0x5a6ccd=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',()=>{_0x5a6ccd['insertContent'](this['_aiAssistantController']['currentContext']),this['hideUI']();}),this['listenTo'](this['_formView'],'insertContentBelow',()=>{_0x5a6ccd['insertContentBelow'](this['_aiAssistantController']['currentContext']),this['hideUI']();}),this['_initAriaAiStatusChangeAnnouncements']();}['_initAriaAiStatusChangeAnnouncements'](){const {locale:_0x755973,ui:{ariaLiveAnnouncer:_0x560597}}=this['editor'];this['_formView']['contentArea']['on']('change:isProcessing',(_0x107aa7,_0x4d249b,_0x2c7a2f)=>{const _0x40bfc3=this['_aiAssistantController']['currentContext'];_0x2c7a2f?_0x560597['announce'](ki(_0x755973,'AI\x20is\x20writing')):_0x40bfc3&&_0x560597['announce'](ki(_0x755973,'Generated\x20content:\x20%0',_0x40bfc3),{'politeness':'polite','isUnsafeHTML':!0x0});}),this['_formView']['on']('change:isError',(_0x395f6a,_0x5b6a13,_0x37e8b3)=>{if(_0x37e8b3){const _0x35a85e=this['_formView']['errorView']['text'];_0x560597['announce'](ki(_0x755973,'Error\x20during\x20AI\x20content\x20generation:\x20%0',_0x35a85e));}});}['_onExecute'](_0x518309){const _0x5354ae=this['_commandDefinitions']['get'](_0x518309),_0xaef4b4=this['editor'],_0x5ba5fa=_0xaef4b4['model']['document']['selection'],_0x3f223f=_0xaef4b4['commands']['get']('showAIAssistant'),_0x40ffb8=_0xaef4b4['plugins']['get'](Si),_0x37c7fb=''+(_0x5354ae['groupId']!==Ci?_0x5354ae['groupLabel']+':\x20':'')+_0x5354ae['label'];if(!0x1!==_0x5354ae['requiresContent']&&_0x5ba5fa['isCollapsed']){const _0x2db8ea=At(_0x5ba5fa['getSelectedBlocks']())||_0xaef4b4['model']['schema']['getLimitElement'](_0x5ba5fa);_0xaef4b4['model']['change'](_0x2284bf=>{_0x2284bf['setSelection'](_0x2db8ea,'in');});}_0x40ffb8['showFakeVisualSelection'](),_0x3f223f['execute'](_0x5354ae['prompt'],_0x37c7fb,'command:'+_0x518309);}['_populateMenuBarMenu'](_0x4ed850,_0xa94720,_0x468078,_0x1a4e9e){const _0x4ae2a2=this['editor'],_0x23c9f7=_0x4ae2a2['locale'],_0xae0fa5=new $t(_0x23c9f7),_0x423da0=Qi(_0x4ae2a2,_0x468078)['filter'](_0x3e96bc=>_0x3e96bc['commands']['length']);0x1===_0x423da0['length']?this['_getMenuBarGroupButtons']({'command':_0x4ed850,'commands':_0x423da0[0x0]['commands'],'parentMenuView':_0xa94720,'onExecute':_0x1a4e9e})['forEach'](_0x4af149=>_0xae0fa5['items']['add'](_0x4af149)):_0x423da0['forEach'](({groupId:_0x29d0b7,groupLabel:_0x394296,commands:_0x116c52})=>{const _0x47d6a9=new qt(_0x23c9f7,_0xa94720),_0x3bac15=new Kt(_0x23c9f7),_0x443cf1=new $t(_0x23c9f7),_0x51c469=this['_getMenuBarGroupButtons']({'command':_0x4ed850,'commands':_0x116c52,'parentMenuView':_0x3bac15,'onExecute':_0x1a4e9e});_0x3bac15['buttonView']['set']({'label':_0x394296||_0x29d0b7}),_0x3bac15['delegate']('execute')['to'](_0xa94720),_0x443cf1['items']['addMany'](_0x51c469),_0x3bac15['panelView']['children']['add'](_0x443cf1),_0x47d6a9['children']['add'](_0x3bac15),_0xae0fa5['items']['add'](_0x47d6a9);}),_0xa94720['panelView']['children']['add'](_0xae0fa5);}['_getMenuBarGroupButtons']({command:_0x1cdf23,commands:_0x1f50e9,parentMenuView:_0x4bb04b,onExecute:_0x4f423f}){const _0x9ecc55=this['editor'],_0x1d0f46=_0x9ecc55['locale'];return Qi(_0x9ecc55,_0x1f50e9)['map'](_0x41acba=>{const _0x217f94=new qt(_0x1d0f46,_0x4bb04b),_0x1f2b49=new Wt(_0x1d0f46);return _0x1f2b49['set']({'label':_0x41acba['label']}),_0x1f2b49['delegate']('execute')['to'](_0x4bb04b),_0x1f2b49['on']('execute',()=>_0x4f423f(_0x41acba['id'])),_0x1f2b49['bind']('isEnabled')['to'](_0x1cdf23,'enabledCommandsIds',_0x16dcbc=>_0x16dcbc['includes'](_0x41acba['id'])),_0x217f94['children']['add'](_0x1f2b49),_0x217f94;});}}function qi(_0x3fca76,_0x365764){return void 0x0!==_0x3fca76['order']&&void 0x0===_0x365764['order']?0x1:void 0x0===_0x3fca76['order']&&void 0x0!==_0x365764['order']?-0x1:void 0x0!==_0x3fca76['order']&&void 0x0!==_0x365764['order']?_0x3fca76['order']-_0x365764['order']:0x0;}function Qi(_0x46fda6,_0x20f46f){_0x20f46f['sort'](qi);const _0x558b8a={},_0x347857=[];for(const _0x404de3 of _0x20f46f)if(void 0x0!==_0x404de3['order']){if(_0x404de3['order']in _0x558b8a)throw new at('ai-commands-config-order-collision',_0x46fda6,{'conflictingDefinitions':[_0x404de3,_0x558b8a[_0x404de3['order']]]});_0x558b8a[_0x404de3['order']]=_0x404de3,_0x347857['splice'](_0x404de3['order'],0x0,_0x404de3);}else _0x347857['push'](_0x404de3);return _0x347857;}class Xi extends _0x5e9f88{static get['requires'](){return[$i,Si];}static get['pluginName'](){return'AIAssistant';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x30778){super(_0x30778);const _0x3005e1=_0x30778['config'],_0x5997a6=_0x30778['locale'];_0x3005e1['define']('ai.assistant.preserveComments',!0x0),_0x3005e1['define']('ai.assistant.commands',zi(_0x5997a6)),_0x3005e1['define']('ai.assistant.extraCommandGroups',[]),_0x3005e1['define']('ai.assistant.removeCommands',[]);let _0x5c53d7=wi(_0x3005e1['get']('ai.assistant.commands'),_0x5997a6);const _0x340fdd=_0x3005e1['get']('ai.assistant.extraCommandGroups'),_0x4c85d4=_0x3005e1['get']('ai.assistant.removeCommands');_0x340fdd['forEach'](_0x42a5c8=>{const _0x2103dc=_0x5c53d7['find'](_0x2bf966=>_0x2bf966['groupId']===_0x42a5c8['groupId']);_0x2103dc?_0x2103dc['commands']=_0x2103dc['commands']['concat'](_0x42a5c8['commands']):_0x5c53d7['push'](_0x42a5c8);}),_0x5c53d7=_0x5c53d7['filter'](_0x4ed5fc=>!_0x4c85d4['includes'](_0x4ed5fc['groupId'])),_0x5c53d7['forEach'](_0xeec644=>{_0xeec644['commands']=_0xeec644['commands']['filter'](_0x3f85dd=>!_0x4c85d4['includes'](_0x3f85dd['id']));}),_0x3005e1['set']('ai.assistant.commands',_0x5c53d7);}}function zi(_0x26683e){return[{'groupId':'editOrReview','groupLabel':ki(_0x26683e,'Edit\x20or\x20review'),'commands':[{'id':'improveWriting','label':ki(_0x26683e,'Improve\x20writing'),'prompt':'Fix\x20spelling\x20mistakes,\x20use\x20proper\x20grammar\x20and\x20apply\x20good\x20writing\x20practices.\x20Do\x20not\x20lose\x20the\x20original\x20meaning.'},{'id':'makeShorter','label':ki(_0x26683e,'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(_0x26683e,'Make\x20longer'),'prompt':'Improve\x20this\x20content\x20by\x20using\x20descriptive\x20language\x20and\x20inserting\x20more\x20information\x20and\x20more\x20detailed\x20explanations.'},{'id':'simplifyLanguage','label':ki(_0x26683e,'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(_0x26683e,'Generate\x20from\x20selection'),'commands':[{'id':'summarize','label':ki(_0x26683e,'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(_0x26683e,'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(_0x26683e,'Change\x20tone'),'commands':[{'id':'professional','label':ki(_0x26683e,'Professional'),'prompt':'Improve\x20using\x20polished,\x20formal,\x20and\x20respectful\x20language\x20to\x20convey\x20professional\x20expertise\x20and\x20competence.'},{'id':'casual','label':ki(_0x26683e,'Casual'),'prompt':'Improve\x20using\x20casual,\x20informal\x20language\x20to\x20convey\x20a\x20casual\x20conversation\x20with\x20a\x20real\x20person.'},{'id':'direct','label':ki(_0x26683e,'Direct'),'prompt':'Improve\x20using\x20direct\x20language,\x20using\x20only\x20the\x20essential\x20information.'},{'id':'confident','label':ki(_0x26683e,'Confident'),'prompt':'Improve\x20using\x20compelling,\x20optimistic\x20language\x20to\x20convey\x20confidence\x20in\x20the\x20writing.'},{'id':'friendly','label':ki(_0x26683e,'Friendly'),'prompt':'Improve\x20using\x20friendly,\x20comforting\x20language,\x20to\x20convey\x20understanding\x20and\x20empathy.'}]},{'groupId':'changeStyle','groupLabel':ki(_0x26683e,'Change\x20style'),'commands':[{'id':'business','label':ki(_0x26683e,'Business'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20business\x20professional\x20with\x20formal\x20language.'},{'id':'legal','label':ki(_0x26683e,'Legal'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20legal\x20professional\x20using\x20valid\x20legal\x20terminology.'},{'id':'journalism','label':ki(_0x26683e,'Journalism'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20journalist\x20using\x20engaging\x20language\x20to\x20convey\x20the\x20importance\x20of\x20the\x20information.'},{'id':'poetic','label':ki(_0x26683e,'Poetic'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20poem\x20using\x20poetic\x20techniques\x20without\x20losing\x20the\x20original\x20meaning.'}]},{'groupId':'translate','groupLabel':ki(_0x26683e,'Translate'),'commands':[{'id':'translateEnglish','label':ki(_0x26683e,'English'),'prompt':'Translate\x20the\x20content\x20to\x20English\x20language.'},{'id':'translateSpanish','label':ki(_0x26683e,'Spanish'),'prompt':'Translate\x20the\x20content\x20to\x20Spanish\x20language.'},{'id':'translatePortuguese','label':ki(_0x26683e,'Portuguese'),'prompt':'Translate\x20the\x20content\x20to\x20Portuguese\x20language.'},{'id':'translateGerman','label':ki(_0x26683e,'German'),'prompt':'Translate\x20the\x20content\x20to\x20German\x20language.'},{'id':'translateFrench','label':ki(_0x26683e,'French'),'prompt':'Translate\x20the\x20content\x20to\x20French\x20language.'},{'id':'translateChinese','label':ki(_0x26683e,'Simplified\x20Chinese'),'prompt':'Translate\x20the\x20content\x20to\x20Simplified\x20Chinese\x20language.'},{'id':'translateHindi','label':ki(_0x26683e,'Hindi'),'prompt':'Translate\x20the\x20content\x20to\x20Hindi\x20language.'},{'id':'translateArabic','label':ki(_0x26683e,'Arabic'),'prompt':'Translate\x20the\x20content\x20to\x20Arabic\x20language.'}]}];}class ji extends _0x5e9f88{['abortController'];static get['requires'](){return[Ri];}constructor(_0x277f37){super(_0x277f37),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'](_0x4b430b){return this['sendRequest'](_0x4b430b)['catch'](_0x3deed4=>{if(_0x3deed4 instanceof Oi)return Promise['reject'](_0x3deed4);if('AbortError'==_0x3deed4['name'])return Promise['resolve']();throw console['error'](_0x3deed4),new at('aitextadapter-send-request-failed',null);});}async['_prepareRequestHeaders'](_0x29018e,_0x9cf17d){const _0x658331=this['editor']['locale'],_0x25c206={'Content-Type':'application/json'};if('object'==typeof _0x29018e)Object['assign'](_0x25c206,_0x29018e);else{if(_0x29018e)try{const _0x20dafd=await _0x29018e(_0x9cf17d);Object['assign'](_0x25c206,_0x20dafd);}catch{return Promise['reject'](new Oi(ki(_0x658331,'AI_ERROR_GET_HEADERS')));}}return _0x25c206;}async['_prepareRequestParameters'](_0xaa3cb9,_0x2e809d){const _0x22d46a=this['editor']['locale'];if('object'==typeof _0xaa3cb9)return _0xaa3cb9;try{return await _0xaa3cb9(_0x2e809d);}catch{return Promise['reject'](new Oi(ki(_0x22d46a,'AI_ERROR_GET_PARAMETERS')));}}}class Ji extends ji{['_apiUrl'];['_requestHeaders'];['_requestParameters'];static get['pluginName'](){return'OpenAITextAdapter';}constructor(_0x3a32f6){super(_0x3a32f6),_0x3a32f6['config']['define']('ai.assistant.adapter.openAI.apiUrl','https://api.openai.com/v1/chat/completions'),_0x3a32f6['config']['get']('ai.assistant.adapter.openAI.requestParameters')||_0x3a32f6['config']['define']('ai.assistant.adapter.openAI.requestParameters',{'model':'gpt-4o','temperature':0x1,'top_p':0x1,'stream':!0x0}),this['_apiUrl']=_0x3a32f6['config']['get']('ai.assistant.adapter.openAI.apiUrl'),this['_requestHeaders']=_0x3a32f6['config']['get']('ai.assistant.adapter.openAI.requestHeaders')||{},this['_requestParameters']=_0x3a32f6['config']['get']('ai.assistant.adapter.openAI.requestParameters');}async['sendRequest']({query:_0x5d2edc,context:_0x59b1db,onData:_0x248d56,actionId:_0x516f4f}){const _0x3320e7=this['editor']['locale'],_0x40cf03=await this['prepareMessages'](_0x5d2edc,_0x59b1db,_0x516f4f),_0x37b444=await this['_prepareRequestHeaders'](this['_requestHeaders'],_0x516f4f),_0x5ee61d=await this['_prepareRequestParameters'](this['_requestParameters'],_0x516f4f),_0x53cb4c={'messages':_0x40cf03,..._0x5ee61d},_0x30c7db={'method':'POST','headers':_0x37b444,'body':JSON['stringify'](_0x53cb4c),'signal':this['abortController']['signal']},_0x6b9977=await fetch(this['_apiUrl'],_0x30c7db);if(_0x6b9977['ok'])return _0x5ee61d['stream']?await this['_readStreamableResponse'](_0x6b9977,_0x248d56):await this['_readStaticResponse'](_0x6b9977,_0x248d56),Promise['resolve']();{const _0x5e76c0=await _0x6b9977['text']();return _0x5e76c0['includes']('context_length_exceeded')?Promise['reject'](new Oi(ki(_0x3320e7,'AI_ERROR_CONTEXT_LENGTH'))):_0x5e76c0['includes']('Moderation')?Promise['reject'](new Oi(ki(_0x3320e7,'AI_ERROR_MODERATION'))):Promise['reject'](new Error(_0x5e76c0));}}async['prepareMessages'](_0x11c9ef,_0x24de62,_0x342775){let _0x2cce08,_0x5d4d1d;return _0x24de62?(_0x2cce08='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.',_0x5d4d1d='Instruction:\x0a'+_0x11c9ef+'\x0aYou\x20must\x20keep\x20the\x20text\x20formatting.\x0a\x0aContent:\x0a'+_0x24de62):(_0x2cce08='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.',_0x5d4d1d=_0x11c9ef),[{'role':'system','content':_0x2cce08},{'role':'user','content':_0x5d4d1d}];}async['_readStreamableResponse'](_0x1d86c0,_0x4da322){const _0x116149=_0x1d86c0['body']['getReader'](),_0x1e5546=new TextDecoder();let _0xe6b103='',_0x1635c3='',_0x37f1a2='',_0x1b9b3e=!0x1;for(;!_0x1b9b3e;){const {done:_0x5a190d,value:_0x327bb2}=await _0x116149['read'](),_0x3e7b93=_0xe6b103+_0x1e5546['decode'](_0x327bb2);let _0x5a8515='';_0x1b9b3e=_0x5a190d;try{_0x5a8515=this['_cleanUpData'](_0x3e7b93),_0xe6b103='';}catch{_0xe6b103=_0x3e7b93;continue;}_0x1635c3+=_0x5a8515,!_0x1b9b3e&&this['_isBufferIncomplete'](_0x1635c3)||_0x1635c3&&(_0x37f1a2+=_0x1635c3,_0x1635c3='',_0x4da322(_0x37f1a2));}return Promise['resolve']();}async['_readStaticResponse'](_0x58c6d6,_0x14e9a3){return _0x14e9a3((await _0x58c6d6['json']())['choices'][0x0]['message']['content']),Promise['resolve']();}['_isBufferIncomplete'](_0x1fb086){const _0x3c2239=_0x1fb086['split']('<')['length']!==_0x1fb086['split']('>')['length'],_0x2419dc=_0x1fb086['length']<0x1e;return _0x3c2239&&_0x2419dc;}['_cleanUpData'](_0x900733){return _0x900733['split'](/\n(?![^{]*\})/g)['map'](_0x53280c=>_0x53280c['replace']('data:\x20',''))['filter'](_0x8996a0=>_0x8996a0&&_0x8996a0['length']>0x0&&'[DONE]'!==_0x8996a0)['map'](_0x4e586e=>{const {choices:_0x2a1281}=JSON['parse'](_0x4e586e);if(_0x2a1281[0x0]?.['delta']?.['content'])return _0x2a1281[0x0]['delta']['content'];})['filter'](_0x136248=>_0x136248)['join']('');}}class Zi extends ji{static get['pluginName'](){return'AWSTextAdapter';}['init'](){super['init'](),It('ai-aws-adapter-not-supported');}async['sendRequest'](_0xb5b518){throw Et('ai-aws-adapter-not-supported'),new Oi(ki(this['editor']['locale'],'AI_ERROR_AWS_NOT_SUPPORTED'));}}class ts extends Nt{constructor(_0x57fea1,_0xee8088={}){super(_0x57fea1),this['isToggleable']=!0x0,this['set']('side',_0xee8088['side']||'top');const _0x2707b1=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':['ck-tab-button',...pt(_0xee8088['class']||[]),_0x2707b1['to']('side',_0x5039ce=>'ck-tab-button_'+_0x5039ce),_0x2707b1['to']('class')]}});}['show'](){this['set']('isVisible',!0x0);}['hide'](){this['set']('isVisible',!0x1);}}class es extends vt{['children'];constructor(_0x215bc7,_0x3ef867={}){super(_0x215bc7);const _0x3bb692=this['bindTemplate'];this['set']('isVisible',!0x1),this['set']('class',''),this['children']=this['createCollection'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-tab-panel',...pt(_0x3ef867['class']||[]),_0x3bb692['to']('class'),_0x3bb692['if']('isVisible','ck-hidden',_0xf9b5eb=>!_0xf9b5eb)]},'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(_0x461089,_0x273a7e={}){super(_0x461089),this['set']('class',void 0x0),this['set']('activeTab',null),this['set']('side',_0x273a7e['side']||'top'),this['set']('isMaximized',!0x1),this['set']('collapsible',_0x273a7e['collapsible']||!0x1),this['set']('_isMaximizedActive',!0x1),this['bind']('_isMaximizedActive')['to'](this,'isMaximized',this,'activeTab',(_0x5cff7c,_0x5895cc)=>_0x5cff7c&&null!==_0x5895cc);const _0x2fb4e3=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset','ck-tabs',...pt(_0x273a7e['class']||[]),_0x2fb4e3['to']('side',_0x2679a4=>'ck-tabs_'+_0x2679a4),_0x2fb4e3['to']('class'),_0x2fb4e3['if']('_isMaximizedActive','ck-ai-tabs_maximized'),_0x2fb4e3['to']('activeTab',_0xe66d72=>null===_0xe66d72?'ck-ai-tabs_collapsed':'')],'tabindex':'0'},'children':[{'tag':'div','attributes':{'class':['ck','ck-tabs__buttons-container',_0x2fb4e3['to']('side',_0x27bcbd=>'ck-tabs__buttons-container_'+_0x27bcbd)]},'children':this['buttonViews']},{'tag':'div','attributes':{'class':['ck','ck-tabs__panels-container',_0x2fb4e3['to']('side',_0x159d71=>'ck-tabs__panels-container_'+_0x159d71)]},'children':this['panelViews']},...pt(_0x273a7e['children']||[])]});}['getTabIds'](){return[...this['_tabs']['keys']()];}['getTab'](_0x1a0042){const _0x8dc42e=this['_tabs']['get'](_0x1a0042);return _0x8dc42e||null;}['addTab'](_0x568064){const _0x399b59=this['_setupButton']({'id':_0x568064['id'],'label':_0x568064['buttonLabel'],'icon':_0x568064['buttonIcon'],'order':_0x568064['order']}),_0xdfb469=new es(this['locale']);return _0xdfb469['render'](),_0x568064['content']&&_0xdfb469['children']['add'](_0x568064['content']),this['panelViews']['add'](_0xdfb469),this['_tabs']['set'](_0x568064['id'],{'button':_0x399b59,'panel':_0xdfb469,'order':void 0x0!==_0x568064['order']?_0x568064['order']:null}),this['fire']('addTab:'+_0x568064['id'],{'id':_0x568064['id'],'button':_0x399b59,'panel':_0xdfb469}),null===this['activeTab']?this['activateTab'](_0x568064['id']):this['_hidePanel'](_0x568064['id']),{'button':_0x399b59,'panel':_0xdfb469};}['activateTab'](_0x50feda){if(null!==_0x50feda&&!this['getTab'](_0x50feda))throw new at('ui-tabsview-tab-not-found',{'tabs':this,'tabId':_0x50feda});if(this['activeTab']===_0x50feda)return;const _0x3e867d=this['activeTab'];this['activeTab']&&this['_hidePanel'](this['activeTab']),this['activeTab']=_0x50feda,_0x50feda&&this['_showPanel'](_0x50feda),this['fire']('activateTab:'+_0x50feda,{'newTab':_0x50feda,'oldTab':_0x3e867d});}['toggleTabPanel'](_0x24310e){if(!this['getTab'](_0x24310e))throw new at('ui-tabsview-tab-not-found',{'tabs':this,'tabId':_0x24310e});this['activeTab']===_0x24310e?this['collapsible']&&(this['activeTab']=null):this['activateTab'](_0x24310e);}['showTab'](_0x5bb287){if(!this['getTab'](_0x5bb287))throw new at('ui-tabsview-tab-not-found',{'tabs':this,'tabId':_0x5bb287});this['_showPanel'](_0x5bb287),this['_showButton'](_0x5bb287),this['fire']('show:'+_0x5bb287,_0x5bb287);}['hideTab'](_0x188fe5){if(!this['getTab'](_0x188fe5))throw new at('ui-tabsview-tab-not-found',{'tabs':this,'tabId':_0x188fe5});const _0x3b1381=this['activeTab'];this['_hidePanel'](_0x188fe5),this['_hideButton'](_0x188fe5);const _0x42bea2=this['getTabIds']();_0x3b1381===_0x188fe5&&_0x42bea2['length']>0x1&&this['activateTab'](_0x42bea2['find'](_0x921386=>_0x921386!==_0x188fe5)),this['fire']('hide:'+_0x188fe5,_0x188fe5);}['_getPanel'](_0x1d36c7){const _0x5a1305=this['_tabs']['get'](_0x1d36c7);return _0x5a1305?_0x5a1305['panel']:null;}['_showPanel'](_0x10c244){null!==this['activeTab']&&this['activeTab']!==_0x10c244||this['_getPanel'](_0x10c244)['show']();}['_hidePanel'](_0x348503){const _0x3e104f=this['_getPanel'](_0x348503);_0x3e104f['isVisible']&&(this['activeTab']===_0x348503&&(this['activeTab']=null),_0x3e104f['hide']());}['_getButton'](_0x34bcef){const _0xbdcf3f=this['_tabs']['get'](_0x34bcef);return _0xbdcf3f?_0xbdcf3f['button']:null;}['_showButton'](_0x40a490){this['_getButton'](_0x40a490)['show']();}['_hideButton'](_0x193058){this['_getButton'](_0x193058)['hide']();}['_setupButton'](_0x139796){const _0x16e03f=new ts(this['locale'],{'side':this['side']}),_0x35433a=this['buttonViews'];if(_0x16e03f['set']({'label':_0x139796['label'],'icon':_0x139796['icon'],'tooltip':!0x0,'withText':!0x0}),_0x16e03f['bind']('isOn')['to'](this,'activeTab',_0x9dee51=>_0x9dee51===_0x139796['id']),_0x16e03f['bind']('side')['to'](this,'side'),_0x139796['order']){const _0x996bb0=[...this['_tabs']]['reduce']((_0x5a92bb,_0x5f315f)=>{const _0x40e8e3=_0x5f315f[0x0],{order:_0x2ee031}=_0x5f315f[0x1];return!_0x2ee031||_0x2ee031>_0x139796['order']?_0x5a92bb:_0x2ee031>=_0x5a92bb['order']?{'id':_0x40e8e3,'order':_0x2ee031}:_0x5a92bb;},{'id':'','order':0x0}),_0x389bc8=_0x35433a['getIndex'](this['_getButton'](_0x996bb0['id']));_0x35433a['add'](_0x16e03f,_0x389bc8+0x1);}else _0x35433a['add'](_0x16e03f);return _0x16e03f['on']('execute',()=>{this['toggleTabPanel'](_0x139796['id']);}),_0x16e03f;}}const ss=['overlay','sidebar','custom'],ns=['left','right'];class rs extends is{constructor(_0x5487b5,_0x24dc4e={}){super(_0x5487b5,_0x24dc4e),this['set']('type',_0x24dc4e['type']||'sidebar'),this['set']('side',_0x24dc4e['side']||'right'),this['set']('isVisible',_0x24dc4e['visibleByDefault']??!0x0);const _0x2b47c4=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':['ck-ai-tabs',_0x2b47c4['if']('type','ck-ai-tabs__overlay',_0x21e966=>'overlay'===_0x21e966),_0x2b47c4['if']('type','ck-ai-tabs__sidebar',_0x33bc2f=>'sidebar'===_0x33bc2f),_0x2b47c4['if']('isVisible','ck-hidden',_0x1b2911=>!_0x1b2911)]}}),this['buttonViews']['on']('add',(_0x24347e,_0x977350)=>{_0x977350['set']('withText',!0x1);});}}class os extends _0xee6711{['view'];['container']=null;['showResizeButton']=!0x0;static get['pluginName'](){return'AITabs';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0xa12bfa){if(super(_0xa12bfa),!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 _0x3c5cf4=this['context']['config']['get']('ai.container');if(this['set']('side','right'),void 0x0!==_0x3c5cf4['showResizeButton']&&(this['showResizeButton']=_0x3c5cf4['showResizeButton']),'sidebar'!==_0x3c5cf4['type']&&'overlay'!==_0x3c5cf4['type']||_0x3c5cf4['side']&&(this['side']=_0x3c5cf4['side']),'sidebar'===_0x3c5cf4['type']){if(this['container']=_0x3c5cf4['element'],this['set']('type','sidebar'),!this['container'])throw new at('ai-tabs-sidebar-container-element-not-found');}else'overlay'===_0x3c5cf4['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':_0x3c5cf4['visibleByDefault'],'collapsible':_0x3c5cf4['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 _0x4df290&&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'](_0x2a1797){if(_0x2a1797&&this['type']!==_0x2a1797){if(!ss['includes'](_0x2a1797))throw new at('ai-tabs-unsupported-ui-type');this['type']=_0x2a1797;}}['switchSide'](_0x596bf1){if(_0x596bf1&&this['side']!==_0x596bf1){if(!ns['includes'](_0x596bf1))throw new at('ai-tabs-unsupported-ui-side');this['side']=_0x596bf1;}}['destroy'](){super['destroy'](),this['view']['destroy'](),this['view']['element']&&this['view']['element']['remove']();}}class as extends _0xee6711{['_apiUrl'];['_token'];['_decoder'];['_responseCache'];static get['requires'](){return[_0x2f155f];}static get['pluginName'](){return'AIConnector';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x4b5e18){super(_0x4b5e18),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 _0x463d63=this['context']['plugins']['get'](_0x2f155f);if(!_0x463d63['token'])throw new at('ai-missing-token',this);this['_token']=_0x463d63['token'];}['startConversation'](_0x29cf4f,_0x99c4ae){const _0x571de9=this['_sendApiRequest']('/conversations','POST',{'id':_0x29cf4f,'group':_0x99c4ae});return{'getConversation':async()=>(await _0x571de9['request'])['json'](),'abortController':_0x571de9['abortController']};}['queryAssistant']({message:_0x1cf77f,conversationId:_0x1af0fa,parts:_0x1cd738,capabilities:_0x113494,model:_0xa1a2eb,attributes:_0x3c8097}){const _0x186f9f={'prompt':_0x1cf77f,'content':_0x1cd738,'model':_0xa1a2eb,..._0x113494&&{'capabilities':_0x113494},..._0x3c8097&&{'attributes':_0x3c8097}},_0xe5b8a4=this['_sendApiRequest']('/conversations/'+_0x1af0fa+'/messages','POST',_0x186f9f);return{'getStream':async()=>{const _0x13d7ac=(await _0xe5b8a4['request'])['body'];return this['_getStreamReader'](_0x13d7ac);},'abortController':_0xe5b8a4['abortController']};}['executeCustomAction']({content:_0x377bd4,message:_0x4a1a4a,model:_0x5029fe,outputFormat:_0x5080cd}){const _0x29c326={'content':[{'type':'text','content':_0x377bd4}],'prompt':_0x4a1a4a,'model':_0x5029fe,'outputFormat':_0x5080cd},_0x3bd89d=this['_sendApiRequest']('/actions/custom/calls','POST',_0x29c326);return{'getStream':async()=>{const _0x43b97e=(await _0x3bd89d['request'])['body'];return this['_getStreamReader'](_0x43b97e);},'abortController':_0x3bd89d['abortController']};}['executeAction']({actionName:_0x3e48a0,content:_0x2ba669,args:_0x538a8d}){const _0x57eab3={'content':[{'type':'text','content':_0x2ba669}],'args':_0x538a8d},_0x7f9d27=this['_sendApiRequest']('/actions/system/'+_0x3e48a0+'/calls','POST',_0x57eab3);return{'getStream':async()=>{const _0x25263c=(await _0x7f9d27['request'])['body'];return this['_getStreamReader'](_0x25263c);},'abortController':_0x7f9d27['abortController']};}['uploadFile'](_0x1d0060,_0x36f13c,_0x5eddc5){const _0x457828=new FormData();_0x457828['append']('file',_0x36f13c,_0x36f13c['name']),_0x5eddc5&&_0x457828['append']('attributes',JSON['stringify'](_0x5eddc5));const _0x17f866=this['_sendApiRequest']('/conversations/'+_0x1d0060+'/files','POST',_0x457828);return{'getId':async()=>(await _0x17f866['request'])['json'](),'abortController':_0x17f866['abortController']};}['fetchDocument'](_0x20f721,_0x16916a){const _0xfa5058=this['_sendApiRequest']('/conversations/'+_0x20f721+'/documents/'+_0x16916a,'GET');return{'getDocument':async()=>(await _0xfa5058['request'])['json'](),'abortController':_0xfa5058['abortController']};}['uploadDocument'](_0x3ab81e,_0x4e7d55,_0x471b0c){const _0x4858e9={'content':_0x4e7d55};_0x471b0c&&(_0x4858e9['attributes']=_0x471b0c);const _0x375f30=this['_sendApiRequest']('/conversations/'+_0x3ab81e+'/documents','POST',_0x4858e9);return{'getId':async()=>(await _0x375f30['request'])['json'](),'abortController':_0x375f30['abortController']};}['uploadDocuments'](_0x40fc47,_0x5b6185){const _0x4e7b6a={'documents':_0x5b6185['map'](_0x467338=>({'content':_0x467338['content'],'attributes':{'version':_0x467338['version'],'sessionId':_0x467338['sessionId'],'selections':_0x467338['selections']},...void 0x0!==_0x467338['name']?{'name':_0x467338['name']}:{},...void 0x0!==_0x467338['description']?{'description':_0x467338['description']}:{}}))},_0x5712c2=this['_sendApiRequest']('/conversations/'+_0x40fc47+'/documents/batch','POST',_0x4e7b6a);return{'getIds':async()=>(await _0x5712c2['request'])['json'](),'abortController':_0x5712c2['abortController']};}['fetchDocuments'](_0x4253ba,_0x53e21b){const _0x1fab88=new URLSearchParams();_0x1fab88['append']('documentIds',_0x53e21b['join'](','));const _0x46f638=this['_sendApiRequest']('/conversations/'+_0x4253ba+'/documents/batch?'+_0x1fab88['toString'](),'GET');return{'getDocuments':async()=>(await _0x46f638['request'])['json'](),'abortController':_0x46f638['abortController']};}['fetchConversations'](_0x3a4dc0,_0x3c0793={}){const _0x135c39=new URLSearchParams();_0x135c39['append']('group',_0x3a4dc0),_0x135c39['append']('excludeEmpty',!0x1!==_0x3c0793['excludeEmpty']?'true':'false'),_0x135c39['append']('limit',_0x3c0793['limit']?_0x3c0793['limit']['toString']():'100'),_0x135c39['append']('sortBy',_0x3c0793['sortBy']?_0x3c0793['sortBy']:'createdAt'),_0x135c39['append']('order',_0x3c0793['order']?_0x3c0793['order']:'desc');const _0x5ca72c=this['_sendApiRequest']('/conversations?'+_0x135c39['toString'](),'GET');return{'getConversations':async()=>{const _0x346557=await _0x5ca72c['request'];return(await _0x346557['json']())['items'];},'abortController':_0x5ca72c['abortController']};}['deleteConversation'](_0x55181d){const _0x14976c=this['_sendApiRequest']('/conversations/'+_0x55181d,'DELETE');return{'execute':async()=>{await _0x14976c['request'];},'abortController':_0x14976c['abortController']};}['updateConversation'](_0xc507cf,_0x3b11fd){const _0x3f77f9=this['_sendApiRequest']('/conversations/'+_0xc507cf,'PATCH',_0x3b11fd);return{'getResult':async()=>(await _0x3f77f9['request'],_0x3b11fd),'abortController':_0x3f77f9['abortController']};}['fetchConversation'](_0x316651){const _0x1dcad2=this['_sendApiRequest']('/conversations/'+_0x316651,'GET');return{'getConversation':async()=>(await _0x1dcad2['request'])['json'](),'abortController':_0x1dcad2['abortController']};}['fetchConversationMessages'](_0xb7f047){const _0x330bf9=this['_sendApiRequest']('/conversations/'+_0xb7f047+'/messages','GET');return{'getMessages':async()=>{const _0x378c30=await _0x330bf9['request'];return(await _0x378c30['json']())['items'];},'abortController':_0x330bf9['abortController']};}['uploadUrl'](_0x1a16df,_0x4f102f,_0x3d57c7){const _0x372447=this['_sendApiRequest']('/conversations/'+_0x1a16df+'/web-resources','POST',{'url':_0x4f102f,'attributes':_0x3d57c7});return{'getId':async()=>(await _0x372447['request'])['json'](),'abortController':_0x372447['abortController']};}['getModels'](_0x4916da='en'){const _0x1cdbea=new URLSearchParams();_0x1cdbea['append']('language',_0x4916da);const _0x535369='/models/1?'+_0x1cdbea['toString'](),_0x553555=this['_sendApiRequest'](_0x535369,'GET',void 0x0,!0x0);return{'list':async()=>await(await _0x553555['request'])['json'](),'abortController':_0x553555['abortController']};}['deleteFile'](_0x435a7d,_0xecedf4){const _0x43a3c5=this['_sendApiRequest']('/conversations/'+_0x435a7d+'/files/'+_0xecedf4,'DELETE');return{'execute':async()=>{await _0x43a3c5['request'];},'abortController':_0x43a3c5['abortController']};}['deleteDocument'](_0x204cb4,_0x42dd01){const _0x59f0c1=this['_sendApiRequest']('/conversations/'+_0x204cb4+'/documents/'+_0x42dd01,'DELETE');return{'execute':async()=>{await _0x59f0c1['request'];},'abortController':_0x59f0c1['abortController']};}['deleteWebResource'](_0xb638d7,_0x2dd6ad){const _0x177a97=this['_sendApiRequest']('/conversations/'+_0xb638d7+'/web-resources/'+_0x2dd6ad,'DELETE');return{'execute':async()=>{await _0x177a97['request'];},'abortController':_0x177a97['abortController']};}['callSystemReview']({reviewName:_0x427b0f,content:_0xc0718b,args:_0xf972ea}){const _0x5d3279=this['_sendApiRequest']('/reviews/system/'+_0x427b0f+'/calls','POST',{'content':[{'type':'text','content':_0xc0718b}],'args':_0xf972ea});return{'getStream':async()=>{const _0xce6dd=(await _0x5d3279['request'])['body'];return this['_getStreamReader'](_0xce6dd);},'abortController':_0x5d3279['abortController']};}['callCustomReview']({content:_0x286df0,prompt:_0xf5bf37,model:_0x3047fb}){const _0x27b3ef=this['_sendApiRequest']('/reviews/custom/calls','POST',{'content':[{'type':'text','content':_0x286df0}],'prompt':_0xf5bf37,'model':_0x3047fb});return{'getStream':async()=>{const _0x351a39=(await _0x27b3ef['request'])['body'];return this['_getStreamReader'](_0x351a39);},'abortController':_0x27b3ef['abortController']};}['upsertAIChatRating'](_0x12b545,_0x1ecd1b,_0x1accda){const _0x11f134=this['_sendApiRequest']('/conversations/'+_0x12b545+'/messages/'+_0x1ecd1b+'/ratings','PUT',{'positiveCount':_0x1accda['positiveCount'],'totalCount':_0x1accda['totalCount'],'modificationId':_0x1accda['modificationId']});return{'execute':async()=>{await _0x11f134['request'];},'abortController':_0x11f134['abortController']};}['upsertAIActionRating'](_0x11a645,_0x44fd01,_0x4003db){const _0x3de073=this['_sendApiRequest']('/actions/system/'+_0x11a645+'/calls/'+_0x44fd01+'/ratings','PUT',{'positiveCount':_0x4003db['positiveCount'],'totalCount':_0x4003db['totalCount']});return{'execute':async()=>{await _0x3de073['request'];},'abortController':_0x3de073['abortController']};}['upsertCustomAIActionRating'](_0x366713,_0x339c21){const _0x4d4b4c=this['_sendApiRequest']('/actions/custom/calls/'+_0x366713+'/ratings','PUT',{'positiveCount':_0x339c21['positiveCount'],'totalCount':_0x339c21['totalCount']});return{'execute':async()=>{await _0x4d4b4c['request'];},'abortController':_0x4d4b4c['abortController']};}['upsertAIReviewRating'](_0x402151,_0x4ef293,_0x51cba2,_0x2afe5b){const _0x1bf56d=this['_sendApiRequest']('/reviews/system/'+_0x402151+'/calls/'+_0x4ef293+'/ratings','PUT',{'positiveCount':_0x51cba2['positiveCount'],'totalCount':_0x51cba2['totalCount'],'dataId':_0x2afe5b});return{'execute':async()=>{await _0x1bf56d['request'];},'abortController':_0x1bf56d['abortController']};}['upsertCustomAIReviewRating'](_0xb7abaa,_0x5caed6,_0x42e6a5){const _0x5eeda7=this['_sendApiRequest']('/reviews/custom/calls/'+_0xb7abaa+'/ratings','PUT',{'positiveCount':_0x5caed6['positiveCount'],'totalCount':_0x5caed6['totalCount'],'dataId':_0x42e6a5});return{'execute':async()=>{await _0x5eeda7['request'];},'abortController':_0x5eeda7['abortController']};}['_sendApiRequest'](_0x4636b8,_0x4a64bf,_0xcd0cbc,_0x3413ec=!0x1){const _0x22eb8c=new AbortController(),_0xd2a4a7=_0x3413ec?_0x4a64bf+':'+_0x4636b8:null;if(_0xd2a4a7){const _0x23bbac=this['_responseCache']['get'](_0xd2a4a7);if(_0x23bbac)return{'request':_0x23bbac['then'](_0x455d23=>_0x455d23['clone']()),'abortController':_0x22eb8c};}const _0x293261=_0xcd0cbc instanceof FormData,_0x6a39dd={'Authorization':'Bearer\x20'+this['_token']?.['value'],'x-feature-flags':'multi-document','X-Editor-Version':mt};_0xcd0cbc&&!_0x293261&&(_0x6a39dd['Content-Type']='application/json');const _0x20032a={'method':_0x4a64bf,'headers':_0x6a39dd,'signal':_0x22eb8c['signal']};_0xcd0cbc&&(_0x20032a['body']=_0x293261?_0xcd0cbc:JSON['stringify'](_0xcd0cbc));const _0x1c054b=fetch(''+this['_apiUrl']+_0x4636b8,_0x20032a)['catch'](_0x52280e=>{_0xd2a4a7&&this['_responseCache']['delete'](_0xd2a4a7),this['_handleError'](_0x52280e);})['then'](_0x50eaae=>_0x50eaae['ok']?_0x50eaae:_0x50eaae['json']()['then'](_0x1a3063=>{throw _0xd2a4a7&&this['_responseCache']['delete'](_0xd2a4a7),{'url':this['_apiUrl'],'path':_0x4636b8,'method':_0x4a64bf,'body':_0xcd0cbc,'status':(_0x50eaae||{})['status'],'statusText':(_0x50eaae||{})['statusText'],'code':_0x1a3063['code'],'message':_0x1a3063['message'],'traceId':_0x1a3063['traceId']};}));return _0xd2a4a7&&this['_responseCache']['set'](_0xd2a4a7,_0x1c054b['then'](_0x56ebfa=>_0x56ebfa['clone']())),{'request':_0x1c054b,'abortController':_0x22eb8c};}async*['_getStreamReader'](_0x5f1c43){const _0x51e9c7=[],_0x4822fa=_0x5f1c43['getReader'](),_0x40ec1b=_0x385587({'onError':_0x17ae90=>{this['_handleError'](_0x17ae90);},'onEvent':_0x4c5ba2=>{_0x4c5ba2['data']=JSON['parse'](_0x4c5ba2['data']),_0x51e9c7['push'](_0x4c5ba2);}});try{let _0x2ef681=!0x1;for(;!_0x2ef681;){const {done:_0x6015b1,value:_0xc28c7e}=await _0x4822fa['read']();_0x6015b1&&(_0x2ef681=!0x0),_0x40ec1b['feed'](this['_decoder']['decode'](_0xc28c7e,{'stream':!0x0})),yield*_0x51e9c7,_0x51e9c7['length']=0x0;}}catch(_0x3ff896){this['_handleError'](_0x3ff896);}finally{_0x4822fa['releaseLock'](),_0x40ec1b['reset']();}}['_handleError'](_0x2841a0){if(_0x2841a0 instanceof at)throw _0x2841a0;if(_0x2841a0 instanceof Error&&'AbortError'===_0x2841a0['name'])throw new at('ai-request-aborted',this,{'originalError':_0x2841a0});throw new at('ai-request-failed',this,{'originalError':_0x2841a0});}}function hs(_0x5a78e8,_0x21479c,_0x1e9927){const t=_0x5a78e8['t'];switch(_0x21479c){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'},_0x1e9927);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.'},_0x1e9927);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.'},_0x1e9927);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.'},_0x1e9927);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'},_0x1e9927);case'AI_CHAT_SUGGESTION_ACTION_SUGGEST':return t({'id':'AI_CHAT_SUGGESTION_ACTION_SUGGEST','string':'Suggest'},_0x1e9927);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'},_0x1e9927);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.'},_0x1e9927);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.'},_0x1e9927);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.'},_0x1e9927);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.'},_0x1e9927);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'},_0x1e9927);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.'},_0x1e9927);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 _0x21479c;}}const cs='ck-ai-button-primary',ls='ck-ai-button-secondary',us='ck-ai-button-tertiary';function ds(_0x7dc624,_0x2842f8){const _0x15534a=new Nt(_0x7dc624),_0x57246c=hs(_0x7dc624,'AI_TABS_LABEL_MINIMIZE'),_0xa52676=hs(_0x7dc624,'AI_TABS_LABEL_MAXIMIZE');return _0x15534a['set']({'withText':!0x1,'icon':_0xb350fd,'tooltip':!0x0,'class':'ck-ai-tabs__resize\x20'+us}),_0x15534a['bind']('label')['to'](_0x2842f8,'isMaximized',_0x5dccc=>_0x5dccc?_0x57246c:_0xa52676),_0x15534a['bind']('icon')['to'](_0x2842f8,'isMaximized',_0x4e922b=>_0x4e922b?_0x2a9f31:_0xb350fd),_0x15534a['bind']('isOn')['to'](_0x2842f8,'isMaximized'),_0x15534a['on']('execute',()=>{_0x2842f8['fire']('resizeTabs');}),_0x15534a;}function _s(_0x138099){return _0x595a67(_0x138099);}function gs(_0x2fbdbc){return ti(_0x2fbdbc);}function As(_0x1b0178,_0x43e7a8,_0x372441){const _0x19b94b=null!==_0x43e7a8?_0x3c5540=>_0x3c5540['attribs'][_0x1b0178]===_0x43e7a8:_0x50681c=>Boolean(_0x50681c['attribs'][_0x1b0178]);return _0x3f6b28(_0xe4f828=>_0x60f0d2(_0xe4f828)&&_0x19b94b(_0xe4f828),_0x372441);}function Is(_0x201f0b,_0xee7700,_0x4a1f64){const _0x45f406=null!==_0xee7700?_0x5d93d1=>_0x5d93d1['attribs'][_0x201f0b]===_0xee7700:_0x1db2cc=>Boolean(_0x1db2cc['attribs'][_0x201f0b]);return _0x364046(_0x867a50=>_0x60f0d2(_0x867a50)&&_0x45f406(_0x867a50),_0x4a1f64);}function Es(_0x570408,_0x4e5ed1){return _0x570408&&_0x60f0d2(_0x570408)?_0x570408['attribs'][_0x4e5ed1]:null;}function ps(_0x4ee445,_0xa7b03e,_0x32a8ad){_0x60f0d2(_0x4ee445)&&(null===_0x32a8ad?delete _0x4ee445['attribs'][_0xa7b03e]:_0x4ee445['attribs'][_0xa7b03e]=_0x32a8ad);}function ms(_0x23a29a,_0x52421d,_0x5955dd){const _0xfab66c=_0x52421d['cloneNode'](!0x0);'beforebegin'===_0x5955dd?_0x484771(_0x23a29a,_0xfab66c):'afterbegin'===_0x5955dd?_0x57380b(_0x23a29a,_0xfab66c):'beforeend'===_0x5955dd?_0x1e9fbc(_0x23a29a,_0xfab66c):'afterend'===_0x5955dd&&_0x5c974a(_0x23a29a,_0xfab66c);}function Ts(_0x3204a4){const _0x210abe=[];let _0x5c3e1e=_0x3204a4;for(;_0x5c3e1e;)_0x5c3e1e=_0xe039c1(_0x5c3e1e),_0x5c3e1e&&_0x210abe['push'](_0x5c3e1e);return _0x210abe;}function Cs(_0x4e9584){return _0x4e9584['replace'](/^\s+/gm,'')['replace'](/\s+$/gm,'')['replace'](/\n*/g,'')['replace'](/\s+/g,'\x20')['replace'](/>\s*</g,'><');}function ws(_0x43ee4f){let _0x4320d5=0x0;for(;_0x43ee4f['parentNode'];)_0x43ee4f=_0x43ee4f['parentNode'],_0x4320d5++;return _0x4320d5;}function fs(_0x142a90){const _0x44014e=[];let _0x11a11d=_0x142a90['nextSibling'];for(;_0x11a11d;)_0x44014e['push'](_0x11a11d),_0x11a11d=_0x11a11d['nextSibling'];_0x44014e['forEach'](_0x2507dc=>{_0x4529c2(_0x2507dc);});}class bs extends/* #__PURE__ -- @preserve */
25
+ ht(){['_m2html'];constructor(){super();const _0x21a0ee=Object['entries'](_0x404772),_0x589286=_0x21a0ee['findIndex'](([_0x42323f])=>'rehypeDomRaw'===_0x42323f);if(-0x1===_0x589286)throw new at('ai-response-parser-unable-to-set-up-parser');_0x21a0ee['splice'](_0x589286+0x1,0x0,['rehypeSanitize',_0x4927f8]),this['_m2html']=new _0x50fd49({'plugins':Object['fromEntries'](_0x21a0ee)});}['convertMarkdownToHTML'](_0x223e64){const _0x2ade84=this['_m2html']['parse'](_0x223e64);return this['parseAndNormalizeHTML'](_0x2ade84);}['parseAndNormalizeHTML'](_0x413d4a){return this['_parseHTML'](_0x413d4a);}['_parseHTML'](_0x34351e){const _0x87b08e=_s('<dummy>'+_0x34351e['replace'](/^\t+/gm,'\x20')['replace'](/\n*/g,'')['replace'](/\s+/g,'\x20')['replace'](/<[^>]*?$/g,'')+'</dummy>');return _0x87b08e['children']=_0x87b08e['children'][0x0]['children'],_0x87b08e;}}class Ss extends/* #__PURE__ -- @preserve */
26
+ ht(){['_generateUid'];['_uidCounter']=0x0;['_touchedNodesState']={'newIds':[],'modifiedIds':[],'removedIds':[],'invalidIds':[],'lastTouchedId':null};['_existingDataIds']=new Set();constructor(_0x4b5c1f){super(),this['_generateUid']=_0x4b5c1f||(()=>'e'+String(this['_uidCounter']++));}['merge'](_0x523e0b,_0x3383af,_0x4cc305){this['_uidCounter']=0x0;const _0x20cfa9=_0x523e0b['cloneNode'](!0x0),_0x3b2904=_0x20cfa9['childNodes'],_0x5d35b0=Array['from'](_0x3b2904)['filter'](_0x23fbfc=>!(0x3===_0x23fbfc['nodeType']&&''===gs(_0x23fbfc)['trim']())),_0x4f17d8=_0x5d35b0['length'],_0x5aa050=new Map();for(const _0x3a97a9 of _0x5d35b0)_0x3a97a9&&_0x60f0d2(_0x3a97a9)&&void 0x0===_0x3a97a9['attribs']['data-id']&&ps(_0x3a97a9,'data-id','new-element');if(0x0===_0x3383af['childNodes']['length']){const _0x3b36ab=[];return Is('data-id','new-element',_0x20cfa9)['forEach'](_0x8a690f=>{const _0xe7aaa2=this['_generateUid']();ps(_0x8a690f,'data-id',_0xe7aaa2),_0x3b36ab['push'](_0xe7aaa2);}),this['_removeSpecialComments'](_0x20cfa9),{'parsedContent':_0x20cfa9,'newNodeIds':_0x3b36ab,'modifiedNodeIds':[],'removedNodeIds':[],'newAnchorIds':_0x5aa050};}_0x4cc305&&_0x4cc305['markUnstableElements']&&this['_markLastTagElementUnstable'](_0x20cfa9),this['_touchedNodesState']['newIds']=[],this['_touchedNodesState']['modifiedIds']=[],this['_touchedNodesState']['removedIds']=[],this['_touchedNodesState']['invalidIds']=[],this['_touchedNodesState']['lastTouchedId']=null,this['_existingDataIds']=new Set(Is('data-id',null,_0x3383af)['map'](_0x550b42=>Es(_0x550b42,'data-id'))['filter'](_0x25f1f1=>!!_0x25f1f1));let _0xb6e719=-0x1,_0x2402dc=!0x1;for(let _0x583632=0x0;_0x583632<_0x4f17d8;_0x583632++){const _0xff4654=_0x5d35b0[_0x583632],_0xdf3af7=_0x5d35b0[_0x583632+0x1];if(this['_isNewNode'](_0xff4654)){if(-0x1===_0xb6e719&&(_0xb6e719=_0x583632),this['_markWrappedElements'](_0xff4654),!this['_isNewNode'](_0xdf3af7)){const [_0x3a4464,_0x2d81be]=this['_findReferenceNode'](_0xff4654,_0x2402dc,_0x3383af);if(_0x3a4464){const _0x845717=Array['from'](_0x5d35b0)['slice'](_0xb6e719,_0x583632+0x1),_0x9716c3=Es(_0x3a4464,'data-id');if(this['_insertNodes'](_0x3a4464,_0x845717,_0x2d81be),_0x9716c3)for(const _0x4cb26b of _0x845717){const _0x5006ce=Es(_0x4cb26b,'data-id');_0x5006ce&&_0x5aa050['set'](_0x5006ce,_0x9716c3);}_0xb6e719=-0x1;}}}else{if(this['_isExistingContentComment'](_0xff4654))_0x2402dc=!0x0;else{if(this['_isExistingNode'](_0xff4654)){const _0x405616=Es(_0xff4654,'data-id');if(_0x405616&&this['_existingDataIds']['has'](_0x405616)){const _0x20cef8=As('data-id',_0x405616,_0x3383af);this['_replaceNode'](_0x20cef8,_0xff4654);}}else{if(this['_isDelNode'](_0xff4654)){const _0x209a5b=this['_getNodeDataId'](_0xff4654);!!As('data-id',_0x209a5b,_0x20cfa9)||this['_touchedNodesState']['removedIds']['push'](_0x209a5b);}}}}}for(const _0x502b65 of this['_touchedNodesState']['removedIds']){const _0x31d059=As('data-id',_0x502b65,_0x3383af);_0x31d059&&this['_removeNode'](_0x31d059,_0x502b65,_0x4cc305);}if(Is('data-id','new-element',_0x3383af)['forEach'](_0x424f2f=>{const _0x35e743=this['_getUid'](_0x424f2f);ps(_0x424f2f,'data-id',_0x35e743),this['_touchedNodesState']['newIds']['push'](_0x35e743);}),this['_removeSpecialComments'](_0x3383af),_0x4cc305&&_0x4cc305['markUnstableElements']&&this['_markUnstableElements'](_0x3383af,_0x4cc305['markUnstableElementsDepth']||0x0),this['_processWrappedElements'](_0x3383af,_0x4cc305),_0x4cc305&&_0x4cc305['cutAfterLastChange']&&this['_touchedNodesState']['lastTouchedId']){const _0xf33d6d=Is('data-id',this['_touchedNodesState']['lastTouchedId'],_0x3383af);let _0x45e3fe=_0xf33d6d[_0xf33d6d['length']-0x1];for(;_0x45e3fe;)fs(_0x45e3fe),_0x45e3fe=_0x45e3fe['parentNode'];}return{'parsedContent':_0x3383af,'newNodeIds':this['_touchedNodesState']['newIds'],'modifiedNodeIds':this['_touchedNodesState']['modifiedIds'],'removedNodeIds':this['_touchedNodesState']['removedIds'],'newAnchorIds':_0x5aa050};}['_insertNodes'](_0x1741dc,_0x221fe5,_0x1a0d41){for(const _0x54bac6 of _0x221fe5){const _0x590ab3=this['_getUid'](_0x54bac6);ps(_0x54bac6,'data-id',_0x590ab3),this['_touchedNodesState']['newIds']['push'](_0x590ab3),this['_touchedNodesState']['lastTouchedId']=_0x590ab3;}const _0x7cbca1='afterbegin'===_0x1a0d41||'afterend'===_0x1a0d41?_0x221fe5['reverse']():_0x221fe5;for(const _0x2d4459 of _0x7cbca1)ms(_0x1741dc,_0x2d4459,_0x1a0d41);}['_replaceNode'](_0x1a0ffc,_0x40d682){if(!_0x1a0ffc)return;if(_0x422653=_0x40d682,Cs(gs(_0x1a0ffc))===Cs(gs(_0x422653)))return;var _0x422653;const _0x3f0471=this['_getUid'](_0x1a0ffc);ps(_0x40d682,'data-id',_0x3f0471),this['_touchedNodesState']['modifiedIds']['push'](_0x3f0471),this['_touchedNodesState']['lastTouchedId']=_0x3f0471,_0x3a530c(_0x1a0ffc,_0x40d682['cloneNode'](!0x0));}['_removeNode'](_0x2d0860,_0x587dcb,_0x18e6bd){if(_0x18e6bd&&_0x18e6bd['replaceRemovedWith']){this['_touchedNodesState']['lastTouchedId']=_0x587dcb;const _0xaf6375=_0x18e6bd['replaceRemovedWith']['cloneNode'](!0x0);ps(_0xaf6375,'data-id',_0x587dcb),ps(_0xaf6375,'data-removed','true'),_0x3a530c(_0x2d0860,_0xaf6375);}else _0x4529c2(_0x2d0860);}['_findReferenceNode'](_0x342fdb,_0x269c85,_0x9e0879){const _0x2875ec=this['_findPrevElementWithDataId'](_0x342fdb,!0x1);if(_0x2875ec){const _0x1c4680=this['_getNodeDataId'](_0x2875ec),_0x3dea3d=As('data-id',_0x1c4680,_0x9e0879);if(_0x3dea3d)return[_0x3dea3d,'afterend'];this['_touchedNodesState']['invalidIds']['push'](_0x1c4680);}const _0x1eff8e=this['_findNextElementWithDataId'](_0x342fdb,!0x1);if(_0x1eff8e){const _0x2721e9=this['_getNodeDataId'](_0x1eff8e),_0x1bbbb9=As('data-id',_0x2721e9,_0x9e0879);if(_0x1bbbb9)return[_0x1bbbb9,'beforebegin'];this['_touchedNodesState']['invalidIds']['push'](_0x2721e9);}return _0x269c85?_0x342fdb['nextSibling']?this['_findFallbackReferenceNode'](_0x342fdb,_0x9e0879):[_0x9e0879['childNodes'][_0x9e0879['childNodes']['length']-0x1],'afterend']:[_0x9e0879['childNodes'][0x0],'beforebegin'];}['_findFallbackReferenceNode'](_0x2de249,_0x4b309b){const _0x3a01d7=[],_0x196b0d=this['_findPrevElementWithDataId'](_0x2de249,!0x0);if(_0x196b0d){const _0x37d646=As('data-id',this['_getNodeDataId'](_0x196b0d),_0x4b309b);_0x37d646&&_0x3a01d7['push']([_0x37d646,'afterend']);}const _0x44ec47=this['_findNextElementWithDataId'](_0x2de249,!0x0);if(_0x44ec47){const _0x520f10=As('data-id',this['_getNodeDataId'](_0x44ec47),_0x4b309b);_0x520f10&&_0x3a01d7['push']([_0x520f10,'beforebegin']);}if(_0x3a01d7['length']>0x1)return ws(_0x3a01d7[0x0][0x0])<=ws(_0x3a01d7[0x1][0x0])?_0x3a01d7[0x0]:_0x3a01d7[0x1];return 0x1===_0x3a01d7['length']?_0x3a01d7[0x0]:[_0x4b309b['lastChild'],'afterend'];}['_findNextElementWithDataId'](_0x54678f,_0x2410b5){let _0x28ac68=_0x54678f['nextSibling'],_0x43aa68=null,_0x2d0226=!0x1;for(;_0x28ac68;){if(_0x502ab9(_0x28ac68)){if(this['_isDelNode'](_0x28ac68)&&(_0x43aa68=_0x28ac68),this['_isExistingContentComment'](_0x28ac68)&&_0x2410b5&&!_0x2d0226){_0x2d0226=!0x0,_0x28ac68=_0x28ac68['nextSibling'];continue;}break;}const _0x394af9=Es(_0x28ac68,'data-id');if(_0x394af9&&'new-element'!==_0x394af9&&this['_existingDataIds']['has'](_0x394af9)){_0x43aa68=_0x28ac68;break;}_0x28ac68=_0x28ac68['nextSibling'];}return _0x43aa68;}['_findPrevElementWithDataId'](_0x301332,_0x5891ab){let _0x45186d=_0x301332['previousSibling'],_0x27961c=null,_0x3f7b62=!0x1;for(;_0x45186d;){if(_0x502ab9(_0x45186d)){if(this['_isDelNode'](_0x45186d)&&(_0x27961c=_0x45186d),this['_isExistingContentComment'](_0x45186d)&&_0x5891ab&&!_0x3f7b62){_0x3f7b62=!0x0,_0x45186d=_0x45186d['previousSibling'];continue;}break;}const _0xa1534f=Es(_0x45186d,'data-id');if(_0xa1534f&&'new-element'!==_0xa1534f&&this['_existingDataIds']['has'](_0xa1534f)){_0x27961c=_0x45186d;break;}_0x45186d=_0x45186d['previousSibling'];}return _0x27961c;}['_markWrappedElements'](_0x42c87b){_0x60f0d2(_0x42c87b)&&Is('data-id',null,_0x42c87b)['forEach'](_0x2e0b62=>{this['_isExistingNode'](_0x2e0b62)&&(ps(_0x2e0b62,'data-wrapped-id',Es(_0x2e0b62,'data-id')),ps(_0x2e0b62,'data-id',null));});}['_processWrappedElements'](_0x4c998f,_0x53f092){Is('data-wrapped-id',null,_0x4c998f)['forEach'](_0x400796=>{const _0x3d7751=Es(_0x400796,'data-wrapped-id');if(Es(_0x400796,'data-unstable')||this['_hasUnstableParent'](_0x400796))return;const _0x512a05=As('data-id',_0x3d7751,_0x4c998f);ps(_0x400796,'data-id',_0x3d7751),ps(_0x400796,'data-wrapped-id',null),_0x512a05&&(this['_removeNode'](_0x512a05,_0x3d7751,_0x53f092),this['_touchedNodesState']['removedIds']['push'](_0x3d7751),this['_touchedNodesState']['lastTouchedId']=_0x3d7751);});}['_hasUnstableParent'](_0x207e2e){let _0x337b20=_0x207e2e['parentNode'];for(;_0x337b20;){if(Es(_0x337b20,'data-unstable'))return!0x0;_0x337b20=_0x337b20['parentNode'];}return!0x1;}['_getNodeDataId'](_0x4a9edf){if(!_0x4a9edf)return null;if(_0x60f0d2(_0x4a9edf))return Es(_0x4a9edf,'data-id');if(_0x502ab9(_0x4a9edf)){const _0x207d83=gs(_0x4a9edf)['match'](/removed[\s*-]data-id="([^"]+)"/);if(_0x207d83&&_0x207d83[0x1])return _0x207d83[0x1];}return null;}['_getUid'](_0x20eb3d){return this['_isExistingNode'](_0x20eb3d)?Es(_0x20eb3d,'data-id'):this['_generateUid']();}['_removeSpecialComments'](_0x859ffa){(function(_0x2438cf){return _0x1b48d2(_0x59331f=>_0x502ab9(_0x59331f),_0x2438cf,!0x0,0x1/0x0);}(_0x859ffa)['filter'](_0x3b05b0=>this['_isDelNode'](_0x3b05b0)||this['_isExistingContentComment'](_0x3b05b0))['forEach'](_0x552edc=>{_0x4529c2(_0x552edc);}));}['_markLastTagElementUnstable'](_0x4251cc){const _0x3749cd=_0x4251cc['childNodes'],_0x57e3df=_0x3749cd[_0x3749cd['length']-0x1];_0x57e3df&&_0x60f0d2(_0x57e3df)&&ps(_0x57e3df,'data-unstable','true');}['_markUnstableElements'](_0x248564,_0x496e3b){const _0x16ff49=As('data-unstable','true',_0x248564);if(!_0x16ff49)return;const _0x37b701=Ts(_0x16ff49)['slice'](0x0,-0x1),_0x1431b0=_0x37b701['length'];let _0x570e00=_0x16ff49;if(_0x1431b0>_0x496e3b){let _0x2b7a45=_0x1431b0,_0x414911=null;for(;_0x2b7a45>_0x496e3b&&_0x2b7a45>=0x0;)_0x2b7a45--,_0x414911=_0x37b701[_0x2b7a45];_0x414911&&(_0x570e00=_0x414911,ps(_0x16ff49,'data-unstable',null),ps(_0x414911,'data-unstable','true'));}else{if(_0x1431b0<_0x496e3b){let _0x2aa9ef=_0x1431b0,_0x5d4298=_0x16ff49;for(;_0x2aa9ef<_0x496e3b;){const _0x4d5dde=_0x5d4298['childNodes']['filter'](_0x917d64=>_0x60f0d2(_0x917d64));if(0x0===_0x4d5dde['length'])break;_0x2aa9ef++,_0x5d4298=_0x4d5dde[_0x4d5dde['length']-0x1];}_0x5d4298&&(_0x570e00=_0x5d4298,ps(_0x16ff49,'data-unstable',null),ps(_0x5d4298,'data-unstable','true'));}}let _0x34398d=_0x570e00;for(;_0x34398d;){for(;_0x34398d['nextSibling'];)_0x34398d=_0x34398d['nextSibling'],_0x60f0d2(_0x34398d)&&ps(_0x34398d,'data-unstable','true');_0x34398d=_0x34398d['parentNode'];}}['_isNewNode'](_0x3442a6){return Boolean('new-element'===Es(_0x3442a6,'data-id'));}['_isExistingNode'](_0xbceef0){return Boolean((Es(_0xbceef0,'data-id')||'')['length']>0x0&&'new-element'!==Es(_0xbceef0,'data-id'));}['_isDelNode'](_0x190e59){return!!_0x190e59&&Boolean(_0x502ab9(_0x190e59)&&gs(_0x190e59)['match'](/removed[\s*-]data-id="[^"]+"/));}['_isExistingContentComment'](_0x2578a6){return Boolean(_0x502ab9(_0x2578a6)&&gs(_0x2578a6)['match'](/\s*existing[\s*-](content|document)\s*/g));}}function Rs({editor:_0x43d359,changeGroups:_0x47b8c3,documentContextContent:_0x451827,showDiff:_0x4d7059,trimUnchanged:_0x459416=!0x0}){return _0x47b8c3['map'](_0x3d465e=>{const _0x45307e=new _0x36408a([]),_0x37a98d=new _0x36408a([]),_0x4b6339=new Set();for(const _0x55ceb9 of _0x3d465e['changes'])'new'==_0x55ceb9['type']&&Is('data-id',null,_0x55ceb9['node'])['forEach'](_0x1d70c6=>{_0x4b6339['add'](Es(_0x1d70c6,'data-id'));});for(const _0x1500be of _0x3d465e['changes'])if('removed'!=_0x1500be['type']?_0x37a98d['children']['push'](_0x1500be['node']['cloneNode'](!0x0)):_0x4d7059||_0x4b6339['has'](_0x1500be['id'])||_0x37a98d['children']['push'](_0x1500be['node']['cloneNode'](!0x0)),'new'!=_0x1500be['type']&&(_0x4d7059||'removed'!=_0x1500be['type'])){const _0x234fb5=_0x3f6b28(_0x1242f4=>Es(_0x1242f4,'data-id')==_0x1500be['id'],_0x451827,!0x0);_0x234fb5&&_0x45307e['children']['push'](_0x234fb5['cloneNode'](!0x0));}const {content:_0x4d5b32,hasChanges:_0x5bd93b}=function(_0x44bdcb,_0x3f5110,_0x2fde40,_0x393e4b,_0x2f0bdd=!0x0){const _0x24646e=_0x44bdcb['plugins']['get']('DocumentCompare'),_0x120b7a=gs(_0x3f5110),_0x4bb08f=gs(_0x2fde40),_0x47e352=_0x44bdcb['data']['parse'](_0x120b7a,'$root'),_0x58f8f9=_0x44bdcb['model']['createPositionAt'](_0x47e352,0x0),_0x10a1a0=_0x24646e['getDiff'](_0x120b7a,_0x4bb08f,{'anchor':_0x58f8f9,'markDeletions':_0x393e4b,'targetEditor':_0x44bdcb}),_0x270527=_0x10a1a0['getOperations']();if(0x0==_0x270527['length'])return{'content':_0x3f5110['cloneNode'](!0x0),'hasChanges':!0x1};_0x393e4b?function(_0x291e34,_0x52f349,_0x130d81){if(0x0==_0x291e34['length'])return;const _0x1e486c=_0x130d81['plugins']['get']('DocumentCompare'),_0x29a7bf=_0x130d81['plugins']['get']('SuggestionsConversion');_0x130d81['model']['change'](_0xc02c44=>{const _0x131766=new Set();for(let _0x4a8dd8=0x0;_0x4a8dd8<_0x291e34['length'];_0x4a8dd8++){const _0x401772=_0x291e34[_0x4a8dd8];if(_0x401772['baseVersion']=null,_0x401772['isDocumentOperation']=!0x1,_0x1e486c['isMarkedRemoveOperation'](_0x401772)){const _0x2a9e67=_0x2bb93e(_0x401772['newRange'],_0x130d81['model']),_0x4ac87e='suggestion:deletion:'+ot()+':$aiSuggestion';_0x52f349['markers']['set'](_0x4ac87e,_0x2a9e67);}else switch(_0x401772['type']){case'rename':{if(_0x401772['oldName']==_0x401772['newName'])break;_0xc02c44['batch']['addOperation'](_0x401772),_0x130d81['model']['applyOperation'](_0x401772);const _0x45d8a4='$elementName',_0x934369=_0x401772['position'],_0x1f8046=_0x130d81['model']['createRange'](_0x934369,_0x130d81['model']['createPositionAt'](_0x934369['nodeAfter'],'end')),_0x10496b='suggestion:attribute:'+_0x45d8a4+':'+ot()+':$aiSuggestion';_0x52f349['markers']['set'](_0x10496b,_0x1f8046);break;}case'addAttribute':case'removeAttribute':case'changeAttribute':{if(_0x401772['oldValue']==_0x401772['newValue'])break;_0xc02c44['batch']['addOperation'](_0x401772),_0x130d81['model']['applyOperation'](_0x401772);const _0x455b24=_0x401772['key'];if(!_0x29a7bf['isRegisteredAttribute'](_0x455b24))break;const _0x5de566=_0x2bb93e(_0x401772['range'],_0x130d81['model']),_0x49affc='suggestion:attribute:'+_0x455b24+':'+ot()+':$aiSuggestion';_0x52f349['markers']['set'](_0x49affc,_0x5de566);break;}case'insert':{_0xc02c44['batch']['addOperation'](_0x401772),_0x130d81['model']['applyOperation'](_0x401772);if(_0x291e34[_0x4a8dd8+0x1]&&'move'==_0x291e34[_0x4a8dd8+0x1]['type']){Os(_0x52f349,_0x401772);break;}const _0x1eb368=_0x401772['position'],_0x2c993a=_0x401772['howMany'],_0x43da73=_0x2bb93e(_0x130d81['model']['createRange'](_0x1eb368,_0x1eb368['getShiftedBy'](_0x2c993a)),_0x130d81['model']),_0x5be9d5='suggestion:insertion:'+ot()+':$aiSuggestion';_0x52f349['markers']['set'](_0x5be9d5,_0x43da73);break;}case'split':{_0xc02c44['batch']['addOperation'](_0x401772),_0x130d81['model']['applyOperation'](_0x401772);const _0x47cd97=_0x401772['splitPosition'],_0x596a5d=_0x401772['moveTargetPosition'],_0x1876c5=_0x130d81['model']['createRange'](_0x47cd97,_0x596a5d),_0x121632='suggestion:insertion:'+ot()+':$aiSuggestion';_0x52f349['markers']['set'](_0x121632,_0x1876c5);break;}case'move':{_0xc02c44['batch']['addOperation'](_0x401772),_0x130d81['model']['applyOperation'](_0x401772),_0x291e34[_0x4a8dd8-0x1]&&'insert'==_0x291e34[_0x4a8dd8-0x1]['type']&&Os(_0x52f349,_0x401772);const _0x5ccce3=_0x401772['getMovedRangeStart'](),_0x157150=_0x401772['howMany'];for(let _0x2fd2d6=0x0;_0x2fd2d6<_0x157150;_0x2fd2d6++){const _0x523a54=_0x5ccce3['getShiftedBy'](_0x2fd2d6)['nodeAfter'];_0x131766['add'](_0x523a54);}break;}case'remove':{const _0x8b084a=_0x401772['sourcePosition'],_0x7ba983=_0x401772['howMany'],_0x2192b5=new _0x349a38(_0x8b084a,_0x7ba983);_0xc02c44['batch']['addOperation'](_0x2192b5),_0x130d81['model']['applyOperation'](_0x2192b5);break;}}}for(const _0x2233f7 of _0x131766){const _0x26a847=_0x130d81['model']['createRangeOn'](_0x2233f7),_0x2d7445='suggestion:formatBlock:$fakeWrap:'+ot()+':$aiSuggestion';_0x52f349['markers']['set'](_0x2d7445,_0x2bb93e(_0x26a847,_0x130d81['model']));}});}(_0x270527,_0x47e352,_0x44bdcb):_0x44bdcb['model']['change'](_0x408bbc=>{for(const _0x5a3636 of _0x270527)if('remove'==_0x5a3636['type']){const _0x222c0b=_0x5a3636['sourcePosition'],_0x3b9950=_0x5a3636['howMany'],_0x3e3ae4=new _0x349a38(_0x222c0b,_0x3b9950);_0x408bbc['batch']['addOperation'](_0x3e3ae4),_0x44bdcb['model']['applyOperation'](_0x3e3ae4);}else{if('marker'==_0x5a3636['type']){const _0x725194=_0x5a3636['name'],_0x3b7e2b=_0x5a3636['newRange'];null!==_0x3b7e2b?_0x47e352['markers']['set'](_0x725194,_0x3b7e2b):_0x47e352['markers']['delete'](_0x725194);}else _0x5a3636['baseVersion']=null,_0x5a3636['isDocumentOperation']=!0x1,_0x408bbc['batch']['addOperation'](_0x5a3636),_0x44bdcb['model']['applyOperation'](_0x5a3636);}});if(_0x2f0bdd){const _0x1dda12=ks(_0x44bdcb,_0x270527,_0x47e352);Ns(_0x44bdcb['model'],_0x1dda12),function(_0x97c707,_0x354e84){const _0x50b7e7=_0x354e84['getFirstRange']()['start'];let _0x54639a=_0x354e84['getFirstRange']()['end'];const _0xa0989c=_0x50b7e7['root'];(_0x54639a['textNode']||_0x54639a['nodeAfter']&&_0x54639a['nodeAfter']['is']('$text'))&&(_0xf2ea81(_0x54639a,'...'),_0x54639a=_0x54639a['getShiftedBy'](0x3)),(_0x50b7e7['textNode']||_0x50b7e7['nodeBefore']&&_0x50b7e7['nodeBefore']['is']('$text'))&&(_0xf2ea81(_0x50b7e7,'...'),function(_0x4747c9,_0x554aa9,_0x550e70){for(let [_0x2dadae,_0x4b2dc9]of _0x4747c9['markers']){const _0x422897=_0x4b2dc9['_getTransformedByInsertion'](_0x554aa9,_0x550e70,!0x1);_0x4b2dc9=_0x422897[0x0],_0x4747c9['markers']['set'](_0x2dadae,_0x4b2dc9);}}(_0xa0989c,_0x50b7e7,0x3),_0x50b7e7['parent']==_0x54639a['parent']&&(_0x54639a=_0x54639a['getShiftedBy'](0x3)));const _0x4d83a4=_0x97c707['createRange'](_0x97c707['createPositionAt'](_0xa0989c,0x0),_0x50b7e7),_0x500901=_0x97c707['createRange'](_0x54639a,_0x97c707['createPositionAt'](_0xa0989c,'end')),_0x585274=[..._0x4d83a4['getMinimalFlatRanges'](),..._0x500901['getMinimalFlatRanges']()];_0x585274['reverse']();for(const _0x2f9af2 of _0x585274)_0x2c3240(_0x2f9af2),ys(_0xa0989c,_0x2f9af2);}(_0x44bdcb['model'],_0x1dda12);}const _0x314d19=_0x44bdcb['data']['stringify'](_0x47e352,{'showSuggestionHighlights':!0x0});return{'content':_s(_0x314d19),'hasChanges':!0x0};}(_0x43d359,_0x45307e,_0x37a98d,_0x4d7059,_0x459416);return{'type':_0x3d465e['changes'][0x0]['type'],'index':_0x3d465e['index'],'content':_0x4d5b32,'hasChanges':_0x5bd93b};});}function Os(_0x425987,_0x3a7cd0){for(const [_0x53bdd4,_0x2cbadf]of _0x425987['markers']){const _0x2bd7df=_0x2a951f['_createFromRanges'](_0x2cbadf['getTransformedByOperation'](_0x3a7cd0));_0x425987['markers']['set'](_0x53bdd4,_0x2bd7df);}}function ks(_0x3b3a08,_0x20cfdd,_0x522f7e){const _0x3cd7e3=_0x3b3a08['plugins']['get']('DocumentCompare');let _0x2c4c5b=_0x3b3a08['model']['createPositionAt'](_0x522f7e,Number['POSITIVE_INFINITY']),_0x1f795d=_0x3b3a08['model']['createPositionAt'](_0x522f7e,0x0);for(const _0x4ce68d of _0x20cfdd){let _0x351952,_0x3a7538;if(_0x3cd7e3['isMarkedRemoveOperation'](_0x4ce68d))_0x351952=_0x4ce68d['newRange']['start'],_0x3a7538=_0x4ce68d['newRange']['end'];else switch(_0x2c4c5b=_0x2c4c5b['getTransformedByOperation'](_0x4ce68d),_0x1f795d=_0x1f795d['getTransformedByOperation'](_0x4ce68d),_0x4ce68d['type']){case'rename':_0x351952=_0x4ce68d['position'],_0x3a7538=_0x351952['getShiftedBy'](0x1);break;case'addAttribute':case'removeAttribute':case'changeAttribute':_0x351952=_0x4ce68d['range']['start'],_0x3a7538=_0x4ce68d['range']['end'];break;case'insert':_0x351952=_0x4ce68d['position'],_0x3a7538=_0x351952['getShiftedBy'](_0x4ce68d['howMany']);break;case'split':_0x351952=_0x4ce68d['splitPosition'],_0x3a7538=_0x4ce68d['moveTargetPosition'];break;case'merge':{const _0x23b856=_0x4ce68d['targetPosition']['path']['slice'](0x0,-0x1);_0x351952=_0x3b3a08['model']['createPositionFromPath'](_0x522f7e,_0x23b856),_0x3a7538=_0x351952['getShiftedBy'](0x1);break;}case'move':case'remove':{const _0x21e22c=_0x4ce68d['howMany'],_0x1f54a2=_0x4ce68d['sourcePosition']['_getTransformedByInsertion'](_0x4ce68d['targetPosition'],_0x21e22c),_0x4fdfa1=_0x4ce68d['getMovedRangeStart']();'remove'==_0x4ce68d['type']?(_0x351952=_0x1f54a2,_0x3a7538=_0x1f54a2):(_0x351952=_0x4fdfa1,_0x3a7538=_0x4fdfa1['getShiftedBy'](_0x21e22c));break;}}_0x351952&&_0x351952['isBefore'](_0x2c4c5b)&&(_0x2c4c5b=_0x351952['clone'](),_0x2c4c5b['stickiness']='toNone'),_0x3a7538&&_0x3a7538['isAfter'](_0x1f795d)&&(_0x1f795d=_0x3a7538['clone'](),_0x1f795d['stickiness']='toNone');}return _0x3b3a08['model']['createSelection'](_0x3b3a08['model']['createRange'](_0x2c4c5b,_0x1f795d));}function Ns(_0x3f3ef9,_0x49abc6){vs(_0x3f3ef9,_0x49abc6,'forward');const _0x3437e9=_0x49abc6['getFirstRange']();_0x49abc6['setTo']([]),_0x49abc6['setTo'](_0x3437e9,{'backward':!0x0}),vs(_0x3f3ef9,_0x49abc6,'backward');}function vs(_0x16cf68,_0x44f2f5,_0xdd0f85){let _0x468143=0x14;for(;_0x468143;){_0x16cf68['modifySelection'](_0x44f2f5,{'unit':'word','direction':_0xdd0f85}),_0x468143--;const _0x2821cc=_0x44f2f5['focus']['forward'==_0xdd0f85?'nodeBefore':'nodeAfter'];if(_0x2821cc&&_0x2821cc['is']('element')&&_0x16cf68['schema']['isBlock'](_0x2821cc)&&_0x16cf68['schema']['isObject'](_0x2821cc))break;}}function ys(_0x3932c9,_0x28ae1d){for(const [_0x219b09,_0xeacf3f]of _0x3932c9['markers']){const _0x4a76f1=_0xeacf3f['_getTransformedByDeletion'](_0x28ae1d['start'],_0x28ae1d['end']['offset']-_0x28ae1d['start']['offset']);null!=_0x4a76f1?_0x3932c9['markers']['set'](_0x219b09,_0x4a76f1):_0x3932c9['markers']['delete'](_0x219b09);}}class xs extends ht(){['id'];['interactionId'];['type'];['sources']=[];['parsedContent']=new _0x36408a([]);['parsedMergedContent']=new _0x36408a([]);['changeGroups']=[];['areActionsDisabled']=!0x1;['isFromHistory']=!0x1;['documentContextContent'];['documentId'];['dataIdDocumentSources'];['newNodeAnchorIds']=new Map();['aiResponseParser'];['aiResponseApplier'];['locale'];['cachedSuggestionContentParts']={'withDiff':[],'withoutDiff':[]};constructor({type:_0x5a0619,content:_0x317344='',isDone:_0x5c6a28=!0x1,isComplete:_0x3f5de8,interactionId:_0x4c8e95,areActionsDisabled:_0x577f8d,isFromHistory:_0x2f4dca=!0x1,documentContextContent:_0x56de43,dataIdDocumentSources:_0x52e95e,documentId:_0x5a4364,locale:_0x2e0f4e,id:_0x4be8eb}){super(),this['id']=_0x4be8eb||ot(),this['interactionId']=_0x4c8e95,this['type']=_0x5a0619,this['areActionsDisabled']=!!_0x577f8d,this['locale']=_0x2e0f4e,this['dataIdDocumentSources']=_0x52e95e,this['documentId']=_0x5a4364,this['isFromHistory']=_0x2f4dca,this['aiResponseParser']=new bs(),this['aiResponseApplier']=new Ss(),this['documentContextContent']=_s(_0x56de43||''),this['set']('isDone',_0x5c6a28),this['set']('isComplete',_0x3f5de8??_0x5c6a28),this['on']('change:content',()=>{this['onContentChange']();}),this['set']('content',_0x317344);}['appendContent'](_0x1e339d){this['set']('content',this['content']+_0x1e339d);}['done'](_0x28e990=!0x0){this['isComplete']=_0x28e990,this['isDone']||(this['set']('isDone',!0x0),this['onContentChange']());}['destroy'](){this['stopListening']();}['setChangeGroupState'](_0x5f56a4,_0x410c36){this['changeGroups'][_0x5f56a4]['state']=_0x410c36,this['fire']('replyChangeGroupStateUpdated',{'reply':this,'index':_0x5f56a4,'state':_0x410c36});}['getContentParts']({showDiff:_0x31be88,groupIndex:_0x48945b,editor:_0x56e7f4}){const _0x1820ee=this['_getCachedContentParts'](_0x31be88,_0x48945b);if(_0x1820ee)return _0x1820ee;let _0xc643c4=[];if(void 0x0===_0x48945b)_0xc643c4=this['changeGroups'];else{const _0x24f2ca=this['changeGroups']['find'](({index:_0x5774e0})=>_0x5774e0===_0x48945b);if(!_0x24f2ca)throw new at('ai-reply-get-content-parts-group-not-found',null,{'aiReply':this,'groupIndex':_0x48945b});_0xc643c4=[_0x24f2ca];}const _0x50ee85=Rs({'editor':_0x56e7f4,'showDiff':_0x31be88,'changeGroups':_0xc643c4,'documentContextContent':this['documentContextContent']});return this['_setCachedContentParts'](_0x31be88,_0x50ee85),_0x50ee85;}['_getCachedContentParts'](_0x55075b,_0x2ee5d3){const _0x312897=_0x55075b?'withDiff':'withoutDiff';if(!this['cachedSuggestionContentParts'][_0x312897]['length'])return null;const _0x82cfdb=this['cachedSuggestionContentParts'][_0x312897];if(void 0x0===_0x2ee5d3)return _0x82cfdb['length']>0x0&&_0x82cfdb['length']!==this['changeGroups']['length']?(this['_setCachedContentParts'](_0x55075b,null),null):_0x5c6558(_0x82cfdb);{const _0x43fb64=_0x82cfdb['find'](({index:_0x49cff1})=>_0x49cff1===_0x2ee5d3);if(_0x43fb64)return[_0x5c6558(_0x43fb64)];}return null;}['_setCachedContentParts'](_0x114eb8,_0x3f4ce4){const _0x1ec396=_0x114eb8?'withDiff':'withoutDiff';_0x3f4ce4?_0x3f4ce4['forEach'](_0x548e94=>{const _0x486ad6=this['cachedSuggestionContentParts'][_0x1ec396],_0x5f4b6f=_0x486ad6['find'](({index:_0x2bbdf9})=>_0x2bbdf9===_0x548e94['index']);if(_0x5f4b6f){const _0x28e7aa=_0x486ad6['indexOf'](_0x5f4b6f);_0x486ad6['splice'](_0x28e7aa,0x1,_0x548e94);}else _0x486ad6['push'](_0x548e94);}):this['cachedSuggestionContentParts'][_0x1ec396]['length']=0x0;}['onContentChange'](){if('modification'===this['type']){this['parsedContent']=this['aiResponseParser']['parseAndNormalizeHTML'](this['content']);const _0x1620b7=this['changeGroups'];this['updateChangeGroups']();const _0xed7459=this['_getDifferentChangeGroups'](_0x1620b7,this['changeGroups']);(_0xed7459['length']||this['isDone'])&&(this['fire']('replyContentUpdated',this,_0xed7459),this['cachedSuggestionContentParts']['withDiff']['length']=this['cachedSuggestionContentParts']['withoutDiff']['length']=0x0);}else this['parsedContent']=this['aiResponseParser']['convertMarkdownToHTML'](this['content']),this['fire']('replyContentUpdated',this);}['_getDifferentChangeGroups'](_0x5f0c4a,_0x21cfd6){const _0x5ab0fb=[];for(const _0x36323e of _0x21cfd6){const _0x311c7d=_0x5f0c4a[_0x36323e['index']];_0x311c7d?_0x311c7d['changes']['length']!==_0x36323e['changes']['length']?_0x5ab0fb['push'](_0x36323e):_0x311c7d['changes']['forEach']((_0x1dd897,_0x85294d)=>{const _0x3e5856=_0x36323e['changes'][_0x85294d];_0x1dd897['id']!==_0x3e5856['id']&&_0x5ab0fb['push'](_0x36323e);}):_0x5ab0fb['push'](_0x36323e);}return _0x5ab0fb;}['updateChangeGroups'](){const _0x1e1409=this['locale']?new _0x2b2f52('p',{},[new _0x2b2f52('span',{'style':'color:\x20#808080;\x20font-style:\x20italic'},[new _0x3f4e70(hs(this['locale'],'AI_SUGGESTION_CONTENT_PART_REMOVED'))])]):void 0x0,_0x5585a4=this['aiResponseApplier']['merge'](this['parsedContent'],this['documentContextContent']['cloneNode'](!0x0),{'markUnstableElements':!this['isDone']||!this['isComplete'],'replaceRemovedWith':_0x1e1409,'cutAfterLastChange':!this['isDone']||!this['isComplete']});if(!_0x5585a4['modifiedNodeIds']['length']&&!this['isDone'])return;this['parsedMergedContent']=_0x5585a4['parsedContent'],this['newNodeAnchorIds']=_0x5585a4['newAnchorIds'];let _0x486f26=[];if(_0x364046(_0x56e77d=>{const _0x5db686=Es(_0x56e77d,'data-id');if(!_0x5db686||!_0x144529(_0x5db686))return!0x1;const _0x408554=[_0x56e77d,...Ts(_0x56e77d)]['at'](-0x2);if(_0x56e77d!=_0x408554){const _0x1c3993=Es(_0x408554,'data-id');_0x144529(_0x1c3993)||(_0x486f26['push']({'node':_0x408554,'id':_0x1c3993,'type':'modified'}),_0x5585a4['modifiedNodeIds']['push'](_0x1c3993));}else _0x5585a4['modifiedNodeIds']['includes'](_0x5db686)?_0x486f26['push']({'node':_0x56e77d,'type':'modified','id':_0x5db686}):_0x5585a4['newNodeIds']['includes'](_0x5db686)?_0x486f26['push']({'node':_0x56e77d,'type':'new','id':_0x5db686,'anchorId':Es(_0x56e77d['previousSibling'],'data-id')}):_0x486f26['push']({'node':_0x56e77d,'type':'removed','id':_0x5db686});return!0x0;},this['parsedMergedContent']),_0x486f26=_0x486f26['filter'](({node:_0x5092e6})=>[...Ts(_0x5092e6),_0x5092e6]['every'](_0x530722=>!Es(_0x530722,'data-unstable'))),0x0==_0x486f26['length'])return;const _0x67d149=[[_0x486f26[0x0]]];for(let _0x25b1bc=0x1;_0x25b1bc<_0x486f26['length'];_0x25b1bc++){const _0x5e9cc0=_0x67d149[_0x67d149['length']-0x1],_0x1d938b=_0x5e9cc0[_0x5e9cc0['length']-0x1];_0x486f26[_0x25b1bc]['node']['previousSibling']==_0x1d938b['node']&&'modified'!=_0x486f26[_0x25b1bc]['type']&&'modified'!=_0x1d938b['type']&&this['_isSameDocument'](_0x486f26[_0x25b1bc]['node'],_0x1d938b['node'])?_0x5e9cc0['push'](_0x486f26[_0x25b1bc]):_0x67d149['push']([_0x486f26[_0x25b1bc]]);}for(const _0x1005f0 of _0x67d149){const _0x259d7e=_0x1005f0[0x0],_0x176079=_0x1005f0[_0x1005f0['length']-0x1],_0x56bfdc=_0x5143e0(_0x259d7e['node']['previousSibling']);_0x56bfdc&&this['_isSameDocument'](_0x56bfdc['node'],_0x259d7e['node'])&&_0x1005f0['unshift'](_0x56bfdc);const _0x557d10=_0x5143e0(_0x176079['node']['nextSibling']);_0x557d10&&this['_isSameDocument'](_0x557d10['node'],_0x176079['node'])&&_0x1005f0['push'](_0x557d10);}function _0x144529(_0x125b52){return _0x5585a4['modifiedNodeIds']['includes'](_0x125b52)||_0x5585a4['newNodeIds']['includes'](_0x125b52)||_0x5585a4['removedNodeIds']['includes'](_0x125b52);}function _0x5143e0(_0x1ca3f3){if(_0x1ca3f3&&Es(_0x1ca3f3,'data-id')&&!Es(_0x1ca3f3,'data-unstable')){const _0x1982a4=Es(_0x1ca3f3,'data-id');if(!_0x144529(_0x1982a4))return{'node':_0x1ca3f3,'type':'context','id':_0x1982a4};}return null;}this['changeGroups']=_0x67d149['map']((_0x454aed,_0x500d5f)=>({'changes':_0x454aed,'state':'pending','index':_0x500d5f}));}['_isSameDocument'](_0x595ad1,_0x3d2b75){if(!this['dataIdDocumentSources']?.['size'])return!0x0;const _0x751260=this['_resolveDocumentSource'](_0x595ad1),_0x5b34b8=this['_resolveDocumentSource'](_0x3d2b75);return!_0x751260||!_0x5b34b8||_0x751260['editor']===_0x5b34b8['editor']&&_0x751260['rootName']===_0x5b34b8['rootName'];}['_resolveDocumentSource'](_0x105662){if(!_0x105662||!this['dataIdDocumentSources'])return;const _0x3d05c7=Es(_0x105662,'data-id');if(_0x3d05c7){const _0x354e68=this['dataIdDocumentSources']['get'](_0x3d05c7);if(_0x354e68)return _0x354e68;const _0x314b08=this['newNodeAnchorIds']['get'](_0x3d05c7),_0x5cca4b=_0x314b08?this['dataIdDocumentSources']['get'](_0x314b08):void 0x0;if(_0x5cca4b)return _0x5cca4b;}for(let _0x550602=_0x105662['previousSibling'];_0x550602;_0x550602=_0x550602['previousSibling']){const _0x4fd319=Es(_0x550602,'data-id'),_0x4c3183=_0x4fd319?this['dataIdDocumentSources']['get'](_0x4fd319):void 0x0;if(_0x4c3183)return _0x4c3183;}for(let _0x542b50=_0x105662['nextSibling'];_0x542b50;_0x542b50=_0x542b50['nextSibling']){const _0x23a87d=Es(_0x542b50,'data-id'),_0x385a1f=_0x23a87d?this['dataIdDocumentSources']['get'](_0x23a87d):void 0x0;if(_0x385a1f)return _0x385a1f;}}}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:_0x10d9e5,locale:_0x257ebe}){super(),this['id']=ot(),this['connector']=_0x10d9e5,this['isStopped']=!0x0,this['locale']=_0x257ebe;}async['start'](){const _0x24313b=[];let _0x13610e,_0x1800b2,_0x3944fd,_0xfee3dd=!0x1;this['isStopped']=!0x1;try{this['currentRequest']=await this['sendRequest'](),this['fire']('interactionStarted',this);const _0x4f65d1=await this['currentRequest']['getStream']();for await(const _0x87ad6f of _0x4f65d1){if(this['isStopped'])return;if('error'==_0x87ad6f['event'])return void this['fire']('error',{'error':new at('ai-chat-interaction-error',this)});switch(_0x87ad6f['event']){case'message-metadata':this['messageId']=_0x87ad6f['data']['messageId'];break;case'action-metadata':this['actionCallId']=_0x87ad6f['data']['callId'];break;case'conversation-title':this['setConversationTitle'](_0x87ad6f['data']['conversationTitle'],!0x0);break;case'source':_0x24313b['push'](_0x87ad6f['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'](),_0x13610e='modification-delta'==_0x87ad6f['event']?'modification':'text',_0x1800b2='modification-delta'==_0x87ad6f['event']?_0x87ad6f['data']['id']:void 0x0,this['currentReply']&&this['currentReply']['type']!=_0x13610e&&(this['currentReply']['done'](),this['currentReply']=void 0x0),this['currentReply']?'modification-delta'==_0x87ad6f['event']&&(this['currentReply']['documentId']=_0x87ad6f['data']['documentId']):(this['currentReply']=this['createReply']({'type':_0x13610e,'interactionId':this['id'],'id':_0x1800b2,...'modification-delta'==_0x87ad6f['event']&&{'documentId':_0x87ad6f['data']['documentId']}}),'modification'==_0x13610e&&(this['currentReply']['sources']=_0x24313b['splice'](0x0))),this['currentReply']['appendContent'](_0x87ad6f['data']['textDelta']);break;case'mcp-tool-result':_0x3944fd=JSON['parse'](_0x87ad6f['data']['result']),this['_handleToolResultData']({'toolName':_0x87ad6f['data']['toolName'],'data':_0x3944fd['data'],'attributes':_0x3944fd['attributes']});break;case'mcp-tool-notification':this['_handleToolNotificationData']({'toolName':_0x87ad6f['data']['toolName'],'data':_0x87ad6f['data']['data']});}}_0xfee3dd=!0x0;}finally{this['isStopped']||(this['currentReply']&&_0x24313b['length']>0x0&&(this['currentReply']['sources']=_0x24313b['splice'](0x0)),this['_finalizeInteraction'](_0xfee3dd),this['fire']('interactionFinished',this));}}['stop'](){this['isStopped']||(this['_finalizeInteraction'](),this['fire']('interactionStopped',this));}['getReply'](_0x282074){return this['replies']['find'](_0x52cb7d=>_0x52cb7d['id']===_0x282074);}['destroy'](){this['isDestroyed']||(this['stop'](),this['replies']['forEach'](_0x1e1e8a=>_0x1e1e8a['destroy']()),this['replies']=[],this['isDestroyed']=!0x0,this['fire']('interactionDestroyed',this),this['stopListening']());}['createReply'](_0x71fc66){const _0x26a74b=new xs({'locale':this['locale'],'documentContextContent':this['getDocumentContext']()?.['content'],'dataIdDocumentSources':this['getDocumentContext']()?.['dataIdDocumentSources'],..._0x71fc66});return this['replies']['push'](_0x26a74b),_0x26a74b['delegate'](...Ls)['to'](this),this['fire']('replyCreated',_0x26a74b),_0x26a74b;}['setConversationTitle'](_0x19cf71,_0xbdb26e=!0x1){this['fire']('setConversationTitle',_0x19cf71,_0xbdb26e);}['resetWebSearchState'](){this['_isWebSearching']&&(this['_isWebSearching']=!0x1,this['fire']('webSearchFinished',this));}['resetReasoningState'](){this['_isReasoning']&&(this['_isReasoning']=!0x1,this['fire']('reasoningFinished',this));}['_handleToolResultData'](_0x21b7ad){this['fire']('toolDataReceived',{'type':'result','toolName':_0x21b7ad['toolName'],'data':structuredClone(_0x21b7ad['data']||{}),'attributes':structuredClone(_0x21b7ad['attributes']||{})},this);}['_handleToolNotificationData'](_0x361be1){this['fire']('toolDataReceived',{'type':'notification','toolName':_0x361be1['toolName'],'data':structuredClone(_0x361be1['data'])},this);}['_finalizeInteraction'](_0x168321=!0x1){this['isStopped']=!0x0,this['currentRequest']&&this['currentRequest']['abortController']['abort'](),this['currentReply']&&this['currentReply']['done'](_0x168321),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:_0x347870,config:_0x2f17a9,ownerId:_0x1176b0}){super(),this['_connector']=_0x347870,this['_config']=_0x2f17a9,this['_ownerId']=_0x1176b0;}['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'](_0x840521){if(_0x840521)return this['_documentSources']['get'](_0x840521);}['getSourceByDataId'](_0x25bff5){if(_0x25bff5)return this['_dataIdToSource']['get'](_0x25bff5);}['getDocumentContextSlice'](_0x3ac5df){const _0x4437fe=this['getDocumentSource'](_0x3ac5df);if(_0x4437fe)return{'editor':_0x4437fe['editor'],'rootName':_0x4437fe['rootName'],'html':_0x4437fe['content'],'version':_0x4437fe['version']};}['getDocumentContextSliceByDataId'](_0xb247ce){const _0x557c59=this['getSourceByDataId'](_0xb247ce);return _0x557c59?this['getDocumentContextSlice'](_0x557c59['documentId']):void 0x0;}['getPendingContextItems'](){return this['_pendingContextItems'];}async['populateFromMessage'](_0x12842b){const _0x34fd97=await this['_createContextItemFromContent'](_0x12842b);return this['_addToConversationContextItem'](_0x34fd97),'current-document'===_0x34fd97['uiId']&&this['_toggleAddCurrentDocumentOptionVisibility'](),_0x34fd97;}async['populateDocumentsFromUserMessage'](_0x2c2171,_0x1a7d05){const _0x15d0e2=_0x2c2171['filter'](_0x37a4c4=>'document'===_0x37a4c4['type']);if(0x0===_0x15d0e2['length'])return{'hasUnmatched':!0x1};if(0x1===_0x15d0e2['length'])return{'contextItem':await this['populateFromMessage'](_0x15d0e2[0x0]),'hasUnmatched':!0x1};const _0x404989=_0x15d0e2['map'](_0x9f89fb=>_0x9f89fb['id']),_0x1a59a1=await this['_connector']['fetchDocuments'](this['_ownerId'],_0x404989)['getDocuments'](),_0x442059=new Map(_0x1a59a1['map'](_0x26b96b=>[_0x26b96b['id'],_0x26b96b]));this['_documentSources']['clear'](),this['_dataIdToSource']['clear']();const _0x2c735b=[];let _0x1a5c10=!0x1;for(const _0x4038c1 of _0x15d0e2){const _0x16a384=_0x442059['get'](_0x4038c1['id']);if(!_0x16a384)continue;const _0x530824=this['_matchDocumentToRoot'](_0x16a384,_0x1a7d05),_0x29cb1f=_0x1a7d05[0x0]&&this['_getFirstRoot'](_0x1a7d05[0x0]);_0x530824||(_0x1a5c10=!0x0);const _0xc00c6f=_0x530824?.['editor']??_0x29cb1f?.['editor'],_0x5bbdd4=_0x530824?.['rootName']??_0x29cb1f?.['rootName'];if(_0xc00c6f&&_0x5bbdd4){const _0x5c745a={'editor':_0xc00c6f,'rootName':_0x5bbdd4,'content':_0x16a384['content'],'version':_0x16a384['attributes']?.['version']??0x0,'name':_0x16a384['name'],'description':_0x16a384['description']};this['_documentSources']['set'](_0x16a384['id'],_0x5c745a);const _0xe62f89=_s(_0x16a384['content']);for(const _0x33da0f of _0x364046(_0x3b6392=>!!Es(_0x3b6392,'data-id'),_0xe62f89)){const _0x25924d=Es(_0x33da0f,'data-id');_0x25924d&&this['_dataIdToSource']['set'](_0x25924d,{..._0x5c745a,'documentId':_0x16a384['id']});}}_0x2c735b['push']({'id':_0x16a384['id'],'content':_0x16a384['content'],'version':_0x16a384['attributes']?.['version']??0x0,'sessionId':_0x16a384['attributes']?.['sessionId']??null,'selection':[]});}const _0x2718fa={'id':'current-document','uiId':'current-document','label':'Current\x20document','type':'document','hidden':this['_conversationContextItems']['has']('current-document'),'documents':_0x2c735b,'dataIdDocumentSources':new Map(this['_dataIdToSource'])};return this['_addToConversationContextItem'](_0x2718fa),this['_toggleAddCurrentDocumentOptionVisibility'](),{'contextItem':_0x2718fa,'hasUnmatched':_0x1a5c10};}['_matchDocumentToRoot'](_0x264b5c,_0x3fb23f){if(_0x264b5c['name'])for(const _0x2c92dc of _0x3fb23f){const _0x48cd8d=_0x2c92dc['config']['get']('roots')||{};for(const _0xa9bec7 of _0x2c92dc['model']['document']['getRoots']()){if('$graveyard'===_0xa9bec7['rootName'])continue;const _0x43ebae=_0x48cd8d[_0xa9bec7['rootName']];if(_0xa9bec7['rootName']===_0x264b5c['name']&&_0x43ebae?.['description']===_0x264b5c['description'])return{'editor':_0x2c92dc,'rootName':_0xa9bec7['rootName']};}}}['_getFirstRoot'](_0x4db37f){for(const _0x2efadd of _0x4db37f['model']['document']['getRoots']())if('$graveyard'!==_0x2efadd['rootName'])return{'editor':_0x4db37f,'rootName':_0x2efadd['rootName']};}async['_createContextItemFromContent'](_0x286cde){if('document'===_0x286cde['type']){const _0x3bf9cf=await this['_connector']['fetchDocument'](this['_ownerId'],_0x286cde['id'])['getDocument']();return{'id':'current-document','uiId':'current-document','label':'Current\x20document','type':_0x286cde['type'],'content':_0x3bf9cf['content'],'hidden':this['_conversationContextItems']['has']('current-document'),'version':_0x3bf9cf['attributes']?.['version'],'sessionId':_0x3bf9cf['attributes']?.['sessionId']};}if('mcp-tool-context'===_0x286cde['type'])return{'id':_0x286cde['id'],'uiId':_0x286cde['id'],'label':_0x286cde['data']?.['label']||_0x286cde['id'],'type':'mcp-tool-context','mcpServerName':_0x286cde['mcpServerName'],'toolName':_0x286cde['toolName'],'data':_0x286cde['data']||{}};return{'id':_0x286cde['id'],'uiId':_0x286cde['id'],'label':_0x286cde['attributes']?.['label']||_0x286cde['name']||_0x286cde['url']||_0x286cde['id'],'type':_0x286cde['type'],..._0x286cde?.['attributes']?.['resourceId']?{'resourceId':_0x286cde['attributes']?.['resourceId']}:{}};}['getSentContextItems'](){return new Map(this['_conversationContextItems']);}['removeFromContext'](_0x69c01f){const _0x3a0ba3=this['_pendingContextItems']['get'](_0x69c01f);_0x3a0ba3?.['isReadOnly']||this['_removeContextItem'](_0x69c01f);}['clearPendingContextItems'](){if(0x0===this['_pendingContextItems']['size'])return;for(const _0x5237f4 of this['_pendingContextItems']['values']())this['_removeContextItem'](_0x5237f4['uiId']);const _0x236d14=this['_conversationContextItems']['get']('current-document')||this['_pendingContextItems']['get']('current-document');_0x236d14&&this['_addContextItem']({..._0x236d14,'isReadOnly':!0x0,'hidden':!0x0});}['addToConversationContext'](_0x25beba){for(const _0x392511 of _0x25beba['values']())this['_addToConversationContextItem'](_0x392511);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'](_0x544962){return Array['from'](_0x544962['values']())['flatMap'](_0x570f24=>this['_mapContextItemToRequestData'](_0x570f24));}async['addFilesToContext'](_0x51ceca,_0x509236,_0x427431='file'){const _0x572313='files-'+ot();this['_startUploadOperation'](_0x572313);try{await Promise['all'](_0x51ceca['map'](async _0x3708eb=>{const _0x3e897f='file-'+ot(),_0x686c09=_0x28ca45(_0x3708eb['name']);try{this['_addContextItem']({'type':_0x427431,'label':_0x509236?.['label']||_0x686c09,'uiId':_0x3e897f,'resourceId':_0x509236?.['resourceId']},!0x0);const _0x29b406=this['_connector']['uploadFile'](this['_ownerId'],_0x3708eb,_0x509236);this['_ongoingUploads']['set'](_0x3e897f,_0x29b406['abortController']);const {id:_0x1db3be}=await _0x29b406['getId']();this['_ongoingUploads']['delete'](_0x3e897f),this['_finishContextItemLoading']({'type':_0x427431,'id':_0x1db3be,'label':_0x509236?.['label']||_0x686c09,'uiId':_0x3e897f,'resourceId':_0x509236?.['resourceId']},!0x1);}catch(_0x7f1e95){this['_ongoingUploads']['delete'](_0x3e897f);if(!(_0x7f1e95 instanceof at&&_0x7f1e95['message']['startsWith']('ai-request-aborted'))){const _0x541c65=Ps['get'](_0x7f1e95['code'])||'ai-chat-file-upload-failed',_0x16b5ac=new at(_0x541c65,null,{'fileName':_0x686c09,..._0x7f1e95});_0x16b5ac['stack']=_0x7f1e95['stack'],this['fire']('error',{'error':_0x16b5ac});}this['_removeContextItem'](_0x3e897f);}}));}finally{this['_finishUploadOperation'](_0x572313);}}['addCurrentDocumentToContext'](_0x555558){if(this['isCurrentDocumentInContext']()||!this['_addContextOptionsState']['document']['enabled'])return;const _0x2ff454={'type':'document','uiId':'current-document','label':_0x555558,'isReadOnly':this['_conversationContextItems']['has']('current-document'),'hidden':this['_conversationContextItems']['has']('current-document')};this['_addContextItem'](_0x2ff454);}async['updateCurrentDocument'](_0x57c869,_0x5a53f9,_0x225917,_0x45f14d){const _0x1feff5=this['_pendingContextItems']['get']('current-document');if(_0x1feff5&&_0x57c869){_0x1feff5['selection']=_0x45f14d?_0x45f14d['map'](_0x5ed11d=>({'start':_0x5ed11d['start'],'end':_0x5ed11d['end']})):[];try{if(_0x1feff5['version']===_0x5a53f9)return;const {id:_0xb00ffe}=await this['_connector']['uploadDocument'](this['_ownerId'],_0x57c869,{'version':_0x5a53f9,'sessionId':_0x225917})['getId']();_0x1feff5['id']=_0xb00ffe,_0x1feff5['content']=_0x57c869,_0x1feff5['version']=_0x5a53f9,_0x1feff5['sessionId']=_0x225917;}catch(_0x32ce57){const _0x553285=new at('ai-chat-document-upload-failed',null);_0x553285['stack']=_0x32ce57['stack'],this['fire']('error',{'error':_0x553285});}}}async['updateDocuments'](_0xa387f9){const _0x1216ad=this['_pendingContextItems']['get']('current-document');if(!_0x1216ad||!_0xa387f9['length']||_0xa387f9['every'](_0x26c287=>!_0x26c287['content']))return;_0xa387f9['length']>0x1&&_0xa387f9['some'](_0x324568=>!_0x324568['description'])&&It('ai-chat-documents-missing-description');const _0x526baf=_0x4c0d9b=>_0x4c0d9b?_0x4c0d9b['map'](_0x383a98=>({'start':_0x383a98['start'],'end':_0x383a98['end']})):[],_0x25aebd=_0x1216ad['documents']??[];if(_0x25aebd['length']===_0xa387f9['length']&&_0xa387f9['every']((_0x1fc62d,_0x410dcb)=>_0x25aebd[_0x410dcb]?.['version']===_0x1fc62d['version']))_0x1216ad['documents']=_0x25aebd['map']((_0x451165,_0x315361)=>({..._0x451165,'selection':_0x526baf(_0xa387f9[_0x315361]['selections'])}));else try{const _0x14b1d8=await this['_connector']['uploadDocuments'](this['_ownerId'],_0xa387f9)['getIds']();_0x1216ad['documents']=_0xa387f9['map']((_0x308112,_0xdbb178)=>({'id':_0x14b1d8[_0xdbb178]?.['id'],'content':_0x308112['content'],'version':_0x308112['version'],'sessionId':_0x308112['sessionId'],'selection':_0x526baf(_0x308112['selections'])})),this['_documentSources']['clear'](),this['_dataIdToSource']['clear']();for(let _0x1c4e6e=0x0;_0x1c4e6e<_0xa387f9['length'];_0x1c4e6e++){const _0x2ea86d=_0x14b1d8[_0x1c4e6e]?.['id'],_0x4f9bb6=_0xa387f9[_0x1c4e6e];if(!_0x2ea86d)continue;const _0x3efab5={'editor':_0x4f9bb6['editor'],'rootName':_0x4f9bb6['rootName'],'content':_0x4f9bb6['content'],'version':_0x4f9bb6['version'],'name':_0x4f9bb6['name'],'description':_0x4f9bb6['description']};this['_documentSources']['set'](_0x2ea86d,_0x3efab5);const _0x1b89fb=_s(_0x4f9bb6['content']);for(const _0x4654f3 of _0x364046(_0x193dfc=>!!Es(_0x193dfc,'data-id'),_0x1b89fb)){const _0x2811a4=Es(_0x4654f3,'data-id');_0x2811a4&&this['_dataIdToSource']['set'](_0x2811a4,{..._0x3efab5,'documentId':_0x2ea86d});}}_0x1216ad['dataIdDocumentSources']=new Map(this['_dataIdToSource']);}catch(_0x5897a1){const _0x13edad=new at('ai-chat-document-upload-failed',null);_0x13edad['stack']=_0x5897a1['stack'],this['fire']('error',{'error':_0x13edad});}}['addSelectionToContext'](_0xe294ff){this['_addContextItem']({'type':'selection','label':_0xe294ff,'uiId':'selection','content':_0xe294ff});}['removeSelectionFromContext'](){this['_removeContextItem']('selection');}async['addUrlToContext'](_0x21f939,_0x445cc8){const _0x45b6c3='url-'+ot();this['_startUploadOperation'](_0x45b6c3);const _0x404a63='url-'+ot();try{this['_addContextItem']({'type':'web-resource','label':_0x445cc8?.['label']||_0x21f939,'uiId':_0x404a63,'resourceId':_0x445cc8?.['resourceId']},!0x0);const _0xc7a61=this['_connector']['uploadUrl'](this['_ownerId'],_0x21f939,_0x445cc8);this['_ongoingUploads']['set'](_0x404a63,_0xc7a61['abortController']);const {id:_0x255181}=await _0xc7a61['getId']();this['_ongoingUploads']['delete'](_0x404a63),this['_finishContextItemLoading']({'type':'web-resource','id':_0x255181,'label':_0x445cc8?.['label']||_0x21f939,'uiId':_0x404a63,'resourceId':_0x445cc8?.['resourceId']},!0x1);}catch(_0x46b5ec){this['_ongoingUploads']['delete'](_0x404a63),(_0x46b5ec['message']['startsWith']('ai-request-aborted')||this['fire']('error',{'error':new at('ai-chat-url-upload-failed',this,{'url':_0x21f939,'originalError':_0x46b5ec}),'url':_0x21f939}),this['_removeContextItem'](_0x404a63));}finally{this['_finishUploadOperation'](_0x45b6c3);}}['addToolItemToContext'](_0x190b2b){_0x190b2b['id']=_0x190b2b['id']??ot()['substring'](0x0,0x15),this['_pendingContextItems']['set'](_0x190b2b['uiId'],_0x190b2b),this['fire']('contextItemAdded',{'contextItem':_0x190b2b,'isLoading':!0x1});}async['loadSourceResources'](_0x1eb377,_0x56230d,_0x249e52){const _0x758c5c=this['_addContextOptionsState']['sources']['find'](_0x56bfde=>_0x56bfde['id']===_0x1eb377);if(!_0x758c5c)return this['fire']('error',{'error':new at('ai-chat-source-not-found',this,{'sourceId':_0x1eb377}),'sourceId':_0x1eb377}),[];try{const _0x5c3131=(await _0x758c5c['getResources'](_0x56230d))['map'](_0x29cf81=>{const _0x3c67c1=this['_isResourceInContext'](_0x29cf81['id']);return{..._0x29cf81,'isInContext':_0x3c67c1};});return _0x758c5c['resources']=_0x5c3131,this['fire']('sourceResourcesLoaded',{'sourceId':_0x1eb377,'source':_0x758c5c,'resources':_0x5c3131,'uid':_0x249e52}),_0x5c3131;}catch(_0x5cf037){return this['fire']('error',{'error':new at('ai-chat-source-resources-load-failed',this,{'sourceId':_0x1eb377,'originalError':_0x5cf037}),'sourceId':_0x1eb377,'sourceLabel':_0x758c5c['label']}),[];}}async['addResourceToContext'](_0x5497e6,_0x3d9d9f){if(this['_isResourceInContext'](_0x3d9d9f['id']))return;let _0xf50e9a=_0x3d9d9f['data'];if(!_0xf50e9a&&_0x5497e6['getData'])try{_0xf50e9a=await _0x5497e6['getData'](_0x3d9d9f['id']);}catch(_0x304c87){return void this['fire']('error',{'error':new at('ai-chat-resource-load-failed',this,{'resourceId':_0x3d9d9f['id'],'sourceId':_0x5497e6['id'],'originalError':_0x304c87}),'resourceId':_0x3d9d9f['id'],'sourceId':_0x5497e6['id']});}if(_0xf50e9a)switch(_0x3d9d9f['type']){case'web-resource':if('string'!=typeof _0xf50e9a)return void this['fire']('error',{'error':new at('ai-chat-context-invalid-data',this,{'resourceId':_0x3d9d9f['id'],'sourceId':_0x5497e6['id'],'expectedType':'string','actualType':typeof _0xf50e9a}),'resourceId':_0x3d9d9f['id'],'sourceId':_0x5497e6['id']});await this['addUrlToContext'](_0xf50e9a,{'label':_0x3d9d9f['label'],'resourceId':_0x3d9d9f['id']});break;case'file':if(!(_0xf50e9a instanceof File))return void this['fire']('error',{'error':new at('ai-chat-context-invalid-data',this,{'resourceId':_0x3d9d9f['id'],'sourceId':_0x5497e6['id'],'expectedType':'File','actualType':typeof _0xf50e9a}),'resourceId':_0x3d9d9f['id'],'sourceId':_0x5497e6['id']});await this['addFilesToContext']([_0xf50e9a],{'label':_0x3d9d9f['label'],'resourceId':_0x3d9d9f['id']});break;case'text':if('object'!=typeof _0xf50e9a||!('content'in _0xf50e9a)||!('type'in _0xf50e9a))return void this['fire']('error',{'error':new at('ai-chat-context-invalid-data',this,{'resourceId':_0x3d9d9f['id'],'sourceId':_0x5497e6['id'],'expectedType':'object\x20with\x20content\x20and\x20type\x20properties','actualType':typeof _0xf50e9a}),'resourceId':_0x3d9d9f['id'],'sourceId':_0x5497e6['id']});_0xf50e9a=Ms['_convertTextResourceToFile'](_0xf50e9a,_0x3d9d9f['label']),await this['addFilesToContext']([_0xf50e9a],{'label':_0x3d9d9f['label'],'resourceId':_0x3d9d9f['id']},'text');break;case'mcp-tool-context':break;default:this['fire']('error',{'error':new at('ai-chat-context-unsupported-type',this,{'resourceId':_0x3d9d9f['id'],'sourceId':_0x5497e6['id'],'resourceType':_0x3d9d9f['type']}),'resourceId':_0x3d9d9f['id'],'sourceId':_0x5497e6['id']});}else this['fire']('error',{'error':new at('ai-chat-resource-no-data',this,{'resourceId':_0x3d9d9f['id'],'sourceId':_0x5497e6['id']}),'resourceId':_0x3d9d9f['id'],'sourceId':_0x5497e6['id']});}static['_convertTextResourceToFile'](_0x160ad3,_0x122228){switch(_0x160ad3['type']){case'markdown':return new File([_0x160ad3['content']],_0x122228,{'type':'text/markdown'});case'html':return new File([_0x160ad3['content']],_0x122228,{'type':'text/html'});default:return new File([_0x160ad3['content']],_0x122228,{'type':'text/plain'});}}static['_mapContextItemToRequestData'](_0x43f77d){switch(_0x43f77d['type']){case'file':case'text':return[{'type':'file','id':_0x43f77d['id']}];case'web-resource':return[{'type':'web-resource','id':_0x43f77d['id']}];case'document':return _0x43f77d['documents']?.['length']?_0x43f77d['documents']['map'](_0x26bf33=>({'type':'document','id':_0x26bf33['id'],..._0x26bf33['selection']?.['length']&&{'selection':_0x26bf33['selection']}})):[{'type':'document','id':_0x43f77d['id'],..._0x43f77d['selection']?.['length']&&{'selection':_0x43f77d['selection']}}];case'mcp-tool-context':{const _0x342958=_0x43f77d;return[{'type':'mcp-tool-context','mcpServerName':_0x342958['mcpServerName'],'toolName':_0x342958['toolName'],'data':{..._0x342958['data'],'label':_0x342958['label']||_0x342958['data']?.['label']||_0x342958['id']},'id':_0x342958['id']}];}default:return[];}}['_addContextItem'](_0x5af9ee,_0x13032f=!0x1){if(this['_pendingContextItems']['set'](_0x5af9ee['uiId'],_0x5af9ee),_0x5af9ee['hidden']||this['fire']('contextItemAdded',{'contextItem':_0x5af9ee,'isLoading':_0x13032f}),'current-document'===_0x5af9ee['uiId']&&this['_toggleAddCurrentDocumentOptionVisibility'](),_0x5af9ee['resourceId']){const _0x1ffc9c=this['_findSourceIdsByResourceId'](_0x5af9ee['resourceId']);_0x1ffc9c&&_0x1ffc9c['forEach'](_0x5db589=>{this['_updateResourceInContextState'](_0x5db589,_0x5af9ee['resourceId'],!0x0);});}}['_removeContextItem'](_0x69bdf4){const _0x4362d4=this['_pendingContextItems']['get'](_0x69bdf4),_0x4309e2=this['_ongoingUploads']['get'](_0x69bdf4);if(_0x4309e2&&(_0x4309e2['abort'](),this['_ongoingUploads']['delete'](_0x69bdf4)),_0x4362d4?.['resourceId']){const _0x2097d3=this['_findSourceIdsByResourceId'](_0x4362d4['resourceId']);_0x2097d3&&_0x2097d3['forEach'](_0x286857=>{this['_updateResourceInContextState'](_0x286857,_0x4362d4['resourceId'],!0x1);});}this['_pendingContextItems']['delete'](_0x69bdf4),this['fire']('contextItemRemoved',{'uiId':_0x69bdf4,'type':_0x4362d4?.['type']}),'current-document'===_0x69bdf4&&this['_toggleAddCurrentDocumentOptionVisibility']();}['_finishContextItemLoading'](_0x2266e1,_0x320bc9){if(this['_pendingContextItems']['has'](_0x2266e1['uiId'])&&(this['_pendingContextItems']['set'](_0x2266e1['uiId'],_0x2266e1),this['fire']('contextItemLoadingEnded',{'contextItem':_0x2266e1,'isLoading':_0x320bc9}),_0x2266e1['resourceId'])){const _0x1956f2=this['_findSourceIdsByResourceId'](_0x2266e1['resourceId']);_0x1956f2&&_0x1956f2['forEach'](_0x15fb32=>{this['_updateResourceInContextState'](_0x15fb32,_0x2266e1['resourceId'],!0x0);});}}['_addToConversationContextItem'](_0x515b3c){this['_conversationContextItems']['set'](_0x515b3c['uiId'],_0x515b3c);}['_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'](_0x4f608a=>({..._0x4f608a,'enabled':!0x0}))??[]},this['fire']('addContextOptionsChanged',{'options':this['_addContextOptionsState']});}['_getCustomSourcesInitialState'](){return this['_config']?.['sources']?.['map'](_0x55cacd=>({..._0x55cacd,'resources':[]}))??[];}['_toggleAddCurrentDocumentOptionVisibility'](){const _0x2b8a5c=this['isCurrentDocumentInContext']()||this['isCurrentDocumentInConversation']();this['_addContextOptionsState']['document']['isHidden']=_0x2b8a5c,this['fire']('addContextOptionsChanged',{'options':this['_addContextOptionsState']});}['_isResourceInContext'](_0x38ca8e){for(const _0x33de8f of this['_pendingContextItems']['values']())if(_0x33de8f['resourceId']===_0x38ca8e)return!0x0;for(const _0x672c15 of this['_conversationContextItems']['values']())if(_0x672c15['resourceId']===_0x38ca8e)return!0x0;return!0x1;}['_findSourceIdsByResourceId'](_0x536b15){const _0x1ce864=[];for(const _0xcd7590 of this['_addContextOptionsState']['sources']){_0xcd7590['resources']['find'](_0x355d98=>_0x355d98['id']===_0x536b15)&&_0x1ce864['push'](_0xcd7590['id']);}return 0x0===_0x1ce864['length']?null:_0x1ce864;}['_updateResourceInContextState'](_0x16a5a2,_0x3572ac,_0xe33551){const _0x575308=this['_addContextOptionsState']['sources']['find'](_0xf978fb=>_0xf978fb['id']===_0x16a5a2);if(!_0x575308)return;const _0x556f6d=_0x575308['resources']['find'](_0x134787=>_0x134787['id']===_0x3572ac);_0x556f6d&&(_0x556f6d['isInContext']=_0xe33551,this['fire']('resourceStateChanged',{'sourceId':_0x16a5a2,'resourceId':_0x3572ac,'isInContext':_0xe33551}));}['_startUploadOperation'](_0x541237){this['_ongoingUploadOperations']['set'](_0x541237,!0x0),this['_ongoingUploadOperations']['size']&&this['fire']('uploadProgressChanged',{'isUploadInProgress':!0x0});}['_finishUploadOperation'](_0x16d9f2){this['_ongoingUploadOperations']['delete'](_0x16d9f2),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'](_0x4bec91){const _0xa92e29={};return _0x4bec91&&_0x4bec91['isWebSearchEnabled']&&(_0xa92e29['webSearch']={}),_0x4bec91&&_0x4bec91['isReasoningEnabled']&&(_0xa92e29['reasoning']={}),_0xa92e29;}['toggleWebSearch'](){this['setWebSearch'](!this['_isWebSearchEnabled']);}['toggleReasoning'](){this['setReasoning'](!this['_isReasoningEnabled']);}['setWebSearch'](_0x2644bb){_0x2644bb!==this['_isWebSearchEnabled']&&(this['_isWebSearchEnabled']=_0x2644bb,this['fire']('capabilitiesUpdated',this['getCapabilitiesConfig']()));}['setReasoning'](_0x18f49e){_0x18f49e!==this['_isReasoningEnabled']&&(this['_isReasoningEnabled']=_0x18f49e,this['fire']('capabilitiesUpdated',this['getCapabilitiesConfig']()));}}class Bs extends Ds{['userMessage'];['conversationId'];['contextItems']=new Map();['capabilities'];['model'];['attributes'];constructor(_0x465bcd){super(_0x465bcd),this['conversationId']=_0x465bcd['conversationId'],this['contextItems']=_0x465bcd['contextItems'],this['capabilities']=_0x465bcd['capabilities'],this['userMessage']=_0x465bcd['userMessage'],this['model']=_0x465bcd['model'],this['attributes']=_0x465bcd['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'](_0xf01b42){const _0x33cf3e=this['getDocumentContext']();if(_0x33cf3e?.['documents']?.['length']){const _0x14edc1=_0x33cf3e['documents']['map'](_0x32eb5a=>_0x32eb5a['content']??'')['join']('');if(_0x14edc1)return super['createReply']({'documentContextContent':_0x14edc1,..._0xf01b42});}return super['createReply'](_0xf01b42);}}class Gs extends Tt(){['id'];['isStarted']=!0x1;['isFromHistory'];['interactions']=[];['currentInteraction'];['selectedModel'];['connector'];['options'];constructor(_0x3c4034){super(),this['options']=_0x3c4034,this['connector']=_0x3c4034['connector'],this['chatModels']=_0x3c4034['chatModels'],this['id']=_0x3c4034['conversationId'],this['isFromHistory']=_0x3c4034['isFromHistory'];}async['init'](_0x4c9d08){try{this['chatContext']=new Ms({'connector':this['connector'],'config':_0x4c9d08,'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 _0x1a0008=await this['chatModels']['getAvailableModels']();this['fire']('conversationInitialized',{'availableModels':_0x1a0008});const _0x9d4f1d=await this['chatModels']['getModel'](this['options']['selectedModelId']);_0x9d4f1d&&await this['setModel'](_0x9d4f1d);}catch(_0x303d3e){const _0x52fd20=new at('ai-chat-conversation-init-failed',null,{'message':_0x303d3e['message']||_0x303d3e});_0x52fd20['stack']=_0x303d3e['stack'],this['fire']('error',{'error':_0x52fd20});}}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:_0x33e9c0}=await this['connector']['startConversation'](this['id'],this['options']['group'])['getConversation']();this['id']=_0x33e9c0,this['isStarted']=!0x0,this['fire']('conversationStarted',{'conversationId':this['id'],'selectedModel':this['selectedModel']});}catch(_0x31fcda){const _0x385bd8=new at('ai-chat-conversation-start-failed',null,{'message':_0x31fcda['message'],'conversationId':this['id']});throw _0x385bd8['stack']=_0x31fcda['stack'],this['fire']('error',{'error':_0x385bd8}),_0x385bd8;}}async['load'](_0x42c401,_0x74ba50){try{const _0x56a538=await this['connector']['fetchConversation'](_0x42c401)['getConversation'](),_0x22e2e9=await this['connector']['fetchConversationMessages'](_0x42c401)['getMessages'](),_0x236e41=_0x22e2e9[0x0]['model'];this['isStarted']=!0x0,this['id']=_0x56a538['id'],'title'in _0x56a538?this['fire']('setConversationTitle',_0x56a538['title'],!0x0):this['fire']('setConversationTitle','',!0x0);const _0x5cdc5e=(await this['chatModels']['getAll']())['find'](_0x295601=>_0x295601['id']['toLowerCase']()===_0x236e41['toLowerCase']());return this['selectedModel']=_0x5cdc5e,this['fire']('modelSelected',{'selectedModel':_0x5cdc5e,'isDisabled':!0x0}),await this['_processMessagesToInteractions'](_0x22e2e9,_0x74ba50,_0x236e41),this['currentInteraction']=void 0x0,this;}catch(_0x45327c){const _0x5bbf59=new at('ai-chat-conversation-init-from-id-failed',null,{'message':_0x45327c['message'],'conversationId':_0x42c401});throw _0x5bbf59['stack']=_0x45327c['stack'],this['fire']('error',{'error':_0x5bbf59}),_0x5bbf59;}}async['_processMessagesToInteractions'](_0x4a76bd,_0x1745b7,_0x36213b){let _0x22d80f,_0x21a55d=!0x1;for(const _0x55c276 of _0x4a76bd)if('user'===_0x55c276['role']){const {contextItems:_0x557794,hasUnmatched:_0x481548}=await this['_extractContextItems'](_0x55c276);_0x21a55d=_0x481548;const _0x585add={'isReasoningEnabled':Object['hasOwn'](_0x55c276['capabilities'],'reasoning'),'isWebSearchEnabled':Object['hasOwn'](_0x55c276['capabilities'],'webSearch')};_0x22d80f=this['createInteraction']({'userMessage':_0x55c276['prompt'],'contextItems':_0x557794,'capabilities':_0x585add,'modelId':_0x36213b,'attributes':_0x55c276['attributes']}),this['currentInteraction']=_0x22d80f,this['chatContext']['addToConversationContext'](this['currentInteraction']['contextItems']);}else{if('assistant'===_0x55c276['role']&&_0x22d80f){const _0xf8897c=[];for(const _0x44b956 of _0x55c276['content'])switch(_0x44b956['type']){case'text':case'modification':{const _0x3d231a=_0x22d80f['getDocumentContext'](),_0x1a30c2=(_0x3d231a?.['documents']?.['length']?_0x3d231a['documents']['some'](_0x16177f=>_0x16177f['sessionId']!==_0x1745b7):_0x3d231a?.['sessionId']!==_0x1745b7)||_0x21a55d;_0x22d80f['currentReply']?.['type']!==_0x44b956['type']&&(_0x22d80f['currentReply']=_0x22d80f['createReply']({'type':_0x44b956['type'],'isDone':!0x0,'interactionId':_0x22d80f['id'],'areActionsDisabled':_0x1a30c2,'isFromHistory':!0x0}),_0xf8897c['length']>0x0&&(_0x22d80f['currentReply']['sources']=_0xf8897c['splice'](0x0))),_0x22d80f['currentReply']['appendContent'](_0x44b956['content']);break;}case'url':_0xf8897c['push'](_0x44b956);break;case'mcp-tool-result':{const {data:_0x20f16a,attributes:_0xa13b4d}=JSON['parse'](_0x44b956['content']);_0x22d80f['_handleToolResultData']({'toolName':_0x44b956['toolName'],'data':_0x20f16a,'attributes':_0xa13b4d});break;}}}}}async['_extractContextItems'](_0x53dd98){const _0x5a842a=new Map();if(!_0x53dd98['content'])return{'contextItems':_0x5a842a,'hasUnmatched':!0x1};const _0x769c33=this['_resolveEditors'](),{contextItem:_0x23acfa,hasUnmatched:_0x387bf9}=await this['chatContext']['populateDocumentsFromUserMessage'](_0x53dd98['content'],_0x769c33);_0x23acfa&&_0x5a842a['set'](_0x23acfa['id'],_0x23acfa);for(const _0x4666b4 of _0x53dd98['content']){if('document'===_0x4666b4['type'])continue;const _0x2132ea=await this['chatContext']['populateFromMessage'](_0x4666b4);_0x2132ea&&_0x5a842a['set'](_0x2132ea['id'],_0x2132ea);}return{'contextItems':_0x5a842a,'hasUnmatched':_0x387bf9};}['_resolveEditors'](){return this['options']['getEditors']?this['options']['getEditors']():this['options']['getEditor']?[this['options']['getEditor']()]:[];}async['handleUserInteraction']({userMessage:_0x4dc90b,attributes:_0x497ef4}){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 _0x37c832=this['chatContext']['getPendingContextItems'](),_0x91f71f=this['chatCapabilities']['getCapabilitiesConfig'](),_0x1915cc=this['selectedModel']['id'];this['currentInteraction']=this['createInteraction']({'userMessage':_0x4dc90b,'contextItems':_0x37c832,'capabilities':_0x91f71f,'modelId':_0x1915cc,'attributes':_0x497ef4}),await this['currentInteraction']['start'](),this['chatContext']['addToConversationContext'](this['currentInteraction']['contextItems']);}catch(_0x279c5d){if(_0x279c5d instanceof at)this['fire']('error',{'interactionId':this['currentInteraction']?this['currentInteraction']['id']:void 0x0,'error':_0x279c5d});else{const _0x1f5054=Ps['get'](_0x279c5d['code'])||'ai-chat-handle-user-interaction-start-failed';this['fire']('error',{'interactionId':this['currentInteraction']?this['currentInteraction']['id']:void 0x0,'error':new at(_0x1f5054,null,{'error':_0x279c5d})});}}finally{this['currentInteraction']?.['stop'](),this['currentInteraction']=void 0x0;}}['createInteraction']({userMessage:_0x18bad9,contextItems:_0x336e63,capabilities:_0x551add,modelId:_0x5784a2,attributes:_0x2fca76}){const _0x189d25=new Bs({'userMessage':_0x18bad9,'contextItems':_0x336e63,'capabilities':_0x551add,'conversationId':this['id'],'connector':this['connector'],'locale':this['options']['locale'],'model':_0x5784a2,'attributes':_0x2fca76});return _0x189d25['delegate'](...Ls)['to'](this),this['interactions']['push'](_0x189d25),this['fire']('interactionCreated',_0x189d25),_0x189d25;}['getInteraction'](_0x2b0b54){return this['interactions']['find'](_0x436637=>_0x436637['id']===_0x2b0b54);}['removeInteraction'](_0x2855d4){const _0x439635=this['getInteraction'](_0x2855d4);_0x439635&&(_0x439635['destroy'](),this['interactions']['splice'](this['interactions']['indexOf'](_0x439635),0x1));}get['lastInteraction'](){return this['interactions'][this['interactions']['length']-0x1];}['addCurrentDocumentToContext'](_0x1e0994){this['chatContext']['addCurrentDocumentToContext'](_0x1e0994);}async['updateCurrentDocumentInContext']({content:_0x5acc00,version:_0x577d53,sessionId:_0x5f2f9a,selections:_0x542b5d}){await this['chatContext']['updateCurrentDocument'](_0x5acc00,_0x577d53,_0x5f2f9a,_0x542b5d);}async['updateDocumentsInContext'](_0x3b0c6d){await this['chatContext']['updateDocuments'](_0x3b0c6d);}['getSourceByDataId'](_0x16e1e4){return this['chatContext']['getSourceByDataId'](_0x16e1e4);}['getDocumentContextSliceByDataId'](_0xd2dab2){return this['chatContext']['getDocumentContextSliceByDataId'](_0xd2dab2);}['getCurrentDocumentContext'](){return this['currentInteraction']?.['getDocumentContext']()?.['content']||'';}['addSelectionToContext'](_0x3bf4eb){this['chatContext']['addSelectionToContext'](_0x3bf4eb);}['removeSelectionFromContext'](){this['chatContext']['removeSelectionFromContext']();}['addFilesToContext'](_0x3937b0){this['chatContext']['addFilesToContext'](_0x3937b0);}['addUrlToContext'](_0x169098){this['chatContext']['addUrlToContext'](_0x169098);}['addToolItemToContext'](_0x1a0973){this['chatContext']['addToolItemToContext'](_0x1a0973);}['addResourceToContext'](_0x4d971c,_0x2a6fb3){this['chatContext']['addResourceToContext'](_0x4d971c,_0x2a6fb3);}['loadSourceResources'](_0x2046fb,_0x469aa7,_0x21b443){return this['chatContext']['loadSourceResources'](_0x2046fb,_0x469aa7,_0x21b443);}['removeFromContext'](_0x522f0e){this['chatContext']['removeFromContext'](_0x522f0e);}['setWebSearch'](_0x5a14f6){this['chatCapabilities']['setWebSearch'](_0x5a14f6);}['toggleWebSearch'](){this['chatCapabilities']['toggleWebSearch']();}['setReasoning'](_0xe79549){this['chatCapabilities']['setReasoning'](_0xe79549);}['toggleReasoning'](){this['chatCapabilities']['toggleReasoning']();}['isCurrentDocumentInContext'](){return this['chatContext']['isCurrentDocumentInContext']();}['isCurrentDocumentInConversation'](){return this['chatContext']['isCurrentDocumentInConversation']();}['isSelectionInContext'](){return this['chatContext']['isSelectionInContext']();}async['setModel'](_0x20c87f){_0x20c87f?!0x1===await this['chatModels']['isAvailable'](_0x20c87f)&&(It('ai-chat-conversation-set-model-not-available',{'conversation':this,'model':_0x20c87f}),_0x20c87f=(await this['chatModels']['getAvailableModels']())[0x0]):(It('ai-chat-conversation-set-model-null',{'conversation':this}),_0x20c87f=(await this['chatModels']['getAvailableModels']())[0x0]),_0x20c87f['id']!==this['selectedModel']?.['id']&&(this['selectedModel']=_0x20c87f,this['chatCapabilities']['reset'](),this['fire']('modelSelected',{'selectedModel':_0x20c87f}));}}class Fs extends Tt(){['_connector'];['_config'];['_locale'];['_modelList']=[];['_modelsRequest']=null;constructor({connector:_0x3c41bb,config:_0x563db9,locale:_0x2e0dba}){super(),this['_connector']=_0x3c41bb,this['_config']=_0x563db9,this['_locale']=_0x2e0dba;}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 _0x7b2ebe=await this['getAll']();let _0x7c6035;return _0x7c6035=this['_availableModels']?this['_filterModels'](_0x7b2ebe,this['_availableModels']):_0x7b2ebe['filter'](_0x16a726=>_0x16a726['recommended']),_0x7c6035;}async['getModel'](_0x1c246c){const _0xdef64c=await this['getAll']();if(!_0xdef64c['length'])return null;if(_0x1c246c){const _0x32d46b=this['_getModelById'](_0xdef64c,_0x1c246c);if(_0x32d46b)return _0x32d46b;It('ai-chat-model-id-unrecognized',{'modelId':_0x1c246c,'fallBackModelId':this['_defaultModelId']});}return this['getDefault']();}async['getDefault'](){const _0x1c2edd=await this['getAvailableModels']();if(!_0x1c2edd['length'])return null;if(this['_defaultModelId']){const _0x34aad6=this['_getModelById'](_0x1c2edd,this['_defaultModelId']);if(_0x34aad6)return _0x34aad6;It('ai-chat-default-model-id-unrecognized',{'defaultModelId':this['_defaultModelId'],'fallBackModelId':_0x1c2edd[0x0]['id']});}return _0x1c2edd[0x0];}async['isAvailable'](_0x541f73){return(await this['getAvailableModels']())['some'](_0x443912=>_0x443912['name']===_0x541f73['name']&&_0x443912['provider']===_0x541f73['provider']);}async['_retrieveModels'](){if(!this['_modelList']['length'])try{const _0x1601d7=this['_locale']['uiLanguage']||'en',_0x1e9464=this['_connector']['getModels'](_0x1601d7),_0x198261=await _0x1e9464['list']();this['_modelList']=_0x198261['items']['map'](_0x13a65a=>Ks(_0x13a65a)?{..._0x13a65a,'name':hs(this['_locale'],'AI_MODEL_NAME_AUTO')}:_0x13a65a);}catch(_0x54bb3d){throw Et('ai-models-unable-to-retrieve',{'error':_0x54bb3d}),_0x54bb3d;}return[...this['_modelList']];}['_filterModels'](_0x13b7e8,_0x18b780){let _0x1ca68e;if(_0x18b780){_0x1ca68e=[];const _0x2a30cc=new Set(),_0x2f3e65='string'==typeof _0x18b780?[_0x18b780['toLocaleLowerCase']()]:_0x18b780['map'](_0x1fcd4f=>_0x1fcd4f['toLocaleLowerCase']());for(const _0x1d7829 of _0x2f3e65)for(const _0x9bbe93 of _0x13b7e8)!_0x2a30cc['has'](_0x9bbe93['id'])&&this['_isMatchingFilter'](_0x9bbe93,_0x1d7829)&&(_0x1ca68e['push'](_0x9bbe93),_0x2a30cc['add'](_0x9bbe93['id']));}else _0x1ca68e=_0x13b7e8;return _0x1ca68e;}['_isMatchingFilter'](_0x39c5ee,_0xafba35){const _0x52860e=_0x39c5ee['id']['toLocaleLowerCase'](),_0xb91ab6=_0x39c5ee['name']['toLocaleLowerCase'](),_0x462a04=_0x39c5ee['provider']['toLocaleLowerCase']();return _0x52860e===_0xafba35||_0xb91ab6===_0xafba35||Ks(_0x39c5ee)&&'auto'===_0xafba35||_0x462a04===_0xafba35||_0x52860e['startsWith'](_0xafba35);}['_getModelById'](_0x151622,_0x2817df){return _0x151622['find'](_0x22e11c=>Ks(_0x22e11c)&&'auto'===_0x2817df?_0x22e11c:_0x22e11c['id']===_0x2817df)||null;}}function Ks(_0x578d73){return _0x578d73['id']['startsWith']('agent');}function Ws(_0x3cbca0){return _0x3cbca0?_0x3cbca0 instanceof _0x4df290?[_0x3cbca0]:_0x3cbca0['editors']&&0x0!==_0x3cbca0['editors']['length']?Array['from'](_0x3cbca0['editors']):[]:[];}function Ys(_0x3ed182){const _0x56aaae=Ws(_0x3ed182);if(!_0x56aaae['length'])throw new at('ai-get-editor-from-context-no-editor');if(0x1===_0x56aaae['length'])return _0x56aaae[0x0];const _0x3306b9=_0x56aaae['find'](_0x1d37c1=>_0x1d37c1['ui']?.['focusTracker']?.['isFocused']);if(_0x3306b9)return _0x3306b9;const _0x51ffec=function(_0x295ac8){if(_0x295ac8 instanceof _0x4df290)return;const _0x1f2b20=_0x295ac8;if(!_0x1f2b20['plugins']||!_0x1f2b20['plugins']['has']('AIEditing'))return;const _0xe00e58=_0x1f2b20['plugins']['get']('AIEditing');return _0xe00e58['getLastContentFocusedEditor']?.();}(_0x3ed182);return _0x51ffec&&_0x56aaae['includes'](_0x51ffec)?_0x51ffec:_0x56aaae[0x0];}function $s(_0x3bc170){return Ys(_0x3bc170);}function qs({editor:_0x4d8033,interaction:_0xb18754,reply:_0x43cf44,groups:_0x1905c6,transform:_0x138bdc,documentCompare:_0x5c2b93,documentCompareOptions:_0x176263,documentContextSlice:_0x234a39}){const _0x3609fe=_0xb18754['getDocumentContext']();if(!_0x3609fe)return[];const _0x22df45=_0x43cf44['documentContextContent']['cloneNode'](!0x0);for(const {changes:_0x45a1eb}of _0x1905c6){const _0x580791=_0x45a1eb['filter'](_0x21fa2b=>'new'!=_0x21fa2b['type'])['map'](_0x381bb9=>As('data-id',_0x381bb9['id'],_0x22df45)),_0x3d09bd=_0x45a1eb['filter'](_0x348a79=>'removed'!=_0x348a79['type'])['map'](_0x3bc92f=>_0x3bc92f['node']['cloneNode'](!0x0));let _0x17b67c=null;if(_0x580791['length']){_0x17b67c=_0x580791[0x0]['previousSibling'];for(let _0x46bcae=0x0;_0x46bcae<_0x580791['length'];_0x46bcae++)_0x4529c2(_0x580791[_0x46bcae]);}if(_0x3d09bd['length']){_0x17b67c||(_0x45a1eb[0x0]['anchorId']?_0x17b67c=As('data-id',_0x45a1eb[0x0]['anchorId'],_0x22df45):(_0x17b67c=_0x3d09bd['shift'](),_0x57380b(_0x22df45,_0x17b67c)));for(let _0x31d41a=0x0;_0x31d41a<_0x3d09bd['length'];_0x31d41a++)_0x5c974a(_0x17b67c,_0x3d09bd[_0x31d41a]),_0x17b67c=_0x3d09bd[_0x31d41a];}}let _0x526ec9,_0x5bd724,_0x5d77b4,_0x5c7a1b=_0x176263;if(_0x234a39){_0x526ec9=_0x234a39['html'],_0x5d77b4=_0x234a39['version'],_0x5c7a1b={..._0x176263,'anchor':_0x234a39['rootName']};const _0x35b462=new _0x36408a([]),_0x6ff48d=_0x22df45['children'],_0x53d1b0=_0x43cf44['dataIdDocumentSources'],_0x33d1ab=_0x43cf44['newNodeAnchorIds'],_0x13793c=_0x234a39['editor'],_0x3fe722=_0x234a39['rootName'],_0x33878b=new Array(_0x6ff48d['length']),_0x4c8936=_0x740bac=>_0x740bac?_0x740bac['editor']===_0x13793c&&_0x740bac['rootName']===_0x3fe722:void 0x0;for(let _0x485aa1=0x0;_0x485aa1<_0x6ff48d['length'];_0x485aa1++){const _0x537534=Es(_0x6ff48d[_0x485aa1],'data-id');if(!_0x537534)continue;const _0x45d68e=_0x4c8936(_0x53d1b0?.['get'](_0x537534));if(void 0x0!==_0x45d68e){_0x33878b[_0x485aa1]=_0x45d68e;continue;}const _0x1362f2=_0x33d1ab['get'](_0x537534),_0x3e03d2=_0x1362f2?_0x4c8936(_0x53d1b0?.['get'](_0x1362f2)):void 0x0;void 0x0!==_0x3e03d2&&(_0x33878b[_0x485aa1]=_0x3e03d2);}for(let _0x3f113c=0x0;_0x3f113c<_0x6ff48d['length'];_0x3f113c++)if(void 0x0===_0x33878b[_0x3f113c]){for(let _0x2da9f5=_0x3f113c-0x1;_0x2da9f5>=0x0;_0x2da9f5--)if(void 0x0!==_0x33878b[_0x2da9f5]){_0x33878b[_0x3f113c]=_0x33878b[_0x2da9f5];break;}if(void 0x0===_0x33878b[_0x3f113c]){for(let _0x15e19f=_0x3f113c+0x1;_0x15e19f<_0x6ff48d['length'];_0x15e19f++)if(void 0x0!==_0x33878b[_0x15e19f]){_0x33878b[_0x3f113c]=_0x33878b[_0x15e19f];break;}}}for(let _0x7da9e0=0x0;_0x7da9e0<_0x6ff48d['length'];_0x7da9e0++)_0x33878b[_0x7da9e0]&&_0x35b462['children']['push'](_0x51d407(_0x6ff48d[_0x7da9e0],!0x0));_0x5bd724=gs(_0x35b462);}else _0x526ec9=_0x3609fe['content'],_0x5d77b4=_0x3609fe['version'],_0x5bd724=gs(_0x22df45);const _0x222b28=_0x5c2b93['getDiff'](_0x526ec9,_0x5bd724,{..._0x5c7a1b,'targetEditor':_0x4d8033})['getOperations']();if(_0x138bdc){const _0x2508bc=_0x4d8033['model']['document']['history']['getOperations'](_0x5d77b4),_0x278241={'document':_0x4d8033['model']['document'],'useRelations':!0x1,'padWithNoOps':!0x1};return _0x5e674a(_0x222b28,_0x2508bc,_0x278241)['operationsA'];}return _0x222b28;}function Qs(_0x119d57,_0x22dd22){if('marker'!=_0x22dd22['type'])return;const _0x2662fa=_0x119d57['model']['markers']['get'](_0x22dd22['name']);_0x2662fa&&(_0x22dd22['oldRange']=_0x2662fa['getRange']());}class Xs extends _0xee6711{['activeConversation'];['_aiEditing'];['_aiConnector'];['_aiChatUi'];['_aiChatModels'];['_aiChatBalloon'];['_activeBalloon'];['_wiredBalloons']=new Set();['_batchToChanges']=new Map();['_currentPreviewedChangeGroup']=null;['_bodyCollection'];static get['requires'](){return[as,_0x367c6c];}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 _0x27f550=this['context']['plugins']['get']('AITabs');this['listenTo'](this['_aiChatUi'],'startConversation',()=>{this['_startConversationSafely']();}),this['listenTo'](this['_aiChatUi'],'sendUserMessage',(_0x47a418,_0x1f5cfd)=>{this['_handleUIUserMessage']({'message':_0x1f5cfd});}),this['listenTo'](_0x27f550['view'],'change:activeTab',(_0xae9723,_0x32874c,_0x4b23ac)=>{'chat'!==_0x4b23ac&&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',(_0x45c30d,_0x503de8)=>{this['activeConversation']?.['addFilesToContext'](Array['from'](_0x503de8));}),this['listenTo'](this['_aiChatUi'],'addUrlToContext',(_0x1451ff,_0x1edb87)=>{this['activeConversation']?.['addUrlToContext'](_0x1edb87);}),this['listenTo'](this['_aiChatUi'],'executeCustomItemCallback',(_0x38277d,_0x16d2f8)=>{_0x16d2f8['callback'](this['context']);}),this['listenTo'](this['_aiChatUi'],'addResourceToContext',(_0x2dc07c,_0x39992b)=>{this['activeConversation']?.['addResourceToContext'](_0x39992b['source'],_0x39992b['resource']);}),this['listenTo'](this['_aiChatUi'],'removeContextItem',(_0x207cec,_0xcc5c14)=>{this['_removeFromContext'](_0xcc5c14);}),this['listenTo'](this['_aiChatUi'],'loadSourceResources',(_0x1f31e9,_0x29af92)=>{this['activeConversation']?.['loadSourceResources'](_0x29af92['sourceId'],_0x29af92['query'],_0x29af92['uid']);}),this['listenTo'](this['_aiChatUi'],'toggleWebSearch',()=>{this['_toggleWebSearch']();}),this['listenTo'](this['_aiChatUi'],'toggleReasoning',()=>{this['_toggleReasoning']();}),this['listenTo'](this['_aiChatUi'],'selectModel',(_0x50b78d,_0x5ce871)=>{this['activeConversation']?.['setModel'](_0x5ce871);}),this['listenTo'](this['_aiChatUi'],'like',(_0x4b06b7,{replyId:_0x1e2458})=>{console['log']('Liked\x20response',_0x1e2458);}),this['listenTo'](this['_aiChatUi'],'dislike',(_0x1ace87,{replyId:_0x5e64a5})=>{console['log']('Disliked\x20response',_0x5e64a5);}),this['listenTo'](this['_aiChatUi'],'insertSuggestion',(_0x2cbf36,_0x3f5c45)=>{this['_insertSuggestion'](_0x3f5c45);}),this['listenTo'](this['_aiChatUi'],'showChangeInText',(_0x189fed,{replyId:_0x3c47d8,partIndex:_0x20533e})=>{this['_aiChatBalloonShowDiff']=this['_aiChatUi']['showDiff'],this['_openBalloonFor'](_0x3c47d8,_0x20533e);}),this['listenTo'](this['_aiChatUi'],'mouseOverSuggestion',(_0x2725fe,{replyId:_0x2c4d6d,partIndex:_0x460d45})=>{const _0x4f77d0=this['_getDocumentRangeForReplyChanges'](_0x2c4d6d,_0x460d45);_0x4f77d0&&'$graveyard'!=_0x4f77d0['range']['root']['rootName']&&this['_aiEditing']['showFakeVisualSelection']({'ranges':[_0x4f77d0['range']],'id':'change-area','priority':0xa});}),this['listenTo'](this['_aiChatUi'],'mouseLeaveSuggestion',()=>{this['_aiEditing']['hideFakeVisualSelection']('change-area');}),this['listenTo'](this['_aiChatUi'],'applySuggestion',(_0x2c1621,_0xc0a7c0)=>{this['_aiEditing']['hideFakeVisualSelection']('change-area'),this['_applySuggestion'](_0xc0a7c0);}),this['listenTo'](this['_aiChatUi'],'toggleSuggestionDisplayMode',async(_0x39bb4a,{replyId:_0x557ded,showDiff:_0x1fe938})=>{const {reply:_0x3744f5}=this['getInteractionAndReplyById'](_0x557ded),_0x164328=_0x3744f5['getContentParts']({'showDiff':_0x1fe938,'editor':$s(this['context'])});await this['_aiChatUi']['updateFeedItemAIReplySuggestionContent']({'id':_0x3744f5['id'],'parts':_0x164328});}),this['listenTo'](this['_aiChatUi'],'rejectSuggestion',(_0x536593,{replyId:_0x31ec34,partIndex:_0x25f973})=>{this['_rejectSuggestion']({'replyId':_0x31ec34,'partIndex':_0x25f973}),this['_aiEditing']['hideFakeVisualSelection']('change-area');}),this['set']('_aiChatBalloonShowDiff',!0x1),this['context']['plugins']['has']('AIChatBalloon')&&(this['_aiChatBalloon']=this['context']['plugins']['get']('AIChatBalloon')),this['on']('interactionCreated',(_0x1aca99,_0xd462dc)=>{this['_aiChatUi']['addFeedItemUserMessage'](_0xd462dc);}),this['on']('replyCreated',(_0x35026e,_0xf1bc27)=>{this['_addFeedItemReply'](_0xf1bc27);});}async['afterInit'](){this['context']instanceof _0x4df290?this['_integrateEditor'](this['context']):this['listenTo'](this['context']['editors'],'add',(_0x5248bd,_0x24c808)=>{_0x24c808['on']('ready',()=>{this['_integrateEditor'](_0x24c808);});});const _0x520429=this['context']['config']['get']('ai.chat.initialConversation');let _0x147d61=_0x520429;if('lastCreated'!=_0x520429||(_0x147d61=await this['_getLastCreatedConversationId'](),_0x147d61))return'new'==_0x147d61?this['_startConversationSafely']():this['loadConversation'](_0x147d61);}async['destroy'](){return await this['_stopLastInteraction'](),this['_bodyCollection']['detachFromDom'](),super['destroy']();}async['loadConversation'](_0x13c2b9){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'](_0x13c2b9)['getConversation'](),await this['_startConversationSafely']({'id':_0x13c2b9}),this['_updateConversationTitle']('\x20'),await this['activeConversation']['load'](_0x13c2b9,this['_aiEditing']['sessionId']),this['activeConversation']['isCurrentDocumentInConversation']()&&this['addCurrentDocumentToChatContext']();}catch(_0x182396){this['_aiChatUi']['addFeedItemError']({'errorMessage':hs(this['context']['locale'],'AI_CHAT_UNABLE_TO_LOAD_CONVERSATION'),'id':_0x13c2b9}),this['_logError'](new at('ai-chat-conversation-not-found',this,{'error':_0x182396}));}finally{this['_aiChatUi']['startAutoScroll']({'smooth':!0x1}),this['_aiChatUi']['setFeedItemRenderingStrategy']('streaming'),this['_aiChatUi']['toggleLoadingSkeleton'](!0x1);}}['registerToolDataCallback'](_0x377918){let _0x44783e=null,_0x3ff8f3=null;this['on']('toolDataReceived',(_0x16fe17,_0xd39382,_0x2150b8)=>{_0x2150b8['id']!==_0x44783e&&(_0x44783e=_0x2150b8['id'],_0x3ff8f3=this['_getAIChatFeedAPI'](_0x2150b8)),_0x377918(_0xd39382,_0x3ff8f3);});}['addCurrentDocumentToChatContext'](){this['activeConversation']?.['addCurrentDocumentToContext'](hs(this['context']['locale'],'AI_CHAT_CONTEXT_CURRENT_DOCUMENT'));}async['addSelectionToChatContext'](){const _0x308cbc=this['_aiEditing']['getSelectionText']();this['activeConversation']?.['addSelectionToContext'](_0x308cbc),this['addCurrentDocumentToChatContext']();}['removeSelectionFromChatContext'](){this['activeConversation']?.['removeSelectionFromContext']();}['focusPromptInput'](){this['_aiChatUi']['focusPromptInput']();}async['startConversation'](_0xd1e007){await this['_startConversationSafely']({'modelId':_0xd1e007?.['modelId']});}async['sendMessage'](_0x4c1b5e){await this['_handleUIUserMessage'](_0x4c1b5e);}['getGroupId'](){const _0x479b30=this['context']['config']['get']('collaboration.channelId');if(!_0x479b30)throw new at('ai-chat-missing-channel-id',this);return _0x479b30;}['_handleRemovedConversation'](_0x3c1b2e){this['activeConversation']['id']===_0x3c1b2e&&this['_startConversationSafely']();}['_insertSuggestion'](_0x270ca1){const _0x6e267b=this['context']['plugins']['get']('DocumentCompare'),{reply:_0x210e3b,interaction:_0xe0f653}=this['getInteractionAndReplyById'](_0x270ca1['replyId']),_0x524a1f=void 0x0!==_0x270ca1['partIndex']?[_0x210e3b['changeGroups'][_0x270ca1['partIndex']]]:_0x210e3b['changeGroups']['filter'](_0x2768ab=>'pending'==_0x2768ab['state']);for(const _0xaf2302 of this['_groupChangesByTarget'](_0x210e3b,_0x524a1f)){const {target:_0x2bda7e,groups:_0x1b9480,groupsIndexes:_0x45c4aa,slice:_0x59b63d}=_0xaf2302;if(!_0x2bda7e['editor']['plugins']['has']('TrackChanges'))throw new at('ai-no-track-changes',null);const _0x5282ff=this['_getDocumentRangeForReplyChanges'](_0x270ca1['replyId'],_0x45c4aa[0x0]);if(!_0x5282ff||'$graveyard'==_0x5282ff['range']['root']['rootName']){_0x45c4aa['forEach'](_0x5d633e=>_0x210e3b['setChangeGroupState'](_0x5d633e,'outdated'));continue;}_0x45c4aa['forEach'](_0x211aba=>_0x210e3b['setChangeGroupState'](_0x211aba,'accepted'));const _0x27cc77=qs({'editor':_0x2bda7e['editor'],'reply':_0x210e3b,'interaction':_0xe0f653,'groups':_0x1b9480,'transform':!0x0,'documentCompare':_0x6e267b,'documentCompareOptions':{'anchor':_0x59b63d?.['rootName']??'main','markDeletions':!0x0},'documentContextSlice':_0x59b63d});let _0x9c3e14;this['_scrollToSuggestionRange'](_0x5282ff['range'],!0x1,_0x2bda7e['editor']),_0x2bda7e['editor']['model']['change'](_0x4812c4=>{_0x9c3e14=_0x4812c4['batch'],_0x2bda7e['editor']['plugins']['get']('TrackChangesEditing')['_applyOperationsAsSuggestions'](_0x27cc77),this['_aiEditing']['hideFakeVisualSelection']('change-area');}),this['_batchToChanges']['set'](_0x9c3e14,{'interactionId':_0xe0f653['id'],'replyId':_0x210e3b['id'],'indexes':_0x45c4aa['slice']()});}this['_updateRatings'](_0x210e3b);}['_applySuggestion'](_0x41c0eb){const _0x1bc03f=this['context']['plugins']['get'](_0x367c6c),{reply:_0x4b7757,interaction:_0x36a76f}=this['getInteractionAndReplyById'](_0x41c0eb['replyId']),_0x568b54=void 0x0!==_0x41c0eb['partIndex']?[_0x4b7757['changeGroups'][_0x41c0eb['partIndex']]]:_0x4b7757['changeGroups']['filter'](_0x5224cb=>'pending'==_0x5224cb['state']);for(const _0x189618 of this['_groupChangesByTarget'](_0x4b7757,_0x568b54)){const {target:_0x2835b7,groups:_0x48f5ab,groupsIndexes:_0x44fd49,slice:_0x15bfd0}=_0x189618,_0x280a09=this['_getDocumentRangeForReplyChanges'](_0x41c0eb['replyId'],_0x44fd49[0x0]);if(!_0x280a09||'$graveyard'==_0x280a09['range']['root']['rootName']){_0x44fd49['forEach'](_0x547aa0=>_0x4b7757['setChangeGroupState'](_0x547aa0,'outdated'));continue;}_0x44fd49['forEach'](_0x5b51cc=>_0x4b7757['setChangeGroupState'](_0x5b51cc,'accepted'));const _0x1b9bdf=qs({'editor':_0x2835b7['editor'],'reply':_0x4b7757,'interaction':_0x36a76f,'groups':_0x48f5ab,'transform':!0x0,'documentCompare':_0x1bc03f,'documentCompareOptions':{'anchor':_0x15bfd0?.['rootName']??'main','markDeletions':!0x1},'documentContextSlice':_0x15bfd0});let _0x50f8cb;this['_scrollToSuggestionRange'](_0x280a09['range'],!0x1,_0x2835b7['editor']),_0x2835b7['editor']['model']['change'](_0xaf1d85=>{_0x50f8cb=_0xaf1d85['batch'];for(const _0x22d26e of _0x1b9bdf)_0x22d26e['baseVersion']=_0x2835b7['editor']['model']['document']['version'],Qs(_0x2835b7['editor'],_0x22d26e),_0xaf1d85['batch']['addOperation'](_0x22d26e),_0x2835b7['editor']['model']['applyOperation'](_0x22d26e);}),this['_batchToChanges']['set'](_0x50f8cb,{'interactionId':_0x36a76f['id'],'replyId':_0x4b7757['id'],'indexes':_0x44fd49['slice']()});}this['_updateRatings'](_0x4b7757);}['_rejectSuggestion'](_0x4c648a){const {reply:_0x40ea8c}=this['getInteractionAndReplyById'](_0x4c648a['replyId']);_0x40ea8c['setChangeGroupState'](_0x4c648a['partIndex'],'rejected');}['_openBalloonFor'](_0x444b0e,_0x18b6cc){if(!this['_aiChatBalloon'])return;const {reply:_0x10065c}=this['getInteractionAndReplyById'](_0x444b0e),_0x4f007f=_0x10065c['getContentParts']({'showDiff':this['_aiChatBalloonShowDiff'],'editor':$s(this['context'])});let _0x35da1b,_0x482b20;if(void 0x0!==_0x18b6cc?(_0x482b20=_0x4f007f['find'](_0x217453=>_0x217453['index']==_0x18b6cc),_0x35da1b=_0x482b20?.['index']):(_0x482b20=_0x4f007f[0x0],_0x35da1b=_0x482b20['index']),this['_currentPreviewedChangeGroup']?.['replyId']==_0x444b0e&&this['_currentPreviewedChangeGroup']?.['partIndex']==_0x35da1b)return;const _0x3d8ed4=this['_getUserPresentableContentPartDocumentRange'](_0x444b0e,_0x10065c,_0x482b20),_0x38e9d4=_0x10065c['changeGroups']['find'](_0xfff295=>_0xfff295['index']==_0x35da1b),_0x2c96fd=_0x38e9d4?this['_resolveGroupTarget'](_0x10065c,_0x38e9d4):null,_0x5b4e94=_0x2c96fd?.['editor']??$s(this['context']),_0x46ef17=_0x5b4e94['plugins']['has']('AIChatBalloon')?_0x5b4e94['plugins']['get']('AIChatBalloon'):this['_aiChatBalloon'];if(this['_activeBalloon']&&this['_activeBalloon']!==_0x46ef17&&this['_activeBalloon']['close'](),!_0x3d8ed4)return _0x46ef17['close'](),void(this['_activeBalloon']=void 0x0);this['_activeBalloon']=_0x46ef17,this['_currentPreviewedChangeGroup']={'replyId':_0x444b0e,'partIndex':_0x35da1b},this['_scrollToSuggestionRange'](_0x3d8ed4,!0x0,_0x5b4e94);const _0x284ce3=this['_getPresentableSiblingContentPartIndex'](_0x444b0e,_0x35da1b,'next');_0x46ef17['updateContent']({'part':_0x482b20,'renderingStrategy':'static'}),_0x46ef17['open']({'index':_0x35da1b,'title':hs(this['context']['locale'],'AI_BALLOON_HEADER_TITLE',(_0x35da1b+0x1)['toString']()),'showRotator':null!==_0x284ce3,'ranges':[_0x3d8ed4],'areActionsDisabled':_0x10065c['areActionsDisabled'],'targetEditor':_0x5b4e94}),_0x46ef17['setState']('pending'),this['_aiChatUi']['scrollFeedToSuggestion'](_0x444b0e,_0x35da1b),this['_aiChatUi']['setFeedItemAIReplySuggestionPartActive']({'id':_0x444b0e,'index':_0x35da1b,'isActive':!0x0});}['_getPresentableSiblingContentPartIndex'](_0x202b58,_0xdcbf81,_0x4d2db7){const {reply:_0x5e0507}=this['getInteractionAndReplyById'](_0x202b58),_0x33d42d=_0x5e0507['getContentParts']({'showDiff':this['_aiChatBalloonShowDiff'],'editor':$s(this['context'])});if(0x1==_0x33d42d['length'])return null;const _0x413872=_0x33d42d['findIndex'](_0x17fbd6=>_0x17fbd6['index']==_0xdcbf81),_0x50f689='next'==_0x4d2db7?0x1:-0x1;let _0xca3af=_0x33d42d['at']((_0x413872+_0x50f689)%_0x33d42d['length'])['index'],_0x3417d1=_0x33d42d[_0xca3af];for(;!this['_getUserPresentableContentPartDocumentRange'](_0x202b58,_0x5e0507,_0x3417d1);){if(_0xca3af=_0x33d42d['at']((_0xca3af+_0x50f689)%_0x33d42d['length'])['index'],_0xca3af===_0x413872)return null;_0x3417d1=_0x33d42d[_0xca3af];}return _0xca3af;}['_getUserPresentableContentPartDocumentRange'](_0x55745f,_0x3e6bfb,_0x1aeafc){const _0x1152c6=_0x3e6bfb['changeGroups'];if(!_0x1aeafc['hasChanges'])return null;const _0x366796=_0x1152c6['find'](_0x409b10=>_0x409b10['index']==_0x1aeafc['index']);if('pending'!==_0x366796?.['state'])return null;const _0x3570b2=this['_getDocumentRangeForReplyChanges'](_0x55745f,_0x1aeafc['index']);if(!_0x3570b2)return _0x3e6bfb['setChangeGroupState'](_0x1aeafc['index'],'outdated'),null;const {range:_0x4e27fd,currentIndex:_0x3843fe}=_0x3570b2;return'$graveyard'==_0x4e27fd['root']['rootName']?(_0x3e6bfb['setChangeGroupState'](_0x3843fe,'outdated'),null):_0x3570b2['range'];}['_getDocumentRangeForReplyChanges'](_0x152275,_0x351c04){const {reply:_0x7f69b}=this['getInteractionAndReplyById'](_0x152275),_0x3d25d6=_0x7f69b['changeGroups']['filter'](_0x5601c8=>'pending'==_0x5601c8['state']),_0x1f8f11=_0x3d25d6['map'](_0x22dc4b=>_0x7f69b['changeGroups']['indexOf'](_0x22dc4b));void 0x0===_0x351c04&&(_0x351c04=_0x1f8f11[0x0]);const _0x110c13=_0x1f8f11['indexOf'](_0x351c04);if(-0x1==_0x110c13)return null;const _0x56cb1d=_0x3d25d6[_0x110c13],_0x50301d=this['_resolveGroupTarget'](_0x7f69b,_0x56cb1d);if(!_0x50301d)return null;const {editor:_0x3cccbf,root:_0x35e1cb,parsedDocumentContent:_0x20637e,serializedDocumentContent:_0x24ae85,version:_0x36ab09}=_0x50301d,_0x4ea20b=new _0x36408a([]),_0x320a80=new _0x36408a([]);for(const _0x514ffd of _0x56cb1d['changes']){const _0x4ef14c=this['activeConversation']?.['getSourceByDataId'](_0x514ffd['id']);if((!_0x4ef14c||_0x4ef14c['editor']===_0x50301d['editor']&&_0x4ef14c['rootName']===_0x50301d['root']['rootName'])&&('removed'!=_0x514ffd['type']&&_0x320a80['children']['push'](_0x514ffd['node']['cloneNode'](!0x0)),'new'!=_0x514ffd['type'])){const _0x233f82=_0x3f6b28(_0x4f073d=>Es(_0x4f073d,'data-id')==_0x514ffd['id'],_0x20637e,!0x0);if(!_0x233f82)return null;_0x4ea20b['children']['push'](_0x233f82['cloneNode'](!0x0));}}if(0x0==_0x4ea20b['children']['length']){if(_0x56cb1d['changes'][0x0]['anchorId']){const _0x4ec928=As('data-id',_0x56cb1d['changes'][0x0]['anchorId'],_0x20637e);_0x4ea20b['children']['unshift'](_0x4ec928['cloneNode'](!0x0)),_0x320a80['children']['unshift'](_0x4ec928['cloneNode'](!0x0)),_0x4ec928['nextSibling']&&(_0x4ea20b['children']['push'](_0x4ec928['nextSibling']['cloneNode'](!0x0)),_0x320a80['children']['push'](_0x4ec928['nextSibling']['cloneNode'](!0x0)));}else{const _0x336637=_0x20637e['children'][0x0];if(!_0x336637)return null;_0x4ea20b['children']['push'](_0x336637['cloneNode'](!0x0)),_0x320a80['children']['push'](_0x336637['cloneNode'](!0x0));}}const _0x26d761=_0x3cccbf['data']['parse'](_0x24ae85),_0x4d626e=gs(_0x4ea20b),_0x6a2b42=_0x3cccbf['data']['parse'](_0x4d626e),_0x51e8ef=_0x3cccbf['data']['parse'](_0x4d626e),_0x21adb7=_0x3cccbf['model']['createPositionAt'](_0x6a2b42,0x0),_0x4637ce=gs(_0x320a80),_0x5529ec={'targetEditor':_0x3cccbf,'anchor':_0x21adb7,'markDeletions':!0x1},_0x2daf47=_0x3cccbf['plugins']['get'](_0x367c6c)['getDiff'](_0x4d626e,_0x4637ce,_0x5529ec)['getOperations']();if(!_0x2daf47['length'])return null;_0x3cccbf['model']['change'](_0x113c29=>{for(const _0x5f5b63 of _0x2daf47)if('remove'==_0x5f5b63['type']){const _0x3fb975=_0x5f5b63['sourcePosition'],_0xf042ec=_0x5f5b63['howMany'],_0x150471=new _0x349a38(_0x3fb975,_0xf042ec);_0x113c29['batch']['addOperation'](_0x150471),_0x3cccbf['model']['applyOperation'](_0x150471);}else'marker'!==_0x5f5b63['type']&&(_0x5f5b63['baseVersion']=null,_0x5f5b63['isDocumentOperation']=!0x1,_0x113c29['batch']['addOperation'](_0x5f5b63),_0x3cccbf['model']['applyOperation'](_0x5f5b63));});const _0x188182=ks(_0x3cccbf,_0x2daf47,_0x6a2b42);Ns(_0x3cccbf['model'],_0x188182);const _0xf22f74=_0x188182['getFirstRange']()['start']['path']['slice'](),_0x3e3220=_0x188182['getFirstRange']()['end']['path']['slice'](),_0x34d3cd=[];let _0x3ba371=_0x6a2b42,_0x423eb8=_0x51e8ef;for(let _0x18d4c7=0x0;_0x18d4c7<_0x3e3220['length'];_0x18d4c7++){const _0xeae322=_0x3ba371['maxOffset']-_0x3e3220[_0x18d4c7];_0x34d3cd[_0x18d4c7]=_0x423eb8['maxOffset']-_0xeae322,_0x3ba371=_0x3ba371['getChildAtOffset'](_0x3e3220[_0x18d4c7]),_0x423eb8=_0x423eb8['getChildAtOffset'](_0x34d3cd[_0x18d4c7]);}const _0x55ed5b=_0x3cccbf['model']['createRange'](_0x3cccbf['model']['createPositionFromPath'](_0x51e8ef,_0xf22f74),_0x3cccbf['model']['createPositionFromPath'](_0x51e8ef,_0x34d3cd)),_0x941322=_0x51e8ef['getChild'](0x0)['getAttribute'](_0x307282),_0x2e712f=Array['from'](_0x26d761['getChildren']())['find'](_0x14668f=>_0x14668f['getAttribute'](_0x307282)==_0x941322)['getPath'](),_0x5e4a24=_0x55ed5b['start']['path']['slice'](),_0x1b6bea=_0x55ed5b['end']['path']['slice']();_0x5e4a24[0x0]=_0x2e712f[0x0]+_0x5e4a24[0x0],_0x1b6bea[0x0]=_0x2e712f[0x0]+_0x1b6bea[0x0];let _0x30cf4e=_0x3cccbf['model']['createRange'](_0x3cccbf['model']['createPositionFromPath'](_0x35e1cb,_0x5e4a24),_0x3cccbf['model']['createPositionFromPath'](_0x35e1cb,_0x1b6bea));const _0x9666f4=_0x3cccbf['model']['document']['history']['getOperations'](_0x36ab09);for(const _0x4fa399 of _0x9666f4)_0x30cf4e=_0x2a951f['_createFromRanges'](_0x30cf4e['getTransformedByOperation'](_0x4fa399));return{'range':_0x30cf4e,'currentIndex':_0x351c04};}['_integrateEditorBalloon'](_0x51df3d){if(!_0x51df3d['plugins']['has']('AIChatBalloon'))return;const _0x388730=_0x51df3d['plugins']['get']('AIChatBalloon');this['_wiredBalloons']['has'](_0x388730)||(this['_wiredBalloons']['add'](_0x388730),this['_aiChatBalloon']||(this['_aiChatBalloon']=_0x388730),_0x388730['bind']('showDiff')['to'](this,'_aiChatBalloonShowDiff'),this['listenTo'](_0x388730,'toggleSuggestionDisplayMode',()=>{const {replyId:_0x231ef1,partIndex:_0xdf7688}=this['_currentPreviewedChangeGroup'];this['_aiChatBalloonShowDiff']=!this['_aiChatBalloonShowDiff'];const {reply:_0xc81384}=this['getInteractionAndReplyById'](_0x231ef1),_0x53f750=_0xc81384['changeGroups']['find'](_0x39156b=>_0x39156b['index']===_0xdf7688),_0x149c3f=_0x53f750?this['_resolveGroupTarget'](_0xc81384,_0x53f750):null,_0x4acedd=_0xc81384['getContentParts']({'showDiff':this['_aiChatBalloonShowDiff'],'groupIndex':_0xdf7688,'editor':_0x149c3f?.['editor']??$s(this['context'])});(this['_activeBalloon']??_0x388730)['updateContent']({'part':_0x4acedd[0x0],'renderingStrategy':'static','keepErrors':!0x0});}),this['listenTo'](_0x388730,'applySuggestion',()=>{const {replyId:_0x2cba4e,partIndex:_0x36f1d8}=this['_currentPreviewedChangeGroup'];this['_applySuggestion']({'replyId':_0x2cba4e,'partIndex':_0x36f1d8}),(this['_activeBalloon']??_0x388730)['setState']('accepted');}),this['listenTo'](_0x388730,'insertSuggestion',()=>{const {replyId:_0x4c7fc9,partIndex:_0x4482b7}=this['_currentPreviewedChangeGroup'];this['_insertSuggestion']({'replyId':_0x4c7fc9,'partIndex':_0x4482b7}),(this['_activeBalloon']??_0x388730)['setState']('accepted');}),this['listenTo'](_0x388730,'rejectSuggestion',()=>{const {replyId:_0x5699cd,partIndex:_0x1c4ae0}=this['_currentPreviewedChangeGroup'];this['_rejectSuggestion']({'replyId':_0x5699cd,'partIndex':_0x1c4ae0}),(this['_activeBalloon']??_0x388730)['setState']('rejected');}),this['listenTo'](_0x388730,'showNext',()=>{const {replyId:_0x721cef,partIndex:_0x3409ad}=this['_currentPreviewedChangeGroup'],_0x8e282f=this['_getPresentableSiblingContentPartIndex'](_0x721cef,_0x3409ad,'next');null!==_0x8e282f&&this['_openBalloonFor'](_0x721cef,_0x8e282f);}),this['listenTo'](_0x388730,'showPrevious',()=>{const {replyId:_0x2426f7,partIndex:_0x38212a}=this['_currentPreviewedChangeGroup'],_0x3db263=this['_getPresentableSiblingContentPartIndex'](_0x2426f7,_0x38212a,'previous');null!==_0x3db263&&this['_openBalloonFor'](_0x2426f7,_0x3db263);}),this['listenTo'](_0x388730,'dialogClosed',(_0x40ccfb,{id:_0x2c84c0})=>{if('aiChatBalloon'!==_0x2c84c0)return;const {replyId:_0x41479c,partIndex:_0x237599}=this['_currentPreviewedChangeGroup'];this['_currentPreviewedChangeGroup']=null,this['_aiChatUi']['setFeedItemAIReplySuggestionPartActive']({'id':_0x41479c,'index':_0x237599,'isActive':!0x1}),this['_activeBalloon']===_0x388730&&(this['_activeBalloon']=void 0x0);}));}['_integrateEditor'](_0x46dee5){if(this['_integrateEditorBalloon'](_0x46dee5),_0x46dee5['plugins']['has']('Undo')){const _0x488cb0=_0x46dee5['commands']['get']('undo'),_0x499b4e=_0x46dee5['commands']['get']('redo');this['listenTo'](_0x488cb0,'revert',(_0x412676,_0x9b468f,_0x471887)=>{const _0x1599ce=this['_batchToChanges']['get'](_0x9b468f);if(!_0x1599ce)return;const _0x134b19=this['activeConversation']['getInteraction'](_0x1599ce['interactionId']),_0x51798f=_0x134b19?.['getReply'](_0x1599ce['replyId']);this['_batchToChanges']['delete'](_0x9b468f),_0x134b19&&_0x51798f&&(_0x1599ce['indexes']['forEach'](_0x1a048c=>_0x51798f['setChangeGroupState'](_0x1a048c,'pending')),this['_batchToChanges']['set'](_0x471887,_0x1599ce));}),this['listenTo'](_0x499b4e,'revert',(_0x62df05,_0x20d110,_0x236f35)=>{const _0x972a63=this['_batchToChanges']['get'](_0x20d110);if(!_0x972a63)return;const _0x43cb53=this['activeConversation']['getInteraction'](_0x972a63['interactionId']),_0x49499d=_0x43cb53?.['getReply'](_0x972a63['replyId']);this['_batchToChanges']['delete'](_0x20d110),_0x43cb53&&_0x49499d&&(_0x972a63['indexes']['forEach'](_0x2c4376=>_0x49499d['setChangeGroupState'](_0x2c4376,'accepted')),this['_batchToChanges']['set'](_0x236f35,_0x972a63));});}const _0xf1d059=_0x46dee5['config']['get']('ai.chat.context');_0xf1d059['alwaysAddSelection']&&_0xf1d059['document']['enabled']&&this['listenTo'](_0x46dee5['model']['document']['selection'],'change:range',(_0x702a84,_0x3e2b7e)=>{if(!_0x3e2b7e['directChange'])return;'chat'===_0x46dee5['plugins']['get']('AITabs')['view']['activeTab']&&(_0x46dee5['model']['hasContent'](_0x46dee5['model']['document']['selection'])?this['addSelectionToChatContext']():this['removeSelectionFromChatContext']());});}async['_getLastCreatedConversationId'](){const _0x5ebf5d=this['_aiConnector']['fetchConversations'](this['getGroupId'](),{'limit':0x1,'sortBy':'createdAt'});try{const _0x5dd806=await _0x5ebf5d['getConversations']();return _0x5dd806['length']?_0x5dd806[0x0]['id']:'new';}catch(_0x9e1563){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':_0x9e1563})),this['_aiChatUi']['toggleLoadingSkeleton'](!0x1),this['_aiChatUi']['disableControls'](),null;}}async['_startConversationSafely'](_0x418b1a={}){try{this['_aiChatUi']['enableControls'](),await this['_handleStartConversation'](_0x418b1a);}catch(_0xbf8b90){this['_aiChatUi']['addFeedItemError']({'errorMessage':hs(this['context']['locale'],'AI_CHAT_UNABLE_TO_START_CONVERSATION'),'id':_0x418b1a['id']||ot()}),console['error'](_0xbf8b90),this['activeConversation']=void 0x0,this['_aiChatUi']['disableControls']();}}async['_handleStartConversation']({id:_0x46bba3,modelId:_0x383216}={}){this['_activeBalloon']?.['close'](),this['_activeBalloon']=void 0x0,this['_currentPreviewedChangeGroup']=null;let _0x5e631c=_0x383216;_0x5e631c||(_0x46bba3||!this['activeConversation']?_0x5e631c=this['context']['config']['get']('ai.models.defaultModelId'):this['_aiChatUi']['isModelAvailable']&&(_0x5e631c=this['activeConversation']['selectedModel']['id'])),await this['_stopLastInteraction']();const _0x4e7fc3=this['getGroupId'](),_0x1119fc=_0x46bba3||ot();let _0x4d1340;this['activeConversation']=new Gs({'connector':this['_aiConnector'],'chatModels':this['_aiChatModels'],'selectedModelId':_0x5e631c,'conversationId':_0x1119fc,'group':_0x4e7fc3,'getEditor':()=>$s(this['context']),'getEditors':()=>Ws(this['context']),'locale':this['context']['locale'],'isFromHistory':!!_0x46bba3}),this['activeConversation']['delegate']('toolDataReceived','interactionCreated','interactionStarted','replyCreated')['to'](this),this['activeConversation']['on']('conversationInitialized',(_0x5db5ab,_0x5bb847)=>{this['_aiChatUi']['createConversation'](_0x5bb847),this['_aiChatUi']['resetMessageInput'](),this['_aiChatUi']['clearPendingContextUI'](),this['_aiChatUi']['clearConversationContextUI'](),_0x46bba3||(this['_aiChatUi']['resetConversationTitle'](),this['addCurrentDocumentToChatContext']());}),this['activeConversation']['on']('uploadProgressChanged',(_0x4bcd61,_0x298a97)=>{this['_aiChatUi']['setIsUploadInProgress'](_0x298a97['isUploadInProgress']);}),this['activeConversation']['on']('webSearchStarted',()=>{const _0x36c75c=this['_aiChatUi']['prepareLoadingMessage']({'isWebSearchEnabled':!0x0,'isReasoningEnabled':!0x1});this['_aiChatUi']['setLoadingMessage'](_0x36c75c);}),this['activeConversation']['on']('reasoningStarted',()=>{const _0x198a58=this['_aiChatUi']['prepareLoadingMessage']({'isWebSearchEnabled':!0x1,'isReasoningEnabled':!0x0});this['_aiChatUi']['setLoadingMessage'](_0x198a58);}),this['activeConversation']['on']('webSearchFinished',(_0x420b13,_0x5bca42)=>{this['_aiChatUi']['addFeedInteractionHeader'](_0x5bca42,{'isWebSearchEnabled':!0x0,'isReasoningEnabled':!0x1});}),this['activeConversation']['on']('reasoningFinished',(_0x41e716,_0x1307dd)=>{this['_aiChatUi']['addFeedInteractionHeader'](_0x1307dd,{'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',(_0x534657,_0x40d1fe)=>{this['_aiChatUi']['removeFeedInteraction'](_0x40d1fe['id']);}),this['activeConversation']['on']('setConversationTitle',(_0xb3ca59,_0x1c95c5,_0x254e71)=>{this['_updateConversationTitle'](_0x1c95c5,_0x254e71);}),this['activeConversation']['on']('replyContentUpdated',async(_0x103ef9,_0x5cdf14)=>{void 0x0!==_0x4d1340&&_0x4d1340!==_0x5cdf14['id']&&this['_updateReplyContentThrottled']['flush'](),_0x4d1340=_0x5cdf14['id'],await this['_updateReplyContentThrottled']({'reply':_0x5cdf14});}),this['activeConversation']['on']('replyChangeGroupStateUpdated',(_0x433527,{reply:_0x583b42,index:_0x2107de,state:_0x54e1ef})=>{this['_aiChatUi']['updateFeedItemAIReplySuggestionPartState']({'id':_0x583b42['id'],'index':_0x2107de,'state':_0x54e1ef}),this['_currentPreviewedChangeGroup']?.['replyId']['includes'](_0x583b42['id'])&&this['_currentPreviewedChangeGroup']?.['partIndex']==_0x2107de&&(this['_activeBalloon']??this['_aiChatBalloon'])?.['setState'](_0x54e1ef);}),this['activeConversation']['on']('contextItemAdded',(_0x54776d,_0x2ade4a)=>{if(this['_aiChatUi']['addContextItem'](_0x2ade4a['contextItem'],_0x2ade4a['isLoading']),'selection'===_0x2ade4a['contextItem']['type']){const _0x25806d=[...$s(this['context'])['model']['document']['selection']['getRanges']()];this['_aiEditing']['showFakeVisualSelection']({'ranges':_0x25806d,'id':'context','priority':0x1});}}),this['activeConversation']['on']('contextItemRemoved',(_0x31650f,_0x3cdc86)=>{this['_aiChatUi']['removeContextItem'](_0x3cdc86['uiId']),'current-document'==_0x3cdc86['uiId']&&this['removeSelectionFromChatContext'](),'selection'===_0x3cdc86['type']&&this['_aiEditing']['hideFakeVisualSelection']('context');}),this['activeConversation']['on']('contextItemLoadingEnded',(_0x274f22,_0xe09422)=>{this['_aiChatUi']['setContextItemLoading'](_0xe09422['contextItem']['uiId'],_0xe09422['isLoading']);}),this['activeConversation']['on']('contextSent',(_0x4f2892,_0x538d78)=>{this['_aiChatUi']['setConversationContext'](_0x538d78['contextItems']);}),this['activeConversation']['on']('addContextOptionsChanged',(_0xc7a00e,_0x333a49)=>{this['_aiChatUi']['setAddContextOptions'](_0x333a49['options']);}),this['activeConversation']['on']('sourceResourcesLoaded',(_0x535436,_0x47b879)=>{this['_aiChatUi']['populateSourceResourceBalloon'](_0x47b879['sourceId'],_0x47b879['source'],_0x47b879['resources'],_0x47b879['uid']);}),this['activeConversation']['on']('resourceStateChanged',(_0x106a47,_0x4a9275)=>{this['_aiChatUi']['updateResourceState'](_0x4a9275['sourceId'],_0x4a9275['resourceId'],_0x4a9275['isInContext']);}),this['activeConversation']['on']('capabilitiesUpdated',(_0x571089,_0x10559f)=>{this['_aiChatUi']['updateCapabilities'](_0x10559f);}),this['activeConversation']['on']('modelSelected',async(_0x3a1250,_0x322a20)=>{const _0x396b9c=(await this['_aiChatModels']['getAll']())['find'](_0x1f9e0b=>_0x1f9e0b['id']===_0x322a20['selectedModel']?.['id'])||null;this['_aiChatUi']['setSelectedModel'](_0x396b9c,_0x322a20['isDisabled']);}),this['activeConversation']['on']('error',(_0x1ff144,{error:_0x1eb05e,interactionId:_0x30d9ac,fileName:_0x40597c,url:_0x2d2a5d,sourceId:_0x2af697,sourceLabel:_0x4f2ddc})=>{const _0x3b1e8d=_0x30d9ac?_0x30d9ac+':'+ot():ot();_0x1eb05e['message']['startsWith']('ai-request-aborted')?this['_aiChatUi']['addFeedItemStaticMessage']({'staticMessage':hs(this['context']['locale'],'AI_CHAT_ABORTED_MESSAGE'),'id':_0x3b1e8d}):_0x1eb05e['message']['startsWith']('ai-chat-conversation-init-failed')||_0x1eb05e['message']['startsWith']('ai-chat-conversation-start-failed')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':hs(this['context']['locale'],'AI_CHAT_UNABLE_TO_START_CONVERSATION'),'id':_0x3b1e8d}),this['_logError'](_0x1eb05e)):_0x1eb05e['message']['startsWith']('ai-chat-file-upload-failed')?this['_aiChatUi']['addFeedItemError']({'errorMessage':hs(this['context']['locale'],'AI_CHAT_CONTEXT_UNABLE_TO_UPLOAD_FILE',_0x40597c),'id':_0x3b1e8d}):_0x1eb05e['message']['startsWith']('ai-chat-url-upload-failed')?this['_aiChatUi']['addFeedItemError']({'errorMessage':hs(this['context']['locale'],'AI_CHAT_CONTEXT_UNABLE_TO_UPLOAD_URL',_0x2d2a5d),'id':_0x3b1e8d}):_0x1eb05e['message']['startsWith']('ai-chat-context-invalid-data')?this['_aiChatUi']['addFeedItemError']({'errorMessage':hs(this['context']['locale'],'AI_CHAT_CONTEXT_INVALID_DATA'),'id':_0x3b1e8d}):_0x1eb05e['message']['startsWith']('ai-chat-context-unsupported-type')?this['_aiChatUi']['addFeedItemError']({'errorMessage':hs(this['context']['locale'],'AI_CHAT_CONTEXT_UNSUPPORTED_TYPE'),'id':_0x3b1e8d}):_0x1eb05e['message']['startsWith']('ai-chat-source-resources-load-failed')?(_0x2af697&&this['_aiChatUi']['closeSourceResourceBalloon'](_0x2af697),this['_aiChatUi']['addFeedItemError']({'errorMessage':hs(this['context']['locale'],'AI_CHAT_CONTEXT_UNABLE_TO_LOAD_RESOURCES',_0x4f2ddc||'source'),'id':_0x3b1e8d}),this['_logError'](_0x1eb05e)):_0x1eb05e['message']['startsWith']('ai-chat-resource-load-failed')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':hs(this['context']['locale'],'AI_CHAT_RESOURCE_LOAD_FAILED'),'id':_0x3b1e8d}),this['_logError'](_0x1eb05e)):_0x1eb05e['message']['startsWith']('ai-chat-invalid-request')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':hs(this['context']['locale'],'AI_CHAT_INVALID_REQUEST'),'id':_0x3b1e8d}),this['_logError'](_0x1eb05e)):_0x1eb05e['message']['startsWith']('ai-chat-context-unsupported-file-type')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':hs(this['context']['locale'],'AI_CHAT_CONTEXT_UNSUPPORTED_FILE_TYPE'),'id':_0x3b1e8d}),this['_logError'](_0x1eb05e)):_0x1eb05e['message']['startsWith']('ai-chat-context-file-too-large')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':hs(this['context']['locale'],'AI_CHAT_CONTEXT_FILE_TOO_LARGE'),'id':_0x3b1e8d}),this['_logError'](_0x1eb05e)):_0x1eb05e['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':_0x3b1e8d}),this['_logError'](_0x1eb05e)):_0x1eb05e['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':_0x3b1e8d}),this['_logError'](_0x1eb05e)):(this['_aiChatUi']['addFeedItemError']({'errorMessage':hs(this['context']['locale'],'AI_CHAT_GENERIC_ERROR'),'id':_0x3b1e8d}),this['_logError'](_0x1eb05e));}),await this['activeConversation']['init'](this['context']['config']['get']('ai.chat.context')),_0x46bba3||await this['activeConversation']['start']();}async['_handleUIUserMessage']({message:_0x165a47,attributes:_0x4062c0}){if(!this['activeConversation'])throw new at('ai-chat-controller-no-active-conversation');if(this['activeConversation']['isCurrentDocumentInContext']()){const _0x264906=await this['_aiEditing']['getDocumentData']();_0x264906['length']>0x1?await this['activeConversation']['updateDocumentsInContext'](_0x264906):await this['activeConversation']['updateCurrentDocumentInContext'](_0x264906[0x0]);}this['activeConversation']['id']&&this['activeConversation']['isStarted']&&await this['activeConversation']['handleUserInteraction']({'userMessage':_0x165a47,'attributes':_0x4062c0});}['_logError'](_0x4223d1){Et(_0x4223d1['message']);}['_removeFromContext'](_0x2ea0f8){this['activeConversation']?.['removeFromContext'](_0x2ea0f8);}['_toggleWebSearch'](){this['activeConversation']?.['toggleWebSearch']();}['_toggleReasoning'](){this['activeConversation']?.['toggleReasoning']();}['getInteractionAndReplyById'](_0x7f7a3b){const [_0x742331,_0xca63ee]=_0x7f7a3b['split'](':'),_0x45f3dc=this['activeConversation']['getInteraction'](_0x742331),_0x56ad8c=_0x45f3dc['getReply'](_0xca63ee);return{'interaction':_0x45f3dc,'reply':_0x56ad8c};}['_resolveGroupTarget'](_0x446ee4,_0x26b27d){const _0x50a7c2=[..._0x26b27d['changes']['filter'](_0x542ddd=>'context'!==_0x542ddd['type']),..._0x26b27d['changes']['filter'](_0x2915ef=>'context'===_0x2915ef['type'])];for(const _0x3bc460 of _0x50a7c2){const _0x37074c=_0x446ee4['newNodeAnchorIds']['get'](_0x3bc460['id']),_0x431c8c=this['activeConversation']?.['getSourceByDataId'](_0x3bc460['id'])||this['activeConversation']?.['getSourceByDataId'](_0x37074c)||this['activeConversation']?.['getSourceByDataId'](_0x3bc460['anchorId']??void 0x0);if(_0x431c8c){if('destroyed'===_0x431c8c['editor']['state'])return null;const _0xd537b4=_0x431c8c['editor']['model']['document']['getRoot'](_0x431c8c['rootName']);return _0xd537b4?{'editor':_0x431c8c['editor'],'root':_0xd537b4,'parsedDocumentContent':_s(_0x431c8c['content']),'serializedDocumentContent':_0x431c8c['content'],'version':_0x431c8c['version']}:null;}}const _0x8b1479=$s(this['context']),_0x15f54f=this['activeConversation']['getInteraction'](_0x446ee4['interactionId']),_0x50065b=_0x15f54f?.['getDocumentContext']();return{'editor':_0x8b1479,'root':_0x8b1479['model']['document']['getRoot'](),'parsedDocumentContent':_0x446ee4['documentContextContent'],'serializedDocumentContent':_0x50065b?.['content'],'version':_0x50065b?.['version']};}['_groupChangesByTarget'](_0x800dbc,_0x2af440){const _0x341025=new Map();for(const _0x207402 of _0x2af440){const _0x1366a5=this['_resolveGroupTarget'](_0x800dbc,_0x207402);if(!_0x1366a5)continue;const _0x411d0c=(_0x1366a5['editor']['id']||'e')+'|'+_0x1366a5['root']['rootName'];let _0x6655ae=_0x341025['get'](_0x411d0c);if(!_0x6655ae){let _0x12e46a;for(const _0xbaabf1 of[..._0x207402['changes']['filter'](_0x499d89=>'context'!==_0x499d89['type']),..._0x207402['changes']['filter'](_0x19ba9b=>'context'===_0x19ba9b['type'])])if(_0x12e46a=this['activeConversation']?.['getDocumentContextSliceByDataId'](_0xbaabf1['id'])||this['activeConversation']?.['getDocumentContextSliceByDataId'](_0x800dbc['newNodeAnchorIds']['get'](_0xbaabf1['id'])),_0x12e46a)break;_0x6655ae={'target':{'editor':_0x1366a5['editor'],'root':_0x1366a5['root']},'slice':_0x12e46a,'groups':[],'groupsIndexes':[]},_0x341025['set'](_0x411d0c,_0x6655ae);}_0x6655ae['groups']['push'](_0x207402),_0x6655ae['groupsIndexes']['push'](_0x800dbc['changeGroups']['indexOf'](_0x207402));}return Array['from'](_0x341025['values']());}['_scrollToSuggestionRange'](_0x1330a7,_0x489d83=!0x1,_0x42f026){_0x42f026??=$s(this['context']);const _0x4d056a={'target':_0x42f026['editing']['view']['domConverter']['viewRangeToDom'](_0x42f026['editing']['mapper']['toViewRange'](_0x1330a7)),'viewportOffset':{'top':0x96,'left':0x0,'bottom':0x32,'right':0x0},'ancestorOffset':0x14,'alignToTop':_0x489d83};_0x489d83&&(_0x4d056a['alignToTop']=!0x0),Ct(_0x4d056a);}['_updateConversationTitle'](_0x4ba40,_0x499ed7=!0x1){this['_aiChatUi']['setConversationTitle'](_0x4ba40||hs(this['context']['locale'],'AI_CHAT_UNTITLED_CONVERSATION'),_0x499ed7);}['_addFeedItemReply'](_0x807ed0){'text'===_0x807ed0['type']?this['_aiChatUi']['addFeedItemAIReply'](_0x807ed0):this['_aiChatUi']['addFeedItemAISuggestion'](_0x807ed0);}async['_updateReplyContent']({reply:_0x2b9fae,renderingStrategy:_0x38c689}){const {id:_0x90d1ed,interactionId:_0x1ab847,isDone:_0x56e31e,type:_0x21e826,parsedContent:_0x579876}=_0x2b9fae,_0x157218=_0x1ab847+':'+_0x90d1ed;if('modification'===_0x21e826){const _0xdc7082=_0x2b9fae['getContentParts']({'showDiff':this['_aiChatUi']['showDiff'],'editor':$s(this['context'])});await this['_aiChatUi']['updateFeedItemAIReplySuggestionContent']({'id':_0x157218,'parts':_0xdc7082,'isDone':_0x56e31e,'skipLoadingEffects':_0x2b9fae['isFromHistory']});}else'text'===_0x21e826&&await this['_aiChatUi']['updateFeedItemAIReplyContent']({'id':_0x157218,'parsedContent':_0x579876,'renderingStrategy':_0x38c689,'isDone':_0x56e31e});_0x56e31e&&_0x2b9fae['sources']['length']>0x0&&this['_aiChatUi']['updateFeedItemAIReplySources'](_0x157218,_0x2b9fae['sources']);}['_updateReplyContentThrottled']=_0x56a581(this['_updateReplyContent']['bind'](this),0xc8);async['_stopLastInteraction'](){const _0x57a4fb=this['activeConversation']?.['lastInteraction'];_0x57a4fb&&(_0x57a4fb['stop'](),this['_aiChatUi']['stopInteraction'](_0x57a4fb)),this['_updateReplyContentThrottled']['cancel']();}async['_flushLastInteractionUI'](){const _0x59f8b8=this['activeConversation']?.['lastInteraction'];if(_0x59f8b8){for await(const _0x117fcd of _0x59f8b8['replies'])this['_aiChatUi']['hasFeedItem'](_0x117fcd['id'])||this['_addFeedItemReply'](_0x117fcd),await this['_updateReplyContent']({'reply':_0x117fcd,'renderingStrategy':'static'});}}['_updateRatings'](_0x4bd036){const _0x5c0119={'positiveCount':_0x4bd036['changeGroups']['filter'](_0x40a4a8=>'accepted'===_0x40a4a8['state'])['length'],'totalCount':_0x4bd036['changeGroups']['length'],'modificationId':_0x4bd036['id']},_0x192f54=this['activeConversation']['getInteraction'](_0x4bd036['interactionId'])['messageId'];_0x192f54&&this['_aiConnector']['upsertAIChatRating'](this['activeConversation']['id'],_0x192f54,_0x5c0119);}['_getAIChatFeedAPI'](_0x4118a3){const _0xd30140=this['_aiChatUi'],_0x21daff=()=>{_0x4118a3['resetWebSearchState'](),_0x4118a3['resetReasoningState'](),_0xd30140['clearLoadingMessage']();},_0x37f66=()=>{_0x4118a3['currentReply']&&(_0x4118a3['currentReply']['done'](),_0x4118a3['currentReply']=void 0x0);};return{'insertTextReply':(_0x3214f3,_0x3424d4)=>{_0x37f66(),_0x21daff();const _0x573c23=_0x4118a3['currentReply']=_0x4118a3['createReply']({'type':'text','interactionId':_0x4118a3['id'],'content':_0x3214f3,'id':_0x3424d4||ot()});return _0x37f66(),_0x573c23;},'insertCustomElement':async(_0xaa4174,_0x23b058)=>(_0x37f66(),_0x21daff(),_0xd30140['addFeedItemCustomElement'](_0xaa4174,_0x23b058||ot())),'setLoadingMessage':_0x37ebed=>{_0xd30140['setLoadingMessage'](_0x37ebed);},'clearLoadingMessage':()=>{_0xd30140['clearLoadingMessage']();}};}}const zs='ai-selection',js=['br'];class Js extends _0xee6711{constructor(_0x5742ca){super(_0x5742ca),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 _0xd338f0=Ws(this['context']),_0xea3c3a=_0xd338f0['find'](_0x394699=>_0x394699['plugins']['has']('RealTimeCollaborationClient'))||_0xd338f0[0x0],_0x30bc61=_0xea3c3a['plugins']['has']('RealTimeCollaborationClient')&&_0xea3c3a['plugins']['get']('RealTimeCollaborationClient')['sessionId'];this['_sessionId']=_0x30bc61||ot();}return this['_sessionId'];}async['getDocumentData'](){const _0x5c3466=Ws(this['context']);if(!_0x5c3466['length'])throw new at('ai-get-editor-from-context-no-editor');const _0x528657=[],_0x226781=new Set();for(const _0x37e96b of _0x5c3466){const _0x4be71e=_0x37e96b['config']['get']('roots')||{};for(const _0x4c73b1 of _0x37e96b['model']['document']['getRoots']()){if('$graveyard'===_0x4c73b1['rootName'])continue;const _0xc8b4c0=await this['_getDocumentDataForEditorRoot'](_0x37e96b,_0x4c73b1,_0x226781),_0x34b9ff=_0x4be71e[_0x4c73b1['rootName']];_0x528657['push']({'editor':_0x37e96b,'rootName':_0x4c73b1['rootName'],'content':_0xc8b4c0['content'],'version':_0xc8b4c0['version'],'sessionId':this['sessionId'],'selections':_0xc8b4c0['selections'],'name':_0x4c73b1['rootName'],'description':_0x34b9ff?.['description']});}}return _0x528657;}async['_getDocumentDataForEditorRoot'](_0x2bc570,_0x2e9677,_0x131c29){const _0x44984f=_0x2bc570['data']['toView'](_0x2e9677,{'convertAiChatSelectionMarker':!0x0}),_0x2934ae=new _0x506174(_0x2bc570['editing']['view']['document']);this['_setDataIdsOnChildren'](_0x44984f,_0x2934ae,_0x131c29);let _0x5e9fd3=await this['_getDocumentDataStringFromView'](_0x44984f,_0x2bc570);const _0x4ac2bc=this['_getMarkersInDocumentOrder'](_0x2bc570,_0x2e9677),_0x380786=[];for(const _0x1f7e52 of _0x4ac2bc){const _0x1352c8='<'+_0x1f7e52['name']+':start></'+_0x1f7e52['name']+':start>',_0x407f3d=_0x5e9fd3['indexOf'](_0x1352c8);_0x5e9fd3=_0x5e9fd3['substring'](0x0,_0x407f3d)+_0x5e9fd3['substring'](_0x407f3d+_0x1352c8['length']);const _0x116411='<'+_0x1f7e52['name']+':end></'+_0x1f7e52['name']+':end>',_0xaa18df=_0x5e9fd3['indexOf'](_0x116411);_0x5e9fd3=_0x5e9fd3['substring'](0x0,_0xaa18df)+_0x5e9fd3['substring'](_0xaa18df+_0x116411['length']),_0x380786['push']({'markerName':_0x1f7e52['name'],'start':_0x407f3d,'end':_0xaa18df,'htmlFragment':_0x5e9fd3['substring'](_0x407f3d,_0xaa18df)});}return{'content':_0x5e9fd3,'version':_0x2bc570['model']['document']['version'],'selections':_0x380786};}async['afterInit'](){this['context']instanceof _0x4df290?this['_integrateEditor'](this['context']):this['listenTo'](this['context']['editors'],'add',(_0x10a6cb,_0x1e9cb3)=>{_0x1e9cb3['on']('ready',()=>{this['_integrateEditor'](_0x1e9cb3);});});}['_setOutputDataProcessor'](_0x37f281){this['_outputDataProcessor']=_0x37f281;}async['_getDocumentDataStringFromView'](_0x2cbf74,_0x2646a1){let _0x5e03f7;if(this['_outputDataProcessor']){const _0x20bd56=_0x2646a1['data']['processor']['domConverter']['viewToDom'](_0x2cbf74),_0x46033f=await this['_outputDataProcessor'](_0x20bd56);_0x5e03f7=_0x2646a1['data']['processor']['htmlWriter']['getHtml'](_0x46033f);}else _0x5e03f7=_0x2646a1['data']['processor']['toData'](_0x2cbf74);return _0x5e03f7;}['_integrateEditor'](_0x2f0988){_0x2f0988['ui']['focusTracker']['on']('change:isFocused',(_0x3f01cf,_0x383639,_0x59d9d3)=>{_0x59d9d3&&(this['_lastContentFocusedEditor']=_0x2f0988);}),_0x2f0988['on']('destroy',()=>{this['_lastContentFocusedEditor']===_0x2f0988&&(this['_lastContentFocusedEditor']=void 0x0);}),_0x2f0988['conversion']['for']('editingDowncast')['markerToHighlight']({'model':zs,'view':({markerName:_0x485603})=>({'classes':['ck-ai-assistant-ui_theme','ck-fake-ai-selection','ck-fake-ai-selection-'+_0x485603['split'](':')[0x1]],'priority':0xc})}),_0x2f0988['conversion']['for']('dataDowncast')['markerToElement']({'model':zs+':context','view':(_0x54273d,{writer:_0x4f5dc3,options:_0x292761})=>_0x292761['convertAiChatSelectionMarker']?_0x4f5dc3['createUIElement'](_0x54273d['markerName']+':'+(_0x54273d['isOpening']?'start':'end')):null});}['showFakeVisualSelection'](_0x5cd76b){const _0x2e1bf5=this['_fakeSelections'][0x0]||null;this['_addFakeSelection'](_0x5cd76b);const _0xa6f81f=this['_fakeSelections'][0x0]||null;this['_refreshFakeSelection'](_0x2e1bf5,_0xa6f81f);}['hideFakeVisualSelection'](_0x42e711){const _0xfcd1a9=this['_fakeSelections'][0x0]||null;this['_removeFakeSelectionById'](_0x42e711);const _0x33ed1c=this['_fakeSelections'][0x0]||null;this['_refreshFakeSelection'](_0xfcd1a9,_0x33ed1c);}async['modelToDataWithIds'](_0x104f34){const _0x4eef10=$s(this['context']),_0x5cd297=_0x4eef10['data']['toView'](_0x104f34),_0x485116=new _0x506174(_0x4eef10['editing']['view']['document']);return this['_setDataIdsOnChildren'](_0x5cd297,_0x485116),this['_getDocumentDataStringFromView'](_0x5cd297,_0x4eef10);}['_setDataIdsOnChildren'](_0x194bcf,_0x1c7063,_0x59e9fa=new Set()){let _0x528ed8=!0x1;for(const _0x1c03c9 of _0x194bcf['getChildren']()){if(!_0x1c03c9['is']('view:element')||js['includes'](_0x1c03c9['name']))continue;const _0x294b91=_0x1c03c9['is']('view:containerElement'),_0x5533cb=_0x1c03c9['is']('view:emptyElement'),_0x20321c=this['_setDataIdsOnChildren'](_0x1c03c9,_0x1c7063,_0x59e9fa);if(_0x1c03c9['hasAttribute']('data-id')){_0x528ed8=!0x0,_0x59e9fa['add'](_0x1c03c9['getAttribute']('data-id'));continue;}(_0x294b91||_0x5533cb||_0x20321c)&&(_0x1c7063['setAttribute']('data-id',this['_nextDataId'](_0x59e9fa),_0x1c03c9),_0x528ed8=!0x0);}return _0x528ed8;}['_nextDataId'](_0x5a735f){let _0x2bcd4e;do{_0x2bcd4e='';for(let _0x5ae44b=0x0;_0x5ae44b<0x4;_0x5ae44b++)_0x2bcd4e+=String['fromCharCode'](0x61+Math['floor'](0x1a*Math['random']()));}while(_0x5a735f['has'](_0x2bcd4e));return _0x5a735f['add'](_0x2bcd4e),_0x2bcd4e;}['getSelectionText'](){const {model:_0x5e6301}=$s(this['context']),_0x53f720=_0x5e6301['document']['selection'],_0x2215d1=[],_0x190432=Array['from'](_0x53f720['getRanges']());_0x190432['sort']((_0xe8269d,_0x419713)=>_0xe8269d['start']['isBefore'](_0x419713['start'])?-0x1:0x1);for(const _0x3ce1af of _0x190432)for(const _0xc24c9a of _0x3ce1af['getItems']())_0xc24c9a['is']('$textProxy')?_0x2215d1['push'](_0xc24c9a['data']):_0xc24c9a['is']('element')&&_0x2215d1['length']>0x0&&'\x20'!==_0x2215d1[_0x2215d1['length']-0x1]&&_0x2215d1['push']('\x20');return _0x2215d1['length']?'\x22'+_0x2215d1['join']('')['trim']()+'\x22':hs(this['context']['locale'],'AI_CHAT_CONTEXT_DOCUMENT_SELECTION_LABEL');}['_removeFakeSelectionById'](_0x246076){for(let _0x1c813c=0x0;_0x1c813c<this['_fakeSelections']['length'];_0x1c813c++)if(this['_fakeSelections'][_0x1c813c]['id']==_0x246076)return void this['_fakeSelections']['splice'](_0x1c813c,0x1);}['_addFakeSelection'](_0x3184e0){this['_removeFakeSelectionById'](_0x3184e0['id']),wt(this['_fakeSelections'],_0x3184e0);}['_refreshFakeSelection'](_0x32c491,_0x538edc){if(_0x32c491==_0x538edc)return;const _0x175ec7=_0x32c491?this['_getEditorForFakeSelection'](_0x32c491):null,_0xf3d240=_0x538edc?this['_getEditorForFakeSelection'](_0x538edc):null,_0x117cda=(_0x35d2e9,_0x117a64)=>{const _0x59ef85=_0x117a64['model']['markers']['getMarkersGroup'](zs);for(const _0x67155d of _0x59ef85)_0x35d2e9['removeMarker'](_0x67155d);},_0x20c03f=(_0x548280,_0xc89c3e,_0x3a0087)=>{const _0x4d2ccd=_0xc89c3e['model'];for(let _0x2c1de5=0x0;_0x2c1de5<_0x3a0087['ranges']['length'];_0x2c1de5++){let _0x23cdea=_0x3a0087['ranges'][_0x2c1de5];const _0x2ce1fe=zs+':'+_0x3a0087['id']+':'+_0x2c1de5;if(_0x23cdea['start']['isAtEnd']){const _0x244ff1=_0x23cdea['start']['getLastMatchingPosition'](({item:_0x4ca053})=>!_0x4d2ccd['schema']['isContent'](_0x4ca053),{'boundaries':_0x23cdea});_0x23cdea=_0x548280['createRange'](_0x244ff1,_0x23cdea['end']);}_0x548280['addMarker'](_0x2ce1fe,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x23cdea});}};_0x175ec7&&_0xf3d240&&_0x175ec7===_0xf3d240&&_0x538edc?_0x175ec7['model']['change'](_0x2b7b70=>{_0x117cda(_0x2b7b70,_0x175ec7),_0x20c03f(_0x2b7b70,_0xf3d240,_0x538edc);}):(_0x175ec7&&_0x175ec7['model']['change'](_0x1d0fc3=>_0x117cda(_0x1d0fc3,_0x175ec7)),_0xf3d240&&_0x538edc&&_0xf3d240['model']['change'](_0xf593f7=>_0x20c03f(_0xf593f7,_0xf3d240,_0x538edc)));}['_getEditorForFakeSelection'](_0x4ede10){if(!_0x4ede10['ranges']['length'])return $s(this['context']);const _0x36a185=_0x4ede10['ranges'][0x0]['root']['document'];return Ws(this['context'])['find'](_0x59d10b=>_0x59d10b['model']['document']===_0x36a185)??$s(this['context']);}['_getMarkersInDocumentOrder'](_0x4a56eb,_0x36cb19){const _0x2b6265=Array['from'](_0x4a56eb['model']['markers']['getMarkersGroup'](zs+':context'));return(_0x36cb19?_0x2b6265['filter'](_0x553e1d=>{const _0x49a4ab=_0x553e1d['getRange']();return _0x49a4ab&&_0x49a4ab['root']['rootName']===_0x36cb19['rootName'];}):_0x2b6265)['sort']((_0x3bef62,_0x1c9c4c)=>_0x3bef62['getStart']()['isBefore'](_0x1c9c4c['getStart']())?-0x1:_0x3bef62['getStart']()['isAfter'](_0x1c9c4c['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(_0x476c27){const _0x206efd=new AbortController();return{'promise':new Promise((_0x34c732,_0x3324e4)=>{const _0x147047=setTimeout(_0x34c732,_0x476c27);_0x206efd['signal']['addEventListener']('abort',()=>{clearTimeout(_0x147047),_0x3324e4();});}),'abortController':_0x206efd};}class sn{['options'];['isStreaming']=!0x1;['document']=null;['nodesList']=[];['currentIndex']=0x0;['timeoutAbortController']=null;['lastUpdateTime']=0x0;constructor(_0x5b8528){this['options']={'delay':_0x5b8528?.['delay']??0xa,'textNodeStyle':_0x5b8528?.['textNodeStyle']??'animation:\x20ck-html-streamer-fade-in\x20.3s'};}async['stream']({document:_0x1dfc30,targetElement:_0x523087,abortSignal:_0x272e32}){this['isStreaming']&&this['stop'](),_0x272e32?.['addEventListener']('abort',this['stop']['bind'](this)),this['document']=_0x51d407(_0x1dfc30,!0x0),this['nodesList']=this['getParsedDocumentNodeList'](),this['isStreaming']=!0x0,this['currentIndex']>this['nodesList']['length']&&(this['currentIndex']=this['nodesList']['length']);for(let _0x401051=0x0;_0x401051<this['currentIndex'];_0x401051++)this['nodesList'][_0x401051]['shouldBeStreamed']=!0x0;do{const _0x5e7995=Date['now'](),_0x37ebce=this['nodesList'][this['currentIndex']],_0x2ad9a5=_0x5e7995-this['lastUpdateTime'];if(_0x37ebce){_0x37ebce['shouldBeStreamed']=!0x0;let _0x153caf=_0x37ebce['parent'];for(;_0x153caf;)_0x153caf['shouldBeStreamed']=!0x0,_0x153caf=_0x153caf['parent'];}if(_0x2ad9a5<this['options']['delay'])try{const {promise:_0x503fc6,abortController:_0xb58461}=en(this['options']['delay']-_0x2ad9a5);this['timeoutAbortController']=_0xb58461,await _0x503fc6;}catch(_0x39ab65){return;}_0x2863b3(_0x523087,'<'+_0x523087['tagName']+'>'+this['renderNode'](this['document'])+'</'+_0x523087['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:_0x420ee0}){Array['from'](_0x420ee0['querySelectorAll']('span[data-ck-html-streamer-word-chunk]'))['reverse']()['forEach'](_0x554b5a=>{_0x554b5a['replaceWith'](_0x554b5a['childNodes'][0x0]);});}['stop'](){this['isStreaming']=!0x1,this['timeoutAbortController']&&(this['timeoutAbortController']['abort'](),this['timeoutAbortController']=null);}['renderNode'](_0x36a123){let _0x9ebee4='';if(function(_0x14ceff){return _0xcde254(_0x14ceff);}(_0x36a123)){for(const _0x3c2733 of _0x36a123['children'])_0x9ebee4+=this['renderNode'](_0x3c2733);}else{if(on(_0x36a123)){if(!_0x36a123['shouldBeStreamed'])return'';const _0x1eff41=_0x36a123,_0x172b97=Object['entries'](_0x1eff41['attribs'])['map'](([_0x1265bb,_0x2addad])=>_0x1265bb+'=\x22'+_0x2addad+'\x22')['join']('\x20');_0x9ebee4+='<'+_0x1eff41['tagName']+(_0x172b97?'\x20'+_0x172b97:'')+'>';for(const _0xb64ced of _0x5e79c1(_0x1eff41))_0x9ebee4+=this['renderNode'](_0xb64ced);_0x9ebee4+='</'+_0x1eff41['tagName']+'>';}else{if(!rn(_0x36a123))return'';if(!_0x36a123['shouldBeStreamed'])return'';!function(_0x5e102c){if(!_0x5e102c['parent']||!on(_0x5e102c['parent']))return!0x1;if(!nn['includes'](_0x5e102c['parent']['tagName']))return!0x1;return!_0x509c99(_0x5e102c)['match'](/^\s*[<>]\s*$/);}(_0x36a123)?_0x9ebee4+=ti(_0x36a123):_0x9ebee4+=ti(new _0x2b2f52('span',{'data-ck-html-streamer-word-chunk':'','style':this['options']['textNodeStyle']},[_0x36a123]));}}return _0x9ebee4;}['getParsedDocumentNodeList'](){const _0x55569e=[];return function(_0x458745,_0x2fc1ae){const _0x31e114=_0x121654=>{if(_0x2fc1ae(_0x121654),_0x121654 instanceof _0x50edd4)for(let _0x321dfe=0x0;_0x321dfe<_0x121654['children']['length'];_0x321dfe++){const _0x52352a=_0x121654['children'][_0x321dfe];_0x31e114(_0x52352a);}};for(let _0x160050=0x0;_0x160050<_0x458745['children']['length'];_0x160050++)_0x31e114(_0x458745['children'][_0x160050]);}(this['document'],_0x1de6f0=>{if(rn(_0x1de6f0)){const _0x15a7ae=this['splitTextNodeIntoWordNodes'](_0x1de6f0);_0x15a7ae['length']&&_0x55569e['push'](..._0x15a7ae);}_0x1de6f0['isWordSplitSource']||_0x1de6f0['isWordSplitResult']||_0x55569e['push'](_0x1de6f0);}),_0x55569e;}['splitTextNodeIntoWordNodes'](_0xa7383b){if(_0xa7383b['isWordSplitSource']||_0xa7383b['isWordSplitResult'])return[];const _0x4dda1d=_0x509c99(_0xa7383b)['match'](/(?:\s*\S+\s*)/g),_0xd9075d=[];if(_0x4dda1d&&_0x4dda1d['length']>0x1){for(const _0x3a4710 of _0x4dda1d){const _0x57caef=new _0x3f4e70(_0x3a4710);_0x57caef['isWordSplitResult']=!0x0,_0x484771(_0xa7383b,_0x57caef),_0xd9075d['push'](_0x57caef);}_0xa7383b['isWordSplitSource']=!0x0,_0x4529c2(_0xa7383b);}return _0xd9075d;}}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(_0x3a08d7){return _0xbfd574(_0x3a08d7);}function on(_0x499b6a){return _0x60f0d2(_0x499b6a);}class an extends vt{['options'];['content']='';['htmlStreamer'];['children'];constructor(_0x28acbc){super();const _0x323ea0=this['bindTemplate'];this['set']('isDone',!0x1),this['set']('isVisible',!0x0),this['htmlStreamer']=new sn(),this['options']=_0x28acbc,this['children']=this['createCollection'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed__item',_0x323ea0['if']('isDone','ck-ai-chat__feed__item_done'),_0x323ea0['if']('isVisible','ck-hidden',_0x3bdbf8=>!_0x3bdbf8),'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'](_0x2e498e=>{_0x2e498e['removeAttribute']('data-id');}),this['isDone']=!0x0;}async['streamIntoElement'](_0x321e6b,_0xf8bcc7,_0x22efc5){await this['htmlStreamer']['stream']({'document':_0x321e6b,'targetElement':_0xf8bcc7,'abortSignal':_0x22efc5});}}class hn extends vt{['showChangesToggleView'];constructor(_0x38e181,_0x411e50){super(_0x38e181),this['set']('isShowChangesToggleVisible',!0x0),this['showChangesToggleView']=new cn(_0x38e181),this['showChangesToggleView']['set']({'class':'ck-ai-suggestion__header__show-changes-toggle\x20ck-ai-chat-controls-button\x20'+us,'label':hs(_0x38e181,'AI_SUGGESTION_BUTTON_SHOW_CHANGES'),'withText':!0x0}),this['showChangesToggleView']['isOn']=_0x411e50['showDiff'],this['showChangesToggleView']['bind']('isVisible')['to'](this,'isShowChangesToggleVisible'),this['showChangesToggleView']['bind']('icon')['to'](this['showChangesToggleView'],'isOn',_0x39010f=>_0x39010f?_0x3d65c1:_0x22e99c),this['showChangesToggleView']['on']('execute',()=>{this['showChangesToggleView']['isOn']=!this['showChangesToggleView']['isOn'],this['fire']('toggleShowChanges',{'isOn':this['showChangesToggleView']['isOn']});});const _0x500c50=new xt();_0x500c50['content']=_0x2c2579,this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__header',!0x1===_0x411e50['showHeader']?'ck-hidden':null]['filter'](Boolean)},'children':[_0x500c50,{'tag':'span','children':[hs(_0x38e181,'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':_0x4a57f7,'rejected':_0x1c646a,'outdated':_0x1c646a};class un extends vt{['stateIconView'];constructor(_0x32d191){super(_0x32d191);const _0x3f09b4=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',_0x3f09b4['to']('state',_0x1d5321=>'ck-ai-suggestion__content-part-state_'+_0x1d5321),_0x3f09b4['if']('isVisible','ck-hidden',_0x42f478=>!_0x42f478)]},'children':[{'tag':'span','attributes':{'class':['ck-ai-suggestion__content-part-state__label']},'children':[{'text':_0x3f09b4['to']('state',_0x363a8a=>{switch(_0x363a8a){case'accepted':return hs(_0x32d191,'AI_SUGGESTION_CONTENT_PART_STATE_ACCEPTED');case'rejected':return hs(_0x32d191,'AI_SUGGESTION_CONTENT_PART_STATE_REJECTED');case'outdated':return hs(_0x32d191,'AI_SUGGESTION_CONTENT_PART_STATE_OUTDATED');}})}]},this['stateIconView']]});}['setState'](_0x3f95bb){this['state']=_0x3f95bb;}}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(_0x1e2663,_0x2d9ad7,_0x40ebf4){super(_0x1e2663);const _0x28a546=Boolean(_0x40ebf4);this['set']('isEnabled',!_0x28a546),this['set']('isVisible',!0x0),this['class']='ck-ai-suggestion-content-part-toolbar';const _0x10349b=[];if(_0x28a546){const _0x4c836f=new Nt(_0x1e2663);_0x4c836f['set']({'label':hs(_0x1e2663,'AI_SUGGESTION_DISABLED_TOOLTIP_MESSAGE'),'tooltip':!0x0,'withText':!0x1,'icon':_0x5800b6}),_0x4c836f['extendTemplate']({'attributes':{'data-cke-tooltip-class':'ck-ai-suggestion-content-part-disabled-actions-tooltip'}}),_0x10349b['push'](_0x4c836f);}else{_0x2d9ad7['includes']('applySuggestion')&&(this['_applyButton']=new Nt(_0x1e2663),this['_applyButton']['set']({'label':hs(_0x1e2663,'AI_SUGGESTION_CONTENT_PART_APPLY'),'tooltip':!0x0,'tooltipPosition':'n','withText':!0x1,'icon':_0x4a57f7}),this['_applyButton']['bind']('isEnabled')['to'](this),this['_applyButton']['on']('execute',()=>{this['fire']('applySuggestion');}),_0x10349b['push'](this['_applyButton'])),_0x2d9ad7['includes']('insertSuggestion')&&(this['_suggestButton']=new Nt(_0x1e2663),this['_suggestButton']['set']({'label':hs(_0x1e2663,'AI_SUGGESTION_CONTENT_PART_ADD_SUGGESTION'),'tooltip':!0x0,'tooltipPosition':'n','withText':!0x1,'icon':_0x5eaee5}),this['_suggestButton']['bind']('isEnabled')['to'](this),this['_suggestButton']['on']('execute',()=>{this['fire']('insertSuggestion');}),_0x10349b['push'](this['_suggestButton']));const _0x534fb9=new Nt(_0x1e2663);_0x534fb9['set']({'label':hs(_0x1e2663,'AI_SUGGESTION_CONTENT_PART_REJECT'),'tooltip':!0x0,'tooltipPosition':'n','withText':!0x1,'icon':_0x1c646a}),_0x534fb9['bind']('isEnabled')['to'](this),_0x534fb9['on']('execute',()=>{this['fire']('rejectSuggestion');}),_0x10349b['push'](_0x534fb9);}this['items']['addMany'](_0x10349b);const _0x239d81=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':[_0x239d81['if']('isVisible','ck-hidden',_0x11b4f2=>!_0x11b4f2)]}});}['setButtonsVisibility']({showApplyButton:_0x43da64,showSuggestButton:_0x24fc5}){this['_applyButton']&&(this['_applyButton']['isVisible']=_0x43da64),this['_suggestButton']&&(this['_suggestButton']['isVisible']=_0x24fc5);}}class gn extends vt{['toolbarView'];['stateView'];['titleLabelView'];['children'];constructor(_0x41baed,{part:_0x4df625,uiIndex:_0x4f2632,availableActions:_0x2c0199,areActionsDisabled:_0x134f04}){super(_0x41baed),this['set']('isEnabled',!0x0),this['set']('state','pending'),this['toolbarView']=new _n(_0x41baed,_0x2c0199,_0x134f04),this['toolbarView']['on']('rejectSuggestion',()=>{this['fire']('rejectSuggestion',{'index':_0x4df625['index']});}),this['toolbarView']['on']('insertSuggestion',()=>{this['fire']('insertSuggestion',{'index':_0x4df625['index']});}),this['toolbarView']['on']('applySuggestion',()=>{this['fire']('applySuggestion',{'index':_0x4df625['index']});}),this['toolbarView']['bind']('isEnabled')['to'](this),this['stateView']=new un(_0x41baed),this['titleLabelView']=new An(_0x41baed,_0x4f2632),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',(_0x5ba549,_0x1824a9,_0x5ddbe0,_0x1dc41f)=>{'pending'===_0x1dc41f?this['children']['remove'](this['toolbarView']):this['children']['remove'](this['stateView']),'pending'===_0x5ddbe0?this['children']['add'](this['toolbarView']):(this['stateView']['setState'](_0x5ddbe0),this['children']['add'](this['stateView']));});}}class An extends vt{constructor(_0x45fbc0,_0x29e651){super(_0x45fbc0),this['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai-suggestion__body__content-part__title__label']},'children':[hs(_0x45fbc0,'AI_SUGGESTION_CONTENT_PART_TITLE',_0x29e651['toString']())]});}}class In extends vt{['htmlStreamer'];constructor(_0x4e755d){super(_0x4e755d),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:_0x42861a,renderingStrategy:_0xc9e261,abortSignal:_0x58ed65}){'streaming'===_0xc9e261?await this['htmlStreamer']['stream']({'document':_0x42861a['content'],'targetElement':this['element'],'abortSignal':_0x58ed65}):_0x2863b3(this['element'],'<'+this['element']['tagName']+'>'+gs(_0x42861a['content'])+'</'+this['element']['tagName']+'>',{'childrenOnly':!0x0});}['clear'](){this['htmlStreamer']['reset'](),this['element']['innerHTML']='';}}class En extends vt{['_children'];['_headerView'];['_streamableContentView'];constructor(_0x4ffd5b,{part:_0x4878bf,uiIndex:_0x5c2962,areActionsDisabled:_0x3a4d7b,availableActions:_0x47a0ea}){super(_0x4ffd5b);const _0x105bd5=this['bindTemplate'];this['set']('state','pending'),this['set']('isDone',!0x1),this['set']('isVisible',!0x1),this['set']('isActive',!0x1),this['set']('isEnabled',!0x1);const _0x1a94d0=()=>{this['isEnabled']=this['isDone']&&'pending'==this['state']&&!_0x3a4d7b;};this['on']('change:state',_0x1a94d0),this['on']('change:isDone',_0x1a94d0),_0x1a94d0(),this['_children']=this['createCollection'](),this['_headerView']=new gn(_0x4ffd5b,{'part':_0x4878bf,'uiIndex':_0x5c2962,'availableActions':_0x47a0ea,'areActionsDisabled':_0x3a4d7b}),this['_headerView']['bind']('isEnabled','state')['to'](this),this['_headerView']['delegate'](...Zs)['to'](this),this['_streamableContentView']=new In(_0x4ffd5b),this['_children']['addMany']([this['_headerView'],this['_streamableContentView']]),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__body__content-part',_0x105bd5['to']('state',_0x5f007e=>'ck-ai-suggestion__body__content-part_'+_0x5f007e),_0x105bd5['if']('isEnabled','ck-ai-suggestion__body__content-part_enabled'),_0x105bd5['if']('isActive','ck-ai-suggestion__body__content-part_active'),_0x105bd5['if']('isVisible','ck-hidden',_0x4ffe6d=>!_0x4ffe6d)]},'children':this['_children'],'on':{'mouseenter':_0x105bd5['to'](()=>{this['isEnabled']&&this['fire']('mouseOverSuggestion',{'index':_0x4878bf['index']});}),'mouseleave':_0x105bd5['to'](()=>{this['isEnabled']&&this['fire']('mouseLeaveSuggestion',{'index':_0x4878bf['index']});}),'click':_0x105bd5['to'](_0x27b14e=>{const _0x36a6bf=_0x27b14e['target'];this['isEnabled']&&!this['_headerView']['toolbarView']['element']['contains'](_0x36a6bf)&&this['fire']('showChangeInText',{'index':_0x4878bf['index']});})}});}async['updateContent']({part:_0x5b896c,showUnchangedParts:_0x113323=!0x1,abortSignal:_0x375307}){this['partDefinition']=_0x5b896c,this['isVisible']=this['partDefinition']['hasChanges']||_0x113323,this['isVisible']&&await this['_streamableContentView']['update']({'part':_0x5b896c,'renderingStrategy':'static','abortSignal':_0x375307});}['markAsDone'](){this['isDone']=!0x0;}}class pn extends vt{constructor(_0xe92e04,_0x49e000){super(_0xe92e04),this['set']('isVisible',!0x0),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-skeleton',this['bindTemplate']['if']('isVisible','ck-hidden',_0x50b196=>!_0x50b196)]},'children':this['_createSkeletonItems'](_0x49e000)});}['_createSkeletonItems'](_0x48e29a){const _0x21733a=['ck','ck-ai-skeleton__item'];return _0x48e29a['map'](_0x51bbe4=>{let _0x5bdc3f='';switch(_0x51bbe4['attributes']['align']){case'right':_0x5bdc3f='margin-left:\x20auto;\x20margin-right:\x200;\x20text-align:\x20right;';break;case'center':_0x5bdc3f='margin-left:\x20auto;\x20margin-right:\x20auto;\x20text-align:\x20center;';break;case'left':_0x5bdc3f='margin-left:\x200;\x20margin-right:\x20auto;\x20text-align:\x20left;';}return{'tag':_0x51bbe4['tag'],'attributes':{'class':[..._0x21733a,_0x51bbe4['attributes']['class']?_0x51bbe4['attributes']['class']:''],'style':'width:\x20'+_0x51bbe4['attributes']['width']+';\x20height:\x20'+_0x51bbe4['attributes']['height']+';'+_0x5bdc3f}};});}}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(_0x1ccae1,_0x46b159,_0x4e9113,_0x2f135e){return new Array(_0x1ccae1)['fill'](null)['map'](()=>({'tag':'div','attributes':{'width':_0x46b159,'height':_0x4e9113,'align':_0x2f135e}}));}class Cn extends Tt(){['queue']=[];['isProcessing']=!0x1;['_abortController'];async['enqueue'](_0x4e5ee8){const _0x3aba77=this['createTask'](_0x4e5ee8);return this['queue']['push'](_0x3aba77),this['_processQueue'](),_0x3aba77['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(_0x8cb558=>{this['once']('_queueEmpty',()=>{_0x8cb558();});}):Promise['resolve']();}async['_processQueue'](){if(!this['isProcessing']){this['_abortController']=new AbortController(),this['isProcessing']=!0x0;try{for(;this['queue']['length']&&this['isProcessing'];){const _0x244214=this['queue']['shift']();try{await _0x244214['callback'](this['_abortController']['signal']),_0x244214['resolve']();}catch(_0x4cb619){_0x244214['reject'](_0x4cb619);}}}finally{this['isProcessing']=!0x1,this['_abortController']=void 0x0;}this['fire']('_queueEmpty');}}['createTask'](_0x483bb6){let _0x382ead,_0xe2ffcc;const _0x40c8c8=new Promise((_0x503e20,_0x11575d)=>{_0x382ead=_0x503e20,_0xe2ffcc=_0x11575d;});return{'callback':_0x483bb6,'resolve':_0x382ead,'reject':_0xe2ffcc,'completePromise':_0x40c8c8};}}class wn extends an{constructor(_0x190cf4){super(_0x190cf4),this['extendTemplate']({'attributes':{'class':['ck-ai-notification','warning'===_0x190cf4['level']?'ck-ai-notification_warning':'ck-ai-notification_error']}});}['render'](){super['render'](),this['setContent'](this['options']['initialContent']),this['markAsDone']();}['setContent'](_0x4b3421){this['element']['innerHTML']=_0x4b3421;}}const fn=['applySuggestion','insertSuggestion'];class bn extends vt{['_applyChangesButton'];['_insertSuggestionsButton'];['children'];constructor(_0x1413c0,_0x218304=[...fn],_0x5e0c52){super(_0x1413c0);const _0x45c1b7=this['bindTemplate'],_0x5258d1=Boolean(_0x5e0c52);if(this['set']('isEnabled',!_0x5258d1),this['set']('isVisible',!0x1),this['set']('isTrackChangesOn',!0x1),this['children']=this['createCollection'](),_0x5258d1){const _0x5284c2=new Nt(_0x1413c0);_0x5284c2['set']({'label':hs(_0x1413c0,'AI_SUGGESTION_DISABLED_TOOLTIP_MESSAGE'),'tooltip':!0x0,'withText':!0x1,'icon':_0x5800b6}),_0x5284c2['extendTemplate']({'attributes':{'data-cke-tooltip-class':'ck-ai-suggestion-content-part-disabled-actions-tooltip'}});const _0xd7569b=new vt(_0x1413c0);_0xd7569b['setTemplate']({'tag':'div','attributes':{'class':'ck-ai-chat__feed__suggestion__actions__info'},'children':[{'tag':'p','children':[hs(_0x1413c0,'AI_SUGGESTION_DISABLED_FEED_MESSAGE'),_0x5284c2]}]}),this['children']['add'](_0xd7569b);}else this['_applyChangesButton']=new Nt(_0x1413c0),this['_applyChangesButton']['set']({'label':hs(_0x1413c0,'AI_CHAT_SUGGESTION_ACTION_APPLY_ALL'),'withText':!0x0,'type':'button','isVisible':_0x218304['includes']('applySuggestion'),'class':cs}),this['_insertSuggestionsButton']=new Nt(_0x1413c0),this['_insertSuggestionsButton']['set']({'label':hs(_0x1413c0,'AI_CHAT_SUGGESTION_ACTION_SUGGEST_ALL'),'withText':!0x0,'type':'button','isVisible':_0x218304['includes']('insertSuggestion'),'class':ls}),this['_insertSuggestionsButton']['on']('execute',()=>{this['fire']('insertSuggestion');}),this['_applyChangesButton']['on']('execute',()=>{this['fire']('applySuggestion');}),[this['_applyChangesButton'],this['_insertSuggestionsButton']]['forEach'](_0x407e5e=>{_0x407e5e['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',_0x45c1b7['if']('isVisible','ck-hidden',_0xf7db85=>!_0xf7db85)]},'children':this['children']}),this['on']('change:isTrackChangesOn',()=>{this['_applyChangesButton']&&(this['_applyChangesButton']['isVisible']=!this['isTrackChangesOn']);});}['updateVisibility'](_0x326394){this['isVisible']=_0x326394;}['_switchButtonLabelsPlurality'](_0xa13df6){this['_applyChangesButton']&&this['_insertSuggestionsButton']&&(_0xa13df6?(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(_0x581d87,_0x313129){super(_0x581d87),this['bodyCollection']=_0x313129,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',_0x206715=>!_0x206715)]},'children':this['children']});const _0x3a2ada=new vt(this['locale']),_0x15182f=new xt();_0x15182f['content']=_0x2cc2cd,_0x3a2ada['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-web-sources__header']},'children':[_0x15182f,{'tag':'span','children':[{'text':hs(this['locale'],'AI_CHAT_SOURCES_HEADER')}]}]}),this['children']['add'](_0x3a2ada),this['_setupBalloonPanel'](_0x581d87);}['addSource'](_0x23328e){this['children']['add'](new Rn(this['locale'],_0x23328e,this['balloonPanelView']));}['_setupBalloonPanel'](_0x4ac45b){this['balloonPanelView']=new Xt(_0x4ac45b),this['balloonPanelView']['extendTemplate']({'attributes':{'class':['ck-ai-web-source__tooltip-balloon']}}),this['bodyCollection']['add'](this['balloonPanelView']);}}class Rn extends Nt{['balloonPanelView'];['source'];constructor(_0x588879,_0x3077e9,_0x46aaf9){super(_0x588879),this['source']=_0x3077e9,this['balloonPanelView']=_0x46aaf9,this['set']({'label':_0x3077e9['title'],'class':['ck\x20ck-ai-web-source'],'withText':!0x0});const _0x2e63c8=this['bindTemplate'];if(this['extendTemplate']({'on':{'click':_0x2e63c8['to'](()=>{window['open'](_0x3077e9['url'],'_blank');}),'mouseenter':_0x2e63c8['to'](()=>{this['_showTooltip']();}),'mouseleave':_0x2e63c8['to'](()=>{this['_hideTooltip']();})}}),_0x3077e9['favicon']){const _0x5b04ee=new vt(_0x588879);_0x5b04ee['setTemplate']({'tag':'img','attributes':{'src':_0x3077e9['favicon']||_0x2cc2cd,'alt':_0x3077e9['title'],'class':['ck-ai-web-source__image']}}),this['children']['add'](_0x5b04ee);}else this['set']('icon',_0x2cc2cd);}['_createTooltipContentView'](_0x2c9293,_0x255a08){const _0x35ebdf=new vt(_0x2c9293),_0x313dec=[];let _0x2a2cd5;_0x255a08?.['favicon']?(_0x2a2cd5=new vt(_0x2c9293),_0x2a2cd5['setTemplate']({'tag':'img','attributes':{'src':_0x255a08['favicon'],'alt':_0x255a08['title'],'class':['ck-ai-web-source__tooltip-image']}})):(_0x2a2cd5=new xt(),_0x2a2cd5['content']=_0x2cc2cd,_0x2a2cd5['extendTemplate']({'attributes':{'alt':_0x255a08['title'],'class':['ck-ai-web-source__tooltip-image']}})),_0x313dec['push'](_0x2a2cd5);const _0x8da214=new vt(_0x2c9293);_0x8da214['setTemplate']({'tag':'a','attributes':{'class':['ck-ai-web-source__tooltip-url'],'href':_0x255a08['url']},'children':[{'text':new URL(_0x255a08['url'])?.['hostname']}]}),_0x313dec['push'](_0x8da214);const _0x1f3ca8=new vt(_0x2c9293);_0x1f3ca8['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-web-source__tooltip-row']},'children':_0x313dec});const _0x203eb6=new vt(_0x2c9293);return _0x203eb6['setTemplate']({'tag':'span','attributes':{'class':['ck-ai-web-source__tooltip-row','ck-ai-web-source__tooltip-title']},'children':[{'text':_0x255a08['title']['length']>0x190?_0x255a08['title']['substring'](0x0,0x190)+'...':_0x255a08['title']}]}),_0x35ebdf['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-web-source__tooltip']},'children':[_0x1f3ca8,_0x203eb6]}),_0x35ebdf;}['_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 _0x4339d3=this['_createTooltipContentView'](this['locale'],this['source']);this['balloonPanelView']['content']['add'](_0x4339d3);}}class On extends vt{['_actionsView'];['_sourcesView'];['_children'];['_skeletonView'];['_showSkeletonDebounced']=_0x18ec0f(()=>{this['_skeletonView']['isVisible']=!0x0,this['_skeletonShownAt']=Date['now']();},0x3e8);['_skeletonShownAt']=null;['_areActionsDisabled'];['_showUnchangedParts'];['_updateContentPartsPromiseQueue'];['_emptyPartsWarningView'];['_availableActions'];['_cachedContentParts']=[];constructor(_0x32a958,_0x39a10d){super(_0x32a958);const {areActionsDisabled:_0x488bba,showUnchangedParts:_0x2b7c4f,availableActions:_0xe138e1}=_0x39a10d;this['_areActionsDisabled']=_0x488bba,this['_showUnchangedParts']=_0x2b7c4f,this['_availableActions']=_0xe138e1,this['set']('hasPendingParts',!0x1),this['set']('isTrackChangesOn',!0x1),this['_children']=this['createCollection'](),this['_skeletonView']=new pn(_0x32a958,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(_0x32a958,'AI_SUGGESTION_EMPTY_PART_WARNING'),'level':'warning'}),this['_emptyPartsWarningView']['isVisible']=!0x1,this['_actionsView']=new bn(_0x32a958,_0x39a10d['availableActions'],this['_areActionsDisabled']),this['_actionsView']['bind']('isTrackChangesOn')['to'](this),this['_sourcesView']=new Sn(this['locale'],_0x39a10d['bodyCollection']),_0x39a10d['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'](_0x4c5993=>_0x4c5993 instanceof En);}async['updateContentParts']({parts:_0x3d4e45,abortSignal:_0x9fdefb,skipLoadingEffects:_0x25e41a}){this['_cachedContentParts']['length']?_0x3d4e45['forEach'](_0x3fa7e0=>{const _0x205cd5=this['_cachedContentParts']['findIndex'](_0x26441a=>_0x26441a['index']==_0x3fa7e0['index']);-0x1===_0x205cd5?this['_cachedContentParts']['push'](_0x3fa7e0):this['_cachedContentParts'][_0x205cd5]=_0x3fa7e0;}):this['_cachedContentParts']=_0x3d4e45;const _0x35dc28=this['_showUnchangedParts']?_0x3d4e45:_0x3d4e45['filter'](_0x1ace76=>_0x1ace76['hasChanges']);this['_actionsView']['_switchButtonLabelsPlurality'](_0x35dc28['length']>0x1),_0x25e41a&&(this['_showSkeletonDebounced']['cancel'](),this['_skeletonView']['isVisible']=!0x1);for(const _0x2d90d3 of _0x35dc28)this['_updateContentPartsPromiseQueue']['enqueue'](async _0x4ca272=>{let _0x5edcb6=this['getPartView'](_0x2d90d3['index']);if(!_0x5edcb6){if(_0x5edcb6=new En(this['locale'],{'part':_0x2d90d3,'uiIndex':this['_contentPartViews']['length']+0x1,'areActionsDisabled':this['_areActionsDisabled'],'availableActions':this['_availableActions']}),_0x5edcb6['delegate'](...Zs)['to'](this),!_0x25e41a&&(this['_showSkeletonDebounced']['cancel'](),await this['_awaitMinimumSkeletonDisplayTime'](_0x4ca272),_0x4ca272['aborted']))return;this['_skeletonView']['isVisible']=!0x1,this['_children']['add'](_0x5edcb6,this['_children']['length']-0x1),this['hasPendingParts']=!0x0,_0x25e41a||this['_showSkeletonDebounced']();}await _0x5edcb6['updateContent']({'part':_0x2d90d3,'showUnchangedParts':this['_showUnchangedParts'],'abortSignal':_0x4ca272}),_0x5edcb6['markAsDone']();});return _0x9fdefb?.['addEventListener']('abort',()=>{this['_updateContentPartsPromiseQueue']['abort'](),this['_showSkeletonDebounced']['cancel'](),this['_skeletonView']['isVisible']=!0x1;}),this['_updateContentPartsPromiseQueue']['queueEmptyPromise'];}['updatePartState'](_0x17c6cc,_0x4cc7d1){const _0x49dbf5=this['getPartView'](_0x17c6cc);_0x49dbf5&&(_0x49dbf5['state']=_0x4cc7d1),this['hasPendingParts']='pending'==_0x4cc7d1||this['_contentPartViews']['some'](_0x54d5e7=>'pending'==_0x54d5e7['state']);}['setPartActive'](_0x4abc40,_0x328e08){if(!0x1===_0x4abc40){for(const _0x3c489e of this['_contentPartViews'])_0x3c489e['isActive']=!0x1;}else{const _0xe62f6c=this['getPartView'](_0x4abc40);_0xe62f6c&&(_0xe62f6c['isActive']=_0x328e08);}}['updateSources'](_0x352812){_0x352812['forEach'](_0x59ae4b=>this['_sourcesView']['addSource'](_0x59ae4b)),this['_sourcesView']['isVisible']=!0x0;}['getPartView'](_0x718b48){return this['_contentPartViews']['find'](_0x30f4db=>_0x30f4db['partDefinition']['index']==_0x718b48)??null;}['markAsDone'](){if(!this['_showUnchangedParts']){const _0x42b310=!this['_cachedContentParts']['find'](({hasChanges:_0x221449})=>_0x221449),_0x2807d2=!!this['_cachedContentParts']['find'](({hasChanges:_0x190586})=>!_0x190586);this['_emptyPartsWarningView']['isVisible']=0x0==this['_contentPartViews']['length']||_0x2807d2,_0x42b310?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'](_0x20acca=>_0x20acca['markAsDone']()),this['_skeletonView']['isVisible']=!0x1,this['_showSkeletonDebounced']['cancel'](),this['_actionsView']['updateVisibility'](this['hasNonEmptyParts']);}async['_awaitMinimumSkeletonDisplayTime'](_0x2ace5b){if(!this['_skeletonView']['isVisible']||null===this['_skeletonShownAt'])return;const _0x580ce8=0x3e8-(Date['now']()-this['_skeletonShownAt']);if(this['_skeletonShownAt']=null,_0x580ce8>0x0){const {promise:_0xb6db3,abortController:_0x9b0146}=en(_0x580ce8);_0x2ace5b?.['addEventListener']('abort',()=>_0x9b0146['abort']()),await _0xb6db3['catch'](()=>{});}}get['hasNonEmptyParts'](){return this['_contentPartViews']['filter'](_0x449b93=>_0x449b93['partDefinition']['hasChanges'])['length']>0x0;}}class kn extends vt{['bodyView'];['children'];['headerView'];constructor(_0x4954ee,_0x190730,_0x146d4d){super(_0x4954ee);const {showDiff:_0x3d3cb9,areActionsDisabled:_0x3116b6,showUnchangedParts:_0x43e136,availableActions:_0xa3f5f4}=_0x190730;this['set']('isTrackChangesOn',!0x1),this['set']('areChangesVisible',!0x1),this['children']=this['createCollection'](),this['headerView']=new hn(_0x4954ee,{'showDiff':_0x3d3cb9}),this['headerView']['on']('toggleShowChanges',(_0x16c1a3,_0x65ab27)=>{this['areChangesVisible']=_0x65ab27['isOn'],this['fire']('toggleSuggestionDisplayMode',{'showDiff':_0x65ab27['isOn']});}),this['children']['add'](this['headerView']),this['bodyView']=new On(_0x4954ee,{'areActionsDisabled':_0x3116b6,'showUnchangedParts':!!_0x43e136,'availableActions':_0xa3f5f4,'bodyCollection':_0x146d4d}),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'](_0x2f3de8){await this['bodyView']['updateContentParts'](_0x2f3de8);}['updateSources'](_0x357129){this['bodyView']['updateSources'](_0x357129);}['markAsDone'](){this['bodyView']['markAsDone'](),this['headerView']&&(this['headerView']['isShowChangesToggleVisible']=this['bodyView']['hasNonEmptyParts']);}}class Nn extends an{['containerView'];constructor(_0x20e828,_0x418a41,_0x46e539){super(_0x418a41),this['set']('isTrackChangesOn',!0x1),this['containerView']=new kn(_0x20e828,{'showDiff':_0x418a41['showDiff'],'areActionsDisabled':_0x418a41['areActionsDisabled'],'availableActions':_0x418a41['availableActions']},_0x46e539),this['containerView']['on']('toggleSuggestionDisplayMode',(_0x2e59ce,_0x57e5c1)=>{this['fire']('toggleSuggestionDisplayMode',{'replyId':this['options']['id'],'showDiff':_0x57e5c1['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',(_0x569e79,{index:_0x1b47d6})=>{this['fire']('showChangeInText',{'replyId':this['options']['id'],'partIndex':_0x1b47d6});}),this['containerView']['on']('applySuggestion',(_0x4254c6,{index:_0x5e4dff}={})=>{this['fire']('applySuggestion',{'replyId':this['options']['id'],'partIndex':_0x5e4dff});}),this['containerView']['on']('insertSuggestion',(_0x477403,{index:_0x48ebc4}={})=>{this['fire']('insertSuggestion',{'replyId':this['options']['id'],'partIndex':_0x48ebc4});}),this['containerView']['on']('rejectSuggestion',(_0x31da7f,{index:_0x258076})=>{this['fire']('rejectSuggestion',{'replyId':this['options']['id'],'partIndex':_0x258076});}),this['containerView']['on']('mouseOverSuggestion',(_0x31650b,{index:_0x5659a3})=>{this['fire']('mouseOverSuggestion',{'replyId':this['options']['id'],'partIndex':_0x5659a3});}),this['containerView']['on']('mouseLeaveSuggestion',(_0x1b92bf,{index:_0x395d11})=>{this['fire']('mouseLeaveSuggestion',{'replyId':this['options']['id'],'partIndex':_0x395d11});}),this['children']['addMany']([this['containerView']]),this['extendTemplate']({'attributes':{'class':['ck-ai-chat__feed__ai-suggestion']}});}async['updateContent'](_0x5efd57){await this['containerView']['updateContent'](_0x5efd57);}['updatePartState'](_0x253a48,_0xae19a){this['containerView']['bodyView']['updatePartState'](_0x253a48,_0xae19a);}['setPartActive'](_0x1ee02f,_0x4152c6){!0x1===_0x1ee02f?this['containerView']['bodyView']['setPartActive'](!0x1):this['containerView']['bodyView']['setPartActive'](_0x1ee02f,_0x4152c6);}['updateSources'](_0x14a639){this['containerView']['updateSources'](_0x14a639);}['getPartView'](_0x410ec6){return this['containerView']['bodyView']['getPartView'](_0x410ec6);}['markAsDone'](){super['markAsDone'](),this['containerView']['markAsDone']();}}class vn extends an{['replyContainer'];['_bodyCollection'];constructor(_0x414deb,_0x99115c,_0x532773){super(_0x99115c),this['_bodyCollection']=_0x532773,this['locale']=_0x414deb,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:_0x39b783,renderingStrategy:_0x3b730c,abortSignal:_0x4ef4a4}){'streaming'===_0x3b730c?await this['streamIntoElement'](_0x39b783,this['replyContainer']['element'],_0x4ef4a4):this['replyContainer']['element']['innerHTML']=ti(_0x39b783);}['updateSources'](_0x127bb1){const _0x535bed=new Sn(this['locale'],this['_bodyCollection']);_0x535bed['children']['addMany'](_0x127bb1['map'](_0x33af58=>new Rn(this['locale'],_0x33af58,_0x535bed['balloonPanelView']))),_0x535bed['isVisible']=!0x0,this['children']['add'](_0x535bed);}}class yn extends yt{constructor(_0x292532=void 0x0){super();const _0x4233a9=_0x292532?'ck-ai-spinner_'+_0x292532:'';this['extendTemplate']({'tag':'span','attributes':{'class':['ck-ai-spinner',_0x4233a9]}});}}const xn={'file':_0x50ae83,'document':_0x2c2579,'web-resource':_0x289d5e,'text':_0x50ae83,'selection':_0x338003,'mcp-tool-context':_0x2c2579},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(_0x4774a4,_0x4bd40d,_0x5159dc,_0x4a4207,_0x1bf971=!0x1){super(_0x4774a4),this['_isAnimationOnEnterEnabled']=_0x4a4207,this['_initializeProperties'](_0x4bd40d,_0x5159dc,_0x1bf971),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'](_0x1c944a,_0x887d21,_0x326557){this['set']('label',_0x1c944a['label']),this['set']('tooltip',!0x0),this['set']('itemType',_0x1c944a['type']),this['set']('id',_0x1c944a['uiId']),this['set']('readonly',_0x887d21),this['set']('isLoading',_0x326557);}['_setupTemplate'](){const _0x1c396c=this['_createIconView'](),_0x58404b=this['_createRemoveButton'](),_0x52acb7=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':this['_createTemplateAttributes'](_0x52acb7),'children':this['_createTemplateChildren'](_0x1c396c,_0x58404b,_0x52acb7)});}['_createTemplateAttributes'](_0x5299c3){return{'class':[Ln,_0x5299c3['if']('itemType',Pn,_0xf63c40=>'document'==_0xf63c40),_0x5299c3['if']('itemType',Dn,_0x1d4310=>'selection'==_0x1d4310)],'data-cke-tooltip-text':_0x5299c3['to']('label',Gn),'data-cke-tooltip-position':Vn,'data-cke-tooltip-class':Un};}['_createTemplateChildren'](_0x1e314b,_0x4b812b,_0x2b4eb7){const _0x1f7f78=this['_createLabelElement'](_0x2b4eb7),_0x1a8435=this['_createLoaderIcon']();return this['readonly']?[_0x1e314b,_0x1f7f78]:[_0x1e314b,_0x1a8435,_0x1f7f78,_0x4b812b];}['_createLabelElement'](_0x5d4d4e){return{'tag':'span','attributes':{'class':Hn},'children':[{'text':_0x5d4d4e['to']('label')}]};}['_createRemoveButton'](){const _0x3e378c=new Nt(this['locale']);return _0x3e378c['set']({'label':hs(this['locale'],'AI_CHAT_CONTEXT_REMOVE_FROM_CONTEXT'),'icon':_0x1a0f5}),this['_setupRemoveButtonEvent'](_0x3e378c),_0x3e378c;}['_setupRemoveButtonEvent'](_0x257d1f){_0x257d1f['on']('execute',()=>{this['fire']('removeContextItemChip',this['id']);});}['_createIconView'](){const _0x1277c3=this['bindTemplate'],_0x3325ac=new xt();return _0x3325ac['content']=xn[this['itemType']],_0x3325ac['extendTemplate']({'attributes':{'class':[Mn,_0x1277c3['if']('isLoading','ck-hidden',_0x475003=>_0x475003)]}}),_0x3325ac;}['_handleAnimationEndOnce'](_0x37719f,_0xb8631f){if(!_0x37719f)return;const _0x449ff4=()=>{_0xb8631f(),_0x37719f['removeEventListener']('animationend',_0x449ff4),_0x37719f['removeEventListener']('webkitAnimationEnd',_0x449ff4);};_0x37719f['addEventListener']('animationend',_0x449ff4),_0x37719f['addEventListener']('webkitAnimationEnd',_0x449ff4);}['_createLoaderIcon'](){const _0xf05132=new yn('small');return _0xf05132['bind']('isVisible')['to'](this,'isLoading',_0x2234fe=>_0x2234fe),_0xf05132;}}function Gn(_0x20aec1){if(!_0x20aec1)return _0x20aec1;if(_0x20aec1['length']<=0x78)return _0x20aec1;const _0x5e35b8=_0x20aec1['slice'](0x0,0x78),_0x99ee83=_0x5e35b8['lastIndexOf']('\x20');return(_0x99ee83>0x0?_0x5e35b8['slice'](0x0,_0x99ee83):_0x5e35b8)+'…';}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(_0x186aa6,_0x2ca653,_0x1d012,_0x410f5c,_0xaefb6a){this['_locale']=_0x186aa6,this['_visibleChips']=_0x2ca653,this['_config']={...Fn,..._0x1d012,'cssClasses':{'controlsButton':'','calculationContainer':'ck-calculation-container',..._0x1d012['cssClasses']}},this['_overflowChips']=new dt(),this['_bodyCollection']=_0x410f5c,this['_parentView']=_0xaefb6a||null;}['setContainerElement'](_0x1715c7){this['_intersectionObserver']&&(this['_intersectionObserver']['disconnect'](),this['_intersectionObserver']=null),this['_containerElement']=_0x1715c7,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 _0x1dbce3=[...this['_visibleChips'],...this['_overflowChips']],_0x2a9dd6=this['_createCalculationContainer'](),_0x30db2d=this['_calculateOverflowInContainer'](_0x2a9dd6,_0x1dbce3),_0x2de171=_0x2a9dd6['_ancestorsToRestore'];_0x2de171&&this['_restoreAncestorVisibility'](_0x2de171),_0x2a9dd6['remove'](),this['_applyOverflowResults'](_0x1dbce3,_0x30db2d);}['_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 _0x59d276=new Nt(this['_locale']);_0x59d276['set']({'label':'','withText':!0x0,'isToggleable':!0x0});const _0x2415be=[this['_config']['cssClasses']['showMoreButton']];return this['_config']['cssClasses']['controlsButton']&&_0x2415be['push'](this['_config']['cssClasses']['controlsButton']),_0x59d276['extendTemplate']({'attributes':{'class':_0x2415be}}),_0x59d276;}['_createShowMoreBalloonPanelView'](){const _0x2d3490=new Xt(this['_locale']);return _0x2d3490['extendTemplate']({'attributes':{'class':this['_config']['cssClasses']['showMoreBalloon']}}),this['_bodyCollection']['add'](_0x2d3490),_0x2d3490;}['_updateBalloonContent'](){if(this['_showMoreBalloonPanelView']&&(this['_showMoreBalloonPanelView']['content']['clear'](),this['_overflowChips']['length']>0x0)){this['_overflowChips']['forEach'](_0x27bd23=>{_0x27bd23['disableAnimationOnEnter']();});const _0x5bd2fd=new vt(this['_locale']);_0x5bd2fd['setTemplate']({'tag':'div','attributes':{'class':this['_config']['cssClasses']['overflowContainer']},'children':this['_overflowChips']}),this['_showMoreBalloonPanelView']['content']['add'](_0x5bd2fd);}}['_handleShowMoreButtonClick'](){this['_showMoreButtonView']['isOn']?this['hideBalloonPanel']():this['showBalloonPanel']();}['_updateShowMoreButtonVisibility'](){const _0xba8af5=this['_overflowChips']['length']>0x0;this['_showMoreButtonView']?.['element']&&(this['_showMoreButtonView']['element']['style']['display']=_0xba8af5?'':'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'](_0x7cff91){const _0x4a6128=this['_containerElement']?.['tagName']['toLowerCase']()||'div',_0x56d2c4=this['_containerElement']?.['classList'];if(_0x56d2c4){const _0x49b428=_0x56d2c4[0x0]||'',_0x402d94=_0x7cff91['querySelector']('.'+_0x49b428),_0x5ab8a5=_0x7cff91['querySelector'](_0x4a6128);return _0x402d94||_0x5ab8a5||_0x7cff91;}return _0x7cff91['querySelector'](_0x4a6128)||_0x7cff91;}['_calculateContainerWidth'](){const _0x3e2931=this['_parentView']?.['element']||this['_containerElement'];if(!_0x3e2931)return Kn;const _0x4a5987=window['getComputedStyle'](_0x3e2931)['width'];if('auto'===_0x4a5987||'0px'===_0x4a5987||!_0x4a5987){const _0x410214=_0x3e2931['parentElement'];if(_0x410214){const _0xae7e3d=window['getComputedStyle'](_0x410214);return'auto'!==_0xae7e3d['width']?_0xae7e3d['width']:Kn;}return Kn;}return _0x4a5987;}['_applyCalculationStyles'](_0x38a08a,_0x11b1c4){this['_config']['cssClasses']['calculationContainer']&&_0x38a08a['classList']['add'](this['_config']['cssClasses']['calculationContainer']),_0x38a08a['style']['width']=_0x11b1c4,_0x38a08a['style']['position']='absolute',_0x38a08a['style']['top']='-9999px',_0x38a08a['style']['left']='-9999px',_0x38a08a['style']['opacity']='0',_0x38a08a['style']['pointerEvents']='none',_0x38a08a['style']['zIndex']='-1',_0x38a08a['style']['visibility']='visible\x20!important',_0x38a08a['style']['display']='block\x20!important',_0x38a08a['style']['boxSizing']='border-box';}['_restoreAncestorVisibility'](_0x118540){_0x118540['forEach'](({element:_0x95323a,originalDisplay:_0x2bae65,originalVisibility:_0x1d6dd9})=>{_0x95323a['style']['display']=_0x2bae65,_0x95323a['style']['visibility']=_0x1d6dd9;});}['_makeAncestorsVisible'](_0x3f6680){const _0x2e42dd=[];let _0x3ef2f5=_0x3f6680;for(;_0x3ef2f5&&_0x3ef2f5!==document['body'];){const _0x4188e8=window['getComputedStyle'](_0x3ef2f5);'none'!==_0x4188e8['display']&&'hidden'!==_0x4188e8['visibility']||(_0x2e42dd['push']({'element':_0x3ef2f5,'originalDisplay':_0x3ef2f5['style']['display'],'originalVisibility':_0x3ef2f5['style']['visibility']}),_0x3ef2f5['style']['display']='block',_0x3ef2f5['style']['visibility']='visible'),_0x3ef2f5=_0x3ef2f5['parentElement'];}return _0x2e42dd;}['_createContainerElements'](){let _0x153d2,_0xcdf34;return this['_parentView']?.['element']?(_0x153d2=this['_parentView']['element']['cloneNode'](!0x0),_0xcdf34=this['_findTargetContainer'](_0x153d2)):(_0x153d2=document['createElement']('div'),_0xcdf34=_0x153d2),{'calculationContainer':_0x153d2,'targetContainer':_0xcdf34};}['_createCalculationContainer'](){const {calculationContainer:_0x17edcc,targetContainer:_0x33a05d}=this['_createContainerElements'](),_0x5e551b=this['_calculateContainerWidth']();this['_applyCalculationStyles'](_0x17edcc,_0x5e551b);const _0x306724=this['_parentView']?.['element']||this['_containerElement'],_0x3613e7=_0x306724?.['parentElement'];_0x3613e7?_0x3613e7['appendChild'](_0x17edcc):document['body']['appendChild'](_0x17edcc),_0x17edcc['_targetContainer']=_0x33a05d;const _0x2824=this['_makeAncestorsVisible'](_0x3613e7||null);return _0x17edcc['offsetWidth'],_0x17edcc['_ancestorsToRestore']=_0x2824,_0x17edcc;}['_calculateOverflowInContainer'](_0xa0b3ac,_0x1c6d45){const _0x2aba2d=_0xa0b3ac['_targetContainer']||_0xa0b3ac,_0x5d1c9d=[],{rowCount:_0x221559}=this['_renderChipsAndCountRows'](_0x2aba2d,_0x1c6d45);if(_0x221559<=this['_config']['maxVisibleRows'])return _0x5d1c9d;const _0x1e8036=_0x1c6d45['slice']();for(;_0x1e8036['length']>0x0;){if(this['_testButtonFit'](_0xa0b3ac,_0x2aba2d,_0x1e8036)){const _0x5e69f8=_0x1c6d45['filter'](_0x53fd64=>!_0x1e8036['includes'](_0x53fd64));_0x5d1c9d['push'](..._0x5e69f8);break;}if(!_0x1e8036['pop']())break;}return _0x5d1c9d;}['_renderChipsAndCountRows'](_0x3612e6,_0x2108c2){_0x3612e6['innerHTML']='',_0x2108c2['forEach'](_0x13d286=>{if(_0x13d286['element']){const _0x3c0e2c=_0x13d286['element']['cloneNode'](!0x0);_0x3612e6['appendChild'](_0x3c0e2c);}}),_0x3612e6['offsetWidth'];const _0xee0b77=_0x3612e6['children'],_0x270c28=[];return Array['from'](_0xee0b77)['forEach'](_0x2ab81a=>{const _0x2393d3=_0x2ab81a['getBoundingClientRect']()['top'];_0x270c28['some'](_0x15377f=>Math['abs'](_0x15377f-_0x2393d3)<this['_config']['rowDetectionTolerance'])||_0x270c28['push'](_0x2393d3);}),{'rowCount':_0x270c28['length']};}['_createMockButton'](){const _0xdcaade=document['createElement']('button');return _0xdcaade['className']=this['_config']['cssClasses']['showMoreButton'],this['_config']['cssClasses']['controlsButton']&&_0xdcaade['classList']['add'](this['_config']['cssClasses']['controlsButton']),_0xdcaade['textContent']='+\x201',_0xdcaade;}['_testButtonFit'](_0x34bbf3,_0x512422,_0x314aa1){this['_renderChipsAndCountRows'](_0x512422,_0x314aa1);const _0x4e2ef6=this['_createMockButton']();_0x34bbf3['appendChild'](_0x4e2ef6),_0x34bbf3['offsetWidth'];const _0x4cfef8=[..._0x512422['children'],_0x4e2ef6],_0x4fd995=[];_0x4cfef8['forEach'](_0x2883a1=>{const _0x499000=_0x2883a1['getBoundingClientRect']()['top'];_0x4fd995['some'](_0xe08f=>Math['abs'](_0xe08f-_0x499000)<this['_config']['rowDetectionTolerance'])||_0x4fd995['push'](_0x499000);});const _0xa15766=_0x4fd995['length'];return _0x4e2ef6['remove'](),_0xa15766<=this['_config']['maxVisibleRows'];}['_distributeChips'](_0x150b45,_0x1220d7){this['_visibleChips']['clear'](),this['_overflowChips']['clear'](),_0x150b45['forEach'](_0x14b660=>{_0x1220d7['includes'](_0x14b660)?this['_overflowChips']['add'](_0x14b660):this['_visibleChips']['add'](_0x14b660);});}['_updateOverflowUI'](_0x2b53a0){if(_0x2b53a0>0x0&&!this['_showMoreButtonView']&&this['_createShowMoreButton'](),_0x2b53a0>0x0&&this['_showMoreButtonView']){const _0x603eca=''+this['_config']['showMoreLabelPrefix']+(_0x2b53a0<0x63?_0x2b53a0:'99');this['_showMoreButtonView']['label']=_0x603eca;}this['_updateBalloonContent'](),this['_updateShowMoreButtonVisibility'](),this['_repinBalloonPanel']();}['_applyOverflowResults'](_0x573b62,_0x36e480){this['_distributeChips'](_0x573b62,_0x36e480),this['_updateOverflowUI'](_0x36e480['length']);}['_setupVisibilityObserver'](){this['_containerElement']&&'undefined'!=typeof IntersectionObserver&&(this['_intersectionObserver']=new IntersectionObserver(_0x57ed27=>{_0x57ed27[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 _0x1d51b2=this['_containerElement']['getBoundingClientRect']();if(0x0===_0x1d51b2['width']||0x0===_0x1d51b2['height'])return!0x1;const _0x263c15=window['innerHeight']||document['documentElement']['clientHeight'],_0x28516b=window['innerWidth']||document['documentElement']['clientWidth'],_0x5d5383=0xc8;return _0x1d51b2['bottom']>=-0xc8&&_0x1d51b2['top']<=_0x263c15+_0x5d5383&&_0x1d51b2['right']>=-0xc8&&_0x1d51b2['left']<=_0x28516b+_0x5d5383;}}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(_0x754975,_0x3e5a0e,_0x53e5c3){super(_0x754975),this['_bodyCollection']=_0x53e5c3,this['_createContextChips'](_0x3e5a0e);const _0x55f8eb={'cssClasses':{'showMoreButton':Xn+'\x20'+us,'showMoreBalloon':zn,'overflowContainer':qn,'controlsButton':Qn}};this['_overflowManager']=new Wn(_0x754975,this['_contextChips'],_0x55f8eb,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 _0x513142=this['element']['querySelector']('.'+$n);_0x513142&&(this['_overflowManager']['setContainerElement'](_0x513142),this['_overflowManager']['reorganizeChips']());}['destroy'](){super['destroy'](),this['_overflowManager']['destroy']();}['_createContextChips'](_0x4e9d65){for(const _0x5384d8 of _0x4e9d65){const _0x38d1ab=new Bn(this['locale'],_0x5384d8,!0x0,!0x1);this['_contextChips']['add'](_0x38d1ab);}}}class Jn extends an{['_contextChipsView']=null;['_locale'];['_bodyCollection'];['_messageContentView'];constructor(_0x53f4d9,_0x5736b2,_0x17acbf){super(_0x5736b2),this['_locale']=_0x53f4d9,this['_bodyCollection']=_0x17acbf,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'](_0x5aa283=>!_0x5aa283['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(_0x5b91a8,_0x59b83e){super(_0x59b83e);const {isWebSearchEnabled:_0x23426e,isReasoningEnabled:_0x1091ac}=_0x59b83e['capabilities'],_0x6a364d=[];let _0x37c694='';_0x23426e&&_0x1091ac?(_0x37c694=hs(_0x5b91a8,'AI_CHAT_FEED_REPLY_ITEM_USED_WEB_SEARCH_REASONING'),_0x6a364d['push'](tr(_0x2cc2cd)),_0x6a364d['push'](tr(_0x33f7c5))):_0x23426e?(_0x37c694=hs(_0x5b91a8,'AI_CHAT_FEED_REPLY_ITEM_USED_WEB_SEARCH'),_0x6a364d['push'](tr(_0x2cc2cd))):_0x1091ac&&(_0x37c694=hs(_0x5b91a8,'AI_CHAT_FEED_REPLY_ITEM_USED_REASONING'),_0x6a364d['push'](tr(_0x33f7c5))),this['extendTemplate']({'attributes':{'class':['ck-ai-chat__feed__interaction-header',_0x37c694?'':'ck-hidden']}});const _0xafdb84=new vt();_0xafdb84['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed__interaction-header__capabilities']},'children':[..._0x6a364d,{'tag':'span','attributes':{'class':['ck-ai-chat__feed__interaction-header__capabilities__text']},'children':[_0x37c694]}]}),this['children']['add'](_0xafdb84),this['capabilities']=_0x59b83e['capabilities'];}}function tr(_0x5c8fe1){const _0x5c003a=new xt();return _0x5c003a['content']=_0x5c8fe1,_0x5c003a;}const er=['wheel','touchstart','pointerdown','keydown'],ir=['ArrowUp','ArrowDown','PageUp','PageDown','Home','End','\x20'];class sr{['element'];['animationFrameId'];['isRunning'];['abortController'];['isUserPaused'];['scrollBehavior'];constructor(_0x41f447){this['element']=_0x41f447,this['animationFrameId']=null,this['isRunning']=!0x1,this['abortController']=new AbortController(),this['isUserPaused']=!0x1,this['scrollBehavior']='smooth';for(const _0x597785 of er){const _0x7929b2='keydown'!==_0x597785;this['element']['addEventListener'](_0x597785,this['_onUserEvent']['bind'](this),{'passive':_0x7929b2,'signal':this['abortController']['signal']});}}['start']({smooth:_0x51d736=!0x0}={}){this['isRunning']||(this['isRunning']=!0x0,this['isUserPaused']=!0x1,this['scrollBehavior']=_0x51d736?'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'](_0x54c528){if(this['isRunning']){if('keydown'===_0x54c528['type']){const _0x1600fe=_0x54c528['key'];if(!ir['includes'](_0x1600fe))return;}_0x54c528 instanceof WheelEvent?_0x54c528['deltaY']<0x0?this['isUserPaused']=!0x0:this['isUserPaused']=!this['_isAtBottom']():this['isUserPaused']=!0x0;}}['_isAtBottom'](){const {scrollTop:_0x451c66,scrollHeight:_0x3ff1a4,clientHeight:_0xa3b2a5}=this['element'];return _0x3ff1a4-_0x451c66-_0xa3b2a5<=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(_0x4a2158){super(_0x4a2158),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(_0x39f6fc,_0x275529){super(_0x39f6fc),this['_bodyCollection']=_0x275529,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'](_0x48ccb1,_0x19e4e8){let _0x210c53;return'ai-reply'===_0x48ccb1?_0x210c53=new vn(this['locale'],_0x19e4e8,this['_bodyCollection']):'ai-suggestion-reply'===_0x48ccb1?(_0x210c53=new Nn(this['locale'],_0x19e4e8,this['_bodyCollection']),_0x210c53['bind']('isTrackChangesOn')['to'](this)):_0x210c53='user-message'===_0x48ccb1?new Jn(this['locale'],_0x19e4e8,this['_bodyCollection']):'interaction-header'===_0x48ccb1?new Zn(this['locale'],_0x19e4e8):'custom-element'===_0x48ccb1?new nr(_0x19e4e8):new wn(_0x19e4e8),this['children']['add'](_0x210c53),_0x210c53;}async['updateReplyItem']({id:_0xc836e,parsedContent:_0x13398,renderingStrategy:_0x5ea174,abortSignal:_0x4630ef}){const _0xa7a6b8=this['getItemById'](_0xc836e);if(!(_0xa7a6b8 instanceof vn))throw new at('ai-chat-feed-view-item-not-a-reply-item',null,{'itemView':_0xa7a6b8,'id':_0xc836e,'parsedContent':_0x13398});await _0xa7a6b8['updateContent']({'parsedContent':_0x13398,'renderingStrategy':_0x5ea174,'abortSignal':_0x4630ef});}async['updateWebSources'](_0x26c232,_0x3d95cd){const _0x599061=this['getItemById'](_0x26c232);if(_0x599061 instanceof Nn)_0x599061['updateSources'](_0x3d95cd);else{if(!(_0x599061 instanceof vn))throw new at('ai-chat-feed-view-item-not-a-suggestion-or-reply-item',null,{'itemView':_0x599061,'id':_0x26c232,'sources':_0x3d95cd});_0x599061['updateSources'](_0x3d95cd);}}async['updateSuggestionItem']({id:_0x167ec5,parts:_0x332c51,abortSignal:_0x4f559a,skipLoadingEffects:_0x259802}){const _0x1628a0=this['getItemById'](_0x167ec5);if(!(_0x1628a0 instanceof Nn))throw new at('ai-chat-feed-view-item-not-a-suggestion-item',null,{'itemView':_0x1628a0,'id':_0x167ec5,'parts':_0x332c51});await _0x1628a0['updateContent']({'parts':_0x332c51,'abortSignal':_0x4f559a,'skipLoadingEffects':_0x259802});}['updateSuggestionPartState']({id:_0x54cfb6,index:_0x2db2ae,state:_0x301304}){const _0x204b51=this['getItemById'](_0x54cfb6);if(!(_0x204b51 instanceof Nn))throw new at('ai-chat-feed-view-item-not-a-suggestion-item',this,{'id':_0x54cfb6});_0x204b51['updatePartState'](_0x2db2ae,_0x301304);}['setSuggestionPartActive']({id:_0x29e8f6,index:_0x13aeea,isActive:_0x5e03df}){const _0x1030d5=this['getItemById'](_0x29e8f6);if(!(_0x1030d5 instanceof Nn))throw new at('ai-chat-feed-view-item-not-a-suggestion-item',this,{'id':_0x29e8f6});this['children']['filter'](_0x10f442=>_0x10f442 instanceof Nn)['forEach'](_0x3734ad=>{_0x3734ad['setPartActive'](!0x1);}),_0x1030d5['setPartActive'](_0x13aeea,_0x5e03df);}['markItemAsDone'](_0x38807d){this['getItemById'](_0x38807d)['markAsDone']();}['getItemIds'](){return this['children']['map'](_0x2c386f=>_0x2c386f['options']['id']);}['removeItem'](_0x5a1b3d){this['children']['remove'](this['getItemById'](_0x5a1b3d));}['hasItem'](_0x42d9f9){return!!this['children']['find'](_0xe198d9=>_0xe198d9['options']['id']['includes'](_0x42d9f9));}['scrollToSuggestion'](_0x1dac66,_0x39cbb4){const _0x318b3a=this['getItemById'](_0x1dac66);if(!(_0x318b3a instanceof Nn))return void It('ck-ai-chat-feed-view-scroll-to-suggestion-invalid-item',{'replyId':_0x1dac66,'partIndex':_0x39cbb4});const _0x389d50=_0x318b3a['getPartView'](_0x39cbb4);_0x389d50?ft(_0x389d50['element'],0x14,this['element']['parentElement'],!0x0,!0x0):It('ck-ai-chat-feed-view-scroll-to-suggestion-part-view-not-found',{'replyId':_0x1dac66,'partIndex':_0x39cbb4});}['_setupTemplate'](){this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed']},'children':this['_createTemplateChildren']()});}['_createTemplateChildren'](){const _0x4f185e=this['_createSkeletonLoader']();return[this['_createFeedItems'](),_0x4f185e,this['_createFeedLoader']()];}['_createSkeletonLoader'](){const _0x8722f5=new pn(this['locale'],mn['aiFeed']);return _0x8722f5['bind']('isVisible')['to'](this,'isLoadingSkeletonVisible'),_0x8722f5;}['_createFeedItems'](){const _0x562aca=new vt(this['locale']);return _0x562aca['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed__items',this['bindTemplate']['if']('isLoadingSkeletonVisible','ck-hidden')]},'children':this['children']}),_0x562aca;}['_createFeedLoader'](){const _0x7141e5=new vt(this['locale']);return _0x7141e5['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__loader',this['bindTemplate']['if']('loadingMessage','ck-hidden',_0x49a429=>!_0x49a429)]},'children':this['_createLoaderChildren']()}),_0x7141e5;}['_createLoaderChildren'](){const _0x5b406a=new yn();return _0x5b406a['isVisible']=!0x0,[_0x5b406a,{'tag':'span','attributes':{'class':['ck','ck-ai-chat__loader-text']},'children':[{'text':this['bindTemplate']['to']('loadingMessage')}]}];}['getItemById'](_0x33d9ef){const _0x35a6d2=this['children']['find'](_0x2b13b9=>_0x2b13b9['options']['id']['includes'](_0x33d9ef));if(!_0x35a6d2)throw new at('ai-chat-feed-view-item-not-found',this,{'id':_0x33d9ef});return _0x35a6d2;}['setLoadingMessage'](_0x6111f9){this['set']('loadingMessage',_0x6111f9);}['toggleLoadingSkeleton'](_0x316989){this['set']('isLoadingSkeletonVisible',_0x316989);}['startAutoScroll'](_0x2e738d={}){this['scrollManager']['start'](_0x2e738d);}['stopAutoScroll'](){this['scrollManager']['stop']();}}class or extends Dt{['filter'](){let _0x4d7919=0x0;for(const _0x27e29f of this['items'])_0x4d7919+=_0x27e29f['items']['length'];return{'resultsCount':_0x4d7919,'totalItemsCount':_0x4d7919};}}const ar='ck-ai-chat__prompt-input_highlighted';class hr extends Lt{['submitButtonView'];static ['MIN_ROWS']=0x1;static ['MAX_ROWS']=0xc;['_addContextButtonView'];['_queryViewResizeObserver'];constructor(_0x52c1ce,_0x60706f){super(_0x52c1ce,{'queryView':{'label':'','creator':Vt,'showIcon':!0x1,'showResetButton':!0x1},'filteredView':new or(_0x52c1ce),'queryMinChars':0x1/0x0,'resetOnBlur':!0x1}),this['set']('isEmpty',!0x0),this['set']('isUploadInProgress',!0x1),this['_addContextButtonView']=_0x60706f,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',(_0x58cd2a,_0x2e1375)=>!_0x58cd2a&&!_0x2e1375),this['focusableChildren']['add'](this['submitButtonView']);}['render'](){super['render'](),this['queryView']['fieldWrapperChildren']['add'](this['submitButtonView']),this['keystrokes']['set']('enter',(_0x39d54d,_0x41e932)=>{this['isUploadInProgress']||this['isEmpty']||_0x39d54d['target']==this['queryView']['fieldView']['element']&&(this['submit'](),_0x41e932());}),this['queryView']['fieldView']['on']('update',()=>{this['isEmpty']=''===this['queryView']['fieldView']['element']['value']?.['trim']();});}['destroy'](){super['destroy'](),this['_queryViewResizeObserver']&&this['_queryViewResizeObserver']['destroy']();}['submit'](){const _0x18c8a8=this['queryView']['fieldView']['element']['value']?.['trim']();if(!_0x18c8a8)return this['queryView']['errorText']=hs(this['locale'],'AI_CHAT_PROMPT_EMPTY_ERROR'),void(this['queryView']['fieldView']['hasError']=!0x0);this['queryView']['fieldView']['hasError']=!0x1;const _0x3ce700=_0x28ca45(_0x18c8a8);this['fire']('sendUserMessage',_0x3ce700),this['queryView']['fieldView']['reset']();}['setPlaceholderText'](_0x5a9a04){this['queryView']['fieldView']['set']('placeholder',_0x5a9a04);}['focus'](_0x22d3c4=!0x1){super['focus'](),_0x22d3c4&&(this['element']['classList']['contains'](ar)||(this['element']['classList']['add'](ar),setTimeout(()=>{this['element']['classList']['remove'](ar);},0x320)));}['_createSubmitButton'](){const _0x38a8b7=new Nt(this['locale']);return _0x38a8b7['set']({'icon':_0x4829f4,'label':hs(this['locale'],'AI_CHAT_LABEL_SUBMIT'),'isVisible':!0x0,'tooltip':!0x0,'class':'ck-ai-chat__prompt-submit-button\x20'+cs,'isEnabled':!0x1}),_0x38a8b7['on']('execute',()=>{this['submit']();}),_0x38a8b7;}['setIsUploadInProgress'](_0x5bd2a9){this['isUploadInProgress']=_0x5bd2a9;}['_setUpAddContextButtonPositioning'](){const _0x4f52bc=this['locale'],_0x59ec28=()=>{ct['window']['requestAnimationFrame'](()=>{if(lt(this['element'])){const _0x4d61b1=new ut(this['queryView']['fieldView']['element']),_0x55d9ca=new ut(this['_addContextButtonView']['element']),_0x49f495=_0x4d61b1['width'],_0x136af3='rtl'===_0x4f52bc['uiLanguageDirection']?'right':'left';_0x4d61b1['excludeScrollbarsAndBorders']();const _0x45a05c=_0x49f495-_0x4d61b1['width']+0x1;this['_addContextButtonView']['element']['style'][_0x136af3]='calc('+(_0x49f495-_0x55d9ca['width']-_0x45a05c)+'px\x20-\x20var(--ck-spacing-tiny))';}});};this['queryView']['fieldView']['on']('update',_0x59ec28),this['on']('render',()=>{_0x59ec28(),this['_queryViewResizeObserver']=new bt(this['queryView']['fieldView']['element'],()=>{_0x59ec28();});});}}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(_0x1a3c4d){super(_0x1a3c4d),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',_0x7ddba5=>'selector'===_0x7ddba5),this['_modelSelectionDropdown']['buttonView']['bind']('tooltip')['to'](this,'modelSelectorEnabled',_0x10eb69=>_0x10eb69?this['_modelSelectionDropdown']['buttonView']['label']:hs(this['locale'],'AI_CHAT_MODEL_SELECTOR_DISABLED_TOOLTIP')),this['_modelSelectionDropdown']['bind']('isEnabled')['to'](this,'modelSelectorEnabled',_0x9b5dda=>_0x9b5dda),this['_webSearchButton']['bind']('isOn')['to'](this,'webSearchActive',_0x6331c5=>_0x6331c5),this['_webSearchButton']['bind']('tooltip')['to'](this,'webSearchActive',_0x496d1f=>hs(this['locale'],_0x496d1f?'AI_CHAT_DISABLE_WEB_SEARCH':'AI_CHAT_ENABLE_WEB_SEARCH')),this['_reasoningButton']['bind']('isOn')['to'](this,'reasoningActive',_0x3c577d=>_0x3c577d),this['_reasoningButton']['bind']('tooltip')['to'](this,'reasoningActive',_0x1748a3=>hs(this['locale'],_0x1748a3?'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'](_0x228902,_0x429f20){if(_0x429f20)this['set']('modelDisplayMode','hidden');else{const _0x16e15d=0x1===_0x228902['length'];this['set']('modelDisplayMode',_0x16e15d?'name':'selector');}if(this['_modelSelectionDropdownItems']['clear'](),_0x228902?.['length'])for(const _0x5cef4b of _0x228902){const _0x4b8e32=new Jt({'label':_0x5cef4b['name'],'withText':!0x0,'role':'menuitemradio','id':_0x5cef4b['id'],'model':_0x5cef4b});_0x4b8e32['bind']('isOn')['to'](this,'activeModelId',_0x4e7be6=>_0x4e7be6===_0x5cef4b['id']),this['_modelSelectionDropdownItems']['add']({'type':'button','model':_0x4b8e32,'labelView':new pr(this['locale'],_0x5cef4b)});}}['setWebSearch'](_0x503ecd){this['set']('webSearchActive',_0x503ecd);}['setReasoning'](_0x29c3c1){this['set']('reasoningActive',_0x29c3c1);}['setModel'](_0x30c04c){if(!_0x30c04c)return;this['activeModelId']=_0x30c04c['id'],this['activeModelName']=_0x30c04c['name']||_0x30c04c['id'],this['_modelSelectionDropdown']['buttonView']['set']('label',_0x30c04c['name']),this['_modelSelectionDropdown']['buttonView']['set']('tooltip',_0x30c04c['name']);const _0x1e2efc=_0x30c04c['capabilities']['webSearch']?.['enabled']??!0x1;this['set']('webSearchActive',!0x1),this['_webSearchButton']['set']('isOn',!0x1),this['_webSearchButton']['set']('isEnabled',_0x1e2efc),this['_webSearchButton']['set']('isVisible',_0x1e2efc);const _0x235972=_0x30c04c['capabilities']['reasoning']?.['enabled']??!0x1;this['set']('reasoningActive',!0x1),this['_reasoningButton']['set']('isOn',!0x1),this['_reasoningButton']['set']('isEnabled',_0x235972),this['_reasoningButton']['set']('isVisible',_0x235972);}['enableModelSelector'](){this['set']('modelSelectorEnabled',!0x0);}['disableModelSelector'](_0x29deea){this['set']('modelSelectorEnabled',!0x1),_0x29deea&&this['set']('modelDisplayMode','hidden');}['_createWebSearchButton'](){const _0x1b7393=new Nt();return _0x1b7393['set']({'label':hs(this['locale'],'AI_CHAT_SEARCH_WEB'),'icon':_0x2cc2cd,'class':lr+'\x20'+us,'isToggleable':!0x0,'tooltipPosition':Ir}),_0x1b7393['on']('execute',()=>{this['fire']('toggleWebSearch');}),_0x1b7393;}['_createReasoningButton'](){const _0x13b4a1=new Nt();return _0x13b4a1['set']({'label':hs(this['locale'],'AI_CHAT_REASONING'),'icon':_0x33f7c5,'class':lr+'\x20'+us,'isToggleable':!0x0,'tooltipPosition':Ir}),_0x13b4a1['on']('execute',()=>{this['fire']('toggleReasoning');}),_0x13b4a1;}['_createCommandsButton'](){const _0x582c45=new Nt();return _0x582c45['set']({'label':hs(this['locale'],'AI_CHAT_COMMANDS'),'icon':_0x11d2a1,'withText':!0x0,'class':lr+'\x20'+us,'isToggleable':!0x0,'tooltip':hs(this['locale'],'AI_CHAT_COMMANDS'),'tooltipPosition':Ir}),_0x582c45['extendTemplate']({'attributes':{'class':[ur]}}),_0x582c45['on']('execute',()=>{console['log']('Commands\x20are\x20not\x20implemented\x20yet.'),alert('Commands\x20are\x20not\x20implemented\x20yet.');}),_0x582c45;}['_createModelSelectionDropdown'](){const _0xdb2d87=Gt(this['locale']);return _0xdb2d87['set']({'panelPosition':'ne','class':[dr]}),_0xdb2d87['buttonView']['set']({'label':hs(this['locale'],'AI_CHAT_MODEL_SELECTOR_ENABLED_TOOLTIP'),'withText':!0x0,'tooltip':!0x0,'tooltipPosition':Ir,'class':us}),this['listenTo'](_0xdb2d87,'execute',_0x1afeb0=>{this['fire']('selectModel',_0x1afeb0['source']['model']);}),_0xdb2d87;}['_createModelNameView'](){const _0x4adc5b=new mr(this['locale']);return _0x4adc5b['bind']('text')['to'](this,'activeModelName',_0x3682ed=>_0x3682ed??''),_0x4adc5b['bind']('isVisible')['to'](this,'modelDisplayMode',_0x31b8c5=>'name'===_0x31b8c5),_0x4adc5b;}}let pr=class extends Mt{constructor(_0x200154,_0x1684b6){super();const _0x43f657=this['bindTemplate'],_0x1614a8=this['createCollection']();this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-button__label'],'style':_0x43f657['to']('style'),'id':_0x43f657['to']('id')},'children':[{'tag':'div','attributes':{'class':[_r]},'children':[{'text':_0x43f657['to']('text')}]},{'tag':'div','attributes':{'class':[gr]},'children':[{'tag':'span','children':[{'text':_0x1684b6['description']}]}]},{'tag':'div','attributes':{'class':[Ar]},'children':_0x1614a8}]}),_0x1614a8['addMany'](this['_getCapabilityParts'](_0x200154,_0x2cc2cd,'AI_CHAT_SEARCH_WEB',_0x1684b6['capabilities']['webSearch']?.['enabled']??!0x1)),_0x1614a8['addMany'](this['_getCapabilityParts'](_0x200154,_0x33f7c5,'AI_CHAT_REASONING',_0x1684b6['capabilities']['reasoning']?.['enabled']??!0x1));}['_getCapabilityParts'](_0x58bd6f,_0x35abfd,_0x3189f6,_0x16dbd9){const _0x4d4327=new xt();_0x4d4327['content']=_0x35abfd;const _0x29e835=new vt(_0x58bd6f);_0x29e835['setTemplate']({'tag':'span','children':[{'text':hs(_0x58bd6f,_0x3189f6)+':\x20'}]});const _0x353131=new vt(_0x58bd6f);return _0x353131['setTemplate']({'tag':'span','children':[{'text':hs(_0x58bd6f,_0x16dbd9?'AI_CHAT_CAPABILITIES_YES':'AI_CHAT_CAPABILITIES_NO')}]}),[_0x4d4327,_0x29e835,_0x353131];}},mr=class extends vt{constructor(_0x23da37){super(_0x23da37),this['set']('text',void 0x0),this['set']('isVisible',!0x0);const _0x49aa10=this['bindTemplate'];this['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai-chat-controls__model-name',_0x49aa10['if']('isVisible','ck-hidden',_0x128812=>!_0x128812)]},'children':[{'text':_0x49aa10['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(_0x3b4828){super(_0x3b4828),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'](_0x42746e=>{this['focusTracker']['add'](_0x42746e['element']),this['keystrokes']['listenTo'](_0x42746e['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'](_0x95e3d8){this['urlInputField']['errorText']=_0x95e3d8,this['_updateConfirmButtonState'](),this['fire']('refreshBalloon');}['clearError'](){this['urlInputField']['errorText']=null,this['_updateConfirmButtonState']();}['_createBackButton'](){const _0xeb2021=new Nt(this['locale']);return _0xeb2021['set']({'icon':_0x15e3cb,'tooltip':hs(this['locale'],'AI_CHAT_CONTEXT_URL_BACK_TO_CONTEXT'),'tooltipPosition':'n','class':['ck-button-icon\x20ck-button-back']}),this['on']('change:withBackButton',(_0x5a6cec,_0x25c7d2,_0x3da390)=>{_0xeb2021['set']({'class':['ck-button-icon\x20ck-button-back'+(_0x3da390?'':'\x20ck-hidden')]});}),_0xeb2021;}['_createUrlInputField'](){const _0x2dcc57=new te(this['locale'],_0x2b8667);return _0x2dcc57['set']({'label':hs(this['locale'],'AI_CHAT_CONTEXT_URL_LABEL'),'class':'ck-labeled-field-view_empty'}),_0x2dcc57['fieldView']['set']({'placeholder':hs(this['locale'],'AI_CHAT_CONTEXT_URL_PLACEHOLDER')}),_0x2dcc57;}['_createConfirmButton'](){const _0x198c1f=new Nt(this['locale']);return _0x198c1f['set']({'icon':_0x2dfde3,'tooltip':hs(this['locale'],'AI_CHAT_CONTEXT_URL_ADD_URL'),'tooltipPosition':'n','class':'ck-button-icon','type':'submit','isEnabled':!0x1}),_0x198c1f;}['_setupTemplate'](){const _0x5e6a19=new _0x53b19c(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'});_0x5e6a19['children']['add'](this['backButton'],0x0),this['setTemplate']({'tag':'form','attributes':{'class':Tr,'tabindex':'-1'},'children':[_0x5e6a19,{'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',_0x40d05e=>{_0x40d05e['stop'](),this['_handleSubmit']();});}['_setupKeystrokes'](){this['keystrokes']['set']('esc',(_0x4a0030,_0x2689fe)=>{this['clear'](),this['fire']('cancel'),_0x2689fe();});}['_handleSubmit'](){const _0x4fc8e6=this['getValue']()['trim']();_0x4fc8e6?this['_isValidUrl'](_0x4fc8e6)?(this['clearError'](),this['fire']('submitUrl',_0x4fc8e6)):this['setError'](hs(this['locale'],'AI_CHAT_CONTEXT_URL_INVALID_ERROR')):this['setError'](hs(this['locale'],'AI_CHAT_CONTEXT_URL_EMPTY_ERROR'));}['_updateConfirmButtonState'](){const _0x29e8a1=this['getValue']()['trim'](),_0x4cdd3b=!!this['urlInputField']['errorText'];this['confirmButton']['isEnabled']=_0x29e8a1['length']>0x0&&!_0x4cdd3b;}['_isValidUrl'](_0x32b437){try{return!!new URL(_0x32b437);}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(_0x4553e4,_0x4d2961){super(_0x4553e4),this['resource']=_0x4d2961,this['set']('isInContext',!!_0x4d2961['isInContext']),this['_titleView']=this['_createTitleView'](),this['_iconView']=this['_createIconView'](),this['_setupTemplate']();}['render'](){super['render']();}['getResourceIcon'](_0x2ef47e){if(_0x2ef47e['isInContext'])return _0x2dfde3;switch(_0x2ef47e['type']){case'document':return _0x2c2579;case'web-resource':return _0x289d5e;case'file':case'text':return _0x50ae83;default:return _0x548fb2;}}['highlightText'](_0x527f6c){if(!_0x527f6c||''===_0x527f6c['trim']())return void this['_titleView']['highlightText'](null);const _0x48c144=new RegExp(_0x2052d8(_0x527f6c),'gi');this['_titleView']['highlightText'](_0x48c144);}['updateResourceState'](_0x453e81){this['resource']['isInContext']=_0x453e81,this['isInContext']=_0x453e81,this['_updateIcon']();}['_createTitleView'](){const _0x30719d=new _0x2a3dc2();return _0x30719d['text']=this['resource']['label'],_0x30719d['extendTemplate']({'tag':'span','attributes':{'class':[Sr]}}),_0x30719d;}['_createIconView'](){const _0x51b940=new xt();return _0x51b940['content']=this['getResourceIcon'](this['resource']),_0x51b940;}['_setupTemplate'](){const _0xf3e98e=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':[fr,_0xf3e98e['if']('isVisible','ck-hidden',_0x11c4c4=>!_0x11c4c4),_0xf3e98e['if']('isInContext',br)]},'children':[{'tag':'div','attributes':{'class':[Rr]},'children':[this['_iconView']]},this['_titleView']],'on':{'click':_0xf3e98e['to']('execute')}});}['_updateIcon'](){this['_iconView']['content']=this['getResourceIcon'](this['resource']);}}const kr='ck-ai-chat-resources__list';class Nr extends Dt{['_source'];constructor(_0x1e6c70,_0xa1caca){super(_0x1e6c70),this['_source']=_0xa1caca,this['extendTemplate']({'attributes':{'class':[kr]}});}['setResources'](_0x5ae557,_0x34e699){this['items']['clear']();let _0x58c696=_0x5ae557;if(this['_source']['useDefaultFiltering']&&_0x34e699&&''!==_0x34e699['trim']()){const _0x2217cc=new RegExp(_0x34e699['replace'](/[.*+?^${}()|[\]\\]/g,'\x5c$&'),'gi');_0x58c696=_0x5ae557['filter'](_0x24ad43=>_0x2217cc['test'](_0x24ad43['label']));}for(const _0x2a1f90 of _0x58c696){const _0xc3884a=new Or(this['locale'],_0x2a1f90);_0xc3884a['on']('execute',()=>{this['_handleResourceSelection'](this['_source'],_0x2a1f90);}),this['items']['add'](_0xc3884a);}this['_source']['useDefaultFiltering']&&this['highlightText'](_0x34e699);}['highlightText'](_0x527f39){this['_source']['useDefaultFiltering']&&this['items']['forEach'](_0x356f0e=>{_0x356f0e['highlightText'](_0x527f39);});}['updateResourceState'](_0x54b114,_0x23f746){for(const _0xa28d92 of this['items']){const _0x276df6=_0xa28d92;_0x276df6['resource']['id']===_0x54b114&&_0x276df6['updateResourceState'](_0x23f746);}}['_handleResourceSelection'](_0x21c00f,_0x34671e){this['fire']('addResourceToContext',{'source':_0x21c00f,'resource':_0x34671e});}}class vr extends te{['iconView'];['resetButtonView'];['_viewConfig'];constructor(_0x3bb1cc){const t=_0x3bb1cc['t'],_0x5c9620={'showResetButton':!0x0,'showIcon':!0x0,'creator':_0x2b8667,'label':hs(_0x3bb1cc,'AI_CHAT_SEARCH_RESOURCES')};super(_0x3bb1cc,_0x5c9620['creator']),this['label']=_0x5c9620['label'],this['_viewConfig']=_0x5c9620,this['_viewConfig']['showIcon']&&this['_setupSearchIcon'](),this['_viewConfig']['showResetButton']&&this['_setupResetButton'](_0x3bb1cc,t),this['_setupEventListeners']();}['reset'](){this['fieldView']['reset'](),this['_viewConfig']['showResetButton']&&this['resetButtonView']&&(this['resetButtonView']['isVisible']=!0x1),this['search']('');}['search'](_0x1fc68e){this['fire']('search',_0x1fc68e);}['getQuery'](){return this['fieldView']['element']?.['value']||'';}['_setupSearchIcon'](){this['iconView']=new xt(),this['iconView']['content']=_0xb2c1fa,this['fieldWrapperChildren']['add'](this['iconView'],0x0),this['extendTemplate']({'attributes':{'class':'ck-search__query_with-icon'}});}['_setupResetButton'](_0x32d73a,t){this['resetButtonView']=new Nt(_0x32d73a),this['resetButtonView']['set']({'label':t('Clear'),'icon':_0x1a0f5,'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',_0x2323a5=>!_0x2323a5),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(_0x388ca6,_0x24b3ca){super(_0x388ca6),this['_source']=_0x24b3ca['source'],this['_searchInputVisibleFrom']=_0x24b3ca['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 _0x2fb855([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 _0x4a5d60=new vt(this['locale']);return _0x4a5d60['setTemplate']({'tag':'div','attributes':{'class':'ck\x20ck-search'},'children':[this['_searchView']]}),this['_searchView']['on']('search',(_0x346e5e,_0x51adbc)=>{this['loadResources'](_0x51adbc),this['_source']['useDefaultFiltering']&&this['_resourcesListView']['highlightText'](_0x51adbc);}),_0x4a5d60;}['_createResourcesListView'](){const _0x2862ac=new Nr(this['locale'],this['_source']);return _0x2862ac['delegate']('addResourceToContext')['to'](this),_0x2862ac['extendTemplate']({'attributes':{'class':this['bindTemplate']['if']('isLoading','ck-hidden')}}),_0x2862ac;}['_createSkeletonView'](){const _0x51b276=new pn(this['locale'],mn['aiChatResources']);return _0x51b276['bind']('isVisible')['to'](this,'isLoading'),_0x51b276;}['render'](){super['render'](),this['loadResources']('');}['loadResources'](_0x48436b){const _0x1888fd=ot();this['_latestLoadResourcesUid']=_0x1888fd,this['fire']('loadSourceResources',{'sourceId':this['_source']['id'],'query':_0x48436b,'uid':_0x1888fd}),this['isLoading']=!0x0;}['setResources'](_0x14994e,_0x301eef){if(_0x301eef&&_0x301eef!==this['_latestLoadResourcesUid'])return;const _0x4ef8e6=this['_source']['useDefaultFiltering']?this['_searchView']['getQuery']():'';this['_resourcesListView']['setResources'](_0x14994e,_0x4ef8e6),_0x14994e['length']>=this['_searchInputVisibleFrom']&&!this['children']['has'](this['_searchSection'])&&this['children']['add'](this['_searchSection'],0x0),requestAnimationFrame(()=>{this['isLoading']=!0x1;});}['updateResourceState'](_0x278478,_0x1f3a76){this['_resourcesListView']['updateResourceState'](_0x278478,_0x1f3a76);}}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(_0x23eecf,_0x40c106,_0x5e5a66){this['_locale']=_0x23eecf,this['_bodyCollection']=_0x40c106,this['_config']=_0x5e5a66;}['showSourceResourcesBalloon']({source:_0x273c4c,withBackButton:_0x56db51}){let _0x3f6a9d=this['_sourceResourceBalloons']['get'](_0x273c4c['id']);_0x3f6a9d||(_0x3f6a9d=this['_createSourceResourceBalloonPanel'](),this['_sourceResourceBalloons']['set'](_0x273c4c['id'],_0x3f6a9d),this['_setupSingleResourceBalloonClickOutsideHandler'](_0x3f6a9d)),this['_addSourceResourceContent']({'balloonPanel':_0x3f6a9d,'source':_0x273c4c,'withBackButton':_0x56db51}),_0x3f6a9d['show']();const _0x26dd75=this['_config']['getTargetElement']();_0x26dd75&&_0x3f6a9d['pin']({'target':_0x26dd75,'limiter':this['_config']['getLimiterElement']()});}['populateSourceResourceBalloon'](_0x4d8c16,_0x45a1e9,_0x24993a){const _0x3484f5=this['_sourceResourceBalloons']['get'](_0x4d8c16);if(!_0x3484f5)return;const _0x47975=this['_getResourcesViewFromBalloon'](_0x3484f5);_0x47975&&(_0x47975['setResources'](_0x45a1e9,_0x24993a),_0x47975['once']('change:isLoading',()=>{_0x3484f5['pin']({'target':this['_config']['getTargetElement'](),'limiter':this['_config']['getLimiterElement']()});}));}['closeSourceResourceBalloon'](_0xcbcd04){const _0x2d4a75=this['_sourceResourceBalloons']['get'](_0xcbcd04);_0x2d4a75&&requestAnimationFrame(()=>{_0x2d4a75['hide'](),this['_sourceResourceBalloons']['delete'](_0xcbcd04),this['_config']['onBalloonClosed']();});}['isAnyResourceBalloonVisible'](){for(const _0x468438 of this['_sourceResourceBalloons']['values']())if(_0x468438['isVisible'])return!0x0;return!0x1;}['updateResourceState'](_0x1f1218,_0x33b4d6,_0x4f1485){const _0x21e0c4=this['_sourceResourceBalloons']['get'](_0x1f1218);if(!_0x21e0c4||!_0x21e0c4['isVisible'])return;const _0x10e0c2=this['_config']['getTargetElement']();if(!_0x10e0c2)return;_0x21e0c4['pin']({'target':_0x10e0c2,'limiter':this['_config']['getLimiterElement']()});const _0x2a3850=this['_getResourcesViewFromBalloon'](_0x21e0c4);_0x2a3850&&_0x2a3850['updateResourceState'](_0x33b4d6,_0x4f1485);}['destroy'](){for(const _0x3a199c of this['_sourceResourceBalloons']['values']())_0x3a199c['destroy']();this['_sourceResourceBalloons']['clear']();}['_createSourceResourceBalloonPanel'](){const _0x2a7e4b=new Xt(this['_locale']);return _0x2a7e4b['extendTemplate']({'attributes':{'class':xr}}),this['_bodyCollection']['add'](_0x2a7e4b),_0x2a7e4b;}['_addSourceResourceContent']({balloonPanel:_0x1a5793,source:_0x4800f4,withBackButton:_0xae7e04}){_0x1a5793['content']['clear']();const _0x501ee7=this['_createBalloonHeader']({'balloonPanel':_0x1a5793,'source':_0x4800f4,'withBackButton':_0xae7e04});_0x1a5793['content']['add'](_0x501ee7);const _0xac324a=this['_createBalloonResourcesView'](_0x4800f4);_0x1a5793['content']['add'](_0xac324a);}['_createBalloonHeader']({balloonPanel:_0x1ba32f,source:_0x3fcbfe,withBackButton:_0x1f5587}){const _0x502f99=new _0x53b19c(this['_locale'],{'label':_0x3fcbfe['label'],'class':Dr});return _0x1f5587&&_0x502f99['children']['add'](this['_createBackButton'](_0x1ba32f),0x0),_0x502f99;}['_createBackButton'](_0x171998){const _0x125712=new Nt(this['_locale']);return _0x125712['set']({'icon':_0x15e3cb,'tooltip':hs(this['_locale'],'AI_CHAT_CONTEXT_URL_BACK_TO_CONTEXT'),'tooltipPosition':'n','class':Lr}),_0x125712['on']('execute',()=>{_0x171998['hide'](),this['_config']['onBackToContext']();}),_0x125712;}['_createBalloonResourcesView'](_0x10329d){const _0x1ca27c=new yr(this['_locale'],{'source':_0x10329d,'searchInputVisibleFrom':this['_config']['searchInputVisibleFrom']});return _0x1ca27c['on']('loadSourceResources',(_0x2f0016,_0x1e28c6)=>{this['_config']['onLoadSourceResources'](_0x1e28c6);}),_0x1ca27c['on']('addResourceToContext',(_0x53dfd0,_0x28a08d)=>{this['_config']['onResourceSelected'](_0x28a08d['source'],_0x28a08d['resource']),this['closeSourceResourceBalloon'](_0x10329d['id']);}),_0x1ca27c;}['_getResourcesViewFromBalloon'](_0x18f424){const _0x421cba=_0x18f424['content']['get'](0x1);return _0x421cba instanceof yr?_0x421cba:null;}['_setupSingleResourceBalloonClickOutsideHandler'](_0x20042e){zt({'emitter':_0x20042e,'contextElements':[_0x20042e['element']],'callback':()=>{_0x20042e['hide'](),this['_config']['onBalloonClosed']();},'activator':()=>_0x20042e['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(_0x1f1054,_0x3b8bb3){super(_0x1f1054),this['bodyCollection']=_0x3b8bb3['bodyCollection'],this['_currentContextsChips']=this['createCollection'](),this['_conversationContextsChips']=this['createCollection'](),this['addContextButtonView']=this['_createAddContextButtonView'](_0x1f1054),this['_addContextBalloonPanelView']=this['_createAddContextBalloonPanelView'](_0x1f1054),this['_urlBalloonPanelView']=this['_createUrlBalloonPanelView'](_0x1f1054),this['_resourcesBalloonView']=this['_createResourcesBalloonView'](_0x1f1054,_0x3b8bb3);const _0x4daa5f={'cssClasses':{'showMoreButton':$r+'\x20'+us,'showMoreBalloon':qr,'overflowContainer':Yr,'controlsButton':Wr}};this['_overflowManager']=new Wn(_0x1f1054,this['_currentContextsChips'],_0x4daa5f,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'](_0x50fcb9,_0x3805c3){const _0x463198=this['_createContextButton'](_0x50fcb9,'current',!0x0,_0x3805c3);this['_addContextToCollection'](_0x463198,this['_currentContextsChips']),this['_overflowManager']['reorganizeChips']();}['removeContextItem'](_0x56c27d){this['_removeContextFromCollection'](_0x56c27d,this['_currentContextsChips']),this['_removeContextFromCollection'](_0x56c27d,this['_overflowManager']['overflowChips']),this['_overflowManager']['reorganizeChips']();}['setContextItemLoading'](_0x3f52da,_0x270c40){let _0xd014d3=this['_currentContextsChips']['find'](_0x4cde6d=>_0x4cde6d['id']===_0x3f52da);_0xd014d3||(_0xd014d3=this['_overflowManager']['overflowChips']['find'](_0x3cf3fc=>_0x3cf3fc['id']===_0x3f52da)),_0xd014d3&&(_0xd014d3['isLoading']=_0x270c40);}['setConversationContext'](_0x508692){this['_conversationContextsChips']['clear']();for(const _0x147e95 of _0x508692){const _0x58ef83=this['_createContextButton'](_0x147e95,'conversation',!0x1,!0x1);this['_addContextToCollection'](_0x58ef83,this['_conversationContextsChips']);}}['clearCurrentContextItems'](){this['_currentContextsChips']['clear'](),this['_overflowManager']['clear']();}['clearConversationContextItems'](){this['_conversationContextsChips']['clear']();}['updateResourceState'](_0x233d20,_0x16dcc9,_0xb335c5){this['_resourcesBalloonView']['updateResourceState'](_0x233d20,_0x16dcc9,_0xb335c5);}['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:_0xbd87ca,withBackButton:_0x14713e}){this['_resourcesBalloonView']['showSourceResourcesBalloon']({'source':_0xbd87ca,'withBackButton':_0x14713e}),this['addContextButtonView']['isOn']=!0x0;}['populateSourceResourceBalloon'](_0x2da8f6,_0x32fc65,_0xe4e1a,_0x22f7ae){this['_resourcesBalloonView']['populateSourceResourceBalloon'](_0x2da8f6,_0xe4e1a,_0x22f7ae);}['closeSourceResourceBalloon'](_0x1ae694){this['_resourcesBalloonView']['closeSourceResourceBalloon'](_0x1ae694),this['addContextButtonView']['isOn']=!0x1;}['setAddContextOptions'](_0x109d1e){this['_setBalloonPanelContent'](this['_addContextBalloonPanelView'],this['locale'],_0x109d1e),this['_setAddContextButtonEnabled'](_0x109d1e);}['_setAddContextButtonEnabled'](_0x4120cf){const _0x35a497=!_0x4120cf['document']['isHidden']&&_0x4120cf['document']['enabled'],_0x11b1b2=_0x4120cf['urls']['enabled'],_0x5528e4=_0x4120cf['files']['enabled'],_0x43c843=_0x4120cf['sources']['length']>0x0,_0x1e8dd8=_0x4120cf['customItems']&&_0x4120cf['customItems']['length']>0x0;this['addContextButtonView']['isEnabled']=_0x35a497||_0x11b1b2||_0x5528e4||_0x43c843||_0x1e8dd8;}['_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'](_0x33684e){const _0x780baa=new Nt(_0x33684e);return _0x780baa['set']({'label':hs(_0x33684e,'AI_CHAT_CONTEXT_ADD_CONTEXT'),'class':Wr+'\x20'+Br+'\x20'+us,'icon':_0x2a741b,'isToggleable':!0x0,'tooltip':!0x0,'tooltipPosition':'sw'}),_0x780baa;}['_createAddContextBalloonPanelView'](_0x36c293){return this['_createBaseBalloonPanel'](_0x36c293,Vr);}['_createUrlBalloonPanelView'](_0x19421f){const _0x5e7316=this['_createBaseBalloonPanel'](_0x19421f,Gr);return this['_addUrlContent'](_0x5e7316,_0x19421f),_0x5e7316;}['_createResourcesBalloonView'](_0x294bbe,_0x3069ad){const _0x5906d8={'searchInputVisibleFrom':_0x3069ad['searchInputVisibleFrom'],'onBackToContext':()=>{this['showAddContextBalloonPanel'](),this['_addContextBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':Xr});},'onResourceSelected':(_0x403639,_0xf24928)=>{this['fire']('addResourceToContext',{'source':_0x403639,'resource':_0xf24928});},'onLoadSourceResources':_0xf61038=>{this['fire']('loadSourceResources',_0xf61038);},'onBalloonClosed':()=>{this['addContextButtonView']['isOn']=!0x1;},'getLimiterElement':()=>this['_getLimiterElement'](),'getTargetElement':()=>this['addContextButtonView']['element']};return new Pr(_0x294bbe,_0x3069ad['bodyCollection'],_0x5906d8);}['_getLimiterElement'](){return this['element']?.['closest']('.'+Qr)||document['body'];}['_createBaseBalloonPanel'](_0x35228c,_0x3fd996){const _0x22c404=new Xt(_0x35228c);return _0x22c404['extendTemplate']({'attributes':{'class':_0x3fd996}}),this['bodyCollection']['add'](_0x22c404),_0x22c404;}['_setBalloonPanelContent'](_0x17f28b,_0x411aef,_0x461057){if(_0x17f28b['content']['clear'](),!_0x461057['document']['isHidden']&&_0x461057['document']['enabled']){const _0x2da5bb=this['_createBalloonButton'](_0x411aef,{'label':hs(_0x411aef,'AI_CHAT_CONTEXT_CURRENT_DOCUMENT'),'icon':_0x2c2579});_0x2da5bb['on']('execute',()=>{this['fire']('addDocumentToContext'),this['hideAddContextBalloonPanel']();}),_0x17f28b['content']['add'](_0x2da5bb);}if(_0x461057['urls']['enabled']){const _0x36d8c9=this['_createBalloonButton'](_0x411aef,{'label':hs(_0x411aef,'AI_CHAT_CONTEXT_URL_LABEL'),'icon':_0x289d5e});_0x36d8c9['on']('execute',()=>{this['hideAddContextBalloonPanel'](),this['showUrlBalloonPanel'](),this['_urlBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':Xr}),this['_urlInputView']['focus']();}),_0x17f28b['content']['add'](_0x36d8c9);}if(_0x461057['files']['enabled']){const _0x11798e=new _0x28782d(_0x411aef);_0x11798e['set']({'label':hs(_0x411aef,'AI_CHAT_CONTEXT_FILE_LABEL'),'icon':_0x58d7b2,'withText':!0x0,'tooltip':!0x0,'class':Fr,'allowMultipleFiles':!0x0}),_0x11798e['on']('execute',()=>{this['hideAddContextBalloonPanel']();}),_0x11798e['on']('done',(_0x3ca492,_0x46c9d8)=>{this['fire']('addFileToContext',_0x46c9d8);}),_0x11798e['tooltip']=!0x0,_0x17f28b['content']['add'](_0x11798e);}for(const _0x29d288 of _0x461057['sources']){const _0x2c4425=this['_createBalloonButton'](_0x411aef,{'label':_0x29d288['label'],'icon':_0x29d288['icon']||_0x548fb2,'type':'source'});_0x17f28b['content']['add'](_0x2c4425),_0x2c4425['on']('execute',()=>{this['hideAddContextBalloonPanel'](),this['_showSourceResourcesBalloon']({'source':_0x29d288,'withBackButton':!this['_hasExactlyOneSource']});});}for(const _0x10f18d of _0x461057['customItems']||[]){const _0x375476=this['_createBalloonButton'](_0x411aef,{'label':_0x10f18d['label'],'icon':_0x10f18d['icon']||_0x548fb2,'type':'customItem'});_0x17f28b['content']['add'](_0x375476),_0x375476['on']('execute',()=>{this['hideAddContextBalloonPanel'](),this['fire']('executeCustomItemCallback',_0x10f18d);});}this['_hasExactlyOneSource']=0x1===_0x17f28b['content']['length'],this['_urlInputView']['withBackButton']=!this['_hasExactlyOneSource'];}['_addUrlContent'](_0x406720,_0x1f3be2){this['_urlInputView']=new wr(_0x1f3be2),this['_urlInputView']['on']('submitUrl',(_0x39b45e,_0x1f7436)=>{this['_handleUrlSubmit'](_0x1f7436);}),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});}),_0x406720['content']['add'](this['_urlInputView']);}['_createBalloonButton'](_0x1cb67b,_0x5aea3a){const _0x23175f='source'===_0x5aea3a['type']?new jr(_0x1cb67b):new Nt(_0x1cb67b);return _0x23175f['set']({'label':_0x5aea3a['label'],'icon':_0x5aea3a['icon'],'withText':!0x0,'tooltip':!0x0,'tooltipPosition':'sw','class':Fr}),_0x23175f;}['_setupAllBalloonClickOutsideHandlers'](){this['_setupAddContextBalloonClickOutsideHandler'](),this['_setupUrlBalloonClickOutsideHandler']();}['_setupUrlBalloonClickOutsideHandler'](){zt({'emitter':this['_urlBalloonPanelView'],'contextElements':[this['_urlBalloonPanelView']['element']],'callback':()=>{this['hideUrlBalloonPanel']();},'activator':()=>this['_urlBalloonPanelView']['isVisible']});}['_toggleAddContextBalloon'](_0x572d3b){const _0x358334=this['_addContextBalloonConfig'];_0x358334['buttonView']['isOn']=_0x572d3b,_0x572d3b?_0x358334['balloonView']['show']():_0x358334['balloonView']['hide']();}['_setupAddContextBalloonClickOutsideHandler'](){const {balloonView:_0x536964,buttonView:_0xe23641,hideMethod:_0x2c92cf}=this['_addContextBalloonConfig'];zt({'emitter':_0x536964,'contextElements':[_0x536964['element'],_0xe23641['element']],'callback':()=>{_0x2c92cf();},'activator':()=>_0xe23641['isOn']&&!this['_urlBalloonPanelView']['isVisible']&&!this['_resourcesBalloonView']['isAnyResourceBalloonVisible']()});}['_createContextButton'](_0x4d1eab,_0x361709,_0x29693a=!0x1,_0x4fec77=!0x1){const _0x5c2d64='conversation'===_0x361709||!0x0===_0x4d1eab['isReadOnly'],_0x13b343=new Bn(this['locale'],_0x4d1eab,_0x5c2d64,_0x29693a,_0x4fec77);return _0x5c2d64||_0x13b343['on']('removeContextItemChip',()=>{this['fire']('removeContextItem',_0x13b343['id']);}),_0x13b343;}['_addContextToCollection'](_0x5b3b64,_0x5d22b1){_0x5d22b1['add'](_0x5b3b64,0x0);}['_removeContextFromCollection'](_0x32d8c1,_0x4bca70){const _0x5349cc=_0x4bca70['find'](_0x1a6c6b=>_0x1a6c6b['id']===_0x32d8c1);_0x5349cc&&_0x4bca70['remove'](_0x5349cc);}['_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'](_0x166eeb){this['_urlInputView']['clear'](),this['hideUrlBalloonPanel'](),this['fire']('addUrlToContext',_0x166eeb);}}class jr extends Nt{['arrowView'];constructor(_0x1cc02c){super(_0x1cc02c),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 _0x522509=new xt();return _0x522509['content']=_0x58875c,_0x522509['extendTemplate']({'attributes':{'class':Kr+'__arrow'}}),_0x522509;}}class Jr extends vt{['_cancelButtonView'];['_loaderView'];constructor(_0x581158){super(_0x581158),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 _0x48db43=new Nt(this['locale']);return _0x48db43['set']({'label':hs(this['locale'],'AI_CHAT_STOP_GENERATING'),'withText':!0x0,'class':ls+'\x20ck-ai-button-stop-generating','icon':_0x321021}),_0x48db43['on']('execute',()=>{this['fire']('abortPromptStream');}),_0x48db43;}['_createLoaderView'](){const _0x45dbb3=new vt(this['locale']);return _0x45dbb3['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')}]}),_0x45dbb3;}}class Zr extends vt{['_contextPanelView'];['_promptInputView'];['_promptCapabilitiesView'];['_loaderView'];['_modelUnavailableMessageView'];['_shouldRestorePromptInputFocus'];constructor(_0x4e2c78,_0xca2491){super(_0x4e2c78),this['_contextPanelView']=this['_createContextPanelView'](_0x4e2c78,{'bodyCollection':_0xca2491['bodyCollection'],'searchInputVisibleFrom':_0xca2491['contextResourcesSearchInputVisibleFrom']}),this['_promptInputView']=this['_createPromptInputView'](_0x4e2c78),this['_promptCapabilitiesView']=this['_createPromptCapabilitiesView'](_0x4e2c78),this['_loaderView']=this['_createLoaderView'](_0x4e2c78),this['_modelUnavailableMessageView']=this['_createModelUnavailableMessageView'](_0x4e2c78),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 _0x193b3f=this['bindTemplate'];this['setTemplate']({'tag':'form','attributes':{'class':['ck','ck-ai-chat-controls',_0x193b3f['if']('isDisabled','ck-ai-chat-controls-disabled')]},'children':[{'tag':'div','attributes':{'class':[_0x193b3f['if']('isLoading','ck-hidden',_0x2eb0dd=>_0x2eb0dd||!this['isModelAvailable']),_0x193b3f['if']('isModelAvailable','ck-hidden',_0x18a925=>!_0x18a925||this['isLoading'])]},'children':[this['_contextPanelView'],this['_promptInputView'],this['_promptCapabilitiesView']]},{'tag':'div','attributes':{'class':[_0x193b3f['if']('isLoading','ck-hidden',_0x2e2f30=>!_0x2e2f30)]},'children':[this['_loaderView']]},{'tag':'div','attributes':{'class':[_0x193b3f['if']('isModelAvailable','ck-hidden',_0x25bfd5=>_0x25bfd5)]},'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'](_0x3f72f6,_0x443053){return new zr(_0x3f72f6,_0x443053);}['_createPromptInputView'](_0x5dc9ff){return new hr(_0x5dc9ff,this['_contextPanelView']['addContextButtonView']);}['_createPromptCapabilitiesView'](_0x56b998){return new Er(_0x56b998);}['_createLoaderView'](_0x374142){return new Jr(_0x374142);}['_createModelUnavailableMessageView'](_0x5e2487){const _0x535633=new to(_0x5e2487);return _0x535633['delegate']('startConversation')['to'](this),_0x535633;}['_handlePromptInputFocus'](_0x3f2471,_0x180823,_0x4018c3){_0x4018c3?this['_shouldRestorePromptInputFocus']=!0x0:this['_shouldRestorePromptInputFocus']&&this['_promptInputView']['focus']();}['addContextItem'](_0x5c78d1,_0x6f45b6){this['_contextPanelView']['addContextItem'](_0x5c78d1,_0x6f45b6);}['removeContextItem'](_0x11bb3f){this['_contextPanelView']['removeContextItem'](_0x11bb3f);}['setContextItemLoading'](_0x892bba,_0x3fb99c){this['_contextPanelView']['setContextItemLoading'](_0x892bba,_0x3fb99c);}['setIsUploadInProgress'](_0x49b25f){this['_promptInputView']['setIsUploadInProgress'](_0x49b25f);}['setConversationContext'](_0x8f00d){this['_contextPanelView']['setConversationContext'](_0x8f00d);}['clearPendingContextUI'](){this['_contextPanelView']['clearCurrentContextItems']();}['clearConversationContextUI'](){this['_contextPanelView']['clearConversationContextItems']();}['updateResourceState'](_0x534e2c,_0x558ae4,_0x4f4934){this['_contextPanelView']['updateResourceState'](_0x534e2c,_0x558ae4,_0x4f4934);}['setWebSearch'](_0x251d6a){this['_promptCapabilitiesView']['setWebSearch'](_0x251d6a);}['setReasoning'](_0xf78dca){this['_promptCapabilitiesView']['setReasoning'](_0xf78dca);}['resetMessageInput'](){this['_promptInputView']['reset']();}['setAddContextOptions'](_0x15bb80){this['_contextPanelView']['setAddContextOptions'](_0x15bb80);}['setInputPlaceholder'](_0x5099a6){this['_promptInputView']['setPlaceholderText'](_0x5099a6);}['setModelList'](_0x402fcb,_0x130849){this['_promptCapabilitiesView']['setModelList'](_0x402fcb,_0x130849);}['setModel'](_0x263d6a){_0x263d6a?(this['isModelAvailable']=!0x0,this['_promptCapabilitiesView']['setModel'](_0x263d6a)):this['isModelAvailable']=!0x1;}['enableModelSelector'](){this['_promptCapabilitiesView']['enableModelSelector']();}['disableModelSelector'](_0x14ca3b){this['_promptCapabilitiesView']['disableModelSelector'](_0x14ca3b);}['populateSourceResourceBalloon'](_0x11c019,_0x42c210,_0x530f7e,_0x241b04){this['_contextPanelView']['populateSourceResourceBalloon'](_0x11c019,_0x42c210,_0x530f7e,_0x241b04);}['closeSourceResourceBalloon'](_0x4b2bf5){this['_contextPanelView']['closeSourceResourceBalloon'](_0x4b2bf5);}['focusPromptInput'](_0x40607f=!0x1){this['_promptInputView']['focus'](_0x40607f);}['setPromptInputValue'](_0x573cdf){this['_promptInputView']['queryView']['fieldView']['reset'](),this['_promptInputView']['queryView']['fieldView']['value']=_0x573cdf;}}class to extends vt{constructor(_0x794e70){super(_0x794e70);const _0x53ce18=new Nt(_0x794e70);_0x53ce18['set']({'label':hs(this['locale'],'AI_CHAT_MODEL_UNAVAILABLE_MESSAGE_BUTTON'),'withText':!0x0,'class':['ck-ai-chat-controls__start-new-chat-button'],'tooltip':''}),_0x53ce18['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'},_0x53ce18]}]});}}class eo extends _0x53b19c{['resizeButton'];constructor(_0x35a293,_0x24c1cb){super(_0x35a293,{'label':_0x24c1cb['label'],'class':'ck-ai-header\x20'+_0x24c1cb['class'],'icon':_0x24c1cb['icon']}),this['set']('isMaximized',!0x1),_0x24c1cb['content']&&this['children']['add'](_0x24c1cb['content']),_0x24c1cb['showResizeButton']&&(this['resizeButton']=ds(_0x35a293,this),this['children']['add'](this['resizeButton']));}}class io extends vt{constructor(_0x251967){super(_0x251967),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-disclaimer']},'children':[{'tag':'p','attributes':{'class':['ck','ck-ai-disclaimer__content']},'children':[{'text':hs(_0x251967,'AI_DISCLAIMER_TEXT')}]}]});}}function so(_0x4b87ba,_0x52b8e8){const _0x4b3531=new Nt(_0x4b87ba);return _0x4b3531['set']({'label':hs(_0x4b87ba,'AI_CHAT_LABEL_NEW_CHAT'),'withText':!0x0,'icon':_0x4ff6ca,'class':'ck-ai-chat__start-conversation\x20'+ls}),_0x4b3531['on']('execute',()=>{_0x52b8e8['fire']('startConversation');}),_0x4b3531;}class no extends vt{['chatHeader'];['chatFeed'];['chatControls'];['chatDisclaimer'];['_bodyCollection'];constructor(_0x40db94,_0x2c56e8){super(_0x40db94),this['_bodyCollection']=new Qt(_0x40db94),this['_bodyCollection']['attachToDom']();const _0x34fef8=so(_0x40db94,this);this['chatHeader']=new eo(_0x40db94,{'label':hs(_0x40db94,'AI_CHAT_HEADING'),'icon':_0xf586bd,'class':'ck-ai-header_chat','content':_0x34fef8,'showResizeButton':_0x2c56e8['showResizeButton']}),this['chatHeader']['delegate']('resizeTabs')['to'](this),this['chatFeed']=new rr(_0x40db94,this['_bodyCollection']),this['chatFeed']['delegate'](...tn)['to'](this),this['chatControls']=new Zr(_0x40db94,{'bodyCollection':this['_bodyCollection'],'contextResourcesSearchInputVisibleFrom':_0x2c56e8['contextResourcesSearchInputVisibleFrom']}),this['chatControls']['delegate'](...tn)['to'](this),this['chatDisclaimer']=new io(_0x40db94),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset_all','ck-ai-chat','ck-rounded-corners'],'dir':_0x40db94['uiLanguageDirection']},'children':[this['chatHeader'],this['chatFeed'],this['chatControls'],this['chatDisclaimer']]});}['populateSourceResourceBalloon'](_0x229779,_0x523eb3,_0x1bc376,_0x26f1c4){this['chatControls']['populateSourceResourceBalloon'](_0x229779,_0x523eb3,_0x1bc376,_0x26f1c4);}['closeSourceResourceBalloon'](_0x4aff6d){this['chatControls']['closeSourceResourceBalloon'](_0x4aff6d);}['destroy'](){this['_bodyCollection']['detachFromDom'](),super['destroy']();}}class ro extends _0xee6711{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(_0x1d411f){super(_0x1d411f);const _0x4c5977=this['context']['plugins']['get']('AITabs');this['set']('isBusy',!0x1),this['_promiseQueue']=new Cn(),this['_view']=new no(this['context']['locale'],{'showResizeButton':_0x4c5977['showResizeButton'],'contextResourcesSearchInputVisibleFrom':this['context']['config']['get']('ai.chat.context.searchInputVisibleFrom')}),this['_view']['delegate']('resizeTabs')['to'](_0x4c5977),this['_view']['delegate'](...tn)['to'](this),this['_view']['on']('toggleSuggestionDisplayMode',(_0x3b3a45,{showDiff:_0x43adad})=>{this['showDiff']=_0x43adad;}),_0x4c5977['view']['addTab']({'id':'chat','buttonLabel':hs(this['context']['locale'],'AI_CHAT_HEADING'),'buttonIcon':_0xf586bd,'order':0x0,'content':this['_view']}),this['_view']['chatHeader']['bind']('isMaximized')['to'](_0x4c5977['view'],'isMaximized',_0x582767=>_0x582767),this['_view']['chatControls']['bind']('isLoading')['to'](this,'isBusy',_0x12643e=>_0x12643e),this['_view']['chatControls']['setInputPlaceholder'](this['_getInputPlaceholder']()),this['bind']('isModelAvailable')['to'](this['_view']['chatControls'],'isModelAvailable');}['destroy'](){super['destroy'](),this['_titleAnimationInterval']&&clearInterval(this['_titleAnimationInterval']);}['createConversation'](_0x54e7c5){const _0x1d2b0c=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'](_0x54e7c5['availableModels'],!this['context']['config']['get']('ai.models.showModelSelector')),this['addFeedItemStaticMessage']({'id':'conversation-start','staticMessage':_0x1d2b0c}),this['fire']('conversationCreated');}async['addFeedItemStaticMessage']({id:_0x58749f,staticMessage:_0x552a2d}){return this['_promiseQueue']['enqueue'](async()=>{this['_view']['chatFeed']['addItem']('ai-reply',{'id':_0x58749f,'initialContent':'<p>'+_0x552a2d+'</p>'});});}async['addFeedItemUserMessage'](_0x5cdc59){const _0x22d7e0=_0x5cdc59['attributes']?.['displayedPrompt']||_0x5cdc59['userMessage'];return this['_promiseQueue']['enqueue'](async()=>{this['_view']['chatFeed']['addItem']('user-message',{'contextItems':Array['from'](_0x5cdc59['contextItems']['values']()),'initialContent':'<p>'+_0x22d7e0+'</p>','id':_0x5cdc59['id']});});}async['addFeedItemError']({errorMessage:_0x3af043,id:_0xcd9f94}){return this['_promiseQueue']['enqueue'](async()=>{this['_view']['chatFeed']['addItem']('error-message',{'initialContent':'<p>'+_0x3af043+'</p>','id':_0xcd9f94});});}async['addFeedItemAIReply'](_0x2b56b5){return this['_promiseQueue']['enqueue'](async()=>{this['_view']['chatFeed']['addItem']('ai-reply',{'id':_0x2b56b5['interactionId']+':'+_0x2b56b5['id']}),this['clearLoadingMessage']();});}async['addFeedItemAISuggestion'](_0x2cc526){const _0x3b4dc1=$s(this['context']);let _0x25aa32=_0x3b4dc1['config']['get']('ai.availableReplyActions')||[...fn];if(_0x3b4dc1['plugins']['has']('TrackChanges')){if(!this['_isTrackChangesCommandValueBound']){this['_isTrackChangesCommandValueBound']=!0x0;const _0x5adcac=_0x3b4dc1['commands']['get']('trackChanges');this['_view']['chatFeed']['bind']('isTrackChangesOn')['to'](_0x5adcac,'value');}}else _0x25aa32=_0x25aa32['filter'](_0x4fa5e7=>'insertSuggestion'!=_0x4fa5e7);return this['_promiseQueue']['enqueue'](async()=>{this['_view']['chatFeed']['addItem']('ai-suggestion-reply',{'id':_0x2cc526['interactionId']+':'+_0x2cc526['id'],'areActionsDisabled':_0x2cc526['areActionsDisabled'],'showDiff':this['showDiff'],'availableActions':_0x25aa32}),this['clearLoadingMessage']();});}async['addFeedInteractionHeader'](_0xf4b08a,_0xa35c62){return this['_promiseQueue']['enqueue'](async()=>{const _0x5ae700=this['_view']['chatFeed']['children']['last'];if(_0x5ae700 instanceof Zn)return this['_view']['chatFeed']['children']['remove'](_0x5ae700),void this['_view']['chatFeed']['addItem']('interaction-header',{'id':_0xf4b08a['id'],'capabilities':{'isWebSearchEnabled':_0x5ae700['capabilities']['isWebSearchEnabled']||_0xa35c62['isWebSearchEnabled'],'isReasoningEnabled':_0x5ae700['capabilities']['isReasoningEnabled']||_0xa35c62['isReasoningEnabled']}});this['_view']['chatFeed']['addItem']('interaction-header',{'id':_0xf4b08a['id'],'capabilities':_0xa35c62});});}async['addFeedItemCustomElement'](_0x2d7ff6,_0x7a3eab){let _0x1b2955;return await this['_promiseQueue']['enqueue'](async()=>{_0x1b2955=this['_view']['chatFeed']['addItem']('custom-element',{'content':_0x2d7ff6,'id':_0x7a3eab});}),_0x1b2955;}['removeFeedItem'](_0x536d7a){this['_view']['chatFeed']['removeItem'](_0x536d7a);}['hasFeedItem'](_0x41417f){return this['_view']['chatFeed']['hasItem'](_0x41417f);}['updateFeedInteractionHeader'](_0xee0524){const _0x307bae=this['_view']['chatFeed']['children']['find'](_0x26629b=>_0x26629b['options']['id']==_0xee0524['id']&&_0x26629b instanceof Zn);_0x307bae&&_0x307bae['set']('isVisible',_0xee0524['isVisible']);}async['updateFeedItemAIReplyContent'](_0x33aa6c){const _0x52ddc9=_0x33aa6c['renderingStrategy']||this['feedItemRenderingStrategy'];return this['_promiseQueue']['enqueue'](async _0x4795b6=>{await this['_view']['chatFeed']['updateReplyItem']({..._0x33aa6c,'abortSignal':_0x4795b6,'renderingStrategy':_0x52ddc9}),_0x33aa6c['isDone']&&this['markFeedItemAsDone'](_0x33aa6c['id']);});}['updateFeedItemAIReplySources'](_0x5e1576,_0x5a10c4){this['_view']['chatFeed']['updateWebSources'](_0x5e1576,_0x5a10c4);}async['updateFeedItemAIReplySuggestionContent'](_0x491527){return this['_promiseQueue']['enqueue'](async _0x37c77c=>{await this['_view']['chatFeed']['updateSuggestionItem']({..._0x491527,'abortSignal':_0x37c77c}),_0x491527['isDone']&&this['markFeedItemAsDone'](_0x491527['id']);});}['updateFeedItemAIReplySuggestionPartState'](_0x91bd7){this['_view']['chatFeed']['updateSuggestionPartState'](_0x91bd7);}['setFeedItemAIReplySuggestionPartActive'](_0x522d69){this['_view']['chatFeed']['setSuggestionPartActive'](_0x522d69);}['markFeedItemAsDone'](_0x5bb8ce){this['_view']['chatFeed']['markItemAsDone'](_0x5bb8ce);}['removeFeedInteraction'](_0x28d5fa){this['_view']['chatFeed']['getItemIds']()['filter'](_0x5b3458=>_0x5b3458['startsWith'](_0x28d5fa))['forEach'](_0x26a58d=>this['_view']['chatFeed']['removeItem'](_0x26a58d));}['startInteraction'](){const _0x3da932=this['prepareLoadingMessage']({'isWebSearchEnabled':!0x1,'isReasoningEnabled':!0x1});this['setLoadingMessage'](_0x3da932),this['_view']['chatControls']['disableModelSelector'](!this['context']['config']['get']('ai.models.showModelSelector')),this['isBusy']=!0x0,this['_view']['chatFeed']['startAutoScroll']();}['stopInteraction'](_0x5c0b36){this['_promiseQueue']['abort'](),this['_view']['chatFeed']['getItemIds']()['filter'](_0x1994e4=>_0x1994e4['startsWith'](_0x5c0b36['id']))['forEach'](_0x38df96=>this['markFeedItemAsDone'](_0x38df96)),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'](_0x352947,_0x46b357){this['_view']['chatControls']['addContextItem'](_0x352947,_0x46b357);}['removeContextItem'](_0xfc1a6f){this['_view']['chatControls']['removeContextItem'](_0xfc1a6f);}['setContextItemLoading'](_0x45f01d,_0x5171a4){this['_view']['chatControls']['setContextItemLoading'](_0x45f01d,_0x5171a4);}['setIsUploadInProgress'](_0x242a89){this['_view']['chatControls']['setIsUploadInProgress'](_0x242a89);}['setConversationContext'](_0x2c620b){this['_view']['chatControls']['setConversationContext'](_0x2c620b);}['clearPendingContextUI'](){this['_view']['chatControls']['clearPendingContextUI']();}['clearConversationContextUI'](){this['_view']['chatControls']['clearConversationContextUI']();}['updateResourceState'](_0x51331d,_0x425df1,_0x189df8){this['_view']['chatControls']['updateResourceState'](_0x51331d,_0x425df1,_0x189df8);}['resetMessageInput'](){this['_view']['chatControls']['resetMessageInput'](),this['_view']['chatControls']['setInputPlaceholder'](this['_getInputPlaceholder']());}['setAddContextOptions'](_0x4ff22a){this['_view']['chatControls']['setAddContextOptions'](_0x4ff22a);}['updateCapabilities'](_0x4a5aa5){this['_view']['chatControls']['setWebSearch'](_0x4a5aa5['isWebSearchEnabled']),this['_view']['chatControls']['setReasoning'](_0x4a5aa5['isReasoningEnabled']),this['_view']['chatControls']['setInputPlaceholder'](this['_getInputPlaceholder'](_0x4a5aa5));}['setSelectedModel'](_0x2e6cbc,_0x3cb9d4){this['_view']['chatControls']['setModel'](_0x2e6cbc),_0x3cb9d4&&this['_view']['chatControls']['disableModelSelector'](!0x1);}['setFeedItemRenderingStrategy'](_0x48bd8f){this['feedItemRenderingStrategy']=_0x48bd8f;}['toggleLoadingSkeleton'](_0x446601){this['_view']['chatFeed']['toggleLoadingSkeleton'](_0x446601);}['resetConversationTitle'](){this['setConversationTitle'](hs(this['context']['locale'],'AI_CHAT_HEADING'));}['setConversationTitle'](_0x44f9e2,_0x1dc52c=!0x1){if(_0x1dc52c&&!St()&&_0x44f9e2['length'])return this['_view']['chatHeader']['label']='',void this['_animateConversationTitle'](_0x44f9e2);this['_view']['chatHeader']['label']=_0x44f9e2;}['setLoadingMessage'](_0x2e8596){this['_view']['chatFeed']['setLoadingMessage'](_0x2e8596);}['clearLoadingMessage'](){this['_view']['chatFeed']['setLoadingMessage']('');}['_animateConversationTitle'](_0x322af1){let _0x28d728=0x0;clearInterval(this['_titleAnimationInterval']),this['_titleAnimationInterval']=setInterval(()=>{this['_view']['chatHeader']['label']=this['_view']['chatHeader']['label']+_0x322af1[_0x28d728],_0x28d728++,_0x28d728===_0x322af1['length']&&clearInterval(this['_titleAnimationInterval']);},0x1e);}['prepareLoadingMessage'](_0x27a932){return _0x27a932['isWebSearchEnabled']&&_0x27a932['isReasoningEnabled']?hs(this['context']['locale'],'AI_CHAT_FEED_LOADING_MESSAGE_WEBSEARCH_REASONING'):_0x27a932['isWebSearchEnabled']?hs(this['context']['locale'],'AI_CHAT_FEED_LOADING_MESSAGE_WEBSEARCH'):_0x27a932['isReasoningEnabled']?hs(this['context']['locale'],'AI_CHAT_FEED_LOADING_MESSAGE_REASONING'):hs(this['context']['locale'],'AI_CHAT_FEED_LOADING_MESSAGE_REGULAR');}['_getInputPlaceholder'](_0x196bb7){return _0x196bb7?_0x196bb7['isWebSearchEnabled']&&_0x196bb7['isReasoningEnabled']?hs(this['context']['locale'],'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_WEBSEARCH_REASONING'):_0x196bb7['isWebSearchEnabled']?hs(this['context']['locale'],'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_WEBSEARCH'):_0x196bb7['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'](_0x262ea9,_0x46119e,_0x449709,_0x4a3754){this['_view']['populateSourceResourceBalloon'](_0x262ea9,_0x46119e,_0x449709,_0x4a3754);}['closeSourceResourceBalloon'](_0x173c26){this['_view']['closeSourceResourceBalloon'](_0x173c26);}['setPromptInputValue'](_0xdb774f){this['_view']['chatControls']['setPromptInputValue'](_0xdb774f);}['focusPromptInput'](_0x2a6568=!0x1){this['_view']['chatControls']['focusPromptInput'](_0x2a6568);}['scrollFeedToSuggestion'](_0x592a0d,_0x50863e){this['_view']['chatFeed']['scrollToSuggestion'](_0x592a0d,_0x50863e);}['startAutoScroll'](_0x53ccfb={}){this['_view']['chatFeed']['startAutoScroll'](_0x53ccfb);}['disableControls'](){this['_view']['chatControls']['isDisabled']=!0x0;}['enableControls'](){this['_view']['chatControls']['isDisabled']=!0x1;}}class oo extends Dt{['sections'];constructor(_0x3ad3ee,_0xe2d291){super(_0x3ad3ee),this['sections']=_0xe2d291,this['items']['addMany'](this['sections']),this['extendTemplate']({'attributes':{'class':['ck-ai-chat-history__sections']}});}['filter'](_0x58f848){let _0x30acbb=0x0,_0x2fb9a3=0x0;for(const _0x400da2 of this['sections']){const {resultsCount:_0x3df63b,totalItemsCount:_0x227ec5}=_0x400da2['filter'](_0x58f848);_0x30acbb+=_0x3df63b,_0x2fb9a3+=_0x227ec5;}return{'resultsCount':_0x30acbb,'totalItemsCount':_0x2fb9a3};}}class ao extends Ht{['title'];['itemsViews'];['_itemsListView'];constructor(_0x45ce19,{title:_0x28b16d,items:_0x513034}){super(_0x45ce19);const _0x2be89e=this['bindTemplate'];this['set']('isVisible',!0x0),this['title']=_0x28b16d,this['itemsViews']=_0x513034;const _0x4de3dd=new vt(_0x45ce19);_0x4de3dd['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-chat-history__section-title']},'children':[this['title']]}),this['_itemsListView']=new Dt(_0x45ce19),this['_itemsListView']['items']['addMany'](this['itemsViews']),this['setTemplate']({'tag':'li','attributes':{'class':['ck-ai-chat-history__section',_0x2be89e['if']('isVisible','ck-hidden',_0x31092e=>!_0x31092e)]},'children':[_0x4de3dd,this['_itemsListView']]});}['filter'](_0x1804c7){const _0x5bf416=this['itemsViews']['length'];let _0x145fdd=0x0;for(const _0x55c2c8 of this['itemsViews']){if(_0x1804c7){const _0x3a2380=_0x55c2c8['isMatching'](_0x1804c7);_0x55c2c8['isVisible']=!!_0x3a2380,_0x55c2c8['highlightText'](_0x1804c7);}else _0x55c2c8['isVisible']=!0x0,_0x55c2c8['highlightText'](null);_0x55c2c8['isVisible']&&_0x145fdd++;}return this['isVisible']=_0x145fdd>0x0,{'resultsCount':_0x145fdd,'totalItemsCount':_0x5bf416};}['getItem'](_0x34c620){return this['itemsViews']['find'](_0x209a55=>_0x209a55['id']===_0x34c620);}['removeItem'](_0x4a4542){const _0x41691f=this['itemsViews']['indexOf'](_0x4a4542);-0x1!==_0x41691f&&(this['itemsViews']['splice'](_0x41691f,0x1),this['_itemsListView']['items']['remove'](_0x4a4542));}}class ho extends/* #__PURE__ -- @preserve */
27
+ _0x47b513(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(_0xccfedf,_0x37d619){super(_0xccfedf);const _0x23701d=this['bindTemplate'];this['set']('isEdit',!0x1),this['set']('isVisible',!0x0),this['set']('pinned',!!_0x37d619['pinned']),this['set']('loadingState',null),this['set']('title',_0x37d619['title']),this['id']=_0x37d619['id'];const {createdAt:_0x11e15c,active:_0x2a9a47=!0x1}=_0x37d619;this['_titleView']=new _0x2a3dc2(),this['_titleView']['bind']('text')['to'](this,'title',t=>_0x28ca45(t||'')),this['_titleView']['extendTemplate']({'attributes':{'class':['ck-ai-chat-history__item-title']}});const _0x548133=this['_createCheckView'](),_0x591c5a=this['_createPinButtonView'](_0xccfedf),_0x150fa8=this['_createMenuDropdownView'](),_0x462d48=this['_createEditInputView'](_0xccfedf),_0x1a556a=this['_createAcceptEditButtonView'](_0xccfedf,_0x462d48),_0x223dfb=this['_createCancelEditButtonView'](_0xccfedf);this['actions']=this['createCollection'](),this['mainContent']=this['createCollection'](),this['mainContent']['add'](this['_titleView']),this['actions']['add'](_0x591c5a),this['actions']['add'](_0x150fa8),this['on']('change:isEdit',(_0x2be93d,_0x1f9e2f,_0x5b3b9a)=>{this['actions']['clear'](),this['mainContent']['clear'](),_0x5b3b9a?(this['actions']['add'](_0x1a556a),this['actions']['add'](_0x223dfb),this['mainContent']['add'](_0x462d48),_0x462d48['element']['value']=this['title']||'',_0x462d48['element']['focus']()):(this['actions']['add'](_0x591c5a),this['actions']['add'](_0x150fa8),this['mainContent']['add'](this['_titleView']));}),this['setTemplate']({'tag':'li','attributes':{'class':['ck-ai-chat-history__item',_0x2a9a47?'ck-ai-chat-history__item--active':'',_0x23701d['if']('isVisible','ck-hidden',_0x45b8f8=>!_0x45b8f8),_0x23701d['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',_0x23701d['if']('loadingState','ck-hidden',_0x2cb2a1=>!!_0x2cb2a1)]},'children':_0x2a9a47?[_0x548133]:[]},{'tag':'div','attributes':{'class':['ck-ai-loader',_0x23701d['if']('loadingState','ck-hidden',_0x34e927=>!_0x34e927)]},'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',_0x23701d['if']('loadingState','ck-hidden',_0x3a4de=>!!_0x3a4de)]},'children':this['mainContent']},{'tag':'div','attributes':{'class':['ck-ai-loader__text',_0x23701d['if']('loadingState','ck-hidden',_0x16cbb=>!_0x16cbb)]},'children':[{'text':_0x23701d['to']('loadingState',_0x141fb3=>_0x141fb3?hs(this['locale'],ho['LOADING_LABELS'][_0x141fb3]):'')}]}]},{'tag':'span','attributes':{'class':['ck-ai-chat-history__item-date']},'children':[_0x11e15c]}]},{'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'](_0x2c2a80){this['set']('title',_0x2c2a80);}['updateLoadingState'](_0x2b34d0,_0x325e1b){this['set']('loadingState',_0x325e1b?_0x2b34d0:null);}['_createCheckView'](){const _0x48980b=new xt();return _0x48980b['set']({'content':_0x2dfde3}),_0x48980b;}['_createPinButtonView'](_0x413cb4){const _0x24df54=new Nt(_0x413cb4);return _0x24df54['set']({'label':hs(_0x413cb4,'AI_CHAT_HISTORY_PIN_BUTTON'),'icon':_0x2208db,'withText':!0x1,'tooltip':!0x0}),_0x24df54['bind']('isOn')['to'](this,'pinned'),_0x24df54['on']('execute',()=>{const _0x11efee=!this['pinned'];this['fire']('setConversationPinned',{'id':this['id'],'pinned':_0x11efee});}),_0x24df54;}['_createMenuDropdownView'](){const _0x8bb173=Gt(this['locale']),_0x4f4cab=_0x8bb173['panelView']['children'];_0x8bb173['buttonView']['set']({'label':hs(this['locale'],'AI_CHAT_HISTORY_SHOW_MORE_ITEMS'),'icon':_0x54c890}),_0x8bb173['panelPosition']='sw';const _0x16f51e=new Nt(this['locale']);_0x16f51e['label']=hs(this['locale'],'AI_CHAT_HISTORY_EDIT_NAME'),_0x16f51e['withText']=!0x0,_0x16f51e['on']('execute',()=>{this['isEdit']=!0x0;});const _0x7614aa=new Nt(this['locale']);_0x7614aa['label']=hs(this['locale'],'AI_CHAT_HISTORY_REMOVE'),_0x7614aa['withText']=!0x0,_0x7614aa['on']('execute',()=>{this['showConfirm'](hs(this['locale'],'AI_CHAT_HISTORY_REMOVE_CONFIRM'),this['element'])['then'](()=>{this['fire']('removeConversation',{'id':this['id']});});});const _0x541606=new Dt(this['locale']),_0x58daa6=new Ht(this['locale']);_0x58daa6['children']['add'](_0x16f51e);const _0x135d86=new Ht(this['locale']);return _0x135d86['children']['add'](_0x7614aa),_0x541606['items']['addMany']([_0x58daa6,_0x135d86]),_0x4f4cab['add'](_0x541606),_0x8bb173;}['_createEditInputView'](_0x23e631){const _0x678993=new _0x185b23(_0x23e631),_0x584870=_0x678993['bindTemplate'];return _0x678993['extendTemplate']({'on':{'keydown':_0x584870['to'](_0x421b2a=>{'Enter'==_0x421b2a['key']&&this['_commitEditInputValue'](_0x678993);})}}),_0x678993;}['_createAcceptEditButtonView'](_0x1c9a6c,_0x432f7c){const _0x58c815=new Nt(_0x1c9a6c);return _0x58c815['set']({'icon':_0x2dfde3,'withText':!0x1,'tooltip':hs(_0x1c9a6c,'AI_CHAT_HISTORY_ACCEPT')}),_0x58c815['extendTemplate']({'attributes':{'class':['ck-confirm-view-submit']}}),_0x58c815['on']('execute',()=>{this['_commitEditInputValue'](_0x432f7c);}),_0x58c815;}['_commitEditInputValue'](_0x295787){const _0x32f785=_0x295787['element']['value']||'';this['isEdit']=!0x1,this['fire']('editConversationTitle',{'id':this['id'],'title':_0x32f785});}['_createCancelEditButtonView'](_0x2bf4f5){const _0x5367a9=new Nt(_0x2bf4f5);return _0x5367a9['set']({'icon':_0x1a0f5,'withText':!0x1,'tooltip':hs(_0x2bf4f5,'AI_CHAT_HISTORY_CANCEL')}),_0x5367a9['extendTemplate']({'attributes':{'class':['ck-confirm-view-cancel']}}),_0x5367a9['on']('execute',()=>{this['isEdit']=!0x1,this['fire']('edit:cancel');}),_0x5367a9;}['_createSpinnerView'](){const _0xadf75f=new yn('tiny');return _0xadf75f['isVisible']=!0x0,_0xadf75f;}['isMatching'](_0x263b73){return'string'==typeof this['title']&&this['title']['match'](_0x263b73)?{'title':!0x0}:null;}['highlightText'](_0x386b69){this['_titleView']['highlightText'](_0x386b69);}}class co extends vt{['headerView'];['searchView'];['mainErrorView'];['skeletonView'];['emptyView'];['sectionsView'];constructor(_0x415e71,_0x445ff2){super(_0x415e71),this['set']('hasItems',!0x1),this['set']('isLoading',!0x0),this['set']('errorMessage',''),this['set']('isSearchViewVisible',!0x1),this['set']('isEmptyViewVisible',!0x1),this['set']('isMainErrorViewVisible',!0x1);const _0x5b506d=so(_0x415e71,this);this['headerView']=new eo(_0x415e71,{'label':hs(_0x415e71,'AI_CHAT_HISTORY_HEADING'),'icon':_0x154a8a,'class':'ck-ai-header_history','content':_0x5b506d,'showResizeButton':_0x445ff2}),this['headerView']['delegate']('resizeTabs')['to'](this),this['sectionsView']=new oo(_0x415e71,[]),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',_0x1748ec=>!_0x1748ec)]}}),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 _0x2063bd=new _0x43e87c(this['locale'],{'filteredView':this['sectionsView'],'queryView':{'label':hs(this['locale'],'AI_CHAT_HISTORY_SEARCH_LABEL')},'infoView':{'text':{'notFound':{'primary':_0x5402ff=>hs(this['locale'],'AI_CHAT_HISTORY_SEARCH_NOT_FOUND_PRIMARY',_0x5402ff),'secondary':hs(this['locale'],'AI_CHAT_HISTORY_SEARCH_NOT_FOUND_SECONDARY')}}}}),_0x190868=this['_createErrorView']();return _0x190868['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('errorMessage','ck-hidden',_0x20a3ee=>!_0x20a3ee)]}}),_0x2063bd['on']('render',()=>{_0x2063bd['children']['add'](_0x190868,0x1);}),_0x2063bd['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isSearchViewVisible','ck-hidden',_0x1bc9a5=>!_0x1bc9a5)]}}),_0x2063bd;}['_createSkeletonView'](){const _0x28e61e=new pn(this['locale'],mn['aiHistory']);return _0x28e61e['bind']('isVisible')['to'](this,'isLoading'),_0x28e61e;}['_createErrorView'](){const _0x5932fb=new vt(this['locale']),_0x585cc2=new Nt(this['locale']);_0x585cc2['set']({'withText':!0x1,'icon':_0x1a0f5,'class':'ck-ai-notification_error__dismiss-button'}),_0x585cc2['bind']('isVisible')['to'](this,'hasItems',_0x26be0c=>!!_0x26be0c),_0x585cc2['on']('execute',()=>{this['errorMessage']='';});const _0x467a0c=this['bindTemplate'];return _0x5932fb['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-notification','ck-ai-notification_error']},'children':[{'tag':'p','children':[{'text':_0x467a0c['to']('errorMessage')}]},_0x585cc2]}),_0x5932fb;}['_createEmptyStateView'](){const _0x2903ef=new vt(this['locale']);return _0x2903ef['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-chat-history__empty',this['bindTemplate']['if']('isEmptyViewVisible','ck-hidden',_0xdd3bc6=>!_0xdd3bc6)]},'children':[{'tag':'p','attributes':{'class':['ck-ai-chat-history__empty-message']},'children':[hs(this['locale'],'AI_CHAT_HISTORY_EMPTY_MESSAGE')]}]}),_0x2903ef;}['_createListItemViews'](_0x132a0e,_0x39c527){const _0x4d7430=[];for(const _0x3103ba of _0x132a0e){const _0x160209=new ho(_0x39c527,_0x3103ba);_0x160209['delegate'](...lo)['to'](this),_0x4d7430['push'](_0x160209);}return _0x4d7430;}['updateHistoryItemsWithCategories'](_0x82f929){const _0x53b767=this['locale']||'en',_0x24917a=[];for(const _0x19e9b2 of _0x82f929){const _0x4e3d54=this['_createListItemViews'](_0x19e9b2['items'],_0x53b767);_0x24917a['push'](new ao(_0x53b767,{'title':_0x19e9b2['title'],'items':_0x4e3d54}));}this['sectionsView']['sections']=_0x24917a,this['sectionsView']['items']['clear'](),this['sectionsView']['items']['addMany'](_0x24917a),this['hasItems']=_0x82f929['some'](_0x4146ed=>_0x4146ed['items']['length']>0x0),this['_refreshSearch']();}['removeHistoryItem'](_0x1b6432){for(const _0x264833 of this['sectionsView']['sections']){const _0x290bf3=_0x264833['getItem'](_0x1b6432);if(_0x290bf3){if(_0x264833['removeItem'](_0x290bf3),0x0===_0x264833['itemsViews']['length']){const _0x5c328b=this['sectionsView']['sections']['indexOf'](_0x264833);-0x1!==_0x5c328b&&(this['sectionsView']['sections']['splice'](_0x5c328b,0x1),this['sectionsView']['items']['remove'](_0x264833));}this['hasItems']=this['sectionsView']['sections']['length']>0x0,this['_refreshSearch']();break;}}}['updateItemTitle'](_0x3cbe27,_0x2d66c4){for(const _0x115365 of this['sectionsView']['sections']){const _0xa89939=_0x115365['getItem'](_0x3cbe27);if(_0xa89939){_0xa89939['updateTitle'](_0x2d66c4);break;}}}['updateItemLoadingState'](_0x2a311e,_0x4c5004,_0x3ad97b){for(const _0x26d3c9 of this['sectionsView']['sections']){const _0x2bb944=_0x26d3c9['getItem'](_0x2a311e);if(_0x2bb944){_0x2bb944['updateLoadingState'](_0x4c5004,_0x3ad97b);break;}}}['_refreshSearch'](){if(this['hasItems']){const _0xaea6c8=this['searchView']['queryView']['fieldView']?.['element']?.['value']||'';this['searchView']['search'](_0xaea6c8);}}}const lo=['showConversationHistory','removeConversation','editConversationTitle','setConversationPinned','selectConversation','startConversation'];class uo extends _0xee6711{static get['requires'](){return[os];}['_historyView'];static get['pluginName'](){return'AIChatHistoryUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x5b16cd){super(_0x5b16cd);const _0xa5c1a4=this['context']['plugins']['get']('AITabs');this['_historyView']=new co(this['context']['locale'],_0xa5c1a4['showResizeButton']),this['_historyView']['delegate']('resizeTabs')['to'](_0xa5c1a4),this['_historyView']['delegate'](...lo)['to'](this),this['_historyView']['headerView']['bind']('isMaximized')['to'](_0xa5c1a4['view'],'isMaximized',_0x5206a6=>_0x5206a6),_0xa5c1a4['view']['addTab']({'id':'history','buttonLabel':hs(this['context']['locale'],'AI_CHAT_HISTORY_HEADING'),'buttonIcon':_0x154a8a,'order':0x0,'content':this['_historyView']});}['removeHistoryItem'](_0x5b630c){this['_historyView']['removeHistoryItem'](_0x5b630c);}['updateItems'](_0x25cd82){this['_historyView']['updateHistoryItemsWithCategories'](_0x25cd82);}['updateItemTitle'](_0x2af04e,_0x281992){this['_historyView']['updateItemTitle'](_0x2af04e,_0x281992);}['updateItemLoadingState'](_0x2b7f83,_0x1043d6,_0x400d66){this['_historyView']['updateItemLoadingState'](_0x2b7f83,_0x1043d6,_0x400d66);}['setLoadingSkeleton'](_0x2c8106){this['_historyView']['isLoading']=_0x2c8106;}['showError'](_0x4fba4b){this['_historyView']['errorMessage']=_0x4fba4b;}['hideError'](){this['_historyView']['errorMessage']='';}}class _o extends ht(){['id'];['createdAt'];constructor({id:_0x3ebe78,title:_0x97d77,createdAt:_0x49792d,updatedAt:_0x3a5b32,pinned:_0x3d056f}){super(),this['id']=_0x3ebe78,this['createdAt']=new Date(_0x49792d),this['set']('title',_0x97d77),this['set']('updatedAt',_0x3a5b32?new Date(_0x3a5b32):null),this['set']('pinned',_0x3d056f||!0x1);}['updateTitle'](_0x3f1754){this['set']('title',_0x3f1754),this['updatedAt']=new Date();}['updatePinned'](_0x52eecc){this['set']('pinned',_0x52eecc),this['updatedAt']=new Date();}}class go extends Tt(){['items']=[];['connector'];['group'];constructor({connector:_0x3998ad,group:_0x26517f}){super(),this['connector']=_0x3998ad,this['group']=_0x26517f;}async['init'](){try{const _0x15c8c5=this['connector']['fetchConversations'](this['group']),_0x2c4476=await _0x15c8c5['getConversations']();this['loadItems'](_0x2c4476);}catch(_0x3b1031){this['fire']('error',{'error':_0x3b1031,'operation':'init'});}}['addItem'](_0x19dbe6){this['items']['push'](_0x19dbe6);}async['removeItem'](_0x3c5afb){const _0x2bca49=this['items']['findIndex'](_0x1b224d=>_0x1b224d['id']===_0x3c5afb);if(-0x1===_0x2bca49)return!0x1;try{return await this['connector']['deleteConversation'](_0x3c5afb)['execute'](),this['items']['splice'](_0x2bca49,0x1),this['fire']('itemRemoved',{'itemId':_0x3c5afb}),!0x0;}catch(_0x412621){return this['fire']('error',{'error':_0x412621,'operation':'removeItem','itemId':_0x3c5afb}),!0x1;}}['getItem'](_0x23e349){return this['items']['find'](_0x3a12a8=>_0x3a12a8['id']===_0x23e349);}async['updateItemTitle'](_0x20b3b7,_0x171ab2){const _0x584d16=this['getItem'](_0x20b3b7);if(!_0x584d16)return!0x1;try{return await this['connector']['updateConversation'](_0x20b3b7,{'title':_0x171ab2})['getResult'](),_0x584d16['updateTitle'](_0x171ab2),this['fire']('itemUpdated',{'itemId':_0x20b3b7,'updates':{'title':_0x171ab2}}),!0x0;}catch(_0x13b50e){return this['fire']('error',{'error':_0x13b50e,'operation':'updateItemTitle','itemId':_0x20b3b7}),!0x1;}}async['updateItemPinned'](_0x8e061,_0x4533ea){const _0x3d602c=this['getItem'](_0x8e061);if(!_0x3d602c)return!0x1;try{return await this['connector']['updateConversation'](_0x8e061,{'pinned':_0x4533ea})['getResult'](),_0x3d602c['updatePinned'](_0x4533ea),this['fire']('itemUpdated',{'itemId':_0x8e061,'updates':{'pinned':_0x4533ea}}),!0x0;}catch(_0x25982f){return this['fire']('error',{'error':_0x25982f,'operation':'updateItemPinned','itemId':_0x8e061}),!0x1;}}['loadItems'](_0x42f235){try{this['items']=[],_0x42f235['map'](_0x29811c=>{this['addItem'](new _o(_0x29811c));}),this['fire']('itemsLoaded',{'items':[...this['items']]});}catch(_0x45beaf){this['fire']('error',{'error':_0x45beaf,'operation':'loadItems'});}}['getItems'](_0x4b80da={}){const _0x2f15e7=void 0x0!==_0x4b80da['pinned']&&_0x4b80da['pinned'],_0x126e28=_0x4b80da['from']?new Date(_0x4b80da['from']['getFullYear'](),_0x4b80da['from']['getMonth'](),_0x4b80da['from']['getDate']()):null,_0x46bda6=_0x4b80da['to']?new Date(_0x4b80da['to']['getFullYear'](),_0x4b80da['to']['getMonth'](),_0x4b80da['to']['getDate']()):null;return this['items']['filter'](_0x35bd1a=>{if(_0x35bd1a['pinned']!==_0x2f15e7)return!0x1;if(_0x46bda6){const _0x4e0364=new Date(_0x35bd1a['createdAt']['getFullYear'](),_0x35bd1a['createdAt']['getMonth'](),_0x35bd1a['createdAt']['getDate']());return _0x126e28?_0x126e28['getTime']()===_0x46bda6['getTime']()?_0x4e0364['getTime']()===_0x126e28['getTime']():_0x4e0364<_0x46bda6&&_0x4e0364>=_0x126e28:_0x4e0364<_0x46bda6;}return!0x0;});}}class Ao extends _0xee6711{['_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 _0x289fe5=this['context']['plugins']['get'](os);try{const _0x38a171=this['_aiChatController']['getGroupId']();this['history']=new go({'connector':this['_aiConnector'],'group':_0x38a171}),this['listenTo'](this['_aiChatHistoryUi'],'removeConversation',(_0x46fe52,_0x371d95)=>{this['_setItemLoading'](_0x371d95['id'],'remove'),this['_handleRemove'](_0x371d95['id']);}),this['listenTo'](this['_aiChatHistoryUi'],'editConversationTitle',(_0x3a46e6,_0x4a6d75)=>{this['_setItemLoading'](_0x4a6d75['id'],'rename'),this['_handleEditTitle'](_0x4a6d75['id'],_0x4a6d75['title']);}),this['listenTo'](this['history'],'itemUpdated',(_0x266d5c,_0x5ad675)=>{void 0x0!==_0x5ad675['updates']['title']&&this['_aiChatHistoryUi']['updateItemTitle'](_0x5ad675['itemId'],_0x5ad675['updates']['title']),void 0x0!==_0x5ad675['updates']['pinned']&&this['_updateHistoryItemsUI'](),this['_clearItemLoading'](_0x5ad675['itemId']);}),this['listenTo'](this['history'],'itemRemoved',(_0x18218d,_0x1e7245)=>{this['_aiChatController']['_handleRemovedConversation'](_0x1e7245['itemId']),this['_aiChatHistoryUi']['removeHistoryItem'](_0x1e7245['itemId']),this['_clearItemLoading'](_0x1e7245['itemId']);}),this['listenTo'](this['history'],'itemsLoaded',()=>{this['_updateHistoryItemsUI']();}),this['listenTo'](this['history'],'error',(_0xae5b28,_0x4df136)=>{this['_handleHistoryErrorUI'](_0x4df136['error'],_0x4df136['operation'],_0x4df136['itemId']);}),this['listenTo'](this['_aiChatHistoryUi'],'selectConversation',(_0x3c9d58,_0x3e878e)=>{this['_handleSelectConversation'](_0x3e878e['id']);}),this['listenTo'](this['_aiChatHistoryUi'],'setConversationPinned',(_0x488311,_0x50854e)=>{const _0x44a5f2=_0x50854e['pinned']?'pin':'unpin';this['_setItemLoading'](_0x50854e['id'],_0x44a5f2),this['_handleTogglePin'](_0x50854e['id'],_0x50854e['pinned']);}),this['listenTo'](this['_aiChatHistoryUi'],'startConversation',()=>{this['_aiChatController']['startConversation'](),_0x289fe5['view']['activateTab']('chat');}),this['listenTo'](this['_aiChatController'],'change:activeConversation',()=>{this['_updateHistoryItemsUI']();}),_0x289fe5['view']['on']('activateTab:history',()=>{this['_showConversationHistory']();});}catch(_0x545b8e){this['_handleHistoryErrorUI'](_0x545b8e,'init');}}async['_handleEditTitle'](_0x138e3a,_0x257faa){await this['history']['updateItemTitle'](_0x138e3a,_0x257faa);}async['_handleTogglePin'](_0x1ea851,_0x421d72){await this['history']['updateItemPinned'](_0x1ea851,_0x421d72);}async['_handleRemove'](_0x1b75c8){await this['history']['removeItem'](_0x1b75c8);}async['_handleSelectConversation'](_0x564085){await this['_aiChatController']['loadConversation'](_0x564085);}async['_showConversationHistory'](){this['_aiChatHistoryUi']['showError'](''),this['_aiChatHistoryUi']['setLoadingSkeleton'](!0x0),await this['history']['init'](),this['_aiChatHistoryUi']['setLoadingSkeleton'](!0x1);}['_updateHistoryItemsUI'](){const _0x4a4667=this['_aiChatController']['activeConversation']?.['id'],_0x2b990d=this['_getCategorizedItems']()['map'](_0x133c3=>({'title':_0x133c3['title'],'items':_0x133c3['items']['map'](_0x2b019b=>({'id':_0x2b019b['id'],'title':_0x2b019b['title']||hs(this['context']['locale'],'AI_CHAT_UNTITLED_CONVERSATION'),'createdAt':new Date(_0x2b019b['createdAt'])['toLocaleDateString'](),'active':_0x2b019b['id']===_0x4a4667,'pinned':_0x2b019b['pinned']}))}));this['_aiChatHistoryUi']['updateItems'](_0x2b990d);}['_setItemLoading'](_0xe37e45,_0x4e3f4c){this['_aiChatHistoryUi']['updateItemLoadingState'](_0xe37e45,_0x4e3f4c,!0x0);}['_clearItemLoading'](_0x4c3003){this['_aiChatHistoryUi']['updateItemLoadingState'](_0x4c3003,null,!0x1);}['_handleHistoryErrorUI'](_0x2582d6,_0x599e47,_0x16cfad){const _0xf26adb=this['_generateErrorMessage'](_0x599e47,_0x16cfad);this['_aiChatHistoryUi']['showError'](_0xf26adb),_0x16cfad&&this['_clearItemLoading'](_0x16cfad),this['_aiChatHistoryUi']['setLoadingSkeleton'](!0x1);}['_generateErrorMessage'](_0x2be28d,_0x4c68b5){const _0x3d5c82=_0x4c68b5?this['history']['getItem'](_0x4c68b5):null,_0x311399=_0x3d5c82?.['title']||hs(this['context']['locale'],'AI_CHAT_UNTITLED_CONVERSATION');switch(_0x2be28d){case'updateItemTitle':return hs(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_UPDATE_TITLE',_0x311399);case'updateItemPinned':{const _0x424c95=hs(this['context']['locale'],_0x3d5c82?.['pinned']?'AI_CHAT_HISTORY_UNPIN_ACTION':'AI_CHAT_HISTORY_PIN_ACTION');return hs(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_UPDATE_PINNED',[_0x424c95,_0x311399]);}case'removeItem':return hs(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_REMOVE_ITEM',_0x311399);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 _0x1333f9=new Date(),_0x284243=new Date(_0x1333f9['getFullYear'](),_0x1333f9['getMonth'](),_0x1333f9['getDate']()),_0x23ed3f=new Date(_0x284243);_0x23ed3f['setDate'](_0x23ed3f['getDate']()-0x1);const _0xbc24d7=new Date(_0x284243);_0xbc24d7['setDate'](_0xbc24d7['getDate']()-0xe);const _0x3dcc5e=this['history']['getItems']({'pinned':!0x0}),_0x3815e7=this['history']['getItems']({'from':_0x284243,'to':_0x284243}),_0x141e65=this['history']['getItems']({'from':_0x23ed3f,'to':_0x23ed3f}),_0xb4d8de=this['history']['getItems']({'from':_0xbc24d7,'to':_0x23ed3f}),_0x3f5929=this['history']['getItems']({'to':_0xbc24d7}),_0x9c3c0e=[];return _0x3dcc5e['length']>0x0&&_0x9c3c0e['push']({'title':hs(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_PINNED'),'items':_0x3dcc5e}),_0x3815e7['length']>0x0&&_0x9c3c0e['push']({'title':hs(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_TODAY'),'items':_0x3815e7}),_0x141e65['length']>0x0&&_0x9c3c0e['push']({'title':hs(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_YESTERDAY'),'items':_0x141e65}),_0xb4d8de['length']>0x0&&_0x9c3c0e['push']({'title':hs(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_LAST_14_DAYS'),'items':_0xb4d8de}),_0x3f5929['length']>0x0&&_0x9c3c0e['push']({'title':hs(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_LATER'),'items':_0x3f5929}),_0x9c3c0e;}}class Io extends _0xee6711{static get['requires'](){return[Ao,uo];}static get['pluginName'](){return'AIChatHistory';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}class Eo extends _0xee6711{static get['requires'](){return[Xs,Js,ro,Io];}static get['pluginName'](){return'AIChat';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x5b62c1){super(_0x5b62c1),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(_0x26749c,_0xd1d99c){super(_0x26749c);const {id:_0x5db5ff,type:_0x2b6357,icon:_0x10b4f3}=_0xd1d99c;this['id']=_0x5db5ff,this['set']({'label':_0xd1d99c['label'],'withText':!0x0,'class':'ck-ai-chat-shortcut'}),this['extendTemplate']({'attributes':{'data-cke-ai-shortcut-id':_0xd1d99c['id']}}),_0x10b4f3?this['icon']=_0x10b4f3:'chat'===_0x2b6357?this['icon']=_0xf586bd:'review'===_0x2b6357?this['icon']=_0x14d24d:'translate'===_0x2b6357&&(this['icon']=_0x157c37);}}class mo extends vt{['listView'];constructor(_0x23c400,_0x3a83d4){super(_0x23c400);const _0x52648b=_0x3a83d4['map'](_0x3b7a17=>{const _0x1a5d93=new Ht(this['locale']),_0x2a6fb2=new po(this['locale'],_0x3b7a17);return _0x1a5d93['children']['add'](_0x2a6fb2),_0x2a6fb2['delegate']('execute')['to'](this),_0x1a5d93;});this['listView']=new Dt(this['locale']),this['listView']['items']['addMany'](_0x52648b),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat-shortcuts']},'children':[this['listView']]});}}const To='chat-shortcuts';class Co extends _0xee6711{['_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 _0x3f4914=this['context']['plugins']['get']('AIChatController');this['_shortcuts']['length']&&(this['_validateShortcuts'](),this['_aiChatUI']['on']('conversationCreated',()=>{_0x3f4914['activeConversation']['isFromHistory']||this['_injectShortcuts']();}),this['listenTo'](_0x3f4914,'interactionStarted',()=>{this['_removeShortcuts']();}));}['_validateShortcuts'](){const _0xa71321=['chat','review','translate'];this['_shortcuts']['forEach'](_0x216e93=>{let _0x4aa5e4=!0x0;if(_0x216e93['id']&&_0x216e93['label']&&_0xa71321['includes'](_0x216e93['type'])?'chat'===_0x216e93['type']&&(_0x4aa5e4='string'==typeof _0x216e93['prompt']):_0x4aa5e4=!0x1,!_0x4aa5e4)throw new at('ai-chat-shortcuts-invalid-config',this['context'],{'shortcut':_0x216e93});});}['_injectShortcuts'](){const _0xdee7b8=this['context']['plugins']['get'](ro);this['_shortcutsView']=new mo(this['context']['locale'],this['_shortcuts']),this['_shortcutsView']['render'](),_0xdee7b8['addFeedItemCustomElement'](this['_shortcutsView']['element'],To),this['_shortcutsView']['on']('execute',_0x53c2b9=>{const _0x2c2237=_0x53c2b9['source']['id'];this['_executeShortcut'](_0x2c2237);});}['_removeShortcuts'](){const _0x46029b=this['context']['plugins']['get'](ro);_0x46029b['hasFeedItem'](To)&&_0x46029b['removeFeedItem'](To),this['_shortcutsView']?.['destroy']();}['_executeShortcut'](_0x3e8a0f){const _0x54db5a=this['_shortcuts']['find'](_0xf61a2d=>_0xf61a2d['id']===_0x3e8a0f),_0x13681e=_0x54db5a['type'];'chat'===_0x13681e?this['_runChatShortcut'](_0x54db5a):'review'===_0x13681e?_0x54db5a['commandId']?this['_runReviewShortcut'](_0x54db5a):this['_switchTab']('reviewMode'):'translate'===_0x13681e&&(_0x54db5a['language']?this['_runTranslateShortcut'](_0x54db5a):this['_switchTab']('translate'));}['_switchTab'](_0x59f846){if(!this['context']['plugins']['has']('AITabs'))throw new at('ai-chat-shortcuts-ai-tabs-not-found',this['context'],{'tabName':_0x59f846});this['context']['plugins']['get']('AITabs')['view']['activateTab'](_0x59f846);}async['_runChatShortcut']({prompt:_0x126f9b,draftMode:_0x23deac,useWebSearch:_0x1dc94d=!0x1,useReasoning:_0x14982b=!0x1,model:_0x379643}){const _0x2148cf=this['context']['plugins']['get']('AIChatController'),_0x207a1e=_0x2148cf['activeConversation'];let _0xba5e92;_0xba5e92=_0x379643?await _0x207a1e['chatModels']['getModel'](_0x379643):await _0x207a1e['chatModels']['getDefault'](),_0xba5e92&&await _0x207a1e['setModel'](_0xba5e92),_0x207a1e['setWebSearch'](_0x1dc94d),_0x207a1e['setReasoning'](_0x14982b),_0x2148cf['addCurrentDocumentToChatContext'](),_0x23deac?(this['_aiChatUI']['setPromptInputValue'](_0x126f9b),this['_aiChatUI']['focusPromptInput'](!0x0)):_0x2148cf['sendMessage']({'message':_0x126f9b});}['_runReviewShortcut']({commandId:_0x584521,model:_0x32a5ac,prompt:_0x5ee3cd,params:_0x3fcd6f}){if(!this['context']['plugins']['has']('AIReviewModeUI'))throw new at('ai-chat-shortcuts-review-mode-not-found',this['context']);this['_switchTab']('reviewMode');const _0xfdcad8={'id':_0x584521,'isCustom':'custom'===_0x584521};_0x32a5ac&&_0x5ee3cd&&(_0xfdcad8['args']={'model':_0x32a5ac,'prompt':_0x5ee3cd}),_0x3fcd6f&&(_0xfdcad8['params']=_0x3fcd6f),this['context']['plugins']['get']('AIReviewModeUI')['fire']('runReviewCheck',_0xfdcad8);}['_runTranslateShortcut']({language:_0x353724}){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':_0x353724,'args':{'language':_0x353724}});}}class wo extends _0x2086ab{constructor(_0xeb99bc){super(_0xeb99bc);const _0x186b68=_0xeb99bc['plugins']['get']('AITabs')['view'];this['bind']('value')['to'](_0x186b68,'isVisible'),this['isEnabled']=!0x0;}['execute'](){const _0x55fe68=this['editor']['plugins']['get']('AITabs')['view'];_0x55fe68['isVisible']=!_0x55fe68['isVisible'];}}class fo extends _0x5e9f88{static get['requires'](){return[os];}static get['pluginName'](){return'AIToggleButtonUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const _0x45714b=this['editor'];_0x45714b['commands']['add']('toggleAi',new wo(_0x45714b)),_0x45714b['ui']['componentFactory']['add']('toggleAi',()=>{const _0x17082a=this['_createAIUIButton'](Nt);return _0x17082a['set']({'tooltip':!0x0,'class':'ck-ai-toggle-button'}),_0x17082a;}),_0x45714b['ui']['componentFactory']['add']('menuBar:toggleAi',()=>{const _0x1dd793=this['_createAIUIButton'](Wt);return _0x1dd793['set']({'role':'menuitemcheckbox'}),_0x1dd793;});}['_createAIUIButton'](_0x3989be){const _0x4619a2=this['editor'],_0xa6ec32=_0x4619a2['commands']['get']('toggleAi'),_0x5c425f=new _0x3989be(_0x4619a2['locale']);return _0x5c425f['set']({'label':hs(_0x4619a2['locale'],'AI_TOGGLE_BUTTON_LABEL'),'icon':_0x141f4b,'isToggleable':!0x0}),_0x5c425f['bind']('isEnabled')['to'](_0xa6ec32),_0x5c425f['bind']('isOn')['to'](_0xa6ec32,'value',_0x17fc82=>!!_0x17fc82),this['listenTo'](_0x5c425f,'execute',()=>{_0xa6ec32['execute']();}),_0x5c425f;}}const bo=['applySuggestion','insertSuggestion','showNext','showPrevious'];class So extends vt{['_errorView'];constructor(_0x17696f){super(_0x17696f),this['set']('_errorMessage',''),this['set']('_isErrorVisible',!0x1);}['showBlockingError'](_0x275984){this['showError'](_0x275984);}['showError'](_0x56b54c){this['_errorView']||(this['_errorView']=this['_createErrorView']()),this['_errorMessage']=_0x56b54c,this['_isErrorVisible']=!0x0;}['hideError'](){this['_isErrorVisible']=!0x1;}['_createErrorView'](){const _0x568b09=new vt(this['locale']),_0x1c6a06=new vt(this['locale']);return _0x1c6a06['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai-suggestion__error-text']},'children':[{'text':this['bindTemplate']['to']('_errorMessage')}]}),_0x568b09['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__error','ck-ai-balloon-error',this['bindTemplate']['if']('_isErrorVisible','ck-hidden',_0x3804c6=>!_0x3804c6)]},'children':[_0x1c6a06]}),_0x568b09;}}const Ro=0xa;class Oo extends _0xee6711{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'](_0x18c754){const {id:_0xc614d5}=this['_currentConfig']??{};this['_currentConfig']=_0x18c754;const {id:_0x118bc3}=this['_currentConfig'];this['isOpen']&&_0xc614d5===_0x118bc3?this['_updateDialog']():this['_showDialog']();}['close'](){const _0x428b49=this['_getTargetEditor']()['plugins']['get']('Dialog');_0x428b49['isOpen']&&this['_currentConfig']&&_0x428b49['id']===this['_currentConfig']['id']&&_0x428b49['hide']();}['_updateDialog'](){const _0x5db34a=this['_getTargetEditor']()['plugins']['get']('Dialog'),{icon:_0x21f3e5,title:_0x4ffb58}=this['_currentConfig'];_0x5db34a['view']?.['headerView']&&(_0x5db34a['view']['headerView']['label']=_0x4ffb58,_0x5db34a['view']['headerView']['iconView']&&_0x21f3e5&&(_0x5db34a['view']['headerView']['iconView']['content']=_0x21f3e5)),this['_isUpdatingMarkers']=!0x0,this['_showFakeVisualSelection'](),this['_isUpdatingMarkers']=!0x1,_0x5db34a['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 _0x6a46ef=this['_getTargetEditor']()['plugins']['get']('Dialog'),{id:_0x2ce7b6,title:_0x59f54f,icon:_0x422025,class:_0x39c737,mainView:_0x1d2ec2}=this['_currentConfig'];_0x1d2ec2['delegate'](...bo)['to'](this),_0x6a46ef['show']({'title':_0x59f54f,'icon':_0x422025,'hasCloseButton':!0x0,'id':_0x2ce7b6,'position':this['_calculateDialogPosition']['bind'](this),'className':'ck-ai-balloon\x20'+(_0x39c737||''),'content':_0x1d2ec2,'onShow':_0x2d39d2=>{this['_showFakeVisualSelection'](),this['_setupFakeVisualSelectionMarkerRemovalListener'](),_0x2d39d2['view']?.['updatePosition']();const _0x489e01=this['_getSelectionElements']();_0x489e01&&_0x489e01[0x0]&&Ct({'target':_0x489e01[0x0],'ancestorOffset':0x14,'alignToTop':!0x0,'viewportOffset':{'top':0x14,'bottom':0x14,'left':0x0,'right':0x0}}),this['isOpen']=!0x0,_0x2d39d2['once']('hide',()=>{this['fire']('beforeDialogClosed',{'id':_0x2ce7b6});},{'priority':'high'});},'onHide':()=>{this['_hideFakeVisualSelection'](),this['_cleanupFakeVisualSelectionMarkerRemovalListener'](),this['fire']('dialogClosed',{'id':_0x2ce7b6}),this['isOpen']=!0x1;}});}['_calculateDialogPosition'](_0x43e47a,_0x1e6806){if(!_0x1e6806){const _0x202e7c=this['_getTargetRootDomRect']();if(!_0x202e7c)return null;_0x1e6806=_0x202e7c;}const _0x1d3733=this['_getSelectionElements']();if(!_0x1d3733||0x0===_0x1d3733['length'])return{'left':Math['round'](_0x1e6806['left']+_0x1e6806['width']/0x2-_0x43e47a['width']/0x2),'top':Math['round'](_0x1e6806['top']+_0x1e6806['height']/0x2-_0x43e47a['height']/0x2)};const _0x2c96bd=Math['round'](_0x1e6806['left']+_0x1e6806['width']/0x2-_0x43e47a['width']/0x2),_0x5f4564=_0x1d3733['map'](_0x201c5f=>new ut(_0x201c5f)),_0x268fb4=_0x43e47a['height'];return{'left':_0x2c96bd,'top':this['_calculateOptimalTopPosition'](_0x5f4564,_0x268fb4,_0x1e6806)};}['_calculateOptimalTopPosition'](_0x410601,_0x3c5331,_0x5b0c55){const _0x2aade3=new ut(ct['window']),_0xad1ed=_0x410601['map'](_0x120a12=>_0x120a12['getVisible']())['filter'](_0x376e22=>_0x376e22),_0x5ccc82=ut['getBoundingRect'](_0xad1ed);if(!_0x5ccc82)return Math['round'](_0x5b0c55['top']+_0x5b0c55['height']/0x2);const _0x34c7dc=_0x2aade3['getIntersection'](_0x5ccc82);if(!_0x34c7dc)return Math['round'](_0x5b0c55['top']+_0x5b0c55['height']/0x2);const _0x92bb9e=_0x5b0c55['getVisible'](),_0x4e306b=_0x92bb9e&&_0x5ccc82['height']>_0x92bb9e['height'],_0xd6dac5=_0x34c7dc['top'],_0x8a43ec=_0x34c7dc['bottom'];if(_0x4e306b){const _0x1da27a=(_0x92bb9e||_0x2aade3)['height']/0x2-_0x3c5331/0x2,_0x4846ce=_0xd6dac5-Ro-_0x5b0c55['top'],_0x4b1756=_0x5b0c55['bottom']-_0x8a43ec-Ro;return _0x4846ce>=_0x3c5331?Math['max'](Ro,_0xd6dac5-_0x3c5331-Ro):_0x4b1756>=_0x3c5331?_0x8a43ec+Ro:Math['max'](Ro,_0x1da27a);}const _0x1bac81=_0xd6dac5-_0x3c5331,_0x120f1f=_0x5b0c55['bottom']-_0x8a43ec-Ro,_0x3cee37=_0xd6dac5-Ro-_0x5b0c55['top'];let _0x3a71e1;if(_0x120f1f>=_0x3c5331)_0x3a71e1=_0x8a43ec+Ro;else{if(_0x3cee37>=_0x3c5331)_0x3a71e1=_0x1bac81-Ro;else _0x3a71e1=_0xd6dac5+_0x5ccc82['height']/0x2-_0x3c5331/0x2;}return _0x3a71e1;}['_setupFakeVisualSelectionMarkerRemovalListener'](){const _0x5a78f4=this['_getTargetEditor']();this['listenTo'](_0x5a78f4['model']['document'],'change',()=>{if(!this['_isUpdatingMarkers']){for(const {name:_0x9c3408,data:{newRange:_0x44e4c7}}of _0x5a78f4['model']['document']['differ']['getChangedMarkers']())if(_0x9c3408['startsWith'](zs+':')&&(_0x44e4c7&&(_0x44e4c7['start']['isEqual'](_0x44e4c7['end'])||'$graveyard'==_0x44e4c7['root']['rootName'])||null==_0x44e4c7)){const _0x22f9c8=hs(this['context']['locale'],'AI_BALLOON_SELECTION_REMOVED_ERROR');this['_currentConfig']['mainView']['showBlockingError'](_0x22f9c8),this['fire']('selectionRemoved');}}});}['_cleanupFakeVisualSelectionMarkerRemovalListener'](){const _0x7dd59e=this['_getTargetEditor']();this['_currentConfig']['mainView']['hideError'](),this['stopListening'](_0x7dd59e['model']['document']);}['_getSelectionElements'](){const _0x430bbc=this['_getTargetEditor']();return _0x3359cb(_0x430bbc['editing'],[..._0x430bbc['model']['markers']['getMarkersGroup']('ai-selection'),..._0x430bbc['model']['markers']['getMarkersGroup']('ai-balloon-selection')]);}['_getTargetRootDomRect'](){const _0x5b2e6b=this['_currentConfig']?.['ranges']?.[0x0]?.['root'];if(!_0x5b2e6b)return null;const _0x85f029=this['_getTargetEditor'](),_0xdd490a=_0x85f029['editing']['view']['document']['getRoot'](_0x5b2e6b['rootName']);if(!_0xdd490a)return null;const _0x5d85fd=_0x85f029['editing']['view']['domConverter']['mapViewToDom'](_0xdd490a);return _0x5d85fd&&_0x5d85fd instanceof HTMLElement?new ut(_0x5d85fd):null;}}class ko extends kt{['copyButton'];['likeButton'];['dislikeButton'];['showChangesButton'];['_config'];constructor(_0x54d216,_0x36b52b={}){super(_0x54d216),this['set']('isEnabled',!0x0),this['set']('isShowChangesOn',!0x1),this['_config']={'showCopy':!0x1,'showLike':!0x1,'showDislike':!0x1,..._0x36b52b};const _0x1af640=!(this['_config']['showCopy']||this['_config']['showChanges']||this['_config']['showLike']||this['_config']['showDislike']||this['_config']['customView']?.['length']);this['class']=_0x1af640?'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'](_0x34055f){this['showChangesButton']['isEnabled']=_0x34055f;}['_setupRatingButtons'](){this['likeButton']=new Nt(this['locale']),this['likeButton']['set']({'icon':_0x3cedbd,'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':_0x59a55b,'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':_0x4b3519,'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 _0xf95b4d=new xt();_0xf95b4d['set']({'content':_0x2dfde3}),_0xf95b4d['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'](_0xf95b4d);}['_setupShowChangesButton'](){this['showChangesButton']=new Nt(this['locale']),this['showChangesButton']['set']({'icon':_0x22e99c,'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',_0x181a97=>_0x181a97?_0x3d65c1:_0x22e99c),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(_0x3c114a,_0x5c6a97){super(_0x3c114a);const _0x307979=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']=_0x5c6a97,this['nextButtonView']=this['_createNextButtonView'](),this['previousButtonView']=this['_createPreviousButtonView'](),this['_streamableContentView']=new In(_0x3c114a),this['_partToolbarView']=new _n(_0x3c114a,_0x5c6a97['availableActions']),this['_partToolbarView']['delegate']('applySuggestion','insertSuggestion','rejectSuggestion')['to'](this),this['_togglePartToolbarButtonsVisibility'](_0x5c6a97),this['_stateView']=new un(_0x3c114a),this['_stateView']['isVisible']=!0x1,this['_miniToolbarView']=new ko(_0x3c114a,{'showChanges':'full'}),this['_miniToolbarView']['bind']('isShowChangesOn')['to'](this,'showDiff'),this['_miniToolbarView']['on']('toggleShowChanges',()=>{this['fire']('toggleSuggestionDisplayMode');}),this['_toolbarContainerView']=new vo(_0x3c114a,[this['_partToolbarView'],this['_stateView'],this['_miniToolbarView']]),this['children']=this['createCollection']([this['_streamableContentView'],this['_toolbarContainerView']]),this['on']('change:_state',(_0x3765df,_0x509082,_0x5ce6e5,_0x4772bf)=>{let _0x423e7c,_0x18b7bd;'pending'===_0x4772bf?(_0x423e7c=this['_partToolbarView'],_0x18b7bd=this['_stateView']):(_0x423e7c=this['_stateView'],_0x18b7bd=this['_partToolbarView']),this['_stateView']['setState'](_0x5ce6e5),_0x423e7c['isVisible']=!0x1,_0x18b7bd['isVisible']=!0x0;}),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat-balloon-main',_0x307979['to']('_state',_0xdac5d7=>'ck-ai-chat-balloon-main_state_'+_0xdac5d7)]},'children':this['children']}),this['on']('change:isTrackChangesOn',()=>{this['_togglePartToolbarButtonsVisibility'](_0x5c6a97);});}['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'](_0x4169b3){_0x4169b3?.['keepErrors']||this['hideError'](),await this['_streamableContentView']['update'](_0x4169b3);}['setState'](_0xd3d1f6){this['_state']=_0xd3d1f6;}['showError'](_0x56107c){super['showError'](_0x56107c),this['children']['has'](this['_errorView'])||this['children']['add'](this['_errorView'],0x0);}['hideError'](){this['_isErrorVisible']&&(super['hideError'](),this['togglePartToolbarEnabled'](!0x0));}['showBlockingError'](_0x4b676a){super['showBlockingError'](_0x4b676a),this['togglePartToolbarEnabled'](!0x1);}['toggleRotatorButtonsVisibility'](_0x37f2a9){this['nextButtonView']['isVisible']=this['previousButtonView']['isVisible']=_0x37f2a9;}['togglePartToolbarEnabled'](_0x5a1186){this['_partToolbarView']['isEnabled']=_0x5a1186;}['_togglePartToolbarButtonsVisibility']({showApplyButton:_0x563b54,showSuggestButton:_0x1b767b}){_0x563b54=_0x563b54&&!this['isTrackChangesOn']&&this['_config']['availableActions']['includes']('applySuggestion'),_0x1b767b=_0x1b767b&&this['_config']['availableActions']['includes']('insertSuggestion'),this['_partToolbarView']['setButtonsVisibility']({'showApplyButton':_0x563b54,'showSuggestButton':_0x1b767b});}['_createNextButtonView'](){const _0x5908e5=new Nt(this['locale']);return _0x5908e5['set']({'icon':_0x2d691f,'label':hs(this['locale'],'AI_BALLOON_NEXT_LABEL'),'isVisible':!0x0}),_0x5908e5['on']('execute',()=>{this['fire']('showNext');}),_0x5908e5;}['_createPreviousButtonView'](){const _0x554e10=new Nt(this['locale']);return _0x554e10['set']({'icon':_0x3a1a88,'label':hs(this['locale'],'AI_BALLOON_PREVIOUS_LABEL'),'isVisible':!0x0}),_0x554e10['on']('execute',()=>{this['fire']('showPrevious');}),_0x554e10;}}class vo extends vt{constructor(_0x175949,_0x3d3190){super(_0x175949),this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-chat-balloon__toolbar-container']},'children':_0x3d3190});}}class yo extends _0x5e9f88{static get['requires'](){return[Bt,Oo];}static get['pluginName'](){return'AIChatBalloon';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['_chatBalloonView'];constructor(_0x4ebe09){super(_0x4ebe09),this['set']('showDiff',!0x1);}['open'](_0x13fd01){const _0x5bd7b8=this['editor'];this['_chatBalloonView']||(this['_chatBalloonView']=this['_createChatBalloonView']()),_0x5bd7b8['plugins']['get']('AIBalloon')['open']({..._0x13fd01,'id':'aiChatBalloon','class':'ck-ai-chat-balloon','mainView':this['_chatBalloonView']}),this['_toggleRotatorButtonsInDialogHeader'](_0x13fd01['showRotator']),this['_chatBalloonView']['togglePartToolbarEnabled'](!_0x13fd01['areActionsDisabled']),this['_restoreDefaultViewFocus']();}['close'](){this['editor']['plugins']['get']('AIBalloon')['close']();}['updateContent'](_0x1d2b18){return this['_chatBalloonView']||(this['_chatBalloonView']=this['_createChatBalloonView']()),this['_chatBalloonView']['updateContent'](_0x1d2b18);}['setState'](_0x1a1dcd){this['_chatBalloonView']&&this['_chatBalloonView']['setState'](_0x1a1dcd);}['_createChatBalloonView'](){const _0x1bb378=this['editor'],_0x2465c7=_0x1bb378['plugins']['get']('AIBalloon'),_0x5020f9=_0x1bb378['commands']['get']('trackChanges');let _0x3f3cb7=_0x1bb378['config']['get']('ai.availableReplyActions')||[...fn];_0x1bb378['plugins']['has']('TrackChanges')||(_0x3f3cb7=_0x3f3cb7['filter'](_0x30d662=>'insertSuggestion'!=_0x30d662));const _0x4111dc=new No(_0x1bb378['locale'],{'availableActions':_0x3f3cb7,'showApplyButton':!0x0,'showSuggestButton':!!_0x5020f9});return _0x4111dc['bind']('showDiff')['to'](this),_0x4111dc['delegate'](...Zs)['to'](this),_0x4111dc['delegate']('showPrevious','showNext')['to'](this),_0x2465c7['delegate']('dialogClosed')['to'](this),_0x4111dc['on']('applySuggestion',this['_restoreDefaultViewFocus']['bind'](this)),_0x4111dc['on']('insertSuggestion',this['_restoreDefaultViewFocus']['bind'](this)),_0x4111dc['on']('rejectSuggestion',this['_restoreDefaultViewFocus']['bind'](this)),_0x5020f9&&_0x4111dc['bind']('isTrackChangesOn')['to'](_0x5020f9,'value'),_0x4111dc['render'](),_0x4111dc;}['_toggleRotatorButtonsInDialogHeader'](_0x1f62d0){const _0x10745d=this['editor'],_0x2b2932=_0x10745d['plugins']['get']('Dialog')['view']['headerView']['children'];this['_chatBalloonView']['toggleRotatorButtonsVisibility'](_0x1f62d0),_0x2b2932['has'](this['_chatBalloonView']['previousButtonView'])||(_0x2b2932['addMany']([this['_chatBalloonView']['previousButtonView'],this['_chatBalloonView']['nextButtonView']],0x0),_0x10745d['plugins']['get']('AIBalloon')['once']('beforeDialogClosed',()=>{_0x2b2932['remove'](this['_chatBalloonView']['previousButtonView']),_0x2b2932['remove'](this['_chatBalloonView']['nextButtonView']);}));}['_restoreDefaultViewFocus'](){this['_chatBalloonView']['focus']();}}class xo extends _0x5e9f88{static get['requires'](){return[fo,yo,_0x1da09b];}static get['pluginName'](){return'AIEditorIntegration';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}function Lo(_0x52e7e9){const {editor:_0x5741e7,action:_0x12090e,withText:_0xd16f27=!0x1,withIcon:_0x2545ca=!0x0,isInDropdown:_0x233d45=!0x0,shouldPreventFocus:_0x79d483=!0x1}=_0x52e7e9;return()=>{const _0x2604b1=_0x5741e7['locale'],_0x33d364=new Nt(_0x2604b1),_0x582ebe=_0x33d364['bindTemplate'];_0x233d45&&_0x33d364['extendTemplate']({'on':{'mouseenter':_0x582ebe['to'](()=>{_0x79d483&&_0x79d483()||_0x33d364['focus']();})}});const _0x402beb=_0x12090e['icon']??_0x12090e['parent']?.['icon'];return _0x33d364['set']({'label':_0x12090e['label'],'withText':_0xd16f27,'role':'menuitem','icon':_0x2545ca?_0x402beb??_0x4b17ba:void 0x0,'tooltip':!_0xd16f27,'class':'ck-ai-quick-actions-button','isEnabled':_0x12090e['isEnabled']}),_0x33d364['on']('execute',()=>{_0x5741e7['editing']['view']['focus'](),_0x5741e7['commands']['execute']('aiQuickAction',_0x12090e);}),_0x33d364;};}class Do extends _0x61e23f{['arrowView'];constructor(_0xdf2e9d,_0x5efa42){super(_0xdf2e9d,_0x5efa42);const _0x5f2c9a=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',_0x4ca2c5=>String(_0x4ca2c5)),'data-cke-tooltip-disabled':_0x5f2c9a['to']('isOn')},'on':{'mouseenter':_0x5f2c9a['to']('mouseenter')}});}['render'](){super['render'](),this['children']['add'](this['arrowView']);}['_createArrowView'](){const _0x282479=new xt();return _0x282479['content']=_0x58875c,_0x282479['extendTemplate']({'attributes':{'class':'ck-dropdown-menu-list__nested-menu__button__arrow'}}),_0x282479;}}class Po extends Dt{['_allListItems'];['_allSearchableItems'];constructor(_0x187744,_0x308664,_0x286cc0){super(_0x187744),this['_allListItems']=_0x308664,this['_allSearchableItems']=_0x286cc0;}['filter'](_0x5cb130){if(!_0x5cb130)return this['items']['clear'](),this['items']['addMany'](this['_allListItems']),this['_clearHighlight'](),{'resultsCount':this['_allListItems']['length'],'totalItemsCount':this['_allListItems']['length']};const _0x4d9274=_0x5cb130['source']['toLowerCase']()['trim'](),_0x5070b3=this['_allSearchableItems']['filter'](_0x5c54d5=>(_0x5c54d5['groupLabel']?_0x5c54d5['label']+'\x20('+_0x5c54d5['groupLabel']+')':_0x5c54d5['label'])['toLowerCase']()['includes'](_0x4d9274));return this['items']['clear'](),this['items']['addMany'](_0x5070b3['sort']((_0x583887,_0x5ccc44)=>{const _0x259730=_0x583887['groupLabel'],_0x3a4fb2=_0x5ccc44['groupLabel'];return _0x259730||_0x3a4fb2?_0x259730?0x1:-0x1:0x0;})['map'](_0x773c50=>_0x773c50['item'])),this['_highlightQuery'](_0x4d9274,_0x5070b3),{'resultsCount':_0x5070b3['length'],'totalItemsCount':this['_allSearchableItems']['length']};}['_highlightQuery'](_0x73ac96,_0x52daa8){if(!_0x73ac96)return;const _0x11a87a=new RegExp(_0x2052d8(_0x73ac96),'gi');_0x52daa8['forEach'](_0x2dde0b=>{_0x2dde0b['highlightViews']&&_0x2dde0b['highlightViews']['forEach'](_0x1a5b02=>{'function'==typeof _0x1a5b02['highlightText']&&_0x1a5b02['highlightText'](_0x11a87a);});});}['_clearHighlight'](){this['_allSearchableItems']['forEach'](_0x12a91b=>{_0x12a91b['highlightViews']&&_0x12a91b['highlightViews']['forEach'](_0x3bb39d=>{'function'==typeof _0x3bb39d['highlightText']&&_0x3bb39d['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(_0x55b225,_0x49fd46,_0x35f0c1,_0x32ee81,_0x168b56=!0x1){const _0x44956e=_0x55b225['locale'];super(_0x44956e),this['_bodyCollection']=_0x32ee81,this['_hasSearch']=_0x168b56;const _0x569254=this['_createListItems'](_0x55b225,_0x49fd46,_0x35f0c1);this['optionsListView']=new Po(_0x44956e,_0x569254,this['_allSearchableItems']),this['optionsListView']['role']=Ho,this['optionsListView']['items']['addMany'](_0x569254),this['focusTracker']=new _t(),this['keystrokes']=new gt(),_0x168b56&&(this['_searchTextView']=this['_createSearchTextView']()),this['_focusables']=_0x569254,this['focusCycler']=new Ut({'focusables':this['_focusables'],'focusTracker':this['focusTracker'],'keystrokeHandler':this['keystrokes']}),_0x168b56&&this['_searchTextView']&&this['focusCycler']['chain'](this['_searchTextView']['focusCycler']);const _0x418d9e=_0x168b56&&this['_searchTextView']?[this['_searchTextView']]:[this['optionsListView']];this['children']=new _0x2fb855(_0x418d9e),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset_all','ck-ai-quick-actions','ck-rounded-corners'],'dir':_0x44956e['uiLanguageDirection']},'children':this['children']});}['_createSearchTextView'](){return new _0x43e87c(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 _0x2a175e=this['_searchTextView']['queryView']['fieldView']['element']['ownerDocument']?.['activeElement'];return this['_searchTextView']['queryView']['fieldView']['element']['contains'](_0x2a175e);}['_createListItems'](_0x5076b6,_0x4d84bd,_0xb9e85d){const _0x1d4967=new _0x2fb855();return _0x4d84bd['forEach'](_0x4d420e=>{if('actions'in _0x4d420e){const {listItem:_0x55379e}=this['_createActionGroupButton'](_0x5076b6,_0x4d420e,_0xb9e85d);_0x1d4967['add'](_0x55379e),_0x4d420e['actions']['forEach'](_0x52b6df=>{this['_createActionButton'](_0x5076b6,_0x52b6df,_0x4d420e['label'],_0x4d420e['icon']);const {listItem:_0xaf2940,highlightViews:_0x476253}=this['_createSearchResultActionButton'](_0x5076b6,_0x52b6df,_0x4d420e['label'],_0x4d420e['icon']);this['_allSearchableItems']['push']({'item':_0xaf2940,'label':_0x52b6df['label'],'groupLabel':_0x4d420e['label'],'highlightViews':_0x476253});});}else{const {listItem:_0x37a439}=this['_createActionButton'](_0x5076b6,_0x4d420e);_0x1d4967['add'](_0x37a439);const _0x582fe2=_0x37a439['children']['first'];if(_0x582fe2){const {listItem:_0x3325dc,highlightViews:_0x327cfa}=this['_createSearchResultActionButton'](_0x5076b6,_0x4d420e);this['_allSearchableItems']['push']({'item':_0x3325dc,'label':_0x582fe2['label']||'','highlightViews':_0x327cfa});}}}),_0x1d4967;}['_createActionButton'](_0x2a1f8c,_0x2f593d,_0x3eb224,_0x515b20){const _0x389069=new Ht(this['locale']);if(_0x3eb224&&_0x515b20){const _0x5da604=new Nt(this['locale']),_0x4555d1=_0x5da604['bindTemplate'],_0x324dab=new _0x2a3dc2();_0x324dab['text']=_0x2f593d['label'];const _0x697256=new _0x2a3dc2();_0x697256['text']=_0x3eb224;const _0x520b13=new xt();_0x520b13['content']=_0x515b20,_0x520b13['extendTemplate']({'attributes':{'class':'ck-ai-quick-actions-button__group-icon'}});const _0x2c2299=new vt(this['locale']);_0x2c2299['setTemplate']({'tag':'span','attributes':{'class':'ck-ai-quick-actions-button_with-group__open-paren'},'children':[{'text':'\x20('}]});const _0x163df7=new vt(this['locale']);return _0x163df7['setTemplate']({'tag':'span','attributes':{'class':'ck-ai-quick-actions-button_with-group__close-paren'},'children':[{'text':')'}]}),_0x5da604['set']({'label':_0x2f593d['label']+'\x20('+_0x3eb224+')','withText':!0x0,'role':'menuitem','class':'ck-ai-quick-actions-button\x20ck-ai-quick-actions-button_with-group','tooltip':!0x1}),_0x5da604['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':[_0x324dab,_0x2c2299,_0x520b13,_0x697256,_0x163df7],'on':{'mouseenter':_0x4555d1['to'](()=>{this['_isSearchFocused']()||_0x5da604['focus']();}),'click':_0x4555d1['to'](()=>{_0x5da604['fire']('execute');})}}),_0x5da604['on']('execute',()=>{_0x2a1f8c['editing']['view']['focus'](),_0x2a1f8c['commands']['execute']('aiQuickAction',_0x2f593d);}),_0x389069['children']['add'](_0x5da604),{'listItem':_0x389069,'highlightViews':[_0x324dab,_0x697256]};}{const _0x100ab5=new _0x5e2f36(),_0x3ee748=new Nt(this['locale'],_0x100ab5),_0x4c9251=_0x3ee748['bindTemplate'],_0x49e6ce=_0x2f593d['icon']??_0x2f593d['parent']?.['icon'],_0x555e89=void 0x0!==_0x2f593d['icon'];return _0x3ee748['set']({'label':_0x2f593d['label'],'withText':!0x0,'role':'menuitem','icon':_0x555e89?_0x49e6ce??_0x4b17ba:void 0x0,'tooltip':!0x1,'class':'ck-ai-quick-actions-button'}),_0x3ee748['extendTemplate']({'on':{'mouseenter':_0x4c9251['to'](()=>{this['_isSearchFocused']()||_0x3ee748['focus']();})}}),_0x3ee748['on']('execute',()=>{_0x2a1f8c['editing']['view']['focus'](),_0x2a1f8c['commands']['execute']('aiQuickAction',_0x2f593d);}),_0x389069['children']['add'](_0x3ee748),{'listItem':_0x389069,'highlightViews':[_0x100ab5]};}}['_createSearchResultActionButton'](_0x244086,_0x2ffc7a,_0x57c3bb,_0x13e90c){return _0x57c3bb&&_0x13e90c?this['_createSearchResultGroupedActionButton'](_0x244086,_0x2ffc7a,_0x57c3bb,_0x13e90c):this['_createSearchResultIndividualActionButton'](_0x244086,_0x2ffc7a);}['_createSearchResultGroupedActionButton'](_0x76f3ff,_0x1dfaca,_0xf15e0,_0x53f0f2){const _0x3f7366=new Ht(this['locale']),_0x4addff=new Nt(this['locale']),_0x44cb22=_0x4addff['bindTemplate'],{view:_0x5ad64b,highlightView:_0x505924}=this['_createSearchResultGroupRow'](_0xf15e0,_0x53f0f2),{view:_0x1fa95f,highlightView:_0x3f2ef5}=this['_createSearchResultActionRow'](_0x1dfaca['label']),_0x66d190=this['_createSearchResultContentView'](_0x5ad64b,_0x1fa95f);return _0x4addff['set']({'label':_0x1dfaca['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}),_0x4addff['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':[_0x66d190],'on':{'mouseenter':_0x44cb22['to'](()=>{this['_isSearchFocused']()||_0x4addff['focus']();}),'click':_0x44cb22['to'](()=>{this['_handleSearchResultButtonClick'](_0x4addff);})}}),this['_setupActionButtonExecution'](_0x4addff,_0x76f3ff,_0x1dfaca),_0x3f7366['children']['add'](_0x4addff),{'listItem':_0x3f7366,'highlightViews':[_0x505924,_0x3f2ef5]};}['_createSearchResultIndividualActionButton'](_0x3721cd,_0x54c753){const _0x41c3cf=new Ht(this['locale']),_0x2aa836=new _0x5e2f36(),_0x1d4d53=new Nt(this['locale'],_0x2aa836),_0x5ec693=_0x1d4d53['bindTemplate'];return _0x1d4d53['set']({'label':_0x54c753['label'],'withText':!0x0,'role':'menuitem','icon':void 0x0,'tooltip':!0x1,'class':'ck-ai-quick-actions-button\x20ck-ai-quick-actions-search-result-button'}),_0x1d4d53['extendTemplate']({'on':{'mouseenter':_0x5ec693['to'](()=>{this['_isSearchFocused']()||_0x1d4d53['focus']();})}}),this['_setupActionButtonExecution'](_0x1d4d53,_0x3721cd,_0x54c753),_0x41c3cf['children']['add'](_0x1d4d53),{'listItem':_0x41c3cf,'highlightViews':[_0x2aa836]};}['_createSearchResultGroupRow'](_0x5cfeb1,_0x328925){const _0x5cdc63=new vt(this['locale']),_0x531cd2=new xt();_0x531cd2['content']=_0x328925,_0x531cd2['extendTemplate']({'attributes':{'class':'ck-ai-quick-actions-button__group-icon'}});const _0x2c18a9=new _0x2a3dc2();return _0x2c18a9['text']=_0x5cfeb1,_0x5cdc63['setTemplate']({'tag':'div','attributes':{'class':'ck-ai-quick-actions-search-result__group-row'},'children':[_0x531cd2,_0x2c18a9]}),{'view':_0x5cdc63,'highlightView':_0x2c18a9};}['_createSearchResultActionRow'](_0x4a5735){const _0x1a094d=new vt(this['locale']),_0x3cb85a=new _0x2a3dc2();return _0x3cb85a['text']=_0x4a5735,_0x1a094d['setTemplate']({'tag':'div','attributes':{'class':'ck-ai-quick-actions-search-result__action-row'},'children':[_0x3cb85a]}),{'view':_0x1a094d,'highlightView':_0x3cb85a};}['_createSearchResultContentView'](_0x38ef27,_0x38d429){const _0x2d65c4=new vt(this['locale']);return _0x2d65c4['setTemplate']({'tag':'div','attributes':{'class':'ck-ai-quick-actions-search-result__content'},'children':[_0x38ef27,_0x38d429]}),_0x2d65c4;}['_setupActionButtonExecution'](_0x5344a4,_0x7a3402,_0x5d9b59){_0x5344a4['on']('execute',()=>{_0x7a3402['editing']['view']['focus'](),_0x7a3402['commands']['execute']('aiQuickAction',_0x5d9b59);});}['_createActionGroupButton'](_0x51001c,_0x3575e8,_0xcb3e18){const _0x30e885=new Ht(this['locale']),_0x169542=new _0x5e2f36(),_0x50db18=new Do(this['locale'],_0x169542),_0x2ce7c6=_0x50db18['bindTemplate'],_0x43fbdb=this['_getPanelKeystroke'](_0xcb3e18),_0x2e5439=this['_createGroupActionsList'](_0x51001c,_0x3575e8['actions'],_0xcb3e18);_0x50db18['set']({'label':_0x3575e8['label'],'withText':!0x0,'role':Mo,'icon':_0x3575e8['icon']??_0x4b17ba,'isEnabled':_0x3575e8['actions']['some'](_0x524424=>_0x524424['isEnabled'])}),_0x50db18['extendTemplate']({'on':{'mouseenter':_0x2ce7c6['to'](()=>{this['_isSearchFocused']()||_0x50db18['focus']();})}});const _0x19e321=new Xt(this['locale']);return _0x19e321['extendTemplate']({'attributes':{'class':['ck','ck-reset_all','ck-ai-quick-actions-group-panel','ck-dropdown-menu__nested-menu__panel']},'on':{'keydown':_0x2ce7c6['to'](_0x10feaa=>{this['_handlePanelKeydown'](_0x10feaa,_0x43fbdb,_0x50db18,_0x19e321);})}}),_0x50db18['bind']('isOn')['to'](_0x19e321,'isVisible'),this['_bodyCollection']['add'](_0x19e321),_0x19e321['content']['add'](_0x2e5439),this['_setupGroupMenuBehavior'](_0x50db18,_0x19e321),_0x30e885['children']['add'](_0x50db18),{'listItem':_0x30e885,'highlightView':_0x169542};}['_createGroupActionsList'](_0x207352,_0x5c6001,_0x2ca873){const _0x3813d7=new Dt(this['locale']);return _0x3813d7['extendTemplate']({'attributes':{'class':['ck','ck-reset_all','ck-ai-quick-actions-group-list','ck-dropdown-menu-list']}}),_0x5c6001['forEach'](_0x485a69=>{const _0xf15658=new Ht(this['locale']),_0x471a95=Lo({'editor':_0x207352,'action':_0x485a69,'withText':!0x0,'withIcon':!0x1,'isInDropdown':!0x0,'shouldPreventFocus':()=>this['_isSearchFocused']()})();_0xf15658['children']['add'](_0x471a95),_0x2ca873['focusTracker']['add'](_0x471a95),_0x3813d7['items']['add'](_0xf15658);}),_0x3813d7;}['_setupGroupMenuBehavior'](_0x1eb490,_0x5893d9){const _0x2b6367=_0x1eb490['bindTemplate'],_0xd90640=this['_getButtonKeystroke'](_0x1eb490);_0x1eb490['extendTemplate']({'attributes':{'class':['ck-ai-quick-actions-group-button']},'on':{'mouseenter':_0x2b6367['to'](()=>{this['_showNestedPanel'](_0x5893d9,_0x1eb490);}),'mouseleave':_0x2b6367['to'](_0x5789e4=>{const _0x17d671=_0x5789e4['relatedTarget'];this['_isMovingToNestedMenu'](_0x17d671,_0x5893d9)||this['_hideNestedPanel'](_0x5893d9);}),'keydown':_0x2b6367['to'](_0x382030=>{_0x382030['key']==_0xd90640&&(this['_showNestedPanel'](_0x5893d9,_0x1eb490),_0x5893d9['content']['get'](0x0)['focus']());})}}),_0x5893d9['on']('render',()=>{_0x5893d9['element']?.['addEventListener']('mouseleave',_0x1f41d1=>{const _0x13e651=_0x1f41d1['relatedTarget'];_0x1eb490['element']?.['contains'](_0x13e651)||this['_isMovingToNestedMenu'](_0x13e651,_0x5893d9)||this['_hideNestedPanel'](_0x5893d9);});});}['_showNestedPanel'](_0x2f4828,_0x3d78de){this['_openNestedPanels']['forEach'](_0x41fcd8=>{_0x41fcd8!==_0x2f4828&&_0x41fcd8['isVisible']&&_0x41fcd8['hide']();}),_0x2f4828['show'](),_0x2f4828['pin']({'positions':[_0x5557ff['eastSouth']],'target':_0x3d78de['element'],'fitInViewport':!0x0}),this['_openNestedPanels']['add'](_0x2f4828);}['_hideNestedPanel'](_0x5f2114){_0x5f2114['hide'](),this['_openNestedPanels']['delete'](_0x5f2114);}['_hideAllNestedPanels'](){this['_openNestedPanels']['forEach'](_0x3f2e70=>_0x3f2e70['hide']()),this['_openNestedPanels']['clear']();}['_isMovingToNestedMenu'](_0x4fe2db,_0x1ff17d){if(!_0x4fe2db)return!0x1;if(_0x1ff17d['element']?.['contains'](_0x4fe2db))return!0x0;const _0x35ee48=_0x4fe2db;return _0x35ee48['closest']&&(null!==_0x35ee48['closest']('.ck-ai-quick-actions-group-panel')||null!==_0x35ee48['closest']('.ck-ai-quick-actions-group-list')||null!==_0x35ee48['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'](_0x2e6e23){return'rtl'===_0x2e6e23['locale']['uiLanguageDirection']?'ArrowRight':'ArrowLeft';}['_getButtonKeystroke'](_0x37830a){return'rtl'===_0x37830a['locale']['uiLanguageDirection']?'ArrowLeft':'ArrowRight';}['_handlePanelKeydown'](_0x52cec0,_0x2c51ae,_0x1dc70f,_0x1f0707){_0x52cec0['key']==_0x2c51ae&&(_0x1dc70f['focus'](),this['_hideNestedPanel'](_0x1f0707));}['_handleSearchResultButtonClick'](_0x5c2929){_0x5c2929['fire']('execute');}}function Vo(_0x220c52){const {editor:_0x5409b0,content:_0x490382,buttonDefinition:_0x4df957,bodyCollection:_0x2d8e5c,hasSearch:_0x144f49=!0x1}=_0x220c52;return()=>{const _0x5b8233=_0x5409b0['locale'],_0x405182=_0x5409b0['commands']['get']('aiQuickAction'),_0x16b32a=Gt(_0x5b8233);_0x16b32a['bind']('isEnabled')['to'](_0x405182),_0x16b32a['buttonView']['set']({'icon':_0x4df957['icon']??_0x4b17ba,'label':_0x4df957['label'],'tooltip':!0x0}),_0x16b32a['set']({'class':'ck-ai-quick-actions-dropdown'});const _0x105f0c=new Uo(_0x5409b0,_0x490382,_0x16b32a,_0x2d8e5c,_0x144f49);return _0x16b32a['panelView']['children']['add'](_0x105f0c),_0x144f49&&_0x16b32a['on']('change:isOpen',(_0xf3b87a,_0x7bdc01,_0x1d7f1b)=>{if(_0x1d7f1b){if(_0x5409b0['plugins']['has']('AIEditing')){const _0x214ed8=_0x5409b0['plugins']['get'](Js),_0x54138e=_0x5409b0['model']['document']['selection'],_0x2fa5b0=Array['from'](_0x54138e['getRanges']());_0x2fa5b0['length']>0x0&&_0x214ed8['showFakeVisualSelection']({'ranges':_0x2fa5b0,'id':'quick-action','priority':0x14});}}else _0x5409b0['plugins']['has']('AIEditing')&&_0x5409b0['plugins']['get'](Js)['hideFakeVisualSelection']('quick-action'),_0x105f0c['resetSearch']();}),_0x16b32a;};}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 _0x5e9f88{static get['requires'](){return[_0x27055,as];}static get['pluginName'](){return'AIQuickActionsUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}async['init'](){const _0x33dd79=await this['_getDefaultAndCustomActions']();this['_prepareQuickActionsDefinition'](_0x33dd79),this['_initializeQuickActionsComponentsAndCommands']();}static['getDefaultQuickActions'](_0x1e4df3){return function(_0x592fcd){const _0x57b6ab=new Intl['DisplayNames'](['en'],{'type':'language'})['of'](_0x592fcd['uiLanguage']),_0x514ae8=_0x57b6ab||'English',_0x8725dd=[{'id':'ask-ai','label':hs(_0x592fcd,'AI_QUICK_ACTIONS_ASK_AI'),'type':'chat','icon':_0x3e3c44},{'id':'chat-commands','label':hs(_0x592fcd,'AI_QUICK_ACTIONS_CHAT_COMMANDS'),'icon':_0x3e3c44,'actions':[{'id':'explain','label':hs(_0x592fcd,'AI_QUICK_ACTIONS_EXPLAIN'),'displayedPrompt':hs(_0x592fcd,'AI_QUICK_ACTIONS_EXPLAIN'),'prompt':Bo['replace']('%0',_0x514ae8),'type':'chat'},{'id':'summarize','label':hs(_0x592fcd,'AI_QUICK_ACTIONS_SUMMARIZE'),'displayedPrompt':hs(_0x592fcd,'AI_QUICK_ACTIONS_SUMMARIZE'),'prompt':Go['replace']('%0',_0x514ae8),'type':'chat'},{'id':'highlight-key-points','label':hs(_0x592fcd,'AI_QUICK_ACTIONS_HIGHLIGHT_KEY_POINTS'),'displayedPrompt':hs(_0x592fcd,'AI_QUICK_ACTIONS_HIGHLIGHT_KEY_POINTS'),'prompt':Fo['replace']('%0',_0x514ae8),'type':'chat'}]},{'id':'improve-writing','label':hs(_0x592fcd,'AI_QUICK_ACTIONS_IMPROVE_WRITING'),'type':'action','icon':_0x3e538e},{'id':'continue','label':hs(_0x592fcd,'AI_QUICK_ACTIONS_CONTINUE_WRITING'),'type':'action','icon':_0x21142e},{'id':'fix-grammar','label':hs(_0x592fcd,'AI_QUICK_ACTIONS_FIX_GRAMMAR_SPELLING'),'type':'action','icon':_0x4ab159},{'id':'adjust-length','label':hs(_0x592fcd,'AI_QUICK_ACTIONS_ADJUST_LENGTH'),'icon':_0x4645a8,'actions':[{'id':'make-shorter','label':hs(_0x592fcd,'AI_QUICK_ACTIONS_MAKE_SHORTER'),'type':'action'},{'id':'make-longer','label':hs(_0x592fcd,'AI_QUICK_ACTIONS_MAKE_LONGER'),'type':'action'}]},{'id':'change-tone','label':hs(_0x592fcd,'AI_QUICK_ACTIONS_CHANGE_TONE'),'icon':_0x32d64c,'actions':[{'id':'make-tone-casual','label':hs(_0x592fcd,'AI_QUICK_ACTIONS_MORE_CASUAL'),'type':'action'},{'id':'make-tone-direct','label':hs(_0x592fcd,'AI_QUICK_ACTIONS_MORE_DIRECT'),'type':'action'},{'id':'make-tone-friendly','label':hs(_0x592fcd,'AI_QUICK_ACTIONS_MORE_FRIENDLY'),'type':'action'},{'id':'make-tone-confident','label':hs(_0x592fcd,'AI_QUICK_ACTIONS_MORE_CONFIDENT'),'type':'action'},{'id':'make-tone-professional','label':hs(_0x592fcd,'AI_QUICK_ACTIONS_MORE_PROFESSIONAL'),'type':'action'}]},{'id':'translate','label':hs(_0x592fcd,'AI_QUICK_ACTIONS_TRANSLATE'),'icon':_0x157c37,'actions':[{'id':'translate-to-english','label':hs(_0x592fcd,'AI_QUICK_ACTIONS_TRANSLATE_ENGLISH'),'type':'action','actionName':'translate','args':{'language':'english'}},{'id':'translate-to-chinese','label':hs(_0x592fcd,'AI_QUICK_ACTIONS_TRANSLATE_CHINESE'),'type':'action','actionName':'translate','args':{'language':'chinese'}},{'id':'translate-to-spanish','label':hs(_0x592fcd,'AI_QUICK_ACTIONS_TRANSLATE_SPANISH'),'type':'action','actionName':'translate','args':{'language':'spanish'}},{'id':'translate-to-german','label':hs(_0x592fcd,'AI_QUICK_ACTIONS_TRANSLATE_GERMAN'),'type':'action','actionName':'translate','args':{'language':'german'}},{'id':'translate-to-french','label':hs(_0x592fcd,'AI_QUICK_ACTIONS_TRANSLATE_FRENCH'),'type':'action','actionName':'translate','args':{'language':'french'}},{'id':'translate-to-japanese','label':hs(_0x592fcd,'AI_QUICK_ACTIONS_TRANSLATE_JAPANESE'),'type':'action','actionName':'translate','args':{'language':'japanese'}},{'id':'translate-to-portuguese','label':hs(_0x592fcd,'AI_QUICK_ACTIONS_TRANSLATE_PORTUGUESE'),'type':'action','actionName':'translate','args':{'language':'portuguese'}},{'id':'translate-to-korean','label':hs(_0x592fcd,'AI_QUICK_ACTIONS_TRANSLATE_KOREAN'),'type':'action','actionName':'translate','args':{'language':'korean'}},{'id':'translate-to-italian','label':hs(_0x592fcd,'AI_QUICK_ACTIONS_TRANSLATE_ITALIAN'),'type':'action','actionName':'translate','args':{'language':'italian'}},{'id':'translate-to-russian','label':hs(_0x592fcd,'AI_QUICK_ACTIONS_TRANSLATE_RUSSIAN'),'type':'action','actionName':'translate','args':{'language':'russian'}}]},{'id':'other','label':hs(_0x592fcd,'AI_QUICK_ACTIONS_OTHER'),'icon':_0x4b2fde,'actions':[]}];return _0x8725dd;}(_0x1e4df3);}async['_getDefaultAndCustomActions'](){const _0x423479=Wo['getDefaultQuickActions'](this['editor']['locale']),_0x54668f=this['editor']['config']['get']('ai.quickActions.extraCommands')||[];let _0x58d347,_0x42b55d=[];try{const _0x4abae0=new Fs({'connector':this['editor']['plugins']['get']('AIConnector'),'config':this['editor']['config']['get']('ai.models'),'locale':this['editor']['locale']});_0x42b55d=await _0x4abae0['getAll'](),_0x58d347=(await _0x4abae0['getDefault']())?.['id'];}catch(_0x4791df){const _0x1542c0=new at('ai-quick-actions-models-unable-to-retrieve',this,{'error':_0x4791df});Et(_0x1542c0['message']);}finally{const _0x5a74db=_0x54668f['map'](_0x42f8cd=>({..._0x42f8cd,'type':'chat'===_0x42f8cd['type']?'chat':'action','model':'chat'!==_0x42f8cd['type']?_0x42f8cd['model']||_0x58d347:_0x42f8cd['model'],'icon':void 0x0}));_0x423479['find'](_0xd0d321=>'other'===_0xd0d321['id'])['actions']['push'](..._0x5a74db),_0x423479['forEach'](_0x3fa1e1=>{if('actions'in _0x3fa1e1)_0x3fa1e1['actions']['forEach'](_0x2eb821=>{if(_0x2eb821['isEnabled']=!!_0x42b55d['find'](_0x42df70=>_0x42df70['id']===_0x2eb821['model'])||void 0x0===_0x2eb821['model'],!_0x2eb821['isEnabled']){const _0x2ada38=new at('ai-quick-actions-unavailable-model',this,{'actionId':_0x2eb821['id'],'modelId':_0x2eb821['model']});Et(_0x2ada38['message']);}});else{if(_0x3fa1e1['isEnabled']=!!_0x42b55d['find'](_0xe2b049=>_0xe2b049['id']===_0x3fa1e1['model'])||void 0x0===_0x3fa1e1['model'],!_0x3fa1e1['isEnabled']){const _0x1af428=new at('ai-quick-actions-unavailable-model',this,{'actionId':_0x3fa1e1['id'],'modelId':_0x3fa1e1['model']});Et(_0x1af428['message']);}}});}return _0x423479;}['_initializeQuickActionsComponentsAndCommands'](){const _0x37bebb=new Qt(this['editor']['locale']);_0x37bebb['attachToDom'](),this['_initializeQuickActionsDropdown'](_0x37bebb),this['_initializeQuickActionsMenuBar'](),this['_initializeQuickActionsComponents'](_0x37bebb);}['_initializeQuickActionsDropdown'](_0x3ca972){const _0x5479f9=this['editor']['config']['get']('ai.quickActions.isSearchEnabled')??!0x0;this['editor']['ui']['componentFactory']['add']('aiQuickActions',Vo({'editor':this['editor'],'content':this['_quickActionsDefinition'],'buttonDefinition':{'icon':_0x4b17ba,'label':hs(this['editor']['locale'],'AI_QUICK_ACTIONS_HEADING')},'bodyCollection':_0x3ca972,'hasSearch':_0x5479f9}));}['_prepareQuickActionsDefinition'](_0x21ffe3){this['_quickActionsDefinition']=_0x21ffe3['map'](_0x49e270=>{if('actions'in _0x49e270){const _0x4f01db=_0x49e270;return{..._0x4f01db,'actions':_0x4f01db['actions']['map'](_0x580714=>{const {actions:_0x4c3b22,..._0x35a635}=_0x4f01db;return{..._0x580714,'parent':_0x35a635};})['filter'](_0x181978=>this['_shouldIncludeAction'](_0x181978))};}return _0x49e270;})['filter'](_0x483fe5=>'actions'in _0x483fe5?_0x483fe5['actions']['length']>0x0:this['_shouldIncludeAction'](_0x483fe5));}['_shouldIncludeAction'](_0x1d664c){const _0x363995=this['editor']['config']['get']('ai.quickActions.removeCommands')||[];return this['editor']['plugins']['has'](Ko[_0x1d664c['type']])&&!_0x363995['includes'](_0x1d664c['id'])&&!('chat'===_0x1d664c['type']&&!0x1===this['editor']['config']['get']('ai.chat.context.document.enabled'));}['_initializeQuickActionsComponents'](_0x270a5d){this['_quickActionsDefinition']['forEach'](_0x313914=>{if('actions'in _0x313914){const _0xbed3e=Vo({'editor':this['editor'],'content':_0x313914['actions'],'buttonDefinition':_0x313914,'bodyCollection':_0x270a5d});this['editor']['ui']['componentFactory']['add'](_0x313914['id'],_0xbed3e),_0x313914['actions']['forEach'](_0x50561f=>{const _0x8d1257=Lo({'editor':this['editor'],'action':_0x50561f});this['editor']['ui']['componentFactory']['add'](_0x50561f['id'],_0x8d1257);});}else{const _0x371fdb=Lo({'editor':this['editor'],'action':_0x313914,'withText':!0x1,'withIcon':!0x0,'isInDropdown':!0x1});this['editor']['ui']['componentFactory']['add'](_0x313914['id'],_0x371fdb);}});}['_initializeQuickActionsMenuBar'](){this['editor']['ui']['componentFactory']['add']('menuBar:aiQuickActions',_0x272917=>{const _0x4ad491=this['editor']['commands']['get']('aiQuickAction'),_0x73b491=new Kt(_0x272917),_0xa44a7b=hs(_0x272917,'AI_QUICK_ACTIONS_HEADING');_0x73b491['buttonView']['set']({'label':_0xa44a7b,'icon':_0x4b17ba});const _0x392b50=new $t(_0x272917);return _0x392b50['set']({'ariaLabel':_0xa44a7b,'role':'menu'}),this['_quickActionsDefinition']['forEach'](_0x1c7fa6=>{if('actions'in _0x1c7fa6){const _0x134ab7=_0x1c7fa6,_0x13d2a5=new qt(_0x272917,_0x73b491),_0x136648=new Kt(_0x272917),_0x28b72e=new $t(_0x272917);_0x136648['buttonView']['set']({'label':_0x134ab7['label'],'icon':_0x134ab7['icon']}),_0x134ab7['actions']['forEach'](_0x326d8d=>{const _0x4e088c=new qt(_0x272917,_0x136648),_0x25a1f2=new Wt(_0x272917);_0x25a1f2['set']({'label':_0x326d8d['label'],'icon':_0x326d8d['icon'],'role':'menuitem','isEnabled':_0x326d8d['isEnabled']}),_0x25a1f2['on']('execute',()=>{this['_executeQuickAction'](_0x326d8d);}),_0x25a1f2['delegate']('execute')['to'](_0x136648),_0x4e088c['children']['add'](_0x25a1f2),_0x28b72e['items']['add'](_0x4e088c);}),_0x136648['panelView']['children']['add'](_0x28b72e),_0x13d2a5['children']['add'](_0x136648),_0x392b50['items']['add'](_0x13d2a5);}else{const _0x39065c=_0x1c7fa6,_0x1b76ba=new qt(_0x272917,_0x73b491),_0x114419=new Wt(_0x272917);_0x114419['set']({'label':_0x39065c['label'],'icon':_0x39065c['icon'],'role':'menuitem','isEnabled':_0x39065c['isEnabled']}),_0x114419['on']('execute',()=>{this['_executeQuickAction'](_0x39065c);}),_0x114419['delegate']('execute')['to'](_0x73b491),_0x1b76ba['children']['add'](_0x114419),_0x392b50['items']['add'](_0x1b76ba);}}),(Object['values'](Ko)['some'](_0x333c93=>this['editor']['plugins']['has'](_0x333c93))?_0x73b491['bind']('isEnabled')['to'](_0x4ad491):_0x73b491['set']({'isEnabled':!0x1}),_0x73b491['panelView']['children']['add'](_0x392b50),_0x73b491);});}['_executeQuickAction'](_0x40fd28){const _0x39aa24=this['editor'];_0x39aa24['editing']['view']['focus'](),_0x39aa24['commands']['execute']('aiQuickAction',_0x40fd28);const _0x22ace6=_0x39aa24['ui']['view']['menuBarView'];_0x22ace6&&_0x22ace6['close']&&_0x22ace6['close']();}}class Yo extends _0x2086ab{['execute'](_0x1dcf4b){switch(this['_expandSelectionIfCollapsed'](),_0x1dcf4b['type']){case'chat':if(!this['editor']['plugins']['has']('AIChat')){const _0x31478a=hs(this['editor']['locale'],'AI_QUICK_ACTIONS_PLUGIN_NOT_FOUND','AIChat');throw new at('ai-quick-actions-plugin-not-found',this['editor'],{'errorMessage':_0x31478a});}this['_handleAIChatAction'](_0x1dcf4b);break;case'action':if(!this['editor']['plugins']['has']('AIActions')){const _0x7aaf7c=hs(this['editor']['locale'],'AI_QUICK_ACTIONS_PLUGIN_NOT_FOUND','AIActions');throw new at('ai-quick-actions-plugin-not-found',this['editor'],{'errorMessage':_0x7aaf7c});}this['_handleAIActionsAction'](_0x1dcf4b);}}async['_handleAIChatAction'](_0xa7a69c){const _0x3a0d95=this['editor']['plugins']['get']('AIChatController'),_0x31f933=this['editor']['plugins']['get']('AITabs')['view'];if(_0x31f933['isVisible']||(_0x31f933['isVisible']=!0x0),'chat'!==_0x31f933['activeTab']&&_0x31f933['activateTab']('chat'),'ask-ai'===_0xa7a69c['id'])_0x3a0d95['removeSelectionFromChatContext'](),_0x3a0d95['addSelectionToChatContext'](),_0x3a0d95['focusPromptInput']();else await _0x3a0d95['startConversation']({'modelId':_0xa7a69c['model']}),_0x3a0d95['removeSelectionFromChatContext'](),_0x3a0d95['addSelectionToChatContext'](),_0x3a0d95['focusPromptInput'](),await _0x3a0d95['sendMessage']({'message':_0xa7a69c['prompt']||_0xa7a69c['displayedPrompt']||_0xa7a69c['label'],'attributes':{'quickActionData':{'id':_0xa7a69c['id']},'displayedPrompt':_0xa7a69c['displayedPrompt']}});}['_expandSelectionIfCollapsed'](){const _0x512ddc=this['editor'],_0x53cec7=_0x512ddc['model']['document']['selection'];if(!_0x53cec7['isCollapsed'])return;const _0x7ab505=At(_0x53cec7['getSelectedBlocks']())||_0x512ddc['model']['schema']['getLimitElement'](_0x53cec7);_0x512ddc['model']['change'](_0xa2ad58=>{_0xa2ad58['setSelection'](_0x7ab505,'in');});}['_handleAIActionsActionLabel'](_0x4c016e){return _0x4c016e['parent']?.['label']&&'other'!==_0x4c016e['parent']?.['id']?_0x4c016e['parent']['label']+':\x20'+_0x4c016e['label']:_0x4c016e['label'];}async['_handleAIActionsAction'](_0x529dd4){const _0x127132=this['editor']['plugins']['get']('AIActions'),_0x3a4d80=_0x529dd4['prompt']?{'userMessage':_0x529dd4['prompt'],'model':_0x529dd4['model']}:{'actionName':_0x529dd4['actionName']||_0x529dd4['id'],'args':_0x529dd4['args']},_0xc87037=this['_handleAIActionsActionLabel'](_0x529dd4);await _0x127132['executeAction'](_0x3a4d80,_0xc87037,_0x529dd4['icon']);}}class $o extends _0x5e9f88{static get['pluginName'](){return'AIQuickActionsEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const _0x307801=this['editor'],_0x35953d=new Yo(this['editor']);if(_0x307801['commands']['add']('aiQuickAction',_0x35953d),_0x307801['plugins']['has']('AIChat')){const _0x3cb50e=this['editor']['plugins']['get']('AIChatController');_0x307801['model']['document']['selection']['on']('change:range',(_0x588c8d,_0x15582d)=>{_0x15582d['directChange']&&_0x3cb50e['removeSelectionFromChatContext']();});}}}class qo extends xs{['updateChangeGroups'](){if(this['parsedMergedContent']=this['parsedContent']['cloneNode'](!0x0),0x0==this['parsedMergedContent']['childNodes']['length'])return void(this['changeGroups']=[]);const _0xef0726=this['documentContextContent']['children']['map'](_0x1ef18c=>({'node':_0x1ef18c,'id':Es(_0x1ef18c,'data-id')})),_0x269269=this['parsedMergedContent']['children']['map'](_0x114627=>({'node':_0x114627,'id':Es(_0x114627,'data-id')||ot()})),_0x25cb01=_0x58b9fe(_0xef0726,_0x269269,{'comparator':(_0x594f98,_0x502258)=>_0x594f98['id']==_0x502258['id'],'oneChangePerToken':!0x0});if(!this['isDone']||!this['isComplete']){for(;_0x25cb01['length']&&_0x25cb01[_0x25cb01['length']-0x1]['removed'];)_0x25cb01['pop']();}const _0x1ad75c=_0x25cb01['map'](_0x355683=>{const _0xf0bad7=_0x355683['added']?'new':_0x355683['removed']?'removed':'modified';return{'node':_0x355683['value'][0x0]['node'],'type':_0xf0bad7,'id':_0x355683['value'][0x0]['id']};});this['changeGroups']=[{'changes':_0x1ad75c,'state':'pending','index':0x0}];}['_getDifferentChangeGroups'](_0x20e84c,_0x9e9fa0){return _0x9e9fa0;}}class Qo extends Ds{['content'];['version'];['actionName'];['args'];['userMessage'];['model'];['hasError']=!0x1;['stoppedExplicitly']=!0x1;constructor(_0x38c9f0){super(_0x38c9f0),this['content']=_0x38c9f0['content'],this['version']=_0x38c9f0['version'],this['actionName']=_0x38c9f0['actionName'],this['args']=_0x38c9f0['args'],this['userMessage']=_0x38c9f0['userMessage'],this['model']=_0x38c9f0['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'](_0x2f546a){const _0x195564=new qo({'locale':this['locale'],'documentContextContent':this['content'],..._0x2f546a});return this['replies']['push'](_0x195564),_0x195564['delegate'](...Ls)['to'](this),this['fire']('replyCreated',_0x195564),_0x195564;}}class Xo extends kt{constructor(_0x2812e5,_0x40a889=!0x0,_0x10acb6=!0x0){super(_0x2812e5),this['set']('isEnabled',!0x1),_0x40a889&&(this['applyButton']=this['_createButton'](hs(_0x2812e5,'AI_BALLOON_APPLY_BUTTON'),cs),this['applyButton']['bind']('isEnabled')['to'](this),this['items']['add'](this['applyButton'])),_0x10acb6&&(this['suggestButton']=this['_createButton'](hs(_0x2812e5,'AI_BALLOON_SUGGEST_BUTTON'),_0x40a889?ls:cs),this['suggestButton']['bind']('isEnabled')['to'](this),this['items']['add'](this['suggestButton'])),this['setButtonsVisibility']({'showApplyButton':_0x40a889,'showSuggestButton':_0x10acb6}),this['extendTemplate']({'attributes':{'class':['ck-ai-balloon__toolbar']}});}['setButtonsVisibility']({showApplyButton:_0x2dd977,showSuggestButton:_0x1b1209}){this['applyButton']&&(this['applyButton']['isVisible']=_0x2dd977),this['suggestButton']&&(this['suggestButton']['isVisible']=_0x1b1209);}['_createButton'](_0x73609b,_0x5e2257){const _0x39caec=new Nt(this['locale']);return _0x39caec['set']({'label':_0x73609b,'class':_0x5e2257,'isVisible':!0x0,'withText':!0x0}),_0x39caec;}}class zo extends vt{constructor(_0x37e1c0){super(_0x37e1c0),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(_0x37e1c0,'AI_DISCLAIMER_TEXT')}]}]});}}class jo extends vt{constructor(_0xd7d992){super(_0xd7d992),this['set']('isVisible',!0x0);const _0x512e3c=new yn('small');_0x512e3c['isVisible']=!0x0;const _0x138aa3=new vt(this['locale']);_0x138aa3['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',_0x3fa03e=>!_0x3fa03e)]},'children':[_0x512e3c,_0x138aa3]});}}class Jo extends So{['focusCycler'];['_config'];['_contentWrapper'];['_streamableContentView'];['_toolbarView'];['_miniToolbarView'];['_loaderView'];['_disclaimerView'];['_focusTracker'];['_keystrokes'];['_dialogContent'];['_focusables'];['_scrollManager'];['_navigationPreviousButton'];['_navigationNextButton'];['_navigationTryAgainButton'];['_navigationCounter'];constructor(_0x40bd4f,_0xefd9e1){super(_0x40bd4f),this['set']('isBusy',!0x1),this['set']('isTrackChangesOn',!0x1),this['set']('_isLoading',!0x1),this['set']('_hasError',!0x1),this['_config']=_0xefd9e1,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 _0x2fb855(),this['_addContentWrapper'](_0xefd9e1),this['_addDisclaimerView'](),this['_addToolbar'](_0xefd9e1),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'](_0xefd9e1);});}['render'](){super['render']();for(const _0x15f7ae of this['_focusables'])this['_focusTracker']['add'](_0x15f7ae['element']);this['_keystrokes']['listenTo'](this['element']),this['_initializeScrollManager']();}['destroy'](){super['destroy'](),this['_scrollManager']&&this['_scrollManager']['destroy']();}['focus'](_0x244b5d){-0x1===_0x244b5d?this['focusCycler']['focusLast']():this['focusCycler']['focusFirst']();}['setIsLoading'](_0x4cb30a){this['_isLoading']=_0x4cb30a;}['setErrorState'](){this['_hasError']=!0x0,this['_miniToolbarView']['toggleShowChangesEnabled'](!0x1);}['clearErrorState'](){this['_hasError']=!0x1,this['_miniToolbarView']['toggleShowChangesEnabled'](!0x0);}['showError'](_0x4d5458){super['showError'](_0x4d5458),this['_dialogContent']['has'](this['_errorView'])||this['_dialogContent']['add'](this['_errorView'],0x0);}['hideError'](){super['hideError'](),this['clearErrorState']();}['showBlockingError'](_0x5b32e4){super['showBlockingError'](_0x5b32e4),this['setErrorState']();}['addMiniToolbarItem'](_0x2ba8a9){this['_miniToolbarView']['items']['has'](_0x2ba8a9)||this['_miniToolbarView']['items']['add'](_0x2ba8a9);}['removeMiniToolbarItem'](_0x3bf7ad){this['_miniToolbarView']['items']['has'](_0x3bf7ad)&&this['_miniToolbarView']['items']['remove'](_0x3bf7ad);}['showLoader'](){this['_loaderView']&&(this['_isLoading']=!0x0);}['hideLoader'](){this['_loaderView']&&(this['_isLoading']=!0x1);}['_toggleToolbarButtonsVisibility']({showApplyButton:_0x1902c1,showSuggestButton:_0x5b07b6}){_0x1902c1=_0x1902c1&&!this['isTrackChangesOn']&&this['_config']['availableActions']['includes']('applySuggestion'),_0x5b07b6=_0x5b07b6&&this['_config']['availableActions']['includes']('insertSuggestion'),this['_toolbarView']['setButtonsVisibility']({'showApplyButton':_0x1902c1,'showSuggestButton':_0x5b07b6});}async['updateContent'](_0x2990ed){await this['_streamableContentView']['update'](_0x2990ed);}['clearContent'](){this['_streamableContentView']['clear']();}['_addContentWrapper'](_0x5b9ffd){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'](_0x5b9ffd['miniToolbarConfig'])]}),this['_dialogContent']['add'](this['_contentWrapper']);}['_addDisclaimerView'](){this['_disclaimerView']=new zo(this['locale']),this['_dialogContent']['add'](this['_disclaimerView']);}['_addToolbar']({showApplyButton:_0x371540,showSuggestButton:_0x392b57}){this['_toolbarView']=new Xo(this['locale'],_0x371540,_0x392b57),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',(_0x14729d,_0x4e481a,_0x17e096)=>!(_0x14729d||_0x4e481a||_0x17e096)),this['_toggleToolbarButtonsVisibility']({'showApplyButton':_0x371540,'showSuggestButton':_0x392b57}),this['_dialogContent']['add'](this['_toolbarView']);}['_createMiniToolbar'](_0xda8f56){return this['_miniToolbarView']=new ko(this['locale'],_0xda8f56),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',(_0xc46c56,_0x4b9279)=>!(_0xc46c56||_0x4b9279)),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 _0x422f98=new Nt(this['locale']),_0x4135b8=new Nt(this['locale']),_0x857a06=new Zo(this['locale']),_0x4c4e3f=new Nt(this['locale']);_0x422f98['set']({'icon':tt,'label':hs(this['locale'],'AI_ACTIONS_TRY_AGAIN'),'tooltip':!0x0,'class':'ck-ai-custom-action-button\x20'+us}),_0x4135b8['set']({'icon':_0x15e3cb,'tooltip':hs(this['locale'],'AI_ACTIONS_PREVIOUS_INTERACTION'),'class':'ck-ai-navigation-button\x20ck-ai-previous-button\x20'+us}),_0x4c4e3f['set']({'icon':et,'tooltip':hs(this['locale'],'AI_ACTIONS_NEXT_INTERACTION'),'class':'ck-ai-navigation-button\x20ck-ai-next-button\x20'+us}),_0x422f98['bind']('isEnabled')['to'](this,'isBusy',_0xd696bf=>!_0xd696bf),_0x422f98['on']('execute',()=>{this['fire']('tryAgain');}),_0x4135b8['bind']('isEnabled')['to'](this,'isBusy',_0x4b926a=>!_0x4b926a),_0x4135b8['on']('execute',()=>{this['fire']('showPrevious');}),_0x4c4e3f['bind']('isEnabled')['to'](this,'isBusy',_0x22de30=>!_0x22de30),_0x4c4e3f['on']('execute',()=>{this['fire']('showNext');}),this['_navigationPreviousButton']=_0x4135b8,this['_navigationCounter']=_0x857a06,this['_navigationNextButton']=_0x4c4e3f,this['_navigationTryAgainButton']=_0x422f98;}['updateMiniToolbarButtons'](_0x35db82,_0x50f8dc){this['_navigationPreviousButton']||this['_setupMiniToolbarButtons']();const _0x5317e0=_0x35db82>0x1;if(this['addMiniToolbarItem'](this['_navigationTryAgainButton']),_0x5317e0){this['addMiniToolbarItem'](this['_navigationPreviousButton']),this['addMiniToolbarItem'](this['_navigationCounter']),this['addMiniToolbarItem'](this['_navigationNextButton']);const _0x5000ee=_0x35db82-_0x50f8dc;this['_navigationCounter']['setInteractionCount'](_0x5000ee+'/'+_0x35db82),this['_navigationPreviousButton']['isEnabled']=_0x50f8dc<_0x35db82-0x1,this['_navigationNextButton']['isEnabled']=_0x50f8dc>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'](_0x1374c4){this['_isLoading']=_0x1374c4;}['resetShowChangesButton'](){this['_miniToolbarView']['isShowChangesOn']=!0x1;}['_initializeScrollManager'](){const _0xee9e44=this['_getScrollableElement']();_0xee9e44&&!this['_scrollManager']&&(this['_scrollManager']=new sr(_0xee9e44));}['_getScrollableElement'](){return this['_streamableContentView']['element'];}}class Zo extends vt{constructor(_0x2e19e3){super(_0x2e19e3);const _0x512db0=this['bindTemplate'];this['set']('interactionCount','1/1'),this['setTemplate']({'tag':'span','attributes':{'class':['ck-ai-interaction-counter']},'children':[{'text':_0x512db0['to']('interactionCount')}]});}['setInteractionCount'](_0x161a99){this['set']('interactionCount',_0x161a99);}}class ta extends _0x5e9f88{static get['requires'](){return[as,Bt,Js,Oo,_0x367c6c];}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(_0x3708ee){super(_0x3708ee),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'](_0x2b597f,_0x1090ec,_0x45a9d2){if(this['_stopInteraction'](),this['editor']['plugins']['has']('TableSelection')){if(this['editor']['plugins']['get']('TableSelection')['getSelectedTableCells']()){const {modelFragment:_0x408100,anchorData:_0xb4890a,root:_0x5ec7e5}=this['_getExecuteDataInTable']();return this['_executeAction'](_0x2b597f,_0x408100,_0xb4890a,_0x5ec7e5,_0x1090ec,_0x45a9d2);}}const {modelFragment:_0x43c8bf,anchorData:_0x1331a0,root:_0x2e1beb}=this['_getExecuteDataRegular']();return this['_executeAction'](_0x2b597f,_0x43c8bf,_0x1331a0,_0x2e1beb,_0x1090ec,_0x45a9d2);}async['destroy'](){return this['_stopInteraction'](),this['_bodyCollection']['detachFromDom'](),super['destroy']();}['_createActionsBalloonView'](){const _0x4bef03=this['editor']['plugins']['has']('TrackChanges');let _0x35fd40=this['editor']['config']['get']('ai.availableReplyActions')||[...fn];_0x4bef03||(_0x35fd40=_0x35fd40['filter'](_0x5f1aa4=>'insertSuggestion'!=_0x5f1aa4));const _0x438674=this['editor']['commands']['get']('trackChanges'),_0x3206c1=new Jo(this['editor']['locale'],{'showApplyButton':!0x0,'showSuggestButton':_0x4bef03,'miniToolbarConfig':{'showChanges':'icon'},'availableActions':_0x35fd40});return _0x3206c1['bind']('isBusy')['to'](this),_0x438674&&_0x3206c1['bind']('isTrackChangesOn')['to'](_0x438674,'value'),_0x3206c1['on']('tryAgain',()=>{this['_refreshInteraction']();}),_0x3206c1['on']('showPrevious',()=>{this['_navigateToPrevious']();}),_0x3206c1['on']('showNext',()=>{this['_navigateToNext']();}),_0x3206c1;}['_getExecuteDataRegular'](){const _0x266dc2=this['editor']['model']['document']['selection'],_0xe2bd1a=_0x266dc2['getFirstRange']()['start']['root'];if(_0x266dc2['isCollapsed']){const _0x50bf02=At(_0x266dc2['getSelectedBlocks']())||this['editor']['model']['schema']['getLimitElement'](_0x266dc2);this['editor']['model']['change'](_0x4656b8=>{_0x4656b8['setSelection'](_0x50bf02,'in');});}const _0x1be4a8=_0x266dc2['getFirstRange'](),_0x5b39e0=this['_wrapWithCommonAncestors'](this['editor']['model']['getSelectedContent'](_0x266dc2),_0x1be4a8['start'],_0x1be4a8['end']);this['_copyMarkersToFragment'](_0x5b39e0,_0x266dc2,{'isTableSelection':!0x1});const _0x5ab17c=_0x266dc2['getFirstRange']()['start'],_0x1dd886=new Map();let _0x378362=_0x5b39e0;for(let _0x4a3509=0x0;_0x4a3509<_0x5ab17c['path']['length'];_0x4a3509++)_0x1dd886['set'](_0x378362,_0x5ab17c['path'][_0x4a3509]),_0x378362=_0x378362['getChild'](0x0);return{'modelFragment':_0x5b39e0,'anchorData':_0x1dd886,'root':_0xe2bd1a};}['_getExecuteDataInTable'](){const _0x1fcc28=this['editor']['model']['document']['selection'],_0x510e72=this['editor']['plugins']['get']('TableSelection'),_0xb9a87c=_0x1fcc28['getFirstRange']()['start']['root'],_0x27ac9a=_0x510e72['getSelectionAsFragment'](),_0x4d984c=_0x1fcc28['getFirstRange']()['start']['parent']['parent'],_0x2bfd0e=this['editor']['model']['createRange'](this['editor']['model']['createPositionBefore'](_0x4d984c),this['editor']['model']['createPositionAfter'](_0x4d984c)),_0x49ecfc=this['_wrapWithCommonAncestors'](_0x27ac9a,_0x2bfd0e['start'],_0x2bfd0e['end']);this['_copyMarkersToFragment'](_0x49ecfc,_0x1fcc28,{'isTableSelection':!0x0});const _0x4f4337=_0x1fcc28['getFirstRange']()['start'],_0x398463=new Map();let _0x1ba25a=_0x49ecfc;for(let _0xe14073=0x0;_0xe14073<_0x4f4337['path']['length'];_0xe14073++)if(_0x398463['set'](_0x1ba25a,_0x4f4337['path'][_0xe14073]),_0xe14073<_0x4f4337['path']['length']-0x1)_0x1ba25a=_0x1ba25a['getChild'](0x0);else{let _0x9b4221=_0x1ba25a['nextSibling'];for(;_0x9b4221;)_0x398463['set'](_0x9b4221,_0x4f4337['path'][_0xe14073]),_0x9b4221=_0x9b4221['nextSibling'];}return{'modelFragment':_0x49ecfc,'anchorData':_0x398463,'root':_0xb9a87c};}async['_executeAction'](_0x3adf59,_0xd49c8b,_0x1f7f82,_0x3029fa,_0x45e187,_0x326029){const _0x10c5b9=this['editor']['plugins']['get'](Js),_0x4c30f4=this['editor']['plugins']['get'](Oo),_0x3c4cf9=this['editor']['model']['document']['selection'],_0x1e2270=await _0x10c5b9['modelToDataWithIds'](_0xd49c8b),_0x43b828=this['editor']['model']['document']['version'],_0x5c12d1=[..._0x3c4cf9['getRanges']()];return this['_actionsBalloonView']||(this['_actionsBalloonView']=this['_createActionsBalloonView']()),this['_clearInteractionHistory'](),this['_clearErrorState'](),this['_balloonShowDiff']=!0x1,this['_actionsBalloonView']['resetShowChangesButton'](),this['_actionsBalloonView']['clearContent'](),_0x4c30f4['open']({'index':0x3e8*Math['random']()%0x3e8,'title':_0x45e187,'icon':_0x326029||_0x4b17ba,'mainView':this['_actionsBalloonView'],'class':'ck-ai-actions-balloon','ranges':_0x5c12d1,'id':'aiActionsBalloon'}),this['_setLoadingState'](),this['stopListening'](this['_actionsBalloonView']),this['stopListening'](_0x4c30f4),this['_interactionParams']={'action':_0x3adf59,'content':_0x1e2270,'version':_0x43b828,'aiBalloon':_0x4c30f4,'modelFragment':_0xd49c8b,'anchorData':_0x1f7f82,'root':_0x3029fa},this['_setupApplyListeners'](),this['listenTo'](_0x4c30f4,'selectionRemoved',()=>{this['_stopInteraction'](),this['_actionsBalloonView']['disableMiniToolbarButtons']();}),this['listenTo'](_0x4c30f4,'dialogClosed',(_0x4d68cc,{id:_0x6947b9})=>{if('aiActionsBalloon'===_0x6947b9){for(const _0x1ec4c1 of this['_interactions']){if(0x0===_0x1ec4c1['replies']['length']||_0x1ec4c1['stoppedExplicitly'])continue;const _0x54dc88=_0x1ec4c1['replies'][_0x1ec4c1['replies']['length']-0x1],_0x14dfac=_0x54dc88['changeGroups'][0x0];_0x14dfac&&'pending'===_0x14dfac['state']&&_0x54dc88['setChangeGroupState'](0x0,'rejected');}this['_stopInteraction'](),this['_clearInteractionHistory'](),this['stopListening'](this['_actionsBalloonView']),this['stopListening'](_0x4c30f4);}}),this['_createInteraction'](_0x1e2270,_0x43b828,_0x4c30f4,_0x3adf59);}['_setupApplyListeners'](){if(!this['_interactionParams'])return;const {modelFragment:_0xf07b1,anchorData:_0x38f9eb,root:_0x159662}=this['_interactionParams'];this['listenTo'](this['_actionsBalloonView'],'applySuggestion',()=>{this['_applyChanges'](_0xf07b1,_0x38f9eb,_0x159662,!0x1);}),this['listenTo'](this['_actionsBalloonView'],'insertSuggestion',()=>{this['_applyChanges'](_0xf07b1,_0x38f9eb,_0x159662,!0x0);});}['_wrapWithCommonAncestors'](_0xcb5c5b,_0xa32820,_0x39d96f){const _0x387bfd=this['editor']['model']['createRange'](_0xa32820,_0x39d96f)['getCommonAncestor'](),_0x3b5890=_0x387bfd['is']('documentFragment')?[]:_0x387bfd['getAncestors']({'includeSelf':!0x0})['slice'](0x1);if(_0x3b5890['length']){const _0x4ce986=_0x3b5890['map'](_0xd0db89=>_0xd0db89['_clone'](!0x1));for(let _0x313e63=0x1;_0x313e63<_0x4ce986['length'];_0x313e63++)_0x4ce986[_0x313e63-0x1]['_appendChild'](_0x4ce986[_0x313e63]);return _0x4ce986[_0x4ce986['length']-0x1]['_appendChild'](_0xcb5c5b),new _0x19adab(_0x4ce986[0x0]);}return _0xcb5c5b;}['_copyMarkersToFragment'](_0x45133d,_0x3ded7a,_0x187248={'isTableSelection':!0x1}){const _0x204ec7=this['editor']['model'],_0x47dfdb=Array['from'](_0x3ded7a['getRanges']()),_0x3fca0c=_0x3ded7a['getFirstRange']()['start'];for(const _0x5b9953 of _0x204ec7['markers']){if(_0x5b9953['name']['startsWith'](zs)||!_0x5b9953['affectsData'])continue;const _0x548bbd=_0x5b9953['getRange']();if(!_0x47dfdb['some'](_0x2105e2=>_0x2105e2['containsRange'](_0x548bbd,!0x0)))continue;const _0x1275dc=this['_regularCalculateMarkerPath'](_0x548bbd['start'],_0x3fca0c,_0x187248['isTableSelection']),_0x54a8ed=this['_regularCalculateMarkerPath'](_0x548bbd['end'],_0x3fca0c,_0x187248['isTableSelection']),_0x293274=_0x204ec7['createPositionFromPath'](_0x45133d,_0x1275dc),_0x3f1c6a=_0x204ec7['createPositionFromPath'](_0x45133d,_0x54a8ed);if(!_0x293274['isEqual'](_0x3f1c6a)){const _0x1bc2fd=_0x204ec7['createRange'](_0x293274,_0x3f1c6a);_0x45133d['markers']['set'](_0x5b9953['name'],_0x1bc2fd);}}}['_regularCalculateMarkerPath'](_0x5c3e3d,_0x31233d,_0x40d2d2=!0x1){const _0x1aa1fb=[..._0x5c3e3d['path']['slice']()];for(let _0x476756=0x0;_0x476756<Math['max'](_0x31233d['path']['length'],_0x5c3e3d['path']['length']);_0x476756++){const _0x3c3e62=_0x31233d['path'][_0x476756]||0x0,_0x1124ac=(_0x5c3e3d['path'][_0x476756]||0x0)-_0x3c3e62;if(_0x1aa1fb[_0x476756]=_0x1124ac,0x0!==_0x1124ac&&!_0x40d2d2)break;}return _0x1aa1fb;}async['_createInteraction'](_0x521184,_0x2138d3,_0x522268,_0x5bc5d2){const _0x2f8b4f=this['editor'];this['_interactionParams']||(this['_interactionParams']={'action':_0x5bc5d2,'content':_0x521184,'version':_0x2138d3,'aiBalloon':_0x522268,'modelFragment':this['editor']['model']['getSelectedContent'](this['editor']['model']['document']['selection']),'anchorData':new Map(),'root':this['editor']['model']['document']['selection']['getFirstRange']()['start']['root']});const _0x46558a=new Qo({'connector':this['_aiConnector'],'locale':_0x2f8b4f['locale'],'content':_0x521184,'version':_0x2138d3,..._0x5bc5d2});this['_interactions']['push'](_0x46558a);const _0xe64a25=(_0x3e456a,_0x2c591f=!0x1,_0x5dee4a='streaming')=>this['_promiseQueue']['enqueue'](async _0x1a4605=>{try{const _0x25ec97=Rs({'editor':_0x2f8b4f,'changeGroups':_0x3e456a['changeGroups'],'documentContextContent':_0x3e456a['documentContextContent'],'showDiff':_0x2c591f,'trimUnchanged':!0x1});_0x25ec97['length']&&await this['_actionsBalloonView']['updateContent']({'part':_0x25ec97[0x0],'renderingStrategy':_0x5dee4a,'abortSignal':_0x1a4605});}catch(_0x4adbb4){if(this['_isAbortError'](_0x4adbb4))return;throw _0x4adbb4;}});_0x46558a['on']('replyCreated',(_0x10dca6,_0x309001)=>{this['_actionsBalloonView']['hideLoader'](),this['_actionsBalloonView']['startAutoScroll'](),_0xe64a25(_0x309001)['catch'](_0x99f193=>{this['_isAbortError'](_0x99f193)||(console['error']('Error\x20updating\x20content\x20in\x20replyCreated:',_0x99f193),this['_setErrorState'](_0x46558a));});}),_0x46558a['on']('replyContentUpdated',(_0x1769b9,_0x1d2d33)=>{_0xe64a25(_0x1d2d33)['catch'](_0x17a842=>{this['_isAbortError'](_0x17a842)||(console['error']('Error\x20updating\x20content\x20in\x20replyContentUpdated:',_0x17a842),this['_setErrorState'](_0x46558a));});}),_0x46558a['on']('interactionFinished',async()=>{try{await this['_clearLoadingState'](),this['_actionsBalloonView']['updateMiniToolbarButtons'](this['_interactions']['length'],this['_currentInteractionIndex']),await this['_promiseQueue']['queueEmptyPromise'];}catch(_0x59e66b){this['_isAbortError'](_0x59e66b)||(console['error']('Error\x20clearing\x20loading\x20state\x20in\x20interactionFinished:',_0x59e66b),this['_setErrorState'](_0x46558a));}finally{this['_actionsBalloonView']['stopAutoScroll']();}}),this['listenTo'](this['_actionsBalloonView'],'toggleSuggestionDisplayMode',async(_0x475fb6,{showDiff:_0xf9bf06})=>{try{this['_balloonShowDiff']=_0xf9bf06;const _0x563b9d=this['_interaction']['replies'][this['_interaction']['replies']['length']-0x1];_0x563b9d&&await _0xe64a25(_0x563b9d,_0xf9bf06,'static');}catch(_0x517eaa){this['_isAbortError'](_0x517eaa)||(console['error']('Error\x20updating\x20content\x20in\x20toggleSuggestionDisplayMode:',_0x517eaa),this['_setErrorState'](_0x46558a));}}),_0x46558a['on']('replyChangeGroupStateUpdated',()=>{const _0x3204ac={'positiveCount':_0x46558a['replies']['reduce']((_0xeb5012,_0x53776a)=>_0xeb5012+_0x53776a['changeGroups']['filter'](_0xe8fac7=>'accepted'===_0xe8fac7['state'])['length'],0x0),'totalCount':_0x46558a['replies']['reduce']((_0x2894fc,_0x49bff8)=>_0x2894fc+_0x49bff8['changeGroups']['length'],0x0)},_0x5c23a8=_0x46558a['actionCallId'],_0xe646cc=_0x46558a['actionName'];_0xe646cc?this['_aiConnector']['upsertAIActionRating'](_0xe646cc,_0x5c23a8,_0x3204ac):this['_aiConnector']['upsertCustomAIActionRating'](_0x5c23a8,_0x3204ac);}),this['_setLoadingState']();try{const _0x3605d7=await _0x46558a['start']();return this['_actionsBalloonView']['updateMiniToolbarButtons'](this['_interactions']['length'],this['_currentInteractionIndex']),_0x3605d7;}catch(_0x229cc7){if(this['_isAbortError'](_0x229cc7))return;this['_actionsBalloonView']['hideLoader'](),this['_setErrorState'](_0x46558a);}}['_applyChanges'](_0x3f396e,_0x41e16a,_0x19352,_0x202cb7){const _0x57c964=this['editor'];if(_0x202cb7&&!_0x57c964['plugins']['has']('TrackChanges'))throw new at('ai-no-track-changes',null);const _0x75258f=this['editor']['plugins']['get'](_0x367c6c),_0x404143=this['_interactions'][this['_interactions']['length']-0x1-this['_currentInteractionIndex']];if(!_0x404143||!_0x404143['replies']['length'])return;const _0x35ba39=_0x404143['replies'][_0x404143['replies']['length']-0x1],_0x4f0c78=_0x35ba39['changeGroups'];_0x35ba39['setChangeGroupState'](0x0,'accepted');let _0x1ea032=qs({'editor':_0x57c964,'reply':_0x35ba39,'interaction':_0x404143,'groups':_0x4f0c78,'transform':!0x1,'documentCompare':_0x75258f,'documentCompareOptions':{'anchor':_0x57c964['model']['createPositionAt'](_0x3f396e,0x0),'markDeletions':_0x202cb7}});_0x1ea032=this['_filterOperationsOutsideRange'](_0x1ea032,_0x41e16a);for(const _0x281528 of _0x1ea032)this['_anchorOperation'](_0x41e16a,_0x281528,_0x19352);const _0x25ed49=_0x404143['getDocumentContext']()['version'],_0x107948=_0x57c964['model']['document']['history']['getOperations'](_0x25ed49),_0x2cd947={'document':_0x57c964['model']['document'],'useRelations':!0x1,'padWithNoOps':!0x1},_0x5135cc=_0x5e674a(_0x1ea032,_0x107948,_0x2cd947)['operationsA'];_0x57c964['model']['change'](_0x2f4fb1=>{if(_0x2f4fb1['setSelection'](_0x57c964['model']['document']['selection']['focus']),_0x202cb7)_0x57c964['plugins']['get']('TrackChangesEditing')['_applyOperationsAsSuggestions'](_0x5135cc);else{for(const _0x37bd11 of _0x5135cc)_0x37bd11['baseVersion']=_0x57c964['model']['document']['version'],Qs(_0x57c964,_0x37bd11),_0x2f4fb1['batch']['addOperation'](_0x37bd11),_0x57c964['model']['applyOperation'](_0x37bd11);}}),this['editor']['plugins']['get']('AIBalloon')['close']();}['_filterOperationsOutsideRange'](_0x5ec3f2,_0x41fdf8){return _0x5ec3f2['filter'](_0x16eeb9=>{if('rename'==_0x16eeb9['type']){const _0x43bdd9=_0x16eeb9['position']['nodeAfter'];return!_0x41fdf8['has'](_0x43bdd9);}if(_0x16eeb9['type']['indexOf']('Attribute')>-0x1){const _0x5d7fec=_0x16eeb9['range']['start']['nodeAfter'];return!_0x41fdf8['has'](_0x5d7fec);}return!0x0;});}['_anchorOperation'](_0x16c6dc,_0xa6ffc3,_0x1e88a8){const _0x345ae7=_0xa6ffc3['clone']();for(const _0x2f16af in _0xa6ffc3){const _0x3476c4=_0xa6ffc3[_0x2f16af];_0x3476c4 instanceof _0x2a951f?_0xa6ffc3[_0x2f16af]=new _0x2a951f(_0x571640(_0x3476c4['start']),_0x571640(_0x3476c4['end'])):_0x3476c4 instanceof _0x53bf6b&&(_0xa6ffc3[_0x2f16af]=_0x571640(_0x3476c4));}if(['insert','move','remove','reinsert','split','merge']['includes'](_0x345ae7['type'])){if(_0x345ae7['isDocumentOperation']=!0x1,_0x345ae7['baseVersion']=null,'remove'==_0x345ae7['type']){const _0x594df0=_0x345ae7['sourcePosition'],_0x39504a=_0x345ae7['howMany'];new _0x349a38(_0x594df0,_0x39504a)['_execute']();}else _0x345ae7['_execute']();}function _0x571640(_0x34459a){if('$graveyard'==_0x34459a['root']['rootName'])return _0x34459a;const _0x524d3f=[];let _0x1a98d0=_0x34459a['root'];for(let _0x4023e5=0x0;_0x4023e5<_0x34459a['path']['length'];_0x4023e5++){const _0x323d56=_0x16c6dc['get'](_0x1a98d0)||0x0;_0x524d3f[_0x4023e5]=_0x34459a['path'][_0x4023e5]+_0x323d56,_0x1a98d0=_0x1a98d0['getChildAtOffset'](_0x34459a['path'][_0x4023e5]);}return new _0x53bf6b(_0x1e88a8,_0x524d3f,_0x34459a['stickiness']);}}['_refreshInteraction'](){if(!this['_interactionParams'])return;this['_interactions']['length']>0x0&&this['_stopInteraction'](),this['_currentInteractionIndex']=0x0,this['_balloonShowDiff']=!0x1;const {action:_0x49f3ae,content:_0x50c69f,version:_0x223c76,aiBalloon:_0xf38f5f}=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'](_0x50c69f,_0x223c76,_0xf38f5f,_0x49f3ae)['catch'](_0x40c94a=>{this['_isAbortError'](_0x40c94a)||console['error']('Error\x20refreshing\x20interaction:',_0x40c94a);});}['_isAbortError'](_0x47a960){return!!_0x47a960['message']&&_0x47a960['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 _0x179a48=this['_interactions']['length'];this['_currentInteractionIndex']<_0x179a48-0x1&&this['_displayInteractionAtIndex'](this['_currentInteractionIndex']+0x1);}['_navigateToNext'](){this['_currentInteractionIndex']>0x0&&this['_displayInteractionAtIndex'](this['_currentInteractionIndex']-0x1);}async['_displayInteractionAtIndex'](_0x13dc45){if(!this['_interactionParams'])return;this['_currentInteractionIndex']=_0x13dc45;const _0x1bcb16=this['_interactions'][this['_interactions']['length']-0x1-this['_currentInteractionIndex']];if(!_0x1bcb16)return;if(_0x1bcb16['hasError'])return this['_setErrorState'](_0x1bcb16),void this['_actionsBalloonView']['updateMiniToolbarButtons'](this['_interactions']['length'],this['_currentInteractionIndex']);if(!_0x1bcb16['replies']['length'])return;this['_actionsBalloonView']['hideError'](),this['_interactionParams']&&this['_clearErrorState']();const _0x344f93=_0x1bcb16['replies'][_0x1bcb16['replies']['length']-0x1];if(_0x344f93){const _0x5e8e16=this['editor'];try{const _0x340f35=Rs({'editor':_0x5e8e16,'changeGroups':_0x344f93['changeGroups'],'documentContextContent':_0x344f93['documentContextContent'],'showDiff':this['_balloonShowDiff'],'trimUnchanged':!0x1});await new Promise(_0x931571=>setTimeout(_0x931571,0x32)),await this['_actionsBalloonView']['updateContent']({'part':_0x340f35[0x0],'renderingStrategy':'static','abortSignal':new AbortController()['signal']});}catch(_0x264d80){this['_isAbortError'](_0x264d80)||console['error']('Error\x20updating\x20content\x20during\x20navigation:',_0x264d80);}}this['_actionsBalloonView']['updateMiniToolbarButtons'](this['_interactions']['length'],this['_currentInteractionIndex']);}['_setLoadingState'](){this['_actionsBalloonView']['setIsLoading'](!0x0),this['isBusy']=!0x0;}async['_setErrorState'](_0x1d905d){const _0x7f3b47=hs(this['editor']['locale'],'AI_ACTIONS_GENERIC_ERROR');this['_actionsBalloonView']['showError'](_0x7f3b47),_0x1d905d['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 _0x5e9f88{static get['requires'](){return[Wo,$o,ta];}static get['pluginName'](){return'AIQuickActions';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x3d43bf){super(_0x3d43bf),_0x3d43bf['config']['define']('ai.quickActions',{'extraCommands':[],'removeCommands':[],'isSearchEnabled':!0x0});}}class ia extends vt{['resultResponseView'];['acceptButtonView'];['dismissButtonView'];['infoButtonView'];['outdatedButtonView'];constructor(_0x574c56,_0x40c9fd){super(_0x574c56),this['id']=_0x40c9fd,this['set']('status','pending'),this['set']('changeId',_0x40c9fd),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',(_0x27d66a,_0x2b4b94)=>{_0x2b4b94&&_0x2b4b94['target']&&'A'===_0x2b4b94['target']['tagName']&&_0x2b4b94['preventDefault'](),this['fire']('activateChange',{'id':_0x40c9fd,'source':this,'uiInteraction':'click'});}),this['on']('mouseover',()=>{this['fire']('activateChange',{'id':_0x40c9fd,'source':this,'uiInteraction':'hover'});}),this['on']('mouseout',()=>{this['fire']('deactivateChange',{'origin':'panel','id':_0x40c9fd,'source':this});});}['setItemAsActive'](){this['isActive']=!0x0;}['setItemAsInactive'](){this['isActive']=!0x1;}['_createResultResponseView'](){const _0xb443af=new vt(this['locale']);return _0xb443af['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',_0x525d81=>!_0x525d81)]}}),_0xb443af;}['_createAcceptButtonView'](){const _0x202dfa=new Nt(this['locale']);return _0x202dfa['set']({'label':hs(this['locale'],'AI_REVIEW_MODE_ACCEPT_CHANGE'),'withText':!0x0}),_0x202dfa['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x46e0ca=>{this['fire']('acceptChange',{'id':this['changeId']}),_0x46e0ca['stopPropagation']();})},'attributes':{'class':[this['bindTemplate']['if']('status','ck-hidden',_0x4b2f9c=>'pending'!==_0x4b2f9c&&'accepted'!==_0x4b2f9c),this['bindTemplate']['if']('status',ls,_0x585b58=>'pending'===_0x585b58),this['bindTemplate']['if']('status',us,_0x286f76=>'pending'!==_0x286f76),this['bindTemplate']['if']('status','ck-ai_review__check-run-result-status-button',_0x56bd5f=>'accepted'===_0x56bd5f)]}}),this['on']('change:status',(_0x523b0d,_0x15e33e,_0x18c984)=>{_0x202dfa['isEnabled']='pending'===_0x18c984,'accepted'===_0x18c984&&(_0x202dfa['label']=hs(this['locale'],'AI_REVIEW_MODE_CHECK_STATUS_ACCEPTED'),_0x202dfa['icon']=_0x2dfde3);}),_0x202dfa;}['_createDismissButtonView'](){const _0x54cd22=new Nt(this['locale']);return _0x54cd22['set']({'label':hs(this['locale'],'AI_REVIEW_MODE_DISMISS_CHANGE'),'withText':!0x0}),_0x54cd22['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0xe8d3e1=>{this['fire']('dismissChange',{'id':this['changeId']}),_0xe8d3e1['stopPropagation']();})},'attributes':{'class':[us,this['bindTemplate']['if']('status','ck-hidden',_0x1cda9b=>'pending'!==_0x1cda9b&&'rejected'!==_0x1cda9b),this['bindTemplate']['if']('status','ck-ai_review__check-run-result-dismiss-button',_0x460699=>'pending'===_0x460699),this['bindTemplate']['if']('status','ck-ai_review__check-run-result-status-button',_0x1ae8d2=>'rejected'===_0x1ae8d2)]}}),this['on']('change:status',(_0x345860,_0x34c653,_0x5aad16)=>{_0x54cd22['isEnabled']='pending'===_0x5aad16,'rejected'===_0x5aad16&&(_0x54cd22['label']=hs(this['locale'],'AI_REVIEW_MODE_CHECK_STATUS_REJECTED'),_0x54cd22['icon']=_0x1a0f5);}),_0x54cd22;}['_createInfoButtonView'](){const _0xb2c11a=new Nt(this['locale']);return _0xb2c11a['set']({'label':hs(this['locale'],'AI_REVIEW_MODE_LEARN_MORE'),'icon':_0x5800b6,'tooltip':!0x0,'isToggleable':!0x0,'role':'menuitemcheckbox','class':us+'\x20ck-ai_review__check-run-result-info-button\x20ck-hidden'}),_0xb2c11a['bind']('isOn')['to'](this,'isInfoToggleOn',_0x3e276d=>_0x3e276d),_0xb2c11a['on']('execute',()=>{this['isInfoToggleOn']=!this['isInfoToggleOn'];}),_0xb2c11a;}['_createOutdatedButtonView'](){const _0x2f4383=new Nt(this['locale']);return _0x2f4383['set']({'label':hs(this['locale'],'AI_REVIEW_MODE_CHECK_STATUS_OUTDATED'),'icon':it,'withText':!0x0,'isEnabled':!0x1}),_0x2f4383['extendTemplate']({'attributes':{'class':[us,'ck-ai_review__check-run-result-status-button',this['bindTemplate']['if']('status','ck-hidden',_0x2e5f95=>'outdated'!==_0x2e5f95)],'disabled':'disabled'}}),_0x2f4383;}}class sa extends Xt{['resultItemView'];['_pinnedRectIndex']=void 0x0;['_pinnedTargetElement']=void 0x0;['_pinnedTargetChangeId']=void 0x0;constructor(_0x23ca3c,_0x27f7f7){super(_0x23ca3c),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']()),_0x27f7f7['add'](this);}['render'](){super['render'](),this['_setupClickOutsideHandler']();}['updateContent'](_0x129430){this['resultItemView']['changeId']=_0x129430['id'],this['resultItemView']['resultResponseView']['element']['innerHTML']=_0x129430['contentDiffed'];}['showBalloon'](_0x19e383,_0x32c19b,_0x3e9198,_0x220327,_0x1b3aa7,_0x2128f6){const _0x1dba1e=_0x32c19b();if(!_0x1dba1e)return;this['updateContent'](_0x19e383),this['show']();const _0x2c2f3b=Array['from'](_0x1dba1e['getClientRects']())['reverse'](),_0x340649=this['_getPointedRectIndexFromEvent'](_0x3e9198,_0x2c2f3b),_0x2866f0=_0x2c2f3b[_0x340649??0x0];'click'===_0x220327?(this['isDiffActive']=!0x0,this['pin']({'target':()=>this['_getBestRectPositionOnClick'](_0x32c19b(),_0x340649,_0x19e383['id'],_0x1b3aa7,_0x2128f6)||_0x2866f0})):'hover'===_0x220327&&(this['isDiffActive']=!0x1,this['pin']({'target':()=>this['_getBestRectPositionOnHover'](_0x32c19b(),_0x340649,_0x19e383['id'])||_0x2866f0}));}['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 _0x40a74c=[this['element']];return this['_pinnedTargetElement']&&_0x40a74c['push'](this['_pinnedTargetElement']),_0x40a74c;},'callback':()=>{this['hide'](),this['unpin'](),this['deactivateChange'](),this['_pinnedTargetElement']=void 0x0,this['_pinnedRectIndex']=void 0x0,this['_pinnedTargetChangeId']=void 0x0;}});}['_createContentView'](){const _0x2e5089=new vt();return this['resultItemView']=new ia(this['locale'],''),this['resultItemView']['resultResponseView']['extendTemplate']({'attributes':{'class':['ck-content']}}),this['resultItemView']['delegate']('acceptChange','dismissChange')['to'](this),_0x2e5089['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']]}]}),_0x2e5089;}['_getBestRectPositionOnClick'](_0x318cd3,_0x5d29c8,_0xca6bad,_0x56e1d0,_0x1ec78c){if(!_0x318cd3)return null;const _0x54b7e7=this['position']['replace']('arrow_',''),_0x2e866c=Array['from'](_0x318cd3['getClientRects']());let _0x14234c,_0x30576a=_0x2e866c['reverse']();return void 0x0!==_0x5d29c8&&this['_isPinnedRectVisible'](_0x30576a[_0x5d29c8],_0x56e1d0,_0x1ec78c)?(_0x14234c=_0x30576a[_0x5d29c8],this['_pinnedRectIndex']=_0x5d29c8):this['_isPinnedRectVisible'](_0x30576a[0x0],_0x56e1d0,_0x1ec78c)&&void 0x0===_0x5d29c8?_0x14234c=_0x30576a[0x0]:(_0x30576a='s'==_0x54b7e7[0x0]?[..._0x2e866c]['reverse']():_0x2e866c,_0x30576a['forEach'](_0x2a67b4=>{this['_isPinnedRectVisible'](_0x2a67b4,_0x56e1d0,_0x1ec78c)&&(_0x14234c=_0x2a67b4);})),this['_pinnedTargetChangeId']=_0xca6bad,this['_pinnedTargetElement']=_0x318cd3,_0x14234c||_0x318cd3['getBoundingClientRect']();}['_getBestRectPositionOnHover'](_0x2d8fab,_0x19f2f2,_0x46ab65){if(!_0x2d8fab)return null;const _0x510cb6=Array['from'](_0x2d8fab['getClientRects']())['reverse']();if(void 0x0===this['_pinnedRectIndex']&&void 0x0!==_0x19f2f2&&this['_pinnedTargetChangeId']!==_0x46ab65)return this['_pinnedRectIndex']=_0x19f2f2,this['_pinnedTargetElement']=_0x2d8fab,this['_pinnedTargetChangeId']=_0x46ab65,_0x510cb6[_0x19f2f2];if(void 0x0!==this['_pinnedRectIndex']&&this['_pinnedTargetChangeId']===_0x46ab65){if(_0x2d8fab!==this['_pinnedTargetElement'])return Array['from'](this['_pinnedTargetElement']['getClientRects']())['reverse']()[this['_pinnedRectIndex']];return _0x510cb6[this['_pinnedRectIndex']];}return void 0x0!==_0x19f2f2&&this['_pinnedTargetChangeId']!==_0x46ab65?(this['_pinnedRectIndex']=_0x19f2f2,this['_pinnedTargetElement']=_0x2d8fab,this['_pinnedTargetChangeId']=_0x46ab65,_0x510cb6[_0x19f2f2]):_0x2d8fab['getBoundingClientRect']();}['_getPointedRectIndexFromEvent'](_0xcc702d,_0x17f4b8){if(_0xcc702d)for(let _0xbac4f8=0x0;_0xbac4f8<_0x17f4b8['length'];_0xbac4f8++){const _0x4511f3=_0x17f4b8[_0xbac4f8];if(_0xcc702d['clientX']>=_0x4511f3['left']-0x3&&_0xcc702d['clientX']<=_0x4511f3['right']+0x3&&_0xcc702d['clientY']>=_0x4511f3['top']-0x3&&_0xcc702d['clientY']<=_0x4511f3['bottom']+0x3)return _0xbac4f8;}}['_isPinnedRectVisible'](_0x4e84b7,_0x20feb2,_0xc257aa){const _0x2d6dfd=new ut(_0x4e84b7),_0x5a9b5a=_0x20feb2||document['documentElement'],_0x5b5efd=_0x2d6dfd['getIntersection'](Rt(_0xc257aa)),_0x35af1a=new ut(_0x5a9b5a)['getIntersection'](_0x2d6dfd);return!!(_0x5b5efd&&_0x35af1a&&_0x2d6dfd['width']>0x0);}}const na=['getReviewCheckList','runReviewCheck','abortReviewStream','toggleDiff','acceptAllChanges','leaveReviewCoreResultList','activateChange','deactivateChange','acceptChange','dismissChange','learnMore','finishReview','retryReview'];class ra extends _0xee6711{['_mainView'];['_balloonSuggestionView'];['_bodyCollection'];static get['requires'](){return[os];}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x5ed5c1){super(_0x5ed5c1),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 _0x375dd7=this['context']['plugins']['get']('AITabs');this['registerTab'](_0x375dd7);}['destroy'](){this['_bodyCollection']['detachFromDom'](),super['destroy']();}['setAvailableChecks'](_0x1301b9){if(!this['_mainView']['reviewCheckListView']['hasChecks']()){const _0x5a5c8b=!this['context']['config']['get']('ai.models.showModelSelector');this['_mainView']['reviewCheckListView']['setChecks'](_0x1301b9,_0x5a5c8b);}this['_mainView']['showReviewCheckListView']();}['showReviewCheckList'](){this['fire']('getReviewCheckList');}['showCheckRunResults'](_0x164812){_0x164812&&('error-general'!==_0x164812['status']?'error-chunk'!==_0x164812['status']?this['_mainView']['showReviewCheckResultsView']():this['showChunkErrorView']():this['showGeneralResultsErrorView']());}['showCheckRunResult'](_0x36fc9c){this['_mainView']['addCheckRunResult'](_0x36fc9c);}['showGeneralResultsErrorView'](){this['_mainView']['showGeneralResultsErrorView']();}['showGeneralReviewCoreErrorView'](_0x58e129){this['_mainView']['showGeneralReviewCoreErrorView'](_0x58e129??hs(this['context']['locale'],'AI_REVIEW_INITIALIZATION_ERROR_MESSAGE'));}['showChunkErrorView'](){this['_mainView']['showChunkErrorView']();}['setCheckResultTitle'](_0x34e074,_0x1666bf){this['_mainView']['reviewCheckResultsView']['setTitle'](_0x34e074,_0x1666bf);}['setActiveStateInResults'](_0x2ba54d){this['_mainView']['reviewCheckResultsView']['getResults']()['forEach'](_0x457d8a=>{_0x457d8a['id']===_0x2ba54d&&_0x457d8a['setItemAsActive']();});}['resetActiveStateInResults'](){this['_mainView']['reviewCheckResultsView']['getResults']()['forEach'](_0x32926c=>_0x32926c['setItemAsInactive']());}['updateChangeState'](_0x5538f3,_0x318b43){'accepted'===_0x318b43||'rejected'===_0x318b43||'outdated'===_0x318b43?this['_mainView']['reviewCheckResultsView']['hideResult'](_0x5538f3,_0x318b43):this['_mainView']['reviewCheckResultsView']['showResult'](_0x5538f3,_0x318b43);}['showReviewCompletedView'](){this['_mainView']['showReviewCompletedView']();}['showActionsWhenResultIsReady'](){this['_mainView']['showActionsWhenResultIsReady']();}['showNoChangesView'](){this['_mainView']['showNoChangesView']();}['hideActionsWhenResultIsReady'](){this['_mainView']['hideActionsWhenResultIsReady']();}['showChangeBalloon'](_0x1d9541,_0x423417,_0x35291b,_0x29de37,_0x5133a3,_0x4fc39e){this['_balloonSuggestionView']['showBalloon'](_0x1d9541,_0x423417,_0x35291b,_0x29de37,_0x5133a3,_0x4fc39e);}['hideChangeBalloon'](){this['_balloonSuggestionView']['hideBalloon']();}['hideDiffInBalloon'](){this['_balloonSuggestionView']['hideDiffInBalloon']();}['showDiffInBalloon'](){this['_balloonSuggestionView']['showDiffInBalloon']();}['getChangeElement'](_0x589f26){const _0x48f351=this['_mainView']['reviewCheckResultsView']['getResults']()['find'](_0x4fc300=>_0x4fc300['id']===_0x589f26);return _0x48f351?_0x48f351['element']:null;}['deactivateChange'](){this['_balloonSuggestionView']['deactivateChange']();}}class oa extends vt{constructor(_0x122823){super(_0x122823),this['set']('isVisible',!0x1),this['set']('errorMessage','');const _0x568654=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai_review__general-error-container',_0x568654['if']('isVisible','ck-hidden',_0x355f64=>!_0x355f64)]},'children':[{'tag':'p','attributes':{'class':'ck\x20ck-ai-notification\x20ck-ai-notification_error'},'children':[{'text':_0x568654['to']('errorMessage')}]}]});}}class aa extends vt{['reviewCoreHeader'];['generalErrorView'];['reviewCheckListView'];['reviewCheckResultsView'];['reviewCompletedView'];constructor(_0x2ff15a,_0x5da859){super(_0x2ff15a),this['reviewCoreHeader']=_0x5da859['header'],this['generalErrorView']=new oa(_0x2ff15a),this['reviewCheckListView']=_0x5da859['list'],this['reviewCheckListView']['delegate'](...na)['to'](this),this['reviewCheckResultsView']=_0x5da859['results'],this['reviewCheckResultsView']['delegate'](...na)['to'](this),this['reviewCompletedView']=_0x5da859['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'](_0x1d894a){this['reviewCheckResultsView']['addResult'](_0x1d894a),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'](_0x28977c){this['generalErrorView']['set']('isVisible',!0x0),this['generalErrorView']['errorMessage']=_0x28977c;}['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(_0x2d5927,_0x271039){super(_0x271039),this['set']({'label':_0x2d5927,'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(_0x572fe9,_0x49c0a6){super(_0x572fe9),this['_contents']=_0x49c0a6,this['_resultViews']=new _0x2fb855(),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(_0x572fe9),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 _0x44fbe3=this['_createCombinedSkeletonLoader'](),_0x23c6e5=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-run',_0x23c6e5['if']('isLoading','ck-ai_review__check-run_loading',_0x3ff4d4=>_0x3ff4d4),_0x23c6e5['if']('isResultReady','ck-ai_review__check-run_ready',_0xd5607f=>_0xd5607f),_0x23c6e5['if']('isVisible','ck-hidden',_0x36033c=>!_0x36033c)]},'children':[this['_resultsHeader'],this['_errorMessageView'],this['_resultsBody'],_0x44fbe3,this['reviewDisclaimer']]});}['clearResults'](){this['_resultViews']['clear'](),this['_resultsBody']['element']&&(this['_resultsBody']['element']['scrollTop']=0x0);}['getResults'](){return this['_resultViews'];}['addResult'](_0x2ff702){const _0x2701bf=new ia(this['locale'],_0x2ff702['id']);_0x2701bf['delegate']('acceptChange','dismissChange','activateChange','deactivateChange')['to'](this),this['_resultViews']['add'](_0x2701bf),_0x2701bf['resultResponseView']['element']['innerHTML']=_0x2ff702['contentDiffed'];}['hideResult'](_0x47901f,_0x2f179b){if('pending'===_0x2f179b)return;const _0x4b2fd9=this['_resultViews']['find'](_0x4bc904=>_0x4bc904['id']===_0x47901f);_0x4b2fd9&&(_0x4b2fd9['status']=_0x2f179b,_0x4b2fd9['element']?.['classList']['add']('ck-ai_review__check-run-result_grayout'));}['showResult'](_0x594f79,_0x4be0d7){if('pending'!==_0x4be0d7)return;const _0x2dcf6f=this['_resultViews']['find'](_0x179007=>_0x179007['id']===_0x594f79);_0x2dcf6f&&(_0x2dcf6f['status']=_0x4be0d7,_0x2dcf6f['element']?.['classList']['remove']('ck-ai_review__check-run-result_grayout'));}['setTitle'](_0xefec2e,_0x2dc4ae){this['headerTitle']=_0xefec2e,this['headerSubtitle']=_0x2dc4ae||'';}['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 _0x4134f0=new vt(this['locale']),_0x1899e5=[];for(let _0x8f55f=0x0;_0x8f55f<0x10;_0x8f55f++){const _0x206aba=this['_createSkeletonLoader']();_0x206aba['extendTemplate']({'attributes':{'class':['ck-ai_review__check-run-skeleton-item']}}),_0x1899e5['push'](_0x206aba);}return _0x4134f0['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-run-skeleton-container',this['bindTemplate']['if']('isLoading','ck-hidden',_0x410088=>!_0x410088)]},'children':_0x1899e5}),_0x4134f0;}['_createResultsBodyView'](){const _0x2fe648=new vt(this['locale']);return _0x2fe648['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-run-results-container','ck-reset_all-excluded',this['bindTemplate']['if']('isLoading','ck-hidden',_0x1808a4=>_0x1808a4)]},'children':this['_resultViews']}),_0x2fe648;}['_createErrorView'](){const _0x3ee428=new vt(this['locale']),_0x1fbbbc=new Nt(this['locale']),t=this['locale']['t'];return _0x3ee428['delegate']('retryReview')['to'](this),_0x1fbbbc['set']({'label':t('Try\x20again'),'withText':!0x0,'class':ls+'\x20ck-ai_review__check-run-error-retry-button'}),_0x1fbbbc['on']('execute',()=>{this['fire']('retryReview');}),_0x3ee428['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-run-error-container',this['bindTemplate']['if']('showErrorMessage','ck-hidden',_0xa47312=>!_0xa47312),this['bindTemplate']['if']('errorType','ck-ai_review__check-run-error-container_border-bottom',_0x389e34=>'chunk'===_0x389e34)]},'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',_0xc7c8ec=>'chunk'===_0xc7c8ec)]},'children':[{'tag':'p','attributes':{'class':['ck-ai-notification__content',this['bindTemplate']['if']('errorType','ck-hidden',_0x4aefb1=>'general'!==_0x4aefb1)]},'children':[{'text':this['_contents']['generalErrorText']}]},{'tag':'p','attributes':{'class':['ck-ai-notification__content',this['bindTemplate']['if']('errorType','ck-hidden',_0x50c3a8=>'chunk'!==_0x50c3a8)]},'children':[{'text':hs(this['locale'],'AI_REVIEW_MODE_CHUNK_ERROR_MESSAGE')}]}]},_0x1fbbbc]}),_0x3ee428;}['_createCancelButtonView'](){const _0x5d04c7=new Nt(this['locale']);return _0x5d04c7['set']({'label':hs(this['locale'],'AI_REVIEW_MODE_STOP_GENERATING'),'withText':!0x0,'class':[ls+'\x20ck-ai-button-stop-generating'],'icon':_0x321021}),_0x5d04c7['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isResultReady','ck-hidden',_0x34f9b4=>_0x34f9b4),this['bindTemplate']['if']('isCompleted','ck-hidden',_0x2bbdb5=>_0x2bbdb5)]}}),_0x5d04c7['on']('execute',()=>{this['fire']('abortReviewStream');}),_0x5d04c7;}['_createToggleDiffButtonView'](){const _0x567d56=new Nt(this['locale']);_0x567d56['set']({'tooltip':!0x0,'isToggleable':!0x0,'role':'menuitemcheckbox'}),_0x567d56['bind']('isEnabled')['to'](this,'isError',_0x6ccda7=>!_0x6ccda7),_0x567d56['extendTemplate']({'attributes':{'class':[ls,'ck-ai_review__check-run-toggle-diff-button',this['bindTemplate']['if']('isResultReady','ck-hidden',_0x19969a=>!_0x19969a),this['bindTemplate']['if']('isCompleted','ck-hidden',_0x1fce73=>_0x1fce73)]}});const _0x3d2a5e=hs(this['locale'],'AI_REVIEW_MODE_HIDE_CHANGES'),_0x3e1db4=hs(this['locale'],'AI_REVIEW_MODE_SHOW_CHANGES');return _0x567d56['bind']('isOn')['to'](this,'isToggleDiffOn',_0x2c7aec=>_0x2c7aec),_0x567d56['bind']('icon')['to'](this,'isToggleDiffOn',_0x5295df=>_0x5295df?st:nt),_0x567d56['bind']('label')['to'](this,'isToggleDiffOn',_0x4f7a73=>_0x4f7a73?_0x3d2a5e:_0x3e1db4),_0x567d56['on']('execute',()=>{this['isToggleDiffOn']=!this['isToggleDiffOn'],this['fire']('toggleDiff',{'on':this['isToggleDiffOn']});}),_0x567d56;}['_createAcceptAllButtonView'](){const _0x4d9ab0=new Nt(this['locale']);return _0x4d9ab0['set']({'label':hs(this['locale'],'AI_REVIEW_MODE_ACCEPT_ALL'),'withText':!0x0}),_0x4d9ab0['bind']('isEnabled')['to'](this,'isError',_0x248a26=>!_0x248a26),_0x4d9ab0['extendTemplate']({'attributes':{'class':[cs,'ck-ai_review__check-run-accept-all-button',this['bindTemplate']['if']('isResultReady','ck-hidden',_0x7613b9=>!_0x7613b9),this['bindTemplate']['if']('isCompleted','ck-hidden',_0x573038=>_0x573038)]}}),_0x4d9ab0['on']('execute',()=>{this['fire']('acceptAllChanges');}),_0x4d9ab0;}['_createExitReviewButtonView'](){const _0x3694be=new Nt(this['locale']);return _0x3694be['set']({'label':hs(this['locale'],'AI_REVIEW_MODE_EXIT_REVIEW'),'withText':!0x0}),_0x3694be['extendTemplate']({'attributes':{'class':[us,'ck-ai_review__check-run-exit-button',this['bindTemplate']['if']('isResultReady','ck-hidden',_0x21b3d2=>!_0x21b3d2),this['bindTemplate']['if']('isCompleted','ck-hidden',_0x4c8675=>_0x4c8675)]}}),_0x3694be['on']('execute',()=>{this['fire']('leaveReviewCoreResultList');}),_0x3694be;}['_createResultHeaderView'](){const _0x4172c9=new vt(this['locale']),_0xaac0ae=this['_createTitleView']();return _0x4172c9['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-run-results-header',this['bindTemplate']['if']('isCompleted','ck-ai_review__review-completed-header',_0x98fef=>_0x98fef)]},'children':[_0xaac0ae,{'tag':'div','attributes':{'class':['ck-ai_review__check-run-results-header-buttons']},'children':[this['_cancelButtonView'],this['_acceptAllButtonView'],this['_exitReviewButtonView'],this['_toggleDiffButtonView'],this['_finishReviewButtonView']]}]}),_0x4172c9;}['_createTitleView'](){const _0x421a49=new vt(this['locale']),_0x530353=new yn();return _0x530353['bind']('isVisible')['to'](this,'isResultReady',_0x31ba17=>!_0x31ba17),_0x421a49['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-run-results-header-title-wrapper']},'children':[_0x530353,{'tag':'div','attributes':{'class':['ck-ai_review__check-run-results-header-title-content',this['bindTemplate']['if']('isCompleted','ck-hidden',_0x1b30dc=>_0x1b30dc)]},'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',_0x472a30=>!_0x472a30)]},'children':[{'text':hs(this['locale'],'AI_REVIEW_MODE_FINISH_REVIEW_HEADER_TITLE')}]}]}),_0x421a49;}['_createFinishReviewButtonView'](){const _0x35cc7f=new ha(hs(this['locale'],'AI_REVIEW_MODE_FINISH_REVIEW_BUTTON_LABEL'),this['locale']);return _0x35cc7f['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isCompleted','ck-hidden',_0x52389f=>!_0x52389f)]}}),_0x35cc7f['delegate']('finishReview')['to'](this),_0x35cc7f;}}class la extends Ht{['_resultsHeader'];['_finishReviewButtonView'];constructor(_0x463cfa,_0x1f8934){super(_0x463cfa),this['_finishReviewButtonView']=this['_createFinishReviewButtonView'](_0x1f8934['buttonText']),this['_resultsHeader']=this['_createResultHeaderView'](_0x1f8934['headerText']);const _0x4fedd1=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__review-completed',_0x4fedd1['if']('isVisible','ck-hidden',_0xb9d1b6=>!_0xb9d1b6)]},'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':_0x1f8934['emptyResultsText']}]}]}]});}['_createFinishReviewButtonView'](_0x13aeec){const _0x175f3b=new ha(_0x13aeec,this['locale']);return _0x175f3b['delegate']('finishReview')['to'](this),_0x175f3b;}['_createResultHeaderView'](_0x40adec){const _0x1c3d3e=new vt(this['locale']);return _0x1c3d3e['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':_0x40adec}]},{'tag':'div','attributes':{'class':['ck-ai_review__review-completed-header-buttons']},'children':[this['_finishReviewButtonView']]}]}),_0x1c3d3e;}}class ua extends vt{['_dropdownView'];['_defaultValue'];['_defaultLabel'];constructor(_0x282c99,_0x46eeeb){super(_0x282c99),this['_defaultValue']=_0x46eeeb['default']||(_0x46eeeb['data']['length']>0x0?_0x46eeeb['data'][0x0]['id']:''),this['_defaultLabel']=_0x46eeeb['data']['find'](_0x2791eb=>_0x2791eb['id']===this['_defaultValue'])?.['label']||'',this['set']('formValue',''),this['_dropdownView']=Gt(this['locale']);const _0x31bb2f=this['_prepareListOptions'](_0x46eeeb['data']);jt(this['_dropdownView'],_0x31bb2f,{'role':'menu','ariaLabel':_0x46eeeb['label']}),this['_dropdownView']['buttonView']['set']({'label':this['_defaultLabel'],'withText':!0x0}),this['_dropdownView']['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x66c51a=>{_0x66c51a['stopPropagation']();})}}),this['listenTo'](this['_dropdownView'],'execute',_0x10ddad=>{this['formValue']=_0x10ddad['source']['model']['id'],this['_dropdownView']['buttonView']['label']=_0x10ddad['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'](_0x533d46=[]){const _0x20673b=new dt();this['resetToDefault']();for(const _0x33f892 of _0x533d46){const _0x54a514=new Jt({'label':_0x33f892['label'],'withText':!0x0,'role':'menuitemradio','id':_0x33f892['id'],'model':_0x33f892});_0x54a514['bind']('isOn')['to'](this,'formValue',_0x38a527=>_0x38a527===_0x54a514['id']);const _0x5d188f={'type':'button','model':_0x54a514};_0x20673b['add'](_0x5d188f);}return _0x20673b;}}class da extends Ht{['_formItem']=null;constructor(_0x687188,_0x44cfbd,_0x35a90b){super(_0x687188),this['argsKey']=_0x44cfbd?.['argsKey'];if('dropdown'===_0x44cfbd['formType'])this['_formItem']=new ua(this['locale'],_0x44cfbd);this['set']('value',''),this['bind']('value')['to'](this['_formItem'],'formValue');const _0x4881fd=new _0x187262(this['locale'],{'children':[this['_formItem']],'class':[_0x35a90b?'ck-form__row_with-submit':'']});_0x35a90b&&_0x4881fd['children']['add'](_0x35a90b),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai_review__form-item','ck-reset_all']},'children':[_0x4881fd]});}['resetToDefault'](){this['_formItem']['resetToDefault']();}}class _a extends _0x2b5bb8{['keystrokes'];static ['MIN_ROWS']=0x1;static ['MAX_ROWS']=0xc;constructor(_0x97b3c9){super(_0x97b3c9),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 _0x2fb855();['submitButtonView'];['cancelButtonView'];['promptInputView'];['actionsFooterView'];['_modelSelectionDropdown'];['_modelNameView'];['_modelSelectionDropdownItems'];['_check'];['_defaultValue'];['_defaultLabel'];constructor(_0x1912af,_0x3ff698,_0x5b5201=!0x1){super(_0x1912af),this['_check']=_0x3ff698,this['set']('prompt',''),this['set']('modelId',''),this['set']('modelDisplayMode','selector'),this['set']('activeModelName',null),this['_defaultValue']=_0x3ff698['defaultModel']?_0x3ff698['defaultModel']['id']:'',this['_defaultLabel']=_0x3ff698['defaultModel']?_0x3ff698['defaultModel']['name']:'',this['submitButtonView']=this['_createSubmitButtonView'](),this['cancelButtonView']=this['_createCancelButtonView'](),(this['promptInputView']=new te(this['locale'],()=>new _a(_0x1912af)),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'](_0x5b5201),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 _0x187262(this['locale'],{'children':[this['promptInputView']]}),new _0x187262(this['locale'],{'children':[this['actionsFooterView']]})]}),this['promptInputView']['fieldView']['keystrokes']['set']('Enter',(_0x145e2a,_0x32fba6)=>{this['_isValid']()?(this['fire']('runReviewCheck',{'id':'custom','args':{'prompt':this['prompt'],'model':this['modelId']},'isCustom':!0x0}),_0x32fba6()):_0x32fba6();}),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'](_0x4062f8=>{this['_focusables']['add'](_0x4062f8),this['focusTracker']['add'](_0x4062f8['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 _0x5a1e6f of this['_getFormValidators']()){const _0x5c86fc=_0x5a1e6f();if(_0x5c86fc)return this['promptInputView']['errorText']=_0x5c86fc,!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 _0x53d8eb=new Nt(this['locale']),t=this['locale']['t'];return _0x53d8eb['set']({'label':t('Submit'),'withText':!0x0,'class':cs}),_0x53d8eb['on']('execute',()=>{this['_isValid']()&&this['fire']('runReviewCheck',{'id':'custom','args':{'prompt':this['prompt'],'model':this['modelId']},'isCustom':!0x0});}),_0x53d8eb;}['_createCancelButtonView'](){const _0x44505d=new Nt(this['locale']),t=this['locale']['t'];return _0x44505d['set']({'label':t('Cancel'),'withText':!0x0,'class':us}),_0x44505d['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0xc42776=>{_0xc42776['stopPropagation']();})}}),_0x44505d['on']('execute',()=>{this['resetToDefault'](),this['fire']('closeCustomCheck');}),_0x44505d;}['_setModelList'](_0x5b2c3c){this['_modelSelectionDropdownItems']['clear']();const _0x51fc82=this['_check']['models'];if(_0x5b2c3c)this['set']('modelDisplayMode','hidden');else{const _0x3b3b65=0x1===_0x51fc82['length'];this['set']('modelDisplayMode',_0x3b3b65?'name':'selector');}if(this['resetToDefault'](),_0x51fc82?.['length']){0x1===_0x51fc82['length']&&this['set']('activeModelName',_0x51fc82[0x0]['name']||_0x51fc82[0x0]['id']);for(const _0xf07c33 of _0x51fc82){const _0x50dd88=new Jt({'label':_0xf07c33['name'],'withText':!0x0,'role':'menuitemradio','id':_0xf07c33['id'],'model':_0xf07c33});_0x50dd88['bind']('isOn')['to'](this,'modelId',_0x4ce6ff=>_0x4ce6ff===_0xf07c33['id']),this['_modelSelectionDropdownItems']['add']({'type':'button','model':_0x50dd88,'labelView':new Ia(this['locale'],_0xf07c33)});}}}['_createModelSelectionDropdown'](){const _0x35b2f8=Gt(this['locale']);return _0x35b2f8['set']({'panelPosition':'se','class':'ck-ai_review__check-list-item-model-dropdown'}),_0x35b2f8['buttonView']['set']({'label':this['_defaultLabel'],'withText':!0x0,'tooltip':!0x0,'class':us}),_0x35b2f8['buttonView']['bind']('isVisible')['to'](this,'modelDisplayMode',_0x586971=>'selector'===_0x586971),this['listenTo'](_0x35b2f8,'execute',_0x5f1813=>{this['modelId']=_0x5f1813['source']['model']['id'],_0x35b2f8['buttonView']['label']=_0x5f1813['source']['label'];}),_0x35b2f8;}['_createModelNameView'](){const _0x1c7bfb=new Aa(this['locale']);return _0x1c7bfb['bind']('text')['to'](this,'activeModelName',_0x1df451=>_0x1df451??''),_0x1c7bfb['bind']('isVisible')['to'](this,'modelDisplayMode',_0x32fd44=>'name'===_0x32fd44),_0x1c7bfb;}['_createActionsFooterView'](){const _0x1b72e6=new vt(this['locale']);return _0x1b72e6['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']]}]}),_0x1b72e6;}}class Aa extends vt{constructor(_0x36a815){super(_0x36a815),this['set']('text',void 0x0),this['set']('isVisible',!0x0);const _0x1b18bc=this['bindTemplate'];this['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai_review__check-list-item-model-name',_0x1b18bc['if']('isVisible','ck-hidden',_0x155ccd=>!_0x155ccd)]},'children':[{'text':_0x1b18bc['to']('text')}]});}}class Ia extends Mt{constructor(_0x48684a,_0x5cdb59){super();const _0xcd60de=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-button__label'],'style':_0xcd60de['to']('style'),'id':_0xcd60de['to']('id')},'children':[{'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-model-dropdown-name']},'children':[{'tag':'span','children':[{'text':_0xcd60de['to']('text')}]}]},{'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-model-dropdown-description']},'children':[{'tag':'span','children':[_0x5cdb59['description']||'']}]}]});}}class Ea extends Ht{['_formItemsCollection']=new _0x2fb855();['_customCheckView']=null;['_hideModels']=!0x1;constructor(_0x480843,_0x3d6dfd,_0x4c8633,_0x2e7844=!0x1){super(_0x480843),this['_hideModels']=_0x2e7844,this['set']('isParametrizedViewOpen',!0x1),this['set']('isListItemRendered',!0x1),this['set']('isItemParametrized',_0x3d6dfd['isParameterized']);const _0x24f5ed=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',_0x1ce34f=>_0x1ce34f),this['bindTemplate']['if']('isListItemRendered','ck-ai_review__check-list-item_rendered',_0x4cceed=>_0x4cceed)],'style':{'--ck-ai-review-check-list-item-index':_0x4c8633}},'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':_0x3d6dfd['title']}]},_0x24f5ed]},{'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-description']},'children':_0x3d6dfd['description']?[{'text':_0x3d6dfd['description']}]:[]}]}]},..._0x3d6dfd['isParameterized']?[this['_createParameterizedView'](_0x3d6dfd)]:[],...'custom'===_0x3d6dfd['id']?[this['_createCustomView'](_0x3d6dfd,this['_hideModels'])]:[]]}),this['on']('click',()=>{_0x3d6dfd['isParameterized']?this['isParametrizedViewOpen']=!0x0:this['fire']('runReviewCheck',{'id':_0x3d6dfd['id'],'args':_0x3d6dfd['useArgs']?_0x3d6dfd['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'](_0x1af73b=>{_0x1af73b['resetToDefault']();}),this['_customCheckView']&&this['_customCheckView']['resetToDefault']();}['_createIconView'](){const _0x284c14=new xt();return _0x284c14['content']=rt,_0x284c14['extendTemplate']({'attributes':{'class':['ck-ai_review__check-list-item-title-icon']}}),_0x284c14;}['_createParameterizedView'](_0x4c24e4){const _0x58a6a3=new vt(),_0x4b24c1=this['_createFormView'](_0x4c24e4);return _0x58a6a3['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-parameterized',this['bindTemplate']['if']('isParametrizedViewOpen','ck-hidden',_0x9fe761=>!_0x9fe761)]},'children':[_0x4b24c1]}),_0x58a6a3;}['_createFormView'](_0x382f65){const _0x375fc6=new vt(),_0x3470c5=Array['isArray'](_0x382f65['options'])?_0x382f65['options']:[],_0x29de90=new Nt(this['locale']),t=this['locale']['t'];_0x29de90['set']({'label':t('Submit'),'withText':!0x0,'class':cs}),_0x29de90['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x93839c=>{_0x93839c['stopPropagation']();})}}),_0x29de90['on']('execute',()=>{const _0x91d1f3=[],_0x121560={};this['_formItemsCollection']['forEach'](_0x5e4fda=>{_0x91d1f3['push'](_0x5e4fda['value']),_0x382f65['useArgs']&&_0x382f65['options']&&(_0x121560[_0x5e4fda['argsKey']]=_0x5e4fda['value']);}),this['fire']('runReviewCheck',{'id':_0x382f65['id'],'params':_0x91d1f3['length']?_0x91d1f3:void 0x0,'args':Object['keys'](_0x121560)['length']?_0x121560:void 0x0});});const _0x1c67cc=_0x3470c5['length'];return _0x3470c5['forEach']((_0x488cde,_0x2bee83)=>{const _0x556fb3=_0x2bee83===_0x1c67cc-0x1;this['_formItemsCollection']['add'](new da(this['locale'],_0x488cde,_0x556fb3?_0x29de90:null));}),_0x375fc6['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-parameterized-form']},'children':this['_formItemsCollection']}),_0x375fc6;}['_createCustomView'](_0x1d3be9,_0x5ad664=!0x1){return this['_customCheckView']=new ga(this['locale'],_0x1d3be9,_0x5ad664),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',_0x6bab76=>!_0x6bab76)]}}),this['_customCheckView']['delegate']('runReviewCheck')['to'](this),this['listenTo'](this['_customCheckView'],'closeCustomCheck',()=>{this['isParametrizedViewOpen']=!0x1;}),this['on']('change:isParametrizedViewOpen',(_0x228e62,_0x19ffc6,_0x1eb727)=>{_0x1eb727||this['_customCheckView']['resetFormValidationStatus']();}),this['_customCheckView'];}}class pa extends Ht{['_checkViews'];constructor(_0x62a337){super(_0x62a337),this['_checkViews']=new _0x2fb855(),this['_setupTemplate']();}['setChecks'](_0x26cced,_0x1c9c2d=!0x1){this['_checkViews']['clear']();for(const [_0x4d292f,_0x15cbc6]of _0x26cced['entries']()){const _0x3b4451=new Ea(this['locale'],_0x15cbc6,_0x4d292f,_0x1c9c2d);_0x3b4451['delegate']('runReviewCheck')['to'](this),this['_checkViews']['add'](_0x3b4451);}}['hasChecks'](){return this['_checkViews']['length']>0x0;}['resetAllParameterizedChecks'](){for(const _0x12c35c of this['_checkViews'])_0x12c35c instanceof Ea&&_0x12c35c['resetToDefault']();}['_setupTemplate'](){const _0x103477=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-list',_0x103477['if']('isVisible','ck-hidden',_0x4df663=>!_0x4df663)]},'children':this['_checkViews']});}}class ma extends ra{static get['pluginName'](){return'AIReviewModeUI';}['createMainView'](){const _0xb8985c=this['context']['plugins']['get']('AITabs'),_0x3f66f0=this['context']['locale'],_0x5c345e=new eo(_0x3f66f0,{'label':hs(_0x3f66f0,'AI_REVIEW_MODE'),'icon':_0x14d24d,'class':'ck-ai-header_review','showResizeButton':_0xb8985c['showResizeButton']});return _0x5c345e['delegate']('resizeTabs')['to'](_0xb8985c),_0x5c345e['bind']('isMaximized')['to'](_0xb8985c['view'],'isMaximized',_0x25db53=>_0x25db53),new aa(this['context']['locale'],{'header':_0x5c345e,'list':new pa(_0x3f66f0),'results':new ca(_0x3f66f0,{'generalErrorText':hs(_0x3f66f0,'AI_REVIEW_MODE_GENERAL_ERROR_MESSAGE')}),'completed':new la(_0x3f66f0,{'headerText':hs(_0x3f66f0,'AI_REVIEW_MODE_FINISH_REVIEW_HEADER_TITLE'),'emptyResultsText':hs(_0x3f66f0,'AI_REVIEW_MODE_EMPTY_RESULTS_TEXT'),'buttonText':hs(_0x3f66f0,'AI_REVIEW_MODE_FINISH_REVIEW_BUTTON_LABEL')})});}['registerTab'](){const _0x2bddf4=this['context']['plugins']['get']('AITabs');_0x2bddf4['view']['on']('activateTab',(_0x5e933d,{newTab:_0x32234e,oldTab:_0x31b925})=>{'reviewMode'===_0x32234e?this['fire']('getReviewCheckList'):'reviewMode'===_0x31b925&&this['fire']('leaveReview');}),_0x2bddf4['view']['addTab']({'id':'reviewMode','buttonLabel':hs(this['context']['locale'],'AI_REVIEW_MODE'),'buttonIcon':_0x14d24d,'order':0x0,'content':this['_mainView']});}}const Ta='review-',Ca=['softBreak'];class wa extends _0xee6711{static get['requires'](){return[_0x367c6c,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(_0xbe43d6){super(_0xbe43d6),this['_domEmitter']=new(Ot())(),this['_eventEmitter']=new(Tt())();}get['emitter'](){return this['_eventEmitter'];}['afterInit'](){const _0x36b40e=_0x1e181d=>this['_scheduleAttachReviewEditingToEditor'](_0x1e181d);if(this['_registerGlobalBalloonBlurHandler'](),this['context']instanceof _0x4df290)return void this['_attachReviewEditingToEditor'](this['context']);const _0x50fe56=this['context'];for(const _0x5ca9f8 of _0x50fe56['editors'])_0x36b40e(_0x5ca9f8);this['listenTo'](_0x50fe56['editors'],'add',(_0x572991,_0x20f52e)=>{_0x36b40e(_0x20f52e);}),this['listenTo'](_0x50fe56['editors'],'remove',(_0x149446,_0x52be5f)=>{for(const [_0x8454fc,_0x54921e]of this['_markers'])_0x54921e['editor']===_0x52be5f&&(this['_eventEmitter']['fire']('changeMarkerRemoved',{'markerId':_0x8454fc,'changeId':_0x54921e['groupId']}),this['_markers']['delete'](_0x8454fc));});}['_scheduleAttachReviewEditingToEditor'](_0xfa9cbb){const _0x1cff66=()=>{'destroyed'!==_0xfa9cbb['state']&&_0xfa9cbb['conversion']&&this['_attachReviewEditingToEditor'](_0xfa9cbb);};if('ready'===_0xfa9cbb['state'])return void _0x1cff66();const _0x35009c=()=>{this['stopListening'](_0xfa9cbb,'ready',_0x35009c),_0x1cff66();};this['listenTo'](_0xfa9cbb,'ready',_0x35009c);}['_attachReviewEditingToEditor'](_0x53ebd8){this['_reviewEditingAttachedEditors']['has'](_0x53ebd8)||(_0x53ebd8['conversion']['for']('editingDowncast')['markerToElement']({'model':Ta+'insert','view':(_0x17c184,{writer:_0xba483b})=>{const _0x356bf1=this['_markers']['get'](_0x17c184['markerName']),_0x45d0d3={'class':'ck-ai_review-marker_add'+(this['_activeMarkers']['has'](_0x356bf1?.['id']||'')?'\x20ck-ai_review__change_active':''),'data-marker-id':_0x17c184['markerName']};return _0xba483b['createUIElement']('span',_0x45d0d3,function(_0x46813f){const _0x10e9cf=this['toDomElement'](_0x46813f);return _0x10e9cf['innerHTML']=_0x356bf1?.['content']?.['asString']||'',_0x10e9cf;});}}),_0x53ebd8['conversion']['for']('editingDowncast')['markerToHighlight']({'model':Ta+'remove-only','view':_0x6f991c=>{const _0x5cb61f=this['_markers']['get'](_0x6f991c['markerName']),_0x29ed59=['ck-ai_review-marker_strikethrough'];return this['_activeMarkers']['has'](_0x5cb61f?.['id']||'')&&_0x29ed59['push']('ck-ai_review__change_active'),{'classes':_0x29ed59,'attributes':{'data-marker-id':_0x6f991c['markerName']}};}}),_0x53ebd8['conversion']['for']('editingDowncast')['markerToHighlight']({'model':Ta+'remove-context','view':_0x3cc989=>{const _0x1df60f=this['_markers']['get'](_0x3cc989['markerName']),_0xcddb1b=['ck-ai_review-marker_underline'];return this['_activeMarkers']['has'](_0x1df60f?.['id']||'')&&_0xcddb1b['push']('ck-ai_review__change_active'),{'classes':_0xcddb1b,'attributes':{'data-marker-id':_0x3cc989['markerName']}};}}),_0x53ebd8['conversion']['for']('editingDowncast')['markerToHighlight']({'model':Ta+'remove-text','view':_0x3780fd=>{const _0x121c6f=this['_markers']['get'](_0x3780fd['markerName']),_0x478cbd=['ck-ai_review-marker_hide'];return this['_activeMarkers']['has'](_0x121c6f?.['id']||'')&&_0x478cbd['push']('ck-ai_review__change_active'),{'classes':_0x478cbd,'attributes':{'data-marker-id':_0x3780fd['markerName']}};}}),_0x53ebd8['conversion']['for']('dataDowncast')['markerToElement']({'model':Ta+'suggestion-context','view':(_0x2f58c9,{writer:_0x860305})=>_0x860305['createRawElement']('span',{'class':'ck-ai_review-marker_context-'+(_0x2f58c9['isOpening']?'start':'end')})}),_0x53ebd8['conversion']['for']('downcast')['attributeToAttribute']({'model':_0x307282,'view':_0x2af4e4}),this['_updateMouseMarkerInteractionListeners'](_0x53ebd8),this['listenTo'](_0x53ebd8,'addRoot',()=>this['_updateMouseMarkerInteractionListeners'](_0x53ebd8),{'priority':'lowest'}),this['listenTo'](_0x53ebd8,'detachRoot',()=>this['_updateMouseMarkerInteractionListeners'](_0x53ebd8),{'priority':'lowest'}),_0x53ebd8['model']['document']['registerPostFixer'](_0x2ef713=>this['_validateMarkers'](_0x53ebd8,_0x2ef713)),_0x53ebd8['model']['document']['on']('change',()=>this['_handleMarkerChanges'](_0x53ebd8)),this['_reviewEditingAttachedEditors']['add'](_0x53ebd8));}['_updateMouseMarkerInteractionListeners'](_0x414dda){let _0x567fac=this['_boundEditables']['get'](_0x414dda);_0x567fac||(_0x567fac=new Map(),this['_boundEditables']['set'](_0x414dda,_0x567fac));const _0x146a0e=new Set(_0x414dda['ui']['getEditableElementsNames']());for(const _0x369d38 of _0x146a0e){if(_0x567fac['has'](_0x369d38))continue;const _0x42bc5c=_0x414dda['ui']['getEditableElement'](_0x369d38);_0x567fac['set'](_0x369d38,_0x42bc5c),this['_attachMouseMarkerInteractionListeners'](_0x42bc5c);}for(const [_0x3a1fbc,_0x1f8a10]of _0x567fac)_0x146a0e['has'](_0x3a1fbc)||(_0x567fac['delete'](_0x3a1fbc),this['_domEmitter']['stopListening'](_0x1f8a10));}['_attachMouseMarkerInteractionListeners'](_0x461b7e){this['_domEmitter']['listenTo'](_0x461b7e,'mouseup',(_0x8c29b0,_0x1a168e)=>{const _0xd35d6e=_0x1a168e['target'],_0x181347=this['_findMarkerElement'](_0xd35d6e);if(!_0x181347)return;const _0x2e8339=_0x181347['getAttribute']('data-marker-id'),_0x4fa326=_0x2e8339['split'](':')['pop']()?.['split']('_')[0x0];this['_eventEmitter']['fire']('changeMarkerClicked',{'markerId':_0x2e8339,'changeId':_0x4fa326,'markerElement':()=>this['_findMarkerElementById'](_0x2e8339),'domEvent':_0x1a168e});},{'usePassive':!0x0,'priority':'highest'}),this['_domEmitter']['listenTo'](_0x461b7e,'mouseover',(_0x2fe9a0,_0x4319cd)=>{const _0x1cf525=_0x4319cd['target'],_0x74dfcc=_0x4319cd['relatedTarget'];let _0x5a2e4e=this['_findMarkerElement'](_0x1cf525);if(!_0x5a2e4e&&_0x74dfcc&&(_0x5a2e4e=this['_findMarkerElement'](_0x74dfcc)),!_0x5a2e4e)return;const _0x4c7e06=_0x5a2e4e['getAttribute']('data-marker-id'),_0x22c119=_0x4c7e06['split'](':')['pop']()?.['split']('_')[0x0];this['_eventEmitter']['fire']('changeMarkerHovered',{'changeId':_0x22c119,'markerElement':()=>this['_findMarkerElementById'](_0x4c7e06),'domEvent':_0x4319cd});});}['_registerGlobalBalloonBlurHandler'](){this['_domEmitter']['listenTo'](document,'mouseover',_0x18ec0f((_0x3ddb36,_0x555285)=>{const _0x4c0359=_0x555285['target'];if(this['_findMarkerElement'](_0x4c0359))return;_0x4c0359['closest']('.ck-reset.ck-ai_review-balloon-panel-suggestion')||this['_eventEmitter']['fire']('changeMarkerBlurred');},0xc8));}['getDocumentData'](){const _0x35e24e=this['context']['plugins']['get']('AIEditing'),_0x1f3438=Ws(this['context']);if(!_0x1f3438['length'])throw new at('ai-get-editor-from-context-no-editor',this);const _0xf5c98c=new Set(),_0x1dc1ce=[],_0x5cf276=new Map();for(const _0x12f82d of _0x1f3438)for(const _0x5e1695 of _0x12f82d['model']['document']['getRoots']()){if('$graveyard'===_0x5e1695['rootName'])continue;const _0x20b053=this['_buildDocumentDataSliceForRoot'](_0x12f82d,_0x5e1695,_0x35e24e,_0xf5c98c);_0x1dc1ce['push'](_0x20b053['content']);for(const [_0x4c1d22,_0x8e4a43]of _0x20b053['elements'])_0x5cf276['set'](_0x4c1d22,_0x8e4a43);}return{'elements':_0x5cf276,'content':_0x1dc1ce['join']('')};}['_buildDocumentDataSliceForRoot'](_0x548e6d,_0x38b361,_0x16abf6,_0x31183e){const _0x3a697e=_0x548e6d['model'],_0x38f3ae=new _0x19adab();for(const _0x576972 of _0x38b361['getChildren']())_0x38f3ae['_appendChild'](_0x576972['_clone'](!0x0));for(const _0x444931 of _0x3a697e['markers']){const _0x4a8995=_0x444931['getRange']();_0x4a8995&&_0x4a8995['root']['rootName']===_0x38b361['rootName']&&_0x38f3ae['markers']['set'](_0x444931['name'],this['_changeRangeOwnerDocument'](_0x4a8995['clone'](),_0x38f3ae));}const _0x353592=new Map(),_0x11188f=_0x3a697e['document']['version'],_0xd03820=new _0x4820fe({'ignoreElementEnd':!0x0,'startPosition':_0x3a697e['createPositionAt'](_0x38f3ae,0x0)});for(const {item:_0xfc5a6d}of _0xd03820){if(!_0xfc5a6d['is']('$textProxy'))continue;const _0x5d3e86=_0xfc5a6d['parent'];if(!_0x5d3e86||!_0x5d3e86['is']('element'))continue;const _0x6acb00=this['_upsertDataId'](_0x5d3e86,()=>_0x16abf6['_nextDataId'](_0x31183e));_0x31183e['add'](_0x6acb00);for(const _0x5da671 of _0x5d3e86['getChildren']())_0x5da671['is']('element')&&(_0x5da671['name']&&Ca['includes'](_0x5da671['name'])||_0x31183e['add'](this['_upsertDataId'](_0x5da671,()=>_0x16abf6['_nextDataId'](_0x31183e))));let _0x46a905=_0x5d3e86;for(;_0x46a905['parent']&&!_0x46a905['parent']['is']('documentFragment');)_0x46a905=_0x46a905['parent'],_0x46a905['hasAttribute'](_0x307282)&&_0x46a905['_removeAttribute'](_0x307282);_0x353592['set'](_0x6acb00,{'editor':_0x548e6d,'rootName':_0x38b361['rootName'],'path':_0x5d3e86['getPath'](),'documentVersion':_0x11188f,'getContent':this['_createGetContentUsingDataIdFn'](_0x46a905['_clone'](!0x0),_0x6acb00,_0x548e6d['data'])}),_0xd03820['jumpTo'](_0x3a697e['createPositionAfter'](_0x5d3e86));}return{'content':_0x548e6d['data']['processor']['toData'](_0x548e6d['data']['toView'](_0x38f3ae)),'elements':_0x353592};}['diffContent'](_0x475fe3,_0x2ac19f,_0x4b311d,_0x5adbf6=!0x1){const _0x41e69c=[],_0x226eec=_0x475fe3['data']['parse'](_0x4b311d,'$documentFragment'),_0x224888=_0x475fe3['data']['parse'](_0x2ac19f,'$documentFragment'),_0x12b8d3=_0x475fe3['model']['createPositionAt'](_0x224888,0x0);if(this['_haveSingleTopLevelElement'](_0x226eec)){if(!this['_hasSameTopLevelElement'](_0x224888,_0x226eec))return _0x41e69c;}else{const _0x588ac8=_0x475fe3['model']['schema'];if(!this['_haveOnlyInlineContent'](_0x224888,_0x588ac8)||!this['_haveOnlyInlineContent'](_0x226eec,_0x588ac8))return _0x41e69c;}const _0x2e8a75=this['context']['plugins']['get']('DocumentCompare')['getDiff'](_0x2ac19f,_0x4b311d,{'targetEditor':_0x475fe3,'anchor':_0x12b8d3,'markDeletions':!0x0})['getOperations']()['filter'](_0x360564=>'insert'===_0x360564['type']||'marker'===_0x360564['type']&&_0x360564['name']['startsWith']('$markedRemove')),_0x123a0a=this['_groupAdjacentOperations'](_0x2e8a75),_0x35514c=[];if(_0x5adbf6){if(_0x123a0a['length']){const _0x536092=_0x123a0a[0x0]['operations'][0x0],_0x5b49b1='insert'===_0x536092['type']?_0x536092['position']:_0x536092['newRange']['start'],_0x1d2fa2=this['_getPositionLimitingRange'](_0x5b49b1,_0x475fe3,'inside'),_0x4f438e=_0x1d2fa2?_0x226eec['getChild'](0x0)['getChildren']():_0x226eec['getChildren'](),_0x1c7ed0=_0x1d2fa2||_0x475fe3['model']['createRangeIn'](_0x224888),_0x3dc2a9=[new _0x3113a4('$markedRemove:synthetic'+ot(),null,_0x1c7ed0,_0x475fe3['model']['document']['model']['markers'],!0x0,_0x475fe3['model']['document']['version']+0x1),new _0x304cb7(_0x1c7ed0['end'],_0x4f438e,_0x475fe3['model']['document']['version']+0x2)];_0x35514c['push']({'operations':_0x3dc2a9,'operationsIsolated':_0x3dc2a9,'groupOffset':0x0});}}else _0x35514c['push'](..._0x123a0a);let _0x2c3e92=0x0;return _0x475fe3['model']['change'](_0x2b5def=>{for(let _0x8fc139=0x0;_0x8fc139<_0x35514c['length'];_0x8fc139++){const _0x1a026f=_0x35514c[_0x8fc139],_0x15af6f=_0x2b5def['createDocumentFragment']();for(const _0x517693 of _0x224888['getChildren']())_0x2b5def['append'](_0x517693['_clone'](!0x0),_0x15af6f);for(const _0x1ca6ad of _0x1a026f['operationsIsolated'])if('insert'===_0x1ca6ad['type']){const _0x1461cd=_0x1ca6ad;_0x1461cd['baseVersion']=null,_0x1461cd['isDocumentOperation']=!0x1,this['_changeOperationOwnerDocument'](_0x1461cd,_0x15af6f),_0x2b5def['batch']['addOperation'](_0x1ca6ad),_0x475fe3['model']['applyOperation'](_0x1ca6ad);const _0x5a8cb7='suggestion:insertion:id:authorId:'+_0x2c3e92++,_0x41983a=_0x475fe3['model']['createRange'](_0x1461cd['position'],_0x1461cd['position']['getShiftedBy'](_0x1461cd['howMany']));_0x15af6f['markers']['set'](_0x5a8cb7,_0x41983a);}else{if('marker'===_0x1ca6ad['type']&&_0x1ca6ad['name']['startsWith']('$markedRemove')){const _0x12e7a0=_0x1ca6ad,_0x1c231c='suggestion:deletion:id:authorId:'+_0x2c3e92++;this['_changeOperationOwnerDocument'](_0x12e7a0,_0x15af6f),_0x15af6f['markers']['set'](_0x1c231c,_0x12e7a0['newRange']);}}if(_0x5adbf6)_0x41e69c['push']({..._0x1a026f,'context':this['_createGetContentFn'](_0x224888,_0x475fe3['data']),'content':this['_createGetContentFn'](_0x224888,_0x475fe3['data'])});else{const _0x4fbe90=this['_getChangeContext'](this['_changePositionOwnerDocument'](this['_getOperationStart'](_0x1a026f['operationsIsolated'][0x0]),_0x15af6f),this['_changePositionOwnerDocument'](this['_getOperationEnd'](_0x1a026f['operationsIsolated'][_0x1a026f['operationsIsolated']['length']-0x1]),_0x15af6f),_0x475fe3);_0x15af6f['markers']['set'](Ta+'suggestion-context',new _0x2a951f(_0x4fbe90['start'],_0x4fbe90['end'])),_0x41e69c['push']({..._0x1a026f,'context':this['_createGetContextFn'](_0x15af6f,_0x475fe3['data'],{'ellipsisBefore':_0x4fbe90['hasContentBefore'],'ellipsisAfter':_0x4fbe90['hasContentAfter']}),'content':this['_createGetContentFn'](_0x15af6f,_0x475fe3['data'])});}}}),_0x41e69c;}['markChangePositionInEditorContent'](_0xa5d7ed,_0x529d2c){if(!_0xa5d7ed['length'])return;const _0x571d74=_0xa5d7ed[0x0]['parent']['id'],_0x4c26e2=_0x529d2c['elements']['get'](_0x571d74);if(!_0x4c26e2)return void console['warn']('No\x20element\x20found\x20for\x20ID:\x20'+_0x571d74);const _0x54ed4a=_0x4c26e2['path'],_0x113694=_0x4c26e2['editor'],_0x1d6e83=_0x113694['model']['document']['getRoot'](_0x4c26e2['rootName']);if(!_0x1d6e83)return void console['warn']('No\x20model\x20root\x20found\x20for\x20name:\x20'+_0x4c26e2['rootName']);const _0x560aa2=_0x113694['model']['document']['history']['getOperations'](_0x4c26e2['documentVersion']),_0x44274f=[];for(const _0x519df4 of _0xa5d7ed){const _0x4700d0=_0x519df4['operationsIsolated']['map'](_0x4dbc70=>this['_translateOperationToEditorContent'](_0x4dbc70,_0x54ed4a,_0x1d6e83));if(!_0x4700d0||!_0x4700d0['length'])continue;const _0x1c82ad=_0x4700d0['every'](_0x21fdad=>'marker'===_0x21fdad['type']&&_0x21fdad['name']['startsWith']('$markedRemove')),_0x3e0bab={'document':_0x113694['model']['document'],'useRelations':!0x1,'padWithNoOps':!0x1},_0x30b5d2=_0x5e674a(_0x4700d0,_0x560aa2,_0x3e0bab)['operationsA'];for(const _0x41b762 of _0x30b5d2)if('insert'===_0x41b762['type']){const _0x3b4473=_0x41b762,_0x5da606=_0x3b4473['nodes'];_0x113694['model']['change'](_0x12e03e=>{const _0x3e52ff=_0x12e03e['createDocumentFragment']();for(const _0x4bd51a of _0x5da606)_0x12e03e['append'](_0x4bd51a['_clone'](!0x0),_0x3e52ff);_0x44274f['push']({'start':_0x3b4473['position'],'end':_0x3b4473['position'],'type':'insert','groupId':_0x519df4['id'],'content':{'asString':this['_createGetContentFn'](_0x3e52ff,_0x113694['data'])(),'asFragment':_0x3e52ff}});});}else{if('marker'===_0x41b762['type']&&_0x41b762['name']['startsWith']('$markedRemove')){const _0x47e3c9=_0x41b762;let _0x157fac='remove-text';if(_0x1c82ad){const _0x499702=this['_findAdjacentContextDistance'](_0x47e3c9['newRange']['start'],'backward',_0x113694['model']['schema']),_0x231fa9=this['_findAdjacentContextDistance'](_0x47e3c9['newRange']['end'],'forward',_0x113694['model']['schema']);if(_0x499702||_0x231fa9){const _0x44fcaf=_0x47e3c9['newRange']['start']['getShiftedBy'](-_0x499702),_0x3a14=_0x47e3c9['newRange']['end']['getShiftedBy'](_0x231fa9);_0x44274f['push']({'start':_0x44fcaf,'end':_0x3a14,'groupId':_0x519df4['id'],'type':'remove-context'});}else _0x157fac='remove-only';}_0x44274f['push']({'start':_0x47e3c9['newRange']['start'],'end':_0x47e3c9['newRange']['end'],'groupId':_0x519df4['id'],'type':_0x157fac});}}}this['_insertMarkers'](_0x44274f,_0x113694);}['clearAllMarkers'](){const _0x37752e=new Map();for(const _0x1daeff of this['_markers']['keys']()){const _0x8bbeb8=this['_markers']['get'](_0x1daeff);_0x8bbeb8?.['editor']&&(_0x37752e['has'](_0x8bbeb8['editor'])||_0x37752e['set'](_0x8bbeb8['editor'],[]),_0x37752e['get'](_0x8bbeb8['editor'])['push'](_0x1daeff));}for(const [_0x188701,_0x4cb9ec]of _0x37752e)_0x188701['model']['change'](_0x35bbba=>{for(const _0x10b8e9 of _0x4cb9ec)_0x188701['model']['markers']['get'](_0x10b8e9)&&_0x35bbba['removeMarker'](_0x10b8e9);});this['_markers']['clear'](),this['_activeMarkers']['clear']();}['switchToReadOnly'](){for(const _0x336fd7 of Ws(this['context']))_0x336fd7['enableReadOnlyMode']('ai-review');}['switchToEdit'](){for(const _0x2c0326 of Ws(this['context']))_0x2c0326['disableReadOnlyMode']('ai-review');}['applyChange'](_0xe64931){const _0x55fbd3=_0xe64931['map'](_0x509d87=>this['_getMarkersDataForGroup'](_0x509d87))['flat'](),_0x12508c=new Map();for(const _0x49406c of _0x55fbd3)_0x12508c['has'](_0x49406c['editor'])||_0x12508c['set'](_0x49406c['editor'],[]),_0x12508c['get'](_0x49406c['editor'])['push'](_0x49406c);for(const [_0x55b8e8,_0x45ced8]of _0x12508c){const _0x335364=_0x55b8e8['model'];_0x335364['change'](_0x1a39ae=>{for(const _0x18f059 of _0x45ced8){const _0x34053a=_0x55b8e8['model']['markers']['get'](_0x18f059['id']);if(_0x34053a){if('insert'===_0x18f059['type']){if(!_0x18f059['content'])continue;_0x335364['insertContent'](_0x18f059['content']['asFragment']||null,_0x34053a['getRange']()['start']);}else'remove-text'!==_0x18f059['type']&&'remove-only'!==_0x18f059['type']||_0x335364['deleteContent'](_0x335364['createSelection'](_0x34053a['getRange']()));_0x1a39ae['removeMarker'](_0x18f059['id']),this['_markers']['delete'](_0x18f059['id']);}}});}}['rejectChange'](_0x12cdc2){const _0x401ef0=this['_getMarkersDataForGroup'](_0x12cdc2),_0x22d102=new Map();for(const _0x451d02 of _0x401ef0)_0x22d102['has'](_0x451d02['editor'])||_0x22d102['set'](_0x451d02['editor'],[]),_0x22d102['get'](_0x451d02['editor'])['push'](_0x451d02);for(const [_0x6569d,_0x3d849b]of _0x22d102)_0x6569d['model']['change'](_0x412220=>{for(const _0x512bf9 of _0x3d849b)_0x412220['removeMarker'](_0x512bf9['id']),this['_markers']['delete'](_0x512bf9['id']);});}['getEditor'](){return $s(this['context']);}['getEditors'](){return Ws(this['context']);}['getEditorForChange'](_0x4a111e){const _0x3803cd=this['_getMarkersDataForGroup'](_0x4a111e);return _0x3803cd[0x0]?.['editor'];}['getMarkerElementForChange'](_0x74820){const _0x137e34=Array['from'](this['_markers']['values']())['filter'](_0x29dec0=>_0x29dec0['groupId']===_0x74820);if(!_0x137e34['length'])return null;const _0x2687a4=0x1===_0x137e34['length']?_0x137e34[0x0]:this['_sortMarkers'](_0x137e34)[0x0],_0x4e7d92=_0x2687a4['editor']['model']['markers']['get'](_0x2687a4['id']);if(!_0x4e7d92)return null;return{'modelRange':_0x4e7d92['getRange'](),'getElement':()=>this['_findMarkerElementById'](_0x2687a4['id'])};}['getContentElementForChange'](_0x259e7a){const _0x10d538=Array['from'](this['_markers']['values']())['filter'](_0x5683ba=>_0x5683ba['groupId']===_0x259e7a);if(!_0x10d538['length'])return null;const _0x4f43b3=0x1===_0x10d538['length']?_0x10d538[0x0]:this['_sortMarkers'](_0x10d538)[0x0],_0x360f95=_0x4f43b3['editor'],_0x81c4b6=_0x360f95['model']['markers']['get'](_0x4f43b3['id']);if(!_0x81c4b6)return null;const _0x1baa22=_0x81c4b6['getRange'](),_0x23c4f8=_0x360f95['editing']['view']['getDomRoot'](_0x1baa22['root']['rootName'])||_0x360f95['editing']['view']['getDomRoot']();if(!_0x23c4f8||!_0x1baa22)return null;let _0x1e6d1e=_0x1baa22['start']['parent'];for(;_0x1e6d1e['parent']&&'$root'!==_0x1e6d1e['parent']['name'];)_0x1e6d1e=_0x1e6d1e['parent'];if(!_0x1e6d1e||!_0x1e6d1e['name'])return null;const _0xc9dcf3=_0x23c4f8['querySelector']('[data-marker-id=\x22'+_0x4f43b3['id']+'\x22]');if(!_0xc9dcf3)return null;let _0xc0b607=null;_0x360f95['model']['change'](_0x48b4b3=>{_0xc0b607=_0x48b4b3['createDocumentFragment'](),_0x48b4b3['append'](_0x1e6d1e['_clone'](!0x0),_0xc0b607);});const _0x32791d=_0x360f95['data']['toView'](_0xc0b607)['getChild'](0x0);return _0xc9dcf3['closest'](_0x32791d['name']);}['reactivateMarkers'](_0x151309){const _0x229117=this['_getMarkersDataForGroup'](_0x151309);if(!_0x229117['length'])return;const _0x2194f8=Array['from'](this['_activeMarkers'])['sort'](),_0x115f32=Array['from'](new Set(_0x229117['map'](_0x13d8d6=>_0x13d8d6['id'])))['sort']();_0x2194f8['join']('|')!==_0x115f32['join']('|')&&(this['setAllMarkersAsInactive'](),this['setMarkersInElementAsActive'](_0x151309));}['setMarkersInElementAsActive'](_0x19ca9d){const _0x14581b=this['_getMarkersDataForGroup'](_0x19ca9d);if(!_0x14581b['length'])return;const _0x4025d9=_0x14581b[0x0]['editor'],_0x165006=new Set(_0x14581b['map'](_0x2aae41=>_0x2aae41['id'])),_0x2230c0=Array['from'](_0x165006['values']())['map'](_0x2d3b65=>_0x4025d9['model']['markers']['get'](_0x2d3b65))['filter'](_0x3200e5=>!!_0x3200e5);_0x165006['forEach'](_0x44fa5f=>{this['_activeMarkers']['add'](_0x44fa5f);}),_0x4025d9['model']['change'](()=>{_0x2230c0['forEach'](_0x1db2ca=>{_0x4025d9['editing']['reconvertMarker'](_0x1db2ca);});});}['setAllMarkersAsInactive'](){const _0x497a08=Array['from'](this['_activeMarkers']);if(!_0x497a08['length'])return;this['_activeMarkers']['clear']();const _0x466898=new Map();for(const _0x9543f0 of _0x497a08){const _0x45ba4c=this['_markers']['get'](_0x9543f0);if(!_0x45ba4c)continue;const _0x377525=_0x45ba4c['editor'],_0x5598bb=_0x377525['model']['markers']['get'](_0x9543f0);_0x5598bb&&(_0x466898['has'](_0x377525)||_0x466898['set'](_0x377525,[]),_0x466898['get'](_0x377525)['push'](_0x5598bb));}for(const [_0x11ab31,_0x3280de]of _0x466898)_0x11ab31['model']['change'](()=>{_0x3280de['forEach'](_0xa6db9=>{_0x11ab31['editing']['reconvertMarker'](_0xa6db9);});});}['_getPositionLimitingRange'](_0x5e0729,_0x26c3a6,_0x2e197a='outside'){if(!_0x5e0729)return null;let _0x302be1=_0x5e0729['parent'];for(;_0x302be1&&_0x302be1['parent']&&'$root'!==_0x302be1['parent']['name']&&!_0x26c3a6['model']['schema']['isLimit'](_0x302be1)&&!_0x26c3a6['model']['schema']['isBlock'](_0x302be1);)_0x302be1=_0x302be1['parent'];if(!_0x302be1||!_0x302be1['name']||'$root'===_0x302be1['name'])return null;let _0x5a5d74=null;return _0x26c3a6['model']['change'](_0x516cc8=>{_0x5a5d74='inside'===_0x2e197a?_0x516cc8['createRangeIn'](_0x302be1):_0x516cc8['createRangeOn'](_0x302be1);}),_0x5a5d74;}['_validateMarkers'](_0x545d5a,_0x5509e1){const _0x6445c1=Array['from'](this['_markers']['keys']()),_0x29ddc8=new Map();for(const _0x4e96b9 of _0x6445c1){const _0xecd348=_0x545d5a['model']['markers']['get'](_0x4e96b9);if(!_0xecd348)continue;const _0x13e233=_0xecd348['getStart']()['root']['rootName']+':'+_0xecd348['getStart']()['path'][0x0];_0x29ddc8['has'](_0x13e233)||_0x29ddc8['set'](_0x13e233,[]),_0x29ddc8['get'](_0x13e233)['push'](_0xecd348);}const _0x432c07=new Set();for(const _0x3be292 of _0x545d5a['model']['document']['differ']['getChanges']()){let _0x5402a0='',_0x204825=null;if('insert'===_0x3be292['type'])_0x204825=new _0x2a951f(_0x3be292['position'],_0x3be292['position']['getShiftedBy'](_0x3be292['length'])),_0x5402a0=_0x3be292['position']['root']['rootName']+':'+_0x3be292['position']['path'][0x0];else{if('remove'!==_0x3be292['type'])continue;_0x204825=new _0x2a951f(_0x3be292['position']),_0x5402a0=_0x3be292['position']['root']['rootName']+':'+_0x3be292['position']['path'][0x0];}const _0x3cab32=_0x29ddc8['get'](_0x5402a0)||[];if(_0x3cab32['length']){for(const _0x4bc28b of _0x3cab32)if(_0x204825['root']['rootName']===_0x4bc28b['getRange']()['root']['rootName']&&('insert'!==_0x3be292['type']||!_0x204825['containsRange'](_0x4bc28b['getRange']()))&&(_0x204825['isIntersecting'](_0x4bc28b['getRange']())||_0x204825['start']['isTouching'](_0x4bc28b['getRange']()['end'])||_0x204825['end']['isTouching'](_0x4bc28b['getRange']()['start']))){const _0x5092ac=this['_parseMarkerName'](_0x4bc28b['name']);Array['from'](this['_markers']['values']())['filter'](_0x113a2f=>_0x113a2f['groupId']===_0x5092ac['groupId'])['forEach'](_0x30ad37=>_0x432c07['add'](_0x30ad37['id']));}}}if(_0x432c07['size']){for(const _0xe4578c of _0x432c07)_0x5509e1['removeMarker'](_0xe4578c);return!0x0;}return!0x1;}['_handleMarkerChanges'](_0x47b930){for(const {name:_0x1b610d,data:_0x204ca6}of _0x47b930['model']['document']['differ']['getChangedMarkers']()){if(!_0x1b610d['startsWith'](Ta))continue;const _0x1cdb47=_0x204ca6['oldRange'],_0x2cc98a=_0x204ca6['newRange'],_0x2552ab=_0x1cdb47&&'$graveyard'===_0x1cdb47['root']['rootName'],_0x53dd23=_0x2cc98a&&'$graveyard'===_0x2cc98a['root']['rootName'];if(_0x2552ab&&_0x53dd23)continue;const _0x59ebc8=this['_parseMarkerName'](_0x1b610d);this['_markers']['get'](_0x1b610d)&&(_0x53dd23||!_0x2cc98a?this['_eventEmitter']['fire']('changeMarkerRemoved',{'markerId':_0x1b610d,'changeId':_0x59ebc8['groupId']}):_0x2552ab&&_0x2cc98a&&this['_eventEmitter']['fire']('changeMarkerRestored',{'markerId':_0x1b610d,'changeId':_0x59ebc8['groupId']}));}}['_parseMarkerName'](_0x2eeb4a){const _0x2a03ee=_0x2eeb4a['split'](':'),_0x260e47=(_0x2a03ee[0x1]||'')['split']('_');return{'prefix':_0x2a03ee[0x0],'groupId':_0x260e47[0x0],'suffix':_0x260e47[0x1]};}['_translateOperationToEditorContent'](_0x3d9c1e,_0x2cd41b,_0x50ebac){if('insert'===_0x3d9c1e['type']){const _0x1335c2=_0x3d9c1e;return new _0x304cb7(this['_changePosition'](_0x2cd41b['concat'](_0x1335c2['position']['offset']),_0x50ebac),_0x1335c2['nodes'],_0x1335c2['baseVersion']);}if('marker'===_0x3d9c1e['type']&&_0x3d9c1e['name']['startsWith']('$markedRemove')){const _0x5b1973=_0x3d9c1e;return new _0x3113a4(_0x5b1973['name'],_0x5b1973['oldRange'],this['_changeRange'](_0x5b1973['newRange'],_0x2cd41b['concat'](_0x5b1973['newRange']['start']['offset']),_0x2cd41b['concat'](_0x5b1973['newRange']['end']['offset']),_0x50ebac),_0x5b1973['_markers'],_0x5b1973['affectsData'],_0x5b1973['baseVersion']);}return _0x3d9c1e;}['_groupAdjacentOperations'](_0x54ff4f){if(!_0x54ff4f['length'])return[];const _0x497219=[];let _0x16f206=0x0,_0xd9a470=0x0,_0x19b82f=[];for(let _0x5167a3=0x0;_0x5167a3<=_0x54ff4f['length'];_0x5167a3++){const _0x2a0313=_0x54ff4f[_0x5167a3],_0x587374=_0x54ff4f[_0x5167a3-0x1];!_0x2a0313||_0x587374&&!this['_getOperationEnd'](_0x587374)['isTouching'](this['_getOperationStart'](_0x2a0313))?(_0x497219['push']({'operations':_0x19b82f,'operationsIsolated':_0x19b82f['map'](_0x4cc5bd=>this['_shiftOperation'](_0x4cc5bd['clone'](),-_0xd9a470)),'groupOffset':_0x16f206}),_0x19b82f=_0x2a0313?[_0x2a0313]:[],_0xd9a470+=_0x16f206,_0x16f206=0x0):_0x19b82f['push'](_0x2a0313),_0x2a0313&&'insert'===_0x2a0313['type']&&(_0x16f206+=_0x2a0313['howMany']);}return _0x497219;}['_findAdjacentContextDistance'](_0x1a03f8,_0x14ced8,_0x3e7bd0,_0x460a70=0x1){const _0x455a35=new _0x4820fe({'startPosition':_0x1a03f8,'direction':_0x14ced8});let _0x5b1639=0x0;for(let _0x13448a=0x0;_0x13448a<_0x460a70;_0x13448a++){let _0x8dd634=0x0,_0x5b936b=!0x1,_0x53dd26='forward'===_0x14ced8?/^\W*\w+/:/\w+\W*$/;for(const {item:_0x15808f}of _0x455a35)if(_0x15808f['is']('$textProxy')){const _0x3ed835=_0x53dd26['exec'](_0x15808f['data']);if(_0x3ed835&&_0x3ed835['length']){if(_0x8dd634+='forward'===_0x14ced8?_0x3ed835['index']+_0x3ed835[0x0]['length']:_0x15808f['data']['length']-_0x3ed835['index'],_0x3ed835[0x0]['length']!==_0x15808f['data']['length'])break;_0x5b936b=!0x0,_0x53dd26='forward'===_0x14ced8?/^\w+/:/\w+$/;}else{if(_0x5b936b)break;_0x8dd634+=_0x15808f['offsetSize'];}}else{if(_0x15808f['is']('element')){_0x3e7bd0['isInline'](_0x15808f)&&!_0x5b936b&&(_0x8dd634+=0x1);break;}}_0x5b1639+=_0x8dd634,_0x455a35['jumpTo'](_0x1a03f8['getShiftedBy']('forward'===_0x14ced8?_0x5b1639:-_0x5b1639));}return _0x5b1639;}['_getChangeContext'](_0x49ae5e,_0x367d1c,_0x37a4a0){const _0x53662b=_0x37a4a0['model']['schema'],_0x5f0d9f=this['_findAdjacentContextDistance'](_0x49ae5e,'backward',_0x53662b,0x6),_0x420248=this['_findAdjacentContextDistance'](_0x367d1c,'forward',_0x53662b,0x6),_0x36dee6=_0x49ae5e['getShiftedBy'](-_0x5f0d9f),_0x1722e3=_0x367d1c['getShiftedBy'](_0x420248);return{'start':_0x36dee6,'end':_0x1722e3,'hasContentBefore':!_0x36dee6['isAtStart'],'hasContentAfter':!_0x1722e3['isAtEnd']};}['_insertMarkers'](_0x58504f,_0x36516d){const _0x2d834f=this['context']['plugins']['get']('AIEditing'),_0x3e4149=new Set();_0x36516d['model']['change'](_0x36122a=>{for(const _0x37989f of _0x58504f){const _0x245af9=''+Ta+_0x37989f['type']+':'+_0x37989f['groupId']+'_'+_0x2d834f['_nextDataId'](_0x3e4149);this['_markers']['set'](_0x245af9,{'id':_0x245af9,'groupId':_0x37989f['groupId'],'type':_0x37989f['type'],'content':_0x37989f['content'],'editor':_0x36516d}),_0x36122a['addMarker'](_0x245af9,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x36122a['createRange'](_0x37989f['start'],_0x37989f['end'])});}});}['_createGetContextFn'](_0xdb832e,_0x29c37a,_0x138f04){let _0x12b624='';return()=>{if(!_0x12b624){const _0x3d39ea=_0x29c37a['toView'](_0xdb832e,{'showSuggestionHighlights':!0x0});let _0x4415f2=_0x3d39ea['getChild'](0x0);if(_0x4415f2['is']('containerElement')||(_0x4415f2=_0x3d39ea),!_0x4415f2)return'';let _0x37ab5f=!0x1;const _0x3ddaba=[];for(const _0x21dd03 of _0x4415f2['getChildren']())_0x21dd03['is']('element','span')&&_0x21dd03['hasClass']('ck-ai_review-marker_context-end')&&(_0x37ab5f=!0x1),_0x37ab5f&&_0x3ddaba['push'](_0x21dd03),_0x21dd03['is']('element','span')&&_0x21dd03['hasClass']('ck-ai_review-marker_context-start')&&(_0x37ab5f=!0x0);_0x4415f2['_removeChildren'](0x0,_0x4415f2['childCount']),_0x138f04?.['ellipsisBefore']&&_0x4415f2['_appendChild']('…'),_0x4415f2['_appendChild'](_0x3ddaba),_0x138f04?.['ellipsisAfter']&&_0x4415f2['_appendChild']('…');const _0x4094d3=_0x29c37a['htmlProcessor']['domConverter']['viewToDom'](_0x3d39ea),_0x16617d=_0x29c37a['htmlProcessor']['htmlWriter']['getHtml'](_0x4094d3);_0x12b624=_0x16617d;}return _0x12b624;};}['_createGetContentFn'](_0x6ba7a,_0x56305b){let _0x4872d0='';return()=>(_0x4872d0||(_0x4872d0=_0x56305b['stringify'](_0x6ba7a,{'showSuggestionHighlights':!0x0})),_0x4872d0);}['_createGetContentUsingDataIdFn'](_0x1ec05d,_0x3edaf7,_0x538411){let _0xec3f1d='';return()=>{if(!_0xec3f1d){const _0xfbcfb4=_0x538411['toView'](new _0x19adab(_0x1ec05d)),_0x235027=_0x538411['htmlProcessor']['domConverter']['viewToDom'](_0xfbcfb4)['querySelector']('[data-id=\x22'+_0x3edaf7+'\x22]');_0xec3f1d=_0x235027?.['outerHTML']||'';}return _0xec3f1d;};}['_findMarkerElement'](_0x350a68,_0x42ebd3=0x5){let _0x44b37b=_0x350a68,_0x3c1c26=null;for(let _0x3b2200=0x0;_0x3b2200<_0x42ebd3&&_0x44b37b;_0x3b2200++){if(!_0x44b37b['className']){_0x44b37b=_0x44b37b['parentElement'];continue;}if(!(''+_0x44b37b['className'])['includes']('ck-ai_review-marker_')){_0x44b37b=_0x44b37b['parentElement'];continue;}if(!_0x44b37b['getAttribute']('data-marker-id'))break;_0x3c1c26=_0x44b37b;break;}return _0x3c1c26;}['_findMarkerElementById'](_0x4ef2e5){const _0x27d79e=this['_markers']['get'](_0x4ef2e5),_0x24b51b=_0x27d79e?.['editor']??$s(this['context']),_0x1da782=_0x24b51b['model']['markers']['get'](_0x4ef2e5);return _0x1da782?_0x40ecdc(_0x24b51b['editing'],_0x1da782):null;}['_getMarkersDataForGroup'](_0x5c00ac){return Array['from'](this['_markers']['values']())['filter'](_0x428fc8=>_0x428fc8['groupId']===_0x5c00ac);}['_getOperationStart'](_0x46e303){return'insert'===_0x46e303['type']?_0x46e303['position']:_0x46e303['newRange']['start'];}['_getOperationEnd'](_0x23fc71,_0xbd3a9b=!0x1){return'insert'===_0x23fc71['type']?_0xbd3a9b?_0x23fc71['position']:_0x23fc71['position']['getShiftedBy'](_0x23fc71['howMany']):_0x23fc71['newRange']['end'];}['_shiftOperation'](_0x24520d,_0x51c084){return'insert'===_0x24520d['type']?_0x24520d['position']=_0x24520d['position']['getShiftedBy'](_0x51c084):'marker'===_0x24520d['type']&&_0x24520d['newRange']&&(_0x24520d['newRange']=new _0x2a951f(_0x24520d['newRange']['start']['getShiftedBy'](_0x51c084),_0x24520d['newRange']['end']['getShiftedBy'](_0x51c084))),_0x24520d;}['_changeOperationOwnerDocument'](_0x513032,_0x2e20ef){'insert'===_0x513032['type']?_0x513032['position']=this['_changePositionOwnerDocument'](_0x513032['position'],_0x2e20ef):'marker'===_0x513032['type']&&_0x513032['newRange']&&(_0x513032['newRange']=this['_changeRangeOwnerDocument'](_0x513032['newRange'],_0x2e20ef));}['_changePositionOwnerDocument'](_0x194854,_0x3ca9e9){return new _0x53bf6b(_0x3ca9e9,_0x194854['path']);}['_changeRangeOwnerDocument'](_0x500f48,_0x42bd53){return new _0x2a951f(this['_changePositionOwnerDocument'](_0x500f48['start'],_0x42bd53),this['_changePositionOwnerDocument'](_0x500f48['end'],_0x42bd53));}['_changePosition'](_0x502832,_0x5035d3){return new _0x53bf6b(_0x5035d3,[..._0x502832]);}['_changeRange'](_0xde9ff6,_0x291665,_0x3bdf8d,_0x4a191){return new _0x2a951f(this['_changePosition'](_0x291665,_0x4a191),this['_changePosition'](_0x3bdf8d,_0x4a191));}['_sortMarkers'](_0x73ca16){const _0x381006=_0x5cb91d=>{switch(_0x5cb91d){case'insert':return 0x0;case'remove-context':return 0x1;case'remove-only':return 0x2;case'remove-text':return 0x3;}};return _0x73ca16['sort']((_0x18a8a3,_0x1382e5)=>_0x381006(_0x18a8a3['type'])-_0x381006(_0x1382e5['type']));}['_hasSameTopLevelElement'](_0x396d2c,_0x454c19){const _0x5760e6=_0x396d2c['getChild'](0x0),_0x563a90=_0x454c19['getChild'](0x0);return!(!_0x5760e6||!_0x563a90)&&((!_0x5760e6['is']('element')||!_0x563a90['is']('element')||_0x5760e6['name']===_0x563a90['name'])&&!(_0x5760e6['is']('element')&&!_0x563a90['is']('element')||!_0x5760e6['is']('element')&&_0x563a90['is']('element')));}['_haveSingleTopLevelElement'](_0x4a9984){return 0x1===_0x4a9984['childCount'];}['_haveOnlyInlineContent'](_0x5b26a3,_0x3f7d2e){for(const _0x1ab56c of _0x5b26a3['getChildren']())if(_0x1ab56c['is']('element')&&!_0x3f7d2e['isInline'](_0x1ab56c))return!0x1;return!0x0;}['_upsertDataId'](_0x521e4d,_0x5a4203){let _0x4cf0c4=_0x521e4d['getAttribute'](_0x307282);return _0x4cf0c4||(_0x4cf0c4=_0x5a4203(),_0x521e4d['_setAttribute'](_0x307282,_0x4cf0c4)),_0x4cf0c4;}}class fa extends Tt(){['id'];['contentNew'];['contentInitial'];['documentVersion'];constructor({id:_0x4eff93,contentNew:_0x539015,contentInitial:_0x3f8010,documentVersion:_0x2381e6}){super(),this['id']=_0x4eff93,this['contentNew']=_0x539015,this['contentInitial']=_0x3f8010,this['documentVersion']=_0x2381e6;}}class ba extends ht(){['id'];['parent'];['_data'];['_editorOperations']=[];constructor(_0x37a999,_0x582282,_0x378040){super(),this['id']=_0x37a999,this['parent']=_0x378040,this['_data']=_0x582282,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(_0x1058e9,_0x5327e0,_0x1da2c0,_0x3f8000,_0x5b0488){super(),this['_sourceCheck']=_0x5327e0,this['_documentData']=_0x1058e9,this['_aiConnector']=_0x1da2c0,this['_reviewParams']=_0x3f8000,this['_reviewArgs']=_0x5b0488,this['on']('change:status',(_0x5c05a7,_0x1d2ce8,_0x30b879)=>{'aborted'==_0x30b879&&(this['_wasAborted']=!0x0),this['fire']('reviewCheckRunUpdated',{'status':_0x30b879,'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'](_0x154f22=>'pending'===_0x154f22['status']);}get['currentError'](){return this['_currentError'];}['updateDocumentData'](_0x5f0935){this['_documentData']=_0x5f0935;}async['start'](){this['status']='loading',this['_currentError']=void 0x0;try{this['_activeRequest']=this['_createApiRequest']();const _0x354edb=await this['_activeRequest']['getStream']();this['status']='data';for await(const _0x4bb246 of _0x354edb)'unmodified'!==_0x4bb246['data']['operation']&&('error'!==_0x4bb246['data']['operation']?'review-metadata'!==_0x4bb246['event']?this['_addReviewCheckResult'](_0x4bb246['data']['dataId'],_0x4bb246['data']['textDelta']):this['callId']=_0x4bb246['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(_0x22f833){this['_currentError']=_0x22f833,_0x22f833 instanceof Error&&_0x22f833['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'](_0x358a45,_0x2a3889){const _0xcb4173=this['_results']['get'](_0x358a45);if(!_0xcb4173)return;if(0x0===_0x2a3889['length'])return;const _0xf71a04=[];_0x2a3889['forEach']((_0x37f175,_0x582c32)=>{const _0x88c65a=new ba(_0xcb4173['id']+'-'+_0x582c32,_0x37f175,_0xcb4173);_0x88c65a['on']('change:status',()=>{this['fire']('reviewCheckResultChangeStatusUpdated',{'change':_0x88c65a,'status':_0x88c65a['status']});}),_0x88c65a['on']('change:isActivated',()=>{_0x88c65a['isActivated']?this['fire']('reviewCheckResultActivated',{'change':_0x88c65a}):this['fire']('reviewCheckResultDeactivated',{'change':_0x88c65a});}),this['_changes']['push'](_0x88c65a),_0xf71a04['push'](_0x88c65a);}),this['fire']('reviewCheckResultReady',{'changes':_0xf71a04,'result':_0xcb4173,'source':this});}['abort'](){this['_activeRequest']&&(this['_activeRequest']['abortController']['abort'](),this['_activeRequest']=null,this['status']='aborted');}['isChangeActive'](_0x24e806){const _0x1e3133=this['_changes']['find'](_0x115ca9=>_0x115ca9['id']===_0x24e806);return!(!_0x1e3133||'pending'!==_0x1e3133['status']);}['isAnyChangeActivated'](){return this['_changes']['some'](_0x3605be=>!0x0===_0x3605be['isActivated']);}['getActiveChanges'](){return this['_changes']['filter'](_0x5d7608=>'pending'===_0x5d7608['status']);}['getChangeById'](_0x215135){return this['_changes']['find'](_0x408a0c=>_0x408a0c['id']===_0x215135);}['markAllChangesAsAccepted'](){for(const _0x344e6b of this['_changes'])'pending'===_0x344e6b['status']&&(_0x344e6b['status']='accepted');this['_checkIfFinished']();}['markChangeAsAccepted'](_0x4a601f){const _0x5c4057=this['_changes']['find'](_0x3cdafc=>_0x3cdafc['id']===_0x4a601f);_0x5c4057&&'pending'===_0x5c4057['status']&&(_0x5c4057['status']='accepted'),this['_checkIfFinished']();}['markChangeAsRejected'](_0x53fecc){const _0x1a21d7=this['_changes']['find'](_0x240f5b=>_0x240f5b['id']===_0x53fecc);_0x1a21d7&&'pending'===_0x1a21d7['status']&&(_0x1a21d7['status']='rejected'),this['_checkIfFinished']();}['markChangeAsOutdated'](_0x506095){const _0x422e3a=this['_changes']['find'](_0x1d276e=>_0x1d276e['id']===_0x506095);_0x422e3a&&'pending'===_0x422e3a['status']&&(_0x422e3a['status']='outdated'),this['_checkIfFinished']();}['markChangeAsPending'](_0x5981bb){const _0x5e85a4=this['_changes']['find'](_0x3cf22c=>_0x3cf22c['id']===_0x5981bb);_0x5e85a4&&'outdated'===_0x5e85a4['status']&&(_0x5e85a4['status']='pending'),this['_checkIfFinished']();}['activateChange'](_0x485cb9){this['_changes']['filter'](_0x2e7a00=>_0x2e7a00['isActivated']&&_0x2e7a00['id']!==_0x485cb9)['forEach'](_0x5a29c6=>{_0x5a29c6['isActivated']=!0x1;});const _0x1683dc=this['_changes']['find'](_0x5011ed=>_0x5011ed['id']===_0x485cb9);_0x1683dc&&'pending'===_0x1683dc['status']&&(_0x1683dc['isActivated']=!0x0);}['deactivateChange'](){this['_changes']['filter'](_0x3fd52e=>_0x3fd52e['isActivated'])['forEach'](_0xaaa8df=>{_0xaaa8df['isActivated']=!0x1;});}['forceReadyState'](){this['status']='ready';}async['sendRating'](_0x29ddd4){if('initialized'===this['status']||'loading'===this['status']||'data'===this['status']||this['_wasAborted'])return;if(!this['callId']||0x0===this['_changes']['length'])return;let _0x2749d5;if(_0x29ddd4){const _0x1c6cbf=this['_changes']['find'](_0x30a959=>_0x30a959['id']===_0x29ddd4);if(_0x1c6cbf&&_0x1c6cbf['isRated'])return;_0x1c6cbf&&(_0x2749d5=_0x1c6cbf['parent']['id'],_0x1c6cbf['isRated']=!0x0);}const _0x1dbb1d={'positiveCount':this['_changes']['filter'](_0x30ee2d=>'accepted'===_0x30ee2d['status'])['length'],'totalCount':this['_changes']['length']};this['_sendRatingRequest'](_0x1dbb1d,this['callId'],_0x2749d5);}['_addReviewCheckResult'](_0x1beb73,_0x351046){const _0x5048f1=this['_documentData']['elements']['get'](_0x1beb73);if(!_0x5048f1)return;const _0x571a71=_0x5048f1['getContent']();if(_0x571a71===_0x351046)return;const _0x2acdda=new fa({'id':_0x1beb73,'contentInitial':_0x571a71,'contentNew':_0x351046,'documentVersion':_0x5048f1['documentVersion']});this['_results']['set'](_0x2acdda['id'],_0x2acdda),this['fire']('reviewCheckResultAdded',{'result':_0x2acdda,'source':this,'editor':_0x5048f1['editor']});}['_checkIfFinished'](){'finished'===this['status']&&(this['_changes']['filter'](_0x293f48=>'pending'===_0x293f48['status'])['length']>0x0&&(this['status']='ready')),'ready'===this['status']&&(0x0===this['_changes']['filter'](_0x11cd9d=>'pending'===_0x11cd9d['status'])['length']&&(this['status']='finished'));}}class Ra extends Sa{get['subTitle'](){if(!this['_reviewParams']||0x0===this['_reviewParams']['length'])return'';const _0x22ec2f=[];if(this['_reviewParams']['length']>0x0&&this['_sourceCheck']['options'])for(let _0x369447=0x0;_0x369447<this['_reviewParams']['length'];_0x369447++){if(!this['_reviewParams'][_0x369447]||!this['_sourceCheck']['options'][_0x369447])continue;const _0x9af4de=this['_sourceCheck']['options'][_0x369447],_0xdb90d5=_0x9af4de['data']?.['find'](_0x583772=>_0x583772['id']===this['_reviewParams'][_0x369447]);_0xdb90d5&&_0x22ec2f['push'](_0xdb90d5['label']);}return _0x22ec2f['join'](',\x20');}get['reviewName'](){return this['_composeReviewName']();}['_createApiRequest'](){return this['_aiConnector']['callSystemReview']({'reviewName':this['_composeReviewName'](),'content':this['_documentData']['content'],'args':this['_reviewArgs']});}['_sendRatingRequest'](_0x23cb30,_0x55fa1d,_0x4ac6ba){return this['_aiConnector']['upsertAIReviewRating'](this['reviewName'],_0x55fa1d,_0x23cb30,_0x4ac6ba);}['_composeReviewName'](){return!this['_reviewParams']||0x0===this['_reviewParams']['length']||this['_sourceCheck']['useArgs']?this['_sourceCheck']['apiId']:[this['_sourceCheck']['apiId'],...this['_reviewParams']]['join']('-');}}class Oa extends _0xee6711{['_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(_0x337e9a,_0x3f7927)=>{const _0x5cf77d=this['_aiReviewCheckList']['getCheckById'](_0x3f7927['id']);if(_0x5cf77d){this['_onReviewCheckRun'](_0x3f7927),this['_aiReviewCoreEditing']['switchToReadOnly'](),this['_currentReviewCheckRun']=this['_createReviewCheckRun'](_0x3f7927,_0x5cf77d),this['_aiReviewCoreUi']['setCheckResultTitle'](this['_currentReviewCheckRun']['title'],this['_currentReviewCheckRun']['subTitle']),this['_currentReviewCheckRun']['on']('reviewCheckRunUpdated',(_0x3a4500,_0x87d4a8)=>{switch(_0x87d4a8['status']){case'data':case'loading':this['_aiReviewCoreUi']['showCheckRunResults'](_0x87d4a8);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'!==_0x87d4a8['status']&&'error-chunk'!==_0x87d4a8['status']&&'error-general'!==_0x87d4a8['status']||this['_currentReviewCheckRun']?.['sendRating']();}),this['_currentReviewCheckRun']['on']('reviewCheckResultAdded',(_0x28ff1a,_0x28e2f0)=>{if(!this['_currentReviewCheckRun'])throw new at('ai-review-mode-no-current-check-run',this);const _0x1da457=this['_diffContent'](_0x28e2f0['editor'],_0x28e2f0['result']['contentInitial'],_0x28e2f0['result']['contentNew']);_0x28e2f0['source']['addResultChanges'](_0x28e2f0['result']['id'],_0x1da457);}),this['_currentReviewCheckRun']['on']('reviewCheckResultReady',(_0x5c1992,_0x4b246a)=>{for(const _0x3cd7c4 of _0x4b246a['changes'])this['_aiReviewCoreUi']['showCheckRunResult'](_0x3cd7c4);this['_markChangePositionInEditorContent'](_0x4b246a['changes'],_0x4b246a['source']['documentData']);}),this['_currentReviewCheckRun']['on']('reviewCheckResultChangeStatusUpdated',(_0x580cb6,_0x291a14)=>{this['_aiReviewCoreUi']['updateChangeState'](_0x291a14['change']['id'],_0x291a14['status']);}),this['_currentReviewCheckRun']['on']('reviewCheckResultActivated',(_0x2aa263,_0x51e92e)=>{this['_onReviewCheckResultActivated'](_0x51e92e);}),this['_currentReviewCheckRun']['on']('reviewCheckResultDeactivated',()=>{this['_onReviewCheckResultDeactivated']();});try{await this['_currentReviewCheckRun']['start']();}catch(_0x14f6c6){_0x14f6c6 instanceof Error&&_0x14f6c6['message']['includes']('ai-request-aborted')||(_0x14f6c6 instanceof at?this['_logError'](_0x14f6c6):this['_logError'](new at('ai-review-mode-check-run-failed',this,void 0x0,_0x14f6c6)));}}else this['_logError'](new at('ai-review-mode-source-check-not-found',this,{'checkId':_0x3f7927['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 _0x301292=this['_currentReviewCheckRun']['getActiveChanges']();if(!_0x301292['length'])return;this['_aiReviewCoreEditing']['applyChange'](_0x301292['map'](_0x53e2d7=>_0x53e2d7['id']));const _0x3e46b7=this['_currentReviewCheckRun'];_0x3e46b7['markAllChangesAsAccepted'](),_0x3e46b7['sendRating']();}),this['listenTo'](this['_aiReviewCoreUi'],'acceptChange',(_0x104110,_0x2bb93c)=>{this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['isChangeActive'](_0x2bb93c['id'])&&(this['_aiReviewCoreEditing']['applyChange']([_0x2bb93c['id']]),this['_currentReviewCheckRun']['markChangeAsAccepted'](_0x2bb93c['id']),this['_aiReviewCoreUi']['hideChangeBalloon'](),this['_currentReviewCheckRun']['sendRating'](_0x2bb93c['id']));}),this['listenTo'](this['_aiReviewCoreUi'],'dismissChange',(_0x283b8e,_0x3353e6)=>{this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['isChangeActive'](_0x3353e6['id'])&&(this['_aiReviewCoreEditing']['rejectChange'](_0x3353e6['id']),this['_currentReviewCheckRun']['markChangeAsRejected'](_0x3353e6['id']),this['_aiReviewCoreUi']['hideChangeBalloon'](),this['_currentReviewCheckRun']['sendRating'](_0x3353e6['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',(_0x558642,_0xa197bc)=>{this['_onActivateChange'](_0xa197bc);}),this['listenTo'](this['_aiReviewCoreUi'],'deactivateChange',(_0x31c35a,_0x342cf3)=>{this['_onDeactivateChange'](_0x342cf3);}),this['listenTo'](this['_aiReviewCoreEditing']['emitter'],'changeMarkerClicked',(_0x14b8f2,_0x96719d)=>{this['_onChangeMarkerClicked'](_0x14b8f2,_0x96719d);}),this['listenTo'](this['_aiReviewCoreEditing']['emitter'],'changeMarkerHovered',(_0x5ca888,_0x25e592)=>{this['_onChangeMarkerHovered'](_0x5ca888,_0x25e592);}),this['listenTo'](this['_aiReviewCoreEditing']['emitter'],'changeMarkerBlurred',()=>{this['_onChangeMarkerBlurred']();}),this['listenTo'](this['_aiReviewCoreEditing']['emitter'],'changeMarkerRemoved',(_0x55aab2,_0x5db200)=>{this['_onChangeMarkerRemoved'](_0x55aab2,_0x5db200);}),this['listenTo'](this['_aiReviewCoreEditing']['emitter'],'changeMarkerRestored',(_0x22b71e,_0x475ca5)=>{this['_onChangeMarkerRestored'](_0x22b71e,_0x475ca5);});}['_createReviewCheckRun'](_0x23bbb2,_0x1be242){return new Ra(this['_aiReviewCoreEditing']['getDocumentData'](),_0x1be242,this['_aiConnector'],_0x23bbb2['params'],_0x23bbb2['args']);}['_onChangeMarkerRemoved'](_0x540003,_0x5bc690){this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['markChangeAsOutdated'](_0x5bc690['changeId']);}['_onChangeMarkerRestored'](_0x270fa7,_0x55ceee){this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['markChangeAsPending'](_0x55ceee['changeId']);}['_onCheckRunFinished'](){this['_aiReviewCoreUi']['showReviewCompletedView']();}['_initRequiredPlugins'](){this['_aiConnector']=this['context']['plugins']['get']('AIConnector');}['_onReviewRunLeave'](_0x5dc6aa=!0x1){this['_currentReviewCheckRun']&&(this['_currentReviewCheckRun']['hasModifications']||this['_currentReviewCheckRun']['sendRating'](),this['_currentReviewCheckRun']['stopListening'](),this['_currentReviewCheckRun']['abort'](),this['_currentReviewCheckRun']=void 0x0),_0x5dc6aa&&this['_aiReviewCoreUi']['showReviewCheckList'](),this['_aiReviewCoreEditing']['clearAllMarkers'](),this['_aiReviewCoreEditing']['switchToEdit'](),this['_changeActivationSource']=null;for(const _0x2e17dd of this['_aiReviewCoreEditing']['getEditors']())_0x2e17dd['editing']['view']['change'](_0x3110ec=>{for(const _0x2c7fa5 of _0x2e17dd['editing']['view']['document']['getRoots']())_0x3110ec['removeClass']('ck-ai_review-diff',_0x2c7fa5),_0x3110ec['removeClass']('ck-ai_review-highlights',_0x2c7fa5),_0x3110ec['removeClass']('ck-ai-translate-mode-content',_0x2c7fa5);});}['_getTranslationWithDefault'](_0x38640b,_0x31acea){const _0x2a5eb4=hs(this['context']['locale'],_0x38640b);return _0x2a5eb4===_0x38640b?_0x31acea:_0x2a5eb4;}['_logError'](_0x4a622f,_0x1330e2=!0x1){Et(_0x4a622f['message']),_0x1330e2||(_0x4a622f['message']['startsWith']('ai-review-mode-models-unable-to-retrieve')?this['_aiReviewCoreUi']['showGeneralReviewCoreErrorView']():this['_aiReviewCoreUi']['showGeneralResultsErrorView']());}['_scrollToChange'](_0x5f4cf6){if('content'===this['_changeActivationSource']){const _0x143e75=this['_aiReviewCoreUi']['getChangeElement'](_0x5f4cf6);_0x143e75&&ft(_0x143e75['closest']('.ck-ai_review__check-run-result')||_0x143e75);}else{if('panel'===this['_changeActivationSource']){const _0x49ddec=this['_getChangeContentElement'](_0x5f4cf6);if(!_0x49ddec)return;Ct({'target':_0x49ddec,'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(_0x528e78){this['id']=_0x528e78['id'],this['commandId']=_0x528e78['commandId'],this['title']=_0x528e78['title'],this['description']=_0x528e78['description'],this['isParameterized']=_0x528e78['isParameterized'],this['useArgs']=_0x528e78['useArgs'],this['options']=_0x528e78['options'],this['args']=_0x528e78['args'];}}class va extends ht(){['_checks']=[];['setupChecks'](_0x227e10){this['_checks']=_0x227e10['map'](_0x4084ea=>new Na(_0x4084ea));}get['checks'](){return this['_checks'];}['getCheckById'](_0x1c7c0d){return this['checks']['find'](_0x7587a5=>_0x7587a5['id']===_0x1c7c0d);}['removeCheckById'](_0x16ea8a){this['_checks']=this['_checks']['filter'](_0x27c8b5=>_0x27c8b5['id']!==_0x16ea8a);}}class ya extends Na{['_models']=[];['_defaultModel']=null;constructor(_0x3f5743,_0x1ad588,_0x59d7f0){super(_0x3f5743),this['_models']=_0x1ad588,this['_defaultModel']=_0x59d7f0;}get['models'](){return this['_models'];}get['defaultModel'](){return this['_defaultModel'];}}class xa extends Na{['isExtra']=!0x0;['prompt'];['model'];['_defaultModel']=null;constructor(_0x3340db,_0x3f5f15,_0x157c0d){super(_0x3340db),this['prompt']=_0x3340db['prompt'],this['model']=_0x3340db['model'],this['model']?this['_defaultModel']=_0x3f5f15['find'](_0xf3a9df=>_0xf3a9df['id']===this['model'])||null:this['_defaultModel']=_0x157c0d;}get['defaultModel'](){return this['_defaultModel'];}}class La extends va{['_allModels']=[];['_recommendedModels']=[];['_defaultModel']=null;constructor(_0x5d5e59,_0x412569,_0x26b1d7){super(),this['_allModels']=_0x5d5e59,this['_recommendedModels']=_0x412569,this['_defaultModel']=_0x26b1d7;}['setupChecks'](_0x1fa895){this['_checks']=_0x1fa895['map'](_0x382343=>!0x0===_0x382343['isExtra']?new xa(_0x382343,this['_allModels'],this['_defaultModel']):'custom'===_0x382343['id']?new ya(_0x382343,this['_recommendedModels'],this['_defaultModel']):new Na(_0x382343));}}class Da extends Sa{['_prompt'];['_model'];constructor(_0x2ec6dd,_0x417599,_0xd7cc4c,_0x83e298,_0x367ad0){super(_0xd7cc4c,_0x83e298,_0x367ad0),this['_prompt']=_0x2ec6dd,this['_model']=_0x417599;}get['subTitle'](){return this['_prompt'];}['_createApiRequest'](){return this['_aiConnector']['callCustomReview']({'content':this['_documentData']['content'],'prompt':this['_prompt'],'model':this['_model']});}['_sendRatingRequest'](_0x4f1c5f,_0xc05977,_0x4f35d6){return this['_aiConnector']['upsertCustomAIReviewRating'](_0xc05977,_0x4f1c5f,_0x4f35d6);}}class Pa extends Da{get['subTitle'](){return'';}set['prompt'](_0x392639){this['_prompt']=_0x392639;}set['model'](_0x325928){this['_model']=_0x325928;}}class Ha extends Oa{static get['pluginName'](){return'AIReviewModeController';}['_isDiffOn']=!0x1;['_hasDefaultAvailableCommands']=!0x1;constructor(_0x3fd2e0){super(_0x3fd2e0),this['_hasDefaultAvailableCommands']=!this['context']['config']['get']('ai.review.availableCommands'),this['context']['config']['define']('ai.review.availableCommands',ka['map'](_0x48a565=>_0x48a565['id'])),this['context']['config']['define']('ai.review.extraCommands',[]);}async['init'](){await super['init'](),this['listenTo'](this['_aiReviewCoreUi'],'toggleDiff',(_0x49503b,_0x2abda9)=>{this['_isDiffOn']=_0x2abda9['on'],this['_onDiffChange'](this['_isDiffOn']);});}['_initRequiredPlugins'](){super['_initRequiredPlugins'](),this['_aiReviewCoreUi']=this['context']['plugins']['get']('AIReviewModeUI'),this['_aiReviewCoreEditing']=this['context']['plugins']['get']('AIReviewCoreEditing');}['_createReviewCheckRun'](_0x451429,_0x3859a0){return _0x451429['isCustom']?new Da(_0x451429['args']['prompt'],_0x451429['args']['model'],this['_aiReviewCoreEditing']['getDocumentData'](),_0x3859a0,this['_aiConnector']):_0x3859a0['isExtra']?new Pa(_0x3859a0['prompt'],_0x3859a0['defaultModel']['id'],this['_aiReviewCoreEditing']['getDocumentData'](),_0x3859a0,this['_aiConnector']):new Ra(this['_aiReviewCoreEditing']['getDocumentData'](),_0x3859a0,this['_aiConnector'],_0x451429['params'],_0x451429['args']);}['_onReviewCheckResultActivated'](_0x19f0f2){this['_aiReviewCoreUi']['setActiveStateInResults'](_0x19f0f2['change']['id']),this['_scrollToChange'](_0x19f0f2['change']['id']);const _0x2c2edb=this['_aiReviewCoreEditing']['getMarkerElementForChange'](_0x19f0f2['change']['id']);if(!_0x2c2edb)return;const _0x1f6aeb=this['_aiReviewCoreEditing']['getEditorForChange'](_0x19f0f2['change']['id'])??this['_aiReviewCoreEditing']['getEditor']();this['_aiReviewCoreUi']['showChangeBalloon'](_0x19f0f2['change'],()=>_0x2c2edb['getElement'](),void 0x0,'click',this['_getBalloonDomRoot'](_0x1f6aeb,_0x2c2edb['modelRange']['root']['rootName']),_0x1f6aeb?.['ui']?.['viewportOffset']),this['_aiReviewCoreEditing']['setMarkersInElementAsActive'](_0x19f0f2['change']['id']);}['_onReviewCheckResultDeactivated'](){this['_aiReviewCoreUi']['resetActiveStateInResults'](),this['_aiReviewCoreUi']['hideChangeBalloon'](),this['_aiReviewCoreEditing']['setAllMarkersAsInactive']();}['_onActivateChange'](_0x2f595a){this['_currentReviewCheckRun']&&'click'===_0x2f595a['uiInteraction']&&(this['_changeActivationSource']='panel',this['_currentReviewCheckRun']['activateChange'](_0x2f595a['id']));}['_onDeactivateChange'](_0x4f1174){this['_currentReviewCheckRun']&&'balloon'===_0x4f1174['origin']&&this['_currentReviewCheckRun']['deactivateChange']();}['_onChangeMarkerClicked'](_0x69ee6a,_0x59e715){if(!this['_currentReviewCheckRun'])return;this['_changeActivationSource']='content',this['_currentReviewCheckRun']['activateChange'](_0x59e715['changeId']);const _0x52fd74=this['_currentReviewCheckRun']['getChangeById'](_0x59e715['changeId']);if(!_0x52fd74)return;const _0x2673e7=this['_aiReviewCoreEditing']['getMarkerElementForChange'](_0x59e715['changeId']),_0x257770=this['_aiReviewCoreEditing']['getEditorForChange'](_0x59e715['changeId'])??this['_aiReviewCoreEditing']['getEditor']();this['_aiReviewCoreUi']['showChangeBalloon'](_0x52fd74,_0x59e715['markerElement'],_0x59e715['domEvent'],'click',this['_getBalloonDomRoot'](_0x257770,_0x2673e7?.['modelRange']['root']['rootName']),_0x257770?.['ui']?.['viewportOffset']);}['_onChangeMarkerHovered'](_0x28eb9b,_0x2ffc80){if(!this['_currentReviewCheckRun'])return;if(this['_currentReviewCheckRun']['isAnyChangeActivated']())return;const _0x225332=this['_currentReviewCheckRun']['getChangeById'](_0x2ffc80['changeId']);if(!_0x225332)return;const _0x491ab3=this['_aiReviewCoreEditing']['getMarkerElementForChange'](_0x2ffc80['changeId']),_0x189fc3=this['_aiReviewCoreEditing']['getEditorForChange'](_0x2ffc80['changeId'])??this['_aiReviewCoreEditing']['getEditor']();this['_aiReviewCoreUi']['showChangeBalloon'](_0x225332,_0x2ffc80['markerElement'],_0x2ffc80['domEvent'],'hover',this['_getBalloonDomRoot'](_0x189fc3,_0x491ab3?.['modelRange']['root']['rootName']),_0x189fc3?.['ui']?.['viewportOffset']);}['_onChangeMarkerBlurred'](){if(!this['_currentReviewCheckRun'])return;this['_currentReviewCheckRun']['isAnyChangeActivated']()||this['_aiReviewCoreUi']['hideChangeBalloon']();}['_getChangeContentElement'](_0x438be6){const _0x1388d0=this['_aiReviewCoreEditing']['getMarkerElementForChange'](_0x438be6);return _0x1388d0?_0x1388d0['getElement']():null;}['_markChangePositionInEditorContent'](_0x4d573c,_0x1cb5ce){this['_aiReviewCoreEditing']['markChangePositionInEditorContent'](_0x4d573c,_0x1cb5ce);}['_diffContent'](_0x12f723,_0x116a87,_0x48e390){return this['_aiReviewCoreEditing']['diffContent'](_0x12f723,_0x116a87,_0x48e390,!0x1);}['_onReviewCheckRun'](){this['_onDiffChange'](this['_isDiffOn']);}['_onDiffChange'](_0x4e405e){_0x4e405e?this['_aiReviewCoreUi']['hideDiffInBalloon']():this['_aiReviewCoreUi']['showDiffInBalloon']();for(const _0x3b49a6 of this['_aiReviewCoreEditing']['getEditors']())_0x3b49a6['editing']['view']['change'](_0x825a4d=>{for(const _0x546017 of _0x3b49a6['editing']['view']['document']['getRoots']()){for(const _0x1665bd of _0x546017['getClassNames']())_0x1665bd['startsWith']('ck-ai_review-')&&_0x825a4d['removeClass'](_0x1665bd,_0x546017);_0x825a4d['addClass'](_0x4e405e?'ck-ai_review-diff':'ck-ai_review-highlights',_0x546017);}});}['_getBalloonDomRoot'](_0x46bce7,_0x2bb87c){const _0x2d887a=_0x46bce7['editing']['view'];if(_0x2bb87c){const _0x467280=_0x2d887a['getDomRoot'](_0x2bb87c);if(_0x467280)return _0x467280;}return _0x2d887a['getDomRoot']()??void 0x0;}async['_getChecksList'](){const _0x566246=[...ka,...this['_getExtraChecks']()],_0x3d527c=this['context']['config']['get']('ai.review.availableCommands')||[];this['_logErrorForNonExistentChecks'](_0x3d527c,_0x566246);let _0x3df48e=_0x566246;this['_hasDefaultAvailableCommands']||(_0x3df48e=_0x3d527c['map'](_0x37b553=>_0x566246['find'](_0x5f4094=>_0x5f4094['id']===_0x37b553))['filter'](_0x121016=>!!_0x121016)),_0x3df48e=_0x3df48e['map'](_0x315b76=>_0x315b76['isExtra']?_0x315b76:this['_translateReviewCheck'](_0x315b76));const _0x4c2a07=_0x3df48e['some'](_0x1e60fe=>_0x1e60fe['isExtra']||'custom'===_0x1e60fe['id']);let _0x26a938=[],_0x4ff692=[],_0xb04a04=null;if(_0x4c2a07){const _0x35bb18=await this['_getModels']();_0x26a938=_0x35bb18['all'],_0x4ff692=_0x35bb18['recommended'],_0xb04a04=_0x35bb18['default'];}const _0x35fe75=new La(_0x26a938,_0x4ff692,_0xb04a04);return _0x35fe75['setupChecks'](_0x3df48e),_0x4c2a07&&this['_filterChecksWithMissingModel'](_0x35fe75),_0x35fe75;}['_getExtraChecks'](){return(this['context']['config']['get']('ai.review.extraCommands')||[])['map'](_0x1f9d0f=>({'id':_0x1f9d0f['id'],'commandId':_0x1f9d0f['id'],'title':_0x1f9d0f['label'],'description':_0x1f9d0f['description'],'isParameterized':!0x1,'isExtra':!0x0,'prompt':_0x1f9d0f['prompt'],'model':_0x1f9d0f['model']}));}['_logErrorForNonExistentChecks'](_0x27c794,_0x44bb99){const _0x24a80f=_0x27c794['filter'](_0x3faa6b=>!_0x44bb99['some'](_0x3afc48=>_0x3afc48['id']===_0x3faa6b));_0x24a80f['length']&&this['_logError'](new at('ai-review-mode-non-existent-commands-used',this,{'commandIds':_0x24a80f['join'](',\x20')}),!0x0);}async['_getModels'](){try{const _0x786976=new Fs({'connector':this['_aiConnector'],'config':this['context']['config']['get']('ai.models'),'locale':this['context']['locale']});return{'all':await _0x786976['getAll'](),'recommended':await _0x786976['getAvailableModels'](),'default':await _0x786976['getDefault']()};}catch(_0x5cab70){return this['_logError'](new at('ai-review-mode-models-unable-to-retrieve',this,void 0x0,_0x5cab70)),{'all':[],'recommended':[],'default':null};}}['_translateReviewCheck'](_0x37c300){const _0x223c42='AI_REVIEW_CHECK_'+_0x37c300['id']['toUpperCase']()['replaceAll']('-','_'),_0x4340fb={..._0x37c300,'title':this['_getTranslationWithDefault'](_0x223c42+'_TITLE',_0x37c300['title']),'description':this['_getTranslationWithDefault'](_0x223c42+'_DESCRIPTION',_0x37c300['description'])};return _0x37c300['options']&&(_0x4340fb['options']=_0x37c300['options']['map'](_0x2d4198=>({..._0x2d4198,'label':this['_getTranslationWithDefault'](_0x223c42+'_OPTIONS_LABEL',_0x2d4198['label']||''),'data':_0x2d4198['data']?_0x2d4198['data']['map'](_0x59a4e1=>({..._0x59a4e1,'label':this['_getTranslationWithDefault'](_0x223c42+'_OPTIONS_DATA_'+_0x59a4e1['id']['toUpperCase'](),_0x59a4e1['label'])})):void 0x0}))),_0x4340fb;}['_filterChecksWithMissingModel'](_0x2680e8){const _0x4feb5e=[];_0x2680e8['checks']['forEach'](_0x17d52f=>{(_0x17d52f instanceof xa&&!_0x17d52f['defaultModel']||_0x17d52f instanceof ya&&!_0x17d52f['models']['length'])&&_0x4feb5e['push'](_0x17d52f['id']);}),_0x4feb5e['length']&&_0x4feb5e['forEach'](_0xc8e944=>{_0x2680e8['removeCheckById'](_0xc8e944),this['_logError'](new at('ai-review-mode-command-unavailable-due-to-missing-model',this,{'commandId':_0xc8e944}),!0x0);});}}class Ma extends _0xee6711{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'](_0x26515c){this['_checks']=_0x26515c['map'](_0x1cb90b=>new Ua(_0x1cb90b));}}class Ba extends Ra{['_title'];constructor(_0x5b1b9a,_0x51eed7,_0x226e2a,_0x437db2,_0xea58a9,_0x5e22ba){super(_0x5b1b9a,_0x51eed7,_0x226e2a,_0xea58a9,_0x5e22ba),this['_title']=_0x437db2;}get['title'](){return this['_title'];}get['subTitle'](){return this['_sourceCheck']['title'];}}class Ga extends Oa{static get['pluginName'](){return'AITranslateController';}constructor(_0x4903c5){super(_0x4903c5),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'](_0x3a7808,_0x99869b){return new Ba(this['_aiReviewCoreEditing']['getDocumentData'](),_0x99869b,this['_aiConnector'],hs(this['context']['locale'],'AI_REVIEW_CHECK_TRANSLATE_TITLE'),_0x3a7808['params'],_0x3a7808['args']);}['_onReviewCheckResultActivated'](_0x208c6d){this['_aiReviewCoreUi']['setActiveStateInResults'](_0x208c6d['change']['id']),this['_aiReviewCoreEditing']['setMarkersInElementAsActive'](_0x208c6d['change']['id']);}['_onReviewCheckResultDeactivated'](){this['_aiReviewCoreEditing']['setAllMarkersAsInactive'](),this['_aiReviewCoreUi']['resetActiveStateInResults']();}['_onActivateChange'](_0x661476){this['_currentReviewCheckRun']&&('hover'===_0x661476['uiInteraction']&&(this['_changeActivationSource']='panel',this['_currentReviewCheckRun']['activateChange'](_0x661476['id'])),'click'===_0x661476['uiInteraction']&&this['_scrollToChange'](_0x661476['id']));}['_onDeactivateChange'](_0x2d73e6){this['_currentReviewCheckRun']&&'panel'===_0x2d73e6['origin']&&this['_currentReviewCheckRun']['deactivateChange']();}['_onChangeMarkerClicked'](_0x4f3ce8,_0x53ee3b){this['_currentReviewCheckRun']&&(this['_changeActivationSource']='content',this['_currentReviewCheckRun']['activateChange'](_0x53ee3b['changeId']),this['_scrollToChange'](_0x53ee3b['changeId']));}['_onChangeMarkerHovered'](_0xe5e142,_0x33d608){this['_currentReviewCheckRun']&&(this['_changeActivationSource']='content',this['_currentReviewCheckRun']['activateChange'](_0x33d608['changeId']),this['_aiReviewCoreEditing']['reactivateMarkers'](_0x33d608['changeId']));}['_onChangeMarkerBlurred'](){this['_currentReviewCheckRun']&&'content'===this['_changeActivationSource']&&(this['_currentReviewCheckRun']['deactivateChange'](),this['_aiReviewCoreEditing']['setAllMarkersAsInactive']());}['_getChangeContentElement'](_0x3a3f93){return this['_aiReviewCoreEditing']['getContentElementForChange'](_0x3a3f93);}['_markChangePositionInEditorContent'](_0x4b86f5,_0x44a996){this['_aiReviewCoreEditing']['markChangePositionInEditorContent'](_0x4b86f5,_0x44a996);}['_diffContent'](_0x72b567,_0x1976a5,_0x1ecb1f){return this['_aiReviewCoreEditing']['diffContent'](_0x72b567,_0x1976a5,_0x1ecb1f,!0x0);}['_onReviewCheckRun'](){for(const _0x3ea35a of this['_aiReviewCoreEditing']['getEditors']())_0x3ea35a['editing']['view']['change'](_0x4b10e9=>{for(const _0x216f87 of _0x3ea35a['editing']['view']['document']['getRoots']())_0x4b10e9['addClass']('ck-ai-translate-mode-content',_0x216f87);});}async['_getChecksList'](){const _0x2b7f8f=[],_0x3ab258=this['context']['config']['get']('ai.translate.languages')||[];for(const _0x33339c of _0x3ab258)_0x2b7f8f['push']({'title':_0x33339c['label'],'id':_0x33339c['id'],'commandId':_0x33339c['id'],'description':'','isParameterized':!0x1,'useArgs':!0x0,'args':{'language':_0x33339c['id']}});const _0x35fe25=new Va();return _0x35fe25['setupChecks'](this['_translateChecks'](_0x2b7f8f)),_0x35fe25;}['_translateChecks'](_0x235d17){return _0x235d17['map'](_0x438fc4=>{const _0x101c23='AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_'+_0x438fc4['title']['toUpperCase']()['replaceAll']('-','_');return{..._0x438fc4,'title':this['_getTranslationWithDefault'](_0x101c23,_0x438fc4['title'])};});}}class Fa extends ca{constructor(_0x15785f,_0x1c8f20){super(_0x15785f,_0x1c8f20),this['on']('set:isLoading',(_0x46bf87,_0x1ff16f,_0x2f6f54)=>{_0x2f6f54&&(this['headerTitle']=hs(this['locale'],'AI_TRANSLATE_CHECK_RESULTS_LOADING_TITLE'));}),this['on']('set:isResultReady',(_0x4a1d8c,_0x122160,_0x52218c)=>{_0x52218c&&(this['headerTitle']=hs(this['locale'],'AI_TRANSLATE_CHECK_RESULTS_READY_TITLE'));});}['_createAcceptAllButtonView'](){const _0x5459c5=super['_createAcceptAllButtonView']();return _0x5459c5['set']('label',hs(this['locale'],'AI_TRANSLATE_ACCEPT_ALL')),_0x5459c5;}['_createExitReviewButtonView'](){const _0x1dabda=super['_createExitReviewButtonView']();return _0x1dabda['set']('label',hs(this['locale'],'AI_CHAT_HISTORY_CANCEL')),_0x1dabda;}}class Ka extends pa{['_setupTemplate'](){const _0x312a97=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-translate__check-list-wrapper',_0x312a97['if']('isVisible','ck-hidden',_0x2632aa=>!_0x2632aa)]},'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',_0x312a97['if']('isVisible','ck-hidden',_0x24c281=>!_0x24c281)]},'children':this['_checkViews']}]});}}class Wa extends ra{static get['pluginName'](){return'AITranslateUI';}['createMainView'](){const _0x8f0d6d=this['context']['plugins']['get']('AITabs'),_0x39e2a4=this['context']['locale'],_0x3458fb=new eo(_0x39e2a4,{'label':hs(_0x39e2a4,'AI_REVIEW_CHECK_TRANSLATE_TITLE'),'icon':_0x157c37,'class':'ck-ai-header_review-translate','showResizeButton':_0x8f0d6d['showResizeButton']});_0x3458fb['delegate']('resizeTabs')['to'](_0x8f0d6d),_0x3458fb['bind']('isMaximized')['to'](_0x8f0d6d['view'],'isMaximized',_0x1f8343=>_0x1f8343);const _0x42e4c1=new aa(_0x39e2a4,{'header':_0x3458fb,'list':new Ka(_0x39e2a4),'results':new Fa(_0x39e2a4,{'generalErrorText':hs(_0x39e2a4,'AI_TRANSLATE_GENERAL_ERROR_MESSAGE')}),'completed':new la(_0x39e2a4,{'headerText':hs(_0x39e2a4,'AI_TRANSLATE_FINISH_HEADER_TITLE'),'emptyResultsText':hs(_0x39e2a4,'AI_TRANSLATE_EMPTY_RESULTS_TEXT'),'buttonText':hs(_0x39e2a4,'AI_TRANSLATE_FINISH_BUTTON_LABEL')})});return _0x42e4c1['extendTemplate']({'attributes':{'class':'ck-ai-translate-mode'}}),_0x42e4c1;}['registerTab'](){const _0x400ff3=this['context']['plugins']['get']('AITabs');_0x400ff3['view']['on']('activateTab',(_0x37fbb8,{newTab:_0x1bb84a,oldTab:_0x5653a0})=>{'translate'===_0x1bb84a?this['fire']('getReviewCheckList'):'translate'===_0x5653a0&&this['fire']('leaveReview');}),_0x400ff3['view']['addTab']({'id':'translate','buttonLabel':hs(this['context']['locale'],'AI_REVIEW_CHECK_TRANSLATE_TITLE'),'buttonIcon':_0x157c37,'order':0x0,'content':this['_mainView']});}}class Ya extends _0xee6711{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};