@ckeditor/ckeditor5-ai 48.1.0-alpha.6 → 48.1.0-alpha.8
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.
- package/dist/index.js +6 -6
- package/dist/translations/af.js +1 -1
- package/dist/translations/af.umd.js +1 -1
- package/dist/translations/ar.js +1 -1
- package/dist/translations/ar.umd.js +1 -1
- package/dist/translations/ast.js +1 -1
- package/dist/translations/ast.umd.js +1 -1
- package/dist/translations/az.js +1 -1
- package/dist/translations/az.umd.js +1 -1
- package/dist/translations/be.js +1 -1
- package/dist/translations/be.umd.js +1 -1
- package/dist/translations/bg.js +1 -1
- package/dist/translations/bg.umd.js +1 -1
- package/dist/translations/bn.js +1 -1
- package/dist/translations/bn.umd.js +1 -1
- package/dist/translations/bs.js +1 -1
- package/dist/translations/bs.umd.js +1 -1
- package/dist/translations/ca.js +1 -1
- package/dist/translations/ca.umd.js +1 -1
- package/dist/translations/cs.js +1 -1
- package/dist/translations/cs.umd.js +1 -1
- package/dist/translations/da.js +1 -1
- package/dist/translations/da.umd.js +1 -1
- package/dist/translations/de-ch.js +1 -1
- package/dist/translations/de-ch.umd.js +1 -1
- package/dist/translations/de.js +1 -1
- package/dist/translations/de.umd.js +1 -1
- package/dist/translations/el.js +1 -1
- package/dist/translations/el.umd.js +1 -1
- package/dist/translations/en-au.js +1 -1
- package/dist/translations/en-au.umd.js +1 -1
- package/dist/translations/en-gb.js +1 -1
- package/dist/translations/en-gb.umd.js +1 -1
- package/dist/translations/en.js +1 -1
- package/dist/translations/en.umd.js +1 -1
- package/dist/translations/eo.js +1 -1
- package/dist/translations/eo.umd.js +1 -1
- package/dist/translations/es-co.js +1 -1
- package/dist/translations/es-co.umd.js +1 -1
- package/dist/translations/es.js +1 -1
- package/dist/translations/es.umd.js +1 -1
- package/dist/translations/et.js +1 -1
- package/dist/translations/et.umd.js +1 -1
- package/dist/translations/eu.js +1 -1
- package/dist/translations/eu.umd.js +1 -1
- package/dist/translations/fa.js +1 -1
- package/dist/translations/fa.umd.js +1 -1
- package/dist/translations/fi.js +1 -1
- package/dist/translations/fi.umd.js +1 -1
- package/dist/translations/fr.js +1 -1
- package/dist/translations/fr.umd.js +1 -1
- package/dist/translations/gl.js +1 -1
- package/dist/translations/gl.umd.js +1 -1
- package/dist/translations/gu.js +1 -1
- package/dist/translations/gu.umd.js +1 -1
- package/dist/translations/he.js +1 -1
- package/dist/translations/he.umd.js +1 -1
- package/dist/translations/hi.js +1 -1
- package/dist/translations/hi.umd.js +1 -1
- package/dist/translations/hr.js +1 -1
- package/dist/translations/hr.umd.js +1 -1
- package/dist/translations/hu.js +1 -1
- package/dist/translations/hu.umd.js +1 -1
- package/dist/translations/hy.js +1 -1
- package/dist/translations/hy.umd.js +1 -1
- package/dist/translations/id.js +1 -1
- package/dist/translations/id.umd.js +1 -1
- package/dist/translations/it.js +1 -1
- package/dist/translations/it.umd.js +1 -1
- package/dist/translations/ja.js +1 -1
- package/dist/translations/ja.umd.js +1 -1
- package/dist/translations/jv.js +1 -1
- package/dist/translations/jv.umd.js +1 -1
- package/dist/translations/kk.js +1 -1
- package/dist/translations/kk.umd.js +1 -1
- package/dist/translations/km.js +1 -1
- package/dist/translations/km.umd.js +1 -1
- package/dist/translations/kn.js +1 -1
- package/dist/translations/kn.umd.js +1 -1
- package/dist/translations/ko.js +1 -1
- package/dist/translations/ko.umd.js +1 -1
- package/dist/translations/ku.js +1 -1
- package/dist/translations/ku.umd.js +1 -1
- package/dist/translations/lt.js +1 -1
- package/dist/translations/lt.umd.js +1 -1
- package/dist/translations/lv.js +1 -1
- package/dist/translations/lv.umd.js +1 -1
- package/dist/translations/ms.js +1 -1
- package/dist/translations/ms.umd.js +1 -1
- package/dist/translations/nb.js +1 -1
- package/dist/translations/nb.umd.js +1 -1
- package/dist/translations/ne.js +1 -1
- package/dist/translations/ne.umd.js +1 -1
- package/dist/translations/nl.js +1 -1
- package/dist/translations/nl.umd.js +1 -1
- package/dist/translations/no.js +1 -1
- package/dist/translations/no.umd.js +1 -1
- package/dist/translations/oc.js +1 -1
- package/dist/translations/oc.umd.js +1 -1
- package/dist/translations/pl.js +1 -1
- package/dist/translations/pl.umd.js +1 -1
- package/dist/translations/pt-br.js +1 -1
- package/dist/translations/pt-br.umd.js +1 -1
- package/dist/translations/pt.js +1 -1
- package/dist/translations/pt.umd.js +1 -1
- package/dist/translations/ro.js +1 -1
- package/dist/translations/ro.umd.js +1 -1
- package/dist/translations/ru.js +1 -1
- package/dist/translations/ru.umd.js +1 -1
- package/dist/translations/si.js +1 -1
- package/dist/translations/si.umd.js +1 -1
- package/dist/translations/sk.js +1 -1
- package/dist/translations/sk.umd.js +1 -1
- package/dist/translations/sl.js +1 -1
- package/dist/translations/sl.umd.js +1 -1
- package/dist/translations/sq.js +1 -1
- package/dist/translations/sq.umd.js +1 -1
- package/dist/translations/sr-latn.js +1 -1
- package/dist/translations/sr-latn.umd.js +1 -1
- package/dist/translations/sr.js +1 -1
- package/dist/translations/sr.umd.js +1 -1
- package/dist/translations/sv.js +1 -1
- package/dist/translations/sv.umd.js +1 -1
- package/dist/translations/th.js +1 -1
- package/dist/translations/th.umd.js +1 -1
- package/dist/translations/ti.js +1 -1
- package/dist/translations/ti.umd.js +1 -1
- package/dist/translations/tk.js +1 -1
- package/dist/translations/tk.umd.js +1 -1
- package/dist/translations/tr.js +1 -1
- package/dist/translations/tr.umd.js +1 -1
- package/dist/translations/tt.js +1 -1
- package/dist/translations/tt.umd.js +1 -1
- package/dist/translations/ug.js +1 -1
- package/dist/translations/ug.umd.js +1 -1
- package/dist/translations/uk.js +1 -1
- package/dist/translations/uk.umd.js +1 -1
- package/dist/translations/ur.js +1 -1
- package/dist/translations/ur.umd.js +1 -1
- package/dist/translations/uz.js +1 -1
- package/dist/translations/uz.umd.js +1 -1
- package/dist/translations/vi.js +1 -1
- package/dist/translations/vi.umd.js +1 -1
- package/dist/translations/zh-cn.js +1 -1
- package/dist/translations/zh-cn.umd.js +1 -1
- package/dist/translations/zh.js +1 -1
- package/dist/translations/zh.umd.js +1 -1
- package/package.json +12 -12
package/dist/index.js
CHANGED
|
@@ -20,9 +20,9 @@
|
|
|
20
20
|
*
|
|
21
21
|
*
|
|
22
22
|
*/
|
|
23
|
-
import{Plugin as _0x17e8c8,Command as _0x229e40,ContextPlugin as _0x1c4723,Editor as _0x597112}from'@ckeditor/ckeditor5-core/dist/index.js';import{IconCopy as _0x25f1fc,IconCheck as _0x474e29,IconError as _0x4a9d6a,IconSubmit as _0x403531,IconAIHistory as _0x2de1d5,IconMagicWand as _0x171c1f,IconRobotPencil as _0x5b0fb3,IconMaximize as _0x276d69,IconMinimize as _0x570af1,IconShowChangesOn as _0x468096,IconShowChangesOff as _0x212f7c,IconDocument as _0x31ce36,IconBoxWithCross as _0xd0bad4,IconBoxWithCheck as _0x15a8f9,IconBoxWithMarker as _0x16a0fb,IconInfo as _0x5c9dab,IconWeb as _0x31f360,IconCancel as _0x30d60c,IconSelection as _0x3e3461,IconFileUpload as _0x61dfd7,IconLink as _0x63b1ba,IconBulb as _0x3a90af,IconAI as _0xfb4232,IconPreviousArrow as _0x243bd3,IconDocumentOutline as _0x64142,IconLoupe as _0x113f89,IconPaperClip as _0x46418a,IconBrowseFiles as _0x106b02,IconDropdownArrow as _0x13161c,IconStop as _0x3e5a33,IconPlus as _0x12a1f4,IconAIChat as _0xf4a3ae,IconPin as _0x2a4d0e,IconThreeHorizontalDots as _0x3ab32d,IconAIReview as _0x48c8b8,IconAITranslate as _0xe821c5,IconAIAskAI as _0x4cdcb9,IconThumbUp as _0xd8bed7,IconThumbDown as _0xc7e22,IconChevronDown as _0x2e1999,IconChevronUp as _0xa07a66,IconAIQuickActions as _0x47c1b9,IconAIChatCommands as _0x5ab5a8,IconAIImproveWriting as _0xff2ef9,IconAIContinueWriting as _0x20ab6e,IconAIGrammarCheck as _0x5e42a9,IconAIAdjustLength as _0x37fb85,IconAIChangeTone as _0xe015ab,IconAIOther as _0x4195c4,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 _0xb3bfff,FormHeaderView as _0x4a54a5,HighlightedTextView as _0x2ff97f,ViewCollection as _0x473e27,FileDialogButtonView as _0x2da8f5,InputTextView as _0x50d28e,SearchTextView as _0x48eb62,ListItemButtonView as _0xf87456,ButtonLabelWithHighlightView as _0x3575d8,DropdownMenuPanelPositioningFunctions as _0x59c279,BalloonToolbar as _0x350068,FormRowView as _0x9f9ba4,TextareaView as _0x2327a7}from'@ckeditor/ckeditor5-ui/dist/index.js';import{ClipboardPipeline as _0x242bfd,ClipboardMarkersUtils as _0x3c6d31}from'@ckeditor/ckeditor5-clipboard/dist/index.js';import{ViewDocumentDomEventData as _0x5f4541,ViewDataTransfer as _0x1b905a,ViewUpcastWriter as _0x238b2a,Matcher as _0x3e2cc6,_DetachOperation as _0x5b32ba,_insertIntoModelNodeList as _0xbf4c53,_removeFromModelNodeList as _0x24d713,ModelRange as _0x49ae78,transformOperationSets as _0x5f4e4f,ViewDowncastWriter as _0x3530dd,ModelDocumentFragment as _0x3a3cd6,ModelPosition as _0x11c903,ModelTreeWalker as _0x441fd4,MarkerOperation as _0x2197a6,InsertOperation as _0x286740}from'@ckeditor/ckeditor5-engine/dist/index.js';import{unescape as _0x31486b,escape as _0x56a9e5,cloneDeep as _0x18249f,throttle as _0x409273,debounce as _0x382bff,escapeRegExp as _0x3a047e}from'es-toolkit/compat';import{createParser as _0x55d513}from'eventsource-parser';import{CloudServices as _0x3ed556}from'@ckeditor/ckeditor5-cloud-services/dist/index.js';import{parseDocument as _0x3f6dfb}from'htmlparser2';import{isTag as _0x30b8f4,findOne as _0x2da362,getParent as _0x32dbd8,findAll as _0x5bd49b,removeElement as _0x565d3d,prepend as _0x5014cb,prependChild as _0x26fbb4,appendChild as _0x2cee60,append as _0x2cc319,find as _0x7f7f1b,isComment as _0x238c43,replaceElement as _0x3ac4a2,getChildren as _0x348abb,textContent as _0x3a29a5}from'domutils';import ti from'dom-serializer';import{Document as _0x4bac9c,Element as _0x47c6a6,Text as _0x41b5f7,cloneNode as _0xbcafee,isDocument as _0x487e21,isText as _0x2e5069,NodeWithChildren as _0x20b9a9}from'domhandler';import{MarkdownGfmMdToHtmlDefaultPlugins as _0x47584d,MarkdownGfmMdToHtml as _0x5af806}from'@ckeditor/ckeditor5-markdown-gfm/dist/index.js';import _0x2e96fc from'rehype-sanitize';import{fixElementSuggestionRange as _0x56faff,DocumentCompare as _0x510df7,DATA_ID_MODEL_ATTRIBUTE as _0x503c11,ConfirmMixin as _0x29274d,getAllMarkersDomElementsSorted as _0x37b592,SuggestionsConversion as _0x21c71d,DATA_ID_VIEW_ATTRIBUTE as _0x54d4f0,getMarkerDomElement as _0x2a88d9}from'@ckeditor/ckeditor5-collaboration-core/dist/index.js';import _0x4e0b1b from'morphdom';import{diffArrays as _0x1cf529}from'diff';const Ci='_ungrouppedCommands';function wi(_0x59fd47,_0x1bf6d6){const _0x50ed1b=(0x0,_0x1bf6d6['t'])('Other');return _0x59fd47['length']?'groupId'in _0x59fd47[0x0]?_0x59fd47:[{'groupId':Ci,'groupLabel':_0x50ed1b,'order':0x1/0x0,'commands':_0x59fd47}]:[{'groupId':Ci,'groupLabel':_0x50ed1b,'order':0x1/0x0,'commands':[]}];}const fi=globalThis['DataTransfer'],bi='ai-ui';class Si extends _0x17e8c8{static get['pluginName'](){return'AIAssistantEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const {editor:_0x16868c}=this,_0x38580c=['ck-fake-ai-selection'];_0x16868c['config']['get']('ai.assistant.useTheme')&&_0x38580c['push']('ck-ai-assistant-ui_theme'),_0x16868c['conversion']['for']('editingDowncast')['markerToHighlight']({'model':bi,'view':{'classes':_0x38580c,'priority':0xc}}),_0x16868c['conversion']['for']('editingDowncast')['markerToElement']({'model':bi,'view':(_0x4b4396,{writer:_0x300a77})=>{if(!_0x4b4396['markerRange']['isCollapsed'])return null;const _0x1a2ac4=_0x300a77['createUIElement']('span');return _0x300a77['addClass'](['ck-fake-ai-selection','ck-fake-ai-selection_collapsed'],_0x1a2ac4),_0x1a2ac4;}});}['afterInit'](){!async function(_0x165dd1){const _0x2acd9d=_0x229b8f([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]),_0x82e293=0x3dffc4e1,_0x2c265f=0x3df84d39^_0x82e293,_0x1e0aae=window[_0x229b8f([0x44,0x61,0x74,0x65])][_0x229b8f([0x6e,0x6f,0x77])](),_0x3201fb=_0x165dd1[_0x229b8f([0x65,0x64,0x69,0x74,0x6f,0x72])],_0x2b5874=new window[(_0x229b8f([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x2883dd=>{_0x3201fb[_0x229b8f([0x6f,0x6e,0x63,0x65])](_0x229b8f([0x72,0x65,0x61,0x64,0x79]),_0x2883dd);}),_0xfbffab={[_0x229b8f([0x6b,0x74,0x79])]:_0x229b8f([0x45,0x43]),[_0x229b8f([0x75,0x73,0x65])]:_0x229b8f([0x73,0x69,0x67]),[_0x229b8f([0x63,0x72,0x76])]:_0x229b8f([0x50,0x2d,0x32,0x35,0x36]),[_0x229b8f([0x78])]:_0x229b8f([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]),[_0x229b8f([0x79])]:_0x229b8f([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]),[_0x229b8f([0x61,0x6c,0x67])]:_0x229b8f([0x45,0x53,0x32,0x35,0x36])},_0x32d29f=_0x3201fb[_0x229b8f([0x63,0x6f,0x6e,0x66,0x69,0x67])][_0x229b8f([0x67,0x65,0x74])](_0x229b8f([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79]));async function _0x5e433b(){let _0x64612c,_0x3603c9=null,_0x1b2ded=null;try{if(_0x32d29f==_0x229b8f([0x47,0x50,0x4c]))return _0x229b8f([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]);if(_0x64612c=_0x2c3eba(),!_0x64612c)return _0x229b8f([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);return _0x64612c[_0x229b8f([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])]&&(_0x1b2ded=_0x34324f(_0x64612c[_0x229b8f([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])],_0x64612c[_0x229b8f([0x6a,0x74,0x69])])),await _0x509454()?_0x17ade9()?_0x31a12a()?_0x229b8f([0x45,0x78,0x70,0x69,0x72,0x65,0x64]):_0x38de49()?(_0x64612c[_0x229b8f([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])]==_0x229b8f([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e])&&(_0x3603c9=_0xbe5b0e(_0x229b8f([0x45,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e,0x4c,0x69,0x6d,0x69,0x74]))),await _0x32da69()):_0x229b8f([0x44,0x6f,0x6d,0x61,0x69,0x6e,0x4c,0x69,0x6d,0x69,0x74]):_0x229b8f([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]):_0x229b8f([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}catch{return _0x229b8f([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}function _0x31a12a(){const _0x55414c=[_0x229b8f([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e]),_0x229b8f([0x74,0x72,0x69,0x61,0x6c])][_0x229b8f([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x64612c[_0x229b8f([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])])?_0x1e0aae/0x3e8:0xe10*_0x2c265f;return _0x64612c[_0x229b8f([0x65,0x78,0x70])]<_0x55414c;}function _0x17ade9(){const _0x278dbd=_0x64612c[_0x229b8f([0x66,0x65,0x61,0x74,0x75,0x72,0x65,0x73])];return!!_0x278dbd&&(!!_0x278dbd[_0x229b8f([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x229b8f([0x2a]))||!!_0x278dbd[_0x229b8f([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x229b8f([0x41,0x49])));}function _0x38de49(){const _0x5b5b18=_0x64612c[_0x229b8f([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x64,0x48,0x6f,0x73,0x74,0x73])];if(!_0x5b5b18||0x0==_0x5b5b18[_0x229b8f([0x6c,0x65,0x6e,0x67,0x74,0x68])])return!0x0;const {hostname:_0x38aedd}=new URL(window[_0x229b8f([0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e])]['href']);if(_0x5b5b18[_0x229b8f([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x38aedd))return!0x0;const _0x144edf=_0x38aedd[_0x229b8f([0x73,0x70,0x6c,0x69,0x74])](_0x229b8f([0x2e]));return _0x5b5b18[_0x229b8f([0x66,0x69,0x6c,0x74,0x65,0x72])](_0x3349d0=>_0x3349d0[_0x229b8f([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x229b8f([0x2a])))[_0x229b8f([0x6d,0x61,0x70])](_0x3ced73=>_0x3ced73[_0x229b8f([0x73,0x70,0x6c,0x69,0x74])](_0x229b8f([0x2e])))[_0x229b8f([0x66,0x69,0x6c,0x74,0x65,0x72])](_0x3e3b24=>_0x3e3b24[_0x229b8f([0x6c,0x65,0x6e,0x67,0x74,0x68])]<=_0x144edf[_0x229b8f([0x6c,0x65,0x6e,0x67,0x74,0x68])])[_0x229b8f([0x6d,0x61,0x70])](_0x46f625=>Array(_0x144edf[_0x229b8f([0x6c,0x65,0x6e,0x67,0x74,0x68])]-_0x46f625[_0x229b8f([0x6c,0x65,0x6e,0x67,0x74,0x68])])[_0x229b8f([0x66,0x69,0x6c,0x6c])](_0x46f625[0x0]===_0x229b8f([0x2a])?_0x229b8f([0x2a]):'')[_0x229b8f([0x63,0x6f,0x6e,0x63,0x61,0x74])](_0x46f625))[_0x229b8f([0x73,0x6f,0x6d,0x65])](_0x3c6ce6=>_0x144edf[_0x229b8f([0x65,0x76,0x65,0x72,0x79])]((_0x594ea1,_0x544883)=>_0x3c6ce6[_0x544883]===_0x594ea1||_0x3c6ce6[_0x544883]===_0x229b8f([0x2a])));}function _0x32da69(){return _0x3603c9&&_0x1b2ded?new window[(_0x229b8f([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0xf9a5e,_0x2b55cc)=>{_0x3603c9[_0x229b8f([0x74,0x68,0x65,0x6e])](_0xf9a5e,_0x2b55cc),_0x1b2ded[_0x229b8f([0x74,0x68,0x65,0x6e])](_0x683131=>{_0x683131!=_0x229b8f([0x56,0x61,0x6c,0x69,0x64])&&_0xf9a5e(_0x683131);},_0x2b55cc);}):_0x3603c9||_0x1b2ded||_0x229b8f([0x56,0x61,0x6c,0x69,0x64]);}}function _0x34324f(_0x2b051a,_0x2e2446){return new window[(_0x229b8f([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x3bcd84=>{if(_0x1962c4())return _0x3bcd84(_0x229b8f([0x56,0x61,0x6c,0x69,0x64]));_0x27b577(),_0x3201fb[_0x229b8f([0x64,0x65,0x63,0x6f,0x72,0x61,0x74,0x65])](_0x229b8f([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]));let _0x34b3bd=!0x1;const _0x564465=ot();function _0x2ed20b(_0x372210){return!!_0x372210&&(typeof _0x372210===_0x229b8f([0x6f,0x62,0x6a,0x65,0x63,0x74])||typeof _0x372210===_0x229b8f([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]))&&typeof _0x372210[_0x229b8f([0x74,0x68,0x65,0x6e])]===_0x229b8f([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e])&&typeof _0x372210[_0x229b8f([0x63,0x61,0x74,0x63,0x68])]===_0x229b8f([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]);}function _0x1d4c0f(_0x47d539){_0x4dff77(_0x47d539)[_0x229b8f([0x74,0x68,0x65,0x6e])](_0x2d8b78=>{if(!_0x2d8b78||_0x2d8b78[_0x229b8f([0x73,0x74,0x61,0x74,0x75,0x73])]!=_0x229b8f([0x6f,0x6b]))return _0x229b8f([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]);return _0x5094cf(_0xd1bf3c(_0x564465+_0x2e2446))!=_0x2d8b78[_0x229b8f([0x76,0x65,0x72,0x69,0x66,0x69,0x63,0x61,0x74,0x69,0x6f,0x6e])]?_0x229b8f([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]):_0x229b8f([0x56,0x61,0x6c,0x69,0x64]);})[_0x229b8f([0x74,0x68,0x65,0x6e])](_0x129cad=>(_0x5f020e(),_0x129cad),()=>{const _0x363c68=_0x4f8cd0();return null==_0x363c68?(_0x5f020e(),_0x229b8f([0x56,0x61,0x6c,0x69,0x64])):_0x229b8f(_0x1e0aae-_0x363c68>(0x19f340e1^_0x82e293)?[0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]:[0x56,0x61,0x6c,0x69,0x64]);})[_0x229b8f([0x74,0x68,0x65,0x6e])](_0x3bcd84)[_0x229b8f([0x63,0x61,0x74,0x63,0x68])](()=>{_0x3bcd84(_0x229b8f([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});const _0x521a6d=0x3dc92a61^_0x82e293;function _0x5f020e(){const _0x56b27f=_0x229b8f([0x6c,0x6c,0x63,0x74,0x2d])+_0x5094cf(_0xd1bf3c(_0x2b051a)),_0x2bae7d=_0x241d58(_0x5094cf(window[_0x229b8f([0x4d,0x61,0x74,0x68])][_0x229b8f([0x63,0x65,0x69,0x6c])](_0x1e0aae/_0x521a6d)));window[_0x229b8f([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0x229b8f([0x73,0x65,0x74,0x49,0x74,0x65,0x6d])](_0x56b27f,_0x2bae7d);}function _0x4f8cd0(){const _0x32a98f=_0x229b8f([0x6c,0x6c,0x63,0x74,0x2d])+_0x5094cf(_0xd1bf3c(_0x2b051a)),_0x4ec44d=window[_0x229b8f([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0x229b8f([0x67,0x65,0x74,0x49,0x74,0x65,0x6d])](_0x32a98f);return _0x4ec44d?window[_0x229b8f([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x241d58(_0x4ec44d),0x10)*_0x521a6d:null;}function _0x4dff77(_0x1973a3){return new window[(_0x229b8f([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0x36e2aa,_0x1c3b98)=>{_0x1973a3[_0x229b8f([0x74,0x68,0x65,0x6e])](_0x36e2aa,_0x1c3b98),window[_0x229b8f([0x73,0x65,0x74,0x54,0x69,0x6d,0x65,0x6f,0x75,0x74])](_0x1c3b98,0x3dfe1021^_0x82e293);});}}_0x3201fb[_0x229b8f([0x6f,0x6e])](_0x229b8f([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),(_0x2ff234,_0x199f42)=>{if(_0x199f42[0x0]!=_0x2b051a)return _0x3bcd84(_0x229b8f([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));_0x199f42[0x1]={..._0x199f42[0x1],[_0x229b8f([0x72,0x65,0x71,0x75,0x65,0x73,0x74,0x49,0x64])]:_0x564465};},{[_0x229b8f([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0x229b8f([0x68,0x69,0x67,0x68])}),_0x3201fb[_0x229b8f([0x6f,0x6e])](_0x229b8f([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),_0x340945=>{_0x2ed20b(_0x340945[_0x229b8f([0x72,0x65,0x74,0x75,0x72,0x6e])])&&(_0x34b3bd=!0x0,_0x1d4c0f(_0x340945[_0x229b8f([0x72,0x65,0x74,0x75,0x72,0x6e])]));},{[_0x229b8f([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0x229b8f([0x6c,0x6f,0x77])}),_0x2b5874[_0x229b8f([0x74,0x68,0x65,0x6e])](()=>{_0x34b3bd||_0x3bcd84(_0x229b8f([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});});function _0x1962c4(){return _0x3201fb[_0x229b8f([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0x229b8f([0x76,0x69,0x65,0x77])][_0x229b8f([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]==_0x229b8f([0x61,0x75,0x74,0x6f]);}function _0x27b577(){_0x3201fb[_0x229b8f([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0x229b8f([0x76,0x69,0x65,0x77])][_0x229b8f([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]=_0x229b8f([0x61,0x75,0x74,0x6f]);}}function _0xbe5b0e(_0x5e6c29){const _0x2bbf2f=[new window[(_0x229b8f([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x5b29c3=>setTimeout(_0x5b29c3,0x3df6fa2d^_0x82e293)),_0x2b5874[_0x229b8f([0x74,0x68,0x65,0x6e])](()=>new window[(_0x229b8f([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x510808=>{let _0x459c46=0x0;_0x3201fb[_0x229b8f([0x6d,0x6f,0x64,0x65,0x6c])][_0x229b8f([0x6f,0x6e])](_0x229b8f([0x61,0x70,0x70,0x6c,0x79,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e]),(_0x45f60e,_0x448456)=>{_0x448456[0x0][_0x229b8f([0x69,0x73,0x44,0x6f,0x63,0x75,0x6d,0x65,0x6e,0x74,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e])]&&_0x459c46++,_0x459c46==(0x3dffc109^_0x82e293)&&(_0x510808(),_0x45f60e[_0x229b8f([0x6f,0x66,0x66])]());});}))];return window[_0x229b8f([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65])][_0x229b8f([0x72,0x61,0x63,0x65])](_0x2bbf2f)[_0x229b8f([0x74,0x68,0x65,0x6e])](()=>_0x5e6c29);}async function _0x4975bb(){await _0x2b5874,_0x3201fb[_0x229b8f([0x6d,0x6f,0x64,0x65,0x6c])][_0x229b8f([0x63,0x68,0x61,0x6e,0x67,0x65])]=_0x211b69,_0x3201fb[_0x229b8f([0x6d,0x6f,0x64,0x65,0x6c])][_0x229b8f([0x65,0x6e,0x71,0x75,0x65,0x75,0x65,0x43,0x68,0x61,0x6e,0x67,0x65])]=_0x211b69,_0x3201fb[_0x229b8f([0x65,0x6e,0x61,0x62,0x6c,0x65,0x52,0x65,0x61,0x64,0x4f,0x6e,0x6c,0x79,0x4d,0x6f,0x64,0x65])](_0x229b8f([0x6d,0x6f,0x64,0x65,0x6c]));}function _0x34dd87(_0x36c3c4){const _0xf7944b=_0x330c0b();_0x3201fb[_0xf7944b]=_0x229b8f([0x61,0x69,0x4c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79])+_0x36c3c4,_0x36c3c4!=_0x229b8f([0x56,0x61,0x6c,0x69,0x64])&&_0x4975bb();}function _0x330c0b(){const _0x2cce81=window[_0x229b8f([0x53,0x74,0x72,0x69,0x6e,0x67])](window[_0x229b8f([0x70,0x65,0x72,0x66,0x6f,0x72,0x6d,0x61,0x6e,0x63,0x65])][_0x229b8f([0x6e,0x6f,0x77])]())[_0x229b8f([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](_0x229b8f([0x2e]),'');let _0xae7cdb=_0x229b8f([0x6e]);for(let _0x4fa8d5=0x0;_0x4fa8d5<_0x2cce81[_0x229b8f([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0x4fa8d5+=0x2){let _0xf0b47e=window[_0x229b8f([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x2cce81[_0x229b8f([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0x4fa8d5,_0x4fa8d5+0x2));_0xf0b47e>=_0x2acd9d[_0x229b8f([0x6c,0x65,0x6e,0x67,0x74,0x68])]&&(_0xf0b47e-=_0x2acd9d[_0x229b8f([0x6c,0x65,0x6e,0x67,0x74,0x68])]),_0xae7cdb+=_0x2acd9d[_0xf0b47e];}return _0xae7cdb;}function _0x2c3eba(){const _0x2f5473=_0x32d29f[_0x229b8f([0x73,0x70,0x6c,0x69,0x74])](_0x229b8f([0x2e]));if(0x3!=_0x2f5473[_0x229b8f([0x6c,0x65,0x6e,0x67,0x74,0x68])])return null;return _0x52c2f7(_0x2f5473[0x1]);function _0x52c2f7(_0x425733){const _0x35c0a7=_0x48dbf0(_0x425733);return _0x35c0a7&&_0x34f7d0()?_0x35c0a7:null;function _0x34f7d0(){const _0x36436a=_0x35c0a7[_0x229b8f([0x6a,0x74,0x69])],_0x10b5a4=window[_0x229b8f([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x36436a[_0x229b8f([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0x36436a[_0x229b8f([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8),0x10),_0x429cab={..._0x35c0a7,[_0x229b8f([0x6a,0x74,0x69])]:_0x36436a[_0x229b8f([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](0x0,_0x36436a[_0x229b8f([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8)};return delete _0x429cab[_0x229b8f([0x76,0x63])],_0xd1bf3c(_0x429cab)==_0x10b5a4;}}}async function _0x509454(){let _0x465996=!0x0;try{const _0x4069a3=_0x32d29f[_0x229b8f([0x73,0x70,0x6c,0x69,0x74])](_0x229b8f([0x2e])),[_0x117fb4,_0x47cf23,_0x3af62a]=_0x4069a3;return _0x28e962(_0x117fb4),await _0x56d3da(_0x117fb4,_0x47cf23,_0x3af62a),_0x465996;}catch{return!0x1;}function _0x28e962(_0x155731){const _0x572bc1=_0x48dbf0(_0x155731);_0x572bc1&&_0x572bc1[_0x229b8f([0x61,0x6c,0x67])]==_0x229b8f([0x45,0x53,0x32,0x35,0x36])||(_0x465996=!0x1);}async function _0x56d3da(_0x1ba839,_0x3c9b84,_0x2c9f38){const _0x15ed4c=window[_0x229b8f([0x55,0x69,0x6e,0x74,0x38,0x41,0x72,0x72,0x61,0x79])][_0x229b8f([0x66,0x72,0x6f,0x6d])](_0x21ee0c(_0x2c9f38),_0x2097ba=>_0x2097ba[_0x229b8f([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](0x0)),_0x439349=new window[(_0x229b8f([0x54,0x65,0x78,0x74,0x45,0x6e,0x63,0x6f,0x64,0x65,0x72]))]()[_0x229b8f([0x65,0x6e,0x63,0x6f,0x64,0x65])](_0x1ba839+_0x229b8f([0x2e])+_0x3c9b84),_0x3ad01b=window[_0x229b8f([0x63,0x72,0x79,0x70,0x74,0x6f])][_0x229b8f([0x73,0x75,0x62,0x74,0x6c,0x65])];if(!_0x3ad01b)return;const _0x5cb1b6=await _0x3ad01b[_0x229b8f([0x69,0x6d,0x70,0x6f,0x72,0x74,0x4b,0x65,0x79])](_0x229b8f([0x6a,0x77,0x6b]),_0xfbffab,{[_0x229b8f([0x6e,0x61,0x6d,0x65])]:_0x229b8f([0x45,0x43,0x44,0x53,0x41]),[_0x229b8f([0x6e,0x61,0x6d,0x65,0x64,0x43,0x75,0x72,0x76,0x65])]:_0x229b8f([0x50,0x2d,0x32,0x35,0x36])},!0x1,[_0x229b8f([0x76,0x65,0x72,0x69,0x66,0x79])]);await _0x3ad01b[_0x229b8f([0x76,0x65,0x72,0x69,0x66,0x79])]({[_0x229b8f([0x6e,0x61,0x6d,0x65])]:_0x229b8f([0x45,0x43,0x44,0x53,0x41]),[_0x229b8f([0x68,0x61,0x73,0x68])]:{[_0x229b8f([0x6e,0x61,0x6d,0x65])]:_0x229b8f([0x53,0x48,0x41,0x2d,0x32,0x35,0x36])}},_0x5cb1b6,_0x15ed4c,_0x439349)||(_0x465996=!0x1);}}function _0x48dbf0(_0x369cb0){return _0x369cb0[_0x229b8f([0x73,0x74,0x61,0x72,0x74,0x73,0x57,0x69,0x74,0x68])](_0x229b8f([0x65,0x79]))?JSON[_0x229b8f([0x70,0x61,0x72,0x73,0x65])](_0x21ee0c(_0x369cb0)):null;}function _0x21ee0c(_0x220e69){return window[_0x229b8f([0x61,0x74,0x6f,0x62])](_0x220e69[_0x229b8f([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/-/g,_0x229b8f([0x2b]))[_0x229b8f([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/_/g,_0x229b8f([0x2f])));}function _0xd1bf3c(_0x259ea9){let _0x522150=0x1505;function _0x459c9b(_0x2acdcc){for(let _0x4e2720=0x0;_0x4e2720<_0x2acdcc[_0x229b8f([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0x4e2720++){const _0x29126a=_0x2acdcc[_0x229b8f([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](_0x4e2720);_0x522150=(_0x522150<<0x5)+_0x522150+_0x29126a,_0x522150&=_0x522150;}}function _0xdd827d(_0x14c166){Array[_0x229b8f([0x69,0x73,0x41,0x72,0x72,0x61,0x79])](_0x14c166)?_0x14c166[_0x229b8f([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](_0xdd827d):_0x14c166&&typeof _0x14c166==_0x229b8f([0x6f,0x62,0x6a,0x65,0x63,0x74])?Object[_0x229b8f([0x65,0x6e,0x74,0x72,0x69,0x65,0x73])](_0x14c166)[_0x229b8f([0x73,0x6f,0x72,0x74])]()[_0x229b8f([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](([_0x3fa4d7,_0x457641])=>{_0x459c9b(_0x3fa4d7),_0xdd827d(_0x457641);}):_0x459c9b(window[_0x229b8f([0x53,0x74,0x72,0x69,0x6e,0x67])](_0x14c166));}return _0xdd827d(_0x259ea9),_0x522150>>>0x0;}function _0x5094cf(_0x1c0b2f){return _0x1c0b2f[_0x229b8f([0x74,0x6f,0x53,0x74,0x72,0x69,0x6e,0x67])](0x10)[_0x229b8f([0x70,0x61,0x64,0x53,0x74,0x61,0x72,0x74])](0x8,_0x229b8f([0x30]));}function _0x241d58(_0x336199){return _0x336199[_0x229b8f([0x73,0x70,0x6c,0x69,0x74])]('')[_0x229b8f([0x72,0x65,0x76,0x65,0x72,0x73,0x65])]()[_0x229b8f([0x6a,0x6f,0x69,0x6e])]('');}function _0x211b69(){}function _0x229b8f(_0x130b8b){return _0x130b8b['map'](_0x29dc18=>String['fromCharCode'](_0x29dc18))['join']('');}_0x34dd87(await _0x5e433b());}(this);}['showFakeVisualSelection'](){const _0x1dc0a2=this['editor']['model'];_0x1dc0a2['change'](_0xed982=>{const _0x27dfdc=_0x1dc0a2['document']['selection']['getRanges']();let _0x5c3c48=0x0;for(const _0x5be2ff of _0x27dfdc){const _0x376131=bi+':'+_0x5c3c48;if(_0x1dc0a2['markers']['has'](_0x376131))_0xed982['updateMarker'](_0x376131,{'range':_0x5be2ff});else{if(_0x5be2ff['start']['isAtEnd']){const _0x870b20=_0x5be2ff['start']['getLastMatchingPosition'](({item:_0x22ca74})=>!_0x1dc0a2['schema']['isContent'](_0x22ca74),{'boundaries':_0x5be2ff});_0xed982['addMarker'](_0x376131,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0xed982['createRange'](_0x870b20,_0x5be2ff['end'])});}else _0xed982['addMarker'](_0x376131,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x5be2ff});}_0x5c3c48++;}});}['hideFakeVisualSelection'](){const _0x47fc68=this['editor']['model'],_0x2f110c=Array['from'](this['editor']['model']['markers']['getMarkersGroup'](bi));_0x2f110c['length']&&_0x47fc68['change'](_0x33e1a1=>{_0x2f110c['forEach'](_0x528ef2=>{_0x33e1a1['removeMarker'](_0x528ef2);});});}['insertContent'](_0x629dd7,_0x567414){const _0x57d0ec=this['_getAISelection'](),_0x397791=_0x567414||_0x57d0ec['getFirstRange']();this['editor']['model']['canEditAt'](_0x397791)&&this['editor']['model']['change'](_0x5df733=>{this['hideFakeVisualSelection'](),_0x567414||this['_resetContentOfSelectedTableCells'](_0x5df733,_0x57d0ec),this['_pasteHTMLUsingClipboard']({'insertAt':_0x397791,'writer':_0x5df733,'html':_0x629dd7});});}['insertContentBelow'](_0x4b7ae8){const {model:_0x39ac0a}=this['editor'],_0x133950=this['_getAISelection']();_0x39ac0a['change'](()=>{const _0x2177aa=this['_prepareTableInsertBelowPosition'](_0x4b7ae8,_0x133950)||this['_getDefaultInsertBelowPosition'](_0x133950);this['insertContent'](_0x4b7ae8,_0x2177aa);});}['_getAISelection'](){const _0x76874=this['editor']['model'],_0xe1fcda=Array['from'](_0x76874['markers']['getMarkersGroup'](bi))['map'](_0x2feee4=>_0x2feee4['getRange']());return _0x76874['createSelection'](_0xe1fcda);}['_pasteHTMLUsingClipboard']({writer:_0x218bc0,html:_0xe9e9bd,insertAt:_0x49e7b2}){const {view:_0x35cc46}=this['editor']['editing'],_0x28fb75=this['editor']['plugins']['get'](_0x242bfd),_0x51a8f7=new fi();_0x51a8f7['setData']('text/html',_0xe9e9bd);const _0xb22040=new ClipboardEvent('paste',{'clipboardData':_0x51a8f7}),_0x3d9578=new _0x5f4541(_0x35cc46,_0xb22040,{'dataTransfer':new _0x1b905a(_0x51a8f7)});_0x218bc0['setSelection'](_0x49e7b2);const _0x45a4f8=(_0x5319ae,_0x9796c8)=>{_0x9796c8['resultRange']&&_0x218bc0['setSelection'](_0x9796c8['resultRange']);};_0x28fb75['once']('contentInsertion',_0x45a4f8,{'priority':'lowest'}),_0x35cc46['document']['fire']('paste',_0x3d9578),_0x28fb75['off']('contentInsertion',_0x45a4f8);}['_getDefaultInsertBelowPosition'](_0x3b7257){const {model:_0x2325a4}=this['editor'],_0x5cf640=Array['from'](_0x3b7257['getSelectedBlocks']());return _0x5cf640['length']?_0x2325a4['createPositionAfter'](_0x5cf640['pop']()):_0x3b7257['getLastPosition']();}['_prepareTableInsertBelowPosition'](_0x35681a,_0x4848fe){const {model:_0x15f091,plugins:_0x307c59}=this['editor'];if(_0x307c59['has']('TableUtils')){const _0x2e952d=_0x307c59['get']('TableUtils')['getSelectedTableCells'](_0x4848fe);if(_0x2e952d['length']){const _0x9e467f=this['_getTableRowCountFromContent'](_0x35681a),_0x1087a3=this['_createEmptyTableRows'](_0x2e952d,_0x9e467f);return _0x15f091['createPositionAt'](_0x1087a3,0x0);}}return null;}['_getTableRowCountFromContent'](_0x507bbb){const _0x11dc3e=this['editor']['plugins']['get']('TableUtils'),_0x25bf7b=this['editor']['data']['parse'](_0x507bbb),_0x1bd1aa=Array['from'](_0x25bf7b['getChildren']())['filter'](_0x5d0418=>_0x5d0418['is']('element','table'));let _0x555bff=0x0;return _0x1bd1aa['forEach'](_0x57d096=>{_0x555bff+=_0x11dc3e['getRows'](_0x57d096);}),_0x555bff;}['_createEmptyTableRows'](_0x3d47a4,_0x3c40d8){const _0x4d450a=this['editor']['plugins']['get']('TableUtils'),_0x58ee22=_0x4d450a['getRowIndexes'](_0x3d47a4),_0xce1764=_0x4d450a['getColumnIndexes'](_0x3d47a4),_0x41dfc6=_0x58ee22['last']+0x1,_0x39d9af=_0xce1764['first'],_0xfae3a=_0x3d47a4[0x0]['findAncestor']('table');for(let _0x4e47f3=0x0;_0x4e47f3<_0x3c40d8;_0x4e47f3++)_0x4d450a['insertRows'](_0xfae3a,{'at':_0x41dfc6});return _0xfae3a['getChild'](_0x41dfc6)['getChild'](_0x39d9af);}['_resetContentOfSelectedTableCells'](_0x1fc792,_0x57ae79){const {plugins:_0x3b0522}=this['editor'],{model:_0x361637}=_0x1fc792;if(!_0x3b0522['has']('TableUtils'))return;_0x3b0522['get']('TableUtils')['getSelectedTableCells'](_0x57ae79)['length']&&_0x361637['deleteContent'](_0x57ae79);}}class Ri extends _0x17e8c8{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(_0x3fb16d){super(_0x3fb16d),this['name']='AIRequestError';}}function ki(_0x34f5e6,_0x3214f1,_0x5437db){const t=_0x34f5e6['t'];switch(_0x3214f1){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',_0x5437db);case'Error\x20during\x20AI\x20content\x20generation:\x20%0':return t('Error\x20during\x20AI\x20content\x20generation:\x20%0',_0x5437db);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'},_0x5437db);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 _0x3214f1;}}class Ni extends _0x229e40{['_commandDefinitions'];constructor(_0x260513,_0x16b7e6){super(_0x260513),this['_commandDefinitions']=_0x16b7e6,this['set']('enabledCommandsIds',[]),this['on']('change:_hasContext',(_0x31d0e7,_0xfd07d7,_0x5eecd2)=>{this['isEnabled']&&(this['enabledCommandsIds']=vi(this['_commandDefinitions'],_0x5eecd2));}),this['set']('_hasContext',!0x1),this['on']('change:isEnabled',(_0x52707a,_0x18fb2b,_0x2262d1)=>{this['enabledCommandsIds']=_0x2262d1?vi(this['_commandDefinitions'],this['_hasContext']):[];});}['refresh'](){const _0x6bf2ed=this['editor']['model'];this['_hasContext']=function(_0x2c4c5b){const _0x3744bd=_0x2c4c5b['document']['selection'];return _0x3744bd['isCollapsed']?0x0!==[..._0x3744bd['getSelectedBlocks']()]['length']&&![..._0x3744bd['getSelectedBlocks']()][0x0]['isEmpty']:!!_0x2c4c5b['hasContent'](_0x3744bd['getFirstRange']());}(_0x6bf2ed);const _0x1a4f94=_0x6bf2ed['document']['selection'],_0x533afb=this['editor']['config']['get']('ai.assistant.disabledElements');for(const _0x533aec of _0x1a4f94['getRanges']())for(const _0xb24bbf of _0x533aec['getItems']())if(_0xb24bbf['is']('element')&&_0x533afb['includes'](_0xb24bbf['name']))return void(this['isEnabled']=!0x1);this['isEnabled']=!0x0;}['execute'](_0x3e7816='',_0x1af193='',_0x13ccaa='custom'){this['editor']['plugins']['get']($i)['showUI'](_0x3e7816,_0x1af193,_0x13ccaa);}}function vi(_0x45b2e2,_0x3077b9){const _0x19a723=new Set();for(const _0x7024fc of _0x45b2e2['values']())(_0x3077b9||!0x1===_0x7024fc['requiresContent'])&&_0x19a723['add'](_0x7024fc['id']);return Array['from'](_0x19a723);}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(_0x2b89c4,_0x269f55,_0x3f2143){super(),this['editor']=_0x2b89c4,this['textAdapter']=_0x269f55,this['_sanitizationContainer']=document['createElement']('div'),this['_domParser']=new DOMParser(),this['_xmlSerializer']=new XMLSerializer(),this['view']=_0x3f2143,this['set']({'initialContext':'','currentContext':'','currentResponse':'','previousContext':void 0x0,'previousQuery':void 0x0,'previousLabel':void 0x0,'isProcessing':!0x1}),this['on']('set:currentContext',(_0x4cea50,_0x31438f,_0x17329e)=>{this['view']['value']=this['_sanitizeHTML'](_0x17329e);}),this['listenTo'](this['view'],'submitPrompt',(_0x16e9e0,_0x749b13)=>{const _0xe7835a=this['currentContext']||this['initialContext'];this['_handleQuery'](_0x749b13,_0xe7835a,'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:_0x27f631,query:_0x299eec,htmlContent:_0x147ece,label:_0x2e91d0,mainActionLabel:_0x27ca52}){this['view']['prompt']=_0x2e91d0,this['view']['mainAction']=_0x27ca52,this['initialContext']=_0x147ece,_0x299eec&&(this['view']['isRendered']?this['_handleQuery'](_0x299eec,_0x147ece,_0x27f631,_0x2e91d0):this['view']['once']('render',()=>{this['_handleQuery'](_0x299eec,_0x147ece,_0x27f631,_0x2e91d0);}));}['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'](_0x8cc35c,_0x2a50f3,_0x230c4b,_0x4a3f65){return this['isProcessing']=!0x0,this['view']['startProcessing'](),this['previousContext']=_0x2a50f3,this['previousQuery']=_0x8cc35c,this['previousLabel']=_0x4a3f65||_0x8cc35c,this['previousActionId']=_0x230c4b,new Promise(_0x21d36e=>{this['textAdapter']['makeRequest']({'query':_0x8cc35c,'context':_0x2a50f3,'onData':_0x51778d=>{this['currentResponse']=_0x51778d,this['currentContext']=this['_parseAndNormalizeContent'](this['currentResponse']);},'actionId':_0x230c4b})['then'](()=>{!this['currentContext']&&this['currentResponse']&&(this['currentContext']=this['_parseAndNormalizeContent'](this['currentResponse'],!0x0));})['catch'](_0x3c2308=>{_0x3c2308 instanceof Oi?this['view']['handleError'](_0x3c2308['message']):this['view']['handleError'](),_0x21d36e();})['finally'](()=>{this['stopProcessing'](),_0x21d36e();});});}['_parseAndNormalizeContent'](_0x1cfbf9,_0x1f0e74=!0x1){const _0x3d3874=yi['exec'](_0x1cfbf9);_0x1cfbf9=_0x3d3874?_0x1cfbf9['substring'](_0x3d3874[0x1]['length']):_0x1cfbf9['length']<0x64&&!_0x1f0e74?'':this['_stripMarkdownSyntax'](_0x1cfbf9);const _0x1e2c88=this['_domParser']['parseFromString'](_0x1cfbf9,'text/html');if(_0x3d3874){const _0x3a88e0=Array['from'](_0x1e2c88['body']['childNodes']);_0x3a88e0['reverse']();for(const _0x18cbd7 of _0x3a88e0){if(_0x18cbd7['nodeType']==Node['ELEMENT_NODE'])break;_0x18cbd7['remove']();}}const _0x4eb892=this['editor']['data']['processor']['toView'](this['_xmlSerializer']['serializeToString'](_0x1e2c88['body']));this['_isH1TagSupportEnabled']()||this['_normalizeResponseHeadings'](_0x4eb892);const _0x3c64d8=this['editor']['config']['get']('ai.assistant.preserveComments'),_0x43fcfa=this['editor']['data']['toModel'](_0x4eb892);return _0x3c64d8||_0x43fcfa['markers']['clear'](),this['editor']['data']['stringify'](_0x43fcfa);}['_normalizeResponseHeadings'](_0x492c58){const _0x4859e6=new _0x238b2a(this['editor']['editing']['view']['document']),_0x55fe23=new _0x3e2cc6({'name':/^h[1-5]$/}),_0x1156e1=[];let _0x529a1a=!0x1;for(const _0x130a99 of _0x492c58)_0x130a99['is']('element')&&_0x55fe23['match'](_0x130a99)&&(_0x1156e1['push'](_0x130a99),'h1'==_0x130a99['name']&&(_0x529a1a=!0x0));if(_0x529a1a){for(const _0x587a43 of _0x1156e1)_0x4859e6['rename']('h'+(parseInt(_0x587a43['name'][0x1])+0x1),_0x587a43);}}['_isH1TagSupportEnabled'](){const {data:_0x413ced,editing:_0x347d7f}=this['editor'],_0xf9a812=_0x413ced['htmlProcessor']['toView']('<h1></h1>'),_0x3078b6=_0x413ced['toView'](_0x413ced['toModel'](_0xf9a812));return!!_0x347d7f['view']['domConverter']['viewToDom'](_0x3078b6)['querySelector']('h1');}['_sanitizeHTML'](_0x752b5f){return this['editor']['editing']['view']['domConverter']['setContentOf'](this['_sanitizationContainer'],_0x752b5f),this['_sanitizationContainer']['innerHTML'];}['_stripMarkdownSyntax'](_0x1d6a68){const _0x125b20=_0x1d6a68['trim']();return _0x125b20['startsWith']('```html')?_0x125b20['endsWith']('```')?_0x125b20['substring'](0x7,_0x125b20['length']-0x3):_0x125b20['substring'](0x7):_0x1d6a68;}}const Li={'REPLACE':'replace','INSERT':'insert'};class Di extends kt{constructor(_0x19025e){super(_0x19025e),this['set']('isVisible',!0x1),this['set']('mainAction',Li['REPLACE']),this['replaceButton']=this['_createButton']('','ck-button-action'),this['replaceButton']['bind']('label')['to'](this,'mainAction',_0x21dd66=>ki(_0x19025e,'AI_'+_0x21dd66['toUpperCase']()+'_CONTENT')),this['insertButton']=this['_createButton'](ki(_0x19025e,'Insert\x20below')),this['tryAgainButton']=this['_createButton'](ki(_0x19025e,'Try\x20again')),this['stopButton']=this['_createButton'](ki(_0x19025e,'Stop'));const _0x44ac53=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':['ck-ai-form__toolbar',_0x44ac53['if']('isVisible','ck-hidden',_0xcde745=>!_0xcde745)]}}),this['items']['addMany']([this['replaceButton'],this['insertButton'],this['tryAgainButton'],this['stopButton']]);}['_createButton'](_0x2338c7,_0xd1d2a3){const _0x4476f1=new Nt(this['locale']);return _0x4476f1['set']({'label':_0x2338c7,'class':_0xd1d2a3||'','isVisible':!0x0,'withText':!0x0}),_0x4476f1;}}class Pi extends vt{['contentFieldView'];['copyButtonView'];constructor(_0x47fcf1,_0x1f2402=''){super(_0x47fcf1),this['set']({'value':null,'isVisible':!0x1,'isProcessing':!0x1});const _0x4ab317=this['bindTemplate'];this['contentFieldView']=new Hi(_0x47fcf1,_0x1f2402),this['copyButtonView']=this['_createCopyButton'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area-wrapper',_0x4ab317['if']('isVisible','ck-hidden',_0x21771a=>!_0x21771a)],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area',_0x4ab317['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 _0x7fa457=!0x1;this['on']('change:value',(_0x4e7694,_0x426f61,_0x21219c)=>{const _0x134c96=!this['contentFieldView']['element']['querySelector']('.ck-ai-form__loader');this['contentFieldView']['setContent'](_0x21219c),this['isProcessing']&&_0x134c96&&!_0x7fa457&&this['element']['scrollTo']({'top':this['element']['scrollHeight'],'behavior':'smooth'});}),this['on']('change:isProcessing',(_0x1ff82e,_0x132957,_0x4b22fa)=>{_0x7fa457=!0x1,_0x4b22fa?(this['value']=null,this['contentFieldView']['appendLoader']()):this['value']||this['contentFieldView']['setContent']('');}),this['listenTo'](this['element'],'wheel',()=>{_0x7fa457=!0x0;}),this['listenTo'](this['element'],'mousedown',()=>{_0x7fa457=!0x0;});}['focus'](){this['element']['focus']();}['_createCopyButton'](){const _0x1c5283=this['locale'],_0x4abd14=new Nt(this['locale']),_0x14d7d2='ck-ai-form__copy-button';return _0x4abd14['set']({'label':ki(_0x1c5283,'Copy'),'icon':_0x25f1fc,'class':_0x14d7d2,'tooltip':!0x0}),_0x4abd14['bind']('isVisible')['to'](this,'value',_0x5ce95e=>!!_0x5ce95e),_0x4abd14['bind']('isEnabled')['to'](this,'isProcessing',_0x3de26b=>!_0x3de26b),_0x4abd14['on']('execute',()=>{this['_copyHTMLToClipboard'](this['contentFieldView']['element']),_0x4abd14['icon']=_0x474e29,_0x4abd14['class']=_0x14d7d2+'\x20ck-ai-form__copy-button--copied',this['focus'](),setTimeout(()=>{_0x4abd14['icon']=_0x25f1fc,_0x4abd14['class']=_0x14d7d2;},0x3e8);}),_0x4abd14;}['_copyHTMLToClipboard'](_0x2647a8){const {window:_0x5e7aeb,document:_0x2db003}=ct;if(_0x5e7aeb['ClipboardItem']){const {Blob:_0x538f85,ClipboardItem:_0x204021}=_0x5e7aeb,_0x5c07ae=[new _0x204021({'text/html':new _0x538f85([_0x2647a8['innerHTML']],{'type':'text/html'}),'text/plain':new _0x538f85([_0x2647a8['textContent']||''],{'type':'text/plain'})})];navigator['clipboard']['write'](_0x5c07ae);}else{const _0x546955=_0x2db003['createElement']('div');_0x546955['style']['position']='absolute',_0x546955['style']['left']='-9999px',_0x546955['innerHTML']='<span>[</span>'+_0x2647a8['innerHTML']+'<span>]</span>',_0x2db003['body']['appendChild'](_0x546955);const _0x58af6c=_0x2db003['createRange']();_0x58af6c['setStartAfter'](_0x546955['firstElementChild']),_0x58af6c['setEndBefore'](_0x546955['lastElementChild']);const _0x2aed8a=_0x5e7aeb['getSelection']();_0x2aed8a['removeAllRanges'](),_0x2aed8a['addRange'](_0x58af6c),_0x2db003['execCommand']('copy'),_0x546955['remove']();}}}class Hi extends vt{constructor(_0x135295,_0x270f20=''){super(_0x135295),this['loaderView']=this['_createLoader'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-content',_0x270f20,'ck-reset_all-excluded','ck-ai-form__content-field']}});}['setContent'](_0x524677){this['element']['innerHTML']=_0x524677;}['appendLoader'](){this['element']['appendChild'](this['loaderView']['element']);}['_createLoader'](){const _0x30d0d5=new vt(),_0x328910=this['locale'],_0x47d2a7=new yt();return _0x47d2a7['isVisible']=!0x0,_0x30d0d5['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__loader']},'children':[_0x47d2a7,{'text':ki(_0x328910,'AI\x20is\x20writing...')}]}),_0x30d0d5['render'](),_0x30d0d5;}}class Mi extends vt{constructor(_0x32aa97,_0x245e80=''){super(_0x32aa97);const _0x2e78e4=new xt(),_0x152431=this['bindTemplate'];this['set']('text',_0x245e80),_0x2e78e4['content']=_0x4a9d6a,this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__error']},'children':[_0x2e78e4,{'text':_0x152431['to']('text')}]});}}class Ui extends Lt{['submitButtonView'];['showHistoryButtonView'];constructor(_0x57a6e8,_0x5078da){super(_0x57a6e8,_0x5078da),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',(_0x260c86,_0x1f1eac)=>{_0x260c86['target']==this['queryView']['fieldView']['element']&&(this['submit'](),_0x1f1eac());});}['_createSubmitButton'](){const _0x12cfae=new Nt(this['locale']),_0x2d4bfd=this['locale'];return _0x12cfae['set']({'icon':_0x403531,'label':ki(_0x2d4bfd,'Submit'),'isVisible':!0x0,'tooltip':!0x0,'class':'ck-ai-form__submit'}),_0x12cfae['on']('execute',()=>{this['submit']();}),_0x12cfae['bind']('isEnabled')['to'](this['queryView']['fieldView'],'isEmpty',this,'isEnabled',(_0x538bca,_0x59ca49)=>!_0x538bca&&_0x59ca49),_0x12cfae;}['_createShowHistoryButton'](){const _0x2037b8=new Nt(this['locale']),_0x1e6d39=this['resultsView'],_0x1c5dd3=this['locale'];_0x2037b8['set']({'label':ki(_0x1c5dd3,'History'),'withText':!0x1,'icon':_0x2de1d5,'tooltip':!0x0,'tooltipPosition':'sw','class':'ck-ai-form__toggle-history'}),_0x2037b8['bind']('isOn')['to'](_0x1e6d39,'isVisible'),_0x2037b8['bind']('isEnabled')['to'](this,'isEnabled'),_0x2037b8['on']('execute',()=>{_0x1e6d39['isVisible']=!_0x1e6d39['isVisible'],_0x1e6d39['isVisible']?this['filteredView']['focus']():this['focus']();});const _0x551ab8=()=>{ct['window']['requestAnimationFrame'](()=>{if(lt(this['element'])){const _0x1bb8bd=new ut(this['queryView']['fieldView']['element']),_0x318092=_0x1bb8bd['width'],_0x4986ef='rtl'===_0x1c5dd3['uiLanguageDirection']?'left':'right';_0x1bb8bd['excludeScrollbarsAndBorders'](),_0x2037b8['element']['style'][_0x4986ef]=_0x318092-_0x1bb8bd['width']+0x1+'px';}});};return this['queryView']['fieldView']['on']('update',_0x551ab8),this['on']('render',_0x551ab8),_0x2037b8;}['submit'](){const _0x35368d=this['queryView']['fieldView']['element']['value'];this['fire']('submit',_0x35368d);}['focus'](_0x2398c9){-0x1===_0x2398c9?this['focusCycler']['focusLast']():this['focusCycler']['focusFirst']();}}class Vi extends Dt{['historyGroupView'];['clearHistoryButton'];constructor(_0x32d057){super(_0x32d057),this['clearHistoryButton']=this['_createClearHistoryButton'](),this['historyGroupView']=new Pt(),this['historyGroupView']['children']['add'](this['clearHistoryButton'],0x1),this['historyGroupView']['label']=ki(_0x32d057,'Prompt\x20history'),this['historyGroupView']['items']['delegate']('execute')['to'](this),this['items']['add'](this['historyGroupView']);}['filter'](){let _0x4b6cb3=0x0;for(const _0x367dcb of this['items'])_0x4b6cb3+=_0x367dcb['items']['length'];return{'resultsCount':_0x4b6cb3,'totalItemsCount':_0x4b6cb3};}['_createClearHistoryButton'](){const _0x130647=this['locale'],_0x4523b0=new Nt(this['locale']);return _0x4523b0['set']({'label':'('+ki(_0x130647,'Clear')+')','withText':!0x0}),_0x4523b0['on']('execute',()=>this['fire']('clearHistory')),_0x4523b0;}}class Bi extends Ht{constructor(_0x586abf){super();const _0x4201ca=new Mt(),_0x3e1660=new Nt(this['locale'],_0x4201ca);this['children']['add'](_0x3e1660),_0x3e1660['set']({'label':_0x586abf['prompt'],'withText':!0x0}),_0x3e1660['on']('execute',()=>{this['fire']('execute',{'value':_0x31486b(_0x586abf['prompt'])});});}}const Gi='CKEditor/AIFormView/PromptHistory';class Fi extends dt{constructor(){super(),this['_loadFromSessionStorage'](),this['on']('add',(_0x40baae,_0x24b9df)=>{const _0x10f75d=Ki(_0x24b9df['prompt']);for(const _0x97b487 of this)if(_0x97b487!=_0x24b9df&&Ki(_0x97b487['prompt'])===_0x10f75d){this['remove'](_0x97b487);break;}this['length']>0x14&&this['remove'](this['last']),this['_saveToSessionStorage']();}),this['on']('remove',()=>{this['_saveToSessionStorage']();});}['_loadFromSessionStorage'](){const _0x5cb75d=sessionStorage['getItem'](Gi)||'[]';this['addMany'](JSON['parse'](_0x5cb75d));}['_saveToSessionStorage'](){sessionStorage['setItem'](Gi,JSON['stringify'](this['map'](_0x1ece03=>_0x1ece03)));}}function Ki(_0x485c36){return _0x485c36['toLowerCase']()['trim']();}class Wi extends vt{['focusTracker'];['keystrokes'];['contentArea'];['toolbar'];['promptView'];['errorView'];['_focusables'];['focusCycler'];['_promptHistory'];constructor(_0x5c89bb,_0x5e91eb,_0xbcee93=''){super(_0x5c89bb),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(_0x5c89bb),this['contentArea']=new Pi(_0x5c89bb,_0xbcee93),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 _0x567912=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form',_0x5e91eb],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-form-content']},'children':[{'tag':'div','attributes':{'class':[_0x567912['if']('isError','ck-hidden',_0x4c93a3=>!_0x4c93a3)]},'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'](_0x4cd7bd=0x1){-0x1===_0x4cd7bd?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 _0x6bf687=this['locale'],_0x3f5701=new Ui(_0x6bf687,{'queryView':{'label':ki(_0x6bf687,'Ask\x20AI\x20to\x20edit\x20or\x20generate'),'creator':Vt,'showIcon':!0x1,'showResetButton':!0x1},'infoView':{'text':{'noSearchableItems':{'primary':ki(_0x6bf687,'Empty\x20history'),'secondary':ki(_0x6bf687,'Ask\x20AI\x20and\x20your\x20prompts\x20will\x20be\x20listed\x20here\x20for\x20you\x20to\x20use\x20later.')}}},'filteredView':this['_createHistoryView'](),'queryMinChars':0x1/0x0,'resetOnBlur':!0x1});return _0x3f5701['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',(_0x537ccc,_0x5060da)=>_0x537ccc&&!_0x5060da),this['listenTo'](_0x3f5701,'submit',(_0x5b8100,_0x2549bb)=>{this['prompt']=_0x2549bb;const _0x389d65=_0x56a9e5(_0x2549bb);this['fire']('submitPrompt',_0x389d65),_0x2549bb['trim']()&&this['_promptHistory']['add']({'prompt':_0x389d65},0x0);},{'priority':'high'}),_0x3f5701;}['_createHistoryView'](){const _0x210bab=new Vi(this['locale']);return _0x210bab['historyGroupView']['items']['bindTo'](this['_promptHistory'])['as'](Bi),_0x210bab['on']('clearHistory',()=>{this['_promptHistory']['clear'](),this['promptView']['search'](''),this['promptView']['focus']();}),_0x210bab;}['_createToolbar'](){const _0x5eed40=new Di(this['locale']);return _0x5eed40['replaceButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',this,'value',(_0x4e5f19,_0x466442,_0x93a797)=>_0x4e5f19&&!_0x466442&&!!_0x93a797),_0x5eed40['replaceButton']['delegate']('execute')['to'](this,'replaceContent'),_0x5eed40['insertButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',this,'value',(_0x49ae15,_0x38cb46,_0x18d779)=>_0x49ae15&&!_0x38cb46&&!!_0x18d779),_0x5eed40['insertButton']['delegate']('execute')['to'](this,'insertContentBelow'),_0x5eed40['tryAgainButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',(_0x307c08,_0x532854)=>_0x307c08&&!_0x532854),_0x5eed40['tryAgainButton']['delegate']('execute')['to'](this,'tryAgainEvent'),_0x5eed40['stopButton']['bind']('isEnabled')['to'](this,'isProcessing'),_0x5eed40['stopButton']['delegate']('execute')['to'](this,'stopProcessing'),_0x5eed40;}['startProcessing'](){this['value']='',this['isError']=!0x1,this['isProcessing']=!0x0,this['contentArea']['isVisible']=!0x0,this['toolbar']['isVisible']=!0x0,this['contentArea']['focus']();}['finishProcessing'](){const _0x397ada=this['locale'];this['isProcessing']=!0x1,this['prompt']='',this['promptView']['reset'](),this['value']&&(this['promptView']['queryView']['label']=ki(_0x397ada,'Ask\x20AI\x20to\x20improve\x20generated\x20text'));}['handleError'](_0x5dba25){const _0x38a74e=this['locale'];this['finishProcessing'](),this['isError']=!0x0,this['errorView']['text']=_0x5dba25||ki(_0x38a74e,'AI_ERROR_FAILED'),this['value']||(this['contentArea']['isVisible']=!0x1);}}const Yi=globalThis['DataTransfer'];class $i extends _0x17e8c8{['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[_0x3c6d31,Si,Ri,Bt];}constructor(_0x22df1c){super(_0x22df1c),_0x22df1c['config']['define']('ai.assistant.disabledElements',['media','rawHtml','tableOfContents']),_0x22df1c['config']['define']('ai.assistant.contentAreaCssClass',''),_0x22df1c['config']['define']('ai.assistant.useTheme',!0x0),this['_uiCssClasses']='ck-ai-assistant-ui'+(_0x22df1c['config']['get']('ai.assistant.useTheme')?'\x20ck-ai-assistant-ui_theme':'');}['init'](){const {editor:_0x51b911}=this;this['_aiAdapter']=_0x51b911['plugins']['get'](Ri),this['_dialog']=_0x51b911['plugins']['get'](Bt),this['_formView']=null,this['_commandDefinitions']=this['_getResolvedCommandsDefinitions']();const _0xe551b2=new Ni(_0x51b911,Array['from'](this['_commandDefinitions']['values']()));_0x51b911['commands']['add']('showAIAssistant',_0xe551b2),_0x51b911['ui']['componentFactory']['add']('aiCommands',_0xfdf073=>{const _0x4a64a5=Gt(_0xfdf073);return _0x4a64a5['set']({'class':'ck-ai-commands-dropdown\x20'+this['_uiCssClasses']}),_0x4a64a5['buttonView']['set']({'label':ki(_0xfdf073,'AI\x20Commands'),'icon':_0x171c1f,'tooltip':!0x0}),_0x4a64a5['on']('execute',_0x20e1d2=>this['_onExecute'](_0x20e1d2['source']['id'])),Ft(_0x4a64a5,_0x51b911['ui']['view']['body'],function(_0x5afdaf){const _0x319987=wi(_0x5afdaf['config']['get']('ai.assistant.commands'),_0x5afdaf['locale']),_0x4014a0=Qi(_0x5afdaf,_0x319987)['filter'](_0x180727=>_0x180727['commands']['length']);if(0x1===_0x4014a0['length'])return Qi(_0x5afdaf,_0x4014a0[0x0]['commands'])['map'](_0x4cdf2b=>({'id':_0x4cdf2b['id'],'label':_0x4cdf2b['label']}));return _0x4014a0['map'](_0x12de85=>{const {groupId:_0x2c5166,groupLabel:_0xefac2b,commands:_0x3e13f1}=_0x12de85,_0x57ea95=Qi(_0x5afdaf,_0x3e13f1)['map'](_0x2f920a=>({'id':_0x2f920a['id'],'label':_0x2f920a['label']}));return{'id':_0x2c5166,'menu':_0xefac2b||_0x2c5166,'children':_0x57ea95};});}(_0x51b911),{'ariaLabel':ki(_0xfdf073,'AI\x20Commands')}),_0x4a64a5['menuView']['menuPanelClass']='ck-ai-commands-dropdown\x20'+this['_uiCssClasses'],_0xe551b2['on']('change:enabledCommandsIds',_0x50a504),_0x4a64a5['menuView']['once']('render',_0x50a504),_0x4a64a5;function _0x50a504(){_0x4a64a5['isEnabled']=_0xe551b2['enabledCommandsIds']['length']>0x0;for(const _0x278231 of _0x4a64a5['menuView']['buttons'])_0x278231['isEnabled']=_0xe551b2['enabledCommandsIds']['includes'](_0x278231['id']);}}),_0x51b911['ui']['componentFactory']['add']('menuBar:aiCommands',_0x74ceac=>{const _0xde7cb6=new Kt(_0x74ceac);_0xde7cb6['buttonView']['set']({'label':ki(_0x74ceac,'AI\x20Commands'),'icon':_0x171c1f}),_0xde7cb6['bind']('isEnabled')['to'](_0xe551b2,'enabledCommandsIds',_0x1812a6=>_0x1812a6['length']>0x0);const _0x91966d=wi(_0x51b911['config']['get']('ai.assistant.commands'),_0x74ceac);return this['_populateMenuBarMenu'](_0xe551b2,_0xde7cb6,_0x91966d,_0x399659=>this['_onExecute'](_0x399659)),_0xde7cb6;}),_0x51b911['ui']['componentFactory']['add']('aiAssistant',()=>{const _0x5c67fd=this['_createAIAssistantUIButton'](Nt);return _0x5c67fd['set']({'tooltip':!0x0,'class':'ck-ai-assistant-button\x20'+this['_uiCssClasses']}),_0x5c67fd;}),_0x51b911['ui']['componentFactory']['add']('menuBar:aiAssistant',()=>{const _0x63aa51=this['_createAIAssistantUIButton'](Wt);return _0x63aa51['set']({'role':'menuitemcheckbox'}),_0x63aa51;}),this['licenseKey']=this['editor']['config']['get']('licenseKey');const _0x6b9628=this['editor'];this['_licenseKeyCheckInterval']=setInterval(()=>{let _0x6a5ac4;for(const _0x7296a3 in _0x6b9628){const _0xe85c3c=_0x7296a3,_0x5be876=_0x6b9628[_0xe85c3c];if('aiLicenseKeyValid'==_0x5be876||'aiLicenseKeyInvalid'==_0x5be876||'aiLicenseKeyExpired'==_0x5be876||'aiLicenseKeyDomainLimit'==_0x5be876||'aiLicenseKeyNotAllowed'==_0x5be876||'aiLicenseKeyEvaluationLimit'==_0x5be876||'aiLicenseKeyUsageLimit'==_0x5be876){delete _0x6b9628[_0xe85c3c],_0x6a5ac4=_0x5be876,clearInterval(this['_licenseKeyCheckInterval']),this['_licenseKeyCheckInterval']=void 0x0;break;}}'aiLicenseKeyInvalid'==_0x6a5ac4&&_0x6b9628['_showLicenseError']('invalid'),'aiLicenseKeyExpired'==_0x6a5ac4&&_0x6b9628['_showLicenseError']('expired'),'aiLicenseKeyDomainLimit'==_0x6a5ac4&&_0x6b9628['_showLicenseError']('domainLimit'),'aiLicenseKeyNotAllowed'==_0x6a5ac4&&_0x6b9628['_showLicenseError']('featureNotAllowed','AIAssistant'),'aiLicenseKeyEvaluationLimit'==_0x6a5ac4&&_0x6b9628['_showLicenseError']('evaluationLimit'),'aiLicenseKeyUsageLimit'==_0x6a5ac4&&_0x6b9628['_showLicenseError']('usageLimit');},0x3e8);}['destroy'](){super['destroy'](),this['_licenseKeyCheckInterval']&&clearInterval(this['_licenseKeyCheckInterval']);}['showUI'](_0x2820ac='',_0x551adc='',_0x3468ff='custom'){const _0x438987=this['editor'],_0x56fafc=_0x438987['editing']['view'],_0x302e5e=_0x438987['plugins']['get'](Si),_0x5b8f64=_0x438987['plugins']['get'](_0x3c6d31);_0x302e5e['showFakeVisualSelection']();const _0x27a5cf=new Yi(),_0x16b59a=new ClipboardEvent('copy',{'clipboardData':_0x27a5cf}),_0x4d9247=new _0x1b905a(_0x27a5cf),_0x351a17=new _0x5f4541(_0x56fafc,_0x16b59a,{'dataTransfer':_0x4d9247});_0x5b8f64['_forceMarkersCopy']('comment',()=>{_0x56fafc['document']['fire']('copy',_0x351a17);}),this['_formView']||(this['_initView'](),this['_aiAssistantController']=new xi(_0x438987,this['_aiAdapter']['textAdapter'],this['_formView']));let _0x4723ad=_0x4d9247['getData']('text/html');const _0x1a93f7=_0x438987['model']['document']['selection'],_0x3ceacc=Array['from'](_0x1a93f7['getRanges']());0x1===_0x3ceacc['length']&&_0x3ceacc[0x0]['isFlat']&&!_0x1a93f7['getSelectedElement']()&&''!==_0x4723ad['replace'](/ /g,'')['trim']()&&(_0x4723ad='<p>'+_0x4723ad+'</p>'),this['_aiAssistantController']['updateView']({'actionId':_0x3468ff,'query':_0x2820ac,'htmlContent':_0x4723ad,'label':_0x551adc,'mainActionLabel':Li[_0x438987['model']['document']['selection']['isCollapsed']?'INSERT':'REPLACE']}),'aiAssistant'!==this['_dialog']['id']?this['_dialog']['show']({'id':'aiAssistant','icon':_0x5b0fb3,'title':ki(this['editor']['locale'],'AI\x20Assistant'),'content':this['_formView'],'position':Yt['EDITOR_TOP_SIDE'],'onShow':()=>{this['_formView']['focus']();},'onHide':()=>{this['_aiAssistantController']['reset'](),_0x302e5e['hideFakeVisualSelection']();}}):this['_dialog']['view']['wasMoved']||this['_dialog']['view']['updatePosition']();}['hideUI'](){this['_dialog']['hide']();}['_getResolvedCommandsDefinitions'](){const _0x1728bf=new Map(),_0x45dca6=wi(this['editor']['config']['get']('ai.assistant.commands'),this['editor']['locale']);for(const _0x1346f7 of _0x45dca6)for(const _0x2ef3cd of _0x1346f7['commands'])_0x1728bf['set'](_0x2ef3cd['id'],{..._0x2ef3cd,'groupId':_0x1346f7['groupId'],'groupLabel':_0x1346f7['groupLabel']||_0x1346f7['groupId']});return _0x1728bf;}['_createAIAssistantUIButton'](_0x341825){const _0x408906=this['editor'],_0x50c5ea=_0x408906['commands']['get']('showAIAssistant'),_0x18283c=new _0x341825(_0x408906['locale']);return _0x18283c['set']({'label':ki(_0x408906['locale'],'AI\x20Assistant'),'icon':_0x5b0fb3,'isToggleable':!0x0}),_0x18283c['bind']('isEnabled')['to'](_0x50c5ea),_0x18283c['bind']('isOn')['to'](this['_dialog'],'id',_0x5d99f0=>'aiAssistant'===_0x5d99f0),this['listenTo'](_0x18283c,'execute',()=>{_0x18283c['isOn']?this['hideUI']():_0x50c5ea['execute']();}),_0x18283c;}['_initView'](){const _0x11689e=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',()=>{_0x11689e['insertContent'](this['_aiAssistantController']['currentContext']),this['hideUI']();}),this['listenTo'](this['_formView'],'insertContentBelow',()=>{_0x11689e['insertContentBelow'](this['_aiAssistantController']['currentContext']),this['hideUI']();}),this['_initAriaAiStatusChangeAnnouncements']();}['_initAriaAiStatusChangeAnnouncements'](){const {locale:_0x1dccaa,ui:{ariaLiveAnnouncer:_0x56e515}}=this['editor'];this['_formView']['contentArea']['on']('change:isProcessing',(_0x401bb3,_0x1180e9,_0x52f362)=>{const _0x2318ab=this['_aiAssistantController']['currentContext'];_0x52f362?_0x56e515['announce'](ki(_0x1dccaa,'AI\x20is\x20writing')):_0x2318ab&&_0x56e515['announce'](ki(_0x1dccaa,'Generated\x20content:\x20%0',_0x2318ab),{'politeness':'polite','isUnsafeHTML':!0x0});}),this['_formView']['on']('change:isError',(_0x181566,_0x546b09,_0x1de86e)=>{if(_0x1de86e){const _0x2cf5b9=this['_formView']['errorView']['text'];_0x56e515['announce'](ki(_0x1dccaa,'Error\x20during\x20AI\x20content\x20generation:\x20%0',_0x2cf5b9));}});}['_onExecute'](_0x3089f1){const _0x447479=this['_commandDefinitions']['get'](_0x3089f1),_0x30bbdb=this['editor'],_0x2c6aef=_0x30bbdb['model']['document']['selection'],_0x5bac70=_0x30bbdb['commands']['get']('showAIAssistant'),_0x4022e7=_0x30bbdb['plugins']['get'](Si),_0x76cfc5=''+(_0x447479['groupId']!==Ci?_0x447479['groupLabel']+':\x20':'')+_0x447479['label'];if(!0x1!==_0x447479['requiresContent']&&_0x2c6aef['isCollapsed']){const _0x5c9ab4=At(_0x2c6aef['getSelectedBlocks']())||_0x30bbdb['model']['schema']['getLimitElement'](_0x2c6aef);_0x30bbdb['model']['change'](_0x3f494d=>{_0x3f494d['setSelection'](_0x5c9ab4,'in');});}_0x4022e7['showFakeVisualSelection'](),_0x5bac70['execute'](_0x447479['prompt'],_0x76cfc5,'command:'+_0x3089f1);}['_populateMenuBarMenu'](_0x3f5cc1,_0xdd96c8,_0x3a019d,_0xcc0a0f){const _0x8a3f9c=this['editor'],_0x4fd314=_0x8a3f9c['locale'],_0xd0c14d=new $t(_0x4fd314),_0xcf0c72=Qi(_0x8a3f9c,_0x3a019d)['filter'](_0x1d0f9d=>_0x1d0f9d['commands']['length']);0x1===_0xcf0c72['length']?this['_getMenuBarGroupButtons']({'command':_0x3f5cc1,'commands':_0xcf0c72[0x0]['commands'],'parentMenuView':_0xdd96c8,'onExecute':_0xcc0a0f})['forEach'](_0x70c55c=>_0xd0c14d['items']['add'](_0x70c55c)):_0xcf0c72['forEach'](({groupId:_0x12af9f,groupLabel:_0x4ada8f,commands:_0x5980eb})=>{const _0x49a65e=new qt(_0x4fd314,_0xdd96c8),_0x440361=new Kt(_0x4fd314),_0x2a470e=new $t(_0x4fd314),_0x77dc53=this['_getMenuBarGroupButtons']({'command':_0x3f5cc1,'commands':_0x5980eb,'parentMenuView':_0x440361,'onExecute':_0xcc0a0f});_0x440361['buttonView']['set']({'label':_0x4ada8f||_0x12af9f}),_0x440361['delegate']('execute')['to'](_0xdd96c8),_0x2a470e['items']['addMany'](_0x77dc53),_0x440361['panelView']['children']['add'](_0x2a470e),_0x49a65e['children']['add'](_0x440361),_0xd0c14d['items']['add'](_0x49a65e);}),_0xdd96c8['panelView']['children']['add'](_0xd0c14d);}['_getMenuBarGroupButtons']({command:_0x25a4a8,commands:_0xe04803,parentMenuView:_0x28cea6,onExecute:_0x52c27d}){const _0x58e00a=this['editor'],_0x50e691=_0x58e00a['locale'];return Qi(_0x58e00a,_0xe04803)['map'](_0x2d9cb5=>{const _0x268869=new qt(_0x50e691,_0x28cea6),_0x2db388=new Wt(_0x50e691);return _0x2db388['set']({'label':_0x2d9cb5['label']}),_0x2db388['delegate']('execute')['to'](_0x28cea6),_0x2db388['on']('execute',()=>_0x52c27d(_0x2d9cb5['id'])),_0x2db388['bind']('isEnabled')['to'](_0x25a4a8,'enabledCommandsIds',_0xd2bd8a=>_0xd2bd8a['includes'](_0x2d9cb5['id'])),_0x268869['children']['add'](_0x2db388),_0x268869;});}}function qi(_0x52ccb0,_0x492e19){return void 0x0!==_0x52ccb0['order']&&void 0x0===_0x492e19['order']?0x1:void 0x0===_0x52ccb0['order']&&void 0x0!==_0x492e19['order']?-0x1:void 0x0!==_0x52ccb0['order']&&void 0x0!==_0x492e19['order']?_0x52ccb0['order']-_0x492e19['order']:0x0;}function Qi(_0x1fbf0a,_0x2963c3){_0x2963c3['sort'](qi);const _0x1553fc={},_0x19f9a9=[];for(const _0x133a75 of _0x2963c3)if(void 0x0!==_0x133a75['order']){if(_0x133a75['order']in _0x1553fc)throw new at('ai-commands-config-order-collision',_0x1fbf0a,{'conflictingDefinitions':[_0x133a75,_0x1553fc[_0x133a75['order']]]});_0x1553fc[_0x133a75['order']]=_0x133a75,_0x19f9a9['splice'](_0x133a75['order'],0x0,_0x133a75);}else _0x19f9a9['push'](_0x133a75);return _0x19f9a9;}class Xi extends _0x17e8c8{static get['requires'](){return[$i,Si];}static get['pluginName'](){return'AIAssistant';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x263ea4){super(_0x263ea4);const _0x1190cb=_0x263ea4['config'],_0x1e8719=_0x263ea4['locale'];_0x1190cb['define']('ai.assistant.preserveComments',!0x0),_0x1190cb['define']('ai.assistant.commands',zi(_0x1e8719)),_0x1190cb['define']('ai.assistant.extraCommandGroups',[]),_0x1190cb['define']('ai.assistant.removeCommands',[]);let _0x35b82f=wi(_0x1190cb['get']('ai.assistant.commands'),_0x1e8719);const _0x4c78d1=_0x1190cb['get']('ai.assistant.extraCommandGroups'),_0x110f2c=_0x1190cb['get']('ai.assistant.removeCommands');_0x4c78d1['forEach'](_0x59080b=>{const _0x3ef7d0=_0x35b82f['find'](_0x1a6ac7=>_0x1a6ac7['groupId']===_0x59080b['groupId']);_0x3ef7d0?_0x3ef7d0['commands']=_0x3ef7d0['commands']['concat'](_0x59080b['commands']):_0x35b82f['push'](_0x59080b);}),_0x35b82f=_0x35b82f['filter'](_0xa91f02=>!_0x110f2c['includes'](_0xa91f02['groupId'])),_0x35b82f['forEach'](_0x25473b=>{_0x25473b['commands']=_0x25473b['commands']['filter'](_0x41d620=>!_0x110f2c['includes'](_0x41d620['id']));}),_0x1190cb['set']('ai.assistant.commands',_0x35b82f);}}function zi(_0x16b2ce){return[{'groupId':'editOrReview','groupLabel':ki(_0x16b2ce,'Edit\x20or\x20review'),'commands':[{'id':'improveWriting','label':ki(_0x16b2ce,'Improve\x20writing'),'prompt':'Fix\x20spelling\x20mistakes,\x20use\x20proper\x20grammar\x20and\x20apply\x20good\x20writing\x20practices.\x20Do\x20not\x20lose\x20the\x20original\x20meaning.'},{'id':'makeShorter','label':ki(_0x16b2ce,'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(_0x16b2ce,'Make\x20longer'),'prompt':'Improve\x20this\x20content\x20by\x20using\x20descriptive\x20language\x20and\x20inserting\x20more\x20information\x20and\x20more\x20detailed\x20explanations.'},{'id':'simplifyLanguage','label':ki(_0x16b2ce,'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(_0x16b2ce,'Generate\x20from\x20selection'),'commands':[{'id':'summarize','label':ki(_0x16b2ce,'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(_0x16b2ce,'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(_0x16b2ce,'Change\x20tone'),'commands':[{'id':'professional','label':ki(_0x16b2ce,'Professional'),'prompt':'Improve\x20using\x20polished,\x20formal,\x20and\x20respectful\x20language\x20to\x20convey\x20professional\x20expertise\x20and\x20competence.'},{'id':'casual','label':ki(_0x16b2ce,'Casual'),'prompt':'Improve\x20using\x20casual,\x20informal\x20language\x20to\x20convey\x20a\x20casual\x20conversation\x20with\x20a\x20real\x20person.'},{'id':'direct','label':ki(_0x16b2ce,'Direct'),'prompt':'Improve\x20using\x20direct\x20language,\x20using\x20only\x20the\x20essential\x20information.'},{'id':'confident','label':ki(_0x16b2ce,'Confident'),'prompt':'Improve\x20using\x20compelling,\x20optimistic\x20language\x20to\x20convey\x20confidence\x20in\x20the\x20writing.'},{'id':'friendly','label':ki(_0x16b2ce,'Friendly'),'prompt':'Improve\x20using\x20friendly,\x20comforting\x20language,\x20to\x20convey\x20understanding\x20and\x20empathy.'}]},{'groupId':'changeStyle','groupLabel':ki(_0x16b2ce,'Change\x20style'),'commands':[{'id':'business','label':ki(_0x16b2ce,'Business'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20business\x20professional\x20with\x20formal\x20language.'},{'id':'legal','label':ki(_0x16b2ce,'Legal'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20legal\x20professional\x20using\x20valid\x20legal\x20terminology.'},{'id':'journalism','label':ki(_0x16b2ce,'Journalism'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20journalist\x20using\x20engaging\x20language\x20to\x20convey\x20the\x20importance\x20of\x20the\x20information.'},{'id':'poetic','label':ki(_0x16b2ce,'Poetic'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20poem\x20using\x20poetic\x20techniques\x20without\x20losing\x20the\x20original\x20meaning.'}]},{'groupId':'translate','groupLabel':ki(_0x16b2ce,'Translate'),'commands':[{'id':'translateEnglish','label':ki(_0x16b2ce,'English'),'prompt':'Translate\x20the\x20content\x20to\x20English\x20language.'},{'id':'translateSpanish','label':ki(_0x16b2ce,'Spanish'),'prompt':'Translate\x20the\x20content\x20to\x20Spanish\x20language.'},{'id':'translatePortuguese','label':ki(_0x16b2ce,'Portuguese'),'prompt':'Translate\x20the\x20content\x20to\x20Portuguese\x20language.'},{'id':'translateGerman','label':ki(_0x16b2ce,'German'),'prompt':'Translate\x20the\x20content\x20to\x20German\x20language.'},{'id':'translateFrench','label':ki(_0x16b2ce,'French'),'prompt':'Translate\x20the\x20content\x20to\x20French\x20language.'},{'id':'translateChinese','label':ki(_0x16b2ce,'Simplified\x20Chinese'),'prompt':'Translate\x20the\x20content\x20to\x20Simplified\x20Chinese\x20language.'},{'id':'translateHindi','label':ki(_0x16b2ce,'Hindi'),'prompt':'Translate\x20the\x20content\x20to\x20Hindi\x20language.'},{'id':'translateArabic','label':ki(_0x16b2ce,'Arabic'),'prompt':'Translate\x20the\x20content\x20to\x20Arabic\x20language.'}]}];}class ji extends _0x17e8c8{['abortController'];static get['requires'](){return[Ri];}constructor(_0x59729f){super(_0x59729f),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'](_0x3709d3){return this['sendRequest'](_0x3709d3)['catch'](_0x1883a8=>{if(_0x1883a8 instanceof Oi)return Promise['reject'](_0x1883a8);if('AbortError'==_0x1883a8['name'])return Promise['resolve']();throw console['error'](_0x1883a8),new at('aitextadapter-send-request-failed',null);});}async['_prepareRequestHeaders'](_0x2e4f79,_0x365852){const _0x31117e=this['editor']['locale'],_0x6ceb73={'Content-Type':'application/json'};if('object'==typeof _0x2e4f79)Object['assign'](_0x6ceb73,_0x2e4f79);else{if(_0x2e4f79)try{const _0x19186d=await _0x2e4f79(_0x365852);Object['assign'](_0x6ceb73,_0x19186d);}catch{return Promise['reject'](new Oi(ki(_0x31117e,'AI_ERROR_GET_HEADERS')));}}return _0x6ceb73;}async['_prepareRequestParameters'](_0x176a93,_0x1847a9){const _0xd14ba5=this['editor']['locale'];if('object'==typeof _0x176a93)return _0x176a93;try{return await _0x176a93(_0x1847a9);}catch{return Promise['reject'](new Oi(ki(_0xd14ba5,'AI_ERROR_GET_PARAMETERS')));}}}class Ji extends ji{['_apiUrl'];['_requestHeaders'];['_requestParameters'];static get['pluginName'](){return'OpenAITextAdapter';}constructor(_0x48a5c2){super(_0x48a5c2),_0x48a5c2['config']['define']('ai.assistant.adapter.openAI.apiUrl','https://api.openai.com/v1/chat/completions'),_0x48a5c2['config']['get']('ai.assistant.adapter.openAI.requestParameters')||_0x48a5c2['config']['define']('ai.assistant.adapter.openAI.requestParameters',{'model':'gpt-4o','temperature':0x1,'top_p':0x1,'stream':!0x0}),this['_apiUrl']=_0x48a5c2['config']['get']('ai.assistant.adapter.openAI.apiUrl'),this['_requestHeaders']=_0x48a5c2['config']['get']('ai.assistant.adapter.openAI.requestHeaders')||{},this['_requestParameters']=_0x48a5c2['config']['get']('ai.assistant.adapter.openAI.requestParameters');}async['sendRequest']({query:_0x12d370,context:_0x41133b,onData:_0x3a3ed2,actionId:_0x31a800}){const _0x2f4fe5=this['editor']['locale'],_0x12ee37=await this['prepareMessages'](_0x12d370,_0x41133b,_0x31a800),_0x5ce21a=await this['_prepareRequestHeaders'](this['_requestHeaders'],_0x31a800),_0x46bdae=await this['_prepareRequestParameters'](this['_requestParameters'],_0x31a800),_0x24341e={'messages':_0x12ee37,..._0x46bdae},_0x4ac0c0={'method':'POST','headers':_0x5ce21a,'body':JSON['stringify'](_0x24341e),'signal':this['abortController']['signal']},_0x479d99=await fetch(this['_apiUrl'],_0x4ac0c0);if(_0x479d99['ok'])return _0x46bdae['stream']?await this['_readStreamableResponse'](_0x479d99,_0x3a3ed2):await this['_readStaticResponse'](_0x479d99,_0x3a3ed2),Promise['resolve']();{const _0x5d46dd=await _0x479d99['text']();return _0x5d46dd['includes']('context_length_exceeded')?Promise['reject'](new Oi(ki(_0x2f4fe5,'AI_ERROR_CONTEXT_LENGTH'))):_0x5d46dd['includes']('Moderation')?Promise['reject'](new Oi(ki(_0x2f4fe5,'AI_ERROR_MODERATION'))):Promise['reject'](new Error(_0x5d46dd));}}async['prepareMessages'](_0x7bdc50,_0x308be3,_0x4095c0){let _0x33ad26,_0x289823;return _0x308be3?(_0x33ad26='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.',_0x289823='Instruction:\x0a'+_0x7bdc50+'\x0aYou\x20must\x20keep\x20the\x20text\x20formatting.\x0a\x0aContent:\x0a'+_0x308be3):(_0x33ad26='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.',_0x289823=_0x7bdc50),[{'role':'system','content':_0x33ad26},{'role':'user','content':_0x289823}];}async['_readStreamableResponse'](_0x42cfc5,_0x1a6c94){const _0xb37c1d=_0x42cfc5['body']['getReader'](),_0x2b3963=new TextDecoder();let _0x25627d='',_0x1f962d='',_0x25be75='',_0x2ca639=!0x1;for(;!_0x2ca639;){const {done:_0xe5213b,value:_0x7975f4}=await _0xb37c1d['read'](),_0x289809=_0x25627d+_0x2b3963['decode'](_0x7975f4);let _0x26fe7d='';_0x2ca639=_0xe5213b;try{_0x26fe7d=this['_cleanUpData'](_0x289809),_0x25627d='';}catch{_0x25627d=_0x289809;continue;}_0x1f962d+=_0x26fe7d,!_0x2ca639&&this['_isBufferIncomplete'](_0x1f962d)||_0x1f962d&&(_0x25be75+=_0x1f962d,_0x1f962d='',_0x1a6c94(_0x25be75));}return Promise['resolve']();}async['_readStaticResponse'](_0x5cebc7,_0x47f0fe){return _0x47f0fe((await _0x5cebc7['json']())['choices'][0x0]['message']['content']),Promise['resolve']();}['_isBufferIncomplete'](_0x32311f){const _0x24f70e=_0x32311f['split']('<')['length']!==_0x32311f['split']('>')['length'],_0x250022=_0x32311f['length']<0x1e;return _0x24f70e&&_0x250022;}['_cleanUpData'](_0x26bcff){return _0x26bcff['split'](/\n(?![^{]*\})/g)['map'](_0x4c9098=>_0x4c9098['replace']('data:\x20',''))['filter'](_0x498268=>_0x498268&&_0x498268['length']>0x0&&'[DONE]'!==_0x498268)['map'](_0x505063=>{const {choices:_0x400546}=JSON['parse'](_0x505063);if(_0x400546[0x0]?.['delta']?.['content'])return _0x400546[0x0]['delta']['content'];})['filter'](_0x45f299=>_0x45f299)['join']('');}}class Zi extends ji{static get['pluginName'](){return'AWSTextAdapter';}['init'](){super['init'](),It('ai-aws-adapter-not-supported');}async['sendRequest'](_0x4a5892){throw Et('ai-aws-adapter-not-supported'),new Oi(ki(this['editor']['locale'],'AI_ERROR_AWS_NOT_SUPPORTED'));}}class ts extends Nt{constructor(_0x36c3bd,_0xef9e2a={}){super(_0x36c3bd),this['isToggleable']=!0x0,this['set']('side',_0xef9e2a['side']||'top');const _0x239d1d=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':['ck-tab-button',...pt(_0xef9e2a['class']||[]),_0x239d1d['to']('side',_0x5b69de=>'ck-tab-button_'+_0x5b69de),_0x239d1d['to']('class')]}});}['show'](){this['set']('isVisible',!0x0);}['hide'](){this['set']('isVisible',!0x1);}}class es extends vt{['children'];constructor(_0xf44339,_0x436f13={}){super(_0xf44339);const _0x1260de=this['bindTemplate'];this['set']('isVisible',!0x1),this['set']('class',''),this['children']=this['createCollection'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-tab-panel',...pt(_0x436f13['class']||[]),_0x1260de['to']('class'),_0x1260de['if']('isVisible','ck-hidden',_0x2e0738=>!_0x2e0738)]},'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(_0x4a43de,_0x2f7a4d={}){super(_0x4a43de),this['set']('class',void 0x0),this['set']('activeTab',null),this['set']('side',_0x2f7a4d['side']||'top'),this['set']('isMaximized',!0x1),this['set']('collapsible',_0x2f7a4d['collapsible']||!0x1),this['set']('_isMaximizedActive',!0x1),this['bind']('_isMaximizedActive')['to'](this,'isMaximized',this,'activeTab',(_0x55ec80,_0x32b3d7)=>_0x55ec80&&null!==_0x32b3d7);const _0x133269=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset','ck-tabs',...pt(_0x2f7a4d['class']||[]),_0x133269['to']('side',_0x1a2610=>'ck-tabs_'+_0x1a2610),_0x133269['to']('class'),_0x133269['if']('_isMaximizedActive','ck-ai-tabs_maximized'),_0x133269['to']('activeTab',_0x3704ff=>null===_0x3704ff?'ck-ai-tabs_collapsed':'')],'tabindex':'0'},'children':[{'tag':'div','attributes':{'class':['ck','ck-tabs__buttons-container',_0x133269['to']('side',_0x213f2d=>'ck-tabs__buttons-container_'+_0x213f2d)]},'children':this['buttonViews']},{'tag':'div','attributes':{'class':['ck','ck-tabs__panels-container',_0x133269['to']('side',_0x14120e=>'ck-tabs__panels-container_'+_0x14120e)]},'children':this['panelViews']},...pt(_0x2f7a4d['children']||[])]});}['getTabIds'](){return[...this['_tabs']['keys']()];}['getTab'](_0x2b884c){const _0x4436ef=this['_tabs']['get'](_0x2b884c);return _0x4436ef||null;}['addTab'](_0x42cca4){const _0x324c21=this['_setupButton']({'id':_0x42cca4['id'],'label':_0x42cca4['buttonLabel'],'icon':_0x42cca4['buttonIcon'],'order':_0x42cca4['order']}),_0x2645fb=new es(this['locale']);return _0x2645fb['render'](),_0x42cca4['content']&&_0x2645fb['children']['add'](_0x42cca4['content']),this['panelViews']['add'](_0x2645fb),this['_tabs']['set'](_0x42cca4['id'],{'button':_0x324c21,'panel':_0x2645fb,'order':void 0x0!==_0x42cca4['order']?_0x42cca4['order']:null}),this['fire']('addTab:'+_0x42cca4['id'],{'id':_0x42cca4['id'],'button':_0x324c21,'panel':_0x2645fb}),null===this['activeTab']?this['activateTab'](_0x42cca4['id']):this['_hidePanel'](_0x42cca4['id']),{'button':_0x324c21,'panel':_0x2645fb};}['activateTab'](_0x3373dc){if(null!==_0x3373dc&&!this['getTab'](_0x3373dc))throw new at('ui-tabsview-tab-not-found',{'tabs':this,'tabId':_0x3373dc});if(this['activeTab']===_0x3373dc)return;const _0x3fea28=this['activeTab'];this['activeTab']&&this['_hidePanel'](this['activeTab']),this['activeTab']=_0x3373dc,_0x3373dc&&this['_showPanel'](_0x3373dc),this['fire']('activateTab:'+_0x3373dc,{'newTab':_0x3373dc,'oldTab':_0x3fea28});}['toggleTabPanel'](_0x2d0e4f){if(!this['getTab'](_0x2d0e4f))throw new at('ui-tabsview-tab-not-found',{'tabs':this,'tabId':_0x2d0e4f});this['activeTab']===_0x2d0e4f?this['collapsible']&&(this['activeTab']=null):this['activateTab'](_0x2d0e4f);}['showTab'](_0x51706b){if(!this['getTab'](_0x51706b))throw new at('ui-tabsview-tab-not-found',{'tabs':this,'tabId':_0x51706b});this['_showPanel'](_0x51706b),this['_showButton'](_0x51706b),this['fire']('show:'+_0x51706b,_0x51706b);}['hideTab'](_0x453b6e){if(!this['getTab'](_0x453b6e))throw new at('ui-tabsview-tab-not-found',{'tabs':this,'tabId':_0x453b6e});const _0x3e5ef8=this['activeTab'];this['_hidePanel'](_0x453b6e),this['_hideButton'](_0x453b6e);const _0x1a43e6=this['getTabIds']();_0x3e5ef8===_0x453b6e&&_0x1a43e6['length']>0x1&&this['activateTab'](_0x1a43e6['find'](_0x36730b=>_0x36730b!==_0x453b6e)),this['fire']('hide:'+_0x453b6e,_0x453b6e);}['_getPanel'](_0x38e00a){const _0x166bba=this['_tabs']['get'](_0x38e00a);return _0x166bba?_0x166bba['panel']:null;}['_showPanel'](_0x11e3ad){null!==this['activeTab']&&this['activeTab']!==_0x11e3ad||this['_getPanel'](_0x11e3ad)['show']();}['_hidePanel'](_0x326d84){const _0x5f0fa2=this['_getPanel'](_0x326d84);_0x5f0fa2['isVisible']&&(this['activeTab']===_0x326d84&&(this['activeTab']=null),_0x5f0fa2['hide']());}['_getButton'](_0x58cabe){const _0x3cf7bb=this['_tabs']['get'](_0x58cabe);return _0x3cf7bb?_0x3cf7bb['button']:null;}['_showButton'](_0x3d8865){this['_getButton'](_0x3d8865)['show']();}['_hideButton'](_0x39e3d5){this['_getButton'](_0x39e3d5)['hide']();}['_setupButton'](_0x202b93){const _0x5039bb=new ts(this['locale'],{'side':this['side']}),_0x2dce7c=this['buttonViews'];if(_0x5039bb['set']({'label':_0x202b93['label'],'icon':_0x202b93['icon'],'tooltip':!0x0,'withText':!0x0}),_0x5039bb['bind']('isOn')['to'](this,'activeTab',_0x3b5f3b=>_0x3b5f3b===_0x202b93['id']),_0x5039bb['bind']('side')['to'](this,'side'),_0x202b93['order']){const _0x176f66=[...this['_tabs']]['reduce']((_0x274219,_0x52aef1)=>{const _0x521a3d=_0x52aef1[0x0],{order:_0x47dbd3}=_0x52aef1[0x1];return!_0x47dbd3||_0x47dbd3>_0x202b93['order']?_0x274219:_0x47dbd3>=_0x274219['order']?{'id':_0x521a3d,'order':_0x47dbd3}:_0x274219;},{'id':'','order':0x0}),_0xb1ab10=_0x2dce7c['getIndex'](this['_getButton'](_0x176f66['id']));_0x2dce7c['add'](_0x5039bb,_0xb1ab10+0x1);}else _0x2dce7c['add'](_0x5039bb);return _0x5039bb['on']('execute',()=>{this['toggleTabPanel'](_0x202b93['id']);}),_0x5039bb;}}const ss=['overlay','sidebar','custom'],ns=['left','right'];class rs extends is{constructor(_0x40a862,_0x308b10={}){super(_0x40a862,_0x308b10),this['set']('type',_0x308b10['type']||'sidebar'),this['set']('side',_0x308b10['side']||'right'),this['set']('isVisible',_0x308b10['visibleByDefault']??!0x0);const _0x16bbce=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':['ck-ai-tabs',_0x16bbce['if']('type','ck-ai-tabs__overlay',_0xdcc7af=>'overlay'===_0xdcc7af),_0x16bbce['if']('type','ck-ai-tabs__sidebar',_0x3c6f96=>'sidebar'===_0x3c6f96),_0x16bbce['if']('isVisible','ck-hidden',_0x3b736a=>!_0x3b736a)]}}),this['buttonViews']['on']('add',(_0x1b643b,_0x476804)=>{_0x476804['set']('withText',!0x1);});}}class os extends _0x1c4723{['view'];['container']=null;['showResizeButton']=!0x0;static get['pluginName'](){return'AITabs';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x25cec3){if(super(_0x25cec3),!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 _0x1bf488=this['context']['config']['get']('ai.container');if(this['set']('side','right'),void 0x0!==_0x1bf488['showResizeButton']&&(this['showResizeButton']=_0x1bf488['showResizeButton']),'sidebar'!==_0x1bf488['type']&&'overlay'!==_0x1bf488['type']||_0x1bf488['side']&&(this['side']=_0x1bf488['side']),'sidebar'===_0x1bf488['type']){if(this['container']=_0x1bf488['element'],this['set']('type','sidebar'),!this['container'])throw new at('ai-tabs-sidebar-container-element-not-found');}else'overlay'===_0x1bf488['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':_0x1bf488['visibleByDefault'],'collapsible':_0x1bf488['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 _0x597112&&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'](_0x32b979){if(_0x32b979&&this['type']!==_0x32b979){if(!ss['includes'](_0x32b979))throw new at('ai-tabs-unsupported-ui-type');this['type']=_0x32b979;}}['switchSide'](_0x322afa){if(_0x322afa&&this['side']!==_0x322afa){if(!ns['includes'](_0x322afa))throw new at('ai-tabs-unsupported-ui-side');this['side']=_0x322afa;}}['destroy'](){super['destroy'](),this['view']['destroy'](),this['view']['element']&&this['view']['element']['remove']();}}class as extends _0x1c4723{['_apiUrl'];['_token'];['_decoder'];['_responseCache'];static get['requires'](){return[_0x3ed556];}static get['pluginName'](){return'AIConnector';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x5044c4){super(_0x5044c4),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 _0x15c0a3=this['context']['plugins']['get'](_0x3ed556);if(!_0x15c0a3['token'])throw new at('ai-missing-token',this);this['_token']=_0x15c0a3['token'];}['startConversation'](_0x2d3861,_0xd8e165){const _0x7848f4=this['_sendApiRequest']('/conversations','POST',{'id':_0x2d3861,'group':_0xd8e165});return{'getConversation':async()=>(await _0x7848f4['request'])['json'](),'abortController':_0x7848f4['abortController']};}['queryAssistant']({message:_0x1338dc,conversationId:_0x56ef0a,parts:_0x13c3c0,capabilities:_0x1dd18c,model:_0xd87592,attributes:_0x313b57}){const _0x89b65b={'prompt':_0x1338dc,'content':_0x13c3c0,'model':_0xd87592,..._0x1dd18c&&{'capabilities':_0x1dd18c},..._0x313b57&&{'attributes':_0x313b57}},_0x54138e=this['_sendApiRequest']('/conversations/'+_0x56ef0a+'/messages','POST',_0x89b65b);return{'getStream':async()=>{const _0x326304=(await _0x54138e['request'])['body'];return this['_getStreamReader'](_0x326304);},'abortController':_0x54138e['abortController']};}['executeCustomAction']({content:_0x46f4ed,message:_0x388eb4,model:_0x2a35dc,outputFormat:_0x5d448f}){const _0x54e89c={'content':[{'type':'text','content':_0x46f4ed}],'prompt':_0x388eb4,'model':_0x2a35dc,'outputFormat':_0x5d448f},_0x384e6c=this['_sendApiRequest']('/actions/custom/calls','POST',_0x54e89c);return{'getStream':async()=>{const _0x14eeec=(await _0x384e6c['request'])['body'];return this['_getStreamReader'](_0x14eeec);},'abortController':_0x384e6c['abortController']};}['executeAction']({actionName:_0x3166fb,content:_0x101c7a,args:_0x58226b}){const _0x701f75={'content':[{'type':'text','content':_0x101c7a}],'args':_0x58226b},_0x2caea1=this['_sendApiRequest']('/actions/system/'+_0x3166fb+'/calls','POST',_0x701f75);return{'getStream':async()=>{const _0x1164d2=(await _0x2caea1['request'])['body'];return this['_getStreamReader'](_0x1164d2);},'abortController':_0x2caea1['abortController']};}['uploadFile'](_0x3bad7a,_0x3ea0ad,_0x152cbd){const _0x24fabc=new FormData();_0x24fabc['append']('file',_0x3ea0ad,_0x3ea0ad['name']),_0x152cbd&&_0x24fabc['append']('attributes',JSON['stringify'](_0x152cbd));const _0xdebd3c=this['_sendApiRequest']('/conversations/'+_0x3bad7a+'/files','POST',_0x24fabc);return{'getId':async()=>(await _0xdebd3c['request'])['json'](),'abortController':_0xdebd3c['abortController']};}['fetchDocument'](_0x2c4de5,_0x5b3c35){const _0x350766=this['_sendApiRequest']('/conversations/'+_0x2c4de5+'/documents/'+_0x5b3c35,'GET');return{'getDocument':async()=>(await _0x350766['request'])['json'](),'abortController':_0x350766['abortController']};}['uploadDocument'](_0x204cf9,_0x30c59e,_0x266c55){const _0x1a392e={'content':_0x30c59e};_0x266c55&&(_0x1a392e['attributes']=_0x266c55);const _0x3f394b=this['_sendApiRequest']('/conversations/'+_0x204cf9+'/documents','POST',_0x1a392e);return{'getId':async()=>(await _0x3f394b['request'])['json'](),'abortController':_0x3f394b['abortController']};}['uploadDocuments'](_0x482f71,_0x418e8b){const _0x2a4fd2={'documents':_0x418e8b['map'](_0x549ea8=>({'content':_0x549ea8['content'],'attributes':{'version':_0x549ea8['version'],'sessionId':_0x549ea8['sessionId'],'channelId':_0x549ea8['channelId'],'rootName':_0x549ea8['rootName'],'selections':_0x549ea8['selections']},...void 0x0!==_0x549ea8['name']?{'name':_0x549ea8['name']}:{},...void 0x0!==_0x549ea8['description']?{'description':_0x549ea8['description']}:{}}))},_0x169aaa=this['_sendApiRequest']('/conversations/'+_0x482f71+'/documents/batch','POST',_0x2a4fd2);return{'getIds':async()=>(await _0x169aaa['request'])['json'](),'abortController':_0x169aaa['abortController']};}['fetchDocuments'](_0x2861d7,_0x817bd6){const _0x251971=new URLSearchParams();_0x251971['append']('documentIds',_0x817bd6['join'](','));const _0x2fa227=this['_sendApiRequest']('/conversations/'+_0x2861d7+'/documents/batch?'+_0x251971['toString'](),'GET');return{'getDocuments':async()=>(await _0x2fa227['request'])['json'](),'abortController':_0x2fa227['abortController']};}['fetchConversations'](_0x47fd80,_0x1ea291={}){const _0x1712e0=new URLSearchParams();_0x1712e0['append']('group',_0x47fd80),_0x1712e0['append']('excludeEmpty',!0x1!==_0x1ea291['excludeEmpty']?'true':'false'),_0x1712e0['append']('limit',_0x1ea291['limit']?_0x1ea291['limit']['toString']():'100'),_0x1712e0['append']('sortBy',_0x1ea291['sortBy']?_0x1ea291['sortBy']:'createdAt'),_0x1712e0['append']('order',_0x1ea291['order']?_0x1ea291['order']:'desc');const _0x4fcf1f=this['_sendApiRequest']('/conversations?'+_0x1712e0['toString'](),'GET');return{'getConversations':async()=>{const _0x580771=await _0x4fcf1f['request'];return(await _0x580771['json']())['items'];},'abortController':_0x4fcf1f['abortController']};}['deleteConversation'](_0x357309){const _0x30977c=this['_sendApiRequest']('/conversations/'+_0x357309,'DELETE');return{'execute':async()=>{await _0x30977c['request'];},'abortController':_0x30977c['abortController']};}['updateConversation'](_0x12c9dc,_0x2f476d){const _0x103402=this['_sendApiRequest']('/conversations/'+_0x12c9dc,'PATCH',_0x2f476d);return{'getResult':async()=>(await _0x103402['request'],_0x2f476d),'abortController':_0x103402['abortController']};}['fetchConversation'](_0x40b110){const _0x555a9e=this['_sendApiRequest']('/conversations/'+_0x40b110,'GET');return{'getConversation':async()=>(await _0x555a9e['request'])['json'](),'abortController':_0x555a9e['abortController']};}['fetchConversationMessages'](_0x2bf20e){const _0x25c8da=this['_sendApiRequest']('/conversations/'+_0x2bf20e+'/messages','GET');return{'getMessages':async()=>{const _0x4cbd22=await _0x25c8da['request'];return(await _0x4cbd22['json']())['items'];},'abortController':_0x25c8da['abortController']};}['uploadUrl'](_0x1d646a,_0x2044cc,_0x185d70){const _0xd7ba3=this['_sendApiRequest']('/conversations/'+_0x1d646a+'/web-resources','POST',{'url':_0x2044cc,'attributes':_0x185d70});return{'getId':async()=>(await _0xd7ba3['request'])['json'](),'abortController':_0xd7ba3['abortController']};}['getModels'](_0x361f61='en'){const _0x3b2f93=new URLSearchParams();_0x3b2f93['append']('language',_0x361f61);const _0x503fde='/models/1?'+_0x3b2f93['toString'](),_0x21cccb=this['_sendApiRequest'](_0x503fde,'GET',void 0x0,!0x0);return{'list':async()=>await(await _0x21cccb['request'])['json'](),'abortController':_0x21cccb['abortController']};}['deleteFile'](_0x47ce9f,_0x34cab6){const _0x47fe0e=this['_sendApiRequest']('/conversations/'+_0x47ce9f+'/files/'+_0x34cab6,'DELETE');return{'execute':async()=>{await _0x47fe0e['request'];},'abortController':_0x47fe0e['abortController']};}['deleteDocument'](_0x4c37c1,_0x3961c6){const _0x1c940c=this['_sendApiRequest']('/conversations/'+_0x4c37c1+'/documents/'+_0x3961c6,'DELETE');return{'execute':async()=>{await _0x1c940c['request'];},'abortController':_0x1c940c['abortController']};}['deleteWebResource'](_0x1f7bdb,_0x4a194f){const _0x155987=this['_sendApiRequest']('/conversations/'+_0x1f7bdb+'/web-resources/'+_0x4a194f,'DELETE');return{'execute':async()=>{await _0x155987['request'];},'abortController':_0x155987['abortController']};}['callSystemReview']({reviewName:_0xeb810e,content:_0x39fe4a,args:_0x5ad36e}){const _0x5e4d38=this['_sendApiRequest']('/reviews/system/'+_0xeb810e+'/calls','POST',{'content':[{'type':'text','content':_0x39fe4a}],'args':_0x5ad36e});return{'getStream':async()=>{const _0x4e755b=(await _0x5e4d38['request'])['body'];return this['_getStreamReader'](_0x4e755b);},'abortController':_0x5e4d38['abortController']};}['callCustomReview']({content:_0x39e94a,prompt:_0x595a1c,model:_0x330d9d}){const _0x20874f=this['_sendApiRequest']('/reviews/custom/calls','POST',{'content':[{'type':'text','content':_0x39e94a}],'prompt':_0x595a1c,'model':_0x330d9d});return{'getStream':async()=>{const _0x1d6e12=(await _0x20874f['request'])['body'];return this['_getStreamReader'](_0x1d6e12);},'abortController':_0x20874f['abortController']};}['upsertAIChatRating'](_0xe518f3,_0x21460f,_0x2f5844){const _0x35f399=this['_sendApiRequest']('/conversations/'+_0xe518f3+'/messages/'+_0x21460f+'/ratings','PUT',{'positiveCount':_0x2f5844['positiveCount'],'totalCount':_0x2f5844['totalCount'],'modificationId':_0x2f5844['modificationId']});return{'execute':async()=>{await _0x35f399['request'];},'abortController':_0x35f399['abortController']};}['upsertAIActionRating'](_0x289564,_0x509dbc,_0x5aaf29){const _0x13929a=this['_sendApiRequest']('/actions/system/'+_0x289564+'/calls/'+_0x509dbc+'/ratings','PUT',{'positiveCount':_0x5aaf29['positiveCount'],'totalCount':_0x5aaf29['totalCount']});return{'execute':async()=>{await _0x13929a['request'];},'abortController':_0x13929a['abortController']};}['upsertCustomAIActionRating'](_0x30459e,_0xfdea2f){const _0x5be50b=this['_sendApiRequest']('/actions/custom/calls/'+_0x30459e+'/ratings','PUT',{'positiveCount':_0xfdea2f['positiveCount'],'totalCount':_0xfdea2f['totalCount']});return{'execute':async()=>{await _0x5be50b['request'];},'abortController':_0x5be50b['abortController']};}['upsertAIReviewRating'](_0x32da76,_0x3dc634,_0x3c3594,_0x2213c1){const _0x45527b=this['_sendApiRequest']('/reviews/system/'+_0x32da76+'/calls/'+_0x3dc634+'/ratings','PUT',{'positiveCount':_0x3c3594['positiveCount'],'totalCount':_0x3c3594['totalCount'],'dataId':_0x2213c1});return{'execute':async()=>{await _0x45527b['request'];},'abortController':_0x45527b['abortController']};}['upsertCustomAIReviewRating'](_0x377a68,_0x42bea2,_0x1b7c8e){const _0x35a22c=this['_sendApiRequest']('/reviews/custom/calls/'+_0x377a68+'/ratings','PUT',{'positiveCount':_0x42bea2['positiveCount'],'totalCount':_0x42bea2['totalCount'],'dataId':_0x1b7c8e});return{'execute':async()=>{await _0x35a22c['request'];},'abortController':_0x35a22c['abortController']};}['_sendApiRequest'](_0x5e1255,_0x1fdd36,_0x177d7d,_0x34d58e=!0x1){const _0x20b9fd=new AbortController(),_0x576b8e=_0x34d58e?_0x1fdd36+':'+_0x5e1255:null;if(_0x576b8e){const _0x58569f=this['_responseCache']['get'](_0x576b8e);if(_0x58569f)return{'request':_0x58569f['then'](_0x5de47c=>_0x5de47c['clone']()),'abortController':_0x20b9fd};}const _0x4eb14b=_0x177d7d instanceof FormData,_0x59feae={'Authorization':'Bearer\x20'+this['_token']?.['value'],'x-feature-flags':'multi-document','X-Editor-Version':mt};_0x177d7d&&!_0x4eb14b&&(_0x59feae['Content-Type']='application/json');const _0x43056e={'method':_0x1fdd36,'headers':_0x59feae,'signal':_0x20b9fd['signal']};_0x177d7d&&(_0x43056e['body']=_0x4eb14b?_0x177d7d:JSON['stringify'](_0x177d7d));const _0x2ff0bf=fetch(''+this['_apiUrl']+_0x5e1255,_0x43056e)['catch'](_0x17fc95=>{_0x576b8e&&this['_responseCache']['delete'](_0x576b8e),this['_handleError'](_0x17fc95);})['then'](_0x429ac3=>_0x429ac3['ok']?_0x429ac3:_0x429ac3['json']()['then'](_0x2ebcb0=>{throw _0x576b8e&&this['_responseCache']['delete'](_0x576b8e),{'url':this['_apiUrl'],'path':_0x5e1255,'method':_0x1fdd36,'body':_0x177d7d,'status':(_0x429ac3||{})['status'],'statusText':(_0x429ac3||{})['statusText'],'code':_0x2ebcb0['code'],'message':_0x2ebcb0['message'],'traceId':_0x2ebcb0['traceId']};}));return _0x576b8e&&this['_responseCache']['set'](_0x576b8e,_0x2ff0bf['then'](_0x4f713c=>_0x4f713c['clone']())),{'request':_0x2ff0bf,'abortController':_0x20b9fd};}async*['_getStreamReader'](_0x502e18){const _0x584cc8=[],_0x552401=_0x502e18['getReader'](),_0x54624d=_0x55d513({'onError':_0x5ed4d7=>{this['_handleError'](_0x5ed4d7);},'onEvent':_0x3c3282=>{_0x3c3282['data']=JSON['parse'](_0x3c3282['data']),_0x584cc8['push'](_0x3c3282);}});try{let _0x3ab510=!0x1;for(;!_0x3ab510;){const {done:_0x39f42d,value:_0x25ab48}=await _0x552401['read']();_0x39f42d&&(_0x3ab510=!0x0),_0x54624d['feed'](this['_decoder']['decode'](_0x25ab48,{'stream':!0x0})),yield*_0x584cc8,_0x584cc8['length']=0x0;}}catch(_0x3c7e0e){this['_handleError'](_0x3c7e0e);}finally{_0x552401['releaseLock'](),_0x54624d['reset']();}}['_handleError'](_0xa43137){if(_0xa43137 instanceof at)throw _0xa43137;if(_0xa43137 instanceof Error&&'AbortError'===_0xa43137['name'])throw new at('ai-request-aborted',this,{'originalError':_0xa43137});throw new at('ai-request-failed',this,{'originalError':_0xa43137});}}function hs(_0x3c488b,_0x121e24,_0x318d72){const t=_0x3c488b['t'];switch(_0x121e24){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'},_0x318d72);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.'},_0x318d72);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.'},_0x318d72);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.'},_0x318d72);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'},_0x318d72);case'AI_CHAT_SUGGESTION_ACTION_SUGGEST':return t({'id':'AI_CHAT_SUGGESTION_ACTION_SUGGEST','string':'Suggest'},_0x318d72);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'},_0x318d72);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.'},_0x318d72);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.'},_0x318d72);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.'},_0x318d72);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.'},_0x318d72);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'},_0x318d72);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.'},_0x318d72);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 _0x121e24;}}const cs='ck-ai-button-primary',ls='ck-ai-button-secondary',us='ck-ai-button-tertiary';function ds(_0x2e6742,_0xc38e42){const _0x3e5f35=new Nt(_0x2e6742),_0x3cab9e=hs(_0x2e6742,'AI_TABS_LABEL_MINIMIZE'),_0x5d9e38=hs(_0x2e6742,'AI_TABS_LABEL_MAXIMIZE');return _0x3e5f35['set']({'withText':!0x1,'icon':_0x276d69,'tooltip':!0x0,'class':'ck-ai-tabs__resize\x20'+us}),_0x3e5f35['bind']('label')['to'](_0xc38e42,'isMaximized',_0x40e5b2=>_0x40e5b2?_0x3cab9e:_0x5d9e38),_0x3e5f35['bind']('icon')['to'](_0xc38e42,'isMaximized',_0x3ea40d=>_0x3ea40d?_0x570af1:_0x276d69),_0x3e5f35['bind']('isOn')['to'](_0xc38e42,'isMaximized'),_0x3e5f35['on']('execute',()=>{_0xc38e42['fire']('resizeTabs');}),_0x3e5f35;}function _s(_0x2f046c){return _0x3f6dfb(_0x2f046c);}function gs(_0x14bc4d){return ti(_0x14bc4d);}function As(_0x3f9de9,_0x25c6e7,_0x589c5f){const _0x31ca0c=null!==_0x25c6e7?_0x318556=>_0x318556['attribs'][_0x3f9de9]===_0x25c6e7:_0x140d3c=>Boolean(_0x140d3c['attribs'][_0x3f9de9]);return _0x2da362(_0xc68a1e=>_0x30b8f4(_0xc68a1e)&&_0x31ca0c(_0xc68a1e),_0x589c5f);}function Is(_0x2b8d06,_0x498a7a,_0x1b37e1){const _0x58db11=null!==_0x498a7a?_0x16ef83=>_0x16ef83['attribs'][_0x2b8d06]===_0x498a7a:_0x4751d4=>Boolean(_0x4751d4['attribs'][_0x2b8d06]);return _0x5bd49b(_0xaa8f42=>_0x30b8f4(_0xaa8f42)&&_0x58db11(_0xaa8f42),_0x1b37e1);}function Es(_0x45afe2,_0x56f809){return _0x45afe2&&_0x30b8f4(_0x45afe2)?_0x45afe2['attribs'][_0x56f809]:null;}function ps(_0x55f7d8,_0x1c2ea8,_0x316ef9){_0x30b8f4(_0x55f7d8)&&(null===_0x316ef9?delete _0x55f7d8['attribs'][_0x1c2ea8]:_0x55f7d8['attribs'][_0x1c2ea8]=_0x316ef9);}function ms(_0x52da86,_0x1b0f52,_0x7fa9d5){const _0x43f12d=_0x1b0f52['cloneNode'](!0x0);'beforebegin'===_0x7fa9d5?_0x5014cb(_0x52da86,_0x43f12d):'afterbegin'===_0x7fa9d5?_0x26fbb4(_0x52da86,_0x43f12d):'beforeend'===_0x7fa9d5?_0x2cee60(_0x52da86,_0x43f12d):'afterend'===_0x7fa9d5&&_0x2cc319(_0x52da86,_0x43f12d);}function Ts(_0x5a0dbb){const _0xb0e80a=[];let _0x30cff6=_0x5a0dbb;for(;_0x30cff6;)_0x30cff6=_0x32dbd8(_0x30cff6),_0x30cff6&&_0xb0e80a['push'](_0x30cff6);return _0xb0e80a;}function Cs(_0x376964){return _0x376964['replace'](/^\s+/gm,'')['replace'](/\s+$/gm,'')['replace'](/\n*/g,'')['replace'](/\s+/g,'\x20')['replace'](/>\s*</g,'><');}function ws(_0x19f260){let _0x5a690c=0x0;for(;_0x19f260['parentNode'];)_0x19f260=_0x19f260['parentNode'],_0x5a690c++;return _0x5a690c;}function fs(_0xedff3f){const _0x79d276=[];let _0x1e358f=_0xedff3f['nextSibling'];for(;_0x1e358f;)_0x79d276['push'](_0x1e358f),_0x1e358f=_0x1e358f['nextSibling'];_0x79d276['forEach'](_0x57cb62=>{_0x565d3d(_0x57cb62);});}class bs extends/* #__PURE__ -- @preserve */
|
|
25
|
-
ht(){['_m2html'];constructor(){super();const
|
|
26
|
-
ht(){['_generateUid'];['_uidCounter']=0x0;['_touchedNodesState']={'newIds':[],'modifiedIds':[],'removedIds':[],'invalidIds':[],'lastTouchedId':null};['_existingDataIds']=new Set();constructor(_0x2c3515){super(),this['_generateUid']=_0x2c3515||(()=>'e'+String(this['_uidCounter']++));}['merge'](_0x35d1cc,_0x4d02c7,_0x51d81a){this['_uidCounter']=0x0;const _0x15ced7=_0x35d1cc['cloneNode'](!0x0),_0x412eb5=_0x15ced7['childNodes'],_0x243c49=Array['from'](_0x412eb5)['filter'](_0x41d0a8=>!(0x3===_0x41d0a8['nodeType']&&''===gs(_0x41d0a8)['trim']())),_0x2f3385=_0x243c49['length'],_0x3e0c33=new Map();for(const _0x2b5efa of _0x243c49)_0x2b5efa&&_0x30b8f4(_0x2b5efa)&&void 0x0===_0x2b5efa['attribs']['data-id']&&ps(_0x2b5efa,'data-id','new-element');if(0x0===_0x4d02c7['childNodes']['length']){const _0xab60f8=[];return Is('data-id','new-element',_0x15ced7)['forEach'](_0x32b737=>{const _0x103d43=this['_generateUid']();ps(_0x32b737,'data-id',_0x103d43),_0xab60f8['push'](_0x103d43);}),this['_removeSpecialComments'](_0x15ced7),{'parsedContent':_0x15ced7,'newNodeIds':_0xab60f8,'modifiedNodeIds':[],'removedNodeIds':[],'newAnchorIds':_0x3e0c33};}_0x51d81a&&_0x51d81a['markUnstableElements']&&this['_markLastTagElementUnstable'](_0x15ced7),this['_touchedNodesState']['newIds']=[],this['_touchedNodesState']['modifiedIds']=[],this['_touchedNodesState']['removedIds']=[],this['_touchedNodesState']['invalidIds']=[],this['_touchedNodesState']['lastTouchedId']=null,this['_existingDataIds']=new Set(Is('data-id',null,_0x4d02c7)['map'](_0x1abe8c=>Es(_0x1abe8c,'data-id'))['filter'](_0xf6944a=>!!_0xf6944a));let _0xc61699=-0x1,_0x24d831=!0x1;for(let _0xb34c06=0x0;_0xb34c06<_0x2f3385;_0xb34c06++){const _0x230207=_0x243c49[_0xb34c06],_0x462bfa=_0x243c49[_0xb34c06+0x1];if(this['_isNewNode'](_0x230207)){if(-0x1===_0xc61699&&(_0xc61699=_0xb34c06),this['_markWrappedElements'](_0x230207),!this['_isNewNode'](_0x462bfa)){const [_0x485d51,_0x3438a4]=this['_findReferenceNode'](_0x230207,_0x24d831,_0x4d02c7);if(_0x485d51){const _0x5eb714=Array['from'](_0x243c49)['slice'](_0xc61699,_0xb34c06+0x1),_0x2442f2=Es(_0x485d51,'data-id');if(this['_insertNodes'](_0x485d51,_0x5eb714,_0x3438a4),_0x2442f2)for(const _0x45bb90 of _0x5eb714){const _0x57354a=Es(_0x45bb90,'data-id');_0x57354a&&_0x3e0c33['set'](_0x57354a,_0x2442f2);}_0xc61699=-0x1;}}}else{if(this['_isExistingContentComment'](_0x230207))_0x24d831=!0x0;else{if(this['_isExistingNode'](_0x230207)){const _0x517107=Es(_0x230207,'data-id');if(_0x517107&&this['_existingDataIds']['has'](_0x517107)){const _0x57c551=As('data-id',_0x517107,_0x4d02c7);this['_replaceNode'](_0x57c551,_0x230207);}}else{if(this['_isDelNode'](_0x230207)){const _0x1637db=this['_getNodeDataId'](_0x230207);!!As('data-id',_0x1637db,_0x15ced7)||this['_touchedNodesState']['removedIds']['push'](_0x1637db);}}}}}for(const _0x48cc15 of this['_touchedNodesState']['removedIds']){const _0x3a95f9=As('data-id',_0x48cc15,_0x4d02c7);_0x3a95f9&&this['_removeNode'](_0x3a95f9,_0x48cc15,_0x51d81a);}if(Is('data-id','new-element',_0x4d02c7)['forEach'](_0x3318b0=>{const _0x1272ce=this['_getUid'](_0x3318b0);ps(_0x3318b0,'data-id',_0x1272ce),this['_touchedNodesState']['newIds']['push'](_0x1272ce);}),this['_removeSpecialComments'](_0x4d02c7),_0x51d81a&&_0x51d81a['markUnstableElements']&&this['_markUnstableElements'](_0x4d02c7,_0x51d81a['markUnstableElementsDepth']||0x0),this['_processWrappedElements'](_0x4d02c7,_0x51d81a),_0x51d81a&&_0x51d81a['cutAfterLastChange']&&this['_touchedNodesState']['lastTouchedId']){const _0xb2357c=Is('data-id',this['_touchedNodesState']['lastTouchedId'],_0x4d02c7);let _0x233060=_0xb2357c[_0xb2357c['length']-0x1];for(;_0x233060;)fs(_0x233060),_0x233060=_0x233060['parentNode'];}return{'parsedContent':_0x4d02c7,'newNodeIds':this['_touchedNodesState']['newIds'],'modifiedNodeIds':this['_touchedNodesState']['modifiedIds'],'removedNodeIds':this['_touchedNodesState']['removedIds'],'newAnchorIds':_0x3e0c33};}['_insertNodes'](_0x3996f8,_0x145101,_0x143ce4){for(const _0x40acb1 of _0x145101){const _0x1c99c2=this['_getUid'](_0x40acb1);ps(_0x40acb1,'data-id',_0x1c99c2),this['_touchedNodesState']['newIds']['push'](_0x1c99c2),this['_touchedNodesState']['lastTouchedId']=_0x1c99c2;}const _0x30a236='afterbegin'===_0x143ce4||'afterend'===_0x143ce4?_0x145101['reverse']():_0x145101;for(const _0x20523c of _0x30a236)ms(_0x3996f8,_0x20523c,_0x143ce4);}['_replaceNode'](_0x71be,_0x2b9e1a){if(!_0x71be)return;if(_0x270e7a=_0x2b9e1a,Cs(gs(_0x71be))===Cs(gs(_0x270e7a)))return;var _0x270e7a;const _0x3c743c=this['_getUid'](_0x71be);ps(_0x2b9e1a,'data-id',_0x3c743c),this['_touchedNodesState']['modifiedIds']['push'](_0x3c743c),this['_touchedNodesState']['lastTouchedId']=_0x3c743c,_0x3ac4a2(_0x71be,_0x2b9e1a['cloneNode'](!0x0));}['_removeNode'](_0x46e535,_0x4ce403,_0x3f8d20){if(_0x3f8d20&&_0x3f8d20['replaceRemovedWith']){this['_touchedNodesState']['lastTouchedId']=_0x4ce403;const _0xc6cba2=_0x3f8d20['replaceRemovedWith']['cloneNode'](!0x0);ps(_0xc6cba2,'data-id',_0x4ce403),ps(_0xc6cba2,'data-removed','true'),_0x3ac4a2(_0x46e535,_0xc6cba2);}else _0x565d3d(_0x46e535);}['_findReferenceNode'](_0x3b6640,_0x5b5524,_0x4d9f90){const _0x382053=this['_findPrevElementWithDataId'](_0x3b6640,!0x1);if(_0x382053){const _0x4af9d1=this['_getNodeDataId'](_0x382053),_0x365b58=As('data-id',_0x4af9d1,_0x4d9f90);if(_0x365b58)return[_0x365b58,'afterend'];this['_touchedNodesState']['invalidIds']['push'](_0x4af9d1);}const _0x459333=this['_findNextElementWithDataId'](_0x3b6640,!0x1);if(_0x459333){const _0x2db8e8=this['_getNodeDataId'](_0x459333),_0x169d86=As('data-id',_0x2db8e8,_0x4d9f90);if(_0x169d86)return[_0x169d86,'beforebegin'];this['_touchedNodesState']['invalidIds']['push'](_0x2db8e8);}return _0x5b5524?_0x3b6640['nextSibling']?this['_findFallbackReferenceNode'](_0x3b6640,_0x4d9f90):[_0x4d9f90['childNodes'][_0x4d9f90['childNodes']['length']-0x1],'afterend']:[_0x4d9f90['childNodes'][0x0],'beforebegin'];}['_findFallbackReferenceNode'](_0x34f90d,_0x8ca442){const _0x49bda9=[],_0x2bf1dd=this['_findPrevElementWithDataId'](_0x34f90d,!0x0);if(_0x2bf1dd){const _0x2b9771=As('data-id',this['_getNodeDataId'](_0x2bf1dd),_0x8ca442);_0x2b9771&&_0x49bda9['push']([_0x2b9771,'afterend']);}const _0x1bf3d1=this['_findNextElementWithDataId'](_0x34f90d,!0x0);if(_0x1bf3d1){const _0x3188a2=As('data-id',this['_getNodeDataId'](_0x1bf3d1),_0x8ca442);_0x3188a2&&_0x49bda9['push']([_0x3188a2,'beforebegin']);}if(_0x49bda9['length']>0x1)return ws(_0x49bda9[0x0][0x0])<=ws(_0x49bda9[0x1][0x0])?_0x49bda9[0x0]:_0x49bda9[0x1];return 0x1===_0x49bda9['length']?_0x49bda9[0x0]:[_0x8ca442['lastChild'],'afterend'];}['_findNextElementWithDataId'](_0x249aca,_0x9e95e3){let _0x3140dc=_0x249aca['nextSibling'],_0x5eed0f=null,_0x33ab8b=!0x1;for(;_0x3140dc;){if(_0x238c43(_0x3140dc)){if(this['_isDelNode'](_0x3140dc)&&(_0x5eed0f=_0x3140dc),this['_isExistingContentComment'](_0x3140dc)&&_0x9e95e3&&!_0x33ab8b){_0x33ab8b=!0x0,_0x3140dc=_0x3140dc['nextSibling'];continue;}break;}const _0x409419=Es(_0x3140dc,'data-id');if(_0x409419&&'new-element'!==_0x409419&&this['_existingDataIds']['has'](_0x409419)){_0x5eed0f=_0x3140dc;break;}_0x3140dc=_0x3140dc['nextSibling'];}return _0x5eed0f;}['_findPrevElementWithDataId'](_0x1348bd,_0x4f0c15){let _0x345497=_0x1348bd['previousSibling'],_0x195270=null,_0x56dd51=!0x1;for(;_0x345497;){if(_0x238c43(_0x345497)){if(this['_isDelNode'](_0x345497)&&(_0x195270=_0x345497),this['_isExistingContentComment'](_0x345497)&&_0x4f0c15&&!_0x56dd51){_0x56dd51=!0x0,_0x345497=_0x345497['previousSibling'];continue;}break;}const _0x1b125c=Es(_0x345497,'data-id');if(_0x1b125c&&'new-element'!==_0x1b125c&&this['_existingDataIds']['has'](_0x1b125c)){_0x195270=_0x345497;break;}_0x345497=_0x345497['previousSibling'];}return _0x195270;}['_markWrappedElements'](_0x171f03){_0x30b8f4(_0x171f03)&&Is('data-id',null,_0x171f03)['forEach'](_0x55c01e=>{this['_isExistingNode'](_0x55c01e)&&(ps(_0x55c01e,'data-wrapped-id',Es(_0x55c01e,'data-id')),ps(_0x55c01e,'data-id',null));});}['_processWrappedElements'](_0x195bd6,_0x1debe3){Is('data-wrapped-id',null,_0x195bd6)['forEach'](_0x3e71a6=>{const _0x5d60d7=Es(_0x3e71a6,'data-wrapped-id');if(Es(_0x3e71a6,'data-unstable')||this['_hasUnstableParent'](_0x3e71a6))return;const _0x5817b6=As('data-id',_0x5d60d7,_0x195bd6);ps(_0x3e71a6,'data-id',_0x5d60d7),ps(_0x3e71a6,'data-wrapped-id',null),_0x5817b6&&(this['_removeNode'](_0x5817b6,_0x5d60d7,_0x1debe3),this['_touchedNodesState']['removedIds']['push'](_0x5d60d7),this['_touchedNodesState']['lastTouchedId']=_0x5d60d7);});}['_hasUnstableParent'](_0x4070d6){let _0x2502ec=_0x4070d6['parentNode'];for(;_0x2502ec;){if(Es(_0x2502ec,'data-unstable'))return!0x0;_0x2502ec=_0x2502ec['parentNode'];}return!0x1;}['_getNodeDataId'](_0xd0c9c4){if(!_0xd0c9c4)return null;if(_0x30b8f4(_0xd0c9c4))return Es(_0xd0c9c4,'data-id');if(_0x238c43(_0xd0c9c4)){const _0x4babf4=gs(_0xd0c9c4)['match'](/removed[\s*-]data-id="([^"]+)"/);if(_0x4babf4&&_0x4babf4[0x1])return _0x4babf4[0x1];}return null;}['_getUid'](_0x1d4d91){return this['_isExistingNode'](_0x1d4d91)?Es(_0x1d4d91,'data-id'):this['_generateUid']();}['_removeSpecialComments'](_0x2759e0){(function(_0x53e4d5){return _0x7f7f1b(_0x433b7b=>_0x238c43(_0x433b7b),_0x53e4d5,!0x0,0x1/0x0);}(_0x2759e0)['filter'](_0x12f6b1=>this['_isDelNode'](_0x12f6b1)||this['_isExistingContentComment'](_0x12f6b1))['forEach'](_0x2d672b=>{_0x565d3d(_0x2d672b);}));}['_markLastTagElementUnstable'](_0x5e29fc){const _0x4f119e=_0x5e29fc['childNodes'],_0x38c8e4=_0x4f119e[_0x4f119e['length']-0x1];_0x38c8e4&&_0x30b8f4(_0x38c8e4)&&ps(_0x38c8e4,'data-unstable','true');}['_markUnstableElements'](_0x3f0b8b,_0x1af589){const _0x1d4515=As('data-unstable','true',_0x3f0b8b);if(!_0x1d4515)return;const _0x1d473f=Ts(_0x1d4515)['slice'](0x0,-0x1),_0x467504=_0x1d473f['length'];let _0xd1151d=_0x1d4515;if(_0x467504>_0x1af589){let _0x3e6906=_0x467504,_0x353cb6=null;for(;_0x3e6906>_0x1af589&&_0x3e6906>=0x0;)_0x3e6906--,_0x353cb6=_0x1d473f[_0x3e6906];_0x353cb6&&(_0xd1151d=_0x353cb6,ps(_0x1d4515,'data-unstable',null),ps(_0x353cb6,'data-unstable','true'));}else{if(_0x467504<_0x1af589){let _0x24c4dd=_0x467504,_0x22e0db=_0x1d4515;for(;_0x24c4dd<_0x1af589;){const _0x186174=_0x22e0db['childNodes']['filter'](_0x435329=>_0x30b8f4(_0x435329));if(0x0===_0x186174['length'])break;_0x24c4dd++,_0x22e0db=_0x186174[_0x186174['length']-0x1];}_0x22e0db&&(_0xd1151d=_0x22e0db,ps(_0x1d4515,'data-unstable',null),ps(_0x22e0db,'data-unstable','true'));}}let _0x437f74=_0xd1151d;for(;_0x437f74;){for(;_0x437f74['nextSibling'];)_0x437f74=_0x437f74['nextSibling'],_0x30b8f4(_0x437f74)&&ps(_0x437f74,'data-unstable','true');_0x437f74=_0x437f74['parentNode'];}}['_isNewNode'](_0x45b7c7){return Boolean('new-element'===Es(_0x45b7c7,'data-id'));}['_isExistingNode'](_0x363087){return Boolean((Es(_0x363087,'data-id')||'')['length']>0x0&&'new-element'!==Es(_0x363087,'data-id'));}['_isDelNode'](_0x143990){return!!_0x143990&&Boolean(_0x238c43(_0x143990)&&gs(_0x143990)['match'](/removed[\s*-]data-id="[^"]+"/));}['_isExistingContentComment'](_0x4e803d){return Boolean(_0x238c43(_0x4e803d)&&gs(_0x4e803d)['match'](/\s*existing[\s*-](content|document)\s*/g));}}function Rs({editor:_0x5c31cc,changeGroups:_0x2b12fc,documentContextContent:_0x13e2b3,showDiff:_0x4be663,trimUnchanged:_0x3e05ac=!0x0}){return _0x2b12fc['map'](_0x454d15=>{const _0x593bb3=new _0x4bac9c([]),_0x144e20=new _0x4bac9c([]),_0x1aac6a=new Set();for(const _0x32553d of _0x454d15['changes'])'new'==_0x32553d['type']&&Is('data-id',null,_0x32553d['node'])['forEach'](_0x1f6bba=>{_0x1aac6a['add'](Es(_0x1f6bba,'data-id'));});for(const _0x7cbb83 of _0x454d15['changes'])if('removed'!=_0x7cbb83['type']?_0x144e20['children']['push'](_0x7cbb83['node']['cloneNode'](!0x0)):_0x4be663||_0x1aac6a['has'](_0x7cbb83['id'])||_0x144e20['children']['push'](_0x7cbb83['node']['cloneNode'](!0x0)),'new'!=_0x7cbb83['type']&&(_0x4be663||'removed'!=_0x7cbb83['type'])){const _0x3b9ff4=_0x2da362(_0x52ccf1=>Es(_0x52ccf1,'data-id')==_0x7cbb83['id'],_0x13e2b3,!0x0);_0x3b9ff4&&_0x593bb3['children']['push'](_0x3b9ff4['cloneNode'](!0x0));}const {content:_0x2bb9a0,hasChanges:_0x2f4620}=function(_0x598670,_0x45ebc7,_0x4e246f,_0x5c127b,_0x14a5ea=!0x0){const _0x1d9249=_0x598670['plugins']['get']('DocumentCompare'),_0x8fea42=gs(_0x45ebc7),_0x38745d=gs(_0x4e246f),_0xb1b6e1=_0x598670['data']['parse'](_0x8fea42,'$root'),_0x1cf33=_0x598670['model']['createPositionAt'](_0xb1b6e1,0x0),_0x49e04a=_0x1d9249['getDiff'](_0x8fea42,_0x38745d,{'anchor':_0x1cf33,'markDeletions':_0x5c127b,'targetEditor':_0x598670}),_0x5836f3=_0x49e04a['getOperations']();if(0x0==_0x5836f3['length'])return{'content':_0x45ebc7['cloneNode'](!0x0),'hasChanges':!0x1};_0x5c127b?function(_0x5cee95,_0x5deabe,_0x1398a1){if(0x0==_0x5cee95['length'])return;const _0x25cf09=_0x1398a1['plugins']['get']('DocumentCompare'),_0x5b6e7e=_0x1398a1['plugins']['get']('SuggestionsConversion');_0x1398a1['model']['change'](_0xf27f80=>{const _0xb12579=new Set();for(let _0x3ca061=0x0;_0x3ca061<_0x5cee95['length'];_0x3ca061++){const _0x35dcca=_0x5cee95[_0x3ca061];if(_0x35dcca['baseVersion']=null,_0x35dcca['isDocumentOperation']=!0x1,_0x25cf09['isMarkedRemoveOperation'](_0x35dcca)){const _0x2ca196=_0x56faff(_0x35dcca['newRange'],_0x1398a1['model']),_0xd868c8='suggestion:deletion:'+ot()+':$aiSuggestion';_0x5deabe['markers']['set'](_0xd868c8,_0x2ca196);}else switch(_0x35dcca['type']){case'rename':{if(_0x35dcca['oldName']==_0x35dcca['newName'])break;_0xf27f80['batch']['addOperation'](_0x35dcca),_0x1398a1['model']['applyOperation'](_0x35dcca);const _0xacaca5='$elementName',_0x2c7a18=_0x35dcca['position'],_0xa8d30a=_0x1398a1['model']['createRange'](_0x2c7a18,_0x1398a1['model']['createPositionAt'](_0x2c7a18['nodeAfter'],'end')),_0x395c74='suggestion:attribute:'+_0xacaca5+':'+ot()+':$aiSuggestion';_0x5deabe['markers']['set'](_0x395c74,_0xa8d30a);break;}case'addAttribute':case'removeAttribute':case'changeAttribute':{if(_0x35dcca['oldValue']==_0x35dcca['newValue'])break;_0xf27f80['batch']['addOperation'](_0x35dcca),_0x1398a1['model']['applyOperation'](_0x35dcca);const _0x399782=_0x35dcca['key'];if(!_0x5b6e7e['isRegisteredAttribute'](_0x399782))break;const _0x5c73f8=_0x56faff(_0x35dcca['range'],_0x1398a1['model']),_0x12c346='suggestion:attribute:'+_0x399782+':'+ot()+':$aiSuggestion';_0x5deabe['markers']['set'](_0x12c346,_0x5c73f8);break;}case'insert':{_0xf27f80['batch']['addOperation'](_0x35dcca),_0x1398a1['model']['applyOperation'](_0x35dcca);if(_0x5cee95[_0x3ca061+0x1]&&'move'==_0x5cee95[_0x3ca061+0x1]['type']){Os(_0x5deabe,_0x35dcca);break;}const _0x4d6430=_0x35dcca['position'],_0x108005=_0x35dcca['howMany'],_0x1cb061=_0x56faff(_0x1398a1['model']['createRange'](_0x4d6430,_0x4d6430['getShiftedBy'](_0x108005)),_0x1398a1['model']),_0x87d1c0='suggestion:insertion:'+ot()+':$aiSuggestion';_0x5deabe['markers']['set'](_0x87d1c0,_0x1cb061);break;}case'split':{_0xf27f80['batch']['addOperation'](_0x35dcca),_0x1398a1['model']['applyOperation'](_0x35dcca);const _0x5580df=_0x35dcca['splitPosition'],_0x4850e7=_0x35dcca['moveTargetPosition'],_0xff85a=_0x1398a1['model']['createRange'](_0x5580df,_0x4850e7),_0x4f5526='suggestion:insertion:'+ot()+':$aiSuggestion';_0x5deabe['markers']['set'](_0x4f5526,_0xff85a);break;}case'move':{_0xf27f80['batch']['addOperation'](_0x35dcca),_0x1398a1['model']['applyOperation'](_0x35dcca),_0x5cee95[_0x3ca061-0x1]&&'insert'==_0x5cee95[_0x3ca061-0x1]['type']&&Os(_0x5deabe,_0x35dcca);const _0x2bda59=_0x35dcca['getMovedRangeStart'](),_0x43c726=_0x35dcca['howMany'];for(let _0x59184f=0x0;_0x59184f<_0x43c726;_0x59184f++){const _0x327c30=_0x2bda59['getShiftedBy'](_0x59184f)['nodeAfter'];_0xb12579['add'](_0x327c30);}break;}case'remove':{const _0x32738e=_0x35dcca['sourcePosition'],_0x10f19a=_0x35dcca['howMany'],_0x57bb13=new _0x5b32ba(_0x32738e,_0x10f19a);_0xf27f80['batch']['addOperation'](_0x57bb13),_0x1398a1['model']['applyOperation'](_0x57bb13);break;}}}for(const _0x1926a7 of _0xb12579){const _0x9de93b=_0x1398a1['model']['createRangeOn'](_0x1926a7),_0x5e6baa='suggestion:formatBlock:$fakeWrap:'+ot()+':$aiSuggestion';_0x5deabe['markers']['set'](_0x5e6baa,_0x56faff(_0x9de93b,_0x1398a1['model']));}});}(_0x5836f3,_0xb1b6e1,_0x598670):_0x598670['model']['change'](_0x1dcddd=>{for(const _0x1f989c of _0x5836f3)if('remove'==_0x1f989c['type']){const _0x3223c1=_0x1f989c['sourcePosition'],_0x3dfd64=_0x1f989c['howMany'],_0x475a05=new _0x5b32ba(_0x3223c1,_0x3dfd64);_0x1dcddd['batch']['addOperation'](_0x475a05),_0x598670['model']['applyOperation'](_0x475a05);}else{if('marker'==_0x1f989c['type']){const _0x33ff87=_0x1f989c['name'],_0x30ba2e=_0x1f989c['newRange'];null!==_0x30ba2e?_0xb1b6e1['markers']['set'](_0x33ff87,_0x30ba2e):_0xb1b6e1['markers']['delete'](_0x33ff87);}else _0x1f989c['baseVersion']=null,_0x1f989c['isDocumentOperation']=!0x1,_0x1dcddd['batch']['addOperation'](_0x1f989c),_0x598670['model']['applyOperation'](_0x1f989c);}});if(_0x14a5ea){const _0x543609=ks(_0x598670,_0x5836f3,_0xb1b6e1);Ns(_0x598670['model'],_0x543609),function(_0x3e52be,_0x12b3a1){const _0x41cfdf=_0x12b3a1['getFirstRange']()['start'];let _0x4de817=_0x12b3a1['getFirstRange']()['end'];const _0x878bdd=_0x41cfdf['root'];(_0x4de817['textNode']||_0x4de817['nodeAfter']&&_0x4de817['nodeAfter']['is']('$text'))&&(_0xbf4c53(_0x4de817,'...'),_0x4de817=_0x4de817['getShiftedBy'](0x3)),(_0x41cfdf['textNode']||_0x41cfdf['nodeBefore']&&_0x41cfdf['nodeBefore']['is']('$text'))&&(_0xbf4c53(_0x41cfdf,'...'),function(_0x98c65,_0x4beaa2,_0x34d729){for(let [_0x41f1fc,_0x3d0d81]of _0x98c65['markers']){const _0x453bdb=_0x3d0d81['_getTransformedByInsertion'](_0x4beaa2,_0x34d729,!0x1);_0x3d0d81=_0x453bdb[0x0],_0x98c65['markers']['set'](_0x41f1fc,_0x3d0d81);}}(_0x878bdd,_0x41cfdf,0x3),_0x41cfdf['parent']==_0x4de817['parent']&&(_0x4de817=_0x4de817['getShiftedBy'](0x3)));const _0x3371f1=_0x3e52be['createRange'](_0x3e52be['createPositionAt'](_0x878bdd,0x0),_0x41cfdf),_0x5c05d6=_0x3e52be['createRange'](_0x4de817,_0x3e52be['createPositionAt'](_0x878bdd,'end')),_0xd0dc4b=[..._0x3371f1['getMinimalFlatRanges'](),..._0x5c05d6['getMinimalFlatRanges']()];_0xd0dc4b['reverse']();for(const _0x16fd82 of _0xd0dc4b)_0x24d713(_0x16fd82),ys(_0x878bdd,_0x16fd82);}(_0x598670['model'],_0x543609);}const _0x4bffbb=_0x598670['data']['stringify'](_0xb1b6e1,{'showSuggestionHighlights':!0x0});return{'content':_s(_0x4bffbb),'hasChanges':!0x0};}(_0x5c31cc,_0x593bb3,_0x144e20,_0x4be663,_0x3e05ac);return{'type':_0x454d15['changes'][0x0]['type'],'index':_0x454d15['index'],'content':_0x2bb9a0,'hasChanges':_0x2f4620};});}function Os(_0x1d4dfd,_0x301c3e){for(const [_0x4d2a53,_0x3072ac]of _0x1d4dfd['markers']){const _0x478fd4=_0x49ae78['_createFromRanges'](_0x3072ac['getTransformedByOperation'](_0x301c3e));_0x1d4dfd['markers']['set'](_0x4d2a53,_0x478fd4);}}function ks(_0x213e78,_0x46aa94,_0x44149d){const _0x35536f=_0x213e78['plugins']['get']('DocumentCompare');let _0x13a07c=_0x213e78['model']['createPositionAt'](_0x44149d,Number['POSITIVE_INFINITY']),_0x3a6906=_0x213e78['model']['createPositionAt'](_0x44149d,0x0);for(const _0x49901f of _0x46aa94){let _0x57a880,_0x2f93c4;if(_0x35536f['isMarkedRemoveOperation'](_0x49901f))_0x57a880=_0x49901f['newRange']['start'],_0x2f93c4=_0x49901f['newRange']['end'];else switch(_0x13a07c=_0x13a07c['getTransformedByOperation'](_0x49901f),_0x3a6906=_0x3a6906['getTransformedByOperation'](_0x49901f),_0x49901f['type']){case'rename':_0x57a880=_0x49901f['position'],_0x2f93c4=_0x57a880['getShiftedBy'](0x1);break;case'addAttribute':case'removeAttribute':case'changeAttribute':_0x57a880=_0x49901f['range']['start'],_0x2f93c4=_0x49901f['range']['end'];break;case'insert':_0x57a880=_0x49901f['position'],_0x2f93c4=_0x57a880['getShiftedBy'](_0x49901f['howMany']);break;case'split':_0x57a880=_0x49901f['splitPosition'],_0x2f93c4=_0x49901f['moveTargetPosition'];break;case'merge':{const _0x335054=_0x49901f['targetPosition']['path']['slice'](0x0,-0x1);_0x57a880=_0x213e78['model']['createPositionFromPath'](_0x44149d,_0x335054),_0x2f93c4=_0x57a880['getShiftedBy'](0x1);break;}case'move':case'remove':{const _0x3febc0=_0x49901f['howMany'],_0x55e58e=_0x49901f['sourcePosition']['_getTransformedByInsertion'](_0x49901f['targetPosition'],_0x3febc0),_0xd6d519=_0x49901f['getMovedRangeStart']();'remove'==_0x49901f['type']?(_0x57a880=_0x55e58e,_0x2f93c4=_0x55e58e):(_0x57a880=_0xd6d519,_0x2f93c4=_0xd6d519['getShiftedBy'](_0x3febc0));break;}}_0x57a880&&_0x57a880['isBefore'](_0x13a07c)&&(_0x13a07c=_0x57a880['clone'](),_0x13a07c['stickiness']='toNone'),_0x2f93c4&&_0x2f93c4['isAfter'](_0x3a6906)&&(_0x3a6906=_0x2f93c4['clone'](),_0x3a6906['stickiness']='toNone');}return _0x213e78['model']['createSelection'](_0x213e78['model']['createRange'](_0x13a07c,_0x3a6906));}function Ns(_0x35bd7b,_0x23345c){vs(_0x35bd7b,_0x23345c,'forward');const _0x5a4f40=_0x23345c['getFirstRange']();_0x23345c['setTo']([]),_0x23345c['setTo'](_0x5a4f40,{'backward':!0x0}),vs(_0x35bd7b,_0x23345c,'backward');}function vs(_0x1e2c4c,_0x2112f9,_0x4d5ec7){let _0x36302f=0x14;for(;_0x36302f;){_0x1e2c4c['modifySelection'](_0x2112f9,{'unit':'word','direction':_0x4d5ec7}),_0x36302f--;const _0x1fe50a=_0x2112f9['focus']['forward'==_0x4d5ec7?'nodeBefore':'nodeAfter'];if(_0x1fe50a&&_0x1fe50a['is']('element')&&_0x1e2c4c['schema']['isBlock'](_0x1fe50a)&&_0x1e2c4c['schema']['isObject'](_0x1fe50a))break;}}function ys(_0x34b9fa,_0x4ab816){for(const [_0x182372,_0x47277b]of _0x34b9fa['markers']){const _0xfcc233=_0x47277b['_getTransformedByDeletion'](_0x4ab816['start'],_0x4ab816['end']['offset']-_0x4ab816['start']['offset']);null!=_0xfcc233?_0x34b9fa['markers']['set'](_0x182372,_0xfcc233):_0x34b9fa['markers']['delete'](_0x182372);}}class xs extends ht(){['id'];['interactionId'];['type'];['sources']=[];['parsedContent']=new _0x4bac9c([]);['parsedMergedContent']=new _0x4bac9c([]);['changeGroups']=[];['areActionsDisabled']=!0x1;['isFromHistory']=!0x1;['documentContextContent'];['documentId'];['dataIdDocumentSources'];['newNodeAnchorIds']=new Map();['aiResponseParser'];['aiResponseApplier'];['locale'];['cachedSuggestionContentParts']={'withDiff':[],'withoutDiff':[]};constructor({type:_0x278726,content:_0x59e6e0='',isDone:_0x2f6bbd=!0x1,isComplete:_0x8e180c,interactionId:_0x587f95,areActionsDisabled:_0x13d522,isFromHistory:_0x59cce8=!0x1,documentContextContent:_0x55a6df,dataIdDocumentSources:_0x461f19,documentId:_0x57330e,locale:_0x29886a,id:_0x3b1cfb}){super(),this['id']=_0x3b1cfb||ot(),this['interactionId']=_0x587f95,this['type']=_0x278726,this['areActionsDisabled']=!!_0x13d522,this['locale']=_0x29886a,this['dataIdDocumentSources']=_0x461f19,this['documentId']=_0x57330e,this['isFromHistory']=_0x59cce8,this['aiResponseParser']=new bs(),this['aiResponseApplier']=new Ss(),this['documentContextContent']=_s(_0x55a6df||''),this['set']('isDone',_0x2f6bbd),this['set']('isComplete',_0x8e180c??_0x2f6bbd),this['on']('change:content',()=>{this['onContentChange']();}),this['set']('content',_0x59e6e0);}['appendContent'](_0x73fc8f){this['set']('content',this['content']+_0x73fc8f);}['done'](_0x2447fa=!0x0){this['isComplete']=_0x2447fa,this['isDone']||(this['set']('isDone',!0x0),this['onContentChange']());}['destroy'](){this['stopListening']();}['setChangeGroupState'](_0x5b94c5,_0x43c527){this['changeGroups'][_0x5b94c5]['state']=_0x43c527,this['fire']('replyChangeGroupStateUpdated',{'reply':this,'index':_0x5b94c5,'state':_0x43c527});}['getContentParts']({showDiff:_0x5a8479,groupIndex:_0x500a32,editor:_0x3aa6c2}){const _0x54eddb=this['_getCachedContentParts'](_0x5a8479,_0x500a32);if(_0x54eddb)return _0x54eddb;let _0x1cd63b=[];if(void 0x0===_0x500a32)_0x1cd63b=this['changeGroups'];else{const _0x579f24=this['changeGroups']['find'](({index:_0x1861e5})=>_0x1861e5===_0x500a32);if(!_0x579f24)throw new at('ai-reply-get-content-parts-group-not-found',null,{'aiReply':this,'groupIndex':_0x500a32});_0x1cd63b=[_0x579f24];}const _0x490b59=Rs({'editor':_0x3aa6c2,'showDiff':_0x5a8479,'changeGroups':_0x1cd63b,'documentContextContent':this['documentContextContent']});return this['_setCachedContentParts'](_0x5a8479,_0x490b59),_0x490b59;}['_getCachedContentParts'](_0x15bd1a,_0x58506f){const _0x3da8b7=_0x15bd1a?'withDiff':'withoutDiff';if(!this['cachedSuggestionContentParts'][_0x3da8b7]['length'])return null;const _0x3668fd=this['cachedSuggestionContentParts'][_0x3da8b7];if(void 0x0===_0x58506f)return _0x3668fd['length']>0x0&&_0x3668fd['length']!==this['changeGroups']['length']?(this['_setCachedContentParts'](_0x15bd1a,null),null):_0x18249f(_0x3668fd);{const _0x40efa7=_0x3668fd['find'](({index:_0x137768})=>_0x137768===_0x58506f);if(_0x40efa7)return[_0x18249f(_0x40efa7)];}return null;}['_setCachedContentParts'](_0x42cda1,_0x50f591){const _0x34e6b5=_0x42cda1?'withDiff':'withoutDiff';_0x50f591?_0x50f591['forEach'](_0x2392bf=>{const _0x5a100b=this['cachedSuggestionContentParts'][_0x34e6b5],_0x52b9f5=_0x5a100b['find'](({index:_0x42792e})=>_0x42792e===_0x2392bf['index']);if(_0x52b9f5){const _0x2fe6a9=_0x5a100b['indexOf'](_0x52b9f5);_0x5a100b['splice'](_0x2fe6a9,0x1,_0x2392bf);}else _0x5a100b['push'](_0x2392bf);}):this['cachedSuggestionContentParts'][_0x34e6b5]['length']=0x0;}['onContentChange'](){if('modification'===this['type']){this['parsedContent']=this['aiResponseParser']['parseAndNormalizeHTML'](this['content']);const _0xcef089=this['changeGroups'];this['updateChangeGroups']();const _0x31c490=this['_getDifferentChangeGroups'](_0xcef089,this['changeGroups']);(_0x31c490['length']||this['isDone'])&&(this['fire']('replyContentUpdated',this,_0x31c490),this['cachedSuggestionContentParts']['withDiff']['length']=this['cachedSuggestionContentParts']['withoutDiff']['length']=0x0);}else this['parsedContent']=this['aiResponseParser']['convertMarkdownToHTML'](this['content']),this['fire']('replyContentUpdated',this);}['_getDifferentChangeGroups'](_0x94970b,_0x37c15d){const _0x19c607=[];for(const _0x13fac1 of _0x37c15d){const _0xbf27d1=_0x94970b[_0x13fac1['index']];_0xbf27d1?_0xbf27d1['changes']['length']!==_0x13fac1['changes']['length']?_0x19c607['push'](_0x13fac1):_0xbf27d1['changes']['forEach']((_0x16694b,_0x541445)=>{const _0x3c4858=_0x13fac1['changes'][_0x541445];_0x16694b['id']!==_0x3c4858['id']&&_0x19c607['push'](_0x13fac1);}):_0x19c607['push'](_0x13fac1);}return _0x19c607;}['updateChangeGroups'](){const _0x657979=this['locale']?new _0x47c6a6('p',{},[new _0x47c6a6('span',{'style':'color:\x20#808080;\x20font-style:\x20italic'},[new _0x41b5f7(hs(this['locale'],'AI_SUGGESTION_CONTENT_PART_REMOVED'))])]):void 0x0,_0x283d94=this['aiResponseApplier']['merge'](this['parsedContent'],this['documentContextContent']['cloneNode'](!0x0),{'markUnstableElements':!this['isDone']||!this['isComplete'],'replaceRemovedWith':_0x657979,'cutAfterLastChange':!this['isDone']||!this['isComplete']});if(!_0x283d94['modifiedNodeIds']['length']&&!this['isDone'])return;this['parsedMergedContent']=_0x283d94['parsedContent'],this['newNodeAnchorIds']=_0x283d94['newAnchorIds'];let _0x333215=[];if(_0x5bd49b(_0x171f5f=>{const _0x36f288=Es(_0x171f5f,'data-id');if(!_0x36f288||!_0x17e793(_0x36f288))return!0x1;const _0x24cb9b=[_0x171f5f,...Ts(_0x171f5f)]['at'](-0x2);if(_0x171f5f!=_0x24cb9b){const _0x2e674c=Es(_0x24cb9b,'data-id');_0x17e793(_0x2e674c)||(_0x333215['push']({'node':_0x24cb9b,'id':_0x2e674c,'type':'modified'}),_0x283d94['modifiedNodeIds']['push'](_0x2e674c));}else _0x283d94['modifiedNodeIds']['includes'](_0x36f288)?_0x333215['push']({'node':_0x171f5f,'type':'modified','id':_0x36f288}):_0x283d94['newNodeIds']['includes'](_0x36f288)?_0x333215['push']({'node':_0x171f5f,'type':'new','id':_0x36f288,'anchorId':Es(_0x171f5f['previousSibling'],'data-id')}):_0x333215['push']({'node':_0x171f5f,'type':'removed','id':_0x36f288});return!0x0;},this['parsedMergedContent']),_0x333215=_0x333215['filter'](({node:_0x166c96})=>[...Ts(_0x166c96),_0x166c96]['every'](_0x40b260=>!Es(_0x40b260,'data-unstable'))),0x0==_0x333215['length'])return;const _0x8a7fd3=[[_0x333215[0x0]]];for(let _0x514abb=0x1;_0x514abb<_0x333215['length'];_0x514abb++){const _0x5c7136=_0x8a7fd3[_0x8a7fd3['length']-0x1],_0xf8290=_0x5c7136[_0x5c7136['length']-0x1];_0x333215[_0x514abb]['node']['previousSibling']==_0xf8290['node']&&'modified'!=_0x333215[_0x514abb]['type']&&'modified'!=_0xf8290['type']&&this['_isSameDocument'](_0x333215[_0x514abb]['node'],_0xf8290['node'])?_0x5c7136['push'](_0x333215[_0x514abb]):_0x8a7fd3['push']([_0x333215[_0x514abb]]);}for(const _0x239980 of _0x8a7fd3){const _0x295245=_0x239980[0x0],_0x40b0f4=_0x239980[_0x239980['length']-0x1],_0x35b144=_0x574df7(_0x295245['node']['previousSibling']);_0x35b144&&this['_isSameDocument'](_0x35b144['node'],_0x295245['node'])&&_0x239980['unshift'](_0x35b144);const _0x326fc9=_0x574df7(_0x40b0f4['node']['nextSibling']);_0x326fc9&&this['_isSameDocument'](_0x326fc9['node'],_0x40b0f4['node'])&&_0x239980['push'](_0x326fc9);}function _0x17e793(_0x1c4ca6){return _0x283d94['modifiedNodeIds']['includes'](_0x1c4ca6)||_0x283d94['newNodeIds']['includes'](_0x1c4ca6)||_0x283d94['removedNodeIds']['includes'](_0x1c4ca6);}function _0x574df7(_0x2ded4d){if(_0x2ded4d&&Es(_0x2ded4d,'data-id')&&!Es(_0x2ded4d,'data-unstable')){const _0xf4ba83=Es(_0x2ded4d,'data-id');if(!_0x17e793(_0xf4ba83))return{'node':_0x2ded4d,'type':'context','id':_0xf4ba83};}return null;}this['changeGroups']=_0x8a7fd3['map']((_0x416a47,_0x3687ed)=>({'changes':_0x416a47,'state':'pending','index':_0x3687ed}));}['_isSameDocument'](_0x40756c,_0x1fbdba){if(!this['dataIdDocumentSources']?.['size'])return!0x0;const _0x1c0b65=this['_resolveDocumentSource'](_0x40756c),_0x2a3cca=this['_resolveDocumentSource'](_0x1fbdba);return!_0x1c0b65||!_0x2a3cca||_0x1c0b65['editor']===_0x2a3cca['editor']&&_0x1c0b65['rootName']===_0x2a3cca['rootName'];}['_resolveDocumentSource'](_0x373ef9){if(!_0x373ef9||!this['dataIdDocumentSources'])return;const _0x4134f7=Es(_0x373ef9,'data-id');if(_0x4134f7){const _0x50843f=this['dataIdDocumentSources']['get'](_0x4134f7);if(_0x50843f)return _0x50843f;const _0x1de030=this['newNodeAnchorIds']['get'](_0x4134f7),_0x8cc71a=_0x1de030?this['dataIdDocumentSources']['get'](_0x1de030):void 0x0;if(_0x8cc71a)return _0x8cc71a;}for(let _0x3a2c38=_0x373ef9['previousSibling'];_0x3a2c38;_0x3a2c38=_0x3a2c38['previousSibling']){const _0x5d3828=Es(_0x3a2c38,'data-id'),_0x3fc73c=_0x5d3828?this['dataIdDocumentSources']['get'](_0x5d3828):void 0x0;if(_0x3fc73c)return _0x3fc73c;}for(let _0x47b7db=_0x373ef9['nextSibling'];_0x47b7db;_0x47b7db=_0x47b7db['nextSibling']){const _0x3cbdd9=Es(_0x47b7db,'data-id'),_0x23148c=_0x3cbdd9?this['dataIdDocumentSources']['get'](_0x3cbdd9):void 0x0;if(_0x23148c)return _0x23148c;}}}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:_0x40b27a,locale:_0x4447fd}){super(),this['id']=ot(),this['connector']=_0x40b27a,this['isStopped']=!0x0,this['locale']=_0x4447fd;}async['start'](){const _0x5d3b34=[];let _0x2f1ad6,_0x4b0688,_0xf13d09,_0x893009=!0x1;this['isStopped']=!0x1;try{this['currentRequest']=await this['sendRequest'](),this['fire']('interactionStarted',this);const _0xc07b2c=await this['currentRequest']['getStream']();for await(const _0x237e4a of _0xc07b2c){if(this['isStopped'])return;if('error'==_0x237e4a['event'])return void this['fire']('error',{'error':new at('ai-chat-interaction-error',this)});switch(_0x237e4a['event']){case'message-metadata':this['messageId']=_0x237e4a['data']['messageId'];break;case'action-metadata':this['actionCallId']=_0x237e4a['data']['callId'];break;case'conversation-title':this['setConversationTitle'](_0x237e4a['data']['conversationTitle'],!0x0);break;case'source':_0x5d3b34['push'](_0x237e4a['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'](),_0x2f1ad6='modification-delta'==_0x237e4a['event']?'modification':'text',_0x4b0688='modification-delta'==_0x237e4a['event']?_0x237e4a['data']['id']:void 0x0,this['currentReply']&&this['currentReply']['type']!=_0x2f1ad6&&(this['currentReply']['done'](),this['currentReply']=void 0x0),this['currentReply']?'modification-delta'==_0x237e4a['event']&&(this['currentReply']['documentId']=_0x237e4a['data']['documentId']):(this['currentReply']=this['createReply']({'type':_0x2f1ad6,'interactionId':this['id'],'id':_0x4b0688,...'modification-delta'==_0x237e4a['event']&&{'documentId':_0x237e4a['data']['documentId']}}),'modification'==_0x2f1ad6&&(this['currentReply']['sources']=_0x5d3b34['splice'](0x0))),this['currentReply']['appendContent'](_0x237e4a['data']['textDelta']);break;case'mcp-tool-result':_0xf13d09=JSON['parse'](_0x237e4a['data']['result']),this['_handleToolResultData']({'toolName':_0x237e4a['data']['toolName'],'data':_0xf13d09['data'],'attributes':_0xf13d09['attributes']});break;case'mcp-tool-notification':this['_handleToolNotificationData']({'toolName':_0x237e4a['data']['toolName'],'data':_0x237e4a['data']['data']});}}_0x893009=!0x0;}finally{this['isStopped']||(this['currentReply']&&_0x5d3b34['length']>0x0&&(this['currentReply']['sources']=_0x5d3b34['splice'](0x0)),this['_finalizeInteraction'](_0x893009),this['fire']('interactionFinished',this));}}['stop'](){this['isStopped']||(this['_finalizeInteraction'](),this['fire']('interactionStopped',this));}['getReply'](_0x585008){return this['replies']['find'](_0x5f3e70=>_0x5f3e70['id']===_0x585008);}['destroy'](){this['isDestroyed']||(this['stop'](),this['replies']['forEach'](_0x3ed2d7=>_0x3ed2d7['destroy']()),this['replies']=[],this['isDestroyed']=!0x0,this['fire']('interactionDestroyed',this),this['stopListening']());}['createReply'](_0x2165bc){const _0x230ded=new xs({'locale':this['locale'],'documentContextContent':this['getDocumentContext']()?.['content'],'dataIdDocumentSources':this['getDocumentContext']()?.['dataIdDocumentSources'],..._0x2165bc});return this['replies']['push'](_0x230ded),_0x230ded['delegate'](...Ls)['to'](this),this['fire']('replyCreated',_0x230ded),_0x230ded;}['setConversationTitle'](_0xbee774,_0x1fda4b=!0x1){this['fire']('setConversationTitle',_0xbee774,_0x1fda4b);}['resetWebSearchState'](){this['_isWebSearching']&&(this['_isWebSearching']=!0x1,this['fire']('webSearchFinished',this));}['resetReasoningState'](){this['_isReasoning']&&(this['_isReasoning']=!0x1,this['fire']('reasoningFinished',this));}['_handleToolResultData'](_0x5b489f){this['fire']('toolDataReceived',{'type':'result','toolName':_0x5b489f['toolName'],'data':structuredClone(_0x5b489f['data']||{}),'attributes':structuredClone(_0x5b489f['attributes']||{})},this);}['_handleToolNotificationData'](_0x3de05c){this['fire']('toolDataReceived',{'type':'notification','toolName':_0x3de05c['toolName'],'data':structuredClone(_0x3de05c['data'])},this);}['_finalizeInteraction'](_0x290f9f=!0x1){this['isStopped']=!0x0,this['currentRequest']&&this['currentRequest']['abortController']['abort'](),this['currentReply']&&this['currentReply']['done'](_0x290f9f),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:_0x5d7bf9,config:_0x3fc67f,ownerId:_0x96f512}){super(),this['_connector']=_0x5d7bf9,this['_config']=_0x3fc67f,this['_ownerId']=_0x96f512;}['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'](_0x19602c){if(_0x19602c)return this['_documentSources']['get'](_0x19602c);}['getSourceByDataId'](_0x419ee0){if(_0x419ee0)return this['_dataIdToSource']['get'](_0x419ee0);}['_getDocumentContextSlice'](_0x335a10){const _0xd1483=this['_getDocumentSource'](_0x335a10);if(_0xd1483)return{'editor':_0xd1483['editor'],'rootName':_0xd1483['rootName'],'html':_0xd1483['content'],'version':_0xd1483['version']};}['getDocumentContextSliceByDataId'](_0x1ed576){const _0x20c3ff=this['getSourceByDataId'](_0x1ed576);return _0x20c3ff?this['_getDocumentContextSlice'](_0x20c3ff['documentId']):void 0x0;}['getPendingContextItems'](){return this['_pendingContextItems'];}async['populateFromMessage'](_0x4b8fba){const _0x4588e6=await this['_createContextItemFromContent'](_0x4b8fba);return this['_addToConversationContextItem'](_0x4588e6),'current-document'===_0x4588e6['uiId']&&this['_toggleAddCurrentDocumentOptionVisibility'](),_0x4588e6;}async['populateDocumentsFromMessage'](_0x4c577d,_0x29f1d3){const _0x55462d=_0x4c577d['filter'](_0x38abc2=>'document'===_0x38abc2['type']);if(0x0===_0x55462d['length'])return{'hasUnmatched':!0x1};if(0x1===_0x55462d['length'])return{'contextItem':await this['populateFromMessage'](_0x55462d[0x0]),'hasUnmatched':!0x1};const _0x153f67=_0x55462d['map'](_0x3e9dbb=>_0x3e9dbb['id']),_0x415c9f=await this['_connector']['fetchDocuments'](this['_ownerId'],_0x153f67)['getDocuments'](),_0x198e27=new Map(_0x415c9f['map'](_0x5d4676=>[_0x5d4676['id'],_0x5d4676]));this['_documentSources']['clear'](),this['_dataIdToSource']['clear']();const _0x29397d=[];let _0x1d7170=!0x1;for(const _0x1c1fc0 of _0x55462d){const _0x462684=_0x198e27['get'](_0x1c1fc0['id']);if(!_0x462684)continue;const _0x2eec44=this['_matchDocumentToRoot'](_0x462684,_0x29f1d3),_0x5e4528=_0x29f1d3[0x0]&&this['_getFirstRoot'](_0x29f1d3[0x0]);_0x2eec44||(_0x1d7170=!0x0);const _0xa0750=_0x2eec44?.['editor']??_0x5e4528?.['editor'],_0x4ebe7a=_0x2eec44?.['rootName']??_0x5e4528?.['rootName'];if(_0xa0750&&_0x4ebe7a){const _0x1ebabf={'editor':_0xa0750,'rootName':_0x4ebe7a,'content':_0x462684['content'],'version':_0x462684['attributes']?.['version']??0x0,'name':_0x462684['name'],'description':_0x462684['description']};this['_documentSources']['set'](_0x462684['id'],_0x1ebabf);const _0x46ab8b=_s(_0x462684['content']);for(const _0x1ba000 of _0x5bd49b(_0x46ef75=>!!Es(_0x46ef75,'data-id'),_0x46ab8b)){const _0x1fd231=Es(_0x1ba000,'data-id');_0x1fd231&&this['_dataIdToSource']['set'](_0x1fd231,{..._0x1ebabf,'documentId':_0x462684['id']});}}_0x29397d['push']({'id':_0x462684['id'],'content':_0x462684['content'],'version':_0x462684['attributes']?.['version']??0x0,'sessionId':_0x462684['attributes']?.['sessionId']??null,'selection':[]});}const _0x585f8c={'id':'current-document','uiId':'current-document','label':'Current\x20document','type':'document','hidden':this['_conversationContextItems']['has']('current-document'),'documents':_0x29397d,'dataIdDocumentSources':new Map(this['_dataIdToSource'])};return this['_addToConversationContextItem'](_0x585f8c),this['_toggleAddCurrentDocumentOptionVisibility'](),{'contextItem':_0x585f8c,'hasUnmatched':_0x1d7170};}['_matchDocumentToRoot'](_0x4982a9,_0x3e3d70){const _0x216222=_0x4982a9['attributes']?.['channelId'],_0x96e0f8=_0x4982a9['attributes']?.['rootName'];if(_0x216222&&_0x96e0f8){for(const _0x426f25 of _0x3e3d70)if(_0x426f25['config']['get']('collaboration.channelId')===_0x216222){for(const _0x2748c5 of _0x426f25['model']['document']['getRoots']())if('$graveyard'!==_0x2748c5['rootName']&&_0x2748c5['rootName']===_0x96e0f8)return{'editor':_0x426f25,'rootName':_0x2748c5['rootName']};}}}['_getFirstRoot'](_0x3460e8){for(const _0x59d01e of _0x3460e8['model']['document']['getRoots']())if('$graveyard'!==_0x59d01e['rootName'])return{'editor':_0x3460e8,'rootName':_0x59d01e['rootName']};}async['_createContextItemFromContent'](_0x54681f){if('document'===_0x54681f['type']){const _0x2b2908=await this['_connector']['fetchDocument'](this['_ownerId'],_0x54681f['id'])['getDocument']();return{'id':'current-document','uiId':'current-document','label':'Current\x20document','type':_0x54681f['type'],'content':_0x2b2908['content'],'hidden':this['_conversationContextItems']['has']('current-document'),'version':_0x2b2908['attributes']?.['version'],'sessionId':_0x2b2908['attributes']?.['sessionId']};}if('mcp-tool-context'===_0x54681f['type'])return{'id':_0x54681f['id'],'uiId':_0x54681f['id'],'label':_0x54681f['data']?.['label']||_0x54681f['id'],'type':'mcp-tool-context','mcpServerName':_0x54681f['mcpServerName'],'toolName':_0x54681f['toolName'],'data':_0x54681f['data']||{}};return{'id':_0x54681f['id'],'uiId':_0x54681f['id'],'label':_0x54681f['attributes']?.['label']||_0x54681f['name']||_0x54681f['url']||_0x54681f['id'],'type':_0x54681f['type'],..._0x54681f?.['attributes']?.['resourceId']?{'resourceId':_0x54681f['attributes']?.['resourceId']}:{}};}['getSentContextItems'](){return new Map(this['_conversationContextItems']);}['removeFromContext'](_0x1f0b5c){const _0x2af74c=this['_pendingContextItems']['get'](_0x1f0b5c);_0x2af74c?.['isReadOnly']||this['_removeContextItem'](_0x1f0b5c);}['clearPendingContextItems'](){if(0x0===this['_pendingContextItems']['size'])return;for(const _0x5b1b3a of this['_pendingContextItems']['values']())this['_removeContextItem'](_0x5b1b3a['uiId']);const _0x131f93=this['_conversationContextItems']['get']('current-document')||this['_pendingContextItems']['get']('current-document');_0x131f93&&this['_addContextItem']({..._0x131f93,'isReadOnly':!0x0,'hidden':!0x0});}['addToConversationContext'](_0x5761bf){for(const _0x4c6f80 of _0x5761bf['values']())this['_addToConversationContextItem'](_0x4c6f80);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'](_0x5e1dfa){return Array['from'](_0x5e1dfa['values']())['flatMap'](_0x1cd6af=>this['_mapContextItemToRequestData'](_0x1cd6af));}async['addFilesToContext'](_0x145f24,_0x20eca8,_0xa01fc5='file'){const _0x122edb='files-'+ot();this['_startUploadOperation'](_0x122edb);try{await Promise['all'](_0x145f24['map'](async _0x2bb88d=>{const _0x5d31a2='file-'+ot(),_0x498d86=_0x56a9e5(_0x2bb88d['name']);try{this['_addContextItem']({'type':_0xa01fc5,'label':_0x20eca8?.['label']||_0x498d86,'uiId':_0x5d31a2,'resourceId':_0x20eca8?.['resourceId']},!0x0);const _0x5b2de5=this['_connector']['uploadFile'](this['_ownerId'],_0x2bb88d,_0x20eca8);this['_ongoingUploads']['set'](_0x5d31a2,_0x5b2de5['abortController']);const {id:_0x1978ce}=await _0x5b2de5['getId']();this['_ongoingUploads']['delete'](_0x5d31a2),this['_finishContextItemLoading']({'type':_0xa01fc5,'id':_0x1978ce,'label':_0x20eca8?.['label']||_0x498d86,'uiId':_0x5d31a2,'resourceId':_0x20eca8?.['resourceId']},!0x1);}catch(_0x5260d4){this['_ongoingUploads']['delete'](_0x5d31a2);if(!(_0x5260d4 instanceof at&&_0x5260d4['message']['startsWith']('ai-request-aborted'))){const _0x579f56=Ps['get'](_0x5260d4['code'])||'ai-chat-file-upload-failed',_0x2ce8e8=new at(_0x579f56,null,{'fileName':_0x498d86,..._0x5260d4});_0x2ce8e8['stack']=_0x5260d4['stack'],this['fire']('error',{'error':_0x2ce8e8});}this['_removeContextItem'](_0x5d31a2);}}));}finally{this['_finishUploadOperation'](_0x122edb);}}['addCurrentDocumentToContext'](_0x4a946c){if(this['isCurrentDocumentInContext']()||!this['_addContextOptionsState']['document']['enabled'])return;const _0x2c2948={'type':'document','uiId':'current-document','label':_0x4a946c,'isReadOnly':this['_conversationContextItems']['has']('current-document'),'hidden':this['_conversationContextItems']['has']('current-document')};this['_addContextItem'](_0x2c2948);}async['updateCurrentDocument'](_0x375206,_0x52c8df,_0x127804,_0x306027,_0x20dad7,_0x4e9acc){const _0x22806=this['_pendingContextItems']['get']('current-document');if(_0x22806&&_0x375206){_0x22806['selection']=_0x4e9acc?_0x4e9acc['map'](_0xb8a3cb=>({'start':_0xb8a3cb['start'],'end':_0xb8a3cb['end']})):[];try{if(_0x22806['version']===_0x52c8df)return;const {id:_0x546078}=await this['_connector']['uploadDocument'](this['_ownerId'],_0x375206,{'version':_0x52c8df,'sessionId':_0x127804,'channelId':_0x306027,'rootName':_0x20dad7})['getId']();_0x22806['id']=_0x546078,_0x22806['content']=_0x375206,_0x22806['version']=_0x52c8df,_0x22806['sessionId']=_0x127804;}catch(_0x45fe79){const _0x49f458=new at('ai-chat-document-upload-failed',null);_0x49f458['stack']=_0x45fe79['stack'],this['fire']('error',{'error':_0x49f458});}}}async['updateCurrentDocuments'](_0x2a73c6){const _0x14fc11=this['_pendingContextItems']['get']('current-document');if(!_0x14fc11||!_0x2a73c6['length']||_0x2a73c6['every'](_0x4078f2=>!_0x4078f2['content']))return;_0x2a73c6['length']>0x1&&_0x2a73c6['some'](_0x151157=>!_0x151157['description'])&&It('ai-chat-documents-missing-description');const _0x27389f=_0x282fdf=>_0x282fdf?_0x282fdf['map'](_0x9220f7=>({'start':_0x9220f7['start'],'end':_0x9220f7['end']})):[],_0x36db8f=_0x14fc11['documents']??[];if(_0x36db8f['length']===_0x2a73c6['length']&&_0x2a73c6['every']((_0x16e000,_0x1424fd)=>_0x36db8f[_0x1424fd]?.['version']===_0x16e000['version']))_0x14fc11['documents']=_0x36db8f['map']((_0x2d4889,_0x1930e7)=>({..._0x2d4889,'selection':_0x27389f(_0x2a73c6[_0x1930e7]['selections'])}));else try{const _0x220929=await this['_connector']['uploadDocuments'](this['_ownerId'],_0x2a73c6)['getIds']();_0x14fc11['documents']=_0x2a73c6['map']((_0x251456,_0x12f71f)=>({'id':_0x220929[_0x12f71f]?.['id'],'content':_0x251456['content'],'version':_0x251456['version'],'sessionId':_0x251456['sessionId'],'selection':_0x27389f(_0x251456['selections'])})),this['_documentSources']['clear'](),this['_dataIdToSource']['clear']();for(let _0x4229a4=0x0;_0x4229a4<_0x2a73c6['length'];_0x4229a4++){const _0x4940a8=_0x220929[_0x4229a4]?.['id'],_0x2e244c=_0x2a73c6[_0x4229a4];if(!_0x4940a8)continue;const _0x301f19={'editor':_0x2e244c['editor'],'rootName':_0x2e244c['rootName'],'content':_0x2e244c['content'],'version':_0x2e244c['version'],'name':_0x2e244c['name'],'description':_0x2e244c['description']};this['_documentSources']['set'](_0x4940a8,_0x301f19);const _0x342379=_s(_0x2e244c['content']);for(const _0x4871b8 of _0x5bd49b(_0xc5ed6=>!!Es(_0xc5ed6,'data-id'),_0x342379)){const _0x1ffda0=Es(_0x4871b8,'data-id');_0x1ffda0&&this['_dataIdToSource']['set'](_0x1ffda0,{..._0x301f19,'documentId':_0x4940a8});}}_0x14fc11['dataIdDocumentSources']=new Map(this['_dataIdToSource']);}catch(_0x508c30){const _0x187c62=new at('ai-chat-document-upload-failed',null);_0x187c62['stack']=_0x508c30['stack'],this['fire']('error',{'error':_0x187c62});}}['addSelectionToContext'](_0x8bc2f){this['_addContextItem']({'type':'selection','label':_0x8bc2f,'uiId':'selection','content':_0x8bc2f});}['removeSelectionFromContext'](){this['_removeContextItem']('selection');}async['addUrlToContext'](_0x5125e5,_0x51b858){const _0x2dff74='url-'+ot();this['_startUploadOperation'](_0x2dff74);const _0x54239d='url-'+ot();try{this['_addContextItem']({'type':'web-resource','label':_0x51b858?.['label']||_0x5125e5,'uiId':_0x54239d,'resourceId':_0x51b858?.['resourceId']},!0x0);const _0x5a90af=this['_connector']['uploadUrl'](this['_ownerId'],_0x5125e5,_0x51b858);this['_ongoingUploads']['set'](_0x54239d,_0x5a90af['abortController']);const {id:_0x5b9545}=await _0x5a90af['getId']();this['_ongoingUploads']['delete'](_0x54239d),this['_finishContextItemLoading']({'type':'web-resource','id':_0x5b9545,'label':_0x51b858?.['label']||_0x5125e5,'uiId':_0x54239d,'resourceId':_0x51b858?.['resourceId']},!0x1);}catch(_0x508fdf){this['_ongoingUploads']['delete'](_0x54239d),(_0x508fdf['message']['startsWith']('ai-request-aborted')||this['fire']('error',{'error':new at('ai-chat-url-upload-failed',this,{'url':_0x5125e5,'originalError':_0x508fdf}),'url':_0x5125e5}),this['_removeContextItem'](_0x54239d));}finally{this['_finishUploadOperation'](_0x2dff74);}}['addToolItemToContext'](_0x5a3ab0){_0x5a3ab0['id']=_0x5a3ab0['id']??ot()['substring'](0x0,0x15),this['_pendingContextItems']['set'](_0x5a3ab0['uiId'],_0x5a3ab0),this['fire']('contextItemAdded',{'contextItem':_0x5a3ab0,'isLoading':!0x1});}async['loadSourceResources'](_0x1422be,_0x53577c,_0x4065aa){const _0x58326f=this['_addContextOptionsState']['sources']['find'](_0x5da3c8=>_0x5da3c8['id']===_0x1422be);if(!_0x58326f)return this['fire']('error',{'error':new at('ai-chat-source-not-found',this,{'sourceId':_0x1422be}),'sourceId':_0x1422be}),[];try{const _0x17afaa=(await _0x58326f['getResources'](_0x53577c))['map'](_0x3dd7d5=>{const _0x2b9ae6=this['_isResourceInContext'](_0x3dd7d5['id']);return{..._0x3dd7d5,'isInContext':_0x2b9ae6};});return _0x58326f['resources']=_0x17afaa,this['fire']('sourceResourcesLoaded',{'sourceId':_0x1422be,'source':_0x58326f,'resources':_0x17afaa,'uid':_0x4065aa}),_0x17afaa;}catch(_0x2dc92d){return this['fire']('error',{'error':new at('ai-chat-source-resources-load-failed',this,{'sourceId':_0x1422be,'originalError':_0x2dc92d}),'sourceId':_0x1422be,'sourceLabel':_0x58326f['label']}),[];}}async['addResourceToContext'](_0x38c4ae,_0x11661e){if(this['_isResourceInContext'](_0x11661e['id']))return;let _0x21dda4=_0x11661e['data'];if(!_0x21dda4&&_0x38c4ae['getData'])try{_0x21dda4=await _0x38c4ae['getData'](_0x11661e['id']);}catch(_0x35b5f9){return void this['fire']('error',{'error':new at('ai-chat-resource-load-failed',this,{'resourceId':_0x11661e['id'],'sourceId':_0x38c4ae['id'],'originalError':_0x35b5f9}),'resourceId':_0x11661e['id'],'sourceId':_0x38c4ae['id']});}if(_0x21dda4)switch(_0x11661e['type']){case'web-resource':if('string'!=typeof _0x21dda4)return void this['fire']('error',{'error':new at('ai-chat-context-invalid-data',this,{'resourceId':_0x11661e['id'],'sourceId':_0x38c4ae['id'],'expectedType':'string','actualType':typeof _0x21dda4}),'resourceId':_0x11661e['id'],'sourceId':_0x38c4ae['id']});await this['addUrlToContext'](_0x21dda4,{'label':_0x11661e['label'],'resourceId':_0x11661e['id']});break;case'file':if(!(_0x21dda4 instanceof File))return void this['fire']('error',{'error':new at('ai-chat-context-invalid-data',this,{'resourceId':_0x11661e['id'],'sourceId':_0x38c4ae['id'],'expectedType':'File','actualType':typeof _0x21dda4}),'resourceId':_0x11661e['id'],'sourceId':_0x38c4ae['id']});await this['addFilesToContext']([_0x21dda4],{'label':_0x11661e['label'],'resourceId':_0x11661e['id']});break;case'text':if('object'!=typeof _0x21dda4||!('content'in _0x21dda4)||!('type'in _0x21dda4))return void this['fire']('error',{'error':new at('ai-chat-context-invalid-data',this,{'resourceId':_0x11661e['id'],'sourceId':_0x38c4ae['id'],'expectedType':'object\x20with\x20content\x20and\x20type\x20properties','actualType':typeof _0x21dda4}),'resourceId':_0x11661e['id'],'sourceId':_0x38c4ae['id']});_0x21dda4=Ms['_convertTextResourceToFile'](_0x21dda4,_0x11661e['label']),await this['addFilesToContext']([_0x21dda4],{'label':_0x11661e['label'],'resourceId':_0x11661e['id']},'text');break;case'mcp-tool-context':break;default:this['fire']('error',{'error':new at('ai-chat-context-unsupported-type',this,{'resourceId':_0x11661e['id'],'sourceId':_0x38c4ae['id'],'resourceType':_0x11661e['type']}),'resourceId':_0x11661e['id'],'sourceId':_0x38c4ae['id']});}else this['fire']('error',{'error':new at('ai-chat-resource-no-data',this,{'resourceId':_0x11661e['id'],'sourceId':_0x38c4ae['id']}),'resourceId':_0x11661e['id'],'sourceId':_0x38c4ae['id']});}static['_convertTextResourceToFile'](_0x55dfc6,_0x307c4f){switch(_0x55dfc6['type']){case'markdown':return new File([_0x55dfc6['content']],_0x307c4f,{'type':'text/markdown'});case'html':return new File([_0x55dfc6['content']],_0x307c4f,{'type':'text/html'});default:return new File([_0x55dfc6['content']],_0x307c4f,{'type':'text/plain'});}}static['_mapContextItemToRequestData'](_0x5b7b29){switch(_0x5b7b29['type']){case'file':case'text':return[{'type':'file','id':_0x5b7b29['id']}];case'web-resource':return[{'type':'web-resource','id':_0x5b7b29['id']}];case'document':return _0x5b7b29['documents']?.['length']?_0x5b7b29['documents']['map'](_0x18ccc0=>({'type':'document','id':_0x18ccc0['id'],..._0x18ccc0['selection']?.['length']&&{'selection':_0x18ccc0['selection']}})):[{'type':'document','id':_0x5b7b29['id'],..._0x5b7b29['selection']?.['length']&&{'selection':_0x5b7b29['selection']}}];case'mcp-tool-context':{const _0xda6c51=_0x5b7b29;return[{'type':'mcp-tool-context','mcpServerName':_0xda6c51['mcpServerName'],'toolName':_0xda6c51['toolName'],'data':{..._0xda6c51['data'],'label':_0xda6c51['label']||_0xda6c51['data']?.['label']||_0xda6c51['id']},'id':_0xda6c51['id']}];}default:return[];}}['_addContextItem'](_0x4ca07b,_0x355682=!0x1){if(this['_pendingContextItems']['set'](_0x4ca07b['uiId'],_0x4ca07b),_0x4ca07b['hidden']||this['fire']('contextItemAdded',{'contextItem':_0x4ca07b,'isLoading':_0x355682}),'current-document'===_0x4ca07b['uiId']&&this['_toggleAddCurrentDocumentOptionVisibility'](),_0x4ca07b['resourceId']){const _0x1e55d7=this['_findSourceIdsByResourceId'](_0x4ca07b['resourceId']);_0x1e55d7&&_0x1e55d7['forEach'](_0x2bd2e0=>{this['_updateResourceInContextState'](_0x2bd2e0,_0x4ca07b['resourceId'],!0x0);});}}['_removeContextItem'](_0x135b4c){const _0x9f8c8c=this['_pendingContextItems']['get'](_0x135b4c),_0x45d94d=this['_ongoingUploads']['get'](_0x135b4c);if(_0x45d94d&&(_0x45d94d['abort'](),this['_ongoingUploads']['delete'](_0x135b4c)),_0x9f8c8c?.['resourceId']){const _0x589fa8=this['_findSourceIdsByResourceId'](_0x9f8c8c['resourceId']);_0x589fa8&&_0x589fa8['forEach'](_0x178b3b=>{this['_updateResourceInContextState'](_0x178b3b,_0x9f8c8c['resourceId'],!0x1);});}this['_pendingContextItems']['delete'](_0x135b4c),this['fire']('contextItemRemoved',{'uiId':_0x135b4c,'type':_0x9f8c8c?.['type']}),'current-document'===_0x135b4c&&this['_toggleAddCurrentDocumentOptionVisibility']();}['_finishContextItemLoading'](_0x2c131a,_0x177dbd){if(this['_pendingContextItems']['has'](_0x2c131a['uiId'])&&(this['_pendingContextItems']['set'](_0x2c131a['uiId'],_0x2c131a),this['fire']('contextItemLoadingEnded',{'contextItem':_0x2c131a,'isLoading':_0x177dbd}),_0x2c131a['resourceId'])){const _0x2d2ba8=this['_findSourceIdsByResourceId'](_0x2c131a['resourceId']);_0x2d2ba8&&_0x2d2ba8['forEach'](_0x32c26d=>{this['_updateResourceInContextState'](_0x32c26d,_0x2c131a['resourceId'],!0x0);});}}['_addToConversationContextItem'](_0x26e535){this['_conversationContextItems']['set'](_0x26e535['uiId'],_0x26e535);}['_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'](_0xda52d0=>({..._0xda52d0,'enabled':!0x0}))??[]},this['fire']('addContextOptionsChanged',{'options':this['_addContextOptionsState']});}['_getCustomSourcesInitialState'](){return this['_config']?.['sources']?.['map'](_0x24a3b4=>({..._0x24a3b4,'resources':[]}))??[];}['_toggleAddCurrentDocumentOptionVisibility'](){const _0x330fe0=this['isCurrentDocumentInContext']()||this['isCurrentDocumentInConversation']();this['_addContextOptionsState']['document']['isHidden']=_0x330fe0,this['fire']('addContextOptionsChanged',{'options':this['_addContextOptionsState']});}['_isResourceInContext'](_0x232274){for(const _0x3dbc9c of this['_pendingContextItems']['values']())if(_0x3dbc9c['resourceId']===_0x232274)return!0x0;for(const _0x94cf00 of this['_conversationContextItems']['values']())if(_0x94cf00['resourceId']===_0x232274)return!0x0;return!0x1;}['_findSourceIdsByResourceId'](_0x123f39){const _0x288330=[];for(const _0x1983f5 of this['_addContextOptionsState']['sources']){_0x1983f5['resources']['find'](_0x16bdee=>_0x16bdee['id']===_0x123f39)&&_0x288330['push'](_0x1983f5['id']);}return 0x0===_0x288330['length']?null:_0x288330;}['_updateResourceInContextState'](_0x3b406e,_0x46ae40,_0x4e1de5){const _0x513d08=this['_addContextOptionsState']['sources']['find'](_0x4995aa=>_0x4995aa['id']===_0x3b406e);if(!_0x513d08)return;const _0x546fe9=_0x513d08['resources']['find'](_0x2cc4bb=>_0x2cc4bb['id']===_0x46ae40);_0x546fe9&&(_0x546fe9['isInContext']=_0x4e1de5,this['fire']('resourceStateChanged',{'sourceId':_0x3b406e,'resourceId':_0x46ae40,'isInContext':_0x4e1de5}));}['_startUploadOperation'](_0x528a1c){this['_ongoingUploadOperations']['set'](_0x528a1c,!0x0),this['_ongoingUploadOperations']['size']&&this['fire']('uploadProgressChanged',{'isUploadInProgress':!0x0});}['_finishUploadOperation'](_0x2a875a){this['_ongoingUploadOperations']['delete'](_0x2a875a),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'](_0x36fdd1){const _0x5ef860={};return _0x36fdd1&&_0x36fdd1['isWebSearchEnabled']&&(_0x5ef860['webSearch']={}),_0x36fdd1&&_0x36fdd1['isReasoningEnabled']&&(_0x5ef860['reasoning']={}),_0x5ef860;}['toggleWebSearch'](){this['setWebSearch'](!this['_isWebSearchEnabled']);}['toggleReasoning'](){this['setReasoning'](!this['_isReasoningEnabled']);}['setWebSearch'](_0x336458){_0x336458!==this['_isWebSearchEnabled']&&(this['_isWebSearchEnabled']=_0x336458,this['fire']('capabilitiesUpdated',this['getCapabilitiesConfig']()));}['setReasoning'](_0x3553fd){_0x3553fd!==this['_isReasoningEnabled']&&(this['_isReasoningEnabled']=_0x3553fd,this['fire']('capabilitiesUpdated',this['getCapabilitiesConfig']()));}}class Bs extends Ds{['userMessage'];['conversationId'];['contextItems']=new Map();['capabilities'];['model'];['attributes'];constructor(_0x564ef1){super(_0x564ef1),this['conversationId']=_0x564ef1['conversationId'],this['contextItems']=_0x564ef1['contextItems'],this['capabilities']=_0x564ef1['capabilities'],this['userMessage']=_0x564ef1['userMessage'],this['model']=_0x564ef1['model'],this['attributes']=_0x564ef1['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'](_0xdf1202){const _0x242286=this['getDocumentContext']();if(_0x242286?.['documents']?.['length']){const _0x510854=_0x242286['documents']['map'](_0x230e09=>_0x230e09['content']??'')['join']('');if(_0x510854)return super['createReply']({'documentContextContent':_0x510854,..._0xdf1202});}return super['createReply'](_0xdf1202);}}class Gs extends Tt(){['id'];['isStarted']=!0x1;['isFromHistory'];['interactions']=[];['currentInteraction'];['selectedModel'];['connector'];['options'];constructor(_0x2c3445){super(),this['options']=_0x2c3445,this['connector']=_0x2c3445['connector'],this['chatModels']=_0x2c3445['chatModels'],this['id']=_0x2c3445['conversationId'],this['isFromHistory']=_0x2c3445['isFromHistory'];}async['init'](_0x331d7c){try{this['chatContext']=new Ms({'connector':this['connector'],'config':_0x331d7c,'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 _0x50cd38=await this['chatModels']['getAvailableModels']();this['fire']('conversationInitialized',{'availableModels':_0x50cd38});const _0x14df3b=await this['chatModels']['getModel'](this['options']['selectedModelId']);_0x14df3b&&await this['setModel'](_0x14df3b);}catch(_0x2431e9){const _0x38caa7=new at('ai-chat-conversation-init-failed',null,{'message':_0x2431e9['message']||_0x2431e9});_0x38caa7['stack']=_0x2431e9['stack'],this['fire']('error',{'error':_0x38caa7});}}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:_0x5c4e53}=await this['connector']['startConversation'](this['id'],this['options']['group'])['getConversation']();this['id']=_0x5c4e53,this['isStarted']=!0x0,this['fire']('conversationStarted',{'conversationId':this['id'],'selectedModel':this['selectedModel']});}catch(_0x355237){const _0x565ae1=new at('ai-chat-conversation-start-failed',null,{'message':_0x355237['message'],'conversationId':this['id']});throw _0x565ae1['stack']=_0x355237['stack'],this['fire']('error',{'error':_0x565ae1}),_0x565ae1;}}async['load'](_0x528faf,_0x5281c5){try{const _0x1182fa=await this['connector']['fetchConversation'](_0x528faf)['getConversation'](),_0x51fcfe=await this['connector']['fetchConversationMessages'](_0x528faf)['getMessages'](),_0x2b1796=_0x51fcfe[0x0]['model'];this['isStarted']=!0x0,this['id']=_0x1182fa['id'],'title'in _0x1182fa?this['fire']('setConversationTitle',_0x1182fa['title'],!0x0):this['fire']('setConversationTitle','',!0x0);const _0x218aa9=(await this['chatModels']['getAll']())['find'](_0x4d534a=>_0x4d534a['id']['toLowerCase']()===_0x2b1796['toLowerCase']());return this['selectedModel']=_0x218aa9,this['fire']('modelSelected',{'selectedModel':_0x218aa9,'isDisabled':!0x0}),await this['_processMessagesToInteractions'](_0x51fcfe,_0x5281c5,_0x2b1796),this['currentInteraction']=void 0x0,this;}catch(_0xbe9b7f){const _0x4dba29=new at('ai-chat-conversation-init-from-id-failed',null,{'message':_0xbe9b7f['message'],'conversationId':_0x528faf});throw _0x4dba29['stack']=_0xbe9b7f['stack'],this['fire']('error',{'error':_0x4dba29}),_0x4dba29;}}async['_processMessagesToInteractions'](_0x4f731c,_0x371c76,_0x2d5f2a){let _0xa5de54,_0x5ae31f=!0x1;for(const _0x3b291b of _0x4f731c)if('user'===_0x3b291b['role']){const {contextItems:_0x32e992,hasUnmatched:_0x21a01a}=await this['_extractContextItems'](_0x3b291b);_0x5ae31f=_0x21a01a;const _0x3a0866={'isReasoningEnabled':Object['hasOwn'](_0x3b291b['capabilities'],'reasoning'),'isWebSearchEnabled':Object['hasOwn'](_0x3b291b['capabilities'],'webSearch')};_0xa5de54=this['createInteraction']({'userMessage':_0x3b291b['prompt'],'contextItems':_0x32e992,'capabilities':_0x3a0866,'modelId':_0x2d5f2a,'attributes':_0x3b291b['attributes']}),this['currentInteraction']=_0xa5de54,this['chatContext']['addToConversationContext'](this['currentInteraction']['contextItems']);}else{if('assistant'===_0x3b291b['role']&&_0xa5de54){const _0x3ae83a=[];for(const _0x4a8268 of _0x3b291b['content'])switch(_0x4a8268['type']){case'text':case'modification':{const _0x53860c=_0xa5de54['getDocumentContext'](),_0x1e9e3e=(_0x53860c?.['documents']?.['length']?_0x53860c['documents']['some'](_0x59616f=>_0x59616f['sessionId']!==_0x371c76):_0x53860c?.['sessionId']!==_0x371c76)||_0x5ae31f;_0xa5de54['currentReply']?.['type']!==_0x4a8268['type']&&(_0xa5de54['currentReply']=_0xa5de54['createReply']({'type':_0x4a8268['type'],'isDone':!0x0,'interactionId':_0xa5de54['id'],'areActionsDisabled':_0x1e9e3e,'isFromHistory':!0x0}),_0x3ae83a['length']>0x0&&(_0xa5de54['currentReply']['sources']=_0x3ae83a['splice'](0x0))),_0xa5de54['currentReply']['appendContent'](_0x4a8268['content']);break;}case'url':_0x3ae83a['push'](_0x4a8268);break;case'mcp-tool-result':{const {data:_0x41fc2a,attributes:_0x4f1bd9}=JSON['parse'](_0x4a8268['content']);_0xa5de54['_handleToolResultData']({'toolName':_0x4a8268['toolName'],'data':_0x41fc2a,'attributes':_0x4f1bd9});break;}}}}}async['_extractContextItems'](_0x2c49f2){const _0x5cfda8=new Map();if(!_0x2c49f2['content'])return{'contextItems':_0x5cfda8,'hasUnmatched':!0x1};const _0x52848d=this['_resolveEditors'](),{contextItem:_0xceb83a,hasUnmatched:_0x26881f}=await this['chatContext']['populateDocumentsFromMessage'](_0x2c49f2['content'],_0x52848d);_0xceb83a&&_0x5cfda8['set'](_0xceb83a['id'],_0xceb83a);for(const _0x109ec9 of _0x2c49f2['content']){if('document'===_0x109ec9['type'])continue;const _0x2fb689=await this['chatContext']['populateFromMessage'](_0x109ec9);_0x2fb689&&_0x5cfda8['set'](_0x2fb689['id'],_0x2fb689);}return{'contextItems':_0x5cfda8,'hasUnmatched':_0x26881f};}['_resolveEditors'](){return this['options']['getEditors']?this['options']['getEditors']():this['options']['getEditor']?[this['options']['getEditor']()]:[];}async['handleUserInteraction']({userMessage:_0x52a30c,attributes:_0x415bd5}){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 _0xdb5ee5=this['chatContext']['getPendingContextItems'](),_0x5b07b6=this['chatCapabilities']['getCapabilitiesConfig'](),_0xaf70d1=this['selectedModel']['id'];this['currentInteraction']=this['createInteraction']({'userMessage':_0x52a30c,'contextItems':_0xdb5ee5,'capabilities':_0x5b07b6,'modelId':_0xaf70d1,'attributes':_0x415bd5}),await this['currentInteraction']['start'](),this['chatContext']['addToConversationContext'](this['currentInteraction']['contextItems']);}catch(_0x2d50eb){if(_0x2d50eb instanceof at)this['fire']('error',{'interactionId':this['currentInteraction']?this['currentInteraction']['id']:void 0x0,'error':_0x2d50eb});else{const _0x36d352=Ps['get'](_0x2d50eb['code'])||'ai-chat-handle-user-interaction-start-failed';this['fire']('error',{'interactionId':this['currentInteraction']?this['currentInteraction']['id']:void 0x0,'error':new at(_0x36d352,null,{'error':_0x2d50eb})});}}finally{this['currentInteraction']?.['stop'](),this['currentInteraction']=void 0x0;}}['createInteraction']({userMessage:_0x1ca255,contextItems:_0x59f27b,capabilities:_0x5cfe22,modelId:_0x3cdab2,attributes:_0x2455de}){const _0x23bbd4=new Bs({'userMessage':_0x1ca255,'contextItems':_0x59f27b,'capabilities':_0x5cfe22,'conversationId':this['id'],'connector':this['connector'],'locale':this['options']['locale'],'model':_0x3cdab2,'attributes':_0x2455de});return _0x23bbd4['delegate'](...Ls)['to'](this),this['interactions']['push'](_0x23bbd4),this['fire']('interactionCreated',_0x23bbd4),_0x23bbd4;}['getInteraction'](_0x15a060){return this['interactions']['find'](_0xee25d3=>_0xee25d3['id']===_0x15a060);}['removeInteraction'](_0x4e21b7){const _0x34eb57=this['getInteraction'](_0x4e21b7);_0x34eb57&&(_0x34eb57['destroy'](),this['interactions']['splice'](this['interactions']['indexOf'](_0x34eb57),0x1));}get['lastInteraction'](){return this['interactions'][this['interactions']['length']-0x1];}['addCurrentDocumentToContext'](_0x406c42){this['chatContext']['addCurrentDocumentToContext'](_0x406c42);}async['updateCurrentDocumentInContext']({content:_0x5584a5,version:_0x2f47c8,sessionId:_0x481b6c,channelId:_0xa294ce,rootName:_0x3d4982,selections:_0x4f6bd1}){await this['chatContext']['updateCurrentDocument'](_0x5584a5,_0x2f47c8,_0x481b6c,_0xa294ce,_0x3d4982,_0x4f6bd1);}async['updateCurrentDocumentsInContext'](_0x500fc8){await this['chatContext']['updateCurrentDocuments'](_0x500fc8);}['getSourceByDataId'](_0x7e12e3){return this['chatContext']['getSourceByDataId'](_0x7e12e3);}['getDocumentContextSliceByDataId'](_0x4b2e06){return this['chatContext']['getDocumentContextSliceByDataId'](_0x4b2e06);}['getCurrentDocumentContext'](){return this['currentInteraction']?.['getDocumentContext']()?.['content']||'';}['addSelectionToContext'](_0xfaa390){this['chatContext']['addSelectionToContext'](_0xfaa390);}['removeSelectionFromContext'](){this['chatContext']['removeSelectionFromContext']();}['addFilesToContext'](_0x24fef1){this['chatContext']['addFilesToContext'](_0x24fef1);}['addUrlToContext'](_0x32d213){this['chatContext']['addUrlToContext'](_0x32d213);}['addToolItemToContext'](_0x27192b){this['chatContext']['addToolItemToContext'](_0x27192b);}['addResourceToContext'](_0x274ba0,_0x3e1bdd){this['chatContext']['addResourceToContext'](_0x274ba0,_0x3e1bdd);}['loadSourceResources'](_0x22732a,_0x6eef76,_0x6386dc){return this['chatContext']['loadSourceResources'](_0x22732a,_0x6eef76,_0x6386dc);}['removeFromContext'](_0x4dbe18){this['chatContext']['removeFromContext'](_0x4dbe18);}['setWebSearch'](_0x3d9eb6){this['chatCapabilities']['setWebSearch'](_0x3d9eb6);}['toggleWebSearch'](){this['chatCapabilities']['toggleWebSearch']();}['setReasoning'](_0x1cbb16){this['chatCapabilities']['setReasoning'](_0x1cbb16);}['toggleReasoning'](){this['chatCapabilities']['toggleReasoning']();}['isCurrentDocumentInContext'](){return this['chatContext']['isCurrentDocumentInContext']();}['isCurrentDocumentInConversation'](){return this['chatContext']['isCurrentDocumentInConversation']();}['isSelectionInContext'](){return this['chatContext']['isSelectionInContext']();}async['setModel'](_0x4684a4){_0x4684a4?!0x1===await this['chatModels']['isAvailable'](_0x4684a4)&&(It('ai-chat-conversation-set-model-not-available',{'conversation':this,'model':_0x4684a4}),_0x4684a4=(await this['chatModels']['getAvailableModels']())[0x0]):(It('ai-chat-conversation-set-model-null',{'conversation':this}),_0x4684a4=(await this['chatModels']['getAvailableModels']())[0x0]),_0x4684a4['id']!==this['selectedModel']?.['id']&&(this['selectedModel']=_0x4684a4,this['chatCapabilities']['reset'](),this['fire']('modelSelected',{'selectedModel':_0x4684a4}));}}class Fs extends Tt(){['_connector'];['_config'];['_locale'];['_modelList']=[];['_modelsRequest']=null;constructor({connector:_0x39ab7,config:_0x274a13,locale:_0x1928c0}){super(),this['_connector']=_0x39ab7,this['_config']=_0x274a13,this['_locale']=_0x1928c0;}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 _0x321cee=await this['getAll']();let _0x4ae164;return _0x4ae164=this['_availableModels']?this['_filterModels'](_0x321cee,this['_availableModels']):_0x321cee['filter'](_0x47b7bb=>_0x47b7bb['recommended']),_0x4ae164;}async['getModel'](_0x52f30e){const _0x52dcd9=await this['getAll']();if(!_0x52dcd9['length'])return null;if(_0x52f30e){const _0xf86f27=this['_getModelById'](_0x52dcd9,_0x52f30e);if(_0xf86f27)return _0xf86f27;It('ai-chat-model-id-unrecognized',{'modelId':_0x52f30e,'fallBackModelId':this['_defaultModelId']});}return this['getDefault']();}async['getDefault'](){const _0x22625e=await this['getAvailableModels']();if(!_0x22625e['length'])return null;if(this['_defaultModelId']){const _0x17ee1c=this['_getModelById'](_0x22625e,this['_defaultModelId']);if(_0x17ee1c)return _0x17ee1c;It('ai-chat-default-model-id-unrecognized',{'defaultModelId':this['_defaultModelId'],'fallBackModelId':_0x22625e[0x0]['id']});}return _0x22625e[0x0];}async['isAvailable'](_0x3dd2a0){return(await this['getAvailableModels']())['some'](_0x13c217=>_0x13c217['name']===_0x3dd2a0['name']&&_0x13c217['provider']===_0x3dd2a0['provider']);}async['_retrieveModels'](){if(!this['_modelList']['length'])try{const _0x50f4e3=this['_locale']['uiLanguage']||'en',_0x5bda1e=this['_connector']['getModels'](_0x50f4e3),_0x2bac24=await _0x5bda1e['list']();this['_modelList']=_0x2bac24['items']['map'](_0x4e86b5=>Ks(_0x4e86b5)?{..._0x4e86b5,'name':hs(this['_locale'],'AI_MODEL_NAME_AUTO')}:_0x4e86b5);}catch(_0x255ae6){throw Et('ai-models-unable-to-retrieve',{'error':_0x255ae6}),_0x255ae6;}return[...this['_modelList']];}['_filterModels'](_0x1c0518,_0x4d47fa){let _0xdcb25c;if(_0x4d47fa){_0xdcb25c=[];const _0x3ec297=new Set(),_0x1b3ec2='string'==typeof _0x4d47fa?[_0x4d47fa['toLocaleLowerCase']()]:_0x4d47fa['map'](_0x2a1eed=>_0x2a1eed['toLocaleLowerCase']());for(const _0x1a87a4 of _0x1b3ec2)for(const _0x1d3d21 of _0x1c0518)!_0x3ec297['has'](_0x1d3d21['id'])&&this['_isMatchingFilter'](_0x1d3d21,_0x1a87a4)&&(_0xdcb25c['push'](_0x1d3d21),_0x3ec297['add'](_0x1d3d21['id']));}else _0xdcb25c=_0x1c0518;return _0xdcb25c;}['_isMatchingFilter'](_0x185134,_0x4a1e2f){const _0x5c3c2c=_0x185134['id']['toLocaleLowerCase'](),_0xbfee5c=_0x185134['name']['toLocaleLowerCase'](),_0x5c05af=_0x185134['provider']['toLocaleLowerCase']();return _0x5c3c2c===_0x4a1e2f||_0xbfee5c===_0x4a1e2f||Ks(_0x185134)&&'auto'===_0x4a1e2f||_0x5c05af===_0x4a1e2f||_0x5c3c2c['startsWith'](_0x4a1e2f);}['_getModelById'](_0x5e8004,_0x2d90cd){return _0x5e8004['find'](_0x4ce735=>Ks(_0x4ce735)&&'auto'===_0x2d90cd?_0x4ce735:_0x4ce735['id']===_0x2d90cd)||null;}}function Ks(_0x4eb22f){return _0x4eb22f['id']['startsWith']('agent');}function Ws(_0xc0b268){return _0xc0b268?_0xc0b268 instanceof _0x597112?[_0xc0b268]:_0xc0b268['editors']&&0x0!==_0xc0b268['editors']['length']?Array['from'](_0xc0b268['editors']):[]:[];}function Ys(_0x179326){const _0x3587e6=Ws(_0x179326);if(!_0x3587e6['length'])throw new at('ai-get-editor-from-context-no-editor');if(0x1===_0x3587e6['length'])return _0x3587e6[0x0];const _0x7b78a5=_0x3587e6['find'](_0x2e2395=>_0x2e2395['ui']?.['focusTracker']?.['isFocused']);if(_0x7b78a5)return _0x7b78a5;const _0x4a7d06=function(_0x279485){if(_0x279485 instanceof _0x597112)return;const _0x3eca7a=_0x279485;if(!_0x3eca7a['plugins']||!_0x3eca7a['plugins']['has']('AIEditing'))return;const _0x40b701=_0x3eca7a['plugins']['get']('AIEditing');return _0x40b701['getLastContentFocusedEditor']?.();}(_0x179326);return _0x4a7d06&&_0x3587e6['includes'](_0x4a7d06)?_0x4a7d06:_0x3587e6[0x0];}function $s(_0x18320c){return Ys(_0x18320c);}function qs({editor:_0x75fa58,interaction:_0x31a3c9,reply:_0x385edd,groups:_0x548a80,transform:_0xe9b44e,documentCompare:_0x252376,documentCompareOptions:_0x338ce6,documentContextSlice:_0x3426bf}){const _0x2ae440=_0x31a3c9['getDocumentContext']();if(!_0x2ae440)return[];const _0xa7a840=_0x385edd['documentContextContent']['cloneNode'](!0x0);for(const {changes:_0x389211}of _0x548a80){const _0x18605d=_0x389211['filter'](_0x384e9e=>'new'!=_0x384e9e['type'])['map'](_0x3a2762=>As('data-id',_0x3a2762['id'],_0xa7a840)),_0x2eeb75=_0x389211['filter'](_0x17a2f9=>'removed'!=_0x17a2f9['type'])['map'](_0x291a32=>_0x291a32['node']['cloneNode'](!0x0));let _0x15ce3b=null;if(_0x18605d['length']){_0x15ce3b=_0x18605d[0x0]['previousSibling'];for(let _0x45ae3b=0x0;_0x45ae3b<_0x18605d['length'];_0x45ae3b++)_0x565d3d(_0x18605d[_0x45ae3b]);}if(_0x2eeb75['length']){_0x15ce3b||(_0x389211[0x0]['anchorId']?_0x15ce3b=As('data-id',_0x389211[0x0]['anchorId'],_0xa7a840):(_0x15ce3b=_0x2eeb75['shift'](),_0x26fbb4(_0xa7a840,_0x15ce3b)));for(let _0x1e3c1a=0x0;_0x1e3c1a<_0x2eeb75['length'];_0x1e3c1a++)_0x2cc319(_0x15ce3b,_0x2eeb75[_0x1e3c1a]),_0x15ce3b=_0x2eeb75[_0x1e3c1a];}}let _0xc6cfee,_0x4cdece,_0x161a52,_0x2c1b60=_0x338ce6;if(_0x3426bf){_0xc6cfee=_0x3426bf['html'],_0x161a52=_0x3426bf['version'],_0x2c1b60={..._0x338ce6,'anchor':_0x3426bf['rootName']};const _0x466ccf=new _0x4bac9c([]),_0x17298e=_0xa7a840['children'],_0x47e22c=_0x385edd['dataIdDocumentSources'],_0x4a334a=_0x385edd['newNodeAnchorIds'],_0x57401c=_0x3426bf['editor'],_0x2a8e84=_0x3426bf['rootName'],_0x3bc2c2=new Array(_0x17298e['length']),_0x4b4539=_0x4f17af=>_0x4f17af?_0x4f17af['editor']===_0x57401c&&_0x4f17af['rootName']===_0x2a8e84:void 0x0;for(let _0xcd2382=0x0;_0xcd2382<_0x17298e['length'];_0xcd2382++){const _0xdc8220=Es(_0x17298e[_0xcd2382],'data-id');if(!_0xdc8220)continue;const _0x240711=_0x4b4539(_0x47e22c?.['get'](_0xdc8220));if(void 0x0!==_0x240711){_0x3bc2c2[_0xcd2382]=_0x240711;continue;}const _0x1b039c=_0x4a334a['get'](_0xdc8220),_0xe33d16=_0x1b039c?_0x4b4539(_0x47e22c?.['get'](_0x1b039c)):void 0x0;void 0x0!==_0xe33d16&&(_0x3bc2c2[_0xcd2382]=_0xe33d16);}for(let _0x44395a=0x0;_0x44395a<_0x17298e['length'];_0x44395a++)if(void 0x0===_0x3bc2c2[_0x44395a]){for(let _0x30d495=_0x44395a-0x1;_0x30d495>=0x0;_0x30d495--)if(void 0x0!==_0x3bc2c2[_0x30d495]){_0x3bc2c2[_0x44395a]=_0x3bc2c2[_0x30d495];break;}if(void 0x0===_0x3bc2c2[_0x44395a]){for(let _0x3ba0b2=_0x44395a+0x1;_0x3ba0b2<_0x17298e['length'];_0x3ba0b2++)if(void 0x0!==_0x3bc2c2[_0x3ba0b2]){_0x3bc2c2[_0x44395a]=_0x3bc2c2[_0x3ba0b2];break;}}}for(let _0x16da79=0x0;_0x16da79<_0x17298e['length'];_0x16da79++)_0x3bc2c2[_0x16da79]&&_0x466ccf['children']['push'](_0xbcafee(_0x17298e[_0x16da79],!0x0));_0x4cdece=gs(_0x466ccf);}else _0xc6cfee=_0x2ae440['content'],_0x161a52=_0x2ae440['version'],_0x4cdece=gs(_0xa7a840);const _0x40bbd4=_0x252376['getDiff'](_0xc6cfee,_0x4cdece,{..._0x2c1b60,'targetEditor':_0x75fa58})['getOperations']();if(_0xe9b44e){const _0x388f75=_0x75fa58['model']['document']['history']['getOperations'](_0x161a52),_0x68a3f7={'document':_0x75fa58['model']['document'],'useRelations':!0x1,'padWithNoOps':!0x1};return _0x5f4e4f(_0x40bbd4,_0x388f75,_0x68a3f7)['operationsA'];}return _0x40bbd4;}function Qs(_0x142fc4,_0x443585){if('marker'!=_0x443585['type'])return;const _0x247453=_0x142fc4['model']['markers']['get'](_0x443585['name']);_0x247453&&(_0x443585['oldRange']=_0x247453['getRange']());}class Xs extends _0x1c4723{['activeConversation'];['_aiEditing'];['_aiConnector'];['_aiChatUi'];['_aiChatModels'];['_aiChatBalloon'];['_activeBalloon'];['_wiredBalloons']=new Set();['_batchToChanges']=new Map();['_currentPreviewedChangeGroup']=null;['_bodyCollection'];static get['requires'](){return[as,_0x510df7];}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 _0x16c8cc=this['context']['plugins']['get']('AITabs');this['listenTo'](this['_aiChatUi'],'startConversation',()=>{this['_startConversationSafely']();}),this['listenTo'](this['_aiChatUi'],'sendUserMessage',(_0x26a008,_0x4c59cd)=>{this['_handleUIUserMessage']({'message':_0x4c59cd});}),this['listenTo'](_0x16c8cc['view'],'change:activeTab',(_0x2567a9,_0x242ebf,_0x41e15a)=>{'chat'!==_0x41e15a&&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',(_0x21653e,_0x13b12e)=>{this['activeConversation']?.['addFilesToContext'](Array['from'](_0x13b12e));}),this['listenTo'](this['_aiChatUi'],'addUrlToContext',(_0x416697,_0x4c37bd)=>{this['activeConversation']?.['addUrlToContext'](_0x4c37bd);}),this['listenTo'](this['_aiChatUi'],'executeCustomItemCallback',(_0x327483,_0x5f4022)=>{_0x5f4022['callback'](this['context']);}),this['listenTo'](this['_aiChatUi'],'addResourceToContext',(_0x3e4690,_0x1ee940)=>{this['activeConversation']?.['addResourceToContext'](_0x1ee940['source'],_0x1ee940['resource']);}),this['listenTo'](this['_aiChatUi'],'removeContextItem',(_0x587091,_0x48dcec)=>{this['_removeFromContext'](_0x48dcec);}),this['listenTo'](this['_aiChatUi'],'loadSourceResources',(_0x297534,_0x586153)=>{this['activeConversation']?.['loadSourceResources'](_0x586153['sourceId'],_0x586153['query'],_0x586153['uid']);}),this['listenTo'](this['_aiChatUi'],'toggleWebSearch',()=>{this['_toggleWebSearch']();}),this['listenTo'](this['_aiChatUi'],'toggleReasoning',()=>{this['_toggleReasoning']();}),this['listenTo'](this['_aiChatUi'],'selectModel',(_0x329e6e,_0x4afb07)=>{this['activeConversation']?.['setModel'](_0x4afb07);}),this['listenTo'](this['_aiChatUi'],'like',(_0x1f99ce,{replyId:_0x467ea6})=>{console['log']('Liked\x20response',_0x467ea6);}),this['listenTo'](this['_aiChatUi'],'dislike',(_0x3a990,{replyId:_0x5c6f5c})=>{console['log']('Disliked\x20response',_0x5c6f5c);}),this['listenTo'](this['_aiChatUi'],'insertSuggestion',(_0x23510d,_0x28c2ec)=>{this['_insertSuggestion'](_0x28c2ec);}),this['listenTo'](this['_aiChatUi'],'showChangeInText',(_0x366325,{replyId:_0x442703,partIndex:_0x43ce7a})=>{this['_aiChatBalloonShowDiff']=this['_aiChatUi']['showDiff'],this['_openBalloonFor'](_0x442703,_0x43ce7a);}),this['listenTo'](this['_aiChatUi'],'mouseOverSuggestion',(_0x33d2df,{replyId:_0x131762,partIndex:_0x30c375})=>{const _0x29c3ac=this['_getDocumentRangeForReplyChanges'](_0x131762,_0x30c375);_0x29c3ac&&'$graveyard'!=_0x29c3ac['range']['root']['rootName']&&this['_aiEditing']['showFakeVisualSelection']({'ranges':[_0x29c3ac['range']],'id':'change-area','priority':0xa});}),this['listenTo'](this['_aiChatUi'],'mouseLeaveSuggestion',()=>{this['_aiEditing']['hideFakeVisualSelection']('change-area');}),this['listenTo'](this['_aiChatUi'],'applySuggestion',(_0x4e42ac,_0x53e135)=>{this['_aiEditing']['hideFakeVisualSelection']('change-area'),this['_applySuggestion'](_0x53e135);}),this['listenTo'](this['_aiChatUi'],'toggleSuggestionDisplayMode',async(_0x537e0d,{replyId:_0x556af2,showDiff:_0x32abf9})=>{const {reply:_0x1263e7}=this['getInteractionAndReplyById'](_0x556af2),_0x1a34f5=_0x1263e7['getContentParts']({'showDiff':_0x32abf9,'editor':$s(this['context'])});await this['_aiChatUi']['updateFeedItemAIReplySuggestionContent']({'id':_0x1263e7['id'],'parts':_0x1a34f5});}),this['listenTo'](this['_aiChatUi'],'rejectSuggestion',(_0x3bb2aa,{replyId:_0x20b91e,partIndex:_0x333b80})=>{this['_rejectSuggestion']({'replyId':_0x20b91e,'partIndex':_0x333b80}),this['_aiEditing']['hideFakeVisualSelection']('change-area');}),this['set']('_aiChatBalloonShowDiff',!0x1),this['context']['plugins']['has']('AIChatBalloon')&&(this['_aiChatBalloon']=this['context']['plugins']['get']('AIChatBalloon')),this['on']('interactionCreated',(_0x491351,_0x5821b0)=>{this['_aiChatUi']['addFeedItemUserMessage'](_0x5821b0);}),this['on']('replyCreated',(_0x25988f,_0x269f5a)=>{this['_addFeedItemReply'](_0x269f5a);});}async['afterInit'](){this['context']instanceof _0x597112?this['_integrateEditor'](this['context']):this['listenTo'](this['context']['editors'],'add',(_0x5483d2,_0x47db72)=>{_0x47db72['on']('ready',()=>{this['_integrateEditor'](_0x47db72);});});const _0x42fa03=this['context']['config']['get']('ai.chat.initialConversation');let _0x39f35f=_0x42fa03;if('lastCreated'!=_0x42fa03||(_0x39f35f=await this['_getLastCreatedConversationId'](),_0x39f35f))return'new'==_0x39f35f?this['_startConversationSafely']():this['loadConversation'](_0x39f35f);}async['destroy'](){return await this['_stopLastInteraction'](),this['_bodyCollection']['detachFromDom'](),super['destroy']();}async['loadConversation'](_0x2ba9c3){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'](_0x2ba9c3)['getConversation'](),await this['_startConversationSafely']({'id':_0x2ba9c3}),this['_updateConversationTitle']('\x20'),await this['activeConversation']['load'](_0x2ba9c3,this['_aiEditing']['sessionId']),this['activeConversation']['isCurrentDocumentInConversation']()&&this['addCurrentDocumentToChatContext']();}catch(_0x2011f2){this['_aiChatUi']['addFeedItemError']({'errorMessage':hs(this['context']['locale'],'AI_CHAT_UNABLE_TO_LOAD_CONVERSATION'),'id':_0x2ba9c3}),this['_logError'](new at('ai-chat-conversation-not-found',this,{'error':_0x2011f2}));}finally{this['_aiChatUi']['startAutoScroll']({'smooth':!0x1}),this['_aiChatUi']['setFeedItemRenderingStrategy']('streaming'),this['_aiChatUi']['toggleLoadingSkeleton'](!0x1);}}['registerToolDataCallback'](_0x38430c){let _0x581012=null,_0xcdb939=null;this['on']('toolDataReceived',(_0x464b88,_0x410cad,_0x1432a0)=>{_0x1432a0['id']!==_0x581012&&(_0x581012=_0x1432a0['id'],_0xcdb939=this['_getAIChatFeedAPI'](_0x1432a0)),_0x38430c(_0x410cad,_0xcdb939);});}['addCurrentDocumentToChatContext'](){this['activeConversation']?.['addCurrentDocumentToContext'](hs(this['context']['locale'],'AI_CHAT_CONTEXT_CURRENT_DOCUMENT'));}async['addSelectionToChatContext'](){const _0x21b810=this['_aiEditing']['getSelectionText']();this['activeConversation']?.['addSelectionToContext'](_0x21b810),this['addCurrentDocumentToChatContext']();}['removeSelectionFromChatContext'](){this['activeConversation']?.['removeSelectionFromContext']();}['focusPromptInput'](){this['_aiChatUi']['focusPromptInput']();}async['startConversation'](_0x409789){await this['_startConversationSafely']({'modelId':_0x409789?.['modelId']});}async['sendMessage'](_0x2bd794){await this['_handleUIUserMessage'](_0x2bd794);}['getGroupId'](){const _0x54f6e3=this['context']['config']['get']('collaboration.channelId');if(!_0x54f6e3)throw new at('ai-missing-channel-id',this);return _0x54f6e3;}['_handleRemovedConversation'](_0x18b3b8){this['activeConversation']['id']===_0x18b3b8&&this['_startConversationSafely']();}['_insertSuggestion'](_0x524f9f){const _0x451601=this['context']['plugins']['get']('DocumentCompare'),{reply:_0x4ac774,interaction:_0x9e563b}=this['getInteractionAndReplyById'](_0x524f9f['replyId']),_0x2a3190=void 0x0!==_0x524f9f['partIndex']?[_0x4ac774['changeGroups'][_0x524f9f['partIndex']]]:_0x4ac774['changeGroups']['filter'](_0xdf3415=>'pending'==_0xdf3415['state']);for(const _0x342bef of this['_groupChangesByTarget'](_0x4ac774,_0x2a3190)){const {target:_0xd7cc33,groups:_0x3a9cac,groupsIndexes:_0x5ea489,slice:_0x335af6}=_0x342bef;if(!_0xd7cc33['editor']['plugins']['has']('TrackChanges'))throw new at('ai-no-track-changes',null);const _0x18c1c7=this['_getDocumentRangeForReplyChanges'](_0x524f9f['replyId'],_0x5ea489[0x0]);if(!_0x18c1c7||'$graveyard'==_0x18c1c7['range']['root']['rootName']){_0x5ea489['forEach'](_0x3d15ad=>_0x4ac774['setChangeGroupState'](_0x3d15ad,'outdated'));continue;}_0x5ea489['forEach'](_0x9b60d1=>_0x4ac774['setChangeGroupState'](_0x9b60d1,'accepted'));const _0x1d6a89=qs({'editor':_0xd7cc33['editor'],'reply':_0x4ac774,'interaction':_0x9e563b,'groups':_0x3a9cac,'transform':!0x0,'documentCompare':_0x451601,'documentCompareOptions':{'anchor':_0x335af6?.['rootName']??'main','markDeletions':!0x0},'documentContextSlice':_0x335af6});let _0x54dd56;this['_scrollToSuggestionRange'](_0x18c1c7['range'],!0x1,_0xd7cc33['editor']),_0xd7cc33['editor']['model']['change'](_0x2ee8b2=>{_0x54dd56=_0x2ee8b2['batch'],_0xd7cc33['editor']['plugins']['get']('TrackChangesEditing')['_applyOperationsAsSuggestions'](_0x1d6a89),this['_aiEditing']['hideFakeVisualSelection']('change-area');}),this['_batchToChanges']['set'](_0x54dd56,{'interactionId':_0x9e563b['id'],'replyId':_0x4ac774['id'],'indexes':_0x5ea489['slice']()});}this['_updateRatings'](_0x4ac774);}['_applySuggestion'](_0x359828){const _0x267134=this['context']['plugins']['get'](_0x510df7),{reply:_0x23ffd2,interaction:_0x4352f9}=this['getInteractionAndReplyById'](_0x359828['replyId']),_0x4ca2d3=void 0x0!==_0x359828['partIndex']?[_0x23ffd2['changeGroups'][_0x359828['partIndex']]]:_0x23ffd2['changeGroups']['filter'](_0x652db5=>'pending'==_0x652db5['state']);for(const _0x20845f of this['_groupChangesByTarget'](_0x23ffd2,_0x4ca2d3)){const {target:_0x177ea3,groups:_0x109bb2,groupsIndexes:_0x3afa71,slice:_0x598f2c}=_0x20845f,_0x364c22=this['_getDocumentRangeForReplyChanges'](_0x359828['replyId'],_0x3afa71[0x0]);if(!_0x364c22||'$graveyard'==_0x364c22['range']['root']['rootName']){_0x3afa71['forEach'](_0xf9fbf6=>_0x23ffd2['setChangeGroupState'](_0xf9fbf6,'outdated'));continue;}_0x3afa71['forEach'](_0x19f552=>_0x23ffd2['setChangeGroupState'](_0x19f552,'accepted'));const _0x63244a=qs({'editor':_0x177ea3['editor'],'reply':_0x23ffd2,'interaction':_0x4352f9,'groups':_0x109bb2,'transform':!0x0,'documentCompare':_0x267134,'documentCompareOptions':{'anchor':_0x598f2c?.['rootName']??'main','markDeletions':!0x1},'documentContextSlice':_0x598f2c});let _0x43e2b7;this['_scrollToSuggestionRange'](_0x364c22['range'],!0x1,_0x177ea3['editor']),_0x177ea3['editor']['model']['change'](_0x3ab536=>{_0x43e2b7=_0x3ab536['batch'];for(const _0x1a8ccd of _0x63244a)_0x1a8ccd['baseVersion']=_0x177ea3['editor']['model']['document']['version'],Qs(_0x177ea3['editor'],_0x1a8ccd),_0x3ab536['batch']['addOperation'](_0x1a8ccd),_0x177ea3['editor']['model']['applyOperation'](_0x1a8ccd);}),this['_batchToChanges']['set'](_0x43e2b7,{'interactionId':_0x4352f9['id'],'replyId':_0x23ffd2['id'],'indexes':_0x3afa71['slice']()});}this['_updateRatings'](_0x23ffd2);}['_rejectSuggestion'](_0x4caf8f){const {reply:_0x3e7308}=this['getInteractionAndReplyById'](_0x4caf8f['replyId']);_0x3e7308['setChangeGroupState'](_0x4caf8f['partIndex'],'rejected');}['_openBalloonFor'](_0x5c575c,_0xc0855b){if(!this['_aiChatBalloon'])return;const {reply:_0x10488d}=this['getInteractionAndReplyById'](_0x5c575c),_0x520eb4=_0x10488d['getContentParts']({'showDiff':this['_aiChatBalloonShowDiff'],'editor':$s(this['context'])});let _0xf9f9d0,_0x14c926;if(void 0x0!==_0xc0855b?(_0x14c926=_0x520eb4['find'](_0x18bce3=>_0x18bce3['index']==_0xc0855b),_0xf9f9d0=_0x14c926?.['index']):(_0x14c926=_0x520eb4[0x0],_0xf9f9d0=_0x14c926['index']),this['_currentPreviewedChangeGroup']?.['replyId']==_0x5c575c&&this['_currentPreviewedChangeGroup']?.['partIndex']==_0xf9f9d0)return;const _0x5d7174=this['_getUserPresentableContentPartDocumentRange'](_0x5c575c,_0x10488d,_0x14c926),_0x1c527c=_0x10488d['changeGroups']['find'](_0x487459=>_0x487459['index']==_0xf9f9d0),_0x389727=_0x1c527c?this['_resolveGroupTarget'](_0x10488d,_0x1c527c):null,_0xd11c36=_0x389727?.['editor']??$s(this['context']),_0xfbf5b2=_0xd11c36['plugins']['has']('AIChatBalloon')?_0xd11c36['plugins']['get']('AIChatBalloon'):this['_aiChatBalloon'];if(this['_activeBalloon']&&this['_activeBalloon']!==_0xfbf5b2&&this['_activeBalloon']['close'](),!_0x5d7174)return _0xfbf5b2['close'](),void(this['_activeBalloon']=void 0x0);this['_activeBalloon']=_0xfbf5b2,this['_currentPreviewedChangeGroup']={'replyId':_0x5c575c,'partIndex':_0xf9f9d0},this['_scrollToSuggestionRange'](_0x5d7174,!0x0,_0xd11c36);const _0x509301=this['_getPresentableSiblingContentPartIndex'](_0x5c575c,_0xf9f9d0,'next');_0xfbf5b2['updateContent']({'part':_0x14c926,'renderingStrategy':'static'}),_0xfbf5b2['open']({'index':_0xf9f9d0,'title':hs(this['context']['locale'],'AI_BALLOON_HEADER_TITLE',(_0xf9f9d0+0x1)['toString']()),'showRotator':null!==_0x509301,'ranges':[_0x5d7174],'areActionsDisabled':_0x10488d['areActionsDisabled'],'targetEditor':_0xd11c36}),_0xfbf5b2['setState']('pending'),this['_aiChatUi']['scrollFeedToSuggestion'](_0x5c575c,_0xf9f9d0),this['_aiChatUi']['setFeedItemAIReplySuggestionPartActive']({'id':_0x5c575c,'index':_0xf9f9d0,'isActive':!0x0});}['_getPresentableSiblingContentPartIndex'](_0x3323c5,_0xe2ee44,_0x41a9bd){const {reply:_0x58033a}=this['getInteractionAndReplyById'](_0x3323c5),_0x3ce430=_0x58033a['getContentParts']({'showDiff':this['_aiChatBalloonShowDiff'],'editor':$s(this['context'])});if(0x1==_0x3ce430['length'])return null;const _0x26bfa9=_0x3ce430['findIndex'](_0x3cb2d0=>_0x3cb2d0['index']==_0xe2ee44),_0x25b031='next'==_0x41a9bd?0x1:-0x1;let _0x50df11=_0x3ce430['at']((_0x26bfa9+_0x25b031)%_0x3ce430['length'])['index'],_0x3ad932=_0x3ce430[_0x50df11];for(;!this['_getUserPresentableContentPartDocumentRange'](_0x3323c5,_0x58033a,_0x3ad932);){if(_0x50df11=_0x3ce430['at']((_0x50df11+_0x25b031)%_0x3ce430['length'])['index'],_0x50df11===_0x26bfa9)return null;_0x3ad932=_0x3ce430[_0x50df11];}return _0x50df11;}['_getUserPresentableContentPartDocumentRange'](_0x2ec416,_0x2cb1bf,_0x55fca4){const _0x5a3883=_0x2cb1bf['changeGroups'];if(!_0x55fca4['hasChanges'])return null;const _0x2d7dd0=_0x5a3883['find'](_0x93d85e=>_0x93d85e['index']==_0x55fca4['index']);if('pending'!==_0x2d7dd0?.['state'])return null;const _0x267117=this['_getDocumentRangeForReplyChanges'](_0x2ec416,_0x55fca4['index']);if(!_0x267117)return _0x2cb1bf['setChangeGroupState'](_0x55fca4['index'],'outdated'),null;const {range:_0x2f2744,currentIndex:_0x477792}=_0x267117;return'$graveyard'==_0x2f2744['root']['rootName']?(_0x2cb1bf['setChangeGroupState'](_0x477792,'outdated'),null):_0x267117['range'];}['_getDocumentRangeForReplyChanges'](_0x4ac426,_0x2da338){const {reply:_0x10c088}=this['getInteractionAndReplyById'](_0x4ac426),_0x1f2b9e=_0x10c088['changeGroups']['filter'](_0x3c6fbe=>'pending'==_0x3c6fbe['state']),_0x38da97=_0x1f2b9e['map'](_0x20c354=>_0x10c088['changeGroups']['indexOf'](_0x20c354));void 0x0===_0x2da338&&(_0x2da338=_0x38da97[0x0]);const _0x58f9cf=_0x38da97['indexOf'](_0x2da338);if(-0x1==_0x58f9cf)return null;const _0x405e73=_0x1f2b9e[_0x58f9cf],_0x288e6f=this['_resolveGroupTarget'](_0x10c088,_0x405e73);if(!_0x288e6f)return null;const {editor:_0x17830a,root:_0x23c007,parsedDocumentContent:_0x44909f,serializedDocumentContent:_0x3bcc5a,version:_0x32f0f8}=_0x288e6f,_0x5ad377=new _0x4bac9c([]),_0x4d2cda=new _0x4bac9c([]);for(const _0xbafc33 of _0x405e73['changes']){const _0x4b3eac=this['activeConversation']?.['getSourceByDataId'](_0xbafc33['id']);if((!_0x4b3eac||_0x4b3eac['editor']===_0x288e6f['editor']&&_0x4b3eac['rootName']===_0x288e6f['root']['rootName'])&&('removed'!=_0xbafc33['type']&&_0x4d2cda['children']['push'](_0xbafc33['node']['cloneNode'](!0x0)),'new'!=_0xbafc33['type'])){const _0x2cd8e2=_0x2da362(_0x43ff26=>Es(_0x43ff26,'data-id')==_0xbafc33['id'],_0x44909f,!0x0);if(!_0x2cd8e2)return null;_0x5ad377['children']['push'](_0x2cd8e2['cloneNode'](!0x0));}}if(0x0==_0x5ad377['children']['length']){if(_0x405e73['changes'][0x0]['anchorId']){const _0x180a6f=As('data-id',_0x405e73['changes'][0x0]['anchorId'],_0x44909f);_0x5ad377['children']['unshift'](_0x180a6f['cloneNode'](!0x0)),_0x4d2cda['children']['unshift'](_0x180a6f['cloneNode'](!0x0)),_0x180a6f['nextSibling']&&(_0x5ad377['children']['push'](_0x180a6f['nextSibling']['cloneNode'](!0x0)),_0x4d2cda['children']['push'](_0x180a6f['nextSibling']['cloneNode'](!0x0)));}else{const _0x32b804=_0x44909f['children'][0x0];if(!_0x32b804)return null;_0x5ad377['children']['push'](_0x32b804['cloneNode'](!0x0)),_0x4d2cda['children']['push'](_0x32b804['cloneNode'](!0x0));}}const _0x57442a=_0x17830a['data']['parse'](_0x3bcc5a),_0x35a96d=gs(_0x5ad377),_0xbeb382=_0x17830a['data']['parse'](_0x35a96d),_0x2a4e37=_0x17830a['data']['parse'](_0x35a96d),_0x124e97=_0x17830a['model']['createPositionAt'](_0xbeb382,0x0),_0x4eb6b9=gs(_0x4d2cda),_0x13b3e3={'targetEditor':_0x17830a,'anchor':_0x124e97,'markDeletions':!0x1},_0x33acdc=_0x17830a['plugins']['get'](_0x510df7)['getDiff'](_0x35a96d,_0x4eb6b9,_0x13b3e3)['getOperations']();if(!_0x33acdc['length'])return null;_0x17830a['model']['change'](_0x5514d8=>{for(const _0x33b140 of _0x33acdc)if('remove'==_0x33b140['type']){const _0x1a0cac=_0x33b140['sourcePosition'],_0x2280bf=_0x33b140['howMany'],_0x4efa19=new _0x5b32ba(_0x1a0cac,_0x2280bf);_0x5514d8['batch']['addOperation'](_0x4efa19),_0x17830a['model']['applyOperation'](_0x4efa19);}else'marker'!==_0x33b140['type']&&(_0x33b140['baseVersion']=null,_0x33b140['isDocumentOperation']=!0x1,_0x5514d8['batch']['addOperation'](_0x33b140),_0x17830a['model']['applyOperation'](_0x33b140));});const _0x53e49a=ks(_0x17830a,_0x33acdc,_0xbeb382);Ns(_0x17830a['model'],_0x53e49a);const _0x34e263=_0x53e49a['getFirstRange']()['start']['path']['slice'](),_0x45e87a=_0x53e49a['getFirstRange']()['end']['path']['slice'](),_0x1a1006=[];let _0x2c88d6=_0xbeb382,_0x10a4eb=_0x2a4e37;for(let _0x5ab76c=0x0;_0x5ab76c<_0x45e87a['length'];_0x5ab76c++){const _0x226ba3=_0x2c88d6['maxOffset']-_0x45e87a[_0x5ab76c];_0x1a1006[_0x5ab76c]=_0x10a4eb['maxOffset']-_0x226ba3,_0x2c88d6=_0x2c88d6['getChildAtOffset'](_0x45e87a[_0x5ab76c]),_0x10a4eb=_0x10a4eb['getChildAtOffset'](_0x1a1006[_0x5ab76c]);}const _0x17cee9=_0x17830a['model']['createRange'](_0x17830a['model']['createPositionFromPath'](_0x2a4e37,_0x34e263),_0x17830a['model']['createPositionFromPath'](_0x2a4e37,_0x1a1006)),_0x18c287=_0x2a4e37['getChild'](0x0)['getAttribute'](_0x503c11),_0x5380e8=Array['from'](_0x57442a['getChildren']())['find'](_0x2bc999=>_0x2bc999['getAttribute'](_0x503c11)==_0x18c287)['getPath'](),_0x3b639f=_0x17cee9['start']['path']['slice'](),_0x284e6e=_0x17cee9['end']['path']['slice']();_0x3b639f[0x0]=_0x5380e8[0x0]+_0x3b639f[0x0],_0x284e6e[0x0]=_0x5380e8[0x0]+_0x284e6e[0x0];let _0x146efe=_0x17830a['model']['createRange'](_0x17830a['model']['createPositionFromPath'](_0x23c007,_0x3b639f),_0x17830a['model']['createPositionFromPath'](_0x23c007,_0x284e6e));const _0x14209e=_0x17830a['model']['document']['history']['getOperations'](_0x32f0f8);for(const _0x4cf49b of _0x14209e)_0x146efe=_0x49ae78['_createFromRanges'](_0x146efe['getTransformedByOperation'](_0x4cf49b));return{'range':_0x146efe,'currentIndex':_0x2da338};}['_integrateEditorBalloon'](_0x25ecf3){if(!_0x25ecf3['plugins']['has']('AIChatBalloon'))return;const _0x110ce6=_0x25ecf3['plugins']['get']('AIChatBalloon');this['_wiredBalloons']['has'](_0x110ce6)||(this['_wiredBalloons']['add'](_0x110ce6),this['_aiChatBalloon']||(this['_aiChatBalloon']=_0x110ce6),_0x110ce6['bind']('showDiff')['to'](this,'_aiChatBalloonShowDiff'),this['listenTo'](_0x110ce6,'toggleSuggestionDisplayMode',()=>{const {replyId:_0x1be479,partIndex:_0x3c208c}=this['_currentPreviewedChangeGroup'];this['_aiChatBalloonShowDiff']=!this['_aiChatBalloonShowDiff'];const {reply:_0x3943db}=this['getInteractionAndReplyById'](_0x1be479),_0x2ab63d=_0x3943db['changeGroups']['find'](_0x5e5b5e=>_0x5e5b5e['index']===_0x3c208c),_0x58c803=_0x2ab63d?this['_resolveGroupTarget'](_0x3943db,_0x2ab63d):null,_0x23fe2b=_0x3943db['getContentParts']({'showDiff':this['_aiChatBalloonShowDiff'],'groupIndex':_0x3c208c,'editor':_0x58c803?.['editor']??$s(this['context'])});(this['_activeBalloon']??_0x110ce6)['updateContent']({'part':_0x23fe2b[0x0],'renderingStrategy':'static','keepErrors':!0x0});}),this['listenTo'](_0x110ce6,'applySuggestion',()=>{const {replyId:_0x72d496,partIndex:_0x3097b4}=this['_currentPreviewedChangeGroup'];this['_applySuggestion']({'replyId':_0x72d496,'partIndex':_0x3097b4}),(this['_activeBalloon']??_0x110ce6)['setState']('accepted');}),this['listenTo'](_0x110ce6,'insertSuggestion',()=>{const {replyId:_0x1087dd,partIndex:_0x1f52b1}=this['_currentPreviewedChangeGroup'];this['_insertSuggestion']({'replyId':_0x1087dd,'partIndex':_0x1f52b1}),(this['_activeBalloon']??_0x110ce6)['setState']('accepted');}),this['listenTo'](_0x110ce6,'rejectSuggestion',()=>{const {replyId:_0x5b5f9a,partIndex:_0x598c46}=this['_currentPreviewedChangeGroup'];this['_rejectSuggestion']({'replyId':_0x5b5f9a,'partIndex':_0x598c46}),(this['_activeBalloon']??_0x110ce6)['setState']('rejected');}),this['listenTo'](_0x110ce6,'showNext',()=>{const {replyId:_0x39cf55,partIndex:_0x567dbe}=this['_currentPreviewedChangeGroup'],_0xc97926=this['_getPresentableSiblingContentPartIndex'](_0x39cf55,_0x567dbe,'next');null!==_0xc97926&&this['_openBalloonFor'](_0x39cf55,_0xc97926);}),this['listenTo'](_0x110ce6,'showPrevious',()=>{const {replyId:_0x2b93e1,partIndex:_0x49d207}=this['_currentPreviewedChangeGroup'],_0x2d1834=this['_getPresentableSiblingContentPartIndex'](_0x2b93e1,_0x49d207,'previous');null!==_0x2d1834&&this['_openBalloonFor'](_0x2b93e1,_0x2d1834);}),this['listenTo'](_0x110ce6,'dialogClosed',(_0x279ec8,{id:_0x1283d0})=>{if('aiChatBalloon'!==_0x1283d0)return;const {replyId:_0x4ca24d,partIndex:_0x1b6392}=this['_currentPreviewedChangeGroup'];this['_currentPreviewedChangeGroup']=null,this['_aiChatUi']['setFeedItemAIReplySuggestionPartActive']({'id':_0x4ca24d,'index':_0x1b6392,'isActive':!0x1}),this['_activeBalloon']===_0x110ce6&&(this['_activeBalloon']=void 0x0);}));}['_integrateEditor'](_0x3e760e){if(this['_integrateEditorBalloon'](_0x3e760e),_0x3e760e['plugins']['has']('Undo')){const _0xa88ad1=_0x3e760e['commands']['get']('undo'),_0x55cdd1=_0x3e760e['commands']['get']('redo');this['listenTo'](_0xa88ad1,'revert',(_0x193c31,_0x1b9de7,_0x10bcb8)=>{const _0x3211c5=this['_batchToChanges']['get'](_0x1b9de7);if(!_0x3211c5)return;const _0x17ca19=this['activeConversation']['getInteraction'](_0x3211c5['interactionId']),_0x317487=_0x17ca19?.['getReply'](_0x3211c5['replyId']);this['_batchToChanges']['delete'](_0x1b9de7),_0x17ca19&&_0x317487&&(_0x3211c5['indexes']['forEach'](_0x2c3cd6=>_0x317487['setChangeGroupState'](_0x2c3cd6,'pending')),this['_batchToChanges']['set'](_0x10bcb8,_0x3211c5));}),this['listenTo'](_0x55cdd1,'revert',(_0x3884e0,_0x4a5e20,_0x5bff56)=>{const _0x2ee1e2=this['_batchToChanges']['get'](_0x4a5e20);if(!_0x2ee1e2)return;const _0x392d19=this['activeConversation']['getInteraction'](_0x2ee1e2['interactionId']),_0x142009=_0x392d19?.['getReply'](_0x2ee1e2['replyId']);this['_batchToChanges']['delete'](_0x4a5e20),_0x392d19&&_0x142009&&(_0x2ee1e2['indexes']['forEach'](_0x587fbd=>_0x142009['setChangeGroupState'](_0x587fbd,'accepted')),this['_batchToChanges']['set'](_0x5bff56,_0x2ee1e2));});}const _0x2ac3e3=_0x3e760e['config']['get']('ai.chat.context');_0x2ac3e3['alwaysAddSelection']&&_0x2ac3e3['document']['enabled']&&this['listenTo'](_0x3e760e['model']['document']['selection'],'change:range',(_0x565cdb,_0x5a4d4f)=>{if(!_0x5a4d4f['directChange'])return;'chat'===_0x3e760e['plugins']['get']('AITabs')['view']['activeTab']&&(_0x3e760e['model']['hasContent'](_0x3e760e['model']['document']['selection'])?this['addSelectionToChatContext']():this['removeSelectionFromChatContext']());});}async['_getLastCreatedConversationId'](){const _0x4ba429=this['_aiConnector']['fetchConversations'](this['getGroupId'](),{'limit':0x1,'sortBy':'createdAt'});try{const _0x29c62b=await _0x4ba429['getConversations']();return _0x29c62b['length']?_0x29c62b[0x0]['id']:'new';}catch(_0x1fa259){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':_0x1fa259})),this['_aiChatUi']['toggleLoadingSkeleton'](!0x1),this['_aiChatUi']['disableControls'](),null;}}async['_startConversationSafely'](_0x50bf8f={}){try{this['_aiChatUi']['enableControls'](),await this['_handleStartConversation'](_0x50bf8f);}catch(_0x534b2a){this['_aiChatUi']['addFeedItemError']({'errorMessage':hs(this['context']['locale'],'AI_CHAT_UNABLE_TO_START_CONVERSATION'),'id':_0x50bf8f['id']||ot()}),console['error'](_0x534b2a),this['activeConversation']=void 0x0,this['_aiChatUi']['disableControls']();}}async['_handleStartConversation']({id:_0x19e8e8,modelId:_0x1a0946}={}){this['_activeBalloon']?.['close'](),this['_activeBalloon']=void 0x0,this['_currentPreviewedChangeGroup']=null;let _0x71ce43=_0x1a0946;_0x71ce43||(_0x19e8e8||!this['activeConversation']?_0x71ce43=this['context']['config']['get']('ai.models.defaultModelId'):this['_aiChatUi']['isModelAvailable']&&(_0x71ce43=this['activeConversation']['selectedModel']['id'])),await this['_stopLastInteraction']();const _0x1758c3=this['getGroupId'](),_0x453aaa=_0x19e8e8||ot();let _0x18e629;this['activeConversation']=new Gs({'connector':this['_aiConnector'],'chatModels':this['_aiChatModels'],'selectedModelId':_0x71ce43,'conversationId':_0x453aaa,'group':_0x1758c3,'getEditor':()=>$s(this['context']),'getEditors':()=>Ws(this['context']),'locale':this['context']['locale'],'isFromHistory':!!_0x19e8e8}),this['activeConversation']['delegate']('toolDataReceived','interactionCreated','interactionStarted','replyCreated')['to'](this),this['activeConversation']['on']('conversationInitialized',(_0x56ec87,_0x2221db)=>{this['_aiChatUi']['createConversation'](_0x2221db),this['_aiChatUi']['resetMessageInput'](),this['_aiChatUi']['clearPendingContextUI'](),this['_aiChatUi']['clearConversationContextUI'](),_0x19e8e8||(this['_aiChatUi']['resetConversationTitle'](),this['addCurrentDocumentToChatContext']());}),this['activeConversation']['on']('uploadProgressChanged',(_0x54e0cd,_0x420f82)=>{this['_aiChatUi']['setIsUploadInProgress'](_0x420f82['isUploadInProgress']);}),this['activeConversation']['on']('webSearchStarted',()=>{const _0x4aef94=this['_aiChatUi']['prepareLoadingMessage']({'isWebSearchEnabled':!0x0,'isReasoningEnabled':!0x1});this['_aiChatUi']['setLoadingMessage'](_0x4aef94);}),this['activeConversation']['on']('reasoningStarted',()=>{const _0x3b782a=this['_aiChatUi']['prepareLoadingMessage']({'isWebSearchEnabled':!0x1,'isReasoningEnabled':!0x0});this['_aiChatUi']['setLoadingMessage'](_0x3b782a);}),this['activeConversation']['on']('webSearchFinished',(_0x182581,_0x371ad2)=>{this['_aiChatUi']['addFeedInteractionHeader'](_0x371ad2,{'isWebSearchEnabled':!0x0,'isReasoningEnabled':!0x1});}),this['activeConversation']['on']('reasoningFinished',(_0x40a92e,_0x1e25e2)=>{this['_aiChatUi']['addFeedInteractionHeader'](_0x1e25e2,{'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',(_0x26c876,_0x273dc2)=>{this['_aiChatUi']['removeFeedInteraction'](_0x273dc2['id']);}),this['activeConversation']['on']('setConversationTitle',(_0x26e4ec,_0x1b9869,_0x2884f6)=>{this['_updateConversationTitle'](_0x1b9869,_0x2884f6);}),this['activeConversation']['on']('replyContentUpdated',async(_0x1b5a96,_0x1a7887)=>{void 0x0!==_0x18e629&&_0x18e629!==_0x1a7887['id']&&this['_updateReplyContentThrottled']['flush'](),_0x18e629=_0x1a7887['id'],_0x1a7887['isFromHistory']?await this['_updateReplyContent']({'reply':_0x1a7887}):await this['_updateReplyContentThrottled']({'reply':_0x1a7887});}),this['activeConversation']['on']('replyChangeGroupStateUpdated',(_0x427f32,{reply:_0x4259c9,index:_0x4615cf,state:_0x456e30})=>{this['_aiChatUi']['updateFeedItemAIReplySuggestionPartState']({'id':_0x4259c9['id'],'index':_0x4615cf,'state':_0x456e30}),this['_currentPreviewedChangeGroup']?.['replyId']['includes'](_0x4259c9['id'])&&this['_currentPreviewedChangeGroup']?.['partIndex']==_0x4615cf&&(this['_activeBalloon']??this['_aiChatBalloon'])?.['setState'](_0x456e30);}),this['activeConversation']['on']('contextItemAdded',(_0x56867a,_0x4cc4ba)=>{if(this['_aiChatUi']['addContextItem'](_0x4cc4ba['contextItem'],_0x4cc4ba['isLoading']),'selection'===_0x4cc4ba['contextItem']['type']){const _0x220c6d=[...$s(this['context'])['model']['document']['selection']['getRanges']()];this['_aiEditing']['showFakeVisualSelection']({'ranges':_0x220c6d,'id':'context','priority':0x1});}}),this['activeConversation']['on']('contextItemRemoved',(_0x33a7d3,_0x2e1e7d)=>{this['_aiChatUi']['removeContextItem'](_0x2e1e7d['uiId']),'current-document'==_0x2e1e7d['uiId']&&this['removeSelectionFromChatContext'](),'selection'===_0x2e1e7d['type']&&this['_aiEditing']['hideFakeVisualSelection']('context');}),this['activeConversation']['on']('contextItemLoadingEnded',(_0xc0beea,_0x58b2f5)=>{this['_aiChatUi']['setContextItemLoading'](_0x58b2f5['contextItem']['uiId'],_0x58b2f5['isLoading']);}),this['activeConversation']['on']('contextSent',(_0x34e6f5,_0x291b4a)=>{this['_aiChatUi']['setConversationContext'](_0x291b4a['contextItems']);}),this['activeConversation']['on']('addContextOptionsChanged',(_0x3fb85e,_0x2fef27)=>{this['_aiChatUi']['setAddContextOptions'](_0x2fef27['options']);}),this['activeConversation']['on']('sourceResourcesLoaded',(_0x3273a3,_0x71f9a)=>{this['_aiChatUi']['populateSourceResourceBalloon'](_0x71f9a['sourceId'],_0x71f9a['source'],_0x71f9a['resources'],_0x71f9a['uid']);}),this['activeConversation']['on']('resourceStateChanged',(_0x5bf95d,_0x4b7025)=>{this['_aiChatUi']['updateResourceState'](_0x4b7025['sourceId'],_0x4b7025['resourceId'],_0x4b7025['isInContext']);}),this['activeConversation']['on']('capabilitiesUpdated',(_0x38375c,_0x58dce4)=>{this['_aiChatUi']['updateCapabilities'](_0x58dce4);}),this['activeConversation']['on']('modelSelected',async(_0x11531f,_0x25be4f)=>{const _0x46c682=(await this['_aiChatModels']['getAll']())['find'](_0x7b4181=>_0x7b4181['id']===_0x25be4f['selectedModel']?.['id'])||null;this['_aiChatUi']['setSelectedModel'](_0x46c682,_0x25be4f['isDisabled']);}),this['activeConversation']['on']('error',(_0x48cab8,{error:_0x49fc50,interactionId:_0x52ae35,fileName:_0x2f741d,url:_0x4410e6,sourceId:_0x4510b1,sourceLabel:_0x90028})=>{const _0x47dc5d=_0x52ae35?_0x52ae35+':'+ot():ot();_0x49fc50['message']['startsWith']('ai-request-aborted')?this['_aiChatUi']['addFeedItemStaticMessage']({'staticMessage':hs(this['context']['locale'],'AI_CHAT_ABORTED_MESSAGE'),'id':_0x47dc5d}):_0x49fc50['message']['startsWith']('ai-chat-conversation-init-failed')||_0x49fc50['message']['startsWith']('ai-chat-conversation-start-failed')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':hs(this['context']['locale'],'AI_CHAT_UNABLE_TO_START_CONVERSATION'),'id':_0x47dc5d}),this['_logError'](_0x49fc50)):_0x49fc50['message']['startsWith']('ai-chat-file-upload-failed')?this['_aiChatUi']['addFeedItemError']({'errorMessage':hs(this['context']['locale'],'AI_CHAT_CONTEXT_UNABLE_TO_UPLOAD_FILE',_0x2f741d),'id':_0x47dc5d}):_0x49fc50['message']['startsWith']('ai-chat-url-upload-failed')?this['_aiChatUi']['addFeedItemError']({'errorMessage':hs(this['context']['locale'],'AI_CHAT_CONTEXT_UNABLE_TO_UPLOAD_URL',_0x4410e6),'id':_0x47dc5d}):_0x49fc50['message']['startsWith']('ai-chat-context-invalid-data')?this['_aiChatUi']['addFeedItemError']({'errorMessage':hs(this['context']['locale'],'AI_CHAT_CONTEXT_INVALID_DATA'),'id':_0x47dc5d}):_0x49fc50['message']['startsWith']('ai-chat-context-unsupported-type')?this['_aiChatUi']['addFeedItemError']({'errorMessage':hs(this['context']['locale'],'AI_CHAT_CONTEXT_UNSUPPORTED_TYPE'),'id':_0x47dc5d}):_0x49fc50['message']['startsWith']('ai-chat-source-resources-load-failed')?(_0x4510b1&&this['_aiChatUi']['closeSourceResourceBalloon'](_0x4510b1),this['_aiChatUi']['addFeedItemError']({'errorMessage':hs(this['context']['locale'],'AI_CHAT_CONTEXT_UNABLE_TO_LOAD_RESOURCES',_0x90028||'source'),'id':_0x47dc5d}),this['_logError'](_0x49fc50)):_0x49fc50['message']['startsWith']('ai-chat-resource-load-failed')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':hs(this['context']['locale'],'AI_CHAT_RESOURCE_LOAD_FAILED'),'id':_0x47dc5d}),this['_logError'](_0x49fc50)):_0x49fc50['message']['startsWith']('ai-chat-invalid-request')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':hs(this['context']['locale'],'AI_CHAT_INVALID_REQUEST'),'id':_0x47dc5d}),this['_logError'](_0x49fc50)):_0x49fc50['message']['startsWith']('ai-chat-context-unsupported-file-type')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':hs(this['context']['locale'],'AI_CHAT_CONTEXT_UNSUPPORTED_FILE_TYPE'),'id':_0x47dc5d}),this['_logError'](_0x49fc50)):_0x49fc50['message']['startsWith']('ai-chat-context-file-too-large')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':hs(this['context']['locale'],'AI_CHAT_CONTEXT_FILE_TOO_LARGE'),'id':_0x47dc5d}),this['_logError'](_0x49fc50)):_0x49fc50['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':_0x47dc5d}),this['_logError'](_0x49fc50)):_0x49fc50['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':_0x47dc5d}),this['_logError'](_0x49fc50)):(this['_aiChatUi']['addFeedItemError']({'errorMessage':hs(this['context']['locale'],'AI_CHAT_GENERIC_ERROR'),'id':_0x47dc5d}),this['_logError'](_0x49fc50));}),await this['activeConversation']['init'](this['context']['config']['get']('ai.chat.context')),_0x19e8e8||await this['activeConversation']['start']();}async['_handleUIUserMessage']({message:_0x321675,attributes:_0x10b7b0}){if(!this['activeConversation'])throw new at('ai-chat-controller-no-active-conversation');if(this['activeConversation']['isCurrentDocumentInContext']()){const _0x1c38fb=await this['_aiEditing']['getDocumentData']();_0x1c38fb['length']>0x1?await this['activeConversation']['updateCurrentDocumentsInContext'](_0x1c38fb):await this['activeConversation']['updateCurrentDocumentInContext'](_0x1c38fb[0x0]);}this['activeConversation']['id']&&this['activeConversation']['isStarted']&&await this['activeConversation']['handleUserInteraction']({'userMessage':_0x321675,'attributes':_0x10b7b0});}['_logError'](_0x4929ec){Et(_0x4929ec['message']);}['_removeFromContext'](_0x786837){this['activeConversation']?.['removeFromContext'](_0x786837);}['_toggleWebSearch'](){this['activeConversation']?.['toggleWebSearch']();}['_toggleReasoning'](){this['activeConversation']?.['toggleReasoning']();}['getInteractionAndReplyById'](_0x5108db){const [_0x797fa8,_0x4e7a78]=_0x5108db['split'](':'),_0x5ae042=this['activeConversation']['getInteraction'](_0x797fa8),_0x2d2d0a=_0x5ae042['getReply'](_0x4e7a78);return{'interaction':_0x5ae042,'reply':_0x2d2d0a};}['_resolveGroupTarget'](_0x400b30,_0x365b3f){const _0x413f5d=[..._0x365b3f['changes']['filter'](_0x16e20c=>'context'!==_0x16e20c['type']),..._0x365b3f['changes']['filter'](_0x3d5412=>'context'===_0x3d5412['type'])];for(const _0x2f371a of _0x413f5d){const _0x476f24=_0x400b30['newNodeAnchorIds']['get'](_0x2f371a['id']),_0x26e159=this['activeConversation']?.['getSourceByDataId'](_0x2f371a['id'])||this['activeConversation']?.['getSourceByDataId'](_0x476f24)||this['activeConversation']?.['getSourceByDataId'](_0x2f371a['anchorId']??void 0x0);if(_0x26e159){if('destroyed'===_0x26e159['editor']['state'])return null;const _0x15520b=_0x26e159['editor']['model']['document']['getRoot'](_0x26e159['rootName']);return _0x15520b?{'editor':_0x26e159['editor'],'root':_0x15520b,'parsedDocumentContent':_s(_0x26e159['content']),'serializedDocumentContent':_0x26e159['content'],'version':_0x26e159['version']}:null;}}const _0x53ce22=$s(this['context']),_0x334104=this['activeConversation']['getInteraction'](_0x400b30['interactionId']),_0x2910ad=_0x334104?.['getDocumentContext']();return{'editor':_0x53ce22,'root':_0x53ce22['model']['document']['getRoot'](),'parsedDocumentContent':_0x400b30['documentContextContent'],'serializedDocumentContent':_0x2910ad?.['content'],'version':_0x2910ad?.['version']};}['_groupChangesByTarget'](_0x2ed8e5,_0x38a98d){const _0xdbab7e=new Map();for(const _0x5cec11 of _0x38a98d){const _0x11beea=this['_resolveGroupTarget'](_0x2ed8e5,_0x5cec11);if(!_0x11beea)continue;const _0x30cb9b=(_0x11beea['editor']['id']||'e')+'|'+_0x11beea['root']['rootName'];let _0x3ece4c=_0xdbab7e['get'](_0x30cb9b);if(!_0x3ece4c){let _0x12432a;for(const _0x5d8f7d of[..._0x5cec11['changes']['filter'](_0x7819ac=>'context'!==_0x7819ac['type']),..._0x5cec11['changes']['filter'](_0x45a502=>'context'===_0x45a502['type'])])if(_0x12432a=this['activeConversation']?.['getDocumentContextSliceByDataId'](_0x5d8f7d['id'])||this['activeConversation']?.['getDocumentContextSliceByDataId'](_0x2ed8e5['newNodeAnchorIds']['get'](_0x5d8f7d['id'])),_0x12432a)break;_0x3ece4c={'target':{'editor':_0x11beea['editor'],'root':_0x11beea['root']},'slice':_0x12432a,'groups':[],'groupsIndexes':[]},_0xdbab7e['set'](_0x30cb9b,_0x3ece4c);}_0x3ece4c['groups']['push'](_0x5cec11),_0x3ece4c['groupsIndexes']['push'](_0x2ed8e5['changeGroups']['indexOf'](_0x5cec11));}return Array['from'](_0xdbab7e['values']());}['_scrollToSuggestionRange'](_0x2c1246,_0xa79bd0=!0x1,_0x252d6c){const _0x48108f={'target':_0x252d6c['editing']['view']['domConverter']['viewRangeToDom'](_0x252d6c['editing']['mapper']['toViewRange'](_0x2c1246)),'viewportOffset':{'top':0x96,'left':0x0,'bottom':0x32,'right':0x0},'ancestorOffset':0x14,'alignToTop':_0xa79bd0};_0xa79bd0&&(_0x48108f['alignToTop']=!0x0),Ct(_0x48108f);}['_updateConversationTitle'](_0x2b29c8,_0x4d0bf7=!0x1){this['_aiChatUi']['setConversationTitle'](_0x2b29c8||hs(this['context']['locale'],'AI_CHAT_UNTITLED_CONVERSATION'),_0x4d0bf7);}['_addFeedItemReply'](_0x1f02c8){'text'===_0x1f02c8['type']?this['_aiChatUi']['addFeedItemAIReply'](_0x1f02c8):this['_aiChatUi']['addFeedItemAISuggestion'](_0x1f02c8);}async['_updateReplyContent']({reply:_0x3be72c,renderingStrategy:_0x5bf180}){const {id:_0x4419b4,interactionId:_0x10695f,isDone:_0x1c49ce,type:_0x2f0382,parsedContent:_0xe8588b}=_0x3be72c,_0x39624c=_0x10695f+':'+_0x4419b4;if('modification'===_0x2f0382){const _0x36923f=_0x3be72c['getContentParts']({'showDiff':this['_aiChatUi']['showDiff'],'editor':$s(this['context'])});await this['_aiChatUi']['updateFeedItemAIReplySuggestionContent']({'id':_0x39624c,'parts':_0x36923f,'isDone':_0x1c49ce,'skipLoadingEffects':_0x3be72c['isFromHistory']});}else'text'===_0x2f0382&&await this['_aiChatUi']['updateFeedItemAIReplyContent']({'id':_0x39624c,'parsedContent':_0xe8588b,'renderingStrategy':_0x5bf180,'isDone':_0x1c49ce});_0x1c49ce&&_0x3be72c['sources']['length']>0x0&&this['_aiChatUi']['updateFeedItemAIReplySources'](_0x39624c,_0x3be72c['sources']);}['_updateReplyContentThrottled']=_0x409273(this['_updateReplyContent']['bind'](this),0xc8);async['_stopLastInteraction'](){const _0x579dfb=this['activeConversation']?.['lastInteraction'];_0x579dfb&&(_0x579dfb['stop'](),this['_aiChatUi']['stopInteraction'](_0x579dfb)),this['_updateReplyContentThrottled']['cancel']();}async['_flushLastInteractionUI'](){const _0xc4b496=this['activeConversation']?.['lastInteraction'];if(_0xc4b496){for await(const _0x2a571c of _0xc4b496['replies'])this['_aiChatUi']['hasFeedItem'](_0x2a571c['id'])||this['_addFeedItemReply'](_0x2a571c),await this['_updateReplyContent']({'reply':_0x2a571c,'renderingStrategy':'static'});}}['_updateRatings'](_0x5c0742){const _0x58c0a1={'positiveCount':_0x5c0742['changeGroups']['filter'](_0x428ee0=>'accepted'===_0x428ee0['state'])['length'],'totalCount':_0x5c0742['changeGroups']['length'],'modificationId':_0x5c0742['id']},_0x4dc0c3=this['activeConversation']['getInteraction'](_0x5c0742['interactionId'])['messageId'];_0x4dc0c3&&this['_aiConnector']['upsertAIChatRating'](this['activeConversation']['id'],_0x4dc0c3,_0x58c0a1);}['_getAIChatFeedAPI'](_0x38e6ca){const _0x2b47d2=this['_aiChatUi'],_0x8fb0a9=()=>{_0x38e6ca['resetWebSearchState'](),_0x38e6ca['resetReasoningState'](),_0x2b47d2['clearLoadingMessage']();},_0x4881b8=()=>{_0x38e6ca['currentReply']&&(_0x38e6ca['currentReply']['done'](),_0x38e6ca['currentReply']=void 0x0);};return{'insertTextReply':(_0x21c745,_0x56bd9c)=>{_0x4881b8(),_0x8fb0a9();const _0x21e909=_0x38e6ca['currentReply']=_0x38e6ca['createReply']({'type':'text','interactionId':_0x38e6ca['id'],'content':_0x21c745,'id':_0x56bd9c||ot()});return _0x4881b8(),_0x21e909;},'insertCustomElement':async(_0x3e3658,_0x1062e9)=>(_0x4881b8(),_0x8fb0a9(),_0x2b47d2['addFeedItemCustomElement'](_0x3e3658,_0x1062e9||ot())),'setLoadingMessage':_0x18deb3=>{_0x2b47d2['setLoadingMessage'](_0x18deb3);},'clearLoadingMessage':()=>{_0x2b47d2['clearLoadingMessage']();}};}}const zs='ai-selection',js=['br'];class Js extends _0x1c4723{constructor(_0x4ab2c3){super(_0x4ab2c3),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 _0x181a69=Ws(this['context']),_0x49eebe=_0x181a69['find'](_0x48290b=>_0x48290b['plugins']['has']('RealTimeCollaborationClient'))||_0x181a69[0x0],_0x304cb7=_0x49eebe['plugins']['has']('RealTimeCollaborationClient')&&_0x49eebe['plugins']['get']('RealTimeCollaborationClient')['sessionId'];this['_sessionId']=_0x304cb7||ot();}return this['_sessionId'];}async['getDocumentData'](){const _0x541fec=Ws(this['context']);if(!_0x541fec['length'])throw new at('ai-get-editor-from-context-no-editor');const _0x377dd9=[],_0x85bc16=new Set();for(const _0x4949f3 of _0x541fec){const _0x294461=_0x4949f3['config']['get']('roots')||{};for(const _0x799828 of _0x4949f3['model']['document']['getRoots']()){if('$graveyard'===_0x799828['rootName'])continue;const _0x5aaf16=await this['_getDocumentDataForEditorRoot'](_0x4949f3,_0x799828,_0x85bc16),_0x14b221=_0x294461[_0x799828['rootName']];_0x377dd9['push']({'editor':_0x4949f3,'rootName':_0x799828['rootName'],'content':_0x5aaf16['content'],'version':_0x5aaf16['version'],'sessionId':this['sessionId'],'channelId':_0x4949f3['config']['get']('collaboration.channelId'),'selections':_0x5aaf16['selections'],'name':_0x799828['rootName'],'description':_0x14b221?.['description']});}}return _0x377dd9;}async['_getDocumentDataForEditorRoot'](_0xe39748,_0x2f3e1e,_0x22edc0){const _0x1b3903=_0xe39748['data']['toView'](_0x2f3e1e,{'convertAiChatSelectionMarker':!0x0}),_0x987f12=new _0x3530dd(_0xe39748['editing']['view']['document']);this['_setDataIdsOnChildren'](_0x1b3903,_0x987f12,_0x22edc0);let _0x432280=await this['_getDocumentDataStringFromView'](_0x1b3903,_0xe39748);const _0x9a1d4e=this['_getMarkersInDocumentOrder'](_0xe39748,_0x2f3e1e),_0x4aa124=[];for(const _0x3062b9 of _0x9a1d4e){const _0x50c864='<'+_0x3062b9['name']+':start></'+_0x3062b9['name']+':start>',_0x403d0f=_0x432280['indexOf'](_0x50c864);_0x432280=_0x432280['substring'](0x0,_0x403d0f)+_0x432280['substring'](_0x403d0f+_0x50c864['length']);const _0x15a57d='<'+_0x3062b9['name']+':end></'+_0x3062b9['name']+':end>',_0x5c5236=_0x432280['indexOf'](_0x15a57d);_0x432280=_0x432280['substring'](0x0,_0x5c5236)+_0x432280['substring'](_0x5c5236+_0x15a57d['length']),_0x4aa124['push']({'markerName':_0x3062b9['name'],'start':_0x403d0f,'end':_0x5c5236,'htmlFragment':_0x432280['substring'](_0x403d0f,_0x5c5236)});}return{'content':_0x432280,'version':_0xe39748['model']['document']['version'],'selections':_0x4aa124};}async['afterInit'](){this['context']instanceof _0x597112?this['_integrateEditor'](this['context']):this['listenTo'](this['context']['editors'],'add',(_0x1335e3,_0x5b9312)=>{_0x5b9312['on']('ready',()=>{this['_integrateEditor'](_0x5b9312);});});}['_setOutputDataProcessor'](_0x2da3ae){this['_outputDataProcessor']=_0x2da3ae;}async['_getDocumentDataStringFromView'](_0x1c741d,_0x4e4637){let _0x28c4ef;if(this['_outputDataProcessor']){const _0xa7258d=_0x4e4637['data']['processor']['domConverter']['viewToDom'](_0x1c741d),_0x1975da=await this['_outputDataProcessor'](_0xa7258d);_0x28c4ef=_0x4e4637['data']['processor']['htmlWriter']['getHtml'](_0x1975da);}else _0x28c4ef=_0x4e4637['data']['processor']['toData'](_0x1c741d);return _0x28c4ef;}['_integrateEditor'](_0x5fb22c){if(!_0x5fb22c['config']['get']('collaboration.channelId'))throw new at('ai-missing-channel-id',_0x5fb22c);_0x5fb22c['ui']['focusTracker']['on']('change:isFocused',(_0x1e8f6b,_0x1d3e13,_0x15f16b)=>{_0x15f16b&&(this['_lastContentFocusedEditor']=_0x5fb22c);}),_0x5fb22c['on']('destroy',()=>{this['_lastContentFocusedEditor']===_0x5fb22c&&(this['_lastContentFocusedEditor']=void 0x0);}),_0x5fb22c['conversion']['for']('editingDowncast')['markerToHighlight']({'model':zs,'view':({markerName:_0x522070})=>({'classes':['ck-ai-assistant-ui_theme','ck-fake-ai-selection','ck-fake-ai-selection-'+_0x522070['split'](':')[0x1]],'priority':0xc})}),_0x5fb22c['conversion']['for']('dataDowncast')['markerToElement']({'model':zs+':context','view':(_0x63923f,{writer:_0x2f1334,options:_0x55c9e2})=>_0x55c9e2['convertAiChatSelectionMarker']?_0x2f1334['createUIElement'](_0x63923f['markerName']+':'+(_0x63923f['isOpening']?'start':'end')):null});}['showFakeVisualSelection'](_0x59f0ec){const _0x1c858b=this['_fakeSelections'][0x0]||null;this['_addFakeSelection'](_0x59f0ec);const _0x10a68e=this['_fakeSelections'][0x0]||null;this['_refreshFakeSelection'](_0x1c858b,_0x10a68e);}['hideFakeVisualSelection'](_0x1b036e){const _0x554f38=this['_fakeSelections'][0x0]||null;this['_removeFakeSelectionById'](_0x1b036e);const _0x197ecc=this['_fakeSelections'][0x0]||null;this['_refreshFakeSelection'](_0x554f38,_0x197ecc);}async['modelToDataWithIds'](_0x392c3a){const _0x438b18=$s(this['context']),_0x2fb690=_0x438b18['data']['toView'](_0x392c3a),_0x450894=new _0x3530dd(_0x438b18['editing']['view']['document']);return this['_setDataIdsOnChildren'](_0x2fb690,_0x450894),this['_getDocumentDataStringFromView'](_0x2fb690,_0x438b18);}['_setDataIdsOnChildren'](_0x1b634e,_0x6e4508,_0x321b42=new Set()){let _0x3b6f8d=!0x1;for(const _0x4bd503 of _0x1b634e['getChildren']()){if(!_0x4bd503['is']('view:element')||js['includes'](_0x4bd503['name']))continue;const _0x3c077a=_0x4bd503['is']('view:containerElement'),_0x5b567a=_0x4bd503['is']('view:emptyElement'),_0x183711=this['_setDataIdsOnChildren'](_0x4bd503,_0x6e4508,_0x321b42);if(_0x4bd503['hasAttribute']('data-id')){_0x3b6f8d=!0x0,_0x321b42['add'](_0x4bd503['getAttribute']('data-id'));continue;}(_0x3c077a||_0x5b567a||_0x183711)&&(_0x6e4508['setAttribute']('data-id',this['_nextDataId'](_0x321b42),_0x4bd503),_0x3b6f8d=!0x0);}return _0x3b6f8d;}['_nextDataId'](_0xc60d65){let _0x47456f;do{_0x47456f='';for(let _0x2aaacc=0x0;_0x2aaacc<0x4;_0x2aaacc++)_0x47456f+=String['fromCharCode'](0x61+Math['floor'](0x1a*Math['random']()));}while(_0xc60d65['has'](_0x47456f));return _0xc60d65['add'](_0x47456f),_0x47456f;}['getSelectionText'](){const {model:_0x4f8ec9}=$s(this['context']),_0x37a60b=_0x4f8ec9['document']['selection'],_0x55d5fd=[],_0x444f4b=Array['from'](_0x37a60b['getRanges']());_0x444f4b['sort']((_0x1edb74,_0x52209d)=>_0x1edb74['start']['isBefore'](_0x52209d['start'])?-0x1:0x1);for(const _0x2b22b5 of _0x444f4b)for(const _0x2a1163 of _0x2b22b5['getItems']())_0x2a1163['is']('$textProxy')?_0x55d5fd['push'](_0x2a1163['data']):_0x2a1163['is']('element')&&_0x55d5fd['length']>0x0&&'\x20'!==_0x55d5fd[_0x55d5fd['length']-0x1]&&_0x55d5fd['push']('\x20');return _0x55d5fd['length']?'\x22'+_0x55d5fd['join']('')['trim']()+'\x22':hs(this['context']['locale'],'AI_CHAT_CONTEXT_DOCUMENT_SELECTION_LABEL');}['_removeFakeSelectionById'](_0x3d8233){for(let _0x3fc169=0x0;_0x3fc169<this['_fakeSelections']['length'];_0x3fc169++)if(this['_fakeSelections'][_0x3fc169]['id']==_0x3d8233)return void this['_fakeSelections']['splice'](_0x3fc169,0x1);}['_addFakeSelection'](_0x48c622){this['_removeFakeSelectionById'](_0x48c622['id']),wt(this['_fakeSelections'],_0x48c622);}['_refreshFakeSelection'](_0x153340,_0x3ec0af){if(_0x153340==_0x3ec0af)return;const _0x10fbfe=_0x153340?this['_getEditorForFakeSelection'](_0x153340):null,_0x21696c=_0x3ec0af?this['_getEditorForFakeSelection'](_0x3ec0af):null,_0x47472a=(_0x1dc288,_0x55534e)=>{const _0xeb44cf=_0x55534e['model']['markers']['getMarkersGroup'](zs);for(const _0x3bf6fb of _0xeb44cf)_0x1dc288['removeMarker'](_0x3bf6fb);},_0x4f1b74=(_0x46c3bc,_0x46bd3e,_0x34febf)=>{const _0x168d46=_0x46bd3e['model'];for(let _0x2f18bc=0x0;_0x2f18bc<_0x34febf['ranges']['length'];_0x2f18bc++){let _0xe1af78=_0x34febf['ranges'][_0x2f18bc];const _0x1d046a=zs+':'+_0x34febf['id']+':'+_0x2f18bc;if(_0xe1af78['start']['isAtEnd']){const _0x394303=_0xe1af78['start']['getLastMatchingPosition'](({item:_0x2338d8})=>!_0x168d46['schema']['isContent'](_0x2338d8),{'boundaries':_0xe1af78});_0xe1af78=_0x46c3bc['createRange'](_0x394303,_0xe1af78['end']);}_0x46c3bc['addMarker'](_0x1d046a,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0xe1af78});}};_0x10fbfe&&_0x21696c&&_0x10fbfe===_0x21696c&&_0x3ec0af?_0x10fbfe['model']['change'](_0x188161=>{_0x47472a(_0x188161,_0x10fbfe),_0x4f1b74(_0x188161,_0x21696c,_0x3ec0af);}):(_0x10fbfe&&_0x10fbfe['model']['change'](_0x4e8973=>_0x47472a(_0x4e8973,_0x10fbfe)),_0x21696c&&_0x3ec0af&&_0x21696c['model']['change'](_0x154b3c=>_0x4f1b74(_0x154b3c,_0x21696c,_0x3ec0af)));}['_getEditorForFakeSelection'](_0x36fdb7){if(!_0x36fdb7['ranges']['length'])return $s(this['context']);const _0x48efd3=_0x36fdb7['ranges'][0x0]['root']['document'];return Ws(this['context'])['find'](_0x4df761=>_0x4df761['model']['document']===_0x48efd3)??$s(this['context']);}['_getMarkersInDocumentOrder'](_0x473693,_0x451a82){const _0x2c5f67=Array['from'](_0x473693['model']['markers']['getMarkersGroup'](zs+':context'));return(_0x451a82?_0x2c5f67['filter'](_0x435a51=>{const _0x48ff9c=_0x435a51['getRange']();return _0x48ff9c&&_0x48ff9c['root']['rootName']===_0x451a82['rootName'];}):_0x2c5f67)['sort']((_0x52b818,_0x42a85f)=>_0x52b818['getStart']()['isBefore'](_0x42a85f['getStart']())?-0x1:_0x52b818['getStart']()['isAfter'](_0x42a85f['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(_0x32a873){const _0x51bf80=new AbortController();return{'promise':new Promise((_0x1dd684,_0x521f2f)=>{const _0x2ced68=setTimeout(_0x1dd684,_0x32a873);_0x51bf80['signal']['addEventListener']('abort',()=>{clearTimeout(_0x2ced68),_0x521f2f();});}),'abortController':_0x51bf80};}class sn{['options'];['isStreaming']=!0x1;['document']=null;['nodesList']=[];['currentIndex']=0x0;['timeoutAbortController']=null;['lastUpdateTime']=0x0;constructor(_0x5782ce){this['options']={'delay':_0x5782ce?.['delay']??0xa,'textNodeStyle':_0x5782ce?.['textNodeStyle']??'animation:\x20ck-html-streamer-fade-in\x20.3s'};}async['stream']({document:_0x30d7c6,targetElement:_0x1e1be9,abortSignal:_0x23fe69}){this['isStreaming']&&this['stop'](),_0x23fe69?.['addEventListener']('abort',this['stop']['bind'](this)),this['document']=_0xbcafee(_0x30d7c6,!0x0),this['nodesList']=this['getParsedDocumentNodeList'](),this['isStreaming']=!0x0,this['currentIndex']>this['nodesList']['length']&&(this['currentIndex']=this['nodesList']['length']);for(let _0x219a02=0x0;_0x219a02<this['currentIndex'];_0x219a02++)this['nodesList'][_0x219a02]['shouldBeStreamed']=!0x0;do{const _0x45a571=Date['now'](),_0x5e30ed=this['nodesList'][this['currentIndex']],_0xc3e294=_0x45a571-this['lastUpdateTime'];if(_0x5e30ed){_0x5e30ed['shouldBeStreamed']=!0x0;let _0x3a8bbc=_0x5e30ed['parent'];for(;_0x3a8bbc;)_0x3a8bbc['shouldBeStreamed']=!0x0,_0x3a8bbc=_0x3a8bbc['parent'];}if(_0xc3e294<this['options']['delay'])try{const {promise:_0x13daaf,abortController:_0x3399e7}=en(this['options']['delay']-_0xc3e294);this['timeoutAbortController']=_0x3399e7,await _0x13daaf;}catch(_0x3a0d25){return;}_0x4e0b1b(_0x1e1be9,'<'+_0x1e1be9['tagName']+'>'+this['renderNode'](this['document'])+'</'+_0x1e1be9['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:_0x1010cb}){Array['from'](_0x1010cb['querySelectorAll']('span[data-ck-html-streamer-word-chunk]'))['reverse']()['forEach'](_0x3a848d=>{_0x3a848d['replaceWith'](_0x3a848d['childNodes'][0x0]);});}['stop'](){this['isStreaming']=!0x1,this['timeoutAbortController']&&(this['timeoutAbortController']['abort'](),this['timeoutAbortController']=null);}['renderNode'](_0x446e09){let _0x2d8b39='';if(function(_0x20497e){return _0x487e21(_0x20497e);}(_0x446e09)){for(const _0x2f4f63 of _0x446e09['children'])_0x2d8b39+=this['renderNode'](_0x2f4f63);}else{if(on(_0x446e09)){if(!_0x446e09['shouldBeStreamed'])return'';const _0x17bd10=_0x446e09,_0x296563=Object['entries'](_0x17bd10['attribs'])['map'](([_0x190beb,_0x1922d2])=>_0x190beb+'=\x22'+_0x1922d2+'\x22')['join']('\x20');_0x2d8b39+='<'+_0x17bd10['tagName']+(_0x296563?'\x20'+_0x296563:'')+'>';for(const _0x439696 of _0x348abb(_0x17bd10))_0x2d8b39+=this['renderNode'](_0x439696);_0x2d8b39+='</'+_0x17bd10['tagName']+'>';}else{if(!rn(_0x446e09))return'';if(!_0x446e09['shouldBeStreamed'])return'';!function(_0x35b577){if(!_0x35b577['parent']||!on(_0x35b577['parent']))return!0x1;if(!nn['includes'](_0x35b577['parent']['tagName']))return!0x1;return!_0x3a29a5(_0x35b577)['match'](/^\s*[<>]\s*$/);}(_0x446e09)?_0x2d8b39+=ti(_0x446e09):_0x2d8b39+=ti(new _0x47c6a6('span',{'data-ck-html-streamer-word-chunk':'','style':this['options']['textNodeStyle']},[_0x446e09]));}}return _0x2d8b39;}['getParsedDocumentNodeList'](){const _0x788822=[];return function(_0x429774,_0x2577d6){const _0x1c7884=_0x52b8f6=>{if(_0x2577d6(_0x52b8f6),_0x52b8f6 instanceof _0x20b9a9)for(let _0x2c5170=0x0;_0x2c5170<_0x52b8f6['children']['length'];_0x2c5170++){const _0x361133=_0x52b8f6['children'][_0x2c5170];_0x1c7884(_0x361133);}};for(let _0x136153=0x0;_0x136153<_0x429774['children']['length'];_0x136153++)_0x1c7884(_0x429774['children'][_0x136153]);}(this['document'],_0x3a9af6=>{if(rn(_0x3a9af6)){const _0x4ed6cc=this['splitTextNodeIntoWordNodes'](_0x3a9af6);_0x4ed6cc['length']&&_0x788822['push'](..._0x4ed6cc);}_0x3a9af6['isWordSplitSource']||_0x3a9af6['isWordSplitResult']||_0x788822['push'](_0x3a9af6);}),_0x788822;}['splitTextNodeIntoWordNodes'](_0x584ab6){if(_0x584ab6['isWordSplitSource']||_0x584ab6['isWordSplitResult'])return[];const _0x1b70f7=_0x3a29a5(_0x584ab6)['match'](/(?:\s*\S+\s*)/g),_0x47523a=[];if(_0x1b70f7&&_0x1b70f7['length']>0x1){for(const _0x3b0371 of _0x1b70f7){const _0x3cb81a=new _0x41b5f7(_0x3b0371);_0x3cb81a['isWordSplitResult']=!0x0,_0x5014cb(_0x584ab6,_0x3cb81a),_0x47523a['push'](_0x3cb81a);}_0x584ab6['isWordSplitSource']=!0x0,_0x565d3d(_0x584ab6);}return _0x47523a;}}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(_0x2b77e8){return _0x2e5069(_0x2b77e8);}function on(_0x2faa25){return _0x30b8f4(_0x2faa25);}class an extends vt{['options'];['content']='';['htmlStreamer'];['children'];constructor(_0x58e5ba){super();const _0xa611c1=this['bindTemplate'];this['set']('isDone',!0x1),this['set']('isVisible',!0x0),this['htmlStreamer']=new sn(),this['options']=_0x58e5ba,this['children']=this['createCollection'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed__item',_0xa611c1['if']('isDone','ck-ai-chat__feed__item_done'),_0xa611c1['if']('isVisible','ck-hidden',_0x580f21=>!_0x580f21),'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'](_0x3da077=>{_0x3da077['removeAttribute']('data-id');}),this['isDone']=!0x0;}async['streamIntoElement'](_0x254d24,_0x4b3cf4,_0x23beab){await this['htmlStreamer']['stream']({'document':_0x254d24,'targetElement':_0x4b3cf4,'abortSignal':_0x23beab});}}class hn extends vt{['showChangesToggleView'];constructor(_0x5c21e6,_0x54a72c){super(_0x5c21e6),this['set']('isShowChangesToggleVisible',!0x0),this['showChangesToggleView']=new cn(_0x5c21e6),this['showChangesToggleView']['set']({'class':'ck-ai-suggestion__header__show-changes-toggle\x20ck-ai-chat-controls-button\x20'+us,'label':hs(_0x5c21e6,'AI_SUGGESTION_BUTTON_SHOW_CHANGES'),'withText':!0x0}),this['showChangesToggleView']['isOn']=_0x54a72c['showDiff'],this['showChangesToggleView']['bind']('isVisible')['to'](this,'isShowChangesToggleVisible'),this['showChangesToggleView']['bind']('icon')['to'](this['showChangesToggleView'],'isOn',_0x3e9746=>_0x3e9746?_0x468096:_0x212f7c),this['showChangesToggleView']['on']('execute',()=>{this['showChangesToggleView']['isOn']=!this['showChangesToggleView']['isOn'],this['fire']('toggleShowChanges',{'isOn':this['showChangesToggleView']['isOn']});});const _0x4b64be=new xt();_0x4b64be['content']=_0x31ce36,this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__header',!0x1===_0x54a72c['showHeader']?'ck-hidden':null]['filter'](Boolean)},'children':[_0x4b64be,{'tag':'span','children':[hs(_0x5c21e6,'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':_0x15a8f9,'rejected':_0xd0bad4,'outdated':_0xd0bad4};class un extends vt{['stateIconView'];constructor(_0x57b0c2){super(_0x57b0c2);const _0x4bb8e5=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',_0x4bb8e5['to']('state',_0x458425=>'ck-ai-suggestion__content-part-state_'+_0x458425),_0x4bb8e5['if']('isVisible','ck-hidden',_0x53fc24=>!_0x53fc24)]},'children':[{'tag':'span','attributes':{'class':['ck-ai-suggestion__content-part-state__label']},'children':[{'text':_0x4bb8e5['to']('state',_0x4de9ab=>{switch(_0x4de9ab){case'accepted':return hs(_0x57b0c2,'AI_SUGGESTION_CONTENT_PART_STATE_ACCEPTED');case'rejected':return hs(_0x57b0c2,'AI_SUGGESTION_CONTENT_PART_STATE_REJECTED');case'outdated':return hs(_0x57b0c2,'AI_SUGGESTION_CONTENT_PART_STATE_OUTDATED');}})}]},this['stateIconView']]});}['setState'](_0x231e5e){this['state']=_0x231e5e;}}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(_0x1a5032,_0x1b66d8,_0x4e5b7c){super(_0x1a5032);const _0x4b30c5=Boolean(_0x4e5b7c);this['set']('isEnabled',!_0x4b30c5),this['set']('isVisible',!0x0),this['class']='ck-ai-suggestion-content-part-toolbar';const _0x22ed64=[];if(_0x4b30c5){const _0x12d4ed=new Nt(_0x1a5032);_0x12d4ed['set']({'label':hs(_0x1a5032,'AI_SUGGESTION_DISABLED_TOOLTIP_MESSAGE'),'tooltip':!0x0,'withText':!0x1,'icon':_0x5c9dab}),_0x12d4ed['extendTemplate']({'attributes':{'data-cke-tooltip-class':'ck-ai-suggestion-content-part-disabled-actions-tooltip'}}),_0x22ed64['push'](_0x12d4ed);}else{_0x1b66d8['includes']('applySuggestion')&&(this['_applyButton']=new Nt(_0x1a5032),this['_applyButton']['set']({'label':hs(_0x1a5032,'AI_SUGGESTION_CONTENT_PART_APPLY'),'tooltip':!0x0,'tooltipPosition':'n','withText':!0x1,'icon':_0x15a8f9}),this['_applyButton']['bind']('isEnabled')['to'](this),this['_applyButton']['on']('execute',()=>{this['fire']('applySuggestion');}),_0x22ed64['push'](this['_applyButton'])),_0x1b66d8['includes']('insertSuggestion')&&(this['_suggestButton']=new Nt(_0x1a5032),this['_suggestButton']['set']({'label':hs(_0x1a5032,'AI_SUGGESTION_CONTENT_PART_ADD_SUGGESTION'),'tooltip':!0x0,'tooltipPosition':'n','withText':!0x1,'icon':_0x16a0fb}),this['_suggestButton']['bind']('isEnabled')['to'](this),this['_suggestButton']['on']('execute',()=>{this['fire']('insertSuggestion');}),_0x22ed64['push'](this['_suggestButton']));const _0x3199f2=new Nt(_0x1a5032);_0x3199f2['set']({'label':hs(_0x1a5032,'AI_SUGGESTION_CONTENT_PART_REJECT'),'tooltip':!0x0,'tooltipPosition':'n','withText':!0x1,'icon':_0xd0bad4}),_0x3199f2['bind']('isEnabled')['to'](this),_0x3199f2['on']('execute',()=>{this['fire']('rejectSuggestion');}),_0x22ed64['push'](_0x3199f2);}this['items']['addMany'](_0x22ed64);const _0xd8ee96=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':[_0xd8ee96['if']('isVisible','ck-hidden',_0x4ec44e=>!_0x4ec44e)]}});}['setButtonsVisibility']({showApplyButton:_0x471da3,showSuggestButton:_0x57f05b}){this['_applyButton']&&(this['_applyButton']['isVisible']=_0x471da3),this['_suggestButton']&&(this['_suggestButton']['isVisible']=_0x57f05b);}}class gn extends vt{['toolbarView'];['stateView'];['titleLabelView'];['children'];constructor(_0x3df562,{part:_0x358c25,uiIndex:_0x5bab06,availableActions:_0x37317e,areActionsDisabled:_0x14db38}){super(_0x3df562),this['set']('isEnabled',!0x0),this['set']('state','pending'),this['toolbarView']=new _n(_0x3df562,_0x37317e,_0x14db38),this['toolbarView']['on']('rejectSuggestion',()=>{this['fire']('rejectSuggestion',{'index':_0x358c25['index']});}),this['toolbarView']['on']('insertSuggestion',()=>{this['fire']('insertSuggestion',{'index':_0x358c25['index']});}),this['toolbarView']['on']('applySuggestion',()=>{this['fire']('applySuggestion',{'index':_0x358c25['index']});}),this['toolbarView']['bind']('isEnabled')['to'](this),this['stateView']=new un(_0x3df562),this['titleLabelView']=new An(_0x3df562,_0x5bab06),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',(_0x1541c2,_0x20c225,_0x35ca85,_0x1e9d66)=>{'pending'===_0x1e9d66?this['children']['remove'](this['toolbarView']):this['children']['remove'](this['stateView']),'pending'===_0x35ca85?this['children']['add'](this['toolbarView']):(this['stateView']['setState'](_0x35ca85),this['children']['add'](this['stateView']));});}}class An extends vt{constructor(_0x59231b,_0x5263c5){super(_0x59231b),this['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai-suggestion__body__content-part__title__label']},'children':[hs(_0x59231b,'AI_SUGGESTION_CONTENT_PART_TITLE',_0x5263c5['toString']())]});}}class In extends vt{['htmlStreamer'];constructor(_0x4e8497){super(_0x4e8497),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:_0x33ad45,renderingStrategy:_0x512f40,abortSignal:_0x31aa38}){'streaming'===_0x512f40?await this['htmlStreamer']['stream']({'document':_0x33ad45['content'],'targetElement':this['element'],'abortSignal':_0x31aa38}):_0x4e0b1b(this['element'],'<'+this['element']['tagName']+'>'+gs(_0x33ad45['content'])+'</'+this['element']['tagName']+'>',{'childrenOnly':!0x0});}['clear'](){this['htmlStreamer']['reset'](),this['element']['innerHTML']='';}}class En extends vt{['_children'];['_headerView'];['_streamableContentView'];constructor(_0x1fc2c5,{part:_0x3f3df7,uiIndex:_0x141262,areActionsDisabled:_0x3944f7,availableActions:_0x4e6593}){super(_0x1fc2c5);const _0x354550=this['bindTemplate'];this['set']('state','pending'),this['set']('isDone',!0x1),this['set']('isVisible',!0x1),this['set']('isActive',!0x1),this['set']('isEnabled',!0x1);const _0x4a6db2=()=>{this['isEnabled']=this['isDone']&&'pending'==this['state']&&!_0x3944f7;};this['on']('change:state',_0x4a6db2),this['on']('change:isDone',_0x4a6db2),_0x4a6db2(),this['_children']=this['createCollection'](),this['_headerView']=new gn(_0x1fc2c5,{'part':_0x3f3df7,'uiIndex':_0x141262,'availableActions':_0x4e6593,'areActionsDisabled':_0x3944f7}),this['_headerView']['bind']('isEnabled','state')['to'](this),this['_headerView']['delegate'](...Zs)['to'](this),this['_streamableContentView']=new In(_0x1fc2c5),this['_children']['addMany']([this['_headerView'],this['_streamableContentView']]),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__body__content-part',_0x354550['to']('state',_0x347a88=>'ck-ai-suggestion__body__content-part_'+_0x347a88),_0x354550['if']('isEnabled','ck-ai-suggestion__body__content-part_enabled'),_0x354550['if']('isActive','ck-ai-suggestion__body__content-part_active'),_0x354550['if']('isVisible','ck-hidden',_0x132ebb=>!_0x132ebb)]},'children':this['_children'],'on':{'mouseenter':_0x354550['to'](()=>{this['isEnabled']&&this['fire']('mouseOverSuggestion',{'index':_0x3f3df7['index']});}),'mouseleave':_0x354550['to'](()=>{this['isEnabled']&&this['fire']('mouseLeaveSuggestion',{'index':_0x3f3df7['index']});}),'click':_0x354550['to'](_0x2b1ee9=>{const _0x561a8c=_0x2b1ee9['target'];this['isEnabled']&&!this['_headerView']['toolbarView']['element']['contains'](_0x561a8c)&&this['fire']('showChangeInText',{'index':_0x3f3df7['index']});})}});}async['updateContent']({part:_0x2470f8,showUnchangedParts:_0x54acfc=!0x1,abortSignal:_0x152735}){this['partDefinition']=_0x2470f8,this['isVisible']=this['partDefinition']['hasChanges']||_0x54acfc,this['isVisible']&&await this['_streamableContentView']['update']({'part':_0x2470f8,'renderingStrategy':'static','abortSignal':_0x152735});}['markAsDone'](){this['isDone']=!0x0;}}class pn extends vt{constructor(_0x3ba126,_0x5de4c3){super(_0x3ba126),this['set']('isVisible',!0x0),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-skeleton',this['bindTemplate']['if']('isVisible','ck-hidden',_0x5e42e0=>!_0x5e42e0)]},'children':this['_createSkeletonItems'](_0x5de4c3)});}['_createSkeletonItems'](_0x463205){const _0x3075d8=['ck','ck-ai-skeleton__item'];return _0x463205['map'](_0x3579dd=>{let _0x34331b='';switch(_0x3579dd['attributes']['align']){case'right':_0x34331b='margin-left:\x20auto;\x20margin-right:\x200;\x20text-align:\x20right;';break;case'center':_0x34331b='margin-left:\x20auto;\x20margin-right:\x20auto;\x20text-align:\x20center;';break;case'left':_0x34331b='margin-left:\x200;\x20margin-right:\x20auto;\x20text-align:\x20left;';}return{'tag':_0x3579dd['tag'],'attributes':{'class':[..._0x3075d8,_0x3579dd['attributes']['class']?_0x3579dd['attributes']['class']:''],'style':'width:\x20'+_0x3579dd['attributes']['width']+';\x20height:\x20'+_0x3579dd['attributes']['height']+';'+_0x34331b}};});}}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(_0x21c031,_0x4da77d,_0x14a4b2,_0x28f946){return new Array(_0x21c031)['fill'](null)['map'](()=>({'tag':'div','attributes':{'width':_0x4da77d,'height':_0x14a4b2,'align':_0x28f946}}));}class Cn extends Tt(){['queue']=[];['isProcessing']=!0x1;['_abortController'];async['enqueue'](_0xe98878){const _0x4a412c=this['createTask'](_0xe98878);return this['queue']['push'](_0x4a412c),this['_processQueue'](),_0x4a412c['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(_0x17877d=>{this['once']('_queueEmpty',()=>{_0x17877d();});}):Promise['resolve']();}async['_processQueue'](){if(!this['isProcessing']){this['_abortController']=new AbortController(),this['isProcessing']=!0x0;try{for(;this['queue']['length']&&this['isProcessing'];){const _0x26379a=this['queue']['shift']();try{await _0x26379a['callback'](this['_abortController']['signal']),_0x26379a['resolve']();}catch(_0x4fe52d){_0x26379a['reject'](_0x4fe52d);}}}finally{this['isProcessing']=!0x1,this['_abortController']=void 0x0;}this['fire']('_queueEmpty');}}['createTask'](_0x329a41){let _0x1d70df,_0x9d121f;const _0x2b8cf4=new Promise((_0x1ebbab,_0x4aa435)=>{_0x1d70df=_0x1ebbab,_0x9d121f=_0x4aa435;});return{'callback':_0x329a41,'resolve':_0x1d70df,'reject':_0x9d121f,'completePromise':_0x2b8cf4};}}class wn extends an{constructor(_0x34ce5d){super(_0x34ce5d),this['extendTemplate']({'attributes':{'class':['ck-ai-notification','warning'===_0x34ce5d['level']?'ck-ai-notification_warning':'ck-ai-notification_error']}});}['render'](){super['render'](),this['setContent'](this['options']['initialContent']),this['markAsDone']();}['setContent'](_0x26e233){this['element']['innerHTML']=_0x26e233;}}const fn=['applySuggestion','insertSuggestion'];class bn extends vt{['_applyChangesButton'];['_insertSuggestionsButton'];['children'];constructor(_0x9ab320,_0x2147bd=[...fn],_0x192fe9){super(_0x9ab320);const _0xa62927=this['bindTemplate'],_0x135ded=Boolean(_0x192fe9);if(this['set']('isEnabled',!_0x135ded),this['set']('isVisible',!0x1),this['set']('isTrackChangesOn',!0x1),this['children']=this['createCollection'](),_0x135ded){const _0x51a587=new Nt(_0x9ab320);_0x51a587['set']({'label':hs(_0x9ab320,'AI_SUGGESTION_DISABLED_TOOLTIP_MESSAGE'),'tooltip':!0x0,'withText':!0x1,'icon':_0x5c9dab}),_0x51a587['extendTemplate']({'attributes':{'data-cke-tooltip-class':'ck-ai-suggestion-content-part-disabled-actions-tooltip'}});const _0x22cefb=new vt(_0x9ab320);_0x22cefb['setTemplate']({'tag':'div','attributes':{'class':'ck-ai-chat__feed__suggestion__actions__info'},'children':[{'tag':'p','children':[hs(_0x9ab320,'AI_SUGGESTION_DISABLED_FEED_MESSAGE'),_0x51a587]}]}),this['children']['add'](_0x22cefb);}else this['_applyChangesButton']=new Nt(_0x9ab320),this['_applyChangesButton']['set']({'label':hs(_0x9ab320,'AI_CHAT_SUGGESTION_ACTION_APPLY_ALL'),'withText':!0x0,'type':'button','isVisible':_0x2147bd['includes']('applySuggestion'),'class':cs}),this['_insertSuggestionsButton']=new Nt(_0x9ab320),this['_insertSuggestionsButton']['set']({'label':hs(_0x9ab320,'AI_CHAT_SUGGESTION_ACTION_SUGGEST_ALL'),'withText':!0x0,'type':'button','isVisible':_0x2147bd['includes']('insertSuggestion'),'class':ls}),this['_insertSuggestionsButton']['on']('execute',()=>{this['fire']('insertSuggestion');}),this['_applyChangesButton']['on']('execute',()=>{this['fire']('applySuggestion');}),[this['_applyChangesButton'],this['_insertSuggestionsButton']]['forEach'](_0x48bc32=>{_0x48bc32['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',_0xa62927['if']('isVisible','ck-hidden',_0x5e6133=>!_0x5e6133)]},'children':this['children']}),this['on']('change:isTrackChangesOn',()=>{this['_applyChangesButton']&&(this['_applyChangesButton']['isVisible']=!this['isTrackChangesOn']);});}['updateVisibility'](_0x2778bb){this['isVisible']=_0x2778bb;}['_switchButtonLabelsPlurality'](_0x5cb9ff){this['_applyChangesButton']&&this['_insertSuggestionsButton']&&(_0x5cb9ff?(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(_0x110cbf,_0x20a3c3){super(_0x110cbf),this['bodyCollection']=_0x20a3c3,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',_0x16be76=>!_0x16be76)]},'children':this['children']});const _0xaaf45d=new vt(this['locale']),_0x46e614=new xt();_0x46e614['content']=_0x31f360,_0xaaf45d['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-web-sources__header']},'children':[_0x46e614,{'tag':'span','children':[{'text':hs(this['locale'],'AI_CHAT_SOURCES_HEADER')}]}]}),this['children']['add'](_0xaaf45d),this['_setupBalloonPanel'](_0x110cbf);}['addSource'](_0x224c0f){this['children']['add'](new Rn(this['locale'],_0x224c0f,this['balloonPanelView']));}['_setupBalloonPanel'](_0x4da2e7){this['balloonPanelView']=new Xt(_0x4da2e7),this['balloonPanelView']['extendTemplate']({'attributes':{'class':['ck-ai-web-source__tooltip-balloon']}}),this['bodyCollection']['add'](this['balloonPanelView']);}}class Rn extends Nt{['balloonPanelView'];['source'];constructor(_0x41a0b2,_0x478536,_0x4b3125){super(_0x41a0b2),this['source']=_0x478536,this['balloonPanelView']=_0x4b3125,this['set']({'label':_0x478536['title'],'class':['ck\x20ck-ai-web-source'],'withText':!0x0});const _0x28594b=this['bindTemplate'];if(this['extendTemplate']({'on':{'click':_0x28594b['to'](()=>{window['open'](_0x478536['url'],'_blank');}),'mouseenter':_0x28594b['to'](()=>{this['_showTooltip']();}),'mouseleave':_0x28594b['to'](()=>{this['_hideTooltip']();})}}),_0x478536['favicon']){const _0x2453e9=new vt(_0x41a0b2);_0x2453e9['setTemplate']({'tag':'img','attributes':{'src':_0x478536['favicon']||_0x31f360,'alt':_0x478536['title'],'class':['ck-ai-web-source__image']}}),this['children']['add'](_0x2453e9);}else this['set']('icon',_0x31f360);}['_createTooltipContentView'](_0x472632,_0x37c8af){const _0x4b0472=new vt(_0x472632),_0x1e8217=[];let _0x126f2;_0x37c8af?.['favicon']?(_0x126f2=new vt(_0x472632),_0x126f2['setTemplate']({'tag':'img','attributes':{'src':_0x37c8af['favicon'],'alt':_0x37c8af['title'],'class':['ck-ai-web-source__tooltip-image']}})):(_0x126f2=new xt(),_0x126f2['content']=_0x31f360,_0x126f2['extendTemplate']({'attributes':{'alt':_0x37c8af['title'],'class':['ck-ai-web-source__tooltip-image']}})),_0x1e8217['push'](_0x126f2);const _0x157e1a=new vt(_0x472632);_0x157e1a['setTemplate']({'tag':'a','attributes':{'class':['ck-ai-web-source__tooltip-url'],'href':_0x37c8af['url']},'children':[{'text':new URL(_0x37c8af['url'])?.['hostname']}]}),_0x1e8217['push'](_0x157e1a);const _0x520283=new vt(_0x472632);_0x520283['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-web-source__tooltip-row']},'children':_0x1e8217});const _0xc8e548=new vt(_0x472632);return _0xc8e548['setTemplate']({'tag':'span','attributes':{'class':['ck-ai-web-source__tooltip-row','ck-ai-web-source__tooltip-title']},'children':[{'text':_0x37c8af['title']['length']>0x190?_0x37c8af['title']['substring'](0x0,0x190)+'...':_0x37c8af['title']}]}),_0x4b0472['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-web-source__tooltip']},'children':[_0x520283,_0xc8e548]}),_0x4b0472;}['_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 _0x5e0943=this['_createTooltipContentView'](this['locale'],this['source']);this['balloonPanelView']['content']['add'](_0x5e0943);}}class On extends vt{['_actionsView'];['_sourcesView'];['_children'];['_skeletonView'];['_showSkeletonDebounced']=_0x382bff(()=>{this['_skeletonView']['isVisible']=!0x0,this['_skeletonShownAt']=Date['now']();},0x3e8);['_skeletonShownAt']=null;['_areActionsDisabled'];['_showUnchangedParts'];['_updateContentPartsPromiseQueue'];['_emptyPartsWarningView'];['_availableActions'];['_cachedContentParts']=[];constructor(_0x22ea42,_0x58fc8d){super(_0x22ea42);const {areActionsDisabled:_0x278f30,showUnchangedParts:_0x105840,availableActions:_0x1be574}=_0x58fc8d;this['_areActionsDisabled']=_0x278f30,this['_showUnchangedParts']=_0x105840,this['_availableActions']=_0x1be574,this['set']('hasPendingParts',!0x1),this['set']('isTrackChangesOn',!0x1),this['_children']=this['createCollection'](),this['_skeletonView']=new pn(_0x22ea42,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(_0x22ea42,'AI_SUGGESTION_EMPTY_PART_WARNING'),'level':'warning'}),this['_emptyPartsWarningView']['isVisible']=!0x1,this['_actionsView']=new bn(_0x22ea42,_0x58fc8d['availableActions'],this['_areActionsDisabled']),this['_actionsView']['bind']('isTrackChangesOn')['to'](this),this['_sourcesView']=new Sn(this['locale'],_0x58fc8d['bodyCollection']),_0x58fc8d['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'](_0x418920=>_0x418920 instanceof En);}async['updateContentParts']({parts:_0x511056,abortSignal:_0x487a9b,skipLoadingEffects:_0x44ef84}){this['_cachedContentParts']['length']?_0x511056['forEach'](_0x1e1524=>{const _0x4b56ac=this['_cachedContentParts']['findIndex'](_0x155a8e=>_0x155a8e['index']==_0x1e1524['index']);-0x1===_0x4b56ac?this['_cachedContentParts']['push'](_0x1e1524):this['_cachedContentParts'][_0x4b56ac]=_0x1e1524;}):this['_cachedContentParts']=_0x511056;const _0x5968bd=this['_showUnchangedParts']?_0x511056:_0x511056['filter'](_0x12901d=>_0x12901d['hasChanges']);this['_actionsView']['_switchButtonLabelsPlurality'](_0x5968bd['length']>0x1),_0x44ef84&&(this['_showSkeletonDebounced']['cancel'](),this['_skeletonView']['isVisible']=!0x1);for(const _0x3cc71c of _0x5968bd)this['_updateContentPartsPromiseQueue']['enqueue'](async _0x5e8913=>{let _0x37065e=this['getPartView'](_0x3cc71c['index']);if(!_0x37065e){if(_0x37065e=new En(this['locale'],{'part':_0x3cc71c,'uiIndex':this['_contentPartViews']['length']+0x1,'areActionsDisabled':this['_areActionsDisabled'],'availableActions':this['_availableActions']}),_0x37065e['delegate'](...Zs)['to'](this),!_0x44ef84&&(this['_showSkeletonDebounced']['cancel'](),await this['_awaitMinimumSkeletonDisplayTime'](_0x5e8913),_0x5e8913['aborted']))return;this['_skeletonView']['isVisible']=!0x1,this['_children']['add'](_0x37065e,this['_children']['length']-0x1),this['hasPendingParts']=!0x0,_0x44ef84||this['_showSkeletonDebounced']();}await _0x37065e['updateContent']({'part':_0x3cc71c,'showUnchangedParts':this['_showUnchangedParts'],'abortSignal':_0x5e8913}),_0x37065e['markAsDone']();});return _0x487a9b?.['addEventListener']('abort',()=>{this['_updateContentPartsPromiseQueue']['abort'](),this['_showSkeletonDebounced']['cancel'](),this['_skeletonView']['isVisible']=!0x1;}),this['_updateContentPartsPromiseQueue']['queueEmptyPromise'];}['updatePartState'](_0x24aa31,_0x33f18d){const _0x4edf61=this['getPartView'](_0x24aa31);_0x4edf61&&(_0x4edf61['state']=_0x33f18d),this['hasPendingParts']='pending'==_0x33f18d||this['_contentPartViews']['some'](_0x5c1849=>'pending'==_0x5c1849['state']);}['setPartActive'](_0x110e34,_0x4ef7e2){if(!0x1===_0x110e34){for(const _0x5e89b5 of this['_contentPartViews'])_0x5e89b5['isActive']=!0x1;}else{const _0x9fdfd7=this['getPartView'](_0x110e34);_0x9fdfd7&&(_0x9fdfd7['isActive']=_0x4ef7e2);}}['updateSources'](_0x467acc){_0x467acc['forEach'](_0x453950=>this['_sourcesView']['addSource'](_0x453950)),this['_sourcesView']['isVisible']=!0x0;}['getPartView'](_0x559473){return this['_contentPartViews']['find'](_0x1b6eca=>_0x1b6eca['partDefinition']['index']==_0x559473)??null;}['markAsDone'](){if(!this['_showUnchangedParts']){const _0x489100=!this['_cachedContentParts']['find'](({hasChanges:_0x2b9494})=>_0x2b9494),_0xf8fe2d=!!this['_cachedContentParts']['find'](({hasChanges:_0x46b5b0})=>!_0x46b5b0);this['_emptyPartsWarningView']['isVisible']=0x0==this['_contentPartViews']['length']||_0xf8fe2d,_0x489100?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'](_0x687fa=>_0x687fa['markAsDone']()),this['_skeletonView']['isVisible']=!0x1,this['_showSkeletonDebounced']['cancel'](),this['_actionsView']['updateVisibility'](this['hasNonEmptyParts']);}async['_awaitMinimumSkeletonDisplayTime'](_0x3e7a0f){if(!this['_skeletonView']['isVisible']||null===this['_skeletonShownAt'])return;const _0x57231c=0x3e8-(Date['now']()-this['_skeletonShownAt']);if(this['_skeletonShownAt']=null,_0x57231c>0x0){const {promise:_0x5fceb7,abortController:_0x168dd8}=en(_0x57231c);_0x3e7a0f?.['addEventListener']('abort',()=>_0x168dd8['abort']()),await _0x5fceb7['catch'](()=>{});}}get['hasNonEmptyParts'](){return this['_contentPartViews']['filter'](_0x5c7267=>_0x5c7267['partDefinition']['hasChanges'])['length']>0x0;}}class kn extends vt{['bodyView'];['children'];['headerView'];constructor(_0x58f45a,_0x274f4b,_0x46ba9b){super(_0x58f45a);const {showDiff:_0x153c5f,areActionsDisabled:_0x1290b2,showUnchangedParts:_0xfb2fe,availableActions:_0x2b1734}=_0x274f4b;this['set']('isTrackChangesOn',!0x1),this['set']('areChangesVisible',!0x1),this['children']=this['createCollection'](),this['headerView']=new hn(_0x58f45a,{'showDiff':_0x153c5f}),this['headerView']['on']('toggleShowChanges',(_0x5273dd,_0x85f1ee)=>{this['areChangesVisible']=_0x85f1ee['isOn'],this['fire']('toggleSuggestionDisplayMode',{'showDiff':_0x85f1ee['isOn']});}),this['children']['add'](this['headerView']),this['bodyView']=new On(_0x58f45a,{'areActionsDisabled':_0x1290b2,'showUnchangedParts':!!_0xfb2fe,'availableActions':_0x2b1734,'bodyCollection':_0x46ba9b}),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'](_0x11ed31){await this['bodyView']['updateContentParts'](_0x11ed31);}['updateSources'](_0x473999){this['bodyView']['updateSources'](_0x473999);}['markAsDone'](){this['bodyView']['markAsDone'](),this['headerView']&&(this['headerView']['isShowChangesToggleVisible']=this['bodyView']['hasNonEmptyParts']);}}class Nn extends an{['containerView'];constructor(_0x5c678f,_0x300896,_0x28a2aa){super(_0x300896),this['set']('isTrackChangesOn',!0x1),this['containerView']=new kn(_0x5c678f,{'showDiff':_0x300896['showDiff'],'areActionsDisabled':_0x300896['areActionsDisabled'],'availableActions':_0x300896['availableActions']},_0x28a2aa),this['containerView']['on']('toggleSuggestionDisplayMode',(_0x565796,_0x3d5eff)=>{this['fire']('toggleSuggestionDisplayMode',{'replyId':this['options']['id'],'showDiff':_0x3d5eff['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',(_0x3538fe,{index:_0x8783b0})=>{this['fire']('showChangeInText',{'replyId':this['options']['id'],'partIndex':_0x8783b0});}),this['containerView']['on']('applySuggestion',(_0x153f05,{index:_0x26a8e3}={})=>{this['fire']('applySuggestion',{'replyId':this['options']['id'],'partIndex':_0x26a8e3});}),this['containerView']['on']('insertSuggestion',(_0x149e4d,{index:_0x3fcc04}={})=>{this['fire']('insertSuggestion',{'replyId':this['options']['id'],'partIndex':_0x3fcc04});}),this['containerView']['on']('rejectSuggestion',(_0x2e898c,{index:_0x125a7c})=>{this['fire']('rejectSuggestion',{'replyId':this['options']['id'],'partIndex':_0x125a7c});}),this['containerView']['on']('mouseOverSuggestion',(_0x2b4a7b,{index:_0x39473b})=>{this['fire']('mouseOverSuggestion',{'replyId':this['options']['id'],'partIndex':_0x39473b});}),this['containerView']['on']('mouseLeaveSuggestion',(_0x4f8ea9,{index:_0x311b18})=>{this['fire']('mouseLeaveSuggestion',{'replyId':this['options']['id'],'partIndex':_0x311b18});}),this['children']['addMany']([this['containerView']]),this['extendTemplate']({'attributes':{'class':['ck-ai-chat__feed__ai-suggestion']}});}async['updateContent'](_0x3af927){await this['containerView']['updateContent'](_0x3af927);}['updatePartState'](_0xcebb23,_0x37f773){this['containerView']['bodyView']['updatePartState'](_0xcebb23,_0x37f773);}['setPartActive'](_0x5e97f1,_0x55e85e){!0x1===_0x5e97f1?this['containerView']['bodyView']['setPartActive'](!0x1):this['containerView']['bodyView']['setPartActive'](_0x5e97f1,_0x55e85e);}['updateSources'](_0x2db1df){this['containerView']['updateSources'](_0x2db1df);}['getPartView'](_0x218513){return this['containerView']['bodyView']['getPartView'](_0x218513);}['markAsDone'](){super['markAsDone'](),this['containerView']['markAsDone']();}}class vn extends an{['replyContainer'];['_bodyCollection'];constructor(_0x8f9e03,_0x23d8a5,_0x253328){super(_0x23d8a5),this['_bodyCollection']=_0x253328,this['locale']=_0x8f9e03,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:_0x422b50,renderingStrategy:_0x1e0ec1,abortSignal:_0x56298d}){'streaming'===_0x1e0ec1?await this['streamIntoElement'](_0x422b50,this['replyContainer']['element'],_0x56298d):this['replyContainer']['element']['innerHTML']=ti(_0x422b50);}['updateSources'](_0x1fcece){const _0x4bed44=new Sn(this['locale'],this['_bodyCollection']);_0x4bed44['children']['addMany'](_0x1fcece['map'](_0x2d5dac=>new Rn(this['locale'],_0x2d5dac,_0x4bed44['balloonPanelView']))),_0x4bed44['isVisible']=!0x0,this['children']['add'](_0x4bed44);}}class yn extends yt{constructor(_0x43c4dd=void 0x0){super();const _0x447263=_0x43c4dd?'ck-ai-spinner_'+_0x43c4dd:'';this['extendTemplate']({'tag':'span','attributes':{'class':['ck-ai-spinner',_0x447263]}});}}const xn={'file':_0x61dfd7,'document':_0x31ce36,'web-resource':_0x63b1ba,'text':_0x61dfd7,'selection':_0x3e3461,'mcp-tool-context':_0x31ce36},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(_0x5a9482,_0x1419a5,_0xe7fe8f,_0x51368e,_0x41a520=!0x1){super(_0x5a9482),this['_isAnimationOnEnterEnabled']=_0x51368e,this['_initializeProperties'](_0x1419a5,_0xe7fe8f,_0x41a520),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'](_0x5ebe45,_0x2827e2,_0x9b4d9e){this['set']('label',_0x5ebe45['label']),this['set']('tooltip',!0x0),this['set']('itemType',_0x5ebe45['type']),this['set']('id',_0x5ebe45['uiId']),this['set']('readonly',_0x2827e2),this['set']('isLoading',_0x9b4d9e);}['_setupTemplate'](){const _0x792c19=this['_createIconView'](),_0x1b01ba=this['_createRemoveButton'](),_0x2c42d2=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':this['_createTemplateAttributes'](_0x2c42d2),'children':this['_createTemplateChildren'](_0x792c19,_0x1b01ba,_0x2c42d2)});}['_createTemplateAttributes'](_0x438842){return{'class':[Ln,_0x438842['if']('itemType',Pn,_0x4ec285=>'document'==_0x4ec285),_0x438842['if']('itemType',Dn,_0x45f357=>'selection'==_0x45f357)],'data-cke-tooltip-text':_0x438842['to']('label',Gn),'data-cke-tooltip-position':Vn,'data-cke-tooltip-class':Un};}['_createTemplateChildren'](_0x4d4138,_0x36a524,_0x185e0c){const _0x2c490b=this['_createLabelElement'](_0x185e0c),_0x541519=this['_createLoaderIcon']();return this['readonly']?[_0x4d4138,_0x2c490b]:[_0x4d4138,_0x541519,_0x2c490b,_0x36a524];}['_createLabelElement'](_0x1ebf62){return{'tag':'span','attributes':{'class':Hn},'children':[{'text':_0x1ebf62['to']('label')}]};}['_createRemoveButton'](){const _0x15dfe3=new Nt(this['locale']);return _0x15dfe3['set']({'label':hs(this['locale'],'AI_CHAT_CONTEXT_REMOVE_FROM_CONTEXT'),'icon':_0x30d60c}),this['_setupRemoveButtonEvent'](_0x15dfe3),_0x15dfe3;}['_setupRemoveButtonEvent'](_0x4437b1){_0x4437b1['on']('execute',()=>{this['fire']('removeContextItemChip',this['id']);});}['_createIconView'](){const _0x482814=this['bindTemplate'],_0x33f171=new xt();return _0x33f171['content']=xn[this['itemType']],_0x33f171['extendTemplate']({'attributes':{'class':[Mn,_0x482814['if']('isLoading','ck-hidden',_0x56ca70=>_0x56ca70)]}}),_0x33f171;}['_handleAnimationEndOnce'](_0x13df18,_0xe4647){if(!_0x13df18)return;const _0x400d4f=()=>{_0xe4647(),_0x13df18['removeEventListener']('animationend',_0x400d4f),_0x13df18['removeEventListener']('webkitAnimationEnd',_0x400d4f);};_0x13df18['addEventListener']('animationend',_0x400d4f),_0x13df18['addEventListener']('webkitAnimationEnd',_0x400d4f);}['_createLoaderIcon'](){const _0x45fd93=new yn('small');return _0x45fd93['bind']('isVisible')['to'](this,'isLoading',_0x4bfaf6=>_0x4bfaf6),_0x45fd93;}}function Gn(_0x27ecd9){if(!_0x27ecd9)return _0x27ecd9;if(_0x27ecd9['length']<=0x78)return _0x27ecd9;const _0x31ff49=_0x27ecd9['slice'](0x0,0x78),_0x25d625=_0x31ff49['lastIndexOf']('\x20');return(_0x25d625>0x0?_0x31ff49['slice'](0x0,_0x25d625):_0x31ff49)+'…';}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(_0x4905d2,_0x19e9b2,_0x428274,_0x330c41,_0xcec218){this['_locale']=_0x4905d2,this['_visibleChips']=_0x19e9b2,this['_config']={...Fn,..._0x428274,'cssClasses':{'controlsButton':'','calculationContainer':'ck-calculation-container',..._0x428274['cssClasses']}},this['_overflowChips']=new dt(),this['_bodyCollection']=_0x330c41,this['_parentView']=_0xcec218||null;}['setContainerElement'](_0x58254b){this['_intersectionObserver']&&(this['_intersectionObserver']['disconnect'](),this['_intersectionObserver']=null),this['_containerElement']=_0x58254b,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 _0x28958c=[...this['_visibleChips'],...this['_overflowChips']],_0x56ad3f=this['_createCalculationContainer'](),_0x54debb=this['_calculateOverflowInContainer'](_0x56ad3f,_0x28958c),_0x2b8c96=_0x56ad3f['_ancestorsToRestore'];_0x2b8c96&&this['_restoreAncestorVisibility'](_0x2b8c96),_0x56ad3f['remove'](),this['_applyOverflowResults'](_0x28958c,_0x54debb);}['_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 _0x1191f4=new Nt(this['_locale']);_0x1191f4['set']({'label':'','withText':!0x0,'isToggleable':!0x0});const _0x3eb283=[this['_config']['cssClasses']['showMoreButton']];return this['_config']['cssClasses']['controlsButton']&&_0x3eb283['push'](this['_config']['cssClasses']['controlsButton']),_0x1191f4['extendTemplate']({'attributes':{'class':_0x3eb283}}),_0x1191f4;}['_createShowMoreBalloonPanelView'](){const _0x1af939=new Xt(this['_locale']);return _0x1af939['extendTemplate']({'attributes':{'class':this['_config']['cssClasses']['showMoreBalloon']}}),this['_bodyCollection']['add'](_0x1af939),_0x1af939;}['_updateBalloonContent'](){if(this['_showMoreBalloonPanelView']&&(this['_showMoreBalloonPanelView']['content']['clear'](),this['_overflowChips']['length']>0x0)){this['_overflowChips']['forEach'](_0x5a3ad9=>{_0x5a3ad9['disableAnimationOnEnter']();});const _0x4298b7=new vt(this['_locale']);_0x4298b7['setTemplate']({'tag':'div','attributes':{'class':this['_config']['cssClasses']['overflowContainer']},'children':this['_overflowChips']}),this['_showMoreBalloonPanelView']['content']['add'](_0x4298b7);}}['_handleShowMoreButtonClick'](){this['_showMoreButtonView']['isOn']?this['hideBalloonPanel']():this['showBalloonPanel']();}['_updateShowMoreButtonVisibility'](){const _0xbcecc=this['_overflowChips']['length']>0x0;this['_showMoreButtonView']?.['element']&&(this['_showMoreButtonView']['element']['style']['display']=_0xbcecc?'':'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'](_0x20b5c7){const _0x52e271=this['_containerElement']?.['tagName']['toLowerCase']()||'div',_0x54ddf9=this['_containerElement']?.['classList'];if(_0x54ddf9){const _0x218cbd=_0x54ddf9[0x0]||'',_0x35e0ec=_0x20b5c7['querySelector']('.'+_0x218cbd),_0x33f14c=_0x20b5c7['querySelector'](_0x52e271);return _0x35e0ec||_0x33f14c||_0x20b5c7;}return _0x20b5c7['querySelector'](_0x52e271)||_0x20b5c7;}['_calculateContainerWidth'](){const _0x39efbd=this['_parentView']?.['element']||this['_containerElement'];if(!_0x39efbd)return Kn;const _0x3b5c2a=window['getComputedStyle'](_0x39efbd)['width'];if('auto'===_0x3b5c2a||'0px'===_0x3b5c2a||!_0x3b5c2a){const _0x491f5d=_0x39efbd['parentElement'];if(_0x491f5d){const _0x5e9995=window['getComputedStyle'](_0x491f5d);return'auto'!==_0x5e9995['width']?_0x5e9995['width']:Kn;}return Kn;}return _0x3b5c2a;}['_applyCalculationStyles'](_0x574fbe,_0x26c002){this['_config']['cssClasses']['calculationContainer']&&_0x574fbe['classList']['add'](this['_config']['cssClasses']['calculationContainer']),_0x574fbe['style']['width']=_0x26c002,_0x574fbe['style']['position']='absolute',_0x574fbe['style']['top']='-9999px',_0x574fbe['style']['left']='-9999px',_0x574fbe['style']['opacity']='0',_0x574fbe['style']['pointerEvents']='none',_0x574fbe['style']['zIndex']='-1',_0x574fbe['style']['visibility']='visible\x20!important',_0x574fbe['style']['display']='block\x20!important',_0x574fbe['style']['boxSizing']='border-box';}['_restoreAncestorVisibility'](_0x49a8fa){_0x49a8fa['forEach'](({element:_0x597ddb,originalDisplay:_0xb855b8,originalVisibility:_0x3fc801})=>{_0x597ddb['style']['display']=_0xb855b8,_0x597ddb['style']['visibility']=_0x3fc801;});}['_makeAncestorsVisible'](_0x4e227c){const _0x49f0fe=[];let _0x111224=_0x4e227c;for(;_0x111224&&_0x111224!==document['body'];){const _0x526f19=window['getComputedStyle'](_0x111224);'none'!==_0x526f19['display']&&'hidden'!==_0x526f19['visibility']||(_0x49f0fe['push']({'element':_0x111224,'originalDisplay':_0x111224['style']['display'],'originalVisibility':_0x111224['style']['visibility']}),_0x111224['style']['display']='block',_0x111224['style']['visibility']='visible'),_0x111224=_0x111224['parentElement'];}return _0x49f0fe;}['_createContainerElements'](){let _0x4037ef,_0x32ae99;return this['_parentView']?.['element']?(_0x4037ef=this['_parentView']['element']['cloneNode'](!0x0),_0x32ae99=this['_findTargetContainer'](_0x4037ef)):(_0x4037ef=document['createElement']('div'),_0x32ae99=_0x4037ef),{'calculationContainer':_0x4037ef,'targetContainer':_0x32ae99};}['_createCalculationContainer'](){const {calculationContainer:_0x3826ed,targetContainer:_0x3b4f44}=this['_createContainerElements'](),_0x4627bd=this['_calculateContainerWidth']();this['_applyCalculationStyles'](_0x3826ed,_0x4627bd);const _0x265548=this['_parentView']?.['element']||this['_containerElement'],_0x2a8d9b=_0x265548?.['parentElement'];_0x2a8d9b?_0x2a8d9b['appendChild'](_0x3826ed):document['body']['appendChild'](_0x3826ed),_0x3826ed['_targetContainer']=_0x3b4f44;const _0x33d25a=this['_makeAncestorsVisible'](_0x2a8d9b||null);return _0x3826ed['offsetWidth'],_0x3826ed['_ancestorsToRestore']=_0x33d25a,_0x3826ed;}['_calculateOverflowInContainer'](_0x116cb4,_0x3bfe23){const _0x566589=_0x116cb4['_targetContainer']||_0x116cb4,_0x546431=[],{rowCount:_0x401812}=this['_renderChipsAndCountRows'](_0x566589,_0x3bfe23);if(_0x401812<=this['_config']['maxVisibleRows'])return _0x546431;const _0x472cb7=_0x3bfe23['slice']();for(;_0x472cb7['length']>0x0;){if(this['_testButtonFit'](_0x116cb4,_0x566589,_0x472cb7)){const _0x30f134=_0x3bfe23['filter'](_0x42c89e=>!_0x472cb7['includes'](_0x42c89e));_0x546431['push'](..._0x30f134);break;}if(!_0x472cb7['pop']())break;}return _0x546431;}['_renderChipsAndCountRows'](_0x3aff1e,_0x366c6e){_0x3aff1e['innerHTML']='',_0x366c6e['forEach'](_0x31b8eb=>{if(_0x31b8eb['element']){const _0x1f6b95=_0x31b8eb['element']['cloneNode'](!0x0);_0x3aff1e['appendChild'](_0x1f6b95);}}),_0x3aff1e['offsetWidth'];const _0x4d6922=_0x3aff1e['children'],_0x5909fd=[];return Array['from'](_0x4d6922)['forEach'](_0x12e97c=>{const _0x5b9005=_0x12e97c['getBoundingClientRect']()['top'];_0x5909fd['some'](_0x1ec79e=>Math['abs'](_0x1ec79e-_0x5b9005)<this['_config']['rowDetectionTolerance'])||_0x5909fd['push'](_0x5b9005);}),{'rowCount':_0x5909fd['length']};}['_createMockButton'](){const _0x5b5be2=document['createElement']('button');return _0x5b5be2['className']=this['_config']['cssClasses']['showMoreButton'],this['_config']['cssClasses']['controlsButton']&&_0x5b5be2['classList']['add'](this['_config']['cssClasses']['controlsButton']),_0x5b5be2['textContent']='+\x201',_0x5b5be2;}['_testButtonFit'](_0xeb3831,_0x529b5a,_0x916955){this['_renderChipsAndCountRows'](_0x529b5a,_0x916955);const _0x2304ca=this['_createMockButton']();_0xeb3831['appendChild'](_0x2304ca),_0xeb3831['offsetWidth'];const _0x3db037=[..._0x529b5a['children'],_0x2304ca],_0x17b2b9=[];_0x3db037['forEach'](_0xfde9e7=>{const _0x18733e=_0xfde9e7['getBoundingClientRect']()['top'];_0x17b2b9['some'](_0x41ff9f=>Math['abs'](_0x41ff9f-_0x18733e)<this['_config']['rowDetectionTolerance'])||_0x17b2b9['push'](_0x18733e);});const _0x3bdb0e=_0x17b2b9['length'];return _0x2304ca['remove'](),_0x3bdb0e<=this['_config']['maxVisibleRows'];}['_distributeChips'](_0x3f450a,_0xbc1d67){this['_visibleChips']['clear'](),this['_overflowChips']['clear'](),_0x3f450a['forEach'](_0x1fe587=>{_0xbc1d67['includes'](_0x1fe587)?this['_overflowChips']['add'](_0x1fe587):this['_visibleChips']['add'](_0x1fe587);});}['_updateOverflowUI'](_0x1b2cce){if(_0x1b2cce>0x0&&!this['_showMoreButtonView']&&this['_createShowMoreButton'](),_0x1b2cce>0x0&&this['_showMoreButtonView']){const _0x1e29c0=''+this['_config']['showMoreLabelPrefix']+(_0x1b2cce<0x63?_0x1b2cce:'99');this['_showMoreButtonView']['label']=_0x1e29c0;}this['_updateBalloonContent'](),this['_updateShowMoreButtonVisibility'](),this['_repinBalloonPanel']();}['_applyOverflowResults'](_0x299eb3,_0x1459df){this['_distributeChips'](_0x299eb3,_0x1459df),this['_updateOverflowUI'](_0x1459df['length']);}['_setupVisibilityObserver'](){this['_containerElement']&&'undefined'!=typeof IntersectionObserver&&(this['_intersectionObserver']=new IntersectionObserver(_0x283690=>{_0x283690[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 _0x1a3d0b=this['_containerElement']['getBoundingClientRect']();if(0x0===_0x1a3d0b['width']||0x0===_0x1a3d0b['height'])return!0x1;const _0x4e522c=window['innerHeight']||document['documentElement']['clientHeight'],_0x2540e7=window['innerWidth']||document['documentElement']['clientWidth'],_0x3a79fb=0xc8;return _0x1a3d0b['bottom']>=-0xc8&&_0x1a3d0b['top']<=_0x4e522c+_0x3a79fb&&_0x1a3d0b['right']>=-0xc8&&_0x1a3d0b['left']<=_0x2540e7+_0x3a79fb;}}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(_0x1877a9,_0x3e8709,_0x4daa2b){super(_0x1877a9),this['_bodyCollection']=_0x4daa2b,this['_createContextChips'](_0x3e8709);const _0x5e34d3={'cssClasses':{'showMoreButton':Xn+'\x20'+us,'showMoreBalloon':zn,'overflowContainer':qn,'controlsButton':Qn}};this['_overflowManager']=new Wn(_0x1877a9,this['_contextChips'],_0x5e34d3,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 _0x268819=this['element']['querySelector']('.'+$n);_0x268819&&(this['_overflowManager']['setContainerElement'](_0x268819),this['_overflowManager']['reorganizeChips']());}['destroy'](){super['destroy'](),this['_overflowManager']['destroy']();}['_createContextChips'](_0x47aa69){for(const _0x322f56 of _0x47aa69){const _0x117ff9=new Bn(this['locale'],_0x322f56,!0x0,!0x1);this['_contextChips']['add'](_0x117ff9);}}}class Jn extends an{['_contextChipsView']=null;['_locale'];['_bodyCollection'];['_messageContentView'];constructor(_0x3f6ea5,_0x354d6f,_0x20a14c){super(_0x354d6f),this['_locale']=_0x3f6ea5,this['_bodyCollection']=_0x20a14c,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'](_0x2564af=>!_0x2564af['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(_0x55c708,_0x4f11dd){super(_0x4f11dd);const {isWebSearchEnabled:_0x10b4cc,isReasoningEnabled:_0x2cafe1}=_0x4f11dd['capabilities'],_0x6877fe=[];let _0x4be2cf='';_0x10b4cc&&_0x2cafe1?(_0x4be2cf=hs(_0x55c708,'AI_CHAT_FEED_REPLY_ITEM_USED_WEB_SEARCH_REASONING'),_0x6877fe['push'](tr(_0x31f360)),_0x6877fe['push'](tr(_0x3a90af))):_0x10b4cc?(_0x4be2cf=hs(_0x55c708,'AI_CHAT_FEED_REPLY_ITEM_USED_WEB_SEARCH'),_0x6877fe['push'](tr(_0x31f360))):_0x2cafe1&&(_0x4be2cf=hs(_0x55c708,'AI_CHAT_FEED_REPLY_ITEM_USED_REASONING'),_0x6877fe['push'](tr(_0x3a90af))),this['extendTemplate']({'attributes':{'class':['ck-ai-chat__feed__interaction-header',_0x4be2cf?'':'ck-hidden']}});const _0x155ba0=new vt();_0x155ba0['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed__interaction-header__capabilities']},'children':[..._0x6877fe,{'tag':'span','attributes':{'class':['ck-ai-chat__feed__interaction-header__capabilities__text']},'children':[_0x4be2cf]}]}),this['children']['add'](_0x155ba0),this['capabilities']=_0x4f11dd['capabilities'];}}function tr(_0xb6c3da){const _0x2fbb71=new xt();return _0x2fbb71['content']=_0xb6c3da,_0x2fbb71;}const er=['wheel','touchstart','pointerdown','keydown'],ir=['ArrowUp','ArrowDown','PageUp','PageDown','Home','End','\x20'];class sr{['element'];['animationFrameId'];['isRunning'];['abortController'];['isUserPaused'];['scrollBehavior'];constructor(_0x4866e9){this['element']=_0x4866e9,this['animationFrameId']=null,this['isRunning']=!0x1,this['abortController']=new AbortController(),this['isUserPaused']=!0x1,this['scrollBehavior']='smooth';for(const _0x2a5b4c of er){const _0xa16a2='keydown'!==_0x2a5b4c;this['element']['addEventListener'](_0x2a5b4c,this['_onUserEvent']['bind'](this),{'passive':_0xa16a2,'signal':this['abortController']['signal']});}}['start']({smooth:_0x1dcebf=!0x0}={}){this['isRunning']||(this['isRunning']=!0x0,this['isUserPaused']=!0x1,this['scrollBehavior']=_0x1dcebf?'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'](_0x31ff3e){if(this['isRunning']){if('keydown'===_0x31ff3e['type']){const _0x1617f7=_0x31ff3e['key'];if(!ir['includes'](_0x1617f7))return;}_0x31ff3e instanceof WheelEvent?_0x31ff3e['deltaY']<0x0?this['isUserPaused']=!0x0:this['isUserPaused']=!this['_isAtBottom']():this['isUserPaused']=!0x0;}}['_isAtBottom'](){const {scrollTop:_0x21ae0b,scrollHeight:_0x47ddab,clientHeight:_0x31fea6}=this['element'];return _0x47ddab-_0x21ae0b-_0x31fea6<=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(_0x23ba44){super(_0x23ba44),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(_0x48ec69,_0x3e8a45){super(_0x48ec69),this['_bodyCollection']=_0x3e8a45,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'](_0x446652,_0x434cca){let _0x32b4ea;return'ai-reply'===_0x446652?_0x32b4ea=new vn(this['locale'],_0x434cca,this['_bodyCollection']):'ai-suggestion-reply'===_0x446652?(_0x32b4ea=new Nn(this['locale'],_0x434cca,this['_bodyCollection']),_0x32b4ea['bind']('isTrackChangesOn')['to'](this)):_0x32b4ea='user-message'===_0x446652?new Jn(this['locale'],_0x434cca,this['_bodyCollection']):'interaction-header'===_0x446652?new Zn(this['locale'],_0x434cca):'custom-element'===_0x446652?new nr(_0x434cca):new wn(_0x434cca),this['children']['add'](_0x32b4ea),_0x32b4ea;}async['updateReplyItem']({id:_0x2e031f,parsedContent:_0x9b66cc,renderingStrategy:_0x30afb2,abortSignal:_0x4a86de}){const _0x3d14d7=this['getItemById'](_0x2e031f);if(!(_0x3d14d7 instanceof vn))throw new at('ai-chat-feed-view-item-not-a-reply-item',null,{'itemView':_0x3d14d7,'id':_0x2e031f,'parsedContent':_0x9b66cc});await _0x3d14d7['updateContent']({'parsedContent':_0x9b66cc,'renderingStrategy':_0x30afb2,'abortSignal':_0x4a86de});}async['updateWebSources'](_0x582d34,_0x5721f6){const _0x30cb8b=this['getItemById'](_0x582d34);if(_0x30cb8b instanceof Nn)_0x30cb8b['updateSources'](_0x5721f6);else{if(!(_0x30cb8b instanceof vn))throw new at('ai-chat-feed-view-item-not-a-suggestion-or-reply-item',null,{'itemView':_0x30cb8b,'id':_0x582d34,'sources':_0x5721f6});_0x30cb8b['updateSources'](_0x5721f6);}}async['updateSuggestionItem']({id:_0x2db165,parts:_0x223aa8,abortSignal:_0x17046b,skipLoadingEffects:_0x239624}){const _0x31c7f5=this['getItemById'](_0x2db165);if(!(_0x31c7f5 instanceof Nn))throw new at('ai-chat-feed-view-item-not-a-suggestion-item',null,{'itemView':_0x31c7f5,'id':_0x2db165,'parts':_0x223aa8});await _0x31c7f5['updateContent']({'parts':_0x223aa8,'abortSignal':_0x17046b,'skipLoadingEffects':_0x239624});}['updateSuggestionPartState']({id:_0x5b86b3,index:_0x21efd3,state:_0x285e37}){const _0x124aa6=this['getItemById'](_0x5b86b3);if(!(_0x124aa6 instanceof Nn))throw new at('ai-chat-feed-view-item-not-a-suggestion-item',this,{'id':_0x5b86b3});_0x124aa6['updatePartState'](_0x21efd3,_0x285e37);}['setSuggestionPartActive']({id:_0x5773bb,index:_0x3b764e,isActive:_0x5d12b7}){const _0xd10d99=this['getItemById'](_0x5773bb);if(!(_0xd10d99 instanceof Nn))throw new at('ai-chat-feed-view-item-not-a-suggestion-item',this,{'id':_0x5773bb});this['children']['filter'](_0x333cee=>_0x333cee instanceof Nn)['forEach'](_0x11d26f=>{_0x11d26f['setPartActive'](!0x1);}),_0xd10d99['setPartActive'](_0x3b764e,_0x5d12b7);}['markItemAsDone'](_0x21b45e){this['getItemById'](_0x21b45e)['markAsDone']();}['getItemIds'](){return this['children']['map'](_0x1a648e=>_0x1a648e['options']['id']);}['removeItem'](_0x592c62){this['children']['remove'](this['getItemById'](_0x592c62));}['hasItem'](_0x175c6c){return!!this['children']['find'](_0x2067ab=>_0x2067ab['options']['id']['includes'](_0x175c6c));}['scrollToSuggestion'](_0x30842c,_0x533a6c){const _0x3507d6=this['getItemById'](_0x30842c);if(!(_0x3507d6 instanceof Nn))return void It('ck-ai-chat-feed-view-scroll-to-suggestion-invalid-item',{'replyId':_0x30842c,'partIndex':_0x533a6c});const _0x1beabd=_0x3507d6['getPartView'](_0x533a6c);_0x1beabd?ft(_0x1beabd['element'],0x14,this['element']['parentElement'],!0x0,!0x0):It('ck-ai-chat-feed-view-scroll-to-suggestion-part-view-not-found',{'replyId':_0x30842c,'partIndex':_0x533a6c});}['_setupTemplate'](){this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed']},'children':this['_createTemplateChildren']()});}['_createTemplateChildren'](){const _0x4b9ce2=this['_createSkeletonLoader']();return[this['_createFeedItems'](),_0x4b9ce2,this['_createFeedLoader']()];}['_createSkeletonLoader'](){const _0x3d2b06=new pn(this['locale'],mn['aiFeed']);return _0x3d2b06['bind']('isVisible')['to'](this,'isLoadingSkeletonVisible'),_0x3d2b06;}['_createFeedItems'](){const _0x32402f=new vt(this['locale']);return _0x32402f['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed__items',this['bindTemplate']['if']('isLoadingSkeletonVisible','ck-hidden')]},'children':this['children']}),_0x32402f;}['_createFeedLoader'](){const _0x13fc3d=new vt(this['locale']);return _0x13fc3d['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__loader',this['bindTemplate']['if']('loadingMessage','ck-hidden',_0x168b42=>!_0x168b42)]},'children':this['_createLoaderChildren']()}),_0x13fc3d;}['_createLoaderChildren'](){const _0x2f246b=new yn();return _0x2f246b['isVisible']=!0x0,[_0x2f246b,{'tag':'span','attributes':{'class':['ck','ck-ai-chat__loader-text']},'children':[{'text':this['bindTemplate']['to']('loadingMessage')}]}];}['getItemById'](_0x542a6c){const _0x26e896=this['children']['find'](_0x445c72=>_0x445c72['options']['id']['includes'](_0x542a6c));if(!_0x26e896)throw new at('ai-chat-feed-view-item-not-found',this,{'id':_0x542a6c});return _0x26e896;}['setLoadingMessage'](_0x24fcf8){this['set']('loadingMessage',_0x24fcf8);}['toggleLoadingSkeleton'](_0x5eca64){this['set']('isLoadingSkeletonVisible',_0x5eca64);}['startAutoScroll'](_0x538c20={}){this['scrollManager']['start'](_0x538c20);}['stopAutoScroll'](){this['scrollManager']['stop']();}}class or extends Dt{['filter'](){let _0xe89be5=0x0;for(const _0x23e2f3 of this['items'])_0xe89be5+=_0x23e2f3['items']['length'];return{'resultsCount':_0xe89be5,'totalItemsCount':_0xe89be5};}}const ar='ck-ai-chat__prompt-input_highlighted';class hr extends Lt{['submitButtonView'];static ['MIN_ROWS']=0x1;static ['MAX_ROWS']=0xc;['_addContextButtonView'];['_queryViewResizeObserver'];constructor(_0x224bd1,_0x4894f5){super(_0x224bd1,{'queryView':{'label':'','creator':Vt,'showIcon':!0x1,'showResetButton':!0x1},'filteredView':new or(_0x224bd1),'queryMinChars':0x1/0x0,'resetOnBlur':!0x1}),this['set']('isEmpty',!0x0),this['set']('isUploadInProgress',!0x1),this['_addContextButtonView']=_0x4894f5,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',(_0x5ac23d,_0x312d9a)=>!_0x5ac23d&&!_0x312d9a),this['focusableChildren']['add'](this['submitButtonView']);}['render'](){super['render'](),this['queryView']['fieldWrapperChildren']['add'](this['submitButtonView']),this['keystrokes']['set']('enter',(_0x12291c,_0x53d884)=>{this['isUploadInProgress']||this['isEmpty']||_0x12291c['target']==this['queryView']['fieldView']['element']&&(this['submit'](),_0x53d884());}),this['queryView']['fieldView']['on']('update',()=>{this['isEmpty']=''===this['queryView']['fieldView']['element']['value']?.['trim']();});}['destroy'](){super['destroy'](),this['_queryViewResizeObserver']&&this['_queryViewResizeObserver']['destroy']();}['submit'](){const _0x422cf7=this['queryView']['fieldView']['element']['value']?.['trim']();if(!_0x422cf7)return this['queryView']['errorText']=hs(this['locale'],'AI_CHAT_PROMPT_EMPTY_ERROR'),void(this['queryView']['fieldView']['hasError']=!0x0);this['queryView']['fieldView']['hasError']=!0x1;const _0x29832d=_0x56a9e5(_0x422cf7);this['fire']('sendUserMessage',_0x29832d),this['queryView']['fieldView']['reset']();}['setPlaceholderText'](_0x316e36){this['queryView']['fieldView']['set']('placeholder',_0x316e36);}['focus'](_0x2e0f47=!0x1){super['focus'](),_0x2e0f47&&(this['element']['classList']['contains'](ar)||(this['element']['classList']['add'](ar),setTimeout(()=>{this['element']['classList']['remove'](ar);},0x320)));}['_createSubmitButton'](){const _0x421c53=new Nt(this['locale']);return _0x421c53['set']({'icon':_0x403531,'label':hs(this['locale'],'AI_CHAT_LABEL_SUBMIT'),'isVisible':!0x0,'tooltip':!0x0,'class':'ck-ai-chat__prompt-submit-button\x20'+cs,'isEnabled':!0x1}),_0x421c53['on']('execute',()=>{this['submit']();}),_0x421c53;}['setIsUploadInProgress'](_0x30b0b3){this['isUploadInProgress']=_0x30b0b3;}['_setUpAddContextButtonPositioning'](){const _0x1e105f=this['locale'],_0x3d0a8b=()=>{ct['window']['requestAnimationFrame'](()=>{if(lt(this['element'])){const _0x475bca=new ut(this['queryView']['fieldView']['element']),_0x42102e=new ut(this['_addContextButtonView']['element']),_0x4c8447=_0x475bca['width'],_0x419484='rtl'===_0x1e105f['uiLanguageDirection']?'right':'left';_0x475bca['excludeScrollbarsAndBorders']();const _0x33ca7f=_0x4c8447-_0x475bca['width']+0x1;this['_addContextButtonView']['element']['style'][_0x419484]='calc('+(_0x4c8447-_0x42102e['width']-_0x33ca7f)+'px\x20-\x20var(--ck-spacing-tiny))';}});};this['queryView']['fieldView']['on']('update',_0x3d0a8b),this['on']('render',()=>{_0x3d0a8b(),this['_queryViewResizeObserver']=new bt(this['queryView']['fieldView']['element'],()=>{_0x3d0a8b();});});}}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(_0x219ba9){super(_0x219ba9),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',_0x1b982a=>'selector'===_0x1b982a),this['_modelSelectionDropdown']['buttonView']['bind']('tooltip')['to'](this,'modelSelectorEnabled',_0x1d4745=>_0x1d4745?this['_modelSelectionDropdown']['buttonView']['label']:hs(this['locale'],'AI_CHAT_MODEL_SELECTOR_DISABLED_TOOLTIP')),this['_modelSelectionDropdown']['bind']('isEnabled')['to'](this,'modelSelectorEnabled',_0x2b161e=>_0x2b161e),this['_webSearchButton']['bind']('isOn')['to'](this,'webSearchActive',_0x354f04=>_0x354f04),this['_webSearchButton']['bind']('tooltip')['to'](this,'webSearchActive',_0xfcdfdf=>hs(this['locale'],_0xfcdfdf?'AI_CHAT_DISABLE_WEB_SEARCH':'AI_CHAT_ENABLE_WEB_SEARCH')),this['_reasoningButton']['bind']('isOn')['to'](this,'reasoningActive',_0x45340c=>_0x45340c),this['_reasoningButton']['bind']('tooltip')['to'](this,'reasoningActive',_0x7153bb=>hs(this['locale'],_0x7153bb?'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'](_0x270f9f,_0x53895d){if(_0x53895d)this['set']('modelDisplayMode','hidden');else{const _0x11fded=0x1===_0x270f9f['length'];this['set']('modelDisplayMode',_0x11fded?'name':'selector');}if(this['_modelSelectionDropdownItems']['clear'](),_0x270f9f?.['length'])for(const _0x53d670 of _0x270f9f){const _0x13173a=new Jt({'label':_0x53d670['name'],'withText':!0x0,'role':'menuitemradio','id':_0x53d670['id'],'model':_0x53d670});_0x13173a['bind']('isOn')['to'](this,'activeModelId',_0x36034d=>_0x36034d===_0x53d670['id']),this['_modelSelectionDropdownItems']['add']({'type':'button','model':_0x13173a,'labelView':new pr(this['locale'],_0x53d670)});}}['setWebSearch'](_0x15e241){this['set']('webSearchActive',_0x15e241);}['setReasoning'](_0x299bb1){this['set']('reasoningActive',_0x299bb1);}['setModel'](_0x174e5a){if(!_0x174e5a)return;this['activeModelId']=_0x174e5a['id'],this['activeModelName']=_0x174e5a['name']||_0x174e5a['id'],this['_modelSelectionDropdown']['buttonView']['set']('label',_0x174e5a['name']),this['_modelSelectionDropdown']['buttonView']['set']('tooltip',_0x174e5a['name']);const _0x30a260=_0x174e5a['capabilities']['webSearch']?.['enabled']??!0x1;this['set']('webSearchActive',!0x1),this['_webSearchButton']['set']('isOn',!0x1),this['_webSearchButton']['set']('isEnabled',_0x30a260),this['_webSearchButton']['set']('isVisible',_0x30a260);const _0x2775d4=_0x174e5a['capabilities']['reasoning']?.['enabled']??!0x1;this['set']('reasoningActive',!0x1),this['_reasoningButton']['set']('isOn',!0x1),this['_reasoningButton']['set']('isEnabled',_0x2775d4),this['_reasoningButton']['set']('isVisible',_0x2775d4);}['enableModelSelector'](){this['set']('modelSelectorEnabled',!0x0);}['disableModelSelector'](_0x24131c){this['set']('modelSelectorEnabled',!0x1),_0x24131c&&this['set']('modelDisplayMode','hidden');}['_createWebSearchButton'](){const _0x4aefc1=new Nt();return _0x4aefc1['set']({'label':hs(this['locale'],'AI_CHAT_SEARCH_WEB'),'icon':_0x31f360,'class':lr+'\x20'+us,'isToggleable':!0x0,'tooltipPosition':Ir}),_0x4aefc1['on']('execute',()=>{this['fire']('toggleWebSearch');}),_0x4aefc1;}['_createReasoningButton'](){const _0x6dd3df=new Nt();return _0x6dd3df['set']({'label':hs(this['locale'],'AI_CHAT_REASONING'),'icon':_0x3a90af,'class':lr+'\x20'+us,'isToggleable':!0x0,'tooltipPosition':Ir}),_0x6dd3df['on']('execute',()=>{this['fire']('toggleReasoning');}),_0x6dd3df;}['_createCommandsButton'](){const _0x2de94f=new Nt();return _0x2de94f['set']({'label':hs(this['locale'],'AI_CHAT_COMMANDS'),'icon':_0xfb4232,'withText':!0x0,'class':lr+'\x20'+us,'isToggleable':!0x0,'tooltip':hs(this['locale'],'AI_CHAT_COMMANDS'),'tooltipPosition':Ir}),_0x2de94f['extendTemplate']({'attributes':{'class':[ur]}}),_0x2de94f['on']('execute',()=>{console['log']('Commands\x20are\x20not\x20implemented\x20yet.'),alert('Commands\x20are\x20not\x20implemented\x20yet.');}),_0x2de94f;}['_createModelSelectionDropdown'](){const _0x249de6=Gt(this['locale']);return _0x249de6['set']({'panelPosition':'ne','class':[dr]}),_0x249de6['buttonView']['set']({'label':hs(this['locale'],'AI_CHAT_MODEL_SELECTOR_ENABLED_TOOLTIP'),'withText':!0x0,'tooltip':!0x0,'tooltipPosition':Ir,'class':us}),this['listenTo'](_0x249de6,'execute',_0x48c9df=>{this['fire']('selectModel',_0x48c9df['source']['model']);}),_0x249de6;}['_createModelNameView'](){const _0x4da804=new mr(this['locale']);return _0x4da804['bind']('text')['to'](this,'activeModelName',_0x1ebe02=>_0x1ebe02??''),_0x4da804['bind']('isVisible')['to'](this,'modelDisplayMode',_0x162d6e=>'name'===_0x162d6e),_0x4da804;}}let pr=class extends Mt{constructor(_0x116984,_0x9275dc){super();const _0x33178f=this['bindTemplate'],_0x56d37e=this['createCollection']();this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-button__label'],'style':_0x33178f['to']('style'),'id':_0x33178f['to']('id')},'children':[{'tag':'div','attributes':{'class':[_r]},'children':[{'text':_0x33178f['to']('text')}]},{'tag':'div','attributes':{'class':[gr]},'children':[{'tag':'span','children':[{'text':_0x9275dc['description']}]}]},{'tag':'div','attributes':{'class':[Ar]},'children':_0x56d37e}]}),_0x56d37e['addMany'](this['_getCapabilityParts'](_0x116984,_0x31f360,'AI_CHAT_SEARCH_WEB',_0x9275dc['capabilities']['webSearch']?.['enabled']??!0x1)),_0x56d37e['addMany'](this['_getCapabilityParts'](_0x116984,_0x3a90af,'AI_CHAT_REASONING',_0x9275dc['capabilities']['reasoning']?.['enabled']??!0x1));}['_getCapabilityParts'](_0x38a3f4,_0x570bff,_0x4721b6,_0xca42c){const _0x5b6bb3=new xt();_0x5b6bb3['content']=_0x570bff;const _0x1d57b5=new vt(_0x38a3f4);_0x1d57b5['setTemplate']({'tag':'span','children':[{'text':hs(_0x38a3f4,_0x4721b6)+':\x20'}]});const _0x42575c=new vt(_0x38a3f4);return _0x42575c['setTemplate']({'tag':'span','children':[{'text':hs(_0x38a3f4,_0xca42c?'AI_CHAT_CAPABILITIES_YES':'AI_CHAT_CAPABILITIES_NO')}]}),[_0x5b6bb3,_0x1d57b5,_0x42575c];}},mr=class extends vt{constructor(_0x39a003){super(_0x39a003),this['set']('text',void 0x0),this['set']('isVisible',!0x0);const _0x1cb59d=this['bindTemplate'];this['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai-chat-controls__model-name',_0x1cb59d['if']('isVisible','ck-hidden',_0x541f2c=>!_0x541f2c)]},'children':[{'text':_0x1cb59d['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(_0x2e90b8){super(_0x2e90b8),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'](_0x554548=>{this['focusTracker']['add'](_0x554548['element']),this['keystrokes']['listenTo'](_0x554548['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'](_0x4573d0){this['urlInputField']['errorText']=_0x4573d0,this['_updateConfirmButtonState'](),this['fire']('refreshBalloon');}['clearError'](){this['urlInputField']['errorText']=null,this['_updateConfirmButtonState']();}['_createBackButton'](){const _0x4f86ad=new Nt(this['locale']);return _0x4f86ad['set']({'icon':_0x243bd3,'tooltip':hs(this['locale'],'AI_CHAT_CONTEXT_URL_BACK_TO_CONTEXT'),'tooltipPosition':'n','class':['ck-button-icon\x20ck-button-back']}),this['on']('change:withBackButton',(_0x294891,_0x2b057c,_0x24ef1f)=>{_0x4f86ad['set']({'class':['ck-button-icon\x20ck-button-back'+(_0x24ef1f?'':'\x20ck-hidden')]});}),_0x4f86ad;}['_createUrlInputField'](){const _0x1ebf6b=new te(this['locale'],_0xb3bfff);return _0x1ebf6b['set']({'label':hs(this['locale'],'AI_CHAT_CONTEXT_URL_LABEL'),'class':'ck-labeled-field-view_empty'}),_0x1ebf6b['fieldView']['set']({'placeholder':hs(this['locale'],'AI_CHAT_CONTEXT_URL_PLACEHOLDER')}),_0x1ebf6b;}['_createConfirmButton'](){const _0x389ee1=new Nt(this['locale']);return _0x389ee1['set']({'icon':_0x474e29,'tooltip':hs(this['locale'],'AI_CHAT_CONTEXT_URL_ADD_URL'),'tooltipPosition':'n','class':'ck-button-icon','type':'submit','isEnabled':!0x1}),_0x389ee1;}['_setupTemplate'](){const _0x14d223=new _0x4a54a5(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'});_0x14d223['children']['add'](this['backButton'],0x0),this['setTemplate']({'tag':'form','attributes':{'class':Tr,'tabindex':'-1'},'children':[_0x14d223,{'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',_0x5642e4=>{_0x5642e4['stop'](),this['_handleSubmit']();});}['_setupKeystrokes'](){this['keystrokes']['set']('esc',(_0x565ba7,_0x1a27bf)=>{this['clear'](),this['fire']('cancel'),_0x1a27bf();});}['_handleSubmit'](){const _0xed6a48=this['getValue']()['trim']();_0xed6a48?this['_isValidUrl'](_0xed6a48)?(this['clearError'](),this['fire']('submitUrl',_0xed6a48)):this['setError'](hs(this['locale'],'AI_CHAT_CONTEXT_URL_INVALID_ERROR')):this['setError'](hs(this['locale'],'AI_CHAT_CONTEXT_URL_EMPTY_ERROR'));}['_updateConfirmButtonState'](){const _0x20f7b2=this['getValue']()['trim'](),_0x6cf7c8=!!this['urlInputField']['errorText'];this['confirmButton']['isEnabled']=_0x20f7b2['length']>0x0&&!_0x6cf7c8;}['_isValidUrl'](_0x30966d){try{return!!new URL(_0x30966d);}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(_0xdb9362,_0x5f2d0f){super(_0xdb9362),this['resource']=_0x5f2d0f,this['set']('isInContext',!!_0x5f2d0f['isInContext']),this['_titleView']=this['_createTitleView'](),this['_iconView']=this['_createIconView'](),this['_setupTemplate']();}['render'](){super['render']();}['getResourceIcon'](_0x3056ef){if(_0x3056ef['isInContext'])return _0x474e29;switch(_0x3056ef['type']){case'document':return _0x31ce36;case'web-resource':return _0x63b1ba;case'file':case'text':return _0x61dfd7;default:return _0x64142;}}['highlightText'](_0x243df5){if(!_0x243df5||''===_0x243df5['trim']())return void this['_titleView']['highlightText'](null);const _0x39152b=new RegExp(_0x3a047e(_0x243df5),'gi');this['_titleView']['highlightText'](_0x39152b);}['updateResourceState'](_0x27c3fd){this['resource']['isInContext']=_0x27c3fd,this['isInContext']=_0x27c3fd,this['_updateIcon']();}['_createTitleView'](){const _0x5eb4f6=new _0x2ff97f();return _0x5eb4f6['text']=this['resource']['label'],_0x5eb4f6['extendTemplate']({'tag':'span','attributes':{'class':[Sr]}}),_0x5eb4f6;}['_createIconView'](){const _0x2b7057=new xt();return _0x2b7057['content']=this['getResourceIcon'](this['resource']),_0x2b7057;}['_setupTemplate'](){const _0x43276f=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':[fr,_0x43276f['if']('isVisible','ck-hidden',_0x4a637c=>!_0x4a637c),_0x43276f['if']('isInContext',br)]},'children':[{'tag':'div','attributes':{'class':[Rr]},'children':[this['_iconView']]},this['_titleView']],'on':{'click':_0x43276f['to']('execute')}});}['_updateIcon'](){this['_iconView']['content']=this['getResourceIcon'](this['resource']);}}const kr='ck-ai-chat-resources__list';class Nr extends Dt{['_source'];constructor(_0x3bf33a,_0x31a1d7){super(_0x3bf33a),this['_source']=_0x31a1d7,this['extendTemplate']({'attributes':{'class':[kr]}});}['setResources'](_0x795e70,_0x416c76){this['items']['clear']();let _0x30f56d=_0x795e70;if(this['_source']['useDefaultFiltering']&&_0x416c76&&''!==_0x416c76['trim']()){const _0x276eae=new RegExp(_0x416c76['replace'](/[.*+?^${}()|[\]\\]/g,'\x5c$&'),'gi');_0x30f56d=_0x795e70['filter'](_0x5b0677=>_0x276eae['test'](_0x5b0677['label']));}for(const _0x5aa467 of _0x30f56d){const _0x27c090=new Or(this['locale'],_0x5aa467);_0x27c090['on']('execute',()=>{this['_handleResourceSelection'](this['_source'],_0x5aa467);}),this['items']['add'](_0x27c090);}this['_source']['useDefaultFiltering']&&this['highlightText'](_0x416c76);}['highlightText'](_0x26468c){this['_source']['useDefaultFiltering']&&this['items']['forEach'](_0x32161c=>{_0x32161c['highlightText'](_0x26468c);});}['updateResourceState'](_0x169a03,_0x25bb5d){for(const _0xb7846 of this['items']){const _0x58645a=_0xb7846;_0x58645a['resource']['id']===_0x169a03&&_0x58645a['updateResourceState'](_0x25bb5d);}}['_handleResourceSelection'](_0x4354f9,_0x18d113){this['fire']('addResourceToContext',{'source':_0x4354f9,'resource':_0x18d113});}}class vr extends te{['iconView'];['resetButtonView'];['_viewConfig'];constructor(_0x1145fa){const t=_0x1145fa['t'],_0x54379e={'showResetButton':!0x0,'showIcon':!0x0,'creator':_0xb3bfff,'label':hs(_0x1145fa,'AI_CHAT_SEARCH_RESOURCES')};super(_0x1145fa,_0x54379e['creator']),this['label']=_0x54379e['label'],this['_viewConfig']=_0x54379e,this['_viewConfig']['showIcon']&&this['_setupSearchIcon'](),this['_viewConfig']['showResetButton']&&this['_setupResetButton'](_0x1145fa,t),this['_setupEventListeners']();}['reset'](){this['fieldView']['reset'](),this['_viewConfig']['showResetButton']&&this['resetButtonView']&&(this['resetButtonView']['isVisible']=!0x1),this['search']('');}['search'](_0x597c37){this['fire']('search',_0x597c37);}['getQuery'](){return this['fieldView']['element']?.['value']||'';}['_setupSearchIcon'](){this['iconView']=new xt(),this['iconView']['content']=_0x113f89,this['fieldWrapperChildren']['add'](this['iconView'],0x0),this['extendTemplate']({'attributes':{'class':'ck-search__query_with-icon'}});}['_setupResetButton'](_0x35653d,t){this['resetButtonView']=new Nt(_0x35653d),this['resetButtonView']['set']({'label':t('Clear'),'icon':_0x30d60c,'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',_0x2e8d59=>!_0x2e8d59),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(_0x2c169d,_0x132dc7){super(_0x2c169d),this['_source']=_0x132dc7['source'],this['_searchInputVisibleFrom']=_0x132dc7['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 _0x473e27([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 _0x4d4eaf=new vt(this['locale']);return _0x4d4eaf['setTemplate']({'tag':'div','attributes':{'class':'ck\x20ck-search'},'children':[this['_searchView']]}),this['_searchView']['on']('search',(_0xb4a11a,_0x21ae5d)=>{this['loadResources'](_0x21ae5d),this['_source']['useDefaultFiltering']&&this['_resourcesListView']['highlightText'](_0x21ae5d);}),_0x4d4eaf;}['_createResourcesListView'](){const _0x5a4192=new Nr(this['locale'],this['_source']);return _0x5a4192['delegate']('addResourceToContext')['to'](this),_0x5a4192['extendTemplate']({'attributes':{'class':this['bindTemplate']['if']('isLoading','ck-hidden')}}),_0x5a4192;}['_createSkeletonView'](){const _0x19e1b9=new pn(this['locale'],mn['aiChatResources']);return _0x19e1b9['bind']('isVisible')['to'](this,'isLoading'),_0x19e1b9;}['render'](){super['render'](),this['loadResources']('');}['loadResources'](_0xe6470){const _0x766378=ot();this['_latestLoadResourcesUid']=_0x766378,this['fire']('loadSourceResources',{'sourceId':this['_source']['id'],'query':_0xe6470,'uid':_0x766378}),this['isLoading']=!0x0;}['setResources'](_0x247a19,_0x345412){if(_0x345412&&_0x345412!==this['_latestLoadResourcesUid'])return;const _0xb04674=this['_source']['useDefaultFiltering']?this['_searchView']['getQuery']():'';this['_resourcesListView']['setResources'](_0x247a19,_0xb04674),_0x247a19['length']>=this['_searchInputVisibleFrom']&&!this['children']['has'](this['_searchSection'])&&this['children']['add'](this['_searchSection'],0x0),requestAnimationFrame(()=>{this['isLoading']=!0x1;});}['updateResourceState'](_0x9c37a0,_0x4c22e0){this['_resourcesListView']['updateResourceState'](_0x9c37a0,_0x4c22e0);}}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(_0x36bd84,_0x113da6,_0x1327eb){this['_locale']=_0x36bd84,this['_bodyCollection']=_0x113da6,this['_config']=_0x1327eb;}['showSourceResourcesBalloon']({source:_0x59324a,withBackButton:_0x3cc55f}){let _0x5040ec=this['_sourceResourceBalloons']['get'](_0x59324a['id']);_0x5040ec||(_0x5040ec=this['_createSourceResourceBalloonPanel'](),this['_sourceResourceBalloons']['set'](_0x59324a['id'],_0x5040ec),this['_setupSingleResourceBalloonClickOutsideHandler'](_0x5040ec)),this['_addSourceResourceContent']({'balloonPanel':_0x5040ec,'source':_0x59324a,'withBackButton':_0x3cc55f}),_0x5040ec['show']();const _0x47b292=this['_config']['getTargetElement']();_0x47b292&&_0x5040ec['pin']({'target':_0x47b292,'limiter':this['_config']['getLimiterElement']()});}['populateSourceResourceBalloon'](_0x365049,_0x13cd5b,_0x1136b5){const _0x1ba39b=this['_sourceResourceBalloons']['get'](_0x365049);if(!_0x1ba39b)return;const _0x5da79e=this['_getResourcesViewFromBalloon'](_0x1ba39b);_0x5da79e&&(_0x5da79e['setResources'](_0x13cd5b,_0x1136b5),_0x5da79e['once']('change:isLoading',()=>{_0x1ba39b['pin']({'target':this['_config']['getTargetElement'](),'limiter':this['_config']['getLimiterElement']()});}));}['closeSourceResourceBalloon'](_0x94a978){const _0x1f24cd=this['_sourceResourceBalloons']['get'](_0x94a978);_0x1f24cd&&requestAnimationFrame(()=>{_0x1f24cd['hide'](),this['_sourceResourceBalloons']['delete'](_0x94a978),this['_config']['onBalloonClosed']();});}['isAnyResourceBalloonVisible'](){for(const _0x1d3768 of this['_sourceResourceBalloons']['values']())if(_0x1d3768['isVisible'])return!0x0;return!0x1;}['updateResourceState'](_0x279eb0,_0xa3e353,_0x4775f5){const _0x1eedc4=this['_sourceResourceBalloons']['get'](_0x279eb0);if(!_0x1eedc4||!_0x1eedc4['isVisible'])return;const _0x340ec=this['_config']['getTargetElement']();if(!_0x340ec)return;_0x1eedc4['pin']({'target':_0x340ec,'limiter':this['_config']['getLimiterElement']()});const _0x174bff=this['_getResourcesViewFromBalloon'](_0x1eedc4);_0x174bff&&_0x174bff['updateResourceState'](_0xa3e353,_0x4775f5);}['destroy'](){for(const _0x9b9c6c of this['_sourceResourceBalloons']['values']())_0x9b9c6c['destroy']();this['_sourceResourceBalloons']['clear']();}['_createSourceResourceBalloonPanel'](){const _0x3980f0=new Xt(this['_locale']);return _0x3980f0['extendTemplate']({'attributes':{'class':xr}}),this['_bodyCollection']['add'](_0x3980f0),_0x3980f0;}['_addSourceResourceContent']({balloonPanel:_0x41c920,source:_0x1e5727,withBackButton:_0x37d778}){_0x41c920['content']['clear']();const _0x519e46=this['_createBalloonHeader']({'balloonPanel':_0x41c920,'source':_0x1e5727,'withBackButton':_0x37d778});_0x41c920['content']['add'](_0x519e46);const _0x448665=this['_createBalloonResourcesView'](_0x1e5727);_0x41c920['content']['add'](_0x448665);}['_createBalloonHeader']({balloonPanel:_0x391512,source:_0x16e0f3,withBackButton:_0x448771}){const _0x149011=new _0x4a54a5(this['_locale'],{'label':_0x16e0f3['label'],'class':Dr});return _0x448771&&_0x149011['children']['add'](this['_createBackButton'](_0x391512),0x0),_0x149011;}['_createBackButton'](_0x49da49){const _0x1d7ba0=new Nt(this['_locale']);return _0x1d7ba0['set']({'icon':_0x243bd3,'tooltip':hs(this['_locale'],'AI_CHAT_CONTEXT_URL_BACK_TO_CONTEXT'),'tooltipPosition':'n','class':Lr}),_0x1d7ba0['on']('execute',()=>{_0x49da49['hide'](),this['_config']['onBackToContext']();}),_0x1d7ba0;}['_createBalloonResourcesView'](_0x445e98){const _0x2c724a=new yr(this['_locale'],{'source':_0x445e98,'searchInputVisibleFrom':this['_config']['searchInputVisibleFrom']});return _0x2c724a['on']('loadSourceResources',(_0x4464cf,_0x54307f)=>{this['_config']['onLoadSourceResources'](_0x54307f);}),_0x2c724a['on']('addResourceToContext',(_0x555a5c,_0x7b5f35)=>{this['_config']['onResourceSelected'](_0x7b5f35['source'],_0x7b5f35['resource']),this['closeSourceResourceBalloon'](_0x445e98['id']);}),_0x2c724a;}['_getResourcesViewFromBalloon'](_0x279019){const _0x557f37=_0x279019['content']['get'](0x1);return _0x557f37 instanceof yr?_0x557f37:null;}['_setupSingleResourceBalloonClickOutsideHandler'](_0x2b94c5){zt({'emitter':_0x2b94c5,'contextElements':[_0x2b94c5['element']],'callback':()=>{_0x2b94c5['hide'](),this['_config']['onBalloonClosed']();},'activator':()=>_0x2b94c5['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(_0x5d59bd,_0x29e783){super(_0x5d59bd),this['bodyCollection']=_0x29e783['bodyCollection'],this['_currentContextsChips']=this['createCollection'](),this['_conversationContextsChips']=this['createCollection'](),this['addContextButtonView']=this['_createAddContextButtonView'](_0x5d59bd),this['_addContextBalloonPanelView']=this['_createAddContextBalloonPanelView'](_0x5d59bd),this['_urlBalloonPanelView']=this['_createUrlBalloonPanelView'](_0x5d59bd),this['_resourcesBalloonView']=this['_createResourcesBalloonView'](_0x5d59bd,_0x29e783);const _0x1c8688={'cssClasses':{'showMoreButton':$r+'\x20'+us,'showMoreBalloon':qr,'overflowContainer':Yr,'controlsButton':Wr}};this['_overflowManager']=new Wn(_0x5d59bd,this['_currentContextsChips'],_0x1c8688,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'](_0x3e0226,_0x22870d){const _0x4dd90c=this['_createContextButton'](_0x3e0226,'current',!0x0,_0x22870d);this['_addContextToCollection'](_0x4dd90c,this['_currentContextsChips']),this['_overflowManager']['reorganizeChips']();}['removeContextItem'](_0x2d64cd){this['_removeContextFromCollection'](_0x2d64cd,this['_currentContextsChips']),this['_removeContextFromCollection'](_0x2d64cd,this['_overflowManager']['overflowChips']),this['_overflowManager']['reorganizeChips']();}['setContextItemLoading'](_0xead335,_0x432a6f){let _0x4553f3=this['_currentContextsChips']['find'](_0xd69714=>_0xd69714['id']===_0xead335);_0x4553f3||(_0x4553f3=this['_overflowManager']['overflowChips']['find'](_0x411d2c=>_0x411d2c['id']===_0xead335)),_0x4553f3&&(_0x4553f3['isLoading']=_0x432a6f);}['setConversationContext'](_0x3ef470){this['_conversationContextsChips']['clear']();for(const _0x27f237 of _0x3ef470){const _0x4deb8c=this['_createContextButton'](_0x27f237,'conversation',!0x1,!0x1);this['_addContextToCollection'](_0x4deb8c,this['_conversationContextsChips']);}}['clearCurrentContextItems'](){this['_currentContextsChips']['clear'](),this['_overflowManager']['clear']();}['clearConversationContextItems'](){this['_conversationContextsChips']['clear']();}['updateResourceState'](_0x17c55f,_0x3914d4,_0x3c8f7c){this['_resourcesBalloonView']['updateResourceState'](_0x17c55f,_0x3914d4,_0x3c8f7c);}['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:_0x445821,withBackButton:_0x7a198c}){this['_resourcesBalloonView']['showSourceResourcesBalloon']({'source':_0x445821,'withBackButton':_0x7a198c}),this['addContextButtonView']['isOn']=!0x0;}['populateSourceResourceBalloon'](_0x2f03bb,_0x523a82,_0x218d78,_0x303344){this['_resourcesBalloonView']['populateSourceResourceBalloon'](_0x2f03bb,_0x218d78,_0x303344);}['closeSourceResourceBalloon'](_0x10d51c){this['_resourcesBalloonView']['closeSourceResourceBalloon'](_0x10d51c),this['addContextButtonView']['isOn']=!0x1;}['setAddContextOptions'](_0x569e43){this['_setBalloonPanelContent'](this['_addContextBalloonPanelView'],this['locale'],_0x569e43),this['_setAddContextButtonEnabled'](_0x569e43);}['_setAddContextButtonEnabled'](_0x17ddbe){const _0x5672fd=!_0x17ddbe['document']['isHidden']&&_0x17ddbe['document']['enabled'],_0x4a972a=_0x17ddbe['urls']['enabled'],_0x3fa45f=_0x17ddbe['files']['enabled'],_0x54f712=_0x17ddbe['sources']['length']>0x0,_0x15aa8e=_0x17ddbe['customItems']&&_0x17ddbe['customItems']['length']>0x0;this['addContextButtonView']['isEnabled']=_0x5672fd||_0x4a972a||_0x3fa45f||_0x54f712||_0x15aa8e;}['_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'](_0x3f85e9){const _0xecb3d5=new Nt(_0x3f85e9);return _0xecb3d5['set']({'label':hs(_0x3f85e9,'AI_CHAT_CONTEXT_ADD_CONTEXT'),'class':Wr+'\x20'+Br+'\x20'+us,'icon':_0x46418a,'isToggleable':!0x0,'tooltip':!0x0,'tooltipPosition':'sw'}),_0xecb3d5;}['_createAddContextBalloonPanelView'](_0x2c1260){return this['_createBaseBalloonPanel'](_0x2c1260,Vr);}['_createUrlBalloonPanelView'](_0x5459c2){const _0x335bba=this['_createBaseBalloonPanel'](_0x5459c2,Gr);return this['_addUrlContent'](_0x335bba,_0x5459c2),_0x335bba;}['_createResourcesBalloonView'](_0x48e8d8,_0x14f679){const _0x1f3c3b={'searchInputVisibleFrom':_0x14f679['searchInputVisibleFrom'],'onBackToContext':()=>{this['showAddContextBalloonPanel'](),this['_addContextBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':Xr});},'onResourceSelected':(_0xc1554c,_0x263fc5)=>{this['fire']('addResourceToContext',{'source':_0xc1554c,'resource':_0x263fc5});},'onLoadSourceResources':_0x5a9e06=>{this['fire']('loadSourceResources',_0x5a9e06);},'onBalloonClosed':()=>{this['addContextButtonView']['isOn']=!0x1;},'getLimiterElement':()=>this['_getLimiterElement'](),'getTargetElement':()=>this['addContextButtonView']['element']};return new Pr(_0x48e8d8,_0x14f679['bodyCollection'],_0x1f3c3b);}['_getLimiterElement'](){return this['element']?.['closest']('.'+Qr)||document['body'];}['_createBaseBalloonPanel'](_0xf17d58,_0x31aa9d){const _0x366a6b=new Xt(_0xf17d58);return _0x366a6b['extendTemplate']({'attributes':{'class':_0x31aa9d}}),this['bodyCollection']['add'](_0x366a6b),_0x366a6b;}['_setBalloonPanelContent'](_0x25b0de,_0x9c601c,_0x504b80){if(_0x25b0de['content']['clear'](),!_0x504b80['document']['isHidden']&&_0x504b80['document']['enabled']){const _0x2667df=this['_createBalloonButton'](_0x9c601c,{'label':hs(_0x9c601c,'AI_CHAT_CONTEXT_CURRENT_DOCUMENT'),'icon':_0x31ce36});_0x2667df['on']('execute',()=>{this['fire']('addDocumentToContext'),this['hideAddContextBalloonPanel']();}),_0x25b0de['content']['add'](_0x2667df);}if(_0x504b80['urls']['enabled']){const _0x2b59f8=this['_createBalloonButton'](_0x9c601c,{'label':hs(_0x9c601c,'AI_CHAT_CONTEXT_URL_LABEL'),'icon':_0x63b1ba});_0x2b59f8['on']('execute',()=>{this['hideAddContextBalloonPanel'](),this['showUrlBalloonPanel'](),this['_urlBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':Xr}),this['_urlInputView']['focus']();}),_0x25b0de['content']['add'](_0x2b59f8);}if(_0x504b80['files']['enabled']){const _0x3f1877=new _0x2da8f5(_0x9c601c);_0x3f1877['set']({'label':hs(_0x9c601c,'AI_CHAT_CONTEXT_FILE_LABEL'),'icon':_0x106b02,'withText':!0x0,'tooltip':!0x0,'class':Fr,'allowMultipleFiles':!0x0}),_0x3f1877['on']('execute',()=>{this['hideAddContextBalloonPanel']();}),_0x3f1877['on']('done',(_0xb2244f,_0x9860c2)=>{this['fire']('addFileToContext',_0x9860c2);}),_0x3f1877['tooltip']=!0x0,_0x25b0de['content']['add'](_0x3f1877);}for(const _0x5ce709 of _0x504b80['sources']){const _0x263adf=this['_createBalloonButton'](_0x9c601c,{'label':_0x5ce709['label'],'icon':_0x5ce709['icon']||_0x64142,'type':'source'});_0x25b0de['content']['add'](_0x263adf),_0x263adf['on']('execute',()=>{this['hideAddContextBalloonPanel'](),this['_showSourceResourcesBalloon']({'source':_0x5ce709,'withBackButton':!this['_hasExactlyOneSource']});});}for(const _0x10b13a of _0x504b80['customItems']||[]){const _0x1d4b0c=this['_createBalloonButton'](_0x9c601c,{'label':_0x10b13a['label'],'icon':_0x10b13a['icon']||_0x64142,'type':'customItem'});_0x25b0de['content']['add'](_0x1d4b0c),_0x1d4b0c['on']('execute',()=>{this['hideAddContextBalloonPanel'](),this['fire']('executeCustomItemCallback',_0x10b13a);});}this['_hasExactlyOneSource']=0x1===_0x25b0de['content']['length'],this['_urlInputView']['withBackButton']=!this['_hasExactlyOneSource'];}['_addUrlContent'](_0xd8705f,_0x5ad6b7){this['_urlInputView']=new wr(_0x5ad6b7),this['_urlInputView']['on']('submitUrl',(_0xb3aef6,_0x218f0a)=>{this['_handleUrlSubmit'](_0x218f0a);}),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});}),_0xd8705f['content']['add'](this['_urlInputView']);}['_createBalloonButton'](_0x1f51f7,_0x22b81b){const _0x209537='source'===_0x22b81b['type']?new jr(_0x1f51f7):new Nt(_0x1f51f7);return _0x209537['set']({'label':_0x22b81b['label'],'icon':_0x22b81b['icon'],'withText':!0x0,'tooltip':!0x0,'tooltipPosition':'sw','class':Fr}),_0x209537;}['_setupAllBalloonClickOutsideHandlers'](){this['_setupAddContextBalloonClickOutsideHandler'](),this['_setupUrlBalloonClickOutsideHandler']();}['_setupUrlBalloonClickOutsideHandler'](){zt({'emitter':this['_urlBalloonPanelView'],'contextElements':[this['_urlBalloonPanelView']['element']],'callback':()=>{this['hideUrlBalloonPanel']();},'activator':()=>this['_urlBalloonPanelView']['isVisible']});}['_toggleAddContextBalloon'](_0x434d55){const _0x19712e=this['_addContextBalloonConfig'];_0x19712e['buttonView']['isOn']=_0x434d55,_0x434d55?_0x19712e['balloonView']['show']():_0x19712e['balloonView']['hide']();}['_setupAddContextBalloonClickOutsideHandler'](){const {balloonView:_0x50b017,buttonView:_0x20759e,hideMethod:_0x478a54}=this['_addContextBalloonConfig'];zt({'emitter':_0x50b017,'contextElements':[_0x50b017['element'],_0x20759e['element']],'callback':()=>{_0x478a54();},'activator':()=>_0x20759e['isOn']&&!this['_urlBalloonPanelView']['isVisible']&&!this['_resourcesBalloonView']['isAnyResourceBalloonVisible']()});}['_createContextButton'](_0x583bb5,_0x381f55,_0x2f918a=!0x1,_0x2baff7=!0x1){const _0x101842='conversation'===_0x381f55||!0x0===_0x583bb5['isReadOnly'],_0x4ed76a=new Bn(this['locale'],_0x583bb5,_0x101842,_0x2f918a,_0x2baff7);return _0x101842||_0x4ed76a['on']('removeContextItemChip',()=>{this['fire']('removeContextItem',_0x4ed76a['id']);}),_0x4ed76a;}['_addContextToCollection'](_0x2daf52,_0x182829){_0x182829['add'](_0x2daf52,0x0);}['_removeContextFromCollection'](_0x460006,_0xc95060){const _0x7a31c8=_0xc95060['find'](_0x42e47e=>_0x42e47e['id']===_0x460006);_0x7a31c8&&_0xc95060['remove'](_0x7a31c8);}['_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'](_0x4f8dd){this['_urlInputView']['clear'](),this['hideUrlBalloonPanel'](),this['fire']('addUrlToContext',_0x4f8dd);}}class jr extends Nt{['arrowView'];constructor(_0x23ba7e){super(_0x23ba7e),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 _0x43c034=new xt();return _0x43c034['content']=_0x13161c,_0x43c034['extendTemplate']({'attributes':{'class':Kr+'__arrow'}}),_0x43c034;}}class Jr extends vt{['_cancelButtonView'];['_loaderView'];constructor(_0x59263e){super(_0x59263e),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 _0x162d33=new Nt(this['locale']);return _0x162d33['set']({'label':hs(this['locale'],'AI_CHAT_STOP_GENERATING'),'withText':!0x0,'class':ls+'\x20ck-ai-button-stop-generating','icon':_0x3e5a33}),_0x162d33['on']('execute',()=>{this['fire']('abortPromptStream');}),_0x162d33;}['_createLoaderView'](){const _0x2b128e=new vt(this['locale']);return _0x2b128e['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')}]}),_0x2b128e;}}class Zr extends vt{['_contextPanelView'];['_promptInputView'];['_promptCapabilitiesView'];['_loaderView'];['_modelUnavailableMessageView'];['_shouldRestorePromptInputFocus'];constructor(_0x688263,_0x17d28b){super(_0x688263),this['_contextPanelView']=this['_createContextPanelView'](_0x688263,{'bodyCollection':_0x17d28b['bodyCollection'],'searchInputVisibleFrom':_0x17d28b['contextResourcesSearchInputVisibleFrom']}),this['_promptInputView']=this['_createPromptInputView'](_0x688263),this['_promptCapabilitiesView']=this['_createPromptCapabilitiesView'](_0x688263),this['_loaderView']=this['_createLoaderView'](_0x688263),this['_modelUnavailableMessageView']=this['_createModelUnavailableMessageView'](_0x688263),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 _0x266b76=this['bindTemplate'];this['setTemplate']({'tag':'form','attributes':{'class':['ck','ck-ai-chat-controls',_0x266b76['if']('isDisabled','ck-ai-chat-controls-disabled')]},'children':[{'tag':'div','attributes':{'class':[_0x266b76['if']('isLoading','ck-hidden',_0x4930f0=>_0x4930f0||!this['isModelAvailable']),_0x266b76['if']('isModelAvailable','ck-hidden',_0x362107=>!_0x362107||this['isLoading'])]},'children':[this['_contextPanelView'],this['_promptInputView'],this['_promptCapabilitiesView']]},{'tag':'div','attributes':{'class':[_0x266b76['if']('isLoading','ck-hidden',_0x36ab70=>!_0x36ab70)]},'children':[this['_loaderView']]},{'tag':'div','attributes':{'class':[_0x266b76['if']('isModelAvailable','ck-hidden',_0x378ced=>_0x378ced)]},'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'](_0x58a434,_0x30c342){return new zr(_0x58a434,_0x30c342);}['_createPromptInputView'](_0x251855){return new hr(_0x251855,this['_contextPanelView']['addContextButtonView']);}['_createPromptCapabilitiesView'](_0x26201a){return new Er(_0x26201a);}['_createLoaderView'](_0x224b7f){return new Jr(_0x224b7f);}['_createModelUnavailableMessageView'](_0x17797c){const _0x5ace96=new to(_0x17797c);return _0x5ace96['delegate']('startConversation')['to'](this),_0x5ace96;}['_handlePromptInputFocus'](_0x45d817,_0x32cba8,_0x175327){_0x175327?this['_shouldRestorePromptInputFocus']=!0x0:this['_shouldRestorePromptInputFocus']&&this['_promptInputView']['focus']();}['addContextItem'](_0x578c78,_0x3ca5bc){this['_contextPanelView']['addContextItem'](_0x578c78,_0x3ca5bc);}['removeContextItem'](_0x429225){this['_contextPanelView']['removeContextItem'](_0x429225);}['setContextItemLoading'](_0x3ff428,_0x1a00e1){this['_contextPanelView']['setContextItemLoading'](_0x3ff428,_0x1a00e1);}['setIsUploadInProgress'](_0xea36e1){this['_promptInputView']['setIsUploadInProgress'](_0xea36e1);}['setConversationContext'](_0x4956a2){this['_contextPanelView']['setConversationContext'](_0x4956a2);}['clearPendingContextUI'](){this['_contextPanelView']['clearCurrentContextItems']();}['clearConversationContextUI'](){this['_contextPanelView']['clearConversationContextItems']();}['updateResourceState'](_0x525055,_0x4ee378,_0x107ba9){this['_contextPanelView']['updateResourceState'](_0x525055,_0x4ee378,_0x107ba9);}['setWebSearch'](_0x31f782){this['_promptCapabilitiesView']['setWebSearch'](_0x31f782);}['setReasoning'](_0x11b2aa){this['_promptCapabilitiesView']['setReasoning'](_0x11b2aa);}['resetMessageInput'](){this['_promptInputView']['reset']();}['setAddContextOptions'](_0x2dc711){this['_contextPanelView']['setAddContextOptions'](_0x2dc711);}['setInputPlaceholder'](_0x3725e1){this['_promptInputView']['setPlaceholderText'](_0x3725e1);}['setModelList'](_0x50b882,_0x2cee9){this['_promptCapabilitiesView']['setModelList'](_0x50b882,_0x2cee9);}['setModel'](_0x3ac2ef){_0x3ac2ef?(this['isModelAvailable']=!0x0,this['_promptCapabilitiesView']['setModel'](_0x3ac2ef)):this['isModelAvailable']=!0x1;}['enableModelSelector'](){this['_promptCapabilitiesView']['enableModelSelector']();}['disableModelSelector'](_0x18ccd7){this['_promptCapabilitiesView']['disableModelSelector'](_0x18ccd7);}['populateSourceResourceBalloon'](_0x299e2e,_0xfe6630,_0x478539,_0x1c51eb){this['_contextPanelView']['populateSourceResourceBalloon'](_0x299e2e,_0xfe6630,_0x478539,_0x1c51eb);}['closeSourceResourceBalloon'](_0x2cc80b){this['_contextPanelView']['closeSourceResourceBalloon'](_0x2cc80b);}['focusPromptInput'](_0x50e166=!0x1){this['_promptInputView']['focus'](_0x50e166);}['setPromptInputValue'](_0x339c29){this['_promptInputView']['queryView']['fieldView']['reset'](),this['_promptInputView']['queryView']['fieldView']['value']=_0x339c29;}}class to extends vt{constructor(_0x26d417){super(_0x26d417);const _0xd9f7e0=new Nt(_0x26d417);_0xd9f7e0['set']({'label':hs(this['locale'],'AI_CHAT_MODEL_UNAVAILABLE_MESSAGE_BUTTON'),'withText':!0x0,'class':['ck-ai-chat-controls__start-new-chat-button'],'tooltip':''}),_0xd9f7e0['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'},_0xd9f7e0]}]});}}class eo extends _0x4a54a5{['resizeButton'];constructor(_0x2525a6,_0x5b7877){super(_0x2525a6,{'label':_0x5b7877['label'],'class':'ck-ai-header\x20'+_0x5b7877['class'],'icon':_0x5b7877['icon']}),this['set']('isMaximized',!0x1),_0x5b7877['content']&&this['children']['add'](_0x5b7877['content']),_0x5b7877['showResizeButton']&&(this['resizeButton']=ds(_0x2525a6,this),this['children']['add'](this['resizeButton']));}}class io extends vt{constructor(_0x5b2ef0){super(_0x5b2ef0),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-disclaimer']},'children':[{'tag':'p','attributes':{'class':['ck','ck-ai-disclaimer__content']},'children':[{'text':hs(_0x5b2ef0,'AI_DISCLAIMER_TEXT')}]}]});}}function so(_0x5a1b45,_0x1635be){const _0x740454=new Nt(_0x5a1b45);return _0x740454['set']({'label':hs(_0x5a1b45,'AI_CHAT_LABEL_NEW_CHAT'),'withText':!0x0,'icon':_0x12a1f4,'class':'ck-ai-chat__start-conversation\x20'+ls}),_0x740454['on']('execute',()=>{_0x1635be['fire']('startConversation');}),_0x740454;}class no extends vt{['chatHeader'];['chatFeed'];['chatControls'];['chatDisclaimer'];['_bodyCollection'];constructor(_0x5d125b,_0x2b0218){super(_0x5d125b),this['_bodyCollection']=new Qt(_0x5d125b),this['_bodyCollection']['attachToDom']();const _0x4666e3=so(_0x5d125b,this);this['chatHeader']=new eo(_0x5d125b,{'label':hs(_0x5d125b,'AI_CHAT_HEADING'),'icon':_0xf4a3ae,'class':'ck-ai-header_chat','content':_0x4666e3,'showResizeButton':_0x2b0218['showResizeButton']}),this['chatHeader']['delegate']('resizeTabs')['to'](this),this['chatFeed']=new rr(_0x5d125b,this['_bodyCollection']),this['chatFeed']['delegate'](...tn)['to'](this),this['chatControls']=new Zr(_0x5d125b,{'bodyCollection':this['_bodyCollection'],'contextResourcesSearchInputVisibleFrom':_0x2b0218['contextResourcesSearchInputVisibleFrom']}),this['chatControls']['delegate'](...tn)['to'](this),this['chatDisclaimer']=new io(_0x5d125b),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset_all','ck-ai-chat','ck-rounded-corners'],'dir':_0x5d125b['uiLanguageDirection']},'children':[this['chatHeader'],this['chatFeed'],this['chatControls'],this['chatDisclaimer']]});}['populateSourceResourceBalloon'](_0x4f2dfb,_0x2145e9,_0x413f7f,_0x1dfbf7){this['chatControls']['populateSourceResourceBalloon'](_0x4f2dfb,_0x2145e9,_0x413f7f,_0x1dfbf7);}['closeSourceResourceBalloon'](_0x5d7aa7){this['chatControls']['closeSourceResourceBalloon'](_0x5d7aa7);}['destroy'](){this['_bodyCollection']['detachFromDom'](),super['destroy']();}}class ro extends _0x1c4723{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(_0x3b700f){super(_0x3b700f);const _0x4aec08=this['context']['plugins']['get']('AITabs');this['set']('isBusy',!0x1),this['_promiseQueue']=new Cn(),this['_view']=new no(this['context']['locale'],{'showResizeButton':_0x4aec08['showResizeButton'],'contextResourcesSearchInputVisibleFrom':this['context']['config']['get']('ai.chat.context.searchInputVisibleFrom')}),this['_view']['delegate']('resizeTabs')['to'](_0x4aec08),this['_view']['delegate'](...tn)['to'](this),this['_view']['on']('toggleSuggestionDisplayMode',(_0x4b035f,{showDiff:_0x46d224})=>{this['showDiff']=_0x46d224;}),_0x4aec08['view']['addTab']({'id':'chat','buttonLabel':hs(this['context']['locale'],'AI_CHAT_HEADING'),'buttonIcon':_0xf4a3ae,'order':0x0,'content':this['_view']}),this['_view']['chatHeader']['bind']('isMaximized')['to'](_0x4aec08['view'],'isMaximized',_0x356072=>_0x356072),this['_view']['chatControls']['bind']('isLoading')['to'](this,'isBusy',_0x13740a=>_0x13740a),this['_view']['chatControls']['setInputPlaceholder'](this['_getInputPlaceholder']()),this['bind']('isModelAvailable')['to'](this['_view']['chatControls'],'isModelAvailable');}['destroy'](){super['destroy'](),this['_titleAnimationInterval']&&clearInterval(this['_titleAnimationInterval']);}['createConversation'](_0x58296f){const _0x11234f=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'](_0x58296f['availableModels'],!this['context']['config']['get']('ai.models.showModelSelector')),this['addFeedItemStaticMessage']({'id':'conversation-start','staticMessage':_0x11234f}),this['fire']('conversationCreated');}async['addFeedItemStaticMessage']({id:_0x3a6e7c,staticMessage:_0x57907d}){return this['_promiseQueue']['enqueue'](async()=>{this['_view']['chatFeed']['addItem']('ai-reply',{'id':_0x3a6e7c,'initialContent':'<p>'+_0x57907d+'</p>'});});}async['addFeedItemUserMessage'](_0xc1c7c1){const _0x20584d=_0xc1c7c1['attributes']?.['displayedPrompt']||_0xc1c7c1['userMessage'];return this['_promiseQueue']['enqueue'](async()=>{this['_view']['chatFeed']['addItem']('user-message',{'contextItems':Array['from'](_0xc1c7c1['contextItems']['values']()),'initialContent':'<p>'+_0x20584d+'</p>','id':_0xc1c7c1['id']});});}async['addFeedItemError']({errorMessage:_0x183b34,id:_0x1a1829}){return this['_promiseQueue']['enqueue'](async()=>{this['_view']['chatFeed']['addItem']('error-message',{'initialContent':'<p>'+_0x183b34+'</p>','id':_0x1a1829});});}async['addFeedItemAIReply'](_0x3998c6){return this['_promiseQueue']['enqueue'](async()=>{this['_view']['chatFeed']['addItem']('ai-reply',{'id':_0x3998c6['interactionId']+':'+_0x3998c6['id']}),this['clearLoadingMessage']();});}async['addFeedItemAISuggestion'](_0x187e55){const _0x548142=$s(this['context']);let _0x4ba116=_0x548142['config']['get']('ai.availableReplyActions')||[...fn];if(_0x548142['plugins']['has']('TrackChanges')){if(!this['_isTrackChangesCommandValueBound']){this['_isTrackChangesCommandValueBound']=!0x0;const _0x5da8c6=_0x548142['commands']['get']('trackChanges');this['_view']['chatFeed']['bind']('isTrackChangesOn')['to'](_0x5da8c6,'value');}}else _0x4ba116=_0x4ba116['filter'](_0x4a282c=>'insertSuggestion'!=_0x4a282c);return this['_promiseQueue']['enqueue'](async()=>{this['_view']['chatFeed']['addItem']('ai-suggestion-reply',{'id':_0x187e55['interactionId']+':'+_0x187e55['id'],'areActionsDisabled':_0x187e55['areActionsDisabled'],'showDiff':this['showDiff'],'availableActions':_0x4ba116}),this['clearLoadingMessage']();});}async['addFeedInteractionHeader'](_0x319065,_0x59836a){return this['_promiseQueue']['enqueue'](async()=>{const _0x2c48a7=this['_view']['chatFeed']['children']['last'];if(_0x2c48a7 instanceof Zn)return this['_view']['chatFeed']['children']['remove'](_0x2c48a7),void this['_view']['chatFeed']['addItem']('interaction-header',{'id':_0x319065['id'],'capabilities':{'isWebSearchEnabled':_0x2c48a7['capabilities']['isWebSearchEnabled']||_0x59836a['isWebSearchEnabled'],'isReasoningEnabled':_0x2c48a7['capabilities']['isReasoningEnabled']||_0x59836a['isReasoningEnabled']}});this['_view']['chatFeed']['addItem']('interaction-header',{'id':_0x319065['id'],'capabilities':_0x59836a});});}async['addFeedItemCustomElement'](_0x41a099,_0x232710){let _0x2c71d3;return await this['_promiseQueue']['enqueue'](async()=>{_0x2c71d3=this['_view']['chatFeed']['addItem']('custom-element',{'content':_0x41a099,'id':_0x232710});}),_0x2c71d3;}['removeFeedItem'](_0x31baec){this['_view']['chatFeed']['removeItem'](_0x31baec);}['hasFeedItem'](_0x3c51f6){return this['_view']['chatFeed']['hasItem'](_0x3c51f6);}['updateFeedInteractionHeader'](_0x12f816){const _0xb440bd=this['_view']['chatFeed']['children']['find'](_0x4d6cb0=>_0x4d6cb0['options']['id']==_0x12f816['id']&&_0x4d6cb0 instanceof Zn);_0xb440bd&&_0xb440bd['set']('isVisible',_0x12f816['isVisible']);}async['updateFeedItemAIReplyContent'](_0x2a84d9){const _0x14f445=_0x2a84d9['renderingStrategy']||this['feedItemRenderingStrategy'];return this['_promiseQueue']['enqueue'](async _0x18c9c9=>{await this['_view']['chatFeed']['updateReplyItem']({..._0x2a84d9,'abortSignal':_0x18c9c9,'renderingStrategy':_0x14f445}),_0x2a84d9['isDone']&&this['markFeedItemAsDone'](_0x2a84d9['id']);});}['updateFeedItemAIReplySources'](_0xf5df99,_0x317dbc){this['_view']['chatFeed']['updateWebSources'](_0xf5df99,_0x317dbc);}async['updateFeedItemAIReplySuggestionContent'](_0x51c33b){return this['_promiseQueue']['enqueue'](async _0x38ffe2=>{await this['_view']['chatFeed']['updateSuggestionItem']({..._0x51c33b,'abortSignal':_0x38ffe2}),_0x51c33b['isDone']&&this['markFeedItemAsDone'](_0x51c33b['id']);});}['updateFeedItemAIReplySuggestionPartState'](_0x49eb28){this['_view']['chatFeed']['updateSuggestionPartState'](_0x49eb28);}['setFeedItemAIReplySuggestionPartActive'](_0xbca29c){this['_view']['chatFeed']['setSuggestionPartActive'](_0xbca29c);}['markFeedItemAsDone'](_0x424483){this['_view']['chatFeed']['markItemAsDone'](_0x424483);}['removeFeedInteraction'](_0x43ac51){this['_view']['chatFeed']['getItemIds']()['filter'](_0x2f513d=>_0x2f513d['startsWith'](_0x43ac51))['forEach'](_0x5c4b6f=>this['_view']['chatFeed']['removeItem'](_0x5c4b6f));}['startInteraction'](){const _0x1f1318=this['prepareLoadingMessage']({'isWebSearchEnabled':!0x1,'isReasoningEnabled':!0x1});this['setLoadingMessage'](_0x1f1318),this['_view']['chatControls']['disableModelSelector'](!this['context']['config']['get']('ai.models.showModelSelector')),this['isBusy']=!0x0,this['_view']['chatFeed']['startAutoScroll']();}['stopInteraction'](_0x1a4c19){this['_promiseQueue']['abort'](),this['_view']['chatFeed']['getItemIds']()['filter'](_0x43901c=>_0x43901c['startsWith'](_0x1a4c19['id']))['forEach'](_0x129074=>this['markFeedItemAsDone'](_0x129074)),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'](_0x5a4413,_0x4b1ee7){this['_view']['chatControls']['addContextItem'](_0x5a4413,_0x4b1ee7);}['removeContextItem'](_0x5c4f81){this['_view']['chatControls']['removeContextItem'](_0x5c4f81);}['setContextItemLoading'](_0x1ccc33,_0x1dab9a){this['_view']['chatControls']['setContextItemLoading'](_0x1ccc33,_0x1dab9a);}['setIsUploadInProgress'](_0x930b4){this['_view']['chatControls']['setIsUploadInProgress'](_0x930b4);}['setConversationContext'](_0x41ccf3){this['_view']['chatControls']['setConversationContext'](_0x41ccf3);}['clearPendingContextUI'](){this['_view']['chatControls']['clearPendingContextUI']();}['clearConversationContextUI'](){this['_view']['chatControls']['clearConversationContextUI']();}['updateResourceState'](_0x274738,_0x26a38d,_0x448ad7){this['_view']['chatControls']['updateResourceState'](_0x274738,_0x26a38d,_0x448ad7);}['resetMessageInput'](){this['_view']['chatControls']['resetMessageInput'](),this['_view']['chatControls']['setInputPlaceholder'](this['_getInputPlaceholder']());}['setAddContextOptions'](_0x2f72f0){this['_view']['chatControls']['setAddContextOptions'](_0x2f72f0);}['updateCapabilities'](_0x2b4d0f){this['_view']['chatControls']['setWebSearch'](_0x2b4d0f['isWebSearchEnabled']),this['_view']['chatControls']['setReasoning'](_0x2b4d0f['isReasoningEnabled']),this['_view']['chatControls']['setInputPlaceholder'](this['_getInputPlaceholder'](_0x2b4d0f));}['setSelectedModel'](_0x291126,_0x1a9237){this['_view']['chatControls']['setModel'](_0x291126),_0x1a9237&&this['_view']['chatControls']['disableModelSelector'](!0x1);}['setFeedItemRenderingStrategy'](_0x22d86d){this['feedItemRenderingStrategy']=_0x22d86d;}['toggleLoadingSkeleton'](_0x31ebbb){this['_view']['chatFeed']['toggleLoadingSkeleton'](_0x31ebbb);}['resetConversationTitle'](){this['setConversationTitle'](hs(this['context']['locale'],'AI_CHAT_HEADING'));}['setConversationTitle'](_0x5f27a5,_0x1ae66c=!0x1){if(_0x1ae66c&&!St()&&_0x5f27a5['length'])return this['_view']['chatHeader']['label']='',void this['_animateConversationTitle'](_0x5f27a5);this['_view']['chatHeader']['label']=_0x5f27a5;}['setLoadingMessage'](_0x115153){this['_view']['chatFeed']['setLoadingMessage'](_0x115153);}['clearLoadingMessage'](){this['_view']['chatFeed']['setLoadingMessage']('');}['_animateConversationTitle'](_0x15dd38){let _0x5eb39a=0x0;clearInterval(this['_titleAnimationInterval']),this['_titleAnimationInterval']=setInterval(()=>{this['_view']['chatHeader']['label']=this['_view']['chatHeader']['label']+_0x15dd38[_0x5eb39a],_0x5eb39a++,_0x5eb39a===_0x15dd38['length']&&clearInterval(this['_titleAnimationInterval']);},0x1e);}['prepareLoadingMessage'](_0x1e106f){return _0x1e106f['isWebSearchEnabled']&&_0x1e106f['isReasoningEnabled']?hs(this['context']['locale'],'AI_CHAT_FEED_LOADING_MESSAGE_WEBSEARCH_REASONING'):_0x1e106f['isWebSearchEnabled']?hs(this['context']['locale'],'AI_CHAT_FEED_LOADING_MESSAGE_WEBSEARCH'):_0x1e106f['isReasoningEnabled']?hs(this['context']['locale'],'AI_CHAT_FEED_LOADING_MESSAGE_REASONING'):hs(this['context']['locale'],'AI_CHAT_FEED_LOADING_MESSAGE_REGULAR');}['_getInputPlaceholder'](_0x2ee0cb){return _0x2ee0cb?_0x2ee0cb['isWebSearchEnabled']&&_0x2ee0cb['isReasoningEnabled']?hs(this['context']['locale'],'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_WEBSEARCH_REASONING'):_0x2ee0cb['isWebSearchEnabled']?hs(this['context']['locale'],'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_WEBSEARCH'):_0x2ee0cb['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'](_0x215206,_0x59a4f3,_0x20b2cf,_0x2bbbf7){this['_view']['populateSourceResourceBalloon'](_0x215206,_0x59a4f3,_0x20b2cf,_0x2bbbf7);}['closeSourceResourceBalloon'](_0x4cb205){this['_view']['closeSourceResourceBalloon'](_0x4cb205);}['setPromptInputValue'](_0x513b5d){this['_view']['chatControls']['setPromptInputValue'](_0x513b5d);}['focusPromptInput'](_0x422a70=!0x1){this['_view']['chatControls']['focusPromptInput'](_0x422a70);}['scrollFeedToSuggestion'](_0x277e74,_0x450a74){this['_view']['chatFeed']['scrollToSuggestion'](_0x277e74,_0x450a74);}['startAutoScroll'](_0x19f57b={}){this['_view']['chatFeed']['startAutoScroll'](_0x19f57b);}['disableControls'](){this['_view']['chatControls']['isDisabled']=!0x0;}['enableControls'](){this['_view']['chatControls']['isDisabled']=!0x1;}}class oo extends Dt{['sections'];constructor(_0x263d43,_0x3cb832){super(_0x263d43),this['sections']=_0x3cb832,this['items']['addMany'](this['sections']),this['extendTemplate']({'attributes':{'class':['ck-ai-chat-history__sections']}});}['filter'](_0x232f57){let _0x141021=0x0,_0x31797a=0x0;for(const _0x1b6109 of this['sections']){const {resultsCount:_0x2b41cd,totalItemsCount:_0x14b6ad}=_0x1b6109['filter'](_0x232f57);_0x141021+=_0x2b41cd,_0x31797a+=_0x14b6ad;}return{'resultsCount':_0x141021,'totalItemsCount':_0x31797a};}}class ao extends Ht{['title'];['itemsViews'];['_itemsListView'];constructor(_0x4f555c,{title:_0x19ad68,items:_0x282a48}){super(_0x4f555c);const _0x214b53=this['bindTemplate'];this['set']('isVisible',!0x0),this['title']=_0x19ad68,this['itemsViews']=_0x282a48;const _0x139b45=new vt(_0x4f555c);_0x139b45['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-chat-history__section-title']},'children':[this['title']]}),this['_itemsListView']=new Dt(_0x4f555c),this['_itemsListView']['items']['addMany'](this['itemsViews']),this['setTemplate']({'tag':'li','attributes':{'class':['ck-ai-chat-history__section',_0x214b53['if']('isVisible','ck-hidden',_0x55c4e0=>!_0x55c4e0)]},'children':[_0x139b45,this['_itemsListView']]});}['filter'](_0x4a0d71){const _0x13ab0a=this['itemsViews']['length'];let _0x33f7a9=0x0;for(const _0x34491e of this['itemsViews']){if(_0x4a0d71){const _0x56d95f=_0x34491e['isMatching'](_0x4a0d71);_0x34491e['isVisible']=!!_0x56d95f,_0x34491e['highlightText'](_0x4a0d71);}else _0x34491e['isVisible']=!0x0,_0x34491e['highlightText'](null);_0x34491e['isVisible']&&_0x33f7a9++;}return this['isVisible']=_0x33f7a9>0x0,{'resultsCount':_0x33f7a9,'totalItemsCount':_0x13ab0a};}['getItem'](_0x49b82a){return this['itemsViews']['find'](_0x490d40=>_0x490d40['id']===_0x49b82a);}['removeItem'](_0x4fd50d){const _0x5b2401=this['itemsViews']['indexOf'](_0x4fd50d);-0x1!==_0x5b2401&&(this['itemsViews']['splice'](_0x5b2401,0x1),this['_itemsListView']['items']['remove'](_0x4fd50d));}}class ho extends/* #__PURE__ -- @preserve */
|
|
27
|
-
_0x29274d(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(_0x2f0f6f,_0x4326b3){super(_0x2f0f6f);const _0x2ca433=this['bindTemplate'];this['set']('isEdit',!0x1),this['set']('isVisible',!0x0),this['set']('pinned',!!_0x4326b3['pinned']),this['set']('loadingState',null),this['set']('title',_0x4326b3['title']),this['id']=_0x4326b3['id'];const {createdAt:_0x1854a9,active:_0x59cdd6=!0x1}=_0x4326b3;this['_titleView']=new _0x2ff97f(),this['_titleView']['bind']('text')['to'](this,'title',t=>_0x56a9e5(t||'')),this['_titleView']['extendTemplate']({'attributes':{'class':['ck-ai-chat-history__item-title']}});const _0x41e386=this['_createCheckView'](),_0x467f0a=this['_createPinButtonView'](_0x2f0f6f),_0x3150f0=this['_createMenuDropdownView'](),_0x3b40f4=this['_createEditInputView'](_0x2f0f6f),_0x3ef31a=this['_createAcceptEditButtonView'](_0x2f0f6f,_0x3b40f4),_0xf3f0a3=this['_createCancelEditButtonView'](_0x2f0f6f);this['actions']=this['createCollection'](),this['mainContent']=this['createCollection'](),this['mainContent']['add'](this['_titleView']),this['actions']['add'](_0x467f0a),this['actions']['add'](_0x3150f0),this['on']('change:isEdit',(_0x27fe2b,_0x49d2d7,_0x29562b)=>{this['actions']['clear'](),this['mainContent']['clear'](),_0x29562b?(this['actions']['add'](_0x3ef31a),this['actions']['add'](_0xf3f0a3),this['mainContent']['add'](_0x3b40f4),_0x3b40f4['element']['value']=this['title']||'',_0x3b40f4['element']['focus']()):(this['actions']['add'](_0x467f0a),this['actions']['add'](_0x3150f0),this['mainContent']['add'](this['_titleView']));}),this['setTemplate']({'tag':'li','attributes':{'class':['ck-ai-chat-history__item',_0x59cdd6?'ck-ai-chat-history__item--active':'',_0x2ca433['if']('isVisible','ck-hidden',_0x4a30d7=>!_0x4a30d7),_0x2ca433['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',_0x2ca433['if']('loadingState','ck-hidden',_0x49f71b=>!!_0x49f71b)]},'children':_0x59cdd6?[_0x41e386]:[]},{'tag':'div','attributes':{'class':['ck-ai-loader',_0x2ca433['if']('loadingState','ck-hidden',_0x1fb1e4=>!_0x1fb1e4)]},'children':[this['_createSpinnerView']()]}]},{'tag':'div','attributes':{'class':['ck-ai-chat-history__item-row']},'children':[{'tag':'div','attributes':{'class':['ck-ai-chat-history__item-content']},'on':{'click':this['bindTemplate']['to']('click')},'children':[{'tag':'div','attributes':{'class':['ck-ai-chat-history__item-main-content']},'children':[{'tag':'div','attributes':{'class':['ck-ai-chat-history__item-title-container',_0x2ca433['if']('loadingState','ck-hidden',_0x30f683=>!!_0x30f683)]},'children':this['mainContent']},{'tag':'div','attributes':{'class':['ck-ai-loader__text',_0x2ca433['if']('loadingState','ck-hidden',_0x4b4479=>!_0x4b4479)]},'children':[{'text':_0x2ca433['to']('loadingState',_0x20b8bc=>_0x20b8bc?hs(this['locale'],ho['LOADING_LABELS'][_0x20b8bc]):'')}]}]},{'tag':'span','attributes':{'class':['ck-ai-chat-history__item-date']},'children':[_0x1854a9]}]},{'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'](_0x1161b2){this['set']('title',_0x1161b2);}['updateLoadingState'](_0x2f81bd,_0x26e9fc){this['set']('loadingState',_0x26e9fc?_0x2f81bd:null);}['_createCheckView'](){const _0xe3ca9b=new xt();return _0xe3ca9b['set']({'content':_0x474e29}),_0xe3ca9b;}['_createPinButtonView'](_0x39df8d){const _0x1db494=new Nt(_0x39df8d);return _0x1db494['set']({'label':hs(_0x39df8d,'AI_CHAT_HISTORY_PIN_BUTTON'),'icon':_0x2a4d0e,'withText':!0x1,'tooltip':!0x0}),_0x1db494['bind']('isOn')['to'](this,'pinned'),_0x1db494['on']('execute',()=>{const _0x272cb5=!this['pinned'];this['fire']('setConversationPinned',{'id':this['id'],'pinned':_0x272cb5});}),_0x1db494;}['_createMenuDropdownView'](){const _0x1d3609=Gt(this['locale']),_0x1cb827=_0x1d3609['panelView']['children'];_0x1d3609['buttonView']['set']({'label':hs(this['locale'],'AI_CHAT_HISTORY_SHOW_MORE_ITEMS'),'icon':_0x3ab32d}),_0x1d3609['panelPosition']='sw';const _0xbf9eb3=new Nt(this['locale']);_0xbf9eb3['label']=hs(this['locale'],'AI_CHAT_HISTORY_EDIT_NAME'),_0xbf9eb3['withText']=!0x0,_0xbf9eb3['on']('execute',()=>{this['isEdit']=!0x0;});const _0x16396e=new Nt(this['locale']);_0x16396e['label']=hs(this['locale'],'AI_CHAT_HISTORY_REMOVE'),_0x16396e['withText']=!0x0,_0x16396e['on']('execute',()=>{this['showConfirm'](hs(this['locale'],'AI_CHAT_HISTORY_REMOVE_CONFIRM'),this['element'])['then'](()=>{this['fire']('removeConversation',{'id':this['id']});});});const _0x5677b3=new Dt(this['locale']),_0x337b83=new Ht(this['locale']);_0x337b83['children']['add'](_0xbf9eb3);const _0x29338b=new Ht(this['locale']);return _0x29338b['children']['add'](_0x16396e),_0x5677b3['items']['addMany']([_0x337b83,_0x29338b]),_0x1cb827['add'](_0x5677b3),_0x1d3609;}['_createEditInputView'](_0x4ca334){const _0x3f9762=new _0x50d28e(_0x4ca334),_0x1b9397=_0x3f9762['bindTemplate'];return _0x3f9762['extendTemplate']({'on':{'keydown':_0x1b9397['to'](_0x5e7ac0=>{'Enter'==_0x5e7ac0['key']&&this['_commitEditInputValue'](_0x3f9762);})}}),_0x3f9762;}['_createAcceptEditButtonView'](_0xc22788,_0x556435){const _0x29cac1=new Nt(_0xc22788);return _0x29cac1['set']({'icon':_0x474e29,'withText':!0x1,'tooltip':hs(_0xc22788,'AI_CHAT_HISTORY_ACCEPT')}),_0x29cac1['extendTemplate']({'attributes':{'class':['ck-confirm-view-submit']}}),_0x29cac1['on']('execute',()=>{this['_commitEditInputValue'](_0x556435);}),_0x29cac1;}['_commitEditInputValue'](_0x39c9c2){const _0x5b3d28=_0x39c9c2['element']['value']||'';this['isEdit']=!0x1,this['fire']('editConversationTitle',{'id':this['id'],'title':_0x5b3d28});}['_createCancelEditButtonView'](_0x3dc27a){const _0x2673cd=new Nt(_0x3dc27a);return _0x2673cd['set']({'icon':_0x30d60c,'withText':!0x1,'tooltip':hs(_0x3dc27a,'AI_CHAT_HISTORY_CANCEL')}),_0x2673cd['extendTemplate']({'attributes':{'class':['ck-confirm-view-cancel']}}),_0x2673cd['on']('execute',()=>{this['isEdit']=!0x1,this['fire']('edit:cancel');}),_0x2673cd;}['_createSpinnerView'](){const _0x121a81=new yn('tiny');return _0x121a81['isVisible']=!0x0,_0x121a81;}['isMatching'](_0x5925bb){return'string'==typeof this['title']&&this['title']['match'](_0x5925bb)?{'title':!0x0}:null;}['highlightText'](_0x52f62a){this['_titleView']['highlightText'](_0x52f62a);}}class co extends vt{['headerView'];['searchView'];['mainErrorView'];['skeletonView'];['emptyView'];['sectionsView'];constructor(_0x1acbc1,_0x418a01){super(_0x1acbc1),this['set']('hasItems',!0x1),this['set']('isLoading',!0x0),this['set']('errorMessage',''),this['set']('isSearchViewVisible',!0x1),this['set']('isEmptyViewVisible',!0x1),this['set']('isMainErrorViewVisible',!0x1);const _0x5f441d=so(_0x1acbc1,this);this['headerView']=new eo(_0x1acbc1,{'label':hs(_0x1acbc1,'AI_CHAT_HISTORY_HEADING'),'icon':_0x2de1d5,'class':'ck-ai-header_history','content':_0x5f441d,'showResizeButton':_0x418a01}),this['headerView']['delegate']('resizeTabs')['to'](this),this['sectionsView']=new oo(_0x1acbc1,[]),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',_0x196708=>!_0x196708)]}}),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 _0x46ebbf=new _0x48eb62(this['locale'],{'filteredView':this['sectionsView'],'queryView':{'label':hs(this['locale'],'AI_CHAT_HISTORY_SEARCH_LABEL')},'infoView':{'text':{'notFound':{'primary':_0x2ea8be=>hs(this['locale'],'AI_CHAT_HISTORY_SEARCH_NOT_FOUND_PRIMARY',_0x2ea8be),'secondary':hs(this['locale'],'AI_CHAT_HISTORY_SEARCH_NOT_FOUND_SECONDARY')}}}}),_0x3c4fa4=this['_createErrorView']();return _0x3c4fa4['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('errorMessage','ck-hidden',_0x5f558e=>!_0x5f558e)]}}),_0x46ebbf['on']('render',()=>{_0x46ebbf['children']['add'](_0x3c4fa4,0x1);}),_0x46ebbf['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isSearchViewVisible','ck-hidden',_0x2ce607=>!_0x2ce607)]}}),_0x46ebbf;}['_createSkeletonView'](){const _0x4217a9=new pn(this['locale'],mn['aiHistory']);return _0x4217a9['bind']('isVisible')['to'](this,'isLoading'),_0x4217a9;}['_createErrorView'](){const _0x2c1f05=new vt(this['locale']),_0x453da0=new Nt(this['locale']);_0x453da0['set']({'withText':!0x1,'icon':_0x30d60c,'class':'ck-ai-notification_error__dismiss-button'}),_0x453da0['bind']('isVisible')['to'](this,'hasItems',_0xe974e0=>!!_0xe974e0),_0x453da0['on']('execute',()=>{this['errorMessage']='';});const _0x77eaf=this['bindTemplate'];return _0x2c1f05['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-notification','ck-ai-notification_error']},'children':[{'tag':'p','children':[{'text':_0x77eaf['to']('errorMessage')}]},_0x453da0]}),_0x2c1f05;}['_createEmptyStateView'](){const _0x1e9f7a=new vt(this['locale']);return _0x1e9f7a['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-chat-history__empty',this['bindTemplate']['if']('isEmptyViewVisible','ck-hidden',_0x4598bc=>!_0x4598bc)]},'children':[{'tag':'p','attributes':{'class':['ck-ai-chat-history__empty-message']},'children':[hs(this['locale'],'AI_CHAT_HISTORY_EMPTY_MESSAGE')]}]}),_0x1e9f7a;}['_createListItemViews'](_0x511364,_0x349ee1){const _0x248205=[];for(const _0x53f96e of _0x511364){const _0x4509de=new ho(_0x349ee1,_0x53f96e);_0x4509de['delegate'](...lo)['to'](this),_0x248205['push'](_0x4509de);}return _0x248205;}['updateHistoryItemsWithCategories'](_0x4b94a4){const _0x4de2ac=this['locale']||'en',_0x1837ad=[];for(const _0x517d20 of _0x4b94a4){const _0x1caa40=this['_createListItemViews'](_0x517d20['items'],_0x4de2ac);_0x1837ad['push'](new ao(_0x4de2ac,{'title':_0x517d20['title'],'items':_0x1caa40}));}this['sectionsView']['sections']=_0x1837ad,this['sectionsView']['items']['clear'](),this['sectionsView']['items']['addMany'](_0x1837ad),this['hasItems']=_0x4b94a4['some'](_0x67c6f5=>_0x67c6f5['items']['length']>0x0),this['_refreshSearch']();}['removeHistoryItem'](_0x1ed349){for(const _0x951825 of this['sectionsView']['sections']){const _0x5ac74c=_0x951825['getItem'](_0x1ed349);if(_0x5ac74c){if(_0x951825['removeItem'](_0x5ac74c),0x0===_0x951825['itemsViews']['length']){const _0x1c6b3b=this['sectionsView']['sections']['indexOf'](_0x951825);-0x1!==_0x1c6b3b&&(this['sectionsView']['sections']['splice'](_0x1c6b3b,0x1),this['sectionsView']['items']['remove'](_0x951825));}this['hasItems']=this['sectionsView']['sections']['length']>0x0,this['_refreshSearch']();break;}}}['updateItemTitle'](_0x1207fd,_0x1413cc){for(const _0x46c9e0 of this['sectionsView']['sections']){const _0x48142f=_0x46c9e0['getItem'](_0x1207fd);if(_0x48142f){_0x48142f['updateTitle'](_0x1413cc);break;}}}['updateItemLoadingState'](_0x10da8f,_0x4b5a4c,_0x1bdd2b){for(const _0x3140c7 of this['sectionsView']['sections']){const _0x1f1f79=_0x3140c7['getItem'](_0x10da8f);if(_0x1f1f79){_0x1f1f79['updateLoadingState'](_0x4b5a4c,_0x1bdd2b);break;}}}['_refreshSearch'](){if(this['hasItems']){const _0x3cc63e=this['searchView']['queryView']['fieldView']?.['element']?.['value']||'';this['searchView']['search'](_0x3cc63e);}}}const lo=['showConversationHistory','removeConversation','editConversationTitle','setConversationPinned','selectConversation','startConversation'];class uo extends _0x1c4723{static get['requires'](){return[os];}['_historyView'];static get['pluginName'](){return'AIChatHistoryUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x192b09){super(_0x192b09);const _0x4e0a8b=this['context']['plugins']['get']('AITabs');this['_historyView']=new co(this['context']['locale'],_0x4e0a8b['showResizeButton']),this['_historyView']['delegate']('resizeTabs')['to'](_0x4e0a8b),this['_historyView']['delegate'](...lo)['to'](this),this['_historyView']['headerView']['bind']('isMaximized')['to'](_0x4e0a8b['view'],'isMaximized',_0x3e4def=>_0x3e4def),_0x4e0a8b['view']['addTab']({'id':'history','buttonLabel':hs(this['context']['locale'],'AI_CHAT_HISTORY_HEADING'),'buttonIcon':_0x2de1d5,'order':0x0,'content':this['_historyView']});}['removeHistoryItem'](_0x47ec51){this['_historyView']['removeHistoryItem'](_0x47ec51);}['updateItems'](_0x5b3958){this['_historyView']['updateHistoryItemsWithCategories'](_0x5b3958);}['updateItemTitle'](_0x297435,_0x3fe02b){this['_historyView']['updateItemTitle'](_0x297435,_0x3fe02b);}['updateItemLoadingState'](_0x53c713,_0x561e39,_0x40053a){this['_historyView']['updateItemLoadingState'](_0x53c713,_0x561e39,_0x40053a);}['setLoadingSkeleton'](_0x15da7b){this['_historyView']['isLoading']=_0x15da7b;}['showError'](_0x521b59){this['_historyView']['errorMessage']=_0x521b59;}['hideError'](){this['_historyView']['errorMessage']='';}}class _o extends ht(){['id'];['createdAt'];constructor({id:_0x20f0da,title:_0x360d95,createdAt:_0x5902a9,updatedAt:_0x491f6,pinned:_0x10b879}){super(),this['id']=_0x20f0da,this['createdAt']=new Date(_0x5902a9),this['set']('title',_0x360d95),this['set']('updatedAt',_0x491f6?new Date(_0x491f6):null),this['set']('pinned',_0x10b879||!0x1);}['updateTitle'](_0x1f721d){this['set']('title',_0x1f721d),this['updatedAt']=new Date();}['updatePinned'](_0x5a7540){this['set']('pinned',_0x5a7540),this['updatedAt']=new Date();}}class go extends Tt(){['items']=[];['connector'];['group'];constructor({connector:_0xa06fe9,group:_0x55de5c}){super(),this['connector']=_0xa06fe9,this['group']=_0x55de5c;}async['init'](){try{const _0x2c177e=this['connector']['fetchConversations'](this['group']),_0x303bb1=await _0x2c177e['getConversations']();this['loadItems'](_0x303bb1);}catch(_0xf2e699){this['fire']('error',{'error':_0xf2e699,'operation':'init'});}}['addItem'](_0x5d4800){this['items']['push'](_0x5d4800);}async['removeItem'](_0x962030){const _0x280069=this['items']['findIndex'](_0x2a0a83=>_0x2a0a83['id']===_0x962030);if(-0x1===_0x280069)return!0x1;try{return await this['connector']['deleteConversation'](_0x962030)['execute'](),this['items']['splice'](_0x280069,0x1),this['fire']('itemRemoved',{'itemId':_0x962030}),!0x0;}catch(_0x2ff40d){return this['fire']('error',{'error':_0x2ff40d,'operation':'removeItem','itemId':_0x962030}),!0x1;}}['getItem'](_0x5eeef3){return this['items']['find'](_0x565d2f=>_0x565d2f['id']===_0x5eeef3);}async['updateItemTitle'](_0x331228,_0x1ef362){const _0x345eb8=this['getItem'](_0x331228);if(!_0x345eb8)return!0x1;try{return await this['connector']['updateConversation'](_0x331228,{'title':_0x1ef362})['getResult'](),_0x345eb8['updateTitle'](_0x1ef362),this['fire']('itemUpdated',{'itemId':_0x331228,'updates':{'title':_0x1ef362}}),!0x0;}catch(_0x1482b2){return this['fire']('error',{'error':_0x1482b2,'operation':'updateItemTitle','itemId':_0x331228}),!0x1;}}async['updateItemPinned'](_0x3fc36b,_0x4e0aec){const _0x1af4e8=this['getItem'](_0x3fc36b);if(!_0x1af4e8)return!0x1;try{return await this['connector']['updateConversation'](_0x3fc36b,{'pinned':_0x4e0aec})['getResult'](),_0x1af4e8['updatePinned'](_0x4e0aec),this['fire']('itemUpdated',{'itemId':_0x3fc36b,'updates':{'pinned':_0x4e0aec}}),!0x0;}catch(_0x5109d9){return this['fire']('error',{'error':_0x5109d9,'operation':'updateItemPinned','itemId':_0x3fc36b}),!0x1;}}['loadItems'](_0x215b43){try{this['items']=[],_0x215b43['map'](_0x5bae35=>{this['addItem'](new _o(_0x5bae35));}),this['fire']('itemsLoaded',{'items':[...this['items']]});}catch(_0x5782f2){this['fire']('error',{'error':_0x5782f2,'operation':'loadItems'});}}['getItems'](_0x40cbae={}){const _0x26f1de=void 0x0!==_0x40cbae['pinned']&&_0x40cbae['pinned'],_0x53f0f0=_0x40cbae['from']?new Date(_0x40cbae['from']['getFullYear'](),_0x40cbae['from']['getMonth'](),_0x40cbae['from']['getDate']()):null,_0x548eb6=_0x40cbae['to']?new Date(_0x40cbae['to']['getFullYear'](),_0x40cbae['to']['getMonth'](),_0x40cbae['to']['getDate']()):null;return this['items']['filter'](_0x429875=>{if(_0x429875['pinned']!==_0x26f1de)return!0x1;if(_0x548eb6){const _0x5f5820=new Date(_0x429875['createdAt']['getFullYear'](),_0x429875['createdAt']['getMonth'](),_0x429875['createdAt']['getDate']());return _0x53f0f0?_0x53f0f0['getTime']()===_0x548eb6['getTime']()?_0x5f5820['getTime']()===_0x53f0f0['getTime']():_0x5f5820<_0x548eb6&&_0x5f5820>=_0x53f0f0:_0x5f5820<_0x548eb6;}return!0x0;});}}class Ao extends _0x1c4723{['_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 _0x9f93ca=this['context']['plugins']['get'](os);try{const _0x1a7a29=this['_aiChatController']['getGroupId']();this['history']=new go({'connector':this['_aiConnector'],'group':_0x1a7a29}),this['listenTo'](this['_aiChatHistoryUi'],'removeConversation',(_0x3c66d6,_0x1b7ce4)=>{this['_setItemLoading'](_0x1b7ce4['id'],'remove'),this['_handleRemove'](_0x1b7ce4['id']);}),this['listenTo'](this['_aiChatHistoryUi'],'editConversationTitle',(_0x113ee9,_0x224e75)=>{this['_setItemLoading'](_0x224e75['id'],'rename'),this['_handleEditTitle'](_0x224e75['id'],_0x224e75['title']);}),this['listenTo'](this['history'],'itemUpdated',(_0x5095b8,_0x242dfa)=>{void 0x0!==_0x242dfa['updates']['title']&&this['_aiChatHistoryUi']['updateItemTitle'](_0x242dfa['itemId'],_0x242dfa['updates']['title']),void 0x0!==_0x242dfa['updates']['pinned']&&this['_updateHistoryItemsUI'](),this['_clearItemLoading'](_0x242dfa['itemId']);}),this['listenTo'](this['history'],'itemRemoved',(_0x139d14,_0x49f9e3)=>{this['_aiChatController']['_handleRemovedConversation'](_0x49f9e3['itemId']),this['_aiChatHistoryUi']['removeHistoryItem'](_0x49f9e3['itemId']),this['_clearItemLoading'](_0x49f9e3['itemId']);}),this['listenTo'](this['history'],'itemsLoaded',()=>{this['_updateHistoryItemsUI']();}),this['listenTo'](this['history'],'error',(_0x6bc62e,_0x2ef20c)=>{this['_handleHistoryErrorUI'](_0x2ef20c['error'],_0x2ef20c['operation'],_0x2ef20c['itemId']);}),this['listenTo'](this['_aiChatHistoryUi'],'selectConversation',(_0x4df644,_0x2b2deb)=>{this['_handleSelectConversation'](_0x2b2deb['id']);}),this['listenTo'](this['_aiChatHistoryUi'],'setConversationPinned',(_0x3052a8,_0xf7d410)=>{const _0x2ec76e=_0xf7d410['pinned']?'pin':'unpin';this['_setItemLoading'](_0xf7d410['id'],_0x2ec76e),this['_handleTogglePin'](_0xf7d410['id'],_0xf7d410['pinned']);}),this['listenTo'](this['_aiChatHistoryUi'],'startConversation',()=>{this['_aiChatController']['startConversation'](),_0x9f93ca['view']['activateTab']('chat');}),this['listenTo'](this['_aiChatController'],'change:activeConversation',()=>{this['_updateHistoryItemsUI']();}),_0x9f93ca['view']['on']('activateTab:history',()=>{this['_showConversationHistory']();});}catch(_0x571848){this['_handleHistoryErrorUI'](_0x571848,'init');}}async['_handleEditTitle'](_0x35e031,_0x301453){await this['history']['updateItemTitle'](_0x35e031,_0x301453);}async['_handleTogglePin'](_0x45fa48,_0x9e60c0){await this['history']['updateItemPinned'](_0x45fa48,_0x9e60c0);}async['_handleRemove'](_0x751c1c){await this['history']['removeItem'](_0x751c1c);}async['_handleSelectConversation'](_0x586b91){await this['_aiChatController']['loadConversation'](_0x586b91);}async['_showConversationHistory'](){this['_aiChatHistoryUi']['showError'](''),this['_aiChatHistoryUi']['setLoadingSkeleton'](!0x0),await this['history']['init'](),this['_aiChatHistoryUi']['setLoadingSkeleton'](!0x1);}['_updateHistoryItemsUI'](){const _0x420890=this['_aiChatController']['activeConversation']?.['id'],_0x3bcfac=this['_getCategorizedItems']()['map'](_0x47afbc=>({'title':_0x47afbc['title'],'items':_0x47afbc['items']['map'](_0x5d96c4=>({'id':_0x5d96c4['id'],'title':_0x5d96c4['title']||hs(this['context']['locale'],'AI_CHAT_UNTITLED_CONVERSATION'),'createdAt':new Date(_0x5d96c4['createdAt'])['toLocaleDateString'](),'active':_0x5d96c4['id']===_0x420890,'pinned':_0x5d96c4['pinned']}))}));this['_aiChatHistoryUi']['updateItems'](_0x3bcfac);}['_setItemLoading'](_0x289cee,_0x2eab31){this['_aiChatHistoryUi']['updateItemLoadingState'](_0x289cee,_0x2eab31,!0x0);}['_clearItemLoading'](_0xfbd689){this['_aiChatHistoryUi']['updateItemLoadingState'](_0xfbd689,null,!0x1);}['_handleHistoryErrorUI'](_0x252c2e,_0x38b6a7,_0x21e033){const _0x18400f=this['_generateErrorMessage'](_0x38b6a7,_0x21e033);this['_aiChatHistoryUi']['showError'](_0x18400f),_0x21e033&&this['_clearItemLoading'](_0x21e033),this['_aiChatHistoryUi']['setLoadingSkeleton'](!0x1);}['_generateErrorMessage'](_0x38d009,_0x329dfb){const _0x1418cf=_0x329dfb?this['history']['getItem'](_0x329dfb):null,_0x2b3aa3=_0x1418cf?.['title']||hs(this['context']['locale'],'AI_CHAT_UNTITLED_CONVERSATION');switch(_0x38d009){case'updateItemTitle':return hs(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_UPDATE_TITLE',_0x2b3aa3);case'updateItemPinned':{const _0x22b3eb=hs(this['context']['locale'],_0x1418cf?.['pinned']?'AI_CHAT_HISTORY_UNPIN_ACTION':'AI_CHAT_HISTORY_PIN_ACTION');return hs(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_UPDATE_PINNED',[_0x22b3eb,_0x2b3aa3]);}case'removeItem':return hs(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_REMOVE_ITEM',_0x2b3aa3);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 _0xbe8a90=new Date(),_0xccdcd5=new Date(_0xbe8a90['getFullYear'](),_0xbe8a90['getMonth'](),_0xbe8a90['getDate']()),_0x453060=new Date(_0xccdcd5);_0x453060['setDate'](_0x453060['getDate']()-0x1);const _0x2994a0=new Date(_0xccdcd5);_0x2994a0['setDate'](_0x2994a0['getDate']()-0xe);const _0x7e58bd=this['history']['getItems']({'pinned':!0x0}),_0x14b969=this['history']['getItems']({'from':_0xccdcd5,'to':_0xccdcd5}),_0x4059b6=this['history']['getItems']({'from':_0x453060,'to':_0x453060}),_0x365dfe=this['history']['getItems']({'from':_0x2994a0,'to':_0x453060}),_0x8bf30=this['history']['getItems']({'to':_0x2994a0}),_0x2d6424=[];return _0x7e58bd['length']>0x0&&_0x2d6424['push']({'title':hs(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_PINNED'),'items':_0x7e58bd}),_0x14b969['length']>0x0&&_0x2d6424['push']({'title':hs(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_TODAY'),'items':_0x14b969}),_0x4059b6['length']>0x0&&_0x2d6424['push']({'title':hs(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_YESTERDAY'),'items':_0x4059b6}),_0x365dfe['length']>0x0&&_0x2d6424['push']({'title':hs(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_LAST_14_DAYS'),'items':_0x365dfe}),_0x8bf30['length']>0x0&&_0x2d6424['push']({'title':hs(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_LATER'),'items':_0x8bf30}),_0x2d6424;}}class Io extends _0x1c4723{static get['requires'](){return[Ao,uo];}static get['pluginName'](){return'AIChatHistory';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}class Eo extends _0x1c4723{static get['requires'](){return[Xs,Js,ro,Io];}static get['pluginName'](){return'AIChat';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x5b6dee){super(_0x5b6dee),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(_0x46c00d,_0x15c6a2){super(_0x46c00d);const {id:_0x1362a2,type:_0x599b59,icon:_0x2ef953}=_0x15c6a2;this['id']=_0x1362a2,this['set']({'label':_0x15c6a2['label'],'withText':!0x0,'class':'ck-ai-chat-shortcut'}),this['extendTemplate']({'attributes':{'data-cke-ai-shortcut-id':_0x15c6a2['id']}}),_0x2ef953?this['icon']=_0x2ef953:'chat'===_0x599b59?this['icon']=_0xf4a3ae:'review'===_0x599b59?this['icon']=_0x48c8b8:'translate'===_0x599b59&&(this['icon']=_0xe821c5);}}class mo extends vt{['listView'];constructor(_0x3b9ab8,_0x823756){super(_0x3b9ab8);const _0x363f19=_0x823756['map'](_0x1a32af=>{const _0x166d38=new Ht(this['locale']),_0xc08fea=new po(this['locale'],_0x1a32af);return _0x166d38['children']['add'](_0xc08fea),_0xc08fea['delegate']('execute')['to'](this),_0x166d38;});this['listView']=new Dt(this['locale']),this['listView']['items']['addMany'](_0x363f19),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat-shortcuts']},'children':[this['listView']]});}}const To='chat-shortcuts';class Co extends _0x1c4723{['_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 _0x3252b4=this['context']['plugins']['get']('AIChatController');this['_shortcuts']['length']&&(this['_validateShortcuts'](),this['_aiChatUI']['on']('conversationCreated',()=>{_0x3252b4['activeConversation']['isFromHistory']||this['_injectShortcuts']();}),this['listenTo'](_0x3252b4,'interactionStarted',()=>{this['_removeShortcuts']();}));}['_validateShortcuts'](){const _0x5ecd60=['chat','review','translate'];this['_shortcuts']['forEach'](_0x1482a6=>{let _0x4f35a7=!0x0;if(_0x1482a6['id']&&_0x1482a6['label']&&_0x5ecd60['includes'](_0x1482a6['type'])?'chat'===_0x1482a6['type']&&(_0x4f35a7='string'==typeof _0x1482a6['prompt']):_0x4f35a7=!0x1,!_0x4f35a7)throw new at('ai-chat-shortcuts-invalid-config',this['context'],{'shortcut':_0x1482a6});});}['_injectShortcuts'](){const _0x2a4080=this['context']['plugins']['get'](ro);this['_shortcutsView']=new mo(this['context']['locale'],this['_shortcuts']),this['_shortcutsView']['render'](),_0x2a4080['addFeedItemCustomElement'](this['_shortcutsView']['element'],To),this['_shortcutsView']['on']('execute',_0x490ddd=>{const _0x5ebb61=_0x490ddd['source']['id'];this['_executeShortcut'](_0x5ebb61);});}['_removeShortcuts'](){const _0x5b0550=this['context']['plugins']['get'](ro);_0x5b0550['hasFeedItem'](To)&&_0x5b0550['removeFeedItem'](To),this['_shortcutsView']?.['destroy']();}['_executeShortcut'](_0x19e5b5){const _0xb81dd2=this['_shortcuts']['find'](_0x5ec834=>_0x5ec834['id']===_0x19e5b5),_0x396690=_0xb81dd2['type'];'chat'===_0x396690?this['_runChatShortcut'](_0xb81dd2):'review'===_0x396690?_0xb81dd2['commandId']?this['_runReviewShortcut'](_0xb81dd2):this['_switchTab']('reviewMode'):'translate'===_0x396690&&(_0xb81dd2['language']?this['_runTranslateShortcut'](_0xb81dd2):this['_switchTab']('translate'));}['_switchTab'](_0x52b852){if(!this['context']['plugins']['has']('AITabs'))throw new at('ai-chat-shortcuts-ai-tabs-not-found',this['context'],{'tabName':_0x52b852});this['context']['plugins']['get']('AITabs')['view']['activateTab'](_0x52b852);}async['_runChatShortcut']({prompt:_0x14b012,draftMode:_0x33640e,useWebSearch:_0x1ba33e=!0x1,useReasoning:_0x2b6050=!0x1,model:_0x4da027}){const _0x5743b=this['context']['plugins']['get']('AIChatController'),_0x3ae463=_0x5743b['activeConversation'];let _0x4e1307;_0x4e1307=_0x4da027?await _0x3ae463['chatModels']['getModel'](_0x4da027):await _0x3ae463['chatModels']['getDefault'](),_0x4e1307&&await _0x3ae463['setModel'](_0x4e1307),_0x3ae463['setWebSearch'](_0x1ba33e),_0x3ae463['setReasoning'](_0x2b6050),_0x5743b['addCurrentDocumentToChatContext'](),_0x33640e?(this['_aiChatUI']['setPromptInputValue'](_0x14b012),this['_aiChatUI']['focusPromptInput'](!0x0)):_0x5743b['sendMessage']({'message':_0x14b012});}['_runReviewShortcut']({commandId:_0x498d5d,model:_0x3da7a6,prompt:_0x13038f,params:_0x46ff58}){if(!this['context']['plugins']['has']('AIReviewModeUI'))throw new at('ai-chat-shortcuts-review-mode-not-found',this['context']);this['_switchTab']('reviewMode');const _0x5a809b={'id':_0x498d5d,'isCustom':'custom'===_0x498d5d};_0x3da7a6&&_0x13038f&&(_0x5a809b['args']={'model':_0x3da7a6,'prompt':_0x13038f}),_0x46ff58&&(_0x5a809b['params']=_0x46ff58),this['context']['plugins']['get']('AIReviewModeUI')['fire']('runReviewCheck',_0x5a809b);}['_runTranslateShortcut']({language:_0x48fc50}){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':_0x48fc50,'args':{'language':_0x48fc50}});}}class wo extends _0x229e40{constructor(_0x36f7b5){super(_0x36f7b5);const _0x4148d2=_0x36f7b5['plugins']['get']('AITabs')['view'];this['bind']('value')['to'](_0x4148d2,'isVisible'),this['isEnabled']=!0x0;}['execute'](){const _0x314ecd=this['editor']['plugins']['get']('AITabs')['view'];_0x314ecd['isVisible']=!_0x314ecd['isVisible'];}}class fo extends _0x17e8c8{static get['requires'](){return[os];}static get['pluginName'](){return'AIToggleButtonUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const _0x551501=this['editor'];_0x551501['commands']['add']('toggleAi',new wo(_0x551501)),_0x551501['ui']['componentFactory']['add']('toggleAi',()=>{const _0x206650=this['_createAIUIButton'](Nt);return _0x206650['set']({'tooltip':!0x0,'class':'ck-ai-toggle-button'}),_0x206650;}),_0x551501['ui']['componentFactory']['add']('menuBar:toggleAi',()=>{const _0x2e9050=this['_createAIUIButton'](Wt);return _0x2e9050['set']({'role':'menuitemcheckbox'}),_0x2e9050;});}['_createAIUIButton'](_0x2ae2c1){const _0x1a9b41=this['editor'],_0x2d5680=_0x1a9b41['commands']['get']('toggleAi'),_0x13b440=new _0x2ae2c1(_0x1a9b41['locale']);return _0x13b440['set']({'label':hs(_0x1a9b41['locale'],'AI_TOGGLE_BUTTON_LABEL'),'icon':_0x4cdcb9,'isToggleable':!0x0}),_0x13b440['bind']('isEnabled')['to'](_0x2d5680),_0x13b440['bind']('isOn')['to'](_0x2d5680,'value',_0x18ee64=>!!_0x18ee64),this['listenTo'](_0x13b440,'execute',()=>{_0x2d5680['execute']();}),_0x13b440;}}const bo=['applySuggestion','insertSuggestion','showNext','showPrevious'];class So extends vt{['_errorView'];constructor(_0x2ff746){super(_0x2ff746),this['set']('_errorMessage',''),this['set']('_isErrorVisible',!0x1);}['showBlockingError'](_0x4ada59){this['showError'](_0x4ada59);}['showError'](_0x12883d){this['_errorView']||(this['_errorView']=this['_createErrorView']()),this['_errorMessage']=_0x12883d,this['_isErrorVisible']=!0x0;}['hideError'](){this['_isErrorVisible']=!0x1;}['_createErrorView'](){const _0x4ae2f2=new vt(this['locale']),_0x5a6ae5=new vt(this['locale']);return _0x5a6ae5['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai-suggestion__error-text']},'children':[{'text':this['bindTemplate']['to']('_errorMessage')}]}),_0x4ae2f2['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__error','ck-ai-balloon-error',this['bindTemplate']['if']('_isErrorVisible','ck-hidden',_0x14c9ea=>!_0x14c9ea)]},'children':[_0x5a6ae5]}),_0x4ae2f2;}}const Ro=0xa;class Oo extends _0x1c4723{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'](_0x34b577){const {id:_0x1e3647}=this['_currentConfig']??{};this['_currentConfig']=_0x34b577;const {id:_0x246de3}=this['_currentConfig'];this['isOpen']&&_0x1e3647===_0x246de3?this['_updateDialog']():this['_showDialog']();}['close'](){const _0x343c1a=this['_getTargetEditor']()['plugins']['get']('Dialog');_0x343c1a['isOpen']&&this['_currentConfig']&&_0x343c1a['id']===this['_currentConfig']['id']&&_0x343c1a['hide']();}['_updateDialog'](){const _0x369e30=this['_getTargetEditor']()['plugins']['get']('Dialog'),{icon:_0x58907c,title:_0x35e018}=this['_currentConfig'];_0x369e30['view']?.['headerView']&&(_0x369e30['view']['headerView']['label']=_0x35e018,_0x369e30['view']['headerView']['iconView']&&_0x58907c&&(_0x369e30['view']['headerView']['iconView']['content']=_0x58907c)),this['_isUpdatingMarkers']=!0x0,this['_showFakeVisualSelection'](),this['_isUpdatingMarkers']=!0x1,_0x369e30['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 _0x34edce=this['_getTargetEditor']()['plugins']['get']('Dialog'),{id:_0x521e53,title:_0x5c1d5d,icon:_0xe7f6e3,class:_0x49c8fd,mainView:_0x219771}=this['_currentConfig'];_0x219771['delegate'](...bo)['to'](this),_0x34edce['show']({'title':_0x5c1d5d,'icon':_0xe7f6e3,'hasCloseButton':!0x0,'id':_0x521e53,'position':this['_calculateDialogPosition']['bind'](this),'className':'ck-ai-balloon\x20'+(_0x49c8fd||''),'content':_0x219771,'onShow':_0x333d08=>{this['_showFakeVisualSelection'](),this['_setupFakeVisualSelectionMarkerRemovalListener'](),_0x333d08['view']?.['updatePosition']();const _0x1a1853=this['_getSelectionElements']();_0x1a1853&&_0x1a1853[0x0]&&Ct({'target':_0x1a1853[0x0],'ancestorOffset':0x14,'alignToTop':!0x0,'viewportOffset':{'top':0x14,'bottom':0x14,'left':0x0,'right':0x0}}),this['isOpen']=!0x0,_0x333d08['once']('hide',()=>{this['fire']('beforeDialogClosed',{'id':_0x521e53});},{'priority':'high'});},'onHide':()=>{this['_hideFakeVisualSelection'](),this['_cleanupFakeVisualSelectionMarkerRemovalListener'](),this['fire']('dialogClosed',{'id':_0x521e53}),this['isOpen']=!0x1;}});}['_calculateDialogPosition'](_0x20505d,_0x12c875){if(!_0x12c875){const _0x2c2d21=this['_getTargetRootDomRect']();if(!_0x2c2d21)return null;_0x12c875=_0x2c2d21;}const _0x4359f9=this['_getSelectionElements']();if(!_0x4359f9||0x0===_0x4359f9['length'])return{'left':Math['round'](_0x12c875['left']+_0x12c875['width']/0x2-_0x20505d['width']/0x2),'top':Math['round'](_0x12c875['top']+_0x12c875['height']/0x2-_0x20505d['height']/0x2)};const _0x2aa227=Math['round'](_0x12c875['left']+_0x12c875['width']/0x2-_0x20505d['width']/0x2),_0x418cc3=_0x4359f9['map'](_0x23169f=>new ut(_0x23169f)),_0x2d5665=_0x20505d['height'];return{'left':_0x2aa227,'top':this['_calculateOptimalTopPosition'](_0x418cc3,_0x2d5665,_0x12c875)};}['_calculateOptimalTopPosition'](_0xd32580,_0x15bf60,_0x493665){const _0x33fa69=new ut(ct['window']),_0x2f9e60=_0xd32580['map'](_0x878cfd=>_0x878cfd['getVisible']())['filter'](_0x511ef1=>_0x511ef1),_0x5b8b3a=ut['getBoundingRect'](_0x2f9e60);if(!_0x5b8b3a)return Math['round'](_0x493665['top']+_0x493665['height']/0x2);const _0x4a8e00=_0x33fa69['getIntersection'](_0x5b8b3a);if(!_0x4a8e00)return Math['round'](_0x493665['top']+_0x493665['height']/0x2);const _0x52a64c=_0x493665['getVisible'](),_0x26826e=_0x52a64c&&_0x5b8b3a['height']>_0x52a64c['height'],_0x49ef1b=_0x4a8e00['top'],_0x21dcec=_0x4a8e00['bottom'];if(_0x26826e){const _0x213bd1=(_0x52a64c||_0x33fa69)['height']/0x2-_0x15bf60/0x2,_0x1f0d03=_0x49ef1b-Ro-_0x493665['top'],_0x5350d5=_0x493665['bottom']-_0x21dcec-Ro;return _0x1f0d03>=_0x15bf60?Math['max'](Ro,_0x49ef1b-_0x15bf60-Ro):_0x5350d5>=_0x15bf60?_0x21dcec+Ro:Math['max'](Ro,_0x213bd1);}const _0x13f8c5=_0x49ef1b-_0x15bf60,_0x2ed92f=_0x493665['bottom']-_0x21dcec-Ro,_0x2a3488=_0x49ef1b-Ro-_0x493665['top'];let _0xde7c20;if(_0x2ed92f>=_0x15bf60)_0xde7c20=_0x21dcec+Ro;else{if(_0x2a3488>=_0x15bf60)_0xde7c20=_0x13f8c5-Ro;else _0xde7c20=_0x49ef1b+_0x5b8b3a['height']/0x2-_0x15bf60/0x2;}return _0xde7c20;}['_setupFakeVisualSelectionMarkerRemovalListener'](){const _0x4e78fe=this['_getTargetEditor']();this['listenTo'](_0x4e78fe['model']['document'],'change',()=>{if(!this['_isUpdatingMarkers']){for(const {name:_0x467522,data:{newRange:_0x7214a0}}of _0x4e78fe['model']['document']['differ']['getChangedMarkers']())if(_0x467522['startsWith'](zs+':')&&(_0x7214a0&&(_0x7214a0['start']['isEqual'](_0x7214a0['end'])||'$graveyard'==_0x7214a0['root']['rootName'])||null==_0x7214a0)){const _0xb421c0=hs(this['context']['locale'],'AI_BALLOON_SELECTION_REMOVED_ERROR');this['_currentConfig']['mainView']['showBlockingError'](_0xb421c0),this['fire']('selectionRemoved');}}});}['_cleanupFakeVisualSelectionMarkerRemovalListener'](){const _0x3e929f=this['_getTargetEditor']();this['_currentConfig']['mainView']['hideError'](),this['stopListening'](_0x3e929f['model']['document']);}['_getSelectionElements'](){const _0x61dd44=this['_getTargetEditor']();return _0x37b592(_0x61dd44['editing'],[..._0x61dd44['model']['markers']['getMarkersGroup']('ai-selection'),..._0x61dd44['model']['markers']['getMarkersGroup']('ai-balloon-selection')]);}['_getTargetRootDomRect'](){const _0xecc535=this['_currentConfig']?.['ranges']?.[0x0]?.['root'];if(!_0xecc535)return null;const _0xe08662=this['_getTargetEditor'](),_0x549caf=_0xe08662['editing']['view']['document']['getRoot'](_0xecc535['rootName']);if(!_0x549caf)return null;const _0x1a8810=_0xe08662['editing']['view']['domConverter']['mapViewToDom'](_0x549caf);return _0x1a8810&&_0x1a8810 instanceof HTMLElement?new ut(_0x1a8810):null;}}class ko extends kt{['copyButton'];['likeButton'];['dislikeButton'];['showChangesButton'];['_config'];constructor(_0x370e11,_0x55881c={}){super(_0x370e11),this['set']('isEnabled',!0x0),this['set']('isShowChangesOn',!0x1),this['_config']={'showCopy':!0x1,'showLike':!0x1,'showDislike':!0x1,..._0x55881c};const _0x4a5512=!(this['_config']['showCopy']||this['_config']['showChanges']||this['_config']['showLike']||this['_config']['showDislike']||this['_config']['customView']?.['length']);this['class']=_0x4a5512?'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'](_0x6a0b98){this['showChangesButton']['isEnabled']=_0x6a0b98;}['_setupRatingButtons'](){this['likeButton']=new Nt(this['locale']),this['likeButton']['set']({'icon':_0xd8bed7,'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':_0xc7e22,'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':_0x25f1fc,'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 _0x42e2cb=new xt();_0x42e2cb['set']({'content':_0x474e29}),_0x42e2cb['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'](_0x42e2cb);}['_setupShowChangesButton'](){this['showChangesButton']=new Nt(this['locale']),this['showChangesButton']['set']({'icon':_0x212f7c,'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',_0x19e5d8=>_0x19e5d8?_0x468096:_0x212f7c),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(_0x2e8a14,_0x1f14ec){super(_0x2e8a14);const _0x10bb3d=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']=_0x1f14ec,this['nextButtonView']=this['_createNextButtonView'](),this['previousButtonView']=this['_createPreviousButtonView'](),this['_streamableContentView']=new In(_0x2e8a14),this['_partToolbarView']=new _n(_0x2e8a14,_0x1f14ec['availableActions']),this['_partToolbarView']['delegate']('applySuggestion','insertSuggestion','rejectSuggestion')['to'](this),this['_togglePartToolbarButtonsVisibility'](_0x1f14ec),this['_stateView']=new un(_0x2e8a14),this['_stateView']['isVisible']=!0x1,this['_miniToolbarView']=new ko(_0x2e8a14,{'showChanges':'full'}),this['_miniToolbarView']['bind']('isShowChangesOn')['to'](this,'showDiff'),this['_miniToolbarView']['on']('toggleShowChanges',()=>{this['fire']('toggleSuggestionDisplayMode');}),this['_toolbarContainerView']=new vo(_0x2e8a14,[this['_partToolbarView'],this['_stateView'],this['_miniToolbarView']]),this['children']=this['createCollection']([this['_streamableContentView'],this['_toolbarContainerView']]),this['on']('change:_state',(_0x39dc76,_0x57e211,_0x1d1368,_0x5086b2)=>{let _0x2139f6,_0x2b1440;'pending'===_0x5086b2?(_0x2139f6=this['_partToolbarView'],_0x2b1440=this['_stateView']):(_0x2139f6=this['_stateView'],_0x2b1440=this['_partToolbarView']),this['_stateView']['setState'](_0x1d1368),_0x2139f6['isVisible']=!0x1,_0x2b1440['isVisible']=!0x0;}),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat-balloon-main',_0x10bb3d['to']('_state',_0x47cfec=>'ck-ai-chat-balloon-main_state_'+_0x47cfec)]},'children':this['children']}),this['on']('change:isTrackChangesOn',()=>{this['_togglePartToolbarButtonsVisibility'](_0x1f14ec);});}['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'](_0x480ab9){_0x480ab9?.['keepErrors']||this['hideError'](),await this['_streamableContentView']['update'](_0x480ab9);}['setState'](_0x5e49e1){this['_state']=_0x5e49e1;}['showError'](_0x35662d){super['showError'](_0x35662d),this['children']['has'](this['_errorView'])||this['children']['add'](this['_errorView'],0x0);}['hideError'](){this['_isErrorVisible']&&(super['hideError'](),this['togglePartToolbarEnabled'](!0x0));}['showBlockingError'](_0x3a5ea7){super['showBlockingError'](_0x3a5ea7),this['togglePartToolbarEnabled'](!0x1);}['toggleRotatorButtonsVisibility'](_0x5779c9){this['nextButtonView']['isVisible']=this['previousButtonView']['isVisible']=_0x5779c9;}['togglePartToolbarEnabled'](_0x17abc3){this['_partToolbarView']['isEnabled']=_0x17abc3;}['_togglePartToolbarButtonsVisibility']({showApplyButton:_0x586011,showSuggestButton:_0x17e75d}){_0x586011=_0x586011&&!this['isTrackChangesOn']&&this['_config']['availableActions']['includes']('applySuggestion'),_0x17e75d=_0x17e75d&&this['_config']['availableActions']['includes']('insertSuggestion'),this['_partToolbarView']['setButtonsVisibility']({'showApplyButton':_0x586011,'showSuggestButton':_0x17e75d});}['_createNextButtonView'](){const _0x5585ab=new Nt(this['locale']);return _0x5585ab['set']({'icon':_0x2e1999,'label':hs(this['locale'],'AI_BALLOON_NEXT_LABEL'),'isVisible':!0x0}),_0x5585ab['on']('execute',()=>{this['fire']('showNext');}),_0x5585ab;}['_createPreviousButtonView'](){const _0x45ff8b=new Nt(this['locale']);return _0x45ff8b['set']({'icon':_0xa07a66,'label':hs(this['locale'],'AI_BALLOON_PREVIOUS_LABEL'),'isVisible':!0x0}),_0x45ff8b['on']('execute',()=>{this['fire']('showPrevious');}),_0x45ff8b;}}class vo extends vt{constructor(_0x2f0880,_0x17aa4b){super(_0x2f0880),this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-chat-balloon__toolbar-container']},'children':_0x17aa4b});}}class yo extends _0x17e8c8{static get['requires'](){return[Bt,Oo];}static get['pluginName'](){return'AIChatBalloon';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['_chatBalloonView'];constructor(_0x272585){super(_0x272585),this['set']('showDiff',!0x1);}['open'](_0x1d61ee){const _0x2d31eb=this['editor'];this['_chatBalloonView']||(this['_chatBalloonView']=this['_createChatBalloonView']()),_0x2d31eb['plugins']['get']('AIBalloon')['open']({..._0x1d61ee,'id':'aiChatBalloon','class':'ck-ai-chat-balloon','mainView':this['_chatBalloonView']}),this['_toggleRotatorButtonsInDialogHeader'](_0x1d61ee['showRotator']),this['_chatBalloonView']['togglePartToolbarEnabled'](!_0x1d61ee['areActionsDisabled']),this['_restoreDefaultViewFocus']();}['close'](){this['editor']['plugins']['get']('AIBalloon')['close']();}['updateContent'](_0x5d6940){return this['_chatBalloonView']||(this['_chatBalloonView']=this['_createChatBalloonView']()),this['_chatBalloonView']['updateContent'](_0x5d6940);}['setState'](_0xa9807f){this['_chatBalloonView']&&this['_chatBalloonView']['setState'](_0xa9807f);}['_createChatBalloonView'](){const _0x3e1d5f=this['editor'],_0x6f0f10=_0x3e1d5f['plugins']['get']('AIBalloon'),_0x59aaad=_0x3e1d5f['commands']['get']('trackChanges');let _0x19dac5=_0x3e1d5f['config']['get']('ai.availableReplyActions')||[...fn];_0x3e1d5f['plugins']['has']('TrackChanges')||(_0x19dac5=_0x19dac5['filter'](_0x48ee43=>'insertSuggestion'!=_0x48ee43));const _0x56f42d=new No(_0x3e1d5f['locale'],{'availableActions':_0x19dac5,'showApplyButton':!0x0,'showSuggestButton':!!_0x59aaad});return _0x56f42d['bind']('showDiff')['to'](this),_0x56f42d['delegate'](...Zs)['to'](this),_0x56f42d['delegate']('showPrevious','showNext')['to'](this),_0x6f0f10['delegate']('dialogClosed')['to'](this),_0x56f42d['on']('applySuggestion',this['_restoreDefaultViewFocus']['bind'](this)),_0x56f42d['on']('insertSuggestion',this['_restoreDefaultViewFocus']['bind'](this)),_0x56f42d['on']('rejectSuggestion',this['_restoreDefaultViewFocus']['bind'](this)),_0x59aaad&&_0x56f42d['bind']('isTrackChangesOn')['to'](_0x59aaad,'value'),_0x56f42d['render'](),_0x56f42d;}['_toggleRotatorButtonsInDialogHeader'](_0x392b5c){const _0x2e7c52=this['editor'],_0x4d1807=_0x2e7c52['plugins']['get']('Dialog')['view']['headerView']['children'];this['_chatBalloonView']['toggleRotatorButtonsVisibility'](_0x392b5c),_0x4d1807['has'](this['_chatBalloonView']['previousButtonView'])||(_0x4d1807['addMany']([this['_chatBalloonView']['previousButtonView'],this['_chatBalloonView']['nextButtonView']],0x0),_0x2e7c52['plugins']['get']('AIBalloon')['once']('beforeDialogClosed',()=>{_0x4d1807['remove'](this['_chatBalloonView']['previousButtonView']),_0x4d1807['remove'](this['_chatBalloonView']['nextButtonView']);}));}['_restoreDefaultViewFocus'](){this['_chatBalloonView']['focus']();}}class xo extends _0x17e8c8{static get['requires'](){return[fo,yo,_0x21c71d];}static get['pluginName'](){return'AIEditorIntegration';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}function Lo(_0x3b6082){const {editor:_0x28478a,action:_0xb61bdd,withText:_0x204991=!0x1,withIcon:_0x3bcb12=!0x0,isInDropdown:_0x346f2f=!0x0,shouldPreventFocus:_0x48c052=!0x1}=_0x3b6082;return()=>{const _0x28e87a=_0x28478a['locale'],_0xa9be39=new Nt(_0x28e87a),_0x2738ea=_0xa9be39['bindTemplate'];_0x346f2f&&_0xa9be39['extendTemplate']({'on':{'mouseenter':_0x2738ea['to'](()=>{_0x48c052&&_0x48c052()||_0xa9be39['focus']();})}});const _0x15a082=_0xb61bdd['icon']??_0xb61bdd['parent']?.['icon'];return _0xa9be39['set']({'label':_0xb61bdd['label'],'withText':_0x204991,'role':'menuitem','icon':_0x3bcb12?_0x15a082??_0x47c1b9:void 0x0,'tooltip':!_0x204991,'class':'ck-ai-quick-actions-button','isEnabled':_0xb61bdd['isEnabled']}),_0xa9be39['on']('execute',()=>{_0x28478a['editing']['view']['focus'](),_0x28478a['commands']['execute']('aiQuickAction',_0xb61bdd);}),_0xa9be39;};}class Do extends _0xf87456{['arrowView'];constructor(_0x1f5421,_0x172270){super(_0x1f5421,_0x172270);const _0xc116cc=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',_0x545f10=>String(_0x545f10)),'data-cke-tooltip-disabled':_0xc116cc['to']('isOn')},'on':{'mouseenter':_0xc116cc['to']('mouseenter')}});}['render'](){super['render'](),this['children']['add'](this['arrowView']);}['_createArrowView'](){const _0x196fcc=new xt();return _0x196fcc['content']=_0x13161c,_0x196fcc['extendTemplate']({'attributes':{'class':'ck-dropdown-menu-list__nested-menu__button__arrow'}}),_0x196fcc;}}class Po extends Dt{['_allListItems'];['_allSearchableItems'];constructor(_0x42179e,_0x414a5,_0x4ca2f5){super(_0x42179e),this['_allListItems']=_0x414a5,this['_allSearchableItems']=_0x4ca2f5;}['filter'](_0x2fc84e){if(!_0x2fc84e)return this['items']['clear'](),this['items']['addMany'](this['_allListItems']),this['_clearHighlight'](),{'resultsCount':this['_allListItems']['length'],'totalItemsCount':this['_allListItems']['length']};const _0x458b43=_0x2fc84e['source']['toLowerCase']()['trim'](),_0x48d31b=this['_allSearchableItems']['filter'](_0x38a502=>(_0x38a502['groupLabel']?_0x38a502['label']+'\x20('+_0x38a502['groupLabel']+')':_0x38a502['label'])['toLowerCase']()['includes'](_0x458b43));return this['items']['clear'](),this['items']['addMany'](_0x48d31b['sort']((_0x4eb93b,_0x1e9688)=>{const _0x115acb=_0x4eb93b['groupLabel'],_0x5b711a=_0x1e9688['groupLabel'];return _0x115acb||_0x5b711a?_0x115acb?0x1:-0x1:0x0;})['map'](_0xcd6269=>_0xcd6269['item'])),this['_highlightQuery'](_0x458b43,_0x48d31b),{'resultsCount':_0x48d31b['length'],'totalItemsCount':this['_allSearchableItems']['length']};}['_highlightQuery'](_0x482c64,_0x59e403){if(!_0x482c64)return;const _0x505b33=new RegExp(_0x3a047e(_0x482c64),'gi');_0x59e403['forEach'](_0x4e8312=>{_0x4e8312['highlightViews']&&_0x4e8312['highlightViews']['forEach'](_0x285d2a=>{'function'==typeof _0x285d2a['highlightText']&&_0x285d2a['highlightText'](_0x505b33);});});}['_clearHighlight'](){this['_allSearchableItems']['forEach'](_0xe88f4=>{_0xe88f4['highlightViews']&&_0xe88f4['highlightViews']['forEach'](_0x3ed57d=>{'function'==typeof _0x3ed57d['highlightText']&&_0x3ed57d['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(_0xda707c,_0x205397,_0x3319f9,_0x2f490a,_0x559aec=!0x1){const _0x4bbe3f=_0xda707c['locale'];super(_0x4bbe3f),this['_bodyCollection']=_0x2f490a,this['_hasSearch']=_0x559aec;const _0x294fe0=this['_createListItems'](_0xda707c,_0x205397,_0x3319f9);this['optionsListView']=new Po(_0x4bbe3f,_0x294fe0,this['_allSearchableItems']),this['optionsListView']['role']=Ho,this['optionsListView']['items']['addMany'](_0x294fe0),this['focusTracker']=new _t(),this['keystrokes']=new gt(),_0x559aec&&(this['_searchTextView']=this['_createSearchTextView']()),this['_focusables']=_0x294fe0,this['focusCycler']=new Ut({'focusables':this['_focusables'],'focusTracker':this['focusTracker'],'keystrokeHandler':this['keystrokes']}),_0x559aec&&this['_searchTextView']&&this['focusCycler']['chain'](this['_searchTextView']['focusCycler']);const _0x527e25=_0x559aec&&this['_searchTextView']?[this['_searchTextView']]:[this['optionsListView']];this['children']=new _0x473e27(_0x527e25),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset_all','ck-ai-quick-actions','ck-rounded-corners'],'dir':_0x4bbe3f['uiLanguageDirection']},'children':this['children']});}['_createSearchTextView'](){return new _0x48eb62(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 _0x694586=this['_searchTextView']['queryView']['fieldView']['element']['ownerDocument']?.['activeElement'];return this['_searchTextView']['queryView']['fieldView']['element']['contains'](_0x694586);}['_createListItems'](_0x477f04,_0x1884d3,_0x6eb4ed){const _0x22448e=new _0x473e27();return _0x1884d3['forEach'](_0x2e761b=>{if('actions'in _0x2e761b){const {listItem:_0x4b64e8}=this['_createActionGroupButton'](_0x477f04,_0x2e761b,_0x6eb4ed);_0x22448e['add'](_0x4b64e8),_0x2e761b['actions']['forEach'](_0x28c02f=>{this['_createActionButton'](_0x477f04,_0x28c02f,_0x2e761b['label'],_0x2e761b['icon']);const {listItem:_0x26c586,highlightViews:_0x1bd33e}=this['_createSearchResultActionButton'](_0x477f04,_0x28c02f,_0x2e761b['label'],_0x2e761b['icon']);this['_allSearchableItems']['push']({'item':_0x26c586,'label':_0x28c02f['label'],'groupLabel':_0x2e761b['label'],'highlightViews':_0x1bd33e});});}else{const {listItem:_0x3e6343}=this['_createActionButton'](_0x477f04,_0x2e761b);_0x22448e['add'](_0x3e6343);const _0x36cf74=_0x3e6343['children']['first'];if(_0x36cf74){const {listItem:_0x1911f9,highlightViews:_0x9d5ff5}=this['_createSearchResultActionButton'](_0x477f04,_0x2e761b);this['_allSearchableItems']['push']({'item':_0x1911f9,'label':_0x36cf74['label']||'','highlightViews':_0x9d5ff5});}}}),_0x22448e;}['_createActionButton'](_0x31c57c,_0x4bcaab,_0x21685b,_0x1caada){const _0x2c5d1b=new Ht(this['locale']);if(_0x21685b&&_0x1caada){const _0x4e8263=new Nt(this['locale']),_0x42eb16=_0x4e8263['bindTemplate'],_0x84886c=new _0x2ff97f();_0x84886c['text']=_0x4bcaab['label'];const _0x4391bc=new _0x2ff97f();_0x4391bc['text']=_0x21685b;const _0x1e38de=new xt();_0x1e38de['content']=_0x1caada,_0x1e38de['extendTemplate']({'attributes':{'class':'ck-ai-quick-actions-button__group-icon'}});const _0x230385=new vt(this['locale']);_0x230385['setTemplate']({'tag':'span','attributes':{'class':'ck-ai-quick-actions-button_with-group__open-paren'},'children':[{'text':'\x20('}]});const _0x131ec1=new vt(this['locale']);return _0x131ec1['setTemplate']({'tag':'span','attributes':{'class':'ck-ai-quick-actions-button_with-group__close-paren'},'children':[{'text':')'}]}),_0x4e8263['set']({'label':_0x4bcaab['label']+'\x20('+_0x21685b+')','withText':!0x0,'role':'menuitem','class':'ck-ai-quick-actions-button\x20ck-ai-quick-actions-button_with-group','tooltip':!0x1}),_0x4e8263['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':[_0x84886c,_0x230385,_0x1e38de,_0x4391bc,_0x131ec1],'on':{'mouseenter':_0x42eb16['to'](()=>{this['_isSearchFocused']()||_0x4e8263['focus']();}),'click':_0x42eb16['to'](()=>{_0x4e8263['fire']('execute');})}}),_0x4e8263['on']('execute',()=>{_0x31c57c['editing']['view']['focus'](),_0x31c57c['commands']['execute']('aiQuickAction',_0x4bcaab);}),_0x2c5d1b['children']['add'](_0x4e8263),{'listItem':_0x2c5d1b,'highlightViews':[_0x84886c,_0x4391bc]};}{const _0x3551f3=new _0x3575d8(),_0xb02811=new Nt(this['locale'],_0x3551f3),_0x5c12aa=_0xb02811['bindTemplate'],_0x30aeca=_0x4bcaab['icon']??_0x4bcaab['parent']?.['icon'],_0x254e6e=void 0x0!==_0x4bcaab['icon'];return _0xb02811['set']({'label':_0x4bcaab['label'],'withText':!0x0,'role':'menuitem','icon':_0x254e6e?_0x30aeca??_0x47c1b9:void 0x0,'tooltip':!0x1,'class':'ck-ai-quick-actions-button'}),_0xb02811['extendTemplate']({'on':{'mouseenter':_0x5c12aa['to'](()=>{this['_isSearchFocused']()||_0xb02811['focus']();})}}),_0xb02811['on']('execute',()=>{_0x31c57c['editing']['view']['focus'](),_0x31c57c['commands']['execute']('aiQuickAction',_0x4bcaab);}),_0x2c5d1b['children']['add'](_0xb02811),{'listItem':_0x2c5d1b,'highlightViews':[_0x3551f3]};}}['_createSearchResultActionButton'](_0x5a8e18,_0x512f96,_0x2c2101,_0x271232){return _0x2c2101&&_0x271232?this['_createSearchResultGroupedActionButton'](_0x5a8e18,_0x512f96,_0x2c2101,_0x271232):this['_createSearchResultIndividualActionButton'](_0x5a8e18,_0x512f96);}['_createSearchResultGroupedActionButton'](_0x27b0ae,_0x434025,_0x3bfd1b,_0x416a05){const _0x559e92=new Ht(this['locale']),_0x120299=new Nt(this['locale']),_0xc9ba74=_0x120299['bindTemplate'],{view:_0x3d4ec1,highlightView:_0x2cfb6c}=this['_createSearchResultGroupRow'](_0x3bfd1b,_0x416a05),{view:_0x11fb65,highlightView:_0x585960}=this['_createSearchResultActionRow'](_0x434025['label']),_0x1c4da4=this['_createSearchResultContentView'](_0x3d4ec1,_0x11fb65);return _0x120299['set']({'label':_0x434025['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}),_0x120299['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':[_0x1c4da4],'on':{'mouseenter':_0xc9ba74['to'](()=>{this['_isSearchFocused']()||_0x120299['focus']();}),'click':_0xc9ba74['to'](()=>{this['_handleSearchResultButtonClick'](_0x120299);})}}),this['_setupActionButtonExecution'](_0x120299,_0x27b0ae,_0x434025),_0x559e92['children']['add'](_0x120299),{'listItem':_0x559e92,'highlightViews':[_0x2cfb6c,_0x585960]};}['_createSearchResultIndividualActionButton'](_0x43f948,_0x26dccd){const _0x4bc5d7=new Ht(this['locale']),_0x182bf5=new _0x3575d8(),_0x287522=new Nt(this['locale'],_0x182bf5),_0x148749=_0x287522['bindTemplate'];return _0x287522['set']({'label':_0x26dccd['label'],'withText':!0x0,'role':'menuitem','icon':void 0x0,'tooltip':!0x1,'class':'ck-ai-quick-actions-button\x20ck-ai-quick-actions-search-result-button'}),_0x287522['extendTemplate']({'on':{'mouseenter':_0x148749['to'](()=>{this['_isSearchFocused']()||_0x287522['focus']();})}}),this['_setupActionButtonExecution'](_0x287522,_0x43f948,_0x26dccd),_0x4bc5d7['children']['add'](_0x287522),{'listItem':_0x4bc5d7,'highlightViews':[_0x182bf5]};}['_createSearchResultGroupRow'](_0x57c4ce,_0x369dee){const _0x5c1896=new vt(this['locale']),_0x34737a=new xt();_0x34737a['content']=_0x369dee,_0x34737a['extendTemplate']({'attributes':{'class':'ck-ai-quick-actions-button__group-icon'}});const _0x52dcc1=new _0x2ff97f();return _0x52dcc1['text']=_0x57c4ce,_0x5c1896['setTemplate']({'tag':'div','attributes':{'class':'ck-ai-quick-actions-search-result__group-row'},'children':[_0x34737a,_0x52dcc1]}),{'view':_0x5c1896,'highlightView':_0x52dcc1};}['_createSearchResultActionRow'](_0x299db){const _0x3ed42e=new vt(this['locale']),_0x4b07af=new _0x2ff97f();return _0x4b07af['text']=_0x299db,_0x3ed42e['setTemplate']({'tag':'div','attributes':{'class':'ck-ai-quick-actions-search-result__action-row'},'children':[_0x4b07af]}),{'view':_0x3ed42e,'highlightView':_0x4b07af};}['_createSearchResultContentView'](_0x21ea1f,_0x5da273){const _0x46834b=new vt(this['locale']);return _0x46834b['setTemplate']({'tag':'div','attributes':{'class':'ck-ai-quick-actions-search-result__content'},'children':[_0x21ea1f,_0x5da273]}),_0x46834b;}['_setupActionButtonExecution'](_0x1c4643,_0x171f56,_0x544aaf){_0x1c4643['on']('execute',()=>{_0x171f56['editing']['view']['focus'](),_0x171f56['commands']['execute']('aiQuickAction',_0x544aaf);});}['_createActionGroupButton'](_0x3e2c8f,_0x1e743d,_0x5ac40){const _0x5c469b=new Ht(this['locale']),_0x5d4013=new _0x3575d8(),_0x161f7b=new Do(this['locale'],_0x5d4013),_0x443649=_0x161f7b['bindTemplate'],_0x30a15c=this['_getPanelKeystroke'](_0x5ac40),_0x366d1d=this['_createGroupActionsList'](_0x3e2c8f,_0x1e743d['actions'],_0x5ac40);_0x161f7b['set']({'label':_0x1e743d['label'],'withText':!0x0,'role':Mo,'icon':_0x1e743d['icon']??_0x47c1b9,'isEnabled':_0x1e743d['actions']['some'](_0x9984ca=>_0x9984ca['isEnabled'])}),_0x161f7b['extendTemplate']({'on':{'mouseenter':_0x443649['to'](()=>{this['_isSearchFocused']()||_0x161f7b['focus']();})}});const _0x5b0320=new Xt(this['locale']);return _0x5b0320['extendTemplate']({'attributes':{'class':['ck','ck-reset_all','ck-ai-quick-actions-group-panel','ck-dropdown-menu__nested-menu__panel']},'on':{'keydown':_0x443649['to'](_0x59c81c=>{this['_handlePanelKeydown'](_0x59c81c,_0x30a15c,_0x161f7b,_0x5b0320);})}}),_0x161f7b['bind']('isOn')['to'](_0x5b0320,'isVisible'),this['_bodyCollection']['add'](_0x5b0320),_0x5b0320['content']['add'](_0x366d1d),this['_setupGroupMenuBehavior'](_0x161f7b,_0x5b0320),_0x5c469b['children']['add'](_0x161f7b),{'listItem':_0x5c469b,'highlightView':_0x5d4013};}['_createGroupActionsList'](_0x3d67e7,_0x536036,_0x294a09){const _0x43a119=new Dt(this['locale']);return _0x43a119['extendTemplate']({'attributes':{'class':['ck','ck-reset_all','ck-ai-quick-actions-group-list','ck-dropdown-menu-list']}}),_0x536036['forEach'](_0x5deb14=>{const _0x257aa1=new Ht(this['locale']),_0x2c5b78=Lo({'editor':_0x3d67e7,'action':_0x5deb14,'withText':!0x0,'withIcon':!0x1,'isInDropdown':!0x0,'shouldPreventFocus':()=>this['_isSearchFocused']()})();_0x257aa1['children']['add'](_0x2c5b78),_0x294a09['focusTracker']['add'](_0x2c5b78),_0x43a119['items']['add'](_0x257aa1);}),_0x43a119;}['_setupGroupMenuBehavior'](_0xf99d3e,_0x56cc9f){const _0x1624c8=_0xf99d3e['bindTemplate'],_0x403d3d=this['_getButtonKeystroke'](_0xf99d3e);_0xf99d3e['extendTemplate']({'attributes':{'class':['ck-ai-quick-actions-group-button']},'on':{'mouseenter':_0x1624c8['to'](()=>{this['_showNestedPanel'](_0x56cc9f,_0xf99d3e);}),'mouseleave':_0x1624c8['to'](_0x33d0aa=>{const _0x2738cf=_0x33d0aa['relatedTarget'];this['_isMovingToNestedMenu'](_0x2738cf,_0x56cc9f)||this['_hideNestedPanel'](_0x56cc9f);}),'keydown':_0x1624c8['to'](_0x4537a7=>{_0x4537a7['key']==_0x403d3d&&(this['_showNestedPanel'](_0x56cc9f,_0xf99d3e),_0x56cc9f['content']['get'](0x0)['focus']());})}}),_0x56cc9f['on']('render',()=>{_0x56cc9f['element']?.['addEventListener']('mouseleave',_0x3db07f=>{const _0x3e2aea=_0x3db07f['relatedTarget'];_0xf99d3e['element']?.['contains'](_0x3e2aea)||this['_isMovingToNestedMenu'](_0x3e2aea,_0x56cc9f)||this['_hideNestedPanel'](_0x56cc9f);});});}['_showNestedPanel'](_0x59609e,_0x3a1d9f){this['_openNestedPanels']['forEach'](_0x465c64=>{_0x465c64!==_0x59609e&&_0x465c64['isVisible']&&_0x465c64['hide']();}),_0x59609e['show'](),_0x59609e['pin']({'positions':[_0x59c279['eastSouth']],'target':_0x3a1d9f['element'],'fitInViewport':!0x0}),this['_openNestedPanels']['add'](_0x59609e);}['_hideNestedPanel'](_0x125c5a){_0x125c5a['hide'](),this['_openNestedPanels']['delete'](_0x125c5a);}['_hideAllNestedPanels'](){this['_openNestedPanels']['forEach'](_0x26b286=>_0x26b286['hide']()),this['_openNestedPanels']['clear']();}['_isMovingToNestedMenu'](_0x3f346a,_0x49bc0b){if(!_0x3f346a)return!0x1;if(_0x49bc0b['element']?.['contains'](_0x3f346a))return!0x0;const _0x11151e=_0x3f346a;return _0x11151e['closest']&&(null!==_0x11151e['closest']('.ck-ai-quick-actions-group-panel')||null!==_0x11151e['closest']('.ck-ai-quick-actions-group-list')||null!==_0x11151e['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'](_0x3271b7){return'rtl'===_0x3271b7['locale']['uiLanguageDirection']?'ArrowRight':'ArrowLeft';}['_getButtonKeystroke'](_0x5eae07){return'rtl'===_0x5eae07['locale']['uiLanguageDirection']?'ArrowLeft':'ArrowRight';}['_handlePanelKeydown'](_0x2b3875,_0x2d22cf,_0x3017eb,_0x34157c){_0x2b3875['key']==_0x2d22cf&&(_0x3017eb['focus'](),this['_hideNestedPanel'](_0x34157c));}['_handleSearchResultButtonClick'](_0x28db48){_0x28db48['fire']('execute');}}function Vo(_0x12f2bb){const {editor:_0x288942,content:_0x2dbfc9,buttonDefinition:_0x5335b9,bodyCollection:_0x146604,hasSearch:_0x3568e6=!0x1}=_0x12f2bb;return()=>{const _0x50324f=_0x288942['locale'],_0x1c4fda=_0x288942['commands']['get']('aiQuickAction'),_0xb7ce16=Gt(_0x50324f);_0xb7ce16['bind']('isEnabled')['to'](_0x1c4fda),_0xb7ce16['buttonView']['set']({'icon':_0x5335b9['icon']??_0x47c1b9,'label':_0x5335b9['label'],'tooltip':!0x0}),_0xb7ce16['set']({'class':'ck-ai-quick-actions-dropdown'});const _0x424660=new Uo(_0x288942,_0x2dbfc9,_0xb7ce16,_0x146604,_0x3568e6);return _0xb7ce16['panelView']['children']['add'](_0x424660),_0x3568e6&&_0xb7ce16['on']('change:isOpen',(_0x5af7e,_0x4bf575,_0x256619)=>{if(_0x256619){if(_0x288942['plugins']['has']('AIEditing')){const _0x1be06f=_0x288942['plugins']['get'](Js),_0x19271a=_0x288942['model']['document']['selection'],_0x3096bf=Array['from'](_0x19271a['getRanges']());_0x3096bf['length']>0x0&&_0x1be06f['showFakeVisualSelection']({'ranges':_0x3096bf,'id':'quick-action','priority':0x14});}}else _0x288942['plugins']['has']('AIEditing')&&_0x288942['plugins']['get'](Js)['hideFakeVisualSelection']('quick-action'),_0x424660['resetSearch']();}),_0xb7ce16;};}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 _0x17e8c8{static get['requires'](){return[_0x350068,as];}static get['pluginName'](){return'AIQuickActionsUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}async['init'](){const _0x532a60=await this['_getDefaultAndCustomActions']();this['_prepareQuickActionsDefinition'](_0x532a60),this['_initializeQuickActionsComponentsAndCommands']();}static['getDefaultQuickActions'](_0x9e1d15){return function(_0x83f81c){const _0x57d51d=new Intl['DisplayNames'](['en'],{'type':'language'})['of'](_0x83f81c['uiLanguage']),_0x79d6c5=_0x57d51d||'English',_0x953961=[{'id':'ask-ai','label':hs(_0x83f81c,'AI_QUICK_ACTIONS_ASK_AI'),'type':'chat','icon':_0x5ab5a8},{'id':'chat-commands','label':hs(_0x83f81c,'AI_QUICK_ACTIONS_CHAT_COMMANDS'),'icon':_0x5ab5a8,'actions':[{'id':'explain','label':hs(_0x83f81c,'AI_QUICK_ACTIONS_EXPLAIN'),'displayedPrompt':hs(_0x83f81c,'AI_QUICK_ACTIONS_EXPLAIN'),'prompt':Bo['replace']('%0',_0x79d6c5),'type':'chat'},{'id':'summarize','label':hs(_0x83f81c,'AI_QUICK_ACTIONS_SUMMARIZE'),'displayedPrompt':hs(_0x83f81c,'AI_QUICK_ACTIONS_SUMMARIZE'),'prompt':Go['replace']('%0',_0x79d6c5),'type':'chat'},{'id':'highlight-key-points','label':hs(_0x83f81c,'AI_QUICK_ACTIONS_HIGHLIGHT_KEY_POINTS'),'displayedPrompt':hs(_0x83f81c,'AI_QUICK_ACTIONS_HIGHLIGHT_KEY_POINTS'),'prompt':Fo['replace']('%0',_0x79d6c5),'type':'chat'}]},{'id':'improve-writing','label':hs(_0x83f81c,'AI_QUICK_ACTIONS_IMPROVE_WRITING'),'type':'action','icon':_0xff2ef9},{'id':'continue','label':hs(_0x83f81c,'AI_QUICK_ACTIONS_CONTINUE_WRITING'),'type':'action','icon':_0x20ab6e},{'id':'fix-grammar','label':hs(_0x83f81c,'AI_QUICK_ACTIONS_FIX_GRAMMAR_SPELLING'),'type':'action','icon':_0x5e42a9},{'id':'adjust-length','label':hs(_0x83f81c,'AI_QUICK_ACTIONS_ADJUST_LENGTH'),'icon':_0x37fb85,'actions':[{'id':'make-shorter','label':hs(_0x83f81c,'AI_QUICK_ACTIONS_MAKE_SHORTER'),'type':'action'},{'id':'make-longer','label':hs(_0x83f81c,'AI_QUICK_ACTIONS_MAKE_LONGER'),'type':'action'}]},{'id':'change-tone','label':hs(_0x83f81c,'AI_QUICK_ACTIONS_CHANGE_TONE'),'icon':_0xe015ab,'actions':[{'id':'make-tone-casual','label':hs(_0x83f81c,'AI_QUICK_ACTIONS_MORE_CASUAL'),'type':'action'},{'id':'make-tone-direct','label':hs(_0x83f81c,'AI_QUICK_ACTIONS_MORE_DIRECT'),'type':'action'},{'id':'make-tone-friendly','label':hs(_0x83f81c,'AI_QUICK_ACTIONS_MORE_FRIENDLY'),'type':'action'},{'id':'make-tone-confident','label':hs(_0x83f81c,'AI_QUICK_ACTIONS_MORE_CONFIDENT'),'type':'action'},{'id':'make-tone-professional','label':hs(_0x83f81c,'AI_QUICK_ACTIONS_MORE_PROFESSIONAL'),'type':'action'}]},{'id':'translate','label':hs(_0x83f81c,'AI_QUICK_ACTIONS_TRANSLATE'),'icon':_0xe821c5,'actions':[{'id':'translate-to-english','label':hs(_0x83f81c,'AI_QUICK_ACTIONS_TRANSLATE_ENGLISH'),'type':'action','actionName':'translate','args':{'language':'english'}},{'id':'translate-to-chinese','label':hs(_0x83f81c,'AI_QUICK_ACTIONS_TRANSLATE_CHINESE'),'type':'action','actionName':'translate','args':{'language':'chinese'}},{'id':'translate-to-spanish','label':hs(_0x83f81c,'AI_QUICK_ACTIONS_TRANSLATE_SPANISH'),'type':'action','actionName':'translate','args':{'language':'spanish'}},{'id':'translate-to-german','label':hs(_0x83f81c,'AI_QUICK_ACTIONS_TRANSLATE_GERMAN'),'type':'action','actionName':'translate','args':{'language':'german'}},{'id':'translate-to-french','label':hs(_0x83f81c,'AI_QUICK_ACTIONS_TRANSLATE_FRENCH'),'type':'action','actionName':'translate','args':{'language':'french'}},{'id':'translate-to-japanese','label':hs(_0x83f81c,'AI_QUICK_ACTIONS_TRANSLATE_JAPANESE'),'type':'action','actionName':'translate','args':{'language':'japanese'}},{'id':'translate-to-portuguese','label':hs(_0x83f81c,'AI_QUICK_ACTIONS_TRANSLATE_PORTUGUESE'),'type':'action','actionName':'translate','args':{'language':'portuguese'}},{'id':'translate-to-korean','label':hs(_0x83f81c,'AI_QUICK_ACTIONS_TRANSLATE_KOREAN'),'type':'action','actionName':'translate','args':{'language':'korean'}},{'id':'translate-to-italian','label':hs(_0x83f81c,'AI_QUICK_ACTIONS_TRANSLATE_ITALIAN'),'type':'action','actionName':'translate','args':{'language':'italian'}},{'id':'translate-to-russian','label':hs(_0x83f81c,'AI_QUICK_ACTIONS_TRANSLATE_RUSSIAN'),'type':'action','actionName':'translate','args':{'language':'russian'}}]},{'id':'other','label':hs(_0x83f81c,'AI_QUICK_ACTIONS_OTHER'),'icon':_0x4195c4,'actions':[]}];return _0x953961;}(_0x9e1d15);}async['_getDefaultAndCustomActions'](){const _0xe1485d=Wo['getDefaultQuickActions'](this['editor']['locale']),_0x4a8604=this['editor']['config']['get']('ai.quickActions.extraCommands')||[];let _0x2354f0,_0x7c241f=[];try{const _0x1462fe=new Fs({'connector':this['editor']['plugins']['get']('AIConnector'),'config':this['editor']['config']['get']('ai.models'),'locale':this['editor']['locale']});_0x7c241f=await _0x1462fe['getAll'](),_0x2354f0=(await _0x1462fe['getDefault']())?.['id'];}catch(_0x2aae8e){const _0x54137b=new at('ai-quick-actions-models-unable-to-retrieve',this,{'error':_0x2aae8e});Et(_0x54137b['message']);}finally{const _0x4e4dd6=_0x4a8604['map'](_0x27fab3=>({..._0x27fab3,'type':'chat'===_0x27fab3['type']?'chat':'action','model':'chat'!==_0x27fab3['type']?_0x27fab3['model']||_0x2354f0:_0x27fab3['model'],'icon':void 0x0}));_0xe1485d['find'](_0x1e2e43=>'other'===_0x1e2e43['id'])['actions']['push'](..._0x4e4dd6),_0xe1485d['forEach'](_0x4f8a4c=>{if('actions'in _0x4f8a4c)_0x4f8a4c['actions']['forEach'](_0x40f11a=>{if(_0x40f11a['isEnabled']=!!_0x7c241f['find'](_0x52848e=>_0x52848e['id']===_0x40f11a['model'])||void 0x0===_0x40f11a['model'],!_0x40f11a['isEnabled']){const _0x3f5b23=new at('ai-quick-actions-unavailable-model',this,{'actionId':_0x40f11a['id'],'modelId':_0x40f11a['model']});Et(_0x3f5b23['message']);}});else{if(_0x4f8a4c['isEnabled']=!!_0x7c241f['find'](_0x590879=>_0x590879['id']===_0x4f8a4c['model'])||void 0x0===_0x4f8a4c['model'],!_0x4f8a4c['isEnabled']){const _0x3eeca4=new at('ai-quick-actions-unavailable-model',this,{'actionId':_0x4f8a4c['id'],'modelId':_0x4f8a4c['model']});Et(_0x3eeca4['message']);}}});}return _0xe1485d;}['_initializeQuickActionsComponentsAndCommands'](){const _0x4a2a26=new Qt(this['editor']['locale']);_0x4a2a26['attachToDom'](),this['_initializeQuickActionsDropdown'](_0x4a2a26),this['_initializeQuickActionsMenuBar'](),this['_initializeQuickActionsComponents'](_0x4a2a26);}['_initializeQuickActionsDropdown'](_0x57673b){const _0x114964=this['editor']['config']['get']('ai.quickActions.isSearchEnabled')??!0x0;this['editor']['ui']['componentFactory']['add']('aiQuickActions',Vo({'editor':this['editor'],'content':this['_quickActionsDefinition'],'buttonDefinition':{'icon':_0x47c1b9,'label':hs(this['editor']['locale'],'AI_QUICK_ACTIONS_HEADING')},'bodyCollection':_0x57673b,'hasSearch':_0x114964}));}['_prepareQuickActionsDefinition'](_0x21da6a){this['_quickActionsDefinition']=_0x21da6a['map'](_0x45b4d0=>{if('actions'in _0x45b4d0){const _0x433c6e=_0x45b4d0;return{..._0x433c6e,'actions':_0x433c6e['actions']['map'](_0x49ec7f=>{const {actions:_0x38c41a,..._0x806853}=_0x433c6e;return{..._0x49ec7f,'parent':_0x806853};})['filter'](_0xb34535=>this['_shouldIncludeAction'](_0xb34535))};}return _0x45b4d0;})['filter'](_0x5cba63=>'actions'in _0x5cba63?_0x5cba63['actions']['length']>0x0:this['_shouldIncludeAction'](_0x5cba63));}['_shouldIncludeAction'](_0xf172fb){const _0x32fe48=this['editor']['config']['get']('ai.quickActions.removeCommands')||[];return this['editor']['plugins']['has'](Ko[_0xf172fb['type']])&&!_0x32fe48['includes'](_0xf172fb['id'])&&!('chat'===_0xf172fb['type']&&!0x1===this['editor']['config']['get']('ai.chat.context.document.enabled'));}['_initializeQuickActionsComponents'](_0x32132b){this['_quickActionsDefinition']['forEach'](_0x38795e=>{if('actions'in _0x38795e){const _0x348418=Vo({'editor':this['editor'],'content':_0x38795e['actions'],'buttonDefinition':_0x38795e,'bodyCollection':_0x32132b});this['editor']['ui']['componentFactory']['add'](_0x38795e['id'],_0x348418),_0x38795e['actions']['forEach'](_0x397963=>{const _0x15957b=Lo({'editor':this['editor'],'action':_0x397963});this['editor']['ui']['componentFactory']['add'](_0x397963['id'],_0x15957b);});}else{const _0x39c3bb=Lo({'editor':this['editor'],'action':_0x38795e,'withText':!0x1,'withIcon':!0x0,'isInDropdown':!0x1});this['editor']['ui']['componentFactory']['add'](_0x38795e['id'],_0x39c3bb);}});}['_initializeQuickActionsMenuBar'](){this['editor']['ui']['componentFactory']['add']('menuBar:aiQuickActions',_0x2ed86a=>{const _0x583aab=this['editor']['commands']['get']('aiQuickAction'),_0xb3d26a=new Kt(_0x2ed86a),_0x1b6022=hs(_0x2ed86a,'AI_QUICK_ACTIONS_HEADING');_0xb3d26a['buttonView']['set']({'label':_0x1b6022,'icon':_0x47c1b9});const _0x5eda71=new $t(_0x2ed86a);return _0x5eda71['set']({'ariaLabel':_0x1b6022,'role':'menu'}),this['_quickActionsDefinition']['forEach'](_0x51552f=>{if('actions'in _0x51552f){const _0x431c3d=_0x51552f,_0x351a88=new qt(_0x2ed86a,_0xb3d26a),_0x9ef2b2=new Kt(_0x2ed86a),_0x46d195=new $t(_0x2ed86a);_0x9ef2b2['buttonView']['set']({'label':_0x431c3d['label'],'icon':_0x431c3d['icon']}),_0x431c3d['actions']['forEach'](_0x82024b=>{const _0x28ade8=new qt(_0x2ed86a,_0x9ef2b2),_0x11937e=new Wt(_0x2ed86a);_0x11937e['set']({'label':_0x82024b['label'],'icon':_0x82024b['icon'],'role':'menuitem','isEnabled':_0x82024b['isEnabled']}),_0x11937e['on']('execute',()=>{this['_executeQuickAction'](_0x82024b);}),_0x11937e['delegate']('execute')['to'](_0x9ef2b2),_0x28ade8['children']['add'](_0x11937e),_0x46d195['items']['add'](_0x28ade8);}),_0x9ef2b2['panelView']['children']['add'](_0x46d195),_0x351a88['children']['add'](_0x9ef2b2),_0x5eda71['items']['add'](_0x351a88);}else{const _0x48384b=_0x51552f,_0xf66d38=new qt(_0x2ed86a,_0xb3d26a),_0x1f554c=new Wt(_0x2ed86a);_0x1f554c['set']({'label':_0x48384b['label'],'icon':_0x48384b['icon'],'role':'menuitem','isEnabled':_0x48384b['isEnabled']}),_0x1f554c['on']('execute',()=>{this['_executeQuickAction'](_0x48384b);}),_0x1f554c['delegate']('execute')['to'](_0xb3d26a),_0xf66d38['children']['add'](_0x1f554c),_0x5eda71['items']['add'](_0xf66d38);}}),(Object['values'](Ko)['some'](_0x265c45=>this['editor']['plugins']['has'](_0x265c45))?_0xb3d26a['bind']('isEnabled')['to'](_0x583aab):_0xb3d26a['set']({'isEnabled':!0x1}),_0xb3d26a['panelView']['children']['add'](_0x5eda71),_0xb3d26a);});}['_executeQuickAction'](_0x180e89){const _0x4fb670=this['editor'];_0x4fb670['editing']['view']['focus'](),_0x4fb670['commands']['execute']('aiQuickAction',_0x180e89);const _0x17cdf5=_0x4fb670['ui']['view']['menuBarView'];_0x17cdf5&&_0x17cdf5['close']&&_0x17cdf5['close']();}}class Yo extends _0x229e40{['execute'](_0x2b44eb){switch(this['_expandSelectionIfCollapsed'](),_0x2b44eb['type']){case'chat':if(!this['editor']['plugins']['has']('AIChat')){const _0x50c959=hs(this['editor']['locale'],'AI_QUICK_ACTIONS_PLUGIN_NOT_FOUND','AIChat');throw new at('ai-quick-actions-plugin-not-found',this['editor'],{'errorMessage':_0x50c959});}this['_handleAIChatAction'](_0x2b44eb);break;case'action':if(!this['editor']['plugins']['has']('AIActions')){const _0x1f2e9e=hs(this['editor']['locale'],'AI_QUICK_ACTIONS_PLUGIN_NOT_FOUND','AIActions');throw new at('ai-quick-actions-plugin-not-found',this['editor'],{'errorMessage':_0x1f2e9e});}this['_handleAIActionsAction'](_0x2b44eb);}}async['_handleAIChatAction'](_0x3e22a4){const _0xfad0fc=this['editor']['plugins']['get']('AIChatController'),_0xadc6a1=this['editor']['plugins']['get']('AITabs')['view'];if(_0xadc6a1['isVisible']||(_0xadc6a1['isVisible']=!0x0),'chat'!==_0xadc6a1['activeTab']&&_0xadc6a1['activateTab']('chat'),'ask-ai'===_0x3e22a4['id'])_0xfad0fc['removeSelectionFromChatContext'](),_0xfad0fc['addSelectionToChatContext'](),_0xfad0fc['focusPromptInput']();else await _0xfad0fc['startConversation']({'modelId':_0x3e22a4['model']}),_0xfad0fc['removeSelectionFromChatContext'](),_0xfad0fc['addSelectionToChatContext'](),_0xfad0fc['focusPromptInput'](),await _0xfad0fc['sendMessage']({'message':_0x3e22a4['prompt']||_0x3e22a4['displayedPrompt']||_0x3e22a4['label'],'attributes':{'quickActionData':{'id':_0x3e22a4['id']},'displayedPrompt':_0x3e22a4['displayedPrompt']}});}['_expandSelectionIfCollapsed'](){const _0x523c3f=this['editor'],_0x4a8c86=_0x523c3f['model']['document']['selection'];if(!_0x4a8c86['isCollapsed'])return;const _0x1b6735=At(_0x4a8c86['getSelectedBlocks']())||_0x523c3f['model']['schema']['getLimitElement'](_0x4a8c86);_0x523c3f['model']['change'](_0x27aeb1=>{_0x27aeb1['setSelection'](_0x1b6735,'in');});}['_handleAIActionsActionLabel'](_0x104197){return _0x104197['parent']?.['label']&&'other'!==_0x104197['parent']?.['id']?_0x104197['parent']['label']+':\x20'+_0x104197['label']:_0x104197['label'];}async['_handleAIActionsAction'](_0x56a6b1){const _0x3d7456=this['editor']['plugins']['get']('AIActions'),_0x414aca=_0x56a6b1['prompt']?{'userMessage':_0x56a6b1['prompt'],'model':_0x56a6b1['model']}:{'actionName':_0x56a6b1['actionName']||_0x56a6b1['id'],'args':_0x56a6b1['args']},_0x5c12d7=this['_handleAIActionsActionLabel'](_0x56a6b1);await _0x3d7456['executeAction'](_0x414aca,_0x5c12d7,_0x56a6b1['icon']);}}class $o extends _0x17e8c8{static get['pluginName'](){return'AIQuickActionsEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const _0x24fb1d=this['editor'],_0x146b2e=new Yo(this['editor']);if(_0x24fb1d['commands']['add']('aiQuickAction',_0x146b2e),_0x24fb1d['plugins']['has']('AIChat')){const _0x1f71de=this['editor']['plugins']['get']('AIChatController');_0x24fb1d['model']['document']['selection']['on']('change:range',(_0x46c66e,_0x3366a1)=>{_0x3366a1['directChange']&&_0x1f71de['removeSelectionFromChatContext']();});}}}class qo extends xs{['updateChangeGroups'](){if(this['parsedMergedContent']=this['parsedContent']['cloneNode'](!0x0),0x0==this['parsedMergedContent']['childNodes']['length'])return void(this['changeGroups']=[]);const _0x7b34b7=this['documentContextContent']['children']['map'](_0x343dbc=>({'node':_0x343dbc,'id':Es(_0x343dbc,'data-id')})),_0x300539=this['parsedMergedContent']['children']['map'](_0x4fef61=>({'node':_0x4fef61,'id':Es(_0x4fef61,'data-id')||ot()})),_0x9f7a9e=_0x1cf529(_0x7b34b7,_0x300539,{'comparator':(_0x29f52d,_0x1a9a28)=>_0x29f52d['id']==_0x1a9a28['id'],'oneChangePerToken':!0x0});if(!this['isDone']||!this['isComplete']){for(;_0x9f7a9e['length']&&_0x9f7a9e[_0x9f7a9e['length']-0x1]['removed'];)_0x9f7a9e['pop']();}const _0x321d54=_0x9f7a9e['map'](_0x1731e7=>{const _0x27a3cd=_0x1731e7['added']?'new':_0x1731e7['removed']?'removed':'modified';return{'node':_0x1731e7['value'][0x0]['node'],'type':_0x27a3cd,'id':_0x1731e7['value'][0x0]['id']};});this['changeGroups']=[{'changes':_0x321d54,'state':'pending','index':0x0}];}['_getDifferentChangeGroups'](_0x18bcc1,_0x495ab6){return _0x495ab6;}}class Qo extends Ds{['content'];['version'];['actionName'];['args'];['userMessage'];['model'];['hasError']=!0x1;['stoppedExplicitly']=!0x1;constructor(_0x1039da){super(_0x1039da),this['content']=_0x1039da['content'],this['version']=_0x1039da['version'],this['actionName']=_0x1039da['actionName'],this['args']=_0x1039da['args'],this['userMessage']=_0x1039da['userMessage'],this['model']=_0x1039da['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'](_0xb95d7){const _0x4bec81=new qo({'locale':this['locale'],'documentContextContent':this['content'],..._0xb95d7});return this['replies']['push'](_0x4bec81),_0x4bec81['delegate'](...Ls)['to'](this),this['fire']('replyCreated',_0x4bec81),_0x4bec81;}}class Xo extends kt{constructor(_0x1ccbd8,_0x1a0974=!0x0,_0x31ea40=!0x0){super(_0x1ccbd8),this['set']('isEnabled',!0x1),_0x1a0974&&(this['applyButton']=this['_createButton'](hs(_0x1ccbd8,'AI_BALLOON_APPLY_BUTTON'),cs),this['applyButton']['bind']('isEnabled')['to'](this),this['items']['add'](this['applyButton'])),_0x31ea40&&(this['suggestButton']=this['_createButton'](hs(_0x1ccbd8,'AI_BALLOON_SUGGEST_BUTTON'),_0x1a0974?ls:cs),this['suggestButton']['bind']('isEnabled')['to'](this),this['items']['add'](this['suggestButton'])),this['setButtonsVisibility']({'showApplyButton':_0x1a0974,'showSuggestButton':_0x31ea40}),this['extendTemplate']({'attributes':{'class':['ck-ai-balloon__toolbar']}});}['setButtonsVisibility']({showApplyButton:_0x513fae,showSuggestButton:_0x4d64ae}){this['applyButton']&&(this['applyButton']['isVisible']=_0x513fae),this['suggestButton']&&(this['suggestButton']['isVisible']=_0x4d64ae);}['_createButton'](_0x386a5c,_0x414d25){const _0x24859a=new Nt(this['locale']);return _0x24859a['set']({'label':_0x386a5c,'class':_0x414d25,'isVisible':!0x0,'withText':!0x0}),_0x24859a;}}class zo extends vt{constructor(_0x53a4e7){super(_0x53a4e7),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(_0x53a4e7,'AI_DISCLAIMER_TEXT')}]}]});}}class jo extends vt{constructor(_0x151f53){super(_0x151f53),this['set']('isVisible',!0x0);const _0x4e287e=new yn('small');_0x4e287e['isVisible']=!0x0;const _0x5bc866=new vt(this['locale']);_0x5bc866['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',_0x426fe6=>!_0x426fe6)]},'children':[_0x4e287e,_0x5bc866]});}}class Jo extends So{['focusCycler'];['_config'];['_contentWrapper'];['_streamableContentView'];['_toolbarView'];['_miniToolbarView'];['_loaderView'];['_disclaimerView'];['_focusTracker'];['_keystrokes'];['_dialogContent'];['_focusables'];['_scrollManager'];['_navigationPreviousButton'];['_navigationNextButton'];['_navigationTryAgainButton'];['_navigationCounter'];constructor(_0x43ecac,_0x4ba5af){super(_0x43ecac),this['set']('isBusy',!0x1),this['set']('isTrackChangesOn',!0x1),this['set']('_isLoading',!0x1),this['set']('_hasError',!0x1),this['_config']=_0x4ba5af,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 _0x473e27(),this['_addContentWrapper'](_0x4ba5af),this['_addDisclaimerView'](),this['_addToolbar'](_0x4ba5af),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'](_0x4ba5af);});}['render'](){super['render']();for(const _0x37a810 of this['_focusables'])this['_focusTracker']['add'](_0x37a810['element']);this['_keystrokes']['listenTo'](this['element']),this['_initializeScrollManager']();}['destroy'](){super['destroy'](),this['_scrollManager']&&this['_scrollManager']['destroy']();}['focus'](_0x42577b){-0x1===_0x42577b?this['focusCycler']['focusLast']():this['focusCycler']['focusFirst']();}['setIsLoading'](_0x58016f){this['_isLoading']=_0x58016f;}['setErrorState'](){this['_hasError']=!0x0,this['_miniToolbarView']['toggleShowChangesEnabled'](!0x1);}['clearErrorState'](){this['_hasError']=!0x1,this['_miniToolbarView']['toggleShowChangesEnabled'](!0x0);}['showError'](_0x115a77){super['showError'](_0x115a77),this['_dialogContent']['has'](this['_errorView'])||this['_dialogContent']['add'](this['_errorView'],0x0);}['hideError'](){super['hideError'](),this['clearErrorState']();}['showBlockingError'](_0x198454){super['showBlockingError'](_0x198454),this['setErrorState']();}['addMiniToolbarItem'](_0x29d3f7){this['_miniToolbarView']['items']['has'](_0x29d3f7)||this['_miniToolbarView']['items']['add'](_0x29d3f7);}['removeMiniToolbarItem'](_0x24318b){this['_miniToolbarView']['items']['has'](_0x24318b)&&this['_miniToolbarView']['items']['remove'](_0x24318b);}['showLoader'](){this['_loaderView']&&(this['_isLoading']=!0x0);}['hideLoader'](){this['_loaderView']&&(this['_isLoading']=!0x1);}['_toggleToolbarButtonsVisibility']({showApplyButton:_0x4ba5c0,showSuggestButton:_0x593f9c}){_0x4ba5c0=_0x4ba5c0&&!this['isTrackChangesOn']&&this['_config']['availableActions']['includes']('applySuggestion'),_0x593f9c=_0x593f9c&&this['_config']['availableActions']['includes']('insertSuggestion'),this['_toolbarView']['setButtonsVisibility']({'showApplyButton':_0x4ba5c0,'showSuggestButton':_0x593f9c});}async['updateContent'](_0xc2d14c){await this['_streamableContentView']['update'](_0xc2d14c);}['clearContent'](){this['_streamableContentView']['clear']();}['_addContentWrapper'](_0x4cb50c){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'](_0x4cb50c['miniToolbarConfig'])]}),this['_dialogContent']['add'](this['_contentWrapper']);}['_addDisclaimerView'](){this['_disclaimerView']=new zo(this['locale']),this['_dialogContent']['add'](this['_disclaimerView']);}['_addToolbar']({showApplyButton:_0x33fcc8,showSuggestButton:_0x32ca1d}){this['_toolbarView']=new Xo(this['locale'],_0x33fcc8,_0x32ca1d),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',(_0x3f480a,_0x303752,_0xa00303)=>!(_0x3f480a||_0x303752||_0xa00303)),this['_toggleToolbarButtonsVisibility']({'showApplyButton':_0x33fcc8,'showSuggestButton':_0x32ca1d}),this['_dialogContent']['add'](this['_toolbarView']);}['_createMiniToolbar'](_0x265010){return this['_miniToolbarView']=new ko(this['locale'],_0x265010),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',(_0x3d0c6e,_0x418037)=>!(_0x3d0c6e||_0x418037)),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 _0x2e0317=new Nt(this['locale']),_0x3010a9=new Nt(this['locale']),_0x3d9a7f=new Zo(this['locale']),_0x1e885d=new Nt(this['locale']);_0x2e0317['set']({'icon':tt,'label':hs(this['locale'],'AI_ACTIONS_TRY_AGAIN'),'tooltip':!0x0,'class':'ck-ai-custom-action-button\x20'+us}),_0x3010a9['set']({'icon':_0x243bd3,'tooltip':hs(this['locale'],'AI_ACTIONS_PREVIOUS_INTERACTION'),'class':'ck-ai-navigation-button\x20ck-ai-previous-button\x20'+us}),_0x1e885d['set']({'icon':et,'tooltip':hs(this['locale'],'AI_ACTIONS_NEXT_INTERACTION'),'class':'ck-ai-navigation-button\x20ck-ai-next-button\x20'+us}),_0x2e0317['bind']('isEnabled')['to'](this,'isBusy',_0x5ca344=>!_0x5ca344),_0x2e0317['on']('execute',()=>{this['fire']('tryAgain');}),_0x3010a9['bind']('isEnabled')['to'](this,'isBusy',_0x420316=>!_0x420316),_0x3010a9['on']('execute',()=>{this['fire']('showPrevious');}),_0x1e885d['bind']('isEnabled')['to'](this,'isBusy',_0x20c061=>!_0x20c061),_0x1e885d['on']('execute',()=>{this['fire']('showNext');}),this['_navigationPreviousButton']=_0x3010a9,this['_navigationCounter']=_0x3d9a7f,this['_navigationNextButton']=_0x1e885d,this['_navigationTryAgainButton']=_0x2e0317;}['updateMiniToolbarButtons'](_0x58787b,_0x3a35fb){this['_navigationPreviousButton']||this['_setupMiniToolbarButtons']();const _0x590706=_0x58787b>0x1;if(this['addMiniToolbarItem'](this['_navigationTryAgainButton']),_0x590706){this['addMiniToolbarItem'](this['_navigationPreviousButton']),this['addMiniToolbarItem'](this['_navigationCounter']),this['addMiniToolbarItem'](this['_navigationNextButton']);const _0x2c8bda=_0x58787b-_0x3a35fb;this['_navigationCounter']['setInteractionCount'](_0x2c8bda+'/'+_0x58787b),this['_navigationPreviousButton']['isEnabled']=_0x3a35fb<_0x58787b-0x1,this['_navigationNextButton']['isEnabled']=_0x3a35fb>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'](_0x37f499){this['_isLoading']=_0x37f499;}['resetShowChangesButton'](){this['_miniToolbarView']['isShowChangesOn']=!0x1;}['_initializeScrollManager'](){const _0x5a741f=this['_getScrollableElement']();_0x5a741f&&!this['_scrollManager']&&(this['_scrollManager']=new sr(_0x5a741f));}['_getScrollableElement'](){return this['_streamableContentView']['element'];}}class Zo extends vt{constructor(_0x34ae9a){super(_0x34ae9a);const _0x416812=this['bindTemplate'];this['set']('interactionCount','1/1'),this['setTemplate']({'tag':'span','attributes':{'class':['ck-ai-interaction-counter']},'children':[{'text':_0x416812['to']('interactionCount')}]});}['setInteractionCount'](_0x479a06){this['set']('interactionCount',_0x479a06);}}class ta extends _0x17e8c8{static get['requires'](){return[as,Bt,Js,Oo,_0x510df7];}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(_0x4a928d){super(_0x4a928d),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'](_0x14a26e,_0x1c4ad6,_0x490b9f){if(this['_stopInteraction'](),this['editor']['plugins']['has']('TableSelection')){if(this['editor']['plugins']['get']('TableSelection')['getSelectedTableCells']()){const {modelFragment:_0x5881e6,anchorData:_0x4d367a,root:_0x4a73e5}=this['_getExecuteDataInTable']();return this['_executeAction'](_0x14a26e,_0x5881e6,_0x4d367a,_0x4a73e5,_0x1c4ad6,_0x490b9f);}}const {modelFragment:_0x5e1114,anchorData:_0xc80b07,root:_0x42badb}=this['_getExecuteDataRegular']();return this['_executeAction'](_0x14a26e,_0x5e1114,_0xc80b07,_0x42badb,_0x1c4ad6,_0x490b9f);}async['destroy'](){return this['_stopInteraction'](),this['_bodyCollection']['detachFromDom'](),super['destroy']();}['_createActionsBalloonView'](){const _0x45a8e1=this['editor']['plugins']['has']('TrackChanges');let _0x26bc6f=this['editor']['config']['get']('ai.availableReplyActions')||[...fn];_0x45a8e1||(_0x26bc6f=_0x26bc6f['filter'](_0x2a0188=>'insertSuggestion'!=_0x2a0188));const _0x8af9d7=this['editor']['commands']['get']('trackChanges'),_0x33a4a0=new Jo(this['editor']['locale'],{'showApplyButton':!0x0,'showSuggestButton':_0x45a8e1,'miniToolbarConfig':{'showChanges':'icon'},'availableActions':_0x26bc6f});return _0x33a4a0['bind']('isBusy')['to'](this),_0x8af9d7&&_0x33a4a0['bind']('isTrackChangesOn')['to'](_0x8af9d7,'value'),_0x33a4a0['on']('tryAgain',()=>{this['_refreshInteraction']();}),_0x33a4a0['on']('showPrevious',()=>{this['_navigateToPrevious']();}),_0x33a4a0['on']('showNext',()=>{this['_navigateToNext']();}),_0x33a4a0;}['_getExecuteDataRegular'](){const _0x422373=this['editor']['model']['document']['selection'],_0x404590=_0x422373['getFirstRange']()['start']['root'];if(_0x422373['isCollapsed']){const _0x52ffd3=At(_0x422373['getSelectedBlocks']())||this['editor']['model']['schema']['getLimitElement'](_0x422373);this['editor']['model']['change'](_0x374da2=>{_0x374da2['setSelection'](_0x52ffd3,'in');});}const _0x2f8dfb=_0x422373['getFirstRange'](),_0x1cfc28=this['_wrapWithCommonAncestors'](this['editor']['model']['getSelectedContent'](_0x422373),_0x2f8dfb['start'],_0x2f8dfb['end']);this['_copyMarkersToFragment'](_0x1cfc28,_0x422373,{'isTableSelection':!0x1});const _0x3f6019=_0x422373['getFirstRange']()['start'],_0x5980e9=new Map();let _0x1fc196=_0x1cfc28;for(let _0xb25b4c=0x0;_0xb25b4c<_0x3f6019['path']['length'];_0xb25b4c++)_0x5980e9['set'](_0x1fc196,_0x3f6019['path'][_0xb25b4c]),_0x1fc196=_0x1fc196['getChild'](0x0);return{'modelFragment':_0x1cfc28,'anchorData':_0x5980e9,'root':_0x404590};}['_getExecuteDataInTable'](){const _0x207303=this['editor']['model']['document']['selection'],_0x242623=this['editor']['plugins']['get']('TableSelection'),_0x3d7cb1=_0x207303['getFirstRange']()['start']['root'],_0x12c335=_0x242623['getSelectionAsFragment'](),_0x15b7b3=_0x207303['getFirstRange']()['start']['parent']['parent'],_0x567458=this['editor']['model']['createRange'](this['editor']['model']['createPositionBefore'](_0x15b7b3),this['editor']['model']['createPositionAfter'](_0x15b7b3)),_0x37d578=this['_wrapWithCommonAncestors'](_0x12c335,_0x567458['start'],_0x567458['end']);this['_copyMarkersToFragment'](_0x37d578,_0x207303,{'isTableSelection':!0x0});const _0x2a9363=_0x207303['getFirstRange']()['start'],_0x1a43b0=new Map();let _0x15c046=_0x37d578;for(let _0x3ff24e=0x0;_0x3ff24e<_0x2a9363['path']['length'];_0x3ff24e++)if(_0x1a43b0['set'](_0x15c046,_0x2a9363['path'][_0x3ff24e]),_0x3ff24e<_0x2a9363['path']['length']-0x1)_0x15c046=_0x15c046['getChild'](0x0);else{let _0x5a728e=_0x15c046['nextSibling'];for(;_0x5a728e;)_0x1a43b0['set'](_0x5a728e,_0x2a9363['path'][_0x3ff24e]),_0x5a728e=_0x5a728e['nextSibling'];}return{'modelFragment':_0x37d578,'anchorData':_0x1a43b0,'root':_0x3d7cb1};}async['_executeAction'](_0x1588f4,_0x3b919e,_0x4a62a5,_0x81a528,_0x47afe4,_0x16a499){const _0x44a2c5=this['editor']['plugins']['get'](Js),_0x32f255=this['editor']['plugins']['get'](Oo),_0x455981=this['editor']['model']['document']['selection'],_0x571652=await _0x44a2c5['modelToDataWithIds'](_0x3b919e),_0x539ac4=this['editor']['model']['document']['version'],_0xffb62b=[..._0x455981['getRanges']()];return this['_actionsBalloonView']||(this['_actionsBalloonView']=this['_createActionsBalloonView']()),this['_clearInteractionHistory'](),this['_clearErrorState'](),this['_balloonShowDiff']=!0x1,this['_actionsBalloonView']['resetShowChangesButton'](),this['_actionsBalloonView']['clearContent'](),_0x32f255['open']({'index':0x3e8*Math['random']()%0x3e8,'title':_0x47afe4,'icon':_0x16a499||_0x47c1b9,'mainView':this['_actionsBalloonView'],'class':'ck-ai-actions-balloon','ranges':_0xffb62b,'id':'aiActionsBalloon'}),this['_setLoadingState'](),this['stopListening'](this['_actionsBalloonView']),this['stopListening'](_0x32f255),this['_interactionParams']={'action':_0x1588f4,'content':_0x571652,'version':_0x539ac4,'aiBalloon':_0x32f255,'modelFragment':_0x3b919e,'anchorData':_0x4a62a5,'root':_0x81a528},this['_setupApplyListeners'](),this['listenTo'](_0x32f255,'selectionRemoved',()=>{this['_stopInteraction'](),this['_actionsBalloonView']['disableMiniToolbarButtons']();}),this['listenTo'](_0x32f255,'dialogClosed',(_0x434a85,{id:_0x71921})=>{if('aiActionsBalloon'===_0x71921){for(const _0xf18f9a of this['_interactions']){if(0x0===_0xf18f9a['replies']['length']||_0xf18f9a['stoppedExplicitly'])continue;const _0x1a394e=_0xf18f9a['replies'][_0xf18f9a['replies']['length']-0x1],_0xe2f7ce=_0x1a394e['changeGroups'][0x0];_0xe2f7ce&&'pending'===_0xe2f7ce['state']&&_0x1a394e['setChangeGroupState'](0x0,'rejected');}this['_stopInteraction'](),this['_clearInteractionHistory'](),this['stopListening'](this['_actionsBalloonView']),this['stopListening'](_0x32f255);}}),this['_createInteraction'](_0x571652,_0x539ac4,_0x32f255,_0x1588f4);}['_setupApplyListeners'](){if(!this['_interactionParams'])return;const {modelFragment:_0x287b7e,anchorData:_0x44983b,root:_0x269d7c}=this['_interactionParams'];this['listenTo'](this['_actionsBalloonView'],'applySuggestion',()=>{this['_applyChanges'](_0x287b7e,_0x44983b,_0x269d7c,!0x1);}),this['listenTo'](this['_actionsBalloonView'],'insertSuggestion',()=>{this['_applyChanges'](_0x287b7e,_0x44983b,_0x269d7c,!0x0);});}['_wrapWithCommonAncestors'](_0x440dc6,_0x386ed8,_0x541e43){const _0x257553=this['editor']['model']['createRange'](_0x386ed8,_0x541e43)['getCommonAncestor'](),_0x39107e=_0x257553['is']('documentFragment')?[]:_0x257553['getAncestors']({'includeSelf':!0x0})['slice'](0x1);if(_0x39107e['length']){const _0x52d673=_0x39107e['map'](_0x23ed2e=>_0x23ed2e['_clone'](!0x1));for(let _0x38e576=0x1;_0x38e576<_0x52d673['length'];_0x38e576++)_0x52d673[_0x38e576-0x1]['_appendChild'](_0x52d673[_0x38e576]);return _0x52d673[_0x52d673['length']-0x1]['_appendChild'](_0x440dc6),new _0x3a3cd6(_0x52d673[0x0]);}return _0x440dc6;}['_copyMarkersToFragment'](_0x562b07,_0x5d9a6a,_0x513f77={'isTableSelection':!0x1}){const _0x8c120e=this['editor']['model'],_0x264dbd=Array['from'](_0x5d9a6a['getRanges']()),_0x5c563e=_0x5d9a6a['getFirstRange']()['start'];for(const _0x2a49fe of _0x8c120e['markers']){if(_0x2a49fe['name']['startsWith'](zs)||!_0x2a49fe['affectsData'])continue;const _0x45167a=_0x2a49fe['getRange']();if(!_0x264dbd['some'](_0x3565c4=>_0x3565c4['containsRange'](_0x45167a,!0x0)))continue;const _0x690d12=this['_regularCalculateMarkerPath'](_0x45167a['start'],_0x5c563e,_0x513f77['isTableSelection']),_0x4aea47=this['_regularCalculateMarkerPath'](_0x45167a['end'],_0x5c563e,_0x513f77['isTableSelection']),_0xe150fd=_0x8c120e['createPositionFromPath'](_0x562b07,_0x690d12),_0x5c2a2d=_0x8c120e['createPositionFromPath'](_0x562b07,_0x4aea47);if(!_0xe150fd['isEqual'](_0x5c2a2d)){const _0x52bfc8=_0x8c120e['createRange'](_0xe150fd,_0x5c2a2d);_0x562b07['markers']['set'](_0x2a49fe['name'],_0x52bfc8);}}}['_regularCalculateMarkerPath'](_0x11ec80,_0x4637de,_0x192f2a=!0x1){const _0xd87b4a=[..._0x11ec80['path']['slice']()];for(let _0x2fd33e=0x0;_0x2fd33e<Math['max'](_0x4637de['path']['length'],_0x11ec80['path']['length']);_0x2fd33e++){const _0x8a17de=_0x4637de['path'][_0x2fd33e]||0x0,_0xf29bed=(_0x11ec80['path'][_0x2fd33e]||0x0)-_0x8a17de;if(_0xd87b4a[_0x2fd33e]=_0xf29bed,0x0!==_0xf29bed&&!_0x192f2a)break;}return _0xd87b4a;}async['_createInteraction'](_0x4806c1,_0x37509c,_0x492099,_0x442407){const _0x4fc773=this['editor'];this['_interactionParams']||(this['_interactionParams']={'action':_0x442407,'content':_0x4806c1,'version':_0x37509c,'aiBalloon':_0x492099,'modelFragment':this['editor']['model']['getSelectedContent'](this['editor']['model']['document']['selection']),'anchorData':new Map(),'root':this['editor']['model']['document']['selection']['getFirstRange']()['start']['root']});const _0x352f02=new Qo({'connector':this['_aiConnector'],'locale':_0x4fc773['locale'],'content':_0x4806c1,'version':_0x37509c,..._0x442407});this['_interactions']['push'](_0x352f02);const _0x5075db=(_0x268d45,_0x101d9e=!0x1,_0x365718='streaming')=>this['_promiseQueue']['enqueue'](async _0x2b2a21=>{try{const _0x148a20=Rs({'editor':_0x4fc773,'changeGroups':_0x268d45['changeGroups'],'documentContextContent':_0x268d45['documentContextContent'],'showDiff':_0x101d9e,'trimUnchanged':!0x1});_0x148a20['length']&&await this['_actionsBalloonView']['updateContent']({'part':_0x148a20[0x0],'renderingStrategy':_0x365718,'abortSignal':_0x2b2a21});}catch(_0x31162d){if(this['_isAbortError'](_0x31162d))return;throw _0x31162d;}});_0x352f02['on']('replyCreated',(_0x18f0c6,_0x27b76a)=>{this['_actionsBalloonView']['hideLoader'](),this['_actionsBalloonView']['startAutoScroll'](),_0x5075db(_0x27b76a)['catch'](_0x4e772f=>{this['_isAbortError'](_0x4e772f)||(console['error']('Error\x20updating\x20content\x20in\x20replyCreated:',_0x4e772f),this['_setErrorState'](_0x352f02));});}),_0x352f02['on']('replyContentUpdated',(_0x19d40f,_0x13a41d)=>{_0x5075db(_0x13a41d)['catch'](_0x183de6=>{this['_isAbortError'](_0x183de6)||(console['error']('Error\x20updating\x20content\x20in\x20replyContentUpdated:',_0x183de6),this['_setErrorState'](_0x352f02));});}),_0x352f02['on']('interactionFinished',async()=>{try{await this['_clearLoadingState'](),this['_actionsBalloonView']['updateMiniToolbarButtons'](this['_interactions']['length'],this['_currentInteractionIndex']),await this['_promiseQueue']['queueEmptyPromise'];}catch(_0x3cddb3){this['_isAbortError'](_0x3cddb3)||(console['error']('Error\x20clearing\x20loading\x20state\x20in\x20interactionFinished:',_0x3cddb3),this['_setErrorState'](_0x352f02));}finally{this['_actionsBalloonView']['stopAutoScroll']();}}),this['listenTo'](this['_actionsBalloonView'],'toggleSuggestionDisplayMode',async(_0x187712,{showDiff:_0x29540e})=>{try{this['_balloonShowDiff']=_0x29540e;const _0x55210b=this['_interaction']['replies'][this['_interaction']['replies']['length']-0x1];_0x55210b&&await _0x5075db(_0x55210b,_0x29540e,'static');}catch(_0xfde8aa){this['_isAbortError'](_0xfde8aa)||(console['error']('Error\x20updating\x20content\x20in\x20toggleSuggestionDisplayMode:',_0xfde8aa),this['_setErrorState'](_0x352f02));}}),_0x352f02['on']('replyChangeGroupStateUpdated',()=>{const _0x3d73bc={'positiveCount':_0x352f02['replies']['reduce']((_0x2ca51e,_0x44481b)=>_0x2ca51e+_0x44481b['changeGroups']['filter'](_0x5e5300=>'accepted'===_0x5e5300['state'])['length'],0x0),'totalCount':_0x352f02['replies']['reduce']((_0x1889e8,_0x2493e7)=>_0x1889e8+_0x2493e7['changeGroups']['length'],0x0)},_0x115dcb=_0x352f02['actionCallId'],_0x6e0d08=_0x352f02['actionName'];_0x6e0d08?this['_aiConnector']['upsertAIActionRating'](_0x6e0d08,_0x115dcb,_0x3d73bc):this['_aiConnector']['upsertCustomAIActionRating'](_0x115dcb,_0x3d73bc);}),this['_setLoadingState']();try{const _0x13d70c=await _0x352f02['start']();return this['_actionsBalloonView']['updateMiniToolbarButtons'](this['_interactions']['length'],this['_currentInteractionIndex']),_0x13d70c;}catch(_0x1c3426){if(this['_isAbortError'](_0x1c3426))return;this['_actionsBalloonView']['hideLoader'](),this['_setErrorState'](_0x352f02);}}['_applyChanges'](_0x186ac0,_0x74d4d5,_0xedae4e,_0x39ebe5){const _0x3f5ad8=this['editor'];if(_0x39ebe5&&!_0x3f5ad8['plugins']['has']('TrackChanges'))throw new at('ai-no-track-changes',null);const _0x28bb59=this['editor']['plugins']['get'](_0x510df7),_0x5c87fc=this['_interactions'][this['_interactions']['length']-0x1-this['_currentInteractionIndex']];if(!_0x5c87fc||!_0x5c87fc['replies']['length'])return;const _0x2f3183=_0x5c87fc['replies'][_0x5c87fc['replies']['length']-0x1],_0x4b15ef=_0x2f3183['changeGroups'];_0x2f3183['setChangeGroupState'](0x0,'accepted');let _0x4f5611=qs({'editor':_0x3f5ad8,'reply':_0x2f3183,'interaction':_0x5c87fc,'groups':_0x4b15ef,'transform':!0x1,'documentCompare':_0x28bb59,'documentCompareOptions':{'anchor':_0x3f5ad8['model']['createPositionAt'](_0x186ac0,0x0),'markDeletions':_0x39ebe5}});_0x4f5611=this['_filterOperationsOutsideRange'](_0x4f5611,_0x74d4d5);for(const _0x2c4208 of _0x4f5611)this['_anchorOperation'](_0x74d4d5,_0x2c4208,_0xedae4e);const _0x17f13f=_0x5c87fc['getDocumentContext']()['version'],_0x91740a=_0x3f5ad8['model']['document']['history']['getOperations'](_0x17f13f),_0x31ddc6={'document':_0x3f5ad8['model']['document'],'useRelations':!0x1,'padWithNoOps':!0x1},_0x3a9c0e=_0x5f4e4f(_0x4f5611,_0x91740a,_0x31ddc6)['operationsA'];_0x3f5ad8['model']['change'](_0x5df0bc=>{if(_0x5df0bc['setSelection'](_0x3f5ad8['model']['document']['selection']['focus']),_0x39ebe5)_0x3f5ad8['plugins']['get']('TrackChangesEditing')['_applyOperationsAsSuggestions'](_0x3a9c0e);else{for(const _0x2fa7c2 of _0x3a9c0e)_0x2fa7c2['baseVersion']=_0x3f5ad8['model']['document']['version'],Qs(_0x3f5ad8,_0x2fa7c2),_0x5df0bc['batch']['addOperation'](_0x2fa7c2),_0x3f5ad8['model']['applyOperation'](_0x2fa7c2);}}),this['editor']['plugins']['get']('AIBalloon')['close']();}['_filterOperationsOutsideRange'](_0x224b3d,_0x3a0cbd){return _0x224b3d['filter'](_0x17ec8d=>{if('rename'==_0x17ec8d['type']){const _0xb78532=_0x17ec8d['position']['nodeAfter'];return!_0x3a0cbd['has'](_0xb78532);}if(_0x17ec8d['type']['indexOf']('Attribute')>-0x1){const _0x47e660=_0x17ec8d['range']['start']['nodeAfter'];return!_0x3a0cbd['has'](_0x47e660);}return!0x0;});}['_anchorOperation'](_0x1392d4,_0x18b840,_0x3867f7){const _0x53ae05=_0x18b840['clone']();for(const _0x1a0585 in _0x18b840){const _0x4ae208=_0x18b840[_0x1a0585];_0x4ae208 instanceof _0x49ae78?_0x18b840[_0x1a0585]=new _0x49ae78(_0x34bf85(_0x4ae208['start']),_0x34bf85(_0x4ae208['end'])):_0x4ae208 instanceof _0x11c903&&(_0x18b840[_0x1a0585]=_0x34bf85(_0x4ae208));}if(['insert','move','remove','reinsert','split','merge']['includes'](_0x53ae05['type'])){if(_0x53ae05['isDocumentOperation']=!0x1,_0x53ae05['baseVersion']=null,'remove'==_0x53ae05['type']){const _0x2d71a5=_0x53ae05['sourcePosition'],_0xdfaf7d=_0x53ae05['howMany'];new _0x5b32ba(_0x2d71a5,_0xdfaf7d)['_execute']();}else _0x53ae05['_execute']();}function _0x34bf85(_0x1fe84a){if('$graveyard'==_0x1fe84a['root']['rootName'])return _0x1fe84a;const _0x4fbc48=[];let _0x501437=_0x1fe84a['root'];for(let _0x1ff69e=0x0;_0x1ff69e<_0x1fe84a['path']['length'];_0x1ff69e++){const _0x479b5a=_0x1392d4['get'](_0x501437)||0x0;_0x4fbc48[_0x1ff69e]=_0x1fe84a['path'][_0x1ff69e]+_0x479b5a,_0x501437=_0x501437['getChildAtOffset'](_0x1fe84a['path'][_0x1ff69e]);}return new _0x11c903(_0x3867f7,_0x4fbc48,_0x1fe84a['stickiness']);}}['_refreshInteraction'](){if(!this['_interactionParams'])return;this['_interactions']['length']>0x0&&this['_stopInteraction'](),this['_currentInteractionIndex']=0x0,this['_balloonShowDiff']=!0x1;const {action:_0x16e32c,content:_0x3c0a08,version:_0x2e19f6,aiBalloon:_0x4ad976}=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'](_0x3c0a08,_0x2e19f6,_0x4ad976,_0x16e32c)['catch'](_0x41f733=>{this['_isAbortError'](_0x41f733)||console['error']('Error\x20refreshing\x20interaction:',_0x41f733);});}['_isAbortError'](_0x479a78){return!!_0x479a78['message']&&_0x479a78['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 _0x25ab0e=this['_interactions']['length'];this['_currentInteractionIndex']<_0x25ab0e-0x1&&this['_displayInteractionAtIndex'](this['_currentInteractionIndex']+0x1);}['_navigateToNext'](){this['_currentInteractionIndex']>0x0&&this['_displayInteractionAtIndex'](this['_currentInteractionIndex']-0x1);}async['_displayInteractionAtIndex'](_0x4945ce){if(!this['_interactionParams'])return;this['_currentInteractionIndex']=_0x4945ce;const _0x5eccdf=this['_interactions'][this['_interactions']['length']-0x1-this['_currentInteractionIndex']];if(!_0x5eccdf)return;if(_0x5eccdf['hasError'])return this['_setErrorState'](_0x5eccdf),void this['_actionsBalloonView']['updateMiniToolbarButtons'](this['_interactions']['length'],this['_currentInteractionIndex']);if(!_0x5eccdf['replies']['length'])return;this['_actionsBalloonView']['hideError'](),this['_interactionParams']&&this['_clearErrorState']();const _0x1cad20=_0x5eccdf['replies'][_0x5eccdf['replies']['length']-0x1];if(_0x1cad20){const _0x4d1f1a=this['editor'];try{const _0x55bfc7=Rs({'editor':_0x4d1f1a,'changeGroups':_0x1cad20['changeGroups'],'documentContextContent':_0x1cad20['documentContextContent'],'showDiff':this['_balloonShowDiff'],'trimUnchanged':!0x1});await new Promise(_0x4a727d=>setTimeout(_0x4a727d,0x32)),await this['_actionsBalloonView']['updateContent']({'part':_0x55bfc7[0x0],'renderingStrategy':'static','abortSignal':new AbortController()['signal']});}catch(_0xe220fa){this['_isAbortError'](_0xe220fa)||console['error']('Error\x20updating\x20content\x20during\x20navigation:',_0xe220fa);}}this['_actionsBalloonView']['updateMiniToolbarButtons'](this['_interactions']['length'],this['_currentInteractionIndex']);}['_setLoadingState'](){this['_actionsBalloonView']['setIsLoading'](!0x0),this['isBusy']=!0x0;}async['_setErrorState'](_0x49f38b){const _0x17435d=hs(this['editor']['locale'],'AI_ACTIONS_GENERIC_ERROR');this['_actionsBalloonView']['showError'](_0x17435d),_0x49f38b['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 _0x17e8c8{static get['requires'](){return[Wo,$o,ta];}static get['pluginName'](){return'AIQuickActions';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0xa72516){super(_0xa72516),_0xa72516['config']['define']('ai.quickActions',{'extraCommands':[],'removeCommands':[],'isSearchEnabled':!0x0});}}class ia extends vt{['resultResponseView'];['acceptButtonView'];['dismissButtonView'];['infoButtonView'];['outdatedButtonView'];constructor(_0x5428d6,_0x5a9036){super(_0x5428d6),this['id']=_0x5a9036,this['set']('status','pending'),this['set']('changeId',_0x5a9036),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',(_0x3e0340,_0x2f8257)=>{_0x2f8257&&_0x2f8257['target']&&'A'===_0x2f8257['target']['tagName']&&_0x2f8257['preventDefault'](),this['fire']('activateChange',{'id':_0x5a9036,'source':this,'uiInteraction':'click'});}),this['on']('mouseover',()=>{this['fire']('activateChange',{'id':_0x5a9036,'source':this,'uiInteraction':'hover'});}),this['on']('mouseout',()=>{this['fire']('deactivateChange',{'origin':'panel','id':_0x5a9036,'source':this});});}['setItemAsActive'](){this['isActive']=!0x0;}['setItemAsInactive'](){this['isActive']=!0x1;}['_createResultResponseView'](){const _0x257a43=new vt(this['locale']);return _0x257a43['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',_0x293115=>!_0x293115)]}}),_0x257a43;}['_createAcceptButtonView'](){const _0x3340d9=new Nt(this['locale']);return _0x3340d9['set']({'label':hs(this['locale'],'AI_REVIEW_MODE_ACCEPT_CHANGE'),'withText':!0x0}),_0x3340d9['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x4cf8e5=>{this['fire']('acceptChange',{'id':this['changeId']}),_0x4cf8e5['stopPropagation']();})},'attributes':{'class':[this['bindTemplate']['if']('status','ck-hidden',_0x47b73a=>'pending'!==_0x47b73a&&'accepted'!==_0x47b73a),this['bindTemplate']['if']('status',ls,_0x2ce8c4=>'pending'===_0x2ce8c4),this['bindTemplate']['if']('status',us,_0x2ba7b8=>'pending'!==_0x2ba7b8),this['bindTemplate']['if']('status','ck-ai_review__check-run-result-status-button',_0x5cbd67=>'accepted'===_0x5cbd67)]}}),this['on']('change:status',(_0x661a03,_0xde9227,_0x5af397)=>{_0x3340d9['isEnabled']='pending'===_0x5af397,'accepted'===_0x5af397&&(_0x3340d9['label']=hs(this['locale'],'AI_REVIEW_MODE_CHECK_STATUS_ACCEPTED'),_0x3340d9['icon']=_0x474e29);}),_0x3340d9;}['_createDismissButtonView'](){const _0xd0370=new Nt(this['locale']);return _0xd0370['set']({'label':hs(this['locale'],'AI_REVIEW_MODE_DISMISS_CHANGE'),'withText':!0x0}),_0xd0370['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x4f7b15=>{this['fire']('dismissChange',{'id':this['changeId']}),_0x4f7b15['stopPropagation']();})},'attributes':{'class':[us,this['bindTemplate']['if']('status','ck-hidden',_0x293238=>'pending'!==_0x293238&&'rejected'!==_0x293238),this['bindTemplate']['if']('status','ck-ai_review__check-run-result-dismiss-button',_0x4fee9c=>'pending'===_0x4fee9c),this['bindTemplate']['if']('status','ck-ai_review__check-run-result-status-button',_0x19bd3b=>'rejected'===_0x19bd3b)]}}),this['on']('change:status',(_0x5c8f5b,_0x7bf542,_0x10baac)=>{_0xd0370['isEnabled']='pending'===_0x10baac,'rejected'===_0x10baac&&(_0xd0370['label']=hs(this['locale'],'AI_REVIEW_MODE_CHECK_STATUS_REJECTED'),_0xd0370['icon']=_0x30d60c);}),_0xd0370;}['_createInfoButtonView'](){const _0x4d355e=new Nt(this['locale']);return _0x4d355e['set']({'label':hs(this['locale'],'AI_REVIEW_MODE_LEARN_MORE'),'icon':_0x5c9dab,'tooltip':!0x0,'isToggleable':!0x0,'role':'menuitemcheckbox','class':us+'\x20ck-ai_review__check-run-result-info-button\x20ck-hidden'}),_0x4d355e['bind']('isOn')['to'](this,'isInfoToggleOn',_0x192ab2=>_0x192ab2),_0x4d355e['on']('execute',()=>{this['isInfoToggleOn']=!this['isInfoToggleOn'];}),_0x4d355e;}['_createOutdatedButtonView'](){const _0x1c6732=new Nt(this['locale']);return _0x1c6732['set']({'label':hs(this['locale'],'AI_REVIEW_MODE_CHECK_STATUS_OUTDATED'),'icon':it,'withText':!0x0,'isEnabled':!0x1}),_0x1c6732['extendTemplate']({'attributes':{'class':[us,'ck-ai_review__check-run-result-status-button',this['bindTemplate']['if']('status','ck-hidden',_0x40b164=>'outdated'!==_0x40b164)],'disabled':'disabled'}}),_0x1c6732;}}class sa extends Xt{['resultItemView'];['_pinnedRectIndex']=void 0x0;['_pinnedTargetElement']=void 0x0;['_pinnedTargetChangeId']=void 0x0;constructor(_0x1f71e9,_0x55af2d){super(_0x1f71e9),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']()),_0x55af2d['add'](this);}['render'](){super['render'](),this['_setupClickOutsideHandler']();}['updateContent'](_0x592530){this['resultItemView']['changeId']=_0x592530['id'],this['resultItemView']['resultResponseView']['element']['innerHTML']=_0x592530['contentDiffed'];}['showBalloon'](_0x277051,_0x4b10f1,_0x35a005,_0x36330d,_0x25c9b,_0x5c6e0b){const _0x18e869=_0x4b10f1();if(!_0x18e869)return;this['updateContent'](_0x277051),this['show']();const _0x138c26=Array['from'](_0x18e869['getClientRects']())['reverse'](),_0x13764d=this['_getPointedRectIndexFromEvent'](_0x35a005,_0x138c26),_0x67bae2=_0x138c26[_0x13764d??0x0];'click'===_0x36330d?(this['isDiffActive']=!0x0,this['pin']({'target':()=>this['_getBestRectPositionOnClick'](_0x4b10f1(),_0x13764d,_0x277051['id'],_0x25c9b,_0x5c6e0b)||_0x67bae2})):'hover'===_0x36330d&&(this['isDiffActive']=!0x1,this['pin']({'target':()=>this['_getBestRectPositionOnHover'](_0x4b10f1(),_0x13764d,_0x277051['id'])||_0x67bae2}));}['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 _0x436482=[this['element']];return this['_pinnedTargetElement']&&_0x436482['push'](this['_pinnedTargetElement']),_0x436482;},'callback':()=>{this['hide'](),this['unpin'](),this['deactivateChange'](),this['_pinnedTargetElement']=void 0x0,this['_pinnedRectIndex']=void 0x0,this['_pinnedTargetChangeId']=void 0x0;}});}['_createContentView'](){const _0x9dc749=new vt();return this['resultItemView']=new ia(this['locale'],''),this['resultItemView']['resultResponseView']['extendTemplate']({'attributes':{'class':['ck-content']}}),this['resultItemView']['delegate']('acceptChange','dismissChange')['to'](this),_0x9dc749['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']]}]}),_0x9dc749;}['_getBestRectPositionOnClick'](_0x135b65,_0x154e5d,_0x155c7b,_0x3129c5,_0x32b333){if(!_0x135b65)return null;const _0x5d053e=this['position']['replace']('arrow_',''),_0x2d25f5=Array['from'](_0x135b65['getClientRects']());let _0x529665,_0x5053ff=_0x2d25f5['reverse']();return void 0x0!==_0x154e5d&&this['_isPinnedRectVisible'](_0x5053ff[_0x154e5d],_0x3129c5,_0x32b333)?(_0x529665=_0x5053ff[_0x154e5d],this['_pinnedRectIndex']=_0x154e5d):this['_isPinnedRectVisible'](_0x5053ff[0x0],_0x3129c5,_0x32b333)&&void 0x0===_0x154e5d?_0x529665=_0x5053ff[0x0]:(_0x5053ff='s'==_0x5d053e[0x0]?[..._0x2d25f5]['reverse']():_0x2d25f5,_0x5053ff['forEach'](_0x452ecc=>{this['_isPinnedRectVisible'](_0x452ecc,_0x3129c5,_0x32b333)&&(_0x529665=_0x452ecc);})),this['_pinnedTargetChangeId']=_0x155c7b,this['_pinnedTargetElement']=_0x135b65,_0x529665||_0x135b65['getBoundingClientRect']();}['_getBestRectPositionOnHover'](_0x4eb577,_0xebcb29,_0x26992d){if(!_0x4eb577)return null;const _0x1d4db7=Array['from'](_0x4eb577['getClientRects']())['reverse']();if(void 0x0===this['_pinnedRectIndex']&&void 0x0!==_0xebcb29&&this['_pinnedTargetChangeId']!==_0x26992d)return this['_pinnedRectIndex']=_0xebcb29,this['_pinnedTargetElement']=_0x4eb577,this['_pinnedTargetChangeId']=_0x26992d,_0x1d4db7[_0xebcb29];if(void 0x0!==this['_pinnedRectIndex']&&this['_pinnedTargetChangeId']===_0x26992d){if(_0x4eb577!==this['_pinnedTargetElement'])return Array['from'](this['_pinnedTargetElement']['getClientRects']())['reverse']()[this['_pinnedRectIndex']];return _0x1d4db7[this['_pinnedRectIndex']];}return void 0x0!==_0xebcb29&&this['_pinnedTargetChangeId']!==_0x26992d?(this['_pinnedRectIndex']=_0xebcb29,this['_pinnedTargetElement']=_0x4eb577,this['_pinnedTargetChangeId']=_0x26992d,_0x1d4db7[_0xebcb29]):_0x4eb577['getBoundingClientRect']();}['_getPointedRectIndexFromEvent'](_0x410b83,_0x5b344c){if(_0x410b83)for(let _0x1b50ce=0x0;_0x1b50ce<_0x5b344c['length'];_0x1b50ce++){const _0x24b0a5=_0x5b344c[_0x1b50ce];if(_0x410b83['clientX']>=_0x24b0a5['left']-0x3&&_0x410b83['clientX']<=_0x24b0a5['right']+0x3&&_0x410b83['clientY']>=_0x24b0a5['top']-0x3&&_0x410b83['clientY']<=_0x24b0a5['bottom']+0x3)return _0x1b50ce;}}['_isPinnedRectVisible'](_0x5d3e6c,_0x4a922f,_0x272636){const _0x4393a0=new ut(_0x5d3e6c),_0x190928=_0x4a922f||document['documentElement'],_0x37e4bc=_0x4393a0['getIntersection'](Rt(_0x272636)),_0x2b5d2f=new ut(_0x190928)['getIntersection'](_0x4393a0);return!!(_0x37e4bc&&_0x2b5d2f&&_0x4393a0['width']>0x0);}}const na=['getReviewCheckList','runReviewCheck','abortReviewStream','toggleDiff','acceptAllChanges','leaveReviewCoreResultList','activateChange','deactivateChange','acceptChange','dismissChange','learnMore','finishReview','retryReview'];class ra extends _0x1c4723{['_mainView'];['_balloonSuggestionView'];['_bodyCollection'];static get['requires'](){return[os];}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x452851){super(_0x452851),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 _0x314fd0=this['context']['plugins']['get']('AITabs');this['registerTab'](_0x314fd0);}['destroy'](){this['_bodyCollection']['detachFromDom'](),super['destroy']();}['setAvailableChecks'](_0x296205){if(!this['_mainView']['reviewCheckListView']['hasChecks']()){const _0x23577f=!this['context']['config']['get']('ai.models.showModelSelector');this['_mainView']['reviewCheckListView']['setChecks'](_0x296205,_0x23577f);}this['_mainView']['showReviewCheckListView']();}['showReviewCheckList'](){this['fire']('getReviewCheckList');}['showCheckRunResults'](_0x1a917a){_0x1a917a&&('error-general'!==_0x1a917a['status']?'error-chunk'!==_0x1a917a['status']?this['_mainView']['showReviewCheckResultsView']():this['showChunkErrorView']():this['showGeneralResultsErrorView']());}['showCheckRunResult'](_0x4a06e9){this['_mainView']['addCheckRunResult'](_0x4a06e9);}['showGeneralResultsErrorView'](){this['_mainView']['showGeneralResultsErrorView']();}['showGeneralReviewCoreErrorView'](_0x55bf84){this['_mainView']['showGeneralReviewCoreErrorView'](_0x55bf84??hs(this['context']['locale'],'AI_REVIEW_INITIALIZATION_ERROR_MESSAGE'));}['showChunkErrorView'](){this['_mainView']['showChunkErrorView']();}['setCheckResultTitle'](_0x4a319c,_0x1ca92a){this['_mainView']['reviewCheckResultsView']['setTitle'](_0x4a319c,_0x1ca92a);}['setActiveStateInResults'](_0x508c29){this['_mainView']['reviewCheckResultsView']['getResults']()['forEach'](_0x1222d8=>{_0x1222d8['id']===_0x508c29&&_0x1222d8['setItemAsActive']();});}['resetActiveStateInResults'](){this['_mainView']['reviewCheckResultsView']['getResults']()['forEach'](_0x5027c6=>_0x5027c6['setItemAsInactive']());}['updateChangeState'](_0x45f29e,_0x1273c5){'accepted'===_0x1273c5||'rejected'===_0x1273c5||'outdated'===_0x1273c5?this['_mainView']['reviewCheckResultsView']['hideResult'](_0x45f29e,_0x1273c5):this['_mainView']['reviewCheckResultsView']['showResult'](_0x45f29e,_0x1273c5);}['showReviewCompletedView'](){this['_mainView']['showReviewCompletedView']();}['showActionsWhenResultIsReady'](){this['_mainView']['showActionsWhenResultIsReady']();}['showNoChangesView'](){this['_mainView']['showNoChangesView']();}['hideActionsWhenResultIsReady'](){this['_mainView']['hideActionsWhenResultIsReady']();}['showChangeBalloon'](_0x16c7aa,_0x57c287,_0x20c3f8,_0x517aa1,_0x564e2f,_0x336390){this['_balloonSuggestionView']['showBalloon'](_0x16c7aa,_0x57c287,_0x20c3f8,_0x517aa1,_0x564e2f,_0x336390);}['hideChangeBalloon'](){this['_balloonSuggestionView']['hideBalloon']();}['hideDiffInBalloon'](){this['_balloonSuggestionView']['hideDiffInBalloon']();}['showDiffInBalloon'](){this['_balloonSuggestionView']['showDiffInBalloon']();}['getChangeElement'](_0x9d5ef2){const _0x5bfafa=this['_mainView']['reviewCheckResultsView']['getResults']()['find'](_0x1c1466=>_0x1c1466['id']===_0x9d5ef2);return _0x5bfafa?_0x5bfafa['element']:null;}['deactivateChange'](){this['_balloonSuggestionView']['deactivateChange']();}}class oa extends vt{constructor(_0x3b42c0){super(_0x3b42c0),this['set']('isVisible',!0x1),this['set']('errorMessage','');const _0x4960a6=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai_review__general-error-container',_0x4960a6['if']('isVisible','ck-hidden',_0xbdf19a=>!_0xbdf19a)]},'children':[{'tag':'p','attributes':{'class':'ck\x20ck-ai-notification\x20ck-ai-notification_error'},'children':[{'text':_0x4960a6['to']('errorMessage')}]}]});}}class aa extends vt{['reviewCoreHeader'];['generalErrorView'];['reviewCheckListView'];['reviewCheckResultsView'];['reviewCompletedView'];constructor(_0x28ca1e,_0x44570d){super(_0x28ca1e),this['reviewCoreHeader']=_0x44570d['header'],this['generalErrorView']=new oa(_0x28ca1e),this['reviewCheckListView']=_0x44570d['list'],this['reviewCheckListView']['delegate'](...na)['to'](this),this['reviewCheckResultsView']=_0x44570d['results'],this['reviewCheckResultsView']['delegate'](...na)['to'](this),this['reviewCompletedView']=_0x44570d['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'](_0x417ff7){this['reviewCheckResultsView']['addResult'](_0x417ff7),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'](_0x1236a8){this['generalErrorView']['set']('isVisible',!0x0),this['generalErrorView']['errorMessage']=_0x1236a8;}['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(_0x25ea6e,_0x4298eb){super(_0x4298eb),this['set']({'label':_0x25ea6e,'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(_0x3b421c,_0x535487){super(_0x3b421c),this['_contents']=_0x535487,this['_resultViews']=new _0x473e27(),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(_0x3b421c),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 _0x102ea0=this['_createCombinedSkeletonLoader'](),_0x36ba9a=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-run',_0x36ba9a['if']('isLoading','ck-ai_review__check-run_loading',_0x5a110f=>_0x5a110f),_0x36ba9a['if']('isResultReady','ck-ai_review__check-run_ready',_0x177042=>_0x177042),_0x36ba9a['if']('isVisible','ck-hidden',_0x53554d=>!_0x53554d)]},'children':[this['_resultsHeader'],this['_errorMessageView'],this['_resultsBody'],_0x102ea0,this['reviewDisclaimer']]});}['clearResults'](){this['_resultViews']['clear'](),this['_resultsBody']['element']&&(this['_resultsBody']['element']['scrollTop']=0x0);}['getResults'](){return this['_resultViews'];}['addResult'](_0x9aa547){const _0x4274cb=new ia(this['locale'],_0x9aa547['id']);_0x4274cb['delegate']('acceptChange','dismissChange','activateChange','deactivateChange')['to'](this),this['_resultViews']['add'](_0x4274cb),_0x4274cb['resultResponseView']['element']['innerHTML']=_0x9aa547['contentDiffed'];}['hideResult'](_0x169479,_0x124854){if('pending'===_0x124854)return;const _0x4803ad=this['_resultViews']['find'](_0x2e5342=>_0x2e5342['id']===_0x169479);_0x4803ad&&(_0x4803ad['status']=_0x124854,_0x4803ad['element']?.['classList']['add']('ck-ai_review__check-run-result_grayout'));}['showResult'](_0x4df0f6,_0x525c76){if('pending'!==_0x525c76)return;const _0x1c903e=this['_resultViews']['find'](_0x20a347=>_0x20a347['id']===_0x4df0f6);_0x1c903e&&(_0x1c903e['status']=_0x525c76,_0x1c903e['element']?.['classList']['remove']('ck-ai_review__check-run-result_grayout'));}['setTitle'](_0x1ff0d3,_0xdd548a){this['headerTitle']=_0x1ff0d3,this['headerSubtitle']=_0xdd548a||'';}['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 _0x373924=new vt(this['locale']),_0x5dcb47=[];for(let _0x287cfe=0x0;_0x287cfe<0x10;_0x287cfe++){const _0x547443=this['_createSkeletonLoader']();_0x547443['extendTemplate']({'attributes':{'class':['ck-ai_review__check-run-skeleton-item']}}),_0x5dcb47['push'](_0x547443);}return _0x373924['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-run-skeleton-container',this['bindTemplate']['if']('isLoading','ck-hidden',_0x102c7d=>!_0x102c7d)]},'children':_0x5dcb47}),_0x373924;}['_createResultsBodyView'](){const _0x5cc079=new vt(this['locale']);return _0x5cc079['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-run-results-container','ck-reset_all-excluded',this['bindTemplate']['if']('isLoading','ck-hidden',_0xf72145=>_0xf72145)]},'children':this['_resultViews']}),_0x5cc079;}['_createErrorView'](){const _0x5cc02f=new vt(this['locale']),_0x1ca153=new Nt(this['locale']),t=this['locale']['t'];return _0x5cc02f['delegate']('retryReview')['to'](this),_0x1ca153['set']({'label':t('Try\x20again'),'withText':!0x0,'class':ls+'\x20ck-ai_review__check-run-error-retry-button'}),_0x1ca153['on']('execute',()=>{this['fire']('retryReview');}),_0x5cc02f['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-run-error-container',this['bindTemplate']['if']('showErrorMessage','ck-hidden',_0x5e0431=>!_0x5e0431),this['bindTemplate']['if']('errorType','ck-ai_review__check-run-error-container_border-bottom',_0x2389a6=>'chunk'===_0x2389a6)]},'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',_0x5288f0=>'chunk'===_0x5288f0)]},'children':[{'tag':'p','attributes':{'class':['ck-ai-notification__content',this['bindTemplate']['if']('errorType','ck-hidden',_0x1c7e3d=>'general'!==_0x1c7e3d)]},'children':[{'text':this['_contents']['generalErrorText']}]},{'tag':'p','attributes':{'class':['ck-ai-notification__content',this['bindTemplate']['if']('errorType','ck-hidden',_0x471da6=>'chunk'!==_0x471da6)]},'children':[{'text':hs(this['locale'],'AI_REVIEW_MODE_CHUNK_ERROR_MESSAGE')}]}]},_0x1ca153]}),_0x5cc02f;}['_createCancelButtonView'](){const _0x4307b8=new Nt(this['locale']);return _0x4307b8['set']({'label':hs(this['locale'],'AI_REVIEW_MODE_STOP_GENERATING'),'withText':!0x0,'class':[ls+'\x20ck-ai-button-stop-generating'],'icon':_0x3e5a33}),_0x4307b8['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isResultReady','ck-hidden',_0x497593=>_0x497593),this['bindTemplate']['if']('isCompleted','ck-hidden',_0x4ba661=>_0x4ba661)]}}),_0x4307b8['on']('execute',()=>{this['fire']('abortReviewStream');}),_0x4307b8;}['_createToggleDiffButtonView'](){const _0x5b590b=new Nt(this['locale']);_0x5b590b['set']({'tooltip':!0x0,'isToggleable':!0x0,'role':'menuitemcheckbox'}),_0x5b590b['bind']('isEnabled')['to'](this,'isError',_0x20191f=>!_0x20191f),_0x5b590b['extendTemplate']({'attributes':{'class':[ls,'ck-ai_review__check-run-toggle-diff-button',this['bindTemplate']['if']('isResultReady','ck-hidden',_0x3068a5=>!_0x3068a5),this['bindTemplate']['if']('isCompleted','ck-hidden',_0x2d194e=>_0x2d194e)]}});const _0x3c0ad3=hs(this['locale'],'AI_REVIEW_MODE_HIDE_CHANGES'),_0x16461d=hs(this['locale'],'AI_REVIEW_MODE_SHOW_CHANGES');return _0x5b590b['bind']('isOn')['to'](this,'isToggleDiffOn',_0x4633ae=>_0x4633ae),_0x5b590b['bind']('icon')['to'](this,'isToggleDiffOn',_0x4adbe6=>_0x4adbe6?st:nt),_0x5b590b['bind']('label')['to'](this,'isToggleDiffOn',_0x29e8e1=>_0x29e8e1?_0x3c0ad3:_0x16461d),_0x5b590b['on']('execute',()=>{this['isToggleDiffOn']=!this['isToggleDiffOn'],this['fire']('toggleDiff',{'on':this['isToggleDiffOn']});}),_0x5b590b;}['_createAcceptAllButtonView'](){const _0x102dec=new Nt(this['locale']);return _0x102dec['set']({'label':hs(this['locale'],'AI_REVIEW_MODE_ACCEPT_ALL'),'withText':!0x0}),_0x102dec['bind']('isEnabled')['to'](this,'isError',_0x1bafb9=>!_0x1bafb9),_0x102dec['extendTemplate']({'attributes':{'class':[cs,'ck-ai_review__check-run-accept-all-button',this['bindTemplate']['if']('isResultReady','ck-hidden',_0x4091a6=>!_0x4091a6),this['bindTemplate']['if']('isCompleted','ck-hidden',_0x48c36b=>_0x48c36b)]}}),_0x102dec['on']('execute',()=>{this['fire']('acceptAllChanges');}),_0x102dec;}['_createExitReviewButtonView'](){const _0x49f9e6=new Nt(this['locale']);return _0x49f9e6['set']({'label':hs(this['locale'],'AI_REVIEW_MODE_EXIT_REVIEW'),'withText':!0x0}),_0x49f9e6['extendTemplate']({'attributes':{'class':[us,'ck-ai_review__check-run-exit-button',this['bindTemplate']['if']('isResultReady','ck-hidden',_0x5e745d=>!_0x5e745d),this['bindTemplate']['if']('isCompleted','ck-hidden',_0x34b632=>_0x34b632)]}}),_0x49f9e6['on']('execute',()=>{this['fire']('leaveReviewCoreResultList');}),_0x49f9e6;}['_createResultHeaderView'](){const _0x4a729a=new vt(this['locale']),_0x42e4af=this['_createTitleView']();return _0x4a729a['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-run-results-header',this['bindTemplate']['if']('isCompleted','ck-ai_review__review-completed-header',_0x1083f6=>_0x1083f6)]},'children':[_0x42e4af,{'tag':'div','attributes':{'class':['ck-ai_review__check-run-results-header-buttons']},'children':[this['_cancelButtonView'],this['_acceptAllButtonView'],this['_exitReviewButtonView'],this['_toggleDiffButtonView'],this['_finishReviewButtonView']]}]}),_0x4a729a;}['_createTitleView'](){const _0x8e0098=new vt(this['locale']),_0x17a3ce=new yn();return _0x17a3ce['bind']('isVisible')['to'](this,'isResultReady',_0x2418ca=>!_0x2418ca),_0x8e0098['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-run-results-header-title-wrapper']},'children':[_0x17a3ce,{'tag':'div','attributes':{'class':['ck-ai_review__check-run-results-header-title-content',this['bindTemplate']['if']('isCompleted','ck-hidden',_0x55c62b=>_0x55c62b)]},'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',_0x9e1794=>!_0x9e1794)]},'children':[{'text':hs(this['locale'],'AI_REVIEW_MODE_FINISH_REVIEW_HEADER_TITLE')}]}]}),_0x8e0098;}['_createFinishReviewButtonView'](){const _0x33fdb0=new ha(hs(this['locale'],'AI_REVIEW_MODE_FINISH_REVIEW_BUTTON_LABEL'),this['locale']);return _0x33fdb0['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isCompleted','ck-hidden',_0x5b164a=>!_0x5b164a)]}}),_0x33fdb0['delegate']('finishReview')['to'](this),_0x33fdb0;}}class la extends Ht{['_resultsHeader'];['_finishReviewButtonView'];constructor(_0x5a6d44,_0x2d07a5){super(_0x5a6d44),this['_finishReviewButtonView']=this['_createFinishReviewButtonView'](_0x2d07a5['buttonText']),this['_resultsHeader']=this['_createResultHeaderView'](_0x2d07a5['headerText']);const _0x3cffe9=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__review-completed',_0x3cffe9['if']('isVisible','ck-hidden',_0x5790f6=>!_0x5790f6)]},'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':_0x2d07a5['emptyResultsText']}]}]}]});}['_createFinishReviewButtonView'](_0x20efc9){const _0x4f9c64=new ha(_0x20efc9,this['locale']);return _0x4f9c64['delegate']('finishReview')['to'](this),_0x4f9c64;}['_createResultHeaderView'](_0x59b37c){const _0x26af23=new vt(this['locale']);return _0x26af23['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':_0x59b37c}]},{'tag':'div','attributes':{'class':['ck-ai_review__review-completed-header-buttons']},'children':[this['_finishReviewButtonView']]}]}),_0x26af23;}}class ua extends vt{['_dropdownView'];['_defaultValue'];['_defaultLabel'];constructor(_0x146504,_0x18063e){super(_0x146504),this['_defaultValue']=_0x18063e['default']||(_0x18063e['data']['length']>0x0?_0x18063e['data'][0x0]['id']:''),this['_defaultLabel']=_0x18063e['data']['find'](_0x52e0ef=>_0x52e0ef['id']===this['_defaultValue'])?.['label']||'',this['set']('formValue',''),this['_dropdownView']=Gt(this['locale']);const _0x2971d0=this['_prepareListOptions'](_0x18063e['data']);jt(this['_dropdownView'],_0x2971d0,{'role':'menu','ariaLabel':_0x18063e['label']}),this['_dropdownView']['buttonView']['set']({'label':this['_defaultLabel'],'withText':!0x0}),this['_dropdownView']['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x195b91=>{_0x195b91['stopPropagation']();})}}),this['listenTo'](this['_dropdownView'],'execute',_0x4eea6f=>{this['formValue']=_0x4eea6f['source']['model']['id'],this['_dropdownView']['buttonView']['label']=_0x4eea6f['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'](_0x23da98=[]){const _0x376a92=new dt();this['resetToDefault']();for(const _0x54be32 of _0x23da98){const _0xc3613f=new Jt({'label':_0x54be32['label'],'withText':!0x0,'role':'menuitemradio','id':_0x54be32['id'],'model':_0x54be32});_0xc3613f['bind']('isOn')['to'](this,'formValue',_0x8bf69b=>_0x8bf69b===_0xc3613f['id']);const _0x16d84e={'type':'button','model':_0xc3613f};_0x376a92['add'](_0x16d84e);}return _0x376a92;}}class da extends Ht{['_formItem']=null;constructor(_0x19565d,_0x493cd5,_0x3a2605){super(_0x19565d),this['argsKey']=_0x493cd5?.['argsKey'];if('dropdown'===_0x493cd5['formType'])this['_formItem']=new ua(this['locale'],_0x493cd5);this['set']('value',''),this['bind']('value')['to'](this['_formItem'],'formValue');const _0xff2946=new _0x9f9ba4(this['locale'],{'children':[this['_formItem']],'class':[_0x3a2605?'ck-form__row_with-submit':'']});_0x3a2605&&_0xff2946['children']['add'](_0x3a2605),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai_review__form-item','ck-reset_all']},'children':[_0xff2946]});}['resetToDefault'](){this['_formItem']['resetToDefault']();}}class _a extends _0x2327a7{['keystrokes'];static ['MIN_ROWS']=0x1;static ['MAX_ROWS']=0xc;constructor(_0x3ebebf){super(_0x3ebebf),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 _0x473e27();['submitButtonView'];['cancelButtonView'];['promptInputView'];['actionsFooterView'];['_modelSelectionDropdown'];['_modelNameView'];['_modelSelectionDropdownItems'];['_check'];['_defaultValue'];['_defaultLabel'];constructor(_0x5eb286,_0x72bbca,_0xe8b2e2=!0x1){super(_0x5eb286),this['_check']=_0x72bbca,this['set']('prompt',''),this['set']('modelId',''),this['set']('modelDisplayMode','selector'),this['set']('activeModelName',null),this['_defaultValue']=_0x72bbca['defaultModel']?_0x72bbca['defaultModel']['id']:'',this['_defaultLabel']=_0x72bbca['defaultModel']?_0x72bbca['defaultModel']['name']:'',this['submitButtonView']=this['_createSubmitButtonView'](),this['cancelButtonView']=this['_createCancelButtonView'](),(this['promptInputView']=new te(this['locale'],()=>new _a(_0x5eb286)),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'](_0xe8b2e2),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 _0x9f9ba4(this['locale'],{'children':[this['promptInputView']]}),new _0x9f9ba4(this['locale'],{'children':[this['actionsFooterView']]})]}),this['promptInputView']['fieldView']['keystrokes']['set']('Enter',(_0x3e4b6d,_0x14cce9)=>{this['_isValid']()?(this['fire']('runReviewCheck',{'id':'custom','args':{'prompt':this['prompt'],'model':this['modelId']},'isCustom':!0x0}),_0x14cce9()):_0x14cce9();}),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'](_0x5eeff=>{this['_focusables']['add'](_0x5eeff),this['focusTracker']['add'](_0x5eeff['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 _0x4af14c of this['_getFormValidators']()){const _0x2e00c4=_0x4af14c();if(_0x2e00c4)return this['promptInputView']['errorText']=_0x2e00c4,!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 _0x3650c4=new Nt(this['locale']),t=this['locale']['t'];return _0x3650c4['set']({'label':t('Submit'),'withText':!0x0,'class':cs}),_0x3650c4['on']('execute',()=>{this['_isValid']()&&this['fire']('runReviewCheck',{'id':'custom','args':{'prompt':this['prompt'],'model':this['modelId']},'isCustom':!0x0});}),_0x3650c4;}['_createCancelButtonView'](){const _0x41320c=new Nt(this['locale']),t=this['locale']['t'];return _0x41320c['set']({'label':t('Cancel'),'withText':!0x0,'class':us}),_0x41320c['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x39683b=>{_0x39683b['stopPropagation']();})}}),_0x41320c['on']('execute',()=>{this['resetToDefault'](),this['fire']('closeCustomCheck');}),_0x41320c;}['_setModelList'](_0x430a2c){this['_modelSelectionDropdownItems']['clear']();const _0x558235=this['_check']['models'];if(_0x430a2c)this['set']('modelDisplayMode','hidden');else{const _0x2cf93f=0x1===_0x558235['length'];this['set']('modelDisplayMode',_0x2cf93f?'name':'selector');}if(this['resetToDefault'](),_0x558235?.['length']){0x1===_0x558235['length']&&this['set']('activeModelName',_0x558235[0x0]['name']||_0x558235[0x0]['id']);for(const _0x39a349 of _0x558235){const _0x2d04fe=new Jt({'label':_0x39a349['name'],'withText':!0x0,'role':'menuitemradio','id':_0x39a349['id'],'model':_0x39a349});_0x2d04fe['bind']('isOn')['to'](this,'modelId',_0x2498ab=>_0x2498ab===_0x39a349['id']),this['_modelSelectionDropdownItems']['add']({'type':'button','model':_0x2d04fe,'labelView':new Ia(this['locale'],_0x39a349)});}}}['_createModelSelectionDropdown'](){const _0x489fa4=Gt(this['locale']);return _0x489fa4['set']({'panelPosition':'se','class':'ck-ai_review__check-list-item-model-dropdown'}),_0x489fa4['buttonView']['set']({'label':this['_defaultLabel'],'withText':!0x0,'tooltip':!0x0,'class':us}),_0x489fa4['buttonView']['bind']('isVisible')['to'](this,'modelDisplayMode',_0x5b1906=>'selector'===_0x5b1906),this['listenTo'](_0x489fa4,'execute',_0x26402e=>{this['modelId']=_0x26402e['source']['model']['id'],_0x489fa4['buttonView']['label']=_0x26402e['source']['label'];}),_0x489fa4;}['_createModelNameView'](){const _0x1189a0=new Aa(this['locale']);return _0x1189a0['bind']('text')['to'](this,'activeModelName',_0x52179c=>_0x52179c??''),_0x1189a0['bind']('isVisible')['to'](this,'modelDisplayMode',_0x16588b=>'name'===_0x16588b),_0x1189a0;}['_createActionsFooterView'](){const _0x1bec09=new vt(this['locale']);return _0x1bec09['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']]}]}),_0x1bec09;}}class Aa extends vt{constructor(_0x55376d){super(_0x55376d),this['set']('text',void 0x0),this['set']('isVisible',!0x0);const _0x56011c=this['bindTemplate'];this['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai_review__check-list-item-model-name',_0x56011c['if']('isVisible','ck-hidden',_0x41983b=>!_0x41983b)]},'children':[{'text':_0x56011c['to']('text')}]});}}class Ia extends Mt{constructor(_0x418b77,_0x2adc67){super();const _0x5abaa1=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-button__label'],'style':_0x5abaa1['to']('style'),'id':_0x5abaa1['to']('id')},'children':[{'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-model-dropdown-name']},'children':[{'tag':'span','children':[{'text':_0x5abaa1['to']('text')}]}]},{'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-model-dropdown-description']},'children':[{'tag':'span','children':[_0x2adc67['description']||'']}]}]});}}class Ea extends Ht{['_formItemsCollection']=new _0x473e27();['_customCheckView']=null;['_hideModels']=!0x1;constructor(_0x4662ad,_0x1b0f50,_0x257ed8,_0x10883f=!0x1){super(_0x4662ad),this['_hideModels']=_0x10883f,this['set']('isParametrizedViewOpen',!0x1),this['set']('isListItemRendered',!0x1),this['set']('isItemParametrized',_0x1b0f50['isParameterized']);const _0x3eb3a0=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',_0x267a56=>_0x267a56),this['bindTemplate']['if']('isListItemRendered','ck-ai_review__check-list-item_rendered',_0x431044=>_0x431044)],'style':{'--ck-ai-review-check-list-item-index':_0x257ed8}},'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':_0x1b0f50['title']}]},_0x3eb3a0]},{'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-description']},'children':_0x1b0f50['description']?[{'text':_0x1b0f50['description']}]:[]}]}]},..._0x1b0f50['isParameterized']?[this['_createParameterizedView'](_0x1b0f50)]:[],...'custom'===_0x1b0f50['id']?[this['_createCustomView'](_0x1b0f50,this['_hideModels'])]:[]]}),this['on']('click',()=>{_0x1b0f50['isParameterized']?this['isParametrizedViewOpen']=!0x0:this['fire']('runReviewCheck',{'id':_0x1b0f50['id'],'args':_0x1b0f50['useArgs']?_0x1b0f50['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'](_0x35e6f7=>{_0x35e6f7['resetToDefault']();}),this['_customCheckView']&&this['_customCheckView']['resetToDefault']();}['_createIconView'](){const _0x26adfb=new xt();return _0x26adfb['content']=rt,_0x26adfb['extendTemplate']({'attributes':{'class':['ck-ai_review__check-list-item-title-icon']}}),_0x26adfb;}['_createParameterizedView'](_0x1e7890){const _0x279a10=new vt(),_0x59b64f=this['_createFormView'](_0x1e7890);return _0x279a10['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-parameterized',this['bindTemplate']['if']('isParametrizedViewOpen','ck-hidden',_0x462b32=>!_0x462b32)]},'children':[_0x59b64f]}),_0x279a10;}['_createFormView'](_0x1ee05e){const _0x2dc647=new vt(),_0x5ec3d8=Array['isArray'](_0x1ee05e['options'])?_0x1ee05e['options']:[],_0x490e55=new Nt(this['locale']),t=this['locale']['t'];_0x490e55['set']({'label':t('Submit'),'withText':!0x0,'class':cs}),_0x490e55['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x41217b=>{_0x41217b['stopPropagation']();})}}),_0x490e55['on']('execute',()=>{const _0x570e5a=[],_0x357e4e={};this['_formItemsCollection']['forEach'](_0x2f243d=>{_0x570e5a['push'](_0x2f243d['value']),_0x1ee05e['useArgs']&&_0x1ee05e['options']&&(_0x357e4e[_0x2f243d['argsKey']]=_0x2f243d['value']);}),this['fire']('runReviewCheck',{'id':_0x1ee05e['id'],'params':_0x570e5a['length']?_0x570e5a:void 0x0,'args':Object['keys'](_0x357e4e)['length']?_0x357e4e:void 0x0});});const _0x55da8a=_0x5ec3d8['length'];return _0x5ec3d8['forEach']((_0x36c9ed,_0x265558)=>{const _0x1d7960=_0x265558===_0x55da8a-0x1;this['_formItemsCollection']['add'](new da(this['locale'],_0x36c9ed,_0x1d7960?_0x490e55:null));}),_0x2dc647['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-parameterized-form']},'children':this['_formItemsCollection']}),_0x2dc647;}['_createCustomView'](_0x133612,_0x546925=!0x1){return this['_customCheckView']=new ga(this['locale'],_0x133612,_0x546925),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',_0x1c9be8=>!_0x1c9be8)]}}),this['_customCheckView']['delegate']('runReviewCheck')['to'](this),this['listenTo'](this['_customCheckView'],'closeCustomCheck',()=>{this['isParametrizedViewOpen']=!0x1;}),this['on']('change:isParametrizedViewOpen',(_0x392a7a,_0x1f53c0,_0x4b2d1b)=>{_0x4b2d1b||this['_customCheckView']['resetFormValidationStatus']();}),this['_customCheckView'];}}class pa extends Ht{['_checkViews'];constructor(_0x590a1b){super(_0x590a1b),this['_checkViews']=new _0x473e27(),this['_setupTemplate']();}['setChecks'](_0x54491f,_0x26f780=!0x1){this['_checkViews']['clear']();for(const [_0x4462da,_0x3b1b1a]of _0x54491f['entries']()){const _0x1d9a87=new Ea(this['locale'],_0x3b1b1a,_0x4462da,_0x26f780);_0x1d9a87['delegate']('runReviewCheck')['to'](this),this['_checkViews']['add'](_0x1d9a87);}}['hasChecks'](){return this['_checkViews']['length']>0x0;}['resetAllParameterizedChecks'](){for(const _0x43818c of this['_checkViews'])_0x43818c instanceof Ea&&_0x43818c['resetToDefault']();}['_setupTemplate'](){const _0x2ca862=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-list',_0x2ca862['if']('isVisible','ck-hidden',_0x26188b=>!_0x26188b)]},'children':this['_checkViews']});}}class ma extends ra{static get['pluginName'](){return'AIReviewModeUI';}['createMainView'](){const _0x37b51c=this['context']['plugins']['get']('AITabs'),_0xde616a=this['context']['locale'],_0x2d4f60=new eo(_0xde616a,{'label':hs(_0xde616a,'AI_REVIEW_MODE'),'icon':_0x48c8b8,'class':'ck-ai-header_review','showResizeButton':_0x37b51c['showResizeButton']});return _0x2d4f60['delegate']('resizeTabs')['to'](_0x37b51c),_0x2d4f60['bind']('isMaximized')['to'](_0x37b51c['view'],'isMaximized',_0x3d3991=>_0x3d3991),new aa(this['context']['locale'],{'header':_0x2d4f60,'list':new pa(_0xde616a),'results':new ca(_0xde616a,{'generalErrorText':hs(_0xde616a,'AI_REVIEW_MODE_GENERAL_ERROR_MESSAGE')}),'completed':new la(_0xde616a,{'headerText':hs(_0xde616a,'AI_REVIEW_MODE_FINISH_REVIEW_HEADER_TITLE'),'emptyResultsText':hs(_0xde616a,'AI_REVIEW_MODE_EMPTY_RESULTS_TEXT'),'buttonText':hs(_0xde616a,'AI_REVIEW_MODE_FINISH_REVIEW_BUTTON_LABEL')})});}['registerTab'](){const _0x9cad55=this['context']['plugins']['get']('AITabs');_0x9cad55['view']['on']('activateTab',(_0x478275,{newTab:_0x2372ed,oldTab:_0x36a7f5})=>{'reviewMode'===_0x2372ed?this['fire']('getReviewCheckList'):'reviewMode'===_0x36a7f5&&this['fire']('leaveReview');}),_0x9cad55['view']['addTab']({'id':'reviewMode','buttonLabel':hs(this['context']['locale'],'AI_REVIEW_MODE'),'buttonIcon':_0x48c8b8,'order':0x0,'content':this['_mainView']});}}const Ta='review-',Ca=['softBreak'];class wa extends _0x1c4723{static get['requires'](){return[_0x510df7,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(_0xf0bd4c){super(_0xf0bd4c),this['_domEmitter']=new(Ot())(),this['_eventEmitter']=new(Tt())();}get['emitter'](){return this['_eventEmitter'];}['afterInit'](){const _0x5bc62d=_0x4baad9=>this['_scheduleAttachReviewEditingToEditor'](_0x4baad9);if(this['_registerGlobalBalloonBlurHandler'](),this['context']instanceof _0x597112)return void this['_attachReviewEditingToEditor'](this['context']);const _0x45462b=this['context'];for(const _0x4a94b9 of _0x45462b['editors'])_0x5bc62d(_0x4a94b9);this['listenTo'](_0x45462b['editors'],'add',(_0x9ef7e5,_0xc40634)=>{_0x5bc62d(_0xc40634);}),this['listenTo'](_0x45462b['editors'],'remove',(_0x4bb633,_0x60dcc5)=>{for(const [_0x1e55a8,_0x3a2d21]of this['_markers'])_0x3a2d21['editor']===_0x60dcc5&&(this['_eventEmitter']['fire']('changeMarkerRemoved',{'markerId':_0x1e55a8,'changeId':_0x3a2d21['groupId']}),this['_markers']['delete'](_0x1e55a8));});}['_scheduleAttachReviewEditingToEditor'](_0x7d5367){const _0x15f115=()=>{'destroyed'!==_0x7d5367['state']&&_0x7d5367['conversion']&&this['_attachReviewEditingToEditor'](_0x7d5367);};if('ready'===_0x7d5367['state'])return void _0x15f115();const _0x4790e5=()=>{this['stopListening'](_0x7d5367,'ready',_0x4790e5),_0x15f115();};this['listenTo'](_0x7d5367,'ready',_0x4790e5);}['_attachReviewEditingToEditor'](_0x3c9ab5){this['_reviewEditingAttachedEditors']['has'](_0x3c9ab5)||(_0x3c9ab5['conversion']['for']('editingDowncast')['markerToElement']({'model':Ta+'insert','view':(_0x327ed5,{writer:_0x240b2b})=>{const _0x1c8d70=this['_markers']['get'](_0x327ed5['markerName']),_0x3a130b={'class':'ck-ai_review-marker_add'+(this['_activeMarkers']['has'](_0x1c8d70?.['id']||'')?'\x20ck-ai_review__change_active':''),'data-marker-id':_0x327ed5['markerName']};return _0x240b2b['createUIElement']('span',_0x3a130b,function(_0x27a2e7){const _0x385187=this['toDomElement'](_0x27a2e7);return _0x385187['innerHTML']=_0x1c8d70?.['content']?.['asString']||'',_0x385187;});}}),_0x3c9ab5['conversion']['for']('editingDowncast')['markerToHighlight']({'model':Ta+'remove-only','view':_0x5eead7=>{const _0xe6e63e=this['_markers']['get'](_0x5eead7['markerName']),_0x38d8a7=['ck-ai_review-marker_strikethrough'];return this['_activeMarkers']['has'](_0xe6e63e?.['id']||'')&&_0x38d8a7['push']('ck-ai_review__change_active'),{'classes':_0x38d8a7,'attributes':{'data-marker-id':_0x5eead7['markerName']}};}}),_0x3c9ab5['conversion']['for']('editingDowncast')['markerToHighlight']({'model':Ta+'remove-context','view':_0xa32474=>{const _0x6471dc=this['_markers']['get'](_0xa32474['markerName']),_0x704b70=['ck-ai_review-marker_underline'];return this['_activeMarkers']['has'](_0x6471dc?.['id']||'')&&_0x704b70['push']('ck-ai_review__change_active'),{'classes':_0x704b70,'attributes':{'data-marker-id':_0xa32474['markerName']}};}}),_0x3c9ab5['conversion']['for']('editingDowncast')['markerToHighlight']({'model':Ta+'remove-text','view':_0xdee9ee=>{const _0x2e92fc=this['_markers']['get'](_0xdee9ee['markerName']),_0x2283f3=['ck-ai_review-marker_hide'];return this['_activeMarkers']['has'](_0x2e92fc?.['id']||'')&&_0x2283f3['push']('ck-ai_review__change_active'),{'classes':_0x2283f3,'attributes':{'data-marker-id':_0xdee9ee['markerName']}};}}),_0x3c9ab5['conversion']['for']('dataDowncast')['markerToElement']({'model':Ta+'suggestion-context','view':(_0xf33c33,{writer:_0x164151})=>_0x164151['createRawElement']('span',{'class':'ck-ai_review-marker_context-'+(_0xf33c33['isOpening']?'start':'end')})}),_0x3c9ab5['conversion']['for']('downcast')['attributeToAttribute']({'model':_0x503c11,'view':_0x54d4f0}),this['_updateMouseMarkerInteractionListeners'](_0x3c9ab5),this['listenTo'](_0x3c9ab5,'addRoot',()=>this['_updateMouseMarkerInteractionListeners'](_0x3c9ab5),{'priority':'lowest'}),this['listenTo'](_0x3c9ab5,'detachRoot',()=>this['_updateMouseMarkerInteractionListeners'](_0x3c9ab5),{'priority':'lowest'}),_0x3c9ab5['model']['document']['registerPostFixer'](_0x87365c=>this['_validateMarkers'](_0x3c9ab5,_0x87365c)),_0x3c9ab5['model']['document']['on']('change',()=>this['_handleMarkerChanges'](_0x3c9ab5)),this['_reviewEditingAttachedEditors']['add'](_0x3c9ab5));}['_updateMouseMarkerInteractionListeners'](_0x21e3a0){let _0x5a536b=this['_boundEditables']['get'](_0x21e3a0);_0x5a536b||(_0x5a536b=new Map(),this['_boundEditables']['set'](_0x21e3a0,_0x5a536b));const _0x4741dc=new Set(_0x21e3a0['ui']['getEditableElementsNames']());for(const _0x4f021e of _0x4741dc){if(_0x5a536b['has'](_0x4f021e))continue;const _0x1aabe4=_0x21e3a0['ui']['getEditableElement'](_0x4f021e);_0x5a536b['set'](_0x4f021e,_0x1aabe4),this['_attachMouseMarkerInteractionListeners'](_0x1aabe4);}for(const [_0x205f0a,_0x277140]of _0x5a536b)_0x4741dc['has'](_0x205f0a)||(_0x5a536b['delete'](_0x205f0a),this['_domEmitter']['stopListening'](_0x277140));}['_attachMouseMarkerInteractionListeners'](_0x46e57b){this['_domEmitter']['listenTo'](_0x46e57b,'mouseup',(_0x16721d,_0x4b3485)=>{const _0x55d658=_0x4b3485['target'],_0x410684=this['_findMarkerElement'](_0x55d658);if(!_0x410684)return;const _0x5de732=_0x410684['getAttribute']('data-marker-id'),_0x291ac8=_0x5de732['split'](':')['pop']()?.['split']('_')[0x0];this['_eventEmitter']['fire']('changeMarkerClicked',{'markerId':_0x5de732,'changeId':_0x291ac8,'markerElement':()=>this['_findMarkerElementById'](_0x5de732),'domEvent':_0x4b3485});},{'usePassive':!0x0,'priority':'highest'}),this['_domEmitter']['listenTo'](_0x46e57b,'mouseover',(_0x5be5fc,_0x4202eb)=>{const _0x436221=_0x4202eb['target'],_0x156e42=_0x4202eb['relatedTarget'];let _0x4b2fff=this['_findMarkerElement'](_0x436221);if(!_0x4b2fff&&_0x156e42&&(_0x4b2fff=this['_findMarkerElement'](_0x156e42)),!_0x4b2fff)return;const _0x2f0c1c=_0x4b2fff['getAttribute']('data-marker-id'),_0x173bf0=_0x2f0c1c['split'](':')['pop']()?.['split']('_')[0x0];this['_eventEmitter']['fire']('changeMarkerHovered',{'changeId':_0x173bf0,'markerElement':()=>this['_findMarkerElementById'](_0x2f0c1c),'domEvent':_0x4202eb});});}['_registerGlobalBalloonBlurHandler'](){this['_domEmitter']['listenTo'](document,'mouseover',_0x382bff((_0x33e4f0,_0x144539)=>{const _0x5a139c=_0x144539['target'];if(this['_findMarkerElement'](_0x5a139c))return;_0x5a139c['closest']('.ck-reset.ck-ai_review-balloon-panel-suggestion')||this['_eventEmitter']['fire']('changeMarkerBlurred');},0xc8));}['getDocumentData'](){const _0x3a88ad=this['context']['plugins']['get']('AIEditing'),_0x3566c1=Ws(this['context']);if(!_0x3566c1['length'])throw new at('ai-get-editor-from-context-no-editor',this);const _0xacb4d2=new Set(),_0x1bee5d=[],_0xfed98d=new Map();for(const _0x5df455 of _0x3566c1)for(const _0x48a3fd of _0x5df455['model']['document']['getRoots']()){if('$graveyard'===_0x48a3fd['rootName'])continue;const _0x5ad3c7=this['_buildDocumentDataSliceForRoot'](_0x5df455,_0x48a3fd,_0x3a88ad,_0xacb4d2);_0x1bee5d['push'](_0x5ad3c7['content']);for(const [_0x37800b,_0x1bb8b6]of _0x5ad3c7['elements'])_0xfed98d['set'](_0x37800b,_0x1bb8b6);}return{'elements':_0xfed98d,'content':_0x1bee5d['join']('')};}['_buildDocumentDataSliceForRoot'](_0x4e8624,_0x472eef,_0x4195fe,_0x2b3e64){const _0x4770ce=_0x4e8624['model'],_0x302583=new _0x3a3cd6();for(const _0x5bbe3d of _0x472eef['getChildren']())_0x302583['_appendChild'](_0x5bbe3d['_clone'](!0x0));for(const _0x383527 of _0x4770ce['markers']){const _0x3a5bfa=_0x383527['getRange']();_0x3a5bfa&&_0x3a5bfa['root']['rootName']===_0x472eef['rootName']&&_0x302583['markers']['set'](_0x383527['name'],this['_changeRangeOwnerDocument'](_0x3a5bfa['clone'](),_0x302583));}const _0x3d80e2=new Map(),_0x26db1f=_0x4770ce['document']['version'],_0x336747=new _0x441fd4({'ignoreElementEnd':!0x0,'startPosition':_0x4770ce['createPositionAt'](_0x302583,0x0)});for(const {item:_0x226b7a}of _0x336747){if(!_0x226b7a['is']('$textProxy'))continue;const _0x42f40c=_0x226b7a['parent'];if(!_0x42f40c||!_0x42f40c['is']('element'))continue;const _0x543e3f=this['_upsertDataId'](_0x42f40c,()=>_0x4195fe['_nextDataId'](_0x2b3e64));_0x2b3e64['add'](_0x543e3f);for(const _0x1428b0 of _0x42f40c['getChildren']())_0x1428b0['is']('element')&&(_0x1428b0['name']&&Ca['includes'](_0x1428b0['name'])||_0x2b3e64['add'](this['_upsertDataId'](_0x1428b0,()=>_0x4195fe['_nextDataId'](_0x2b3e64))));let _0x490716=_0x42f40c;for(;_0x490716['parent']&&!_0x490716['parent']['is']('documentFragment');)_0x490716=_0x490716['parent'],_0x490716['hasAttribute'](_0x503c11)&&_0x490716['_removeAttribute'](_0x503c11);_0x3d80e2['set'](_0x543e3f,{'editor':_0x4e8624,'rootName':_0x472eef['rootName'],'path':_0x42f40c['getPath'](),'documentVersion':_0x26db1f,'getContent':this['_createGetContentUsingDataIdFn'](_0x490716['_clone'](!0x0),_0x543e3f,_0x4e8624['data'])}),_0x336747['jumpTo'](_0x4770ce['createPositionAfter'](_0x42f40c));}return{'content':_0x4e8624['data']['processor']['toData'](_0x4e8624['data']['toView'](_0x302583)),'elements':_0x3d80e2};}['diffContent'](_0x479e9e,_0x43e255,_0x4647cb,_0x30fbf5=!0x1){const _0x5d5c8d=[],_0x40c545=_0x479e9e['data']['parse'](_0x4647cb,'$documentFragment'),_0x2533f8=_0x479e9e['data']['parse'](_0x43e255,'$documentFragment'),_0x56a8f1=_0x479e9e['model']['createPositionAt'](_0x2533f8,0x0);if(this['_haveSingleTopLevelElement'](_0x40c545)){if(!this['_hasSameTopLevelElement'](_0x2533f8,_0x40c545))return _0x5d5c8d;}else{const _0xece82=_0x479e9e['model']['schema'];if(!this['_haveOnlyInlineContent'](_0x2533f8,_0xece82)||!this['_haveOnlyInlineContent'](_0x40c545,_0xece82))return _0x5d5c8d;}const _0xb2f959=this['context']['plugins']['get']('DocumentCompare')['getDiff'](_0x43e255,_0x4647cb,{'targetEditor':_0x479e9e,'anchor':_0x56a8f1,'markDeletions':!0x0})['getOperations']()['filter'](_0x3ed0f8=>'insert'===_0x3ed0f8['type']||'marker'===_0x3ed0f8['type']&&_0x3ed0f8['name']['startsWith']('$markedRemove')),_0xf32622=this['_groupAdjacentOperations'](_0xb2f959),_0x58a05b=[];if(_0x30fbf5){if(_0xf32622['length']){const _0x56a69b=_0xf32622[0x0]['operations'][0x0],_0x5bcf65='insert'===_0x56a69b['type']?_0x56a69b['position']:_0x56a69b['newRange']['start'],_0x569961=this['_getPositionLimitingRange'](_0x5bcf65,_0x479e9e,'inside'),_0x4f0aad=_0x569961?_0x40c545['getChild'](0x0)['getChildren']():_0x40c545['getChildren'](),_0x3ada1d=_0x569961||_0x479e9e['model']['createRangeIn'](_0x2533f8),_0x1b683c=[new _0x2197a6('$markedRemove:synthetic'+ot(),null,_0x3ada1d,_0x479e9e['model']['document']['model']['markers'],!0x0,_0x479e9e['model']['document']['version']+0x1),new _0x286740(_0x3ada1d['end'],_0x4f0aad,_0x479e9e['model']['document']['version']+0x2)];_0x58a05b['push']({'operations':_0x1b683c,'operationsIsolated':_0x1b683c,'groupOffset':0x0});}}else _0x58a05b['push'](..._0xf32622);let _0x4234f4=0x0;return _0x479e9e['model']['change'](_0x7df9c8=>{for(let _0x35cd0f=0x0;_0x35cd0f<_0x58a05b['length'];_0x35cd0f++){const _0x5506a1=_0x58a05b[_0x35cd0f],_0x42e5d6=_0x7df9c8['createDocumentFragment']();for(const _0x142e6d of _0x2533f8['getChildren']())_0x7df9c8['append'](_0x142e6d['_clone'](!0x0),_0x42e5d6);for(const _0x4f6308 of _0x5506a1['operationsIsolated'])if('insert'===_0x4f6308['type']){const _0xca0df0=_0x4f6308;_0xca0df0['baseVersion']=null,_0xca0df0['isDocumentOperation']=!0x1,this['_changeOperationOwnerDocument'](_0xca0df0,_0x42e5d6),_0x7df9c8['batch']['addOperation'](_0x4f6308),_0x479e9e['model']['applyOperation'](_0x4f6308);const _0x5e7ece='suggestion:insertion:id:authorId:'+_0x4234f4++,_0x3d7e5a=_0x479e9e['model']['createRange'](_0xca0df0['position'],_0xca0df0['position']['getShiftedBy'](_0xca0df0['howMany']));_0x42e5d6['markers']['set'](_0x5e7ece,_0x3d7e5a);}else{if('marker'===_0x4f6308['type']&&_0x4f6308['name']['startsWith']('$markedRemove')){const _0x2a5b72=_0x4f6308,_0x24b155='suggestion:deletion:id:authorId:'+_0x4234f4++;this['_changeOperationOwnerDocument'](_0x2a5b72,_0x42e5d6),_0x42e5d6['markers']['set'](_0x24b155,_0x2a5b72['newRange']);}}if(_0x30fbf5)_0x5d5c8d['push']({..._0x5506a1,'context':this['_createGetContentFn'](_0x2533f8,_0x479e9e['data']),'content':this['_createGetContentFn'](_0x2533f8,_0x479e9e['data'])});else{const _0x103d98=this['_getChangeContext'](this['_changePositionOwnerDocument'](this['_getOperationStart'](_0x5506a1['operationsIsolated'][0x0]),_0x42e5d6),this['_changePositionOwnerDocument'](this['_getOperationEnd'](_0x5506a1['operationsIsolated'][_0x5506a1['operationsIsolated']['length']-0x1]),_0x42e5d6),_0x479e9e);_0x42e5d6['markers']['set'](Ta+'suggestion-context',new _0x49ae78(_0x103d98['start'],_0x103d98['end'])),_0x5d5c8d['push']({..._0x5506a1,'context':this['_createGetContextFn'](_0x42e5d6,_0x479e9e['data'],{'ellipsisBefore':_0x103d98['hasContentBefore'],'ellipsisAfter':_0x103d98['hasContentAfter']}),'content':this['_createGetContentFn'](_0x42e5d6,_0x479e9e['data'])});}}}),_0x5d5c8d;}['markChangePositionInEditorContent'](_0x1b514c,_0x3ecce7){if(!_0x1b514c['length'])return;const _0x11bdd9=_0x1b514c[0x0]['parent']['id'],_0x426064=_0x3ecce7['elements']['get'](_0x11bdd9);if(!_0x426064)return void console['warn']('No\x20element\x20found\x20for\x20ID:\x20'+_0x11bdd9);const _0x11e8e0=_0x426064['path'],_0x511b33=_0x426064['editor'],_0x4a1300=_0x511b33['model']['document']['getRoot'](_0x426064['rootName']);if(!_0x4a1300)return void console['warn']('No\x20model\x20root\x20found\x20for\x20name:\x20'+_0x426064['rootName']);const _0x4b47ba=_0x511b33['model']['document']['history']['getOperations'](_0x426064['documentVersion']),_0x395922=[];for(const _0x31164e of _0x1b514c){const _0x1fda6d=_0x31164e['operationsIsolated']['map'](_0x37aaab=>this['_translateOperationToEditorContent'](_0x37aaab,_0x11e8e0,_0x4a1300));if(!_0x1fda6d||!_0x1fda6d['length'])continue;const _0x57d83d=_0x1fda6d['every'](_0x194808=>'marker'===_0x194808['type']&&_0x194808['name']['startsWith']('$markedRemove')),_0xe77674={'document':_0x511b33['model']['document'],'useRelations':!0x1,'padWithNoOps':!0x1},_0x1c5128=_0x5f4e4f(_0x1fda6d,_0x4b47ba,_0xe77674)['operationsA'];for(const _0x25bc92 of _0x1c5128)if('insert'===_0x25bc92['type']){const _0x2c4f31=_0x25bc92,_0x54ba86=_0x2c4f31['nodes'];_0x511b33['model']['change'](_0x4dcdf2=>{const _0x309b5a=_0x4dcdf2['createDocumentFragment']();for(const _0x3f844d of _0x54ba86)_0x4dcdf2['append'](_0x3f844d['_clone'](!0x0),_0x309b5a);_0x395922['push']({'start':_0x2c4f31['position'],'end':_0x2c4f31['position'],'type':'insert','groupId':_0x31164e['id'],'content':{'asString':this['_createGetContentFn'](_0x309b5a,_0x511b33['data'])(),'asFragment':_0x309b5a}});});}else{if('marker'===_0x25bc92['type']&&_0x25bc92['name']['startsWith']('$markedRemove')){const _0x4ce24b=_0x25bc92;let _0x422220='remove-text';if(_0x57d83d){const _0x52f4ba=this['_findAdjacentContextDistance'](_0x4ce24b['newRange']['start'],'backward',_0x511b33['model']['schema']),_0x2a80b1=this['_findAdjacentContextDistance'](_0x4ce24b['newRange']['end'],'forward',_0x511b33['model']['schema']);if(_0x52f4ba||_0x2a80b1){const _0x158d69=_0x4ce24b['newRange']['start']['getShiftedBy'](-_0x52f4ba),_0x29b90a=_0x4ce24b['newRange']['end']['getShiftedBy'](_0x2a80b1);_0x395922['push']({'start':_0x158d69,'end':_0x29b90a,'groupId':_0x31164e['id'],'type':'remove-context'});}else _0x422220='remove-only';}_0x395922['push']({'start':_0x4ce24b['newRange']['start'],'end':_0x4ce24b['newRange']['end'],'groupId':_0x31164e['id'],'type':_0x422220});}}}this['_insertMarkers'](_0x395922,_0x511b33);}['clearAllMarkers'](){const _0x5c97a7=new Map();for(const _0x8feea7 of this['_markers']['keys']()){const _0x202699=this['_markers']['get'](_0x8feea7);_0x202699?.['editor']&&(_0x5c97a7['has'](_0x202699['editor'])||_0x5c97a7['set'](_0x202699['editor'],[]),_0x5c97a7['get'](_0x202699['editor'])['push'](_0x8feea7));}for(const [_0x4abcb2,_0xf67e01]of _0x5c97a7)_0x4abcb2['model']['change'](_0x36cd62=>{for(const _0x4d04ef of _0xf67e01)_0x4abcb2['model']['markers']['get'](_0x4d04ef)&&_0x36cd62['removeMarker'](_0x4d04ef);});this['_markers']['clear'](),this['_activeMarkers']['clear']();}['switchToReadOnly'](){for(const _0x399d94 of Ws(this['context']))_0x399d94['enableReadOnlyMode']('ai-review');}['switchToEdit'](){for(const _0x5229b0 of Ws(this['context']))_0x5229b0['disableReadOnlyMode']('ai-review');}['applyChange'](_0x114c43){const _0x3b4c2e=_0x114c43['map'](_0x3ff127=>this['_getMarkersDataForGroup'](_0x3ff127))['flat'](),_0x1c03e8=new Map();for(const _0x38c260 of _0x3b4c2e)_0x1c03e8['has'](_0x38c260['editor'])||_0x1c03e8['set'](_0x38c260['editor'],[]),_0x1c03e8['get'](_0x38c260['editor'])['push'](_0x38c260);for(const [_0x1d7b9e,_0x220895]of _0x1c03e8){const _0x571f5a=_0x1d7b9e['model'];_0x571f5a['change'](_0x33c133=>{for(const _0x1cd0da of _0x220895){const _0x158fff=_0x1d7b9e['model']['markers']['get'](_0x1cd0da['id']);if(_0x158fff){if('insert'===_0x1cd0da['type']){if(!_0x1cd0da['content'])continue;_0x571f5a['insertContent'](_0x1cd0da['content']['asFragment']||null,_0x158fff['getRange']()['start']);}else'remove-text'!==_0x1cd0da['type']&&'remove-only'!==_0x1cd0da['type']||_0x571f5a['deleteContent'](_0x571f5a['createSelection'](_0x158fff['getRange']()));_0x33c133['removeMarker'](_0x1cd0da['id']),this['_markers']['delete'](_0x1cd0da['id']);}}});}}['rejectChange'](_0x1cc094){const _0x3006cc=this['_getMarkersDataForGroup'](_0x1cc094),_0x3384d1=new Map();for(const _0x4ec5d2 of _0x3006cc)_0x3384d1['has'](_0x4ec5d2['editor'])||_0x3384d1['set'](_0x4ec5d2['editor'],[]),_0x3384d1['get'](_0x4ec5d2['editor'])['push'](_0x4ec5d2);for(const [_0x2d05b0,_0x233740]of _0x3384d1)_0x2d05b0['model']['change'](_0x10a4d8=>{for(const _0x4eb2ec of _0x233740)_0x10a4d8['removeMarker'](_0x4eb2ec['id']),this['_markers']['delete'](_0x4eb2ec['id']);});}['getEditor'](){return $s(this['context']);}['getEditors'](){return Ws(this['context']);}['getEditorForChange'](_0x3e99b4){const _0xbc350b=this['_getMarkersDataForGroup'](_0x3e99b4);return _0xbc350b[0x0]?.['editor'];}['getMarkerElementForChange'](_0x20d330){const _0x52767a=Array['from'](this['_markers']['values']())['filter'](_0x3e9d9e=>_0x3e9d9e['groupId']===_0x20d330);if(!_0x52767a['length'])return null;const _0x245651=0x1===_0x52767a['length']?_0x52767a[0x0]:this['_sortMarkers'](_0x52767a)[0x0],_0x32a9a4=_0x245651['editor']['model']['markers']['get'](_0x245651['id']);if(!_0x32a9a4)return null;return{'modelRange':_0x32a9a4['getRange'](),'getElement':()=>this['_findMarkerElementById'](_0x245651['id'])};}['getContentElementForChange'](_0xdd865e){const _0x13e440=Array['from'](this['_markers']['values']())['filter'](_0x234e63=>_0x234e63['groupId']===_0xdd865e);if(!_0x13e440['length'])return null;const _0x131a3b=0x1===_0x13e440['length']?_0x13e440[0x0]:this['_sortMarkers'](_0x13e440)[0x0],_0x4e1368=_0x131a3b['editor'],_0x1c2976=_0x4e1368['model']['markers']['get'](_0x131a3b['id']);if(!_0x1c2976)return null;const _0x5949ee=_0x1c2976['getRange'](),_0x421a6f=_0x4e1368['editing']['view']['getDomRoot'](_0x5949ee['root']['rootName'])||_0x4e1368['editing']['view']['getDomRoot']();if(!_0x421a6f||!_0x5949ee)return null;let _0x4b4636=_0x5949ee['start']['parent'];for(;_0x4b4636['parent']&&'$root'!==_0x4b4636['parent']['name'];)_0x4b4636=_0x4b4636['parent'];if(!_0x4b4636||!_0x4b4636['name'])return null;const _0x386d13=_0x421a6f['querySelector']('[data-marker-id=\x22'+_0x131a3b['id']+'\x22]');if(!_0x386d13)return null;let _0x5ab136=null;_0x4e1368['model']['change'](_0x5ac98=>{_0x5ab136=_0x5ac98['createDocumentFragment'](),_0x5ac98['append'](_0x4b4636['_clone'](!0x0),_0x5ab136);});const _0x203aec=_0x4e1368['data']['toView'](_0x5ab136)['getChild'](0x0);return _0x386d13['closest'](_0x203aec['name']);}['reactivateMarkers'](_0x4cf7ca){const _0x19df89=this['_getMarkersDataForGroup'](_0x4cf7ca);if(!_0x19df89['length'])return;const _0x4516c8=Array['from'](this['_activeMarkers'])['sort'](),_0xd11a45=Array['from'](new Set(_0x19df89['map'](_0x52a1cd=>_0x52a1cd['id'])))['sort']();_0x4516c8['join']('|')!==_0xd11a45['join']('|')&&(this['setAllMarkersAsInactive'](),this['setMarkersInElementAsActive'](_0x4cf7ca));}['setMarkersInElementAsActive'](_0x38c22c){const _0x18ff12=this['_getMarkersDataForGroup'](_0x38c22c);if(!_0x18ff12['length'])return;const _0x3bef65=_0x18ff12[0x0]['editor'],_0x4b75f9=new Set(_0x18ff12['map'](_0x3426c5=>_0x3426c5['id'])),_0x25f29f=Array['from'](_0x4b75f9['values']())['map'](_0x1e447a=>_0x3bef65['model']['markers']['get'](_0x1e447a))['filter'](_0x5a05ba=>!!_0x5a05ba);_0x4b75f9['forEach'](_0x31e730=>{this['_activeMarkers']['add'](_0x31e730);}),_0x3bef65['model']['change'](()=>{_0x25f29f['forEach'](_0x2ac396=>{_0x3bef65['editing']['reconvertMarker'](_0x2ac396);});});}['setAllMarkersAsInactive'](){const _0x51dcb3=Array['from'](this['_activeMarkers']);if(!_0x51dcb3['length'])return;this['_activeMarkers']['clear']();const _0xfe5207=new Map();for(const _0x4ee2d2 of _0x51dcb3){const _0x509129=this['_markers']['get'](_0x4ee2d2);if(!_0x509129)continue;const _0x388fb9=_0x509129['editor'],_0x51a7ce=_0x388fb9['model']['markers']['get'](_0x4ee2d2);_0x51a7ce&&(_0xfe5207['has'](_0x388fb9)||_0xfe5207['set'](_0x388fb9,[]),_0xfe5207['get'](_0x388fb9)['push'](_0x51a7ce));}for(const [_0x1cb750,_0x43cae7]of _0xfe5207)_0x1cb750['model']['change'](()=>{_0x43cae7['forEach'](_0x19e500=>{_0x1cb750['editing']['reconvertMarker'](_0x19e500);});});}['_getPositionLimitingRange'](_0x4991e6,_0x588b1a,_0x32bd46='outside'){if(!_0x4991e6)return null;let _0x36994f=_0x4991e6['parent'];for(;_0x36994f&&_0x36994f['parent']&&'$root'!==_0x36994f['parent']['name']&&!_0x588b1a['model']['schema']['isLimit'](_0x36994f)&&!_0x588b1a['model']['schema']['isBlock'](_0x36994f);)_0x36994f=_0x36994f['parent'];if(!_0x36994f||!_0x36994f['name']||'$root'===_0x36994f['name'])return null;let _0x57ac65=null;return _0x588b1a['model']['change'](_0x3ce1d4=>{_0x57ac65='inside'===_0x32bd46?_0x3ce1d4['createRangeIn'](_0x36994f):_0x3ce1d4['createRangeOn'](_0x36994f);}),_0x57ac65;}['_validateMarkers'](_0x366c1c,_0x1df400){const _0x337229=Array['from'](this['_markers']['keys']()),_0x504aaf=new Map();for(const _0x1fa8f2 of _0x337229){const _0x1a42fe=_0x366c1c['model']['markers']['get'](_0x1fa8f2);if(!_0x1a42fe)continue;const _0x4936ff=_0x1a42fe['getStart']()['root']['rootName']+':'+_0x1a42fe['getStart']()['path'][0x0];_0x504aaf['has'](_0x4936ff)||_0x504aaf['set'](_0x4936ff,[]),_0x504aaf['get'](_0x4936ff)['push'](_0x1a42fe);}const _0x2d0fcf=new Set();for(const _0x20f823 of _0x366c1c['model']['document']['differ']['getChanges']()){let _0x21487e='',_0x294ffa=null;if('insert'===_0x20f823['type'])_0x294ffa=new _0x49ae78(_0x20f823['position'],_0x20f823['position']['getShiftedBy'](_0x20f823['length'])),_0x21487e=_0x20f823['position']['root']['rootName']+':'+_0x20f823['position']['path'][0x0];else{if('remove'!==_0x20f823['type'])continue;_0x294ffa=new _0x49ae78(_0x20f823['position']),_0x21487e=_0x20f823['position']['root']['rootName']+':'+_0x20f823['position']['path'][0x0];}const _0xd45201=_0x504aaf['get'](_0x21487e)||[];if(_0xd45201['length']){for(const _0x1d9b3b of _0xd45201)if(_0x294ffa['root']['rootName']===_0x1d9b3b['getRange']()['root']['rootName']&&('insert'!==_0x20f823['type']||!_0x294ffa['containsRange'](_0x1d9b3b['getRange']()))&&(_0x294ffa['isIntersecting'](_0x1d9b3b['getRange']())||_0x294ffa['start']['isTouching'](_0x1d9b3b['getRange']()['end'])||_0x294ffa['end']['isTouching'](_0x1d9b3b['getRange']()['start']))){const _0x553c59=this['_parseMarkerName'](_0x1d9b3b['name']);Array['from'](this['_markers']['values']())['filter'](_0x2907c6=>_0x2907c6['groupId']===_0x553c59['groupId'])['forEach'](_0x392778=>_0x2d0fcf['add'](_0x392778['id']));}}}if(_0x2d0fcf['size']){for(const _0x579b0e of _0x2d0fcf)_0x1df400['removeMarker'](_0x579b0e);return!0x0;}return!0x1;}['_handleMarkerChanges'](_0x2df880){for(const {name:_0x47491c,data:_0x1be0bf}of _0x2df880['model']['document']['differ']['getChangedMarkers']()){if(!_0x47491c['startsWith'](Ta))continue;const _0x465b2b=_0x1be0bf['oldRange'],_0x3db8d8=_0x1be0bf['newRange'],_0x3bc09e=_0x465b2b&&'$graveyard'===_0x465b2b['root']['rootName'],_0x1f4604=_0x3db8d8&&'$graveyard'===_0x3db8d8['root']['rootName'];if(_0x3bc09e&&_0x1f4604)continue;const _0x14a8c7=this['_parseMarkerName'](_0x47491c);this['_markers']['get'](_0x47491c)&&(_0x1f4604||!_0x3db8d8?this['_eventEmitter']['fire']('changeMarkerRemoved',{'markerId':_0x47491c,'changeId':_0x14a8c7['groupId']}):_0x3bc09e&&_0x3db8d8&&this['_eventEmitter']['fire']('changeMarkerRestored',{'markerId':_0x47491c,'changeId':_0x14a8c7['groupId']}));}}['_parseMarkerName'](_0x3dac47){const _0x13947d=_0x3dac47['split'](':'),_0x20b41b=(_0x13947d[0x1]||'')['split']('_');return{'prefix':_0x13947d[0x0],'groupId':_0x20b41b[0x0],'suffix':_0x20b41b[0x1]};}['_translateOperationToEditorContent'](_0x2f64b6,_0x5e0b97,_0x4e8eb3){if('insert'===_0x2f64b6['type']){const _0x22f22c=_0x2f64b6;return new _0x286740(this['_changePosition'](_0x5e0b97['concat'](_0x22f22c['position']['offset']),_0x4e8eb3),_0x22f22c['nodes'],_0x22f22c['baseVersion']);}if('marker'===_0x2f64b6['type']&&_0x2f64b6['name']['startsWith']('$markedRemove')){const _0x5e57f7=_0x2f64b6;return new _0x2197a6(_0x5e57f7['name'],_0x5e57f7['oldRange'],this['_changeRange'](_0x5e57f7['newRange'],_0x5e0b97['concat'](_0x5e57f7['newRange']['start']['offset']),_0x5e0b97['concat'](_0x5e57f7['newRange']['end']['offset']),_0x4e8eb3),_0x5e57f7['_markers'],_0x5e57f7['affectsData'],_0x5e57f7['baseVersion']);}return _0x2f64b6;}['_groupAdjacentOperations'](_0x18e771){if(!_0x18e771['length'])return[];const _0x995094=[];let _0x206dd9=0x0,_0xfaf05a=0x0,_0x342c88=[];for(let _0x4d815b=0x0;_0x4d815b<=_0x18e771['length'];_0x4d815b++){const _0x150768=_0x18e771[_0x4d815b],_0x189700=_0x18e771[_0x4d815b-0x1];!_0x150768||_0x189700&&!this['_getOperationEnd'](_0x189700)['isTouching'](this['_getOperationStart'](_0x150768))?(_0x995094['push']({'operations':_0x342c88,'operationsIsolated':_0x342c88['map'](_0x11ca72=>this['_shiftOperation'](_0x11ca72['clone'](),-_0xfaf05a)),'groupOffset':_0x206dd9}),_0x342c88=_0x150768?[_0x150768]:[],_0xfaf05a+=_0x206dd9,_0x206dd9=0x0):_0x342c88['push'](_0x150768),_0x150768&&'insert'===_0x150768['type']&&(_0x206dd9+=_0x150768['howMany']);}return _0x995094;}['_findAdjacentContextDistance'](_0x44db79,_0x124807,_0xe56716,_0x290dd8=0x1){const _0x1aa2fb=new _0x441fd4({'startPosition':_0x44db79,'direction':_0x124807});let _0x17c036=0x0;for(let _0x5bee96=0x0;_0x5bee96<_0x290dd8;_0x5bee96++){let _0xde4042=0x0,_0x261f57=!0x1,_0x2e79ae='forward'===_0x124807?/^\W*\w+/:/\w+\W*$/;for(const {item:_0x244499}of _0x1aa2fb)if(_0x244499['is']('$textProxy')){const _0x58de2a=_0x2e79ae['exec'](_0x244499['data']);if(_0x58de2a&&_0x58de2a['length']){if(_0xde4042+='forward'===_0x124807?_0x58de2a['index']+_0x58de2a[0x0]['length']:_0x244499['data']['length']-_0x58de2a['index'],_0x58de2a[0x0]['length']!==_0x244499['data']['length'])break;_0x261f57=!0x0,_0x2e79ae='forward'===_0x124807?/^\w+/:/\w+$/;}else{if(_0x261f57)break;_0xde4042+=_0x244499['offsetSize'];}}else{if(_0x244499['is']('element')){_0xe56716['isInline'](_0x244499)&&!_0x261f57&&(_0xde4042+=0x1);break;}}_0x17c036+=_0xde4042,_0x1aa2fb['jumpTo'](_0x44db79['getShiftedBy']('forward'===_0x124807?_0x17c036:-_0x17c036));}return _0x17c036;}['_getChangeContext'](_0xaf5c81,_0xf55ef9,_0x5d2ad1){const _0x41ca2e=_0x5d2ad1['model']['schema'],_0x3ca138=this['_findAdjacentContextDistance'](_0xaf5c81,'backward',_0x41ca2e,0x6),_0x6beb8c=this['_findAdjacentContextDistance'](_0xf55ef9,'forward',_0x41ca2e,0x6),_0x1d27ce=_0xaf5c81['getShiftedBy'](-_0x3ca138),_0xd9aa79=_0xf55ef9['getShiftedBy'](_0x6beb8c);return{'start':_0x1d27ce,'end':_0xd9aa79,'hasContentBefore':!_0x1d27ce['isAtStart'],'hasContentAfter':!_0xd9aa79['isAtEnd']};}['_insertMarkers'](_0x68ab4,_0x24b02e){const _0x1a32c6=this['context']['plugins']['get']('AIEditing'),_0x3f1c91=new Set();_0x24b02e['model']['change'](_0x2aef56=>{for(const _0x250aa7 of _0x68ab4){const _0x37ff37=''+Ta+_0x250aa7['type']+':'+_0x250aa7['groupId']+'_'+_0x1a32c6['_nextDataId'](_0x3f1c91);this['_markers']['set'](_0x37ff37,{'id':_0x37ff37,'groupId':_0x250aa7['groupId'],'type':_0x250aa7['type'],'content':_0x250aa7['content'],'editor':_0x24b02e}),_0x2aef56['addMarker'](_0x37ff37,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x2aef56['createRange'](_0x250aa7['start'],_0x250aa7['end'])});}});}['_createGetContextFn'](_0x269420,_0x338ff9,_0x27cd28){let _0x14f82d='';return()=>{if(!_0x14f82d){const _0x2cfc0=_0x338ff9['toView'](_0x269420,{'showSuggestionHighlights':!0x0});let _0x50cb51=_0x2cfc0['getChild'](0x0);if(_0x50cb51['is']('containerElement')||(_0x50cb51=_0x2cfc0),!_0x50cb51)return'';let _0x7bcbe3=!0x1;const _0x47d03e=[];for(const _0x2893fb of _0x50cb51['getChildren']())_0x2893fb['is']('element','span')&&_0x2893fb['hasClass']('ck-ai_review-marker_context-end')&&(_0x7bcbe3=!0x1),_0x7bcbe3&&_0x47d03e['push'](_0x2893fb),_0x2893fb['is']('element','span')&&_0x2893fb['hasClass']('ck-ai_review-marker_context-start')&&(_0x7bcbe3=!0x0);_0x50cb51['_removeChildren'](0x0,_0x50cb51['childCount']),_0x27cd28?.['ellipsisBefore']&&_0x50cb51['_appendChild']('…'),_0x50cb51['_appendChild'](_0x47d03e),_0x27cd28?.['ellipsisAfter']&&_0x50cb51['_appendChild']('…');const _0x3e160e=_0x338ff9['htmlProcessor']['domConverter']['viewToDom'](_0x2cfc0),_0x4da463=_0x338ff9['htmlProcessor']['htmlWriter']['getHtml'](_0x3e160e);_0x14f82d=_0x4da463;}return _0x14f82d;};}['_createGetContentFn'](_0x287d3d,_0x3e1608){let _0x2bb998='';return()=>(_0x2bb998||(_0x2bb998=_0x3e1608['stringify'](_0x287d3d,{'showSuggestionHighlights':!0x0})),_0x2bb998);}['_createGetContentUsingDataIdFn'](_0xaa0e5b,_0x4d9845,_0x26cfda){let _0x492246='';return()=>{if(!_0x492246){const _0x54bda2=_0x26cfda['toView'](new _0x3a3cd6(_0xaa0e5b)),_0x206d57=_0x26cfda['htmlProcessor']['domConverter']['viewToDom'](_0x54bda2)['querySelector']('[data-id=\x22'+_0x4d9845+'\x22]');_0x492246=_0x206d57?.['outerHTML']||'';}return _0x492246;};}['_findMarkerElement'](_0x353783,_0x5592ad=0x5){let _0x41f03f=_0x353783,_0x2c7d6a=null;for(let _0x1d40cc=0x0;_0x1d40cc<_0x5592ad&&_0x41f03f;_0x1d40cc++){if(!_0x41f03f['className']){_0x41f03f=_0x41f03f['parentElement'];continue;}if(!(''+_0x41f03f['className'])['includes']('ck-ai_review-marker_')){_0x41f03f=_0x41f03f['parentElement'];continue;}if(!_0x41f03f['getAttribute']('data-marker-id'))break;_0x2c7d6a=_0x41f03f;break;}return _0x2c7d6a;}['_findMarkerElementById'](_0x71d1fc){const _0x4b2b44=this['_markers']['get'](_0x71d1fc),_0x3f6786=_0x4b2b44?.['editor']??$s(this['context']),_0x50f38d=_0x3f6786['model']['markers']['get'](_0x71d1fc);return _0x50f38d?_0x2a88d9(_0x3f6786['editing'],_0x50f38d):null;}['_getMarkersDataForGroup'](_0x2a31a9){return Array['from'](this['_markers']['values']())['filter'](_0x4e2db7=>_0x4e2db7['groupId']===_0x2a31a9);}['_getOperationStart'](_0xb86b46){return'insert'===_0xb86b46['type']?_0xb86b46['position']:_0xb86b46['newRange']['start'];}['_getOperationEnd'](_0x4600f7,_0x90477f=!0x1){return'insert'===_0x4600f7['type']?_0x90477f?_0x4600f7['position']:_0x4600f7['position']['getShiftedBy'](_0x4600f7['howMany']):_0x4600f7['newRange']['end'];}['_shiftOperation'](_0x17cfd3,_0x361f89){return'insert'===_0x17cfd3['type']?_0x17cfd3['position']=_0x17cfd3['position']['getShiftedBy'](_0x361f89):'marker'===_0x17cfd3['type']&&_0x17cfd3['newRange']&&(_0x17cfd3['newRange']=new _0x49ae78(_0x17cfd3['newRange']['start']['getShiftedBy'](_0x361f89),_0x17cfd3['newRange']['end']['getShiftedBy'](_0x361f89))),_0x17cfd3;}['_changeOperationOwnerDocument'](_0x1e145e,_0x52229f){'insert'===_0x1e145e['type']?_0x1e145e['position']=this['_changePositionOwnerDocument'](_0x1e145e['position'],_0x52229f):'marker'===_0x1e145e['type']&&_0x1e145e['newRange']&&(_0x1e145e['newRange']=this['_changeRangeOwnerDocument'](_0x1e145e['newRange'],_0x52229f));}['_changePositionOwnerDocument'](_0x432bb8,_0x25ba3d){return new _0x11c903(_0x25ba3d,_0x432bb8['path']);}['_changeRangeOwnerDocument'](_0x9be9da,_0x351e87){return new _0x49ae78(this['_changePositionOwnerDocument'](_0x9be9da['start'],_0x351e87),this['_changePositionOwnerDocument'](_0x9be9da['end'],_0x351e87));}['_changePosition'](_0x3acb8d,_0x2d19ca){return new _0x11c903(_0x2d19ca,[..._0x3acb8d]);}['_changeRange'](_0x791a3d,_0x39e32d,_0x4b3a2d,_0x116a6c){return new _0x49ae78(this['_changePosition'](_0x39e32d,_0x116a6c),this['_changePosition'](_0x4b3a2d,_0x116a6c));}['_sortMarkers'](_0x4e606b){const _0x2c1372=_0x564bbc=>{switch(_0x564bbc){case'insert':return 0x0;case'remove-context':return 0x1;case'remove-only':return 0x2;case'remove-text':return 0x3;}};return _0x4e606b['sort']((_0x54147c,_0x3bb8d8)=>_0x2c1372(_0x54147c['type'])-_0x2c1372(_0x3bb8d8['type']));}['_hasSameTopLevelElement'](_0x57488d,_0x119d13){const _0x7e7ecb=_0x57488d['getChild'](0x0),_0x22a53=_0x119d13['getChild'](0x0);return!(!_0x7e7ecb||!_0x22a53)&&((!_0x7e7ecb['is']('element')||!_0x22a53['is']('element')||_0x7e7ecb['name']===_0x22a53['name'])&&!(_0x7e7ecb['is']('element')&&!_0x22a53['is']('element')||!_0x7e7ecb['is']('element')&&_0x22a53['is']('element')));}['_haveSingleTopLevelElement'](_0x26052c){return 0x1===_0x26052c['childCount'];}['_haveOnlyInlineContent'](_0x4135fb,_0x1e47be){for(const _0x5d0a86 of _0x4135fb['getChildren']())if(_0x5d0a86['is']('element')&&!_0x1e47be['isInline'](_0x5d0a86))return!0x1;return!0x0;}['_upsertDataId'](_0x1d57d3,_0x58b041){let _0x3fd69c=_0x1d57d3['getAttribute'](_0x503c11);return _0x3fd69c||(_0x3fd69c=_0x58b041(),_0x1d57d3['_setAttribute'](_0x503c11,_0x3fd69c)),_0x3fd69c;}}class fa extends Tt(){['id'];['contentNew'];['contentInitial'];['documentVersion'];constructor({id:_0xe64e24,contentNew:_0x5c82db,contentInitial:_0x2c23ac,documentVersion:_0x20698c}){super(),this['id']=_0xe64e24,this['contentNew']=_0x5c82db,this['contentInitial']=_0x2c23ac,this['documentVersion']=_0x20698c;}}class ba extends ht(){['id'];['parent'];['_data'];['_editorOperations']=[];constructor(_0x3c6f4e,_0x58259a,_0x3531c2){super(),this['id']=_0x3c6f4e,this['parent']=_0x3531c2,this['_data']=_0x58259a,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(_0x4e0b02,_0x234afc,_0x5bff41,_0x46d771,_0x1b6288){super(),this['_sourceCheck']=_0x234afc,this['_documentData']=_0x4e0b02,this['_aiConnector']=_0x5bff41,this['_reviewParams']=_0x46d771,this['_reviewArgs']=_0x1b6288,this['on']('change:status',(_0x2fdcad,_0x3f9512,_0x411345)=>{'aborted'==_0x411345&&(this['_wasAborted']=!0x0),this['fire']('reviewCheckRunUpdated',{'status':_0x411345,'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'](_0x3c3db9=>'pending'===_0x3c3db9['status']);}get['currentError'](){return this['_currentError'];}['updateDocumentData'](_0x692c39){this['_documentData']=_0x692c39;}async['start'](){this['status']='loading',this['_currentError']=void 0x0;try{this['_activeRequest']=this['_createApiRequest']();const _0x51b31a=await this['_activeRequest']['getStream']();this['status']='data';for await(const _0x271e09 of _0x51b31a)'unmodified'!==_0x271e09['data']['operation']&&('error'!==_0x271e09['data']['operation']?'review-metadata'!==_0x271e09['event']?this['_addReviewCheckResult'](_0x271e09['data']['dataId'],_0x271e09['data']['textDelta']):this['callId']=_0x271e09['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(_0x28b75d){this['_currentError']=_0x28b75d,_0x28b75d instanceof Error&&_0x28b75d['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'](_0x299896,_0x29fa3e){const _0x5c71e2=this['_results']['get'](_0x299896);if(!_0x5c71e2)return;if(0x0===_0x29fa3e['length'])return;const _0x878f9b=[];_0x29fa3e['forEach']((_0x2c5c50,_0x45c854)=>{const _0x1f9b0e=new ba(_0x5c71e2['id']+'-'+_0x45c854,_0x2c5c50,_0x5c71e2);_0x1f9b0e['on']('change:status',()=>{this['fire']('reviewCheckResultChangeStatusUpdated',{'change':_0x1f9b0e,'status':_0x1f9b0e['status']});}),_0x1f9b0e['on']('change:isActivated',()=>{_0x1f9b0e['isActivated']?this['fire']('reviewCheckResultActivated',{'change':_0x1f9b0e}):this['fire']('reviewCheckResultDeactivated',{'change':_0x1f9b0e});}),this['_changes']['push'](_0x1f9b0e),_0x878f9b['push'](_0x1f9b0e);}),this['fire']('reviewCheckResultReady',{'changes':_0x878f9b,'result':_0x5c71e2,'source':this});}['abort'](){this['_activeRequest']&&(this['_activeRequest']['abortController']['abort'](),this['_activeRequest']=null,this['status']='aborted');}['isChangeActive'](_0x5bf4ac){const _0x5c8806=this['_changes']['find'](_0x3cc7e0=>_0x3cc7e0['id']===_0x5bf4ac);return!(!_0x5c8806||'pending'!==_0x5c8806['status']);}['isAnyChangeActivated'](){return this['_changes']['some'](_0x239643=>!0x0===_0x239643['isActivated']);}['getActiveChanges'](){return this['_changes']['filter'](_0x462101=>'pending'===_0x462101['status']);}['getChangeById'](_0x125ca4){return this['_changes']['find'](_0x54edf5=>_0x54edf5['id']===_0x125ca4);}['markAllChangesAsAccepted'](){for(const _0x1f0556 of this['_changes'])'pending'===_0x1f0556['status']&&(_0x1f0556['status']='accepted');this['_checkIfFinished']();}['markChangeAsAccepted'](_0x3e6486){const _0x472218=this['_changes']['find'](_0x53ac77=>_0x53ac77['id']===_0x3e6486);_0x472218&&'pending'===_0x472218['status']&&(_0x472218['status']='accepted'),this['_checkIfFinished']();}['markChangeAsRejected'](_0x3472be){const _0x4b0bc9=this['_changes']['find'](_0x4a43e9=>_0x4a43e9['id']===_0x3472be);_0x4b0bc9&&'pending'===_0x4b0bc9['status']&&(_0x4b0bc9['status']='rejected'),this['_checkIfFinished']();}['markChangeAsOutdated'](_0xdf7e6d){const _0x5aa562=this['_changes']['find'](_0x30ef47=>_0x30ef47['id']===_0xdf7e6d);_0x5aa562&&'pending'===_0x5aa562['status']&&(_0x5aa562['status']='outdated'),this['_checkIfFinished']();}['markChangeAsPending'](_0x75ccb7){const _0x55f05e=this['_changes']['find'](_0x2869e7=>_0x2869e7['id']===_0x75ccb7);_0x55f05e&&'outdated'===_0x55f05e['status']&&(_0x55f05e['status']='pending'),this['_checkIfFinished']();}['activateChange'](_0xc18f2c){this['_changes']['filter'](_0x48bb1a=>_0x48bb1a['isActivated']&&_0x48bb1a['id']!==_0xc18f2c)['forEach'](_0x26d491=>{_0x26d491['isActivated']=!0x1;});const _0x173293=this['_changes']['find'](_0x3b6fbf=>_0x3b6fbf['id']===_0xc18f2c);_0x173293&&'pending'===_0x173293['status']&&(_0x173293['isActivated']=!0x0);}['deactivateChange'](){this['_changes']['filter'](_0x561c94=>_0x561c94['isActivated'])['forEach'](_0x5e28df=>{_0x5e28df['isActivated']=!0x1;});}['forceReadyState'](){this['status']='ready';}async['sendRating'](_0x3ebab3){if('initialized'===this['status']||'loading'===this['status']||'data'===this['status']||this['_wasAborted'])return;if(!this['callId']||0x0===this['_changes']['length'])return;let _0x5235ce;if(_0x3ebab3){const _0x2d6fa4=this['_changes']['find'](_0x4cf8e0=>_0x4cf8e0['id']===_0x3ebab3);if(_0x2d6fa4&&_0x2d6fa4['isRated'])return;_0x2d6fa4&&(_0x5235ce=_0x2d6fa4['parent']['id'],_0x2d6fa4['isRated']=!0x0);}const _0x10aadc={'positiveCount':this['_changes']['filter'](_0x1a0977=>'accepted'===_0x1a0977['status'])['length'],'totalCount':this['_changes']['length']};this['_sendRatingRequest'](_0x10aadc,this['callId'],_0x5235ce);}['_addReviewCheckResult'](_0x35234b,_0x907359){const _0x292871=this['_documentData']['elements']['get'](_0x35234b);if(!_0x292871)return;const _0x16f741=_0x292871['getContent']();if(_0x16f741===_0x907359)return;const _0x175579=new fa({'id':_0x35234b,'contentInitial':_0x16f741,'contentNew':_0x907359,'documentVersion':_0x292871['documentVersion']});this['_results']['set'](_0x175579['id'],_0x175579),this['fire']('reviewCheckResultAdded',{'result':_0x175579,'source':this,'editor':_0x292871['editor']});}['_checkIfFinished'](){'finished'===this['status']&&(this['_changes']['filter'](_0x16b049=>'pending'===_0x16b049['status'])['length']>0x0&&(this['status']='ready')),'ready'===this['status']&&(0x0===this['_changes']['filter'](_0x6220ec=>'pending'===_0x6220ec['status'])['length']&&(this['status']='finished'));}}class Ra extends Sa{get['subTitle'](){if(!this['_reviewParams']||0x0===this['_reviewParams']['length'])return'';const _0x53357a=[];if(this['_reviewParams']['length']>0x0&&this['_sourceCheck']['options'])for(let _0x561ef6=0x0;_0x561ef6<this['_reviewParams']['length'];_0x561ef6++){if(!this['_reviewParams'][_0x561ef6]||!this['_sourceCheck']['options'][_0x561ef6])continue;const _0x4d79e3=this['_sourceCheck']['options'][_0x561ef6],_0x4ec967=_0x4d79e3['data']?.['find'](_0xc7baf5=>_0xc7baf5['id']===this['_reviewParams'][_0x561ef6]);_0x4ec967&&_0x53357a['push'](_0x4ec967['label']);}return _0x53357a['join'](',\x20');}get['reviewName'](){return this['_composeReviewName']();}['_createApiRequest'](){return this['_aiConnector']['callSystemReview']({'reviewName':this['_composeReviewName'](),'content':this['_documentData']['content'],'args':this['_reviewArgs']});}['_sendRatingRequest'](_0x3f6ab3,_0x273e66,_0x253997){return this['_aiConnector']['upsertAIReviewRating'](this['reviewName'],_0x273e66,_0x3f6ab3,_0x253997);}['_composeReviewName'](){return!this['_reviewParams']||0x0===this['_reviewParams']['length']||this['_sourceCheck']['useArgs']?this['_sourceCheck']['apiId']:[this['_sourceCheck']['apiId'],...this['_reviewParams']]['join']('-');}}class Oa extends _0x1c4723{['_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(_0x1a7588,_0x221eda)=>{const _0x4fdac3=this['_aiReviewCheckList']['getCheckById'](_0x221eda['id']);if(_0x4fdac3){this['_onReviewCheckRun'](_0x221eda),this['_aiReviewCoreEditing']['switchToReadOnly'](),this['_currentReviewCheckRun']=this['_createReviewCheckRun'](_0x221eda,_0x4fdac3),this['_aiReviewCoreUi']['setCheckResultTitle'](this['_currentReviewCheckRun']['title'],this['_currentReviewCheckRun']['subTitle']),this['_currentReviewCheckRun']['on']('reviewCheckRunUpdated',(_0x327b4e,_0x4eafff)=>{switch(_0x4eafff['status']){case'data':case'loading':this['_aiReviewCoreUi']['showCheckRunResults'](_0x4eafff);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'!==_0x4eafff['status']&&'error-chunk'!==_0x4eafff['status']&&'error-general'!==_0x4eafff['status']||this['_currentReviewCheckRun']?.['sendRating']();}),this['_currentReviewCheckRun']['on']('reviewCheckResultAdded',(_0x5e4929,_0x21fcbc)=>{if(!this['_currentReviewCheckRun'])throw new at('ai-review-mode-no-current-check-run',this);const _0x247297=this['_diffContent'](_0x21fcbc['editor'],_0x21fcbc['result']['contentInitial'],_0x21fcbc['result']['contentNew']);_0x21fcbc['source']['addResultChanges'](_0x21fcbc['result']['id'],_0x247297);}),this['_currentReviewCheckRun']['on']('reviewCheckResultReady',(_0x393413,_0x65ae73)=>{for(const _0x59531b of _0x65ae73['changes'])this['_aiReviewCoreUi']['showCheckRunResult'](_0x59531b);this['_markChangePositionInEditorContent'](_0x65ae73['changes'],_0x65ae73['source']['documentData']);}),this['_currentReviewCheckRun']['on']('reviewCheckResultChangeStatusUpdated',(_0x2c5d66,_0x595c50)=>{this['_aiReviewCoreUi']['updateChangeState'](_0x595c50['change']['id'],_0x595c50['status']);}),this['_currentReviewCheckRun']['on']('reviewCheckResultActivated',(_0x30cf85,_0x15d1ad)=>{this['_onReviewCheckResultActivated'](_0x15d1ad);}),this['_currentReviewCheckRun']['on']('reviewCheckResultDeactivated',()=>{this['_onReviewCheckResultDeactivated']();});try{await this['_currentReviewCheckRun']['start']();}catch(_0x1558b9){_0x1558b9 instanceof Error&&_0x1558b9['message']['includes']('ai-request-aborted')||(_0x1558b9 instanceof at?this['_logError'](_0x1558b9):this['_logError'](new at('ai-review-mode-check-run-failed',this,void 0x0,_0x1558b9)));}}else this['_logError'](new at('ai-review-mode-source-check-not-found',this,{'checkId':_0x221eda['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 _0x2398cb=this['_currentReviewCheckRun']['getActiveChanges']();if(!_0x2398cb['length'])return;this['_aiReviewCoreEditing']['applyChange'](_0x2398cb['map'](_0x36f207=>_0x36f207['id']));const _0xea885=this['_currentReviewCheckRun'];_0xea885['markAllChangesAsAccepted'](),_0xea885['sendRating']();}),this['listenTo'](this['_aiReviewCoreUi'],'acceptChange',(_0x57e627,_0x4998cb)=>{this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['isChangeActive'](_0x4998cb['id'])&&(this['_aiReviewCoreEditing']['applyChange']([_0x4998cb['id']]),this['_currentReviewCheckRun']['markChangeAsAccepted'](_0x4998cb['id']),this['_aiReviewCoreUi']['hideChangeBalloon'](),this['_currentReviewCheckRun']['sendRating'](_0x4998cb['id']));}),this['listenTo'](this['_aiReviewCoreUi'],'dismissChange',(_0x8a1150,_0x3dc75c)=>{this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['isChangeActive'](_0x3dc75c['id'])&&(this['_aiReviewCoreEditing']['rejectChange'](_0x3dc75c['id']),this['_currentReviewCheckRun']['markChangeAsRejected'](_0x3dc75c['id']),this['_aiReviewCoreUi']['hideChangeBalloon'](),this['_currentReviewCheckRun']['sendRating'](_0x3dc75c['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',(_0x309ffc,_0x35fa8e)=>{this['_onActivateChange'](_0x35fa8e);}),this['listenTo'](this['_aiReviewCoreUi'],'deactivateChange',(_0x2009e6,_0x6b6ced)=>{this['_onDeactivateChange'](_0x6b6ced);}),this['listenTo'](this['_aiReviewCoreEditing']['emitter'],'changeMarkerClicked',(_0x2e3086,_0xd8a466)=>{this['_onChangeMarkerClicked'](_0x2e3086,_0xd8a466);}),this['listenTo'](this['_aiReviewCoreEditing']['emitter'],'changeMarkerHovered',(_0x2df836,_0x5d935f)=>{this['_onChangeMarkerHovered'](_0x2df836,_0x5d935f);}),this['listenTo'](this['_aiReviewCoreEditing']['emitter'],'changeMarkerBlurred',()=>{this['_onChangeMarkerBlurred']();}),this['listenTo'](this['_aiReviewCoreEditing']['emitter'],'changeMarkerRemoved',(_0x997edf,_0x4aad7d)=>{this['_onChangeMarkerRemoved'](_0x997edf,_0x4aad7d);}),this['listenTo'](this['_aiReviewCoreEditing']['emitter'],'changeMarkerRestored',(_0x1e99e5,_0x390d50)=>{this['_onChangeMarkerRestored'](_0x1e99e5,_0x390d50);});}['_createReviewCheckRun'](_0x1e5543,_0x555f55){return new Ra(this['_aiReviewCoreEditing']['getDocumentData'](),_0x555f55,this['_aiConnector'],_0x1e5543['params'],_0x1e5543['args']);}['_onChangeMarkerRemoved'](_0x204e95,_0x186969){this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['markChangeAsOutdated'](_0x186969['changeId']);}['_onChangeMarkerRestored'](_0x51ddcd,_0x3405dd){this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['markChangeAsPending'](_0x3405dd['changeId']);}['_onCheckRunFinished'](){this['_aiReviewCoreUi']['showReviewCompletedView']();}['_initRequiredPlugins'](){this['_aiConnector']=this['context']['plugins']['get']('AIConnector');}['_onReviewRunLeave'](_0x5618c6=!0x1){this['_currentReviewCheckRun']&&(this['_currentReviewCheckRun']['hasModifications']||this['_currentReviewCheckRun']['sendRating'](),this['_currentReviewCheckRun']['stopListening'](),this['_currentReviewCheckRun']['abort'](),this['_currentReviewCheckRun']=void 0x0),_0x5618c6&&this['_aiReviewCoreUi']['showReviewCheckList'](),this['_aiReviewCoreEditing']['clearAllMarkers'](),this['_aiReviewCoreEditing']['switchToEdit'](),this['_changeActivationSource']=null;for(const _0x44f2a4 of this['_aiReviewCoreEditing']['getEditors']())_0x44f2a4['editing']['view']['change'](_0x1853db=>{for(const _0x47efe1 of _0x44f2a4['editing']['view']['document']['getRoots']())_0x1853db['removeClass']('ck-ai_review-diff',_0x47efe1),_0x1853db['removeClass']('ck-ai_review-highlights',_0x47efe1),_0x1853db['removeClass']('ck-ai-translate-mode-content',_0x47efe1);});}['_getTranslationWithDefault'](_0x312bcd,_0xed6587){const _0x21ae30=hs(this['context']['locale'],_0x312bcd);return _0x21ae30===_0x312bcd?_0xed6587:_0x21ae30;}['_logError'](_0x2e0614,_0x94796=!0x1){Et(_0x2e0614['message']),_0x94796||(_0x2e0614['message']['startsWith']('ai-review-mode-models-unable-to-retrieve')?this['_aiReviewCoreUi']['showGeneralReviewCoreErrorView']():this['_aiReviewCoreUi']['showGeneralResultsErrorView']());}['_scrollToChange'](_0x49e898){if('content'===this['_changeActivationSource']){const _0x1f891e=this['_aiReviewCoreUi']['getChangeElement'](_0x49e898);_0x1f891e&&ft(_0x1f891e['closest']('.ck-ai_review__check-run-result')||_0x1f891e);}else{if('panel'===this['_changeActivationSource']){const _0x483fd3=this['_getChangeContentElement'](_0x49e898);if(!_0x483fd3)return;Ct({'target':_0x483fd3,'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(_0x1bb62b){this['id']=_0x1bb62b['id'],this['commandId']=_0x1bb62b['commandId'],this['title']=_0x1bb62b['title'],this['description']=_0x1bb62b['description'],this['isParameterized']=_0x1bb62b['isParameterized'],this['useArgs']=_0x1bb62b['useArgs'],this['options']=_0x1bb62b['options'],this['args']=_0x1bb62b['args'];}}class va extends ht(){['_checks']=[];['setupChecks'](_0x6d764e){this['_checks']=_0x6d764e['map'](_0x2d9d13=>new Na(_0x2d9d13));}get['checks'](){return this['_checks'];}['getCheckById'](_0x2bfc1e){return this['checks']['find'](_0x51008e=>_0x51008e['id']===_0x2bfc1e);}['removeCheckById'](_0x1ad059){this['_checks']=this['_checks']['filter'](_0x368ba6=>_0x368ba6['id']!==_0x1ad059);}}class ya extends Na{['_models']=[];['_defaultModel']=null;constructor(_0x3115d5,_0x75011b,_0x4bf89d){super(_0x3115d5),this['_models']=_0x75011b,this['_defaultModel']=_0x4bf89d;}get['models'](){return this['_models'];}get['defaultModel'](){return this['_defaultModel'];}}class xa extends Na{['isExtra']=!0x0;['prompt'];['model'];['_defaultModel']=null;constructor(_0x17b011,_0x4cc5bd,_0x3a8275){super(_0x17b011),this['prompt']=_0x17b011['prompt'],this['model']=_0x17b011['model'],this['model']?this['_defaultModel']=_0x4cc5bd['find'](_0x4d77c3=>_0x4d77c3['id']===this['model'])||null:this['_defaultModel']=_0x3a8275;}get['defaultModel'](){return this['_defaultModel'];}}class La extends va{['_allModels']=[];['_recommendedModels']=[];['_defaultModel']=null;constructor(_0x26a83e,_0x7e0ff,_0x5eb2d7){super(),this['_allModels']=_0x26a83e,this['_recommendedModels']=_0x7e0ff,this['_defaultModel']=_0x5eb2d7;}['setupChecks'](_0x8ae4e6){this['_checks']=_0x8ae4e6['map'](_0xc19d1d=>!0x0===_0xc19d1d['isExtra']?new xa(_0xc19d1d,this['_allModels'],this['_defaultModel']):'custom'===_0xc19d1d['id']?new ya(_0xc19d1d,this['_recommendedModels'],this['_defaultModel']):new Na(_0xc19d1d));}}class Da extends Sa{['_prompt'];['_model'];constructor(_0x9cd2ef,_0x54cdbb,_0x1855f9,_0x3cd5ac,_0x22c89b){super(_0x1855f9,_0x3cd5ac,_0x22c89b),this['_prompt']=_0x9cd2ef,this['_model']=_0x54cdbb;}get['subTitle'](){return this['_prompt'];}['_createApiRequest'](){return this['_aiConnector']['callCustomReview']({'content':this['_documentData']['content'],'prompt':this['_prompt'],'model':this['_model']});}['_sendRatingRequest'](_0x37f9b8,_0x39399c,_0x6143e5){return this['_aiConnector']['upsertCustomAIReviewRating'](_0x39399c,_0x37f9b8,_0x6143e5);}}class Pa extends Da{get['subTitle'](){return'';}set['prompt'](_0xfb4366){this['_prompt']=_0xfb4366;}set['model'](_0x45b5ac){this['_model']=_0x45b5ac;}}class Ha extends Oa{static get['pluginName'](){return'AIReviewModeController';}['_isDiffOn']=!0x1;['_hasDefaultAvailableCommands']=!0x1;constructor(_0x4cedd8){super(_0x4cedd8),this['_hasDefaultAvailableCommands']=!this['context']['config']['get']('ai.review.availableCommands'),this['context']['config']['define']('ai.review.availableCommands',ka['map'](_0x400711=>_0x400711['id'])),this['context']['config']['define']('ai.review.extraCommands',[]);}async['init'](){await super['init'](),this['listenTo'](this['_aiReviewCoreUi'],'toggleDiff',(_0x52c416,_0x3d7c37)=>{this['_isDiffOn']=_0x3d7c37['on'],this['_onDiffChange'](this['_isDiffOn']);});}['_initRequiredPlugins'](){super['_initRequiredPlugins'](),this['_aiReviewCoreUi']=this['context']['plugins']['get']('AIReviewModeUI'),this['_aiReviewCoreEditing']=this['context']['plugins']['get']('AIReviewCoreEditing');}['_createReviewCheckRun'](_0x159c47,_0x23bc6d){return _0x159c47['isCustom']?new Da(_0x159c47['args']['prompt'],_0x159c47['args']['model'],this['_aiReviewCoreEditing']['getDocumentData'](),_0x23bc6d,this['_aiConnector']):_0x23bc6d['isExtra']?new Pa(_0x23bc6d['prompt'],_0x23bc6d['defaultModel']['id'],this['_aiReviewCoreEditing']['getDocumentData'](),_0x23bc6d,this['_aiConnector']):new Ra(this['_aiReviewCoreEditing']['getDocumentData'](),_0x23bc6d,this['_aiConnector'],_0x159c47['params'],_0x159c47['args']);}['_onReviewCheckResultActivated'](_0x271e93){this['_aiReviewCoreUi']['setActiveStateInResults'](_0x271e93['change']['id']),this['_scrollToChange'](_0x271e93['change']['id']);const _0x440e4e=this['_aiReviewCoreEditing']['getMarkerElementForChange'](_0x271e93['change']['id']);if(!_0x440e4e)return;const _0x1e4fda=this['_aiReviewCoreEditing']['getEditorForChange'](_0x271e93['change']['id'])??this['_aiReviewCoreEditing']['getEditor']();this['_aiReviewCoreUi']['showChangeBalloon'](_0x271e93['change'],()=>_0x440e4e['getElement'](),void 0x0,'click',this['_getBalloonDomRoot'](_0x1e4fda,_0x440e4e['modelRange']['root']['rootName']),_0x1e4fda?.['ui']?.['viewportOffset']),this['_aiReviewCoreEditing']['setMarkersInElementAsActive'](_0x271e93['change']['id']);}['_onReviewCheckResultDeactivated'](){this['_aiReviewCoreUi']['resetActiveStateInResults'](),this['_aiReviewCoreUi']['hideChangeBalloon'](),this['_aiReviewCoreEditing']['setAllMarkersAsInactive']();}['_onActivateChange'](_0x6c8fb0){this['_currentReviewCheckRun']&&'click'===_0x6c8fb0['uiInteraction']&&(this['_changeActivationSource']='panel',this['_currentReviewCheckRun']['activateChange'](_0x6c8fb0['id']));}['_onDeactivateChange'](_0x467c01){this['_currentReviewCheckRun']&&'balloon'===_0x467c01['origin']&&this['_currentReviewCheckRun']['deactivateChange']();}['_onChangeMarkerClicked'](_0x20ceb6,_0x572ccb){if(!this['_currentReviewCheckRun'])return;this['_changeActivationSource']='content',this['_currentReviewCheckRun']['activateChange'](_0x572ccb['changeId']);const _0x278ab3=this['_currentReviewCheckRun']['getChangeById'](_0x572ccb['changeId']);if(!_0x278ab3)return;const _0x5d13dd=this['_aiReviewCoreEditing']['getMarkerElementForChange'](_0x572ccb['changeId']),_0x3517f8=this['_aiReviewCoreEditing']['getEditorForChange'](_0x572ccb['changeId'])??this['_aiReviewCoreEditing']['getEditor']();this['_aiReviewCoreUi']['showChangeBalloon'](_0x278ab3,_0x572ccb['markerElement'],_0x572ccb['domEvent'],'click',this['_getBalloonDomRoot'](_0x3517f8,_0x5d13dd?.['modelRange']['root']['rootName']),_0x3517f8?.['ui']?.['viewportOffset']);}['_onChangeMarkerHovered'](_0x4183e3,_0x12c355){if(!this['_currentReviewCheckRun'])return;if(this['_currentReviewCheckRun']['isAnyChangeActivated']())return;const _0x388e4a=this['_currentReviewCheckRun']['getChangeById'](_0x12c355['changeId']);if(!_0x388e4a)return;const _0x57ee2f=this['_aiReviewCoreEditing']['getMarkerElementForChange'](_0x12c355['changeId']),_0x2ae53d=this['_aiReviewCoreEditing']['getEditorForChange'](_0x12c355['changeId'])??this['_aiReviewCoreEditing']['getEditor']();this['_aiReviewCoreUi']['showChangeBalloon'](_0x388e4a,_0x12c355['markerElement'],_0x12c355['domEvent'],'hover',this['_getBalloonDomRoot'](_0x2ae53d,_0x57ee2f?.['modelRange']['root']['rootName']),_0x2ae53d?.['ui']?.['viewportOffset']);}['_onChangeMarkerBlurred'](){if(!this['_currentReviewCheckRun'])return;this['_currentReviewCheckRun']['isAnyChangeActivated']()||this['_aiReviewCoreUi']['hideChangeBalloon']();}['_getChangeContentElement'](_0x38fbe9){const _0x34c869=this['_aiReviewCoreEditing']['getMarkerElementForChange'](_0x38fbe9);return _0x34c869?_0x34c869['getElement']():null;}['_markChangePositionInEditorContent'](_0x3a756f,_0x374cc9){this['_aiReviewCoreEditing']['markChangePositionInEditorContent'](_0x3a756f,_0x374cc9);}['_diffContent'](_0x10cb79,_0x51cee4,_0x49cb44){return this['_aiReviewCoreEditing']['diffContent'](_0x10cb79,_0x51cee4,_0x49cb44,!0x1);}['_onReviewCheckRun'](){this['_onDiffChange'](this['_isDiffOn']);}['_onDiffChange'](_0x5ef656){_0x5ef656?this['_aiReviewCoreUi']['hideDiffInBalloon']():this['_aiReviewCoreUi']['showDiffInBalloon']();for(const _0x16af9f of this['_aiReviewCoreEditing']['getEditors']())_0x16af9f['editing']['view']['change'](_0x215c8f=>{for(const _0x4bb233 of _0x16af9f['editing']['view']['document']['getRoots']()){for(const _0x15827d of _0x4bb233['getClassNames']())_0x15827d['startsWith']('ck-ai_review-')&&_0x215c8f['removeClass'](_0x15827d,_0x4bb233);_0x215c8f['addClass'](_0x5ef656?'ck-ai_review-diff':'ck-ai_review-highlights',_0x4bb233);}});}['_getBalloonDomRoot'](_0x2fbfca,_0x564769){const _0x1adf28=_0x2fbfca['editing']['view'];if(_0x564769){const _0x5ab543=_0x1adf28['getDomRoot'](_0x564769);if(_0x5ab543)return _0x5ab543;}return _0x1adf28['getDomRoot']()??void 0x0;}async['_getChecksList'](){const _0xe9b97f=[...ka,...this['_getExtraChecks']()],_0x5454a5=this['context']['config']['get']('ai.review.availableCommands')||[];this['_logErrorForNonExistentChecks'](_0x5454a5,_0xe9b97f);let _0x31d6f1=_0xe9b97f;this['_hasDefaultAvailableCommands']||(_0x31d6f1=_0x5454a5['map'](_0xe9b35b=>_0xe9b97f['find'](_0x4dce13=>_0x4dce13['id']===_0xe9b35b))['filter'](_0x14e498=>!!_0x14e498)),_0x31d6f1=_0x31d6f1['map'](_0x253f92=>_0x253f92['isExtra']?_0x253f92:this['_translateReviewCheck'](_0x253f92));const _0x44df84=_0x31d6f1['some'](_0x41d4cc=>_0x41d4cc['isExtra']||'custom'===_0x41d4cc['id']);let _0x17af8b=[],_0x18bf18=[],_0x17b4c9=null;if(_0x44df84){const _0x4d69f0=await this['_getModels']();_0x17af8b=_0x4d69f0['all'],_0x18bf18=_0x4d69f0['recommended'],_0x17b4c9=_0x4d69f0['default'];}const _0x588599=new La(_0x17af8b,_0x18bf18,_0x17b4c9);return _0x588599['setupChecks'](_0x31d6f1),_0x44df84&&this['_filterChecksWithMissingModel'](_0x588599),_0x588599;}['_getExtraChecks'](){return(this['context']['config']['get']('ai.review.extraCommands')||[])['map'](_0x438089=>({'id':_0x438089['id'],'commandId':_0x438089['id'],'title':_0x438089['label'],'description':_0x438089['description'],'isParameterized':!0x1,'isExtra':!0x0,'prompt':_0x438089['prompt'],'model':_0x438089['model']}));}['_logErrorForNonExistentChecks'](_0x3336ef,_0x1590c8){const _0x49f5a8=_0x3336ef['filter'](_0xec9725=>!_0x1590c8['some'](_0x1be4ad=>_0x1be4ad['id']===_0xec9725));_0x49f5a8['length']&&this['_logError'](new at('ai-review-mode-non-existent-commands-used',this,{'commandIds':_0x49f5a8['join'](',\x20')}),!0x0);}async['_getModels'](){try{const _0x5f5d25=new Fs({'connector':this['_aiConnector'],'config':this['context']['config']['get']('ai.models'),'locale':this['context']['locale']});return{'all':await _0x5f5d25['getAll'](),'recommended':await _0x5f5d25['getAvailableModels'](),'default':await _0x5f5d25['getDefault']()};}catch(_0x5e46a4){return this['_logError'](new at('ai-review-mode-models-unable-to-retrieve',this,void 0x0,_0x5e46a4)),{'all':[],'recommended':[],'default':null};}}['_translateReviewCheck'](_0x1bba06){const _0x35c5b3='AI_REVIEW_CHECK_'+_0x1bba06['id']['toUpperCase']()['replaceAll']('-','_'),_0x5e2fec={..._0x1bba06,'title':this['_getTranslationWithDefault'](_0x35c5b3+'_TITLE',_0x1bba06['title']),'description':this['_getTranslationWithDefault'](_0x35c5b3+'_DESCRIPTION',_0x1bba06['description'])};return _0x1bba06['options']&&(_0x5e2fec['options']=_0x1bba06['options']['map'](_0x17ad86=>({..._0x17ad86,'label':this['_getTranslationWithDefault'](_0x35c5b3+'_OPTIONS_LABEL',_0x17ad86['label']||''),'data':_0x17ad86['data']?_0x17ad86['data']['map'](_0x561682=>({..._0x561682,'label':this['_getTranslationWithDefault'](_0x35c5b3+'_OPTIONS_DATA_'+_0x561682['id']['toUpperCase'](),_0x561682['label'])})):void 0x0}))),_0x5e2fec;}['_filterChecksWithMissingModel'](_0x22f979){const _0x195028=[];_0x22f979['checks']['forEach'](_0x173784=>{(_0x173784 instanceof xa&&!_0x173784['defaultModel']||_0x173784 instanceof ya&&!_0x173784['models']['length'])&&_0x195028['push'](_0x173784['id']);}),_0x195028['length']&&_0x195028['forEach'](_0x26bd1d=>{_0x22f979['removeCheckById'](_0x26bd1d),this['_logError'](new at('ai-review-mode-command-unavailable-due-to-missing-model',this,{'commandId':_0x26bd1d}),!0x0);});}}class Ma extends _0x1c4723{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'](_0x3185aa){this['_checks']=_0x3185aa['map'](_0x10cc65=>new Ua(_0x10cc65));}}class Ba extends Ra{['_title'];constructor(_0x298bb0,_0xca5829,_0x406c8d,_0xf134ee,_0x1e0408,_0xe89fcb){super(_0x298bb0,_0xca5829,_0x406c8d,_0x1e0408,_0xe89fcb),this['_title']=_0xf134ee;}get['title'](){return this['_title'];}get['subTitle'](){return this['_sourceCheck']['title'];}}class Ga extends Oa{static get['pluginName'](){return'AITranslateController';}constructor(_0x50af5f){super(_0x50af5f),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'](_0x1efd06,_0x117715){return new Ba(this['_aiReviewCoreEditing']['getDocumentData'](),_0x117715,this['_aiConnector'],hs(this['context']['locale'],'AI_REVIEW_CHECK_TRANSLATE_TITLE'),_0x1efd06['params'],_0x1efd06['args']);}['_onReviewCheckResultActivated'](_0x9eba8f){this['_aiReviewCoreUi']['setActiveStateInResults'](_0x9eba8f['change']['id']),this['_aiReviewCoreEditing']['setMarkersInElementAsActive'](_0x9eba8f['change']['id']);}['_onReviewCheckResultDeactivated'](){this['_aiReviewCoreEditing']['setAllMarkersAsInactive'](),this['_aiReviewCoreUi']['resetActiveStateInResults']();}['_onActivateChange'](_0x1f9590){this['_currentReviewCheckRun']&&('hover'===_0x1f9590['uiInteraction']&&(this['_changeActivationSource']='panel',this['_currentReviewCheckRun']['activateChange'](_0x1f9590['id'])),'click'===_0x1f9590['uiInteraction']&&this['_scrollToChange'](_0x1f9590['id']));}['_onDeactivateChange'](_0x2c0669){this['_currentReviewCheckRun']&&'panel'===_0x2c0669['origin']&&this['_currentReviewCheckRun']['deactivateChange']();}['_onChangeMarkerClicked'](_0x5106f0,_0x298dd9){this['_currentReviewCheckRun']&&(this['_changeActivationSource']='content',this['_currentReviewCheckRun']['activateChange'](_0x298dd9['changeId']),this['_scrollToChange'](_0x298dd9['changeId']));}['_onChangeMarkerHovered'](_0x9cf7f2,_0x3cb2b6){this['_currentReviewCheckRun']&&(this['_changeActivationSource']='content',this['_currentReviewCheckRun']['activateChange'](_0x3cb2b6['changeId']),this['_aiReviewCoreEditing']['reactivateMarkers'](_0x3cb2b6['changeId']));}['_onChangeMarkerBlurred'](){this['_currentReviewCheckRun']&&'content'===this['_changeActivationSource']&&(this['_currentReviewCheckRun']['deactivateChange'](),this['_aiReviewCoreEditing']['setAllMarkersAsInactive']());}['_getChangeContentElement'](_0x2fb677){return this['_aiReviewCoreEditing']['getContentElementForChange'](_0x2fb677);}['_markChangePositionInEditorContent'](_0x5b70fd,_0x542009){this['_aiReviewCoreEditing']['markChangePositionInEditorContent'](_0x5b70fd,_0x542009);}['_diffContent'](_0xada270,_0x277f73,_0x73097b){return this['_aiReviewCoreEditing']['diffContent'](_0xada270,_0x277f73,_0x73097b,!0x0);}['_onReviewCheckRun'](){for(const _0x4c0f8f of this['_aiReviewCoreEditing']['getEditors']())_0x4c0f8f['editing']['view']['change'](_0x158b4b=>{for(const _0x4714c8 of _0x4c0f8f['editing']['view']['document']['getRoots']())_0x158b4b['addClass']('ck-ai-translate-mode-content',_0x4714c8);});}async['_getChecksList'](){const _0x266d24=[],_0x5c8146=this['context']['config']['get']('ai.translate.languages')||[];for(const _0x5cf518 of _0x5c8146)_0x266d24['push']({'title':_0x5cf518['label'],'id':_0x5cf518['id'],'commandId':_0x5cf518['id'],'description':'','isParameterized':!0x1,'useArgs':!0x0,'args':{'language':_0x5cf518['id']}});const _0x4ced32=new Va();return _0x4ced32['setupChecks'](this['_translateChecks'](_0x266d24)),_0x4ced32;}['_translateChecks'](_0x8f99c6){return _0x8f99c6['map'](_0x1172f8=>{const _0x74cf0e='AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_'+_0x1172f8['title']['toUpperCase']()['replaceAll']('-','_');return{..._0x1172f8,'title':this['_getTranslationWithDefault'](_0x74cf0e,_0x1172f8['title'])};});}}class Fa extends ca{constructor(_0x3289c0,_0x28a6aa){super(_0x3289c0,_0x28a6aa),this['on']('set:isLoading',(_0x1ad467,_0x16127d,_0x14c91b)=>{_0x14c91b&&(this['headerTitle']=hs(this['locale'],'AI_TRANSLATE_CHECK_RESULTS_LOADING_TITLE'));}),this['on']('set:isResultReady',(_0x20e4fb,_0x59c8f8,_0x18194d)=>{_0x18194d&&(this['headerTitle']=hs(this['locale'],'AI_TRANSLATE_CHECK_RESULTS_READY_TITLE'));});}['_createAcceptAllButtonView'](){const _0x2b5295=super['_createAcceptAllButtonView']();return _0x2b5295['set']('label',hs(this['locale'],'AI_TRANSLATE_ACCEPT_ALL')),_0x2b5295;}['_createExitReviewButtonView'](){const _0x431221=super['_createExitReviewButtonView']();return _0x431221['set']('label',hs(this['locale'],'AI_CHAT_HISTORY_CANCEL')),_0x431221;}}class Ka extends pa{['_setupTemplate'](){const _0x42f723=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-translate__check-list-wrapper',_0x42f723['if']('isVisible','ck-hidden',_0x5137ea=>!_0x5137ea)]},'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',_0x42f723['if']('isVisible','ck-hidden',_0x324379=>!_0x324379)]},'children':this['_checkViews']}]});}}class Wa extends ra{static get['pluginName'](){return'AITranslateUI';}['createMainView'](){const _0x34167b=this['context']['plugins']['get']('AITabs'),_0x4ede27=this['context']['locale'],_0xa89330=new eo(_0x4ede27,{'label':hs(_0x4ede27,'AI_REVIEW_CHECK_TRANSLATE_TITLE'),'icon':_0xe821c5,'class':'ck-ai-header_review-translate','showResizeButton':_0x34167b['showResizeButton']});_0xa89330['delegate']('resizeTabs')['to'](_0x34167b),_0xa89330['bind']('isMaximized')['to'](_0x34167b['view'],'isMaximized',_0x354880=>_0x354880);const _0x193c7b=new aa(_0x4ede27,{'header':_0xa89330,'list':new Ka(_0x4ede27),'results':new Fa(_0x4ede27,{'generalErrorText':hs(_0x4ede27,'AI_TRANSLATE_GENERAL_ERROR_MESSAGE')}),'completed':new la(_0x4ede27,{'headerText':hs(_0x4ede27,'AI_TRANSLATE_FINISH_HEADER_TITLE'),'emptyResultsText':hs(_0x4ede27,'AI_TRANSLATE_EMPTY_RESULTS_TEXT'),'buttonText':hs(_0x4ede27,'AI_TRANSLATE_FINISH_BUTTON_LABEL')})});return _0x193c7b['extendTemplate']({'attributes':{'class':'ck-ai-translate-mode'}}),_0x193c7b;}['registerTab'](){const _0x3b9309=this['context']['plugins']['get']('AITabs');_0x3b9309['view']['on']('activateTab',(_0x37d9d5,{newTab:_0x3159c5,oldTab:_0xc78ce8})=>{'translate'===_0x3159c5?this['fire']('getReviewCheckList'):'translate'===_0xc78ce8&&this['fire']('leaveReview');}),_0x3b9309['view']['addTab']({'id':'translate','buttonLabel':hs(this['context']['locale'],'AI_REVIEW_CHECK_TRANSLATE_TITLE'),'buttonIcon':_0xe821c5,'order':0x0,'content':this['_mainView']});}}class Ya extends _0x1c4723{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 _0x3c4360,Command as _0x353726,ContextPlugin as _0x490ade,Editor as _0x52dd99}from'@ckeditor/ckeditor5-core/dist/index.js';import{IconCopy as _0x3bac73,IconCheck as _0x202ca3,IconError as _0x2559e9,IconSubmit as _0x270404,IconAIHistory as _0x4ccc15,IconMagicWand as _0x4d7db5,IconRobotPencil as _0x280e89,IconMaximize as _0x404c0e,IconMinimize as _0x3a0cb5,IconShowChangesOn as _0x54c2f0,IconShowChangesOff as _0x5e81fe,IconDocument as _0x5ed1d7,IconBoxWithCross as _0x51fda2,IconBoxWithCheck as _0x13c3d0,IconBoxWithMarker as _0x4a5638,IconInfo as _0x4a37a4,IconWeb as _0x4cfbb8,IconCancel as _0xf8dc71,IconSelection as _0x5daf20,IconFileUpload as _0xe24ff3,IconLink as _0x4ec276,IconBulb as _0x47cf05,IconAI as _0x57fdf0,IconPreviousArrow as _0x478ce3,IconDocumentOutline as _0xcaba98,IconLoupe as _0x20eade,IconPaperClip as _0xe39455,IconBrowseFiles as _0x365af3,IconDropdownArrow as _0x1c55a8,IconStop as _0x56cd42,IconPlus as _0x2c183e,IconAIChat as _0x4dbd34,IconPin as _0x5bdc0f,IconThreeHorizontalDots as _0x43d94f,IconAIReview as _0x2222ae,IconAITranslate as _0x503fac,IconAIAskAI as _0x1434d8,IconThumbUp as _0x37dbc3,IconThumbDown as _0x36bdc1,IconChevronDown as _0x445f3e,IconChevronUp as _0x54bbe3,IconAIQuickActions as _0x1457fe,IconAIChatCommands as _0x5df412,IconAIImproveWriting as _0x250d0d,IconAIContinueWriting as _0x32b2b5,IconAIGrammarCheck as _0x11716f,IconAIAdjustLength as _0x395348,IconAIChangeTone as _0x1c636a,IconAIOther as _0x56fb4d,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 _0xbc0dcc,FormHeaderView as _0x189b73,HighlightedTextView as _0x3716e9,ViewCollection as _0x4a50ef,FileDialogButtonView as _0x1be7e7,InputTextView as _0x4d8a82,SearchTextView as _0x10c502,ListItemButtonView as _0x34fbce,ButtonLabelWithHighlightView as _0x1f3275,DropdownMenuPanelPositioningFunctions as _0x25d722,BalloonToolbar as _0x3d1dd2,FormRowView as _0x490619,TextareaView as _0x5d5255}from'@ckeditor/ckeditor5-ui/dist/index.js';import{ClipboardPipeline as _0x347d1b,ClipboardMarkersUtils as _0x1d07ea}from'@ckeditor/ckeditor5-clipboard/dist/index.js';import{ViewDocumentDomEventData as _0x852f60,ViewDataTransfer as _0x2bd755,ViewUpcastWriter as _0x1a77b3,Matcher as _0x4fbe09,_DetachOperation as _0x3d7c4f,_insertIntoModelNodeList as _0x4383a2,_removeFromModelNodeList as _0x558a1e,ModelRange as _0x5779b9,transformOperationSets as _0x84a22e,ViewDowncastWriter as _0x3fb8b8,ModelDocumentFragment as _0x342c55,ModelPosition as _0x1c4ec6,ModelTreeWalker as _0x210c56,MarkerOperation as _0x4c42af,InsertOperation as _0x226929}from'@ckeditor/ckeditor5-engine/dist/index.js';import{unescape as _0x5998ae,escape as _0x1db613,cloneDeep as _0x493d9d,throttle as _0x1ae134,debounce as _0xbdcb87,escapeRegExp as _0x865c1f}from'es-toolkit/compat';import{createParser as _0x296409}from'eventsource-parser';import{CloudServices as _0x3ebd57}from'@ckeditor/ckeditor5-cloud-services/dist/index.js';import{parseDocument as _0xa4cc6b}from'htmlparser2';import{isTag as _0x3c6d6b,findOne as _0x4d511d,getParent as _0x3c5b43,findAll as _0x3200a8,removeElement as _0x4da48a,prepend as _0x398bab,prependChild as _0x1b368b,appendChild as _0x5e11d3,append as _0x2260c6,find as _0x5a294d,isComment as _0x320ff7,replaceElement as _0xda6aae,getChildren as _0x2c1273,textContent as _0x5adb77}from'domutils';import ti from'dom-serializer';import{Document as _0x19e721,Element as _0x4b7733,Text as _0x19530c,cloneNode as _0x29aa2a,isDocument as _0x1a821b,isText as _0x4e28f2,NodeWithChildren as _0x110993}from'domhandler';import{MarkdownGfmMdToHtmlDefaultPlugins as _0x433026,MarkdownGfmMdToHtml as _0x21f209}from'@ckeditor/ckeditor5-markdown-gfm/dist/index.js';import _0x50ed3e from'rehype-sanitize';import{fixElementSuggestionRange as _0x3981ff,DocumentCompare as _0x566822,DATA_ID_MODEL_ATTRIBUTE as _0x2afd81,ConfirmMixin as _0x287790,getAllMarkersDomElementsSorted as _0x12ff67,SuggestionsConversion as _0x402556,DATA_ID_VIEW_ATTRIBUTE as _0x2d7115,getMarkerDomElement as _0x5d9dce}from'@ckeditor/ckeditor5-collaboration-core/dist/index.js';import _0x41406e from'morphdom';import{diffArrays as _0x3d1ad3}from'diff';const Ci='_ungrouppedCommands';function wi(_0x3bbf08,_0x2c2085){const _0x2b6e05=(0x0,_0x2c2085['t'])('Other');return _0x3bbf08['length']?'groupId'in _0x3bbf08[0x0]?_0x3bbf08:[{'groupId':Ci,'groupLabel':_0x2b6e05,'order':0x1/0x0,'commands':_0x3bbf08}]:[{'groupId':Ci,'groupLabel':_0x2b6e05,'order':0x1/0x0,'commands':[]}];}const fi=globalThis['DataTransfer'],bi='ai-ui';class Si extends _0x3c4360{static get['pluginName'](){return'AIAssistantEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const {editor:_0xd10af6}=this,_0x247cd6=['ck-fake-ai-selection'];_0xd10af6['config']['get']('ai.assistant.useTheme')&&_0x247cd6['push']('ck-ai-assistant-ui_theme'),_0xd10af6['conversion']['for']('editingDowncast')['markerToHighlight']({'model':bi,'view':{'classes':_0x247cd6,'priority':0xc}}),_0xd10af6['conversion']['for']('editingDowncast')['markerToElement']({'model':bi,'view':(_0x11f024,{writer:_0x37be6d})=>{if(!_0x11f024['markerRange']['isCollapsed'])return null;const _0x6396f5=_0x37be6d['createUIElement']('span');return _0x37be6d['addClass'](['ck-fake-ai-selection','ck-fake-ai-selection_collapsed'],_0x6396f5),_0x6396f5;}});}['afterInit'](){!async function(_0xa9a224){const _0x171dd4=_0x2bc27f([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]),_0x1b0161=0x3dffc4e1,_0x4917ff=0x3df84d11^_0x1b0161,_0x96c970=window[_0x2bc27f([0x44,0x61,0x74,0x65])][_0x2bc27f([0x6e,0x6f,0x77])](),_0x27965e=_0xa9a224[_0x2bc27f([0x65,0x64,0x69,0x74,0x6f,0x72])],_0x48c03e=new window[(_0x2bc27f([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x537a39=>{_0x27965e[_0x2bc27f([0x6f,0x6e,0x63,0x65])](_0x2bc27f([0x72,0x65,0x61,0x64,0x79]),_0x537a39);}),_0x22adc9={[_0x2bc27f([0x6b,0x74,0x79])]:_0x2bc27f([0x45,0x43]),[_0x2bc27f([0x75,0x73,0x65])]:_0x2bc27f([0x73,0x69,0x67]),[_0x2bc27f([0x63,0x72,0x76])]:_0x2bc27f([0x50,0x2d,0x32,0x35,0x36]),[_0x2bc27f([0x78])]:_0x2bc27f([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]),[_0x2bc27f([0x79])]:_0x2bc27f([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]),[_0x2bc27f([0x61,0x6c,0x67])]:_0x2bc27f([0x45,0x53,0x32,0x35,0x36])},_0x717d3b=_0x27965e[_0x2bc27f([0x63,0x6f,0x6e,0x66,0x69,0x67])][_0x2bc27f([0x67,0x65,0x74])](_0x2bc27f([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79]));async function _0x5147e5(){let _0x1d732c,_0x58142f=null,_0xfce161=null;try{if(_0x717d3b==_0x2bc27f([0x47,0x50,0x4c]))return _0x2bc27f([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]);if(_0x1d732c=_0x4c41d2(),!_0x1d732c)return _0x2bc27f([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);return _0x1d732c[_0x2bc27f([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])]&&(_0xfce161=_0x1e30fe(_0x1d732c[_0x2bc27f([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])],_0x1d732c[_0x2bc27f([0x6a,0x74,0x69])])),await _0x3d4093()?_0x5bb958()?_0x15d060()?_0x2bc27f([0x45,0x78,0x70,0x69,0x72,0x65,0x64]):_0x4dbf89()?(_0x1d732c[_0x2bc27f([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])]==_0x2bc27f([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e])&&(_0x58142f=_0x2f3854(_0x2bc27f([0x45,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e,0x4c,0x69,0x6d,0x69,0x74]))),await _0x25405e()):_0x2bc27f([0x44,0x6f,0x6d,0x61,0x69,0x6e,0x4c,0x69,0x6d,0x69,0x74]):_0x2bc27f([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]):_0x2bc27f([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}catch{return _0x2bc27f([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}function _0x15d060(){const _0x5e3215=[_0x2bc27f([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e]),_0x2bc27f([0x74,0x72,0x69,0x61,0x6c])][_0x2bc27f([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x1d732c[_0x2bc27f([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])])?_0x96c970/0x3e8:0xe10*_0x4917ff;return _0x1d732c[_0x2bc27f([0x65,0x78,0x70])]<_0x5e3215;}function _0x5bb958(){const _0x5a2dc8=_0x1d732c[_0x2bc27f([0x66,0x65,0x61,0x74,0x75,0x72,0x65,0x73])];return!!_0x5a2dc8&&(!!_0x5a2dc8[_0x2bc27f([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x2bc27f([0x2a]))||!!_0x5a2dc8[_0x2bc27f([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x2bc27f([0x41,0x49])));}function _0x4dbf89(){const _0x18e8ad=_0x1d732c[_0x2bc27f([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x64,0x48,0x6f,0x73,0x74,0x73])];if(!_0x18e8ad||0x0==_0x18e8ad[_0x2bc27f([0x6c,0x65,0x6e,0x67,0x74,0x68])])return!0x0;const {hostname:_0x5e933c}=new URL(window[_0x2bc27f([0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e])]['href']);if(_0x18e8ad[_0x2bc27f([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x5e933c))return!0x0;const _0x841973=_0x5e933c[_0x2bc27f([0x73,0x70,0x6c,0x69,0x74])](_0x2bc27f([0x2e]));return _0x18e8ad[_0x2bc27f([0x66,0x69,0x6c,0x74,0x65,0x72])](_0x15b6f0=>_0x15b6f0[_0x2bc27f([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x2bc27f([0x2a])))[_0x2bc27f([0x6d,0x61,0x70])](_0x1577fb=>_0x1577fb[_0x2bc27f([0x73,0x70,0x6c,0x69,0x74])](_0x2bc27f([0x2e])))[_0x2bc27f([0x66,0x69,0x6c,0x74,0x65,0x72])](_0x5323ef=>_0x5323ef[_0x2bc27f([0x6c,0x65,0x6e,0x67,0x74,0x68])]<=_0x841973[_0x2bc27f([0x6c,0x65,0x6e,0x67,0x74,0x68])])[_0x2bc27f([0x6d,0x61,0x70])](_0x5bf3a4=>Array(_0x841973[_0x2bc27f([0x6c,0x65,0x6e,0x67,0x74,0x68])]-_0x5bf3a4[_0x2bc27f([0x6c,0x65,0x6e,0x67,0x74,0x68])])[_0x2bc27f([0x66,0x69,0x6c,0x6c])](_0x5bf3a4[0x0]===_0x2bc27f([0x2a])?_0x2bc27f([0x2a]):'')[_0x2bc27f([0x63,0x6f,0x6e,0x63,0x61,0x74])](_0x5bf3a4))[_0x2bc27f([0x73,0x6f,0x6d,0x65])](_0x288e2a=>_0x841973[_0x2bc27f([0x65,0x76,0x65,0x72,0x79])]((_0xa50bbc,_0x381754)=>_0x288e2a[_0x381754]===_0xa50bbc||_0x288e2a[_0x381754]===_0x2bc27f([0x2a])));}function _0x25405e(){return _0x58142f&&_0xfce161?new window[(_0x2bc27f([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0x45b53d,_0x104495)=>{_0x58142f[_0x2bc27f([0x74,0x68,0x65,0x6e])](_0x45b53d,_0x104495),_0xfce161[_0x2bc27f([0x74,0x68,0x65,0x6e])](_0x100a57=>{_0x100a57!=_0x2bc27f([0x56,0x61,0x6c,0x69,0x64])&&_0x45b53d(_0x100a57);},_0x104495);}):_0x58142f||_0xfce161||_0x2bc27f([0x56,0x61,0x6c,0x69,0x64]);}}function _0x1e30fe(_0x8c509,_0x2fbdff){return new window[(_0x2bc27f([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x507adc=>{if(_0x2485c9())return _0x507adc(_0x2bc27f([0x56,0x61,0x6c,0x69,0x64]));_0x2d0484(),_0x27965e[_0x2bc27f([0x64,0x65,0x63,0x6f,0x72,0x61,0x74,0x65])](_0x2bc27f([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]));let _0x4fe89b=!0x1;const _0x54a0a1=ot();function _0x29994a(_0x40fc91){return!!_0x40fc91&&(typeof _0x40fc91===_0x2bc27f([0x6f,0x62,0x6a,0x65,0x63,0x74])||typeof _0x40fc91===_0x2bc27f([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]))&&typeof _0x40fc91[_0x2bc27f([0x74,0x68,0x65,0x6e])]===_0x2bc27f([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e])&&typeof _0x40fc91[_0x2bc27f([0x63,0x61,0x74,0x63,0x68])]===_0x2bc27f([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]);}function _0x393767(_0x3784cd){_0x5a8183(_0x3784cd)[_0x2bc27f([0x74,0x68,0x65,0x6e])](_0x5e07f8=>{if(!_0x5e07f8||_0x5e07f8[_0x2bc27f([0x73,0x74,0x61,0x74,0x75,0x73])]!=_0x2bc27f([0x6f,0x6b]))return _0x2bc27f([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]);return _0x5a23c7(_0x22062e(_0x54a0a1+_0x2fbdff))!=_0x5e07f8[_0x2bc27f([0x76,0x65,0x72,0x69,0x66,0x69,0x63,0x61,0x74,0x69,0x6f,0x6e])]?_0x2bc27f([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]):_0x2bc27f([0x56,0x61,0x6c,0x69,0x64]);})[_0x2bc27f([0x74,0x68,0x65,0x6e])](_0x35247b=>(_0x449ad9(),_0x35247b),()=>{const _0xa28558=_0x2558c1();return null==_0xa28558?(_0x449ad9(),_0x2bc27f([0x56,0x61,0x6c,0x69,0x64])):_0x2bc27f(_0x96c970-_0xa28558>(0x19f340e1^_0x1b0161)?[0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]:[0x56,0x61,0x6c,0x69,0x64]);})[_0x2bc27f([0x74,0x68,0x65,0x6e])](_0x507adc)[_0x2bc27f([0x63,0x61,0x74,0x63,0x68])](()=>{_0x507adc(_0x2bc27f([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});const _0x331cce=0x3dc92a61^_0x1b0161;function _0x449ad9(){const _0x38d57b=_0x2bc27f([0x6c,0x6c,0x63,0x74,0x2d])+_0x5a23c7(_0x22062e(_0x8c509)),_0x53d67f=_0x3d6424(_0x5a23c7(window[_0x2bc27f([0x4d,0x61,0x74,0x68])][_0x2bc27f([0x63,0x65,0x69,0x6c])](_0x96c970/_0x331cce)));window[_0x2bc27f([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0x2bc27f([0x73,0x65,0x74,0x49,0x74,0x65,0x6d])](_0x38d57b,_0x53d67f);}function _0x2558c1(){const _0x3fd635=_0x2bc27f([0x6c,0x6c,0x63,0x74,0x2d])+_0x5a23c7(_0x22062e(_0x8c509)),_0x34b4aa=window[_0x2bc27f([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0x2bc27f([0x67,0x65,0x74,0x49,0x74,0x65,0x6d])](_0x3fd635);return _0x34b4aa?window[_0x2bc27f([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x3d6424(_0x34b4aa),0x10)*_0x331cce:null;}function _0x5a8183(_0x40cd24){return new window[(_0x2bc27f([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0x61c30d,_0xecd568)=>{_0x40cd24[_0x2bc27f([0x74,0x68,0x65,0x6e])](_0x61c30d,_0xecd568),window[_0x2bc27f([0x73,0x65,0x74,0x54,0x69,0x6d,0x65,0x6f,0x75,0x74])](_0xecd568,0x3dfe1021^_0x1b0161);});}}_0x27965e[_0x2bc27f([0x6f,0x6e])](_0x2bc27f([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),(_0x19750f,_0x3f7163)=>{if(_0x3f7163[0x0]!=_0x8c509)return _0x507adc(_0x2bc27f([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));_0x3f7163[0x1]={..._0x3f7163[0x1],[_0x2bc27f([0x72,0x65,0x71,0x75,0x65,0x73,0x74,0x49,0x64])]:_0x54a0a1};},{[_0x2bc27f([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0x2bc27f([0x68,0x69,0x67,0x68])}),_0x27965e[_0x2bc27f([0x6f,0x6e])](_0x2bc27f([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),_0x372c3b=>{_0x29994a(_0x372c3b[_0x2bc27f([0x72,0x65,0x74,0x75,0x72,0x6e])])&&(_0x4fe89b=!0x0,_0x393767(_0x372c3b[_0x2bc27f([0x72,0x65,0x74,0x75,0x72,0x6e])]));},{[_0x2bc27f([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0x2bc27f([0x6c,0x6f,0x77])}),_0x48c03e[_0x2bc27f([0x74,0x68,0x65,0x6e])](()=>{_0x4fe89b||_0x507adc(_0x2bc27f([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});});function _0x2485c9(){return _0x27965e[_0x2bc27f([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0x2bc27f([0x76,0x69,0x65,0x77])][_0x2bc27f([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]==_0x2bc27f([0x61,0x75,0x74,0x6f]);}function _0x2d0484(){_0x27965e[_0x2bc27f([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0x2bc27f([0x76,0x69,0x65,0x77])][_0x2bc27f([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]=_0x2bc27f([0x61,0x75,0x74,0x6f]);}}function _0x2f3854(_0x2a9b6a){const _0x4f1087=[new window[(_0x2bc27f([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x3443d8=>setTimeout(_0x3443d8,0x3df6fa2d^_0x1b0161)),_0x48c03e[_0x2bc27f([0x74,0x68,0x65,0x6e])](()=>new window[(_0x2bc27f([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x1cc36b=>{let _0x4ad385=0x0;_0x27965e[_0x2bc27f([0x6d,0x6f,0x64,0x65,0x6c])][_0x2bc27f([0x6f,0x6e])](_0x2bc27f([0x61,0x70,0x70,0x6c,0x79,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e]),(_0x45b7e7,_0x19afa3)=>{_0x19afa3[0x0][_0x2bc27f([0x69,0x73,0x44,0x6f,0x63,0x75,0x6d,0x65,0x6e,0x74,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e])]&&_0x4ad385++,_0x4ad385==(0x3dffc109^_0x1b0161)&&(_0x1cc36b(),_0x45b7e7[_0x2bc27f([0x6f,0x66,0x66])]());});}))];return window[_0x2bc27f([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65])][_0x2bc27f([0x72,0x61,0x63,0x65])](_0x4f1087)[_0x2bc27f([0x74,0x68,0x65,0x6e])](()=>_0x2a9b6a);}async function _0x2f2a44(){await _0x48c03e,_0x27965e[_0x2bc27f([0x6d,0x6f,0x64,0x65,0x6c])][_0x2bc27f([0x63,0x68,0x61,0x6e,0x67,0x65])]=_0xcecce9,_0x27965e[_0x2bc27f([0x6d,0x6f,0x64,0x65,0x6c])][_0x2bc27f([0x65,0x6e,0x71,0x75,0x65,0x75,0x65,0x43,0x68,0x61,0x6e,0x67,0x65])]=_0xcecce9,_0x27965e[_0x2bc27f([0x65,0x6e,0x61,0x62,0x6c,0x65,0x52,0x65,0x61,0x64,0x4f,0x6e,0x6c,0x79,0x4d,0x6f,0x64,0x65])](_0x2bc27f([0x6d,0x6f,0x64,0x65,0x6c]));}function _0x3250bb(_0x5ed970){const _0x59323e=_0x89c890();_0x27965e[_0x59323e]=_0x2bc27f([0x61,0x69,0x4c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79])+_0x5ed970,_0x5ed970!=_0x2bc27f([0x56,0x61,0x6c,0x69,0x64])&&_0x2f2a44();}function _0x89c890(){const _0x4415e7=window[_0x2bc27f([0x53,0x74,0x72,0x69,0x6e,0x67])](window[_0x2bc27f([0x70,0x65,0x72,0x66,0x6f,0x72,0x6d,0x61,0x6e,0x63,0x65])][_0x2bc27f([0x6e,0x6f,0x77])]())[_0x2bc27f([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](_0x2bc27f([0x2e]),'');let _0x21ae29=_0x2bc27f([0x6e]);for(let _0x4f72c=0x0;_0x4f72c<_0x4415e7[_0x2bc27f([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0x4f72c+=0x2){let _0x593a45=window[_0x2bc27f([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x4415e7[_0x2bc27f([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0x4f72c,_0x4f72c+0x2));_0x593a45>=_0x171dd4[_0x2bc27f([0x6c,0x65,0x6e,0x67,0x74,0x68])]&&(_0x593a45-=_0x171dd4[_0x2bc27f([0x6c,0x65,0x6e,0x67,0x74,0x68])]),_0x21ae29+=_0x171dd4[_0x593a45];}return _0x21ae29;}function _0x4c41d2(){const _0x48445c=_0x717d3b[_0x2bc27f([0x73,0x70,0x6c,0x69,0x74])](_0x2bc27f([0x2e]));if(0x3!=_0x48445c[_0x2bc27f([0x6c,0x65,0x6e,0x67,0x74,0x68])])return null;return _0x1ee04f(_0x48445c[0x1]);function _0x1ee04f(_0xf06e0d){const _0x44e94b=_0x294dd1(_0xf06e0d);return _0x44e94b&&_0x83b69()?_0x44e94b:null;function _0x83b69(){const _0x2a0a53=_0x44e94b[_0x2bc27f([0x6a,0x74,0x69])],_0x82bf50=window[_0x2bc27f([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x2a0a53[_0x2bc27f([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0x2a0a53[_0x2bc27f([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8),0x10),_0x998015={..._0x44e94b,[_0x2bc27f([0x6a,0x74,0x69])]:_0x2a0a53[_0x2bc27f([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](0x0,_0x2a0a53[_0x2bc27f([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8)};return delete _0x998015[_0x2bc27f([0x76,0x63])],_0x22062e(_0x998015)==_0x82bf50;}}}async function _0x3d4093(){let _0x415706=!0x0;try{const _0x14d30e=_0x717d3b[_0x2bc27f([0x73,0x70,0x6c,0x69,0x74])](_0x2bc27f([0x2e])),[_0x5a4006,_0x40f285,_0x59aa48]=_0x14d30e;return _0x1880c8(_0x5a4006),await _0x341bda(_0x5a4006,_0x40f285,_0x59aa48),_0x415706;}catch{return!0x1;}function _0x1880c8(_0x3bd1f5){const _0x6fb2e5=_0x294dd1(_0x3bd1f5);_0x6fb2e5&&_0x6fb2e5[_0x2bc27f([0x61,0x6c,0x67])]==_0x2bc27f([0x45,0x53,0x32,0x35,0x36])||(_0x415706=!0x1);}async function _0x341bda(_0x449211,_0x407b6d,_0x1d6a62){const _0x39accf=window[_0x2bc27f([0x55,0x69,0x6e,0x74,0x38,0x41,0x72,0x72,0x61,0x79])][_0x2bc27f([0x66,0x72,0x6f,0x6d])](_0x1886e9(_0x1d6a62),_0x363650=>_0x363650[_0x2bc27f([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](0x0)),_0x3ecade=new window[(_0x2bc27f([0x54,0x65,0x78,0x74,0x45,0x6e,0x63,0x6f,0x64,0x65,0x72]))]()[_0x2bc27f([0x65,0x6e,0x63,0x6f,0x64,0x65])](_0x449211+_0x2bc27f([0x2e])+_0x407b6d),_0x555629=window[_0x2bc27f([0x63,0x72,0x79,0x70,0x74,0x6f])][_0x2bc27f([0x73,0x75,0x62,0x74,0x6c,0x65])];if(!_0x555629)return;const _0x398142=await _0x555629[_0x2bc27f([0x69,0x6d,0x70,0x6f,0x72,0x74,0x4b,0x65,0x79])](_0x2bc27f([0x6a,0x77,0x6b]),_0x22adc9,{[_0x2bc27f([0x6e,0x61,0x6d,0x65])]:_0x2bc27f([0x45,0x43,0x44,0x53,0x41]),[_0x2bc27f([0x6e,0x61,0x6d,0x65,0x64,0x43,0x75,0x72,0x76,0x65])]:_0x2bc27f([0x50,0x2d,0x32,0x35,0x36])},!0x1,[_0x2bc27f([0x76,0x65,0x72,0x69,0x66,0x79])]);await _0x555629[_0x2bc27f([0x76,0x65,0x72,0x69,0x66,0x79])]({[_0x2bc27f([0x6e,0x61,0x6d,0x65])]:_0x2bc27f([0x45,0x43,0x44,0x53,0x41]),[_0x2bc27f([0x68,0x61,0x73,0x68])]:{[_0x2bc27f([0x6e,0x61,0x6d,0x65])]:_0x2bc27f([0x53,0x48,0x41,0x2d,0x32,0x35,0x36])}},_0x398142,_0x39accf,_0x3ecade)||(_0x415706=!0x1);}}function _0x294dd1(_0x33c5ad){return _0x33c5ad[_0x2bc27f([0x73,0x74,0x61,0x72,0x74,0x73,0x57,0x69,0x74,0x68])](_0x2bc27f([0x65,0x79]))?JSON[_0x2bc27f([0x70,0x61,0x72,0x73,0x65])](_0x1886e9(_0x33c5ad)):null;}function _0x1886e9(_0x57a7c7){return window[_0x2bc27f([0x61,0x74,0x6f,0x62])](_0x57a7c7[_0x2bc27f([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/-/g,_0x2bc27f([0x2b]))[_0x2bc27f([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/_/g,_0x2bc27f([0x2f])));}function _0x22062e(_0x5d3b05){let _0x3c6b33=0x1505;function _0x131153(_0x2d4beb){for(let _0x59d175=0x0;_0x59d175<_0x2d4beb[_0x2bc27f([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0x59d175++){const _0x1b3831=_0x2d4beb[_0x2bc27f([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](_0x59d175);_0x3c6b33=(_0x3c6b33<<0x5)+_0x3c6b33+_0x1b3831,_0x3c6b33&=_0x3c6b33;}}function _0x6a3d40(_0x53e941){Array[_0x2bc27f([0x69,0x73,0x41,0x72,0x72,0x61,0x79])](_0x53e941)?_0x53e941[_0x2bc27f([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](_0x6a3d40):_0x53e941&&typeof _0x53e941==_0x2bc27f([0x6f,0x62,0x6a,0x65,0x63,0x74])?Object[_0x2bc27f([0x65,0x6e,0x74,0x72,0x69,0x65,0x73])](_0x53e941)[_0x2bc27f([0x73,0x6f,0x72,0x74])]()[_0x2bc27f([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](([_0x2d698c,_0x33a18e])=>{_0x131153(_0x2d698c),_0x6a3d40(_0x33a18e);}):_0x131153(window[_0x2bc27f([0x53,0x74,0x72,0x69,0x6e,0x67])](_0x53e941));}return _0x6a3d40(_0x5d3b05),_0x3c6b33>>>0x0;}function _0x5a23c7(_0x42b31e){return _0x42b31e[_0x2bc27f([0x74,0x6f,0x53,0x74,0x72,0x69,0x6e,0x67])](0x10)[_0x2bc27f([0x70,0x61,0x64,0x53,0x74,0x61,0x72,0x74])](0x8,_0x2bc27f([0x30]));}function _0x3d6424(_0x1514a8){return _0x1514a8[_0x2bc27f([0x73,0x70,0x6c,0x69,0x74])]('')[_0x2bc27f([0x72,0x65,0x76,0x65,0x72,0x73,0x65])]()[_0x2bc27f([0x6a,0x6f,0x69,0x6e])]('');}function _0xcecce9(){}function _0x2bc27f(_0x286a6c){return _0x286a6c['map'](_0x92cb73=>String['fromCharCode'](_0x92cb73))['join']('');}_0x3250bb(await _0x5147e5());}(this);}['showFakeVisualSelection'](){const _0x5f3675=this['editor']['model'];_0x5f3675['change'](_0x30a5db=>{const _0x201dff=_0x5f3675['document']['selection']['getRanges']();let _0x1cd3f9=0x0;for(const _0x1a856f of _0x201dff){const _0x245aad=bi+':'+_0x1cd3f9;if(_0x5f3675['markers']['has'](_0x245aad))_0x30a5db['updateMarker'](_0x245aad,{'range':_0x1a856f});else{if(_0x1a856f['start']['isAtEnd']){const _0x3797e0=_0x1a856f['start']['getLastMatchingPosition'](({item:_0x17b99a})=>!_0x5f3675['schema']['isContent'](_0x17b99a),{'boundaries':_0x1a856f});_0x30a5db['addMarker'](_0x245aad,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x30a5db['createRange'](_0x3797e0,_0x1a856f['end'])});}else _0x30a5db['addMarker'](_0x245aad,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x1a856f});}_0x1cd3f9++;}});}['hideFakeVisualSelection'](){const _0x177ec0=this['editor']['model'],_0xfde1f1=Array['from'](this['editor']['model']['markers']['getMarkersGroup'](bi));_0xfde1f1['length']&&_0x177ec0['change'](_0xd5f400=>{_0xfde1f1['forEach'](_0x58fdbd=>{_0xd5f400['removeMarker'](_0x58fdbd);});});}['insertContent'](_0x4509e7,_0x211189){const _0x9a9538=this['_getAISelection'](),_0x5264dc=_0x211189||_0x9a9538['getFirstRange']();this['editor']['model']['canEditAt'](_0x5264dc)&&this['editor']['model']['change'](_0x4e5629=>{this['hideFakeVisualSelection'](),_0x211189||this['_resetContentOfSelectedTableCells'](_0x4e5629,_0x9a9538),this['_pasteHTMLUsingClipboard']({'insertAt':_0x5264dc,'writer':_0x4e5629,'html':_0x4509e7});});}['insertContentBelow'](_0x2a6966){const {model:_0x15f46c}=this['editor'],_0x4babfc=this['_getAISelection']();_0x15f46c['change'](()=>{const _0x290a65=this['_prepareTableInsertBelowPosition'](_0x2a6966,_0x4babfc)||this['_getDefaultInsertBelowPosition'](_0x4babfc);this['insertContent'](_0x2a6966,_0x290a65);});}['_getAISelection'](){const _0x5a5b5f=this['editor']['model'],_0xe89923=Array['from'](_0x5a5b5f['markers']['getMarkersGroup'](bi))['map'](_0x519f9b=>_0x519f9b['getRange']());return _0x5a5b5f['createSelection'](_0xe89923);}['_pasteHTMLUsingClipboard']({writer:_0xfa7f0a,html:_0x1d4bc3,insertAt:_0x1c1ea3}){const {view:_0x469619}=this['editor']['editing'],_0x385b43=this['editor']['plugins']['get'](_0x347d1b),_0x293eee=new fi();_0x293eee['setData']('text/html',_0x1d4bc3);const _0x14d590=new ClipboardEvent('paste',{'clipboardData':_0x293eee}),_0xe1351b=new _0x852f60(_0x469619,_0x14d590,{'dataTransfer':new _0x2bd755(_0x293eee)});_0xfa7f0a['setSelection'](_0x1c1ea3);const _0x459b22=(_0x55a7b0,_0x212ec5)=>{_0x212ec5['resultRange']&&_0xfa7f0a['setSelection'](_0x212ec5['resultRange']);};_0x385b43['once']('contentInsertion',_0x459b22,{'priority':'lowest'}),_0x469619['document']['fire']('paste',_0xe1351b),_0x385b43['off']('contentInsertion',_0x459b22);}['_getDefaultInsertBelowPosition'](_0x44b63d){const {model:_0x9a4955}=this['editor'],_0x5bb2f1=Array['from'](_0x44b63d['getSelectedBlocks']());return _0x5bb2f1['length']?_0x9a4955['createPositionAfter'](_0x5bb2f1['pop']()):_0x44b63d['getLastPosition']();}['_prepareTableInsertBelowPosition'](_0x470a87,_0x97ecb){const {model:_0x2d7966,plugins:_0x41a55a}=this['editor'];if(_0x41a55a['has']('TableUtils')){const _0x3c9111=_0x41a55a['get']('TableUtils')['getSelectedTableCells'](_0x97ecb);if(_0x3c9111['length']){const _0x3e6db6=this['_getTableRowCountFromContent'](_0x470a87),_0x2f64cf=this['_createEmptyTableRows'](_0x3c9111,_0x3e6db6);return _0x2d7966['createPositionAt'](_0x2f64cf,0x0);}}return null;}['_getTableRowCountFromContent'](_0x3fe28b){const _0x1bcf13=this['editor']['plugins']['get']('TableUtils'),_0x220973=this['editor']['data']['parse'](_0x3fe28b),_0x57e116=Array['from'](_0x220973['getChildren']())['filter'](_0x2923ad=>_0x2923ad['is']('element','table'));let _0x4f965e=0x0;return _0x57e116['forEach'](_0x5b2081=>{_0x4f965e+=_0x1bcf13['getRows'](_0x5b2081);}),_0x4f965e;}['_createEmptyTableRows'](_0x2939af,_0x5da87d){const _0xdcbbe4=this['editor']['plugins']['get']('TableUtils'),_0x14435e=_0xdcbbe4['getRowIndexes'](_0x2939af),_0x2923a5=_0xdcbbe4['getColumnIndexes'](_0x2939af),_0x5000ad=_0x14435e['last']+0x1,_0x5639e1=_0x2923a5['first'],_0x119cf7=_0x2939af[0x0]['findAncestor']('table');for(let _0x1f18e0=0x0;_0x1f18e0<_0x5da87d;_0x1f18e0++)_0xdcbbe4['insertRows'](_0x119cf7,{'at':_0x5000ad});return _0x119cf7['getChild'](_0x5000ad)['getChild'](_0x5639e1);}['_resetContentOfSelectedTableCells'](_0x32fcdc,_0x5762ad){const {plugins:_0x481fb7}=this['editor'],{model:_0xb3255d}=_0x32fcdc;if(!_0x481fb7['has']('TableUtils'))return;_0x481fb7['get']('TableUtils')['getSelectedTableCells'](_0x5762ad)['length']&&_0xb3255d['deleteContent'](_0x5762ad);}}class Ri extends _0x3c4360{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(_0x5008e5){super(_0x5008e5),this['name']='AIRequestError';}}function ki(_0x35026f,_0x142f76,_0x656814){const t=_0x35026f['t'];switch(_0x142f76){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',_0x656814);case'Error\x20during\x20AI\x20content\x20generation:\x20%0':return t('Error\x20during\x20AI\x20content\x20generation:\x20%0',_0x656814);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'},_0x656814);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 _0x142f76;}}class Ni extends _0x353726{['_commandDefinitions'];constructor(_0x4eb815,_0x1ac8c5){super(_0x4eb815),this['_commandDefinitions']=_0x1ac8c5,this['set']('enabledCommandsIds',[]),this['on']('change:_hasContext',(_0x5be45d,_0x3e69f3,_0x8e626f)=>{this['isEnabled']&&(this['enabledCommandsIds']=vi(this['_commandDefinitions'],_0x8e626f));}),this['set']('_hasContext',!0x1),this['on']('change:isEnabled',(_0x32ad91,_0x521b5c,_0x13a822)=>{this['enabledCommandsIds']=_0x13a822?vi(this['_commandDefinitions'],this['_hasContext']):[];});}['refresh'](){const _0x107e14=this['editor']['model'];this['_hasContext']=function(_0xb832b9){const _0x36b6ad=_0xb832b9['document']['selection'];return _0x36b6ad['isCollapsed']?0x0!==[..._0x36b6ad['getSelectedBlocks']()]['length']&&![..._0x36b6ad['getSelectedBlocks']()][0x0]['isEmpty']:!!_0xb832b9['hasContent'](_0x36b6ad['getFirstRange']());}(_0x107e14);const _0x1d448f=_0x107e14['document']['selection'],_0x1381ec=this['editor']['config']['get']('ai.assistant.disabledElements');for(const _0x2217cd of _0x1d448f['getRanges']())for(const _0x142ccf of _0x2217cd['getItems']())if(_0x142ccf['is']('element')&&_0x1381ec['includes'](_0x142ccf['name']))return void(this['isEnabled']=!0x1);this['isEnabled']=!0x0;}['execute'](_0x34d36a='',_0x3ebb0f='',_0x20058e='custom'){this['editor']['plugins']['get']($i)['showUI'](_0x34d36a,_0x3ebb0f,_0x20058e);}}function vi(_0x27cb7b,_0x4e27da){const _0xfdcd7c=new Set();for(const _0x52331c of _0x27cb7b['values']())(_0x4e27da||!0x1===_0x52331c['requiresContent'])&&_0xfdcd7c['add'](_0x52331c['id']);return Array['from'](_0xfdcd7c);}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(_0x104e37,_0x3007bc,_0x39d12a){super(),this['editor']=_0x104e37,this['textAdapter']=_0x3007bc,this['_sanitizationContainer']=document['createElement']('div'),this['_domParser']=new DOMParser(),this['_xmlSerializer']=new XMLSerializer(),this['view']=_0x39d12a,this['set']({'initialContext':'','currentContext':'','currentResponse':'','previousContext':void 0x0,'previousQuery':void 0x0,'previousLabel':void 0x0,'isProcessing':!0x1}),this['on']('set:currentContext',(_0x13e689,_0x30f9f1,_0x40726d)=>{this['view']['value']=this['_sanitizeHTML'](_0x40726d);}),this['listenTo'](this['view'],'submitPrompt',(_0x3cdc2f,_0x1aad2a)=>{const _0x3cb327=this['currentContext']||this['initialContext'];this['_handleQuery'](_0x1aad2a,_0x3cb327,'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:_0x58d300,query:_0x1a5ab1,htmlContent:_0x5a6d6c,label:_0xe8a545,mainActionLabel:_0x2b3343}){this['view']['prompt']=_0xe8a545,this['view']['mainAction']=_0x2b3343,this['initialContext']=_0x5a6d6c,_0x1a5ab1&&(this['view']['isRendered']?this['_handleQuery'](_0x1a5ab1,_0x5a6d6c,_0x58d300,_0xe8a545):this['view']['once']('render',()=>{this['_handleQuery'](_0x1a5ab1,_0x5a6d6c,_0x58d300,_0xe8a545);}));}['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'](_0xe9a275,_0xbfe10,_0x217405,_0x3dc21e){return this['isProcessing']=!0x0,this['view']['startProcessing'](),this['previousContext']=_0xbfe10,this['previousQuery']=_0xe9a275,this['previousLabel']=_0x3dc21e||_0xe9a275,this['previousActionId']=_0x217405,new Promise(_0x1f0445=>{this['textAdapter']['makeRequest']({'query':_0xe9a275,'context':_0xbfe10,'onData':_0x382010=>{this['currentResponse']=_0x382010,this['currentContext']=this['_parseAndNormalizeContent'](this['currentResponse']);},'actionId':_0x217405})['then'](()=>{!this['currentContext']&&this['currentResponse']&&(this['currentContext']=this['_parseAndNormalizeContent'](this['currentResponse'],!0x0));})['catch'](_0x5bbf70=>{_0x5bbf70 instanceof Oi?this['view']['handleError'](_0x5bbf70['message']):this['view']['handleError'](),_0x1f0445();})['finally'](()=>{this['stopProcessing'](),_0x1f0445();});});}['_parseAndNormalizeContent'](_0x523a28,_0x1b94ed=!0x1){const _0x1a0a08=yi['exec'](_0x523a28);_0x523a28=_0x1a0a08?_0x523a28['substring'](_0x1a0a08[0x1]['length']):_0x523a28['length']<0x64&&!_0x1b94ed?'':this['_stripMarkdownSyntax'](_0x523a28);const _0xe3ece7=this['_domParser']['parseFromString'](_0x523a28,'text/html');if(_0x1a0a08){const _0x20ddf3=Array['from'](_0xe3ece7['body']['childNodes']);_0x20ddf3['reverse']();for(const _0x5a8102 of _0x20ddf3){if(_0x5a8102['nodeType']==Node['ELEMENT_NODE'])break;_0x5a8102['remove']();}}const _0x540309=this['editor']['data']['processor']['toView'](this['_xmlSerializer']['serializeToString'](_0xe3ece7['body']));this['_isH1TagSupportEnabled']()||this['_normalizeResponseHeadings'](_0x540309);const _0x4eb611=this['editor']['config']['get']('ai.assistant.preserveComments'),_0x1a5a1b=this['editor']['data']['toModel'](_0x540309);return _0x4eb611||_0x1a5a1b['markers']['clear'](),this['editor']['data']['stringify'](_0x1a5a1b);}['_normalizeResponseHeadings'](_0x354551){const _0x3aca63=new _0x1a77b3(this['editor']['editing']['view']['document']),_0x430644=new _0x4fbe09({'name':/^h[1-5]$/}),_0x2288d6=[];let _0x5cfcea=!0x1;for(const _0x2ab12a of _0x354551)_0x2ab12a['is']('element')&&_0x430644['match'](_0x2ab12a)&&(_0x2288d6['push'](_0x2ab12a),'h1'==_0x2ab12a['name']&&(_0x5cfcea=!0x0));if(_0x5cfcea){for(const _0x180098 of _0x2288d6)_0x3aca63['rename']('h'+(parseInt(_0x180098['name'][0x1])+0x1),_0x180098);}}['_isH1TagSupportEnabled'](){const {data:_0x140de1,editing:_0x26158e}=this['editor'],_0x3e7fad=_0x140de1['htmlProcessor']['toView']('<h1></h1>'),_0x68e4a4=_0x140de1['toView'](_0x140de1['toModel'](_0x3e7fad));return!!_0x26158e['view']['domConverter']['viewToDom'](_0x68e4a4)['querySelector']('h1');}['_sanitizeHTML'](_0x561374){return this['editor']['editing']['view']['domConverter']['setContentOf'](this['_sanitizationContainer'],_0x561374),this['_sanitizationContainer']['innerHTML'];}['_stripMarkdownSyntax'](_0x163f60){const _0x323c1d=_0x163f60['trim']();return _0x323c1d['startsWith']('```html')?_0x323c1d['endsWith']('```')?_0x323c1d['substring'](0x7,_0x323c1d['length']-0x3):_0x323c1d['substring'](0x7):_0x163f60;}}const Li={'REPLACE':'replace','INSERT':'insert'};class Di extends kt{constructor(_0x4e7624){super(_0x4e7624),this['set']('isVisible',!0x1),this['set']('mainAction',Li['REPLACE']),this['replaceButton']=this['_createButton']('','ck-button-action'),this['replaceButton']['bind']('label')['to'](this,'mainAction',_0x5a83e3=>ki(_0x4e7624,'AI_'+_0x5a83e3['toUpperCase']()+'_CONTENT')),this['insertButton']=this['_createButton'](ki(_0x4e7624,'Insert\x20below')),this['tryAgainButton']=this['_createButton'](ki(_0x4e7624,'Try\x20again')),this['stopButton']=this['_createButton'](ki(_0x4e7624,'Stop'));const _0x1c0834=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':['ck-ai-form__toolbar',_0x1c0834['if']('isVisible','ck-hidden',_0x13bf21=>!_0x13bf21)]}}),this['items']['addMany']([this['replaceButton'],this['insertButton'],this['tryAgainButton'],this['stopButton']]);}['_createButton'](_0x214cb9,_0x5f5c75){const _0x12af21=new Nt(this['locale']);return _0x12af21['set']({'label':_0x214cb9,'class':_0x5f5c75||'','isVisible':!0x0,'withText':!0x0}),_0x12af21;}}class Pi extends vt{['contentFieldView'];['copyButtonView'];constructor(_0x40daac,_0x28d12c=''){super(_0x40daac),this['set']({'value':null,'isVisible':!0x1,'isProcessing':!0x1});const _0x4345f8=this['bindTemplate'];this['contentFieldView']=new Hi(_0x40daac,_0x28d12c),this['copyButtonView']=this['_createCopyButton'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area-wrapper',_0x4345f8['if']('isVisible','ck-hidden',_0x23f595=>!_0x23f595)],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area',_0x4345f8['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 _0x56ab44=!0x1;this['on']('change:value',(_0x2dbeaa,_0x411402,_0x435c09)=>{const _0x428a4b=!this['contentFieldView']['element']['querySelector']('.ck-ai-form__loader');this['contentFieldView']['setContent'](_0x435c09),this['isProcessing']&&_0x428a4b&&!_0x56ab44&&this['element']['scrollTo']({'top':this['element']['scrollHeight'],'behavior':'smooth'});}),this['on']('change:isProcessing',(_0x2ba64a,_0x345b36,_0x3c78ab)=>{_0x56ab44=!0x1,_0x3c78ab?(this['value']=null,this['contentFieldView']['appendLoader']()):this['value']||this['contentFieldView']['setContent']('');}),this['listenTo'](this['element'],'wheel',()=>{_0x56ab44=!0x0;}),this['listenTo'](this['element'],'mousedown',()=>{_0x56ab44=!0x0;});}['focus'](){this['element']['focus']();}['_createCopyButton'](){const _0x2a5b97=this['locale'],_0x540cda=new Nt(this['locale']),_0x25895f='ck-ai-form__copy-button';return _0x540cda['set']({'label':ki(_0x2a5b97,'Copy'),'icon':_0x3bac73,'class':_0x25895f,'tooltip':!0x0}),_0x540cda['bind']('isVisible')['to'](this,'value',_0x1be2f0=>!!_0x1be2f0),_0x540cda['bind']('isEnabled')['to'](this,'isProcessing',_0x1ab1f8=>!_0x1ab1f8),_0x540cda['on']('execute',()=>{this['_copyHTMLToClipboard'](this['contentFieldView']['element']),_0x540cda['icon']=_0x202ca3,_0x540cda['class']=_0x25895f+'\x20ck-ai-form__copy-button--copied',this['focus'](),setTimeout(()=>{_0x540cda['icon']=_0x3bac73,_0x540cda['class']=_0x25895f;},0x3e8);}),_0x540cda;}['_copyHTMLToClipboard'](_0xde883d){const {window:_0x3f823a,document:_0x2a0d1b}=ct;if(_0x3f823a['ClipboardItem']){const {Blob:_0x147c44,ClipboardItem:_0x1af211}=_0x3f823a,_0x1d16fd=[new _0x1af211({'text/html':new _0x147c44([_0xde883d['innerHTML']],{'type':'text/html'}),'text/plain':new _0x147c44([_0xde883d['textContent']||''],{'type':'text/plain'})})];navigator['clipboard']['write'](_0x1d16fd);}else{const _0x3a4726=_0x2a0d1b['createElement']('div');_0x3a4726['style']['position']='absolute',_0x3a4726['style']['left']='-9999px',_0x3a4726['innerHTML']='<span>[</span>'+_0xde883d['innerHTML']+'<span>]</span>',_0x2a0d1b['body']['appendChild'](_0x3a4726);const _0x137180=_0x2a0d1b['createRange']();_0x137180['setStartAfter'](_0x3a4726['firstElementChild']),_0x137180['setEndBefore'](_0x3a4726['lastElementChild']);const _0x3c7bda=_0x3f823a['getSelection']();_0x3c7bda['removeAllRanges'](),_0x3c7bda['addRange'](_0x137180),_0x2a0d1b['execCommand']('copy'),_0x3a4726['remove']();}}}class Hi extends vt{constructor(_0x23e53f,_0x3445f3=''){super(_0x23e53f),this['loaderView']=this['_createLoader'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-content',_0x3445f3,'ck-reset_all-excluded','ck-ai-form__content-field']}});}['setContent'](_0x2637b2){this['element']['innerHTML']=_0x2637b2;}['appendLoader'](){this['element']['appendChild'](this['loaderView']['element']);}['_createLoader'](){const _0xb19225=new vt(),_0x4f60fb=this['locale'],_0x5db23c=new yt();return _0x5db23c['isVisible']=!0x0,_0xb19225['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__loader']},'children':[_0x5db23c,{'text':ki(_0x4f60fb,'AI\x20is\x20writing...')}]}),_0xb19225['render'](),_0xb19225;}}class Mi extends vt{constructor(_0x2250ff,_0x5eff81=''){super(_0x2250ff);const _0x538bca=new xt(),_0x44afd8=this['bindTemplate'];this['set']('text',_0x5eff81),_0x538bca['content']=_0x2559e9,this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__error']},'children':[_0x538bca,{'text':_0x44afd8['to']('text')}]});}}class Ui extends Lt{['submitButtonView'];['showHistoryButtonView'];constructor(_0x102779,_0x50842e){super(_0x102779,_0x50842e),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',(_0x234e38,_0x1d904c)=>{_0x234e38['target']==this['queryView']['fieldView']['element']&&(this['submit'](),_0x1d904c());});}['_createSubmitButton'](){const _0xf67058=new Nt(this['locale']),_0x3c2e77=this['locale'];return _0xf67058['set']({'icon':_0x270404,'label':ki(_0x3c2e77,'Submit'),'isVisible':!0x0,'tooltip':!0x0,'class':'ck-ai-form__submit'}),_0xf67058['on']('execute',()=>{this['submit']();}),_0xf67058['bind']('isEnabled')['to'](this['queryView']['fieldView'],'isEmpty',this,'isEnabled',(_0x546bfc,_0x402520)=>!_0x546bfc&&_0x402520),_0xf67058;}['_createShowHistoryButton'](){const _0x18416a=new Nt(this['locale']),_0x126ed4=this['resultsView'],_0x2b38d4=this['locale'];_0x18416a['set']({'label':ki(_0x2b38d4,'History'),'withText':!0x1,'icon':_0x4ccc15,'tooltip':!0x0,'tooltipPosition':'sw','class':'ck-ai-form__toggle-history'}),_0x18416a['bind']('isOn')['to'](_0x126ed4,'isVisible'),_0x18416a['bind']('isEnabled')['to'](this,'isEnabled'),_0x18416a['on']('execute',()=>{_0x126ed4['isVisible']=!_0x126ed4['isVisible'],_0x126ed4['isVisible']?this['filteredView']['focus']():this['focus']();});const _0x3bfaa6=()=>{ct['window']['requestAnimationFrame'](()=>{if(lt(this['element'])){const _0x5bca8b=new ut(this['queryView']['fieldView']['element']),_0x2999e1=_0x5bca8b['width'],_0x4abee3='rtl'===_0x2b38d4['uiLanguageDirection']?'left':'right';_0x5bca8b['excludeScrollbarsAndBorders'](),_0x18416a['element']['style'][_0x4abee3]=_0x2999e1-_0x5bca8b['width']+0x1+'px';}});};return this['queryView']['fieldView']['on']('update',_0x3bfaa6),this['on']('render',_0x3bfaa6),_0x18416a;}['submit'](){const _0x88c411=this['queryView']['fieldView']['element']['value'];this['fire']('submit',_0x88c411);}['focus'](_0x530989){-0x1===_0x530989?this['focusCycler']['focusLast']():this['focusCycler']['focusFirst']();}}class Vi extends Dt{['historyGroupView'];['clearHistoryButton'];constructor(_0x2f3680){super(_0x2f3680),this['clearHistoryButton']=this['_createClearHistoryButton'](),this['historyGroupView']=new Pt(),this['historyGroupView']['children']['add'](this['clearHistoryButton'],0x1),this['historyGroupView']['label']=ki(_0x2f3680,'Prompt\x20history'),this['historyGroupView']['items']['delegate']('execute')['to'](this),this['items']['add'](this['historyGroupView']);}['filter'](){let _0x50e990=0x0;for(const _0x1a8f93 of this['items'])_0x50e990+=_0x1a8f93['items']['length'];return{'resultsCount':_0x50e990,'totalItemsCount':_0x50e990};}['_createClearHistoryButton'](){const _0x3b9002=this['locale'],_0x15f613=new Nt(this['locale']);return _0x15f613['set']({'label':'('+ki(_0x3b9002,'Clear')+')','withText':!0x0}),_0x15f613['on']('execute',()=>this['fire']('clearHistory')),_0x15f613;}}class Bi extends Ht{constructor(_0x63da8f){super();const _0x534775=new Mt(),_0x47f75f=new Nt(this['locale'],_0x534775);this['children']['add'](_0x47f75f),_0x47f75f['set']({'label':_0x63da8f['prompt'],'withText':!0x0}),_0x47f75f['on']('execute',()=>{this['fire']('execute',{'value':_0x5998ae(_0x63da8f['prompt'])});});}}const Gi='CKEditor/AIFormView/PromptHistory';class Fi extends dt{constructor(){super(),this['_loadFromSessionStorage'](),this['on']('add',(_0x17e71b,_0x2e8d99)=>{const _0x5b0ae5=Ki(_0x2e8d99['prompt']);for(const _0x220ca8 of this)if(_0x220ca8!=_0x2e8d99&&Ki(_0x220ca8['prompt'])===_0x5b0ae5){this['remove'](_0x220ca8);break;}this['length']>0x14&&this['remove'](this['last']),this['_saveToSessionStorage']();}),this['on']('remove',()=>{this['_saveToSessionStorage']();});}['_loadFromSessionStorage'](){const _0x4e3e19=sessionStorage['getItem'](Gi)||'[]';this['addMany'](JSON['parse'](_0x4e3e19));}['_saveToSessionStorage'](){sessionStorage['setItem'](Gi,JSON['stringify'](this['map'](_0x1335be=>_0x1335be)));}}function Ki(_0x3e8bec){return _0x3e8bec['toLowerCase']()['trim']();}class Wi extends vt{['focusTracker'];['keystrokes'];['contentArea'];['toolbar'];['promptView'];['errorView'];['_focusables'];['focusCycler'];['_promptHistory'];constructor(_0x394584,_0x973770,_0x2f4ee2=''){super(_0x394584),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(_0x394584),this['contentArea']=new Pi(_0x394584,_0x2f4ee2),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 _0x1e285b=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form',_0x973770],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-form-content']},'children':[{'tag':'div','attributes':{'class':[_0x1e285b['if']('isError','ck-hidden',_0x550fe5=>!_0x550fe5)]},'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'](_0x177db0=0x1){-0x1===_0x177db0?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 _0x28238e=this['locale'],_0x4fcba5=new Ui(_0x28238e,{'queryView':{'label':ki(_0x28238e,'Ask\x20AI\x20to\x20edit\x20or\x20generate'),'creator':Vt,'showIcon':!0x1,'showResetButton':!0x1},'infoView':{'text':{'noSearchableItems':{'primary':ki(_0x28238e,'Empty\x20history'),'secondary':ki(_0x28238e,'Ask\x20AI\x20and\x20your\x20prompts\x20will\x20be\x20listed\x20here\x20for\x20you\x20to\x20use\x20later.')}}},'filteredView':this['_createHistoryView'](),'queryMinChars':0x1/0x0,'resetOnBlur':!0x1});return _0x4fcba5['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',(_0x4b4fbf,_0x4a9a9f)=>_0x4b4fbf&&!_0x4a9a9f),this['listenTo'](_0x4fcba5,'submit',(_0x189d6c,_0x16f14f)=>{this['prompt']=_0x16f14f;const _0x5a98a9=_0x1db613(_0x16f14f);this['fire']('submitPrompt',_0x5a98a9),_0x16f14f['trim']()&&this['_promptHistory']['add']({'prompt':_0x5a98a9},0x0);},{'priority':'high'}),_0x4fcba5;}['_createHistoryView'](){const _0x2be962=new Vi(this['locale']);return _0x2be962['historyGroupView']['items']['bindTo'](this['_promptHistory'])['as'](Bi),_0x2be962['on']('clearHistory',()=>{this['_promptHistory']['clear'](),this['promptView']['search'](''),this['promptView']['focus']();}),_0x2be962;}['_createToolbar'](){const _0x5649b0=new Di(this['locale']);return _0x5649b0['replaceButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',this,'value',(_0x3a5ad6,_0x479d97,_0xa9f5a2)=>_0x3a5ad6&&!_0x479d97&&!!_0xa9f5a2),_0x5649b0['replaceButton']['delegate']('execute')['to'](this,'replaceContent'),_0x5649b0['insertButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',this,'value',(_0x5f3de5,_0x53edd2,_0x5d8b31)=>_0x5f3de5&&!_0x53edd2&&!!_0x5d8b31),_0x5649b0['insertButton']['delegate']('execute')['to'](this,'insertContentBelow'),_0x5649b0['tryAgainButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',(_0x1cc34f,_0x2a3f77)=>_0x1cc34f&&!_0x2a3f77),_0x5649b0['tryAgainButton']['delegate']('execute')['to'](this,'tryAgainEvent'),_0x5649b0['stopButton']['bind']('isEnabled')['to'](this,'isProcessing'),_0x5649b0['stopButton']['delegate']('execute')['to'](this,'stopProcessing'),_0x5649b0;}['startProcessing'](){this['value']='',this['isError']=!0x1,this['isProcessing']=!0x0,this['contentArea']['isVisible']=!0x0,this['toolbar']['isVisible']=!0x0,this['contentArea']['focus']();}['finishProcessing'](){const _0x36f427=this['locale'];this['isProcessing']=!0x1,this['prompt']='',this['promptView']['reset'](),this['value']&&(this['promptView']['queryView']['label']=ki(_0x36f427,'Ask\x20AI\x20to\x20improve\x20generated\x20text'));}['handleError'](_0x396da7){const _0x498248=this['locale'];this['finishProcessing'](),this['isError']=!0x0,this['errorView']['text']=_0x396da7||ki(_0x498248,'AI_ERROR_FAILED'),this['value']||(this['contentArea']['isVisible']=!0x1);}}const Yi=globalThis['DataTransfer'];class $i extends _0x3c4360{['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[_0x1d07ea,Si,Ri,Bt];}constructor(_0x2e85b6){super(_0x2e85b6),_0x2e85b6['config']['define']('ai.assistant.disabledElements',['media','rawHtml','tableOfContents']),_0x2e85b6['config']['define']('ai.assistant.contentAreaCssClass',''),_0x2e85b6['config']['define']('ai.assistant.useTheme',!0x0),this['_uiCssClasses']='ck-ai-assistant-ui'+(_0x2e85b6['config']['get']('ai.assistant.useTheme')?'\x20ck-ai-assistant-ui_theme':'');}['init'](){const {editor:_0x4fd475}=this;this['_aiAdapter']=_0x4fd475['plugins']['get'](Ri),this['_dialog']=_0x4fd475['plugins']['get'](Bt),this['_formView']=null,this['_commandDefinitions']=this['_getResolvedCommandsDefinitions']();const _0x5de4b3=new Ni(_0x4fd475,Array['from'](this['_commandDefinitions']['values']()));_0x4fd475['commands']['add']('showAIAssistant',_0x5de4b3),_0x4fd475['ui']['componentFactory']['add']('aiCommands',_0x4f50d1=>{const _0x5a2457=Gt(_0x4f50d1);return _0x5a2457['set']({'class':'ck-ai-commands-dropdown\x20'+this['_uiCssClasses']}),_0x5a2457['buttonView']['set']({'label':ki(_0x4f50d1,'AI\x20Commands'),'icon':_0x4d7db5,'tooltip':!0x0}),_0x5a2457['on']('execute',_0x822c8f=>this['_onExecute'](_0x822c8f['source']['id'])),Ft(_0x5a2457,_0x4fd475['ui']['view']['body'],function(_0x49df0d){const _0x123755=wi(_0x49df0d['config']['get']('ai.assistant.commands'),_0x49df0d['locale']),_0x1c4c09=Qi(_0x49df0d,_0x123755)['filter'](_0x52ce31=>_0x52ce31['commands']['length']);if(0x1===_0x1c4c09['length'])return Qi(_0x49df0d,_0x1c4c09[0x0]['commands'])['map'](_0x5be121=>({'id':_0x5be121['id'],'label':_0x5be121['label']}));return _0x1c4c09['map'](_0x29d7b5=>{const {groupId:_0x546642,groupLabel:_0x1a2615,commands:_0x435c21}=_0x29d7b5,_0x210626=Qi(_0x49df0d,_0x435c21)['map'](_0x435aab=>({'id':_0x435aab['id'],'label':_0x435aab['label']}));return{'id':_0x546642,'menu':_0x1a2615||_0x546642,'children':_0x210626};});}(_0x4fd475),{'ariaLabel':ki(_0x4f50d1,'AI\x20Commands')}),_0x5a2457['menuView']['menuPanelClass']='ck-ai-commands-dropdown\x20'+this['_uiCssClasses'],_0x5de4b3['on']('change:enabledCommandsIds',_0x5d6406),_0x5a2457['menuView']['once']('render',_0x5d6406),_0x5a2457;function _0x5d6406(){_0x5a2457['isEnabled']=_0x5de4b3['enabledCommandsIds']['length']>0x0;for(const _0x467b92 of _0x5a2457['menuView']['buttons'])_0x467b92['isEnabled']=_0x5de4b3['enabledCommandsIds']['includes'](_0x467b92['id']);}}),_0x4fd475['ui']['componentFactory']['add']('menuBar:aiCommands',_0x31b82a=>{const _0x40b0d1=new Kt(_0x31b82a);_0x40b0d1['buttonView']['set']({'label':ki(_0x31b82a,'AI\x20Commands'),'icon':_0x4d7db5}),_0x40b0d1['bind']('isEnabled')['to'](_0x5de4b3,'enabledCommandsIds',_0x310971=>_0x310971['length']>0x0);const _0x3f0821=wi(_0x4fd475['config']['get']('ai.assistant.commands'),_0x31b82a);return this['_populateMenuBarMenu'](_0x5de4b3,_0x40b0d1,_0x3f0821,_0x260311=>this['_onExecute'](_0x260311)),_0x40b0d1;}),_0x4fd475['ui']['componentFactory']['add']('aiAssistant',()=>{const _0x40b00a=this['_createAIAssistantUIButton'](Nt);return _0x40b00a['set']({'tooltip':!0x0,'class':'ck-ai-assistant-button\x20'+this['_uiCssClasses']}),_0x40b00a;}),_0x4fd475['ui']['componentFactory']['add']('menuBar:aiAssistant',()=>{const _0x51035c=this['_createAIAssistantUIButton'](Wt);return _0x51035c['set']({'role':'menuitemcheckbox'}),_0x51035c;}),this['licenseKey']=this['editor']['config']['get']('licenseKey');const _0x2e36f9=this['editor'];this['_licenseKeyCheckInterval']=setInterval(()=>{let _0x8ae2a;for(const _0xf3a07a in _0x2e36f9){const _0x208ef4=_0xf3a07a,_0x55c387=_0x2e36f9[_0x208ef4];if('aiLicenseKeyValid'==_0x55c387||'aiLicenseKeyInvalid'==_0x55c387||'aiLicenseKeyExpired'==_0x55c387||'aiLicenseKeyDomainLimit'==_0x55c387||'aiLicenseKeyNotAllowed'==_0x55c387||'aiLicenseKeyEvaluationLimit'==_0x55c387||'aiLicenseKeyUsageLimit'==_0x55c387){delete _0x2e36f9[_0x208ef4],_0x8ae2a=_0x55c387,clearInterval(this['_licenseKeyCheckInterval']),this['_licenseKeyCheckInterval']=void 0x0;break;}}'aiLicenseKeyInvalid'==_0x8ae2a&&_0x2e36f9['_showLicenseError']('invalid'),'aiLicenseKeyExpired'==_0x8ae2a&&_0x2e36f9['_showLicenseError']('expired'),'aiLicenseKeyDomainLimit'==_0x8ae2a&&_0x2e36f9['_showLicenseError']('domainLimit'),'aiLicenseKeyNotAllowed'==_0x8ae2a&&_0x2e36f9['_showLicenseError']('featureNotAllowed','AIAssistant'),'aiLicenseKeyEvaluationLimit'==_0x8ae2a&&_0x2e36f9['_showLicenseError']('evaluationLimit'),'aiLicenseKeyUsageLimit'==_0x8ae2a&&_0x2e36f9['_showLicenseError']('usageLimit');},0x3e8);}['destroy'](){super['destroy'](),this['_licenseKeyCheckInterval']&&clearInterval(this['_licenseKeyCheckInterval']);}['showUI'](_0x5f420f='',_0x369f5a='',_0x1ecaed='custom'){const _0x3324bd=this['editor'],_0x140c7d=_0x3324bd['editing']['view'],_0x42811b=_0x3324bd['plugins']['get'](Si),_0x560d76=_0x3324bd['plugins']['get'](_0x1d07ea);_0x42811b['showFakeVisualSelection']();const _0x20491b=new Yi(),_0x1d7421=new ClipboardEvent('copy',{'clipboardData':_0x20491b}),_0x252fa9=new _0x2bd755(_0x20491b),_0xfbbe34=new _0x852f60(_0x140c7d,_0x1d7421,{'dataTransfer':_0x252fa9});_0x560d76['_forceMarkersCopy']('comment',()=>{_0x140c7d['document']['fire']('copy',_0xfbbe34);}),this['_formView']||(this['_initView'](),this['_aiAssistantController']=new xi(_0x3324bd,this['_aiAdapter']['textAdapter'],this['_formView']));let _0xb80776=_0x252fa9['getData']('text/html');const _0x163bb6=_0x3324bd['model']['document']['selection'],_0x453eca=Array['from'](_0x163bb6['getRanges']());0x1===_0x453eca['length']&&_0x453eca[0x0]['isFlat']&&!_0x163bb6['getSelectedElement']()&&''!==_0xb80776['replace'](/ /g,'')['trim']()&&(_0xb80776='<p>'+_0xb80776+'</p>'),this['_aiAssistantController']['updateView']({'actionId':_0x1ecaed,'query':_0x5f420f,'htmlContent':_0xb80776,'label':_0x369f5a,'mainActionLabel':Li[_0x3324bd['model']['document']['selection']['isCollapsed']?'INSERT':'REPLACE']}),'aiAssistant'!==this['_dialog']['id']?this['_dialog']['show']({'id':'aiAssistant','icon':_0x280e89,'title':ki(this['editor']['locale'],'AI\x20Assistant'),'content':this['_formView'],'position':Yt['EDITOR_TOP_SIDE'],'onShow':()=>{this['_formView']['focus']();},'onHide':()=>{this['_aiAssistantController']['reset'](),_0x42811b['hideFakeVisualSelection']();}}):this['_dialog']['view']['wasMoved']||this['_dialog']['view']['updatePosition']();}['hideUI'](){this['_dialog']['hide']();}['_getResolvedCommandsDefinitions'](){const _0x4673cf=new Map(),_0x427640=wi(this['editor']['config']['get']('ai.assistant.commands'),this['editor']['locale']);for(const _0x586455 of _0x427640)for(const _0x4def15 of _0x586455['commands'])_0x4673cf['set'](_0x4def15['id'],{..._0x4def15,'groupId':_0x586455['groupId'],'groupLabel':_0x586455['groupLabel']||_0x586455['groupId']});return _0x4673cf;}['_createAIAssistantUIButton'](_0x687c0c){const _0x545efd=this['editor'],_0x32f883=_0x545efd['commands']['get']('showAIAssistant'),_0x404d3d=new _0x687c0c(_0x545efd['locale']);return _0x404d3d['set']({'label':ki(_0x545efd['locale'],'AI\x20Assistant'),'icon':_0x280e89,'isToggleable':!0x0}),_0x404d3d['bind']('isEnabled')['to'](_0x32f883),_0x404d3d['bind']('isOn')['to'](this['_dialog'],'id',_0x164f31=>'aiAssistant'===_0x164f31),this['listenTo'](_0x404d3d,'execute',()=>{_0x404d3d['isOn']?this['hideUI']():_0x32f883['execute']();}),_0x404d3d;}['_initView'](){const _0x140ecd=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',()=>{_0x140ecd['insertContent'](this['_aiAssistantController']['currentContext']),this['hideUI']();}),this['listenTo'](this['_formView'],'insertContentBelow',()=>{_0x140ecd['insertContentBelow'](this['_aiAssistantController']['currentContext']),this['hideUI']();}),this['_initAriaAiStatusChangeAnnouncements']();}['_initAriaAiStatusChangeAnnouncements'](){const {locale:_0x2e09e9,ui:{ariaLiveAnnouncer:_0x3cf417}}=this['editor'];this['_formView']['contentArea']['on']('change:isProcessing',(_0x5c3757,_0x3d8c47,_0x5f45bb)=>{const _0x5c6c39=this['_aiAssistantController']['currentContext'];_0x5f45bb?_0x3cf417['announce'](ki(_0x2e09e9,'AI\x20is\x20writing')):_0x5c6c39&&_0x3cf417['announce'](ki(_0x2e09e9,'Generated\x20content:\x20%0',_0x5c6c39),{'politeness':'polite','isUnsafeHTML':!0x0});}),this['_formView']['on']('change:isError',(_0x2a37db,_0x21d552,_0x287361)=>{if(_0x287361){const _0x2b806f=this['_formView']['errorView']['text'];_0x3cf417['announce'](ki(_0x2e09e9,'Error\x20during\x20AI\x20content\x20generation:\x20%0',_0x2b806f));}});}['_onExecute'](_0x5e3470){const _0x1543a7=this['_commandDefinitions']['get'](_0x5e3470),_0x3a1d4a=this['editor'],_0x4687cd=_0x3a1d4a['model']['document']['selection'],_0x8610a7=_0x3a1d4a['commands']['get']('showAIAssistant'),_0x31c2a0=_0x3a1d4a['plugins']['get'](Si),_0x3f2628=''+(_0x1543a7['groupId']!==Ci?_0x1543a7['groupLabel']+':\x20':'')+_0x1543a7['label'];if(!0x1!==_0x1543a7['requiresContent']&&_0x4687cd['isCollapsed']){const _0xaad0c8=At(_0x4687cd['getSelectedBlocks']())||_0x3a1d4a['model']['schema']['getLimitElement'](_0x4687cd);_0x3a1d4a['model']['change'](_0x5642ba=>{_0x5642ba['setSelection'](_0xaad0c8,'in');});}_0x31c2a0['showFakeVisualSelection'](),_0x8610a7['execute'](_0x1543a7['prompt'],_0x3f2628,'command:'+_0x5e3470);}['_populateMenuBarMenu'](_0x3ded8a,_0xc29ed1,_0x4d7772,_0x40f31c){const _0x38a3d3=this['editor'],_0x3f62e4=_0x38a3d3['locale'],_0x517d78=new $t(_0x3f62e4),_0x5c423d=Qi(_0x38a3d3,_0x4d7772)['filter'](_0x1537ae=>_0x1537ae['commands']['length']);0x1===_0x5c423d['length']?this['_getMenuBarGroupButtons']({'command':_0x3ded8a,'commands':_0x5c423d[0x0]['commands'],'parentMenuView':_0xc29ed1,'onExecute':_0x40f31c})['forEach'](_0x53e861=>_0x517d78['items']['add'](_0x53e861)):_0x5c423d['forEach'](({groupId:_0x46ce59,groupLabel:_0x1b13b0,commands:_0x9cd92})=>{const _0x18fa5f=new qt(_0x3f62e4,_0xc29ed1),_0x1269f1=new Kt(_0x3f62e4),_0x2cfbb1=new $t(_0x3f62e4),_0x56f1ce=this['_getMenuBarGroupButtons']({'command':_0x3ded8a,'commands':_0x9cd92,'parentMenuView':_0x1269f1,'onExecute':_0x40f31c});_0x1269f1['buttonView']['set']({'label':_0x1b13b0||_0x46ce59}),_0x1269f1['delegate']('execute')['to'](_0xc29ed1),_0x2cfbb1['items']['addMany'](_0x56f1ce),_0x1269f1['panelView']['children']['add'](_0x2cfbb1),_0x18fa5f['children']['add'](_0x1269f1),_0x517d78['items']['add'](_0x18fa5f);}),_0xc29ed1['panelView']['children']['add'](_0x517d78);}['_getMenuBarGroupButtons']({command:_0xe455c2,commands:_0xc736b2,parentMenuView:_0x51f099,onExecute:_0x36be34}){const _0xfd95b=this['editor'],_0x6218c3=_0xfd95b['locale'];return Qi(_0xfd95b,_0xc736b2)['map'](_0x50a77d=>{const _0x513730=new qt(_0x6218c3,_0x51f099),_0x268c86=new Wt(_0x6218c3);return _0x268c86['set']({'label':_0x50a77d['label']}),_0x268c86['delegate']('execute')['to'](_0x51f099),_0x268c86['on']('execute',()=>_0x36be34(_0x50a77d['id'])),_0x268c86['bind']('isEnabled')['to'](_0xe455c2,'enabledCommandsIds',_0x57e78d=>_0x57e78d['includes'](_0x50a77d['id'])),_0x513730['children']['add'](_0x268c86),_0x513730;});}}function qi(_0x5cdc47,_0xb5c2f4){return void 0x0!==_0x5cdc47['order']&&void 0x0===_0xb5c2f4['order']?0x1:void 0x0===_0x5cdc47['order']&&void 0x0!==_0xb5c2f4['order']?-0x1:void 0x0!==_0x5cdc47['order']&&void 0x0!==_0xb5c2f4['order']?_0x5cdc47['order']-_0xb5c2f4['order']:0x0;}function Qi(_0x4dbd25,_0x4584d1){_0x4584d1['sort'](qi);const _0x133a17={},_0x2dcf15=[];for(const _0x3ff6b8 of _0x4584d1)if(void 0x0!==_0x3ff6b8['order']){if(_0x3ff6b8['order']in _0x133a17)throw new at('ai-commands-config-order-collision',_0x4dbd25,{'conflictingDefinitions':[_0x3ff6b8,_0x133a17[_0x3ff6b8['order']]]});_0x133a17[_0x3ff6b8['order']]=_0x3ff6b8,_0x2dcf15['splice'](_0x3ff6b8['order'],0x0,_0x3ff6b8);}else _0x2dcf15['push'](_0x3ff6b8);return _0x2dcf15;}class Xi extends _0x3c4360{static get['requires'](){return[$i,Si];}static get['pluginName'](){return'AIAssistant';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x3d4703){super(_0x3d4703);const _0x298f46=_0x3d4703['config'],_0x3aa21b=_0x3d4703['locale'];_0x298f46['define']('ai.assistant.preserveComments',!0x0),_0x298f46['define']('ai.assistant.commands',zi(_0x3aa21b)),_0x298f46['define']('ai.assistant.extraCommandGroups',[]),_0x298f46['define']('ai.assistant.removeCommands',[]);let _0x539003=wi(_0x298f46['get']('ai.assistant.commands'),_0x3aa21b);const _0x43ded5=_0x298f46['get']('ai.assistant.extraCommandGroups'),_0x125164=_0x298f46['get']('ai.assistant.removeCommands');_0x43ded5['forEach'](_0x3c701f=>{const _0x163951=_0x539003['find'](_0x4737bc=>_0x4737bc['groupId']===_0x3c701f['groupId']);_0x163951?_0x163951['commands']=_0x163951['commands']['concat'](_0x3c701f['commands']):_0x539003['push'](_0x3c701f);}),_0x539003=_0x539003['filter'](_0x3ca3fa=>!_0x125164['includes'](_0x3ca3fa['groupId'])),_0x539003['forEach'](_0x48cb47=>{_0x48cb47['commands']=_0x48cb47['commands']['filter'](_0xe3efaa=>!_0x125164['includes'](_0xe3efaa['id']));}),_0x298f46['set']('ai.assistant.commands',_0x539003);}}function zi(_0x2c0d07){return[{'groupId':'editOrReview','groupLabel':ki(_0x2c0d07,'Edit\x20or\x20review'),'commands':[{'id':'improveWriting','label':ki(_0x2c0d07,'Improve\x20writing'),'prompt':'Fix\x20spelling\x20mistakes,\x20use\x20proper\x20grammar\x20and\x20apply\x20good\x20writing\x20practices.\x20Do\x20not\x20lose\x20the\x20original\x20meaning.'},{'id':'makeShorter','label':ki(_0x2c0d07,'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(_0x2c0d07,'Make\x20longer'),'prompt':'Improve\x20this\x20content\x20by\x20using\x20descriptive\x20language\x20and\x20inserting\x20more\x20information\x20and\x20more\x20detailed\x20explanations.'},{'id':'simplifyLanguage','label':ki(_0x2c0d07,'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(_0x2c0d07,'Generate\x20from\x20selection'),'commands':[{'id':'summarize','label':ki(_0x2c0d07,'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(_0x2c0d07,'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(_0x2c0d07,'Change\x20tone'),'commands':[{'id':'professional','label':ki(_0x2c0d07,'Professional'),'prompt':'Improve\x20using\x20polished,\x20formal,\x20and\x20respectful\x20language\x20to\x20convey\x20professional\x20expertise\x20and\x20competence.'},{'id':'casual','label':ki(_0x2c0d07,'Casual'),'prompt':'Improve\x20using\x20casual,\x20informal\x20language\x20to\x20convey\x20a\x20casual\x20conversation\x20with\x20a\x20real\x20person.'},{'id':'direct','label':ki(_0x2c0d07,'Direct'),'prompt':'Improve\x20using\x20direct\x20language,\x20using\x20only\x20the\x20essential\x20information.'},{'id':'confident','label':ki(_0x2c0d07,'Confident'),'prompt':'Improve\x20using\x20compelling,\x20optimistic\x20language\x20to\x20convey\x20confidence\x20in\x20the\x20writing.'},{'id':'friendly','label':ki(_0x2c0d07,'Friendly'),'prompt':'Improve\x20using\x20friendly,\x20comforting\x20language,\x20to\x20convey\x20understanding\x20and\x20empathy.'}]},{'groupId':'changeStyle','groupLabel':ki(_0x2c0d07,'Change\x20style'),'commands':[{'id':'business','label':ki(_0x2c0d07,'Business'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20business\x20professional\x20with\x20formal\x20language.'},{'id':'legal','label':ki(_0x2c0d07,'Legal'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20legal\x20professional\x20using\x20valid\x20legal\x20terminology.'},{'id':'journalism','label':ki(_0x2c0d07,'Journalism'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20journalist\x20using\x20engaging\x20language\x20to\x20convey\x20the\x20importance\x20of\x20the\x20information.'},{'id':'poetic','label':ki(_0x2c0d07,'Poetic'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20poem\x20using\x20poetic\x20techniques\x20without\x20losing\x20the\x20original\x20meaning.'}]},{'groupId':'translate','groupLabel':ki(_0x2c0d07,'Translate'),'commands':[{'id':'translateEnglish','label':ki(_0x2c0d07,'English'),'prompt':'Translate\x20the\x20content\x20to\x20English\x20language.'},{'id':'translateSpanish','label':ki(_0x2c0d07,'Spanish'),'prompt':'Translate\x20the\x20content\x20to\x20Spanish\x20language.'},{'id':'translatePortuguese','label':ki(_0x2c0d07,'Portuguese'),'prompt':'Translate\x20the\x20content\x20to\x20Portuguese\x20language.'},{'id':'translateGerman','label':ki(_0x2c0d07,'German'),'prompt':'Translate\x20the\x20content\x20to\x20German\x20language.'},{'id':'translateFrench','label':ki(_0x2c0d07,'French'),'prompt':'Translate\x20the\x20content\x20to\x20French\x20language.'},{'id':'translateChinese','label':ki(_0x2c0d07,'Simplified\x20Chinese'),'prompt':'Translate\x20the\x20content\x20to\x20Simplified\x20Chinese\x20language.'},{'id':'translateHindi','label':ki(_0x2c0d07,'Hindi'),'prompt':'Translate\x20the\x20content\x20to\x20Hindi\x20language.'},{'id':'translateArabic','label':ki(_0x2c0d07,'Arabic'),'prompt':'Translate\x20the\x20content\x20to\x20Arabic\x20language.'}]}];}class ji extends _0x3c4360{['abortController'];static get['requires'](){return[Ri];}constructor(_0xa591f9){super(_0xa591f9),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'](_0x5ab138){return this['sendRequest'](_0x5ab138)['catch'](_0x58f37f=>{if(_0x58f37f instanceof Oi)return Promise['reject'](_0x58f37f);if('AbortError'==_0x58f37f['name'])return Promise['resolve']();throw console['error'](_0x58f37f),new at('aitextadapter-send-request-failed',null);});}async['_prepareRequestHeaders'](_0x23e402,_0x223d2f){const _0x48c80f=this['editor']['locale'],_0x58e9bd={'Content-Type':'application/json'};if('object'==typeof _0x23e402)Object['assign'](_0x58e9bd,_0x23e402);else{if(_0x23e402)try{const _0x183e8c=await _0x23e402(_0x223d2f);Object['assign'](_0x58e9bd,_0x183e8c);}catch{return Promise['reject'](new Oi(ki(_0x48c80f,'AI_ERROR_GET_HEADERS')));}}return _0x58e9bd;}async['_prepareRequestParameters'](_0x533b11,_0x69a55){const _0x4406d6=this['editor']['locale'];if('object'==typeof _0x533b11)return _0x533b11;try{return await _0x533b11(_0x69a55);}catch{return Promise['reject'](new Oi(ki(_0x4406d6,'AI_ERROR_GET_PARAMETERS')));}}}class Ji extends ji{['_apiUrl'];['_requestHeaders'];['_requestParameters'];static get['pluginName'](){return'OpenAITextAdapter';}constructor(_0x2ef875){super(_0x2ef875),_0x2ef875['config']['define']('ai.assistant.adapter.openAI.apiUrl','https://api.openai.com/v1/chat/completions'),_0x2ef875['config']['get']('ai.assistant.adapter.openAI.requestParameters')||_0x2ef875['config']['define']('ai.assistant.adapter.openAI.requestParameters',{'model':'gpt-4o','temperature':0x1,'top_p':0x1,'stream':!0x0}),this['_apiUrl']=_0x2ef875['config']['get']('ai.assistant.adapter.openAI.apiUrl'),this['_requestHeaders']=_0x2ef875['config']['get']('ai.assistant.adapter.openAI.requestHeaders')||{},this['_requestParameters']=_0x2ef875['config']['get']('ai.assistant.adapter.openAI.requestParameters');}async['sendRequest']({query:_0x910df,context:_0x5325be,onData:_0x5df17d,actionId:_0x33c8e8}){const _0x232741=this['editor']['locale'],_0xf031f5=await this['prepareMessages'](_0x910df,_0x5325be,_0x33c8e8),_0xcf9cf1=await this['_prepareRequestHeaders'](this['_requestHeaders'],_0x33c8e8),_0x267886=await this['_prepareRequestParameters'](this['_requestParameters'],_0x33c8e8),_0x552d2c={'messages':_0xf031f5,..._0x267886},_0x1bf641={'method':'POST','headers':_0xcf9cf1,'body':JSON['stringify'](_0x552d2c),'signal':this['abortController']['signal']},_0x3ebdbc=await fetch(this['_apiUrl'],_0x1bf641);if(_0x3ebdbc['ok'])return _0x267886['stream']?await this['_readStreamableResponse'](_0x3ebdbc,_0x5df17d):await this['_readStaticResponse'](_0x3ebdbc,_0x5df17d),Promise['resolve']();{const _0x892994=await _0x3ebdbc['text']();return _0x892994['includes']('context_length_exceeded')?Promise['reject'](new Oi(ki(_0x232741,'AI_ERROR_CONTEXT_LENGTH'))):_0x892994['includes']('Moderation')?Promise['reject'](new Oi(ki(_0x232741,'AI_ERROR_MODERATION'))):Promise['reject'](new Error(_0x892994));}}async['prepareMessages'](_0x45e292,_0xa24e77,_0x2acbe2){let _0x342483,_0x4aea8f;return _0xa24e77?(_0x342483='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.',_0x4aea8f='Instruction:\x0a'+_0x45e292+'\x0aYou\x20must\x20keep\x20the\x20text\x20formatting.\x0a\x0aContent:\x0a'+_0xa24e77):(_0x342483='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.',_0x4aea8f=_0x45e292),[{'role':'system','content':_0x342483},{'role':'user','content':_0x4aea8f}];}async['_readStreamableResponse'](_0x373374,_0x43af2b){const _0x5b6362=_0x373374['body']['getReader'](),_0x2d213d=new TextDecoder();let _0xe967c4='',_0x1eac8a='',_0xfcfddc='',_0x59922d=!0x1;for(;!_0x59922d;){const {done:_0x50eb02,value:_0x25786d}=await _0x5b6362['read'](),_0x192f25=_0xe967c4+_0x2d213d['decode'](_0x25786d);let _0x74a4a9='';_0x59922d=_0x50eb02;try{_0x74a4a9=this['_cleanUpData'](_0x192f25),_0xe967c4='';}catch{_0xe967c4=_0x192f25;continue;}_0x1eac8a+=_0x74a4a9,!_0x59922d&&this['_isBufferIncomplete'](_0x1eac8a)||_0x1eac8a&&(_0xfcfddc+=_0x1eac8a,_0x1eac8a='',_0x43af2b(_0xfcfddc));}return Promise['resolve']();}async['_readStaticResponse'](_0x2f3dca,_0x2695a2){return _0x2695a2((await _0x2f3dca['json']())['choices'][0x0]['message']['content']),Promise['resolve']();}['_isBufferIncomplete'](_0x572047){const _0x19908c=_0x572047['split']('<')['length']!==_0x572047['split']('>')['length'],_0x518686=_0x572047['length']<0x1e;return _0x19908c&&_0x518686;}['_cleanUpData'](_0x147f97){return _0x147f97['split'](/\n(?![^{]*\})/g)['map'](_0x5a5a34=>_0x5a5a34['replace']('data:\x20',''))['filter'](_0xc30e94=>_0xc30e94&&_0xc30e94['length']>0x0&&'[DONE]'!==_0xc30e94)['map'](_0x357bc4=>{const {choices:_0x79af70}=JSON['parse'](_0x357bc4);if(_0x79af70[0x0]?.['delta']?.['content'])return _0x79af70[0x0]['delta']['content'];})['filter'](_0x364676=>_0x364676)['join']('');}}class Zi extends ji{static get['pluginName'](){return'AWSTextAdapter';}['init'](){super['init'](),It('ai-aws-adapter-not-supported');}async['sendRequest'](_0x244158){throw Et('ai-aws-adapter-not-supported'),new Oi(ki(this['editor']['locale'],'AI_ERROR_AWS_NOT_SUPPORTED'));}}class ts extends Nt{constructor(_0x1929ae,_0x501ddf={}){super(_0x1929ae),this['isToggleable']=!0x0,this['set']('side',_0x501ddf['side']||'top');const _0x3b9359=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':['ck-tab-button',...pt(_0x501ddf['class']||[]),_0x3b9359['to']('side',_0xa7f4f8=>'ck-tab-button_'+_0xa7f4f8),_0x3b9359['to']('class')]}});}['show'](){this['set']('isVisible',!0x0);}['hide'](){this['set']('isVisible',!0x1);}}class es extends vt{['children'];constructor(_0x306a06,_0x161301={}){super(_0x306a06);const _0x2cbace=this['bindTemplate'];this['set']('isVisible',!0x1),this['set']('class',''),this['children']=this['createCollection'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-tab-panel',...pt(_0x161301['class']||[]),_0x2cbace['to']('class'),_0x2cbace['if']('isVisible','ck-hidden',_0x168ca1=>!_0x168ca1)]},'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(_0x341ad7,_0x29725c={}){super(_0x341ad7),this['set']('class',void 0x0),this['set']('activeTab',null),this['set']('side',_0x29725c['side']||'top'),this['set']('isMaximized',!0x1),this['set']('collapsible',_0x29725c['collapsible']||!0x1),this['set']('_isMaximizedActive',!0x1),this['bind']('_isMaximizedActive')['to'](this,'isMaximized',this,'activeTab',(_0x2b39f8,_0x363cbf)=>_0x2b39f8&&null!==_0x363cbf);const _0x5d595d=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset','ck-tabs',...pt(_0x29725c['class']||[]),_0x5d595d['to']('side',_0x203c33=>'ck-tabs_'+_0x203c33),_0x5d595d['to']('class'),_0x5d595d['if']('_isMaximizedActive','ck-ai-tabs_maximized'),_0x5d595d['to']('activeTab',_0x453b06=>null===_0x453b06?'ck-ai-tabs_collapsed':'')],'tabindex':'0'},'children':[{'tag':'div','attributes':{'class':['ck','ck-tabs__buttons-container',_0x5d595d['to']('side',_0x1a20e7=>'ck-tabs__buttons-container_'+_0x1a20e7)]},'children':this['buttonViews']},{'tag':'div','attributes':{'class':['ck','ck-tabs__panels-container',_0x5d595d['to']('side',_0x5041dd=>'ck-tabs__panels-container_'+_0x5041dd)]},'children':this['panelViews']},...pt(_0x29725c['children']||[])]});}['getTabIds'](){return[...this['_tabs']['keys']()];}['getTab'](_0x460a8e){const _0x520486=this['_tabs']['get'](_0x460a8e);return _0x520486||null;}['addTab'](_0x129871){const _0x435700=this['_setupButton']({'id':_0x129871['id'],'label':_0x129871['buttonLabel'],'icon':_0x129871['buttonIcon'],'order':_0x129871['order']}),_0x1f7620=new es(this['locale']);return _0x1f7620['render'](),_0x129871['content']&&_0x1f7620['children']['add'](_0x129871['content']),this['panelViews']['add'](_0x1f7620),this['_tabs']['set'](_0x129871['id'],{'button':_0x435700,'panel':_0x1f7620,'order':void 0x0!==_0x129871['order']?_0x129871['order']:null}),this['fire']('addTab:'+_0x129871['id'],{'id':_0x129871['id'],'button':_0x435700,'panel':_0x1f7620}),null===this['activeTab']?this['activateTab'](_0x129871['id']):this['_hidePanel'](_0x129871['id']),{'button':_0x435700,'panel':_0x1f7620};}['activateTab'](_0x436f39){if(null!==_0x436f39&&!this['getTab'](_0x436f39))throw new at('ui-tabsview-tab-not-found',{'tabs':this,'tabId':_0x436f39});if(this['activeTab']===_0x436f39)return;const _0x4d4eb0=this['activeTab'];this['activeTab']&&this['_hidePanel'](this['activeTab']),this['activeTab']=_0x436f39,_0x436f39&&this['_showPanel'](_0x436f39),this['fire']('activateTab:'+_0x436f39,{'newTab':_0x436f39,'oldTab':_0x4d4eb0});}['toggleTabPanel'](_0x2a8e6a){if(!this['getTab'](_0x2a8e6a))throw new at('ui-tabsview-tab-not-found',{'tabs':this,'tabId':_0x2a8e6a});this['activeTab']===_0x2a8e6a?this['collapsible']&&(this['activeTab']=null):this['activateTab'](_0x2a8e6a);}['showTab'](_0x8eab92){if(!this['getTab'](_0x8eab92))throw new at('ui-tabsview-tab-not-found',{'tabs':this,'tabId':_0x8eab92});this['_showPanel'](_0x8eab92),this['_showButton'](_0x8eab92),this['fire']('show:'+_0x8eab92,_0x8eab92);}['hideTab'](_0x45e1b3){if(!this['getTab'](_0x45e1b3))throw new at('ui-tabsview-tab-not-found',{'tabs':this,'tabId':_0x45e1b3});const _0x5f55df=this['activeTab'];this['_hidePanel'](_0x45e1b3),this['_hideButton'](_0x45e1b3);const _0x4d1e14=this['getTabIds']();_0x5f55df===_0x45e1b3&&_0x4d1e14['length']>0x1&&this['activateTab'](_0x4d1e14['find'](_0x402984=>_0x402984!==_0x45e1b3)),this['fire']('hide:'+_0x45e1b3,_0x45e1b3);}['_getPanel'](_0x329841){const _0x174f04=this['_tabs']['get'](_0x329841);return _0x174f04?_0x174f04['panel']:null;}['_showPanel'](_0x21dd16){null!==this['activeTab']&&this['activeTab']!==_0x21dd16||this['_getPanel'](_0x21dd16)['show']();}['_hidePanel'](_0x2320f8){const _0xce33dd=this['_getPanel'](_0x2320f8);_0xce33dd['isVisible']&&(this['activeTab']===_0x2320f8&&(this['activeTab']=null),_0xce33dd['hide']());}['_getButton'](_0x5038b3){const _0x4ab57d=this['_tabs']['get'](_0x5038b3);return _0x4ab57d?_0x4ab57d['button']:null;}['_showButton'](_0x262535){this['_getButton'](_0x262535)['show']();}['_hideButton'](_0x4c48e0){this['_getButton'](_0x4c48e0)['hide']();}['_setupButton'](_0x4fee52){const _0x436a3a=new ts(this['locale'],{'side':this['side']}),_0x1565a6=this['buttonViews'];if(_0x436a3a['set']({'label':_0x4fee52['label'],'icon':_0x4fee52['icon'],'tooltip':!0x0,'withText':!0x0}),_0x436a3a['bind']('isOn')['to'](this,'activeTab',_0x3ecc27=>_0x3ecc27===_0x4fee52['id']),_0x436a3a['bind']('side')['to'](this,'side'),_0x4fee52['order']){const _0x3dde9f=[...this['_tabs']]['reduce']((_0x2432f5,_0x3015b9)=>{const _0x531cbf=_0x3015b9[0x0],{order:_0x3b45e3}=_0x3015b9[0x1];return!_0x3b45e3||_0x3b45e3>_0x4fee52['order']?_0x2432f5:_0x3b45e3>=_0x2432f5['order']?{'id':_0x531cbf,'order':_0x3b45e3}:_0x2432f5;},{'id':'','order':0x0}),_0x3e8609=_0x1565a6['getIndex'](this['_getButton'](_0x3dde9f['id']));_0x1565a6['add'](_0x436a3a,_0x3e8609+0x1);}else _0x1565a6['add'](_0x436a3a);return _0x436a3a['on']('execute',()=>{this['toggleTabPanel'](_0x4fee52['id']);}),_0x436a3a;}}const ss=['overlay','sidebar','custom'],ns=['left','right'];class rs extends is{constructor(_0x2c01b0,_0xdb0b26={}){super(_0x2c01b0,_0xdb0b26),this['set']('type',_0xdb0b26['type']||'sidebar'),this['set']('side',_0xdb0b26['side']||'right'),this['set']('isVisible',_0xdb0b26['visibleByDefault']??!0x0);const _0x16a600=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':['ck-ai-tabs',_0x16a600['if']('type','ck-ai-tabs__overlay',_0x40eebb=>'overlay'===_0x40eebb),_0x16a600['if']('type','ck-ai-tabs__sidebar',_0x386d2b=>'sidebar'===_0x386d2b),_0x16a600['if']('isVisible','ck-hidden',_0xb2add6=>!_0xb2add6)]}}),this['buttonViews']['on']('add',(_0x2a3166,_0x48ec1e)=>{_0x48ec1e['set']('withText',!0x1);});}}class os extends _0x490ade{['view'];['container']=null;['showResizeButton']=!0x0;static get['pluginName'](){return'AITabs';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x563189){if(super(_0x563189),!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 _0x453e9a=this['context']['config']['get']('ai.container');if(this['set']('side','right'),void 0x0!==_0x453e9a['showResizeButton']&&(this['showResizeButton']=_0x453e9a['showResizeButton']),'sidebar'!==_0x453e9a['type']&&'overlay'!==_0x453e9a['type']||_0x453e9a['side']&&(this['side']=_0x453e9a['side']),'sidebar'===_0x453e9a['type']){if(this['container']=_0x453e9a['element'],this['set']('type','sidebar'),!this['container'])throw new at('ai-tabs-sidebar-container-element-not-found');}else'overlay'===_0x453e9a['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':_0x453e9a['visibleByDefault'],'collapsible':_0x453e9a['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 _0x52dd99&&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'](_0x25d838){if(_0x25d838&&this['type']!==_0x25d838){if(!ss['includes'](_0x25d838))throw new at('ai-tabs-unsupported-ui-type');this['type']=_0x25d838;}}['switchSide'](_0x503597){if(_0x503597&&this['side']!==_0x503597){if(!ns['includes'](_0x503597))throw new at('ai-tabs-unsupported-ui-side');this['side']=_0x503597;}}['destroy'](){super['destroy'](),this['view']['destroy'](),this['view']['element']&&this['view']['element']['remove']();}}class as extends _0x490ade{['_apiUrl'];['_token'];['_decoder'];['_responseCache'];static get['requires'](){return[_0x3ebd57];}static get['pluginName'](){return'AIConnector';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x3499ef){super(_0x3499ef),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 _0xe1402f=this['context']['plugins']['get'](_0x3ebd57);if(!_0xe1402f['token'])throw new at('ai-missing-token',this);this['_token']=_0xe1402f['token'];}['startConversation'](_0x406dce,_0x2bafe2){const _0x310caf=this['_sendApiRequest']('/conversations','POST',{'id':_0x406dce,'group':_0x2bafe2});return{'getConversation':async()=>(await _0x310caf['request'])['json'](),'abortController':_0x310caf['abortController']};}['queryAssistant']({message:_0x215a5c,conversationId:_0x2bbf61,parts:_0x1d0f92,capabilities:_0x878ec5,model:_0x4cc6b6,attributes:_0x4c3cc7}){const _0x20d916={'prompt':_0x215a5c,'content':_0x1d0f92,'model':_0x4cc6b6,..._0x878ec5&&{'capabilities':_0x878ec5},..._0x4c3cc7&&{'attributes':_0x4c3cc7}},_0x4f8026=this['_sendApiRequest']('/conversations/'+_0x2bbf61+'/messages','POST',_0x20d916);return{'getStream':async()=>{const _0x141e2f=(await _0x4f8026['request'])['body'];return this['_getStreamReader'](_0x141e2f);},'abortController':_0x4f8026['abortController']};}['executeCustomAction']({content:_0x1cdda5,message:_0x55e820,model:_0x2e0265,outputFormat:_0x3bc668}){const _0x3e05cf={'content':[{'type':'text','content':_0x1cdda5}],'prompt':_0x55e820,'model':_0x2e0265,'outputFormat':_0x3bc668},_0x421bc8=this['_sendApiRequest']('/actions/custom/calls','POST',_0x3e05cf);return{'getStream':async()=>{const _0x7ccfee=(await _0x421bc8['request'])['body'];return this['_getStreamReader'](_0x7ccfee);},'abortController':_0x421bc8['abortController']};}['executeAction']({actionName:_0x4df8f3,content:_0x5493a6,args:_0x2ff5d0}){const _0x34768e={'content':[{'type':'text','content':_0x5493a6}],'args':_0x2ff5d0},_0x18366e=this['_sendApiRequest']('/actions/system/'+_0x4df8f3+'/calls','POST',_0x34768e);return{'getStream':async()=>{const _0x2d8454=(await _0x18366e['request'])['body'];return this['_getStreamReader'](_0x2d8454);},'abortController':_0x18366e['abortController']};}['uploadFile'](_0x70b35e,_0x4f443c,_0x4e0543){const _0x410b20=new FormData();_0x410b20['append']('file',_0x4f443c,_0x4f443c['name']),_0x4e0543&&_0x410b20['append']('attributes',JSON['stringify'](_0x4e0543));const _0x16374e=this['_sendApiRequest']('/conversations/'+_0x70b35e+'/files','POST',_0x410b20);return{'getId':async()=>(await _0x16374e['request'])['json'](),'abortController':_0x16374e['abortController']};}['fetchDocument'](_0x326a65,_0x5811ef){const _0x4a9b7a=this['_sendApiRequest']('/conversations/'+_0x326a65+'/documents/'+_0x5811ef,'GET');return{'getDocument':async()=>(await _0x4a9b7a['request'])['json'](),'abortController':_0x4a9b7a['abortController']};}['uploadDocument'](_0x30fdae,_0x30c9f8,_0x48d38a){const _0x2947ce={'content':_0x30c9f8};_0x48d38a&&(_0x2947ce['attributes']=_0x48d38a);const _0x37d86e=this['_sendApiRequest']('/conversations/'+_0x30fdae+'/documents','POST',_0x2947ce);return{'getId':async()=>(await _0x37d86e['request'])['json'](),'abortController':_0x37d86e['abortController']};}['uploadDocuments'](_0x4ef123,_0x3d9e57){const _0x49c8fe={'documents':_0x3d9e57['map'](_0x57438f=>({'content':_0x57438f['content'],'attributes':{'version':_0x57438f['version'],'sessionId':_0x57438f['sessionId'],'channelId':_0x57438f['channelId'],'rootName':_0x57438f['rootName'],'selections':_0x57438f['selections']},...void 0x0!==_0x57438f['name']?{'name':_0x57438f['name']}:{},...void 0x0!==_0x57438f['description']?{'description':_0x57438f['description']}:{}}))},_0x2549fe=this['_sendApiRequest']('/conversations/'+_0x4ef123+'/documents/batch','POST',_0x49c8fe);return{'getIds':async()=>(await _0x2549fe['request'])['json'](),'abortController':_0x2549fe['abortController']};}['fetchDocuments'](_0x50eae9,_0x155a5e){const _0x1ffba7=new URLSearchParams();_0x1ffba7['append']('documentIds',_0x155a5e['join'](','));const _0x3ad903=this['_sendApiRequest']('/conversations/'+_0x50eae9+'/documents/batch?'+_0x1ffba7['toString'](),'GET');return{'getDocuments':async()=>(await _0x3ad903['request'])['json'](),'abortController':_0x3ad903['abortController']};}['fetchConversations'](_0x21b8f6,_0x74eb5a={}){const _0x479bef=new URLSearchParams();_0x479bef['append']('group',_0x21b8f6),_0x479bef['append']('excludeEmpty',!0x1!==_0x74eb5a['excludeEmpty']?'true':'false'),_0x479bef['append']('limit',_0x74eb5a['limit']?_0x74eb5a['limit']['toString']():'100'),_0x479bef['append']('sortBy',_0x74eb5a['sortBy']?_0x74eb5a['sortBy']:'createdAt'),_0x479bef['append']('order',_0x74eb5a['order']?_0x74eb5a['order']:'desc');const _0x1ebd2f=this['_sendApiRequest']('/conversations?'+_0x479bef['toString'](),'GET');return{'getConversations':async()=>{const _0x422009=await _0x1ebd2f['request'];return(await _0x422009['json']())['items'];},'abortController':_0x1ebd2f['abortController']};}['deleteConversation'](_0x11d590){const _0x41b8c8=this['_sendApiRequest']('/conversations/'+_0x11d590,'DELETE');return{'execute':async()=>{await _0x41b8c8['request'];},'abortController':_0x41b8c8['abortController']};}['updateConversation'](_0x4db3b4,_0x2ea8ec){const _0x22bef6=this['_sendApiRequest']('/conversations/'+_0x4db3b4,'PATCH',_0x2ea8ec);return{'getResult':async()=>(await _0x22bef6['request'],_0x2ea8ec),'abortController':_0x22bef6['abortController']};}['fetchConversation'](_0x116d45){const _0x1513da=this['_sendApiRequest']('/conversations/'+_0x116d45,'GET');return{'getConversation':async()=>(await _0x1513da['request'])['json'](),'abortController':_0x1513da['abortController']};}['fetchConversationMessages'](_0xbb63af){const _0x39d6b5=this['_sendApiRequest']('/conversations/'+_0xbb63af+'/messages','GET');return{'getMessages':async()=>{const _0x5be510=await _0x39d6b5['request'];return(await _0x5be510['json']())['items'];},'abortController':_0x39d6b5['abortController']};}['uploadUrl'](_0x177ce0,_0xddc12e,_0x34c567){const _0x105a47=this['_sendApiRequest']('/conversations/'+_0x177ce0+'/web-resources','POST',{'url':_0xddc12e,'attributes':_0x34c567});return{'getId':async()=>(await _0x105a47['request'])['json'](),'abortController':_0x105a47['abortController']};}['getModels'](_0x34e2e1='en'){const _0xde3e69=new URLSearchParams();_0xde3e69['append']('language',_0x34e2e1);const _0x55d42b='/models/1?'+_0xde3e69['toString'](),_0x3a81f7=this['_sendApiRequest'](_0x55d42b,'GET',void 0x0,!0x0);return{'list':async()=>await(await _0x3a81f7['request'])['json'](),'abortController':_0x3a81f7['abortController']};}['deleteFile'](_0x308606,_0x507d62){const _0x18548f=this['_sendApiRequest']('/conversations/'+_0x308606+'/files/'+_0x507d62,'DELETE');return{'execute':async()=>{await _0x18548f['request'];},'abortController':_0x18548f['abortController']};}['deleteDocument'](_0x4a442b,_0x1b90cc){const _0x41024b=this['_sendApiRequest']('/conversations/'+_0x4a442b+'/documents/'+_0x1b90cc,'DELETE');return{'execute':async()=>{await _0x41024b['request'];},'abortController':_0x41024b['abortController']};}['deleteWebResource'](_0x50a3cf,_0x482cb4){const _0x43afbd=this['_sendApiRequest']('/conversations/'+_0x50a3cf+'/web-resources/'+_0x482cb4,'DELETE');return{'execute':async()=>{await _0x43afbd['request'];},'abortController':_0x43afbd['abortController']};}['callSystemReview']({reviewName:_0x5cd721,content:_0x44a43c,args:_0x43da49}){const _0x3bb2c2=this['_sendApiRequest']('/reviews/system/'+_0x5cd721+'/calls','POST',{'content':[{'type':'text','content':_0x44a43c}],'args':_0x43da49});return{'getStream':async()=>{const _0x304660=(await _0x3bb2c2['request'])['body'];return this['_getStreamReader'](_0x304660);},'abortController':_0x3bb2c2['abortController']};}['callCustomReview']({content:_0x22e981,prompt:_0x56e089,model:_0xe9e995}){const _0x5c8942=this['_sendApiRequest']('/reviews/custom/calls','POST',{'content':[{'type':'text','content':_0x22e981}],'prompt':_0x56e089,'model':_0xe9e995});return{'getStream':async()=>{const _0x579690=(await _0x5c8942['request'])['body'];return this['_getStreamReader'](_0x579690);},'abortController':_0x5c8942['abortController']};}['upsertAIChatRating'](_0x111abc,_0x2f42b1,_0x2cfe01){const _0x28ddb1=this['_sendApiRequest']('/conversations/'+_0x111abc+'/messages/'+_0x2f42b1+'/ratings','PUT',{'positiveCount':_0x2cfe01['positiveCount'],'totalCount':_0x2cfe01['totalCount'],'modificationId':_0x2cfe01['modificationId']});return{'execute':async()=>{await _0x28ddb1['request'];},'abortController':_0x28ddb1['abortController']};}['upsertAIActionRating'](_0x5b5a91,_0x4431fb,_0x1e00c5){const _0x27bb24=this['_sendApiRequest']('/actions/system/'+_0x5b5a91+'/calls/'+_0x4431fb+'/ratings','PUT',{'positiveCount':_0x1e00c5['positiveCount'],'totalCount':_0x1e00c5['totalCount']});return{'execute':async()=>{await _0x27bb24['request'];},'abortController':_0x27bb24['abortController']};}['upsertCustomAIActionRating'](_0x417007,_0x29ef75){const _0x3c211f=this['_sendApiRequest']('/actions/custom/calls/'+_0x417007+'/ratings','PUT',{'positiveCount':_0x29ef75['positiveCount'],'totalCount':_0x29ef75['totalCount']});return{'execute':async()=>{await _0x3c211f['request'];},'abortController':_0x3c211f['abortController']};}['upsertAIReviewRating'](_0x3f0c57,_0x50d57c,_0x58c536,_0x37a396){const _0x36d83c=this['_sendApiRequest']('/reviews/system/'+_0x3f0c57+'/calls/'+_0x50d57c+'/ratings','PUT',{'positiveCount':_0x58c536['positiveCount'],'totalCount':_0x58c536['totalCount'],'dataId':_0x37a396});return{'execute':async()=>{await _0x36d83c['request'];},'abortController':_0x36d83c['abortController']};}['upsertCustomAIReviewRating'](_0x4213d4,_0x1e8e5f,_0x323675){const _0x1817a6=this['_sendApiRequest']('/reviews/custom/calls/'+_0x4213d4+'/ratings','PUT',{'positiveCount':_0x1e8e5f['positiveCount'],'totalCount':_0x1e8e5f['totalCount'],'dataId':_0x323675});return{'execute':async()=>{await _0x1817a6['request'];},'abortController':_0x1817a6['abortController']};}['_sendApiRequest'](_0x20aa03,_0x1c882e,_0x501cb4,_0x31f512=!0x1){const _0x4cf28b=new AbortController(),_0x267a6c=_0x31f512?_0x1c882e+':'+_0x20aa03:null;if(_0x267a6c){const _0x3a265c=this['_responseCache']['get'](_0x267a6c);if(_0x3a265c)return{'request':_0x3a265c['then'](_0x341c18=>_0x341c18['clone']()),'abortController':_0x4cf28b};}const _0x416852=_0x501cb4 instanceof FormData,_0x2f88d3={'Authorization':'Bearer\x20'+this['_token']?.['value'],'X-Editor-Version':mt};_0x501cb4&&!_0x416852&&(_0x2f88d3['Content-Type']='application/json');const _0x12279a={'method':_0x1c882e,'headers':_0x2f88d3,'signal':_0x4cf28b['signal']};_0x501cb4&&(_0x12279a['body']=_0x416852?_0x501cb4:JSON['stringify'](_0x501cb4));const _0x514b7a=fetch(''+this['_apiUrl']+_0x20aa03,_0x12279a)['catch'](_0x15729b=>{_0x267a6c&&this['_responseCache']['delete'](_0x267a6c),this['_handleError'](_0x15729b);})['then'](_0x1dd2f4=>_0x1dd2f4['ok']?_0x1dd2f4:_0x1dd2f4['json']()['then'](_0x4941e8=>{throw _0x267a6c&&this['_responseCache']['delete'](_0x267a6c),{'url':this['_apiUrl'],'path':_0x20aa03,'method':_0x1c882e,'body':_0x501cb4,'status':(_0x1dd2f4||{})['status'],'statusText':(_0x1dd2f4||{})['statusText'],'code':_0x4941e8['code'],'message':_0x4941e8['message'],'traceId':_0x4941e8['traceId']};}));return _0x267a6c&&this['_responseCache']['set'](_0x267a6c,_0x514b7a['then'](_0x2f305e=>_0x2f305e['clone']())),{'request':_0x514b7a,'abortController':_0x4cf28b};}async*['_getStreamReader'](_0x45f87f){const _0x44cc7d=[],_0x4ac4aa=_0x45f87f['getReader'](),_0x2b96ea=_0x296409({'onError':_0x7c9dec=>{this['_handleError'](_0x7c9dec);},'onEvent':_0x1db1f6=>{_0x1db1f6['data']=JSON['parse'](_0x1db1f6['data']),_0x44cc7d['push'](_0x1db1f6);}});try{let _0x21a349=!0x1;for(;!_0x21a349;){const {done:_0x1b9027,value:_0x332842}=await _0x4ac4aa['read']();_0x1b9027&&(_0x21a349=!0x0),_0x2b96ea['feed'](this['_decoder']['decode'](_0x332842,{'stream':!0x0})),yield*_0x44cc7d,_0x44cc7d['length']=0x0;}}catch(_0x55de10){this['_handleError'](_0x55de10);}finally{_0x4ac4aa['releaseLock'](),_0x2b96ea['reset']();}}['_handleError'](_0xed93ab){if(_0xed93ab instanceof at)throw _0xed93ab;if(_0xed93ab instanceof Error&&'AbortError'===_0xed93ab['name'])throw new at('ai-request-aborted',this,{'originalError':_0xed93ab});throw new at('ai-request-failed',this,{'originalError':_0xed93ab});}}function hs(_0x569e84,_0x17b6d3,_0x4d2316){const t=_0x569e84['t'];switch(_0x17b6d3){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'},_0x4d2316);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.'},_0x4d2316);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.'},_0x4d2316);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.'},_0x4d2316);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'},_0x4d2316);case'AI_CHAT_SUGGESTION_ACTION_SUGGEST':return t({'id':'AI_CHAT_SUGGESTION_ACTION_SUGGEST','string':'Suggest'},_0x4d2316);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'},_0x4d2316);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.'},_0x4d2316);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.'},_0x4d2316);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.'},_0x4d2316);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.'},_0x4d2316);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'},_0x4d2316);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.'},_0x4d2316);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 _0x17b6d3;}}const cs='ck-ai-button-primary',ls='ck-ai-button-secondary',us='ck-ai-button-tertiary';function ds(_0x12a797,_0x56d12e){const _0x44fb30=new Nt(_0x12a797),_0x11513a=hs(_0x12a797,'AI_TABS_LABEL_MINIMIZE'),_0x3114fa=hs(_0x12a797,'AI_TABS_LABEL_MAXIMIZE');return _0x44fb30['set']({'withText':!0x1,'icon':_0x404c0e,'tooltip':!0x0,'class':'ck-ai-tabs__resize\x20'+us}),_0x44fb30['bind']('label')['to'](_0x56d12e,'isMaximized',_0x4ec094=>_0x4ec094?_0x11513a:_0x3114fa),_0x44fb30['bind']('icon')['to'](_0x56d12e,'isMaximized',_0x20f07b=>_0x20f07b?_0x3a0cb5:_0x404c0e),_0x44fb30['bind']('isOn')['to'](_0x56d12e,'isMaximized'),_0x44fb30['on']('execute',()=>{_0x56d12e['fire']('resizeTabs');}),_0x44fb30;}function _s(_0x4cdd96){return _0xa4cc6b(_0x4cdd96);}function gs(_0x53b630){return ti(_0x53b630);}function As(_0x5d0a7d,_0x29628a,_0x4464c3){const _0x4f6598=null!==_0x29628a?_0x1255f3=>_0x1255f3['attribs'][_0x5d0a7d]===_0x29628a:_0x449a47=>Boolean(_0x449a47['attribs'][_0x5d0a7d]);return _0x4d511d(_0xafdcee=>_0x3c6d6b(_0xafdcee)&&_0x4f6598(_0xafdcee),_0x4464c3);}function Is(_0x1b65a3,_0x57ec36,_0x482a37){const _0x47995c=null!==_0x57ec36?_0x898cda=>_0x898cda['attribs'][_0x1b65a3]===_0x57ec36:_0x341493=>Boolean(_0x341493['attribs'][_0x1b65a3]);return _0x3200a8(_0x3c2b29=>_0x3c6d6b(_0x3c2b29)&&_0x47995c(_0x3c2b29),_0x482a37);}function Es(_0x90e67a,_0x484900){return _0x90e67a&&_0x3c6d6b(_0x90e67a)?_0x90e67a['attribs'][_0x484900]:null;}function ps(_0x58173e,_0xad57a0,_0x1abfa3){_0x3c6d6b(_0x58173e)&&(null===_0x1abfa3?delete _0x58173e['attribs'][_0xad57a0]:_0x58173e['attribs'][_0xad57a0]=_0x1abfa3);}function ms(_0x487776,_0x35bd43,_0x56193e){const _0xd3b9e6=_0x35bd43['cloneNode'](!0x0);'beforebegin'===_0x56193e?_0x398bab(_0x487776,_0xd3b9e6):'afterbegin'===_0x56193e?_0x1b368b(_0x487776,_0xd3b9e6):'beforeend'===_0x56193e?_0x5e11d3(_0x487776,_0xd3b9e6):'afterend'===_0x56193e&&_0x2260c6(_0x487776,_0xd3b9e6);}function Ts(_0x469e3d){const _0x2859a6=[];let _0x51a41b=_0x469e3d;for(;_0x51a41b;)_0x51a41b=_0x3c5b43(_0x51a41b),_0x51a41b&&_0x2859a6['push'](_0x51a41b);return _0x2859a6;}function Cs(_0x5b6cf2){return _0x5b6cf2['replace'](/^\s+/gm,'')['replace'](/\s+$/gm,'')['replace'](/\n*/g,'')['replace'](/\s+/g,'\x20')['replace'](/>\s*</g,'><');}function ws(_0x2c7851){let _0x37172e=0x0;for(;_0x2c7851['parentNode'];)_0x2c7851=_0x2c7851['parentNode'],_0x37172e++;return _0x37172e;}function fs(_0x3058ce){const _0x23f4e7=[];let _0x445035=_0x3058ce['nextSibling'];for(;_0x445035;)_0x23f4e7['push'](_0x445035),_0x445035=_0x445035['nextSibling'];_0x23f4e7['forEach'](_0x354f18=>{_0x4da48a(_0x354f18);});}class bs extends/* #__PURE__ -- @preserve */
|
|
25
|
+
ht(){['_m2html'];constructor(){super();const _0x3300a0=Object['entries'](_0x433026),_0x20201f=_0x3300a0['findIndex'](([_0x23243d])=>'rehypeDomRaw'===_0x23243d);if(-0x1===_0x20201f)throw new at('ai-response-parser-unable-to-set-up-parser');_0x3300a0['splice'](_0x20201f+0x1,0x0,['rehypeSanitize',_0x50ed3e]),this['_m2html']=new _0x21f209({'plugins':Object['fromEntries'](_0x3300a0)});}['convertMarkdownToHTML'](_0x2168ed){const _0x392803=this['_m2html']['parse'](_0x2168ed);return this['parseAndNormalizeHTML'](_0x392803);}['parseAndNormalizeHTML'](_0x15b537){return this['_parseHTML'](_0x15b537);}['_parseHTML'](_0x4c94ee){const _0xdf6ad=_s('<dummy>'+_0x4c94ee['replace'](/^\t+/gm,'\x20')['replace'](/\n*/g,'')['replace'](/\s+/g,'\x20')['replace'](/<[^>]*?$/g,'')+'</dummy>');return _0xdf6ad['children']=_0xdf6ad['children'][0x0]['children'],_0xdf6ad;}}class Ss extends/* #__PURE__ -- @preserve */
|
|
26
|
+
ht(){['_generateUid'];['_uidCounter']=0x0;['_touchedNodesState']={'newIds':[],'modifiedIds':[],'removedIds':[],'invalidIds':[],'lastTouchedId':null};['_existingDataIds']=new Set();constructor(_0x177159){super(),this['_generateUid']=_0x177159||(()=>'e'+String(this['_uidCounter']++));}['merge'](_0x446439,_0x449e91,_0x5c4365){this['_uidCounter']=0x0;const _0x4dfafb=_0x446439['cloneNode'](!0x0),_0x45fd3d=_0x4dfafb['childNodes'],_0x2b8bc5=Array['from'](_0x45fd3d)['filter'](_0x31b3b5=>!(0x3===_0x31b3b5['nodeType']&&''===gs(_0x31b3b5)['trim']())),_0x4d2906=_0x2b8bc5['length'],_0x57496c=new Map();for(const _0x250fe7 of _0x2b8bc5)_0x250fe7&&_0x3c6d6b(_0x250fe7)&&void 0x0===_0x250fe7['attribs']['data-id']&&ps(_0x250fe7,'data-id','new-element');if(0x0===_0x449e91['childNodes']['length']){const _0x12c453=[];return Is('data-id','new-element',_0x4dfafb)['forEach'](_0xea4214=>{const _0x500116=this['_generateUid']();ps(_0xea4214,'data-id',_0x500116),_0x12c453['push'](_0x500116);}),this['_removeSpecialComments'](_0x4dfafb),{'parsedContent':_0x4dfafb,'newNodeIds':_0x12c453,'modifiedNodeIds':[],'removedNodeIds':[],'newAnchorIds':_0x57496c};}_0x5c4365&&_0x5c4365['markUnstableElements']&&this['_markLastTagElementUnstable'](_0x4dfafb),this['_touchedNodesState']['newIds']=[],this['_touchedNodesState']['modifiedIds']=[],this['_touchedNodesState']['removedIds']=[],this['_touchedNodesState']['invalidIds']=[],this['_touchedNodesState']['lastTouchedId']=null,this['_existingDataIds']=new Set(Is('data-id',null,_0x449e91)['map'](_0xaafe5c=>Es(_0xaafe5c,'data-id'))['filter'](_0x511374=>!!_0x511374));let _0xbb62fb=-0x1,_0x5698a1=!0x1;for(let _0x229c24=0x0;_0x229c24<_0x4d2906;_0x229c24++){const _0x567f94=_0x2b8bc5[_0x229c24],_0x5e3fa0=_0x2b8bc5[_0x229c24+0x1];if(this['_isNewNode'](_0x567f94)){if(-0x1===_0xbb62fb&&(_0xbb62fb=_0x229c24),this['_markWrappedElements'](_0x567f94),!this['_isNewNode'](_0x5e3fa0)){const [_0x4f4334,_0x1a2a1f]=this['_findReferenceNode'](_0x567f94,_0x5698a1,_0x449e91);if(_0x4f4334){const _0x50e858=Array['from'](_0x2b8bc5)['slice'](_0xbb62fb,_0x229c24+0x1),_0x1baabb=Es(_0x4f4334,'data-id');if(this['_insertNodes'](_0x4f4334,_0x50e858,_0x1a2a1f),_0x1baabb)for(const _0x135e22 of _0x50e858){const _0x11c5e8=Es(_0x135e22,'data-id');_0x11c5e8&&_0x57496c['set'](_0x11c5e8,_0x1baabb);}_0xbb62fb=-0x1;}}}else{if(this['_isExistingContentComment'](_0x567f94))_0x5698a1=!0x0;else{if(this['_isExistingNode'](_0x567f94)){const _0x22349c=Es(_0x567f94,'data-id');if(_0x22349c&&this['_existingDataIds']['has'](_0x22349c)){const _0xca0b1d=As('data-id',_0x22349c,_0x449e91);this['_replaceNode'](_0xca0b1d,_0x567f94);}}else{if(this['_isDelNode'](_0x567f94)){const _0x49a514=this['_getNodeDataId'](_0x567f94);!!As('data-id',_0x49a514,_0x4dfafb)||this['_touchedNodesState']['removedIds']['push'](_0x49a514);}}}}}for(const _0x533b88 of this['_touchedNodesState']['removedIds']){const _0x4e8d34=As('data-id',_0x533b88,_0x449e91);_0x4e8d34&&this['_removeNode'](_0x4e8d34,_0x533b88,_0x5c4365);}if(Is('data-id','new-element',_0x449e91)['forEach'](_0x5d2980=>{const _0x17ca87=this['_getUid'](_0x5d2980);ps(_0x5d2980,'data-id',_0x17ca87),this['_touchedNodesState']['newIds']['push'](_0x17ca87);}),this['_removeSpecialComments'](_0x449e91),_0x5c4365&&_0x5c4365['markUnstableElements']&&this['_markUnstableElements'](_0x449e91,_0x5c4365['markUnstableElementsDepth']||0x0),this['_processWrappedElements'](_0x449e91,_0x5c4365),_0x5c4365&&_0x5c4365['cutAfterLastChange']&&this['_touchedNodesState']['lastTouchedId']){const _0x2cb683=Is('data-id',this['_touchedNodesState']['lastTouchedId'],_0x449e91);let _0x44a7f4=_0x2cb683[_0x2cb683['length']-0x1];for(;_0x44a7f4;)fs(_0x44a7f4),_0x44a7f4=_0x44a7f4['parentNode'];}return{'parsedContent':_0x449e91,'newNodeIds':this['_touchedNodesState']['newIds'],'modifiedNodeIds':this['_touchedNodesState']['modifiedIds'],'removedNodeIds':this['_touchedNodesState']['removedIds'],'newAnchorIds':_0x57496c};}['_insertNodes'](_0x2cc006,_0x35c5fc,_0x3144bc){for(const _0x108ffc of _0x35c5fc){const _0x2fd84c=this['_getUid'](_0x108ffc);ps(_0x108ffc,'data-id',_0x2fd84c),this['_touchedNodesState']['newIds']['push'](_0x2fd84c),this['_touchedNodesState']['lastTouchedId']=_0x2fd84c;}const _0x4d6534='afterbegin'===_0x3144bc||'afterend'===_0x3144bc?_0x35c5fc['reverse']():_0x35c5fc;for(const _0x185c43 of _0x4d6534)ms(_0x2cc006,_0x185c43,_0x3144bc);}['_replaceNode'](_0x43222a,_0x585ebd){if(!_0x43222a)return;if(_0x26512d=_0x585ebd,Cs(gs(_0x43222a))===Cs(gs(_0x26512d)))return;var _0x26512d;const _0x2b775a=this['_getUid'](_0x43222a);ps(_0x585ebd,'data-id',_0x2b775a),this['_touchedNodesState']['modifiedIds']['push'](_0x2b775a),this['_touchedNodesState']['lastTouchedId']=_0x2b775a,_0xda6aae(_0x43222a,_0x585ebd['cloneNode'](!0x0));}['_removeNode'](_0x233205,_0x35b4df,_0x249e50){if(_0x249e50&&_0x249e50['replaceRemovedWith']){this['_touchedNodesState']['lastTouchedId']=_0x35b4df;const _0x1bb2f2=_0x249e50['replaceRemovedWith']['cloneNode'](!0x0);ps(_0x1bb2f2,'data-id',_0x35b4df),ps(_0x1bb2f2,'data-removed','true'),_0xda6aae(_0x233205,_0x1bb2f2);}else _0x4da48a(_0x233205);}['_findReferenceNode'](_0x476ee2,_0x28a5ce,_0x7883d7){const _0x1e9d0e=this['_findPrevElementWithDataId'](_0x476ee2,!0x1);if(_0x1e9d0e){const _0x2e4a6e=this['_getNodeDataId'](_0x1e9d0e),_0x540943=As('data-id',_0x2e4a6e,_0x7883d7);if(_0x540943)return[_0x540943,'afterend'];this['_touchedNodesState']['invalidIds']['push'](_0x2e4a6e);}const _0x37b7e0=this['_findNextElementWithDataId'](_0x476ee2,!0x1);if(_0x37b7e0){const _0x350c2b=this['_getNodeDataId'](_0x37b7e0),_0x3d5fdd=As('data-id',_0x350c2b,_0x7883d7);if(_0x3d5fdd)return[_0x3d5fdd,'beforebegin'];this['_touchedNodesState']['invalidIds']['push'](_0x350c2b);}return _0x28a5ce?_0x476ee2['nextSibling']?this['_findFallbackReferenceNode'](_0x476ee2,_0x7883d7):[_0x7883d7['childNodes'][_0x7883d7['childNodes']['length']-0x1],'afterend']:[_0x7883d7['childNodes'][0x0],'beforebegin'];}['_findFallbackReferenceNode'](_0xd71984,_0x1b1422){const _0x1df594=[],_0x2442bf=this['_findPrevElementWithDataId'](_0xd71984,!0x0);if(_0x2442bf){const _0x2edbf3=As('data-id',this['_getNodeDataId'](_0x2442bf),_0x1b1422);_0x2edbf3&&_0x1df594['push']([_0x2edbf3,'afterend']);}const _0x2de767=this['_findNextElementWithDataId'](_0xd71984,!0x0);if(_0x2de767){const _0x1ba6d1=As('data-id',this['_getNodeDataId'](_0x2de767),_0x1b1422);_0x1ba6d1&&_0x1df594['push']([_0x1ba6d1,'beforebegin']);}if(_0x1df594['length']>0x1)return ws(_0x1df594[0x0][0x0])<=ws(_0x1df594[0x1][0x0])?_0x1df594[0x0]:_0x1df594[0x1];return 0x1===_0x1df594['length']?_0x1df594[0x0]:[_0x1b1422['lastChild'],'afterend'];}['_findNextElementWithDataId'](_0x60e563,_0x1a096e){let _0x263e1b=_0x60e563['nextSibling'],_0x447c3d=null,_0x5ac349=!0x1;for(;_0x263e1b;){if(_0x320ff7(_0x263e1b)){if(this['_isDelNode'](_0x263e1b)&&(_0x447c3d=_0x263e1b),this['_isExistingContentComment'](_0x263e1b)&&_0x1a096e&&!_0x5ac349){_0x5ac349=!0x0,_0x263e1b=_0x263e1b['nextSibling'];continue;}break;}const _0xb5cd2a=Es(_0x263e1b,'data-id');if(_0xb5cd2a&&'new-element'!==_0xb5cd2a&&this['_existingDataIds']['has'](_0xb5cd2a)){_0x447c3d=_0x263e1b;break;}_0x263e1b=_0x263e1b['nextSibling'];}return _0x447c3d;}['_findPrevElementWithDataId'](_0x2e3a33,_0x26b70b){let _0x423f51=_0x2e3a33['previousSibling'],_0xba525f=null,_0x6de73=!0x1;for(;_0x423f51;){if(_0x320ff7(_0x423f51)){if(this['_isDelNode'](_0x423f51)&&(_0xba525f=_0x423f51),this['_isExistingContentComment'](_0x423f51)&&_0x26b70b&&!_0x6de73){_0x6de73=!0x0,_0x423f51=_0x423f51['previousSibling'];continue;}break;}const _0x1926b6=Es(_0x423f51,'data-id');if(_0x1926b6&&'new-element'!==_0x1926b6&&this['_existingDataIds']['has'](_0x1926b6)){_0xba525f=_0x423f51;break;}_0x423f51=_0x423f51['previousSibling'];}return _0xba525f;}['_markWrappedElements'](_0x26c1b9){_0x3c6d6b(_0x26c1b9)&&Is('data-id',null,_0x26c1b9)['forEach'](_0xe1b46=>{this['_isExistingNode'](_0xe1b46)&&(ps(_0xe1b46,'data-wrapped-id',Es(_0xe1b46,'data-id')),ps(_0xe1b46,'data-id',null));});}['_processWrappedElements'](_0x1c007e,_0x4cedf5){Is('data-wrapped-id',null,_0x1c007e)['forEach'](_0x400b34=>{const _0xf7c2e5=Es(_0x400b34,'data-wrapped-id');if(Es(_0x400b34,'data-unstable')||this['_hasUnstableParent'](_0x400b34))return;const _0x466d5d=As('data-id',_0xf7c2e5,_0x1c007e);ps(_0x400b34,'data-id',_0xf7c2e5),ps(_0x400b34,'data-wrapped-id',null),_0x466d5d&&(this['_removeNode'](_0x466d5d,_0xf7c2e5,_0x4cedf5),this['_touchedNodesState']['removedIds']['push'](_0xf7c2e5),this['_touchedNodesState']['lastTouchedId']=_0xf7c2e5);});}['_hasUnstableParent'](_0x3a7b6f){let _0x5bbfcd=_0x3a7b6f['parentNode'];for(;_0x5bbfcd;){if(Es(_0x5bbfcd,'data-unstable'))return!0x0;_0x5bbfcd=_0x5bbfcd['parentNode'];}return!0x1;}['_getNodeDataId'](_0x2fdc29){if(!_0x2fdc29)return null;if(_0x3c6d6b(_0x2fdc29))return Es(_0x2fdc29,'data-id');if(_0x320ff7(_0x2fdc29)){const _0xdf4788=gs(_0x2fdc29)['match'](/removed[\s*-]data-id="([^"]+)"/);if(_0xdf4788&&_0xdf4788[0x1])return _0xdf4788[0x1];}return null;}['_getUid'](_0x37d1ff){return this['_isExistingNode'](_0x37d1ff)?Es(_0x37d1ff,'data-id'):this['_generateUid']();}['_removeSpecialComments'](_0x92e4ba){(function(_0x3c410b){return _0x5a294d(_0x3d15b8=>_0x320ff7(_0x3d15b8),_0x3c410b,!0x0,0x1/0x0);}(_0x92e4ba)['filter'](_0x518fe1=>this['_isDelNode'](_0x518fe1)||this['_isExistingContentComment'](_0x518fe1))['forEach'](_0x433d2f=>{_0x4da48a(_0x433d2f);}));}['_markLastTagElementUnstable'](_0x44df33){const _0x132c14=_0x44df33['childNodes'],_0x23171a=_0x132c14[_0x132c14['length']-0x1];_0x23171a&&_0x3c6d6b(_0x23171a)&&ps(_0x23171a,'data-unstable','true');}['_markUnstableElements'](_0x93810d,_0x1860b1){const _0x27a9ad=As('data-unstable','true',_0x93810d);if(!_0x27a9ad)return;const _0x5f9b44=Ts(_0x27a9ad)['slice'](0x0,-0x1),_0x409194=_0x5f9b44['length'];let _0x2733cd=_0x27a9ad;if(_0x409194>_0x1860b1){let _0x4dc2ed=_0x409194,_0x2bad67=null;for(;_0x4dc2ed>_0x1860b1&&_0x4dc2ed>=0x0;)_0x4dc2ed--,_0x2bad67=_0x5f9b44[_0x4dc2ed];_0x2bad67&&(_0x2733cd=_0x2bad67,ps(_0x27a9ad,'data-unstable',null),ps(_0x2bad67,'data-unstable','true'));}else{if(_0x409194<_0x1860b1){let _0x1328c8=_0x409194,_0x548513=_0x27a9ad;for(;_0x1328c8<_0x1860b1;){const _0x2ab1f3=_0x548513['childNodes']['filter'](_0x3b6e96=>_0x3c6d6b(_0x3b6e96));if(0x0===_0x2ab1f3['length'])break;_0x1328c8++,_0x548513=_0x2ab1f3[_0x2ab1f3['length']-0x1];}_0x548513&&(_0x2733cd=_0x548513,ps(_0x27a9ad,'data-unstable',null),ps(_0x548513,'data-unstable','true'));}}let _0x57a3cc=_0x2733cd;for(;_0x57a3cc;){for(;_0x57a3cc['nextSibling'];)_0x57a3cc=_0x57a3cc['nextSibling'],_0x3c6d6b(_0x57a3cc)&&ps(_0x57a3cc,'data-unstable','true');_0x57a3cc=_0x57a3cc['parentNode'];}}['_isNewNode'](_0x14b5d1){return Boolean('new-element'===Es(_0x14b5d1,'data-id'));}['_isExistingNode'](_0x18d0da){return Boolean((Es(_0x18d0da,'data-id')||'')['length']>0x0&&'new-element'!==Es(_0x18d0da,'data-id'));}['_isDelNode'](_0x105bbf){return!!_0x105bbf&&Boolean(_0x320ff7(_0x105bbf)&&gs(_0x105bbf)['match'](/removed[\s*-]data-id="[^"]+"/));}['_isExistingContentComment'](_0x453f67){return Boolean(_0x320ff7(_0x453f67)&&gs(_0x453f67)['match'](/\s*existing[\s*-](content|document)\s*/g));}}function Rs({editor:_0x4c916,changeGroups:_0x16341f,documentContextContent:_0x440c26,showDiff:_0x25dc37,trimUnchanged:_0x5aa5d3=!0x0}){return _0x16341f['map'](_0x3c3182=>{const _0xddfa10=new _0x19e721([]),_0x2913a1=new _0x19e721([]),_0x3ae5e1=new Set();for(const _0x15a38c of _0x3c3182['changes'])'new'==_0x15a38c['type']&&Is('data-id',null,_0x15a38c['node'])['forEach'](_0x463c94=>{_0x3ae5e1['add'](Es(_0x463c94,'data-id'));});for(const _0x16f53e of _0x3c3182['changes'])if('removed'!=_0x16f53e['type']?_0x2913a1['children']['push'](_0x16f53e['node']['cloneNode'](!0x0)):_0x25dc37||_0x3ae5e1['has'](_0x16f53e['id'])||_0x2913a1['children']['push'](_0x16f53e['node']['cloneNode'](!0x0)),'new'!=_0x16f53e['type']&&(_0x25dc37||'removed'!=_0x16f53e['type'])){const _0x22a3fe=_0x4d511d(_0xd4c407=>Es(_0xd4c407,'data-id')==_0x16f53e['id'],_0x440c26,!0x0);_0x22a3fe&&_0xddfa10['children']['push'](_0x22a3fe['cloneNode'](!0x0));}const {content:_0x4d8c23,hasChanges:_0x485530}=function(_0x85cf5e,_0x40a195,_0x5eaf28,_0x5ec7f6,_0x472ed4=!0x0){const _0x1dfc47=_0x85cf5e['plugins']['get']('DocumentCompare'),_0xaa0829=gs(_0x40a195),_0x337c03=gs(_0x5eaf28),_0x35a8d6=_0x85cf5e['data']['parse'](_0xaa0829,'$root'),_0x50aeef=_0x85cf5e['model']['createPositionAt'](_0x35a8d6,0x0),_0x1e0dc7=_0x1dfc47['getDiff'](_0xaa0829,_0x337c03,{'anchor':_0x50aeef,'markDeletions':_0x5ec7f6,'targetEditor':_0x85cf5e}),_0x181e72=_0x1e0dc7['getOperations']();if(0x0==_0x181e72['length'])return{'content':_0x40a195['cloneNode'](!0x0),'hasChanges':!0x1};_0x5ec7f6?function(_0x3f6890,_0x3620fb,_0x51a888){if(0x0==_0x3f6890['length'])return;const _0x41181a=_0x51a888['plugins']['get']('DocumentCompare'),_0x53e663=_0x51a888['plugins']['get']('SuggestionsConversion');_0x51a888['model']['change'](_0x3be2a2=>{const _0x15337b=new Set();for(let _0x44e27a=0x0;_0x44e27a<_0x3f6890['length'];_0x44e27a++){const _0x3badb7=_0x3f6890[_0x44e27a];if(_0x3badb7['baseVersion']=null,_0x3badb7['isDocumentOperation']=!0x1,_0x41181a['isMarkedRemoveOperation'](_0x3badb7)){const _0x47011e=_0x3981ff(_0x3badb7['newRange'],_0x51a888['model']),_0x780b5f='suggestion:deletion:'+ot()+':$aiSuggestion';_0x3620fb['markers']['set'](_0x780b5f,_0x47011e);}else switch(_0x3badb7['type']){case'rename':{if(_0x3badb7['oldName']==_0x3badb7['newName'])break;_0x3be2a2['batch']['addOperation'](_0x3badb7),_0x51a888['model']['applyOperation'](_0x3badb7);const _0x5ec18f='$elementName',_0x1fc9de=_0x3badb7['position'],_0x260799=_0x51a888['model']['createRange'](_0x1fc9de,_0x51a888['model']['createPositionAt'](_0x1fc9de['nodeAfter'],'end')),_0x579409='suggestion:attribute:'+_0x5ec18f+':'+ot()+':$aiSuggestion';_0x3620fb['markers']['set'](_0x579409,_0x260799);break;}case'addAttribute':case'removeAttribute':case'changeAttribute':{if(_0x3badb7['oldValue']==_0x3badb7['newValue'])break;_0x3be2a2['batch']['addOperation'](_0x3badb7),_0x51a888['model']['applyOperation'](_0x3badb7);const _0x1fbbc8=_0x3badb7['key'];if(!_0x53e663['isRegisteredAttribute'](_0x1fbbc8))break;const _0xbf0b89=_0x3981ff(_0x3badb7['range'],_0x51a888['model']),_0x34e26c='suggestion:attribute:'+_0x1fbbc8+':'+ot()+':$aiSuggestion';_0x3620fb['markers']['set'](_0x34e26c,_0xbf0b89);break;}case'insert':{_0x3be2a2['batch']['addOperation'](_0x3badb7),_0x51a888['model']['applyOperation'](_0x3badb7);if(_0x3f6890[_0x44e27a+0x1]&&'move'==_0x3f6890[_0x44e27a+0x1]['type']){Os(_0x3620fb,_0x3badb7);break;}const _0xdfd53=_0x3badb7['position'],_0x4d8195=_0x3badb7['howMany'],_0x3ad219=_0x3981ff(_0x51a888['model']['createRange'](_0xdfd53,_0xdfd53['getShiftedBy'](_0x4d8195)),_0x51a888['model']),_0xb20898='suggestion:insertion:'+ot()+':$aiSuggestion';_0x3620fb['markers']['set'](_0xb20898,_0x3ad219);break;}case'split':{_0x3be2a2['batch']['addOperation'](_0x3badb7),_0x51a888['model']['applyOperation'](_0x3badb7);const _0x4d7822=_0x3badb7['splitPosition'],_0x5ceda6=_0x3badb7['moveTargetPosition'],_0x16bd83=_0x51a888['model']['createRange'](_0x4d7822,_0x5ceda6),_0x57c92e='suggestion:insertion:'+ot()+':$aiSuggestion';_0x3620fb['markers']['set'](_0x57c92e,_0x16bd83);break;}case'move':{_0x3be2a2['batch']['addOperation'](_0x3badb7),_0x51a888['model']['applyOperation'](_0x3badb7),_0x3f6890[_0x44e27a-0x1]&&'insert'==_0x3f6890[_0x44e27a-0x1]['type']&&Os(_0x3620fb,_0x3badb7);const _0x4f306e=_0x3badb7['getMovedRangeStart'](),_0x256005=_0x3badb7['howMany'];for(let _0x46362b=0x0;_0x46362b<_0x256005;_0x46362b++){const _0x4c6ada=_0x4f306e['getShiftedBy'](_0x46362b)['nodeAfter'];_0x15337b['add'](_0x4c6ada);}break;}case'remove':{const _0x18bdbc=_0x3badb7['sourcePosition'],_0x2e47fe=_0x3badb7['howMany'],_0x107a37=new _0x3d7c4f(_0x18bdbc,_0x2e47fe);_0x3be2a2['batch']['addOperation'](_0x107a37),_0x51a888['model']['applyOperation'](_0x107a37);break;}}}for(const _0x26437f of _0x15337b){const _0x25dbe1=_0x51a888['model']['createRangeOn'](_0x26437f),_0x5ad59b='suggestion:formatBlock:$fakeWrap:'+ot()+':$aiSuggestion';_0x3620fb['markers']['set'](_0x5ad59b,_0x3981ff(_0x25dbe1,_0x51a888['model']));}});}(_0x181e72,_0x35a8d6,_0x85cf5e):_0x85cf5e['model']['change'](_0x4884ff=>{for(const _0x144b33 of _0x181e72)if('remove'==_0x144b33['type']){const _0x38120e=_0x144b33['sourcePosition'],_0x2e13a5=_0x144b33['howMany'],_0x580f37=new _0x3d7c4f(_0x38120e,_0x2e13a5);_0x4884ff['batch']['addOperation'](_0x580f37),_0x85cf5e['model']['applyOperation'](_0x580f37);}else{if('marker'==_0x144b33['type']){const _0x49535f=_0x144b33['name'],_0x446717=_0x144b33['newRange'];null!==_0x446717?_0x35a8d6['markers']['set'](_0x49535f,_0x446717):_0x35a8d6['markers']['delete'](_0x49535f);}else _0x144b33['baseVersion']=null,_0x144b33['isDocumentOperation']=!0x1,_0x4884ff['batch']['addOperation'](_0x144b33),_0x85cf5e['model']['applyOperation'](_0x144b33);}});if(_0x472ed4){const _0x548a02=ks(_0x85cf5e,_0x181e72,_0x35a8d6);Ns(_0x85cf5e['model'],_0x548a02),function(_0x501255,_0x18238f){const _0x363cef=_0x18238f['getFirstRange']()['start'];let _0xb4b86b=_0x18238f['getFirstRange']()['end'];const _0x94b480=_0x363cef['root'];(_0xb4b86b['textNode']||_0xb4b86b['nodeAfter']&&_0xb4b86b['nodeAfter']['is']('$text'))&&(_0x4383a2(_0xb4b86b,'...'),_0xb4b86b=_0xb4b86b['getShiftedBy'](0x3)),(_0x363cef['textNode']||_0x363cef['nodeBefore']&&_0x363cef['nodeBefore']['is']('$text'))&&(_0x4383a2(_0x363cef,'...'),function(_0x547b02,_0x5aae74,_0x588446){for(let [_0x453147,_0x1002b9]of _0x547b02['markers']){const _0xe25392=_0x1002b9['_getTransformedByInsertion'](_0x5aae74,_0x588446,!0x1);_0x1002b9=_0xe25392[0x0],_0x547b02['markers']['set'](_0x453147,_0x1002b9);}}(_0x94b480,_0x363cef,0x3),_0x363cef['parent']==_0xb4b86b['parent']&&(_0xb4b86b=_0xb4b86b['getShiftedBy'](0x3)));const _0x55dcea=_0x501255['createRange'](_0x501255['createPositionAt'](_0x94b480,0x0),_0x363cef),_0x22126c=_0x501255['createRange'](_0xb4b86b,_0x501255['createPositionAt'](_0x94b480,'end')),_0x48e9a2=[..._0x55dcea['getMinimalFlatRanges'](),..._0x22126c['getMinimalFlatRanges']()];_0x48e9a2['reverse']();for(const _0x10c306 of _0x48e9a2)_0x558a1e(_0x10c306),ys(_0x94b480,_0x10c306);}(_0x85cf5e['model'],_0x548a02);}const _0x1a3926=_0x85cf5e['data']['stringify'](_0x35a8d6,{'showSuggestionHighlights':!0x0});return{'content':_s(_0x1a3926),'hasChanges':!0x0};}(_0x4c916,_0xddfa10,_0x2913a1,_0x25dc37,_0x5aa5d3);return{'type':_0x3c3182['changes'][0x0]['type'],'index':_0x3c3182['index'],'content':_0x4d8c23,'hasChanges':_0x485530};});}function Os(_0x3cd66d,_0x3c276d){for(const [_0x225daa,_0x18f9c1]of _0x3cd66d['markers']){const _0x1c7bc6=_0x5779b9['_createFromRanges'](_0x18f9c1['getTransformedByOperation'](_0x3c276d));_0x3cd66d['markers']['set'](_0x225daa,_0x1c7bc6);}}function ks(_0x62ea9,_0x355d3f,_0xa96a77){const _0x476d3d=_0x62ea9['plugins']['get']('DocumentCompare');let _0x50a1f1=_0x62ea9['model']['createPositionAt'](_0xa96a77,Number['POSITIVE_INFINITY']),_0x9ab3ae=_0x62ea9['model']['createPositionAt'](_0xa96a77,0x0);for(const _0x2ad7c2 of _0x355d3f){let _0x4df89a,_0x32db5a;if(_0x476d3d['isMarkedRemoveOperation'](_0x2ad7c2))_0x4df89a=_0x2ad7c2['newRange']['start'],_0x32db5a=_0x2ad7c2['newRange']['end'];else switch(_0x50a1f1=_0x50a1f1['getTransformedByOperation'](_0x2ad7c2),_0x9ab3ae=_0x9ab3ae['getTransformedByOperation'](_0x2ad7c2),_0x2ad7c2['type']){case'rename':_0x4df89a=_0x2ad7c2['position'],_0x32db5a=_0x4df89a['getShiftedBy'](0x1);break;case'addAttribute':case'removeAttribute':case'changeAttribute':_0x4df89a=_0x2ad7c2['range']['start'],_0x32db5a=_0x2ad7c2['range']['end'];break;case'insert':_0x4df89a=_0x2ad7c2['position'],_0x32db5a=_0x4df89a['getShiftedBy'](_0x2ad7c2['howMany']);break;case'split':_0x4df89a=_0x2ad7c2['splitPosition'],_0x32db5a=_0x2ad7c2['moveTargetPosition'];break;case'merge':{const _0x3985d8=_0x2ad7c2['targetPosition']['path']['slice'](0x0,-0x1);_0x4df89a=_0x62ea9['model']['createPositionFromPath'](_0xa96a77,_0x3985d8),_0x32db5a=_0x4df89a['getShiftedBy'](0x1);break;}case'move':case'remove':{const _0x1ea0c5=_0x2ad7c2['howMany'],_0x4b5858=_0x2ad7c2['sourcePosition']['_getTransformedByInsertion'](_0x2ad7c2['targetPosition'],_0x1ea0c5),_0x446c78=_0x2ad7c2['getMovedRangeStart']();'remove'==_0x2ad7c2['type']?(_0x4df89a=_0x4b5858,_0x32db5a=_0x4b5858):(_0x4df89a=_0x446c78,_0x32db5a=_0x446c78['getShiftedBy'](_0x1ea0c5));break;}}_0x4df89a&&_0x4df89a['isBefore'](_0x50a1f1)&&(_0x50a1f1=_0x4df89a['clone'](),_0x50a1f1['stickiness']='toNone'),_0x32db5a&&_0x32db5a['isAfter'](_0x9ab3ae)&&(_0x9ab3ae=_0x32db5a['clone'](),_0x9ab3ae['stickiness']='toNone');}return _0x62ea9['model']['createSelection'](_0x62ea9['model']['createRange'](_0x50a1f1,_0x9ab3ae));}function Ns(_0x4c0164,_0x96147f){vs(_0x4c0164,_0x96147f,'forward');const _0x273a4f=_0x96147f['getFirstRange']();_0x96147f['setTo']([]),_0x96147f['setTo'](_0x273a4f,{'backward':!0x0}),vs(_0x4c0164,_0x96147f,'backward');}function vs(_0x3116de,_0x437ec3,_0x202c62){let _0x3eb00f=0x14;for(;_0x3eb00f;){_0x3116de['modifySelection'](_0x437ec3,{'unit':'word','direction':_0x202c62}),_0x3eb00f--;const _0x49f22d=_0x437ec3['focus']['forward'==_0x202c62?'nodeBefore':'nodeAfter'];if(_0x49f22d&&_0x49f22d['is']('element')&&_0x3116de['schema']['isBlock'](_0x49f22d)&&_0x3116de['schema']['isObject'](_0x49f22d))break;}}function ys(_0x2c36d3,_0x36959f){for(const [_0x1217b5,_0x54d4eb]of _0x2c36d3['markers']){const _0x20c4fb=_0x54d4eb['_getTransformedByDeletion'](_0x36959f['start'],_0x36959f['end']['offset']-_0x36959f['start']['offset']);null!=_0x20c4fb?_0x2c36d3['markers']['set'](_0x1217b5,_0x20c4fb):_0x2c36d3['markers']['delete'](_0x1217b5);}}class xs extends ht(){['id'];['interactionId'];['type'];['sources']=[];['parsedContent']=new _0x19e721([]);['parsedMergedContent']=new _0x19e721([]);['changeGroups']=[];['areActionsDisabled']=!0x1;['isFromHistory']=!0x1;['documentContextContent'];['documentId'];['dataIdDocumentSources'];['newNodeAnchorIds']=new Map();['aiResponseParser'];['aiResponseApplier'];['locale'];['cachedSuggestionContentParts']={'withDiff':[],'withoutDiff':[]};constructor({type:_0xf9e01,content:_0x1bab7c='',isDone:_0x3d236c=!0x1,isComplete:_0x50b3f5,interactionId:_0x1d0fdb,areActionsDisabled:_0x100870,isFromHistory:_0x5f55d0=!0x1,documentContextContent:_0x2fa08d,dataIdDocumentSources:_0x5af7ba,documentId:_0x393e7a,locale:_0xfeef0d,id:_0x1deead}){super(),this['id']=_0x1deead||ot(),this['interactionId']=_0x1d0fdb,this['type']=_0xf9e01,this['areActionsDisabled']=!!_0x100870,this['locale']=_0xfeef0d,this['dataIdDocumentSources']=_0x5af7ba,this['documentId']=_0x393e7a,this['isFromHistory']=_0x5f55d0,this['aiResponseParser']=new bs(),this['aiResponseApplier']=new Ss(),this['documentContextContent']=_s(_0x2fa08d||''),this['set']('isDone',_0x3d236c),this['set']('isComplete',_0x50b3f5??_0x3d236c),this['on']('change:content',()=>{this['onContentChange']();}),this['set']('content',_0x1bab7c);}['appendContent'](_0x43f339){this['set']('content',this['content']+_0x43f339);}['done'](_0x18271e=!0x0){this['isComplete']=_0x18271e,this['isDone']||(this['set']('isDone',!0x0),this['onContentChange']());}['destroy'](){this['stopListening']();}['setChangeGroupState'](_0x9af292,_0x3072c8){this['changeGroups'][_0x9af292]['state']=_0x3072c8,this['fire']('replyChangeGroupStateUpdated',{'reply':this,'index':_0x9af292,'state':_0x3072c8});}['getContentParts']({showDiff:_0x3352d5,groupIndex:_0x2e83d0,editor:_0x6b41ae}){const _0xd83914=this['_getCachedContentParts'](_0x3352d5,_0x2e83d0);if(_0xd83914)return _0xd83914;let _0x690a9d=[];if(void 0x0===_0x2e83d0)_0x690a9d=this['changeGroups'];else{const _0x28cd25=this['changeGroups']['find'](({index:_0x481a96})=>_0x481a96===_0x2e83d0);if(!_0x28cd25)throw new at('ai-reply-get-content-parts-group-not-found',null,{'aiReply':this,'groupIndex':_0x2e83d0});_0x690a9d=[_0x28cd25];}const _0x1a1c4c=Rs({'editor':_0x6b41ae,'showDiff':_0x3352d5,'changeGroups':_0x690a9d,'documentContextContent':this['documentContextContent']});return this['_setCachedContentParts'](_0x3352d5,_0x1a1c4c),_0x1a1c4c;}['_getCachedContentParts'](_0x875e56,_0x47f1dd){const _0x41876f=_0x875e56?'withDiff':'withoutDiff';if(!this['cachedSuggestionContentParts'][_0x41876f]['length'])return null;const _0xf2f76d=this['cachedSuggestionContentParts'][_0x41876f];if(void 0x0===_0x47f1dd)return _0xf2f76d['length']>0x0&&_0xf2f76d['length']!==this['changeGroups']['length']?(this['_setCachedContentParts'](_0x875e56,null),null):_0x493d9d(_0xf2f76d);{const _0x15df7a=_0xf2f76d['find'](({index:_0x1c9fa9})=>_0x1c9fa9===_0x47f1dd);if(_0x15df7a)return[_0x493d9d(_0x15df7a)];}return null;}['_setCachedContentParts'](_0x409d55,_0x5879f7){const _0x3ec56f=_0x409d55?'withDiff':'withoutDiff';_0x5879f7?_0x5879f7['forEach'](_0xa5fc8=>{const _0x191a22=this['cachedSuggestionContentParts'][_0x3ec56f],_0x20e9eb=_0x191a22['find'](({index:_0x96ec1c})=>_0x96ec1c===_0xa5fc8['index']);if(_0x20e9eb){const _0x30ae82=_0x191a22['indexOf'](_0x20e9eb);_0x191a22['splice'](_0x30ae82,0x1,_0xa5fc8);}else _0x191a22['push'](_0xa5fc8);}):this['cachedSuggestionContentParts'][_0x3ec56f]['length']=0x0;}['onContentChange'](){if('modification'===this['type']){this['parsedContent']=this['aiResponseParser']['parseAndNormalizeHTML'](this['content']);const _0x20007e=this['changeGroups'];this['updateChangeGroups']();const _0x53ef96=this['_getDifferentChangeGroups'](_0x20007e,this['changeGroups']);(_0x53ef96['length']||this['isDone'])&&(this['fire']('replyContentUpdated',this,_0x53ef96),this['cachedSuggestionContentParts']['withDiff']['length']=this['cachedSuggestionContentParts']['withoutDiff']['length']=0x0);}else this['parsedContent']=this['aiResponseParser']['convertMarkdownToHTML'](this['content']),this['fire']('replyContentUpdated',this);}['_getDifferentChangeGroups'](_0x540df9,_0x7ea28a){const _0x7a6b9f=[];for(const _0x3e065d of _0x7ea28a){const _0x2638b8=_0x540df9[_0x3e065d['index']];_0x2638b8?_0x2638b8['changes']['length']!==_0x3e065d['changes']['length']?_0x7a6b9f['push'](_0x3e065d):_0x2638b8['changes']['forEach']((_0x11f087,_0x3c59d9)=>{const _0x51c2d4=_0x3e065d['changes'][_0x3c59d9];_0x11f087['id']!==_0x51c2d4['id']&&_0x7a6b9f['push'](_0x3e065d);}):_0x7a6b9f['push'](_0x3e065d);}return _0x7a6b9f;}['updateChangeGroups'](){const _0x5ce0bd=this['locale']?new _0x4b7733('p',{},[new _0x4b7733('span',{'style':'color:\x20#808080;\x20font-style:\x20italic'},[new _0x19530c(hs(this['locale'],'AI_SUGGESTION_CONTENT_PART_REMOVED'))])]):void 0x0,_0x20d58b=this['aiResponseApplier']['merge'](this['parsedContent'],this['documentContextContent']['cloneNode'](!0x0),{'markUnstableElements':!this['isDone']||!this['isComplete'],'replaceRemovedWith':_0x5ce0bd,'cutAfterLastChange':!this['isDone']||!this['isComplete']});if(!_0x20d58b['modifiedNodeIds']['length']&&!this['isDone'])return;this['parsedMergedContent']=_0x20d58b['parsedContent'],this['newNodeAnchorIds']=_0x20d58b['newAnchorIds'];let _0x3638ec=[];if(_0x3200a8(_0x116535=>{const _0x1ae5d1=Es(_0x116535,'data-id');if(!_0x1ae5d1||!_0x157706(_0x1ae5d1))return!0x1;const _0x44ab69=[_0x116535,...Ts(_0x116535)]['at'](-0x2);if(_0x116535!=_0x44ab69){const _0x57d885=Es(_0x44ab69,'data-id');_0x157706(_0x57d885)||(_0x3638ec['push']({'node':_0x44ab69,'id':_0x57d885,'type':'modified'}),_0x20d58b['modifiedNodeIds']['push'](_0x57d885));}else _0x20d58b['modifiedNodeIds']['includes'](_0x1ae5d1)?_0x3638ec['push']({'node':_0x116535,'type':'modified','id':_0x1ae5d1}):_0x20d58b['newNodeIds']['includes'](_0x1ae5d1)?_0x3638ec['push']({'node':_0x116535,'type':'new','id':_0x1ae5d1,'anchorId':Es(_0x116535['previousSibling'],'data-id')}):_0x3638ec['push']({'node':_0x116535,'type':'removed','id':_0x1ae5d1});return!0x0;},this['parsedMergedContent']),_0x3638ec=_0x3638ec['filter'](({node:_0x444353})=>[...Ts(_0x444353),_0x444353]['every'](_0x13e945=>!Es(_0x13e945,'data-unstable'))),0x0==_0x3638ec['length'])return;const _0x3a56f5=[[_0x3638ec[0x0]]];for(let _0x986d84=0x1;_0x986d84<_0x3638ec['length'];_0x986d84++){const _0x20377b=_0x3a56f5[_0x3a56f5['length']-0x1],_0x2947b9=_0x20377b[_0x20377b['length']-0x1];_0x3638ec[_0x986d84]['node']['previousSibling']==_0x2947b9['node']&&'modified'!=_0x3638ec[_0x986d84]['type']&&'modified'!=_0x2947b9['type']&&this['_isSameDocument'](_0x3638ec[_0x986d84]['node'],_0x2947b9['node'])?_0x20377b['push'](_0x3638ec[_0x986d84]):_0x3a56f5['push']([_0x3638ec[_0x986d84]]);}for(const _0x1ded3d of _0x3a56f5){const _0x5c33ef=_0x1ded3d[0x0],_0x2b5c66=_0x1ded3d[_0x1ded3d['length']-0x1],_0x3ab3e3=_0x5b5b11(_0x5c33ef['node']['previousSibling']);_0x3ab3e3&&this['_isSameDocument'](_0x3ab3e3['node'],_0x5c33ef['node'])&&_0x1ded3d['unshift'](_0x3ab3e3);const _0xd15f2c=_0x5b5b11(_0x2b5c66['node']['nextSibling']);_0xd15f2c&&this['_isSameDocument'](_0xd15f2c['node'],_0x2b5c66['node'])&&_0x1ded3d['push'](_0xd15f2c);}function _0x157706(_0x2874aa){return _0x20d58b['modifiedNodeIds']['includes'](_0x2874aa)||_0x20d58b['newNodeIds']['includes'](_0x2874aa)||_0x20d58b['removedNodeIds']['includes'](_0x2874aa);}function _0x5b5b11(_0x56ee0e){if(_0x56ee0e&&Es(_0x56ee0e,'data-id')&&!Es(_0x56ee0e,'data-unstable')){const _0x360bf5=Es(_0x56ee0e,'data-id');if(!_0x157706(_0x360bf5))return{'node':_0x56ee0e,'type':'context','id':_0x360bf5};}return null;}this['changeGroups']=_0x3a56f5['map']((_0x5a283e,_0x566065)=>({'changes':_0x5a283e,'state':'pending','index':_0x566065}));}['_isSameDocument'](_0x1d8d36,_0x1c1e2b){if(!this['dataIdDocumentSources']?.['size'])return!0x0;const _0x47e97c=this['_resolveDocumentSource'](_0x1d8d36),_0x19fbdc=this['_resolveDocumentSource'](_0x1c1e2b);return!_0x47e97c||!_0x19fbdc||_0x47e97c['editor']===_0x19fbdc['editor']&&_0x47e97c['rootName']===_0x19fbdc['rootName'];}['_resolveDocumentSource'](_0x3dbea5){if(!_0x3dbea5||!this['dataIdDocumentSources'])return;const _0x53909c=Es(_0x3dbea5,'data-id');if(_0x53909c){const _0x1abfc2=this['dataIdDocumentSources']['get'](_0x53909c);if(_0x1abfc2)return _0x1abfc2;const _0x26af64=this['newNodeAnchorIds']['get'](_0x53909c),_0x4267aa=_0x26af64?this['dataIdDocumentSources']['get'](_0x26af64):void 0x0;if(_0x4267aa)return _0x4267aa;}for(let _0x2530fb=_0x3dbea5['previousSibling'];_0x2530fb;_0x2530fb=_0x2530fb['previousSibling']){const _0x35a1e4=Es(_0x2530fb,'data-id'),_0x171f9e=_0x35a1e4?this['dataIdDocumentSources']['get'](_0x35a1e4):void 0x0;if(_0x171f9e)return _0x171f9e;}for(let _0x41956d=_0x3dbea5['nextSibling'];_0x41956d;_0x41956d=_0x41956d['nextSibling']){const _0x2ed670=Es(_0x41956d,'data-id'),_0x46926b=_0x2ed670?this['dataIdDocumentSources']['get'](_0x2ed670):void 0x0;if(_0x46926b)return _0x46926b;}}}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:_0x1103a4,locale:_0x1f6da3}){super(),this['id']=ot(),this['connector']=_0x1103a4,this['isStopped']=!0x0,this['locale']=_0x1f6da3;}async['start'](){const _0x3cc07b=[];let _0x206d88,_0xe8a946,_0x5cc69e,_0x4a05a3=!0x1;this['isStopped']=!0x1;try{this['currentRequest']=await this['sendRequest'](),this['fire']('interactionStarted',this);const _0x4a6534=await this['currentRequest']['getStream']();for await(const _0x2db50e of _0x4a6534){if(this['isStopped'])return;if('error'==_0x2db50e['event'])return void this['fire']('error',{'error':new at('ai-chat-interaction-error',this)});switch(_0x2db50e['event']){case'message-metadata':this['messageId']=_0x2db50e['data']['messageId'];break;case'action-metadata':this['actionCallId']=_0x2db50e['data']['callId'];break;case'conversation-title':this['setConversationTitle'](_0x2db50e['data']['conversationTitle'],!0x0);break;case'source':_0x3cc07b['push'](_0x2db50e['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'](),_0x206d88='modification-delta'==_0x2db50e['event']?'modification':'text',_0xe8a946='modification-delta'==_0x2db50e['event']?_0x2db50e['data']['id']:void 0x0,this['currentReply']&&this['currentReply']['type']!=_0x206d88&&(this['currentReply']['done'](),this['currentReply']=void 0x0),this['currentReply']?'modification-delta'==_0x2db50e['event']&&(this['currentReply']['documentId']=_0x2db50e['data']['documentId']):(this['currentReply']=this['createReply']({'type':_0x206d88,'interactionId':this['id'],'id':_0xe8a946,...'modification-delta'==_0x2db50e['event']&&{'documentId':_0x2db50e['data']['documentId']}}),'modification'==_0x206d88&&(this['currentReply']['sources']=_0x3cc07b['splice'](0x0))),this['currentReply']['appendContent'](_0x2db50e['data']['textDelta']);break;case'mcp-tool-result':_0x5cc69e=JSON['parse'](_0x2db50e['data']['result']),this['_handleToolResultData']({'toolName':_0x2db50e['data']['toolName'],'data':_0x5cc69e['data'],'attributes':_0x5cc69e['attributes']});break;case'mcp-tool-notification':this['_handleToolNotificationData']({'toolName':_0x2db50e['data']['toolName'],'data':_0x2db50e['data']['data']});}}_0x4a05a3=!0x0;}finally{this['isStopped']||(this['currentReply']&&_0x3cc07b['length']>0x0&&(this['currentReply']['sources']=_0x3cc07b['splice'](0x0)),this['_finalizeInteraction'](_0x4a05a3),this['fire']('interactionFinished',this));}}['stop'](){this['isStopped']||(this['_finalizeInteraction'](),this['fire']('interactionStopped',this));}['getReply'](_0x5d5068){return this['replies']['find'](_0x1920a1=>_0x1920a1['id']===_0x5d5068);}['destroy'](){this['isDestroyed']||(this['stop'](),this['replies']['forEach'](_0x11809d=>_0x11809d['destroy']()),this['replies']=[],this['isDestroyed']=!0x0,this['fire']('interactionDestroyed',this),this['stopListening']());}['createReply'](_0x21db46){const _0xb155c9=new xs({'locale':this['locale'],'documentContextContent':this['getDocumentContext']()?.['content'],'dataIdDocumentSources':this['getDocumentContext']()?.['dataIdDocumentSources'],..._0x21db46});return this['replies']['push'](_0xb155c9),_0xb155c9['delegate'](...Ls)['to'](this),this['fire']('replyCreated',_0xb155c9),_0xb155c9;}['setConversationTitle'](_0x392b3f,_0x1665c0=!0x1){this['fire']('setConversationTitle',_0x392b3f,_0x1665c0);}['resetWebSearchState'](){this['_isWebSearching']&&(this['_isWebSearching']=!0x1,this['fire']('webSearchFinished',this));}['resetReasoningState'](){this['_isReasoning']&&(this['_isReasoning']=!0x1,this['fire']('reasoningFinished',this));}['_handleToolResultData'](_0x547d9c){this['fire']('toolDataReceived',{'type':'result','toolName':_0x547d9c['toolName'],'data':structuredClone(_0x547d9c['data']||{}),'attributes':structuredClone(_0x547d9c['attributes']||{})},this);}['_handleToolNotificationData'](_0x4335a6){this['fire']('toolDataReceived',{'type':'notification','toolName':_0x4335a6['toolName'],'data':structuredClone(_0x4335a6['data'])},this);}['_finalizeInteraction'](_0x42e95d=!0x1){this['isStopped']=!0x0,this['currentRequest']&&this['currentRequest']['abortController']['abort'](),this['currentReply']&&this['currentReply']['done'](_0x42e95d),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:_0x439743,config:_0x433c49,ownerId:_0x77d287}){super(),this['_connector']=_0x439743,this['_config']=_0x433c49,this['_ownerId']=_0x77d287;}['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'](_0x4a6940){if(_0x4a6940)return this['_documentSources']['get'](_0x4a6940);}['getSourceByDataId'](_0x216d50){if(_0x216d50)return this['_dataIdToSource']['get'](_0x216d50);}['_getDocumentContextSlice'](_0x302d20){const _0x499e27=this['_getDocumentSource'](_0x302d20);if(_0x499e27)return{'editor':_0x499e27['editor'],'rootName':_0x499e27['rootName'],'html':_0x499e27['content'],'version':_0x499e27['version']};}['getDocumentContextSliceByDataId'](_0x46c03a){const _0x55c8d0=this['getSourceByDataId'](_0x46c03a);return _0x55c8d0?this['_getDocumentContextSlice'](_0x55c8d0['documentId']):void 0x0;}['getPendingContextItems'](){return this['_pendingContextItems'];}async['populateFromMessage'](_0x356793){const _0x2f19db=await this['_createContextItemFromContent'](_0x356793);return this['_addToConversationContextItem'](_0x2f19db),'current-document'===_0x2f19db['uiId']&&this['_toggleAddCurrentDocumentOptionVisibility'](),_0x2f19db;}async['populateDocumentsFromMessage'](_0x4f7195,_0x107d77){const _0x450557=_0x4f7195['filter'](_0x589743=>'document'===_0x589743['type']);if(0x0===_0x450557['length'])return{'hasUnmatched':!0x1};if(0x1===_0x450557['length'])return{'contextItem':await this['populateFromMessage'](_0x450557[0x0]),'hasUnmatched':!0x1};const _0x5ee870=_0x450557['map'](_0x27c394=>_0x27c394['id']),_0x4a0bc9=await this['_connector']['fetchDocuments'](this['_ownerId'],_0x5ee870)['getDocuments'](),_0x5f5a6f=new Map(_0x4a0bc9['map'](_0x4a0593=>[_0x4a0593['id'],_0x4a0593]));this['_documentSources']['clear'](),this['_dataIdToSource']['clear']();const _0x3bb58d=[];let _0x533e4a=!0x1;for(const _0x3fab0e of _0x450557){const _0x143f08=_0x5f5a6f['get'](_0x3fab0e['id']);if(!_0x143f08)continue;const _0x9c4b8d=this['_matchDocumentToRoot'](_0x143f08,_0x107d77),_0x4ad3ff=_0x107d77[0x0]&&this['_getFirstRoot'](_0x107d77[0x0]);_0x9c4b8d||(_0x533e4a=!0x0);const _0x57b187=_0x9c4b8d?.['editor']??_0x4ad3ff?.['editor'],_0x574be3=_0x9c4b8d?.['rootName']??_0x4ad3ff?.['rootName'];if(_0x57b187&&_0x574be3){const _0x406d8f={'editor':_0x57b187,'rootName':_0x574be3,'content':_0x143f08['content'],'version':_0x143f08['attributes']?.['version']??0x0,'name':_0x143f08['name'],'description':_0x143f08['description']};this['_documentSources']['set'](_0x143f08['id'],_0x406d8f);const _0x14312f=_s(_0x143f08['content']);for(const _0x15f67d of _0x3200a8(_0x1478fd=>!!Es(_0x1478fd,'data-id'),_0x14312f)){const _0x5a7ae0=Es(_0x15f67d,'data-id');_0x5a7ae0&&this['_dataIdToSource']['set'](_0x5a7ae0,{..._0x406d8f,'documentId':_0x143f08['id']});}}_0x3bb58d['push']({'id':_0x143f08['id'],'content':_0x143f08['content'],'version':_0x143f08['attributes']?.['version']??0x0,'sessionId':_0x143f08['attributes']?.['sessionId']??null,'selection':[]});}const _0x578902={'id':'current-document','uiId':'current-document','label':'Current\x20document','type':'document','hidden':this['_conversationContextItems']['has']('current-document'),'documents':_0x3bb58d,'dataIdDocumentSources':new Map(this['_dataIdToSource'])};return this['_addToConversationContextItem'](_0x578902),this['_toggleAddCurrentDocumentOptionVisibility'](),{'contextItem':_0x578902,'hasUnmatched':_0x533e4a};}['_matchDocumentToRoot'](_0x81d7b1,_0x4e9ac9){const _0x5408a2=_0x81d7b1['attributes']?.['channelId'],_0x3a8401=_0x81d7b1['attributes']?.['rootName'];if(_0x5408a2&&_0x3a8401){for(const _0x232291 of _0x4e9ac9)if(_0x232291['config']['get']('collaboration.channelId')===_0x5408a2){for(const _0x2c331a of _0x232291['model']['document']['getRoots']())if('$graveyard'!==_0x2c331a['rootName']&&_0x2c331a['rootName']===_0x3a8401)return{'editor':_0x232291,'rootName':_0x2c331a['rootName']};}}}['_getFirstRoot'](_0x30c7d2){for(const _0x390cfe of _0x30c7d2['model']['document']['getRoots']())if('$graveyard'!==_0x390cfe['rootName'])return{'editor':_0x30c7d2,'rootName':_0x390cfe['rootName']};}async['_createContextItemFromContent'](_0x5fed42){if('document'===_0x5fed42['type']){const _0x1bb21a=await this['_connector']['fetchDocument'](this['_ownerId'],_0x5fed42['id'])['getDocument']();return{'id':'current-document','uiId':'current-document','label':'Current\x20document','type':_0x5fed42['type'],'content':_0x1bb21a['content'],'hidden':this['_conversationContextItems']['has']('current-document'),'version':_0x1bb21a['attributes']?.['version'],'sessionId':_0x1bb21a['attributes']?.['sessionId']};}if('mcp-tool-context'===_0x5fed42['type'])return{'id':_0x5fed42['id'],'uiId':_0x5fed42['id'],'label':_0x5fed42['data']?.['label']||_0x5fed42['id'],'type':'mcp-tool-context','mcpServerName':_0x5fed42['mcpServerName'],'toolName':_0x5fed42['toolName'],'data':_0x5fed42['data']||{}};return{'id':_0x5fed42['id'],'uiId':_0x5fed42['id'],'label':_0x5fed42['attributes']?.['label']||_0x5fed42['name']||_0x5fed42['url']||_0x5fed42['id'],'type':_0x5fed42['type'],..._0x5fed42?.['attributes']?.['resourceId']?{'resourceId':_0x5fed42['attributes']?.['resourceId']}:{}};}['getSentContextItems'](){return new Map(this['_conversationContextItems']);}['removeFromContext'](_0x3a315c){const _0x5adee4=this['_pendingContextItems']['get'](_0x3a315c);_0x5adee4?.['isReadOnly']||this['_removeContextItem'](_0x3a315c);}['clearPendingContextItems'](){if(0x0===this['_pendingContextItems']['size'])return;for(const _0x4d15fd of this['_pendingContextItems']['values']())this['_removeContextItem'](_0x4d15fd['uiId']);const _0x41b88d=this['_conversationContextItems']['get']('current-document')||this['_pendingContextItems']['get']('current-document');_0x41b88d&&this['_addContextItem']({..._0x41b88d,'isReadOnly':!0x0,'hidden':!0x0});}['addToConversationContext'](_0x290e12){for(const _0x425b07 of _0x290e12['values']())this['_addToConversationContextItem'](_0x425b07);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'](_0x3344ef){return Array['from'](_0x3344ef['values']())['flatMap'](_0x1df4d6=>this['_mapContextItemToRequestData'](_0x1df4d6));}async['addFilesToContext'](_0x5a77b9,_0x198194,_0x539b64='file'){const _0x59a486='files-'+ot();this['_startUploadOperation'](_0x59a486);try{await Promise['all'](_0x5a77b9['map'](async _0x5ed6b4=>{const _0x27bee3='file-'+ot(),_0x4c47de=_0x1db613(_0x5ed6b4['name']);try{this['_addContextItem']({'type':_0x539b64,'label':_0x198194?.['label']||_0x4c47de,'uiId':_0x27bee3,'resourceId':_0x198194?.['resourceId']},!0x0);const _0x257b6a=this['_connector']['uploadFile'](this['_ownerId'],_0x5ed6b4,_0x198194);this['_ongoingUploads']['set'](_0x27bee3,_0x257b6a['abortController']);const {id:_0x48731b}=await _0x257b6a['getId']();this['_ongoingUploads']['delete'](_0x27bee3),this['_finishContextItemLoading']({'type':_0x539b64,'id':_0x48731b,'label':_0x198194?.['label']||_0x4c47de,'uiId':_0x27bee3,'resourceId':_0x198194?.['resourceId']},!0x1);}catch(_0x1c0c0a){this['_ongoingUploads']['delete'](_0x27bee3);if(!(_0x1c0c0a instanceof at&&_0x1c0c0a['message']['startsWith']('ai-request-aborted'))){const _0x318019=Ps['get'](_0x1c0c0a['code'])||'ai-chat-file-upload-failed',_0xea138c=new at(_0x318019,null,{'fileName':_0x4c47de,..._0x1c0c0a});_0xea138c['stack']=_0x1c0c0a['stack'],this['fire']('error',{'error':_0xea138c});}this['_removeContextItem'](_0x27bee3);}}));}finally{this['_finishUploadOperation'](_0x59a486);}}['addCurrentDocumentToContext'](_0x3de364){if(this['isCurrentDocumentInContext']()||!this['_addContextOptionsState']['document']['enabled'])return;const _0x6156d3={'type':'document','uiId':'current-document','label':_0x3de364,'isReadOnly':this['_conversationContextItems']['has']('current-document'),'hidden':this['_conversationContextItems']['has']('current-document')};this['_addContextItem'](_0x6156d3);}async['updateCurrentDocument'](_0x190192,_0x418f7e,_0x4a3c8b,_0x3f2abf,_0x496eef,_0x3b164a){const _0x2334bd=this['_pendingContextItems']['get']('current-document');if(_0x2334bd&&_0x190192){_0x2334bd['selection']=_0x3b164a?_0x3b164a['map'](_0x52088f=>({'start':_0x52088f['start'],'end':_0x52088f['end']})):[];try{if(_0x2334bd['version']===_0x418f7e)return;const {id:_0x3f0d56}=await this['_connector']['uploadDocument'](this['_ownerId'],_0x190192,{'version':_0x418f7e,'sessionId':_0x4a3c8b,'channelId':_0x3f2abf,'rootName':_0x496eef})['getId']();_0x2334bd['id']=_0x3f0d56,_0x2334bd['content']=_0x190192,_0x2334bd['version']=_0x418f7e,_0x2334bd['sessionId']=_0x4a3c8b;}catch(_0x573b30){const _0x55cd95=new at('ai-chat-document-upload-failed',null);_0x55cd95['stack']=_0x573b30['stack'],this['fire']('error',{'error':_0x55cd95});}}}async['updateCurrentDocuments'](_0x1d8219){const _0x456a27=this['_pendingContextItems']['get']('current-document');if(!_0x456a27||!_0x1d8219['length']||_0x1d8219['every'](_0x5c2b70=>!_0x5c2b70['content']))return;_0x1d8219['length']>0x1&&_0x1d8219['some'](_0x177b95=>!_0x177b95['description'])&&It('ai-chat-documents-missing-description');const _0x200517=_0x8baeea=>_0x8baeea?_0x8baeea['map'](_0x4791db=>({'start':_0x4791db['start'],'end':_0x4791db['end']})):[],_0x4216f1=_0x456a27['documents']??[];if(_0x4216f1['length']===_0x1d8219['length']&&_0x1d8219['every']((_0x24a390,_0x2985d6)=>_0x4216f1[_0x2985d6]?.['version']===_0x24a390['version']))_0x456a27['documents']=_0x4216f1['map']((_0x51cf9c,_0x263117)=>({..._0x51cf9c,'selection':_0x200517(_0x1d8219[_0x263117]['selections'])}));else try{const _0x22dfe1=await this['_connector']['uploadDocuments'](this['_ownerId'],_0x1d8219)['getIds']();_0x456a27['documents']=_0x1d8219['map']((_0x4c8d50,_0x211c7a)=>({'id':_0x22dfe1[_0x211c7a]?.['id'],'content':_0x4c8d50['content'],'version':_0x4c8d50['version'],'sessionId':_0x4c8d50['sessionId'],'selection':_0x200517(_0x4c8d50['selections'])})),this['_documentSources']['clear'](),this['_dataIdToSource']['clear']();for(let _0x54ae73=0x0;_0x54ae73<_0x1d8219['length'];_0x54ae73++){const _0x2804f1=_0x22dfe1[_0x54ae73]?.['id'],_0x3884e5=_0x1d8219[_0x54ae73];if(!_0x2804f1)continue;const _0xabcd12={'editor':_0x3884e5['editor'],'rootName':_0x3884e5['rootName'],'content':_0x3884e5['content'],'version':_0x3884e5['version'],'name':_0x3884e5['name'],'description':_0x3884e5['description']};this['_documentSources']['set'](_0x2804f1,_0xabcd12);const _0x421c06=_s(_0x3884e5['content']);for(const _0x10e0ab of _0x3200a8(_0x58eb65=>!!Es(_0x58eb65,'data-id'),_0x421c06)){const _0x28a325=Es(_0x10e0ab,'data-id');_0x28a325&&this['_dataIdToSource']['set'](_0x28a325,{..._0xabcd12,'documentId':_0x2804f1});}}_0x456a27['dataIdDocumentSources']=new Map(this['_dataIdToSource']);}catch(_0x249b65){const _0x692335=new at('ai-chat-document-upload-failed',null);_0x692335['stack']=_0x249b65['stack'],this['fire']('error',{'error':_0x692335});}}['addSelectionToContext'](_0x3792b4){this['_addContextItem']({'type':'selection','label':_0x3792b4,'uiId':'selection','content':_0x3792b4});}['removeSelectionFromContext'](){this['_removeContextItem']('selection');}async['addUrlToContext'](_0x34332a,_0x308fc3){const _0x180c18='url-'+ot();this['_startUploadOperation'](_0x180c18);const _0x54bc4f='url-'+ot();try{this['_addContextItem']({'type':'web-resource','label':_0x308fc3?.['label']||_0x34332a,'uiId':_0x54bc4f,'resourceId':_0x308fc3?.['resourceId']},!0x0);const _0x10a16e=this['_connector']['uploadUrl'](this['_ownerId'],_0x34332a,_0x308fc3);this['_ongoingUploads']['set'](_0x54bc4f,_0x10a16e['abortController']);const {id:_0x208385}=await _0x10a16e['getId']();this['_ongoingUploads']['delete'](_0x54bc4f),this['_finishContextItemLoading']({'type':'web-resource','id':_0x208385,'label':_0x308fc3?.['label']||_0x34332a,'uiId':_0x54bc4f,'resourceId':_0x308fc3?.['resourceId']},!0x1);}catch(_0x271bd8){this['_ongoingUploads']['delete'](_0x54bc4f),(_0x271bd8['message']['startsWith']('ai-request-aborted')||this['fire']('error',{'error':new at('ai-chat-url-upload-failed',this,{'url':_0x34332a,'originalError':_0x271bd8}),'url':_0x34332a}),this['_removeContextItem'](_0x54bc4f));}finally{this['_finishUploadOperation'](_0x180c18);}}['addToolItemToContext'](_0x177dfe){_0x177dfe['id']=_0x177dfe['id']??ot()['substring'](0x0,0x15),this['_pendingContextItems']['set'](_0x177dfe['uiId'],_0x177dfe),this['fire']('contextItemAdded',{'contextItem':_0x177dfe,'isLoading':!0x1});}async['loadSourceResources'](_0x4dc451,_0x5ab4f1,_0x581a9e){const _0x13ac28=this['_addContextOptionsState']['sources']['find'](_0x4d34c2=>_0x4d34c2['id']===_0x4dc451);if(!_0x13ac28)return this['fire']('error',{'error':new at('ai-chat-source-not-found',this,{'sourceId':_0x4dc451}),'sourceId':_0x4dc451}),[];try{const _0x357a86=(await _0x13ac28['getResources'](_0x5ab4f1))['map'](_0x5d37de=>{const _0x2ba9ad=this['_isResourceInContext'](_0x5d37de['id']);return{..._0x5d37de,'isInContext':_0x2ba9ad};});return _0x13ac28['resources']=_0x357a86,this['fire']('sourceResourcesLoaded',{'sourceId':_0x4dc451,'source':_0x13ac28,'resources':_0x357a86,'uid':_0x581a9e}),_0x357a86;}catch(_0xa92850){return this['fire']('error',{'error':new at('ai-chat-source-resources-load-failed',this,{'sourceId':_0x4dc451,'originalError':_0xa92850}),'sourceId':_0x4dc451,'sourceLabel':_0x13ac28['label']}),[];}}async['addResourceToContext'](_0x1fff1a,_0xfdce59){if(this['_isResourceInContext'](_0xfdce59['id']))return;let _0xacd526=_0xfdce59['data'];if(!_0xacd526&&_0x1fff1a['getData'])try{_0xacd526=await _0x1fff1a['getData'](_0xfdce59['id']);}catch(_0x3a560a){return void this['fire']('error',{'error':new at('ai-chat-resource-load-failed',this,{'resourceId':_0xfdce59['id'],'sourceId':_0x1fff1a['id'],'originalError':_0x3a560a}),'resourceId':_0xfdce59['id'],'sourceId':_0x1fff1a['id']});}if(_0xacd526)switch(_0xfdce59['type']){case'web-resource':if('string'!=typeof _0xacd526)return void this['fire']('error',{'error':new at('ai-chat-context-invalid-data',this,{'resourceId':_0xfdce59['id'],'sourceId':_0x1fff1a['id'],'expectedType':'string','actualType':typeof _0xacd526}),'resourceId':_0xfdce59['id'],'sourceId':_0x1fff1a['id']});await this['addUrlToContext'](_0xacd526,{'label':_0xfdce59['label'],'resourceId':_0xfdce59['id']});break;case'file':if(!(_0xacd526 instanceof File))return void this['fire']('error',{'error':new at('ai-chat-context-invalid-data',this,{'resourceId':_0xfdce59['id'],'sourceId':_0x1fff1a['id'],'expectedType':'File','actualType':typeof _0xacd526}),'resourceId':_0xfdce59['id'],'sourceId':_0x1fff1a['id']});await this['addFilesToContext']([_0xacd526],{'label':_0xfdce59['label'],'resourceId':_0xfdce59['id']});break;case'text':if('object'!=typeof _0xacd526||!('content'in _0xacd526)||!('type'in _0xacd526))return void this['fire']('error',{'error':new at('ai-chat-context-invalid-data',this,{'resourceId':_0xfdce59['id'],'sourceId':_0x1fff1a['id'],'expectedType':'object\x20with\x20content\x20and\x20type\x20properties','actualType':typeof _0xacd526}),'resourceId':_0xfdce59['id'],'sourceId':_0x1fff1a['id']});_0xacd526=Ms['_convertTextResourceToFile'](_0xacd526,_0xfdce59['label']),await this['addFilesToContext']([_0xacd526],{'label':_0xfdce59['label'],'resourceId':_0xfdce59['id']},'text');break;case'mcp-tool-context':break;default:this['fire']('error',{'error':new at('ai-chat-context-unsupported-type',this,{'resourceId':_0xfdce59['id'],'sourceId':_0x1fff1a['id'],'resourceType':_0xfdce59['type']}),'resourceId':_0xfdce59['id'],'sourceId':_0x1fff1a['id']});}else this['fire']('error',{'error':new at('ai-chat-resource-no-data',this,{'resourceId':_0xfdce59['id'],'sourceId':_0x1fff1a['id']}),'resourceId':_0xfdce59['id'],'sourceId':_0x1fff1a['id']});}static['_convertTextResourceToFile'](_0x2361ae,_0x59ef7d){switch(_0x2361ae['type']){case'markdown':return new File([_0x2361ae['content']],_0x59ef7d,{'type':'text/markdown'});case'html':return new File([_0x2361ae['content']],_0x59ef7d,{'type':'text/html'});default:return new File([_0x2361ae['content']],_0x59ef7d,{'type':'text/plain'});}}static['_mapContextItemToRequestData'](_0x4e275e){switch(_0x4e275e['type']){case'file':case'text':return[{'type':'file','id':_0x4e275e['id']}];case'web-resource':return[{'type':'web-resource','id':_0x4e275e['id']}];case'document':return _0x4e275e['documents']?.['length']?_0x4e275e['documents']['map'](_0x13f326=>({'type':'document','id':_0x13f326['id'],..._0x13f326['selection']?.['length']&&{'selection':_0x13f326['selection']}})):[{'type':'document','id':_0x4e275e['id'],..._0x4e275e['selection']?.['length']&&{'selection':_0x4e275e['selection']}}];case'mcp-tool-context':{const _0x31a079=_0x4e275e;return[{'type':'mcp-tool-context','mcpServerName':_0x31a079['mcpServerName'],'toolName':_0x31a079['toolName'],'data':{..._0x31a079['data'],'label':_0x31a079['label']||_0x31a079['data']?.['label']||_0x31a079['id']},'id':_0x31a079['id']}];}default:return[];}}['_addContextItem'](_0x24649a,_0x101d61=!0x1){if(this['_pendingContextItems']['set'](_0x24649a['uiId'],_0x24649a),_0x24649a['hidden']||this['fire']('contextItemAdded',{'contextItem':_0x24649a,'isLoading':_0x101d61}),'current-document'===_0x24649a['uiId']&&this['_toggleAddCurrentDocumentOptionVisibility'](),_0x24649a['resourceId']){const _0xa3f84a=this['_findSourceIdsByResourceId'](_0x24649a['resourceId']);_0xa3f84a&&_0xa3f84a['forEach'](_0x34e5ac=>{this['_updateResourceInContextState'](_0x34e5ac,_0x24649a['resourceId'],!0x0);});}}['_removeContextItem'](_0x646525){const _0x4cb575=this['_pendingContextItems']['get'](_0x646525),_0x872d92=this['_ongoingUploads']['get'](_0x646525);if(_0x872d92&&(_0x872d92['abort'](),this['_ongoingUploads']['delete'](_0x646525)),_0x4cb575?.['resourceId']){const _0x10826c=this['_findSourceIdsByResourceId'](_0x4cb575['resourceId']);_0x10826c&&_0x10826c['forEach'](_0x20342e=>{this['_updateResourceInContextState'](_0x20342e,_0x4cb575['resourceId'],!0x1);});}this['_pendingContextItems']['delete'](_0x646525),this['fire']('contextItemRemoved',{'uiId':_0x646525,'type':_0x4cb575?.['type']}),'current-document'===_0x646525&&this['_toggleAddCurrentDocumentOptionVisibility']();}['_finishContextItemLoading'](_0x1f45ab,_0x44302a){if(this['_pendingContextItems']['has'](_0x1f45ab['uiId'])&&(this['_pendingContextItems']['set'](_0x1f45ab['uiId'],_0x1f45ab),this['fire']('contextItemLoadingEnded',{'contextItem':_0x1f45ab,'isLoading':_0x44302a}),_0x1f45ab['resourceId'])){const _0x280447=this['_findSourceIdsByResourceId'](_0x1f45ab['resourceId']);_0x280447&&_0x280447['forEach'](_0x3af9c8=>{this['_updateResourceInContextState'](_0x3af9c8,_0x1f45ab['resourceId'],!0x0);});}}['_addToConversationContextItem'](_0x27065a){this['_conversationContextItems']['set'](_0x27065a['uiId'],_0x27065a);}['_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'](_0x498293=>({..._0x498293,'enabled':!0x0}))??[]},this['fire']('addContextOptionsChanged',{'options':this['_addContextOptionsState']});}['_getCustomSourcesInitialState'](){return this['_config']?.['sources']?.['map'](_0x3f8636=>({..._0x3f8636,'resources':[]}))??[];}['_toggleAddCurrentDocumentOptionVisibility'](){const _0x1ccc69=this['isCurrentDocumentInContext']()||this['isCurrentDocumentInConversation']();this['_addContextOptionsState']['document']['isHidden']=_0x1ccc69,this['fire']('addContextOptionsChanged',{'options':this['_addContextOptionsState']});}['_isResourceInContext'](_0x1ca0a1){for(const _0x25483f of this['_pendingContextItems']['values']())if(_0x25483f['resourceId']===_0x1ca0a1)return!0x0;for(const _0x5922be of this['_conversationContextItems']['values']())if(_0x5922be['resourceId']===_0x1ca0a1)return!0x0;return!0x1;}['_findSourceIdsByResourceId'](_0xb640ac){const _0x477559=[];for(const _0x322c83 of this['_addContextOptionsState']['sources']){_0x322c83['resources']['find'](_0x3d49d6=>_0x3d49d6['id']===_0xb640ac)&&_0x477559['push'](_0x322c83['id']);}return 0x0===_0x477559['length']?null:_0x477559;}['_updateResourceInContextState'](_0x41558b,_0x444df1,_0x212bbe){const _0x29e227=this['_addContextOptionsState']['sources']['find'](_0x193c2d=>_0x193c2d['id']===_0x41558b);if(!_0x29e227)return;const _0x39e8d4=_0x29e227['resources']['find'](_0x21991f=>_0x21991f['id']===_0x444df1);_0x39e8d4&&(_0x39e8d4['isInContext']=_0x212bbe,this['fire']('resourceStateChanged',{'sourceId':_0x41558b,'resourceId':_0x444df1,'isInContext':_0x212bbe}));}['_startUploadOperation'](_0x415396){this['_ongoingUploadOperations']['set'](_0x415396,!0x0),this['_ongoingUploadOperations']['size']&&this['fire']('uploadProgressChanged',{'isUploadInProgress':!0x0});}['_finishUploadOperation'](_0x22ee19){this['_ongoingUploadOperations']['delete'](_0x22ee19),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'](_0x2254a5){const _0x5a02f3={};return _0x2254a5&&_0x2254a5['isWebSearchEnabled']&&(_0x5a02f3['webSearch']={}),_0x2254a5&&_0x2254a5['isReasoningEnabled']&&(_0x5a02f3['reasoning']={}),_0x5a02f3;}['toggleWebSearch'](){this['setWebSearch'](!this['_isWebSearchEnabled']);}['toggleReasoning'](){this['setReasoning'](!this['_isReasoningEnabled']);}['setWebSearch'](_0xaee7db){_0xaee7db!==this['_isWebSearchEnabled']&&(this['_isWebSearchEnabled']=_0xaee7db,this['fire']('capabilitiesUpdated',this['getCapabilitiesConfig']()));}['setReasoning'](_0x40eca4){_0x40eca4!==this['_isReasoningEnabled']&&(this['_isReasoningEnabled']=_0x40eca4,this['fire']('capabilitiesUpdated',this['getCapabilitiesConfig']()));}}class Bs extends Ds{['userMessage'];['conversationId'];['contextItems']=new Map();['capabilities'];['model'];['attributes'];constructor(_0x45cc24){super(_0x45cc24),this['conversationId']=_0x45cc24['conversationId'],this['contextItems']=_0x45cc24['contextItems'],this['capabilities']=_0x45cc24['capabilities'],this['userMessage']=_0x45cc24['userMessage'],this['model']=_0x45cc24['model'],this['attributes']=_0x45cc24['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'](_0x22c9a5){const _0x384eff=this['getDocumentContext']();if(_0x384eff?.['documents']?.['length']){const _0x137d8c=_0x384eff['documents']['map'](_0x26182f=>_0x26182f['content']??'')['join']('');if(_0x137d8c)return super['createReply']({'documentContextContent':_0x137d8c,..._0x22c9a5});}return super['createReply'](_0x22c9a5);}}class Gs extends Tt(){['id'];['isStarted']=!0x1;['isFromHistory'];['interactions']=[];['currentInteraction'];['selectedModel'];['connector'];['options'];constructor(_0x55ee2b){super(),this['options']=_0x55ee2b,this['connector']=_0x55ee2b['connector'],this['chatModels']=_0x55ee2b['chatModels'],this['id']=_0x55ee2b['conversationId'],this['isFromHistory']=_0x55ee2b['isFromHistory'];}async['init'](_0x4fe171){try{this['chatContext']=new Ms({'connector':this['connector'],'config':_0x4fe171,'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 _0x7c2870=await this['chatModels']['getAvailableModels']();this['fire']('conversationInitialized',{'availableModels':_0x7c2870});const _0x3c7064=await this['chatModels']['getModel'](this['options']['selectedModelId']);_0x3c7064&&await this['setModel'](_0x3c7064);}catch(_0x20cf6e){const _0x4fbaa1=new at('ai-chat-conversation-init-failed',null,{'message':_0x20cf6e['message']||_0x20cf6e});_0x4fbaa1['stack']=_0x20cf6e['stack'],this['fire']('error',{'error':_0x4fbaa1});}}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:_0xea0aeb}=await this['connector']['startConversation'](this['id'],this['options']['group'])['getConversation']();this['id']=_0xea0aeb,this['isStarted']=!0x0,this['fire']('conversationStarted',{'conversationId':this['id'],'selectedModel':this['selectedModel']});}catch(_0x1c736f){const _0x5a2ad=new at('ai-chat-conversation-start-failed',null,{'message':_0x1c736f['message'],'conversationId':this['id']});throw _0x5a2ad['stack']=_0x1c736f['stack'],this['fire']('error',{'error':_0x5a2ad}),_0x5a2ad;}}async['load'](_0x93607b,_0x49eb91){try{const _0x1f3868=await this['connector']['fetchConversation'](_0x93607b)['getConversation'](),_0x3bc0fe=await this['connector']['fetchConversationMessages'](_0x93607b)['getMessages'](),_0x5d78aa=_0x3bc0fe[0x0]['model'];this['isStarted']=!0x0,this['id']=_0x1f3868['id'],'title'in _0x1f3868?this['fire']('setConversationTitle',_0x1f3868['title'],!0x0):this['fire']('setConversationTitle','',!0x0);const _0x21e6ec=(await this['chatModels']['getAll']())['find'](_0x208b1a=>_0x208b1a['id']['toLowerCase']()===_0x5d78aa['toLowerCase']());return this['selectedModel']=_0x21e6ec,this['fire']('modelSelected',{'selectedModel':_0x21e6ec,'isDisabled':!0x0}),await this['_processMessagesToInteractions'](_0x3bc0fe,_0x49eb91,_0x5d78aa),this['currentInteraction']=void 0x0,this;}catch(_0x4b76af){const _0x4a4f3b=new at('ai-chat-conversation-init-from-id-failed',null,{'message':_0x4b76af['message'],'conversationId':_0x93607b});throw _0x4a4f3b['stack']=_0x4b76af['stack'],this['fire']('error',{'error':_0x4a4f3b}),_0x4a4f3b;}}async['_processMessagesToInteractions'](_0x1f705c,_0x3e0e8d,_0x3b0dc7){let _0x2908cc,_0x42ea49=!0x1;for(const _0x54bbfd of _0x1f705c)if('user'===_0x54bbfd['role']){const {contextItems:_0x953a98,hasUnmatched:_0x3505a4}=await this['_extractContextItems'](_0x54bbfd);_0x42ea49=_0x3505a4;const _0x1b6133={'isReasoningEnabled':Object['hasOwn'](_0x54bbfd['capabilities'],'reasoning'),'isWebSearchEnabled':Object['hasOwn'](_0x54bbfd['capabilities'],'webSearch')};_0x2908cc=this['createInteraction']({'userMessage':_0x54bbfd['prompt'],'contextItems':_0x953a98,'capabilities':_0x1b6133,'modelId':_0x3b0dc7,'attributes':_0x54bbfd['attributes']}),this['currentInteraction']=_0x2908cc,this['chatContext']['addToConversationContext'](this['currentInteraction']['contextItems']);}else{if('assistant'===_0x54bbfd['role']&&_0x2908cc){const _0x52f804=[];for(const _0x496839 of _0x54bbfd['content'])switch(_0x496839['type']){case'text':case'modification':{const _0x4608b0=_0x2908cc['getDocumentContext'](),_0x40e1c3=(_0x4608b0?.['documents']?.['length']?_0x4608b0['documents']['some'](_0x503ba1=>_0x503ba1['sessionId']!==_0x3e0e8d):_0x4608b0?.['sessionId']!==_0x3e0e8d)||_0x42ea49;_0x2908cc['currentReply']?.['type']!==_0x496839['type']&&(_0x2908cc['currentReply']=_0x2908cc['createReply']({'type':_0x496839['type'],'isDone':!0x0,'interactionId':_0x2908cc['id'],'areActionsDisabled':_0x40e1c3,'isFromHistory':!0x0}),_0x52f804['length']>0x0&&(_0x2908cc['currentReply']['sources']=_0x52f804['splice'](0x0))),_0x2908cc['currentReply']['appendContent'](_0x496839['content']);break;}case'url':_0x52f804['push'](_0x496839);break;case'mcp-tool-result':{const {data:_0xce2f71,attributes:_0x4a6dbc}=JSON['parse'](_0x496839['content']);_0x2908cc['_handleToolResultData']({'toolName':_0x496839['toolName'],'data':_0xce2f71,'attributes':_0x4a6dbc});break;}}}}}async['_extractContextItems'](_0x41a444){const _0x1dad56=new Map();if(!_0x41a444['content'])return{'contextItems':_0x1dad56,'hasUnmatched':!0x1};const _0x37a680=this['_resolveEditors'](),{contextItem:_0x379ecb,hasUnmatched:_0x5e16a3}=await this['chatContext']['populateDocumentsFromMessage'](_0x41a444['content'],_0x37a680);_0x379ecb&&_0x1dad56['set'](_0x379ecb['id'],_0x379ecb);for(const _0x10d569 of _0x41a444['content']){if('document'===_0x10d569['type'])continue;const _0x142f2e=await this['chatContext']['populateFromMessage'](_0x10d569);_0x142f2e&&_0x1dad56['set'](_0x142f2e['id'],_0x142f2e);}return{'contextItems':_0x1dad56,'hasUnmatched':_0x5e16a3};}['_resolveEditors'](){return this['options']['getEditors']?this['options']['getEditors']():this['options']['getEditor']?[this['options']['getEditor']()]:[];}async['handleUserInteraction']({userMessage:_0xe58b28,attributes:_0x437cfa}){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 _0x20a2be=this['chatContext']['getPendingContextItems'](),_0x3e6472=this['chatCapabilities']['getCapabilitiesConfig'](),_0x468a2b=this['selectedModel']['id'];this['currentInteraction']=this['createInteraction']({'userMessage':_0xe58b28,'contextItems':_0x20a2be,'capabilities':_0x3e6472,'modelId':_0x468a2b,'attributes':_0x437cfa}),await this['currentInteraction']['start'](),this['chatContext']['addToConversationContext'](this['currentInteraction']['contextItems']);}catch(_0x3f71cc){if(_0x3f71cc instanceof at)this['fire']('error',{'interactionId':this['currentInteraction']?this['currentInteraction']['id']:void 0x0,'error':_0x3f71cc});else{const _0x23049c=Ps['get'](_0x3f71cc['code'])||'ai-chat-handle-user-interaction-start-failed';this['fire']('error',{'interactionId':this['currentInteraction']?this['currentInteraction']['id']:void 0x0,'error':new at(_0x23049c,null,{'error':_0x3f71cc})});}}finally{this['currentInteraction']?.['stop'](),this['currentInteraction']=void 0x0;}}['createInteraction']({userMessage:_0x834755,contextItems:_0x3206d0,capabilities:_0x3ddb86,modelId:_0x20f57e,attributes:_0x263568}){const _0x2309a9=new Bs({'userMessage':_0x834755,'contextItems':_0x3206d0,'capabilities':_0x3ddb86,'conversationId':this['id'],'connector':this['connector'],'locale':this['options']['locale'],'model':_0x20f57e,'attributes':_0x263568});return _0x2309a9['delegate'](...Ls)['to'](this),this['interactions']['push'](_0x2309a9),this['fire']('interactionCreated',_0x2309a9),_0x2309a9;}['getInteraction'](_0x595fe0){return this['interactions']['find'](_0x1b8a7d=>_0x1b8a7d['id']===_0x595fe0);}['removeInteraction'](_0x41165f){const _0x389b53=this['getInteraction'](_0x41165f);_0x389b53&&(_0x389b53['destroy'](),this['interactions']['splice'](this['interactions']['indexOf'](_0x389b53),0x1));}get['lastInteraction'](){return this['interactions'][this['interactions']['length']-0x1];}['addCurrentDocumentToContext'](_0xbcf22d){this['chatContext']['addCurrentDocumentToContext'](_0xbcf22d);}async['updateCurrentDocumentInContext']({content:_0x422a16,version:_0x444f8c,sessionId:_0x3cf9fa,channelId:_0x161455,rootName:_0x481ca4,selections:_0x361431}){await this['chatContext']['updateCurrentDocument'](_0x422a16,_0x444f8c,_0x3cf9fa,_0x161455,_0x481ca4,_0x361431);}async['updateCurrentDocumentsInContext'](_0x334391){await this['chatContext']['updateCurrentDocuments'](_0x334391);}['getSourceByDataId'](_0x59ee2d){return this['chatContext']['getSourceByDataId'](_0x59ee2d);}['getDocumentContextSliceByDataId'](_0xc0b2b){return this['chatContext']['getDocumentContextSliceByDataId'](_0xc0b2b);}['getCurrentDocumentContext'](){return this['currentInteraction']?.['getDocumentContext']()?.['content']||'';}['addSelectionToContext'](_0x444df7){this['chatContext']['addSelectionToContext'](_0x444df7);}['removeSelectionFromContext'](){this['chatContext']['removeSelectionFromContext']();}['addFilesToContext'](_0x404034){this['chatContext']['addFilesToContext'](_0x404034);}['addUrlToContext'](_0x337e79){this['chatContext']['addUrlToContext'](_0x337e79);}['addToolItemToContext'](_0x3262a5){this['chatContext']['addToolItemToContext'](_0x3262a5);}['addResourceToContext'](_0x26b571,_0x24cd78){this['chatContext']['addResourceToContext'](_0x26b571,_0x24cd78);}['loadSourceResources'](_0x4a6253,_0x1ae108,_0x1f70b4){return this['chatContext']['loadSourceResources'](_0x4a6253,_0x1ae108,_0x1f70b4);}['removeFromContext'](_0x1a60cf){this['chatContext']['removeFromContext'](_0x1a60cf);}['setWebSearch'](_0xa27f95){this['chatCapabilities']['setWebSearch'](_0xa27f95);}['toggleWebSearch'](){this['chatCapabilities']['toggleWebSearch']();}['setReasoning'](_0x3e4750){this['chatCapabilities']['setReasoning'](_0x3e4750);}['toggleReasoning'](){this['chatCapabilities']['toggleReasoning']();}['isCurrentDocumentInContext'](){return this['chatContext']['isCurrentDocumentInContext']();}['isCurrentDocumentInConversation'](){return this['chatContext']['isCurrentDocumentInConversation']();}['isSelectionInContext'](){return this['chatContext']['isSelectionInContext']();}async['setModel'](_0x40b3d8){_0x40b3d8?!0x1===await this['chatModels']['isAvailable'](_0x40b3d8)&&(It('ai-chat-conversation-set-model-not-available',{'conversation':this,'model':_0x40b3d8}),_0x40b3d8=(await this['chatModels']['getAvailableModels']())[0x0]):(It('ai-chat-conversation-set-model-null',{'conversation':this}),_0x40b3d8=(await this['chatModels']['getAvailableModels']())[0x0]),_0x40b3d8['id']!==this['selectedModel']?.['id']&&(this['selectedModel']=_0x40b3d8,this['chatCapabilities']['reset'](),this['fire']('modelSelected',{'selectedModel':_0x40b3d8}));}}class Fs extends Tt(){['_connector'];['_config'];['_locale'];['_modelList']=[];['_modelsRequest']=null;constructor({connector:_0x42705f,config:_0x56b817,locale:_0x59fe12}){super(),this['_connector']=_0x42705f,this['_config']=_0x56b817,this['_locale']=_0x59fe12;}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 _0x3a8288=await this['getAll']();let _0x2b0532;return _0x2b0532=this['_availableModels']?this['_filterModels'](_0x3a8288,this['_availableModels']):_0x3a8288['filter'](_0x57fac6=>_0x57fac6['recommended']),_0x2b0532;}async['getModel'](_0x8c84a9){const _0x1111aa=await this['getAll']();if(!_0x1111aa['length'])return null;if(_0x8c84a9){const _0x372a23=this['_getModelById'](_0x1111aa,_0x8c84a9);if(_0x372a23)return _0x372a23;It('ai-chat-model-id-unrecognized',{'modelId':_0x8c84a9,'fallBackModelId':this['_defaultModelId']});}return this['getDefault']();}async['getDefault'](){const _0x4cfb86=await this['getAvailableModels']();if(!_0x4cfb86['length'])return null;if(this['_defaultModelId']){const _0x5c28f7=this['_getModelById'](_0x4cfb86,this['_defaultModelId']);if(_0x5c28f7)return _0x5c28f7;It('ai-chat-default-model-id-unrecognized',{'defaultModelId':this['_defaultModelId'],'fallBackModelId':_0x4cfb86[0x0]['id']});}return _0x4cfb86[0x0];}async['isAvailable'](_0x539ade){return(await this['getAvailableModels']())['some'](_0x36bad7=>_0x36bad7['name']===_0x539ade['name']&&_0x36bad7['provider']===_0x539ade['provider']);}async['_retrieveModels'](){if(!this['_modelList']['length'])try{const _0x5b7250=this['_locale']['uiLanguage']||'en',_0x4bd3be=this['_connector']['getModels'](_0x5b7250),_0x71c345=await _0x4bd3be['list']();this['_modelList']=_0x71c345['items']['map'](_0x19da6d=>Ks(_0x19da6d)?{..._0x19da6d,'name':hs(this['_locale'],'AI_MODEL_NAME_AUTO')}:_0x19da6d);}catch(_0x2dc76c){throw Et('ai-models-unable-to-retrieve',{'error':_0x2dc76c}),_0x2dc76c;}return[...this['_modelList']];}['_filterModels'](_0x344cd6,_0xcee6da){let _0x852a9e;if(_0xcee6da){_0x852a9e=[];const _0x1c8161=new Set(),_0x5f0ff9='string'==typeof _0xcee6da?[_0xcee6da['toLocaleLowerCase']()]:_0xcee6da['map'](_0x22c623=>_0x22c623['toLocaleLowerCase']());for(const _0x28d782 of _0x5f0ff9)for(const _0x6f72d2 of _0x344cd6)!_0x1c8161['has'](_0x6f72d2['id'])&&this['_isMatchingFilter'](_0x6f72d2,_0x28d782)&&(_0x852a9e['push'](_0x6f72d2),_0x1c8161['add'](_0x6f72d2['id']));}else _0x852a9e=_0x344cd6;return _0x852a9e;}['_isMatchingFilter'](_0x3d5a34,_0x1f9baf){const _0x3e105f=_0x3d5a34['id']['toLocaleLowerCase'](),_0x669e59=_0x3d5a34['name']['toLocaleLowerCase'](),_0x4b4ac8=_0x3d5a34['provider']['toLocaleLowerCase']();return _0x3e105f===_0x1f9baf||_0x669e59===_0x1f9baf||Ks(_0x3d5a34)&&'auto'===_0x1f9baf||_0x4b4ac8===_0x1f9baf||_0x3e105f['startsWith'](_0x1f9baf);}['_getModelById'](_0x2ff7de,_0x21f68c){return _0x2ff7de['find'](_0x48453a=>Ks(_0x48453a)&&'auto'===_0x21f68c?_0x48453a:_0x48453a['id']===_0x21f68c)||null;}}function Ks(_0x513fe0){return _0x513fe0['id']['startsWith']('agent');}function Ws(_0x52e514){return _0x52e514?_0x52e514 instanceof _0x52dd99?[_0x52e514]:_0x52e514['editors']&&0x0!==_0x52e514['editors']['length']?Array['from'](_0x52e514['editors']):[]:[];}function Ys(_0x4e2509){const _0x338b61=Ws(_0x4e2509);if(!_0x338b61['length'])throw new at('ai-get-editor-from-context-no-editor');if(0x1===_0x338b61['length'])return _0x338b61[0x0];const _0x265661=_0x338b61['find'](_0x4196a9=>_0x4196a9['ui']?.['focusTracker']?.['isFocused']);if(_0x265661)return _0x265661;const _0x299921=function(_0xd8d323){if(_0xd8d323 instanceof _0x52dd99)return;const _0x18b3a7=_0xd8d323;if(!_0x18b3a7['plugins']||!_0x18b3a7['plugins']['has']('AIEditing'))return;const _0x5b2cb5=_0x18b3a7['plugins']['get']('AIEditing');return _0x5b2cb5['getLastContentFocusedEditor']?.();}(_0x4e2509);return _0x299921&&_0x338b61['includes'](_0x299921)?_0x299921:_0x338b61[0x0];}function $s(_0x14c832){return Ys(_0x14c832);}function qs({editor:_0x79b338,interaction:_0x2b0b9b,reply:_0x1f7774,groups:_0x1e3c3e,transform:_0x3f0219,documentCompare:_0x2649eb,documentCompareOptions:_0x2668be,documentContextSlice:_0x53d401}){const _0x21f615=_0x2b0b9b['getDocumentContext']();if(!_0x21f615)return[];const _0x5ef2ee=_0x1f7774['documentContextContent']['cloneNode'](!0x0);for(const {changes:_0x1e3054}of _0x1e3c3e){const _0x5de0ef=_0x1e3054['filter'](_0x7cddc7=>'new'!=_0x7cddc7['type'])['map'](_0x2cb153=>As('data-id',_0x2cb153['id'],_0x5ef2ee)),_0x868ae2=_0x1e3054['filter'](_0x4d14b2=>'removed'!=_0x4d14b2['type'])['map'](_0x336ec9=>_0x336ec9['node']['cloneNode'](!0x0));let _0x4b8e3d=null;if(_0x5de0ef['length']){_0x4b8e3d=_0x5de0ef[0x0]['previousSibling'];for(let _0x2efc89=0x0;_0x2efc89<_0x5de0ef['length'];_0x2efc89++)_0x4da48a(_0x5de0ef[_0x2efc89]);}if(_0x868ae2['length']){_0x4b8e3d||(_0x1e3054[0x0]['anchorId']?_0x4b8e3d=As('data-id',_0x1e3054[0x0]['anchorId'],_0x5ef2ee):(_0x4b8e3d=_0x868ae2['shift'](),_0x1b368b(_0x5ef2ee,_0x4b8e3d)));for(let _0x3e391b=0x0;_0x3e391b<_0x868ae2['length'];_0x3e391b++)_0x2260c6(_0x4b8e3d,_0x868ae2[_0x3e391b]),_0x4b8e3d=_0x868ae2[_0x3e391b];}}let _0x342544,_0x485175,_0x410191,_0x39896a=_0x2668be;if(_0x53d401){_0x342544=_0x53d401['html'],_0x410191=_0x53d401['version'],_0x39896a={..._0x2668be,'anchor':_0x53d401['rootName']};const _0x47c711=new _0x19e721([]),_0x4a1fa8=_0x5ef2ee['children'],_0x44df11=_0x1f7774['dataIdDocumentSources'],_0x198403=_0x1f7774['newNodeAnchorIds'],_0x501ec0=_0x53d401['editor'],_0x13e7d7=_0x53d401['rootName'],_0x34291d=new Array(_0x4a1fa8['length']),_0x519f06=_0x168eac=>_0x168eac?_0x168eac['editor']===_0x501ec0&&_0x168eac['rootName']===_0x13e7d7:void 0x0;for(let _0x35890f=0x0;_0x35890f<_0x4a1fa8['length'];_0x35890f++){const _0x514dea=Es(_0x4a1fa8[_0x35890f],'data-id');if(!_0x514dea)continue;const _0x303e97=_0x519f06(_0x44df11?.['get'](_0x514dea));if(void 0x0!==_0x303e97){_0x34291d[_0x35890f]=_0x303e97;continue;}const _0x242d2e=_0x198403['get'](_0x514dea),_0x36a8a9=_0x242d2e?_0x519f06(_0x44df11?.['get'](_0x242d2e)):void 0x0;void 0x0!==_0x36a8a9&&(_0x34291d[_0x35890f]=_0x36a8a9);}for(let _0x1b614b=0x0;_0x1b614b<_0x4a1fa8['length'];_0x1b614b++)if(void 0x0===_0x34291d[_0x1b614b]){for(let _0x58c919=_0x1b614b-0x1;_0x58c919>=0x0;_0x58c919--)if(void 0x0!==_0x34291d[_0x58c919]){_0x34291d[_0x1b614b]=_0x34291d[_0x58c919];break;}if(void 0x0===_0x34291d[_0x1b614b]){for(let _0x1350c7=_0x1b614b+0x1;_0x1350c7<_0x4a1fa8['length'];_0x1350c7++)if(void 0x0!==_0x34291d[_0x1350c7]){_0x34291d[_0x1b614b]=_0x34291d[_0x1350c7];break;}}}for(let _0x27932d=0x0;_0x27932d<_0x4a1fa8['length'];_0x27932d++)_0x34291d[_0x27932d]&&_0x47c711['children']['push'](_0x29aa2a(_0x4a1fa8[_0x27932d],!0x0));_0x485175=gs(_0x47c711);}else _0x342544=_0x21f615['content'],_0x410191=_0x21f615['version'],_0x485175=gs(_0x5ef2ee);const _0x8fd8e7=_0x2649eb['getDiff'](_0x342544,_0x485175,{..._0x39896a,'targetEditor':_0x79b338})['getOperations']();if(_0x3f0219){const _0x5e0a28=_0x79b338['model']['document']['history']['getOperations'](_0x410191),_0x5e4380={'document':_0x79b338['model']['document'],'useRelations':!0x1,'padWithNoOps':!0x1};return _0x84a22e(_0x8fd8e7,_0x5e0a28,_0x5e4380)['operationsA'];}return _0x8fd8e7;}function Qs(_0x5a6dae,_0x4c96c6){if('marker'!=_0x4c96c6['type'])return;const _0x596e56=_0x5a6dae['model']['markers']['get'](_0x4c96c6['name']);_0x596e56&&(_0x4c96c6['oldRange']=_0x596e56['getRange']());}class Xs extends _0x490ade{['activeConversation'];['_aiEditing'];['_aiConnector'];['_aiChatUi'];['_aiChatModels'];['_aiChatBalloon'];['_activeBalloon'];['_wiredBalloons']=new Set();['_batchToChanges']=new Map();['_currentPreviewedChangeGroup']=null;['_bodyCollection'];static get['requires'](){return[as,_0x566822];}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 _0x48798d=this['context']['plugins']['get']('AITabs');this['listenTo'](this['_aiChatUi'],'startConversation',()=>{this['_startConversationSafely']();}),this['listenTo'](this['_aiChatUi'],'sendUserMessage',(_0x3c37b2,_0x1bc0cd)=>{this['_handleUIUserMessage']({'message':_0x1bc0cd});}),this['listenTo'](_0x48798d['view'],'change:activeTab',(_0x3e10e5,_0xd76ce8,_0x16b8f1)=>{'chat'!==_0x16b8f1&&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',(_0x7b3860,_0x590a2d)=>{this['activeConversation']?.['addFilesToContext'](Array['from'](_0x590a2d));}),this['listenTo'](this['_aiChatUi'],'addUrlToContext',(_0x152f08,_0x4fe8e1)=>{this['activeConversation']?.['addUrlToContext'](_0x4fe8e1);}),this['listenTo'](this['_aiChatUi'],'executeCustomItemCallback',(_0x5f3bf0,_0x315141)=>{_0x315141['callback'](this['context']);}),this['listenTo'](this['_aiChatUi'],'addResourceToContext',(_0x5e57ed,_0x3c1301)=>{this['activeConversation']?.['addResourceToContext'](_0x3c1301['source'],_0x3c1301['resource']);}),this['listenTo'](this['_aiChatUi'],'removeContextItem',(_0x20b24f,_0x1ec623)=>{this['_removeFromContext'](_0x1ec623);}),this['listenTo'](this['_aiChatUi'],'loadSourceResources',(_0x29ec55,_0x114a3b)=>{this['activeConversation']?.['loadSourceResources'](_0x114a3b['sourceId'],_0x114a3b['query'],_0x114a3b['uid']);}),this['listenTo'](this['_aiChatUi'],'toggleWebSearch',()=>{this['_toggleWebSearch']();}),this['listenTo'](this['_aiChatUi'],'toggleReasoning',()=>{this['_toggleReasoning']();}),this['listenTo'](this['_aiChatUi'],'selectModel',(_0x339f08,_0x501d5b)=>{this['activeConversation']?.['setModel'](_0x501d5b);}),this['listenTo'](this['_aiChatUi'],'like',(_0x48e388,{replyId:_0x5ebd2d})=>{console['log']('Liked\x20response',_0x5ebd2d);}),this['listenTo'](this['_aiChatUi'],'dislike',(_0x4c691f,{replyId:_0x2972ed})=>{console['log']('Disliked\x20response',_0x2972ed);}),this['listenTo'](this['_aiChatUi'],'insertSuggestion',(_0x32ab6c,_0x47a891)=>{this['_insertSuggestion'](_0x47a891);}),this['listenTo'](this['_aiChatUi'],'showChangeInText',(_0x1f31cc,{replyId:_0x1d0301,partIndex:_0x39f489})=>{this['_aiChatBalloonShowDiff']=this['_aiChatUi']['showDiff'],this['_openBalloonFor'](_0x1d0301,_0x39f489);}),this['listenTo'](this['_aiChatUi'],'mouseOverSuggestion',(_0x4f03b1,{replyId:_0x181b85,partIndex:_0x1b3389})=>{const _0x2d7c10=this['_getDocumentRangeForReplyChanges'](_0x181b85,_0x1b3389);_0x2d7c10&&'$graveyard'!=_0x2d7c10['range']['root']['rootName']&&this['_aiEditing']['showFakeVisualSelection']({'ranges':[_0x2d7c10['range']],'id':'change-area','priority':0xa});}),this['listenTo'](this['_aiChatUi'],'mouseLeaveSuggestion',()=>{this['_aiEditing']['hideFakeVisualSelection']('change-area');}),this['listenTo'](this['_aiChatUi'],'applySuggestion',(_0xd76572,_0x65f3b7)=>{this['_aiEditing']['hideFakeVisualSelection']('change-area'),this['_applySuggestion'](_0x65f3b7);}),this['listenTo'](this['_aiChatUi'],'toggleSuggestionDisplayMode',async(_0x2ab786,{replyId:_0x3c4169,showDiff:_0x5df01e})=>{const {reply:_0x2ec826}=this['getInteractionAndReplyById'](_0x3c4169),_0x2ca8e2=_0x2ec826['getContentParts']({'showDiff':_0x5df01e,'editor':$s(this['context'])});await this['_aiChatUi']['updateFeedItemAIReplySuggestionContent']({'id':_0x2ec826['id'],'parts':_0x2ca8e2});}),this['listenTo'](this['_aiChatUi'],'rejectSuggestion',(_0x54be20,{replyId:_0x3a93b9,partIndex:_0x1fe2bb})=>{this['_rejectSuggestion']({'replyId':_0x3a93b9,'partIndex':_0x1fe2bb}),this['_aiEditing']['hideFakeVisualSelection']('change-area');}),this['set']('_aiChatBalloonShowDiff',!0x1),this['context']['plugins']['has']('AIChatBalloon')&&(this['_aiChatBalloon']=this['context']['plugins']['get']('AIChatBalloon')),this['on']('interactionCreated',(_0x4145b3,_0x2f167d)=>{this['_aiChatUi']['addFeedItemUserMessage'](_0x2f167d);}),this['on']('replyCreated',(_0xb959c2,_0x576f8e)=>{this['_addFeedItemReply'](_0x576f8e);});}async['afterInit'](){this['context']instanceof _0x52dd99?this['_integrateEditor'](this['context']):this['listenTo'](this['context']['editors'],'add',(_0x181635,_0x4dff17)=>{_0x4dff17['on']('ready',()=>{this['_integrateEditor'](_0x4dff17);});});const _0x5ad5d8=this['context']['config']['get']('ai.chat.initialConversation');let _0x161339=_0x5ad5d8;if('lastCreated'!=_0x5ad5d8||(_0x161339=await this['_getLastCreatedConversationId'](),_0x161339))return'new'==_0x161339?this['_startConversationSafely']():this['loadConversation'](_0x161339);}async['destroy'](){return await this['_stopLastInteraction'](),this['_bodyCollection']['detachFromDom'](),super['destroy']();}async['loadConversation'](_0x48cfb5){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'](_0x48cfb5)['getConversation'](),await this['_startConversationSafely']({'id':_0x48cfb5}),this['_updateConversationTitle']('\x20'),await this['activeConversation']['load'](_0x48cfb5,this['_aiEditing']['sessionId']),this['activeConversation']['isCurrentDocumentInConversation']()&&this['addCurrentDocumentToChatContext']();}catch(_0x15cea7){this['_aiChatUi']['addFeedItemError']({'errorMessage':hs(this['context']['locale'],'AI_CHAT_UNABLE_TO_LOAD_CONVERSATION'),'id':_0x48cfb5}),this['_logError'](new at('ai-chat-conversation-not-found',this,{'error':_0x15cea7}));}finally{this['_aiChatUi']['startAutoScroll']({'smooth':!0x1}),this['_aiChatUi']['setFeedItemRenderingStrategy']('streaming'),this['_aiChatUi']['toggleLoadingSkeleton'](!0x1);}}['registerToolDataCallback'](_0x332e83){let _0x18526b=null,_0x40801c=null;this['on']('toolDataReceived',(_0x3cf9ac,_0x42fa65,_0x2219ed)=>{_0x2219ed['id']!==_0x18526b&&(_0x18526b=_0x2219ed['id'],_0x40801c=this['_getAIChatFeedAPI'](_0x2219ed)),_0x332e83(_0x42fa65,_0x40801c);});}['addCurrentDocumentToChatContext'](){this['activeConversation']?.['addCurrentDocumentToContext'](hs(this['context']['locale'],'AI_CHAT_CONTEXT_CURRENT_DOCUMENT'));}async['addSelectionToChatContext'](){const _0x2a5aba=this['_aiEditing']['getSelectionText']();this['activeConversation']?.['addSelectionToContext'](_0x2a5aba),this['addCurrentDocumentToChatContext']();}['removeSelectionFromChatContext'](){this['activeConversation']?.['removeSelectionFromContext']();}['focusPromptInput'](){this['_aiChatUi']['focusPromptInput']();}async['startConversation'](_0x436d7b){await this['_startConversationSafely']({'modelId':_0x436d7b?.['modelId']});}async['sendMessage'](_0x1912a2){await this['_handleUIUserMessage'](_0x1912a2);}['getGroupId'](){const _0x47be52=this['context']['config']['get']('collaboration.channelId');if(!_0x47be52)throw new at('ai-missing-channel-id',this);return _0x47be52;}['_handleRemovedConversation'](_0x3e76b7){this['activeConversation']['id']===_0x3e76b7&&this['_startConversationSafely']();}['_insertSuggestion'](_0x36c448){const _0xfdec7e=this['context']['plugins']['get']('DocumentCompare'),{reply:_0x271d76,interaction:_0x4fcf7b}=this['getInteractionAndReplyById'](_0x36c448['replyId']),_0x199fef=void 0x0!==_0x36c448['partIndex']?[_0x271d76['changeGroups'][_0x36c448['partIndex']]]:_0x271d76['changeGroups']['filter'](_0x435076=>'pending'==_0x435076['state']);for(const _0x904556 of this['_groupChangesByTarget'](_0x271d76,_0x199fef)){const {target:_0x5ecadc,groups:_0x35a1d0,groupsIndexes:_0x3ad58f,slice:_0x444564}=_0x904556;if(!_0x5ecadc['editor']['plugins']['has']('TrackChanges'))throw new at('ai-no-track-changes',null);const _0x10654b=this['_getDocumentRangeForReplyChanges'](_0x36c448['replyId'],_0x3ad58f[0x0]);if(!_0x10654b||'$graveyard'==_0x10654b['range']['root']['rootName']){_0x3ad58f['forEach'](_0x141aa0=>_0x271d76['setChangeGroupState'](_0x141aa0,'outdated'));continue;}_0x3ad58f['forEach'](_0x484714=>_0x271d76['setChangeGroupState'](_0x484714,'accepted'));const _0x3e07c7=qs({'editor':_0x5ecadc['editor'],'reply':_0x271d76,'interaction':_0x4fcf7b,'groups':_0x35a1d0,'transform':!0x0,'documentCompare':_0xfdec7e,'documentCompareOptions':{'anchor':_0x444564?.['rootName']??'main','markDeletions':!0x0},'documentContextSlice':_0x444564});let _0x222b4d;this['_scrollToSuggestionRange'](_0x10654b['range'],!0x1,_0x5ecadc['editor']),_0x5ecadc['editor']['model']['change'](_0x937f0d=>{_0x222b4d=_0x937f0d['batch'],_0x5ecadc['editor']['plugins']['get']('TrackChangesEditing')['_applyOperationsAsSuggestions'](_0x3e07c7),this['_aiEditing']['hideFakeVisualSelection']('change-area');}),this['_batchToChanges']['set'](_0x222b4d,{'interactionId':_0x4fcf7b['id'],'replyId':_0x271d76['id'],'indexes':_0x3ad58f['slice']()});}this['_updateRatings'](_0x271d76);}['_applySuggestion'](_0x80fa26){const _0x381e38=this['context']['plugins']['get'](_0x566822),{reply:_0x471c84,interaction:_0x16f374}=this['getInteractionAndReplyById'](_0x80fa26['replyId']),_0x35ef2d=void 0x0!==_0x80fa26['partIndex']?[_0x471c84['changeGroups'][_0x80fa26['partIndex']]]:_0x471c84['changeGroups']['filter'](_0x556a2d=>'pending'==_0x556a2d['state']);for(const _0x57bd24 of this['_groupChangesByTarget'](_0x471c84,_0x35ef2d)){const {target:_0x43afdb,groups:_0x5645b3,groupsIndexes:_0x927745,slice:_0x289d05}=_0x57bd24,_0xed1b06=this['_getDocumentRangeForReplyChanges'](_0x80fa26['replyId'],_0x927745[0x0]);if(!_0xed1b06||'$graveyard'==_0xed1b06['range']['root']['rootName']){_0x927745['forEach'](_0x2c3c64=>_0x471c84['setChangeGroupState'](_0x2c3c64,'outdated'));continue;}_0x927745['forEach'](_0x5cce27=>_0x471c84['setChangeGroupState'](_0x5cce27,'accepted'));const _0x5375eb=qs({'editor':_0x43afdb['editor'],'reply':_0x471c84,'interaction':_0x16f374,'groups':_0x5645b3,'transform':!0x0,'documentCompare':_0x381e38,'documentCompareOptions':{'anchor':_0x289d05?.['rootName']??'main','markDeletions':!0x1},'documentContextSlice':_0x289d05});let _0x18786f;this['_scrollToSuggestionRange'](_0xed1b06['range'],!0x1,_0x43afdb['editor']),_0x43afdb['editor']['model']['change'](_0xffd060=>{_0x18786f=_0xffd060['batch'];for(const _0x5a302a of _0x5375eb)_0x5a302a['baseVersion']=_0x43afdb['editor']['model']['document']['version'],Qs(_0x43afdb['editor'],_0x5a302a),_0xffd060['batch']['addOperation'](_0x5a302a),_0x43afdb['editor']['model']['applyOperation'](_0x5a302a);}),this['_batchToChanges']['set'](_0x18786f,{'interactionId':_0x16f374['id'],'replyId':_0x471c84['id'],'indexes':_0x927745['slice']()});}this['_updateRatings'](_0x471c84);}['_rejectSuggestion'](_0x4bc161){const {reply:_0x5c2a8e}=this['getInteractionAndReplyById'](_0x4bc161['replyId']);_0x5c2a8e['setChangeGroupState'](_0x4bc161['partIndex'],'rejected');}['_openBalloonFor'](_0xe1b12b,_0x30ccaf){if(!this['_aiChatBalloon'])return;const {reply:_0x45b350}=this['getInteractionAndReplyById'](_0xe1b12b),_0x37d7f4=_0x45b350['getContentParts']({'showDiff':this['_aiChatBalloonShowDiff'],'editor':$s(this['context'])});let _0x42c728,_0x4f2511;if(void 0x0!==_0x30ccaf?(_0x4f2511=_0x37d7f4['find'](_0x26c189=>_0x26c189['index']==_0x30ccaf),_0x42c728=_0x4f2511?.['index']):(_0x4f2511=_0x37d7f4[0x0],_0x42c728=_0x4f2511['index']),this['_currentPreviewedChangeGroup']?.['replyId']==_0xe1b12b&&this['_currentPreviewedChangeGroup']?.['partIndex']==_0x42c728)return;const _0x43106d=this['_getUserPresentableContentPartDocumentRange'](_0xe1b12b,_0x45b350,_0x4f2511),_0x493fa7=_0x45b350['changeGroups']['find'](_0x38a8ab=>_0x38a8ab['index']==_0x42c728),_0x190cd4=_0x493fa7?this['_resolveGroupTarget'](_0x45b350,_0x493fa7):null,_0x55614c=_0x190cd4?.['editor']??$s(this['context']),_0x2506de=_0x55614c['plugins']['has']('AIChatBalloon')?_0x55614c['plugins']['get']('AIChatBalloon'):this['_aiChatBalloon'];if(this['_activeBalloon']&&this['_activeBalloon']!==_0x2506de&&this['_activeBalloon']['close'](),!_0x43106d)return _0x2506de['close'](),void(this['_activeBalloon']=void 0x0);this['_activeBalloon']=_0x2506de,this['_currentPreviewedChangeGroup']={'replyId':_0xe1b12b,'partIndex':_0x42c728},this['_scrollToSuggestionRange'](_0x43106d,!0x0,_0x55614c);const _0x38fa81=this['_getPresentableSiblingContentPartIndex'](_0xe1b12b,_0x42c728,'next');_0x2506de['updateContent']({'part':_0x4f2511,'renderingStrategy':'static'}),_0x2506de['open']({'index':_0x42c728,'title':hs(this['context']['locale'],'AI_BALLOON_HEADER_TITLE',(_0x42c728+0x1)['toString']()),'showRotator':null!==_0x38fa81,'ranges':[_0x43106d],'areActionsDisabled':_0x45b350['areActionsDisabled'],'targetEditor':_0x55614c}),_0x2506de['setState']('pending'),this['_aiChatUi']['scrollFeedToSuggestion'](_0xe1b12b,_0x42c728),this['_aiChatUi']['setFeedItemAIReplySuggestionPartActive']({'id':_0xe1b12b,'index':_0x42c728,'isActive':!0x0});}['_getPresentableSiblingContentPartIndex'](_0x23bdad,_0xf6116d,_0x2ace7a){const {reply:_0x204d8d}=this['getInteractionAndReplyById'](_0x23bdad),_0x2d7280=_0x204d8d['getContentParts']({'showDiff':this['_aiChatBalloonShowDiff'],'editor':$s(this['context'])});if(0x1==_0x2d7280['length'])return null;const _0x2b1b61=_0x2d7280['findIndex'](_0x5a632a=>_0x5a632a['index']==_0xf6116d),_0x1794ee='next'==_0x2ace7a?0x1:-0x1;let _0x4534a9=_0x2d7280['at']((_0x2b1b61+_0x1794ee)%_0x2d7280['length'])['index'],_0x3439ae=_0x2d7280[_0x4534a9];for(;!this['_getUserPresentableContentPartDocumentRange'](_0x23bdad,_0x204d8d,_0x3439ae);){if(_0x4534a9=_0x2d7280['at']((_0x4534a9+_0x1794ee)%_0x2d7280['length'])['index'],_0x4534a9===_0x2b1b61)return null;_0x3439ae=_0x2d7280[_0x4534a9];}return _0x4534a9;}['_getUserPresentableContentPartDocumentRange'](_0x26239e,_0x2e7c8e,_0x285a69){const _0x4e92ba=_0x2e7c8e['changeGroups'];if(!_0x285a69['hasChanges'])return null;const _0xa2f28=_0x4e92ba['find'](_0xde22ee=>_0xde22ee['index']==_0x285a69['index']);if('pending'!==_0xa2f28?.['state'])return null;const _0x5761fa=this['_getDocumentRangeForReplyChanges'](_0x26239e,_0x285a69['index']);if(!_0x5761fa)return _0x2e7c8e['setChangeGroupState'](_0x285a69['index'],'outdated'),null;const {range:_0x130ab1,currentIndex:_0x490273}=_0x5761fa;return'$graveyard'==_0x130ab1['root']['rootName']?(_0x2e7c8e['setChangeGroupState'](_0x490273,'outdated'),null):_0x5761fa['range'];}['_getDocumentRangeForReplyChanges'](_0x6ba682,_0x3f7a4e){const {reply:_0x2e9d60}=this['getInteractionAndReplyById'](_0x6ba682),_0x3bb3f8=_0x2e9d60['changeGroups']['filter'](_0x14feaa=>'pending'==_0x14feaa['state']),_0x1d1e4a=_0x3bb3f8['map'](_0x2dc9bd=>_0x2e9d60['changeGroups']['indexOf'](_0x2dc9bd));void 0x0===_0x3f7a4e&&(_0x3f7a4e=_0x1d1e4a[0x0]);const _0x45ac92=_0x1d1e4a['indexOf'](_0x3f7a4e);if(-0x1==_0x45ac92)return null;const _0x15ab7c=_0x3bb3f8[_0x45ac92],_0x1df5d9=this['_resolveGroupTarget'](_0x2e9d60,_0x15ab7c);if(!_0x1df5d9)return null;const {editor:_0x584fa6,root:_0x59bf47,parsedDocumentContent:_0x2aa36f,serializedDocumentContent:_0x43aa88,version:_0x1d4ed1}=_0x1df5d9,_0x4fcb46=new _0x19e721([]),_0xce9b7=new _0x19e721([]);for(const _0x1fc29f of _0x15ab7c['changes']){const _0x131f56=this['activeConversation']?.['getSourceByDataId'](_0x1fc29f['id']);if((!_0x131f56||_0x131f56['editor']===_0x1df5d9['editor']&&_0x131f56['rootName']===_0x1df5d9['root']['rootName'])&&('removed'!=_0x1fc29f['type']&&_0xce9b7['children']['push'](_0x1fc29f['node']['cloneNode'](!0x0)),'new'!=_0x1fc29f['type'])){const _0x302e78=_0x4d511d(_0x546ad1=>Es(_0x546ad1,'data-id')==_0x1fc29f['id'],_0x2aa36f,!0x0);if(!_0x302e78)return null;_0x4fcb46['children']['push'](_0x302e78['cloneNode'](!0x0));}}if(0x0==_0x4fcb46['children']['length']){if(_0x15ab7c['changes'][0x0]['anchorId']){const _0x2d6965=As('data-id',_0x15ab7c['changes'][0x0]['anchorId'],_0x2aa36f);_0x4fcb46['children']['unshift'](_0x2d6965['cloneNode'](!0x0)),_0xce9b7['children']['unshift'](_0x2d6965['cloneNode'](!0x0)),_0x2d6965['nextSibling']&&(_0x4fcb46['children']['push'](_0x2d6965['nextSibling']['cloneNode'](!0x0)),_0xce9b7['children']['push'](_0x2d6965['nextSibling']['cloneNode'](!0x0)));}else{const _0x212f19=_0x2aa36f['children'][0x0];if(!_0x212f19)return null;_0x4fcb46['children']['push'](_0x212f19['cloneNode'](!0x0)),_0xce9b7['children']['push'](_0x212f19['cloneNode'](!0x0));}}const _0x453930=_0x584fa6['data']['parse'](_0x43aa88),_0x179226=gs(_0x4fcb46),_0x4add77=_0x584fa6['data']['parse'](_0x179226),_0x2a0c65=_0x584fa6['data']['parse'](_0x179226),_0x16a215=_0x584fa6['model']['createPositionAt'](_0x4add77,0x0),_0x386f22=gs(_0xce9b7),_0x474d31={'targetEditor':_0x584fa6,'anchor':_0x16a215,'markDeletions':!0x1},_0x5d6e8b=_0x584fa6['plugins']['get'](_0x566822)['getDiff'](_0x179226,_0x386f22,_0x474d31)['getOperations']();if(!_0x5d6e8b['length'])return null;_0x584fa6['model']['change'](_0x114b6c=>{for(const _0x561ffc of _0x5d6e8b)if('remove'==_0x561ffc['type']){const _0xcb7b2e=_0x561ffc['sourcePosition'],_0x594f50=_0x561ffc['howMany'],_0x45f8df=new _0x3d7c4f(_0xcb7b2e,_0x594f50);_0x114b6c['batch']['addOperation'](_0x45f8df),_0x584fa6['model']['applyOperation'](_0x45f8df);}else'marker'!==_0x561ffc['type']&&(_0x561ffc['baseVersion']=null,_0x561ffc['isDocumentOperation']=!0x1,_0x114b6c['batch']['addOperation'](_0x561ffc),_0x584fa6['model']['applyOperation'](_0x561ffc));});const _0x2adf78=ks(_0x584fa6,_0x5d6e8b,_0x4add77);Ns(_0x584fa6['model'],_0x2adf78);const _0x107c88=_0x2adf78['getFirstRange']()['start']['path']['slice'](),_0x279614=_0x2adf78['getFirstRange']()['end']['path']['slice'](),_0x4d4a9a=[];let _0xba62ea=_0x4add77,_0x2a0aa7=_0x2a0c65;for(let _0x516b54=0x0;_0x516b54<_0x279614['length'];_0x516b54++){const _0x831ee7=_0xba62ea['maxOffset']-_0x279614[_0x516b54];_0x4d4a9a[_0x516b54]=_0x2a0aa7['maxOffset']-_0x831ee7,_0xba62ea=_0xba62ea['getChildAtOffset'](_0x279614[_0x516b54]),_0x2a0aa7=_0x2a0aa7['getChildAtOffset'](_0x4d4a9a[_0x516b54]);}const _0x80e02c=_0x584fa6['model']['createRange'](_0x584fa6['model']['createPositionFromPath'](_0x2a0c65,_0x107c88),_0x584fa6['model']['createPositionFromPath'](_0x2a0c65,_0x4d4a9a)),_0x59f504=_0x2a0c65['getChild'](0x0)['getAttribute'](_0x2afd81),_0x210e6e=Array['from'](_0x453930['getChildren']())['find'](_0x732185=>_0x732185['getAttribute'](_0x2afd81)==_0x59f504)['getPath'](),_0x1b6fcb=_0x80e02c['start']['path']['slice'](),_0x1a3820=_0x80e02c['end']['path']['slice']();_0x1b6fcb[0x0]=_0x210e6e[0x0]+_0x1b6fcb[0x0],_0x1a3820[0x0]=_0x210e6e[0x0]+_0x1a3820[0x0];let _0x56df3f=_0x584fa6['model']['createRange'](_0x584fa6['model']['createPositionFromPath'](_0x59bf47,_0x1b6fcb),_0x584fa6['model']['createPositionFromPath'](_0x59bf47,_0x1a3820));const _0x5b9ab3=_0x584fa6['model']['document']['history']['getOperations'](_0x1d4ed1);for(const _0x8f2553 of _0x5b9ab3)_0x56df3f=_0x5779b9['_createFromRanges'](_0x56df3f['getTransformedByOperation'](_0x8f2553));return{'range':_0x56df3f,'currentIndex':_0x3f7a4e};}['_integrateEditorBalloon'](_0xac9a6a){if(!_0xac9a6a['plugins']['has']('AIChatBalloon'))return;const _0x48123e=_0xac9a6a['plugins']['get']('AIChatBalloon');this['_wiredBalloons']['has'](_0x48123e)||(this['_wiredBalloons']['add'](_0x48123e),this['_aiChatBalloon']||(this['_aiChatBalloon']=_0x48123e),_0x48123e['bind']('showDiff')['to'](this,'_aiChatBalloonShowDiff'),this['listenTo'](_0x48123e,'toggleSuggestionDisplayMode',()=>{const {replyId:_0x26fca7,partIndex:_0x5aec0c}=this['_currentPreviewedChangeGroup'];this['_aiChatBalloonShowDiff']=!this['_aiChatBalloonShowDiff'];const {reply:_0x24b4d2}=this['getInteractionAndReplyById'](_0x26fca7),_0x293bfb=_0x24b4d2['changeGroups']['find'](_0x4ef1ca=>_0x4ef1ca['index']===_0x5aec0c),_0x230da6=_0x293bfb?this['_resolveGroupTarget'](_0x24b4d2,_0x293bfb):null,_0x544333=_0x24b4d2['getContentParts']({'showDiff':this['_aiChatBalloonShowDiff'],'groupIndex':_0x5aec0c,'editor':_0x230da6?.['editor']??$s(this['context'])});(this['_activeBalloon']??_0x48123e)['updateContent']({'part':_0x544333[0x0],'renderingStrategy':'static','keepErrors':!0x0});}),this['listenTo'](_0x48123e,'applySuggestion',()=>{const {replyId:_0xa137d1,partIndex:_0x5972bd}=this['_currentPreviewedChangeGroup'];this['_applySuggestion']({'replyId':_0xa137d1,'partIndex':_0x5972bd}),(this['_activeBalloon']??_0x48123e)['setState']('accepted');}),this['listenTo'](_0x48123e,'insertSuggestion',()=>{const {replyId:_0xd2ad45,partIndex:_0x562ead}=this['_currentPreviewedChangeGroup'];this['_insertSuggestion']({'replyId':_0xd2ad45,'partIndex':_0x562ead}),(this['_activeBalloon']??_0x48123e)['setState']('accepted');}),this['listenTo'](_0x48123e,'rejectSuggestion',()=>{const {replyId:_0x5a2b53,partIndex:_0x3b944e}=this['_currentPreviewedChangeGroup'];this['_rejectSuggestion']({'replyId':_0x5a2b53,'partIndex':_0x3b944e}),(this['_activeBalloon']??_0x48123e)['setState']('rejected');}),this['listenTo'](_0x48123e,'showNext',()=>{const {replyId:_0x526ded,partIndex:_0x2db21f}=this['_currentPreviewedChangeGroup'],_0xe8d154=this['_getPresentableSiblingContentPartIndex'](_0x526ded,_0x2db21f,'next');null!==_0xe8d154&&this['_openBalloonFor'](_0x526ded,_0xe8d154);}),this['listenTo'](_0x48123e,'showPrevious',()=>{const {replyId:_0x2942e9,partIndex:_0xcad06c}=this['_currentPreviewedChangeGroup'],_0x4fef28=this['_getPresentableSiblingContentPartIndex'](_0x2942e9,_0xcad06c,'previous');null!==_0x4fef28&&this['_openBalloonFor'](_0x2942e9,_0x4fef28);}),this['listenTo'](_0x48123e,'dialogClosed',(_0x712c92,{id:_0x134eff})=>{if('aiChatBalloon'!==_0x134eff)return;const {replyId:_0x287b3b,partIndex:_0x4e9d7b}=this['_currentPreviewedChangeGroup'];this['_currentPreviewedChangeGroup']=null,this['_aiChatUi']['setFeedItemAIReplySuggestionPartActive']({'id':_0x287b3b,'index':_0x4e9d7b,'isActive':!0x1}),this['_activeBalloon']===_0x48123e&&(this['_activeBalloon']=void 0x0);}));}['_integrateEditor'](_0x3e64b3){if(this['_integrateEditorBalloon'](_0x3e64b3),_0x3e64b3['plugins']['has']('Undo')){const _0x4157a7=_0x3e64b3['commands']['get']('undo'),_0xb2b8b7=_0x3e64b3['commands']['get']('redo');this['listenTo'](_0x4157a7,'revert',(_0x2ec374,_0x1d5cd9,_0x2c1dd5)=>{const _0x469138=this['_batchToChanges']['get'](_0x1d5cd9);if(!_0x469138)return;const _0x345d9c=this['activeConversation']['getInteraction'](_0x469138['interactionId']),_0x27dc07=_0x345d9c?.['getReply'](_0x469138['replyId']);this['_batchToChanges']['delete'](_0x1d5cd9),_0x345d9c&&_0x27dc07&&(_0x469138['indexes']['forEach'](_0x3a719c=>_0x27dc07['setChangeGroupState'](_0x3a719c,'pending')),this['_batchToChanges']['set'](_0x2c1dd5,_0x469138));}),this['listenTo'](_0xb2b8b7,'revert',(_0x2a0d74,_0x1952fb,_0x5d083e)=>{const _0x5d2cd4=this['_batchToChanges']['get'](_0x1952fb);if(!_0x5d2cd4)return;const _0x121df2=this['activeConversation']['getInteraction'](_0x5d2cd4['interactionId']),_0x4a17b6=_0x121df2?.['getReply'](_0x5d2cd4['replyId']);this['_batchToChanges']['delete'](_0x1952fb),_0x121df2&&_0x4a17b6&&(_0x5d2cd4['indexes']['forEach'](_0xfda4a8=>_0x4a17b6['setChangeGroupState'](_0xfda4a8,'accepted')),this['_batchToChanges']['set'](_0x5d083e,_0x5d2cd4));});}const _0xd9b2cd=_0x3e64b3['config']['get']('ai.chat.context');_0xd9b2cd['alwaysAddSelection']&&_0xd9b2cd['document']['enabled']&&this['listenTo'](_0x3e64b3['model']['document']['selection'],'change:range',(_0x4b1f3c,_0x4e7bf8)=>{if(!_0x4e7bf8['directChange'])return;'chat'===_0x3e64b3['plugins']['get']('AITabs')['view']['activeTab']&&(_0x3e64b3['model']['hasContent'](_0x3e64b3['model']['document']['selection'])?this['addSelectionToChatContext']():this['removeSelectionFromChatContext']());});}async['_getLastCreatedConversationId'](){const _0x1d8905=this['_aiConnector']['fetchConversations'](this['getGroupId'](),{'limit':0x1,'sortBy':'createdAt'});try{const _0x5dd6bd=await _0x1d8905['getConversations']();return _0x5dd6bd['length']?_0x5dd6bd[0x0]['id']:'new';}catch(_0x30ef94){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':_0x30ef94})),this['_aiChatUi']['toggleLoadingSkeleton'](!0x1),this['_aiChatUi']['disableControls'](),null;}}async['_startConversationSafely'](_0x2de616={}){try{this['_aiChatUi']['enableControls'](),await this['_handleStartConversation'](_0x2de616);}catch(_0x596cdc){this['_aiChatUi']['addFeedItemError']({'errorMessage':hs(this['context']['locale'],'AI_CHAT_UNABLE_TO_START_CONVERSATION'),'id':_0x2de616['id']||ot()}),console['error'](_0x596cdc),this['activeConversation']=void 0x0,this['_aiChatUi']['disableControls']();}}async['_handleStartConversation']({id:_0x41221f,modelId:_0x4cef98}={}){this['_activeBalloon']?.['close'](),this['_activeBalloon']=void 0x0,this['_currentPreviewedChangeGroup']=null;let _0x3d968c=_0x4cef98;_0x3d968c||(_0x41221f||!this['activeConversation']?_0x3d968c=this['context']['config']['get']('ai.models.defaultModelId'):this['_aiChatUi']['isModelAvailable']&&(_0x3d968c=this['activeConversation']['selectedModel']['id'])),await this['_stopLastInteraction']();const _0x35619b=this['getGroupId'](),_0x39636e=_0x41221f||ot();let _0x5a959f;this['activeConversation']=new Gs({'connector':this['_aiConnector'],'chatModels':this['_aiChatModels'],'selectedModelId':_0x3d968c,'conversationId':_0x39636e,'group':_0x35619b,'getEditor':()=>$s(this['context']),'getEditors':()=>Ws(this['context']),'locale':this['context']['locale'],'isFromHistory':!!_0x41221f}),this['activeConversation']['delegate']('toolDataReceived','interactionCreated','interactionStarted','replyCreated')['to'](this),this['activeConversation']['on']('conversationInitialized',(_0x3cb51b,_0x126230)=>{this['_aiChatUi']['createConversation'](_0x126230),this['_aiChatUi']['resetMessageInput'](),this['_aiChatUi']['clearPendingContextUI'](),this['_aiChatUi']['clearConversationContextUI'](),_0x41221f||(this['_aiChatUi']['resetConversationTitle'](),this['addCurrentDocumentToChatContext']());}),this['activeConversation']['on']('uploadProgressChanged',(_0x5da0a2,_0x5e2b00)=>{this['_aiChatUi']['setIsUploadInProgress'](_0x5e2b00['isUploadInProgress']);}),this['activeConversation']['on']('webSearchStarted',()=>{const _0x58c552=this['_aiChatUi']['prepareLoadingMessage']({'isWebSearchEnabled':!0x0,'isReasoningEnabled':!0x1});this['_aiChatUi']['setLoadingMessage'](_0x58c552);}),this['activeConversation']['on']('reasoningStarted',()=>{const _0x4b46b1=this['_aiChatUi']['prepareLoadingMessage']({'isWebSearchEnabled':!0x1,'isReasoningEnabled':!0x0});this['_aiChatUi']['setLoadingMessage'](_0x4b46b1);}),this['activeConversation']['on']('webSearchFinished',(_0x37b45c,_0x3a4ae9)=>{this['_aiChatUi']['addFeedInteractionHeader'](_0x3a4ae9,{'isWebSearchEnabled':!0x0,'isReasoningEnabled':!0x1});}),this['activeConversation']['on']('reasoningFinished',(_0x459049,_0x58b22f)=>{this['_aiChatUi']['addFeedInteractionHeader'](_0x58b22f,{'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',(_0x3fd74b,_0x1902d1)=>{this['_aiChatUi']['removeFeedInteraction'](_0x1902d1['id']);}),this['activeConversation']['on']('setConversationTitle',(_0x2d226c,_0x1ae015,_0x18d555)=>{this['_updateConversationTitle'](_0x1ae015,_0x18d555);}),this['activeConversation']['on']('replyContentUpdated',async(_0x46e602,_0x51fea0)=>{void 0x0!==_0x5a959f&&_0x5a959f!==_0x51fea0['id']&&this['_updateReplyContentThrottled']['flush'](),_0x5a959f=_0x51fea0['id'],_0x51fea0['isFromHistory']?await this['_updateReplyContent']({'reply':_0x51fea0}):await this['_updateReplyContentThrottled']({'reply':_0x51fea0});}),this['activeConversation']['on']('replyChangeGroupStateUpdated',(_0x24ffa,{reply:_0x24b9b6,index:_0x1b6753,state:_0xebf339})=>{this['_aiChatUi']['updateFeedItemAIReplySuggestionPartState']({'id':_0x24b9b6['id'],'index':_0x1b6753,'state':_0xebf339}),this['_currentPreviewedChangeGroup']?.['replyId']['includes'](_0x24b9b6['id'])&&this['_currentPreviewedChangeGroup']?.['partIndex']==_0x1b6753&&(this['_activeBalloon']??this['_aiChatBalloon'])?.['setState'](_0xebf339);}),this['activeConversation']['on']('contextItemAdded',(_0x12a650,_0x288a35)=>{if(this['_aiChatUi']['addContextItem'](_0x288a35['contextItem'],_0x288a35['isLoading']),'selection'===_0x288a35['contextItem']['type']){const _0x850da9=[...$s(this['context'])['model']['document']['selection']['getRanges']()];this['_aiEditing']['showFakeVisualSelection']({'ranges':_0x850da9,'id':'context','priority':0x1});}}),this['activeConversation']['on']('contextItemRemoved',(_0xdb2bfa,_0x4a468b)=>{this['_aiChatUi']['removeContextItem'](_0x4a468b['uiId']),'current-document'==_0x4a468b['uiId']&&this['removeSelectionFromChatContext'](),'selection'===_0x4a468b['type']&&this['_aiEditing']['hideFakeVisualSelection']('context');}),this['activeConversation']['on']('contextItemLoadingEnded',(_0x456ba8,_0x2c4f2e)=>{this['_aiChatUi']['setContextItemLoading'](_0x2c4f2e['contextItem']['uiId'],_0x2c4f2e['isLoading']);}),this['activeConversation']['on']('contextSent',(_0x5ad33b,_0x84496c)=>{this['_aiChatUi']['setConversationContext'](_0x84496c['contextItems']);}),this['activeConversation']['on']('addContextOptionsChanged',(_0x5c02d0,_0x286ab1)=>{this['_aiChatUi']['setAddContextOptions'](_0x286ab1['options']);}),this['activeConversation']['on']('sourceResourcesLoaded',(_0x3b7e50,_0x2fffb1)=>{this['_aiChatUi']['populateSourceResourceBalloon'](_0x2fffb1['sourceId'],_0x2fffb1['source'],_0x2fffb1['resources'],_0x2fffb1['uid']);}),this['activeConversation']['on']('resourceStateChanged',(_0x1cc415,_0x5f0ed6)=>{this['_aiChatUi']['updateResourceState'](_0x5f0ed6['sourceId'],_0x5f0ed6['resourceId'],_0x5f0ed6['isInContext']);}),this['activeConversation']['on']('capabilitiesUpdated',(_0x1655ac,_0x8a12f4)=>{this['_aiChatUi']['updateCapabilities'](_0x8a12f4);}),this['activeConversation']['on']('modelSelected',async(_0x2e6dfd,_0x7c6e8)=>{const _0x50a04d=(await this['_aiChatModels']['getAll']())['find'](_0x4bc20e=>_0x4bc20e['id']===_0x7c6e8['selectedModel']?.['id'])||null;this['_aiChatUi']['setSelectedModel'](_0x50a04d,_0x7c6e8['isDisabled']);}),this['activeConversation']['on']('error',(_0x3a6a0c,{error:_0x3f5229,interactionId:_0x45a2c5,fileName:_0x244bb7,url:_0x39e4ae,sourceId:_0x5d8344,sourceLabel:_0x260ce5})=>{const _0xaa27a3=_0x45a2c5?_0x45a2c5+':'+ot():ot();_0x3f5229['message']['startsWith']('ai-request-aborted')?this['_aiChatUi']['addFeedItemStaticMessage']({'staticMessage':hs(this['context']['locale'],'AI_CHAT_ABORTED_MESSAGE'),'id':_0xaa27a3}):_0x3f5229['message']['startsWith']('ai-chat-conversation-init-failed')||_0x3f5229['message']['startsWith']('ai-chat-conversation-start-failed')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':hs(this['context']['locale'],'AI_CHAT_UNABLE_TO_START_CONVERSATION'),'id':_0xaa27a3}),this['_logError'](_0x3f5229)):_0x3f5229['message']['startsWith']('ai-chat-file-upload-failed')?this['_aiChatUi']['addFeedItemError']({'errorMessage':hs(this['context']['locale'],'AI_CHAT_CONTEXT_UNABLE_TO_UPLOAD_FILE',_0x244bb7),'id':_0xaa27a3}):_0x3f5229['message']['startsWith']('ai-chat-url-upload-failed')?this['_aiChatUi']['addFeedItemError']({'errorMessage':hs(this['context']['locale'],'AI_CHAT_CONTEXT_UNABLE_TO_UPLOAD_URL',_0x39e4ae),'id':_0xaa27a3}):_0x3f5229['message']['startsWith']('ai-chat-context-invalid-data')?this['_aiChatUi']['addFeedItemError']({'errorMessage':hs(this['context']['locale'],'AI_CHAT_CONTEXT_INVALID_DATA'),'id':_0xaa27a3}):_0x3f5229['message']['startsWith']('ai-chat-context-unsupported-type')?this['_aiChatUi']['addFeedItemError']({'errorMessage':hs(this['context']['locale'],'AI_CHAT_CONTEXT_UNSUPPORTED_TYPE'),'id':_0xaa27a3}):_0x3f5229['message']['startsWith']('ai-chat-source-resources-load-failed')?(_0x5d8344&&this['_aiChatUi']['closeSourceResourceBalloon'](_0x5d8344),this['_aiChatUi']['addFeedItemError']({'errorMessage':hs(this['context']['locale'],'AI_CHAT_CONTEXT_UNABLE_TO_LOAD_RESOURCES',_0x260ce5||'source'),'id':_0xaa27a3}),this['_logError'](_0x3f5229)):_0x3f5229['message']['startsWith']('ai-chat-resource-load-failed')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':hs(this['context']['locale'],'AI_CHAT_RESOURCE_LOAD_FAILED'),'id':_0xaa27a3}),this['_logError'](_0x3f5229)):_0x3f5229['message']['startsWith']('ai-chat-invalid-request')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':hs(this['context']['locale'],'AI_CHAT_INVALID_REQUEST'),'id':_0xaa27a3}),this['_logError'](_0x3f5229)):_0x3f5229['message']['startsWith']('ai-chat-context-unsupported-file-type')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':hs(this['context']['locale'],'AI_CHAT_CONTEXT_UNSUPPORTED_FILE_TYPE'),'id':_0xaa27a3}),this['_logError'](_0x3f5229)):_0x3f5229['message']['startsWith']('ai-chat-context-file-too-large')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':hs(this['context']['locale'],'AI_CHAT_CONTEXT_FILE_TOO_LARGE'),'id':_0xaa27a3}),this['_logError'](_0x3f5229)):_0x3f5229['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':_0xaa27a3}),this['_logError'](_0x3f5229)):_0x3f5229['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':_0xaa27a3}),this['_logError'](_0x3f5229)):(this['_aiChatUi']['addFeedItemError']({'errorMessage':hs(this['context']['locale'],'AI_CHAT_GENERIC_ERROR'),'id':_0xaa27a3}),this['_logError'](_0x3f5229));}),await this['activeConversation']['init'](this['context']['config']['get']('ai.chat.context')),_0x41221f||await this['activeConversation']['start']();}async['_handleUIUserMessage']({message:_0x4a85f5,attributes:_0x276206}){if(!this['activeConversation'])throw new at('ai-chat-controller-no-active-conversation');if(this['activeConversation']['isCurrentDocumentInContext']()){const _0x1cdba5=await this['_aiEditing']['getDocumentData']();_0x1cdba5['length']>0x1?await this['activeConversation']['updateCurrentDocumentsInContext'](_0x1cdba5):await this['activeConversation']['updateCurrentDocumentInContext'](_0x1cdba5[0x0]);}this['activeConversation']['id']&&this['activeConversation']['isStarted']&&await this['activeConversation']['handleUserInteraction']({'userMessage':_0x4a85f5,'attributes':_0x276206});}['_logError'](_0x2d4568){Et(_0x2d4568['message']);}['_removeFromContext'](_0x159b76){this['activeConversation']?.['removeFromContext'](_0x159b76);}['_toggleWebSearch'](){this['activeConversation']?.['toggleWebSearch']();}['_toggleReasoning'](){this['activeConversation']?.['toggleReasoning']();}['getInteractionAndReplyById'](_0x362b9b){const [_0x20e568,_0x1b5ecf]=_0x362b9b['split'](':'),_0x6066f5=this['activeConversation']['getInteraction'](_0x20e568),_0x22d1f7=_0x6066f5['getReply'](_0x1b5ecf);return{'interaction':_0x6066f5,'reply':_0x22d1f7};}['_resolveGroupTarget'](_0x4597e2,_0x460d1a){const _0x264c95=[..._0x460d1a['changes']['filter'](_0x1af41d=>'context'!==_0x1af41d['type']),..._0x460d1a['changes']['filter'](_0x241fa4=>'context'===_0x241fa4['type'])];for(const _0x48cfa9 of _0x264c95){const _0x4aaff4=_0x4597e2['newNodeAnchorIds']['get'](_0x48cfa9['id']),_0x121d19=this['activeConversation']?.['getSourceByDataId'](_0x48cfa9['id'])||this['activeConversation']?.['getSourceByDataId'](_0x4aaff4)||this['activeConversation']?.['getSourceByDataId'](_0x48cfa9['anchorId']??void 0x0);if(_0x121d19){if('destroyed'===_0x121d19['editor']['state'])return null;const _0x434432=_0x121d19['editor']['model']['document']['getRoot'](_0x121d19['rootName']);return _0x434432?{'editor':_0x121d19['editor'],'root':_0x434432,'parsedDocumentContent':_s(_0x121d19['content']),'serializedDocumentContent':_0x121d19['content'],'version':_0x121d19['version']}:null;}}const _0x4edd70=$s(this['context']),_0x237005=this['activeConversation']['getInteraction'](_0x4597e2['interactionId']),_0xce9674=_0x237005?.['getDocumentContext']();return{'editor':_0x4edd70,'root':_0x4edd70['model']['document']['getRoot'](),'parsedDocumentContent':_0x4597e2['documentContextContent'],'serializedDocumentContent':_0xce9674?.['content'],'version':_0xce9674?.['version']};}['_groupChangesByTarget'](_0x28b8a4,_0x17dd46){const _0x54b20a=new Map();for(const _0x13370d of _0x17dd46){const _0x125aaf=this['_resolveGroupTarget'](_0x28b8a4,_0x13370d);if(!_0x125aaf)continue;const _0x4c7d16=(_0x125aaf['editor']['id']||'e')+'|'+_0x125aaf['root']['rootName'];let _0x2da9d6=_0x54b20a['get'](_0x4c7d16);if(!_0x2da9d6){let _0x2ce2aa;for(const _0x1ea085 of[..._0x13370d['changes']['filter'](_0x1032a3=>'context'!==_0x1032a3['type']),..._0x13370d['changes']['filter'](_0x302b31=>'context'===_0x302b31['type'])])if(_0x2ce2aa=this['activeConversation']?.['getDocumentContextSliceByDataId'](_0x1ea085['id'])||this['activeConversation']?.['getDocumentContextSliceByDataId'](_0x28b8a4['newNodeAnchorIds']['get'](_0x1ea085['id'])),_0x2ce2aa)break;_0x2da9d6={'target':{'editor':_0x125aaf['editor'],'root':_0x125aaf['root']},'slice':_0x2ce2aa,'groups':[],'groupsIndexes':[]},_0x54b20a['set'](_0x4c7d16,_0x2da9d6);}_0x2da9d6['groups']['push'](_0x13370d),_0x2da9d6['groupsIndexes']['push'](_0x28b8a4['changeGroups']['indexOf'](_0x13370d));}return Array['from'](_0x54b20a['values']());}['_scrollToSuggestionRange'](_0x5d7bd2,_0x6be060=!0x1,_0x14b46d){const _0x35335f={'target':_0x14b46d['editing']['view']['domConverter']['viewRangeToDom'](_0x14b46d['editing']['mapper']['toViewRange'](_0x5d7bd2)),'viewportOffset':{'top':0x96,'left':0x0,'bottom':0x32,'right':0x0},'ancestorOffset':0x14,'alignToTop':_0x6be060};_0x6be060&&(_0x35335f['alignToTop']=!0x0),Ct(_0x35335f);}['_updateConversationTitle'](_0x4d54fd,_0x5452ce=!0x1){this['_aiChatUi']['setConversationTitle'](_0x4d54fd||hs(this['context']['locale'],'AI_CHAT_UNTITLED_CONVERSATION'),_0x5452ce);}['_addFeedItemReply'](_0x8654b0){'text'===_0x8654b0['type']?this['_aiChatUi']['addFeedItemAIReply'](_0x8654b0):this['_aiChatUi']['addFeedItemAISuggestion'](_0x8654b0);}async['_updateReplyContent']({reply:_0x3423a7,renderingStrategy:_0x530af8}){const {id:_0x31fe5c,interactionId:_0x10ed03,isDone:_0x3b5a1f,type:_0x3cd763,parsedContent:_0x10bbb5}=_0x3423a7,_0x5cdb65=_0x10ed03+':'+_0x31fe5c;if('modification'===_0x3cd763){const _0x52fcb5=_0x3423a7['getContentParts']({'showDiff':this['_aiChatUi']['showDiff'],'editor':$s(this['context'])});await this['_aiChatUi']['updateFeedItemAIReplySuggestionContent']({'id':_0x5cdb65,'parts':_0x52fcb5,'isDone':_0x3b5a1f,'skipLoadingEffects':_0x3423a7['isFromHistory']});}else'text'===_0x3cd763&&await this['_aiChatUi']['updateFeedItemAIReplyContent']({'id':_0x5cdb65,'parsedContent':_0x10bbb5,'renderingStrategy':_0x530af8,'isDone':_0x3b5a1f});_0x3b5a1f&&_0x3423a7['sources']['length']>0x0&&this['_aiChatUi']['updateFeedItemAIReplySources'](_0x5cdb65,_0x3423a7['sources']);}['_updateReplyContentThrottled']=_0x1ae134(this['_updateReplyContent']['bind'](this),0xc8);async['_stopLastInteraction'](){const _0x1be3d0=this['activeConversation']?.['lastInteraction'];_0x1be3d0&&(_0x1be3d0['stop'](),this['_aiChatUi']['stopInteraction'](_0x1be3d0)),this['_updateReplyContentThrottled']['cancel']();}async['_flushLastInteractionUI'](){const _0x20d973=this['activeConversation']?.['lastInteraction'];if(_0x20d973){for await(const _0x179a7 of _0x20d973['replies'])this['_aiChatUi']['hasFeedItem'](_0x179a7['id'])||this['_addFeedItemReply'](_0x179a7),await this['_updateReplyContent']({'reply':_0x179a7,'renderingStrategy':'static'});}}['_updateRatings'](_0x7e1362){const _0x86540={'positiveCount':_0x7e1362['changeGroups']['filter'](_0x561ad1=>'accepted'===_0x561ad1['state'])['length'],'totalCount':_0x7e1362['changeGroups']['length'],'modificationId':_0x7e1362['id']},_0x14609b=this['activeConversation']['getInteraction'](_0x7e1362['interactionId'])['messageId'];_0x14609b&&this['_aiConnector']['upsertAIChatRating'](this['activeConversation']['id'],_0x14609b,_0x86540);}['_getAIChatFeedAPI'](_0x4f2531){const _0x2be053=this['_aiChatUi'],_0x4ef3a=()=>{_0x4f2531['resetWebSearchState'](),_0x4f2531['resetReasoningState'](),_0x2be053['clearLoadingMessage']();},_0x5036f5=()=>{_0x4f2531['currentReply']&&(_0x4f2531['currentReply']['done'](),_0x4f2531['currentReply']=void 0x0);};return{'insertTextReply':(_0x5e6cc6,_0x428519)=>{_0x5036f5(),_0x4ef3a();const _0x5020a4=_0x4f2531['currentReply']=_0x4f2531['createReply']({'type':'text','interactionId':_0x4f2531['id'],'content':_0x5e6cc6,'id':_0x428519||ot()});return _0x5036f5(),_0x5020a4;},'insertCustomElement':async(_0x41fc23,_0x10e1a2)=>(_0x5036f5(),_0x4ef3a(),_0x2be053['addFeedItemCustomElement'](_0x41fc23,_0x10e1a2||ot())),'setLoadingMessage':_0x218005=>{_0x2be053['setLoadingMessage'](_0x218005);},'clearLoadingMessage':()=>{_0x2be053['clearLoadingMessage']();}};}}const zs='ai-selection',js=['br'];class Js extends _0x490ade{constructor(_0x917009){super(_0x917009),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 _0x28fd21=Ws(this['context']),_0x31079d=_0x28fd21['find'](_0x45c4c7=>_0x45c4c7['plugins']['has']('RealTimeCollaborationClient'))||_0x28fd21[0x0],_0x38d02a=_0x31079d['plugins']['has']('RealTimeCollaborationClient')&&_0x31079d['plugins']['get']('RealTimeCollaborationClient')['sessionId'];this['_sessionId']=_0x38d02a||ot();}return this['_sessionId'];}async['getDocumentData'](){const _0x9412f0=Ws(this['context']);if(!_0x9412f0['length'])throw new at('ai-get-editor-from-context-no-editor');const _0x2b78e1=[],_0x158953=new Set();for(const _0x425eb5 of _0x9412f0){const _0x3ec044=_0x425eb5['config']['get']('roots')||{};for(const _0x321480 of _0x425eb5['model']['document']['getRoots']()){if('$graveyard'===_0x321480['rootName'])continue;const _0x4f45cc=await this['_getDocumentDataForEditorRoot'](_0x425eb5,_0x321480,_0x158953),_0x49fbd6=_0x3ec044[_0x321480['rootName']];let _0x52104a;_0x49fbd6?.['label']?_0x52104a=_0x49fbd6['label']:(It('ai-document-root-missing-label',{'editor':_0x425eb5,'rootConfig':_0x49fbd6}),_0x52104a=_0x321480['rootName']),_0x2b78e1['push']({'editor':_0x425eb5,'rootName':_0x321480['rootName'],'content':_0x4f45cc['content'],'version':_0x4f45cc['version'],'sessionId':this['sessionId'],'channelId':_0x425eb5['config']['get']('collaboration.channelId'),'selections':_0x4f45cc['selections'],'name':_0x52104a,'description':_0x49fbd6?.['description']});}}return _0x2b78e1;}async['_getDocumentDataForEditorRoot'](_0x9ece1e,_0x36bc6a,_0x592f33){const _0x4807a1=_0x9ece1e['data']['toView'](_0x36bc6a,{'convertAiChatSelectionMarker':!0x0}),_0x5ea840=new _0x3fb8b8(_0x9ece1e['editing']['view']['document']);this['_setDataIdsOnChildren'](_0x4807a1,_0x5ea840,_0x592f33);let _0x4fba66=await this['_getDocumentDataStringFromView'](_0x4807a1,_0x9ece1e);const _0x4da6c5=this['_getMarkersInDocumentOrder'](_0x9ece1e,_0x36bc6a),_0x51d6be=[];for(const _0x2a6112 of _0x4da6c5){const _0x50a7b3='<'+_0x2a6112['name']+':start></'+_0x2a6112['name']+':start>',_0xf48143=_0x4fba66['indexOf'](_0x50a7b3);_0x4fba66=_0x4fba66['substring'](0x0,_0xf48143)+_0x4fba66['substring'](_0xf48143+_0x50a7b3['length']);const _0x2afa31='<'+_0x2a6112['name']+':end></'+_0x2a6112['name']+':end>',_0x69b002=_0x4fba66['indexOf'](_0x2afa31);_0x4fba66=_0x4fba66['substring'](0x0,_0x69b002)+_0x4fba66['substring'](_0x69b002+_0x2afa31['length']),_0x51d6be['push']({'markerName':_0x2a6112['name'],'start':_0xf48143,'end':_0x69b002,'htmlFragment':_0x4fba66['substring'](_0xf48143,_0x69b002)});}return{'content':_0x4fba66,'version':_0x9ece1e['model']['document']['version'],'selections':_0x51d6be};}async['afterInit'](){this['context']instanceof _0x52dd99?this['_integrateEditor'](this['context']):this['listenTo'](this['context']['editors'],'add',(_0x2471a7,_0x3f1130)=>{_0x3f1130['on']('ready',()=>{this['_integrateEditor'](_0x3f1130);});});}['_setOutputDataProcessor'](_0x202976){this['_outputDataProcessor']=_0x202976;}async['_getDocumentDataStringFromView'](_0x505c56,_0x31ed2b){let _0x4912ef;if(this['_outputDataProcessor']){const _0x38fc1e=_0x31ed2b['data']['processor']['domConverter']['viewToDom'](_0x505c56),_0x35b904=await this['_outputDataProcessor'](_0x38fc1e);_0x4912ef=_0x31ed2b['data']['processor']['htmlWriter']['getHtml'](_0x35b904);}else _0x4912ef=_0x31ed2b['data']['processor']['toData'](_0x505c56);return _0x4912ef;}['_integrateEditor'](_0x5e3ebe){if(!_0x5e3ebe['config']['get']('collaboration.channelId'))throw new at('ai-missing-channel-id',_0x5e3ebe);_0x5e3ebe['ui']['focusTracker']['on']('change:isFocused',(_0x153b66,_0x4b40c6,_0x1e0de0)=>{_0x1e0de0&&(this['_lastContentFocusedEditor']=_0x5e3ebe);}),_0x5e3ebe['on']('destroy',()=>{this['_lastContentFocusedEditor']===_0x5e3ebe&&(this['_lastContentFocusedEditor']=void 0x0);}),_0x5e3ebe['conversion']['for']('editingDowncast')['markerToHighlight']({'model':zs,'view':({markerName:_0x3ddf25})=>({'classes':['ck-ai-assistant-ui_theme','ck-fake-ai-selection','ck-fake-ai-selection-'+_0x3ddf25['split'](':')[0x1]],'priority':0xc})}),_0x5e3ebe['conversion']['for']('dataDowncast')['markerToElement']({'model':zs+':context','view':(_0x1c8727,{writer:_0x4712d6,options:_0x81c4df})=>_0x81c4df['convertAiChatSelectionMarker']?_0x4712d6['createUIElement'](_0x1c8727['markerName']+':'+(_0x1c8727['isOpening']?'start':'end')):null});}['showFakeVisualSelection'](_0x18ad5c){const _0x37ef0d=this['_fakeSelections'][0x0]||null;this['_addFakeSelection'](_0x18ad5c);const _0x21c4a0=this['_fakeSelections'][0x0]||null;this['_refreshFakeSelection'](_0x37ef0d,_0x21c4a0);}['hideFakeVisualSelection'](_0x483dfd){const _0x51e142=this['_fakeSelections'][0x0]||null;this['_removeFakeSelectionById'](_0x483dfd);const _0x2332b4=this['_fakeSelections'][0x0]||null;this['_refreshFakeSelection'](_0x51e142,_0x2332b4);}async['modelToDataWithIds'](_0x411c27){const _0x4c5783=$s(this['context']),_0x322633=_0x4c5783['data']['toView'](_0x411c27),_0x37c656=new _0x3fb8b8(_0x4c5783['editing']['view']['document']);return this['_setDataIdsOnChildren'](_0x322633,_0x37c656),this['_getDocumentDataStringFromView'](_0x322633,_0x4c5783);}['_setDataIdsOnChildren'](_0x2d1258,_0x567410,_0x567c48=new Set()){let _0x52b7f6=!0x1;for(const _0x59ebea of _0x2d1258['getChildren']()){if(!_0x59ebea['is']('view:element')||js['includes'](_0x59ebea['name']))continue;const _0x427ab2=_0x59ebea['is']('view:containerElement'),_0xf838f2=_0x59ebea['is']('view:emptyElement'),_0x4d303c=this['_setDataIdsOnChildren'](_0x59ebea,_0x567410,_0x567c48);if(_0x59ebea['hasAttribute']('data-id')){_0x52b7f6=!0x0,_0x567c48['add'](_0x59ebea['getAttribute']('data-id'));continue;}(_0x427ab2||_0xf838f2||_0x4d303c)&&(_0x567410['setAttribute']('data-id',this['_nextDataId'](_0x567c48),_0x59ebea),_0x52b7f6=!0x0);}return _0x52b7f6;}['_nextDataId'](_0x25b947){let _0x3ec766;do{_0x3ec766='';for(let _0x210538=0x0;_0x210538<0x4;_0x210538++)_0x3ec766+=String['fromCharCode'](0x61+Math['floor'](0x1a*Math['random']()));}while(_0x25b947['has'](_0x3ec766));return _0x25b947['add'](_0x3ec766),_0x3ec766;}['getSelectionText'](){const {model:_0x545b0f}=$s(this['context']),_0x1bca9a=_0x545b0f['document']['selection'],_0x1c1b3c=[],_0x213791=Array['from'](_0x1bca9a['getRanges']());_0x213791['sort']((_0x19a16c,_0x327d20)=>_0x19a16c['start']['isBefore'](_0x327d20['start'])?-0x1:0x1);for(const _0x513114 of _0x213791)for(const _0x269f76 of _0x513114['getItems']())_0x269f76['is']('$textProxy')?_0x1c1b3c['push'](_0x269f76['data']):_0x269f76['is']('element')&&_0x1c1b3c['length']>0x0&&'\x20'!==_0x1c1b3c[_0x1c1b3c['length']-0x1]&&_0x1c1b3c['push']('\x20');return _0x1c1b3c['length']?'\x22'+_0x1c1b3c['join']('')['trim']()+'\x22':hs(this['context']['locale'],'AI_CHAT_CONTEXT_DOCUMENT_SELECTION_LABEL');}['_removeFakeSelectionById'](_0x8f77d0){for(let _0x13b967=0x0;_0x13b967<this['_fakeSelections']['length'];_0x13b967++)if(this['_fakeSelections'][_0x13b967]['id']==_0x8f77d0)return void this['_fakeSelections']['splice'](_0x13b967,0x1);}['_addFakeSelection'](_0x4c47a4){this['_removeFakeSelectionById'](_0x4c47a4['id']),wt(this['_fakeSelections'],_0x4c47a4);}['_refreshFakeSelection'](_0x31638d,_0x10fe9c){if(_0x31638d==_0x10fe9c)return;const _0x3dcc01=_0x31638d?this['_getEditorForFakeSelection'](_0x31638d):null,_0xdcf289=_0x10fe9c?this['_getEditorForFakeSelection'](_0x10fe9c):null,_0x1b9f13=(_0x1b0a9a,_0x418c7c)=>{const _0x3e9650=_0x418c7c['model']['markers']['getMarkersGroup'](zs);for(const _0x5d78ee of _0x3e9650)_0x1b0a9a['removeMarker'](_0x5d78ee);},_0x3854cb=(_0x2fdc72,_0x9e6a35,_0x4196a5)=>{const _0x2dc9e8=_0x9e6a35['model'];for(let _0x1e4ba9=0x0;_0x1e4ba9<_0x4196a5['ranges']['length'];_0x1e4ba9++){let _0x1b4577=_0x4196a5['ranges'][_0x1e4ba9];const _0x2dceea=zs+':'+_0x4196a5['id']+':'+_0x1e4ba9;if(_0x1b4577['start']['isAtEnd']){const _0x242f0a=_0x1b4577['start']['getLastMatchingPosition'](({item:_0x128960})=>!_0x2dc9e8['schema']['isContent'](_0x128960),{'boundaries':_0x1b4577});_0x1b4577=_0x2fdc72['createRange'](_0x242f0a,_0x1b4577['end']);}_0x2fdc72['addMarker'](_0x2dceea,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x1b4577});}};_0x3dcc01&&_0xdcf289&&_0x3dcc01===_0xdcf289&&_0x10fe9c?_0x3dcc01['model']['change'](_0x4b43f0=>{_0x1b9f13(_0x4b43f0,_0x3dcc01),_0x3854cb(_0x4b43f0,_0xdcf289,_0x10fe9c);}):(_0x3dcc01&&_0x3dcc01['model']['change'](_0x5cf933=>_0x1b9f13(_0x5cf933,_0x3dcc01)),_0xdcf289&&_0x10fe9c&&_0xdcf289['model']['change'](_0x99f6d5=>_0x3854cb(_0x99f6d5,_0xdcf289,_0x10fe9c)));}['_getEditorForFakeSelection'](_0x33f97e){if(!_0x33f97e['ranges']['length'])return $s(this['context']);const _0x1266d5=_0x33f97e['ranges'][0x0]['root']['document'];return Ws(this['context'])['find'](_0x1adfd7=>_0x1adfd7['model']['document']===_0x1266d5)??$s(this['context']);}['_getMarkersInDocumentOrder'](_0x4229f7,_0x21e1c9){const _0x39a1ca=Array['from'](_0x4229f7['model']['markers']['getMarkersGroup'](zs+':context'));return(_0x21e1c9?_0x39a1ca['filter'](_0x1fa8f8=>{const _0x33f144=_0x1fa8f8['getRange']();return _0x33f144&&_0x33f144['root']['rootName']===_0x21e1c9['rootName'];}):_0x39a1ca)['sort']((_0x4cdc57,_0x799070)=>_0x4cdc57['getStart']()['isBefore'](_0x799070['getStart']())?-0x1:_0x4cdc57['getStart']()['isAfter'](_0x799070['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(_0x474661){const _0x1a686c=new AbortController();return{'promise':new Promise((_0x1968d8,_0x196629)=>{const _0x48c428=setTimeout(_0x1968d8,_0x474661);_0x1a686c['signal']['addEventListener']('abort',()=>{clearTimeout(_0x48c428),_0x196629();});}),'abortController':_0x1a686c};}class sn{['options'];['isStreaming']=!0x1;['document']=null;['nodesList']=[];['currentIndex']=0x0;['timeoutAbortController']=null;['lastUpdateTime']=0x0;constructor(_0x5873df){this['options']={'delay':_0x5873df?.['delay']??0xa,'textNodeStyle':_0x5873df?.['textNodeStyle']??'animation:\x20ck-html-streamer-fade-in\x20.3s'};}async['stream']({document:_0x38cbec,targetElement:_0x2fc8f5,abortSignal:_0x1598c9}){this['isStreaming']&&this['stop'](),_0x1598c9?.['addEventListener']('abort',this['stop']['bind'](this)),this['document']=_0x29aa2a(_0x38cbec,!0x0),this['nodesList']=this['getParsedDocumentNodeList'](),this['isStreaming']=!0x0,this['currentIndex']>this['nodesList']['length']&&(this['currentIndex']=this['nodesList']['length']);for(let _0x290d34=0x0;_0x290d34<this['currentIndex'];_0x290d34++)this['nodesList'][_0x290d34]['shouldBeStreamed']=!0x0;do{const _0x2491d3=Date['now'](),_0x5c6b1e=this['nodesList'][this['currentIndex']],_0x472162=_0x2491d3-this['lastUpdateTime'];if(_0x5c6b1e){_0x5c6b1e['shouldBeStreamed']=!0x0;let _0x119fbe=_0x5c6b1e['parent'];for(;_0x119fbe;)_0x119fbe['shouldBeStreamed']=!0x0,_0x119fbe=_0x119fbe['parent'];}if(_0x472162<this['options']['delay'])try{const {promise:_0x188919,abortController:_0x428f58}=en(this['options']['delay']-_0x472162);this['timeoutAbortController']=_0x428f58,await _0x188919;}catch(_0x348d18){return;}_0x41406e(_0x2fc8f5,'<'+_0x2fc8f5['tagName']+'>'+this['renderNode'](this['document'])+'</'+_0x2fc8f5['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:_0x2a8315}){Array['from'](_0x2a8315['querySelectorAll']('span[data-ck-html-streamer-word-chunk]'))['reverse']()['forEach'](_0x21533f=>{_0x21533f['replaceWith'](_0x21533f['childNodes'][0x0]);});}['stop'](){this['isStreaming']=!0x1,this['timeoutAbortController']&&(this['timeoutAbortController']['abort'](),this['timeoutAbortController']=null);}['renderNode'](_0x3c4bf4){let _0x12282d='';if(function(_0x4fbcae){return _0x1a821b(_0x4fbcae);}(_0x3c4bf4)){for(const _0x2e8a8a of _0x3c4bf4['children'])_0x12282d+=this['renderNode'](_0x2e8a8a);}else{if(on(_0x3c4bf4)){if(!_0x3c4bf4['shouldBeStreamed'])return'';const _0x3ea9d2=_0x3c4bf4,_0x3dc94d=Object['entries'](_0x3ea9d2['attribs'])['map'](([_0x5caab2,_0x3c0a2d])=>_0x5caab2+'=\x22'+_0x3c0a2d+'\x22')['join']('\x20');_0x12282d+='<'+_0x3ea9d2['tagName']+(_0x3dc94d?'\x20'+_0x3dc94d:'')+'>';for(const _0x231710 of _0x2c1273(_0x3ea9d2))_0x12282d+=this['renderNode'](_0x231710);_0x12282d+='</'+_0x3ea9d2['tagName']+'>';}else{if(!rn(_0x3c4bf4))return'';if(!_0x3c4bf4['shouldBeStreamed'])return'';!function(_0x24dcb9){if(!_0x24dcb9['parent']||!on(_0x24dcb9['parent']))return!0x1;if(!nn['includes'](_0x24dcb9['parent']['tagName']))return!0x1;return!_0x5adb77(_0x24dcb9)['match'](/^\s*[<>]\s*$/);}(_0x3c4bf4)?_0x12282d+=ti(_0x3c4bf4):_0x12282d+=ti(new _0x4b7733('span',{'data-ck-html-streamer-word-chunk':'','style':this['options']['textNodeStyle']},[_0x3c4bf4]));}}return _0x12282d;}['getParsedDocumentNodeList'](){const _0x186394=[];return function(_0x552e99,_0x516de8){const _0x46507e=_0xf39770=>{if(_0x516de8(_0xf39770),_0xf39770 instanceof _0x110993)for(let _0x8210ab=0x0;_0x8210ab<_0xf39770['children']['length'];_0x8210ab++){const _0x429fd1=_0xf39770['children'][_0x8210ab];_0x46507e(_0x429fd1);}};for(let _0x24e308=0x0;_0x24e308<_0x552e99['children']['length'];_0x24e308++)_0x46507e(_0x552e99['children'][_0x24e308]);}(this['document'],_0x4f8bac=>{if(rn(_0x4f8bac)){const _0x58793e=this['splitTextNodeIntoWordNodes'](_0x4f8bac);_0x58793e['length']&&_0x186394['push'](..._0x58793e);}_0x4f8bac['isWordSplitSource']||_0x4f8bac['isWordSplitResult']||_0x186394['push'](_0x4f8bac);}),_0x186394;}['splitTextNodeIntoWordNodes'](_0x429c27){if(_0x429c27['isWordSplitSource']||_0x429c27['isWordSplitResult'])return[];const _0x428454=_0x5adb77(_0x429c27)['match'](/(?:\s*\S+\s*)/g),_0x591132=[];if(_0x428454&&_0x428454['length']>0x1){for(const _0x210404 of _0x428454){const _0x49c44f=new _0x19530c(_0x210404);_0x49c44f['isWordSplitResult']=!0x0,_0x398bab(_0x429c27,_0x49c44f),_0x591132['push'](_0x49c44f);}_0x429c27['isWordSplitSource']=!0x0,_0x4da48a(_0x429c27);}return _0x591132;}}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(_0x20cd05){return _0x4e28f2(_0x20cd05);}function on(_0x14fa9e){return _0x3c6d6b(_0x14fa9e);}class an extends vt{['options'];['content']='';['htmlStreamer'];['children'];constructor(_0x44a40e){super();const _0x5690ce=this['bindTemplate'];this['set']('isDone',!0x1),this['set']('isVisible',!0x0),this['htmlStreamer']=new sn(),this['options']=_0x44a40e,this['children']=this['createCollection'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed__item',_0x5690ce['if']('isDone','ck-ai-chat__feed__item_done'),_0x5690ce['if']('isVisible','ck-hidden',_0x4e5eca=>!_0x4e5eca),'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'](_0x124466=>{_0x124466['removeAttribute']('data-id');}),this['isDone']=!0x0;}async['streamIntoElement'](_0x2647b0,_0x29f50c,_0x1dc5d4){await this['htmlStreamer']['stream']({'document':_0x2647b0,'targetElement':_0x29f50c,'abortSignal':_0x1dc5d4});}}class hn extends vt{['showChangesToggleView'];constructor(_0x8ab15a,_0x1504d3){super(_0x8ab15a),this['set']('isShowChangesToggleVisible',!0x0),this['showChangesToggleView']=new cn(_0x8ab15a),this['showChangesToggleView']['set']({'class':'ck-ai-suggestion__header__show-changes-toggle\x20ck-ai-chat-controls-button\x20'+us,'label':hs(_0x8ab15a,'AI_SUGGESTION_BUTTON_SHOW_CHANGES'),'withText':!0x0}),this['showChangesToggleView']['isOn']=_0x1504d3['showDiff'],this['showChangesToggleView']['bind']('isVisible')['to'](this,'isShowChangesToggleVisible'),this['showChangesToggleView']['bind']('icon')['to'](this['showChangesToggleView'],'isOn',_0x4652cc=>_0x4652cc?_0x54c2f0:_0x5e81fe),this['showChangesToggleView']['on']('execute',()=>{this['showChangesToggleView']['isOn']=!this['showChangesToggleView']['isOn'],this['fire']('toggleShowChanges',{'isOn':this['showChangesToggleView']['isOn']});});const _0x26b092=new xt();_0x26b092['content']=_0x5ed1d7,this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__header',!0x1===_0x1504d3['showHeader']?'ck-hidden':null]['filter'](Boolean)},'children':[_0x26b092,{'tag':'span','children':[hs(_0x8ab15a,'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':_0x13c3d0,'rejected':_0x51fda2,'outdated':_0x51fda2};class un extends vt{['stateIconView'];constructor(_0x580984){super(_0x580984);const _0x464b23=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',_0x464b23['to']('state',_0xa64881=>'ck-ai-suggestion__content-part-state_'+_0xa64881),_0x464b23['if']('isVisible','ck-hidden',_0x588c79=>!_0x588c79)]},'children':[{'tag':'span','attributes':{'class':['ck-ai-suggestion__content-part-state__label']},'children':[{'text':_0x464b23['to']('state',_0x1e98a2=>{switch(_0x1e98a2){case'accepted':return hs(_0x580984,'AI_SUGGESTION_CONTENT_PART_STATE_ACCEPTED');case'rejected':return hs(_0x580984,'AI_SUGGESTION_CONTENT_PART_STATE_REJECTED');case'outdated':return hs(_0x580984,'AI_SUGGESTION_CONTENT_PART_STATE_OUTDATED');}})}]},this['stateIconView']]});}['setState'](_0x2e3047){this['state']=_0x2e3047;}}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(_0x470338,_0x5a3fb7,_0x4893f1){super(_0x470338);const _0x13e22a=Boolean(_0x4893f1);this['set']('isEnabled',!_0x13e22a),this['set']('isVisible',!0x0),this['class']='ck-ai-suggestion-content-part-toolbar';const _0x38762f=[];if(_0x13e22a){const _0x444ed4=new Nt(_0x470338);_0x444ed4['set']({'label':hs(_0x470338,'AI_SUGGESTION_DISABLED_TOOLTIP_MESSAGE'),'tooltip':!0x0,'withText':!0x1,'icon':_0x4a37a4}),_0x444ed4['extendTemplate']({'attributes':{'data-cke-tooltip-class':'ck-ai-suggestion-content-part-disabled-actions-tooltip'}}),_0x38762f['push'](_0x444ed4);}else{_0x5a3fb7['includes']('applySuggestion')&&(this['_applyButton']=new Nt(_0x470338),this['_applyButton']['set']({'label':hs(_0x470338,'AI_SUGGESTION_CONTENT_PART_APPLY'),'tooltip':!0x0,'tooltipPosition':'n','withText':!0x1,'icon':_0x13c3d0}),this['_applyButton']['bind']('isEnabled')['to'](this),this['_applyButton']['on']('execute',()=>{this['fire']('applySuggestion');}),_0x38762f['push'](this['_applyButton'])),_0x5a3fb7['includes']('insertSuggestion')&&(this['_suggestButton']=new Nt(_0x470338),this['_suggestButton']['set']({'label':hs(_0x470338,'AI_SUGGESTION_CONTENT_PART_ADD_SUGGESTION'),'tooltip':!0x0,'tooltipPosition':'n','withText':!0x1,'icon':_0x4a5638}),this['_suggestButton']['bind']('isEnabled')['to'](this),this['_suggestButton']['on']('execute',()=>{this['fire']('insertSuggestion');}),_0x38762f['push'](this['_suggestButton']));const _0x5a7270=new Nt(_0x470338);_0x5a7270['set']({'label':hs(_0x470338,'AI_SUGGESTION_CONTENT_PART_REJECT'),'tooltip':!0x0,'tooltipPosition':'n','withText':!0x1,'icon':_0x51fda2}),_0x5a7270['bind']('isEnabled')['to'](this),_0x5a7270['on']('execute',()=>{this['fire']('rejectSuggestion');}),_0x38762f['push'](_0x5a7270);}this['items']['addMany'](_0x38762f);const _0x4f542e=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':[_0x4f542e['if']('isVisible','ck-hidden',_0xfaef3=>!_0xfaef3)]}});}['setButtonsVisibility']({showApplyButton:_0x30098f,showSuggestButton:_0x496ad0}){this['_applyButton']&&(this['_applyButton']['isVisible']=_0x30098f),this['_suggestButton']&&(this['_suggestButton']['isVisible']=_0x496ad0);}}class gn extends vt{['toolbarView'];['stateView'];['titleLabelView'];['children'];constructor(_0x8cbd0b,{part:_0x4ceb10,uiIndex:_0x20427e,availableActions:_0x1661b8,areActionsDisabled:_0xf71aa5}){super(_0x8cbd0b),this['set']('isEnabled',!0x0),this['set']('state','pending'),this['toolbarView']=new _n(_0x8cbd0b,_0x1661b8,_0xf71aa5),this['toolbarView']['on']('rejectSuggestion',()=>{this['fire']('rejectSuggestion',{'index':_0x4ceb10['index']});}),this['toolbarView']['on']('insertSuggestion',()=>{this['fire']('insertSuggestion',{'index':_0x4ceb10['index']});}),this['toolbarView']['on']('applySuggestion',()=>{this['fire']('applySuggestion',{'index':_0x4ceb10['index']});}),this['toolbarView']['bind']('isEnabled')['to'](this),this['stateView']=new un(_0x8cbd0b),this['titleLabelView']=new An(_0x8cbd0b,_0x20427e),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',(_0x244d9e,_0x3a9f6e,_0x5b8631,_0x2ba0c0)=>{'pending'===_0x2ba0c0?this['children']['remove'](this['toolbarView']):this['children']['remove'](this['stateView']),'pending'===_0x5b8631?this['children']['add'](this['toolbarView']):(this['stateView']['setState'](_0x5b8631),this['children']['add'](this['stateView']));});}}class An extends vt{constructor(_0x233eb6,_0x14bff0){super(_0x233eb6),this['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai-suggestion__body__content-part__title__label']},'children':[hs(_0x233eb6,'AI_SUGGESTION_CONTENT_PART_TITLE',_0x14bff0['toString']())]});}}class In extends vt{['htmlStreamer'];constructor(_0x4c33a8){super(_0x4c33a8),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:_0x11a097,renderingStrategy:_0x4d555c,abortSignal:_0x3ec3c2}){'streaming'===_0x4d555c?await this['htmlStreamer']['stream']({'document':_0x11a097['content'],'targetElement':this['element'],'abortSignal':_0x3ec3c2}):_0x41406e(this['element'],'<'+this['element']['tagName']+'>'+gs(_0x11a097['content'])+'</'+this['element']['tagName']+'>',{'childrenOnly':!0x0});}['clear'](){this['htmlStreamer']['reset'](),this['element']['innerHTML']='';}}class En extends vt{['_children'];['_headerView'];['_streamableContentView'];constructor(_0xf1b36a,{part:_0x4a8c19,uiIndex:_0x1408f0,areActionsDisabled:_0xb74907,availableActions:_0x47c63a}){super(_0xf1b36a);const _0x28c66c=this['bindTemplate'];this['set']('state','pending'),this['set']('isDone',!0x1),this['set']('isVisible',!0x1),this['set']('isActive',!0x1),this['set']('isEnabled',!0x1);const _0x348d48=()=>{this['isEnabled']=this['isDone']&&'pending'==this['state']&&!_0xb74907;};this['on']('change:state',_0x348d48),this['on']('change:isDone',_0x348d48),_0x348d48(),this['_children']=this['createCollection'](),this['_headerView']=new gn(_0xf1b36a,{'part':_0x4a8c19,'uiIndex':_0x1408f0,'availableActions':_0x47c63a,'areActionsDisabled':_0xb74907}),this['_headerView']['bind']('isEnabled','state')['to'](this),this['_headerView']['delegate'](...Zs)['to'](this),this['_streamableContentView']=new In(_0xf1b36a),this['_children']['addMany']([this['_headerView'],this['_streamableContentView']]),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__body__content-part',_0x28c66c['to']('state',_0xde02b6=>'ck-ai-suggestion__body__content-part_'+_0xde02b6),_0x28c66c['if']('isEnabled','ck-ai-suggestion__body__content-part_enabled'),_0x28c66c['if']('isActive','ck-ai-suggestion__body__content-part_active'),_0x28c66c['if']('isVisible','ck-hidden',_0x1e2123=>!_0x1e2123)]},'children':this['_children'],'on':{'mouseenter':_0x28c66c['to'](()=>{this['isEnabled']&&this['fire']('mouseOverSuggestion',{'index':_0x4a8c19['index']});}),'mouseleave':_0x28c66c['to'](()=>{this['isEnabled']&&this['fire']('mouseLeaveSuggestion',{'index':_0x4a8c19['index']});}),'click':_0x28c66c['to'](_0x5c8dc4=>{const _0x48ac6e=_0x5c8dc4['target'];this['isEnabled']&&!this['_headerView']['toolbarView']['element']['contains'](_0x48ac6e)&&this['fire']('showChangeInText',{'index':_0x4a8c19['index']});})}});}async['updateContent']({part:_0x19cb4a,showUnchangedParts:_0x521f69=!0x1,abortSignal:_0x338b5d}){this['partDefinition']=_0x19cb4a,this['isVisible']=this['partDefinition']['hasChanges']||_0x521f69,this['isVisible']&&await this['_streamableContentView']['update']({'part':_0x19cb4a,'renderingStrategy':'static','abortSignal':_0x338b5d});}['markAsDone'](){this['isDone']=!0x0;}}class pn extends vt{constructor(_0x218805,_0x21bc53){super(_0x218805),this['set']('isVisible',!0x0),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-skeleton',this['bindTemplate']['if']('isVisible','ck-hidden',_0x20e9aa=>!_0x20e9aa)]},'children':this['_createSkeletonItems'](_0x21bc53)});}['_createSkeletonItems'](_0x23aa8d){const _0x300f03=['ck','ck-ai-skeleton__item'];return _0x23aa8d['map'](_0x24d670=>{let _0x2a5c7d='';switch(_0x24d670['attributes']['align']){case'right':_0x2a5c7d='margin-left:\x20auto;\x20margin-right:\x200;\x20text-align:\x20right;';break;case'center':_0x2a5c7d='margin-left:\x20auto;\x20margin-right:\x20auto;\x20text-align:\x20center;';break;case'left':_0x2a5c7d='margin-left:\x200;\x20margin-right:\x20auto;\x20text-align:\x20left;';}return{'tag':_0x24d670['tag'],'attributes':{'class':[..._0x300f03,_0x24d670['attributes']['class']?_0x24d670['attributes']['class']:''],'style':'width:\x20'+_0x24d670['attributes']['width']+';\x20height:\x20'+_0x24d670['attributes']['height']+';'+_0x2a5c7d}};});}}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(_0x179e76,_0x6ee577,_0x4f3161,_0x421527){return new Array(_0x179e76)['fill'](null)['map'](()=>({'tag':'div','attributes':{'width':_0x6ee577,'height':_0x4f3161,'align':_0x421527}}));}class Cn extends Tt(){['queue']=[];['isProcessing']=!0x1;['_abortController'];async['enqueue'](_0xd52370){const _0x11f613=this['createTask'](_0xd52370);return this['queue']['push'](_0x11f613),this['_processQueue'](),_0x11f613['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(_0x347005=>{this['once']('_queueEmpty',()=>{_0x347005();});}):Promise['resolve']();}async['_processQueue'](){if(!this['isProcessing']){this['_abortController']=new AbortController(),this['isProcessing']=!0x0;try{for(;this['queue']['length']&&this['isProcessing'];){const _0x13f2ff=this['queue']['shift']();try{await _0x13f2ff['callback'](this['_abortController']['signal']),_0x13f2ff['resolve']();}catch(_0x3bc26f){_0x13f2ff['reject'](_0x3bc26f);}}}finally{this['isProcessing']=!0x1,this['_abortController']=void 0x0;}this['fire']('_queueEmpty');}}['createTask'](_0x552375){let _0x8fe7a,_0x236fe1;const _0x45849d=new Promise((_0x165f67,_0x574a9a)=>{_0x8fe7a=_0x165f67,_0x236fe1=_0x574a9a;});return{'callback':_0x552375,'resolve':_0x8fe7a,'reject':_0x236fe1,'completePromise':_0x45849d};}}class wn extends an{constructor(_0x735ae4){super(_0x735ae4),this['extendTemplate']({'attributes':{'class':['ck-ai-notification','warning'===_0x735ae4['level']?'ck-ai-notification_warning':'ck-ai-notification_error']}});}['render'](){super['render'](),this['setContent'](this['options']['initialContent']),this['markAsDone']();}['setContent'](_0x3e3827){this['element']['innerHTML']=_0x3e3827;}}const fn=['applySuggestion','insertSuggestion'];class bn extends vt{['_applyChangesButton'];['_insertSuggestionsButton'];['children'];constructor(_0x29ba76,_0x3485ed=[...fn],_0x17b5a6){super(_0x29ba76);const _0x2f1705=this['bindTemplate'],_0x1a4438=Boolean(_0x17b5a6);if(this['set']('isEnabled',!_0x1a4438),this['set']('isVisible',!0x1),this['set']('isTrackChangesOn',!0x1),this['children']=this['createCollection'](),_0x1a4438){const _0x5ca118=new Nt(_0x29ba76);_0x5ca118['set']({'label':hs(_0x29ba76,'AI_SUGGESTION_DISABLED_TOOLTIP_MESSAGE'),'tooltip':!0x0,'withText':!0x1,'icon':_0x4a37a4}),_0x5ca118['extendTemplate']({'attributes':{'data-cke-tooltip-class':'ck-ai-suggestion-content-part-disabled-actions-tooltip'}});const _0x435d2c=new vt(_0x29ba76);_0x435d2c['setTemplate']({'tag':'div','attributes':{'class':'ck-ai-chat__feed__suggestion__actions__info'},'children':[{'tag':'p','children':[hs(_0x29ba76,'AI_SUGGESTION_DISABLED_FEED_MESSAGE'),_0x5ca118]}]}),this['children']['add'](_0x435d2c);}else this['_applyChangesButton']=new Nt(_0x29ba76),this['_applyChangesButton']['set']({'label':hs(_0x29ba76,'AI_CHAT_SUGGESTION_ACTION_APPLY_ALL'),'withText':!0x0,'type':'button','isVisible':_0x3485ed['includes']('applySuggestion'),'class':cs}),this['_insertSuggestionsButton']=new Nt(_0x29ba76),this['_insertSuggestionsButton']['set']({'label':hs(_0x29ba76,'AI_CHAT_SUGGESTION_ACTION_SUGGEST_ALL'),'withText':!0x0,'type':'button','isVisible':_0x3485ed['includes']('insertSuggestion'),'class':ls}),this['_insertSuggestionsButton']['on']('execute',()=>{this['fire']('insertSuggestion');}),this['_applyChangesButton']['on']('execute',()=>{this['fire']('applySuggestion');}),[this['_applyChangesButton'],this['_insertSuggestionsButton']]['forEach'](_0x58c249=>{_0x58c249['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',_0x2f1705['if']('isVisible','ck-hidden',_0x4451e7=>!_0x4451e7)]},'children':this['children']}),this['on']('change:isTrackChangesOn',()=>{this['_applyChangesButton']&&(this['_applyChangesButton']['isVisible']=!this['isTrackChangesOn']);});}['updateVisibility'](_0x4f0183){this['isVisible']=_0x4f0183;}['_switchButtonLabelsPlurality'](_0x144177){this['_applyChangesButton']&&this['_insertSuggestionsButton']&&(_0x144177?(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(_0x404ef2,_0x36a8a5){super(_0x404ef2),this['bodyCollection']=_0x36a8a5,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',_0x3ee41c=>!_0x3ee41c)]},'children':this['children']});const _0x548308=new vt(this['locale']),_0xf4202=new xt();_0xf4202['content']=_0x4cfbb8,_0x548308['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-web-sources__header']},'children':[_0xf4202,{'tag':'span','children':[{'text':hs(this['locale'],'AI_CHAT_SOURCES_HEADER')}]}]}),this['children']['add'](_0x548308),this['_setupBalloonPanel'](_0x404ef2);}['addSource'](_0x3d2ca0){this['children']['add'](new Rn(this['locale'],_0x3d2ca0,this['balloonPanelView']));}['_setupBalloonPanel'](_0x2d5a2f){this['balloonPanelView']=new Xt(_0x2d5a2f),this['balloonPanelView']['extendTemplate']({'attributes':{'class':['ck-ai-web-source__tooltip-balloon']}}),this['bodyCollection']['add'](this['balloonPanelView']);}}class Rn extends Nt{['balloonPanelView'];['source'];constructor(_0x535aae,_0x40ff73,_0x4310c6){super(_0x535aae),this['source']=_0x40ff73,this['balloonPanelView']=_0x4310c6,this['set']({'label':_0x40ff73['title'],'class':['ck\x20ck-ai-web-source'],'withText':!0x0});const _0xa9bcc5=this['bindTemplate'];if(this['extendTemplate']({'on':{'click':_0xa9bcc5['to'](()=>{window['open'](_0x40ff73['url'],'_blank');}),'mouseenter':_0xa9bcc5['to'](()=>{this['_showTooltip']();}),'mouseleave':_0xa9bcc5['to'](()=>{this['_hideTooltip']();})}}),_0x40ff73['favicon']){const _0x485c9c=new vt(_0x535aae);_0x485c9c['setTemplate']({'tag':'img','attributes':{'src':_0x40ff73['favicon']||_0x4cfbb8,'alt':_0x40ff73['title'],'class':['ck-ai-web-source__image']}}),this['children']['add'](_0x485c9c);}else this['set']('icon',_0x4cfbb8);}['_createTooltipContentView'](_0x26596f,_0x324b3d){const _0x5a5e96=new vt(_0x26596f),_0x4738d3=[];let _0x45f2cf;_0x324b3d?.['favicon']?(_0x45f2cf=new vt(_0x26596f),_0x45f2cf['setTemplate']({'tag':'img','attributes':{'src':_0x324b3d['favicon'],'alt':_0x324b3d['title'],'class':['ck-ai-web-source__tooltip-image']}})):(_0x45f2cf=new xt(),_0x45f2cf['content']=_0x4cfbb8,_0x45f2cf['extendTemplate']({'attributes':{'alt':_0x324b3d['title'],'class':['ck-ai-web-source__tooltip-image']}})),_0x4738d3['push'](_0x45f2cf);const _0x1b637e=new vt(_0x26596f);_0x1b637e['setTemplate']({'tag':'a','attributes':{'class':['ck-ai-web-source__tooltip-url'],'href':_0x324b3d['url']},'children':[{'text':new URL(_0x324b3d['url'])?.['hostname']}]}),_0x4738d3['push'](_0x1b637e);const _0x3a1bc0=new vt(_0x26596f);_0x3a1bc0['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-web-source__tooltip-row']},'children':_0x4738d3});const _0x3cd962=new vt(_0x26596f);return _0x3cd962['setTemplate']({'tag':'span','attributes':{'class':['ck-ai-web-source__tooltip-row','ck-ai-web-source__tooltip-title']},'children':[{'text':_0x324b3d['title']['length']>0x190?_0x324b3d['title']['substring'](0x0,0x190)+'...':_0x324b3d['title']}]}),_0x5a5e96['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-web-source__tooltip']},'children':[_0x3a1bc0,_0x3cd962]}),_0x5a5e96;}['_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 _0x1dc37d=this['_createTooltipContentView'](this['locale'],this['source']);this['balloonPanelView']['content']['add'](_0x1dc37d);}}class On extends vt{['_actionsView'];['_sourcesView'];['_children'];['_skeletonView'];['_showSkeletonDebounced']=_0xbdcb87(()=>{this['_skeletonView']['isVisible']=!0x0,this['_skeletonShownAt']=Date['now']();},0x3e8);['_skeletonShownAt']=null;['_areActionsDisabled'];['_showUnchangedParts'];['_updateContentPartsPromiseQueue'];['_emptyPartsWarningView'];['_availableActions'];['_cachedContentParts']=[];constructor(_0x22fc1e,_0x243011){super(_0x22fc1e);const {areActionsDisabled:_0x439e5e,showUnchangedParts:_0x5dde6e,availableActions:_0x28243c}=_0x243011;this['_areActionsDisabled']=_0x439e5e,this['_showUnchangedParts']=_0x5dde6e,this['_availableActions']=_0x28243c,this['set']('hasPendingParts',!0x1),this['set']('isTrackChangesOn',!0x1),this['_children']=this['createCollection'](),this['_skeletonView']=new pn(_0x22fc1e,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(_0x22fc1e,'AI_SUGGESTION_EMPTY_PART_WARNING'),'level':'warning'}),this['_emptyPartsWarningView']['isVisible']=!0x1,this['_actionsView']=new bn(_0x22fc1e,_0x243011['availableActions'],this['_areActionsDisabled']),this['_actionsView']['bind']('isTrackChangesOn')['to'](this),this['_sourcesView']=new Sn(this['locale'],_0x243011['bodyCollection']),_0x243011['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'](_0x385a9e=>_0x385a9e instanceof En);}async['updateContentParts']({parts:_0x31e67a,abortSignal:_0x2afb04,skipLoadingEffects:_0x7399ce}){this['_cachedContentParts']['length']?_0x31e67a['forEach'](_0x100429=>{const _0x107a61=this['_cachedContentParts']['findIndex'](_0x273054=>_0x273054['index']==_0x100429['index']);-0x1===_0x107a61?this['_cachedContentParts']['push'](_0x100429):this['_cachedContentParts'][_0x107a61]=_0x100429;}):this['_cachedContentParts']=_0x31e67a;const _0x3d8a3e=this['_showUnchangedParts']?_0x31e67a:_0x31e67a['filter'](_0x268350=>_0x268350['hasChanges']);this['_actionsView']['_switchButtonLabelsPlurality'](_0x3d8a3e['length']>0x1),_0x7399ce&&(this['_showSkeletonDebounced']['cancel'](),this['_skeletonView']['isVisible']=!0x1);for(const _0xb2ce48 of _0x3d8a3e)this['_updateContentPartsPromiseQueue']['enqueue'](async _0xb0c4ea=>{let _0x496fad=this['getPartView'](_0xb2ce48['index']);if(!_0x496fad){if(_0x496fad=new En(this['locale'],{'part':_0xb2ce48,'uiIndex':this['_contentPartViews']['length']+0x1,'areActionsDisabled':this['_areActionsDisabled'],'availableActions':this['_availableActions']}),_0x496fad['delegate'](...Zs)['to'](this),!_0x7399ce&&(this['_showSkeletonDebounced']['cancel'](),await this['_awaitMinimumSkeletonDisplayTime'](_0xb0c4ea),_0xb0c4ea['aborted']))return;this['_skeletonView']['isVisible']=!0x1,this['_children']['add'](_0x496fad,this['_children']['length']-0x1),this['hasPendingParts']=!0x0,_0x7399ce||this['_showSkeletonDebounced']();}await _0x496fad['updateContent']({'part':_0xb2ce48,'showUnchangedParts':this['_showUnchangedParts'],'abortSignal':_0xb0c4ea}),_0x496fad['markAsDone']();});return _0x2afb04?.['addEventListener']('abort',()=>{this['_updateContentPartsPromiseQueue']['abort'](),this['_showSkeletonDebounced']['cancel'](),this['_skeletonView']['isVisible']=!0x1;}),this['_updateContentPartsPromiseQueue']['queueEmptyPromise'];}['updatePartState'](_0x5c6aa2,_0x5a1e4b){const _0x5d7e36=this['getPartView'](_0x5c6aa2);_0x5d7e36&&(_0x5d7e36['state']=_0x5a1e4b),this['hasPendingParts']='pending'==_0x5a1e4b||this['_contentPartViews']['some'](_0xdd01a6=>'pending'==_0xdd01a6['state']);}['setPartActive'](_0x15d3b0,_0x10e886){if(!0x1===_0x15d3b0){for(const _0x2e382e of this['_contentPartViews'])_0x2e382e['isActive']=!0x1;}else{const _0xc88f39=this['getPartView'](_0x15d3b0);_0xc88f39&&(_0xc88f39['isActive']=_0x10e886);}}['updateSources'](_0x129103){_0x129103['forEach'](_0x36c40f=>this['_sourcesView']['addSource'](_0x36c40f)),this['_sourcesView']['isVisible']=!0x0;}['getPartView'](_0x341b5c){return this['_contentPartViews']['find'](_0xc1d6df=>_0xc1d6df['partDefinition']['index']==_0x341b5c)??null;}['markAsDone'](){if(!this['_showUnchangedParts']){const _0x278193=!this['_cachedContentParts']['find'](({hasChanges:_0x36e047})=>_0x36e047),_0x531e5f=!!this['_cachedContentParts']['find'](({hasChanges:_0x1622dc})=>!_0x1622dc);this['_emptyPartsWarningView']['isVisible']=0x0==this['_contentPartViews']['length']||_0x531e5f,_0x278193?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'](_0x3c6705=>_0x3c6705['markAsDone']()),this['_skeletonView']['isVisible']=!0x1,this['_showSkeletonDebounced']['cancel'](),this['_actionsView']['updateVisibility'](this['hasNonEmptyParts']);}async['_awaitMinimumSkeletonDisplayTime'](_0x5bfa15){if(!this['_skeletonView']['isVisible']||null===this['_skeletonShownAt'])return;const _0x28e63b=0x3e8-(Date['now']()-this['_skeletonShownAt']);if(this['_skeletonShownAt']=null,_0x28e63b>0x0){const {promise:_0x372bce,abortController:_0x44d38a}=en(_0x28e63b);_0x5bfa15?.['addEventListener']('abort',()=>_0x44d38a['abort']()),await _0x372bce['catch'](()=>{});}}get['hasNonEmptyParts'](){return this['_contentPartViews']['filter'](_0x16e12b=>_0x16e12b['partDefinition']['hasChanges'])['length']>0x0;}}class kn extends vt{['bodyView'];['children'];['headerView'];constructor(_0xf5dea1,_0x3169f2,_0x11176b){super(_0xf5dea1);const {showDiff:_0x5bebb9,areActionsDisabled:_0x54038f,showUnchangedParts:_0x43900c,availableActions:_0x106adc}=_0x3169f2;this['set']('isTrackChangesOn',!0x1),this['set']('areChangesVisible',!0x1),this['children']=this['createCollection'](),this['headerView']=new hn(_0xf5dea1,{'showDiff':_0x5bebb9}),this['headerView']['on']('toggleShowChanges',(_0x21cc72,_0xe83655)=>{this['areChangesVisible']=_0xe83655['isOn'],this['fire']('toggleSuggestionDisplayMode',{'showDiff':_0xe83655['isOn']});}),this['children']['add'](this['headerView']),this['bodyView']=new On(_0xf5dea1,{'areActionsDisabled':_0x54038f,'showUnchangedParts':!!_0x43900c,'availableActions':_0x106adc,'bodyCollection':_0x11176b}),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'](_0x445559){await this['bodyView']['updateContentParts'](_0x445559);}['updateSources'](_0x2d33ef){this['bodyView']['updateSources'](_0x2d33ef);}['markAsDone'](){this['bodyView']['markAsDone'](),this['headerView']&&(this['headerView']['isShowChangesToggleVisible']=this['bodyView']['hasNonEmptyParts']);}}class Nn extends an{['containerView'];constructor(_0x144651,_0x4c1be8,_0x4e2c7a){super(_0x4c1be8),this['set']('isTrackChangesOn',!0x1),this['containerView']=new kn(_0x144651,{'showDiff':_0x4c1be8['showDiff'],'areActionsDisabled':_0x4c1be8['areActionsDisabled'],'availableActions':_0x4c1be8['availableActions']},_0x4e2c7a),this['containerView']['on']('toggleSuggestionDisplayMode',(_0x5ee469,_0x4c9314)=>{this['fire']('toggleSuggestionDisplayMode',{'replyId':this['options']['id'],'showDiff':_0x4c9314['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',(_0x3c06e4,{index:_0x5dd211})=>{this['fire']('showChangeInText',{'replyId':this['options']['id'],'partIndex':_0x5dd211});}),this['containerView']['on']('applySuggestion',(_0x4a2f89,{index:_0x1f55ab}={})=>{this['fire']('applySuggestion',{'replyId':this['options']['id'],'partIndex':_0x1f55ab});}),this['containerView']['on']('insertSuggestion',(_0x581dbb,{index:_0x5163a9}={})=>{this['fire']('insertSuggestion',{'replyId':this['options']['id'],'partIndex':_0x5163a9});}),this['containerView']['on']('rejectSuggestion',(_0x3a6c23,{index:_0x1aafe7})=>{this['fire']('rejectSuggestion',{'replyId':this['options']['id'],'partIndex':_0x1aafe7});}),this['containerView']['on']('mouseOverSuggestion',(_0xc7fbd3,{index:_0x3875a5})=>{this['fire']('mouseOverSuggestion',{'replyId':this['options']['id'],'partIndex':_0x3875a5});}),this['containerView']['on']('mouseLeaveSuggestion',(_0x5946d6,{index:_0x5d66b2})=>{this['fire']('mouseLeaveSuggestion',{'replyId':this['options']['id'],'partIndex':_0x5d66b2});}),this['children']['addMany']([this['containerView']]),this['extendTemplate']({'attributes':{'class':['ck-ai-chat__feed__ai-suggestion']}});}async['updateContent'](_0x598e82){await this['containerView']['updateContent'](_0x598e82);}['updatePartState'](_0x3b7feb,_0x19c0a5){this['containerView']['bodyView']['updatePartState'](_0x3b7feb,_0x19c0a5);}['setPartActive'](_0x4e5f75,_0x2ea6e8){!0x1===_0x4e5f75?this['containerView']['bodyView']['setPartActive'](!0x1):this['containerView']['bodyView']['setPartActive'](_0x4e5f75,_0x2ea6e8);}['updateSources'](_0x481c75){this['containerView']['updateSources'](_0x481c75);}['getPartView'](_0x2e1e7f){return this['containerView']['bodyView']['getPartView'](_0x2e1e7f);}['markAsDone'](){super['markAsDone'](),this['containerView']['markAsDone']();}}class vn extends an{['replyContainer'];['_bodyCollection'];constructor(_0x2955a8,_0x463bb5,_0x39c893){super(_0x463bb5),this['_bodyCollection']=_0x39c893,this['locale']=_0x2955a8,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:_0x42df1e,renderingStrategy:_0x396780,abortSignal:_0x42cf3d}){'streaming'===_0x396780?await this['streamIntoElement'](_0x42df1e,this['replyContainer']['element'],_0x42cf3d):this['replyContainer']['element']['innerHTML']=ti(_0x42df1e);}['updateSources'](_0x4dc891){const _0x9c77b0=new Sn(this['locale'],this['_bodyCollection']);_0x9c77b0['children']['addMany'](_0x4dc891['map'](_0x191842=>new Rn(this['locale'],_0x191842,_0x9c77b0['balloonPanelView']))),_0x9c77b0['isVisible']=!0x0,this['children']['add'](_0x9c77b0);}}class yn extends yt{constructor(_0x21bfaa=void 0x0){super();const _0x4f0f53=_0x21bfaa?'ck-ai-spinner_'+_0x21bfaa:'';this['extendTemplate']({'tag':'span','attributes':{'class':['ck-ai-spinner',_0x4f0f53]}});}}const xn={'file':_0xe24ff3,'document':_0x5ed1d7,'web-resource':_0x4ec276,'text':_0xe24ff3,'selection':_0x5daf20,'mcp-tool-context':_0x5ed1d7},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(_0x3fd8ca,_0x13fe5a,_0x3eb8e7,_0x400a0d,_0x1f5f19=!0x1){super(_0x3fd8ca),this['_isAnimationOnEnterEnabled']=_0x400a0d,this['_initializeProperties'](_0x13fe5a,_0x3eb8e7,_0x1f5f19),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'](_0x5d33c8,_0x29cf9a,_0x4e1cd4){this['set']('label',_0x5d33c8['label']),this['set']('tooltip',!0x0),this['set']('itemType',_0x5d33c8['type']),this['set']('id',_0x5d33c8['uiId']),this['set']('readonly',_0x29cf9a),this['set']('isLoading',_0x4e1cd4);}['_setupTemplate'](){const _0x50035b=this['_createIconView'](),_0x2a0c15=this['_createRemoveButton'](),_0x16e152=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':this['_createTemplateAttributes'](_0x16e152),'children':this['_createTemplateChildren'](_0x50035b,_0x2a0c15,_0x16e152)});}['_createTemplateAttributes'](_0x595cd0){return{'class':[Ln,_0x595cd0['if']('itemType',Pn,_0x1b043b=>'document'==_0x1b043b),_0x595cd0['if']('itemType',Dn,_0x2d1f28=>'selection'==_0x2d1f28)],'data-cke-tooltip-text':_0x595cd0['to']('label',Gn),'data-cke-tooltip-position':Vn,'data-cke-tooltip-class':Un};}['_createTemplateChildren'](_0x321595,_0x5bf99f,_0x2512ff){const _0x4f7e2f=this['_createLabelElement'](_0x2512ff),_0x1a13b3=this['_createLoaderIcon']();return this['readonly']?[_0x321595,_0x4f7e2f]:[_0x321595,_0x1a13b3,_0x4f7e2f,_0x5bf99f];}['_createLabelElement'](_0x1aac0d){return{'tag':'span','attributes':{'class':Hn},'children':[{'text':_0x1aac0d['to']('label')}]};}['_createRemoveButton'](){const _0x59af37=new Nt(this['locale']);return _0x59af37['set']({'label':hs(this['locale'],'AI_CHAT_CONTEXT_REMOVE_FROM_CONTEXT'),'icon':_0xf8dc71}),this['_setupRemoveButtonEvent'](_0x59af37),_0x59af37;}['_setupRemoveButtonEvent'](_0x13d568){_0x13d568['on']('execute',()=>{this['fire']('removeContextItemChip',this['id']);});}['_createIconView'](){const _0x450074=this['bindTemplate'],_0x12cc38=new xt();return _0x12cc38['content']=xn[this['itemType']],_0x12cc38['extendTemplate']({'attributes':{'class':[Mn,_0x450074['if']('isLoading','ck-hidden',_0x4eb73b=>_0x4eb73b)]}}),_0x12cc38;}['_handleAnimationEndOnce'](_0x2b5ac1,_0x1135b1){if(!_0x2b5ac1)return;const _0x2cf4b2=()=>{_0x1135b1(),_0x2b5ac1['removeEventListener']('animationend',_0x2cf4b2),_0x2b5ac1['removeEventListener']('webkitAnimationEnd',_0x2cf4b2);};_0x2b5ac1['addEventListener']('animationend',_0x2cf4b2),_0x2b5ac1['addEventListener']('webkitAnimationEnd',_0x2cf4b2);}['_createLoaderIcon'](){const _0xe29210=new yn('small');return _0xe29210['bind']('isVisible')['to'](this,'isLoading',_0x59a911=>_0x59a911),_0xe29210;}}function Gn(_0x210e88){if(!_0x210e88)return _0x210e88;if(_0x210e88['length']<=0x78)return _0x210e88;const _0xc8d13e=_0x210e88['slice'](0x0,0x78),_0x2eb48e=_0xc8d13e['lastIndexOf']('\x20');return(_0x2eb48e>0x0?_0xc8d13e['slice'](0x0,_0x2eb48e):_0xc8d13e)+'…';}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(_0x5f4c3b,_0x3724a5,_0x13332d,_0x368949,_0x5eb612){this['_locale']=_0x5f4c3b,this['_visibleChips']=_0x3724a5,this['_config']={...Fn,..._0x13332d,'cssClasses':{'controlsButton':'','calculationContainer':'ck-calculation-container',..._0x13332d['cssClasses']}},this['_overflowChips']=new dt(),this['_bodyCollection']=_0x368949,this['_parentView']=_0x5eb612||null;}['setContainerElement'](_0x4fb600){this['_intersectionObserver']&&(this['_intersectionObserver']['disconnect'](),this['_intersectionObserver']=null),this['_containerElement']=_0x4fb600,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 _0x33424c=[...this['_visibleChips'],...this['_overflowChips']],_0x182a43=this['_createCalculationContainer'](),_0x2bd46c=this['_calculateOverflowInContainer'](_0x182a43,_0x33424c),_0x5a1177=_0x182a43['_ancestorsToRestore'];_0x5a1177&&this['_restoreAncestorVisibility'](_0x5a1177),_0x182a43['remove'](),this['_applyOverflowResults'](_0x33424c,_0x2bd46c);}['_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 _0x354690=new Nt(this['_locale']);_0x354690['set']({'label':'','withText':!0x0,'isToggleable':!0x0});const _0x3e2218=[this['_config']['cssClasses']['showMoreButton']];return this['_config']['cssClasses']['controlsButton']&&_0x3e2218['push'](this['_config']['cssClasses']['controlsButton']),_0x354690['extendTemplate']({'attributes':{'class':_0x3e2218}}),_0x354690;}['_createShowMoreBalloonPanelView'](){const _0x53b033=new Xt(this['_locale']);return _0x53b033['extendTemplate']({'attributes':{'class':this['_config']['cssClasses']['showMoreBalloon']}}),this['_bodyCollection']['add'](_0x53b033),_0x53b033;}['_updateBalloonContent'](){if(this['_showMoreBalloonPanelView']&&(this['_showMoreBalloonPanelView']['content']['clear'](),this['_overflowChips']['length']>0x0)){this['_overflowChips']['forEach'](_0x3b0b18=>{_0x3b0b18['disableAnimationOnEnter']();});const _0x2afad6=new vt(this['_locale']);_0x2afad6['setTemplate']({'tag':'div','attributes':{'class':this['_config']['cssClasses']['overflowContainer']},'children':this['_overflowChips']}),this['_showMoreBalloonPanelView']['content']['add'](_0x2afad6);}}['_handleShowMoreButtonClick'](){this['_showMoreButtonView']['isOn']?this['hideBalloonPanel']():this['showBalloonPanel']();}['_updateShowMoreButtonVisibility'](){const _0x45612c=this['_overflowChips']['length']>0x0;this['_showMoreButtonView']?.['element']&&(this['_showMoreButtonView']['element']['style']['display']=_0x45612c?'':'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'](_0xf412da){const _0x2b9804=this['_containerElement']?.['tagName']['toLowerCase']()||'div',_0x4d14cb=this['_containerElement']?.['classList'];if(_0x4d14cb){const _0xa9d7c=_0x4d14cb[0x0]||'',_0xa69f92=_0xf412da['querySelector']('.'+_0xa9d7c),_0x4a3300=_0xf412da['querySelector'](_0x2b9804);return _0xa69f92||_0x4a3300||_0xf412da;}return _0xf412da['querySelector'](_0x2b9804)||_0xf412da;}['_calculateContainerWidth'](){const _0x15e7b2=this['_parentView']?.['element']||this['_containerElement'];if(!_0x15e7b2)return Kn;const _0x387485=window['getComputedStyle'](_0x15e7b2)['width'];if('auto'===_0x387485||'0px'===_0x387485||!_0x387485){const _0x1fe677=_0x15e7b2['parentElement'];if(_0x1fe677){const _0x5cccd6=window['getComputedStyle'](_0x1fe677);return'auto'!==_0x5cccd6['width']?_0x5cccd6['width']:Kn;}return Kn;}return _0x387485;}['_applyCalculationStyles'](_0x3d8392,_0x34875f){this['_config']['cssClasses']['calculationContainer']&&_0x3d8392['classList']['add'](this['_config']['cssClasses']['calculationContainer']),_0x3d8392['style']['width']=_0x34875f,_0x3d8392['style']['position']='absolute',_0x3d8392['style']['top']='-9999px',_0x3d8392['style']['left']='-9999px',_0x3d8392['style']['opacity']='0',_0x3d8392['style']['pointerEvents']='none',_0x3d8392['style']['zIndex']='-1',_0x3d8392['style']['visibility']='visible\x20!important',_0x3d8392['style']['display']='block\x20!important',_0x3d8392['style']['boxSizing']='border-box';}['_restoreAncestorVisibility'](_0xd2a90){_0xd2a90['forEach'](({element:_0x50588c,originalDisplay:_0x5b8c81,originalVisibility:_0x32c80a})=>{_0x50588c['style']['display']=_0x5b8c81,_0x50588c['style']['visibility']=_0x32c80a;});}['_makeAncestorsVisible'](_0x4aae5f){const _0x73ce24=[];let _0x627be7=_0x4aae5f;for(;_0x627be7&&_0x627be7!==document['body'];){const _0x427406=window['getComputedStyle'](_0x627be7);'none'!==_0x427406['display']&&'hidden'!==_0x427406['visibility']||(_0x73ce24['push']({'element':_0x627be7,'originalDisplay':_0x627be7['style']['display'],'originalVisibility':_0x627be7['style']['visibility']}),_0x627be7['style']['display']='block',_0x627be7['style']['visibility']='visible'),_0x627be7=_0x627be7['parentElement'];}return _0x73ce24;}['_createContainerElements'](){let _0x26c817,_0x37ca30;return this['_parentView']?.['element']?(_0x26c817=this['_parentView']['element']['cloneNode'](!0x0),_0x37ca30=this['_findTargetContainer'](_0x26c817)):(_0x26c817=document['createElement']('div'),_0x37ca30=_0x26c817),{'calculationContainer':_0x26c817,'targetContainer':_0x37ca30};}['_createCalculationContainer'](){const {calculationContainer:_0x8547eb,targetContainer:_0x5c387e}=this['_createContainerElements'](),_0x4ce97b=this['_calculateContainerWidth']();this['_applyCalculationStyles'](_0x8547eb,_0x4ce97b);const _0x45ee92=this['_parentView']?.['element']||this['_containerElement'],_0x4939ef=_0x45ee92?.['parentElement'];_0x4939ef?_0x4939ef['appendChild'](_0x8547eb):document['body']['appendChild'](_0x8547eb),_0x8547eb['_targetContainer']=_0x5c387e;const _0x1c8c4c=this['_makeAncestorsVisible'](_0x4939ef||null);return _0x8547eb['offsetWidth'],_0x8547eb['_ancestorsToRestore']=_0x1c8c4c,_0x8547eb;}['_calculateOverflowInContainer'](_0x190172,_0xf54ca9){const _0x3e77cb=_0x190172['_targetContainer']||_0x190172,_0x41870c=[],{rowCount:_0x70e001}=this['_renderChipsAndCountRows'](_0x3e77cb,_0xf54ca9);if(_0x70e001<=this['_config']['maxVisibleRows'])return _0x41870c;const _0x3dc999=_0xf54ca9['slice']();for(;_0x3dc999['length']>0x0;){if(this['_testButtonFit'](_0x190172,_0x3e77cb,_0x3dc999)){const _0x148974=_0xf54ca9['filter'](_0x3cf03c=>!_0x3dc999['includes'](_0x3cf03c));_0x41870c['push'](..._0x148974);break;}if(!_0x3dc999['pop']())break;}return _0x41870c;}['_renderChipsAndCountRows'](_0x1ae380,_0x59acd6){_0x1ae380['innerHTML']='',_0x59acd6['forEach'](_0x15b8a9=>{if(_0x15b8a9['element']){const _0x20d3b3=_0x15b8a9['element']['cloneNode'](!0x0);_0x1ae380['appendChild'](_0x20d3b3);}}),_0x1ae380['offsetWidth'];const _0x1ab830=_0x1ae380['children'],_0x3a4437=[];return Array['from'](_0x1ab830)['forEach'](_0x15c5e2=>{const _0x3cb3f5=_0x15c5e2['getBoundingClientRect']()['top'];_0x3a4437['some'](_0x4c872a=>Math['abs'](_0x4c872a-_0x3cb3f5)<this['_config']['rowDetectionTolerance'])||_0x3a4437['push'](_0x3cb3f5);}),{'rowCount':_0x3a4437['length']};}['_createMockButton'](){const _0x42bd1a=document['createElement']('button');return _0x42bd1a['className']=this['_config']['cssClasses']['showMoreButton'],this['_config']['cssClasses']['controlsButton']&&_0x42bd1a['classList']['add'](this['_config']['cssClasses']['controlsButton']),_0x42bd1a['textContent']='+\x201',_0x42bd1a;}['_testButtonFit'](_0x541ea8,_0x2b09a4,_0x4fa168){this['_renderChipsAndCountRows'](_0x2b09a4,_0x4fa168);const _0x2cdf6d=this['_createMockButton']();_0x541ea8['appendChild'](_0x2cdf6d),_0x541ea8['offsetWidth'];const _0x7a4a3c=[..._0x2b09a4['children'],_0x2cdf6d],_0x8c1e34=[];_0x7a4a3c['forEach'](_0x72c369=>{const _0x3d594a=_0x72c369['getBoundingClientRect']()['top'];_0x8c1e34['some'](_0x1c2242=>Math['abs'](_0x1c2242-_0x3d594a)<this['_config']['rowDetectionTolerance'])||_0x8c1e34['push'](_0x3d594a);});const _0x4cc424=_0x8c1e34['length'];return _0x2cdf6d['remove'](),_0x4cc424<=this['_config']['maxVisibleRows'];}['_distributeChips'](_0x1d74a5,_0x541840){this['_visibleChips']['clear'](),this['_overflowChips']['clear'](),_0x1d74a5['forEach'](_0x29f279=>{_0x541840['includes'](_0x29f279)?this['_overflowChips']['add'](_0x29f279):this['_visibleChips']['add'](_0x29f279);});}['_updateOverflowUI'](_0x4a272e){if(_0x4a272e>0x0&&!this['_showMoreButtonView']&&this['_createShowMoreButton'](),_0x4a272e>0x0&&this['_showMoreButtonView']){const _0x5e5fea=''+this['_config']['showMoreLabelPrefix']+(_0x4a272e<0x63?_0x4a272e:'99');this['_showMoreButtonView']['label']=_0x5e5fea;}this['_updateBalloonContent'](),this['_updateShowMoreButtonVisibility'](),this['_repinBalloonPanel']();}['_applyOverflowResults'](_0x85dba8,_0x199072){this['_distributeChips'](_0x85dba8,_0x199072),this['_updateOverflowUI'](_0x199072['length']);}['_setupVisibilityObserver'](){this['_containerElement']&&'undefined'!=typeof IntersectionObserver&&(this['_intersectionObserver']=new IntersectionObserver(_0x5b3f15=>{_0x5b3f15[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 _0xbd19ae=this['_containerElement']['getBoundingClientRect']();if(0x0===_0xbd19ae['width']||0x0===_0xbd19ae['height'])return!0x1;const _0x273bdb=window['innerHeight']||document['documentElement']['clientHeight'],_0x269dbc=window['innerWidth']||document['documentElement']['clientWidth'],_0xdbcd22=0xc8;return _0xbd19ae['bottom']>=-0xc8&&_0xbd19ae['top']<=_0x273bdb+_0xdbcd22&&_0xbd19ae['right']>=-0xc8&&_0xbd19ae['left']<=_0x269dbc+_0xdbcd22;}}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(_0x2598ef,_0x235649,_0x3c9c67){super(_0x2598ef),this['_bodyCollection']=_0x3c9c67,this['_createContextChips'](_0x235649);const _0x1125dd={'cssClasses':{'showMoreButton':Xn+'\x20'+us,'showMoreBalloon':zn,'overflowContainer':qn,'controlsButton':Qn}};this['_overflowManager']=new Wn(_0x2598ef,this['_contextChips'],_0x1125dd,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 _0x2aba04=this['element']['querySelector']('.'+$n);_0x2aba04&&(this['_overflowManager']['setContainerElement'](_0x2aba04),this['_overflowManager']['reorganizeChips']());}['destroy'](){super['destroy'](),this['_overflowManager']['destroy']();}['_createContextChips'](_0x2f5076){for(const _0x143cfb of _0x2f5076){const _0x36823a=new Bn(this['locale'],_0x143cfb,!0x0,!0x1);this['_contextChips']['add'](_0x36823a);}}}class Jn extends an{['_contextChipsView']=null;['_locale'];['_bodyCollection'];['_messageContentView'];constructor(_0x5ce9e1,_0x3e4bd1,_0x798b64){super(_0x3e4bd1),this['_locale']=_0x5ce9e1,this['_bodyCollection']=_0x798b64,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'](_0x197da1=>!_0x197da1['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(_0x33ff32,_0x289c31){super(_0x289c31);const {isWebSearchEnabled:_0x352f2b,isReasoningEnabled:_0x3acfb7}=_0x289c31['capabilities'],_0x6ef9dc=[];let _0x49ecc4='';_0x352f2b&&_0x3acfb7?(_0x49ecc4=hs(_0x33ff32,'AI_CHAT_FEED_REPLY_ITEM_USED_WEB_SEARCH_REASONING'),_0x6ef9dc['push'](tr(_0x4cfbb8)),_0x6ef9dc['push'](tr(_0x47cf05))):_0x352f2b?(_0x49ecc4=hs(_0x33ff32,'AI_CHAT_FEED_REPLY_ITEM_USED_WEB_SEARCH'),_0x6ef9dc['push'](tr(_0x4cfbb8))):_0x3acfb7&&(_0x49ecc4=hs(_0x33ff32,'AI_CHAT_FEED_REPLY_ITEM_USED_REASONING'),_0x6ef9dc['push'](tr(_0x47cf05))),this['extendTemplate']({'attributes':{'class':['ck-ai-chat__feed__interaction-header',_0x49ecc4?'':'ck-hidden']}});const _0xa85f22=new vt();_0xa85f22['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed__interaction-header__capabilities']},'children':[..._0x6ef9dc,{'tag':'span','attributes':{'class':['ck-ai-chat__feed__interaction-header__capabilities__text']},'children':[_0x49ecc4]}]}),this['children']['add'](_0xa85f22),this['capabilities']=_0x289c31['capabilities'];}}function tr(_0x38f799){const _0x4425a1=new xt();return _0x4425a1['content']=_0x38f799,_0x4425a1;}const er=['wheel','touchstart','pointerdown','keydown'],ir=['ArrowUp','ArrowDown','PageUp','PageDown','Home','End','\x20'];class sr{['element'];['animationFrameId'];['isRunning'];['abortController'];['isUserPaused'];['scrollBehavior'];constructor(_0x22b47c){this['element']=_0x22b47c,this['animationFrameId']=null,this['isRunning']=!0x1,this['abortController']=new AbortController(),this['isUserPaused']=!0x1,this['scrollBehavior']='smooth';for(const _0x373131 of er){const _0x53d6b1='keydown'!==_0x373131;this['element']['addEventListener'](_0x373131,this['_onUserEvent']['bind'](this),{'passive':_0x53d6b1,'signal':this['abortController']['signal']});}}['start']({smooth:_0x3e55f1=!0x0}={}){this['isRunning']||(this['isRunning']=!0x0,this['isUserPaused']=!0x1,this['scrollBehavior']=_0x3e55f1?'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'](_0x3d3ba3){if(this['isRunning']){if('keydown'===_0x3d3ba3['type']){const _0x13f135=_0x3d3ba3['key'];if(!ir['includes'](_0x13f135))return;}_0x3d3ba3 instanceof WheelEvent?_0x3d3ba3['deltaY']<0x0?this['isUserPaused']=!0x0:this['isUserPaused']=!this['_isAtBottom']():this['isUserPaused']=!0x0;}}['_isAtBottom'](){const {scrollTop:_0x4c63dc,scrollHeight:_0x429309,clientHeight:_0x2363b3}=this['element'];return _0x429309-_0x4c63dc-_0x2363b3<=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(_0x31fbcd){super(_0x31fbcd),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(_0x33d149,_0x434d68){super(_0x33d149),this['_bodyCollection']=_0x434d68,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'](_0x2797bb,_0x2181b7){let _0x2cad9b;return'ai-reply'===_0x2797bb?_0x2cad9b=new vn(this['locale'],_0x2181b7,this['_bodyCollection']):'ai-suggestion-reply'===_0x2797bb?(_0x2cad9b=new Nn(this['locale'],_0x2181b7,this['_bodyCollection']),_0x2cad9b['bind']('isTrackChangesOn')['to'](this)):_0x2cad9b='user-message'===_0x2797bb?new Jn(this['locale'],_0x2181b7,this['_bodyCollection']):'interaction-header'===_0x2797bb?new Zn(this['locale'],_0x2181b7):'custom-element'===_0x2797bb?new nr(_0x2181b7):new wn(_0x2181b7),this['children']['add'](_0x2cad9b),_0x2cad9b;}async['updateReplyItem']({id:_0x1605b9,parsedContent:_0x268eaa,renderingStrategy:_0xb4dbf2,abortSignal:_0xe3336}){const _0x29fd05=this['getItemById'](_0x1605b9);if(!(_0x29fd05 instanceof vn))throw new at('ai-chat-feed-view-item-not-a-reply-item',null,{'itemView':_0x29fd05,'id':_0x1605b9,'parsedContent':_0x268eaa});await _0x29fd05['updateContent']({'parsedContent':_0x268eaa,'renderingStrategy':_0xb4dbf2,'abortSignal':_0xe3336});}async['updateWebSources'](_0x8e4ea8,_0x381d61){const _0x43342e=this['getItemById'](_0x8e4ea8);if(_0x43342e instanceof Nn)_0x43342e['updateSources'](_0x381d61);else{if(!(_0x43342e instanceof vn))throw new at('ai-chat-feed-view-item-not-a-suggestion-or-reply-item',null,{'itemView':_0x43342e,'id':_0x8e4ea8,'sources':_0x381d61});_0x43342e['updateSources'](_0x381d61);}}async['updateSuggestionItem']({id:_0x336481,parts:_0x278b4d,abortSignal:_0x25c88e,skipLoadingEffects:_0x3c24d9}){const _0x55cbab=this['getItemById'](_0x336481);if(!(_0x55cbab instanceof Nn))throw new at('ai-chat-feed-view-item-not-a-suggestion-item',null,{'itemView':_0x55cbab,'id':_0x336481,'parts':_0x278b4d});await _0x55cbab['updateContent']({'parts':_0x278b4d,'abortSignal':_0x25c88e,'skipLoadingEffects':_0x3c24d9});}['updateSuggestionPartState']({id:_0x7063ce,index:_0x1cbf6d,state:_0x2c4686}){const _0x2bbc51=this['getItemById'](_0x7063ce);if(!(_0x2bbc51 instanceof Nn))throw new at('ai-chat-feed-view-item-not-a-suggestion-item',this,{'id':_0x7063ce});_0x2bbc51['updatePartState'](_0x1cbf6d,_0x2c4686);}['setSuggestionPartActive']({id:_0x53d48b,index:_0x192cbc,isActive:_0x1ff98d}){const _0x754738=this['getItemById'](_0x53d48b);if(!(_0x754738 instanceof Nn))throw new at('ai-chat-feed-view-item-not-a-suggestion-item',this,{'id':_0x53d48b});this['children']['filter'](_0x4c4c7b=>_0x4c4c7b instanceof Nn)['forEach'](_0x2495ac=>{_0x2495ac['setPartActive'](!0x1);}),_0x754738['setPartActive'](_0x192cbc,_0x1ff98d);}['markItemAsDone'](_0x1d14b6){this['getItemById'](_0x1d14b6)['markAsDone']();}['getItemIds'](){return this['children']['map'](_0x1326ab=>_0x1326ab['options']['id']);}['removeItem'](_0x54846b){this['children']['remove'](this['getItemById'](_0x54846b));}['hasItem'](_0xa9f566){return!!this['children']['find'](_0x598859=>_0x598859['options']['id']['includes'](_0xa9f566));}['scrollToSuggestion'](_0x3e1523,_0x32d1e0){const _0x588e27=this['getItemById'](_0x3e1523);if(!(_0x588e27 instanceof Nn))return void It('ck-ai-chat-feed-view-scroll-to-suggestion-invalid-item',{'replyId':_0x3e1523,'partIndex':_0x32d1e0});const _0x3a4955=_0x588e27['getPartView'](_0x32d1e0);_0x3a4955?ft(_0x3a4955['element'],0x14,this['element']['parentElement'],!0x0,!0x0):It('ck-ai-chat-feed-view-scroll-to-suggestion-part-view-not-found',{'replyId':_0x3e1523,'partIndex':_0x32d1e0});}['_setupTemplate'](){this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed']},'children':this['_createTemplateChildren']()});}['_createTemplateChildren'](){const _0x2bdfd7=this['_createSkeletonLoader']();return[this['_createFeedItems'](),_0x2bdfd7,this['_createFeedLoader']()];}['_createSkeletonLoader'](){const _0x7fb1a=new pn(this['locale'],mn['aiFeed']);return _0x7fb1a['bind']('isVisible')['to'](this,'isLoadingSkeletonVisible'),_0x7fb1a;}['_createFeedItems'](){const _0x4975c5=new vt(this['locale']);return _0x4975c5['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed__items',this['bindTemplate']['if']('isLoadingSkeletonVisible','ck-hidden')]},'children':this['children']}),_0x4975c5;}['_createFeedLoader'](){const _0x9e9991=new vt(this['locale']);return _0x9e9991['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__loader',this['bindTemplate']['if']('loadingMessage','ck-hidden',_0x211f53=>!_0x211f53)]},'children':this['_createLoaderChildren']()}),_0x9e9991;}['_createLoaderChildren'](){const _0x904dd8=new yn();return _0x904dd8['isVisible']=!0x0,[_0x904dd8,{'tag':'span','attributes':{'class':['ck','ck-ai-chat__loader-text']},'children':[{'text':this['bindTemplate']['to']('loadingMessage')}]}];}['getItemById'](_0x509b2f){const _0x413eb7=this['children']['find'](_0x859de6=>_0x859de6['options']['id']['includes'](_0x509b2f));if(!_0x413eb7)throw new at('ai-chat-feed-view-item-not-found',this,{'id':_0x509b2f});return _0x413eb7;}['setLoadingMessage'](_0x47dc92){this['set']('loadingMessage',_0x47dc92);}['toggleLoadingSkeleton'](_0x2ae73f){this['set']('isLoadingSkeletonVisible',_0x2ae73f);}['startAutoScroll'](_0x1e73e3={}){this['scrollManager']['start'](_0x1e73e3);}['stopAutoScroll'](){this['scrollManager']['stop']();}}class or extends Dt{['filter'](){let _0x5bd01b=0x0;for(const _0x34ec7a of this['items'])_0x5bd01b+=_0x34ec7a['items']['length'];return{'resultsCount':_0x5bd01b,'totalItemsCount':_0x5bd01b};}}const ar='ck-ai-chat__prompt-input_highlighted';class hr extends Lt{['submitButtonView'];static ['MIN_ROWS']=0x1;static ['MAX_ROWS']=0xc;['_addContextButtonView'];['_queryViewResizeObserver'];constructor(_0x5a2800,_0x18860d){super(_0x5a2800,{'queryView':{'label':'','creator':Vt,'showIcon':!0x1,'showResetButton':!0x1},'filteredView':new or(_0x5a2800),'queryMinChars':0x1/0x0,'resetOnBlur':!0x1}),this['set']('isEmpty',!0x0),this['set']('isUploadInProgress',!0x1),this['_addContextButtonView']=_0x18860d,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',(_0x43c0fe,_0x22061f)=>!_0x43c0fe&&!_0x22061f),this['focusableChildren']['add'](this['submitButtonView']);}['render'](){super['render'](),this['queryView']['fieldWrapperChildren']['add'](this['submitButtonView']),this['keystrokes']['set']('enter',(_0x5afefc,_0x458551)=>{this['isUploadInProgress']||this['isEmpty']||_0x5afefc['target']==this['queryView']['fieldView']['element']&&(this['submit'](),_0x458551());}),this['queryView']['fieldView']['on']('update',()=>{this['isEmpty']=''===this['queryView']['fieldView']['element']['value']?.['trim']();});}['destroy'](){super['destroy'](),this['_queryViewResizeObserver']&&this['_queryViewResizeObserver']['destroy']();}['submit'](){const _0x59d0d6=this['queryView']['fieldView']['element']['value']?.['trim']();if(!_0x59d0d6)return this['queryView']['errorText']=hs(this['locale'],'AI_CHAT_PROMPT_EMPTY_ERROR'),void(this['queryView']['fieldView']['hasError']=!0x0);this['queryView']['fieldView']['hasError']=!0x1;const _0x3c36a0=_0x1db613(_0x59d0d6);this['fire']('sendUserMessage',_0x3c36a0),this['queryView']['fieldView']['reset']();}['setPlaceholderText'](_0x1113a2){this['queryView']['fieldView']['set']('placeholder',_0x1113a2);}['focus'](_0x1a1389=!0x1){super['focus'](),_0x1a1389&&(this['element']['classList']['contains'](ar)||(this['element']['classList']['add'](ar),setTimeout(()=>{this['element']['classList']['remove'](ar);},0x320)));}['_createSubmitButton'](){const _0x53dce2=new Nt(this['locale']);return _0x53dce2['set']({'icon':_0x270404,'label':hs(this['locale'],'AI_CHAT_LABEL_SUBMIT'),'isVisible':!0x0,'tooltip':!0x0,'class':'ck-ai-chat__prompt-submit-button\x20'+cs,'isEnabled':!0x1}),_0x53dce2['on']('execute',()=>{this['submit']();}),_0x53dce2;}['setIsUploadInProgress'](_0x56498f){this['isUploadInProgress']=_0x56498f;}['_setUpAddContextButtonPositioning'](){const _0x41cfea=this['locale'],_0x24a015=()=>{ct['window']['requestAnimationFrame'](()=>{if(lt(this['element'])){const _0x45b60c=new ut(this['queryView']['fieldView']['element']),_0x596889=new ut(this['_addContextButtonView']['element']),_0x7b3654=_0x45b60c['width'],_0x6b0e51='rtl'===_0x41cfea['uiLanguageDirection']?'right':'left';_0x45b60c['excludeScrollbarsAndBorders']();const _0x939640=_0x7b3654-_0x45b60c['width']+0x1;this['_addContextButtonView']['element']['style'][_0x6b0e51]='calc('+(_0x7b3654-_0x596889['width']-_0x939640)+'px\x20-\x20var(--ck-spacing-tiny))';}});};this['queryView']['fieldView']['on']('update',_0x24a015),this['on']('render',()=>{_0x24a015(),this['_queryViewResizeObserver']=new bt(this['queryView']['fieldView']['element'],()=>{_0x24a015();});});}}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(_0x8c0314){super(_0x8c0314),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',_0xc11e46=>'selector'===_0xc11e46),this['_modelSelectionDropdown']['buttonView']['bind']('tooltip')['to'](this,'modelSelectorEnabled',_0x20ca95=>_0x20ca95?this['_modelSelectionDropdown']['buttonView']['label']:hs(this['locale'],'AI_CHAT_MODEL_SELECTOR_DISABLED_TOOLTIP')),this['_modelSelectionDropdown']['bind']('isEnabled')['to'](this,'modelSelectorEnabled',_0xc60a87=>_0xc60a87),this['_webSearchButton']['bind']('isOn')['to'](this,'webSearchActive',_0x351644=>_0x351644),this['_webSearchButton']['bind']('tooltip')['to'](this,'webSearchActive',_0x3a0d16=>hs(this['locale'],_0x3a0d16?'AI_CHAT_DISABLE_WEB_SEARCH':'AI_CHAT_ENABLE_WEB_SEARCH')),this['_reasoningButton']['bind']('isOn')['to'](this,'reasoningActive',_0x3f8d7f=>_0x3f8d7f),this['_reasoningButton']['bind']('tooltip')['to'](this,'reasoningActive',_0x3dd8a1=>hs(this['locale'],_0x3dd8a1?'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'](_0x527dca,_0x5b0286){if(_0x5b0286)this['set']('modelDisplayMode','hidden');else{const _0x41db4e=0x1===_0x527dca['length'];this['set']('modelDisplayMode',_0x41db4e?'name':'selector');}if(this['_modelSelectionDropdownItems']['clear'](),_0x527dca?.['length'])for(const _0x3a23ef of _0x527dca){const _0x167e79=new Jt({'label':_0x3a23ef['name'],'withText':!0x0,'role':'menuitemradio','id':_0x3a23ef['id'],'model':_0x3a23ef});_0x167e79['bind']('isOn')['to'](this,'activeModelId',_0x5e18c2=>_0x5e18c2===_0x3a23ef['id']),this['_modelSelectionDropdownItems']['add']({'type':'button','model':_0x167e79,'labelView':new pr(this['locale'],_0x3a23ef)});}}['setWebSearch'](_0x469279){this['set']('webSearchActive',_0x469279);}['setReasoning'](_0x2974b0){this['set']('reasoningActive',_0x2974b0);}['setModel'](_0x5a97a3){if(!_0x5a97a3)return;this['activeModelId']=_0x5a97a3['id'],this['activeModelName']=_0x5a97a3['name']||_0x5a97a3['id'],this['_modelSelectionDropdown']['buttonView']['set']('label',_0x5a97a3['name']),this['_modelSelectionDropdown']['buttonView']['set']('tooltip',_0x5a97a3['name']);const _0x269475=_0x5a97a3['capabilities']['webSearch']?.['enabled']??!0x1;this['set']('webSearchActive',!0x1),this['_webSearchButton']['set']('isOn',!0x1),this['_webSearchButton']['set']('isEnabled',_0x269475),this['_webSearchButton']['set']('isVisible',_0x269475);const _0x57099e=_0x5a97a3['capabilities']['reasoning']?.['enabled']??!0x1;this['set']('reasoningActive',!0x1),this['_reasoningButton']['set']('isOn',!0x1),this['_reasoningButton']['set']('isEnabled',_0x57099e),this['_reasoningButton']['set']('isVisible',_0x57099e);}['enableModelSelector'](){this['set']('modelSelectorEnabled',!0x0);}['disableModelSelector'](_0x1553f2){this['set']('modelSelectorEnabled',!0x1),_0x1553f2&&this['set']('modelDisplayMode','hidden');}['_createWebSearchButton'](){const _0x2c1f79=new Nt();return _0x2c1f79['set']({'label':hs(this['locale'],'AI_CHAT_SEARCH_WEB'),'icon':_0x4cfbb8,'class':lr+'\x20'+us,'isToggleable':!0x0,'tooltipPosition':Ir}),_0x2c1f79['on']('execute',()=>{this['fire']('toggleWebSearch');}),_0x2c1f79;}['_createReasoningButton'](){const _0x5d4133=new Nt();return _0x5d4133['set']({'label':hs(this['locale'],'AI_CHAT_REASONING'),'icon':_0x47cf05,'class':lr+'\x20'+us,'isToggleable':!0x0,'tooltipPosition':Ir}),_0x5d4133['on']('execute',()=>{this['fire']('toggleReasoning');}),_0x5d4133;}['_createCommandsButton'](){const _0x4ac0a8=new Nt();return _0x4ac0a8['set']({'label':hs(this['locale'],'AI_CHAT_COMMANDS'),'icon':_0x57fdf0,'withText':!0x0,'class':lr+'\x20'+us,'isToggleable':!0x0,'tooltip':hs(this['locale'],'AI_CHAT_COMMANDS'),'tooltipPosition':Ir}),_0x4ac0a8['extendTemplate']({'attributes':{'class':[ur]}}),_0x4ac0a8['on']('execute',()=>{console['log']('Commands\x20are\x20not\x20implemented\x20yet.'),alert('Commands\x20are\x20not\x20implemented\x20yet.');}),_0x4ac0a8;}['_createModelSelectionDropdown'](){const _0x194c30=Gt(this['locale']);return _0x194c30['set']({'panelPosition':'ne','class':[dr]}),_0x194c30['buttonView']['set']({'label':hs(this['locale'],'AI_CHAT_MODEL_SELECTOR_ENABLED_TOOLTIP'),'withText':!0x0,'tooltip':!0x0,'tooltipPosition':Ir,'class':us}),this['listenTo'](_0x194c30,'execute',_0x6803df=>{this['fire']('selectModel',_0x6803df['source']['model']);}),_0x194c30;}['_createModelNameView'](){const _0x1f7bee=new mr(this['locale']);return _0x1f7bee['bind']('text')['to'](this,'activeModelName',_0x275a0b=>_0x275a0b??''),_0x1f7bee['bind']('isVisible')['to'](this,'modelDisplayMode',_0x1caec3=>'name'===_0x1caec3),_0x1f7bee;}}let pr=class extends Mt{constructor(_0x14c2ef,_0x512ff6){super();const _0x3ba583=this['bindTemplate'],_0x53427b=this['createCollection']();this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-button__label'],'style':_0x3ba583['to']('style'),'id':_0x3ba583['to']('id')},'children':[{'tag':'div','attributes':{'class':[_r]},'children':[{'text':_0x3ba583['to']('text')}]},{'tag':'div','attributes':{'class':[gr]},'children':[{'tag':'span','children':[{'text':_0x512ff6['description']}]}]},{'tag':'div','attributes':{'class':[Ar]},'children':_0x53427b}]}),_0x53427b['addMany'](this['_getCapabilityParts'](_0x14c2ef,_0x4cfbb8,'AI_CHAT_SEARCH_WEB',_0x512ff6['capabilities']['webSearch']?.['enabled']??!0x1)),_0x53427b['addMany'](this['_getCapabilityParts'](_0x14c2ef,_0x47cf05,'AI_CHAT_REASONING',_0x512ff6['capabilities']['reasoning']?.['enabled']??!0x1));}['_getCapabilityParts'](_0x408b76,_0x31d8fa,_0x2434c8,_0x341c38){const _0x23bee8=new xt();_0x23bee8['content']=_0x31d8fa;const _0x3872ac=new vt(_0x408b76);_0x3872ac['setTemplate']({'tag':'span','children':[{'text':hs(_0x408b76,_0x2434c8)+':\x20'}]});const _0x56d43e=new vt(_0x408b76);return _0x56d43e['setTemplate']({'tag':'span','children':[{'text':hs(_0x408b76,_0x341c38?'AI_CHAT_CAPABILITIES_YES':'AI_CHAT_CAPABILITIES_NO')}]}),[_0x23bee8,_0x3872ac,_0x56d43e];}},mr=class extends vt{constructor(_0x2b7640){super(_0x2b7640),this['set']('text',void 0x0),this['set']('isVisible',!0x0);const _0xcbe2c0=this['bindTemplate'];this['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai-chat-controls__model-name',_0xcbe2c0['if']('isVisible','ck-hidden',_0x5d6965=>!_0x5d6965)]},'children':[{'text':_0xcbe2c0['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(_0x4d03ce){super(_0x4d03ce),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'](_0x1e1d1f=>{this['focusTracker']['add'](_0x1e1d1f['element']),this['keystrokes']['listenTo'](_0x1e1d1f['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'](_0x78140b){this['urlInputField']['errorText']=_0x78140b,this['_updateConfirmButtonState'](),this['fire']('refreshBalloon');}['clearError'](){this['urlInputField']['errorText']=null,this['_updateConfirmButtonState']();}['_createBackButton'](){const _0xbb7878=new Nt(this['locale']);return _0xbb7878['set']({'icon':_0x478ce3,'tooltip':hs(this['locale'],'AI_CHAT_CONTEXT_URL_BACK_TO_CONTEXT'),'tooltipPosition':'n','class':['ck-button-icon\x20ck-button-back']}),this['on']('change:withBackButton',(_0x3bc957,_0x3d114a,_0x4b563b)=>{_0xbb7878['set']({'class':['ck-button-icon\x20ck-button-back'+(_0x4b563b?'':'\x20ck-hidden')]});}),_0xbb7878;}['_createUrlInputField'](){const _0x4b2eb3=new te(this['locale'],_0xbc0dcc);return _0x4b2eb3['set']({'label':hs(this['locale'],'AI_CHAT_CONTEXT_URL_LABEL'),'class':'ck-labeled-field-view_empty'}),_0x4b2eb3['fieldView']['set']({'placeholder':hs(this['locale'],'AI_CHAT_CONTEXT_URL_PLACEHOLDER')}),_0x4b2eb3;}['_createConfirmButton'](){const _0x35eae6=new Nt(this['locale']);return _0x35eae6['set']({'icon':_0x202ca3,'tooltip':hs(this['locale'],'AI_CHAT_CONTEXT_URL_ADD_URL'),'tooltipPosition':'n','class':'ck-button-icon','type':'submit','isEnabled':!0x1}),_0x35eae6;}['_setupTemplate'](){const _0x28b945=new _0x189b73(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'});_0x28b945['children']['add'](this['backButton'],0x0),this['setTemplate']({'tag':'form','attributes':{'class':Tr,'tabindex':'-1'},'children':[_0x28b945,{'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',_0x68aa73=>{_0x68aa73['stop'](),this['_handleSubmit']();});}['_setupKeystrokes'](){this['keystrokes']['set']('esc',(_0x4c5def,_0x2d1a9c)=>{this['clear'](),this['fire']('cancel'),_0x2d1a9c();});}['_handleSubmit'](){const _0x36b353=this['getValue']()['trim']();_0x36b353?this['_isValidUrl'](_0x36b353)?(this['clearError'](),this['fire']('submitUrl',_0x36b353)):this['setError'](hs(this['locale'],'AI_CHAT_CONTEXT_URL_INVALID_ERROR')):this['setError'](hs(this['locale'],'AI_CHAT_CONTEXT_URL_EMPTY_ERROR'));}['_updateConfirmButtonState'](){const _0x4a9549=this['getValue']()['trim'](),_0x56b7f8=!!this['urlInputField']['errorText'];this['confirmButton']['isEnabled']=_0x4a9549['length']>0x0&&!_0x56b7f8;}['_isValidUrl'](_0x2a7180){try{return!!new URL(_0x2a7180);}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(_0x43cacb,_0x23b908){super(_0x43cacb),this['resource']=_0x23b908,this['set']('isInContext',!!_0x23b908['isInContext']),this['_titleView']=this['_createTitleView'](),this['_iconView']=this['_createIconView'](),this['_setupTemplate']();}['render'](){super['render']();}['getResourceIcon'](_0x1846ad){if(_0x1846ad['isInContext'])return _0x202ca3;switch(_0x1846ad['type']){case'document':return _0x5ed1d7;case'web-resource':return _0x4ec276;case'file':case'text':return _0xe24ff3;default:return _0xcaba98;}}['highlightText'](_0x205f3d){if(!_0x205f3d||''===_0x205f3d['trim']())return void this['_titleView']['highlightText'](null);const _0xa145a7=new RegExp(_0x865c1f(_0x205f3d),'gi');this['_titleView']['highlightText'](_0xa145a7);}['updateResourceState'](_0x4d012d){this['resource']['isInContext']=_0x4d012d,this['isInContext']=_0x4d012d,this['_updateIcon']();}['_createTitleView'](){const _0x405873=new _0x3716e9();return _0x405873['text']=this['resource']['label'],_0x405873['extendTemplate']({'tag':'span','attributes':{'class':[Sr]}}),_0x405873;}['_createIconView'](){const _0xdf4444=new xt();return _0xdf4444['content']=this['getResourceIcon'](this['resource']),_0xdf4444;}['_setupTemplate'](){const _0x2f1d54=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':[fr,_0x2f1d54['if']('isVisible','ck-hidden',_0x40fb7b=>!_0x40fb7b),_0x2f1d54['if']('isInContext',br)]},'children':[{'tag':'div','attributes':{'class':[Rr]},'children':[this['_iconView']]},this['_titleView']],'on':{'click':_0x2f1d54['to']('execute')}});}['_updateIcon'](){this['_iconView']['content']=this['getResourceIcon'](this['resource']);}}const kr='ck-ai-chat-resources__list';class Nr extends Dt{['_source'];constructor(_0x5b5a80,_0x25d68a){super(_0x5b5a80),this['_source']=_0x25d68a,this['extendTemplate']({'attributes':{'class':[kr]}});}['setResources'](_0x235191,_0x16d330){this['items']['clear']();let _0x3ba37b=_0x235191;if(this['_source']['useDefaultFiltering']&&_0x16d330&&''!==_0x16d330['trim']()){const _0x14eb38=new RegExp(_0x16d330['replace'](/[.*+?^${}()|[\]\\]/g,'\x5c$&'),'gi');_0x3ba37b=_0x235191['filter'](_0x3ec2be=>_0x14eb38['test'](_0x3ec2be['label']));}for(const _0x432b2e of _0x3ba37b){const _0x5ff418=new Or(this['locale'],_0x432b2e);_0x5ff418['on']('execute',()=>{this['_handleResourceSelection'](this['_source'],_0x432b2e);}),this['items']['add'](_0x5ff418);}this['_source']['useDefaultFiltering']&&this['highlightText'](_0x16d330);}['highlightText'](_0x36b5f4){this['_source']['useDefaultFiltering']&&this['items']['forEach'](_0x5a18cb=>{_0x5a18cb['highlightText'](_0x36b5f4);});}['updateResourceState'](_0x45f272,_0x846add){for(const _0x1a4f97 of this['items']){const _0x11edcb=_0x1a4f97;_0x11edcb['resource']['id']===_0x45f272&&_0x11edcb['updateResourceState'](_0x846add);}}['_handleResourceSelection'](_0x22d0cb,_0x4ed682){this['fire']('addResourceToContext',{'source':_0x22d0cb,'resource':_0x4ed682});}}class vr extends te{['iconView'];['resetButtonView'];['_viewConfig'];constructor(_0x2ec21e){const t=_0x2ec21e['t'],_0x40ac00={'showResetButton':!0x0,'showIcon':!0x0,'creator':_0xbc0dcc,'label':hs(_0x2ec21e,'AI_CHAT_SEARCH_RESOURCES')};super(_0x2ec21e,_0x40ac00['creator']),this['label']=_0x40ac00['label'],this['_viewConfig']=_0x40ac00,this['_viewConfig']['showIcon']&&this['_setupSearchIcon'](),this['_viewConfig']['showResetButton']&&this['_setupResetButton'](_0x2ec21e,t),this['_setupEventListeners']();}['reset'](){this['fieldView']['reset'](),this['_viewConfig']['showResetButton']&&this['resetButtonView']&&(this['resetButtonView']['isVisible']=!0x1),this['search']('');}['search'](_0x468254){this['fire']('search',_0x468254);}['getQuery'](){return this['fieldView']['element']?.['value']||'';}['_setupSearchIcon'](){this['iconView']=new xt(),this['iconView']['content']=_0x20eade,this['fieldWrapperChildren']['add'](this['iconView'],0x0),this['extendTemplate']({'attributes':{'class':'ck-search__query_with-icon'}});}['_setupResetButton'](_0x2b4ca4,t){this['resetButtonView']=new Nt(_0x2b4ca4),this['resetButtonView']['set']({'label':t('Clear'),'icon':_0xf8dc71,'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',_0xf90630=>!_0xf90630),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(_0x8148bd,_0x3acf56){super(_0x8148bd),this['_source']=_0x3acf56['source'],this['_searchInputVisibleFrom']=_0x3acf56['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 _0x4a50ef([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 _0x5048dc=new vt(this['locale']);return _0x5048dc['setTemplate']({'tag':'div','attributes':{'class':'ck\x20ck-search'},'children':[this['_searchView']]}),this['_searchView']['on']('search',(_0x214207,_0x3d0e95)=>{this['loadResources'](_0x3d0e95),this['_source']['useDefaultFiltering']&&this['_resourcesListView']['highlightText'](_0x3d0e95);}),_0x5048dc;}['_createResourcesListView'](){const _0x3743ad=new Nr(this['locale'],this['_source']);return _0x3743ad['delegate']('addResourceToContext')['to'](this),_0x3743ad['extendTemplate']({'attributes':{'class':this['bindTemplate']['if']('isLoading','ck-hidden')}}),_0x3743ad;}['_createSkeletonView'](){const _0x2f0146=new pn(this['locale'],mn['aiChatResources']);return _0x2f0146['bind']('isVisible')['to'](this,'isLoading'),_0x2f0146;}['render'](){super['render'](),this['loadResources']('');}['loadResources'](_0x4b5244){const _0x3addf2=ot();this['_latestLoadResourcesUid']=_0x3addf2,this['fire']('loadSourceResources',{'sourceId':this['_source']['id'],'query':_0x4b5244,'uid':_0x3addf2}),this['isLoading']=!0x0;}['setResources'](_0x1bd9fa,_0x1d9f65){if(_0x1d9f65&&_0x1d9f65!==this['_latestLoadResourcesUid'])return;const _0x1de0c3=this['_source']['useDefaultFiltering']?this['_searchView']['getQuery']():'';this['_resourcesListView']['setResources'](_0x1bd9fa,_0x1de0c3),_0x1bd9fa['length']>=this['_searchInputVisibleFrom']&&!this['children']['has'](this['_searchSection'])&&this['children']['add'](this['_searchSection'],0x0),requestAnimationFrame(()=>{this['isLoading']=!0x1;});}['updateResourceState'](_0x4818ca,_0x515d02){this['_resourcesListView']['updateResourceState'](_0x4818ca,_0x515d02);}}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(_0x2e773f,_0x4052dc,_0x1a1e84){this['_locale']=_0x2e773f,this['_bodyCollection']=_0x4052dc,this['_config']=_0x1a1e84;}['showSourceResourcesBalloon']({source:_0xd9576,withBackButton:_0x1b3464}){let _0xe1deea=this['_sourceResourceBalloons']['get'](_0xd9576['id']);_0xe1deea||(_0xe1deea=this['_createSourceResourceBalloonPanel'](),this['_sourceResourceBalloons']['set'](_0xd9576['id'],_0xe1deea),this['_setupSingleResourceBalloonClickOutsideHandler'](_0xe1deea)),this['_addSourceResourceContent']({'balloonPanel':_0xe1deea,'source':_0xd9576,'withBackButton':_0x1b3464}),_0xe1deea['show']();const _0x28f830=this['_config']['getTargetElement']();_0x28f830&&_0xe1deea['pin']({'target':_0x28f830,'limiter':this['_config']['getLimiterElement']()});}['populateSourceResourceBalloon'](_0x5a96d4,_0x4f651f,_0x26640a){const _0x156b40=this['_sourceResourceBalloons']['get'](_0x5a96d4);if(!_0x156b40)return;const _0x4d8927=this['_getResourcesViewFromBalloon'](_0x156b40);_0x4d8927&&(_0x4d8927['setResources'](_0x4f651f,_0x26640a),_0x4d8927['once']('change:isLoading',()=>{_0x156b40['pin']({'target':this['_config']['getTargetElement'](),'limiter':this['_config']['getLimiterElement']()});}));}['closeSourceResourceBalloon'](_0x58bc12){const _0x1183fe=this['_sourceResourceBalloons']['get'](_0x58bc12);_0x1183fe&&requestAnimationFrame(()=>{_0x1183fe['hide'](),this['_sourceResourceBalloons']['delete'](_0x58bc12),this['_config']['onBalloonClosed']();});}['isAnyResourceBalloonVisible'](){for(const _0x49ad7f of this['_sourceResourceBalloons']['values']())if(_0x49ad7f['isVisible'])return!0x0;return!0x1;}['updateResourceState'](_0x46d46f,_0xc26ed,_0x4db725){const _0x496fd1=this['_sourceResourceBalloons']['get'](_0x46d46f);if(!_0x496fd1||!_0x496fd1['isVisible'])return;const _0x4fa8e9=this['_config']['getTargetElement']();if(!_0x4fa8e9)return;_0x496fd1['pin']({'target':_0x4fa8e9,'limiter':this['_config']['getLimiterElement']()});const _0x41461=this['_getResourcesViewFromBalloon'](_0x496fd1);_0x41461&&_0x41461['updateResourceState'](_0xc26ed,_0x4db725);}['destroy'](){for(const _0x303b4a of this['_sourceResourceBalloons']['values']())_0x303b4a['destroy']();this['_sourceResourceBalloons']['clear']();}['_createSourceResourceBalloonPanel'](){const _0x1d9699=new Xt(this['_locale']);return _0x1d9699['extendTemplate']({'attributes':{'class':xr}}),this['_bodyCollection']['add'](_0x1d9699),_0x1d9699;}['_addSourceResourceContent']({balloonPanel:_0x3503c1,source:_0x101c6d,withBackButton:_0x997886}){_0x3503c1['content']['clear']();const _0x28b51b=this['_createBalloonHeader']({'balloonPanel':_0x3503c1,'source':_0x101c6d,'withBackButton':_0x997886});_0x3503c1['content']['add'](_0x28b51b);const _0x32760b=this['_createBalloonResourcesView'](_0x101c6d);_0x3503c1['content']['add'](_0x32760b);}['_createBalloonHeader']({balloonPanel:_0x595f37,source:_0x41d9fd,withBackButton:_0x47efcc}){const _0x8b4215=new _0x189b73(this['_locale'],{'label':_0x41d9fd['label'],'class':Dr});return _0x47efcc&&_0x8b4215['children']['add'](this['_createBackButton'](_0x595f37),0x0),_0x8b4215;}['_createBackButton'](_0x4191a7){const _0x47fdf4=new Nt(this['_locale']);return _0x47fdf4['set']({'icon':_0x478ce3,'tooltip':hs(this['_locale'],'AI_CHAT_CONTEXT_URL_BACK_TO_CONTEXT'),'tooltipPosition':'n','class':Lr}),_0x47fdf4['on']('execute',()=>{_0x4191a7['hide'](),this['_config']['onBackToContext']();}),_0x47fdf4;}['_createBalloonResourcesView'](_0xe8f6af){const _0x2d1534=new yr(this['_locale'],{'source':_0xe8f6af,'searchInputVisibleFrom':this['_config']['searchInputVisibleFrom']});return _0x2d1534['on']('loadSourceResources',(_0x1cb1cd,_0x4b8bd4)=>{this['_config']['onLoadSourceResources'](_0x4b8bd4);}),_0x2d1534['on']('addResourceToContext',(_0x5db000,_0x4e5cd8)=>{this['_config']['onResourceSelected'](_0x4e5cd8['source'],_0x4e5cd8['resource']),this['closeSourceResourceBalloon'](_0xe8f6af['id']);}),_0x2d1534;}['_getResourcesViewFromBalloon'](_0x14420b){const _0x47b1ec=_0x14420b['content']['get'](0x1);return _0x47b1ec instanceof yr?_0x47b1ec:null;}['_setupSingleResourceBalloonClickOutsideHandler'](_0x4fa70b){zt({'emitter':_0x4fa70b,'contextElements':[_0x4fa70b['element']],'callback':()=>{_0x4fa70b['hide'](),this['_config']['onBalloonClosed']();},'activator':()=>_0x4fa70b['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(_0x1cdd55,_0x55ba83){super(_0x1cdd55),this['bodyCollection']=_0x55ba83['bodyCollection'],this['_currentContextsChips']=this['createCollection'](),this['_conversationContextsChips']=this['createCollection'](),this['addContextButtonView']=this['_createAddContextButtonView'](_0x1cdd55),this['_addContextBalloonPanelView']=this['_createAddContextBalloonPanelView'](_0x1cdd55),this['_urlBalloonPanelView']=this['_createUrlBalloonPanelView'](_0x1cdd55),this['_resourcesBalloonView']=this['_createResourcesBalloonView'](_0x1cdd55,_0x55ba83);const _0x3f9c95={'cssClasses':{'showMoreButton':$r+'\x20'+us,'showMoreBalloon':qr,'overflowContainer':Yr,'controlsButton':Wr}};this['_overflowManager']=new Wn(_0x1cdd55,this['_currentContextsChips'],_0x3f9c95,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'](_0x5f3a60,_0x39ab0f){const _0x5eadd2=this['_createContextButton'](_0x5f3a60,'current',!0x0,_0x39ab0f);this['_addContextToCollection'](_0x5eadd2,this['_currentContextsChips']),this['_overflowManager']['reorganizeChips']();}['removeContextItem'](_0x3c4f13){this['_removeContextFromCollection'](_0x3c4f13,this['_currentContextsChips']),this['_removeContextFromCollection'](_0x3c4f13,this['_overflowManager']['overflowChips']),this['_overflowManager']['reorganizeChips']();}['setContextItemLoading'](_0x40b660,_0x22c33c){let _0x31ef5c=this['_currentContextsChips']['find'](_0xe03d35=>_0xe03d35['id']===_0x40b660);_0x31ef5c||(_0x31ef5c=this['_overflowManager']['overflowChips']['find'](_0x4384e2=>_0x4384e2['id']===_0x40b660)),_0x31ef5c&&(_0x31ef5c['isLoading']=_0x22c33c);}['setConversationContext'](_0x283dbc){this['_conversationContextsChips']['clear']();for(const _0x340e96 of _0x283dbc){const _0x1a4b1d=this['_createContextButton'](_0x340e96,'conversation',!0x1,!0x1);this['_addContextToCollection'](_0x1a4b1d,this['_conversationContextsChips']);}}['clearCurrentContextItems'](){this['_currentContextsChips']['clear'](),this['_overflowManager']['clear']();}['clearConversationContextItems'](){this['_conversationContextsChips']['clear']();}['updateResourceState'](_0x3696a8,_0x2ae69b,_0x347f02){this['_resourcesBalloonView']['updateResourceState'](_0x3696a8,_0x2ae69b,_0x347f02);}['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:_0x5102ed,withBackButton:_0x49c6a5}){this['_resourcesBalloonView']['showSourceResourcesBalloon']({'source':_0x5102ed,'withBackButton':_0x49c6a5}),this['addContextButtonView']['isOn']=!0x0;}['populateSourceResourceBalloon'](_0x5f5c30,_0x4d3c60,_0x23bff7,_0x4da165){this['_resourcesBalloonView']['populateSourceResourceBalloon'](_0x5f5c30,_0x23bff7,_0x4da165);}['closeSourceResourceBalloon'](_0xe6702){this['_resourcesBalloonView']['closeSourceResourceBalloon'](_0xe6702),this['addContextButtonView']['isOn']=!0x1;}['setAddContextOptions'](_0x4835db){this['_setBalloonPanelContent'](this['_addContextBalloonPanelView'],this['locale'],_0x4835db),this['_setAddContextButtonEnabled'](_0x4835db);}['_setAddContextButtonEnabled'](_0x2c1ed8){const _0x45d5b2=!_0x2c1ed8['document']['isHidden']&&_0x2c1ed8['document']['enabled'],_0x15e375=_0x2c1ed8['urls']['enabled'],_0x28d57a=_0x2c1ed8['files']['enabled'],_0x249a0d=_0x2c1ed8['sources']['length']>0x0,_0x47dc2c=_0x2c1ed8['customItems']&&_0x2c1ed8['customItems']['length']>0x0;this['addContextButtonView']['isEnabled']=_0x45d5b2||_0x15e375||_0x28d57a||_0x249a0d||_0x47dc2c;}['_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'](_0x3a1693){const _0x2c586c=new Nt(_0x3a1693);return _0x2c586c['set']({'label':hs(_0x3a1693,'AI_CHAT_CONTEXT_ADD_CONTEXT'),'class':Wr+'\x20'+Br+'\x20'+us,'icon':_0xe39455,'isToggleable':!0x0,'tooltip':!0x0,'tooltipPosition':'sw'}),_0x2c586c;}['_createAddContextBalloonPanelView'](_0x28cc6f){return this['_createBaseBalloonPanel'](_0x28cc6f,Vr);}['_createUrlBalloonPanelView'](_0x1b5708){const _0xe84432=this['_createBaseBalloonPanel'](_0x1b5708,Gr);return this['_addUrlContent'](_0xe84432,_0x1b5708),_0xe84432;}['_createResourcesBalloonView'](_0x1a360c,_0x2214cc){const _0xe3376a={'searchInputVisibleFrom':_0x2214cc['searchInputVisibleFrom'],'onBackToContext':()=>{this['showAddContextBalloonPanel'](),this['_addContextBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':Xr});},'onResourceSelected':(_0x351c13,_0x328d16)=>{this['fire']('addResourceToContext',{'source':_0x351c13,'resource':_0x328d16});},'onLoadSourceResources':_0x198191=>{this['fire']('loadSourceResources',_0x198191);},'onBalloonClosed':()=>{this['addContextButtonView']['isOn']=!0x1;},'getLimiterElement':()=>this['_getLimiterElement'](),'getTargetElement':()=>this['addContextButtonView']['element']};return new Pr(_0x1a360c,_0x2214cc['bodyCollection'],_0xe3376a);}['_getLimiterElement'](){return this['element']?.['closest']('.'+Qr)||document['body'];}['_createBaseBalloonPanel'](_0x951852,_0x3d3af9){const _0x122693=new Xt(_0x951852);return _0x122693['extendTemplate']({'attributes':{'class':_0x3d3af9}}),this['bodyCollection']['add'](_0x122693),_0x122693;}['_setBalloonPanelContent'](_0x887365,_0x1eb9b8,_0x17a48e){if(_0x887365['content']['clear'](),!_0x17a48e['document']['isHidden']&&_0x17a48e['document']['enabled']){const _0x43ea39=this['_createBalloonButton'](_0x1eb9b8,{'label':hs(_0x1eb9b8,'AI_CHAT_CONTEXT_CURRENT_DOCUMENT'),'icon':_0x5ed1d7});_0x43ea39['on']('execute',()=>{this['fire']('addDocumentToContext'),this['hideAddContextBalloonPanel']();}),_0x887365['content']['add'](_0x43ea39);}if(_0x17a48e['urls']['enabled']){const _0x5a4925=this['_createBalloonButton'](_0x1eb9b8,{'label':hs(_0x1eb9b8,'AI_CHAT_CONTEXT_URL_LABEL'),'icon':_0x4ec276});_0x5a4925['on']('execute',()=>{this['hideAddContextBalloonPanel'](),this['showUrlBalloonPanel'](),this['_urlBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':Xr}),this['_urlInputView']['focus']();}),_0x887365['content']['add'](_0x5a4925);}if(_0x17a48e['files']['enabled']){const _0x3c2403=new _0x1be7e7(_0x1eb9b8);_0x3c2403['set']({'label':hs(_0x1eb9b8,'AI_CHAT_CONTEXT_FILE_LABEL'),'icon':_0x365af3,'withText':!0x0,'tooltip':!0x0,'class':Fr,'allowMultipleFiles':!0x0}),_0x3c2403['on']('execute',()=>{this['hideAddContextBalloonPanel']();}),_0x3c2403['on']('done',(_0xa43994,_0x3aa90a)=>{this['fire']('addFileToContext',_0x3aa90a);}),_0x3c2403['tooltip']=!0x0,_0x887365['content']['add'](_0x3c2403);}for(const _0x36aa0c of _0x17a48e['sources']){const _0x42cdf2=this['_createBalloonButton'](_0x1eb9b8,{'label':_0x36aa0c['label'],'icon':_0x36aa0c['icon']||_0xcaba98,'type':'source'});_0x887365['content']['add'](_0x42cdf2),_0x42cdf2['on']('execute',()=>{this['hideAddContextBalloonPanel'](),this['_showSourceResourcesBalloon']({'source':_0x36aa0c,'withBackButton':!this['_hasExactlyOneSource']});});}for(const _0x526225 of _0x17a48e['customItems']||[]){const _0x40d154=this['_createBalloonButton'](_0x1eb9b8,{'label':_0x526225['label'],'icon':_0x526225['icon']||_0xcaba98,'type':'customItem'});_0x887365['content']['add'](_0x40d154),_0x40d154['on']('execute',()=>{this['hideAddContextBalloonPanel'](),this['fire']('executeCustomItemCallback',_0x526225);});}this['_hasExactlyOneSource']=0x1===_0x887365['content']['length'],this['_urlInputView']['withBackButton']=!this['_hasExactlyOneSource'];}['_addUrlContent'](_0x1825ea,_0x2b6c51){this['_urlInputView']=new wr(_0x2b6c51),this['_urlInputView']['on']('submitUrl',(_0x1b1c18,_0x2254c7)=>{this['_handleUrlSubmit'](_0x2254c7);}),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});}),_0x1825ea['content']['add'](this['_urlInputView']);}['_createBalloonButton'](_0x4b2139,_0x1e6c02){const _0x4cc318='source'===_0x1e6c02['type']?new jr(_0x4b2139):new Nt(_0x4b2139);return _0x4cc318['set']({'label':_0x1e6c02['label'],'icon':_0x1e6c02['icon'],'withText':!0x0,'tooltip':!0x0,'tooltipPosition':'sw','class':Fr}),_0x4cc318;}['_setupAllBalloonClickOutsideHandlers'](){this['_setupAddContextBalloonClickOutsideHandler'](),this['_setupUrlBalloonClickOutsideHandler']();}['_setupUrlBalloonClickOutsideHandler'](){zt({'emitter':this['_urlBalloonPanelView'],'contextElements':[this['_urlBalloonPanelView']['element']],'callback':()=>{this['hideUrlBalloonPanel']();},'activator':()=>this['_urlBalloonPanelView']['isVisible']});}['_toggleAddContextBalloon'](_0xedede1){const _0x5057c8=this['_addContextBalloonConfig'];_0x5057c8['buttonView']['isOn']=_0xedede1,_0xedede1?_0x5057c8['balloonView']['show']():_0x5057c8['balloonView']['hide']();}['_setupAddContextBalloonClickOutsideHandler'](){const {balloonView:_0xd05de,buttonView:_0x28c6dc,hideMethod:_0x5cc549}=this['_addContextBalloonConfig'];zt({'emitter':_0xd05de,'contextElements':[_0xd05de['element'],_0x28c6dc['element']],'callback':()=>{_0x5cc549();},'activator':()=>_0x28c6dc['isOn']&&!this['_urlBalloonPanelView']['isVisible']&&!this['_resourcesBalloonView']['isAnyResourceBalloonVisible']()});}['_createContextButton'](_0x43dd70,_0x12d311,_0xe7b66f=!0x1,_0x15ee7a=!0x1){const _0x3d4d4f='conversation'===_0x12d311||!0x0===_0x43dd70['isReadOnly'],_0x12a36a=new Bn(this['locale'],_0x43dd70,_0x3d4d4f,_0xe7b66f,_0x15ee7a);return _0x3d4d4f||_0x12a36a['on']('removeContextItemChip',()=>{this['fire']('removeContextItem',_0x12a36a['id']);}),_0x12a36a;}['_addContextToCollection'](_0x22d52f,_0xd389d3){_0xd389d3['add'](_0x22d52f,0x0);}['_removeContextFromCollection'](_0x310bf8,_0x100e78){const _0x4c4a13=_0x100e78['find'](_0x13f6ff=>_0x13f6ff['id']===_0x310bf8);_0x4c4a13&&_0x100e78['remove'](_0x4c4a13);}['_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'](_0x3e7b4c){this['_urlInputView']['clear'](),this['hideUrlBalloonPanel'](),this['fire']('addUrlToContext',_0x3e7b4c);}}class jr extends Nt{['arrowView'];constructor(_0x4e0112){super(_0x4e0112),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 _0x32d323=new xt();return _0x32d323['content']=_0x1c55a8,_0x32d323['extendTemplate']({'attributes':{'class':Kr+'__arrow'}}),_0x32d323;}}class Jr extends vt{['_cancelButtonView'];['_loaderView'];constructor(_0x51dfe1){super(_0x51dfe1),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 _0x26ad55=new Nt(this['locale']);return _0x26ad55['set']({'label':hs(this['locale'],'AI_CHAT_STOP_GENERATING'),'withText':!0x0,'class':ls+'\x20ck-ai-button-stop-generating','icon':_0x56cd42}),_0x26ad55['on']('execute',()=>{this['fire']('abortPromptStream');}),_0x26ad55;}['_createLoaderView'](){const _0x5c2438=new vt(this['locale']);return _0x5c2438['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')}]}),_0x5c2438;}}class Zr extends vt{['_contextPanelView'];['_promptInputView'];['_promptCapabilitiesView'];['_loaderView'];['_modelUnavailableMessageView'];['_shouldRestorePromptInputFocus'];constructor(_0x361632,_0x2518c2){super(_0x361632),this['_contextPanelView']=this['_createContextPanelView'](_0x361632,{'bodyCollection':_0x2518c2['bodyCollection'],'searchInputVisibleFrom':_0x2518c2['contextResourcesSearchInputVisibleFrom']}),this['_promptInputView']=this['_createPromptInputView'](_0x361632),this['_promptCapabilitiesView']=this['_createPromptCapabilitiesView'](_0x361632),this['_loaderView']=this['_createLoaderView'](_0x361632),this['_modelUnavailableMessageView']=this['_createModelUnavailableMessageView'](_0x361632),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 _0x18581b=this['bindTemplate'];this['setTemplate']({'tag':'form','attributes':{'class':['ck','ck-ai-chat-controls',_0x18581b['if']('isDisabled','ck-ai-chat-controls-disabled')]},'children':[{'tag':'div','attributes':{'class':[_0x18581b['if']('isLoading','ck-hidden',_0x42f62c=>_0x42f62c||!this['isModelAvailable']),_0x18581b['if']('isModelAvailable','ck-hidden',_0x21aee4=>!_0x21aee4||this['isLoading'])]},'children':[this['_contextPanelView'],this['_promptInputView'],this['_promptCapabilitiesView']]},{'tag':'div','attributes':{'class':[_0x18581b['if']('isLoading','ck-hidden',_0x11ab26=>!_0x11ab26)]},'children':[this['_loaderView']]},{'tag':'div','attributes':{'class':[_0x18581b['if']('isModelAvailable','ck-hidden',_0x58464c=>_0x58464c)]},'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'](_0x30878b,_0x5d0558){return new zr(_0x30878b,_0x5d0558);}['_createPromptInputView'](_0x270978){return new hr(_0x270978,this['_contextPanelView']['addContextButtonView']);}['_createPromptCapabilitiesView'](_0x507b3b){return new Er(_0x507b3b);}['_createLoaderView'](_0x1d5364){return new Jr(_0x1d5364);}['_createModelUnavailableMessageView'](_0x2c3fd6){const _0x51bb21=new to(_0x2c3fd6);return _0x51bb21['delegate']('startConversation')['to'](this),_0x51bb21;}['_handlePromptInputFocus'](_0x4f7432,_0x148829,_0x22ba82){_0x22ba82?this['_shouldRestorePromptInputFocus']=!0x0:this['_shouldRestorePromptInputFocus']&&this['_promptInputView']['focus']();}['addContextItem'](_0x4d8528,_0x31c415){this['_contextPanelView']['addContextItem'](_0x4d8528,_0x31c415);}['removeContextItem'](_0x4f34c6){this['_contextPanelView']['removeContextItem'](_0x4f34c6);}['setContextItemLoading'](_0x191964,_0x5cc600){this['_contextPanelView']['setContextItemLoading'](_0x191964,_0x5cc600);}['setIsUploadInProgress'](_0x15471e){this['_promptInputView']['setIsUploadInProgress'](_0x15471e);}['setConversationContext'](_0x41066a){this['_contextPanelView']['setConversationContext'](_0x41066a);}['clearPendingContextUI'](){this['_contextPanelView']['clearCurrentContextItems']();}['clearConversationContextUI'](){this['_contextPanelView']['clearConversationContextItems']();}['updateResourceState'](_0x35a5aa,_0x5e4faa,_0x51214b){this['_contextPanelView']['updateResourceState'](_0x35a5aa,_0x5e4faa,_0x51214b);}['setWebSearch'](_0xffd823){this['_promptCapabilitiesView']['setWebSearch'](_0xffd823);}['setReasoning'](_0x135885){this['_promptCapabilitiesView']['setReasoning'](_0x135885);}['resetMessageInput'](){this['_promptInputView']['reset']();}['setAddContextOptions'](_0x29b36c){this['_contextPanelView']['setAddContextOptions'](_0x29b36c);}['setInputPlaceholder'](_0x481541){this['_promptInputView']['setPlaceholderText'](_0x481541);}['setModelList'](_0x3d60ed,_0x3a37dd){this['_promptCapabilitiesView']['setModelList'](_0x3d60ed,_0x3a37dd);}['setModel'](_0x5edd41){_0x5edd41?(this['isModelAvailable']=!0x0,this['_promptCapabilitiesView']['setModel'](_0x5edd41)):this['isModelAvailable']=!0x1;}['enableModelSelector'](){this['_promptCapabilitiesView']['enableModelSelector']();}['disableModelSelector'](_0x5ccaea){this['_promptCapabilitiesView']['disableModelSelector'](_0x5ccaea);}['populateSourceResourceBalloon'](_0x3241af,_0x11e01b,_0x13e946,_0x775309){this['_contextPanelView']['populateSourceResourceBalloon'](_0x3241af,_0x11e01b,_0x13e946,_0x775309);}['closeSourceResourceBalloon'](_0x4442ff){this['_contextPanelView']['closeSourceResourceBalloon'](_0x4442ff);}['focusPromptInput'](_0x41018a=!0x1){this['_promptInputView']['focus'](_0x41018a);}['setPromptInputValue'](_0x4df411){this['_promptInputView']['queryView']['fieldView']['reset'](),this['_promptInputView']['queryView']['fieldView']['value']=_0x4df411;}}class to extends vt{constructor(_0x416ac3){super(_0x416ac3);const _0x177a40=new Nt(_0x416ac3);_0x177a40['set']({'label':hs(this['locale'],'AI_CHAT_MODEL_UNAVAILABLE_MESSAGE_BUTTON'),'withText':!0x0,'class':['ck-ai-chat-controls__start-new-chat-button'],'tooltip':''}),_0x177a40['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'},_0x177a40]}]});}}class eo extends _0x189b73{['resizeButton'];constructor(_0x411867,_0x56f94b){super(_0x411867,{'label':_0x56f94b['label'],'class':'ck-ai-header\x20'+_0x56f94b['class'],'icon':_0x56f94b['icon']}),this['set']('isMaximized',!0x1),_0x56f94b['content']&&this['children']['add'](_0x56f94b['content']),_0x56f94b['showResizeButton']&&(this['resizeButton']=ds(_0x411867,this),this['children']['add'](this['resizeButton']));}}class io extends vt{constructor(_0x346245){super(_0x346245),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-disclaimer']},'children':[{'tag':'p','attributes':{'class':['ck','ck-ai-disclaimer__content']},'children':[{'text':hs(_0x346245,'AI_DISCLAIMER_TEXT')}]}]});}}function so(_0x35d5f5,_0x2cbe9f){const _0x22fdd9=new Nt(_0x35d5f5);return _0x22fdd9['set']({'label':hs(_0x35d5f5,'AI_CHAT_LABEL_NEW_CHAT'),'withText':!0x0,'icon':_0x2c183e,'class':'ck-ai-chat__start-conversation\x20'+ls}),_0x22fdd9['on']('execute',()=>{_0x2cbe9f['fire']('startConversation');}),_0x22fdd9;}class no extends vt{['chatHeader'];['chatFeed'];['chatControls'];['chatDisclaimer'];['_bodyCollection'];constructor(_0x5ae4b3,_0x1886f7){super(_0x5ae4b3),this['_bodyCollection']=new Qt(_0x5ae4b3),this['_bodyCollection']['attachToDom']();const _0x1a1a64=so(_0x5ae4b3,this);this['chatHeader']=new eo(_0x5ae4b3,{'label':hs(_0x5ae4b3,'AI_CHAT_HEADING'),'icon':_0x4dbd34,'class':'ck-ai-header_chat','content':_0x1a1a64,'showResizeButton':_0x1886f7['showResizeButton']}),this['chatHeader']['delegate']('resizeTabs')['to'](this),this['chatFeed']=new rr(_0x5ae4b3,this['_bodyCollection']),this['chatFeed']['delegate'](...tn)['to'](this),this['chatControls']=new Zr(_0x5ae4b3,{'bodyCollection':this['_bodyCollection'],'contextResourcesSearchInputVisibleFrom':_0x1886f7['contextResourcesSearchInputVisibleFrom']}),this['chatControls']['delegate'](...tn)['to'](this),this['chatDisclaimer']=new io(_0x5ae4b3),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset_all','ck-ai-chat','ck-rounded-corners'],'dir':_0x5ae4b3['uiLanguageDirection']},'children':[this['chatHeader'],this['chatFeed'],this['chatControls'],this['chatDisclaimer']]});}['populateSourceResourceBalloon'](_0x40219b,_0x15ae45,_0x22b74a,_0x569c42){this['chatControls']['populateSourceResourceBalloon'](_0x40219b,_0x15ae45,_0x22b74a,_0x569c42);}['closeSourceResourceBalloon'](_0x2eebf0){this['chatControls']['closeSourceResourceBalloon'](_0x2eebf0);}['destroy'](){this['_bodyCollection']['detachFromDom'](),super['destroy']();}}class ro extends _0x490ade{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(_0x5e8ab1){super(_0x5e8ab1);const _0x5e4505=this['context']['plugins']['get']('AITabs');this['set']('isBusy',!0x1),this['_promiseQueue']=new Cn(),this['_view']=new no(this['context']['locale'],{'showResizeButton':_0x5e4505['showResizeButton'],'contextResourcesSearchInputVisibleFrom':this['context']['config']['get']('ai.chat.context.searchInputVisibleFrom')}),this['_view']['delegate']('resizeTabs')['to'](_0x5e4505),this['_view']['delegate'](...tn)['to'](this),this['_view']['on']('toggleSuggestionDisplayMode',(_0x40fcbe,{showDiff:_0x42a9a7})=>{this['showDiff']=_0x42a9a7;}),_0x5e4505['view']['addTab']({'id':'chat','buttonLabel':hs(this['context']['locale'],'AI_CHAT_HEADING'),'buttonIcon':_0x4dbd34,'order':0x0,'content':this['_view']}),this['_view']['chatHeader']['bind']('isMaximized')['to'](_0x5e4505['view'],'isMaximized',_0x31c026=>_0x31c026),this['_view']['chatControls']['bind']('isLoading')['to'](this,'isBusy',_0x45e6bd=>_0x45e6bd),this['_view']['chatControls']['setInputPlaceholder'](this['_getInputPlaceholder']()),this['bind']('isModelAvailable')['to'](this['_view']['chatControls'],'isModelAvailable');}['destroy'](){super['destroy'](),this['_titleAnimationInterval']&&clearInterval(this['_titleAnimationInterval']);}['createConversation'](_0x4218c7){const _0x184685=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'](_0x4218c7['availableModels'],!this['context']['config']['get']('ai.models.showModelSelector')),this['addFeedItemStaticMessage']({'id':'conversation-start','staticMessage':_0x184685}),this['fire']('conversationCreated');}async['addFeedItemStaticMessage']({id:_0x5a8a80,staticMessage:_0x528d14}){return this['_promiseQueue']['enqueue'](async()=>{this['_view']['chatFeed']['addItem']('ai-reply',{'id':_0x5a8a80,'initialContent':'<p>'+_0x528d14+'</p>'});});}async['addFeedItemUserMessage'](_0x29f9d4){const _0x17460a=_0x29f9d4['attributes']?.['displayedPrompt']||_0x29f9d4['userMessage'];return this['_promiseQueue']['enqueue'](async()=>{this['_view']['chatFeed']['addItem']('user-message',{'contextItems':Array['from'](_0x29f9d4['contextItems']['values']()),'initialContent':'<p>'+_0x17460a+'</p>','id':_0x29f9d4['id']});});}async['addFeedItemError']({errorMessage:_0x555a74,id:_0x5a441b}){return this['_promiseQueue']['enqueue'](async()=>{this['_view']['chatFeed']['addItem']('error-message',{'initialContent':'<p>'+_0x555a74+'</p>','id':_0x5a441b});});}async['addFeedItemAIReply'](_0x2fd62e){return this['_promiseQueue']['enqueue'](async()=>{this['_view']['chatFeed']['addItem']('ai-reply',{'id':_0x2fd62e['interactionId']+':'+_0x2fd62e['id']}),this['clearLoadingMessage']();});}async['addFeedItemAISuggestion'](_0x59915e){const _0xec08d3=$s(this['context']);let _0x458025=_0xec08d3['config']['get']('ai.availableReplyActions')||[...fn];if(_0xec08d3['plugins']['has']('TrackChanges')){if(!this['_isTrackChangesCommandValueBound']){this['_isTrackChangesCommandValueBound']=!0x0;const _0x1d7406=_0xec08d3['commands']['get']('trackChanges');this['_view']['chatFeed']['bind']('isTrackChangesOn')['to'](_0x1d7406,'value');}}else _0x458025=_0x458025['filter'](_0x829348=>'insertSuggestion'!=_0x829348);return this['_promiseQueue']['enqueue'](async()=>{this['_view']['chatFeed']['addItem']('ai-suggestion-reply',{'id':_0x59915e['interactionId']+':'+_0x59915e['id'],'areActionsDisabled':_0x59915e['areActionsDisabled'],'showDiff':this['showDiff'],'availableActions':_0x458025}),this['clearLoadingMessage']();});}async['addFeedInteractionHeader'](_0x273e9e,_0x1c7664){return this['_promiseQueue']['enqueue'](async()=>{const _0x469d70=this['_view']['chatFeed']['children']['last'];if(_0x469d70 instanceof Zn)return this['_view']['chatFeed']['children']['remove'](_0x469d70),void this['_view']['chatFeed']['addItem']('interaction-header',{'id':_0x273e9e['id'],'capabilities':{'isWebSearchEnabled':_0x469d70['capabilities']['isWebSearchEnabled']||_0x1c7664['isWebSearchEnabled'],'isReasoningEnabled':_0x469d70['capabilities']['isReasoningEnabled']||_0x1c7664['isReasoningEnabled']}});this['_view']['chatFeed']['addItem']('interaction-header',{'id':_0x273e9e['id'],'capabilities':_0x1c7664});});}async['addFeedItemCustomElement'](_0x206a5d,_0x409bc7){let _0x20c150;return await this['_promiseQueue']['enqueue'](async()=>{_0x20c150=this['_view']['chatFeed']['addItem']('custom-element',{'content':_0x206a5d,'id':_0x409bc7});}),_0x20c150;}['removeFeedItem'](_0x243a5b){this['_view']['chatFeed']['removeItem'](_0x243a5b);}['hasFeedItem'](_0x3b2eb0){return this['_view']['chatFeed']['hasItem'](_0x3b2eb0);}['updateFeedInteractionHeader'](_0x446e58){const _0x108558=this['_view']['chatFeed']['children']['find'](_0x545fec=>_0x545fec['options']['id']==_0x446e58['id']&&_0x545fec instanceof Zn);_0x108558&&_0x108558['set']('isVisible',_0x446e58['isVisible']);}async['updateFeedItemAIReplyContent'](_0x3b1838){const _0x522dfe=_0x3b1838['renderingStrategy']||this['feedItemRenderingStrategy'];return this['_promiseQueue']['enqueue'](async _0x5c8090=>{await this['_view']['chatFeed']['updateReplyItem']({..._0x3b1838,'abortSignal':_0x5c8090,'renderingStrategy':_0x522dfe}),_0x3b1838['isDone']&&this['markFeedItemAsDone'](_0x3b1838['id']);});}['updateFeedItemAIReplySources'](_0x31f8a1,_0x56d167){this['_view']['chatFeed']['updateWebSources'](_0x31f8a1,_0x56d167);}async['updateFeedItemAIReplySuggestionContent'](_0x51c8ad){return this['_promiseQueue']['enqueue'](async _0x154a57=>{await this['_view']['chatFeed']['updateSuggestionItem']({..._0x51c8ad,'abortSignal':_0x154a57}),_0x51c8ad['isDone']&&this['markFeedItemAsDone'](_0x51c8ad['id']);});}['updateFeedItemAIReplySuggestionPartState'](_0x5d047b){this['_view']['chatFeed']['updateSuggestionPartState'](_0x5d047b);}['setFeedItemAIReplySuggestionPartActive'](_0x3aa7d3){this['_view']['chatFeed']['setSuggestionPartActive'](_0x3aa7d3);}['markFeedItemAsDone'](_0x1ce7b3){this['_view']['chatFeed']['markItemAsDone'](_0x1ce7b3);}['removeFeedInteraction'](_0x2adaa8){this['_view']['chatFeed']['getItemIds']()['filter'](_0x11add7=>_0x11add7['startsWith'](_0x2adaa8))['forEach'](_0x4b5749=>this['_view']['chatFeed']['removeItem'](_0x4b5749));}['startInteraction'](){const _0x4c93a6=this['prepareLoadingMessage']({'isWebSearchEnabled':!0x1,'isReasoningEnabled':!0x1});this['setLoadingMessage'](_0x4c93a6),this['_view']['chatControls']['disableModelSelector'](!this['context']['config']['get']('ai.models.showModelSelector')),this['isBusy']=!0x0,this['_view']['chatFeed']['startAutoScroll']();}['stopInteraction'](_0x261f23){this['_promiseQueue']['abort'](),this['_view']['chatFeed']['getItemIds']()['filter'](_0x4a5c84=>_0x4a5c84['startsWith'](_0x261f23['id']))['forEach'](_0x4c8c37=>this['markFeedItemAsDone'](_0x4c8c37)),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'](_0x3fb76f,_0x28f0bb){this['_view']['chatControls']['addContextItem'](_0x3fb76f,_0x28f0bb);}['removeContextItem'](_0x1f1d56){this['_view']['chatControls']['removeContextItem'](_0x1f1d56);}['setContextItemLoading'](_0x162043,_0x85b8df){this['_view']['chatControls']['setContextItemLoading'](_0x162043,_0x85b8df);}['setIsUploadInProgress'](_0x52fbd9){this['_view']['chatControls']['setIsUploadInProgress'](_0x52fbd9);}['setConversationContext'](_0x41d0bb){this['_view']['chatControls']['setConversationContext'](_0x41d0bb);}['clearPendingContextUI'](){this['_view']['chatControls']['clearPendingContextUI']();}['clearConversationContextUI'](){this['_view']['chatControls']['clearConversationContextUI']();}['updateResourceState'](_0x3c9b46,_0x4bdb15,_0xf4d26c){this['_view']['chatControls']['updateResourceState'](_0x3c9b46,_0x4bdb15,_0xf4d26c);}['resetMessageInput'](){this['_view']['chatControls']['resetMessageInput'](),this['_view']['chatControls']['setInputPlaceholder'](this['_getInputPlaceholder']());}['setAddContextOptions'](_0x45c471){this['_view']['chatControls']['setAddContextOptions'](_0x45c471);}['updateCapabilities'](_0x3faabf){this['_view']['chatControls']['setWebSearch'](_0x3faabf['isWebSearchEnabled']),this['_view']['chatControls']['setReasoning'](_0x3faabf['isReasoningEnabled']),this['_view']['chatControls']['setInputPlaceholder'](this['_getInputPlaceholder'](_0x3faabf));}['setSelectedModel'](_0x1f01f6,_0x3dc10e){this['_view']['chatControls']['setModel'](_0x1f01f6),_0x3dc10e&&this['_view']['chatControls']['disableModelSelector'](!0x1);}['setFeedItemRenderingStrategy'](_0x59814f){this['feedItemRenderingStrategy']=_0x59814f;}['toggleLoadingSkeleton'](_0x3b649b){this['_view']['chatFeed']['toggleLoadingSkeleton'](_0x3b649b);}['resetConversationTitle'](){this['setConversationTitle'](hs(this['context']['locale'],'AI_CHAT_HEADING'));}['setConversationTitle'](_0x15fef8,_0x51dbf6=!0x1){if(_0x51dbf6&&!St()&&_0x15fef8['length'])return this['_view']['chatHeader']['label']='',void this['_animateConversationTitle'](_0x15fef8);this['_view']['chatHeader']['label']=_0x15fef8;}['setLoadingMessage'](_0x342776){this['_view']['chatFeed']['setLoadingMessage'](_0x342776);}['clearLoadingMessage'](){this['_view']['chatFeed']['setLoadingMessage']('');}['_animateConversationTitle'](_0x136439){let _0x3a1ccb=0x0;clearInterval(this['_titleAnimationInterval']),this['_titleAnimationInterval']=setInterval(()=>{this['_view']['chatHeader']['label']=this['_view']['chatHeader']['label']+_0x136439[_0x3a1ccb],_0x3a1ccb++,_0x3a1ccb===_0x136439['length']&&clearInterval(this['_titleAnimationInterval']);},0x1e);}['prepareLoadingMessage'](_0x5d9136){return _0x5d9136['isWebSearchEnabled']&&_0x5d9136['isReasoningEnabled']?hs(this['context']['locale'],'AI_CHAT_FEED_LOADING_MESSAGE_WEBSEARCH_REASONING'):_0x5d9136['isWebSearchEnabled']?hs(this['context']['locale'],'AI_CHAT_FEED_LOADING_MESSAGE_WEBSEARCH'):_0x5d9136['isReasoningEnabled']?hs(this['context']['locale'],'AI_CHAT_FEED_LOADING_MESSAGE_REASONING'):hs(this['context']['locale'],'AI_CHAT_FEED_LOADING_MESSAGE_REGULAR');}['_getInputPlaceholder'](_0x3114be){return _0x3114be?_0x3114be['isWebSearchEnabled']&&_0x3114be['isReasoningEnabled']?hs(this['context']['locale'],'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_WEBSEARCH_REASONING'):_0x3114be['isWebSearchEnabled']?hs(this['context']['locale'],'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_WEBSEARCH'):_0x3114be['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'](_0x57bfae,_0x5e6872,_0x5836ce,_0x4087d1){this['_view']['populateSourceResourceBalloon'](_0x57bfae,_0x5e6872,_0x5836ce,_0x4087d1);}['closeSourceResourceBalloon'](_0x3705ad){this['_view']['closeSourceResourceBalloon'](_0x3705ad);}['setPromptInputValue'](_0x5e1e72){this['_view']['chatControls']['setPromptInputValue'](_0x5e1e72);}['focusPromptInput'](_0xfecaa2=!0x1){this['_view']['chatControls']['focusPromptInput'](_0xfecaa2);}['scrollFeedToSuggestion'](_0xa40e9d,_0x7dd8ed){this['_view']['chatFeed']['scrollToSuggestion'](_0xa40e9d,_0x7dd8ed);}['startAutoScroll'](_0x5d7031={}){this['_view']['chatFeed']['startAutoScroll'](_0x5d7031);}['disableControls'](){this['_view']['chatControls']['isDisabled']=!0x0;}['enableControls'](){this['_view']['chatControls']['isDisabled']=!0x1;}}class oo extends Dt{['sections'];constructor(_0x6ed0ad,_0x28bbbe){super(_0x6ed0ad),this['sections']=_0x28bbbe,this['items']['addMany'](this['sections']),this['extendTemplate']({'attributes':{'class':['ck-ai-chat-history__sections']}});}['filter'](_0x2281ec){let _0x13b24e=0x0,_0x19f3ea=0x0;for(const _0x5a6296 of this['sections']){const {resultsCount:_0x495bdc,totalItemsCount:_0x47ddfa}=_0x5a6296['filter'](_0x2281ec);_0x13b24e+=_0x495bdc,_0x19f3ea+=_0x47ddfa;}return{'resultsCount':_0x13b24e,'totalItemsCount':_0x19f3ea};}}class ao extends Ht{['title'];['itemsViews'];['_itemsListView'];constructor(_0x1579b6,{title:_0x4f417b,items:_0x4406a0}){super(_0x1579b6);const _0x5a9cbd=this['bindTemplate'];this['set']('isVisible',!0x0),this['title']=_0x4f417b,this['itemsViews']=_0x4406a0;const _0x234bfd=new vt(_0x1579b6);_0x234bfd['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-chat-history__section-title']},'children':[this['title']]}),this['_itemsListView']=new Dt(_0x1579b6),this['_itemsListView']['items']['addMany'](this['itemsViews']),this['setTemplate']({'tag':'li','attributes':{'class':['ck-ai-chat-history__section',_0x5a9cbd['if']('isVisible','ck-hidden',_0x4ecc4e=>!_0x4ecc4e)]},'children':[_0x234bfd,this['_itemsListView']]});}['filter'](_0x396c0f){const _0xc83ac8=this['itemsViews']['length'];let _0x14b026=0x0;for(const _0x28c823 of this['itemsViews']){if(_0x396c0f){const _0x5e4334=_0x28c823['isMatching'](_0x396c0f);_0x28c823['isVisible']=!!_0x5e4334,_0x28c823['highlightText'](_0x396c0f);}else _0x28c823['isVisible']=!0x0,_0x28c823['highlightText'](null);_0x28c823['isVisible']&&_0x14b026++;}return this['isVisible']=_0x14b026>0x0,{'resultsCount':_0x14b026,'totalItemsCount':_0xc83ac8};}['getItem'](_0x1b26c3){return this['itemsViews']['find'](_0x28367b=>_0x28367b['id']===_0x1b26c3);}['removeItem'](_0x530ce9){const _0x50e92a=this['itemsViews']['indexOf'](_0x530ce9);-0x1!==_0x50e92a&&(this['itemsViews']['splice'](_0x50e92a,0x1),this['_itemsListView']['items']['remove'](_0x530ce9));}}class ho extends/* #__PURE__ -- @preserve */
|
|
27
|
+
_0x287790(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(_0x3039ef,_0x319e90){super(_0x3039ef);const _0x10c621=this['bindTemplate'];this['set']('isEdit',!0x1),this['set']('isVisible',!0x0),this['set']('pinned',!!_0x319e90['pinned']),this['set']('loadingState',null),this['set']('title',_0x319e90['title']),this['id']=_0x319e90['id'];const {createdAt:_0x565005,active:_0x44e856=!0x1}=_0x319e90;this['_titleView']=new _0x3716e9(),this['_titleView']['bind']('text')['to'](this,'title',t=>_0x1db613(t||'')),this['_titleView']['extendTemplate']({'attributes':{'class':['ck-ai-chat-history__item-title']}});const _0x4a3987=this['_createCheckView'](),_0x4d54d4=this['_createPinButtonView'](_0x3039ef),_0x8b285f=this['_createMenuDropdownView'](),_0x2ee5b7=this['_createEditInputView'](_0x3039ef),_0x3a7b1d=this['_createAcceptEditButtonView'](_0x3039ef,_0x2ee5b7),_0x24678a=this['_createCancelEditButtonView'](_0x3039ef);this['actions']=this['createCollection'](),this['mainContent']=this['createCollection'](),this['mainContent']['add'](this['_titleView']),this['actions']['add'](_0x4d54d4),this['actions']['add'](_0x8b285f),this['on']('change:isEdit',(_0x262b64,_0x4083a,_0x332e2d)=>{this['actions']['clear'](),this['mainContent']['clear'](),_0x332e2d?(this['actions']['add'](_0x3a7b1d),this['actions']['add'](_0x24678a),this['mainContent']['add'](_0x2ee5b7),_0x2ee5b7['element']['value']=this['title']||'',_0x2ee5b7['element']['focus']()):(this['actions']['add'](_0x4d54d4),this['actions']['add'](_0x8b285f),this['mainContent']['add'](this['_titleView']));}),this['setTemplate']({'tag':'li','attributes':{'class':['ck-ai-chat-history__item',_0x44e856?'ck-ai-chat-history__item--active':'',_0x10c621['if']('isVisible','ck-hidden',_0x247347=>!_0x247347),_0x10c621['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',_0x10c621['if']('loadingState','ck-hidden',_0x5d035c=>!!_0x5d035c)]},'children':_0x44e856?[_0x4a3987]:[]},{'tag':'div','attributes':{'class':['ck-ai-loader',_0x10c621['if']('loadingState','ck-hidden',_0x5c37ba=>!_0x5c37ba)]},'children':[this['_createSpinnerView']()]}]},{'tag':'div','attributes':{'class':['ck-ai-chat-history__item-row']},'children':[{'tag':'div','attributes':{'class':['ck-ai-chat-history__item-content']},'on':{'click':this['bindTemplate']['to']('click')},'children':[{'tag':'div','attributes':{'class':['ck-ai-chat-history__item-main-content']},'children':[{'tag':'div','attributes':{'class':['ck-ai-chat-history__item-title-container',_0x10c621['if']('loadingState','ck-hidden',_0x29f366=>!!_0x29f366)]},'children':this['mainContent']},{'tag':'div','attributes':{'class':['ck-ai-loader__text',_0x10c621['if']('loadingState','ck-hidden',_0x2331dd=>!_0x2331dd)]},'children':[{'text':_0x10c621['to']('loadingState',_0x2b1662=>_0x2b1662?hs(this['locale'],ho['LOADING_LABELS'][_0x2b1662]):'')}]}]},{'tag':'span','attributes':{'class':['ck-ai-chat-history__item-date']},'children':[_0x565005]}]},{'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'](_0x2d87c4){this['set']('title',_0x2d87c4);}['updateLoadingState'](_0x1e3837,_0xe972eb){this['set']('loadingState',_0xe972eb?_0x1e3837:null);}['_createCheckView'](){const _0x1aef8e=new xt();return _0x1aef8e['set']({'content':_0x202ca3}),_0x1aef8e;}['_createPinButtonView'](_0x541469){const _0x34dc31=new Nt(_0x541469);return _0x34dc31['set']({'label':hs(_0x541469,'AI_CHAT_HISTORY_PIN_BUTTON'),'icon':_0x5bdc0f,'withText':!0x1,'tooltip':!0x0}),_0x34dc31['bind']('isOn')['to'](this,'pinned'),_0x34dc31['on']('execute',()=>{const _0x35da19=!this['pinned'];this['fire']('setConversationPinned',{'id':this['id'],'pinned':_0x35da19});}),_0x34dc31;}['_createMenuDropdownView'](){const _0x60fb32=Gt(this['locale']),_0x4c039c=_0x60fb32['panelView']['children'];_0x60fb32['buttonView']['set']({'label':hs(this['locale'],'AI_CHAT_HISTORY_SHOW_MORE_ITEMS'),'icon':_0x43d94f}),_0x60fb32['panelPosition']='sw';const _0x40c4a2=new Nt(this['locale']);_0x40c4a2['label']=hs(this['locale'],'AI_CHAT_HISTORY_EDIT_NAME'),_0x40c4a2['withText']=!0x0,_0x40c4a2['on']('execute',()=>{this['isEdit']=!0x0;});const _0x37ec65=new Nt(this['locale']);_0x37ec65['label']=hs(this['locale'],'AI_CHAT_HISTORY_REMOVE'),_0x37ec65['withText']=!0x0,_0x37ec65['on']('execute',()=>{this['showConfirm'](hs(this['locale'],'AI_CHAT_HISTORY_REMOVE_CONFIRM'),this['element'])['then'](()=>{this['fire']('removeConversation',{'id':this['id']});});});const _0x250fbf=new Dt(this['locale']),_0x2caae2=new Ht(this['locale']);_0x2caae2['children']['add'](_0x40c4a2);const _0x15b9a1=new Ht(this['locale']);return _0x15b9a1['children']['add'](_0x37ec65),_0x250fbf['items']['addMany']([_0x2caae2,_0x15b9a1]),_0x4c039c['add'](_0x250fbf),_0x60fb32;}['_createEditInputView'](_0x17e3d8){const _0x1dad1f=new _0x4d8a82(_0x17e3d8),_0x7cecf1=_0x1dad1f['bindTemplate'];return _0x1dad1f['extendTemplate']({'on':{'keydown':_0x7cecf1['to'](_0x45e88f=>{'Enter'==_0x45e88f['key']&&this['_commitEditInputValue'](_0x1dad1f);})}}),_0x1dad1f;}['_createAcceptEditButtonView'](_0x58daa2,_0x400e69){const _0x10980e=new Nt(_0x58daa2);return _0x10980e['set']({'icon':_0x202ca3,'withText':!0x1,'tooltip':hs(_0x58daa2,'AI_CHAT_HISTORY_ACCEPT')}),_0x10980e['extendTemplate']({'attributes':{'class':['ck-confirm-view-submit']}}),_0x10980e['on']('execute',()=>{this['_commitEditInputValue'](_0x400e69);}),_0x10980e;}['_commitEditInputValue'](_0x7e9753){const _0x4a86f6=_0x7e9753['element']['value']||'';this['isEdit']=!0x1,this['fire']('editConversationTitle',{'id':this['id'],'title':_0x4a86f6});}['_createCancelEditButtonView'](_0x1de56c){const _0x31249b=new Nt(_0x1de56c);return _0x31249b['set']({'icon':_0xf8dc71,'withText':!0x1,'tooltip':hs(_0x1de56c,'AI_CHAT_HISTORY_CANCEL')}),_0x31249b['extendTemplate']({'attributes':{'class':['ck-confirm-view-cancel']}}),_0x31249b['on']('execute',()=>{this['isEdit']=!0x1,this['fire']('edit:cancel');}),_0x31249b;}['_createSpinnerView'](){const _0x50cd72=new yn('tiny');return _0x50cd72['isVisible']=!0x0,_0x50cd72;}['isMatching'](_0x2a8709){return'string'==typeof this['title']&&this['title']['match'](_0x2a8709)?{'title':!0x0}:null;}['highlightText'](_0x3a08e8){this['_titleView']['highlightText'](_0x3a08e8);}}class co extends vt{['headerView'];['searchView'];['mainErrorView'];['skeletonView'];['emptyView'];['sectionsView'];constructor(_0x1f768a,_0x71b51a){super(_0x1f768a),this['set']('hasItems',!0x1),this['set']('isLoading',!0x0),this['set']('errorMessage',''),this['set']('isSearchViewVisible',!0x1),this['set']('isEmptyViewVisible',!0x1),this['set']('isMainErrorViewVisible',!0x1);const _0x2a73d3=so(_0x1f768a,this);this['headerView']=new eo(_0x1f768a,{'label':hs(_0x1f768a,'AI_CHAT_HISTORY_HEADING'),'icon':_0x4ccc15,'class':'ck-ai-header_history','content':_0x2a73d3,'showResizeButton':_0x71b51a}),this['headerView']['delegate']('resizeTabs')['to'](this),this['sectionsView']=new oo(_0x1f768a,[]),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',_0xc4b174=>!_0xc4b174)]}}),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 _0x264c73=new _0x10c502(this['locale'],{'filteredView':this['sectionsView'],'queryView':{'label':hs(this['locale'],'AI_CHAT_HISTORY_SEARCH_LABEL')},'infoView':{'text':{'notFound':{'primary':_0x5a3393=>hs(this['locale'],'AI_CHAT_HISTORY_SEARCH_NOT_FOUND_PRIMARY',_0x5a3393),'secondary':hs(this['locale'],'AI_CHAT_HISTORY_SEARCH_NOT_FOUND_SECONDARY')}}}}),_0x1e50c9=this['_createErrorView']();return _0x1e50c9['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('errorMessage','ck-hidden',_0xfb40a2=>!_0xfb40a2)]}}),_0x264c73['on']('render',()=>{_0x264c73['children']['add'](_0x1e50c9,0x1);}),_0x264c73['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isSearchViewVisible','ck-hidden',_0xabefa9=>!_0xabefa9)]}}),_0x264c73;}['_createSkeletonView'](){const _0x321c98=new pn(this['locale'],mn['aiHistory']);return _0x321c98['bind']('isVisible')['to'](this,'isLoading'),_0x321c98;}['_createErrorView'](){const _0x24777d=new vt(this['locale']),_0x1ab351=new Nt(this['locale']);_0x1ab351['set']({'withText':!0x1,'icon':_0xf8dc71,'class':'ck-ai-notification_error__dismiss-button'}),_0x1ab351['bind']('isVisible')['to'](this,'hasItems',_0x16b7a1=>!!_0x16b7a1),_0x1ab351['on']('execute',()=>{this['errorMessage']='';});const _0x3f4039=this['bindTemplate'];return _0x24777d['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-notification','ck-ai-notification_error']},'children':[{'tag':'p','children':[{'text':_0x3f4039['to']('errorMessage')}]},_0x1ab351]}),_0x24777d;}['_createEmptyStateView'](){const _0x2e7e5d=new vt(this['locale']);return _0x2e7e5d['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-chat-history__empty',this['bindTemplate']['if']('isEmptyViewVisible','ck-hidden',_0x283659=>!_0x283659)]},'children':[{'tag':'p','attributes':{'class':['ck-ai-chat-history__empty-message']},'children':[hs(this['locale'],'AI_CHAT_HISTORY_EMPTY_MESSAGE')]}]}),_0x2e7e5d;}['_createListItemViews'](_0x20a9b2,_0x1563b5){const _0x33d1a5=[];for(const _0x285719 of _0x20a9b2){const _0x367143=new ho(_0x1563b5,_0x285719);_0x367143['delegate'](...lo)['to'](this),_0x33d1a5['push'](_0x367143);}return _0x33d1a5;}['updateHistoryItemsWithCategories'](_0x292e53){const _0x4eb609=this['locale']||'en',_0xbfa438=[];for(const _0x25adcd of _0x292e53){const _0x168486=this['_createListItemViews'](_0x25adcd['items'],_0x4eb609);_0xbfa438['push'](new ao(_0x4eb609,{'title':_0x25adcd['title'],'items':_0x168486}));}this['sectionsView']['sections']=_0xbfa438,this['sectionsView']['items']['clear'](),this['sectionsView']['items']['addMany'](_0xbfa438),this['hasItems']=_0x292e53['some'](_0x501f4c=>_0x501f4c['items']['length']>0x0),this['_refreshSearch']();}['removeHistoryItem'](_0x356ea6){for(const _0x359136 of this['sectionsView']['sections']){const _0x2105d5=_0x359136['getItem'](_0x356ea6);if(_0x2105d5){if(_0x359136['removeItem'](_0x2105d5),0x0===_0x359136['itemsViews']['length']){const _0x37a89d=this['sectionsView']['sections']['indexOf'](_0x359136);-0x1!==_0x37a89d&&(this['sectionsView']['sections']['splice'](_0x37a89d,0x1),this['sectionsView']['items']['remove'](_0x359136));}this['hasItems']=this['sectionsView']['sections']['length']>0x0,this['_refreshSearch']();break;}}}['updateItemTitle'](_0x11c67c,_0x203455){for(const _0x50f46a of this['sectionsView']['sections']){const _0x1dfcb0=_0x50f46a['getItem'](_0x11c67c);if(_0x1dfcb0){_0x1dfcb0['updateTitle'](_0x203455);break;}}}['updateItemLoadingState'](_0xd480b9,_0x580915,_0x24b1d2){for(const _0x1398c6 of this['sectionsView']['sections']){const _0x2d7231=_0x1398c6['getItem'](_0xd480b9);if(_0x2d7231){_0x2d7231['updateLoadingState'](_0x580915,_0x24b1d2);break;}}}['_refreshSearch'](){if(this['hasItems']){const _0x44a41a=this['searchView']['queryView']['fieldView']?.['element']?.['value']||'';this['searchView']['search'](_0x44a41a);}}}const lo=['showConversationHistory','removeConversation','editConversationTitle','setConversationPinned','selectConversation','startConversation'];class uo extends _0x490ade{static get['requires'](){return[os];}['_historyView'];static get['pluginName'](){return'AIChatHistoryUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x4cee06){super(_0x4cee06);const _0x4a876f=this['context']['plugins']['get']('AITabs');this['_historyView']=new co(this['context']['locale'],_0x4a876f['showResizeButton']),this['_historyView']['delegate']('resizeTabs')['to'](_0x4a876f),this['_historyView']['delegate'](...lo)['to'](this),this['_historyView']['headerView']['bind']('isMaximized')['to'](_0x4a876f['view'],'isMaximized',_0xe0550b=>_0xe0550b),_0x4a876f['view']['addTab']({'id':'history','buttonLabel':hs(this['context']['locale'],'AI_CHAT_HISTORY_HEADING'),'buttonIcon':_0x4ccc15,'order':0x0,'content':this['_historyView']});}['removeHistoryItem'](_0x313b78){this['_historyView']['removeHistoryItem'](_0x313b78);}['updateItems'](_0x43d83e){this['_historyView']['updateHistoryItemsWithCategories'](_0x43d83e);}['updateItemTitle'](_0x2ff82c,_0x3d8c8f){this['_historyView']['updateItemTitle'](_0x2ff82c,_0x3d8c8f);}['updateItemLoadingState'](_0x127e78,_0x431efe,_0x48631a){this['_historyView']['updateItemLoadingState'](_0x127e78,_0x431efe,_0x48631a);}['setLoadingSkeleton'](_0xd9bb67){this['_historyView']['isLoading']=_0xd9bb67;}['showError'](_0xf3bdef){this['_historyView']['errorMessage']=_0xf3bdef;}['hideError'](){this['_historyView']['errorMessage']='';}}class _o extends ht(){['id'];['createdAt'];constructor({id:_0x5e48df,title:_0x1db63c,createdAt:_0x577f4b,updatedAt:_0x506423,pinned:_0x113d51}){super(),this['id']=_0x5e48df,this['createdAt']=new Date(_0x577f4b),this['set']('title',_0x1db63c),this['set']('updatedAt',_0x506423?new Date(_0x506423):null),this['set']('pinned',_0x113d51||!0x1);}['updateTitle'](_0x1ec65e){this['set']('title',_0x1ec65e),this['updatedAt']=new Date();}['updatePinned'](_0x193e1c){this['set']('pinned',_0x193e1c),this['updatedAt']=new Date();}}class go extends Tt(){['items']=[];['connector'];['group'];constructor({connector:_0x22c5d7,group:_0x27181c}){super(),this['connector']=_0x22c5d7,this['group']=_0x27181c;}async['init'](){try{const _0x2be2d9=this['connector']['fetchConversations'](this['group']),_0x2fa288=await _0x2be2d9['getConversations']();this['loadItems'](_0x2fa288);}catch(_0x5037c0){this['fire']('error',{'error':_0x5037c0,'operation':'init'});}}['addItem'](_0x1164e7){this['items']['push'](_0x1164e7);}async['removeItem'](_0x25b6bf){const _0x43464d=this['items']['findIndex'](_0x29c87f=>_0x29c87f['id']===_0x25b6bf);if(-0x1===_0x43464d)return!0x1;try{return await this['connector']['deleteConversation'](_0x25b6bf)['execute'](),this['items']['splice'](_0x43464d,0x1),this['fire']('itemRemoved',{'itemId':_0x25b6bf}),!0x0;}catch(_0x2636f3){return this['fire']('error',{'error':_0x2636f3,'operation':'removeItem','itemId':_0x25b6bf}),!0x1;}}['getItem'](_0x6ca10e){return this['items']['find'](_0x358096=>_0x358096['id']===_0x6ca10e);}async['updateItemTitle'](_0x40a49b,_0x58a962){const _0x32e23f=this['getItem'](_0x40a49b);if(!_0x32e23f)return!0x1;try{return await this['connector']['updateConversation'](_0x40a49b,{'title':_0x58a962})['getResult'](),_0x32e23f['updateTitle'](_0x58a962),this['fire']('itemUpdated',{'itemId':_0x40a49b,'updates':{'title':_0x58a962}}),!0x0;}catch(_0x58ff70){return this['fire']('error',{'error':_0x58ff70,'operation':'updateItemTitle','itemId':_0x40a49b}),!0x1;}}async['updateItemPinned'](_0x4fe8d5,_0x1b0c9f){const _0x5559f6=this['getItem'](_0x4fe8d5);if(!_0x5559f6)return!0x1;try{return await this['connector']['updateConversation'](_0x4fe8d5,{'pinned':_0x1b0c9f})['getResult'](),_0x5559f6['updatePinned'](_0x1b0c9f),this['fire']('itemUpdated',{'itemId':_0x4fe8d5,'updates':{'pinned':_0x1b0c9f}}),!0x0;}catch(_0x2c8208){return this['fire']('error',{'error':_0x2c8208,'operation':'updateItemPinned','itemId':_0x4fe8d5}),!0x1;}}['loadItems'](_0x420796){try{this['items']=[],_0x420796['map'](_0x1e55d1=>{this['addItem'](new _o(_0x1e55d1));}),this['fire']('itemsLoaded',{'items':[...this['items']]});}catch(_0x3d7254){this['fire']('error',{'error':_0x3d7254,'operation':'loadItems'});}}['getItems'](_0xbace71={}){const _0x5dfb7d=void 0x0!==_0xbace71['pinned']&&_0xbace71['pinned'],_0x3f2537=_0xbace71['from']?new Date(_0xbace71['from']['getFullYear'](),_0xbace71['from']['getMonth'](),_0xbace71['from']['getDate']()):null,_0x38b2da=_0xbace71['to']?new Date(_0xbace71['to']['getFullYear'](),_0xbace71['to']['getMonth'](),_0xbace71['to']['getDate']()):null;return this['items']['filter'](_0x129ce2=>{if(_0x129ce2['pinned']!==_0x5dfb7d)return!0x1;if(_0x38b2da){const _0x9e4d38=new Date(_0x129ce2['createdAt']['getFullYear'](),_0x129ce2['createdAt']['getMonth'](),_0x129ce2['createdAt']['getDate']());return _0x3f2537?_0x3f2537['getTime']()===_0x38b2da['getTime']()?_0x9e4d38['getTime']()===_0x3f2537['getTime']():_0x9e4d38<_0x38b2da&&_0x9e4d38>=_0x3f2537:_0x9e4d38<_0x38b2da;}return!0x0;});}}class Ao extends _0x490ade{['_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 _0x31f717=this['context']['plugins']['get'](os);try{const _0x2b2444=this['_aiChatController']['getGroupId']();this['history']=new go({'connector':this['_aiConnector'],'group':_0x2b2444}),this['listenTo'](this['_aiChatHistoryUi'],'removeConversation',(_0x17e9e9,_0x485783)=>{this['_setItemLoading'](_0x485783['id'],'remove'),this['_handleRemove'](_0x485783['id']);}),this['listenTo'](this['_aiChatHistoryUi'],'editConversationTitle',(_0x79e84b,_0x26fcf8)=>{this['_setItemLoading'](_0x26fcf8['id'],'rename'),this['_handleEditTitle'](_0x26fcf8['id'],_0x26fcf8['title']);}),this['listenTo'](this['history'],'itemUpdated',(_0x3c577f,_0x54ac89)=>{void 0x0!==_0x54ac89['updates']['title']&&this['_aiChatHistoryUi']['updateItemTitle'](_0x54ac89['itemId'],_0x54ac89['updates']['title']),void 0x0!==_0x54ac89['updates']['pinned']&&this['_updateHistoryItemsUI'](),this['_clearItemLoading'](_0x54ac89['itemId']);}),this['listenTo'](this['history'],'itemRemoved',(_0x611090,_0x5b62a2)=>{this['_aiChatController']['_handleRemovedConversation'](_0x5b62a2['itemId']),this['_aiChatHistoryUi']['removeHistoryItem'](_0x5b62a2['itemId']),this['_clearItemLoading'](_0x5b62a2['itemId']);}),this['listenTo'](this['history'],'itemsLoaded',()=>{this['_updateHistoryItemsUI']();}),this['listenTo'](this['history'],'error',(_0x4ff07d,_0x205fff)=>{this['_handleHistoryErrorUI'](_0x205fff['error'],_0x205fff['operation'],_0x205fff['itemId']);}),this['listenTo'](this['_aiChatHistoryUi'],'selectConversation',(_0x2105e8,_0x159e5e)=>{this['_handleSelectConversation'](_0x159e5e['id']);}),this['listenTo'](this['_aiChatHistoryUi'],'setConversationPinned',(_0x125c65,_0x2a3c22)=>{const _0x53f87e=_0x2a3c22['pinned']?'pin':'unpin';this['_setItemLoading'](_0x2a3c22['id'],_0x53f87e),this['_handleTogglePin'](_0x2a3c22['id'],_0x2a3c22['pinned']);}),this['listenTo'](this['_aiChatHistoryUi'],'startConversation',()=>{this['_aiChatController']['startConversation'](),_0x31f717['view']['activateTab']('chat');}),this['listenTo'](this['_aiChatController'],'change:activeConversation',()=>{this['_updateHistoryItemsUI']();}),_0x31f717['view']['on']('activateTab:history',()=>{this['_showConversationHistory']();});}catch(_0x1db95d){this['_handleHistoryErrorUI'](_0x1db95d,'init');}}async['_handleEditTitle'](_0xd0c59c,_0x20b18a){await this['history']['updateItemTitle'](_0xd0c59c,_0x20b18a);}async['_handleTogglePin'](_0x263d66,_0x5281c5){await this['history']['updateItemPinned'](_0x263d66,_0x5281c5);}async['_handleRemove'](_0x8f8f32){await this['history']['removeItem'](_0x8f8f32);}async['_handleSelectConversation'](_0x2228a4){await this['_aiChatController']['loadConversation'](_0x2228a4);}async['_showConversationHistory'](){this['_aiChatHistoryUi']['showError'](''),this['_aiChatHistoryUi']['setLoadingSkeleton'](!0x0),await this['history']['init'](),this['_aiChatHistoryUi']['setLoadingSkeleton'](!0x1);}['_updateHistoryItemsUI'](){const _0x2356b6=this['_aiChatController']['activeConversation']?.['id'],_0xc208ef=this['_getCategorizedItems']()['map'](_0x4cf8f7=>({'title':_0x4cf8f7['title'],'items':_0x4cf8f7['items']['map'](_0x589ee8=>({'id':_0x589ee8['id'],'title':_0x589ee8['title']||hs(this['context']['locale'],'AI_CHAT_UNTITLED_CONVERSATION'),'createdAt':new Date(_0x589ee8['createdAt'])['toLocaleDateString'](),'active':_0x589ee8['id']===_0x2356b6,'pinned':_0x589ee8['pinned']}))}));this['_aiChatHistoryUi']['updateItems'](_0xc208ef);}['_setItemLoading'](_0x23d458,_0x8cd7fe){this['_aiChatHistoryUi']['updateItemLoadingState'](_0x23d458,_0x8cd7fe,!0x0);}['_clearItemLoading'](_0x50c530){this['_aiChatHistoryUi']['updateItemLoadingState'](_0x50c530,null,!0x1);}['_handleHistoryErrorUI'](_0x272ab2,_0x1915b7,_0x583123){const _0x1043c1=this['_generateErrorMessage'](_0x1915b7,_0x583123);this['_aiChatHistoryUi']['showError'](_0x1043c1),_0x583123&&this['_clearItemLoading'](_0x583123),this['_aiChatHistoryUi']['setLoadingSkeleton'](!0x1);}['_generateErrorMessage'](_0x4a1ec7,_0x1bb085){const _0x38cbe8=_0x1bb085?this['history']['getItem'](_0x1bb085):null,_0x30a49f=_0x38cbe8?.['title']||hs(this['context']['locale'],'AI_CHAT_UNTITLED_CONVERSATION');switch(_0x4a1ec7){case'updateItemTitle':return hs(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_UPDATE_TITLE',_0x30a49f);case'updateItemPinned':{const _0x2dbca5=hs(this['context']['locale'],_0x38cbe8?.['pinned']?'AI_CHAT_HISTORY_UNPIN_ACTION':'AI_CHAT_HISTORY_PIN_ACTION');return hs(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_UPDATE_PINNED',[_0x2dbca5,_0x30a49f]);}case'removeItem':return hs(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_REMOVE_ITEM',_0x30a49f);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 _0x530725=new Date(),_0x32e693=new Date(_0x530725['getFullYear'](),_0x530725['getMonth'](),_0x530725['getDate']()),_0x411ad1=new Date(_0x32e693);_0x411ad1['setDate'](_0x411ad1['getDate']()-0x1);const _0x768e3f=new Date(_0x32e693);_0x768e3f['setDate'](_0x768e3f['getDate']()-0xe);const _0xbc9db0=this['history']['getItems']({'pinned':!0x0}),_0x360030=this['history']['getItems']({'from':_0x32e693,'to':_0x32e693}),_0x4b272b=this['history']['getItems']({'from':_0x411ad1,'to':_0x411ad1}),_0x4fbece=this['history']['getItems']({'from':_0x768e3f,'to':_0x411ad1}),_0xbe76e9=this['history']['getItems']({'to':_0x768e3f}),_0x5dbb73=[];return _0xbc9db0['length']>0x0&&_0x5dbb73['push']({'title':hs(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_PINNED'),'items':_0xbc9db0}),_0x360030['length']>0x0&&_0x5dbb73['push']({'title':hs(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_TODAY'),'items':_0x360030}),_0x4b272b['length']>0x0&&_0x5dbb73['push']({'title':hs(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_YESTERDAY'),'items':_0x4b272b}),_0x4fbece['length']>0x0&&_0x5dbb73['push']({'title':hs(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_LAST_14_DAYS'),'items':_0x4fbece}),_0xbe76e9['length']>0x0&&_0x5dbb73['push']({'title':hs(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_LATER'),'items':_0xbe76e9}),_0x5dbb73;}}class Io extends _0x490ade{static get['requires'](){return[Ao,uo];}static get['pluginName'](){return'AIChatHistory';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}class Eo extends _0x490ade{static get['requires'](){return[Xs,Js,ro,Io];}static get['pluginName'](){return'AIChat';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x273fbb){super(_0x273fbb),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(_0x1a8716,_0x66d94){super(_0x1a8716);const {id:_0x5d9e05,type:_0x311ad9,icon:_0xbda2cc}=_0x66d94;this['id']=_0x5d9e05,this['set']({'label':_0x66d94['label'],'withText':!0x0,'class':'ck-ai-chat-shortcut'}),this['extendTemplate']({'attributes':{'data-cke-ai-shortcut-id':_0x66d94['id']}}),_0xbda2cc?this['icon']=_0xbda2cc:'chat'===_0x311ad9?this['icon']=_0x4dbd34:'review'===_0x311ad9?this['icon']=_0x2222ae:'translate'===_0x311ad9&&(this['icon']=_0x503fac);}}class mo extends vt{['listView'];constructor(_0x23cf68,_0x40643d){super(_0x23cf68);const _0x1e21a9=_0x40643d['map'](_0x406e47=>{const _0x26470c=new Ht(this['locale']),_0x59d4ee=new po(this['locale'],_0x406e47);return _0x26470c['children']['add'](_0x59d4ee),_0x59d4ee['delegate']('execute')['to'](this),_0x26470c;});this['listView']=new Dt(this['locale']),this['listView']['items']['addMany'](_0x1e21a9),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat-shortcuts']},'children':[this['listView']]});}}const To='chat-shortcuts';class Co extends _0x490ade{['_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 _0x141d6b=this['context']['plugins']['get']('AIChatController');this['_shortcuts']['length']&&(this['_validateShortcuts'](),this['_aiChatUI']['on']('conversationCreated',()=>{_0x141d6b['activeConversation']['isFromHistory']||this['_injectShortcuts']();}),this['listenTo'](_0x141d6b,'interactionStarted',()=>{this['_removeShortcuts']();}));}['_validateShortcuts'](){const _0x1d71bd=['chat','review','translate'];this['_shortcuts']['forEach'](_0x2ff977=>{let _0x1036f8=!0x0;if(_0x2ff977['id']&&_0x2ff977['label']&&_0x1d71bd['includes'](_0x2ff977['type'])?'chat'===_0x2ff977['type']&&(_0x1036f8='string'==typeof _0x2ff977['prompt']):_0x1036f8=!0x1,!_0x1036f8)throw new at('ai-chat-shortcuts-invalid-config',this['context'],{'shortcut':_0x2ff977});});}['_injectShortcuts'](){const _0x3e60e1=this['context']['plugins']['get'](ro);this['_shortcutsView']=new mo(this['context']['locale'],this['_shortcuts']),this['_shortcutsView']['render'](),_0x3e60e1['addFeedItemCustomElement'](this['_shortcutsView']['element'],To),this['_shortcutsView']['on']('execute',_0x9f5baf=>{const _0x53e88b=_0x9f5baf['source']['id'];this['_executeShortcut'](_0x53e88b);});}['_removeShortcuts'](){const _0x444cb0=this['context']['plugins']['get'](ro);_0x444cb0['hasFeedItem'](To)&&_0x444cb0['removeFeedItem'](To),this['_shortcutsView']?.['destroy']();}['_executeShortcut'](_0x7562ee){const _0x48fb4c=this['_shortcuts']['find'](_0xa11795=>_0xa11795['id']===_0x7562ee),_0x43f1c2=_0x48fb4c['type'];'chat'===_0x43f1c2?this['_runChatShortcut'](_0x48fb4c):'review'===_0x43f1c2?_0x48fb4c['commandId']?this['_runReviewShortcut'](_0x48fb4c):this['_switchTab']('reviewMode'):'translate'===_0x43f1c2&&(_0x48fb4c['language']?this['_runTranslateShortcut'](_0x48fb4c):this['_switchTab']('translate'));}['_switchTab'](_0x28b8fb){if(!this['context']['plugins']['has']('AITabs'))throw new at('ai-chat-shortcuts-ai-tabs-not-found',this['context'],{'tabName':_0x28b8fb});this['context']['plugins']['get']('AITabs')['view']['activateTab'](_0x28b8fb);}async['_runChatShortcut']({prompt:_0x3408ac,draftMode:_0x47a1b7,useWebSearch:_0x56824c=!0x1,useReasoning:_0x530815=!0x1,model:_0xe2a0c4}){const _0x2a0a1f=this['context']['plugins']['get']('AIChatController'),_0x284f30=_0x2a0a1f['activeConversation'];let _0x55081d;_0x55081d=_0xe2a0c4?await _0x284f30['chatModels']['getModel'](_0xe2a0c4):await _0x284f30['chatModels']['getDefault'](),_0x55081d&&await _0x284f30['setModel'](_0x55081d),_0x284f30['setWebSearch'](_0x56824c),_0x284f30['setReasoning'](_0x530815),_0x2a0a1f['addCurrentDocumentToChatContext'](),_0x47a1b7?(this['_aiChatUI']['setPromptInputValue'](_0x3408ac),this['_aiChatUI']['focusPromptInput'](!0x0)):_0x2a0a1f['sendMessage']({'message':_0x3408ac});}['_runReviewShortcut']({commandId:_0x1c1597,model:_0x1141e6,prompt:_0x5b85ed,params:_0x487ba9}){if(!this['context']['plugins']['has']('AIReviewModeUI'))throw new at('ai-chat-shortcuts-review-mode-not-found',this['context']);this['_switchTab']('reviewMode');const _0x2d3b56={'id':_0x1c1597,'isCustom':'custom'===_0x1c1597};_0x1141e6&&_0x5b85ed&&(_0x2d3b56['args']={'model':_0x1141e6,'prompt':_0x5b85ed}),_0x487ba9&&(_0x2d3b56['params']=_0x487ba9),this['context']['plugins']['get']('AIReviewModeUI')['fire']('runReviewCheck',_0x2d3b56);}['_runTranslateShortcut']({language:_0xf3c5f6}){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':_0xf3c5f6,'args':{'language':_0xf3c5f6}});}}class wo extends _0x353726{constructor(_0x2032b4){super(_0x2032b4);const _0x24250f=_0x2032b4['plugins']['get']('AITabs')['view'];this['bind']('value')['to'](_0x24250f,'isVisible'),this['isEnabled']=!0x0;}['execute'](){const _0xd5762=this['editor']['plugins']['get']('AITabs')['view'];_0xd5762['isVisible']=!_0xd5762['isVisible'];}}class fo extends _0x3c4360{static get['requires'](){return[os];}static get['pluginName'](){return'AIToggleButtonUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const _0x46cd5f=this['editor'];_0x46cd5f['commands']['add']('toggleAi',new wo(_0x46cd5f)),_0x46cd5f['ui']['componentFactory']['add']('toggleAi',()=>{const _0x2e3699=this['_createAIUIButton'](Nt);return _0x2e3699['set']({'tooltip':!0x0,'class':'ck-ai-toggle-button'}),_0x2e3699;}),_0x46cd5f['ui']['componentFactory']['add']('menuBar:toggleAi',()=>{const _0x41948e=this['_createAIUIButton'](Wt);return _0x41948e['set']({'role':'menuitemcheckbox'}),_0x41948e;});}['_createAIUIButton'](_0x595804){const _0x524e5b=this['editor'],_0x2ea548=_0x524e5b['commands']['get']('toggleAi'),_0x2f1cea=new _0x595804(_0x524e5b['locale']);return _0x2f1cea['set']({'label':hs(_0x524e5b['locale'],'AI_TOGGLE_BUTTON_LABEL'),'icon':_0x1434d8,'isToggleable':!0x0}),_0x2f1cea['bind']('isEnabled')['to'](_0x2ea548),_0x2f1cea['bind']('isOn')['to'](_0x2ea548,'value',_0x23126=>!!_0x23126),this['listenTo'](_0x2f1cea,'execute',()=>{_0x2ea548['execute']();}),_0x2f1cea;}}const bo=['applySuggestion','insertSuggestion','showNext','showPrevious'];class So extends vt{['_errorView'];constructor(_0x1c8498){super(_0x1c8498),this['set']('_errorMessage',''),this['set']('_isErrorVisible',!0x1);}['showBlockingError'](_0x44ff2f){this['showError'](_0x44ff2f);}['showError'](_0xb6dc5a){this['_errorView']||(this['_errorView']=this['_createErrorView']()),this['_errorMessage']=_0xb6dc5a,this['_isErrorVisible']=!0x0;}['hideError'](){this['_isErrorVisible']=!0x1;}['_createErrorView'](){const _0x4256de=new vt(this['locale']),_0xfaf8d7=new vt(this['locale']);return _0xfaf8d7['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai-suggestion__error-text']},'children':[{'text':this['bindTemplate']['to']('_errorMessage')}]}),_0x4256de['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__error','ck-ai-balloon-error',this['bindTemplate']['if']('_isErrorVisible','ck-hidden',_0x30c234=>!_0x30c234)]},'children':[_0xfaf8d7]}),_0x4256de;}}const Ro=0xa;class Oo extends _0x490ade{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'](_0xac72d4){const {id:_0x228209}=this['_currentConfig']??{};this['_currentConfig']=_0xac72d4;const {id:_0x4cbb74}=this['_currentConfig'];this['isOpen']&&_0x228209===_0x4cbb74?this['_updateDialog']():this['_showDialog']();}['close'](){const _0x44e781=this['_getTargetEditor']()['plugins']['get']('Dialog');_0x44e781['isOpen']&&this['_currentConfig']&&_0x44e781['id']===this['_currentConfig']['id']&&_0x44e781['hide']();}['_updateDialog'](){const _0x20dce4=this['_getTargetEditor']()['plugins']['get']('Dialog'),{icon:_0x565436,title:_0x2e8b61}=this['_currentConfig'];_0x20dce4['view']?.['headerView']&&(_0x20dce4['view']['headerView']['label']=_0x2e8b61,_0x20dce4['view']['headerView']['iconView']&&_0x565436&&(_0x20dce4['view']['headerView']['iconView']['content']=_0x565436)),this['_isUpdatingMarkers']=!0x0,this['_showFakeVisualSelection'](),this['_isUpdatingMarkers']=!0x1,_0x20dce4['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 _0x18da9e=this['_getTargetEditor']()['plugins']['get']('Dialog'),{id:_0x568be6,title:_0x4915c9,icon:_0x14e9b4,class:_0x2707e0,mainView:_0x4f4dd8}=this['_currentConfig'];_0x4f4dd8['delegate'](...bo)['to'](this),_0x18da9e['show']({'title':_0x4915c9,'icon':_0x14e9b4,'hasCloseButton':!0x0,'id':_0x568be6,'position':this['_calculateDialogPosition']['bind'](this),'className':'ck-ai-balloon\x20'+(_0x2707e0||''),'content':_0x4f4dd8,'onShow':_0x28d762=>{this['_showFakeVisualSelection'](),this['_setupFakeVisualSelectionMarkerRemovalListener'](),_0x28d762['view']?.['updatePosition']();const _0x299578=this['_getSelectionElements']();_0x299578&&_0x299578[0x0]&&Ct({'target':_0x299578[0x0],'ancestorOffset':0x14,'alignToTop':!0x0,'viewportOffset':{'top':0x14,'bottom':0x14,'left':0x0,'right':0x0}}),this['isOpen']=!0x0,_0x28d762['once']('hide',()=>{this['fire']('beforeDialogClosed',{'id':_0x568be6});},{'priority':'high'});},'onHide':()=>{this['_hideFakeVisualSelection'](),this['_cleanupFakeVisualSelectionMarkerRemovalListener'](),this['fire']('dialogClosed',{'id':_0x568be6}),this['isOpen']=!0x1;}});}['_calculateDialogPosition'](_0x1fc99b,_0x1d82eb){if(!_0x1d82eb){const _0x49d557=this['_getTargetRootDomRect']();if(!_0x49d557)return null;_0x1d82eb=_0x49d557;}const _0x22eb2c=this['_getSelectionElements']();if(!_0x22eb2c||0x0===_0x22eb2c['length'])return{'left':Math['round'](_0x1d82eb['left']+_0x1d82eb['width']/0x2-_0x1fc99b['width']/0x2),'top':Math['round'](_0x1d82eb['top']+_0x1d82eb['height']/0x2-_0x1fc99b['height']/0x2)};const _0x5657e5=Math['round'](_0x1d82eb['left']+_0x1d82eb['width']/0x2-_0x1fc99b['width']/0x2),_0x570347=_0x22eb2c['map'](_0x15c688=>new ut(_0x15c688)),_0x2c2697=_0x1fc99b['height'];return{'left':_0x5657e5,'top':this['_calculateOptimalTopPosition'](_0x570347,_0x2c2697,_0x1d82eb)};}['_calculateOptimalTopPosition'](_0x4f2f63,_0x2f5efb,_0x274d83){const _0x35d5f7=new ut(ct['window']),_0x4f807d=_0x4f2f63['map'](_0x3a2c5d=>_0x3a2c5d['getVisible']())['filter'](_0x6594d1=>_0x6594d1),_0x32c2f1=ut['getBoundingRect'](_0x4f807d);if(!_0x32c2f1)return Math['round'](_0x274d83['top']+_0x274d83['height']/0x2);const _0x32405f=_0x35d5f7['getIntersection'](_0x32c2f1);if(!_0x32405f)return Math['round'](_0x274d83['top']+_0x274d83['height']/0x2);const _0x44e7ef=_0x274d83['getVisible'](),_0x198f73=_0x44e7ef&&_0x32c2f1['height']>_0x44e7ef['height'],_0x58db=_0x32405f['top'],_0x3e8ec4=_0x32405f['bottom'];if(_0x198f73){const _0x24d3c5=(_0x44e7ef||_0x35d5f7)['height']/0x2-_0x2f5efb/0x2,_0x260aba=_0x58db-Ro-_0x274d83['top'],_0x5e47c9=_0x274d83['bottom']-_0x3e8ec4-Ro;return _0x260aba>=_0x2f5efb?Math['max'](Ro,_0x58db-_0x2f5efb-Ro):_0x5e47c9>=_0x2f5efb?_0x3e8ec4+Ro:Math['max'](Ro,_0x24d3c5);}const _0x3abed3=_0x58db-_0x2f5efb,_0x52ae49=_0x274d83['bottom']-_0x3e8ec4-Ro,_0x1dd01a=_0x58db-Ro-_0x274d83['top'];let _0x550fda;if(_0x52ae49>=_0x2f5efb)_0x550fda=_0x3e8ec4+Ro;else{if(_0x1dd01a>=_0x2f5efb)_0x550fda=_0x3abed3-Ro;else _0x550fda=_0x58db+_0x32c2f1['height']/0x2-_0x2f5efb/0x2;}return _0x550fda;}['_setupFakeVisualSelectionMarkerRemovalListener'](){const _0x5128ea=this['_getTargetEditor']();this['listenTo'](_0x5128ea['model']['document'],'change',()=>{if(!this['_isUpdatingMarkers']){for(const {name:_0x428625,data:{newRange:_0x2d31d8}}of _0x5128ea['model']['document']['differ']['getChangedMarkers']())if(_0x428625['startsWith'](zs+':')&&(_0x2d31d8&&(_0x2d31d8['start']['isEqual'](_0x2d31d8['end'])||'$graveyard'==_0x2d31d8['root']['rootName'])||null==_0x2d31d8)){const _0x582b07=hs(this['context']['locale'],'AI_BALLOON_SELECTION_REMOVED_ERROR');this['_currentConfig']['mainView']['showBlockingError'](_0x582b07),this['fire']('selectionRemoved');}}});}['_cleanupFakeVisualSelectionMarkerRemovalListener'](){const _0x2ce106=this['_getTargetEditor']();this['_currentConfig']['mainView']['hideError'](),this['stopListening'](_0x2ce106['model']['document']);}['_getSelectionElements'](){const _0xdbdfab=this['_getTargetEditor']();return _0x12ff67(_0xdbdfab['editing'],[..._0xdbdfab['model']['markers']['getMarkersGroup']('ai-selection'),..._0xdbdfab['model']['markers']['getMarkersGroup']('ai-balloon-selection')]);}['_getTargetRootDomRect'](){const _0x403350=this['_currentConfig']?.['ranges']?.[0x0]?.['root'];if(!_0x403350)return null;const _0x36fbcd=this['_getTargetEditor'](),_0x17b6ba=_0x36fbcd['editing']['view']['document']['getRoot'](_0x403350['rootName']);if(!_0x17b6ba)return null;const _0x403f6a=_0x36fbcd['editing']['view']['domConverter']['mapViewToDom'](_0x17b6ba);return _0x403f6a&&_0x403f6a instanceof HTMLElement?new ut(_0x403f6a):null;}}class ko extends kt{['copyButton'];['likeButton'];['dislikeButton'];['showChangesButton'];['_config'];constructor(_0x487f09,_0x14bc27={}){super(_0x487f09),this['set']('isEnabled',!0x0),this['set']('isShowChangesOn',!0x1),this['_config']={'showCopy':!0x1,'showLike':!0x1,'showDislike':!0x1,..._0x14bc27};const _0x6888cf=!(this['_config']['showCopy']||this['_config']['showChanges']||this['_config']['showLike']||this['_config']['showDislike']||this['_config']['customView']?.['length']);this['class']=_0x6888cf?'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'](_0x659690){this['showChangesButton']['isEnabled']=_0x659690;}['_setupRatingButtons'](){this['likeButton']=new Nt(this['locale']),this['likeButton']['set']({'icon':_0x37dbc3,'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':_0x36bdc1,'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':_0x3bac73,'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 _0x49397f=new xt();_0x49397f['set']({'content':_0x202ca3}),_0x49397f['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'](_0x49397f);}['_setupShowChangesButton'](){this['showChangesButton']=new Nt(this['locale']),this['showChangesButton']['set']({'icon':_0x5e81fe,'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',_0x3569dd=>_0x3569dd?_0x54c2f0:_0x5e81fe),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(_0x412bfa,_0x21bd78){super(_0x412bfa);const _0x25489e=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']=_0x21bd78,this['nextButtonView']=this['_createNextButtonView'](),this['previousButtonView']=this['_createPreviousButtonView'](),this['_streamableContentView']=new In(_0x412bfa),this['_partToolbarView']=new _n(_0x412bfa,_0x21bd78['availableActions']),this['_partToolbarView']['delegate']('applySuggestion','insertSuggestion','rejectSuggestion')['to'](this),this['_togglePartToolbarButtonsVisibility'](_0x21bd78),this['_stateView']=new un(_0x412bfa),this['_stateView']['isVisible']=!0x1,this['_miniToolbarView']=new ko(_0x412bfa,{'showChanges':'full'}),this['_miniToolbarView']['bind']('isShowChangesOn')['to'](this,'showDiff'),this['_miniToolbarView']['on']('toggleShowChanges',()=>{this['fire']('toggleSuggestionDisplayMode');}),this['_toolbarContainerView']=new vo(_0x412bfa,[this['_partToolbarView'],this['_stateView'],this['_miniToolbarView']]),this['children']=this['createCollection']([this['_streamableContentView'],this['_toolbarContainerView']]),this['on']('change:_state',(_0x44a7c1,_0x30b63d,_0x4f9a1c,_0x269c01)=>{let _0x2d762e,_0x5b20ec;'pending'===_0x269c01?(_0x2d762e=this['_partToolbarView'],_0x5b20ec=this['_stateView']):(_0x2d762e=this['_stateView'],_0x5b20ec=this['_partToolbarView']),this['_stateView']['setState'](_0x4f9a1c),_0x2d762e['isVisible']=!0x1,_0x5b20ec['isVisible']=!0x0;}),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat-balloon-main',_0x25489e['to']('_state',_0xad4a37=>'ck-ai-chat-balloon-main_state_'+_0xad4a37)]},'children':this['children']}),this['on']('change:isTrackChangesOn',()=>{this['_togglePartToolbarButtonsVisibility'](_0x21bd78);});}['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'](_0x1c3c16){_0x1c3c16?.['keepErrors']||this['hideError'](),await this['_streamableContentView']['update'](_0x1c3c16);}['setState'](_0x567e31){this['_state']=_0x567e31;}['showError'](_0x5863c1){super['showError'](_0x5863c1),this['children']['has'](this['_errorView'])||this['children']['add'](this['_errorView'],0x0);}['hideError'](){this['_isErrorVisible']&&(super['hideError'](),this['togglePartToolbarEnabled'](!0x0));}['showBlockingError'](_0x342791){super['showBlockingError'](_0x342791),this['togglePartToolbarEnabled'](!0x1);}['toggleRotatorButtonsVisibility'](_0x11c94f){this['nextButtonView']['isVisible']=this['previousButtonView']['isVisible']=_0x11c94f;}['togglePartToolbarEnabled'](_0x597051){this['_partToolbarView']['isEnabled']=_0x597051;}['_togglePartToolbarButtonsVisibility']({showApplyButton:_0x40e80b,showSuggestButton:_0xeab54c}){_0x40e80b=_0x40e80b&&!this['isTrackChangesOn']&&this['_config']['availableActions']['includes']('applySuggestion'),_0xeab54c=_0xeab54c&&this['_config']['availableActions']['includes']('insertSuggestion'),this['_partToolbarView']['setButtonsVisibility']({'showApplyButton':_0x40e80b,'showSuggestButton':_0xeab54c});}['_createNextButtonView'](){const _0x53fbcd=new Nt(this['locale']);return _0x53fbcd['set']({'icon':_0x445f3e,'label':hs(this['locale'],'AI_BALLOON_NEXT_LABEL'),'isVisible':!0x0}),_0x53fbcd['on']('execute',()=>{this['fire']('showNext');}),_0x53fbcd;}['_createPreviousButtonView'](){const _0x24f8e4=new Nt(this['locale']);return _0x24f8e4['set']({'icon':_0x54bbe3,'label':hs(this['locale'],'AI_BALLOON_PREVIOUS_LABEL'),'isVisible':!0x0}),_0x24f8e4['on']('execute',()=>{this['fire']('showPrevious');}),_0x24f8e4;}}class vo extends vt{constructor(_0x348b6c,_0x5d386b){super(_0x348b6c),this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-chat-balloon__toolbar-container']},'children':_0x5d386b});}}class yo extends _0x3c4360{static get['requires'](){return[Bt,Oo];}static get['pluginName'](){return'AIChatBalloon';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['_chatBalloonView'];constructor(_0x3a2f5d){super(_0x3a2f5d),this['set']('showDiff',!0x1);}['open'](_0x1ce3cf){const _0x4da5cf=this['editor'];this['_chatBalloonView']||(this['_chatBalloonView']=this['_createChatBalloonView']()),_0x4da5cf['plugins']['get']('AIBalloon')['open']({..._0x1ce3cf,'id':'aiChatBalloon','class':'ck-ai-chat-balloon','mainView':this['_chatBalloonView']}),this['_toggleRotatorButtonsInDialogHeader'](_0x1ce3cf['showRotator']),this['_chatBalloonView']['togglePartToolbarEnabled'](!_0x1ce3cf['areActionsDisabled']),this['_restoreDefaultViewFocus']();}['close'](){this['editor']['plugins']['get']('AIBalloon')['close']();}['updateContent'](_0x45e7a3){return this['_chatBalloonView']||(this['_chatBalloonView']=this['_createChatBalloonView']()),this['_chatBalloonView']['updateContent'](_0x45e7a3);}['setState'](_0x3e28de){this['_chatBalloonView']&&this['_chatBalloonView']['setState'](_0x3e28de);}['_createChatBalloonView'](){const _0x57ae7d=this['editor'],_0x11c343=_0x57ae7d['plugins']['get']('AIBalloon'),_0x6da1b1=_0x57ae7d['commands']['get']('trackChanges');let _0x5c31f1=_0x57ae7d['config']['get']('ai.availableReplyActions')||[...fn];_0x57ae7d['plugins']['has']('TrackChanges')||(_0x5c31f1=_0x5c31f1['filter'](_0x3ba2e8=>'insertSuggestion'!=_0x3ba2e8));const _0x37f349=new No(_0x57ae7d['locale'],{'availableActions':_0x5c31f1,'showApplyButton':!0x0,'showSuggestButton':!!_0x6da1b1});return _0x37f349['bind']('showDiff')['to'](this),_0x37f349['delegate'](...Zs)['to'](this),_0x37f349['delegate']('showPrevious','showNext')['to'](this),_0x11c343['delegate']('dialogClosed')['to'](this),_0x37f349['on']('applySuggestion',this['_restoreDefaultViewFocus']['bind'](this)),_0x37f349['on']('insertSuggestion',this['_restoreDefaultViewFocus']['bind'](this)),_0x37f349['on']('rejectSuggestion',this['_restoreDefaultViewFocus']['bind'](this)),_0x6da1b1&&_0x37f349['bind']('isTrackChangesOn')['to'](_0x6da1b1,'value'),_0x37f349['render'](),_0x37f349;}['_toggleRotatorButtonsInDialogHeader'](_0x797e15){const _0x28b54b=this['editor'],_0x45135c=_0x28b54b['plugins']['get']('Dialog')['view']['headerView']['children'];this['_chatBalloonView']['toggleRotatorButtonsVisibility'](_0x797e15),_0x45135c['has'](this['_chatBalloonView']['previousButtonView'])||(_0x45135c['addMany']([this['_chatBalloonView']['previousButtonView'],this['_chatBalloonView']['nextButtonView']],0x0),_0x28b54b['plugins']['get']('AIBalloon')['once']('beforeDialogClosed',()=>{_0x45135c['remove'](this['_chatBalloonView']['previousButtonView']),_0x45135c['remove'](this['_chatBalloonView']['nextButtonView']);}));}['_restoreDefaultViewFocus'](){this['_chatBalloonView']['focus']();}}class xo extends _0x3c4360{static get['requires'](){return[fo,yo,_0x402556];}static get['pluginName'](){return'AIEditorIntegration';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}function Lo(_0xa8bfc4){const {editor:_0x181253,action:_0x4d7a99,withText:_0x173927=!0x1,withIcon:_0x18b8f0=!0x0,isInDropdown:_0x20c2df=!0x0,shouldPreventFocus:_0x40e6e0=!0x1}=_0xa8bfc4;return()=>{const _0x420ea2=_0x181253['locale'],_0x1ead27=new Nt(_0x420ea2),_0x2de07d=_0x1ead27['bindTemplate'];_0x20c2df&&_0x1ead27['extendTemplate']({'on':{'mouseenter':_0x2de07d['to'](()=>{_0x40e6e0&&_0x40e6e0()||_0x1ead27['focus']();})}});const _0x45c0de=_0x4d7a99['icon']??_0x4d7a99['parent']?.['icon'];return _0x1ead27['set']({'label':_0x4d7a99['label'],'withText':_0x173927,'role':'menuitem','icon':_0x18b8f0?_0x45c0de??_0x1457fe:void 0x0,'tooltip':!_0x173927,'class':'ck-ai-quick-actions-button','isEnabled':_0x4d7a99['isEnabled']}),_0x1ead27['on']('execute',()=>{_0x181253['editing']['view']['focus'](),_0x181253['commands']['execute']('aiQuickAction',_0x4d7a99);}),_0x1ead27;};}class Do extends _0x34fbce{['arrowView'];constructor(_0x452eb2,_0x65b8be){super(_0x452eb2,_0x65b8be);const _0x1f3ac0=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',_0x296afa=>String(_0x296afa)),'data-cke-tooltip-disabled':_0x1f3ac0['to']('isOn')},'on':{'mouseenter':_0x1f3ac0['to']('mouseenter')}});}['render'](){super['render'](),this['children']['add'](this['arrowView']);}['_createArrowView'](){const _0x58ba2a=new xt();return _0x58ba2a['content']=_0x1c55a8,_0x58ba2a['extendTemplate']({'attributes':{'class':'ck-dropdown-menu-list__nested-menu__button__arrow'}}),_0x58ba2a;}}class Po extends Dt{['_allListItems'];['_allSearchableItems'];constructor(_0x2cdfa6,_0x320500,_0x199eca){super(_0x2cdfa6),this['_allListItems']=_0x320500,this['_allSearchableItems']=_0x199eca;}['filter'](_0x2f22bc){if(!_0x2f22bc)return this['items']['clear'](),this['items']['addMany'](this['_allListItems']),this['_clearHighlight'](),{'resultsCount':this['_allListItems']['length'],'totalItemsCount':this['_allListItems']['length']};const _0x31c288=_0x2f22bc['source']['toLowerCase']()['trim'](),_0x3d27fe=this['_allSearchableItems']['filter'](_0x4c7d5b=>(_0x4c7d5b['groupLabel']?_0x4c7d5b['label']+'\x20('+_0x4c7d5b['groupLabel']+')':_0x4c7d5b['label'])['toLowerCase']()['includes'](_0x31c288));return this['items']['clear'](),this['items']['addMany'](_0x3d27fe['sort']((_0x3a0806,_0x3ad911)=>{const _0x43fa43=_0x3a0806['groupLabel'],_0x57109f=_0x3ad911['groupLabel'];return _0x43fa43||_0x57109f?_0x43fa43?0x1:-0x1:0x0;})['map'](_0x2069dc=>_0x2069dc['item'])),this['_highlightQuery'](_0x31c288,_0x3d27fe),{'resultsCount':_0x3d27fe['length'],'totalItemsCount':this['_allSearchableItems']['length']};}['_highlightQuery'](_0x101648,_0x4f443e){if(!_0x101648)return;const _0x25fc97=new RegExp(_0x865c1f(_0x101648),'gi');_0x4f443e['forEach'](_0x1481b5=>{_0x1481b5['highlightViews']&&_0x1481b5['highlightViews']['forEach'](_0x41b090=>{'function'==typeof _0x41b090['highlightText']&&_0x41b090['highlightText'](_0x25fc97);});});}['_clearHighlight'](){this['_allSearchableItems']['forEach'](_0x542cd2=>{_0x542cd2['highlightViews']&&_0x542cd2['highlightViews']['forEach'](_0x32ee21=>{'function'==typeof _0x32ee21['highlightText']&&_0x32ee21['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(_0x1b80ad,_0x274cde,_0xc69b7a,_0x23075f,_0x335bbf=!0x1){const _0x40431f=_0x1b80ad['locale'];super(_0x40431f),this['_bodyCollection']=_0x23075f,this['_hasSearch']=_0x335bbf;const _0x1272d1=this['_createListItems'](_0x1b80ad,_0x274cde,_0xc69b7a);this['optionsListView']=new Po(_0x40431f,_0x1272d1,this['_allSearchableItems']),this['optionsListView']['role']=Ho,this['optionsListView']['items']['addMany'](_0x1272d1),this['focusTracker']=new _t(),this['keystrokes']=new gt(),_0x335bbf&&(this['_searchTextView']=this['_createSearchTextView']()),this['_focusables']=_0x1272d1,this['focusCycler']=new Ut({'focusables':this['_focusables'],'focusTracker':this['focusTracker'],'keystrokeHandler':this['keystrokes']}),_0x335bbf&&this['_searchTextView']&&this['focusCycler']['chain'](this['_searchTextView']['focusCycler']);const _0xf33c68=_0x335bbf&&this['_searchTextView']?[this['_searchTextView']]:[this['optionsListView']];this['children']=new _0x4a50ef(_0xf33c68),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset_all','ck-ai-quick-actions','ck-rounded-corners'],'dir':_0x40431f['uiLanguageDirection']},'children':this['children']});}['_createSearchTextView'](){return new _0x10c502(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 _0x1a02e7=this['_searchTextView']['queryView']['fieldView']['element']['ownerDocument']?.['activeElement'];return this['_searchTextView']['queryView']['fieldView']['element']['contains'](_0x1a02e7);}['_createListItems'](_0x1d48da,_0x320bc7,_0x1db497){const _0x4ff45f=new _0x4a50ef();return _0x320bc7['forEach'](_0x520bd4=>{if('actions'in _0x520bd4){const {listItem:_0x1a35fd}=this['_createActionGroupButton'](_0x1d48da,_0x520bd4,_0x1db497);_0x4ff45f['add'](_0x1a35fd),_0x520bd4['actions']['forEach'](_0x39e26e=>{this['_createActionButton'](_0x1d48da,_0x39e26e,_0x520bd4['label'],_0x520bd4['icon']);const {listItem:_0x2f27a3,highlightViews:_0x42af93}=this['_createSearchResultActionButton'](_0x1d48da,_0x39e26e,_0x520bd4['label'],_0x520bd4['icon']);this['_allSearchableItems']['push']({'item':_0x2f27a3,'label':_0x39e26e['label'],'groupLabel':_0x520bd4['label'],'highlightViews':_0x42af93});});}else{const {listItem:_0x34a1ec}=this['_createActionButton'](_0x1d48da,_0x520bd4);_0x4ff45f['add'](_0x34a1ec);const _0x589235=_0x34a1ec['children']['first'];if(_0x589235){const {listItem:_0x2c66a8,highlightViews:_0x49de42}=this['_createSearchResultActionButton'](_0x1d48da,_0x520bd4);this['_allSearchableItems']['push']({'item':_0x2c66a8,'label':_0x589235['label']||'','highlightViews':_0x49de42});}}}),_0x4ff45f;}['_createActionButton'](_0x21b4f0,_0x5d1dac,_0x35f48b,_0x1176c8){const _0x1a158a=new Ht(this['locale']);if(_0x35f48b&&_0x1176c8){const _0x2b9af1=new Nt(this['locale']),_0x5d4a5d=_0x2b9af1['bindTemplate'],_0x155c47=new _0x3716e9();_0x155c47['text']=_0x5d1dac['label'];const _0x47c6d1=new _0x3716e9();_0x47c6d1['text']=_0x35f48b;const _0x36eb8a=new xt();_0x36eb8a['content']=_0x1176c8,_0x36eb8a['extendTemplate']({'attributes':{'class':'ck-ai-quick-actions-button__group-icon'}});const _0x16c96a=new vt(this['locale']);_0x16c96a['setTemplate']({'tag':'span','attributes':{'class':'ck-ai-quick-actions-button_with-group__open-paren'},'children':[{'text':'\x20('}]});const _0x5b4d0e=new vt(this['locale']);return _0x5b4d0e['setTemplate']({'tag':'span','attributes':{'class':'ck-ai-quick-actions-button_with-group__close-paren'},'children':[{'text':')'}]}),_0x2b9af1['set']({'label':_0x5d1dac['label']+'\x20('+_0x35f48b+')','withText':!0x0,'role':'menuitem','class':'ck-ai-quick-actions-button\x20ck-ai-quick-actions-button_with-group','tooltip':!0x1}),_0x2b9af1['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':[_0x155c47,_0x16c96a,_0x36eb8a,_0x47c6d1,_0x5b4d0e],'on':{'mouseenter':_0x5d4a5d['to'](()=>{this['_isSearchFocused']()||_0x2b9af1['focus']();}),'click':_0x5d4a5d['to'](()=>{_0x2b9af1['fire']('execute');})}}),_0x2b9af1['on']('execute',()=>{_0x21b4f0['editing']['view']['focus'](),_0x21b4f0['commands']['execute']('aiQuickAction',_0x5d1dac);}),_0x1a158a['children']['add'](_0x2b9af1),{'listItem':_0x1a158a,'highlightViews':[_0x155c47,_0x47c6d1]};}{const _0x1eb8f9=new _0x1f3275(),_0x541137=new Nt(this['locale'],_0x1eb8f9),_0x553d13=_0x541137['bindTemplate'],_0x47172d=_0x5d1dac['icon']??_0x5d1dac['parent']?.['icon'],_0xd73e75=void 0x0!==_0x5d1dac['icon'];return _0x541137['set']({'label':_0x5d1dac['label'],'withText':!0x0,'role':'menuitem','icon':_0xd73e75?_0x47172d??_0x1457fe:void 0x0,'tooltip':!0x1,'class':'ck-ai-quick-actions-button'}),_0x541137['extendTemplate']({'on':{'mouseenter':_0x553d13['to'](()=>{this['_isSearchFocused']()||_0x541137['focus']();})}}),_0x541137['on']('execute',()=>{_0x21b4f0['editing']['view']['focus'](),_0x21b4f0['commands']['execute']('aiQuickAction',_0x5d1dac);}),_0x1a158a['children']['add'](_0x541137),{'listItem':_0x1a158a,'highlightViews':[_0x1eb8f9]};}}['_createSearchResultActionButton'](_0x393c2,_0x392584,_0x219030,_0x324082){return _0x219030&&_0x324082?this['_createSearchResultGroupedActionButton'](_0x393c2,_0x392584,_0x219030,_0x324082):this['_createSearchResultIndividualActionButton'](_0x393c2,_0x392584);}['_createSearchResultGroupedActionButton'](_0x13c669,_0x3d4d91,_0xdebc52,_0x2ba403){const _0x35e0dc=new Ht(this['locale']),_0x50d2a6=new Nt(this['locale']),_0x5f5c0c=_0x50d2a6['bindTemplate'],{view:_0x268ed5,highlightView:_0x4f8409}=this['_createSearchResultGroupRow'](_0xdebc52,_0x2ba403),{view:_0x15a467,highlightView:_0x2a11d3}=this['_createSearchResultActionRow'](_0x3d4d91['label']),_0x14435f=this['_createSearchResultContentView'](_0x268ed5,_0x15a467);return _0x50d2a6['set']({'label':_0x3d4d91['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}),_0x50d2a6['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':[_0x14435f],'on':{'mouseenter':_0x5f5c0c['to'](()=>{this['_isSearchFocused']()||_0x50d2a6['focus']();}),'click':_0x5f5c0c['to'](()=>{this['_handleSearchResultButtonClick'](_0x50d2a6);})}}),this['_setupActionButtonExecution'](_0x50d2a6,_0x13c669,_0x3d4d91),_0x35e0dc['children']['add'](_0x50d2a6),{'listItem':_0x35e0dc,'highlightViews':[_0x4f8409,_0x2a11d3]};}['_createSearchResultIndividualActionButton'](_0x56943a,_0x4c49e4){const _0xf0a618=new Ht(this['locale']),_0xb0695a=new _0x1f3275(),_0x28886b=new Nt(this['locale'],_0xb0695a),_0x212d67=_0x28886b['bindTemplate'];return _0x28886b['set']({'label':_0x4c49e4['label'],'withText':!0x0,'role':'menuitem','icon':void 0x0,'tooltip':!0x1,'class':'ck-ai-quick-actions-button\x20ck-ai-quick-actions-search-result-button'}),_0x28886b['extendTemplate']({'on':{'mouseenter':_0x212d67['to'](()=>{this['_isSearchFocused']()||_0x28886b['focus']();})}}),this['_setupActionButtonExecution'](_0x28886b,_0x56943a,_0x4c49e4),_0xf0a618['children']['add'](_0x28886b),{'listItem':_0xf0a618,'highlightViews':[_0xb0695a]};}['_createSearchResultGroupRow'](_0x5ba392,_0xe28e85){const _0x37473e=new vt(this['locale']),_0x436ca4=new xt();_0x436ca4['content']=_0xe28e85,_0x436ca4['extendTemplate']({'attributes':{'class':'ck-ai-quick-actions-button__group-icon'}});const _0x54197d=new _0x3716e9();return _0x54197d['text']=_0x5ba392,_0x37473e['setTemplate']({'tag':'div','attributes':{'class':'ck-ai-quick-actions-search-result__group-row'},'children':[_0x436ca4,_0x54197d]}),{'view':_0x37473e,'highlightView':_0x54197d};}['_createSearchResultActionRow'](_0x2a6b96){const _0x3d949d=new vt(this['locale']),_0x4249f6=new _0x3716e9();return _0x4249f6['text']=_0x2a6b96,_0x3d949d['setTemplate']({'tag':'div','attributes':{'class':'ck-ai-quick-actions-search-result__action-row'},'children':[_0x4249f6]}),{'view':_0x3d949d,'highlightView':_0x4249f6};}['_createSearchResultContentView'](_0x53f748,_0x27c733){const _0x4924d3=new vt(this['locale']);return _0x4924d3['setTemplate']({'tag':'div','attributes':{'class':'ck-ai-quick-actions-search-result__content'},'children':[_0x53f748,_0x27c733]}),_0x4924d3;}['_setupActionButtonExecution'](_0x47cde7,_0x51f39d,_0x18227c){_0x47cde7['on']('execute',()=>{_0x51f39d['editing']['view']['focus'](),_0x51f39d['commands']['execute']('aiQuickAction',_0x18227c);});}['_createActionGroupButton'](_0x3ac9f,_0xa17a0d,_0x4cd669){const _0x3d8326=new Ht(this['locale']),_0x27d1b0=new _0x1f3275(),_0x2bb1c4=new Do(this['locale'],_0x27d1b0),_0x4bb1cd=_0x2bb1c4['bindTemplate'],_0x4a7d59=this['_getPanelKeystroke'](_0x4cd669),_0x160760=this['_createGroupActionsList'](_0x3ac9f,_0xa17a0d['actions'],_0x4cd669);_0x2bb1c4['set']({'label':_0xa17a0d['label'],'withText':!0x0,'role':Mo,'icon':_0xa17a0d['icon']??_0x1457fe,'isEnabled':_0xa17a0d['actions']['some'](_0x7f2691=>_0x7f2691['isEnabled'])}),_0x2bb1c4['extendTemplate']({'on':{'mouseenter':_0x4bb1cd['to'](()=>{this['_isSearchFocused']()||_0x2bb1c4['focus']();})}});const _0x55c413=new Xt(this['locale']);return _0x55c413['extendTemplate']({'attributes':{'class':['ck','ck-reset_all','ck-ai-quick-actions-group-panel','ck-dropdown-menu__nested-menu__panel']},'on':{'keydown':_0x4bb1cd['to'](_0x4240f2=>{this['_handlePanelKeydown'](_0x4240f2,_0x4a7d59,_0x2bb1c4,_0x55c413);})}}),_0x2bb1c4['bind']('isOn')['to'](_0x55c413,'isVisible'),this['_bodyCollection']['add'](_0x55c413),_0x55c413['content']['add'](_0x160760),this['_setupGroupMenuBehavior'](_0x2bb1c4,_0x55c413),_0x3d8326['children']['add'](_0x2bb1c4),{'listItem':_0x3d8326,'highlightView':_0x27d1b0};}['_createGroupActionsList'](_0x49df26,_0x430045,_0x26adca){const _0x3b0f8e=new Dt(this['locale']);return _0x3b0f8e['extendTemplate']({'attributes':{'class':['ck','ck-reset_all','ck-ai-quick-actions-group-list','ck-dropdown-menu-list']}}),_0x430045['forEach'](_0x2902a6=>{const _0x3cbad1=new Ht(this['locale']),_0x564d6a=Lo({'editor':_0x49df26,'action':_0x2902a6,'withText':!0x0,'withIcon':!0x1,'isInDropdown':!0x0,'shouldPreventFocus':()=>this['_isSearchFocused']()})();_0x3cbad1['children']['add'](_0x564d6a),_0x26adca['focusTracker']['add'](_0x564d6a),_0x3b0f8e['items']['add'](_0x3cbad1);}),_0x3b0f8e;}['_setupGroupMenuBehavior'](_0x52aaa3,_0x59f80e){const _0x23eea5=_0x52aaa3['bindTemplate'],_0x523309=this['_getButtonKeystroke'](_0x52aaa3);_0x52aaa3['extendTemplate']({'attributes':{'class':['ck-ai-quick-actions-group-button']},'on':{'mouseenter':_0x23eea5['to'](()=>{this['_showNestedPanel'](_0x59f80e,_0x52aaa3);}),'mouseleave':_0x23eea5['to'](_0x4ea42f=>{const _0x304940=_0x4ea42f['relatedTarget'];this['_isMovingToNestedMenu'](_0x304940,_0x59f80e)||this['_hideNestedPanel'](_0x59f80e);}),'keydown':_0x23eea5['to'](_0x360cf8=>{_0x360cf8['key']==_0x523309&&(this['_showNestedPanel'](_0x59f80e,_0x52aaa3),_0x59f80e['content']['get'](0x0)['focus']());})}}),_0x59f80e['on']('render',()=>{_0x59f80e['element']?.['addEventListener']('mouseleave',_0x38a43e=>{const _0x307086=_0x38a43e['relatedTarget'];_0x52aaa3['element']?.['contains'](_0x307086)||this['_isMovingToNestedMenu'](_0x307086,_0x59f80e)||this['_hideNestedPanel'](_0x59f80e);});});}['_showNestedPanel'](_0x81e743,_0x4ee551){this['_openNestedPanels']['forEach'](_0x19cb0c=>{_0x19cb0c!==_0x81e743&&_0x19cb0c['isVisible']&&_0x19cb0c['hide']();}),_0x81e743['show'](),_0x81e743['pin']({'positions':[_0x25d722['eastSouth']],'target':_0x4ee551['element'],'fitInViewport':!0x0}),this['_openNestedPanels']['add'](_0x81e743);}['_hideNestedPanel'](_0x597416){_0x597416['hide'](),this['_openNestedPanels']['delete'](_0x597416);}['_hideAllNestedPanels'](){this['_openNestedPanels']['forEach'](_0x5231a2=>_0x5231a2['hide']()),this['_openNestedPanels']['clear']();}['_isMovingToNestedMenu'](_0x4e1e45,_0x35e56f){if(!_0x4e1e45)return!0x1;if(_0x35e56f['element']?.['contains'](_0x4e1e45))return!0x0;const _0x454802=_0x4e1e45;return _0x454802['closest']&&(null!==_0x454802['closest']('.ck-ai-quick-actions-group-panel')||null!==_0x454802['closest']('.ck-ai-quick-actions-group-list')||null!==_0x454802['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'](_0x23ba03){return'rtl'===_0x23ba03['locale']['uiLanguageDirection']?'ArrowRight':'ArrowLeft';}['_getButtonKeystroke'](_0x12e89a){return'rtl'===_0x12e89a['locale']['uiLanguageDirection']?'ArrowLeft':'ArrowRight';}['_handlePanelKeydown'](_0x1ea651,_0xc8421d,_0x4919dd,_0x4a5876){_0x1ea651['key']==_0xc8421d&&(_0x4919dd['focus'](),this['_hideNestedPanel'](_0x4a5876));}['_handleSearchResultButtonClick'](_0x5bb3a2){_0x5bb3a2['fire']('execute');}}function Vo(_0x2510c9){const {editor:_0x1e7c13,content:_0xb7544e,buttonDefinition:_0x597516,bodyCollection:_0x43d064,hasSearch:_0x44a138=!0x1}=_0x2510c9;return()=>{const _0x47cba0=_0x1e7c13['locale'],_0x5494b4=_0x1e7c13['commands']['get']('aiQuickAction'),_0x39f625=Gt(_0x47cba0);_0x39f625['bind']('isEnabled')['to'](_0x5494b4),_0x39f625['buttonView']['set']({'icon':_0x597516['icon']??_0x1457fe,'label':_0x597516['label'],'tooltip':!0x0}),_0x39f625['set']({'class':'ck-ai-quick-actions-dropdown'});const _0x1c48ad=new Uo(_0x1e7c13,_0xb7544e,_0x39f625,_0x43d064,_0x44a138);return _0x39f625['panelView']['children']['add'](_0x1c48ad),_0x44a138&&_0x39f625['on']('change:isOpen',(_0x246bea,_0x4510bd,_0x4a2bc9)=>{if(_0x4a2bc9){if(_0x1e7c13['plugins']['has']('AIEditing')){const _0x20a627=_0x1e7c13['plugins']['get'](Js),_0x214862=_0x1e7c13['model']['document']['selection'],_0x1d84fd=Array['from'](_0x214862['getRanges']());_0x1d84fd['length']>0x0&&_0x20a627['showFakeVisualSelection']({'ranges':_0x1d84fd,'id':'quick-action','priority':0x14});}}else _0x1e7c13['plugins']['has']('AIEditing')&&_0x1e7c13['plugins']['get'](Js)['hideFakeVisualSelection']('quick-action'),_0x1c48ad['resetSearch']();}),_0x39f625;};}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 _0x3c4360{static get['requires'](){return[_0x3d1dd2,as];}static get['pluginName'](){return'AIQuickActionsUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}async['init'](){const _0xdf926b=await this['_getDefaultAndCustomActions']();this['_prepareQuickActionsDefinition'](_0xdf926b),this['_initializeQuickActionsComponentsAndCommands']();}static['getDefaultQuickActions'](_0x223289){return function(_0x1026bb){const _0x20f38f=new Intl['DisplayNames'](['en'],{'type':'language'})['of'](_0x1026bb['uiLanguage']),_0x5b7632=_0x20f38f||'English',_0x4494ba=[{'id':'ask-ai','label':hs(_0x1026bb,'AI_QUICK_ACTIONS_ASK_AI'),'type':'chat','icon':_0x5df412},{'id':'chat-commands','label':hs(_0x1026bb,'AI_QUICK_ACTIONS_CHAT_COMMANDS'),'icon':_0x5df412,'actions':[{'id':'explain','label':hs(_0x1026bb,'AI_QUICK_ACTIONS_EXPLAIN'),'displayedPrompt':hs(_0x1026bb,'AI_QUICK_ACTIONS_EXPLAIN'),'prompt':Bo['replace']('%0',_0x5b7632),'type':'chat'},{'id':'summarize','label':hs(_0x1026bb,'AI_QUICK_ACTIONS_SUMMARIZE'),'displayedPrompt':hs(_0x1026bb,'AI_QUICK_ACTIONS_SUMMARIZE'),'prompt':Go['replace']('%0',_0x5b7632),'type':'chat'},{'id':'highlight-key-points','label':hs(_0x1026bb,'AI_QUICK_ACTIONS_HIGHLIGHT_KEY_POINTS'),'displayedPrompt':hs(_0x1026bb,'AI_QUICK_ACTIONS_HIGHLIGHT_KEY_POINTS'),'prompt':Fo['replace']('%0',_0x5b7632),'type':'chat'}]},{'id':'improve-writing','label':hs(_0x1026bb,'AI_QUICK_ACTIONS_IMPROVE_WRITING'),'type':'action','icon':_0x250d0d},{'id':'continue','label':hs(_0x1026bb,'AI_QUICK_ACTIONS_CONTINUE_WRITING'),'type':'action','icon':_0x32b2b5},{'id':'fix-grammar','label':hs(_0x1026bb,'AI_QUICK_ACTIONS_FIX_GRAMMAR_SPELLING'),'type':'action','icon':_0x11716f},{'id':'adjust-length','label':hs(_0x1026bb,'AI_QUICK_ACTIONS_ADJUST_LENGTH'),'icon':_0x395348,'actions':[{'id':'make-shorter','label':hs(_0x1026bb,'AI_QUICK_ACTIONS_MAKE_SHORTER'),'type':'action'},{'id':'make-longer','label':hs(_0x1026bb,'AI_QUICK_ACTIONS_MAKE_LONGER'),'type':'action'}]},{'id':'change-tone','label':hs(_0x1026bb,'AI_QUICK_ACTIONS_CHANGE_TONE'),'icon':_0x1c636a,'actions':[{'id':'make-tone-casual','label':hs(_0x1026bb,'AI_QUICK_ACTIONS_MORE_CASUAL'),'type':'action'},{'id':'make-tone-direct','label':hs(_0x1026bb,'AI_QUICK_ACTIONS_MORE_DIRECT'),'type':'action'},{'id':'make-tone-friendly','label':hs(_0x1026bb,'AI_QUICK_ACTIONS_MORE_FRIENDLY'),'type':'action'},{'id':'make-tone-confident','label':hs(_0x1026bb,'AI_QUICK_ACTIONS_MORE_CONFIDENT'),'type':'action'},{'id':'make-tone-professional','label':hs(_0x1026bb,'AI_QUICK_ACTIONS_MORE_PROFESSIONAL'),'type':'action'}]},{'id':'translate','label':hs(_0x1026bb,'AI_QUICK_ACTIONS_TRANSLATE'),'icon':_0x503fac,'actions':[{'id':'translate-to-english','label':hs(_0x1026bb,'AI_QUICK_ACTIONS_TRANSLATE_ENGLISH'),'type':'action','actionName':'translate','args':{'language':'english'}},{'id':'translate-to-chinese','label':hs(_0x1026bb,'AI_QUICK_ACTIONS_TRANSLATE_CHINESE'),'type':'action','actionName':'translate','args':{'language':'chinese'}},{'id':'translate-to-spanish','label':hs(_0x1026bb,'AI_QUICK_ACTIONS_TRANSLATE_SPANISH'),'type':'action','actionName':'translate','args':{'language':'spanish'}},{'id':'translate-to-german','label':hs(_0x1026bb,'AI_QUICK_ACTIONS_TRANSLATE_GERMAN'),'type':'action','actionName':'translate','args':{'language':'german'}},{'id':'translate-to-french','label':hs(_0x1026bb,'AI_QUICK_ACTIONS_TRANSLATE_FRENCH'),'type':'action','actionName':'translate','args':{'language':'french'}},{'id':'translate-to-japanese','label':hs(_0x1026bb,'AI_QUICK_ACTIONS_TRANSLATE_JAPANESE'),'type':'action','actionName':'translate','args':{'language':'japanese'}},{'id':'translate-to-portuguese','label':hs(_0x1026bb,'AI_QUICK_ACTIONS_TRANSLATE_PORTUGUESE'),'type':'action','actionName':'translate','args':{'language':'portuguese'}},{'id':'translate-to-korean','label':hs(_0x1026bb,'AI_QUICK_ACTIONS_TRANSLATE_KOREAN'),'type':'action','actionName':'translate','args':{'language':'korean'}},{'id':'translate-to-italian','label':hs(_0x1026bb,'AI_QUICK_ACTIONS_TRANSLATE_ITALIAN'),'type':'action','actionName':'translate','args':{'language':'italian'}},{'id':'translate-to-russian','label':hs(_0x1026bb,'AI_QUICK_ACTIONS_TRANSLATE_RUSSIAN'),'type':'action','actionName':'translate','args':{'language':'russian'}}]},{'id':'other','label':hs(_0x1026bb,'AI_QUICK_ACTIONS_OTHER'),'icon':_0x56fb4d,'actions':[]}];return _0x4494ba;}(_0x223289);}async['_getDefaultAndCustomActions'](){const _0x1294f0=Wo['getDefaultQuickActions'](this['editor']['locale']),_0x40d5b4=this['editor']['config']['get']('ai.quickActions.extraCommands')||[];let _0xe6499b,_0x175edc=[];try{const _0x3c7c2e=new Fs({'connector':this['editor']['plugins']['get']('AIConnector'),'config':this['editor']['config']['get']('ai.models'),'locale':this['editor']['locale']});_0x175edc=await _0x3c7c2e['getAll'](),_0xe6499b=(await _0x3c7c2e['getDefault']())?.['id'];}catch(_0x5813d3){const _0x65a7b9=new at('ai-quick-actions-models-unable-to-retrieve',this,{'error':_0x5813d3});Et(_0x65a7b9['message']);}finally{const _0x93170a=_0x40d5b4['map'](_0x2a4d15=>({..._0x2a4d15,'type':'chat'===_0x2a4d15['type']?'chat':'action','model':'chat'!==_0x2a4d15['type']?_0x2a4d15['model']||_0xe6499b:_0x2a4d15['model'],'icon':void 0x0}));_0x1294f0['find'](_0x20492e=>'other'===_0x20492e['id'])['actions']['push'](..._0x93170a),_0x1294f0['forEach'](_0x1147c7=>{if('actions'in _0x1147c7)_0x1147c7['actions']['forEach'](_0x214e2c=>{if(_0x214e2c['isEnabled']=!!_0x175edc['find'](_0x592a0e=>_0x592a0e['id']===_0x214e2c['model'])||void 0x0===_0x214e2c['model'],!_0x214e2c['isEnabled']){const _0xbf35a=new at('ai-quick-actions-unavailable-model',this,{'actionId':_0x214e2c['id'],'modelId':_0x214e2c['model']});Et(_0xbf35a['message']);}});else{if(_0x1147c7['isEnabled']=!!_0x175edc['find'](_0xe482bc=>_0xe482bc['id']===_0x1147c7['model'])||void 0x0===_0x1147c7['model'],!_0x1147c7['isEnabled']){const _0x415237=new at('ai-quick-actions-unavailable-model',this,{'actionId':_0x1147c7['id'],'modelId':_0x1147c7['model']});Et(_0x415237['message']);}}});}return _0x1294f0;}['_initializeQuickActionsComponentsAndCommands'](){const _0x4c518a=new Qt(this['editor']['locale']);_0x4c518a['attachToDom'](),this['_initializeQuickActionsDropdown'](_0x4c518a),this['_initializeQuickActionsMenuBar'](),this['_initializeQuickActionsComponents'](_0x4c518a);}['_initializeQuickActionsDropdown'](_0x31cc93){const _0xe1aa9e=this['editor']['config']['get']('ai.quickActions.isSearchEnabled')??!0x0;this['editor']['ui']['componentFactory']['add']('aiQuickActions',Vo({'editor':this['editor'],'content':this['_quickActionsDefinition'],'buttonDefinition':{'icon':_0x1457fe,'label':hs(this['editor']['locale'],'AI_QUICK_ACTIONS_HEADING')},'bodyCollection':_0x31cc93,'hasSearch':_0xe1aa9e}));}['_prepareQuickActionsDefinition'](_0x488f36){this['_quickActionsDefinition']=_0x488f36['map'](_0x577cf1=>{if('actions'in _0x577cf1){const _0x198675=_0x577cf1;return{..._0x198675,'actions':_0x198675['actions']['map'](_0x43a7f1=>{const {actions:_0x469712,..._0x26f7b4}=_0x198675;return{..._0x43a7f1,'parent':_0x26f7b4};})['filter'](_0x41b209=>this['_shouldIncludeAction'](_0x41b209))};}return _0x577cf1;})['filter'](_0x3fea95=>'actions'in _0x3fea95?_0x3fea95['actions']['length']>0x0:this['_shouldIncludeAction'](_0x3fea95));}['_shouldIncludeAction'](_0x404c3e){const _0x53fa62=this['editor']['config']['get']('ai.quickActions.removeCommands')||[];return this['editor']['plugins']['has'](Ko[_0x404c3e['type']])&&!_0x53fa62['includes'](_0x404c3e['id'])&&!('chat'===_0x404c3e['type']&&!0x1===this['editor']['config']['get']('ai.chat.context.document.enabled'));}['_initializeQuickActionsComponents'](_0x3f158d){this['_quickActionsDefinition']['forEach'](_0x2b3187=>{if('actions'in _0x2b3187){const _0x53da24=Vo({'editor':this['editor'],'content':_0x2b3187['actions'],'buttonDefinition':_0x2b3187,'bodyCollection':_0x3f158d});this['editor']['ui']['componentFactory']['add'](_0x2b3187['id'],_0x53da24),_0x2b3187['actions']['forEach'](_0x3ef630=>{const _0x54d51e=Lo({'editor':this['editor'],'action':_0x3ef630});this['editor']['ui']['componentFactory']['add'](_0x3ef630['id'],_0x54d51e);});}else{const _0x3176de=Lo({'editor':this['editor'],'action':_0x2b3187,'withText':!0x1,'withIcon':!0x0,'isInDropdown':!0x1});this['editor']['ui']['componentFactory']['add'](_0x2b3187['id'],_0x3176de);}});}['_initializeQuickActionsMenuBar'](){this['editor']['ui']['componentFactory']['add']('menuBar:aiQuickActions',_0x4e667a=>{const _0x36c7f9=this['editor']['commands']['get']('aiQuickAction'),_0x144a64=new Kt(_0x4e667a),_0x4a6e6a=hs(_0x4e667a,'AI_QUICK_ACTIONS_HEADING');_0x144a64['buttonView']['set']({'label':_0x4a6e6a,'icon':_0x1457fe});const _0x59d28f=new $t(_0x4e667a);return _0x59d28f['set']({'ariaLabel':_0x4a6e6a,'role':'menu'}),this['_quickActionsDefinition']['forEach'](_0xea302a=>{if('actions'in _0xea302a){const _0x1e3bf9=_0xea302a,_0x2ed28c=new qt(_0x4e667a,_0x144a64),_0xad0db2=new Kt(_0x4e667a),_0x1836ce=new $t(_0x4e667a);_0xad0db2['buttonView']['set']({'label':_0x1e3bf9['label'],'icon':_0x1e3bf9['icon']}),_0x1e3bf9['actions']['forEach'](_0x19e692=>{const _0xca5c9=new qt(_0x4e667a,_0xad0db2),_0x11ee33=new Wt(_0x4e667a);_0x11ee33['set']({'label':_0x19e692['label'],'icon':_0x19e692['icon'],'role':'menuitem','isEnabled':_0x19e692['isEnabled']}),_0x11ee33['on']('execute',()=>{this['_executeQuickAction'](_0x19e692);}),_0x11ee33['delegate']('execute')['to'](_0xad0db2),_0xca5c9['children']['add'](_0x11ee33),_0x1836ce['items']['add'](_0xca5c9);}),_0xad0db2['panelView']['children']['add'](_0x1836ce),_0x2ed28c['children']['add'](_0xad0db2),_0x59d28f['items']['add'](_0x2ed28c);}else{const _0x151303=_0xea302a,_0x420440=new qt(_0x4e667a,_0x144a64),_0x54dad4=new Wt(_0x4e667a);_0x54dad4['set']({'label':_0x151303['label'],'icon':_0x151303['icon'],'role':'menuitem','isEnabled':_0x151303['isEnabled']}),_0x54dad4['on']('execute',()=>{this['_executeQuickAction'](_0x151303);}),_0x54dad4['delegate']('execute')['to'](_0x144a64),_0x420440['children']['add'](_0x54dad4),_0x59d28f['items']['add'](_0x420440);}}),(Object['values'](Ko)['some'](_0x441269=>this['editor']['plugins']['has'](_0x441269))?_0x144a64['bind']('isEnabled')['to'](_0x36c7f9):_0x144a64['set']({'isEnabled':!0x1}),_0x144a64['panelView']['children']['add'](_0x59d28f),_0x144a64);});}['_executeQuickAction'](_0x314bf0){const _0x44f689=this['editor'];_0x44f689['editing']['view']['focus'](),_0x44f689['commands']['execute']('aiQuickAction',_0x314bf0);const _0x5626fa=_0x44f689['ui']['view']['menuBarView'];_0x5626fa&&_0x5626fa['close']&&_0x5626fa['close']();}}class Yo extends _0x353726{['execute'](_0x5ba189){switch(this['_expandSelectionIfCollapsed'](),_0x5ba189['type']){case'chat':if(!this['editor']['plugins']['has']('AIChat')){const _0x44ff27=hs(this['editor']['locale'],'AI_QUICK_ACTIONS_PLUGIN_NOT_FOUND','AIChat');throw new at('ai-quick-actions-plugin-not-found',this['editor'],{'errorMessage':_0x44ff27});}this['_handleAIChatAction'](_0x5ba189);break;case'action':if(!this['editor']['plugins']['has']('AIActions')){const _0x5974a8=hs(this['editor']['locale'],'AI_QUICK_ACTIONS_PLUGIN_NOT_FOUND','AIActions');throw new at('ai-quick-actions-plugin-not-found',this['editor'],{'errorMessage':_0x5974a8});}this['_handleAIActionsAction'](_0x5ba189);}}async['_handleAIChatAction'](_0x297580){const _0x4a3705=this['editor']['plugins']['get']('AIChatController'),_0x3d2137=this['editor']['plugins']['get']('AITabs')['view'];if(_0x3d2137['isVisible']||(_0x3d2137['isVisible']=!0x0),'chat'!==_0x3d2137['activeTab']&&_0x3d2137['activateTab']('chat'),'ask-ai'===_0x297580['id'])_0x4a3705['removeSelectionFromChatContext'](),_0x4a3705['addSelectionToChatContext'](),_0x4a3705['focusPromptInput']();else await _0x4a3705['startConversation']({'modelId':_0x297580['model']}),_0x4a3705['removeSelectionFromChatContext'](),_0x4a3705['addSelectionToChatContext'](),_0x4a3705['focusPromptInput'](),await _0x4a3705['sendMessage']({'message':_0x297580['prompt']||_0x297580['displayedPrompt']||_0x297580['label'],'attributes':{'quickActionData':{'id':_0x297580['id']},'displayedPrompt':_0x297580['displayedPrompt']}});}['_expandSelectionIfCollapsed'](){const _0x210152=this['editor'],_0x1c1f7c=_0x210152['model']['document']['selection'];if(!_0x1c1f7c['isCollapsed'])return;const _0x59f7a6=At(_0x1c1f7c['getSelectedBlocks']())||_0x210152['model']['schema']['getLimitElement'](_0x1c1f7c);_0x210152['model']['change'](_0x37b46d=>{_0x37b46d['setSelection'](_0x59f7a6,'in');});}['_handleAIActionsActionLabel'](_0x245c4b){return _0x245c4b['parent']?.['label']&&'other'!==_0x245c4b['parent']?.['id']?_0x245c4b['parent']['label']+':\x20'+_0x245c4b['label']:_0x245c4b['label'];}async['_handleAIActionsAction'](_0x2862a1){const _0x3c52cb=this['editor']['plugins']['get']('AIActions'),_0x590222=_0x2862a1['prompt']?{'userMessage':_0x2862a1['prompt'],'model':_0x2862a1['model']}:{'actionName':_0x2862a1['actionName']||_0x2862a1['id'],'args':_0x2862a1['args']},_0x1f4391=this['_handleAIActionsActionLabel'](_0x2862a1);await _0x3c52cb['executeAction'](_0x590222,_0x1f4391,_0x2862a1['icon']);}}class $o extends _0x3c4360{static get['pluginName'](){return'AIQuickActionsEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const _0x4ea142=this['editor'],_0x3bfa9c=new Yo(this['editor']);if(_0x4ea142['commands']['add']('aiQuickAction',_0x3bfa9c),_0x4ea142['plugins']['has']('AIChat')){const _0x560397=this['editor']['plugins']['get']('AIChatController');_0x4ea142['model']['document']['selection']['on']('change:range',(_0x5824b7,_0x531d89)=>{_0x531d89['directChange']&&_0x560397['removeSelectionFromChatContext']();});}}}class qo extends xs{['updateChangeGroups'](){if(this['parsedMergedContent']=this['parsedContent']['cloneNode'](!0x0),0x0==this['parsedMergedContent']['childNodes']['length'])return void(this['changeGroups']=[]);const _0x4f14b4=this['documentContextContent']['children']['map'](_0x2cb045=>({'node':_0x2cb045,'id':Es(_0x2cb045,'data-id')})),_0x1147d2=this['parsedMergedContent']['children']['map'](_0x5f4b46=>({'node':_0x5f4b46,'id':Es(_0x5f4b46,'data-id')||ot()})),_0x4fdbbd=_0x3d1ad3(_0x4f14b4,_0x1147d2,{'comparator':(_0x2f2e1b,_0x3a737a)=>_0x2f2e1b['id']==_0x3a737a['id'],'oneChangePerToken':!0x0});if(!this['isDone']||!this['isComplete']){for(;_0x4fdbbd['length']&&_0x4fdbbd[_0x4fdbbd['length']-0x1]['removed'];)_0x4fdbbd['pop']();}const _0x3e4a7e=_0x4fdbbd['map'](_0x28604e=>{const _0x25b43f=_0x28604e['added']?'new':_0x28604e['removed']?'removed':'modified';return{'node':_0x28604e['value'][0x0]['node'],'type':_0x25b43f,'id':_0x28604e['value'][0x0]['id']};});this['changeGroups']=[{'changes':_0x3e4a7e,'state':'pending','index':0x0}];}['_getDifferentChangeGroups'](_0xbdf06e,_0x1569be){return _0x1569be;}}class Qo extends Ds{['content'];['version'];['actionName'];['args'];['userMessage'];['model'];['hasError']=!0x1;['stoppedExplicitly']=!0x1;constructor(_0x2466ca){super(_0x2466ca),this['content']=_0x2466ca['content'],this['version']=_0x2466ca['version'],this['actionName']=_0x2466ca['actionName'],this['args']=_0x2466ca['args'],this['userMessage']=_0x2466ca['userMessage'],this['model']=_0x2466ca['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'](_0x44f65d){const _0x5bed8c=new qo({'locale':this['locale'],'documentContextContent':this['content'],..._0x44f65d});return this['replies']['push'](_0x5bed8c),_0x5bed8c['delegate'](...Ls)['to'](this),this['fire']('replyCreated',_0x5bed8c),_0x5bed8c;}}class Xo extends kt{constructor(_0x1d41ac,_0x8dd1f9=!0x0,_0x470e1f=!0x0){super(_0x1d41ac),this['set']('isEnabled',!0x1),_0x8dd1f9&&(this['applyButton']=this['_createButton'](hs(_0x1d41ac,'AI_BALLOON_APPLY_BUTTON'),cs),this['applyButton']['bind']('isEnabled')['to'](this),this['items']['add'](this['applyButton'])),_0x470e1f&&(this['suggestButton']=this['_createButton'](hs(_0x1d41ac,'AI_BALLOON_SUGGEST_BUTTON'),_0x8dd1f9?ls:cs),this['suggestButton']['bind']('isEnabled')['to'](this),this['items']['add'](this['suggestButton'])),this['setButtonsVisibility']({'showApplyButton':_0x8dd1f9,'showSuggestButton':_0x470e1f}),this['extendTemplate']({'attributes':{'class':['ck-ai-balloon__toolbar']}});}['setButtonsVisibility']({showApplyButton:_0x11f8a4,showSuggestButton:_0x24903d}){this['applyButton']&&(this['applyButton']['isVisible']=_0x11f8a4),this['suggestButton']&&(this['suggestButton']['isVisible']=_0x24903d);}['_createButton'](_0x38b3fb,_0x9a091f){const _0x5a7e03=new Nt(this['locale']);return _0x5a7e03['set']({'label':_0x38b3fb,'class':_0x9a091f,'isVisible':!0x0,'withText':!0x0}),_0x5a7e03;}}class zo extends vt{constructor(_0x229eb4){super(_0x229eb4),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(_0x229eb4,'AI_DISCLAIMER_TEXT')}]}]});}}class jo extends vt{constructor(_0x386d07){super(_0x386d07),this['set']('isVisible',!0x0);const _0x7c3b22=new yn('small');_0x7c3b22['isVisible']=!0x0;const _0x58f2b4=new vt(this['locale']);_0x58f2b4['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',_0x1d8fe8=>!_0x1d8fe8)]},'children':[_0x7c3b22,_0x58f2b4]});}}class Jo extends So{['focusCycler'];['_config'];['_contentWrapper'];['_streamableContentView'];['_toolbarView'];['_miniToolbarView'];['_loaderView'];['_disclaimerView'];['_focusTracker'];['_keystrokes'];['_dialogContent'];['_focusables'];['_scrollManager'];['_navigationPreviousButton'];['_navigationNextButton'];['_navigationTryAgainButton'];['_navigationCounter'];constructor(_0x2058fa,_0x45e401){super(_0x2058fa),this['set']('isBusy',!0x1),this['set']('isTrackChangesOn',!0x1),this['set']('_isLoading',!0x1),this['set']('_hasError',!0x1),this['_config']=_0x45e401,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 _0x4a50ef(),this['_addContentWrapper'](_0x45e401),this['_addDisclaimerView'](),this['_addToolbar'](_0x45e401),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'](_0x45e401);});}['render'](){super['render']();for(const _0x541aac of this['_focusables'])this['_focusTracker']['add'](_0x541aac['element']);this['_keystrokes']['listenTo'](this['element']),this['_initializeScrollManager']();}['destroy'](){super['destroy'](),this['_scrollManager']&&this['_scrollManager']['destroy']();}['focus'](_0x1edc5e){-0x1===_0x1edc5e?this['focusCycler']['focusLast']():this['focusCycler']['focusFirst']();}['setIsLoading'](_0x2b2165){this['_isLoading']=_0x2b2165;}['setErrorState'](){this['_hasError']=!0x0,this['_miniToolbarView']['toggleShowChangesEnabled'](!0x1);}['clearErrorState'](){this['_hasError']=!0x1,this['_miniToolbarView']['toggleShowChangesEnabled'](!0x0);}['showError'](_0x581f22){super['showError'](_0x581f22),this['_dialogContent']['has'](this['_errorView'])||this['_dialogContent']['add'](this['_errorView'],0x0);}['hideError'](){super['hideError'](),this['clearErrorState']();}['showBlockingError'](_0x4cfed3){super['showBlockingError'](_0x4cfed3),this['setErrorState']();}['addMiniToolbarItem'](_0x267737){this['_miniToolbarView']['items']['has'](_0x267737)||this['_miniToolbarView']['items']['add'](_0x267737);}['removeMiniToolbarItem'](_0x12dc20){this['_miniToolbarView']['items']['has'](_0x12dc20)&&this['_miniToolbarView']['items']['remove'](_0x12dc20);}['showLoader'](){this['_loaderView']&&(this['_isLoading']=!0x0);}['hideLoader'](){this['_loaderView']&&(this['_isLoading']=!0x1);}['_toggleToolbarButtonsVisibility']({showApplyButton:_0x281f27,showSuggestButton:_0x22b6a2}){_0x281f27=_0x281f27&&!this['isTrackChangesOn']&&this['_config']['availableActions']['includes']('applySuggestion'),_0x22b6a2=_0x22b6a2&&this['_config']['availableActions']['includes']('insertSuggestion'),this['_toolbarView']['setButtonsVisibility']({'showApplyButton':_0x281f27,'showSuggestButton':_0x22b6a2});}async['updateContent'](_0x409c27){await this['_streamableContentView']['update'](_0x409c27);}['clearContent'](){this['_streamableContentView']['clear']();}['_addContentWrapper'](_0x53af7a){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'](_0x53af7a['miniToolbarConfig'])]}),this['_dialogContent']['add'](this['_contentWrapper']);}['_addDisclaimerView'](){this['_disclaimerView']=new zo(this['locale']),this['_dialogContent']['add'](this['_disclaimerView']);}['_addToolbar']({showApplyButton:_0x4a5be1,showSuggestButton:_0x4a242f}){this['_toolbarView']=new Xo(this['locale'],_0x4a5be1,_0x4a242f),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',(_0x18ec36,_0x2f640f,_0xcdcd89)=>!(_0x18ec36||_0x2f640f||_0xcdcd89)),this['_toggleToolbarButtonsVisibility']({'showApplyButton':_0x4a5be1,'showSuggestButton':_0x4a242f}),this['_dialogContent']['add'](this['_toolbarView']);}['_createMiniToolbar'](_0x1dd587){return this['_miniToolbarView']=new ko(this['locale'],_0x1dd587),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',(_0xd8d7ff,_0x4cd4cd)=>!(_0xd8d7ff||_0x4cd4cd)),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 _0x32fdcf=new Nt(this['locale']),_0x4117d2=new Nt(this['locale']),_0x262757=new Zo(this['locale']),_0xa38dd=new Nt(this['locale']);_0x32fdcf['set']({'icon':tt,'label':hs(this['locale'],'AI_ACTIONS_TRY_AGAIN'),'tooltip':!0x0,'class':'ck-ai-custom-action-button\x20'+us}),_0x4117d2['set']({'icon':_0x478ce3,'tooltip':hs(this['locale'],'AI_ACTIONS_PREVIOUS_INTERACTION'),'class':'ck-ai-navigation-button\x20ck-ai-previous-button\x20'+us}),_0xa38dd['set']({'icon':et,'tooltip':hs(this['locale'],'AI_ACTIONS_NEXT_INTERACTION'),'class':'ck-ai-navigation-button\x20ck-ai-next-button\x20'+us}),_0x32fdcf['bind']('isEnabled')['to'](this,'isBusy',_0x33ca88=>!_0x33ca88),_0x32fdcf['on']('execute',()=>{this['fire']('tryAgain');}),_0x4117d2['bind']('isEnabled')['to'](this,'isBusy',_0x27ebb6=>!_0x27ebb6),_0x4117d2['on']('execute',()=>{this['fire']('showPrevious');}),_0xa38dd['bind']('isEnabled')['to'](this,'isBusy',_0x29d1b1=>!_0x29d1b1),_0xa38dd['on']('execute',()=>{this['fire']('showNext');}),this['_navigationPreviousButton']=_0x4117d2,this['_navigationCounter']=_0x262757,this['_navigationNextButton']=_0xa38dd,this['_navigationTryAgainButton']=_0x32fdcf;}['updateMiniToolbarButtons'](_0xd75783,_0x5068dd){this['_navigationPreviousButton']||this['_setupMiniToolbarButtons']();const _0x5cbf5c=_0xd75783>0x1;if(this['addMiniToolbarItem'](this['_navigationTryAgainButton']),_0x5cbf5c){this['addMiniToolbarItem'](this['_navigationPreviousButton']),this['addMiniToolbarItem'](this['_navigationCounter']),this['addMiniToolbarItem'](this['_navigationNextButton']);const _0xbf59ea=_0xd75783-_0x5068dd;this['_navigationCounter']['setInteractionCount'](_0xbf59ea+'/'+_0xd75783),this['_navigationPreviousButton']['isEnabled']=_0x5068dd<_0xd75783-0x1,this['_navigationNextButton']['isEnabled']=_0x5068dd>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'](_0x5ed5e3){this['_isLoading']=_0x5ed5e3;}['resetShowChangesButton'](){this['_miniToolbarView']['isShowChangesOn']=!0x1;}['_initializeScrollManager'](){const _0x5a50e5=this['_getScrollableElement']();_0x5a50e5&&!this['_scrollManager']&&(this['_scrollManager']=new sr(_0x5a50e5));}['_getScrollableElement'](){return this['_streamableContentView']['element'];}}class Zo extends vt{constructor(_0x17fb22){super(_0x17fb22);const _0xe15fee=this['bindTemplate'];this['set']('interactionCount','1/1'),this['setTemplate']({'tag':'span','attributes':{'class':['ck-ai-interaction-counter']},'children':[{'text':_0xe15fee['to']('interactionCount')}]});}['setInteractionCount'](_0x2b4a55){this['set']('interactionCount',_0x2b4a55);}}class ta extends _0x3c4360{static get['requires'](){return[as,Bt,Js,Oo,_0x566822];}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(_0xf2bb5e){super(_0xf2bb5e),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'](_0x347ed4,_0x4df164,_0x525af7){if(this['_stopInteraction'](),this['editor']['plugins']['has']('TableSelection')){if(this['editor']['plugins']['get']('TableSelection')['getSelectedTableCells']()){const {modelFragment:_0x48450b,anchorData:_0x55a9ee,root:_0x34c3bf}=this['_getExecuteDataInTable']();return this['_executeAction'](_0x347ed4,_0x48450b,_0x55a9ee,_0x34c3bf,_0x4df164,_0x525af7);}}const {modelFragment:_0x4f0a10,anchorData:_0x3b1da2,root:_0x3098a9}=this['_getExecuteDataRegular']();return this['_executeAction'](_0x347ed4,_0x4f0a10,_0x3b1da2,_0x3098a9,_0x4df164,_0x525af7);}async['destroy'](){return this['_stopInteraction'](),this['_bodyCollection']['detachFromDom'](),super['destroy']();}['_createActionsBalloonView'](){const _0x1542e2=this['editor']['plugins']['has']('TrackChanges');let _0x49d85e=this['editor']['config']['get']('ai.availableReplyActions')||[...fn];_0x1542e2||(_0x49d85e=_0x49d85e['filter'](_0x3904f7=>'insertSuggestion'!=_0x3904f7));const _0x4ba7f5=this['editor']['commands']['get']('trackChanges'),_0x576a69=new Jo(this['editor']['locale'],{'showApplyButton':!0x0,'showSuggestButton':_0x1542e2,'miniToolbarConfig':{'showChanges':'icon'},'availableActions':_0x49d85e});return _0x576a69['bind']('isBusy')['to'](this),_0x4ba7f5&&_0x576a69['bind']('isTrackChangesOn')['to'](_0x4ba7f5,'value'),_0x576a69['on']('tryAgain',()=>{this['_refreshInteraction']();}),_0x576a69['on']('showPrevious',()=>{this['_navigateToPrevious']();}),_0x576a69['on']('showNext',()=>{this['_navigateToNext']();}),_0x576a69;}['_getExecuteDataRegular'](){const _0x162011=this['editor']['model']['document']['selection'],_0x1375d5=_0x162011['getFirstRange']()['start']['root'];if(_0x162011['isCollapsed']){const _0x5789e0=At(_0x162011['getSelectedBlocks']())||this['editor']['model']['schema']['getLimitElement'](_0x162011);this['editor']['model']['change'](_0x1f7900=>{_0x1f7900['setSelection'](_0x5789e0,'in');});}const _0x522df2=_0x162011['getFirstRange'](),_0x299f1c=this['_wrapWithCommonAncestors'](this['editor']['model']['getSelectedContent'](_0x162011),_0x522df2['start'],_0x522df2['end']);this['_copyMarkersToFragment'](_0x299f1c,_0x162011,{'isTableSelection':!0x1});const _0x3e9f4c=_0x162011['getFirstRange']()['start'],_0x1748ee=new Map();let _0x4f7a43=_0x299f1c;for(let _0x4384de=0x0;_0x4384de<_0x3e9f4c['path']['length'];_0x4384de++)_0x1748ee['set'](_0x4f7a43,_0x3e9f4c['path'][_0x4384de]),_0x4f7a43=_0x4f7a43['getChild'](0x0);return{'modelFragment':_0x299f1c,'anchorData':_0x1748ee,'root':_0x1375d5};}['_getExecuteDataInTable'](){const _0xb80e6=this['editor']['model']['document']['selection'],_0x87fa2c=this['editor']['plugins']['get']('TableSelection'),_0x5ab174=_0xb80e6['getFirstRange']()['start']['root'],_0x4b60be=_0x87fa2c['getSelectionAsFragment'](),_0x3ec686=_0xb80e6['getFirstRange']()['start']['parent']['parent'],_0x460ec2=this['editor']['model']['createRange'](this['editor']['model']['createPositionBefore'](_0x3ec686),this['editor']['model']['createPositionAfter'](_0x3ec686)),_0x497aa3=this['_wrapWithCommonAncestors'](_0x4b60be,_0x460ec2['start'],_0x460ec2['end']);this['_copyMarkersToFragment'](_0x497aa3,_0xb80e6,{'isTableSelection':!0x0});const _0x3f03a3=_0xb80e6['getFirstRange']()['start'],_0x46bb74=new Map();let _0x3b2600=_0x497aa3;for(let _0x10efa5=0x0;_0x10efa5<_0x3f03a3['path']['length'];_0x10efa5++)if(_0x46bb74['set'](_0x3b2600,_0x3f03a3['path'][_0x10efa5]),_0x10efa5<_0x3f03a3['path']['length']-0x1)_0x3b2600=_0x3b2600['getChild'](0x0);else{let _0x1fe240=_0x3b2600['nextSibling'];for(;_0x1fe240;)_0x46bb74['set'](_0x1fe240,_0x3f03a3['path'][_0x10efa5]),_0x1fe240=_0x1fe240['nextSibling'];}return{'modelFragment':_0x497aa3,'anchorData':_0x46bb74,'root':_0x5ab174};}async['_executeAction'](_0xb8322f,_0x538635,_0x2b9bbb,_0x5ecb36,_0x9019a7,_0x3caf12){const _0x1daf1c=this['editor']['plugins']['get'](Js),_0x5a56ae=this['editor']['plugins']['get'](Oo),_0x2279f9=this['editor']['model']['document']['selection'],_0x9a7de=await _0x1daf1c['modelToDataWithIds'](_0x538635),_0x7d62d3=this['editor']['model']['document']['version'],_0x3fdf24=[..._0x2279f9['getRanges']()];return this['_actionsBalloonView']||(this['_actionsBalloonView']=this['_createActionsBalloonView']()),this['_clearInteractionHistory'](),this['_clearErrorState'](),this['_balloonShowDiff']=!0x1,this['_actionsBalloonView']['resetShowChangesButton'](),this['_actionsBalloonView']['clearContent'](),_0x5a56ae['open']({'index':0x3e8*Math['random']()%0x3e8,'title':_0x9019a7,'icon':_0x3caf12||_0x1457fe,'mainView':this['_actionsBalloonView'],'class':'ck-ai-actions-balloon','ranges':_0x3fdf24,'id':'aiActionsBalloon'}),this['_setLoadingState'](),this['stopListening'](this['_actionsBalloonView']),this['stopListening'](_0x5a56ae),this['_interactionParams']={'action':_0xb8322f,'content':_0x9a7de,'version':_0x7d62d3,'aiBalloon':_0x5a56ae,'modelFragment':_0x538635,'anchorData':_0x2b9bbb,'root':_0x5ecb36},this['_setupApplyListeners'](),this['listenTo'](_0x5a56ae,'selectionRemoved',()=>{this['_stopInteraction'](),this['_actionsBalloonView']['disableMiniToolbarButtons']();}),this['listenTo'](_0x5a56ae,'dialogClosed',(_0x10cca6,{id:_0x174006})=>{if('aiActionsBalloon'===_0x174006){for(const _0x288365 of this['_interactions']){if(0x0===_0x288365['replies']['length']||_0x288365['stoppedExplicitly'])continue;const _0x185f05=_0x288365['replies'][_0x288365['replies']['length']-0x1],_0x346c7b=_0x185f05['changeGroups'][0x0];_0x346c7b&&'pending'===_0x346c7b['state']&&_0x185f05['setChangeGroupState'](0x0,'rejected');}this['_stopInteraction'](),this['_clearInteractionHistory'](),this['stopListening'](this['_actionsBalloonView']),this['stopListening'](_0x5a56ae);}}),this['_createInteraction'](_0x9a7de,_0x7d62d3,_0x5a56ae,_0xb8322f);}['_setupApplyListeners'](){if(!this['_interactionParams'])return;const {modelFragment:_0x49c74c,anchorData:_0x5f59c5,root:_0x28adae}=this['_interactionParams'];this['listenTo'](this['_actionsBalloonView'],'applySuggestion',()=>{this['_applyChanges'](_0x49c74c,_0x5f59c5,_0x28adae,!0x1);}),this['listenTo'](this['_actionsBalloonView'],'insertSuggestion',()=>{this['_applyChanges'](_0x49c74c,_0x5f59c5,_0x28adae,!0x0);});}['_wrapWithCommonAncestors'](_0x515c1e,_0x2a4024,_0x435d61){const _0x43b177=this['editor']['model']['createRange'](_0x2a4024,_0x435d61)['getCommonAncestor'](),_0x2c8249=_0x43b177['is']('documentFragment')?[]:_0x43b177['getAncestors']({'includeSelf':!0x0})['slice'](0x1);if(_0x2c8249['length']){const _0x3c0cda=_0x2c8249['map'](_0x465eca=>_0x465eca['_clone'](!0x1));for(let _0x27c3e2=0x1;_0x27c3e2<_0x3c0cda['length'];_0x27c3e2++)_0x3c0cda[_0x27c3e2-0x1]['_appendChild'](_0x3c0cda[_0x27c3e2]);return _0x3c0cda[_0x3c0cda['length']-0x1]['_appendChild'](_0x515c1e),new _0x342c55(_0x3c0cda[0x0]);}return _0x515c1e;}['_copyMarkersToFragment'](_0x505a9a,_0x1c6d49,_0x100e99={'isTableSelection':!0x1}){const _0x5df7b0=this['editor']['model'],_0x463d7c=Array['from'](_0x1c6d49['getRanges']()),_0x3fbb5a=_0x1c6d49['getFirstRange']()['start'];for(const _0x10ec26 of _0x5df7b0['markers']){if(_0x10ec26['name']['startsWith'](zs)||!_0x10ec26['affectsData'])continue;const _0x391200=_0x10ec26['getRange']();if(!_0x463d7c['some'](_0x84d0e6=>_0x84d0e6['containsRange'](_0x391200,!0x0)))continue;const _0x5ec528=this['_regularCalculateMarkerPath'](_0x391200['start'],_0x3fbb5a,_0x100e99['isTableSelection']),_0x334028=this['_regularCalculateMarkerPath'](_0x391200['end'],_0x3fbb5a,_0x100e99['isTableSelection']),_0x5118bc=_0x5df7b0['createPositionFromPath'](_0x505a9a,_0x5ec528),_0x115c68=_0x5df7b0['createPositionFromPath'](_0x505a9a,_0x334028);if(!_0x5118bc['isEqual'](_0x115c68)){const _0x4e96f9=_0x5df7b0['createRange'](_0x5118bc,_0x115c68);_0x505a9a['markers']['set'](_0x10ec26['name'],_0x4e96f9);}}}['_regularCalculateMarkerPath'](_0x453048,_0x363279,_0x1bebd0=!0x1){const _0xc7c3d2=[..._0x453048['path']['slice']()];for(let _0x2da92c=0x0;_0x2da92c<Math['max'](_0x363279['path']['length'],_0x453048['path']['length']);_0x2da92c++){const _0x2c02c1=_0x363279['path'][_0x2da92c]||0x0,_0x3b1ceb=(_0x453048['path'][_0x2da92c]||0x0)-_0x2c02c1;if(_0xc7c3d2[_0x2da92c]=_0x3b1ceb,0x0!==_0x3b1ceb&&!_0x1bebd0)break;}return _0xc7c3d2;}async['_createInteraction'](_0x13e2f3,_0x6bb475,_0x2f86d7,_0x4c5861){const _0x2698be=this['editor'];this['_interactionParams']||(this['_interactionParams']={'action':_0x4c5861,'content':_0x13e2f3,'version':_0x6bb475,'aiBalloon':_0x2f86d7,'modelFragment':this['editor']['model']['getSelectedContent'](this['editor']['model']['document']['selection']),'anchorData':new Map(),'root':this['editor']['model']['document']['selection']['getFirstRange']()['start']['root']});const _0x3348e4=new Qo({'connector':this['_aiConnector'],'locale':_0x2698be['locale'],'content':_0x13e2f3,'version':_0x6bb475,..._0x4c5861});this['_interactions']['push'](_0x3348e4);const _0x4ff68d=(_0x40cb3d,_0x1b302d=!0x1,_0x445c1a='streaming')=>this['_promiseQueue']['enqueue'](async _0x2a483e=>{try{const _0x12f712=Rs({'editor':_0x2698be,'changeGroups':_0x40cb3d['changeGroups'],'documentContextContent':_0x40cb3d['documentContextContent'],'showDiff':_0x1b302d,'trimUnchanged':!0x1});_0x12f712['length']&&await this['_actionsBalloonView']['updateContent']({'part':_0x12f712[0x0],'renderingStrategy':_0x445c1a,'abortSignal':_0x2a483e});}catch(_0x394d24){if(this['_isAbortError'](_0x394d24))return;throw _0x394d24;}});_0x3348e4['on']('replyCreated',(_0x416e87,_0x75b0fa)=>{this['_actionsBalloonView']['hideLoader'](),this['_actionsBalloonView']['startAutoScroll'](),_0x4ff68d(_0x75b0fa)['catch'](_0x31a8ec=>{this['_isAbortError'](_0x31a8ec)||(console['error']('Error\x20updating\x20content\x20in\x20replyCreated:',_0x31a8ec),this['_setErrorState'](_0x3348e4));});}),_0x3348e4['on']('replyContentUpdated',(_0x3333fd,_0x40f379)=>{_0x4ff68d(_0x40f379)['catch'](_0x5622c7=>{this['_isAbortError'](_0x5622c7)||(console['error']('Error\x20updating\x20content\x20in\x20replyContentUpdated:',_0x5622c7),this['_setErrorState'](_0x3348e4));});}),_0x3348e4['on']('interactionFinished',async()=>{try{await this['_clearLoadingState'](),this['_actionsBalloonView']['updateMiniToolbarButtons'](this['_interactions']['length'],this['_currentInteractionIndex']),await this['_promiseQueue']['queueEmptyPromise'];}catch(_0x95f391){this['_isAbortError'](_0x95f391)||(console['error']('Error\x20clearing\x20loading\x20state\x20in\x20interactionFinished:',_0x95f391),this['_setErrorState'](_0x3348e4));}finally{this['_actionsBalloonView']['stopAutoScroll']();}}),this['listenTo'](this['_actionsBalloonView'],'toggleSuggestionDisplayMode',async(_0x5d9c03,{showDiff:_0x568fcc})=>{try{this['_balloonShowDiff']=_0x568fcc;const _0xca31f0=this['_interaction']['replies'][this['_interaction']['replies']['length']-0x1];_0xca31f0&&await _0x4ff68d(_0xca31f0,_0x568fcc,'static');}catch(_0x5b9e07){this['_isAbortError'](_0x5b9e07)||(console['error']('Error\x20updating\x20content\x20in\x20toggleSuggestionDisplayMode:',_0x5b9e07),this['_setErrorState'](_0x3348e4));}}),_0x3348e4['on']('replyChangeGroupStateUpdated',()=>{const _0x5dc9ca={'positiveCount':_0x3348e4['replies']['reduce']((_0x3ce6cf,_0x124804)=>_0x3ce6cf+_0x124804['changeGroups']['filter'](_0x157258=>'accepted'===_0x157258['state'])['length'],0x0),'totalCount':_0x3348e4['replies']['reduce']((_0x5e3af8,_0x18c2ac)=>_0x5e3af8+_0x18c2ac['changeGroups']['length'],0x0)},_0x5a8f64=_0x3348e4['actionCallId'],_0x1ddaee=_0x3348e4['actionName'];_0x1ddaee?this['_aiConnector']['upsertAIActionRating'](_0x1ddaee,_0x5a8f64,_0x5dc9ca):this['_aiConnector']['upsertCustomAIActionRating'](_0x5a8f64,_0x5dc9ca);}),this['_setLoadingState']();try{const _0x510cc8=await _0x3348e4['start']();return this['_actionsBalloonView']['updateMiniToolbarButtons'](this['_interactions']['length'],this['_currentInteractionIndex']),_0x510cc8;}catch(_0x2d3513){if(this['_isAbortError'](_0x2d3513))return;this['_actionsBalloonView']['hideLoader'](),this['_setErrorState'](_0x3348e4);}}['_applyChanges'](_0x553178,_0x5ae48e,_0x1e6ad4,_0x370a0c){const _0x29a128=this['editor'];if(_0x370a0c&&!_0x29a128['plugins']['has']('TrackChanges'))throw new at('ai-no-track-changes',null);const _0x4f4019=this['editor']['plugins']['get'](_0x566822),_0x336312=this['_interactions'][this['_interactions']['length']-0x1-this['_currentInteractionIndex']];if(!_0x336312||!_0x336312['replies']['length'])return;const _0x21e144=_0x336312['replies'][_0x336312['replies']['length']-0x1],_0xe0e6e0=_0x21e144['changeGroups'];_0x21e144['setChangeGroupState'](0x0,'accepted');let _0x41902e=qs({'editor':_0x29a128,'reply':_0x21e144,'interaction':_0x336312,'groups':_0xe0e6e0,'transform':!0x1,'documentCompare':_0x4f4019,'documentCompareOptions':{'anchor':_0x29a128['model']['createPositionAt'](_0x553178,0x0),'markDeletions':_0x370a0c}});_0x41902e=this['_filterOperationsOutsideRange'](_0x41902e,_0x5ae48e);for(const _0x2dc2c3 of _0x41902e)this['_anchorOperation'](_0x5ae48e,_0x2dc2c3,_0x1e6ad4);const _0x2bd948=_0x336312['getDocumentContext']()['version'],_0x3da559=_0x29a128['model']['document']['history']['getOperations'](_0x2bd948),_0x361d14={'document':_0x29a128['model']['document'],'useRelations':!0x1,'padWithNoOps':!0x1},_0x3c059c=_0x84a22e(_0x41902e,_0x3da559,_0x361d14)['operationsA'];_0x29a128['model']['change'](_0x386c74=>{if(_0x386c74['setSelection'](_0x29a128['model']['document']['selection']['focus']),_0x370a0c)_0x29a128['plugins']['get']('TrackChangesEditing')['_applyOperationsAsSuggestions'](_0x3c059c);else{for(const _0x1d73a7 of _0x3c059c)_0x1d73a7['baseVersion']=_0x29a128['model']['document']['version'],Qs(_0x29a128,_0x1d73a7),_0x386c74['batch']['addOperation'](_0x1d73a7),_0x29a128['model']['applyOperation'](_0x1d73a7);}}),this['editor']['plugins']['get']('AIBalloon')['close']();}['_filterOperationsOutsideRange'](_0x47a428,_0x234465){return _0x47a428['filter'](_0x2959e5=>{if('rename'==_0x2959e5['type']){const _0xa16d23=_0x2959e5['position']['nodeAfter'];return!_0x234465['has'](_0xa16d23);}if(_0x2959e5['type']['indexOf']('Attribute')>-0x1){const _0x367774=_0x2959e5['range']['start']['nodeAfter'];return!_0x234465['has'](_0x367774);}return!0x0;});}['_anchorOperation'](_0x221d11,_0x498547,_0x57d184){const _0x17c554=_0x498547['clone']();for(const _0x318f3c in _0x498547){const _0x205d78=_0x498547[_0x318f3c];_0x205d78 instanceof _0x5779b9?_0x498547[_0x318f3c]=new _0x5779b9(_0x368bdf(_0x205d78['start']),_0x368bdf(_0x205d78['end'])):_0x205d78 instanceof _0x1c4ec6&&(_0x498547[_0x318f3c]=_0x368bdf(_0x205d78));}if(['insert','move','remove','reinsert','split','merge']['includes'](_0x17c554['type'])){if(_0x17c554['isDocumentOperation']=!0x1,_0x17c554['baseVersion']=null,'remove'==_0x17c554['type']){const _0x594099=_0x17c554['sourcePosition'],_0x385a27=_0x17c554['howMany'];new _0x3d7c4f(_0x594099,_0x385a27)['_execute']();}else _0x17c554['_execute']();}function _0x368bdf(_0x446c0c){if('$graveyard'==_0x446c0c['root']['rootName'])return _0x446c0c;const _0x11e97a=[];let _0x1de52c=_0x446c0c['root'];for(let _0x310b67=0x0;_0x310b67<_0x446c0c['path']['length'];_0x310b67++){const _0x21ca18=_0x221d11['get'](_0x1de52c)||0x0;_0x11e97a[_0x310b67]=_0x446c0c['path'][_0x310b67]+_0x21ca18,_0x1de52c=_0x1de52c['getChildAtOffset'](_0x446c0c['path'][_0x310b67]);}return new _0x1c4ec6(_0x57d184,_0x11e97a,_0x446c0c['stickiness']);}}['_refreshInteraction'](){if(!this['_interactionParams'])return;this['_interactions']['length']>0x0&&this['_stopInteraction'](),this['_currentInteractionIndex']=0x0,this['_balloonShowDiff']=!0x1;const {action:_0x1ca49e,content:_0x3e998f,version:_0x89deef,aiBalloon:_0x52ecd5}=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'](_0x3e998f,_0x89deef,_0x52ecd5,_0x1ca49e)['catch'](_0x13ba30=>{this['_isAbortError'](_0x13ba30)||console['error']('Error\x20refreshing\x20interaction:',_0x13ba30);});}['_isAbortError'](_0x2aba2b){return!!_0x2aba2b['message']&&_0x2aba2b['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 _0x442563=this['_interactions']['length'];this['_currentInteractionIndex']<_0x442563-0x1&&this['_displayInteractionAtIndex'](this['_currentInteractionIndex']+0x1);}['_navigateToNext'](){this['_currentInteractionIndex']>0x0&&this['_displayInteractionAtIndex'](this['_currentInteractionIndex']-0x1);}async['_displayInteractionAtIndex'](_0x30ea24){if(!this['_interactionParams'])return;this['_currentInteractionIndex']=_0x30ea24;const _0x5b5a77=this['_interactions'][this['_interactions']['length']-0x1-this['_currentInteractionIndex']];if(!_0x5b5a77)return;if(_0x5b5a77['hasError'])return this['_setErrorState'](_0x5b5a77),void this['_actionsBalloonView']['updateMiniToolbarButtons'](this['_interactions']['length'],this['_currentInteractionIndex']);if(!_0x5b5a77['replies']['length'])return;this['_actionsBalloonView']['hideError'](),this['_interactionParams']&&this['_clearErrorState']();const _0x5062b3=_0x5b5a77['replies'][_0x5b5a77['replies']['length']-0x1];if(_0x5062b3){const _0x1f36c7=this['editor'];try{const _0xfdc4d5=Rs({'editor':_0x1f36c7,'changeGroups':_0x5062b3['changeGroups'],'documentContextContent':_0x5062b3['documentContextContent'],'showDiff':this['_balloonShowDiff'],'trimUnchanged':!0x1});await new Promise(_0x23a838=>setTimeout(_0x23a838,0x32)),await this['_actionsBalloonView']['updateContent']({'part':_0xfdc4d5[0x0],'renderingStrategy':'static','abortSignal':new AbortController()['signal']});}catch(_0x1576b1){this['_isAbortError'](_0x1576b1)||console['error']('Error\x20updating\x20content\x20during\x20navigation:',_0x1576b1);}}this['_actionsBalloonView']['updateMiniToolbarButtons'](this['_interactions']['length'],this['_currentInteractionIndex']);}['_setLoadingState'](){this['_actionsBalloonView']['setIsLoading'](!0x0),this['isBusy']=!0x0;}async['_setErrorState'](_0x44fe73){const _0x542d2d=hs(this['editor']['locale'],'AI_ACTIONS_GENERIC_ERROR');this['_actionsBalloonView']['showError'](_0x542d2d),_0x44fe73['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 _0x3c4360{static get['requires'](){return[Wo,$o,ta];}static get['pluginName'](){return'AIQuickActions';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x2846b0){super(_0x2846b0),_0x2846b0['config']['define']('ai.quickActions',{'extraCommands':[],'removeCommands':[],'isSearchEnabled':!0x0});}}class ia extends vt{['resultResponseView'];['acceptButtonView'];['dismissButtonView'];['infoButtonView'];['outdatedButtonView'];constructor(_0xe3714b,_0x363944){super(_0xe3714b),this['id']=_0x363944,this['set']('status','pending'),this['set']('changeId',_0x363944),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',(_0x5c2b19,_0x559db3)=>{_0x559db3&&_0x559db3['target']&&'A'===_0x559db3['target']['tagName']&&_0x559db3['preventDefault'](),this['fire']('activateChange',{'id':_0x363944,'source':this,'uiInteraction':'click'});}),this['on']('mouseover',()=>{this['fire']('activateChange',{'id':_0x363944,'source':this,'uiInteraction':'hover'});}),this['on']('mouseout',()=>{this['fire']('deactivateChange',{'origin':'panel','id':_0x363944,'source':this});});}['setItemAsActive'](){this['isActive']=!0x0;}['setItemAsInactive'](){this['isActive']=!0x1;}['_createResultResponseView'](){const _0x34de34=new vt(this['locale']);return _0x34de34['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',_0x3c847a=>!_0x3c847a)]}}),_0x34de34;}['_createAcceptButtonView'](){const _0x125de0=new Nt(this['locale']);return _0x125de0['set']({'label':hs(this['locale'],'AI_REVIEW_MODE_ACCEPT_CHANGE'),'withText':!0x0}),_0x125de0['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x5d2c9e=>{this['fire']('acceptChange',{'id':this['changeId']}),_0x5d2c9e['stopPropagation']();})},'attributes':{'class':[this['bindTemplate']['if']('status','ck-hidden',_0x478bf9=>'pending'!==_0x478bf9&&'accepted'!==_0x478bf9),this['bindTemplate']['if']('status',ls,_0x1c83ea=>'pending'===_0x1c83ea),this['bindTemplate']['if']('status',us,_0x4d3a48=>'pending'!==_0x4d3a48),this['bindTemplate']['if']('status','ck-ai_review__check-run-result-status-button',_0x4195d3=>'accepted'===_0x4195d3)]}}),this['on']('change:status',(_0xc4e181,_0x25b063,_0x4f108b)=>{_0x125de0['isEnabled']='pending'===_0x4f108b,'accepted'===_0x4f108b&&(_0x125de0['label']=hs(this['locale'],'AI_REVIEW_MODE_CHECK_STATUS_ACCEPTED'),_0x125de0['icon']=_0x202ca3);}),_0x125de0;}['_createDismissButtonView'](){const _0xd1d99=new Nt(this['locale']);return _0xd1d99['set']({'label':hs(this['locale'],'AI_REVIEW_MODE_DISMISS_CHANGE'),'withText':!0x0}),_0xd1d99['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x126aeb=>{this['fire']('dismissChange',{'id':this['changeId']}),_0x126aeb['stopPropagation']();})},'attributes':{'class':[us,this['bindTemplate']['if']('status','ck-hidden',_0x342c4b=>'pending'!==_0x342c4b&&'rejected'!==_0x342c4b),this['bindTemplate']['if']('status','ck-ai_review__check-run-result-dismiss-button',_0x5a1886=>'pending'===_0x5a1886),this['bindTemplate']['if']('status','ck-ai_review__check-run-result-status-button',_0x1a8941=>'rejected'===_0x1a8941)]}}),this['on']('change:status',(_0x2202e1,_0x2a025a,_0x4b3d6b)=>{_0xd1d99['isEnabled']='pending'===_0x4b3d6b,'rejected'===_0x4b3d6b&&(_0xd1d99['label']=hs(this['locale'],'AI_REVIEW_MODE_CHECK_STATUS_REJECTED'),_0xd1d99['icon']=_0xf8dc71);}),_0xd1d99;}['_createInfoButtonView'](){const _0x4ce71c=new Nt(this['locale']);return _0x4ce71c['set']({'label':hs(this['locale'],'AI_REVIEW_MODE_LEARN_MORE'),'icon':_0x4a37a4,'tooltip':!0x0,'isToggleable':!0x0,'role':'menuitemcheckbox','class':us+'\x20ck-ai_review__check-run-result-info-button\x20ck-hidden'}),_0x4ce71c['bind']('isOn')['to'](this,'isInfoToggleOn',_0x76eefd=>_0x76eefd),_0x4ce71c['on']('execute',()=>{this['isInfoToggleOn']=!this['isInfoToggleOn'];}),_0x4ce71c;}['_createOutdatedButtonView'](){const _0x376f43=new Nt(this['locale']);return _0x376f43['set']({'label':hs(this['locale'],'AI_REVIEW_MODE_CHECK_STATUS_OUTDATED'),'icon':it,'withText':!0x0,'isEnabled':!0x1}),_0x376f43['extendTemplate']({'attributes':{'class':[us,'ck-ai_review__check-run-result-status-button',this['bindTemplate']['if']('status','ck-hidden',_0x31d812=>'outdated'!==_0x31d812)],'disabled':'disabled'}}),_0x376f43;}}class sa extends Xt{['resultItemView'];['_pinnedRectIndex']=void 0x0;['_pinnedTargetElement']=void 0x0;['_pinnedTargetChangeId']=void 0x0;constructor(_0x52465a,_0x16b260){super(_0x52465a),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']()),_0x16b260['add'](this);}['render'](){super['render'](),this['_setupClickOutsideHandler']();}['updateContent'](_0x4e10ad){this['resultItemView']['changeId']=_0x4e10ad['id'],this['resultItemView']['resultResponseView']['element']['innerHTML']=_0x4e10ad['contentDiffed'];}['showBalloon'](_0x4bccf6,_0x4b5dc9,_0x3fa1c5,_0x6ef7d3,_0x24c95f,_0x508b7a){const _0x59b990=_0x4b5dc9();if(!_0x59b990)return;this['updateContent'](_0x4bccf6),this['show']();const _0x299112=Array['from'](_0x59b990['getClientRects']())['reverse'](),_0x54fc56=this['_getPointedRectIndexFromEvent'](_0x3fa1c5,_0x299112),_0x413135=_0x299112[_0x54fc56??0x0];'click'===_0x6ef7d3?(this['isDiffActive']=!0x0,this['pin']({'target':()=>this['_getBestRectPositionOnClick'](_0x4b5dc9(),_0x54fc56,_0x4bccf6['id'],_0x24c95f,_0x508b7a)||_0x413135})):'hover'===_0x6ef7d3&&(this['isDiffActive']=!0x1,this['pin']({'target':()=>this['_getBestRectPositionOnHover'](_0x4b5dc9(),_0x54fc56,_0x4bccf6['id'])||_0x413135}));}['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 _0x3e095f=[this['element']];return this['_pinnedTargetElement']&&_0x3e095f['push'](this['_pinnedTargetElement']),_0x3e095f;},'callback':()=>{this['hide'](),this['unpin'](),this['deactivateChange'](),this['_pinnedTargetElement']=void 0x0,this['_pinnedRectIndex']=void 0x0,this['_pinnedTargetChangeId']=void 0x0;}});}['_createContentView'](){const _0x59e746=new vt();return this['resultItemView']=new ia(this['locale'],''),this['resultItemView']['resultResponseView']['extendTemplate']({'attributes':{'class':['ck-content']}}),this['resultItemView']['delegate']('acceptChange','dismissChange')['to'](this),_0x59e746['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']]}]}),_0x59e746;}['_getBestRectPositionOnClick'](_0x2e1ba7,_0x26249e,_0x8da915,_0x3d92ee,_0x258831){if(!_0x2e1ba7)return null;const _0xa6ff20=this['position']['replace']('arrow_',''),_0x4f8ed9=Array['from'](_0x2e1ba7['getClientRects']());let _0x10f1f2,_0x5f2563=_0x4f8ed9['reverse']();return void 0x0!==_0x26249e&&this['_isPinnedRectVisible'](_0x5f2563[_0x26249e],_0x3d92ee,_0x258831)?(_0x10f1f2=_0x5f2563[_0x26249e],this['_pinnedRectIndex']=_0x26249e):this['_isPinnedRectVisible'](_0x5f2563[0x0],_0x3d92ee,_0x258831)&&void 0x0===_0x26249e?_0x10f1f2=_0x5f2563[0x0]:(_0x5f2563='s'==_0xa6ff20[0x0]?[..._0x4f8ed9]['reverse']():_0x4f8ed9,_0x5f2563['forEach'](_0x9afca=>{this['_isPinnedRectVisible'](_0x9afca,_0x3d92ee,_0x258831)&&(_0x10f1f2=_0x9afca);})),this['_pinnedTargetChangeId']=_0x8da915,this['_pinnedTargetElement']=_0x2e1ba7,_0x10f1f2||_0x2e1ba7['getBoundingClientRect']();}['_getBestRectPositionOnHover'](_0x31497e,_0x148e4a,_0x1c9e24){if(!_0x31497e)return null;const _0x25420a=Array['from'](_0x31497e['getClientRects']())['reverse']();if(void 0x0===this['_pinnedRectIndex']&&void 0x0!==_0x148e4a&&this['_pinnedTargetChangeId']!==_0x1c9e24)return this['_pinnedRectIndex']=_0x148e4a,this['_pinnedTargetElement']=_0x31497e,this['_pinnedTargetChangeId']=_0x1c9e24,_0x25420a[_0x148e4a];if(void 0x0!==this['_pinnedRectIndex']&&this['_pinnedTargetChangeId']===_0x1c9e24){if(_0x31497e!==this['_pinnedTargetElement'])return Array['from'](this['_pinnedTargetElement']['getClientRects']())['reverse']()[this['_pinnedRectIndex']];return _0x25420a[this['_pinnedRectIndex']];}return void 0x0!==_0x148e4a&&this['_pinnedTargetChangeId']!==_0x1c9e24?(this['_pinnedRectIndex']=_0x148e4a,this['_pinnedTargetElement']=_0x31497e,this['_pinnedTargetChangeId']=_0x1c9e24,_0x25420a[_0x148e4a]):_0x31497e['getBoundingClientRect']();}['_getPointedRectIndexFromEvent'](_0x5207f9,_0x8b5e09){if(_0x5207f9)for(let _0x3704c0=0x0;_0x3704c0<_0x8b5e09['length'];_0x3704c0++){const _0x3d9306=_0x8b5e09[_0x3704c0];if(_0x5207f9['clientX']>=_0x3d9306['left']-0x3&&_0x5207f9['clientX']<=_0x3d9306['right']+0x3&&_0x5207f9['clientY']>=_0x3d9306['top']-0x3&&_0x5207f9['clientY']<=_0x3d9306['bottom']+0x3)return _0x3704c0;}}['_isPinnedRectVisible'](_0x17d603,_0x1e2e6e,_0x4b3c78){const _0x89fe08=new ut(_0x17d603),_0x566218=_0x1e2e6e||document['documentElement'],_0x3769b7=_0x89fe08['getIntersection'](Rt(_0x4b3c78)),_0x27cc51=new ut(_0x566218)['getIntersection'](_0x89fe08);return!!(_0x3769b7&&_0x27cc51&&_0x89fe08['width']>0x0);}}const na=['getReviewCheckList','runReviewCheck','abortReviewStream','toggleDiff','acceptAllChanges','leaveReviewCoreResultList','activateChange','deactivateChange','acceptChange','dismissChange','learnMore','finishReview','retryReview'];class ra extends _0x490ade{['_mainView'];['_balloonSuggestionView'];['_bodyCollection'];static get['requires'](){return[os];}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x32f72c){super(_0x32f72c),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 _0x288791=this['context']['plugins']['get']('AITabs');this['registerTab'](_0x288791);}['destroy'](){this['_bodyCollection']['detachFromDom'](),super['destroy']();}['setAvailableChecks'](_0x1e4c91){if(!this['_mainView']['reviewCheckListView']['hasChecks']()){const _0x201c0c=!this['context']['config']['get']('ai.models.showModelSelector');this['_mainView']['reviewCheckListView']['setChecks'](_0x1e4c91,_0x201c0c);}this['_mainView']['showReviewCheckListView']();}['showReviewCheckList'](){this['fire']('getReviewCheckList');}['showCheckRunResults'](_0x487cc){_0x487cc&&('error-general'!==_0x487cc['status']?'error-chunk'!==_0x487cc['status']?this['_mainView']['showReviewCheckResultsView']():this['showChunkErrorView']():this['showGeneralResultsErrorView']());}['showCheckRunResult'](_0x3c4d7e){this['_mainView']['addCheckRunResult'](_0x3c4d7e);}['showGeneralResultsErrorView'](){this['_mainView']['showGeneralResultsErrorView']();}['showGeneralReviewCoreErrorView'](_0x52a97c){this['_mainView']['showGeneralReviewCoreErrorView'](_0x52a97c??hs(this['context']['locale'],'AI_REVIEW_INITIALIZATION_ERROR_MESSAGE'));}['showChunkErrorView'](){this['_mainView']['showChunkErrorView']();}['setCheckResultTitle'](_0x42256b,_0x485f7f){this['_mainView']['reviewCheckResultsView']['setTitle'](_0x42256b,_0x485f7f);}['setActiveStateInResults'](_0x371919){this['_mainView']['reviewCheckResultsView']['getResults']()['forEach'](_0x4ec490=>{_0x4ec490['id']===_0x371919&&_0x4ec490['setItemAsActive']();});}['resetActiveStateInResults'](){this['_mainView']['reviewCheckResultsView']['getResults']()['forEach'](_0x42da0a=>_0x42da0a['setItemAsInactive']());}['updateChangeState'](_0x3fa512,_0x4a15bc){'accepted'===_0x4a15bc||'rejected'===_0x4a15bc||'outdated'===_0x4a15bc?this['_mainView']['reviewCheckResultsView']['hideResult'](_0x3fa512,_0x4a15bc):this['_mainView']['reviewCheckResultsView']['showResult'](_0x3fa512,_0x4a15bc);}['showReviewCompletedView'](){this['_mainView']['showReviewCompletedView']();}['showActionsWhenResultIsReady'](){this['_mainView']['showActionsWhenResultIsReady']();}['showNoChangesView'](){this['_mainView']['showNoChangesView']();}['hideActionsWhenResultIsReady'](){this['_mainView']['hideActionsWhenResultIsReady']();}['showChangeBalloon'](_0x2f0884,_0x305306,_0x1a5a30,_0x1d0e2b,_0x10225e,_0x3e53b6){this['_balloonSuggestionView']['showBalloon'](_0x2f0884,_0x305306,_0x1a5a30,_0x1d0e2b,_0x10225e,_0x3e53b6);}['hideChangeBalloon'](){this['_balloonSuggestionView']['hideBalloon']();}['hideDiffInBalloon'](){this['_balloonSuggestionView']['hideDiffInBalloon']();}['showDiffInBalloon'](){this['_balloonSuggestionView']['showDiffInBalloon']();}['getChangeElement'](_0x1de7ba){const _0x3788e2=this['_mainView']['reviewCheckResultsView']['getResults']()['find'](_0x1d18a8=>_0x1d18a8['id']===_0x1de7ba);return _0x3788e2?_0x3788e2['element']:null;}['deactivateChange'](){this['_balloonSuggestionView']['deactivateChange']();}}class oa extends vt{constructor(_0x54d136){super(_0x54d136),this['set']('isVisible',!0x1),this['set']('errorMessage','');const _0x7e2e61=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai_review__general-error-container',_0x7e2e61['if']('isVisible','ck-hidden',_0x1a8aad=>!_0x1a8aad)]},'children':[{'tag':'p','attributes':{'class':'ck\x20ck-ai-notification\x20ck-ai-notification_error'},'children':[{'text':_0x7e2e61['to']('errorMessage')}]}]});}}class aa extends vt{['reviewCoreHeader'];['generalErrorView'];['reviewCheckListView'];['reviewCheckResultsView'];['reviewCompletedView'];constructor(_0x32ed07,_0x4102a3){super(_0x32ed07),this['reviewCoreHeader']=_0x4102a3['header'],this['generalErrorView']=new oa(_0x32ed07),this['reviewCheckListView']=_0x4102a3['list'],this['reviewCheckListView']['delegate'](...na)['to'](this),this['reviewCheckResultsView']=_0x4102a3['results'],this['reviewCheckResultsView']['delegate'](...na)['to'](this),this['reviewCompletedView']=_0x4102a3['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'](_0x4509a9){this['reviewCheckResultsView']['addResult'](_0x4509a9),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'](_0x2c5037){this['generalErrorView']['set']('isVisible',!0x0),this['generalErrorView']['errorMessage']=_0x2c5037;}['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(_0x26f70e,_0x33ddfe){super(_0x33ddfe),this['set']({'label':_0x26f70e,'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(_0x493f42,_0x563d9a){super(_0x493f42),this['_contents']=_0x563d9a,this['_resultViews']=new _0x4a50ef(),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(_0x493f42),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 _0xfb2417=this['_createCombinedSkeletonLoader'](),_0x76cbaf=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-run',_0x76cbaf['if']('isLoading','ck-ai_review__check-run_loading',_0x1dca3c=>_0x1dca3c),_0x76cbaf['if']('isResultReady','ck-ai_review__check-run_ready',_0x5f5d0e=>_0x5f5d0e),_0x76cbaf['if']('isVisible','ck-hidden',_0x1639c2=>!_0x1639c2)]},'children':[this['_resultsHeader'],this['_errorMessageView'],this['_resultsBody'],_0xfb2417,this['reviewDisclaimer']]});}['clearResults'](){this['_resultViews']['clear'](),this['_resultsBody']['element']&&(this['_resultsBody']['element']['scrollTop']=0x0);}['getResults'](){return this['_resultViews'];}['addResult'](_0x37c50d){const _0x40509d=new ia(this['locale'],_0x37c50d['id']);_0x40509d['delegate']('acceptChange','dismissChange','activateChange','deactivateChange')['to'](this),this['_resultViews']['add'](_0x40509d),_0x40509d['resultResponseView']['element']['innerHTML']=_0x37c50d['contentDiffed'];}['hideResult'](_0x3659e3,_0x129bb3){if('pending'===_0x129bb3)return;const _0x1ea6ae=this['_resultViews']['find'](_0x46bd44=>_0x46bd44['id']===_0x3659e3);_0x1ea6ae&&(_0x1ea6ae['status']=_0x129bb3,_0x1ea6ae['element']?.['classList']['add']('ck-ai_review__check-run-result_grayout'));}['showResult'](_0x1fdc67,_0xe40201){if('pending'!==_0xe40201)return;const _0x70cf62=this['_resultViews']['find'](_0x2dc7d9=>_0x2dc7d9['id']===_0x1fdc67);_0x70cf62&&(_0x70cf62['status']=_0xe40201,_0x70cf62['element']?.['classList']['remove']('ck-ai_review__check-run-result_grayout'));}['setTitle'](_0xcabd76,_0x122eba){this['headerTitle']=_0xcabd76,this['headerSubtitle']=_0x122eba||'';}['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 _0x59ccd5=new vt(this['locale']),_0x55143c=[];for(let _0x1ca74d=0x0;_0x1ca74d<0x10;_0x1ca74d++){const _0xb66f8f=this['_createSkeletonLoader']();_0xb66f8f['extendTemplate']({'attributes':{'class':['ck-ai_review__check-run-skeleton-item']}}),_0x55143c['push'](_0xb66f8f);}return _0x59ccd5['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-run-skeleton-container',this['bindTemplate']['if']('isLoading','ck-hidden',_0x166f5f=>!_0x166f5f)]},'children':_0x55143c}),_0x59ccd5;}['_createResultsBodyView'](){const _0x18ecaa=new vt(this['locale']);return _0x18ecaa['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-run-results-container','ck-reset_all-excluded',this['bindTemplate']['if']('isLoading','ck-hidden',_0x478325=>_0x478325)]},'children':this['_resultViews']}),_0x18ecaa;}['_createErrorView'](){const _0xb26e92=new vt(this['locale']),_0x1ab510=new Nt(this['locale']),t=this['locale']['t'];return _0xb26e92['delegate']('retryReview')['to'](this),_0x1ab510['set']({'label':t('Try\x20again'),'withText':!0x0,'class':ls+'\x20ck-ai_review__check-run-error-retry-button'}),_0x1ab510['on']('execute',()=>{this['fire']('retryReview');}),_0xb26e92['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-run-error-container',this['bindTemplate']['if']('showErrorMessage','ck-hidden',_0x47217f=>!_0x47217f),this['bindTemplate']['if']('errorType','ck-ai_review__check-run-error-container_border-bottom',_0x507fb9=>'chunk'===_0x507fb9)]},'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',_0x478c48=>'chunk'===_0x478c48)]},'children':[{'tag':'p','attributes':{'class':['ck-ai-notification__content',this['bindTemplate']['if']('errorType','ck-hidden',_0x2ea0b5=>'general'!==_0x2ea0b5)]},'children':[{'text':this['_contents']['generalErrorText']}]},{'tag':'p','attributes':{'class':['ck-ai-notification__content',this['bindTemplate']['if']('errorType','ck-hidden',_0x3442ce=>'chunk'!==_0x3442ce)]},'children':[{'text':hs(this['locale'],'AI_REVIEW_MODE_CHUNK_ERROR_MESSAGE')}]}]},_0x1ab510]}),_0xb26e92;}['_createCancelButtonView'](){const _0x582209=new Nt(this['locale']);return _0x582209['set']({'label':hs(this['locale'],'AI_REVIEW_MODE_STOP_GENERATING'),'withText':!0x0,'class':[ls+'\x20ck-ai-button-stop-generating'],'icon':_0x56cd42}),_0x582209['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isResultReady','ck-hidden',_0x5660ec=>_0x5660ec),this['bindTemplate']['if']('isCompleted','ck-hidden',_0x1f9fdb=>_0x1f9fdb)]}}),_0x582209['on']('execute',()=>{this['fire']('abortReviewStream');}),_0x582209;}['_createToggleDiffButtonView'](){const _0x45bafe=new Nt(this['locale']);_0x45bafe['set']({'tooltip':!0x0,'isToggleable':!0x0,'role':'menuitemcheckbox'}),_0x45bafe['bind']('isEnabled')['to'](this,'isError',_0x43d7de=>!_0x43d7de),_0x45bafe['extendTemplate']({'attributes':{'class':[ls,'ck-ai_review__check-run-toggle-diff-button',this['bindTemplate']['if']('isResultReady','ck-hidden',_0x3dd7e3=>!_0x3dd7e3),this['bindTemplate']['if']('isCompleted','ck-hidden',_0x1bad32=>_0x1bad32)]}});const _0x3ec2fb=hs(this['locale'],'AI_REVIEW_MODE_HIDE_CHANGES'),_0x3964a6=hs(this['locale'],'AI_REVIEW_MODE_SHOW_CHANGES');return _0x45bafe['bind']('isOn')['to'](this,'isToggleDiffOn',_0x758769=>_0x758769),_0x45bafe['bind']('icon')['to'](this,'isToggleDiffOn',_0x5102a2=>_0x5102a2?st:nt),_0x45bafe['bind']('label')['to'](this,'isToggleDiffOn',_0x195604=>_0x195604?_0x3ec2fb:_0x3964a6),_0x45bafe['on']('execute',()=>{this['isToggleDiffOn']=!this['isToggleDiffOn'],this['fire']('toggleDiff',{'on':this['isToggleDiffOn']});}),_0x45bafe;}['_createAcceptAllButtonView'](){const _0x1d54de=new Nt(this['locale']);return _0x1d54de['set']({'label':hs(this['locale'],'AI_REVIEW_MODE_ACCEPT_ALL'),'withText':!0x0}),_0x1d54de['bind']('isEnabled')['to'](this,'isError',_0x32f3c3=>!_0x32f3c3),_0x1d54de['extendTemplate']({'attributes':{'class':[cs,'ck-ai_review__check-run-accept-all-button',this['bindTemplate']['if']('isResultReady','ck-hidden',_0x4cd8c5=>!_0x4cd8c5),this['bindTemplate']['if']('isCompleted','ck-hidden',_0x1e5eca=>_0x1e5eca)]}}),_0x1d54de['on']('execute',()=>{this['fire']('acceptAllChanges');}),_0x1d54de;}['_createExitReviewButtonView'](){const _0x435c82=new Nt(this['locale']);return _0x435c82['set']({'label':hs(this['locale'],'AI_REVIEW_MODE_EXIT_REVIEW'),'withText':!0x0}),_0x435c82['extendTemplate']({'attributes':{'class':[us,'ck-ai_review__check-run-exit-button',this['bindTemplate']['if']('isResultReady','ck-hidden',_0x13949c=>!_0x13949c),this['bindTemplate']['if']('isCompleted','ck-hidden',_0x5df350=>_0x5df350)]}}),_0x435c82['on']('execute',()=>{this['fire']('leaveReviewCoreResultList');}),_0x435c82;}['_createResultHeaderView'](){const _0x1bb792=new vt(this['locale']),_0x526e73=this['_createTitleView']();return _0x1bb792['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-run-results-header',this['bindTemplate']['if']('isCompleted','ck-ai_review__review-completed-header',_0x169881=>_0x169881)]},'children':[_0x526e73,{'tag':'div','attributes':{'class':['ck-ai_review__check-run-results-header-buttons']},'children':[this['_cancelButtonView'],this['_acceptAllButtonView'],this['_exitReviewButtonView'],this['_toggleDiffButtonView'],this['_finishReviewButtonView']]}]}),_0x1bb792;}['_createTitleView'](){const _0x229281=new vt(this['locale']),_0xfba906=new yn();return _0xfba906['bind']('isVisible')['to'](this,'isResultReady',_0x4297a3=>!_0x4297a3),_0x229281['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-run-results-header-title-wrapper']},'children':[_0xfba906,{'tag':'div','attributes':{'class':['ck-ai_review__check-run-results-header-title-content',this['bindTemplate']['if']('isCompleted','ck-hidden',_0x2544b9=>_0x2544b9)]},'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',_0x2208af=>!_0x2208af)]},'children':[{'text':hs(this['locale'],'AI_REVIEW_MODE_FINISH_REVIEW_HEADER_TITLE')}]}]}),_0x229281;}['_createFinishReviewButtonView'](){const _0x53cb82=new ha(hs(this['locale'],'AI_REVIEW_MODE_FINISH_REVIEW_BUTTON_LABEL'),this['locale']);return _0x53cb82['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isCompleted','ck-hidden',_0x17722e=>!_0x17722e)]}}),_0x53cb82['delegate']('finishReview')['to'](this),_0x53cb82;}}class la extends Ht{['_resultsHeader'];['_finishReviewButtonView'];constructor(_0x32a691,_0x412ea9){super(_0x32a691),this['_finishReviewButtonView']=this['_createFinishReviewButtonView'](_0x412ea9['buttonText']),this['_resultsHeader']=this['_createResultHeaderView'](_0x412ea9['headerText']);const _0x469d7c=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__review-completed',_0x469d7c['if']('isVisible','ck-hidden',_0x4343df=>!_0x4343df)]},'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':_0x412ea9['emptyResultsText']}]}]}]});}['_createFinishReviewButtonView'](_0x2a2620){const _0x434f15=new ha(_0x2a2620,this['locale']);return _0x434f15['delegate']('finishReview')['to'](this),_0x434f15;}['_createResultHeaderView'](_0x4a4538){const _0x5d1276=new vt(this['locale']);return _0x5d1276['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':_0x4a4538}]},{'tag':'div','attributes':{'class':['ck-ai_review__review-completed-header-buttons']},'children':[this['_finishReviewButtonView']]}]}),_0x5d1276;}}class ua extends vt{['_dropdownView'];['_defaultValue'];['_defaultLabel'];constructor(_0x282fe3,_0x428be5){super(_0x282fe3),this['_defaultValue']=_0x428be5['default']||(_0x428be5['data']['length']>0x0?_0x428be5['data'][0x0]['id']:''),this['_defaultLabel']=_0x428be5['data']['find'](_0x537164=>_0x537164['id']===this['_defaultValue'])?.['label']||'',this['set']('formValue',''),this['_dropdownView']=Gt(this['locale']);const _0x50a840=this['_prepareListOptions'](_0x428be5['data']);jt(this['_dropdownView'],_0x50a840,{'role':'menu','ariaLabel':_0x428be5['label']}),this['_dropdownView']['buttonView']['set']({'label':this['_defaultLabel'],'withText':!0x0}),this['_dropdownView']['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x252d0f=>{_0x252d0f['stopPropagation']();})}}),this['listenTo'](this['_dropdownView'],'execute',_0x24df65=>{this['formValue']=_0x24df65['source']['model']['id'],this['_dropdownView']['buttonView']['label']=_0x24df65['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'](_0x4e47c7=[]){const _0x2845e1=new dt();this['resetToDefault']();for(const _0x3bcb67 of _0x4e47c7){const _0x486852=new Jt({'label':_0x3bcb67['label'],'withText':!0x0,'role':'menuitemradio','id':_0x3bcb67['id'],'model':_0x3bcb67});_0x486852['bind']('isOn')['to'](this,'formValue',_0x267d64=>_0x267d64===_0x486852['id']);const _0x5b5df8={'type':'button','model':_0x486852};_0x2845e1['add'](_0x5b5df8);}return _0x2845e1;}}class da extends Ht{['_formItem']=null;constructor(_0x7eae66,_0x49ab6b,_0x490f91){super(_0x7eae66),this['argsKey']=_0x49ab6b?.['argsKey'];if('dropdown'===_0x49ab6b['formType'])this['_formItem']=new ua(this['locale'],_0x49ab6b);this['set']('value',''),this['bind']('value')['to'](this['_formItem'],'formValue');const _0x1ab91b=new _0x490619(this['locale'],{'children':[this['_formItem']],'class':[_0x490f91?'ck-form__row_with-submit':'']});_0x490f91&&_0x1ab91b['children']['add'](_0x490f91),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai_review__form-item','ck-reset_all']},'children':[_0x1ab91b]});}['resetToDefault'](){this['_formItem']['resetToDefault']();}}class _a extends _0x5d5255{['keystrokes'];static ['MIN_ROWS']=0x1;static ['MAX_ROWS']=0xc;constructor(_0x27e171){super(_0x27e171),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 _0x4a50ef();['submitButtonView'];['cancelButtonView'];['promptInputView'];['actionsFooterView'];['_modelSelectionDropdown'];['_modelNameView'];['_modelSelectionDropdownItems'];['_check'];['_defaultValue'];['_defaultLabel'];constructor(_0x304887,_0x1d8ca2,_0x11ac6d=!0x1){super(_0x304887),this['_check']=_0x1d8ca2,this['set']('prompt',''),this['set']('modelId',''),this['set']('modelDisplayMode','selector'),this['set']('activeModelName',null),this['_defaultValue']=_0x1d8ca2['defaultModel']?_0x1d8ca2['defaultModel']['id']:'',this['_defaultLabel']=_0x1d8ca2['defaultModel']?_0x1d8ca2['defaultModel']['name']:'',this['submitButtonView']=this['_createSubmitButtonView'](),this['cancelButtonView']=this['_createCancelButtonView'](),(this['promptInputView']=new te(this['locale'],()=>new _a(_0x304887)),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'](_0x11ac6d),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 _0x490619(this['locale'],{'children':[this['promptInputView']]}),new _0x490619(this['locale'],{'children':[this['actionsFooterView']]})]}),this['promptInputView']['fieldView']['keystrokes']['set']('Enter',(_0x1a5aa5,_0x2188ab)=>{this['_isValid']()?(this['fire']('runReviewCheck',{'id':'custom','args':{'prompt':this['prompt'],'model':this['modelId']},'isCustom':!0x0}),_0x2188ab()):_0x2188ab();}),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'](_0x3571b8=>{this['_focusables']['add'](_0x3571b8),this['focusTracker']['add'](_0x3571b8['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 _0x482df3 of this['_getFormValidators']()){const _0x315aec=_0x482df3();if(_0x315aec)return this['promptInputView']['errorText']=_0x315aec,!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 _0x2f0654=new Nt(this['locale']),t=this['locale']['t'];return _0x2f0654['set']({'label':t('Submit'),'withText':!0x0,'class':cs}),_0x2f0654['on']('execute',()=>{this['_isValid']()&&this['fire']('runReviewCheck',{'id':'custom','args':{'prompt':this['prompt'],'model':this['modelId']},'isCustom':!0x0});}),_0x2f0654;}['_createCancelButtonView'](){const _0x4b23e9=new Nt(this['locale']),t=this['locale']['t'];return _0x4b23e9['set']({'label':t('Cancel'),'withText':!0x0,'class':us}),_0x4b23e9['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x1c977f=>{_0x1c977f['stopPropagation']();})}}),_0x4b23e9['on']('execute',()=>{this['resetToDefault'](),this['fire']('closeCustomCheck');}),_0x4b23e9;}['_setModelList'](_0x41b35d){this['_modelSelectionDropdownItems']['clear']();const _0xb54d65=this['_check']['models'];if(_0x41b35d)this['set']('modelDisplayMode','hidden');else{const _0x214757=0x1===_0xb54d65['length'];this['set']('modelDisplayMode',_0x214757?'name':'selector');}if(this['resetToDefault'](),_0xb54d65?.['length']){0x1===_0xb54d65['length']&&this['set']('activeModelName',_0xb54d65[0x0]['name']||_0xb54d65[0x0]['id']);for(const _0x4c14de of _0xb54d65){const _0x2f9991=new Jt({'label':_0x4c14de['name'],'withText':!0x0,'role':'menuitemradio','id':_0x4c14de['id'],'model':_0x4c14de});_0x2f9991['bind']('isOn')['to'](this,'modelId',_0x510192=>_0x510192===_0x4c14de['id']),this['_modelSelectionDropdownItems']['add']({'type':'button','model':_0x2f9991,'labelView':new Ia(this['locale'],_0x4c14de)});}}}['_createModelSelectionDropdown'](){const _0x1b3677=Gt(this['locale']);return _0x1b3677['set']({'panelPosition':'se','class':'ck-ai_review__check-list-item-model-dropdown'}),_0x1b3677['buttonView']['set']({'label':this['_defaultLabel'],'withText':!0x0,'tooltip':!0x0,'class':us}),_0x1b3677['buttonView']['bind']('isVisible')['to'](this,'modelDisplayMode',_0x480752=>'selector'===_0x480752),this['listenTo'](_0x1b3677,'execute',_0x3892c6=>{this['modelId']=_0x3892c6['source']['model']['id'],_0x1b3677['buttonView']['label']=_0x3892c6['source']['label'];}),_0x1b3677;}['_createModelNameView'](){const _0x58e4bf=new Aa(this['locale']);return _0x58e4bf['bind']('text')['to'](this,'activeModelName',_0x50f2d7=>_0x50f2d7??''),_0x58e4bf['bind']('isVisible')['to'](this,'modelDisplayMode',_0x3976c3=>'name'===_0x3976c3),_0x58e4bf;}['_createActionsFooterView'](){const _0x2726f6=new vt(this['locale']);return _0x2726f6['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']]}]}),_0x2726f6;}}class Aa extends vt{constructor(_0x2be35c){super(_0x2be35c),this['set']('text',void 0x0),this['set']('isVisible',!0x0);const _0x5c15e2=this['bindTemplate'];this['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai_review__check-list-item-model-name',_0x5c15e2['if']('isVisible','ck-hidden',_0x3c31ae=>!_0x3c31ae)]},'children':[{'text':_0x5c15e2['to']('text')}]});}}class Ia extends Mt{constructor(_0xb6909f,_0x13e644){super();const _0x1ee837=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-button__label'],'style':_0x1ee837['to']('style'),'id':_0x1ee837['to']('id')},'children':[{'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-model-dropdown-name']},'children':[{'tag':'span','children':[{'text':_0x1ee837['to']('text')}]}]},{'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-model-dropdown-description']},'children':[{'tag':'span','children':[_0x13e644['description']||'']}]}]});}}class Ea extends Ht{['_formItemsCollection']=new _0x4a50ef();['_customCheckView']=null;['_hideModels']=!0x1;constructor(_0x3c5baf,_0x43630a,_0x566589,_0x1bb35a=!0x1){super(_0x3c5baf),this['_hideModels']=_0x1bb35a,this['set']('isParametrizedViewOpen',!0x1),this['set']('isListItemRendered',!0x1),this['set']('isItemParametrized',_0x43630a['isParameterized']);const _0x45d6fd=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',_0xbae922=>_0xbae922),this['bindTemplate']['if']('isListItemRendered','ck-ai_review__check-list-item_rendered',_0x324709=>_0x324709)],'style':{'--ck-ai-review-check-list-item-index':_0x566589}},'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':_0x43630a['title']}]},_0x45d6fd]},{'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-description']},'children':_0x43630a['description']?[{'text':_0x43630a['description']}]:[]}]}]},..._0x43630a['isParameterized']?[this['_createParameterizedView'](_0x43630a)]:[],...'custom'===_0x43630a['id']?[this['_createCustomView'](_0x43630a,this['_hideModels'])]:[]]}),this['on']('click',()=>{_0x43630a['isParameterized']?this['isParametrizedViewOpen']=!0x0:this['fire']('runReviewCheck',{'id':_0x43630a['id'],'args':_0x43630a['useArgs']?_0x43630a['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'](_0x3fdd8d=>{_0x3fdd8d['resetToDefault']();}),this['_customCheckView']&&this['_customCheckView']['resetToDefault']();}['_createIconView'](){const _0x1ff2ed=new xt();return _0x1ff2ed['content']=rt,_0x1ff2ed['extendTemplate']({'attributes':{'class':['ck-ai_review__check-list-item-title-icon']}}),_0x1ff2ed;}['_createParameterizedView'](_0x149f37){const _0x5404c3=new vt(),_0x1a35d7=this['_createFormView'](_0x149f37);return _0x5404c3['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-parameterized',this['bindTemplate']['if']('isParametrizedViewOpen','ck-hidden',_0xa5ca3f=>!_0xa5ca3f)]},'children':[_0x1a35d7]}),_0x5404c3;}['_createFormView'](_0xd76bb1){const _0x4ef371=new vt(),_0x20ce76=Array['isArray'](_0xd76bb1['options'])?_0xd76bb1['options']:[],_0x4746cd=new Nt(this['locale']),t=this['locale']['t'];_0x4746cd['set']({'label':t('Submit'),'withText':!0x0,'class':cs}),_0x4746cd['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x47d56d=>{_0x47d56d['stopPropagation']();})}}),_0x4746cd['on']('execute',()=>{const _0x3983b4=[],_0x33a462={};this['_formItemsCollection']['forEach'](_0x126be6=>{_0x3983b4['push'](_0x126be6['value']),_0xd76bb1['useArgs']&&_0xd76bb1['options']&&(_0x33a462[_0x126be6['argsKey']]=_0x126be6['value']);}),this['fire']('runReviewCheck',{'id':_0xd76bb1['id'],'params':_0x3983b4['length']?_0x3983b4:void 0x0,'args':Object['keys'](_0x33a462)['length']?_0x33a462:void 0x0});});const _0x29caa1=_0x20ce76['length'];return _0x20ce76['forEach']((_0x46a6d4,_0x504b2b)=>{const _0xd4a52a=_0x504b2b===_0x29caa1-0x1;this['_formItemsCollection']['add'](new da(this['locale'],_0x46a6d4,_0xd4a52a?_0x4746cd:null));}),_0x4ef371['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-parameterized-form']},'children':this['_formItemsCollection']}),_0x4ef371;}['_createCustomView'](_0x3b13fd,_0x531adf=!0x1){return this['_customCheckView']=new ga(this['locale'],_0x3b13fd,_0x531adf),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',_0x5c2fe9=>!_0x5c2fe9)]}}),this['_customCheckView']['delegate']('runReviewCheck')['to'](this),this['listenTo'](this['_customCheckView'],'closeCustomCheck',()=>{this['isParametrizedViewOpen']=!0x1;}),this['on']('change:isParametrizedViewOpen',(_0x5d7b80,_0x11db1e,_0x219055)=>{_0x219055||this['_customCheckView']['resetFormValidationStatus']();}),this['_customCheckView'];}}class pa extends Ht{['_checkViews'];constructor(_0x4ceb95){super(_0x4ceb95),this['_checkViews']=new _0x4a50ef(),this['_setupTemplate']();}['setChecks'](_0xc964ee,_0x1839ca=!0x1){this['_checkViews']['clear']();for(const [_0xa59fe5,_0x8ebbeb]of _0xc964ee['entries']()){const _0x5ee68a=new Ea(this['locale'],_0x8ebbeb,_0xa59fe5,_0x1839ca);_0x5ee68a['delegate']('runReviewCheck')['to'](this),this['_checkViews']['add'](_0x5ee68a);}}['hasChecks'](){return this['_checkViews']['length']>0x0;}['resetAllParameterizedChecks'](){for(const _0x28e8e7 of this['_checkViews'])_0x28e8e7 instanceof Ea&&_0x28e8e7['resetToDefault']();}['_setupTemplate'](){const _0x2ccfcc=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-list',_0x2ccfcc['if']('isVisible','ck-hidden',_0x12c08b=>!_0x12c08b)]},'children':this['_checkViews']});}}class ma extends ra{static get['pluginName'](){return'AIReviewModeUI';}['createMainView'](){const _0x52eff7=this['context']['plugins']['get']('AITabs'),_0x334f86=this['context']['locale'],_0x4b84bd=new eo(_0x334f86,{'label':hs(_0x334f86,'AI_REVIEW_MODE'),'icon':_0x2222ae,'class':'ck-ai-header_review','showResizeButton':_0x52eff7['showResizeButton']});return _0x4b84bd['delegate']('resizeTabs')['to'](_0x52eff7),_0x4b84bd['bind']('isMaximized')['to'](_0x52eff7['view'],'isMaximized',_0x4290d7=>_0x4290d7),new aa(this['context']['locale'],{'header':_0x4b84bd,'list':new pa(_0x334f86),'results':new ca(_0x334f86,{'generalErrorText':hs(_0x334f86,'AI_REVIEW_MODE_GENERAL_ERROR_MESSAGE')}),'completed':new la(_0x334f86,{'headerText':hs(_0x334f86,'AI_REVIEW_MODE_FINISH_REVIEW_HEADER_TITLE'),'emptyResultsText':hs(_0x334f86,'AI_REVIEW_MODE_EMPTY_RESULTS_TEXT'),'buttonText':hs(_0x334f86,'AI_REVIEW_MODE_FINISH_REVIEW_BUTTON_LABEL')})});}['registerTab'](){const _0x311847=this['context']['plugins']['get']('AITabs');_0x311847['view']['on']('activateTab',(_0x439d3d,{newTab:_0x10d4c8,oldTab:_0x41309f})=>{'reviewMode'===_0x10d4c8?this['fire']('getReviewCheckList'):'reviewMode'===_0x41309f&&this['fire']('leaveReview');}),_0x311847['view']['addTab']({'id':'reviewMode','buttonLabel':hs(this['context']['locale'],'AI_REVIEW_MODE'),'buttonIcon':_0x2222ae,'order':0x0,'content':this['_mainView']});}}const Ta='review-',Ca=['softBreak'];class wa extends _0x490ade{static get['requires'](){return[_0x566822,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(_0x5ef5e0){super(_0x5ef5e0),this['_domEmitter']=new(Ot())(),this['_eventEmitter']=new(Tt())();}get['emitter'](){return this['_eventEmitter'];}['afterInit'](){const _0x55739c=_0x743fa7=>this['_scheduleAttachReviewEditingToEditor'](_0x743fa7);if(this['_registerGlobalBalloonBlurHandler'](),this['context']instanceof _0x52dd99)return void this['_attachReviewEditingToEditor'](this['context']);const _0x160c59=this['context'];for(const _0x572574 of _0x160c59['editors'])_0x55739c(_0x572574);this['listenTo'](_0x160c59['editors'],'add',(_0x3285c6,_0x3b181f)=>{_0x55739c(_0x3b181f);}),this['listenTo'](_0x160c59['editors'],'remove',(_0x136a6c,_0x36f03b)=>{for(const [_0x13cda0,_0x449f18]of this['_markers'])_0x449f18['editor']===_0x36f03b&&(this['_eventEmitter']['fire']('changeMarkerRemoved',{'markerId':_0x13cda0,'changeId':_0x449f18['groupId']}),this['_markers']['delete'](_0x13cda0));});}['_scheduleAttachReviewEditingToEditor'](_0x35c69c){const _0x4ca529=()=>{'destroyed'!==_0x35c69c['state']&&_0x35c69c['conversion']&&this['_attachReviewEditingToEditor'](_0x35c69c);};if('ready'===_0x35c69c['state'])return void _0x4ca529();const _0x24e939=()=>{this['stopListening'](_0x35c69c,'ready',_0x24e939),_0x4ca529();};this['listenTo'](_0x35c69c,'ready',_0x24e939);}['_attachReviewEditingToEditor'](_0x25b561){this['_reviewEditingAttachedEditors']['has'](_0x25b561)||(_0x25b561['conversion']['for']('editingDowncast')['markerToElement']({'model':Ta+'insert','view':(_0x9b76b4,{writer:_0x2ddbb9})=>{const _0xd3aaa5=this['_markers']['get'](_0x9b76b4['markerName']),_0x35f5de={'class':'ck-ai_review-marker_add'+(this['_activeMarkers']['has'](_0xd3aaa5?.['id']||'')?'\x20ck-ai_review__change_active':''),'data-marker-id':_0x9b76b4['markerName']};return _0x2ddbb9['createUIElement']('span',_0x35f5de,function(_0xe4579d){const _0x1b2743=this['toDomElement'](_0xe4579d);return _0x1b2743['innerHTML']=_0xd3aaa5?.['content']?.['asString']||'',_0x1b2743;});}}),_0x25b561['conversion']['for']('editingDowncast')['markerToHighlight']({'model':Ta+'remove-only','view':_0x3fd8a5=>{const _0x3cd48b=this['_markers']['get'](_0x3fd8a5['markerName']),_0x26d04d=['ck-ai_review-marker_strikethrough'];return this['_activeMarkers']['has'](_0x3cd48b?.['id']||'')&&_0x26d04d['push']('ck-ai_review__change_active'),{'classes':_0x26d04d,'attributes':{'data-marker-id':_0x3fd8a5['markerName']}};}}),_0x25b561['conversion']['for']('editingDowncast')['markerToHighlight']({'model':Ta+'remove-context','view':_0x2e4d28=>{const _0x3f54f5=this['_markers']['get'](_0x2e4d28['markerName']),_0x2f0234=['ck-ai_review-marker_underline'];return this['_activeMarkers']['has'](_0x3f54f5?.['id']||'')&&_0x2f0234['push']('ck-ai_review__change_active'),{'classes':_0x2f0234,'attributes':{'data-marker-id':_0x2e4d28['markerName']}};}}),_0x25b561['conversion']['for']('editingDowncast')['markerToHighlight']({'model':Ta+'remove-text','view':_0x2c6df8=>{const _0x929080=this['_markers']['get'](_0x2c6df8['markerName']),_0x459259=['ck-ai_review-marker_hide'];return this['_activeMarkers']['has'](_0x929080?.['id']||'')&&_0x459259['push']('ck-ai_review__change_active'),{'classes':_0x459259,'attributes':{'data-marker-id':_0x2c6df8['markerName']}};}}),_0x25b561['conversion']['for']('dataDowncast')['markerToElement']({'model':Ta+'suggestion-context','view':(_0x254268,{writer:_0x2dae27})=>_0x2dae27['createRawElement']('span',{'class':'ck-ai_review-marker_context-'+(_0x254268['isOpening']?'start':'end')})}),_0x25b561['conversion']['for']('downcast')['attributeToAttribute']({'model':_0x2afd81,'view':_0x2d7115}),this['_updateMouseMarkerInteractionListeners'](_0x25b561),this['listenTo'](_0x25b561,'addRoot',()=>this['_updateMouseMarkerInteractionListeners'](_0x25b561),{'priority':'lowest'}),this['listenTo'](_0x25b561,'detachRoot',()=>this['_updateMouseMarkerInteractionListeners'](_0x25b561),{'priority':'lowest'}),_0x25b561['model']['document']['registerPostFixer'](_0x1ca2d5=>this['_validateMarkers'](_0x25b561,_0x1ca2d5)),_0x25b561['model']['document']['on']('change',()=>this['_handleMarkerChanges'](_0x25b561)),this['_reviewEditingAttachedEditors']['add'](_0x25b561));}['_updateMouseMarkerInteractionListeners'](_0x37340e){let _0xf76c6=this['_boundEditables']['get'](_0x37340e);_0xf76c6||(_0xf76c6=new Map(),this['_boundEditables']['set'](_0x37340e,_0xf76c6));const _0x5ba902=new Set(_0x37340e['ui']['getEditableElementsNames']());for(const _0x43d4b6 of _0x5ba902){if(_0xf76c6['has'](_0x43d4b6))continue;const _0x13d572=_0x37340e['ui']['getEditableElement'](_0x43d4b6);_0xf76c6['set'](_0x43d4b6,_0x13d572),this['_attachMouseMarkerInteractionListeners'](_0x13d572);}for(const [_0x45b1a1,_0x412643]of _0xf76c6)_0x5ba902['has'](_0x45b1a1)||(_0xf76c6['delete'](_0x45b1a1),this['_domEmitter']['stopListening'](_0x412643));}['_attachMouseMarkerInteractionListeners'](_0x5d2434){this['_domEmitter']['listenTo'](_0x5d2434,'mouseup',(_0x5eb963,_0xc34748)=>{const _0xd9bc28=_0xc34748['target'],_0x10b8b1=this['_findMarkerElement'](_0xd9bc28);if(!_0x10b8b1)return;const _0x26f66a=_0x10b8b1['getAttribute']('data-marker-id'),_0x22cd34=_0x26f66a['split'](':')['pop']()?.['split']('_')[0x0];this['_eventEmitter']['fire']('changeMarkerClicked',{'markerId':_0x26f66a,'changeId':_0x22cd34,'markerElement':()=>this['_findMarkerElementById'](_0x26f66a),'domEvent':_0xc34748});},{'usePassive':!0x0,'priority':'highest'}),this['_domEmitter']['listenTo'](_0x5d2434,'mouseover',(_0x557f9d,_0x35ea00)=>{const _0xecc266=_0x35ea00['target'],_0x51ca12=_0x35ea00['relatedTarget'];let _0xc2c87e=this['_findMarkerElement'](_0xecc266);if(!_0xc2c87e&&_0x51ca12&&(_0xc2c87e=this['_findMarkerElement'](_0x51ca12)),!_0xc2c87e)return;const _0x53c6f0=_0xc2c87e['getAttribute']('data-marker-id'),_0x19d191=_0x53c6f0['split'](':')['pop']()?.['split']('_')[0x0];this['_eventEmitter']['fire']('changeMarkerHovered',{'changeId':_0x19d191,'markerElement':()=>this['_findMarkerElementById'](_0x53c6f0),'domEvent':_0x35ea00});});}['_registerGlobalBalloonBlurHandler'](){this['_domEmitter']['listenTo'](document,'mouseover',_0xbdcb87((_0x4a467c,_0x3d29f0)=>{const _0x120989=_0x3d29f0['target'];if(this['_findMarkerElement'](_0x120989))return;_0x120989['closest']('.ck-reset.ck-ai_review-balloon-panel-suggestion')||this['_eventEmitter']['fire']('changeMarkerBlurred');},0xc8));}['getDocumentData'](){const _0x9f0689=this['context']['plugins']['get']('AIEditing'),_0x1c06e6=Ws(this['context']);if(!_0x1c06e6['length'])throw new at('ai-get-editor-from-context-no-editor',this);const _0x4e3146=new Set(),_0xe22876=[],_0x4e2037=new Map();for(const _0x223b0d of _0x1c06e6)for(const _0x30e76e of _0x223b0d['model']['document']['getRoots']()){if('$graveyard'===_0x30e76e['rootName'])continue;const _0x55b670=this['_buildDocumentDataSliceForRoot'](_0x223b0d,_0x30e76e,_0x9f0689,_0x4e3146);_0xe22876['push'](_0x55b670['content']);for(const [_0x281bf0,_0x3a3c4b]of _0x55b670['elements'])_0x4e2037['set'](_0x281bf0,_0x3a3c4b);}return{'elements':_0x4e2037,'content':_0xe22876['join']('')};}['_buildDocumentDataSliceForRoot'](_0x1d5dfb,_0x435128,_0x1a08ff,_0x5a7f78){const _0x2d4ce9=_0x1d5dfb['model'],_0x290846=new _0x342c55();for(const _0x111888 of _0x435128['getChildren']())_0x290846['_appendChild'](_0x111888['_clone'](!0x0));for(const _0x1cd616 of _0x2d4ce9['markers']){const _0x5f4229=_0x1cd616['getRange']();_0x5f4229&&_0x5f4229['root']['rootName']===_0x435128['rootName']&&_0x290846['markers']['set'](_0x1cd616['name'],this['_changeRangeOwnerDocument'](_0x5f4229['clone'](),_0x290846));}const _0x3b0fc3=new Map(),_0x1750d7=_0x2d4ce9['document']['version'],_0x2f6589=new _0x210c56({'ignoreElementEnd':!0x0,'startPosition':_0x2d4ce9['createPositionAt'](_0x290846,0x0)});for(const {item:_0x55ee96}of _0x2f6589){if(!_0x55ee96['is']('$textProxy'))continue;const _0x4bda88=_0x55ee96['parent'];if(!_0x4bda88||!_0x4bda88['is']('element'))continue;const _0x19fa79=this['_upsertDataId'](_0x4bda88,()=>_0x1a08ff['_nextDataId'](_0x5a7f78));_0x5a7f78['add'](_0x19fa79);for(const _0xde1459 of _0x4bda88['getChildren']())_0xde1459['is']('element')&&(_0xde1459['name']&&Ca['includes'](_0xde1459['name'])||_0x5a7f78['add'](this['_upsertDataId'](_0xde1459,()=>_0x1a08ff['_nextDataId'](_0x5a7f78))));let _0x2e5eea=_0x4bda88;for(;_0x2e5eea['parent']&&!_0x2e5eea['parent']['is']('documentFragment');)_0x2e5eea=_0x2e5eea['parent'],_0x2e5eea['hasAttribute'](_0x2afd81)&&_0x2e5eea['_removeAttribute'](_0x2afd81);_0x3b0fc3['set'](_0x19fa79,{'editor':_0x1d5dfb,'rootName':_0x435128['rootName'],'path':_0x4bda88['getPath'](),'documentVersion':_0x1750d7,'getContent':this['_createGetContentUsingDataIdFn'](_0x2e5eea['_clone'](!0x0),_0x19fa79,_0x1d5dfb['data'])}),_0x2f6589['jumpTo'](_0x2d4ce9['createPositionAfter'](_0x4bda88));}return{'content':_0x1d5dfb['data']['processor']['toData'](_0x1d5dfb['data']['toView'](_0x290846)),'elements':_0x3b0fc3};}['diffContent'](_0x25732d,_0x3d7516,_0x3e92b1,_0x5776a2=!0x1){const _0x5366d8=[],_0x40096b=_0x25732d['data']['parse'](_0x3e92b1,'$documentFragment'),_0x4dea32=_0x25732d['data']['parse'](_0x3d7516,'$documentFragment'),_0x28c6a3=_0x25732d['model']['createPositionAt'](_0x4dea32,0x0);if(this['_haveSingleTopLevelElement'](_0x40096b)){if(!this['_hasSameTopLevelElement'](_0x4dea32,_0x40096b))return _0x5366d8;}else{const _0x4fed81=_0x25732d['model']['schema'];if(!this['_haveOnlyInlineContent'](_0x4dea32,_0x4fed81)||!this['_haveOnlyInlineContent'](_0x40096b,_0x4fed81))return _0x5366d8;}const _0x3ecf0a=this['context']['plugins']['get']('DocumentCompare')['getDiff'](_0x3d7516,_0x3e92b1,{'targetEditor':_0x25732d,'anchor':_0x28c6a3,'markDeletions':!0x0})['getOperations']()['filter'](_0x3f83a7=>'insert'===_0x3f83a7['type']||'marker'===_0x3f83a7['type']&&_0x3f83a7['name']['startsWith']('$markedRemove')),_0x583e91=this['_groupAdjacentOperations'](_0x3ecf0a),_0x4f9cdf=[];if(_0x5776a2){if(_0x583e91['length']){const _0x924ea9=_0x583e91[0x0]['operations'][0x0],_0x14dffe='insert'===_0x924ea9['type']?_0x924ea9['position']:_0x924ea9['newRange']['start'],_0x17523f=this['_getPositionLimitingRange'](_0x14dffe,_0x25732d,'inside'),_0x4140b2=_0x17523f?_0x40096b['getChild'](0x0)['getChildren']():_0x40096b['getChildren'](),_0x15926e=_0x17523f||_0x25732d['model']['createRangeIn'](_0x4dea32),_0x25d410=[new _0x4c42af('$markedRemove:synthetic'+ot(),null,_0x15926e,_0x25732d['model']['document']['model']['markers'],!0x0,_0x25732d['model']['document']['version']+0x1),new _0x226929(_0x15926e['end'],_0x4140b2,_0x25732d['model']['document']['version']+0x2)];_0x4f9cdf['push']({'operations':_0x25d410,'operationsIsolated':_0x25d410,'groupOffset':0x0});}}else _0x4f9cdf['push'](..._0x583e91);let _0x28f0db=0x0;return _0x25732d['model']['change'](_0x517bb6=>{for(let _0xf6d3be=0x0;_0xf6d3be<_0x4f9cdf['length'];_0xf6d3be++){const _0x1a77ba=_0x4f9cdf[_0xf6d3be],_0x16c677=_0x517bb6['createDocumentFragment']();for(const _0x587ab6 of _0x4dea32['getChildren']())_0x517bb6['append'](_0x587ab6['_clone'](!0x0),_0x16c677);for(const _0x16bd02 of _0x1a77ba['operationsIsolated'])if('insert'===_0x16bd02['type']){const _0x289835=_0x16bd02;_0x289835['baseVersion']=null,_0x289835['isDocumentOperation']=!0x1,this['_changeOperationOwnerDocument'](_0x289835,_0x16c677),_0x517bb6['batch']['addOperation'](_0x16bd02),_0x25732d['model']['applyOperation'](_0x16bd02);const _0x38ae73='suggestion:insertion:id:authorId:'+_0x28f0db++,_0x4a9298=_0x25732d['model']['createRange'](_0x289835['position'],_0x289835['position']['getShiftedBy'](_0x289835['howMany']));_0x16c677['markers']['set'](_0x38ae73,_0x4a9298);}else{if('marker'===_0x16bd02['type']&&_0x16bd02['name']['startsWith']('$markedRemove')){const _0xde5c9b=_0x16bd02,_0x303ed7='suggestion:deletion:id:authorId:'+_0x28f0db++;this['_changeOperationOwnerDocument'](_0xde5c9b,_0x16c677),_0x16c677['markers']['set'](_0x303ed7,_0xde5c9b['newRange']);}}if(_0x5776a2)_0x5366d8['push']({..._0x1a77ba,'context':this['_createGetContentFn'](_0x4dea32,_0x25732d['data']),'content':this['_createGetContentFn'](_0x4dea32,_0x25732d['data'])});else{const _0x584ce1=this['_getChangeContext'](this['_changePositionOwnerDocument'](this['_getOperationStart'](_0x1a77ba['operationsIsolated'][0x0]),_0x16c677),this['_changePositionOwnerDocument'](this['_getOperationEnd'](_0x1a77ba['operationsIsolated'][_0x1a77ba['operationsIsolated']['length']-0x1]),_0x16c677),_0x25732d);_0x16c677['markers']['set'](Ta+'suggestion-context',new _0x5779b9(_0x584ce1['start'],_0x584ce1['end'])),_0x5366d8['push']({..._0x1a77ba,'context':this['_createGetContextFn'](_0x16c677,_0x25732d['data'],{'ellipsisBefore':_0x584ce1['hasContentBefore'],'ellipsisAfter':_0x584ce1['hasContentAfter']}),'content':this['_createGetContentFn'](_0x16c677,_0x25732d['data'])});}}}),_0x5366d8;}['markChangePositionInEditorContent'](_0x4f6646,_0x5f50d){if(!_0x4f6646['length'])return;const _0x5e8533=_0x4f6646[0x0]['parent']['id'],_0x539666=_0x5f50d['elements']['get'](_0x5e8533);if(!_0x539666)return void console['warn']('No\x20element\x20found\x20for\x20ID:\x20'+_0x5e8533);const _0x33f4ec=_0x539666['path'],_0xc0762d=_0x539666['editor'],_0x5a74a2=_0xc0762d['model']['document']['getRoot'](_0x539666['rootName']);if(!_0x5a74a2)return void console['warn']('No\x20model\x20root\x20found\x20for\x20name:\x20'+_0x539666['rootName']);const _0x23f58b=_0xc0762d['model']['document']['history']['getOperations'](_0x539666['documentVersion']),_0x2223a9=[];for(const _0x5c17fa of _0x4f6646){const _0x1334b0=_0x5c17fa['operationsIsolated']['map'](_0x2c74dd=>this['_translateOperationToEditorContent'](_0x2c74dd,_0x33f4ec,_0x5a74a2));if(!_0x1334b0||!_0x1334b0['length'])continue;const _0x3847d=_0x1334b0['every'](_0x1f4d8d=>'marker'===_0x1f4d8d['type']&&_0x1f4d8d['name']['startsWith']('$markedRemove')),_0x2efab2={'document':_0xc0762d['model']['document'],'useRelations':!0x1,'padWithNoOps':!0x1},_0x26862b=_0x84a22e(_0x1334b0,_0x23f58b,_0x2efab2)['operationsA'];for(const _0x7b5f06 of _0x26862b)if('insert'===_0x7b5f06['type']){const _0x2726d0=_0x7b5f06,_0x36ae5f=_0x2726d0['nodes'];_0xc0762d['model']['change'](_0x19377b=>{const _0x4a0964=_0x19377b['createDocumentFragment']();for(const _0x4611f4 of _0x36ae5f)_0x19377b['append'](_0x4611f4['_clone'](!0x0),_0x4a0964);_0x2223a9['push']({'start':_0x2726d0['position'],'end':_0x2726d0['position'],'type':'insert','groupId':_0x5c17fa['id'],'content':{'asString':this['_createGetContentFn'](_0x4a0964,_0xc0762d['data'])(),'asFragment':_0x4a0964}});});}else{if('marker'===_0x7b5f06['type']&&_0x7b5f06['name']['startsWith']('$markedRemove')){const _0x2bc9bf=_0x7b5f06;let _0x34a9bd='remove-text';if(_0x3847d){const _0x4957ec=this['_findAdjacentContextDistance'](_0x2bc9bf['newRange']['start'],'backward',_0xc0762d['model']['schema']),_0x17e49d=this['_findAdjacentContextDistance'](_0x2bc9bf['newRange']['end'],'forward',_0xc0762d['model']['schema']);if(_0x4957ec||_0x17e49d){const _0xf49f27=_0x2bc9bf['newRange']['start']['getShiftedBy'](-_0x4957ec),_0x490646=_0x2bc9bf['newRange']['end']['getShiftedBy'](_0x17e49d);_0x2223a9['push']({'start':_0xf49f27,'end':_0x490646,'groupId':_0x5c17fa['id'],'type':'remove-context'});}else _0x34a9bd='remove-only';}_0x2223a9['push']({'start':_0x2bc9bf['newRange']['start'],'end':_0x2bc9bf['newRange']['end'],'groupId':_0x5c17fa['id'],'type':_0x34a9bd});}}}this['_insertMarkers'](_0x2223a9,_0xc0762d);}['clearAllMarkers'](){const _0x2c6687=new Map();for(const _0x39db6c of this['_markers']['keys']()){const _0x4041c5=this['_markers']['get'](_0x39db6c);_0x4041c5?.['editor']&&(_0x2c6687['has'](_0x4041c5['editor'])||_0x2c6687['set'](_0x4041c5['editor'],[]),_0x2c6687['get'](_0x4041c5['editor'])['push'](_0x39db6c));}for(const [_0x4e397b,_0x45c86c]of _0x2c6687)_0x4e397b['model']['change'](_0x4584f0=>{for(const _0x54be26 of _0x45c86c)_0x4e397b['model']['markers']['get'](_0x54be26)&&_0x4584f0['removeMarker'](_0x54be26);});this['_markers']['clear'](),this['_activeMarkers']['clear']();}['switchToReadOnly'](){for(const _0x42e1a0 of Ws(this['context']))_0x42e1a0['enableReadOnlyMode']('ai-review');}['switchToEdit'](){for(const _0x59afaa of Ws(this['context']))_0x59afaa['disableReadOnlyMode']('ai-review');}['applyChange'](_0x1eedd2){const _0xa3e20e=_0x1eedd2['map'](_0x4ca0b1=>this['_getMarkersDataForGroup'](_0x4ca0b1))['flat'](),_0x3963fe=new Map();for(const _0x590a70 of _0xa3e20e)_0x3963fe['has'](_0x590a70['editor'])||_0x3963fe['set'](_0x590a70['editor'],[]),_0x3963fe['get'](_0x590a70['editor'])['push'](_0x590a70);for(const [_0x1a2ea4,_0x3d3e81]of _0x3963fe){const _0x2fcb28=_0x1a2ea4['model'];_0x2fcb28['change'](_0x6f62bc=>{for(const _0x2e34a5 of _0x3d3e81){const _0x57720b=_0x1a2ea4['model']['markers']['get'](_0x2e34a5['id']);if(_0x57720b){if('insert'===_0x2e34a5['type']){if(!_0x2e34a5['content'])continue;_0x2fcb28['insertContent'](_0x2e34a5['content']['asFragment']||null,_0x57720b['getRange']()['start']);}else'remove-text'!==_0x2e34a5['type']&&'remove-only'!==_0x2e34a5['type']||_0x2fcb28['deleteContent'](_0x2fcb28['createSelection'](_0x57720b['getRange']()));_0x6f62bc['removeMarker'](_0x2e34a5['id']),this['_markers']['delete'](_0x2e34a5['id']);}}});}}['rejectChange'](_0x59d037){const _0x5d0e40=this['_getMarkersDataForGroup'](_0x59d037),_0x14724a=new Map();for(const _0x349119 of _0x5d0e40)_0x14724a['has'](_0x349119['editor'])||_0x14724a['set'](_0x349119['editor'],[]),_0x14724a['get'](_0x349119['editor'])['push'](_0x349119);for(const [_0x2a656f,_0x5da340]of _0x14724a)_0x2a656f['model']['change'](_0x1eb8ea=>{for(const _0x388fbe of _0x5da340)_0x1eb8ea['removeMarker'](_0x388fbe['id']),this['_markers']['delete'](_0x388fbe['id']);});}['getEditor'](){return $s(this['context']);}['getEditors'](){return Ws(this['context']);}['getEditorForChange'](_0x9bbdc9){const _0x550f72=this['_getMarkersDataForGroup'](_0x9bbdc9);return _0x550f72[0x0]?.['editor'];}['getMarkerElementForChange'](_0x26f3e9){const _0x26000e=Array['from'](this['_markers']['values']())['filter'](_0x2a46e5=>_0x2a46e5['groupId']===_0x26f3e9);if(!_0x26000e['length'])return null;const _0x193aac=0x1===_0x26000e['length']?_0x26000e[0x0]:this['_sortMarkers'](_0x26000e)[0x0],_0x48634a=_0x193aac['editor']['model']['markers']['get'](_0x193aac['id']);if(!_0x48634a)return null;return{'modelRange':_0x48634a['getRange'](),'getElement':()=>this['_findMarkerElementById'](_0x193aac['id'])};}['getContentElementForChange'](_0x470eb9){const _0x216acc=Array['from'](this['_markers']['values']())['filter'](_0x310d29=>_0x310d29['groupId']===_0x470eb9);if(!_0x216acc['length'])return null;const _0x481429=0x1===_0x216acc['length']?_0x216acc[0x0]:this['_sortMarkers'](_0x216acc)[0x0],_0x2dc28d=_0x481429['editor'],_0x32669f=_0x2dc28d['model']['markers']['get'](_0x481429['id']);if(!_0x32669f)return null;const _0x578178=_0x32669f['getRange'](),_0x4d3807=_0x2dc28d['editing']['view']['getDomRoot'](_0x578178['root']['rootName'])||_0x2dc28d['editing']['view']['getDomRoot']();if(!_0x4d3807||!_0x578178)return null;let _0xb46f71=_0x578178['start']['parent'];for(;_0xb46f71['parent']&&'$root'!==_0xb46f71['parent']['name'];)_0xb46f71=_0xb46f71['parent'];if(!_0xb46f71||!_0xb46f71['name'])return null;const _0x4ddbbb=_0x4d3807['querySelector']('[data-marker-id=\x22'+_0x481429['id']+'\x22]');if(!_0x4ddbbb)return null;let _0x5af727=null;_0x2dc28d['model']['change'](_0x311699=>{_0x5af727=_0x311699['createDocumentFragment'](),_0x311699['append'](_0xb46f71['_clone'](!0x0),_0x5af727);});const _0x2a8262=_0x2dc28d['data']['toView'](_0x5af727)['getChild'](0x0);return _0x4ddbbb['closest'](_0x2a8262['name']);}['reactivateMarkers'](_0x5d2b98){const _0x514c18=this['_getMarkersDataForGroup'](_0x5d2b98);if(!_0x514c18['length'])return;const _0x1c0c43=Array['from'](this['_activeMarkers'])['sort'](),_0xdfd116=Array['from'](new Set(_0x514c18['map'](_0x395432=>_0x395432['id'])))['sort']();_0x1c0c43['join']('|')!==_0xdfd116['join']('|')&&(this['setAllMarkersAsInactive'](),this['setMarkersInElementAsActive'](_0x5d2b98));}['setMarkersInElementAsActive'](_0xb075da){const _0x16b6fd=this['_getMarkersDataForGroup'](_0xb075da);if(!_0x16b6fd['length'])return;const _0x3eaf74=_0x16b6fd[0x0]['editor'],_0x1afab8=new Set(_0x16b6fd['map'](_0xf6279c=>_0xf6279c['id'])),_0x307cae=Array['from'](_0x1afab8['values']())['map'](_0x49714f=>_0x3eaf74['model']['markers']['get'](_0x49714f))['filter'](_0xadd5fb=>!!_0xadd5fb);_0x1afab8['forEach'](_0x392c42=>{this['_activeMarkers']['add'](_0x392c42);}),_0x3eaf74['model']['change'](()=>{_0x307cae['forEach'](_0x867ea0=>{_0x3eaf74['editing']['reconvertMarker'](_0x867ea0);});});}['setAllMarkersAsInactive'](){const _0x2aff4c=Array['from'](this['_activeMarkers']);if(!_0x2aff4c['length'])return;this['_activeMarkers']['clear']();const _0x52521a=new Map();for(const _0x155a59 of _0x2aff4c){const _0x32c06a=this['_markers']['get'](_0x155a59);if(!_0x32c06a)continue;const _0x11280e=_0x32c06a['editor'],_0x2d93d4=_0x11280e['model']['markers']['get'](_0x155a59);_0x2d93d4&&(_0x52521a['has'](_0x11280e)||_0x52521a['set'](_0x11280e,[]),_0x52521a['get'](_0x11280e)['push'](_0x2d93d4));}for(const [_0x4c5590,_0x6d8968]of _0x52521a)_0x4c5590['model']['change'](()=>{_0x6d8968['forEach'](_0x51b84b=>{_0x4c5590['editing']['reconvertMarker'](_0x51b84b);});});}['_getPositionLimitingRange'](_0x482146,_0x3d1f9d,_0x1422ba='outside'){if(!_0x482146)return null;let _0x229f07=_0x482146['parent'];for(;_0x229f07&&_0x229f07['parent']&&'$root'!==_0x229f07['parent']['name']&&!_0x3d1f9d['model']['schema']['isLimit'](_0x229f07)&&!_0x3d1f9d['model']['schema']['isBlock'](_0x229f07);)_0x229f07=_0x229f07['parent'];if(!_0x229f07||!_0x229f07['name']||'$root'===_0x229f07['name'])return null;let _0x145274=null;return _0x3d1f9d['model']['change'](_0x240fa5=>{_0x145274='inside'===_0x1422ba?_0x240fa5['createRangeIn'](_0x229f07):_0x240fa5['createRangeOn'](_0x229f07);}),_0x145274;}['_validateMarkers'](_0x92f346,_0x193e3d){const _0x2c86b4=Array['from'](this['_markers']['keys']()),_0x5b9589=new Map();for(const _0x110563 of _0x2c86b4){const _0x3767c9=_0x92f346['model']['markers']['get'](_0x110563);if(!_0x3767c9)continue;const _0x19b3d4=_0x3767c9['getStart']()['root']['rootName']+':'+_0x3767c9['getStart']()['path'][0x0];_0x5b9589['has'](_0x19b3d4)||_0x5b9589['set'](_0x19b3d4,[]),_0x5b9589['get'](_0x19b3d4)['push'](_0x3767c9);}const _0x2c3a49=new Set();for(const _0x1a794a of _0x92f346['model']['document']['differ']['getChanges']()){let _0x948f3d='',_0x26a4e3=null;if('insert'===_0x1a794a['type'])_0x26a4e3=new _0x5779b9(_0x1a794a['position'],_0x1a794a['position']['getShiftedBy'](_0x1a794a['length'])),_0x948f3d=_0x1a794a['position']['root']['rootName']+':'+_0x1a794a['position']['path'][0x0];else{if('remove'!==_0x1a794a['type'])continue;_0x26a4e3=new _0x5779b9(_0x1a794a['position']),_0x948f3d=_0x1a794a['position']['root']['rootName']+':'+_0x1a794a['position']['path'][0x0];}const _0x28d1e2=_0x5b9589['get'](_0x948f3d)||[];if(_0x28d1e2['length']){for(const _0x1a59a3 of _0x28d1e2)if(_0x26a4e3['root']['rootName']===_0x1a59a3['getRange']()['root']['rootName']&&('insert'!==_0x1a794a['type']||!_0x26a4e3['containsRange'](_0x1a59a3['getRange']()))&&(_0x26a4e3['isIntersecting'](_0x1a59a3['getRange']())||_0x26a4e3['start']['isTouching'](_0x1a59a3['getRange']()['end'])||_0x26a4e3['end']['isTouching'](_0x1a59a3['getRange']()['start']))){const _0x180be1=this['_parseMarkerName'](_0x1a59a3['name']);Array['from'](this['_markers']['values']())['filter'](_0x38c5ce=>_0x38c5ce['groupId']===_0x180be1['groupId'])['forEach'](_0x1c0edf=>_0x2c3a49['add'](_0x1c0edf['id']));}}}if(_0x2c3a49['size']){for(const _0x5e84a9 of _0x2c3a49)_0x193e3d['removeMarker'](_0x5e84a9);return!0x0;}return!0x1;}['_handleMarkerChanges'](_0x20ba12){for(const {name:_0x3c98a9,data:_0x185598}of _0x20ba12['model']['document']['differ']['getChangedMarkers']()){if(!_0x3c98a9['startsWith'](Ta))continue;const _0x1ddacb=_0x185598['oldRange'],_0x3a532a=_0x185598['newRange'],_0x173773=_0x1ddacb&&'$graveyard'===_0x1ddacb['root']['rootName'],_0x32a8b2=_0x3a532a&&'$graveyard'===_0x3a532a['root']['rootName'];if(_0x173773&&_0x32a8b2)continue;const _0x49291b=this['_parseMarkerName'](_0x3c98a9);this['_markers']['get'](_0x3c98a9)&&(_0x32a8b2||!_0x3a532a?this['_eventEmitter']['fire']('changeMarkerRemoved',{'markerId':_0x3c98a9,'changeId':_0x49291b['groupId']}):_0x173773&&_0x3a532a&&this['_eventEmitter']['fire']('changeMarkerRestored',{'markerId':_0x3c98a9,'changeId':_0x49291b['groupId']}));}}['_parseMarkerName'](_0x23e241){const _0x2d271f=_0x23e241['split'](':'),_0x1f77f8=(_0x2d271f[0x1]||'')['split']('_');return{'prefix':_0x2d271f[0x0],'groupId':_0x1f77f8[0x0],'suffix':_0x1f77f8[0x1]};}['_translateOperationToEditorContent'](_0x45d4e9,_0x4c17f6,_0x5d5f5b){if('insert'===_0x45d4e9['type']){const _0x193a4d=_0x45d4e9;return new _0x226929(this['_changePosition'](_0x4c17f6['concat'](_0x193a4d['position']['offset']),_0x5d5f5b),_0x193a4d['nodes'],_0x193a4d['baseVersion']);}if('marker'===_0x45d4e9['type']&&_0x45d4e9['name']['startsWith']('$markedRemove')){const _0x5ed7b1=_0x45d4e9;return new _0x4c42af(_0x5ed7b1['name'],_0x5ed7b1['oldRange'],this['_changeRange'](_0x5ed7b1['newRange'],_0x4c17f6['concat'](_0x5ed7b1['newRange']['start']['offset']),_0x4c17f6['concat'](_0x5ed7b1['newRange']['end']['offset']),_0x5d5f5b),_0x5ed7b1['_markers'],_0x5ed7b1['affectsData'],_0x5ed7b1['baseVersion']);}return _0x45d4e9;}['_groupAdjacentOperations'](_0x2d9eeb){if(!_0x2d9eeb['length'])return[];const _0x154de9=[];let _0x2ebf1d=0x0,_0x5b27ef=0x0,_0x26acbf=[];for(let _0x2a1f9f=0x0;_0x2a1f9f<=_0x2d9eeb['length'];_0x2a1f9f++){const _0x2ba7f2=_0x2d9eeb[_0x2a1f9f],_0x30cca4=_0x2d9eeb[_0x2a1f9f-0x1];!_0x2ba7f2||_0x30cca4&&!this['_getOperationEnd'](_0x30cca4)['isTouching'](this['_getOperationStart'](_0x2ba7f2))?(_0x154de9['push']({'operations':_0x26acbf,'operationsIsolated':_0x26acbf['map'](_0x440996=>this['_shiftOperation'](_0x440996['clone'](),-_0x5b27ef)),'groupOffset':_0x2ebf1d}),_0x26acbf=_0x2ba7f2?[_0x2ba7f2]:[],_0x5b27ef+=_0x2ebf1d,_0x2ebf1d=0x0):_0x26acbf['push'](_0x2ba7f2),_0x2ba7f2&&'insert'===_0x2ba7f2['type']&&(_0x2ebf1d+=_0x2ba7f2['howMany']);}return _0x154de9;}['_findAdjacentContextDistance'](_0xb4f25d,_0x579111,_0x4edf92,_0x1c0236=0x1){const _0x444221=new _0x210c56({'startPosition':_0xb4f25d,'direction':_0x579111});let _0x56a05a=0x0;for(let _0x43866c=0x0;_0x43866c<_0x1c0236;_0x43866c++){let _0xe72b52=0x0,_0x14b8b6=!0x1,_0x2ffce1='forward'===_0x579111?/^\W*\w+/:/\w+\W*$/;for(const {item:_0x371b52}of _0x444221)if(_0x371b52['is']('$textProxy')){const _0x23bd64=_0x2ffce1['exec'](_0x371b52['data']);if(_0x23bd64&&_0x23bd64['length']){if(_0xe72b52+='forward'===_0x579111?_0x23bd64['index']+_0x23bd64[0x0]['length']:_0x371b52['data']['length']-_0x23bd64['index'],_0x23bd64[0x0]['length']!==_0x371b52['data']['length'])break;_0x14b8b6=!0x0,_0x2ffce1='forward'===_0x579111?/^\w+/:/\w+$/;}else{if(_0x14b8b6)break;_0xe72b52+=_0x371b52['offsetSize'];}}else{if(_0x371b52['is']('element')){_0x4edf92['isInline'](_0x371b52)&&!_0x14b8b6&&(_0xe72b52+=0x1);break;}}_0x56a05a+=_0xe72b52,_0x444221['jumpTo'](_0xb4f25d['getShiftedBy']('forward'===_0x579111?_0x56a05a:-_0x56a05a));}return _0x56a05a;}['_getChangeContext'](_0x219817,_0x4834f4,_0x1630fe){const _0x204dd2=_0x1630fe['model']['schema'],_0x4c2e19=this['_findAdjacentContextDistance'](_0x219817,'backward',_0x204dd2,0x6),_0x270ffe=this['_findAdjacentContextDistance'](_0x4834f4,'forward',_0x204dd2,0x6),_0x2f45fe=_0x219817['getShiftedBy'](-_0x4c2e19),_0x19a91b=_0x4834f4['getShiftedBy'](_0x270ffe);return{'start':_0x2f45fe,'end':_0x19a91b,'hasContentBefore':!_0x2f45fe['isAtStart'],'hasContentAfter':!_0x19a91b['isAtEnd']};}['_insertMarkers'](_0x4e48fa,_0x32e590){const _0x30079c=this['context']['plugins']['get']('AIEditing'),_0x592c14=new Set();_0x32e590['model']['change'](_0x4690fb=>{for(const _0x437b0d of _0x4e48fa){const _0xaa4448=''+Ta+_0x437b0d['type']+':'+_0x437b0d['groupId']+'_'+_0x30079c['_nextDataId'](_0x592c14);this['_markers']['set'](_0xaa4448,{'id':_0xaa4448,'groupId':_0x437b0d['groupId'],'type':_0x437b0d['type'],'content':_0x437b0d['content'],'editor':_0x32e590}),_0x4690fb['addMarker'](_0xaa4448,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x4690fb['createRange'](_0x437b0d['start'],_0x437b0d['end'])});}});}['_createGetContextFn'](_0x8f15a5,_0x321f72,_0x15c8ac){let _0xa4ea72='';return()=>{if(!_0xa4ea72){const _0x2724d3=_0x321f72['toView'](_0x8f15a5,{'showSuggestionHighlights':!0x0});let _0x50cf16=_0x2724d3['getChild'](0x0);if(_0x50cf16['is']('containerElement')||(_0x50cf16=_0x2724d3),!_0x50cf16)return'';let _0x2f5452=!0x1;const _0x39186d=[];for(const _0x2c81ec of _0x50cf16['getChildren']())_0x2c81ec['is']('element','span')&&_0x2c81ec['hasClass']('ck-ai_review-marker_context-end')&&(_0x2f5452=!0x1),_0x2f5452&&_0x39186d['push'](_0x2c81ec),_0x2c81ec['is']('element','span')&&_0x2c81ec['hasClass']('ck-ai_review-marker_context-start')&&(_0x2f5452=!0x0);_0x50cf16['_removeChildren'](0x0,_0x50cf16['childCount']),_0x15c8ac?.['ellipsisBefore']&&_0x50cf16['_appendChild']('…'),_0x50cf16['_appendChild'](_0x39186d),_0x15c8ac?.['ellipsisAfter']&&_0x50cf16['_appendChild']('…');const _0x224998=_0x321f72['htmlProcessor']['domConverter']['viewToDom'](_0x2724d3),_0xc9c050=_0x321f72['htmlProcessor']['htmlWriter']['getHtml'](_0x224998);_0xa4ea72=_0xc9c050;}return _0xa4ea72;};}['_createGetContentFn'](_0xb49d54,_0x1c8180){let _0xfeacb8='';return()=>(_0xfeacb8||(_0xfeacb8=_0x1c8180['stringify'](_0xb49d54,{'showSuggestionHighlights':!0x0})),_0xfeacb8);}['_createGetContentUsingDataIdFn'](_0x5a9d67,_0xc954b5,_0x4f0f18){let _0x32acd8='';return()=>{if(!_0x32acd8){const _0x412751=_0x4f0f18['toView'](new _0x342c55(_0x5a9d67)),_0x99d35c=_0x4f0f18['htmlProcessor']['domConverter']['viewToDom'](_0x412751)['querySelector']('[data-id=\x22'+_0xc954b5+'\x22]');_0x32acd8=_0x99d35c?.['outerHTML']||'';}return _0x32acd8;};}['_findMarkerElement'](_0x40f77f,_0x52d41b=0x5){let _0x451c1e=_0x40f77f,_0x438a9e=null;for(let _0x383506=0x0;_0x383506<_0x52d41b&&_0x451c1e;_0x383506++){if(!_0x451c1e['className']){_0x451c1e=_0x451c1e['parentElement'];continue;}if(!(''+_0x451c1e['className'])['includes']('ck-ai_review-marker_')){_0x451c1e=_0x451c1e['parentElement'];continue;}if(!_0x451c1e['getAttribute']('data-marker-id'))break;_0x438a9e=_0x451c1e;break;}return _0x438a9e;}['_findMarkerElementById'](_0x2b476d){const _0x1df2d2=this['_markers']['get'](_0x2b476d),_0x11ec54=_0x1df2d2?.['editor']??$s(this['context']),_0x34827e=_0x11ec54['model']['markers']['get'](_0x2b476d);return _0x34827e?_0x5d9dce(_0x11ec54['editing'],_0x34827e):null;}['_getMarkersDataForGroup'](_0x1b3ce1){return Array['from'](this['_markers']['values']())['filter'](_0x3fb181=>_0x3fb181['groupId']===_0x1b3ce1);}['_getOperationStart'](_0x147cce){return'insert'===_0x147cce['type']?_0x147cce['position']:_0x147cce['newRange']['start'];}['_getOperationEnd'](_0x3dfb24,_0x5a7db7=!0x1){return'insert'===_0x3dfb24['type']?_0x5a7db7?_0x3dfb24['position']:_0x3dfb24['position']['getShiftedBy'](_0x3dfb24['howMany']):_0x3dfb24['newRange']['end'];}['_shiftOperation'](_0x17e384,_0x3a6a04){return'insert'===_0x17e384['type']?_0x17e384['position']=_0x17e384['position']['getShiftedBy'](_0x3a6a04):'marker'===_0x17e384['type']&&_0x17e384['newRange']&&(_0x17e384['newRange']=new _0x5779b9(_0x17e384['newRange']['start']['getShiftedBy'](_0x3a6a04),_0x17e384['newRange']['end']['getShiftedBy'](_0x3a6a04))),_0x17e384;}['_changeOperationOwnerDocument'](_0x3005c1,_0xf780c4){'insert'===_0x3005c1['type']?_0x3005c1['position']=this['_changePositionOwnerDocument'](_0x3005c1['position'],_0xf780c4):'marker'===_0x3005c1['type']&&_0x3005c1['newRange']&&(_0x3005c1['newRange']=this['_changeRangeOwnerDocument'](_0x3005c1['newRange'],_0xf780c4));}['_changePositionOwnerDocument'](_0x4aabee,_0x1b2a10){return new _0x1c4ec6(_0x1b2a10,_0x4aabee['path']);}['_changeRangeOwnerDocument'](_0x1f0161,_0x63dbe2){return new _0x5779b9(this['_changePositionOwnerDocument'](_0x1f0161['start'],_0x63dbe2),this['_changePositionOwnerDocument'](_0x1f0161['end'],_0x63dbe2));}['_changePosition'](_0x5a218d,_0x370472){return new _0x1c4ec6(_0x370472,[..._0x5a218d]);}['_changeRange'](_0x548844,_0x4d2f50,_0x48a7ce,_0x96a895){return new _0x5779b9(this['_changePosition'](_0x4d2f50,_0x96a895),this['_changePosition'](_0x48a7ce,_0x96a895));}['_sortMarkers'](_0x4312ce){const _0x9e99d7=_0x4b4dc4=>{switch(_0x4b4dc4){case'insert':return 0x0;case'remove-context':return 0x1;case'remove-only':return 0x2;case'remove-text':return 0x3;}};return _0x4312ce['sort']((_0x327beb,_0x28b6a5)=>_0x9e99d7(_0x327beb['type'])-_0x9e99d7(_0x28b6a5['type']));}['_hasSameTopLevelElement'](_0x15b706,_0x5dc55d){const _0xb59022=_0x15b706['getChild'](0x0),_0x56b2d9=_0x5dc55d['getChild'](0x0);return!(!_0xb59022||!_0x56b2d9)&&((!_0xb59022['is']('element')||!_0x56b2d9['is']('element')||_0xb59022['name']===_0x56b2d9['name'])&&!(_0xb59022['is']('element')&&!_0x56b2d9['is']('element')||!_0xb59022['is']('element')&&_0x56b2d9['is']('element')));}['_haveSingleTopLevelElement'](_0xd91c40){return 0x1===_0xd91c40['childCount'];}['_haveOnlyInlineContent'](_0x31416c,_0x59b313){for(const _0x189784 of _0x31416c['getChildren']())if(_0x189784['is']('element')&&!_0x59b313['isInline'](_0x189784))return!0x1;return!0x0;}['_upsertDataId'](_0x181d82,_0x98ce89){let _0x2b4b28=_0x181d82['getAttribute'](_0x2afd81);return _0x2b4b28||(_0x2b4b28=_0x98ce89(),_0x181d82['_setAttribute'](_0x2afd81,_0x2b4b28)),_0x2b4b28;}}class fa extends Tt(){['id'];['contentNew'];['contentInitial'];['documentVersion'];constructor({id:_0x5d6d74,contentNew:_0x1aa486,contentInitial:_0x21dfa7,documentVersion:_0x34dfb8}){super(),this['id']=_0x5d6d74,this['contentNew']=_0x1aa486,this['contentInitial']=_0x21dfa7,this['documentVersion']=_0x34dfb8;}}class ba extends ht(){['id'];['parent'];['_data'];['_editorOperations']=[];constructor(_0x5edcbf,_0xf16b79,_0x4e77c5){super(),this['id']=_0x5edcbf,this['parent']=_0x4e77c5,this['_data']=_0xf16b79,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(_0x2f533b,_0x4a0b89,_0x2bd167,_0x344e0a,_0x3fd5fc){super(),this['_sourceCheck']=_0x4a0b89,this['_documentData']=_0x2f533b,this['_aiConnector']=_0x2bd167,this['_reviewParams']=_0x344e0a,this['_reviewArgs']=_0x3fd5fc,this['on']('change:status',(_0x30628d,_0x36c3d8,_0x4b93f8)=>{'aborted'==_0x4b93f8&&(this['_wasAborted']=!0x0),this['fire']('reviewCheckRunUpdated',{'status':_0x4b93f8,'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'](_0xc6c692=>'pending'===_0xc6c692['status']);}get['currentError'](){return this['_currentError'];}['updateDocumentData'](_0xb60975){this['_documentData']=_0xb60975;}async['start'](){this['status']='loading',this['_currentError']=void 0x0;try{this['_activeRequest']=this['_createApiRequest']();const _0xa938a0=await this['_activeRequest']['getStream']();this['status']='data';for await(const _0x5ee3fc of _0xa938a0)'unmodified'!==_0x5ee3fc['data']['operation']&&('error'!==_0x5ee3fc['data']['operation']?'review-metadata'!==_0x5ee3fc['event']?this['_addReviewCheckResult'](_0x5ee3fc['data']['dataId'],_0x5ee3fc['data']['textDelta']):this['callId']=_0x5ee3fc['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(_0x9f4d2b){this['_currentError']=_0x9f4d2b,_0x9f4d2b instanceof Error&&_0x9f4d2b['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'](_0x1c626d,_0x5c014c){const _0x2a98a3=this['_results']['get'](_0x1c626d);if(!_0x2a98a3)return;if(0x0===_0x5c014c['length'])return;const _0x14492b=[];_0x5c014c['forEach']((_0x9c3686,_0x1add1d)=>{const _0x23dacd=new ba(_0x2a98a3['id']+'-'+_0x1add1d,_0x9c3686,_0x2a98a3);_0x23dacd['on']('change:status',()=>{this['fire']('reviewCheckResultChangeStatusUpdated',{'change':_0x23dacd,'status':_0x23dacd['status']});}),_0x23dacd['on']('change:isActivated',()=>{_0x23dacd['isActivated']?this['fire']('reviewCheckResultActivated',{'change':_0x23dacd}):this['fire']('reviewCheckResultDeactivated',{'change':_0x23dacd});}),this['_changes']['push'](_0x23dacd),_0x14492b['push'](_0x23dacd);}),this['fire']('reviewCheckResultReady',{'changes':_0x14492b,'result':_0x2a98a3,'source':this});}['abort'](){this['_activeRequest']&&(this['_activeRequest']['abortController']['abort'](),this['_activeRequest']=null,this['status']='aborted');}['isChangeActive'](_0xa125d8){const _0x380a1f=this['_changes']['find'](_0x233e1f=>_0x233e1f['id']===_0xa125d8);return!(!_0x380a1f||'pending'!==_0x380a1f['status']);}['isAnyChangeActivated'](){return this['_changes']['some'](_0x199cdf=>!0x0===_0x199cdf['isActivated']);}['getActiveChanges'](){return this['_changes']['filter'](_0x29de3c=>'pending'===_0x29de3c['status']);}['getChangeById'](_0x425339){return this['_changes']['find'](_0x338bb0=>_0x338bb0['id']===_0x425339);}['markAllChangesAsAccepted'](){for(const _0x46acb7 of this['_changes'])'pending'===_0x46acb7['status']&&(_0x46acb7['status']='accepted');this['_checkIfFinished']();}['markChangeAsAccepted'](_0x5f0b33){const _0x3be691=this['_changes']['find'](_0xb8cb4b=>_0xb8cb4b['id']===_0x5f0b33);_0x3be691&&'pending'===_0x3be691['status']&&(_0x3be691['status']='accepted'),this['_checkIfFinished']();}['markChangeAsRejected'](_0x1b9f16){const _0x58ad4f=this['_changes']['find'](_0x5b770e=>_0x5b770e['id']===_0x1b9f16);_0x58ad4f&&'pending'===_0x58ad4f['status']&&(_0x58ad4f['status']='rejected'),this['_checkIfFinished']();}['markChangeAsOutdated'](_0x960d6e){const _0x21920c=this['_changes']['find'](_0x5df4c8=>_0x5df4c8['id']===_0x960d6e);_0x21920c&&'pending'===_0x21920c['status']&&(_0x21920c['status']='outdated'),this['_checkIfFinished']();}['markChangeAsPending'](_0xfafbb3){const _0x279df5=this['_changes']['find'](_0x50af09=>_0x50af09['id']===_0xfafbb3);_0x279df5&&'outdated'===_0x279df5['status']&&(_0x279df5['status']='pending'),this['_checkIfFinished']();}['activateChange'](_0x36d18f){this['_changes']['filter'](_0x5ef81c=>_0x5ef81c['isActivated']&&_0x5ef81c['id']!==_0x36d18f)['forEach'](_0x6c48b3=>{_0x6c48b3['isActivated']=!0x1;});const _0x4aba77=this['_changes']['find'](_0x368c91=>_0x368c91['id']===_0x36d18f);_0x4aba77&&'pending'===_0x4aba77['status']&&(_0x4aba77['isActivated']=!0x0);}['deactivateChange'](){this['_changes']['filter'](_0x47d84f=>_0x47d84f['isActivated'])['forEach'](_0x3757d6=>{_0x3757d6['isActivated']=!0x1;});}['forceReadyState'](){this['status']='ready';}async['sendRating'](_0x1c82ea){if('initialized'===this['status']||'loading'===this['status']||'data'===this['status']||this['_wasAborted'])return;if(!this['callId']||0x0===this['_changes']['length'])return;let _0x407900;if(_0x1c82ea){const _0x11a624=this['_changes']['find'](_0x5de9ba=>_0x5de9ba['id']===_0x1c82ea);if(_0x11a624&&_0x11a624['isRated'])return;_0x11a624&&(_0x407900=_0x11a624['parent']['id'],_0x11a624['isRated']=!0x0);}const _0x392b61={'positiveCount':this['_changes']['filter'](_0x16d477=>'accepted'===_0x16d477['status'])['length'],'totalCount':this['_changes']['length']};this['_sendRatingRequest'](_0x392b61,this['callId'],_0x407900);}['_addReviewCheckResult'](_0x5d0f94,_0x2866eb){const _0x3db0fc=this['_documentData']['elements']['get'](_0x5d0f94);if(!_0x3db0fc)return;const _0x594c5d=_0x3db0fc['getContent']();if(_0x594c5d===_0x2866eb)return;const _0x3b507c=new fa({'id':_0x5d0f94,'contentInitial':_0x594c5d,'contentNew':_0x2866eb,'documentVersion':_0x3db0fc['documentVersion']});this['_results']['set'](_0x3b507c['id'],_0x3b507c),this['fire']('reviewCheckResultAdded',{'result':_0x3b507c,'source':this,'editor':_0x3db0fc['editor']});}['_checkIfFinished'](){'finished'===this['status']&&(this['_changes']['filter'](_0x588582=>'pending'===_0x588582['status'])['length']>0x0&&(this['status']='ready')),'ready'===this['status']&&(0x0===this['_changes']['filter'](_0x4d1c5e=>'pending'===_0x4d1c5e['status'])['length']&&(this['status']='finished'));}}class Ra extends Sa{get['subTitle'](){if(!this['_reviewParams']||0x0===this['_reviewParams']['length'])return'';const _0x3651ae=[];if(this['_reviewParams']['length']>0x0&&this['_sourceCheck']['options'])for(let _0x6a5b1d=0x0;_0x6a5b1d<this['_reviewParams']['length'];_0x6a5b1d++){if(!this['_reviewParams'][_0x6a5b1d]||!this['_sourceCheck']['options'][_0x6a5b1d])continue;const _0x279314=this['_sourceCheck']['options'][_0x6a5b1d],_0x4b42df=_0x279314['data']?.['find'](_0x4071c2=>_0x4071c2['id']===this['_reviewParams'][_0x6a5b1d]);_0x4b42df&&_0x3651ae['push'](_0x4b42df['label']);}return _0x3651ae['join'](',\x20');}get['reviewName'](){return this['_composeReviewName']();}['_createApiRequest'](){return this['_aiConnector']['callSystemReview']({'reviewName':this['_composeReviewName'](),'content':this['_documentData']['content'],'args':this['_reviewArgs']});}['_sendRatingRequest'](_0x107cfd,_0x421ae7,_0x100b02){return this['_aiConnector']['upsertAIReviewRating'](this['reviewName'],_0x421ae7,_0x107cfd,_0x100b02);}['_composeReviewName'](){return!this['_reviewParams']||0x0===this['_reviewParams']['length']||this['_sourceCheck']['useArgs']?this['_sourceCheck']['apiId']:[this['_sourceCheck']['apiId'],...this['_reviewParams']]['join']('-');}}class Oa extends _0x490ade{['_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(_0x31fdd9,_0x2c6fbe)=>{const _0xcc2d02=this['_aiReviewCheckList']['getCheckById'](_0x2c6fbe['id']);if(_0xcc2d02){this['_onReviewCheckRun'](_0x2c6fbe),this['_aiReviewCoreEditing']['switchToReadOnly'](),this['_currentReviewCheckRun']=this['_createReviewCheckRun'](_0x2c6fbe,_0xcc2d02),this['_aiReviewCoreUi']['setCheckResultTitle'](this['_currentReviewCheckRun']['title'],this['_currentReviewCheckRun']['subTitle']),this['_currentReviewCheckRun']['on']('reviewCheckRunUpdated',(_0x2c81d4,_0x4695c1)=>{switch(_0x4695c1['status']){case'data':case'loading':this['_aiReviewCoreUi']['showCheckRunResults'](_0x4695c1);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'!==_0x4695c1['status']&&'error-chunk'!==_0x4695c1['status']&&'error-general'!==_0x4695c1['status']||this['_currentReviewCheckRun']?.['sendRating']();}),this['_currentReviewCheckRun']['on']('reviewCheckResultAdded',(_0x1ae0fd,_0x1bf628)=>{if(!this['_currentReviewCheckRun'])throw new at('ai-review-mode-no-current-check-run',this);const _0x5b2f77=this['_diffContent'](_0x1bf628['editor'],_0x1bf628['result']['contentInitial'],_0x1bf628['result']['contentNew']);_0x1bf628['source']['addResultChanges'](_0x1bf628['result']['id'],_0x5b2f77);}),this['_currentReviewCheckRun']['on']('reviewCheckResultReady',(_0x4f7e70,_0x27d72b)=>{for(const _0x285e1d of _0x27d72b['changes'])this['_aiReviewCoreUi']['showCheckRunResult'](_0x285e1d);this['_markChangePositionInEditorContent'](_0x27d72b['changes'],_0x27d72b['source']['documentData']);}),this['_currentReviewCheckRun']['on']('reviewCheckResultChangeStatusUpdated',(_0x57493d,_0x13e99e)=>{this['_aiReviewCoreUi']['updateChangeState'](_0x13e99e['change']['id'],_0x13e99e['status']);}),this['_currentReviewCheckRun']['on']('reviewCheckResultActivated',(_0x51ff63,_0x14cfca)=>{this['_onReviewCheckResultActivated'](_0x14cfca);}),this['_currentReviewCheckRun']['on']('reviewCheckResultDeactivated',()=>{this['_onReviewCheckResultDeactivated']();});try{await this['_currentReviewCheckRun']['start']();}catch(_0x29b17d){_0x29b17d instanceof Error&&_0x29b17d['message']['includes']('ai-request-aborted')||(_0x29b17d instanceof at?this['_logError'](_0x29b17d):this['_logError'](new at('ai-review-mode-check-run-failed',this,void 0x0,_0x29b17d)));}}else this['_logError'](new at('ai-review-mode-source-check-not-found',this,{'checkId':_0x2c6fbe['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 _0x1b5523=this['_currentReviewCheckRun']['getActiveChanges']();if(!_0x1b5523['length'])return;this['_aiReviewCoreEditing']['applyChange'](_0x1b5523['map'](_0x4c4049=>_0x4c4049['id']));const _0x10a3ed=this['_currentReviewCheckRun'];_0x10a3ed['markAllChangesAsAccepted'](),_0x10a3ed['sendRating']();}),this['listenTo'](this['_aiReviewCoreUi'],'acceptChange',(_0x4d54f9,_0x4ae42e)=>{this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['isChangeActive'](_0x4ae42e['id'])&&(this['_aiReviewCoreEditing']['applyChange']([_0x4ae42e['id']]),this['_currentReviewCheckRun']['markChangeAsAccepted'](_0x4ae42e['id']),this['_aiReviewCoreUi']['hideChangeBalloon'](),this['_currentReviewCheckRun']['sendRating'](_0x4ae42e['id']));}),this['listenTo'](this['_aiReviewCoreUi'],'dismissChange',(_0x2bb4cc,_0x2039f6)=>{this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['isChangeActive'](_0x2039f6['id'])&&(this['_aiReviewCoreEditing']['rejectChange'](_0x2039f6['id']),this['_currentReviewCheckRun']['markChangeAsRejected'](_0x2039f6['id']),this['_aiReviewCoreUi']['hideChangeBalloon'](),this['_currentReviewCheckRun']['sendRating'](_0x2039f6['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',(_0x1afcda,_0x362585)=>{this['_onActivateChange'](_0x362585);}),this['listenTo'](this['_aiReviewCoreUi'],'deactivateChange',(_0x364d1c,_0x3a4e9f)=>{this['_onDeactivateChange'](_0x3a4e9f);}),this['listenTo'](this['_aiReviewCoreEditing']['emitter'],'changeMarkerClicked',(_0x3d7fb4,_0xe1e4a6)=>{this['_onChangeMarkerClicked'](_0x3d7fb4,_0xe1e4a6);}),this['listenTo'](this['_aiReviewCoreEditing']['emitter'],'changeMarkerHovered',(_0x2e1c03,_0x21ae36)=>{this['_onChangeMarkerHovered'](_0x2e1c03,_0x21ae36);}),this['listenTo'](this['_aiReviewCoreEditing']['emitter'],'changeMarkerBlurred',()=>{this['_onChangeMarkerBlurred']();}),this['listenTo'](this['_aiReviewCoreEditing']['emitter'],'changeMarkerRemoved',(_0x526071,_0x1650c1)=>{this['_onChangeMarkerRemoved'](_0x526071,_0x1650c1);}),this['listenTo'](this['_aiReviewCoreEditing']['emitter'],'changeMarkerRestored',(_0x3abf84,_0x4d4607)=>{this['_onChangeMarkerRestored'](_0x3abf84,_0x4d4607);});}['_createReviewCheckRun'](_0x28a716,_0x3ed048){return new Ra(this['_aiReviewCoreEditing']['getDocumentData'](),_0x3ed048,this['_aiConnector'],_0x28a716['params'],_0x28a716['args']);}['_onChangeMarkerRemoved'](_0x57a7c4,_0x2b32e5){this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['markChangeAsOutdated'](_0x2b32e5['changeId']);}['_onChangeMarkerRestored'](_0x12441a,_0xd22c4e){this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['markChangeAsPending'](_0xd22c4e['changeId']);}['_onCheckRunFinished'](){this['_aiReviewCoreUi']['showReviewCompletedView']();}['_initRequiredPlugins'](){this['_aiConnector']=this['context']['plugins']['get']('AIConnector');}['_onReviewRunLeave'](_0x4e1356=!0x1){this['_currentReviewCheckRun']&&(this['_currentReviewCheckRun']['hasModifications']||this['_currentReviewCheckRun']['sendRating'](),this['_currentReviewCheckRun']['stopListening'](),this['_currentReviewCheckRun']['abort'](),this['_currentReviewCheckRun']=void 0x0),_0x4e1356&&this['_aiReviewCoreUi']['showReviewCheckList'](),this['_aiReviewCoreEditing']['clearAllMarkers'](),this['_aiReviewCoreEditing']['switchToEdit'](),this['_changeActivationSource']=null;for(const _0x3afdda of this['_aiReviewCoreEditing']['getEditors']())_0x3afdda['editing']['view']['change'](_0x2cc52e=>{for(const _0x426c80 of _0x3afdda['editing']['view']['document']['getRoots']())_0x2cc52e['removeClass']('ck-ai_review-diff',_0x426c80),_0x2cc52e['removeClass']('ck-ai_review-highlights',_0x426c80),_0x2cc52e['removeClass']('ck-ai-translate-mode-content',_0x426c80);});}['_getTranslationWithDefault'](_0x1fdf8e,_0x624495){const _0x3bda7f=hs(this['context']['locale'],_0x1fdf8e);return _0x3bda7f===_0x1fdf8e?_0x624495:_0x3bda7f;}['_logError'](_0x3f895f,_0x286a27=!0x1){Et(_0x3f895f['message']),_0x286a27||(_0x3f895f['message']['startsWith']('ai-review-mode-models-unable-to-retrieve')?this['_aiReviewCoreUi']['showGeneralReviewCoreErrorView']():this['_aiReviewCoreUi']['showGeneralResultsErrorView']());}['_scrollToChange'](_0x300a8d){if('content'===this['_changeActivationSource']){const _0x4f775a=this['_aiReviewCoreUi']['getChangeElement'](_0x300a8d);_0x4f775a&&ft(_0x4f775a['closest']('.ck-ai_review__check-run-result')||_0x4f775a);}else{if('panel'===this['_changeActivationSource']){const _0x46c349=this['_getChangeContentElement'](_0x300a8d);if(!_0x46c349)return;Ct({'target':_0x46c349,'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(_0x584c81){this['id']=_0x584c81['id'],this['commandId']=_0x584c81['commandId'],this['title']=_0x584c81['title'],this['description']=_0x584c81['description'],this['isParameterized']=_0x584c81['isParameterized'],this['useArgs']=_0x584c81['useArgs'],this['options']=_0x584c81['options'],this['args']=_0x584c81['args'];}}class va extends ht(){['_checks']=[];['setupChecks'](_0x3c0f1b){this['_checks']=_0x3c0f1b['map'](_0x578ba8=>new Na(_0x578ba8));}get['checks'](){return this['_checks'];}['getCheckById'](_0x5757fc){return this['checks']['find'](_0x598eef=>_0x598eef['id']===_0x5757fc);}['removeCheckById'](_0x613353){this['_checks']=this['_checks']['filter'](_0x52b9e7=>_0x52b9e7['id']!==_0x613353);}}class ya extends Na{['_models']=[];['_defaultModel']=null;constructor(_0x3f0959,_0x355ead,_0x5da53e){super(_0x3f0959),this['_models']=_0x355ead,this['_defaultModel']=_0x5da53e;}get['models'](){return this['_models'];}get['defaultModel'](){return this['_defaultModel'];}}class xa extends Na{['isExtra']=!0x0;['prompt'];['model'];['_defaultModel']=null;constructor(_0x21a056,_0x5d577c,_0x4205fe){super(_0x21a056),this['prompt']=_0x21a056['prompt'],this['model']=_0x21a056['model'],this['model']?this['_defaultModel']=_0x5d577c['find'](_0x1a5bef=>_0x1a5bef['id']===this['model'])||null:this['_defaultModel']=_0x4205fe;}get['defaultModel'](){return this['_defaultModel'];}}class La extends va{['_allModels']=[];['_recommendedModels']=[];['_defaultModel']=null;constructor(_0x3d13f0,_0x561325,_0x205395){super(),this['_allModels']=_0x3d13f0,this['_recommendedModels']=_0x561325,this['_defaultModel']=_0x205395;}['setupChecks'](_0x489be5){this['_checks']=_0x489be5['map'](_0x1bac03=>!0x0===_0x1bac03['isExtra']?new xa(_0x1bac03,this['_allModels'],this['_defaultModel']):'custom'===_0x1bac03['id']?new ya(_0x1bac03,this['_recommendedModels'],this['_defaultModel']):new Na(_0x1bac03));}}class Da extends Sa{['_prompt'];['_model'];constructor(_0x1edb53,_0x508014,_0x29797b,_0x29c06f,_0x3014ef){super(_0x29797b,_0x29c06f,_0x3014ef),this['_prompt']=_0x1edb53,this['_model']=_0x508014;}get['subTitle'](){return this['_prompt'];}['_createApiRequest'](){return this['_aiConnector']['callCustomReview']({'content':this['_documentData']['content'],'prompt':this['_prompt'],'model':this['_model']});}['_sendRatingRequest'](_0xd7b1c4,_0x4b41d8,_0x57912d){return this['_aiConnector']['upsertCustomAIReviewRating'](_0x4b41d8,_0xd7b1c4,_0x57912d);}}class Pa extends Da{get['subTitle'](){return'';}set['prompt'](_0x2cb9e5){this['_prompt']=_0x2cb9e5;}set['model'](_0x55aa52){this['_model']=_0x55aa52;}}class Ha extends Oa{static get['pluginName'](){return'AIReviewModeController';}['_isDiffOn']=!0x1;['_hasDefaultAvailableCommands']=!0x1;constructor(_0x3d19d8){super(_0x3d19d8),this['_hasDefaultAvailableCommands']=!this['context']['config']['get']('ai.review.availableCommands'),this['context']['config']['define']('ai.review.availableCommands',ka['map'](_0x31ffff=>_0x31ffff['id'])),this['context']['config']['define']('ai.review.extraCommands',[]);}async['init'](){await super['init'](),this['listenTo'](this['_aiReviewCoreUi'],'toggleDiff',(_0x1e4a24,_0x1de0a5)=>{this['_isDiffOn']=_0x1de0a5['on'],this['_onDiffChange'](this['_isDiffOn']);});}['_initRequiredPlugins'](){super['_initRequiredPlugins'](),this['_aiReviewCoreUi']=this['context']['plugins']['get']('AIReviewModeUI'),this['_aiReviewCoreEditing']=this['context']['plugins']['get']('AIReviewCoreEditing');}['_createReviewCheckRun'](_0x4725aa,_0x44f2e2){return _0x4725aa['isCustom']?new Da(_0x4725aa['args']['prompt'],_0x4725aa['args']['model'],this['_aiReviewCoreEditing']['getDocumentData'](),_0x44f2e2,this['_aiConnector']):_0x44f2e2['isExtra']?new Pa(_0x44f2e2['prompt'],_0x44f2e2['defaultModel']['id'],this['_aiReviewCoreEditing']['getDocumentData'](),_0x44f2e2,this['_aiConnector']):new Ra(this['_aiReviewCoreEditing']['getDocumentData'](),_0x44f2e2,this['_aiConnector'],_0x4725aa['params'],_0x4725aa['args']);}['_onReviewCheckResultActivated'](_0xe86520){this['_aiReviewCoreUi']['setActiveStateInResults'](_0xe86520['change']['id']),this['_scrollToChange'](_0xe86520['change']['id']);const _0x2b9c15=this['_aiReviewCoreEditing']['getMarkerElementForChange'](_0xe86520['change']['id']);if(!_0x2b9c15)return;const _0x19d990=this['_aiReviewCoreEditing']['getEditorForChange'](_0xe86520['change']['id'])??this['_aiReviewCoreEditing']['getEditor']();this['_aiReviewCoreUi']['showChangeBalloon'](_0xe86520['change'],()=>_0x2b9c15['getElement'](),void 0x0,'click',this['_getBalloonDomRoot'](_0x19d990,_0x2b9c15['modelRange']['root']['rootName']),_0x19d990?.['ui']?.['viewportOffset']),this['_aiReviewCoreEditing']['setMarkersInElementAsActive'](_0xe86520['change']['id']);}['_onReviewCheckResultDeactivated'](){this['_aiReviewCoreUi']['resetActiveStateInResults'](),this['_aiReviewCoreUi']['hideChangeBalloon'](),this['_aiReviewCoreEditing']['setAllMarkersAsInactive']();}['_onActivateChange'](_0x48566e){this['_currentReviewCheckRun']&&'click'===_0x48566e['uiInteraction']&&(this['_changeActivationSource']='panel',this['_currentReviewCheckRun']['activateChange'](_0x48566e['id']));}['_onDeactivateChange'](_0xe38b65){this['_currentReviewCheckRun']&&'balloon'===_0xe38b65['origin']&&this['_currentReviewCheckRun']['deactivateChange']();}['_onChangeMarkerClicked'](_0x51de01,_0x27edfc){if(!this['_currentReviewCheckRun'])return;this['_changeActivationSource']='content',this['_currentReviewCheckRun']['activateChange'](_0x27edfc['changeId']);const _0x6c20e4=this['_currentReviewCheckRun']['getChangeById'](_0x27edfc['changeId']);if(!_0x6c20e4)return;const _0x5b5119=this['_aiReviewCoreEditing']['getMarkerElementForChange'](_0x27edfc['changeId']),_0xefe4ad=this['_aiReviewCoreEditing']['getEditorForChange'](_0x27edfc['changeId'])??this['_aiReviewCoreEditing']['getEditor']();this['_aiReviewCoreUi']['showChangeBalloon'](_0x6c20e4,_0x27edfc['markerElement'],_0x27edfc['domEvent'],'click',this['_getBalloonDomRoot'](_0xefe4ad,_0x5b5119?.['modelRange']['root']['rootName']),_0xefe4ad?.['ui']?.['viewportOffset']);}['_onChangeMarkerHovered'](_0x487803,_0x4fd4cf){if(!this['_currentReviewCheckRun'])return;if(this['_currentReviewCheckRun']['isAnyChangeActivated']())return;const _0x5439b0=this['_currentReviewCheckRun']['getChangeById'](_0x4fd4cf['changeId']);if(!_0x5439b0)return;const _0x48e513=this['_aiReviewCoreEditing']['getMarkerElementForChange'](_0x4fd4cf['changeId']),_0x266825=this['_aiReviewCoreEditing']['getEditorForChange'](_0x4fd4cf['changeId'])??this['_aiReviewCoreEditing']['getEditor']();this['_aiReviewCoreUi']['showChangeBalloon'](_0x5439b0,_0x4fd4cf['markerElement'],_0x4fd4cf['domEvent'],'hover',this['_getBalloonDomRoot'](_0x266825,_0x48e513?.['modelRange']['root']['rootName']),_0x266825?.['ui']?.['viewportOffset']);}['_onChangeMarkerBlurred'](){if(!this['_currentReviewCheckRun'])return;this['_currentReviewCheckRun']['isAnyChangeActivated']()||this['_aiReviewCoreUi']['hideChangeBalloon']();}['_getChangeContentElement'](_0x387631){const _0x58b6d8=this['_aiReviewCoreEditing']['getMarkerElementForChange'](_0x387631);return _0x58b6d8?_0x58b6d8['getElement']():null;}['_markChangePositionInEditorContent'](_0x3c6dc6,_0x15feaa){this['_aiReviewCoreEditing']['markChangePositionInEditorContent'](_0x3c6dc6,_0x15feaa);}['_diffContent'](_0xfa62c,_0x5b620b,_0x68f4c7){return this['_aiReviewCoreEditing']['diffContent'](_0xfa62c,_0x5b620b,_0x68f4c7,!0x1);}['_onReviewCheckRun'](){this['_onDiffChange'](this['_isDiffOn']);}['_onDiffChange'](_0x29e547){_0x29e547?this['_aiReviewCoreUi']['hideDiffInBalloon']():this['_aiReviewCoreUi']['showDiffInBalloon']();for(const _0xe79d64 of this['_aiReviewCoreEditing']['getEditors']())_0xe79d64['editing']['view']['change'](_0x819493=>{for(const _0x865548 of _0xe79d64['editing']['view']['document']['getRoots']()){for(const _0x5dec09 of _0x865548['getClassNames']())_0x5dec09['startsWith']('ck-ai_review-')&&_0x819493['removeClass'](_0x5dec09,_0x865548);_0x819493['addClass'](_0x29e547?'ck-ai_review-diff':'ck-ai_review-highlights',_0x865548);}});}['_getBalloonDomRoot'](_0x1ef49c,_0x231612){const _0x187174=_0x1ef49c['editing']['view'];if(_0x231612){const _0x611caf=_0x187174['getDomRoot'](_0x231612);if(_0x611caf)return _0x611caf;}return _0x187174['getDomRoot']()??void 0x0;}async['_getChecksList'](){const _0x4c997c=[...ka,...this['_getExtraChecks']()],_0x476b2c=this['context']['config']['get']('ai.review.availableCommands')||[];this['_logErrorForNonExistentChecks'](_0x476b2c,_0x4c997c);let _0x3ca318=_0x4c997c;this['_hasDefaultAvailableCommands']||(_0x3ca318=_0x476b2c['map'](_0x74e75e=>_0x4c997c['find'](_0xeaa13c=>_0xeaa13c['id']===_0x74e75e))['filter'](_0x4d1758=>!!_0x4d1758)),_0x3ca318=_0x3ca318['map'](_0x3123d9=>_0x3123d9['isExtra']?_0x3123d9:this['_translateReviewCheck'](_0x3123d9));const _0x157c7c=_0x3ca318['some'](_0x171382=>_0x171382['isExtra']||'custom'===_0x171382['id']);let _0x17e243=[],_0x2d791b=[],_0x57744f=null;if(_0x157c7c){const _0x2c1cd2=await this['_getModels']();_0x17e243=_0x2c1cd2['all'],_0x2d791b=_0x2c1cd2['recommended'],_0x57744f=_0x2c1cd2['default'];}const _0x206b92=new La(_0x17e243,_0x2d791b,_0x57744f);return _0x206b92['setupChecks'](_0x3ca318),_0x157c7c&&this['_filterChecksWithMissingModel'](_0x206b92),_0x206b92;}['_getExtraChecks'](){return(this['context']['config']['get']('ai.review.extraCommands')||[])['map'](_0x446821=>({'id':_0x446821['id'],'commandId':_0x446821['id'],'title':_0x446821['label'],'description':_0x446821['description'],'isParameterized':!0x1,'isExtra':!0x0,'prompt':_0x446821['prompt'],'model':_0x446821['model']}));}['_logErrorForNonExistentChecks'](_0x526f19,_0x4a1b31){const _0x40d0f9=_0x526f19['filter'](_0x34078c=>!_0x4a1b31['some'](_0x102259=>_0x102259['id']===_0x34078c));_0x40d0f9['length']&&this['_logError'](new at('ai-review-mode-non-existent-commands-used',this,{'commandIds':_0x40d0f9['join'](',\x20')}),!0x0);}async['_getModels'](){try{const _0x37df5d=new Fs({'connector':this['_aiConnector'],'config':this['context']['config']['get']('ai.models'),'locale':this['context']['locale']});return{'all':await _0x37df5d['getAll'](),'recommended':await _0x37df5d['getAvailableModels'](),'default':await _0x37df5d['getDefault']()};}catch(_0x4525ac){return this['_logError'](new at('ai-review-mode-models-unable-to-retrieve',this,void 0x0,_0x4525ac)),{'all':[],'recommended':[],'default':null};}}['_translateReviewCheck'](_0x36cadc){const _0x38de7d='AI_REVIEW_CHECK_'+_0x36cadc['id']['toUpperCase']()['replaceAll']('-','_'),_0x294874={..._0x36cadc,'title':this['_getTranslationWithDefault'](_0x38de7d+'_TITLE',_0x36cadc['title']),'description':this['_getTranslationWithDefault'](_0x38de7d+'_DESCRIPTION',_0x36cadc['description'])};return _0x36cadc['options']&&(_0x294874['options']=_0x36cadc['options']['map'](_0x5de5fa=>({..._0x5de5fa,'label':this['_getTranslationWithDefault'](_0x38de7d+'_OPTIONS_LABEL',_0x5de5fa['label']||''),'data':_0x5de5fa['data']?_0x5de5fa['data']['map'](_0x416ddc=>({..._0x416ddc,'label':this['_getTranslationWithDefault'](_0x38de7d+'_OPTIONS_DATA_'+_0x416ddc['id']['toUpperCase'](),_0x416ddc['label'])})):void 0x0}))),_0x294874;}['_filterChecksWithMissingModel'](_0x22dc3a){const _0x2f4473=[];_0x22dc3a['checks']['forEach'](_0x415e77=>{(_0x415e77 instanceof xa&&!_0x415e77['defaultModel']||_0x415e77 instanceof ya&&!_0x415e77['models']['length'])&&_0x2f4473['push'](_0x415e77['id']);}),_0x2f4473['length']&&_0x2f4473['forEach'](_0x2507a8=>{_0x22dc3a['removeCheckById'](_0x2507a8),this['_logError'](new at('ai-review-mode-command-unavailable-due-to-missing-model',this,{'commandId':_0x2507a8}),!0x0);});}}class Ma extends _0x490ade{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'](_0x1c5537){this['_checks']=_0x1c5537['map'](_0x546dbb=>new Ua(_0x546dbb));}}class Ba extends Ra{['_title'];constructor(_0x4cd9e1,_0x471c4d,_0x53c9c3,_0x2faf51,_0x3f72a2,_0xe5e114){super(_0x4cd9e1,_0x471c4d,_0x53c9c3,_0x3f72a2,_0xe5e114),this['_title']=_0x2faf51;}get['title'](){return this['_title'];}get['subTitle'](){return this['_sourceCheck']['title'];}}class Ga extends Oa{static get['pluginName'](){return'AITranslateController';}constructor(_0x3fb712){super(_0x3fb712),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'](_0x2d1b3e,_0x1e8f5c){return new Ba(this['_aiReviewCoreEditing']['getDocumentData'](),_0x1e8f5c,this['_aiConnector'],hs(this['context']['locale'],'AI_REVIEW_CHECK_TRANSLATE_TITLE'),_0x2d1b3e['params'],_0x2d1b3e['args']);}['_onReviewCheckResultActivated'](_0x169bb7){this['_aiReviewCoreUi']['setActiveStateInResults'](_0x169bb7['change']['id']),this['_aiReviewCoreEditing']['setMarkersInElementAsActive'](_0x169bb7['change']['id']);}['_onReviewCheckResultDeactivated'](){this['_aiReviewCoreEditing']['setAllMarkersAsInactive'](),this['_aiReviewCoreUi']['resetActiveStateInResults']();}['_onActivateChange'](_0x4c8b10){this['_currentReviewCheckRun']&&('hover'===_0x4c8b10['uiInteraction']&&(this['_changeActivationSource']='panel',this['_currentReviewCheckRun']['activateChange'](_0x4c8b10['id'])),'click'===_0x4c8b10['uiInteraction']&&this['_scrollToChange'](_0x4c8b10['id']));}['_onDeactivateChange'](_0x1804f1){this['_currentReviewCheckRun']&&'panel'===_0x1804f1['origin']&&this['_currentReviewCheckRun']['deactivateChange']();}['_onChangeMarkerClicked'](_0x305baf,_0x51d93a){this['_currentReviewCheckRun']&&(this['_changeActivationSource']='content',this['_currentReviewCheckRun']['activateChange'](_0x51d93a['changeId']),this['_scrollToChange'](_0x51d93a['changeId']));}['_onChangeMarkerHovered'](_0x56585f,_0x471429){this['_currentReviewCheckRun']&&(this['_changeActivationSource']='content',this['_currentReviewCheckRun']['activateChange'](_0x471429['changeId']),this['_aiReviewCoreEditing']['reactivateMarkers'](_0x471429['changeId']));}['_onChangeMarkerBlurred'](){this['_currentReviewCheckRun']&&'content'===this['_changeActivationSource']&&(this['_currentReviewCheckRun']['deactivateChange'](),this['_aiReviewCoreEditing']['setAllMarkersAsInactive']());}['_getChangeContentElement'](_0x2bc619){return this['_aiReviewCoreEditing']['getContentElementForChange'](_0x2bc619);}['_markChangePositionInEditorContent'](_0x31b51e,_0x25ee02){this['_aiReviewCoreEditing']['markChangePositionInEditorContent'](_0x31b51e,_0x25ee02);}['_diffContent'](_0x3471e4,_0x340280,_0xd0624){return this['_aiReviewCoreEditing']['diffContent'](_0x3471e4,_0x340280,_0xd0624,!0x0);}['_onReviewCheckRun'](){for(const _0x470da5 of this['_aiReviewCoreEditing']['getEditors']())_0x470da5['editing']['view']['change'](_0x2b31d1=>{for(const _0x5da5ab of _0x470da5['editing']['view']['document']['getRoots']())_0x2b31d1['addClass']('ck-ai-translate-mode-content',_0x5da5ab);});}async['_getChecksList'](){const _0x1f9cf4=[],_0x257abf=this['context']['config']['get']('ai.translate.languages')||[];for(const _0x5e778f of _0x257abf)_0x1f9cf4['push']({'title':_0x5e778f['label'],'id':_0x5e778f['id'],'commandId':_0x5e778f['id'],'description':'','isParameterized':!0x1,'useArgs':!0x0,'args':{'language':_0x5e778f['id']}});const _0x1e1bd5=new Va();return _0x1e1bd5['setupChecks'](this['_translateChecks'](_0x1f9cf4)),_0x1e1bd5;}['_translateChecks'](_0x25c4ec){return _0x25c4ec['map'](_0x1b95d9=>{const _0x33f9cd='AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_'+_0x1b95d9['title']['toUpperCase']()['replaceAll']('-','_');return{..._0x1b95d9,'title':this['_getTranslationWithDefault'](_0x33f9cd,_0x1b95d9['title'])};});}}class Fa extends ca{constructor(_0x1508df,_0xc6009d){super(_0x1508df,_0xc6009d),this['on']('set:isLoading',(_0x2fda7e,_0x5f3377,_0x347750)=>{_0x347750&&(this['headerTitle']=hs(this['locale'],'AI_TRANSLATE_CHECK_RESULTS_LOADING_TITLE'));}),this['on']('set:isResultReady',(_0x1a1d4e,_0x555257,_0x56dff9)=>{_0x56dff9&&(this['headerTitle']=hs(this['locale'],'AI_TRANSLATE_CHECK_RESULTS_READY_TITLE'));});}['_createAcceptAllButtonView'](){const _0x567a5c=super['_createAcceptAllButtonView']();return _0x567a5c['set']('label',hs(this['locale'],'AI_TRANSLATE_ACCEPT_ALL')),_0x567a5c;}['_createExitReviewButtonView'](){const _0x231c40=super['_createExitReviewButtonView']();return _0x231c40['set']('label',hs(this['locale'],'AI_CHAT_HISTORY_CANCEL')),_0x231c40;}}class Ka extends pa{['_setupTemplate'](){const _0x546252=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-translate__check-list-wrapper',_0x546252['if']('isVisible','ck-hidden',_0x4fc572=>!_0x4fc572)]},'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',_0x546252['if']('isVisible','ck-hidden',_0x3f9b3f=>!_0x3f9b3f)]},'children':this['_checkViews']}]});}}class Wa extends ra{static get['pluginName'](){return'AITranslateUI';}['createMainView'](){const _0x27734e=this['context']['plugins']['get']('AITabs'),_0x1f0f94=this['context']['locale'],_0x3714f3=new eo(_0x1f0f94,{'label':hs(_0x1f0f94,'AI_REVIEW_CHECK_TRANSLATE_TITLE'),'icon':_0x503fac,'class':'ck-ai-header_review-translate','showResizeButton':_0x27734e['showResizeButton']});_0x3714f3['delegate']('resizeTabs')['to'](_0x27734e),_0x3714f3['bind']('isMaximized')['to'](_0x27734e['view'],'isMaximized',_0x1744eb=>_0x1744eb);const _0x1f176e=new aa(_0x1f0f94,{'header':_0x3714f3,'list':new Ka(_0x1f0f94),'results':new Fa(_0x1f0f94,{'generalErrorText':hs(_0x1f0f94,'AI_TRANSLATE_GENERAL_ERROR_MESSAGE')}),'completed':new la(_0x1f0f94,{'headerText':hs(_0x1f0f94,'AI_TRANSLATE_FINISH_HEADER_TITLE'),'emptyResultsText':hs(_0x1f0f94,'AI_TRANSLATE_EMPTY_RESULTS_TEXT'),'buttonText':hs(_0x1f0f94,'AI_TRANSLATE_FINISH_BUTTON_LABEL')})});return _0x1f176e['extendTemplate']({'attributes':{'class':'ck-ai-translate-mode'}}),_0x1f176e;}['registerTab'](){const _0x396fff=this['context']['plugins']['get']('AITabs');_0x396fff['view']['on']('activateTab',(_0x18237c,{newTab:_0x3db416,oldTab:_0x52003f})=>{'translate'===_0x3db416?this['fire']('getReviewCheckList'):'translate'===_0x52003f&&this['fire']('leaveReview');}),_0x396fff['view']['addTab']({'id':'translate','buttonLabel':hs(this['context']['locale'],'AI_REVIEW_CHECK_TRANSLATE_TITLE'),'buttonIcon':_0x503fac,'order':0x0,'content':this['_mainView']});}}class Ya extends _0x490ade{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};
|