@ckeditor/ckeditor5-ai 48.1.0 → 48.8.1-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- 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 _0x5e248a,Command as _0x131d8d,ContextPlugin as _0x173dbd,Editor as _0x2ef8df}from'@ckeditor/ckeditor5-core/dist/index.js';import{IconCopy as _0x47d488,IconCheck as _0x406d61,IconError as _0x5348f5,IconSubmit as _0x1f67f2,IconAIHistory as _0x592da0,IconMagicWand as _0x3a64fb,IconRobotPencil as _0x31dd3a,IconMaximize as _0x4aa4b0,IconMinimize as _0x3fafdd,IconShowChangesOn as _0x577354,IconShowChangesOff as _0x1ebf6f,IconDocument as _0x3e528c,IconBoxWithCross as _0x17ed4e,IconBoxWithCheck as _0x3b5a26,IconBoxWithMarker as _0x227ff0,IconInfo as _0x138750,IconWeb as _0xfff9b0,IconCancel as _0x35e3e9,IconSelection as _0xa1a1f9,IconFileUpload as _0xc51032,IconLink as _0xe5297c,IconBulb as _0x3d54c0,IconAI as _0x4a7bec,IconPreviousArrow as _0xba82e9,IconDocumentOutline as _0xfc4b68,IconLoupe as _0x262e2c,IconPaperClip as _0x5e24ae,IconBrowseFiles as _0x14e330,IconDropdownArrow as _0x108533,IconStop as _0x327a50,IconPlus as _0x38e4f9,IconAIChat as _0xd19f1f,IconPin as _0x54fbb0,IconThreeHorizontalDots as _0xb6454c,IconAIReview as _0x4a5506,IconAITranslate as _0x199a24,IconAIAskAI as _0x45afa0,IconThumbUp as _0x46c214,IconThumbDown as _0x2c1fe4,IconChevronDown as _0x361d40,IconChevronUp as _0x39b878,IconAIQuickActions as _0x272647,IconAIChatCommands as _0xfcf3e5,IconAIImproveWriting as _0x288b1b,IconAIContinueWriting as _0xc7e597,IconAIGrammarCheck as _0x49a57c,IconAIAdjustLength as _0x22bd65,IconAIChangeTone as _0xda723e,IconAIOther as _0x2735be,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 _0x1a6109,FormHeaderView as _0xb76395,HighlightedTextView as _0x56ea6b,ViewCollection as _0x23af51,FileDialogButtonView as _0x2dc43e,InputTextView as _0x5fd969,SearchTextView as _0x5bd8a7,ListItemButtonView as _0x4eb138,ButtonLabelWithHighlightView as _0x3a2569,DropdownMenuPanelPositioningFunctions as _0x23c38f,BalloonToolbar as _0x22ceab,FormRowView as _0xc57744,TextareaView as _0x4e411f}from'@ckeditor/ckeditor5-ui/dist/index.js';import{ClipboardPipeline as _0x393629,ClipboardMarkersUtils as _0x1cb775}from'@ckeditor/ckeditor5-clipboard/dist/index.js';import{ViewDocumentDomEventData as _0x5d1575,ViewDataTransfer as _0x4329ca,ViewUpcastWriter as _0x48cb1f,Matcher as _0x3bcca8,_DetachOperation as _0x48a283,_insertIntoModelNodeList as _0x3f2c26,_removeFromModelNodeList as _0x1d04c0,ModelRange as _0x5ca4e8,transformOperationSets as _0x261504,ViewDowncastWriter as _0x27a0d8,ModelDocumentFragment as _0x569183,ModelPosition as _0x1e668d,ModelTreeWalker as _0x342db9,MarkerOperation as _0x437745,InsertOperation as _0x2038eb}from'@ckeditor/ckeditor5-engine/dist/index.js';import{unescape as _0x1cfbb0,escape as _0x5aed4a,cloneDeep as _0x2d7474,throttle as _0x42e740,debounce as _0x12ff54,escapeRegExp as _0x5607f9}from'es-toolkit/compat';import{createParser as _0x3e40e3}from'eventsource-parser';import{CloudServices as _0x47c197}from'@ckeditor/ckeditor5-cloud-services/dist/index.js';import{parseDocument as _0xabe431}from'htmlparser2';import{isTag as _0x1d6ab8,findOne as _0x4f11c1,getParent as _0xb9dbd4,findAll as _0x49c4b8,removeElement as _0x5d78f4,prepend as _0x27ae1b,prependChild as _0x288fde,appendChild as _0x27626e,append as _0x188752,find as _0x56818a,isComment as _0x31c97d,replaceElement as _0x292e22,getChildren as _0x45c663,textContent as _0x1ea558}from'domutils';import ti from'dom-serializer';import{Document as _0x290fcd,Element as _0x244f1b,Text as _0x592fb4,cloneNode as _0x2cb1ed,isDocument as _0x984065,isText as _0x391745,NodeWithChildren as _0x5218f8}from'domhandler';import{MarkdownGfmMdToHtmlDefaultPlugins as _0x58a02a,MarkdownGfmMdToHtml as _0x53347b}from'@ckeditor/ckeditor5-markdown-gfm/dist/index.js';import _0xfb07ec from'rehype-sanitize';import{fixElementSuggestionRange as _0x2443fd,DocumentCompare as _0x47efd0,DATA_ID_MODEL_ATTRIBUTE as _0x138817,ConfirmMixin as _0x16b97f,getAllMarkersDomElementsSorted as _0x4f33d6,SuggestionsConversion as _0x407819,DATA_ID_VIEW_ATTRIBUTE as _0x6099dd,getMarkerDomElement as _0x3ebf06}from'@ckeditor/ckeditor5-collaboration-core/dist/index.js';import _0x509ce5 from'morphdom';import{diffArrays as _0x87a05f}from'diff';const Ci='_ungrouppedCommands';function wi(_0xf5834e,_0x4fe097){const _0x3784e0=(0x0,_0x4fe097['t'])('Other');return _0xf5834e['length']?'groupId'in _0xf5834e[0x0]?_0xf5834e:[{'groupId':Ci,'groupLabel':_0x3784e0,'order':0x1/0x0,'commands':_0xf5834e}]:[{'groupId':Ci,'groupLabel':_0x3784e0,'order':0x1/0x0,'commands':[]}];}const fi=globalThis['DataTransfer'],bi='ai-ui';class Si extends _0x5e248a{static get['pluginName'](){return'AIAssistantEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const {editor:_0x4dbb73}=this,_0x305adf=['ck-fake-ai-selection'];_0x4dbb73['config']['get']('ai.assistant.useTheme')&&_0x305adf['push']('ck-ai-assistant-ui_theme'),_0x4dbb73['conversion']['for']('editingDowncast')['markerToHighlight']({'model':bi,'view':{'classes':_0x305adf,'priority':0xc}}),_0x4dbb73['conversion']['for']('editingDowncast')['markerToElement']({'model':bi,'view':(_0x4bd8dc,{writer:_0x468e64})=>{if(!_0x4bd8dc['markerRange']['isCollapsed'])return null;const _0x20489f=_0x468e64['createUIElement']('span');return _0x468e64['addClass'](['ck-fake-ai-selection','ck-fake-ai-selection_collapsed'],_0x20489f),_0x20489f;}});}['afterInit'](){!async function(_0x1684d3){const _0x224852=_0x26aed1([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]),_0x4f92e1=0x3dffc4e1,_0x316419=0x3df84d11^_0x4f92e1,_0x4c637c=window[_0x26aed1([0x44,0x61,0x74,0x65])][_0x26aed1([0x6e,0x6f,0x77])](),_0x49e15b=_0x1684d3[_0x26aed1([0x65,0x64,0x69,0x74,0x6f,0x72])],_0x5761dc=new window[(_0x26aed1([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x2b1117=>{_0x49e15b[_0x26aed1([0x6f,0x6e,0x63,0x65])](_0x26aed1([0x72,0x65,0x61,0x64,0x79]),_0x2b1117);}),_0x5c8336={[_0x26aed1([0x6b,0x74,0x79])]:_0x26aed1([0x45,0x43]),[_0x26aed1([0x75,0x73,0x65])]:_0x26aed1([0x73,0x69,0x67]),[_0x26aed1([0x63,0x72,0x76])]:_0x26aed1([0x50,0x2d,0x32,0x35,0x36]),[_0x26aed1([0x78])]:_0x26aed1([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]),[_0x26aed1([0x79])]:_0x26aed1([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]),[_0x26aed1([0x61,0x6c,0x67])]:_0x26aed1([0x45,0x53,0x32,0x35,0x36])},_0x2857b8=_0x49e15b[_0x26aed1([0x63,0x6f,0x6e,0x66,0x69,0x67])][_0x26aed1([0x67,0x65,0x74])](_0x26aed1([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79]));async function _0x545f99(){let _0x27a7af,_0x3e355d=null,_0x2c1d89=null;try{if(_0x2857b8==_0x26aed1([0x47,0x50,0x4c]))return _0x26aed1([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]);if(_0x27a7af=_0x2b0fe4(),!_0x27a7af)return _0x26aed1([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);return _0x27a7af[_0x26aed1([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])]&&(_0x2c1d89=_0x22fdeb(_0x27a7af[_0x26aed1([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])],_0x27a7af[_0x26aed1([0x6a,0x74,0x69])])),await _0x54124a()?_0x2f85e2()?_0x467d92()?_0x26aed1([0x45,0x78,0x70,0x69,0x72,0x65,0x64]):_0x4168bd()?(_0x27a7af[_0x26aed1([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])]==_0x26aed1([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e])&&(_0x3e355d=_0x49c4cc(_0x26aed1([0x45,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e,0x4c,0x69,0x6d,0x69,0x74]))),await _0x589414()):_0x26aed1([0x44,0x6f,0x6d,0x61,0x69,0x6e,0x4c,0x69,0x6d,0x69,0x74]):_0x26aed1([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]):_0x26aed1([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}catch{return _0x26aed1([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}function _0x467d92(){const _0x3114e8=[_0x26aed1([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e]),_0x26aed1([0x74,0x72,0x69,0x61,0x6c])][_0x26aed1([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x27a7af[_0x26aed1([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])])?_0x4c637c/0x3e8:0xe10*_0x316419;return _0x27a7af[_0x26aed1([0x65,0x78,0x70])]<_0x3114e8;}function _0x2f85e2(){const _0x50d8ed=_0x27a7af[_0x26aed1([0x66,0x65,0x61,0x74,0x75,0x72,0x65,0x73])];return!!_0x50d8ed&&(!!_0x50d8ed[_0x26aed1([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x26aed1([0x2a]))||!!_0x50d8ed[_0x26aed1([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x26aed1([0x41,0x49])));}function _0x4168bd(){const _0x5c27bc=_0x27a7af[_0x26aed1([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x64,0x48,0x6f,0x73,0x74,0x73])];if(!_0x5c27bc||0x0==_0x5c27bc[_0x26aed1([0x6c,0x65,0x6e,0x67,0x74,0x68])])return!0x0;const {hostname:_0x41bc1f}=new URL(window[_0x26aed1([0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e])]['href']);if(_0x5c27bc[_0x26aed1([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x41bc1f))return!0x0;const _0x491309=_0x41bc1f[_0x26aed1([0x73,0x70,0x6c,0x69,0x74])](_0x26aed1([0x2e]));return _0x5c27bc[_0x26aed1([0x66,0x69,0x6c,0x74,0x65,0x72])](_0x19d8b1=>_0x19d8b1[_0x26aed1([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x26aed1([0x2a])))[_0x26aed1([0x6d,0x61,0x70])](_0x270c50=>_0x270c50[_0x26aed1([0x73,0x70,0x6c,0x69,0x74])](_0x26aed1([0x2e])))[_0x26aed1([0x66,0x69,0x6c,0x74,0x65,0x72])](_0x35463f=>_0x35463f[_0x26aed1([0x6c,0x65,0x6e,0x67,0x74,0x68])]<=_0x491309[_0x26aed1([0x6c,0x65,0x6e,0x67,0x74,0x68])])[_0x26aed1([0x6d,0x61,0x70])](_0x472198=>Array(_0x491309[_0x26aed1([0x6c,0x65,0x6e,0x67,0x74,0x68])]-_0x472198[_0x26aed1([0x6c,0x65,0x6e,0x67,0x74,0x68])])[_0x26aed1([0x66,0x69,0x6c,0x6c])](_0x472198[0x0]===_0x26aed1([0x2a])?_0x26aed1([0x2a]):'')[_0x26aed1([0x63,0x6f,0x6e,0x63,0x61,0x74])](_0x472198))[_0x26aed1([0x73,0x6f,0x6d,0x65])](_0x2f45fb=>_0x491309[_0x26aed1([0x65,0x76,0x65,0x72,0x79])]((_0x3bf3a2,_0x454596)=>_0x2f45fb[_0x454596]===_0x3bf3a2||_0x2f45fb[_0x454596]===_0x26aed1([0x2a])));}function _0x589414(){return _0x3e355d&&_0x2c1d89?new window[(_0x26aed1([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0x554045,_0x31809a)=>{_0x3e355d[_0x26aed1([0x74,0x68,0x65,0x6e])](_0x554045,_0x31809a),_0x2c1d89[_0x26aed1([0x74,0x68,0x65,0x6e])](_0x4422dd=>{_0x4422dd!=_0x26aed1([0x56,0x61,0x6c,0x69,0x64])&&_0x554045(_0x4422dd);},_0x31809a);}):_0x3e355d||_0x2c1d89||_0x26aed1([0x56,0x61,0x6c,0x69,0x64]);}}function _0x22fdeb(_0x5ad54f,_0x36032c){return new window[(_0x26aed1([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x282f7a=>{if(_0x5b8941())return _0x282f7a(_0x26aed1([0x56,0x61,0x6c,0x69,0x64]));_0x49ae97(),_0x49e15b[_0x26aed1([0x64,0x65,0x63,0x6f,0x72,0x61,0x74,0x65])](_0x26aed1([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]));let _0x5d24aa=!0x1;const _0x2587e6=ot();function _0x3f9c52(_0x5a04b3){return!!_0x5a04b3&&(typeof _0x5a04b3===_0x26aed1([0x6f,0x62,0x6a,0x65,0x63,0x74])||typeof _0x5a04b3===_0x26aed1([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]))&&typeof _0x5a04b3[_0x26aed1([0x74,0x68,0x65,0x6e])]===_0x26aed1([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e])&&typeof _0x5a04b3[_0x26aed1([0x63,0x61,0x74,0x63,0x68])]===_0x26aed1([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]);}function _0x8f5e9a(_0xebeff8){_0x18e64f(_0xebeff8)[_0x26aed1([0x74,0x68,0x65,0x6e])](_0x592a83=>{if(!_0x592a83||_0x592a83[_0x26aed1([0x73,0x74,0x61,0x74,0x75,0x73])]!=_0x26aed1([0x6f,0x6b]))return _0x26aed1([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]);return _0x2b6ba2(_0x33090b(_0x2587e6+_0x36032c))!=_0x592a83[_0x26aed1([0x76,0x65,0x72,0x69,0x66,0x69,0x63,0x61,0x74,0x69,0x6f,0x6e])]?_0x26aed1([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]):_0x26aed1([0x56,0x61,0x6c,0x69,0x64]);})[_0x26aed1([0x74,0x68,0x65,0x6e])](_0x3c6b83=>(_0x86adbc(),_0x3c6b83),()=>{const _0x31cd26=_0x347386();return null==_0x31cd26?(_0x86adbc(),_0x26aed1([0x56,0x61,0x6c,0x69,0x64])):_0x26aed1(_0x4c637c-_0x31cd26>(0x19f340e1^_0x4f92e1)?[0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]:[0x56,0x61,0x6c,0x69,0x64]);})[_0x26aed1([0x74,0x68,0x65,0x6e])](_0x282f7a)[_0x26aed1([0x63,0x61,0x74,0x63,0x68])](()=>{_0x282f7a(_0x26aed1([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});const _0x122ee3=0x3dc92a61^_0x4f92e1;function _0x86adbc(){const _0x5065ce=_0x26aed1([0x6c,0x6c,0x63,0x74,0x2d])+_0x2b6ba2(_0x33090b(_0x5ad54f)),_0x3467a2=_0x216eee(_0x2b6ba2(window[_0x26aed1([0x4d,0x61,0x74,0x68])][_0x26aed1([0x63,0x65,0x69,0x6c])](_0x4c637c/_0x122ee3)));window[_0x26aed1([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0x26aed1([0x73,0x65,0x74,0x49,0x74,0x65,0x6d])](_0x5065ce,_0x3467a2);}function _0x347386(){const _0x3bed22=_0x26aed1([0x6c,0x6c,0x63,0x74,0x2d])+_0x2b6ba2(_0x33090b(_0x5ad54f)),_0x1556ad=window[_0x26aed1([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0x26aed1([0x67,0x65,0x74,0x49,0x74,0x65,0x6d])](_0x3bed22);return _0x1556ad?window[_0x26aed1([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x216eee(_0x1556ad),0x10)*_0x122ee3:null;}function _0x18e64f(_0x2134ab){return new window[(_0x26aed1([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0x35c021,_0x41837b)=>{_0x2134ab[_0x26aed1([0x74,0x68,0x65,0x6e])](_0x35c021,_0x41837b),window[_0x26aed1([0x73,0x65,0x74,0x54,0x69,0x6d,0x65,0x6f,0x75,0x74])](_0x41837b,0x3dfe1021^_0x4f92e1);});}}_0x49e15b[_0x26aed1([0x6f,0x6e])](_0x26aed1([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),(_0x53d669,_0x56cc80)=>{if(_0x56cc80[0x0]!=_0x5ad54f)return _0x282f7a(_0x26aed1([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));_0x56cc80[0x1]={..._0x56cc80[0x1],[_0x26aed1([0x72,0x65,0x71,0x75,0x65,0x73,0x74,0x49,0x64])]:_0x2587e6};},{[_0x26aed1([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0x26aed1([0x68,0x69,0x67,0x68])}),_0x49e15b[_0x26aed1([0x6f,0x6e])](_0x26aed1([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),_0x517379=>{_0x3f9c52(_0x517379[_0x26aed1([0x72,0x65,0x74,0x75,0x72,0x6e])])&&(_0x5d24aa=!0x0,_0x8f5e9a(_0x517379[_0x26aed1([0x72,0x65,0x74,0x75,0x72,0x6e])]));},{[_0x26aed1([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0x26aed1([0x6c,0x6f,0x77])}),_0x5761dc[_0x26aed1([0x74,0x68,0x65,0x6e])](()=>{_0x5d24aa||_0x282f7a(_0x26aed1([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});});function _0x5b8941(){return _0x49e15b[_0x26aed1([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0x26aed1([0x76,0x69,0x65,0x77])][_0x26aed1([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]==_0x26aed1([0x61,0x75,0x74,0x6f]);}function _0x49ae97(){_0x49e15b[_0x26aed1([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0x26aed1([0x76,0x69,0x65,0x77])][_0x26aed1([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]=_0x26aed1([0x61,0x75,0x74,0x6f]);}}function _0x49c4cc(_0x118bea){const _0x14e9ce=[new window[(_0x26aed1([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x1ae6da=>setTimeout(_0x1ae6da,0x3df6fa2d^_0x4f92e1)),_0x5761dc[_0x26aed1([0x74,0x68,0x65,0x6e])](()=>new window[(_0x26aed1([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x306aac=>{let _0x3976a3=0x0;_0x49e15b[_0x26aed1([0x6d,0x6f,0x64,0x65,0x6c])][_0x26aed1([0x6f,0x6e])](_0x26aed1([0x61,0x70,0x70,0x6c,0x79,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e]),(_0x39c987,_0x17a731)=>{_0x17a731[0x0][_0x26aed1([0x69,0x73,0x44,0x6f,0x63,0x75,0x6d,0x65,0x6e,0x74,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e])]&&_0x3976a3++,_0x3976a3==(0x3dffc109^_0x4f92e1)&&(_0x306aac(),_0x39c987[_0x26aed1([0x6f,0x66,0x66])]());});}))];return window[_0x26aed1([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65])][_0x26aed1([0x72,0x61,0x63,0x65])](_0x14e9ce)[_0x26aed1([0x74,0x68,0x65,0x6e])](()=>_0x118bea);}async function _0x22a074(){await _0x5761dc,_0x49e15b[_0x26aed1([0x6d,0x6f,0x64,0x65,0x6c])][_0x26aed1([0x63,0x68,0x61,0x6e,0x67,0x65])]=_0x26b6db,_0x49e15b[_0x26aed1([0x6d,0x6f,0x64,0x65,0x6c])][_0x26aed1([0x65,0x6e,0x71,0x75,0x65,0x75,0x65,0x43,0x68,0x61,0x6e,0x67,0x65])]=_0x26b6db,_0x49e15b[_0x26aed1([0x65,0x6e,0x61,0x62,0x6c,0x65,0x52,0x65,0x61,0x64,0x4f,0x6e,0x6c,0x79,0x4d,0x6f,0x64,0x65])](_0x26aed1([0x6d,0x6f,0x64,0x65,0x6c]));}function _0xc3a93b(_0x51a4f4){const _0x1c30e2=_0x102a28();_0x49e15b[_0x1c30e2]=_0x26aed1([0x61,0x69,0x4c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79])+_0x51a4f4,_0x51a4f4!=_0x26aed1([0x56,0x61,0x6c,0x69,0x64])&&_0x22a074();}function _0x102a28(){const _0x10f08f=window[_0x26aed1([0x53,0x74,0x72,0x69,0x6e,0x67])](window[_0x26aed1([0x70,0x65,0x72,0x66,0x6f,0x72,0x6d,0x61,0x6e,0x63,0x65])][_0x26aed1([0x6e,0x6f,0x77])]())[_0x26aed1([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](_0x26aed1([0x2e]),'');let _0x589e5a=_0x26aed1([0x6e]);for(let _0x16eff4=0x0;_0x16eff4<_0x10f08f[_0x26aed1([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0x16eff4+=0x2){let _0x12919a=window[_0x26aed1([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x10f08f[_0x26aed1([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0x16eff4,_0x16eff4+0x2));_0x12919a>=_0x224852[_0x26aed1([0x6c,0x65,0x6e,0x67,0x74,0x68])]&&(_0x12919a-=_0x224852[_0x26aed1([0x6c,0x65,0x6e,0x67,0x74,0x68])]),_0x589e5a+=_0x224852[_0x12919a];}return _0x589e5a;}function _0x2b0fe4(){const _0x23744a=_0x2857b8[_0x26aed1([0x73,0x70,0x6c,0x69,0x74])](_0x26aed1([0x2e]));if(0x3!=_0x23744a[_0x26aed1([0x6c,0x65,0x6e,0x67,0x74,0x68])])return null;return _0x1130cb(_0x23744a[0x1]);function _0x1130cb(_0x42a2cb){const _0x2e58d0=_0x32e440(_0x42a2cb);return _0x2e58d0&&_0x3d31f0()?_0x2e58d0:null;function _0x3d31f0(){const _0x5cded1=_0x2e58d0[_0x26aed1([0x6a,0x74,0x69])],_0x486194=window[_0x26aed1([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x5cded1[_0x26aed1([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0x5cded1[_0x26aed1([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8),0x10),_0x2cbe20={..._0x2e58d0,[_0x26aed1([0x6a,0x74,0x69])]:_0x5cded1[_0x26aed1([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](0x0,_0x5cded1[_0x26aed1([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8)};return delete _0x2cbe20[_0x26aed1([0x76,0x63])],_0x33090b(_0x2cbe20)==_0x486194;}}}async function _0x54124a(){let _0x73e6f3=!0x0;try{const _0xcebd4=_0x2857b8[_0x26aed1([0x73,0x70,0x6c,0x69,0x74])](_0x26aed1([0x2e])),[_0x5eae0b,_0x29d2d7,_0x35c645]=_0xcebd4;return _0xe3aecc(_0x5eae0b),await _0x4ce799(_0x5eae0b,_0x29d2d7,_0x35c645),_0x73e6f3;}catch{return!0x1;}function _0xe3aecc(_0x457407){const _0xc7f0da=_0x32e440(_0x457407);_0xc7f0da&&_0xc7f0da[_0x26aed1([0x61,0x6c,0x67])]==_0x26aed1([0x45,0x53,0x32,0x35,0x36])||(_0x73e6f3=!0x1);}async function _0x4ce799(_0x3504a5,_0x19050f,_0x10c70a){const _0x455a77=window[_0x26aed1([0x55,0x69,0x6e,0x74,0x38,0x41,0x72,0x72,0x61,0x79])][_0x26aed1([0x66,0x72,0x6f,0x6d])](_0x98ca4a(_0x10c70a),_0x10e504=>_0x10e504[_0x26aed1([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](0x0)),_0x529edb=new window[(_0x26aed1([0x54,0x65,0x78,0x74,0x45,0x6e,0x63,0x6f,0x64,0x65,0x72]))]()[_0x26aed1([0x65,0x6e,0x63,0x6f,0x64,0x65])](_0x3504a5+_0x26aed1([0x2e])+_0x19050f),_0x1a69f8=window[_0x26aed1([0x63,0x72,0x79,0x70,0x74,0x6f])][_0x26aed1([0x73,0x75,0x62,0x74,0x6c,0x65])];if(!_0x1a69f8)return;const _0x20f373=await _0x1a69f8[_0x26aed1([0x69,0x6d,0x70,0x6f,0x72,0x74,0x4b,0x65,0x79])](_0x26aed1([0x6a,0x77,0x6b]),_0x5c8336,{[_0x26aed1([0x6e,0x61,0x6d,0x65])]:_0x26aed1([0x45,0x43,0x44,0x53,0x41]),[_0x26aed1([0x6e,0x61,0x6d,0x65,0x64,0x43,0x75,0x72,0x76,0x65])]:_0x26aed1([0x50,0x2d,0x32,0x35,0x36])},!0x1,[_0x26aed1([0x76,0x65,0x72,0x69,0x66,0x79])]);await _0x1a69f8[_0x26aed1([0x76,0x65,0x72,0x69,0x66,0x79])]({[_0x26aed1([0x6e,0x61,0x6d,0x65])]:_0x26aed1([0x45,0x43,0x44,0x53,0x41]),[_0x26aed1([0x68,0x61,0x73,0x68])]:{[_0x26aed1([0x6e,0x61,0x6d,0x65])]:_0x26aed1([0x53,0x48,0x41,0x2d,0x32,0x35,0x36])}},_0x20f373,_0x455a77,_0x529edb)||(_0x73e6f3=!0x1);}}function _0x32e440(_0xa0ed8c){return _0xa0ed8c[_0x26aed1([0x73,0x74,0x61,0x72,0x74,0x73,0x57,0x69,0x74,0x68])](_0x26aed1([0x65,0x79]))?JSON[_0x26aed1([0x70,0x61,0x72,0x73,0x65])](_0x98ca4a(_0xa0ed8c)):null;}function _0x98ca4a(_0x128af9){return window[_0x26aed1([0x61,0x74,0x6f,0x62])](_0x128af9[_0x26aed1([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/-/g,_0x26aed1([0x2b]))[_0x26aed1([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/_/g,_0x26aed1([0x2f])));}function _0x33090b(_0x5ed8ee){let _0x5bbc1e=0x1505;function _0x42fa87(_0x112063){for(let _0x2ccd84=0x0;_0x2ccd84<_0x112063[_0x26aed1([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0x2ccd84++){const _0x5d004b=_0x112063[_0x26aed1([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](_0x2ccd84);_0x5bbc1e=(_0x5bbc1e<<0x5)+_0x5bbc1e+_0x5d004b,_0x5bbc1e&=_0x5bbc1e;}}function _0x5a85f8(_0x5c4fe6){Array[_0x26aed1([0x69,0x73,0x41,0x72,0x72,0x61,0x79])](_0x5c4fe6)?_0x5c4fe6[_0x26aed1([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](_0x5a85f8):_0x5c4fe6&&typeof _0x5c4fe6==_0x26aed1([0x6f,0x62,0x6a,0x65,0x63,0x74])?Object[_0x26aed1([0x65,0x6e,0x74,0x72,0x69,0x65,0x73])](_0x5c4fe6)[_0x26aed1([0x73,0x6f,0x72,0x74])]()[_0x26aed1([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](([_0x32d079,_0x1dac0b])=>{_0x42fa87(_0x32d079),_0x5a85f8(_0x1dac0b);}):_0x42fa87(window[_0x26aed1([0x53,0x74,0x72,0x69,0x6e,0x67])](_0x5c4fe6));}return _0x5a85f8(_0x5ed8ee),_0x5bbc1e>>>0x0;}function _0x2b6ba2(_0x38cf2f){return _0x38cf2f[_0x26aed1([0x74,0x6f,0x53,0x74,0x72,0x69,0x6e,0x67])](0x10)[_0x26aed1([0x70,0x61,0x64,0x53,0x74,0x61,0x72,0x74])](0x8,_0x26aed1([0x30]));}function _0x216eee(_0xc56912){return _0xc56912[_0x26aed1([0x73,0x70,0x6c,0x69,0x74])]('')[_0x26aed1([0x72,0x65,0x76,0x65,0x72,0x73,0x65])]()[_0x26aed1([0x6a,0x6f,0x69,0x6e])]('');}function _0x26b6db(){}function _0x26aed1(_0x2f15ab){return _0x2f15ab['map'](_0x48fe41=>String['fromCharCode'](_0x48fe41))['join']('');}_0xc3a93b(await _0x545f99());}(this);}['showFakeVisualSelection'](){const _0x3e743b=this['editor']['model'];_0x3e743b['change'](_0x34683f=>{const _0x310c27=_0x3e743b['document']['selection']['getRanges']();let _0x2974d1=0x0;for(const _0xca38e0 of _0x310c27){const _0x1b7e75=bi+':'+_0x2974d1;if(_0x3e743b['markers']['has'](_0x1b7e75))_0x34683f['updateMarker'](_0x1b7e75,{'range':_0xca38e0});else{if(_0xca38e0['start']['isAtEnd']){const _0x1415c5=_0xca38e0['start']['getLastMatchingPosition'](({item:_0x4035c8})=>!_0x3e743b['schema']['isContent'](_0x4035c8),{'boundaries':_0xca38e0});_0x34683f['addMarker'](_0x1b7e75,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x34683f['createRange'](_0x1415c5,_0xca38e0['end'])});}else _0x34683f['addMarker'](_0x1b7e75,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0xca38e0});}_0x2974d1++;}});}['hideFakeVisualSelection'](){const _0x57c03d=this['editor']['model'],_0x2e42cd=Array['from'](this['editor']['model']['markers']['getMarkersGroup'](bi));_0x2e42cd['length']&&_0x57c03d['change'](_0x17f3b8=>{_0x2e42cd['forEach'](_0x4c9ea1=>{_0x17f3b8['removeMarker'](_0x4c9ea1);});});}['insertContent'](_0x26b676,_0xcbee96){const _0x4f42ab=this['_getAISelection'](),_0x24d16e=_0xcbee96||_0x4f42ab['getFirstRange']();this['editor']['model']['canEditAt'](_0x24d16e)&&this['editor']['model']['change'](_0x50ac72=>{this['hideFakeVisualSelection'](),_0xcbee96||this['_resetContentOfSelectedTableCells'](_0x50ac72,_0x4f42ab),this['_pasteHTMLUsingClipboard']({'insertAt':_0x24d16e,'writer':_0x50ac72,'html':_0x26b676});});}['insertContentBelow'](_0x4976d1){const {model:_0x563af4}=this['editor'],_0x2a00a=this['_getAISelection']();_0x563af4['change'](()=>{const _0x1edd72=this['_prepareTableInsertBelowPosition'](_0x4976d1,_0x2a00a)||this['_getDefaultInsertBelowPosition'](_0x2a00a);this['insertContent'](_0x4976d1,_0x1edd72);});}['_getAISelection'](){const _0x1b5772=this['editor']['model'],_0x15318a=Array['from'](_0x1b5772['markers']['getMarkersGroup'](bi))['map'](_0x269b8a=>_0x269b8a['getRange']());return _0x1b5772['createSelection'](_0x15318a);}['_pasteHTMLUsingClipboard']({writer:_0x269303,html:_0x2d4bda,insertAt:_0x120f36}){const {view:_0x4c2e89}=this['editor']['editing'],_0x8bfa45=this['editor']['plugins']['get'](_0x393629),_0x4fd0ed=new fi();_0x4fd0ed['setData']('text/html',_0x2d4bda);const _0x42a262=new ClipboardEvent('paste',{'clipboardData':_0x4fd0ed}),_0x42fed1=new _0x5d1575(_0x4c2e89,_0x42a262,{'dataTransfer':new _0x4329ca(_0x4fd0ed)});_0x269303['setSelection'](_0x120f36);const _0x3b5050=(_0x388ab5,_0x59cf78)=>{_0x59cf78['resultRange']&&_0x269303['setSelection'](_0x59cf78['resultRange']);};_0x8bfa45['once']('contentInsertion',_0x3b5050,{'priority':'lowest'}),_0x4c2e89['document']['fire']('paste',_0x42fed1),_0x8bfa45['off']('contentInsertion',_0x3b5050);}['_getDefaultInsertBelowPosition'](_0x4a5cb3){const {model:_0x5f399d}=this['editor'],_0x504a13=Array['from'](_0x4a5cb3['getSelectedBlocks']());return _0x504a13['length']?_0x5f399d['createPositionAfter'](_0x504a13['pop']()):_0x4a5cb3['getLastPosition']();}['_prepareTableInsertBelowPosition'](_0x14559f,_0x339f5a){const {model:_0x27eca3,plugins:_0x49aefc}=this['editor'];if(_0x49aefc['has']('TableUtils')){const _0x301dfd=_0x49aefc['get']('TableUtils')['getSelectedTableCells'](_0x339f5a);if(_0x301dfd['length']){const _0x43ada7=this['_getTableRowCountFromContent'](_0x14559f),_0x3dfb3a=this['_createEmptyTableRows'](_0x301dfd,_0x43ada7);return _0x27eca3['createPositionAt'](_0x3dfb3a,0x0);}}return null;}['_getTableRowCountFromContent'](_0x2edd99){const _0x53fc62=this['editor']['plugins']['get']('TableUtils'),_0xce9242=this['editor']['data']['parse'](_0x2edd99),_0x34250d=Array['from'](_0xce9242['getChildren']())['filter'](_0x501ecb=>_0x501ecb['is']('element','table'));let _0x11f3cb=0x0;return _0x34250d['forEach'](_0x254f99=>{_0x11f3cb+=_0x53fc62['getRows'](_0x254f99);}),_0x11f3cb;}['_createEmptyTableRows'](_0x310ce1,_0x202c70){const _0x18e30b=this['editor']['plugins']['get']('TableUtils'),_0x4a0ee4=_0x18e30b['getRowIndexes'](_0x310ce1),_0x55c1fc=_0x18e30b['getColumnIndexes'](_0x310ce1),_0x24fbd1=_0x4a0ee4['last']+0x1,_0x21ba04=_0x55c1fc['first'],_0x48a888=_0x310ce1[0x0]['findAncestor']('table');for(let _0x4c5181=0x0;_0x4c5181<_0x202c70;_0x4c5181++)_0x18e30b['insertRows'](_0x48a888,{'at':_0x24fbd1});return _0x48a888['getChild'](_0x24fbd1)['getChild'](_0x21ba04);}['_resetContentOfSelectedTableCells'](_0xc70509,_0x4c18b5){const {plugins:_0x56365b}=this['editor'],{model:_0x596e94}=_0xc70509;if(!_0x56365b['has']('TableUtils'))return;_0x56365b['get']('TableUtils')['getSelectedTableCells'](_0x4c18b5)['length']&&_0x596e94['deleteContent'](_0x4c18b5);}}class Ri extends _0x5e248a{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(_0x6e6633){super(_0x6e6633),this['name']='AIRequestError';}}function ki(_0x2463e5,_0x458c6a,_0x367fa0){const t=_0x2463e5['t'];switch(_0x458c6a){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',_0x367fa0);case'Error\x20during\x20AI\x20content\x20generation:\x20%0':return t('Error\x20during\x20AI\x20content\x20generation:\x20%0',_0x367fa0);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'},_0x367fa0);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 _0x458c6a;}}class Ni extends _0x131d8d{['_commandDefinitions'];constructor(_0x2e9be7,_0x2fe80a){super(_0x2e9be7),this['_commandDefinitions']=_0x2fe80a,this['set']('enabledCommandsIds',[]),this['on']('change:_hasContext',(_0x279931,_0x48157c,_0x17b156)=>{this['isEnabled']&&(this['enabledCommandsIds']=vi(this['_commandDefinitions'],_0x17b156));}),this['set']('_hasContext',!0x1),this['on']('change:isEnabled',(_0x41f44a,_0x3ba3a6,_0x41fee8)=>{this['enabledCommandsIds']=_0x41fee8?vi(this['_commandDefinitions'],this['_hasContext']):[];});}['refresh'](){const _0x3ca63e=this['editor']['model'];this['_hasContext']=function(_0x4c87e6){const _0x1884e1=_0x4c87e6['document']['selection'];return _0x1884e1['isCollapsed']?0x0!==[..._0x1884e1['getSelectedBlocks']()]['length']&&![..._0x1884e1['getSelectedBlocks']()][0x0]['isEmpty']:!!_0x4c87e6['hasContent'](_0x1884e1['getFirstRange']());}(_0x3ca63e);const _0x3178a5=_0x3ca63e['document']['selection'],_0x40033c=this['editor']['config']['get']('ai.assistant.disabledElements');for(const _0x20ea36 of _0x3178a5['getRanges']())for(const _0x444e70 of _0x20ea36['getItems']())if(_0x444e70['is']('element')&&_0x40033c['includes'](_0x444e70['name']))return void(this['isEnabled']=!0x1);this['isEnabled']=!0x0;}['execute'](_0x2b1a86='',_0x1586ec='',_0x12f787='custom'){this['editor']['plugins']['get']($i)['showUI'](_0x2b1a86,_0x1586ec,_0x12f787);}}function vi(_0xefea81,_0x16977d){const _0x13dc91=new Set();for(const _0x37a8d1 of _0xefea81['values']())(_0x16977d||!0x1===_0x37a8d1['requiresContent'])&&_0x13dc91['add'](_0x37a8d1['id']);return Array['from'](_0x13dc91);}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(_0x550092,_0x56b7c6,_0x22a9e0){super(),this['editor']=_0x550092,this['textAdapter']=_0x56b7c6,this['_sanitizationContainer']=document['createElement']('div'),this['_domParser']=new DOMParser(),this['_xmlSerializer']=new XMLSerializer(),this['view']=_0x22a9e0,this['set']({'initialContext':'','currentContext':'','currentResponse':'','previousContext':void 0x0,'previousQuery':void 0x0,'previousLabel':void 0x0,'isProcessing':!0x1}),this['on']('set:currentContext',(_0x316f4e,_0x1b1d5f,_0x5d324c)=>{this['view']['value']=this['_sanitizeHTML'](_0x5d324c);}),this['listenTo'](this['view'],'submitPrompt',(_0x182e20,_0x41eedd)=>{const _0x17e824=this['currentContext']||this['initialContext'];this['_handleQuery'](_0x41eedd,_0x17e824,'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:_0x77d138,query:_0x4df17c,htmlContent:_0x129426,label:_0x4c0d61,mainActionLabel:_0x5da2c1}){this['view']['prompt']=_0x4c0d61,this['view']['mainAction']=_0x5da2c1,this['initialContext']=_0x129426,_0x4df17c&&(this['view']['isRendered']?this['_handleQuery'](_0x4df17c,_0x129426,_0x77d138,_0x4c0d61):this['view']['once']('render',()=>{this['_handleQuery'](_0x4df17c,_0x129426,_0x77d138,_0x4c0d61);}));}['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'](_0x482958,_0x1da3b5,_0x5d5250,_0x2ab9b4){return this['isProcessing']=!0x0,this['view']['startProcessing'](),this['previousContext']=_0x1da3b5,this['previousQuery']=_0x482958,this['previousLabel']=_0x2ab9b4||_0x482958,this['previousActionId']=_0x5d5250,new Promise(_0x2a97de=>{this['textAdapter']['makeRequest']({'query':_0x482958,'context':_0x1da3b5,'onData':_0x2746f7=>{this['currentResponse']=_0x2746f7,this['currentContext']=this['_parseAndNormalizeContent'](this['currentResponse']);},'actionId':_0x5d5250})['then'](()=>{!this['currentContext']&&this['currentResponse']&&(this['currentContext']=this['_parseAndNormalizeContent'](this['currentResponse'],!0x0));})['catch'](_0x3e0b68=>{_0x3e0b68 instanceof Oi?this['view']['handleError'](_0x3e0b68['message']):this['view']['handleError'](),_0x2a97de();})['finally'](()=>{this['stopProcessing'](),_0x2a97de();});});}['_parseAndNormalizeContent'](_0x1f8b64,_0x519d8f=!0x1){const _0x1963bc=yi['exec'](_0x1f8b64);_0x1f8b64=_0x1963bc?_0x1f8b64['substring'](_0x1963bc[0x1]['length']):_0x1f8b64['length']<0x64&&!_0x519d8f?'':this['_stripMarkdownSyntax'](_0x1f8b64);const _0x50e0b9=this['_domParser']['parseFromString'](_0x1f8b64,'text/html');if(_0x1963bc){const _0x83c075=Array['from'](_0x50e0b9['body']['childNodes']);_0x83c075['reverse']();for(const _0x1e5da3 of _0x83c075){if(_0x1e5da3['nodeType']==Node['ELEMENT_NODE'])break;_0x1e5da3['remove']();}}const _0x163520=this['editor']['data']['processor']['toView'](this['_xmlSerializer']['serializeToString'](_0x50e0b9['body']));this['_isH1TagSupportEnabled']()||this['_normalizeResponseHeadings'](_0x163520);const _0x36b363=this['editor']['config']['get']('ai.assistant.preserveComments'),_0x5bae6c=this['editor']['data']['toModel'](_0x163520);return _0x36b363||_0x5bae6c['markers']['clear'](),this['editor']['data']['stringify'](_0x5bae6c);}['_normalizeResponseHeadings'](_0x4a2488){const _0x4cabe9=new _0x48cb1f(this['editor']['editing']['view']['document']),_0x1cfd6c=new _0x3bcca8({'name':/^h[1-5]$/}),_0x408b1e=[];let _0x56d946=!0x1;for(const _0x28f2f5 of _0x4a2488)_0x28f2f5['is']('element')&&_0x1cfd6c['match'](_0x28f2f5)&&(_0x408b1e['push'](_0x28f2f5),'h1'==_0x28f2f5['name']&&(_0x56d946=!0x0));if(_0x56d946){for(const _0x4c290b of _0x408b1e)_0x4cabe9['rename']('h'+(parseInt(_0x4c290b['name'][0x1])+0x1),_0x4c290b);}}['_isH1TagSupportEnabled'](){const {data:_0x5a7182,editing:_0x52c65e}=this['editor'],_0x12fe21=_0x5a7182['htmlProcessor']['toView']('<h1></h1>'),_0x1fe152=_0x5a7182['toView'](_0x5a7182['toModel'](_0x12fe21));return!!_0x52c65e['view']['domConverter']['viewToDom'](_0x1fe152)['querySelector']('h1');}['_sanitizeHTML'](_0xcabd59){return this['editor']['editing']['view']['domConverter']['setContentOf'](this['_sanitizationContainer'],_0xcabd59),this['_sanitizationContainer']['innerHTML'];}['_stripMarkdownSyntax'](_0x2a027d){const _0x58ed4f=_0x2a027d['trim']();return _0x58ed4f['startsWith']('```html')?_0x58ed4f['endsWith']('```')?_0x58ed4f['substring'](0x7,_0x58ed4f['length']-0x3):_0x58ed4f['substring'](0x7):_0x2a027d;}}const Li={'REPLACE':'replace','INSERT':'insert'};class Di extends kt{constructor(_0xa1df55){super(_0xa1df55),this['set']('isVisible',!0x1),this['set']('mainAction',Li['REPLACE']),this['replaceButton']=this['_createButton']('','ck-button-action'),this['replaceButton']['bind']('label')['to'](this,'mainAction',_0x267b69=>ki(_0xa1df55,'AI_'+_0x267b69['toUpperCase']()+'_CONTENT')),this['insertButton']=this['_createButton'](ki(_0xa1df55,'Insert\x20below')),this['tryAgainButton']=this['_createButton'](ki(_0xa1df55,'Try\x20again')),this['stopButton']=this['_createButton'](ki(_0xa1df55,'Stop'));const _0x2ce650=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':['ck-ai-form__toolbar',_0x2ce650['if']('isVisible','ck-hidden',_0x26a9a8=>!_0x26a9a8)]}}),this['items']['addMany']([this['replaceButton'],this['insertButton'],this['tryAgainButton'],this['stopButton']]);}['_createButton'](_0x6e4813,_0x3fe819){const _0x1025ea=new Nt(this['locale']);return _0x1025ea['set']({'label':_0x6e4813,'class':_0x3fe819||'','isVisible':!0x0,'withText':!0x0}),_0x1025ea;}}class Pi extends vt{['contentFieldView'];['copyButtonView'];constructor(_0x134158,_0x1b8f63=''){super(_0x134158),this['set']({'value':null,'isVisible':!0x1,'isProcessing':!0x1});const _0xb58da5=this['bindTemplate'];this['contentFieldView']=new Hi(_0x134158,_0x1b8f63),this['copyButtonView']=this['_createCopyButton'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area-wrapper',_0xb58da5['if']('isVisible','ck-hidden',_0x463fd2=>!_0x463fd2)],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area',_0xb58da5['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 _0x5353b4=!0x1;this['on']('change:value',(_0x3b0a5e,_0x442a02,_0x23976d)=>{const _0x135e03=!this['contentFieldView']['element']['querySelector']('.ck-ai-form__loader');this['contentFieldView']['setContent'](_0x23976d),this['isProcessing']&&_0x135e03&&!_0x5353b4&&this['element']['scrollTo']({'top':this['element']['scrollHeight'],'behavior':'smooth'});}),this['on']('change:isProcessing',(_0x214083,_0x543624,_0x36e349)=>{_0x5353b4=!0x1,_0x36e349?(this['value']=null,this['contentFieldView']['appendLoader']()):this['value']||this['contentFieldView']['setContent']('');}),this['listenTo'](this['element'],'wheel',()=>{_0x5353b4=!0x0;}),this['listenTo'](this['element'],'mousedown',()=>{_0x5353b4=!0x0;});}['focus'](){this['element']['focus']();}['_createCopyButton'](){const _0x53da23=this['locale'],_0x1d9d7e=new Nt(this['locale']),_0x1e4d87='ck-ai-form__copy-button';return _0x1d9d7e['set']({'label':ki(_0x53da23,'Copy'),'icon':_0x47d488,'class':_0x1e4d87,'tooltip':!0x0}),_0x1d9d7e['bind']('isVisible')['to'](this,'value',_0x27b9ff=>!!_0x27b9ff),_0x1d9d7e['bind']('isEnabled')['to'](this,'isProcessing',_0x55474b=>!_0x55474b),_0x1d9d7e['on']('execute',()=>{this['_copyHTMLToClipboard'](this['contentFieldView']['element']),_0x1d9d7e['icon']=_0x406d61,_0x1d9d7e['class']=_0x1e4d87+'\x20ck-ai-form__copy-button--copied',this['focus'](),setTimeout(()=>{_0x1d9d7e['icon']=_0x47d488,_0x1d9d7e['class']=_0x1e4d87;},0x3e8);}),_0x1d9d7e;}['_copyHTMLToClipboard'](_0x20c06d){const {window:_0x42f9cc,document:_0x1f3d46}=ct;if(_0x42f9cc['ClipboardItem']){const {Blob:_0x118bed,ClipboardItem:_0xc6fe74}=_0x42f9cc,_0x390fe4=[new _0xc6fe74({'text/html':new _0x118bed([_0x20c06d['innerHTML']],{'type':'text/html'}),'text/plain':new _0x118bed([_0x20c06d['textContent']||''],{'type':'text/plain'})})];navigator['clipboard']['write'](_0x390fe4);}else{const _0x2a7f1a=_0x1f3d46['createElement']('div');_0x2a7f1a['style']['position']='absolute',_0x2a7f1a['style']['left']='-9999px',_0x2a7f1a['innerHTML']='<span>[</span>'+_0x20c06d['innerHTML']+'<span>]</span>',_0x1f3d46['body']['appendChild'](_0x2a7f1a);const _0x1c8545=_0x1f3d46['createRange']();_0x1c8545['setStartAfter'](_0x2a7f1a['firstElementChild']),_0x1c8545['setEndBefore'](_0x2a7f1a['lastElementChild']);const _0x14df5a=_0x42f9cc['getSelection']();_0x14df5a['removeAllRanges'](),_0x14df5a['addRange'](_0x1c8545),_0x1f3d46['execCommand']('copy'),_0x2a7f1a['remove']();}}}class Hi extends vt{constructor(_0x3b43a4,_0xdaf3a9=''){super(_0x3b43a4),this['loaderView']=this['_createLoader'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-content',_0xdaf3a9,'ck-reset_all-excluded','ck-ai-form__content-field']}});}['setContent'](_0x39d0f6){this['element']['innerHTML']=_0x39d0f6;}['appendLoader'](){this['element']['appendChild'](this['loaderView']['element']);}['_createLoader'](){const _0xdb7335=new vt(),_0x1ba6b3=this['locale'],_0x489a26=new yt();return _0x489a26['isVisible']=!0x0,_0xdb7335['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__loader']},'children':[_0x489a26,{'text':ki(_0x1ba6b3,'AI\x20is\x20writing...')}]}),_0xdb7335['render'](),_0xdb7335;}}class Mi extends vt{constructor(_0x28e6c6,_0x5296d5=''){super(_0x28e6c6);const _0x2a755a=new xt(),_0x3e3d42=this['bindTemplate'];this['set']('text',_0x5296d5),_0x2a755a['content']=_0x5348f5,this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__error']},'children':[_0x2a755a,{'text':_0x3e3d42['to']('text')}]});}}class Ui extends Lt{['submitButtonView'];['showHistoryButtonView'];constructor(_0x153c7a,_0x11e90e){super(_0x153c7a,_0x11e90e),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',(_0x4ccb5b,_0x47f348)=>{_0x4ccb5b['target']==this['queryView']['fieldView']['element']&&(this['submit'](),_0x47f348());});}['_createSubmitButton'](){const _0xd7aba2=new Nt(this['locale']),_0x160b9a=this['locale'];return _0xd7aba2['set']({'icon':_0x1f67f2,'label':ki(_0x160b9a,'Submit'),'isVisible':!0x0,'tooltip':!0x0,'class':'ck-ai-form__submit'}),_0xd7aba2['on']('execute',()=>{this['submit']();}),_0xd7aba2['bind']('isEnabled')['to'](this['queryView']['fieldView'],'isEmpty',this,'isEnabled',(_0x5ea5b4,_0x3a262b)=>!_0x5ea5b4&&_0x3a262b),_0xd7aba2;}['_createShowHistoryButton'](){const _0x23ab5c=new Nt(this['locale']),_0x3c33ac=this['resultsView'],_0xee0682=this['locale'];_0x23ab5c['set']({'label':ki(_0xee0682,'History'),'withText':!0x1,'icon':_0x592da0,'tooltip':!0x0,'tooltipPosition':'sw','class':'ck-ai-form__toggle-history'}),_0x23ab5c['bind']('isOn')['to'](_0x3c33ac,'isVisible'),_0x23ab5c['bind']('isEnabled')['to'](this,'isEnabled'),_0x23ab5c['on']('execute',()=>{_0x3c33ac['isVisible']=!_0x3c33ac['isVisible'],_0x3c33ac['isVisible']?this['filteredView']['focus']():this['focus']();});const _0xe2661=()=>{ct['window']['requestAnimationFrame'](()=>{if(lt(this['element'])){const _0x93733a=new ut(this['queryView']['fieldView']['element']),_0x49f330=_0x93733a['width'],_0x24e723='rtl'===_0xee0682['uiLanguageDirection']?'left':'right';_0x93733a['excludeScrollbarsAndBorders'](),_0x23ab5c['element']['style'][_0x24e723]=_0x49f330-_0x93733a['width']+0x1+'px';}});};return this['queryView']['fieldView']['on']('update',_0xe2661),this['on']('render',_0xe2661),_0x23ab5c;}['submit'](){const _0x4c2b23=this['queryView']['fieldView']['element']['value'];this['fire']('submit',_0x4c2b23);}['focus'](_0x26550c){-0x1===_0x26550c?this['focusCycler']['focusLast']():this['focusCycler']['focusFirst']();}}class Vi extends Dt{['historyGroupView'];['clearHistoryButton'];constructor(_0x595189){super(_0x595189),this['clearHistoryButton']=this['_createClearHistoryButton'](),this['historyGroupView']=new Pt(),this['historyGroupView']['children']['add'](this['clearHistoryButton'],0x1),this['historyGroupView']['label']=ki(_0x595189,'Prompt\x20history'),this['historyGroupView']['items']['delegate']('execute')['to'](this),this['items']['add'](this['historyGroupView']);}['filter'](){let _0x41726f=0x0;for(const _0x58ec2b of this['items'])_0x41726f+=_0x58ec2b['items']['length'];return{'resultsCount':_0x41726f,'totalItemsCount':_0x41726f};}['_createClearHistoryButton'](){const _0x3223da=this['locale'],_0x43ba76=new Nt(this['locale']);return _0x43ba76['set']({'label':'('+ki(_0x3223da,'Clear')+')','withText':!0x0}),_0x43ba76['on']('execute',()=>this['fire']('clearHistory')),_0x43ba76;}}class Bi extends Ht{constructor(_0x47601c){super();const _0x5ccefe=new Mt(),_0x2ef895=new Nt(this['locale'],_0x5ccefe);this['children']['add'](_0x2ef895),_0x2ef895['set']({'label':_0x47601c['prompt'],'withText':!0x0}),_0x2ef895['on']('execute',()=>{this['fire']('execute',{'value':_0x1cfbb0(_0x47601c['prompt'])});});}}const Gi='CKEditor/AIFormView/PromptHistory';class Fi extends dt{constructor(){super(),this['_loadFromSessionStorage'](),this['on']('add',(_0x5cd0fd,_0x5d47c8)=>{const _0x2dd743=Ki(_0x5d47c8['prompt']);for(const _0x238294 of this)if(_0x238294!=_0x5d47c8&&Ki(_0x238294['prompt'])===_0x2dd743){this['remove'](_0x238294);break;}this['length']>0x14&&this['remove'](this['last']),this['_saveToSessionStorage']();}),this['on']('remove',()=>{this['_saveToSessionStorage']();});}['_loadFromSessionStorage'](){const _0x245c37=sessionStorage['getItem'](Gi)||'[]';this['addMany'](JSON['parse'](_0x245c37));}['_saveToSessionStorage'](){sessionStorage['setItem'](Gi,JSON['stringify'](this['map'](_0x3ff8c6=>_0x3ff8c6)));}}function Ki(_0x5c2f4d){return _0x5c2f4d['toLowerCase']()['trim']();}class Wi extends vt{['focusTracker'];['keystrokes'];['contentArea'];['toolbar'];['promptView'];['errorView'];['_focusables'];['focusCycler'];['_promptHistory'];constructor(_0x20149b,_0x566e51,_0x3d6aa7=''){super(_0x20149b),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(_0x20149b),this['contentArea']=new Pi(_0x20149b,_0x3d6aa7),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 _0x4f88dd=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form',_0x566e51],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-form-content']},'children':[{'tag':'div','attributes':{'class':[_0x4f88dd['if']('isError','ck-hidden',_0x50d32b=>!_0x50d32b)]},'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'](_0xfdbdce=0x1){-0x1===_0xfdbdce?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 _0x1c7210=this['locale'],_0x3ebb51=new Ui(_0x1c7210,{'queryView':{'label':ki(_0x1c7210,'Ask\x20AI\x20to\x20edit\x20or\x20generate'),'creator':Vt,'showIcon':!0x1,'showResetButton':!0x1},'infoView':{'text':{'noSearchableItems':{'primary':ki(_0x1c7210,'Empty\x20history'),'secondary':ki(_0x1c7210,'Ask\x20AI\x20and\x20your\x20prompts\x20will\x20be\x20listed\x20here\x20for\x20you\x20to\x20use\x20later.')}}},'filteredView':this['_createHistoryView'](),'queryMinChars':0x1/0x0,'resetOnBlur':!0x1});return _0x3ebb51['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',(_0x453b9a,_0x435288)=>_0x453b9a&&!_0x435288),this['listenTo'](_0x3ebb51,'submit',(_0x56c75e,_0x19999e)=>{this['prompt']=_0x19999e;const _0x464e54=_0x5aed4a(_0x19999e);this['fire']('submitPrompt',_0x464e54),_0x19999e['trim']()&&this['_promptHistory']['add']({'prompt':_0x464e54},0x0);},{'priority':'high'}),_0x3ebb51;}['_createHistoryView'](){const _0x3c6ec7=new Vi(this['locale']);return _0x3c6ec7['historyGroupView']['items']['bindTo'](this['_promptHistory'])['as'](Bi),_0x3c6ec7['on']('clearHistory',()=>{this['_promptHistory']['clear'](),this['promptView']['search'](''),this['promptView']['focus']();}),_0x3c6ec7;}['_createToolbar'](){const _0x272492=new Di(this['locale']);return _0x272492['replaceButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',this,'value',(_0x6b534b,_0x3e6d77,_0x2282ef)=>_0x6b534b&&!_0x3e6d77&&!!_0x2282ef),_0x272492['replaceButton']['delegate']('execute')['to'](this,'replaceContent'),_0x272492['insertButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',this,'value',(_0x51db85,_0x56b203,_0x15d7f6)=>_0x51db85&&!_0x56b203&&!!_0x15d7f6),_0x272492['insertButton']['delegate']('execute')['to'](this,'insertContentBelow'),_0x272492['tryAgainButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',(_0x3e30c3,_0x3aa631)=>_0x3e30c3&&!_0x3aa631),_0x272492['tryAgainButton']['delegate']('execute')['to'](this,'tryAgainEvent'),_0x272492['stopButton']['bind']('isEnabled')['to'](this,'isProcessing'),_0x272492['stopButton']['delegate']('execute')['to'](this,'stopProcessing'),_0x272492;}['startProcessing'](){this['value']='',this['isError']=!0x1,this['isProcessing']=!0x0,this['contentArea']['isVisible']=!0x0,this['toolbar']['isVisible']=!0x0,this['contentArea']['focus']();}['finishProcessing'](){const _0x3adafb=this['locale'];this['isProcessing']=!0x1,this['prompt']='',this['promptView']['reset'](),this['value']&&(this['promptView']['queryView']['label']=ki(_0x3adafb,'Ask\x20AI\x20to\x20improve\x20generated\x20text'));}['handleError'](_0x52bd89){const _0x25f732=this['locale'];this['finishProcessing'](),this['isError']=!0x0,this['errorView']['text']=_0x52bd89||ki(_0x25f732,'AI_ERROR_FAILED'),this['value']||(this['contentArea']['isVisible']=!0x1);}}const Yi=globalThis['DataTransfer'];class $i extends _0x5e248a{['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[_0x1cb775,Si,Ri,Bt];}constructor(_0x1e9075){super(_0x1e9075),_0x1e9075['config']['define']('ai.assistant.disabledElements',['media','rawHtml','tableOfContents']),_0x1e9075['config']['define']('ai.assistant.contentAreaCssClass',''),_0x1e9075['config']['define']('ai.assistant.useTheme',!0x0),this['_uiCssClasses']='ck-ai-assistant-ui'+(_0x1e9075['config']['get']('ai.assistant.useTheme')?'\x20ck-ai-assistant-ui_theme':'');}['init'](){const {editor:_0x2f947c}=this;this['_aiAdapter']=_0x2f947c['plugins']['get'](Ri),this['_dialog']=_0x2f947c['plugins']['get'](Bt),this['_formView']=null,this['_commandDefinitions']=this['_getResolvedCommandsDefinitions']();const _0x56f698=new Ni(_0x2f947c,Array['from'](this['_commandDefinitions']['values']()));_0x2f947c['commands']['add']('showAIAssistant',_0x56f698),_0x2f947c['ui']['componentFactory']['add']('aiCommands',_0x4191b9=>{const _0x189af4=Gt(_0x4191b9);return _0x189af4['set']({'class':'ck-ai-commands-dropdown\x20'+this['_uiCssClasses']}),_0x189af4['buttonView']['set']({'label':ki(_0x4191b9,'AI\x20Commands'),'icon':_0x3a64fb,'tooltip':!0x0}),_0x189af4['on']('execute',_0x561746=>this['_onExecute'](_0x561746['source']['id'])),Ft(_0x189af4,_0x2f947c['ui']['view']['body'],function(_0x1db555){const _0x56a77c=wi(_0x1db555['config']['get']('ai.assistant.commands'),_0x1db555['locale']),_0x532677=Qi(_0x1db555,_0x56a77c)['filter'](_0x1f28d3=>_0x1f28d3['commands']['length']);if(0x1===_0x532677['length'])return Qi(_0x1db555,_0x532677[0x0]['commands'])['map'](_0x4fe025=>({'id':_0x4fe025['id'],'label':_0x4fe025['label']}));return _0x532677['map'](_0x49a639=>{const {groupId:_0x10bbbc,groupLabel:_0x21a5c5,commands:_0xd3a1bb}=_0x49a639,_0xb9b6d2=Qi(_0x1db555,_0xd3a1bb)['map'](_0x2e6cc1=>({'id':_0x2e6cc1['id'],'label':_0x2e6cc1['label']}));return{'id':_0x10bbbc,'menu':_0x21a5c5||_0x10bbbc,'children':_0xb9b6d2};});}(_0x2f947c),{'ariaLabel':ki(_0x4191b9,'AI\x20Commands')}),_0x189af4['menuView']['menuPanelClass']='ck-ai-commands-dropdown\x20'+this['_uiCssClasses'],_0x56f698['on']('change:enabledCommandsIds',_0x2f9dbe),_0x189af4['menuView']['once']('render',_0x2f9dbe),_0x189af4;function _0x2f9dbe(){_0x189af4['isEnabled']=_0x56f698['enabledCommandsIds']['length']>0x0;for(const _0x35c5d8 of _0x189af4['menuView']['buttons'])_0x35c5d8['isEnabled']=_0x56f698['enabledCommandsIds']['includes'](_0x35c5d8['id']);}}),_0x2f947c['ui']['componentFactory']['add']('menuBar:aiCommands',_0x3bca05=>{const _0x2bf5a6=new Kt(_0x3bca05);_0x2bf5a6['buttonView']['set']({'label':ki(_0x3bca05,'AI\x20Commands'),'icon':_0x3a64fb}),_0x2bf5a6['bind']('isEnabled')['to'](_0x56f698,'enabledCommandsIds',_0x15bda7=>_0x15bda7['length']>0x0);const _0x32d0f3=wi(_0x2f947c['config']['get']('ai.assistant.commands'),_0x3bca05);return this['_populateMenuBarMenu'](_0x56f698,_0x2bf5a6,_0x32d0f3,_0x164ec4=>this['_onExecute'](_0x164ec4)),_0x2bf5a6;}),_0x2f947c['ui']['componentFactory']['add']('aiAssistant',()=>{const _0x5b9296=this['_createAIAssistantUIButton'](Nt);return _0x5b9296['set']({'tooltip':!0x0,'class':'ck-ai-assistant-button\x20'+this['_uiCssClasses']}),_0x5b9296;}),_0x2f947c['ui']['componentFactory']['add']('menuBar:aiAssistant',()=>{const _0x19802b=this['_createAIAssistantUIButton'](Wt);return _0x19802b['set']({'role':'menuitemcheckbox'}),_0x19802b;}),this['licenseKey']=this['editor']['config']['get']('licenseKey');const _0x1d7de8=this['editor'];this['_licenseKeyCheckInterval']=setInterval(()=>{let _0x3d6652;for(const _0x3d3387 in _0x1d7de8){const _0x1ba3ee=_0x3d3387,_0x17cf30=_0x1d7de8[_0x1ba3ee];if('aiLicenseKeyValid'==_0x17cf30||'aiLicenseKeyInvalid'==_0x17cf30||'aiLicenseKeyExpired'==_0x17cf30||'aiLicenseKeyDomainLimit'==_0x17cf30||'aiLicenseKeyNotAllowed'==_0x17cf30||'aiLicenseKeyEvaluationLimit'==_0x17cf30||'aiLicenseKeyUsageLimit'==_0x17cf30){delete _0x1d7de8[_0x1ba3ee],_0x3d6652=_0x17cf30,clearInterval(this['_licenseKeyCheckInterval']),this['_licenseKeyCheckInterval']=void 0x0;break;}}'aiLicenseKeyInvalid'==_0x3d6652&&_0x1d7de8['_showLicenseError']('invalid'),'aiLicenseKeyExpired'==_0x3d6652&&_0x1d7de8['_showLicenseError']('expired'),'aiLicenseKeyDomainLimit'==_0x3d6652&&_0x1d7de8['_showLicenseError']('domainLimit'),'aiLicenseKeyNotAllowed'==_0x3d6652&&_0x1d7de8['_showLicenseError']('featureNotAllowed','AIAssistant'),'aiLicenseKeyEvaluationLimit'==_0x3d6652&&_0x1d7de8['_showLicenseError']('evaluationLimit'),'aiLicenseKeyUsageLimit'==_0x3d6652&&_0x1d7de8['_showLicenseError']('usageLimit');},0x3e8);}['destroy'](){super['destroy'](),this['_licenseKeyCheckInterval']&&clearInterval(this['_licenseKeyCheckInterval']);}['showUI'](_0x11a193='',_0x29107d='',_0x1e0e51='custom'){const _0x1ee751=this['editor'],_0x546266=_0x1ee751['editing']['view'],_0x3e4539=_0x1ee751['plugins']['get'](Si),_0xadabad=_0x1ee751['plugins']['get'](_0x1cb775);_0x3e4539['showFakeVisualSelection']();const _0x50d47a=new Yi(),_0x3698fb=new ClipboardEvent('copy',{'clipboardData':_0x50d47a}),_0x4e3b75=new _0x4329ca(_0x50d47a),_0x3f23c2=new _0x5d1575(_0x546266,_0x3698fb,{'dataTransfer':_0x4e3b75});_0xadabad['_forceMarkersCopy']('comment',()=>{_0x546266['document']['fire']('copy',_0x3f23c2);}),this['_formView']||(this['_initView'](),this['_aiAssistantController']=new xi(_0x1ee751,this['_aiAdapter']['textAdapter'],this['_formView']));let _0x1653e4=_0x4e3b75['getData']('text/html');const _0x171210=_0x1ee751['model']['document']['selection'],_0x3ac39a=Array['from'](_0x171210['getRanges']());0x1===_0x3ac39a['length']&&_0x3ac39a[0x0]['isFlat']&&!_0x171210['getSelectedElement']()&&''!==_0x1653e4['replace'](/ /g,'')['trim']()&&(_0x1653e4='<p>'+_0x1653e4+'</p>'),this['_aiAssistantController']['updateView']({'actionId':_0x1e0e51,'query':_0x11a193,'htmlContent':_0x1653e4,'label':_0x29107d,'mainActionLabel':Li[_0x1ee751['model']['document']['selection']['isCollapsed']?'INSERT':'REPLACE']}),'aiAssistant'!==this['_dialog']['id']?this['_dialog']['show']({'id':'aiAssistant','icon':_0x31dd3a,'title':ki(this['editor']['locale'],'AI\x20Assistant'),'content':this['_formView'],'position':Yt['EDITOR_TOP_SIDE'],'onShow':()=>{this['_formView']['focus']();},'onHide':()=>{this['_aiAssistantController']['reset'](),_0x3e4539['hideFakeVisualSelection']();}}):this['_dialog']['view']['wasMoved']||this['_dialog']['view']['updatePosition']();}['hideUI'](){this['_dialog']['hide']();}['_getResolvedCommandsDefinitions'](){const _0x250a11=new Map(),_0xb332b9=wi(this['editor']['config']['get']('ai.assistant.commands'),this['editor']['locale']);for(const _0x4f8e15 of _0xb332b9)for(const _0x447dce of _0x4f8e15['commands'])_0x250a11['set'](_0x447dce['id'],{..._0x447dce,'groupId':_0x4f8e15['groupId'],'groupLabel':_0x4f8e15['groupLabel']||_0x4f8e15['groupId']});return _0x250a11;}['_createAIAssistantUIButton'](_0x3d9618){const _0x5091e4=this['editor'],_0x19b139=_0x5091e4['commands']['get']('showAIAssistant'),_0xff44d0=new _0x3d9618(_0x5091e4['locale']);return _0xff44d0['set']({'label':ki(_0x5091e4['locale'],'AI\x20Assistant'),'icon':_0x31dd3a,'isToggleable':!0x0}),_0xff44d0['bind']('isEnabled')['to'](_0x19b139),_0xff44d0['bind']('isOn')['to'](this['_dialog'],'id',_0x4baf2f=>'aiAssistant'===_0x4baf2f),this['listenTo'](_0xff44d0,'execute',()=>{_0xff44d0['isOn']?this['hideUI']():_0x19b139['execute']();}),_0xff44d0;}['_initView'](){const _0x21c23b=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',()=>{_0x21c23b['insertContent'](this['_aiAssistantController']['currentContext']),this['hideUI']();}),this['listenTo'](this['_formView'],'insertContentBelow',()=>{_0x21c23b['insertContentBelow'](this['_aiAssistantController']['currentContext']),this['hideUI']();}),this['_initAriaAiStatusChangeAnnouncements']();}['_initAriaAiStatusChangeAnnouncements'](){const {locale:_0x282ab9,ui:{ariaLiveAnnouncer:_0x199622}}=this['editor'];this['_formView']['contentArea']['on']('change:isProcessing',(_0x547bb6,_0x69314e,_0x162fb2)=>{const _0x32a872=this['_aiAssistantController']['currentContext'];_0x162fb2?_0x199622['announce'](ki(_0x282ab9,'AI\x20is\x20writing')):_0x32a872&&_0x199622['announce'](ki(_0x282ab9,'Generated\x20content:\x20%0',_0x32a872),{'politeness':'polite','isUnsafeHTML':!0x0});}),this['_formView']['on']('change:isError',(_0x32ad85,_0x50bafc,_0x4ac849)=>{if(_0x4ac849){const _0x2c4830=this['_formView']['errorView']['text'];_0x199622['announce'](ki(_0x282ab9,'Error\x20during\x20AI\x20content\x20generation:\x20%0',_0x2c4830));}});}['_onExecute'](_0xe2eab3){const _0x294c7d=this['_commandDefinitions']['get'](_0xe2eab3),_0x2e8c7a=this['editor'],_0x38a0fd=_0x2e8c7a['model']['document']['selection'],_0x24e318=_0x2e8c7a['commands']['get']('showAIAssistant'),_0x401e80=_0x2e8c7a['plugins']['get'](Si),_0x5ef35e=''+(_0x294c7d['groupId']!==Ci?_0x294c7d['groupLabel']+':\x20':'')+_0x294c7d['label'];if(!0x1!==_0x294c7d['requiresContent']&&_0x38a0fd['isCollapsed']){const _0x2a6399=At(_0x38a0fd['getSelectedBlocks']())||_0x2e8c7a['model']['schema']['getLimitElement'](_0x38a0fd);_0x2e8c7a['model']['change'](_0xe6eee=>{_0xe6eee['setSelection'](_0x2a6399,'in');});}_0x401e80['showFakeVisualSelection'](),_0x24e318['execute'](_0x294c7d['prompt'],_0x5ef35e,'command:'+_0xe2eab3);}['_populateMenuBarMenu'](_0x177122,_0x3f06e9,_0x1c5a93,_0x57a39e){const _0x580cc7=this['editor'],_0x22b0b1=_0x580cc7['locale'],_0x5008ce=new $t(_0x22b0b1),_0x1a1ae4=Qi(_0x580cc7,_0x1c5a93)['filter'](_0x49cfe9=>_0x49cfe9['commands']['length']);0x1===_0x1a1ae4['length']?this['_getMenuBarGroupButtons']({'command':_0x177122,'commands':_0x1a1ae4[0x0]['commands'],'parentMenuView':_0x3f06e9,'onExecute':_0x57a39e})['forEach'](_0x44be82=>_0x5008ce['items']['add'](_0x44be82)):_0x1a1ae4['forEach'](({groupId:_0x1148ef,groupLabel:_0x5ef45a,commands:_0x54fa6a})=>{const _0x22d99a=new qt(_0x22b0b1,_0x3f06e9),_0x2eebe2=new Kt(_0x22b0b1),_0x49d9a7=new $t(_0x22b0b1),_0x97de41=this['_getMenuBarGroupButtons']({'command':_0x177122,'commands':_0x54fa6a,'parentMenuView':_0x2eebe2,'onExecute':_0x57a39e});_0x2eebe2['buttonView']['set']({'label':_0x5ef45a||_0x1148ef}),_0x2eebe2['delegate']('execute')['to'](_0x3f06e9),_0x49d9a7['items']['addMany'](_0x97de41),_0x2eebe2['panelView']['children']['add'](_0x49d9a7),_0x22d99a['children']['add'](_0x2eebe2),_0x5008ce['items']['add'](_0x22d99a);}),_0x3f06e9['panelView']['children']['add'](_0x5008ce);}['_getMenuBarGroupButtons']({command:_0x13759c,commands:_0x3eeba3,parentMenuView:_0x52f7a0,onExecute:_0x1a7cc4}){const _0xe95ec4=this['editor'],_0x49639f=_0xe95ec4['locale'];return Qi(_0xe95ec4,_0x3eeba3)['map'](_0x491f78=>{const _0x45057a=new qt(_0x49639f,_0x52f7a0),_0x1f4623=new Wt(_0x49639f);return _0x1f4623['set']({'label':_0x491f78['label']}),_0x1f4623['delegate']('execute')['to'](_0x52f7a0),_0x1f4623['on']('execute',()=>_0x1a7cc4(_0x491f78['id'])),_0x1f4623['bind']('isEnabled')['to'](_0x13759c,'enabledCommandsIds',_0x1d6385=>_0x1d6385['includes'](_0x491f78['id'])),_0x45057a['children']['add'](_0x1f4623),_0x45057a;});}}function qi(_0x550fc3,_0x2c17df){return void 0x0!==_0x550fc3['order']&&void 0x0===_0x2c17df['order']?0x1:void 0x0===_0x550fc3['order']&&void 0x0!==_0x2c17df['order']?-0x1:void 0x0!==_0x550fc3['order']&&void 0x0!==_0x2c17df['order']?_0x550fc3['order']-_0x2c17df['order']:0x0;}function Qi(_0x493083,_0x5441fd){_0x5441fd['sort'](qi);const _0x48cad7={},_0xd36422=[];for(const _0x3021f0 of _0x5441fd)if(void 0x0!==_0x3021f0['order']){if(_0x3021f0['order']in _0x48cad7)throw new at('ai-commands-config-order-collision',_0x493083,{'conflictingDefinitions':[_0x3021f0,_0x48cad7[_0x3021f0['order']]]});_0x48cad7[_0x3021f0['order']]=_0x3021f0,_0xd36422['splice'](_0x3021f0['order'],0x0,_0x3021f0);}else _0xd36422['push'](_0x3021f0);return _0xd36422;}class Xi extends _0x5e248a{static get['requires'](){return[$i,Si];}static get['pluginName'](){return'AIAssistant';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x5f2af0){super(_0x5f2af0);const _0x2dda6a=_0x5f2af0['config'],_0x2d2a44=_0x5f2af0['locale'];_0x2dda6a['define']('ai.assistant.preserveComments',!0x0),_0x2dda6a['define']('ai.assistant.commands',zi(_0x2d2a44)),_0x2dda6a['define']('ai.assistant.extraCommandGroups',[]),_0x2dda6a['define']('ai.assistant.removeCommands',[]);let _0x25ec81=wi(_0x2dda6a['get']('ai.assistant.commands'),_0x2d2a44);const _0x27f1cb=_0x2dda6a['get']('ai.assistant.extraCommandGroups'),_0xbecad7=_0x2dda6a['get']('ai.assistant.removeCommands');_0x27f1cb['forEach'](_0x48d7ff=>{const _0x41c618=_0x25ec81['find'](_0x2f1e7a=>_0x2f1e7a['groupId']===_0x48d7ff['groupId']);_0x41c618?_0x41c618['commands']=_0x41c618['commands']['concat'](_0x48d7ff['commands']):_0x25ec81['push'](_0x48d7ff);}),_0x25ec81=_0x25ec81['filter'](_0x541f9e=>!_0xbecad7['includes'](_0x541f9e['groupId'])),_0x25ec81['forEach'](_0xcc961=>{_0xcc961['commands']=_0xcc961['commands']['filter'](_0x2c40d7=>!_0xbecad7['includes'](_0x2c40d7['id']));}),_0x2dda6a['set']('ai.assistant.commands',_0x25ec81);}}function zi(_0xd10892){return[{'groupId':'editOrReview','groupLabel':ki(_0xd10892,'Edit\x20or\x20review'),'commands':[{'id':'improveWriting','label':ki(_0xd10892,'Improve\x20writing'),'prompt':'Fix\x20spelling\x20mistakes,\x20use\x20proper\x20grammar\x20and\x20apply\x20good\x20writing\x20practices.\x20Do\x20not\x20lose\x20the\x20original\x20meaning.'},{'id':'makeShorter','label':ki(_0xd10892,'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(_0xd10892,'Make\x20longer'),'prompt':'Improve\x20this\x20content\x20by\x20using\x20descriptive\x20language\x20and\x20inserting\x20more\x20information\x20and\x20more\x20detailed\x20explanations.'},{'id':'simplifyLanguage','label':ki(_0xd10892,'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(_0xd10892,'Generate\x20from\x20selection'),'commands':[{'id':'summarize','label':ki(_0xd10892,'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(_0xd10892,'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(_0xd10892,'Change\x20tone'),'commands':[{'id':'professional','label':ki(_0xd10892,'Professional'),'prompt':'Improve\x20using\x20polished,\x20formal,\x20and\x20respectful\x20language\x20to\x20convey\x20professional\x20expertise\x20and\x20competence.'},{'id':'casual','label':ki(_0xd10892,'Casual'),'prompt':'Improve\x20using\x20casual,\x20informal\x20language\x20to\x20convey\x20a\x20casual\x20conversation\x20with\x20a\x20real\x20person.'},{'id':'direct','label':ki(_0xd10892,'Direct'),'prompt':'Improve\x20using\x20direct\x20language,\x20using\x20only\x20the\x20essential\x20information.'},{'id':'confident','label':ki(_0xd10892,'Confident'),'prompt':'Improve\x20using\x20compelling,\x20optimistic\x20language\x20to\x20convey\x20confidence\x20in\x20the\x20writing.'},{'id':'friendly','label':ki(_0xd10892,'Friendly'),'prompt':'Improve\x20using\x20friendly,\x20comforting\x20language,\x20to\x20convey\x20understanding\x20and\x20empathy.'}]},{'groupId':'changeStyle','groupLabel':ki(_0xd10892,'Change\x20style'),'commands':[{'id':'business','label':ki(_0xd10892,'Business'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20business\x20professional\x20with\x20formal\x20language.'},{'id':'legal','label':ki(_0xd10892,'Legal'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20legal\x20professional\x20using\x20valid\x20legal\x20terminology.'},{'id':'journalism','label':ki(_0xd10892,'Journalism'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20journalist\x20using\x20engaging\x20language\x20to\x20convey\x20the\x20importance\x20of\x20the\x20information.'},{'id':'poetic','label':ki(_0xd10892,'Poetic'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20poem\x20using\x20poetic\x20techniques\x20without\x20losing\x20the\x20original\x20meaning.'}]},{'groupId':'translate','groupLabel':ki(_0xd10892,'Translate'),'commands':[{'id':'translateEnglish','label':ki(_0xd10892,'English'),'prompt':'Translate\x20the\x20content\x20to\x20English\x20language.'},{'id':'translateSpanish','label':ki(_0xd10892,'Spanish'),'prompt':'Translate\x20the\x20content\x20to\x20Spanish\x20language.'},{'id':'translatePortuguese','label':ki(_0xd10892,'Portuguese'),'prompt':'Translate\x20the\x20content\x20to\x20Portuguese\x20language.'},{'id':'translateGerman','label':ki(_0xd10892,'German'),'prompt':'Translate\x20the\x20content\x20to\x20German\x20language.'},{'id':'translateFrench','label':ki(_0xd10892,'French'),'prompt':'Translate\x20the\x20content\x20to\x20French\x20language.'},{'id':'translateChinese','label':ki(_0xd10892,'Simplified\x20Chinese'),'prompt':'Translate\x20the\x20content\x20to\x20Simplified\x20Chinese\x20language.'},{'id':'translateHindi','label':ki(_0xd10892,'Hindi'),'prompt':'Translate\x20the\x20content\x20to\x20Hindi\x20language.'},{'id':'translateArabic','label':ki(_0xd10892,'Arabic'),'prompt':'Translate\x20the\x20content\x20to\x20Arabic\x20language.'}]}];}class ji extends _0x5e248a{['abortController'];static get['requires'](){return[Ri];}constructor(_0x35790f){super(_0x35790f),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'](_0x41c46c){return this['sendRequest'](_0x41c46c)['catch'](_0xbd5791=>{if(_0xbd5791 instanceof Oi)return Promise['reject'](_0xbd5791);if('AbortError'==_0xbd5791['name'])return Promise['resolve']();throw console['error'](_0xbd5791),new at('aitextadapter-send-request-failed',null);});}async['_prepareRequestHeaders'](_0x376233,_0xf6ff8){const _0x61779e=this['editor']['locale'],_0x3aff79={'Content-Type':'application/json'};if('object'==typeof _0x376233)Object['assign'](_0x3aff79,_0x376233);else{if(_0x376233)try{const _0x154f50=await _0x376233(_0xf6ff8);Object['assign'](_0x3aff79,_0x154f50);}catch{return Promise['reject'](new Oi(ki(_0x61779e,'AI_ERROR_GET_HEADERS')));}}return _0x3aff79;}async['_prepareRequestParameters'](_0x486b48,_0x173d36){const _0x4d154b=this['editor']['locale'];if('object'==typeof _0x486b48)return _0x486b48;try{return await _0x486b48(_0x173d36);}catch{return Promise['reject'](new Oi(ki(_0x4d154b,'AI_ERROR_GET_PARAMETERS')));}}}class Ji extends ji{['_apiUrl'];['_requestHeaders'];['_requestParameters'];static get['pluginName'](){return'OpenAITextAdapter';}constructor(_0xbf434){super(_0xbf434),_0xbf434['config']['define']('ai.assistant.adapter.openAI.apiUrl','https://api.openai.com/v1/chat/completions'),_0xbf434['config']['get']('ai.assistant.adapter.openAI.requestParameters')||_0xbf434['config']['define']('ai.assistant.adapter.openAI.requestParameters',{'model':'gpt-4o','temperature':0x1,'top_p':0x1,'stream':!0x0}),this['_apiUrl']=_0xbf434['config']['get']('ai.assistant.adapter.openAI.apiUrl'),this['_requestHeaders']=_0xbf434['config']['get']('ai.assistant.adapter.openAI.requestHeaders')||{},this['_requestParameters']=_0xbf434['config']['get']('ai.assistant.adapter.openAI.requestParameters');}async['sendRequest']({query:_0x3f7bd8,context:_0x5f583e,onData:_0x108479,actionId:_0xb7d881}){const _0xf11daa=this['editor']['locale'],_0x123949=await this['prepareMessages'](_0x3f7bd8,_0x5f583e,_0xb7d881),_0x9ecf83=await this['_prepareRequestHeaders'](this['_requestHeaders'],_0xb7d881),_0x4fff3e=await this['_prepareRequestParameters'](this['_requestParameters'],_0xb7d881),_0x3e2eca={'messages':_0x123949,..._0x4fff3e},_0x20f9e5={'method':'POST','headers':_0x9ecf83,'body':JSON['stringify'](_0x3e2eca),'signal':this['abortController']['signal']},_0x224e99=await fetch(this['_apiUrl'],_0x20f9e5);if(_0x224e99['ok'])return _0x4fff3e['stream']?await this['_readStreamableResponse'](_0x224e99,_0x108479):await this['_readStaticResponse'](_0x224e99,_0x108479),Promise['resolve']();{const _0x14d9d0=await _0x224e99['text']();return _0x14d9d0['includes']('context_length_exceeded')?Promise['reject'](new Oi(ki(_0xf11daa,'AI_ERROR_CONTEXT_LENGTH'))):_0x14d9d0['includes']('Moderation')?Promise['reject'](new Oi(ki(_0xf11daa,'AI_ERROR_MODERATION'))):Promise['reject'](new Error(_0x14d9d0));}}async['prepareMessages'](_0x1f1b60,_0xbc7200,_0x46a1f6){let _0x45a5b2,_0x16fdb6;return _0xbc7200?(_0x45a5b2='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.',_0x16fdb6='Instruction:\x0a'+_0x1f1b60+'\x0aYou\x20must\x20keep\x20the\x20text\x20formatting.\x0a\x0aContent:\x0a'+_0xbc7200):(_0x45a5b2='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.',_0x16fdb6=_0x1f1b60),[{'role':'system','content':_0x45a5b2},{'role':'user','content':_0x16fdb6}];}async['_readStreamableResponse'](_0x221005,_0x274b06){const _0x4fb585=_0x221005['body']['getReader'](),_0x33a961=new TextDecoder();let _0x1e71a0='',_0x4d9181='',_0x356873='',_0x37b47d=!0x1;for(;!_0x37b47d;){const {done:_0x1bb174,value:_0x28a2a7}=await _0x4fb585['read'](),_0x55e5ec=_0x1e71a0+_0x33a961['decode'](_0x28a2a7);let _0x681e27='';_0x37b47d=_0x1bb174;try{_0x681e27=this['_cleanUpData'](_0x55e5ec),_0x1e71a0='';}catch{_0x1e71a0=_0x55e5ec;continue;}_0x4d9181+=_0x681e27,!_0x37b47d&&this['_isBufferIncomplete'](_0x4d9181)||_0x4d9181&&(_0x356873+=_0x4d9181,_0x4d9181='',_0x274b06(_0x356873));}return Promise['resolve']();}async['_readStaticResponse'](_0x32b804,_0xf5482e){return _0xf5482e((await _0x32b804['json']())['choices'][0x0]['message']['content']),Promise['resolve']();}['_isBufferIncomplete'](_0x298f5e){const _0x4b840c=_0x298f5e['split']('<')['length']!==_0x298f5e['split']('>')['length'],_0x340b4c=_0x298f5e['length']<0x1e;return _0x4b840c&&_0x340b4c;}['_cleanUpData'](_0x468e8f){return _0x468e8f['split'](/\n(?![^{]*\})/g)['map'](_0x4b9c63=>_0x4b9c63['replace']('data:\x20',''))['filter'](_0xbcc5ad=>_0xbcc5ad&&_0xbcc5ad['length']>0x0&&'[DONE]'!==_0xbcc5ad)['map'](_0x1fc76d=>{const {choices:_0x1f8a0e}=JSON['parse'](_0x1fc76d);if(_0x1f8a0e[0x0]?.['delta']?.['content'])return _0x1f8a0e[0x0]['delta']['content'];})['filter'](_0x28f607=>_0x28f607)['join']('');}}class Zi extends ji{static get['pluginName'](){return'AWSTextAdapter';}['init'](){super['init'](),It('ai-aws-adapter-not-supported');}async['sendRequest'](_0x486a91){throw Et('ai-aws-adapter-not-supported'),new Oi(ki(this['editor']['locale'],'AI_ERROR_AWS_NOT_SUPPORTED'));}}class ts extends Nt{constructor(_0x83b37b,_0x2db667={}){super(_0x83b37b),this['isToggleable']=!0x0,this['set']('side',_0x2db667['side']||'top');const _0xc548bf=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':['ck-tab-button',...pt(_0x2db667['class']||[]),_0xc548bf['to']('side',_0xc67437=>'ck-tab-button_'+_0xc67437),_0xc548bf['to']('class')]}});}['show'](){this['set']('isVisible',!0x0);}['hide'](){this['set']('isVisible',!0x1);}}class es extends vt{['children'];constructor(_0x1bc8ad,_0x5780e8={}){super(_0x1bc8ad);const _0x27940c=this['bindTemplate'];this['set']('isVisible',!0x1),this['set']('class',''),this['children']=this['createCollection'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-tab-panel',...pt(_0x5780e8['class']||[]),_0x27940c['to']('class'),_0x27940c['if']('isVisible','ck-hidden',_0x277166=>!_0x277166)]},'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(_0x551b81,_0x341523={}){super(_0x551b81),this['set']('class',void 0x0),this['set']('activeTab',null),this['set']('side',_0x341523['side']||'top'),this['set']('isMaximized',!0x1),this['set']('collapsible',_0x341523['collapsible']||!0x1),this['set']('_isMaximizedActive',!0x1),this['bind']('_isMaximizedActive')['to'](this,'isMaximized',this,'activeTab',(_0xcc93c6,_0xb9879e)=>_0xcc93c6&&null!==_0xb9879e);const _0x232611=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset','ck-tabs',...pt(_0x341523['class']||[]),_0x232611['to']('side',_0x39734c=>'ck-tabs_'+_0x39734c),_0x232611['to']('class'),_0x232611['if']('_isMaximizedActive','ck-ai-tabs_maximized'),_0x232611['to']('activeTab',_0x5d6a89=>null===_0x5d6a89?'ck-ai-tabs_collapsed':'')],'tabindex':'0'},'children':[{'tag':'div','attributes':{'class':['ck','ck-tabs__buttons-container',_0x232611['to']('side',_0x374b93=>'ck-tabs__buttons-container_'+_0x374b93)]},'children':this['buttonViews']},{'tag':'div','attributes':{'class':['ck','ck-tabs__panels-container',_0x232611['to']('side',_0x423762=>'ck-tabs__panels-container_'+_0x423762)]},'children':this['panelViews']},...pt(_0x341523['children']||[])]});}['getTabIds'](){return[...this['_tabs']['keys']()];}['getTab'](_0x2ec6d6){const _0x1315f9=this['_tabs']['get'](_0x2ec6d6);return _0x1315f9||null;}['addTab'](_0x1a03fe){const _0x4ae807=this['_setupButton']({'id':_0x1a03fe['id'],'label':_0x1a03fe['buttonLabel'],'icon':_0x1a03fe['buttonIcon'],'order':_0x1a03fe['order']}),_0xd5b5ff=new es(this['locale']);return _0xd5b5ff['render'](),_0x1a03fe['content']&&_0xd5b5ff['children']['add'](_0x1a03fe['content']),this['panelViews']['add'](_0xd5b5ff),this['_tabs']['set'](_0x1a03fe['id'],{'button':_0x4ae807,'panel':_0xd5b5ff,'order':void 0x0!==_0x1a03fe['order']?_0x1a03fe['order']:null}),this['fire']('addTab:'+_0x1a03fe['id'],{'id':_0x1a03fe['id'],'button':_0x4ae807,'panel':_0xd5b5ff}),null===this['activeTab']?this['activateTab'](_0x1a03fe['id']):this['_hidePanel'](_0x1a03fe['id']),{'button':_0x4ae807,'panel':_0xd5b5ff};}['activateTab'](_0x496535){if(null!==_0x496535&&!this['getTab'](_0x496535))throw new at('ui-tabsview-tab-not-found',{'tabs':this,'tabId':_0x496535});if(this['activeTab']===_0x496535)return;const _0x3dd405=this['activeTab'];this['activeTab']&&this['_hidePanel'](this['activeTab']),this['activeTab']=_0x496535,_0x496535&&this['_showPanel'](_0x496535),this['fire']('activateTab:'+_0x496535,{'newTab':_0x496535,'oldTab':_0x3dd405});}['toggleTabPanel'](_0x59d317){if(!this['getTab'](_0x59d317))throw new at('ui-tabsview-tab-not-found',{'tabs':this,'tabId':_0x59d317});this['activeTab']===_0x59d317?this['collapsible']&&(this['activeTab']=null):this['activateTab'](_0x59d317);}['showTab'](_0x4967ca){if(!this['getTab'](_0x4967ca))throw new at('ui-tabsview-tab-not-found',{'tabs':this,'tabId':_0x4967ca});this['_showPanel'](_0x4967ca),this['_showButton'](_0x4967ca),this['fire']('show:'+_0x4967ca,_0x4967ca);}['hideTab'](_0x2d3d53){if(!this['getTab'](_0x2d3d53))throw new at('ui-tabsview-tab-not-found',{'tabs':this,'tabId':_0x2d3d53});const _0x3893c7=this['activeTab'];this['_hidePanel'](_0x2d3d53),this['_hideButton'](_0x2d3d53);const _0xcdf3b9=this['getTabIds']();_0x3893c7===_0x2d3d53&&_0xcdf3b9['length']>0x1&&this['activateTab'](_0xcdf3b9['find'](_0x1a563=>_0x1a563!==_0x2d3d53)),this['fire']('hide:'+_0x2d3d53,_0x2d3d53);}['_getPanel'](_0x4d76e2){const _0x20da7e=this['_tabs']['get'](_0x4d76e2);return _0x20da7e?_0x20da7e['panel']:null;}['_showPanel'](_0x8d3265){null!==this['activeTab']&&this['activeTab']!==_0x8d3265||this['_getPanel'](_0x8d3265)['show']();}['_hidePanel'](_0x53ea88){const _0xd657ab=this['_getPanel'](_0x53ea88);_0xd657ab['isVisible']&&(this['activeTab']===_0x53ea88&&(this['activeTab']=null),_0xd657ab['hide']());}['_getButton'](_0x10a0e1){const _0x29e812=this['_tabs']['get'](_0x10a0e1);return _0x29e812?_0x29e812['button']:null;}['_showButton'](_0x2cc4aa){this['_getButton'](_0x2cc4aa)['show']();}['_hideButton'](_0x19c4a5){this['_getButton'](_0x19c4a5)['hide']();}['_setupButton'](_0x3a745f){const _0x25ea41=new ts(this['locale'],{'side':this['side']}),_0x39751e=this['buttonViews'];if(_0x25ea41['set']({'label':_0x3a745f['label'],'icon':_0x3a745f['icon'],'tooltip':!0x0,'withText':!0x0}),_0x25ea41['bind']('isOn')['to'](this,'activeTab',_0x3e8731=>_0x3e8731===_0x3a745f['id']),_0x25ea41['bind']('side')['to'](this,'side'),_0x3a745f['order']){const _0x5567c9=[...this['_tabs']]['reduce']((_0xc0f08a,_0xdd2f5c)=>{const _0x55be18=_0xdd2f5c[0x0],{order:_0x453522}=_0xdd2f5c[0x1];return!_0x453522||_0x453522>_0x3a745f['order']?_0xc0f08a:_0x453522>=_0xc0f08a['order']?{'id':_0x55be18,'order':_0x453522}:_0xc0f08a;},{'id':'','order':0x0}),_0x10da53=_0x39751e['getIndex'](this['_getButton'](_0x5567c9['id']));_0x39751e['add'](_0x25ea41,_0x10da53+0x1);}else _0x39751e['add'](_0x25ea41);return _0x25ea41['on']('execute',()=>{this['toggleTabPanel'](_0x3a745f['id']);}),_0x25ea41;}}const ss=['overlay','sidebar','custom'],ns=['left','right'];class rs extends is{constructor(_0x4a244e,_0x4d325a={}){super(_0x4a244e,_0x4d325a),this['set']('type',_0x4d325a['type']||'sidebar'),this['set']('side',_0x4d325a['side']||'right'),this['set']('isVisible',_0x4d325a['visibleByDefault']??!0x0);const _0x5b0b7b=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':['ck-ai-tabs',_0x5b0b7b['if']('type','ck-ai-tabs__overlay',_0x16562d=>'overlay'===_0x16562d),_0x5b0b7b['if']('type','ck-ai-tabs__sidebar',_0x4b7296=>'sidebar'===_0x4b7296),_0x5b0b7b['if']('isVisible','ck-hidden',_0x25c148=>!_0x25c148)]}}),this['buttonViews']['on']('add',(_0x34e36f,_0x61936b)=>{_0x61936b['set']('withText',!0x1);});}}class os extends _0x173dbd{['view'];['container']=null;['showResizeButton']=!0x0;static get['pluginName'](){return'AITabs';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x2f4d60){if(super(_0x2f4d60),!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 _0x5423ba=this['context']['config']['get']('ai.container');if(this['set']('side','right'),void 0x0!==_0x5423ba['showResizeButton']&&(this['showResizeButton']=_0x5423ba['showResizeButton']),'sidebar'!==_0x5423ba['type']&&'overlay'!==_0x5423ba['type']||_0x5423ba['side']&&(this['side']=_0x5423ba['side']),'sidebar'===_0x5423ba['type']){if(this['container']=_0x5423ba['element'],this['set']('type','sidebar'),!this['container'])throw new at('ai-tabs-sidebar-container-element-not-found');}else'overlay'===_0x5423ba['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':_0x5423ba['visibleByDefault'],'collapsible':_0x5423ba['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 _0x2ef8df&&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'](_0x43a456){if(_0x43a456&&this['type']!==_0x43a456){if(!ss['includes'](_0x43a456))throw new at('ai-tabs-unsupported-ui-type');this['type']=_0x43a456;}}['switchSide'](_0x38098d){if(_0x38098d&&this['side']!==_0x38098d){if(!ns['includes'](_0x38098d))throw new at('ai-tabs-unsupported-ui-side');this['side']=_0x38098d;}}['destroy'](){super['destroy'](),this['view']['destroy'](),this['view']['element']&&this['view']['element']['remove']();}}class as extends _0x173dbd{['_apiUrl'];['_token'];['_decoder'];['_responseCache'];static get['requires'](){return[_0x47c197];}static get['pluginName'](){return'AIConnector';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x1c29b8){super(_0x1c29b8),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 _0x4821f4=this['context']['plugins']['get'](_0x47c197);if(!_0x4821f4['token'])throw new at('ai-missing-token',this);this['_token']=_0x4821f4['token'];}['startConversation'](_0x5c3a53,_0x259cd0){const _0x4a363f=this['_sendApiRequest']('/conversations','POST',{'id':_0x5c3a53,'group':_0x259cd0});return{'getConversation':async()=>(await _0x4a363f['request'])['json'](),'abortController':_0x4a363f['abortController']};}['queryAssistant']({message:_0x286163,conversationId:_0x395ad4,parts:_0x5047ca,capabilities:_0x51effb,model:_0x517eb4,attributes:_0x23c647}){const _0x13f87e={'prompt':_0x286163,'content':_0x5047ca,'model':_0x517eb4,..._0x51effb&&{'capabilities':_0x51effb},..._0x23c647&&{'attributes':_0x23c647}},_0x33f8a3=this['_sendApiRequest']('/conversations/'+_0x395ad4+'/messages','POST',_0x13f87e);return{'getStream':async()=>{const _0x2c4839=(await _0x33f8a3['request'])['body'];return this['_getStreamReader'](_0x2c4839);},'abortController':_0x33f8a3['abortController']};}['executeCustomAction']({content:_0xbb454,message:_0x2b2a3e,model:_0x3fa39b,outputFormat:_0x21629c}){const _0xdf749a={'content':[{'type':'text','content':_0xbb454}],'prompt':_0x2b2a3e,'model':_0x3fa39b,'outputFormat':_0x21629c},_0x10baa=this['_sendApiRequest']('/actions/custom/calls','POST',_0xdf749a);return{'getStream':async()=>{const _0x506870=(await _0x10baa['request'])['body'];return this['_getStreamReader'](_0x506870);},'abortController':_0x10baa['abortController']};}['executeAction']({actionName:_0x379e01,content:_0x460751,args:_0x343a1e}){const _0x17bf75={'content':[{'type':'text','content':_0x460751}],'args':_0x343a1e},_0x12a436=this['_sendApiRequest']('/actions/system/'+_0x379e01+'/calls','POST',_0x17bf75);return{'getStream':async()=>{const _0xcc110=(await _0x12a436['request'])['body'];return this['_getStreamReader'](_0xcc110);},'abortController':_0x12a436['abortController']};}['uploadFile'](_0x59ea98,_0x148c0f,_0x2c24f8){const _0x3d7b58=new FormData();_0x3d7b58['append']('file',_0x148c0f,_0x148c0f['name']),_0x2c24f8&&_0x3d7b58['append']('attributes',JSON['stringify'](_0x2c24f8));const _0x29a4b2=this['_sendApiRequest']('/conversations/'+_0x59ea98+'/files','POST',_0x3d7b58);return{'getId':async()=>(await _0x29a4b2['request'])['json'](),'abortController':_0x29a4b2['abortController']};}['fetchDocument'](_0x4c2111,_0x3e652f){const _0x3d48d2=this['_sendApiRequest']('/conversations/'+_0x4c2111+'/documents/'+_0x3e652f,'GET');return{'getDocument':async()=>(await _0x3d48d2['request'])['json'](),'abortController':_0x3d48d2['abortController']};}['uploadDocument'](_0x330714,_0x3aefe1,_0x1144b1){const _0x54e9e6={'content':_0x3aefe1};_0x1144b1&&(_0x54e9e6['attributes']=_0x1144b1);const _0x28d6b7=this['_sendApiRequest']('/conversations/'+_0x330714+'/documents','POST',_0x54e9e6);return{'getId':async()=>(await _0x28d6b7['request'])['json'](),'abortController':_0x28d6b7['abortController']};}['uploadDocuments'](_0x521e74,_0x22ad9){const _0x35ec37={'documents':_0x22ad9['map'](_0x1b646c=>({'content':_0x1b646c['content'],'attributes':{'version':_0x1b646c['version'],'sessionId':_0x1b646c['sessionId'],'channelId':_0x1b646c['channelId'],'rootName':_0x1b646c['rootName'],'selections':_0x1b646c['selections']},...void 0x0!==_0x1b646c['name']?{'name':_0x1b646c['name']}:{},...void 0x0!==_0x1b646c['description']?{'description':_0x1b646c['description']}:{}}))},_0x5a2109=this['_sendApiRequest']('/conversations/'+_0x521e74+'/documents/batch','POST',_0x35ec37);return{'getIds':async()=>(await _0x5a2109['request'])['json'](),'abortController':_0x5a2109['abortController']};}['fetchDocuments'](_0x5f4de0,_0x1d1d10){const _0x40391f=new URLSearchParams();_0x40391f['append']('documentIds',_0x1d1d10['join'](','));const _0x497cee=this['_sendApiRequest']('/conversations/'+_0x5f4de0+'/documents/batch?'+_0x40391f['toString'](),'GET');return{'getDocuments':async()=>(await _0x497cee['request'])['json'](),'abortController':_0x497cee['abortController']};}['fetchConversations'](_0x5690c7,_0x403481={}){const _0x44db08=new URLSearchParams();_0x44db08['append']('group',_0x5690c7),_0x44db08['append']('excludeEmpty',!0x1!==_0x403481['excludeEmpty']?'true':'false'),_0x44db08['append']('limit',_0x403481['limit']?_0x403481['limit']['toString']():'100'),_0x44db08['append']('sortBy',_0x403481['sortBy']?_0x403481['sortBy']:'createdAt'),_0x44db08['append']('order',_0x403481['order']?_0x403481['order']:'desc');const _0x3b5209=this['_sendApiRequest']('/conversations?'+_0x44db08['toString'](),'GET');return{'getConversations':async()=>{const _0x46c0f0=await _0x3b5209['request'];return(await _0x46c0f0['json']())['items'];},'abortController':_0x3b5209['abortController']};}['deleteConversation'](_0x125070){const _0xcae92e=this['_sendApiRequest']('/conversations/'+_0x125070,'DELETE');return{'execute':async()=>{await _0xcae92e['request'];},'abortController':_0xcae92e['abortController']};}['updateConversation'](_0xac7a23,_0x574186){const _0x56cb1c=this['_sendApiRequest']('/conversations/'+_0xac7a23,'PATCH',_0x574186);return{'getResult':async()=>(await _0x56cb1c['request'],_0x574186),'abortController':_0x56cb1c['abortController']};}['fetchConversation'](_0x13703a){const _0x467b63=this['_sendApiRequest']('/conversations/'+_0x13703a,'GET');return{'getConversation':async()=>(await _0x467b63['request'])['json'](),'abortController':_0x467b63['abortController']};}['fetchConversationMessages'](_0x8ee7a9){const _0x29f3a5=this['_sendApiRequest']('/conversations/'+_0x8ee7a9+'/messages','GET');return{'getMessages':async()=>{const _0x29140a=await _0x29f3a5['request'];return(await _0x29140a['json']())['items'];},'abortController':_0x29f3a5['abortController']};}['uploadUrl'](_0xf2065a,_0x428b3e,_0x271686){const _0x62758e=this['_sendApiRequest']('/conversations/'+_0xf2065a+'/web-resources','POST',{'url':_0x428b3e,'attributes':_0x271686});return{'getId':async()=>(await _0x62758e['request'])['json'](),'abortController':_0x62758e['abortController']};}['getModels'](_0x5dafa0='en'){const _0x2bb3f9=new URLSearchParams();_0x2bb3f9['append']('language',_0x5dafa0);const _0x12f72e='/models/1?'+_0x2bb3f9['toString'](),_0x542c50=this['_sendApiRequest'](_0x12f72e,'GET',void 0x0,!0x0);return{'list':async()=>await(await _0x542c50['request'])['json'](),'abortController':_0x542c50['abortController']};}['deleteFile'](_0x4ed8df,_0x1d2a3f){const _0x54809d=this['_sendApiRequest']('/conversations/'+_0x4ed8df+'/files/'+_0x1d2a3f,'DELETE');return{'execute':async()=>{await _0x54809d['request'];},'abortController':_0x54809d['abortController']};}['deleteDocument'](_0x4aa09,_0x3da526){const _0x4fe3f2=this['_sendApiRequest']('/conversations/'+_0x4aa09+'/documents/'+_0x3da526,'DELETE');return{'execute':async()=>{await _0x4fe3f2['request'];},'abortController':_0x4fe3f2['abortController']};}['deleteWebResource'](_0x342ab3,_0x90db38){const _0x233d56=this['_sendApiRequest']('/conversations/'+_0x342ab3+'/web-resources/'+_0x90db38,'DELETE');return{'execute':async()=>{await _0x233d56['request'];},'abortController':_0x233d56['abortController']};}['callSystemReview']({reviewName:_0x4cf8a1,content:_0x3364fb,args:_0x4df5e6}){const _0x26e9c7=this['_sendApiRequest']('/reviews/system/'+_0x4cf8a1+'/calls','POST',{'content':[{'type':'text','content':_0x3364fb}],'args':_0x4df5e6});return{'getStream':async()=>{const _0x1fdf19=(await _0x26e9c7['request'])['body'];return this['_getStreamReader'](_0x1fdf19);},'abortController':_0x26e9c7['abortController']};}['callCustomReview']({content:_0x4794e0,prompt:_0x118562,model:_0x3b753d}){const _0x286ada=this['_sendApiRequest']('/reviews/custom/calls','POST',{'content':[{'type':'text','content':_0x4794e0}],'prompt':_0x118562,'model':_0x3b753d});return{'getStream':async()=>{const _0x3c9de8=(await _0x286ada['request'])['body'];return this['_getStreamReader'](_0x3c9de8);},'abortController':_0x286ada['abortController']};}['upsertAIChatRating'](_0x3f2023,_0x173e93,_0x4b761b){const _0x3a52a6=this['_sendApiRequest']('/conversations/'+_0x3f2023+'/messages/'+_0x173e93+'/ratings','PUT',{'positiveCount':_0x4b761b['positiveCount'],'totalCount':_0x4b761b['totalCount'],'modificationId':_0x4b761b['modificationId']});return{'execute':async()=>{await _0x3a52a6['request'];},'abortController':_0x3a52a6['abortController']};}['upsertAIActionRating'](_0x463d62,_0x5f1a3b,_0x5f28a6){const _0x2821d4=this['_sendApiRequest']('/actions/system/'+_0x463d62+'/calls/'+_0x5f1a3b+'/ratings','PUT',{'positiveCount':_0x5f28a6['positiveCount'],'totalCount':_0x5f28a6['totalCount']});return{'execute':async()=>{await _0x2821d4['request'];},'abortController':_0x2821d4['abortController']};}['upsertCustomAIActionRating'](_0x34e1c1,_0x3817e0){const _0x519150=this['_sendApiRequest']('/actions/custom/calls/'+_0x34e1c1+'/ratings','PUT',{'positiveCount':_0x3817e0['positiveCount'],'totalCount':_0x3817e0['totalCount']});return{'execute':async()=>{await _0x519150['request'];},'abortController':_0x519150['abortController']};}['upsertAIReviewRating'](_0x17eb2b,_0x1514d1,_0x17aea1,_0x2a5bfe){const _0xaa0c1b=this['_sendApiRequest']('/reviews/system/'+_0x17eb2b+'/calls/'+_0x1514d1+'/ratings','PUT',{'positiveCount':_0x17aea1['positiveCount'],'totalCount':_0x17aea1['totalCount'],'dataId':_0x2a5bfe});return{'execute':async()=>{await _0xaa0c1b['request'];},'abortController':_0xaa0c1b['abortController']};}['upsertCustomAIReviewRating'](_0x2cc828,_0x2ffa7c,_0x489c5a){const _0x2384d1=this['_sendApiRequest']('/reviews/custom/calls/'+_0x2cc828+'/ratings','PUT',{'positiveCount':_0x2ffa7c['positiveCount'],'totalCount':_0x2ffa7c['totalCount'],'dataId':_0x489c5a});return{'execute':async()=>{await _0x2384d1['request'];},'abortController':_0x2384d1['abortController']};}['_sendApiRequest'](_0x18ff07,_0x233fcb,_0x27024d,_0x485c6a=!0x1){const _0x582f0a=new AbortController(),_0x312eaa=_0x485c6a?_0x233fcb+':'+_0x18ff07:null;if(_0x312eaa){const _0x4680a5=this['_responseCache']['get'](_0x312eaa);if(_0x4680a5)return{'request':_0x4680a5['then'](_0x52478e=>_0x52478e['clone']()),'abortController':_0x582f0a};}const _0x2e3283=_0x27024d instanceof FormData,_0x3ab579={'Authorization':'Bearer\x20'+this['_token']?.['value'],'X-Editor-Version':mt};_0x27024d&&!_0x2e3283&&(_0x3ab579['Content-Type']='application/json');const _0xc7294b={'method':_0x233fcb,'headers':_0x3ab579,'signal':_0x582f0a['signal']};_0x27024d&&(_0xc7294b['body']=_0x2e3283?_0x27024d:JSON['stringify'](_0x27024d));const _0xd8d647=fetch(''+this['_apiUrl']+_0x18ff07,_0xc7294b)['catch'](_0xd5c6b9=>{_0x312eaa&&this['_responseCache']['delete'](_0x312eaa),this['_handleError'](_0xd5c6b9);})['then'](_0x2bdd63=>_0x2bdd63['ok']?_0x2bdd63:_0x2bdd63['json']()['then'](_0x58e40f=>{throw _0x312eaa&&this['_responseCache']['delete'](_0x312eaa),{'url':this['_apiUrl'],'path':_0x18ff07,'method':_0x233fcb,'body':_0x27024d,'status':(_0x2bdd63||{})['status'],'statusText':(_0x2bdd63||{})['statusText'],'code':_0x58e40f['code'],'message':_0x58e40f['message'],'traceId':_0x58e40f['traceId']};}));return _0x312eaa&&this['_responseCache']['set'](_0x312eaa,_0xd8d647['then'](_0x42b6b5=>_0x42b6b5['clone']())),{'request':_0xd8d647,'abortController':_0x582f0a};}async*['_getStreamReader'](_0x587ea1){const _0x8f9677=[],_0x16bd34=_0x587ea1['getReader'](),_0x12c54d=_0x3e40e3({'onError':_0x17ca13=>{this['_handleError'](_0x17ca13);},'onEvent':_0x5bca09=>{_0x5bca09['data']=JSON['parse'](_0x5bca09['data']),_0x8f9677['push'](_0x5bca09);}});try{let _0x511768=!0x1;for(;!_0x511768;){const {done:_0x1e382b,value:_0x1abb0c}=await _0x16bd34['read']();_0x1e382b&&(_0x511768=!0x0),_0x12c54d['feed'](this['_decoder']['decode'](_0x1abb0c,{'stream':!0x0})),yield*_0x8f9677,_0x8f9677['length']=0x0;}}catch(_0xf7da40){this['_handleError'](_0xf7da40);}finally{_0x16bd34['releaseLock'](),_0x12c54d['reset']();}}['_handleError'](_0x52d278){if(_0x52d278 instanceof at)throw _0x52d278;if(_0x52d278 instanceof Error&&'AbortError'===_0x52d278['name'])throw new at('ai-request-aborted',this,{'originalError':_0x52d278});throw new at('ai-request-failed',this,{'originalError':_0x52d278});}}function hs(_0x17570e,_0x48f227,_0xa02442){const t=_0x17570e['t'];switch(_0x48f227){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'},_0xa02442);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.'},_0xa02442);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.'},_0xa02442);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.'},_0xa02442);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'},_0xa02442);case'AI_CHAT_SUGGESTION_ACTION_SUGGEST':return t({'id':'AI_CHAT_SUGGESTION_ACTION_SUGGEST','string':'Suggest'},_0xa02442);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'},_0xa02442);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.'},_0xa02442);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.'},_0xa02442);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.'},_0xa02442);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.'},_0xa02442);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'},_0xa02442);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.'},_0xa02442);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 _0x48f227;}}const cs='ck-ai-button-primary',ls='ck-ai-button-secondary',us='ck-ai-button-tertiary';function ds(_0x382455,_0x3d65fb){const _0x47ffa5=new Nt(_0x382455),_0x5cb04b=hs(_0x382455,'AI_TABS_LABEL_MINIMIZE'),_0x50fd67=hs(_0x382455,'AI_TABS_LABEL_MAXIMIZE');return _0x47ffa5['set']({'withText':!0x1,'icon':_0x4aa4b0,'tooltip':!0x0,'class':'ck-ai-tabs__resize\x20'+us}),_0x47ffa5['bind']('label')['to'](_0x3d65fb,'isMaximized',_0x253c48=>_0x253c48?_0x5cb04b:_0x50fd67),_0x47ffa5['bind']('icon')['to'](_0x3d65fb,'isMaximized',_0x54e107=>_0x54e107?_0x3fafdd:_0x4aa4b0),_0x47ffa5['bind']('isOn')['to'](_0x3d65fb,'isMaximized'),_0x47ffa5['on']('execute',()=>{_0x3d65fb['fire']('resizeTabs');}),_0x47ffa5;}function _s(_0x31333f){return _0xabe431(_0x31333f);}function gs(_0x12b9b4){return ti(_0x12b9b4);}function As(_0x20da5e,_0x3a6ffa,_0x564f9c){const _0x284d6c=null!==_0x3a6ffa?_0x51637a=>_0x51637a['attribs'][_0x20da5e]===_0x3a6ffa:_0x30a276=>Boolean(_0x30a276['attribs'][_0x20da5e]);return _0x4f11c1(_0x32799f=>_0x1d6ab8(_0x32799f)&&_0x284d6c(_0x32799f),_0x564f9c);}function Is(_0x18124b,_0x407a40,_0x38dd65){const _0x4bcf53=null!==_0x407a40?_0x16786d=>_0x16786d['attribs'][_0x18124b]===_0x407a40:_0x5247e8=>Boolean(_0x5247e8['attribs'][_0x18124b]);return _0x49c4b8(_0x1c5585=>_0x1d6ab8(_0x1c5585)&&_0x4bcf53(_0x1c5585),_0x38dd65);}function Es(_0x2428a3,_0x12ec70){return _0x2428a3&&_0x1d6ab8(_0x2428a3)?_0x2428a3['attribs'][_0x12ec70]:null;}function ps(_0x1a0164,_0x2c26be,_0x83c883){_0x1d6ab8(_0x1a0164)&&(null===_0x83c883?delete _0x1a0164['attribs'][_0x2c26be]:_0x1a0164['attribs'][_0x2c26be]=_0x83c883);}function ms(_0x292582,_0x43f826,_0x365d84){const _0x1abc83=_0x43f826['cloneNode'](!0x0);'beforebegin'===_0x365d84?_0x27ae1b(_0x292582,_0x1abc83):'afterbegin'===_0x365d84?_0x288fde(_0x292582,_0x1abc83):'beforeend'===_0x365d84?_0x27626e(_0x292582,_0x1abc83):'afterend'===_0x365d84&&_0x188752(_0x292582,_0x1abc83);}function Ts(_0x1052c4){const _0x1a4c14=[];let _0x1b88e9=_0x1052c4;for(;_0x1b88e9;)_0x1b88e9=_0xb9dbd4(_0x1b88e9),_0x1b88e9&&_0x1a4c14['push'](_0x1b88e9);return _0x1a4c14;}function Cs(_0xf57216){return _0xf57216['replace'](/^\s+/gm,'')['replace'](/\s+$/gm,'')['replace'](/\n*/g,'')['replace'](/\s+/g,'\x20')['replace'](/>\s*</g,'><');}function ws(_0xe11682){let _0x1448e6=0x0;for(;_0xe11682['parentNode'];)_0xe11682=_0xe11682['parentNode'],_0x1448e6++;return _0x1448e6;}function fs(_0x3eeff3){const _0x3f13da=[];let _0x3faa05=_0x3eeff3['nextSibling'];for(;_0x3faa05;)_0x3f13da['push'](_0x3faa05),_0x3faa05=_0x3faa05['nextSibling'];_0x3f13da['forEach'](_0x13ac3d=>{_0x5d78f4(_0x13ac3d);});}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(_0x4a4080){super(),this['_generateUid']=_0x4a4080||(()=>'e'+String(this['_uidCounter']++));}['merge'](_0x45f45e,_0x3529ca,_0x54266a){this['_uidCounter']=0x0;const _0xa20633=_0x45f45e['cloneNode'](!0x0),_0x13937d=_0xa20633['childNodes'],_0x45b4d9=Array['from'](_0x13937d)['filter'](_0x509605=>!(0x3===_0x509605['nodeType']&&''===gs(_0x509605)['trim']())),_0x9bda67=_0x45b4d9['length'],_0xf5454=new Map();for(const _0x318b22 of _0x45b4d9)_0x318b22&&_0x1d6ab8(_0x318b22)&&void 0x0===_0x318b22['attribs']['data-id']&&ps(_0x318b22,'data-id','new-element');if(0x0===_0x3529ca['childNodes']['length']){const _0x551c80=[];return Is('data-id','new-element',_0xa20633)['forEach'](_0x50d707=>{const _0x4f88af=this['_generateUid']();ps(_0x50d707,'data-id',_0x4f88af),_0x551c80['push'](_0x4f88af);}),this['_removeSpecialComments'](_0xa20633),{'parsedContent':_0xa20633,'newNodeIds':_0x551c80,'modifiedNodeIds':[],'removedNodeIds':[],'newAnchorIds':_0xf5454};}_0x54266a&&_0x54266a['markUnstableElements']&&this['_markLastTagElementUnstable'](_0xa20633),this['_touchedNodesState']['newIds']=[],this['_touchedNodesState']['modifiedIds']=[],this['_touchedNodesState']['removedIds']=[],this['_touchedNodesState']['invalidIds']=[],this['_touchedNodesState']['lastTouchedId']=null,this['_existingDataIds']=new Set(Is('data-id',null,_0x3529ca)['map'](_0x4caabc=>Es(_0x4caabc,'data-id'))['filter'](_0x5c7ac2=>!!_0x5c7ac2));let _0x2cf3a2=-0x1,_0x17b59b=!0x1;for(let _0x198ca3=0x0;_0x198ca3<_0x9bda67;_0x198ca3++){const _0x512d8b=_0x45b4d9[_0x198ca3],_0x4b45ad=_0x45b4d9[_0x198ca3+0x1];if(this['_isNewNode'](_0x512d8b)){if(-0x1===_0x2cf3a2&&(_0x2cf3a2=_0x198ca3),this['_markWrappedElements'](_0x512d8b),!this['_isNewNode'](_0x4b45ad)){const [_0x46c02b,_0x1b36ae]=this['_findReferenceNode'](_0x512d8b,_0x17b59b,_0x3529ca);if(_0x46c02b){const _0x169f7d=Array['from'](_0x45b4d9)['slice'](_0x2cf3a2,_0x198ca3+0x1),_0x375737=Es(_0x46c02b,'data-id');if(this['_insertNodes'](_0x46c02b,_0x169f7d,_0x1b36ae),_0x375737)for(const _0x37b848 of _0x169f7d){const _0x5ceaf6=Es(_0x37b848,'data-id');_0x5ceaf6&&_0xf5454['set'](_0x5ceaf6,_0x375737);}_0x2cf3a2=-0x1;}}}else{if(this['_isExistingContentComment'](_0x512d8b))_0x17b59b=!0x0;else{if(this['_isExistingNode'](_0x512d8b)){const _0x1ff3c8=Es(_0x512d8b,'data-id');if(_0x1ff3c8&&this['_existingDataIds']['has'](_0x1ff3c8)){const _0x2d6284=As('data-id',_0x1ff3c8,_0x3529ca);this['_replaceNode'](_0x2d6284,_0x512d8b);}}else{if(this['_isDelNode'](_0x512d8b)){const _0x423840=this['_getNodeDataId'](_0x512d8b);!!As('data-id',_0x423840,_0xa20633)||this['_touchedNodesState']['removedIds']['push'](_0x423840);}}}}}for(const _0x3918ae of this['_touchedNodesState']['removedIds']){const _0x2b2fa1=As('data-id',_0x3918ae,_0x3529ca);_0x2b2fa1&&this['_removeNode'](_0x2b2fa1,_0x3918ae,_0x54266a);}if(Is('data-id','new-element',_0x3529ca)['forEach'](_0x298664=>{const _0x2fa6eb=this['_getUid'](_0x298664);ps(_0x298664,'data-id',_0x2fa6eb),this['_touchedNodesState']['newIds']['push'](_0x2fa6eb);}),this['_removeSpecialComments'](_0x3529ca),_0x54266a&&_0x54266a['markUnstableElements']&&this['_markUnstableElements'](_0x3529ca,_0x54266a['markUnstableElementsDepth']||0x0),this['_processWrappedElements'](_0x3529ca,_0x54266a),_0x54266a&&_0x54266a['cutAfterLastChange']&&this['_touchedNodesState']['lastTouchedId']){const _0xa677b7=Is('data-id',this['_touchedNodesState']['lastTouchedId'],_0x3529ca);let _0x38a60d=_0xa677b7[_0xa677b7['length']-0x1];for(;_0x38a60d;)fs(_0x38a60d),_0x38a60d=_0x38a60d['parentNode'];}return{'parsedContent':_0x3529ca,'newNodeIds':this['_touchedNodesState']['newIds'],'modifiedNodeIds':this['_touchedNodesState']['modifiedIds'],'removedNodeIds':this['_touchedNodesState']['removedIds'],'newAnchorIds':_0xf5454};}['_insertNodes'](_0x40e705,_0x3644a8,_0x13a016){for(const _0x449cb3 of _0x3644a8){const _0x36134a=this['_getUid'](_0x449cb3);ps(_0x449cb3,'data-id',_0x36134a),this['_touchedNodesState']['newIds']['push'](_0x36134a),this['_touchedNodesState']['lastTouchedId']=_0x36134a;}const _0x23b640='afterbegin'===_0x13a016||'afterend'===_0x13a016?_0x3644a8['reverse']():_0x3644a8;for(const _0x2cf1b7 of _0x23b640)ms(_0x40e705,_0x2cf1b7,_0x13a016);}['_replaceNode'](_0x527e2d,_0x13d6e7){if(!_0x527e2d)return;if(_0x2a074d=_0x13d6e7,Cs(gs(_0x527e2d))===Cs(gs(_0x2a074d)))return;var _0x2a074d;const _0x1ff8d9=this['_getUid'](_0x527e2d);ps(_0x13d6e7,'data-id',_0x1ff8d9),this['_touchedNodesState']['modifiedIds']['push'](_0x1ff8d9),this['_touchedNodesState']['lastTouchedId']=_0x1ff8d9,_0x292e22(_0x527e2d,_0x13d6e7['cloneNode'](!0x0));}['_removeNode'](_0x1eb200,_0x3e024b,_0x16ed73){if(_0x16ed73&&_0x16ed73['replaceRemovedWith']){this['_touchedNodesState']['lastTouchedId']=_0x3e024b;const _0x2b830a=_0x16ed73['replaceRemovedWith']['cloneNode'](!0x0);ps(_0x2b830a,'data-id',_0x3e024b),ps(_0x2b830a,'data-removed','true'),_0x292e22(_0x1eb200,_0x2b830a);}else _0x5d78f4(_0x1eb200);}['_findReferenceNode'](_0x32428a,_0x3e2323,_0x81b9da){const _0x204ea0=this['_findPrevElementWithDataId'](_0x32428a,!0x1);if(_0x204ea0){const _0x5692e6=this['_getNodeDataId'](_0x204ea0),_0x143d58=As('data-id',_0x5692e6,_0x81b9da);if(_0x143d58)return[_0x143d58,'afterend'];this['_touchedNodesState']['invalidIds']['push'](_0x5692e6);}const _0x343493=this['_findNextElementWithDataId'](_0x32428a,!0x1);if(_0x343493){const _0x19c470=this['_getNodeDataId'](_0x343493),_0x344dc8=As('data-id',_0x19c470,_0x81b9da);if(_0x344dc8)return[_0x344dc8,'beforebegin'];this['_touchedNodesState']['invalidIds']['push'](_0x19c470);}return _0x3e2323?_0x32428a['nextSibling']?this['_findFallbackReferenceNode'](_0x32428a,_0x81b9da):[_0x81b9da['childNodes'][_0x81b9da['childNodes']['length']-0x1],'afterend']:[_0x81b9da['childNodes'][0x0],'beforebegin'];}['_findFallbackReferenceNode'](_0x82eab5,_0x337702){const _0x24ad02=[],_0x2f976e=this['_findPrevElementWithDataId'](_0x82eab5,!0x0);if(_0x2f976e){const _0xadec11=As('data-id',this['_getNodeDataId'](_0x2f976e),_0x337702);_0xadec11&&_0x24ad02['push']([_0xadec11,'afterend']);}const _0x41f273=this['_findNextElementWithDataId'](_0x82eab5,!0x0);if(_0x41f273){const _0x24b057=As('data-id',this['_getNodeDataId'](_0x41f273),_0x337702);_0x24b057&&_0x24ad02['push']([_0x24b057,'beforebegin']);}if(_0x24ad02['length']>0x1)return ws(_0x24ad02[0x0][0x0])<=ws(_0x24ad02[0x1][0x0])?_0x24ad02[0x0]:_0x24ad02[0x1];return 0x1===_0x24ad02['length']?_0x24ad02[0x0]:[_0x337702['lastChild'],'afterend'];}['_findNextElementWithDataId'](_0x7c2370,_0x4eb73d){let _0x4fa20c=_0x7c2370['nextSibling'],_0x5ca5d0=null,_0x3c0dab=!0x1;for(;_0x4fa20c;){if(_0x31c97d(_0x4fa20c)){if(this['_isDelNode'](_0x4fa20c)&&(_0x5ca5d0=_0x4fa20c),this['_isExistingContentComment'](_0x4fa20c)&&_0x4eb73d&&!_0x3c0dab){_0x3c0dab=!0x0,_0x4fa20c=_0x4fa20c['nextSibling'];continue;}break;}const _0x55259c=Es(_0x4fa20c,'data-id');if(_0x55259c&&'new-element'!==_0x55259c&&this['_existingDataIds']['has'](_0x55259c)){_0x5ca5d0=_0x4fa20c;break;}_0x4fa20c=_0x4fa20c['nextSibling'];}return _0x5ca5d0;}['_findPrevElementWithDataId'](_0x4f30ef,_0x3ee94c){let _0x341ec1=_0x4f30ef['previousSibling'],_0x4ed62d=null,_0x197c8e=!0x1;for(;_0x341ec1;){if(_0x31c97d(_0x341ec1)){if(this['_isDelNode'](_0x341ec1)&&(_0x4ed62d=_0x341ec1),this['_isExistingContentComment'](_0x341ec1)&&_0x3ee94c&&!_0x197c8e){_0x197c8e=!0x0,_0x341ec1=_0x341ec1['previousSibling'];continue;}break;}const _0x20b073=Es(_0x341ec1,'data-id');if(_0x20b073&&'new-element'!==_0x20b073&&this['_existingDataIds']['has'](_0x20b073)){_0x4ed62d=_0x341ec1;break;}_0x341ec1=_0x341ec1['previousSibling'];}return _0x4ed62d;}['_markWrappedElements'](_0x2278f3){_0x1d6ab8(_0x2278f3)&&Is('data-id',null,_0x2278f3)['forEach'](_0x58c458=>{this['_isExistingNode'](_0x58c458)&&(ps(_0x58c458,'data-wrapped-id',Es(_0x58c458,'data-id')),ps(_0x58c458,'data-id',null));});}['_processWrappedElements'](_0x2cce61,_0x156265){Is('data-wrapped-id',null,_0x2cce61)['forEach'](_0x3dedad=>{const _0x297c69=Es(_0x3dedad,'data-wrapped-id');if(Es(_0x3dedad,'data-unstable')||this['_hasUnstableParent'](_0x3dedad))return;const _0x5a7a00=As('data-id',_0x297c69,_0x2cce61);ps(_0x3dedad,'data-id',_0x297c69),ps(_0x3dedad,'data-wrapped-id',null),_0x5a7a00&&(this['_removeNode'](_0x5a7a00,_0x297c69,_0x156265),this['_touchedNodesState']['removedIds']['push'](_0x297c69),this['_touchedNodesState']['lastTouchedId']=_0x297c69);});}['_hasUnstableParent'](_0x4c976c){let _0x47553f=_0x4c976c['parentNode'];for(;_0x47553f;){if(Es(_0x47553f,'data-unstable'))return!0x0;_0x47553f=_0x47553f['parentNode'];}return!0x1;}['_getNodeDataId'](_0x18d7f9){if(!_0x18d7f9)return null;if(_0x1d6ab8(_0x18d7f9))return Es(_0x18d7f9,'data-id');if(_0x31c97d(_0x18d7f9)){const _0x17ef53=gs(_0x18d7f9)['match'](/removed[\s*-]data-id="([^"]+)"/);if(_0x17ef53&&_0x17ef53[0x1])return _0x17ef53[0x1];}return null;}['_getUid'](_0x4543f4){return this['_isExistingNode'](_0x4543f4)?Es(_0x4543f4,'data-id'):this['_generateUid']();}['_removeSpecialComments'](_0x57454e){(function(_0x218097){return _0x56818a(_0x5d3dcc=>_0x31c97d(_0x5d3dcc),_0x218097,!0x0,0x1/0x0);}(_0x57454e)['filter'](_0x50f744=>this['_isDelNode'](_0x50f744)||this['_isExistingContentComment'](_0x50f744))['forEach'](_0x2a47c1=>{_0x5d78f4(_0x2a47c1);}));}['_markLastTagElementUnstable'](_0x11cfdf){const _0x1cd3aa=_0x11cfdf['childNodes'],_0x1e725=_0x1cd3aa[_0x1cd3aa['length']-0x1];_0x1e725&&_0x1d6ab8(_0x1e725)&&ps(_0x1e725,'data-unstable','true');}['_markUnstableElements'](_0x2a874c,_0x2dbacf){const _0x29f6c0=As('data-unstable','true',_0x2a874c);if(!_0x29f6c0)return;const _0x2039f0=Ts(_0x29f6c0)['slice'](0x0,-0x1),_0x338e41=_0x2039f0['length'];let _0x497991=_0x29f6c0;if(_0x338e41>_0x2dbacf){let _0x3c7470=_0x338e41,_0x1ba1e0=null;for(;_0x3c7470>_0x2dbacf&&_0x3c7470>=0x0;)_0x3c7470--,_0x1ba1e0=_0x2039f0[_0x3c7470];_0x1ba1e0&&(_0x497991=_0x1ba1e0,ps(_0x29f6c0,'data-unstable',null),ps(_0x1ba1e0,'data-unstable','true'));}else{if(_0x338e41<_0x2dbacf){let _0x25314c=_0x338e41,_0x336b95=_0x29f6c0;for(;_0x25314c<_0x2dbacf;){const _0x3bd3cf=_0x336b95['childNodes']['filter'](_0x1e0347=>_0x1d6ab8(_0x1e0347));if(0x0===_0x3bd3cf['length'])break;_0x25314c++,_0x336b95=_0x3bd3cf[_0x3bd3cf['length']-0x1];}_0x336b95&&(_0x497991=_0x336b95,ps(_0x29f6c0,'data-unstable',null),ps(_0x336b95,'data-unstable','true'));}}let _0x37f7b3=_0x497991;for(;_0x37f7b3;){for(;_0x37f7b3['nextSibling'];)_0x37f7b3=_0x37f7b3['nextSibling'],_0x1d6ab8(_0x37f7b3)&&ps(_0x37f7b3,'data-unstable','true');_0x37f7b3=_0x37f7b3['parentNode'];}}['_isNewNode'](_0x1d0b42){return Boolean('new-element'===Es(_0x1d0b42,'data-id'));}['_isExistingNode'](_0x14130c){return Boolean((Es(_0x14130c,'data-id')||'')['length']>0x0&&'new-element'!==Es(_0x14130c,'data-id'));}['_isDelNode'](_0x3545b8){return!!_0x3545b8&&Boolean(_0x31c97d(_0x3545b8)&&gs(_0x3545b8)['match'](/removed[\s*-]data-id="[^"]+"/));}['_isExistingContentComment'](_0x2b584b){return Boolean(_0x31c97d(_0x2b584b)&&gs(_0x2b584b)['match'](/\s*existing[\s*-](content|document)\s*/g));}}function Rs({editor:_0x4d1225,changeGroups:_0x748937,documentContextContent:_0x35bf50,showDiff:_0x458a3e,trimUnchanged:_0xd0be31=!0x0}){return _0x748937['map'](_0x2832e3=>{const _0x4e1c2f=new _0x290fcd([]),_0x3ecd6b=new _0x290fcd([]),_0x5f373d=new Set();for(const _0x54dc18 of _0x2832e3['changes'])'new'==_0x54dc18['type']&&Is('data-id',null,_0x54dc18['node'])['forEach'](_0x2c1016=>{_0x5f373d['add'](Es(_0x2c1016,'data-id'));});for(const _0x328854 of _0x2832e3['changes'])if('removed'!=_0x328854['type']?_0x3ecd6b['children']['push'](_0x328854['node']['cloneNode'](!0x0)):_0x458a3e||_0x5f373d['has'](_0x328854['id'])||_0x3ecd6b['children']['push'](_0x328854['node']['cloneNode'](!0x0)),'new'!=_0x328854['type']&&(_0x458a3e||'removed'!=_0x328854['type'])){const _0xf18fa7=_0x4f11c1(_0x463af7=>Es(_0x463af7,'data-id')==_0x328854['id'],_0x35bf50,!0x0);_0xf18fa7&&_0x4e1c2f['children']['push'](_0xf18fa7['cloneNode'](!0x0));}const {content:_0xcd1c61,hasChanges:_0x1cc44e}=function(_0x20b2f7,_0x55cbe9,_0x4e6b69,_0x54892f,_0x211d80=!0x0){const _0x530753=_0x20b2f7['plugins']['get']('DocumentCompare'),_0x554a93=gs(_0x55cbe9),_0x55ba18=gs(_0x4e6b69),_0x1924d6=_0x20b2f7['data']['parse'](_0x554a93,'$root'),_0x1ae9be=_0x20b2f7['model']['createPositionAt'](_0x1924d6,0x0),_0xb8462d=_0x530753['getDiff'](_0x554a93,_0x55ba18,{'anchor':_0x1ae9be,'markDeletions':_0x54892f,'targetEditor':_0x20b2f7}),_0x17536a=_0xb8462d['getOperations']();if(0x0==_0x17536a['length'])return{'content':_0x55cbe9['cloneNode'](!0x0),'hasChanges':!0x1};_0x54892f?function(_0x220ac4,_0x26afc9,_0x58333c){if(0x0==_0x220ac4['length'])return;const _0x39b7e9=_0x58333c['plugins']['get']('DocumentCompare'),_0x56bab2=_0x58333c['plugins']['get']('SuggestionsConversion');_0x58333c['model']['change'](_0x2ba006=>{const _0x3689a3=new Set();for(let _0x2c7490=0x0;_0x2c7490<_0x220ac4['length'];_0x2c7490++){const _0x4c89b3=_0x220ac4[_0x2c7490];if(_0x4c89b3['baseVersion']=null,_0x4c89b3['isDocumentOperation']=!0x1,_0x39b7e9['isMarkedRemoveOperation'](_0x4c89b3)){const _0x553cef=_0x2443fd(_0x4c89b3['newRange'],_0x58333c['model']),_0x548822='suggestion:deletion:'+ot()+':$aiSuggestion';_0x26afc9['markers']['set'](_0x548822,_0x553cef);}else switch(_0x4c89b3['type']){case'rename':{if(_0x4c89b3['oldName']==_0x4c89b3['newName'])break;_0x2ba006['batch']['addOperation'](_0x4c89b3),_0x58333c['model']['applyOperation'](_0x4c89b3);const _0x4f40f7='$elementName',_0x4c5a80=_0x4c89b3['position'],_0x4ac662=_0x58333c['model']['createRange'](_0x4c5a80,_0x58333c['model']['createPositionAt'](_0x4c5a80['nodeAfter'],'end')),_0x650619='suggestion:attribute:'+_0x4f40f7+':'+ot()+':$aiSuggestion';_0x26afc9['markers']['set'](_0x650619,_0x4ac662);break;}case'addAttribute':case'removeAttribute':case'changeAttribute':{if(_0x4c89b3['oldValue']==_0x4c89b3['newValue'])break;_0x2ba006['batch']['addOperation'](_0x4c89b3),_0x58333c['model']['applyOperation'](_0x4c89b3);const _0x45ae4c=_0x4c89b3['key'];if(!_0x56bab2['isRegisteredAttribute'](_0x45ae4c))break;const _0x49a46d=_0x2443fd(_0x4c89b3['range'],_0x58333c['model']),_0x213aea='suggestion:attribute:'+_0x45ae4c+':'+ot()+':$aiSuggestion';_0x26afc9['markers']['set'](_0x213aea,_0x49a46d);break;}case'insert':{_0x2ba006['batch']['addOperation'](_0x4c89b3),_0x58333c['model']['applyOperation'](_0x4c89b3);if(_0x220ac4[_0x2c7490+0x1]&&'move'==_0x220ac4[_0x2c7490+0x1]['type']){Os(_0x26afc9,_0x4c89b3);break;}const _0x25cd07=_0x4c89b3['position'],_0x5c7d73=_0x4c89b3['howMany'],_0x4b5244=_0x2443fd(_0x58333c['model']['createRange'](_0x25cd07,_0x25cd07['getShiftedBy'](_0x5c7d73)),_0x58333c['model']),_0x328783='suggestion:insertion:'+ot()+':$aiSuggestion';_0x26afc9['markers']['set'](_0x328783,_0x4b5244);break;}case'split':{_0x2ba006['batch']['addOperation'](_0x4c89b3),_0x58333c['model']['applyOperation'](_0x4c89b3);const _0x37b127=_0x4c89b3['splitPosition'],_0x572714=_0x4c89b3['moveTargetPosition'],_0x239632=_0x58333c['model']['createRange'](_0x37b127,_0x572714),_0x1da3d8='suggestion:insertion:'+ot()+':$aiSuggestion';_0x26afc9['markers']['set'](_0x1da3d8,_0x239632);break;}case'move':{_0x2ba006['batch']['addOperation'](_0x4c89b3),_0x58333c['model']['applyOperation'](_0x4c89b3),_0x220ac4[_0x2c7490-0x1]&&'insert'==_0x220ac4[_0x2c7490-0x1]['type']&&Os(_0x26afc9,_0x4c89b3);const _0xa8bd52=_0x4c89b3['getMovedRangeStart'](),_0x508736=_0x4c89b3['howMany'];for(let _0x264f98=0x0;_0x264f98<_0x508736;_0x264f98++){const _0x13941c=_0xa8bd52['getShiftedBy'](_0x264f98)['nodeAfter'];_0x3689a3['add'](_0x13941c);}break;}case'remove':{const _0x174fef=_0x4c89b3['sourcePosition'],_0x2832b3=_0x4c89b3['howMany'],_0x35d4b6=new _0x48a283(_0x174fef,_0x2832b3);_0x2ba006['batch']['addOperation'](_0x35d4b6),_0x58333c['model']['applyOperation'](_0x35d4b6);break;}}}for(const _0x2c1b97 of _0x3689a3){const _0xbb67e0=_0x58333c['model']['createRangeOn'](_0x2c1b97),_0x299cbb='suggestion:formatBlock:$fakeWrap:'+ot()+':$aiSuggestion';_0x26afc9['markers']['set'](_0x299cbb,_0x2443fd(_0xbb67e0,_0x58333c['model']));}});}(_0x17536a,_0x1924d6,_0x20b2f7):_0x20b2f7['model']['change'](_0x2ff02d=>{for(const _0x199915 of _0x17536a)if('remove'==_0x199915['type']){const _0x3bfff0=_0x199915['sourcePosition'],_0x393b9f=_0x199915['howMany'],_0x5280b3=new _0x48a283(_0x3bfff0,_0x393b9f);_0x2ff02d['batch']['addOperation'](_0x5280b3),_0x20b2f7['model']['applyOperation'](_0x5280b3);}else{if('marker'==_0x199915['type']){const _0x2c71f2=_0x199915['name'],_0x247520=_0x199915['newRange'];null!==_0x247520?_0x1924d6['markers']['set'](_0x2c71f2,_0x247520):_0x1924d6['markers']['delete'](_0x2c71f2);}else _0x199915['baseVersion']=null,_0x199915['isDocumentOperation']=!0x1,_0x2ff02d['batch']['addOperation'](_0x199915),_0x20b2f7['model']['applyOperation'](_0x199915);}});if(_0x211d80){const _0x53a2a1=ks(_0x20b2f7,_0x17536a,_0x1924d6);Ns(_0x20b2f7['model'],_0x53a2a1),function(_0x2506b9,_0x59e694){const _0x111bce=_0x59e694['getFirstRange']()['start'];let _0x361e00=_0x59e694['getFirstRange']()['end'];const _0x51c76d=_0x111bce['root'];(_0x361e00['textNode']||_0x361e00['nodeAfter']&&_0x361e00['nodeAfter']['is']('$text'))&&(_0x3f2c26(_0x361e00,'...'),_0x361e00=_0x361e00['getShiftedBy'](0x3)),(_0x111bce['textNode']||_0x111bce['nodeBefore']&&_0x111bce['nodeBefore']['is']('$text'))&&(_0x3f2c26(_0x111bce,'...'),function(_0x53f5b8,_0x44909a,_0x4d1560){for(let [_0x261dc9,_0x3d0840]of _0x53f5b8['markers']){const _0x163858=_0x3d0840['_getTransformedByInsertion'](_0x44909a,_0x4d1560,!0x1);_0x3d0840=_0x163858[0x0],_0x53f5b8['markers']['set'](_0x261dc9,_0x3d0840);}}(_0x51c76d,_0x111bce,0x3),_0x111bce['parent']==_0x361e00['parent']&&(_0x361e00=_0x361e00['getShiftedBy'](0x3)));const _0x45c580=_0x2506b9['createRange'](_0x2506b9['createPositionAt'](_0x51c76d,0x0),_0x111bce),_0x53881f=_0x2506b9['createRange'](_0x361e00,_0x2506b9['createPositionAt'](_0x51c76d,'end')),_0x4cb029=[..._0x45c580['getMinimalFlatRanges'](),..._0x53881f['getMinimalFlatRanges']()];_0x4cb029['reverse']();for(const _0x376c17 of _0x4cb029)_0x1d04c0(_0x376c17),ys(_0x51c76d,_0x376c17);}(_0x20b2f7['model'],_0x53a2a1);}const _0x4b2883=_0x20b2f7['data']['stringify'](_0x1924d6,{'showSuggestionHighlights':!0x0});return{'content':_s(_0x4b2883),'hasChanges':!0x0};}(_0x4d1225,_0x4e1c2f,_0x3ecd6b,_0x458a3e,_0xd0be31);return{'type':_0x2832e3['changes'][0x0]['type'],'index':_0x2832e3['index'],'content':_0xcd1c61,'hasChanges':_0x1cc44e};});}function Os(_0x9c319e,_0x4cbd0c){for(const [_0x424b98,_0x5db8ec]of _0x9c319e['markers']){const _0x4e753a=_0x5ca4e8['_createFromRanges'](_0x5db8ec['getTransformedByOperation'](_0x4cbd0c));_0x9c319e['markers']['set'](_0x424b98,_0x4e753a);}}function ks(_0x537ec6,_0x5df134,_0x4bdfb8){const _0x1992a0=_0x537ec6['plugins']['get']('DocumentCompare');let _0x1cc162=_0x537ec6['model']['createPositionAt'](_0x4bdfb8,Number['POSITIVE_INFINITY']),_0x50b4c8=_0x537ec6['model']['createPositionAt'](_0x4bdfb8,0x0);for(const _0x505728 of _0x5df134){let _0x4fbf46,_0x2d244d;if(_0x1992a0['isMarkedRemoveOperation'](_0x505728))_0x4fbf46=_0x505728['newRange']['start'],_0x2d244d=_0x505728['newRange']['end'];else switch(_0x1cc162=_0x1cc162['getTransformedByOperation'](_0x505728),_0x50b4c8=_0x50b4c8['getTransformedByOperation'](_0x505728),_0x505728['type']){case'rename':_0x4fbf46=_0x505728['position'],_0x2d244d=_0x4fbf46['getShiftedBy'](0x1);break;case'addAttribute':case'removeAttribute':case'changeAttribute':_0x4fbf46=_0x505728['range']['start'],_0x2d244d=_0x505728['range']['end'];break;case'insert':_0x4fbf46=_0x505728['position'],_0x2d244d=_0x4fbf46['getShiftedBy'](_0x505728['howMany']);break;case'split':_0x4fbf46=_0x505728['splitPosition'],_0x2d244d=_0x505728['moveTargetPosition'];break;case'merge':{const _0x56fddf=_0x505728['targetPosition']['path']['slice'](0x0,-0x1);_0x4fbf46=_0x537ec6['model']['createPositionFromPath'](_0x4bdfb8,_0x56fddf),_0x2d244d=_0x4fbf46['getShiftedBy'](0x1);break;}case'move':case'remove':{const _0x18a8b8=_0x505728['howMany'],_0x2563c4=_0x505728['sourcePosition']['_getTransformedByInsertion'](_0x505728['targetPosition'],_0x18a8b8),_0x437f5a=_0x505728['getMovedRangeStart']();'remove'==_0x505728['type']?(_0x4fbf46=_0x2563c4,_0x2d244d=_0x2563c4):(_0x4fbf46=_0x437f5a,_0x2d244d=_0x437f5a['getShiftedBy'](_0x18a8b8));break;}}_0x4fbf46&&_0x4fbf46['isBefore'](_0x1cc162)&&(_0x1cc162=_0x4fbf46['clone'](),_0x1cc162['stickiness']='toNone'),_0x2d244d&&_0x2d244d['isAfter'](_0x50b4c8)&&(_0x50b4c8=_0x2d244d['clone'](),_0x50b4c8['stickiness']='toNone');}return _0x537ec6['model']['createSelection'](_0x537ec6['model']['createRange'](_0x1cc162,_0x50b4c8));}function Ns(_0x3410dd,_0x49ee97){vs(_0x3410dd,_0x49ee97,'forward');const _0x474624=_0x49ee97['getFirstRange']();_0x49ee97['setTo']([]),_0x49ee97['setTo'](_0x474624,{'backward':!0x0}),vs(_0x3410dd,_0x49ee97,'backward');}function vs(_0x269dd6,_0x5d5fb9,_0x44956e){let _0x20d8ec=0x14;for(;_0x20d8ec;){_0x269dd6['modifySelection'](_0x5d5fb9,{'unit':'word','direction':_0x44956e}),_0x20d8ec--;const _0x3476a0=_0x5d5fb9['focus']['forward'==_0x44956e?'nodeBefore':'nodeAfter'];if(_0x3476a0&&_0x3476a0['is']('element')&&_0x269dd6['schema']['isBlock'](_0x3476a0)&&_0x269dd6['schema']['isObject'](_0x3476a0))break;}}function ys(_0x24a204,_0x37e479){for(const [_0x54c82f,_0xdbd244]of _0x24a204['markers']){const _0xacdbdf=_0xdbd244['_getTransformedByDeletion'](_0x37e479['start'],_0x37e479['end']['offset']-_0x37e479['start']['offset']);null!=_0xacdbdf?_0x24a204['markers']['set'](_0x54c82f,_0xacdbdf):_0x24a204['markers']['delete'](_0x54c82f);}}class xs extends ht(){['id'];['interactionId'];['type'];['sources']=[];['parsedContent']=new _0x290fcd([]);['parsedMergedContent']=new _0x290fcd([]);['changeGroups']=[];['areActionsDisabled']=!0x1;['isFromHistory']=!0x1;['documentContextContent'];['documentId'];['dataIdDocumentSources'];['newNodeAnchorIds']=new Map();['aiResponseParser'];['aiResponseApplier'];['locale'];['cachedSuggestionContentParts']={'withDiff':[],'withoutDiff':[]};constructor({type:_0x12fe39,content:_0x1dea6f='',isDone:_0x3837f1=!0x1,isComplete:_0x152cca,interactionId:_0x8be45e,areActionsDisabled:_0x42a7b7,isFromHistory:_0x268a5e=!0x1,documentContextContent:_0x882df4,dataIdDocumentSources:_0x14be30,documentId:_0x5ab413,locale:_0x127fa2,id:_0x136320}){super(),this['id']=_0x136320||ot(),this['interactionId']=_0x8be45e,this['type']=_0x12fe39,this['areActionsDisabled']=!!_0x42a7b7,this['locale']=_0x127fa2,this['dataIdDocumentSources']=_0x14be30,this['documentId']=_0x5ab413,this['isFromHistory']=_0x268a5e,this['aiResponseParser']=new bs(),this['aiResponseApplier']=new Ss(),this['documentContextContent']=_s(_0x882df4||''),this['set']('isDone',_0x3837f1),this['set']('isComplete',_0x152cca??_0x3837f1),this['on']('change:content',()=>{this['onContentChange']();}),this['set']('content',_0x1dea6f);}['appendContent'](_0x413b98){this['set']('content',this['content']+_0x413b98);}['done'](_0x54f9a4=!0x0){this['isComplete']=_0x54f9a4,this['isDone']||(this['set']('isDone',!0x0),this['onContentChange']());}['destroy'](){this['stopListening']();}['setChangeGroupState'](_0x4e7ec3,_0x596a4f){this['changeGroups'][_0x4e7ec3]['state']=_0x596a4f,this['fire']('replyChangeGroupStateUpdated',{'reply':this,'index':_0x4e7ec3,'state':_0x596a4f});}['getContentParts']({showDiff:_0x4dae53,groupIndex:_0x17ba31,editor:_0x3deb10}){const _0x27ee6c=this['_getCachedContentParts'](_0x4dae53,_0x17ba31);if(_0x27ee6c)return _0x27ee6c;let _0x43424f=[];if(void 0x0===_0x17ba31)_0x43424f=this['changeGroups'];else{const _0x33c6f2=this['changeGroups']['find'](({index:_0x4ab9a7})=>_0x4ab9a7===_0x17ba31);if(!_0x33c6f2)throw new at('ai-reply-get-content-parts-group-not-found',null,{'aiReply':this,'groupIndex':_0x17ba31});_0x43424f=[_0x33c6f2];}const _0x451233=Rs({'editor':_0x3deb10,'showDiff':_0x4dae53,'changeGroups':_0x43424f,'documentContextContent':this['documentContextContent']});return this['_setCachedContentParts'](_0x4dae53,_0x451233),_0x451233;}['_getCachedContentParts'](_0xcebd3d,_0xaa9b35){const _0x19e1a6=_0xcebd3d?'withDiff':'withoutDiff';if(!this['cachedSuggestionContentParts'][_0x19e1a6]['length'])return null;const _0x3da507=this['cachedSuggestionContentParts'][_0x19e1a6];if(void 0x0===_0xaa9b35)return _0x3da507['length']>0x0&&_0x3da507['length']!==this['changeGroups']['length']?(this['_setCachedContentParts'](_0xcebd3d,null),null):_0x2d7474(_0x3da507);{const _0x31d80a=_0x3da507['find'](({index:_0x6167b1})=>_0x6167b1===_0xaa9b35);if(_0x31d80a)return[_0x2d7474(_0x31d80a)];}return null;}['_setCachedContentParts'](_0xdc8f41,_0x1115a6){const _0x4548fb=_0xdc8f41?'withDiff':'withoutDiff';_0x1115a6?_0x1115a6['forEach'](_0xaa6475=>{const _0x1a2c41=this['cachedSuggestionContentParts'][_0x4548fb],_0x49d027=_0x1a2c41['find'](({index:_0x15e153})=>_0x15e153===_0xaa6475['index']);if(_0x49d027){const _0x17d8c4=_0x1a2c41['indexOf'](_0x49d027);_0x1a2c41['splice'](_0x17d8c4,0x1,_0xaa6475);}else _0x1a2c41['push'](_0xaa6475);}):this['cachedSuggestionContentParts'][_0x4548fb]['length']=0x0;}['onContentChange'](){if('modification'===this['type']){this['parsedContent']=this['aiResponseParser']['parseAndNormalizeHTML'](this['content']);const _0x2346c0=this['changeGroups'];this['updateChangeGroups']();const _0x33ef13=this['_getDifferentChangeGroups'](_0x2346c0,this['changeGroups']);(_0x33ef13['length']||this['isDone'])&&(this['fire']('replyContentUpdated',this,_0x33ef13),this['cachedSuggestionContentParts']['withDiff']['length']=this['cachedSuggestionContentParts']['withoutDiff']['length']=0x0);}else this['parsedContent']=this['aiResponseParser']['convertMarkdownToHTML'](this['content']),this['fire']('replyContentUpdated',this);}['_getDifferentChangeGroups'](_0x18becd,_0x322f0d){const _0x10773c=[];for(const _0x443d0f of _0x322f0d){const _0x2d1089=_0x18becd[_0x443d0f['index']];_0x2d1089?_0x2d1089['changes']['length']!==_0x443d0f['changes']['length']?_0x10773c['push'](_0x443d0f):_0x2d1089['changes']['forEach']((_0x30db50,_0x3033e6)=>{const _0x340f1f=_0x443d0f['changes'][_0x3033e6];_0x30db50['id']!==_0x340f1f['id']&&_0x10773c['push'](_0x443d0f);}):_0x10773c['push'](_0x443d0f);}return _0x10773c;}['updateChangeGroups'](){const _0xe028a6=this['locale']?new _0x244f1b('p',{},[new _0x244f1b('span',{'style':'color:\x20#808080;\x20font-style:\x20italic'},[new _0x592fb4(hs(this['locale'],'AI_SUGGESTION_CONTENT_PART_REMOVED'))])]):void 0x0,_0x1f0a04=this['aiResponseApplier']['merge'](this['parsedContent'],this['documentContextContent']['cloneNode'](!0x0),{'markUnstableElements':!this['isDone']||!this['isComplete'],'replaceRemovedWith':_0xe028a6,'cutAfterLastChange':!this['isDone']||!this['isComplete']});if(!_0x1f0a04['modifiedNodeIds']['length']&&!this['isDone'])return;this['parsedMergedContent']=_0x1f0a04['parsedContent'],this['newNodeAnchorIds']=_0x1f0a04['newAnchorIds'];let _0x1bc78b=[];if(_0x49c4b8(_0x889e3b=>{const _0xa2eedb=Es(_0x889e3b,'data-id');if(!_0xa2eedb||!_0x3ab711(_0xa2eedb))return!0x1;const _0x4d1c5c=[_0x889e3b,...Ts(_0x889e3b)]['at'](-0x2);if(_0x889e3b!=_0x4d1c5c){const _0x56faa5=Es(_0x4d1c5c,'data-id');_0x3ab711(_0x56faa5)||(_0x1bc78b['push']({'node':_0x4d1c5c,'id':_0x56faa5,'type':'modified'}),_0x1f0a04['modifiedNodeIds']['push'](_0x56faa5));}else _0x1f0a04['modifiedNodeIds']['includes'](_0xa2eedb)?_0x1bc78b['push']({'node':_0x889e3b,'type':'modified','id':_0xa2eedb}):_0x1f0a04['newNodeIds']['includes'](_0xa2eedb)?_0x1bc78b['push']({'node':_0x889e3b,'type':'new','id':_0xa2eedb,'anchorId':Es(_0x889e3b['previousSibling'],'data-id')}):_0x1bc78b['push']({'node':_0x889e3b,'type':'removed','id':_0xa2eedb});return!0x0;},this['parsedMergedContent']),_0x1bc78b=_0x1bc78b['filter'](({node:_0x3f18a7})=>[...Ts(_0x3f18a7),_0x3f18a7]['every'](_0x13a9ec=>!Es(_0x13a9ec,'data-unstable'))),0x0==_0x1bc78b['length'])return;const _0x55320d=[[_0x1bc78b[0x0]]];for(let _0x3d9864=0x1;_0x3d9864<_0x1bc78b['length'];_0x3d9864++){const _0x4af982=_0x55320d[_0x55320d['length']-0x1],_0x12c1b7=_0x4af982[_0x4af982['length']-0x1];_0x1bc78b[_0x3d9864]['node']['previousSibling']==_0x12c1b7['node']&&'modified'!=_0x1bc78b[_0x3d9864]['type']&&'modified'!=_0x12c1b7['type']&&this['_isSameDocument'](_0x1bc78b[_0x3d9864]['node'],_0x12c1b7['node'])?_0x4af982['push'](_0x1bc78b[_0x3d9864]):_0x55320d['push']([_0x1bc78b[_0x3d9864]]);}for(const _0x457461 of _0x55320d){const _0x2bd0cc=_0x457461[0x0],_0x66cfd7=_0x457461[_0x457461['length']-0x1],_0x12616=_0x5034de(_0x2bd0cc['node']['previousSibling']);_0x12616&&this['_isSameDocument'](_0x12616['node'],_0x2bd0cc['node'])&&_0x457461['unshift'](_0x12616);const _0x35e559=_0x5034de(_0x66cfd7['node']['nextSibling']);_0x35e559&&this['_isSameDocument'](_0x35e559['node'],_0x66cfd7['node'])&&_0x457461['push'](_0x35e559);}function _0x3ab711(_0x616c59){return _0x1f0a04['modifiedNodeIds']['includes'](_0x616c59)||_0x1f0a04['newNodeIds']['includes'](_0x616c59)||_0x1f0a04['removedNodeIds']['includes'](_0x616c59);}function _0x5034de(_0x29cea5){if(_0x29cea5&&Es(_0x29cea5,'data-id')&&!Es(_0x29cea5,'data-unstable')){const _0x254d20=Es(_0x29cea5,'data-id');if(!_0x3ab711(_0x254d20))return{'node':_0x29cea5,'type':'context','id':_0x254d20};}return null;}this['changeGroups']=_0x55320d['map']((_0x43a108,_0x170a44)=>({'changes':_0x43a108,'state':'pending','index':_0x170a44}));}['_isSameDocument'](_0x3ccf2f,_0x40193a){if(!this['dataIdDocumentSources']?.['size'])return!0x0;const _0x4d4452=this['_resolveDocumentSource'](_0x3ccf2f),_0x1997d0=this['_resolveDocumentSource'](_0x40193a);return!_0x4d4452||!_0x1997d0||_0x4d4452['editor']===_0x1997d0['editor']&&_0x4d4452['rootName']===_0x1997d0['rootName'];}['_resolveDocumentSource'](_0x2e858d){if(!_0x2e858d||!this['dataIdDocumentSources'])return;const _0x4e5632=Es(_0x2e858d,'data-id');if(_0x4e5632){const _0x123ba6=this['dataIdDocumentSources']['get'](_0x4e5632);if(_0x123ba6)return _0x123ba6;const _0x2c2e35=this['newNodeAnchorIds']['get'](_0x4e5632),_0x4f0011=_0x2c2e35?this['dataIdDocumentSources']['get'](_0x2c2e35):void 0x0;if(_0x4f0011)return _0x4f0011;}for(let _0x59fb54=_0x2e858d['previousSibling'];_0x59fb54;_0x59fb54=_0x59fb54['previousSibling']){const _0x1825cc=Es(_0x59fb54,'data-id'),_0x2d8295=_0x1825cc?this['dataIdDocumentSources']['get'](_0x1825cc):void 0x0;if(_0x2d8295)return _0x2d8295;}for(let _0x527d03=_0x2e858d['nextSibling'];_0x527d03;_0x527d03=_0x527d03['nextSibling']){const _0x983c78=Es(_0x527d03,'data-id'),_0x460bbe=_0x983c78?this['dataIdDocumentSources']['get'](_0x983c78):void 0x0;if(_0x460bbe)return _0x460bbe;}}}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:_0xef6479,locale:_0x71a20c}){super(),this['id']=ot(),this['connector']=_0xef6479,this['isStopped']=!0x0,this['locale']=_0x71a20c;}async['start'](){const _0x538839=[];let _0x41e5ba,_0x3749ee,_0x88fb87,_0x1060f3=!0x1;this['isStopped']=!0x1;try{this['currentRequest']=await this['sendRequest'](),this['fire']('interactionStarted',this);const _0x5a9cb6=await this['currentRequest']['getStream']();for await(const _0x393601 of _0x5a9cb6){if(this['isStopped'])return;if('error'==_0x393601['event'])return void this['fire']('error',{'error':new at('ai-chat-interaction-error',this)});switch(_0x393601['event']){case'message-metadata':this['messageId']=_0x393601['data']['messageId'];break;case'action-metadata':this['actionCallId']=_0x393601['data']['callId'];break;case'conversation-title':this['setConversationTitle'](_0x393601['data']['conversationTitle'],!0x0);break;case'source':_0x538839['push'](_0x393601['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'](),_0x41e5ba='modification-delta'==_0x393601['event']?'modification':'text',_0x3749ee='modification-delta'==_0x393601['event']?_0x393601['data']['id']:void 0x0,this['currentReply']&&this['currentReply']['type']!=_0x41e5ba&&(this['currentReply']['done'](),this['currentReply']=void 0x0),this['currentReply']?'modification-delta'==_0x393601['event']&&(this['currentReply']['documentId']=_0x393601['data']['documentId']):(this['currentReply']=this['createReply']({'type':_0x41e5ba,'interactionId':this['id'],'id':_0x3749ee,...'modification-delta'==_0x393601['event']&&{'documentId':_0x393601['data']['documentId']}}),'modification'==_0x41e5ba&&(this['currentReply']['sources']=_0x538839['splice'](0x0))),this['currentReply']['appendContent'](_0x393601['data']['textDelta']);break;case'mcp-tool-result':_0x88fb87=JSON['parse'](_0x393601['data']['result']),this['_handleToolResultData']({'toolName':_0x393601['data']['toolName'],'data':_0x88fb87['data'],'attributes':_0x88fb87['attributes']});break;case'mcp-tool-notification':this['_handleToolNotificationData']({'toolName':_0x393601['data']['toolName'],'data':_0x393601['data']['data']});}}_0x1060f3=!0x0;}finally{this['isStopped']||(this['currentReply']&&_0x538839['length']>0x0&&(this['currentReply']['sources']=_0x538839['splice'](0x0)),this['_finalizeInteraction'](_0x1060f3),this['fire']('interactionFinished',this));}}['stop'](){this['isStopped']||(this['_finalizeInteraction'](),this['fire']('interactionStopped',this));}['getReply'](_0x572a24){return this['replies']['find'](_0x139ab3=>_0x139ab3['id']===_0x572a24);}['destroy'](){this['isDestroyed']||(this['stop'](),this['replies']['forEach'](_0x4f2b90=>_0x4f2b90['destroy']()),this['replies']=[],this['isDestroyed']=!0x0,this['fire']('interactionDestroyed',this),this['stopListening']());}['createReply'](_0x55ec03){const _0x14170c=new xs({'locale':this['locale'],'documentContextContent':this['getDocumentContext']()?.['content'],'dataIdDocumentSources':this['getDocumentContext']()?.['dataIdDocumentSources'],..._0x55ec03});return this['replies']['push'](_0x14170c),_0x14170c['delegate'](...Ls)['to'](this),this['fire']('replyCreated',_0x14170c),_0x14170c;}['setConversationTitle'](_0x35047b,_0x1215d8=!0x1){this['fire']('setConversationTitle',_0x35047b,_0x1215d8);}['resetWebSearchState'](){this['_isWebSearching']&&(this['_isWebSearching']=!0x1,this['fire']('webSearchFinished',this));}['resetReasoningState'](){this['_isReasoning']&&(this['_isReasoning']=!0x1,this['fire']('reasoningFinished',this));}['_handleToolResultData'](_0x531732){this['fire']('toolDataReceived',{'type':'result','toolName':_0x531732['toolName'],'data':structuredClone(_0x531732['data']||{}),'attributes':structuredClone(_0x531732['attributes']||{})},this);}['_handleToolNotificationData'](_0x2ecc87){this['fire']('toolDataReceived',{'type':'notification','toolName':_0x2ecc87['toolName'],'data':structuredClone(_0x2ecc87['data'])},this);}['_finalizeInteraction'](_0x46a11e=!0x1){this['isStopped']=!0x0,this['currentRequest']&&this['currentRequest']['abortController']['abort'](),this['currentReply']&&this['currentReply']['done'](_0x46a11e),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:_0x5d52f9,config:_0x4e6ee7,ownerId:_0x3e4e02}){super(),this['_connector']=_0x5d52f9,this['_config']=_0x4e6ee7,this['_ownerId']=_0x3e4e02;}['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'](_0x3a89f1){if(_0x3a89f1)return this['_documentSources']['get'](_0x3a89f1);}['getSourceByDataId'](_0xdef55e){if(_0xdef55e)return this['_dataIdToSource']['get'](_0xdef55e);}['_getDocumentContextSlice'](_0x341840){const _0x55dff5=this['_getDocumentSource'](_0x341840);if(_0x55dff5)return{'editor':_0x55dff5['editor'],'rootName':_0x55dff5['rootName'],'html':_0x55dff5['content'],'version':_0x55dff5['version']};}['getDocumentContextSliceByDataId'](_0x27732d){const _0x4c1181=this['getSourceByDataId'](_0x27732d);return _0x4c1181?this['_getDocumentContextSlice'](_0x4c1181['documentId']):void 0x0;}['getPendingContextItems'](){return this['_pendingContextItems'];}async['populateFromMessage'](_0x29be45){const _0x479dce=await this['_createContextItemFromContent'](_0x29be45);return this['_addToConversationContextItem'](_0x479dce),'current-document'===_0x479dce['uiId']&&this['_toggleAddCurrentDocumentOptionVisibility'](),_0x479dce;}async['populateDocumentsFromMessage'](_0x5758de,_0x3dfcba){const _0x26cbd4=_0x5758de['filter'](_0x2b3557=>'document'===_0x2b3557['type']);if(0x0===_0x26cbd4['length'])return{'hasUnmatched':!0x1};if(0x1===_0x26cbd4['length'])return{'contextItem':await this['populateFromMessage'](_0x26cbd4[0x0]),'hasUnmatched':!0x1};const _0x5ea907=_0x26cbd4['map'](_0x26d5d9=>_0x26d5d9['id']),_0x121597=await this['_connector']['fetchDocuments'](this['_ownerId'],_0x5ea907)['getDocuments'](),_0x226bc2=new Map(_0x121597['map'](_0x519580=>[_0x519580['id'],_0x519580]));this['_documentSources']['clear'](),this['_dataIdToSource']['clear']();const _0x54506a=[];let _0x2f6f91=!0x1;for(const _0x57b08b of _0x26cbd4){const _0x196988=_0x226bc2['get'](_0x57b08b['id']);if(!_0x196988)continue;const _0x5ac4f1=this['_matchDocumentToRoot'](_0x196988,_0x3dfcba),_0x44f4b5=_0x3dfcba[0x0]&&this['_getFirstRoot'](_0x3dfcba[0x0]);_0x5ac4f1||(_0x2f6f91=!0x0);const _0x50a4b9=_0x5ac4f1?.['editor']??_0x44f4b5?.['editor'],_0x3971e4=_0x5ac4f1?.['rootName']??_0x44f4b5?.['rootName'];if(_0x50a4b9&&_0x3971e4){const _0x1b9ccd={'editor':_0x50a4b9,'rootName':_0x3971e4,'content':_0x196988['content'],'version':_0x196988['attributes']?.['version']??0x0,'name':_0x196988['name'],'description':_0x196988['description']};this['_documentSources']['set'](_0x196988['id'],_0x1b9ccd);const _0x2446ac=_s(_0x196988['content']);for(const _0xfb4efc of _0x49c4b8(_0x4e7d9f=>!!Es(_0x4e7d9f,'data-id'),_0x2446ac)){const _0x44759f=Es(_0xfb4efc,'data-id');_0x44759f&&this['_dataIdToSource']['set'](_0x44759f,{..._0x1b9ccd,'documentId':_0x196988['id']});}}_0x54506a['push']({'id':_0x196988['id'],'content':_0x196988['content'],'version':_0x196988['attributes']?.['version']??0x0,'sessionId':_0x196988['attributes']?.['sessionId']??null,'selection':[]});}const _0x3e5704={'id':'current-document','uiId':'current-document','label':'Current\x20document','type':'document','hidden':this['_conversationContextItems']['has']('current-document'),'documents':_0x54506a,'dataIdDocumentSources':new Map(this['_dataIdToSource'])};return this['_addToConversationContextItem'](_0x3e5704),this['_toggleAddCurrentDocumentOptionVisibility'](),{'contextItem':_0x3e5704,'hasUnmatched':_0x2f6f91};}['_matchDocumentToRoot'](_0x50ff58,_0x50e056){const _0xd3283=_0x50ff58['attributes']?.['channelId'],_0x54ff42=_0x50ff58['attributes']?.['rootName'];if(_0xd3283&&_0x54ff42){for(const _0x54e30b of _0x50e056)if(_0x54e30b['config']['get']('collaboration.channelId')===_0xd3283){for(const _0x27ce6e of _0x54e30b['model']['document']['getRoots']())if('$graveyard'!==_0x27ce6e['rootName']&&_0x27ce6e['rootName']===_0x54ff42)return{'editor':_0x54e30b,'rootName':_0x27ce6e['rootName']};}}}['_getFirstRoot'](_0x3898ad){for(const _0x5c73a8 of _0x3898ad['model']['document']['getRoots']())if('$graveyard'!==_0x5c73a8['rootName'])return{'editor':_0x3898ad,'rootName':_0x5c73a8['rootName']};}async['_createContextItemFromContent'](_0x18518f){if('document'===_0x18518f['type']){const _0x1d28ca=await this['_connector']['fetchDocument'](this['_ownerId'],_0x18518f['id'])['getDocument']();return{'id':'current-document','uiId':'current-document','label':'Current\x20document','type':_0x18518f['type'],'content':_0x1d28ca['content'],'hidden':this['_conversationContextItems']['has']('current-document'),'version':_0x1d28ca['attributes']?.['version'],'sessionId':_0x1d28ca['attributes']?.['sessionId']};}if('mcp-tool-context'===_0x18518f['type'])return{'id':_0x18518f['id'],'uiId':_0x18518f['id'],'label':_0x18518f['data']?.['label']||_0x18518f['id'],'type':'mcp-tool-context','mcpServerName':_0x18518f['mcpServerName'],'toolName':_0x18518f['toolName'],'data':_0x18518f['data']||{}};return{'id':_0x18518f['id'],'uiId':_0x18518f['id'],'label':_0x18518f['attributes']?.['label']||_0x18518f['name']||_0x18518f['url']||_0x18518f['id'],'type':_0x18518f['type'],..._0x18518f?.['attributes']?.['resourceId']?{'resourceId':_0x18518f['attributes']?.['resourceId']}:{}};}['getSentContextItems'](){return new Map(this['_conversationContextItems']);}['removeFromContext'](_0x2aea98){const _0x332405=this['_pendingContextItems']['get'](_0x2aea98);_0x332405?.['isReadOnly']||this['_removeContextItem'](_0x2aea98);}['clearPendingContextItems'](){if(0x0===this['_pendingContextItems']['size'])return;for(const _0x56d699 of this['_pendingContextItems']['values']())this['_removeContextItem'](_0x56d699['uiId']);const _0xc9a006=this['_conversationContextItems']['get']('current-document')||this['_pendingContextItems']['get']('current-document');_0xc9a006&&this['_addContextItem']({..._0xc9a006,'isReadOnly':!0x0,'hidden':!0x0});}['addToConversationContext'](_0x3dd080){for(const _0x5a932e of _0x3dd080['values']())this['_addToConversationContextItem'](_0x5a932e);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'](_0x503751){return Array['from'](_0x503751['values']())['flatMap'](_0x14c165=>this['_mapContextItemToRequestData'](_0x14c165));}async['addFilesToContext'](_0x1921dc,_0x1ed9ba,_0x58237a='file'){const _0x34e45e='files-'+ot();this['_startUploadOperation'](_0x34e45e);try{await Promise['all'](_0x1921dc['map'](async _0x512984=>{const _0x4f2407='file-'+ot(),_0x41d136=_0x5aed4a(_0x512984['name']);try{this['_addContextItem']({'type':_0x58237a,'label':_0x1ed9ba?.['label']||_0x41d136,'uiId':_0x4f2407,'resourceId':_0x1ed9ba?.['resourceId']},!0x0);const _0x35f7e9=this['_connector']['uploadFile'](this['_ownerId'],_0x512984,_0x1ed9ba);this['_ongoingUploads']['set'](_0x4f2407,_0x35f7e9['abortController']);const {id:_0x28e5a0}=await _0x35f7e9['getId']();this['_ongoingUploads']['delete'](_0x4f2407),this['_finishContextItemLoading']({'type':_0x58237a,'id':_0x28e5a0,'label':_0x1ed9ba?.['label']||_0x41d136,'uiId':_0x4f2407,'resourceId':_0x1ed9ba?.['resourceId']},!0x1);}catch(_0x3f449a){this['_ongoingUploads']['delete'](_0x4f2407);if(!(_0x3f449a instanceof at&&_0x3f449a['message']['startsWith']('ai-request-aborted'))){const _0x5d0fe2=Ps['get'](_0x3f449a['code'])||'ai-chat-file-upload-failed',_0x8c3b4=new at(_0x5d0fe2,null,{'fileName':_0x41d136,..._0x3f449a});_0x8c3b4['stack']=_0x3f449a['stack'],this['fire']('error',{'error':_0x8c3b4});}this['_removeContextItem'](_0x4f2407);}}));}finally{this['_finishUploadOperation'](_0x34e45e);}}['addCurrentDocumentToContext'](_0x398a3a){if(this['isCurrentDocumentInContext']()||!this['_addContextOptionsState']['document']['enabled'])return;const _0x474b4b={'type':'document','uiId':'current-document','label':_0x398a3a,'isReadOnly':this['_conversationContextItems']['has']('current-document'),'hidden':this['_conversationContextItems']['has']('current-document')};this['_addContextItem'](_0x474b4b);}async['updateCurrentDocument'](_0x7cdfbe,_0x169212,_0x41ab25,_0x3b37f8,_0xed7dd,_0x29fdbf){const _0x5d3586=this['_pendingContextItems']['get']('current-document');if(_0x5d3586&&_0x7cdfbe){_0x5d3586['selection']=_0x29fdbf?_0x29fdbf['map'](_0x243c8f=>({'start':_0x243c8f['start'],'end':_0x243c8f['end']})):[];try{if(_0x5d3586['version']===_0x169212)return;const {id:_0x5c549d}=await this['_connector']['uploadDocument'](this['_ownerId'],_0x7cdfbe,{'version':_0x169212,'sessionId':_0x41ab25,'channelId':_0x3b37f8,'rootName':_0xed7dd})['getId']();_0x5d3586['id']=_0x5c549d,_0x5d3586['content']=_0x7cdfbe,_0x5d3586['version']=_0x169212,_0x5d3586['sessionId']=_0x41ab25;}catch(_0x1976a1){const _0x540885=new at('ai-chat-document-upload-failed',null);_0x540885['stack']=_0x1976a1['stack'],this['fire']('error',{'error':_0x540885});}}}async['updateCurrentDocuments'](_0x5d0433){const _0x55cb27=this['_pendingContextItems']['get']('current-document');if(!_0x55cb27||!_0x5d0433['length']||_0x5d0433['every'](_0x3ddb5e=>!_0x3ddb5e['content']))return;_0x5d0433['length']>0x1&&_0x5d0433['some'](_0x48fa0c=>!_0x48fa0c['description'])&&It('ai-chat-documents-missing-description');const _0x3f6aa7=_0x51cb30=>_0x51cb30?_0x51cb30['map'](_0x318a29=>({'start':_0x318a29['start'],'end':_0x318a29['end']})):[],_0x33d1ed=_0x55cb27['documents']??[];if(_0x33d1ed['length']===_0x5d0433['length']&&_0x5d0433['every']((_0x52bcfd,_0x30193a)=>_0x33d1ed[_0x30193a]?.['version']===_0x52bcfd['version']))_0x55cb27['documents']=_0x33d1ed['map']((_0x4e79f4,_0x47f30d)=>({..._0x4e79f4,'selection':_0x3f6aa7(_0x5d0433[_0x47f30d]['selections'])}));else try{const _0x10a733=await this['_connector']['uploadDocuments'](this['_ownerId'],_0x5d0433)['getIds']();_0x55cb27['documents']=_0x5d0433['map']((_0x1dbc32,_0x53cc81)=>({'id':_0x10a733[_0x53cc81]?.['id'],'content':_0x1dbc32['content'],'version':_0x1dbc32['version'],'sessionId':_0x1dbc32['sessionId'],'selection':_0x3f6aa7(_0x1dbc32['selections'])})),this['_documentSources']['clear'](),this['_dataIdToSource']['clear']();for(let _0x3bbb35=0x0;_0x3bbb35<_0x5d0433['length'];_0x3bbb35++){const _0x981807=_0x10a733[_0x3bbb35]?.['id'],_0x252c12=_0x5d0433[_0x3bbb35];if(!_0x981807)continue;const _0x32417f={'editor':_0x252c12['editor'],'rootName':_0x252c12['rootName'],'content':_0x252c12['content'],'version':_0x252c12['version'],'name':_0x252c12['name'],'description':_0x252c12['description']};this['_documentSources']['set'](_0x981807,_0x32417f);const _0x34965d=_s(_0x252c12['content']);for(const _0x4d4a3f of _0x49c4b8(_0x5898ff=>!!Es(_0x5898ff,'data-id'),_0x34965d)){const _0x145f28=Es(_0x4d4a3f,'data-id');_0x145f28&&this['_dataIdToSource']['set'](_0x145f28,{..._0x32417f,'documentId':_0x981807});}}_0x55cb27['dataIdDocumentSources']=new Map(this['_dataIdToSource']);}catch(_0x329d2d){const _0x49159f=new at('ai-chat-document-upload-failed',null);_0x49159f['stack']=_0x329d2d['stack'],this['fire']('error',{'error':_0x49159f});}}['addSelectionToContext'](_0x28d566){this['_addContextItem']({'type':'selection','label':_0x28d566,'uiId':'selection','content':_0x28d566});}['removeSelectionFromContext'](){this['_removeContextItem']('selection');}async['addUrlToContext'](_0x3bc4f0,_0xc081ec){const _0x286251='url-'+ot();this['_startUploadOperation'](_0x286251);const _0x1d3b9c='url-'+ot();try{this['_addContextItem']({'type':'web-resource','label':_0xc081ec?.['label']||_0x3bc4f0,'uiId':_0x1d3b9c,'resourceId':_0xc081ec?.['resourceId']},!0x0);const _0x2ec3c6=this['_connector']['uploadUrl'](this['_ownerId'],_0x3bc4f0,_0xc081ec);this['_ongoingUploads']['set'](_0x1d3b9c,_0x2ec3c6['abortController']);const {id:_0x47c1ce}=await _0x2ec3c6['getId']();this['_ongoingUploads']['delete'](_0x1d3b9c),this['_finishContextItemLoading']({'type':'web-resource','id':_0x47c1ce,'label':_0xc081ec?.['label']||_0x3bc4f0,'uiId':_0x1d3b9c,'resourceId':_0xc081ec?.['resourceId']},!0x1);}catch(_0x44f18d){this['_ongoingUploads']['delete'](_0x1d3b9c),(_0x44f18d['message']['startsWith']('ai-request-aborted')||this['fire']('error',{'error':new at('ai-chat-url-upload-failed',this,{'url':_0x3bc4f0,'originalError':_0x44f18d}),'url':_0x3bc4f0}),this['_removeContextItem'](_0x1d3b9c));}finally{this['_finishUploadOperation'](_0x286251);}}['addToolItemToContext'](_0x33ec7d){_0x33ec7d['id']=_0x33ec7d['id']??ot()['substring'](0x0,0x15),this['_pendingContextItems']['set'](_0x33ec7d['uiId'],_0x33ec7d),this['fire']('contextItemAdded',{'contextItem':_0x33ec7d,'isLoading':!0x1});}async['loadSourceResources'](_0xf4a75b,_0x363b09,_0x5b4956){const _0x117352=this['_addContextOptionsState']['sources']['find'](_0x4027c6=>_0x4027c6['id']===_0xf4a75b);if(!_0x117352)return this['fire']('error',{'error':new at('ai-chat-source-not-found',this,{'sourceId':_0xf4a75b}),'sourceId':_0xf4a75b}),[];try{const _0xa5d3ac=(await _0x117352['getResources'](_0x363b09))['map'](_0x10e374=>{const _0x2826ba=this['_isResourceInContext'](_0x10e374['id']);return{..._0x10e374,'isInContext':_0x2826ba};});return _0x117352['resources']=_0xa5d3ac,this['fire']('sourceResourcesLoaded',{'sourceId':_0xf4a75b,'source':_0x117352,'resources':_0xa5d3ac,'uid':_0x5b4956}),_0xa5d3ac;}catch(_0x5ef63c){return this['fire']('error',{'error':new at('ai-chat-source-resources-load-failed',this,{'sourceId':_0xf4a75b,'originalError':_0x5ef63c}),'sourceId':_0xf4a75b,'sourceLabel':_0x117352['label']}),[];}}async['addResourceToContext'](_0x2fa88c,_0x108f73){if(this['_isResourceInContext'](_0x108f73['id']))return;let _0x37850f=_0x108f73['data'];if(!_0x37850f&&_0x2fa88c['getData'])try{_0x37850f=await _0x2fa88c['getData'](_0x108f73['id']);}catch(_0x2b6a24){return void this['fire']('error',{'error':new at('ai-chat-resource-load-failed',this,{'resourceId':_0x108f73['id'],'sourceId':_0x2fa88c['id'],'originalError':_0x2b6a24}),'resourceId':_0x108f73['id'],'sourceId':_0x2fa88c['id']});}if(_0x37850f)switch(_0x108f73['type']){case'web-resource':if('string'!=typeof _0x37850f)return void this['fire']('error',{'error':new at('ai-chat-context-invalid-data',this,{'resourceId':_0x108f73['id'],'sourceId':_0x2fa88c['id'],'expectedType':'string','actualType':typeof _0x37850f}),'resourceId':_0x108f73['id'],'sourceId':_0x2fa88c['id']});await this['addUrlToContext'](_0x37850f,{'label':_0x108f73['label'],'resourceId':_0x108f73['id']});break;case'file':if(!(_0x37850f instanceof File))return void this['fire']('error',{'error':new at('ai-chat-context-invalid-data',this,{'resourceId':_0x108f73['id'],'sourceId':_0x2fa88c['id'],'expectedType':'File','actualType':typeof _0x37850f}),'resourceId':_0x108f73['id'],'sourceId':_0x2fa88c['id']});await this['addFilesToContext']([_0x37850f],{'label':_0x108f73['label'],'resourceId':_0x108f73['id']});break;case'text':if('object'!=typeof _0x37850f||!('content'in _0x37850f)||!('type'in _0x37850f))return void this['fire']('error',{'error':new at('ai-chat-context-invalid-data',this,{'resourceId':_0x108f73['id'],'sourceId':_0x2fa88c['id'],'expectedType':'object\x20with\x20content\x20and\x20type\x20properties','actualType':typeof _0x37850f}),'resourceId':_0x108f73['id'],'sourceId':_0x2fa88c['id']});_0x37850f=Ms['_convertTextResourceToFile'](_0x37850f,_0x108f73['label']),await this['addFilesToContext']([_0x37850f],{'label':_0x108f73['label'],'resourceId':_0x108f73['id']},'text');break;case'mcp-tool-context':break;default:this['fire']('error',{'error':new at('ai-chat-context-unsupported-type',this,{'resourceId':_0x108f73['id'],'sourceId':_0x2fa88c['id'],'resourceType':_0x108f73['type']}),'resourceId':_0x108f73['id'],'sourceId':_0x2fa88c['id']});}else this['fire']('error',{'error':new at('ai-chat-resource-no-data',this,{'resourceId':_0x108f73['id'],'sourceId':_0x2fa88c['id']}),'resourceId':_0x108f73['id'],'sourceId':_0x2fa88c['id']});}static['_convertTextResourceToFile'](_0xf938e1,_0x20992f){switch(_0xf938e1['type']){case'markdown':return new File([_0xf938e1['content']],_0x20992f,{'type':'text/markdown'});case'html':return new File([_0xf938e1['content']],_0x20992f,{'type':'text/html'});default:return new File([_0xf938e1['content']],_0x20992f,{'type':'text/plain'});}}static['_mapContextItemToRequestData'](_0x4a0b26){switch(_0x4a0b26['type']){case'file':case'text':return[{'type':'file','id':_0x4a0b26['id']}];case'web-resource':return[{'type':'web-resource','id':_0x4a0b26['id']}];case'document':return _0x4a0b26['documents']?.['length']?_0x4a0b26['documents']['map'](_0x5c11db=>({'type':'document','id':_0x5c11db['id'],..._0x5c11db['selection']?.['length']&&{'selection':_0x5c11db['selection']}})):[{'type':'document','id':_0x4a0b26['id'],..._0x4a0b26['selection']?.['length']&&{'selection':_0x4a0b26['selection']}}];case'mcp-tool-context':{const _0x410225=_0x4a0b26;return[{'type':'mcp-tool-context','mcpServerName':_0x410225['mcpServerName'],'toolName':_0x410225['toolName'],'data':{..._0x410225['data'],'label':_0x410225['label']||_0x410225['data']?.['label']||_0x410225['id']},'id':_0x410225['id']}];}default:return[];}}['_addContextItem'](_0x5cdb3c,_0x24814c=!0x1){if(this['_pendingContextItems']['set'](_0x5cdb3c['uiId'],_0x5cdb3c),_0x5cdb3c['hidden']||this['fire']('contextItemAdded',{'contextItem':_0x5cdb3c,'isLoading':_0x24814c}),'current-document'===_0x5cdb3c['uiId']&&this['_toggleAddCurrentDocumentOptionVisibility'](),_0x5cdb3c['resourceId']){const _0x5c01ff=this['_findSourceIdsByResourceId'](_0x5cdb3c['resourceId']);_0x5c01ff&&_0x5c01ff['forEach'](_0xbd3215=>{this['_updateResourceInContextState'](_0xbd3215,_0x5cdb3c['resourceId'],!0x0);});}}['_removeContextItem'](_0x5950d5){const _0x4d2978=this['_pendingContextItems']['get'](_0x5950d5),_0x191a52=this['_ongoingUploads']['get'](_0x5950d5);if(_0x191a52&&(_0x191a52['abort'](),this['_ongoingUploads']['delete'](_0x5950d5)),_0x4d2978?.['resourceId']){const _0x5e54e5=this['_findSourceIdsByResourceId'](_0x4d2978['resourceId']);_0x5e54e5&&_0x5e54e5['forEach'](_0x4f3d4e=>{this['_updateResourceInContextState'](_0x4f3d4e,_0x4d2978['resourceId'],!0x1);});}this['_pendingContextItems']['delete'](_0x5950d5),this['fire']('contextItemRemoved',{'uiId':_0x5950d5,'type':_0x4d2978?.['type']}),'current-document'===_0x5950d5&&this['_toggleAddCurrentDocumentOptionVisibility']();}['_finishContextItemLoading'](_0x487a39,_0x17e9d2){if(this['_pendingContextItems']['has'](_0x487a39['uiId'])&&(this['_pendingContextItems']['set'](_0x487a39['uiId'],_0x487a39),this['fire']('contextItemLoadingEnded',{'contextItem':_0x487a39,'isLoading':_0x17e9d2}),_0x487a39['resourceId'])){const _0x36249d=this['_findSourceIdsByResourceId'](_0x487a39['resourceId']);_0x36249d&&_0x36249d['forEach'](_0x5bffa6=>{this['_updateResourceInContextState'](_0x5bffa6,_0x487a39['resourceId'],!0x0);});}}['_addToConversationContextItem'](_0x10cffe){this['_conversationContextItems']['set'](_0x10cffe['uiId'],_0x10cffe);}['_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'](_0x5da76a=>({..._0x5da76a,'enabled':!0x0}))??[]},this['fire']('addContextOptionsChanged',{'options':this['_addContextOptionsState']});}['_getCustomSourcesInitialState'](){return this['_config']?.['sources']?.['map'](_0x58ad35=>({..._0x58ad35,'resources':[]}))??[];}['_toggleAddCurrentDocumentOptionVisibility'](){const _0x2a0885=this['isCurrentDocumentInContext']()||this['isCurrentDocumentInConversation']();this['_addContextOptionsState']['document']['isHidden']=_0x2a0885,this['fire']('addContextOptionsChanged',{'options':this['_addContextOptionsState']});}['_isResourceInContext'](_0x5a9976){for(const _0x51d0a1 of this['_pendingContextItems']['values']())if(_0x51d0a1['resourceId']===_0x5a9976)return!0x0;for(const _0x46f89b of this['_conversationContextItems']['values']())if(_0x46f89b['resourceId']===_0x5a9976)return!0x0;return!0x1;}['_findSourceIdsByResourceId'](_0x43d0b1){const _0x5981aa=[];for(const _0x1155a3 of this['_addContextOptionsState']['sources']){_0x1155a3['resources']['find'](_0x21229b=>_0x21229b['id']===_0x43d0b1)&&_0x5981aa['push'](_0x1155a3['id']);}return 0x0===_0x5981aa['length']?null:_0x5981aa;}['_updateResourceInContextState'](_0x393c6e,_0x37c1c7,_0x288408){const _0x252184=this['_addContextOptionsState']['sources']['find'](_0x5c35d4=>_0x5c35d4['id']===_0x393c6e);if(!_0x252184)return;const _0x4d4f10=_0x252184['resources']['find'](_0x5833e6=>_0x5833e6['id']===_0x37c1c7);_0x4d4f10&&(_0x4d4f10['isInContext']=_0x288408,this['fire']('resourceStateChanged',{'sourceId':_0x393c6e,'resourceId':_0x37c1c7,'isInContext':_0x288408}));}['_startUploadOperation'](_0x5dff8d){this['_ongoingUploadOperations']['set'](_0x5dff8d,!0x0),this['_ongoingUploadOperations']['size']&&this['fire']('uploadProgressChanged',{'isUploadInProgress':!0x0});}['_finishUploadOperation'](_0x5bdc8b){this['_ongoingUploadOperations']['delete'](_0x5bdc8b),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'](_0x31c4a8){const _0x94f1fc={};return _0x31c4a8&&_0x31c4a8['isWebSearchEnabled']&&(_0x94f1fc['webSearch']={}),_0x31c4a8&&_0x31c4a8['isReasoningEnabled']&&(_0x94f1fc['reasoning']={}),_0x94f1fc;}['toggleWebSearch'](){this['setWebSearch'](!this['_isWebSearchEnabled']);}['toggleReasoning'](){this['setReasoning'](!this['_isReasoningEnabled']);}['setWebSearch'](_0x146fc0){_0x146fc0!==this['_isWebSearchEnabled']&&(this['_isWebSearchEnabled']=_0x146fc0,this['fire']('capabilitiesUpdated',this['getCapabilitiesConfig']()));}['setReasoning'](_0xb4eeea){_0xb4eeea!==this['_isReasoningEnabled']&&(this['_isReasoningEnabled']=_0xb4eeea,this['fire']('capabilitiesUpdated',this['getCapabilitiesConfig']()));}}class Bs extends Ds{['userMessage'];['conversationId'];['contextItems']=new Map();['capabilities'];['model'];['attributes'];constructor(_0x336be8){super(_0x336be8),this['conversationId']=_0x336be8['conversationId'],this['contextItems']=_0x336be8['contextItems'],this['capabilities']=_0x336be8['capabilities'],this['userMessage']=_0x336be8['userMessage'],this['model']=_0x336be8['model'],this['attributes']=_0x336be8['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'](_0x5e5978){const _0x8f096a=this['getDocumentContext']();if(_0x8f096a?.['documents']?.['length']){const _0x2eea18=_0x8f096a['documents']['map'](_0x4868c2=>_0x4868c2['content']??'')['join']('');if(_0x2eea18)return super['createReply']({'documentContextContent':_0x2eea18,..._0x5e5978});}return super['createReply'](_0x5e5978);}}class Gs extends Tt(){['id'];['isStarted']=!0x1;['isFromHistory'];['interactions']=[];['currentInteraction'];['selectedModel'];['connector'];['options'];constructor(_0x31ee39){super(),this['options']=_0x31ee39,this['connector']=_0x31ee39['connector'],this['chatModels']=_0x31ee39['chatModels'],this['id']=_0x31ee39['conversationId'],this['isFromHistory']=_0x31ee39['isFromHistory'];}async['init'](_0x3e565d){try{this['chatContext']=new Ms({'connector':this['connector'],'config':_0x3e565d,'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 _0x4593b1=await this['chatModels']['getAvailableModels']();this['fire']('conversationInitialized',{'availableModels':_0x4593b1});const _0x172d17=await this['chatModels']['getModel'](this['options']['selectedModelId']);_0x172d17&&await this['setModel'](_0x172d17);}catch(_0x5d3d45){const _0x43fc2a=new at('ai-chat-conversation-init-failed',null,{'message':_0x5d3d45['message']||_0x5d3d45});_0x43fc2a['stack']=_0x5d3d45['stack'],this['fire']('error',{'error':_0x43fc2a});}}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:_0x1d8953}=await this['connector']['startConversation'](this['id'],this['options']['group'])['getConversation']();this['id']=_0x1d8953,this['isStarted']=!0x0,this['fire']('conversationStarted',{'conversationId':this['id'],'selectedModel':this['selectedModel']});}catch(_0x99b140){const _0x9de6c7=new at('ai-chat-conversation-start-failed',null,{'message':_0x99b140['message'],'conversationId':this['id']});throw _0x9de6c7['stack']=_0x99b140['stack'],this['fire']('error',{'error':_0x9de6c7}),_0x9de6c7;}}async['load'](_0x229e1d,_0x5cb76e){try{const _0x873173=await this['connector']['fetchConversation'](_0x229e1d)['getConversation'](),_0x413534=await this['connector']['fetchConversationMessages'](_0x229e1d)['getMessages'](),_0x58b927=_0x413534[0x0]['model'];this['isStarted']=!0x0,this['id']=_0x873173['id'],'title'in _0x873173?this['fire']('setConversationTitle',_0x873173['title'],!0x0):this['fire']('setConversationTitle','',!0x0);const _0x1aebd4=(await this['chatModels']['getAll']())['find'](_0x2051c3=>_0x2051c3['id']['toLowerCase']()===_0x58b927['toLowerCase']());return this['selectedModel']=_0x1aebd4,this['fire']('modelSelected',{'selectedModel':_0x1aebd4,'isDisabled':!0x0}),await this['_processMessagesToInteractions'](_0x413534,_0x5cb76e,_0x58b927),this['currentInteraction']=void 0x0,this;}catch(_0x9d64d9){const _0x157493=new at('ai-chat-conversation-init-from-id-failed',null,{'message':_0x9d64d9['message'],'conversationId':_0x229e1d});throw _0x157493['stack']=_0x9d64d9['stack'],this['fire']('error',{'error':_0x157493}),_0x157493;}}async['_processMessagesToInteractions'](_0x371e80,_0x47bedf,_0x2a7f7b){let _0x12abcb,_0x4c5f7a=!0x1;for(const _0x54c44e of _0x371e80)if('user'===_0x54c44e['role']){const {contextItems:_0x11c19b,hasUnmatched:_0x88e3f}=await this['_extractContextItems'](_0x54c44e);_0x4c5f7a=_0x88e3f;const _0x486e8f={'isReasoningEnabled':Object['hasOwn'](_0x54c44e['capabilities'],'reasoning'),'isWebSearchEnabled':Object['hasOwn'](_0x54c44e['capabilities'],'webSearch')};_0x12abcb=this['createInteraction']({'userMessage':_0x54c44e['prompt'],'contextItems':_0x11c19b,'capabilities':_0x486e8f,'modelId':_0x2a7f7b,'attributes':_0x54c44e['attributes']}),this['currentInteraction']=_0x12abcb,this['chatContext']['addToConversationContext'](this['currentInteraction']['contextItems']);}else{if('assistant'===_0x54c44e['role']&&_0x12abcb){const _0x371ede=[];for(const _0x1485b7 of _0x54c44e['content'])switch(_0x1485b7['type']){case'text':case'modification':{const _0x55da80=_0x12abcb['getDocumentContext'](),_0xb904ce=(_0x55da80?.['documents']?.['length']?_0x55da80['documents']['some'](_0xe4dfe2=>_0xe4dfe2['sessionId']!==_0x47bedf):_0x55da80?.['sessionId']!==_0x47bedf)||_0x4c5f7a;_0x12abcb['currentReply']?.['type']!==_0x1485b7['type']&&(_0x12abcb['currentReply']=_0x12abcb['createReply']({'type':_0x1485b7['type'],'isDone':!0x0,'interactionId':_0x12abcb['id'],'areActionsDisabled':_0xb904ce,'isFromHistory':!0x0}),_0x371ede['length']>0x0&&(_0x12abcb['currentReply']['sources']=_0x371ede['splice'](0x0))),_0x12abcb['currentReply']['appendContent'](_0x1485b7['content']);break;}case'url':_0x371ede['push'](_0x1485b7);break;case'mcp-tool-result':{const {data:_0x1ba716,attributes:_0xaede46}=JSON['parse'](_0x1485b7['content']);_0x12abcb['_handleToolResultData']({'toolName':_0x1485b7['toolName'],'data':_0x1ba716,'attributes':_0xaede46});break;}}}}}async['_extractContextItems'](_0x1fd183){const _0x1ad8f7=new Map();if(!_0x1fd183['content'])return{'contextItems':_0x1ad8f7,'hasUnmatched':!0x1};const _0x5262f9=this['_resolveEditors'](),{contextItem:_0x121ca4,hasUnmatched:_0x1c8a0b}=await this['chatContext']['populateDocumentsFromMessage'](_0x1fd183['content'],_0x5262f9);_0x121ca4&&_0x1ad8f7['set'](_0x121ca4['id'],_0x121ca4);for(const _0x1786b4 of _0x1fd183['content']){if('document'===_0x1786b4['type'])continue;const _0x58fcff=await this['chatContext']['populateFromMessage'](_0x1786b4);_0x58fcff&&_0x1ad8f7['set'](_0x58fcff['id'],_0x58fcff);}return{'contextItems':_0x1ad8f7,'hasUnmatched':_0x1c8a0b};}['_resolveEditors'](){return this['options']['getEditors']?this['options']['getEditors']():this['options']['getEditor']?[this['options']['getEditor']()]:[];}async['handleUserInteraction']({userMessage:_0x51899e,attributes:_0x369cc1}){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 _0x964c9d=this['chatContext']['getPendingContextItems'](),_0x261852=this['chatCapabilities']['getCapabilitiesConfig'](),_0x20f3d4=this['selectedModel']['id'];this['currentInteraction']=this['createInteraction']({'userMessage':_0x51899e,'contextItems':_0x964c9d,'capabilities':_0x261852,'modelId':_0x20f3d4,'attributes':_0x369cc1}),await this['currentInteraction']['start'](),this['chatContext']['addToConversationContext'](this['currentInteraction']['contextItems']);}catch(_0x2b18bf){if(_0x2b18bf instanceof at)this['fire']('error',{'interactionId':this['currentInteraction']?this['currentInteraction']['id']:void 0x0,'error':_0x2b18bf});else{const _0x31edc7=Ps['get'](_0x2b18bf['code'])||'ai-chat-handle-user-interaction-start-failed';this['fire']('error',{'interactionId':this['currentInteraction']?this['currentInteraction']['id']:void 0x0,'error':new at(_0x31edc7,null,{'error':_0x2b18bf})});}}finally{this['currentInteraction']?.['stop'](),this['currentInteraction']=void 0x0;}}['createInteraction']({userMessage:_0x57dfe3,contextItems:_0x23f6e9,capabilities:_0x1ff7f8,modelId:_0x4638c9,attributes:_0x2e61a9}){const _0x7b1acf=new Bs({'userMessage':_0x57dfe3,'contextItems':_0x23f6e9,'capabilities':_0x1ff7f8,'conversationId':this['id'],'connector':this['connector'],'locale':this['options']['locale'],'model':_0x4638c9,'attributes':_0x2e61a9});return _0x7b1acf['delegate'](...Ls)['to'](this),this['interactions']['push'](_0x7b1acf),this['fire']('interactionCreated',_0x7b1acf),_0x7b1acf;}['getInteraction'](_0x5bc6d5){return this['interactions']['find'](_0x1df34f=>_0x1df34f['id']===_0x5bc6d5);}['removeInteraction'](_0x5ced88){const _0x48a925=this['getInteraction'](_0x5ced88);_0x48a925&&(_0x48a925['destroy'](),this['interactions']['splice'](this['interactions']['indexOf'](_0x48a925),0x1));}get['lastInteraction'](){return this['interactions'][this['interactions']['length']-0x1];}['addCurrentDocumentToContext'](_0x2cc27f){this['chatContext']['addCurrentDocumentToContext'](_0x2cc27f);}async['updateCurrentDocumentInContext']({content:_0x533c9c,version:_0x1912e7,sessionId:_0x3f7732,channelId:_0x3fad75,rootName:_0x45d402,selections:_0x11d083}){await this['chatContext']['updateCurrentDocument'](_0x533c9c,_0x1912e7,_0x3f7732,_0x3fad75,_0x45d402,_0x11d083);}async['updateCurrentDocumentsInContext'](_0x27066b){await this['chatContext']['updateCurrentDocuments'](_0x27066b);}['getSourceByDataId'](_0x1c08cd){return this['chatContext']['getSourceByDataId'](_0x1c08cd);}['getDocumentContextSliceByDataId'](_0x1819b4){return this['chatContext']['getDocumentContextSliceByDataId'](_0x1819b4);}['getCurrentDocumentContext'](){return this['currentInteraction']?.['getDocumentContext']()?.['content']||'';}['addSelectionToContext'](_0x35f727){this['chatContext']['addSelectionToContext'](_0x35f727);}['removeSelectionFromContext'](){this['chatContext']['removeSelectionFromContext']();}['addFilesToContext'](_0x361f4e){this['chatContext']['addFilesToContext'](_0x361f4e);}['addUrlToContext'](_0x4194c2){this['chatContext']['addUrlToContext'](_0x4194c2);}['addToolItemToContext'](_0x2f56de){this['chatContext']['addToolItemToContext'](_0x2f56de);}['addResourceToContext'](_0x4f0fcc,_0x100e6d){this['chatContext']['addResourceToContext'](_0x4f0fcc,_0x100e6d);}['loadSourceResources'](_0x2737ea,_0x482d5f,_0x4e3e3e){return this['chatContext']['loadSourceResources'](_0x2737ea,_0x482d5f,_0x4e3e3e);}['removeFromContext'](_0xd5639f){this['chatContext']['removeFromContext'](_0xd5639f);}['setWebSearch'](_0x5f5556){this['chatCapabilities']['setWebSearch'](_0x5f5556);}['toggleWebSearch'](){this['chatCapabilities']['toggleWebSearch']();}['setReasoning'](_0xc7d4bf){this['chatCapabilities']['setReasoning'](_0xc7d4bf);}['toggleReasoning'](){this['chatCapabilities']['toggleReasoning']();}['isCurrentDocumentInContext'](){return this['chatContext']['isCurrentDocumentInContext']();}['isCurrentDocumentInConversation'](){return this['chatContext']['isCurrentDocumentInConversation']();}['isSelectionInContext'](){return this['chatContext']['isSelectionInContext']();}async['setModel'](_0x5a3efc){_0x5a3efc?!0x1===await this['chatModels']['isAvailable'](_0x5a3efc)&&(It('ai-chat-conversation-set-model-not-available',{'conversation':this,'model':_0x5a3efc}),_0x5a3efc=(await this['chatModels']['getAvailableModels']())[0x0]):(It('ai-chat-conversation-set-model-null',{'conversation':this}),_0x5a3efc=(await this['chatModels']['getAvailableModels']())[0x0]),_0x5a3efc['id']!==this['selectedModel']?.['id']&&(this['selectedModel']=_0x5a3efc,this['chatCapabilities']['reset'](),this['fire']('modelSelected',{'selectedModel':_0x5a3efc}));}}class Fs extends Tt(){['_connector'];['_config'];['_locale'];['_modelList']=[];['_modelsRequest']=null;constructor({connector:_0x4698d0,config:_0x212ff3,locale:_0x5d5a0e}){super(),this['_connector']=_0x4698d0,this['_config']=_0x212ff3,this['_locale']=_0x5d5a0e;}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 _0x2ec666=await this['getAll']();let _0x2c6393;return _0x2c6393=this['_availableModels']?this['_filterModels'](_0x2ec666,this['_availableModels']):_0x2ec666['filter'](_0x2cb25b=>_0x2cb25b['recommended']),_0x2c6393;}async['getModel'](_0x301819){const _0x3c11b6=await this['getAll']();if(!_0x3c11b6['length'])return null;if(_0x301819){const _0xefce2f=this['_getModelById'](_0x3c11b6,_0x301819);if(_0xefce2f)return _0xefce2f;It('ai-chat-model-id-unrecognized',{'modelId':_0x301819,'fallBackModelId':this['_defaultModelId']});}return this['getDefault']();}async['getDefault'](){const _0x7a3ba8=await this['getAvailableModels']();if(!_0x7a3ba8['length'])return null;if(this['_defaultModelId']){const _0x4b1629=this['_getModelById'](_0x7a3ba8,this['_defaultModelId']);if(_0x4b1629)return _0x4b1629;It('ai-chat-default-model-id-unrecognized',{'defaultModelId':this['_defaultModelId'],'fallBackModelId':_0x7a3ba8[0x0]['id']});}return _0x7a3ba8[0x0];}async['isAvailable'](_0x21f0b){return(await this['getAvailableModels']())['some'](_0x341c86=>_0x341c86['name']===_0x21f0b['name']&&_0x341c86['provider']===_0x21f0b['provider']);}async['_retrieveModels'](){if(!this['_modelList']['length'])try{const _0x52e5dc=this['_locale']['uiLanguage']||'en',_0x685890=this['_connector']['getModels'](_0x52e5dc),_0x430416=await _0x685890['list']();this['_modelList']=_0x430416['items']['map'](_0x511e6d=>Ks(_0x511e6d)?{..._0x511e6d,'name':hs(this['_locale'],'AI_MODEL_NAME_AUTO')}:_0x511e6d);}catch(_0x24c33f){throw Et('ai-models-unable-to-retrieve',{'error':_0x24c33f}),_0x24c33f;}return[...this['_modelList']];}['_filterModels'](_0x2fafe1,_0x1e8396){let _0x1fe9fe;if(_0x1e8396){_0x1fe9fe=[];const _0x4b5ae3=new Set(),_0x10ed16='string'==typeof _0x1e8396?[_0x1e8396['toLocaleLowerCase']()]:_0x1e8396['map'](_0x50f2ad=>_0x50f2ad['toLocaleLowerCase']());for(const _0x282fa9 of _0x10ed16)for(const _0x1e06ca of _0x2fafe1)!_0x4b5ae3['has'](_0x1e06ca['id'])&&this['_isMatchingFilter'](_0x1e06ca,_0x282fa9)&&(_0x1fe9fe['push'](_0x1e06ca),_0x4b5ae3['add'](_0x1e06ca['id']));}else _0x1fe9fe=_0x2fafe1;return _0x1fe9fe;}['_isMatchingFilter'](_0x14f99b,_0x4d5c84){const _0x597ce2=_0x14f99b['id']['toLocaleLowerCase'](),_0x3ba4e1=_0x14f99b['name']['toLocaleLowerCase'](),_0x18f995=_0x14f99b['provider']['toLocaleLowerCase']();return _0x597ce2===_0x4d5c84||_0x3ba4e1===_0x4d5c84||Ks(_0x14f99b)&&'auto'===_0x4d5c84||_0x18f995===_0x4d5c84||_0x597ce2['startsWith'](_0x4d5c84);}['_getModelById'](_0x13d7f5,_0x14948d){return _0x13d7f5['find'](_0x271c78=>Ks(_0x271c78)&&'auto'===_0x14948d?_0x271c78:_0x271c78['id']===_0x14948d)||null;}}function Ks(_0x40e1a7){return _0x40e1a7['id']['startsWith']('agent');}function Ws(_0x36367c){return _0x36367c?_0x36367c instanceof _0x2ef8df?[_0x36367c]:_0x36367c['editors']&&0x0!==_0x36367c['editors']['length']?Array['from'](_0x36367c['editors']):[]:[];}function Ys(_0x29defd){const _0x2f4b4d=Ws(_0x29defd);if(!_0x2f4b4d['length'])throw new at('ai-get-editor-from-context-no-editor');if(0x1===_0x2f4b4d['length'])return _0x2f4b4d[0x0];const _0x1701f1=_0x2f4b4d['find'](_0x399a34=>_0x399a34['ui']?.['focusTracker']?.['isFocused']);if(_0x1701f1)return _0x1701f1;const _0x475372=function(_0x82f49){if(_0x82f49 instanceof _0x2ef8df)return;const _0x460da7=_0x82f49;if(!_0x460da7['plugins']||!_0x460da7['plugins']['has']('AIEditing'))return;const _0x3c7a42=_0x460da7['plugins']['get']('AIEditing');return _0x3c7a42['getLastContentFocusedEditor']?.();}(_0x29defd);return _0x475372&&_0x2f4b4d['includes'](_0x475372)?_0x475372:_0x2f4b4d[0x0];}function $s(_0x3b5ed8){return Ys(_0x3b5ed8);}function qs({editor:_0x4b33b3,interaction:_0x39b4ff,reply:_0x418232,groups:_0x596b1f,transform:_0x2b4950,documentCompare:_0x4639de,documentCompareOptions:_0x173b74,documentContextSlice:_0x1dd824}){const _0x1eca0a=_0x39b4ff['getDocumentContext']();if(!_0x1eca0a)return[];const _0x179fd0=_0x418232['documentContextContent']['cloneNode'](!0x0);for(const {changes:_0x4941a3}of _0x596b1f){const _0x5bb84a=_0x4941a3['filter'](_0x13a969=>'new'!=_0x13a969['type'])['map'](_0x156e76=>As('data-id',_0x156e76['id'],_0x179fd0)),_0x33cce3=_0x4941a3['filter'](_0x48790d=>'removed'!=_0x48790d['type'])['map'](_0x3a3998=>_0x3a3998['node']['cloneNode'](!0x0));let _0x55e61a=null;if(_0x5bb84a['length']){_0x55e61a=_0x5bb84a[0x0]['previousSibling'];for(let _0xc19542=0x0;_0xc19542<_0x5bb84a['length'];_0xc19542++)_0x5d78f4(_0x5bb84a[_0xc19542]);}if(_0x33cce3['length']){_0x55e61a||(_0x4941a3[0x0]['anchorId']?_0x55e61a=As('data-id',_0x4941a3[0x0]['anchorId'],_0x179fd0):(_0x55e61a=_0x33cce3['shift'](),_0x288fde(_0x179fd0,_0x55e61a)));for(let _0x11f76b=0x0;_0x11f76b<_0x33cce3['length'];_0x11f76b++)_0x188752(_0x55e61a,_0x33cce3[_0x11f76b]),_0x55e61a=_0x33cce3[_0x11f76b];}}let _0x358fad,_0x1441af,_0x3109f4,_0x428795=_0x173b74;if(_0x1dd824){_0x358fad=_0x1dd824['html'],_0x3109f4=_0x1dd824['version'],_0x428795={..._0x173b74,'anchor':_0x1dd824['rootName']};const _0x800778=new _0x290fcd([]),_0xc10a08=_0x179fd0['children'],_0x26eca8=_0x418232['dataIdDocumentSources'],_0x5efd94=_0x418232['newNodeAnchorIds'],_0x531b2a=_0x1dd824['editor'],_0x322ee8=_0x1dd824['rootName'],_0x474b3f=new Array(_0xc10a08['length']),_0x4e3c3b=_0x166653=>_0x166653?_0x166653['editor']===_0x531b2a&&_0x166653['rootName']===_0x322ee8:void 0x0;for(let _0x27bb38=0x0;_0x27bb38<_0xc10a08['length'];_0x27bb38++){const _0x251681=Es(_0xc10a08[_0x27bb38],'data-id');if(!_0x251681)continue;const _0x466a89=_0x4e3c3b(_0x26eca8?.['get'](_0x251681));if(void 0x0!==_0x466a89){_0x474b3f[_0x27bb38]=_0x466a89;continue;}const _0x33066e=_0x5efd94['get'](_0x251681),_0x2f0222=_0x33066e?_0x4e3c3b(_0x26eca8?.['get'](_0x33066e)):void 0x0;void 0x0!==_0x2f0222&&(_0x474b3f[_0x27bb38]=_0x2f0222);}for(let _0x57277d=0x0;_0x57277d<_0xc10a08['length'];_0x57277d++)if(void 0x0===_0x474b3f[_0x57277d]){for(let _0x3e3783=_0x57277d-0x1;_0x3e3783>=0x0;_0x3e3783--)if(void 0x0!==_0x474b3f[_0x3e3783]){_0x474b3f[_0x57277d]=_0x474b3f[_0x3e3783];break;}if(void 0x0===_0x474b3f[_0x57277d]){for(let _0x3ecebf=_0x57277d+0x1;_0x3ecebf<_0xc10a08['length'];_0x3ecebf++)if(void 0x0!==_0x474b3f[_0x3ecebf]){_0x474b3f[_0x57277d]=_0x474b3f[_0x3ecebf];break;}}}for(let _0x51b750=0x0;_0x51b750<_0xc10a08['length'];_0x51b750++)_0x474b3f[_0x51b750]&&_0x800778['children']['push'](_0x2cb1ed(_0xc10a08[_0x51b750],!0x0));_0x1441af=gs(_0x800778);}else _0x358fad=_0x1eca0a['content'],_0x3109f4=_0x1eca0a['version'],_0x1441af=gs(_0x179fd0);const _0xecc955=_0x4639de['getDiff'](_0x358fad,_0x1441af,{..._0x428795,'targetEditor':_0x4b33b3})['getOperations']();if(_0x2b4950){const _0x27863c=_0x4b33b3['model']['document']['history']['getOperations'](_0x3109f4),_0x2b5cc4={'document':_0x4b33b3['model']['document'],'useRelations':!0x1,'padWithNoOps':!0x1};return _0x261504(_0xecc955,_0x27863c,_0x2b5cc4)['operationsA'];}return _0xecc955;}function Qs(_0xd5cd1,_0x250b73){if('marker'!=_0x250b73['type'])return;const _0x347a13=_0xd5cd1['model']['markers']['get'](_0x250b73['name']);_0x347a13&&(_0x250b73['oldRange']=_0x347a13['getRange']());}class Xs extends _0x173dbd{['activeConversation'];['_aiEditing'];['_aiConnector'];['_aiChatUi'];['_aiChatModels'];['_aiChatBalloon'];['_activeBalloon'];['_wiredBalloons']=new Set();['_batchToChanges']=new Map();['_currentPreviewedChangeGroup']=null;['_bodyCollection'];static get['requires'](){return[as,_0x47efd0];}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 _0x552ada=this['context']['plugins']['get']('AITabs');this['listenTo'](this['_aiChatUi'],'startConversation',()=>{this['_startConversationSafely']();}),this['listenTo'](this['_aiChatUi'],'sendUserMessage',(_0x2044c6,_0x523a19)=>{this['_handleUIUserMessage']({'message':_0x523a19});}),this['listenTo'](_0x552ada['view'],'change:activeTab',(_0x172a52,_0x29c252,_0x42b9ad)=>{'chat'!==_0x42b9ad&&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',(_0x3b5f5a,_0x38ee3e)=>{this['activeConversation']?.['addFilesToContext'](Array['from'](_0x38ee3e));}),this['listenTo'](this['_aiChatUi'],'addUrlToContext',(_0x18a781,_0x21f9a7)=>{this['activeConversation']?.['addUrlToContext'](_0x21f9a7);}),this['listenTo'](this['_aiChatUi'],'executeCustomItemCallback',(_0x1302c7,_0x38e144)=>{_0x38e144['callback'](this['context']);}),this['listenTo'](this['_aiChatUi'],'addResourceToContext',(_0x22d5a2,_0x3ff925)=>{this['activeConversation']?.['addResourceToContext'](_0x3ff925['source'],_0x3ff925['resource']);}),this['listenTo'](this['_aiChatUi'],'removeContextItem',(_0x4b2027,_0x46d0e3)=>{this['_removeFromContext'](_0x46d0e3);}),this['listenTo'](this['_aiChatUi'],'loadSourceResources',(_0x5a60c0,_0x3e29c)=>{this['activeConversation']?.['loadSourceResources'](_0x3e29c['sourceId'],_0x3e29c['query'],_0x3e29c['uid']);}),this['listenTo'](this['_aiChatUi'],'toggleWebSearch',()=>{this['_toggleWebSearch']();}),this['listenTo'](this['_aiChatUi'],'toggleReasoning',()=>{this['_toggleReasoning']();}),this['listenTo'](this['_aiChatUi'],'selectModel',(_0x1dce75,_0x34de65)=>{this['activeConversation']?.['setModel'](_0x34de65);}),this['listenTo'](this['_aiChatUi'],'like',(_0x2307fa,{replyId:_0x35263c})=>{console['log']('Liked\x20response',_0x35263c);}),this['listenTo'](this['_aiChatUi'],'dislike',(_0x37801a,{replyId:_0x421987})=>{console['log']('Disliked\x20response',_0x421987);}),this['listenTo'](this['_aiChatUi'],'insertSuggestion',(_0x1ddbe3,_0x3c9289)=>{this['_insertSuggestion'](_0x3c9289);}),this['listenTo'](this['_aiChatUi'],'showChangeInText',(_0x7fa872,{replyId:_0x26ee7f,partIndex:_0x196bb5})=>{this['_aiChatBalloonShowDiff']=this['_aiChatUi']['showDiff'],this['_openBalloonFor'](_0x26ee7f,_0x196bb5);}),this['listenTo'](this['_aiChatUi'],'mouseOverSuggestion',(_0x10e801,{replyId:_0xfdc720,partIndex:_0x57cd2b})=>{const _0x487048=this['_getDocumentRangeForReplyChanges'](_0xfdc720,_0x57cd2b);_0x487048&&'$graveyard'!=_0x487048['range']['root']['rootName']&&this['_aiEditing']['showFakeVisualSelection']({'ranges':[_0x487048['range']],'id':'change-area','priority':0xa});}),this['listenTo'](this['_aiChatUi'],'mouseLeaveSuggestion',()=>{this['_aiEditing']['hideFakeVisualSelection']('change-area');}),this['listenTo'](this['_aiChatUi'],'applySuggestion',(_0x61572,_0x961dfe)=>{this['_aiEditing']['hideFakeVisualSelection']('change-area'),this['_applySuggestion'](_0x961dfe);}),this['listenTo'](this['_aiChatUi'],'toggleSuggestionDisplayMode',async(_0x30000c,{replyId:_0x26a69d,showDiff:_0x1e09c6})=>{const {reply:_0x1b59ff}=this['getInteractionAndReplyById'](_0x26a69d),_0x45c5e6=_0x1b59ff['getContentParts']({'showDiff':_0x1e09c6,'editor':$s(this['context'])});await this['_aiChatUi']['updateFeedItemAIReplySuggestionContent']({'id':_0x1b59ff['id'],'parts':_0x45c5e6});}),this['listenTo'](this['_aiChatUi'],'rejectSuggestion',(_0x39493e,{replyId:_0xe41c16,partIndex:_0x11d2f2})=>{this['_rejectSuggestion']({'replyId':_0xe41c16,'partIndex':_0x11d2f2}),this['_aiEditing']['hideFakeVisualSelection']('change-area');}),this['set']('_aiChatBalloonShowDiff',!0x1),this['context']['plugins']['has']('AIChatBalloon')&&(this['_aiChatBalloon']=this['context']['plugins']['get']('AIChatBalloon')),this['on']('interactionCreated',(_0x17405a,_0x3494df)=>{this['_aiChatUi']['addFeedItemUserMessage'](_0x3494df);}),this['on']('replyCreated',(_0x15d2e9,_0x5afc64)=>{this['_addFeedItemReply'](_0x5afc64);});}async['afterInit'](){this['context']instanceof _0x2ef8df?this['_integrateEditor'](this['context']):this['listenTo'](this['context']['editors'],'add',(_0xf541aa,_0x2540a6)=>{_0x2540a6['on']('ready',()=>{this['_integrateEditor'](_0x2540a6);});});const _0x196e64=this['context']['config']['get']('ai.chat.initialConversation');let _0x3a1c94=_0x196e64;if('lastCreated'!=_0x196e64||(_0x3a1c94=await this['_getLastCreatedConversationId'](),_0x3a1c94))return'new'==_0x3a1c94?this['_startConversationSafely']():this['loadConversation'](_0x3a1c94);}async['destroy'](){return await this['_stopLastInteraction'](),this['_bodyCollection']['detachFromDom'](),super['destroy']();}async['loadConversation'](_0x55791f){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'](_0x55791f)['getConversation'](),await this['_startConversationSafely']({'id':_0x55791f}),this['_updateConversationTitle']('\x20'),await this['activeConversation']['load'](_0x55791f,this['_aiEditing']['sessionId']),this['activeConversation']['isCurrentDocumentInConversation']()&&this['addCurrentDocumentToChatContext']();}catch(_0x51d576){this['_aiChatUi']['addFeedItemError']({'errorMessage':hs(this['context']['locale'],'AI_CHAT_UNABLE_TO_LOAD_CONVERSATION'),'id':_0x55791f}),this['_logError'](new at('ai-chat-conversation-not-found',this,{'error':_0x51d576}));}finally{this['_aiChatUi']['startAutoScroll']({'smooth':!0x1}),this['_aiChatUi']['setFeedItemRenderingStrategy']('streaming'),this['_aiChatUi']['toggleLoadingSkeleton'](!0x1);}}['registerToolDataCallback'](_0x2cc278){let _0x3b0df1=null,_0x5a6dd2=null;this['on']('toolDataReceived',(_0x37f31d,_0x4f7c5d,_0x3af27a)=>{_0x3af27a['id']!==_0x3b0df1&&(_0x3b0df1=_0x3af27a['id'],_0x5a6dd2=this['_getAIChatFeedAPI'](_0x3af27a)),_0x2cc278(_0x4f7c5d,_0x5a6dd2);});}['addCurrentDocumentToChatContext'](){this['activeConversation']?.['addCurrentDocumentToContext'](hs(this['context']['locale'],'AI_CHAT_CONTEXT_CURRENT_DOCUMENT'));}async['addSelectionToChatContext'](){const _0x464801=this['_aiEditing']['getSelectionText']();this['activeConversation']?.['addSelectionToContext'](_0x464801),this['addCurrentDocumentToChatContext']();}['removeSelectionFromChatContext'](){this['activeConversation']?.['removeSelectionFromContext']();}['focusPromptInput'](){this['_aiChatUi']['focusPromptInput']();}async['startConversation'](_0x48f774){await this['_startConversationSafely']({'modelId':_0x48f774?.['modelId']});}async['sendMessage'](_0x4b019d){await this['_handleUIUserMessage'](_0x4b019d);}['getGroupId'](){const _0xdf14c8=this['context']['config']['get']('collaboration.channelId');if(!_0xdf14c8)throw new at('ai-missing-channel-id',this);return _0xdf14c8;}['_handleRemovedConversation'](_0x5b4c8e){this['activeConversation']['id']===_0x5b4c8e&&this['_startConversationSafely']();}['_insertSuggestion'](_0x2e21f4){const _0x116e7a=this['context']['plugins']['get']('DocumentCompare'),{reply:_0x59e058,interaction:_0x174223}=this['getInteractionAndReplyById'](_0x2e21f4['replyId']),_0x1232be=void 0x0!==_0x2e21f4['partIndex']?[_0x59e058['changeGroups'][_0x2e21f4['partIndex']]]:_0x59e058['changeGroups']['filter'](_0x994c91=>'pending'==_0x994c91['state']);for(const _0x4ef91e of this['_groupChangesByTarget'](_0x59e058,_0x1232be)){const {target:_0x2c779c,groups:_0x4e078d,groupsIndexes:_0x4d1676,slice:_0x430c82}=_0x4ef91e;if(!_0x2c779c['editor']['plugins']['has']('TrackChanges'))throw new at('ai-no-track-changes',null);const _0x105857=this['_getDocumentRangeForReplyChanges'](_0x2e21f4['replyId'],_0x4d1676[0x0]);if(!_0x105857||'$graveyard'==_0x105857['range']['root']['rootName']){_0x4d1676['forEach'](_0x392577=>_0x59e058['setChangeGroupState'](_0x392577,'outdated'));continue;}_0x4d1676['forEach'](_0x4c25e7=>_0x59e058['setChangeGroupState'](_0x4c25e7,'accepted'));const _0x39728a=qs({'editor':_0x2c779c['editor'],'reply':_0x59e058,'interaction':_0x174223,'groups':_0x4e078d,'transform':!0x0,'documentCompare':_0x116e7a,'documentCompareOptions':{'anchor':_0x430c82?.['rootName']??'main','markDeletions':!0x0},'documentContextSlice':_0x430c82});let _0xdfa5c;this['_scrollToSuggestionRange'](_0x105857['range'],!0x1,_0x2c779c['editor']),_0x2c779c['editor']['model']['change'](_0x39d8c7=>{_0xdfa5c=_0x39d8c7['batch'],_0x2c779c['editor']['plugins']['get']('TrackChangesEditing')['_applyOperationsAsSuggestions'](_0x39728a),this['_aiEditing']['hideFakeVisualSelection']('change-area');}),this['_batchToChanges']['set'](_0xdfa5c,{'interactionId':_0x174223['id'],'replyId':_0x59e058['id'],'indexes':_0x4d1676['slice']()});}this['_updateRatings'](_0x59e058);}['_applySuggestion'](_0x2dafcd){const _0x95f881=this['context']['plugins']['get'](_0x47efd0),{reply:_0x3921d7,interaction:_0x2ef25b}=this['getInteractionAndReplyById'](_0x2dafcd['replyId']),_0x275c7e=void 0x0!==_0x2dafcd['partIndex']?[_0x3921d7['changeGroups'][_0x2dafcd['partIndex']]]:_0x3921d7['changeGroups']['filter'](_0x48134f=>'pending'==_0x48134f['state']);for(const _0x509035 of this['_groupChangesByTarget'](_0x3921d7,_0x275c7e)){const {target:_0x457194,groups:_0x41b677,groupsIndexes:_0x4504f6,slice:_0x253f34}=_0x509035,_0x4f13a2=this['_getDocumentRangeForReplyChanges'](_0x2dafcd['replyId'],_0x4504f6[0x0]);if(!_0x4f13a2||'$graveyard'==_0x4f13a2['range']['root']['rootName']){_0x4504f6['forEach'](_0xa1f5bf=>_0x3921d7['setChangeGroupState'](_0xa1f5bf,'outdated'));continue;}_0x4504f6['forEach'](_0x44dcbc=>_0x3921d7['setChangeGroupState'](_0x44dcbc,'accepted'));const _0x521bb9=qs({'editor':_0x457194['editor'],'reply':_0x3921d7,'interaction':_0x2ef25b,'groups':_0x41b677,'transform':!0x0,'documentCompare':_0x95f881,'documentCompareOptions':{'anchor':_0x253f34?.['rootName']??'main','markDeletions':!0x1},'documentContextSlice':_0x253f34});let _0x11e23b;this['_scrollToSuggestionRange'](_0x4f13a2['range'],!0x1,_0x457194['editor']),_0x457194['editor']['model']['change'](_0x1d340e=>{_0x11e23b=_0x1d340e['batch'];for(const _0x5d769e of _0x521bb9)_0x5d769e['baseVersion']=_0x457194['editor']['model']['document']['version'],Qs(_0x457194['editor'],_0x5d769e),_0x1d340e['batch']['addOperation'](_0x5d769e),_0x457194['editor']['model']['applyOperation'](_0x5d769e);}),this['_batchToChanges']['set'](_0x11e23b,{'interactionId':_0x2ef25b['id'],'replyId':_0x3921d7['id'],'indexes':_0x4504f6['slice']()});}this['_updateRatings'](_0x3921d7);}['_rejectSuggestion'](_0x4b5976){const {reply:_0x4e9d54}=this['getInteractionAndReplyById'](_0x4b5976['replyId']);_0x4e9d54['setChangeGroupState'](_0x4b5976['partIndex'],'rejected');}['_openBalloonFor'](_0x1a0784,_0x538993){if(!this['_aiChatBalloon'])return;const {reply:_0x45d5bb}=this['getInteractionAndReplyById'](_0x1a0784),_0x327e44=_0x45d5bb['getContentParts']({'showDiff':this['_aiChatBalloonShowDiff'],'editor':$s(this['context'])});let _0x5278e5,_0x4e9539;if(void 0x0!==_0x538993?(_0x4e9539=_0x327e44['find'](_0x2e2d78=>_0x2e2d78['index']==_0x538993),_0x5278e5=_0x4e9539?.['index']):(_0x4e9539=_0x327e44[0x0],_0x5278e5=_0x4e9539['index']),this['_currentPreviewedChangeGroup']?.['replyId']==_0x1a0784&&this['_currentPreviewedChangeGroup']?.['partIndex']==_0x5278e5)return;const _0xcbbad3=this['_getUserPresentableContentPartDocumentRange'](_0x1a0784,_0x45d5bb,_0x4e9539),_0x419a9c=_0x45d5bb['changeGroups']['find'](_0x59a211=>_0x59a211['index']==_0x5278e5),_0x10b421=_0x419a9c?this['_resolveGroupTarget'](_0x45d5bb,_0x419a9c):null,_0x21cb35=_0x10b421?.['editor']??$s(this['context']),_0xaf651a=_0x21cb35['plugins']['has']('AIChatBalloon')?_0x21cb35['plugins']['get']('AIChatBalloon'):this['_aiChatBalloon'];if(this['_activeBalloon']&&this['_activeBalloon']!==_0xaf651a&&this['_activeBalloon']['close'](),!_0xcbbad3)return _0xaf651a['close'](),void(this['_activeBalloon']=void 0x0);this['_activeBalloon']=_0xaf651a,this['_currentPreviewedChangeGroup']={'replyId':_0x1a0784,'partIndex':_0x5278e5},this['_scrollToSuggestionRange'](_0xcbbad3,!0x0,_0x21cb35);const _0x15c952=this['_getPresentableSiblingContentPartIndex'](_0x1a0784,_0x5278e5,'next');_0xaf651a['updateContent']({'part':_0x4e9539,'renderingStrategy':'static'}),_0xaf651a['open']({'index':_0x5278e5,'title':hs(this['context']['locale'],'AI_BALLOON_HEADER_TITLE',(_0x5278e5+0x1)['toString']()),'showRotator':null!==_0x15c952,'ranges':[_0xcbbad3],'areActionsDisabled':_0x45d5bb['areActionsDisabled'],'targetEditor':_0x21cb35}),_0xaf651a['setState']('pending'),this['_aiChatUi']['scrollFeedToSuggestion'](_0x1a0784,_0x5278e5),this['_aiChatUi']['setFeedItemAIReplySuggestionPartActive']({'id':_0x1a0784,'index':_0x5278e5,'isActive':!0x0});}['_getPresentableSiblingContentPartIndex'](_0x1fed89,_0x4a796a,_0x2f6e6a){const {reply:_0x44452d}=this['getInteractionAndReplyById'](_0x1fed89),_0x4fbe59=_0x44452d['getContentParts']({'showDiff':this['_aiChatBalloonShowDiff'],'editor':$s(this['context'])});if(0x1==_0x4fbe59['length'])return null;const _0x101497=_0x4fbe59['findIndex'](_0xe2209e=>_0xe2209e['index']==_0x4a796a),_0x29aed4='next'==_0x2f6e6a?0x1:-0x1;let _0x3df88c=_0x4fbe59['at']((_0x101497+_0x29aed4)%_0x4fbe59['length'])['index'],_0x22d00c=_0x4fbe59[_0x3df88c];for(;!this['_getUserPresentableContentPartDocumentRange'](_0x1fed89,_0x44452d,_0x22d00c);){if(_0x3df88c=_0x4fbe59['at']((_0x3df88c+_0x29aed4)%_0x4fbe59['length'])['index'],_0x3df88c===_0x101497)return null;_0x22d00c=_0x4fbe59[_0x3df88c];}return _0x3df88c;}['_getUserPresentableContentPartDocumentRange'](_0x14ce5a,_0x9b01de,_0xd4f4a3){const _0x4726b9=_0x9b01de['changeGroups'];if(!_0xd4f4a3['hasChanges'])return null;const _0xe893da=_0x4726b9['find'](_0x577fcb=>_0x577fcb['index']==_0xd4f4a3['index']);if('pending'!==_0xe893da?.['state'])return null;const _0x21ab11=this['_getDocumentRangeForReplyChanges'](_0x14ce5a,_0xd4f4a3['index']);if(!_0x21ab11)return _0x9b01de['setChangeGroupState'](_0xd4f4a3['index'],'outdated'),null;const {range:_0x50b2ba,currentIndex:_0x2a0aeb}=_0x21ab11;return'$graveyard'==_0x50b2ba['root']['rootName']?(_0x9b01de['setChangeGroupState'](_0x2a0aeb,'outdated'),null):_0x21ab11['range'];}['_getDocumentRangeForReplyChanges'](_0x3c0e59,_0x48ff34){const {reply:_0x3a0c75}=this['getInteractionAndReplyById'](_0x3c0e59),_0x2baaa8=_0x3a0c75['changeGroups']['filter'](_0x3bf510=>'pending'==_0x3bf510['state']),_0x37c294=_0x2baaa8['map'](_0x34c647=>_0x3a0c75['changeGroups']['indexOf'](_0x34c647));void 0x0===_0x48ff34&&(_0x48ff34=_0x37c294[0x0]);const _0x668bd6=_0x37c294['indexOf'](_0x48ff34);if(-0x1==_0x668bd6)return null;const _0x199fe7=_0x2baaa8[_0x668bd6],_0x1409a7=this['_resolveGroupTarget'](_0x3a0c75,_0x199fe7);if(!_0x1409a7)return null;const {editor:_0x6cd7a7,root:_0x2650ca,parsedDocumentContent:_0x40bd40,serializedDocumentContent:_0x46ecea,version:_0x4c2d6f}=_0x1409a7,_0x3d7ab1=new _0x290fcd([]),_0x2f571b=new _0x290fcd([]);for(const _0xa89ca8 of _0x199fe7['changes']){const _0x59b587=this['activeConversation']?.['getSourceByDataId'](_0xa89ca8['id']);if((!_0x59b587||_0x59b587['editor']===_0x1409a7['editor']&&_0x59b587['rootName']===_0x1409a7['root']['rootName'])&&('removed'!=_0xa89ca8['type']&&_0x2f571b['children']['push'](_0xa89ca8['node']['cloneNode'](!0x0)),'new'!=_0xa89ca8['type'])){const _0x107e75=_0x4f11c1(_0x3db357=>Es(_0x3db357,'data-id')==_0xa89ca8['id'],_0x40bd40,!0x0);if(!_0x107e75)return null;_0x3d7ab1['children']['push'](_0x107e75['cloneNode'](!0x0));}}if(0x0==_0x3d7ab1['children']['length']){if(_0x199fe7['changes'][0x0]['anchorId']){const _0xdf5593=As('data-id',_0x199fe7['changes'][0x0]['anchorId'],_0x40bd40);_0x3d7ab1['children']['unshift'](_0xdf5593['cloneNode'](!0x0)),_0x2f571b['children']['unshift'](_0xdf5593['cloneNode'](!0x0)),_0xdf5593['nextSibling']&&(_0x3d7ab1['children']['push'](_0xdf5593['nextSibling']['cloneNode'](!0x0)),_0x2f571b['children']['push'](_0xdf5593['nextSibling']['cloneNode'](!0x0)));}else{const _0x5990ef=_0x40bd40['children'][0x0];if(!_0x5990ef)return null;_0x3d7ab1['children']['push'](_0x5990ef['cloneNode'](!0x0)),_0x2f571b['children']['push'](_0x5990ef['cloneNode'](!0x0));}}const _0x53e7a0=_0x6cd7a7['data']['parse'](_0x46ecea),_0x463f06=gs(_0x3d7ab1),_0x4790fe=_0x6cd7a7['data']['parse'](_0x463f06),_0x232153=_0x6cd7a7['data']['parse'](_0x463f06),_0x58022a=_0x6cd7a7['model']['createPositionAt'](_0x4790fe,0x0),_0xb13653=gs(_0x2f571b),_0x192073={'targetEditor':_0x6cd7a7,'anchor':_0x58022a,'markDeletions':!0x1},_0x215a3a=_0x6cd7a7['plugins']['get'](_0x47efd0)['getDiff'](_0x463f06,_0xb13653,_0x192073)['getOperations']();if(!_0x215a3a['length'])return null;_0x6cd7a7['model']['change'](_0x2ff3fd=>{for(const _0x646d7a of _0x215a3a)if('remove'==_0x646d7a['type']){const _0x8daea4=_0x646d7a['sourcePosition'],_0x4031c2=_0x646d7a['howMany'],_0x54a6d7=new _0x48a283(_0x8daea4,_0x4031c2);_0x2ff3fd['batch']['addOperation'](_0x54a6d7),_0x6cd7a7['model']['applyOperation'](_0x54a6d7);}else'marker'!==_0x646d7a['type']&&(_0x646d7a['baseVersion']=null,_0x646d7a['isDocumentOperation']=!0x1,_0x2ff3fd['batch']['addOperation'](_0x646d7a),_0x6cd7a7['model']['applyOperation'](_0x646d7a));});const _0x1533fd=ks(_0x6cd7a7,_0x215a3a,_0x4790fe);Ns(_0x6cd7a7['model'],_0x1533fd);const _0x32d09c=_0x1533fd['getFirstRange']()['start']['path']['slice'](),_0x427ce5=_0x1533fd['getFirstRange']()['end']['path']['slice'](),_0x1b1877=[];let _0x30eb01=_0x4790fe,_0x5d2814=_0x232153;for(let _0x728772=0x0;_0x728772<_0x427ce5['length'];_0x728772++){const _0x2eabf0=_0x30eb01['maxOffset']-_0x427ce5[_0x728772];_0x1b1877[_0x728772]=_0x5d2814['maxOffset']-_0x2eabf0,_0x30eb01=_0x30eb01['getChildAtOffset'](_0x427ce5[_0x728772]),_0x5d2814=_0x5d2814['getChildAtOffset'](_0x1b1877[_0x728772]);}const _0x4d3acf=_0x6cd7a7['model']['createRange'](_0x6cd7a7['model']['createPositionFromPath'](_0x232153,_0x32d09c),_0x6cd7a7['model']['createPositionFromPath'](_0x232153,_0x1b1877)),_0x3e979e=_0x232153['getChild'](0x0)['getAttribute'](_0x138817),_0x4f03d1=Array['from'](_0x53e7a0['getChildren']())['find'](_0x5a93f7=>_0x5a93f7['getAttribute'](_0x138817)==_0x3e979e)['getPath'](),_0x1bc06a=_0x4d3acf['start']['path']['slice'](),_0x401263=_0x4d3acf['end']['path']['slice']();_0x1bc06a[0x0]=_0x4f03d1[0x0]+_0x1bc06a[0x0],_0x401263[0x0]=_0x4f03d1[0x0]+_0x401263[0x0];let _0x54c8a3=_0x6cd7a7['model']['createRange'](_0x6cd7a7['model']['createPositionFromPath'](_0x2650ca,_0x1bc06a),_0x6cd7a7['model']['createPositionFromPath'](_0x2650ca,_0x401263));const _0x77601e=_0x6cd7a7['model']['document']['history']['getOperations'](_0x4c2d6f);for(const _0x11ff8a of _0x77601e)_0x54c8a3=_0x5ca4e8['_createFromRanges'](_0x54c8a3['getTransformedByOperation'](_0x11ff8a));return{'range':_0x54c8a3,'currentIndex':_0x48ff34};}['_integrateEditorBalloon'](_0x3999fb){if(!_0x3999fb['plugins']['has']('AIChatBalloon'))return;const _0x531fa0=_0x3999fb['plugins']['get']('AIChatBalloon');this['_wiredBalloons']['has'](_0x531fa0)||(this['_wiredBalloons']['add'](_0x531fa0),this['_aiChatBalloon']||(this['_aiChatBalloon']=_0x531fa0),_0x531fa0['bind']('showDiff')['to'](this,'_aiChatBalloonShowDiff'),this['listenTo'](_0x531fa0,'toggleSuggestionDisplayMode',()=>{const {replyId:_0x435970,partIndex:_0x25ef84}=this['_currentPreviewedChangeGroup'];this['_aiChatBalloonShowDiff']=!this['_aiChatBalloonShowDiff'];const {reply:_0x840ace}=this['getInteractionAndReplyById'](_0x435970),_0x15c033=_0x840ace['changeGroups']['find'](_0x545318=>_0x545318['index']===_0x25ef84),_0x3c6073=_0x15c033?this['_resolveGroupTarget'](_0x840ace,_0x15c033):null,_0x5b849c=_0x840ace['getContentParts']({'showDiff':this['_aiChatBalloonShowDiff'],'groupIndex':_0x25ef84,'editor':_0x3c6073?.['editor']??$s(this['context'])});(this['_activeBalloon']??_0x531fa0)['updateContent']({'part':_0x5b849c[0x0],'renderingStrategy':'static','keepErrors':!0x0});}),this['listenTo'](_0x531fa0,'applySuggestion',()=>{const {replyId:_0x912015,partIndex:_0x2d3b59}=this['_currentPreviewedChangeGroup'];this['_applySuggestion']({'replyId':_0x912015,'partIndex':_0x2d3b59}),(this['_activeBalloon']??_0x531fa0)['setState']('accepted');}),this['listenTo'](_0x531fa0,'insertSuggestion',()=>{const {replyId:_0x1a19ba,partIndex:_0x58cad0}=this['_currentPreviewedChangeGroup'];this['_insertSuggestion']({'replyId':_0x1a19ba,'partIndex':_0x58cad0}),(this['_activeBalloon']??_0x531fa0)['setState']('accepted');}),this['listenTo'](_0x531fa0,'rejectSuggestion',()=>{const {replyId:_0x3e8f5a,partIndex:_0x1491c2}=this['_currentPreviewedChangeGroup'];this['_rejectSuggestion']({'replyId':_0x3e8f5a,'partIndex':_0x1491c2}),(this['_activeBalloon']??_0x531fa0)['setState']('rejected');}),this['listenTo'](_0x531fa0,'showNext',()=>{const {replyId:_0x4ce765,partIndex:_0x17fbfd}=this['_currentPreviewedChangeGroup'],_0x55e468=this['_getPresentableSiblingContentPartIndex'](_0x4ce765,_0x17fbfd,'next');null!==_0x55e468&&this['_openBalloonFor'](_0x4ce765,_0x55e468);}),this['listenTo'](_0x531fa0,'showPrevious',()=>{const {replyId:_0x2ce3e1,partIndex:_0x5ae62b}=this['_currentPreviewedChangeGroup'],_0x26bd75=this['_getPresentableSiblingContentPartIndex'](_0x2ce3e1,_0x5ae62b,'previous');null!==_0x26bd75&&this['_openBalloonFor'](_0x2ce3e1,_0x26bd75);}),this['listenTo'](_0x531fa0,'dialogClosed',(_0x3d0d2f,{id:_0x3e0e6b})=>{if('aiChatBalloon'!==_0x3e0e6b)return;const {replyId:_0x16fbf9,partIndex:_0x2bd6e4}=this['_currentPreviewedChangeGroup'];this['_currentPreviewedChangeGroup']=null,this['_aiChatUi']['setFeedItemAIReplySuggestionPartActive']({'id':_0x16fbf9,'index':_0x2bd6e4,'isActive':!0x1}),this['_activeBalloon']===_0x531fa0&&(this['_activeBalloon']=void 0x0);}));}['_integrateEditor'](_0x178bf1){if(this['_integrateEditorBalloon'](_0x178bf1),_0x178bf1['plugins']['has']('Undo')){const _0xeb407b=_0x178bf1['commands']['get']('undo'),_0x2dd280=_0x178bf1['commands']['get']('redo');this['listenTo'](_0xeb407b,'revert',(_0x1745ac,_0x5bd4f0,_0x32fac3)=>{const _0x295d9d=this['_batchToChanges']['get'](_0x5bd4f0);if(!_0x295d9d)return;const _0x2d6b24=this['activeConversation']['getInteraction'](_0x295d9d['interactionId']),_0x49c416=_0x2d6b24?.['getReply'](_0x295d9d['replyId']);this['_batchToChanges']['delete'](_0x5bd4f0),_0x2d6b24&&_0x49c416&&(_0x295d9d['indexes']['forEach'](_0x23a884=>_0x49c416['setChangeGroupState'](_0x23a884,'pending')),this['_batchToChanges']['set'](_0x32fac3,_0x295d9d));}),this['listenTo'](_0x2dd280,'revert',(_0x5b188a,_0x19a44e,_0x45fd4f)=>{const _0x209ac6=this['_batchToChanges']['get'](_0x19a44e);if(!_0x209ac6)return;const _0x4cfcbf=this['activeConversation']['getInteraction'](_0x209ac6['interactionId']),_0x2a6ed5=_0x4cfcbf?.['getReply'](_0x209ac6['replyId']);this['_batchToChanges']['delete'](_0x19a44e),_0x4cfcbf&&_0x2a6ed5&&(_0x209ac6['indexes']['forEach'](_0x4d8747=>_0x2a6ed5['setChangeGroupState'](_0x4d8747,'accepted')),this['_batchToChanges']['set'](_0x45fd4f,_0x209ac6));});}const _0x3afb42=_0x178bf1['config']['get']('ai.chat.context');_0x3afb42['alwaysAddSelection']&&_0x3afb42['document']['enabled']&&this['listenTo'](_0x178bf1['model']['document']['selection'],'change:range',(_0x5d17d7,_0x23e38b)=>{if(!_0x23e38b['directChange'])return;'chat'===_0x178bf1['plugins']['get']('AITabs')['view']['activeTab']&&(_0x178bf1['model']['hasContent'](_0x178bf1['model']['document']['selection'])?this['addSelectionToChatContext']():this['removeSelectionFromChatContext']());});}async['_getLastCreatedConversationId'](){const _0x5c4d5f=this['_aiConnector']['fetchConversations'](this['getGroupId'](),{'limit':0x1,'sortBy':'createdAt'});try{const _0x33beeb=await _0x5c4d5f['getConversations']();return _0x33beeb['length']?_0x33beeb[0x0]['id']:'new';}catch(_0x179e02){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':_0x179e02})),this['_aiChatUi']['toggleLoadingSkeleton'](!0x1),this['_aiChatUi']['disableControls'](),null;}}async['_startConversationSafely'](_0x86617={}){try{this['_aiChatUi']['enableControls'](),await this['_handleStartConversation'](_0x86617);}catch(_0x79d77c){this['_aiChatUi']['addFeedItemError']({'errorMessage':hs(this['context']['locale'],'AI_CHAT_UNABLE_TO_START_CONVERSATION'),'id':_0x86617['id']||ot()}),console['error'](_0x79d77c),this['activeConversation']=void 0x0,this['_aiChatUi']['disableControls']();}}async['_handleStartConversation']({id:_0x4e6995,modelId:_0x4f2639}={}){this['_activeBalloon']?.['close'](),this['_activeBalloon']=void 0x0,this['_currentPreviewedChangeGroup']=null;let _0x56a76e=_0x4f2639;_0x56a76e||(_0x4e6995||!this['activeConversation']?_0x56a76e=this['context']['config']['get']('ai.models.defaultModelId'):this['_aiChatUi']['isModelAvailable']&&(_0x56a76e=this['activeConversation']['selectedModel']['id'])),await this['_stopLastInteraction']();const _0x7a1e47=this['getGroupId'](),_0x3aa6f6=_0x4e6995||ot();let _0x435aab;this['activeConversation']=new Gs({'connector':this['_aiConnector'],'chatModels':this['_aiChatModels'],'selectedModelId':_0x56a76e,'conversationId':_0x3aa6f6,'group':_0x7a1e47,'getEditor':()=>$s(this['context']),'getEditors':()=>Ws(this['context']),'locale':this['context']['locale'],'isFromHistory':!!_0x4e6995}),this['activeConversation']['delegate']('toolDataReceived','interactionCreated','interactionStarted','replyCreated')['to'](this),this['activeConversation']['on']('conversationInitialized',(_0x3975ca,_0x190708)=>{this['_aiChatUi']['createConversation'](_0x190708),this['_aiChatUi']['resetMessageInput'](),this['_aiChatUi']['clearPendingContextUI'](),this['_aiChatUi']['clearConversationContextUI'](),_0x4e6995||(this['_aiChatUi']['resetConversationTitle'](),this['addCurrentDocumentToChatContext']());}),this['activeConversation']['on']('uploadProgressChanged',(_0x3a584c,_0x49efcf)=>{this['_aiChatUi']['setIsUploadInProgress'](_0x49efcf['isUploadInProgress']);}),this['activeConversation']['on']('webSearchStarted',()=>{const _0x3a842a=this['_aiChatUi']['prepareLoadingMessage']({'isWebSearchEnabled':!0x0,'isReasoningEnabled':!0x1});this['_aiChatUi']['setLoadingMessage'](_0x3a842a);}),this['activeConversation']['on']('reasoningStarted',()=>{const _0x1ab8a4=this['_aiChatUi']['prepareLoadingMessage']({'isWebSearchEnabled':!0x1,'isReasoningEnabled':!0x0});this['_aiChatUi']['setLoadingMessage'](_0x1ab8a4);}),this['activeConversation']['on']('webSearchFinished',(_0x5d268c,_0x130dc8)=>{this['_aiChatUi']['addFeedInteractionHeader'](_0x130dc8,{'isWebSearchEnabled':!0x0,'isReasoningEnabled':!0x1});}),this['activeConversation']['on']('reasoningFinished',(_0x45f087,_0x559b5c)=>{this['_aiChatUi']['addFeedInteractionHeader'](_0x559b5c,{'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',(_0x21c041,_0x3ded36)=>{this['_aiChatUi']['removeFeedInteraction'](_0x3ded36['id']);}),this['activeConversation']['on']('setConversationTitle',(_0x42f014,_0x880f96,_0x3deda4)=>{this['_updateConversationTitle'](_0x880f96,_0x3deda4);}),this['activeConversation']['on']('replyContentUpdated',async(_0x59d3ad,_0x298aae)=>{void 0x0!==_0x435aab&&_0x435aab!==_0x298aae['id']&&this['_updateReplyContentThrottled']['flush'](),_0x435aab=_0x298aae['id'],_0x298aae['isFromHistory']?await this['_updateReplyContent']({'reply':_0x298aae}):await this['_updateReplyContentThrottled']({'reply':_0x298aae});}),this['activeConversation']['on']('replyChangeGroupStateUpdated',(_0x7384f2,{reply:_0x134bb3,index:_0x26dd2f,state:_0x19bc8a})=>{this['_aiChatUi']['updateFeedItemAIReplySuggestionPartState']({'id':_0x134bb3['id'],'index':_0x26dd2f,'state':_0x19bc8a}),this['_currentPreviewedChangeGroup']?.['replyId']['includes'](_0x134bb3['id'])&&this['_currentPreviewedChangeGroup']?.['partIndex']==_0x26dd2f&&(this['_activeBalloon']??this['_aiChatBalloon'])?.['setState'](_0x19bc8a);}),this['activeConversation']['on']('contextItemAdded',(_0x757773,_0x4c88ac)=>{if(this['_aiChatUi']['addContextItem'](_0x4c88ac['contextItem'],_0x4c88ac['isLoading']),'selection'===_0x4c88ac['contextItem']['type']){const _0x3ab3dd=[...$s(this['context'])['model']['document']['selection']['getRanges']()];this['_aiEditing']['showFakeVisualSelection']({'ranges':_0x3ab3dd,'id':'context','priority':0x1});}}),this['activeConversation']['on']('contextItemRemoved',(_0x3df630,_0x21020b)=>{this['_aiChatUi']['removeContextItem'](_0x21020b['uiId']),'current-document'==_0x21020b['uiId']&&this['removeSelectionFromChatContext'](),'selection'===_0x21020b['type']&&this['_aiEditing']['hideFakeVisualSelection']('context');}),this['activeConversation']['on']('contextItemLoadingEnded',(_0x4c468c,_0x5b1a22)=>{this['_aiChatUi']['setContextItemLoading'](_0x5b1a22['contextItem']['uiId'],_0x5b1a22['isLoading']);}),this['activeConversation']['on']('contextSent',(_0x404e49,_0x328e54)=>{this['_aiChatUi']['setConversationContext'](_0x328e54['contextItems']);}),this['activeConversation']['on']('addContextOptionsChanged',(_0x4872ff,_0x4e9746)=>{this['_aiChatUi']['setAddContextOptions'](_0x4e9746['options']);}),this['activeConversation']['on']('sourceResourcesLoaded',(_0x4e2c1d,_0x2aaeea)=>{this['_aiChatUi']['populateSourceResourceBalloon'](_0x2aaeea['sourceId'],_0x2aaeea['source'],_0x2aaeea['resources'],_0x2aaeea['uid']);}),this['activeConversation']['on']('resourceStateChanged',(_0x122ed3,_0x45f4c1)=>{this['_aiChatUi']['updateResourceState'](_0x45f4c1['sourceId'],_0x45f4c1['resourceId'],_0x45f4c1['isInContext']);}),this['activeConversation']['on']('capabilitiesUpdated',(_0x549c15,_0x39a81b)=>{this['_aiChatUi']['updateCapabilities'](_0x39a81b);}),this['activeConversation']['on']('modelSelected',async(_0x18cb97,_0x4c8a12)=>{const _0xc4dbf7=(await this['_aiChatModels']['getAll']())['find'](_0x1273a0=>_0x1273a0['id']===_0x4c8a12['selectedModel']?.['id'])||null;this['_aiChatUi']['setSelectedModel'](_0xc4dbf7,_0x4c8a12['isDisabled']);}),this['activeConversation']['on']('error',(_0x40a5bb,{error:_0x1a20f0,interactionId:_0x487565,fileName:_0x48a80d,url:_0x1c24ae,sourceId:_0x16391d,sourceLabel:_0x310e56})=>{const _0xaa93ee=_0x487565?_0x487565+':'+ot():ot();_0x1a20f0['message']['startsWith']('ai-request-aborted')?this['_aiChatUi']['addFeedItemStaticMessage']({'staticMessage':hs(this['context']['locale'],'AI_CHAT_ABORTED_MESSAGE'),'id':_0xaa93ee}):_0x1a20f0['message']['startsWith']('ai-chat-conversation-init-failed')||_0x1a20f0['message']['startsWith']('ai-chat-conversation-start-failed')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':hs(this['context']['locale'],'AI_CHAT_UNABLE_TO_START_CONVERSATION'),'id':_0xaa93ee}),this['_logError'](_0x1a20f0)):_0x1a20f0['message']['startsWith']('ai-chat-file-upload-failed')?this['_aiChatUi']['addFeedItemError']({'errorMessage':hs(this['context']['locale'],'AI_CHAT_CONTEXT_UNABLE_TO_UPLOAD_FILE',_0x48a80d),'id':_0xaa93ee}):_0x1a20f0['message']['startsWith']('ai-chat-url-upload-failed')?this['_aiChatUi']['addFeedItemError']({'errorMessage':hs(this['context']['locale'],'AI_CHAT_CONTEXT_UNABLE_TO_UPLOAD_URL',_0x1c24ae),'id':_0xaa93ee}):_0x1a20f0['message']['startsWith']('ai-chat-context-invalid-data')?this['_aiChatUi']['addFeedItemError']({'errorMessage':hs(this['context']['locale'],'AI_CHAT_CONTEXT_INVALID_DATA'),'id':_0xaa93ee}):_0x1a20f0['message']['startsWith']('ai-chat-context-unsupported-type')?this['_aiChatUi']['addFeedItemError']({'errorMessage':hs(this['context']['locale'],'AI_CHAT_CONTEXT_UNSUPPORTED_TYPE'),'id':_0xaa93ee}):_0x1a20f0['message']['startsWith']('ai-chat-source-resources-load-failed')?(_0x16391d&&this['_aiChatUi']['closeSourceResourceBalloon'](_0x16391d),this['_aiChatUi']['addFeedItemError']({'errorMessage':hs(this['context']['locale'],'AI_CHAT_CONTEXT_UNABLE_TO_LOAD_RESOURCES',_0x310e56||'source'),'id':_0xaa93ee}),this['_logError'](_0x1a20f0)):_0x1a20f0['message']['startsWith']('ai-chat-resource-load-failed')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':hs(this['context']['locale'],'AI_CHAT_RESOURCE_LOAD_FAILED'),'id':_0xaa93ee}),this['_logError'](_0x1a20f0)):_0x1a20f0['message']['startsWith']('ai-chat-invalid-request')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':hs(this['context']['locale'],'AI_CHAT_INVALID_REQUEST'),'id':_0xaa93ee}),this['_logError'](_0x1a20f0)):_0x1a20f0['message']['startsWith']('ai-chat-context-unsupported-file-type')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':hs(this['context']['locale'],'AI_CHAT_CONTEXT_UNSUPPORTED_FILE_TYPE'),'id':_0xaa93ee}),this['_logError'](_0x1a20f0)):_0x1a20f0['message']['startsWith']('ai-chat-context-file-too-large')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':hs(this['context']['locale'],'AI_CHAT_CONTEXT_FILE_TOO_LARGE'),'id':_0xaa93ee}),this['_logError'](_0x1a20f0)):_0x1a20f0['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':_0xaa93ee}),this['_logError'](_0x1a20f0)):_0x1a20f0['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':_0xaa93ee}),this['_logError'](_0x1a20f0)):(this['_aiChatUi']['addFeedItemError']({'errorMessage':hs(this['context']['locale'],'AI_CHAT_GENERIC_ERROR'),'id':_0xaa93ee}),this['_logError'](_0x1a20f0));}),await this['activeConversation']['init'](this['context']['config']['get']('ai.chat.context')),_0x4e6995||await this['activeConversation']['start']();}async['_handleUIUserMessage']({message:_0x292a93,attributes:_0x1fe795}){if(!this['activeConversation'])throw new at('ai-chat-controller-no-active-conversation');if(this['activeConversation']['isCurrentDocumentInContext']()){const _0x24d226=await this['_aiEditing']['getDocumentData']();_0x24d226['length']>0x1?await this['activeConversation']['updateCurrentDocumentsInContext'](_0x24d226):await this['activeConversation']['updateCurrentDocumentInContext'](_0x24d226[0x0]);}this['activeConversation']['id']&&this['activeConversation']['isStarted']&&await this['activeConversation']['handleUserInteraction']({'userMessage':_0x292a93,'attributes':_0x1fe795});}['_logError'](_0x5f09cb){Et(_0x5f09cb['message']);}['_removeFromContext'](_0x1c91b2){this['activeConversation']?.['removeFromContext'](_0x1c91b2);}['_toggleWebSearch'](){this['activeConversation']?.['toggleWebSearch']();}['_toggleReasoning'](){this['activeConversation']?.['toggleReasoning']();}['getInteractionAndReplyById'](_0xde19b3){const [_0x2fc6b8,_0xed576e]=_0xde19b3['split'](':'),_0x24bd6f=this['activeConversation']['getInteraction'](_0x2fc6b8),_0x5931d1=_0x24bd6f['getReply'](_0xed576e);return{'interaction':_0x24bd6f,'reply':_0x5931d1};}['_resolveGroupTarget'](_0x5214f5,_0x5e35c0){const _0xadbfe9=[..._0x5e35c0['changes']['filter'](_0x5a4120=>'context'!==_0x5a4120['type']),..._0x5e35c0['changes']['filter'](_0x22afe2=>'context'===_0x22afe2['type'])];for(const _0x37ce89 of _0xadbfe9){const _0x322659=_0x5214f5['newNodeAnchorIds']['get'](_0x37ce89['id']),_0x2f9c39=this['activeConversation']?.['getSourceByDataId'](_0x37ce89['id'])||this['activeConversation']?.['getSourceByDataId'](_0x322659)||this['activeConversation']?.['getSourceByDataId'](_0x37ce89['anchorId']??void 0x0);if(_0x2f9c39){if('destroyed'===_0x2f9c39['editor']['state'])return null;const _0x2ce7ca=_0x2f9c39['editor']['model']['document']['getRoot'](_0x2f9c39['rootName']);return _0x2ce7ca?{'editor':_0x2f9c39['editor'],'root':_0x2ce7ca,'parsedDocumentContent':_s(_0x2f9c39['content']),'serializedDocumentContent':_0x2f9c39['content'],'version':_0x2f9c39['version']}:null;}}const _0x24c3d7=$s(this['context']),_0x2e26f1=this['activeConversation']['getInteraction'](_0x5214f5['interactionId']),_0x39514b=_0x2e26f1?.['getDocumentContext']();return{'editor':_0x24c3d7,'root':_0x24c3d7['model']['document']['getRoot'](),'parsedDocumentContent':_0x5214f5['documentContextContent'],'serializedDocumentContent':_0x39514b?.['content'],'version':_0x39514b?.['version']};}['_groupChangesByTarget'](_0x5c5aa5,_0x3c1b85){const _0xd9ea44=new Map();for(const _0x2b03e9 of _0x3c1b85){const _0x26680a=this['_resolveGroupTarget'](_0x5c5aa5,_0x2b03e9);if(!_0x26680a)continue;const _0x4df793=(_0x26680a['editor']['id']||'e')+'|'+_0x26680a['root']['rootName'];let _0x3624ab=_0xd9ea44['get'](_0x4df793);if(!_0x3624ab){let _0x25dbd2;for(const _0x45f731 of[..._0x2b03e9['changes']['filter'](_0x4e8fef=>'context'!==_0x4e8fef['type']),..._0x2b03e9['changes']['filter'](_0x33e4b4=>'context'===_0x33e4b4['type'])])if(_0x25dbd2=this['activeConversation']?.['getDocumentContextSliceByDataId'](_0x45f731['id'])||this['activeConversation']?.['getDocumentContextSliceByDataId'](_0x5c5aa5['newNodeAnchorIds']['get'](_0x45f731['id'])),_0x25dbd2)break;_0x3624ab={'target':{'editor':_0x26680a['editor'],'root':_0x26680a['root']},'slice':_0x25dbd2,'groups':[],'groupsIndexes':[]},_0xd9ea44['set'](_0x4df793,_0x3624ab);}_0x3624ab['groups']['push'](_0x2b03e9),_0x3624ab['groupsIndexes']['push'](_0x5c5aa5['changeGroups']['indexOf'](_0x2b03e9));}return Array['from'](_0xd9ea44['values']());}['_scrollToSuggestionRange'](_0x1824c1,_0x168ab9=!0x1,_0x3eacb5){const _0x3fcafc={'target':_0x3eacb5['editing']['view']['domConverter']['viewRangeToDom'](_0x3eacb5['editing']['mapper']['toViewRange'](_0x1824c1)),'viewportOffset':{'top':0x96,'left':0x0,'bottom':0x32,'right':0x0},'ancestorOffset':0x14,'alignToTop':_0x168ab9};_0x168ab9&&(_0x3fcafc['alignToTop']=!0x0),Ct(_0x3fcafc);}['_updateConversationTitle'](_0x2d2efd,_0x4eec5f=!0x1){this['_aiChatUi']['setConversationTitle'](_0x2d2efd||hs(this['context']['locale'],'AI_CHAT_UNTITLED_CONVERSATION'),_0x4eec5f);}['_addFeedItemReply'](_0x5041fa){'text'===_0x5041fa['type']?this['_aiChatUi']['addFeedItemAIReply'](_0x5041fa):this['_aiChatUi']['addFeedItemAISuggestion'](_0x5041fa);}async['_updateReplyContent']({reply:_0x4afd24,renderingStrategy:_0x552db8}){const {id:_0x1a118e,interactionId:_0x4a5698,isDone:_0x5d10ae,type:_0x1a0945,parsedContent:_0x50918d}=_0x4afd24,_0x1c018b=_0x4a5698+':'+_0x1a118e;if('modification'===_0x1a0945){const _0x4198e3=_0x4afd24['getContentParts']({'showDiff':this['_aiChatUi']['showDiff'],'editor':$s(this['context'])});await this['_aiChatUi']['updateFeedItemAIReplySuggestionContent']({'id':_0x1c018b,'parts':_0x4198e3,'isDone':_0x5d10ae,'skipLoadingEffects':_0x4afd24['isFromHistory']});}else'text'===_0x1a0945&&await this['_aiChatUi']['updateFeedItemAIReplyContent']({'id':_0x1c018b,'parsedContent':_0x50918d,'renderingStrategy':_0x552db8,'isDone':_0x5d10ae});_0x5d10ae&&_0x4afd24['sources']['length']>0x0&&this['_aiChatUi']['updateFeedItemAIReplySources'](_0x1c018b,_0x4afd24['sources']);}['_updateReplyContentThrottled']=_0x42e740(this['_updateReplyContent']['bind'](this),0xc8);async['_stopLastInteraction'](){const _0x4dba31=this['activeConversation']?.['lastInteraction'];_0x4dba31&&(_0x4dba31['stop'](),this['_aiChatUi']['stopInteraction'](_0x4dba31)),this['_updateReplyContentThrottled']['cancel']();}async['_flushLastInteractionUI'](){const _0x3cbb7a=this['activeConversation']?.['lastInteraction'];if(_0x3cbb7a){for await(const _0x23b41e of _0x3cbb7a['replies'])this['_aiChatUi']['hasFeedItem'](_0x23b41e['id'])||this['_addFeedItemReply'](_0x23b41e),await this['_updateReplyContent']({'reply':_0x23b41e,'renderingStrategy':'static'});}}['_updateRatings'](_0x5ac3c6){const _0x2880ef={'positiveCount':_0x5ac3c6['changeGroups']['filter'](_0x377dd7=>'accepted'===_0x377dd7['state'])['length'],'totalCount':_0x5ac3c6['changeGroups']['length'],'modificationId':_0x5ac3c6['id']},_0x5b7b4a=this['activeConversation']['getInteraction'](_0x5ac3c6['interactionId'])['messageId'];_0x5b7b4a&&this['_aiConnector']['upsertAIChatRating'](this['activeConversation']['id'],_0x5b7b4a,_0x2880ef);}['_getAIChatFeedAPI'](_0x116376){const _0x40d82e=this['_aiChatUi'],_0xb705bb=()=>{_0x116376['resetWebSearchState'](),_0x116376['resetReasoningState'](),_0x40d82e['clearLoadingMessage']();},_0x178c20=()=>{_0x116376['currentReply']&&(_0x116376['currentReply']['done'](),_0x116376['currentReply']=void 0x0);};return{'insertTextReply':(_0x4d5d9a,_0x32b5fb)=>{_0x178c20(),_0xb705bb();const _0x30a41e=_0x116376['currentReply']=_0x116376['createReply']({'type':'text','interactionId':_0x116376['id'],'content':_0x4d5d9a,'id':_0x32b5fb||ot()});return _0x178c20(),_0x30a41e;},'insertCustomElement':async(_0xd3c5e6,_0x4cc1b8)=>(_0x178c20(),_0xb705bb(),_0x40d82e['addFeedItemCustomElement'](_0xd3c5e6,_0x4cc1b8||ot())),'setLoadingMessage':_0x379cf8=>{_0x40d82e['setLoadingMessage'](_0x379cf8);},'clearLoadingMessage':()=>{_0x40d82e['clearLoadingMessage']();}};}}const zs='ai-selection',js=['br'];class Js extends _0x173dbd{constructor(_0x33ce5c){super(_0x33ce5c),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 _0x4f73cf=Ws(this['context']),_0x57ef76=_0x4f73cf['find'](_0x3e9721=>_0x3e9721['plugins']['has']('RealTimeCollaborationClient'))||_0x4f73cf[0x0],_0x53bee6=_0x57ef76['plugins']['has']('RealTimeCollaborationClient')&&_0x57ef76['plugins']['get']('RealTimeCollaborationClient')['sessionId'];this['_sessionId']=_0x53bee6||ot();}return this['_sessionId'];}async['getDocumentData'](){const _0x5bf8b7=Ws(this['context']);if(!_0x5bf8b7['length'])throw new at('ai-get-editor-from-context-no-editor');const _0x5f3b25=[],_0x257e1d=new Set();for(const _0x5648a5 of _0x5bf8b7){const _0x13d30a=_0x5648a5['config']['get']('roots')||{};for(const _0x46b9c0 of _0x5648a5['model']['document']['getRoots']()){if('$graveyard'===_0x46b9c0['rootName'])continue;const _0x5f5d60=await this['_getDocumentDataForEditorRoot'](_0x5648a5,_0x46b9c0,_0x257e1d),_0x49a3b4=_0x13d30a[_0x46b9c0['rootName']];let _0x477e90;_0x49a3b4?.['label']?_0x477e90=_0x49a3b4['label']:(It('ai-document-root-missing-label',{'editor':_0x5648a5,'rootConfig':_0x49a3b4}),_0x477e90=_0x46b9c0['rootName']),_0x5f3b25['push']({'editor':_0x5648a5,'rootName':_0x46b9c0['rootName'],'content':_0x5f5d60['content'],'version':_0x5f5d60['version'],'sessionId':this['sessionId'],'channelId':_0x5648a5['config']['get']('collaboration.channelId'),'selections':_0x5f5d60['selections'],'name':_0x477e90,'description':_0x49a3b4?.['description']});}}return _0x5f3b25;}async['_getDocumentDataForEditorRoot'](_0x46f117,_0x3a06fa,_0x543030){const _0x4f5e57=_0x46f117['data']['toView'](_0x3a06fa,{'convertAiChatSelectionMarker':!0x0}),_0x16e62a=new _0x27a0d8(_0x46f117['editing']['view']['document']);this['_setDataIdsOnChildren'](_0x4f5e57,_0x16e62a,_0x543030);let _0x58b965=await this['_getDocumentDataStringFromView'](_0x4f5e57,_0x46f117);const _0x4354b1=this['_getMarkersInDocumentOrder'](_0x46f117,_0x3a06fa),_0x32fd1d=[];for(const _0x21b0f4 of _0x4354b1){const _0xfacfc7='<'+_0x21b0f4['name']+':start></'+_0x21b0f4['name']+':start>',_0x55392a=_0x58b965['indexOf'](_0xfacfc7);_0x58b965=_0x58b965['substring'](0x0,_0x55392a)+_0x58b965['substring'](_0x55392a+_0xfacfc7['length']);const _0x51a105='<'+_0x21b0f4['name']+':end></'+_0x21b0f4['name']+':end>',_0xaf088a=_0x58b965['indexOf'](_0x51a105);_0x58b965=_0x58b965['substring'](0x0,_0xaf088a)+_0x58b965['substring'](_0xaf088a+_0x51a105['length']),_0x32fd1d['push']({'markerName':_0x21b0f4['name'],'start':_0x55392a,'end':_0xaf088a,'htmlFragment':_0x58b965['substring'](_0x55392a,_0xaf088a)});}return{'content':_0x58b965,'version':_0x46f117['model']['document']['version'],'selections':_0x32fd1d};}async['afterInit'](){this['context']instanceof _0x2ef8df?this['_integrateEditor'](this['context']):this['listenTo'](this['context']['editors'],'add',(_0x319a43,_0x36e677)=>{_0x36e677['on']('ready',()=>{this['_integrateEditor'](_0x36e677);});});}['_setOutputDataProcessor'](_0x284004){this['_outputDataProcessor']=_0x284004;}async['_getDocumentDataStringFromView'](_0x51f93f,_0x5933ee){let _0x37ea88;if(this['_outputDataProcessor']){const _0x5d9698=_0x5933ee['data']['processor']['domConverter']['viewToDom'](_0x51f93f),_0x194e9f=await this['_outputDataProcessor'](_0x5d9698);_0x37ea88=_0x5933ee['data']['processor']['htmlWriter']['getHtml'](_0x194e9f);}else _0x37ea88=_0x5933ee['data']['processor']['toData'](_0x51f93f);return _0x37ea88;}['_integrateEditor'](_0x1fb83e){if(!_0x1fb83e['config']['get']('collaboration.channelId'))throw new at('ai-missing-channel-id',_0x1fb83e);_0x1fb83e['ui']['focusTracker']['on']('change:isFocused',(_0x521fc9,_0x249c8,_0x352771)=>{_0x352771&&(this['_lastContentFocusedEditor']=_0x1fb83e);}),_0x1fb83e['on']('destroy',()=>{this['_lastContentFocusedEditor']===_0x1fb83e&&(this['_lastContentFocusedEditor']=void 0x0);}),_0x1fb83e['conversion']['for']('editingDowncast')['markerToHighlight']({'model':zs,'view':({markerName:_0x40ed52})=>({'classes':['ck-ai-assistant-ui_theme','ck-fake-ai-selection','ck-fake-ai-selection-'+_0x40ed52['split'](':')[0x1]],'priority':0xc})}),_0x1fb83e['conversion']['for']('dataDowncast')['markerToElement']({'model':zs+':context','view':(_0x4c2690,{writer:_0x13493c,options:_0x592d5c})=>_0x592d5c['convertAiChatSelectionMarker']?_0x13493c['createUIElement'](_0x4c2690['markerName']+':'+(_0x4c2690['isOpening']?'start':'end')):null});}['showFakeVisualSelection'](_0x1be4d0){const _0x47f24b=this['_fakeSelections'][0x0]||null;this['_addFakeSelection'](_0x1be4d0);const _0x11c7d2=this['_fakeSelections'][0x0]||null;this['_refreshFakeSelection'](_0x47f24b,_0x11c7d2);}['hideFakeVisualSelection'](_0x2f550d){const _0x267693=this['_fakeSelections'][0x0]||null;this['_removeFakeSelectionById'](_0x2f550d);const _0x3d2985=this['_fakeSelections'][0x0]||null;this['_refreshFakeSelection'](_0x267693,_0x3d2985);}async['modelToDataWithIds'](_0x59a876){const _0x5efe2f=$s(this['context']),_0x541b2c=_0x5efe2f['data']['toView'](_0x59a876),_0x1341d3=new _0x27a0d8(_0x5efe2f['editing']['view']['document']);return this['_setDataIdsOnChildren'](_0x541b2c,_0x1341d3),this['_getDocumentDataStringFromView'](_0x541b2c,_0x5efe2f);}['_setDataIdsOnChildren'](_0x22e867,_0x4bcc46,_0x497d75=new Set()){let _0x154458=!0x1;for(const _0x3e654c of _0x22e867['getChildren']()){if(!_0x3e654c['is']('view:element')||js['includes'](_0x3e654c['name']))continue;const _0x392073=_0x3e654c['is']('view:containerElement'),_0x19b4cc=_0x3e654c['is']('view:emptyElement'),_0x3b73ef=this['_setDataIdsOnChildren'](_0x3e654c,_0x4bcc46,_0x497d75);if(_0x3e654c['hasAttribute']('data-id')){_0x154458=!0x0,_0x497d75['add'](_0x3e654c['getAttribute']('data-id'));continue;}(_0x392073||_0x19b4cc||_0x3b73ef)&&(_0x4bcc46['setAttribute']('data-id',this['_nextDataId'](_0x497d75),_0x3e654c),_0x154458=!0x0);}return _0x154458;}['_nextDataId'](_0x7af183){let _0x4b731e;do{_0x4b731e='';for(let _0x4ba510=0x0;_0x4ba510<0x4;_0x4ba510++)_0x4b731e+=String['fromCharCode'](0x61+Math['floor'](0x1a*Math['random']()));}while(_0x7af183['has'](_0x4b731e));return _0x7af183['add'](_0x4b731e),_0x4b731e;}['getSelectionText'](){const {model:_0x42b439}=$s(this['context']),_0x29a844=_0x42b439['document']['selection'],_0x4c2e91=[],_0x54f1ca=Array['from'](_0x29a844['getRanges']());_0x54f1ca['sort']((_0x4a2059,_0x5981e3)=>_0x4a2059['start']['isBefore'](_0x5981e3['start'])?-0x1:0x1);for(const _0x40f827 of _0x54f1ca)for(const _0x23d398 of _0x40f827['getItems']())_0x23d398['is']('$textProxy')?_0x4c2e91['push'](_0x23d398['data']):_0x23d398['is']('element')&&_0x4c2e91['length']>0x0&&'\x20'!==_0x4c2e91[_0x4c2e91['length']-0x1]&&_0x4c2e91['push']('\x20');return _0x4c2e91['length']?'\x22'+_0x4c2e91['join']('')['trim']()+'\x22':hs(this['context']['locale'],'AI_CHAT_CONTEXT_DOCUMENT_SELECTION_LABEL');}['_removeFakeSelectionById'](_0x204918){for(let _0x3ae530=0x0;_0x3ae530<this['_fakeSelections']['length'];_0x3ae530++)if(this['_fakeSelections'][_0x3ae530]['id']==_0x204918)return void this['_fakeSelections']['splice'](_0x3ae530,0x1);}['_addFakeSelection'](_0x19b041){this['_removeFakeSelectionById'](_0x19b041['id']),wt(this['_fakeSelections'],_0x19b041);}['_refreshFakeSelection'](_0x69f49d,_0x1c963e){if(_0x69f49d==_0x1c963e)return;const _0x2dc4d0=_0x69f49d?this['_getEditorForFakeSelection'](_0x69f49d):null,_0x4ab0b2=_0x1c963e?this['_getEditorForFakeSelection'](_0x1c963e):null,_0x484130=(_0x5bc78f,_0x5c98c0)=>{const _0x504cd5=_0x5c98c0['model']['markers']['getMarkersGroup'](zs);for(const _0x1b7576 of _0x504cd5)_0x5bc78f['removeMarker'](_0x1b7576);},_0x1595c3=(_0x258a7b,_0x4cbcc5,_0x5f3702)=>{const _0x4d0d4b=_0x4cbcc5['model'];for(let _0x4cf0a=0x0;_0x4cf0a<_0x5f3702['ranges']['length'];_0x4cf0a++){let _0x6b0592=_0x5f3702['ranges'][_0x4cf0a];const _0xe7e803=zs+':'+_0x5f3702['id']+':'+_0x4cf0a;if(_0x6b0592['start']['isAtEnd']){const _0x4fa029=_0x6b0592['start']['getLastMatchingPosition'](({item:_0x4b5923})=>!_0x4d0d4b['schema']['isContent'](_0x4b5923),{'boundaries':_0x6b0592});_0x6b0592=_0x258a7b['createRange'](_0x4fa029,_0x6b0592['end']);}_0x258a7b['addMarker'](_0xe7e803,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x6b0592});}};_0x2dc4d0&&_0x4ab0b2&&_0x2dc4d0===_0x4ab0b2&&_0x1c963e?_0x2dc4d0['model']['change'](_0x2dc2ff=>{_0x484130(_0x2dc2ff,_0x2dc4d0),_0x1595c3(_0x2dc2ff,_0x4ab0b2,_0x1c963e);}):(_0x2dc4d0&&_0x2dc4d0['model']['change'](_0x37e8ec=>_0x484130(_0x37e8ec,_0x2dc4d0)),_0x4ab0b2&&_0x1c963e&&_0x4ab0b2['model']['change'](_0x23c5f0=>_0x1595c3(_0x23c5f0,_0x4ab0b2,_0x1c963e)));}['_getEditorForFakeSelection'](_0x58d9e7){if(!_0x58d9e7['ranges']['length'])return $s(this['context']);const _0x1b75d5=_0x58d9e7['ranges'][0x0]['root']['document'];return Ws(this['context'])['find'](_0x178f2c=>_0x178f2c['model']['document']===_0x1b75d5)??$s(this['context']);}['_getMarkersInDocumentOrder'](_0xb21004,_0x3c2632){const _0x1c5e46=Array['from'](_0xb21004['model']['markers']['getMarkersGroup'](zs+':context'));return(_0x3c2632?_0x1c5e46['filter'](_0x4f1442=>{const _0x3054b9=_0x4f1442['getRange']();return _0x3054b9&&_0x3054b9['root']['rootName']===_0x3c2632['rootName'];}):_0x1c5e46)['sort']((_0x3bd59d,_0x3f43fd)=>_0x3bd59d['getStart']()['isBefore'](_0x3f43fd['getStart']())?-0x1:_0x3bd59d['getStart']()['isAfter'](_0x3f43fd['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(_0x129159){const _0x4238dd=new AbortController();return{'promise':new Promise((_0x21c84d,_0x2c3285)=>{const _0x264571=setTimeout(_0x21c84d,_0x129159);_0x4238dd['signal']['addEventListener']('abort',()=>{clearTimeout(_0x264571),_0x2c3285();});}),'abortController':_0x4238dd};}class sn{['options'];['isStreaming']=!0x1;['document']=null;['nodesList']=[];['currentIndex']=0x0;['timeoutAbortController']=null;['lastUpdateTime']=0x0;constructor(_0x3a504a){this['options']={'delay':_0x3a504a?.['delay']??0xa,'textNodeStyle':_0x3a504a?.['textNodeStyle']??'animation:\x20ck-html-streamer-fade-in\x20.3s'};}async['stream']({document:_0x35268d,targetElement:_0x27a343,abortSignal:_0x9e1c11}){this['isStreaming']&&this['stop'](),_0x9e1c11?.['addEventListener']('abort',this['stop']['bind'](this)),this['document']=_0x2cb1ed(_0x35268d,!0x0),this['nodesList']=this['getParsedDocumentNodeList'](),this['isStreaming']=!0x0,this['currentIndex']>this['nodesList']['length']&&(this['currentIndex']=this['nodesList']['length']);for(let _0x19aec4=0x0;_0x19aec4<this['currentIndex'];_0x19aec4++)this['nodesList'][_0x19aec4]['shouldBeStreamed']=!0x0;do{const _0x50759f=Date['now'](),_0x2d58be=this['nodesList'][this['currentIndex']],_0x48f0c7=_0x50759f-this['lastUpdateTime'];if(_0x2d58be){_0x2d58be['shouldBeStreamed']=!0x0;let _0x2b79ec=_0x2d58be['parent'];for(;_0x2b79ec;)_0x2b79ec['shouldBeStreamed']=!0x0,_0x2b79ec=_0x2b79ec['parent'];}if(_0x48f0c7<this['options']['delay'])try{const {promise:_0x4e04ae,abortController:_0x51443c}=en(this['options']['delay']-_0x48f0c7);this['timeoutAbortController']=_0x51443c,await _0x4e04ae;}catch(_0xaacc17){return;}_0x509ce5(_0x27a343,'<'+_0x27a343['tagName']+'>'+this['renderNode'](this['document'])+'</'+_0x27a343['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:_0x5de1e0}){Array['from'](_0x5de1e0['querySelectorAll']('span[data-ck-html-streamer-word-chunk]'))['reverse']()['forEach'](_0xf78d24=>{_0xf78d24['replaceWith'](_0xf78d24['childNodes'][0x0]);});}['stop'](){this['isStreaming']=!0x1,this['timeoutAbortController']&&(this['timeoutAbortController']['abort'](),this['timeoutAbortController']=null);}['renderNode'](_0xfe7c1d){let _0xe49b83='';if(function(_0xf76c5f){return _0x984065(_0xf76c5f);}(_0xfe7c1d)){for(const _0x327f23 of _0xfe7c1d['children'])_0xe49b83+=this['renderNode'](_0x327f23);}else{if(on(_0xfe7c1d)){if(!_0xfe7c1d['shouldBeStreamed'])return'';const _0x2dfda9=_0xfe7c1d,_0x13ca22=Object['entries'](_0x2dfda9['attribs'])['map'](([_0xd9ddcd,_0x4858a8])=>_0xd9ddcd+'=\x22'+_0x4858a8+'\x22')['join']('\x20');_0xe49b83+='<'+_0x2dfda9['tagName']+(_0x13ca22?'\x20'+_0x13ca22:'')+'>';for(const _0x3130db of _0x45c663(_0x2dfda9))_0xe49b83+=this['renderNode'](_0x3130db);_0xe49b83+='</'+_0x2dfda9['tagName']+'>';}else{if(!rn(_0xfe7c1d))return'';if(!_0xfe7c1d['shouldBeStreamed'])return'';!function(_0x1fea0e){if(!_0x1fea0e['parent']||!on(_0x1fea0e['parent']))return!0x1;if(!nn['includes'](_0x1fea0e['parent']['tagName']))return!0x1;return!_0x1ea558(_0x1fea0e)['match'](/^\s*[<>]\s*$/);}(_0xfe7c1d)?_0xe49b83+=ti(_0xfe7c1d):_0xe49b83+=ti(new _0x244f1b('span',{'data-ck-html-streamer-word-chunk':'','style':this['options']['textNodeStyle']},[_0xfe7c1d]));}}return _0xe49b83;}['getParsedDocumentNodeList'](){const _0x103286=[];return function(_0x30b3c3,_0x2022b7){const _0x4c07b2=_0x23f044=>{if(_0x2022b7(_0x23f044),_0x23f044 instanceof _0x5218f8)for(let _0x6a72d7=0x0;_0x6a72d7<_0x23f044['children']['length'];_0x6a72d7++){const _0x56559a=_0x23f044['children'][_0x6a72d7];_0x4c07b2(_0x56559a);}};for(let _0x53bf3f=0x0;_0x53bf3f<_0x30b3c3['children']['length'];_0x53bf3f++)_0x4c07b2(_0x30b3c3['children'][_0x53bf3f]);}(this['document'],_0x2b9faf=>{if(rn(_0x2b9faf)){const _0x2af525=this['splitTextNodeIntoWordNodes'](_0x2b9faf);_0x2af525['length']&&_0x103286['push'](..._0x2af525);}_0x2b9faf['isWordSplitSource']||_0x2b9faf['isWordSplitResult']||_0x103286['push'](_0x2b9faf);}),_0x103286;}['splitTextNodeIntoWordNodes'](_0x530a9a){if(_0x530a9a['isWordSplitSource']||_0x530a9a['isWordSplitResult'])return[];const _0x456e9e=_0x1ea558(_0x530a9a)['match'](/(?:\s*\S+\s*)/g),_0xffd7fe=[];if(_0x456e9e&&_0x456e9e['length']>0x1){for(const _0x4dbfca of _0x456e9e){const _0x5dca34=new _0x592fb4(_0x4dbfca);_0x5dca34['isWordSplitResult']=!0x0,_0x27ae1b(_0x530a9a,_0x5dca34),_0xffd7fe['push'](_0x5dca34);}_0x530a9a['isWordSplitSource']=!0x0,_0x5d78f4(_0x530a9a);}return _0xffd7fe;}}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(_0x3dd70e){return _0x391745(_0x3dd70e);}function on(_0x4d392c){return _0x1d6ab8(_0x4d392c);}class an extends vt{['options'];['content']='';['htmlStreamer'];['children'];constructor(_0x824244){super();const _0x2a78c2=this['bindTemplate'];this['set']('isDone',!0x1),this['set']('isVisible',!0x0),this['htmlStreamer']=new sn(),this['options']=_0x824244,this['children']=this['createCollection'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed__item',_0x2a78c2['if']('isDone','ck-ai-chat__feed__item_done'),_0x2a78c2['if']('isVisible','ck-hidden',_0xd05315=>!_0xd05315),'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'](_0x35858f=>{_0x35858f['removeAttribute']('data-id');}),this['isDone']=!0x0;}async['streamIntoElement'](_0x12a643,_0x1778a9,_0xdd06a6){await this['htmlStreamer']['stream']({'document':_0x12a643,'targetElement':_0x1778a9,'abortSignal':_0xdd06a6});}}class hn extends vt{['showChangesToggleView'];constructor(_0x292b9a,_0xc028f4){super(_0x292b9a),this['set']('isShowChangesToggleVisible',!0x0),this['showChangesToggleView']=new cn(_0x292b9a),this['showChangesToggleView']['set']({'class':'ck-ai-suggestion__header__show-changes-toggle\x20ck-ai-chat-controls-button\x20'+us,'label':hs(_0x292b9a,'AI_SUGGESTION_BUTTON_SHOW_CHANGES'),'withText':!0x0}),this['showChangesToggleView']['isOn']=_0xc028f4['showDiff'],this['showChangesToggleView']['bind']('isVisible')['to'](this,'isShowChangesToggleVisible'),this['showChangesToggleView']['bind']('icon')['to'](this['showChangesToggleView'],'isOn',_0x2a8dc2=>_0x2a8dc2?_0x577354:_0x1ebf6f),this['showChangesToggleView']['on']('execute',()=>{this['showChangesToggleView']['isOn']=!this['showChangesToggleView']['isOn'],this['fire']('toggleShowChanges',{'isOn':this['showChangesToggleView']['isOn']});});const _0x2979c0=new xt();_0x2979c0['content']=_0x3e528c,this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__header',!0x1===_0xc028f4['showHeader']?'ck-hidden':null]['filter'](Boolean)},'children':[_0x2979c0,{'tag':'span','children':[hs(_0x292b9a,'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':_0x3b5a26,'rejected':_0x17ed4e,'outdated':_0x17ed4e};class un extends vt{['stateIconView'];constructor(_0x2603de){super(_0x2603de);const _0x5e66dc=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',_0x5e66dc['to']('state',_0xdcc1ab=>'ck-ai-suggestion__content-part-state_'+_0xdcc1ab),_0x5e66dc['if']('isVisible','ck-hidden',_0x998844=>!_0x998844)]},'children':[{'tag':'span','attributes':{'class':['ck-ai-suggestion__content-part-state__label']},'children':[{'text':_0x5e66dc['to']('state',_0x246ac6=>{switch(_0x246ac6){case'accepted':return hs(_0x2603de,'AI_SUGGESTION_CONTENT_PART_STATE_ACCEPTED');case'rejected':return hs(_0x2603de,'AI_SUGGESTION_CONTENT_PART_STATE_REJECTED');case'outdated':return hs(_0x2603de,'AI_SUGGESTION_CONTENT_PART_STATE_OUTDATED');}})}]},this['stateIconView']]});}['setState'](_0x583717){this['state']=_0x583717;}}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(_0x244ef4,_0x1f4350,_0x23396f){super(_0x244ef4);const _0xd5e91c=Boolean(_0x23396f);this['set']('isEnabled',!_0xd5e91c),this['set']('isVisible',!0x0),this['class']='ck-ai-suggestion-content-part-toolbar';const _0x4bb2d6=[];if(_0xd5e91c){const _0xe17ec9=new Nt(_0x244ef4);_0xe17ec9['set']({'label':hs(_0x244ef4,'AI_SUGGESTION_DISABLED_TOOLTIP_MESSAGE'),'tooltip':!0x0,'withText':!0x1,'icon':_0x138750}),_0xe17ec9['extendTemplate']({'attributes':{'data-cke-tooltip-class':'ck-ai-suggestion-content-part-disabled-actions-tooltip'}}),_0x4bb2d6['push'](_0xe17ec9);}else{_0x1f4350['includes']('applySuggestion')&&(this['_applyButton']=new Nt(_0x244ef4),this['_applyButton']['set']({'label':hs(_0x244ef4,'AI_SUGGESTION_CONTENT_PART_APPLY'),'tooltip':!0x0,'tooltipPosition':'n','withText':!0x1,'icon':_0x3b5a26}),this['_applyButton']['bind']('isEnabled')['to'](this),this['_applyButton']['on']('execute',()=>{this['fire']('applySuggestion');}),_0x4bb2d6['push'](this['_applyButton'])),_0x1f4350['includes']('insertSuggestion')&&(this['_suggestButton']=new Nt(_0x244ef4),this['_suggestButton']['set']({'label':hs(_0x244ef4,'AI_SUGGESTION_CONTENT_PART_ADD_SUGGESTION'),'tooltip':!0x0,'tooltipPosition':'n','withText':!0x1,'icon':_0x227ff0}),this['_suggestButton']['bind']('isEnabled')['to'](this),this['_suggestButton']['on']('execute',()=>{this['fire']('insertSuggestion');}),_0x4bb2d6['push'](this['_suggestButton']));const _0x109b01=new Nt(_0x244ef4);_0x109b01['set']({'label':hs(_0x244ef4,'AI_SUGGESTION_CONTENT_PART_REJECT'),'tooltip':!0x0,'tooltipPosition':'n','withText':!0x1,'icon':_0x17ed4e}),_0x109b01['bind']('isEnabled')['to'](this),_0x109b01['on']('execute',()=>{this['fire']('rejectSuggestion');}),_0x4bb2d6['push'](_0x109b01);}this['items']['addMany'](_0x4bb2d6);const _0x283175=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':[_0x283175['if']('isVisible','ck-hidden',_0x196d9b=>!_0x196d9b)]}});}['setButtonsVisibility']({showApplyButton:_0x16aee3,showSuggestButton:_0x1bf629}){this['_applyButton']&&(this['_applyButton']['isVisible']=_0x16aee3),this['_suggestButton']&&(this['_suggestButton']['isVisible']=_0x1bf629);}}class gn extends vt{['toolbarView'];['stateView'];['titleLabelView'];['children'];constructor(_0x5f0b3a,{part:_0x26f8b5,uiIndex:_0x26c266,availableActions:_0x3a7ab5,areActionsDisabled:_0x1e539a}){super(_0x5f0b3a),this['set']('isEnabled',!0x0),this['set']('state','pending'),this['toolbarView']=new _n(_0x5f0b3a,_0x3a7ab5,_0x1e539a),this['toolbarView']['on']('rejectSuggestion',()=>{this['fire']('rejectSuggestion',{'index':_0x26f8b5['index']});}),this['toolbarView']['on']('insertSuggestion',()=>{this['fire']('insertSuggestion',{'index':_0x26f8b5['index']});}),this['toolbarView']['on']('applySuggestion',()=>{this['fire']('applySuggestion',{'index':_0x26f8b5['index']});}),this['toolbarView']['bind']('isEnabled')['to'](this),this['stateView']=new un(_0x5f0b3a),this['titleLabelView']=new An(_0x5f0b3a,_0x26c266),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',(_0xac5b8,_0x1ae217,_0x2134ed,_0x518192)=>{'pending'===_0x518192?this['children']['remove'](this['toolbarView']):this['children']['remove'](this['stateView']),'pending'===_0x2134ed?this['children']['add'](this['toolbarView']):(this['stateView']['setState'](_0x2134ed),this['children']['add'](this['stateView']));});}}class An extends vt{constructor(_0x35a966,_0x3d38a7){super(_0x35a966),this['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai-suggestion__body__content-part__title__label']},'children':[hs(_0x35a966,'AI_SUGGESTION_CONTENT_PART_TITLE',_0x3d38a7['toString']())]});}}class In extends vt{['htmlStreamer'];constructor(_0x4c664c){super(_0x4c664c),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:_0x2c507b,renderingStrategy:_0x319f82,abortSignal:_0x3c0333}){'streaming'===_0x319f82?await this['htmlStreamer']['stream']({'document':_0x2c507b['content'],'targetElement':this['element'],'abortSignal':_0x3c0333}):_0x509ce5(this['element'],'<'+this['element']['tagName']+'>'+gs(_0x2c507b['content'])+'</'+this['element']['tagName']+'>',{'childrenOnly':!0x0});}['clear'](){this['htmlStreamer']['reset'](),this['element']['innerHTML']='';}}class En extends vt{['_children'];['_headerView'];['_streamableContentView'];constructor(_0x4581e3,{part:_0x1ec32a,uiIndex:_0x3c4f22,areActionsDisabled:_0x285681,availableActions:_0x303113}){super(_0x4581e3);const _0x2af121=this['bindTemplate'];this['set']('state','pending'),this['set']('isDone',!0x1),this['set']('isVisible',!0x1),this['set']('isActive',!0x1),this['set']('isEnabled',!0x1);const _0x349e95=()=>{this['isEnabled']=this['isDone']&&'pending'==this['state']&&!_0x285681;};this['on']('change:state',_0x349e95),this['on']('change:isDone',_0x349e95),_0x349e95(),this['_children']=this['createCollection'](),this['_headerView']=new gn(_0x4581e3,{'part':_0x1ec32a,'uiIndex':_0x3c4f22,'availableActions':_0x303113,'areActionsDisabled':_0x285681}),this['_headerView']['bind']('isEnabled','state')['to'](this),this['_headerView']['delegate'](...Zs)['to'](this),this['_streamableContentView']=new In(_0x4581e3),this['_children']['addMany']([this['_headerView'],this['_streamableContentView']]),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__body__content-part',_0x2af121['to']('state',_0x2fabed=>'ck-ai-suggestion__body__content-part_'+_0x2fabed),_0x2af121['if']('isEnabled','ck-ai-suggestion__body__content-part_enabled'),_0x2af121['if']('isActive','ck-ai-suggestion__body__content-part_active'),_0x2af121['if']('isVisible','ck-hidden',_0x25e2bb=>!_0x25e2bb)]},'children':this['_children'],'on':{'mouseenter':_0x2af121['to'](()=>{this['isEnabled']&&this['fire']('mouseOverSuggestion',{'index':_0x1ec32a['index']});}),'mouseleave':_0x2af121['to'](()=>{this['isEnabled']&&this['fire']('mouseLeaveSuggestion',{'index':_0x1ec32a['index']});}),'click':_0x2af121['to'](_0x532ef1=>{const _0x4506d8=_0x532ef1['target'];this['isEnabled']&&!this['_headerView']['toolbarView']['element']['contains'](_0x4506d8)&&this['fire']('showChangeInText',{'index':_0x1ec32a['index']});})}});}async['updateContent']({part:_0x4281b6,showUnchangedParts:_0x5dcbde=!0x1,abortSignal:_0x13b0b7}){this['partDefinition']=_0x4281b6,this['isVisible']=this['partDefinition']['hasChanges']||_0x5dcbde,this['isVisible']&&await this['_streamableContentView']['update']({'part':_0x4281b6,'renderingStrategy':'static','abortSignal':_0x13b0b7});}['markAsDone'](){this['isDone']=!0x0;}}class pn extends vt{constructor(_0x1157e5,_0x97461e){super(_0x1157e5),this['set']('isVisible',!0x0),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-skeleton',this['bindTemplate']['if']('isVisible','ck-hidden',_0x38f8c2=>!_0x38f8c2)]},'children':this['_createSkeletonItems'](_0x97461e)});}['_createSkeletonItems'](_0x258098){const _0x22a676=['ck','ck-ai-skeleton__item'];return _0x258098['map'](_0x4e2c43=>{let _0x336e5f='';switch(_0x4e2c43['attributes']['align']){case'right':_0x336e5f='margin-left:\x20auto;\x20margin-right:\x200;\x20text-align:\x20right;';break;case'center':_0x336e5f='margin-left:\x20auto;\x20margin-right:\x20auto;\x20text-align:\x20center;';break;case'left':_0x336e5f='margin-left:\x200;\x20margin-right:\x20auto;\x20text-align:\x20left;';}return{'tag':_0x4e2c43['tag'],'attributes':{'class':[..._0x22a676,_0x4e2c43['attributes']['class']?_0x4e2c43['attributes']['class']:''],'style':'width:\x20'+_0x4e2c43['attributes']['width']+';\x20height:\x20'+_0x4e2c43['attributes']['height']+';'+_0x336e5f}};});}}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(_0x5aadcb,_0x3767ec,_0x467e77,_0x50161c){return new Array(_0x5aadcb)['fill'](null)['map'](()=>({'tag':'div','attributes':{'width':_0x3767ec,'height':_0x467e77,'align':_0x50161c}}));}class Cn extends Tt(){['queue']=[];['isProcessing']=!0x1;['_abortController'];async['enqueue'](_0xfd7dd9){const _0x52cbbe=this['createTask'](_0xfd7dd9);return this['queue']['push'](_0x52cbbe),this['_processQueue'](),_0x52cbbe['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(_0x35612f=>{this['once']('_queueEmpty',()=>{_0x35612f();});}):Promise['resolve']();}async['_processQueue'](){if(!this['isProcessing']){this['_abortController']=new AbortController(),this['isProcessing']=!0x0;try{for(;this['queue']['length']&&this['isProcessing'];){const _0x103881=this['queue']['shift']();try{await _0x103881['callback'](this['_abortController']['signal']),_0x103881['resolve']();}catch(_0x3f00b4){_0x103881['reject'](_0x3f00b4);}}}finally{this['isProcessing']=!0x1,this['_abortController']=void 0x0;}this['fire']('_queueEmpty');}}['createTask'](_0x8a8260){let _0x2273fa,_0x2da307;const _0x30639a=new Promise((_0x14eecd,_0x43fa1b)=>{_0x2273fa=_0x14eecd,_0x2da307=_0x43fa1b;});return{'callback':_0x8a8260,'resolve':_0x2273fa,'reject':_0x2da307,'completePromise':_0x30639a};}}class wn extends an{constructor(_0x37102c){super(_0x37102c),this['extendTemplate']({'attributes':{'class':['ck-ai-notification','warning'===_0x37102c['level']?'ck-ai-notification_warning':'ck-ai-notification_error']}});}['render'](){super['render'](),this['setContent'](this['options']['initialContent']),this['markAsDone']();}['setContent'](_0x439c49){this['element']['innerHTML']=_0x439c49;}}const fn=['applySuggestion','insertSuggestion'];class bn extends vt{['_applyChangesButton'];['_insertSuggestionsButton'];['children'];constructor(_0x1added,_0x4fe0a6=[...fn],_0x193997){super(_0x1added);const _0x4b2a71=this['bindTemplate'],_0x378ffd=Boolean(_0x193997);if(this['set']('isEnabled',!_0x378ffd),this['set']('isVisible',!0x1),this['set']('isTrackChangesOn',!0x1),this['children']=this['createCollection'](),_0x378ffd){const _0x21f4fb=new Nt(_0x1added);_0x21f4fb['set']({'label':hs(_0x1added,'AI_SUGGESTION_DISABLED_TOOLTIP_MESSAGE'),'tooltip':!0x0,'withText':!0x1,'icon':_0x138750}),_0x21f4fb['extendTemplate']({'attributes':{'data-cke-tooltip-class':'ck-ai-suggestion-content-part-disabled-actions-tooltip'}});const _0x3f3a45=new vt(_0x1added);_0x3f3a45['setTemplate']({'tag':'div','attributes':{'class':'ck-ai-chat__feed__suggestion__actions__info'},'children':[{'tag':'p','children':[hs(_0x1added,'AI_SUGGESTION_DISABLED_FEED_MESSAGE'),_0x21f4fb]}]}),this['children']['add'](_0x3f3a45);}else this['_applyChangesButton']=new Nt(_0x1added),this['_applyChangesButton']['set']({'label':hs(_0x1added,'AI_CHAT_SUGGESTION_ACTION_APPLY_ALL'),'withText':!0x0,'type':'button','isVisible':_0x4fe0a6['includes']('applySuggestion'),'class':cs}),this['_insertSuggestionsButton']=new Nt(_0x1added),this['_insertSuggestionsButton']['set']({'label':hs(_0x1added,'AI_CHAT_SUGGESTION_ACTION_SUGGEST_ALL'),'withText':!0x0,'type':'button','isVisible':_0x4fe0a6['includes']('insertSuggestion'),'class':ls}),this['_insertSuggestionsButton']['on']('execute',()=>{this['fire']('insertSuggestion');}),this['_applyChangesButton']['on']('execute',()=>{this['fire']('applySuggestion');}),[this['_applyChangesButton'],this['_insertSuggestionsButton']]['forEach'](_0x5a2d02=>{_0x5a2d02['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',_0x4b2a71['if']('isVisible','ck-hidden',_0xb530e=>!_0xb530e)]},'children':this['children']}),this['on']('change:isTrackChangesOn',()=>{this['_applyChangesButton']&&(this['_applyChangesButton']['isVisible']=!this['isTrackChangesOn']);});}['updateVisibility'](_0x2befe7){this['isVisible']=_0x2befe7;}['_switchButtonLabelsPlurality'](_0xaedeba){this['_applyChangesButton']&&this['_insertSuggestionsButton']&&(_0xaedeba?(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(_0x486a0c,_0x46e431){super(_0x486a0c),this['bodyCollection']=_0x46e431,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',_0x4c636c=>!_0x4c636c)]},'children':this['children']});const _0x262d6b=new vt(this['locale']),_0x179f7c=new xt();_0x179f7c['content']=_0xfff9b0,_0x262d6b['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-web-sources__header']},'children':[_0x179f7c,{'tag':'span','children':[{'text':hs(this['locale'],'AI_CHAT_SOURCES_HEADER')}]}]}),this['children']['add'](_0x262d6b),this['_setupBalloonPanel'](_0x486a0c);}['addSource'](_0x23fee8){this['children']['add'](new Rn(this['locale'],_0x23fee8,this['balloonPanelView']));}['_setupBalloonPanel'](_0x436947){this['balloonPanelView']=new Xt(_0x436947),this['balloonPanelView']['extendTemplate']({'attributes':{'class':['ck-ai-web-source__tooltip-balloon']}}),this['bodyCollection']['add'](this['balloonPanelView']);}}class Rn extends Nt{['balloonPanelView'];['source'];constructor(_0x5c1422,_0x35ac6d,_0x200ada){super(_0x5c1422),this['source']=_0x35ac6d,this['balloonPanelView']=_0x200ada,this['set']({'label':_0x35ac6d['title'],'class':['ck\x20ck-ai-web-source'],'withText':!0x0});const _0x3150a7=this['bindTemplate'];if(this['extendTemplate']({'on':{'click':_0x3150a7['to'](()=>{window['open'](_0x35ac6d['url'],'_blank');}),'mouseenter':_0x3150a7['to'](()=>{this['_showTooltip']();}),'mouseleave':_0x3150a7['to'](()=>{this['_hideTooltip']();})}}),_0x35ac6d['favicon']){const _0x2293ac=new vt(_0x5c1422);_0x2293ac['setTemplate']({'tag':'img','attributes':{'src':_0x35ac6d['favicon']||_0xfff9b0,'alt':_0x35ac6d['title'],'class':['ck-ai-web-source__image']}}),this['children']['add'](_0x2293ac);}else this['set']('icon',_0xfff9b0);}['_createTooltipContentView'](_0x4871e5,_0x3985f1){const _0x151a91=new vt(_0x4871e5),_0x8c2864=[];let _0x4adcec;_0x3985f1?.['favicon']?(_0x4adcec=new vt(_0x4871e5),_0x4adcec['setTemplate']({'tag':'img','attributes':{'src':_0x3985f1['favicon'],'alt':_0x3985f1['title'],'class':['ck-ai-web-source__tooltip-image']}})):(_0x4adcec=new xt(),_0x4adcec['content']=_0xfff9b0,_0x4adcec['extendTemplate']({'attributes':{'alt':_0x3985f1['title'],'class':['ck-ai-web-source__tooltip-image']}})),_0x8c2864['push'](_0x4adcec);const _0x2dc107=new vt(_0x4871e5);_0x2dc107['setTemplate']({'tag':'a','attributes':{'class':['ck-ai-web-source__tooltip-url'],'href':_0x3985f1['url']},'children':[{'text':new URL(_0x3985f1['url'])?.['hostname']}]}),_0x8c2864['push'](_0x2dc107);const _0x420d0f=new vt(_0x4871e5);_0x420d0f['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-web-source__tooltip-row']},'children':_0x8c2864});const _0x5bcf8e=new vt(_0x4871e5);return _0x5bcf8e['setTemplate']({'tag':'span','attributes':{'class':['ck-ai-web-source__tooltip-row','ck-ai-web-source__tooltip-title']},'children':[{'text':_0x3985f1['title']['length']>0x190?_0x3985f1['title']['substring'](0x0,0x190)+'...':_0x3985f1['title']}]}),_0x151a91['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-web-source__tooltip']},'children':[_0x420d0f,_0x5bcf8e]}),_0x151a91;}['_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 _0x122c74=this['_createTooltipContentView'](this['locale'],this['source']);this['balloonPanelView']['content']['add'](_0x122c74);}}class On extends vt{['_actionsView'];['_sourcesView'];['_children'];['_skeletonView'];['_showSkeletonDebounced']=_0x12ff54(()=>{this['_skeletonView']['isVisible']=!0x0,this['_skeletonShownAt']=Date['now']();},0x3e8);['_skeletonShownAt']=null;['_areActionsDisabled'];['_showUnchangedParts'];['_updateContentPartsPromiseQueue'];['_emptyPartsWarningView'];['_availableActions'];['_cachedContentParts']=[];constructor(_0x21f9ea,_0x13e124){super(_0x21f9ea);const {areActionsDisabled:_0x529a49,showUnchangedParts:_0x4c4924,availableActions:_0x120d1e}=_0x13e124;this['_areActionsDisabled']=_0x529a49,this['_showUnchangedParts']=_0x4c4924,this['_availableActions']=_0x120d1e,this['set']('hasPendingParts',!0x1),this['set']('isTrackChangesOn',!0x1),this['_children']=this['createCollection'](),this['_skeletonView']=new pn(_0x21f9ea,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(_0x21f9ea,'AI_SUGGESTION_EMPTY_PART_WARNING'),'level':'warning'}),this['_emptyPartsWarningView']['isVisible']=!0x1,this['_actionsView']=new bn(_0x21f9ea,_0x13e124['availableActions'],this['_areActionsDisabled']),this['_actionsView']['bind']('isTrackChangesOn')['to'](this),this['_sourcesView']=new Sn(this['locale'],_0x13e124['bodyCollection']),_0x13e124['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'](_0x245922=>_0x245922 instanceof En);}async['updateContentParts']({parts:_0x18d16d,abortSignal:_0x59ff5b,skipLoadingEffects:_0x11f560}){this['_cachedContentParts']['length']?_0x18d16d['forEach'](_0x3a46cf=>{const _0xd50a1b=this['_cachedContentParts']['findIndex'](_0x194a3a=>_0x194a3a['index']==_0x3a46cf['index']);-0x1===_0xd50a1b?this['_cachedContentParts']['push'](_0x3a46cf):this['_cachedContentParts'][_0xd50a1b]=_0x3a46cf;}):this['_cachedContentParts']=_0x18d16d;const _0xb4bd78=this['_showUnchangedParts']?_0x18d16d:_0x18d16d['filter'](_0x2df9fe=>_0x2df9fe['hasChanges']);this['_actionsView']['_switchButtonLabelsPlurality'](_0xb4bd78['length']>0x1),_0x11f560&&(this['_showSkeletonDebounced']['cancel'](),this['_skeletonView']['isVisible']=!0x1);for(const _0x24bcc5 of _0xb4bd78)this['_updateContentPartsPromiseQueue']['enqueue'](async _0x5c3e6a=>{let _0x2cb707=this['getPartView'](_0x24bcc5['index']);if(!_0x2cb707){if(_0x2cb707=new En(this['locale'],{'part':_0x24bcc5,'uiIndex':this['_contentPartViews']['length']+0x1,'areActionsDisabled':this['_areActionsDisabled'],'availableActions':this['_availableActions']}),_0x2cb707['delegate'](...Zs)['to'](this),!_0x11f560&&(this['_showSkeletonDebounced']['cancel'](),await this['_awaitMinimumSkeletonDisplayTime'](_0x5c3e6a),_0x5c3e6a['aborted']))return;this['_skeletonView']['isVisible']=!0x1,this['_children']['add'](_0x2cb707,this['_children']['length']-0x1),this['hasPendingParts']=!0x0,_0x11f560||this['_showSkeletonDebounced']();}await _0x2cb707['updateContent']({'part':_0x24bcc5,'showUnchangedParts':this['_showUnchangedParts'],'abortSignal':_0x5c3e6a}),_0x2cb707['markAsDone']();});return _0x59ff5b?.['addEventListener']('abort',()=>{this['_updateContentPartsPromiseQueue']['abort'](),this['_showSkeletonDebounced']['cancel'](),this['_skeletonView']['isVisible']=!0x1;}),this['_updateContentPartsPromiseQueue']['queueEmptyPromise'];}['updatePartState'](_0x451ae6,_0x5d2c7f){const _0x2e9a19=this['getPartView'](_0x451ae6);_0x2e9a19&&(_0x2e9a19['state']=_0x5d2c7f),this['hasPendingParts']='pending'==_0x5d2c7f||this['_contentPartViews']['some'](_0x560f98=>'pending'==_0x560f98['state']);}['setPartActive'](_0xe7aa8e,_0x38d2f7){if(!0x1===_0xe7aa8e){for(const _0x4562a7 of this['_contentPartViews'])_0x4562a7['isActive']=!0x1;}else{const _0x1238a8=this['getPartView'](_0xe7aa8e);_0x1238a8&&(_0x1238a8['isActive']=_0x38d2f7);}}['updateSources'](_0x2f6e01){_0x2f6e01['forEach'](_0x53c45f=>this['_sourcesView']['addSource'](_0x53c45f)),this['_sourcesView']['isVisible']=!0x0;}['getPartView'](_0x3d9b16){return this['_contentPartViews']['find'](_0x11e147=>_0x11e147['partDefinition']['index']==_0x3d9b16)??null;}['markAsDone'](){if(!this['_showUnchangedParts']){const _0x27bb37=!this['_cachedContentParts']['find'](({hasChanges:_0x245d58})=>_0x245d58),_0xd9e3a2=!!this['_cachedContentParts']['find'](({hasChanges:_0x17eb6d})=>!_0x17eb6d);this['_emptyPartsWarningView']['isVisible']=0x0==this['_contentPartViews']['length']||_0xd9e3a2,_0x27bb37?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'](_0x53ee13=>_0x53ee13['markAsDone']()),this['_skeletonView']['isVisible']=!0x1,this['_showSkeletonDebounced']['cancel'](),this['_actionsView']['updateVisibility'](this['hasNonEmptyParts']);}async['_awaitMinimumSkeletonDisplayTime'](_0x34371e){if(!this['_skeletonView']['isVisible']||null===this['_skeletonShownAt'])return;const _0x4c5ce0=0x3e8-(Date['now']()-this['_skeletonShownAt']);if(this['_skeletonShownAt']=null,_0x4c5ce0>0x0){const {promise:_0x1885d0,abortController:_0x260a24}=en(_0x4c5ce0);_0x34371e?.['addEventListener']('abort',()=>_0x260a24['abort']()),await _0x1885d0['catch'](()=>{});}}get['hasNonEmptyParts'](){return this['_contentPartViews']['filter'](_0x3f9d6a=>_0x3f9d6a['partDefinition']['hasChanges'])['length']>0x0;}}class kn extends vt{['bodyView'];['children'];['headerView'];constructor(_0xdc9692,_0x3be81c,_0x3176fc){super(_0xdc9692);const {showDiff:_0xc9e63f,areActionsDisabled:_0x2feb02,showUnchangedParts:_0x3173fb,availableActions:_0x5101a2}=_0x3be81c;this['set']('isTrackChangesOn',!0x1),this['set']('areChangesVisible',!0x1),this['children']=this['createCollection'](),this['headerView']=new hn(_0xdc9692,{'showDiff':_0xc9e63f}),this['headerView']['on']('toggleShowChanges',(_0x2f43ab,_0x407858)=>{this['areChangesVisible']=_0x407858['isOn'],this['fire']('toggleSuggestionDisplayMode',{'showDiff':_0x407858['isOn']});}),this['children']['add'](this['headerView']),this['bodyView']=new On(_0xdc9692,{'areActionsDisabled':_0x2feb02,'showUnchangedParts':!!_0x3173fb,'availableActions':_0x5101a2,'bodyCollection':_0x3176fc}),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'](_0x8d76ca){await this['bodyView']['updateContentParts'](_0x8d76ca);}['updateSources'](_0x420b03){this['bodyView']['updateSources'](_0x420b03);}['markAsDone'](){this['bodyView']['markAsDone'](),this['headerView']&&(this['headerView']['isShowChangesToggleVisible']=this['bodyView']['hasNonEmptyParts']);}}class Nn extends an{['containerView'];constructor(_0x40415d,_0x4b3664,_0x5af4b5){super(_0x4b3664),this['set']('isTrackChangesOn',!0x1),this['containerView']=new kn(_0x40415d,{'showDiff':_0x4b3664['showDiff'],'areActionsDisabled':_0x4b3664['areActionsDisabled'],'availableActions':_0x4b3664['availableActions']},_0x5af4b5),this['containerView']['on']('toggleSuggestionDisplayMode',(_0xfc5be4,_0x39562a)=>{this['fire']('toggleSuggestionDisplayMode',{'replyId':this['options']['id'],'showDiff':_0x39562a['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',(_0x372567,{index:_0x37de4d})=>{this['fire']('showChangeInText',{'replyId':this['options']['id'],'partIndex':_0x37de4d});}),this['containerView']['on']('applySuggestion',(_0x59d6b3,{index:_0x63921f}={})=>{this['fire']('applySuggestion',{'replyId':this['options']['id'],'partIndex':_0x63921f});}),this['containerView']['on']('insertSuggestion',(_0x59434b,{index:_0x5e05fb}={})=>{this['fire']('insertSuggestion',{'replyId':this['options']['id'],'partIndex':_0x5e05fb});}),this['containerView']['on']('rejectSuggestion',(_0x1eb059,{index:_0x5371f0})=>{this['fire']('rejectSuggestion',{'replyId':this['options']['id'],'partIndex':_0x5371f0});}),this['containerView']['on']('mouseOverSuggestion',(_0xaaa20,{index:_0x36db12})=>{this['fire']('mouseOverSuggestion',{'replyId':this['options']['id'],'partIndex':_0x36db12});}),this['containerView']['on']('mouseLeaveSuggestion',(_0x1c6094,{index:_0x188990})=>{this['fire']('mouseLeaveSuggestion',{'replyId':this['options']['id'],'partIndex':_0x188990});}),this['children']['addMany']([this['containerView']]),this['extendTemplate']({'attributes':{'class':['ck-ai-chat__feed__ai-suggestion']}});}async['updateContent'](_0x2d0374){await this['containerView']['updateContent'](_0x2d0374);}['updatePartState'](_0x17bfc9,_0x4d8284){this['containerView']['bodyView']['updatePartState'](_0x17bfc9,_0x4d8284);}['setPartActive'](_0x1f30f6,_0x21ef4f){!0x1===_0x1f30f6?this['containerView']['bodyView']['setPartActive'](!0x1):this['containerView']['bodyView']['setPartActive'](_0x1f30f6,_0x21ef4f);}['updateSources'](_0x5a8f0d){this['containerView']['updateSources'](_0x5a8f0d);}['getPartView'](_0x268ff0){return this['containerView']['bodyView']['getPartView'](_0x268ff0);}['markAsDone'](){super['markAsDone'](),this['containerView']['markAsDone']();}}class vn extends an{['replyContainer'];['_bodyCollection'];constructor(_0x1303e5,_0x2ab1c3,_0x58bce3){super(_0x2ab1c3),this['_bodyCollection']=_0x58bce3,this['locale']=_0x1303e5,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:_0x160743,renderingStrategy:_0x577415,abortSignal:_0x49149e}){'streaming'===_0x577415?await this['streamIntoElement'](_0x160743,this['replyContainer']['element'],_0x49149e):this['replyContainer']['element']['innerHTML']=ti(_0x160743);}['updateSources'](_0x31eb66){const _0x5b9306=new Sn(this['locale'],this['_bodyCollection']);_0x5b9306['children']['addMany'](_0x31eb66['map'](_0x534bdb=>new Rn(this['locale'],_0x534bdb,_0x5b9306['balloonPanelView']))),_0x5b9306['isVisible']=!0x0,this['children']['add'](_0x5b9306);}}class yn extends yt{constructor(_0x3d1714=void 0x0){super();const _0x655ba0=_0x3d1714?'ck-ai-spinner_'+_0x3d1714:'';this['extendTemplate']({'tag':'span','attributes':{'class':['ck-ai-spinner',_0x655ba0]}});}}const xn={'file':_0xc51032,'document':_0x3e528c,'web-resource':_0xe5297c,'text':_0xc51032,'selection':_0xa1a1f9,'mcp-tool-context':_0x3e528c},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(_0x4eccf0,_0x4a2327,_0xa172a7,_0x3a90aa,_0x1ed8b8=!0x1){super(_0x4eccf0),this['_isAnimationOnEnterEnabled']=_0x3a90aa,this['_initializeProperties'](_0x4a2327,_0xa172a7,_0x1ed8b8),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'](_0x39f961,_0x1e58fe,_0x4983f1){this['set']('label',_0x39f961['label']),this['set']('tooltip',!0x0),this['set']('itemType',_0x39f961['type']),this['set']('id',_0x39f961['uiId']),this['set']('readonly',_0x1e58fe),this['set']('isLoading',_0x4983f1);}['_setupTemplate'](){const _0x484a10=this['_createIconView'](),_0x587df5=this['_createRemoveButton'](),_0x54586d=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':this['_createTemplateAttributes'](_0x54586d),'children':this['_createTemplateChildren'](_0x484a10,_0x587df5,_0x54586d)});}['_createTemplateAttributes'](_0xbb725e){return{'class':[Ln,_0xbb725e['if']('itemType',Pn,_0x37a1ff=>'document'==_0x37a1ff),_0xbb725e['if']('itemType',Dn,_0x737e83=>'selection'==_0x737e83)],'data-cke-tooltip-text':_0xbb725e['to']('label',Gn),'data-cke-tooltip-position':Vn,'data-cke-tooltip-class':Un};}['_createTemplateChildren'](_0x184828,_0x299fd1,_0x1f81be){const _0x702eb=this['_createLabelElement'](_0x1f81be),_0x1ad5b5=this['_createLoaderIcon']();return this['readonly']?[_0x184828,_0x702eb]:[_0x184828,_0x1ad5b5,_0x702eb,_0x299fd1];}['_createLabelElement'](_0x5afc22){return{'tag':'span','attributes':{'class':Hn},'children':[{'text':_0x5afc22['to']('label')}]};}['_createRemoveButton'](){const _0x1cfe4e=new Nt(this['locale']);return _0x1cfe4e['set']({'label':hs(this['locale'],'AI_CHAT_CONTEXT_REMOVE_FROM_CONTEXT'),'icon':_0x35e3e9}),this['_setupRemoveButtonEvent'](_0x1cfe4e),_0x1cfe4e;}['_setupRemoveButtonEvent'](_0x10d9fb){_0x10d9fb['on']('execute',()=>{this['fire']('removeContextItemChip',this['id']);});}['_createIconView'](){const _0x5d714f=this['bindTemplate'],_0x2e9ad2=new xt();return _0x2e9ad2['content']=xn[this['itemType']],_0x2e9ad2['extendTemplate']({'attributes':{'class':[Mn,_0x5d714f['if']('isLoading','ck-hidden',_0x244d18=>_0x244d18)]}}),_0x2e9ad2;}['_handleAnimationEndOnce'](_0x54e2f8,_0xacdc9a){if(!_0x54e2f8)return;const _0x315607=()=>{_0xacdc9a(),_0x54e2f8['removeEventListener']('animationend',_0x315607),_0x54e2f8['removeEventListener']('webkitAnimationEnd',_0x315607);};_0x54e2f8['addEventListener']('animationend',_0x315607),_0x54e2f8['addEventListener']('webkitAnimationEnd',_0x315607);}['_createLoaderIcon'](){const _0x2d07ba=new yn('small');return _0x2d07ba['bind']('isVisible')['to'](this,'isLoading',_0x25b0c8=>_0x25b0c8),_0x2d07ba;}}function Gn(_0x104f35){if(!_0x104f35)return _0x104f35;if(_0x104f35['length']<=0x78)return _0x104f35;const _0x1793c7=_0x104f35['slice'](0x0,0x78),_0x5bcf9d=_0x1793c7['lastIndexOf']('\x20');return(_0x5bcf9d>0x0?_0x1793c7['slice'](0x0,_0x5bcf9d):_0x1793c7)+'…';}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(_0x26d383,_0xfa0098,_0x26bb0b,_0x58587a,_0x4c2534){this['_locale']=_0x26d383,this['_visibleChips']=_0xfa0098,this['_config']={...Fn,..._0x26bb0b,'cssClasses':{'controlsButton':'','calculationContainer':'ck-calculation-container',..._0x26bb0b['cssClasses']}},this['_overflowChips']=new dt(),this['_bodyCollection']=_0x58587a,this['_parentView']=_0x4c2534||null;}['setContainerElement'](_0x399b9c){this['_intersectionObserver']&&(this['_intersectionObserver']['disconnect'](),this['_intersectionObserver']=null),this['_containerElement']=_0x399b9c,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 _0x252d24=[...this['_visibleChips'],...this['_overflowChips']],_0x3c4d43=this['_createCalculationContainer'](),_0xf5697c=this['_calculateOverflowInContainer'](_0x3c4d43,_0x252d24),_0x424b64=_0x3c4d43['_ancestorsToRestore'];_0x424b64&&this['_restoreAncestorVisibility'](_0x424b64),_0x3c4d43['remove'](),this['_applyOverflowResults'](_0x252d24,_0xf5697c);}['_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 _0x16f522=new Nt(this['_locale']);_0x16f522['set']({'label':'','withText':!0x0,'isToggleable':!0x0});const _0x2c8189=[this['_config']['cssClasses']['showMoreButton']];return this['_config']['cssClasses']['controlsButton']&&_0x2c8189['push'](this['_config']['cssClasses']['controlsButton']),_0x16f522['extendTemplate']({'attributes':{'class':_0x2c8189}}),_0x16f522;}['_createShowMoreBalloonPanelView'](){const _0x4c9f5c=new Xt(this['_locale']);return _0x4c9f5c['extendTemplate']({'attributes':{'class':this['_config']['cssClasses']['showMoreBalloon']}}),this['_bodyCollection']['add'](_0x4c9f5c),_0x4c9f5c;}['_updateBalloonContent'](){if(this['_showMoreBalloonPanelView']&&(this['_showMoreBalloonPanelView']['content']['clear'](),this['_overflowChips']['length']>0x0)){this['_overflowChips']['forEach'](_0x54d5f2=>{_0x54d5f2['disableAnimationOnEnter']();});const _0x2348ee=new vt(this['_locale']);_0x2348ee['setTemplate']({'tag':'div','attributes':{'class':this['_config']['cssClasses']['overflowContainer']},'children':this['_overflowChips']}),this['_showMoreBalloonPanelView']['content']['add'](_0x2348ee);}}['_handleShowMoreButtonClick'](){this['_showMoreButtonView']['isOn']?this['hideBalloonPanel']():this['showBalloonPanel']();}['_updateShowMoreButtonVisibility'](){const _0x265def=this['_overflowChips']['length']>0x0;this['_showMoreButtonView']?.['element']&&(this['_showMoreButtonView']['element']['style']['display']=_0x265def?'':'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'](_0x52e9f0){const _0x127e29=this['_containerElement']?.['tagName']['toLowerCase']()||'div',_0x383597=this['_containerElement']?.['classList'];if(_0x383597){const _0x2e7955=_0x383597[0x0]||'',_0xd2899d=_0x52e9f0['querySelector']('.'+_0x2e7955),_0x56359b=_0x52e9f0['querySelector'](_0x127e29);return _0xd2899d||_0x56359b||_0x52e9f0;}return _0x52e9f0['querySelector'](_0x127e29)||_0x52e9f0;}['_calculateContainerWidth'](){const _0x48ba79=this['_parentView']?.['element']||this['_containerElement'];if(!_0x48ba79)return Kn;const _0x48d7e9=window['getComputedStyle'](_0x48ba79)['width'];if('auto'===_0x48d7e9||'0px'===_0x48d7e9||!_0x48d7e9){const _0x1d4f6f=_0x48ba79['parentElement'];if(_0x1d4f6f){const _0x1ff3fd=window['getComputedStyle'](_0x1d4f6f);return'auto'!==_0x1ff3fd['width']?_0x1ff3fd['width']:Kn;}return Kn;}return _0x48d7e9;}['_applyCalculationStyles'](_0x17f92a,_0x4f566d){this['_config']['cssClasses']['calculationContainer']&&_0x17f92a['classList']['add'](this['_config']['cssClasses']['calculationContainer']),_0x17f92a['style']['width']=_0x4f566d,_0x17f92a['style']['position']='absolute',_0x17f92a['style']['top']='-9999px',_0x17f92a['style']['left']='-9999px',_0x17f92a['style']['opacity']='0',_0x17f92a['style']['pointerEvents']='none',_0x17f92a['style']['zIndex']='-1',_0x17f92a['style']['visibility']='visible\x20!important',_0x17f92a['style']['display']='block\x20!important',_0x17f92a['style']['boxSizing']='border-box';}['_restoreAncestorVisibility'](_0x7ee726){_0x7ee726['forEach'](({element:_0x2d391e,originalDisplay:_0x304710,originalVisibility:_0x25ca0d})=>{_0x2d391e['style']['display']=_0x304710,_0x2d391e['style']['visibility']=_0x25ca0d;});}['_makeAncestorsVisible'](_0x549800){const _0x20f7be=[];let _0x3e8f81=_0x549800;for(;_0x3e8f81&&_0x3e8f81!==document['body'];){const _0x158eed=window['getComputedStyle'](_0x3e8f81);'none'!==_0x158eed['display']&&'hidden'!==_0x158eed['visibility']||(_0x20f7be['push']({'element':_0x3e8f81,'originalDisplay':_0x3e8f81['style']['display'],'originalVisibility':_0x3e8f81['style']['visibility']}),_0x3e8f81['style']['display']='block',_0x3e8f81['style']['visibility']='visible'),_0x3e8f81=_0x3e8f81['parentElement'];}return _0x20f7be;}['_createContainerElements'](){let _0x15617d,_0x1f0d4d;return this['_parentView']?.['element']?(_0x15617d=this['_parentView']['element']['cloneNode'](!0x0),_0x1f0d4d=this['_findTargetContainer'](_0x15617d)):(_0x15617d=document['createElement']('div'),_0x1f0d4d=_0x15617d),{'calculationContainer':_0x15617d,'targetContainer':_0x1f0d4d};}['_createCalculationContainer'](){const {calculationContainer:_0x84c82f,targetContainer:_0x486b00}=this['_createContainerElements'](),_0x163844=this['_calculateContainerWidth']();this['_applyCalculationStyles'](_0x84c82f,_0x163844);const _0x40a238=this['_parentView']?.['element']||this['_containerElement'],_0x488293=_0x40a238?.['parentElement'];_0x488293?_0x488293['appendChild'](_0x84c82f):document['body']['appendChild'](_0x84c82f),_0x84c82f['_targetContainer']=_0x486b00;const _0x2c788a=this['_makeAncestorsVisible'](_0x488293||null);return _0x84c82f['offsetWidth'],_0x84c82f['_ancestorsToRestore']=_0x2c788a,_0x84c82f;}['_calculateOverflowInContainer'](_0x15fd04,_0x40daa0){const _0x19bc9a=_0x15fd04['_targetContainer']||_0x15fd04,_0x12d2ca=[],{rowCount:_0x14591f}=this['_renderChipsAndCountRows'](_0x19bc9a,_0x40daa0);if(_0x14591f<=this['_config']['maxVisibleRows'])return _0x12d2ca;const _0xaf3868=_0x40daa0['slice']();for(;_0xaf3868['length']>0x0;){if(this['_testButtonFit'](_0x15fd04,_0x19bc9a,_0xaf3868)){const _0x1b8b2f=_0x40daa0['filter'](_0xf151d9=>!_0xaf3868['includes'](_0xf151d9));_0x12d2ca['push'](..._0x1b8b2f);break;}if(!_0xaf3868['pop']())break;}return _0x12d2ca;}['_renderChipsAndCountRows'](_0x2dd621,_0x28d551){_0x2dd621['innerHTML']='',_0x28d551['forEach'](_0x4abe87=>{if(_0x4abe87['element']){const _0xf85944=_0x4abe87['element']['cloneNode'](!0x0);_0x2dd621['appendChild'](_0xf85944);}}),_0x2dd621['offsetWidth'];const _0x3f57b5=_0x2dd621['children'],_0x2d5b3c=[];return Array['from'](_0x3f57b5)['forEach'](_0x347fbf=>{const _0x9990ad=_0x347fbf['getBoundingClientRect']()['top'];_0x2d5b3c['some'](_0x1fe1a6=>Math['abs'](_0x1fe1a6-_0x9990ad)<this['_config']['rowDetectionTolerance'])||_0x2d5b3c['push'](_0x9990ad);}),{'rowCount':_0x2d5b3c['length']};}['_createMockButton'](){const _0x2568bf=document['createElement']('button');return _0x2568bf['className']=this['_config']['cssClasses']['showMoreButton'],this['_config']['cssClasses']['controlsButton']&&_0x2568bf['classList']['add'](this['_config']['cssClasses']['controlsButton']),_0x2568bf['textContent']='+\x201',_0x2568bf;}['_testButtonFit'](_0x5b1429,_0x5c381b,_0x1078d9){this['_renderChipsAndCountRows'](_0x5c381b,_0x1078d9);const _0xf537dc=this['_createMockButton']();_0x5b1429['appendChild'](_0xf537dc),_0x5b1429['offsetWidth'];const _0x2588b9=[..._0x5c381b['children'],_0xf537dc],_0x2648d6=[];_0x2588b9['forEach'](_0x565cc7=>{const _0x52232e=_0x565cc7['getBoundingClientRect']()['top'];_0x2648d6['some'](_0x1effcb=>Math['abs'](_0x1effcb-_0x52232e)<this['_config']['rowDetectionTolerance'])||_0x2648d6['push'](_0x52232e);});const _0x22ad56=_0x2648d6['length'];return _0xf537dc['remove'](),_0x22ad56<=this['_config']['maxVisibleRows'];}['_distributeChips'](_0x2292d8,_0x587b26){this['_visibleChips']['clear'](),this['_overflowChips']['clear'](),_0x2292d8['forEach'](_0x3ff212=>{_0x587b26['includes'](_0x3ff212)?this['_overflowChips']['add'](_0x3ff212):this['_visibleChips']['add'](_0x3ff212);});}['_updateOverflowUI'](_0xfadf6){if(_0xfadf6>0x0&&!this['_showMoreButtonView']&&this['_createShowMoreButton'](),_0xfadf6>0x0&&this['_showMoreButtonView']){const _0xf543d0=''+this['_config']['showMoreLabelPrefix']+(_0xfadf6<0x63?_0xfadf6:'99');this['_showMoreButtonView']['label']=_0xf543d0;}this['_updateBalloonContent'](),this['_updateShowMoreButtonVisibility'](),this['_repinBalloonPanel']();}['_applyOverflowResults'](_0x14b24e,_0x41c166){this['_distributeChips'](_0x14b24e,_0x41c166),this['_updateOverflowUI'](_0x41c166['length']);}['_setupVisibilityObserver'](){this['_containerElement']&&'undefined'!=typeof IntersectionObserver&&(this['_intersectionObserver']=new IntersectionObserver(_0x51d60d=>{_0x51d60d[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 _0x92cc0e=this['_containerElement']['getBoundingClientRect']();if(0x0===_0x92cc0e['width']||0x0===_0x92cc0e['height'])return!0x1;const _0x34ba2e=window['innerHeight']||document['documentElement']['clientHeight'],_0x1a9574=window['innerWidth']||document['documentElement']['clientWidth'],_0x24c3d8=0xc8;return _0x92cc0e['bottom']>=-0xc8&&_0x92cc0e['top']<=_0x34ba2e+_0x24c3d8&&_0x92cc0e['right']>=-0xc8&&_0x92cc0e['left']<=_0x1a9574+_0x24c3d8;}}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(_0x509f92,_0x13f884,_0x55b557){super(_0x509f92),this['_bodyCollection']=_0x55b557,this['_createContextChips'](_0x13f884);const _0x3562cd={'cssClasses':{'showMoreButton':Xn+'\x20'+us,'showMoreBalloon':zn,'overflowContainer':qn,'controlsButton':Qn}};this['_overflowManager']=new Wn(_0x509f92,this['_contextChips'],_0x3562cd,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 _0x4734af=this['element']['querySelector']('.'+$n);_0x4734af&&(this['_overflowManager']['setContainerElement'](_0x4734af),this['_overflowManager']['reorganizeChips']());}['destroy'](){super['destroy'](),this['_overflowManager']['destroy']();}['_createContextChips'](_0x488b7d){for(const _0xbaacf6 of _0x488b7d){const _0x56b202=new Bn(this['locale'],_0xbaacf6,!0x0,!0x1);this['_contextChips']['add'](_0x56b202);}}}class Jn extends an{['_contextChipsView']=null;['_locale'];['_bodyCollection'];['_messageContentView'];constructor(_0x35ed1f,_0x3c75ee,_0x49fb19){super(_0x3c75ee),this['_locale']=_0x35ed1f,this['_bodyCollection']=_0x49fb19,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'](_0x248997=>!_0x248997['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(_0x3aefa1,_0x84dc92){super(_0x84dc92);const {isWebSearchEnabled:_0x13406a,isReasoningEnabled:_0x51843f}=_0x84dc92['capabilities'],_0x5e7268=[];let _0x20d459='';_0x13406a&&_0x51843f?(_0x20d459=hs(_0x3aefa1,'AI_CHAT_FEED_REPLY_ITEM_USED_WEB_SEARCH_REASONING'),_0x5e7268['push'](tr(_0xfff9b0)),_0x5e7268['push'](tr(_0x3d54c0))):_0x13406a?(_0x20d459=hs(_0x3aefa1,'AI_CHAT_FEED_REPLY_ITEM_USED_WEB_SEARCH'),_0x5e7268['push'](tr(_0xfff9b0))):_0x51843f&&(_0x20d459=hs(_0x3aefa1,'AI_CHAT_FEED_REPLY_ITEM_USED_REASONING'),_0x5e7268['push'](tr(_0x3d54c0))),this['extendTemplate']({'attributes':{'class':['ck-ai-chat__feed__interaction-header',_0x20d459?'':'ck-hidden']}});const _0xd72082=new vt();_0xd72082['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed__interaction-header__capabilities']},'children':[..._0x5e7268,{'tag':'span','attributes':{'class':['ck-ai-chat__feed__interaction-header__capabilities__text']},'children':[_0x20d459]}]}),this['children']['add'](_0xd72082),this['capabilities']=_0x84dc92['capabilities'];}}function tr(_0x370de4){const _0x43566e=new xt();return _0x43566e['content']=_0x370de4,_0x43566e;}const er=['wheel','touchstart','pointerdown','keydown'],ir=['ArrowUp','ArrowDown','PageUp','PageDown','Home','End','\x20'];class sr{['element'];['animationFrameId'];['isRunning'];['abortController'];['isUserPaused'];['scrollBehavior'];constructor(_0x1bb301){this['element']=_0x1bb301,this['animationFrameId']=null,this['isRunning']=!0x1,this['abortController']=new AbortController(),this['isUserPaused']=!0x1,this['scrollBehavior']='smooth';for(const _0x5819ba of er){const _0x58af31='keydown'!==_0x5819ba;this['element']['addEventListener'](_0x5819ba,this['_onUserEvent']['bind'](this),{'passive':_0x58af31,'signal':this['abortController']['signal']});}}['start']({smooth:_0x3bb6d8=!0x0}={}){this['isRunning']||(this['isRunning']=!0x0,this['isUserPaused']=!0x1,this['scrollBehavior']=_0x3bb6d8?'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'](_0xe36cfd){if(this['isRunning']){if('keydown'===_0xe36cfd['type']){const _0x5817be=_0xe36cfd['key'];if(!ir['includes'](_0x5817be))return;}_0xe36cfd instanceof WheelEvent?_0xe36cfd['deltaY']<0x0?this['isUserPaused']=!0x0:this['isUserPaused']=!this['_isAtBottom']():this['isUserPaused']=!0x0;}}['_isAtBottom'](){const {scrollTop:_0x299881,scrollHeight:_0x1b96b6,clientHeight:_0x449034}=this['element'];return _0x1b96b6-_0x299881-_0x449034<=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(_0x4a998a){super(_0x4a998a),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(_0x140525,_0x356b67){super(_0x140525),this['_bodyCollection']=_0x356b67,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'](_0x2acc74,_0x57dc46){let _0x4373ae;return'ai-reply'===_0x2acc74?_0x4373ae=new vn(this['locale'],_0x57dc46,this['_bodyCollection']):'ai-suggestion-reply'===_0x2acc74?(_0x4373ae=new Nn(this['locale'],_0x57dc46,this['_bodyCollection']),_0x4373ae['bind']('isTrackChangesOn')['to'](this)):_0x4373ae='user-message'===_0x2acc74?new Jn(this['locale'],_0x57dc46,this['_bodyCollection']):'interaction-header'===_0x2acc74?new Zn(this['locale'],_0x57dc46):'custom-element'===_0x2acc74?new nr(_0x57dc46):new wn(_0x57dc46),this['children']['add'](_0x4373ae),_0x4373ae;}async['updateReplyItem']({id:_0xc01b38,parsedContent:_0x514f9e,renderingStrategy:_0x339b4f,abortSignal:_0x38dd6c}){const _0x2f0f51=this['getItemById'](_0xc01b38);if(!(_0x2f0f51 instanceof vn))throw new at('ai-chat-feed-view-item-not-a-reply-item',null,{'itemView':_0x2f0f51,'id':_0xc01b38,'parsedContent':_0x514f9e});await _0x2f0f51['updateContent']({'parsedContent':_0x514f9e,'renderingStrategy':_0x339b4f,'abortSignal':_0x38dd6c});}async['updateWebSources'](_0x12d830,_0xb43481){const _0xb85913=this['getItemById'](_0x12d830);if(_0xb85913 instanceof Nn)_0xb85913['updateSources'](_0xb43481);else{if(!(_0xb85913 instanceof vn))throw new at('ai-chat-feed-view-item-not-a-suggestion-or-reply-item',null,{'itemView':_0xb85913,'id':_0x12d830,'sources':_0xb43481});_0xb85913['updateSources'](_0xb43481);}}async['updateSuggestionItem']({id:_0x556f8b,parts:_0x54b029,abortSignal:_0x33ce6c,skipLoadingEffects:_0x5aea95}){const _0x31dd85=this['getItemById'](_0x556f8b);if(!(_0x31dd85 instanceof Nn))throw new at('ai-chat-feed-view-item-not-a-suggestion-item',null,{'itemView':_0x31dd85,'id':_0x556f8b,'parts':_0x54b029});await _0x31dd85['updateContent']({'parts':_0x54b029,'abortSignal':_0x33ce6c,'skipLoadingEffects':_0x5aea95});}['updateSuggestionPartState']({id:_0x342eaa,index:_0x48b3c0,state:_0x401a0a}){const _0x30c3d1=this['getItemById'](_0x342eaa);if(!(_0x30c3d1 instanceof Nn))throw new at('ai-chat-feed-view-item-not-a-suggestion-item',this,{'id':_0x342eaa});_0x30c3d1['updatePartState'](_0x48b3c0,_0x401a0a);}['setSuggestionPartActive']({id:_0x1715dd,index:_0x5d1339,isActive:_0x356c8d}){const _0x5a521e=this['getItemById'](_0x1715dd);if(!(_0x5a521e instanceof Nn))throw new at('ai-chat-feed-view-item-not-a-suggestion-item',this,{'id':_0x1715dd});this['children']['filter'](_0x4038b7=>_0x4038b7 instanceof Nn)['forEach'](_0x53a142=>{_0x53a142['setPartActive'](!0x1);}),_0x5a521e['setPartActive'](_0x5d1339,_0x356c8d);}['markItemAsDone'](_0x5b7623){this['getItemById'](_0x5b7623)['markAsDone']();}['getItemIds'](){return this['children']['map'](_0x5369ae=>_0x5369ae['options']['id']);}['removeItem'](_0x9fd937){this['children']['remove'](this['getItemById'](_0x9fd937));}['hasItem'](_0x4774b6){return!!this['children']['find'](_0x21113f=>_0x21113f['options']['id']['includes'](_0x4774b6));}['scrollToSuggestion'](_0x2a9dc,_0x4e38c9){const _0x1225c4=this['getItemById'](_0x2a9dc);if(!(_0x1225c4 instanceof Nn))return void It('ck-ai-chat-feed-view-scroll-to-suggestion-invalid-item',{'replyId':_0x2a9dc,'partIndex':_0x4e38c9});const _0xcd3d93=_0x1225c4['getPartView'](_0x4e38c9);_0xcd3d93?ft(_0xcd3d93['element'],0x14,this['element']['parentElement'],!0x0,!0x0):It('ck-ai-chat-feed-view-scroll-to-suggestion-part-view-not-found',{'replyId':_0x2a9dc,'partIndex':_0x4e38c9});}['_setupTemplate'](){this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed']},'children':this['_createTemplateChildren']()});}['_createTemplateChildren'](){const _0x473112=this['_createSkeletonLoader']();return[this['_createFeedItems'](),_0x473112,this['_createFeedLoader']()];}['_createSkeletonLoader'](){const _0x458521=new pn(this['locale'],mn['aiFeed']);return _0x458521['bind']('isVisible')['to'](this,'isLoadingSkeletonVisible'),_0x458521;}['_createFeedItems'](){const _0x1b806a=new vt(this['locale']);return _0x1b806a['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed__items',this['bindTemplate']['if']('isLoadingSkeletonVisible','ck-hidden')]},'children':this['children']}),_0x1b806a;}['_createFeedLoader'](){const _0x8e7395=new vt(this['locale']);return _0x8e7395['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__loader',this['bindTemplate']['if']('loadingMessage','ck-hidden',_0xa52456=>!_0xa52456)]},'children':this['_createLoaderChildren']()}),_0x8e7395;}['_createLoaderChildren'](){const _0x57820b=new yn();return _0x57820b['isVisible']=!0x0,[_0x57820b,{'tag':'span','attributes':{'class':['ck','ck-ai-chat__loader-text']},'children':[{'text':this['bindTemplate']['to']('loadingMessage')}]}];}['getItemById'](_0x2f8c91){const _0x21aad1=this['children']['find'](_0xee72b7=>_0xee72b7['options']['id']['includes'](_0x2f8c91));if(!_0x21aad1)throw new at('ai-chat-feed-view-item-not-found',this,{'id':_0x2f8c91});return _0x21aad1;}['setLoadingMessage'](_0x33ec69){this['set']('loadingMessage',_0x33ec69);}['toggleLoadingSkeleton'](_0x51fedc){this['set']('isLoadingSkeletonVisible',_0x51fedc);}['startAutoScroll'](_0x4c6248={}){this['scrollManager']['start'](_0x4c6248);}['stopAutoScroll'](){this['scrollManager']['stop']();}}class or extends Dt{['filter'](){let _0x46496b=0x0;for(const _0x338951 of this['items'])_0x46496b+=_0x338951['items']['length'];return{'resultsCount':_0x46496b,'totalItemsCount':_0x46496b};}}const ar='ck-ai-chat__prompt-input_highlighted';class hr extends Lt{['submitButtonView'];static ['MIN_ROWS']=0x1;static ['MAX_ROWS']=0xc;['_addContextButtonView'];['_queryViewResizeObserver'];constructor(_0x4c7f31,_0xfccf20){super(_0x4c7f31,{'queryView':{'label':'','creator':Vt,'showIcon':!0x1,'showResetButton':!0x1},'filteredView':new or(_0x4c7f31),'queryMinChars':0x1/0x0,'resetOnBlur':!0x1}),this['set']('isEmpty',!0x0),this['set']('isUploadInProgress',!0x1),this['_addContextButtonView']=_0xfccf20,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',(_0x1af6c7,_0x3ffcf9)=>!_0x1af6c7&&!_0x3ffcf9),this['focusableChildren']['add'](this['submitButtonView']);}['render'](){super['render'](),this['queryView']['fieldWrapperChildren']['add'](this['submitButtonView']),this['keystrokes']['set']('enter',(_0x198def,_0x697e94)=>{this['isUploadInProgress']||this['isEmpty']||_0x198def['target']==this['queryView']['fieldView']['element']&&(this['submit'](),_0x697e94());}),this['queryView']['fieldView']['on']('update',()=>{this['isEmpty']=''===this['queryView']['fieldView']['element']['value']?.['trim']();});}['destroy'](){super['destroy'](),this['_queryViewResizeObserver']&&this['_queryViewResizeObserver']['destroy']();}['submit'](){const _0xf66033=this['queryView']['fieldView']['element']['value']?.['trim']();if(!_0xf66033)return this['queryView']['errorText']=hs(this['locale'],'AI_CHAT_PROMPT_EMPTY_ERROR'),void(this['queryView']['fieldView']['hasError']=!0x0);this['queryView']['fieldView']['hasError']=!0x1;const _0x13d36e=_0x5aed4a(_0xf66033);this['fire']('sendUserMessage',_0x13d36e),this['queryView']['fieldView']['reset']();}['setPlaceholderText'](_0xf8c3bf){this['queryView']['fieldView']['set']('placeholder',_0xf8c3bf);}['focus'](_0x246df1=!0x1){super['focus'](),_0x246df1&&(this['element']['classList']['contains'](ar)||(this['element']['classList']['add'](ar),setTimeout(()=>{this['element']['classList']['remove'](ar);},0x320)));}['_createSubmitButton'](){const _0x20bd9f=new Nt(this['locale']);return _0x20bd9f['set']({'icon':_0x1f67f2,'label':hs(this['locale'],'AI_CHAT_LABEL_SUBMIT'),'isVisible':!0x0,'tooltip':!0x0,'class':'ck-ai-chat__prompt-submit-button\x20'+cs,'isEnabled':!0x1}),_0x20bd9f['on']('execute',()=>{this['submit']();}),_0x20bd9f;}['setIsUploadInProgress'](_0x16d12a){this['isUploadInProgress']=_0x16d12a;}['_setUpAddContextButtonPositioning'](){const _0x4fcd9e=this['locale'],_0x17915d=()=>{ct['window']['requestAnimationFrame'](()=>{if(lt(this['element'])){const _0x1d9b62=new ut(this['queryView']['fieldView']['element']),_0x3d6f79=new ut(this['_addContextButtonView']['element']),_0xf40744=_0x1d9b62['width'],_0x1a75bd='rtl'===_0x4fcd9e['uiLanguageDirection']?'right':'left';_0x1d9b62['excludeScrollbarsAndBorders']();const _0xeeaa3c=_0xf40744-_0x1d9b62['width']+0x1;this['_addContextButtonView']['element']['style'][_0x1a75bd]='calc('+(_0xf40744-_0x3d6f79['width']-_0xeeaa3c)+'px\x20-\x20var(--ck-spacing-tiny))';}});};this['queryView']['fieldView']['on']('update',_0x17915d),this['on']('render',()=>{_0x17915d(),this['_queryViewResizeObserver']=new bt(this['queryView']['fieldView']['element'],()=>{_0x17915d();});});}}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(_0x243b5f){super(_0x243b5f),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',_0x490a63=>'selector'===_0x490a63),this['_modelSelectionDropdown']['buttonView']['bind']('tooltip')['to'](this,'modelSelectorEnabled',_0x56dd64=>_0x56dd64?this['_modelSelectionDropdown']['buttonView']['label']:hs(this['locale'],'AI_CHAT_MODEL_SELECTOR_DISABLED_TOOLTIP')),this['_modelSelectionDropdown']['bind']('isEnabled')['to'](this,'modelSelectorEnabled',_0xe3bfc3=>_0xe3bfc3),this['_webSearchButton']['bind']('isOn')['to'](this,'webSearchActive',_0x29cf8f=>_0x29cf8f),this['_webSearchButton']['bind']('tooltip')['to'](this,'webSearchActive',_0x248c7a=>hs(this['locale'],_0x248c7a?'AI_CHAT_DISABLE_WEB_SEARCH':'AI_CHAT_ENABLE_WEB_SEARCH')),this['_reasoningButton']['bind']('isOn')['to'](this,'reasoningActive',_0x4c5ca2=>_0x4c5ca2),this['_reasoningButton']['bind']('tooltip')['to'](this,'reasoningActive',_0x374fbc=>hs(this['locale'],_0x374fbc?'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'](_0x9403ed,_0x5562f6){if(_0x5562f6)this['set']('modelDisplayMode','hidden');else{const _0x43dabb=0x1===_0x9403ed['length'];this['set']('modelDisplayMode',_0x43dabb?'name':'selector');}if(this['_modelSelectionDropdownItems']['clear'](),_0x9403ed?.['length'])for(const _0x568be8 of _0x9403ed){const _0x261daf=new Jt({'label':_0x568be8['name'],'withText':!0x0,'role':'menuitemradio','id':_0x568be8['id'],'model':_0x568be8});_0x261daf['bind']('isOn')['to'](this,'activeModelId',_0x8aba09=>_0x8aba09===_0x568be8['id']),this['_modelSelectionDropdownItems']['add']({'type':'button','model':_0x261daf,'labelView':new pr(this['locale'],_0x568be8)});}}['setWebSearch'](_0x1918e0){this['set']('webSearchActive',_0x1918e0);}['setReasoning'](_0x58afae){this['set']('reasoningActive',_0x58afae);}['setModel'](_0x255d66){if(!_0x255d66)return;this['activeModelId']=_0x255d66['id'],this['activeModelName']=_0x255d66['name']||_0x255d66['id'],this['_modelSelectionDropdown']['buttonView']['set']('label',_0x255d66['name']),this['_modelSelectionDropdown']['buttonView']['set']('tooltip',_0x255d66['name']);const _0xf318bd=_0x255d66['capabilities']['webSearch']?.['enabled']??!0x1;this['set']('webSearchActive',!0x1),this['_webSearchButton']['set']('isOn',!0x1),this['_webSearchButton']['set']('isEnabled',_0xf318bd),this['_webSearchButton']['set']('isVisible',_0xf318bd);const _0x5a3a25=_0x255d66['capabilities']['reasoning']?.['enabled']??!0x1;this['set']('reasoningActive',!0x1),this['_reasoningButton']['set']('isOn',!0x1),this['_reasoningButton']['set']('isEnabled',_0x5a3a25),this['_reasoningButton']['set']('isVisible',_0x5a3a25);}['enableModelSelector'](){this['set']('modelSelectorEnabled',!0x0);}['disableModelSelector'](_0x52f20c){this['set']('modelSelectorEnabled',!0x1),_0x52f20c&&this['set']('modelDisplayMode','hidden');}['_createWebSearchButton'](){const _0x41eec7=new Nt();return _0x41eec7['set']({'label':hs(this['locale'],'AI_CHAT_SEARCH_WEB'),'icon':_0xfff9b0,'class':lr+'\x20'+us,'isToggleable':!0x0,'tooltipPosition':Ir}),_0x41eec7['on']('execute',()=>{this['fire']('toggleWebSearch');}),_0x41eec7;}['_createReasoningButton'](){const _0x5a8ce3=new Nt();return _0x5a8ce3['set']({'label':hs(this['locale'],'AI_CHAT_REASONING'),'icon':_0x3d54c0,'class':lr+'\x20'+us,'isToggleable':!0x0,'tooltipPosition':Ir}),_0x5a8ce3['on']('execute',()=>{this['fire']('toggleReasoning');}),_0x5a8ce3;}['_createCommandsButton'](){const _0x3dab1f=new Nt();return _0x3dab1f['set']({'label':hs(this['locale'],'AI_CHAT_COMMANDS'),'icon':_0x4a7bec,'withText':!0x0,'class':lr+'\x20'+us,'isToggleable':!0x0,'tooltip':hs(this['locale'],'AI_CHAT_COMMANDS'),'tooltipPosition':Ir}),_0x3dab1f['extendTemplate']({'attributes':{'class':[ur]}}),_0x3dab1f['on']('execute',()=>{console['log']('Commands\x20are\x20not\x20implemented\x20yet.'),alert('Commands\x20are\x20not\x20implemented\x20yet.');}),_0x3dab1f;}['_createModelSelectionDropdown'](){const _0x2d461d=Gt(this['locale']);return _0x2d461d['set']({'panelPosition':'ne','class':[dr]}),_0x2d461d['buttonView']['set']({'label':hs(this['locale'],'AI_CHAT_MODEL_SELECTOR_ENABLED_TOOLTIP'),'withText':!0x0,'tooltip':!0x0,'tooltipPosition':Ir,'class':us}),this['listenTo'](_0x2d461d,'execute',_0x4953de=>{this['fire']('selectModel',_0x4953de['source']['model']);}),_0x2d461d;}['_createModelNameView'](){const _0x30b185=new mr(this['locale']);return _0x30b185['bind']('text')['to'](this,'activeModelName',_0x2c6bfd=>_0x2c6bfd??''),_0x30b185['bind']('isVisible')['to'](this,'modelDisplayMode',_0x42b08e=>'name'===_0x42b08e),_0x30b185;}}let pr=class extends Mt{constructor(_0x465002,_0x535179){super();const _0x568114=this['bindTemplate'],_0xaee110=this['createCollection']();this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-button__label'],'style':_0x568114['to']('style'),'id':_0x568114['to']('id')},'children':[{'tag':'div','attributes':{'class':[_r]},'children':[{'text':_0x568114['to']('text')}]},{'tag':'div','attributes':{'class':[gr]},'children':[{'tag':'span','children':[{'text':_0x535179['description']}]}]},{'tag':'div','attributes':{'class':[Ar]},'children':_0xaee110}]}),_0xaee110['addMany'](this['_getCapabilityParts'](_0x465002,_0xfff9b0,'AI_CHAT_SEARCH_WEB',_0x535179['capabilities']['webSearch']?.['enabled']??!0x1)),_0xaee110['addMany'](this['_getCapabilityParts'](_0x465002,_0x3d54c0,'AI_CHAT_REASONING',_0x535179['capabilities']['reasoning']?.['enabled']??!0x1));}['_getCapabilityParts'](_0x269cdd,_0x511d71,_0x418c4b,_0xcc81f9){const _0x3bd7a=new xt();_0x3bd7a['content']=_0x511d71;const _0x44a452=new vt(_0x269cdd);_0x44a452['setTemplate']({'tag':'span','children':[{'text':hs(_0x269cdd,_0x418c4b)+':\x20'}]});const _0x1e02c3=new vt(_0x269cdd);return _0x1e02c3['setTemplate']({'tag':'span','children':[{'text':hs(_0x269cdd,_0xcc81f9?'AI_CHAT_CAPABILITIES_YES':'AI_CHAT_CAPABILITIES_NO')}]}),[_0x3bd7a,_0x44a452,_0x1e02c3];}},mr=class extends vt{constructor(_0x2f0ea6){super(_0x2f0ea6),this['set']('text',void 0x0),this['set']('isVisible',!0x0);const _0x53d88b=this['bindTemplate'];this['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai-chat-controls__model-name',_0x53d88b['if']('isVisible','ck-hidden',_0x57ce7a=>!_0x57ce7a)]},'children':[{'text':_0x53d88b['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(_0x53c9a5){super(_0x53c9a5),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'](_0xf8351f=>{this['focusTracker']['add'](_0xf8351f['element']),this['keystrokes']['listenTo'](_0xf8351f['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'](_0x13608c){this['urlInputField']['errorText']=_0x13608c,this['_updateConfirmButtonState'](),this['fire']('refreshBalloon');}['clearError'](){this['urlInputField']['errorText']=null,this['_updateConfirmButtonState']();}['_createBackButton'](){const _0xe2ad6e=new Nt(this['locale']);return _0xe2ad6e['set']({'icon':_0xba82e9,'tooltip':hs(this['locale'],'AI_CHAT_CONTEXT_URL_BACK_TO_CONTEXT'),'tooltipPosition':'n','class':['ck-button-icon\x20ck-button-back']}),this['on']('change:withBackButton',(_0x297b7b,_0x4b1f32,_0x5bce36)=>{_0xe2ad6e['set']({'class':['ck-button-icon\x20ck-button-back'+(_0x5bce36?'':'\x20ck-hidden')]});}),_0xe2ad6e;}['_createUrlInputField'](){const _0x57391a=new te(this['locale'],_0x1a6109);return _0x57391a['set']({'label':hs(this['locale'],'AI_CHAT_CONTEXT_URL_LABEL'),'class':'ck-labeled-field-view_empty'}),_0x57391a['fieldView']['set']({'placeholder':hs(this['locale'],'AI_CHAT_CONTEXT_URL_PLACEHOLDER')}),_0x57391a;}['_createConfirmButton'](){const _0x42cc91=new Nt(this['locale']);return _0x42cc91['set']({'icon':_0x406d61,'tooltip':hs(this['locale'],'AI_CHAT_CONTEXT_URL_ADD_URL'),'tooltipPosition':'n','class':'ck-button-icon','type':'submit','isEnabled':!0x1}),_0x42cc91;}['_setupTemplate'](){const _0x23dbcd=new _0xb76395(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'});_0x23dbcd['children']['add'](this['backButton'],0x0),this['setTemplate']({'tag':'form','attributes':{'class':Tr,'tabindex':'-1'},'children':[_0x23dbcd,{'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',_0x3d7f5c=>{_0x3d7f5c['stop'](),this['_handleSubmit']();});}['_setupKeystrokes'](){this['keystrokes']['set']('esc',(_0x28267c,_0x530eca)=>{this['clear'](),this['fire']('cancel'),_0x530eca();});}['_handleSubmit'](){const _0x479ca7=this['getValue']()['trim']();_0x479ca7?this['_isValidUrl'](_0x479ca7)?(this['clearError'](),this['fire']('submitUrl',_0x479ca7)):this['setError'](hs(this['locale'],'AI_CHAT_CONTEXT_URL_INVALID_ERROR')):this['setError'](hs(this['locale'],'AI_CHAT_CONTEXT_URL_EMPTY_ERROR'));}['_updateConfirmButtonState'](){const _0x28ee39=this['getValue']()['trim'](),_0x67573e=!!this['urlInputField']['errorText'];this['confirmButton']['isEnabled']=_0x28ee39['length']>0x0&&!_0x67573e;}['_isValidUrl'](_0x532310){try{return!!new URL(_0x532310);}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(_0x1e024e,_0x24399c){super(_0x1e024e),this['resource']=_0x24399c,this['set']('isInContext',!!_0x24399c['isInContext']),this['_titleView']=this['_createTitleView'](),this['_iconView']=this['_createIconView'](),this['_setupTemplate']();}['render'](){super['render']();}['getResourceIcon'](_0x1430de){if(_0x1430de['isInContext'])return _0x406d61;switch(_0x1430de['type']){case'document':return _0x3e528c;case'web-resource':return _0xe5297c;case'file':case'text':return _0xc51032;default:return _0xfc4b68;}}['highlightText'](_0x5eecdd){if(!_0x5eecdd||''===_0x5eecdd['trim']())return void this['_titleView']['highlightText'](null);const _0x5f25e1=new RegExp(_0x5607f9(_0x5eecdd),'gi');this['_titleView']['highlightText'](_0x5f25e1);}['updateResourceState'](_0x12949d){this['resource']['isInContext']=_0x12949d,this['isInContext']=_0x12949d,this['_updateIcon']();}['_createTitleView'](){const _0x688715=new _0x56ea6b();return _0x688715['text']=this['resource']['label'],_0x688715['extendTemplate']({'tag':'span','attributes':{'class':[Sr]}}),_0x688715;}['_createIconView'](){const _0x5cf645=new xt();return _0x5cf645['content']=this['getResourceIcon'](this['resource']),_0x5cf645;}['_setupTemplate'](){const _0x204634=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':[fr,_0x204634['if']('isVisible','ck-hidden',_0x4ab70f=>!_0x4ab70f),_0x204634['if']('isInContext',br)]},'children':[{'tag':'div','attributes':{'class':[Rr]},'children':[this['_iconView']]},this['_titleView']],'on':{'click':_0x204634['to']('execute')}});}['_updateIcon'](){this['_iconView']['content']=this['getResourceIcon'](this['resource']);}}const kr='ck-ai-chat-resources__list';class Nr extends Dt{['_source'];constructor(_0x5de904,_0x49f503){super(_0x5de904),this['_source']=_0x49f503,this['extendTemplate']({'attributes':{'class':[kr]}});}['setResources'](_0x6d27c,_0x325091){this['items']['clear']();let _0x6a419b=_0x6d27c;if(this['_source']['useDefaultFiltering']&&_0x325091&&''!==_0x325091['trim']()){const _0x170351=new RegExp(_0x325091['replace'](/[.*+?^${}()|[\]\\]/g,'\x5c$&'),'gi');_0x6a419b=_0x6d27c['filter'](_0x406b8a=>_0x170351['test'](_0x406b8a['label']));}for(const _0x4f8d81 of _0x6a419b){const _0x4b1e80=new Or(this['locale'],_0x4f8d81);_0x4b1e80['on']('execute',()=>{this['_handleResourceSelection'](this['_source'],_0x4f8d81);}),this['items']['add'](_0x4b1e80);}this['_source']['useDefaultFiltering']&&this['highlightText'](_0x325091);}['highlightText'](_0x21a6b0){this['_source']['useDefaultFiltering']&&this['items']['forEach'](_0x5bff49=>{_0x5bff49['highlightText'](_0x21a6b0);});}['updateResourceState'](_0xe3bb5c,_0xb209e2){for(const _0x452ae9 of this['items']){const _0x2027c3=_0x452ae9;_0x2027c3['resource']['id']===_0xe3bb5c&&_0x2027c3['updateResourceState'](_0xb209e2);}}['_handleResourceSelection'](_0x4ff6f7,_0x2320fc){this['fire']('addResourceToContext',{'source':_0x4ff6f7,'resource':_0x2320fc});}}class vr extends te{['iconView'];['resetButtonView'];['_viewConfig'];constructor(_0x1dc87a){const t=_0x1dc87a['t'],_0x5d31ad={'showResetButton':!0x0,'showIcon':!0x0,'creator':_0x1a6109,'label':hs(_0x1dc87a,'AI_CHAT_SEARCH_RESOURCES')};super(_0x1dc87a,_0x5d31ad['creator']),this['label']=_0x5d31ad['label'],this['_viewConfig']=_0x5d31ad,this['_viewConfig']['showIcon']&&this['_setupSearchIcon'](),this['_viewConfig']['showResetButton']&&this['_setupResetButton'](_0x1dc87a,t),this['_setupEventListeners']();}['reset'](){this['fieldView']['reset'](),this['_viewConfig']['showResetButton']&&this['resetButtonView']&&(this['resetButtonView']['isVisible']=!0x1),this['search']('');}['search'](_0x5cab5f){this['fire']('search',_0x5cab5f);}['getQuery'](){return this['fieldView']['element']?.['value']||'';}['_setupSearchIcon'](){this['iconView']=new xt(),this['iconView']['content']=_0x262e2c,this['fieldWrapperChildren']['add'](this['iconView'],0x0),this['extendTemplate']({'attributes':{'class':'ck-search__query_with-icon'}});}['_setupResetButton'](_0x594f72,t){this['resetButtonView']=new Nt(_0x594f72),this['resetButtonView']['set']({'label':t('Clear'),'icon':_0x35e3e9,'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',_0x41ffe4=>!_0x41ffe4),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(_0x476e01,_0x291bb5){super(_0x476e01),this['_source']=_0x291bb5['source'],this['_searchInputVisibleFrom']=_0x291bb5['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 _0x23af51([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 _0x566ac2=new vt(this['locale']);return _0x566ac2['setTemplate']({'tag':'div','attributes':{'class':'ck\x20ck-search'},'children':[this['_searchView']]}),this['_searchView']['on']('search',(_0x1c7d49,_0x1dd79c)=>{this['loadResources'](_0x1dd79c),this['_source']['useDefaultFiltering']&&this['_resourcesListView']['highlightText'](_0x1dd79c);}),_0x566ac2;}['_createResourcesListView'](){const _0x2f0e1f=new Nr(this['locale'],this['_source']);return _0x2f0e1f['delegate']('addResourceToContext')['to'](this),_0x2f0e1f['extendTemplate']({'attributes':{'class':this['bindTemplate']['if']('isLoading','ck-hidden')}}),_0x2f0e1f;}['_createSkeletonView'](){const _0x1d54a9=new pn(this['locale'],mn['aiChatResources']);return _0x1d54a9['bind']('isVisible')['to'](this,'isLoading'),_0x1d54a9;}['render'](){super['render'](),this['loadResources']('');}['loadResources'](_0x4de010){const _0x555c42=ot();this['_latestLoadResourcesUid']=_0x555c42,this['fire']('loadSourceResources',{'sourceId':this['_source']['id'],'query':_0x4de010,'uid':_0x555c42}),this['isLoading']=!0x0;}['setResources'](_0x24ef2c,_0x1751da){if(_0x1751da&&_0x1751da!==this['_latestLoadResourcesUid'])return;const _0x318957=this['_source']['useDefaultFiltering']?this['_searchView']['getQuery']():'';this['_resourcesListView']['setResources'](_0x24ef2c,_0x318957),_0x24ef2c['length']>=this['_searchInputVisibleFrom']&&!this['children']['has'](this['_searchSection'])&&this['children']['add'](this['_searchSection'],0x0),requestAnimationFrame(()=>{this['isLoading']=!0x1;});}['updateResourceState'](_0x42bc39,_0x3cadbc){this['_resourcesListView']['updateResourceState'](_0x42bc39,_0x3cadbc);}}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(_0x74cef,_0x18687b,_0x381bb1){this['_locale']=_0x74cef,this['_bodyCollection']=_0x18687b,this['_config']=_0x381bb1;}['showSourceResourcesBalloon']({source:_0x393bd9,withBackButton:_0x171f01}){let _0xfaf8c5=this['_sourceResourceBalloons']['get'](_0x393bd9['id']);_0xfaf8c5||(_0xfaf8c5=this['_createSourceResourceBalloonPanel'](),this['_sourceResourceBalloons']['set'](_0x393bd9['id'],_0xfaf8c5),this['_setupSingleResourceBalloonClickOutsideHandler'](_0xfaf8c5)),this['_addSourceResourceContent']({'balloonPanel':_0xfaf8c5,'source':_0x393bd9,'withBackButton':_0x171f01}),_0xfaf8c5['show']();const _0x26d298=this['_config']['getTargetElement']();_0x26d298&&_0xfaf8c5['pin']({'target':_0x26d298,'limiter':this['_config']['getLimiterElement']()});}['populateSourceResourceBalloon'](_0x307d1a,_0x418030,_0x126239){const _0x4568fc=this['_sourceResourceBalloons']['get'](_0x307d1a);if(!_0x4568fc)return;const _0x247c80=this['_getResourcesViewFromBalloon'](_0x4568fc);_0x247c80&&(_0x247c80['setResources'](_0x418030,_0x126239),_0x247c80['once']('change:isLoading',()=>{_0x4568fc['pin']({'target':this['_config']['getTargetElement'](),'limiter':this['_config']['getLimiterElement']()});}));}['closeSourceResourceBalloon'](_0x34f815){const _0xc2f5c4=this['_sourceResourceBalloons']['get'](_0x34f815);_0xc2f5c4&&requestAnimationFrame(()=>{_0xc2f5c4['hide'](),this['_sourceResourceBalloons']['delete'](_0x34f815),this['_config']['onBalloonClosed']();});}['isAnyResourceBalloonVisible'](){for(const _0x171c6e of this['_sourceResourceBalloons']['values']())if(_0x171c6e['isVisible'])return!0x0;return!0x1;}['updateResourceState'](_0x261a80,_0x5e9c64,_0x293f3d){const _0xa7a3e9=this['_sourceResourceBalloons']['get'](_0x261a80);if(!_0xa7a3e9||!_0xa7a3e9['isVisible'])return;const _0x1071b3=this['_config']['getTargetElement']();if(!_0x1071b3)return;_0xa7a3e9['pin']({'target':_0x1071b3,'limiter':this['_config']['getLimiterElement']()});const _0x345eed=this['_getResourcesViewFromBalloon'](_0xa7a3e9);_0x345eed&&_0x345eed['updateResourceState'](_0x5e9c64,_0x293f3d);}['destroy'](){for(const _0x4249bf of this['_sourceResourceBalloons']['values']())_0x4249bf['destroy']();this['_sourceResourceBalloons']['clear']();}['_createSourceResourceBalloonPanel'](){const _0x5bd280=new Xt(this['_locale']);return _0x5bd280['extendTemplate']({'attributes':{'class':xr}}),this['_bodyCollection']['add'](_0x5bd280),_0x5bd280;}['_addSourceResourceContent']({balloonPanel:_0x68e4ef,source:_0x4fce72,withBackButton:_0x492129}){_0x68e4ef['content']['clear']();const _0x3b367e=this['_createBalloonHeader']({'balloonPanel':_0x68e4ef,'source':_0x4fce72,'withBackButton':_0x492129});_0x68e4ef['content']['add'](_0x3b367e);const _0x1b9a66=this['_createBalloonResourcesView'](_0x4fce72);_0x68e4ef['content']['add'](_0x1b9a66);}['_createBalloonHeader']({balloonPanel:_0x45f067,source:_0x68cc29,withBackButton:_0x26ffdb}){const _0x20aeb1=new _0xb76395(this['_locale'],{'label':_0x68cc29['label'],'class':Dr});return _0x26ffdb&&_0x20aeb1['children']['add'](this['_createBackButton'](_0x45f067),0x0),_0x20aeb1;}['_createBackButton'](_0x5460f2){const _0x7f77e8=new Nt(this['_locale']);return _0x7f77e8['set']({'icon':_0xba82e9,'tooltip':hs(this['_locale'],'AI_CHAT_CONTEXT_URL_BACK_TO_CONTEXT'),'tooltipPosition':'n','class':Lr}),_0x7f77e8['on']('execute',()=>{_0x5460f2['hide'](),this['_config']['onBackToContext']();}),_0x7f77e8;}['_createBalloonResourcesView'](_0x1d718d){const _0x2f8414=new yr(this['_locale'],{'source':_0x1d718d,'searchInputVisibleFrom':this['_config']['searchInputVisibleFrom']});return _0x2f8414['on']('loadSourceResources',(_0x37446d,_0x5d2cf2)=>{this['_config']['onLoadSourceResources'](_0x5d2cf2);}),_0x2f8414['on']('addResourceToContext',(_0x33f27d,_0x39fee4)=>{this['_config']['onResourceSelected'](_0x39fee4['source'],_0x39fee4['resource']),this['closeSourceResourceBalloon'](_0x1d718d['id']);}),_0x2f8414;}['_getResourcesViewFromBalloon'](_0x1e9384){const _0x119262=_0x1e9384['content']['get'](0x1);return _0x119262 instanceof yr?_0x119262:null;}['_setupSingleResourceBalloonClickOutsideHandler'](_0x3728d5){zt({'emitter':_0x3728d5,'contextElements':[_0x3728d5['element']],'callback':()=>{_0x3728d5['hide'](),this['_config']['onBalloonClosed']();},'activator':()=>_0x3728d5['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(_0x13bbf1,_0x9d34e5){super(_0x13bbf1),this['bodyCollection']=_0x9d34e5['bodyCollection'],this['_currentContextsChips']=this['createCollection'](),this['_conversationContextsChips']=this['createCollection'](),this['addContextButtonView']=this['_createAddContextButtonView'](_0x13bbf1),this['_addContextBalloonPanelView']=this['_createAddContextBalloonPanelView'](_0x13bbf1),this['_urlBalloonPanelView']=this['_createUrlBalloonPanelView'](_0x13bbf1),this['_resourcesBalloonView']=this['_createResourcesBalloonView'](_0x13bbf1,_0x9d34e5);const _0x3244cd={'cssClasses':{'showMoreButton':$r+'\x20'+us,'showMoreBalloon':qr,'overflowContainer':Yr,'controlsButton':Wr}};this['_overflowManager']=new Wn(_0x13bbf1,this['_currentContextsChips'],_0x3244cd,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'](_0x1b822c,_0x2c2cae){const _0x3d3405=this['_createContextButton'](_0x1b822c,'current',!0x0,_0x2c2cae);this['_addContextToCollection'](_0x3d3405,this['_currentContextsChips']),this['_overflowManager']['reorganizeChips']();}['removeContextItem'](_0x4482d4){this['_removeContextFromCollection'](_0x4482d4,this['_currentContextsChips']),this['_removeContextFromCollection'](_0x4482d4,this['_overflowManager']['overflowChips']),this['_overflowManager']['reorganizeChips']();}['setContextItemLoading'](_0x1553ac,_0x58346a){let _0x1a8e79=this['_currentContextsChips']['find'](_0x751a97=>_0x751a97['id']===_0x1553ac);_0x1a8e79||(_0x1a8e79=this['_overflowManager']['overflowChips']['find'](_0x35e612=>_0x35e612['id']===_0x1553ac)),_0x1a8e79&&(_0x1a8e79['isLoading']=_0x58346a);}['setConversationContext'](_0x48431a){this['_conversationContextsChips']['clear']();for(const _0x48b4ab of _0x48431a){const _0x1c5256=this['_createContextButton'](_0x48b4ab,'conversation',!0x1,!0x1);this['_addContextToCollection'](_0x1c5256,this['_conversationContextsChips']);}}['clearCurrentContextItems'](){this['_currentContextsChips']['clear'](),this['_overflowManager']['clear']();}['clearConversationContextItems'](){this['_conversationContextsChips']['clear']();}['updateResourceState'](_0x1503e0,_0xb9a318,_0x4abb3d){this['_resourcesBalloonView']['updateResourceState'](_0x1503e0,_0xb9a318,_0x4abb3d);}['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:_0x558566,withBackButton:_0x2be00c}){this['_resourcesBalloonView']['showSourceResourcesBalloon']({'source':_0x558566,'withBackButton':_0x2be00c}),this['addContextButtonView']['isOn']=!0x0;}['populateSourceResourceBalloon'](_0x80a25,_0x50dd14,_0x18b304,_0x15fb9f){this['_resourcesBalloonView']['populateSourceResourceBalloon'](_0x80a25,_0x18b304,_0x15fb9f);}['closeSourceResourceBalloon'](_0x4116dd){this['_resourcesBalloonView']['closeSourceResourceBalloon'](_0x4116dd),this['addContextButtonView']['isOn']=!0x1;}['setAddContextOptions'](_0x2b78ed){this['_setBalloonPanelContent'](this['_addContextBalloonPanelView'],this['locale'],_0x2b78ed),this['_setAddContextButtonEnabled'](_0x2b78ed);}['_setAddContextButtonEnabled'](_0x392cff){const _0x2526bf=!_0x392cff['document']['isHidden']&&_0x392cff['document']['enabled'],_0x3d179=_0x392cff['urls']['enabled'],_0x166ab9=_0x392cff['files']['enabled'],_0x5b8b72=_0x392cff['sources']['length']>0x0,_0x49e555=_0x392cff['customItems']&&_0x392cff['customItems']['length']>0x0;this['addContextButtonView']['isEnabled']=_0x2526bf||_0x3d179||_0x166ab9||_0x5b8b72||_0x49e555;}['_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'](_0x1a058c){const _0x584600=new Nt(_0x1a058c);return _0x584600['set']({'label':hs(_0x1a058c,'AI_CHAT_CONTEXT_ADD_CONTEXT'),'class':Wr+'\x20'+Br+'\x20'+us,'icon':_0x5e24ae,'isToggleable':!0x0,'tooltip':!0x0,'tooltipPosition':'sw'}),_0x584600;}['_createAddContextBalloonPanelView'](_0x3cf50f){return this['_createBaseBalloonPanel'](_0x3cf50f,Vr);}['_createUrlBalloonPanelView'](_0x52ec31){const _0x226eef=this['_createBaseBalloonPanel'](_0x52ec31,Gr);return this['_addUrlContent'](_0x226eef,_0x52ec31),_0x226eef;}['_createResourcesBalloonView'](_0x3ad573,_0x279737){const _0x599252={'searchInputVisibleFrom':_0x279737['searchInputVisibleFrom'],'onBackToContext':()=>{this['showAddContextBalloonPanel'](),this['_addContextBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':Xr});},'onResourceSelected':(_0x1e27da,_0xad49d3)=>{this['fire']('addResourceToContext',{'source':_0x1e27da,'resource':_0xad49d3});},'onLoadSourceResources':_0x3b15c2=>{this['fire']('loadSourceResources',_0x3b15c2);},'onBalloonClosed':()=>{this['addContextButtonView']['isOn']=!0x1;},'getLimiterElement':()=>this['_getLimiterElement'](),'getTargetElement':()=>this['addContextButtonView']['element']};return new Pr(_0x3ad573,_0x279737['bodyCollection'],_0x599252);}['_getLimiterElement'](){return this['element']?.['closest']('.'+Qr)||document['body'];}['_createBaseBalloonPanel'](_0x206295,_0x4c5373){const _0x2bbbaf=new Xt(_0x206295);return _0x2bbbaf['extendTemplate']({'attributes':{'class':_0x4c5373}}),this['bodyCollection']['add'](_0x2bbbaf),_0x2bbbaf;}['_setBalloonPanelContent'](_0x3ccf85,_0x48cfeb,_0xb04ae2){if(_0x3ccf85['content']['clear'](),!_0xb04ae2['document']['isHidden']&&_0xb04ae2['document']['enabled']){const _0xa55a0a=this['_createBalloonButton'](_0x48cfeb,{'label':hs(_0x48cfeb,'AI_CHAT_CONTEXT_CURRENT_DOCUMENT'),'icon':_0x3e528c});_0xa55a0a['on']('execute',()=>{this['fire']('addDocumentToContext'),this['hideAddContextBalloonPanel']();}),_0x3ccf85['content']['add'](_0xa55a0a);}if(_0xb04ae2['urls']['enabled']){const _0x5d79c4=this['_createBalloonButton'](_0x48cfeb,{'label':hs(_0x48cfeb,'AI_CHAT_CONTEXT_URL_LABEL'),'icon':_0xe5297c});_0x5d79c4['on']('execute',()=>{this['hideAddContextBalloonPanel'](),this['showUrlBalloonPanel'](),this['_urlBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':Xr}),this['_urlInputView']['focus']();}),_0x3ccf85['content']['add'](_0x5d79c4);}if(_0xb04ae2['files']['enabled']){const _0x2d0aa4=new _0x2dc43e(_0x48cfeb);_0x2d0aa4['set']({'label':hs(_0x48cfeb,'AI_CHAT_CONTEXT_FILE_LABEL'),'icon':_0x14e330,'withText':!0x0,'tooltip':!0x0,'class':Fr,'allowMultipleFiles':!0x0}),_0x2d0aa4['on']('execute',()=>{this['hideAddContextBalloonPanel']();}),_0x2d0aa4['on']('done',(_0x2b2fcd,_0x1409cb)=>{this['fire']('addFileToContext',_0x1409cb);}),_0x2d0aa4['tooltip']=!0x0,_0x3ccf85['content']['add'](_0x2d0aa4);}for(const _0x2a2ccb of _0xb04ae2['sources']){const _0xdac4d8=this['_createBalloonButton'](_0x48cfeb,{'label':_0x2a2ccb['label'],'icon':_0x2a2ccb['icon']||_0xfc4b68,'type':'source'});_0x3ccf85['content']['add'](_0xdac4d8),_0xdac4d8['on']('execute',()=>{this['hideAddContextBalloonPanel'](),this['_showSourceResourcesBalloon']({'source':_0x2a2ccb,'withBackButton':!this['_hasExactlyOneSource']});});}for(const _0x4b9cab of _0xb04ae2['customItems']||[]){const _0x170bb3=this['_createBalloonButton'](_0x48cfeb,{'label':_0x4b9cab['label'],'icon':_0x4b9cab['icon']||_0xfc4b68,'type':'customItem'});_0x3ccf85['content']['add'](_0x170bb3),_0x170bb3['on']('execute',()=>{this['hideAddContextBalloonPanel'](),this['fire']('executeCustomItemCallback',_0x4b9cab);});}this['_hasExactlyOneSource']=0x1===_0x3ccf85['content']['length'],this['_urlInputView']['withBackButton']=!this['_hasExactlyOneSource'];}['_addUrlContent'](_0x275360,_0x368a0b){this['_urlInputView']=new wr(_0x368a0b),this['_urlInputView']['on']('submitUrl',(_0x364ff5,_0x379750)=>{this['_handleUrlSubmit'](_0x379750);}),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});}),_0x275360['content']['add'](this['_urlInputView']);}['_createBalloonButton'](_0x26713c,_0x278419){const _0x14f882='source'===_0x278419['type']?new jr(_0x26713c):new Nt(_0x26713c);return _0x14f882['set']({'label':_0x278419['label'],'icon':_0x278419['icon'],'withText':!0x0,'tooltip':!0x0,'tooltipPosition':'sw','class':Fr}),_0x14f882;}['_setupAllBalloonClickOutsideHandlers'](){this['_setupAddContextBalloonClickOutsideHandler'](),this['_setupUrlBalloonClickOutsideHandler']();}['_setupUrlBalloonClickOutsideHandler'](){zt({'emitter':this['_urlBalloonPanelView'],'contextElements':[this['_urlBalloonPanelView']['element']],'callback':()=>{this['hideUrlBalloonPanel']();},'activator':()=>this['_urlBalloonPanelView']['isVisible']});}['_toggleAddContextBalloon'](_0x3d2adf){const _0x1d9ffb=this['_addContextBalloonConfig'];_0x1d9ffb['buttonView']['isOn']=_0x3d2adf,_0x3d2adf?_0x1d9ffb['balloonView']['show']():_0x1d9ffb['balloonView']['hide']();}['_setupAddContextBalloonClickOutsideHandler'](){const {balloonView:_0x117780,buttonView:_0x793dc,hideMethod:_0x552455}=this['_addContextBalloonConfig'];zt({'emitter':_0x117780,'contextElements':[_0x117780['element'],_0x793dc['element']],'callback':()=>{_0x552455();},'activator':()=>_0x793dc['isOn']&&!this['_urlBalloonPanelView']['isVisible']&&!this['_resourcesBalloonView']['isAnyResourceBalloonVisible']()});}['_createContextButton'](_0x4321dc,_0x366649,_0x34c035=!0x1,_0x3b6a3b=!0x1){const _0x555694='conversation'===_0x366649||!0x0===_0x4321dc['isReadOnly'],_0x3a35c7=new Bn(this['locale'],_0x4321dc,_0x555694,_0x34c035,_0x3b6a3b);return _0x555694||_0x3a35c7['on']('removeContextItemChip',()=>{this['fire']('removeContextItem',_0x3a35c7['id']);}),_0x3a35c7;}['_addContextToCollection'](_0x43104d,_0x3d44a4){_0x3d44a4['add'](_0x43104d,0x0);}['_removeContextFromCollection'](_0x5cd151,_0x3a8a22){const _0x1d5b60=_0x3a8a22['find'](_0x37024a=>_0x37024a['id']===_0x5cd151);_0x1d5b60&&_0x3a8a22['remove'](_0x1d5b60);}['_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'](_0x442a03){this['_urlInputView']['clear'](),this['hideUrlBalloonPanel'](),this['fire']('addUrlToContext',_0x442a03);}}class jr extends Nt{['arrowView'];constructor(_0x1c1b89){super(_0x1c1b89),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 _0xaa1f5=new xt();return _0xaa1f5['content']=_0x108533,_0xaa1f5['extendTemplate']({'attributes':{'class':Kr+'__arrow'}}),_0xaa1f5;}}class Jr extends vt{['_cancelButtonView'];['_loaderView'];constructor(_0x1eb8a6){super(_0x1eb8a6),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 _0x1aafc1=new Nt(this['locale']);return _0x1aafc1['set']({'label':hs(this['locale'],'AI_CHAT_STOP_GENERATING'),'withText':!0x0,'class':ls+'\x20ck-ai-button-stop-generating','icon':_0x327a50}),_0x1aafc1['on']('execute',()=>{this['fire']('abortPromptStream');}),_0x1aafc1;}['_createLoaderView'](){const _0x5aaa0d=new vt(this['locale']);return _0x5aaa0d['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')}]}),_0x5aaa0d;}}class Zr extends vt{['_contextPanelView'];['_promptInputView'];['_promptCapabilitiesView'];['_loaderView'];['_modelUnavailableMessageView'];['_shouldRestorePromptInputFocus'];constructor(_0x43ff70,_0x335a27){super(_0x43ff70),this['_contextPanelView']=this['_createContextPanelView'](_0x43ff70,{'bodyCollection':_0x335a27['bodyCollection'],'searchInputVisibleFrom':_0x335a27['contextResourcesSearchInputVisibleFrom']}),this['_promptInputView']=this['_createPromptInputView'](_0x43ff70),this['_promptCapabilitiesView']=this['_createPromptCapabilitiesView'](_0x43ff70),this['_loaderView']=this['_createLoaderView'](_0x43ff70),this['_modelUnavailableMessageView']=this['_createModelUnavailableMessageView'](_0x43ff70),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 _0x421884=this['bindTemplate'];this['setTemplate']({'tag':'form','attributes':{'class':['ck','ck-ai-chat-controls',_0x421884['if']('isDisabled','ck-ai-chat-controls-disabled')]},'children':[{'tag':'div','attributes':{'class':[_0x421884['if']('isLoading','ck-hidden',_0x3b0d29=>_0x3b0d29||!this['isModelAvailable']),_0x421884['if']('isModelAvailable','ck-hidden',_0x213a05=>!_0x213a05||this['isLoading'])]},'children':[this['_contextPanelView'],this['_promptInputView'],this['_promptCapabilitiesView']]},{'tag':'div','attributes':{'class':[_0x421884['if']('isLoading','ck-hidden',_0x287780=>!_0x287780)]},'children':[this['_loaderView']]},{'tag':'div','attributes':{'class':[_0x421884['if']('isModelAvailable','ck-hidden',_0x326750=>_0x326750)]},'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'](_0x59b15c,_0x319c5e){return new zr(_0x59b15c,_0x319c5e);}['_createPromptInputView'](_0x113e9c){return new hr(_0x113e9c,this['_contextPanelView']['addContextButtonView']);}['_createPromptCapabilitiesView'](_0x40923d){return new Er(_0x40923d);}['_createLoaderView'](_0x98aab3){return new Jr(_0x98aab3);}['_createModelUnavailableMessageView'](_0xfcf663){const _0x40abdf=new to(_0xfcf663);return _0x40abdf['delegate']('startConversation')['to'](this),_0x40abdf;}['_handlePromptInputFocus'](_0x7171a7,_0x43744e,_0x3644f1){_0x3644f1?this['_shouldRestorePromptInputFocus']=!0x0:this['_shouldRestorePromptInputFocus']&&this['_promptInputView']['focus']();}['addContextItem'](_0x3ae233,_0x1ebfd7){this['_contextPanelView']['addContextItem'](_0x3ae233,_0x1ebfd7);}['removeContextItem'](_0x1e98ba){this['_contextPanelView']['removeContextItem'](_0x1e98ba);}['setContextItemLoading'](_0x54abf4,_0x187ae3){this['_contextPanelView']['setContextItemLoading'](_0x54abf4,_0x187ae3);}['setIsUploadInProgress'](_0x2da531){this['_promptInputView']['setIsUploadInProgress'](_0x2da531);}['setConversationContext'](_0x58711f){this['_contextPanelView']['setConversationContext'](_0x58711f);}['clearPendingContextUI'](){this['_contextPanelView']['clearCurrentContextItems']();}['clearConversationContextUI'](){this['_contextPanelView']['clearConversationContextItems']();}['updateResourceState'](_0x334bdb,_0x8ed0d1,_0x891e74){this['_contextPanelView']['updateResourceState'](_0x334bdb,_0x8ed0d1,_0x891e74);}['setWebSearch'](_0x1084d1){this['_promptCapabilitiesView']['setWebSearch'](_0x1084d1);}['setReasoning'](_0x2e647c){this['_promptCapabilitiesView']['setReasoning'](_0x2e647c);}['resetMessageInput'](){this['_promptInputView']['reset']();}['setAddContextOptions'](_0x19fee6){this['_contextPanelView']['setAddContextOptions'](_0x19fee6);}['setInputPlaceholder'](_0x4e3778){this['_promptInputView']['setPlaceholderText'](_0x4e3778);}['setModelList'](_0x95d610,_0x2c6c30){this['_promptCapabilitiesView']['setModelList'](_0x95d610,_0x2c6c30);}['setModel'](_0x3a07ec){_0x3a07ec?(this['isModelAvailable']=!0x0,this['_promptCapabilitiesView']['setModel'](_0x3a07ec)):this['isModelAvailable']=!0x1;}['enableModelSelector'](){this['_promptCapabilitiesView']['enableModelSelector']();}['disableModelSelector'](_0x4de485){this['_promptCapabilitiesView']['disableModelSelector'](_0x4de485);}['populateSourceResourceBalloon'](_0x180899,_0x24492f,_0x1fb154,_0x2333de){this['_contextPanelView']['populateSourceResourceBalloon'](_0x180899,_0x24492f,_0x1fb154,_0x2333de);}['closeSourceResourceBalloon'](_0x51d294){this['_contextPanelView']['closeSourceResourceBalloon'](_0x51d294);}['focusPromptInput'](_0x582413=!0x1){this['_promptInputView']['focus'](_0x582413);}['setPromptInputValue'](_0x2f39cd){this['_promptInputView']['queryView']['fieldView']['reset'](),this['_promptInputView']['queryView']['fieldView']['value']=_0x2f39cd;}}class to extends vt{constructor(_0x5cab97){super(_0x5cab97);const _0x3a06f1=new Nt(_0x5cab97);_0x3a06f1['set']({'label':hs(this['locale'],'AI_CHAT_MODEL_UNAVAILABLE_MESSAGE_BUTTON'),'withText':!0x0,'class':['ck-ai-chat-controls__start-new-chat-button'],'tooltip':''}),_0x3a06f1['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'},_0x3a06f1]}]});}}class eo extends _0xb76395{['resizeButton'];constructor(_0xf80bf,_0x47e94f){super(_0xf80bf,{'label':_0x47e94f['label'],'class':'ck-ai-header\x20'+_0x47e94f['class'],'icon':_0x47e94f['icon']}),this['set']('isMaximized',!0x1),_0x47e94f['content']&&this['children']['add'](_0x47e94f['content']),_0x47e94f['showResizeButton']&&(this['resizeButton']=ds(_0xf80bf,this),this['children']['add'](this['resizeButton']));}}class io extends vt{constructor(_0x1a52d2){super(_0x1a52d2),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-disclaimer']},'children':[{'tag':'p','attributes':{'class':['ck','ck-ai-disclaimer__content']},'children':[{'text':hs(_0x1a52d2,'AI_DISCLAIMER_TEXT')}]}]});}}function so(_0x38299d,_0x353852){const _0x5ba860=new Nt(_0x38299d);return _0x5ba860['set']({'label':hs(_0x38299d,'AI_CHAT_LABEL_NEW_CHAT'),'withText':!0x0,'icon':_0x38e4f9,'class':'ck-ai-chat__start-conversation\x20'+ls}),_0x5ba860['on']('execute',()=>{_0x353852['fire']('startConversation');}),_0x5ba860;}class no extends vt{['chatHeader'];['chatFeed'];['chatControls'];['chatDisclaimer'];['_bodyCollection'];constructor(_0x436094,_0xf9b79b){super(_0x436094),this['_bodyCollection']=new Qt(_0x436094),this['_bodyCollection']['attachToDom']();const _0x50d1c5=so(_0x436094,this);this['chatHeader']=new eo(_0x436094,{'label':hs(_0x436094,'AI_CHAT_HEADING'),'icon':_0xd19f1f,'class':'ck-ai-header_chat','content':_0x50d1c5,'showResizeButton':_0xf9b79b['showResizeButton']}),this['chatHeader']['delegate']('resizeTabs')['to'](this),this['chatFeed']=new rr(_0x436094,this['_bodyCollection']),this['chatFeed']['delegate'](...tn)['to'](this),this['chatControls']=new Zr(_0x436094,{'bodyCollection':this['_bodyCollection'],'contextResourcesSearchInputVisibleFrom':_0xf9b79b['contextResourcesSearchInputVisibleFrom']}),this['chatControls']['delegate'](...tn)['to'](this),this['chatDisclaimer']=new io(_0x436094),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset_all','ck-ai-chat','ck-rounded-corners'],'dir':_0x436094['uiLanguageDirection']},'children':[this['chatHeader'],this['chatFeed'],this['chatControls'],this['chatDisclaimer']]});}['populateSourceResourceBalloon'](_0x30d6f3,_0x3c598d,_0x5cff90,_0x52d584){this['chatControls']['populateSourceResourceBalloon'](_0x30d6f3,_0x3c598d,_0x5cff90,_0x52d584);}['closeSourceResourceBalloon'](_0x43f4ce){this['chatControls']['closeSourceResourceBalloon'](_0x43f4ce);}['destroy'](){this['_bodyCollection']['detachFromDom'](),super['destroy']();}}class ro extends _0x173dbd{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(_0x316f88){super(_0x316f88);const _0x1aae51=this['context']['plugins']['get']('AITabs');this['set']('isBusy',!0x1),this['_promiseQueue']=new Cn(),this['_view']=new no(this['context']['locale'],{'showResizeButton':_0x1aae51['showResizeButton'],'contextResourcesSearchInputVisibleFrom':this['context']['config']['get']('ai.chat.context.searchInputVisibleFrom')}),this['_view']['delegate']('resizeTabs')['to'](_0x1aae51),this['_view']['delegate'](...tn)['to'](this),this['_view']['on']('toggleSuggestionDisplayMode',(_0x173d75,{showDiff:_0x9f30c3})=>{this['showDiff']=_0x9f30c3;}),_0x1aae51['view']['addTab']({'id':'chat','buttonLabel':hs(this['context']['locale'],'AI_CHAT_HEADING'),'buttonIcon':_0xd19f1f,'order':0x0,'content':this['_view']}),this['_view']['chatHeader']['bind']('isMaximized')['to'](_0x1aae51['view'],'isMaximized',_0x151d2e=>_0x151d2e),this['_view']['chatControls']['bind']('isLoading')['to'](this,'isBusy',_0x242368=>_0x242368),this['_view']['chatControls']['setInputPlaceholder'](this['_getInputPlaceholder']()),this['bind']('isModelAvailable')['to'](this['_view']['chatControls'],'isModelAvailable');}['destroy'](){super['destroy'](),this['_titleAnimationInterval']&&clearInterval(this['_titleAnimationInterval']);}['createConversation'](_0x43e962){const _0x131e97=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'](_0x43e962['availableModels'],!this['context']['config']['get']('ai.models.showModelSelector')),this['addFeedItemStaticMessage']({'id':'conversation-start','staticMessage':_0x131e97}),this['fire']('conversationCreated');}async['addFeedItemStaticMessage']({id:_0xcbd1d8,staticMessage:_0x5a1aa4}){return this['_promiseQueue']['enqueue'](async()=>{this['_view']['chatFeed']['addItem']('ai-reply',{'id':_0xcbd1d8,'initialContent':'<p>'+_0x5a1aa4+'</p>'});});}async['addFeedItemUserMessage'](_0x4a51e1){const _0x45f9f6=_0x4a51e1['attributes']?.['displayedPrompt']||_0x4a51e1['userMessage'];return this['_promiseQueue']['enqueue'](async()=>{this['_view']['chatFeed']['addItem']('user-message',{'contextItems':Array['from'](_0x4a51e1['contextItems']['values']()),'initialContent':'<p>'+_0x45f9f6+'</p>','id':_0x4a51e1['id']});});}async['addFeedItemError']({errorMessage:_0x2e99ea,id:_0x2bae33}){return this['_promiseQueue']['enqueue'](async()=>{this['_view']['chatFeed']['addItem']('error-message',{'initialContent':'<p>'+_0x2e99ea+'</p>','id':_0x2bae33});});}async['addFeedItemAIReply'](_0x5570de){return this['_promiseQueue']['enqueue'](async()=>{this['_view']['chatFeed']['addItem']('ai-reply',{'id':_0x5570de['interactionId']+':'+_0x5570de['id']}),this['clearLoadingMessage']();});}async['addFeedItemAISuggestion'](_0x1e300a){const _0x857287=$s(this['context']);let _0x46e16b=_0x857287['config']['get']('ai.availableReplyActions')||[...fn];if(_0x857287['plugins']['has']('TrackChanges')){if(!this['_isTrackChangesCommandValueBound']){this['_isTrackChangesCommandValueBound']=!0x0;const _0x59da81=_0x857287['commands']['get']('trackChanges');this['_view']['chatFeed']['bind']('isTrackChangesOn')['to'](_0x59da81,'value');}}else _0x46e16b=_0x46e16b['filter'](_0x304fa0=>'insertSuggestion'!=_0x304fa0);return this['_promiseQueue']['enqueue'](async()=>{this['_view']['chatFeed']['addItem']('ai-suggestion-reply',{'id':_0x1e300a['interactionId']+':'+_0x1e300a['id'],'areActionsDisabled':_0x1e300a['areActionsDisabled'],'showDiff':this['showDiff'],'availableActions':_0x46e16b}),this['clearLoadingMessage']();});}async['addFeedInteractionHeader'](_0x3bd1e7,_0x848890){return this['_promiseQueue']['enqueue'](async()=>{const _0x12a8a5=this['_view']['chatFeed']['children']['last'];if(_0x12a8a5 instanceof Zn)return this['_view']['chatFeed']['children']['remove'](_0x12a8a5),void this['_view']['chatFeed']['addItem']('interaction-header',{'id':_0x3bd1e7['id'],'capabilities':{'isWebSearchEnabled':_0x12a8a5['capabilities']['isWebSearchEnabled']||_0x848890['isWebSearchEnabled'],'isReasoningEnabled':_0x12a8a5['capabilities']['isReasoningEnabled']||_0x848890['isReasoningEnabled']}});this['_view']['chatFeed']['addItem']('interaction-header',{'id':_0x3bd1e7['id'],'capabilities':_0x848890});});}async['addFeedItemCustomElement'](_0x1eb12f,_0x35ed89){let _0x572f0c;return await this['_promiseQueue']['enqueue'](async()=>{_0x572f0c=this['_view']['chatFeed']['addItem']('custom-element',{'content':_0x1eb12f,'id':_0x35ed89});}),_0x572f0c;}['removeFeedItem'](_0x12bf53){this['_view']['chatFeed']['removeItem'](_0x12bf53);}['hasFeedItem'](_0x1a528e){return this['_view']['chatFeed']['hasItem'](_0x1a528e);}['updateFeedInteractionHeader'](_0x48c55b){const _0x5bbe91=this['_view']['chatFeed']['children']['find'](_0x38fbe5=>_0x38fbe5['options']['id']==_0x48c55b['id']&&_0x38fbe5 instanceof Zn);_0x5bbe91&&_0x5bbe91['set']('isVisible',_0x48c55b['isVisible']);}async['updateFeedItemAIReplyContent'](_0x1ccaca){const _0x4bd3db=_0x1ccaca['renderingStrategy']||this['feedItemRenderingStrategy'];return this['_promiseQueue']['enqueue'](async _0x1999b8=>{await this['_view']['chatFeed']['updateReplyItem']({..._0x1ccaca,'abortSignal':_0x1999b8,'renderingStrategy':_0x4bd3db}),_0x1ccaca['isDone']&&this['markFeedItemAsDone'](_0x1ccaca['id']);});}['updateFeedItemAIReplySources'](_0x2863a9,_0x3cdd0c){this['_view']['chatFeed']['updateWebSources'](_0x2863a9,_0x3cdd0c);}async['updateFeedItemAIReplySuggestionContent'](_0x1c5c78){return this['_promiseQueue']['enqueue'](async _0x2ba377=>{await this['_view']['chatFeed']['updateSuggestionItem']({..._0x1c5c78,'abortSignal':_0x2ba377}),_0x1c5c78['isDone']&&this['markFeedItemAsDone'](_0x1c5c78['id']);});}['updateFeedItemAIReplySuggestionPartState'](_0x3241ac){this['_view']['chatFeed']['updateSuggestionPartState'](_0x3241ac);}['setFeedItemAIReplySuggestionPartActive'](_0x46c032){this['_view']['chatFeed']['setSuggestionPartActive'](_0x46c032);}['markFeedItemAsDone'](_0x38ca0b){this['_view']['chatFeed']['markItemAsDone'](_0x38ca0b);}['removeFeedInteraction'](_0x50a04e){this['_view']['chatFeed']['getItemIds']()['filter'](_0xcfca1=>_0xcfca1['startsWith'](_0x50a04e))['forEach'](_0x1aeb22=>this['_view']['chatFeed']['removeItem'](_0x1aeb22));}['startInteraction'](){const _0x28cfb2=this['prepareLoadingMessage']({'isWebSearchEnabled':!0x1,'isReasoningEnabled':!0x1});this['setLoadingMessage'](_0x28cfb2),this['_view']['chatControls']['disableModelSelector'](!this['context']['config']['get']('ai.models.showModelSelector')),this['isBusy']=!0x0,this['_view']['chatFeed']['startAutoScroll']();}['stopInteraction'](_0x54f176){this['_promiseQueue']['abort'](),this['_view']['chatFeed']['getItemIds']()['filter'](_0x2952ab=>_0x2952ab['startsWith'](_0x54f176['id']))['forEach'](_0x3d6840=>this['markFeedItemAsDone'](_0x3d6840)),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'](_0x5ddd5b,_0x3f66af){this['_view']['chatControls']['addContextItem'](_0x5ddd5b,_0x3f66af);}['removeContextItem'](_0x4a35bd){this['_view']['chatControls']['removeContextItem'](_0x4a35bd);}['setContextItemLoading'](_0x464e74,_0x29e025){this['_view']['chatControls']['setContextItemLoading'](_0x464e74,_0x29e025);}['setIsUploadInProgress'](_0x3eec9a){this['_view']['chatControls']['setIsUploadInProgress'](_0x3eec9a);}['setConversationContext'](_0x8db99a){this['_view']['chatControls']['setConversationContext'](_0x8db99a);}['clearPendingContextUI'](){this['_view']['chatControls']['clearPendingContextUI']();}['clearConversationContextUI'](){this['_view']['chatControls']['clearConversationContextUI']();}['updateResourceState'](_0x5ef4c0,_0x14deff,_0x3addf0){this['_view']['chatControls']['updateResourceState'](_0x5ef4c0,_0x14deff,_0x3addf0);}['resetMessageInput'](){this['_view']['chatControls']['resetMessageInput'](),this['_view']['chatControls']['setInputPlaceholder'](this['_getInputPlaceholder']());}['setAddContextOptions'](_0x508e9b){this['_view']['chatControls']['setAddContextOptions'](_0x508e9b);}['updateCapabilities'](_0x505a7b){this['_view']['chatControls']['setWebSearch'](_0x505a7b['isWebSearchEnabled']),this['_view']['chatControls']['setReasoning'](_0x505a7b['isReasoningEnabled']),this['_view']['chatControls']['setInputPlaceholder'](this['_getInputPlaceholder'](_0x505a7b));}['setSelectedModel'](_0x3aff8a,_0x23b9fb){this['_view']['chatControls']['setModel'](_0x3aff8a),_0x23b9fb&&this['_view']['chatControls']['disableModelSelector'](!0x1);}['setFeedItemRenderingStrategy'](_0x1a4ca9){this['feedItemRenderingStrategy']=_0x1a4ca9;}['toggleLoadingSkeleton'](_0x2b60df){this['_view']['chatFeed']['toggleLoadingSkeleton'](_0x2b60df);}['resetConversationTitle'](){this['setConversationTitle'](hs(this['context']['locale'],'AI_CHAT_HEADING'));}['setConversationTitle'](_0x2cc8a0,_0x184d58=!0x1){if(_0x184d58&&!St()&&_0x2cc8a0['length'])return this['_view']['chatHeader']['label']='',void this['_animateConversationTitle'](_0x2cc8a0);this['_view']['chatHeader']['label']=_0x2cc8a0;}['setLoadingMessage'](_0x8c5e71){this['_view']['chatFeed']['setLoadingMessage'](_0x8c5e71);}['clearLoadingMessage'](){this['_view']['chatFeed']['setLoadingMessage']('');}['_animateConversationTitle'](_0x5d5a7e){let _0x458113=0x0;clearInterval(this['_titleAnimationInterval']),this['_titleAnimationInterval']=setInterval(()=>{this['_view']['chatHeader']['label']=this['_view']['chatHeader']['label']+_0x5d5a7e[_0x458113],_0x458113++,_0x458113===_0x5d5a7e['length']&&clearInterval(this['_titleAnimationInterval']);},0x1e);}['prepareLoadingMessage'](_0x2b6d68){return _0x2b6d68['isWebSearchEnabled']&&_0x2b6d68['isReasoningEnabled']?hs(this['context']['locale'],'AI_CHAT_FEED_LOADING_MESSAGE_WEBSEARCH_REASONING'):_0x2b6d68['isWebSearchEnabled']?hs(this['context']['locale'],'AI_CHAT_FEED_LOADING_MESSAGE_WEBSEARCH'):_0x2b6d68['isReasoningEnabled']?hs(this['context']['locale'],'AI_CHAT_FEED_LOADING_MESSAGE_REASONING'):hs(this['context']['locale'],'AI_CHAT_FEED_LOADING_MESSAGE_REGULAR');}['_getInputPlaceholder'](_0x4a202d){return _0x4a202d?_0x4a202d['isWebSearchEnabled']&&_0x4a202d['isReasoningEnabled']?hs(this['context']['locale'],'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_WEBSEARCH_REASONING'):_0x4a202d['isWebSearchEnabled']?hs(this['context']['locale'],'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_WEBSEARCH'):_0x4a202d['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'](_0x307dc6,_0x24a148,_0x1fb09b,_0x242f28){this['_view']['populateSourceResourceBalloon'](_0x307dc6,_0x24a148,_0x1fb09b,_0x242f28);}['closeSourceResourceBalloon'](_0x24ced5){this['_view']['closeSourceResourceBalloon'](_0x24ced5);}['setPromptInputValue'](_0xa241bb){this['_view']['chatControls']['setPromptInputValue'](_0xa241bb);}['focusPromptInput'](_0xf7e54d=!0x1){this['_view']['chatControls']['focusPromptInput'](_0xf7e54d);}['scrollFeedToSuggestion'](_0x3b2f37,_0x259308){this['_view']['chatFeed']['scrollToSuggestion'](_0x3b2f37,_0x259308);}['startAutoScroll'](_0x127ea0={}){this['_view']['chatFeed']['startAutoScroll'](_0x127ea0);}['disableControls'](){this['_view']['chatControls']['isDisabled']=!0x0;}['enableControls'](){this['_view']['chatControls']['isDisabled']=!0x1;}}class oo extends Dt{['sections'];constructor(_0xbc6562,_0x287237){super(_0xbc6562),this['sections']=_0x287237,this['items']['addMany'](this['sections']),this['extendTemplate']({'attributes':{'class':['ck-ai-chat-history__sections']}});}['filter'](_0x2313ad){let _0xc2265d=0x0,_0x28c742=0x0;for(const _0x199828 of this['sections']){const {resultsCount:_0x4aba39,totalItemsCount:_0xae36ed}=_0x199828['filter'](_0x2313ad);_0xc2265d+=_0x4aba39,_0x28c742+=_0xae36ed;}return{'resultsCount':_0xc2265d,'totalItemsCount':_0x28c742};}}class ao extends Ht{['title'];['itemsViews'];['_itemsListView'];constructor(_0x385377,{title:_0x3416bf,items:_0x14c03a}){super(_0x385377);const _0x5cb5f0=this['bindTemplate'];this['set']('isVisible',!0x0),this['title']=_0x3416bf,this['itemsViews']=_0x14c03a;const _0x2377e2=new vt(_0x385377);_0x2377e2['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-chat-history__section-title']},'children':[this['title']]}),this['_itemsListView']=new Dt(_0x385377),this['_itemsListView']['items']['addMany'](this['itemsViews']),this['setTemplate']({'tag':'li','attributes':{'class':['ck-ai-chat-history__section',_0x5cb5f0['if']('isVisible','ck-hidden',_0x2d6fb5=>!_0x2d6fb5)]},'children':[_0x2377e2,this['_itemsListView']]});}['filter'](_0xdf9c59){const _0x110403=this['itemsViews']['length'];let _0x58c1a9=0x0;for(const _0x2afd60 of this['itemsViews']){if(_0xdf9c59){const _0x4b0501=_0x2afd60['isMatching'](_0xdf9c59);_0x2afd60['isVisible']=!!_0x4b0501,_0x2afd60['highlightText'](_0xdf9c59);}else _0x2afd60['isVisible']=!0x0,_0x2afd60['highlightText'](null);_0x2afd60['isVisible']&&_0x58c1a9++;}return this['isVisible']=_0x58c1a9>0x0,{'resultsCount':_0x58c1a9,'totalItemsCount':_0x110403};}['getItem'](_0x5a99ff){return this['itemsViews']['find'](_0x5e9af3=>_0x5e9af3['id']===_0x5a99ff);}['removeItem'](_0xf3e0a3){const _0x280237=this['itemsViews']['indexOf'](_0xf3e0a3);-0x1!==_0x280237&&(this['itemsViews']['splice'](_0x280237,0x1),this['_itemsListView']['items']['remove'](_0xf3e0a3));}}class ho extends/* #__PURE__ -- @preserve */
|
|
27
|
-
_0x16b97f(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(_0x2b2895,_0x4cec75){super(_0x2b2895);const _0x2f97cd=this['bindTemplate'];this['set']('isEdit',!0x1),this['set']('isVisible',!0x0),this['set']('pinned',!!_0x4cec75['pinned']),this['set']('loadingState',null),this['set']('title',_0x4cec75['title']),this['id']=_0x4cec75['id'];const {createdAt:_0x1ec768,active:_0x29b0b2=!0x1}=_0x4cec75;this['_titleView']=new _0x56ea6b(),this['_titleView']['bind']('text')['to'](this,'title',t=>_0x5aed4a(t||'')),this['_titleView']['extendTemplate']({'attributes':{'class':['ck-ai-chat-history__item-title']}});const _0x4aaa3f=this['_createCheckView'](),_0x3a1bc1=this['_createPinButtonView'](_0x2b2895),_0x1548ae=this['_createMenuDropdownView'](),_0xa1ed35=this['_createEditInputView'](_0x2b2895),_0x4c17e0=this['_createAcceptEditButtonView'](_0x2b2895,_0xa1ed35),_0x39433e=this['_createCancelEditButtonView'](_0x2b2895);this['actions']=this['createCollection'](),this['mainContent']=this['createCollection'](),this['mainContent']['add'](this['_titleView']),this['actions']['add'](_0x3a1bc1),this['actions']['add'](_0x1548ae),this['on']('change:isEdit',(_0xb11969,_0x5177a0,_0x251d31)=>{this['actions']['clear'](),this['mainContent']['clear'](),_0x251d31?(this['actions']['add'](_0x4c17e0),this['actions']['add'](_0x39433e),this['mainContent']['add'](_0xa1ed35),_0xa1ed35['element']['value']=this['title']||'',_0xa1ed35['element']['focus']()):(this['actions']['add'](_0x3a1bc1),this['actions']['add'](_0x1548ae),this['mainContent']['add'](this['_titleView']));}),this['setTemplate']({'tag':'li','attributes':{'class':['ck-ai-chat-history__item',_0x29b0b2?'ck-ai-chat-history__item--active':'',_0x2f97cd['if']('isVisible','ck-hidden',_0x1ad63c=>!_0x1ad63c),_0x2f97cd['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',_0x2f97cd['if']('loadingState','ck-hidden',_0x18a1a1=>!!_0x18a1a1)]},'children':_0x29b0b2?[_0x4aaa3f]:[]},{'tag':'div','attributes':{'class':['ck-ai-loader',_0x2f97cd['if']('loadingState','ck-hidden',_0x486b6d=>!_0x486b6d)]},'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',_0x2f97cd['if']('loadingState','ck-hidden',_0x1e5bdf=>!!_0x1e5bdf)]},'children':this['mainContent']},{'tag':'div','attributes':{'class':['ck-ai-loader__text',_0x2f97cd['if']('loadingState','ck-hidden',_0xabdb66=>!_0xabdb66)]},'children':[{'text':_0x2f97cd['to']('loadingState',_0x479d6a=>_0x479d6a?hs(this['locale'],ho['LOADING_LABELS'][_0x479d6a]):'')}]}]},{'tag':'span','attributes':{'class':['ck-ai-chat-history__item-date']},'children':[_0x1ec768]}]},{'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'](_0x1e5245){this['set']('title',_0x1e5245);}['updateLoadingState'](_0x54eed3,_0x90c0bc){this['set']('loadingState',_0x90c0bc?_0x54eed3:null);}['_createCheckView'](){const _0x29b3ba=new xt();return _0x29b3ba['set']({'content':_0x406d61}),_0x29b3ba;}['_createPinButtonView'](_0x29668b){const _0x4d15ed=new Nt(_0x29668b);return _0x4d15ed['set']({'label':hs(_0x29668b,'AI_CHAT_HISTORY_PIN_BUTTON'),'icon':_0x54fbb0,'withText':!0x1,'tooltip':!0x0}),_0x4d15ed['bind']('isOn')['to'](this,'pinned'),_0x4d15ed['on']('execute',()=>{const _0x558e43=!this['pinned'];this['fire']('setConversationPinned',{'id':this['id'],'pinned':_0x558e43});}),_0x4d15ed;}['_createMenuDropdownView'](){const _0x703b18=Gt(this['locale']),_0x67fe61=_0x703b18['panelView']['children'];_0x703b18['buttonView']['set']({'label':hs(this['locale'],'AI_CHAT_HISTORY_SHOW_MORE_ITEMS'),'icon':_0xb6454c}),_0x703b18['panelPosition']='sw';const _0x25bb71=new Nt(this['locale']);_0x25bb71['label']=hs(this['locale'],'AI_CHAT_HISTORY_EDIT_NAME'),_0x25bb71['withText']=!0x0,_0x25bb71['on']('execute',()=>{this['isEdit']=!0x0;});const _0x167aee=new Nt(this['locale']);_0x167aee['label']=hs(this['locale'],'AI_CHAT_HISTORY_REMOVE'),_0x167aee['withText']=!0x0,_0x167aee['on']('execute',()=>{this['showConfirm'](hs(this['locale'],'AI_CHAT_HISTORY_REMOVE_CONFIRM'),this['element'])['then'](()=>{this['fire']('removeConversation',{'id':this['id']});});});const _0x7c7445=new Dt(this['locale']),_0x85b841=new Ht(this['locale']);_0x85b841['children']['add'](_0x25bb71);const _0x40d659=new Ht(this['locale']);return _0x40d659['children']['add'](_0x167aee),_0x7c7445['items']['addMany']([_0x85b841,_0x40d659]),_0x67fe61['add'](_0x7c7445),_0x703b18;}['_createEditInputView'](_0x3f224f){const _0x187888=new _0x5fd969(_0x3f224f),_0x49a2b4=_0x187888['bindTemplate'];return _0x187888['extendTemplate']({'on':{'keydown':_0x49a2b4['to'](_0x277fb5=>{'Enter'==_0x277fb5['key']&&this['_commitEditInputValue'](_0x187888);})}}),_0x187888;}['_createAcceptEditButtonView'](_0xb02bb2,_0x38aa94){const _0x41a51a=new Nt(_0xb02bb2);return _0x41a51a['set']({'icon':_0x406d61,'withText':!0x1,'tooltip':hs(_0xb02bb2,'AI_CHAT_HISTORY_ACCEPT')}),_0x41a51a['extendTemplate']({'attributes':{'class':['ck-confirm-view-submit']}}),_0x41a51a['on']('execute',()=>{this['_commitEditInputValue'](_0x38aa94);}),_0x41a51a;}['_commitEditInputValue'](_0x177c02){const _0x280f8e=_0x177c02['element']['value']||'';this['isEdit']=!0x1,this['fire']('editConversationTitle',{'id':this['id'],'title':_0x280f8e});}['_createCancelEditButtonView'](_0x228234){const _0x51c373=new Nt(_0x228234);return _0x51c373['set']({'icon':_0x35e3e9,'withText':!0x1,'tooltip':hs(_0x228234,'AI_CHAT_HISTORY_CANCEL')}),_0x51c373['extendTemplate']({'attributes':{'class':['ck-confirm-view-cancel']}}),_0x51c373['on']('execute',()=>{this['isEdit']=!0x1,this['fire']('edit:cancel');}),_0x51c373;}['_createSpinnerView'](){const _0x31c41b=new yn('tiny');return _0x31c41b['isVisible']=!0x0,_0x31c41b;}['isMatching'](_0x58e159){return'string'==typeof this['title']&&this['title']['match'](_0x58e159)?{'title':!0x0}:null;}['highlightText'](_0x4fb02e){this['_titleView']['highlightText'](_0x4fb02e);}}class co extends vt{['headerView'];['searchView'];['mainErrorView'];['skeletonView'];['emptyView'];['sectionsView'];constructor(_0x2196d1,_0x225db8){super(_0x2196d1),this['set']('hasItems',!0x1),this['set']('isLoading',!0x0),this['set']('errorMessage',''),this['set']('isSearchViewVisible',!0x1),this['set']('isEmptyViewVisible',!0x1),this['set']('isMainErrorViewVisible',!0x1);const _0x97f466=so(_0x2196d1,this);this['headerView']=new eo(_0x2196d1,{'label':hs(_0x2196d1,'AI_CHAT_HISTORY_HEADING'),'icon':_0x592da0,'class':'ck-ai-header_history','content':_0x97f466,'showResizeButton':_0x225db8}),this['headerView']['delegate']('resizeTabs')['to'](this),this['sectionsView']=new oo(_0x2196d1,[]),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',_0x181505=>!_0x181505)]}}),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 _0x3122ca=new _0x5bd8a7(this['locale'],{'filteredView':this['sectionsView'],'queryView':{'label':hs(this['locale'],'AI_CHAT_HISTORY_SEARCH_LABEL')},'infoView':{'text':{'notFound':{'primary':_0x5d3bf2=>hs(this['locale'],'AI_CHAT_HISTORY_SEARCH_NOT_FOUND_PRIMARY',_0x5d3bf2),'secondary':hs(this['locale'],'AI_CHAT_HISTORY_SEARCH_NOT_FOUND_SECONDARY')}}}}),_0x4e3d68=this['_createErrorView']();return _0x4e3d68['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('errorMessage','ck-hidden',_0x1e221d=>!_0x1e221d)]}}),_0x3122ca['on']('render',()=>{_0x3122ca['children']['add'](_0x4e3d68,0x1);}),_0x3122ca['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isSearchViewVisible','ck-hidden',_0x1d3455=>!_0x1d3455)]}}),_0x3122ca;}['_createSkeletonView'](){const _0x519ab9=new pn(this['locale'],mn['aiHistory']);return _0x519ab9['bind']('isVisible')['to'](this,'isLoading'),_0x519ab9;}['_createErrorView'](){const _0x57171d=new vt(this['locale']),_0x5a2519=new Nt(this['locale']);_0x5a2519['set']({'withText':!0x1,'icon':_0x35e3e9,'class':'ck-ai-notification_error__dismiss-button'}),_0x5a2519['bind']('isVisible')['to'](this,'hasItems',_0x13d639=>!!_0x13d639),_0x5a2519['on']('execute',()=>{this['errorMessage']='';});const _0x2982cb=this['bindTemplate'];return _0x57171d['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-notification','ck-ai-notification_error']},'children':[{'tag':'p','children':[{'text':_0x2982cb['to']('errorMessage')}]},_0x5a2519]}),_0x57171d;}['_createEmptyStateView'](){const _0x52f09a=new vt(this['locale']);return _0x52f09a['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-chat-history__empty',this['bindTemplate']['if']('isEmptyViewVisible','ck-hidden',_0x1c4f59=>!_0x1c4f59)]},'children':[{'tag':'p','attributes':{'class':['ck-ai-chat-history__empty-message']},'children':[hs(this['locale'],'AI_CHAT_HISTORY_EMPTY_MESSAGE')]}]}),_0x52f09a;}['_createListItemViews'](_0xe8cd89,_0x20dc35){const _0x38164d=[];for(const _0x1caa5e of _0xe8cd89){const _0x138c48=new ho(_0x20dc35,_0x1caa5e);_0x138c48['delegate'](...lo)['to'](this),_0x38164d['push'](_0x138c48);}return _0x38164d;}['updateHistoryItemsWithCategories'](_0x41afdf){const _0x42384e=this['locale']||'en',_0x2df217=[];for(const _0x17dfd6 of _0x41afdf){const _0x24c061=this['_createListItemViews'](_0x17dfd6['items'],_0x42384e);_0x2df217['push'](new ao(_0x42384e,{'title':_0x17dfd6['title'],'items':_0x24c061}));}this['sectionsView']['sections']=_0x2df217,this['sectionsView']['items']['clear'](),this['sectionsView']['items']['addMany'](_0x2df217),this['hasItems']=_0x41afdf['some'](_0x299947=>_0x299947['items']['length']>0x0),this['_refreshSearch']();}['removeHistoryItem'](_0x399f02){for(const _0x8f4e of this['sectionsView']['sections']){const _0x257fa2=_0x8f4e['getItem'](_0x399f02);if(_0x257fa2){if(_0x8f4e['removeItem'](_0x257fa2),0x0===_0x8f4e['itemsViews']['length']){const _0x4cec61=this['sectionsView']['sections']['indexOf'](_0x8f4e);-0x1!==_0x4cec61&&(this['sectionsView']['sections']['splice'](_0x4cec61,0x1),this['sectionsView']['items']['remove'](_0x8f4e));}this['hasItems']=this['sectionsView']['sections']['length']>0x0,this['_refreshSearch']();break;}}}['updateItemTitle'](_0x2f37c6,_0xd13631){for(const _0x2f332 of this['sectionsView']['sections']){const _0x41a17e=_0x2f332['getItem'](_0x2f37c6);if(_0x41a17e){_0x41a17e['updateTitle'](_0xd13631);break;}}}['updateItemLoadingState'](_0x49f650,_0x255962,_0x2146a2){for(const _0x27dc79 of this['sectionsView']['sections']){const _0x43a99f=_0x27dc79['getItem'](_0x49f650);if(_0x43a99f){_0x43a99f['updateLoadingState'](_0x255962,_0x2146a2);break;}}}['_refreshSearch'](){if(this['hasItems']){const _0x48ad09=this['searchView']['queryView']['fieldView']?.['element']?.['value']||'';this['searchView']['search'](_0x48ad09);}}}const lo=['showConversationHistory','removeConversation','editConversationTitle','setConversationPinned','selectConversation','startConversation'];class uo extends _0x173dbd{static get['requires'](){return[os];}['_historyView'];static get['pluginName'](){return'AIChatHistoryUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x2c93a7){super(_0x2c93a7);const _0x329dbd=this['context']['plugins']['get']('AITabs');this['_historyView']=new co(this['context']['locale'],_0x329dbd['showResizeButton']),this['_historyView']['delegate']('resizeTabs')['to'](_0x329dbd),this['_historyView']['delegate'](...lo)['to'](this),this['_historyView']['headerView']['bind']('isMaximized')['to'](_0x329dbd['view'],'isMaximized',_0x37db23=>_0x37db23),_0x329dbd['view']['addTab']({'id':'history','buttonLabel':hs(this['context']['locale'],'AI_CHAT_HISTORY_HEADING'),'buttonIcon':_0x592da0,'order':0x0,'content':this['_historyView']});}['removeHistoryItem'](_0xc5f7f0){this['_historyView']['removeHistoryItem'](_0xc5f7f0);}['updateItems'](_0x43c435){this['_historyView']['updateHistoryItemsWithCategories'](_0x43c435);}['updateItemTitle'](_0x13b04e,_0x24ab7f){this['_historyView']['updateItemTitle'](_0x13b04e,_0x24ab7f);}['updateItemLoadingState'](_0x452ee6,_0x60d75d,_0x395ada){this['_historyView']['updateItemLoadingState'](_0x452ee6,_0x60d75d,_0x395ada);}['setLoadingSkeleton'](_0x40c4c2){this['_historyView']['isLoading']=_0x40c4c2;}['showError'](_0xb0de4a){this['_historyView']['errorMessage']=_0xb0de4a;}['hideError'](){this['_historyView']['errorMessage']='';}}class _o extends ht(){['id'];['createdAt'];constructor({id:_0x3b111c,title:_0x51b2bf,createdAt:_0x494000,updatedAt:_0x357470,pinned:_0x159c76}){super(),this['id']=_0x3b111c,this['createdAt']=new Date(_0x494000),this['set']('title',_0x51b2bf),this['set']('updatedAt',_0x357470?new Date(_0x357470):null),this['set']('pinned',_0x159c76||!0x1);}['updateTitle'](_0xc49d1e){this['set']('title',_0xc49d1e),this['updatedAt']=new Date();}['updatePinned'](_0x4ab6d9){this['set']('pinned',_0x4ab6d9),this['updatedAt']=new Date();}}class go extends Tt(){['items']=[];['connector'];['group'];constructor({connector:_0x48bbed,group:_0x21c2fd}){super(),this['connector']=_0x48bbed,this['group']=_0x21c2fd;}async['init'](){try{const _0x5730f5=this['connector']['fetchConversations'](this['group']),_0x4f29cd=await _0x5730f5['getConversations']();this['loadItems'](_0x4f29cd);}catch(_0x1c32f7){this['fire']('error',{'error':_0x1c32f7,'operation':'init'});}}['addItem'](_0x34c9ec){this['items']['push'](_0x34c9ec);}async['removeItem'](_0x564180){const _0x1ae2e2=this['items']['findIndex'](_0x4349fc=>_0x4349fc['id']===_0x564180);if(-0x1===_0x1ae2e2)return!0x1;try{return await this['connector']['deleteConversation'](_0x564180)['execute'](),this['items']['splice'](_0x1ae2e2,0x1),this['fire']('itemRemoved',{'itemId':_0x564180}),!0x0;}catch(_0x5ed246){return this['fire']('error',{'error':_0x5ed246,'operation':'removeItem','itemId':_0x564180}),!0x1;}}['getItem'](_0x22a4d7){return this['items']['find'](_0x4c4473=>_0x4c4473['id']===_0x22a4d7);}async['updateItemTitle'](_0x5eb29b,_0xd42448){const _0x303f2a=this['getItem'](_0x5eb29b);if(!_0x303f2a)return!0x1;try{return await this['connector']['updateConversation'](_0x5eb29b,{'title':_0xd42448})['getResult'](),_0x303f2a['updateTitle'](_0xd42448),this['fire']('itemUpdated',{'itemId':_0x5eb29b,'updates':{'title':_0xd42448}}),!0x0;}catch(_0x37d3f1){return this['fire']('error',{'error':_0x37d3f1,'operation':'updateItemTitle','itemId':_0x5eb29b}),!0x1;}}async['updateItemPinned'](_0x11841a,_0x1ac777){const _0x32dbdf=this['getItem'](_0x11841a);if(!_0x32dbdf)return!0x1;try{return await this['connector']['updateConversation'](_0x11841a,{'pinned':_0x1ac777})['getResult'](),_0x32dbdf['updatePinned'](_0x1ac777),this['fire']('itemUpdated',{'itemId':_0x11841a,'updates':{'pinned':_0x1ac777}}),!0x0;}catch(_0x53d676){return this['fire']('error',{'error':_0x53d676,'operation':'updateItemPinned','itemId':_0x11841a}),!0x1;}}['loadItems'](_0x1f6303){try{this['items']=[],_0x1f6303['map'](_0x1c6cef=>{this['addItem'](new _o(_0x1c6cef));}),this['fire']('itemsLoaded',{'items':[...this['items']]});}catch(_0x159ed3){this['fire']('error',{'error':_0x159ed3,'operation':'loadItems'});}}['getItems'](_0x4c8420={}){const _0x5a2deb=void 0x0!==_0x4c8420['pinned']&&_0x4c8420['pinned'],_0x4e818c=_0x4c8420['from']?new Date(_0x4c8420['from']['getFullYear'](),_0x4c8420['from']['getMonth'](),_0x4c8420['from']['getDate']()):null,_0x43f9be=_0x4c8420['to']?new Date(_0x4c8420['to']['getFullYear'](),_0x4c8420['to']['getMonth'](),_0x4c8420['to']['getDate']()):null;return this['items']['filter'](_0x5ccd31=>{if(_0x5ccd31['pinned']!==_0x5a2deb)return!0x1;if(_0x43f9be){const _0x57d601=new Date(_0x5ccd31['createdAt']['getFullYear'](),_0x5ccd31['createdAt']['getMonth'](),_0x5ccd31['createdAt']['getDate']());return _0x4e818c?_0x4e818c['getTime']()===_0x43f9be['getTime']()?_0x57d601['getTime']()===_0x4e818c['getTime']():_0x57d601<_0x43f9be&&_0x57d601>=_0x4e818c:_0x57d601<_0x43f9be;}return!0x0;});}}class Ao extends _0x173dbd{['_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 _0x5babdc=this['context']['plugins']['get'](os);try{const _0x442cb9=this['_aiChatController']['getGroupId']();this['history']=new go({'connector':this['_aiConnector'],'group':_0x442cb9}),this['listenTo'](this['_aiChatHistoryUi'],'removeConversation',(_0x255940,_0x14f45d)=>{this['_setItemLoading'](_0x14f45d['id'],'remove'),this['_handleRemove'](_0x14f45d['id']);}),this['listenTo'](this['_aiChatHistoryUi'],'editConversationTitle',(_0x2d0bca,_0x4fe672)=>{this['_setItemLoading'](_0x4fe672['id'],'rename'),this['_handleEditTitle'](_0x4fe672['id'],_0x4fe672['title']);}),this['listenTo'](this['history'],'itemUpdated',(_0x39be18,_0x130199)=>{void 0x0!==_0x130199['updates']['title']&&this['_aiChatHistoryUi']['updateItemTitle'](_0x130199['itemId'],_0x130199['updates']['title']),void 0x0!==_0x130199['updates']['pinned']&&this['_updateHistoryItemsUI'](),this['_clearItemLoading'](_0x130199['itemId']);}),this['listenTo'](this['history'],'itemRemoved',(_0x1fc019,_0x1681c0)=>{this['_aiChatController']['_handleRemovedConversation'](_0x1681c0['itemId']),this['_aiChatHistoryUi']['removeHistoryItem'](_0x1681c0['itemId']),this['_clearItemLoading'](_0x1681c0['itemId']);}),this['listenTo'](this['history'],'itemsLoaded',()=>{this['_updateHistoryItemsUI']();}),this['listenTo'](this['history'],'error',(_0x1d91ef,_0x3d60c4)=>{this['_handleHistoryErrorUI'](_0x3d60c4['error'],_0x3d60c4['operation'],_0x3d60c4['itemId']);}),this['listenTo'](this['_aiChatHistoryUi'],'selectConversation',(_0x211631,_0x17c22c)=>{this['_handleSelectConversation'](_0x17c22c['id']);}),this['listenTo'](this['_aiChatHistoryUi'],'setConversationPinned',(_0x565aa9,_0x150ac8)=>{const _0x43b9b8=_0x150ac8['pinned']?'pin':'unpin';this['_setItemLoading'](_0x150ac8['id'],_0x43b9b8),this['_handleTogglePin'](_0x150ac8['id'],_0x150ac8['pinned']);}),this['listenTo'](this['_aiChatHistoryUi'],'startConversation',()=>{this['_aiChatController']['startConversation'](),_0x5babdc['view']['activateTab']('chat');}),this['listenTo'](this['_aiChatController'],'change:activeConversation',()=>{this['_updateHistoryItemsUI']();}),_0x5babdc['view']['on']('activateTab:history',()=>{this['_showConversationHistory']();});}catch(_0x1ba66a){this['_handleHistoryErrorUI'](_0x1ba66a,'init');}}async['_handleEditTitle'](_0x528a8d,_0x539a2a){await this['history']['updateItemTitle'](_0x528a8d,_0x539a2a);}async['_handleTogglePin'](_0x2965e7,_0x9ccb25){await this['history']['updateItemPinned'](_0x2965e7,_0x9ccb25);}async['_handleRemove'](_0x317462){await this['history']['removeItem'](_0x317462);}async['_handleSelectConversation'](_0x18d16a){await this['_aiChatController']['loadConversation'](_0x18d16a);}async['_showConversationHistory'](){this['_aiChatHistoryUi']['showError'](''),this['_aiChatHistoryUi']['setLoadingSkeleton'](!0x0),await this['history']['init'](),this['_aiChatHistoryUi']['setLoadingSkeleton'](!0x1);}['_updateHistoryItemsUI'](){const _0x1d4faa=this['_aiChatController']['activeConversation']?.['id'],_0x14d5de=this['_getCategorizedItems']()['map'](_0x48c4a9=>({'title':_0x48c4a9['title'],'items':_0x48c4a9['items']['map'](_0x47e229=>({'id':_0x47e229['id'],'title':_0x47e229['title']||hs(this['context']['locale'],'AI_CHAT_UNTITLED_CONVERSATION'),'createdAt':new Date(_0x47e229['createdAt'])['toLocaleDateString'](),'active':_0x47e229['id']===_0x1d4faa,'pinned':_0x47e229['pinned']}))}));this['_aiChatHistoryUi']['updateItems'](_0x14d5de);}['_setItemLoading'](_0x2b5941,_0x8ed10d){this['_aiChatHistoryUi']['updateItemLoadingState'](_0x2b5941,_0x8ed10d,!0x0);}['_clearItemLoading'](_0x22ca88){this['_aiChatHistoryUi']['updateItemLoadingState'](_0x22ca88,null,!0x1);}['_handleHistoryErrorUI'](_0x5adf90,_0x5dc2b2,_0x4ff920){const _0x28a1dc=this['_generateErrorMessage'](_0x5dc2b2,_0x4ff920);this['_aiChatHistoryUi']['showError'](_0x28a1dc),_0x4ff920&&this['_clearItemLoading'](_0x4ff920),this['_aiChatHistoryUi']['setLoadingSkeleton'](!0x1);}['_generateErrorMessage'](_0x3303c3,_0x2c69e7){const _0x343a32=_0x2c69e7?this['history']['getItem'](_0x2c69e7):null,_0x390a26=_0x343a32?.['title']||hs(this['context']['locale'],'AI_CHAT_UNTITLED_CONVERSATION');switch(_0x3303c3){case'updateItemTitle':return hs(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_UPDATE_TITLE',_0x390a26);case'updateItemPinned':{const _0x30dc39=hs(this['context']['locale'],_0x343a32?.['pinned']?'AI_CHAT_HISTORY_UNPIN_ACTION':'AI_CHAT_HISTORY_PIN_ACTION');return hs(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_UPDATE_PINNED',[_0x30dc39,_0x390a26]);}case'removeItem':return hs(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_REMOVE_ITEM',_0x390a26);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 _0x3ce695=new Date(),_0xbf57ae=new Date(_0x3ce695['getFullYear'](),_0x3ce695['getMonth'](),_0x3ce695['getDate']()),_0xa94ec=new Date(_0xbf57ae);_0xa94ec['setDate'](_0xa94ec['getDate']()-0x1);const _0x4ebf52=new Date(_0xbf57ae);_0x4ebf52['setDate'](_0x4ebf52['getDate']()-0xe);const _0x2cd08c=this['history']['getItems']({'pinned':!0x0}),_0x17f632=this['history']['getItems']({'from':_0xbf57ae,'to':_0xbf57ae}),_0x34588c=this['history']['getItems']({'from':_0xa94ec,'to':_0xa94ec}),_0x12dd4c=this['history']['getItems']({'from':_0x4ebf52,'to':_0xa94ec}),_0x26f01d=this['history']['getItems']({'to':_0x4ebf52}),_0x428469=[];return _0x2cd08c['length']>0x0&&_0x428469['push']({'title':hs(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_PINNED'),'items':_0x2cd08c}),_0x17f632['length']>0x0&&_0x428469['push']({'title':hs(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_TODAY'),'items':_0x17f632}),_0x34588c['length']>0x0&&_0x428469['push']({'title':hs(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_YESTERDAY'),'items':_0x34588c}),_0x12dd4c['length']>0x0&&_0x428469['push']({'title':hs(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_LAST_14_DAYS'),'items':_0x12dd4c}),_0x26f01d['length']>0x0&&_0x428469['push']({'title':hs(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_LATER'),'items':_0x26f01d}),_0x428469;}}class Io extends _0x173dbd{static get['requires'](){return[Ao,uo];}static get['pluginName'](){return'AIChatHistory';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}class Eo extends _0x173dbd{static get['requires'](){return[Xs,Js,ro,Io];}static get['pluginName'](){return'AIChat';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x1ee84c){super(_0x1ee84c),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(_0x54fc1b,_0xaa95d9){super(_0x54fc1b);const {id:_0x144dcf,type:_0x26c8a3,icon:_0x347d6f}=_0xaa95d9;this['id']=_0x144dcf,this['set']({'label':_0xaa95d9['label'],'withText':!0x0,'class':'ck-ai-chat-shortcut'}),this['extendTemplate']({'attributes':{'data-cke-ai-shortcut-id':_0xaa95d9['id']}}),_0x347d6f?this['icon']=_0x347d6f:'chat'===_0x26c8a3?this['icon']=_0xd19f1f:'review'===_0x26c8a3?this['icon']=_0x4a5506:'translate'===_0x26c8a3&&(this['icon']=_0x199a24);}}class mo extends vt{['listView'];constructor(_0x48f6e7,_0x40ecbe){super(_0x48f6e7);const _0xb55422=_0x40ecbe['map'](_0x2cac81=>{const _0xc59b77=new Ht(this['locale']),_0x45c6d3=new po(this['locale'],_0x2cac81);return _0xc59b77['children']['add'](_0x45c6d3),_0x45c6d3['delegate']('execute')['to'](this),_0xc59b77;});this['listView']=new Dt(this['locale']),this['listView']['items']['addMany'](_0xb55422),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat-shortcuts']},'children':[this['listView']]});}}const To='chat-shortcuts';class Co extends _0x173dbd{['_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 _0x3af124=this['context']['plugins']['get']('AIChatController');this['_shortcuts']['length']&&(this['_validateShortcuts'](),this['_aiChatUI']['on']('conversationCreated',()=>{_0x3af124['activeConversation']['isFromHistory']||this['_injectShortcuts']();}),this['listenTo'](_0x3af124,'interactionStarted',()=>{this['_removeShortcuts']();}));}['_validateShortcuts'](){const _0x2cbf91=['chat','review','translate'];this['_shortcuts']['forEach'](_0x4db9eb=>{let _0x377df2=!0x0;if(_0x4db9eb['id']&&_0x4db9eb['label']&&_0x2cbf91['includes'](_0x4db9eb['type'])?'chat'===_0x4db9eb['type']&&(_0x377df2='string'==typeof _0x4db9eb['prompt']):_0x377df2=!0x1,!_0x377df2)throw new at('ai-chat-shortcuts-invalid-config',this['context'],{'shortcut':_0x4db9eb});});}['_injectShortcuts'](){const _0x3647a5=this['context']['plugins']['get'](ro);this['_shortcutsView']=new mo(this['context']['locale'],this['_shortcuts']),this['_shortcutsView']['render'](),_0x3647a5['addFeedItemCustomElement'](this['_shortcutsView']['element'],To),this['_shortcutsView']['on']('execute',_0x2153a0=>{const _0x46b32e=_0x2153a0['source']['id'];this['_executeShortcut'](_0x46b32e);});}['_removeShortcuts'](){const _0x1c6fee=this['context']['plugins']['get'](ro);_0x1c6fee['hasFeedItem'](To)&&_0x1c6fee['removeFeedItem'](To),this['_shortcutsView']?.['destroy']();}['_executeShortcut'](_0x3c7e36){const _0x27a50a=this['_shortcuts']['find'](_0x4999d9=>_0x4999d9['id']===_0x3c7e36),_0x810c75=_0x27a50a['type'];'chat'===_0x810c75?this['_runChatShortcut'](_0x27a50a):'review'===_0x810c75?_0x27a50a['commandId']?this['_runReviewShortcut'](_0x27a50a):this['_switchTab']('reviewMode'):'translate'===_0x810c75&&(_0x27a50a['language']?this['_runTranslateShortcut'](_0x27a50a):this['_switchTab']('translate'));}['_switchTab'](_0x2a1193){if(!this['context']['plugins']['has']('AITabs'))throw new at('ai-chat-shortcuts-ai-tabs-not-found',this['context'],{'tabName':_0x2a1193});this['context']['plugins']['get']('AITabs')['view']['activateTab'](_0x2a1193);}async['_runChatShortcut']({prompt:_0x230847,draftMode:_0x5e06c0,useWebSearch:_0x5c87c1=!0x1,useReasoning:_0x4e36c7=!0x1,model:_0x3388a1}){const _0x14cbff=this['context']['plugins']['get']('AIChatController'),_0x4121ee=_0x14cbff['activeConversation'];let _0x31db7e;_0x31db7e=_0x3388a1?await _0x4121ee['chatModels']['getModel'](_0x3388a1):await _0x4121ee['chatModels']['getDefault'](),_0x31db7e&&await _0x4121ee['setModel'](_0x31db7e),_0x4121ee['setWebSearch'](_0x5c87c1),_0x4121ee['setReasoning'](_0x4e36c7),_0x14cbff['addCurrentDocumentToChatContext'](),_0x5e06c0?(this['_aiChatUI']['setPromptInputValue'](_0x230847),this['_aiChatUI']['focusPromptInput'](!0x0)):_0x14cbff['sendMessage']({'message':_0x230847});}['_runReviewShortcut']({commandId:_0xc1a237,model:_0x19f7c4,prompt:_0x5bbf9f,params:_0x319992}){if(!this['context']['plugins']['has']('AIReviewModeUI'))throw new at('ai-chat-shortcuts-review-mode-not-found',this['context']);this['_switchTab']('reviewMode');const _0x285df7={'id':_0xc1a237,'isCustom':'custom'===_0xc1a237};_0x19f7c4&&_0x5bbf9f&&(_0x285df7['args']={'model':_0x19f7c4,'prompt':_0x5bbf9f}),_0x319992&&(_0x285df7['params']=_0x319992),this['context']['plugins']['get']('AIReviewModeUI')['fire']('runReviewCheck',_0x285df7);}['_runTranslateShortcut']({language:_0x331337}){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':_0x331337,'args':{'language':_0x331337}});}}class wo extends _0x131d8d{constructor(_0x816391){super(_0x816391);const _0x28c1ab=_0x816391['plugins']['get']('AITabs')['view'];this['bind']('value')['to'](_0x28c1ab,'isVisible'),this['isEnabled']=!0x0;}['execute'](){const _0x24e354=this['editor']['plugins']['get']('AITabs')['view'];_0x24e354['isVisible']=!_0x24e354['isVisible'];}}class fo extends _0x5e248a{static get['requires'](){return[os];}static get['pluginName'](){return'AIToggleButtonUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const _0x1b59e6=this['editor'];_0x1b59e6['commands']['add']('toggleAi',new wo(_0x1b59e6)),_0x1b59e6['ui']['componentFactory']['add']('toggleAi',()=>{const _0x25ee2b=this['_createAIUIButton'](Nt);return _0x25ee2b['set']({'tooltip':!0x0,'class':'ck-ai-toggle-button'}),_0x25ee2b;}),_0x1b59e6['ui']['componentFactory']['add']('menuBar:toggleAi',()=>{const _0x5c007d=this['_createAIUIButton'](Wt);return _0x5c007d['set']({'role':'menuitemcheckbox'}),_0x5c007d;});}['_createAIUIButton'](_0x47373e){const _0x2a6e8c=this['editor'],_0x40b850=_0x2a6e8c['commands']['get']('toggleAi'),_0x487cc5=new _0x47373e(_0x2a6e8c['locale']);return _0x487cc5['set']({'label':hs(_0x2a6e8c['locale'],'AI_TOGGLE_BUTTON_LABEL'),'icon':_0x45afa0,'isToggleable':!0x0}),_0x487cc5['bind']('isEnabled')['to'](_0x40b850),_0x487cc5['bind']('isOn')['to'](_0x40b850,'value',_0x255fcc=>!!_0x255fcc),this['listenTo'](_0x487cc5,'execute',()=>{_0x40b850['execute']();}),_0x487cc5;}}const bo=['applySuggestion','insertSuggestion','showNext','showPrevious'];class So extends vt{['_errorView'];constructor(_0x36b35a){super(_0x36b35a),this['set']('_errorMessage',''),this['set']('_isErrorVisible',!0x1);}['showBlockingError'](_0x5c4295){this['showError'](_0x5c4295);}['showError'](_0x4b6aad){this['_errorView']||(this['_errorView']=this['_createErrorView']()),this['_errorMessage']=_0x4b6aad,this['_isErrorVisible']=!0x0;}['hideError'](){this['_isErrorVisible']=!0x1;}['_createErrorView'](){const _0x1e3773=new vt(this['locale']),_0x3d1513=new vt(this['locale']);return _0x3d1513['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai-suggestion__error-text']},'children':[{'text':this['bindTemplate']['to']('_errorMessage')}]}),_0x1e3773['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__error','ck-ai-balloon-error',this['bindTemplate']['if']('_isErrorVisible','ck-hidden',_0x2db92d=>!_0x2db92d)]},'children':[_0x3d1513]}),_0x1e3773;}}const Ro=0xa;class Oo extends _0x173dbd{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'](_0x4aff70){const {id:_0x420cd0}=this['_currentConfig']??{};this['_currentConfig']=_0x4aff70;const {id:_0x34bca3}=this['_currentConfig'];this['isOpen']&&_0x420cd0===_0x34bca3?this['_updateDialog']():this['_showDialog']();}['close'](){const _0x432f05=this['_getTargetEditor']()['plugins']['get']('Dialog');_0x432f05['isOpen']&&this['_currentConfig']&&_0x432f05['id']===this['_currentConfig']['id']&&_0x432f05['hide']();}['_updateDialog'](){const _0x5956d7=this['_getTargetEditor']()['plugins']['get']('Dialog'),{icon:_0x3a6348,title:_0x529482}=this['_currentConfig'];_0x5956d7['view']?.['headerView']&&(_0x5956d7['view']['headerView']['label']=_0x529482,_0x5956d7['view']['headerView']['iconView']&&_0x3a6348&&(_0x5956d7['view']['headerView']['iconView']['content']=_0x3a6348)),this['_isUpdatingMarkers']=!0x0,this['_showFakeVisualSelection'](),this['_isUpdatingMarkers']=!0x1,_0x5956d7['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 _0x2ca20c=this['_getTargetEditor']()['plugins']['get']('Dialog'),{id:_0x50d952,title:_0x1d34f9,icon:_0x279e0d,class:_0x37117f,mainView:_0x534872}=this['_currentConfig'];_0x534872['delegate'](...bo)['to'](this),_0x2ca20c['show']({'title':_0x1d34f9,'icon':_0x279e0d,'hasCloseButton':!0x0,'id':_0x50d952,'position':this['_calculateDialogPosition']['bind'](this),'className':'ck-ai-balloon\x20'+(_0x37117f||''),'content':_0x534872,'onShow':_0x2cf8b9=>{this['_showFakeVisualSelection'](),this['_setupFakeVisualSelectionMarkerRemovalListener'](),_0x2cf8b9['view']?.['updatePosition']();const _0x545e1e=this['_getSelectionElements']();_0x545e1e&&_0x545e1e[0x0]&&Ct({'target':_0x545e1e[0x0],'ancestorOffset':0x14,'alignToTop':!0x0,'viewportOffset':{'top':0x14,'bottom':0x14,'left':0x0,'right':0x0}}),this['isOpen']=!0x0,_0x2cf8b9['once']('hide',()=>{this['fire']('beforeDialogClosed',{'id':_0x50d952});},{'priority':'high'});},'onHide':()=>{this['_hideFakeVisualSelection'](),this['_cleanupFakeVisualSelectionMarkerRemovalListener'](),this['fire']('dialogClosed',{'id':_0x50d952}),this['isOpen']=!0x1;}});}['_calculateDialogPosition'](_0xe9d3d0,_0x4bb2bf){if(!_0x4bb2bf){const _0x4d6243=this['_getTargetRootDomRect']();if(!_0x4d6243)return null;_0x4bb2bf=_0x4d6243;}const _0x2b3175=this['_getSelectionElements']();if(!_0x2b3175||0x0===_0x2b3175['length'])return{'left':Math['round'](_0x4bb2bf['left']+_0x4bb2bf['width']/0x2-_0xe9d3d0['width']/0x2),'top':Math['round'](_0x4bb2bf['top']+_0x4bb2bf['height']/0x2-_0xe9d3d0['height']/0x2)};const _0x51209b=Math['round'](_0x4bb2bf['left']+_0x4bb2bf['width']/0x2-_0xe9d3d0['width']/0x2),_0x1f9efd=_0x2b3175['map'](_0x492a38=>new ut(_0x492a38)),_0x1b9eed=_0xe9d3d0['height'];return{'left':_0x51209b,'top':this['_calculateOptimalTopPosition'](_0x1f9efd,_0x1b9eed,_0x4bb2bf)};}['_calculateOptimalTopPosition'](_0x538824,_0x459bd0,_0x400c0b){const _0x595b99=new ut(ct['window']),_0x3e518f=_0x538824['map'](_0x489214=>_0x489214['getVisible']())['filter'](_0x279ead=>_0x279ead),_0x366789=ut['getBoundingRect'](_0x3e518f);if(!_0x366789)return Math['round'](_0x400c0b['top']+_0x400c0b['height']/0x2);const _0x39ebc4=_0x595b99['getIntersection'](_0x366789);if(!_0x39ebc4)return Math['round'](_0x400c0b['top']+_0x400c0b['height']/0x2);const _0xc52340=_0x400c0b['getVisible'](),_0x2aaffe=_0xc52340&&_0x366789['height']>_0xc52340['height'],_0x561de8=_0x39ebc4['top'],_0x58369d=_0x39ebc4['bottom'];if(_0x2aaffe){const _0xf281eb=(_0xc52340||_0x595b99)['height']/0x2-_0x459bd0/0x2,_0x4b049b=_0x561de8-Ro-_0x400c0b['top'],_0x381b1f=_0x400c0b['bottom']-_0x58369d-Ro;return _0x4b049b>=_0x459bd0?Math['max'](Ro,_0x561de8-_0x459bd0-Ro):_0x381b1f>=_0x459bd0?_0x58369d+Ro:Math['max'](Ro,_0xf281eb);}const _0x43a1c9=_0x561de8-_0x459bd0,_0x16ecb4=_0x400c0b['bottom']-_0x58369d-Ro,_0x13332e=_0x561de8-Ro-_0x400c0b['top'];let _0x39ed9d;if(_0x16ecb4>=_0x459bd0)_0x39ed9d=_0x58369d+Ro;else{if(_0x13332e>=_0x459bd0)_0x39ed9d=_0x43a1c9-Ro;else _0x39ed9d=_0x561de8+_0x366789['height']/0x2-_0x459bd0/0x2;}return _0x39ed9d;}['_setupFakeVisualSelectionMarkerRemovalListener'](){const _0x3aab63=this['_getTargetEditor']();this['listenTo'](_0x3aab63['model']['document'],'change',()=>{if(!this['_isUpdatingMarkers']){for(const {name:_0x27857e,data:{newRange:_0x649d42}}of _0x3aab63['model']['document']['differ']['getChangedMarkers']())if(_0x27857e['startsWith'](zs+':')&&(_0x649d42&&(_0x649d42['start']['isEqual'](_0x649d42['end'])||'$graveyard'==_0x649d42['root']['rootName'])||null==_0x649d42)){const _0x4b8500=hs(this['context']['locale'],'AI_BALLOON_SELECTION_REMOVED_ERROR');this['_currentConfig']['mainView']['showBlockingError'](_0x4b8500),this['fire']('selectionRemoved');}}});}['_cleanupFakeVisualSelectionMarkerRemovalListener'](){const _0x19e5fa=this['_getTargetEditor']();this['_currentConfig']['mainView']['hideError'](),this['stopListening'](_0x19e5fa['model']['document']);}['_getSelectionElements'](){const _0x39d791=this['_getTargetEditor']();return _0x4f33d6(_0x39d791['editing'],[..._0x39d791['model']['markers']['getMarkersGroup']('ai-selection'),..._0x39d791['model']['markers']['getMarkersGroup']('ai-balloon-selection')]);}['_getTargetRootDomRect'](){const _0x482cb4=this['_currentConfig']?.['ranges']?.[0x0]?.['root'];if(!_0x482cb4)return null;const _0x36d8b5=this['_getTargetEditor'](),_0x161d1a=_0x36d8b5['editing']['view']['document']['getRoot'](_0x482cb4['rootName']);if(!_0x161d1a)return null;const _0x153926=_0x36d8b5['editing']['view']['domConverter']['mapViewToDom'](_0x161d1a);return _0x153926&&_0x153926 instanceof HTMLElement?new ut(_0x153926):null;}}class ko extends kt{['copyButton'];['likeButton'];['dislikeButton'];['showChangesButton'];['_config'];constructor(_0x5bb993,_0x366252={}){super(_0x5bb993),this['set']('isEnabled',!0x0),this['set']('isShowChangesOn',!0x1),this['_config']={'showCopy':!0x1,'showLike':!0x1,'showDislike':!0x1,..._0x366252};const _0x1c2580=!(this['_config']['showCopy']||this['_config']['showChanges']||this['_config']['showLike']||this['_config']['showDislike']||this['_config']['customView']?.['length']);this['class']=_0x1c2580?'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'](_0x4b555d){this['showChangesButton']['isEnabled']=_0x4b555d;}['_setupRatingButtons'](){this['likeButton']=new Nt(this['locale']),this['likeButton']['set']({'icon':_0x46c214,'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':_0x2c1fe4,'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':_0x47d488,'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 _0x10068d=new xt();_0x10068d['set']({'content':_0x406d61}),_0x10068d['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'](_0x10068d);}['_setupShowChangesButton'](){this['showChangesButton']=new Nt(this['locale']),this['showChangesButton']['set']({'icon':_0x1ebf6f,'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',_0x40eb4c=>_0x40eb4c?_0x577354:_0x1ebf6f),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(_0x39a660,_0x1d986b){super(_0x39a660);const _0x168330=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']=_0x1d986b,this['nextButtonView']=this['_createNextButtonView'](),this['previousButtonView']=this['_createPreviousButtonView'](),this['_streamableContentView']=new In(_0x39a660),this['_partToolbarView']=new _n(_0x39a660,_0x1d986b['availableActions']),this['_partToolbarView']['delegate']('applySuggestion','insertSuggestion','rejectSuggestion')['to'](this),this['_togglePartToolbarButtonsVisibility'](_0x1d986b),this['_stateView']=new un(_0x39a660),this['_stateView']['isVisible']=!0x1,this['_miniToolbarView']=new ko(_0x39a660,{'showChanges':'full'}),this['_miniToolbarView']['bind']('isShowChangesOn')['to'](this,'showDiff'),this['_miniToolbarView']['on']('toggleShowChanges',()=>{this['fire']('toggleSuggestionDisplayMode');}),this['_toolbarContainerView']=new vo(_0x39a660,[this['_partToolbarView'],this['_stateView'],this['_miniToolbarView']]),this['children']=this['createCollection']([this['_streamableContentView'],this['_toolbarContainerView']]),this['on']('change:_state',(_0x10d082,_0x5bb5ee,_0x20fe9f,_0x113d96)=>{let _0x104472,_0x3f7923;'pending'===_0x113d96?(_0x104472=this['_partToolbarView'],_0x3f7923=this['_stateView']):(_0x104472=this['_stateView'],_0x3f7923=this['_partToolbarView']),this['_stateView']['setState'](_0x20fe9f),_0x104472['isVisible']=!0x1,_0x3f7923['isVisible']=!0x0;}),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat-balloon-main',_0x168330['to']('_state',_0x254c66=>'ck-ai-chat-balloon-main_state_'+_0x254c66)]},'children':this['children']}),this['on']('change:isTrackChangesOn',()=>{this['_togglePartToolbarButtonsVisibility'](_0x1d986b);});}['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'](_0x5ad794){_0x5ad794?.['keepErrors']||this['hideError'](),await this['_streamableContentView']['update'](_0x5ad794);}['setState'](_0x27c891){this['_state']=_0x27c891;}['showError'](_0x51994d){super['showError'](_0x51994d),this['children']['has'](this['_errorView'])||this['children']['add'](this['_errorView'],0x0);}['hideError'](){this['_isErrorVisible']&&(super['hideError'](),this['togglePartToolbarEnabled'](!0x0));}['showBlockingError'](_0x2ef274){super['showBlockingError'](_0x2ef274),this['togglePartToolbarEnabled'](!0x1);}['toggleRotatorButtonsVisibility'](_0x69fab2){this['nextButtonView']['isVisible']=this['previousButtonView']['isVisible']=_0x69fab2;}['togglePartToolbarEnabled'](_0x5bed97){this['_partToolbarView']['isEnabled']=_0x5bed97;}['_togglePartToolbarButtonsVisibility']({showApplyButton:_0x30737b,showSuggestButton:_0x3fe233}){_0x30737b=_0x30737b&&!this['isTrackChangesOn']&&this['_config']['availableActions']['includes']('applySuggestion'),_0x3fe233=_0x3fe233&&this['_config']['availableActions']['includes']('insertSuggestion'),this['_partToolbarView']['setButtonsVisibility']({'showApplyButton':_0x30737b,'showSuggestButton':_0x3fe233});}['_createNextButtonView'](){const _0x140b5f=new Nt(this['locale']);return _0x140b5f['set']({'icon':_0x361d40,'label':hs(this['locale'],'AI_BALLOON_NEXT_LABEL'),'isVisible':!0x0}),_0x140b5f['on']('execute',()=>{this['fire']('showNext');}),_0x140b5f;}['_createPreviousButtonView'](){const _0x38d471=new Nt(this['locale']);return _0x38d471['set']({'icon':_0x39b878,'label':hs(this['locale'],'AI_BALLOON_PREVIOUS_LABEL'),'isVisible':!0x0}),_0x38d471['on']('execute',()=>{this['fire']('showPrevious');}),_0x38d471;}}class vo extends vt{constructor(_0x4872b1,_0x1b175){super(_0x4872b1),this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-chat-balloon__toolbar-container']},'children':_0x1b175});}}class yo extends _0x5e248a{static get['requires'](){return[Bt,Oo];}static get['pluginName'](){return'AIChatBalloon';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['_chatBalloonView'];constructor(_0x28241b){super(_0x28241b),this['set']('showDiff',!0x1);}['open'](_0x415e01){const _0x535759=this['editor'];this['_chatBalloonView']||(this['_chatBalloonView']=this['_createChatBalloonView']()),_0x535759['plugins']['get']('AIBalloon')['open']({..._0x415e01,'id':'aiChatBalloon','class':'ck-ai-chat-balloon','mainView':this['_chatBalloonView']}),this['_toggleRotatorButtonsInDialogHeader'](_0x415e01['showRotator']),this['_chatBalloonView']['togglePartToolbarEnabled'](!_0x415e01['areActionsDisabled']),this['_restoreDefaultViewFocus']();}['close'](){this['editor']['plugins']['get']('AIBalloon')['close']();}['updateContent'](_0x447733){return this['_chatBalloonView']||(this['_chatBalloonView']=this['_createChatBalloonView']()),this['_chatBalloonView']['updateContent'](_0x447733);}['setState'](_0x51147e){this['_chatBalloonView']&&this['_chatBalloonView']['setState'](_0x51147e);}['_createChatBalloonView'](){const _0x2500e6=this['editor'],_0x170ffd=_0x2500e6['plugins']['get']('AIBalloon'),_0x3d4198=_0x2500e6['commands']['get']('trackChanges');let _0x3836eb=_0x2500e6['config']['get']('ai.availableReplyActions')||[...fn];_0x2500e6['plugins']['has']('TrackChanges')||(_0x3836eb=_0x3836eb['filter'](_0x562e9e=>'insertSuggestion'!=_0x562e9e));const _0x4cab32=new No(_0x2500e6['locale'],{'availableActions':_0x3836eb,'showApplyButton':!0x0,'showSuggestButton':!!_0x3d4198});return _0x4cab32['bind']('showDiff')['to'](this),_0x4cab32['delegate'](...Zs)['to'](this),_0x4cab32['delegate']('showPrevious','showNext')['to'](this),_0x170ffd['delegate']('dialogClosed')['to'](this),_0x4cab32['on']('applySuggestion',this['_restoreDefaultViewFocus']['bind'](this)),_0x4cab32['on']('insertSuggestion',this['_restoreDefaultViewFocus']['bind'](this)),_0x4cab32['on']('rejectSuggestion',this['_restoreDefaultViewFocus']['bind'](this)),_0x3d4198&&_0x4cab32['bind']('isTrackChangesOn')['to'](_0x3d4198,'value'),_0x4cab32['render'](),_0x4cab32;}['_toggleRotatorButtonsInDialogHeader'](_0x32e3ef){const _0x13b38e=this['editor'],_0x249f1b=_0x13b38e['plugins']['get']('Dialog')['view']['headerView']['children'];this['_chatBalloonView']['toggleRotatorButtonsVisibility'](_0x32e3ef),_0x249f1b['has'](this['_chatBalloonView']['previousButtonView'])||(_0x249f1b['addMany']([this['_chatBalloonView']['previousButtonView'],this['_chatBalloonView']['nextButtonView']],0x0),_0x13b38e['plugins']['get']('AIBalloon')['once']('beforeDialogClosed',()=>{_0x249f1b['remove'](this['_chatBalloonView']['previousButtonView']),_0x249f1b['remove'](this['_chatBalloonView']['nextButtonView']);}));}['_restoreDefaultViewFocus'](){this['_chatBalloonView']['focus']();}}class xo extends _0x5e248a{static get['requires'](){return[fo,yo,_0x407819];}static get['pluginName'](){return'AIEditorIntegration';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}function Lo(_0x38c442){const {editor:_0x2d772f,action:_0x4c1e97,withText:_0x3be84d=!0x1,withIcon:_0xb498e9=!0x0,isInDropdown:_0x3cdae0=!0x0,shouldPreventFocus:_0xd9e47a=!0x1}=_0x38c442;return()=>{const _0x93068c=_0x2d772f['locale'],_0xb8ec2=new Nt(_0x93068c),_0x4dd9e1=_0xb8ec2['bindTemplate'];_0x3cdae0&&_0xb8ec2['extendTemplate']({'on':{'mouseenter':_0x4dd9e1['to'](()=>{_0xd9e47a&&_0xd9e47a()||_0xb8ec2['focus']();})}});const _0x2fa832=_0x4c1e97['icon']??_0x4c1e97['parent']?.['icon'];return _0xb8ec2['set']({'label':_0x4c1e97['label'],'withText':_0x3be84d,'role':'menuitem','icon':_0xb498e9?_0x2fa832??_0x272647:void 0x0,'tooltip':!_0x3be84d,'class':'ck-ai-quick-actions-button','isEnabled':_0x4c1e97['isEnabled']}),_0xb8ec2['on']('execute',()=>{_0x2d772f['editing']['view']['focus'](),_0x2d772f['commands']['execute']('aiQuickAction',_0x4c1e97);}),_0xb8ec2;};}class Do extends _0x4eb138{['arrowView'];constructor(_0x4b5732,_0x2d67e9){super(_0x4b5732,_0x2d67e9);const _0xe9e660=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',_0x4034d0=>String(_0x4034d0)),'data-cke-tooltip-disabled':_0xe9e660['to']('isOn')},'on':{'mouseenter':_0xe9e660['to']('mouseenter')}});}['render'](){super['render'](),this['children']['add'](this['arrowView']);}['_createArrowView'](){const _0x4b16cc=new xt();return _0x4b16cc['content']=_0x108533,_0x4b16cc['extendTemplate']({'attributes':{'class':'ck-dropdown-menu-list__nested-menu__button__arrow'}}),_0x4b16cc;}}class Po extends Dt{['_allListItems'];['_allSearchableItems'];constructor(_0x368554,_0x335543,_0xd3c3de){super(_0x368554),this['_allListItems']=_0x335543,this['_allSearchableItems']=_0xd3c3de;}['filter'](_0x1555df){if(!_0x1555df)return this['items']['clear'](),this['items']['addMany'](this['_allListItems']),this['_clearHighlight'](),{'resultsCount':this['_allListItems']['length'],'totalItemsCount':this['_allListItems']['length']};const _0x4d7e3d=_0x1555df['source']['toLowerCase']()['trim'](),_0x114f68=this['_allSearchableItems']['filter'](_0x2a71c2=>(_0x2a71c2['groupLabel']?_0x2a71c2['label']+'\x20('+_0x2a71c2['groupLabel']+')':_0x2a71c2['label'])['toLowerCase']()['includes'](_0x4d7e3d));return this['items']['clear'](),this['items']['addMany'](_0x114f68['sort']((_0x17290f,_0x367d3c)=>{const _0x201116=_0x17290f['groupLabel'],_0x5d4c2b=_0x367d3c['groupLabel'];return _0x201116||_0x5d4c2b?_0x201116?0x1:-0x1:0x0;})['map'](_0x38b6ae=>_0x38b6ae['item'])),this['_highlightQuery'](_0x4d7e3d,_0x114f68),{'resultsCount':_0x114f68['length'],'totalItemsCount':this['_allSearchableItems']['length']};}['_highlightQuery'](_0x19f595,_0x3dcb1f){if(!_0x19f595)return;const _0x739605=new RegExp(_0x5607f9(_0x19f595),'gi');_0x3dcb1f['forEach'](_0x508b81=>{_0x508b81['highlightViews']&&_0x508b81['highlightViews']['forEach'](_0x303608=>{'function'==typeof _0x303608['highlightText']&&_0x303608['highlightText'](_0x739605);});});}['_clearHighlight'](){this['_allSearchableItems']['forEach'](_0x89e25d=>{_0x89e25d['highlightViews']&&_0x89e25d['highlightViews']['forEach'](_0x5a5cd7=>{'function'==typeof _0x5a5cd7['highlightText']&&_0x5a5cd7['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(_0x1b192b,_0x44235d,_0x534061,_0xe9538e,_0x2cd40a=!0x1){const _0x6d88b=_0x1b192b['locale'];super(_0x6d88b),this['_bodyCollection']=_0xe9538e,this['_hasSearch']=_0x2cd40a;const _0x269dcf=this['_createListItems'](_0x1b192b,_0x44235d,_0x534061);this['optionsListView']=new Po(_0x6d88b,_0x269dcf,this['_allSearchableItems']),this['optionsListView']['role']=Ho,this['optionsListView']['items']['addMany'](_0x269dcf),this['focusTracker']=new _t(),this['keystrokes']=new gt(),_0x2cd40a&&(this['_searchTextView']=this['_createSearchTextView']()),this['_focusables']=_0x269dcf,this['focusCycler']=new Ut({'focusables':this['_focusables'],'focusTracker':this['focusTracker'],'keystrokeHandler':this['keystrokes']}),_0x2cd40a&&this['_searchTextView']&&this['focusCycler']['chain'](this['_searchTextView']['focusCycler']);const _0xe34fdf=_0x2cd40a&&this['_searchTextView']?[this['_searchTextView']]:[this['optionsListView']];this['children']=new _0x23af51(_0xe34fdf),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset_all','ck-ai-quick-actions','ck-rounded-corners'],'dir':_0x6d88b['uiLanguageDirection']},'children':this['children']});}['_createSearchTextView'](){return new _0x5bd8a7(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 _0x336ea4=this['_searchTextView']['queryView']['fieldView']['element']['ownerDocument']?.['activeElement'];return this['_searchTextView']['queryView']['fieldView']['element']['contains'](_0x336ea4);}['_createListItems'](_0xa4f961,_0x2edf18,_0xdcf107){const _0x27f1ba=new _0x23af51();return _0x2edf18['forEach'](_0x4e0758=>{if('actions'in _0x4e0758){const {listItem:_0x509150}=this['_createActionGroupButton'](_0xa4f961,_0x4e0758,_0xdcf107);_0x27f1ba['add'](_0x509150),_0x4e0758['actions']['forEach'](_0x195aae=>{this['_createActionButton'](_0xa4f961,_0x195aae,_0x4e0758['label'],_0x4e0758['icon']);const {listItem:_0xf2f8d0,highlightViews:_0x153500}=this['_createSearchResultActionButton'](_0xa4f961,_0x195aae,_0x4e0758['label'],_0x4e0758['icon']);this['_allSearchableItems']['push']({'item':_0xf2f8d0,'label':_0x195aae['label'],'groupLabel':_0x4e0758['label'],'highlightViews':_0x153500});});}else{const {listItem:_0x1d125b}=this['_createActionButton'](_0xa4f961,_0x4e0758);_0x27f1ba['add'](_0x1d125b);const _0x88ae32=_0x1d125b['children']['first'];if(_0x88ae32){const {listItem:_0x35be46,highlightViews:_0x23f399}=this['_createSearchResultActionButton'](_0xa4f961,_0x4e0758);this['_allSearchableItems']['push']({'item':_0x35be46,'label':_0x88ae32['label']||'','highlightViews':_0x23f399});}}}),_0x27f1ba;}['_createActionButton'](_0x102723,_0x3d4550,_0x57fe4a,_0x4f3918){const _0x4aeb0c=new Ht(this['locale']);if(_0x57fe4a&&_0x4f3918){const _0x3ce382=new Nt(this['locale']),_0x2dc2be=_0x3ce382['bindTemplate'],_0x2ab599=new _0x56ea6b();_0x2ab599['text']=_0x3d4550['label'];const _0x54634c=new _0x56ea6b();_0x54634c['text']=_0x57fe4a;const _0x2cb8ce=new xt();_0x2cb8ce['content']=_0x4f3918,_0x2cb8ce['extendTemplate']({'attributes':{'class':'ck-ai-quick-actions-button__group-icon'}});const _0x50b990=new vt(this['locale']);_0x50b990['setTemplate']({'tag':'span','attributes':{'class':'ck-ai-quick-actions-button_with-group__open-paren'},'children':[{'text':'\x20('}]});const _0x56f041=new vt(this['locale']);return _0x56f041['setTemplate']({'tag':'span','attributes':{'class':'ck-ai-quick-actions-button_with-group__close-paren'},'children':[{'text':')'}]}),_0x3ce382['set']({'label':_0x3d4550['label']+'\x20('+_0x57fe4a+')','withText':!0x0,'role':'menuitem','class':'ck-ai-quick-actions-button\x20ck-ai-quick-actions-button_with-group','tooltip':!0x1}),_0x3ce382['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':[_0x2ab599,_0x50b990,_0x2cb8ce,_0x54634c,_0x56f041],'on':{'mouseenter':_0x2dc2be['to'](()=>{this['_isSearchFocused']()||_0x3ce382['focus']();}),'click':_0x2dc2be['to'](()=>{_0x3ce382['fire']('execute');})}}),_0x3ce382['on']('execute',()=>{_0x102723['editing']['view']['focus'](),_0x102723['commands']['execute']('aiQuickAction',_0x3d4550);}),_0x4aeb0c['children']['add'](_0x3ce382),{'listItem':_0x4aeb0c,'highlightViews':[_0x2ab599,_0x54634c]};}{const _0x5d7cb8=new _0x3a2569(),_0x2c89de=new Nt(this['locale'],_0x5d7cb8),_0x552504=_0x2c89de['bindTemplate'],_0x4293b3=_0x3d4550['icon']??_0x3d4550['parent']?.['icon'],_0x547991=void 0x0!==_0x3d4550['icon'];return _0x2c89de['set']({'label':_0x3d4550['label'],'withText':!0x0,'role':'menuitem','icon':_0x547991?_0x4293b3??_0x272647:void 0x0,'tooltip':!0x1,'class':'ck-ai-quick-actions-button'}),_0x2c89de['extendTemplate']({'on':{'mouseenter':_0x552504['to'](()=>{this['_isSearchFocused']()||_0x2c89de['focus']();})}}),_0x2c89de['on']('execute',()=>{_0x102723['editing']['view']['focus'](),_0x102723['commands']['execute']('aiQuickAction',_0x3d4550);}),_0x4aeb0c['children']['add'](_0x2c89de),{'listItem':_0x4aeb0c,'highlightViews':[_0x5d7cb8]};}}['_createSearchResultActionButton'](_0x24d57d,_0x55b857,_0x47e9b,_0x495cfd){return _0x47e9b&&_0x495cfd?this['_createSearchResultGroupedActionButton'](_0x24d57d,_0x55b857,_0x47e9b,_0x495cfd):this['_createSearchResultIndividualActionButton'](_0x24d57d,_0x55b857);}['_createSearchResultGroupedActionButton'](_0x15209f,_0x36467b,_0xb429f,_0x59d31b){const _0x171eee=new Ht(this['locale']),_0x5df14a=new Nt(this['locale']),_0x2a2317=_0x5df14a['bindTemplate'],{view:_0x53cbf5,highlightView:_0x2ac4b7}=this['_createSearchResultGroupRow'](_0xb429f,_0x59d31b),{view:_0x19fa2d,highlightView:_0x4d7631}=this['_createSearchResultActionRow'](_0x36467b['label']),_0x3eb731=this['_createSearchResultContentView'](_0x53cbf5,_0x19fa2d);return _0x5df14a['set']({'label':_0x36467b['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}),_0x5df14a['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':[_0x3eb731],'on':{'mouseenter':_0x2a2317['to'](()=>{this['_isSearchFocused']()||_0x5df14a['focus']();}),'click':_0x2a2317['to'](()=>{this['_handleSearchResultButtonClick'](_0x5df14a);})}}),this['_setupActionButtonExecution'](_0x5df14a,_0x15209f,_0x36467b),_0x171eee['children']['add'](_0x5df14a),{'listItem':_0x171eee,'highlightViews':[_0x2ac4b7,_0x4d7631]};}['_createSearchResultIndividualActionButton'](_0xbbc01e,_0x18b6b4){const _0x1bbcaa=new Ht(this['locale']),_0x20cbe7=new _0x3a2569(),_0xf440b3=new Nt(this['locale'],_0x20cbe7),_0x4bc90a=_0xf440b3['bindTemplate'];return _0xf440b3['set']({'label':_0x18b6b4['label'],'withText':!0x0,'role':'menuitem','icon':void 0x0,'tooltip':!0x1,'class':'ck-ai-quick-actions-button\x20ck-ai-quick-actions-search-result-button'}),_0xf440b3['extendTemplate']({'on':{'mouseenter':_0x4bc90a['to'](()=>{this['_isSearchFocused']()||_0xf440b3['focus']();})}}),this['_setupActionButtonExecution'](_0xf440b3,_0xbbc01e,_0x18b6b4),_0x1bbcaa['children']['add'](_0xf440b3),{'listItem':_0x1bbcaa,'highlightViews':[_0x20cbe7]};}['_createSearchResultGroupRow'](_0x11e345,_0x1f78f9){const _0x58c752=new vt(this['locale']),_0x13d62c=new xt();_0x13d62c['content']=_0x1f78f9,_0x13d62c['extendTemplate']({'attributes':{'class':'ck-ai-quick-actions-button__group-icon'}});const _0x2f1279=new _0x56ea6b();return _0x2f1279['text']=_0x11e345,_0x58c752['setTemplate']({'tag':'div','attributes':{'class':'ck-ai-quick-actions-search-result__group-row'},'children':[_0x13d62c,_0x2f1279]}),{'view':_0x58c752,'highlightView':_0x2f1279};}['_createSearchResultActionRow'](_0x43f90c){const _0x340b56=new vt(this['locale']),_0x4a1202=new _0x56ea6b();return _0x4a1202['text']=_0x43f90c,_0x340b56['setTemplate']({'tag':'div','attributes':{'class':'ck-ai-quick-actions-search-result__action-row'},'children':[_0x4a1202]}),{'view':_0x340b56,'highlightView':_0x4a1202};}['_createSearchResultContentView'](_0x4eebd2,_0x1961e4){const _0x26f614=new vt(this['locale']);return _0x26f614['setTemplate']({'tag':'div','attributes':{'class':'ck-ai-quick-actions-search-result__content'},'children':[_0x4eebd2,_0x1961e4]}),_0x26f614;}['_setupActionButtonExecution'](_0x190b6c,_0x52bb81,_0x67a617){_0x190b6c['on']('execute',()=>{_0x52bb81['editing']['view']['focus'](),_0x52bb81['commands']['execute']('aiQuickAction',_0x67a617);});}['_createActionGroupButton'](_0x3cd118,_0x19b0bb,_0x5dcf80){const _0x3448da=new Ht(this['locale']),_0x233a3a=new _0x3a2569(),_0xa6ced5=new Do(this['locale'],_0x233a3a),_0x55c4bc=_0xa6ced5['bindTemplate'],_0x4fc0c9=this['_getPanelKeystroke'](_0x5dcf80),_0x1132c4=this['_createGroupActionsList'](_0x3cd118,_0x19b0bb['actions'],_0x5dcf80);_0xa6ced5['set']({'label':_0x19b0bb['label'],'withText':!0x0,'role':Mo,'icon':_0x19b0bb['icon']??_0x272647,'isEnabled':_0x19b0bb['actions']['some'](_0xf4c3f2=>_0xf4c3f2['isEnabled'])}),_0xa6ced5['extendTemplate']({'on':{'mouseenter':_0x55c4bc['to'](()=>{this['_isSearchFocused']()||_0xa6ced5['focus']();})}});const _0xd28f9b=new Xt(this['locale']);return _0xd28f9b['extendTemplate']({'attributes':{'class':['ck','ck-reset_all','ck-ai-quick-actions-group-panel','ck-dropdown-menu__nested-menu__panel']},'on':{'keydown':_0x55c4bc['to'](_0x2e3654=>{this['_handlePanelKeydown'](_0x2e3654,_0x4fc0c9,_0xa6ced5,_0xd28f9b);})}}),_0xa6ced5['bind']('isOn')['to'](_0xd28f9b,'isVisible'),this['_bodyCollection']['add'](_0xd28f9b),_0xd28f9b['content']['add'](_0x1132c4),this['_setupGroupMenuBehavior'](_0xa6ced5,_0xd28f9b),_0x3448da['children']['add'](_0xa6ced5),{'listItem':_0x3448da,'highlightView':_0x233a3a};}['_createGroupActionsList'](_0x5e3a06,_0x6e9912,_0x4cfee5){const _0xdb86df=new Dt(this['locale']);return _0xdb86df['extendTemplate']({'attributes':{'class':['ck','ck-reset_all','ck-ai-quick-actions-group-list','ck-dropdown-menu-list']}}),_0x6e9912['forEach'](_0x43c2d1=>{const _0xd5f403=new Ht(this['locale']),_0xf26d2a=Lo({'editor':_0x5e3a06,'action':_0x43c2d1,'withText':!0x0,'withIcon':!0x1,'isInDropdown':!0x0,'shouldPreventFocus':()=>this['_isSearchFocused']()})();_0xd5f403['children']['add'](_0xf26d2a),_0x4cfee5['focusTracker']['add'](_0xf26d2a),_0xdb86df['items']['add'](_0xd5f403);}),_0xdb86df;}['_setupGroupMenuBehavior'](_0x1da088,_0x33c9c9){const _0x49f1ed=_0x1da088['bindTemplate'],_0x1cf153=this['_getButtonKeystroke'](_0x1da088);_0x1da088['extendTemplate']({'attributes':{'class':['ck-ai-quick-actions-group-button']},'on':{'mouseenter':_0x49f1ed['to'](()=>{this['_showNestedPanel'](_0x33c9c9,_0x1da088);}),'mouseleave':_0x49f1ed['to'](_0xd9d6b7=>{const _0x109d31=_0xd9d6b7['relatedTarget'];this['_isMovingToNestedMenu'](_0x109d31,_0x33c9c9)||this['_hideNestedPanel'](_0x33c9c9);}),'keydown':_0x49f1ed['to'](_0x36cee7=>{_0x36cee7['key']==_0x1cf153&&(this['_showNestedPanel'](_0x33c9c9,_0x1da088),_0x33c9c9['content']['get'](0x0)['focus']());})}}),_0x33c9c9['on']('render',()=>{_0x33c9c9['element']?.['addEventListener']('mouseleave',_0x1e1836=>{const _0x46527d=_0x1e1836['relatedTarget'];_0x1da088['element']?.['contains'](_0x46527d)||this['_isMovingToNestedMenu'](_0x46527d,_0x33c9c9)||this['_hideNestedPanel'](_0x33c9c9);});});}['_showNestedPanel'](_0x3c3847,_0x22c072){this['_openNestedPanels']['forEach'](_0x17ef24=>{_0x17ef24!==_0x3c3847&&_0x17ef24['isVisible']&&_0x17ef24['hide']();}),_0x3c3847['show'](),_0x3c3847['pin']({'positions':[_0x23c38f['eastSouth']],'target':_0x22c072['element'],'fitInViewport':!0x0}),this['_openNestedPanels']['add'](_0x3c3847);}['_hideNestedPanel'](_0x2c5f40){_0x2c5f40['hide'](),this['_openNestedPanels']['delete'](_0x2c5f40);}['_hideAllNestedPanels'](){this['_openNestedPanels']['forEach'](_0x7222b5=>_0x7222b5['hide']()),this['_openNestedPanels']['clear']();}['_isMovingToNestedMenu'](_0x2d5d3f,_0x17bb1a){if(!_0x2d5d3f)return!0x1;if(_0x17bb1a['element']?.['contains'](_0x2d5d3f))return!0x0;const _0x1bda35=_0x2d5d3f;return _0x1bda35['closest']&&(null!==_0x1bda35['closest']('.ck-ai-quick-actions-group-panel')||null!==_0x1bda35['closest']('.ck-ai-quick-actions-group-list')||null!==_0x1bda35['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'](_0x190620){return'rtl'===_0x190620['locale']['uiLanguageDirection']?'ArrowRight':'ArrowLeft';}['_getButtonKeystroke'](_0x45ac15){return'rtl'===_0x45ac15['locale']['uiLanguageDirection']?'ArrowLeft':'ArrowRight';}['_handlePanelKeydown'](_0x8e2993,_0x3776cc,_0x1b9095,_0x15d3ae){_0x8e2993['key']==_0x3776cc&&(_0x1b9095['focus'](),this['_hideNestedPanel'](_0x15d3ae));}['_handleSearchResultButtonClick'](_0x4de5cf){_0x4de5cf['fire']('execute');}}function Vo(_0x25d5a0){const {editor:_0x5683e3,content:_0x55b262,buttonDefinition:_0x18daa2,bodyCollection:_0x259e08,hasSearch:_0x1ff5d3=!0x1}=_0x25d5a0;return()=>{const _0x36dbbe=_0x5683e3['locale'],_0x1803c2=_0x5683e3['commands']['get']('aiQuickAction'),_0x1ca9ac=Gt(_0x36dbbe);_0x1ca9ac['bind']('isEnabled')['to'](_0x1803c2),_0x1ca9ac['buttonView']['set']({'icon':_0x18daa2['icon']??_0x272647,'label':_0x18daa2['label'],'tooltip':!0x0}),_0x1ca9ac['set']({'class':'ck-ai-quick-actions-dropdown'});const _0x3755db=new Uo(_0x5683e3,_0x55b262,_0x1ca9ac,_0x259e08,_0x1ff5d3);return _0x1ca9ac['panelView']['children']['add'](_0x3755db),_0x1ff5d3&&_0x1ca9ac['on']('change:isOpen',(_0xf3528f,_0x1c2e8f,_0x320dbc)=>{if(_0x320dbc){if(_0x5683e3['plugins']['has']('AIEditing')){const _0x140cf6=_0x5683e3['plugins']['get'](Js),_0x4ffa44=_0x5683e3['model']['document']['selection'],_0x4c4c26=Array['from'](_0x4ffa44['getRanges']());_0x4c4c26['length']>0x0&&_0x140cf6['showFakeVisualSelection']({'ranges':_0x4c4c26,'id':'quick-action','priority':0x14});}}else _0x5683e3['plugins']['has']('AIEditing')&&_0x5683e3['plugins']['get'](Js)['hideFakeVisualSelection']('quick-action'),_0x3755db['resetSearch']();}),_0x1ca9ac;};}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 _0x5e248a{static get['requires'](){return[_0x22ceab,as];}static get['pluginName'](){return'AIQuickActionsUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}async['init'](){const _0xecc4c6=await this['_getDefaultAndCustomActions']();this['_prepareQuickActionsDefinition'](_0xecc4c6),this['_initializeQuickActionsComponentsAndCommands']();}static['getDefaultQuickActions'](_0x1700da){return function(_0x4fb2e3){const _0x411ac5=new Intl['DisplayNames'](['en'],{'type':'language'})['of'](_0x4fb2e3['uiLanguage']),_0x523826=_0x411ac5||'English',_0x5856a7=[{'id':'ask-ai','label':hs(_0x4fb2e3,'AI_QUICK_ACTIONS_ASK_AI'),'type':'chat','icon':_0xfcf3e5},{'id':'chat-commands','label':hs(_0x4fb2e3,'AI_QUICK_ACTIONS_CHAT_COMMANDS'),'icon':_0xfcf3e5,'actions':[{'id':'explain','label':hs(_0x4fb2e3,'AI_QUICK_ACTIONS_EXPLAIN'),'displayedPrompt':hs(_0x4fb2e3,'AI_QUICK_ACTIONS_EXPLAIN'),'prompt':Bo['replace']('%0',_0x523826),'type':'chat'},{'id':'summarize','label':hs(_0x4fb2e3,'AI_QUICK_ACTIONS_SUMMARIZE'),'displayedPrompt':hs(_0x4fb2e3,'AI_QUICK_ACTIONS_SUMMARIZE'),'prompt':Go['replace']('%0',_0x523826),'type':'chat'},{'id':'highlight-key-points','label':hs(_0x4fb2e3,'AI_QUICK_ACTIONS_HIGHLIGHT_KEY_POINTS'),'displayedPrompt':hs(_0x4fb2e3,'AI_QUICK_ACTIONS_HIGHLIGHT_KEY_POINTS'),'prompt':Fo['replace']('%0',_0x523826),'type':'chat'}]},{'id':'improve-writing','label':hs(_0x4fb2e3,'AI_QUICK_ACTIONS_IMPROVE_WRITING'),'type':'action','icon':_0x288b1b},{'id':'continue','label':hs(_0x4fb2e3,'AI_QUICK_ACTIONS_CONTINUE_WRITING'),'type':'action','icon':_0xc7e597},{'id':'fix-grammar','label':hs(_0x4fb2e3,'AI_QUICK_ACTIONS_FIX_GRAMMAR_SPELLING'),'type':'action','icon':_0x49a57c},{'id':'adjust-length','label':hs(_0x4fb2e3,'AI_QUICK_ACTIONS_ADJUST_LENGTH'),'icon':_0x22bd65,'actions':[{'id':'make-shorter','label':hs(_0x4fb2e3,'AI_QUICK_ACTIONS_MAKE_SHORTER'),'type':'action'},{'id':'make-longer','label':hs(_0x4fb2e3,'AI_QUICK_ACTIONS_MAKE_LONGER'),'type':'action'}]},{'id':'change-tone','label':hs(_0x4fb2e3,'AI_QUICK_ACTIONS_CHANGE_TONE'),'icon':_0xda723e,'actions':[{'id':'make-tone-casual','label':hs(_0x4fb2e3,'AI_QUICK_ACTIONS_MORE_CASUAL'),'type':'action'},{'id':'make-tone-direct','label':hs(_0x4fb2e3,'AI_QUICK_ACTIONS_MORE_DIRECT'),'type':'action'},{'id':'make-tone-friendly','label':hs(_0x4fb2e3,'AI_QUICK_ACTIONS_MORE_FRIENDLY'),'type':'action'},{'id':'make-tone-confident','label':hs(_0x4fb2e3,'AI_QUICK_ACTIONS_MORE_CONFIDENT'),'type':'action'},{'id':'make-tone-professional','label':hs(_0x4fb2e3,'AI_QUICK_ACTIONS_MORE_PROFESSIONAL'),'type':'action'}]},{'id':'translate','label':hs(_0x4fb2e3,'AI_QUICK_ACTIONS_TRANSLATE'),'icon':_0x199a24,'actions':[{'id':'translate-to-english','label':hs(_0x4fb2e3,'AI_QUICK_ACTIONS_TRANSLATE_ENGLISH'),'type':'action','actionName':'translate','args':{'language':'english'}},{'id':'translate-to-chinese','label':hs(_0x4fb2e3,'AI_QUICK_ACTIONS_TRANSLATE_CHINESE'),'type':'action','actionName':'translate','args':{'language':'chinese'}},{'id':'translate-to-spanish','label':hs(_0x4fb2e3,'AI_QUICK_ACTIONS_TRANSLATE_SPANISH'),'type':'action','actionName':'translate','args':{'language':'spanish'}},{'id':'translate-to-german','label':hs(_0x4fb2e3,'AI_QUICK_ACTIONS_TRANSLATE_GERMAN'),'type':'action','actionName':'translate','args':{'language':'german'}},{'id':'translate-to-french','label':hs(_0x4fb2e3,'AI_QUICK_ACTIONS_TRANSLATE_FRENCH'),'type':'action','actionName':'translate','args':{'language':'french'}},{'id':'translate-to-japanese','label':hs(_0x4fb2e3,'AI_QUICK_ACTIONS_TRANSLATE_JAPANESE'),'type':'action','actionName':'translate','args':{'language':'japanese'}},{'id':'translate-to-portuguese','label':hs(_0x4fb2e3,'AI_QUICK_ACTIONS_TRANSLATE_PORTUGUESE'),'type':'action','actionName':'translate','args':{'language':'portuguese'}},{'id':'translate-to-korean','label':hs(_0x4fb2e3,'AI_QUICK_ACTIONS_TRANSLATE_KOREAN'),'type':'action','actionName':'translate','args':{'language':'korean'}},{'id':'translate-to-italian','label':hs(_0x4fb2e3,'AI_QUICK_ACTIONS_TRANSLATE_ITALIAN'),'type':'action','actionName':'translate','args':{'language':'italian'}},{'id':'translate-to-russian','label':hs(_0x4fb2e3,'AI_QUICK_ACTIONS_TRANSLATE_RUSSIAN'),'type':'action','actionName':'translate','args':{'language':'russian'}}]},{'id':'other','label':hs(_0x4fb2e3,'AI_QUICK_ACTIONS_OTHER'),'icon':_0x2735be,'actions':[]}];return _0x5856a7;}(_0x1700da);}async['_getDefaultAndCustomActions'](){const _0x240908=Wo['getDefaultQuickActions'](this['editor']['locale']),_0x259080=this['editor']['config']['get']('ai.quickActions.extraCommands')||[];let _0x2b92ad,_0x3d663b=[];try{const _0x51dabc=new Fs({'connector':this['editor']['plugins']['get']('AIConnector'),'config':this['editor']['config']['get']('ai.models'),'locale':this['editor']['locale']});_0x3d663b=await _0x51dabc['getAll'](),_0x2b92ad=(await _0x51dabc['getDefault']())?.['id'];}catch(_0x111a33){const _0x28700e=new at('ai-quick-actions-models-unable-to-retrieve',this,{'error':_0x111a33});Et(_0x28700e['message']);}finally{const _0x268bcd=_0x259080['map'](_0x3ed1ee=>({..._0x3ed1ee,'type':'chat'===_0x3ed1ee['type']?'chat':'action','model':'chat'!==_0x3ed1ee['type']?_0x3ed1ee['model']||_0x2b92ad:_0x3ed1ee['model'],'icon':void 0x0}));_0x240908['find'](_0x3527d2=>'other'===_0x3527d2['id'])['actions']['push'](..._0x268bcd),_0x240908['forEach'](_0x4a79e9=>{if('actions'in _0x4a79e9)_0x4a79e9['actions']['forEach'](_0x2258d1=>{if(_0x2258d1['isEnabled']=!!_0x3d663b['find'](_0x1d1adc=>_0x1d1adc['id']===_0x2258d1['model'])||void 0x0===_0x2258d1['model'],!_0x2258d1['isEnabled']){const _0x41a8e3=new at('ai-quick-actions-unavailable-model',this,{'actionId':_0x2258d1['id'],'modelId':_0x2258d1['model']});Et(_0x41a8e3['message']);}});else{if(_0x4a79e9['isEnabled']=!!_0x3d663b['find'](_0x1ea226=>_0x1ea226['id']===_0x4a79e9['model'])||void 0x0===_0x4a79e9['model'],!_0x4a79e9['isEnabled']){const _0x104980=new at('ai-quick-actions-unavailable-model',this,{'actionId':_0x4a79e9['id'],'modelId':_0x4a79e9['model']});Et(_0x104980['message']);}}});}return _0x240908;}['_initializeQuickActionsComponentsAndCommands'](){const _0x4c1db6=new Qt(this['editor']['locale']);_0x4c1db6['attachToDom'](),this['_initializeQuickActionsDropdown'](_0x4c1db6),this['_initializeQuickActionsMenuBar'](),this['_initializeQuickActionsComponents'](_0x4c1db6);}['_initializeQuickActionsDropdown'](_0x2b4d79){const _0x5b0e60=this['editor']['config']['get']('ai.quickActions.isSearchEnabled')??!0x0;this['editor']['ui']['componentFactory']['add']('aiQuickActions',Vo({'editor':this['editor'],'content':this['_quickActionsDefinition'],'buttonDefinition':{'icon':_0x272647,'label':hs(this['editor']['locale'],'AI_QUICK_ACTIONS_HEADING')},'bodyCollection':_0x2b4d79,'hasSearch':_0x5b0e60}));}['_prepareQuickActionsDefinition'](_0x5bb0c4){this['_quickActionsDefinition']=_0x5bb0c4['map'](_0x3cda55=>{if('actions'in _0x3cda55){const _0x1d21c9=_0x3cda55;return{..._0x1d21c9,'actions':_0x1d21c9['actions']['map'](_0x233180=>{const {actions:_0x5ba909,..._0x306744}=_0x1d21c9;return{..._0x233180,'parent':_0x306744};})['filter'](_0x4186a4=>this['_shouldIncludeAction'](_0x4186a4))};}return _0x3cda55;})['filter'](_0x57043c=>'actions'in _0x57043c?_0x57043c['actions']['length']>0x0:this['_shouldIncludeAction'](_0x57043c));}['_shouldIncludeAction'](_0x35a277){const _0x118cea=this['editor']['config']['get']('ai.quickActions.removeCommands')||[];return this['editor']['plugins']['has'](Ko[_0x35a277['type']])&&!_0x118cea['includes'](_0x35a277['id'])&&!('chat'===_0x35a277['type']&&!0x1===this['editor']['config']['get']('ai.chat.context.document.enabled'));}['_initializeQuickActionsComponents'](_0x27221f){this['_quickActionsDefinition']['forEach'](_0x506be0=>{if('actions'in _0x506be0){const _0x20e868=Vo({'editor':this['editor'],'content':_0x506be0['actions'],'buttonDefinition':_0x506be0,'bodyCollection':_0x27221f});this['editor']['ui']['componentFactory']['add'](_0x506be0['id'],_0x20e868),_0x506be0['actions']['forEach'](_0x23dddd=>{const _0x1e3ab7=Lo({'editor':this['editor'],'action':_0x23dddd});this['editor']['ui']['componentFactory']['add'](_0x23dddd['id'],_0x1e3ab7);});}else{const _0xa3772e=Lo({'editor':this['editor'],'action':_0x506be0,'withText':!0x1,'withIcon':!0x0,'isInDropdown':!0x1});this['editor']['ui']['componentFactory']['add'](_0x506be0['id'],_0xa3772e);}});}['_initializeQuickActionsMenuBar'](){this['editor']['ui']['componentFactory']['add']('menuBar:aiQuickActions',_0x162deb=>{const _0x23a57b=this['editor']['commands']['get']('aiQuickAction'),_0x1b73d6=new Kt(_0x162deb),_0x4ebdf8=hs(_0x162deb,'AI_QUICK_ACTIONS_HEADING');_0x1b73d6['buttonView']['set']({'label':_0x4ebdf8,'icon':_0x272647});const _0x5af936=new $t(_0x162deb);return _0x5af936['set']({'ariaLabel':_0x4ebdf8,'role':'menu'}),this['_quickActionsDefinition']['forEach'](_0x2a4f8a=>{if('actions'in _0x2a4f8a){const _0x454470=_0x2a4f8a,_0x20be4e=new qt(_0x162deb,_0x1b73d6),_0xe62bd8=new Kt(_0x162deb),_0x26b14e=new $t(_0x162deb);_0xe62bd8['buttonView']['set']({'label':_0x454470['label'],'icon':_0x454470['icon']}),_0x454470['actions']['forEach'](_0xedb6bd=>{const _0x531ded=new qt(_0x162deb,_0xe62bd8),_0x55a859=new Wt(_0x162deb);_0x55a859['set']({'label':_0xedb6bd['label'],'icon':_0xedb6bd['icon'],'role':'menuitem','isEnabled':_0xedb6bd['isEnabled']}),_0x55a859['on']('execute',()=>{this['_executeQuickAction'](_0xedb6bd);}),_0x55a859['delegate']('execute')['to'](_0xe62bd8),_0x531ded['children']['add'](_0x55a859),_0x26b14e['items']['add'](_0x531ded);}),_0xe62bd8['panelView']['children']['add'](_0x26b14e),_0x20be4e['children']['add'](_0xe62bd8),_0x5af936['items']['add'](_0x20be4e);}else{const _0x55b359=_0x2a4f8a,_0x3bd5fd=new qt(_0x162deb,_0x1b73d6),_0x1f7130=new Wt(_0x162deb);_0x1f7130['set']({'label':_0x55b359['label'],'icon':_0x55b359['icon'],'role':'menuitem','isEnabled':_0x55b359['isEnabled']}),_0x1f7130['on']('execute',()=>{this['_executeQuickAction'](_0x55b359);}),_0x1f7130['delegate']('execute')['to'](_0x1b73d6),_0x3bd5fd['children']['add'](_0x1f7130),_0x5af936['items']['add'](_0x3bd5fd);}}),(Object['values'](Ko)['some'](_0x334e07=>this['editor']['plugins']['has'](_0x334e07))?_0x1b73d6['bind']('isEnabled')['to'](_0x23a57b):_0x1b73d6['set']({'isEnabled':!0x1}),_0x1b73d6['panelView']['children']['add'](_0x5af936),_0x1b73d6);});}['_executeQuickAction'](_0x317a8a){const _0x1f6a1a=this['editor'];_0x1f6a1a['editing']['view']['focus'](),_0x1f6a1a['commands']['execute']('aiQuickAction',_0x317a8a);const _0x33be7a=_0x1f6a1a['ui']['view']['menuBarView'];_0x33be7a&&_0x33be7a['close']&&_0x33be7a['close']();}}class Yo extends _0x131d8d{['execute'](_0x340265){switch(this['_expandSelectionIfCollapsed'](),_0x340265['type']){case'chat':if(!this['editor']['plugins']['has']('AIChat')){const _0xb5a557=hs(this['editor']['locale'],'AI_QUICK_ACTIONS_PLUGIN_NOT_FOUND','AIChat');throw new at('ai-quick-actions-plugin-not-found',this['editor'],{'errorMessage':_0xb5a557});}this['_handleAIChatAction'](_0x340265);break;case'action':if(!this['editor']['plugins']['has']('AIActions')){const _0xba4eeb=hs(this['editor']['locale'],'AI_QUICK_ACTIONS_PLUGIN_NOT_FOUND','AIActions');throw new at('ai-quick-actions-plugin-not-found',this['editor'],{'errorMessage':_0xba4eeb});}this['_handleAIActionsAction'](_0x340265);}}async['_handleAIChatAction'](_0x252ecd){const _0x5ea19b=this['editor']['plugins']['get']('AIChatController'),_0x5ff885=this['editor']['plugins']['get']('AITabs')['view'];if(_0x5ff885['isVisible']||(_0x5ff885['isVisible']=!0x0),'chat'!==_0x5ff885['activeTab']&&_0x5ff885['activateTab']('chat'),'ask-ai'===_0x252ecd['id'])_0x5ea19b['removeSelectionFromChatContext'](),_0x5ea19b['addSelectionToChatContext'](),_0x5ea19b['focusPromptInput']();else await _0x5ea19b['startConversation']({'modelId':_0x252ecd['model']}),_0x5ea19b['removeSelectionFromChatContext'](),_0x5ea19b['addSelectionToChatContext'](),_0x5ea19b['focusPromptInput'](),await _0x5ea19b['sendMessage']({'message':_0x252ecd['prompt']||_0x252ecd['displayedPrompt']||_0x252ecd['label'],'attributes':{'quickActionData':{'id':_0x252ecd['id']},'displayedPrompt':_0x252ecd['displayedPrompt']}});}['_expandSelectionIfCollapsed'](){const _0x131dc9=this['editor'],_0xd1cb8e=_0x131dc9['model']['document']['selection'];if(!_0xd1cb8e['isCollapsed'])return;const _0x1eebfb=At(_0xd1cb8e['getSelectedBlocks']())||_0x131dc9['model']['schema']['getLimitElement'](_0xd1cb8e);_0x131dc9['model']['change'](_0x4c498c=>{_0x4c498c['setSelection'](_0x1eebfb,'in');});}['_handleAIActionsActionLabel'](_0x20a249){return _0x20a249['parent']?.['label']&&'other'!==_0x20a249['parent']?.['id']?_0x20a249['parent']['label']+':\x20'+_0x20a249['label']:_0x20a249['label'];}async['_handleAIActionsAction'](_0x29dd6b){const _0x36dffb=this['editor']['plugins']['get']('AIActions'),_0x55468b=_0x29dd6b['prompt']?{'userMessage':_0x29dd6b['prompt'],'model':_0x29dd6b['model']}:{'actionName':_0x29dd6b['actionName']||_0x29dd6b['id'],'args':_0x29dd6b['args']},_0x2429cb=this['_handleAIActionsActionLabel'](_0x29dd6b);await _0x36dffb['executeAction'](_0x55468b,_0x2429cb,_0x29dd6b['icon']);}}class $o extends _0x5e248a{static get['pluginName'](){return'AIQuickActionsEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const _0x463528=this['editor'],_0x37fb69=new Yo(this['editor']);if(_0x463528['commands']['add']('aiQuickAction',_0x37fb69),_0x463528['plugins']['has']('AIChat')){const _0x59e57e=this['editor']['plugins']['get']('AIChatController');_0x463528['model']['document']['selection']['on']('change:range',(_0xf2d6d6,_0x3048ae)=>{_0x3048ae['directChange']&&_0x59e57e['removeSelectionFromChatContext']();});}}}class qo extends xs{['updateChangeGroups'](){if(this['parsedMergedContent']=this['parsedContent']['cloneNode'](!0x0),0x0==this['parsedMergedContent']['childNodes']['length'])return void(this['changeGroups']=[]);const _0x482389=this['documentContextContent']['children']['map'](_0x56b890=>({'node':_0x56b890,'id':Es(_0x56b890,'data-id')})),_0x468fc8=this['parsedMergedContent']['children']['map'](_0x45a474=>({'node':_0x45a474,'id':Es(_0x45a474,'data-id')||ot()})),_0xb5955a=_0x87a05f(_0x482389,_0x468fc8,{'comparator':(_0x38440c,_0x3bcaaf)=>_0x38440c['id']==_0x3bcaaf['id'],'oneChangePerToken':!0x0});if(!this['isDone']||!this['isComplete']){for(;_0xb5955a['length']&&_0xb5955a[_0xb5955a['length']-0x1]['removed'];)_0xb5955a['pop']();}const _0x1df7b4=_0xb5955a['map'](_0x168db0=>{const _0x510f93=_0x168db0['added']?'new':_0x168db0['removed']?'removed':'modified';return{'node':_0x168db0['value'][0x0]['node'],'type':_0x510f93,'id':_0x168db0['value'][0x0]['id']};});this['changeGroups']=[{'changes':_0x1df7b4,'state':'pending','index':0x0}];}['_getDifferentChangeGroups'](_0x12ce72,_0x3ae817){return _0x3ae817;}}class Qo extends Ds{['content'];['version'];['actionName'];['args'];['userMessage'];['model'];['hasError']=!0x1;['stoppedExplicitly']=!0x1;constructor(_0x1956dc){super(_0x1956dc),this['content']=_0x1956dc['content'],this['version']=_0x1956dc['version'],this['actionName']=_0x1956dc['actionName'],this['args']=_0x1956dc['args'],this['userMessage']=_0x1956dc['userMessage'],this['model']=_0x1956dc['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'](_0x264b51){const _0x20128c=new qo({'locale':this['locale'],'documentContextContent':this['content'],..._0x264b51});return this['replies']['push'](_0x20128c),_0x20128c['delegate'](...Ls)['to'](this),this['fire']('replyCreated',_0x20128c),_0x20128c;}}class Xo extends kt{constructor(_0x2c8ae9,_0x51c769=!0x0,_0x51f404=!0x0){super(_0x2c8ae9),this['set']('isEnabled',!0x1),_0x51c769&&(this['applyButton']=this['_createButton'](hs(_0x2c8ae9,'AI_BALLOON_APPLY_BUTTON'),cs),this['applyButton']['bind']('isEnabled')['to'](this),this['items']['add'](this['applyButton'])),_0x51f404&&(this['suggestButton']=this['_createButton'](hs(_0x2c8ae9,'AI_BALLOON_SUGGEST_BUTTON'),_0x51c769?ls:cs),this['suggestButton']['bind']('isEnabled')['to'](this),this['items']['add'](this['suggestButton'])),this['setButtonsVisibility']({'showApplyButton':_0x51c769,'showSuggestButton':_0x51f404}),this['extendTemplate']({'attributes':{'class':['ck-ai-balloon__toolbar']}});}['setButtonsVisibility']({showApplyButton:_0x60643c,showSuggestButton:_0x51bfa6}){this['applyButton']&&(this['applyButton']['isVisible']=_0x60643c),this['suggestButton']&&(this['suggestButton']['isVisible']=_0x51bfa6);}['_createButton'](_0x2ebd4c,_0x337c14){const _0x338b80=new Nt(this['locale']);return _0x338b80['set']({'label':_0x2ebd4c,'class':_0x337c14,'isVisible':!0x0,'withText':!0x0}),_0x338b80;}}class zo extends vt{constructor(_0x2b751c){super(_0x2b751c),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(_0x2b751c,'AI_DISCLAIMER_TEXT')}]}]});}}class jo extends vt{constructor(_0x1a78eb){super(_0x1a78eb),this['set']('isVisible',!0x0);const _0x4e9508=new yn('small');_0x4e9508['isVisible']=!0x0;const _0xf26029=new vt(this['locale']);_0xf26029['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',_0x3d4275=>!_0x3d4275)]},'children':[_0x4e9508,_0xf26029]});}}class Jo extends So{['focusCycler'];['_config'];['_contentWrapper'];['_streamableContentView'];['_toolbarView'];['_miniToolbarView'];['_loaderView'];['_disclaimerView'];['_focusTracker'];['_keystrokes'];['_dialogContent'];['_focusables'];['_scrollManager'];['_navigationPreviousButton'];['_navigationNextButton'];['_navigationTryAgainButton'];['_navigationCounter'];constructor(_0xdf13d7,_0x34d5ea){super(_0xdf13d7),this['set']('isBusy',!0x1),this['set']('isTrackChangesOn',!0x1),this['set']('_isLoading',!0x1),this['set']('_hasError',!0x1),this['_config']=_0x34d5ea,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 _0x23af51(),this['_addContentWrapper'](_0x34d5ea),this['_addDisclaimerView'](),this['_addToolbar'](_0x34d5ea),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'](_0x34d5ea);});}['render'](){super['render']();for(const _0x8b9695 of this['_focusables'])this['_focusTracker']['add'](_0x8b9695['element']);this['_keystrokes']['listenTo'](this['element']),this['_initializeScrollManager']();}['destroy'](){super['destroy'](),this['_scrollManager']&&this['_scrollManager']['destroy']();}['focus'](_0x4e9a01){-0x1===_0x4e9a01?this['focusCycler']['focusLast']():this['focusCycler']['focusFirst']();}['setIsLoading'](_0x43e359){this['_isLoading']=_0x43e359;}['setErrorState'](){this['_hasError']=!0x0,this['_miniToolbarView']['toggleShowChangesEnabled'](!0x1);}['clearErrorState'](){this['_hasError']=!0x1,this['_miniToolbarView']['toggleShowChangesEnabled'](!0x0);}['showError'](_0x1f9d74){super['showError'](_0x1f9d74),this['_dialogContent']['has'](this['_errorView'])||this['_dialogContent']['add'](this['_errorView'],0x0);}['hideError'](){super['hideError'](),this['clearErrorState']();}['showBlockingError'](_0x444506){super['showBlockingError'](_0x444506),this['setErrorState']();}['addMiniToolbarItem'](_0x4846a8){this['_miniToolbarView']['items']['has'](_0x4846a8)||this['_miniToolbarView']['items']['add'](_0x4846a8);}['removeMiniToolbarItem'](_0x282630){this['_miniToolbarView']['items']['has'](_0x282630)&&this['_miniToolbarView']['items']['remove'](_0x282630);}['showLoader'](){this['_loaderView']&&(this['_isLoading']=!0x0);}['hideLoader'](){this['_loaderView']&&(this['_isLoading']=!0x1);}['_toggleToolbarButtonsVisibility']({showApplyButton:_0x2e094c,showSuggestButton:_0x195ec3}){_0x2e094c=_0x2e094c&&!this['isTrackChangesOn']&&this['_config']['availableActions']['includes']('applySuggestion'),_0x195ec3=_0x195ec3&&this['_config']['availableActions']['includes']('insertSuggestion'),this['_toolbarView']['setButtonsVisibility']({'showApplyButton':_0x2e094c,'showSuggestButton':_0x195ec3});}async['updateContent'](_0x353781){await this['_streamableContentView']['update'](_0x353781);}['clearContent'](){this['_streamableContentView']['clear']();}['_addContentWrapper'](_0x237c76){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'](_0x237c76['miniToolbarConfig'])]}),this['_dialogContent']['add'](this['_contentWrapper']);}['_addDisclaimerView'](){this['_disclaimerView']=new zo(this['locale']),this['_dialogContent']['add'](this['_disclaimerView']);}['_addToolbar']({showApplyButton:_0x69404f,showSuggestButton:_0x4570ee}){this['_toolbarView']=new Xo(this['locale'],_0x69404f,_0x4570ee),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',(_0x5b66f5,_0x1b354b,_0x23aae4)=>!(_0x5b66f5||_0x1b354b||_0x23aae4)),this['_toggleToolbarButtonsVisibility']({'showApplyButton':_0x69404f,'showSuggestButton':_0x4570ee}),this['_dialogContent']['add'](this['_toolbarView']);}['_createMiniToolbar'](_0x409a2b){return this['_miniToolbarView']=new ko(this['locale'],_0x409a2b),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',(_0x37f9b4,_0x518271)=>!(_0x37f9b4||_0x518271)),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 _0x3b37c3=new Nt(this['locale']),_0x19df16=new Nt(this['locale']),_0x1ee7d6=new Zo(this['locale']),_0x59b76b=new Nt(this['locale']);_0x3b37c3['set']({'icon':tt,'label':hs(this['locale'],'AI_ACTIONS_TRY_AGAIN'),'tooltip':!0x0,'class':'ck-ai-custom-action-button\x20'+us}),_0x19df16['set']({'icon':_0xba82e9,'tooltip':hs(this['locale'],'AI_ACTIONS_PREVIOUS_INTERACTION'),'class':'ck-ai-navigation-button\x20ck-ai-previous-button\x20'+us}),_0x59b76b['set']({'icon':et,'tooltip':hs(this['locale'],'AI_ACTIONS_NEXT_INTERACTION'),'class':'ck-ai-navigation-button\x20ck-ai-next-button\x20'+us}),_0x3b37c3['bind']('isEnabled')['to'](this,'isBusy',_0x26c5b0=>!_0x26c5b0),_0x3b37c3['on']('execute',()=>{this['fire']('tryAgain');}),_0x19df16['bind']('isEnabled')['to'](this,'isBusy',_0x1e4ac0=>!_0x1e4ac0),_0x19df16['on']('execute',()=>{this['fire']('showPrevious');}),_0x59b76b['bind']('isEnabled')['to'](this,'isBusy',_0x886c36=>!_0x886c36),_0x59b76b['on']('execute',()=>{this['fire']('showNext');}),this['_navigationPreviousButton']=_0x19df16,this['_navigationCounter']=_0x1ee7d6,this['_navigationNextButton']=_0x59b76b,this['_navigationTryAgainButton']=_0x3b37c3;}['updateMiniToolbarButtons'](_0x48a414,_0x1df01b){this['_navigationPreviousButton']||this['_setupMiniToolbarButtons']();const _0xa7cab4=_0x48a414>0x1;if(this['addMiniToolbarItem'](this['_navigationTryAgainButton']),_0xa7cab4){this['addMiniToolbarItem'](this['_navigationPreviousButton']),this['addMiniToolbarItem'](this['_navigationCounter']),this['addMiniToolbarItem'](this['_navigationNextButton']);const _0xdf56b4=_0x48a414-_0x1df01b;this['_navigationCounter']['setInteractionCount'](_0xdf56b4+'/'+_0x48a414),this['_navigationPreviousButton']['isEnabled']=_0x1df01b<_0x48a414-0x1,this['_navigationNextButton']['isEnabled']=_0x1df01b>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'](_0x161357){this['_isLoading']=_0x161357;}['resetShowChangesButton'](){this['_miniToolbarView']['isShowChangesOn']=!0x1;}['_initializeScrollManager'](){const _0x3d720d=this['_getScrollableElement']();_0x3d720d&&!this['_scrollManager']&&(this['_scrollManager']=new sr(_0x3d720d));}['_getScrollableElement'](){return this['_streamableContentView']['element'];}}class Zo extends vt{constructor(_0x1236d2){super(_0x1236d2);const _0x54fc83=this['bindTemplate'];this['set']('interactionCount','1/1'),this['setTemplate']({'tag':'span','attributes':{'class':['ck-ai-interaction-counter']},'children':[{'text':_0x54fc83['to']('interactionCount')}]});}['setInteractionCount'](_0x16b3cf){this['set']('interactionCount',_0x16b3cf);}}class ta extends _0x5e248a{static get['requires'](){return[as,Bt,Js,Oo,_0x47efd0];}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(_0x1dec01){super(_0x1dec01),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'](_0x22787d,_0x243b16,_0x370865){if(this['_stopInteraction'](),this['editor']['plugins']['has']('TableSelection')){if(this['editor']['plugins']['get']('TableSelection')['getSelectedTableCells']()){const {modelFragment:_0x317f78,anchorData:_0x1d49b2,root:_0x3c371a}=this['_getExecuteDataInTable']();return this['_executeAction'](_0x22787d,_0x317f78,_0x1d49b2,_0x3c371a,_0x243b16,_0x370865);}}const {modelFragment:_0x300d4d,anchorData:_0x8718d9,root:_0x4acb8f}=this['_getExecuteDataRegular']();return this['_executeAction'](_0x22787d,_0x300d4d,_0x8718d9,_0x4acb8f,_0x243b16,_0x370865);}async['destroy'](){return this['_stopInteraction'](),this['_bodyCollection']['detachFromDom'](),super['destroy']();}['_createActionsBalloonView'](){const _0x3f817f=this['editor']['plugins']['has']('TrackChanges');let _0x4de660=this['editor']['config']['get']('ai.availableReplyActions')||[...fn];_0x3f817f||(_0x4de660=_0x4de660['filter'](_0x51630f=>'insertSuggestion'!=_0x51630f));const _0x5dc057=this['editor']['commands']['get']('trackChanges'),_0x425ac4=new Jo(this['editor']['locale'],{'showApplyButton':!0x0,'showSuggestButton':_0x3f817f,'miniToolbarConfig':{'showChanges':'icon'},'availableActions':_0x4de660});return _0x425ac4['bind']('isBusy')['to'](this),_0x5dc057&&_0x425ac4['bind']('isTrackChangesOn')['to'](_0x5dc057,'value'),_0x425ac4['on']('tryAgain',()=>{this['_refreshInteraction']();}),_0x425ac4['on']('showPrevious',()=>{this['_navigateToPrevious']();}),_0x425ac4['on']('showNext',()=>{this['_navigateToNext']();}),_0x425ac4;}['_getExecuteDataRegular'](){const _0x1b85e0=this['editor']['model']['document']['selection'],_0x50f1ae=_0x1b85e0['getFirstRange']()['start']['root'];if(_0x1b85e0['isCollapsed']){const _0x2cbcb8=At(_0x1b85e0['getSelectedBlocks']())||this['editor']['model']['schema']['getLimitElement'](_0x1b85e0);this['editor']['model']['change'](_0x159fdb=>{_0x159fdb['setSelection'](_0x2cbcb8,'in');});}const _0x10c651=_0x1b85e0['getFirstRange'](),_0x4ace13=this['_wrapWithCommonAncestors'](this['editor']['model']['getSelectedContent'](_0x1b85e0),_0x10c651['start'],_0x10c651['end']);this['_copyMarkersToFragment'](_0x4ace13,_0x1b85e0,{'isTableSelection':!0x1});const _0x16de57=_0x1b85e0['getFirstRange']()['start'],_0x365d12=new Map();let _0x287091=_0x4ace13;for(let _0x49fedc=0x0;_0x49fedc<_0x16de57['path']['length'];_0x49fedc++)_0x365d12['set'](_0x287091,_0x16de57['path'][_0x49fedc]),_0x287091=_0x287091['getChild'](0x0);return{'modelFragment':_0x4ace13,'anchorData':_0x365d12,'root':_0x50f1ae};}['_getExecuteDataInTable'](){const _0x2dd271=this['editor']['model']['document']['selection'],_0x5d409b=this['editor']['plugins']['get']('TableSelection'),_0xc1a1cc=_0x2dd271['getFirstRange']()['start']['root'],_0xc9327e=_0x5d409b['getSelectionAsFragment'](),_0x2d1d3b=_0x2dd271['getFirstRange']()['start']['parent']['parent'],_0x2192f4=this['editor']['model']['createRange'](this['editor']['model']['createPositionBefore'](_0x2d1d3b),this['editor']['model']['createPositionAfter'](_0x2d1d3b)),_0x5b9f92=this['_wrapWithCommonAncestors'](_0xc9327e,_0x2192f4['start'],_0x2192f4['end']);this['_copyMarkersToFragment'](_0x5b9f92,_0x2dd271,{'isTableSelection':!0x0});const _0x10d539=_0x2dd271['getFirstRange']()['start'],_0xe41fd8=new Map();let _0x1920b7=_0x5b9f92;for(let _0x517f29=0x0;_0x517f29<_0x10d539['path']['length'];_0x517f29++)if(_0xe41fd8['set'](_0x1920b7,_0x10d539['path'][_0x517f29]),_0x517f29<_0x10d539['path']['length']-0x1)_0x1920b7=_0x1920b7['getChild'](0x0);else{let _0x55f668=_0x1920b7['nextSibling'];for(;_0x55f668;)_0xe41fd8['set'](_0x55f668,_0x10d539['path'][_0x517f29]),_0x55f668=_0x55f668['nextSibling'];}return{'modelFragment':_0x5b9f92,'anchorData':_0xe41fd8,'root':_0xc1a1cc};}async['_executeAction'](_0x4338bb,_0x342a5a,_0x43e536,_0x21edff,_0x435b75,_0x4af872){const _0x16d86d=this['editor']['plugins']['get'](Js),_0x4fd0b9=this['editor']['plugins']['get'](Oo),_0x5aae0d=this['editor']['model']['document']['selection'],_0x58bbf6=await _0x16d86d['modelToDataWithIds'](_0x342a5a),_0x470a45=this['editor']['model']['document']['version'],_0x2a1fa9=[..._0x5aae0d['getRanges']()];return this['_actionsBalloonView']||(this['_actionsBalloonView']=this['_createActionsBalloonView']()),this['_clearInteractionHistory'](),this['_clearErrorState'](),this['_balloonShowDiff']=!0x1,this['_actionsBalloonView']['resetShowChangesButton'](),this['_actionsBalloonView']['clearContent'](),_0x4fd0b9['open']({'index':0x3e8*Math['random']()%0x3e8,'title':_0x435b75,'icon':_0x4af872||_0x272647,'mainView':this['_actionsBalloonView'],'class':'ck-ai-actions-balloon','ranges':_0x2a1fa9,'id':'aiActionsBalloon'}),this['_setLoadingState'](),this['stopListening'](this['_actionsBalloonView']),this['stopListening'](_0x4fd0b9),this['_interactionParams']={'action':_0x4338bb,'content':_0x58bbf6,'version':_0x470a45,'aiBalloon':_0x4fd0b9,'modelFragment':_0x342a5a,'anchorData':_0x43e536,'root':_0x21edff},this['_setupApplyListeners'](),this['listenTo'](_0x4fd0b9,'selectionRemoved',()=>{this['_stopInteraction'](),this['_actionsBalloonView']['disableMiniToolbarButtons']();}),this['listenTo'](_0x4fd0b9,'dialogClosed',(_0x4c9586,{id:_0xecf3c9})=>{if('aiActionsBalloon'===_0xecf3c9){for(const _0x50b929 of this['_interactions']){if(0x0===_0x50b929['replies']['length']||_0x50b929['stoppedExplicitly'])continue;const _0x2c5bf1=_0x50b929['replies'][_0x50b929['replies']['length']-0x1],_0x583849=_0x2c5bf1['changeGroups'][0x0];_0x583849&&'pending'===_0x583849['state']&&_0x2c5bf1['setChangeGroupState'](0x0,'rejected');}this['_stopInteraction'](),this['_clearInteractionHistory'](),this['stopListening'](this['_actionsBalloonView']),this['stopListening'](_0x4fd0b9);}}),this['_createInteraction'](_0x58bbf6,_0x470a45,_0x4fd0b9,_0x4338bb);}['_setupApplyListeners'](){if(!this['_interactionParams'])return;const {modelFragment:_0x59b0f5,anchorData:_0x16cc7f,root:_0x124ed2}=this['_interactionParams'];this['listenTo'](this['_actionsBalloonView'],'applySuggestion',()=>{this['_applyChanges'](_0x59b0f5,_0x16cc7f,_0x124ed2,!0x1);}),this['listenTo'](this['_actionsBalloonView'],'insertSuggestion',()=>{this['_applyChanges'](_0x59b0f5,_0x16cc7f,_0x124ed2,!0x0);});}['_wrapWithCommonAncestors'](_0x252b56,_0x4677b6,_0x1b9de1){const _0x5773f8=this['editor']['model']['createRange'](_0x4677b6,_0x1b9de1)['getCommonAncestor'](),_0x4760e2=_0x5773f8['is']('documentFragment')?[]:_0x5773f8['getAncestors']({'includeSelf':!0x0})['slice'](0x1);if(_0x4760e2['length']){const _0x202628=_0x4760e2['map'](_0x44829c=>_0x44829c['_clone'](!0x1));for(let _0x48ec7c=0x1;_0x48ec7c<_0x202628['length'];_0x48ec7c++)_0x202628[_0x48ec7c-0x1]['_appendChild'](_0x202628[_0x48ec7c]);return _0x202628[_0x202628['length']-0x1]['_appendChild'](_0x252b56),new _0x569183(_0x202628[0x0]);}return _0x252b56;}['_copyMarkersToFragment'](_0x40dc53,_0x51572f,_0x4dd57e={'isTableSelection':!0x1}){const _0x330f6f=this['editor']['model'],_0x30a39f=Array['from'](_0x51572f['getRanges']()),_0x5811b2=_0x51572f['getFirstRange']()['start'];for(const _0x53d039 of _0x330f6f['markers']){if(_0x53d039['name']['startsWith'](zs)||!_0x53d039['affectsData'])continue;const _0x3780ae=_0x53d039['getRange']();if(!_0x30a39f['some'](_0x186ba3=>_0x186ba3['containsRange'](_0x3780ae,!0x0)))continue;const _0x2fe856=this['_regularCalculateMarkerPath'](_0x3780ae['start'],_0x5811b2,_0x4dd57e['isTableSelection']),_0x33a237=this['_regularCalculateMarkerPath'](_0x3780ae['end'],_0x5811b2,_0x4dd57e['isTableSelection']),_0x4f011c=_0x330f6f['createPositionFromPath'](_0x40dc53,_0x2fe856),_0x5d5d2c=_0x330f6f['createPositionFromPath'](_0x40dc53,_0x33a237);if(!_0x4f011c['isEqual'](_0x5d5d2c)){const _0x15811f=_0x330f6f['createRange'](_0x4f011c,_0x5d5d2c);_0x40dc53['markers']['set'](_0x53d039['name'],_0x15811f);}}}['_regularCalculateMarkerPath'](_0x1c503a,_0x5c1ec4,_0x59d52c=!0x1){const _0x16e6a3=[..._0x1c503a['path']['slice']()];for(let _0xf34aa4=0x0;_0xf34aa4<Math['max'](_0x5c1ec4['path']['length'],_0x1c503a['path']['length']);_0xf34aa4++){const _0x55987d=_0x5c1ec4['path'][_0xf34aa4]||0x0,_0x2807c0=(_0x1c503a['path'][_0xf34aa4]||0x0)-_0x55987d;if(_0x16e6a3[_0xf34aa4]=_0x2807c0,0x0!==_0x2807c0&&!_0x59d52c)break;}return _0x16e6a3;}async['_createInteraction'](_0x2dd81c,_0xf6fb0f,_0x485cf9,_0x51112e){const _0x29bae8=this['editor'];this['_interactionParams']||(this['_interactionParams']={'action':_0x51112e,'content':_0x2dd81c,'version':_0xf6fb0f,'aiBalloon':_0x485cf9,'modelFragment':this['editor']['model']['getSelectedContent'](this['editor']['model']['document']['selection']),'anchorData':new Map(),'root':this['editor']['model']['document']['selection']['getFirstRange']()['start']['root']});const _0x45c2ed=new Qo({'connector':this['_aiConnector'],'locale':_0x29bae8['locale'],'content':_0x2dd81c,'version':_0xf6fb0f,..._0x51112e});this['_interactions']['push'](_0x45c2ed);const _0x345293=(_0x1a1578,_0x20fe8b=!0x1,_0x46b250='streaming')=>this['_promiseQueue']['enqueue'](async _0x4fab76=>{try{const _0x5c85b0=Rs({'editor':_0x29bae8,'changeGroups':_0x1a1578['changeGroups'],'documentContextContent':_0x1a1578['documentContextContent'],'showDiff':_0x20fe8b,'trimUnchanged':!0x1});_0x5c85b0['length']&&await this['_actionsBalloonView']['updateContent']({'part':_0x5c85b0[0x0],'renderingStrategy':_0x46b250,'abortSignal':_0x4fab76});}catch(_0x39b7ac){if(this['_isAbortError'](_0x39b7ac))return;throw _0x39b7ac;}});_0x45c2ed['on']('replyCreated',(_0x1f814d,_0x3f7aea)=>{this['_actionsBalloonView']['hideLoader'](),this['_actionsBalloonView']['startAutoScroll'](),_0x345293(_0x3f7aea)['catch'](_0x5a8401=>{this['_isAbortError'](_0x5a8401)||(console['error']('Error\x20updating\x20content\x20in\x20replyCreated:',_0x5a8401),this['_setErrorState'](_0x45c2ed));});}),_0x45c2ed['on']('replyContentUpdated',(_0x587004,_0x14e3f5)=>{_0x345293(_0x14e3f5)['catch'](_0x585c3c=>{this['_isAbortError'](_0x585c3c)||(console['error']('Error\x20updating\x20content\x20in\x20replyContentUpdated:',_0x585c3c),this['_setErrorState'](_0x45c2ed));});}),_0x45c2ed['on']('interactionFinished',async()=>{try{await this['_clearLoadingState'](),this['_actionsBalloonView']['updateMiniToolbarButtons'](this['_interactions']['length'],this['_currentInteractionIndex']),await this['_promiseQueue']['queueEmptyPromise'];}catch(_0x2110e2){this['_isAbortError'](_0x2110e2)||(console['error']('Error\x20clearing\x20loading\x20state\x20in\x20interactionFinished:',_0x2110e2),this['_setErrorState'](_0x45c2ed));}finally{this['_actionsBalloonView']['stopAutoScroll']();}}),this['listenTo'](this['_actionsBalloonView'],'toggleSuggestionDisplayMode',async(_0x3350e3,{showDiff:_0x5cc411})=>{try{this['_balloonShowDiff']=_0x5cc411;const _0x21b164=this['_interaction']['replies'][this['_interaction']['replies']['length']-0x1];_0x21b164&&await _0x345293(_0x21b164,_0x5cc411,'static');}catch(_0x3b6fb7){this['_isAbortError'](_0x3b6fb7)||(console['error']('Error\x20updating\x20content\x20in\x20toggleSuggestionDisplayMode:',_0x3b6fb7),this['_setErrorState'](_0x45c2ed));}}),_0x45c2ed['on']('replyChangeGroupStateUpdated',()=>{const _0x4020ba={'positiveCount':_0x45c2ed['replies']['reduce']((_0x4ae879,_0x37e8f3)=>_0x4ae879+_0x37e8f3['changeGroups']['filter'](_0xe13571=>'accepted'===_0xe13571['state'])['length'],0x0),'totalCount':_0x45c2ed['replies']['reduce']((_0x181e2c,_0x331786)=>_0x181e2c+_0x331786['changeGroups']['length'],0x0)},_0x68c551=_0x45c2ed['actionCallId'],_0x5ed319=_0x45c2ed['actionName'];_0x5ed319?this['_aiConnector']['upsertAIActionRating'](_0x5ed319,_0x68c551,_0x4020ba):this['_aiConnector']['upsertCustomAIActionRating'](_0x68c551,_0x4020ba);}),this['_setLoadingState']();try{const _0x1895fb=await _0x45c2ed['start']();return this['_actionsBalloonView']['updateMiniToolbarButtons'](this['_interactions']['length'],this['_currentInteractionIndex']),_0x1895fb;}catch(_0x1620c7){if(this['_isAbortError'](_0x1620c7))return;this['_actionsBalloonView']['hideLoader'](),this['_setErrorState'](_0x45c2ed);}}['_applyChanges'](_0x16afe7,_0x2e2c1f,_0x3bb523,_0x48a7de){const _0x50daa3=this['editor'];if(_0x48a7de&&!_0x50daa3['plugins']['has']('TrackChanges'))throw new at('ai-no-track-changes',null);const _0x4d0d6b=this['editor']['plugins']['get'](_0x47efd0),_0xe4d49d=this['_interactions'][this['_interactions']['length']-0x1-this['_currentInteractionIndex']];if(!_0xe4d49d||!_0xe4d49d['replies']['length'])return;const _0x408462=_0xe4d49d['replies'][_0xe4d49d['replies']['length']-0x1],_0x1d9e01=_0x408462['changeGroups'];_0x408462['setChangeGroupState'](0x0,'accepted');let _0x481716=qs({'editor':_0x50daa3,'reply':_0x408462,'interaction':_0xe4d49d,'groups':_0x1d9e01,'transform':!0x1,'documentCompare':_0x4d0d6b,'documentCompareOptions':{'anchor':_0x50daa3['model']['createPositionAt'](_0x16afe7,0x0),'markDeletions':_0x48a7de}});_0x481716=this['_filterOperationsOutsideRange'](_0x481716,_0x2e2c1f);for(const _0x5cb238 of _0x481716)this['_anchorOperation'](_0x2e2c1f,_0x5cb238,_0x3bb523);const _0x5a2e26=_0xe4d49d['getDocumentContext']()['version'],_0x113926=_0x50daa3['model']['document']['history']['getOperations'](_0x5a2e26),_0x397f9c={'document':_0x50daa3['model']['document'],'useRelations':!0x1,'padWithNoOps':!0x1},_0x164c4d=_0x261504(_0x481716,_0x113926,_0x397f9c)['operationsA'];_0x50daa3['model']['change'](_0x5f1162=>{if(_0x5f1162['setSelection'](_0x50daa3['model']['document']['selection']['focus']),_0x48a7de)_0x50daa3['plugins']['get']('TrackChangesEditing')['_applyOperationsAsSuggestions'](_0x164c4d);else{for(const _0x4b83c2 of _0x164c4d)_0x4b83c2['baseVersion']=_0x50daa3['model']['document']['version'],Qs(_0x50daa3,_0x4b83c2),_0x5f1162['batch']['addOperation'](_0x4b83c2),_0x50daa3['model']['applyOperation'](_0x4b83c2);}}),this['editor']['plugins']['get']('AIBalloon')['close']();}['_filterOperationsOutsideRange'](_0x1d0fa5,_0x541720){return _0x1d0fa5['filter'](_0x309b29=>{if('rename'==_0x309b29['type']){const _0x152a4=_0x309b29['position']['nodeAfter'];return!_0x541720['has'](_0x152a4);}if(_0x309b29['type']['indexOf']('Attribute')>-0x1){const _0xcc6538=_0x309b29['range']['start']['nodeAfter'];return!_0x541720['has'](_0xcc6538);}return!0x0;});}['_anchorOperation'](_0x59933d,_0xd8a6e7,_0x4dbfe9){const _0x397c70=_0xd8a6e7['clone']();for(const _0xd31787 in _0xd8a6e7){const _0x2b2c65=_0xd8a6e7[_0xd31787];_0x2b2c65 instanceof _0x5ca4e8?_0xd8a6e7[_0xd31787]=new _0x5ca4e8(_0x2a0a4e(_0x2b2c65['start']),_0x2a0a4e(_0x2b2c65['end'])):_0x2b2c65 instanceof _0x1e668d&&(_0xd8a6e7[_0xd31787]=_0x2a0a4e(_0x2b2c65));}if(['insert','move','remove','reinsert','split','merge']['includes'](_0x397c70['type'])){if(_0x397c70['isDocumentOperation']=!0x1,_0x397c70['baseVersion']=null,'remove'==_0x397c70['type']){const _0x2e3ad=_0x397c70['sourcePosition'],_0x48ea18=_0x397c70['howMany'];new _0x48a283(_0x2e3ad,_0x48ea18)['_execute']();}else _0x397c70['_execute']();}function _0x2a0a4e(_0x5c2d5f){if('$graveyard'==_0x5c2d5f['root']['rootName'])return _0x5c2d5f;const _0x24ca7f=[];let _0x271762=_0x5c2d5f['root'];for(let _0x321b67=0x0;_0x321b67<_0x5c2d5f['path']['length'];_0x321b67++){const _0x1fd112=_0x59933d['get'](_0x271762)||0x0;_0x24ca7f[_0x321b67]=_0x5c2d5f['path'][_0x321b67]+_0x1fd112,_0x271762=_0x271762['getChildAtOffset'](_0x5c2d5f['path'][_0x321b67]);}return new _0x1e668d(_0x4dbfe9,_0x24ca7f,_0x5c2d5f['stickiness']);}}['_refreshInteraction'](){if(!this['_interactionParams'])return;this['_interactions']['length']>0x0&&this['_stopInteraction'](),this['_currentInteractionIndex']=0x0,this['_balloonShowDiff']=!0x1;const {action:_0x44806d,content:_0x1f34b3,version:_0x5f5cc0,aiBalloon:_0x5b7192}=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'](_0x1f34b3,_0x5f5cc0,_0x5b7192,_0x44806d)['catch'](_0x12ac41=>{this['_isAbortError'](_0x12ac41)||console['error']('Error\x20refreshing\x20interaction:',_0x12ac41);});}['_isAbortError'](_0x56292b){return!!_0x56292b['message']&&_0x56292b['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 _0x268d97=this['_interactions']['length'];this['_currentInteractionIndex']<_0x268d97-0x1&&this['_displayInteractionAtIndex'](this['_currentInteractionIndex']+0x1);}['_navigateToNext'](){this['_currentInteractionIndex']>0x0&&this['_displayInteractionAtIndex'](this['_currentInteractionIndex']-0x1);}async['_displayInteractionAtIndex'](_0xd32bf1){if(!this['_interactionParams'])return;this['_currentInteractionIndex']=_0xd32bf1;const _0xeb18df=this['_interactions'][this['_interactions']['length']-0x1-this['_currentInteractionIndex']];if(!_0xeb18df)return;if(_0xeb18df['hasError'])return this['_setErrorState'](_0xeb18df),void this['_actionsBalloonView']['updateMiniToolbarButtons'](this['_interactions']['length'],this['_currentInteractionIndex']);if(!_0xeb18df['replies']['length'])return;this['_actionsBalloonView']['hideError'](),this['_interactionParams']&&this['_clearErrorState']();const _0x2f2000=_0xeb18df['replies'][_0xeb18df['replies']['length']-0x1];if(_0x2f2000){const _0x3c9fc1=this['editor'];try{const _0x1e25c1=Rs({'editor':_0x3c9fc1,'changeGroups':_0x2f2000['changeGroups'],'documentContextContent':_0x2f2000['documentContextContent'],'showDiff':this['_balloonShowDiff'],'trimUnchanged':!0x1});await new Promise(_0x2e0782=>setTimeout(_0x2e0782,0x32)),await this['_actionsBalloonView']['updateContent']({'part':_0x1e25c1[0x0],'renderingStrategy':'static','abortSignal':new AbortController()['signal']});}catch(_0x429fa0){this['_isAbortError'](_0x429fa0)||console['error']('Error\x20updating\x20content\x20during\x20navigation:',_0x429fa0);}}this['_actionsBalloonView']['updateMiniToolbarButtons'](this['_interactions']['length'],this['_currentInteractionIndex']);}['_setLoadingState'](){this['_actionsBalloonView']['setIsLoading'](!0x0),this['isBusy']=!0x0;}async['_setErrorState'](_0x298909){const _0x34af0e=hs(this['editor']['locale'],'AI_ACTIONS_GENERIC_ERROR');this['_actionsBalloonView']['showError'](_0x34af0e),_0x298909['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 _0x5e248a{static get['requires'](){return[Wo,$o,ta];}static get['pluginName'](){return'AIQuickActions';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0xffb33a){super(_0xffb33a),_0xffb33a['config']['define']('ai.quickActions',{'extraCommands':[],'removeCommands':[],'isSearchEnabled':!0x0});}}class ia extends vt{['resultResponseView'];['acceptButtonView'];['dismissButtonView'];['infoButtonView'];['outdatedButtonView'];constructor(_0x310777,_0x4f4ff4){super(_0x310777),this['id']=_0x4f4ff4,this['set']('status','pending'),this['set']('changeId',_0x4f4ff4),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',(_0x5a1489,_0x5a579e)=>{_0x5a579e&&_0x5a579e['target']&&'A'===_0x5a579e['target']['tagName']&&_0x5a579e['preventDefault'](),this['fire']('activateChange',{'id':_0x4f4ff4,'source':this,'uiInteraction':'click'});}),this['on']('mouseover',()=>{this['fire']('activateChange',{'id':_0x4f4ff4,'source':this,'uiInteraction':'hover'});}),this['on']('mouseout',()=>{this['fire']('deactivateChange',{'origin':'panel','id':_0x4f4ff4,'source':this});});}['setItemAsActive'](){this['isActive']=!0x0;}['setItemAsInactive'](){this['isActive']=!0x1;}['_createResultResponseView'](){const _0x15b2fb=new vt(this['locale']);return _0x15b2fb['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',_0x3d5979=>!_0x3d5979)]}}),_0x15b2fb;}['_createAcceptButtonView'](){const _0x3fc72a=new Nt(this['locale']);return _0x3fc72a['set']({'label':hs(this['locale'],'AI_REVIEW_MODE_ACCEPT_CHANGE'),'withText':!0x0}),_0x3fc72a['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x313669=>{this['fire']('acceptChange',{'id':this['changeId']}),_0x313669['stopPropagation']();})},'attributes':{'class':[this['bindTemplate']['if']('status','ck-hidden',_0xdd07f9=>'pending'!==_0xdd07f9&&'accepted'!==_0xdd07f9),this['bindTemplate']['if']('status',ls,_0x2d6f8a=>'pending'===_0x2d6f8a),this['bindTemplate']['if']('status',us,_0x4ff8fb=>'pending'!==_0x4ff8fb),this['bindTemplate']['if']('status','ck-ai_review__check-run-result-status-button',_0x2eff99=>'accepted'===_0x2eff99)]}}),this['on']('change:status',(_0x20a7de,_0x3657c0,_0x34d3b4)=>{_0x3fc72a['isEnabled']='pending'===_0x34d3b4,'accepted'===_0x34d3b4&&(_0x3fc72a['label']=hs(this['locale'],'AI_REVIEW_MODE_CHECK_STATUS_ACCEPTED'),_0x3fc72a['icon']=_0x406d61);}),_0x3fc72a;}['_createDismissButtonView'](){const _0xf549f3=new Nt(this['locale']);return _0xf549f3['set']({'label':hs(this['locale'],'AI_REVIEW_MODE_DISMISS_CHANGE'),'withText':!0x0}),_0xf549f3['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x3747fd=>{this['fire']('dismissChange',{'id':this['changeId']}),_0x3747fd['stopPropagation']();})},'attributes':{'class':[us,this['bindTemplate']['if']('status','ck-hidden',_0x5a3c0a=>'pending'!==_0x5a3c0a&&'rejected'!==_0x5a3c0a),this['bindTemplate']['if']('status','ck-ai_review__check-run-result-dismiss-button',_0x295830=>'pending'===_0x295830),this['bindTemplate']['if']('status','ck-ai_review__check-run-result-status-button',_0x20f5f5=>'rejected'===_0x20f5f5)]}}),this['on']('change:status',(_0x527ac5,_0x454913,_0x548a38)=>{_0xf549f3['isEnabled']='pending'===_0x548a38,'rejected'===_0x548a38&&(_0xf549f3['label']=hs(this['locale'],'AI_REVIEW_MODE_CHECK_STATUS_REJECTED'),_0xf549f3['icon']=_0x35e3e9);}),_0xf549f3;}['_createInfoButtonView'](){const _0x944f4f=new Nt(this['locale']);return _0x944f4f['set']({'label':hs(this['locale'],'AI_REVIEW_MODE_LEARN_MORE'),'icon':_0x138750,'tooltip':!0x0,'isToggleable':!0x0,'role':'menuitemcheckbox','class':us+'\x20ck-ai_review__check-run-result-info-button\x20ck-hidden'}),_0x944f4f['bind']('isOn')['to'](this,'isInfoToggleOn',_0x9fd5bc=>_0x9fd5bc),_0x944f4f['on']('execute',()=>{this['isInfoToggleOn']=!this['isInfoToggleOn'];}),_0x944f4f;}['_createOutdatedButtonView'](){const _0x5f3b9b=new Nt(this['locale']);return _0x5f3b9b['set']({'label':hs(this['locale'],'AI_REVIEW_MODE_CHECK_STATUS_OUTDATED'),'icon':it,'withText':!0x0,'isEnabled':!0x1}),_0x5f3b9b['extendTemplate']({'attributes':{'class':[us,'ck-ai_review__check-run-result-status-button',this['bindTemplate']['if']('status','ck-hidden',_0x3a5fa7=>'outdated'!==_0x3a5fa7)],'disabled':'disabled'}}),_0x5f3b9b;}}class sa extends Xt{['resultItemView'];['_pinnedRectIndex']=void 0x0;['_pinnedTargetElement']=void 0x0;['_pinnedTargetChangeId']=void 0x0;constructor(_0x57e0cb,_0x1a0f58){super(_0x57e0cb),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']()),_0x1a0f58['add'](this);}['render'](){super['render'](),this['_setupClickOutsideHandler']();}['updateContent'](_0xc50bb5){this['resultItemView']['changeId']=_0xc50bb5['id'],this['resultItemView']['resultResponseView']['element']['innerHTML']=_0xc50bb5['contentDiffed'];}['showBalloon'](_0x1a422f,_0x91fb4c,_0x2d65c3,_0x1cfcb4,_0x61db1,_0x26a8e0){const _0x5a2dba=_0x91fb4c();if(!_0x5a2dba)return;this['updateContent'](_0x1a422f),this['show']();const _0x1ad641=Array['from'](_0x5a2dba['getClientRects']())['reverse'](),_0x9d7d6b=this['_getPointedRectIndexFromEvent'](_0x2d65c3,_0x1ad641),_0x3595f4=_0x1ad641[_0x9d7d6b??0x0];'click'===_0x1cfcb4?(this['isDiffActive']=!0x0,this['pin']({'target':()=>this['_getBestRectPositionOnClick'](_0x91fb4c(),_0x9d7d6b,_0x1a422f['id'],_0x61db1,_0x26a8e0)||_0x3595f4})):'hover'===_0x1cfcb4&&(this['isDiffActive']=!0x1,this['pin']({'target':()=>this['_getBestRectPositionOnHover'](_0x91fb4c(),_0x9d7d6b,_0x1a422f['id'])||_0x3595f4}));}['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 _0x8bb723=[this['element']];return this['_pinnedTargetElement']&&_0x8bb723['push'](this['_pinnedTargetElement']),_0x8bb723;},'callback':()=>{this['hide'](),this['unpin'](),this['deactivateChange'](),this['_pinnedTargetElement']=void 0x0,this['_pinnedRectIndex']=void 0x0,this['_pinnedTargetChangeId']=void 0x0;}});}['_createContentView'](){const _0x5360df=new vt();return this['resultItemView']=new ia(this['locale'],''),this['resultItemView']['resultResponseView']['extendTemplate']({'attributes':{'class':['ck-content']}}),this['resultItemView']['delegate']('acceptChange','dismissChange')['to'](this),_0x5360df['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']]}]}),_0x5360df;}['_getBestRectPositionOnClick'](_0x27aae8,_0x1f0f26,_0x55883b,_0x169ead,_0x447389){if(!_0x27aae8)return null;const _0xf830bd=this['position']['replace']('arrow_',''),_0x52bdfa=Array['from'](_0x27aae8['getClientRects']());let _0x1a0230,_0x55f429=_0x52bdfa['reverse']();return void 0x0!==_0x1f0f26&&this['_isPinnedRectVisible'](_0x55f429[_0x1f0f26],_0x169ead,_0x447389)?(_0x1a0230=_0x55f429[_0x1f0f26],this['_pinnedRectIndex']=_0x1f0f26):this['_isPinnedRectVisible'](_0x55f429[0x0],_0x169ead,_0x447389)&&void 0x0===_0x1f0f26?_0x1a0230=_0x55f429[0x0]:(_0x55f429='s'==_0xf830bd[0x0]?[..._0x52bdfa]['reverse']():_0x52bdfa,_0x55f429['forEach'](_0x3830c8=>{this['_isPinnedRectVisible'](_0x3830c8,_0x169ead,_0x447389)&&(_0x1a0230=_0x3830c8);})),this['_pinnedTargetChangeId']=_0x55883b,this['_pinnedTargetElement']=_0x27aae8,_0x1a0230||_0x27aae8['getBoundingClientRect']();}['_getBestRectPositionOnHover'](_0x533d6d,_0x1ece2c,_0x6a35a){if(!_0x533d6d)return null;const _0x1e5b91=Array['from'](_0x533d6d['getClientRects']())['reverse']();if(void 0x0===this['_pinnedRectIndex']&&void 0x0!==_0x1ece2c&&this['_pinnedTargetChangeId']!==_0x6a35a)return this['_pinnedRectIndex']=_0x1ece2c,this['_pinnedTargetElement']=_0x533d6d,this['_pinnedTargetChangeId']=_0x6a35a,_0x1e5b91[_0x1ece2c];if(void 0x0!==this['_pinnedRectIndex']&&this['_pinnedTargetChangeId']===_0x6a35a){if(_0x533d6d!==this['_pinnedTargetElement'])return Array['from'](this['_pinnedTargetElement']['getClientRects']())['reverse']()[this['_pinnedRectIndex']];return _0x1e5b91[this['_pinnedRectIndex']];}return void 0x0!==_0x1ece2c&&this['_pinnedTargetChangeId']!==_0x6a35a?(this['_pinnedRectIndex']=_0x1ece2c,this['_pinnedTargetElement']=_0x533d6d,this['_pinnedTargetChangeId']=_0x6a35a,_0x1e5b91[_0x1ece2c]):_0x533d6d['getBoundingClientRect']();}['_getPointedRectIndexFromEvent'](_0x5022be,_0x5aa7ee){if(_0x5022be)for(let _0x4ffb5a=0x0;_0x4ffb5a<_0x5aa7ee['length'];_0x4ffb5a++){const _0x1bcee8=_0x5aa7ee[_0x4ffb5a];if(_0x5022be['clientX']>=_0x1bcee8['left']-0x3&&_0x5022be['clientX']<=_0x1bcee8['right']+0x3&&_0x5022be['clientY']>=_0x1bcee8['top']-0x3&&_0x5022be['clientY']<=_0x1bcee8['bottom']+0x3)return _0x4ffb5a;}}['_isPinnedRectVisible'](_0x23db2f,_0x292b61,_0x2c8239){const _0x4e7a40=new ut(_0x23db2f),_0x36bbdd=_0x292b61||document['documentElement'],_0x10b6f5=_0x4e7a40['getIntersection'](Rt(_0x2c8239)),_0x1373a1=new ut(_0x36bbdd)['getIntersection'](_0x4e7a40);return!!(_0x10b6f5&&_0x1373a1&&_0x4e7a40['width']>0x0);}}const na=['getReviewCheckList','runReviewCheck','abortReviewStream','toggleDiff','acceptAllChanges','leaveReviewCoreResultList','activateChange','deactivateChange','acceptChange','dismissChange','learnMore','finishReview','retryReview'];class ra extends _0x173dbd{['_mainView'];['_balloonSuggestionView'];['_bodyCollection'];static get['requires'](){return[os];}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x58f973){super(_0x58f973),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 _0x3875fd=this['context']['plugins']['get']('AITabs');this['registerTab'](_0x3875fd);}['destroy'](){this['_bodyCollection']['detachFromDom'](),super['destroy']();}['setAvailableChecks'](_0x3d1245){if(!this['_mainView']['reviewCheckListView']['hasChecks']()){const _0x40c620=!this['context']['config']['get']('ai.models.showModelSelector');this['_mainView']['reviewCheckListView']['setChecks'](_0x3d1245,_0x40c620);}this['_mainView']['showReviewCheckListView']();}['showReviewCheckList'](){this['fire']('getReviewCheckList');}['showCheckRunResults'](_0x5cb217){_0x5cb217&&('error-general'!==_0x5cb217['status']?'error-chunk'!==_0x5cb217['status']?this['_mainView']['showReviewCheckResultsView']():this['showChunkErrorView']():this['showGeneralResultsErrorView']());}['showCheckRunResult'](_0x6e5099){this['_mainView']['addCheckRunResult'](_0x6e5099);}['showGeneralResultsErrorView'](){this['_mainView']['showGeneralResultsErrorView']();}['showGeneralReviewCoreErrorView'](_0x2d96cd){this['_mainView']['showGeneralReviewCoreErrorView'](_0x2d96cd??hs(this['context']['locale'],'AI_REVIEW_INITIALIZATION_ERROR_MESSAGE'));}['showChunkErrorView'](){this['_mainView']['showChunkErrorView']();}['setCheckResultTitle'](_0x56303f,_0x4a4e55){this['_mainView']['reviewCheckResultsView']['setTitle'](_0x56303f,_0x4a4e55);}['setActiveStateInResults'](_0x4dd78b){this['_mainView']['reviewCheckResultsView']['getResults']()['forEach'](_0x2d9e3b=>{_0x2d9e3b['id']===_0x4dd78b&&_0x2d9e3b['setItemAsActive']();});}['resetActiveStateInResults'](){this['_mainView']['reviewCheckResultsView']['getResults']()['forEach'](_0x3a2d91=>_0x3a2d91['setItemAsInactive']());}['updateChangeState'](_0x2b3cef,_0xf9e180){'accepted'===_0xf9e180||'rejected'===_0xf9e180||'outdated'===_0xf9e180?this['_mainView']['reviewCheckResultsView']['hideResult'](_0x2b3cef,_0xf9e180):this['_mainView']['reviewCheckResultsView']['showResult'](_0x2b3cef,_0xf9e180);}['showReviewCompletedView'](){this['_mainView']['showReviewCompletedView']();}['showActionsWhenResultIsReady'](){this['_mainView']['showActionsWhenResultIsReady']();}['showNoChangesView'](){this['_mainView']['showNoChangesView']();}['hideActionsWhenResultIsReady'](){this['_mainView']['hideActionsWhenResultIsReady']();}['showChangeBalloon'](_0x20764e,_0x6c7b12,_0x16dcb0,_0x5c9eb6,_0x329ec2,_0x4f64c0){this['_balloonSuggestionView']['showBalloon'](_0x20764e,_0x6c7b12,_0x16dcb0,_0x5c9eb6,_0x329ec2,_0x4f64c0);}['hideChangeBalloon'](){this['_balloonSuggestionView']['hideBalloon']();}['hideDiffInBalloon'](){this['_balloonSuggestionView']['hideDiffInBalloon']();}['showDiffInBalloon'](){this['_balloonSuggestionView']['showDiffInBalloon']();}['getChangeElement'](_0x59d77b){const _0x5b8c42=this['_mainView']['reviewCheckResultsView']['getResults']()['find'](_0x385e9c=>_0x385e9c['id']===_0x59d77b);return _0x5b8c42?_0x5b8c42['element']:null;}['deactivateChange'](){this['_balloonSuggestionView']['deactivateChange']();}}class oa extends vt{constructor(_0xeb1bf4){super(_0xeb1bf4),this['set']('isVisible',!0x1),this['set']('errorMessage','');const _0x5dec46=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai_review__general-error-container',_0x5dec46['if']('isVisible','ck-hidden',_0x3bb60d=>!_0x3bb60d)]},'children':[{'tag':'p','attributes':{'class':'ck\x20ck-ai-notification\x20ck-ai-notification_error'},'children':[{'text':_0x5dec46['to']('errorMessage')}]}]});}}class aa extends vt{['reviewCoreHeader'];['generalErrorView'];['reviewCheckListView'];['reviewCheckResultsView'];['reviewCompletedView'];constructor(_0x369fd7,_0x5b4d6f){super(_0x369fd7),this['reviewCoreHeader']=_0x5b4d6f['header'],this['generalErrorView']=new oa(_0x369fd7),this['reviewCheckListView']=_0x5b4d6f['list'],this['reviewCheckListView']['delegate'](...na)['to'](this),this['reviewCheckResultsView']=_0x5b4d6f['results'],this['reviewCheckResultsView']['delegate'](...na)['to'](this),this['reviewCompletedView']=_0x5b4d6f['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'](_0x1349e0){this['reviewCheckResultsView']['addResult'](_0x1349e0),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'](_0x1750b9){this['generalErrorView']['set']('isVisible',!0x0),this['generalErrorView']['errorMessage']=_0x1750b9;}['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(_0x592236,_0x11fa97){super(_0x11fa97),this['set']({'label':_0x592236,'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(_0x1e3eed,_0x14f988){super(_0x1e3eed),this['_contents']=_0x14f988,this['_resultViews']=new _0x23af51(),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(_0x1e3eed),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 _0x762826=this['_createCombinedSkeletonLoader'](),_0x48869e=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-run',_0x48869e['if']('isLoading','ck-ai_review__check-run_loading',_0x4d8ea3=>_0x4d8ea3),_0x48869e['if']('isResultReady','ck-ai_review__check-run_ready',_0xc5b292=>_0xc5b292),_0x48869e['if']('isVisible','ck-hidden',_0x1ccc39=>!_0x1ccc39)]},'children':[this['_resultsHeader'],this['_errorMessageView'],this['_resultsBody'],_0x762826,this['reviewDisclaimer']]});}['clearResults'](){this['_resultViews']['clear'](),this['_resultsBody']['element']&&(this['_resultsBody']['element']['scrollTop']=0x0);}['getResults'](){return this['_resultViews'];}['addResult'](_0x1ba20b){const _0x381b03=new ia(this['locale'],_0x1ba20b['id']);_0x381b03['delegate']('acceptChange','dismissChange','activateChange','deactivateChange')['to'](this),this['_resultViews']['add'](_0x381b03),_0x381b03['resultResponseView']['element']['innerHTML']=_0x1ba20b['contentDiffed'];}['hideResult'](_0x5724b1,_0x28e02a){if('pending'===_0x28e02a)return;const _0x42b670=this['_resultViews']['find'](_0x176669=>_0x176669['id']===_0x5724b1);_0x42b670&&(_0x42b670['status']=_0x28e02a,_0x42b670['element']?.['classList']['add']('ck-ai_review__check-run-result_grayout'));}['showResult'](_0x1ca568,_0x570cd7){if('pending'!==_0x570cd7)return;const _0x155cc6=this['_resultViews']['find'](_0x2f9d0f=>_0x2f9d0f['id']===_0x1ca568);_0x155cc6&&(_0x155cc6['status']=_0x570cd7,_0x155cc6['element']?.['classList']['remove']('ck-ai_review__check-run-result_grayout'));}['setTitle'](_0x337467,_0x15a233){this['headerTitle']=_0x337467,this['headerSubtitle']=_0x15a233||'';}['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 _0x5eb78d=new vt(this['locale']),_0xf970a2=[];for(let _0x320280=0x0;_0x320280<0x10;_0x320280++){const _0x3a17ce=this['_createSkeletonLoader']();_0x3a17ce['extendTemplate']({'attributes':{'class':['ck-ai_review__check-run-skeleton-item']}}),_0xf970a2['push'](_0x3a17ce);}return _0x5eb78d['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-run-skeleton-container',this['bindTemplate']['if']('isLoading','ck-hidden',_0x449fab=>!_0x449fab)]},'children':_0xf970a2}),_0x5eb78d;}['_createResultsBodyView'](){const _0x163c84=new vt(this['locale']);return _0x163c84['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-run-results-container','ck-reset_all-excluded',this['bindTemplate']['if']('isLoading','ck-hidden',_0x4f47f4=>_0x4f47f4)]},'children':this['_resultViews']}),_0x163c84;}['_createErrorView'](){const _0x4df9be=new vt(this['locale']),_0x3949f3=new Nt(this['locale']),t=this['locale']['t'];return _0x4df9be['delegate']('retryReview')['to'](this),_0x3949f3['set']({'label':t('Try\x20again'),'withText':!0x0,'class':ls+'\x20ck-ai_review__check-run-error-retry-button'}),_0x3949f3['on']('execute',()=>{this['fire']('retryReview');}),_0x4df9be['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-run-error-container',this['bindTemplate']['if']('showErrorMessage','ck-hidden',_0x1706ce=>!_0x1706ce),this['bindTemplate']['if']('errorType','ck-ai_review__check-run-error-container_border-bottom',_0x161fee=>'chunk'===_0x161fee)]},'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',_0x580802=>'chunk'===_0x580802)]},'children':[{'tag':'p','attributes':{'class':['ck-ai-notification__content',this['bindTemplate']['if']('errorType','ck-hidden',_0x2d9b63=>'general'!==_0x2d9b63)]},'children':[{'text':this['_contents']['generalErrorText']}]},{'tag':'p','attributes':{'class':['ck-ai-notification__content',this['bindTemplate']['if']('errorType','ck-hidden',_0x1dca23=>'chunk'!==_0x1dca23)]},'children':[{'text':hs(this['locale'],'AI_REVIEW_MODE_CHUNK_ERROR_MESSAGE')}]}]},_0x3949f3]}),_0x4df9be;}['_createCancelButtonView'](){const _0x3cfac6=new Nt(this['locale']);return _0x3cfac6['set']({'label':hs(this['locale'],'AI_REVIEW_MODE_STOP_GENERATING'),'withText':!0x0,'class':[ls+'\x20ck-ai-button-stop-generating'],'icon':_0x327a50}),_0x3cfac6['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isResultReady','ck-hidden',_0x3fbfd5=>_0x3fbfd5),this['bindTemplate']['if']('isCompleted','ck-hidden',_0x33d228=>_0x33d228)]}}),_0x3cfac6['on']('execute',()=>{this['fire']('abortReviewStream');}),_0x3cfac6;}['_createToggleDiffButtonView'](){const _0x49f642=new Nt(this['locale']);_0x49f642['set']({'tooltip':!0x0,'isToggleable':!0x0,'role':'menuitemcheckbox'}),_0x49f642['bind']('isEnabled')['to'](this,'isError',_0x2f002f=>!_0x2f002f),_0x49f642['extendTemplate']({'attributes':{'class':[ls,'ck-ai_review__check-run-toggle-diff-button',this['bindTemplate']['if']('isResultReady','ck-hidden',_0x54e1c8=>!_0x54e1c8),this['bindTemplate']['if']('isCompleted','ck-hidden',_0x1730fd=>_0x1730fd)]}});const _0x207f75=hs(this['locale'],'AI_REVIEW_MODE_HIDE_CHANGES'),_0xad3816=hs(this['locale'],'AI_REVIEW_MODE_SHOW_CHANGES');return _0x49f642['bind']('isOn')['to'](this,'isToggleDiffOn',_0x1dcf13=>_0x1dcf13),_0x49f642['bind']('icon')['to'](this,'isToggleDiffOn',_0x3698c9=>_0x3698c9?st:nt),_0x49f642['bind']('label')['to'](this,'isToggleDiffOn',_0x506d7a=>_0x506d7a?_0x207f75:_0xad3816),_0x49f642['on']('execute',()=>{this['isToggleDiffOn']=!this['isToggleDiffOn'],this['fire']('toggleDiff',{'on':this['isToggleDiffOn']});}),_0x49f642;}['_createAcceptAllButtonView'](){const _0x3a262f=new Nt(this['locale']);return _0x3a262f['set']({'label':hs(this['locale'],'AI_REVIEW_MODE_ACCEPT_ALL'),'withText':!0x0}),_0x3a262f['bind']('isEnabled')['to'](this,'isError',_0x31b90b=>!_0x31b90b),_0x3a262f['extendTemplate']({'attributes':{'class':[cs,'ck-ai_review__check-run-accept-all-button',this['bindTemplate']['if']('isResultReady','ck-hidden',_0x359211=>!_0x359211),this['bindTemplate']['if']('isCompleted','ck-hidden',_0x464b4a=>_0x464b4a)]}}),_0x3a262f['on']('execute',()=>{this['fire']('acceptAllChanges');}),_0x3a262f;}['_createExitReviewButtonView'](){const _0xb367e3=new Nt(this['locale']);return _0xb367e3['set']({'label':hs(this['locale'],'AI_REVIEW_MODE_EXIT_REVIEW'),'withText':!0x0}),_0xb367e3['extendTemplate']({'attributes':{'class':[us,'ck-ai_review__check-run-exit-button',this['bindTemplate']['if']('isResultReady','ck-hidden',_0x9660e=>!_0x9660e),this['bindTemplate']['if']('isCompleted','ck-hidden',_0x320c8f=>_0x320c8f)]}}),_0xb367e3['on']('execute',()=>{this['fire']('leaveReviewCoreResultList');}),_0xb367e3;}['_createResultHeaderView'](){const _0x55c9af=new vt(this['locale']),_0x334a84=this['_createTitleView']();return _0x55c9af['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-run-results-header',this['bindTemplate']['if']('isCompleted','ck-ai_review__review-completed-header',_0x4b8ee1=>_0x4b8ee1)]},'children':[_0x334a84,{'tag':'div','attributes':{'class':['ck-ai_review__check-run-results-header-buttons']},'children':[this['_cancelButtonView'],this['_acceptAllButtonView'],this['_exitReviewButtonView'],this['_toggleDiffButtonView'],this['_finishReviewButtonView']]}]}),_0x55c9af;}['_createTitleView'](){const _0x431305=new vt(this['locale']),_0x4b2c64=new yn();return _0x4b2c64['bind']('isVisible')['to'](this,'isResultReady',_0xbf90b9=>!_0xbf90b9),_0x431305['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-run-results-header-title-wrapper']},'children':[_0x4b2c64,{'tag':'div','attributes':{'class':['ck-ai_review__check-run-results-header-title-content',this['bindTemplate']['if']('isCompleted','ck-hidden',_0xb0910e=>_0xb0910e)]},'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',_0x5dff05=>!_0x5dff05)]},'children':[{'text':hs(this['locale'],'AI_REVIEW_MODE_FINISH_REVIEW_HEADER_TITLE')}]}]}),_0x431305;}['_createFinishReviewButtonView'](){const _0x4906cd=new ha(hs(this['locale'],'AI_REVIEW_MODE_FINISH_REVIEW_BUTTON_LABEL'),this['locale']);return _0x4906cd['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isCompleted','ck-hidden',_0x356667=>!_0x356667)]}}),_0x4906cd['delegate']('finishReview')['to'](this),_0x4906cd;}}class la extends Ht{['_resultsHeader'];['_finishReviewButtonView'];constructor(_0x10f345,_0x3ffd99){super(_0x10f345),this['_finishReviewButtonView']=this['_createFinishReviewButtonView'](_0x3ffd99['buttonText']),this['_resultsHeader']=this['_createResultHeaderView'](_0x3ffd99['headerText']);const _0x52a0e8=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__review-completed',_0x52a0e8['if']('isVisible','ck-hidden',_0x24659a=>!_0x24659a)]},'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':_0x3ffd99['emptyResultsText']}]}]}]});}['_createFinishReviewButtonView'](_0x667c59){const _0x353c9a=new ha(_0x667c59,this['locale']);return _0x353c9a['delegate']('finishReview')['to'](this),_0x353c9a;}['_createResultHeaderView'](_0x20cf0d){const _0x412328=new vt(this['locale']);return _0x412328['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':_0x20cf0d}]},{'tag':'div','attributes':{'class':['ck-ai_review__review-completed-header-buttons']},'children':[this['_finishReviewButtonView']]}]}),_0x412328;}}class ua extends vt{['_dropdownView'];['_defaultValue'];['_defaultLabel'];constructor(_0x26d353,_0x3451df){super(_0x26d353),this['_defaultValue']=_0x3451df['default']||(_0x3451df['data']['length']>0x0?_0x3451df['data'][0x0]['id']:''),this['_defaultLabel']=_0x3451df['data']['find'](_0x580cfb=>_0x580cfb['id']===this['_defaultValue'])?.['label']||'',this['set']('formValue',''),this['_dropdownView']=Gt(this['locale']);const _0x363764=this['_prepareListOptions'](_0x3451df['data']);jt(this['_dropdownView'],_0x363764,{'role':'menu','ariaLabel':_0x3451df['label']}),this['_dropdownView']['buttonView']['set']({'label':this['_defaultLabel'],'withText':!0x0}),this['_dropdownView']['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x333f00=>{_0x333f00['stopPropagation']();})}}),this['listenTo'](this['_dropdownView'],'execute',_0x570960=>{this['formValue']=_0x570960['source']['model']['id'],this['_dropdownView']['buttonView']['label']=_0x570960['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'](_0x2a03bb=[]){const _0x25a3d1=new dt();this['resetToDefault']();for(const _0x4b4196 of _0x2a03bb){const _0x408d02=new Jt({'label':_0x4b4196['label'],'withText':!0x0,'role':'menuitemradio','id':_0x4b4196['id'],'model':_0x4b4196});_0x408d02['bind']('isOn')['to'](this,'formValue',_0x241358=>_0x241358===_0x408d02['id']);const _0x8d696={'type':'button','model':_0x408d02};_0x25a3d1['add'](_0x8d696);}return _0x25a3d1;}}class da extends Ht{['_formItem']=null;constructor(_0x38581d,_0x4f70e2,_0x3edcfd){super(_0x38581d),this['argsKey']=_0x4f70e2?.['argsKey'];if('dropdown'===_0x4f70e2['formType'])this['_formItem']=new ua(this['locale'],_0x4f70e2);this['set']('value',''),this['bind']('value')['to'](this['_formItem'],'formValue');const _0x294c6f=new _0xc57744(this['locale'],{'children':[this['_formItem']],'class':[_0x3edcfd?'ck-form__row_with-submit':'']});_0x3edcfd&&_0x294c6f['children']['add'](_0x3edcfd),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai_review__form-item','ck-reset_all']},'children':[_0x294c6f]});}['resetToDefault'](){this['_formItem']['resetToDefault']();}}class _a extends _0x4e411f{['keystrokes'];static ['MIN_ROWS']=0x1;static ['MAX_ROWS']=0xc;constructor(_0x2cb6d9){super(_0x2cb6d9),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 _0x23af51();['submitButtonView'];['cancelButtonView'];['promptInputView'];['actionsFooterView'];['_modelSelectionDropdown'];['_modelNameView'];['_modelSelectionDropdownItems'];['_check'];['_defaultValue'];['_defaultLabel'];constructor(_0x303a59,_0x29c224,_0x124131=!0x1){super(_0x303a59),this['_check']=_0x29c224,this['set']('prompt',''),this['set']('modelId',''),this['set']('modelDisplayMode','selector'),this['set']('activeModelName',null),this['_defaultValue']=_0x29c224['defaultModel']?_0x29c224['defaultModel']['id']:'',this['_defaultLabel']=_0x29c224['defaultModel']?_0x29c224['defaultModel']['name']:'',this['submitButtonView']=this['_createSubmitButtonView'](),this['cancelButtonView']=this['_createCancelButtonView'](),(this['promptInputView']=new te(this['locale'],()=>new _a(_0x303a59)),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'](_0x124131),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 _0xc57744(this['locale'],{'children':[this['promptInputView']]}),new _0xc57744(this['locale'],{'children':[this['actionsFooterView']]})]}),this['promptInputView']['fieldView']['keystrokes']['set']('Enter',(_0x1b3b56,_0x2e05c4)=>{this['_isValid']()?(this['fire']('runReviewCheck',{'id':'custom','args':{'prompt':this['prompt'],'model':this['modelId']},'isCustom':!0x0}),_0x2e05c4()):_0x2e05c4();}),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'](_0x3874a4=>{this['_focusables']['add'](_0x3874a4),this['focusTracker']['add'](_0x3874a4['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 _0xd9623d of this['_getFormValidators']()){const _0x414d2a=_0xd9623d();if(_0x414d2a)return this['promptInputView']['errorText']=_0x414d2a,!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 _0x4f8380=new Nt(this['locale']),t=this['locale']['t'];return _0x4f8380['set']({'label':t('Submit'),'withText':!0x0,'class':cs}),_0x4f8380['on']('execute',()=>{this['_isValid']()&&this['fire']('runReviewCheck',{'id':'custom','args':{'prompt':this['prompt'],'model':this['modelId']},'isCustom':!0x0});}),_0x4f8380;}['_createCancelButtonView'](){const _0xd859d=new Nt(this['locale']),t=this['locale']['t'];return _0xd859d['set']({'label':t('Cancel'),'withText':!0x0,'class':us}),_0xd859d['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x3f5698=>{_0x3f5698['stopPropagation']();})}}),_0xd859d['on']('execute',()=>{this['resetToDefault'](),this['fire']('closeCustomCheck');}),_0xd859d;}['_setModelList'](_0xc06094){this['_modelSelectionDropdownItems']['clear']();const _0xfb8e6e=this['_check']['models'];if(_0xc06094)this['set']('modelDisplayMode','hidden');else{const _0x3c8e0c=0x1===_0xfb8e6e['length'];this['set']('modelDisplayMode',_0x3c8e0c?'name':'selector');}if(this['resetToDefault'](),_0xfb8e6e?.['length']){0x1===_0xfb8e6e['length']&&this['set']('activeModelName',_0xfb8e6e[0x0]['name']||_0xfb8e6e[0x0]['id']);for(const _0x1804f5 of _0xfb8e6e){const _0x375e70=new Jt({'label':_0x1804f5['name'],'withText':!0x0,'role':'menuitemradio','id':_0x1804f5['id'],'model':_0x1804f5});_0x375e70['bind']('isOn')['to'](this,'modelId',_0x3b00d3=>_0x3b00d3===_0x1804f5['id']),this['_modelSelectionDropdownItems']['add']({'type':'button','model':_0x375e70,'labelView':new Ia(this['locale'],_0x1804f5)});}}}['_createModelSelectionDropdown'](){const _0x10f78b=Gt(this['locale']);return _0x10f78b['set']({'panelPosition':'se','class':'ck-ai_review__check-list-item-model-dropdown'}),_0x10f78b['buttonView']['set']({'label':this['_defaultLabel'],'withText':!0x0,'tooltip':!0x0,'class':us}),_0x10f78b['buttonView']['bind']('isVisible')['to'](this,'modelDisplayMode',_0x54c66d=>'selector'===_0x54c66d),this['listenTo'](_0x10f78b,'execute',_0x44d73e=>{this['modelId']=_0x44d73e['source']['model']['id'],_0x10f78b['buttonView']['label']=_0x44d73e['source']['label'];}),_0x10f78b;}['_createModelNameView'](){const _0x47c934=new Aa(this['locale']);return _0x47c934['bind']('text')['to'](this,'activeModelName',_0x273650=>_0x273650??''),_0x47c934['bind']('isVisible')['to'](this,'modelDisplayMode',_0x2422e6=>'name'===_0x2422e6),_0x47c934;}['_createActionsFooterView'](){const _0x2fb218=new vt(this['locale']);return _0x2fb218['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']]}]}),_0x2fb218;}}class Aa extends vt{constructor(_0x5afd42){super(_0x5afd42),this['set']('text',void 0x0),this['set']('isVisible',!0x0);const _0x3594f4=this['bindTemplate'];this['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai_review__check-list-item-model-name',_0x3594f4['if']('isVisible','ck-hidden',_0xe8b554=>!_0xe8b554)]},'children':[{'text':_0x3594f4['to']('text')}]});}}class Ia extends Mt{constructor(_0x33bdcb,_0x554334){super();const _0x1cbf86=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-button__label'],'style':_0x1cbf86['to']('style'),'id':_0x1cbf86['to']('id')},'children':[{'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-model-dropdown-name']},'children':[{'tag':'span','children':[{'text':_0x1cbf86['to']('text')}]}]},{'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-model-dropdown-description']},'children':[{'tag':'span','children':[_0x554334['description']||'']}]}]});}}class Ea extends Ht{['_formItemsCollection']=new _0x23af51();['_customCheckView']=null;['_hideModels']=!0x1;constructor(_0x3c82be,_0x166d97,_0x3a24d8,_0x22eeb3=!0x1){super(_0x3c82be),this['_hideModels']=_0x22eeb3,this['set']('isParametrizedViewOpen',!0x1),this['set']('isListItemRendered',!0x1),this['set']('isItemParametrized',_0x166d97['isParameterized']);const _0x5495cd=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',_0x2abcad=>_0x2abcad),this['bindTemplate']['if']('isListItemRendered','ck-ai_review__check-list-item_rendered',_0x294925=>_0x294925)],'style':{'--ck-ai-review-check-list-item-index':_0x3a24d8}},'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':_0x166d97['title']}]},_0x5495cd]},{'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-description']},'children':_0x166d97['description']?[{'text':_0x166d97['description']}]:[]}]}]},..._0x166d97['isParameterized']?[this['_createParameterizedView'](_0x166d97)]:[],...'custom'===_0x166d97['id']?[this['_createCustomView'](_0x166d97,this['_hideModels'])]:[]]}),this['on']('click',()=>{_0x166d97['isParameterized']?this['isParametrizedViewOpen']=!0x0:this['fire']('runReviewCheck',{'id':_0x166d97['id'],'args':_0x166d97['useArgs']?_0x166d97['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'](_0x1a8fa7=>{_0x1a8fa7['resetToDefault']();}),this['_customCheckView']&&this['_customCheckView']['resetToDefault']();}['_createIconView'](){const _0x5e770b=new xt();return _0x5e770b['content']=rt,_0x5e770b['extendTemplate']({'attributes':{'class':['ck-ai_review__check-list-item-title-icon']}}),_0x5e770b;}['_createParameterizedView'](_0x438998){const _0x1fb86f=new vt(),_0x3f2865=this['_createFormView'](_0x438998);return _0x1fb86f['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-parameterized',this['bindTemplate']['if']('isParametrizedViewOpen','ck-hidden',_0x3f07ce=>!_0x3f07ce)]},'children':[_0x3f2865]}),_0x1fb86f;}['_createFormView'](_0x3f7803){const _0x230a74=new vt(),_0x2202b2=Array['isArray'](_0x3f7803['options'])?_0x3f7803['options']:[],_0x1d8fc0=new Nt(this['locale']),t=this['locale']['t'];_0x1d8fc0['set']({'label':t('Submit'),'withText':!0x0,'class':cs}),_0x1d8fc0['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0xc0e03b=>{_0xc0e03b['stopPropagation']();})}}),_0x1d8fc0['on']('execute',()=>{const _0xdceb4c=[],_0x5d1887={};this['_formItemsCollection']['forEach'](_0x3fedd2=>{_0xdceb4c['push'](_0x3fedd2['value']),_0x3f7803['useArgs']&&_0x3f7803['options']&&(_0x5d1887[_0x3fedd2['argsKey']]=_0x3fedd2['value']);}),this['fire']('runReviewCheck',{'id':_0x3f7803['id'],'params':_0xdceb4c['length']?_0xdceb4c:void 0x0,'args':Object['keys'](_0x5d1887)['length']?_0x5d1887:void 0x0});});const _0x33ccc6=_0x2202b2['length'];return _0x2202b2['forEach']((_0x2087f,_0x53f2c7)=>{const _0x35440d=_0x53f2c7===_0x33ccc6-0x1;this['_formItemsCollection']['add'](new da(this['locale'],_0x2087f,_0x35440d?_0x1d8fc0:null));}),_0x230a74['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-parameterized-form']},'children':this['_formItemsCollection']}),_0x230a74;}['_createCustomView'](_0x3202c5,_0x5b4fc8=!0x1){return this['_customCheckView']=new ga(this['locale'],_0x3202c5,_0x5b4fc8),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',_0x325beb=>!_0x325beb)]}}),this['_customCheckView']['delegate']('runReviewCheck')['to'](this),this['listenTo'](this['_customCheckView'],'closeCustomCheck',()=>{this['isParametrizedViewOpen']=!0x1;}),this['on']('change:isParametrizedViewOpen',(_0x12d5f7,_0x51b9c7,_0x2b9288)=>{_0x2b9288||this['_customCheckView']['resetFormValidationStatus']();}),this['_customCheckView'];}}class pa extends Ht{['_checkViews'];constructor(_0x35e5ce){super(_0x35e5ce),this['_checkViews']=new _0x23af51(),this['_setupTemplate']();}['setChecks'](_0x52d49f,_0x57b2b4=!0x1){this['_checkViews']['clear']();for(const [_0x94ff8d,_0x1d4ed0]of _0x52d49f['entries']()){const _0x3203fe=new Ea(this['locale'],_0x1d4ed0,_0x94ff8d,_0x57b2b4);_0x3203fe['delegate']('runReviewCheck')['to'](this),this['_checkViews']['add'](_0x3203fe);}}['hasChecks'](){return this['_checkViews']['length']>0x0;}['resetAllParameterizedChecks'](){for(const _0x2c7ac1 of this['_checkViews'])_0x2c7ac1 instanceof Ea&&_0x2c7ac1['resetToDefault']();}['_setupTemplate'](){const _0x1e05cb=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-list',_0x1e05cb['if']('isVisible','ck-hidden',_0x58e160=>!_0x58e160)]},'children':this['_checkViews']});}}class ma extends ra{static get['pluginName'](){return'AIReviewModeUI';}['createMainView'](){const _0x599544=this['context']['plugins']['get']('AITabs'),_0x101709=this['context']['locale'],_0x548acc=new eo(_0x101709,{'label':hs(_0x101709,'AI_REVIEW_MODE'),'icon':_0x4a5506,'class':'ck-ai-header_review','showResizeButton':_0x599544['showResizeButton']});return _0x548acc['delegate']('resizeTabs')['to'](_0x599544),_0x548acc['bind']('isMaximized')['to'](_0x599544['view'],'isMaximized',_0x314ec0=>_0x314ec0),new aa(this['context']['locale'],{'header':_0x548acc,'list':new pa(_0x101709),'results':new ca(_0x101709,{'generalErrorText':hs(_0x101709,'AI_REVIEW_MODE_GENERAL_ERROR_MESSAGE')}),'completed':new la(_0x101709,{'headerText':hs(_0x101709,'AI_REVIEW_MODE_FINISH_REVIEW_HEADER_TITLE'),'emptyResultsText':hs(_0x101709,'AI_REVIEW_MODE_EMPTY_RESULTS_TEXT'),'buttonText':hs(_0x101709,'AI_REVIEW_MODE_FINISH_REVIEW_BUTTON_LABEL')})});}['registerTab'](){const _0x59301e=this['context']['plugins']['get']('AITabs');_0x59301e['view']['on']('activateTab',(_0x3c7ee2,{newTab:_0x5aead2,oldTab:_0x4b38e7})=>{'reviewMode'===_0x5aead2?this['fire']('getReviewCheckList'):'reviewMode'===_0x4b38e7&&this['fire']('leaveReview');}),_0x59301e['view']['addTab']({'id':'reviewMode','buttonLabel':hs(this['context']['locale'],'AI_REVIEW_MODE'),'buttonIcon':_0x4a5506,'order':0x0,'content':this['_mainView']});}}const Ta='review-',Ca=['softBreak'];class wa extends _0x173dbd{static get['requires'](){return[_0x47efd0,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(_0x22160a){super(_0x22160a),this['_domEmitter']=new(Ot())(),this['_eventEmitter']=new(Tt())();}get['emitter'](){return this['_eventEmitter'];}['afterInit'](){const _0x1255bc=_0x3dabee=>this['_scheduleAttachReviewEditingToEditor'](_0x3dabee);if(this['_registerGlobalBalloonBlurHandler'](),this['context']instanceof _0x2ef8df)return void this['_attachReviewEditingToEditor'](this['context']);const _0x212d41=this['context'];for(const _0x350ee2 of _0x212d41['editors'])_0x1255bc(_0x350ee2);this['listenTo'](_0x212d41['editors'],'add',(_0xbf7898,_0x2a316c)=>{_0x1255bc(_0x2a316c);}),this['listenTo'](_0x212d41['editors'],'remove',(_0x17c1cd,_0x3b76fc)=>{for(const [_0x13d638,_0x3c61d2]of this['_markers'])_0x3c61d2['editor']===_0x3b76fc&&(this['_eventEmitter']['fire']('changeMarkerRemoved',{'markerId':_0x13d638,'changeId':_0x3c61d2['groupId']}),this['_markers']['delete'](_0x13d638));});}['_scheduleAttachReviewEditingToEditor'](_0x2e2833){const _0x1a996e=()=>{'destroyed'!==_0x2e2833['state']&&_0x2e2833['conversion']&&this['_attachReviewEditingToEditor'](_0x2e2833);};if('ready'===_0x2e2833['state'])return void _0x1a996e();const _0x15f3e7=()=>{this['stopListening'](_0x2e2833,'ready',_0x15f3e7),_0x1a996e();};this['listenTo'](_0x2e2833,'ready',_0x15f3e7);}['_attachReviewEditingToEditor'](_0x47edc8){this['_reviewEditingAttachedEditors']['has'](_0x47edc8)||(_0x47edc8['conversion']['for']('editingDowncast')['markerToElement']({'model':Ta+'insert','view':(_0x43d8c2,{writer:_0x2d73b2})=>{const _0x37ff5c=this['_markers']['get'](_0x43d8c2['markerName']),_0x773e1f={'class':'ck-ai_review-marker_add'+(this['_activeMarkers']['has'](_0x37ff5c?.['id']||'')?'\x20ck-ai_review__change_active':''),'data-marker-id':_0x43d8c2['markerName']};return _0x2d73b2['createUIElement']('span',_0x773e1f,function(_0x19a47b){const _0x137266=this['toDomElement'](_0x19a47b);return _0x137266['innerHTML']=_0x37ff5c?.['content']?.['asString']||'',_0x137266;});}}),_0x47edc8['conversion']['for']('editingDowncast')['markerToHighlight']({'model':Ta+'remove-only','view':_0x40636f=>{const _0x5c3fbd=this['_markers']['get'](_0x40636f['markerName']),_0x412003=['ck-ai_review-marker_strikethrough'];return this['_activeMarkers']['has'](_0x5c3fbd?.['id']||'')&&_0x412003['push']('ck-ai_review__change_active'),{'classes':_0x412003,'attributes':{'data-marker-id':_0x40636f['markerName']}};}}),_0x47edc8['conversion']['for']('editingDowncast')['markerToHighlight']({'model':Ta+'remove-context','view':_0x52b8e7=>{const _0x2dd5ad=this['_markers']['get'](_0x52b8e7['markerName']),_0x3c07d6=['ck-ai_review-marker_underline'];return this['_activeMarkers']['has'](_0x2dd5ad?.['id']||'')&&_0x3c07d6['push']('ck-ai_review__change_active'),{'classes':_0x3c07d6,'attributes':{'data-marker-id':_0x52b8e7['markerName']}};}}),_0x47edc8['conversion']['for']('editingDowncast')['markerToHighlight']({'model':Ta+'remove-text','view':_0xe3a867=>{const _0x12ccac=this['_markers']['get'](_0xe3a867['markerName']),_0x586d19=['ck-ai_review-marker_hide'];return this['_activeMarkers']['has'](_0x12ccac?.['id']||'')&&_0x586d19['push']('ck-ai_review__change_active'),{'classes':_0x586d19,'attributes':{'data-marker-id':_0xe3a867['markerName']}};}}),_0x47edc8['conversion']['for']('dataDowncast')['markerToElement']({'model':Ta+'suggestion-context','view':(_0x265bb0,{writer:_0x45f77d})=>_0x45f77d['createRawElement']('span',{'class':'ck-ai_review-marker_context-'+(_0x265bb0['isOpening']?'start':'end')})}),_0x47edc8['conversion']['for']('downcast')['attributeToAttribute']({'model':_0x138817,'view':_0x6099dd}),this['_updateMouseMarkerInteractionListeners'](_0x47edc8),this['listenTo'](_0x47edc8,'addRoot',()=>this['_updateMouseMarkerInteractionListeners'](_0x47edc8),{'priority':'lowest'}),this['listenTo'](_0x47edc8,'detachRoot',()=>this['_updateMouseMarkerInteractionListeners'](_0x47edc8),{'priority':'lowest'}),_0x47edc8['model']['document']['registerPostFixer'](_0x3f476b=>this['_validateMarkers'](_0x47edc8,_0x3f476b)),_0x47edc8['model']['document']['on']('change',()=>this['_handleMarkerChanges'](_0x47edc8)),this['_reviewEditingAttachedEditors']['add'](_0x47edc8));}['_updateMouseMarkerInteractionListeners'](_0x3f8f64){let _0xe1428e=this['_boundEditables']['get'](_0x3f8f64);_0xe1428e||(_0xe1428e=new Map(),this['_boundEditables']['set'](_0x3f8f64,_0xe1428e));const _0x21e75f=new Set(_0x3f8f64['ui']['getEditableElementsNames']());for(const _0x55a415 of _0x21e75f){if(_0xe1428e['has'](_0x55a415))continue;const _0x349e79=_0x3f8f64['ui']['getEditableElement'](_0x55a415);_0xe1428e['set'](_0x55a415,_0x349e79),this['_attachMouseMarkerInteractionListeners'](_0x349e79);}for(const [_0x4c3c86,_0x42b2f2]of _0xe1428e)_0x21e75f['has'](_0x4c3c86)||(_0xe1428e['delete'](_0x4c3c86),this['_domEmitter']['stopListening'](_0x42b2f2));}['_attachMouseMarkerInteractionListeners'](_0x1561e4){this['_domEmitter']['listenTo'](_0x1561e4,'mouseup',(_0x89a9da,_0x34c3ec)=>{const _0x2a302b=_0x34c3ec['target'],_0x502596=this['_findMarkerElement'](_0x2a302b);if(!_0x502596)return;const _0x4236b8=_0x502596['getAttribute']('data-marker-id'),_0xe528e4=_0x4236b8['split'](':')['pop']()?.['split']('_')[0x0];this['_eventEmitter']['fire']('changeMarkerClicked',{'markerId':_0x4236b8,'changeId':_0xe528e4,'markerElement':()=>this['_findMarkerElementById'](_0x4236b8),'domEvent':_0x34c3ec});},{'usePassive':!0x0,'priority':'highest'}),this['_domEmitter']['listenTo'](_0x1561e4,'mouseover',(_0x5df60e,_0x225a7a)=>{const _0x2ac039=_0x225a7a['target'],_0x36a754=_0x225a7a['relatedTarget'];let _0x216de1=this['_findMarkerElement'](_0x2ac039);if(!_0x216de1&&_0x36a754&&(_0x216de1=this['_findMarkerElement'](_0x36a754)),!_0x216de1)return;const _0x2f7529=_0x216de1['getAttribute']('data-marker-id'),_0xab0978=_0x2f7529['split'](':')['pop']()?.['split']('_')[0x0];this['_eventEmitter']['fire']('changeMarkerHovered',{'changeId':_0xab0978,'markerElement':()=>this['_findMarkerElementById'](_0x2f7529),'domEvent':_0x225a7a});});}['_registerGlobalBalloonBlurHandler'](){this['_domEmitter']['listenTo'](document,'mouseover',_0x12ff54((_0x5e2cf4,_0x37fbf2)=>{const _0x43b964=_0x37fbf2['target'];if(this['_findMarkerElement'](_0x43b964))return;_0x43b964['closest']('.ck-reset.ck-ai_review-balloon-panel-suggestion')||this['_eventEmitter']['fire']('changeMarkerBlurred');},0xc8));}['getDocumentData'](){const _0x5cabf1=this['context']['plugins']['get']('AIEditing'),_0x5ceb2d=Ws(this['context']);if(!_0x5ceb2d['length'])throw new at('ai-get-editor-from-context-no-editor',this);const _0x4f282e=new Set(),_0xedf505=[],_0x1a8750=new Map();for(const _0x293c6a of _0x5ceb2d)for(const _0x3b0c13 of _0x293c6a['model']['document']['getRoots']()){if('$graveyard'===_0x3b0c13['rootName'])continue;const _0x456a3a=this['_buildDocumentDataSliceForRoot'](_0x293c6a,_0x3b0c13,_0x5cabf1,_0x4f282e);_0xedf505['push'](_0x456a3a['content']);for(const [_0x9ca790,_0x3aceb2]of _0x456a3a['elements'])_0x1a8750['set'](_0x9ca790,_0x3aceb2);}return{'elements':_0x1a8750,'content':_0xedf505['join']('')};}['_buildDocumentDataSliceForRoot'](_0xc340fc,_0x230593,_0x11786a,_0x56da2f){const _0x499760=_0xc340fc['model'],_0x7cf0f5=new _0x569183();for(const _0x5798d5 of _0x230593['getChildren']())_0x7cf0f5['_appendChild'](_0x5798d5['_clone'](!0x0));for(const _0x3d29b7 of _0x499760['markers']){const _0x4364fa=_0x3d29b7['getRange']();_0x4364fa&&_0x4364fa['root']['rootName']===_0x230593['rootName']&&_0x7cf0f5['markers']['set'](_0x3d29b7['name'],this['_changeRangeOwnerDocument'](_0x4364fa['clone'](),_0x7cf0f5));}const _0x3b2d14=new Map(),_0x59cbf5=_0x499760['document']['version'],_0x3333ad=new _0x342db9({'ignoreElementEnd':!0x0,'startPosition':_0x499760['createPositionAt'](_0x7cf0f5,0x0)});for(const {item:_0x2904ae}of _0x3333ad){if(!_0x2904ae['is']('$textProxy'))continue;const _0x34d493=_0x2904ae['parent'];if(!_0x34d493||!_0x34d493['is']('element'))continue;const _0x2ff396=this['_upsertDataId'](_0x34d493,()=>_0x11786a['_nextDataId'](_0x56da2f));_0x56da2f['add'](_0x2ff396);for(const _0x3b80ab of _0x34d493['getChildren']())_0x3b80ab['is']('element')&&(_0x3b80ab['name']&&Ca['includes'](_0x3b80ab['name'])||_0x56da2f['add'](this['_upsertDataId'](_0x3b80ab,()=>_0x11786a['_nextDataId'](_0x56da2f))));let _0x21076e=_0x34d493;for(;_0x21076e['parent']&&!_0x21076e['parent']['is']('documentFragment');)_0x21076e=_0x21076e['parent'],_0x21076e['hasAttribute'](_0x138817)&&_0x21076e['_removeAttribute'](_0x138817);_0x3b2d14['set'](_0x2ff396,{'editor':_0xc340fc,'rootName':_0x230593['rootName'],'path':_0x34d493['getPath'](),'documentVersion':_0x59cbf5,'getContent':this['_createGetContentUsingDataIdFn'](_0x21076e['_clone'](!0x0),_0x2ff396,_0xc340fc['data'])}),_0x3333ad['jumpTo'](_0x499760['createPositionAfter'](_0x34d493));}return{'content':_0xc340fc['data']['processor']['toData'](_0xc340fc['data']['toView'](_0x7cf0f5)),'elements':_0x3b2d14};}['diffContent'](_0xca3621,_0x58bea3,_0x115808,_0x2e7e11=!0x1){const _0x130ea9=[],_0x4ef5c7=_0xca3621['data']['parse'](_0x115808,'$documentFragment'),_0x3a888a=_0xca3621['data']['parse'](_0x58bea3,'$documentFragment'),_0x2127ab=_0xca3621['model']['createPositionAt'](_0x3a888a,0x0);if(this['_haveSingleTopLevelElement'](_0x4ef5c7)){if(!this['_hasSameTopLevelElement'](_0x3a888a,_0x4ef5c7))return _0x130ea9;}else{const _0x5009f1=_0xca3621['model']['schema'];if(!this['_haveOnlyInlineContent'](_0x3a888a,_0x5009f1)||!this['_haveOnlyInlineContent'](_0x4ef5c7,_0x5009f1))return _0x130ea9;}const _0x306b5c=this['context']['plugins']['get']('DocumentCompare')['getDiff'](_0x58bea3,_0x115808,{'targetEditor':_0xca3621,'anchor':_0x2127ab,'markDeletions':!0x0})['getOperations']()['filter'](_0x1c48f0=>'insert'===_0x1c48f0['type']||'marker'===_0x1c48f0['type']&&_0x1c48f0['name']['startsWith']('$markedRemove')),_0x32d8f3=this['_groupAdjacentOperations'](_0x306b5c),_0x381359=[];if(_0x2e7e11){if(_0x32d8f3['length']){const _0x416529=_0x32d8f3[0x0]['operations'][0x0],_0x2fbb26='insert'===_0x416529['type']?_0x416529['position']:_0x416529['newRange']['start'],_0x584690=this['_getPositionLimitingRange'](_0x2fbb26,_0xca3621,'inside'),_0x4ee3eb=_0x584690?_0x4ef5c7['getChild'](0x0)['getChildren']():_0x4ef5c7['getChildren'](),_0x5c16ef=_0x584690||_0xca3621['model']['createRangeIn'](_0x3a888a),_0x18ca1a=[new _0x437745('$markedRemove:synthetic'+ot(),null,_0x5c16ef,_0xca3621['model']['document']['model']['markers'],!0x0,_0xca3621['model']['document']['version']+0x1),new _0x2038eb(_0x5c16ef['end'],_0x4ee3eb,_0xca3621['model']['document']['version']+0x2)];_0x381359['push']({'operations':_0x18ca1a,'operationsIsolated':_0x18ca1a,'groupOffset':0x0});}}else _0x381359['push'](..._0x32d8f3);let _0x4df397=0x0;return _0xca3621['model']['change'](_0x67541e=>{for(let _0x59a2f3=0x0;_0x59a2f3<_0x381359['length'];_0x59a2f3++){const _0x31700d=_0x381359[_0x59a2f3],_0x1a4264=_0x67541e['createDocumentFragment']();for(const _0x2b3ee1 of _0x3a888a['getChildren']())_0x67541e['append'](_0x2b3ee1['_clone'](!0x0),_0x1a4264);for(const _0x57c2f9 of _0x31700d['operationsIsolated'])if('insert'===_0x57c2f9['type']){const _0x4bdd20=_0x57c2f9;_0x4bdd20['baseVersion']=null,_0x4bdd20['isDocumentOperation']=!0x1,this['_changeOperationOwnerDocument'](_0x4bdd20,_0x1a4264),_0x67541e['batch']['addOperation'](_0x57c2f9),_0xca3621['model']['applyOperation'](_0x57c2f9);const _0x5f5663='suggestion:insertion:id:authorId:'+_0x4df397++,_0x1ed0a8=_0xca3621['model']['createRange'](_0x4bdd20['position'],_0x4bdd20['position']['getShiftedBy'](_0x4bdd20['howMany']));_0x1a4264['markers']['set'](_0x5f5663,_0x1ed0a8);}else{if('marker'===_0x57c2f9['type']&&_0x57c2f9['name']['startsWith']('$markedRemove')){const _0x16ec10=_0x57c2f9,_0x338f38='suggestion:deletion:id:authorId:'+_0x4df397++;this['_changeOperationOwnerDocument'](_0x16ec10,_0x1a4264),_0x1a4264['markers']['set'](_0x338f38,_0x16ec10['newRange']);}}if(_0x2e7e11)_0x130ea9['push']({..._0x31700d,'context':this['_createGetContentFn'](_0x3a888a,_0xca3621['data']),'content':this['_createGetContentFn'](_0x3a888a,_0xca3621['data'])});else{const _0x1aacc9=this['_getChangeContext'](this['_changePositionOwnerDocument'](this['_getOperationStart'](_0x31700d['operationsIsolated'][0x0]),_0x1a4264),this['_changePositionOwnerDocument'](this['_getOperationEnd'](_0x31700d['operationsIsolated'][_0x31700d['operationsIsolated']['length']-0x1]),_0x1a4264),_0xca3621);_0x1a4264['markers']['set'](Ta+'suggestion-context',new _0x5ca4e8(_0x1aacc9['start'],_0x1aacc9['end'])),_0x130ea9['push']({..._0x31700d,'context':this['_createGetContextFn'](_0x1a4264,_0xca3621['data'],{'ellipsisBefore':_0x1aacc9['hasContentBefore'],'ellipsisAfter':_0x1aacc9['hasContentAfter']}),'content':this['_createGetContentFn'](_0x1a4264,_0xca3621['data'])});}}}),_0x130ea9;}['markChangePositionInEditorContent'](_0x167eb5,_0x3ab323){if(!_0x167eb5['length'])return;const _0x42b365=_0x167eb5[0x0]['parent']['id'],_0x340e80=_0x3ab323['elements']['get'](_0x42b365);if(!_0x340e80)return void console['warn']('No\x20element\x20found\x20for\x20ID:\x20'+_0x42b365);const _0x3e8206=_0x340e80['path'],_0x258d8b=_0x340e80['editor'],_0x428cd9=_0x258d8b['model']['document']['getRoot'](_0x340e80['rootName']);if(!_0x428cd9)return void console['warn']('No\x20model\x20root\x20found\x20for\x20name:\x20'+_0x340e80['rootName']);const _0x20fa1d=_0x258d8b['model']['document']['history']['getOperations'](_0x340e80['documentVersion']),_0x5b2d30=[];for(const _0x1ba502 of _0x167eb5){const _0x20afeb=_0x1ba502['operationsIsolated']['map'](_0x31afbf=>this['_translateOperationToEditorContent'](_0x31afbf,_0x3e8206,_0x428cd9));if(!_0x20afeb||!_0x20afeb['length'])continue;const _0x36b270=_0x20afeb['every'](_0x48faed=>'marker'===_0x48faed['type']&&_0x48faed['name']['startsWith']('$markedRemove')),_0x59dca7={'document':_0x258d8b['model']['document'],'useRelations':!0x1,'padWithNoOps':!0x1},_0x478f75=_0x261504(_0x20afeb,_0x20fa1d,_0x59dca7)['operationsA'];for(const _0x5319e4 of _0x478f75)if('insert'===_0x5319e4['type']){const _0x5d8bfe=_0x5319e4,_0x30a5e0=_0x5d8bfe['nodes'];_0x258d8b['model']['change'](_0x67de56=>{const _0x3c4676=_0x67de56['createDocumentFragment']();for(const _0x353141 of _0x30a5e0)_0x67de56['append'](_0x353141['_clone'](!0x0),_0x3c4676);_0x5b2d30['push']({'start':_0x5d8bfe['position'],'end':_0x5d8bfe['position'],'type':'insert','groupId':_0x1ba502['id'],'content':{'asString':this['_createGetContentFn'](_0x3c4676,_0x258d8b['data'])(),'asFragment':_0x3c4676}});});}else{if('marker'===_0x5319e4['type']&&_0x5319e4['name']['startsWith']('$markedRemove')){const _0x126633=_0x5319e4;let _0x45f76c='remove-text';if(_0x36b270){const _0x48bfde=this['_findAdjacentContextDistance'](_0x126633['newRange']['start'],'backward',_0x258d8b['model']['schema']),_0x167616=this['_findAdjacentContextDistance'](_0x126633['newRange']['end'],'forward',_0x258d8b['model']['schema']);if(_0x48bfde||_0x167616){const _0x3a8182=_0x126633['newRange']['start']['getShiftedBy'](-_0x48bfde),_0x163e49=_0x126633['newRange']['end']['getShiftedBy'](_0x167616);_0x5b2d30['push']({'start':_0x3a8182,'end':_0x163e49,'groupId':_0x1ba502['id'],'type':'remove-context'});}else _0x45f76c='remove-only';}_0x5b2d30['push']({'start':_0x126633['newRange']['start'],'end':_0x126633['newRange']['end'],'groupId':_0x1ba502['id'],'type':_0x45f76c});}}}this['_insertMarkers'](_0x5b2d30,_0x258d8b);}['clearAllMarkers'](){const _0x4b5219=new Map();for(const _0x32a818 of this['_markers']['keys']()){const _0x285540=this['_markers']['get'](_0x32a818);_0x285540?.['editor']&&(_0x4b5219['has'](_0x285540['editor'])||_0x4b5219['set'](_0x285540['editor'],[]),_0x4b5219['get'](_0x285540['editor'])['push'](_0x32a818));}for(const [_0x49e9e7,_0x1f91f4]of _0x4b5219)_0x49e9e7['model']['change'](_0x2d2f38=>{for(const _0x5c06f3 of _0x1f91f4)_0x49e9e7['model']['markers']['get'](_0x5c06f3)&&_0x2d2f38['removeMarker'](_0x5c06f3);});this['_markers']['clear'](),this['_activeMarkers']['clear']();}['switchToReadOnly'](){for(const _0x4d4310 of Ws(this['context']))_0x4d4310['enableReadOnlyMode']('ai-review');}['switchToEdit'](){for(const _0x280550 of Ws(this['context']))_0x280550['disableReadOnlyMode']('ai-review');}['applyChange'](_0x2b4d2f){const _0x3f9d1d=_0x2b4d2f['map'](_0x186571=>this['_getMarkersDataForGroup'](_0x186571))['flat'](),_0x79dfc2=new Map();for(const _0x5d7305 of _0x3f9d1d)_0x79dfc2['has'](_0x5d7305['editor'])||_0x79dfc2['set'](_0x5d7305['editor'],[]),_0x79dfc2['get'](_0x5d7305['editor'])['push'](_0x5d7305);for(const [_0x2da193,_0xa109d3]of _0x79dfc2){const _0x31877c=_0x2da193['model'];_0x31877c['change'](_0x1e0759=>{for(const _0x537720 of _0xa109d3){const _0x4c604b=_0x2da193['model']['markers']['get'](_0x537720['id']);if(_0x4c604b){if('insert'===_0x537720['type']){if(!_0x537720['content'])continue;_0x31877c['insertContent'](_0x537720['content']['asFragment']||null,_0x4c604b['getRange']()['start']);}else'remove-text'!==_0x537720['type']&&'remove-only'!==_0x537720['type']||_0x31877c['deleteContent'](_0x31877c['createSelection'](_0x4c604b['getRange']()));_0x1e0759['removeMarker'](_0x537720['id']),this['_markers']['delete'](_0x537720['id']);}}});}}['rejectChange'](_0x5f44bb){const _0x475a41=this['_getMarkersDataForGroup'](_0x5f44bb),_0x743462=new Map();for(const _0x471f31 of _0x475a41)_0x743462['has'](_0x471f31['editor'])||_0x743462['set'](_0x471f31['editor'],[]),_0x743462['get'](_0x471f31['editor'])['push'](_0x471f31);for(const [_0x1ee0ff,_0x5e4577]of _0x743462)_0x1ee0ff['model']['change'](_0x42437e=>{for(const _0x107469 of _0x5e4577)_0x42437e['removeMarker'](_0x107469['id']),this['_markers']['delete'](_0x107469['id']);});}['getEditor'](){return $s(this['context']);}['getEditors'](){return Ws(this['context']);}['getEditorForChange'](_0x5df28f){const _0x36a175=this['_getMarkersDataForGroup'](_0x5df28f);return _0x36a175[0x0]?.['editor'];}['getMarkerElementForChange'](_0x3a6545){const _0x4b2fa9=Array['from'](this['_markers']['values']())['filter'](_0x46efc6=>_0x46efc6['groupId']===_0x3a6545);if(!_0x4b2fa9['length'])return null;const _0x3044d4=0x1===_0x4b2fa9['length']?_0x4b2fa9[0x0]:this['_sortMarkers'](_0x4b2fa9)[0x0],_0x5503b2=_0x3044d4['editor']['model']['markers']['get'](_0x3044d4['id']);if(!_0x5503b2)return null;return{'modelRange':_0x5503b2['getRange'](),'getElement':()=>this['_findMarkerElementById'](_0x3044d4['id'])};}['getContentElementForChange'](_0x48338a){const _0x2bc922=Array['from'](this['_markers']['values']())['filter'](_0x347061=>_0x347061['groupId']===_0x48338a);if(!_0x2bc922['length'])return null;const _0x27461b=0x1===_0x2bc922['length']?_0x2bc922[0x0]:this['_sortMarkers'](_0x2bc922)[0x0],_0xcc645e=_0x27461b['editor'],_0x45fef8=_0xcc645e['model']['markers']['get'](_0x27461b['id']);if(!_0x45fef8)return null;const _0x3d4f15=_0x45fef8['getRange'](),_0x8b06a4=_0xcc645e['editing']['view']['getDomRoot'](_0x3d4f15['root']['rootName'])||_0xcc645e['editing']['view']['getDomRoot']();if(!_0x8b06a4||!_0x3d4f15)return null;let _0x345b89=_0x3d4f15['start']['parent'];for(;_0x345b89['parent']&&'$root'!==_0x345b89['parent']['name'];)_0x345b89=_0x345b89['parent'];if(!_0x345b89||!_0x345b89['name'])return null;const _0x4ce9ca=_0x8b06a4['querySelector']('[data-marker-id=\x22'+_0x27461b['id']+'\x22]');if(!_0x4ce9ca)return null;let _0x597588=null;_0xcc645e['model']['change'](_0x532668=>{_0x597588=_0x532668['createDocumentFragment'](),_0x532668['append'](_0x345b89['_clone'](!0x0),_0x597588);});const _0x5da39a=_0xcc645e['data']['toView'](_0x597588)['getChild'](0x0);return _0x4ce9ca['closest'](_0x5da39a['name']);}['reactivateMarkers'](_0x1c4b10){const _0x4bcd19=this['_getMarkersDataForGroup'](_0x1c4b10);if(!_0x4bcd19['length'])return;const _0x56a6be=Array['from'](this['_activeMarkers'])['sort'](),_0x3c73a1=Array['from'](new Set(_0x4bcd19['map'](_0x24bdf2=>_0x24bdf2['id'])))['sort']();_0x56a6be['join']('|')!==_0x3c73a1['join']('|')&&(this['setAllMarkersAsInactive'](),this['setMarkersInElementAsActive'](_0x1c4b10));}['setMarkersInElementAsActive'](_0x34f309){const _0x1d9c05=this['_getMarkersDataForGroup'](_0x34f309);if(!_0x1d9c05['length'])return;const _0x109cc4=_0x1d9c05[0x0]['editor'],_0x2d7400=new Set(_0x1d9c05['map'](_0x24ac07=>_0x24ac07['id'])),_0x15bcf2=Array['from'](_0x2d7400['values']())['map'](_0x23672f=>_0x109cc4['model']['markers']['get'](_0x23672f))['filter'](_0xcff7f4=>!!_0xcff7f4);_0x2d7400['forEach'](_0xcb7b0c=>{this['_activeMarkers']['add'](_0xcb7b0c);}),_0x109cc4['model']['change'](()=>{_0x15bcf2['forEach'](_0x3a913d=>{_0x109cc4['editing']['reconvertMarker'](_0x3a913d);});});}['setAllMarkersAsInactive'](){const _0x22489d=Array['from'](this['_activeMarkers']);if(!_0x22489d['length'])return;this['_activeMarkers']['clear']();const _0xdfaeb3=new Map();for(const _0x96d26f of _0x22489d){const _0x4ed5e9=this['_markers']['get'](_0x96d26f);if(!_0x4ed5e9)continue;const _0x55095f=_0x4ed5e9['editor'],_0x415034=_0x55095f['model']['markers']['get'](_0x96d26f);_0x415034&&(_0xdfaeb3['has'](_0x55095f)||_0xdfaeb3['set'](_0x55095f,[]),_0xdfaeb3['get'](_0x55095f)['push'](_0x415034));}for(const [_0x227c6f,_0x585371]of _0xdfaeb3)_0x227c6f['model']['change'](()=>{_0x585371['forEach'](_0x2359b4=>{_0x227c6f['editing']['reconvertMarker'](_0x2359b4);});});}['_getPositionLimitingRange'](_0x382266,_0x4aef4e,_0x574a0c='outside'){if(!_0x382266)return null;let _0x1939d8=_0x382266['parent'];for(;_0x1939d8&&_0x1939d8['parent']&&'$root'!==_0x1939d8['parent']['name']&&!_0x4aef4e['model']['schema']['isLimit'](_0x1939d8)&&!_0x4aef4e['model']['schema']['isBlock'](_0x1939d8);)_0x1939d8=_0x1939d8['parent'];if(!_0x1939d8||!_0x1939d8['name']||'$root'===_0x1939d8['name'])return null;let _0x38a1df=null;return _0x4aef4e['model']['change'](_0x109ef7=>{_0x38a1df='inside'===_0x574a0c?_0x109ef7['createRangeIn'](_0x1939d8):_0x109ef7['createRangeOn'](_0x1939d8);}),_0x38a1df;}['_validateMarkers'](_0x26df95,_0x3b5d3f){const _0x48b700=Array['from'](this['_markers']['keys']()),_0x39ebfd=new Map();for(const _0x49a92b of _0x48b700){const _0x188483=_0x26df95['model']['markers']['get'](_0x49a92b);if(!_0x188483)continue;const _0x13bc1f=_0x188483['getStart']()['root']['rootName']+':'+_0x188483['getStart']()['path'][0x0];_0x39ebfd['has'](_0x13bc1f)||_0x39ebfd['set'](_0x13bc1f,[]),_0x39ebfd['get'](_0x13bc1f)['push'](_0x188483);}const _0x2af182=new Set();for(const _0x9ea4a3 of _0x26df95['model']['document']['differ']['getChanges']()){let _0x3b387c='',_0x76f8c7=null;if('insert'===_0x9ea4a3['type'])_0x76f8c7=new _0x5ca4e8(_0x9ea4a3['position'],_0x9ea4a3['position']['getShiftedBy'](_0x9ea4a3['length'])),_0x3b387c=_0x9ea4a3['position']['root']['rootName']+':'+_0x9ea4a3['position']['path'][0x0];else{if('remove'!==_0x9ea4a3['type'])continue;_0x76f8c7=new _0x5ca4e8(_0x9ea4a3['position']),_0x3b387c=_0x9ea4a3['position']['root']['rootName']+':'+_0x9ea4a3['position']['path'][0x0];}const _0x516ae1=_0x39ebfd['get'](_0x3b387c)||[];if(_0x516ae1['length']){for(const _0x4b4c15 of _0x516ae1)if(_0x76f8c7['root']['rootName']===_0x4b4c15['getRange']()['root']['rootName']&&('insert'!==_0x9ea4a3['type']||!_0x76f8c7['containsRange'](_0x4b4c15['getRange']()))&&(_0x76f8c7['isIntersecting'](_0x4b4c15['getRange']())||_0x76f8c7['start']['isTouching'](_0x4b4c15['getRange']()['end'])||_0x76f8c7['end']['isTouching'](_0x4b4c15['getRange']()['start']))){const _0x172ad6=this['_parseMarkerName'](_0x4b4c15['name']);Array['from'](this['_markers']['values']())['filter'](_0x4e0735=>_0x4e0735['groupId']===_0x172ad6['groupId'])['forEach'](_0x2a8cf8=>_0x2af182['add'](_0x2a8cf8['id']));}}}if(_0x2af182['size']){for(const _0x4e030f of _0x2af182)_0x3b5d3f['removeMarker'](_0x4e030f);return!0x0;}return!0x1;}['_handleMarkerChanges'](_0x4f0cf6){for(const {name:_0x598a01,data:_0x29d735}of _0x4f0cf6['model']['document']['differ']['getChangedMarkers']()){if(!_0x598a01['startsWith'](Ta))continue;const _0x22cf2c=_0x29d735['oldRange'],_0x19c3ff=_0x29d735['newRange'],_0x52140f=_0x22cf2c&&'$graveyard'===_0x22cf2c['root']['rootName'],_0x253edc=_0x19c3ff&&'$graveyard'===_0x19c3ff['root']['rootName'];if(_0x52140f&&_0x253edc)continue;const _0x4a37ec=this['_parseMarkerName'](_0x598a01);this['_markers']['get'](_0x598a01)&&(_0x253edc||!_0x19c3ff?this['_eventEmitter']['fire']('changeMarkerRemoved',{'markerId':_0x598a01,'changeId':_0x4a37ec['groupId']}):_0x52140f&&_0x19c3ff&&this['_eventEmitter']['fire']('changeMarkerRestored',{'markerId':_0x598a01,'changeId':_0x4a37ec['groupId']}));}}['_parseMarkerName'](_0x2fc20b){const _0x1bfac6=_0x2fc20b['split'](':'),_0x2340ce=(_0x1bfac6[0x1]||'')['split']('_');return{'prefix':_0x1bfac6[0x0],'groupId':_0x2340ce[0x0],'suffix':_0x2340ce[0x1]};}['_translateOperationToEditorContent'](_0x172ccd,_0x35de4d,_0x2a8f94){if('insert'===_0x172ccd['type']){const _0x57dbcf=_0x172ccd;return new _0x2038eb(this['_changePosition'](_0x35de4d['concat'](_0x57dbcf['position']['offset']),_0x2a8f94),_0x57dbcf['nodes'],_0x57dbcf['baseVersion']);}if('marker'===_0x172ccd['type']&&_0x172ccd['name']['startsWith']('$markedRemove')){const _0x5b64f6=_0x172ccd;return new _0x437745(_0x5b64f6['name'],_0x5b64f6['oldRange'],this['_changeRange'](_0x5b64f6['newRange'],_0x35de4d['concat'](_0x5b64f6['newRange']['start']['offset']),_0x35de4d['concat'](_0x5b64f6['newRange']['end']['offset']),_0x2a8f94),_0x5b64f6['_markers'],_0x5b64f6['affectsData'],_0x5b64f6['baseVersion']);}return _0x172ccd;}['_groupAdjacentOperations'](_0x45ccac){if(!_0x45ccac['length'])return[];const _0x1bc777=[];let _0xb7393a=0x0,_0x2d423d=0x0,_0x4bb99=[];for(let _0x3f6706=0x0;_0x3f6706<=_0x45ccac['length'];_0x3f6706++){const _0x5b7f7a=_0x45ccac[_0x3f6706],_0x21e0f8=_0x45ccac[_0x3f6706-0x1];!_0x5b7f7a||_0x21e0f8&&!this['_getOperationEnd'](_0x21e0f8)['isTouching'](this['_getOperationStart'](_0x5b7f7a))?(_0x1bc777['push']({'operations':_0x4bb99,'operationsIsolated':_0x4bb99['map'](_0x2f7ab7=>this['_shiftOperation'](_0x2f7ab7['clone'](),-_0x2d423d)),'groupOffset':_0xb7393a}),_0x4bb99=_0x5b7f7a?[_0x5b7f7a]:[],_0x2d423d+=_0xb7393a,_0xb7393a=0x0):_0x4bb99['push'](_0x5b7f7a),_0x5b7f7a&&'insert'===_0x5b7f7a['type']&&(_0xb7393a+=_0x5b7f7a['howMany']);}return _0x1bc777;}['_findAdjacentContextDistance'](_0xcb7dba,_0x5f8cec,_0x510a2f,_0x4b61ff=0x1){const _0x566237=new _0x342db9({'startPosition':_0xcb7dba,'direction':_0x5f8cec});let _0x2edefc=0x0;for(let _0x49491e=0x0;_0x49491e<_0x4b61ff;_0x49491e++){let _0x446544=0x0,_0x977ea1=!0x1,_0x5b17de='forward'===_0x5f8cec?/^\W*\w+/:/\w+\W*$/;for(const {item:_0x186adf}of _0x566237)if(_0x186adf['is']('$textProxy')){const _0x52e2d1=_0x5b17de['exec'](_0x186adf['data']);if(_0x52e2d1&&_0x52e2d1['length']){if(_0x446544+='forward'===_0x5f8cec?_0x52e2d1['index']+_0x52e2d1[0x0]['length']:_0x186adf['data']['length']-_0x52e2d1['index'],_0x52e2d1[0x0]['length']!==_0x186adf['data']['length'])break;_0x977ea1=!0x0,_0x5b17de='forward'===_0x5f8cec?/^\w+/:/\w+$/;}else{if(_0x977ea1)break;_0x446544+=_0x186adf['offsetSize'];}}else{if(_0x186adf['is']('element')){_0x510a2f['isInline'](_0x186adf)&&!_0x977ea1&&(_0x446544+=0x1);break;}}_0x2edefc+=_0x446544,_0x566237['jumpTo'](_0xcb7dba['getShiftedBy']('forward'===_0x5f8cec?_0x2edefc:-_0x2edefc));}return _0x2edefc;}['_getChangeContext'](_0x2aaa8e,_0x37cadc,_0x44e954){const _0x52c06b=_0x44e954['model']['schema'],_0x29860e=this['_findAdjacentContextDistance'](_0x2aaa8e,'backward',_0x52c06b,0x6),_0x2d134d=this['_findAdjacentContextDistance'](_0x37cadc,'forward',_0x52c06b,0x6),_0x4d9396=_0x2aaa8e['getShiftedBy'](-_0x29860e),_0xd15733=_0x37cadc['getShiftedBy'](_0x2d134d);return{'start':_0x4d9396,'end':_0xd15733,'hasContentBefore':!_0x4d9396['isAtStart'],'hasContentAfter':!_0xd15733['isAtEnd']};}['_insertMarkers'](_0xd45c7a,_0x20754c){const _0x331c8c=this['context']['plugins']['get']('AIEditing'),_0x5af6fb=new Set();_0x20754c['model']['change'](_0x4713c3=>{for(const _0xd5bea8 of _0xd45c7a){const _0x250995=''+Ta+_0xd5bea8['type']+':'+_0xd5bea8['groupId']+'_'+_0x331c8c['_nextDataId'](_0x5af6fb);this['_markers']['set'](_0x250995,{'id':_0x250995,'groupId':_0xd5bea8['groupId'],'type':_0xd5bea8['type'],'content':_0xd5bea8['content'],'editor':_0x20754c}),_0x4713c3['addMarker'](_0x250995,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x4713c3['createRange'](_0xd5bea8['start'],_0xd5bea8['end'])});}});}['_createGetContextFn'](_0x1c3cc1,_0x9fbcc9,_0x45e1e8){let _0x2742d5='';return()=>{if(!_0x2742d5){const _0x502b69=_0x9fbcc9['toView'](_0x1c3cc1,{'showSuggestionHighlights':!0x0});let _0x354cb3=_0x502b69['getChild'](0x0);if(_0x354cb3['is']('containerElement')||(_0x354cb3=_0x502b69),!_0x354cb3)return'';let _0x496fcf=!0x1;const _0x204d03=[];for(const _0x66ac18 of _0x354cb3['getChildren']())_0x66ac18['is']('element','span')&&_0x66ac18['hasClass']('ck-ai_review-marker_context-end')&&(_0x496fcf=!0x1),_0x496fcf&&_0x204d03['push'](_0x66ac18),_0x66ac18['is']('element','span')&&_0x66ac18['hasClass']('ck-ai_review-marker_context-start')&&(_0x496fcf=!0x0);_0x354cb3['_removeChildren'](0x0,_0x354cb3['childCount']),_0x45e1e8?.['ellipsisBefore']&&_0x354cb3['_appendChild']('…'),_0x354cb3['_appendChild'](_0x204d03),_0x45e1e8?.['ellipsisAfter']&&_0x354cb3['_appendChild']('…');const _0x3b58c9=_0x9fbcc9['htmlProcessor']['domConverter']['viewToDom'](_0x502b69),_0x530c80=_0x9fbcc9['htmlProcessor']['htmlWriter']['getHtml'](_0x3b58c9);_0x2742d5=_0x530c80;}return _0x2742d5;};}['_createGetContentFn'](_0x5dfce8,_0x22b0c2){let _0x375318='';return()=>(_0x375318||(_0x375318=_0x22b0c2['stringify'](_0x5dfce8,{'showSuggestionHighlights':!0x0})),_0x375318);}['_createGetContentUsingDataIdFn'](_0x1b1866,_0x2915fd,_0x3665b1){let _0x431be6='';return()=>{if(!_0x431be6){const _0x5b3a8e=_0x3665b1['toView'](new _0x569183(_0x1b1866)),_0x55268c=_0x3665b1['htmlProcessor']['domConverter']['viewToDom'](_0x5b3a8e)['querySelector']('[data-id=\x22'+_0x2915fd+'\x22]');_0x431be6=_0x55268c?.['outerHTML']||'';}return _0x431be6;};}['_findMarkerElement'](_0x180ee1,_0x645bd6=0x5){let _0x2f74ed=_0x180ee1,_0x183542=null;for(let _0x2869ad=0x0;_0x2869ad<_0x645bd6&&_0x2f74ed;_0x2869ad++){if(!_0x2f74ed['className']){_0x2f74ed=_0x2f74ed['parentElement'];continue;}if(!(''+_0x2f74ed['className'])['includes']('ck-ai_review-marker_')){_0x2f74ed=_0x2f74ed['parentElement'];continue;}if(!_0x2f74ed['getAttribute']('data-marker-id'))break;_0x183542=_0x2f74ed;break;}return _0x183542;}['_findMarkerElementById'](_0x1a8c61){const _0x447e3b=this['_markers']['get'](_0x1a8c61),_0xf539fe=_0x447e3b?.['editor']??$s(this['context']),_0x1a9e2a=_0xf539fe['model']['markers']['get'](_0x1a8c61);return _0x1a9e2a?_0x3ebf06(_0xf539fe['editing'],_0x1a9e2a):null;}['_getMarkersDataForGroup'](_0x3a4a58){return Array['from'](this['_markers']['values']())['filter'](_0x3c2edd=>_0x3c2edd['groupId']===_0x3a4a58);}['_getOperationStart'](_0x446a33){return'insert'===_0x446a33['type']?_0x446a33['position']:_0x446a33['newRange']['start'];}['_getOperationEnd'](_0x1ad400,_0xedae62=!0x1){return'insert'===_0x1ad400['type']?_0xedae62?_0x1ad400['position']:_0x1ad400['position']['getShiftedBy'](_0x1ad400['howMany']):_0x1ad400['newRange']['end'];}['_shiftOperation'](_0x5f960a,_0x56745f){return'insert'===_0x5f960a['type']?_0x5f960a['position']=_0x5f960a['position']['getShiftedBy'](_0x56745f):'marker'===_0x5f960a['type']&&_0x5f960a['newRange']&&(_0x5f960a['newRange']=new _0x5ca4e8(_0x5f960a['newRange']['start']['getShiftedBy'](_0x56745f),_0x5f960a['newRange']['end']['getShiftedBy'](_0x56745f))),_0x5f960a;}['_changeOperationOwnerDocument'](_0x17b5c7,_0x2b21ea){'insert'===_0x17b5c7['type']?_0x17b5c7['position']=this['_changePositionOwnerDocument'](_0x17b5c7['position'],_0x2b21ea):'marker'===_0x17b5c7['type']&&_0x17b5c7['newRange']&&(_0x17b5c7['newRange']=this['_changeRangeOwnerDocument'](_0x17b5c7['newRange'],_0x2b21ea));}['_changePositionOwnerDocument'](_0x386211,_0x37f095){return new _0x1e668d(_0x37f095,_0x386211['path']);}['_changeRangeOwnerDocument'](_0x142ceb,_0x2175a1){return new _0x5ca4e8(this['_changePositionOwnerDocument'](_0x142ceb['start'],_0x2175a1),this['_changePositionOwnerDocument'](_0x142ceb['end'],_0x2175a1));}['_changePosition'](_0xda2462,_0x4f5340){return new _0x1e668d(_0x4f5340,[..._0xda2462]);}['_changeRange'](_0x22f353,_0x32a0bd,_0x21ffae,_0x10e7ee){return new _0x5ca4e8(this['_changePosition'](_0x32a0bd,_0x10e7ee),this['_changePosition'](_0x21ffae,_0x10e7ee));}['_sortMarkers'](_0x276091){const _0x3dc0db=_0x3db062=>{switch(_0x3db062){case'insert':return 0x0;case'remove-context':return 0x1;case'remove-only':return 0x2;case'remove-text':return 0x3;}};return _0x276091['sort']((_0x350f86,_0x377633)=>_0x3dc0db(_0x350f86['type'])-_0x3dc0db(_0x377633['type']));}['_hasSameTopLevelElement'](_0x1c40a8,_0x4857b3){const _0x4f964f=_0x1c40a8['getChild'](0x0),_0x30c5d7=_0x4857b3['getChild'](0x0);return!(!_0x4f964f||!_0x30c5d7)&&((!_0x4f964f['is']('element')||!_0x30c5d7['is']('element')||_0x4f964f['name']===_0x30c5d7['name'])&&!(_0x4f964f['is']('element')&&!_0x30c5d7['is']('element')||!_0x4f964f['is']('element')&&_0x30c5d7['is']('element')));}['_haveSingleTopLevelElement'](_0x4c1f0b){return 0x1===_0x4c1f0b['childCount'];}['_haveOnlyInlineContent'](_0x4c260a,_0x40418d){for(const _0x4213e0 of _0x4c260a['getChildren']())if(_0x4213e0['is']('element')&&!_0x40418d['isInline'](_0x4213e0))return!0x1;return!0x0;}['_upsertDataId'](_0x1bcb09,_0x4db8b0){let _0x297a6e=_0x1bcb09['getAttribute'](_0x138817);return _0x297a6e||(_0x297a6e=_0x4db8b0(),_0x1bcb09['_setAttribute'](_0x138817,_0x297a6e)),_0x297a6e;}}class fa extends Tt(){['id'];['contentNew'];['contentInitial'];['documentVersion'];constructor({id:_0x1f1e04,contentNew:_0x4be86f,contentInitial:_0x3a1fc9,documentVersion:_0x2b190b}){super(),this['id']=_0x1f1e04,this['contentNew']=_0x4be86f,this['contentInitial']=_0x3a1fc9,this['documentVersion']=_0x2b190b;}}class ba extends ht(){['id'];['parent'];['_data'];['_editorOperations']=[];constructor(_0x2e1390,_0x4cc31b,_0x27d075){super(),this['id']=_0x2e1390,this['parent']=_0x27d075,this['_data']=_0x4cc31b,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(_0x52efa8,_0x146c73,_0x1ed47d,_0x621034,_0x4265d3){super(),this['_sourceCheck']=_0x146c73,this['_documentData']=_0x52efa8,this['_aiConnector']=_0x1ed47d,this['_reviewParams']=_0x621034,this['_reviewArgs']=_0x4265d3,this['on']('change:status',(_0x353a3a,_0x266542,_0x65b58c)=>{'aborted'==_0x65b58c&&(this['_wasAborted']=!0x0),this['fire']('reviewCheckRunUpdated',{'status':_0x65b58c,'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'](_0x1023fb=>'pending'===_0x1023fb['status']);}get['currentError'](){return this['_currentError'];}['updateDocumentData'](_0x11b859){this['_documentData']=_0x11b859;}async['start'](){this['status']='loading',this['_currentError']=void 0x0;try{this['_activeRequest']=this['_createApiRequest']();const _0x5c99ce=await this['_activeRequest']['getStream']();this['status']='data';for await(const _0x22d4ea of _0x5c99ce)'unmodified'!==_0x22d4ea['data']['operation']&&('error'!==_0x22d4ea['data']['operation']?'review-metadata'!==_0x22d4ea['event']?this['_addReviewCheckResult'](_0x22d4ea['data']['dataId'],_0x22d4ea['data']['textDelta']):this['callId']=_0x22d4ea['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(_0x621754){this['_currentError']=_0x621754,_0x621754 instanceof Error&&_0x621754['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'](_0x1adb6c,_0x2ee7c4){const _0x22981c=this['_results']['get'](_0x1adb6c);if(!_0x22981c)return;if(0x0===_0x2ee7c4['length'])return;const _0x5d0b8f=[];_0x2ee7c4['forEach']((_0x359fe6,_0x32e088)=>{const _0x15b2c8=new ba(_0x22981c['id']+'-'+_0x32e088,_0x359fe6,_0x22981c);_0x15b2c8['on']('change:status',()=>{this['fire']('reviewCheckResultChangeStatusUpdated',{'change':_0x15b2c8,'status':_0x15b2c8['status']});}),_0x15b2c8['on']('change:isActivated',()=>{_0x15b2c8['isActivated']?this['fire']('reviewCheckResultActivated',{'change':_0x15b2c8}):this['fire']('reviewCheckResultDeactivated',{'change':_0x15b2c8});}),this['_changes']['push'](_0x15b2c8),_0x5d0b8f['push'](_0x15b2c8);}),this['fire']('reviewCheckResultReady',{'changes':_0x5d0b8f,'result':_0x22981c,'source':this});}['abort'](){this['_activeRequest']&&(this['_activeRequest']['abortController']['abort'](),this['_activeRequest']=null,this['status']='aborted');}['isChangeActive'](_0x5aa21d){const _0x1a7704=this['_changes']['find'](_0xd2e700=>_0xd2e700['id']===_0x5aa21d);return!(!_0x1a7704||'pending'!==_0x1a7704['status']);}['isAnyChangeActivated'](){return this['_changes']['some'](_0xd33fee=>!0x0===_0xd33fee['isActivated']);}['getActiveChanges'](){return this['_changes']['filter'](_0x1f0538=>'pending'===_0x1f0538['status']);}['getChangeById'](_0x879876){return this['_changes']['find'](_0x280abb=>_0x280abb['id']===_0x879876);}['markAllChangesAsAccepted'](){for(const _0x5effd2 of this['_changes'])'pending'===_0x5effd2['status']&&(_0x5effd2['status']='accepted');this['_checkIfFinished']();}['markChangeAsAccepted'](_0x49eba5){const _0xc3fb1=this['_changes']['find'](_0x1b6fd1=>_0x1b6fd1['id']===_0x49eba5);_0xc3fb1&&'pending'===_0xc3fb1['status']&&(_0xc3fb1['status']='accepted'),this['_checkIfFinished']();}['markChangeAsRejected'](_0x4abaee){const _0x5afca6=this['_changes']['find'](_0x32ddc4=>_0x32ddc4['id']===_0x4abaee);_0x5afca6&&'pending'===_0x5afca6['status']&&(_0x5afca6['status']='rejected'),this['_checkIfFinished']();}['markChangeAsOutdated'](_0x49b973){const _0x5f473e=this['_changes']['find'](_0x5b35a0=>_0x5b35a0['id']===_0x49b973);_0x5f473e&&'pending'===_0x5f473e['status']&&(_0x5f473e['status']='outdated'),this['_checkIfFinished']();}['markChangeAsPending'](_0x22b42c){const _0x55399c=this['_changes']['find'](_0x5184e4=>_0x5184e4['id']===_0x22b42c);_0x55399c&&'outdated'===_0x55399c['status']&&(_0x55399c['status']='pending'),this['_checkIfFinished']();}['activateChange'](_0x281b76){this['_changes']['filter'](_0x45c52a=>_0x45c52a['isActivated']&&_0x45c52a['id']!==_0x281b76)['forEach'](_0xf1f49d=>{_0xf1f49d['isActivated']=!0x1;});const _0x1e654d=this['_changes']['find'](_0x2e0d09=>_0x2e0d09['id']===_0x281b76);_0x1e654d&&'pending'===_0x1e654d['status']&&(_0x1e654d['isActivated']=!0x0);}['deactivateChange'](){this['_changes']['filter'](_0x380d8a=>_0x380d8a['isActivated'])['forEach'](_0x15065d=>{_0x15065d['isActivated']=!0x1;});}['forceReadyState'](){this['status']='ready';}async['sendRating'](_0x71faa5){if('initialized'===this['status']||'loading'===this['status']||'data'===this['status']||this['_wasAborted'])return;if(!this['callId']||0x0===this['_changes']['length'])return;let _0x3e30e2;if(_0x71faa5){const _0x29345d=this['_changes']['find'](_0x168448=>_0x168448['id']===_0x71faa5);if(_0x29345d&&_0x29345d['isRated'])return;_0x29345d&&(_0x3e30e2=_0x29345d['parent']['id'],_0x29345d['isRated']=!0x0);}const _0x49c8a3={'positiveCount':this['_changes']['filter'](_0xe209a5=>'accepted'===_0xe209a5['status'])['length'],'totalCount':this['_changes']['length']};this['_sendRatingRequest'](_0x49c8a3,this['callId'],_0x3e30e2);}['_addReviewCheckResult'](_0x588b31,_0x530e06){const _0x51baf7=this['_documentData']['elements']['get'](_0x588b31);if(!_0x51baf7)return;const _0x5a4dc7=_0x51baf7['getContent']();if(_0x5a4dc7===_0x530e06)return;const _0x15e1d9=new fa({'id':_0x588b31,'contentInitial':_0x5a4dc7,'contentNew':_0x530e06,'documentVersion':_0x51baf7['documentVersion']});this['_results']['set'](_0x15e1d9['id'],_0x15e1d9),this['fire']('reviewCheckResultAdded',{'result':_0x15e1d9,'source':this,'editor':_0x51baf7['editor']});}['_checkIfFinished'](){'finished'===this['status']&&(this['_changes']['filter'](_0x10a3b3=>'pending'===_0x10a3b3['status'])['length']>0x0&&(this['status']='ready')),'ready'===this['status']&&(0x0===this['_changes']['filter'](_0x1845c0=>'pending'===_0x1845c0['status'])['length']&&(this['status']='finished'));}}class Ra extends Sa{get['subTitle'](){if(!this['_reviewParams']||0x0===this['_reviewParams']['length'])return'';const _0x2f25f6=[];if(this['_reviewParams']['length']>0x0&&this['_sourceCheck']['options'])for(let _0x33c40a=0x0;_0x33c40a<this['_reviewParams']['length'];_0x33c40a++){if(!this['_reviewParams'][_0x33c40a]||!this['_sourceCheck']['options'][_0x33c40a])continue;const _0x41adf9=this['_sourceCheck']['options'][_0x33c40a],_0x1046dc=_0x41adf9['data']?.['find'](_0x5f4ade=>_0x5f4ade['id']===this['_reviewParams'][_0x33c40a]);_0x1046dc&&_0x2f25f6['push'](_0x1046dc['label']);}return _0x2f25f6['join'](',\x20');}get['reviewName'](){return this['_composeReviewName']();}['_createApiRequest'](){return this['_aiConnector']['callSystemReview']({'reviewName':this['_composeReviewName'](),'content':this['_documentData']['content'],'args':this['_reviewArgs']});}['_sendRatingRequest'](_0x5c3644,_0x3d9611,_0x2c641b){return this['_aiConnector']['upsertAIReviewRating'](this['reviewName'],_0x3d9611,_0x5c3644,_0x2c641b);}['_composeReviewName'](){return!this['_reviewParams']||0x0===this['_reviewParams']['length']||this['_sourceCheck']['useArgs']?this['_sourceCheck']['apiId']:[this['_sourceCheck']['apiId'],...this['_reviewParams']]['join']('-');}}class Oa extends _0x173dbd{['_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(_0x32f47f,_0x43b78c)=>{const _0x331fbb=this['_aiReviewCheckList']['getCheckById'](_0x43b78c['id']);if(_0x331fbb){this['_onReviewCheckRun'](_0x43b78c),this['_aiReviewCoreEditing']['switchToReadOnly'](),this['_currentReviewCheckRun']=this['_createReviewCheckRun'](_0x43b78c,_0x331fbb),this['_aiReviewCoreUi']['setCheckResultTitle'](this['_currentReviewCheckRun']['title'],this['_currentReviewCheckRun']['subTitle']),this['_currentReviewCheckRun']['on']('reviewCheckRunUpdated',(_0x24e038,_0x298dea)=>{switch(_0x298dea['status']){case'data':case'loading':this['_aiReviewCoreUi']['showCheckRunResults'](_0x298dea);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'!==_0x298dea['status']&&'error-chunk'!==_0x298dea['status']&&'error-general'!==_0x298dea['status']||this['_currentReviewCheckRun']?.['sendRating']();}),this['_currentReviewCheckRun']['on']('reviewCheckResultAdded',(_0x18af23,_0x58d771)=>{if(!this['_currentReviewCheckRun'])throw new at('ai-review-mode-no-current-check-run',this);const _0x2e7f06=this['_diffContent'](_0x58d771['editor'],_0x58d771['result']['contentInitial'],_0x58d771['result']['contentNew']);_0x58d771['source']['addResultChanges'](_0x58d771['result']['id'],_0x2e7f06);}),this['_currentReviewCheckRun']['on']('reviewCheckResultReady',(_0x3f1bbe,_0x41fb6e)=>{for(const _0x836317 of _0x41fb6e['changes'])this['_aiReviewCoreUi']['showCheckRunResult'](_0x836317);this['_markChangePositionInEditorContent'](_0x41fb6e['changes'],_0x41fb6e['source']['documentData']);}),this['_currentReviewCheckRun']['on']('reviewCheckResultChangeStatusUpdated',(_0x5c5726,_0x4987b7)=>{this['_aiReviewCoreUi']['updateChangeState'](_0x4987b7['change']['id'],_0x4987b7['status']);}),this['_currentReviewCheckRun']['on']('reviewCheckResultActivated',(_0x305b20,_0xf782a0)=>{this['_onReviewCheckResultActivated'](_0xf782a0);}),this['_currentReviewCheckRun']['on']('reviewCheckResultDeactivated',()=>{this['_onReviewCheckResultDeactivated']();});try{await this['_currentReviewCheckRun']['start']();}catch(_0x5bb5ae){_0x5bb5ae instanceof Error&&_0x5bb5ae['message']['includes']('ai-request-aborted')||(_0x5bb5ae instanceof at?this['_logError'](_0x5bb5ae):this['_logError'](new at('ai-review-mode-check-run-failed',this,void 0x0,_0x5bb5ae)));}}else this['_logError'](new at('ai-review-mode-source-check-not-found',this,{'checkId':_0x43b78c['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 _0x4557f9=this['_currentReviewCheckRun']['getActiveChanges']();if(!_0x4557f9['length'])return;this['_aiReviewCoreEditing']['applyChange'](_0x4557f9['map'](_0x282916=>_0x282916['id']));const _0x32c3b2=this['_currentReviewCheckRun'];_0x32c3b2['markAllChangesAsAccepted'](),_0x32c3b2['sendRating']();}),this['listenTo'](this['_aiReviewCoreUi'],'acceptChange',(_0x3e572f,_0x54ec3e)=>{this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['isChangeActive'](_0x54ec3e['id'])&&(this['_aiReviewCoreEditing']['applyChange']([_0x54ec3e['id']]),this['_currentReviewCheckRun']['markChangeAsAccepted'](_0x54ec3e['id']),this['_aiReviewCoreUi']['hideChangeBalloon'](),this['_currentReviewCheckRun']['sendRating'](_0x54ec3e['id']));}),this['listenTo'](this['_aiReviewCoreUi'],'dismissChange',(_0x241f4b,_0x5e82a0)=>{this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['isChangeActive'](_0x5e82a0['id'])&&(this['_aiReviewCoreEditing']['rejectChange'](_0x5e82a0['id']),this['_currentReviewCheckRun']['markChangeAsRejected'](_0x5e82a0['id']),this['_aiReviewCoreUi']['hideChangeBalloon'](),this['_currentReviewCheckRun']['sendRating'](_0x5e82a0['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',(_0x24f97a,_0x29e3f7)=>{this['_onActivateChange'](_0x29e3f7);}),this['listenTo'](this['_aiReviewCoreUi'],'deactivateChange',(_0x3fbc15,_0x2bee07)=>{this['_onDeactivateChange'](_0x2bee07);}),this['listenTo'](this['_aiReviewCoreEditing']['emitter'],'changeMarkerClicked',(_0x316cb1,_0x57003f)=>{this['_onChangeMarkerClicked'](_0x316cb1,_0x57003f);}),this['listenTo'](this['_aiReviewCoreEditing']['emitter'],'changeMarkerHovered',(_0x50d515,_0x2b8ed1)=>{this['_onChangeMarkerHovered'](_0x50d515,_0x2b8ed1);}),this['listenTo'](this['_aiReviewCoreEditing']['emitter'],'changeMarkerBlurred',()=>{this['_onChangeMarkerBlurred']();}),this['listenTo'](this['_aiReviewCoreEditing']['emitter'],'changeMarkerRemoved',(_0x5df497,_0x4f82a5)=>{this['_onChangeMarkerRemoved'](_0x5df497,_0x4f82a5);}),this['listenTo'](this['_aiReviewCoreEditing']['emitter'],'changeMarkerRestored',(_0x319a98,_0x13de12)=>{this['_onChangeMarkerRestored'](_0x319a98,_0x13de12);});}['_createReviewCheckRun'](_0x10a1c4,_0x4abe0b){return new Ra(this['_aiReviewCoreEditing']['getDocumentData'](),_0x4abe0b,this['_aiConnector'],_0x10a1c4['params'],_0x10a1c4['args']);}['_onChangeMarkerRemoved'](_0x52df55,_0x480c5c){this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['markChangeAsOutdated'](_0x480c5c['changeId']);}['_onChangeMarkerRestored'](_0x9e7329,_0x1a1d5e){this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['markChangeAsPending'](_0x1a1d5e['changeId']);}['_onCheckRunFinished'](){this['_aiReviewCoreUi']['showReviewCompletedView']();}['_initRequiredPlugins'](){this['_aiConnector']=this['context']['plugins']['get']('AIConnector');}['_onReviewRunLeave'](_0x5b9a16=!0x1){this['_currentReviewCheckRun']&&(this['_currentReviewCheckRun']['hasModifications']||this['_currentReviewCheckRun']['sendRating'](),this['_currentReviewCheckRun']['stopListening'](),this['_currentReviewCheckRun']['abort'](),this['_currentReviewCheckRun']=void 0x0),_0x5b9a16&&this['_aiReviewCoreUi']['showReviewCheckList'](),this['_aiReviewCoreEditing']['clearAllMarkers'](),this['_aiReviewCoreEditing']['switchToEdit'](),this['_changeActivationSource']=null;for(const _0x5e62ee of this['_aiReviewCoreEditing']['getEditors']())_0x5e62ee['editing']['view']['change'](_0x3fb970=>{for(const _0x3a2e56 of _0x5e62ee['editing']['view']['document']['getRoots']())_0x3fb970['removeClass']('ck-ai_review-diff',_0x3a2e56),_0x3fb970['removeClass']('ck-ai_review-highlights',_0x3a2e56),_0x3fb970['removeClass']('ck-ai-translate-mode-content',_0x3a2e56);});}['_getTranslationWithDefault'](_0x2f5183,_0x1d86e9){const _0xda6523=hs(this['context']['locale'],_0x2f5183);return _0xda6523===_0x2f5183?_0x1d86e9:_0xda6523;}['_logError'](_0x171cde,_0x3952f9=!0x1){Et(_0x171cde['message']),_0x3952f9||(_0x171cde['message']['startsWith']('ai-review-mode-models-unable-to-retrieve')?this['_aiReviewCoreUi']['showGeneralReviewCoreErrorView']():this['_aiReviewCoreUi']['showGeneralResultsErrorView']());}['_scrollToChange'](_0x188bd5){if('content'===this['_changeActivationSource']){const _0x1cbbdf=this['_aiReviewCoreUi']['getChangeElement'](_0x188bd5);_0x1cbbdf&&ft(_0x1cbbdf['closest']('.ck-ai_review__check-run-result')||_0x1cbbdf);}else{if('panel'===this['_changeActivationSource']){const _0x1c875a=this['_getChangeContentElement'](_0x188bd5);if(!_0x1c875a)return;Ct({'target':_0x1c875a,'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(_0x2f64dd){this['id']=_0x2f64dd['id'],this['commandId']=_0x2f64dd['commandId'],this['title']=_0x2f64dd['title'],this['description']=_0x2f64dd['description'],this['isParameterized']=_0x2f64dd['isParameterized'],this['useArgs']=_0x2f64dd['useArgs'],this['options']=_0x2f64dd['options'],this['args']=_0x2f64dd['args'];}}class va extends ht(){['_checks']=[];['setupChecks'](_0x752037){this['_checks']=_0x752037['map'](_0x415ac7=>new Na(_0x415ac7));}get['checks'](){return this['_checks'];}['getCheckById'](_0x56540a){return this['checks']['find'](_0x28f94d=>_0x28f94d['id']===_0x56540a);}['removeCheckById'](_0x1c59b1){this['_checks']=this['_checks']['filter'](_0xef4b37=>_0xef4b37['id']!==_0x1c59b1);}}class ya extends Na{['_models']=[];['_defaultModel']=null;constructor(_0xd869c9,_0x297d78,_0x310bdc){super(_0xd869c9),this['_models']=_0x297d78,this['_defaultModel']=_0x310bdc;}get['models'](){return this['_models'];}get['defaultModel'](){return this['_defaultModel'];}}class xa extends Na{['isExtra']=!0x0;['prompt'];['model'];['_defaultModel']=null;constructor(_0x4254c5,_0x55f56a,_0x296b63){super(_0x4254c5),this['prompt']=_0x4254c5['prompt'],this['model']=_0x4254c5['model'],this['model']?this['_defaultModel']=_0x55f56a['find'](_0x56a68f=>_0x56a68f['id']===this['model'])||null:this['_defaultModel']=_0x296b63;}get['defaultModel'](){return this['_defaultModel'];}}class La extends va{['_allModels']=[];['_recommendedModels']=[];['_defaultModel']=null;constructor(_0x16afb0,_0x3ea371,_0x1aa8af){super(),this['_allModels']=_0x16afb0,this['_recommendedModels']=_0x3ea371,this['_defaultModel']=_0x1aa8af;}['setupChecks'](_0x35ca6d){this['_checks']=_0x35ca6d['map'](_0x1a5220=>!0x0===_0x1a5220['isExtra']?new xa(_0x1a5220,this['_allModels'],this['_defaultModel']):'custom'===_0x1a5220['id']?new ya(_0x1a5220,this['_recommendedModels'],this['_defaultModel']):new Na(_0x1a5220));}}class Da extends Sa{['_prompt'];['_model'];constructor(_0x15ee61,_0x5e8fa8,_0x4537a3,_0x38eaa2,_0x4d95bd){super(_0x4537a3,_0x38eaa2,_0x4d95bd),this['_prompt']=_0x15ee61,this['_model']=_0x5e8fa8;}get['subTitle'](){return this['_prompt'];}['_createApiRequest'](){return this['_aiConnector']['callCustomReview']({'content':this['_documentData']['content'],'prompt':this['_prompt'],'model':this['_model']});}['_sendRatingRequest'](_0x45ee71,_0x1fe776,_0x28e0cd){return this['_aiConnector']['upsertCustomAIReviewRating'](_0x1fe776,_0x45ee71,_0x28e0cd);}}class Pa extends Da{get['subTitle'](){return'';}set['prompt'](_0x460f1b){this['_prompt']=_0x460f1b;}set['model'](_0x42cb9c){this['_model']=_0x42cb9c;}}class Ha extends Oa{static get['pluginName'](){return'AIReviewModeController';}['_isDiffOn']=!0x1;['_hasDefaultAvailableCommands']=!0x1;constructor(_0x5f3c10){super(_0x5f3c10),this['_hasDefaultAvailableCommands']=!this['context']['config']['get']('ai.review.availableCommands'),this['context']['config']['define']('ai.review.availableCommands',ka['map'](_0x1419f4=>_0x1419f4['id'])),this['context']['config']['define']('ai.review.extraCommands',[]);}async['init'](){await super['init'](),this['listenTo'](this['_aiReviewCoreUi'],'toggleDiff',(_0x3a438e,_0x1d6111)=>{this['_isDiffOn']=_0x1d6111['on'],this['_onDiffChange'](this['_isDiffOn']);});}['_initRequiredPlugins'](){super['_initRequiredPlugins'](),this['_aiReviewCoreUi']=this['context']['plugins']['get']('AIReviewModeUI'),this['_aiReviewCoreEditing']=this['context']['plugins']['get']('AIReviewCoreEditing');}['_createReviewCheckRun'](_0x1ea720,_0x779053){return _0x1ea720['isCustom']?new Da(_0x1ea720['args']['prompt'],_0x1ea720['args']['model'],this['_aiReviewCoreEditing']['getDocumentData'](),_0x779053,this['_aiConnector']):_0x779053['isExtra']?new Pa(_0x779053['prompt'],_0x779053['defaultModel']['id'],this['_aiReviewCoreEditing']['getDocumentData'](),_0x779053,this['_aiConnector']):new Ra(this['_aiReviewCoreEditing']['getDocumentData'](),_0x779053,this['_aiConnector'],_0x1ea720['params'],_0x1ea720['args']);}['_onReviewCheckResultActivated'](_0x58e0d0){this['_aiReviewCoreUi']['setActiveStateInResults'](_0x58e0d0['change']['id']),this['_scrollToChange'](_0x58e0d0['change']['id']);const _0x4dca49=this['_aiReviewCoreEditing']['getMarkerElementForChange'](_0x58e0d0['change']['id']);if(!_0x4dca49)return;const _0x22c7bf=this['_aiReviewCoreEditing']['getEditorForChange'](_0x58e0d0['change']['id'])??this['_aiReviewCoreEditing']['getEditor']();this['_aiReviewCoreUi']['showChangeBalloon'](_0x58e0d0['change'],()=>_0x4dca49['getElement'](),void 0x0,'click',this['_getBalloonDomRoot'](_0x22c7bf,_0x4dca49['modelRange']['root']['rootName']),_0x22c7bf?.['ui']?.['viewportOffset']),this['_aiReviewCoreEditing']['setMarkersInElementAsActive'](_0x58e0d0['change']['id']);}['_onReviewCheckResultDeactivated'](){this['_aiReviewCoreUi']['resetActiveStateInResults'](),this['_aiReviewCoreUi']['hideChangeBalloon'](),this['_aiReviewCoreEditing']['setAllMarkersAsInactive']();}['_onActivateChange'](_0x22f1fb){this['_currentReviewCheckRun']&&'click'===_0x22f1fb['uiInteraction']&&(this['_changeActivationSource']='panel',this['_currentReviewCheckRun']['activateChange'](_0x22f1fb['id']));}['_onDeactivateChange'](_0x262c8b){this['_currentReviewCheckRun']&&'balloon'===_0x262c8b['origin']&&this['_currentReviewCheckRun']['deactivateChange']();}['_onChangeMarkerClicked'](_0x18f55a,_0x7b829c){if(!this['_currentReviewCheckRun'])return;this['_changeActivationSource']='content',this['_currentReviewCheckRun']['activateChange'](_0x7b829c['changeId']);const _0x3e0c81=this['_currentReviewCheckRun']['getChangeById'](_0x7b829c['changeId']);if(!_0x3e0c81)return;const _0xd4eba0=this['_aiReviewCoreEditing']['getMarkerElementForChange'](_0x7b829c['changeId']),_0x31d47b=this['_aiReviewCoreEditing']['getEditorForChange'](_0x7b829c['changeId'])??this['_aiReviewCoreEditing']['getEditor']();this['_aiReviewCoreUi']['showChangeBalloon'](_0x3e0c81,_0x7b829c['markerElement'],_0x7b829c['domEvent'],'click',this['_getBalloonDomRoot'](_0x31d47b,_0xd4eba0?.['modelRange']['root']['rootName']),_0x31d47b?.['ui']?.['viewportOffset']);}['_onChangeMarkerHovered'](_0x36602e,_0x43d112){if(!this['_currentReviewCheckRun'])return;if(this['_currentReviewCheckRun']['isAnyChangeActivated']())return;const _0x5f2730=this['_currentReviewCheckRun']['getChangeById'](_0x43d112['changeId']);if(!_0x5f2730)return;const _0x4706b9=this['_aiReviewCoreEditing']['getMarkerElementForChange'](_0x43d112['changeId']),_0x162440=this['_aiReviewCoreEditing']['getEditorForChange'](_0x43d112['changeId'])??this['_aiReviewCoreEditing']['getEditor']();this['_aiReviewCoreUi']['showChangeBalloon'](_0x5f2730,_0x43d112['markerElement'],_0x43d112['domEvent'],'hover',this['_getBalloonDomRoot'](_0x162440,_0x4706b9?.['modelRange']['root']['rootName']),_0x162440?.['ui']?.['viewportOffset']);}['_onChangeMarkerBlurred'](){if(!this['_currentReviewCheckRun'])return;this['_currentReviewCheckRun']['isAnyChangeActivated']()||this['_aiReviewCoreUi']['hideChangeBalloon']();}['_getChangeContentElement'](_0x57cdc4){const _0xad7850=this['_aiReviewCoreEditing']['getMarkerElementForChange'](_0x57cdc4);return _0xad7850?_0xad7850['getElement']():null;}['_markChangePositionInEditorContent'](_0x338b7d,_0xabf09){this['_aiReviewCoreEditing']['markChangePositionInEditorContent'](_0x338b7d,_0xabf09);}['_diffContent'](_0x4555db,_0x46bc89,_0x5b950e){return this['_aiReviewCoreEditing']['diffContent'](_0x4555db,_0x46bc89,_0x5b950e,!0x1);}['_onReviewCheckRun'](){this['_onDiffChange'](this['_isDiffOn']);}['_onDiffChange'](_0x23d55a){_0x23d55a?this['_aiReviewCoreUi']['hideDiffInBalloon']():this['_aiReviewCoreUi']['showDiffInBalloon']();for(const _0x505a46 of this['_aiReviewCoreEditing']['getEditors']())_0x505a46['editing']['view']['change'](_0x4d1ade=>{for(const _0x1b65d7 of _0x505a46['editing']['view']['document']['getRoots']()){for(const _0x527acf of _0x1b65d7['getClassNames']())_0x527acf['startsWith']('ck-ai_review-')&&_0x4d1ade['removeClass'](_0x527acf,_0x1b65d7);_0x4d1ade['addClass'](_0x23d55a?'ck-ai_review-diff':'ck-ai_review-highlights',_0x1b65d7);}});}['_getBalloonDomRoot'](_0x431092,_0x206a46){const _0x37b738=_0x431092['editing']['view'];if(_0x206a46){const _0x4f8b8d=_0x37b738['getDomRoot'](_0x206a46);if(_0x4f8b8d)return _0x4f8b8d;}return _0x37b738['getDomRoot']()??void 0x0;}async['_getChecksList'](){const _0xc4d4fb=[...ka,...this['_getExtraChecks']()],_0x5b9001=this['context']['config']['get']('ai.review.availableCommands')||[];this['_logErrorForNonExistentChecks'](_0x5b9001,_0xc4d4fb);let _0x464df8=_0xc4d4fb;this['_hasDefaultAvailableCommands']||(_0x464df8=_0x5b9001['map'](_0x4bf5a7=>_0xc4d4fb['find'](_0x210ad9=>_0x210ad9['id']===_0x4bf5a7))['filter'](_0x36eb01=>!!_0x36eb01)),_0x464df8=_0x464df8['map'](_0x2577ef=>_0x2577ef['isExtra']?_0x2577ef:this['_translateReviewCheck'](_0x2577ef));const _0x45e0cd=_0x464df8['some'](_0x64ca17=>_0x64ca17['isExtra']||'custom'===_0x64ca17['id']);let _0x5bdad4=[],_0x194088=[],_0x304772=null;if(_0x45e0cd){const _0x48cced=await this['_getModels']();_0x5bdad4=_0x48cced['all'],_0x194088=_0x48cced['recommended'],_0x304772=_0x48cced['default'];}const _0x7e2ea=new La(_0x5bdad4,_0x194088,_0x304772);return _0x7e2ea['setupChecks'](_0x464df8),_0x45e0cd&&this['_filterChecksWithMissingModel'](_0x7e2ea),_0x7e2ea;}['_getExtraChecks'](){return(this['context']['config']['get']('ai.review.extraCommands')||[])['map'](_0x7f466d=>({'id':_0x7f466d['id'],'commandId':_0x7f466d['id'],'title':_0x7f466d['label'],'description':_0x7f466d['description'],'isParameterized':!0x1,'isExtra':!0x0,'prompt':_0x7f466d['prompt'],'model':_0x7f466d['model']}));}['_logErrorForNonExistentChecks'](_0x517a7c,_0x4b791f){const _0x22f4d9=_0x517a7c['filter'](_0x16a1bc=>!_0x4b791f['some'](_0x4c9301=>_0x4c9301['id']===_0x16a1bc));_0x22f4d9['length']&&this['_logError'](new at('ai-review-mode-non-existent-commands-used',this,{'commandIds':_0x22f4d9['join'](',\x20')}),!0x0);}async['_getModels'](){try{const _0x3b66fa=new Fs({'connector':this['_aiConnector'],'config':this['context']['config']['get']('ai.models'),'locale':this['context']['locale']});return{'all':await _0x3b66fa['getAll'](),'recommended':await _0x3b66fa['getAvailableModels'](),'default':await _0x3b66fa['getDefault']()};}catch(_0x40ff36){return this['_logError'](new at('ai-review-mode-models-unable-to-retrieve',this,void 0x0,_0x40ff36)),{'all':[],'recommended':[],'default':null};}}['_translateReviewCheck'](_0x1c1a6d){const _0x10a7a5='AI_REVIEW_CHECK_'+_0x1c1a6d['id']['toUpperCase']()['replaceAll']('-','_'),_0x1cbc36={..._0x1c1a6d,'title':this['_getTranslationWithDefault'](_0x10a7a5+'_TITLE',_0x1c1a6d['title']),'description':this['_getTranslationWithDefault'](_0x10a7a5+'_DESCRIPTION',_0x1c1a6d['description'])};return _0x1c1a6d['options']&&(_0x1cbc36['options']=_0x1c1a6d['options']['map'](_0x213c8f=>({..._0x213c8f,'label':this['_getTranslationWithDefault'](_0x10a7a5+'_OPTIONS_LABEL',_0x213c8f['label']||''),'data':_0x213c8f['data']?_0x213c8f['data']['map'](_0x2dfd67=>({..._0x2dfd67,'label':this['_getTranslationWithDefault'](_0x10a7a5+'_OPTIONS_DATA_'+_0x2dfd67['id']['toUpperCase'](),_0x2dfd67['label'])})):void 0x0}))),_0x1cbc36;}['_filterChecksWithMissingModel'](_0x4fa9cb){const _0x284468=[];_0x4fa9cb['checks']['forEach'](_0x48266a=>{(_0x48266a instanceof xa&&!_0x48266a['defaultModel']||_0x48266a instanceof ya&&!_0x48266a['models']['length'])&&_0x284468['push'](_0x48266a['id']);}),_0x284468['length']&&_0x284468['forEach'](_0x3dfa9c=>{_0x4fa9cb['removeCheckById'](_0x3dfa9c),this['_logError'](new at('ai-review-mode-command-unavailable-due-to-missing-model',this,{'commandId':_0x3dfa9c}),!0x0);});}}class Ma extends _0x173dbd{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'](_0x33ebd4){this['_checks']=_0x33ebd4['map'](_0xa7651d=>new Ua(_0xa7651d));}}class Ba extends Ra{['_title'];constructor(_0x394970,_0x44a154,_0x44f9f4,_0x66548a,_0x4cf7d7,_0x169fdd){super(_0x394970,_0x44a154,_0x44f9f4,_0x4cf7d7,_0x169fdd),this['_title']=_0x66548a;}get['title'](){return this['_title'];}get['subTitle'](){return this['_sourceCheck']['title'];}}class Ga extends Oa{static get['pluginName'](){return'AITranslateController';}constructor(_0x4dd317){super(_0x4dd317),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'](_0x5d4522,_0x23eed7){return new Ba(this['_aiReviewCoreEditing']['getDocumentData'](),_0x23eed7,this['_aiConnector'],hs(this['context']['locale'],'AI_REVIEW_CHECK_TRANSLATE_TITLE'),_0x5d4522['params'],_0x5d4522['args']);}['_onReviewCheckResultActivated'](_0x280499){this['_aiReviewCoreUi']['setActiveStateInResults'](_0x280499['change']['id']),this['_aiReviewCoreEditing']['setMarkersInElementAsActive'](_0x280499['change']['id']);}['_onReviewCheckResultDeactivated'](){this['_aiReviewCoreEditing']['setAllMarkersAsInactive'](),this['_aiReviewCoreUi']['resetActiveStateInResults']();}['_onActivateChange'](_0x1efcde){this['_currentReviewCheckRun']&&('hover'===_0x1efcde['uiInteraction']&&(this['_changeActivationSource']='panel',this['_currentReviewCheckRun']['activateChange'](_0x1efcde['id'])),'click'===_0x1efcde['uiInteraction']&&this['_scrollToChange'](_0x1efcde['id']));}['_onDeactivateChange'](_0x118a0e){this['_currentReviewCheckRun']&&'panel'===_0x118a0e['origin']&&this['_currentReviewCheckRun']['deactivateChange']();}['_onChangeMarkerClicked'](_0x5b2a38,_0x5735cf){this['_currentReviewCheckRun']&&(this['_changeActivationSource']='content',this['_currentReviewCheckRun']['activateChange'](_0x5735cf['changeId']),this['_scrollToChange'](_0x5735cf['changeId']));}['_onChangeMarkerHovered'](_0x5667d3,_0x3c51b3){this['_currentReviewCheckRun']&&(this['_changeActivationSource']='content',this['_currentReviewCheckRun']['activateChange'](_0x3c51b3['changeId']),this['_aiReviewCoreEditing']['reactivateMarkers'](_0x3c51b3['changeId']));}['_onChangeMarkerBlurred'](){this['_currentReviewCheckRun']&&'content'===this['_changeActivationSource']&&(this['_currentReviewCheckRun']['deactivateChange'](),this['_aiReviewCoreEditing']['setAllMarkersAsInactive']());}['_getChangeContentElement'](_0x21de79){return this['_aiReviewCoreEditing']['getContentElementForChange'](_0x21de79);}['_markChangePositionInEditorContent'](_0x2350be,_0x2d1ef0){this['_aiReviewCoreEditing']['markChangePositionInEditorContent'](_0x2350be,_0x2d1ef0);}['_diffContent'](_0x8b4a4,_0x2bb61c,_0x58e65c){return this['_aiReviewCoreEditing']['diffContent'](_0x8b4a4,_0x2bb61c,_0x58e65c,!0x0);}['_onReviewCheckRun'](){for(const _0xb55745 of this['_aiReviewCoreEditing']['getEditors']())_0xb55745['editing']['view']['change'](_0x22b565=>{for(const _0x91ccaa of _0xb55745['editing']['view']['document']['getRoots']())_0x22b565['addClass']('ck-ai-translate-mode-content',_0x91ccaa);});}async['_getChecksList'](){const _0x2a09e7=[],_0x3b4a7c=this['context']['config']['get']('ai.translate.languages')||[];for(const _0x43da80 of _0x3b4a7c)_0x2a09e7['push']({'title':_0x43da80['label'],'id':_0x43da80['id'],'commandId':_0x43da80['id'],'description':'','isParameterized':!0x1,'useArgs':!0x0,'args':{'language':_0x43da80['id']}});const _0x41c306=new Va();return _0x41c306['setupChecks'](this['_translateChecks'](_0x2a09e7)),_0x41c306;}['_translateChecks'](_0x3d3369){return _0x3d3369['map'](_0x5561c4=>{const _0x488991='AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_'+_0x5561c4['title']['toUpperCase']()['replaceAll']('-','_');return{..._0x5561c4,'title':this['_getTranslationWithDefault'](_0x488991,_0x5561c4['title'])};});}}class Fa extends ca{constructor(_0x4efa88,_0x4c4e21){super(_0x4efa88,_0x4c4e21),this['on']('set:isLoading',(_0x154003,_0x3cdb8c,_0x5abb0b)=>{_0x5abb0b&&(this['headerTitle']=hs(this['locale'],'AI_TRANSLATE_CHECK_RESULTS_LOADING_TITLE'));}),this['on']('set:isResultReady',(_0x98cc17,_0x3d3a33,_0x4fde7f)=>{_0x4fde7f&&(this['headerTitle']=hs(this['locale'],'AI_TRANSLATE_CHECK_RESULTS_READY_TITLE'));});}['_createAcceptAllButtonView'](){const _0x4255cb=super['_createAcceptAllButtonView']();return _0x4255cb['set']('label',hs(this['locale'],'AI_TRANSLATE_ACCEPT_ALL')),_0x4255cb;}['_createExitReviewButtonView'](){const _0x454419=super['_createExitReviewButtonView']();return _0x454419['set']('label',hs(this['locale'],'AI_CHAT_HISTORY_CANCEL')),_0x454419;}}class Ka extends pa{['_setupTemplate'](){const _0x34eac8=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-translate__check-list-wrapper',_0x34eac8['if']('isVisible','ck-hidden',_0x3d8c86=>!_0x3d8c86)]},'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',_0x34eac8['if']('isVisible','ck-hidden',_0x593a8f=>!_0x593a8f)]},'children':this['_checkViews']}]});}}class Wa extends ra{static get['pluginName'](){return'AITranslateUI';}['createMainView'](){const _0x3a8212=this['context']['plugins']['get']('AITabs'),_0x1a349=this['context']['locale'],_0xd3ebbd=new eo(_0x1a349,{'label':hs(_0x1a349,'AI_REVIEW_CHECK_TRANSLATE_TITLE'),'icon':_0x199a24,'class':'ck-ai-header_review-translate','showResizeButton':_0x3a8212['showResizeButton']});_0xd3ebbd['delegate']('resizeTabs')['to'](_0x3a8212),_0xd3ebbd['bind']('isMaximized')['to'](_0x3a8212['view'],'isMaximized',_0x5ba4c6=>_0x5ba4c6);const _0x59fe50=new aa(_0x1a349,{'header':_0xd3ebbd,'list':new Ka(_0x1a349),'results':new Fa(_0x1a349,{'generalErrorText':hs(_0x1a349,'AI_TRANSLATE_GENERAL_ERROR_MESSAGE')}),'completed':new la(_0x1a349,{'headerText':hs(_0x1a349,'AI_TRANSLATE_FINISH_HEADER_TITLE'),'emptyResultsText':hs(_0x1a349,'AI_TRANSLATE_EMPTY_RESULTS_TEXT'),'buttonText':hs(_0x1a349,'AI_TRANSLATE_FINISH_BUTTON_LABEL')})});return _0x59fe50['extendTemplate']({'attributes':{'class':'ck-ai-translate-mode'}}),_0x59fe50;}['registerTab'](){const _0x3298f7=this['context']['plugins']['get']('AITabs');_0x3298f7['view']['on']('activateTab',(_0x3267bc,{newTab:_0x3ed063,oldTab:_0x4fedd1})=>{'translate'===_0x3ed063?this['fire']('getReviewCheckList'):'translate'===_0x4fedd1&&this['fire']('leaveReview');}),_0x3298f7['view']['addTab']({'id':'translate','buttonLabel':hs(this['context']['locale'],'AI_REVIEW_CHECK_TRANSLATE_TITLE'),'buttonIcon':_0x199a24,'order':0x0,'content':this['_mainView']});}}class Ya extends _0x173dbd{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 _0x21762c,Command as _0x244dfb,ContextPlugin as _0x530a64,Editor as _0x581096}from'@ckeditor/ckeditor5-core/dist/index.js';import{IconCopy as _0x2cf9ac,IconCheck as _0xfcbf97,IconError as _0x194b7d,IconSubmit as _0x26a258,IconAIHistory as _0x5db7a2,IconMagicWand as _0x6ea10d,IconRobotPencil as _0x49238c,IconMaximize as _0x28e0d9,IconMinimize as _0x1d80e4,IconShowChangesOn as _0x53c611,IconShowChangesOff as _0x3f4754,IconDocument as _0x51cd8b,IconBoxWithCross as _0x255ef9,IconBoxWithCheck as _0xe9f15a,IconBoxWithMarker as _0x330f5b,IconInfo as _0x5e8452,IconWeb as _0x1d0469,IconCancel as _0x189920,IconSelection as _0xe67e40,IconFileUpload as _0x3194f3,IconLink as _0x140843,IconBulb as _0x3ee979,IconAI as _0x48e0c5,IconPreviousArrow as _0x591ef7,IconDocumentOutline as _0x46c705,IconLoupe as _0xba848d,IconPaperClip as _0x534c6c,IconBrowseFiles as _0x5036a0,IconDropdownArrow as _0x1991bc,IconStop as _0x5b8dae,IconPlus as _0x7bd6d1,IconAIChat as _0x2ef84a,IconPin as _0xd1b736,IconThreeHorizontalDots as _0x348395,IconAIReview as _0x76da7e,IconAITranslate as _0xb0c3ee,IconAIAskAI as _0x9a1fd7,IconThumbUp as _0x45e759,IconThumbDown as _0x2a8e16,IconChevronDown as _0x32bdef,IconChevronUp as _0x1e025d,IconAIQuickActions as _0x356c4e,IconAIChatCommands as _0x38b8bf,IconAIImproveWriting as _0xd98cc6,IconAIContinueWriting as _0x5bfaed,IconAIGrammarCheck as _0x1baab8,IconAIAdjustLength as _0x4e57cc,IconAIChangeTone as _0x30b49a,IconAIOther as _0x192e8f,IconRefresh as tt,IconNextArrow as et,IconOutdated as it,IconEye as st,IconEyeCrossedOut as nt,IconChevronRight as rt}from'@ckeditor/ckeditor5-icons/dist/index.js';import{uid as ot,CKEditorError as at,ObservableMixin as ht,global as ct,isVisible as lt,Rect as ut,Collection as dt,FocusTracker as _t,KeystrokeHandler as It,first as At,logWarning as gt,logError as Ct,toArray as mt,version as pt,EmitterMixin as Et,scrollViewportToShowTarget as wt,insertToPriorityArray as Tt,scrollAncestorsToShowTarget as ft,ResizeObserver as St,_isMotionReduced as Rt,getConstrainedViewportRect as bt,DomEmitterMixin as Ot}from'@ckeditor/ckeditor5-utils/dist/index.js';import{ToolbarView as kt,ButtonView as vt,View as Nt,SpinnerView as yt,IconView as xt,AutocompleteView as Lt,ListView as Dt,ListItemGroupView as Vt,ListItemView as Pt,ButtonLabelView as Ht,FocusCycler as Mt,createLabeledTextarea as Ut,Dialog as Bt,createDropdown as Gt,addMenuToDropdown as Ft,MenuBarMenuView as Kt,MenuBarMenuListItemButtonView as Wt,DialogViewPosition as Yt,MenuBarMenuListView as $t,MenuBarMenuListItemView as qt,BodyCollection as Qt,BalloonPanelView as Xt,clickOutsideHandler as zt,addListToDropdown as jt,UIModel as Jt,submitHandler as Zt,LabeledFieldView as te,createLabeledInputText as _0x2934f1,FormHeaderView as _0x3b3599,HighlightedTextView as _0xf9dbb2,ViewCollection as _0x83e50c,FileDialogButtonView as _0x4da545,InputTextView as _0x347a68,SearchTextView as _0x360153,ListItemButtonView as _0x4b2746,ButtonLabelWithHighlightView as _0x16bda8,DropdownMenuPanelPositioningFunctions as _0x34e584,BalloonToolbar as _0x203137,FormRowView as _0x4252c0,TextareaView as _0x25a6ab}from'@ckeditor/ckeditor5-ui/dist/index.js';import{ClipboardPipeline as _0x172ff6,ClipboardMarkersUtils as _0x316909}from'@ckeditor/ckeditor5-clipboard/dist/index.js';import{ViewDocumentDomEventData as _0x9a0a56,ViewDataTransfer as _0x471674,ViewUpcastWriter as _0x59d274,Matcher as _0x4a03d5,_DetachOperation as _0x33b723,_insertIntoModelNodeList as _0x3fd73e,_removeFromModelNodeList as _0x4d0cf2,ModelRange as _0x3070cc,transformOperationSets as _0x5afac3,ViewDowncastWriter as _0x1e9e0f,ModelDocumentFragment as _0x17ef1e,ModelPosition as _0x4357c7,ModelTreeWalker as _0x20d2f3,MarkerOperation as _0x3b21c1,InsertOperation as _0x124932}from'@ckeditor/ckeditor5-engine/dist/index.js';import{unescape as _0x18f3df,escape as _0x292a51,cloneDeep as _0x19c702,throttle as _0x225d5d,debounce as _0x148416,escapeRegExp as _0x3cd3bb}from'es-toolkit/compat';import{createParser as _0x443370}from'eventsource-parser';import{CloudServices as _0xe04397}from'@ckeditor/ckeditor5-cloud-services/dist/index.js';import{parseDocument as _0x38e7a7}from'htmlparser2';import{isTag as _0x3a909c,findOne as _0x14f12e,getParent as _0x2664b3,findAll as _0x577331,removeElement as _0x497429,prepend as _0x5be902,prependChild as _0x38563a,appendChild as _0x1dab44,append as _0x3567c2,find as _0x11a870,isComment as _0x1b8f4d,replaceElement as _0x274742,getChildren as _0x31d55c,textContent as _0x3357dc}from'domutils';import ti from'dom-serializer';import{Document as _0x135e16,Element as _0x3d6efa,Text as _0xf98b0e,cloneNode as _0x26480f,isDocument as _0x2cb6f8,isText as _0x254ff4,NodeWithChildren as _0x176ff2}from'domhandler';import{MarkdownGfmMdToHtmlDefaultPlugins as _0x232c6,MarkdownGfmMdToHtml as _0x14628b}from'@ckeditor/ckeditor5-markdown-gfm/dist/index.js';import _0x2e627d from'rehype-sanitize';import{fixElementSuggestionRange as _0x10b93e,DocumentCompare as _0x4f763b,DATA_ID_MODEL_ATTRIBUTE as _0x4ab9e3,ConfirmMixin as _0x49be0b,getAllMarkersDomElementsSorted as _0x4c63f0,SuggestionsConversion as _0x2d8596,DATA_ID_VIEW_ATTRIBUTE as _0x3c1969,getMarkerDomElement as _0xbefab9}from'@ckeditor/ckeditor5-collaboration-core/dist/index.js';import _0x34ac0a from'morphdom';import{diffArrays as _0x3ef461}from'diff';const wi='_ungrouppedCommands';function Ti(_0x3c8359,_0x4fdda9){const _0x2eab0d=(0x0,_0x4fdda9['t'])('Other');return _0x3c8359['length']?'groupId'in _0x3c8359[0x0]?_0x3c8359:[{'groupId':wi,'groupLabel':_0x2eab0d,'order':0x1/0x0,'commands':_0x3c8359}]:[{'groupId':wi,'groupLabel':_0x2eab0d,'order':0x1/0x0,'commands':[]}];}const fi=globalThis['DataTransfer'],Si='ai-ui';class AIAssistantEditing extends _0x21762c{static get['pluginName'](){return'AIAssistantEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const {editor:_0x3fef4a}=this,_0x5a4df4=['ck-fake-ai-selection'];_0x3fef4a['config']['get']('ai.assistant.useTheme')&&_0x5a4df4['push']('ck-ai-assistant-ui_theme'),_0x3fef4a['conversion']['for']('editingDowncast')['markerToHighlight']({'model':Si,'view':{'classes':_0x5a4df4,'priority':0xc}}),_0x3fef4a['conversion']['for']('editingDowncast')['markerToElement']({'model':Si,'view':(_0x351cac,{writer:_0x595527})=>{if(!_0x351cac['markerRange']['isCollapsed'])return null;const _0x2f73c2=_0x595527['createUIElement']('span');return _0x595527['addClass'](['ck-fake-ai-selection','ck-fake-ai-selection_collapsed'],_0x2f73c2),_0x2f73c2;}});}['afterInit'](){!async function(_0x14b00c){const _0x32db28=_0x322be0([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]),_0x95803f=0x3dffc4e1,_0x136922=0x3df84ed9^_0x95803f,_0x221cba=window[_0x322be0([0x44,0x61,0x74,0x65])][_0x322be0([0x6e,0x6f,0x77])](),_0x1a7320=_0x14b00c[_0x322be0([0x65,0x64,0x69,0x74,0x6f,0x72])],_0x82c6fd=new window[(_0x322be0([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0xf4ba2d=>{_0x1a7320[_0x322be0([0x6f,0x6e,0x63,0x65])](_0x322be0([0x72,0x65,0x61,0x64,0x79]),_0xf4ba2d);}),_0x2a77a5={[_0x322be0([0x6b,0x74,0x79])]:_0x322be0([0x45,0x43]),[_0x322be0([0x75,0x73,0x65])]:_0x322be0([0x73,0x69,0x67]),[_0x322be0([0x63,0x72,0x76])]:_0x322be0([0x50,0x2d,0x32,0x35,0x36]),[_0x322be0([0x78])]:_0x322be0([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]),[_0x322be0([0x79])]:_0x322be0([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]),[_0x322be0([0x61,0x6c,0x67])]:_0x322be0([0x45,0x53,0x32,0x35,0x36])},_0xbb8a71=_0x1a7320[_0x322be0([0x63,0x6f,0x6e,0x66,0x69,0x67])][_0x322be0([0x67,0x65,0x74])](_0x322be0([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79]));async function _0x402570(){let _0x2a1a4e,_0x1ee78d=null,_0x2e2f73=null;try{if(_0xbb8a71==_0x322be0([0x47,0x50,0x4c]))return _0x322be0([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]);if(_0x2a1a4e=_0x4bf8c2(),!_0x2a1a4e)return _0x322be0([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);return _0x2a1a4e[_0x322be0([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])]&&(_0x2e2f73=_0x150049(_0x2a1a4e[_0x322be0([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])],_0x2a1a4e[_0x322be0([0x6a,0x74,0x69])])),await _0x492956()?_0x8b6156()?_0x4bcadd()?_0x322be0([0x45,0x78,0x70,0x69,0x72,0x65,0x64]):_0x43cc8e()?(_0x2a1a4e[_0x322be0([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])]==_0x322be0([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e])&&(_0x1ee78d=_0x5563bb(_0x322be0([0x45,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e,0x4c,0x69,0x6d,0x69,0x74]))),await _0x42c8b7()):_0x322be0([0x44,0x6f,0x6d,0x61,0x69,0x6e,0x4c,0x69,0x6d,0x69,0x74]):_0x322be0([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]):_0x322be0([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}catch{return _0x322be0([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}function _0x4bcadd(){const _0x3daa68=[_0x322be0([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e]),_0x322be0([0x74,0x72,0x69,0x61,0x6c])][_0x322be0([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x2a1a4e[_0x322be0([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])])?_0x221cba/0x3e8:0xe10*_0x136922;return _0x2a1a4e[_0x322be0([0x65,0x78,0x70])]<_0x3daa68;}function _0x8b6156(){const _0x1e5084=_0x2a1a4e[_0x322be0([0x66,0x65,0x61,0x74,0x75,0x72,0x65,0x73])];return!!_0x1e5084&&(!!_0x1e5084[_0x322be0([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x322be0([0x2a]))||!!_0x1e5084[_0x322be0([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x322be0([0x41,0x49])));}function _0x43cc8e(){const _0x41fef3=_0x2a1a4e[_0x322be0([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x64,0x48,0x6f,0x73,0x74,0x73])];if(!_0x41fef3||0x0==_0x41fef3[_0x322be0([0x6c,0x65,0x6e,0x67,0x74,0x68])])return!0x0;const {hostname:_0x2040fa}=new URL(window[_0x322be0([0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e])]['href']);if(_0x41fef3[_0x322be0([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x2040fa))return!0x0;const _0x54facd=_0x2040fa[_0x322be0([0x73,0x70,0x6c,0x69,0x74])](_0x322be0([0x2e]));return _0x41fef3[_0x322be0([0x66,0x69,0x6c,0x74,0x65,0x72])](_0x4f96d6=>_0x4f96d6[_0x322be0([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x322be0([0x2a])))[_0x322be0([0x6d,0x61,0x70])](_0x38de5a=>_0x38de5a[_0x322be0([0x73,0x70,0x6c,0x69,0x74])](_0x322be0([0x2e])))[_0x322be0([0x66,0x69,0x6c,0x74,0x65,0x72])](_0xc50844=>_0xc50844[_0x322be0([0x6c,0x65,0x6e,0x67,0x74,0x68])]<=_0x54facd[_0x322be0([0x6c,0x65,0x6e,0x67,0x74,0x68])])[_0x322be0([0x6d,0x61,0x70])](_0x2eb35e=>Array(_0x54facd[_0x322be0([0x6c,0x65,0x6e,0x67,0x74,0x68])]-_0x2eb35e[_0x322be0([0x6c,0x65,0x6e,0x67,0x74,0x68])])[_0x322be0([0x66,0x69,0x6c,0x6c])](_0x2eb35e[0x0]===_0x322be0([0x2a])?_0x322be0([0x2a]):'')[_0x322be0([0x63,0x6f,0x6e,0x63,0x61,0x74])](_0x2eb35e))[_0x322be0([0x73,0x6f,0x6d,0x65])](_0x230761=>_0x54facd[_0x322be0([0x65,0x76,0x65,0x72,0x79])]((_0x36c64a,_0x535787)=>_0x230761[_0x535787]===_0x36c64a||_0x230761[_0x535787]===_0x322be0([0x2a])));}function _0x42c8b7(){return _0x1ee78d&&_0x2e2f73?new window[(_0x322be0([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0x28d323,_0x44cb26)=>{_0x1ee78d[_0x322be0([0x74,0x68,0x65,0x6e])](_0x28d323,_0x44cb26),_0x2e2f73[_0x322be0([0x74,0x68,0x65,0x6e])](_0x126bfc=>{_0x126bfc!=_0x322be0([0x56,0x61,0x6c,0x69,0x64])&&_0x28d323(_0x126bfc);},_0x44cb26);}):_0x1ee78d||_0x2e2f73||_0x322be0([0x56,0x61,0x6c,0x69,0x64]);}}function _0x150049(_0x238176,_0x352723){return new window[(_0x322be0([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x2269da=>{if(_0x3e338d())return _0x2269da(_0x322be0([0x56,0x61,0x6c,0x69,0x64]));_0x4120fd(),_0x1a7320[_0x322be0([0x64,0x65,0x63,0x6f,0x72,0x61,0x74,0x65])](_0x322be0([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]));let _0x1239b1=!0x1;const _0x2b34ae=ot();function _0x4c3d97(_0x36fd6f){return!!_0x36fd6f&&(typeof _0x36fd6f===_0x322be0([0x6f,0x62,0x6a,0x65,0x63,0x74])||typeof _0x36fd6f===_0x322be0([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]))&&typeof _0x36fd6f[_0x322be0([0x74,0x68,0x65,0x6e])]===_0x322be0([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e])&&typeof _0x36fd6f[_0x322be0([0x63,0x61,0x74,0x63,0x68])]===_0x322be0([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]);}function _0x1df16f(_0x5c41c5){_0x583deb(_0x5c41c5)[_0x322be0([0x74,0x68,0x65,0x6e])](_0x4bbac4=>{if(!_0x4bbac4||_0x4bbac4[_0x322be0([0x73,0x74,0x61,0x74,0x75,0x73])]!=_0x322be0([0x6f,0x6b]))return _0x322be0([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]);return _0x131b8f(_0x1dfad3(_0x2b34ae+_0x352723))!=_0x4bbac4[_0x322be0([0x76,0x65,0x72,0x69,0x66,0x69,0x63,0x61,0x74,0x69,0x6f,0x6e])]?_0x322be0([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]):_0x322be0([0x56,0x61,0x6c,0x69,0x64]);})[_0x322be0([0x74,0x68,0x65,0x6e])](_0x40a99b=>(_0x2ed77c(),_0x40a99b),()=>{const _0x11dd1c=_0x383b8b();return null==_0x11dd1c?(_0x2ed77c(),_0x322be0([0x56,0x61,0x6c,0x69,0x64])):_0x322be0(_0x221cba-_0x11dd1c>(0x19f340e1^_0x95803f)?[0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]:[0x56,0x61,0x6c,0x69,0x64]);})[_0x322be0([0x74,0x68,0x65,0x6e])](_0x2269da)[_0x322be0([0x63,0x61,0x74,0x63,0x68])](()=>{_0x2269da(_0x322be0([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});const _0x17a994=0x3dc92a61^_0x95803f;function _0x2ed77c(){const _0x559079=_0x322be0([0x6c,0x6c,0x63,0x74,0x2d])+_0x131b8f(_0x1dfad3(_0x238176)),_0x3465d2=_0x178621(_0x131b8f(window[_0x322be0([0x4d,0x61,0x74,0x68])][_0x322be0([0x63,0x65,0x69,0x6c])](_0x221cba/_0x17a994)));window[_0x322be0([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0x322be0([0x73,0x65,0x74,0x49,0x74,0x65,0x6d])](_0x559079,_0x3465d2);}function _0x383b8b(){const _0x179c7f=_0x322be0([0x6c,0x6c,0x63,0x74,0x2d])+_0x131b8f(_0x1dfad3(_0x238176)),_0x3e701a=window[_0x322be0([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0x322be0([0x67,0x65,0x74,0x49,0x74,0x65,0x6d])](_0x179c7f);return _0x3e701a?window[_0x322be0([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x178621(_0x3e701a),0x10)*_0x17a994:null;}function _0x583deb(_0x25be03){return new window[(_0x322be0([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0x3dbd0f,_0x381e02)=>{_0x25be03[_0x322be0([0x74,0x68,0x65,0x6e])](_0x3dbd0f,_0x381e02),window[_0x322be0([0x73,0x65,0x74,0x54,0x69,0x6d,0x65,0x6f,0x75,0x74])](_0x381e02,0x3dfe1021^_0x95803f);});}}_0x1a7320[_0x322be0([0x6f,0x6e])](_0x322be0([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),(_0x2d2259,_0x779dcd)=>{if(_0x779dcd[0x0]!=_0x238176)return _0x2269da(_0x322be0([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));_0x779dcd[0x1]={..._0x779dcd[0x1],[_0x322be0([0x72,0x65,0x71,0x75,0x65,0x73,0x74,0x49,0x64])]:_0x2b34ae};},{[_0x322be0([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0x322be0([0x68,0x69,0x67,0x68])}),_0x1a7320[_0x322be0([0x6f,0x6e])](_0x322be0([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),_0x45b41e=>{_0x4c3d97(_0x45b41e[_0x322be0([0x72,0x65,0x74,0x75,0x72,0x6e])])&&(_0x1239b1=!0x0,_0x1df16f(_0x45b41e[_0x322be0([0x72,0x65,0x74,0x75,0x72,0x6e])]));},{[_0x322be0([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0x322be0([0x6c,0x6f,0x77])}),_0x82c6fd[_0x322be0([0x74,0x68,0x65,0x6e])](()=>{_0x1239b1||_0x2269da(_0x322be0([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});});function _0x3e338d(){return _0x1a7320[_0x322be0([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0x322be0([0x76,0x69,0x65,0x77])][_0x322be0([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]==_0x322be0([0x61,0x75,0x74,0x6f]);}function _0x4120fd(){_0x1a7320[_0x322be0([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0x322be0([0x76,0x69,0x65,0x77])][_0x322be0([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]=_0x322be0([0x61,0x75,0x74,0x6f]);}}function _0x5563bb(_0x34b778){const _0x428704=[new window[(_0x322be0([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x3287a4=>setTimeout(_0x3287a4,0x3df6fa2d^_0x95803f)),_0x82c6fd[_0x322be0([0x74,0x68,0x65,0x6e])](()=>new window[(_0x322be0([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x797951=>{let _0x29302d=0x0;_0x1a7320[_0x322be0([0x6d,0x6f,0x64,0x65,0x6c])][_0x322be0([0x6f,0x6e])](_0x322be0([0x61,0x70,0x70,0x6c,0x79,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e]),(_0x15f5d7,_0x4a709d)=>{_0x4a709d[0x0][_0x322be0([0x69,0x73,0x44,0x6f,0x63,0x75,0x6d,0x65,0x6e,0x74,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e])]&&_0x29302d++,_0x29302d==(0x3dffc109^_0x95803f)&&(_0x797951(),_0x15f5d7[_0x322be0([0x6f,0x66,0x66])]());});}))];return window[_0x322be0([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65])][_0x322be0([0x72,0x61,0x63,0x65])](_0x428704)[_0x322be0([0x74,0x68,0x65,0x6e])](()=>_0x34b778);}async function _0x261df3(){await _0x82c6fd,_0x1a7320[_0x322be0([0x6d,0x6f,0x64,0x65,0x6c])][_0x322be0([0x63,0x68,0x61,0x6e,0x67,0x65])]=_0x4b32c1,_0x1a7320[_0x322be0([0x6d,0x6f,0x64,0x65,0x6c])][_0x322be0([0x65,0x6e,0x71,0x75,0x65,0x75,0x65,0x43,0x68,0x61,0x6e,0x67,0x65])]=_0x4b32c1,_0x1a7320[_0x322be0([0x65,0x6e,0x61,0x62,0x6c,0x65,0x52,0x65,0x61,0x64,0x4f,0x6e,0x6c,0x79,0x4d,0x6f,0x64,0x65])](_0x322be0([0x6d,0x6f,0x64,0x65,0x6c]));}function _0x4561e5(_0x29097b){const _0x38db11=_0x202822();_0x1a7320[_0x38db11]=_0x322be0([0x61,0x69,0x4c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79])+_0x29097b,_0x29097b!=_0x322be0([0x56,0x61,0x6c,0x69,0x64])&&_0x261df3();}function _0x202822(){const _0xf1454f=window[_0x322be0([0x53,0x74,0x72,0x69,0x6e,0x67])](window[_0x322be0([0x70,0x65,0x72,0x66,0x6f,0x72,0x6d,0x61,0x6e,0x63,0x65])][_0x322be0([0x6e,0x6f,0x77])]())[_0x322be0([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](_0x322be0([0x2e]),'');let _0x2fa21d=_0x322be0([0x6e]);for(let _0x3249e3=0x0;_0x3249e3<_0xf1454f[_0x322be0([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0x3249e3+=0x2){let _0x50f4bd=window[_0x322be0([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0xf1454f[_0x322be0([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0x3249e3,_0x3249e3+0x2));_0x50f4bd>=_0x32db28[_0x322be0([0x6c,0x65,0x6e,0x67,0x74,0x68])]&&(_0x50f4bd-=_0x32db28[_0x322be0([0x6c,0x65,0x6e,0x67,0x74,0x68])]),_0x2fa21d+=_0x32db28[_0x50f4bd];}return _0x2fa21d;}function _0x4bf8c2(){const _0x11653b=_0xbb8a71[_0x322be0([0x73,0x70,0x6c,0x69,0x74])](_0x322be0([0x2e]));if(0x3!=_0x11653b[_0x322be0([0x6c,0x65,0x6e,0x67,0x74,0x68])])return null;return _0x209fc6(_0x11653b[0x1]);function _0x209fc6(_0x3a95d0){const _0x2c1728=_0x149b5c(_0x3a95d0);return _0x2c1728&&_0x1aa099()?_0x2c1728:null;function _0x1aa099(){const _0x571246=_0x2c1728[_0x322be0([0x6a,0x74,0x69])],_0x9232e=window[_0x322be0([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x571246[_0x322be0([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0x571246[_0x322be0([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8),0x10),_0x3f1b9f={..._0x2c1728,[_0x322be0([0x6a,0x74,0x69])]:_0x571246[_0x322be0([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](0x0,_0x571246[_0x322be0([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8)};return delete _0x3f1b9f[_0x322be0([0x76,0x63])],_0x1dfad3(_0x3f1b9f)==_0x9232e;}}}async function _0x492956(){let _0xe1d38=!0x0;try{const _0x1af332=_0xbb8a71[_0x322be0([0x73,0x70,0x6c,0x69,0x74])](_0x322be0([0x2e])),[_0x4275f0,_0x12fd09,_0x2817b0]=_0x1af332;return _0x5f5451(_0x4275f0),await _0x1f2a2b(_0x4275f0,_0x12fd09,_0x2817b0),_0xe1d38;}catch{return!0x1;}function _0x5f5451(_0x47f4a0){const _0x1084ea=_0x149b5c(_0x47f4a0);_0x1084ea&&_0x1084ea[_0x322be0([0x61,0x6c,0x67])]==_0x322be0([0x45,0x53,0x32,0x35,0x36])||(_0xe1d38=!0x1);}async function _0x1f2a2b(_0x186e9e,_0x15780e,_0x160daa){const _0x4e5d29=window[_0x322be0([0x55,0x69,0x6e,0x74,0x38,0x41,0x72,0x72,0x61,0x79])][_0x322be0([0x66,0x72,0x6f,0x6d])](_0x4cb24c(_0x160daa),_0x352a90=>_0x352a90[_0x322be0([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](0x0)),_0x54d97a=new window[(_0x322be0([0x54,0x65,0x78,0x74,0x45,0x6e,0x63,0x6f,0x64,0x65,0x72]))]()[_0x322be0([0x65,0x6e,0x63,0x6f,0x64,0x65])](_0x186e9e+_0x322be0([0x2e])+_0x15780e),_0x49c99e=window[_0x322be0([0x63,0x72,0x79,0x70,0x74,0x6f])][_0x322be0([0x73,0x75,0x62,0x74,0x6c,0x65])];if(!_0x49c99e)return;const _0x46f920=await _0x49c99e[_0x322be0([0x69,0x6d,0x70,0x6f,0x72,0x74,0x4b,0x65,0x79])](_0x322be0([0x6a,0x77,0x6b]),_0x2a77a5,{[_0x322be0([0x6e,0x61,0x6d,0x65])]:_0x322be0([0x45,0x43,0x44,0x53,0x41]),[_0x322be0([0x6e,0x61,0x6d,0x65,0x64,0x43,0x75,0x72,0x76,0x65])]:_0x322be0([0x50,0x2d,0x32,0x35,0x36])},!0x1,[_0x322be0([0x76,0x65,0x72,0x69,0x66,0x79])]);await _0x49c99e[_0x322be0([0x76,0x65,0x72,0x69,0x66,0x79])]({[_0x322be0([0x6e,0x61,0x6d,0x65])]:_0x322be0([0x45,0x43,0x44,0x53,0x41]),[_0x322be0([0x68,0x61,0x73,0x68])]:{[_0x322be0([0x6e,0x61,0x6d,0x65])]:_0x322be0([0x53,0x48,0x41,0x2d,0x32,0x35,0x36])}},_0x46f920,_0x4e5d29,_0x54d97a)||(_0xe1d38=!0x1);}}function _0x149b5c(_0x3a0a5c){return _0x3a0a5c[_0x322be0([0x73,0x74,0x61,0x72,0x74,0x73,0x57,0x69,0x74,0x68])](_0x322be0([0x65,0x79]))?JSON[_0x322be0([0x70,0x61,0x72,0x73,0x65])](_0x4cb24c(_0x3a0a5c)):null;}function _0x4cb24c(_0x422e48){return window[_0x322be0([0x61,0x74,0x6f,0x62])](_0x422e48[_0x322be0([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/-/g,_0x322be0([0x2b]))[_0x322be0([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/_/g,_0x322be0([0x2f])));}function _0x1dfad3(_0x42da5a){let _0x4d3750=0x1505;function _0x113a22(_0x1fb5bd){for(let _0x4b55bb=0x0;_0x4b55bb<_0x1fb5bd[_0x322be0([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0x4b55bb++){const _0x4e606f=_0x1fb5bd[_0x322be0([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](_0x4b55bb);_0x4d3750=(_0x4d3750<<0x5)+_0x4d3750+_0x4e606f,_0x4d3750&=_0x4d3750;}}function _0x4432f1(_0x261e13){Array[_0x322be0([0x69,0x73,0x41,0x72,0x72,0x61,0x79])](_0x261e13)?_0x261e13[_0x322be0([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](_0x4432f1):_0x261e13&&typeof _0x261e13==_0x322be0([0x6f,0x62,0x6a,0x65,0x63,0x74])?Object[_0x322be0([0x65,0x6e,0x74,0x72,0x69,0x65,0x73])](_0x261e13)[_0x322be0([0x73,0x6f,0x72,0x74])]()[_0x322be0([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](([_0xf31211,_0x3d1880])=>{_0x113a22(_0xf31211),_0x4432f1(_0x3d1880);}):_0x113a22(window[_0x322be0([0x53,0x74,0x72,0x69,0x6e,0x67])](_0x261e13));}return _0x4432f1(_0x42da5a),_0x4d3750>>>0x0;}function _0x131b8f(_0x498543){return _0x498543[_0x322be0([0x74,0x6f,0x53,0x74,0x72,0x69,0x6e,0x67])](0x10)[_0x322be0([0x70,0x61,0x64,0x53,0x74,0x61,0x72,0x74])](0x8,_0x322be0([0x30]));}function _0x178621(_0x4e4680){return _0x4e4680[_0x322be0([0x73,0x70,0x6c,0x69,0x74])]('')[_0x322be0([0x72,0x65,0x76,0x65,0x72,0x73,0x65])]()[_0x322be0([0x6a,0x6f,0x69,0x6e])]('');}function _0x4b32c1(){}function _0x322be0(_0x416969){return _0x416969['map'](_0x5b87ed=>String['fromCharCode'](_0x5b87ed))['join']('');}_0x4561e5(await _0x402570());}(this);}['showFakeVisualSelection'](){const _0xb97f71=this['editor']['model'];_0xb97f71['change'](_0xf83032=>{const _0x3a7b06=_0xb97f71['document']['selection']['getRanges']();let _0x3cf1bb=0x0;for(const _0xf7ea2f of _0x3a7b06){const _0x29d874=Si+':'+_0x3cf1bb;if(_0xb97f71['markers']['has'](_0x29d874))_0xf83032['updateMarker'](_0x29d874,{'range':_0xf7ea2f});else{if(_0xf7ea2f['start']['isAtEnd']){const _0x599c56=_0xf7ea2f['start']['getLastMatchingPosition'](({item:_0x5c0e66})=>!_0xb97f71['schema']['isContent'](_0x5c0e66),{'boundaries':_0xf7ea2f});_0xf83032['addMarker'](_0x29d874,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0xf83032['createRange'](_0x599c56,_0xf7ea2f['end'])});}else _0xf83032['addMarker'](_0x29d874,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0xf7ea2f});}_0x3cf1bb++;}});}['hideFakeVisualSelection'](){const _0x5646e0=this['editor']['model'],_0x221019=Array['from'](this['editor']['model']['markers']['getMarkersGroup'](Si));_0x221019['length']&&_0x5646e0['change'](_0x179e0f=>{_0x221019['forEach'](_0x465863=>{_0x179e0f['removeMarker'](_0x465863);});});}['insertContent'](_0x4a59d0,_0x34fb61){const _0x38fe44=this['_getAISelection'](),_0x5dc273=_0x34fb61||_0x38fe44['getFirstRange']();this['editor']['model']['canEditAt'](_0x5dc273)&&this['editor']['model']['change'](_0x33888c=>{this['hideFakeVisualSelection'](),_0x34fb61||this['_resetContentOfSelectedTableCells'](_0x33888c,_0x38fe44),this['_pasteHTMLUsingClipboard']({'insertAt':_0x5dc273,'writer':_0x33888c,'html':_0x4a59d0});});}['insertContentBelow'](_0x29dd2f){const {model:_0x34a0b2}=this['editor'],_0x2f2494=this['_getAISelection']();_0x34a0b2['change'](()=>{const _0x241cc8=this['_prepareTableInsertBelowPosition'](_0x29dd2f,_0x2f2494)||this['_getDefaultInsertBelowPosition'](_0x2f2494);this['insertContent'](_0x29dd2f,_0x241cc8);});}['_getAISelection'](){const _0x32206d=this['editor']['model'],_0x22b1e5=Array['from'](_0x32206d['markers']['getMarkersGroup'](Si))['map'](_0x2da3ef=>_0x2da3ef['getRange']());return _0x32206d['createSelection'](_0x22b1e5);}['_pasteHTMLUsingClipboard']({writer:_0x508a95,html:_0x3c1907,insertAt:_0x6a96a4}){const {view:_0x544bf5}=this['editor']['editing'],_0x18ae78=this['editor']['plugins']['get'](_0x172ff6),_0x1f9b1d=new fi();_0x1f9b1d['setData']('text/html',_0x3c1907);const _0x4730a6=new ClipboardEvent('paste',{'clipboardData':_0x1f9b1d}),_0x5f088c=new _0x9a0a56(_0x544bf5,_0x4730a6,{'dataTransfer':new _0x471674(_0x1f9b1d)});_0x508a95['setSelection'](_0x6a96a4);const _0x58a75f=(_0x555f2e,_0x753158)=>{_0x753158['resultRange']&&_0x508a95['setSelection'](_0x753158['resultRange']);};_0x18ae78['once']('contentInsertion',_0x58a75f,{'priority':'lowest'}),_0x544bf5['document']['fire']('paste',_0x5f088c),_0x18ae78['off']('contentInsertion',_0x58a75f);}['_getDefaultInsertBelowPosition'](_0x11cf54){const {model:_0x266516}=this['editor'],_0x26fa82=Array['from'](_0x11cf54['getSelectedBlocks']());return _0x26fa82['length']?_0x266516['createPositionAfter'](_0x26fa82['pop']()):_0x11cf54['getLastPosition']();}['_prepareTableInsertBelowPosition'](_0x36ee46,_0x91fdeb){const {model:_0x58e3e3,plugins:_0x5b360c}=this['editor'];if(_0x5b360c['has']('TableUtils')){const _0x73b434=_0x5b360c['get']('TableUtils')['getSelectedTableCells'](_0x91fdeb);if(_0x73b434['length']){const _0x5a9898=this['_getTableRowCountFromContent'](_0x36ee46),_0x3f90b3=this['_createEmptyTableRows'](_0x73b434,_0x5a9898);return _0x58e3e3['createPositionAt'](_0x3f90b3,0x0);}}return null;}['_getTableRowCountFromContent'](_0x433dfd){const _0x3d0dc3=this['editor']['plugins']['get']('TableUtils'),_0x5c5e17=this['editor']['data']['parse'](_0x433dfd),_0x34d9ba=Array['from'](_0x5c5e17['getChildren']())['filter'](_0x12b8bd=>_0x12b8bd['is']('element','table'));let _0x4ffb01=0x0;return _0x34d9ba['forEach'](_0x13d94e=>{_0x4ffb01+=_0x3d0dc3['getRows'](_0x13d94e);}),_0x4ffb01;}['_createEmptyTableRows'](_0x5535f,_0x1c4ee4){const _0x597764=this['editor']['plugins']['get']('TableUtils'),_0x2109d9=_0x597764['getRowIndexes'](_0x5535f),_0x568a43=_0x597764['getColumnIndexes'](_0x5535f),_0x2be994=_0x2109d9['last']+0x1,_0x541ce7=_0x568a43['first'],_0x36bf48=_0x5535f[0x0]['findAncestor']('table');for(let _0x491962=0x0;_0x491962<_0x1c4ee4;_0x491962++)_0x597764['insertRows'](_0x36bf48,{'at':_0x2be994});return _0x36bf48['getChild'](_0x2be994)['getChild'](_0x541ce7);}['_resetContentOfSelectedTableCells'](_0x1453a8,_0x3cd42f){const {plugins:_0x21f54b}=this['editor'],{model:_0x5d22e0}=_0x1453a8;if(!_0x21f54b['has']('TableUtils'))return;_0x21f54b['get']('TableUtils')['getSelectedTableCells'](_0x3cd42f)['length']&&_0x5d22e0['deleteContent'](_0x3cd42f);}}class AIAdapter extends _0x21762c{static get['pluginName'](){return'AIAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['afterInit'](){if(!this['textAdapter'])throw new at('aiadapter-text-adapter-not-set',null);}}class AIRequestError extends Error{constructor(_0x54f915){super(_0x54f915),this['name']='AIRequestError';}}function Ri(_0x4f2fd1,_0x255d94,_0x3f0405){const t=_0x4f2fd1['t'];switch(_0x255d94){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',_0x3f0405);case'Error\x20during\x20AI\x20content\x20generation:\x20%0':return t('Error\x20during\x20AI\x20content\x20generation:\x20%0',_0x3f0405);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'},_0x3f0405);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 _0x255d94;}}class ShowAIAssistantCommand extends _0x244dfb{['_commandDefinitions'];constructor(_0x2505f6,_0x396894){super(_0x2505f6),this['_commandDefinitions']=_0x396894,this['set']('enabledCommandsIds',[]),this['on']('change:_hasContext',(_0x609c7c,_0x1fd0b5,_0x5cbe43)=>{this['isEnabled']&&(this['enabledCommandsIds']=bi(this['_commandDefinitions'],_0x5cbe43));}),this['set']('_hasContext',!0x1),this['on']('change:isEnabled',(_0xcb94d2,_0x5be578,_0x3c68f7)=>{this['enabledCommandsIds']=_0x3c68f7?bi(this['_commandDefinitions'],this['_hasContext']):[];});}['refresh'](){const _0x5c1db7=this['editor']['model'];this['_hasContext']=function(_0x455275){const _0x511d97=_0x455275['document']['selection'];return _0x511d97['isCollapsed']?0x0!==[..._0x511d97['getSelectedBlocks']()]['length']&&![..._0x511d97['getSelectedBlocks']()][0x0]['isEmpty']:!!_0x455275['hasContent'](_0x511d97['getFirstRange']());}(_0x5c1db7);const _0x41f022=_0x5c1db7['document']['selection'],_0x1f2afb=this['editor']['config']['get']('ai.assistant.disabledElements');for(const _0x5bdad0 of _0x41f022['getRanges']())for(const _0x21211b of _0x5bdad0['getItems']())if(_0x21211b['is']('element')&&_0x1f2afb['includes'](_0x21211b['name']))return void(this['isEnabled']=!0x1);this['isEnabled']=!0x0;}['execute'](_0x366ee5='',_0x4d3729='',_0x8addec='custom'){this['editor']['plugins']['get'](AIAssistantUI)['showUI'](_0x366ee5,_0x4d3729,_0x8addec);}}function bi(_0x37cc9d,_0x1eabd9){const _0x45cd62=new Set();for(const _0x396d26 of _0x37cc9d['values']())(_0x1eabd9||!0x1===_0x396d26['requiresContent'])&&_0x45cd62['add'](_0x396d26['id']);return Array['from'](_0x45cd62);}const Oi=new RegExp(/^(.*?)<[a-zA-Z][a-zA-Z0-9_\-.]*[ >]/,'is');class AIAssistantController extends/* #__PURE__ -- @preserve */
|
|
24
|
+
ht(){['editor'];['textAdapter'];['view'];['_sanitizationContainer'];['_domParser'];['_xmlSerializer'];constructor(_0x10141c,_0x4913bb,_0x2149a4){super(),this['editor']=_0x10141c,this['textAdapter']=_0x4913bb,this['_sanitizationContainer']=document['createElement']('div'),this['_domParser']=new DOMParser(),this['_xmlSerializer']=new XMLSerializer(),this['view']=_0x2149a4,this['set']({'initialContext':'','currentContext':'','currentResponse':'','previousContext':void 0x0,'previousQuery':void 0x0,'previousLabel':void 0x0,'isProcessing':!0x1}),this['on']('set:currentContext',(_0x52a2a5,_0x336ea2,_0x58c3dc)=>{this['view']['value']=this['_sanitizeHTML'](_0x58c3dc);}),this['listenTo'](this['view'],'submitPrompt',(_0x4e527a,_0x435541)=>{const _0x462c7f=this['currentContext']||this['initialContext'];this['_handleQuery'](_0x435541,_0x462c7f,'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:_0x2ea2aa,query:_0x568cf5,htmlContent:_0xe8d150,label:_0x4cd1f3,mainActionLabel:_0x238f2d}){this['view']['prompt']=_0x4cd1f3,this['view']['mainAction']=_0x238f2d,this['initialContext']=_0xe8d150,_0x568cf5&&(this['view']['isRendered']?this['_handleQuery'](_0x568cf5,_0xe8d150,_0x2ea2aa,_0x4cd1f3):this['view']['once']('render',()=>{this['_handleQuery'](_0x568cf5,_0xe8d150,_0x2ea2aa,_0x4cd1f3);}));}['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'](_0x1b176c,_0xfabb9d,_0x51d1fd,_0xf5abce){return this['isProcessing']=!0x0,this['view']['startProcessing'](),this['previousContext']=_0xfabb9d,this['previousQuery']=_0x1b176c,this['previousLabel']=_0xf5abce||_0x1b176c,this['previousActionId']=_0x51d1fd,new Promise(_0x189b3f=>{this['textAdapter']['makeRequest']({'query':_0x1b176c,'context':_0xfabb9d,'onData':_0x47ad22=>{this['currentResponse']=_0x47ad22,this['currentContext']=this['_parseAndNormalizeContent'](this['currentResponse']);},'actionId':_0x51d1fd})['then'](()=>{!this['currentContext']&&this['currentResponse']&&(this['currentContext']=this['_parseAndNormalizeContent'](this['currentResponse'],!0x0));})['catch'](_0x55290a=>{_0x55290a instanceof AIRequestError?this['view']['handleError'](_0x55290a['message']):this['view']['handleError'](),_0x189b3f();})['finally'](()=>{this['stopProcessing'](),_0x189b3f();});});}['_parseAndNormalizeContent'](_0x830512,_0x29e337=!0x1){const _0x400479=Oi['exec'](_0x830512);_0x830512=_0x400479?_0x830512['substring'](_0x400479[0x1]['length']):_0x830512['length']<0x64&&!_0x29e337?'':this['_stripMarkdownSyntax'](_0x830512);const _0x47b692=this['_domParser']['parseFromString'](_0x830512,'text/html');if(_0x400479){const _0x32cb10=Array['from'](_0x47b692['body']['childNodes']);_0x32cb10['reverse']();for(const _0x3e4893 of _0x32cb10){if(_0x3e4893['nodeType']==Node['ELEMENT_NODE'])break;_0x3e4893['remove']();}}const _0x5f1bf0=this['editor']['data']['processor']['toView'](this['_xmlSerializer']['serializeToString'](_0x47b692['body']));this['_isH1TagSupportEnabled']()||this['_normalizeResponseHeadings'](_0x5f1bf0);const _0x2fffa8=this['editor']['config']['get']('ai.assistant.preserveComments'),_0x384977=this['editor']['data']['toModel'](_0x5f1bf0);return _0x2fffa8||_0x384977['markers']['clear'](),this['editor']['data']['stringify'](_0x384977);}['_normalizeResponseHeadings'](_0xda8506){const _0x164872=new _0x59d274(this['editor']['editing']['view']['document']),_0x558e18=new _0x4a03d5({'name':/^h[1-5]$/}),_0x443921=[];let _0x4d030c=!0x1;for(const _0x5bc680 of _0xda8506)_0x5bc680['is']('element')&&_0x558e18['match'](_0x5bc680)&&(_0x443921['push'](_0x5bc680),'h1'==_0x5bc680['name']&&(_0x4d030c=!0x0));if(_0x4d030c){for(const _0x4e12bd of _0x443921)_0x164872['rename']('h'+(parseInt(_0x4e12bd['name'][0x1])+0x1),_0x4e12bd);}}['_isH1TagSupportEnabled'](){const {data:_0x2f7350,editing:_0x58264f}=this['editor'],_0x30c3cb=_0x2f7350['htmlProcessor']['toView']('<h1></h1>'),_0x1855b1=_0x2f7350['toView'](_0x2f7350['toModel'](_0x30c3cb));return!!_0x58264f['view']['domConverter']['viewToDom'](_0x1855b1)['querySelector']('h1');}['_sanitizeHTML'](_0xcdba4c){return this['editor']['editing']['view']['domConverter']['setContentOf'](this['_sanitizationContainer'],_0xcdba4c),this['_sanitizationContainer']['innerHTML'];}['_stripMarkdownSyntax'](_0x9e88c4){const _0x249fc2=_0x9e88c4['trim']();return _0x249fc2['startsWith']('```html')?_0x249fc2['endsWith']('```')?_0x249fc2['substring'](0x7,_0x249fc2['length']-0x3):_0x249fc2['substring'](0x7):_0x9e88c4;}}const ki={'REPLACE':'replace','INSERT':'insert'};class AIFormToolbarView extends kt{constructor(_0xbe900b){super(_0xbe900b),this['set']('isVisible',!0x1),this['set']('mainAction',ki['REPLACE']),this['replaceButton']=this['_createButton']('','ck-button-action'),this['replaceButton']['bind']('label')['to'](this,'mainAction',_0x19710f=>Ri(_0xbe900b,'AI_'+_0x19710f['toUpperCase']()+'_CONTENT')),this['insertButton']=this['_createButton'](Ri(_0xbe900b,'Insert\x20below')),this['tryAgainButton']=this['_createButton'](Ri(_0xbe900b,'Try\x20again')),this['stopButton']=this['_createButton'](Ri(_0xbe900b,'Stop'));const _0x4833ea=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':['ck-ai-form__toolbar',_0x4833ea['if']('isVisible','ck-hidden',_0x2dfed7=>!_0x2dfed7)]}}),this['items']['addMany']([this['replaceButton'],this['insertButton'],this['tryAgainButton'],this['stopButton']]);}['_createButton'](_0x456d8b,_0xa4f42a){const _0x6272a0=new vt(this['locale']);return _0x6272a0['set']({'label':_0x456d8b,'class':_0xa4f42a||'','isVisible':!0x0,'withText':!0x0}),_0x6272a0;}}class AIFormContentArea extends Nt{['contentFieldView'];['copyButtonView'];constructor(_0x146e58,_0x1942f8=''){super(_0x146e58),this['set']({'value':null,'isVisible':!0x1,'isProcessing':!0x1});const _0x2c36c5=this['bindTemplate'];this['contentFieldView']=new ContentFieldView(_0x146e58,_0x1942f8),this['copyButtonView']=this['_createCopyButton'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area-wrapper',_0x2c36c5['if']('isVisible','ck-hidden',_0x17a3c8=>!_0x17a3c8)],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area',_0x2c36c5['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 _0x3ef950=!0x1;this['on']('change:value',(_0x2429b5,_0x3c1946,_0x8897fe)=>{const _0x295357=!this['contentFieldView']['element']['querySelector']('.ck-ai-form__loader');this['contentFieldView']['setContent'](_0x8897fe),this['isProcessing']&&_0x295357&&!_0x3ef950&&this['element']['scrollTo']({'top':this['element']['scrollHeight'],'behavior':'smooth'});}),this['on']('change:isProcessing',(_0x37cb53,_0x353474,_0x8b4ab9)=>{_0x3ef950=!0x1,_0x8b4ab9?(this['value']=null,this['contentFieldView']['appendLoader']()):this['value']||this['contentFieldView']['setContent']('');}),this['listenTo'](this['element'],'wheel',()=>{_0x3ef950=!0x0;}),this['listenTo'](this['element'],'mousedown',()=>{_0x3ef950=!0x0;});}['focus'](){this['element']['focus']();}['_createCopyButton'](){const _0x48bbbf=this['locale'],_0x1bdc75=new vt(this['locale']),_0x55494b='ck-ai-form__copy-button';return _0x1bdc75['set']({'label':Ri(_0x48bbbf,'Copy'),'icon':_0x2cf9ac,'class':_0x55494b,'tooltip':!0x0}),_0x1bdc75['bind']('isVisible')['to'](this,'value',_0x4f1935=>!!_0x4f1935),_0x1bdc75['bind']('isEnabled')['to'](this,'isProcessing',_0x33ad94=>!_0x33ad94),_0x1bdc75['on']('execute',()=>{this['_copyHTMLToClipboard'](this['contentFieldView']['element']),_0x1bdc75['icon']=_0xfcbf97,_0x1bdc75['class']=_0x55494b+'\x20ck-ai-form__copy-button--copied',this['focus'](),setTimeout(()=>{_0x1bdc75['icon']=_0x2cf9ac,_0x1bdc75['class']=_0x55494b;},0x3e8);}),_0x1bdc75;}['_copyHTMLToClipboard'](_0x246ce3){const {window:_0xf0d3f6,document:_0x2e7adc}=ct;if(_0xf0d3f6['ClipboardItem']){const {Blob:_0x451ec5,ClipboardItem:_0x1ccf83}=_0xf0d3f6,_0x1612ea=[new _0x1ccf83({'text/html':new _0x451ec5([_0x246ce3['innerHTML']],{'type':'text/html'}),'text/plain':new _0x451ec5([_0x246ce3['textContent']||''],{'type':'text/plain'})})];navigator['clipboard']['write'](_0x1612ea);}else{const _0x4c298a=_0x2e7adc['createElement']('div');_0x4c298a['style']['position']='absolute',_0x4c298a['style']['left']='-9999px',_0x4c298a['innerHTML']='<span>[</span>'+_0x246ce3['innerHTML']+'<span>]</span>',_0x2e7adc['body']['appendChild'](_0x4c298a);const _0x82dd9=_0x2e7adc['createRange']();_0x82dd9['setStartAfter'](_0x4c298a['firstElementChild']),_0x82dd9['setEndBefore'](_0x4c298a['lastElementChild']);const _0x1a4e7f=_0xf0d3f6['getSelection']();_0x1a4e7f['removeAllRanges'](),_0x1a4e7f['addRange'](_0x82dd9),_0x2e7adc['execCommand']('copy'),_0x4c298a['remove']();}}}class ContentFieldView extends Nt{constructor(_0x3b51fe,_0x2b9f4e=''){super(_0x3b51fe),this['loaderView']=this['_createLoader'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-content',_0x2b9f4e,'ck-reset_all-excluded','ck-ai-form__content-field']}});}['setContent'](_0x19fd3f){this['element']['innerHTML']=_0x19fd3f;}['appendLoader'](){this['element']['appendChild'](this['loaderView']['element']);}['_createLoader'](){const _0x1fc788=new Nt(),_0x134eba=this['locale'],_0x24fc27=new yt();return _0x24fc27['isVisible']=!0x0,_0x1fc788['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__loader']},'children':[_0x24fc27,{'text':Ri(_0x134eba,'AI\x20is\x20writing...')}]}),_0x1fc788['render'](),_0x1fc788;}}class AIFormErrorView extends Nt{constructor(_0xde5d85,_0x3be8ac=''){super(_0xde5d85);const _0x3c01ed=new xt(),_0x53b78f=this['bindTemplate'];this['set']('text',_0x3be8ac),_0x3c01ed['content']=_0x194b7d,this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__error']},'children':[_0x3c01ed,{'text':_0x53b78f['to']('text')}]});}}class AIFormPromptView extends Lt{['submitButtonView'];['showHistoryButtonView'];constructor(_0x182430,_0x500c8f){super(_0x182430,_0x500c8f),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',(_0x207b3b,_0x5dfca2)=>{_0x207b3b['target']==this['queryView']['fieldView']['element']&&(this['submit'](),_0x5dfca2());});}['_createSubmitButton'](){const _0x308452=new vt(this['locale']),_0x1fb2d5=this['locale'];return _0x308452['set']({'icon':_0x26a258,'label':Ri(_0x1fb2d5,'Submit'),'isVisible':!0x0,'tooltip':!0x0,'class':'ck-ai-form__submit'}),_0x308452['on']('execute',()=>{this['submit']();}),_0x308452['bind']('isEnabled')['to'](this['queryView']['fieldView'],'isEmpty',this,'isEnabled',(_0x4aca5b,_0x5428d0)=>!_0x4aca5b&&_0x5428d0),_0x308452;}['_createShowHistoryButton'](){const _0xfa49dd=new vt(this['locale']),_0x4446bf=this['resultsView'],_0x5d5378=this['locale'];_0xfa49dd['set']({'label':Ri(_0x5d5378,'History'),'withText':!0x1,'icon':_0x5db7a2,'tooltip':!0x0,'tooltipPosition':'sw','class':'ck-ai-form__toggle-history'}),_0xfa49dd['bind']('isOn')['to'](_0x4446bf,'isVisible'),_0xfa49dd['bind']('isEnabled')['to'](this,'isEnabled'),_0xfa49dd['on']('execute',()=>{_0x4446bf['isVisible']=!_0x4446bf['isVisible'],_0x4446bf['isVisible']?this['filteredView']['focus']():this['focus']();});const _0x580898=()=>{ct['window']['requestAnimationFrame'](()=>{if(lt(this['element'])){const _0x566cfe=new ut(this['queryView']['fieldView']['element']),_0x3fff0e=_0x566cfe['width'],_0x5770e7='rtl'===_0x5d5378['uiLanguageDirection']?'left':'right';_0x566cfe['excludeScrollbarsAndBorders'](),_0xfa49dd['element']['style'][_0x5770e7]=_0x3fff0e-_0x566cfe['width']+0x1+'px';}});};return this['queryView']['fieldView']['on']('update',_0x580898),this['on']('render',_0x580898),_0xfa49dd;}['submit'](){const _0x28715c=this['queryView']['fieldView']['element']['value'];this['fire']('submit',_0x28715c);}['focus'](_0x1ff48c){-0x1===_0x1ff48c?this['focusCycler']['focusLast']():this['focusCycler']['focusFirst']();}}class AIHistoryListView extends Dt{['historyGroupView'];['clearHistoryButton'];constructor(_0x4976e3){super(_0x4976e3),this['clearHistoryButton']=this['_createClearHistoryButton'](),this['historyGroupView']=new Vt(),this['historyGroupView']['children']['add'](this['clearHistoryButton'],0x1),this['historyGroupView']['label']=Ri(_0x4976e3,'Prompt\x20history'),this['historyGroupView']['items']['delegate']('execute')['to'](this),this['items']['add'](this['historyGroupView']);}['filter'](){let _0x32bf52=0x0;for(const _0x5a0d8f of this['items'])_0x32bf52+=_0x5a0d8f['items']['length'];return{'resultsCount':_0x32bf52,'totalItemsCount':_0x32bf52};}['_createClearHistoryButton'](){const _0x1c319c=this['locale'],_0x1a1aee=new vt(this['locale']);return _0x1a1aee['set']({'label':'('+Ri(_0x1c319c,'Clear')+')','withText':!0x0}),_0x1a1aee['on']('execute',()=>this['fire']('clearHistory')),_0x1a1aee;}}class AIHistoryListItemView extends Pt{constructor(_0x29ce31){super();const _0x5c2ccd=new Ht(),_0x29cadf=new vt(this['locale'],_0x5c2ccd);this['children']['add'](_0x29cadf),_0x29cadf['set']({'label':_0x29ce31['prompt'],'withText':!0x0}),_0x29cadf['on']('execute',()=>{this['fire']('execute',{'value':_0x18f3df(_0x29ce31['prompt'])});});}}const vi='CKEditor/AIFormView/PromptHistory';class PromptHistory extends dt{constructor(){super(),this['_loadFromSessionStorage'](),this['on']('add',(_0xb966c1,_0x2e5b91)=>{const _0x35fdd3=Ni(_0x2e5b91['prompt']);for(const _0x44d242 of this)if(_0x44d242!=_0x2e5b91&&Ni(_0x44d242['prompt'])===_0x35fdd3){this['remove'](_0x44d242);break;}this['length']>0x14&&this['remove'](this['last']),this['_saveToSessionStorage']();}),this['on']('remove',()=>{this['_saveToSessionStorage']();});}['_loadFromSessionStorage'](){const _0x37c695=sessionStorage['getItem'](vi)||'[]';this['addMany'](JSON['parse'](_0x37c695));}['_saveToSessionStorage'](){sessionStorage['setItem'](vi,JSON['stringify'](this['map'](_0x3523d9=>_0x3523d9)));}}function Ni(_0x2ac6db){return _0x2ac6db['toLowerCase']()['trim']();}class AIFormView extends Nt{['focusTracker'];['keystrokes'];['contentArea'];['toolbar'];['promptView'];['errorView'];['_focusables'];['focusCycler'];['_promptHistory'];constructor(_0x57b2d1,_0x57c085,_0x1346dc=''){super(_0x57b2d1),this['set']('isEnabled',!0x0),this['set']('isProcessing',!0x1),this['set']('prompt',''),this['set']('value',''),this['set']('isError',!0x1),this['set']('mainAction',ki['REPLACE']),this['_promptHistory']=new PromptHistory(),this['errorView']=new AIFormErrorView(_0x57b2d1),this['contentArea']=new AIFormContentArea(_0x57b2d1,_0x1346dc),this['contentArea']['bind']('isProcessing')['to'](this),this['contentArea']['bind']('value')['to'](this),this['toolbar']=this['_createToolbar'](),this['toolbar']['bind']('mainAction')['to'](this),this['promptView']=this['_createPromptView'](),this['focusTracker']=new _t(),this['keystrokes']=new It(),this['_focusables']=this['createCollection']([this['contentArea'],this['contentArea']['copyButtonView'],this['toolbar'],this['promptView']]),this['focusCycler']=new Mt({'focusables':this['_focusables'],'focusTracker':this['focusTracker'],'keystrokeHandler':this['keystrokes'],'actions':{'focusPrevious':'shift\x20+\x20tab','focusNext':'tab'}}),this['focusCycler']['chain'](this['promptView']['focusCycler']),this['promptView']['queryView']['fieldView']['bind']('value')['to'](this,'prompt');const _0x262d0c=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form',_0x57c085],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-form-content']},'children':[{'tag':'div','attributes':{'class':[_0x262d0c['if']('isError','ck-hidden',_0x51e084=>!_0x51e084)]},'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'](_0x3d7292=0x1){-0x1===_0x3d7292?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 _0x4f753c=this['locale'],_0x374014=new AIFormPromptView(_0x4f753c,{'queryView':{'label':Ri(_0x4f753c,'Ask\x20AI\x20to\x20edit\x20or\x20generate'),'creator':Ut,'showIcon':!0x1,'showResetButton':!0x1},'infoView':{'text':{'noSearchableItems':{'primary':Ri(_0x4f753c,'Empty\x20history'),'secondary':Ri(_0x4f753c,'Ask\x20AI\x20and\x20your\x20prompts\x20will\x20be\x20listed\x20here\x20for\x20you\x20to\x20use\x20later.')}}},'filteredView':this['_createHistoryView'](),'queryMinChars':0x1/0x0,'resetOnBlur':!0x1});return _0x374014['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',(_0x5d259e,_0x58a45e)=>_0x5d259e&&!_0x58a45e),this['listenTo'](_0x374014,'submit',(_0x13e5cb,_0x54aa2c)=>{this['prompt']=_0x54aa2c;const _0x2763c2=_0x292a51(_0x54aa2c);this['fire']('submitPrompt',_0x2763c2),_0x54aa2c['trim']()&&this['_promptHistory']['add']({'prompt':_0x2763c2},0x0);},{'priority':'high'}),_0x374014;}['_createHistoryView'](){const _0x362c4d=new AIHistoryListView(this['locale']);return _0x362c4d['historyGroupView']['items']['bindTo'](this['_promptHistory'])['as'](AIHistoryListItemView),_0x362c4d['on']('clearHistory',()=>{this['_promptHistory']['clear'](),this['promptView']['search'](''),this['promptView']['focus']();}),_0x362c4d;}['_createToolbar'](){const _0xf9ee74=new AIFormToolbarView(this['locale']);return _0xf9ee74['replaceButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',this,'value',(_0x16ac9c,_0x30f20,_0x26ed2c)=>_0x16ac9c&&!_0x30f20&&!!_0x26ed2c),_0xf9ee74['replaceButton']['delegate']('execute')['to'](this,'replaceContent'),_0xf9ee74['insertButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',this,'value',(_0x55ef29,_0x582822,_0x56d973)=>_0x55ef29&&!_0x582822&&!!_0x56d973),_0xf9ee74['insertButton']['delegate']('execute')['to'](this,'insertContentBelow'),_0xf9ee74['tryAgainButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',(_0x2508fc,_0xd6ec86)=>_0x2508fc&&!_0xd6ec86),_0xf9ee74['tryAgainButton']['delegate']('execute')['to'](this,'tryAgainEvent'),_0xf9ee74['stopButton']['bind']('isEnabled')['to'](this,'isProcessing'),_0xf9ee74['stopButton']['delegate']('execute')['to'](this,'stopProcessing'),_0xf9ee74;}['startProcessing'](){this['value']='',this['isError']=!0x1,this['isProcessing']=!0x0,this['contentArea']['isVisible']=!0x0,this['toolbar']['isVisible']=!0x0,this['contentArea']['focus']();}['finishProcessing'](){const _0x5e0e12=this['locale'];this['isProcessing']=!0x1,this['prompt']='',this['promptView']['reset'](),this['value']&&(this['promptView']['queryView']['label']=Ri(_0x5e0e12,'Ask\x20AI\x20to\x20improve\x20generated\x20text'));}['handleError'](_0x5783de){const _0x10f28c=this['locale'];this['finishProcessing'](),this['isError']=!0x0,this['errorView']['text']=_0x5783de||Ri(_0x10f28c,'AI_ERROR_FAILED'),this['value']||(this['contentArea']['isVisible']=!0x1);}}const yi=globalThis['DataTransfer'];class AIAssistantUI extends _0x21762c{['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[_0x316909,AIAssistantEditing,AIAdapter,Bt];}constructor(_0x46420d){super(_0x46420d),_0x46420d['config']['define']('ai.assistant.disabledElements',['media','rawHtml','tableOfContents']),_0x46420d['config']['define']('ai.assistant.contentAreaCssClass',''),_0x46420d['config']['define']('ai.assistant.useTheme',!0x0),this['_uiCssClasses']='ck-ai-assistant-ui'+(_0x46420d['config']['get']('ai.assistant.useTheme')?'\x20ck-ai-assistant-ui_theme':'');}['init'](){const {editor:_0x244026}=this;this['_aiAdapter']=_0x244026['plugins']['get'](AIAdapter),this['_dialog']=_0x244026['plugins']['get'](Bt),this['_formView']=null,this['_commandDefinitions']=this['_getResolvedCommandsDefinitions']();const _0x14da28=new ShowAIAssistantCommand(_0x244026,Array['from'](this['_commandDefinitions']['values']()));_0x244026['commands']['add']('showAIAssistant',_0x14da28),_0x244026['ui']['componentFactory']['add']('aiCommands',_0x58c123=>{const _0x558983=Gt(_0x58c123);return _0x558983['set']({'class':'ck-ai-commands-dropdown\x20'+this['_uiCssClasses']}),_0x558983['buttonView']['set']({'label':Ri(_0x58c123,'AI\x20Commands'),'icon':_0x6ea10d,'tooltip':!0x0}),_0x558983['on']('execute',_0x274d82=>this['_onExecute'](_0x274d82['source']['id'])),Ft(_0x558983,_0x244026['ui']['view']['body'],function(_0x2fa5b8){const _0x7dc9f2=Ti(_0x2fa5b8['config']['get']('ai.assistant.commands'),_0x2fa5b8['locale']),_0x4b36b7=Li(_0x2fa5b8,_0x7dc9f2)['filter'](_0x5bfcf5=>_0x5bfcf5['commands']['length']);if(0x1===_0x4b36b7['length'])return Li(_0x2fa5b8,_0x4b36b7[0x0]['commands'])['map'](_0x590112=>({'id':_0x590112['id'],'label':_0x590112['label']}));return _0x4b36b7['map'](_0x4cd33a=>{const {groupId:_0xa0a650,groupLabel:_0x501586,commands:_0x24e449}=_0x4cd33a,_0x145159=Li(_0x2fa5b8,_0x24e449)['map'](_0x31a186=>({'id':_0x31a186['id'],'label':_0x31a186['label']}));return{'id':_0xa0a650,'menu':_0x501586||_0xa0a650,'children':_0x145159};});}(_0x244026),{'ariaLabel':Ri(_0x58c123,'AI\x20Commands')}),_0x558983['menuView']['menuPanelClass']='ck-ai-commands-dropdown\x20'+this['_uiCssClasses'],_0x14da28['on']('change:enabledCommandsIds',_0x261748),_0x558983['menuView']['once']('render',_0x261748),_0x558983;function _0x261748(){_0x558983['isEnabled']=_0x14da28['enabledCommandsIds']['length']>0x0;for(const _0x25b65f of _0x558983['menuView']['buttons'])_0x25b65f['isEnabled']=_0x14da28['enabledCommandsIds']['includes'](_0x25b65f['id']);}}),_0x244026['ui']['componentFactory']['add']('menuBar:aiCommands',_0x2418e6=>{const _0x585b79=new Kt(_0x2418e6);_0x585b79['buttonView']['set']({'label':Ri(_0x2418e6,'AI\x20Commands'),'icon':_0x6ea10d}),_0x585b79['bind']('isEnabled')['to'](_0x14da28,'enabledCommandsIds',_0x534efd=>_0x534efd['length']>0x0);const _0x14f81f=Ti(_0x244026['config']['get']('ai.assistant.commands'),_0x2418e6);return this['_populateMenuBarMenu'](_0x14da28,_0x585b79,_0x14f81f,_0x4ce2ee=>this['_onExecute'](_0x4ce2ee)),_0x585b79;}),_0x244026['ui']['componentFactory']['add']('aiAssistant',()=>{const _0x397370=this['_createAIAssistantUIButton'](vt);return _0x397370['set']({'tooltip':!0x0,'class':'ck-ai-assistant-button\x20'+this['_uiCssClasses']}),_0x397370;}),_0x244026['ui']['componentFactory']['add']('menuBar:aiAssistant',()=>{const _0x5d62d4=this['_createAIAssistantUIButton'](Wt);return _0x5d62d4['set']({'role':'menuitemcheckbox'}),_0x5d62d4;}),this['licenseKey']=this['editor']['config']['get']('licenseKey');const _0x447112=this['editor'];this['_licenseKeyCheckInterval']=setInterval(()=>{let _0xd101e1;for(const _0x4f0806 in _0x447112){const _0x2ffd17=_0x4f0806,_0xb808af=_0x447112[_0x2ffd17];if('aiLicenseKeyValid'==_0xb808af||'aiLicenseKeyInvalid'==_0xb808af||'aiLicenseKeyExpired'==_0xb808af||'aiLicenseKeyDomainLimit'==_0xb808af||'aiLicenseKeyNotAllowed'==_0xb808af||'aiLicenseKeyEvaluationLimit'==_0xb808af||'aiLicenseKeyUsageLimit'==_0xb808af){delete _0x447112[_0x2ffd17],_0xd101e1=_0xb808af,clearInterval(this['_licenseKeyCheckInterval']),this['_licenseKeyCheckInterval']=void 0x0;break;}}'aiLicenseKeyInvalid'==_0xd101e1&&_0x447112['_showLicenseError']('invalid'),'aiLicenseKeyExpired'==_0xd101e1&&_0x447112['_showLicenseError']('expired'),'aiLicenseKeyDomainLimit'==_0xd101e1&&_0x447112['_showLicenseError']('domainLimit'),'aiLicenseKeyNotAllowed'==_0xd101e1&&_0x447112['_showLicenseError']('featureNotAllowed','AIAssistant'),'aiLicenseKeyEvaluationLimit'==_0xd101e1&&_0x447112['_showLicenseError']('evaluationLimit'),'aiLicenseKeyUsageLimit'==_0xd101e1&&_0x447112['_showLicenseError']('usageLimit');},0x3e8);}['destroy'](){super['destroy'](),this['_licenseKeyCheckInterval']&&clearInterval(this['_licenseKeyCheckInterval']);}['showUI'](_0x318fae='',_0x30422f='',_0x5ad413='custom'){const _0x390bb7=this['editor'],_0x5d9b5e=_0x390bb7['editing']['view'],_0x48a08b=_0x390bb7['plugins']['get'](AIAssistantEditing),_0x309435=_0x390bb7['plugins']['get'](_0x316909);_0x48a08b['showFakeVisualSelection']();const _0x332046=new yi(),_0x344a68=new ClipboardEvent('copy',{'clipboardData':_0x332046}),_0x298840=new _0x471674(_0x332046),_0x187ff1=new _0x9a0a56(_0x5d9b5e,_0x344a68,{'dataTransfer':_0x298840});_0x309435['_forceMarkersCopy']('comment',()=>{_0x5d9b5e['document']['fire']('copy',_0x187ff1);}),this['_formView']||(this['_initView'](),this['_aiAssistantController']=new AIAssistantController(_0x390bb7,this['_aiAdapter']['textAdapter'],this['_formView']));let _0x4a38c8=_0x298840['getData']('text/html');const _0x10d5b7=_0x390bb7['model']['document']['selection'],_0x34d03e=Array['from'](_0x10d5b7['getRanges']());0x1===_0x34d03e['length']&&_0x34d03e[0x0]['isFlat']&&!_0x10d5b7['getSelectedElement']()&&''!==_0x4a38c8['replace'](/ /g,'')['trim']()&&(_0x4a38c8='<p>'+_0x4a38c8+'</p>'),this['_aiAssistantController']['updateView']({'actionId':_0x5ad413,'query':_0x318fae,'htmlContent':_0x4a38c8,'label':_0x30422f,'mainActionLabel':ki[_0x390bb7['model']['document']['selection']['isCollapsed']?'INSERT':'REPLACE']}),'aiAssistant'!==this['_dialog']['id']?this['_dialog']['show']({'id':'aiAssistant','icon':_0x49238c,'title':Ri(this['editor']['locale'],'AI\x20Assistant'),'content':this['_formView'],'position':Yt['EDITOR_TOP_SIDE'],'onShow':()=>{this['_formView']['focus']();},'onHide':()=>{this['_aiAssistantController']['reset'](),_0x48a08b['hideFakeVisualSelection']();}}):this['_dialog']['view']['wasMoved']||this['_dialog']['view']['updatePosition']();}['hideUI'](){this['_dialog']['hide']();}['_getResolvedCommandsDefinitions'](){const _0x4fc6df=new Map(),_0x2bd7bd=Ti(this['editor']['config']['get']('ai.assistant.commands'),this['editor']['locale']);for(const _0xaf9776 of _0x2bd7bd)for(const _0x4ff9ba of _0xaf9776['commands'])_0x4fc6df['set'](_0x4ff9ba['id'],{..._0x4ff9ba,'groupId':_0xaf9776['groupId'],'groupLabel':_0xaf9776['groupLabel']||_0xaf9776['groupId']});return _0x4fc6df;}['_createAIAssistantUIButton'](_0x32529d){const _0x4c5a6c=this['editor'],_0x7bd601=_0x4c5a6c['commands']['get']('showAIAssistant'),_0x277f4d=new _0x32529d(_0x4c5a6c['locale']);return _0x277f4d['set']({'label':Ri(_0x4c5a6c['locale'],'AI\x20Assistant'),'icon':_0x49238c,'isToggleable':!0x0}),_0x277f4d['bind']('isEnabled')['to'](_0x7bd601),_0x277f4d['bind']('isOn')['to'](this['_dialog'],'id',_0x24cee2=>'aiAssistant'===_0x24cee2),this['listenTo'](_0x277f4d,'execute',()=>{_0x277f4d['isOn']?this['hideUI']():_0x7bd601['execute']();}),_0x277f4d;}['_initView'](){const _0x443ac0=this['editor']['plugins']['get'](AIAssistantEditing);this['_formView']=new AIFormView(this['editor']['locale'],this['_uiCssClasses'],this['editor']['config']['get']('ai.assistant.contentAreaCssClass')),this['_formView']['on']('change:value',()=>{this['_dialog']['view']['wasMoved']||this['_dialog']['view']['updatePosition']();}),this['_formView']['promptView']['queryView']['fieldView']['on']('update',()=>{this['_dialog']['view']['wasMoved']||this['_dialog']['view']['updatePosition']();}),this['listenTo'](this['_formView'],'replaceContent',()=>{_0x443ac0['insertContent'](this['_aiAssistantController']['currentContext']),this['hideUI']();}),this['listenTo'](this['_formView'],'insertContentBelow',()=>{_0x443ac0['insertContentBelow'](this['_aiAssistantController']['currentContext']),this['hideUI']();}),this['_initAriaAiStatusChangeAnnouncements']();}['_initAriaAiStatusChangeAnnouncements'](){const {locale:_0x431590,ui:{ariaLiveAnnouncer:_0x5551f7}}=this['editor'];this['_formView']['contentArea']['on']('change:isProcessing',(_0xe25ac0,_0x11b208,_0x37e3ba)=>{const _0x9a9a68=this['_aiAssistantController']['currentContext'];_0x37e3ba?_0x5551f7['announce'](Ri(_0x431590,'AI\x20is\x20writing')):_0x9a9a68&&_0x5551f7['announce'](Ri(_0x431590,'Generated\x20content:\x20%0',_0x9a9a68),{'politeness':'polite','isUnsafeHTML':!0x0});}),this['_formView']['on']('change:isError',(_0x5db45d,_0xfa2696,_0x126dd4)=>{if(_0x126dd4){const _0x3712f1=this['_formView']['errorView']['text'];_0x5551f7['announce'](Ri(_0x431590,'Error\x20during\x20AI\x20content\x20generation:\x20%0',_0x3712f1));}});}['_onExecute'](_0x550f0f){const _0x59fa3b=this['_commandDefinitions']['get'](_0x550f0f),_0x49e0ce=this['editor'],_0x354eac=_0x49e0ce['model']['document']['selection'],_0x9d72bd=_0x49e0ce['commands']['get']('showAIAssistant'),_0x4e4c5e=_0x49e0ce['plugins']['get'](AIAssistantEditing),_0x2539db=''+(_0x59fa3b['groupId']!==wi?_0x59fa3b['groupLabel']+':\x20':'')+_0x59fa3b['label'];if(!0x1!==_0x59fa3b['requiresContent']&&_0x354eac['isCollapsed']){const _0x1cd13a=At(_0x354eac['getSelectedBlocks']())||_0x49e0ce['model']['schema']['getLimitElement'](_0x354eac);_0x49e0ce['model']['change'](_0xd5c77=>{_0xd5c77['setSelection'](_0x1cd13a,'in');});}_0x4e4c5e['showFakeVisualSelection'](),_0x9d72bd['execute'](_0x59fa3b['prompt'],_0x2539db,'command:'+_0x550f0f);}['_populateMenuBarMenu'](_0x95eefe,_0x1d4aa0,_0x5388a5,_0x1ae05e){const _0x328f78=this['editor'],_0x5e7d17=_0x328f78['locale'],_0x4e8dd7=new $t(_0x5e7d17),_0x1f3f88=Li(_0x328f78,_0x5388a5)['filter'](_0x2a27ea=>_0x2a27ea['commands']['length']);0x1===_0x1f3f88['length']?this['_getMenuBarGroupButtons']({'command':_0x95eefe,'commands':_0x1f3f88[0x0]['commands'],'parentMenuView':_0x1d4aa0,'onExecute':_0x1ae05e})['forEach'](_0x3cfb99=>_0x4e8dd7['items']['add'](_0x3cfb99)):_0x1f3f88['forEach'](({groupId:_0x333778,groupLabel:_0x4feae3,commands:_0xf09987})=>{const _0x315bc4=new qt(_0x5e7d17,_0x1d4aa0),_0x7bc048=new Kt(_0x5e7d17),_0x2c32e4=new $t(_0x5e7d17),_0x5ea554=this['_getMenuBarGroupButtons']({'command':_0x95eefe,'commands':_0xf09987,'parentMenuView':_0x7bc048,'onExecute':_0x1ae05e});_0x7bc048['buttonView']['set']({'label':_0x4feae3||_0x333778}),_0x7bc048['delegate']('execute')['to'](_0x1d4aa0),_0x2c32e4['items']['addMany'](_0x5ea554),_0x7bc048['panelView']['children']['add'](_0x2c32e4),_0x315bc4['children']['add'](_0x7bc048),_0x4e8dd7['items']['add'](_0x315bc4);}),_0x1d4aa0['panelView']['children']['add'](_0x4e8dd7);}['_getMenuBarGroupButtons']({command:_0x3483ff,commands:_0x29ac17,parentMenuView:_0x17b37e,onExecute:_0x20edd2}){const _0x4625e0=this['editor'],_0x2779e8=_0x4625e0['locale'];return Li(_0x4625e0,_0x29ac17)['map'](_0x4687e8=>{const _0x3d5620=new qt(_0x2779e8,_0x17b37e),_0x410d5e=new Wt(_0x2779e8);return _0x410d5e['set']({'label':_0x4687e8['label']}),_0x410d5e['delegate']('execute')['to'](_0x17b37e),_0x410d5e['on']('execute',()=>_0x20edd2(_0x4687e8['id'])),_0x410d5e['bind']('isEnabled')['to'](_0x3483ff,'enabledCommandsIds',_0x7b6baf=>_0x7b6baf['includes'](_0x4687e8['id'])),_0x3d5620['children']['add'](_0x410d5e),_0x3d5620;});}}function xi(_0x4c2e09,_0x27438f){return void 0x0!==_0x4c2e09['order']&&void 0x0===_0x27438f['order']?0x1:void 0x0===_0x4c2e09['order']&&void 0x0!==_0x27438f['order']?-0x1:void 0x0!==_0x4c2e09['order']&&void 0x0!==_0x27438f['order']?_0x4c2e09['order']-_0x27438f['order']:0x0;}function Li(_0x1ae138,_0x275d07){_0x275d07['sort'](xi);const _0x413aa8={},_0x5207ce=[];for(const _0x3e9b80 of _0x275d07)if(void 0x0!==_0x3e9b80['order']){if(_0x3e9b80['order']in _0x413aa8)throw new at('ai-commands-config-order-collision',_0x1ae138,{'conflictingDefinitions':[_0x3e9b80,_0x413aa8[_0x3e9b80['order']]]});_0x413aa8[_0x3e9b80['order']]=_0x3e9b80,_0x5207ce['splice'](_0x3e9b80['order'],0x0,_0x3e9b80);}else _0x5207ce['push'](_0x3e9b80);return _0x5207ce;}class AIAssistant extends _0x21762c{static get['requires'](){return[AIAssistantUI,AIAssistantEditing];}static get['pluginName'](){return'AIAssistant';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x167994){super(_0x167994);const _0x50dcb9=_0x167994['config'],_0x22ce7f=_0x167994['locale'];_0x50dcb9['define']('ai.assistant.preserveComments',!0x0),_0x50dcb9['define']('ai.assistant.commands',Di(_0x22ce7f)),_0x50dcb9['define']('ai.assistant.extraCommandGroups',[]),_0x50dcb9['define']('ai.assistant.removeCommands',[]);let _0x5f147d=Ti(_0x50dcb9['get']('ai.assistant.commands'),_0x22ce7f);const _0x1027c8=_0x50dcb9['get']('ai.assistant.extraCommandGroups'),_0x37e67e=_0x50dcb9['get']('ai.assistant.removeCommands');_0x1027c8['forEach'](_0x220cde=>{const _0x20eea2=_0x5f147d['find'](_0x4adaed=>_0x4adaed['groupId']===_0x220cde['groupId']);_0x20eea2?_0x20eea2['commands']=_0x20eea2['commands']['concat'](_0x220cde['commands']):_0x5f147d['push'](_0x220cde);}),_0x5f147d=_0x5f147d['filter'](_0x5ed478=>!_0x37e67e['includes'](_0x5ed478['groupId'])),_0x5f147d['forEach'](_0x4fa7e6=>{_0x4fa7e6['commands']=_0x4fa7e6['commands']['filter'](_0x481a9d=>!_0x37e67e['includes'](_0x481a9d['id']));}),_0x50dcb9['set']('ai.assistant.commands',_0x5f147d);}}function Di(_0x519732){return[{'groupId':'editOrReview','groupLabel':Ri(_0x519732,'Edit\x20or\x20review'),'commands':[{'id':'improveWriting','label':Ri(_0x519732,'Improve\x20writing'),'prompt':'Fix\x20spelling\x20mistakes,\x20use\x20proper\x20grammar\x20and\x20apply\x20good\x20writing\x20practices.\x20Do\x20not\x20lose\x20the\x20original\x20meaning.'},{'id':'makeShorter','label':Ri(_0x519732,'Make\x20shorter'),'prompt':'Remove\x20any\x20repetitive,\x20redundant,\x20or\x20non-essential\x20writing\x20in\x20this\x20content\x20without\x20changing\x20the\x20meaning\x20or\x20losing\x20any\x20key\x20information.'},{'id':'makeLonger','label':Ri(_0x519732,'Make\x20longer'),'prompt':'Improve\x20this\x20content\x20by\x20using\x20descriptive\x20language\x20and\x20inserting\x20more\x20information\x20and\x20more\x20detailed\x20explanations.'},{'id':'simplifyLanguage','label':Ri(_0x519732,'Simplify\x20language'),'prompt':'Simplify\x20the\x20writing\x20style\x20of\x20this\x20content\x20and\x20reduce\x20the\x20complexity,\x20so\x20that\x20the\x20content\x20is\x20easy\x20to\x20understand.'}]},{'groupId':'generate','groupLabel':Ri(_0x519732,'Generate\x20from\x20selection'),'commands':[{'id':'summarize','label':Ri(_0x519732,'Summarize'),'prompt':'Summarize\x20this\x20content\x20into\x20one\x20paragraph\x20of\x20text.\x20Include\x20only\x20the\x20key\x20ideas\x20and\x20conclusions.\x20Keep\x20it\x20short.\x20Do\x20not\x20keep\x20original\x20text\x20formatting.'},{'id':'continue','label':Ri(_0x519732,'Continue'),'prompt':'Start\x20with\x20the\x20provided\x20content\x20and\x20write\x20at\x20the\x20end\x20of\x20it\x20continuing\x20this\x20topic.\x20Keep\x20the\x20added\x20part\x20short.'}]},{'groupId':'changeTone','groupLabel':Ri(_0x519732,'Change\x20tone'),'commands':[{'id':'professional','label':Ri(_0x519732,'Professional'),'prompt':'Improve\x20using\x20polished,\x20formal,\x20and\x20respectful\x20language\x20to\x20convey\x20professional\x20expertise\x20and\x20competence.'},{'id':'casual','label':Ri(_0x519732,'Casual'),'prompt':'Improve\x20using\x20casual,\x20informal\x20language\x20to\x20convey\x20a\x20casual\x20conversation\x20with\x20a\x20real\x20person.'},{'id':'direct','label':Ri(_0x519732,'Direct'),'prompt':'Improve\x20using\x20direct\x20language,\x20using\x20only\x20the\x20essential\x20information.'},{'id':'confident','label':Ri(_0x519732,'Confident'),'prompt':'Improve\x20using\x20compelling,\x20optimistic\x20language\x20to\x20convey\x20confidence\x20in\x20the\x20writing.'},{'id':'friendly','label':Ri(_0x519732,'Friendly'),'prompt':'Improve\x20using\x20friendly,\x20comforting\x20language,\x20to\x20convey\x20understanding\x20and\x20empathy.'}]},{'groupId':'changeStyle','groupLabel':Ri(_0x519732,'Change\x20style'),'commands':[{'id':'business','label':Ri(_0x519732,'Business'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20business\x20professional\x20with\x20formal\x20language.'},{'id':'legal','label':Ri(_0x519732,'Legal'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20legal\x20professional\x20using\x20valid\x20legal\x20terminology.'},{'id':'journalism','label':Ri(_0x519732,'Journalism'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20journalist\x20using\x20engaging\x20language\x20to\x20convey\x20the\x20importance\x20of\x20the\x20information.'},{'id':'poetic','label':Ri(_0x519732,'Poetic'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20poem\x20using\x20poetic\x20techniques\x20without\x20losing\x20the\x20original\x20meaning.'}]},{'groupId':'translate','groupLabel':Ri(_0x519732,'Translate'),'commands':[{'id':'translateEnglish','label':Ri(_0x519732,'English'),'prompt':'Translate\x20the\x20content\x20to\x20English\x20language.'},{'id':'translateSpanish','label':Ri(_0x519732,'Spanish'),'prompt':'Translate\x20the\x20content\x20to\x20Spanish\x20language.'},{'id':'translatePortuguese','label':Ri(_0x519732,'Portuguese'),'prompt':'Translate\x20the\x20content\x20to\x20Portuguese\x20language.'},{'id':'translateGerman','label':Ri(_0x519732,'German'),'prompt':'Translate\x20the\x20content\x20to\x20German\x20language.'},{'id':'translateFrench','label':Ri(_0x519732,'French'),'prompt':'Translate\x20the\x20content\x20to\x20French\x20language.'},{'id':'translateChinese','label':Ri(_0x519732,'Simplified\x20Chinese'),'prompt':'Translate\x20the\x20content\x20to\x20Simplified\x20Chinese\x20language.'},{'id':'translateHindi','label':Ri(_0x519732,'Hindi'),'prompt':'Translate\x20the\x20content\x20to\x20Hindi\x20language.'},{'id':'translateArabic','label':Ri(_0x519732,'Arabic'),'prompt':'Translate\x20the\x20content\x20to\x20Arabic\x20language.'}]}];}class AITextAdapter extends _0x21762c{['abortController'];static get['requires'](){return[AIAdapter];}constructor(_0x3e8061){super(_0x3e8061),this['abortController']=new AbortController();}['init'](){this['editor']['plugins']['get'](AIAdapter)['textAdapter']=this;}['abort'](){this['abortController']['signal']['aborted']||(this['abortController']['abort'](),this['abortController']=new AbortController());}async['makeRequest'](_0x46ba16){return this['sendRequest'](_0x46ba16)['catch'](_0x377248=>{if(_0x377248 instanceof AIRequestError)return Promise['reject'](_0x377248);if('AbortError'==_0x377248['name'])return Promise['resolve']();throw console['error'](_0x377248),new at('aitextadapter-send-request-failed',null);});}async['_prepareRequestHeaders'](_0x219017,_0x2e295b){const _0x2fb03d=this['editor']['locale'],_0x3d59c0={'Content-Type':'application/json'};if('object'==typeof _0x219017)Object['assign'](_0x3d59c0,_0x219017);else{if(_0x219017)try{const _0x4d92bd=await _0x219017(_0x2e295b);Object['assign'](_0x3d59c0,_0x4d92bd);}catch{return Promise['reject'](new AIRequestError(Ri(_0x2fb03d,'AI_ERROR_GET_HEADERS')));}}return _0x3d59c0;}async['_prepareRequestParameters'](_0x2a34f0,_0x30bfe6){const _0x5bb2c7=this['editor']['locale'];if('object'==typeof _0x2a34f0)return _0x2a34f0;try{return await _0x2a34f0(_0x30bfe6);}catch{return Promise['reject'](new AIRequestError(Ri(_0x5bb2c7,'AI_ERROR_GET_PARAMETERS')));}}}class OpenAITextAdapter extends AITextAdapter{['_apiUrl'];['_requestHeaders'];['_requestParameters'];static get['pluginName'](){return'OpenAITextAdapter';}constructor(_0x52679b){super(_0x52679b),_0x52679b['config']['define']('ai.assistant.adapter.openAI.apiUrl','https://api.openai.com/v1/chat/completions'),_0x52679b['config']['get']('ai.assistant.adapter.openAI.requestParameters')||_0x52679b['config']['define']('ai.assistant.adapter.openAI.requestParameters',{'model':'gpt-4o','temperature':0x1,'top_p':0x1,'stream':!0x0}),this['_apiUrl']=_0x52679b['config']['get']('ai.assistant.adapter.openAI.apiUrl'),this['_requestHeaders']=_0x52679b['config']['get']('ai.assistant.adapter.openAI.requestHeaders')||{},this['_requestParameters']=_0x52679b['config']['get']('ai.assistant.adapter.openAI.requestParameters');}async['sendRequest']({query:_0x309f75,context:_0x2b9293,onData:_0x2735cc,actionId:_0x44c655}){const _0x4dbdeb=this['editor']['locale'],_0x1ad2dc=await this['prepareMessages'](_0x309f75,_0x2b9293,_0x44c655),_0x28b813=await this['_prepareRequestHeaders'](this['_requestHeaders'],_0x44c655),_0x595033=await this['_prepareRequestParameters'](this['_requestParameters'],_0x44c655),_0x2ed28f={'messages':_0x1ad2dc,..._0x595033},_0x45a976={'method':'POST','headers':_0x28b813,'body':JSON['stringify'](_0x2ed28f),'signal':this['abortController']['signal']},_0x29951d=await fetch(this['_apiUrl'],_0x45a976);if(_0x29951d['ok'])return _0x595033['stream']?await this['_readStreamableResponse'](_0x29951d,_0x2735cc):await this['_readStaticResponse'](_0x29951d,_0x2735cc),Promise['resolve']();{const _0x18f385=await _0x29951d['text']();return _0x18f385['includes']('context_length_exceeded')?Promise['reject'](new AIRequestError(Ri(_0x4dbdeb,'AI_ERROR_CONTEXT_LENGTH'))):_0x18f385['includes']('Moderation')?Promise['reject'](new AIRequestError(Ri(_0x4dbdeb,'AI_ERROR_MODERATION'))):Promise['reject'](new Error(_0x18f385));}}async['prepareMessages'](_0x163772,_0x173c39,_0x276cee){let _0x4d5065,_0x49b706;return _0x173c39?(_0x4d5065='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.',_0x49b706='Instruction:\x0a'+_0x163772+'\x0aYou\x20must\x20keep\x20the\x20text\x20formatting.\x0a\x0aContent:\x0a'+_0x173c39):(_0x4d5065='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.',_0x49b706=_0x163772),[{'role':'system','content':_0x4d5065},{'role':'user','content':_0x49b706}];}async['_readStreamableResponse'](_0x25340d,_0x24ed64){const _0x5f4809=_0x25340d['body']['getReader'](),_0x3a5f30=new TextDecoder();let _0x291d44='',_0x28d4fc='',_0x589632='',_0x71e630=!0x1;for(;!_0x71e630;){const {done:_0x4e7db3,value:_0x3b174e}=await _0x5f4809['read'](),_0x246829=_0x291d44+_0x3a5f30['decode'](_0x3b174e);let _0x267052='';_0x71e630=_0x4e7db3;try{_0x267052=this['_cleanUpData'](_0x246829),_0x291d44='';}catch{_0x291d44=_0x246829;continue;}_0x28d4fc+=_0x267052,!_0x71e630&&this['_isBufferIncomplete'](_0x28d4fc)||_0x28d4fc&&(_0x589632+=_0x28d4fc,_0x28d4fc='',_0x24ed64(_0x589632));}return Promise['resolve']();}async['_readStaticResponse'](_0x4659c3,_0x99d836){return _0x99d836((await _0x4659c3['json']())['choices'][0x0]['message']['content']),Promise['resolve']();}['_isBufferIncomplete'](_0x2235a8){const _0x23fd83=_0x2235a8['split']('<')['length']!==_0x2235a8['split']('>')['length'],_0x377d7d=_0x2235a8['length']<0x1e;return _0x23fd83&&_0x377d7d;}['_cleanUpData'](_0x4dd6eb){return _0x4dd6eb['split'](/\n(?![^{]*\})/g)['map'](_0x2d1ed7=>_0x2d1ed7['replace']('data:\x20',''))['filter'](_0x312ab1=>_0x312ab1&&_0x312ab1['length']>0x0&&'[DONE]'!==_0x312ab1)['map'](_0x24b469=>{const {choices:_0x439b6f}=JSON['parse'](_0x24b469);if(_0x439b6f[0x0]?.['delta']?.['content'])return _0x439b6f[0x0]['delta']['content'];})['filter'](_0x137609=>_0x137609)['join']('');}}class AWSTextAdapter extends AITextAdapter{static get['pluginName'](){return'AWSTextAdapter';}['init'](){super['init'](),gt('ai-aws-adapter-not-supported');}async['sendRequest'](_0x530278){throw Ct('ai-aws-adapter-not-supported'),new AIRequestError(Ri(this['editor']['locale'],'AI_ERROR_AWS_NOT_SUPPORTED'));}}class TabButtonView extends vt{constructor(_0x11955c,_0x35863e={}){super(_0x11955c),this['isToggleable']=!0x0,this['set']('side',_0x35863e['side']||'top');const _0x223eaf=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':['ck-tab-button',...mt(_0x35863e['class']||[]),_0x223eaf['to']('side',_0x3692fc=>'ck-tab-button_'+_0x3692fc),_0x223eaf['to']('class')]}});}['show'](){this['set']('isVisible',!0x0);}['hide'](){this['set']('isVisible',!0x1);}}class TabPanelView extends Nt{['children'];constructor(_0x435315,_0x34ce64={}){super(_0x435315);const _0x3c83de=this['bindTemplate'];this['set']('isVisible',!0x1),this['set']('class',''),this['children']=this['createCollection'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-tab-panel',...mt(_0x34ce64['class']||[]),_0x3c83de['to']('class'),_0x3c83de['if']('isVisible','ck-hidden',_0x4d82e9=>!_0x4d82e9)]},'children':this['children']});}['show'](){this['set']('isVisible',!0x0);}['hide'](){this['set']('isVisible',!0x1);}}class AITabsView extends Nt{['buttonViews']=this['createCollection']();['panelViews']=this['createCollection']();['_tabs']=new Map();constructor(_0x140886,_0x5aafe2={}){super(_0x140886),this['set']('class',void 0x0),this['set']('activeTab',null),this['set']('side',_0x5aafe2['side']||'top'),this['set']('isMaximized',!0x1),this['set']('collapsible',_0x5aafe2['collapsible']||!0x1),this['set']('_isMaximizedActive',!0x1),this['bind']('_isMaximizedActive')['to'](this,'isMaximized',this,'activeTab',(_0x176a15,_0x548981)=>_0x176a15&&null!==_0x548981);const _0x35074e=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset','ck-tabs',...mt(_0x5aafe2['class']||[]),_0x35074e['to']('side',_0x30175f=>'ck-tabs_'+_0x30175f),_0x35074e['to']('class'),_0x35074e['if']('_isMaximizedActive','ck-ai-tabs_maximized'),_0x35074e['to']('activeTab',_0x47ab2a=>null===_0x47ab2a?'ck-ai-tabs_collapsed':'')],'tabindex':'0'},'children':[{'tag':'div','attributes':{'class':['ck','ck-tabs__buttons-container',_0x35074e['to']('side',_0x46acac=>'ck-tabs__buttons-container_'+_0x46acac)]},'children':this['buttonViews']},{'tag':'div','attributes':{'class':['ck','ck-tabs__panels-container',_0x35074e['to']('side',_0x17f905=>'ck-tabs__panels-container_'+_0x17f905)]},'children':this['panelViews']},...mt(_0x5aafe2['children']||[])]});}['getTabIds'](){return[...this['_tabs']['keys']()];}['getTab'](_0x332708){const _0x13b263=this['_tabs']['get'](_0x332708);return _0x13b263||null;}['addTab'](_0x340570){const _0x21e21a=this['_setupButton']({'id':_0x340570['id'],'label':_0x340570['buttonLabel'],'icon':_0x340570['buttonIcon'],'order':_0x340570['order']}),_0x3bb3c8=new TabPanelView(this['locale']);return _0x3bb3c8['render'](),_0x340570['content']&&_0x3bb3c8['children']['add'](_0x340570['content']),this['panelViews']['add'](_0x3bb3c8),this['_tabs']['set'](_0x340570['id'],{'button':_0x21e21a,'panel':_0x3bb3c8,'order':void 0x0!==_0x340570['order']?_0x340570['order']:null}),this['fire']('addTab:'+_0x340570['id'],{'id':_0x340570['id'],'button':_0x21e21a,'panel':_0x3bb3c8}),null===this['activeTab']?this['activateTab'](_0x340570['id']):this['_hidePanel'](_0x340570['id']),{'button':_0x21e21a,'panel':_0x3bb3c8};}['activateTab'](_0x19a05d){if(null!==_0x19a05d&&!this['getTab'](_0x19a05d))throw new at('ui-tabsview-tab-not-found',{'tabs':this,'tabId':_0x19a05d});if(this['activeTab']===_0x19a05d)return;const _0x31772a=this['activeTab'];this['activeTab']&&this['_hidePanel'](this['activeTab']),this['activeTab']=_0x19a05d,_0x19a05d&&this['_showPanel'](_0x19a05d),this['fire']('activateTab:'+_0x19a05d,{'newTab':_0x19a05d,'oldTab':_0x31772a});}['toggleTabPanel'](_0x20abf0){if(!this['getTab'](_0x20abf0))throw new at('ui-tabsview-tab-not-found',{'tabs':this,'tabId':_0x20abf0});this['activeTab']===_0x20abf0?this['collapsible']&&(this['activeTab']=null):this['activateTab'](_0x20abf0);}['showTab'](_0x241da8){if(!this['getTab'](_0x241da8))throw new at('ui-tabsview-tab-not-found',{'tabs':this,'tabId':_0x241da8});this['_showPanel'](_0x241da8),this['_showButton'](_0x241da8),this['fire']('show:'+_0x241da8,_0x241da8);}['hideTab'](_0x5b1ec5){if(!this['getTab'](_0x5b1ec5))throw new at('ui-tabsview-tab-not-found',{'tabs':this,'tabId':_0x5b1ec5});const _0x407bcd=this['activeTab'];this['_hidePanel'](_0x5b1ec5),this['_hideButton'](_0x5b1ec5);const _0x48c9c0=this['getTabIds']();_0x407bcd===_0x5b1ec5&&_0x48c9c0['length']>0x1&&this['activateTab'](_0x48c9c0['find'](_0x24fbe7=>_0x24fbe7!==_0x5b1ec5)),this['fire']('hide:'+_0x5b1ec5,_0x5b1ec5);}['_getPanel'](_0x117415){const _0x2e147e=this['_tabs']['get'](_0x117415);return _0x2e147e?_0x2e147e['panel']:null;}['_showPanel'](_0x8f849f){null!==this['activeTab']&&this['activeTab']!==_0x8f849f||this['_getPanel'](_0x8f849f)['show']();}['_hidePanel'](_0x4d2d39){const _0x219e93=this['_getPanel'](_0x4d2d39);_0x219e93['isVisible']&&(this['activeTab']===_0x4d2d39&&(this['activeTab']=null),_0x219e93['hide']());}['_getButton'](_0x54c02e){const _0x42b69b=this['_tabs']['get'](_0x54c02e);return _0x42b69b?_0x42b69b['button']:null;}['_showButton'](_0x4123d3){this['_getButton'](_0x4123d3)['show']();}['_hideButton'](_0x4a37ad){this['_getButton'](_0x4a37ad)['hide']();}['_setupButton'](_0x3c4a41){const _0x135371=new TabButtonView(this['locale'],{'side':this['side']}),_0xb88423=this['buttonViews'];if(_0x135371['set']({'label':_0x3c4a41['label'],'icon':_0x3c4a41['icon'],'tooltip':!0x0,'withText':!0x0}),_0x135371['bind']('isOn')['to'](this,'activeTab',_0x5c5627=>_0x5c5627===_0x3c4a41['id']),_0x135371['bind']('side')['to'](this,'side'),_0x3c4a41['order']){const _0x34c192=[...this['_tabs']]['reduce']((_0x545c22,_0x14e376)=>{const _0x28d594=_0x14e376[0x0],{order:_0x3a1099}=_0x14e376[0x1];return!_0x3a1099||_0x3a1099>_0x3c4a41['order']?_0x545c22:_0x3a1099>=_0x545c22['order']?{'id':_0x28d594,'order':_0x3a1099}:_0x545c22;},{'id':'','order':0x0}),_0x108378=_0xb88423['getIndex'](this['_getButton'](_0x34c192['id']));_0xb88423['add'](_0x135371,_0x108378+0x1);}else _0xb88423['add'](_0x135371);return _0x135371['on']('execute',()=>{this['toggleTabPanel'](_0x3c4a41['id']);}),_0x135371;}}const Vi=['overlay','sidebar','custom'],Pi=['left','right'];class AITabsMainView extends AITabsView{constructor(_0x47e100,_0x4f5044={}){super(_0x47e100,_0x4f5044),this['set']('type',_0x4f5044['type']||'sidebar'),this['set']('side',_0x4f5044['side']||'right'),this['set']('isVisible',_0x4f5044['visibleByDefault']??!0x0);const _0x49ff5a=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':['ck-ai-tabs',_0x49ff5a['if']('type','ck-ai-tabs__overlay',_0x55683d=>'overlay'===_0x55683d),_0x49ff5a['if']('type','ck-ai-tabs__sidebar',_0x2f4fdf=>'sidebar'===_0x2f4fdf),_0x49ff5a['if']('isVisible','ck-hidden',_0x8275d=>!_0x8275d)]}}),this['buttonViews']['on']('add',(_0x4bcd4f,_0x26d77b)=>{_0x26d77b['set']('withText',!0x1);});}}class AITabs extends _0x530a64{['view'];['container']=null;['showResizeButton']=!0x0;static get['pluginName'](){return'AITabs';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x2e4547){if(super(_0x2e4547),!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 _0x393323=this['context']['config']['get']('ai.container');if(this['set']('side','right'),void 0x0!==_0x393323['showResizeButton']&&(this['showResizeButton']=_0x393323['showResizeButton']),'sidebar'!==_0x393323['type']&&'overlay'!==_0x393323['type']||_0x393323['side']&&(this['side']=_0x393323['side']),'sidebar'===_0x393323['type']){if(this['container']=_0x393323['element'],this['set']('type','sidebar'),!this['container'])throw new at('ai-tabs-sidebar-container-element-not-found');}else'overlay'===_0x393323['type']?(this['container']=document['body'],this['set']('type','overlay')):(this['container']=null,this['set']('type','custom'));this['view']=new AITabsMainView(this['context']['locale'],{'side':this['side'],'type':this['type'],'visibleByDefault':_0x393323['visibleByDefault'],'collapsible':_0x393323['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 _0x581096&&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'](_0x1c1fc6){if(_0x1c1fc6&&this['type']!==_0x1c1fc6){if(!Vi['includes'](_0x1c1fc6))throw new at('ai-tabs-unsupported-ui-type');this['type']=_0x1c1fc6;}}['switchSide'](_0x9c7a35){if(_0x9c7a35&&this['side']!==_0x9c7a35){if(!Pi['includes'](_0x9c7a35))throw new at('ai-tabs-unsupported-ui-side');this['side']=_0x9c7a35;}}['destroy'](){super['destroy'](),this['view']['destroy'](),this['view']['element']&&this['view']['element']['remove']();}}class AIConnector extends _0x530a64{['_apiUrl'];['_token'];['_decoder'];['_responseCache'];static get['requires'](){return[_0xe04397];}static get['pluginName'](){return'AIConnector';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x24c60d){super(_0x24c60d),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 _0xda8599=this['context']['plugins']['get'](_0xe04397);if(!_0xda8599['token'])throw new at('ai-missing-token',this);this['_token']=_0xda8599['token'];}['startConversation'](_0x310652,_0x5cb267){const _0x26438b=this['_sendApiRequest']('/conversations','POST',{'id':_0x310652,'group':_0x5cb267});return{'getConversation':async()=>(await _0x26438b['request'])['json'](),'abortController':_0x26438b['abortController']};}['queryAssistant']({message:_0x40c787,conversationId:_0x3cd1be,parts:_0x28fca9,capabilities:_0x54c8b7,model:_0x770dc0,attributes:_0xd80f3e}){const _0x432586={'prompt':_0x40c787,'content':_0x28fca9,'model':_0x770dc0,..._0x54c8b7&&{'capabilities':_0x54c8b7},..._0xd80f3e&&{'attributes':_0xd80f3e}},_0x139e5c=this['_sendApiRequest']('/conversations/'+_0x3cd1be+'/messages','POST',_0x432586);return{'getStream':async()=>{const _0x24c375=(await _0x139e5c['request'])['body'];return this['_getStreamReader'](_0x24c375);},'abortController':_0x139e5c['abortController']};}['executeCustomAction']({content:_0x2abad5,message:_0x32ebc4,model:_0x39a595,outputFormat:_0x5a8795}){const _0x2fedc3={'content':[{'type':'text','content':_0x2abad5}],'prompt':_0x32ebc4,'model':_0x39a595,'outputFormat':_0x5a8795},_0x342630=this['_sendApiRequest']('/actions/custom/calls','POST',_0x2fedc3);return{'getStream':async()=>{const _0x5db938=(await _0x342630['request'])['body'];return this['_getStreamReader'](_0x5db938);},'abortController':_0x342630['abortController']};}['executeAction']({actionName:_0x116235,content:_0x270979,args:_0x23993c}){const _0x4d4274={'content':[{'type':'text','content':_0x270979}],'args':_0x23993c},_0x29191b=this['_sendApiRequest']('/actions/system/'+_0x116235+'/calls','POST',_0x4d4274);return{'getStream':async()=>{const _0x1e6d9a=(await _0x29191b['request'])['body'];return this['_getStreamReader'](_0x1e6d9a);},'abortController':_0x29191b['abortController']};}['uploadFile'](_0x3c70cf,_0x39d5d7,_0x3a2218){const _0x553a2a=new FormData();_0x553a2a['append']('file',_0x39d5d7,_0x39d5d7['name']),_0x3a2218&&_0x553a2a['append']('attributes',JSON['stringify'](_0x3a2218));const _0x1d5f1b=this['_sendApiRequest']('/conversations/'+_0x3c70cf+'/files','POST',_0x553a2a);return{'getId':async()=>(await _0x1d5f1b['request'])['json'](),'abortController':_0x1d5f1b['abortController']};}['fetchDocument'](_0x5411a5,_0x2efd9b){const _0x394758=this['_sendApiRequest']('/conversations/'+_0x5411a5+'/documents/'+_0x2efd9b,'GET');return{'getDocument':async()=>(await _0x394758['request'])['json'](),'abortController':_0x394758['abortController']};}['uploadDocument'](_0x349ff3,_0x4895d1,_0x4b56eb){const _0x1ba609={'content':_0x4895d1};_0x4b56eb&&(_0x1ba609['attributes']=_0x4b56eb);const _0x46df89=this['_sendApiRequest']('/conversations/'+_0x349ff3+'/documents','POST',_0x1ba609);return{'getId':async()=>(await _0x46df89['request'])['json'](),'abortController':_0x46df89['abortController']};}['uploadDocuments'](_0xa98a94,_0x101c61){const _0x17bb67={'documents':_0x101c61['map'](_0x43047f=>({'content':_0x43047f['content'],'attributes':{'version':_0x43047f['version'],'sessionId':_0x43047f['sessionId'],'channelId':_0x43047f['channelId'],'rootName':_0x43047f['rootName'],'selections':_0x43047f['selections']},...void 0x0!==_0x43047f['name']?{'name':_0x43047f['name']}:{},...void 0x0!==_0x43047f['description']?{'description':_0x43047f['description']}:{}}))},_0x360eb4=this['_sendApiRequest']('/conversations/'+_0xa98a94+'/documents/batch','POST',_0x17bb67);return{'getIds':async()=>(await _0x360eb4['request'])['json'](),'abortController':_0x360eb4['abortController']};}['fetchDocuments'](_0x39aafc,_0x49cc96){const _0x2b6205=new URLSearchParams();_0x2b6205['append']('documentIds',_0x49cc96['join'](','));const _0x441b6e=this['_sendApiRequest']('/conversations/'+_0x39aafc+'/documents/batch?'+_0x2b6205['toString'](),'GET');return{'getDocuments':async()=>(await _0x441b6e['request'])['json'](),'abortController':_0x441b6e['abortController']};}['fetchConversations'](_0x458736,_0x3ea217={}){const _0x51f0aa=new URLSearchParams();_0x51f0aa['append']('group',_0x458736),_0x51f0aa['append']('excludeEmpty',!0x1!==_0x3ea217['excludeEmpty']?'true':'false'),_0x51f0aa['append']('limit',_0x3ea217['limit']?_0x3ea217['limit']['toString']():'100'),_0x51f0aa['append']('sortBy',_0x3ea217['sortBy']?_0x3ea217['sortBy']:'createdAt'),_0x51f0aa['append']('order',_0x3ea217['order']?_0x3ea217['order']:'desc');const _0x5eddbd=this['_sendApiRequest']('/conversations?'+_0x51f0aa['toString'](),'GET');return{'getConversations':async()=>{const _0x35e6f9=await _0x5eddbd['request'];return(await _0x35e6f9['json']())['items'];},'abortController':_0x5eddbd['abortController']};}['deleteConversation'](_0x1efe13){const _0x2da71a=this['_sendApiRequest']('/conversations/'+_0x1efe13,'DELETE');return{'execute':async()=>{await _0x2da71a['request'];},'abortController':_0x2da71a['abortController']};}['updateConversation'](_0x1bb8e8,_0x592097){const _0x3ea177=this['_sendApiRequest']('/conversations/'+_0x1bb8e8,'PATCH',_0x592097);return{'getResult':async()=>(await _0x3ea177['request'],_0x592097),'abortController':_0x3ea177['abortController']};}['fetchConversation'](_0x22abf1){const _0x39bf73=this['_sendApiRequest']('/conversations/'+_0x22abf1,'GET');return{'getConversation':async()=>(await _0x39bf73['request'])['json'](),'abortController':_0x39bf73['abortController']};}['fetchConversationMessages'](_0x4d5f40){const _0x21ae35=this['_sendApiRequest']('/conversations/'+_0x4d5f40+'/messages','GET');return{'getMessages':async()=>{const _0x254050=await _0x21ae35['request'];return(await _0x254050['json']())['items'];},'abortController':_0x21ae35['abortController']};}['uploadUrl'](_0x46dfbd,_0x225243,_0x499c27){const _0x37b99e=this['_sendApiRequest']('/conversations/'+_0x46dfbd+'/web-resources','POST',{'url':_0x225243,'attributes':_0x499c27});return{'getId':async()=>(await _0x37b99e['request'])['json'](),'abortController':_0x37b99e['abortController']};}['getModels'](_0x9b2881='en'){const _0x195817=new URLSearchParams();_0x195817['append']('language',_0x9b2881);const _0x51cf98='/models/1?'+_0x195817['toString'](),_0x2b7c8a=this['_sendApiRequest'](_0x51cf98,'GET',void 0x0,!0x0);return{'list':async()=>await(await _0x2b7c8a['request'])['json'](),'abortController':_0x2b7c8a['abortController']};}['deleteFile'](_0x23a016,_0x358a48){const _0x15237a=this['_sendApiRequest']('/conversations/'+_0x23a016+'/files/'+_0x358a48,'DELETE');return{'execute':async()=>{await _0x15237a['request'];},'abortController':_0x15237a['abortController']};}['deleteDocument'](_0xfc6945,_0x150f37){const _0x3ce065=this['_sendApiRequest']('/conversations/'+_0xfc6945+'/documents/'+_0x150f37,'DELETE');return{'execute':async()=>{await _0x3ce065['request'];},'abortController':_0x3ce065['abortController']};}['deleteWebResource'](_0x25d964,_0xae9c80){const _0x734091=this['_sendApiRequest']('/conversations/'+_0x25d964+'/web-resources/'+_0xae9c80,'DELETE');return{'execute':async()=>{await _0x734091['request'];},'abortController':_0x734091['abortController']};}['callSystemReview']({reviewName:_0x2a8822,content:_0x34ab5b,args:_0x3d9379}){const _0x1f0bda=this['_sendApiRequest']('/reviews/system/'+_0x2a8822+'/calls','POST',{'content':[{'type':'text','content':_0x34ab5b}],'args':_0x3d9379});return{'getStream':async()=>{const _0x37c54a=(await _0x1f0bda['request'])['body'];return this['_getStreamReader'](_0x37c54a);},'abortController':_0x1f0bda['abortController']};}['callCustomReview']({content:_0xdc05b2,prompt:_0x224fd0,model:_0x20a480}){const _0x19d1a9=this['_sendApiRequest']('/reviews/custom/calls','POST',{'content':[{'type':'text','content':_0xdc05b2}],'prompt':_0x224fd0,'model':_0x20a480});return{'getStream':async()=>{const _0x345a1b=(await _0x19d1a9['request'])['body'];return this['_getStreamReader'](_0x345a1b);},'abortController':_0x19d1a9['abortController']};}['upsertAIChatRating'](_0x326b90,_0x1b8cab,_0x2c5443){const _0x4aaa44=this['_sendApiRequest']('/conversations/'+_0x326b90+'/messages/'+_0x1b8cab+'/ratings','PUT',{'positiveCount':_0x2c5443['positiveCount'],'totalCount':_0x2c5443['totalCount'],'modificationId':_0x2c5443['modificationId']});return{'execute':async()=>{await _0x4aaa44['request'];},'abortController':_0x4aaa44['abortController']};}['upsertAIActionRating'](_0x32a04a,_0x20f971,_0x2b3f1e){const _0x34b1fd=this['_sendApiRequest']('/actions/system/'+_0x32a04a+'/calls/'+_0x20f971+'/ratings','PUT',{'positiveCount':_0x2b3f1e['positiveCount'],'totalCount':_0x2b3f1e['totalCount']});return{'execute':async()=>{await _0x34b1fd['request'];},'abortController':_0x34b1fd['abortController']};}['upsertCustomAIActionRating'](_0x36c151,_0xc0ac31){const _0x1005d1=this['_sendApiRequest']('/actions/custom/calls/'+_0x36c151+'/ratings','PUT',{'positiveCount':_0xc0ac31['positiveCount'],'totalCount':_0xc0ac31['totalCount']});return{'execute':async()=>{await _0x1005d1['request'];},'abortController':_0x1005d1['abortController']};}['upsertAIReviewRating'](_0xb21e30,_0x25e332,_0x488b19,_0x2ed260){const _0x21e64a=this['_sendApiRequest']('/reviews/system/'+_0xb21e30+'/calls/'+_0x25e332+'/ratings','PUT',{'positiveCount':_0x488b19['positiveCount'],'totalCount':_0x488b19['totalCount'],'dataId':_0x2ed260});return{'execute':async()=>{await _0x21e64a['request'];},'abortController':_0x21e64a['abortController']};}['upsertCustomAIReviewRating'](_0x36499c,_0xd81b5e,_0x25154d){const _0x198f4b=this['_sendApiRequest']('/reviews/custom/calls/'+_0x36499c+'/ratings','PUT',{'positiveCount':_0xd81b5e['positiveCount'],'totalCount':_0xd81b5e['totalCount'],'dataId':_0x25154d});return{'execute':async()=>{await _0x198f4b['request'];},'abortController':_0x198f4b['abortController']};}['_sendApiRequest'](_0x43284b,_0x2088a6,_0x4eeaa4,_0x41c7da=!0x1){const _0x4b99b2=new AbortController(),_0x2749cc=_0x41c7da?_0x2088a6+':'+_0x43284b:null;if(_0x2749cc){const _0x2a1ce3=this['_responseCache']['get'](_0x2749cc);if(_0x2a1ce3)return{'request':_0x2a1ce3['then'](_0x61f1bb=>_0x61f1bb['clone']()),'abortController':_0x4b99b2};}const _0x152bed=_0x4eeaa4 instanceof FormData,_0x45a33f={'Authorization':'Bearer\x20'+this['_token']?.['value'],'X-Editor-Version':pt};_0x4eeaa4&&!_0x152bed&&(_0x45a33f['Content-Type']='application/json');const _0x21620a={'method':_0x2088a6,'headers':_0x45a33f,'signal':_0x4b99b2['signal']};_0x4eeaa4&&(_0x21620a['body']=_0x152bed?_0x4eeaa4:JSON['stringify'](_0x4eeaa4));const _0x3d04ff=fetch(''+this['_apiUrl']+_0x43284b,_0x21620a)['catch'](_0x310a55=>{_0x2749cc&&this['_responseCache']['delete'](_0x2749cc),this['_handleError'](_0x310a55);})['then'](_0x12bab0=>_0x12bab0['ok']?_0x12bab0:_0x12bab0['json']()['then'](_0x115e40=>{throw _0x2749cc&&this['_responseCache']['delete'](_0x2749cc),{'url':this['_apiUrl'],'path':_0x43284b,'method':_0x2088a6,'body':_0x4eeaa4,'status':(_0x12bab0||{})['status'],'statusText':(_0x12bab0||{})['statusText'],'code':_0x115e40['code'],'message':_0x115e40['message'],'traceId':_0x115e40['traceId']};}));return _0x2749cc&&this['_responseCache']['set'](_0x2749cc,_0x3d04ff['then'](_0x1afb54=>_0x1afb54['clone']())),{'request':_0x3d04ff,'abortController':_0x4b99b2};}async*['_getStreamReader'](_0x53b288){const _0x1f2100=[],_0x47ed17=_0x53b288['getReader'](),_0x5416a3=_0x443370({'onError':_0x59caa0=>{this['_handleError'](_0x59caa0);},'onEvent':_0x2e5fae=>{_0x2e5fae['data']=JSON['parse'](_0x2e5fae['data']),_0x1f2100['push'](_0x2e5fae);}});try{let _0x130a62=!0x1;for(;!_0x130a62;){const {done:_0x5b79bf,value:_0x365fec}=await _0x47ed17['read']();_0x5b79bf&&(_0x130a62=!0x0),_0x5416a3['feed'](this['_decoder']['decode'](_0x365fec,{'stream':!0x0})),yield*_0x1f2100,_0x1f2100['length']=0x0;}}catch(_0xc8ae83){this['_handleError'](_0xc8ae83);}finally{_0x47ed17['releaseLock'](),_0x5416a3['reset']();}}['_handleError'](_0x28f75c){if(_0x28f75c instanceof at)throw _0x28f75c;if(_0x28f75c instanceof Error&&'AbortError'===_0x28f75c['name'])throw new at('ai-request-aborted',this,{'originalError':_0x28f75c});throw new at('ai-request-failed',this,{'originalError':_0x28f75c});}}function Hi(_0x2a4ab3,_0x18dedf,_0x987359){const t=_0x2a4ab3['t'];switch(_0x18dedf){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'},_0x987359);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.'},_0x987359);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.'},_0x987359);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.'},_0x987359);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'},_0x987359);case'AI_CHAT_SUGGESTION_ACTION_SUGGEST':return t({'id':'AI_CHAT_SUGGESTION_ACTION_SUGGEST','string':'Suggest'},_0x987359);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'},_0x987359);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.'},_0x987359);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.'},_0x987359);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.'},_0x987359);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.'},_0x987359);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'},_0x987359);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.'},_0x987359);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 _0x18dedf;}}const Mi='ck-ai-button-primary',Ui='ck-ai-button-secondary',Bi='ck-ai-button-tertiary';function Gi(_0x5e36f8,_0x41ca5a){const _0x32131a=new vt(_0x5e36f8),_0x32c20f=Hi(_0x5e36f8,'AI_TABS_LABEL_MINIMIZE'),_0x54db83=Hi(_0x5e36f8,'AI_TABS_LABEL_MAXIMIZE');return _0x32131a['set']({'withText':!0x1,'icon':_0x28e0d9,'tooltip':!0x0,'class':'ck-ai-tabs__resize\x20'+Bi}),_0x32131a['bind']('label')['to'](_0x41ca5a,'isMaximized',_0x4d9cee=>_0x4d9cee?_0x32c20f:_0x54db83),_0x32131a['bind']('icon')['to'](_0x41ca5a,'isMaximized',_0x2b1603=>_0x2b1603?_0x1d80e4:_0x28e0d9),_0x32131a['bind']('isOn')['to'](_0x41ca5a,'isMaximized'),_0x32131a['on']('execute',()=>{_0x41ca5a['fire']('resizeTabs');}),_0x32131a;}function Fi(_0x4e1a09){return _0x38e7a7(_0x4e1a09);}function Ki(_0x2f7889){return ti(_0x2f7889);}function Wi(_0x528531,_0x255c26,_0x5dcae9){const _0xda9ba=null!==_0x255c26?_0x522a45=>_0x522a45['attribs'][_0x528531]===_0x255c26:_0x47bb22=>Boolean(_0x47bb22['attribs'][_0x528531]);return _0x14f12e(_0x1788c1=>_0x3a909c(_0x1788c1)&&_0xda9ba(_0x1788c1),_0x5dcae9);}function Yi(_0x31cc2f,_0x5653aa,_0x18e67a){const _0x526e5d=null!==_0x5653aa?_0x47f920=>_0x47f920['attribs'][_0x31cc2f]===_0x5653aa:_0x4ab7a4=>Boolean(_0x4ab7a4['attribs'][_0x31cc2f]);return _0x577331(_0x314837=>_0x3a909c(_0x314837)&&_0x526e5d(_0x314837),_0x18e67a);}function $i(_0x5a468a,_0x42caf4){return _0x5a468a&&_0x3a909c(_0x5a468a)?_0x5a468a['attribs'][_0x42caf4]:null;}function qi(_0x2b5f25,_0xd3db78,_0x1ac199){_0x3a909c(_0x2b5f25)&&(null===_0x1ac199?delete _0x2b5f25['attribs'][_0xd3db78]:_0x2b5f25['attribs'][_0xd3db78]=_0x1ac199);}function Qi(_0x3b189b,_0xf2dc9a,_0x270d5c){const _0x545164=_0xf2dc9a['cloneNode'](!0x0);'beforebegin'===_0x270d5c?_0x5be902(_0x3b189b,_0x545164):'afterbegin'===_0x270d5c?_0x38563a(_0x3b189b,_0x545164):'beforeend'===_0x270d5c?_0x1dab44(_0x3b189b,_0x545164):'afterend'===_0x270d5c&&_0x3567c2(_0x3b189b,_0x545164);}function Xi(_0x58f39a){const _0x3d2996=[];let _0x1cb950=_0x58f39a;for(;_0x1cb950;)_0x1cb950=_0x2664b3(_0x1cb950),_0x1cb950&&_0x3d2996['push'](_0x1cb950);return _0x3d2996;}function zi(_0x22537b){return _0x22537b['replace'](/^\s+/gm,'')['replace'](/\s+$/gm,'')['replace'](/\n*/g,'')['replace'](/\s+/g,'\x20')['replace'](/>\s*</g,'><');}function ji(_0x18d38f){let _0x273ccd=0x0;for(;_0x18d38f['parentNode'];)_0x18d38f=_0x18d38f['parentNode'],_0x273ccd++;return _0x273ccd;}function Ji(_0x2852ea){const _0x35138f=[];let _0x10854c=_0x2852ea['nextSibling'];for(;_0x10854c;)_0x35138f['push'](_0x10854c),_0x10854c=_0x10854c['nextSibling'];_0x35138f['forEach'](_0x53ad82=>{_0x497429(_0x53ad82);});}class AIResponseParser extends/* #__PURE__ -- @preserve */
|
|
25
|
+
ht(){['_m2html'];constructor(){super();const _0x2d3eb3=Object['entries'](_0x232c6),_0x3ef8e0=_0x2d3eb3['findIndex'](([_0x11856a])=>'rehypeDomRaw'===_0x11856a);if(-0x1===_0x3ef8e0)throw new at('ai-response-parser-unable-to-set-up-parser');_0x2d3eb3['splice'](_0x3ef8e0+0x1,0x0,['rehypeSanitize',_0x2e627d]),this['_m2html']=new _0x14628b({'plugins':Object['fromEntries'](_0x2d3eb3)});}['convertMarkdownToHTML'](_0x318a55){const _0x364bbf=this['_m2html']['parse'](_0x318a55);return this['parseAndNormalizeHTML'](_0x364bbf);}['parseAndNormalizeHTML'](_0x31c32e){return this['_parseHTML'](_0x31c32e);}['_parseHTML'](_0x7c8948){const _0x4eda61=Fi('<dummy>'+_0x7c8948['replace'](/^\t+/gm,'\x20')['replace'](/\n*/g,'')['replace'](/\s+/g,'\x20')['replace'](/<[^>]*?$/g,'')+'</dummy>');return _0x4eda61['children']=_0x4eda61['children'][0x0]['children'],_0x4eda61;}}class AIResponseApplier extends/* #__PURE__ -- @preserve */
|
|
26
|
+
ht(){['_generateUid'];['_uidCounter']=0x0;['_touchedNodesState']={'newIds':[],'modifiedIds':[],'removedIds':[],'invalidIds':[],'lastTouchedId':null};['_existingDataIds']=new Set();constructor(_0x3ae78d){super(),this['_generateUid']=_0x3ae78d||(()=>'e'+String(this['_uidCounter']++));}['merge'](_0x5cf800,_0x75a828,_0x5bd3bb){this['_uidCounter']=0x0;const _0x51f2a4=_0x5cf800['cloneNode'](!0x0),_0x435299=_0x51f2a4['childNodes'],_0x484a33=Array['from'](_0x435299)['filter'](_0x195307=>!(0x3===_0x195307['nodeType']&&''===Ki(_0x195307)['trim']())),_0x3d71b3=_0x484a33['length'],_0xa7c203=new Map();for(const _0x3d5618 of _0x484a33)_0x3d5618&&_0x3a909c(_0x3d5618)&&void 0x0===_0x3d5618['attribs']['data-id']&&qi(_0x3d5618,'data-id','new-element');if(0x0===_0x75a828['childNodes']['length']){const _0x57eb8e=[];return Yi('data-id','new-element',_0x51f2a4)['forEach'](_0xcbe5fd=>{const _0x1d32f4=this['_generateUid']();qi(_0xcbe5fd,'data-id',_0x1d32f4),_0x57eb8e['push'](_0x1d32f4);}),this['_removeSpecialComments'](_0x51f2a4),{'parsedContent':_0x51f2a4,'newNodeIds':_0x57eb8e,'modifiedNodeIds':[],'removedNodeIds':[],'newAnchorIds':_0xa7c203};}_0x5bd3bb&&_0x5bd3bb['markUnstableElements']&&this['_markLastTagElementUnstable'](_0x51f2a4),this['_touchedNodesState']['newIds']=[],this['_touchedNodesState']['modifiedIds']=[],this['_touchedNodesState']['removedIds']=[],this['_touchedNodesState']['invalidIds']=[],this['_touchedNodesState']['lastTouchedId']=null,this['_existingDataIds']=new Set(Yi('data-id',null,_0x75a828)['map'](_0x3b95d5=>$i(_0x3b95d5,'data-id'))['filter'](_0x484682=>!!_0x484682));let _0x2b9d61=-0x1,_0x5c8128=!0x1;for(let _0x2fac8f=0x0;_0x2fac8f<_0x3d71b3;_0x2fac8f++){const _0xd89c8e=_0x484a33[_0x2fac8f],_0x397333=_0x484a33[_0x2fac8f+0x1];if(this['_isNewNode'](_0xd89c8e)){if(-0x1===_0x2b9d61&&(_0x2b9d61=_0x2fac8f),this['_markWrappedElements'](_0xd89c8e),!this['_isNewNode'](_0x397333)){const [_0x251f93,_0x3e192f]=this['_findReferenceNode'](_0xd89c8e,_0x5c8128,_0x75a828);if(_0x251f93){const _0x2b1806=Array['from'](_0x484a33)['slice'](_0x2b9d61,_0x2fac8f+0x1),_0x390b12=$i(_0x251f93,'data-id');if(this['_insertNodes'](_0x251f93,_0x2b1806,_0x3e192f),_0x390b12)for(const _0x230696 of _0x2b1806){const _0xc09577=$i(_0x230696,'data-id');_0xc09577&&_0xa7c203['set'](_0xc09577,_0x390b12);}_0x2b9d61=-0x1;}}}else{if(this['_isExistingContentComment'](_0xd89c8e))_0x5c8128=!0x0;else{if(this['_isExistingNode'](_0xd89c8e)){const _0x1e612f=$i(_0xd89c8e,'data-id');if(_0x1e612f&&this['_existingDataIds']['has'](_0x1e612f)){const _0x16e4d7=Wi('data-id',_0x1e612f,_0x75a828);this['_replaceNode'](_0x16e4d7,_0xd89c8e);}}else{if(this['_isDelNode'](_0xd89c8e)){const _0x219954=this['_getNodeDataId'](_0xd89c8e);!!Wi('data-id',_0x219954,_0x51f2a4)||this['_touchedNodesState']['removedIds']['push'](_0x219954);}}}}}for(const _0xc534fd of this['_touchedNodesState']['removedIds']){const _0x43b1c8=Wi('data-id',_0xc534fd,_0x75a828);_0x43b1c8&&this['_removeNode'](_0x43b1c8,_0xc534fd,_0x5bd3bb);}if(Yi('data-id','new-element',_0x75a828)['forEach'](_0x4284bf=>{const _0x5032c1=this['_getUid'](_0x4284bf);qi(_0x4284bf,'data-id',_0x5032c1),this['_touchedNodesState']['newIds']['push'](_0x5032c1);}),this['_removeSpecialComments'](_0x75a828),_0x5bd3bb&&_0x5bd3bb['markUnstableElements']&&this['_markUnstableElements'](_0x75a828,_0x5bd3bb['markUnstableElementsDepth']||0x0),this['_processWrappedElements'](_0x75a828,_0x5bd3bb),_0x5bd3bb&&_0x5bd3bb['cutAfterLastChange']&&this['_touchedNodesState']['lastTouchedId']){const _0x2e8c12=Yi('data-id',this['_touchedNodesState']['lastTouchedId'],_0x75a828);let _0x297a20=_0x2e8c12[_0x2e8c12['length']-0x1];for(;_0x297a20;)Ji(_0x297a20),_0x297a20=_0x297a20['parentNode'];}return{'parsedContent':_0x75a828,'newNodeIds':this['_touchedNodesState']['newIds'],'modifiedNodeIds':this['_touchedNodesState']['modifiedIds'],'removedNodeIds':this['_touchedNodesState']['removedIds'],'newAnchorIds':_0xa7c203};}['_insertNodes'](_0x3f1f39,_0x29ade6,_0x11a027){for(const _0x27d72c of _0x29ade6){const _0x339084=this['_getUid'](_0x27d72c);qi(_0x27d72c,'data-id',_0x339084),this['_touchedNodesState']['newIds']['push'](_0x339084),this['_touchedNodesState']['lastTouchedId']=_0x339084;}const _0xd4f6c8='afterbegin'===_0x11a027||'afterend'===_0x11a027?_0x29ade6['reverse']():_0x29ade6;for(const _0x532494 of _0xd4f6c8)Qi(_0x3f1f39,_0x532494,_0x11a027);}['_replaceNode'](_0x44fa09,_0x2acbca){if(!_0x44fa09)return;if(_0x4d2f59=_0x2acbca,zi(Ki(_0x44fa09))===zi(Ki(_0x4d2f59)))return;var _0x4d2f59;const _0x4227fc=this['_getUid'](_0x44fa09);qi(_0x2acbca,'data-id',_0x4227fc),this['_touchedNodesState']['modifiedIds']['push'](_0x4227fc),this['_touchedNodesState']['lastTouchedId']=_0x4227fc,_0x274742(_0x44fa09,_0x2acbca['cloneNode'](!0x0));}['_removeNode'](_0x59aa73,_0x2bec75,_0x244f75){if(_0x244f75&&_0x244f75['replaceRemovedWith']){this['_touchedNodesState']['lastTouchedId']=_0x2bec75;const _0x1bef6f=_0x244f75['replaceRemovedWith']['cloneNode'](!0x0);qi(_0x1bef6f,'data-id',_0x2bec75),qi(_0x1bef6f,'data-removed','true'),_0x274742(_0x59aa73,_0x1bef6f);}else _0x497429(_0x59aa73);}['_findReferenceNode'](_0x5dc621,_0x4b6bd3,_0x3cd207){const _0x3430fb=this['_findPrevElementWithDataId'](_0x5dc621,!0x1);if(_0x3430fb){const _0xb9ddda=this['_getNodeDataId'](_0x3430fb),_0x425ade=Wi('data-id',_0xb9ddda,_0x3cd207);if(_0x425ade)return[_0x425ade,'afterend'];this['_touchedNodesState']['invalidIds']['push'](_0xb9ddda);}const _0x4113e1=this['_findNextElementWithDataId'](_0x5dc621,!0x1);if(_0x4113e1){const _0x413ca4=this['_getNodeDataId'](_0x4113e1),_0x3eed20=Wi('data-id',_0x413ca4,_0x3cd207);if(_0x3eed20)return[_0x3eed20,'beforebegin'];this['_touchedNodesState']['invalidIds']['push'](_0x413ca4);}return _0x4b6bd3?_0x5dc621['nextSibling']?this['_findFallbackReferenceNode'](_0x5dc621,_0x3cd207):[_0x3cd207['childNodes'][_0x3cd207['childNodes']['length']-0x1],'afterend']:[_0x3cd207['childNodes'][0x0],'beforebegin'];}['_findFallbackReferenceNode'](_0x65b182,_0x184f0e){const _0x98fb02=[],_0x3396f4=this['_findPrevElementWithDataId'](_0x65b182,!0x0);if(_0x3396f4){const _0x8e1341=Wi('data-id',this['_getNodeDataId'](_0x3396f4),_0x184f0e);_0x8e1341&&_0x98fb02['push']([_0x8e1341,'afterend']);}const _0xc7417=this['_findNextElementWithDataId'](_0x65b182,!0x0);if(_0xc7417){const _0x964038=Wi('data-id',this['_getNodeDataId'](_0xc7417),_0x184f0e);_0x964038&&_0x98fb02['push']([_0x964038,'beforebegin']);}if(_0x98fb02['length']>0x1)return ji(_0x98fb02[0x0][0x0])<=ji(_0x98fb02[0x1][0x0])?_0x98fb02[0x0]:_0x98fb02[0x1];return 0x1===_0x98fb02['length']?_0x98fb02[0x0]:[_0x184f0e['lastChild'],'afterend'];}['_findNextElementWithDataId'](_0x4d3b48,_0x5defa6){let _0x40c88e=_0x4d3b48['nextSibling'],_0x5c70af=null,_0x3e7983=!0x1;for(;_0x40c88e;){if(_0x1b8f4d(_0x40c88e)){if(this['_isDelNode'](_0x40c88e)&&(_0x5c70af=_0x40c88e),this['_isExistingContentComment'](_0x40c88e)&&_0x5defa6&&!_0x3e7983){_0x3e7983=!0x0,_0x40c88e=_0x40c88e['nextSibling'];continue;}break;}const _0x2d3c70=$i(_0x40c88e,'data-id');if(_0x2d3c70&&'new-element'!==_0x2d3c70&&this['_existingDataIds']['has'](_0x2d3c70)){_0x5c70af=_0x40c88e;break;}_0x40c88e=_0x40c88e['nextSibling'];}return _0x5c70af;}['_findPrevElementWithDataId'](_0xa75df0,_0x2ee55d){let _0x41b661=_0xa75df0['previousSibling'],_0x5e0634=null,_0x5ba35f=!0x1;for(;_0x41b661;){if(_0x1b8f4d(_0x41b661)){if(this['_isDelNode'](_0x41b661)&&(_0x5e0634=_0x41b661),this['_isExistingContentComment'](_0x41b661)&&_0x2ee55d&&!_0x5ba35f){_0x5ba35f=!0x0,_0x41b661=_0x41b661['previousSibling'];continue;}break;}const _0x440fc7=$i(_0x41b661,'data-id');if(_0x440fc7&&'new-element'!==_0x440fc7&&this['_existingDataIds']['has'](_0x440fc7)){_0x5e0634=_0x41b661;break;}_0x41b661=_0x41b661['previousSibling'];}return _0x5e0634;}['_markWrappedElements'](_0x571da5){_0x3a909c(_0x571da5)&&Yi('data-id',null,_0x571da5)['forEach'](_0xd9c0cc=>{this['_isExistingNode'](_0xd9c0cc)&&(qi(_0xd9c0cc,'data-wrapped-id',$i(_0xd9c0cc,'data-id')),qi(_0xd9c0cc,'data-id',null));});}['_processWrappedElements'](_0x47cbc9,_0x3b307a){Yi('data-wrapped-id',null,_0x47cbc9)['forEach'](_0x240344=>{const _0x57f989=$i(_0x240344,'data-wrapped-id');if($i(_0x240344,'data-unstable')||this['_hasUnstableParent'](_0x240344))return;const _0x524558=Wi('data-id',_0x57f989,_0x47cbc9);qi(_0x240344,'data-id',_0x57f989),qi(_0x240344,'data-wrapped-id',null),_0x524558&&(this['_removeNode'](_0x524558,_0x57f989,_0x3b307a),this['_touchedNodesState']['removedIds']['push'](_0x57f989),this['_touchedNodesState']['lastTouchedId']=_0x57f989);});}['_hasUnstableParent'](_0x510ae4){let _0x459817=_0x510ae4['parentNode'];for(;_0x459817;){if($i(_0x459817,'data-unstable'))return!0x0;_0x459817=_0x459817['parentNode'];}return!0x1;}['_getNodeDataId'](_0x257fa8){if(!_0x257fa8)return null;if(_0x3a909c(_0x257fa8))return $i(_0x257fa8,'data-id');if(_0x1b8f4d(_0x257fa8)){const _0x4679a6=Ki(_0x257fa8)['match'](/removed[\s*-]data-id="([^"]+)"/);if(_0x4679a6&&_0x4679a6[0x1])return _0x4679a6[0x1];}return null;}['_getUid'](_0x23f1ab){return this['_isExistingNode'](_0x23f1ab)?$i(_0x23f1ab,'data-id'):this['_generateUid']();}['_removeSpecialComments'](_0x4a8a51){(function(_0x297518){return _0x11a870(_0x5e2f54=>_0x1b8f4d(_0x5e2f54),_0x297518,!0x0,0x1/0x0);}(_0x4a8a51)['filter'](_0x37fe6f=>this['_isDelNode'](_0x37fe6f)||this['_isExistingContentComment'](_0x37fe6f))['forEach'](_0x502030=>{_0x497429(_0x502030);}));}['_markLastTagElementUnstable'](_0x39fdc1){const _0x530033=_0x39fdc1['childNodes'],_0x45200c=_0x530033[_0x530033['length']-0x1];_0x45200c&&_0x3a909c(_0x45200c)&&qi(_0x45200c,'data-unstable','true');}['_markUnstableElements'](_0x1b49e9,_0x54ec1f){const _0x56e975=Wi('data-unstable','true',_0x1b49e9);if(!_0x56e975)return;const _0x1468d3=Xi(_0x56e975)['slice'](0x0,-0x1),_0x5945a4=_0x1468d3['length'];let _0x552185=_0x56e975;if(_0x5945a4>_0x54ec1f){let _0x2c43b5=_0x5945a4,_0x3cf386=null;for(;_0x2c43b5>_0x54ec1f&&_0x2c43b5>=0x0;)_0x2c43b5--,_0x3cf386=_0x1468d3[_0x2c43b5];_0x3cf386&&(_0x552185=_0x3cf386,qi(_0x56e975,'data-unstable',null),qi(_0x3cf386,'data-unstable','true'));}else{if(_0x5945a4<_0x54ec1f){let _0x378ead=_0x5945a4,_0x3efa7e=_0x56e975;for(;_0x378ead<_0x54ec1f;){const _0x3acee5=_0x3efa7e['childNodes']['filter'](_0x14a4d4=>_0x3a909c(_0x14a4d4));if(0x0===_0x3acee5['length'])break;_0x378ead++,_0x3efa7e=_0x3acee5[_0x3acee5['length']-0x1];}_0x3efa7e&&(_0x552185=_0x3efa7e,qi(_0x56e975,'data-unstable',null),qi(_0x3efa7e,'data-unstable','true'));}}let _0x327e8f=_0x552185;for(;_0x327e8f;){for(;_0x327e8f['nextSibling'];)_0x327e8f=_0x327e8f['nextSibling'],_0x3a909c(_0x327e8f)&&qi(_0x327e8f,'data-unstable','true');_0x327e8f=_0x327e8f['parentNode'];}}['_isNewNode'](_0x36b459){return Boolean('new-element'===$i(_0x36b459,'data-id'));}['_isExistingNode'](_0x1e52ed){return Boolean(($i(_0x1e52ed,'data-id')||'')['length']>0x0&&'new-element'!==$i(_0x1e52ed,'data-id'));}['_isDelNode'](_0x19a220){return!!_0x19a220&&Boolean(_0x1b8f4d(_0x19a220)&&Ki(_0x19a220)['match'](/removed[\s*-]data-id="[^"]+"/));}['_isExistingContentComment'](_0x2c34b8){return Boolean(_0x1b8f4d(_0x2c34b8)&&Ki(_0x2c34b8)['match'](/\s*existing[\s*-](content|document)\s*/g));}}function Zi({editor:_0x5b123e,changeGroups:_0x4ea7ef,documentContextContent:_0x3b8039,showDiff:_0x2951f1,trimUnchanged:_0x411e6e=!0x0}){return _0x4ea7ef['map'](_0xe33fd9=>{const _0x386d40=new _0x135e16([]),_0x2c9601=new _0x135e16([]),_0x382037=new Set();for(const _0x3e717a of _0xe33fd9['changes'])'new'==_0x3e717a['type']&&Yi('data-id',null,_0x3e717a['node'])['forEach'](_0x574ca2=>{_0x382037['add']($i(_0x574ca2,'data-id'));});for(const _0x204fc6 of _0xe33fd9['changes'])if('removed'!=_0x204fc6['type']?_0x2c9601['children']['push'](_0x204fc6['node']['cloneNode'](!0x0)):_0x2951f1||_0x382037['has'](_0x204fc6['id'])||_0x2c9601['children']['push'](_0x204fc6['node']['cloneNode'](!0x0)),'new'!=_0x204fc6['type']&&(_0x2951f1||'removed'!=_0x204fc6['type'])){const _0x5dce9c=_0x14f12e(_0x1eb6de=>$i(_0x1eb6de,'data-id')==_0x204fc6['id'],_0x3b8039,!0x0);_0x5dce9c&&_0x386d40['children']['push'](_0x5dce9c['cloneNode'](!0x0));}const {content:_0x4937d8,hasChanges:_0x4baf36}=function(_0x894084,_0x1841b1,_0x42c174,_0x48ba71,_0xb8322f=!0x0){const _0x167034=_0x894084['plugins']['get']('DocumentCompare'),_0x2a1acc=Ki(_0x1841b1),_0x330ac4=Ki(_0x42c174),_0x46b1a5=_0x894084['data']['parse'](_0x2a1acc,'$root'),_0x529b46=_0x894084['model']['createPositionAt'](_0x46b1a5,0x0),_0x5a788e=_0x167034['getDiff'](_0x2a1acc,_0x330ac4,{'anchor':_0x529b46,'markDeletions':_0x48ba71,'targetEditor':_0x894084}),_0x5326b9=_0x5a788e['getOperations']();if(0x0==_0x5326b9['length'])return{'content':_0x1841b1['cloneNode'](!0x0),'hasChanges':!0x1};_0x48ba71?function(_0x97ed08,_0x4f5a29,_0x3322e6){if(0x0==_0x97ed08['length'])return;const _0x3a5b10=_0x3322e6['plugins']['get']('DocumentCompare'),_0xa79ac0=_0x3322e6['plugins']['get']('SuggestionsConversion');_0x3322e6['model']['change'](_0x2fc806=>{const _0x3f13c6=new Set();for(let _0xe2adcc=0x0;_0xe2adcc<_0x97ed08['length'];_0xe2adcc++){const _0x144518=_0x97ed08[_0xe2adcc];if(_0x144518['baseVersion']=null,_0x144518['isDocumentOperation']=!0x1,_0x3a5b10['isMarkedRemoveOperation'](_0x144518)){const _0x1aa6ad=_0x10b93e(_0x144518['newRange'],_0x3322e6['model']),_0x5f24db='suggestion:deletion:'+ot()+':$aiSuggestion';_0x4f5a29['markers']['set'](_0x5f24db,_0x1aa6ad);}else switch(_0x144518['type']){case'rename':{if(_0x144518['oldName']==_0x144518['newName'])break;_0x2fc806['batch']['addOperation'](_0x144518),_0x3322e6['model']['applyOperation'](_0x144518);const _0x23eeaa='$elementName',_0x340131=_0x144518['position'],_0x1ad865=_0x3322e6['model']['createRange'](_0x340131,_0x3322e6['model']['createPositionAt'](_0x340131['nodeAfter'],'end')),_0x41e06e='suggestion:attribute:'+_0x23eeaa+':'+ot()+':$aiSuggestion';_0x4f5a29['markers']['set'](_0x41e06e,_0x1ad865);break;}case'addAttribute':case'removeAttribute':case'changeAttribute':{if(_0x144518['oldValue']==_0x144518['newValue'])break;_0x2fc806['batch']['addOperation'](_0x144518),_0x3322e6['model']['applyOperation'](_0x144518);const _0x4bcf9a=_0x144518['key'];if(!_0xa79ac0['isRegisteredAttribute'](_0x4bcf9a))break;const _0x8bdd96=_0x10b93e(_0x144518['range'],_0x3322e6['model']),_0x4d0ca7='suggestion:attribute:'+_0x4bcf9a+':'+ot()+':$aiSuggestion';_0x4f5a29['markers']['set'](_0x4d0ca7,_0x8bdd96);break;}case'insert':{_0x2fc806['batch']['addOperation'](_0x144518),_0x3322e6['model']['applyOperation'](_0x144518);if(_0x97ed08[_0xe2adcc+0x1]&&'move'==_0x97ed08[_0xe2adcc+0x1]['type']){ts(_0x4f5a29,_0x144518);break;}const _0x494a35=_0x144518['position'],_0x1eae64=_0x144518['howMany'],_0x35518d=_0x10b93e(_0x3322e6['model']['createRange'](_0x494a35,_0x494a35['getShiftedBy'](_0x1eae64)),_0x3322e6['model']),_0x58f66f='suggestion:insertion:'+ot()+':$aiSuggestion';_0x4f5a29['markers']['set'](_0x58f66f,_0x35518d);break;}case'split':{_0x2fc806['batch']['addOperation'](_0x144518),_0x3322e6['model']['applyOperation'](_0x144518);const _0x3f8350=_0x144518['splitPosition'],_0x3bb8d2=_0x144518['moveTargetPosition'],_0x2dd418=_0x3322e6['model']['createRange'](_0x3f8350,_0x3bb8d2),_0x2c9dfe='suggestion:insertion:'+ot()+':$aiSuggestion';_0x4f5a29['markers']['set'](_0x2c9dfe,_0x2dd418);break;}case'move':{_0x2fc806['batch']['addOperation'](_0x144518),_0x3322e6['model']['applyOperation'](_0x144518),_0x97ed08[_0xe2adcc-0x1]&&'insert'==_0x97ed08[_0xe2adcc-0x1]['type']&&ts(_0x4f5a29,_0x144518);const _0x5600aa=_0x144518['getMovedRangeStart'](),_0x3357d9=_0x144518['howMany'];for(let _0x3b9aaa=0x0;_0x3b9aaa<_0x3357d9;_0x3b9aaa++){const _0x2805c6=_0x5600aa['getShiftedBy'](_0x3b9aaa)['nodeAfter'];_0x3f13c6['add'](_0x2805c6);}break;}case'remove':{const _0x319671=_0x144518['sourcePosition'],_0x1f5231=_0x144518['howMany'],_0x3ddfdb=new _0x33b723(_0x319671,_0x1f5231);_0x2fc806['batch']['addOperation'](_0x3ddfdb),_0x3322e6['model']['applyOperation'](_0x3ddfdb);break;}}}for(const _0x5e6b49 of _0x3f13c6){const _0x4015ec=_0x3322e6['model']['createRangeOn'](_0x5e6b49),_0x1f5791='suggestion:formatBlock:$fakeWrap:'+ot()+':$aiSuggestion';_0x4f5a29['markers']['set'](_0x1f5791,_0x10b93e(_0x4015ec,_0x3322e6['model']));}});}(_0x5326b9,_0x46b1a5,_0x894084):_0x894084['model']['change'](_0x5daea6=>{for(const _0x4be344 of _0x5326b9)if('remove'==_0x4be344['type']){const _0x4e0818=_0x4be344['sourcePosition'],_0x1bca7c=_0x4be344['howMany'],_0x18af4c=new _0x33b723(_0x4e0818,_0x1bca7c);_0x5daea6['batch']['addOperation'](_0x18af4c),_0x894084['model']['applyOperation'](_0x18af4c);}else{if('marker'==_0x4be344['type']){const _0x15e9c0=_0x4be344['name'],_0x6a1aa1=_0x4be344['newRange'];null!==_0x6a1aa1?_0x46b1a5['markers']['set'](_0x15e9c0,_0x6a1aa1):_0x46b1a5['markers']['delete'](_0x15e9c0);}else _0x4be344['baseVersion']=null,_0x4be344['isDocumentOperation']=!0x1,_0x5daea6['batch']['addOperation'](_0x4be344),_0x894084['model']['applyOperation'](_0x4be344);}});if(_0xb8322f){const _0x436d07=es(_0x894084,_0x5326b9,_0x46b1a5);is(_0x894084['model'],_0x436d07),function(_0x4a5b33,_0x401e82){const _0x101d52=_0x401e82['getFirstRange']()['start'];let _0x1b27ba=_0x401e82['getFirstRange']()['end'];const _0x52259d=_0x101d52['root'];(_0x1b27ba['textNode']||_0x1b27ba['nodeAfter']&&_0x1b27ba['nodeAfter']['is']('$text'))&&(_0x3fd73e(_0x1b27ba,'...'),_0x1b27ba=_0x1b27ba['getShiftedBy'](0x3)),(_0x101d52['textNode']||_0x101d52['nodeBefore']&&_0x101d52['nodeBefore']['is']('$text'))&&(_0x3fd73e(_0x101d52,'...'),function(_0x1a00c9,_0x40667d,_0x50f118){for(let [_0x22228d,_0x393bcf]of _0x1a00c9['markers']){const _0xa4a241=_0x393bcf['_getTransformedByInsertion'](_0x40667d,_0x50f118,!0x1);_0x393bcf=_0xa4a241[0x0],_0x1a00c9['markers']['set'](_0x22228d,_0x393bcf);}}(_0x52259d,_0x101d52,0x3),_0x101d52['parent']==_0x1b27ba['parent']&&(_0x1b27ba=_0x1b27ba['getShiftedBy'](0x3)));const _0x5c5c8b=_0x4a5b33['createRange'](_0x4a5b33['createPositionAt'](_0x52259d,0x0),_0x101d52),_0x1c95bf=_0x4a5b33['createRange'](_0x1b27ba,_0x4a5b33['createPositionAt'](_0x52259d,'end')),_0x26f039=[..._0x5c5c8b['getMinimalFlatRanges'](),..._0x1c95bf['getMinimalFlatRanges']()];_0x26f039['reverse']();for(const _0x101e54 of _0x26f039)_0x4d0cf2(_0x101e54),ns(_0x52259d,_0x101e54);}(_0x894084['model'],_0x436d07);}const _0x59841=_0x894084['data']['stringify'](_0x46b1a5,{'showSuggestionHighlights':!0x0});return{'content':Fi(_0x59841),'hasChanges':!0x0};}(_0x5b123e,_0x386d40,_0x2c9601,_0x2951f1,_0x411e6e);return{'type':_0xe33fd9['changes'][0x0]['type'],'index':_0xe33fd9['index'],'content':_0x4937d8,'hasChanges':_0x4baf36};});}function ts(_0x4f182e,_0x24577e){for(const [_0x1ab83c,_0x5e1637]of _0x4f182e['markers']){const _0x10837b=_0x3070cc['_createFromRanges'](_0x5e1637['getTransformedByOperation'](_0x24577e));_0x4f182e['markers']['set'](_0x1ab83c,_0x10837b);}}function es(_0x14168a,_0x5d3076,_0x35bbc8){const _0x1f526c=_0x14168a['plugins']['get']('DocumentCompare');let _0x20b2de=_0x14168a['model']['createPositionAt'](_0x35bbc8,Number['POSITIVE_INFINITY']),_0x5f2a3c=_0x14168a['model']['createPositionAt'](_0x35bbc8,0x0);for(const _0xc2295a of _0x5d3076){let _0x516d97,_0x1e96df;if(_0x1f526c['isMarkedRemoveOperation'](_0xc2295a))_0x516d97=_0xc2295a['newRange']['start'],_0x1e96df=_0xc2295a['newRange']['end'];else switch(_0x20b2de=_0x20b2de['getTransformedByOperation'](_0xc2295a),_0x5f2a3c=_0x5f2a3c['getTransformedByOperation'](_0xc2295a),_0xc2295a['type']){case'rename':_0x516d97=_0xc2295a['position'],_0x1e96df=_0x516d97['getShiftedBy'](0x1);break;case'addAttribute':case'removeAttribute':case'changeAttribute':_0x516d97=_0xc2295a['range']['start'],_0x1e96df=_0xc2295a['range']['end'];break;case'insert':_0x516d97=_0xc2295a['position'],_0x1e96df=_0x516d97['getShiftedBy'](_0xc2295a['howMany']);break;case'split':_0x516d97=_0xc2295a['splitPosition'],_0x1e96df=_0xc2295a['moveTargetPosition'];break;case'merge':{const _0x464223=_0xc2295a['targetPosition']['path']['slice'](0x0,-0x1);_0x516d97=_0x14168a['model']['createPositionFromPath'](_0x35bbc8,_0x464223),_0x1e96df=_0x516d97['getShiftedBy'](0x1);break;}case'move':case'remove':{const _0x38ea12=_0xc2295a['howMany'],_0xd4a0d0=_0xc2295a['sourcePosition']['_getTransformedByInsertion'](_0xc2295a['targetPosition'],_0x38ea12),_0x2425dd=_0xc2295a['getMovedRangeStart']();'remove'==_0xc2295a['type']?(_0x516d97=_0xd4a0d0,_0x1e96df=_0xd4a0d0):(_0x516d97=_0x2425dd,_0x1e96df=_0x2425dd['getShiftedBy'](_0x38ea12));break;}}_0x516d97&&_0x516d97['isBefore'](_0x20b2de)&&(_0x20b2de=_0x516d97['clone'](),_0x20b2de['stickiness']='toNone'),_0x1e96df&&_0x1e96df['isAfter'](_0x5f2a3c)&&(_0x5f2a3c=_0x1e96df['clone'](),_0x5f2a3c['stickiness']='toNone');}return _0x14168a['model']['createSelection'](_0x14168a['model']['createRange'](_0x20b2de,_0x5f2a3c));}function is(_0x3c0b5e,_0x5f2f65){ss(_0x3c0b5e,_0x5f2f65,'forward');const _0x5d5598=_0x5f2f65['getFirstRange']();_0x5f2f65['setTo']([]),_0x5f2f65['setTo'](_0x5d5598,{'backward':!0x0}),ss(_0x3c0b5e,_0x5f2f65,'backward');}function ss(_0x5ce834,_0x42936a,_0x1b4156){let _0x2eda64=0x14;for(;_0x2eda64;){_0x5ce834['modifySelection'](_0x42936a,{'unit':'word','direction':_0x1b4156}),_0x2eda64--;const _0x1bb8ec=_0x42936a['focus']['forward'==_0x1b4156?'nodeBefore':'nodeAfter'];if(_0x1bb8ec&&_0x1bb8ec['is']('element')&&_0x5ce834['schema']['isBlock'](_0x1bb8ec)&&_0x5ce834['schema']['isObject'](_0x1bb8ec))break;}}function ns(_0x10941d,_0x4e3a48){for(const [_0x43b358,_0x64aa4b]of _0x10941d['markers']){const _0x13a99b=_0x64aa4b['_getTransformedByDeletion'](_0x4e3a48['start'],_0x4e3a48['end']['offset']-_0x4e3a48['start']['offset']);null!=_0x13a99b?_0x10941d['markers']['set'](_0x43b358,_0x13a99b):_0x10941d['markers']['delete'](_0x43b358);}}class AIReply extends ht(){['id'];['interactionId'];['type'];['sources']=[];['parsedContent']=new _0x135e16([]);['parsedMergedContent']=new _0x135e16([]);['changeGroups']=[];['areActionsDisabled']=!0x1;['isFromHistory']=!0x1;['documentContextContent'];['documentId'];['dataIdDocumentSources'];['newNodeAnchorIds']=new Map();['aiResponseParser'];['aiResponseApplier'];['locale'];['cachedSuggestionContentParts']={'withDiff':[],'withoutDiff':[]};constructor({type:_0x30cdd6,content:_0xa4328d='',isDone:_0x4267e7=!0x1,isComplete:_0x3e4ae0,interactionId:_0x276c45,areActionsDisabled:_0x50c3bb,isFromHistory:_0x54e304=!0x1,documentContextContent:_0x35b852,dataIdDocumentSources:_0x33546b,documentId:_0x1124df,locale:_0x195c2d,id:_0x3598f9}){super(),this['id']=_0x3598f9||ot(),this['interactionId']=_0x276c45,this['type']=_0x30cdd6,this['areActionsDisabled']=!!_0x50c3bb,this['locale']=_0x195c2d,this['dataIdDocumentSources']=_0x33546b,this['documentId']=_0x1124df,this['isFromHistory']=_0x54e304,this['aiResponseParser']=new AIResponseParser(),this['aiResponseApplier']=new AIResponseApplier(),this['documentContextContent']=Fi(_0x35b852||''),this['set']('isDone',_0x4267e7),this['set']('isComplete',_0x3e4ae0??_0x4267e7),this['on']('change:content',()=>{this['onContentChange']();}),this['set']('content',_0xa4328d);}['appendContent'](_0x20d97e){this['set']('content',this['content']+_0x20d97e);}['done'](_0x429434=!0x0){this['isComplete']=_0x429434,this['isDone']||(this['set']('isDone',!0x0),this['onContentChange']());}['destroy'](){this['stopListening']();}['setChangeGroupState'](_0x2e796c,_0x5712c1){this['changeGroups'][_0x2e796c]['state']=_0x5712c1,this['fire']('replyChangeGroupStateUpdated',{'reply':this,'index':_0x2e796c,'state':_0x5712c1});}['getContentParts']({showDiff:_0x4c8dba,groupIndex:_0x2392be,editor:_0x196786}){const _0x42af8c=this['_getCachedContentParts'](_0x4c8dba,_0x2392be);if(_0x42af8c)return _0x42af8c;let _0xc1e6d0=[];if(void 0x0===_0x2392be)_0xc1e6d0=this['changeGroups'];else{const _0x3b3f61=this['changeGroups']['find'](({index:_0x3da5d7})=>_0x3da5d7===_0x2392be);if(!_0x3b3f61)throw new at('ai-reply-get-content-parts-group-not-found',null,{'aiReply':this,'groupIndex':_0x2392be});_0xc1e6d0=[_0x3b3f61];}const _0x1a82ee=Zi({'editor':_0x196786,'showDiff':_0x4c8dba,'changeGroups':_0xc1e6d0,'documentContextContent':this['documentContextContent']});return this['_setCachedContentParts'](_0x4c8dba,_0x1a82ee),_0x1a82ee;}['_getCachedContentParts'](_0x2905c1,_0x408f5e){const _0x833415=_0x2905c1?'withDiff':'withoutDiff';if(!this['cachedSuggestionContentParts'][_0x833415]['length'])return null;const _0x12376d=this['cachedSuggestionContentParts'][_0x833415];if(void 0x0===_0x408f5e)return _0x12376d['length']>0x0&&_0x12376d['length']!==this['changeGroups']['length']?(this['_setCachedContentParts'](_0x2905c1,null),null):_0x19c702(_0x12376d);{const _0x323968=_0x12376d['find'](({index:_0x153643})=>_0x153643===_0x408f5e);if(_0x323968)return[_0x19c702(_0x323968)];}return null;}['_setCachedContentParts'](_0x54b39a,_0x26b135){const _0x4b61bc=_0x54b39a?'withDiff':'withoutDiff';_0x26b135?_0x26b135['forEach'](_0x524322=>{const _0x31c3d0=this['cachedSuggestionContentParts'][_0x4b61bc],_0x2541f0=_0x31c3d0['find'](({index:_0x16c8c9})=>_0x16c8c9===_0x524322['index']);if(_0x2541f0){const _0x4fe115=_0x31c3d0['indexOf'](_0x2541f0);_0x31c3d0['splice'](_0x4fe115,0x1,_0x524322);}else _0x31c3d0['push'](_0x524322);}):this['cachedSuggestionContentParts'][_0x4b61bc]['length']=0x0;}['onContentChange'](){if('modification'===this['type']){this['parsedContent']=this['aiResponseParser']['parseAndNormalizeHTML'](this['content']);const _0x532264=this['changeGroups'];this['updateChangeGroups']();const _0x3c0043=this['_getDifferentChangeGroups'](_0x532264,this['changeGroups']);(_0x3c0043['length']||this['isDone'])&&(this['fire']('replyContentUpdated',this,_0x3c0043),this['cachedSuggestionContentParts']['withDiff']['length']=this['cachedSuggestionContentParts']['withoutDiff']['length']=0x0);}else this['parsedContent']=this['aiResponseParser']['convertMarkdownToHTML'](this['content']),this['fire']('replyContentUpdated',this);}['_getDifferentChangeGroups'](_0x15698d,_0xdd8c67){const _0x5e6819=[];for(const _0x49275b of _0xdd8c67){const _0x259a9b=_0x15698d[_0x49275b['index']];_0x259a9b?_0x259a9b['changes']['length']!==_0x49275b['changes']['length']?_0x5e6819['push'](_0x49275b):_0x259a9b['changes']['forEach']((_0x40828b,_0x21e267)=>{const _0xd4a4f8=_0x49275b['changes'][_0x21e267];_0x40828b['id']!==_0xd4a4f8['id']&&_0x5e6819['push'](_0x49275b);}):_0x5e6819['push'](_0x49275b);}return _0x5e6819;}['updateChangeGroups'](){const _0x479919=this['locale']?new _0x3d6efa('p',{},[new _0x3d6efa('span',{'style':'color:\x20#808080;\x20font-style:\x20italic'},[new _0xf98b0e(Hi(this['locale'],'AI_SUGGESTION_CONTENT_PART_REMOVED'))])]):void 0x0,_0x41413f=this['aiResponseApplier']['merge'](this['parsedContent'],this['documentContextContent']['cloneNode'](!0x0),{'markUnstableElements':!this['isDone']||!this['isComplete'],'replaceRemovedWith':_0x479919,'cutAfterLastChange':!this['isDone']||!this['isComplete']});if(!_0x41413f['modifiedNodeIds']['length']&&!this['isDone'])return;this['parsedMergedContent']=_0x41413f['parsedContent'],this['newNodeAnchorIds']=_0x41413f['newAnchorIds'];let _0x4a20e3=[];if(_0x577331(_0x2fe757=>{const _0x10f19e=$i(_0x2fe757,'data-id');if(!_0x10f19e||!_0x44b0b0(_0x10f19e))return!0x1;const _0x4fec12=[_0x2fe757,...Xi(_0x2fe757)]['at'](-0x2);if(_0x2fe757!=_0x4fec12){const _0x1117df=$i(_0x4fec12,'data-id');_0x44b0b0(_0x1117df)||(_0x4a20e3['push']({'node':_0x4fec12,'id':_0x1117df,'type':'modified'}),_0x41413f['modifiedNodeIds']['push'](_0x1117df));}else _0x41413f['modifiedNodeIds']['includes'](_0x10f19e)?_0x4a20e3['push']({'node':_0x2fe757,'type':'modified','id':_0x10f19e}):_0x41413f['newNodeIds']['includes'](_0x10f19e)?_0x4a20e3['push']({'node':_0x2fe757,'type':'new','id':_0x10f19e,'anchorId':$i(_0x2fe757['previousSibling'],'data-id')}):_0x4a20e3['push']({'node':_0x2fe757,'type':'removed','id':_0x10f19e});return!0x0;},this['parsedMergedContent']),_0x4a20e3=_0x4a20e3['filter'](({node:_0x177892})=>[...Xi(_0x177892),_0x177892]['every'](_0x2b401f=>!$i(_0x2b401f,'data-unstable'))),0x0==_0x4a20e3['length'])return;const _0x1e71d7=[[_0x4a20e3[0x0]]];for(let _0x5076eb=0x1;_0x5076eb<_0x4a20e3['length'];_0x5076eb++){const _0x1d2b21=_0x1e71d7[_0x1e71d7['length']-0x1],_0x4c94e3=_0x1d2b21[_0x1d2b21['length']-0x1];_0x4a20e3[_0x5076eb]['node']['previousSibling']==_0x4c94e3['node']&&'modified'!=_0x4a20e3[_0x5076eb]['type']&&'modified'!=_0x4c94e3['type']&&this['_isSameDocument'](_0x4a20e3[_0x5076eb]['node'],_0x4c94e3['node'])?_0x1d2b21['push'](_0x4a20e3[_0x5076eb]):_0x1e71d7['push']([_0x4a20e3[_0x5076eb]]);}for(const _0x1088a6 of _0x1e71d7){const _0x3d88d2=_0x1088a6[0x0],_0x4fa8e0=_0x1088a6[_0x1088a6['length']-0x1],_0x38195f=_0x352a74(_0x3d88d2['node']['previousSibling']);_0x38195f&&this['_isSameDocument'](_0x38195f['node'],_0x3d88d2['node'])&&_0x1088a6['unshift'](_0x38195f);const _0x19eb2e=_0x352a74(_0x4fa8e0['node']['nextSibling']);_0x19eb2e&&this['_isSameDocument'](_0x19eb2e['node'],_0x4fa8e0['node'])&&_0x1088a6['push'](_0x19eb2e);}function _0x44b0b0(_0x3d8e8a){return _0x41413f['modifiedNodeIds']['includes'](_0x3d8e8a)||_0x41413f['newNodeIds']['includes'](_0x3d8e8a)||_0x41413f['removedNodeIds']['includes'](_0x3d8e8a);}function _0x352a74(_0x315bab){if(_0x315bab&&$i(_0x315bab,'data-id')&&!$i(_0x315bab,'data-unstable')){const _0x113e27=$i(_0x315bab,'data-id');if(!_0x44b0b0(_0x113e27))return{'node':_0x315bab,'type':'context','id':_0x113e27};}return null;}this['changeGroups']=_0x1e71d7['map']((_0x4ee311,_0x349a2b)=>({'changes':_0x4ee311,'state':'pending','index':_0x349a2b}));}['_isSameDocument'](_0x1842ac,_0x37ba54){if(!this['dataIdDocumentSources']?.['size'])return!0x0;const _0x1ffdae=this['_resolveDocumentSource'](_0x1842ac),_0x2d5ec=this['_resolveDocumentSource'](_0x37ba54);return!_0x1ffdae||!_0x2d5ec||_0x1ffdae['editor']===_0x2d5ec['editor']&&_0x1ffdae['rootName']===_0x2d5ec['rootName'];}['_resolveDocumentSource'](_0x1f0156){if(!_0x1f0156||!this['dataIdDocumentSources'])return;const _0xd512d9=$i(_0x1f0156,'data-id');if(_0xd512d9){const _0xd92581=this['dataIdDocumentSources']['get'](_0xd512d9);if(_0xd92581)return _0xd92581;const _0x1975dd=this['newNodeAnchorIds']['get'](_0xd512d9),_0x46da4d=_0x1975dd?this['dataIdDocumentSources']['get'](_0x1975dd):void 0x0;if(_0x46da4d)return _0x46da4d;}for(let _0x40d958=_0x1f0156['previousSibling'];_0x40d958;_0x40d958=_0x40d958['previousSibling']){const _0x1d2521=$i(_0x40d958,'data-id'),_0x2363b9=_0x1d2521?this['dataIdDocumentSources']['get'](_0x1d2521):void 0x0;if(_0x2363b9)return _0x2363b9;}for(let _0xe87322=_0x1f0156['nextSibling'];_0xe87322;_0xe87322=_0xe87322['nextSibling']){const _0x128d76=$i(_0xe87322,'data-id'),_0x1fc6f6=_0x128d76?this['dataIdDocumentSources']['get'](_0x128d76):void 0x0;if(_0x1fc6f6)return _0x1fc6f6;}}}const rs=['interactionCreated','interactionStarted','interactionStopped','interactionFinished','interactionDestroyed','replyCreated','replyContentUpdated','replyChangeGroupStateUpdated','setConversationTitle','webSearchStarted','webSearchFinished','reasoningStarted','reasoningFinished','toolDataReceived','error'];class AIInteraction extends Et(){['id'];['replies']=[];['currentReply'];['messageId'];['actionCallId'];['currentRequest'];['connector'];['isStopped']=!0x1;['isDestroyed']=!0x1;['locale'];['_isReasoning']=!0x1;['_isWebSearching']=!0x1;constructor({connector:_0x227092,locale:_0x2e66a3}){super(),this['id']=ot(),this['connector']=_0x227092,this['isStopped']=!0x0,this['locale']=_0x2e66a3;}async['start'](){const _0x10a22f=[];let _0x44dd57,_0xb13184,_0x3f0e0a,_0x58eb7c=!0x1;this['isStopped']=!0x1;try{this['currentRequest']=await this['sendRequest'](),this['fire']('interactionStarted',this);const _0x59adb7=await this['currentRequest']['getStream']();for await(const _0x529dc7 of _0x59adb7){if(this['isStopped'])return;if('error'==_0x529dc7['event'])return void this['fire']('error',{'error':new at('ai-chat-interaction-error',this)});switch(_0x529dc7['event']){case'message-metadata':this['messageId']=_0x529dc7['data']['messageId'];break;case'action-metadata':this['actionCallId']=_0x529dc7['data']['callId'];break;case'conversation-title':this['setConversationTitle'](_0x529dc7['data']['conversationTitle'],!0x0);break;case'source':_0x10a22f['push'](_0x529dc7['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'](),_0x44dd57='modification-delta'==_0x529dc7['event']?'modification':'text',_0xb13184='modification-delta'==_0x529dc7['event']?_0x529dc7['data']['id']:void 0x0,this['currentReply']&&this['currentReply']['type']!=_0x44dd57&&(this['currentReply']['done'](),this['currentReply']=void 0x0),this['currentReply']?'modification-delta'==_0x529dc7['event']&&(this['currentReply']['documentId']=_0x529dc7['data']['documentId']):(this['currentReply']=this['createReply']({'type':_0x44dd57,'interactionId':this['id'],'id':_0xb13184,...'modification-delta'==_0x529dc7['event']&&{'documentId':_0x529dc7['data']['documentId']}}),'modification'==_0x44dd57&&(this['currentReply']['sources']=_0x10a22f['splice'](0x0))),this['currentReply']['appendContent'](_0x529dc7['data']['textDelta']);break;case'mcp-tool-result':_0x3f0e0a=JSON['parse'](_0x529dc7['data']['result']),this['_handleToolResultData']({'toolName':_0x529dc7['data']['toolName'],'data':_0x3f0e0a['data'],'attributes':_0x3f0e0a['attributes']});break;case'mcp-tool-notification':this['_handleToolNotificationData']({'toolName':_0x529dc7['data']['toolName'],'data':_0x529dc7['data']['data']});}}_0x58eb7c=!0x0;}finally{this['isStopped']||(this['currentReply']&&_0x10a22f['length']>0x0&&(this['currentReply']['sources']=_0x10a22f['splice'](0x0)),this['_finalizeInteraction'](_0x58eb7c),this['fire']('interactionFinished',this));}}['stop'](){this['isStopped']||(this['_finalizeInteraction'](),this['fire']('interactionStopped',this));}['getReply'](_0x1c02eb){return this['replies']['find'](_0x55906b=>_0x55906b['id']===_0x1c02eb);}['destroy'](){this['isDestroyed']||(this['stop'](),this['replies']['forEach'](_0xa3497e=>_0xa3497e['destroy']()),this['replies']=[],this['isDestroyed']=!0x0,this['fire']('interactionDestroyed',this),this['stopListening']());}['createReply'](_0x1b1dcd){const _0x4c99f7=new AIReply({'locale':this['locale'],'documentContextContent':this['getDocumentContext']()?.['content'],'dataIdDocumentSources':this['getDocumentContext']()?.['dataIdDocumentSources'],..._0x1b1dcd});return this['replies']['push'](_0x4c99f7),_0x4c99f7['delegate'](...rs)['to'](this),this['fire']('replyCreated',_0x4c99f7),_0x4c99f7;}['setConversationTitle'](_0xc3ddd9,_0xdd4f2e=!0x1){this['fire']('setConversationTitle',_0xc3ddd9,_0xdd4f2e);}['resetWebSearchState'](){this['_isWebSearching']&&(this['_isWebSearching']=!0x1,this['fire']('webSearchFinished',this));}['resetReasoningState'](){this['_isReasoning']&&(this['_isReasoning']=!0x1,this['fire']('reasoningFinished',this));}['_handleToolResultData'](_0x32adfe){this['fire']('toolDataReceived',{'type':'result','toolName':_0x32adfe['toolName'],'data':structuredClone(_0x32adfe['data']||{}),'attributes':structuredClone(_0x32adfe['attributes']||{})},this);}['_handleToolNotificationData'](_0x3795e9){this['fire']('toolDataReceived',{'type':'notification','toolName':_0x3795e9['toolName'],'data':structuredClone(_0x3795e9['data'])},this);}['_finalizeInteraction'](_0xc5f388=!0x1){this['isStopped']=!0x0,this['currentRequest']&&this['currentRequest']['abortController']['abort'](),this['currentReply']&&this['currentReply']['done'](_0xc5f388),this['currentRequest']=this['currentReply']=void 0x0;}}const os=new Map([['usage-limits-exceeded','ai-usage-limits-exceeded'],['rate-limits-exceeded','ai-rate-limits-exceeded'],['invalid-content-type','ai-invalid-content-type'],['invalid-request-data','ai-chat-invalid-request'],['model-already-set','ai-chat-model-already-set'],['model-not-found','ai-chat-model-not-found'],['unsafe-content-detected','ai-chat-unsafe-content-detected'],['unsupported-content-type','ai-chat-unsupported-content-type'],['content-too-large','ai-chat-content-too-large'],['unsupported-file-type','ai-chat-context-unsupported-file-type'],['file-too-large','ai-chat-context-file-too-large'],['file-too-many-pages','ai-chat-context-file-too-many-pages'],['form-data-size-limits-exceeded','ai-chat-context-form-data-size-limits-exceeded']]),as=['contextItemAdded','contextItemRemoved','contextItemLoadingEnded','contextSent','error','addContextOptionsChanged','sourceResourcesLoaded','resourceStateChanged','uploadProgressChanged'];class AIChatContext extends ht(){['_connector'];['_config'];['_ownerId'];constructor({connector:_0x17047a,config:_0x3d8159,ownerId:_0x2377ee}){super(),this['_connector']=_0x17047a,this['_config']=_0x3d8159,this['_ownerId']=_0x2377ee;}['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'](_0x4e8237){if(_0x4e8237)return this['_documentSources']['get'](_0x4e8237);}['getSourceByDataId'](_0x91c14f){if(_0x91c14f)return this['_dataIdToSource']['get'](_0x91c14f);}['_getDocumentContextSlice'](_0x38dfd9){const _0x4117e7=this['_getDocumentSource'](_0x38dfd9);if(_0x4117e7)return{'editor':_0x4117e7['editor'],'rootName':_0x4117e7['rootName'],'html':_0x4117e7['content'],'version':_0x4117e7['version']};}['getDocumentContextSliceByDataId'](_0x14d236){const _0x3386a8=this['getSourceByDataId'](_0x14d236);return _0x3386a8?this['_getDocumentContextSlice'](_0x3386a8['documentId']):void 0x0;}['getPendingContextItems'](){return this['_pendingContextItems'];}async['populateFromMessage'](_0x2be354){const _0x11fe4f=await this['_createContextItemFromContent'](_0x2be354);return this['_addToConversationContextItem'](_0x11fe4f),'current-document'===_0x11fe4f['uiId']&&this['_toggleAddCurrentDocumentOptionVisibility'](),_0x11fe4f;}async['populateDocumentsFromMessage'](_0x918b6d,_0x9a2434){const _0x3687f3=_0x918b6d['filter'](_0x15bba1=>'document'===_0x15bba1['type']);if(0x0===_0x3687f3['length'])return{'hasUnmatched':!0x1};if(0x1===_0x3687f3['length'])return{'contextItem':await this['populateFromMessage'](_0x3687f3[0x0]),'hasUnmatched':!0x1};const _0x325150=_0x3687f3['map'](_0x319fb7=>_0x319fb7['id']),_0x41fe98=await this['_connector']['fetchDocuments'](this['_ownerId'],_0x325150)['getDocuments'](),_0x20abc9=new Map(_0x41fe98['map'](_0x1b3c1f=>[_0x1b3c1f['id'],_0x1b3c1f]));this['_documentSources']['clear'](),this['_dataIdToSource']['clear']();const _0x7b6a9b=[];let _0x4e72ae=!0x1;for(const _0x8598c4 of _0x3687f3){const _0x3d80d3=_0x20abc9['get'](_0x8598c4['id']);if(!_0x3d80d3)continue;const _0x2ccdaf=this['_matchDocumentToRoot'](_0x3d80d3,_0x9a2434),_0x1af2cc=_0x9a2434[0x0]&&this['_getFirstRoot'](_0x9a2434[0x0]);_0x2ccdaf||(_0x4e72ae=!0x0);const _0x12296c=_0x2ccdaf?.['editor']??_0x1af2cc?.['editor'],_0x4933d9=_0x2ccdaf?.['rootName']??_0x1af2cc?.['rootName'];if(_0x12296c&&_0x4933d9){const _0x4dce50={'editor':_0x12296c,'rootName':_0x4933d9,'content':_0x3d80d3['content'],'version':_0x3d80d3['attributes']?.['version']??0x0,'name':_0x3d80d3['name'],'description':_0x3d80d3['description']};this['_documentSources']['set'](_0x3d80d3['id'],_0x4dce50);const _0x379044=Fi(_0x3d80d3['content']);for(const _0x26cc98 of _0x577331(_0x36e5ce=>!!$i(_0x36e5ce,'data-id'),_0x379044)){const _0x529212=$i(_0x26cc98,'data-id');_0x529212&&this['_dataIdToSource']['set'](_0x529212,{..._0x4dce50,'documentId':_0x3d80d3['id']});}}_0x7b6a9b['push']({'id':_0x3d80d3['id'],'content':_0x3d80d3['content'],'version':_0x3d80d3['attributes']?.['version']??0x0,'sessionId':_0x3d80d3['attributes']?.['sessionId']??null,'selection':[]});}const _0x43a87e={'id':'current-document','uiId':'current-document','label':'Current\x20document','type':'document','hidden':this['_conversationContextItems']['has']('current-document'),'documents':_0x7b6a9b,'dataIdDocumentSources':new Map(this['_dataIdToSource'])};return this['_addToConversationContextItem'](_0x43a87e),this['_toggleAddCurrentDocumentOptionVisibility'](),{'contextItem':_0x43a87e,'hasUnmatched':_0x4e72ae};}['_matchDocumentToRoot'](_0xae3141,_0x2ab41a){const _0x2e5ad2=_0xae3141['attributes']?.['channelId'],_0x4ceadf=_0xae3141['attributes']?.['rootName'];if(_0x2e5ad2&&_0x4ceadf){for(const _0x1631fe of _0x2ab41a)if(_0x1631fe['config']['get']('collaboration.channelId')===_0x2e5ad2){for(const _0x2080e4 of _0x1631fe['model']['document']['getRoots']())if('$graveyard'!==_0x2080e4['rootName']&&_0x2080e4['rootName']===_0x4ceadf)return{'editor':_0x1631fe,'rootName':_0x2080e4['rootName']};}}}['_getFirstRoot'](_0x1857d5){for(const _0x4a94ba of _0x1857d5['model']['document']['getRoots']())if('$graveyard'!==_0x4a94ba['rootName'])return{'editor':_0x1857d5,'rootName':_0x4a94ba['rootName']};}async['_createContextItemFromContent'](_0x85b0df){if('document'===_0x85b0df['type']){const _0x11e9c1=await this['_connector']['fetchDocument'](this['_ownerId'],_0x85b0df['id'])['getDocument']();return{'id':'current-document','uiId':'current-document','label':'Current\x20document','type':_0x85b0df['type'],'content':_0x11e9c1['content'],'hidden':this['_conversationContextItems']['has']('current-document'),'version':_0x11e9c1['attributes']?.['version'],'sessionId':_0x11e9c1['attributes']?.['sessionId']};}if('mcp-tool-context'===_0x85b0df['type'])return{'id':_0x85b0df['id'],'uiId':_0x85b0df['id'],'label':_0x85b0df['data']?.['label']||_0x85b0df['id'],'type':'mcp-tool-context','mcpServerName':_0x85b0df['mcpServerName'],'toolName':_0x85b0df['toolName'],'data':_0x85b0df['data']||{}};return{'id':_0x85b0df['id'],'uiId':_0x85b0df['id'],'label':_0x85b0df['attributes']?.['label']||_0x85b0df['name']||_0x85b0df['url']||_0x85b0df['id'],'type':_0x85b0df['type'],..._0x85b0df?.['attributes']?.['resourceId']?{'resourceId':_0x85b0df['attributes']?.['resourceId']}:{}};}['getSentContextItems'](){return new Map(this['_conversationContextItems']);}['removeFromContext'](_0x32dc17){const _0x4917b7=this['_pendingContextItems']['get'](_0x32dc17);_0x4917b7?.['isReadOnly']||this['_removeContextItem'](_0x32dc17);}['clearPendingContextItems'](){if(0x0===this['_pendingContextItems']['size'])return;for(const _0x2444dd of this['_pendingContextItems']['values']())this['_removeContextItem'](_0x2444dd['uiId']);const _0x29406d=this['_conversationContextItems']['get']('current-document')||this['_pendingContextItems']['get']('current-document');_0x29406d&&this['_addContextItem']({..._0x29406d,'isReadOnly':!0x0,'hidden':!0x0});}['addToConversationContext'](_0x2666c7){for(const _0x38850e of _0x2666c7['values']())this['_addToConversationContextItem'](_0x38850e);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'](_0x265e03){return Array['from'](_0x265e03['values']())['flatMap'](_0x334bfe=>this['_mapContextItemToRequestData'](_0x334bfe));}async['addFilesToContext'](_0x4ec7c8,_0x327cab,_0x2f0083='file'){const _0x477be8='files-'+ot();this['_startUploadOperation'](_0x477be8);try{await Promise['all'](_0x4ec7c8['map'](async _0x3714aa=>{const _0x17c09d='file-'+ot(),_0x24e904=_0x292a51(_0x3714aa['name']);try{this['_addContextItem']({'type':_0x2f0083,'label':_0x327cab?.['label']||_0x24e904,'uiId':_0x17c09d,'resourceId':_0x327cab?.['resourceId']},!0x0);const _0x381fef=this['_connector']['uploadFile'](this['_ownerId'],_0x3714aa,_0x327cab);this['_ongoingUploads']['set'](_0x17c09d,_0x381fef['abortController']);const {id:_0x149483}=await _0x381fef['getId']();this['_ongoingUploads']['delete'](_0x17c09d),this['_finishContextItemLoading']({'type':_0x2f0083,'id':_0x149483,'label':_0x327cab?.['label']||_0x24e904,'uiId':_0x17c09d,'resourceId':_0x327cab?.['resourceId']},!0x1);}catch(_0x584988){this['_ongoingUploads']['delete'](_0x17c09d);if(!(_0x584988 instanceof at&&_0x584988['message']['startsWith']('ai-request-aborted'))){const _0x287e2e=os['get'](_0x584988['code'])||'ai-chat-file-upload-failed',_0x134108=new at(_0x287e2e,null,{'fileName':_0x24e904,..._0x584988});_0x134108['stack']=_0x584988['stack'],this['fire']('error',{'error':_0x134108});}this['_removeContextItem'](_0x17c09d);}}));}finally{this['_finishUploadOperation'](_0x477be8);}}['addCurrentDocumentToContext'](_0x178f6b){if(this['isCurrentDocumentInContext']()||!this['_addContextOptionsState']['document']['enabled'])return;const _0x18188c={'type':'document','uiId':'current-document','label':_0x178f6b,'isReadOnly':this['_conversationContextItems']['has']('current-document'),'hidden':this['_conversationContextItems']['has']('current-document')};this['_addContextItem'](_0x18188c);}async['updateCurrentDocument'](_0x4744e9,_0x3871cc,_0x532e9a,_0x46aa9d,_0x37c88c,_0x5dca4c){const _0x498691=this['_pendingContextItems']['get']('current-document');if(_0x498691&&_0x4744e9){_0x498691['selection']=_0x5dca4c?_0x5dca4c['map'](_0x3a2633=>({'start':_0x3a2633['start'],'end':_0x3a2633['end']})):[];try{if(_0x498691['version']===_0x3871cc)return;const {id:_0x20e5dd}=await this['_connector']['uploadDocument'](this['_ownerId'],_0x4744e9,{'version':_0x3871cc,'sessionId':_0x532e9a,'channelId':_0x46aa9d,'rootName':_0x37c88c})['getId']();_0x498691['id']=_0x20e5dd,_0x498691['content']=_0x4744e9,_0x498691['version']=_0x3871cc,_0x498691['sessionId']=_0x532e9a;}catch(_0x150e8d){const _0x34081a=new at('ai-chat-document-upload-failed',null);_0x34081a['stack']=_0x150e8d['stack'],this['fire']('error',{'error':_0x34081a});}}}async['updateCurrentDocuments'](_0x14c4b4){const _0x25f7dc=this['_pendingContextItems']['get']('current-document');if(!_0x25f7dc||!_0x14c4b4['length']||_0x14c4b4['every'](_0x2f5202=>!_0x2f5202['content']))return;_0x14c4b4['length']>0x1&&_0x14c4b4['some'](_0x17193c=>!_0x17193c['description'])&>('ai-chat-documents-missing-description');const _0x7adcf9=_0x5652ea=>_0x5652ea?_0x5652ea['map'](_0x27aa91=>({'start':_0x27aa91['start'],'end':_0x27aa91['end']})):[],_0x4460e2=_0x25f7dc['documents']??[];if(_0x4460e2['length']===_0x14c4b4['length']&&_0x14c4b4['every']((_0x14a39b,_0x25cc90)=>_0x4460e2[_0x25cc90]?.['version']===_0x14a39b['version']))_0x25f7dc['documents']=_0x4460e2['map']((_0xef4be6,_0x8dcd4)=>({..._0xef4be6,'selection':_0x7adcf9(_0x14c4b4[_0x8dcd4]['selections'])}));else try{const _0x1a3459=await this['_connector']['uploadDocuments'](this['_ownerId'],_0x14c4b4)['getIds']();_0x25f7dc['documents']=_0x14c4b4['map']((_0x128d92,_0x552dd8)=>({'id':_0x1a3459[_0x552dd8]?.['id'],'content':_0x128d92['content'],'version':_0x128d92['version'],'sessionId':_0x128d92['sessionId'],'selection':_0x7adcf9(_0x128d92['selections'])})),this['_documentSources']['clear'](),this['_dataIdToSource']['clear']();for(let _0x3f6862=0x0;_0x3f6862<_0x14c4b4['length'];_0x3f6862++){const _0x47e791=_0x1a3459[_0x3f6862]?.['id'],_0x1f6531=_0x14c4b4[_0x3f6862];if(!_0x47e791)continue;const _0x1f0b68={'editor':_0x1f6531['editor'],'rootName':_0x1f6531['rootName'],'content':_0x1f6531['content'],'version':_0x1f6531['version'],'name':_0x1f6531['name'],'description':_0x1f6531['description']};this['_documentSources']['set'](_0x47e791,_0x1f0b68);const _0x418cd0=Fi(_0x1f6531['content']);for(const _0x24d3f1 of _0x577331(_0x201fa7=>!!$i(_0x201fa7,'data-id'),_0x418cd0)){const _0x2168ce=$i(_0x24d3f1,'data-id');_0x2168ce&&this['_dataIdToSource']['set'](_0x2168ce,{..._0x1f0b68,'documentId':_0x47e791});}}_0x25f7dc['dataIdDocumentSources']=new Map(this['_dataIdToSource']);}catch(_0xbfff28){const _0x35c90c=new at('ai-chat-document-upload-failed',null);_0x35c90c['stack']=_0xbfff28['stack'],this['fire']('error',{'error':_0x35c90c});}}['addSelectionToContext'](_0x154398){this['_addContextItem']({'type':'selection','label':_0x154398,'uiId':'selection','content':_0x154398});}['removeSelectionFromContext'](){this['_removeContextItem']('selection');}async['addUrlToContext'](_0x5ca064,_0x4724ad){const _0x5d1f6b='url-'+ot();this['_startUploadOperation'](_0x5d1f6b);const _0x657314='url-'+ot();try{this['_addContextItem']({'type':'web-resource','label':_0x4724ad?.['label']||_0x5ca064,'uiId':_0x657314,'resourceId':_0x4724ad?.['resourceId']},!0x0);const _0x403829=this['_connector']['uploadUrl'](this['_ownerId'],_0x5ca064,_0x4724ad);this['_ongoingUploads']['set'](_0x657314,_0x403829['abortController']);const {id:_0x1ade9f}=await _0x403829['getId']();this['_ongoingUploads']['delete'](_0x657314),this['_finishContextItemLoading']({'type':'web-resource','id':_0x1ade9f,'label':_0x4724ad?.['label']||_0x5ca064,'uiId':_0x657314,'resourceId':_0x4724ad?.['resourceId']},!0x1);}catch(_0x399622){this['_ongoingUploads']['delete'](_0x657314),(_0x399622['message']['startsWith']('ai-request-aborted')||this['fire']('error',{'error':new at('ai-chat-url-upload-failed',this,{'url':_0x5ca064,'originalError':_0x399622}),'url':_0x5ca064}),this['_removeContextItem'](_0x657314));}finally{this['_finishUploadOperation'](_0x5d1f6b);}}['addToolItemToContext'](_0x3d4363){_0x3d4363['id']=_0x3d4363['id']??ot()['substring'](0x0,0x15),this['_pendingContextItems']['set'](_0x3d4363['uiId'],_0x3d4363),this['fire']('contextItemAdded',{'contextItem':_0x3d4363,'isLoading':!0x1});}async['loadSourceResources'](_0x3d0c78,_0x36601c,_0x592882){const _0x396577=this['_addContextOptionsState']['sources']['find'](_0x5d5393=>_0x5d5393['id']===_0x3d0c78);if(!_0x396577)return this['fire']('error',{'error':new at('ai-chat-source-not-found',this,{'sourceId':_0x3d0c78}),'sourceId':_0x3d0c78}),[];try{const _0x1fb464=(await _0x396577['getResources'](_0x36601c))['map'](_0x50884d=>{const _0x5d97fd=this['_isResourceInContext'](_0x50884d['id']);return{..._0x50884d,'isInContext':_0x5d97fd};});return _0x396577['resources']=_0x1fb464,this['fire']('sourceResourcesLoaded',{'sourceId':_0x3d0c78,'source':_0x396577,'resources':_0x1fb464,'uid':_0x592882}),_0x1fb464;}catch(_0x2f28c9){return this['fire']('error',{'error':new at('ai-chat-source-resources-load-failed',this,{'sourceId':_0x3d0c78,'originalError':_0x2f28c9}),'sourceId':_0x3d0c78,'sourceLabel':_0x396577['label']}),[];}}async['addResourceToContext'](_0x441dca,_0x1f5ef5){if(this['_isResourceInContext'](_0x1f5ef5['id']))return;let _0x11342c=_0x1f5ef5['data'];if(!_0x11342c&&_0x441dca['getData'])try{_0x11342c=await _0x441dca['getData'](_0x1f5ef5['id']);}catch(_0xadae7a){return void this['fire']('error',{'error':new at('ai-chat-resource-load-failed',this,{'resourceId':_0x1f5ef5['id'],'sourceId':_0x441dca['id'],'originalError':_0xadae7a}),'resourceId':_0x1f5ef5['id'],'sourceId':_0x441dca['id']});}if(_0x11342c)switch(_0x1f5ef5['type']){case'web-resource':if('string'!=typeof _0x11342c)return void this['fire']('error',{'error':new at('ai-chat-context-invalid-data',this,{'resourceId':_0x1f5ef5['id'],'sourceId':_0x441dca['id'],'expectedType':'string','actualType':typeof _0x11342c}),'resourceId':_0x1f5ef5['id'],'sourceId':_0x441dca['id']});await this['addUrlToContext'](_0x11342c,{'label':_0x1f5ef5['label'],'resourceId':_0x1f5ef5['id']});break;case'file':if(!(_0x11342c instanceof File))return void this['fire']('error',{'error':new at('ai-chat-context-invalid-data',this,{'resourceId':_0x1f5ef5['id'],'sourceId':_0x441dca['id'],'expectedType':'File','actualType':typeof _0x11342c}),'resourceId':_0x1f5ef5['id'],'sourceId':_0x441dca['id']});await this['addFilesToContext']([_0x11342c],{'label':_0x1f5ef5['label'],'resourceId':_0x1f5ef5['id']});break;case'text':if('object'!=typeof _0x11342c||!('content'in _0x11342c)||!('type'in _0x11342c))return void this['fire']('error',{'error':new at('ai-chat-context-invalid-data',this,{'resourceId':_0x1f5ef5['id'],'sourceId':_0x441dca['id'],'expectedType':'object\x20with\x20content\x20and\x20type\x20properties','actualType':typeof _0x11342c}),'resourceId':_0x1f5ef5['id'],'sourceId':_0x441dca['id']});_0x11342c=AIChatContext['_convertTextResourceToFile'](_0x11342c,_0x1f5ef5['label']),await this['addFilesToContext']([_0x11342c],{'label':_0x1f5ef5['label'],'resourceId':_0x1f5ef5['id']},'text');break;case'mcp-tool-context':break;default:this['fire']('error',{'error':new at('ai-chat-context-unsupported-type',this,{'resourceId':_0x1f5ef5['id'],'sourceId':_0x441dca['id'],'resourceType':_0x1f5ef5['type']}),'resourceId':_0x1f5ef5['id'],'sourceId':_0x441dca['id']});}else this['fire']('error',{'error':new at('ai-chat-resource-no-data',this,{'resourceId':_0x1f5ef5['id'],'sourceId':_0x441dca['id']}),'resourceId':_0x1f5ef5['id'],'sourceId':_0x441dca['id']});}static['_convertTextResourceToFile'](_0x3f7110,_0x47de54){switch(_0x3f7110['type']){case'markdown':return new File([_0x3f7110['content']],_0x47de54,{'type':'text/markdown'});case'html':return new File([_0x3f7110['content']],_0x47de54,{'type':'text/html'});default:return new File([_0x3f7110['content']],_0x47de54,{'type':'text/plain'});}}static['_mapContextItemToRequestData'](_0x115532){switch(_0x115532['type']){case'file':case'text':return[{'type':'file','id':_0x115532['id']}];case'web-resource':return[{'type':'web-resource','id':_0x115532['id']}];case'document':return _0x115532['documents']?.['length']?_0x115532['documents']['map'](_0xf68fe3=>({'type':'document','id':_0xf68fe3['id'],..._0xf68fe3['selection']?.['length']&&{'selection':_0xf68fe3['selection']}})):[{'type':'document','id':_0x115532['id'],..._0x115532['selection']?.['length']&&{'selection':_0x115532['selection']}}];case'mcp-tool-context':{const _0x2770d0=_0x115532;return[{'type':'mcp-tool-context','mcpServerName':_0x2770d0['mcpServerName'],'toolName':_0x2770d0['toolName'],'data':{..._0x2770d0['data'],'label':_0x2770d0['label']||_0x2770d0['data']?.['label']||_0x2770d0['id']},'id':_0x2770d0['id']}];}default:return[];}}['_addContextItem'](_0x592ad6,_0x46cc48=!0x1){if(this['_pendingContextItems']['set'](_0x592ad6['uiId'],_0x592ad6),_0x592ad6['hidden']||this['fire']('contextItemAdded',{'contextItem':_0x592ad6,'isLoading':_0x46cc48}),'current-document'===_0x592ad6['uiId']&&this['_toggleAddCurrentDocumentOptionVisibility'](),_0x592ad6['resourceId']){const _0x25cbe8=this['_findSourceIdsByResourceId'](_0x592ad6['resourceId']);_0x25cbe8&&_0x25cbe8['forEach'](_0x40348e=>{this['_updateResourceInContextState'](_0x40348e,_0x592ad6['resourceId'],!0x0);});}}['_removeContextItem'](_0x2bcf15){const _0x262d24=this['_pendingContextItems']['get'](_0x2bcf15),_0x5a725f=this['_ongoingUploads']['get'](_0x2bcf15);if(_0x5a725f&&(_0x5a725f['abort'](),this['_ongoingUploads']['delete'](_0x2bcf15)),_0x262d24?.['resourceId']){const _0xb4edd3=this['_findSourceIdsByResourceId'](_0x262d24['resourceId']);_0xb4edd3&&_0xb4edd3['forEach'](_0x134182=>{this['_updateResourceInContextState'](_0x134182,_0x262d24['resourceId'],!0x1);});}this['_pendingContextItems']['delete'](_0x2bcf15),this['fire']('contextItemRemoved',{'uiId':_0x2bcf15,'type':_0x262d24?.['type']}),'current-document'===_0x2bcf15&&this['_toggleAddCurrentDocumentOptionVisibility']();}['_finishContextItemLoading'](_0x10dfab,_0xa782bf){if(this['_pendingContextItems']['has'](_0x10dfab['uiId'])&&(this['_pendingContextItems']['set'](_0x10dfab['uiId'],_0x10dfab),this['fire']('contextItemLoadingEnded',{'contextItem':_0x10dfab,'isLoading':_0xa782bf}),_0x10dfab['resourceId'])){const _0x59a8fe=this['_findSourceIdsByResourceId'](_0x10dfab['resourceId']);_0x59a8fe&&_0x59a8fe['forEach'](_0x481eb3=>{this['_updateResourceInContextState'](_0x481eb3,_0x10dfab['resourceId'],!0x0);});}}['_addToConversationContextItem'](_0x5088f3){this['_conversationContextItems']['set'](_0x5088f3['uiId'],_0x5088f3);}['_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'](_0x3c8ab6=>({..._0x3c8ab6,'enabled':!0x0}))??[]},this['fire']('addContextOptionsChanged',{'options':this['_addContextOptionsState']});}['_getCustomSourcesInitialState'](){return this['_config']?.['sources']?.['map'](_0x3cc125=>({..._0x3cc125,'resources':[]}))??[];}['_toggleAddCurrentDocumentOptionVisibility'](){const _0x1d0a7a=this['isCurrentDocumentInContext']()||this['isCurrentDocumentInConversation']();this['_addContextOptionsState']['document']['isHidden']=_0x1d0a7a,this['fire']('addContextOptionsChanged',{'options':this['_addContextOptionsState']});}['_isResourceInContext'](_0x21ca17){for(const _0x5aed16 of this['_pendingContextItems']['values']())if(_0x5aed16['resourceId']===_0x21ca17)return!0x0;for(const _0x21c566 of this['_conversationContextItems']['values']())if(_0x21c566['resourceId']===_0x21ca17)return!0x0;return!0x1;}['_findSourceIdsByResourceId'](_0x5fbe92){const _0x4f91b5=[];for(const _0x47997e of this['_addContextOptionsState']['sources']){_0x47997e['resources']['find'](_0x2e9f2c=>_0x2e9f2c['id']===_0x5fbe92)&&_0x4f91b5['push'](_0x47997e['id']);}return 0x0===_0x4f91b5['length']?null:_0x4f91b5;}['_updateResourceInContextState'](_0x36bb36,_0x4cbfc9,_0x102e76){const _0x554b45=this['_addContextOptionsState']['sources']['find'](_0x58fb26=>_0x58fb26['id']===_0x36bb36);if(!_0x554b45)return;const _0x4bb444=_0x554b45['resources']['find'](_0x13d177=>_0x13d177['id']===_0x4cbfc9);_0x4bb444&&(_0x4bb444['isInContext']=_0x102e76,this['fire']('resourceStateChanged',{'sourceId':_0x36bb36,'resourceId':_0x4cbfc9,'isInContext':_0x102e76}));}['_startUploadOperation'](_0x2fed83){this['_ongoingUploadOperations']['set'](_0x2fed83,!0x0),this['_ongoingUploadOperations']['size']&&this['fire']('uploadProgressChanged',{'isUploadInProgress':!0x0});}['_finishUploadOperation'](_0x18f739){this['_ongoingUploadOperations']['delete'](_0x18f739),0x0===this['_ongoingUploadOperations']['size']&&this['fire']('uploadProgressChanged',{'isUploadInProgress':!0x1});}}const hs=['capabilitiesUpdated'];class AICapabilities extends Et(){['_isWebSearchEnabled'];['_isReasoningEnabled'];constructor(){super(),this['_isWebSearchEnabled']=!0x1,this['_isReasoningEnabled']=!0x1;}['init'](){this['reset']();}['reset'](){this['setWebSearch'](!0x1),this['setReasoning'](!0x1);}['getCapabilitiesConfig'](){return{'isWebSearchEnabled':this['_isWebSearchEnabled'],'isReasoningEnabled':this['_isReasoningEnabled']};}static['getCapabilitiesRequestData'](_0x555b48){const _0x174b6a={};return _0x555b48&&_0x555b48['isWebSearchEnabled']&&(_0x174b6a['webSearch']={}),_0x555b48&&_0x555b48['isReasoningEnabled']&&(_0x174b6a['reasoning']={}),_0x174b6a;}['toggleWebSearch'](){this['setWebSearch'](!this['_isWebSearchEnabled']);}['toggleReasoning'](){this['setReasoning'](!this['_isReasoningEnabled']);}['setWebSearch'](_0x2eb3dc){_0x2eb3dc!==this['_isWebSearchEnabled']&&(this['_isWebSearchEnabled']=_0x2eb3dc,this['fire']('capabilitiesUpdated',this['getCapabilitiesConfig']()));}['setReasoning'](_0x2a0751){_0x2a0751!==this['_isReasoningEnabled']&&(this['_isReasoningEnabled']=_0x2a0751,this['fire']('capabilitiesUpdated',this['getCapabilitiesConfig']()));}}class AIChatInteraction extends AIInteraction{['userMessage'];['conversationId'];['contextItems']=new Map();['capabilities'];['model'];['attributes'];constructor(_0x182b52){super(_0x182b52),this['conversationId']=_0x182b52['conversationId'],this['contextItems']=_0x182b52['contextItems'],this['capabilities']=_0x182b52['capabilities'],this['userMessage']=_0x182b52['userMessage'],this['model']=_0x182b52['model'],this['attributes']=_0x182b52['attributes'];}async['sendRequest'](){return this['connector']['queryAssistant']({'message':this['userMessage'],'conversationId':this['conversationId'],'parts':AIChatContext['mapContextItemsToRequestData'](this['contextItems']),'capabilities':AICapabilities['getCapabilitiesRequestData'](this['capabilities']),'model':this['model'],'attributes':this['attributes']});}['getDocumentContext'](){return this['contextItems']['get']('current-document');}['createReply'](_0x22da1d){const _0x444e95=this['getDocumentContext']();if(_0x444e95?.['documents']?.['length']){const _0x36bf41=_0x444e95['documents']['map'](_0x113d20=>_0x113d20['content']??'')['join']('');if(_0x36bf41)return super['createReply']({'documentContextContent':_0x36bf41,..._0x22da1d});}return super['createReply'](_0x22da1d);}}class AIChatConversation extends Et(){['id'];['isStarted']=!0x1;['isFromHistory'];['interactions']=[];['currentInteraction'];['selectedModel'];['connector'];['options'];constructor(_0x57b910){super(),this['options']=_0x57b910,this['connector']=_0x57b910['connector'],this['chatModels']=_0x57b910['chatModels'],this['id']=_0x57b910['conversationId'],this['isFromHistory']=_0x57b910['isFromHistory'];}async['init'](_0x38afe9){try{this['chatContext']=new AIChatContext({'connector':this['connector'],'config':_0x38afe9,'ownerId':this['id']}),this['chatContext']['delegate'](...as)['to'](this),this['chatContext']['init'](),this['chatCapabilities']=new AICapabilities(),this['chatCapabilities']['delegate'](...hs)['to'](this),this['chatCapabilities']['init']();const _0x25ccd2=await this['chatModels']['getAvailableModels']();this['fire']('conversationInitialized',{'availableModels':_0x25ccd2});const _0x20b5b3=await this['chatModels']['getModel'](this['options']['selectedModelId']);_0x20b5b3&&await this['setModel'](_0x20b5b3);}catch(_0x4e706b){const _0x1efa6d=new at('ai-chat-conversation-init-failed',null,{'message':_0x4e706b['message']||_0x4e706b});_0x1efa6d['stack']=_0x4e706b['stack'],this['fire']('error',{'error':_0x1efa6d});}}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:_0x258f90}=await this['connector']['startConversation'](this['id'],this['options']['group'])['getConversation']();this['id']=_0x258f90,this['isStarted']=!0x0,this['fire']('conversationStarted',{'conversationId':this['id'],'selectedModel':this['selectedModel']});}catch(_0x2fa023){const _0x41c90e=new at('ai-chat-conversation-start-failed',null,{'message':_0x2fa023['message'],'conversationId':this['id']});throw _0x41c90e['stack']=_0x2fa023['stack'],this['fire']('error',{'error':_0x41c90e}),_0x41c90e;}}async['load'](_0x1b1db7,_0x482418){try{const _0x5ea5bf=await this['connector']['fetchConversation'](_0x1b1db7)['getConversation'](),_0x581553=await this['connector']['fetchConversationMessages'](_0x1b1db7)['getMessages'](),_0x298e97=_0x581553[0x0]['model'];this['isStarted']=!0x0,this['id']=_0x5ea5bf['id'],'title'in _0x5ea5bf?this['fire']('setConversationTitle',_0x5ea5bf['title'],!0x0):this['fire']('setConversationTitle','',!0x0);const _0x61fd27=(await this['chatModels']['getAll']())['find'](_0x5abbc2=>_0x5abbc2['id']['toLowerCase']()===_0x298e97['toLowerCase']());return this['selectedModel']=_0x61fd27,this['fire']('modelSelected',{'selectedModel':_0x61fd27,'isDisabled':!0x0}),await this['_processMessagesToInteractions'](_0x581553,_0x482418,_0x298e97),this['currentInteraction']=void 0x0,this;}catch(_0x169801){const _0x54fbf5=new at('ai-chat-conversation-init-from-id-failed',null,{'message':_0x169801['message'],'conversationId':_0x1b1db7});throw _0x54fbf5['stack']=_0x169801['stack'],this['fire']('error',{'error':_0x54fbf5}),_0x54fbf5;}}async['_processMessagesToInteractions'](_0x145502,_0x4a86ef,_0x5c8f4f){let _0x187108,_0x20bb45=!0x1;for(const _0x4e06f5 of _0x145502)if('user'===_0x4e06f5['role']){const {contextItems:_0x53a16f,hasUnmatched:_0x276c61}=await this['_extractContextItems'](_0x4e06f5);_0x20bb45=_0x276c61;const _0x22a99c={'isReasoningEnabled':Object['hasOwn'](_0x4e06f5['capabilities'],'reasoning'),'isWebSearchEnabled':Object['hasOwn'](_0x4e06f5['capabilities'],'webSearch')};_0x187108=this['createInteraction']({'userMessage':_0x4e06f5['prompt'],'contextItems':_0x53a16f,'capabilities':_0x22a99c,'modelId':_0x5c8f4f,'attributes':_0x4e06f5['attributes']}),this['currentInteraction']=_0x187108,this['chatContext']['addToConversationContext'](this['currentInteraction']['contextItems']);}else{if('assistant'===_0x4e06f5['role']&&_0x187108){const _0xc71896=[];for(const _0x517793 of _0x4e06f5['content'])switch(_0x517793['type']){case'text':case'modification':{const _0x316d58=_0x187108['getDocumentContext'](),_0x5d4e91=(_0x316d58?.['documents']?.['length']?_0x316d58['documents']['some'](_0x380be9=>_0x380be9['sessionId']!==_0x4a86ef):_0x316d58?.['sessionId']!==_0x4a86ef)||_0x20bb45;_0x187108['currentReply']?.['type']!==_0x517793['type']&&(_0x187108['currentReply']=_0x187108['createReply']({'type':_0x517793['type'],'isDone':!0x0,'interactionId':_0x187108['id'],'areActionsDisabled':_0x5d4e91,'isFromHistory':!0x0}),_0xc71896['length']>0x0&&(_0x187108['currentReply']['sources']=_0xc71896['splice'](0x0))),_0x187108['currentReply']['appendContent'](_0x517793['content']);break;}case'url':_0xc71896['push'](_0x517793);break;case'mcp-tool-result':{const {data:_0x384e24,attributes:_0x352096}=JSON['parse'](_0x517793['content']);_0x187108['_handleToolResultData']({'toolName':_0x517793['toolName'],'data':_0x384e24,'attributes':_0x352096});break;}}}}}async['_extractContextItems'](_0x55f795){const _0x7757df=new Map();if(!_0x55f795['content'])return{'contextItems':_0x7757df,'hasUnmatched':!0x1};const _0x22a756=this['_resolveEditors'](),{contextItem:_0x2137d5,hasUnmatched:_0x584c43}=await this['chatContext']['populateDocumentsFromMessage'](_0x55f795['content'],_0x22a756);_0x2137d5&&_0x7757df['set'](_0x2137d5['id'],_0x2137d5);for(const _0x69029b of _0x55f795['content']){if('document'===_0x69029b['type'])continue;const _0x497cc9=await this['chatContext']['populateFromMessage'](_0x69029b);_0x497cc9&&_0x7757df['set'](_0x497cc9['id'],_0x497cc9);}return{'contextItems':_0x7757df,'hasUnmatched':_0x584c43};}['_resolveEditors'](){return this['options']['getEditors']?this['options']['getEditors']():this['options']['getEditor']?[this['options']['getEditor']()]:[];}async['handleUserInteraction']({userMessage:_0x5d5d1c,attributes:_0x54dada}){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 _0x46ec81=this['chatContext']['getPendingContextItems'](),_0x2d8b9e=this['chatCapabilities']['getCapabilitiesConfig'](),_0x255f82=this['selectedModel']['id'];this['currentInteraction']=this['createInteraction']({'userMessage':_0x5d5d1c,'contextItems':_0x46ec81,'capabilities':_0x2d8b9e,'modelId':_0x255f82,'attributes':_0x54dada}),await this['currentInteraction']['start'](),this['chatContext']['addToConversationContext'](this['currentInteraction']['contextItems']);}catch(_0x118ea3){if(_0x118ea3 instanceof at)this['fire']('error',{'interactionId':this['currentInteraction']?this['currentInteraction']['id']:void 0x0,'error':_0x118ea3});else{const _0x3e1922=os['get'](_0x118ea3['code'])||'ai-chat-handle-user-interaction-start-failed';this['fire']('error',{'interactionId':this['currentInteraction']?this['currentInteraction']['id']:void 0x0,'error':new at(_0x3e1922,null,{'error':_0x118ea3})});}}finally{this['currentInteraction']?.['stop'](),this['currentInteraction']=void 0x0;}}['createInteraction']({userMessage:_0x585e07,contextItems:_0x2b804a,capabilities:_0x542c81,modelId:_0x123f2e,attributes:_0x290707}){const _0x44860a=new AIChatInteraction({'userMessage':_0x585e07,'contextItems':_0x2b804a,'capabilities':_0x542c81,'conversationId':this['id'],'connector':this['connector'],'locale':this['options']['locale'],'model':_0x123f2e,'attributes':_0x290707});return _0x44860a['delegate'](...rs)['to'](this),this['interactions']['push'](_0x44860a),this['fire']('interactionCreated',_0x44860a),_0x44860a;}['getInteraction'](_0x545769){return this['interactions']['find'](_0xfaeb0f=>_0xfaeb0f['id']===_0x545769);}['removeInteraction'](_0x427a97){const _0x27cd93=this['getInteraction'](_0x427a97);_0x27cd93&&(_0x27cd93['destroy'](),this['interactions']['splice'](this['interactions']['indexOf'](_0x27cd93),0x1));}get['lastInteraction'](){return this['interactions'][this['interactions']['length']-0x1];}['addCurrentDocumentToContext'](_0x5e4a0d){this['chatContext']['addCurrentDocumentToContext'](_0x5e4a0d);}async['updateCurrentDocumentInContext']({content:_0x29e44d,version:_0x6be36,sessionId:_0x7a1da5,channelId:_0x436db4,rootName:_0x2b1e9b,selections:_0x309356}){await this['chatContext']['updateCurrentDocument'](_0x29e44d,_0x6be36,_0x7a1da5,_0x436db4,_0x2b1e9b,_0x309356);}async['updateCurrentDocumentsInContext'](_0x5c62b8){await this['chatContext']['updateCurrentDocuments'](_0x5c62b8);}['getSourceByDataId'](_0x185d5c){return this['chatContext']['getSourceByDataId'](_0x185d5c);}['getDocumentContextSliceByDataId'](_0x46e363){return this['chatContext']['getDocumentContextSliceByDataId'](_0x46e363);}['getCurrentDocumentContext'](){return this['currentInteraction']?.['getDocumentContext']()?.['content']||'';}['addSelectionToContext'](_0x156249){this['chatContext']['addSelectionToContext'](_0x156249);}['removeSelectionFromContext'](){this['chatContext']['removeSelectionFromContext']();}['addFilesToContext'](_0x14a9e8){this['chatContext']['addFilesToContext'](_0x14a9e8);}['addUrlToContext'](_0x148ec7){this['chatContext']['addUrlToContext'](_0x148ec7);}['addToolItemToContext'](_0xb251e1){this['chatContext']['addToolItemToContext'](_0xb251e1);}['addResourceToContext'](_0xf3dcae,_0x3bc1a5){this['chatContext']['addResourceToContext'](_0xf3dcae,_0x3bc1a5);}['loadSourceResources'](_0x5426bf,_0x16700f,_0x6587ad){return this['chatContext']['loadSourceResources'](_0x5426bf,_0x16700f,_0x6587ad);}['removeFromContext'](_0xa56faa){this['chatContext']['removeFromContext'](_0xa56faa);}['setWebSearch'](_0x1eaf7c){this['chatCapabilities']['setWebSearch'](_0x1eaf7c);}['toggleWebSearch'](){this['chatCapabilities']['toggleWebSearch']();}['setReasoning'](_0x5b7964){this['chatCapabilities']['setReasoning'](_0x5b7964);}['toggleReasoning'](){this['chatCapabilities']['toggleReasoning']();}['isCurrentDocumentInContext'](){return this['chatContext']['isCurrentDocumentInContext']();}['isCurrentDocumentInConversation'](){return this['chatContext']['isCurrentDocumentInConversation']();}['isSelectionInContext'](){return this['chatContext']['isSelectionInContext']();}async['setModel'](_0x26b04d){_0x26b04d?!0x1===await this['chatModels']['isAvailable'](_0x26b04d)&&(gt('ai-chat-conversation-set-model-not-available',{'conversation':this,'model':_0x26b04d}),_0x26b04d=(await this['chatModels']['getAvailableModels']())[0x0]):(gt('ai-chat-conversation-set-model-null',{'conversation':this}),_0x26b04d=(await this['chatModels']['getAvailableModels']())[0x0]),_0x26b04d['id']!==this['selectedModel']?.['id']&&(this['selectedModel']=_0x26b04d,this['chatCapabilities']['reset'](),this['fire']('modelSelected',{'selectedModel':_0x26b04d}));}}class AIModels extends Et(){['_connector'];['_config'];['_locale'];['_modelList']=[];['_modelsRequest']=null;constructor({connector:_0x29def1,config:_0xd3a565,locale:_0x3a1563}){super(),this['_connector']=_0x29def1,this['_config']=_0xd3a565,this['_locale']=_0x3a1563;}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 _0x58c9ef=await this['getAll']();let _0x55f7c9;return _0x55f7c9=this['_availableModels']?this['_filterModels'](_0x58c9ef,this['_availableModels']):_0x58c9ef['filter'](_0x2eaa79=>_0x2eaa79['recommended']),_0x55f7c9;}async['getModel'](_0x366727){const _0x40c50e=await this['getAll']();if(!_0x40c50e['length'])return null;if(_0x366727){const _0x55dd6a=this['_getModelById'](_0x40c50e,_0x366727);if(_0x55dd6a)return _0x55dd6a;gt('ai-chat-model-id-unrecognized',{'modelId':_0x366727,'fallBackModelId':this['_defaultModelId']});}return this['getDefault']();}async['getDefault'](){const _0x31afe4=await this['getAvailableModels']();if(!_0x31afe4['length'])return null;if(this['_defaultModelId']){const _0x10620c=this['_getModelById'](_0x31afe4,this['_defaultModelId']);if(_0x10620c)return _0x10620c;gt('ai-chat-default-model-id-unrecognized',{'defaultModelId':this['_defaultModelId'],'fallBackModelId':_0x31afe4[0x0]['id']});}return _0x31afe4[0x0];}async['isAvailable'](_0x4ce8d6){return(await this['getAvailableModels']())['some'](_0x2c87e4=>_0x2c87e4['name']===_0x4ce8d6['name']&&_0x2c87e4['provider']===_0x4ce8d6['provider']);}async['_retrieveModels'](){if(!this['_modelList']['length'])try{const _0x2b3f4e=this['_locale']['uiLanguage']||'en',_0x49d4c0=this['_connector']['getModels'](_0x2b3f4e),_0x5027f0=await _0x49d4c0['list']();this['_modelList']=_0x5027f0['items']['map'](_0x40cbcb=>cs(_0x40cbcb)?{..._0x40cbcb,'name':Hi(this['_locale'],'AI_MODEL_NAME_AUTO')}:_0x40cbcb);}catch(_0x4024bd){throw Ct('ai-models-unable-to-retrieve',{'error':_0x4024bd}),_0x4024bd;}return[...this['_modelList']];}['_filterModels'](_0x5afbf1,_0x1179a1){let _0x551dd8;if(_0x1179a1){_0x551dd8=[];const _0x55be6e=new Set(),_0x5c193f='string'==typeof _0x1179a1?[_0x1179a1['toLocaleLowerCase']()]:_0x1179a1['map'](_0x1774e3=>_0x1774e3['toLocaleLowerCase']());for(const _0x522784 of _0x5c193f)for(const _0x4f4039 of _0x5afbf1)!_0x55be6e['has'](_0x4f4039['id'])&&this['_isMatchingFilter'](_0x4f4039,_0x522784)&&(_0x551dd8['push'](_0x4f4039),_0x55be6e['add'](_0x4f4039['id']));}else _0x551dd8=_0x5afbf1;return _0x551dd8;}['_isMatchingFilter'](_0xb186a1,_0x5b4b6d){const _0x3d31a3=_0xb186a1['id']['toLocaleLowerCase'](),_0x1ae0a8=_0xb186a1['name']['toLocaleLowerCase'](),_0x4f1b68=_0xb186a1['provider']['toLocaleLowerCase']();return _0x3d31a3===_0x5b4b6d||_0x1ae0a8===_0x5b4b6d||cs(_0xb186a1)&&'auto'===_0x5b4b6d||_0x4f1b68===_0x5b4b6d||_0x3d31a3['startsWith'](_0x5b4b6d);}['_getModelById'](_0x46a459,_0x8f5ecc){return _0x46a459['find'](_0x12c271=>cs(_0x12c271)&&'auto'===_0x8f5ecc?_0x12c271:_0x12c271['id']===_0x8f5ecc)||null;}}function cs(_0x478bc7){return _0x478bc7['id']['startsWith']('agent');}function ls(_0x57cac7){return _0x57cac7?_0x57cac7 instanceof _0x581096?[_0x57cac7]:_0x57cac7['editors']&&0x0!==_0x57cac7['editors']['length']?Array['from'](_0x57cac7['editors']):[]:[];}function us(_0x7b8174){const _0x4f2f34=ls(_0x7b8174);if(!_0x4f2f34['length'])throw new at('ai-get-editor-from-context-no-editor');if(0x1===_0x4f2f34['length'])return _0x4f2f34[0x0];const _0x1333f9=_0x4f2f34['find'](_0xefd070=>_0xefd070['ui']?.['focusTracker']?.['isFocused']);if(_0x1333f9)return _0x1333f9;const _0x2c258b=function(_0x2e4118){if(_0x2e4118 instanceof _0x581096)return;const _0x374822=_0x2e4118;if(!_0x374822['plugins']||!_0x374822['plugins']['has']('AIEditing'))return;const _0x33bd7d=_0x374822['plugins']['get']('AIEditing');return _0x33bd7d['getLastContentFocusedEditor']?.();}(_0x7b8174);return _0x2c258b&&_0x4f2f34['includes'](_0x2c258b)?_0x2c258b:_0x4f2f34[0x0];}function ds(_0x509357){return us(_0x509357);}function _s({editor:_0xb57f6b,interaction:_0x1d539a,reply:_0x2db518,groups:_0x3e8c41,transform:_0x4b7c55,documentCompare:_0xb52256,documentCompareOptions:_0x59af4f,documentContextSlice:_0x258d4a}){const _0x3c4bc9=_0x1d539a['getDocumentContext']();if(!_0x3c4bc9)return[];const _0x21a768=_0x2db518['documentContextContent']['cloneNode'](!0x0);for(const {changes:_0x293618}of _0x3e8c41){const _0x4e1421=_0x293618['filter'](_0x4db91c=>'new'!=_0x4db91c['type'])['map'](_0x55e9b1=>Wi('data-id',_0x55e9b1['id'],_0x21a768)),_0x450ce2=_0x293618['filter'](_0x27c56e=>'removed'!=_0x27c56e['type'])['map'](_0x5d4e49=>_0x5d4e49['node']['cloneNode'](!0x0));let _0x2c464e=null;if(_0x4e1421['length']){_0x2c464e=_0x4e1421[0x0]['previousSibling'];for(let _0x1c3579=0x0;_0x1c3579<_0x4e1421['length'];_0x1c3579++)_0x497429(_0x4e1421[_0x1c3579]);}if(_0x450ce2['length']){_0x2c464e||(_0x293618[0x0]['anchorId']?_0x2c464e=Wi('data-id',_0x293618[0x0]['anchorId'],_0x21a768):(_0x2c464e=_0x450ce2['shift'](),_0x38563a(_0x21a768,_0x2c464e)));for(let _0x4f5beb=0x0;_0x4f5beb<_0x450ce2['length'];_0x4f5beb++)_0x3567c2(_0x2c464e,_0x450ce2[_0x4f5beb]),_0x2c464e=_0x450ce2[_0x4f5beb];}}let _0x597d41,_0x35b082,_0x384109,_0x3e358e=_0x59af4f;if(_0x258d4a){_0x597d41=_0x258d4a['html'],_0x384109=_0x258d4a['version'],_0x3e358e={..._0x59af4f,'anchor':_0x258d4a['rootName']};const _0x4ec5ed=new _0x135e16([]),_0x1da496=_0x21a768['children'],_0x5150ae=_0x2db518['dataIdDocumentSources'],_0x4f2b15=_0x2db518['newNodeAnchorIds'],_0x16de49=_0x258d4a['editor'],_0x1b0295=_0x258d4a['rootName'],_0x115aef=new Array(_0x1da496['length']),_0xd66ab3=_0x20be62=>_0x20be62?_0x20be62['editor']===_0x16de49&&_0x20be62['rootName']===_0x1b0295:void 0x0;for(let _0x4f51e3=0x0;_0x4f51e3<_0x1da496['length'];_0x4f51e3++){const _0xffae07=$i(_0x1da496[_0x4f51e3],'data-id');if(!_0xffae07)continue;const _0x9ab7b5=_0xd66ab3(_0x5150ae?.['get'](_0xffae07));if(void 0x0!==_0x9ab7b5){_0x115aef[_0x4f51e3]=_0x9ab7b5;continue;}const _0xd1137a=_0x4f2b15['get'](_0xffae07),_0x25e4fb=_0xd1137a?_0xd66ab3(_0x5150ae?.['get'](_0xd1137a)):void 0x0;void 0x0!==_0x25e4fb&&(_0x115aef[_0x4f51e3]=_0x25e4fb);}for(let _0x4016cc=0x0;_0x4016cc<_0x1da496['length'];_0x4016cc++)if(void 0x0===_0x115aef[_0x4016cc]){for(let _0x275fc8=_0x4016cc-0x1;_0x275fc8>=0x0;_0x275fc8--)if(void 0x0!==_0x115aef[_0x275fc8]){_0x115aef[_0x4016cc]=_0x115aef[_0x275fc8];break;}if(void 0x0===_0x115aef[_0x4016cc]){for(let _0x3637ec=_0x4016cc+0x1;_0x3637ec<_0x1da496['length'];_0x3637ec++)if(void 0x0!==_0x115aef[_0x3637ec]){_0x115aef[_0x4016cc]=_0x115aef[_0x3637ec];break;}}}for(let _0x2ff64f=0x0;_0x2ff64f<_0x1da496['length'];_0x2ff64f++)_0x115aef[_0x2ff64f]&&_0x4ec5ed['children']['push'](_0x26480f(_0x1da496[_0x2ff64f],!0x0));_0x35b082=Ki(_0x4ec5ed);}else _0x597d41=_0x3c4bc9['content'],_0x384109=_0x3c4bc9['version'],_0x35b082=Ki(_0x21a768);const _0x175264=_0xb52256['getDiff'](_0x597d41,_0x35b082,{..._0x3e358e,'targetEditor':_0xb57f6b})['getOperations']();if(_0x4b7c55){const _0x301dac=_0xb57f6b['model']['document']['history']['getOperations'](_0x384109),_0x43276f={'document':_0xb57f6b['model']['document'],'useRelations':!0x1,'padWithNoOps':!0x1};return _0x5afac3(_0x175264,_0x301dac,_0x43276f)['operationsA'];}return _0x175264;}function Is(_0x2b79b4,_0x47b711){if('marker'!=_0x47b711['type'])return;const _0x240480=_0x2b79b4['model']['markers']['get'](_0x47b711['name']);_0x240480&&(_0x47b711['oldRange']=_0x240480['getRange']());}class AIChatController extends _0x530a64{['activeConversation'];['_aiEditing'];['_aiConnector'];['_aiChatUi'];['_aiChatModels'];['_aiChatBalloon'];['_activeBalloon'];['_wiredBalloons']=new Set();['_batchToChanges']=new Map();['_currentPreviewedChangeGroup']=null;['_bodyCollection'];static get['requires'](){return[AIConnector,_0x4f763b];}static get['pluginName'](){return'AIChatController';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){this['_bodyCollection']=new Qt(this['context']['locale']),this['_bodyCollection']['attachToDom'](),this['_aiConnector']=this['context']['plugins']['get']('AIConnector'),this['_aiChatUi']=this['context']['plugins']['get']('AIChatUI'),this['_aiEditing']=this['context']['plugins']['get']('AIEditing'),this['_aiChatModels']=new AIModels({'connector':this['_aiConnector'],'config':this['context']['config']['get']('ai.models'),'locale':this['context']['locale']});const _0x55e8f9=this['context']['plugins']['get']('AITabs');this['listenTo'](this['_aiChatUi'],'startConversation',()=>{this['_startConversationSafely']();}),this['listenTo'](this['_aiChatUi'],'sendUserMessage',(_0x6970c0,_0x3a22d)=>{this['_handleUIUserMessage']({'message':_0x3a22d});}),this['listenTo'](_0x55e8f9['view'],'change:activeTab',(_0x358bba,_0x55fdc9,_0x580d58)=>{'chat'!==_0x580d58&&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',(_0x44905d,_0x582b03)=>{this['activeConversation']?.['addFilesToContext'](Array['from'](_0x582b03));}),this['listenTo'](this['_aiChatUi'],'addUrlToContext',(_0x1d6066,_0x5532ce)=>{this['activeConversation']?.['addUrlToContext'](_0x5532ce);}),this['listenTo'](this['_aiChatUi'],'executeCustomItemCallback',(_0x4305aa,_0x4b59eb)=>{_0x4b59eb['callback'](this['context']);}),this['listenTo'](this['_aiChatUi'],'addResourceToContext',(_0x522067,_0x33782f)=>{this['activeConversation']?.['addResourceToContext'](_0x33782f['source'],_0x33782f['resource']);}),this['listenTo'](this['_aiChatUi'],'removeContextItem',(_0x2944d8,_0x2f6237)=>{this['_removeFromContext'](_0x2f6237);}),this['listenTo'](this['_aiChatUi'],'loadSourceResources',(_0x1482a6,_0x341d09)=>{this['activeConversation']?.['loadSourceResources'](_0x341d09['sourceId'],_0x341d09['query'],_0x341d09['uid']);}),this['listenTo'](this['_aiChatUi'],'toggleWebSearch',()=>{this['_toggleWebSearch']();}),this['listenTo'](this['_aiChatUi'],'toggleReasoning',()=>{this['_toggleReasoning']();}),this['listenTo'](this['_aiChatUi'],'selectModel',(_0xca0a3d,_0x111c71)=>{this['activeConversation']?.['setModel'](_0x111c71);}),this['listenTo'](this['_aiChatUi'],'like',(_0x4bc97a,{replyId:_0x1e5e09})=>{console['log']('Liked\x20response',_0x1e5e09);}),this['listenTo'](this['_aiChatUi'],'dislike',(_0x10f176,{replyId:_0x24161b})=>{console['log']('Disliked\x20response',_0x24161b);}),this['listenTo'](this['_aiChatUi'],'insertSuggestion',(_0x3f26b5,_0x54d0ce)=>{this['_insertSuggestion'](_0x54d0ce);}),this['listenTo'](this['_aiChatUi'],'showChangeInText',(_0x389446,{replyId:_0x114e94,partIndex:_0x3d2414})=>{this['_aiChatBalloonShowDiff']=this['_aiChatUi']['showDiff'],this['_openBalloonFor'](_0x114e94,_0x3d2414);}),this['listenTo'](this['_aiChatUi'],'mouseOverSuggestion',(_0x3eea83,{replyId:_0x107c7d,partIndex:_0x4fe41f})=>{const _0x3480af=this['_getDocumentRangeForReplyChanges'](_0x107c7d,_0x4fe41f);_0x3480af&&'$graveyard'!=_0x3480af['range']['root']['rootName']&&this['_aiEditing']['showFakeVisualSelection']({'ranges':[_0x3480af['range']],'id':'change-area','priority':0xa});}),this['listenTo'](this['_aiChatUi'],'mouseLeaveSuggestion',()=>{this['_aiEditing']['hideFakeVisualSelection']('change-area');}),this['listenTo'](this['_aiChatUi'],'applySuggestion',(_0x5cffa4,_0x438b5c)=>{this['_aiEditing']['hideFakeVisualSelection']('change-area'),this['_applySuggestion'](_0x438b5c);}),this['listenTo'](this['_aiChatUi'],'toggleSuggestionDisplayMode',async(_0xdbe457,{replyId:_0x3afcb3,showDiff:_0x329d21})=>{const {reply:_0xda31cb}=this['getInteractionAndReplyById'](_0x3afcb3),_0x2dfb6d=_0xda31cb['getContentParts']({'showDiff':_0x329d21,'editor':ds(this['context'])});await this['_aiChatUi']['updateFeedItemAIReplySuggestionContent']({'id':_0xda31cb['id'],'parts':_0x2dfb6d});}),this['listenTo'](this['_aiChatUi'],'rejectSuggestion',(_0x764bdb,{replyId:_0x5245d4,partIndex:_0x37d153})=>{this['_rejectSuggestion']({'replyId':_0x5245d4,'partIndex':_0x37d153}),this['_aiEditing']['hideFakeVisualSelection']('change-area');}),this['set']('_aiChatBalloonShowDiff',!0x1),this['context']['plugins']['has']('AIChatBalloon')&&(this['_aiChatBalloon']=this['context']['plugins']['get']('AIChatBalloon')),this['on']('interactionCreated',(_0x56a05f,_0x3a5437)=>{this['_aiChatUi']['addFeedItemUserMessage'](_0x3a5437);}),this['on']('replyCreated',(_0x2c0ffd,_0x579d8e)=>{this['_addFeedItemReply'](_0x579d8e);});}async['afterInit'](){this['context']instanceof _0x581096?this['_integrateEditor'](this['context']):this['listenTo'](this['context']['editors'],'add',(_0x11e63c,_0x2dd7d6)=>{_0x2dd7d6['on']('ready',()=>{this['_integrateEditor'](_0x2dd7d6);});});const _0x4c42a7=this['context']['config']['get']('ai.chat.initialConversation');let _0x153c2a=_0x4c42a7;if('lastCreated'!=_0x4c42a7||(_0x153c2a=await this['_getLastCreatedConversationId'](),_0x153c2a))return'new'==_0x153c2a?this['_startConversationSafely']():this['loadConversation'](_0x153c2a);}async['destroy'](){return await this['_stopLastInteraction'](),this['_bodyCollection']['detachFromDom'](),super['destroy']();}async['loadConversation'](_0x35bd21){this['_activeBalloon']?.['close'](),this['_activeBalloon']=void 0x0,this['_currentPreviewedChangeGroup']=null,(this['context']['plugins']['get'](AITabs)['view']['activateTab']('chat'),this['_aiChatUi']['setFeedItemRenderingStrategy']('static'),this['_aiChatUi']['toggleLoadingSkeleton'](!0x0),await this['_stopLastInteraction']());try{await this['_aiConnector']['fetchConversation'](_0x35bd21)['getConversation'](),await this['_startConversationSafely']({'id':_0x35bd21}),this['_updateConversationTitle']('\x20'),await this['activeConversation']['load'](_0x35bd21,this['_aiEditing']['sessionId']),this['activeConversation']['isCurrentDocumentInConversation']()&&this['addCurrentDocumentToChatContext']();}catch(_0x147d2f){this['_aiChatUi']['addFeedItemError']({'errorMessage':Hi(this['context']['locale'],'AI_CHAT_UNABLE_TO_LOAD_CONVERSATION'),'id':_0x35bd21}),this['_logError'](new at('ai-chat-conversation-not-found',this,{'error':_0x147d2f}));}finally{this['_aiChatUi']['startAutoScroll']({'smooth':!0x1}),this['_aiChatUi']['setFeedItemRenderingStrategy']('streaming'),this['_aiChatUi']['toggleLoadingSkeleton'](!0x1);}}['registerToolDataCallback'](_0x553fa5){let _0x295d1a=null,_0x34f16d=null;this['on']('toolDataReceived',(_0x166612,_0x2caf92,_0x56e6d5)=>{_0x56e6d5['id']!==_0x295d1a&&(_0x295d1a=_0x56e6d5['id'],_0x34f16d=this['_getAIChatFeedAPI'](_0x56e6d5)),_0x553fa5(_0x2caf92,_0x34f16d);});}['addCurrentDocumentToChatContext'](){this['activeConversation']?.['addCurrentDocumentToContext'](Hi(this['context']['locale'],'AI_CHAT_CONTEXT_CURRENT_DOCUMENT'));}async['addSelectionToChatContext'](){const _0x292e35=this['_aiEditing']['getSelectionText']();this['activeConversation']?.['addSelectionToContext'](_0x292e35),this['addCurrentDocumentToChatContext']();}['removeSelectionFromChatContext'](){this['activeConversation']?.['removeSelectionFromContext']();}['focusPromptInput'](){this['_aiChatUi']['focusPromptInput']();}async['startConversation'](_0x47db0e){await this['_startConversationSafely']({'modelId':_0x47db0e?.['modelId']});}async['sendMessage'](_0x4c64d0){await this['_handleUIUserMessage'](_0x4c64d0);}['getGroupId'](){const _0x2ae369=this['context']['config']['get']('collaboration.channelId');if(!_0x2ae369)throw new at('ai-missing-channel-id',this);return _0x2ae369;}['_handleRemovedConversation'](_0x53ffdd){this['activeConversation']['id']===_0x53ffdd&&this['_startConversationSafely']();}['_insertSuggestion'](_0x501877){const _0x47849a=this['context']['plugins']['get']('DocumentCompare'),{reply:_0x100806,interaction:_0x1e0527}=this['getInteractionAndReplyById'](_0x501877['replyId']),_0x47fd9e=void 0x0!==_0x501877['partIndex']?[_0x100806['changeGroups'][_0x501877['partIndex']]]:_0x100806['changeGroups']['filter'](_0x1d154f=>'pending'==_0x1d154f['state']);for(const _0x3d94f1 of this['_groupChangesByTarget'](_0x100806,_0x47fd9e)){const {target:_0x35e610,groups:_0x56bbcf,groupsIndexes:_0x8f5262,slice:_0x20ac4c}=_0x3d94f1;if(!_0x35e610['editor']['plugins']['has']('TrackChanges'))throw new at('ai-no-track-changes',null);const _0x3bb06c=this['_getDocumentRangeForReplyChanges'](_0x501877['replyId'],_0x8f5262[0x0]);if(!_0x3bb06c||'$graveyard'==_0x3bb06c['range']['root']['rootName']){_0x8f5262['forEach'](_0x57e804=>_0x100806['setChangeGroupState'](_0x57e804,'outdated'));continue;}_0x8f5262['forEach'](_0x51527f=>_0x100806['setChangeGroupState'](_0x51527f,'accepted'));const _0x5ee0ea=_s({'editor':_0x35e610['editor'],'reply':_0x100806,'interaction':_0x1e0527,'groups':_0x56bbcf,'transform':!0x0,'documentCompare':_0x47849a,'documentCompareOptions':{'anchor':_0x20ac4c?.['rootName']??'main','markDeletions':!0x0},'documentContextSlice':_0x20ac4c});let _0x3dc67e;this['_scrollToSuggestionRange'](_0x3bb06c['range'],!0x1,_0x35e610['editor']),_0x35e610['editor']['model']['change'](_0x190b83=>{_0x3dc67e=_0x190b83['batch'],_0x35e610['editor']['plugins']['get']('TrackChangesEditing')['_applyOperationsAsSuggestions'](_0x5ee0ea),this['_aiEditing']['hideFakeVisualSelection']('change-area');}),this['_batchToChanges']['set'](_0x3dc67e,{'interactionId':_0x1e0527['id'],'replyId':_0x100806['id'],'indexes':_0x8f5262['slice']()});}this['_updateRatings'](_0x100806);}['_applySuggestion'](_0x574c7c){const _0x225d0c=this['context']['plugins']['get'](_0x4f763b),{reply:_0x263f2b,interaction:_0x378507}=this['getInteractionAndReplyById'](_0x574c7c['replyId']),_0x542417=void 0x0!==_0x574c7c['partIndex']?[_0x263f2b['changeGroups'][_0x574c7c['partIndex']]]:_0x263f2b['changeGroups']['filter'](_0x59ff89=>'pending'==_0x59ff89['state']);for(const _0x2ada58 of this['_groupChangesByTarget'](_0x263f2b,_0x542417)){const {target:_0x2dd723,groups:_0x13978e,groupsIndexes:_0x5d5979,slice:_0x55131e}=_0x2ada58,_0x4e12c1=this['_getDocumentRangeForReplyChanges'](_0x574c7c['replyId'],_0x5d5979[0x0]);if(!_0x4e12c1||'$graveyard'==_0x4e12c1['range']['root']['rootName']){_0x5d5979['forEach'](_0x3aa512=>_0x263f2b['setChangeGroupState'](_0x3aa512,'outdated'));continue;}_0x5d5979['forEach'](_0x5f4336=>_0x263f2b['setChangeGroupState'](_0x5f4336,'accepted'));const _0x3e2456=_s({'editor':_0x2dd723['editor'],'reply':_0x263f2b,'interaction':_0x378507,'groups':_0x13978e,'transform':!0x0,'documentCompare':_0x225d0c,'documentCompareOptions':{'anchor':_0x55131e?.['rootName']??'main','markDeletions':!0x1},'documentContextSlice':_0x55131e});let _0x12a9f6;this['_scrollToSuggestionRange'](_0x4e12c1['range'],!0x1,_0x2dd723['editor']),_0x2dd723['editor']['model']['change'](_0x1f8d40=>{_0x12a9f6=_0x1f8d40['batch'];for(const _0x3a0ef1 of _0x3e2456)_0x3a0ef1['baseVersion']=_0x2dd723['editor']['model']['document']['version'],Is(_0x2dd723['editor'],_0x3a0ef1),_0x1f8d40['batch']['addOperation'](_0x3a0ef1),_0x2dd723['editor']['model']['applyOperation'](_0x3a0ef1);}),this['_batchToChanges']['set'](_0x12a9f6,{'interactionId':_0x378507['id'],'replyId':_0x263f2b['id'],'indexes':_0x5d5979['slice']()});}this['_updateRatings'](_0x263f2b);}['_rejectSuggestion'](_0x397dcf){const {reply:_0x23b59e}=this['getInteractionAndReplyById'](_0x397dcf['replyId']);_0x23b59e['setChangeGroupState'](_0x397dcf['partIndex'],'rejected');}['_openBalloonFor'](_0x617373,_0x260eda){if(!this['_aiChatBalloon'])return;const {reply:_0x1da37e}=this['getInteractionAndReplyById'](_0x617373),_0x3e97b8=_0x1da37e['getContentParts']({'showDiff':this['_aiChatBalloonShowDiff'],'editor':ds(this['context'])});let _0x5dc069,_0x1ef05b;if(void 0x0!==_0x260eda?(_0x1ef05b=_0x3e97b8['find'](_0x4abfec=>_0x4abfec['index']==_0x260eda),_0x5dc069=_0x1ef05b?.['index']):(_0x1ef05b=_0x3e97b8[0x0],_0x5dc069=_0x1ef05b['index']),this['_currentPreviewedChangeGroup']?.['replyId']==_0x617373&&this['_currentPreviewedChangeGroup']?.['partIndex']==_0x5dc069)return;const _0x2fc77e=this['_getUserPresentableContentPartDocumentRange'](_0x617373,_0x1da37e,_0x1ef05b),_0x38c2a6=_0x1da37e['changeGroups']['find'](_0x25293a=>_0x25293a['index']==_0x5dc069),_0x5efc95=_0x38c2a6?this['_resolveGroupTarget'](_0x1da37e,_0x38c2a6):null,_0x260f70=_0x5efc95?.['editor']??ds(this['context']),_0x48e130=_0x260f70['plugins']['has']('AIChatBalloon')?_0x260f70['plugins']['get']('AIChatBalloon'):this['_aiChatBalloon'];if(this['_activeBalloon']&&this['_activeBalloon']!==_0x48e130&&this['_activeBalloon']['close'](),!_0x2fc77e)return _0x48e130['close'](),void(this['_activeBalloon']=void 0x0);this['_activeBalloon']=_0x48e130,this['_currentPreviewedChangeGroup']={'replyId':_0x617373,'partIndex':_0x5dc069},this['_scrollToSuggestionRange'](_0x2fc77e,!0x0,_0x260f70);const _0x1208fe=this['_getPresentableSiblingContentPartIndex'](_0x617373,_0x5dc069,'next');_0x48e130['updateContent']({'part':_0x1ef05b,'renderingStrategy':'static'}),_0x48e130['open']({'index':_0x5dc069,'title':Hi(this['context']['locale'],'AI_BALLOON_HEADER_TITLE',(_0x5dc069+0x1)['toString']()),'showRotator':null!==_0x1208fe,'ranges':[_0x2fc77e],'areActionsDisabled':_0x1da37e['areActionsDisabled'],'targetEditor':_0x260f70}),_0x48e130['setState']('pending'),this['_aiChatUi']['scrollFeedToSuggestion'](_0x617373,_0x5dc069),this['_aiChatUi']['setFeedItemAIReplySuggestionPartActive']({'id':_0x617373,'index':_0x5dc069,'isActive':!0x0});}['_getPresentableSiblingContentPartIndex'](_0x496c7b,_0x57c91f,_0x3c8cd3){const {reply:_0x2d5785}=this['getInteractionAndReplyById'](_0x496c7b),_0x2452c1=_0x2d5785['getContentParts']({'showDiff':this['_aiChatBalloonShowDiff'],'editor':ds(this['context'])});if(0x1==_0x2452c1['length'])return null;const _0x1a8a08=_0x2452c1['findIndex'](_0x8d7b37=>_0x8d7b37['index']==_0x57c91f),_0x3711de='next'==_0x3c8cd3?0x1:-0x1;let _0x510d09=_0x2452c1['at']((_0x1a8a08+_0x3711de)%_0x2452c1['length'])['index'],_0x18d5aa=_0x2452c1[_0x510d09];for(;!this['_getUserPresentableContentPartDocumentRange'](_0x496c7b,_0x2d5785,_0x18d5aa);){if(_0x510d09=_0x2452c1['at']((_0x510d09+_0x3711de)%_0x2452c1['length'])['index'],_0x510d09===_0x1a8a08)return null;_0x18d5aa=_0x2452c1[_0x510d09];}return _0x510d09;}['_getUserPresentableContentPartDocumentRange'](_0x214e3f,_0x37bc27,_0x5297bc){const _0x465723=_0x37bc27['changeGroups'];if(!_0x5297bc['hasChanges'])return null;const _0x240b6f=_0x465723['find'](_0x29d29d=>_0x29d29d['index']==_0x5297bc['index']);if('pending'!==_0x240b6f?.['state'])return null;const _0x35b501=this['_getDocumentRangeForReplyChanges'](_0x214e3f,_0x5297bc['index']);if(!_0x35b501)return _0x37bc27['setChangeGroupState'](_0x5297bc['index'],'outdated'),null;const {range:_0x2821c7,currentIndex:_0x735a0e}=_0x35b501;return'$graveyard'==_0x2821c7['root']['rootName']?(_0x37bc27['setChangeGroupState'](_0x735a0e,'outdated'),null):_0x35b501['range'];}['_getDocumentRangeForReplyChanges'](_0x3c3f96,_0x507206){const {reply:_0xf8c539}=this['getInteractionAndReplyById'](_0x3c3f96),_0x115dd1=_0xf8c539['changeGroups']['filter'](_0x2d5841=>'pending'==_0x2d5841['state']),_0xf2d615=_0x115dd1['map'](_0x398a99=>_0xf8c539['changeGroups']['indexOf'](_0x398a99));void 0x0===_0x507206&&(_0x507206=_0xf2d615[0x0]);const _0x45cb57=_0xf2d615['indexOf'](_0x507206);if(-0x1==_0x45cb57)return null;const _0x3e24a5=_0x115dd1[_0x45cb57],_0x1b23ed=this['_resolveGroupTarget'](_0xf8c539,_0x3e24a5);if(!_0x1b23ed)return null;const {editor:_0x3cc06b,root:_0x23c700,parsedDocumentContent:_0x56828e,serializedDocumentContent:_0x5df30c,version:_0xef3f0c}=_0x1b23ed,_0x1aac2b=new _0x135e16([]),_0x5a5392=new _0x135e16([]);for(const _0x230e54 of _0x3e24a5['changes']){const _0x188c41=this['activeConversation']?.['getSourceByDataId'](_0x230e54['id']);if((!_0x188c41||_0x188c41['editor']===_0x1b23ed['editor']&&_0x188c41['rootName']===_0x1b23ed['root']['rootName'])&&('removed'!=_0x230e54['type']&&_0x5a5392['children']['push'](_0x230e54['node']['cloneNode'](!0x0)),'new'!=_0x230e54['type'])){const _0x4c721d=_0x14f12e(_0x4db725=>$i(_0x4db725,'data-id')==_0x230e54['id'],_0x56828e,!0x0);if(!_0x4c721d)return null;_0x1aac2b['children']['push'](_0x4c721d['cloneNode'](!0x0));}}if(0x0==_0x1aac2b['children']['length']){if(_0x3e24a5['changes'][0x0]['anchorId']){const _0x26b2c3=Wi('data-id',_0x3e24a5['changes'][0x0]['anchorId'],_0x56828e);_0x1aac2b['children']['unshift'](_0x26b2c3['cloneNode'](!0x0)),_0x5a5392['children']['unshift'](_0x26b2c3['cloneNode'](!0x0)),_0x26b2c3['nextSibling']&&(_0x1aac2b['children']['push'](_0x26b2c3['nextSibling']['cloneNode'](!0x0)),_0x5a5392['children']['push'](_0x26b2c3['nextSibling']['cloneNode'](!0x0)));}else{const _0x41a47d=_0x56828e['children'][0x0];if(!_0x41a47d)return null;_0x1aac2b['children']['push'](_0x41a47d['cloneNode'](!0x0)),_0x5a5392['children']['push'](_0x41a47d['cloneNode'](!0x0));}}const _0x1d2e82=_0x3cc06b['data']['parse'](_0x5df30c),_0x5d3929=Ki(_0x1aac2b),_0x4f5097=_0x3cc06b['data']['parse'](_0x5d3929),_0xb380d6=_0x3cc06b['data']['parse'](_0x5d3929),_0x462993=_0x3cc06b['model']['createPositionAt'](_0x4f5097,0x0),_0x34f0c6=Ki(_0x5a5392),_0x5ce044={'targetEditor':_0x3cc06b,'anchor':_0x462993,'markDeletions':!0x1},_0x317d45=_0x3cc06b['plugins']['get'](_0x4f763b)['getDiff'](_0x5d3929,_0x34f0c6,_0x5ce044)['getOperations']();if(!_0x317d45['length'])return null;_0x3cc06b['model']['change'](_0x1c1b12=>{for(const _0x4a6b71 of _0x317d45)if('remove'==_0x4a6b71['type']){const _0xf1ab35=_0x4a6b71['sourcePosition'],_0x5d9e5a=_0x4a6b71['howMany'],_0x5d7fe9=new _0x33b723(_0xf1ab35,_0x5d9e5a);_0x1c1b12['batch']['addOperation'](_0x5d7fe9),_0x3cc06b['model']['applyOperation'](_0x5d7fe9);}else'marker'!==_0x4a6b71['type']&&(_0x4a6b71['baseVersion']=null,_0x4a6b71['isDocumentOperation']=!0x1,_0x1c1b12['batch']['addOperation'](_0x4a6b71),_0x3cc06b['model']['applyOperation'](_0x4a6b71));});const _0x111e1e=es(_0x3cc06b,_0x317d45,_0x4f5097);is(_0x3cc06b['model'],_0x111e1e);const _0x430925=_0x111e1e['getFirstRange']()['start']['path']['slice'](),_0x29bec1=_0x111e1e['getFirstRange']()['end']['path']['slice'](),_0x635bbe=[];let _0x52314c=_0x4f5097,_0x209e81=_0xb380d6;for(let _0x57eec0=0x0;_0x57eec0<_0x29bec1['length'];_0x57eec0++){const _0x60c59e=_0x52314c['maxOffset']-_0x29bec1[_0x57eec0];_0x635bbe[_0x57eec0]=_0x209e81['maxOffset']-_0x60c59e,_0x52314c=_0x52314c['getChildAtOffset'](_0x29bec1[_0x57eec0]),_0x209e81=_0x209e81['getChildAtOffset'](_0x635bbe[_0x57eec0]);}const _0x12d9e4=_0x3cc06b['model']['createRange'](_0x3cc06b['model']['createPositionFromPath'](_0xb380d6,_0x430925),_0x3cc06b['model']['createPositionFromPath'](_0xb380d6,_0x635bbe)),_0x3c3532=_0xb380d6['getChild'](0x0)['getAttribute'](_0x4ab9e3),_0x3fc6b4=Array['from'](_0x1d2e82['getChildren']())['find'](_0x7da78e=>_0x7da78e['getAttribute'](_0x4ab9e3)==_0x3c3532)['getPath'](),_0x201eea=_0x12d9e4['start']['path']['slice'](),_0x2dd77b=_0x12d9e4['end']['path']['slice']();_0x201eea[0x0]=_0x3fc6b4[0x0]+_0x201eea[0x0],_0x2dd77b[0x0]=_0x3fc6b4[0x0]+_0x2dd77b[0x0];let _0x1c160c=_0x3cc06b['model']['createRange'](_0x3cc06b['model']['createPositionFromPath'](_0x23c700,_0x201eea),_0x3cc06b['model']['createPositionFromPath'](_0x23c700,_0x2dd77b));const _0x2f0f0b=_0x3cc06b['model']['document']['history']['getOperations'](_0xef3f0c);for(const _0x39ba9b of _0x2f0f0b)_0x1c160c=_0x3070cc['_createFromRanges'](_0x1c160c['getTransformedByOperation'](_0x39ba9b));return{'range':_0x1c160c,'currentIndex':_0x507206};}['_integrateEditorBalloon'](_0x504ed7){if(!_0x504ed7['plugins']['has']('AIChatBalloon'))return;const _0x3fc73e=_0x504ed7['plugins']['get']('AIChatBalloon');this['_wiredBalloons']['has'](_0x3fc73e)||(this['_wiredBalloons']['add'](_0x3fc73e),this['_aiChatBalloon']||(this['_aiChatBalloon']=_0x3fc73e),_0x3fc73e['bind']('showDiff')['to'](this,'_aiChatBalloonShowDiff'),this['listenTo'](_0x3fc73e,'toggleSuggestionDisplayMode',()=>{const {replyId:_0xc57029,partIndex:_0x3fa622}=this['_currentPreviewedChangeGroup'];this['_aiChatBalloonShowDiff']=!this['_aiChatBalloonShowDiff'];const {reply:_0x4127ab}=this['getInteractionAndReplyById'](_0xc57029),_0x465f46=_0x4127ab['changeGroups']['find'](_0x4fd446=>_0x4fd446['index']===_0x3fa622),_0x1cc7b7=_0x465f46?this['_resolveGroupTarget'](_0x4127ab,_0x465f46):null,_0x2c8cda=_0x4127ab['getContentParts']({'showDiff':this['_aiChatBalloonShowDiff'],'groupIndex':_0x3fa622,'editor':_0x1cc7b7?.['editor']??ds(this['context'])});(this['_activeBalloon']??_0x3fc73e)['updateContent']({'part':_0x2c8cda[0x0],'renderingStrategy':'static','keepErrors':!0x0});}),this['listenTo'](_0x3fc73e,'applySuggestion',()=>{const {replyId:_0x4ca0d6,partIndex:_0x19ec61}=this['_currentPreviewedChangeGroup'];this['_applySuggestion']({'replyId':_0x4ca0d6,'partIndex':_0x19ec61}),(this['_activeBalloon']??_0x3fc73e)['setState']('accepted');}),this['listenTo'](_0x3fc73e,'insertSuggestion',()=>{const {replyId:_0x2f86be,partIndex:_0x251db8}=this['_currentPreviewedChangeGroup'];this['_insertSuggestion']({'replyId':_0x2f86be,'partIndex':_0x251db8}),(this['_activeBalloon']??_0x3fc73e)['setState']('accepted');}),this['listenTo'](_0x3fc73e,'rejectSuggestion',()=>{const {replyId:_0x5f0887,partIndex:_0x3c8f38}=this['_currentPreviewedChangeGroup'];this['_rejectSuggestion']({'replyId':_0x5f0887,'partIndex':_0x3c8f38}),(this['_activeBalloon']??_0x3fc73e)['setState']('rejected');}),this['listenTo'](_0x3fc73e,'showNext',()=>{const {replyId:_0x5424ab,partIndex:_0x4c81e7}=this['_currentPreviewedChangeGroup'],_0x184531=this['_getPresentableSiblingContentPartIndex'](_0x5424ab,_0x4c81e7,'next');null!==_0x184531&&this['_openBalloonFor'](_0x5424ab,_0x184531);}),this['listenTo'](_0x3fc73e,'showPrevious',()=>{const {replyId:_0x29aae9,partIndex:_0x49462d}=this['_currentPreviewedChangeGroup'],_0xda461c=this['_getPresentableSiblingContentPartIndex'](_0x29aae9,_0x49462d,'previous');null!==_0xda461c&&this['_openBalloonFor'](_0x29aae9,_0xda461c);}),this['listenTo'](_0x3fc73e,'dialogClosed',(_0x4c101c,{id:_0x4253ff})=>{if('aiChatBalloon'!==_0x4253ff)return;const {replyId:_0x14e0e0,partIndex:_0x4c34c4}=this['_currentPreviewedChangeGroup'];this['_currentPreviewedChangeGroup']=null,this['_aiChatUi']['setFeedItemAIReplySuggestionPartActive']({'id':_0x14e0e0,'index':_0x4c34c4,'isActive':!0x1}),this['_activeBalloon']===_0x3fc73e&&(this['_activeBalloon']=void 0x0);}));}['_integrateEditor'](_0x585f38){if(this['_integrateEditorBalloon'](_0x585f38),_0x585f38['plugins']['has']('Undo')){const _0xfa1901=_0x585f38['commands']['get']('undo'),_0x1244ee=_0x585f38['commands']['get']('redo');this['listenTo'](_0xfa1901,'revert',(_0x1e0517,_0x55cbfc,_0x2afc5d)=>{const _0x443acb=this['_batchToChanges']['get'](_0x55cbfc);if(!_0x443acb)return;const _0x2d861=this['activeConversation']['getInteraction'](_0x443acb['interactionId']),_0xfd788e=_0x2d861?.['getReply'](_0x443acb['replyId']);this['_batchToChanges']['delete'](_0x55cbfc),_0x2d861&&_0xfd788e&&(_0x443acb['indexes']['forEach'](_0x3d1366=>_0xfd788e['setChangeGroupState'](_0x3d1366,'pending')),this['_batchToChanges']['set'](_0x2afc5d,_0x443acb));}),this['listenTo'](_0x1244ee,'revert',(_0x34027d,_0x2669a0,_0x401a96)=>{const _0x5b52c4=this['_batchToChanges']['get'](_0x2669a0);if(!_0x5b52c4)return;const _0x28139f=this['activeConversation']['getInteraction'](_0x5b52c4['interactionId']),_0x5717fb=_0x28139f?.['getReply'](_0x5b52c4['replyId']);this['_batchToChanges']['delete'](_0x2669a0),_0x28139f&&_0x5717fb&&(_0x5b52c4['indexes']['forEach'](_0x1467f9=>_0x5717fb['setChangeGroupState'](_0x1467f9,'accepted')),this['_batchToChanges']['set'](_0x401a96,_0x5b52c4));});}const _0x513859=_0x585f38['config']['get']('ai.chat.context');_0x513859['alwaysAddSelection']&&_0x513859['document']['enabled']&&this['listenTo'](_0x585f38['model']['document']['selection'],'change:range',(_0x3621d5,_0x1ccdc)=>{if(!_0x1ccdc['directChange'])return;'chat'===_0x585f38['plugins']['get']('AITabs')['view']['activeTab']&&(_0x585f38['model']['hasContent'](_0x585f38['model']['document']['selection'])?this['addSelectionToChatContext']():this['removeSelectionFromChatContext']());});}async['_getLastCreatedConversationId'](){const _0x430ed7=this['_aiConnector']['fetchConversations'](this['getGroupId'](),{'limit':0x1,'sortBy':'createdAt'});try{const _0x25ab77=await _0x430ed7['getConversations']();return _0x25ab77['length']?_0x25ab77[0x0]['id']:'new';}catch(_0x54ce40){return this['_aiChatUi']['addFeedItemError']({'errorMessage':Hi(this['context']['locale'],'AI_CHAT_UNABLE_TO_LOAD_CONVERSATION'),'id':ot()}),this['_logError'](new at('ai-chat-conversation-init-failed',this,{'error':_0x54ce40})),this['_aiChatUi']['toggleLoadingSkeleton'](!0x1),this['_aiChatUi']['disableControls'](),null;}}async['_startConversationSafely'](_0xc2a03d={}){try{this['_aiChatUi']['enableControls'](),await this['_handleStartConversation'](_0xc2a03d);}catch(_0x8b7f91){this['_aiChatUi']['addFeedItemError']({'errorMessage':Hi(this['context']['locale'],'AI_CHAT_UNABLE_TO_START_CONVERSATION'),'id':_0xc2a03d['id']||ot()}),console['error'](_0x8b7f91),this['activeConversation']=void 0x0,this['_aiChatUi']['disableControls']();}}async['_handleStartConversation']({id:_0xee2ef1,modelId:_0x40010e}={}){this['_activeBalloon']?.['close'](),this['_activeBalloon']=void 0x0,this['_currentPreviewedChangeGroup']=null;let _0x3e305c=_0x40010e;_0x3e305c||(_0xee2ef1||!this['activeConversation']?_0x3e305c=this['context']['config']['get']('ai.models.defaultModelId'):this['_aiChatUi']['isModelAvailable']&&(_0x3e305c=this['activeConversation']['selectedModel']['id'])),await this['_stopLastInteraction']();const _0x4160fb=this['getGroupId'](),_0x4c923f=_0xee2ef1||ot();let _0x51d5e4;this['activeConversation']=new AIChatConversation({'connector':this['_aiConnector'],'chatModels':this['_aiChatModels'],'selectedModelId':_0x3e305c,'conversationId':_0x4c923f,'group':_0x4160fb,'getEditor':()=>ds(this['context']),'getEditors':()=>ls(this['context']),'locale':this['context']['locale'],'isFromHistory':!!_0xee2ef1}),this['activeConversation']['delegate']('toolDataReceived','interactionCreated','interactionStarted','replyCreated')['to'](this),this['activeConversation']['on']('conversationInitialized',(_0x410c4a,_0x3ca0f9)=>{this['_aiChatUi']['createConversation'](_0x3ca0f9),this['_aiChatUi']['resetMessageInput'](),this['_aiChatUi']['clearPendingContextUI'](),this['_aiChatUi']['clearConversationContextUI'](),_0xee2ef1||(this['_aiChatUi']['resetConversationTitle'](),this['addCurrentDocumentToChatContext']());}),this['activeConversation']['on']('uploadProgressChanged',(_0x18892e,_0x24d89a)=>{this['_aiChatUi']['setIsUploadInProgress'](_0x24d89a['isUploadInProgress']);}),this['activeConversation']['on']('webSearchStarted',()=>{const _0x189f24=this['_aiChatUi']['prepareLoadingMessage']({'isWebSearchEnabled':!0x0,'isReasoningEnabled':!0x1});this['_aiChatUi']['setLoadingMessage'](_0x189f24);}),this['activeConversation']['on']('reasoningStarted',()=>{const _0x374a62=this['_aiChatUi']['prepareLoadingMessage']({'isWebSearchEnabled':!0x1,'isReasoningEnabled':!0x0});this['_aiChatUi']['setLoadingMessage'](_0x374a62);}),this['activeConversation']['on']('webSearchFinished',(_0x510346,_0x40dd03)=>{this['_aiChatUi']['addFeedInteractionHeader'](_0x40dd03,{'isWebSearchEnabled':!0x0,'isReasoningEnabled':!0x1});}),this['activeConversation']['on']('reasoningFinished',(_0x224cb1,_0x3ffb8d)=>{this['_aiChatUi']['addFeedInteractionHeader'](_0x3ffb8d,{'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',(_0x44de2f,_0x49ba6b)=>{this['_aiChatUi']['removeFeedInteraction'](_0x49ba6b['id']);}),this['activeConversation']['on']('setConversationTitle',(_0x55685c,_0xd2aac0,_0x3eb3a1)=>{this['_updateConversationTitle'](_0xd2aac0,_0x3eb3a1);}),this['activeConversation']['on']('replyContentUpdated',async(_0x149eee,_0x45797b)=>{void 0x0!==_0x51d5e4&&_0x51d5e4!==_0x45797b['id']&&this['_updateReplyContentThrottled']['flush'](),_0x51d5e4=_0x45797b['id'],_0x45797b['isFromHistory']?await this['_updateReplyContent']({'reply':_0x45797b}):await this['_updateReplyContentThrottled']({'reply':_0x45797b});}),this['activeConversation']['on']('replyChangeGroupStateUpdated',(_0x36de49,{reply:_0x45f72a,index:_0x3c0e0a,state:_0x507369})=>{this['_aiChatUi']['updateFeedItemAIReplySuggestionPartState']({'id':_0x45f72a['id'],'index':_0x3c0e0a,'state':_0x507369}),this['_currentPreviewedChangeGroup']?.['replyId']['includes'](_0x45f72a['id'])&&this['_currentPreviewedChangeGroup']?.['partIndex']==_0x3c0e0a&&(this['_activeBalloon']??this['_aiChatBalloon'])?.['setState'](_0x507369);}),this['activeConversation']['on']('contextItemAdded',(_0x132660,_0x2700c5)=>{if(this['_aiChatUi']['addContextItem'](_0x2700c5['contextItem'],_0x2700c5['isLoading']),'selection'===_0x2700c5['contextItem']['type']){const _0x3783dd=[...ds(this['context'])['model']['document']['selection']['getRanges']()];this['_aiEditing']['showFakeVisualSelection']({'ranges':_0x3783dd,'id':'context','priority':0x1});}}),this['activeConversation']['on']('contextItemRemoved',(_0x5b1650,_0x4f8882)=>{this['_aiChatUi']['removeContextItem'](_0x4f8882['uiId']),'current-document'==_0x4f8882['uiId']&&this['removeSelectionFromChatContext'](),'selection'===_0x4f8882['type']&&this['_aiEditing']['hideFakeVisualSelection']('context');}),this['activeConversation']['on']('contextItemLoadingEnded',(_0x960b6a,_0x47141f)=>{this['_aiChatUi']['setContextItemLoading'](_0x47141f['contextItem']['uiId'],_0x47141f['isLoading']);}),this['activeConversation']['on']('contextSent',(_0x34d1d5,_0x58f96d)=>{this['_aiChatUi']['setConversationContext'](_0x58f96d['contextItems']);}),this['activeConversation']['on']('addContextOptionsChanged',(_0x35e036,_0x68d5f9)=>{this['_aiChatUi']['setAddContextOptions'](_0x68d5f9['options']);}),this['activeConversation']['on']('sourceResourcesLoaded',(_0x438b68,_0x1ac8c3)=>{this['_aiChatUi']['populateSourceResourceBalloon'](_0x1ac8c3['sourceId'],_0x1ac8c3['source'],_0x1ac8c3['resources'],_0x1ac8c3['uid']);}),this['activeConversation']['on']('resourceStateChanged',(_0x49b2d6,_0x54c3b8)=>{this['_aiChatUi']['updateResourceState'](_0x54c3b8['sourceId'],_0x54c3b8['resourceId'],_0x54c3b8['isInContext']);}),this['activeConversation']['on']('capabilitiesUpdated',(_0x3b2b65,_0x4680fb)=>{this['_aiChatUi']['updateCapabilities'](_0x4680fb);}),this['activeConversation']['on']('modelSelected',async(_0x30823e,_0x322705)=>{const _0x165d55=(await this['_aiChatModels']['getAll']())['find'](_0x5d5dbf=>_0x5d5dbf['id']===_0x322705['selectedModel']?.['id'])||null;this['_aiChatUi']['setSelectedModel'](_0x165d55,_0x322705['isDisabled']);}),this['activeConversation']['on']('error',(_0x14404f,{error:_0x282c5,interactionId:_0xf91275,fileName:_0x3161ce,url:_0x4e30ee,sourceId:_0xb70ab,sourceLabel:_0x2266f8})=>{const _0x52734f=_0xf91275?_0xf91275+':'+ot():ot();_0x282c5['message']['startsWith']('ai-request-aborted')?this['_aiChatUi']['addFeedItemStaticMessage']({'staticMessage':Hi(this['context']['locale'],'AI_CHAT_ABORTED_MESSAGE'),'id':_0x52734f}):_0x282c5['message']['startsWith']('ai-chat-conversation-init-failed')||_0x282c5['message']['startsWith']('ai-chat-conversation-start-failed')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':Hi(this['context']['locale'],'AI_CHAT_UNABLE_TO_START_CONVERSATION'),'id':_0x52734f}),this['_logError'](_0x282c5)):_0x282c5['message']['startsWith']('ai-chat-file-upload-failed')?this['_aiChatUi']['addFeedItemError']({'errorMessage':Hi(this['context']['locale'],'AI_CHAT_CONTEXT_UNABLE_TO_UPLOAD_FILE',_0x3161ce),'id':_0x52734f}):_0x282c5['message']['startsWith']('ai-chat-url-upload-failed')?this['_aiChatUi']['addFeedItemError']({'errorMessage':Hi(this['context']['locale'],'AI_CHAT_CONTEXT_UNABLE_TO_UPLOAD_URL',_0x4e30ee),'id':_0x52734f}):_0x282c5['message']['startsWith']('ai-chat-context-invalid-data')?this['_aiChatUi']['addFeedItemError']({'errorMessage':Hi(this['context']['locale'],'AI_CHAT_CONTEXT_INVALID_DATA'),'id':_0x52734f}):_0x282c5['message']['startsWith']('ai-chat-context-unsupported-type')?this['_aiChatUi']['addFeedItemError']({'errorMessage':Hi(this['context']['locale'],'AI_CHAT_CONTEXT_UNSUPPORTED_TYPE'),'id':_0x52734f}):_0x282c5['message']['startsWith']('ai-chat-source-resources-load-failed')?(_0xb70ab&&this['_aiChatUi']['closeSourceResourceBalloon'](_0xb70ab),this['_aiChatUi']['addFeedItemError']({'errorMessage':Hi(this['context']['locale'],'AI_CHAT_CONTEXT_UNABLE_TO_LOAD_RESOURCES',_0x2266f8||'source'),'id':_0x52734f}),this['_logError'](_0x282c5)):_0x282c5['message']['startsWith']('ai-chat-resource-load-failed')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':Hi(this['context']['locale'],'AI_CHAT_RESOURCE_LOAD_FAILED'),'id':_0x52734f}),this['_logError'](_0x282c5)):_0x282c5['message']['startsWith']('ai-chat-invalid-request')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':Hi(this['context']['locale'],'AI_CHAT_INVALID_REQUEST'),'id':_0x52734f}),this['_logError'](_0x282c5)):_0x282c5['message']['startsWith']('ai-chat-context-unsupported-file-type')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':Hi(this['context']['locale'],'AI_CHAT_CONTEXT_UNSUPPORTED_FILE_TYPE'),'id':_0x52734f}),this['_logError'](_0x282c5)):_0x282c5['message']['startsWith']('ai-chat-context-file-too-large')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':Hi(this['context']['locale'],'AI_CHAT_CONTEXT_FILE_TOO_LARGE'),'id':_0x52734f}),this['_logError'](_0x282c5)):_0x282c5['message']['startsWith']('ai-chat-context-file-too-many-pages')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':Hi(this['context']['locale'],'AI_CHAT_CONTEXT_FILE_TOO_MANY_PAGES'),'id':_0x52734f}),this['_logError'](_0x282c5)):_0x282c5['message']['startsWith']('ai-chat-context-form-data-size-limits-exceeded')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':Hi(this['context']['locale'],'AI_CHAT_CONTEXT_FORM_DATA_SIZE_LIMITS_EXCEEDED'),'id':_0x52734f}),this['_logError'](_0x282c5)):(this['_aiChatUi']['addFeedItemError']({'errorMessage':Hi(this['context']['locale'],'AI_CHAT_GENERIC_ERROR'),'id':_0x52734f}),this['_logError'](_0x282c5));}),await this['activeConversation']['init'](this['context']['config']['get']('ai.chat.context')),_0xee2ef1||await this['activeConversation']['start']();}async['_handleUIUserMessage']({message:_0xe681a4,attributes:_0x2aa83a}){if(!this['activeConversation'])throw new at('ai-chat-controller-no-active-conversation');if(this['activeConversation']['isCurrentDocumentInContext']()){const _0x53e5ed=await this['_aiEditing']['getDocumentData']();_0x53e5ed['length']>0x1?await this['activeConversation']['updateCurrentDocumentsInContext'](_0x53e5ed):await this['activeConversation']['updateCurrentDocumentInContext'](_0x53e5ed[0x0]);}this['activeConversation']['id']&&this['activeConversation']['isStarted']&&await this['activeConversation']['handleUserInteraction']({'userMessage':_0xe681a4,'attributes':_0x2aa83a});}['_logError'](_0x3f03b8){Ct(_0x3f03b8['message']);}['_removeFromContext'](_0x249894){this['activeConversation']?.['removeFromContext'](_0x249894);}['_toggleWebSearch'](){this['activeConversation']?.['toggleWebSearch']();}['_toggleReasoning'](){this['activeConversation']?.['toggleReasoning']();}['getInteractionAndReplyById'](_0x49adfd){const [_0x33573c,_0xe1677f]=_0x49adfd['split'](':'),_0x431b12=this['activeConversation']['getInteraction'](_0x33573c),_0x1c5e3d=_0x431b12['getReply'](_0xe1677f);return{'interaction':_0x431b12,'reply':_0x1c5e3d};}['_resolveGroupTarget'](_0x5048b1,_0x3566d6){const _0x262627=[..._0x3566d6['changes']['filter'](_0x4a5379=>'context'!==_0x4a5379['type']),..._0x3566d6['changes']['filter'](_0x30db91=>'context'===_0x30db91['type'])];for(const _0x44b9d3 of _0x262627){const _0x25dd65=_0x5048b1['newNodeAnchorIds']['get'](_0x44b9d3['id']),_0x47749a=this['activeConversation']?.['getSourceByDataId'](_0x44b9d3['id'])||this['activeConversation']?.['getSourceByDataId'](_0x25dd65)||this['activeConversation']?.['getSourceByDataId'](_0x44b9d3['anchorId']??void 0x0);if(_0x47749a){if('destroyed'===_0x47749a['editor']['state'])return null;const _0x2c04cf=_0x47749a['editor']['model']['document']['getRoot'](_0x47749a['rootName']);return _0x2c04cf?{'editor':_0x47749a['editor'],'root':_0x2c04cf,'parsedDocumentContent':Fi(_0x47749a['content']),'serializedDocumentContent':_0x47749a['content'],'version':_0x47749a['version']}:null;}}const _0x189d69=ds(this['context']),_0x4f779d=this['activeConversation']['getInteraction'](_0x5048b1['interactionId']),_0x1dd882=_0x4f779d?.['getDocumentContext']();return{'editor':_0x189d69,'root':_0x189d69['model']['document']['getRoot'](),'parsedDocumentContent':_0x5048b1['documentContextContent'],'serializedDocumentContent':_0x1dd882?.['content'],'version':_0x1dd882?.['version']};}['_groupChangesByTarget'](_0x23fa11,_0x567507){const _0x28a391=new Map();for(const _0x2f3086 of _0x567507){const _0x52f7e3=this['_resolveGroupTarget'](_0x23fa11,_0x2f3086);if(!_0x52f7e3)continue;const _0x5a29fb=(_0x52f7e3['editor']['id']||'e')+'|'+_0x52f7e3['root']['rootName'];let _0x4a5085=_0x28a391['get'](_0x5a29fb);if(!_0x4a5085){let _0xbb59ee;for(const _0x5d1a48 of[..._0x2f3086['changes']['filter'](_0x3638ef=>'context'!==_0x3638ef['type']),..._0x2f3086['changes']['filter'](_0x103c24=>'context'===_0x103c24['type'])])if(_0xbb59ee=this['activeConversation']?.['getDocumentContextSliceByDataId'](_0x5d1a48['id'])||this['activeConversation']?.['getDocumentContextSliceByDataId'](_0x23fa11['newNodeAnchorIds']['get'](_0x5d1a48['id'])),_0xbb59ee)break;_0x4a5085={'target':{'editor':_0x52f7e3['editor'],'root':_0x52f7e3['root']},'slice':_0xbb59ee,'groups':[],'groupsIndexes':[]},_0x28a391['set'](_0x5a29fb,_0x4a5085);}_0x4a5085['groups']['push'](_0x2f3086),_0x4a5085['groupsIndexes']['push'](_0x23fa11['changeGroups']['indexOf'](_0x2f3086));}return Array['from'](_0x28a391['values']());}['_scrollToSuggestionRange'](_0x22ba9b,_0x116761=!0x1,_0x290140){const _0x2848db={'target':_0x290140['editing']['view']['domConverter']['viewRangeToDom'](_0x290140['editing']['mapper']['toViewRange'](_0x22ba9b)),'viewportOffset':{'top':0x96,'left':0x0,'bottom':0x32,'right':0x0},'ancestorOffset':0x14,'alignToTop':_0x116761};_0x116761&&(_0x2848db['alignToTop']=!0x0),wt(_0x2848db);}['_updateConversationTitle'](_0xda2b8f,_0x8b5dd0=!0x1){this['_aiChatUi']['setConversationTitle'](_0xda2b8f||Hi(this['context']['locale'],'AI_CHAT_UNTITLED_CONVERSATION'),_0x8b5dd0);}['_addFeedItemReply'](_0x1b4bdf){'text'===_0x1b4bdf['type']?this['_aiChatUi']['addFeedItemAIReply'](_0x1b4bdf):this['_aiChatUi']['addFeedItemAISuggestion'](_0x1b4bdf);}async['_updateReplyContent']({reply:_0x188826,renderingStrategy:_0xd71e42}){const {id:_0x5a6eb2,interactionId:_0x5790d1,isDone:_0x577680,type:_0x2121c9,parsedContent:_0x59aa78}=_0x188826,_0x3d8c09=_0x5790d1+':'+_0x5a6eb2;if('modification'===_0x2121c9){const _0x583313=_0x188826['getContentParts']({'showDiff':this['_aiChatUi']['showDiff'],'editor':ds(this['context'])});await this['_aiChatUi']['updateFeedItemAIReplySuggestionContent']({'id':_0x3d8c09,'parts':_0x583313,'isDone':_0x577680,'skipLoadingEffects':_0x188826['isFromHistory']});}else'text'===_0x2121c9&&await this['_aiChatUi']['updateFeedItemAIReplyContent']({'id':_0x3d8c09,'parsedContent':_0x59aa78,'renderingStrategy':_0xd71e42,'isDone':_0x577680});_0x577680&&_0x188826['sources']['length']>0x0&&this['_aiChatUi']['updateFeedItemAIReplySources'](_0x3d8c09,_0x188826['sources']);}['_updateReplyContentThrottled']=_0x225d5d(this['_updateReplyContent']['bind'](this),0xc8);async['_stopLastInteraction'](){const _0x1f8943=this['activeConversation']?.['lastInteraction'];_0x1f8943&&(_0x1f8943['stop'](),this['_aiChatUi']['stopInteraction'](_0x1f8943)),this['_updateReplyContentThrottled']['cancel']();}async['_flushLastInteractionUI'](){const _0x46eace=this['activeConversation']?.['lastInteraction'];if(_0x46eace){for await(const _0x3ff416 of _0x46eace['replies'])this['_aiChatUi']['hasFeedItem'](_0x3ff416['id'])||this['_addFeedItemReply'](_0x3ff416),await this['_updateReplyContent']({'reply':_0x3ff416,'renderingStrategy':'static'});}}['_updateRatings'](_0x5a47b5){const _0x454e81={'positiveCount':_0x5a47b5['changeGroups']['filter'](_0xcdaa5d=>'accepted'===_0xcdaa5d['state'])['length'],'totalCount':_0x5a47b5['changeGroups']['length'],'modificationId':_0x5a47b5['id']},_0x213d7b=this['activeConversation']['getInteraction'](_0x5a47b5['interactionId'])['messageId'];_0x213d7b&&this['_aiConnector']['upsertAIChatRating'](this['activeConversation']['id'],_0x213d7b,_0x454e81);}['_getAIChatFeedAPI'](_0x24781d){const _0x4ddd1a=this['_aiChatUi'],_0x51636b=()=>{_0x24781d['resetWebSearchState'](),_0x24781d['resetReasoningState'](),_0x4ddd1a['clearLoadingMessage']();},_0x17828c=()=>{_0x24781d['currentReply']&&(_0x24781d['currentReply']['done'](),_0x24781d['currentReply']=void 0x0);};return{'insertTextReply':(_0x3bd43b,_0x405343)=>{_0x17828c(),_0x51636b();const _0x194057=_0x24781d['currentReply']=_0x24781d['createReply']({'type':'text','interactionId':_0x24781d['id'],'content':_0x3bd43b,'id':_0x405343||ot()});return _0x17828c(),_0x194057;},'insertCustomElement':async(_0x21dbda,_0x257393)=>(_0x17828c(),_0x51636b(),_0x4ddd1a['addFeedItemCustomElement'](_0x21dbda,_0x257393||ot())),'setLoadingMessage':_0x3ba68c=>{_0x4ddd1a['setLoadingMessage'](_0x3ba68c);},'clearLoadingMessage':()=>{_0x4ddd1a['clearLoadingMessage']();}};}}const As='ai-selection',gs=['br'];class AIEditing extends _0x530a64{constructor(_0xfff358){super(_0xfff358),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 _0x20d721=ls(this['context']),_0x3aa076=_0x20d721['find'](_0x8db478=>_0x8db478['plugins']['has']('RealTimeCollaborationClient'))||_0x20d721[0x0],_0x15cdc8=_0x3aa076['plugins']['has']('RealTimeCollaborationClient')&&_0x3aa076['plugins']['get']('RealTimeCollaborationClient')['sessionId'];this['_sessionId']=_0x15cdc8||ot();}return this['_sessionId'];}async['getDocumentData'](){const _0xa51a44=ls(this['context']);if(!_0xa51a44['length'])throw new at('ai-get-editor-from-context-no-editor');const _0x2a3785=[],_0x32c877=new Set();for(const _0x2429c7 of _0xa51a44){const _0xbc402e=_0x2429c7['config']['get']('roots')||{};for(const _0x16c690 of _0x2429c7['model']['document']['getRoots']()){if('$graveyard'===_0x16c690['rootName'])continue;const _0x4ccceb=await this['_getDocumentDataForEditorRoot'](_0x2429c7,_0x16c690,_0x32c877),_0x515205=_0xbc402e[_0x16c690['rootName']];let _0x7afd22;_0x515205?.['label']?_0x7afd22=_0x515205['label']:(gt('ai-document-root-missing-label',{'editor':_0x2429c7,'rootConfig':_0x515205}),_0x7afd22=_0x16c690['rootName']),_0x2a3785['push']({'editor':_0x2429c7,'rootName':_0x16c690['rootName'],'content':_0x4ccceb['content'],'version':_0x4ccceb['version'],'sessionId':this['sessionId'],'channelId':_0x2429c7['config']['get']('collaboration.channelId'),'selections':_0x4ccceb['selections'],'name':_0x7afd22,'description':_0x515205?.['description']});}}return _0x2a3785;}async['_getDocumentDataForEditorRoot'](_0x10795e,_0x6783dc,_0x106e94){const _0x292231=_0x10795e['data']['toView'](_0x6783dc,{'convertAiChatSelectionMarker':!0x0}),_0x5ea39c=new _0x1e9e0f(_0x10795e['editing']['view']['document']);this['_setDataIdsOnChildren'](_0x292231,_0x5ea39c,_0x106e94);let _0x33f6b7=await this['_getDocumentDataStringFromView'](_0x292231,_0x10795e);const _0x445305=this['_getMarkersInDocumentOrder'](_0x10795e,_0x6783dc),_0x470b02=[];for(const _0x4a235b of _0x445305){const _0x5ba396='<'+_0x4a235b['name']+':start></'+_0x4a235b['name']+':start>',_0xb9a920=_0x33f6b7['indexOf'](_0x5ba396);_0x33f6b7=_0x33f6b7['substring'](0x0,_0xb9a920)+_0x33f6b7['substring'](_0xb9a920+_0x5ba396['length']);const _0x281772='<'+_0x4a235b['name']+':end></'+_0x4a235b['name']+':end>',_0x59eb9e=_0x33f6b7['indexOf'](_0x281772);_0x33f6b7=_0x33f6b7['substring'](0x0,_0x59eb9e)+_0x33f6b7['substring'](_0x59eb9e+_0x281772['length']),_0x470b02['push']({'markerName':_0x4a235b['name'],'start':_0xb9a920,'end':_0x59eb9e,'htmlFragment':_0x33f6b7['substring'](_0xb9a920,_0x59eb9e)});}return{'content':_0x33f6b7,'version':_0x10795e['model']['document']['version'],'selections':_0x470b02};}async['afterInit'](){this['context']instanceof _0x581096?this['_integrateEditor'](this['context']):this['listenTo'](this['context']['editors'],'add',(_0x17fa86,_0x40df27)=>{_0x40df27['on']('ready',()=>{this['_integrateEditor'](_0x40df27);});});}['_setOutputDataProcessor'](_0x406638){this['_outputDataProcessor']=_0x406638;}async['_getDocumentDataStringFromView'](_0x1db0f0,_0x274b26){let _0x36f0e0;if(this['_outputDataProcessor']){const _0x4c0b1e=_0x274b26['data']['processor']['domConverter']['viewToDom'](_0x1db0f0),_0x50eadd=await this['_outputDataProcessor'](_0x4c0b1e);_0x36f0e0=_0x274b26['data']['processor']['htmlWriter']['getHtml'](_0x50eadd);}else _0x36f0e0=_0x274b26['data']['processor']['toData'](_0x1db0f0);return _0x36f0e0;}['_integrateEditor'](_0x14c486){if(!_0x14c486['config']['get']('collaboration.channelId'))throw new at('ai-missing-channel-id',_0x14c486);_0x14c486['ui']['focusTracker']['on']('change:isFocused',(_0x117a67,_0x2bd4ce,_0xe9e2f8)=>{_0xe9e2f8&&(this['_lastContentFocusedEditor']=_0x14c486);}),_0x14c486['on']('destroy',()=>{this['_lastContentFocusedEditor']===_0x14c486&&(this['_lastContentFocusedEditor']=void 0x0);}),_0x14c486['conversion']['for']('editingDowncast')['markerToHighlight']({'model':As,'view':({markerName:_0x327610})=>({'classes':['ck-ai-assistant-ui_theme','ck-fake-ai-selection','ck-fake-ai-selection-'+_0x327610['split'](':')[0x1]],'priority':0xc})}),_0x14c486['conversion']['for']('dataDowncast')['markerToElement']({'model':As+':context','view':(_0x3427d0,{writer:_0x3835fa,options:_0x2dfd23})=>_0x2dfd23['convertAiChatSelectionMarker']?_0x3835fa['createUIElement'](_0x3427d0['markerName']+':'+(_0x3427d0['isOpening']?'start':'end')):null});}['showFakeVisualSelection'](_0x14042f){const _0x5348cc=this['_fakeSelections'][0x0]||null;this['_addFakeSelection'](_0x14042f);const _0x105e20=this['_fakeSelections'][0x0]||null;this['_refreshFakeSelection'](_0x5348cc,_0x105e20);}['hideFakeVisualSelection'](_0x3857e3){const _0x499ed2=this['_fakeSelections'][0x0]||null;this['_removeFakeSelectionById'](_0x3857e3);const _0x13ec90=this['_fakeSelections'][0x0]||null;this['_refreshFakeSelection'](_0x499ed2,_0x13ec90);}async['modelToDataWithIds'](_0x5414bc){const _0x13d299=ds(this['context']),_0x2bb35c=_0x13d299['data']['toView'](_0x5414bc),_0x3b9a6b=new _0x1e9e0f(_0x13d299['editing']['view']['document']);return this['_setDataIdsOnChildren'](_0x2bb35c,_0x3b9a6b),this['_getDocumentDataStringFromView'](_0x2bb35c,_0x13d299);}['_setDataIdsOnChildren'](_0x4a8ced,_0x101c92,_0x58fd5a=new Set()){let _0x34cffb=!0x1;for(const _0x4b193e of _0x4a8ced['getChildren']()){if(!_0x4b193e['is']('view:element')||gs['includes'](_0x4b193e['name']))continue;const _0x2ea635=_0x4b193e['is']('view:containerElement'),_0xc2e308=_0x4b193e['is']('view:emptyElement'),_0x1440f4=this['_setDataIdsOnChildren'](_0x4b193e,_0x101c92,_0x58fd5a);if(_0x4b193e['hasAttribute']('data-id')){_0x34cffb=!0x0,_0x58fd5a['add'](_0x4b193e['getAttribute']('data-id'));continue;}(_0x2ea635||_0xc2e308||_0x1440f4)&&(_0x101c92['setAttribute']('data-id',this['_nextDataId'](_0x58fd5a),_0x4b193e),_0x34cffb=!0x0);}return _0x34cffb;}['_nextDataId'](_0x181c9e){let _0x8a3c2f;do{_0x8a3c2f='';for(let _0x233a6a=0x0;_0x233a6a<0x4;_0x233a6a++)_0x8a3c2f+=String['fromCharCode'](0x61+Math['floor'](0x1a*Math['random']()));}while(_0x181c9e['has'](_0x8a3c2f));return _0x181c9e['add'](_0x8a3c2f),_0x8a3c2f;}['getSelectionText'](){const {model:_0x3aea9e}=ds(this['context']),_0x2a98ae=_0x3aea9e['document']['selection'],_0x2f31cb=[],_0x2656d3=Array['from'](_0x2a98ae['getRanges']());_0x2656d3['sort']((_0xdabeed,_0x43f58b)=>_0xdabeed['start']['isBefore'](_0x43f58b['start'])?-0x1:0x1);for(const _0x16af40 of _0x2656d3)for(const _0x2add35 of _0x16af40['getItems']())_0x2add35['is']('$textProxy')?_0x2f31cb['push'](_0x2add35['data']):_0x2add35['is']('element')&&_0x2f31cb['length']>0x0&&'\x20'!==_0x2f31cb[_0x2f31cb['length']-0x1]&&_0x2f31cb['push']('\x20');return _0x2f31cb['length']?'\x22'+_0x2f31cb['join']('')['trim']()+'\x22':Hi(this['context']['locale'],'AI_CHAT_CONTEXT_DOCUMENT_SELECTION_LABEL');}['_removeFakeSelectionById'](_0x91ff43){for(let _0x23df29=0x0;_0x23df29<this['_fakeSelections']['length'];_0x23df29++)if(this['_fakeSelections'][_0x23df29]['id']==_0x91ff43)return void this['_fakeSelections']['splice'](_0x23df29,0x1);}['_addFakeSelection'](_0x4e1432){this['_removeFakeSelectionById'](_0x4e1432['id']),Tt(this['_fakeSelections'],_0x4e1432);}['_refreshFakeSelection'](_0x2be482,_0x4f73ab){if(_0x2be482==_0x4f73ab)return;const _0x5bbfa4=_0x2be482?this['_getEditorForFakeSelection'](_0x2be482):null,_0x3bc1b4=_0x4f73ab?this['_getEditorForFakeSelection'](_0x4f73ab):null,_0x271818=(_0x4521c2,_0x1b3128)=>{const _0x3e4339=_0x1b3128['model']['markers']['getMarkersGroup'](As);for(const _0x2efe3f of _0x3e4339)_0x4521c2['removeMarker'](_0x2efe3f);},_0x5aa55e=(_0x2dac8b,_0x3b5cef,_0x4638b1)=>{const _0x478cfa=_0x3b5cef['model'];for(let _0x29b2ec=0x0;_0x29b2ec<_0x4638b1['ranges']['length'];_0x29b2ec++){let _0x39617b=_0x4638b1['ranges'][_0x29b2ec];const _0x15ec5a=As+':'+_0x4638b1['id']+':'+_0x29b2ec;if(_0x39617b['start']['isAtEnd']){const _0x58096f=_0x39617b['start']['getLastMatchingPosition'](({item:_0xa9ab26})=>!_0x478cfa['schema']['isContent'](_0xa9ab26),{'boundaries':_0x39617b});_0x39617b=_0x2dac8b['createRange'](_0x58096f,_0x39617b['end']);}_0x2dac8b['addMarker'](_0x15ec5a,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x39617b});}};_0x5bbfa4&&_0x3bc1b4&&_0x5bbfa4===_0x3bc1b4&&_0x4f73ab?_0x5bbfa4['model']['change'](_0x3cf6ae=>{_0x271818(_0x3cf6ae,_0x5bbfa4),_0x5aa55e(_0x3cf6ae,_0x3bc1b4,_0x4f73ab);}):(_0x5bbfa4&&_0x5bbfa4['model']['change'](_0x5e556f=>_0x271818(_0x5e556f,_0x5bbfa4)),_0x3bc1b4&&_0x4f73ab&&_0x3bc1b4['model']['change'](_0x5e1690=>_0x5aa55e(_0x5e1690,_0x3bc1b4,_0x4f73ab)));}['_getEditorForFakeSelection'](_0x4873e7){if(!_0x4873e7['ranges']['length'])return ds(this['context']);const _0x76dfca=_0x4873e7['ranges'][0x0]['root']['document'];return ls(this['context'])['find'](_0x214186=>_0x214186['model']['document']===_0x76dfca)??ds(this['context']);}['_getMarkersInDocumentOrder'](_0x45318c,_0x2a38ed){const _0x420c1b=Array['from'](_0x45318c['model']['markers']['getMarkersGroup'](As+':context'));return(_0x2a38ed?_0x420c1b['filter'](_0x24297f=>{const _0x41deeb=_0x24297f['getRange']();return _0x41deeb&&_0x41deeb['root']['rootName']===_0x2a38ed['rootName'];}):_0x420c1b)['sort']((_0x33a272,_0x1c6883)=>_0x33a272['getStart']()['isBefore'](_0x1c6883['getStart']())?-0x1:_0x33a272['getStart']()['isAfter'](_0x1c6883['getStart']())?0x1:0x0);}}const Cs=['showChangeInText','insertSuggestion','applySuggestion','rejectSuggestion','mouseOverSuggestion','mouseLeaveSuggestion','toggleSuggestionDisplayMode','like','dislike'],ms=[...Cs,'startConversation','sendUserMessage','abortPromptStream','addDocumentToContext','addFileToContext','addUrlToContext','executeCustomItemCallback','addResourceToContext','removeContextItem','loadSourceResources','toggleWebSearch','toggleReasoning','selectModel'];function ps(_0x44cec8){const _0x32d087=new AbortController();return{'promise':new Promise((_0x43eab7,_0xe15d9)=>{const _0x100683=setTimeout(_0x43eab7,_0x44cec8);_0x32d087['signal']['addEventListener']('abort',()=>{clearTimeout(_0x100683),_0xe15d9();});}),'abortController':_0x32d087};}class HTMLStreamer{['options'];['isStreaming']=!0x1;['document']=null;['nodesList']=[];['currentIndex']=0x0;['timeoutAbortController']=null;['lastUpdateTime']=0x0;constructor(_0x431fc1){this['options']={'delay':_0x431fc1?.['delay']??0xa,'textNodeStyle':_0x431fc1?.['textNodeStyle']??'animation:\x20ck-html-streamer-fade-in\x20.3s'};}async['stream']({document:_0x4498e5,targetElement:_0x33a049,abortSignal:_0x16e0dd}){this['isStreaming']&&this['stop'](),_0x16e0dd?.['addEventListener']('abort',this['stop']['bind'](this)),this['document']=_0x26480f(_0x4498e5,!0x0),this['nodesList']=this['getParsedDocumentNodeList'](),this['isStreaming']=!0x0,this['currentIndex']>this['nodesList']['length']&&(this['currentIndex']=this['nodesList']['length']);for(let _0x4fb58a=0x0;_0x4fb58a<this['currentIndex'];_0x4fb58a++)this['nodesList'][_0x4fb58a]['shouldBeStreamed']=!0x0;do{const _0x1b8b46=Date['now'](),_0x269151=this['nodesList'][this['currentIndex']],_0x4f29d7=_0x1b8b46-this['lastUpdateTime'];if(_0x269151){_0x269151['shouldBeStreamed']=!0x0;let _0x1bd3c4=_0x269151['parent'];for(;_0x1bd3c4;)_0x1bd3c4['shouldBeStreamed']=!0x0,_0x1bd3c4=_0x1bd3c4['parent'];}if(_0x4f29d7<this['options']['delay'])try{const {promise:_0x2592fc,abortController:_0x4f6237}=ps(this['options']['delay']-_0x4f29d7);this['timeoutAbortController']=_0x4f6237,await _0x2592fc;}catch(_0x3a3303){return;}_0x34ac0a(_0x33a049,'<'+_0x33a049['tagName']+'>'+this['renderNode'](this['document'])+'</'+_0x33a049['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:_0x4976a4}){Array['from'](_0x4976a4['querySelectorAll']('span[data-ck-html-streamer-word-chunk]'))['reverse']()['forEach'](_0xb87e86=>{_0xb87e86['replaceWith'](_0xb87e86['childNodes'][0x0]);});}['stop'](){this['isStreaming']=!0x1,this['timeoutAbortController']&&(this['timeoutAbortController']['abort'](),this['timeoutAbortController']=null);}['renderNode'](_0x222a36){let _0x332c0c='';if(function(_0x3361e4){return _0x2cb6f8(_0x3361e4);}(_0x222a36)){for(const _0x3c8720 of _0x222a36['children'])_0x332c0c+=this['renderNode'](_0x3c8720);}else{if(Ts(_0x222a36)){if(!_0x222a36['shouldBeStreamed'])return'';const _0x46b7c9=_0x222a36,_0x487b5b=Object['entries'](_0x46b7c9['attribs'])['map'](([_0x5a46f3,_0x24902f])=>_0x5a46f3+'=\x22'+_0x24902f+'\x22')['join']('\x20');_0x332c0c+='<'+_0x46b7c9['tagName']+(_0x487b5b?'\x20'+_0x487b5b:'')+'>';for(const _0x569d11 of _0x31d55c(_0x46b7c9))_0x332c0c+=this['renderNode'](_0x569d11);_0x332c0c+='</'+_0x46b7c9['tagName']+'>';}else{if(!ws(_0x222a36))return'';if(!_0x222a36['shouldBeStreamed'])return'';!function(_0x5b403a){if(!_0x5b403a['parent']||!Ts(_0x5b403a['parent']))return!0x1;if(!Es['includes'](_0x5b403a['parent']['tagName']))return!0x1;return!_0x3357dc(_0x5b403a)['match'](/^\s*[<>]\s*$/);}(_0x222a36)?_0x332c0c+=ti(_0x222a36):_0x332c0c+=ti(new _0x3d6efa('span',{'data-ck-html-streamer-word-chunk':'','style':this['options']['textNodeStyle']},[_0x222a36]));}}return _0x332c0c;}['getParsedDocumentNodeList'](){const _0x339d96=[];return function(_0x3bc9f1,_0x5d4b95){const _0x1a9588=_0x1622f3=>{if(_0x5d4b95(_0x1622f3),_0x1622f3 instanceof _0x176ff2)for(let _0x4001ad=0x0;_0x4001ad<_0x1622f3['children']['length'];_0x4001ad++){const _0xd12ddc=_0x1622f3['children'][_0x4001ad];_0x1a9588(_0xd12ddc);}};for(let _0x4a09c9=0x0;_0x4a09c9<_0x3bc9f1['children']['length'];_0x4a09c9++)_0x1a9588(_0x3bc9f1['children'][_0x4a09c9]);}(this['document'],_0x29ec5e=>{if(ws(_0x29ec5e)){const _0x452540=this['splitTextNodeIntoWordNodes'](_0x29ec5e);_0x452540['length']&&_0x339d96['push'](..._0x452540);}_0x29ec5e['isWordSplitSource']||_0x29ec5e['isWordSplitResult']||_0x339d96['push'](_0x29ec5e);}),_0x339d96;}['splitTextNodeIntoWordNodes'](_0x316d9e){if(_0x316d9e['isWordSplitSource']||_0x316d9e['isWordSplitResult'])return[];const _0x19d9a3=_0x3357dc(_0x316d9e)['match'](/(?:\s*\S+\s*)/g),_0x55a8f9=[];if(_0x19d9a3&&_0x19d9a3['length']>0x1){for(const _0x2bad94 of _0x19d9a3){const _0x2b936e=new _0xf98b0e(_0x2bad94);_0x2b936e['isWordSplitResult']=!0x0,_0x5be902(_0x316d9e,_0x2b936e),_0x55a8f9['push'](_0x2b936e);}_0x316d9e['isWordSplitSource']=!0x0,_0x497429(_0x316d9e);}return _0x55a8f9;}}const Es=['p','li','td','th','span','h1','h2','h3','h4','h5','h6','b','strong','i','em','mark','del','ins','sup','sub','a','code','div'];function ws(_0x3fa9a7){return _0x254ff4(_0x3fa9a7);}function Ts(_0x5d831a){return _0x3a909c(_0x5d831a);}class AIChatFeedItemView extends Nt{['options'];['content']='';['htmlStreamer'];['children'];constructor(_0x9783d5){super();const _0x31ee14=this['bindTemplate'];this['set']('isDone',!0x1),this['set']('isVisible',!0x0),this['htmlStreamer']=new HTMLStreamer(),this['options']=_0x9783d5,this['children']=this['createCollection'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed__item',_0x31ee14['if']('isDone','ck-ai-chat__feed__item_done'),_0x31ee14['if']('isVisible','ck-hidden',_0x2dcdea=>!_0x2dcdea),'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'](_0x2315bd=>{_0x2315bd['removeAttribute']('data-id');}),this['isDone']=!0x0;}async['streamIntoElement'](_0x4e470d,_0x4a1bd8,_0x31e496){await this['htmlStreamer']['stream']({'document':_0x4e470d,'targetElement':_0x4a1bd8,'abortSignal':_0x31e496});}}class AISuggestionHeaderView extends Nt{['showChangesToggleView'];constructor(_0x447e9d,_0x30ffed){super(_0x447e9d),this['set']('isShowChangesToggleVisible',!0x0),this['showChangesToggleView']=new ShowChangesToggleView(_0x447e9d),this['showChangesToggleView']['set']({'class':'ck-ai-suggestion__header__show-changes-toggle\x20ck-ai-chat-controls-button\x20'+Bi,'label':Hi(_0x447e9d,'AI_SUGGESTION_BUTTON_SHOW_CHANGES'),'withText':!0x0}),this['showChangesToggleView']['isOn']=_0x30ffed['showDiff'],this['showChangesToggleView']['bind']('isVisible')['to'](this,'isShowChangesToggleVisible'),this['showChangesToggleView']['bind']('icon')['to'](this['showChangesToggleView'],'isOn',_0xa5bd5d=>_0xa5bd5d?_0x53c611:_0x3f4754),this['showChangesToggleView']['on']('execute',()=>{this['showChangesToggleView']['isOn']=!this['showChangesToggleView']['isOn'],this['fire']('toggleShowChanges',{'isOn':this['showChangesToggleView']['isOn']});});const _0x232a02=new xt();_0x232a02['content']=_0x51cd8b,this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__header',!0x1===_0x30ffed['showHeader']?'ck-hidden':null]['filter'](Boolean)},'children':[_0x232a02,{'tag':'span','children':[Hi(_0x447e9d,'AI_SUGGESTION_HEADER_TITLE')]},this['showChangesToggleView']]});}}class ShowChangesToggleView extends vt{['render'](){super['render'](),this['children']['remove'](this['iconView']),this['children']['add'](this['iconView']);}}const fs={'accepted':_0xe9f15a,'rejected':_0x255ef9,'outdated':_0x255ef9};class AISuggestionContentPartStateView extends Nt{['stateIconView'];constructor(_0x57c0d6){super(_0x57c0d6);const _0x5b6897=this['bindTemplate'];this['set']('state','accepted'),this['set']('isVisible',!0x0),this['stateIconView']=new StateIconView(),this['stateIconView']['bind']('state')['to'](this),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__content-part-state',_0x5b6897['to']('state',_0x5e1816=>'ck-ai-suggestion__content-part-state_'+_0x5e1816),_0x5b6897['if']('isVisible','ck-hidden',_0x3bb9f2=>!_0x3bb9f2)]},'children':[{'tag':'span','attributes':{'class':['ck-ai-suggestion__content-part-state__label']},'children':[{'text':_0x5b6897['to']('state',_0x56b894=>{switch(_0x56b894){case'accepted':return Hi(_0x57c0d6,'AI_SUGGESTION_CONTENT_PART_STATE_ACCEPTED');case'rejected':return Hi(_0x57c0d6,'AI_SUGGESTION_CONTENT_PART_STATE_REJECTED');case'outdated':return Hi(_0x57c0d6,'AI_SUGGESTION_CONTENT_PART_STATE_OUTDATED');}})}]},this['stateIconView']]});}['setState'](_0x34b83d){this['state']=_0x34b83d;}}class StateIconView extends xt{constructor(){super(),this['set']('state','accepted'),this['content']=fs[this['state']],this['on']('change:state',()=>{this['content']=fs[this['state']];});}}class AISuggestionContentPartToolbarView extends kt{['_applyButton'];['_suggestButton'];constructor(_0x554eb7,_0x13037c,_0x1b8005){super(_0x554eb7);const _0x1ced89=Boolean(_0x1b8005);this['set']('isEnabled',!_0x1ced89),this['set']('isVisible',!0x0),this['class']='ck-ai-suggestion-content-part-toolbar';const _0x26652c=[];if(_0x1ced89){const _0x5e959a=new vt(_0x554eb7);_0x5e959a['set']({'label':Hi(_0x554eb7,'AI_SUGGESTION_DISABLED_TOOLTIP_MESSAGE'),'tooltip':!0x0,'withText':!0x1,'icon':_0x5e8452}),_0x5e959a['extendTemplate']({'attributes':{'data-cke-tooltip-class':'ck-ai-suggestion-content-part-disabled-actions-tooltip'}}),_0x26652c['push'](_0x5e959a);}else{_0x13037c['includes']('applySuggestion')&&(this['_applyButton']=new vt(_0x554eb7),this['_applyButton']['set']({'label':Hi(_0x554eb7,'AI_SUGGESTION_CONTENT_PART_APPLY'),'tooltip':!0x0,'tooltipPosition':'n','withText':!0x1,'icon':_0xe9f15a}),this['_applyButton']['bind']('isEnabled')['to'](this),this['_applyButton']['on']('execute',()=>{this['fire']('applySuggestion');}),_0x26652c['push'](this['_applyButton'])),_0x13037c['includes']('insertSuggestion')&&(this['_suggestButton']=new vt(_0x554eb7),this['_suggestButton']['set']({'label':Hi(_0x554eb7,'AI_SUGGESTION_CONTENT_PART_ADD_SUGGESTION'),'tooltip':!0x0,'tooltipPosition':'n','withText':!0x1,'icon':_0x330f5b}),this['_suggestButton']['bind']('isEnabled')['to'](this),this['_suggestButton']['on']('execute',()=>{this['fire']('insertSuggestion');}),_0x26652c['push'](this['_suggestButton']));const _0x29aa62=new vt(_0x554eb7);_0x29aa62['set']({'label':Hi(_0x554eb7,'AI_SUGGESTION_CONTENT_PART_REJECT'),'tooltip':!0x0,'tooltipPosition':'n','withText':!0x1,'icon':_0x255ef9}),_0x29aa62['bind']('isEnabled')['to'](this),_0x29aa62['on']('execute',()=>{this['fire']('rejectSuggestion');}),_0x26652c['push'](_0x29aa62);}this['items']['addMany'](_0x26652c);const _0x537375=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':[_0x537375['if']('isVisible','ck-hidden',_0x4bccd9=>!_0x4bccd9)]}});}['setButtonsVisibility']({showApplyButton:_0x43e259,showSuggestButton:_0x1ed6a8}){this['_applyButton']&&(this['_applyButton']['isVisible']=_0x43e259),this['_suggestButton']&&(this['_suggestButton']['isVisible']=_0x1ed6a8);}}class AISuggestionContentPartHeaderView extends Nt{['toolbarView'];['stateView'];['titleLabelView'];['children'];constructor(_0x4a5e86,{part:_0x599538,uiIndex:_0x2f5087,availableActions:_0x23f25a,areActionsDisabled:_0xb8a98d}){super(_0x4a5e86),this['set']('isEnabled',!0x0),this['set']('state','pending'),this['toolbarView']=new AISuggestionContentPartToolbarView(_0x4a5e86,_0x23f25a,_0xb8a98d),this['toolbarView']['on']('rejectSuggestion',()=>{this['fire']('rejectSuggestion',{'index':_0x599538['index']});}),this['toolbarView']['on']('insertSuggestion',()=>{this['fire']('insertSuggestion',{'index':_0x599538['index']});}),this['toolbarView']['on']('applySuggestion',()=>{this['fire']('applySuggestion',{'index':_0x599538['index']});}),this['toolbarView']['bind']('isEnabled')['to'](this),this['stateView']=new AISuggestionContentPartStateView(_0x4a5e86),this['titleLabelView']=new AISuggestionBodyContentPartTitleLabelView(_0x4a5e86,_0x2f5087),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',(_0x34b012,_0x1936f8,_0x2b2918,_0x1b4bd1)=>{'pending'===_0x1b4bd1?this['children']['remove'](this['toolbarView']):this['children']['remove'](this['stateView']),'pending'===_0x2b2918?this['children']['add'](this['toolbarView']):(this['stateView']['setState'](_0x2b2918),this['children']['add'](this['stateView']));});}}class AISuggestionBodyContentPartTitleLabelView extends Nt{constructor(_0x17fd73,_0x15ba1b){super(_0x17fd73),this['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai-suggestion__body__content-part__title__label']},'children':[Hi(_0x17fd73,'AI_SUGGESTION_CONTENT_PART_TITLE',_0x15ba1b['toString']())]});}}class AISuggestionStreamableContentView extends Nt{['htmlStreamer'];constructor(_0x2352f8){super(_0x2352f8),this['htmlStreamer']=new HTMLStreamer(),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-content','ck-reset_all-excluded','ck-ai-suggestion-streamable-content']}});}async['update']({part:_0x65f42c,renderingStrategy:_0x1b5860,abortSignal:_0x9aca34}){'streaming'===_0x1b5860?await this['htmlStreamer']['stream']({'document':_0x65f42c['content'],'targetElement':this['element'],'abortSignal':_0x9aca34}):_0x34ac0a(this['element'],'<'+this['element']['tagName']+'>'+Ki(_0x65f42c['content'])+'</'+this['element']['tagName']+'>',{'childrenOnly':!0x0});}['clear'](){this['htmlStreamer']['reset'](),this['element']['innerHTML']='';}}class AISuggestionBodyViewContentPartView extends Nt{['_children'];['_headerView'];['_streamableContentView'];constructor(_0x5e503f,{part:_0x1edb58,uiIndex:_0x40a54b,areActionsDisabled:_0x2eb615,availableActions:_0x678482}){super(_0x5e503f);const _0x5d2701=this['bindTemplate'];this['set']('state','pending'),this['set']('isDone',!0x1),this['set']('isVisible',!0x1),this['set']('isActive',!0x1),this['set']('isEnabled',!0x1);const _0xdbddb6=()=>{this['isEnabled']=this['isDone']&&'pending'==this['state']&&!_0x2eb615;};this['on']('change:state',_0xdbddb6),this['on']('change:isDone',_0xdbddb6),_0xdbddb6(),this['_children']=this['createCollection'](),this['_headerView']=new AISuggestionContentPartHeaderView(_0x5e503f,{'part':_0x1edb58,'uiIndex':_0x40a54b,'availableActions':_0x678482,'areActionsDisabled':_0x2eb615}),this['_headerView']['bind']('isEnabled','state')['to'](this),this['_headerView']['delegate'](...Cs)['to'](this),this['_streamableContentView']=new AISuggestionStreamableContentView(_0x5e503f),this['_children']['addMany']([this['_headerView'],this['_streamableContentView']]),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__body__content-part',_0x5d2701['to']('state',_0x5bc7bd=>'ck-ai-suggestion__body__content-part_'+_0x5bc7bd),_0x5d2701['if']('isEnabled','ck-ai-suggestion__body__content-part_enabled'),_0x5d2701['if']('isActive','ck-ai-suggestion__body__content-part_active'),_0x5d2701['if']('isVisible','ck-hidden',_0x3d195b=>!_0x3d195b)]},'children':this['_children'],'on':{'mouseenter':_0x5d2701['to'](()=>{this['isEnabled']&&this['fire']('mouseOverSuggestion',{'index':_0x1edb58['index']});}),'mouseleave':_0x5d2701['to'](()=>{this['isEnabled']&&this['fire']('mouseLeaveSuggestion',{'index':_0x1edb58['index']});}),'click':_0x5d2701['to'](_0x12d791=>{const _0x4f439f=_0x12d791['target'];this['isEnabled']&&!this['_headerView']['toolbarView']['element']['contains'](_0x4f439f)&&this['fire']('showChangeInText',{'index':_0x1edb58['index']});})}});}async['updateContent']({part:_0x43e4d8,showUnchangedParts:_0x1aa2aa=!0x1,abortSignal:_0x29790d}){this['partDefinition']=_0x43e4d8,this['isVisible']=this['partDefinition']['hasChanges']||_0x1aa2aa,this['isVisible']&&await this['_streamableContentView']['update']({'part':_0x43e4d8,'renderingStrategy':'static','abortSignal':_0x29790d});}['markAsDone'](){this['isDone']=!0x0;}}class AISkeletonView extends Nt{constructor(_0x2a883d,_0x417782){super(_0x2a883d),this['set']('isVisible',!0x0),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-skeleton',this['bindTemplate']['if']('isVisible','ck-hidden',_0x25dbe7=>!_0x25dbe7)]},'children':this['_createSkeletonItems'](_0x417782)});}['_createSkeletonItems'](_0x5016bc){const _0x2104c7=['ck','ck-ai-skeleton__item'];return _0x5016bc['map'](_0x286413=>{let _0x2524a4='';switch(_0x286413['attributes']['align']){case'right':_0x2524a4='margin-left:\x20auto;\x20margin-right:\x200;\x20text-align:\x20right;';break;case'center':_0x2524a4='margin-left:\x20auto;\x20margin-right:\x20auto;\x20text-align:\x20center;';break;case'left':_0x2524a4='margin-left:\x200;\x20margin-right:\x20auto;\x20text-align:\x20left;';}return{'tag':_0x286413['tag'],'attributes':{'class':[..._0x2104c7,_0x286413['attributes']['class']?_0x286413['attributes']['class']:''],'style':'width:\x20'+_0x286413['attributes']['width']+';\x20height:\x20'+_0x286413['attributes']['height']+';'+_0x2524a4}};});}}const Ss={'aiSuggestionBody':[{'tag':'div','attributes':{'width':'50%','height':'24px','align':'left'}},{'tag':'div','attributes':{'width':'85%','height':'24px','align':'left'}},{'tag':'div','attributes':{'width':'100%','height':'24px','align':'left'}},{'tag':'div','attributes':{'width':'75%','height':'24px','align':'left'}},{'tag':'div','attributes':{'width':'100%','height':'24px','align':'left'}}],'aiFeed':[{'tag':'div','attributes':{'width':'100%','height':'72px','align':'right'}},{'tag':'div','attributes':{'width':'250px','height':'40px','align':'right'}},{'tag':'div','attributes':{'width':'100%','height':'88px','align':'right'}},{'tag':'div','attributes':{'width':'150px','height':'40px','align':'right'}},{'tag':'div','attributes':{'width':'100%','height':'140px','align':'right'}},{'tag':'div','attributes':{'width':'250px','height':'40px','align':'right'}},{'tag':'div','attributes':{'width':'100%','height':'88px','align':'right'}}],'aiHistory':Rs(0x5,'100%','44px','right'),'aiChatResources':Rs(0x8,'100%','24px','right'),'aiReviewChecks':[{'tag':'div','attributes':{'width':'128px','height':'24px','align':'left'}},{'tag':'div','attributes':{'width':'100%','height':'24px','align':'left'}},{'tag':'div','attributes':{'width':'128px','height':'24px','align':'left'}}]};function Rs(_0xd3d45a,_0x378e0b,_0xf17cad,_0x15932b){return new Array(_0xd3d45a)['fill'](null)['map'](()=>({'tag':'div','attributes':{'width':_0x378e0b,'height':_0xf17cad,'align':_0x15932b}}));}class PromiseQueue extends Et(){['queue']=[];['isProcessing']=!0x1;['_abortController'];async['enqueue'](_0x3f8359){const _0x387b8=this['createTask'](_0x3f8359);return this['queue']['push'](_0x387b8),this['_processQueue'](),_0x387b8['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(_0x4eb6d0=>{this['once']('_queueEmpty',()=>{_0x4eb6d0();});}):Promise['resolve']();}async['_processQueue'](){if(!this['isProcessing']){this['_abortController']=new AbortController(),this['isProcessing']=!0x0;try{for(;this['queue']['length']&&this['isProcessing'];){const _0x487fce=this['queue']['shift']();try{await _0x487fce['callback'](this['_abortController']['signal']),_0x487fce['resolve']();}catch(_0x464cae){_0x487fce['reject'](_0x464cae);}}}finally{this['isProcessing']=!0x1,this['_abortController']=void 0x0;}this['fire']('_queueEmpty');}}['createTask'](_0x4df895){let _0x48bc81,_0x1c8216;const _0x2f3d3b=new Promise((_0x57e7cc,_0xa90fd)=>{_0x48bc81=_0x57e7cc,_0x1c8216=_0xa90fd;});return{'callback':_0x4df895,'resolve':_0x48bc81,'reject':_0x1c8216,'completePromise':_0x2f3d3b};}}class AIChatFeedErrorItemView extends AIChatFeedItemView{constructor(_0x3d48c5){super(_0x3d48c5),this['extendTemplate']({'attributes':{'class':['ck-ai-notification','warning'===_0x3d48c5['level']?'ck-ai-notification_warning':'ck-ai-notification_error']}});}['render'](){super['render'](),this['setContent'](this['options']['initialContent']),this['markAsDone']();}['setContent'](_0x2512ed){this['element']['innerHTML']=_0x2512ed;}}const bs=['applySuggestion','insertSuggestion'];class AIChatFeedSuggestionItemActionsView extends Nt{['_applyChangesButton'];['_insertSuggestionsButton'];['children'];constructor(_0x5b9b13,_0x208de4=[...bs],_0x54f86d){super(_0x5b9b13);const _0x5e2bac=this['bindTemplate'],_0x1b8006=Boolean(_0x54f86d);if(this['set']('isEnabled',!_0x1b8006),this['set']('isVisible',!0x1),this['set']('isTrackChangesOn',!0x1),this['children']=this['createCollection'](),_0x1b8006){const _0x2e29de=new vt(_0x5b9b13);_0x2e29de['set']({'label':Hi(_0x5b9b13,'AI_SUGGESTION_DISABLED_TOOLTIP_MESSAGE'),'tooltip':!0x0,'withText':!0x1,'icon':_0x5e8452}),_0x2e29de['extendTemplate']({'attributes':{'data-cke-tooltip-class':'ck-ai-suggestion-content-part-disabled-actions-tooltip'}});const _0x4260e4=new Nt(_0x5b9b13);_0x4260e4['setTemplate']({'tag':'div','attributes':{'class':'ck-ai-chat__feed__suggestion__actions__info'},'children':[{'tag':'p','children':[Hi(_0x5b9b13,'AI_SUGGESTION_DISABLED_FEED_MESSAGE'),_0x2e29de]}]}),this['children']['add'](_0x4260e4);}else this['_applyChangesButton']=new vt(_0x5b9b13),this['_applyChangesButton']['set']({'label':Hi(_0x5b9b13,'AI_CHAT_SUGGESTION_ACTION_APPLY_ALL'),'withText':!0x0,'type':'button','isVisible':_0x208de4['includes']('applySuggestion'),'class':Mi}),this['_insertSuggestionsButton']=new vt(_0x5b9b13),this['_insertSuggestionsButton']['set']({'label':Hi(_0x5b9b13,'AI_CHAT_SUGGESTION_ACTION_SUGGEST_ALL'),'withText':!0x0,'type':'button','isVisible':_0x208de4['includes']('insertSuggestion'),'class':Ui}),this['_insertSuggestionsButton']['on']('execute',()=>{this['fire']('insertSuggestion');}),this['_applyChangesButton']['on']('execute',()=>{this['fire']('applySuggestion');}),[this['_applyChangesButton'],this['_insertSuggestionsButton']]['forEach'](_0x3529ad=>{_0x3529ad['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',_0x5e2bac['if']('isVisible','ck-hidden',_0x234dc9=>!_0x234dc9)]},'children':this['children']}),this['on']('change:isTrackChangesOn',()=>{this['_applyChangesButton']&&(this['_applyChangesButton']['isVisible']=!this['isTrackChangesOn']);});}['updateVisibility'](_0x530677){this['isVisible']=_0x530677;}['_switchButtonLabelsPlurality'](_0x1beb58){this['_applyChangesButton']&&this['_insertSuggestionsButton']&&(_0x1beb58?(this['_applyChangesButton']['label']=Hi(this['locale'],'AI_CHAT_SUGGESTION_ACTION_APPLY_ALL'),this['_insertSuggestionsButton']['label']=Hi(this['locale'],'AI_CHAT_SUGGESTION_ACTION_SUGGEST_ALL')):(this['_applyChangesButton']['label']=Hi(this['locale'],'AI_CHAT_SUGGESTION_ACTION_APPLY'),this['_insertSuggestionsButton']['label']=Hi(this['locale'],'AI_CHAT_SUGGESTION_ACTION_SUGGEST')));}}class AIWebSourcesView extends Nt{['children'];['balloonPanelView'];['bodyCollection'];constructor(_0x3845ae,_0x2a2f4b){super(_0x3845ae),this['bodyCollection']=_0x2a2f4b,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',_0x237ef2=>!_0x237ef2)]},'children':this['children']});const _0x2202c6=new Nt(this['locale']),_0x339a6e=new xt();_0x339a6e['content']=_0x1d0469,_0x2202c6['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-web-sources__header']},'children':[_0x339a6e,{'tag':'span','children':[{'text':Hi(this['locale'],'AI_CHAT_SOURCES_HEADER')}]}]}),this['children']['add'](_0x2202c6),this['_setupBalloonPanel'](_0x3845ae);}['addSource'](_0x5d54f0){this['children']['add'](new AIWebSourceView(this['locale'],_0x5d54f0,this['balloonPanelView']));}['_setupBalloonPanel'](_0x248703){this['balloonPanelView']=new Xt(_0x248703),this['balloonPanelView']['extendTemplate']({'attributes':{'class':['ck-ai-web-source__tooltip-balloon']}}),this['bodyCollection']['add'](this['balloonPanelView']);}}class AIWebSourceView extends vt{['balloonPanelView'];['source'];constructor(_0x4780ed,_0x2eeff4,_0x4d1baa){super(_0x4780ed),this['source']=_0x2eeff4,this['balloonPanelView']=_0x4d1baa,this['set']({'label':_0x2eeff4['title'],'class':['ck\x20ck-ai-web-source'],'withText':!0x0});const _0x490365=this['bindTemplate'];if(this['extendTemplate']({'on':{'click':_0x490365['to'](()=>{window['open'](_0x2eeff4['url'],'_blank');}),'mouseenter':_0x490365['to'](()=>{this['_showTooltip']();}),'mouseleave':_0x490365['to'](()=>{this['_hideTooltip']();})}}),_0x2eeff4['favicon']){const _0xb28e3=new Nt(_0x4780ed);_0xb28e3['setTemplate']({'tag':'img','attributes':{'src':_0x2eeff4['favicon']||_0x1d0469,'alt':_0x2eeff4['title'],'class':['ck-ai-web-source__image']}}),this['children']['add'](_0xb28e3);}else this['set']('icon',_0x1d0469);}['_createTooltipContentView'](_0xfe8e0a,_0x3784a8){const _0x5b052a=new Nt(_0xfe8e0a),_0x448198=[];let _0x440502;_0x3784a8?.['favicon']?(_0x440502=new Nt(_0xfe8e0a),_0x440502['setTemplate']({'tag':'img','attributes':{'src':_0x3784a8['favicon'],'alt':_0x3784a8['title'],'class':['ck-ai-web-source__tooltip-image']}})):(_0x440502=new xt(),_0x440502['content']=_0x1d0469,_0x440502['extendTemplate']({'attributes':{'alt':_0x3784a8['title'],'class':['ck-ai-web-source__tooltip-image']}})),_0x448198['push'](_0x440502);const _0x5901aa=new Nt(_0xfe8e0a);_0x5901aa['setTemplate']({'tag':'a','attributes':{'class':['ck-ai-web-source__tooltip-url'],'href':_0x3784a8['url']},'children':[{'text':new URL(_0x3784a8['url'])?.['hostname']}]}),_0x448198['push'](_0x5901aa);const _0x45ba69=new Nt(_0xfe8e0a);_0x45ba69['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-web-source__tooltip-row']},'children':_0x448198});const _0x50b93=new Nt(_0xfe8e0a);return _0x50b93['setTemplate']({'tag':'span','attributes':{'class':['ck-ai-web-source__tooltip-row','ck-ai-web-source__tooltip-title']},'children':[{'text':_0x3784a8['title']['length']>0x190?_0x3784a8['title']['substring'](0x0,0x190)+'...':_0x3784a8['title']}]}),_0x5b052a['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-web-source__tooltip']},'children':[_0x45ba69,_0x50b93]}),_0x5b052a;}['_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 _0x3e8f27=this['_createTooltipContentView'](this['locale'],this['source']);this['balloonPanelView']['content']['add'](_0x3e8f27);}}class AISuggestionBodyView extends Nt{['_actionsView'];['_sourcesView'];['_children'];['_skeletonView'];['_showSkeletonDebounced']=_0x148416(()=>{this['_skeletonView']['isVisible']=!0x0,this['_skeletonShownAt']=Date['now']();},0x3e8);['_skeletonShownAt']=null;['_areActionsDisabled'];['_showUnchangedParts'];['_updateContentPartsPromiseQueue'];['_emptyPartsWarningView'];['_availableActions'];['_cachedContentParts']=[];constructor(_0x3d744b,_0xfc5776){super(_0x3d744b);const {areActionsDisabled:_0x146fe1,showUnchangedParts:_0x13755b,availableActions:_0x1967db}=_0xfc5776;this['_areActionsDisabled']=_0x146fe1,this['_showUnchangedParts']=_0x13755b,this['_availableActions']=_0x1967db,this['set']('hasPendingParts',!0x1),this['set']('isTrackChangesOn',!0x1),this['_children']=this['createCollection'](),this['_skeletonView']=new AISkeletonView(_0x3d744b,Ss['aiSuggestionBody']),this['_skeletonView']['isVisible']=!0x0,this['_skeletonShownAt']=Date['now'](),this['_children']['add'](this['_skeletonView']),this['_updateContentPartsPromiseQueue']=new PromiseQueue(),this['_emptyPartsWarningView']=new AIChatFeedErrorItemView({'id':'empty-parts-warning','initialContent':Hi(_0x3d744b,'AI_SUGGESTION_EMPTY_PART_WARNING'),'level':'warning'}),this['_emptyPartsWarningView']['isVisible']=!0x1,this['_actionsView']=new AIChatFeedSuggestionItemActionsView(_0x3d744b,_0xfc5776['availableActions'],this['_areActionsDisabled']),this['_actionsView']['bind']('isTrackChangesOn')['to'](this),this['_sourcesView']=new AIWebSourcesView(this['locale'],_0xfc5776['bodyCollection']),_0xfc5776['areActionsDisabled']?this['_actionsView']['isEnabled']=!0x1:this['_actionsView']['bind']('isEnabled')['to'](this,'hasPendingParts'),this['_actionsView']['delegate'](...Cs)['to'](this),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__body']},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__body__content-parts']},'children':this['_children']},this['_emptyPartsWarningView'],this['_actionsView'],this['_sourcesView']]});}['destroy'](){this['_updateContentPartsPromiseQueue']['abort'](),this['_showSkeletonDebounced']['cancel'](),super['destroy']();}get['partsCount'](){return this['_contentPartViews']['length'];}get['_contentPartViews'](){return Array['from'](this['_children'])['filter'](_0x497104=>_0x497104 instanceof AISuggestionBodyViewContentPartView);}async['updateContentParts']({parts:_0x12e0e1,abortSignal:_0xae1208,skipLoadingEffects:_0x954a25}){this['_cachedContentParts']['length']?_0x12e0e1['forEach'](_0x37cf92=>{const _0x3c562c=this['_cachedContentParts']['findIndex'](_0x3029ed=>_0x3029ed['index']==_0x37cf92['index']);-0x1===_0x3c562c?this['_cachedContentParts']['push'](_0x37cf92):this['_cachedContentParts'][_0x3c562c]=_0x37cf92;}):this['_cachedContentParts']=_0x12e0e1;const _0x15ee11=this['_showUnchangedParts']?_0x12e0e1:_0x12e0e1['filter'](_0x511a67=>_0x511a67['hasChanges']);this['_actionsView']['_switchButtonLabelsPlurality'](_0x15ee11['length']>0x1),_0x954a25&&(this['_showSkeletonDebounced']['cancel'](),this['_skeletonView']['isVisible']=!0x1);for(const _0x1360f2 of _0x15ee11)this['_updateContentPartsPromiseQueue']['enqueue'](async _0x13f0bf=>{let _0x171dd5=this['getPartView'](_0x1360f2['index']);if(!_0x171dd5){if(_0x171dd5=new AISuggestionBodyViewContentPartView(this['locale'],{'part':_0x1360f2,'uiIndex':this['_contentPartViews']['length']+0x1,'areActionsDisabled':this['_areActionsDisabled'],'availableActions':this['_availableActions']}),_0x171dd5['delegate'](...Cs)['to'](this),!_0x954a25&&(this['_showSkeletonDebounced']['cancel'](),await this['_awaitMinimumSkeletonDisplayTime'](_0x13f0bf),_0x13f0bf['aborted']))return;this['_skeletonView']['isVisible']=!0x1,this['_children']['add'](_0x171dd5,this['_children']['length']-0x1),this['hasPendingParts']=!0x0,_0x954a25||this['_showSkeletonDebounced']();}await _0x171dd5['updateContent']({'part':_0x1360f2,'showUnchangedParts':this['_showUnchangedParts'],'abortSignal':_0x13f0bf}),_0x171dd5['markAsDone']();});return _0xae1208?.['addEventListener']('abort',()=>{this['_updateContentPartsPromiseQueue']['abort'](),this['_showSkeletonDebounced']['cancel'](),this['_skeletonView']['isVisible']=!0x1;}),this['_updateContentPartsPromiseQueue']['queueEmptyPromise'];}['updatePartState'](_0x31936b,_0xcd4d38){const _0x5267f3=this['getPartView'](_0x31936b);_0x5267f3&&(_0x5267f3['state']=_0xcd4d38),this['hasPendingParts']='pending'==_0xcd4d38||this['_contentPartViews']['some'](_0x4ae5e4=>'pending'==_0x4ae5e4['state']);}['setPartActive'](_0x3bf35e,_0x31c83e){if(!0x1===_0x3bf35e){for(const _0x19577f of this['_contentPartViews'])_0x19577f['isActive']=!0x1;}else{const _0x5de3dc=this['getPartView'](_0x3bf35e);_0x5de3dc&&(_0x5de3dc['isActive']=_0x31c83e);}}['updateSources'](_0x4f23fa){_0x4f23fa['forEach'](_0x2925e2=>this['_sourcesView']['addSource'](_0x2925e2)),this['_sourcesView']['isVisible']=!0x0;}['getPartView'](_0x63bafe){return this['_contentPartViews']['find'](_0x467a54=>_0x467a54['partDefinition']['index']==_0x63bafe)??null;}['markAsDone'](){if(!this['_showUnchangedParts']){const _0x2e4746=!this['_cachedContentParts']['find'](({hasChanges:_0x1761c8})=>_0x1761c8),_0x11b228=!!this['_cachedContentParts']['find'](({hasChanges:_0x1493c6})=>!_0x1493c6);this['_emptyPartsWarningView']['isVisible']=0x0==this['_contentPartViews']['length']||_0x11b228,_0x2e4746?this['_emptyPartsWarningView']['setContent'](Hi(this['locale'],'AI_SUGGESTION_NO_PARTS_WARNING')):this['_emptyPartsWarningView']['setContent'](Hi(this['locale'],'AI_SUGGESTION_EMPTY_PART_WARNING'));}this['_contentPartViews']['forEach'](_0xaac3d=>_0xaac3d['markAsDone']()),this['_skeletonView']['isVisible']=!0x1,this['_showSkeletonDebounced']['cancel'](),this['_actionsView']['updateVisibility'](this['hasNonEmptyParts']);}async['_awaitMinimumSkeletonDisplayTime'](_0x23e0a0){if(!this['_skeletonView']['isVisible']||null===this['_skeletonShownAt'])return;const _0x87b7b7=0x3e8-(Date['now']()-this['_skeletonShownAt']);if(this['_skeletonShownAt']=null,_0x87b7b7>0x0){const {promise:_0x2004c9,abortController:_0x3d3d64}=ps(_0x87b7b7);_0x23e0a0?.['addEventListener']('abort',()=>_0x3d3d64['abort']()),await _0x2004c9['catch'](()=>{});}}get['hasNonEmptyParts'](){return this['_contentPartViews']['filter'](_0x16c9a7=>_0x16c9a7['partDefinition']['hasChanges'])['length']>0x0;}}class AISuggestionContainerView extends Nt{['bodyView'];['children'];['headerView'];constructor(_0x2a5144,_0x59fbda,_0x1da0d6){super(_0x2a5144);const {showDiff:_0x51c5a7,areActionsDisabled:_0x5e0a1c,showUnchangedParts:_0x2afedc,availableActions:_0x5e97aa}=_0x59fbda;this['set']('isTrackChangesOn',!0x1),this['set']('areChangesVisible',!0x1),this['children']=this['createCollection'](),this['headerView']=new AISuggestionHeaderView(_0x2a5144,{'showDiff':_0x51c5a7}),this['headerView']['on']('toggleShowChanges',(_0x4e1aa4,_0xda07e8)=>{this['areChangesVisible']=_0xda07e8['isOn'],this['fire']('toggleSuggestionDisplayMode',{'showDiff':_0xda07e8['isOn']});}),this['children']['add'](this['headerView']),this['bodyView']=new AISuggestionBodyView(_0x2a5144,{'areActionsDisabled':_0x5e0a1c,'showUnchangedParts':!!_0x2afedc,'availableActions':_0x5e97aa,'bodyCollection':_0x1da0d6}),this['bodyView']['delegate'](...Cs)['to'](this),this['bodyView']['bind']('isTrackChangesOn')['to'](this),this['children']['add'](this['bodyView']),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__container','ck-rounded-corners']},'children':this['children']});}async['updateContent'](_0x3f4fc2){await this['bodyView']['updateContentParts'](_0x3f4fc2);}['updateSources'](_0x5ee318){this['bodyView']['updateSources'](_0x5ee318);}['markAsDone'](){this['bodyView']['markAsDone'](),this['headerView']&&(this['headerView']['isShowChangesToggleVisible']=this['bodyView']['hasNonEmptyParts']);}}class AIChatFeedSuggestionItemView extends AIChatFeedItemView{['containerView'];constructor(_0x28c01f,_0x4624e2,_0xd10fd8){super(_0x4624e2),this['set']('isTrackChangesOn',!0x1),this['containerView']=new AISuggestionContainerView(_0x28c01f,{'showDiff':_0x4624e2['showDiff'],'areActionsDisabled':_0x4624e2['areActionsDisabled'],'availableActions':_0x4624e2['availableActions']},_0xd10fd8),this['containerView']['on']('toggleSuggestionDisplayMode',(_0x59b832,_0x3d52b1)=>{this['fire']('toggleSuggestionDisplayMode',{'replyId':this['options']['id'],'showDiff':_0x3d52b1['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',(_0x3f9f81,{index:_0x2fa10e})=>{this['fire']('showChangeInText',{'replyId':this['options']['id'],'partIndex':_0x2fa10e});}),this['containerView']['on']('applySuggestion',(_0x5c687a,{index:_0x43cd97}={})=>{this['fire']('applySuggestion',{'replyId':this['options']['id'],'partIndex':_0x43cd97});}),this['containerView']['on']('insertSuggestion',(_0x2ea5ce,{index:_0x5d3436}={})=>{this['fire']('insertSuggestion',{'replyId':this['options']['id'],'partIndex':_0x5d3436});}),this['containerView']['on']('rejectSuggestion',(_0x14f39f,{index:_0x3f537a})=>{this['fire']('rejectSuggestion',{'replyId':this['options']['id'],'partIndex':_0x3f537a});}),this['containerView']['on']('mouseOverSuggestion',(_0x23a85e,{index:_0x4e237a})=>{this['fire']('mouseOverSuggestion',{'replyId':this['options']['id'],'partIndex':_0x4e237a});}),this['containerView']['on']('mouseLeaveSuggestion',(_0xb650f7,{index:_0x38b976})=>{this['fire']('mouseLeaveSuggestion',{'replyId':this['options']['id'],'partIndex':_0x38b976});}),this['children']['addMany']([this['containerView']]),this['extendTemplate']({'attributes':{'class':['ck-ai-chat__feed__ai-suggestion']}});}async['updateContent'](_0x13fbbf){await this['containerView']['updateContent'](_0x13fbbf);}['updatePartState'](_0x417ec7,_0xe3a80e){this['containerView']['bodyView']['updatePartState'](_0x417ec7,_0xe3a80e);}['setPartActive'](_0x22107f,_0x4cff6){!0x1===_0x22107f?this['containerView']['bodyView']['setPartActive'](!0x1):this['containerView']['bodyView']['setPartActive'](_0x22107f,_0x4cff6);}['updateSources'](_0x1e7b65){this['containerView']['updateSources'](_0x1e7b65);}['getPartView'](_0x5588f4){return this['containerView']['bodyView']['getPartView'](_0x5588f4);}['markAsDone'](){super['markAsDone'](),this['containerView']['markAsDone']();}}class AIChatFeedReplyItemView extends AIChatFeedItemView{['replyContainer'];['_bodyCollection'];constructor(_0x4878a5,_0x4a17f2,_0x290b2b){super(_0x4a17f2),this['_bodyCollection']=_0x290b2b,this['locale']=_0x4878a5,this['extendTemplate']({'attributes':{'class':['ck-ai-chat__feed__ai-reply']}}),this['replyContainer']=new Nt(),this['replyContainer']['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset_all-excluded','ck-ai-chat__feed__ai-reply-container']}}),this['children']['add'](this['replyContainer']);}async['render'](){super['render'](),this['options']['initialContent']&&(await this['updateContent']({'parsedContent':Fi(this['options']['initialContent']),'renderingStrategy':'static'}),this['markAsDone']());}async['updateContent']({parsedContent:_0x513d4f,renderingStrategy:_0x4e190e,abortSignal:_0xcc6e4c}){'streaming'===_0x4e190e?await this['streamIntoElement'](_0x513d4f,this['replyContainer']['element'],_0xcc6e4c):this['replyContainer']['element']['innerHTML']=ti(_0x513d4f);}['updateSources'](_0x1555b2){const _0x280098=new AIWebSourcesView(this['locale'],this['_bodyCollection']);_0x280098['children']['addMany'](_0x1555b2['map'](_0x21aa62=>new AIWebSourceView(this['locale'],_0x21aa62,_0x280098['balloonPanelView']))),_0x280098['isVisible']=!0x0,this['children']['add'](_0x280098);}}class AISpinnerView extends yt{constructor(_0x34ee00=void 0x0){super();const _0x53ec65=_0x34ee00?'ck-ai-spinner_'+_0x34ee00:'';this['extendTemplate']({'tag':'span','attributes':{'class':['ck-ai-spinner',_0x53ec65]}});}}const Os={'file':_0x3194f3,'document':_0x51cd8b,'web-resource':_0x140843,'text':_0x3194f3,'selection':_0xe67e40,'mcp-tool-context':_0x51cd8b},ks='ck-ai-chat-context-chip',vs='ck-ai-chat-context-chip_wide',Ns='ck-ai-chat-context-chip_document',ys='ck-ai-chat-context-chip__label',xs='ck-ai-chat-context-chip__type-icon',Ls='ck-ai-chat-context-controls__chip-tooltip',Ds='n';class AIChatContextItemButtonView extends vt{constructor(_0x350ad8,_0x16b8d3,_0x231d6c,_0x44824d,_0x265cfa=!0x1){super(_0x350ad8),this['_isAnimationOnEnterEnabled']=_0x44824d,this['_initializeProperties'](_0x16b8d3,_0x231d6c,_0x265cfa),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'](_0x57e5ac,_0x3fa0de,_0x130d0b){this['set']('label',_0x57e5ac['label']),this['set']('tooltip',!0x0),this['set']('itemType',_0x57e5ac['type']),this['set']('id',_0x57e5ac['uiId']),this['set']('readonly',_0x3fa0de),this['set']('isLoading',_0x130d0b);}['_setupTemplate'](){const _0x52da13=this['_createIconView'](),_0x46d791=this['_createRemoveButton'](),_0x3a3c21=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':this['_createTemplateAttributes'](_0x3a3c21),'children':this['_createTemplateChildren'](_0x52da13,_0x46d791,_0x3a3c21)});}['_createTemplateAttributes'](_0x28b097){return{'class':[ks,_0x28b097['if']('itemType',Ns,_0x237ec0=>'document'==_0x237ec0),_0x28b097['if']('itemType',vs,_0x7de211=>'selection'==_0x7de211)],'data-cke-tooltip-text':_0x28b097['to']('label',Vs),'data-cke-tooltip-position':Ds,'data-cke-tooltip-class':Ls};}['_createTemplateChildren'](_0x5c3b25,_0x3cbef5,_0x56e79a){const _0x47b5cb=this['_createLabelElement'](_0x56e79a),_0x573b38=this['_createLoaderIcon']();return this['readonly']?[_0x5c3b25,_0x47b5cb]:[_0x5c3b25,_0x573b38,_0x47b5cb,_0x3cbef5];}['_createLabelElement'](_0x33e4c3){return{'tag':'span','attributes':{'class':ys},'children':[{'text':_0x33e4c3['to']('label')}]};}['_createRemoveButton'](){const _0x1622e1=new vt(this['locale']);return _0x1622e1['set']({'label':Hi(this['locale'],'AI_CHAT_CONTEXT_REMOVE_FROM_CONTEXT'),'icon':_0x189920}),this['_setupRemoveButtonEvent'](_0x1622e1),_0x1622e1;}['_setupRemoveButtonEvent'](_0x3d46e9){_0x3d46e9['on']('execute',()=>{this['fire']('removeContextItemChip',this['id']);});}['_createIconView'](){const _0x1b69c2=this['bindTemplate'],_0xf4bdd3=new xt();return _0xf4bdd3['content']=Os[this['itemType']],_0xf4bdd3['extendTemplate']({'attributes':{'class':[xs,_0x1b69c2['if']('isLoading','ck-hidden',_0x527207=>_0x527207)]}}),_0xf4bdd3;}['_handleAnimationEndOnce'](_0x1dd519,_0x41b7c1){if(!_0x1dd519)return;const _0x3a0cec=()=>{_0x41b7c1(),_0x1dd519['removeEventListener']('animationend',_0x3a0cec),_0x1dd519['removeEventListener']('webkitAnimationEnd',_0x3a0cec);};_0x1dd519['addEventListener']('animationend',_0x3a0cec),_0x1dd519['addEventListener']('webkitAnimationEnd',_0x3a0cec);}['_createLoaderIcon'](){const _0x5a6503=new AISpinnerView('small');return _0x5a6503['bind']('isVisible')['to'](this,'isLoading',_0x390f54=>_0x390f54),_0x5a6503;}}function Vs(_0x330097){if(!_0x330097)return _0x330097;if(_0x330097['length']<=0x78)return _0x330097;const _0x1c9d17=_0x330097['slice'](0x0,0x78),_0x5412a1=_0x1c9d17['lastIndexOf']('\x20');return(_0x5412a1>0x0?_0x1c9d17['slice'](0x0,_0x5412a1):_0x1c9d17)+'…';}const Ps={'maxVisibleRows':0x2,'rowDetectionTolerance':0x5,'showMoreLabelPrefix':'+\x20','viewportOffset':{'top':0x64,'bottom':0xa}},Hs='300px';class AIChatChipsOverflowManager{['_locale'];['_config'];['_visibleChips'];['_overflowChips'];['_showMoreButtonView']=null;['_showMoreBalloonPanelView']=null;['_containerElement']=null;['_bodyCollection'];['_parentView']=null;['_intersectionObserver']=null;['_pendingCalculation']=!0x1;constructor(_0x5664bc,_0x4ed0d8,_0x2747cb,_0x58185c,_0x28bd81){this['_locale']=_0x5664bc,this['_visibleChips']=_0x4ed0d8,this['_config']={...Ps,..._0x2747cb,'cssClasses':{'controlsButton':'','calculationContainer':'ck-calculation-container',..._0x2747cb['cssClasses']}},this['_overflowChips']=new dt(),this['_bodyCollection']=_0x58185c,this['_parentView']=_0x28bd81||null;}['setContainerElement'](_0x509c20){this['_intersectionObserver']&&(this['_intersectionObserver']['disconnect'](),this['_intersectionObserver']=null),this['_containerElement']=_0x509c20,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 _0x197441=[...this['_visibleChips'],...this['_overflowChips']],_0x5f0702=this['_createCalculationContainer'](),_0x26e865=this['_calculateOverflowInContainer'](_0x5f0702,_0x197441),_0x1c38bd=_0x5f0702['_ancestorsToRestore'];_0x1c38bd&&this['_restoreAncestorVisibility'](_0x1c38bd),_0x5f0702['remove'](),this['_applyOverflowResults'](_0x197441,_0x26e865);}['_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 _0xa30943=new vt(this['_locale']);_0xa30943['set']({'label':'','withText':!0x0,'isToggleable':!0x0});const _0x3014cc=[this['_config']['cssClasses']['showMoreButton']];return this['_config']['cssClasses']['controlsButton']&&_0x3014cc['push'](this['_config']['cssClasses']['controlsButton']),_0xa30943['extendTemplate']({'attributes':{'class':_0x3014cc}}),_0xa30943;}['_createShowMoreBalloonPanelView'](){const _0x171ba3=new Xt(this['_locale']);return _0x171ba3['extendTemplate']({'attributes':{'class':this['_config']['cssClasses']['showMoreBalloon']}}),this['_bodyCollection']['add'](_0x171ba3),_0x171ba3;}['_updateBalloonContent'](){if(this['_showMoreBalloonPanelView']&&(this['_showMoreBalloonPanelView']['content']['clear'](),this['_overflowChips']['length']>0x0)){this['_overflowChips']['forEach'](_0x3ba1b9=>{_0x3ba1b9['disableAnimationOnEnter']();});const _0x50fb33=new Nt(this['_locale']);_0x50fb33['setTemplate']({'tag':'div','attributes':{'class':this['_config']['cssClasses']['overflowContainer']},'children':this['_overflowChips']}),this['_showMoreBalloonPanelView']['content']['add'](_0x50fb33);}}['_handleShowMoreButtonClick'](){this['_showMoreButtonView']['isOn']?this['hideBalloonPanel']():this['showBalloonPanel']();}['_updateShowMoreButtonVisibility'](){const _0x3c8e16=this['_overflowChips']['length']>0x0;this['_showMoreButtonView']?.['element']&&(this['_showMoreButtonView']['element']['style']['display']=_0x3c8e16?'':'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'](_0x3457b4){const _0x1f4a7f=this['_containerElement']?.['tagName']['toLowerCase']()||'div',_0x2d5add=this['_containerElement']?.['classList'];if(_0x2d5add){const _0x7c1412=_0x2d5add[0x0]||'',_0x3d4d4d=_0x3457b4['querySelector']('.'+_0x7c1412),_0x5cd333=_0x3457b4['querySelector'](_0x1f4a7f);return _0x3d4d4d||_0x5cd333||_0x3457b4;}return _0x3457b4['querySelector'](_0x1f4a7f)||_0x3457b4;}['_calculateContainerWidth'](){const _0x57711e=this['_parentView']?.['element']||this['_containerElement'];if(!_0x57711e)return Hs;const _0x3ccfb4=window['getComputedStyle'](_0x57711e)['width'];if('auto'===_0x3ccfb4||'0px'===_0x3ccfb4||!_0x3ccfb4){const _0x1c721a=_0x57711e['parentElement'];if(_0x1c721a){const _0x3b6f79=window['getComputedStyle'](_0x1c721a);return'auto'!==_0x3b6f79['width']?_0x3b6f79['width']:Hs;}return Hs;}return _0x3ccfb4;}['_applyCalculationStyles'](_0x3f9d73,_0x5251a4){this['_config']['cssClasses']['calculationContainer']&&_0x3f9d73['classList']['add'](this['_config']['cssClasses']['calculationContainer']),_0x3f9d73['style']['width']=_0x5251a4,_0x3f9d73['style']['position']='absolute',_0x3f9d73['style']['top']='-9999px',_0x3f9d73['style']['left']='-9999px',_0x3f9d73['style']['opacity']='0',_0x3f9d73['style']['pointerEvents']='none',_0x3f9d73['style']['zIndex']='-1',_0x3f9d73['style']['visibility']='visible\x20!important',_0x3f9d73['style']['display']='block\x20!important',_0x3f9d73['style']['boxSizing']='border-box';}['_restoreAncestorVisibility'](_0x7fa893){_0x7fa893['forEach'](({element:_0x4528d4,originalDisplay:_0x5cdce2,originalVisibility:_0x11da01})=>{_0x4528d4['style']['display']=_0x5cdce2,_0x4528d4['style']['visibility']=_0x11da01;});}['_makeAncestorsVisible'](_0x26a455){const _0x17925f=[];let _0x1adc76=_0x26a455;for(;_0x1adc76&&_0x1adc76!==document['body'];){const _0x279ec0=window['getComputedStyle'](_0x1adc76);'none'!==_0x279ec0['display']&&'hidden'!==_0x279ec0['visibility']||(_0x17925f['push']({'element':_0x1adc76,'originalDisplay':_0x1adc76['style']['display'],'originalVisibility':_0x1adc76['style']['visibility']}),_0x1adc76['style']['display']='block',_0x1adc76['style']['visibility']='visible'),_0x1adc76=_0x1adc76['parentElement'];}return _0x17925f;}['_createContainerElements'](){let _0x34e59d,_0xe6445b;return this['_parentView']?.['element']?(_0x34e59d=this['_parentView']['element']['cloneNode'](!0x0),_0xe6445b=this['_findTargetContainer'](_0x34e59d)):(_0x34e59d=document['createElement']('div'),_0xe6445b=_0x34e59d),{'calculationContainer':_0x34e59d,'targetContainer':_0xe6445b};}['_createCalculationContainer'](){const {calculationContainer:_0x3e1a20,targetContainer:_0x17d91f}=this['_createContainerElements'](),_0x346eb5=this['_calculateContainerWidth']();this['_applyCalculationStyles'](_0x3e1a20,_0x346eb5);const _0x6c4c23=this['_parentView']?.['element']||this['_containerElement'],_0x282c69=_0x6c4c23?.['parentElement'];_0x282c69?_0x282c69['appendChild'](_0x3e1a20):document['body']['appendChild'](_0x3e1a20),_0x3e1a20['_targetContainer']=_0x17d91f;const _0x336b1e=this['_makeAncestorsVisible'](_0x282c69||null);return _0x3e1a20['offsetWidth'],_0x3e1a20['_ancestorsToRestore']=_0x336b1e,_0x3e1a20;}['_calculateOverflowInContainer'](_0x3340ca,_0x68674f){const _0xcc215e=_0x3340ca['_targetContainer']||_0x3340ca,_0x208c0a=[],{rowCount:_0x378439}=this['_renderChipsAndCountRows'](_0xcc215e,_0x68674f);if(_0x378439<=this['_config']['maxVisibleRows'])return _0x208c0a;const _0x56167b=_0x68674f['slice']();for(;_0x56167b['length']>0x0;){if(this['_testButtonFit'](_0x3340ca,_0xcc215e,_0x56167b)){const _0x1e799f=_0x68674f['filter'](_0x348a5b=>!_0x56167b['includes'](_0x348a5b));_0x208c0a['push'](..._0x1e799f);break;}if(!_0x56167b['pop']())break;}return _0x208c0a;}['_renderChipsAndCountRows'](_0x552b64,_0x347cd4){_0x552b64['innerHTML']='',_0x347cd4['forEach'](_0x17e274=>{if(_0x17e274['element']){const _0x2bcaf2=_0x17e274['element']['cloneNode'](!0x0);_0x552b64['appendChild'](_0x2bcaf2);}}),_0x552b64['offsetWidth'];const _0x85e136=_0x552b64['children'],_0x2ce05f=[];return Array['from'](_0x85e136)['forEach'](_0x84fd75=>{const _0x12c595=_0x84fd75['getBoundingClientRect']()['top'];_0x2ce05f['some'](_0x310970=>Math['abs'](_0x310970-_0x12c595)<this['_config']['rowDetectionTolerance'])||_0x2ce05f['push'](_0x12c595);}),{'rowCount':_0x2ce05f['length']};}['_createMockButton'](){const _0x3cc6ac=document['createElement']('button');return _0x3cc6ac['className']=this['_config']['cssClasses']['showMoreButton'],this['_config']['cssClasses']['controlsButton']&&_0x3cc6ac['classList']['add'](this['_config']['cssClasses']['controlsButton']),_0x3cc6ac['textContent']='+\x201',_0x3cc6ac;}['_testButtonFit'](_0x1170b,_0x12b096,_0x45752f){this['_renderChipsAndCountRows'](_0x12b096,_0x45752f);const _0x45911e=this['_createMockButton']();_0x1170b['appendChild'](_0x45911e),_0x1170b['offsetWidth'];const _0x5f481a=[..._0x12b096['children'],_0x45911e],_0x2689be=[];_0x5f481a['forEach'](_0x4d9293=>{const _0x4ee71f=_0x4d9293['getBoundingClientRect']()['top'];_0x2689be['some'](_0x172d39=>Math['abs'](_0x172d39-_0x4ee71f)<this['_config']['rowDetectionTolerance'])||_0x2689be['push'](_0x4ee71f);});const _0x7b7175=_0x2689be['length'];return _0x45911e['remove'](),_0x7b7175<=this['_config']['maxVisibleRows'];}['_distributeChips'](_0x1e61b0,_0x5ede50){this['_visibleChips']['clear'](),this['_overflowChips']['clear'](),_0x1e61b0['forEach'](_0x1fa9d6=>{_0x5ede50['includes'](_0x1fa9d6)?this['_overflowChips']['add'](_0x1fa9d6):this['_visibleChips']['add'](_0x1fa9d6);});}['_updateOverflowUI'](_0x5afe5b){if(_0x5afe5b>0x0&&!this['_showMoreButtonView']&&this['_createShowMoreButton'](),_0x5afe5b>0x0&&this['_showMoreButtonView']){const _0x50f5e7=''+this['_config']['showMoreLabelPrefix']+(_0x5afe5b<0x63?_0x5afe5b:'99');this['_showMoreButtonView']['label']=_0x50f5e7;}this['_updateBalloonContent'](),this['_updateShowMoreButtonVisibility'](),this['_repinBalloonPanel']();}['_applyOverflowResults'](_0x302671,_0x22f30e){this['_distributeChips'](_0x302671,_0x22f30e),this['_updateOverflowUI'](_0x22f30e['length']);}['_setupVisibilityObserver'](){this['_containerElement']&&'undefined'!=typeof IntersectionObserver&&(this['_intersectionObserver']=new IntersectionObserver(_0x1565f3=>{_0x1565f3[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 _0x4deef0=this['_containerElement']['getBoundingClientRect']();if(0x0===_0x4deef0['width']||0x0===_0x4deef0['height'])return!0x1;const _0x4fae22=window['innerHeight']||document['documentElement']['clientHeight'],_0x40435d=window['innerWidth']||document['documentElement']['clientWidth'],_0x39bc10=0xc8;return _0x4deef0['bottom']>=-0xc8&&_0x4deef0['top']<=_0x4fae22+_0x39bc10&&_0x4deef0['right']>=-0xc8&&_0x4deef0['left']<=_0x40435d+_0x39bc10;}}const Ms='ck-ai-chat__feed__context-chips',Us='ck-ai-chat-context-chips-wrapper',Bs='ck-ai-chat-context-chips-wrapper-balloon',Gs='ck-ai-chat-controls-button',Fs='ck-ai-chat-controls_context_show-more-button',Ks='ck-ai-chat-context-controls__show-more-balloon-panel';class AIChatFeedContextChipsView extends Nt{['_contextChips']=this['createCollection']();['_overflowManager'];['_bodyCollection'];constructor(_0xb083a2,_0xf0d8c6,_0xfff9b9){super(_0xb083a2),this['_bodyCollection']=_0xfff9b9,this['_createContextChips'](_0xf0d8c6);const _0x25eac9={'cssClasses':{'showMoreButton':Fs+'\x20'+Bi,'showMoreBalloon':Ks,'overflowContainer':Bs,'controlsButton':Gs}};this['_overflowManager']=new AIChatChipsOverflowManager(_0xb083a2,this['_contextChips'],_0x25eac9,this['_bodyCollection'],this),this['setTemplate']({'tag':'div','attributes':{'class':[Ms,'ck','ck-reset_all']},'children':[{'tag':'div','attributes':{'class':Us},'children':this['_contextChips']}]});}['render'](){super['render']();const _0x1be9af=this['element']['querySelector']('.'+Us);_0x1be9af&&(this['_overflowManager']['setContainerElement'](_0x1be9af),this['_overflowManager']['reorganizeChips']());}['destroy'](){super['destroy'](),this['_overflowManager']['destroy']();}['_createContextChips'](_0x210f4a){for(const _0x110ab8 of _0x210f4a){const _0x39e5e9=new AIChatContextItemButtonView(this['locale'],_0x110ab8,!0x0,!0x1);this['_contextChips']['add'](_0x39e5e9);}}}class AIChatFeedUserMessageItemView extends AIChatFeedItemView{['_contextChipsView']=null;['_locale'];['_bodyCollection'];['_messageContentView'];constructor(_0x308d69,_0x1be2d1,_0x7a2e37){super(_0x1be2d1),this['_locale']=_0x308d69,this['_bodyCollection']=_0x7a2e37,this['_createContextChipsView'](),this['_createMessageContentView'](),this['extendTemplate']({'attributes':{'class':['ck-ai-chat__feed__user-message']}});}['_createContextChipsView'](){this['options']['contextItems']&&this['options']['contextItems']['length']>0x0&&(this['_contextChipsView']=new AIChatFeedContextChipsView(this['_locale'],this['options']['contextItems']['filter'](_0x5197e3=>!_0x5197e3['hidden']),this['_bodyCollection']),this['_contextChipsView']['extendTemplate']({'attributes':{'class':'ck-ai-chat__feed__context-chips'}}),this['children']['add'](this['_contextChipsView']));}['_createMessageContentView'](){this['_messageContentView']=new Nt(this['_locale']),this['_messageContentView']['setTemplate']({'tag':'div','attributes':{'class':'ck-ai-chat__feed__message-content'}}),this['children']['add'](this['_messageContentView']);}['render'](){super['render'](),this['_messageContentView']['element']['innerHTML']=this['options']['initialContent'],this['markAsDone']();}}class AIChatFeedInteractionHeaderView extends AIChatFeedItemView{['capabilities'];constructor(_0x2a97a8,_0x3530f3){super(_0x3530f3);const {isWebSearchEnabled:_0x19f1c5,isReasoningEnabled:_0xb89fea}=_0x3530f3['capabilities'],_0x590884=[];let _0x4c4468='';_0x19f1c5&&_0xb89fea?(_0x4c4468=Hi(_0x2a97a8,'AI_CHAT_FEED_REPLY_ITEM_USED_WEB_SEARCH_REASONING'),_0x590884['push'](Ws(_0x1d0469)),_0x590884['push'](Ws(_0x3ee979))):_0x19f1c5?(_0x4c4468=Hi(_0x2a97a8,'AI_CHAT_FEED_REPLY_ITEM_USED_WEB_SEARCH'),_0x590884['push'](Ws(_0x1d0469))):_0xb89fea&&(_0x4c4468=Hi(_0x2a97a8,'AI_CHAT_FEED_REPLY_ITEM_USED_REASONING'),_0x590884['push'](Ws(_0x3ee979))),this['extendTemplate']({'attributes':{'class':['ck-ai-chat__feed__interaction-header',_0x4c4468?'':'ck-hidden']}});const _0x4e8e13=new Nt();_0x4e8e13['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed__interaction-header__capabilities']},'children':[..._0x590884,{'tag':'span','attributes':{'class':['ck-ai-chat__feed__interaction-header__capabilities__text']},'children':[_0x4c4468]}]}),this['children']['add'](_0x4e8e13),this['capabilities']=_0x3530f3['capabilities'];}}function Ws(_0xd73b50){const _0x5b2d7e=new xt();return _0x5b2d7e['content']=_0xd73b50,_0x5b2d7e;}const Ys=['wheel','touchstart','pointerdown','keydown'],$s=['ArrowUp','ArrowDown','PageUp','PageDown','Home','End','\x20'];class ScrollManager{['element'];['animationFrameId'];['isRunning'];['abortController'];['isUserPaused'];['scrollBehavior'];constructor(_0x3b7a78){this['element']=_0x3b7a78,this['animationFrameId']=null,this['isRunning']=!0x1,this['abortController']=new AbortController(),this['isUserPaused']=!0x1,this['scrollBehavior']='smooth';for(const _0x12f87e of Ys){const _0x5ed850='keydown'!==_0x12f87e;this['element']['addEventListener'](_0x12f87e,this['_onUserEvent']['bind'](this),{'passive':_0x5ed850,'signal':this['abortController']['signal']});}}['start']({smooth:_0x36586b=!0x0}={}){this['isRunning']||(this['isRunning']=!0x0,this['isUserPaused']=!0x1,this['scrollBehavior']=_0x36586b?'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'](_0x436501){if(this['isRunning']){if('keydown'===_0x436501['type']){const _0x4736df=_0x436501['key'];if(!$s['includes'](_0x4736df))return;}_0x436501 instanceof WheelEvent?_0x436501['deltaY']<0x0?this['isUserPaused']=!0x0:this['isUserPaused']=!this['_isAtBottom']():this['isUserPaused']=!0x0;}}['_isAtBottom'](){const {scrollTop:_0x1ae79b,scrollHeight:_0x1ed401,clientHeight:_0x37441a}=this['element'];return _0x1ed401-_0x1ae79b-_0x37441a<=0x5;}['_rafUpdate'](){this['isRunning']&&(this['isUserPaused']||this['element']['scrollTo']({'top':this['element']['scrollHeight'],'behavior':this['scrollBehavior']}),this['animationFrameId']=requestAnimationFrame(this['_rafUpdate']['bind'](this)));}}class AIChatFeedCustomElementView extends AIChatFeedItemView{constructor(_0x964101){super(_0x964101),this['extendTemplate']({'attributes':{'class':['ck-ai-chat__feed__custom-element']}});}async['render'](){super['render'](),'string'==typeof this['options']['content']?this['element']['innerHTML']=this['options']['content']:this['element']['appendChild'](this['options']['content']);}}class AIChatFeedView extends Nt{['children'];['scrollManager'];['_bodyCollection'];constructor(_0x38fc24,_0x205e40){super(_0x38fc24),this['_bodyCollection']=_0x205e40,this['set']('loadingMessage',''),this['set']('isLoadingSkeletonVisible',!0x1),this['set']('isTrackChangesOn',!0x1),this['children']=this['createCollection'](),this['children']['delegate'](...ms)['to'](this),this['_setupTemplate']();}['render'](){super['render'](),this['scrollManager']=new ScrollManager(this['element']);}['destroy'](){super['destroy'](),this['scrollManager']['destroy']();}['clear'](){this['children']['clear']();}['addItem'](_0x445a50,_0x3ba367){let _0x5981eb;return'ai-reply'===_0x445a50?_0x5981eb=new AIChatFeedReplyItemView(this['locale'],_0x3ba367,this['_bodyCollection']):'ai-suggestion-reply'===_0x445a50?(_0x5981eb=new AIChatFeedSuggestionItemView(this['locale'],_0x3ba367,this['_bodyCollection']),_0x5981eb['bind']('isTrackChangesOn')['to'](this)):_0x5981eb='user-message'===_0x445a50?new AIChatFeedUserMessageItemView(this['locale'],_0x3ba367,this['_bodyCollection']):'interaction-header'===_0x445a50?new AIChatFeedInteractionHeaderView(this['locale'],_0x3ba367):'custom-element'===_0x445a50?new AIChatFeedCustomElementView(_0x3ba367):new AIChatFeedErrorItemView(_0x3ba367),this['children']['add'](_0x5981eb),_0x5981eb;}async['updateReplyItem']({id:_0x3b3a42,parsedContent:_0x22f062,renderingStrategy:_0x5bb5dd,abortSignal:_0x469795}){const _0x3c5431=this['getItemById'](_0x3b3a42);if(!(_0x3c5431 instanceof AIChatFeedReplyItemView))throw new at('ai-chat-feed-view-item-not-a-reply-item',null,{'itemView':_0x3c5431,'id':_0x3b3a42,'parsedContent':_0x22f062});await _0x3c5431['updateContent']({'parsedContent':_0x22f062,'renderingStrategy':_0x5bb5dd,'abortSignal':_0x469795});}async['updateWebSources'](_0x45cfbe,_0x453442){const _0x367159=this['getItemById'](_0x45cfbe);if(_0x367159 instanceof AIChatFeedSuggestionItemView)_0x367159['updateSources'](_0x453442);else{if(!(_0x367159 instanceof AIChatFeedReplyItemView))throw new at('ai-chat-feed-view-item-not-a-suggestion-or-reply-item',null,{'itemView':_0x367159,'id':_0x45cfbe,'sources':_0x453442});_0x367159['updateSources'](_0x453442);}}async['updateSuggestionItem']({id:_0x5d2850,parts:_0x1976de,abortSignal:_0x32e378,skipLoadingEffects:_0x6c1297}){const _0x590b7a=this['getItemById'](_0x5d2850);if(!(_0x590b7a instanceof AIChatFeedSuggestionItemView))throw new at('ai-chat-feed-view-item-not-a-suggestion-item',null,{'itemView':_0x590b7a,'id':_0x5d2850,'parts':_0x1976de});await _0x590b7a['updateContent']({'parts':_0x1976de,'abortSignal':_0x32e378,'skipLoadingEffects':_0x6c1297});}['updateSuggestionPartState']({id:_0x4d79c4,index:_0xf34af6,state:_0x5ab5b8}){const _0x56bdfb=this['getItemById'](_0x4d79c4);if(!(_0x56bdfb instanceof AIChatFeedSuggestionItemView))throw new at('ai-chat-feed-view-item-not-a-suggestion-item',this,{'id':_0x4d79c4});_0x56bdfb['updatePartState'](_0xf34af6,_0x5ab5b8);}['setSuggestionPartActive']({id:_0x5ee8ba,index:_0x6af16f,isActive:_0x227535}){const _0x51c9b1=this['getItemById'](_0x5ee8ba);if(!(_0x51c9b1 instanceof AIChatFeedSuggestionItemView))throw new at('ai-chat-feed-view-item-not-a-suggestion-item',this,{'id':_0x5ee8ba});this['children']['filter'](_0x5c63b6=>_0x5c63b6 instanceof AIChatFeedSuggestionItemView)['forEach'](_0x495fb3=>{_0x495fb3['setPartActive'](!0x1);}),_0x51c9b1['setPartActive'](_0x6af16f,_0x227535);}['markItemAsDone'](_0x3b671a){this['getItemById'](_0x3b671a)['markAsDone']();}['getItemIds'](){return this['children']['map'](_0x203a2e=>_0x203a2e['options']['id']);}['removeItem'](_0x14e048){this['children']['remove'](this['getItemById'](_0x14e048));}['hasItem'](_0x1a68e9){return!!this['children']['find'](_0x325bd1=>_0x325bd1['options']['id']['includes'](_0x1a68e9));}['scrollToSuggestion'](_0x12ec4c,_0x5b818e){const _0x1eebfe=this['getItemById'](_0x12ec4c);if(!(_0x1eebfe instanceof AIChatFeedSuggestionItemView))return void gt('ck-ai-chat-feed-view-scroll-to-suggestion-invalid-item',{'replyId':_0x12ec4c,'partIndex':_0x5b818e});const _0x1c64ef=_0x1eebfe['getPartView'](_0x5b818e);_0x1c64ef?ft(_0x1c64ef['element'],0x14,this['element']['parentElement'],!0x0,!0x0):gt('ck-ai-chat-feed-view-scroll-to-suggestion-part-view-not-found',{'replyId':_0x12ec4c,'partIndex':_0x5b818e});}['_setupTemplate'](){this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed']},'children':this['_createTemplateChildren']()});}['_createTemplateChildren'](){const _0x1c2132=this['_createSkeletonLoader']();return[this['_createFeedItems'](),_0x1c2132,this['_createFeedLoader']()];}['_createSkeletonLoader'](){const _0xd7cfe=new AISkeletonView(this['locale'],Ss['aiFeed']);return _0xd7cfe['bind']('isVisible')['to'](this,'isLoadingSkeletonVisible'),_0xd7cfe;}['_createFeedItems'](){const _0x49ac00=new Nt(this['locale']);return _0x49ac00['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed__items',this['bindTemplate']['if']('isLoadingSkeletonVisible','ck-hidden')]},'children':this['children']}),_0x49ac00;}['_createFeedLoader'](){const _0x20beaa=new Nt(this['locale']);return _0x20beaa['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__loader',this['bindTemplate']['if']('loadingMessage','ck-hidden',_0x299599=>!_0x299599)]},'children':this['_createLoaderChildren']()}),_0x20beaa;}['_createLoaderChildren'](){const _0x38d665=new AISpinnerView();return _0x38d665['isVisible']=!0x0,[_0x38d665,{'tag':'span','attributes':{'class':['ck','ck-ai-chat__loader-text']},'children':[{'text':this['bindTemplate']['to']('loadingMessage')}]}];}['getItemById'](_0x171e72){const _0x53b1d7=this['children']['find'](_0x3a22c4=>_0x3a22c4['options']['id']['includes'](_0x171e72));if(!_0x53b1d7)throw new at('ai-chat-feed-view-item-not-found',this,{'id':_0x171e72});return _0x53b1d7;}['setLoadingMessage'](_0x5bc1ee){this['set']('loadingMessage',_0x5bc1ee);}['toggleLoadingSkeleton'](_0x6153f5){this['set']('isLoadingSkeletonVisible',_0x6153f5);}['startAutoScroll'](_0x33f7c2={}){this['scrollManager']['start'](_0x33f7c2);}['stopAutoScroll'](){this['scrollManager']['stop']();}}class AIChatPromptSuggestionsListView extends Dt{['filter'](){let _0x3f41cc=0x0;for(const _0x48d2a0 of this['items'])_0x3f41cc+=_0x48d2a0['items']['length'];return{'resultsCount':_0x3f41cc,'totalItemsCount':_0x3f41cc};}}const qs='ck-ai-chat__prompt-input_highlighted';class AIChatPromptInputView extends Lt{['submitButtonView'];static ['MIN_ROWS']=0x1;static ['MAX_ROWS']=0xc;['_addContextButtonView'];['_queryViewResizeObserver'];constructor(_0x14b0ac,_0x2321ee){super(_0x14b0ac,{'queryView':{'label':'','creator':Ut,'showIcon':!0x1,'showResetButton':!0x1},'filteredView':new AIChatPromptSuggestionsListView(_0x14b0ac),'queryMinChars':0x1/0x0,'resetOnBlur':!0x1}),this['set']('isEmpty',!0x0),this['set']('isUploadInProgress',!0x1),this['_addContextButtonView']=_0x2321ee,this['_queryViewResizeObserver']=null,this['queryView']['fieldView']['minRows']=AIChatPromptInputView['MIN_ROWS'],this['queryView']['fieldView']['maxRows']=AIChatPromptInputView['MAX_ROWS'],this['queryView']['fieldWrapperChildren']['add'](this['_addContextButtonView']),this['_setUpAddContextButtonPositioning'](),this['extendTemplate']({'attributes':{'class':['ck','ck-ai-chat__prompt-input']}}),this['submitButtonView']=this['_createSubmitButton'](),this['submitButtonView']['bind']('isEnabled')['to'](this,'isEmpty',this,'isUploadInProgress',(_0x54cba3,_0x1ee087)=>!_0x54cba3&&!_0x1ee087),this['focusableChildren']['add'](this['submitButtonView']);}['render'](){super['render'](),this['queryView']['fieldWrapperChildren']['add'](this['submitButtonView']),this['keystrokes']['set']('enter',(_0x48d778,_0x5572ff)=>{this['isUploadInProgress']||this['isEmpty']||_0x48d778['target']==this['queryView']['fieldView']['element']&&(this['submit'](),_0x5572ff());}),this['queryView']['fieldView']['on']('update',()=>{this['isEmpty']=''===this['queryView']['fieldView']['element']['value']?.['trim']();});}['destroy'](){super['destroy'](),this['_queryViewResizeObserver']&&this['_queryViewResizeObserver']['destroy']();}['submit'](){const _0x51c05a=this['queryView']['fieldView']['element']['value']?.['trim']();if(!_0x51c05a)return this['queryView']['errorText']=Hi(this['locale'],'AI_CHAT_PROMPT_EMPTY_ERROR'),void(this['queryView']['fieldView']['hasError']=!0x0);this['queryView']['fieldView']['hasError']=!0x1;const _0x15ac22=_0x292a51(_0x51c05a);this['fire']('sendUserMessage',_0x15ac22),this['queryView']['fieldView']['reset']();}['setPlaceholderText'](_0x4c7b68){this['queryView']['fieldView']['set']('placeholder',_0x4c7b68);}['focus'](_0xe4385a=!0x1){super['focus'](),_0xe4385a&&(this['element']['classList']['contains'](qs)||(this['element']['classList']['add'](qs),setTimeout(()=>{this['element']['classList']['remove'](qs);},0x320)));}['_createSubmitButton'](){const _0x1f5904=new vt(this['locale']);return _0x1f5904['set']({'icon':_0x26a258,'label':Hi(this['locale'],'AI_CHAT_LABEL_SUBMIT'),'isVisible':!0x0,'tooltip':!0x0,'class':'ck-ai-chat__prompt-submit-button\x20'+Mi,'isEnabled':!0x1}),_0x1f5904['on']('execute',()=>{this['submit']();}),_0x1f5904;}['setIsUploadInProgress'](_0x8e106b){this['isUploadInProgress']=_0x8e106b;}['_setUpAddContextButtonPositioning'](){const _0x4d0d15=this['locale'],_0x2d888a=()=>{ct['window']['requestAnimationFrame'](()=>{if(lt(this['element'])){const _0x14aa92=new ut(this['queryView']['fieldView']['element']),_0x2301ea=new ut(this['_addContextButtonView']['element']),_0x5b083a=_0x14aa92['width'],_0x1be08b='rtl'===_0x4d0d15['uiLanguageDirection']?'right':'left';_0x14aa92['excludeScrollbarsAndBorders']();const _0x220600=_0x5b083a-_0x14aa92['width']+0x1;this['_addContextButtonView']['element']['style'][_0x1be08b]='calc('+(_0x5b083a-_0x2301ea['width']-_0x220600)+'px\x20-\x20var(--ck-spacing-tiny))';}});};this['queryView']['fieldView']['on']('update',_0x2d888a),this['on']('render',()=>{_0x2d888a(),this['_queryViewResizeObserver']=new St(this['queryView']['fieldView']['element'],()=>{_0x2d888a();});});}}const Qs='ck-ai-chat__prompt-capabilities',Xs='ck-ai-chat-controls-button',zs='ck-ai-chat-controls-button--commands',js='ck-ai-chat-controls__model-selection',Js='ck-ai-chat-controls__model-selection__item-name',Zs='ck-ai-chat-controls__model-selection__item-description',tn='ck-ai-chat-controls__model-selection__item-capabilities',en='n';class AIChatPromptCapabilitiesView extends Nt{['_webSearchButton'];['_reasoningButton'];['_commandsButton'];['_modelSelectionDropdown'];['_modelSelectionDropdownItems'];['_modelNameView'];constructor(_0x55be08){super(_0x55be08),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',_0x17adef=>'selector'===_0x17adef),this['_modelSelectionDropdown']['buttonView']['bind']('tooltip')['to'](this,'modelSelectorEnabled',_0x534f16=>_0x534f16?this['_modelSelectionDropdown']['buttonView']['label']:Hi(this['locale'],'AI_CHAT_MODEL_SELECTOR_DISABLED_TOOLTIP')),this['_modelSelectionDropdown']['bind']('isEnabled')['to'](this,'modelSelectorEnabled',_0x452deb=>_0x452deb),this['_webSearchButton']['bind']('isOn')['to'](this,'webSearchActive',_0x58e3e5=>_0x58e3e5),this['_webSearchButton']['bind']('tooltip')['to'](this,'webSearchActive',_0x29de12=>Hi(this['locale'],_0x29de12?'AI_CHAT_DISABLE_WEB_SEARCH':'AI_CHAT_ENABLE_WEB_SEARCH')),this['_reasoningButton']['bind']('isOn')['to'](this,'reasoningActive',_0x23fde4=>_0x23fde4),this['_reasoningButton']['bind']('tooltip')['to'](this,'reasoningActive',_0x5367d1=>Hi(this['locale'],_0x5367d1?'AI_CHAT_DISABLE_REASONING':'AI_CHAT_ENABLE_REASONING')),this['setTemplate']({'tag':'div','attributes':{'class':[Qs]},'children':[this['_modelSelectionDropdown'],this['_modelNameView'],this['_webSearchButton'],this['_reasoningButton'],this['_commandsButton']]}),this['_modelSelectionDropdownItems']=new dt(),jt(this['_modelSelectionDropdown'],this['_modelSelectionDropdownItems']);}['setModelList'](_0x34ae23,_0x4eeea6){if(_0x4eeea6)this['set']('modelDisplayMode','hidden');else{const _0x29a85c=0x1===_0x34ae23['length'];this['set']('modelDisplayMode',_0x29a85c?'name':'selector');}if(this['_modelSelectionDropdownItems']['clear'](),_0x34ae23?.['length'])for(const _0x1c4b18 of _0x34ae23){const _0x49c76e=new Jt({'label':_0x1c4b18['name'],'withText':!0x0,'role':'menuitemradio','id':_0x1c4b18['id'],'model':_0x1c4b18});_0x49c76e['bind']('isOn')['to'](this,'activeModelId',_0x11492e=>_0x11492e===_0x1c4b18['id']),this['_modelSelectionDropdownItems']['add']({'type':'button','model':_0x49c76e,'labelView':new sn(this['locale'],_0x1c4b18)});}}['setWebSearch'](_0x3c1dff){this['set']('webSearchActive',_0x3c1dff);}['setReasoning'](_0x1ccf3c){this['set']('reasoningActive',_0x1ccf3c);}['setModel'](_0x33ef1c){if(!_0x33ef1c)return;this['activeModelId']=_0x33ef1c['id'],this['activeModelName']=_0x33ef1c['name']||_0x33ef1c['id'],this['_modelSelectionDropdown']['buttonView']['set']('label',_0x33ef1c['name']),this['_modelSelectionDropdown']['buttonView']['set']('tooltip',_0x33ef1c['name']);const _0x4cee92=_0x33ef1c['capabilities']['webSearch']?.['enabled']??!0x1;this['set']('webSearchActive',!0x1),this['_webSearchButton']['set']('isOn',!0x1),this['_webSearchButton']['set']('isEnabled',_0x4cee92),this['_webSearchButton']['set']('isVisible',_0x4cee92);const _0x58ecee=_0x33ef1c['capabilities']['reasoning']?.['enabled']??!0x1;this['set']('reasoningActive',!0x1),this['_reasoningButton']['set']('isOn',!0x1),this['_reasoningButton']['set']('isEnabled',_0x58ecee),this['_reasoningButton']['set']('isVisible',_0x58ecee);}['enableModelSelector'](){this['set']('modelSelectorEnabled',!0x0);}['disableModelSelector'](_0x329153){this['set']('modelSelectorEnabled',!0x1),_0x329153&&this['set']('modelDisplayMode','hidden');}['_createWebSearchButton'](){const _0x4aa08b=new vt();return _0x4aa08b['set']({'label':Hi(this['locale'],'AI_CHAT_SEARCH_WEB'),'icon':_0x1d0469,'class':Xs+'\x20'+Bi,'isToggleable':!0x0,'tooltipPosition':en}),_0x4aa08b['on']('execute',()=>{this['fire']('toggleWebSearch');}),_0x4aa08b;}['_createReasoningButton'](){const _0x18e412=new vt();return _0x18e412['set']({'label':Hi(this['locale'],'AI_CHAT_REASONING'),'icon':_0x3ee979,'class':Xs+'\x20'+Bi,'isToggleable':!0x0,'tooltipPosition':en}),_0x18e412['on']('execute',()=>{this['fire']('toggleReasoning');}),_0x18e412;}['_createCommandsButton'](){const _0x39ace7=new vt();return _0x39ace7['set']({'label':Hi(this['locale'],'AI_CHAT_COMMANDS'),'icon':_0x48e0c5,'withText':!0x0,'class':Xs+'\x20'+Bi,'isToggleable':!0x0,'tooltip':Hi(this['locale'],'AI_CHAT_COMMANDS'),'tooltipPosition':en}),_0x39ace7['extendTemplate']({'attributes':{'class':[zs]}}),_0x39ace7['on']('execute',()=>{console['log']('Commands\x20are\x20not\x20implemented\x20yet.'),alert('Commands\x20are\x20not\x20implemented\x20yet.');}),_0x39ace7;}['_createModelSelectionDropdown'](){const _0x586182=Gt(this['locale']);return _0x586182['set']({'panelPosition':'ne','class':[js]}),_0x586182['buttonView']['set']({'label':Hi(this['locale'],'AI_CHAT_MODEL_SELECTOR_ENABLED_TOOLTIP'),'withText':!0x0,'tooltip':!0x0,'tooltipPosition':en,'class':Bi}),this['listenTo'](_0x586182,'execute',_0x487514=>{this['fire']('selectModel',_0x487514['source']['model']);}),_0x586182;}['_createModelNameView'](){const _0x215053=new nn(this['locale']);return _0x215053['bind']('text')['to'](this,'activeModelName',_0x1ba16f=>_0x1ba16f??''),_0x215053['bind']('isVisible')['to'](this,'modelDisplayMode',_0x239e7a=>'name'===_0x239e7a),_0x215053;}}let sn=class ModelButtonLabelView extends Ht{constructor(_0x1819c2,_0x3492dc){super();const _0x5ae14c=this['bindTemplate'],_0x529f1f=this['createCollection']();this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-button__label'],'style':_0x5ae14c['to']('style'),'id':_0x5ae14c['to']('id')},'children':[{'tag':'div','attributes':{'class':[Js]},'children':[{'text':_0x5ae14c['to']('text')}]},{'tag':'div','attributes':{'class':[Zs]},'children':[{'tag':'span','children':[{'text':_0x3492dc['description']}]}]},{'tag':'div','attributes':{'class':[tn]},'children':_0x529f1f}]}),_0x529f1f['addMany'](this['_getCapabilityParts'](_0x1819c2,_0x1d0469,'AI_CHAT_SEARCH_WEB',_0x3492dc['capabilities']['webSearch']?.['enabled']??!0x1)),_0x529f1f['addMany'](this['_getCapabilityParts'](_0x1819c2,_0x3ee979,'AI_CHAT_REASONING',_0x3492dc['capabilities']['reasoning']?.['enabled']??!0x1));}['_getCapabilityParts'](_0x2a1bd6,_0x31a5b5,_0x18d7de,_0x50976a){const _0x3be78a=new xt();_0x3be78a['content']=_0x31a5b5;const _0x3e18b6=new Nt(_0x2a1bd6);_0x3e18b6['setTemplate']({'tag':'span','children':[{'text':Hi(_0x2a1bd6,_0x18d7de)+':\x20'}]});const _0x24e127=new Nt(_0x2a1bd6);return _0x24e127['setTemplate']({'tag':'span','children':[{'text':Hi(_0x2a1bd6,_0x50976a?'AI_CHAT_CAPABILITIES_YES':'AI_CHAT_CAPABILITIES_NO')}]}),[_0x3be78a,_0x3e18b6,_0x24e127];}},nn=class ModelNameView extends Nt{constructor(_0x218a54){super(_0x218a54),this['set']('text',void 0x0),this['set']('isVisible',!0x0);const _0x2f03f7=this['bindTemplate'];this['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai-chat-controls__model-name',_0x2f03f7['if']('isVisible','ck-hidden',_0x17a269=>!_0x17a269)]},'children':[{'text':_0x2f03f7['to']('text')}]});}};const rn='ck-ai-chat-context-controls__url-form',on='ck-ai-chat-context-controls__url-input-section';class AIChatContextPanelUrlInputView extends Nt{['focusTracker'];['keystrokes'];['_focusables'];['focusCycler'];['urlInputField'];['backButton'];['confirmButton'];constructor(_0x592a49){super(_0x592a49),this['focusTracker']=new _t(),this['keystrokes']=new It(),this['backButton']=this['_createBackButton'](),this['urlInputField']=this['_createUrlInputField'](),this['confirmButton']=this['_createConfirmButton'](),this['_focusables']=this['createCollection']([this['backButton'],this['urlInputField'],this['confirmButton']]),this['focusCycler']=new Mt({'focusables':this['_focusables'],'focusTracker':this['focusTracker'],'keystrokeHandler':this['keystrokes'],'actions':{'focusPrevious':'shift+tab','focusNext':'tab'}}),this['set']('withBackButton',!0x0),this['_setupTemplate'](),this['_setupEventHandlers'](),this['_setupKeystrokes']();}['render'](){super['render'](),this['_focusables']['forEach'](_0xabf10c=>{this['focusTracker']['add'](_0xabf10c['element']),this['keystrokes']['listenTo'](_0xabf10c['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'](_0x1cc902){this['urlInputField']['errorText']=_0x1cc902,this['_updateConfirmButtonState'](),this['fire']('refreshBalloon');}['clearError'](){this['urlInputField']['errorText']=null,this['_updateConfirmButtonState']();}['_createBackButton'](){const _0x300c27=new vt(this['locale']);return _0x300c27['set']({'icon':_0x591ef7,'tooltip':Hi(this['locale'],'AI_CHAT_CONTEXT_URL_BACK_TO_CONTEXT'),'tooltipPosition':'n','class':['ck-button-icon\x20ck-button-back']}),this['on']('change:withBackButton',(_0x28b004,_0x1465d7,_0x11eff2)=>{_0x300c27['set']({'class':['ck-button-icon\x20ck-button-back'+(_0x11eff2?'':'\x20ck-hidden')]});}),_0x300c27;}['_createUrlInputField'](){const _0x301821=new te(this['locale'],_0x2934f1);return _0x301821['set']({'label':Hi(this['locale'],'AI_CHAT_CONTEXT_URL_LABEL'),'class':'ck-labeled-field-view_empty'}),_0x301821['fieldView']['set']({'placeholder':Hi(this['locale'],'AI_CHAT_CONTEXT_URL_PLACEHOLDER')}),_0x301821;}['_createConfirmButton'](){const _0xe5f798=new vt(this['locale']);return _0xe5f798['set']({'icon':_0xfcbf97,'tooltip':Hi(this['locale'],'AI_CHAT_CONTEXT_URL_ADD_URL'),'tooltipPosition':'n','class':'ck-button-icon','type':'submit','isEnabled':!0x1}),_0xe5f798;}['_setupTemplate'](){const _0x3a0aa5=new _0x3b3599(this['locale'],{'label':Hi(this['locale'],'AI_CHAT_CONTEXT_URL_ADD_URL'),'class':'ck-ai-header\x20ck-ai-header_small\x20ck-ai-header_context-url'});_0x3a0aa5['children']['add'](this['backButton'],0x0),this['setTemplate']({'tag':'form','attributes':{'class':rn,'tabindex':'-1'},'children':[_0x3a0aa5,{'tag':'div','attributes':{'class':on},'children':[this['urlInputField'],this['confirmButton']]}]});}['_setupEventHandlers'](){this['backButton']['on']('execute',()=>{this['clear'](),this['fire']('cancel');}),this['urlInputField']['fieldView']['on']('input',()=>{this['clearError'](),this['_updateConfirmButtonState'](),this['fire']('refreshBalloon');}),this['on']('submit',_0x1c9966=>{_0x1c9966['stop'](),this['_handleSubmit']();});}['_setupKeystrokes'](){this['keystrokes']['set']('esc',(_0x30803e,_0x36f900)=>{this['clear'](),this['fire']('cancel'),_0x36f900();});}['_handleSubmit'](){const _0x33c882=this['getValue']()['trim']();_0x33c882?this['_isValidUrl'](_0x33c882)?(this['clearError'](),this['fire']('submitUrl',_0x33c882)):this['setError'](Hi(this['locale'],'AI_CHAT_CONTEXT_URL_INVALID_ERROR')):this['setError'](Hi(this['locale'],'AI_CHAT_CONTEXT_URL_EMPTY_ERROR'));}['_updateConfirmButtonState'](){const _0x58a09f=this['getValue']()['trim'](),_0x33e9e7=!!this['urlInputField']['errorText'];this['confirmButton']['isEnabled']=_0x58a09f['length']>0x0&&!_0x33e9e7;}['_isValidUrl'](_0x41744c){try{return!!new URL(_0x41744c);}catch{return!0x1;}}}const an='ck-ai-chat-resources__item',hn='ck-ai-chat-resources__item--in-context',cn='ck-ai-chat-resources__item-title',ln='ck-ai-chat-resources__item__icon';class AIChatResourceListItemView extends Pt{['resource'];['_titleView'];['_iconView'];constructor(_0x1e7569,_0x8b6ef0){super(_0x1e7569),this['resource']=_0x8b6ef0,this['set']('isInContext',!!_0x8b6ef0['isInContext']),this['_titleView']=this['_createTitleView'](),this['_iconView']=this['_createIconView'](),this['_setupTemplate']();}['render'](){super['render']();}['getResourceIcon'](_0x268b35){if(_0x268b35['isInContext'])return _0xfcbf97;switch(_0x268b35['type']){case'document':return _0x51cd8b;case'web-resource':return _0x140843;case'file':case'text':return _0x3194f3;default:return _0x46c705;}}['highlightText'](_0x5978e8){if(!_0x5978e8||''===_0x5978e8['trim']())return void this['_titleView']['highlightText'](null);const _0x290057=new RegExp(_0x3cd3bb(_0x5978e8),'gi');this['_titleView']['highlightText'](_0x290057);}['updateResourceState'](_0x4298dc){this['resource']['isInContext']=_0x4298dc,this['isInContext']=_0x4298dc,this['_updateIcon']();}['_createTitleView'](){const _0x4fdbdc=new _0xf9dbb2();return _0x4fdbdc['text']=this['resource']['label'],_0x4fdbdc['extendTemplate']({'tag':'span','attributes':{'class':[cn]}}),_0x4fdbdc;}['_createIconView'](){const _0x1ab5bb=new xt();return _0x1ab5bb['content']=this['getResourceIcon'](this['resource']),_0x1ab5bb;}['_setupTemplate'](){const _0x107610=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':[an,_0x107610['if']('isVisible','ck-hidden',_0xe23e59=>!_0xe23e59),_0x107610['if']('isInContext',hn)]},'children':[{'tag':'div','attributes':{'class':[ln]},'children':[this['_iconView']]},this['_titleView']],'on':{'click':_0x107610['to']('execute')}});}['_updateIcon'](){this['_iconView']['content']=this['getResourceIcon'](this['resource']);}}const un='ck-ai-chat-resources__list';class AIChatContextResourcesListView extends Dt{['_source'];constructor(_0x11b16d,_0x218ba6){super(_0x11b16d),this['_source']=_0x218ba6,this['extendTemplate']({'attributes':{'class':[un]}});}['setResources'](_0x3b7b61,_0x18781c){this['items']['clear']();let _0x342f95=_0x3b7b61;if(this['_source']['useDefaultFiltering']&&_0x18781c&&''!==_0x18781c['trim']()){const _0x54767b=new RegExp(_0x18781c['replace'](/[.*+?^${}()|[\]\\]/g,'\x5c$&'),'gi');_0x342f95=_0x3b7b61['filter'](_0x31877f=>_0x54767b['test'](_0x31877f['label']));}for(const _0x456d11 of _0x342f95){const _0x51ea66=new AIChatResourceListItemView(this['locale'],_0x456d11);_0x51ea66['on']('execute',()=>{this['_handleResourceSelection'](this['_source'],_0x456d11);}),this['items']['add'](_0x51ea66);}this['_source']['useDefaultFiltering']&&this['highlightText'](_0x18781c);}['highlightText'](_0x21bfd2){this['_source']['useDefaultFiltering']&&this['items']['forEach'](_0x2d24b4=>{_0x2d24b4['highlightText'](_0x21bfd2);});}['updateResourceState'](_0x351201,_0x171f86){for(const _0x2a3c70 of this['items']){const _0x23b645=_0x2a3c70;_0x23b645['resource']['id']===_0x351201&&_0x23b645['updateResourceState'](_0x171f86);}}['_handleResourceSelection'](_0x453029,_0x30ee0b){this['fire']('addResourceToContext',{'source':_0x453029,'resource':_0x30ee0b});}}class AIChatContextResourcesSearchInputView extends te{['iconView'];['resetButtonView'];['_viewConfig'];constructor(_0x37fbc3){const t=_0x37fbc3['t'],_0x300e70={'showResetButton':!0x0,'showIcon':!0x0,'creator':_0x2934f1,'label':Hi(_0x37fbc3,'AI_CHAT_SEARCH_RESOURCES')};super(_0x37fbc3,_0x300e70['creator']),this['label']=_0x300e70['label'],this['_viewConfig']=_0x300e70,this['_viewConfig']['showIcon']&&this['_setupSearchIcon'](),this['_viewConfig']['showResetButton']&&this['_setupResetButton'](_0x37fbc3,t),this['_setupEventListeners']();}['reset'](){this['fieldView']['reset'](),this['_viewConfig']['showResetButton']&&this['resetButtonView']&&(this['resetButtonView']['isVisible']=!0x1),this['search']('');}['search'](_0x56af35){this['fire']('search',_0x56af35);}['getQuery'](){return this['fieldView']['element']?.['value']||'';}['_setupSearchIcon'](){this['iconView']=new xt(),this['iconView']['content']=_0xba848d,this['fieldWrapperChildren']['add'](this['iconView'],0x0),this['extendTemplate']({'attributes':{'class':'ck-search__query_with-icon'}});}['_setupResetButton'](_0xeae7d4,t){this['resetButtonView']=new vt(_0xeae7d4),this['resetButtonView']['set']({'label':t('Clear'),'icon':_0x189920,'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',_0x58fc3d=>!_0x58fc3d),this['fieldWrapperChildren']['add'](this['resetButtonView']),this['extendTemplate']({'attributes':{'class':'ck-search__query_with-reset'}});}['_setupEventListeners'](){this['listenTo'](this['fieldView'],'input',()=>{this['search'](this['fieldView']['element']['value']);}),this['bind']('isEnabled')['to'](this);}}class AIChatContextResourcesView extends Nt{['_searchView'];['_searchSection'];['_searchInputVisibleFrom'];['_resourcesListView'];['_skeletonLoader'];['_source'];['children'];['_latestLoadResourcesUid']=null;constructor(_0x2aeada,_0x25b12e){super(_0x2aeada),this['_source']=_0x25b12e['source'],this['_searchInputVisibleFrom']=_0x25b12e['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 _0x83e50c([this['_skeletonLoader'],this['_resourcesListView']]),this['setTemplate']({'tag':'div','attributes':{'class':'ck-ai-chat-resources'},'children':this['children']});}['_createSearchView'](){return new AIChatContextResourcesSearchInputView(this['locale']);}['_createSearchSection'](){const _0xe223b3=new Nt(this['locale']);return _0xe223b3['setTemplate']({'tag':'div','attributes':{'class':'ck\x20ck-search'},'children':[this['_searchView']]}),this['_searchView']['on']('search',(_0x84fb6f,_0x183792)=>{this['loadResources'](_0x183792),this['_source']['useDefaultFiltering']&&this['_resourcesListView']['highlightText'](_0x183792);}),_0xe223b3;}['_createResourcesListView'](){const _0x286b9d=new AIChatContextResourcesListView(this['locale'],this['_source']);return _0x286b9d['delegate']('addResourceToContext')['to'](this),_0x286b9d['extendTemplate']({'attributes':{'class':this['bindTemplate']['if']('isLoading','ck-hidden')}}),_0x286b9d;}['_createSkeletonView'](){const _0x56fb5=new AISkeletonView(this['locale'],Ss['aiChatResources']);return _0x56fb5['bind']('isVisible')['to'](this,'isLoading'),_0x56fb5;}['render'](){super['render'](),this['loadResources']('');}['loadResources'](_0x4cc126){const _0x1410b0=ot();this['_latestLoadResourcesUid']=_0x1410b0,this['fire']('loadSourceResources',{'sourceId':this['_source']['id'],'query':_0x4cc126,'uid':_0x1410b0}),this['isLoading']=!0x0;}['setResources'](_0x5f4c63,_0x173d45){if(_0x173d45&&_0x173d45!==this['_latestLoadResourcesUid'])return;const _0x6b43df=this['_source']['useDefaultFiltering']?this['_searchView']['getQuery']():'';this['_resourcesListView']['setResources'](_0x5f4c63,_0x6b43df),_0x5f4c63['length']>=this['_searchInputVisibleFrom']&&!this['children']['has'](this['_searchSection'])&&this['children']['add'](this['_searchSection'],0x0),requestAnimationFrame(()=>{this['isLoading']=!0x1;});}['updateResourceState'](_0x54036e,_0x255470){this['_resourcesListView']['updateResourceState'](_0x54036e,_0x255470);}}const dn='ck-ai-chat-context-controls__source-balloon-panel',_n='ck-button-icon\x20ck-button-back',In='ck-ai-header\x20ck-ai-header_small\x20ck-ai-header_source';class AIChatResourcesBalloonView{['_sourceResourceBalloons']=new Map();['_bodyCollection'];['_locale'];['_config'];constructor(_0x17dac0,_0x584cce,_0x26b7d5){this['_locale']=_0x17dac0,this['_bodyCollection']=_0x584cce,this['_config']=_0x26b7d5;}['showSourceResourcesBalloon']({source:_0x162151,withBackButton:_0x6d1f7}){let _0x503b68=this['_sourceResourceBalloons']['get'](_0x162151['id']);_0x503b68||(_0x503b68=this['_createSourceResourceBalloonPanel'](),this['_sourceResourceBalloons']['set'](_0x162151['id'],_0x503b68),this['_setupSingleResourceBalloonClickOutsideHandler'](_0x503b68)),this['_addSourceResourceContent']({'balloonPanel':_0x503b68,'source':_0x162151,'withBackButton':_0x6d1f7}),_0x503b68['show']();const _0x3da3d1=this['_config']['getTargetElement']();_0x3da3d1&&_0x503b68['pin']({'target':_0x3da3d1,'limiter':this['_config']['getLimiterElement']()});}['populateSourceResourceBalloon'](_0x3e798b,_0x207972,_0x89df4c){const _0x5bec76=this['_sourceResourceBalloons']['get'](_0x3e798b);if(!_0x5bec76)return;const _0x2c5ad5=this['_getResourcesViewFromBalloon'](_0x5bec76);_0x2c5ad5&&(_0x2c5ad5['setResources'](_0x207972,_0x89df4c),_0x2c5ad5['once']('change:isLoading',()=>{_0x5bec76['pin']({'target':this['_config']['getTargetElement'](),'limiter':this['_config']['getLimiterElement']()});}));}['closeSourceResourceBalloon'](_0x3264b9){const _0x3cb315=this['_sourceResourceBalloons']['get'](_0x3264b9);_0x3cb315&&requestAnimationFrame(()=>{_0x3cb315['hide'](),this['_sourceResourceBalloons']['delete'](_0x3264b9),this['_config']['onBalloonClosed']();});}['isAnyResourceBalloonVisible'](){for(const _0x813700 of this['_sourceResourceBalloons']['values']())if(_0x813700['isVisible'])return!0x0;return!0x1;}['updateResourceState'](_0x3e532f,_0x2920c4,_0x1f8335){const _0x4a2c6a=this['_sourceResourceBalloons']['get'](_0x3e532f);if(!_0x4a2c6a||!_0x4a2c6a['isVisible'])return;const _0x3ac6dd=this['_config']['getTargetElement']();if(!_0x3ac6dd)return;_0x4a2c6a['pin']({'target':_0x3ac6dd,'limiter':this['_config']['getLimiterElement']()});const _0x368823=this['_getResourcesViewFromBalloon'](_0x4a2c6a);_0x368823&&_0x368823['updateResourceState'](_0x2920c4,_0x1f8335);}['destroy'](){for(const _0x305a7e of this['_sourceResourceBalloons']['values']())_0x305a7e['destroy']();this['_sourceResourceBalloons']['clear']();}['_createSourceResourceBalloonPanel'](){const _0x4488df=new Xt(this['_locale']);return _0x4488df['extendTemplate']({'attributes':{'class':dn}}),this['_bodyCollection']['add'](_0x4488df),_0x4488df;}['_addSourceResourceContent']({balloonPanel:_0x48511a,source:_0x1b2e69,withBackButton:_0x2f93d7}){_0x48511a['content']['clear']();const _0xa262f6=this['_createBalloonHeader']({'balloonPanel':_0x48511a,'source':_0x1b2e69,'withBackButton':_0x2f93d7});_0x48511a['content']['add'](_0xa262f6);const _0x130ddd=this['_createBalloonResourcesView'](_0x1b2e69);_0x48511a['content']['add'](_0x130ddd);}['_createBalloonHeader']({balloonPanel:_0x55b708,source:_0x290b21,withBackButton:_0x4ef11b}){const _0x1a060c=new _0x3b3599(this['_locale'],{'label':_0x290b21['label'],'class':In});return _0x4ef11b&&_0x1a060c['children']['add'](this['_createBackButton'](_0x55b708),0x0),_0x1a060c;}['_createBackButton'](_0x15eda6){const _0x4880fe=new vt(this['_locale']);return _0x4880fe['set']({'icon':_0x591ef7,'tooltip':Hi(this['_locale'],'AI_CHAT_CONTEXT_URL_BACK_TO_CONTEXT'),'tooltipPosition':'n','class':_n}),_0x4880fe['on']('execute',()=>{_0x15eda6['hide'](),this['_config']['onBackToContext']();}),_0x4880fe;}['_createBalloonResourcesView'](_0x34cef8){const _0x19831e=new AIChatContextResourcesView(this['_locale'],{'source':_0x34cef8,'searchInputVisibleFrom':this['_config']['searchInputVisibleFrom']});return _0x19831e['on']('loadSourceResources',(_0x2a348d,_0xa4ac8)=>{this['_config']['onLoadSourceResources'](_0xa4ac8);}),_0x19831e['on']('addResourceToContext',(_0x2a90dc,_0x4359eb)=>{this['_config']['onResourceSelected'](_0x4359eb['source'],_0x4359eb['resource']),this['closeSourceResourceBalloon'](_0x34cef8['id']);}),_0x19831e;}['_getResourcesViewFromBalloon'](_0x51cbdf){const _0x5089d0=_0x51cbdf['content']['get'](0x1);return _0x5089d0 instanceof AIChatContextResourcesView?_0x5089d0:null;}['_setupSingleResourceBalloonClickOutsideHandler'](_0x4865e6){zt({'emitter':_0x4865e6,'contextElements':[_0x4865e6['element']],'callback':()=>{_0x4865e6['hide'](),this['_config']['onBalloonClosed']();},'activator':()=>_0x4865e6['isVisible']});}}const An=['addDocumentToContext','addFileToContext','addUrlToContext','addResourceToContext','removeContextItem','loadSourceResources','executeCustomItemCallback'],gn='ck-ai-chat-context-controls',Cn='ck-ai-chat-context-controls__pending-contexts',mn='ck-ai-chat-context-controls__add-context-balloon-panel',pn='ck-ai-chat-context-controls__add-context-button',En='ck-ai-chat-context-controls__url-balloon-panel',wn='ck-ai-chat-context-controls__balloon-button',Tn='ck-ai-chat-context-controls__balloon-button-source',fn='ck-ai-chat-controls-button',Sn='ck-ai-chat-context-chips-wrapper-balloon',Rn='ck-ai-chat-controls_context_show-more-button',bn='ck-ai-chat-context-controls__show-more-balloon-panel',On='ck-ai-chat',kn=[Xt['defaultPositions']['northArrowSouthWest'],Xt['defaultPositions']['northArrowSouth'],Xt['defaultPositions']['northArrowSouthEast'],Xt['defaultPositions']['southArrowNorthWest'],Xt['defaultPositions']['southArrowNorth'],Xt['defaultPositions']['southArrowNorthEast']];class AIChatContextPanelView extends Nt{['addContextButtonView'];['_currentContextsChips']=this['createCollection']();['_conversationContextsChips']=this['createCollection']();['_overflowManager'];['_addContextBalloonPanelView'];['_urlBalloonPanelView'];['_urlInputView'];['_resourcesBalloonView'];['_addContextBalloonConfig'];['_hasExactlyOneSource']=!0x1;['bodyCollection'];constructor(_0x40bff0,_0x1cf126){super(_0x40bff0),this['bodyCollection']=_0x1cf126['bodyCollection'],this['_currentContextsChips']=this['createCollection'](),this['_conversationContextsChips']=this['createCollection'](),this['addContextButtonView']=this['_createAddContextButtonView'](_0x40bff0),this['_addContextBalloonPanelView']=this['_createAddContextBalloonPanelView'](_0x40bff0),this['_urlBalloonPanelView']=this['_createUrlBalloonPanelView'](_0x40bff0),this['_resourcesBalloonView']=this['_createResourcesBalloonView'](_0x40bff0,_0x1cf126);const _0x4c8f04={'cssClasses':{'showMoreButton':Rn+'\x20'+Bi,'showMoreBalloon':bn,'overflowContainer':Sn,'controlsButton':fn}};this['_overflowManager']=new AIChatChipsOverflowManager(_0x40bff0,this['_currentContextsChips'],_0x4c8f04,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'](_0x327e6f,_0x1b65fb){const _0xc92bb6=this['_createContextButton'](_0x327e6f,'current',!0x0,_0x1b65fb);this['_addContextToCollection'](_0xc92bb6,this['_currentContextsChips']),this['_overflowManager']['reorganizeChips']();}['removeContextItem'](_0x362851){this['_removeContextFromCollection'](_0x362851,this['_currentContextsChips']),this['_removeContextFromCollection'](_0x362851,this['_overflowManager']['overflowChips']),this['_overflowManager']['reorganizeChips']();}['setContextItemLoading'](_0x771bbe,_0x75b766){let _0xf382c3=this['_currentContextsChips']['find'](_0x495441=>_0x495441['id']===_0x771bbe);_0xf382c3||(_0xf382c3=this['_overflowManager']['overflowChips']['find'](_0x2e991d=>_0x2e991d['id']===_0x771bbe)),_0xf382c3&&(_0xf382c3['isLoading']=_0x75b766);}['setConversationContext'](_0x10eb48){this['_conversationContextsChips']['clear']();for(const _0x111b1e of _0x10eb48){const _0x476bee=this['_createContextButton'](_0x111b1e,'conversation',!0x1,!0x1);this['_addContextToCollection'](_0x476bee,this['_conversationContextsChips']);}}['clearCurrentContextItems'](){this['_currentContextsChips']['clear'](),this['_overflowManager']['clear']();}['clearConversationContextItems'](){this['_conversationContextsChips']['clear']();}['updateResourceState'](_0x60b5f5,_0x98438d,_0x573b35){this['_resourcesBalloonView']['updateResourceState'](_0x60b5f5,_0x98438d,_0x573b35);}['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:_0x243d44,withBackButton:_0x142897}){this['_resourcesBalloonView']['showSourceResourcesBalloon']({'source':_0x243d44,'withBackButton':_0x142897}),this['addContextButtonView']['isOn']=!0x0;}['populateSourceResourceBalloon'](_0x3724cb,_0x5609a4,_0xfa3926,_0x4a4bed){this['_resourcesBalloonView']['populateSourceResourceBalloon'](_0x3724cb,_0xfa3926,_0x4a4bed);}['closeSourceResourceBalloon'](_0x6afbd9){this['_resourcesBalloonView']['closeSourceResourceBalloon'](_0x6afbd9),this['addContextButtonView']['isOn']=!0x1;}['setAddContextOptions'](_0x2005b4){this['_setBalloonPanelContent'](this['_addContextBalloonPanelView'],this['locale'],_0x2005b4),this['_setAddContextButtonEnabled'](_0x2005b4);}['_setAddContextButtonEnabled'](_0x35e7cf){const _0x41f0c2=!_0x35e7cf['document']['isHidden']&&_0x35e7cf['document']['enabled'],_0x3ae41f=_0x35e7cf['urls']['enabled'],_0x2f9f65=_0x35e7cf['files']['enabled'],_0x48b399=_0x35e7cf['sources']['length']>0x0,_0x5d3e61=_0x35e7cf['customItems']&&_0x35e7cf['customItems']['length']>0x0;this['addContextButtonView']['isEnabled']=_0x41f0c2||_0x3ae41f||_0x2f9f65||_0x48b399||_0x5d3e61;}['_setupTemplate'](){this['setTemplate']({'tag':'div','attributes':{'class':[gn,'ck-reset_all-excluded']},'children':[{'tag':'div','attributes':{'class':Cn},'children':this['_currentContextsChips']}]});}['_bindEventHandlers'](){this['addContextButtonView']['on']('execute',()=>{this['_handleAddContextButtonClick']();});}['_createAddContextButtonView'](_0x19a3ec){const _0x845e54=new vt(_0x19a3ec);return _0x845e54['set']({'label':Hi(_0x19a3ec,'AI_CHAT_CONTEXT_ADD_CONTEXT'),'class':fn+'\x20'+pn+'\x20'+Bi,'icon':_0x534c6c,'isToggleable':!0x0,'tooltip':!0x0,'tooltipPosition':'sw'}),_0x845e54;}['_createAddContextBalloonPanelView'](_0x50cc5e){return this['_createBaseBalloonPanel'](_0x50cc5e,mn);}['_createUrlBalloonPanelView'](_0x5067f5){const _0x3b0991=this['_createBaseBalloonPanel'](_0x5067f5,En);return this['_addUrlContent'](_0x3b0991,_0x5067f5),_0x3b0991;}['_createResourcesBalloonView'](_0x3cb854,_0x48d943){const _0x3826b6={'searchInputVisibleFrom':_0x48d943['searchInputVisibleFrom'],'onBackToContext':()=>{this['showAddContextBalloonPanel'](),this['_addContextBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':kn});},'onResourceSelected':(_0x1b5d7f,_0x416d0b)=>{this['fire']('addResourceToContext',{'source':_0x1b5d7f,'resource':_0x416d0b});},'onLoadSourceResources':_0x228dc8=>{this['fire']('loadSourceResources',_0x228dc8);},'onBalloonClosed':()=>{this['addContextButtonView']['isOn']=!0x1;},'getLimiterElement':()=>this['_getLimiterElement'](),'getTargetElement':()=>this['addContextButtonView']['element']};return new AIChatResourcesBalloonView(_0x3cb854,_0x48d943['bodyCollection'],_0x3826b6);}['_getLimiterElement'](){return this['element']?.['closest']('.'+On)||document['body'];}['_createBaseBalloonPanel'](_0x502d91,_0x59e1cb){const _0x28256f=new Xt(_0x502d91);return _0x28256f['extendTemplate']({'attributes':{'class':_0x59e1cb}}),this['bodyCollection']['add'](_0x28256f),_0x28256f;}['_setBalloonPanelContent'](_0x5507eb,_0x5f48a4,_0x3862e5){if(_0x5507eb['content']['clear'](),!_0x3862e5['document']['isHidden']&&_0x3862e5['document']['enabled']){const _0x3db1dd=this['_createBalloonButton'](_0x5f48a4,{'label':Hi(_0x5f48a4,'AI_CHAT_CONTEXT_CURRENT_DOCUMENT'),'icon':_0x51cd8b});_0x3db1dd['on']('execute',()=>{this['fire']('addDocumentToContext'),this['hideAddContextBalloonPanel']();}),_0x5507eb['content']['add'](_0x3db1dd);}if(_0x3862e5['urls']['enabled']){const _0xbc2078=this['_createBalloonButton'](_0x5f48a4,{'label':Hi(_0x5f48a4,'AI_CHAT_CONTEXT_URL_LABEL'),'icon':_0x140843});_0xbc2078['on']('execute',()=>{this['hideAddContextBalloonPanel'](),this['showUrlBalloonPanel'](),this['_urlBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':kn}),this['_urlInputView']['focus']();}),_0x5507eb['content']['add'](_0xbc2078);}if(_0x3862e5['files']['enabled']){const _0xc93f2e=new _0x4da545(_0x5f48a4);_0xc93f2e['set']({'label':Hi(_0x5f48a4,'AI_CHAT_CONTEXT_FILE_LABEL'),'icon':_0x5036a0,'withText':!0x0,'tooltip':!0x0,'class':wn,'allowMultipleFiles':!0x0}),_0xc93f2e['on']('execute',()=>{this['hideAddContextBalloonPanel']();}),_0xc93f2e['on']('done',(_0x435351,_0x488104)=>{this['fire']('addFileToContext',_0x488104);}),_0xc93f2e['tooltip']=!0x0,_0x5507eb['content']['add'](_0xc93f2e);}for(const _0x1adb91 of _0x3862e5['sources']){const _0x3cc4c5=this['_createBalloonButton'](_0x5f48a4,{'label':_0x1adb91['label'],'icon':_0x1adb91['icon']||_0x46c705,'type':'source'});_0x5507eb['content']['add'](_0x3cc4c5),_0x3cc4c5['on']('execute',()=>{this['hideAddContextBalloonPanel'](),this['_showSourceResourcesBalloon']({'source':_0x1adb91,'withBackButton':!this['_hasExactlyOneSource']});});}for(const _0x7ddbb5 of _0x3862e5['customItems']||[]){const _0x4f4166=this['_createBalloonButton'](_0x5f48a4,{'label':_0x7ddbb5['label'],'icon':_0x7ddbb5['icon']||_0x46c705,'type':'customItem'});_0x5507eb['content']['add'](_0x4f4166),_0x4f4166['on']('execute',()=>{this['hideAddContextBalloonPanel'](),this['fire']('executeCustomItemCallback',_0x7ddbb5);});}this['_hasExactlyOneSource']=0x1===_0x5507eb['content']['length'],this['_urlInputView']['withBackButton']=!this['_hasExactlyOneSource'];}['_addUrlContent'](_0x5d3c7d,_0x9b7261){this['_urlInputView']=new AIChatContextPanelUrlInputView(_0x9b7261),this['_urlInputView']['on']('submitUrl',(_0x32cf75,_0x5cf711)=>{this['_handleUrlSubmit'](_0x5cf711);}),this['_urlInputView']['on']('cancel',()=>{this['hideUrlBalloonPanel'](),this['_hasExactlyOneSource']||(this['showAddContextBalloonPanel'](),this['_addContextBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':kn}));}),this['_urlInputView']['on']('refreshBalloon',()=>{this['_urlBalloonPanelView']['isVisible']&&this['_urlBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':kn});}),_0x5d3c7d['content']['add'](this['_urlInputView']);}['_createBalloonButton'](_0x30154e,_0x44a49c){const _0x490e30='source'===_0x44a49c['type']?new SourcesBalloonButtonView(_0x30154e):new vt(_0x30154e);return _0x490e30['set']({'label':_0x44a49c['label'],'icon':_0x44a49c['icon'],'withText':!0x0,'tooltip':!0x0,'tooltipPosition':'sw','class':wn}),_0x490e30;}['_setupAllBalloonClickOutsideHandlers'](){this['_setupAddContextBalloonClickOutsideHandler'](),this['_setupUrlBalloonClickOutsideHandler']();}['_setupUrlBalloonClickOutsideHandler'](){zt({'emitter':this['_urlBalloonPanelView'],'contextElements':[this['_urlBalloonPanelView']['element']],'callback':()=>{this['hideUrlBalloonPanel']();},'activator':()=>this['_urlBalloonPanelView']['isVisible']});}['_toggleAddContextBalloon'](_0x3d165b){const _0x35cecd=this['_addContextBalloonConfig'];_0x35cecd['buttonView']['isOn']=_0x3d165b,_0x3d165b?_0x35cecd['balloonView']['show']():_0x35cecd['balloonView']['hide']();}['_setupAddContextBalloonClickOutsideHandler'](){const {balloonView:_0x2051fc,buttonView:_0x59cdf4,hideMethod:_0x25a521}=this['_addContextBalloonConfig'];zt({'emitter':_0x2051fc,'contextElements':[_0x2051fc['element'],_0x59cdf4['element']],'callback':()=>{_0x25a521();},'activator':()=>_0x59cdf4['isOn']&&!this['_urlBalloonPanelView']['isVisible']&&!this['_resourcesBalloonView']['isAnyResourceBalloonVisible']()});}['_createContextButton'](_0x1cdf55,_0x399d7c,_0x291b79=!0x1,_0x385fbf=!0x1){const _0x3336a3='conversation'===_0x399d7c||!0x0===_0x1cdf55['isReadOnly'],_0x4713e8=new AIChatContextItemButtonView(this['locale'],_0x1cdf55,_0x3336a3,_0x291b79,_0x385fbf);return _0x3336a3||_0x4713e8['on']('removeContextItemChip',()=>{this['fire']('removeContextItem',_0x4713e8['id']);}),_0x4713e8;}['_addContextToCollection'](_0x2170a8,_0x409c7d){_0x409c7d['add'](_0x2170a8,0x0);}['_removeContextFromCollection'](_0x430a15,_0x502a5e){const _0x2a0994=_0x502a5e['find'](_0x38d402=>_0x38d402['id']===_0x430a15);_0x2a0994&&_0x502a5e['remove'](_0x2a0994);}['_handleAddContextButtonClick'](){this['addContextButtonView']['isOn']?this['hideAddContextBalloonPanel']():(this['showAddContextBalloonPanel'](),this['_addContextBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':kn}),this['_hasExactlyOneSource']&&this['_addContextBalloonPanelView']['content']['get'](0x0)?.['fire']('execute'));}['_handleUrlSubmit'](_0x58b7eb){this['_urlInputView']['clear'](),this['hideUrlBalloonPanel'](),this['fire']('addUrlToContext',_0x58b7eb);}}class SourcesBalloonButtonView extends vt{['arrowView'];constructor(_0x46d714){super(_0x46d714),this['set']({'withText':!0x0,'role':'menuitem'}),this['arrowView']=this['_createArrowView'](),this['extendTemplate']({'attributes':{'class':[Tn]}});}['render'](){super['render'](),this['children']['add'](this['arrowView']);}['_createArrowView'](){const _0x2b2737=new xt();return _0x2b2737['content']=_0x1991bc,_0x2b2737['extendTemplate']({'attributes':{'class':Tn+'__arrow'}}),_0x2b2737;}}class AIChatControlsLoaderView extends Nt{['_cancelButtonView'];['_loaderView'];constructor(_0x137af1){super(_0x137af1),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 _0x20d0da=new vt(this['locale']);return _0x20d0da['set']({'label':Hi(this['locale'],'AI_CHAT_STOP_GENERATING'),'withText':!0x0,'class':Ui+'\x20ck-ai-button-stop-generating','icon':_0x5b8dae}),_0x20d0da['on']('execute',()=>{this['fire']('abortPromptStream');}),_0x20d0da;}['_createLoaderView'](){const _0x20119d=new Nt(this['locale']);return _0x20119d['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-chat-controls-loader']},'children':[{'tag':'div','attributes':{'class':['ck-ai-chat-controls-loader-icon']},'children':[{'tag':'div','attributes':{'class':['ck-ai-chat-controls-loader-icon-dot']}},{'tag':'div','attributes':{'class':['ck-ai-chat-controls-loader-icon-dot']}},{'tag':'div','attributes':{'class':['ck-ai-chat-controls-loader-icon-dot']}}]},{'text':Hi(this['locale'],'AI_CHAT_IS_WRITING')}]}),_0x20119d;}}class AIChatControlsView extends Nt{['_contextPanelView'];['_promptInputView'];['_promptCapabilitiesView'];['_loaderView'];['_modelUnavailableMessageView'];['_shouldRestorePromptInputFocus'];constructor(_0x50be20,_0x499a0b){super(_0x50be20),this['_contextPanelView']=this['_createContextPanelView'](_0x50be20,{'bodyCollection':_0x499a0b['bodyCollection'],'searchInputVisibleFrom':_0x499a0b['contextResourcesSearchInputVisibleFrom']}),this['_promptInputView']=this['_createPromptInputView'](_0x50be20),this['_promptCapabilitiesView']=this['_createPromptCapabilitiesView'](_0x50be20),this['_loaderView']=this['_createLoaderView'](_0x50be20),this['_modelUnavailableMessageView']=this['_createModelUnavailableMessageView'](_0x50be20),this['_shouldRestorePromptInputFocus']=!0x1,this['_promptInputView']['delegate']('sendUserMessage')['to'](this),this['_loaderView']['delegate']('abortPromptStream')['to'](this),this['_promptCapabilitiesView']['delegate']('toggleWebSearch')['to'](this),this['_promptCapabilitiesView']['delegate']('toggleReasoning')['to'](this),this['_promptCapabilitiesView']['delegate']('selectModel')['to'](this),this['_contextPanelView']['delegate'](...An)['to'](this),this['set']('isModelAvailable',!0x0),this['set']('isDisabled',!0x1);const _0x63a4c5=this['bindTemplate'];this['setTemplate']({'tag':'form','attributes':{'class':['ck','ck-ai-chat-controls',_0x63a4c5['if']('isDisabled','ck-ai-chat-controls-disabled')]},'children':[{'tag':'div','attributes':{'class':[_0x63a4c5['if']('isLoading','ck-hidden',_0x205f18=>_0x205f18||!this['isModelAvailable']),_0x63a4c5['if']('isModelAvailable','ck-hidden',_0x77ee76=>!_0x77ee76||this['isLoading'])]},'children':[this['_contextPanelView'],this['_promptInputView'],this['_promptCapabilitiesView']]},{'tag':'div','attributes':{'class':[_0x63a4c5['if']('isLoading','ck-hidden',_0x479ee1=>!_0x479ee1)]},'children':[this['_loaderView']]},{'tag':'div','attributes':{'class':[_0x63a4c5['if']('isModelAvailable','ck-hidden',_0x2afdba=>_0x2afdba)]},'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'](_0xd0f45f,_0x1416bb){return new AIChatContextPanelView(_0xd0f45f,_0x1416bb);}['_createPromptInputView'](_0x183dc1){return new AIChatPromptInputView(_0x183dc1,this['_contextPanelView']['addContextButtonView']);}['_createPromptCapabilitiesView'](_0x533b03){return new AIChatPromptCapabilitiesView(_0x533b03);}['_createLoaderView'](_0xc5947a){return new AIChatControlsLoaderView(_0xc5947a);}['_createModelUnavailableMessageView'](_0x28b3e0){const _0x14dfbc=new AIChatModelUnavailableMessageView(_0x28b3e0);return _0x14dfbc['delegate']('startConversation')['to'](this),_0x14dfbc;}['_handlePromptInputFocus'](_0x492fff,_0x4e9c5b,_0x3380dc){_0x3380dc?this['_shouldRestorePromptInputFocus']=!0x0:this['_shouldRestorePromptInputFocus']&&this['_promptInputView']['focus']();}['addContextItem'](_0x8a1e52,_0xf4fa41){this['_contextPanelView']['addContextItem'](_0x8a1e52,_0xf4fa41);}['removeContextItem'](_0x592469){this['_contextPanelView']['removeContextItem'](_0x592469);}['setContextItemLoading'](_0x342a7b,_0x302f62){this['_contextPanelView']['setContextItemLoading'](_0x342a7b,_0x302f62);}['setIsUploadInProgress'](_0x1ec455){this['_promptInputView']['setIsUploadInProgress'](_0x1ec455);}['setConversationContext'](_0x108afb){this['_contextPanelView']['setConversationContext'](_0x108afb);}['clearPendingContextUI'](){this['_contextPanelView']['clearCurrentContextItems']();}['clearConversationContextUI'](){this['_contextPanelView']['clearConversationContextItems']();}['updateResourceState'](_0x3c3e75,_0x2c5fc3,_0x2c65f0){this['_contextPanelView']['updateResourceState'](_0x3c3e75,_0x2c5fc3,_0x2c65f0);}['setWebSearch'](_0x8304f1){this['_promptCapabilitiesView']['setWebSearch'](_0x8304f1);}['setReasoning'](_0x23e3a9){this['_promptCapabilitiesView']['setReasoning'](_0x23e3a9);}['resetMessageInput'](){this['_promptInputView']['reset']();}['setAddContextOptions'](_0x5c7a3e){this['_contextPanelView']['setAddContextOptions'](_0x5c7a3e);}['setInputPlaceholder'](_0x172e8b){this['_promptInputView']['setPlaceholderText'](_0x172e8b);}['setModelList'](_0x2c2628,_0x35b388){this['_promptCapabilitiesView']['setModelList'](_0x2c2628,_0x35b388);}['setModel'](_0x3c4ecb){_0x3c4ecb?(this['isModelAvailable']=!0x0,this['_promptCapabilitiesView']['setModel'](_0x3c4ecb)):this['isModelAvailable']=!0x1;}['enableModelSelector'](){this['_promptCapabilitiesView']['enableModelSelector']();}['disableModelSelector'](_0x39de95){this['_promptCapabilitiesView']['disableModelSelector'](_0x39de95);}['populateSourceResourceBalloon'](_0x42f53b,_0x2b2695,_0x37bbad,_0x4021ac){this['_contextPanelView']['populateSourceResourceBalloon'](_0x42f53b,_0x2b2695,_0x37bbad,_0x4021ac);}['closeSourceResourceBalloon'](_0x3c219b){this['_contextPanelView']['closeSourceResourceBalloon'](_0x3c219b);}['focusPromptInput'](_0x35ba9d=!0x1){this['_promptInputView']['focus'](_0x35ba9d);}['setPromptInputValue'](_0x51fc15){this['_promptInputView']['queryView']['fieldView']['reset'](),this['_promptInputView']['queryView']['fieldView']['value']=_0x51fc15;}}class AIChatModelUnavailableMessageView extends Nt{constructor(_0x170449){super(_0x170449);const _0x39a46d=new vt(_0x170449);_0x39a46d['set']({'label':Hi(this['locale'],'AI_CHAT_MODEL_UNAVAILABLE_MESSAGE_BUTTON'),'withText':!0x0,'class':['ck-ai-chat-controls__start-new-chat-button'],'tooltip':''}),_0x39a46d['delegate']('execute')['to'](this,'startConversation'),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat-controls-model-unavailable-message']},'children':[{'tag':'p','children':[{'text':Hi(this['locale'],'AI_CHAT_MODEL_UNAVAILABLE_MESSAGE_TEXT')+'\x20'},_0x39a46d]}]});}}class AIHeaderView extends _0x3b3599{['resizeButton'];constructor(_0x2565e7,_0x3c84b5){super(_0x2565e7,{'label':_0x3c84b5['label'],'class':'ck-ai-header\x20'+_0x3c84b5['class'],'icon':_0x3c84b5['icon']}),this['set']('isMaximized',!0x1),_0x3c84b5['content']&&this['children']['add'](_0x3c84b5['content']),_0x3c84b5['showResizeButton']&&(this['resizeButton']=Gi(_0x2565e7,this),this['children']['add'](this['resizeButton']));}}class AIDisclaimerView extends Nt{constructor(_0x3c30ed){super(_0x3c30ed),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-disclaimer']},'children':[{'tag':'p','attributes':{'class':['ck','ck-ai-disclaimer__content']},'children':[{'text':Hi(_0x3c30ed,'AI_DISCLAIMER_TEXT')}]}]});}}function vn(_0x443bd7,_0x7c780e){const _0x2b3122=new vt(_0x443bd7);return _0x2b3122['set']({'label':Hi(_0x443bd7,'AI_CHAT_LABEL_NEW_CHAT'),'withText':!0x0,'icon':_0x7bd6d1,'class':'ck-ai-chat__start-conversation\x20'+Ui}),_0x2b3122['on']('execute',()=>{_0x7c780e['fire']('startConversation');}),_0x2b3122;}class AIChatView extends Nt{['chatHeader'];['chatFeed'];['chatControls'];['chatDisclaimer'];['_bodyCollection'];constructor(_0x245cf9,_0x424741){super(_0x245cf9),this['_bodyCollection']=new Qt(_0x245cf9),this['_bodyCollection']['attachToDom']();const _0x25f370=vn(_0x245cf9,this);this['chatHeader']=new AIHeaderView(_0x245cf9,{'label':Hi(_0x245cf9,'AI_CHAT_HEADING'),'icon':_0x2ef84a,'class':'ck-ai-header_chat','content':_0x25f370,'showResizeButton':_0x424741['showResizeButton']}),this['chatHeader']['delegate']('resizeTabs')['to'](this),this['chatFeed']=new AIChatFeedView(_0x245cf9,this['_bodyCollection']),this['chatFeed']['delegate'](...ms)['to'](this),this['chatControls']=new AIChatControlsView(_0x245cf9,{'bodyCollection':this['_bodyCollection'],'contextResourcesSearchInputVisibleFrom':_0x424741['contextResourcesSearchInputVisibleFrom']}),this['chatControls']['delegate'](...ms)['to'](this),this['chatDisclaimer']=new AIDisclaimerView(_0x245cf9),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset_all','ck-ai-chat','ck-rounded-corners'],'dir':_0x245cf9['uiLanguageDirection']},'children':[this['chatHeader'],this['chatFeed'],this['chatControls'],this['chatDisclaimer']]});}['populateSourceResourceBalloon'](_0xac1db4,_0x134c53,_0x29e51d,_0x5e8430){this['chatControls']['populateSourceResourceBalloon'](_0xac1db4,_0x134c53,_0x29e51d,_0x5e8430);}['closeSourceResourceBalloon'](_0x17c05d){this['chatControls']['closeSourceResourceBalloon'](_0x17c05d);}['destroy'](){this['_bodyCollection']['detachFromDom'](),super['destroy']();}}class AIChatUI extends _0x530a64{static get['requires'](){return[AITabs];}['_view'];static get['pluginName'](){return'AIChatUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['feedItemRenderingStrategy']='streaming';['showDiff']=!0x0;['_promiseQueue'];['_interactionPromiseResolver'];['_titleAnimationInterval']=void 0x0;['_isTrackChangesCommandValueBound']=!0x1;constructor(_0x59c5c6){super(_0x59c5c6);const _0x2aa330=this['context']['plugins']['get']('AITabs');this['set']('isBusy',!0x1),this['_promiseQueue']=new PromiseQueue(),this['_view']=new AIChatView(this['context']['locale'],{'showResizeButton':_0x2aa330['showResizeButton'],'contextResourcesSearchInputVisibleFrom':this['context']['config']['get']('ai.chat.context.searchInputVisibleFrom')}),this['_view']['delegate']('resizeTabs')['to'](_0x2aa330),this['_view']['delegate'](...ms)['to'](this),this['_view']['on']('toggleSuggestionDisplayMode',(_0x20b3d2,{showDiff:_0x251fbe})=>{this['showDiff']=_0x251fbe;}),_0x2aa330['view']['addTab']({'id':'chat','buttonLabel':Hi(this['context']['locale'],'AI_CHAT_HEADING'),'buttonIcon':_0x2ef84a,'order':0x0,'content':this['_view']}),this['_view']['chatHeader']['bind']('isMaximized')['to'](_0x2aa330['view'],'isMaximized',_0x5d53a9=>_0x5d53a9),this['_view']['chatControls']['bind']('isLoading')['to'](this,'isBusy',_0x474a2f=>_0x474a2f),this['_view']['chatControls']['setInputPlaceholder'](this['_getInputPlaceholder']()),this['bind']('isModelAvailable')['to'](this['_view']['chatControls'],'isModelAvailable');}['destroy'](){super['destroy'](),this['_titleAnimationInterval']&&clearInterval(this['_titleAnimationInterval']);}['createConversation'](_0xd4b7f){const _0x560f22=this['context']['config']['get']('ai.chat.welcomeMessage')??Hi(this['context']['locale'],'AI_CHAT_WELCOME_MESSAGE');this['_view']['chatFeed']['clear'](),this['_view']['chatControls']['enableModelSelector'](),this['_view']['chatControls']['setModelList'](_0xd4b7f['availableModels'],!this['context']['config']['get']('ai.models.showModelSelector')),this['addFeedItemStaticMessage']({'id':'conversation-start','staticMessage':_0x560f22}),this['fire']('conversationCreated');}async['addFeedItemStaticMessage']({id:_0x1ab4e0,staticMessage:_0x5fcf10}){return this['_promiseQueue']['enqueue'](async()=>{this['_view']['chatFeed']['addItem']('ai-reply',{'id':_0x1ab4e0,'initialContent':'<p>'+_0x5fcf10+'</p>'});});}async['addFeedItemUserMessage'](_0x44ffb6){const _0x2da461=_0x44ffb6['attributes']?.['displayedPrompt']||_0x44ffb6['userMessage'];return this['_promiseQueue']['enqueue'](async()=>{this['_view']['chatFeed']['addItem']('user-message',{'contextItems':Array['from'](_0x44ffb6['contextItems']['values']()),'initialContent':'<p>'+_0x2da461+'</p>','id':_0x44ffb6['id']});});}async['addFeedItemError']({errorMessage:_0x38d3c4,id:_0x5325aa}){return this['_promiseQueue']['enqueue'](async()=>{this['_view']['chatFeed']['addItem']('error-message',{'initialContent':'<p>'+_0x38d3c4+'</p>','id':_0x5325aa});});}async['addFeedItemAIReply'](_0xfe7d67){return this['_promiseQueue']['enqueue'](async()=>{this['_view']['chatFeed']['addItem']('ai-reply',{'id':_0xfe7d67['interactionId']+':'+_0xfe7d67['id']}),this['clearLoadingMessage']();});}async['addFeedItemAISuggestion'](_0x4cc4f4){const _0x4ce767=ds(this['context']);let _0x4b2822=_0x4ce767['config']['get']('ai.availableReplyActions')||[...bs];if(_0x4ce767['plugins']['has']('TrackChanges')){if(!this['_isTrackChangesCommandValueBound']){this['_isTrackChangesCommandValueBound']=!0x0;const _0x25f4f0=_0x4ce767['commands']['get']('trackChanges');this['_view']['chatFeed']['bind']('isTrackChangesOn')['to'](_0x25f4f0,'value');}}else _0x4b2822=_0x4b2822['filter'](_0x24ce26=>'insertSuggestion'!=_0x24ce26);return this['_promiseQueue']['enqueue'](async()=>{this['_view']['chatFeed']['addItem']('ai-suggestion-reply',{'id':_0x4cc4f4['interactionId']+':'+_0x4cc4f4['id'],'areActionsDisabled':_0x4cc4f4['areActionsDisabled'],'showDiff':this['showDiff'],'availableActions':_0x4b2822}),this['clearLoadingMessage']();});}async['addFeedInteractionHeader'](_0x14a53b,_0x3af1a7){return this['_promiseQueue']['enqueue'](async()=>{const _0x24138a=this['_view']['chatFeed']['children']['last'];if(_0x24138a instanceof AIChatFeedInteractionHeaderView)return this['_view']['chatFeed']['children']['remove'](_0x24138a),void this['_view']['chatFeed']['addItem']('interaction-header',{'id':_0x14a53b['id'],'capabilities':{'isWebSearchEnabled':_0x24138a['capabilities']['isWebSearchEnabled']||_0x3af1a7['isWebSearchEnabled'],'isReasoningEnabled':_0x24138a['capabilities']['isReasoningEnabled']||_0x3af1a7['isReasoningEnabled']}});this['_view']['chatFeed']['addItem']('interaction-header',{'id':_0x14a53b['id'],'capabilities':_0x3af1a7});});}async['addFeedItemCustomElement'](_0x12c4ce,_0x15fc32){let _0x4e905e;return await this['_promiseQueue']['enqueue'](async()=>{_0x4e905e=this['_view']['chatFeed']['addItem']('custom-element',{'content':_0x12c4ce,'id':_0x15fc32});}),_0x4e905e;}['removeFeedItem'](_0x226f6f){this['_view']['chatFeed']['removeItem'](_0x226f6f);}['hasFeedItem'](_0x57b4c5){return this['_view']['chatFeed']['hasItem'](_0x57b4c5);}['updateFeedInteractionHeader'](_0x350705){const _0x2f2941=this['_view']['chatFeed']['children']['find'](_0x3c197f=>_0x3c197f['options']['id']==_0x350705['id']&&_0x3c197f instanceof AIChatFeedInteractionHeaderView);_0x2f2941&&_0x2f2941['set']('isVisible',_0x350705['isVisible']);}async['updateFeedItemAIReplyContent'](_0x59afe3){const _0x28bace=_0x59afe3['renderingStrategy']||this['feedItemRenderingStrategy'];return this['_promiseQueue']['enqueue'](async _0x327b2d=>{await this['_view']['chatFeed']['updateReplyItem']({..._0x59afe3,'abortSignal':_0x327b2d,'renderingStrategy':_0x28bace}),_0x59afe3['isDone']&&this['markFeedItemAsDone'](_0x59afe3['id']);});}['updateFeedItemAIReplySources'](_0x23100a,_0x58c448){this['_view']['chatFeed']['updateWebSources'](_0x23100a,_0x58c448);}async['updateFeedItemAIReplySuggestionContent'](_0x238830){return this['_promiseQueue']['enqueue'](async _0x473b8b=>{await this['_view']['chatFeed']['updateSuggestionItem']({..._0x238830,'abortSignal':_0x473b8b}),_0x238830['isDone']&&this['markFeedItemAsDone'](_0x238830['id']);});}['updateFeedItemAIReplySuggestionPartState'](_0x320b7e){this['_view']['chatFeed']['updateSuggestionPartState'](_0x320b7e);}['setFeedItemAIReplySuggestionPartActive'](_0x342b8d){this['_view']['chatFeed']['setSuggestionPartActive'](_0x342b8d);}['markFeedItemAsDone'](_0xffde96){this['_view']['chatFeed']['markItemAsDone'](_0xffde96);}['removeFeedInteraction'](_0x535fa6){this['_view']['chatFeed']['getItemIds']()['filter'](_0x30b427=>_0x30b427['startsWith'](_0x535fa6))['forEach'](_0x578359=>this['_view']['chatFeed']['removeItem'](_0x578359));}['startInteraction'](){const _0x2ffed0=this['prepareLoadingMessage']({'isWebSearchEnabled':!0x1,'isReasoningEnabled':!0x1});this['setLoadingMessage'](_0x2ffed0),this['_view']['chatControls']['disableModelSelector'](!this['context']['config']['get']('ai.models.showModelSelector')),this['isBusy']=!0x0,this['_view']['chatFeed']['startAutoScroll']();}['stopInteraction'](_0x5cbfdd){this['_promiseQueue']['abort'](),this['_view']['chatFeed']['getItemIds']()['filter'](_0x775138=>_0x775138['startsWith'](_0x5cbfdd['id']))['forEach'](_0x48502e=>this['markFeedItemAsDone'](_0x48502e)),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'](_0x5b3073,_0x2bd510){this['_view']['chatControls']['addContextItem'](_0x5b3073,_0x2bd510);}['removeContextItem'](_0x125d02){this['_view']['chatControls']['removeContextItem'](_0x125d02);}['setContextItemLoading'](_0x1e867c,_0x1a182b){this['_view']['chatControls']['setContextItemLoading'](_0x1e867c,_0x1a182b);}['setIsUploadInProgress'](_0x42ebdd){this['_view']['chatControls']['setIsUploadInProgress'](_0x42ebdd);}['setConversationContext'](_0x2c6fc7){this['_view']['chatControls']['setConversationContext'](_0x2c6fc7);}['clearPendingContextUI'](){this['_view']['chatControls']['clearPendingContextUI']();}['clearConversationContextUI'](){this['_view']['chatControls']['clearConversationContextUI']();}['updateResourceState'](_0x1edc7f,_0x3dc55c,_0x5e12dc){this['_view']['chatControls']['updateResourceState'](_0x1edc7f,_0x3dc55c,_0x5e12dc);}['resetMessageInput'](){this['_view']['chatControls']['resetMessageInput'](),this['_view']['chatControls']['setInputPlaceholder'](this['_getInputPlaceholder']());}['setAddContextOptions'](_0x134074){this['_view']['chatControls']['setAddContextOptions'](_0x134074);}['updateCapabilities'](_0x409852){this['_view']['chatControls']['setWebSearch'](_0x409852['isWebSearchEnabled']),this['_view']['chatControls']['setReasoning'](_0x409852['isReasoningEnabled']),this['_view']['chatControls']['setInputPlaceholder'](this['_getInputPlaceholder'](_0x409852));}['setSelectedModel'](_0x31e72b,_0x794e4b){this['_view']['chatControls']['setModel'](_0x31e72b),_0x794e4b&&this['_view']['chatControls']['disableModelSelector'](!0x1);}['setFeedItemRenderingStrategy'](_0x3b195b){this['feedItemRenderingStrategy']=_0x3b195b;}['toggleLoadingSkeleton'](_0x1462da){this['_view']['chatFeed']['toggleLoadingSkeleton'](_0x1462da);}['resetConversationTitle'](){this['setConversationTitle'](Hi(this['context']['locale'],'AI_CHAT_HEADING'));}['setConversationTitle'](_0x185374,_0x24f345=!0x1){if(_0x24f345&&!Rt()&&_0x185374['length'])return this['_view']['chatHeader']['label']='',void this['_animateConversationTitle'](_0x185374);this['_view']['chatHeader']['label']=_0x185374;}['setLoadingMessage'](_0x93d342){this['_view']['chatFeed']['setLoadingMessage'](_0x93d342);}['clearLoadingMessage'](){this['_view']['chatFeed']['setLoadingMessage']('');}['_animateConversationTitle'](_0x536ddd){let _0x1a9d2a=0x0;clearInterval(this['_titleAnimationInterval']),this['_titleAnimationInterval']=setInterval(()=>{this['_view']['chatHeader']['label']=this['_view']['chatHeader']['label']+_0x536ddd[_0x1a9d2a],_0x1a9d2a++,_0x1a9d2a===_0x536ddd['length']&&clearInterval(this['_titleAnimationInterval']);},0x1e);}['prepareLoadingMessage'](_0x376ef3){return _0x376ef3['isWebSearchEnabled']&&_0x376ef3['isReasoningEnabled']?Hi(this['context']['locale'],'AI_CHAT_FEED_LOADING_MESSAGE_WEBSEARCH_REASONING'):_0x376ef3['isWebSearchEnabled']?Hi(this['context']['locale'],'AI_CHAT_FEED_LOADING_MESSAGE_WEBSEARCH'):_0x376ef3['isReasoningEnabled']?Hi(this['context']['locale'],'AI_CHAT_FEED_LOADING_MESSAGE_REASONING'):Hi(this['context']['locale'],'AI_CHAT_FEED_LOADING_MESSAGE_REGULAR');}['_getInputPlaceholder'](_0x44bb52){return _0x44bb52?_0x44bb52['isWebSearchEnabled']&&_0x44bb52['isReasoningEnabled']?Hi(this['context']['locale'],'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_WEBSEARCH_REASONING'):_0x44bb52['isWebSearchEnabled']?Hi(this['context']['locale'],'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_WEBSEARCH'):_0x44bb52['isReasoningEnabled']?Hi(this['context']['locale'],'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_REASONING'):Hi(this['context']['locale'],'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_REGULAR'):Hi(this['context']['locale'],'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_REGULAR');}['populateSourceResourceBalloon'](_0x356d4d,_0x1a9a0d,_0xd69ddd,_0x524979){this['_view']['populateSourceResourceBalloon'](_0x356d4d,_0x1a9a0d,_0xd69ddd,_0x524979);}['closeSourceResourceBalloon'](_0x438ad7){this['_view']['closeSourceResourceBalloon'](_0x438ad7);}['setPromptInputValue'](_0x16bcae){this['_view']['chatControls']['setPromptInputValue'](_0x16bcae);}['focusPromptInput'](_0xc22c69=!0x1){this['_view']['chatControls']['focusPromptInput'](_0xc22c69);}['scrollFeedToSuggestion'](_0x13c1d8,_0x41fded){this['_view']['chatFeed']['scrollToSuggestion'](_0x13c1d8,_0x41fded);}['startAutoScroll'](_0x829bf2={}){this['_view']['chatFeed']['startAutoScroll'](_0x829bf2);}['disableControls'](){this['_view']['chatControls']['isDisabled']=!0x0;}['enableControls'](){this['_view']['chatControls']['isDisabled']=!0x1;}}class AIChatHistorySectionListView extends Dt{['sections'];constructor(_0x35bafa,_0x3d973b){super(_0x35bafa),this['sections']=_0x3d973b,this['items']['addMany'](this['sections']),this['extendTemplate']({'attributes':{'class':['ck-ai-chat-history__sections']}});}['filter'](_0x585776){let _0x30af12=0x0,_0x1c3125=0x0;for(const _0x3decad of this['sections']){const {resultsCount:_0x2c635b,totalItemsCount:_0x2ea2f0}=_0x3decad['filter'](_0x585776);_0x30af12+=_0x2c635b,_0x1c3125+=_0x2ea2f0;}return{'resultsCount':_0x30af12,'totalItemsCount':_0x1c3125};}}class AIChatHistoryListView extends Pt{['title'];['itemsViews'];['_itemsListView'];constructor(_0xb1e361,{title:_0x2fdc3e,items:_0x35f3b0}){super(_0xb1e361);const _0x4806ae=this['bindTemplate'];this['set']('isVisible',!0x0),this['title']=_0x2fdc3e,this['itemsViews']=_0x35f3b0;const _0x35ea9b=new Nt(_0xb1e361);_0x35ea9b['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-chat-history__section-title']},'children':[this['title']]}),this['_itemsListView']=new Dt(_0xb1e361),this['_itemsListView']['items']['addMany'](this['itemsViews']),this['setTemplate']({'tag':'li','attributes':{'class':['ck-ai-chat-history__section',_0x4806ae['if']('isVisible','ck-hidden',_0x26a5b8=>!_0x26a5b8)]},'children':[_0x35ea9b,this['_itemsListView']]});}['filter'](_0x6e51ca){const _0x1b8d9d=this['itemsViews']['length'];let _0x4521dd=0x0;for(const _0x433434 of this['itemsViews']){if(_0x6e51ca){const _0x19601b=_0x433434['isMatching'](_0x6e51ca);_0x433434['isVisible']=!!_0x19601b,_0x433434['highlightText'](_0x6e51ca);}else _0x433434['isVisible']=!0x0,_0x433434['highlightText'](null);_0x433434['isVisible']&&_0x4521dd++;}return this['isVisible']=_0x4521dd>0x0,{'resultsCount':_0x4521dd,'totalItemsCount':_0x1b8d9d};}['getItem'](_0x5736ed){return this['itemsViews']['find'](_0x3b2f78=>_0x3b2f78['id']===_0x5736ed);}['removeItem'](_0x15d993){const _0x7aae1f=this['itemsViews']['indexOf'](_0x15d993);-0x1!==_0x7aae1f&&(this['itemsViews']['splice'](_0x7aae1f,0x1),this['_itemsListView']['items']['remove'](_0x15d993));}}class AIChatHistoryListItemView extends/* #__PURE__ -- @preserve */
|
|
27
|
+
_0x49be0b(Pt){['id'];static ['LOADING_LABELS']={'remove':'AI_CHAT_HISTORY_LOADING_REMOVING','rename':'AI_CHAT_HISTORY_LOADING_RENAMING','pin':'AI_CHAT_HISTORY_LOADING_PINNING','unpin':'AI_CHAT_HISTORY_LOADING_UNPINNING'};['actions'];['mainContent'];['_titleView'];constructor(_0x1b96a8,_0x19554e){super(_0x1b96a8);const _0x2201bd=this['bindTemplate'];this['set']('isEdit',!0x1),this['set']('isVisible',!0x0),this['set']('pinned',!!_0x19554e['pinned']),this['set']('loadingState',null),this['set']('title',_0x19554e['title']),this['id']=_0x19554e['id'];const {createdAt:_0x4b601c,active:_0x3b8a00=!0x1}=_0x19554e;this['_titleView']=new _0xf9dbb2(),this['_titleView']['bind']('text')['to'](this,'title',t=>_0x292a51(t||'')),this['_titleView']['extendTemplate']({'attributes':{'class':['ck-ai-chat-history__item-title']}});const _0x2e6dcf=this['_createCheckView'](),_0xeaec34=this['_createPinButtonView'](_0x1b96a8),_0x19e158=this['_createMenuDropdownView'](),_0x468bb3=this['_createEditInputView'](_0x1b96a8),_0x3fe4a8=this['_createAcceptEditButtonView'](_0x1b96a8,_0x468bb3),_0x3f353a=this['_createCancelEditButtonView'](_0x1b96a8);this['actions']=this['createCollection'](),this['mainContent']=this['createCollection'](),this['mainContent']['add'](this['_titleView']),this['actions']['add'](_0xeaec34),this['actions']['add'](_0x19e158),this['on']('change:isEdit',(_0x3fa2cb,_0x2fb9ff,_0x16368c)=>{this['actions']['clear'](),this['mainContent']['clear'](),_0x16368c?(this['actions']['add'](_0x3fe4a8),this['actions']['add'](_0x3f353a),this['mainContent']['add'](_0x468bb3),_0x468bb3['element']['value']=this['title']||'',_0x468bb3['element']['focus']()):(this['actions']['add'](_0xeaec34),this['actions']['add'](_0x19e158),this['mainContent']['add'](this['_titleView']));}),this['setTemplate']({'tag':'li','attributes':{'class':['ck-ai-chat-history__item',_0x3b8a00?'ck-ai-chat-history__item--active':'',_0x2201bd['if']('isVisible','ck-hidden',_0x3fb4db=>!_0x3fb4db),_0x2201bd['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',_0x2201bd['if']('loadingState','ck-hidden',_0x8e9600=>!!_0x8e9600)]},'children':_0x3b8a00?[_0x2e6dcf]:[]},{'tag':'div','attributes':{'class':['ck-ai-loader',_0x2201bd['if']('loadingState','ck-hidden',_0x5131d7=>!_0x5131d7)]},'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',_0x2201bd['if']('loadingState','ck-hidden',_0x130812=>!!_0x130812)]},'children':this['mainContent']},{'tag':'div','attributes':{'class':['ck-ai-loader__text',_0x2201bd['if']('loadingState','ck-hidden',_0x4719b8=>!_0x4719b8)]},'children':[{'text':_0x2201bd['to']('loadingState',_0x5e2587=>_0x5e2587?Hi(this['locale'],AIChatHistoryListItemView['LOADING_LABELS'][_0x5e2587]):'')}]}]},{'tag':'span','attributes':{'class':['ck-ai-chat-history__item-date']},'children':[_0x4b601c]}]},{'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'](_0x1ace14){this['set']('title',_0x1ace14);}['updateLoadingState'](_0x484fbe,_0x312ed9){this['set']('loadingState',_0x312ed9?_0x484fbe:null);}['_createCheckView'](){const _0x11bf92=new xt();return _0x11bf92['set']({'content':_0xfcbf97}),_0x11bf92;}['_createPinButtonView'](_0x5b0f2a){const _0x3ef9f3=new vt(_0x5b0f2a);return _0x3ef9f3['set']({'label':Hi(_0x5b0f2a,'AI_CHAT_HISTORY_PIN_BUTTON'),'icon':_0xd1b736,'withText':!0x1,'tooltip':!0x0}),_0x3ef9f3['bind']('isOn')['to'](this,'pinned'),_0x3ef9f3['on']('execute',()=>{const _0x22c590=!this['pinned'];this['fire']('setConversationPinned',{'id':this['id'],'pinned':_0x22c590});}),_0x3ef9f3;}['_createMenuDropdownView'](){const _0x31767d=Gt(this['locale']),_0x2c8f0c=_0x31767d['panelView']['children'];_0x31767d['buttonView']['set']({'label':Hi(this['locale'],'AI_CHAT_HISTORY_SHOW_MORE_ITEMS'),'icon':_0x348395}),_0x31767d['panelPosition']='sw';const _0xb372b3=new vt(this['locale']);_0xb372b3['label']=Hi(this['locale'],'AI_CHAT_HISTORY_EDIT_NAME'),_0xb372b3['withText']=!0x0,_0xb372b3['on']('execute',()=>{this['isEdit']=!0x0;});const _0x590893=new vt(this['locale']);_0x590893['label']=Hi(this['locale'],'AI_CHAT_HISTORY_REMOVE'),_0x590893['withText']=!0x0,_0x590893['on']('execute',()=>{this['showConfirm'](Hi(this['locale'],'AI_CHAT_HISTORY_REMOVE_CONFIRM'),this['element'])['then'](()=>{this['fire']('removeConversation',{'id':this['id']});});});const _0x502e0c=new Dt(this['locale']),_0x55486f=new Pt(this['locale']);_0x55486f['children']['add'](_0xb372b3);const _0x5c6c9a=new Pt(this['locale']);return _0x5c6c9a['children']['add'](_0x590893),_0x502e0c['items']['addMany']([_0x55486f,_0x5c6c9a]),_0x2c8f0c['add'](_0x502e0c),_0x31767d;}['_createEditInputView'](_0x256041){const _0x293821=new _0x347a68(_0x256041),_0x34bb3d=_0x293821['bindTemplate'];return _0x293821['extendTemplate']({'on':{'keydown':_0x34bb3d['to'](_0xfd9845=>{'Enter'==_0xfd9845['key']&&this['_commitEditInputValue'](_0x293821);})}}),_0x293821;}['_createAcceptEditButtonView'](_0x550956,_0x452f49){const _0x1185b7=new vt(_0x550956);return _0x1185b7['set']({'icon':_0xfcbf97,'withText':!0x1,'tooltip':Hi(_0x550956,'AI_CHAT_HISTORY_ACCEPT')}),_0x1185b7['extendTemplate']({'attributes':{'class':['ck-confirm-view-submit']}}),_0x1185b7['on']('execute',()=>{this['_commitEditInputValue'](_0x452f49);}),_0x1185b7;}['_commitEditInputValue'](_0x16f22b){const _0xd604e=_0x16f22b['element']['value']||'';this['isEdit']=!0x1,this['fire']('editConversationTitle',{'id':this['id'],'title':_0xd604e});}['_createCancelEditButtonView'](_0x446038){const _0x576d64=new vt(_0x446038);return _0x576d64['set']({'icon':_0x189920,'withText':!0x1,'tooltip':Hi(_0x446038,'AI_CHAT_HISTORY_CANCEL')}),_0x576d64['extendTemplate']({'attributes':{'class':['ck-confirm-view-cancel']}}),_0x576d64['on']('execute',()=>{this['isEdit']=!0x1,this['fire']('edit:cancel');}),_0x576d64;}['_createSpinnerView'](){const _0x27f973=new AISpinnerView('tiny');return _0x27f973['isVisible']=!0x0,_0x27f973;}['isMatching'](_0x165736){return'string'==typeof this['title']&&this['title']['match'](_0x165736)?{'title':!0x0}:null;}['highlightText'](_0x497289){this['_titleView']['highlightText'](_0x497289);}}class AIChatHistoryView extends Nt{['headerView'];['searchView'];['mainErrorView'];['skeletonView'];['emptyView'];['sectionsView'];constructor(_0x4ebc8b,_0x44c633){super(_0x4ebc8b),this['set']('hasItems',!0x1),this['set']('isLoading',!0x0),this['set']('errorMessage',''),this['set']('isSearchViewVisible',!0x1),this['set']('isEmptyViewVisible',!0x1),this['set']('isMainErrorViewVisible',!0x1);const _0x4f17a5=vn(_0x4ebc8b,this);this['headerView']=new AIHeaderView(_0x4ebc8b,{'label':Hi(_0x4ebc8b,'AI_CHAT_HISTORY_HEADING'),'icon':_0x5db7a2,'class':'ck-ai-header_history','content':_0x4f17a5,'showResizeButton':_0x44c633}),this['headerView']['delegate']('resizeTabs')['to'](this),this['sectionsView']=new AIChatHistorySectionListView(_0x4ebc8b,[]),this['sectionsView']['delegate'](...Nn)['to'](this),this['mainErrorView']=this['_createErrorView'](),this['skeletonView']=this['_createSkeletonView'](),this['emptyView']=this['_createEmptyStateView'](),this['searchView']=this['_createSearchView'](),this['mainErrorView']['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isMainErrorViewVisible','ck-hidden',_0x12943b=>!_0x12943b)]}}),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 _0x4d6ee0=new _0x360153(this['locale'],{'filteredView':this['sectionsView'],'queryView':{'label':Hi(this['locale'],'AI_CHAT_HISTORY_SEARCH_LABEL')},'infoView':{'text':{'notFound':{'primary':_0x4dcb5b=>Hi(this['locale'],'AI_CHAT_HISTORY_SEARCH_NOT_FOUND_PRIMARY',_0x4dcb5b),'secondary':Hi(this['locale'],'AI_CHAT_HISTORY_SEARCH_NOT_FOUND_SECONDARY')}}}}),_0x3a1210=this['_createErrorView']();return _0x3a1210['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('errorMessage','ck-hidden',_0x43956d=>!_0x43956d)]}}),_0x4d6ee0['on']('render',()=>{_0x4d6ee0['children']['add'](_0x3a1210,0x1);}),_0x4d6ee0['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isSearchViewVisible','ck-hidden',_0x105f45=>!_0x105f45)]}}),_0x4d6ee0;}['_createSkeletonView'](){const _0x6cf683=new AISkeletonView(this['locale'],Ss['aiHistory']);return _0x6cf683['bind']('isVisible')['to'](this,'isLoading'),_0x6cf683;}['_createErrorView'](){const _0x45161b=new Nt(this['locale']),_0x5acea1=new vt(this['locale']);_0x5acea1['set']({'withText':!0x1,'icon':_0x189920,'class':'ck-ai-notification_error__dismiss-button'}),_0x5acea1['bind']('isVisible')['to'](this,'hasItems',_0x223e66=>!!_0x223e66),_0x5acea1['on']('execute',()=>{this['errorMessage']='';});const _0x44cd72=this['bindTemplate'];return _0x45161b['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-notification','ck-ai-notification_error']},'children':[{'tag':'p','children':[{'text':_0x44cd72['to']('errorMessage')}]},_0x5acea1]}),_0x45161b;}['_createEmptyStateView'](){const _0x28f750=new Nt(this['locale']);return _0x28f750['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-chat-history__empty',this['bindTemplate']['if']('isEmptyViewVisible','ck-hidden',_0x2ec955=>!_0x2ec955)]},'children':[{'tag':'p','attributes':{'class':['ck-ai-chat-history__empty-message']},'children':[Hi(this['locale'],'AI_CHAT_HISTORY_EMPTY_MESSAGE')]}]}),_0x28f750;}['_createListItemViews'](_0xdcc415,_0x1098af){const _0x559780=[];for(const _0x27af05 of _0xdcc415){const _0x37719c=new AIChatHistoryListItemView(_0x1098af,_0x27af05);_0x37719c['delegate'](...Nn)['to'](this),_0x559780['push'](_0x37719c);}return _0x559780;}['updateHistoryItemsWithCategories'](_0x107223){const _0x4e0511=this['locale']||'en',_0x2684a0=[];for(const _0x43904b of _0x107223){const _0x3ad103=this['_createListItemViews'](_0x43904b['items'],_0x4e0511);_0x2684a0['push'](new AIChatHistoryListView(_0x4e0511,{'title':_0x43904b['title'],'items':_0x3ad103}));}this['sectionsView']['sections']=_0x2684a0,this['sectionsView']['items']['clear'](),this['sectionsView']['items']['addMany'](_0x2684a0),this['hasItems']=_0x107223['some'](_0x3c7e93=>_0x3c7e93['items']['length']>0x0),this['_refreshSearch']();}['removeHistoryItem'](_0x111dbe){for(const _0x2fb3e7 of this['sectionsView']['sections']){const _0x54a69c=_0x2fb3e7['getItem'](_0x111dbe);if(_0x54a69c){if(_0x2fb3e7['removeItem'](_0x54a69c),0x0===_0x2fb3e7['itemsViews']['length']){const _0xdbf31=this['sectionsView']['sections']['indexOf'](_0x2fb3e7);-0x1!==_0xdbf31&&(this['sectionsView']['sections']['splice'](_0xdbf31,0x1),this['sectionsView']['items']['remove'](_0x2fb3e7));}this['hasItems']=this['sectionsView']['sections']['length']>0x0,this['_refreshSearch']();break;}}}['updateItemTitle'](_0x1f29ad,_0x8a716a){for(const _0x3deb4e of this['sectionsView']['sections']){const _0x38a5fd=_0x3deb4e['getItem'](_0x1f29ad);if(_0x38a5fd){_0x38a5fd['updateTitle'](_0x8a716a);break;}}}['updateItemLoadingState'](_0x2f22e8,_0x65498d,_0x1923b0){for(const _0x3c0575 of this['sectionsView']['sections']){const _0x456e3d=_0x3c0575['getItem'](_0x2f22e8);if(_0x456e3d){_0x456e3d['updateLoadingState'](_0x65498d,_0x1923b0);break;}}}['_refreshSearch'](){if(this['hasItems']){const _0xce2208=this['searchView']['queryView']['fieldView']?.['element']?.['value']||'';this['searchView']['search'](_0xce2208);}}}const Nn=['showConversationHistory','removeConversation','editConversationTitle','setConversationPinned','selectConversation','startConversation'];class AIChatHistoryUI extends _0x530a64{static get['requires'](){return[AITabs];}['_historyView'];static get['pluginName'](){return'AIChatHistoryUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x247fa0){super(_0x247fa0);const _0x22b55f=this['context']['plugins']['get']('AITabs');this['_historyView']=new AIChatHistoryView(this['context']['locale'],_0x22b55f['showResizeButton']),this['_historyView']['delegate']('resizeTabs')['to'](_0x22b55f),this['_historyView']['delegate'](...Nn)['to'](this),this['_historyView']['headerView']['bind']('isMaximized')['to'](_0x22b55f['view'],'isMaximized',_0x131eb4=>_0x131eb4),_0x22b55f['view']['addTab']({'id':'history','buttonLabel':Hi(this['context']['locale'],'AI_CHAT_HISTORY_HEADING'),'buttonIcon':_0x5db7a2,'order':0x0,'content':this['_historyView']});}['removeHistoryItem'](_0x219ae2){this['_historyView']['removeHistoryItem'](_0x219ae2);}['updateItems'](_0x3defcc){this['_historyView']['updateHistoryItemsWithCategories'](_0x3defcc);}['updateItemTitle'](_0x2f810c,_0x1e4cc3){this['_historyView']['updateItemTitle'](_0x2f810c,_0x1e4cc3);}['updateItemLoadingState'](_0x56a056,_0x4d88f2,_0xe82060){this['_historyView']['updateItemLoadingState'](_0x56a056,_0x4d88f2,_0xe82060);}['setLoadingSkeleton'](_0x350805){this['_historyView']['isLoading']=_0x350805;}['showError'](_0x3f1640){this['_historyView']['errorMessage']=_0x3f1640;}['hideError'](){this['_historyView']['errorMessage']='';}}class AIChatHistoryItem extends ht(){['id'];['createdAt'];constructor({id:_0x448566,title:_0x499d4b,createdAt:_0x211c93,updatedAt:_0xcecc64,pinned:_0x3bb2d6}){super(),this['id']=_0x448566,this['createdAt']=new Date(_0x211c93),this['set']('title',_0x499d4b),this['set']('updatedAt',_0xcecc64?new Date(_0xcecc64):null),this['set']('pinned',_0x3bb2d6||!0x1);}['updateTitle'](_0x1f07ed){this['set']('title',_0x1f07ed),this['updatedAt']=new Date();}['updatePinned'](_0x4764d1){this['set']('pinned',_0x4764d1),this['updatedAt']=new Date();}}class AIChatHistoryConversations extends Et(){['items']=[];['connector'];['group'];constructor({connector:_0x989c01,group:_0x47b3ab}){super(),this['connector']=_0x989c01,this['group']=_0x47b3ab;}async['init'](){try{const _0x4ab551=this['connector']['fetchConversations'](this['group']),_0x26a6d4=await _0x4ab551['getConversations']();this['loadItems'](_0x26a6d4);}catch(_0x3b2d09){this['fire']('error',{'error':_0x3b2d09,'operation':'init'});}}['addItem'](_0x24e134){this['items']['push'](_0x24e134);}async['removeItem'](_0x124eab){const _0x24b143=this['items']['findIndex'](_0x22a85d=>_0x22a85d['id']===_0x124eab);if(-0x1===_0x24b143)return!0x1;try{return await this['connector']['deleteConversation'](_0x124eab)['execute'](),this['items']['splice'](_0x24b143,0x1),this['fire']('itemRemoved',{'itemId':_0x124eab}),!0x0;}catch(_0x50cede){return this['fire']('error',{'error':_0x50cede,'operation':'removeItem','itemId':_0x124eab}),!0x1;}}['getItem'](_0x33f0e3){return this['items']['find'](_0xe822ea=>_0xe822ea['id']===_0x33f0e3);}async['updateItemTitle'](_0x1a07d5,_0x3d1bfe){const _0x2193d5=this['getItem'](_0x1a07d5);if(!_0x2193d5)return!0x1;try{return await this['connector']['updateConversation'](_0x1a07d5,{'title':_0x3d1bfe})['getResult'](),_0x2193d5['updateTitle'](_0x3d1bfe),this['fire']('itemUpdated',{'itemId':_0x1a07d5,'updates':{'title':_0x3d1bfe}}),!0x0;}catch(_0x2ba2fa){return this['fire']('error',{'error':_0x2ba2fa,'operation':'updateItemTitle','itemId':_0x1a07d5}),!0x1;}}async['updateItemPinned'](_0x2f506d,_0x21b8e1){const _0x359d8f=this['getItem'](_0x2f506d);if(!_0x359d8f)return!0x1;try{return await this['connector']['updateConversation'](_0x2f506d,{'pinned':_0x21b8e1})['getResult'](),_0x359d8f['updatePinned'](_0x21b8e1),this['fire']('itemUpdated',{'itemId':_0x2f506d,'updates':{'pinned':_0x21b8e1}}),!0x0;}catch(_0x329783){return this['fire']('error',{'error':_0x329783,'operation':'updateItemPinned','itemId':_0x2f506d}),!0x1;}}['loadItems'](_0x527386){try{this['items']=[],_0x527386['map'](_0x1dc6d3=>{this['addItem'](new AIChatHistoryItem(_0x1dc6d3));}),this['fire']('itemsLoaded',{'items':[...this['items']]});}catch(_0x4de21b){this['fire']('error',{'error':_0x4de21b,'operation':'loadItems'});}}['getItems'](_0x4c55e4={}){const _0x3924c4=void 0x0!==_0x4c55e4['pinned']&&_0x4c55e4['pinned'],_0x254d04=_0x4c55e4['from']?new Date(_0x4c55e4['from']['getFullYear'](),_0x4c55e4['from']['getMonth'](),_0x4c55e4['from']['getDate']()):null,_0x1d97c5=_0x4c55e4['to']?new Date(_0x4c55e4['to']['getFullYear'](),_0x4c55e4['to']['getMonth'](),_0x4c55e4['to']['getDate']()):null;return this['items']['filter'](_0x5346f4=>{if(_0x5346f4['pinned']!==_0x3924c4)return!0x1;if(_0x1d97c5){const _0x1c243=new Date(_0x5346f4['createdAt']['getFullYear'](),_0x5346f4['createdAt']['getMonth'](),_0x5346f4['createdAt']['getDate']());return _0x254d04?_0x254d04['getTime']()===_0x1d97c5['getTime']()?_0x1c243['getTime']()===_0x254d04['getTime']():_0x1c243<_0x1d97c5&&_0x1c243>=_0x254d04:_0x1c243<_0x1d97c5;}return!0x0;});}}class AIChatHistoryController extends _0x530a64{['_aiConnector'];['_aiChatHistoryUi'];['_aiChatController'];static get['requires'](){return[AIConnector,AIChatController,AIChatHistoryUI,AITabs];}static get['pluginName'](){return'AIChatHistoryController';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){this['_aiConnector']=this['context']['plugins']['get'](AIConnector),this['_aiChatHistoryUi']=this['context']['plugins']['get'](AIChatHistoryUI),this['_aiChatController']=this['context']['plugins']['get'](AIChatController);const _0x13ce18=this['context']['plugins']['get'](AITabs);try{const _0x3eade8=this['_aiChatController']['getGroupId']();this['history']=new AIChatHistoryConversations({'connector':this['_aiConnector'],'group':_0x3eade8}),this['listenTo'](this['_aiChatHistoryUi'],'removeConversation',(_0x59006d,_0x28bae6)=>{this['_setItemLoading'](_0x28bae6['id'],'remove'),this['_handleRemove'](_0x28bae6['id']);}),this['listenTo'](this['_aiChatHistoryUi'],'editConversationTitle',(_0x3981c8,_0x3d3821)=>{this['_setItemLoading'](_0x3d3821['id'],'rename'),this['_handleEditTitle'](_0x3d3821['id'],_0x3d3821['title']);}),this['listenTo'](this['history'],'itemUpdated',(_0x12ab7b,_0x500c15)=>{void 0x0!==_0x500c15['updates']['title']&&this['_aiChatHistoryUi']['updateItemTitle'](_0x500c15['itemId'],_0x500c15['updates']['title']),void 0x0!==_0x500c15['updates']['pinned']&&this['_updateHistoryItemsUI'](),this['_clearItemLoading'](_0x500c15['itemId']);}),this['listenTo'](this['history'],'itemRemoved',(_0x292684,_0x23b131)=>{this['_aiChatController']['_handleRemovedConversation'](_0x23b131['itemId']),this['_aiChatHistoryUi']['removeHistoryItem'](_0x23b131['itemId']),this['_clearItemLoading'](_0x23b131['itemId']);}),this['listenTo'](this['history'],'itemsLoaded',()=>{this['_updateHistoryItemsUI']();}),this['listenTo'](this['history'],'error',(_0x42fc9e,_0x5edd8f)=>{this['_handleHistoryErrorUI'](_0x5edd8f['error'],_0x5edd8f['operation'],_0x5edd8f['itemId']);}),this['listenTo'](this['_aiChatHistoryUi'],'selectConversation',(_0x3b1e2e,_0x2728c9)=>{this['_handleSelectConversation'](_0x2728c9['id']);}),this['listenTo'](this['_aiChatHistoryUi'],'setConversationPinned',(_0x9e37b2,_0x4bd0d8)=>{const _0x3bd599=_0x4bd0d8['pinned']?'pin':'unpin';this['_setItemLoading'](_0x4bd0d8['id'],_0x3bd599),this['_handleTogglePin'](_0x4bd0d8['id'],_0x4bd0d8['pinned']);}),this['listenTo'](this['_aiChatHistoryUi'],'startConversation',()=>{this['_aiChatController']['startConversation'](),_0x13ce18['view']['activateTab']('chat');}),this['listenTo'](this['_aiChatController'],'change:activeConversation',()=>{this['_updateHistoryItemsUI']();}),_0x13ce18['view']['on']('activateTab:history',()=>{this['_showConversationHistory']();});}catch(_0x191cd2){this['_handleHistoryErrorUI'](_0x191cd2,'init');}}async['_handleEditTitle'](_0x3d0f9c,_0x2ceff3){await this['history']['updateItemTitle'](_0x3d0f9c,_0x2ceff3);}async['_handleTogglePin'](_0x4270c0,_0x1e5272){await this['history']['updateItemPinned'](_0x4270c0,_0x1e5272);}async['_handleRemove'](_0x594f60){await this['history']['removeItem'](_0x594f60);}async['_handleSelectConversation'](_0x3588cb){await this['_aiChatController']['loadConversation'](_0x3588cb);}async['_showConversationHistory'](){this['_aiChatHistoryUi']['showError'](''),this['_aiChatHistoryUi']['setLoadingSkeleton'](!0x0),await this['history']['init'](),this['_aiChatHistoryUi']['setLoadingSkeleton'](!0x1);}['_updateHistoryItemsUI'](){const _0xaab9fe=this['_aiChatController']['activeConversation']?.['id'],_0x1fa890=this['_getCategorizedItems']()['map'](_0x5508f3=>({'title':_0x5508f3['title'],'items':_0x5508f3['items']['map'](_0x4cb98e=>({'id':_0x4cb98e['id'],'title':_0x4cb98e['title']||Hi(this['context']['locale'],'AI_CHAT_UNTITLED_CONVERSATION'),'createdAt':new Date(_0x4cb98e['createdAt'])['toLocaleDateString'](),'active':_0x4cb98e['id']===_0xaab9fe,'pinned':_0x4cb98e['pinned']}))}));this['_aiChatHistoryUi']['updateItems'](_0x1fa890);}['_setItemLoading'](_0x1fcec6,_0x331c1a){this['_aiChatHistoryUi']['updateItemLoadingState'](_0x1fcec6,_0x331c1a,!0x0);}['_clearItemLoading'](_0x16d789){this['_aiChatHistoryUi']['updateItemLoadingState'](_0x16d789,null,!0x1);}['_handleHistoryErrorUI'](_0x320d2c,_0x2c1c8a,_0x4b48c7){const _0x1fbb0b=this['_generateErrorMessage'](_0x2c1c8a,_0x4b48c7);this['_aiChatHistoryUi']['showError'](_0x1fbb0b),_0x4b48c7&&this['_clearItemLoading'](_0x4b48c7),this['_aiChatHistoryUi']['setLoadingSkeleton'](!0x1);}['_generateErrorMessage'](_0x25d970,_0x551425){const _0x5941bc=_0x551425?this['history']['getItem'](_0x551425):null,_0x2b145a=_0x5941bc?.['title']||Hi(this['context']['locale'],'AI_CHAT_UNTITLED_CONVERSATION');switch(_0x25d970){case'updateItemTitle':return Hi(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_UPDATE_TITLE',_0x2b145a);case'updateItemPinned':{const _0x117d5b=Hi(this['context']['locale'],_0x5941bc?.['pinned']?'AI_CHAT_HISTORY_UNPIN_ACTION':'AI_CHAT_HISTORY_PIN_ACTION');return Hi(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_UPDATE_PINNED',[_0x117d5b,_0x2b145a]);}case'removeItem':return Hi(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_REMOVE_ITEM',_0x2b145a);case'init':case'loadItems':return Hi(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_LOAD_ITEMS');default:return Hi(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_GENERIC');}}['_getCategorizedItems'](){const _0x5e8e3d=new Date(),_0x541062=new Date(_0x5e8e3d['getFullYear'](),_0x5e8e3d['getMonth'](),_0x5e8e3d['getDate']()),_0x263e1f=new Date(_0x541062);_0x263e1f['setDate'](_0x263e1f['getDate']()-0x1);const _0x3badc7=new Date(_0x541062);_0x3badc7['setDate'](_0x3badc7['getDate']()-0xe);const _0xd7c1aa=this['history']['getItems']({'pinned':!0x0}),_0x3d399c=this['history']['getItems']({'from':_0x541062,'to':_0x541062}),_0x31d461=this['history']['getItems']({'from':_0x263e1f,'to':_0x263e1f}),_0x3dc102=this['history']['getItems']({'from':_0x3badc7,'to':_0x263e1f}),_0x56e666=this['history']['getItems']({'to':_0x3badc7}),_0x57abd7=[];return _0xd7c1aa['length']>0x0&&_0x57abd7['push']({'title':Hi(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_PINNED'),'items':_0xd7c1aa}),_0x3d399c['length']>0x0&&_0x57abd7['push']({'title':Hi(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_TODAY'),'items':_0x3d399c}),_0x31d461['length']>0x0&&_0x57abd7['push']({'title':Hi(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_YESTERDAY'),'items':_0x31d461}),_0x3dc102['length']>0x0&&_0x57abd7['push']({'title':Hi(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_LAST_14_DAYS'),'items':_0x3dc102}),_0x56e666['length']>0x0&&_0x57abd7['push']({'title':Hi(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_LATER'),'items':_0x56e666}),_0x57abd7;}}class AIChatHistory extends _0x530a64{static get['requires'](){return[AIChatHistoryController,AIChatHistoryUI];}static get['pluginName'](){return'AIChatHistory';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}class AIChat extends _0x530a64{static get['requires'](){return[AIChatController,AIEditing,AIChatUI,AIChatHistory];}static get['pluginName'](){return'AIChat';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x5d0c95){super(_0x5d0c95),this['context']['config']['define']('ai.chat.context',{'document':{'enabled':!0x0},'urls':{'enabled':!0x0},'files':{'enabled':!0x0},'sources':[],'alwaysAddSelection':!0x1}),this['context']['config']['define']('ai.chat.initialConversation','new');}}class AIChatShortcutView extends vt{['id'];constructor(_0x510114,_0x503866){super(_0x510114);const {id:_0x2cace2,type:_0x5e3281,icon:_0x3a7c21}=_0x503866;this['id']=_0x2cace2,this['set']({'label':_0x503866['label'],'withText':!0x0,'class':'ck-ai-chat-shortcut'}),this['extendTemplate']({'attributes':{'data-cke-ai-shortcut-id':_0x503866['id']}}),_0x3a7c21?this['icon']=_0x3a7c21:'chat'===_0x5e3281?this['icon']=_0x2ef84a:'review'===_0x5e3281?this['icon']=_0x76da7e:'translate'===_0x5e3281&&(this['icon']=_0xb0c3ee);}}class AIChatShortcutsView extends Nt{['listView'];constructor(_0x2ee522,_0x485bb3){super(_0x2ee522);const _0x1805a2=_0x485bb3['map'](_0x39f3c5=>{const _0x22e08b=new Pt(this['locale']),_0x1fae1f=new AIChatShortcutView(this['locale'],_0x39f3c5);return _0x22e08b['children']['add'](_0x1fae1f),_0x1fae1f['delegate']('execute')['to'](this),_0x22e08b;});this['listView']=new Dt(this['locale']),this['listView']['items']['addMany'](_0x1805a2),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat-shortcuts']},'children':[this['listView']]});}}const yn='chat-shortcuts';class AIChatShortcuts extends _0x530a64{['_shortcuts'];['_shortcutsView'];['_aiChatUI'];static get['requires'](){return[AIChatUI];}static get['pluginName'](){return'AIChatShortcuts';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){this['_aiChatUI']=this['context']['plugins']['get'](AIChatUI),this['_shortcuts']=this['context']['config']['get']('ai.chat.shortcuts')??[];const _0x41cc99=this['context']['plugins']['get']('AIChatController');this['_shortcuts']['length']&&(this['_validateShortcuts'](),this['_aiChatUI']['on']('conversationCreated',()=>{_0x41cc99['activeConversation']['isFromHistory']||this['_injectShortcuts']();}),this['listenTo'](_0x41cc99,'interactionStarted',()=>{this['_removeShortcuts']();}));}['_validateShortcuts'](){const _0x15dce3=['chat','review','translate'];this['_shortcuts']['forEach'](_0x591db4=>{let _0x5da19d=!0x0;if(_0x591db4['id']&&_0x591db4['label']&&_0x15dce3['includes'](_0x591db4['type'])?'chat'===_0x591db4['type']&&(_0x5da19d='string'==typeof _0x591db4['prompt']):_0x5da19d=!0x1,!_0x5da19d)throw new at('ai-chat-shortcuts-invalid-config',this['context'],{'shortcut':_0x591db4});});}['_injectShortcuts'](){const _0x86858b=this['context']['plugins']['get'](AIChatUI);this['_shortcutsView']=new AIChatShortcutsView(this['context']['locale'],this['_shortcuts']),this['_shortcutsView']['render'](),_0x86858b['addFeedItemCustomElement'](this['_shortcutsView']['element'],yn),this['_shortcutsView']['on']('execute',_0x22d728=>{const _0x4c4d17=_0x22d728['source']['id'];this['_executeShortcut'](_0x4c4d17);});}['_removeShortcuts'](){const _0x1925a2=this['context']['plugins']['get'](AIChatUI);_0x1925a2['hasFeedItem'](yn)&&_0x1925a2['removeFeedItem'](yn),this['_shortcutsView']?.['destroy']();}['_executeShortcut'](_0x50ef53){const _0x407792=this['_shortcuts']['find'](_0x26678b=>_0x26678b['id']===_0x50ef53),_0x1291cc=_0x407792['type'];'chat'===_0x1291cc?this['_runChatShortcut'](_0x407792):'review'===_0x1291cc?_0x407792['commandId']?this['_runReviewShortcut'](_0x407792):this['_switchTab']('reviewMode'):'translate'===_0x1291cc&&(_0x407792['language']?this['_runTranslateShortcut'](_0x407792):this['_switchTab']('translate'));}['_switchTab'](_0x34a31b){if(!this['context']['plugins']['has']('AITabs'))throw new at('ai-chat-shortcuts-ai-tabs-not-found',this['context'],{'tabName':_0x34a31b});this['context']['plugins']['get']('AITabs')['view']['activateTab'](_0x34a31b);}async['_runChatShortcut']({prompt:_0x478daf,draftMode:_0xaa239a,useWebSearch:_0x4cedb0=!0x1,useReasoning:_0x27d56a=!0x1,model:_0x2f0505}){const _0x336f3c=this['context']['plugins']['get']('AIChatController'),_0x3da93e=_0x336f3c['activeConversation'];let _0x2b065b;_0x2b065b=_0x2f0505?await _0x3da93e['chatModels']['getModel'](_0x2f0505):await _0x3da93e['chatModels']['getDefault'](),_0x2b065b&&await _0x3da93e['setModel'](_0x2b065b),_0x3da93e['setWebSearch'](_0x4cedb0),_0x3da93e['setReasoning'](_0x27d56a),_0x336f3c['addCurrentDocumentToChatContext'](),_0xaa239a?(this['_aiChatUI']['setPromptInputValue'](_0x478daf),this['_aiChatUI']['focusPromptInput'](!0x0)):_0x336f3c['sendMessage']({'message':_0x478daf});}['_runReviewShortcut']({commandId:_0x525c8a,model:_0x56e3ec,prompt:_0x57acd8,params:_0x12a1a1}){if(!this['context']['plugins']['has']('AIReviewModeUI'))throw new at('ai-chat-shortcuts-review-mode-not-found',this['context']);this['_switchTab']('reviewMode');const _0x2c8b83={'id':_0x525c8a,'isCustom':'custom'===_0x525c8a};_0x56e3ec&&_0x57acd8&&(_0x2c8b83['args']={'model':_0x56e3ec,'prompt':_0x57acd8}),_0x12a1a1&&(_0x2c8b83['params']=_0x12a1a1),this['context']['plugins']['get']('AIReviewModeUI')['fire']('runReviewCheck',_0x2c8b83);}['_runTranslateShortcut']({language:_0xedd8c2}){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':_0xedd8c2,'args':{'language':_0xedd8c2}});}}class ToggleAICommand extends _0x244dfb{constructor(_0x2a3408){super(_0x2a3408);const _0x1d32e3=_0x2a3408['plugins']['get']('AITabs')['view'];this['bind']('value')['to'](_0x1d32e3,'isVisible'),this['isEnabled']=!0x0;}['execute'](){const _0x3ff883=this['editor']['plugins']['get']('AITabs')['view'];_0x3ff883['isVisible']=!_0x3ff883['isVisible'];}}class AIToggleButtonUI extends _0x21762c{static get['requires'](){return[AITabs];}static get['pluginName'](){return'AIToggleButtonUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const _0x4bd42e=this['editor'];_0x4bd42e['commands']['add']('toggleAi',new ToggleAICommand(_0x4bd42e)),_0x4bd42e['ui']['componentFactory']['add']('toggleAi',()=>{const _0x143e01=this['_createAIUIButton'](vt);return _0x143e01['set']({'tooltip':!0x0,'class':'ck-ai-toggle-button'}),_0x143e01;}),_0x4bd42e['ui']['componentFactory']['add']('menuBar:toggleAi',()=>{const _0x3a6ea2=this['_createAIUIButton'](Wt);return _0x3a6ea2['set']({'role':'menuitemcheckbox'}),_0x3a6ea2;});}['_createAIUIButton'](_0x4c6187){const _0x510780=this['editor'],_0x5ba3fd=_0x510780['commands']['get']('toggleAi'),_0x241a4b=new _0x4c6187(_0x510780['locale']);return _0x241a4b['set']({'label':Hi(_0x510780['locale'],'AI_TOGGLE_BUTTON_LABEL'),'icon':_0x9a1fd7,'isToggleable':!0x0}),_0x241a4b['bind']('isEnabled')['to'](_0x5ba3fd),_0x241a4b['bind']('isOn')['to'](_0x5ba3fd,'value',_0x1680cd=>!!_0x1680cd),this['listenTo'](_0x241a4b,'execute',()=>{_0x5ba3fd['execute']();}),_0x241a4b;}}const xn=['applySuggestion','insertSuggestion','showNext','showPrevious'];class AIBalloonView extends Nt{['_errorView'];constructor(_0x10b033){super(_0x10b033),this['set']('_errorMessage',''),this['set']('_isErrorVisible',!0x1);}['showBlockingError'](_0x28ec5f){this['showError'](_0x28ec5f);}['showError'](_0x42fd3b){this['_errorView']||(this['_errorView']=this['_createErrorView']()),this['_errorMessage']=_0x42fd3b,this['_isErrorVisible']=!0x0;}['hideError'](){this['_isErrorVisible']=!0x1;}['_createErrorView'](){const _0x5621f7=new Nt(this['locale']),_0x2e4d98=new Nt(this['locale']);return _0x2e4d98['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai-suggestion__error-text']},'children':[{'text':this['bindTemplate']['to']('_errorMessage')}]}),_0x5621f7['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__error','ck-ai-balloon-error',this['bindTemplate']['if']('_isErrorVisible','ck-hidden',_0x293469=>!_0x293469)]},'children':[_0x2e4d98]}),_0x5621f7;}}const Ln=0xa;class AIBalloon extends _0x530a64{static get['requires'](){return[AIEditing];}static get['pluginName'](){return'AIBalloon';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['isOpen']=!0x1;['_currentConfig'];['_getTargetEditor'](){return this['_currentConfig']?.['targetEditor']??ds(this['context']);}['_isUpdatingMarkers']=!0x1;['open'](_0x1605a5){const {id:_0x2a774d}=this['_currentConfig']??{};this['_currentConfig']=_0x1605a5;const {id:_0x207d03}=this['_currentConfig'];this['isOpen']&&_0x2a774d===_0x207d03?this['_updateDialog']():this['_showDialog']();}['close'](){const _0x543dae=this['_getTargetEditor']()['plugins']['get']('Dialog');_0x543dae['isOpen']&&this['_currentConfig']&&_0x543dae['id']===this['_currentConfig']['id']&&_0x543dae['hide']();}['_updateDialog'](){const _0x1024b6=this['_getTargetEditor']()['plugins']['get']('Dialog'),{icon:_0x37ae58,title:_0x2354b2}=this['_currentConfig'];_0x1024b6['view']?.['headerView']&&(_0x1024b6['view']['headerView']['label']=_0x2354b2,_0x1024b6['view']['headerView']['iconView']&&_0x37ae58&&(_0x1024b6['view']['headerView']['iconView']['content']=_0x37ae58)),this['_isUpdatingMarkers']=!0x0,this['_showFakeVisualSelection'](),this['_isUpdatingMarkers']=!0x1,_0x1024b6['view']?.['updatePosition']();}['_showFakeVisualSelection'](){this['context']['plugins']['get'](AIEditing)['showFakeVisualSelection']({'ranges':this['_currentConfig']['ranges'],'id':'balloon','priority':0x64}),window['getSelection']()?.['removeAllRanges']();}['_hideFakeVisualSelection'](){this['context']['plugins']['get'](AIEditing)['hideFakeVisualSelection']('balloon');}['_showDialog'](){const _0x3ba694=this['_getTargetEditor']()['plugins']['get']('Dialog'),{id:_0x23ba89,title:_0x47d9a4,icon:_0x2dc975,class:_0x29d7c9,mainView:_0x2c078a}=this['_currentConfig'];_0x2c078a['delegate'](...xn)['to'](this),_0x3ba694['show']({'title':_0x47d9a4,'icon':_0x2dc975,'hasCloseButton':!0x0,'id':_0x23ba89,'position':this['_calculateDialogPosition']['bind'](this),'className':'ck-ai-balloon\x20'+(_0x29d7c9||''),'content':_0x2c078a,'onShow':_0x16378d=>{this['_showFakeVisualSelection'](),this['_setupFakeVisualSelectionMarkerRemovalListener'](),_0x16378d['view']?.['updatePosition']();const _0x37aa4f=this['_getSelectionElements']();_0x37aa4f&&_0x37aa4f[0x0]&&wt({'target':_0x37aa4f[0x0],'ancestorOffset':0x14,'alignToTop':!0x0,'viewportOffset':{'top':0x14,'bottom':0x14,'left':0x0,'right':0x0}}),this['isOpen']=!0x0,_0x16378d['once']('hide',()=>{this['fire']('beforeDialogClosed',{'id':_0x23ba89});},{'priority':'high'});},'onHide':()=>{this['_hideFakeVisualSelection'](),this['_cleanupFakeVisualSelectionMarkerRemovalListener'](),this['fire']('dialogClosed',{'id':_0x23ba89}),this['isOpen']=!0x1;}});}['_calculateDialogPosition'](_0x1eb25c,_0x35dd45){if(!_0x35dd45){const _0x4e9d0b=this['_getTargetRootDomRect']();if(!_0x4e9d0b)return null;_0x35dd45=_0x4e9d0b;}const _0x2c36df=this['_getSelectionElements']();if(!_0x2c36df||0x0===_0x2c36df['length'])return{'left':Math['round'](_0x35dd45['left']+_0x35dd45['width']/0x2-_0x1eb25c['width']/0x2),'top':Math['round'](_0x35dd45['top']+_0x35dd45['height']/0x2-_0x1eb25c['height']/0x2)};const _0x5ec1e8=Math['round'](_0x35dd45['left']+_0x35dd45['width']/0x2-_0x1eb25c['width']/0x2),_0x3ff750=_0x2c36df['map'](_0x4454d0=>new ut(_0x4454d0)),_0x14463e=_0x1eb25c['height'];return{'left':_0x5ec1e8,'top':this['_calculateOptimalTopPosition'](_0x3ff750,_0x14463e,_0x35dd45)};}['_calculateOptimalTopPosition'](_0x2f1904,_0x518ca3,_0x3da053){const _0x3ec140=new ut(ct['window']),_0x70822d=_0x2f1904['map'](_0x30c035=>_0x30c035['getVisible']())['filter'](_0x3e14fd=>_0x3e14fd),_0x20ce25=ut['getBoundingRect'](_0x70822d);if(!_0x20ce25)return Math['round'](_0x3da053['top']+_0x3da053['height']/0x2);const _0x2f93e4=_0x3ec140['getIntersection'](_0x20ce25);if(!_0x2f93e4)return Math['round'](_0x3da053['top']+_0x3da053['height']/0x2);const _0x29cf2e=_0x3da053['getVisible'](),_0x542545=_0x29cf2e&&_0x20ce25['height']>_0x29cf2e['height'],_0x5b34b1=_0x2f93e4['top'],_0x20f915=_0x2f93e4['bottom'];if(_0x542545){const _0x4b1e3a=(_0x29cf2e||_0x3ec140)['height']/0x2-_0x518ca3/0x2,_0xeec5df=_0x5b34b1-Ln-_0x3da053['top'],_0x15457f=_0x3da053['bottom']-_0x20f915-Ln;return _0xeec5df>=_0x518ca3?Math['max'](Ln,_0x5b34b1-_0x518ca3-Ln):_0x15457f>=_0x518ca3?_0x20f915+Ln:Math['max'](Ln,_0x4b1e3a);}const _0x5f512c=_0x5b34b1-_0x518ca3,_0x4f3401=_0x3da053['bottom']-_0x20f915-Ln,_0x975bae=_0x5b34b1-Ln-_0x3da053['top'];let _0x313ac8;if(_0x4f3401>=_0x518ca3)_0x313ac8=_0x20f915+Ln;else{if(_0x975bae>=_0x518ca3)_0x313ac8=_0x5f512c-Ln;else _0x313ac8=_0x5b34b1+_0x20ce25['height']/0x2-_0x518ca3/0x2;}return _0x313ac8;}['_setupFakeVisualSelectionMarkerRemovalListener'](){const _0x40a7e4=this['_getTargetEditor']();this['listenTo'](_0x40a7e4['model']['document'],'change',()=>{if(!this['_isUpdatingMarkers']){for(const {name:_0x1e829a,data:{newRange:_0x1d1fe2}}of _0x40a7e4['model']['document']['differ']['getChangedMarkers']())if(_0x1e829a['startsWith'](As+':')&&(_0x1d1fe2&&(_0x1d1fe2['start']['isEqual'](_0x1d1fe2['end'])||'$graveyard'==_0x1d1fe2['root']['rootName'])||null==_0x1d1fe2)){const _0x5b2152=Hi(this['context']['locale'],'AI_BALLOON_SELECTION_REMOVED_ERROR');this['_currentConfig']['mainView']['showBlockingError'](_0x5b2152),this['fire']('selectionRemoved');}}});}['_cleanupFakeVisualSelectionMarkerRemovalListener'](){const _0x1e2815=this['_getTargetEditor']();this['_currentConfig']['mainView']['hideError'](),this['stopListening'](_0x1e2815['model']['document']);}['_getSelectionElements'](){const _0x3fd17a=this['_getTargetEditor']();return _0x4c63f0(_0x3fd17a['editing'],[..._0x3fd17a['model']['markers']['getMarkersGroup']('ai-selection'),..._0x3fd17a['model']['markers']['getMarkersGroup']('ai-balloon-selection')]);}['_getTargetRootDomRect'](){const _0x3a4963=this['_currentConfig']?.['ranges']?.[0x0]?.['root'];if(!_0x3a4963)return null;const _0x27f0a4=this['_getTargetEditor'](),_0x3f6550=_0x27f0a4['editing']['view']['document']['getRoot'](_0x3a4963['rootName']);if(!_0x3f6550)return null;const _0x15c46c=_0x27f0a4['editing']['view']['domConverter']['mapViewToDom'](_0x3f6550);return _0x15c46c&&_0x15c46c instanceof HTMLElement?new ut(_0x15c46c):null;}}class AIMiniToolbarView extends kt{['copyButton'];['likeButton'];['dislikeButton'];['showChangesButton'];['_config'];constructor(_0x5547c8,_0x36d16f={}){super(_0x5547c8),this['set']('isEnabled',!0x0),this['set']('isShowChangesOn',!0x1),this['_config']={'showCopy':!0x1,'showLike':!0x1,'showDislike':!0x1,..._0x36d16f};const _0x475f35=!(this['_config']['showCopy']||this['_config']['showChanges']||this['_config']['showLike']||this['_config']['showDislike']||this['_config']['customView']?.['length']);this['class']=_0x475f35?'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'](_0x57b362){this['showChangesButton']['isEnabled']=_0x57b362;}['_setupRatingButtons'](){this['likeButton']=new vt(this['locale']),this['likeButton']['set']({'icon':_0x45e759,'label':Hi(this['locale'],'AI_MINI_TOOLBAR_LIKE'),'class':Bi,'tooltip':!0x0}),this['likeButton']['bind']('isEnabled')['to'](this),this['likeButton']['on']('execute',()=>{this['fire']('like');}),this['dislikeButton']=new vt(this['locale']),this['dislikeButton']['set']({'icon':_0x2a8e16,'label':Hi(this['locale'],'AI_MINI_TOOLBAR_DISLIKE'),'class':Bi,'tooltip':!0x0}),this['dislikeButton']['bind']('isEnabled')['to'](this),this['dislikeButton']['on']('execute',()=>{this['fire']('dislike');});}['_setupCopyButton'](){this['copyButton']=new vt(this['locale']),this['copyButton']['set']({'icon':_0x2cf9ac,'label':Hi(this['locale'],'AI_MINI_TOOLBAR_COPY'),'class':'ck-ai-mini-toolbar-copy-button\x20'+Bi,'tooltip':!0x0}),this['copyButton']['bind']('isEnabled')['to'](this);const _0x1bcf18=new xt();_0x1bcf18['set']({'content':_0xfcbf97}),_0x1bcf18['extendTemplate']({'attributes':{'class':['ck-ai-mini-toolbar-copy-button__check-mark']}}),this['copyButton']['on']('execute',()=>{this['copyButton']['class']='ck-ai-mini-toolbar-copy-button\x20ck-ai-mini-toolbar-copy-button_copied\x20'+Bi,setTimeout(()=>{this['copyButton']['class']='ck-ai-mini-toolbar-copy-button\x20'+Bi;},0x7d0);}),this['copyButton']['children']['add'](_0x1bcf18);}['_setupShowChangesButton'](){this['showChangesButton']=new vt(this['locale']),this['showChangesButton']['set']({'icon':_0x3f4754,'label':Hi(this['locale'],'AI_SUGGESTION_BUTTON_SHOW_CHANGES'),'withText':'full'==this['_config']['showChanges'],'tooltip':'full'!=this['_config']['showChanges'],'class':Bi}),this['showChangesButton']['bind']('isOn')['to'](this,'isShowChangesOn'),this['showChangesButton']['bind']('isEnabled')['to'](this),this['showChangesButton']['bind']('icon')['to'](this,'isShowChangesOn',_0x50eaf9=>_0x50eaf9?_0x53c611:_0x3f4754),this['showChangesButton']['on']('execute',()=>{this['fire']('toggleShowChanges');});}}class AIChatBalloonView extends AIBalloonView{['children'];['nextButtonView'];['previousButtonView'];['focusCycler'];['_focusables'];['_focusTracker'];['_keystrokes'];['_config'];['_streamableContentView'];['_toolbarContainerView'];['_partToolbarView'];['_stateView'];['_miniToolbarView'];constructor(_0x47de11,_0x43f51d){super(_0x47de11);const _0x4bf5da=this['bindTemplate'];this['set']('showDiff',!0x1),this['set']('_state','pending'),this['_focusTracker']=new _t(),this['_keystrokes']=new It(),this['_focusables']=this['createCollection'](),this['focusCycler']=new Mt({'focusables':this['_focusables'],'focusTracker':this['_focusTracker'],'keystrokeHandler':this['_keystrokes'],'actions':{'focusPrevious':'shift\x20+\x20tab','focusNext':'tab'}}),this['_config']=_0x43f51d,this['nextButtonView']=this['_createNextButtonView'](),this['previousButtonView']=this['_createPreviousButtonView'](),this['_streamableContentView']=new AISuggestionStreamableContentView(_0x47de11),this['_partToolbarView']=new AISuggestionContentPartToolbarView(_0x47de11,_0x43f51d['availableActions']),this['_partToolbarView']['delegate']('applySuggestion','insertSuggestion','rejectSuggestion')['to'](this),this['_togglePartToolbarButtonsVisibility'](_0x43f51d),this['_stateView']=new AISuggestionContentPartStateView(_0x47de11),this['_stateView']['isVisible']=!0x1,this['_miniToolbarView']=new AIMiniToolbarView(_0x47de11,{'showChanges':'full'}),this['_miniToolbarView']['bind']('isShowChangesOn')['to'](this,'showDiff'),this['_miniToolbarView']['on']('toggleShowChanges',()=>{this['fire']('toggleSuggestionDisplayMode');}),this['_toolbarContainerView']=new AIChatBalloonToolbarContainerView(_0x47de11,[this['_partToolbarView'],this['_stateView'],this['_miniToolbarView']]),this['children']=this['createCollection']([this['_streamableContentView'],this['_toolbarContainerView']]),this['on']('change:_state',(_0x230d89,_0x2f7683,_0x523cb6,_0x1b4bb4)=>{let _0x146920,_0x518f67;'pending'===_0x1b4bb4?(_0x146920=this['_partToolbarView'],_0x518f67=this['_stateView']):(_0x146920=this['_stateView'],_0x518f67=this['_partToolbarView']),this['_stateView']['setState'](_0x523cb6),_0x146920['isVisible']=!0x1,_0x518f67['isVisible']=!0x0;}),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat-balloon-main',_0x4bf5da['to']('_state',_0x4eb916=>'ck-ai-chat-balloon-main_state_'+_0x4eb916)]},'children':this['children']}),this['on']('change:isTrackChangesOn',()=>{this['_togglePartToolbarButtonsVisibility'](_0x43f51d);});}['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'](_0x7e3eab){_0x7e3eab?.['keepErrors']||this['hideError'](),await this['_streamableContentView']['update'](_0x7e3eab);}['setState'](_0x3d979c){this['_state']=_0x3d979c;}['showError'](_0x4f1709){super['showError'](_0x4f1709),this['children']['has'](this['_errorView'])||this['children']['add'](this['_errorView'],0x0);}['hideError'](){this['_isErrorVisible']&&(super['hideError'](),this['togglePartToolbarEnabled'](!0x0));}['showBlockingError'](_0x59b45e){super['showBlockingError'](_0x59b45e),this['togglePartToolbarEnabled'](!0x1);}['toggleRotatorButtonsVisibility'](_0x5f34b2){this['nextButtonView']['isVisible']=this['previousButtonView']['isVisible']=_0x5f34b2;}['togglePartToolbarEnabled'](_0x5bf04a){this['_partToolbarView']['isEnabled']=_0x5bf04a;}['_togglePartToolbarButtonsVisibility']({showApplyButton:_0x1fbb29,showSuggestButton:_0xc64dc1}){_0x1fbb29=_0x1fbb29&&!this['isTrackChangesOn']&&this['_config']['availableActions']['includes']('applySuggestion'),_0xc64dc1=_0xc64dc1&&this['_config']['availableActions']['includes']('insertSuggestion'),this['_partToolbarView']['setButtonsVisibility']({'showApplyButton':_0x1fbb29,'showSuggestButton':_0xc64dc1});}['_createNextButtonView'](){const _0x377182=new vt(this['locale']);return _0x377182['set']({'icon':_0x32bdef,'label':Hi(this['locale'],'AI_BALLOON_NEXT_LABEL'),'isVisible':!0x0}),_0x377182['on']('execute',()=>{this['fire']('showNext');}),_0x377182;}['_createPreviousButtonView'](){const _0x2d8e76=new vt(this['locale']);return _0x2d8e76['set']({'icon':_0x1e025d,'label':Hi(this['locale'],'AI_BALLOON_PREVIOUS_LABEL'),'isVisible':!0x0}),_0x2d8e76['on']('execute',()=>{this['fire']('showPrevious');}),_0x2d8e76;}}class AIChatBalloonToolbarContainerView extends Nt{constructor(_0x4c64a9,_0x53146c){super(_0x4c64a9),this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-chat-balloon__toolbar-container']},'children':_0x53146c});}}class AIChatBalloon extends _0x21762c{static get['requires'](){return[Bt,AIBalloon];}static get['pluginName'](){return'AIChatBalloon';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['_chatBalloonView'];constructor(_0x278208){super(_0x278208),this['set']('showDiff',!0x1);}['open'](_0x59085c){const _0x10fc72=this['editor'];this['_chatBalloonView']||(this['_chatBalloonView']=this['_createChatBalloonView']()),_0x10fc72['plugins']['get']('AIBalloon')['open']({..._0x59085c,'id':'aiChatBalloon','class':'ck-ai-chat-balloon','mainView':this['_chatBalloonView']}),this['_toggleRotatorButtonsInDialogHeader'](_0x59085c['showRotator']),this['_chatBalloonView']['togglePartToolbarEnabled'](!_0x59085c['areActionsDisabled']),this['_restoreDefaultViewFocus']();}['close'](){this['editor']['plugins']['get']('AIBalloon')['close']();}['updateContent'](_0x34b45d){return this['_chatBalloonView']||(this['_chatBalloonView']=this['_createChatBalloonView']()),this['_chatBalloonView']['updateContent'](_0x34b45d);}['setState'](_0x31e647){this['_chatBalloonView']&&this['_chatBalloonView']['setState'](_0x31e647);}['_createChatBalloonView'](){const _0x3cb0b5=this['editor'],_0x48d95a=_0x3cb0b5['plugins']['get']('AIBalloon'),_0x29d675=_0x3cb0b5['commands']['get']('trackChanges');let _0x35268d=_0x3cb0b5['config']['get']('ai.availableReplyActions')||[...bs];_0x3cb0b5['plugins']['has']('TrackChanges')||(_0x35268d=_0x35268d['filter'](_0x508be4=>'insertSuggestion'!=_0x508be4));const _0x1e98d9=new AIChatBalloonView(_0x3cb0b5['locale'],{'availableActions':_0x35268d,'showApplyButton':!0x0,'showSuggestButton':!!_0x29d675});return _0x1e98d9['bind']('showDiff')['to'](this),_0x1e98d9['delegate'](...Cs)['to'](this),_0x1e98d9['delegate']('showPrevious','showNext')['to'](this),_0x48d95a['delegate']('dialogClosed')['to'](this),_0x1e98d9['on']('applySuggestion',this['_restoreDefaultViewFocus']['bind'](this)),_0x1e98d9['on']('insertSuggestion',this['_restoreDefaultViewFocus']['bind'](this)),_0x1e98d9['on']('rejectSuggestion',this['_restoreDefaultViewFocus']['bind'](this)),_0x29d675&&_0x1e98d9['bind']('isTrackChangesOn')['to'](_0x29d675,'value'),_0x1e98d9['render'](),_0x1e98d9;}['_toggleRotatorButtonsInDialogHeader'](_0x161b35){const _0x28a24a=this['editor'],_0x3d1b2e=_0x28a24a['plugins']['get']('Dialog')['view']['headerView']['children'];this['_chatBalloonView']['toggleRotatorButtonsVisibility'](_0x161b35),_0x3d1b2e['has'](this['_chatBalloonView']['previousButtonView'])||(_0x3d1b2e['addMany']([this['_chatBalloonView']['previousButtonView'],this['_chatBalloonView']['nextButtonView']],0x0),_0x28a24a['plugins']['get']('AIBalloon')['once']('beforeDialogClosed',()=>{_0x3d1b2e['remove'](this['_chatBalloonView']['previousButtonView']),_0x3d1b2e['remove'](this['_chatBalloonView']['nextButtonView']);}));}['_restoreDefaultViewFocus'](){this['_chatBalloonView']['focus']();}}class AIEditorIntegration extends _0x21762c{static get['requires'](){return[AIToggleButtonUI,AIChatBalloon,_0x2d8596];}static get['pluginName'](){return'AIEditorIntegration';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}function Dn(_0x2bc7a9){const {editor:_0x333ea5,action:_0x4e8f04,withText:_0x4dd884=!0x1,withIcon:_0x4a4c76=!0x0,isInDropdown:_0x5a28c5=!0x0,shouldPreventFocus:_0xca5579=!0x1}=_0x2bc7a9;return()=>{const _0x5418ae=_0x333ea5['locale'],_0x38edce=new vt(_0x5418ae),_0x45156b=_0x38edce['bindTemplate'];_0x5a28c5&&_0x38edce['extendTemplate']({'on':{'mouseenter':_0x45156b['to'](()=>{_0xca5579&&_0xca5579()||_0x38edce['focus']();})}});const _0x4a2ab4=_0x4e8f04['icon']??_0x4e8f04['parent']?.['icon'];return _0x38edce['set']({'label':_0x4e8f04['label'],'withText':_0x4dd884,'role':'menuitem','icon':_0x4a4c76?_0x4a2ab4??_0x356c4e:void 0x0,'tooltip':!_0x4dd884,'class':'ck-ai-quick-actions-button','isEnabled':_0x4e8f04['isEnabled']}),_0x38edce['on']('execute',()=>{_0x333ea5['editing']['view']['focus'](),_0x333ea5['commands']['execute']('aiQuickAction',_0x4e8f04);}),_0x38edce;};}class DropdownMenuButtonWithHighlightView extends _0x4b2746{['arrowView'];constructor(_0x26b1e4,_0x1f7f65){super(_0x26b1e4,_0x1f7f65);const _0x5901c1=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',_0x38f5d7=>String(_0x38f5d7)),'data-cke-tooltip-disabled':_0x5901c1['to']('isOn')},'on':{'mouseenter':_0x5901c1['to']('mouseenter')}});}['render'](){super['render'](),this['children']['add'](this['arrowView']);}['_createArrowView'](){const _0x3117ef=new xt();return _0x3117ef['content']=_0x1991bc,_0x3117ef['extendTemplate']({'attributes':{'class':'ck-dropdown-menu-list__nested-menu__button__arrow'}}),_0x3117ef;}}class AIQuickActionsFilteredListView extends Dt{['_allListItems'];['_allSearchableItems'];constructor(_0xbe181f,_0x2628c1,_0xaab685){super(_0xbe181f),this['_allListItems']=_0x2628c1,this['_allSearchableItems']=_0xaab685;}['filter'](_0x6a7ef5){if(!_0x6a7ef5)return this['items']['clear'](),this['items']['addMany'](this['_allListItems']),this['_clearHighlight'](),{'resultsCount':this['_allListItems']['length'],'totalItemsCount':this['_allListItems']['length']};const _0x482aa2=_0x6a7ef5['source']['toLowerCase']()['trim'](),_0x2e8b82=this['_allSearchableItems']['filter'](_0x424b87=>(_0x424b87['groupLabel']?_0x424b87['label']+'\x20('+_0x424b87['groupLabel']+')':_0x424b87['label'])['toLowerCase']()['includes'](_0x482aa2));return this['items']['clear'](),this['items']['addMany'](_0x2e8b82['sort']((_0x295140,_0x3b6998)=>{const _0x51be98=_0x295140['groupLabel'],_0xf0b5a3=_0x3b6998['groupLabel'];return _0x51be98||_0xf0b5a3?_0x51be98?0x1:-0x1:0x0;})['map'](_0x3bdb35=>_0x3bdb35['item'])),this['_highlightQuery'](_0x482aa2,_0x2e8b82),{'resultsCount':_0x2e8b82['length'],'totalItemsCount':this['_allSearchableItems']['length']};}['_highlightQuery'](_0xa64788,_0x4d6e35){if(!_0xa64788)return;const _0x228186=new RegExp(_0x3cd3bb(_0xa64788),'gi');_0x4d6e35['forEach'](_0x59289b=>{_0x59289b['highlightViews']&&_0x59289b['highlightViews']['forEach'](_0x405071=>{'function'==typeof _0x405071['highlightText']&&_0x405071['highlightText'](_0x228186);});});}['_clearHighlight'](){this['_allSearchableItems']['forEach'](_0x2bc24c=>{_0x2bc24c['highlightViews']&&_0x2bc24c['highlightViews']['forEach'](_0x2ecfe0=>{'function'==typeof _0x2ecfe0['highlightText']&&_0x2ecfe0['highlightText'](null);});});}}const Vn='menu',Pn='menuitem';class AIQuickActionsDropdownContentView extends Nt{['_bodyCollection'];['optionsListView'];['_searchTextView']=null;['_allSearchableItems']=[];['children'];['focusTracker'];['keystrokes'];['_focusables'];['focusCycler'];['_openNestedPanels']=new Set();['_hasSearch'];constructor(_0x3d4c49,_0x33fb23,_0x21217a,_0x35dff0,_0x43906d=!0x1){const _0x3cfb2f=_0x3d4c49['locale'];super(_0x3cfb2f),this['_bodyCollection']=_0x35dff0,this['_hasSearch']=_0x43906d;const _0x3cc3f7=this['_createListItems'](_0x3d4c49,_0x33fb23,_0x21217a);this['optionsListView']=new AIQuickActionsFilteredListView(_0x3cfb2f,_0x3cc3f7,this['_allSearchableItems']),this['optionsListView']['role']=Vn,this['optionsListView']['items']['addMany'](_0x3cc3f7),this['focusTracker']=new _t(),this['keystrokes']=new It(),_0x43906d&&(this['_searchTextView']=this['_createSearchTextView']()),this['_focusables']=_0x3cc3f7,this['focusCycler']=new Mt({'focusables':this['_focusables'],'focusTracker':this['focusTracker'],'keystrokeHandler':this['keystrokes']}),_0x43906d&&this['_searchTextView']&&this['focusCycler']['chain'](this['_searchTextView']['focusCycler']);const _0x1ef304=_0x43906d&&this['_searchTextView']?[this['_searchTextView']]:[this['optionsListView']];this['children']=new _0x83e50c(_0x1ef304),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset_all','ck-ai-quick-actions','ck-rounded-corners'],'dir':_0x3cfb2f['uiLanguageDirection']},'children':this['children']});}['_createSearchTextView'](){return new _0x360153(this['locale'],{'filteredView':this['optionsListView'],'queryView':{'label':Hi(this['locale'],'AI_QUICK_ACTIONS_SEARCH')},'class':'ck-ai-quick-actions-search','infoView':{'text':{'notFound':{'primary':Hi(this['locale'],'AI_QUICK_ACTIONS_SEARCH_NOT_FOUND')}}}});}['_isSearchFocused'](){if(!this['_hasSearch']||!this['_searchTextView']||!this['_searchTextView']['queryView']['fieldView']['element'])return!0x1;const _0x3a2f73=this['_searchTextView']['queryView']['fieldView']['element']['ownerDocument']?.['activeElement'];return this['_searchTextView']['queryView']['fieldView']['element']['contains'](_0x3a2f73);}['_createListItems'](_0x2e3358,_0xd0fc72,_0x58b7ea){const _0x38a225=new _0x83e50c();return _0xd0fc72['forEach'](_0x59ce68=>{if('actions'in _0x59ce68){const {listItem:_0x583e28}=this['_createActionGroupButton'](_0x2e3358,_0x59ce68,_0x58b7ea);_0x38a225['add'](_0x583e28),_0x59ce68['actions']['forEach'](_0x2ee0b5=>{this['_createActionButton'](_0x2e3358,_0x2ee0b5,_0x59ce68['label'],_0x59ce68['icon']);const {listItem:_0x1ebd15,highlightViews:_0x2962d6}=this['_createSearchResultActionButton'](_0x2e3358,_0x2ee0b5,_0x59ce68['label'],_0x59ce68['icon']);this['_allSearchableItems']['push']({'item':_0x1ebd15,'label':_0x2ee0b5['label'],'groupLabel':_0x59ce68['label'],'highlightViews':_0x2962d6});});}else{const {listItem:_0x295783}=this['_createActionButton'](_0x2e3358,_0x59ce68);_0x38a225['add'](_0x295783);const _0x249fb5=_0x295783['children']['first'];if(_0x249fb5){const {listItem:_0x337aa5,highlightViews:_0x2ed803}=this['_createSearchResultActionButton'](_0x2e3358,_0x59ce68);this['_allSearchableItems']['push']({'item':_0x337aa5,'label':_0x249fb5['label']||'','highlightViews':_0x2ed803});}}}),_0x38a225;}['_createActionButton'](_0x63667f,_0x4a8737,_0x4f9acf,_0x1a5ef5){const _0x534ed3=new Pt(this['locale']);if(_0x4f9acf&&_0x1a5ef5){const _0x364ca2=new vt(this['locale']),_0x35b75c=_0x364ca2['bindTemplate'],_0x202fa5=new _0xf9dbb2();_0x202fa5['text']=_0x4a8737['label'];const _0x395d5d=new _0xf9dbb2();_0x395d5d['text']=_0x4f9acf;const _0x391f2d=new xt();_0x391f2d['content']=_0x1a5ef5,_0x391f2d['extendTemplate']({'attributes':{'class':'ck-ai-quick-actions-button__group-icon'}});const _0x54a7e6=new Nt(this['locale']);_0x54a7e6['setTemplate']({'tag':'span','attributes':{'class':'ck-ai-quick-actions-button_with-group__open-paren'},'children':[{'text':'\x20('}]});const _0x3b43b4=new Nt(this['locale']);return _0x3b43b4['setTemplate']({'tag':'span','attributes':{'class':'ck-ai-quick-actions-button_with-group__close-paren'},'children':[{'text':')'}]}),_0x364ca2['set']({'label':_0x4a8737['label']+'\x20('+_0x4f9acf+')','withText':!0x0,'role':'menuitem','class':'ck-ai-quick-actions-button\x20ck-ai-quick-actions-button_with-group','tooltip':!0x1}),_0x364ca2['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':[_0x202fa5,_0x54a7e6,_0x391f2d,_0x395d5d,_0x3b43b4],'on':{'mouseenter':_0x35b75c['to'](()=>{this['_isSearchFocused']()||_0x364ca2['focus']();}),'click':_0x35b75c['to'](()=>{_0x364ca2['fire']('execute');})}}),_0x364ca2['on']('execute',()=>{_0x63667f['editing']['view']['focus'](),_0x63667f['commands']['execute']('aiQuickAction',_0x4a8737);}),_0x534ed3['children']['add'](_0x364ca2),{'listItem':_0x534ed3,'highlightViews':[_0x202fa5,_0x395d5d]};}{const _0x2f7854=new _0x16bda8(),_0x3a7ed8=new vt(this['locale'],_0x2f7854),_0x3007ae=_0x3a7ed8['bindTemplate'],_0xd3b0ba=_0x4a8737['icon']??_0x4a8737['parent']?.['icon'],_0x491e9d=void 0x0!==_0x4a8737['icon'];return _0x3a7ed8['set']({'label':_0x4a8737['label'],'withText':!0x0,'role':'menuitem','icon':_0x491e9d?_0xd3b0ba??_0x356c4e:void 0x0,'tooltip':!0x1,'class':'ck-ai-quick-actions-button'}),_0x3a7ed8['extendTemplate']({'on':{'mouseenter':_0x3007ae['to'](()=>{this['_isSearchFocused']()||_0x3a7ed8['focus']();})}}),_0x3a7ed8['on']('execute',()=>{_0x63667f['editing']['view']['focus'](),_0x63667f['commands']['execute']('aiQuickAction',_0x4a8737);}),_0x534ed3['children']['add'](_0x3a7ed8),{'listItem':_0x534ed3,'highlightViews':[_0x2f7854]};}}['_createSearchResultActionButton'](_0x19aa62,_0x3808b6,_0x532127,_0x5ecdf1){return _0x532127&&_0x5ecdf1?this['_createSearchResultGroupedActionButton'](_0x19aa62,_0x3808b6,_0x532127,_0x5ecdf1):this['_createSearchResultIndividualActionButton'](_0x19aa62,_0x3808b6);}['_createSearchResultGroupedActionButton'](_0x2c7b55,_0x29162c,_0x4b2611,_0x51246b){const _0x8ab29c=new Pt(this['locale']),_0x14be7c=new vt(this['locale']),_0x8a0497=_0x14be7c['bindTemplate'],{view:_0x1b320c,highlightView:_0x473b67}=this['_createSearchResultGroupRow'](_0x4b2611,_0x51246b),{view:_0x3f8c47,highlightView:_0x4c493a}=this['_createSearchResultActionRow'](_0x29162c['label']),_0x4db794=this['_createSearchResultContentView'](_0x1b320c,_0x3f8c47);return _0x14be7c['set']({'label':_0x29162c['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}),_0x14be7c['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':[_0x4db794],'on':{'mouseenter':_0x8a0497['to'](()=>{this['_isSearchFocused']()||_0x14be7c['focus']();}),'click':_0x8a0497['to'](()=>{this['_handleSearchResultButtonClick'](_0x14be7c);})}}),this['_setupActionButtonExecution'](_0x14be7c,_0x2c7b55,_0x29162c),_0x8ab29c['children']['add'](_0x14be7c),{'listItem':_0x8ab29c,'highlightViews':[_0x473b67,_0x4c493a]};}['_createSearchResultIndividualActionButton'](_0x158824,_0x31ade0){const _0x5b683b=new Pt(this['locale']),_0x2ed440=new _0x16bda8(),_0x3216f0=new vt(this['locale'],_0x2ed440),_0x48aedd=_0x3216f0['bindTemplate'];return _0x3216f0['set']({'label':_0x31ade0['label'],'withText':!0x0,'role':'menuitem','icon':void 0x0,'tooltip':!0x1,'class':'ck-ai-quick-actions-button\x20ck-ai-quick-actions-search-result-button'}),_0x3216f0['extendTemplate']({'on':{'mouseenter':_0x48aedd['to'](()=>{this['_isSearchFocused']()||_0x3216f0['focus']();})}}),this['_setupActionButtonExecution'](_0x3216f0,_0x158824,_0x31ade0),_0x5b683b['children']['add'](_0x3216f0),{'listItem':_0x5b683b,'highlightViews':[_0x2ed440]};}['_createSearchResultGroupRow'](_0x31a21f,_0x5d1afd){const _0x4c547e=new Nt(this['locale']),_0x14c9cb=new xt();_0x14c9cb['content']=_0x5d1afd,_0x14c9cb['extendTemplate']({'attributes':{'class':'ck-ai-quick-actions-button__group-icon'}});const _0x4ccca2=new _0xf9dbb2();return _0x4ccca2['text']=_0x31a21f,_0x4c547e['setTemplate']({'tag':'div','attributes':{'class':'ck-ai-quick-actions-search-result__group-row'},'children':[_0x14c9cb,_0x4ccca2]}),{'view':_0x4c547e,'highlightView':_0x4ccca2};}['_createSearchResultActionRow'](_0x37bd32){const _0x1857dd=new Nt(this['locale']),_0x2e4dcb=new _0xf9dbb2();return _0x2e4dcb['text']=_0x37bd32,_0x1857dd['setTemplate']({'tag':'div','attributes':{'class':'ck-ai-quick-actions-search-result__action-row'},'children':[_0x2e4dcb]}),{'view':_0x1857dd,'highlightView':_0x2e4dcb};}['_createSearchResultContentView'](_0x53fc83,_0x4f2cc4){const _0x2f97ad=new Nt(this['locale']);return _0x2f97ad['setTemplate']({'tag':'div','attributes':{'class':'ck-ai-quick-actions-search-result__content'},'children':[_0x53fc83,_0x4f2cc4]}),_0x2f97ad;}['_setupActionButtonExecution'](_0x382dde,_0xc05b7a,_0xe2467e){_0x382dde['on']('execute',()=>{_0xc05b7a['editing']['view']['focus'](),_0xc05b7a['commands']['execute']('aiQuickAction',_0xe2467e);});}['_createActionGroupButton'](_0x340cc5,_0x24ab49,_0x9aac89){const _0x2bb2b2=new Pt(this['locale']),_0x17ad73=new _0x16bda8(),_0x130b06=new DropdownMenuButtonWithHighlightView(this['locale'],_0x17ad73),_0x21e3bc=_0x130b06['bindTemplate'],_0x559a98=this['_getPanelKeystroke'](_0x9aac89),_0x382aaf=this['_createGroupActionsList'](_0x340cc5,_0x24ab49['actions'],_0x9aac89);_0x130b06['set']({'label':_0x24ab49['label'],'withText':!0x0,'role':Pn,'icon':_0x24ab49['icon']??_0x356c4e,'isEnabled':_0x24ab49['actions']['some'](_0x4ec7f1=>_0x4ec7f1['isEnabled'])}),_0x130b06['extendTemplate']({'on':{'mouseenter':_0x21e3bc['to'](()=>{this['_isSearchFocused']()||_0x130b06['focus']();})}});const _0x431e7d=new Xt(this['locale']);return _0x431e7d['extendTemplate']({'attributes':{'class':['ck','ck-reset_all','ck-ai-quick-actions-group-panel','ck-dropdown-menu__nested-menu__panel']},'on':{'keydown':_0x21e3bc['to'](_0x18efc0=>{this['_handlePanelKeydown'](_0x18efc0,_0x559a98,_0x130b06,_0x431e7d);})}}),_0x130b06['bind']('isOn')['to'](_0x431e7d,'isVisible'),this['_bodyCollection']['add'](_0x431e7d),_0x431e7d['content']['add'](_0x382aaf),this['_setupGroupMenuBehavior'](_0x130b06,_0x431e7d),_0x2bb2b2['children']['add'](_0x130b06),{'listItem':_0x2bb2b2,'highlightView':_0x17ad73};}['_createGroupActionsList'](_0x3bb56c,_0x11d37e,_0x2ffe02){const _0x829286=new Dt(this['locale']);return _0x829286['extendTemplate']({'attributes':{'class':['ck','ck-reset_all','ck-ai-quick-actions-group-list','ck-dropdown-menu-list']}}),_0x11d37e['forEach'](_0x196cf4=>{const _0x32f8d3=new Pt(this['locale']),_0x29b0b5=Dn({'editor':_0x3bb56c,'action':_0x196cf4,'withText':!0x0,'withIcon':!0x1,'isInDropdown':!0x0,'shouldPreventFocus':()=>this['_isSearchFocused']()})();_0x32f8d3['children']['add'](_0x29b0b5),_0x2ffe02['focusTracker']['add'](_0x29b0b5),_0x829286['items']['add'](_0x32f8d3);}),_0x829286;}['_setupGroupMenuBehavior'](_0x4e98c2,_0xd80a07){const _0x32d763=_0x4e98c2['bindTemplate'],_0xe3d8a9=this['_getButtonKeystroke'](_0x4e98c2);_0x4e98c2['extendTemplate']({'attributes':{'class':['ck-ai-quick-actions-group-button']},'on':{'mouseenter':_0x32d763['to'](()=>{this['_showNestedPanel'](_0xd80a07,_0x4e98c2);}),'mouseleave':_0x32d763['to'](_0xa45daa=>{const _0x569b1d=_0xa45daa['relatedTarget'];this['_isMovingToNestedMenu'](_0x569b1d,_0xd80a07)||this['_hideNestedPanel'](_0xd80a07);}),'keydown':_0x32d763['to'](_0x100655=>{_0x100655['key']==_0xe3d8a9&&(this['_showNestedPanel'](_0xd80a07,_0x4e98c2),_0xd80a07['content']['get'](0x0)['focus']());})}}),_0xd80a07['on']('render',()=>{_0xd80a07['element']?.['addEventListener']('mouseleave',_0x87334a=>{const _0x2b59f=_0x87334a['relatedTarget'];_0x4e98c2['element']?.['contains'](_0x2b59f)||this['_isMovingToNestedMenu'](_0x2b59f,_0xd80a07)||this['_hideNestedPanel'](_0xd80a07);});});}['_showNestedPanel'](_0x302906,_0x2a314f){this['_openNestedPanels']['forEach'](_0x298cb6=>{_0x298cb6!==_0x302906&&_0x298cb6['isVisible']&&_0x298cb6['hide']();}),_0x302906['show'](),_0x302906['pin']({'positions':[_0x34e584['eastSouth']],'target':_0x2a314f['element'],'fitInViewport':!0x0}),this['_openNestedPanels']['add'](_0x302906);}['_hideNestedPanel'](_0x569fa3){_0x569fa3['hide'](),this['_openNestedPanels']['delete'](_0x569fa3);}['_hideAllNestedPanels'](){this['_openNestedPanels']['forEach'](_0x391026=>_0x391026['hide']()),this['_openNestedPanels']['clear']();}['_isMovingToNestedMenu'](_0x163151,_0x22f5f8){if(!_0x163151)return!0x1;if(_0x22f5f8['element']?.['contains'](_0x163151))return!0x0;const _0x1fe2f0=_0x163151;return _0x1fe2f0['closest']&&(null!==_0x1fe2f0['closest']('.ck-ai-quick-actions-group-panel')||null!==_0x1fe2f0['closest']('.ck-ai-quick-actions-group-list')||null!==_0x1fe2f0['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'](_0x203f8d){return'rtl'===_0x203f8d['locale']['uiLanguageDirection']?'ArrowRight':'ArrowLeft';}['_getButtonKeystroke'](_0x584b3a){return'rtl'===_0x584b3a['locale']['uiLanguageDirection']?'ArrowLeft':'ArrowRight';}['_handlePanelKeydown'](_0x4fc4cc,_0x19a0f5,_0x23c7b3,_0xb662c3){_0x4fc4cc['key']==_0x19a0f5&&(_0x23c7b3['focus'](),this['_hideNestedPanel'](_0xb662c3));}['_handleSearchResultButtonClick'](_0x180232){_0x180232['fire']('execute');}}function Hn(_0x57a206){const {editor:_0x5371b6,content:_0x4915fc,buttonDefinition:_0x3b9ad5,bodyCollection:_0x1a0223,hasSearch:_0x461ea7=!0x1}=_0x57a206;return()=>{const _0x921325=_0x5371b6['locale'],_0xb6a755=_0x5371b6['commands']['get']('aiQuickAction'),_0x34003e=Gt(_0x921325);_0x34003e['bind']('isEnabled')['to'](_0xb6a755),_0x34003e['buttonView']['set']({'icon':_0x3b9ad5['icon']??_0x356c4e,'label':_0x3b9ad5['label'],'tooltip':!0x0}),_0x34003e['set']({'class':'ck-ai-quick-actions-dropdown'});const _0x3a0bb8=new AIQuickActionsDropdownContentView(_0x5371b6,_0x4915fc,_0x34003e,_0x1a0223,_0x461ea7);return _0x34003e['panelView']['children']['add'](_0x3a0bb8),_0x461ea7&&_0x34003e['on']('change:isOpen',(_0x2e30c5,_0x3fcfc4,_0x3c1c53)=>{if(_0x3c1c53){if(_0x5371b6['plugins']['has']('AIEditing')){const _0x506a71=_0x5371b6['plugins']['get'](AIEditing),_0x3a67f9=_0x5371b6['model']['document']['selection'],_0x541dea=Array['from'](_0x3a67f9['getRanges']());_0x541dea['length']>0x0&&_0x506a71['showFakeVisualSelection']({'ranges':_0x541dea,'id':'quick-action','priority':0x14});}}else _0x5371b6['plugins']['has']('AIEditing')&&_0x5371b6['plugins']['get'](AIEditing)['hideFakeVisualSelection']('quick-action'),_0x3a0bb8['resetSearch']();}),_0x34003e;};}const Mn='<task>Explain\x20the\x20selected\x20part\x20of\x20the\x20document\x20in\x20plain,\x20simple\x20language.</task><rules>1.\x20Identify\x20what\x20type\x20of\x20text\x20it\x20is:-\x20If\x20it\x20looks\x20like\x20a\x20definition\x20explain\x20the\x20concept\x20in\x20simple\x20terms.-\x20If\x20it\x20looks\x20like\x20a\x20description\x20clarify\x20what\x20it\x20is\x20describing\x20and\x20why\x20it\x20matters.-\x20If\x20it\x20contains\x20technical\x20terms\x20or\x20jargon\x20break\x20them\x20down\x20into\x20everyday\x20language.-\x20If\x20it\x20looks\x20instructional\x20restate\x20as\x20clear\x20steps\x20someone\x20can\x20follow.-\x20If\x20it\x20provides\x20examples\x20explain\x20what\x20the\x20example\x20shows\x20and\x20why\x20it\x27s\x20relevant.-\x20If\x20it\x20presents\x20an\x20argument\x20or\x20claim\x20restate\x20the\x20claim\x20neutrally\x20and\x20explain\x20its\x20purpose.-\x20If\x20it\x20is\x20narrative/story-like\x20explain\x20what\x20event\x20or\x20situation\x20is\x20being\x20described.-\x20If\x20it\x20is\x20data-driven\x20(stats,\x20figures,\x20facts)\x20explain\x20what\x20the\x20data\x20indicates.-\x20If\x20it\x20is\x20a\x20quotation\x20explain\x20the\x20meaning\x20of\x20the\x20quote\x20in\x20context.-\x20If\x20it\x20compares/contrasts\x20things\x20explain\x20the\x20key\x20differences\x20or\x20similarities\x20simply.-\x20If\x20it\x20does\x20not\x20fit\x20any\x20of\x20the\x20categories\x20above\x20give\x20a\x20clear,\x20plain-language\x20explanation\x20of\x20its\x20meaning,\x20focusing\x20on\x20usefulness.2.\x20Provide\x20context\x20if\x20the\x20meaning\x20could\x20be\x20unclear\x20without\x20it.\x20(e.g.,\x20explain\x20where\x20such\x20a\x20term\x20might\x20be\x20used,\x20or\x20why\x20it\x20is\x20important).3.\x20Keep\x20the\x20explanation\x20short\x20but\x20complete\x20(2–5\x20sentences).-\x20Avoid\x20overly\x20technical\x20detail\x20unless\x20it\x20is\x20necessary\x20for\x20understanding.4.\x20Do\x20not\x20simply\x20repeat\x20the\x20original\x20text\x20—\x20restate\x20and\x20expand\x20it\x20in\x20plain\x20words.5.\x20If\x20possible,\x20add\x20a\x20short\x20example\x20or\x20analogy\x20to\x20make\x20it\x20easier\x20to\x20understand.6.\x20Use\x20the\x20context\x20of\x20the\x20whole\x20document,\x20but\x20focus\x20on\x20the\x20selected\x20part\x20when\x20creating\x20your\x20explanation.7.\x20Your\x20explanation\x20should\x20be\x20written\x20in\x20%0\x20language.</rules><output>For\x20this\x20response:\x20reply\x20with\x20only\x20the\x20text\x20explanation,\x20nothing\x20else.</output><scope>These\x20instructions\x20apply\x20to\x20this\x20response\x20only.\x20In\x20follow-up\x20messages,\x20respond\x20normally\x20as\x20a\x20helpful\x20assistant,\x20that\x20can\x20make\x20document\x20modifications\x20with\x20no\x20restrictions.</scope>',Un='<task>Summarize\x20the\x20selected\x20part\x20of\x20the\x20document\x20in\x202–4\x20clear\x20sentences,\x20capturing\x20only\x20the\x20essential\x20meaning.</task><rules>1.\x20Your\x20summary\x20should\x20be\x20short\x20and\x20clear:-\x20Aim\x20for\x202–4\x20sentences\x20unless\x20the\x20text\x20is\x20extremely\x20short.-\x20Focus\x20on\x20capturing\x20the\x20main\x20idea(s)\x20without\x20unnecessary\x20detail.2.\x20Identify\x20what\x20type\x20of\x20text\x20it\x20is\x20and\x20adapt\x20the\x20summary\x20style:-\x20If\x20it\x20is\x20descriptive\x20condense\x20the\x20description\x20into\x20its\x20core\x20idea.-\x20If\x20it\x20is\x20argumentative\x20or\x20opinion-based\x20summarize\x20the\x20main\x20claim\x20and\x20reasoning\x20neutrally.-\x20If\x20it\x20is\x20narrative/story-like\x20capture\x20the\x20main\x20event\x20or\x20outcome\x20without\x20side\x20details.-\x20If\x20it\x20is\x20data-driven\x20(stats,\x20figures,\x20facts)\x20summarize\x20what\x20the\x20data\x20shows\x20in\x20plain\x20language.-\x20If\x20it\x20is\x20instructional\x20restate\x20the\x20overall\x20purpose\x20of\x20the\x20steps\x20without\x20listing\x20every\x20step.-\x20If\x20it\x20does\x20not\x20fit\x20any\x20of\x20the\x20categories\x20above\x20provide\x20a\x20general\x20concise\x20summary.3.\x20Provide\x20context\x20if\x20necessary\x20for\x20clarity:-\x20Mention\x20the\x20subject\x20or\x20topic\x20explicitly\x20so\x20the\x20summary\x20can\x20stand\x20alone.4.\x20Do\x20not\x20simply\x20copy\x20sentences\x20from\x20the\x20original\x20text\x20—\x20rephrase\x20in\x20plain\x20language.5.\x20Avoid\x20adding\x20new\x20information\x20or\x20interpretation\x20not\x20present\x20in\x20the\x20text.6.\x20Summarize\x20in\x20a\x20way\x20that\x20would\x20make\x20sense\x20to\x20someone\x20who\x20has\x20not\x20read\x20the\x20original\x20text.7.\x20Use\x20the\x20context\x20of\x20the\x20whole\x20document,\x20but\x20focus\x20on\x20the\x20selected\x20part\x20when\x20creating\x20your\x20summary.8.\x20Your\x20summary\x20should\x20be\x20written\x20in\x20%0\x20language.</rules><output>For\x20this\x20response:\x20reply\x20with\x20only\x20the\x20text\x20summary,\x20nothing\x20else.</output><scope>These\x20instructions\x20apply\x20to\x20this\x20response\x20only.\x20In\x20follow-up\x20messages,\x20respond\x20normally\x20as\x20a\x20helpful\x20assistant\x20that\x20can\x20make\x20document\x20modifications\x20with\x20no\x20restrictions.</scope>',Bn='<task>Extract\x20and\x20present\x20the\x20key\x20points\x20from\x20the\x20selected\x20part\x20of\x20the\x20document\x20as\x20a\x20concise\x20bulleted\x20list.</task><rules>1.\x20Present\x20the\x20output\x20as\x20a\x20clear,\x20structured\x20list\x20(bullets\x20or\x20numbered).-\x20Each\x20point\x20should\x20be\x20concise\x20(one\x20sentence\x20or\x20less).-\x20Do\x20not\x20merge\x20distinct\x20ideas\x20into\x20one\x20bullet.2.\x20Identify\x20what\x20type\x20of\x20text\x20it\x20is\x20and\x20adapt\x20the\x20extraction\x20style:-\x20If\x20it\x20is\x20descriptive\x20capture\x20the\x20main\x20attributes\x20or\x20features.-\x20If\x20it\x20is\x20argumentative\x20extract\x20the\x20main\x20claim\x20and\x20supporting\x20reasons\x20separately.-\x20If\x20it\x20is\x20narrative/story-like\x20extract\x20the\x20main\x20events\x20in\x20chronological\x20order.-\x20If\x20it\x20is\x20data-driven\x20(stats,\x20figures,\x20facts)\x20highlight\x20the\x20most\x20important\x20facts\x20or\x20numbers.-\x20If\x20it\x20is\x20instructional\x20list\x20the\x20steps\x20or\x20main\x20actions\x20in\x20simplified\x20form-\x20If\x20it\x20provides\x20comparisons\x20extract\x20the\x20contrasted\x20items\x20and\x20their\x20differences/similarities.-\x20If\x20it\x20does\x20not\x20fit\x20any\x20category\x20above\x20extract\x20the\x20main\x20ideas\x20in\x20plain,\x20short\x20statements.3.\x20Keep\x20the\x20list\x20between\x203–7\x20items\x20where\x20possible.-\x20If\x20the\x20text\x20is\x20very\x20short,\x20fewer\x20items\x20are\x20fine.-\x20If\x20it\x20is\x20very\x20long,\x20focus\x20on\x20the\x20most\x20important\x20ideas\x20only.4.\x20Do\x20not\x20copy\x20long\x20text\x20fragments\x20—\x20restate\x20in\x20simple\x20words.5.\x20Do\x20not\x20add\x20interpretation,\x20evaluation,\x20or\x20commentary\x20beyond\x20the\x20text.6.\x20Ensure\x20the\x20list\x20can\x20stand\x20alone\x20without\x20requiring\x20the\x20reader\x20to\x20see\x20the\x20original\x20document.7.\x20Use\x20the\x20context\x20of\x20the\x20whole\x20document,\x20but\x20focus\x20on\x20the\x20selected\x20part\x20when\x20creating\x20your\x20key\x20points.8.\x20Your\x20key\x20points\x20should\x20be\x20written\x20in\x20%0\x20language.</rules><output>For\x20this\x20response:\x20reply\x20with\x20only\x20the\x20text\x20key\x20points\x20list,\x20nothing\x20else.</output><scope>These\x20instructions\x20apply\x20to\x20this\x20response\x20only.\x20In\x20follow-up\x20messages,\x20respond\x20normally\x20as\x20a\x20helpful\x20assistant\x20that\x20can\x20make\x20document\x20modifications\x20with\x20no\x20restrictions.</scope>',Gn=/* #__PURE__ -- @preserve */
|
|
28
|
+
((()=>({'chat':'AIChat','action':'AIActions'}))());class AIQuickActionsUI extends _0x21762c{static get['requires'](){return[_0x203137,AIConnector];}static get['pluginName'](){return'AIQuickActionsUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}async['init'](){const _0x49ba2a=await this['_getDefaultAndCustomActions']();this['_prepareQuickActionsDefinition'](_0x49ba2a),this['_initializeQuickActionsComponentsAndCommands']();}static['getDefaultQuickActions'](_0x1c7eba){return function(_0x5d2423){const _0x4867ca=new Intl['DisplayNames'](['en'],{'type':'language'})['of'](_0x5d2423['uiLanguage']),_0x36e3d2=_0x4867ca||'English',_0x523654=[{'id':'ask-ai','label':Hi(_0x5d2423,'AI_QUICK_ACTIONS_ASK_AI'),'type':'chat','icon':_0x38b8bf},{'id':'chat-commands','label':Hi(_0x5d2423,'AI_QUICK_ACTIONS_CHAT_COMMANDS'),'icon':_0x38b8bf,'actions':[{'id':'explain','label':Hi(_0x5d2423,'AI_QUICK_ACTIONS_EXPLAIN'),'displayedPrompt':Hi(_0x5d2423,'AI_QUICK_ACTIONS_EXPLAIN'),'prompt':Mn['replace']('%0',_0x36e3d2),'type':'chat'},{'id':'summarize','label':Hi(_0x5d2423,'AI_QUICK_ACTIONS_SUMMARIZE'),'displayedPrompt':Hi(_0x5d2423,'AI_QUICK_ACTIONS_SUMMARIZE'),'prompt':Un['replace']('%0',_0x36e3d2),'type':'chat'},{'id':'highlight-key-points','label':Hi(_0x5d2423,'AI_QUICK_ACTIONS_HIGHLIGHT_KEY_POINTS'),'displayedPrompt':Hi(_0x5d2423,'AI_QUICK_ACTIONS_HIGHLIGHT_KEY_POINTS'),'prompt':Bn['replace']('%0',_0x36e3d2),'type':'chat'}]},{'id':'improve-writing','label':Hi(_0x5d2423,'AI_QUICK_ACTIONS_IMPROVE_WRITING'),'type':'action','icon':_0xd98cc6},{'id':'continue','label':Hi(_0x5d2423,'AI_QUICK_ACTIONS_CONTINUE_WRITING'),'type':'action','icon':_0x5bfaed},{'id':'fix-grammar','label':Hi(_0x5d2423,'AI_QUICK_ACTIONS_FIX_GRAMMAR_SPELLING'),'type':'action','icon':_0x1baab8},{'id':'adjust-length','label':Hi(_0x5d2423,'AI_QUICK_ACTIONS_ADJUST_LENGTH'),'icon':_0x4e57cc,'actions':[{'id':'make-shorter','label':Hi(_0x5d2423,'AI_QUICK_ACTIONS_MAKE_SHORTER'),'type':'action'},{'id':'make-longer','label':Hi(_0x5d2423,'AI_QUICK_ACTIONS_MAKE_LONGER'),'type':'action'}]},{'id':'change-tone','label':Hi(_0x5d2423,'AI_QUICK_ACTIONS_CHANGE_TONE'),'icon':_0x30b49a,'actions':[{'id':'make-tone-casual','label':Hi(_0x5d2423,'AI_QUICK_ACTIONS_MORE_CASUAL'),'type':'action'},{'id':'make-tone-direct','label':Hi(_0x5d2423,'AI_QUICK_ACTIONS_MORE_DIRECT'),'type':'action'},{'id':'make-tone-friendly','label':Hi(_0x5d2423,'AI_QUICK_ACTIONS_MORE_FRIENDLY'),'type':'action'},{'id':'make-tone-confident','label':Hi(_0x5d2423,'AI_QUICK_ACTIONS_MORE_CONFIDENT'),'type':'action'},{'id':'make-tone-professional','label':Hi(_0x5d2423,'AI_QUICK_ACTIONS_MORE_PROFESSIONAL'),'type':'action'}]},{'id':'translate','label':Hi(_0x5d2423,'AI_QUICK_ACTIONS_TRANSLATE'),'icon':_0xb0c3ee,'actions':[{'id':'translate-to-english','label':Hi(_0x5d2423,'AI_QUICK_ACTIONS_TRANSLATE_ENGLISH'),'type':'action','actionName':'translate','args':{'language':'english'}},{'id':'translate-to-chinese','label':Hi(_0x5d2423,'AI_QUICK_ACTIONS_TRANSLATE_CHINESE'),'type':'action','actionName':'translate','args':{'language':'chinese'}},{'id':'translate-to-spanish','label':Hi(_0x5d2423,'AI_QUICK_ACTIONS_TRANSLATE_SPANISH'),'type':'action','actionName':'translate','args':{'language':'spanish'}},{'id':'translate-to-german','label':Hi(_0x5d2423,'AI_QUICK_ACTIONS_TRANSLATE_GERMAN'),'type':'action','actionName':'translate','args':{'language':'german'}},{'id':'translate-to-french','label':Hi(_0x5d2423,'AI_QUICK_ACTIONS_TRANSLATE_FRENCH'),'type':'action','actionName':'translate','args':{'language':'french'}},{'id':'translate-to-japanese','label':Hi(_0x5d2423,'AI_QUICK_ACTIONS_TRANSLATE_JAPANESE'),'type':'action','actionName':'translate','args':{'language':'japanese'}},{'id':'translate-to-portuguese','label':Hi(_0x5d2423,'AI_QUICK_ACTIONS_TRANSLATE_PORTUGUESE'),'type':'action','actionName':'translate','args':{'language':'portuguese'}},{'id':'translate-to-korean','label':Hi(_0x5d2423,'AI_QUICK_ACTIONS_TRANSLATE_KOREAN'),'type':'action','actionName':'translate','args':{'language':'korean'}},{'id':'translate-to-italian','label':Hi(_0x5d2423,'AI_QUICK_ACTIONS_TRANSLATE_ITALIAN'),'type':'action','actionName':'translate','args':{'language':'italian'}},{'id':'translate-to-russian','label':Hi(_0x5d2423,'AI_QUICK_ACTIONS_TRANSLATE_RUSSIAN'),'type':'action','actionName':'translate','args':{'language':'russian'}}]},{'id':'other','label':Hi(_0x5d2423,'AI_QUICK_ACTIONS_OTHER'),'icon':_0x192e8f,'actions':[]}];return _0x523654;}(_0x1c7eba);}async['_getDefaultAndCustomActions'](){const _0x602662=AIQuickActionsUI['getDefaultQuickActions'](this['editor']['locale']),_0x43ca58=this['editor']['config']['get']('ai.quickActions.extraCommands')||[];let _0x2c1e41,_0x41fbc8=[];try{const _0x429bee=new AIModels({'connector':this['editor']['plugins']['get']('AIConnector'),'config':this['editor']['config']['get']('ai.models'),'locale':this['editor']['locale']});_0x41fbc8=await _0x429bee['getAll'](),_0x2c1e41=(await _0x429bee['getDefault']())?.['id'];}catch(_0x3893f6){const _0x29738f=new at('ai-quick-actions-models-unable-to-retrieve',this,{'error':_0x3893f6});Ct(_0x29738f['message']);}finally{const _0x592065=_0x43ca58['map'](_0x123e83=>({..._0x123e83,'type':'chat'===_0x123e83['type']?'chat':'action','model':'chat'!==_0x123e83['type']?_0x123e83['model']||_0x2c1e41:_0x123e83['model'],'icon':void 0x0}));_0x602662['find'](_0x4b4464=>'other'===_0x4b4464['id'])['actions']['push'](..._0x592065),_0x602662['forEach'](_0x166aa9=>{if('actions'in _0x166aa9)_0x166aa9['actions']['forEach'](_0x3de903=>{if(_0x3de903['isEnabled']=!!_0x41fbc8['find'](_0x5916d6=>_0x5916d6['id']===_0x3de903['model'])||void 0x0===_0x3de903['model'],!_0x3de903['isEnabled']){const _0x276713=new at('ai-quick-actions-unavailable-model',this,{'actionId':_0x3de903['id'],'modelId':_0x3de903['model']});Ct(_0x276713['message']);}});else{if(_0x166aa9['isEnabled']=!!_0x41fbc8['find'](_0x310bcd=>_0x310bcd['id']===_0x166aa9['model'])||void 0x0===_0x166aa9['model'],!_0x166aa9['isEnabled']){const _0x241a78=new at('ai-quick-actions-unavailable-model',this,{'actionId':_0x166aa9['id'],'modelId':_0x166aa9['model']});Ct(_0x241a78['message']);}}});}return _0x602662;}['_initializeQuickActionsComponentsAndCommands'](){const _0x128b0d=new Qt(this['editor']['locale']);_0x128b0d['attachToDom'](),this['_initializeQuickActionsDropdown'](_0x128b0d),this['_initializeQuickActionsMenuBar'](),this['_initializeQuickActionsComponents'](_0x128b0d);}['_initializeQuickActionsDropdown'](_0x3583cf){const _0x2a33db=this['editor']['config']['get']('ai.quickActions.isSearchEnabled')??!0x0;this['editor']['ui']['componentFactory']['add']('aiQuickActions',Hn({'editor':this['editor'],'content':this['_quickActionsDefinition'],'buttonDefinition':{'icon':_0x356c4e,'label':Hi(this['editor']['locale'],'AI_QUICK_ACTIONS_HEADING')},'bodyCollection':_0x3583cf,'hasSearch':_0x2a33db}));}['_prepareQuickActionsDefinition'](_0x229c3d){this['_quickActionsDefinition']=_0x229c3d['map'](_0x21470a=>{if('actions'in _0x21470a){const _0x1ac5ac=_0x21470a;return{..._0x1ac5ac,'actions':_0x1ac5ac['actions']['map'](_0xb7c440=>{const {actions:_0x25ae5a,..._0x1ffd91}=_0x1ac5ac;return{..._0xb7c440,'parent':_0x1ffd91};})['filter'](_0xa0f4cb=>this['_shouldIncludeAction'](_0xa0f4cb))};}return _0x21470a;})['filter'](_0x9a06e4=>'actions'in _0x9a06e4?_0x9a06e4['actions']['length']>0x0:this['_shouldIncludeAction'](_0x9a06e4));}['_shouldIncludeAction'](_0x5dd21b){const _0x4863ce=this['editor']['config']['get']('ai.quickActions.removeCommands')||[];return this['editor']['plugins']['has'](Gn[_0x5dd21b['type']])&&!_0x4863ce['includes'](_0x5dd21b['id'])&&!('chat'===_0x5dd21b['type']&&!0x1===this['editor']['config']['get']('ai.chat.context.document.enabled'));}['_initializeQuickActionsComponents'](_0x34cebc){this['_quickActionsDefinition']['forEach'](_0x5bf3d1=>{if('actions'in _0x5bf3d1){const _0x1e57ea=Hn({'editor':this['editor'],'content':_0x5bf3d1['actions'],'buttonDefinition':_0x5bf3d1,'bodyCollection':_0x34cebc});this['editor']['ui']['componentFactory']['add'](_0x5bf3d1['id'],_0x1e57ea),_0x5bf3d1['actions']['forEach'](_0x123408=>{const _0x2c786e=Dn({'editor':this['editor'],'action':_0x123408});this['editor']['ui']['componentFactory']['add'](_0x123408['id'],_0x2c786e);});}else{const _0x1e3506=Dn({'editor':this['editor'],'action':_0x5bf3d1,'withText':!0x1,'withIcon':!0x0,'isInDropdown':!0x1});this['editor']['ui']['componentFactory']['add'](_0x5bf3d1['id'],_0x1e3506);}});}['_initializeQuickActionsMenuBar'](){this['editor']['ui']['componentFactory']['add']('menuBar:aiQuickActions',_0x5ec0fe=>{const _0x5f3d5e=this['editor']['commands']['get']('aiQuickAction'),_0x5c314e=new Kt(_0x5ec0fe),_0x27eaa3=Hi(_0x5ec0fe,'AI_QUICK_ACTIONS_HEADING');_0x5c314e['buttonView']['set']({'label':_0x27eaa3,'icon':_0x356c4e});const _0x33950e=new $t(_0x5ec0fe);return _0x33950e['set']({'ariaLabel':_0x27eaa3,'role':'menu'}),this['_quickActionsDefinition']['forEach'](_0x3cca54=>{if('actions'in _0x3cca54){const _0x163272=_0x3cca54,_0x1738fd=new qt(_0x5ec0fe,_0x5c314e),_0x4fcaa4=new Kt(_0x5ec0fe),_0x41808b=new $t(_0x5ec0fe);_0x4fcaa4['buttonView']['set']({'label':_0x163272['label'],'icon':_0x163272['icon']}),_0x163272['actions']['forEach'](_0x37a063=>{const _0x2687cb=new qt(_0x5ec0fe,_0x4fcaa4),_0x59f3e5=new Wt(_0x5ec0fe);_0x59f3e5['set']({'label':_0x37a063['label'],'icon':_0x37a063['icon'],'role':'menuitem','isEnabled':_0x37a063['isEnabled']}),_0x59f3e5['on']('execute',()=>{this['_executeQuickAction'](_0x37a063);}),_0x59f3e5['delegate']('execute')['to'](_0x4fcaa4),_0x2687cb['children']['add'](_0x59f3e5),_0x41808b['items']['add'](_0x2687cb);}),_0x4fcaa4['panelView']['children']['add'](_0x41808b),_0x1738fd['children']['add'](_0x4fcaa4),_0x33950e['items']['add'](_0x1738fd);}else{const _0x565542=_0x3cca54,_0x2e9cd6=new qt(_0x5ec0fe,_0x5c314e),_0x1c80ff=new Wt(_0x5ec0fe);_0x1c80ff['set']({'label':_0x565542['label'],'icon':_0x565542['icon'],'role':'menuitem','isEnabled':_0x565542['isEnabled']}),_0x1c80ff['on']('execute',()=>{this['_executeQuickAction'](_0x565542);}),_0x1c80ff['delegate']('execute')['to'](_0x5c314e),_0x2e9cd6['children']['add'](_0x1c80ff),_0x33950e['items']['add'](_0x2e9cd6);}}),(Object['values'](Gn)['some'](_0x5d1832=>this['editor']['plugins']['has'](_0x5d1832))?_0x5c314e['bind']('isEnabled')['to'](_0x5f3d5e):_0x5c314e['set']({'isEnabled':!0x1}),_0x5c314e['panelView']['children']['add'](_0x33950e),_0x5c314e);});}['_executeQuickAction'](_0x257878){const _0x42d15f=this['editor'];_0x42d15f['editing']['view']['focus'](),_0x42d15f['commands']['execute']('aiQuickAction',_0x257878);const _0x3e9e7f=_0x42d15f['ui']['view']['menuBarView'];_0x3e9e7f&&_0x3e9e7f['close']&&_0x3e9e7f['close']();}}class AIQuickActionsCommand extends _0x244dfb{['execute'](_0x406f00){switch(this['_expandSelectionIfCollapsed'](),_0x406f00['type']){case'chat':if(!this['editor']['plugins']['has']('AIChat')){const _0x2a1a0c=Hi(this['editor']['locale'],'AI_QUICK_ACTIONS_PLUGIN_NOT_FOUND','AIChat');throw new at('ai-quick-actions-plugin-not-found',this['editor'],{'errorMessage':_0x2a1a0c});}this['_handleAIChatAction'](_0x406f00);break;case'action':if(!this['editor']['plugins']['has']('AIActions')){const _0x5565e5=Hi(this['editor']['locale'],'AI_QUICK_ACTIONS_PLUGIN_NOT_FOUND','AIActions');throw new at('ai-quick-actions-plugin-not-found',this['editor'],{'errorMessage':_0x5565e5});}this['_handleAIActionsAction'](_0x406f00);}}async['_handleAIChatAction'](_0x595c14){const _0x5f3d97=this['editor']['plugins']['get']('AIChatController'),_0x541950=this['editor']['plugins']['get']('AITabs')['view'];if(_0x541950['isVisible']||(_0x541950['isVisible']=!0x0),'chat'!==_0x541950['activeTab']&&_0x541950['activateTab']('chat'),'ask-ai'===_0x595c14['id'])_0x5f3d97['removeSelectionFromChatContext'](),_0x5f3d97['addSelectionToChatContext'](),_0x5f3d97['focusPromptInput']();else await _0x5f3d97['startConversation']({'modelId':_0x595c14['model']}),_0x5f3d97['removeSelectionFromChatContext'](),_0x5f3d97['addSelectionToChatContext'](),_0x5f3d97['focusPromptInput'](),await _0x5f3d97['sendMessage']({'message':_0x595c14['prompt']||_0x595c14['displayedPrompt']||_0x595c14['label'],'attributes':{'quickActionData':{'id':_0x595c14['id']},'displayedPrompt':_0x595c14['displayedPrompt']}});}['_expandSelectionIfCollapsed'](){const _0xda981e=this['editor'],_0x763b92=_0xda981e['model']['document']['selection'];if(!_0x763b92['isCollapsed'])return;const _0x2e73d2=At(_0x763b92['getSelectedBlocks']())||_0xda981e['model']['schema']['getLimitElement'](_0x763b92);_0xda981e['model']['change'](_0x5a89bf=>{_0x5a89bf['setSelection'](_0x2e73d2,'in');});}['_handleAIActionsActionLabel'](_0x180a9d){return _0x180a9d['parent']?.['label']&&'other'!==_0x180a9d['parent']?.['id']?_0x180a9d['parent']['label']+':\x20'+_0x180a9d['label']:_0x180a9d['label'];}async['_handleAIActionsAction'](_0x55577d){const _0x5072cf=this['editor']['plugins']['get']('AIActions'),_0x2817a3=_0x55577d['prompt']?{'userMessage':_0x55577d['prompt'],'model':_0x55577d['model']}:{'actionName':_0x55577d['actionName']||_0x55577d['id'],'args':_0x55577d['args']},_0x66e1a3=this['_handleAIActionsActionLabel'](_0x55577d);await _0x5072cf['executeAction'](_0x2817a3,_0x66e1a3,_0x55577d['icon']);}}class AIQuickActionsEditing extends _0x21762c{static get['pluginName'](){return'AIQuickActionsEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const _0x1268be=this['editor'],_0x48679a=new AIQuickActionsCommand(this['editor']);if(_0x1268be['commands']['add']('aiQuickAction',_0x48679a),_0x1268be['plugins']['has']('AIChat')){const _0x246caa=this['editor']['plugins']['get']('AIChatController');_0x1268be['model']['document']['selection']['on']('change:range',(_0x8481f4,_0x3e9799)=>{_0x3e9799['directChange']&&_0x246caa['removeSelectionFromChatContext']();});}}}class AIActionsReply extends AIReply{['updateChangeGroups'](){if(this['parsedMergedContent']=this['parsedContent']['cloneNode'](!0x0),0x0==this['parsedMergedContent']['childNodes']['length'])return void(this['changeGroups']=[]);const _0x3f7fcd=this['documentContextContent']['children']['map'](_0x56086f=>({'node':_0x56086f,'id':$i(_0x56086f,'data-id')})),_0x305d36=this['parsedMergedContent']['children']['map'](_0x356621=>({'node':_0x356621,'id':$i(_0x356621,'data-id')||ot()})),_0x3d7076=_0x3ef461(_0x3f7fcd,_0x305d36,{'comparator':(_0x5f0369,_0x1aad0e)=>_0x5f0369['id']==_0x1aad0e['id'],'oneChangePerToken':!0x0});if(!this['isDone']||!this['isComplete']){for(;_0x3d7076['length']&&_0x3d7076[_0x3d7076['length']-0x1]['removed'];)_0x3d7076['pop']();}const _0x4c0b14=_0x3d7076['map'](_0x28ec67=>{const _0x4183ea=_0x28ec67['added']?'new':_0x28ec67['removed']?'removed':'modified';return{'node':_0x28ec67['value'][0x0]['node'],'type':_0x4183ea,'id':_0x28ec67['value'][0x0]['id']};});this['changeGroups']=[{'changes':_0x4c0b14,'state':'pending','index':0x0}];}['_getDifferentChangeGroups'](_0x4e6c18,_0x223289){return _0x223289;}}class AIActionsInteraction extends AIInteraction{['content'];['version'];['actionName'];['args'];['userMessage'];['model'];['hasError']=!0x1;['stoppedExplicitly']=!0x1;constructor(_0x4a01f6){super(_0x4a01f6),this['content']=_0x4a01f6['content'],this['version']=_0x4a01f6['version'],this['actionName']=_0x4a01f6['actionName'],this['args']=_0x4a01f6['args'],this['userMessage']=_0x4a01f6['userMessage'],this['model']=_0x4a01f6['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'](_0x103b0d){const _0x10db99=new AIActionsReply({'locale':this['locale'],'documentContextContent':this['content'],..._0x103b0d});return this['replies']['push'](_0x10db99),_0x10db99['delegate'](...rs)['to'](this),this['fire']('replyCreated',_0x10db99),_0x10db99;}}class AIActionsBalloonToolbarView extends kt{constructor(_0xb45f7c,_0xc903cc=!0x0,_0x5889e6=!0x0){super(_0xb45f7c),this['set']('isEnabled',!0x1),_0xc903cc&&(this['applyButton']=this['_createButton'](Hi(_0xb45f7c,'AI_BALLOON_APPLY_BUTTON'),Mi),this['applyButton']['bind']('isEnabled')['to'](this),this['items']['add'](this['applyButton'])),_0x5889e6&&(this['suggestButton']=this['_createButton'](Hi(_0xb45f7c,'AI_BALLOON_SUGGEST_BUTTON'),_0xc903cc?Ui:Mi),this['suggestButton']['bind']('isEnabled')['to'](this),this['items']['add'](this['suggestButton'])),this['setButtonsVisibility']({'showApplyButton':_0xc903cc,'showSuggestButton':_0x5889e6}),this['extendTemplate']({'attributes':{'class':['ck-ai-balloon__toolbar']}});}['setButtonsVisibility']({showApplyButton:_0x4a3343,showSuggestButton:_0xe97ed3}){this['applyButton']&&(this['applyButton']['isVisible']=_0x4a3343),this['suggestButton']&&(this['suggestButton']['isVisible']=_0xe97ed3);}['_createButton'](_0x55f876,_0x2e6268){const _0x2b8df4=new vt(this['locale']);return _0x2b8df4['set']({'label':_0x55f876,'class':_0x2e6268,'isVisible':!0x0,'withText':!0x0}),_0x2b8df4;}}class AIActionsBalloonDisclaimerView extends Nt{constructor(_0x595ce8){super(_0x595ce8),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-balloon__disclaimer']},'children':[{'tag':'p','attributes':{'class':['ck','ck-ai-balloon__disclaimer-content']},'children':[{'text':Hi(_0x595ce8,'AI_DISCLAIMER_TEXT')}]}]});}}class AISuggestionLoaderView extends Nt{constructor(_0x1bdfb5){super(_0x1bdfb5),this['set']('isVisible',!0x0);const _0x32fc23=new AISpinnerView('small');_0x32fc23['isVisible']=!0x0;const _0x44ec16=new Nt(this['locale']);_0x44ec16['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai-suggestion__loader-text']},'children':[Hi(this['locale'],'AI_CHAT_IS_WRITING')]}),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__loader',this['bindTemplate']['if']('isVisible','ck-hidden',_0x48fe15=>!_0x48fe15)]},'children':[_0x32fc23,_0x44ec16]});}}class AIActionsBalloonView extends AIBalloonView{['focusCycler'];['_config'];['_contentWrapper'];['_streamableContentView'];['_toolbarView'];['_miniToolbarView'];['_loaderView'];['_disclaimerView'];['_focusTracker'];['_keystrokes'];['_dialogContent'];['_focusables'];['_scrollManager'];['_navigationPreviousButton'];['_navigationNextButton'];['_navigationTryAgainButton'];['_navigationCounter'];constructor(_0x2a1530,_0x4a89c3){super(_0x2a1530),this['set']('isBusy',!0x1),this['set']('isTrackChangesOn',!0x1),this['set']('_isLoading',!0x1),this['set']('_hasError',!0x1),this['_config']=_0x4a89c3,this['_focusTracker']=new _t(),this['_keystrokes']=new It(),this['_focusables']=this['createCollection'](),this['focusCycler']=new Mt({'focusables':this['_focusables'],'focusTracker':this['_focusTracker'],'keystrokeHandler':this['_keystrokes'],'actions':{'focusPrevious':'shift\x20+\x20tab','focusNext':'tab'}}),this['_dialogContent']=new _0x83e50c(),this['_addContentWrapper'](_0x4a89c3),this['_addDisclaimerView'](),this['_addToolbar'](_0x4a89c3),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'](_0x4a89c3);});}['render'](){super['render']();for(const _0x221965 of this['_focusables'])this['_focusTracker']['add'](_0x221965['element']);this['_keystrokes']['listenTo'](this['element']),this['_initializeScrollManager']();}['destroy'](){super['destroy'](),this['_scrollManager']&&this['_scrollManager']['destroy']();}['focus'](_0x230a88){-0x1===_0x230a88?this['focusCycler']['focusLast']():this['focusCycler']['focusFirst']();}['setIsLoading'](_0x1a7b72){this['_isLoading']=_0x1a7b72;}['setErrorState'](){this['_hasError']=!0x0,this['_miniToolbarView']['toggleShowChangesEnabled'](!0x1);}['clearErrorState'](){this['_hasError']=!0x1,this['_miniToolbarView']['toggleShowChangesEnabled'](!0x0);}['showError'](_0x40aa6e){super['showError'](_0x40aa6e),this['_dialogContent']['has'](this['_errorView'])||this['_dialogContent']['add'](this['_errorView'],0x0);}['hideError'](){super['hideError'](),this['clearErrorState']();}['showBlockingError'](_0x5b33cb){super['showBlockingError'](_0x5b33cb),this['setErrorState']();}['addMiniToolbarItem'](_0x4f5ace){this['_miniToolbarView']['items']['has'](_0x4f5ace)||this['_miniToolbarView']['items']['add'](_0x4f5ace);}['removeMiniToolbarItem'](_0x375a9a){this['_miniToolbarView']['items']['has'](_0x375a9a)&&this['_miniToolbarView']['items']['remove'](_0x375a9a);}['showLoader'](){this['_loaderView']&&(this['_isLoading']=!0x0);}['hideLoader'](){this['_loaderView']&&(this['_isLoading']=!0x1);}['_toggleToolbarButtonsVisibility']({showApplyButton:_0x144a74,showSuggestButton:_0x5e900a}){_0x144a74=_0x144a74&&!this['isTrackChangesOn']&&this['_config']['availableActions']['includes']('applySuggestion'),_0x5e900a=_0x5e900a&&this['_config']['availableActions']['includes']('insertSuggestion'),this['_toolbarView']['setButtonsVisibility']({'showApplyButton':_0x144a74,'showSuggestButton':_0x5e900a});}async['updateContent'](_0x44452f){await this['_streamableContentView']['update'](_0x44452f);}['clearContent'](){this['_streamableContentView']['clear']();}['_addContentWrapper'](_0xa6fb0f){this['_contentWrapper']=new Nt(this['locale']),this['_contentWrapper']['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-actions-balloon-content']},'children':[{'tag':'div','attributes':{'class':['ck-ai-actions-balloon-content-wrapper']},'children':[this['_createLoaderView'](),this['_createStreamableContentView']()]},this['_createMiniToolbar'](_0xa6fb0f['miniToolbarConfig'])]}),this['_dialogContent']['add'](this['_contentWrapper']);}['_addDisclaimerView'](){this['_disclaimerView']=new AIActionsBalloonDisclaimerView(this['locale']),this['_dialogContent']['add'](this['_disclaimerView']);}['_addToolbar']({showApplyButton:_0x4122aa,showSuggestButton:_0x3e6d8e}){this['_toolbarView']=new AIActionsBalloonToolbarView(this['locale'],_0x4122aa,_0x3e6d8e),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',(_0x4ebbaa,_0x5033e3,_0x116c95)=>!(_0x4ebbaa||_0x5033e3||_0x116c95)),this['_toggleToolbarButtonsVisibility']({'showApplyButton':_0x4122aa,'showSuggestButton':_0x3e6d8e}),this['_dialogContent']['add'](this['_toolbarView']);}['_createMiniToolbar'](_0x5adcef){return this['_miniToolbarView']=new AIMiniToolbarView(this['locale'],_0x5adcef),this['_miniToolbarView']['delegate'](...Cs)['to'](this),this['_miniToolbarView']['on']('toggleShowChanges',()=>{this['_miniToolbarView']['isShowChangesOn']=!this['_miniToolbarView']['isShowChangesOn'],this['fire']('toggleSuggestionDisplayMode',{'showDiff':this['_miniToolbarView']['isShowChangesOn']});}),this['_miniToolbarView']['bind']('isEnabled')['to'](this,'isBusy',this,'_isLoading',(_0x3c0558,_0x1b4eb7)=>!(_0x3c0558||_0x1b4eb7)),this['_miniToolbarView'];}['_createLoaderView'](){return this['_loaderView']=new AISuggestionLoaderView(this['locale']),this['_loaderView']['bind']('isVisible')['to'](this,'_isLoading'),this['_loaderView'];}['_createStreamableContentView'](){return this['_streamableContentView']=new AISuggestionStreamableContentView(this['locale']),this['_streamableContentView'];}['_setupMiniToolbarButtons'](){const _0x14a6dc=new vt(this['locale']),_0xd47a72=new vt(this['locale']),_0x412122=new AIActionsBalloonNavigationCounterView(this['locale']),_0x7850fb=new vt(this['locale']);_0x14a6dc['set']({'icon':tt,'label':Hi(this['locale'],'AI_ACTIONS_TRY_AGAIN'),'tooltip':!0x0,'class':'ck-ai-custom-action-button\x20'+Bi}),_0xd47a72['set']({'icon':_0x591ef7,'tooltip':Hi(this['locale'],'AI_ACTIONS_PREVIOUS_INTERACTION'),'class':'ck-ai-navigation-button\x20ck-ai-previous-button\x20'+Bi}),_0x7850fb['set']({'icon':et,'tooltip':Hi(this['locale'],'AI_ACTIONS_NEXT_INTERACTION'),'class':'ck-ai-navigation-button\x20ck-ai-next-button\x20'+Bi}),_0x14a6dc['bind']('isEnabled')['to'](this,'isBusy',_0x7e3058=>!_0x7e3058),_0x14a6dc['on']('execute',()=>{this['fire']('tryAgain');}),_0xd47a72['bind']('isEnabled')['to'](this,'isBusy',_0x42c87b=>!_0x42c87b),_0xd47a72['on']('execute',()=>{this['fire']('showPrevious');}),_0x7850fb['bind']('isEnabled')['to'](this,'isBusy',_0x5bc3f9=>!_0x5bc3f9),_0x7850fb['on']('execute',()=>{this['fire']('showNext');}),this['_navigationPreviousButton']=_0xd47a72,this['_navigationCounter']=_0x412122,this['_navigationNextButton']=_0x7850fb,this['_navigationTryAgainButton']=_0x14a6dc;}['updateMiniToolbarButtons'](_0x56cfe9,_0x3badd5){this['_navigationPreviousButton']||this['_setupMiniToolbarButtons']();const _0x23bc4a=_0x56cfe9>0x1;if(this['addMiniToolbarItem'](this['_navigationTryAgainButton']),_0x23bc4a){this['addMiniToolbarItem'](this['_navigationPreviousButton']),this['addMiniToolbarItem'](this['_navigationCounter']),this['addMiniToolbarItem'](this['_navigationNextButton']);const _0x189cac=_0x56cfe9-_0x3badd5;this['_navigationCounter']['setInteractionCount'](_0x189cac+'/'+_0x56cfe9),this['_navigationPreviousButton']['isEnabled']=_0x3badd5<_0x56cfe9-0x1,this['_navigationNextButton']['isEnabled']=_0x3badd5>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'](_0x18f2a0){this['_isLoading']=_0x18f2a0;}['resetShowChangesButton'](){this['_miniToolbarView']['isShowChangesOn']=!0x1;}['_initializeScrollManager'](){const _0x266749=this['_getScrollableElement']();_0x266749&&!this['_scrollManager']&&(this['_scrollManager']=new ScrollManager(_0x266749));}['_getScrollableElement'](){return this['_streamableContentView']['element'];}}class AIActionsBalloonNavigationCounterView extends Nt{constructor(_0x349395){super(_0x349395);const _0x2fde38=this['bindTemplate'];this['set']('interactionCount','1/1'),this['setTemplate']({'tag':'span','attributes':{'class':['ck-ai-interaction-counter']},'children':[{'text':_0x2fde38['to']('interactionCount')}]});}['setInteractionCount'](_0x48c305){this['set']('interactionCount',_0x48c305);}}class AIActions extends _0x21762c{static get['requires'](){return[AIConnector,Bt,AIEditing,AIBalloon,_0x4f763b];}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(_0x2a7e86){super(_0x2a7e86),this['_bodyCollection']=new Qt(this['editor']['locale']),this['_bodyCollection']['attachToDom'](),this['_aiConnector']=this['editor']['plugins']['get']('AIConnector'),this['set']('isBusy',!0x1),this['_promiseQueue']=new PromiseQueue();}['stopInteraction'](){this['_stopInteraction']();}async['executeAction'](_0x33aa30,_0x42238f,_0x33900e){if(this['_stopInteraction'](),this['editor']['plugins']['has']('TableSelection')){if(this['editor']['plugins']['get']('TableSelection')['getSelectedTableCells']()){const {modelFragment:_0x16fb31,anchorData:_0x4fc2f3,root:_0x122dc9}=this['_getExecuteDataInTable']();return this['_executeAction'](_0x33aa30,_0x16fb31,_0x4fc2f3,_0x122dc9,_0x42238f,_0x33900e);}}const {modelFragment:_0x3e4561,anchorData:_0x144520,root:_0x2ac39f}=this['_getExecuteDataRegular']();return this['_executeAction'](_0x33aa30,_0x3e4561,_0x144520,_0x2ac39f,_0x42238f,_0x33900e);}async['destroy'](){return this['_stopInteraction'](),this['_bodyCollection']['detachFromDom'](),super['destroy']();}['_createActionsBalloonView'](){const _0x31c21f=this['editor']['plugins']['has']('TrackChanges');let _0xb5355c=this['editor']['config']['get']('ai.availableReplyActions')||[...bs];_0x31c21f||(_0xb5355c=_0xb5355c['filter'](_0x500286=>'insertSuggestion'!=_0x500286));const _0x3eae39=this['editor']['commands']['get']('trackChanges'),_0x462b00=new AIActionsBalloonView(this['editor']['locale'],{'showApplyButton':!0x0,'showSuggestButton':_0x31c21f,'miniToolbarConfig':{'showChanges':'icon'},'availableActions':_0xb5355c});return _0x462b00['bind']('isBusy')['to'](this),_0x3eae39&&_0x462b00['bind']('isTrackChangesOn')['to'](_0x3eae39,'value'),_0x462b00['on']('tryAgain',()=>{this['_refreshInteraction']();}),_0x462b00['on']('showPrevious',()=>{this['_navigateToPrevious']();}),_0x462b00['on']('showNext',()=>{this['_navigateToNext']();}),_0x462b00;}['_getExecuteDataRegular'](){const _0x27ad53=this['editor']['model']['document']['selection'],_0x1a42e9=_0x27ad53['getFirstRange']()['start']['root'];if(_0x27ad53['isCollapsed']){const _0x48bce3=At(_0x27ad53['getSelectedBlocks']())||this['editor']['model']['schema']['getLimitElement'](_0x27ad53);this['editor']['model']['change'](_0x50590c=>{_0x50590c['setSelection'](_0x48bce3,'in');});}const _0x1b3513=_0x27ad53['getFirstRange'](),_0x493c28=this['_wrapWithCommonAncestors'](this['editor']['model']['getSelectedContent'](_0x27ad53),_0x1b3513['start'],_0x1b3513['end']);this['_copyMarkersToFragment'](_0x493c28,_0x27ad53,{'isTableSelection':!0x1});const _0x49ac69=_0x27ad53['getFirstRange']()['start'],_0xcd9c98=new Map();let _0x1560a7=_0x493c28;for(let _0x2ceaeb=0x0;_0x2ceaeb<_0x49ac69['path']['length'];_0x2ceaeb++)_0xcd9c98['set'](_0x1560a7,_0x49ac69['path'][_0x2ceaeb]),_0x1560a7=_0x1560a7['getChild'](0x0);return{'modelFragment':_0x493c28,'anchorData':_0xcd9c98,'root':_0x1a42e9};}['_getExecuteDataInTable'](){const _0x3ed7c8=this['editor']['model']['document']['selection'],_0x4b7aa7=this['editor']['plugins']['get']('TableSelection'),_0x2732b6=_0x3ed7c8['getFirstRange']()['start']['root'],_0x1a82bb=_0x4b7aa7['getSelectionAsFragment'](),_0xf14d0b=_0x3ed7c8['getFirstRange']()['start']['parent']['parent'],_0xee23bc=this['editor']['model']['createRange'](this['editor']['model']['createPositionBefore'](_0xf14d0b),this['editor']['model']['createPositionAfter'](_0xf14d0b)),_0x6e95fa=this['_wrapWithCommonAncestors'](_0x1a82bb,_0xee23bc['start'],_0xee23bc['end']);this['_copyMarkersToFragment'](_0x6e95fa,_0x3ed7c8,{'isTableSelection':!0x0});const _0x2e88b4=_0x3ed7c8['getFirstRange']()['start'],_0x17a610=new Map();let _0x2fcc81=_0x6e95fa;for(let _0x27f72c=0x0;_0x27f72c<_0x2e88b4['path']['length'];_0x27f72c++)if(_0x17a610['set'](_0x2fcc81,_0x2e88b4['path'][_0x27f72c]),_0x27f72c<_0x2e88b4['path']['length']-0x1)_0x2fcc81=_0x2fcc81['getChild'](0x0);else{let _0x3832d1=_0x2fcc81['nextSibling'];for(;_0x3832d1;)_0x17a610['set'](_0x3832d1,_0x2e88b4['path'][_0x27f72c]),_0x3832d1=_0x3832d1['nextSibling'];}return{'modelFragment':_0x6e95fa,'anchorData':_0x17a610,'root':_0x2732b6};}async['_executeAction'](_0x59a26d,_0x10fb06,_0x242a37,_0x25e891,_0x3df4d2,_0x53e763){const _0x4ca6ed=this['editor']['plugins']['get'](AIEditing),_0x343091=this['editor']['plugins']['get'](AIBalloon),_0x35cbe5=this['editor']['model']['document']['selection'],_0x15b8fa=await _0x4ca6ed['modelToDataWithIds'](_0x10fb06),_0x3e6fbc=this['editor']['model']['document']['version'],_0x1ad22b=[..._0x35cbe5['getRanges']()];return this['_actionsBalloonView']||(this['_actionsBalloonView']=this['_createActionsBalloonView']()),this['_clearInteractionHistory'](),this['_clearErrorState'](),this['_balloonShowDiff']=!0x1,this['_actionsBalloonView']['resetShowChangesButton'](),this['_actionsBalloonView']['clearContent'](),_0x343091['open']({'index':0x3e8*Math['random']()%0x3e8,'title':_0x3df4d2,'icon':_0x53e763||_0x356c4e,'mainView':this['_actionsBalloonView'],'class':'ck-ai-actions-balloon','ranges':_0x1ad22b,'id':'aiActionsBalloon'}),this['_setLoadingState'](),this['stopListening'](this['_actionsBalloonView']),this['stopListening'](_0x343091),this['_interactionParams']={'action':_0x59a26d,'content':_0x15b8fa,'version':_0x3e6fbc,'aiBalloon':_0x343091,'modelFragment':_0x10fb06,'anchorData':_0x242a37,'root':_0x25e891},this['_setupApplyListeners'](),this['listenTo'](_0x343091,'selectionRemoved',()=>{this['_stopInteraction'](),this['_actionsBalloonView']['disableMiniToolbarButtons']();}),this['listenTo'](_0x343091,'dialogClosed',(_0x34cd85,{id:_0x1aa49b})=>{if('aiActionsBalloon'===_0x1aa49b){for(const _0x582169 of this['_interactions']){if(0x0===_0x582169['replies']['length']||_0x582169['stoppedExplicitly'])continue;const _0x1056e0=_0x582169['replies'][_0x582169['replies']['length']-0x1],_0x466066=_0x1056e0['changeGroups'][0x0];_0x466066&&'pending'===_0x466066['state']&&_0x1056e0['setChangeGroupState'](0x0,'rejected');}this['_stopInteraction'](),this['_clearInteractionHistory'](),this['stopListening'](this['_actionsBalloonView']),this['stopListening'](_0x343091);}}),this['_createInteraction'](_0x15b8fa,_0x3e6fbc,_0x343091,_0x59a26d);}['_setupApplyListeners'](){if(!this['_interactionParams'])return;const {modelFragment:_0x113f2f,anchorData:_0x782729,root:_0x40dff0}=this['_interactionParams'];this['listenTo'](this['_actionsBalloonView'],'applySuggestion',()=>{this['_applyChanges'](_0x113f2f,_0x782729,_0x40dff0,!0x1);}),this['listenTo'](this['_actionsBalloonView'],'insertSuggestion',()=>{this['_applyChanges'](_0x113f2f,_0x782729,_0x40dff0,!0x0);});}['_wrapWithCommonAncestors'](_0x27ad9d,_0x4df868,_0x3d0b03){const _0x1f8399=this['editor']['model']['createRange'](_0x4df868,_0x3d0b03)['getCommonAncestor'](),_0x9f5584=_0x1f8399['is']('documentFragment')?[]:_0x1f8399['getAncestors']({'includeSelf':!0x0})['slice'](0x1);if(_0x9f5584['length']){const _0x532497=_0x9f5584['map'](_0x10d012=>_0x10d012['_clone'](!0x1));for(let _0x368aa8=0x1;_0x368aa8<_0x532497['length'];_0x368aa8++)_0x532497[_0x368aa8-0x1]['_appendChild'](_0x532497[_0x368aa8]);return _0x532497[_0x532497['length']-0x1]['_appendChild'](_0x27ad9d),new _0x17ef1e(_0x532497[0x0]);}return _0x27ad9d;}['_copyMarkersToFragment'](_0x4a8f8a,_0x40a949,_0x4823c0={'isTableSelection':!0x1}){const _0x46b0f3=this['editor']['model'],_0x26cc41=Array['from'](_0x40a949['getRanges']()),_0x53c00b=_0x40a949['getFirstRange']()['start'];for(const _0xcd4518 of _0x46b0f3['markers']){if(_0xcd4518['name']['startsWith'](As)||!_0xcd4518['affectsData'])continue;const _0x5270c0=_0xcd4518['getRange']();if(!_0x26cc41['some'](_0x327a4f=>_0x327a4f['containsRange'](_0x5270c0,!0x0)))continue;const _0x10539a=this['_regularCalculateMarkerPath'](_0x5270c0['start'],_0x53c00b,_0x4823c0['isTableSelection']),_0x49bc5a=this['_regularCalculateMarkerPath'](_0x5270c0['end'],_0x53c00b,_0x4823c0['isTableSelection']),_0x43d12c=_0x46b0f3['createPositionFromPath'](_0x4a8f8a,_0x10539a),_0x53c83e=_0x46b0f3['createPositionFromPath'](_0x4a8f8a,_0x49bc5a);if(!_0x43d12c['isEqual'](_0x53c83e)){const _0x376d5b=_0x46b0f3['createRange'](_0x43d12c,_0x53c83e);_0x4a8f8a['markers']['set'](_0xcd4518['name'],_0x376d5b);}}}['_regularCalculateMarkerPath'](_0xbc410f,_0x29c8a6,_0x30c14b=!0x1){const _0x381c0a=[..._0xbc410f['path']['slice']()];for(let _0x3d2228=0x0;_0x3d2228<Math['max'](_0x29c8a6['path']['length'],_0xbc410f['path']['length']);_0x3d2228++){const _0x13af02=_0x29c8a6['path'][_0x3d2228]||0x0,_0x4c7278=(_0xbc410f['path'][_0x3d2228]||0x0)-_0x13af02;if(_0x381c0a[_0x3d2228]=_0x4c7278,0x0!==_0x4c7278&&!_0x30c14b)break;}return _0x381c0a;}async['_createInteraction'](_0x30941d,_0x90ef2b,_0x571294,_0x3db088){const _0x6cbcba=this['editor'];this['_interactionParams']||(this['_interactionParams']={'action':_0x3db088,'content':_0x30941d,'version':_0x90ef2b,'aiBalloon':_0x571294,'modelFragment':this['editor']['model']['getSelectedContent'](this['editor']['model']['document']['selection']),'anchorData':new Map(),'root':this['editor']['model']['document']['selection']['getFirstRange']()['start']['root']});const _0x555b8e=new AIActionsInteraction({'connector':this['_aiConnector'],'locale':_0x6cbcba['locale'],'content':_0x30941d,'version':_0x90ef2b,..._0x3db088});this['_interactions']['push'](_0x555b8e);const _0x5334db=(_0x18f0d5,_0x4bfb9a=!0x1,_0x34e723='streaming')=>this['_promiseQueue']['enqueue'](async _0x1d0d8c=>{try{const _0x9b717e=Zi({'editor':_0x6cbcba,'changeGroups':_0x18f0d5['changeGroups'],'documentContextContent':_0x18f0d5['documentContextContent'],'showDiff':_0x4bfb9a,'trimUnchanged':!0x1});_0x9b717e['length']&&await this['_actionsBalloonView']['updateContent']({'part':_0x9b717e[0x0],'renderingStrategy':_0x34e723,'abortSignal':_0x1d0d8c});}catch(_0x3aa38c){if(this['_isAbortError'](_0x3aa38c))return;throw _0x3aa38c;}});_0x555b8e['on']('replyCreated',(_0x3650e4,_0x11457a)=>{this['_actionsBalloonView']['hideLoader'](),this['_actionsBalloonView']['startAutoScroll'](),_0x5334db(_0x11457a)['catch'](_0x4828f1=>{this['_isAbortError'](_0x4828f1)||(console['error']('Error\x20updating\x20content\x20in\x20replyCreated:',_0x4828f1),this['_setErrorState'](_0x555b8e));});}),_0x555b8e['on']('replyContentUpdated',(_0x40dc30,_0x2c9343)=>{_0x5334db(_0x2c9343)['catch'](_0x39bd56=>{this['_isAbortError'](_0x39bd56)||(console['error']('Error\x20updating\x20content\x20in\x20replyContentUpdated:',_0x39bd56),this['_setErrorState'](_0x555b8e));});}),_0x555b8e['on']('interactionFinished',async()=>{try{await this['_clearLoadingState'](),this['_actionsBalloonView']['updateMiniToolbarButtons'](this['_interactions']['length'],this['_currentInteractionIndex']),await this['_promiseQueue']['queueEmptyPromise'];}catch(_0x34c922){this['_isAbortError'](_0x34c922)||(console['error']('Error\x20clearing\x20loading\x20state\x20in\x20interactionFinished:',_0x34c922),this['_setErrorState'](_0x555b8e));}finally{this['_actionsBalloonView']['stopAutoScroll']();}}),this['listenTo'](this['_actionsBalloonView'],'toggleSuggestionDisplayMode',async(_0x188a28,{showDiff:_0x1834d2})=>{try{this['_balloonShowDiff']=_0x1834d2;const _0x2f0009=this['_interaction']['replies'][this['_interaction']['replies']['length']-0x1];_0x2f0009&&await _0x5334db(_0x2f0009,_0x1834d2,'static');}catch(_0x119205){this['_isAbortError'](_0x119205)||(console['error']('Error\x20updating\x20content\x20in\x20toggleSuggestionDisplayMode:',_0x119205),this['_setErrorState'](_0x555b8e));}}),_0x555b8e['on']('replyChangeGroupStateUpdated',()=>{const _0x5b71fa={'positiveCount':_0x555b8e['replies']['reduce']((_0x31cf4d,_0x211c12)=>_0x31cf4d+_0x211c12['changeGroups']['filter'](_0x192058=>'accepted'===_0x192058['state'])['length'],0x0),'totalCount':_0x555b8e['replies']['reduce']((_0x216835,_0x2adfa1)=>_0x216835+_0x2adfa1['changeGroups']['length'],0x0)},_0x6b2dc5=_0x555b8e['actionCallId'],_0x2a0167=_0x555b8e['actionName'];_0x2a0167?this['_aiConnector']['upsertAIActionRating'](_0x2a0167,_0x6b2dc5,_0x5b71fa):this['_aiConnector']['upsertCustomAIActionRating'](_0x6b2dc5,_0x5b71fa);}),this['_setLoadingState']();try{const _0xc505a9=await _0x555b8e['start']();return this['_actionsBalloonView']['updateMiniToolbarButtons'](this['_interactions']['length'],this['_currentInteractionIndex']),_0xc505a9;}catch(_0x585830){if(this['_isAbortError'](_0x585830))return;this['_actionsBalloonView']['hideLoader'](),this['_setErrorState'](_0x555b8e);}}['_applyChanges'](_0x144632,_0x241e67,_0x4704b2,_0x2c0d42){const _0x33e4fd=this['editor'];if(_0x2c0d42&&!_0x33e4fd['plugins']['has']('TrackChanges'))throw new at('ai-no-track-changes',null);const _0x1ac7aa=this['editor']['plugins']['get'](_0x4f763b),_0x261adc=this['_interactions'][this['_interactions']['length']-0x1-this['_currentInteractionIndex']];if(!_0x261adc||!_0x261adc['replies']['length'])return;const _0x52e749=_0x261adc['replies'][_0x261adc['replies']['length']-0x1],_0x5e147c=_0x52e749['changeGroups'];_0x52e749['setChangeGroupState'](0x0,'accepted');let _0x243ae5=_s({'editor':_0x33e4fd,'reply':_0x52e749,'interaction':_0x261adc,'groups':_0x5e147c,'transform':!0x1,'documentCompare':_0x1ac7aa,'documentCompareOptions':{'anchor':_0x33e4fd['model']['createPositionAt'](_0x144632,0x0),'markDeletions':_0x2c0d42}});_0x243ae5=this['_filterOperationsOutsideRange'](_0x243ae5,_0x241e67);for(const _0x55f796 of _0x243ae5)this['_anchorOperation'](_0x241e67,_0x55f796,_0x4704b2);const _0x38dac7=_0x261adc['getDocumentContext']()['version'],_0x5028fe=_0x33e4fd['model']['document']['history']['getOperations'](_0x38dac7),_0x34c406={'document':_0x33e4fd['model']['document'],'useRelations':!0x1,'padWithNoOps':!0x1},_0x5b4405=_0x5afac3(_0x243ae5,_0x5028fe,_0x34c406)['operationsA'];_0x33e4fd['model']['change'](_0x31bca4=>{if(_0x31bca4['setSelection'](_0x33e4fd['model']['document']['selection']['focus']),_0x2c0d42)_0x33e4fd['plugins']['get']('TrackChangesEditing')['_applyOperationsAsSuggestions'](_0x5b4405);else{for(const _0xdc96c1 of _0x5b4405)_0xdc96c1['baseVersion']=_0x33e4fd['model']['document']['version'],Is(_0x33e4fd,_0xdc96c1),_0x31bca4['batch']['addOperation'](_0xdc96c1),_0x33e4fd['model']['applyOperation'](_0xdc96c1);}}),this['editor']['plugins']['get']('AIBalloon')['close']();}['_filterOperationsOutsideRange'](_0x33e4b9,_0x31ec5d){return _0x33e4b9['filter'](_0x914799=>{if('rename'==_0x914799['type']){const _0x4e752c=_0x914799['position']['nodeAfter'];return!_0x31ec5d['has'](_0x4e752c);}if(_0x914799['type']['indexOf']('Attribute')>-0x1){const _0x676ae5=_0x914799['range']['start']['nodeAfter'];return!_0x31ec5d['has'](_0x676ae5);}return!0x0;});}['_anchorOperation'](_0x57c1b7,_0x5c1a53,_0x20d74a){const _0x4a3907=_0x5c1a53['clone']();for(const _0x29732c in _0x5c1a53){const _0x1597ef=_0x5c1a53[_0x29732c];_0x1597ef instanceof _0x3070cc?_0x5c1a53[_0x29732c]=new _0x3070cc(_0x2689fc(_0x1597ef['start']),_0x2689fc(_0x1597ef['end'])):_0x1597ef instanceof _0x4357c7&&(_0x5c1a53[_0x29732c]=_0x2689fc(_0x1597ef));}if(['insert','move','remove','reinsert','split','merge']['includes'](_0x4a3907['type'])){if(_0x4a3907['isDocumentOperation']=!0x1,_0x4a3907['baseVersion']=null,'remove'==_0x4a3907['type']){const _0x472862=_0x4a3907['sourcePosition'],_0xf554a1=_0x4a3907['howMany'];new _0x33b723(_0x472862,_0xf554a1)['_execute']();}else _0x4a3907['_execute']();}function _0x2689fc(_0x6a59f4){if('$graveyard'==_0x6a59f4['root']['rootName'])return _0x6a59f4;const _0x5a837c=[];let _0x5edfb4=_0x6a59f4['root'];for(let _0x59cc9e=0x0;_0x59cc9e<_0x6a59f4['path']['length'];_0x59cc9e++){const _0x300ce5=_0x57c1b7['get'](_0x5edfb4)||0x0;_0x5a837c[_0x59cc9e]=_0x6a59f4['path'][_0x59cc9e]+_0x300ce5,_0x5edfb4=_0x5edfb4['getChildAtOffset'](_0x6a59f4['path'][_0x59cc9e]);}return new _0x4357c7(_0x20d74a,_0x5a837c,_0x6a59f4['stickiness']);}}['_refreshInteraction'](){if(!this['_interactionParams'])return;this['_interactions']['length']>0x0&&this['_stopInteraction'](),this['_currentInteractionIndex']=0x0,this['_balloonShowDiff']=!0x1;const {action:_0x2dc2df,content:_0x210155,version:_0x1e1a34,aiBalloon:_0x4fdd4a}=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'](_0x210155,_0x1e1a34,_0x4fdd4a,_0x2dc2df)['catch'](_0x144132=>{this['_isAbortError'](_0x144132)||console['error']('Error\x20refreshing\x20interaction:',_0x144132);});}['_isAbortError'](_0x59dded){return!!_0x59dded['message']&&_0x59dded['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 _0x2bc4e0=this['_interactions']['length'];this['_currentInteractionIndex']<_0x2bc4e0-0x1&&this['_displayInteractionAtIndex'](this['_currentInteractionIndex']+0x1);}['_navigateToNext'](){this['_currentInteractionIndex']>0x0&&this['_displayInteractionAtIndex'](this['_currentInteractionIndex']-0x1);}async['_displayInteractionAtIndex'](_0x5cc117){if(!this['_interactionParams'])return;this['_currentInteractionIndex']=_0x5cc117;const _0x5f492f=this['_interactions'][this['_interactions']['length']-0x1-this['_currentInteractionIndex']];if(!_0x5f492f)return;if(_0x5f492f['hasError'])return this['_setErrorState'](_0x5f492f),void this['_actionsBalloonView']['updateMiniToolbarButtons'](this['_interactions']['length'],this['_currentInteractionIndex']);if(!_0x5f492f['replies']['length'])return;this['_actionsBalloonView']['hideError'](),this['_interactionParams']&&this['_clearErrorState']();const _0x13b7f7=_0x5f492f['replies'][_0x5f492f['replies']['length']-0x1];if(_0x13b7f7){const _0x10979e=this['editor'];try{const _0x2aaaa5=Zi({'editor':_0x10979e,'changeGroups':_0x13b7f7['changeGroups'],'documentContextContent':_0x13b7f7['documentContextContent'],'showDiff':this['_balloonShowDiff'],'trimUnchanged':!0x1});await new Promise(_0x53671a=>setTimeout(_0x53671a,0x32)),await this['_actionsBalloonView']['updateContent']({'part':_0x2aaaa5[0x0],'renderingStrategy':'static','abortSignal':new AbortController()['signal']});}catch(_0x5811fc){this['_isAbortError'](_0x5811fc)||console['error']('Error\x20updating\x20content\x20during\x20navigation:',_0x5811fc);}}this['_actionsBalloonView']['updateMiniToolbarButtons'](this['_interactions']['length'],this['_currentInteractionIndex']);}['_setLoadingState'](){this['_actionsBalloonView']['setIsLoading'](!0x0),this['isBusy']=!0x0;}async['_setErrorState'](_0x3ae74c){const _0xb124e0=Hi(this['editor']['locale'],'AI_ACTIONS_GENERIC_ERROR');this['_actionsBalloonView']['showError'](_0xb124e0),_0x3ae74c['hasError']=!0x0,await this['_promiseQueue']['queueEmptyPromise'],this['_actionsBalloonView']['setErrorState'](),this['_actionsBalloonView']['toggleIsLoading'](!0x0);}['_clearErrorState'](){this['_actionsBalloonView']['hideError'](),this['_actionsBalloonView']['toggleIsLoading'](!0x1);}async['_clearLoadingState'](){await this['_promiseQueue']['queueEmptyPromise'],this['isBusy']=!0x1,this['_actionsBalloonView']['setIsLoading'](!0x1);}}class AIQuickActions extends _0x21762c{static get['requires'](){return[AIQuickActionsUI,AIQuickActionsEditing,AIActions];}static get['pluginName'](){return'AIQuickActions';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x42f54b){super(_0x42f54b),_0x42f54b['config']['define']('ai.quickActions',{'extraCommands':[],'removeCommands':[],'isSearchEnabled':!0x0});}}class AIReviewCoreReviewCheckListItemResultsView extends Nt{['resultResponseView'];['acceptButtonView'];['dismissButtonView'];['infoButtonView'];['outdatedButtonView'];constructor(_0x314e04,_0x2e1ce3){super(_0x314e04),this['id']=_0x2e1ce3,this['set']('status','pending'),this['set']('changeId',_0x2e1ce3),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',(_0x47e2e1,_0x2dc625)=>{_0x2dc625&&_0x2dc625['target']&&'A'===_0x2dc625['target']['tagName']&&_0x2dc625['preventDefault'](),this['fire']('activateChange',{'id':_0x2e1ce3,'source':this,'uiInteraction':'click'});}),this['on']('mouseover',()=>{this['fire']('activateChange',{'id':_0x2e1ce3,'source':this,'uiInteraction':'hover'});}),this['on']('mouseout',()=>{this['fire']('deactivateChange',{'origin':'panel','id':_0x2e1ce3,'source':this});});}['setItemAsActive'](){this['isActive']=!0x0;}['setItemAsInactive'](){this['isActive']=!0x1;}['_createResultResponseView'](){const _0x5e93aa=new Nt(this['locale']);return _0x5e93aa['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',_0x4638f2=>!_0x4638f2)]}}),_0x5e93aa;}['_createAcceptButtonView'](){const _0x5cd681=new vt(this['locale']);return _0x5cd681['set']({'label':Hi(this['locale'],'AI_REVIEW_MODE_ACCEPT_CHANGE'),'withText':!0x0}),_0x5cd681['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x198de7=>{this['fire']('acceptChange',{'id':this['changeId']}),_0x198de7['stopPropagation']();})},'attributes':{'class':[this['bindTemplate']['if']('status','ck-hidden',_0x2813c3=>'pending'!==_0x2813c3&&'accepted'!==_0x2813c3),this['bindTemplate']['if']('status',Ui,_0x1ad713=>'pending'===_0x1ad713),this['bindTemplate']['if']('status',Bi,_0x670491=>'pending'!==_0x670491),this['bindTemplate']['if']('status','ck-ai_review__check-run-result-status-button',_0x41cf97=>'accepted'===_0x41cf97)]}}),this['on']('change:status',(_0x1bd393,_0xb6cc0a,_0x5daa25)=>{_0x5cd681['isEnabled']='pending'===_0x5daa25,'accepted'===_0x5daa25&&(_0x5cd681['label']=Hi(this['locale'],'AI_REVIEW_MODE_CHECK_STATUS_ACCEPTED'),_0x5cd681['icon']=_0xfcbf97);}),_0x5cd681;}['_createDismissButtonView'](){const _0x211d38=new vt(this['locale']);return _0x211d38['set']({'label':Hi(this['locale'],'AI_REVIEW_MODE_DISMISS_CHANGE'),'withText':!0x0}),_0x211d38['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x564948=>{this['fire']('dismissChange',{'id':this['changeId']}),_0x564948['stopPropagation']();})},'attributes':{'class':[Bi,this['bindTemplate']['if']('status','ck-hidden',_0x25b4dd=>'pending'!==_0x25b4dd&&'rejected'!==_0x25b4dd),this['bindTemplate']['if']('status','ck-ai_review__check-run-result-dismiss-button',_0x57f46b=>'pending'===_0x57f46b),this['bindTemplate']['if']('status','ck-ai_review__check-run-result-status-button',_0x5c029b=>'rejected'===_0x5c029b)]}}),this['on']('change:status',(_0x35f32e,_0x406a54,_0x33f24c)=>{_0x211d38['isEnabled']='pending'===_0x33f24c,'rejected'===_0x33f24c&&(_0x211d38['label']=Hi(this['locale'],'AI_REVIEW_MODE_CHECK_STATUS_REJECTED'),_0x211d38['icon']=_0x189920);}),_0x211d38;}['_createInfoButtonView'](){const _0x2d8110=new vt(this['locale']);return _0x2d8110['set']({'label':Hi(this['locale'],'AI_REVIEW_MODE_LEARN_MORE'),'icon':_0x5e8452,'tooltip':!0x0,'isToggleable':!0x0,'role':'menuitemcheckbox','class':Bi+'\x20ck-ai_review__check-run-result-info-button\x20ck-hidden'}),_0x2d8110['bind']('isOn')['to'](this,'isInfoToggleOn',_0x708bbe=>_0x708bbe),_0x2d8110['on']('execute',()=>{this['isInfoToggleOn']=!this['isInfoToggleOn'];}),_0x2d8110;}['_createOutdatedButtonView'](){const _0x7f70d0=new vt(this['locale']);return _0x7f70d0['set']({'label':Hi(this['locale'],'AI_REVIEW_MODE_CHECK_STATUS_OUTDATED'),'icon':it,'withText':!0x0,'isEnabled':!0x1}),_0x7f70d0['extendTemplate']({'attributes':{'class':[Bi,'ck-ai_review__check-run-result-status-button',this['bindTemplate']['if']('status','ck-hidden',_0x3fd097=>'outdated'!==_0x3fd097)],'disabled':'disabled'}}),_0x7f70d0;}}class AIReviewCoreBalloonSuggestionItemView extends Xt{['resultItemView'];['_pinnedRectIndex']=void 0x0;['_pinnedTargetElement']=void 0x0;['_pinnedTargetChangeId']=void 0x0;constructor(_0x356b00,_0x4df6c5){super(_0x356b00),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']()),_0x4df6c5['add'](this);}['render'](){super['render'](),this['_setupClickOutsideHandler']();}['updateContent'](_0xae4235){this['resultItemView']['changeId']=_0xae4235['id'],this['resultItemView']['resultResponseView']['element']['innerHTML']=_0xae4235['contentDiffed'];}['showBalloon'](_0xb7e227,_0x232864,_0x536707,_0x146521,_0x25b121,_0x282f10){const _0x494efd=_0x232864();if(!_0x494efd)return;this['updateContent'](_0xb7e227),this['show']();const _0x2aba8c=Array['from'](_0x494efd['getClientRects']())['reverse'](),_0x429e71=this['_getPointedRectIndexFromEvent'](_0x536707,_0x2aba8c),_0x5aba3b=_0x2aba8c[_0x429e71??0x0];'click'===_0x146521?(this['isDiffActive']=!0x0,this['pin']({'target':()=>this['_getBestRectPositionOnClick'](_0x232864(),_0x429e71,_0xb7e227['id'],_0x25b121,_0x282f10)||_0x5aba3b})):'hover'===_0x146521&&(this['isDiffActive']=!0x1,this['pin']({'target':()=>this['_getBestRectPositionOnHover'](_0x232864(),_0x429e71,_0xb7e227['id'])||_0x5aba3b}));}['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 _0x4ed4de=[this['element']];return this['_pinnedTargetElement']&&_0x4ed4de['push'](this['_pinnedTargetElement']),_0x4ed4de;},'callback':()=>{this['hide'](),this['unpin'](),this['deactivateChange'](),this['_pinnedTargetElement']=void 0x0,this['_pinnedRectIndex']=void 0x0,this['_pinnedTargetChangeId']=void 0x0;}});}['_createContentView'](){const _0x2d93b6=new Nt();return this['resultItemView']=new AIReviewCoreReviewCheckListItemResultsView(this['locale'],''),this['resultItemView']['resultResponseView']['extendTemplate']({'attributes':{'class':['ck-content']}}),this['resultItemView']['delegate']('acceptChange','dismissChange')['to'](this),_0x2d93b6['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']]}]}),_0x2d93b6;}['_getBestRectPositionOnClick'](_0x827b18,_0x51aa82,_0x4998d0,_0x4230ed,_0x480f26){if(!_0x827b18)return null;const _0x55f229=this['position']['replace']('arrow_',''),_0x2f8252=Array['from'](_0x827b18['getClientRects']());let _0x4924c8,_0x2af62b=_0x2f8252['reverse']();return void 0x0!==_0x51aa82&&this['_isPinnedRectVisible'](_0x2af62b[_0x51aa82],_0x4230ed,_0x480f26)?(_0x4924c8=_0x2af62b[_0x51aa82],this['_pinnedRectIndex']=_0x51aa82):this['_isPinnedRectVisible'](_0x2af62b[0x0],_0x4230ed,_0x480f26)&&void 0x0===_0x51aa82?_0x4924c8=_0x2af62b[0x0]:(_0x2af62b='s'==_0x55f229[0x0]?[..._0x2f8252]['reverse']():_0x2f8252,_0x2af62b['forEach'](_0xd30bab=>{this['_isPinnedRectVisible'](_0xd30bab,_0x4230ed,_0x480f26)&&(_0x4924c8=_0xd30bab);})),this['_pinnedTargetChangeId']=_0x4998d0,this['_pinnedTargetElement']=_0x827b18,_0x4924c8||_0x827b18['getBoundingClientRect']();}['_getBestRectPositionOnHover'](_0x406c28,_0x425ef0,_0x3175de){if(!_0x406c28)return null;const _0x1e5036=Array['from'](_0x406c28['getClientRects']())['reverse']();if(void 0x0===this['_pinnedRectIndex']&&void 0x0!==_0x425ef0&&this['_pinnedTargetChangeId']!==_0x3175de)return this['_pinnedRectIndex']=_0x425ef0,this['_pinnedTargetElement']=_0x406c28,this['_pinnedTargetChangeId']=_0x3175de,_0x1e5036[_0x425ef0];if(void 0x0!==this['_pinnedRectIndex']&&this['_pinnedTargetChangeId']===_0x3175de){if(_0x406c28!==this['_pinnedTargetElement'])return Array['from'](this['_pinnedTargetElement']['getClientRects']())['reverse']()[this['_pinnedRectIndex']];return _0x1e5036[this['_pinnedRectIndex']];}return void 0x0!==_0x425ef0&&this['_pinnedTargetChangeId']!==_0x3175de?(this['_pinnedRectIndex']=_0x425ef0,this['_pinnedTargetElement']=_0x406c28,this['_pinnedTargetChangeId']=_0x3175de,_0x1e5036[_0x425ef0]):_0x406c28['getBoundingClientRect']();}['_getPointedRectIndexFromEvent'](_0x3ae013,_0x1c24af){if(_0x3ae013)for(let _0xde479a=0x0;_0xde479a<_0x1c24af['length'];_0xde479a++){const _0x5d2e1d=_0x1c24af[_0xde479a];if(_0x3ae013['clientX']>=_0x5d2e1d['left']-0x3&&_0x3ae013['clientX']<=_0x5d2e1d['right']+0x3&&_0x3ae013['clientY']>=_0x5d2e1d['top']-0x3&&_0x3ae013['clientY']<=_0x5d2e1d['bottom']+0x3)return _0xde479a;}}['_isPinnedRectVisible'](_0x15f96c,_0x7e0af5,_0x3af302){const _0x58bd62=new ut(_0x15f96c),_0x1526cc=_0x7e0af5||document['documentElement'],_0x1bcca1=_0x58bd62['getIntersection'](bt(_0x3af302)),_0x8bef56=new ut(_0x1526cc)['getIntersection'](_0x58bd62);return!!(_0x1bcca1&&_0x8bef56&&_0x58bd62['width']>0x0);}}const Fn=['getReviewCheckList','runReviewCheck','abortReviewStream','toggleDiff','acceptAllChanges','leaveReviewCoreResultList','activateChange','deactivateChange','acceptChange','dismissChange','learnMore','finishReview','retryReview'];class AIReviewCoreUI extends _0x530a64{['_mainView'];['_balloonSuggestionView'];['_bodyCollection'];static get['requires'](){return[AITabs];}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x164729){super(_0x164729),this['_bodyCollection']=new Qt(this['context']['locale']),this['_bodyCollection']['attachToDom'](),this['_mainView']=this['createMainView'](),this['_mainView']['delegate'](...Fn)['to'](this),this['_balloonSuggestionView']=new AIReviewCoreBalloonSuggestionItemView(this['context']['locale'],this['_bodyCollection']),this['_balloonSuggestionView']['delegate']('acceptChange','dismissChange','deactivateChange')['to'](this);}['init'](){const _0x2b09e4=this['context']['plugins']['get']('AITabs');this['registerTab'](_0x2b09e4);}['destroy'](){this['_bodyCollection']['detachFromDom'](),super['destroy']();}['setAvailableChecks'](_0x455f51){if(!this['_mainView']['reviewCheckListView']['hasChecks']()){const _0x49dc87=!this['context']['config']['get']('ai.models.showModelSelector');this['_mainView']['reviewCheckListView']['setChecks'](_0x455f51,_0x49dc87);}this['_mainView']['showReviewCheckListView']();}['showReviewCheckList'](){this['fire']('getReviewCheckList');}['showCheckRunResults'](_0xd03ebd){_0xd03ebd&&('error-general'!==_0xd03ebd['status']?'error-chunk'!==_0xd03ebd['status']?this['_mainView']['showReviewCheckResultsView']():this['showChunkErrorView']():this['showGeneralResultsErrorView']());}['showCheckRunResult'](_0xf9020f){this['_mainView']['addCheckRunResult'](_0xf9020f);}['showGeneralResultsErrorView'](){this['_mainView']['showGeneralResultsErrorView']();}['showGeneralReviewCoreErrorView'](_0x30ba97){this['_mainView']['showGeneralReviewCoreErrorView'](_0x30ba97??Hi(this['context']['locale'],'AI_REVIEW_INITIALIZATION_ERROR_MESSAGE'));}['showChunkErrorView'](){this['_mainView']['showChunkErrorView']();}['setCheckResultTitle'](_0x33e24d,_0x23e341){this['_mainView']['reviewCheckResultsView']['setTitle'](_0x33e24d,_0x23e341);}['setActiveStateInResults'](_0x2830d3){this['_mainView']['reviewCheckResultsView']['getResults']()['forEach'](_0x47a32e=>{_0x47a32e['id']===_0x2830d3&&_0x47a32e['setItemAsActive']();});}['resetActiveStateInResults'](){this['_mainView']['reviewCheckResultsView']['getResults']()['forEach'](_0x364dbb=>_0x364dbb['setItemAsInactive']());}['updateChangeState'](_0xe71ff,_0x3c53b3){'accepted'===_0x3c53b3||'rejected'===_0x3c53b3||'outdated'===_0x3c53b3?this['_mainView']['reviewCheckResultsView']['hideResult'](_0xe71ff,_0x3c53b3):this['_mainView']['reviewCheckResultsView']['showResult'](_0xe71ff,_0x3c53b3);}['showReviewCompletedView'](){this['_mainView']['showReviewCompletedView']();}['showActionsWhenResultIsReady'](){this['_mainView']['showActionsWhenResultIsReady']();}['showNoChangesView'](){this['_mainView']['showNoChangesView']();}['hideActionsWhenResultIsReady'](){this['_mainView']['hideActionsWhenResultIsReady']();}['showChangeBalloon'](_0x5696dd,_0x5c27e8,_0x43756a,_0x1bc6c4,_0x54063d,_0x2c4f35){this['_balloonSuggestionView']['showBalloon'](_0x5696dd,_0x5c27e8,_0x43756a,_0x1bc6c4,_0x54063d,_0x2c4f35);}['hideChangeBalloon'](){this['_balloonSuggestionView']['hideBalloon']();}['hideDiffInBalloon'](){this['_balloonSuggestionView']['hideDiffInBalloon']();}['showDiffInBalloon'](){this['_balloonSuggestionView']['showDiffInBalloon']();}['getChangeElement'](_0x317724){const _0x2302fd=this['_mainView']['reviewCheckResultsView']['getResults']()['find'](_0x1dd509=>_0x1dd509['id']===_0x317724);return _0x2302fd?_0x2302fd['element']:null;}['deactivateChange'](){this['_balloonSuggestionView']['deactivateChange']();}}class AIReviewCoreGeneralErrorView extends Nt{constructor(_0xe7723a){super(_0xe7723a),this['set']('isVisible',!0x1),this['set']('errorMessage','');const _0x57a44a=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai_review__general-error-container',_0x57a44a['if']('isVisible','ck-hidden',_0x81a5d2=>!_0x81a5d2)]},'children':[{'tag':'p','attributes':{'class':'ck\x20ck-ai-notification\x20ck-ai-notification_error'},'children':[{'text':_0x57a44a['to']('errorMessage')}]}]});}}class AIReviewCoreView extends Nt{['reviewCoreHeader'];['generalErrorView'];['reviewCheckListView'];['reviewCheckResultsView'];['reviewCompletedView'];constructor(_0x15bdb6,_0x2de3d2){super(_0x15bdb6),this['reviewCoreHeader']=_0x2de3d2['header'],this['generalErrorView']=new AIReviewCoreGeneralErrorView(_0x15bdb6),this['reviewCheckListView']=_0x2de3d2['list'],this['reviewCheckListView']['delegate'](...Fn)['to'](this),this['reviewCheckResultsView']=_0x2de3d2['results'],this['reviewCheckResultsView']['delegate'](...Fn)['to'](this),this['reviewCompletedView']=_0x2de3d2['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'](_0x5206de){this['reviewCheckResultsView']['addResult'](_0x5206de),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'](_0x5927cb){this['generalErrorView']['set']('isVisible',!0x0),this['generalErrorView']['errorMessage']=_0x5927cb;}['showGeneralResultsErrorView'](){this['reviewCheckResultsView']['set']('isLoading',!0x1),this['showActionsWhenResultIsReady'](),this['reviewCheckResultsView']['showGeneralErrorMessage']();}['showChunkErrorView'](){this['reviewCheckResultsView']['set']('isLoading',!0x1),this['showActionsWhenResultIsReady'](),this['reviewCheckResultsView']['showChunkErrorMessage']();}}class AIReviewCoreFinishReviewButtonView extends vt{constructor(_0x53c86f,_0x33acb0){super(_0x33acb0),this['set']({'label':_0x53c86f,'withText':!0x0,'class':Mi}),this['on']('execute',()=>{this['fire']('finishReview');});}}class AIReviewCoreUICheckResultsView extends Pt{['_resultViews'];['_resultsHeader'];['_resultsBody'];['reviewDisclaimer'];['_cancelButtonView'];['_acceptAllButtonView'];['_exitReviewButtonView'];['_toggleDiffButtonView'];['_errorMessageView'];['_finishReviewButtonView'];['_contents'];constructor(_0x24beb0,_0x3c44f3){super(_0x24beb0),this['_contents']=_0x3c44f3,this['_resultViews']=new _0x83e50c(),this['_cancelButtonView']=this['_createCancelButtonView'](),this['_acceptAllButtonView']=this['_createAcceptAllButtonView'](),this['_exitReviewButtonView']=this['_createExitReviewButtonView'](),this['_toggleDiffButtonView']=this['_createToggleDiffButtonView'](),this['_finishReviewButtonView']=this['_createFinishReviewButtonView'](),this['_resultsHeader']=this['_createResultHeaderView'](),this['_resultsBody']=this['_createResultsBodyView'](),this['_errorMessageView']=this['_createErrorView'](),this['reviewDisclaimer']=new AIDisclaimerView(_0x24beb0),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 _0xaaedf9=this['_createCombinedSkeletonLoader'](),_0xbbda40=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-run',_0xbbda40['if']('isLoading','ck-ai_review__check-run_loading',_0x2f16fa=>_0x2f16fa),_0xbbda40['if']('isResultReady','ck-ai_review__check-run_ready',_0xbcb695=>_0xbcb695),_0xbbda40['if']('isVisible','ck-hidden',_0x4dceb4=>!_0x4dceb4)]},'children':[this['_resultsHeader'],this['_errorMessageView'],this['_resultsBody'],_0xaaedf9,this['reviewDisclaimer']]});}['clearResults'](){this['_resultViews']['clear'](),this['_resultsBody']['element']&&(this['_resultsBody']['element']['scrollTop']=0x0);}['getResults'](){return this['_resultViews'];}['addResult'](_0x41fd17){const _0xe4bc20=new AIReviewCoreReviewCheckListItemResultsView(this['locale'],_0x41fd17['id']);_0xe4bc20['delegate']('acceptChange','dismissChange','activateChange','deactivateChange')['to'](this),this['_resultViews']['add'](_0xe4bc20),_0xe4bc20['resultResponseView']['element']['innerHTML']=_0x41fd17['contentDiffed'];}['hideResult'](_0x5e1d9a,_0x3b799a){if('pending'===_0x3b799a)return;const _0x25f260=this['_resultViews']['find'](_0x27b79d=>_0x27b79d['id']===_0x5e1d9a);_0x25f260&&(_0x25f260['status']=_0x3b799a,_0x25f260['element']?.['classList']['add']('ck-ai_review__check-run-result_grayout'));}['showResult'](_0x427d7d,_0x15a7b3){if('pending'!==_0x15a7b3)return;const _0x3a1de2=this['_resultViews']['find'](_0x160d4b=>_0x160d4b['id']===_0x427d7d);_0x3a1de2&&(_0x3a1de2['status']=_0x15a7b3,_0x3a1de2['element']?.['classList']['remove']('ck-ai_review__check-run-result_grayout'));}['setTitle'](_0x4fa92b,_0x11b24d){this['headerTitle']=_0x4fa92b,this['headerSubtitle']=_0x11b24d||'';}['showChunkErrorMessage'](){this['errorType']='chunk',this['showErrorMessage']=!0x0;}['showGeneralErrorMessage'](){this['isError']=!0x0,this['errorType']='general',this['showErrorMessage']=!0x0;}['resetErrorState'](){this['isError']=!0x1,this['errorType']='general',this['showErrorMessage']=!0x1;}['_createSkeletonLoader'](){return new AISkeletonView(this['locale'],Ss['aiReviewChecks']);}['_createCombinedSkeletonLoader'](){const _0x47f0ba=new Nt(this['locale']),_0x3697dd=[];for(let _0x2ed549=0x0;_0x2ed549<0x10;_0x2ed549++){const _0xc85067=this['_createSkeletonLoader']();_0xc85067['extendTemplate']({'attributes':{'class':['ck-ai_review__check-run-skeleton-item']}}),_0x3697dd['push'](_0xc85067);}return _0x47f0ba['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-run-skeleton-container',this['bindTemplate']['if']('isLoading','ck-hidden',_0x582272=>!_0x582272)]},'children':_0x3697dd}),_0x47f0ba;}['_createResultsBodyView'](){const _0x57b54a=new Nt(this['locale']);return _0x57b54a['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-run-results-container','ck-reset_all-excluded',this['bindTemplate']['if']('isLoading','ck-hidden',_0x559053=>_0x559053)]},'children':this['_resultViews']}),_0x57b54a;}['_createErrorView'](){const _0x2b7597=new Nt(this['locale']),_0x2b7153=new vt(this['locale']),t=this['locale']['t'];return _0x2b7597['delegate']('retryReview')['to'](this),_0x2b7153['set']({'label':t('Try\x20again'),'withText':!0x0,'class':Ui+'\x20ck-ai_review__check-run-error-retry-button'}),_0x2b7153['on']('execute',()=>{this['fire']('retryReview');}),_0x2b7597['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-run-error-container',this['bindTemplate']['if']('showErrorMessage','ck-hidden',_0x3c8c35=>!_0x3c8c35),this['bindTemplate']['if']('errorType','ck-ai_review__check-run-error-container_border-bottom',_0x11c7a6=>'chunk'===_0x11c7a6)]},'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',_0xdbc7cb=>'chunk'===_0xdbc7cb)]},'children':[{'tag':'p','attributes':{'class':['ck-ai-notification__content',this['bindTemplate']['if']('errorType','ck-hidden',_0x3103a4=>'general'!==_0x3103a4)]},'children':[{'text':this['_contents']['generalErrorText']}]},{'tag':'p','attributes':{'class':['ck-ai-notification__content',this['bindTemplate']['if']('errorType','ck-hidden',_0x392876=>'chunk'!==_0x392876)]},'children':[{'text':Hi(this['locale'],'AI_REVIEW_MODE_CHUNK_ERROR_MESSAGE')}]}]},_0x2b7153]}),_0x2b7597;}['_createCancelButtonView'](){const _0x5650a6=new vt(this['locale']);return _0x5650a6['set']({'label':Hi(this['locale'],'AI_REVIEW_MODE_STOP_GENERATING'),'withText':!0x0,'class':[Ui+'\x20ck-ai-button-stop-generating'],'icon':_0x5b8dae}),_0x5650a6['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isResultReady','ck-hidden',_0x19f4cc=>_0x19f4cc),this['bindTemplate']['if']('isCompleted','ck-hidden',_0x19c154=>_0x19c154)]}}),_0x5650a6['on']('execute',()=>{this['fire']('abortReviewStream');}),_0x5650a6;}['_createToggleDiffButtonView'](){const _0x3641b9=new vt(this['locale']);_0x3641b9['set']({'tooltip':!0x0,'isToggleable':!0x0,'role':'menuitemcheckbox'}),_0x3641b9['bind']('isEnabled')['to'](this,'isError',_0x58f93a=>!_0x58f93a),_0x3641b9['extendTemplate']({'attributes':{'class':[Ui,'ck-ai_review__check-run-toggle-diff-button',this['bindTemplate']['if']('isResultReady','ck-hidden',_0xe32c58=>!_0xe32c58),this['bindTemplate']['if']('isCompleted','ck-hidden',_0x2430c4=>_0x2430c4)]}});const _0x10a147=Hi(this['locale'],'AI_REVIEW_MODE_HIDE_CHANGES'),_0x234a8b=Hi(this['locale'],'AI_REVIEW_MODE_SHOW_CHANGES');return _0x3641b9['bind']('isOn')['to'](this,'isToggleDiffOn',_0x1ea3e7=>_0x1ea3e7),_0x3641b9['bind']('icon')['to'](this,'isToggleDiffOn',_0x323ffa=>_0x323ffa?st:nt),_0x3641b9['bind']('label')['to'](this,'isToggleDiffOn',_0x43bf92=>_0x43bf92?_0x10a147:_0x234a8b),_0x3641b9['on']('execute',()=>{this['isToggleDiffOn']=!this['isToggleDiffOn'],this['fire']('toggleDiff',{'on':this['isToggleDiffOn']});}),_0x3641b9;}['_createAcceptAllButtonView'](){const _0x5e04bd=new vt(this['locale']);return _0x5e04bd['set']({'label':Hi(this['locale'],'AI_REVIEW_MODE_ACCEPT_ALL'),'withText':!0x0}),_0x5e04bd['bind']('isEnabled')['to'](this,'isError',_0xc23308=>!_0xc23308),_0x5e04bd['extendTemplate']({'attributes':{'class':[Mi,'ck-ai_review__check-run-accept-all-button',this['bindTemplate']['if']('isResultReady','ck-hidden',_0x28b84b=>!_0x28b84b),this['bindTemplate']['if']('isCompleted','ck-hidden',_0x954943=>_0x954943)]}}),_0x5e04bd['on']('execute',()=>{this['fire']('acceptAllChanges');}),_0x5e04bd;}['_createExitReviewButtonView'](){const _0x4b9fea=new vt(this['locale']);return _0x4b9fea['set']({'label':Hi(this['locale'],'AI_REVIEW_MODE_EXIT_REVIEW'),'withText':!0x0}),_0x4b9fea['extendTemplate']({'attributes':{'class':[Bi,'ck-ai_review__check-run-exit-button',this['bindTemplate']['if']('isResultReady','ck-hidden',_0xb7ec81=>!_0xb7ec81),this['bindTemplate']['if']('isCompleted','ck-hidden',_0x4d93ce=>_0x4d93ce)]}}),_0x4b9fea['on']('execute',()=>{this['fire']('leaveReviewCoreResultList');}),_0x4b9fea;}['_createResultHeaderView'](){const _0x3aa3af=new Nt(this['locale']),_0xa50a56=this['_createTitleView']();return _0x3aa3af['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-run-results-header',this['bindTemplate']['if']('isCompleted','ck-ai_review__review-completed-header',_0x1ff26d=>_0x1ff26d)]},'children':[_0xa50a56,{'tag':'div','attributes':{'class':['ck-ai_review__check-run-results-header-buttons']},'children':[this['_cancelButtonView'],this['_acceptAllButtonView'],this['_exitReviewButtonView'],this['_toggleDiffButtonView'],this['_finishReviewButtonView']]}]}),_0x3aa3af;}['_createTitleView'](){const _0x24e432=new Nt(this['locale']),_0x982fbb=new AISpinnerView();return _0x982fbb['bind']('isVisible')['to'](this,'isResultReady',_0x10212d=>!_0x10212d),_0x24e432['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-run-results-header-title-wrapper']},'children':[_0x982fbb,{'tag':'div','attributes':{'class':['ck-ai_review__check-run-results-header-title-content',this['bindTemplate']['if']('isCompleted','ck-hidden',_0x24a879=>_0x24a879)]},'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',_0x483945=>!_0x483945)]},'children':[{'text':Hi(this['locale'],'AI_REVIEW_MODE_FINISH_REVIEW_HEADER_TITLE')}]}]}),_0x24e432;}['_createFinishReviewButtonView'](){const _0x33ce49=new AIReviewCoreFinishReviewButtonView(Hi(this['locale'],'AI_REVIEW_MODE_FINISH_REVIEW_BUTTON_LABEL'),this['locale']);return _0x33ce49['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isCompleted','ck-hidden',_0x3552a9=>!_0x3552a9)]}}),_0x33ce49['delegate']('finishReview')['to'](this),_0x33ce49;}}class AIReviewCoreReviewCompletedView extends Pt{['_resultsHeader'];['_finishReviewButtonView'];constructor(_0x394093,_0x45c2b4){super(_0x394093),this['_finishReviewButtonView']=this['_createFinishReviewButtonView'](_0x45c2b4['buttonText']),this['_resultsHeader']=this['_createResultHeaderView'](_0x45c2b4['headerText']);const _0x5860b2=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__review-completed',_0x5860b2['if']('isVisible','ck-hidden',_0x413baf=>!_0x413baf)]},'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':_0x45c2b4['emptyResultsText']}]}]}]});}['_createFinishReviewButtonView'](_0x2dde19){const _0xde00a7=new AIReviewCoreFinishReviewButtonView(_0x2dde19,this['locale']);return _0xde00a7['delegate']('finishReview')['to'](this),_0xde00a7;}['_createResultHeaderView'](_0x3c07f8){const _0x44a046=new Nt(this['locale']);return _0x44a046['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':_0x3c07f8}]},{'tag':'div','attributes':{'class':['ck-ai_review__review-completed-header-buttons']},'children':[this['_finishReviewButtonView']]}]}),_0x44a046;}}class AIReviewCoreFormDropdownView extends Nt{['_dropdownView'];['_defaultValue'];['_defaultLabel'];constructor(_0x4c6344,_0x29a37e){super(_0x4c6344),this['_defaultValue']=_0x29a37e['default']||(_0x29a37e['data']['length']>0x0?_0x29a37e['data'][0x0]['id']:''),this['_defaultLabel']=_0x29a37e['data']['find'](_0x24f290=>_0x24f290['id']===this['_defaultValue'])?.['label']||'',this['set']('formValue',''),this['_dropdownView']=Gt(this['locale']);const _0x384c81=this['_prepareListOptions'](_0x29a37e['data']);jt(this['_dropdownView'],_0x384c81,{'role':'menu','ariaLabel':_0x29a37e['label']}),this['_dropdownView']['buttonView']['set']({'label':this['_defaultLabel'],'withText':!0x0}),this['_dropdownView']['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x3e4da5=>{_0x3e4da5['stopPropagation']();})}}),this['listenTo'](this['_dropdownView'],'execute',_0x53fd85=>{this['formValue']=_0x53fd85['source']['model']['id'],this['_dropdownView']['buttonView']['label']=_0x53fd85['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'](_0x13acce=[]){const _0x1dc095=new dt();this['resetToDefault']();for(const _0x3b252f of _0x13acce){const _0x1ae202=new Jt({'label':_0x3b252f['label'],'withText':!0x0,'role':'menuitemradio','id':_0x3b252f['id'],'model':_0x3b252f});_0x1ae202['bind']('isOn')['to'](this,'formValue',_0x11e6cb=>_0x11e6cb===_0x1ae202['id']);const _0x7cd686={'type':'button','model':_0x1ae202};_0x1dc095['add'](_0x7cd686);}return _0x1dc095;}}class AIReviewCoreFormManagerView extends Pt{['_formItem']=null;constructor(_0x4c0b80,_0x433ea5,_0x3f562a){super(_0x4c0b80),this['argsKey']=_0x433ea5?.['argsKey'];if('dropdown'===_0x433ea5['formType'])this['_formItem']=new AIReviewCoreFormDropdownView(this['locale'],_0x433ea5);this['set']('value',''),this['bind']('value')['to'](this['_formItem'],'formValue');const _0x7cf359=new _0x4252c0(this['locale'],{'children':[this['_formItem']],'class':[_0x3f562a?'ck-form__row_with-submit':'']});_0x3f562a&&_0x7cf359['children']['add'](_0x3f562a),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai_review__form-item','ck-reset_all']},'children':[_0x7cf359]});}['resetToDefault'](){this['_formItem']['resetToDefault']();}}class AIReviewCorePromptInputView extends _0x25a6ab{['keystrokes'];static ['MIN_ROWS']=0x1;static ['MAX_ROWS']=0xc;constructor(_0x294e4d){super(_0x294e4d),this['set']('isEmpty',!0x0),this['keystrokes']=new It(),this['minRows']=AIReviewCorePromptInputView['MIN_ROWS'],this['maxRows']=AIReviewCorePromptInputView['MAX_ROWS'],this['extendTemplate']({'attributes':{'id':'ai-review-prompt-input','class':['ck','ck-review__prompt-input']}});}['render'](){super['render'](),this['on']('update',()=>{this['isEmpty']=''===this['element']['value']?.['trim']();}),this['keystrokes']['listenTo'](this['element']);}}class AIReviewCoreCustomCheckView extends Nt{['focusTracker']=new _t();['keystrokes']=new It();['focusCycler'];['_focusables']=new _0x83e50c();['submitButtonView'];['cancelButtonView'];['promptInputView'];['actionsFooterView'];['_modelSelectionDropdown'];['_modelNameView'];['_modelSelectionDropdownItems'];['_check'];['_defaultValue'];['_defaultLabel'];constructor(_0x246ca7,_0x2736e7,_0x4c89a0=!0x1){super(_0x246ca7),this['_check']=_0x2736e7,this['set']('prompt',''),this['set']('modelId',''),this['set']('modelDisplayMode','selector'),this['set']('activeModelName',null),this['_defaultValue']=_0x2736e7['defaultModel']?_0x2736e7['defaultModel']['id']:'',this['_defaultLabel']=_0x2736e7['defaultModel']?_0x2736e7['defaultModel']['name']:'',this['submitButtonView']=this['_createSubmitButtonView'](),this['cancelButtonView']=this['_createCancelButtonView'](),(this['promptInputView']=new te(this['locale'],()=>new AIReviewCorePromptInputView(_0x246ca7)),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'](_0x4c89a0),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 _0x4252c0(this['locale'],{'children':[this['promptInputView']]}),new _0x4252c0(this['locale'],{'children':[this['actionsFooterView']]})]}),this['promptInputView']['fieldView']['keystrokes']['set']('Enter',(_0x16816c,_0x431afe)=>{this['_isValid']()?(this['fire']('runReviewCheck',{'id':'custom','args':{'prompt':this['prompt'],'model':this['modelId']},'isCustom':!0x0}),_0x431afe()):_0x431afe();}),this['focusCycler']=new Mt({'focusables':this['_focusables'],'focusTracker':this['focusTracker'],'keystrokeHandler':this['keystrokes'],'actions':{'focusPrevious':'shift\x20+\x20tab','focusNext':'tab'}}));}['render'](){super['render'](),([this['promptInputView'],this['_modelSelectionDropdown'],this['cancelButtonView'],this['submitButtonView']]['forEach'](_0x22f405=>{this['_focusables']['add'](_0x22f405),this['focusTracker']['add'](_0x22f405['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 _0x5a0796 of this['_getFormValidators']()){const _0x46e5df=_0x5a0796();if(_0x46e5df)return this['promptInputView']['errorText']=_0x46e5df,!0x1;}return!0x0;}['_getFormValidators'](){return[()=>{if(0x0===this['promptInputView']['fieldView']['value']?.['trim']()['length'])return Hi(this['locale'],'AI_REVIEW_MODE_PROMPT_EMPTY_ERROR');}];}['_createSubmitButtonView'](){const _0x32ff7e=new vt(this['locale']),t=this['locale']['t'];return _0x32ff7e['set']({'label':t('Submit'),'withText':!0x0,'class':Mi}),_0x32ff7e['on']('execute',()=>{this['_isValid']()&&this['fire']('runReviewCheck',{'id':'custom','args':{'prompt':this['prompt'],'model':this['modelId']},'isCustom':!0x0});}),_0x32ff7e;}['_createCancelButtonView'](){const _0x343ea9=new vt(this['locale']),t=this['locale']['t'];return _0x343ea9['set']({'label':t('Cancel'),'withText':!0x0,'class':Bi}),_0x343ea9['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x1381a1=>{_0x1381a1['stopPropagation']();})}}),_0x343ea9['on']('execute',()=>{this['resetToDefault'](),this['fire']('closeCustomCheck');}),_0x343ea9;}['_setModelList'](_0x2181fd){this['_modelSelectionDropdownItems']['clear']();const _0x213835=this['_check']['models'];if(_0x2181fd)this['set']('modelDisplayMode','hidden');else{const _0x4318e4=0x1===_0x213835['length'];this['set']('modelDisplayMode',_0x4318e4?'name':'selector');}if(this['resetToDefault'](),_0x213835?.['length']){0x1===_0x213835['length']&&this['set']('activeModelName',_0x213835[0x0]['name']||_0x213835[0x0]['id']);for(const _0x42929c of _0x213835){const _0x53ef53=new Jt({'label':_0x42929c['name'],'withText':!0x0,'role':'menuitemradio','id':_0x42929c['id'],'model':_0x42929c});_0x53ef53['bind']('isOn')['to'](this,'modelId',_0x31fc86=>_0x31fc86===_0x42929c['id']),this['_modelSelectionDropdownItems']['add']({'type':'button','model':_0x53ef53,'labelView':new ModelButtonLabelView(this['locale'],_0x42929c)});}}}['_createModelSelectionDropdown'](){const _0x596ed0=Gt(this['locale']);return _0x596ed0['set']({'panelPosition':'se','class':'ck-ai_review__check-list-item-model-dropdown'}),_0x596ed0['buttonView']['set']({'label':this['_defaultLabel'],'withText':!0x0,'tooltip':!0x0,'class':Bi}),_0x596ed0['buttonView']['bind']('isVisible')['to'](this,'modelDisplayMode',_0x554078=>'selector'===_0x554078),this['listenTo'](_0x596ed0,'execute',_0x7efae0=>{this['modelId']=_0x7efae0['source']['model']['id'],_0x596ed0['buttonView']['label']=_0x7efae0['source']['label'];}),_0x596ed0;}['_createModelNameView'](){const _0x173a14=new ModelNameView(this['locale']);return _0x173a14['bind']('text')['to'](this,'activeModelName',_0x258d0a=>_0x258d0a??''),_0x173a14['bind']('isVisible')['to'](this,'modelDisplayMode',_0x31ba07=>'name'===_0x31ba07),_0x173a14;}['_createActionsFooterView'](){const _0x373f1a=new Nt(this['locale']);return _0x373f1a['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']]}]}),_0x373f1a;}}class ModelNameView extends Nt{constructor(_0x4a20eb){super(_0x4a20eb),this['set']('text',void 0x0),this['set']('isVisible',!0x0);const _0x49be09=this['bindTemplate'];this['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai_review__check-list-item-model-name',_0x49be09['if']('isVisible','ck-hidden',_0x466c40=>!_0x466c40)]},'children':[{'text':_0x49be09['to']('text')}]});}}class ModelButtonLabelView extends Ht{constructor(_0x4c80f8,_0xd11119){super();const _0x1a10f5=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-button__label'],'style':_0x1a10f5['to']('style'),'id':_0x1a10f5['to']('id')},'children':[{'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-model-dropdown-name']},'children':[{'tag':'span','children':[{'text':_0x1a10f5['to']('text')}]}]},{'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-model-dropdown-description']},'children':[{'tag':'span','children':[_0xd11119['description']||'']}]}]});}}class AIReviewCoreReviewCommandListItemView extends Pt{['_formItemsCollection']=new _0x83e50c();['_customCheckView']=null;['_hideModels']=!0x1;constructor(_0x1def4d,_0x32d78c,_0x1d224d,_0x13177d=!0x1){super(_0x1def4d),this['_hideModels']=_0x13177d,this['set']('isParametrizedViewOpen',!0x1),this['set']('isListItemRendered',!0x1),this['set']('isItemParametrized',_0x32d78c['isParameterized']);const _0x52847f=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',_0x33f20c=>_0x33f20c),this['bindTemplate']['if']('isListItemRendered','ck-ai_review__check-list-item_rendered',_0x40cd26=>_0x40cd26)],'style':{'--ck-ai-review-check-list-item-index':_0x1d224d}},'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':_0x32d78c['title']}]},_0x52847f]},{'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-description']},'children':_0x32d78c['description']?[{'text':_0x32d78c['description']}]:[]}]}]},..._0x32d78c['isParameterized']?[this['_createParameterizedView'](_0x32d78c)]:[],...'custom'===_0x32d78c['id']?[this['_createCustomView'](_0x32d78c,this['_hideModels'])]:[]]}),this['on']('click',()=>{_0x32d78c['isParameterized']?this['isParametrizedViewOpen']=!0x0:this['fire']('runReviewCheck',{'id':_0x32d78c['id'],'args':_0x32d78c['useArgs']?_0x32d78c['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'](_0x846aaf=>{_0x846aaf['resetToDefault']();}),this['_customCheckView']&&this['_customCheckView']['resetToDefault']();}['_createIconView'](){const _0x5c7895=new xt();return _0x5c7895['content']=rt,_0x5c7895['extendTemplate']({'attributes':{'class':['ck-ai_review__check-list-item-title-icon']}}),_0x5c7895;}['_createParameterizedView'](_0x5b2903){const _0x54c079=new Nt(),_0x4d68cc=this['_createFormView'](_0x5b2903);return _0x54c079['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-parameterized',this['bindTemplate']['if']('isParametrizedViewOpen','ck-hidden',_0x40e90d=>!_0x40e90d)]},'children':[_0x4d68cc]}),_0x54c079;}['_createFormView'](_0x24bdef){const _0x5d412d=new Nt(),_0x243956=Array['isArray'](_0x24bdef['options'])?_0x24bdef['options']:[],_0x2d31fc=new vt(this['locale']),t=this['locale']['t'];_0x2d31fc['set']({'label':t('Submit'),'withText':!0x0,'class':Mi}),_0x2d31fc['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x2c7e78=>{_0x2c7e78['stopPropagation']();})}}),_0x2d31fc['on']('execute',()=>{const _0x54c8f5=[],_0xd59526={};this['_formItemsCollection']['forEach'](_0x2679df=>{_0x54c8f5['push'](_0x2679df['value']),_0x24bdef['useArgs']&&_0x24bdef['options']&&(_0xd59526[_0x2679df['argsKey']]=_0x2679df['value']);}),this['fire']('runReviewCheck',{'id':_0x24bdef['id'],'params':_0x54c8f5['length']?_0x54c8f5:void 0x0,'args':Object['keys'](_0xd59526)['length']?_0xd59526:void 0x0});});const _0x2dd043=_0x243956['length'];return _0x243956['forEach']((_0x57b2b4,_0x208b59)=>{const _0x143ea4=_0x208b59===_0x2dd043-0x1;this['_formItemsCollection']['add'](new AIReviewCoreFormManagerView(this['locale'],_0x57b2b4,_0x143ea4?_0x2d31fc:null));}),_0x5d412d['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-parameterized-form']},'children':this['_formItemsCollection']}),_0x5d412d;}['_createCustomView'](_0x4cae27,_0x21b796=!0x1){return this['_customCheckView']=new AIReviewCoreCustomCheckView(this['locale'],_0x4cae27,_0x21b796),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',_0x438ba9=>!_0x438ba9)]}}),this['_customCheckView']['delegate']('runReviewCheck')['to'](this),this['listenTo'](this['_customCheckView'],'closeCustomCheck',()=>{this['isParametrizedViewOpen']=!0x1;}),this['on']('change:isParametrizedViewOpen',(_0x4741ac,_0xe44518,_0x31409e)=>{_0x31409e||this['_customCheckView']['resetFormValidationStatus']();}),this['_customCheckView'];}}class AIReviewCoreReviewCheckListView extends Pt{['_checkViews'];constructor(_0x3d56a4){super(_0x3d56a4),this['_checkViews']=new _0x83e50c(),this['_setupTemplate']();}['setChecks'](_0x43e9fd,_0x287fab=!0x1){this['_checkViews']['clear']();for(const [_0x31cc73,_0x2ef863]of _0x43e9fd['entries']()){const _0x52513d=new AIReviewCoreReviewCommandListItemView(this['locale'],_0x2ef863,_0x31cc73,_0x287fab);_0x52513d['delegate']('runReviewCheck')['to'](this),this['_checkViews']['add'](_0x52513d);}}['hasChecks'](){return this['_checkViews']['length']>0x0;}['resetAllParameterizedChecks'](){for(const _0x3f2c1e of this['_checkViews'])_0x3f2c1e instanceof AIReviewCoreReviewCommandListItemView&&_0x3f2c1e['resetToDefault']();}['_setupTemplate'](){const _0x1e45a4=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-list',_0x1e45a4['if']('isVisible','ck-hidden',_0x3dbc73=>!_0x3dbc73)]},'children':this['_checkViews']});}}class AIReviewModeUI extends AIReviewCoreUI{static get['pluginName'](){return'AIReviewModeUI';}['createMainView'](){const _0x574afe=this['context']['plugins']['get']('AITabs'),_0x1958c3=this['context']['locale'],_0x307959=new AIHeaderView(_0x1958c3,{'label':Hi(_0x1958c3,'AI_REVIEW_MODE'),'icon':_0x76da7e,'class':'ck-ai-header_review','showResizeButton':_0x574afe['showResizeButton']});return _0x307959['delegate']('resizeTabs')['to'](_0x574afe),_0x307959['bind']('isMaximized')['to'](_0x574afe['view'],'isMaximized',_0xf619e2=>_0xf619e2),new AIReviewCoreView(this['context']['locale'],{'header':_0x307959,'list':new AIReviewCoreReviewCheckListView(_0x1958c3),'results':new AIReviewCoreUICheckResultsView(_0x1958c3,{'generalErrorText':Hi(_0x1958c3,'AI_REVIEW_MODE_GENERAL_ERROR_MESSAGE')}),'completed':new AIReviewCoreReviewCompletedView(_0x1958c3,{'headerText':Hi(_0x1958c3,'AI_REVIEW_MODE_FINISH_REVIEW_HEADER_TITLE'),'emptyResultsText':Hi(_0x1958c3,'AI_REVIEW_MODE_EMPTY_RESULTS_TEXT'),'buttonText':Hi(_0x1958c3,'AI_REVIEW_MODE_FINISH_REVIEW_BUTTON_LABEL')})});}['registerTab'](){const _0x30dfcc=this['context']['plugins']['get']('AITabs');_0x30dfcc['view']['on']('activateTab',(_0x4c0170,{newTab:_0x18b033,oldTab:_0x19177e})=>{'reviewMode'===_0x18b033?this['fire']('getReviewCheckList'):'reviewMode'===_0x19177e&&this['fire']('leaveReview');}),_0x30dfcc['view']['addTab']({'id':'reviewMode','buttonLabel':Hi(this['context']['locale'],'AI_REVIEW_MODE'),'buttonIcon':_0x76da7e,'order':0x0,'content':this['_mainView']});}}const Kn='review-',Wn=['softBreak'];class AIReviewCoreEditing extends _0x530a64{static get['requires'](){return[_0x4f763b,AIEditing];}static get['pluginName'](){return'AIReviewCoreEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['_markers']=new Map();['_activeMarkers']=new Set();['_domEmitter'];['_eventEmitter'];['_reviewEditingAttachedEditors']=new WeakSet();['_boundEditables']=new WeakMap();constructor(_0x22760c){super(_0x22760c),this['_domEmitter']=new(Ot())(),this['_eventEmitter']=new(Et())();}get['emitter'](){return this['_eventEmitter'];}['afterInit'](){const _0x2e1182=_0x573620=>this['_scheduleAttachReviewEditingToEditor'](_0x573620);if(this['_registerGlobalBalloonBlurHandler'](),this['context']instanceof _0x581096)return void _0x2e1182(this['context']);const _0x56b301=this['context'];for(const _0x446d04 of _0x56b301['editors'])_0x2e1182(_0x446d04);this['listenTo'](_0x56b301['editors'],'add',(_0xd44e3b,_0x36be6b)=>{_0x2e1182(_0x36be6b);}),this['listenTo'](_0x56b301['editors'],'remove',(_0xdb8072,_0x4429f4)=>{for(const [_0x388342,_0x58de7f]of this['_markers'])_0x58de7f['editor']===_0x4429f4&&(this['_eventEmitter']['fire']('changeMarkerRemoved',{'markerId':_0x388342,'changeId':_0x58de7f['groupId']}),this['_markers']['delete'](_0x388342));});}['_scheduleAttachReviewEditingToEditor'](_0x49a12c){const _0x55854e=()=>{'destroyed'!==_0x49a12c['state']&&_0x49a12c['conversion']&&this['_attachReviewEditingToEditor'](_0x49a12c);};if('ready'===_0x49a12c['state'])return void _0x55854e();const _0x17ea99=()=>{this['stopListening'](_0x49a12c,'ready',_0x17ea99),_0x55854e();};this['listenTo'](_0x49a12c,'ready',_0x17ea99);}['_attachReviewEditingToEditor'](_0x5c8d38){this['_reviewEditingAttachedEditors']['has'](_0x5c8d38)||(_0x5c8d38['conversion']['for']('editingDowncast')['markerToElement']({'model':Kn+'insert','view':(_0x2ff7d9,{writer:_0x60908f})=>{const _0x47ed58=this['_markers']['get'](_0x2ff7d9['markerName']),_0x530f38={'class':'ck-ai_review-marker_add'+(this['_activeMarkers']['has'](_0x47ed58?.['id']||'')?'\x20ck-ai_review__change_active':''),'data-marker-id':_0x2ff7d9['markerName']};return _0x60908f['createUIElement']('span',_0x530f38,function(_0x59184f){const _0x2ce0ed=this['toDomElement'](_0x59184f);return _0x2ce0ed['innerHTML']=_0x47ed58?.['content']?.['asString']||'',_0x2ce0ed;});}}),_0x5c8d38['conversion']['for']('editingDowncast')['markerToHighlight']({'model':Kn+'remove-only','view':_0x397484=>{const _0x2d5fb1=this['_markers']['get'](_0x397484['markerName']),_0x4b35b9=['ck-ai_review-marker_strikethrough'];return this['_activeMarkers']['has'](_0x2d5fb1?.['id']||'')&&_0x4b35b9['push']('ck-ai_review__change_active'),{'classes':_0x4b35b9,'attributes':{'data-marker-id':_0x397484['markerName']}};}}),_0x5c8d38['conversion']['for']('editingDowncast')['markerToHighlight']({'model':Kn+'remove-context','view':_0x1cac91=>{const _0x28deb1=this['_markers']['get'](_0x1cac91['markerName']),_0x19c734=['ck-ai_review-marker_underline'];return this['_activeMarkers']['has'](_0x28deb1?.['id']||'')&&_0x19c734['push']('ck-ai_review__change_active'),{'classes':_0x19c734,'attributes':{'data-marker-id':_0x1cac91['markerName']}};}}),_0x5c8d38['conversion']['for']('editingDowncast')['markerToHighlight']({'model':Kn+'remove-text','view':_0x365fb8=>{const _0x2b1d44=this['_markers']['get'](_0x365fb8['markerName']),_0x409a97=['ck-ai_review-marker_hide'];return this['_activeMarkers']['has'](_0x2b1d44?.['id']||'')&&_0x409a97['push']('ck-ai_review__change_active'),{'classes':_0x409a97,'attributes':{'data-marker-id':_0x365fb8['markerName']}};}}),_0x5c8d38['conversion']['for']('dataDowncast')['markerToElement']({'model':Kn+'suggestion-context','view':(_0x2df350,{writer:_0x561f98})=>_0x561f98['createRawElement']('span',{'class':'ck-ai_review-marker_context-'+(_0x2df350['isOpening']?'start':'end')})}),_0x5c8d38['conversion']['for']('downcast')['attributeToAttribute']({'model':_0x4ab9e3,'view':_0x3c1969}),this['_updateMouseMarkerInteractionListeners'](_0x5c8d38),this['listenTo'](_0x5c8d38,'addRoot',()=>this['_updateMouseMarkerInteractionListeners'](_0x5c8d38),{'priority':'lowest'}),this['listenTo'](_0x5c8d38,'detachRoot',()=>this['_updateMouseMarkerInteractionListeners'](_0x5c8d38),{'priority':'lowest'}),_0x5c8d38['model']['document']['registerPostFixer'](_0x4805cf=>this['_validateMarkers'](_0x5c8d38,_0x4805cf)),_0x5c8d38['model']['document']['on']('change',()=>this['_handleMarkerChanges'](_0x5c8d38)),this['_reviewEditingAttachedEditors']['add'](_0x5c8d38));}['_updateMouseMarkerInteractionListeners'](_0x2cdf78){let _0x5a53b9=this['_boundEditables']['get'](_0x2cdf78);_0x5a53b9||(_0x5a53b9=new Map(),this['_boundEditables']['set'](_0x2cdf78,_0x5a53b9));const _0x3279ad=new Set(_0x2cdf78['ui']['getEditableElementsNames']());for(const _0x1ccbb0 of _0x3279ad){if(_0x5a53b9['has'](_0x1ccbb0))continue;const _0x49ab20=_0x2cdf78['ui']['getEditableElement'](_0x1ccbb0);_0x5a53b9['set'](_0x1ccbb0,_0x49ab20),this['_attachMouseMarkerInteractionListeners'](_0x49ab20);}for(const [_0x21bdd3,_0x599048]of _0x5a53b9)_0x3279ad['has'](_0x21bdd3)||(_0x5a53b9['delete'](_0x21bdd3),this['_domEmitter']['stopListening'](_0x599048));}['_attachMouseMarkerInteractionListeners'](_0x374309){this['_domEmitter']['listenTo'](_0x374309,'mouseup',(_0x266a77,_0x433de1)=>{const _0xcf5e4c=_0x433de1['target'],_0x438c65=this['_findMarkerElement'](_0xcf5e4c);if(!_0x438c65)return;const _0x212031=_0x438c65['getAttribute']('data-marker-id'),_0x1191d8=_0x212031['split'](':')['pop']()?.['split']('_')[0x0];this['_eventEmitter']['fire']('changeMarkerClicked',{'markerId':_0x212031,'changeId':_0x1191d8,'markerElement':()=>this['_findMarkerElementById'](_0x212031),'domEvent':_0x433de1});},{'usePassive':!0x0,'priority':'highest'}),this['_domEmitter']['listenTo'](_0x374309,'mouseover',(_0x64c944,_0x3fb8ce)=>{const _0x4a9fe7=_0x3fb8ce['target'],_0xcab9b7=_0x3fb8ce['relatedTarget'];let _0x446ab0=this['_findMarkerElement'](_0x4a9fe7);if(!_0x446ab0&&_0xcab9b7&&(_0x446ab0=this['_findMarkerElement'](_0xcab9b7)),!_0x446ab0)return;const _0x3b3b6b=_0x446ab0['getAttribute']('data-marker-id'),_0x49bafb=_0x3b3b6b['split'](':')['pop']()?.['split']('_')[0x0];this['_eventEmitter']['fire']('changeMarkerHovered',{'changeId':_0x49bafb,'markerElement':()=>this['_findMarkerElementById'](_0x3b3b6b),'domEvent':_0x3fb8ce});});}['_registerGlobalBalloonBlurHandler'](){this['_domEmitter']['listenTo'](document,'mouseover',_0x148416((_0x55e80b,_0x2c6fc0)=>{const _0x10a920=_0x2c6fc0['target'];if(this['_findMarkerElement'](_0x10a920))return;_0x10a920['closest']('.ck-reset.ck-ai_review-balloon-panel-suggestion')||this['_eventEmitter']['fire']('changeMarkerBlurred');},0xc8));}['getDocumentData'](){const _0x1451fa=this['context']['plugins']['get']('AIEditing'),_0x2fb52c=ls(this['context']);if(!_0x2fb52c['length'])throw new at('ai-get-editor-from-context-no-editor',this);const _0x3665b2=new Set(),_0x21c448=[],_0x693c73=new Map();for(const _0x6c98c8 of _0x2fb52c)for(const _0x23f76c of _0x6c98c8['model']['document']['getRoots']()){if('$graveyard'===_0x23f76c['rootName'])continue;const _0x1a2340=this['_buildDocumentDataSliceForRoot'](_0x6c98c8,_0x23f76c,_0x1451fa,_0x3665b2);_0x21c448['push'](_0x1a2340['content']);for(const [_0x36638e,_0x2c20d5]of _0x1a2340['elements'])_0x693c73['set'](_0x36638e,_0x2c20d5);}return{'elements':_0x693c73,'content':_0x21c448['join']('')};}['_buildDocumentDataSliceForRoot'](_0xf2b4bc,_0x5a2241,_0x462022,_0x2085d2){const _0x422238=_0xf2b4bc['model'],_0xddced6=new _0x17ef1e();for(const _0x11a4bc of _0x5a2241['getChildren']())_0xddced6['_appendChild'](_0x11a4bc['_clone'](!0x0));for(const _0xc53e84 of _0x422238['markers']){const _0x54944c=_0xc53e84['getRange']();_0x54944c&&_0x54944c['root']['rootName']===_0x5a2241['rootName']&&_0xddced6['markers']['set'](_0xc53e84['name'],this['_changeRangeOwnerDocument'](_0x54944c['clone'](),_0xddced6));}const _0xdf82c9=new Map(),_0x51c979=_0x422238['document']['version'],_0x15c245=new _0x20d2f3({'ignoreElementEnd':!0x0,'startPosition':_0x422238['createPositionAt'](_0xddced6,0x0)});for(const {item:_0x513d8a}of _0x15c245){if(!_0x513d8a['is']('$textProxy'))continue;const _0x38e6a8=_0x513d8a['parent'];if(!_0x38e6a8||!_0x38e6a8['is']('element'))continue;const _0x40607a=this['_upsertDataId'](_0x38e6a8,()=>_0x462022['_nextDataId'](_0x2085d2));_0x2085d2['add'](_0x40607a);for(const _0x132ce2 of _0x38e6a8['getChildren']())_0x132ce2['is']('element')&&(_0x132ce2['name']&&Wn['includes'](_0x132ce2['name'])||_0x2085d2['add'](this['_upsertDataId'](_0x132ce2,()=>_0x462022['_nextDataId'](_0x2085d2))));let _0x52685c=_0x38e6a8;for(;_0x52685c['parent']&&!_0x52685c['parent']['is']('documentFragment');)_0x52685c=_0x52685c['parent'],_0x52685c['hasAttribute'](_0x4ab9e3)&&_0x52685c['_removeAttribute'](_0x4ab9e3);_0xdf82c9['set'](_0x40607a,{'editor':_0xf2b4bc,'rootName':_0x5a2241['rootName'],'path':_0x38e6a8['getPath'](),'documentVersion':_0x51c979,'getContent':this['_createGetContentUsingDataIdFn'](_0x52685c['_clone'](!0x0),_0x40607a,_0xf2b4bc['data'])}),_0x15c245['jumpTo'](_0x422238['createPositionAfter'](_0x38e6a8));}return{'content':_0xf2b4bc['data']['processor']['toData'](_0xf2b4bc['data']['toView'](_0xddced6)),'elements':_0xdf82c9};}['diffContent'](_0x37678d,_0x5effba,_0x36fa9c,_0x26c4c7=!0x1){const _0xe8a640=[],_0x23414f=_0x37678d['data']['parse'](_0x36fa9c,'$documentFragment'),_0x83fe1c=_0x37678d['data']['parse'](_0x5effba,'$documentFragment'),_0x243056=_0x37678d['model']['createPositionAt'](_0x83fe1c,0x0);if(this['_haveSingleTopLevelElement'](_0x23414f)){if(!this['_hasSameTopLevelElement'](_0x83fe1c,_0x23414f))return _0xe8a640;}else{const _0x5cc568=_0x37678d['model']['schema'];if(!this['_haveOnlyInlineContent'](_0x83fe1c,_0x5cc568)||!this['_haveOnlyInlineContent'](_0x23414f,_0x5cc568))return _0xe8a640;}const _0x58622a=this['context']['plugins']['get']('DocumentCompare')['getDiff'](_0x5effba,_0x36fa9c,{'targetEditor':_0x37678d,'anchor':_0x243056,'markDeletions':!0x0})['getOperations']()['filter'](_0x51646c=>'insert'===_0x51646c['type']||'marker'===_0x51646c['type']&&_0x51646c['name']['startsWith']('$markedRemove')),_0x2c028=this['_groupAdjacentOperations'](_0x58622a),_0x32ec70=[];if(_0x26c4c7){if(_0x2c028['length']){const _0x56dc47=_0x2c028[0x0]['operations'][0x0],_0x488bc1='insert'===_0x56dc47['type']?_0x56dc47['position']:_0x56dc47['newRange']['start'],_0x49d34c=this['_getPositionLimitingRange'](_0x488bc1,_0x37678d,'inside'),_0x1091a2=_0x49d34c?_0x23414f['getChild'](0x0)['getChildren']():_0x23414f['getChildren'](),_0x1be391=_0x49d34c||_0x37678d['model']['createRangeIn'](_0x83fe1c),_0x3ffb4e=[new _0x3b21c1('$markedRemove:synthetic'+ot(),null,_0x1be391,_0x37678d['model']['document']['model']['markers'],!0x0,_0x37678d['model']['document']['version']+0x1),new _0x124932(_0x1be391['end'],_0x1091a2,_0x37678d['model']['document']['version']+0x2)];_0x32ec70['push']({'operations':_0x3ffb4e,'operationsIsolated':_0x3ffb4e,'groupOffset':0x0});}}else _0x32ec70['push'](..._0x2c028);let _0x188be2=0x0;return _0x37678d['model']['change'](_0x5eff5e=>{for(let _0x2b70ca=0x0;_0x2b70ca<_0x32ec70['length'];_0x2b70ca++){const _0x595e3c=_0x32ec70[_0x2b70ca],_0x475a4b=_0x5eff5e['createDocumentFragment']();for(const _0x4fef0a of _0x83fe1c['getChildren']())_0x5eff5e['append'](_0x4fef0a['_clone'](!0x0),_0x475a4b);for(const _0xb8f128 of _0x595e3c['operationsIsolated'])if('insert'===_0xb8f128['type']){const _0x5a955e=_0xb8f128;_0x5a955e['baseVersion']=null,_0x5a955e['isDocumentOperation']=!0x1,this['_changeOperationOwnerDocument'](_0x5a955e,_0x475a4b),_0x5eff5e['batch']['addOperation'](_0xb8f128),_0x37678d['model']['applyOperation'](_0xb8f128);const _0x210aac='suggestion:insertion:id:authorId:'+_0x188be2++,_0x2ff916=_0x37678d['model']['createRange'](_0x5a955e['position'],_0x5a955e['position']['getShiftedBy'](_0x5a955e['howMany']));_0x475a4b['markers']['set'](_0x210aac,_0x2ff916);}else{if('marker'===_0xb8f128['type']&&_0xb8f128['name']['startsWith']('$markedRemove')){const _0x3cc9b9=_0xb8f128,_0x26d936='suggestion:deletion:id:authorId:'+_0x188be2++;this['_changeOperationOwnerDocument'](_0x3cc9b9,_0x475a4b),_0x475a4b['markers']['set'](_0x26d936,_0x3cc9b9['newRange']);}}if(_0x26c4c7)_0xe8a640['push']({..._0x595e3c,'context':this['_createGetContentFn'](_0x83fe1c,_0x37678d['data']),'content':this['_createGetContentFn'](_0x83fe1c,_0x37678d['data'])});else{const _0x3a985c=this['_getChangeContext'](this['_changePositionOwnerDocument'](this['_getOperationStart'](_0x595e3c['operationsIsolated'][0x0]),_0x475a4b),this['_changePositionOwnerDocument'](this['_getOperationEnd'](_0x595e3c['operationsIsolated'][_0x595e3c['operationsIsolated']['length']-0x1]),_0x475a4b),_0x37678d);_0x475a4b['markers']['set'](Kn+'suggestion-context',new _0x3070cc(_0x3a985c['start'],_0x3a985c['end'])),_0xe8a640['push']({..._0x595e3c,'context':this['_createGetContextFn'](_0x475a4b,_0x37678d['data'],{'ellipsisBefore':_0x3a985c['hasContentBefore'],'ellipsisAfter':_0x3a985c['hasContentAfter']}),'content':this['_createGetContentFn'](_0x475a4b,_0x37678d['data'])});}}}),_0xe8a640;}['markChangePositionInEditorContent'](_0x3b6b41,_0x5219d0){if(!_0x3b6b41['length'])return;const _0xd7188e=_0x3b6b41[0x0]['parent']['id'],_0x49694f=_0x5219d0['elements']['get'](_0xd7188e);if(!_0x49694f)return void console['warn']('No\x20element\x20found\x20for\x20ID:\x20'+_0xd7188e);const _0x304128=_0x49694f['path'],_0x2adc0d=_0x49694f['editor'],_0x36893b=_0x2adc0d['model']['document']['getRoot'](_0x49694f['rootName']);if(!_0x36893b)return void console['warn']('No\x20model\x20root\x20found\x20for\x20name:\x20'+_0x49694f['rootName']);const _0xbd74d1=_0x2adc0d['model']['document']['history']['getOperations'](_0x49694f['documentVersion']),_0x1cc9a3=[];for(const _0x4fa464 of _0x3b6b41){const _0x44e095=_0x4fa464['operationsIsolated']['map'](_0x18cd96=>this['_translateOperationToEditorContent'](_0x18cd96,_0x304128,_0x36893b));if(!_0x44e095||!_0x44e095['length'])continue;const _0x1f51ce=_0x44e095['every'](_0x55fe76=>'marker'===_0x55fe76['type']&&_0x55fe76['name']['startsWith']('$markedRemove')),_0x3e0798={'document':_0x2adc0d['model']['document'],'useRelations':!0x1,'padWithNoOps':!0x1},_0x45eff0=_0x5afac3(_0x44e095,_0xbd74d1,_0x3e0798)['operationsA'];for(const _0x3f4772 of _0x45eff0)if('insert'===_0x3f4772['type']){const _0x28e5a9=_0x3f4772,_0x5b398b=_0x28e5a9['nodes'];_0x2adc0d['model']['change'](_0x33bfab=>{const _0x3daf4c=_0x33bfab['createDocumentFragment']();for(const _0x2a280e of _0x5b398b)_0x33bfab['append'](_0x2a280e['_clone'](!0x0),_0x3daf4c);_0x1cc9a3['push']({'start':_0x28e5a9['position'],'end':_0x28e5a9['position'],'type':'insert','groupId':_0x4fa464['id'],'content':{'asString':this['_createGetContentFn'](_0x3daf4c,_0x2adc0d['data'])(),'asFragment':_0x3daf4c}});});}else{if('marker'===_0x3f4772['type']&&_0x3f4772['name']['startsWith']('$markedRemove')){const _0x5deb00=_0x3f4772;let _0x142220='remove-text';if(_0x1f51ce){const _0x42a3a3=this['_findAdjacentContextDistance'](_0x5deb00['newRange']['start'],'backward',_0x2adc0d['model']['schema']),_0x441c54=this['_findAdjacentContextDistance'](_0x5deb00['newRange']['end'],'forward',_0x2adc0d['model']['schema']);if(_0x42a3a3||_0x441c54){const _0x4625d7=_0x5deb00['newRange']['start']['getShiftedBy'](-_0x42a3a3),_0x1d9c97=_0x5deb00['newRange']['end']['getShiftedBy'](_0x441c54);_0x1cc9a3['push']({'start':_0x4625d7,'end':_0x1d9c97,'groupId':_0x4fa464['id'],'type':'remove-context'});}else _0x142220='remove-only';}_0x1cc9a3['push']({'start':_0x5deb00['newRange']['start'],'end':_0x5deb00['newRange']['end'],'groupId':_0x4fa464['id'],'type':_0x142220});}}}this['_insertMarkers'](_0x1cc9a3,_0x2adc0d);}['clearAllMarkers'](){const _0x45dcff=new Map();for(const _0x551c74 of this['_markers']['keys']()){const _0x2f5c41=this['_markers']['get'](_0x551c74);_0x2f5c41?.['editor']&&(_0x45dcff['has'](_0x2f5c41['editor'])||_0x45dcff['set'](_0x2f5c41['editor'],[]),_0x45dcff['get'](_0x2f5c41['editor'])['push'](_0x551c74));}for(const [_0x4b7bc6,_0x380a3f]of _0x45dcff)_0x4b7bc6['model']['change'](_0x1a1889=>{for(const _0x370d03 of _0x380a3f)_0x4b7bc6['model']['markers']['get'](_0x370d03)&&_0x1a1889['removeMarker'](_0x370d03);});this['_markers']['clear'](),this['_activeMarkers']['clear']();}['switchToReadOnly'](){for(const _0x22a105 of ls(this['context']))_0x22a105['enableReadOnlyMode']('ai-review');}['switchToEdit'](){for(const _0x5310cf of ls(this['context']))_0x5310cf['disableReadOnlyMode']('ai-review');}['applyChange'](_0x392802){const _0x5047e6=_0x392802['map'](_0x4ce99c=>this['_getMarkersDataForGroup'](_0x4ce99c))['flat'](),_0x5dfa4e=new Map();for(const _0x48c78b of _0x5047e6)_0x5dfa4e['has'](_0x48c78b['editor'])||_0x5dfa4e['set'](_0x48c78b['editor'],[]),_0x5dfa4e['get'](_0x48c78b['editor'])['push'](_0x48c78b);for(const [_0x4f2793,_0xa5f8ac]of _0x5dfa4e){const _0x20e668=_0x4f2793['model'];_0x20e668['change'](_0x31525f=>{for(const _0x1b39b0 of _0xa5f8ac){const _0x5ebee3=_0x4f2793['model']['markers']['get'](_0x1b39b0['id']);if(_0x5ebee3){if('insert'===_0x1b39b0['type']){if(!_0x1b39b0['content'])continue;_0x20e668['insertContent'](_0x1b39b0['content']['asFragment']||null,_0x5ebee3['getRange']()['start']);}else'remove-text'!==_0x1b39b0['type']&&'remove-only'!==_0x1b39b0['type']||_0x20e668['deleteContent'](_0x20e668['createSelection'](_0x5ebee3['getRange']()));_0x31525f['removeMarker'](_0x1b39b0['id']),this['_markers']['delete'](_0x1b39b0['id']);}}});}}['rejectChange'](_0x433fa6){const _0x1b2bbe=this['_getMarkersDataForGroup'](_0x433fa6),_0xefc39b=new Map();for(const _0x497ebf of _0x1b2bbe)_0xefc39b['has'](_0x497ebf['editor'])||_0xefc39b['set'](_0x497ebf['editor'],[]),_0xefc39b['get'](_0x497ebf['editor'])['push'](_0x497ebf);for(const [_0xf10ad0,_0x417419]of _0xefc39b)_0xf10ad0['model']['change'](_0x2507c0=>{for(const _0x3845bc of _0x417419)_0x2507c0['removeMarker'](_0x3845bc['id']),this['_markers']['delete'](_0x3845bc['id']);});}['getEditor'](){return ds(this['context']);}['getEditors'](){return ls(this['context']);}['getEditorForChange'](_0x3fb07d){const _0x45e87f=this['_getMarkersDataForGroup'](_0x3fb07d);return _0x45e87f[0x0]?.['editor'];}['getMarkerElementForChange'](_0x41d64a){const _0x4a43fc=Array['from'](this['_markers']['values']())['filter'](_0x5d542b=>_0x5d542b['groupId']===_0x41d64a);if(!_0x4a43fc['length'])return null;const _0x4fece1=0x1===_0x4a43fc['length']?_0x4a43fc[0x0]:this['_sortMarkers'](_0x4a43fc)[0x0],_0x10ede2=_0x4fece1['editor']['model']['markers']['get'](_0x4fece1['id']);if(!_0x10ede2)return null;return{'modelRange':_0x10ede2['getRange'](),'getElement':()=>this['_findMarkerElementById'](_0x4fece1['id'])};}['getContentElementForChange'](_0x3af3b1){const _0x40521f=Array['from'](this['_markers']['values']())['filter'](_0xbb9331=>_0xbb9331['groupId']===_0x3af3b1);if(!_0x40521f['length'])return null;const _0x5222b7=0x1===_0x40521f['length']?_0x40521f[0x0]:this['_sortMarkers'](_0x40521f)[0x0],_0x11e234=_0x5222b7['editor'],_0x4b7202=_0x11e234['model']['markers']['get'](_0x5222b7['id']);if(!_0x4b7202)return null;const _0x221a42=_0x4b7202['getRange'](),_0x45d1db=_0x11e234['editing']['view']['getDomRoot'](_0x221a42['root']['rootName'])||_0x11e234['editing']['view']['getDomRoot']();if(!_0x45d1db||!_0x221a42)return null;let _0xe3b24=_0x221a42['start']['parent'];for(;_0xe3b24['parent']&&'$root'!==_0xe3b24['parent']['name'];)_0xe3b24=_0xe3b24['parent'];if(!_0xe3b24||!_0xe3b24['name'])return null;const _0x577156=_0x45d1db['querySelector']('[data-marker-id=\x22'+_0x5222b7['id']+'\x22]');if(!_0x577156)return null;let _0x183730=null;_0x11e234['model']['change'](_0x5ac7b3=>{_0x183730=_0x5ac7b3['createDocumentFragment'](),_0x5ac7b3['append'](_0xe3b24['_clone'](!0x0),_0x183730);});const _0x36b8d1=_0x11e234['data']['toView'](_0x183730)['getChild'](0x0);return _0x577156['closest'](_0x36b8d1['name']);}['reactivateMarkers'](_0x4f793e){const _0x20e77f=this['_getMarkersDataForGroup'](_0x4f793e);if(!_0x20e77f['length'])return;const _0x3394ad=Array['from'](this['_activeMarkers'])['sort'](),_0x17f0be=Array['from'](new Set(_0x20e77f['map'](_0xcd02ed=>_0xcd02ed['id'])))['sort']();_0x3394ad['join']('|')!==_0x17f0be['join']('|')&&(this['setAllMarkersAsInactive'](),this['setMarkersInElementAsActive'](_0x4f793e));}['setMarkersInElementAsActive'](_0x437a83){const _0x365334=this['_getMarkersDataForGroup'](_0x437a83);if(!_0x365334['length'])return;const _0xb13577=_0x365334[0x0]['editor'],_0x1e8c2e=new Set(_0x365334['map'](_0xcdeeb9=>_0xcdeeb9['id'])),_0x56b768=Array['from'](_0x1e8c2e['values']())['map'](_0x594a6b=>_0xb13577['model']['markers']['get'](_0x594a6b))['filter'](_0x471da3=>!!_0x471da3);_0x1e8c2e['forEach'](_0x1ca491=>{this['_activeMarkers']['add'](_0x1ca491);}),_0xb13577['model']['change'](()=>{_0x56b768['forEach'](_0x376995=>{_0xb13577['editing']['reconvertMarker'](_0x376995);});});}['setAllMarkersAsInactive'](){const _0x46a3dd=Array['from'](this['_activeMarkers']);if(!_0x46a3dd['length'])return;this['_activeMarkers']['clear']();const _0x34dc23=new Map();for(const _0x90bf06 of _0x46a3dd){const _0x46f510=this['_markers']['get'](_0x90bf06);if(!_0x46f510)continue;const _0x2adce0=_0x46f510['editor'],_0xfc56a2=_0x2adce0['model']['markers']['get'](_0x90bf06);_0xfc56a2&&(_0x34dc23['has'](_0x2adce0)||_0x34dc23['set'](_0x2adce0,[]),_0x34dc23['get'](_0x2adce0)['push'](_0xfc56a2));}for(const [_0x4bbb50,_0x94d204]of _0x34dc23)_0x4bbb50['model']['change'](()=>{_0x94d204['forEach'](_0x2ce4d9=>{_0x4bbb50['editing']['reconvertMarker'](_0x2ce4d9);});});}['_getPositionLimitingRange'](_0x31d5bd,_0x1b1134,_0x1da122='outside'){if(!_0x31d5bd)return null;let _0x43a742=_0x31d5bd['parent'];for(;_0x43a742&&_0x43a742['parent']&&'$root'!==_0x43a742['parent']['name']&&!_0x1b1134['model']['schema']['isLimit'](_0x43a742)&&!_0x1b1134['model']['schema']['isBlock'](_0x43a742);)_0x43a742=_0x43a742['parent'];if(!_0x43a742||!_0x43a742['name']||'$root'===_0x43a742['name'])return null;let _0x158a10=null;return _0x1b1134['model']['change'](_0x1ac2f4=>{_0x158a10='inside'===_0x1da122?_0x1ac2f4['createRangeIn'](_0x43a742):_0x1ac2f4['createRangeOn'](_0x43a742);}),_0x158a10;}['_validateMarkers'](_0x430fa3,_0x4a0af8){const _0x45756f=Array['from'](this['_markers']['keys']()),_0x21e1e3=new Map();for(const _0x52b719 of _0x45756f){const _0x18d631=_0x430fa3['model']['markers']['get'](_0x52b719);if(!_0x18d631)continue;const _0xf5f32=_0x18d631['getStart']()['root']['rootName']+':'+_0x18d631['getStart']()['path'][0x0];_0x21e1e3['has'](_0xf5f32)||_0x21e1e3['set'](_0xf5f32,[]),_0x21e1e3['get'](_0xf5f32)['push'](_0x18d631);}const _0x14c818=new Set();for(const _0x48f17b of _0x430fa3['model']['document']['differ']['getChanges']()){let _0x34f866='',_0x843fa=null;if('insert'===_0x48f17b['type'])_0x843fa=new _0x3070cc(_0x48f17b['position'],_0x48f17b['position']['getShiftedBy'](_0x48f17b['length'])),_0x34f866=_0x48f17b['position']['root']['rootName']+':'+_0x48f17b['position']['path'][0x0];else{if('remove'!==_0x48f17b['type'])continue;_0x843fa=new _0x3070cc(_0x48f17b['position']),_0x34f866=_0x48f17b['position']['root']['rootName']+':'+_0x48f17b['position']['path'][0x0];}const _0x181022=_0x21e1e3['get'](_0x34f866)||[];if(_0x181022['length']){for(const _0x148f4a of _0x181022)if(_0x843fa['root']['rootName']===_0x148f4a['getRange']()['root']['rootName']&&('insert'!==_0x48f17b['type']||!_0x843fa['containsRange'](_0x148f4a['getRange']()))&&(_0x843fa['isIntersecting'](_0x148f4a['getRange']())||_0x843fa['start']['isTouching'](_0x148f4a['getRange']()['end'])||_0x843fa['end']['isTouching'](_0x148f4a['getRange']()['start']))){const _0x1b488e=this['_parseMarkerName'](_0x148f4a['name']);Array['from'](this['_markers']['values']())['filter'](_0x3dd829=>_0x3dd829['groupId']===_0x1b488e['groupId'])['forEach'](_0x5d74f8=>_0x14c818['add'](_0x5d74f8['id']));}}}if(_0x14c818['size']){for(const _0x263a0f of _0x14c818)_0x4a0af8['removeMarker'](_0x263a0f);return!0x0;}return!0x1;}['_handleMarkerChanges'](_0xcf2cc1){for(const {name:_0x2176d1,data:_0x29e33d}of _0xcf2cc1['model']['document']['differ']['getChangedMarkers']()){if(!_0x2176d1['startsWith'](Kn))continue;const _0x12f828=_0x29e33d['oldRange'],_0x3b2978=_0x29e33d['newRange'],_0x46ca4b=_0x12f828&&'$graveyard'===_0x12f828['root']['rootName'],_0x34cc24=_0x3b2978&&'$graveyard'===_0x3b2978['root']['rootName'];if(_0x46ca4b&&_0x34cc24)continue;const _0xf01096=this['_parseMarkerName'](_0x2176d1);this['_markers']['get'](_0x2176d1)&&(_0x34cc24||!_0x3b2978?this['_eventEmitter']['fire']('changeMarkerRemoved',{'markerId':_0x2176d1,'changeId':_0xf01096['groupId']}):_0x46ca4b&&_0x3b2978&&this['_eventEmitter']['fire']('changeMarkerRestored',{'markerId':_0x2176d1,'changeId':_0xf01096['groupId']}));}}['_parseMarkerName'](_0x32138d){const _0x2f56dd=_0x32138d['split'](':'),_0x84cb3e=(_0x2f56dd[0x1]||'')['split']('_');return{'prefix':_0x2f56dd[0x0],'groupId':_0x84cb3e[0x0],'suffix':_0x84cb3e[0x1]};}['_translateOperationToEditorContent'](_0x3549a5,_0x40998b,_0x518062){if('insert'===_0x3549a5['type']){const _0x1b3875=_0x3549a5;return new _0x124932(this['_changePosition'](_0x40998b['concat'](_0x1b3875['position']['offset']),_0x518062),_0x1b3875['nodes'],_0x1b3875['baseVersion']);}if('marker'===_0x3549a5['type']&&_0x3549a5['name']['startsWith']('$markedRemove')){const _0x30bc90=_0x3549a5;return new _0x3b21c1(_0x30bc90['name'],_0x30bc90['oldRange'],this['_changeRange'](_0x30bc90['newRange'],_0x40998b['concat'](_0x30bc90['newRange']['start']['offset']),_0x40998b['concat'](_0x30bc90['newRange']['end']['offset']),_0x518062),_0x30bc90['_markers'],_0x30bc90['affectsData'],_0x30bc90['baseVersion']);}return _0x3549a5;}['_groupAdjacentOperations'](_0x5b0d28){if(!_0x5b0d28['length'])return[];const _0x472590=[];let _0x52826a=0x0,_0x548a4a=0x0,_0x262709=[];for(let _0x1d3766=0x0;_0x1d3766<=_0x5b0d28['length'];_0x1d3766++){const _0x53223f=_0x5b0d28[_0x1d3766],_0x883cf3=_0x5b0d28[_0x1d3766-0x1];!_0x53223f||_0x883cf3&&!this['_getOperationEnd'](_0x883cf3)['isTouching'](this['_getOperationStart'](_0x53223f))?(_0x472590['push']({'operations':_0x262709,'operationsIsolated':_0x262709['map'](_0xac96e3=>this['_shiftOperation'](_0xac96e3['clone'](),-_0x548a4a)),'groupOffset':_0x52826a}),_0x262709=_0x53223f?[_0x53223f]:[],_0x548a4a+=_0x52826a,_0x52826a=0x0):_0x262709['push'](_0x53223f),_0x53223f&&'insert'===_0x53223f['type']&&(_0x52826a+=_0x53223f['howMany']);}return _0x472590;}['_findAdjacentContextDistance'](_0x1b7043,_0x4acb19,_0x48c948,_0x21092a=0x1){const _0x5978b0=new _0x20d2f3({'startPosition':_0x1b7043,'direction':_0x4acb19});let _0x31c2ac=0x0;for(let _0x337b55=0x0;_0x337b55<_0x21092a;_0x337b55++){let _0x393b3c=0x0,_0x4183da=!0x1,_0x21b252='forward'===_0x4acb19?/^\W*\w+/:/\w+\W*$/;for(const {item:_0x5b358c}of _0x5978b0)if(_0x5b358c['is']('$textProxy')){const _0x17059a=_0x21b252['exec'](_0x5b358c['data']);if(_0x17059a&&_0x17059a['length']){if(_0x393b3c+='forward'===_0x4acb19?_0x17059a['index']+_0x17059a[0x0]['length']:_0x5b358c['data']['length']-_0x17059a['index'],_0x17059a[0x0]['length']!==_0x5b358c['data']['length'])break;_0x4183da=!0x0,_0x21b252='forward'===_0x4acb19?/^\w+/:/\w+$/;}else{if(_0x4183da)break;_0x393b3c+=_0x5b358c['offsetSize'];}}else{if(_0x5b358c['is']('element')){_0x48c948['isInline'](_0x5b358c)&&!_0x4183da&&(_0x393b3c+=0x1);break;}}_0x31c2ac+=_0x393b3c,_0x5978b0['jumpTo'](_0x1b7043['getShiftedBy']('forward'===_0x4acb19?_0x31c2ac:-_0x31c2ac));}return _0x31c2ac;}['_getChangeContext'](_0x54ea03,_0x1350dc,_0x39087f){const _0x48f15c=_0x39087f['model']['schema'],_0x12b92e=this['_findAdjacentContextDistance'](_0x54ea03,'backward',_0x48f15c,0x6),_0xf4a8b2=this['_findAdjacentContextDistance'](_0x1350dc,'forward',_0x48f15c,0x6),_0x423463=_0x54ea03['getShiftedBy'](-_0x12b92e),_0x4d617f=_0x1350dc['getShiftedBy'](_0xf4a8b2);return{'start':_0x423463,'end':_0x4d617f,'hasContentBefore':!_0x423463['isAtStart'],'hasContentAfter':!_0x4d617f['isAtEnd']};}['_insertMarkers'](_0x208cbf,_0x1c336f){const _0x16f3a8=this['context']['plugins']['get']('AIEditing'),_0x5a94cc=new Set();_0x1c336f['model']['change'](_0x280bc0=>{for(const _0x3271ac of _0x208cbf){const _0x21dae2=''+Kn+_0x3271ac['type']+':'+_0x3271ac['groupId']+'_'+_0x16f3a8['_nextDataId'](_0x5a94cc);this['_markers']['set'](_0x21dae2,{'id':_0x21dae2,'groupId':_0x3271ac['groupId'],'type':_0x3271ac['type'],'content':_0x3271ac['content'],'editor':_0x1c336f}),_0x280bc0['addMarker'](_0x21dae2,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x280bc0['createRange'](_0x3271ac['start'],_0x3271ac['end'])});}});}['_createGetContextFn'](_0x25408d,_0x5dd471,_0x1583ef){let _0x272a04='';return()=>{if(!_0x272a04){const _0x55f81e=_0x5dd471['toView'](_0x25408d,{'showSuggestionHighlights':!0x0});let _0x351031=_0x55f81e['getChild'](0x0);if(_0x351031['is']('containerElement')||(_0x351031=_0x55f81e),!_0x351031)return'';let _0x38c67e=!0x1;const _0x10950e=[];for(const _0x211f70 of _0x351031['getChildren']())_0x211f70['is']('element','span')&&_0x211f70['hasClass']('ck-ai_review-marker_context-end')&&(_0x38c67e=!0x1),_0x38c67e&&_0x10950e['push'](_0x211f70),_0x211f70['is']('element','span')&&_0x211f70['hasClass']('ck-ai_review-marker_context-start')&&(_0x38c67e=!0x0);_0x351031['_removeChildren'](0x0,_0x351031['childCount']),_0x1583ef?.['ellipsisBefore']&&_0x351031['_appendChild']('…'),_0x351031['_appendChild'](_0x10950e),_0x1583ef?.['ellipsisAfter']&&_0x351031['_appendChild']('…');const _0x9c7af3=_0x5dd471['htmlProcessor']['domConverter']['viewToDom'](_0x55f81e),_0x119df7=_0x5dd471['htmlProcessor']['htmlWriter']['getHtml'](_0x9c7af3);_0x272a04=_0x119df7;}return _0x272a04;};}['_createGetContentFn'](_0xb90867,_0x12c389){let _0x1f347d='';return()=>(_0x1f347d||(_0x1f347d=_0x12c389['stringify'](_0xb90867,{'showSuggestionHighlights':!0x0})),_0x1f347d);}['_createGetContentUsingDataIdFn'](_0x4979c7,_0x88fbb5,_0x570637){let _0x504f6e='';return()=>{if(!_0x504f6e){const _0x369bb1=_0x570637['toView'](new _0x17ef1e(_0x4979c7)),_0x2a705f=_0x570637['htmlProcessor']['domConverter']['viewToDom'](_0x369bb1)['querySelector']('[data-id=\x22'+_0x88fbb5+'\x22]');_0x504f6e=_0x2a705f?.['outerHTML']||'';}return _0x504f6e;};}['_findMarkerElement'](_0x3daa1c,_0x571967=0x5){let _0x3bdf00=_0x3daa1c,_0x282203=null;for(let _0x3d202d=0x0;_0x3d202d<_0x571967&&_0x3bdf00;_0x3d202d++){if(!_0x3bdf00['className']){_0x3bdf00=_0x3bdf00['parentElement'];continue;}if(!(''+_0x3bdf00['className'])['includes']('ck-ai_review-marker_')){_0x3bdf00=_0x3bdf00['parentElement'];continue;}if(!_0x3bdf00['getAttribute']('data-marker-id'))break;_0x282203=_0x3bdf00;break;}return _0x282203;}['_findMarkerElementById'](_0x2916e3){const _0x38444d=this['_markers']['get'](_0x2916e3),_0x43739f=_0x38444d?.['editor']??ds(this['context']),_0x2b76a2=_0x43739f['model']['markers']['get'](_0x2916e3);return _0x2b76a2?_0xbefab9(_0x43739f['editing'],_0x2b76a2):null;}['_getMarkersDataForGroup'](_0x2c636a){return Array['from'](this['_markers']['values']())['filter'](_0x3f3480=>_0x3f3480['groupId']===_0x2c636a);}['_getOperationStart'](_0x4893bb){return'insert'===_0x4893bb['type']?_0x4893bb['position']:_0x4893bb['newRange']['start'];}['_getOperationEnd'](_0x19758b,_0x52e6a7=!0x1){return'insert'===_0x19758b['type']?_0x52e6a7?_0x19758b['position']:_0x19758b['position']['getShiftedBy'](_0x19758b['howMany']):_0x19758b['newRange']['end'];}['_shiftOperation'](_0x493be7,_0xfe922b){return'insert'===_0x493be7['type']?_0x493be7['position']=_0x493be7['position']['getShiftedBy'](_0xfe922b):'marker'===_0x493be7['type']&&_0x493be7['newRange']&&(_0x493be7['newRange']=new _0x3070cc(_0x493be7['newRange']['start']['getShiftedBy'](_0xfe922b),_0x493be7['newRange']['end']['getShiftedBy'](_0xfe922b))),_0x493be7;}['_changeOperationOwnerDocument'](_0x510315,_0x4077c1){'insert'===_0x510315['type']?_0x510315['position']=this['_changePositionOwnerDocument'](_0x510315['position'],_0x4077c1):'marker'===_0x510315['type']&&_0x510315['newRange']&&(_0x510315['newRange']=this['_changeRangeOwnerDocument'](_0x510315['newRange'],_0x4077c1));}['_changePositionOwnerDocument'](_0x2d8737,_0x3a20a8){return new _0x4357c7(_0x3a20a8,_0x2d8737['path']);}['_changeRangeOwnerDocument'](_0x473777,_0x4edd04){return new _0x3070cc(this['_changePositionOwnerDocument'](_0x473777['start'],_0x4edd04),this['_changePositionOwnerDocument'](_0x473777['end'],_0x4edd04));}['_changePosition'](_0x20b87f,_0x3e1d18){return new _0x4357c7(_0x3e1d18,[..._0x20b87f]);}['_changeRange'](_0x22fac2,_0x35ab27,_0x43862d,_0x5a513e){return new _0x3070cc(this['_changePosition'](_0x35ab27,_0x5a513e),this['_changePosition'](_0x43862d,_0x5a513e));}['_sortMarkers'](_0x498e9b){const _0x3c67b9=_0x30f6c4=>{switch(_0x30f6c4){case'insert':return 0x0;case'remove-context':return 0x1;case'remove-only':return 0x2;case'remove-text':return 0x3;}};return _0x498e9b['sort']((_0x508a92,_0x304030)=>_0x3c67b9(_0x508a92['type'])-_0x3c67b9(_0x304030['type']));}['_hasSameTopLevelElement'](_0x222a16,_0x5edc0e){const _0x5b85f6=_0x222a16['getChild'](0x0),_0x157c77=_0x5edc0e['getChild'](0x0);return!(!_0x5b85f6||!_0x157c77)&&((!_0x5b85f6['is']('element')||!_0x157c77['is']('element')||_0x5b85f6['name']===_0x157c77['name'])&&!(_0x5b85f6['is']('element')&&!_0x157c77['is']('element')||!_0x5b85f6['is']('element')&&_0x157c77['is']('element')));}['_haveSingleTopLevelElement'](_0x96f9bd){return 0x1===_0x96f9bd['childCount'];}['_haveOnlyInlineContent'](_0x5bf8e4,_0x38626e){for(const _0x2d84cd of _0x5bf8e4['getChildren']())if(_0x2d84cd['is']('element')&&!_0x38626e['isInline'](_0x2d84cd))return!0x1;return!0x0;}['_upsertDataId'](_0x4ed26f,_0x4545fa){let _0x2d4b06=_0x4ed26f['getAttribute'](_0x4ab9e3);return _0x2d4b06||(_0x2d4b06=_0x4545fa(),_0x4ed26f['_setAttribute'](_0x4ab9e3,_0x2d4b06)),_0x2d4b06;}}class AIReviewCheckResult extends Et(){['id'];['contentNew'];['contentInitial'];['documentVersion'];constructor({id:_0x1e824d,contentNew:_0x506d42,contentInitial:_0x4407fd,documentVersion:_0x29fc9d}){super(),this['id']=_0x1e824d,this['contentNew']=_0x506d42,this['contentInitial']=_0x4407fd,this['documentVersion']=_0x29fc9d;}}class AIReviewCheckResultChange extends ht(){['id'];['parent'];['_data'];['_editorOperations']=[];constructor(_0x9e613b,_0x5f546b,_0x47cce8){super(),this['id']=_0x9e613b,this['parent']=_0x47cce8,this['_data']=_0x5f546b,this['set']('isActivated',!0x1),this['set']('isRated',!0x1),this['set']('status','pending'),this['on']('change:status',()=>{'pending'!==this['status']&&this['isActivated']&&(this['isActivated']=!0x1);});}get['contentDiffed'](){return this['_data']['context']();}get['operations'](){return this['_data']['operations'];}get['operationsIsolated'](){return this['_data']['operationsIsolated'];}}class AIReviewCheckRun extends ht(){['id']=ot();['callId'];['_results']=new Map();['_changes']=[];['_sourceCheck'];['_documentData'];['_aiConnector'];['_reviewParams'];['_reviewArgs'];['_activeRequest']=null;['_currentError'];['_wasAborted']=!0x1;constructor(_0x3efc3a,_0x336cf8,_0x538b30,_0x511f04,_0x5e8959){super(),this['_sourceCheck']=_0x336cf8,this['_documentData']=_0x3efc3a,this['_aiConnector']=_0x538b30,this['_reviewParams']=_0x511f04,this['_reviewArgs']=_0x5e8959,this['on']('change:status',(_0x4eed81,_0x2c2eb8,_0x210267)=>{'aborted'==_0x210267&&(this['_wasAborted']=!0x0),this['fire']('reviewCheckRunUpdated',{'status':_0x210267,'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'](_0x18c834=>'pending'===_0x18c834['status']);}get['currentError'](){return this['_currentError'];}['updateDocumentData'](_0x3b2016){this['_documentData']=_0x3b2016;}async['start'](){this['status']='loading',this['_currentError']=void 0x0;try{this['_activeRequest']=this['_createApiRequest']();const _0x359d24=await this['_activeRequest']['getStream']();this['status']='data';for await(const _0x195f40 of _0x359d24)'unmodified'!==_0x195f40['data']['operation']&&('error'!==_0x195f40['data']['operation']?'review-metadata'!==_0x195f40['event']?this['_addReviewCheckResult'](_0x195f40['data']['dataId'],_0x195f40['data']['textDelta']):this['callId']=_0x195f40['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(_0x41ce19){this['_currentError']=_0x41ce19,_0x41ce19 instanceof Error&&_0x41ce19['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'](_0x5d85ba,_0x45818e){const _0x1acda9=this['_results']['get'](_0x5d85ba);if(!_0x1acda9)return;if(0x0===_0x45818e['length'])return;const _0x14c697=[];_0x45818e['forEach']((_0x3ecdbe,_0x2ebb18)=>{const _0xa3e8b7=new AIReviewCheckResultChange(_0x1acda9['id']+'-'+_0x2ebb18,_0x3ecdbe,_0x1acda9);_0xa3e8b7['on']('change:status',()=>{this['fire']('reviewCheckResultChangeStatusUpdated',{'change':_0xa3e8b7,'status':_0xa3e8b7['status']});}),_0xa3e8b7['on']('change:isActivated',()=>{_0xa3e8b7['isActivated']?this['fire']('reviewCheckResultActivated',{'change':_0xa3e8b7}):this['fire']('reviewCheckResultDeactivated',{'change':_0xa3e8b7});}),this['_changes']['push'](_0xa3e8b7),_0x14c697['push'](_0xa3e8b7);}),this['fire']('reviewCheckResultReady',{'changes':_0x14c697,'result':_0x1acda9,'source':this});}['abort'](){this['_activeRequest']&&(this['_activeRequest']['abortController']['abort'](),this['_activeRequest']=null,this['status']='aborted');}['isChangeActive'](_0x5ac547){const _0x206579=this['_changes']['find'](_0xe14e18=>_0xe14e18['id']===_0x5ac547);return!(!_0x206579||'pending'!==_0x206579['status']);}['isAnyChangeActivated'](){return this['_changes']['some'](_0x4ddc4b=>!0x0===_0x4ddc4b['isActivated']);}['getActiveChanges'](){return this['_changes']['filter'](_0x2c27bb=>'pending'===_0x2c27bb['status']);}['getChangeById'](_0x126378){return this['_changes']['find'](_0x57687d=>_0x57687d['id']===_0x126378);}['markAllChangesAsAccepted'](){for(const _0x481dd8 of this['_changes'])'pending'===_0x481dd8['status']&&(_0x481dd8['status']='accepted');this['_checkIfFinished']();}['markChangeAsAccepted'](_0x299394){const _0x2e741d=this['_changes']['find'](_0x1c49fa=>_0x1c49fa['id']===_0x299394);_0x2e741d&&'pending'===_0x2e741d['status']&&(_0x2e741d['status']='accepted'),this['_checkIfFinished']();}['markChangeAsRejected'](_0x1515f3){const _0x4c66d2=this['_changes']['find'](_0x2e32d8=>_0x2e32d8['id']===_0x1515f3);_0x4c66d2&&'pending'===_0x4c66d2['status']&&(_0x4c66d2['status']='rejected'),this['_checkIfFinished']();}['markChangeAsOutdated'](_0x26e821){const _0x238333=this['_changes']['find'](_0x210354=>_0x210354['id']===_0x26e821);_0x238333&&'pending'===_0x238333['status']&&(_0x238333['status']='outdated'),this['_checkIfFinished']();}['markChangeAsPending'](_0x9a8cce){const _0x3c77a0=this['_changes']['find'](_0x2a1920=>_0x2a1920['id']===_0x9a8cce);_0x3c77a0&&'outdated'===_0x3c77a0['status']&&(_0x3c77a0['status']='pending'),this['_checkIfFinished']();}['activateChange'](_0x343b18){this['_changes']['filter'](_0x7ee1cc=>_0x7ee1cc['isActivated']&&_0x7ee1cc['id']!==_0x343b18)['forEach'](_0xe55ff3=>{_0xe55ff3['isActivated']=!0x1;});const _0x5930cc=this['_changes']['find'](_0x35aac8=>_0x35aac8['id']===_0x343b18);_0x5930cc&&'pending'===_0x5930cc['status']&&(_0x5930cc['isActivated']=!0x0);}['deactivateChange'](){this['_changes']['filter'](_0x12b1ca=>_0x12b1ca['isActivated'])['forEach'](_0x2845b9=>{_0x2845b9['isActivated']=!0x1;});}['forceReadyState'](){this['status']='ready';}async['sendRating'](_0x1ed87a){if('initialized'===this['status']||'loading'===this['status']||'data'===this['status']||this['_wasAborted'])return;if(!this['callId']||0x0===this['_changes']['length'])return;let _0x2f7077;if(_0x1ed87a){const _0x4a92ce=this['_changes']['find'](_0x407900=>_0x407900['id']===_0x1ed87a);if(_0x4a92ce&&_0x4a92ce['isRated'])return;_0x4a92ce&&(_0x2f7077=_0x4a92ce['parent']['id'],_0x4a92ce['isRated']=!0x0);}const _0x1f7f64={'positiveCount':this['_changes']['filter'](_0x13c607=>'accepted'===_0x13c607['status'])['length'],'totalCount':this['_changes']['length']};this['_sendRatingRequest'](_0x1f7f64,this['callId'],_0x2f7077);}['_addReviewCheckResult'](_0x18cfe9,_0x2173e0){const _0x2ae76a=this['_documentData']['elements']['get'](_0x18cfe9);if(!_0x2ae76a)return;const _0xba2dde=_0x2ae76a['getContent']();if(_0xba2dde===_0x2173e0)return;const _0x3f09c0=new AIReviewCheckResult({'id':_0x18cfe9,'contentInitial':_0xba2dde,'contentNew':_0x2173e0,'documentVersion':_0x2ae76a['documentVersion']});this['_results']['set'](_0x3f09c0['id'],_0x3f09c0),this['fire']('reviewCheckResultAdded',{'result':_0x3f09c0,'source':this,'editor':_0x2ae76a['editor']});}['_checkIfFinished'](){'finished'===this['status']&&(this['_changes']['filter'](_0x5410f3=>'pending'===_0x5410f3['status'])['length']>0x0&&(this['status']='ready')),'ready'===this['status']&&(0x0===this['_changes']['filter'](_0x534923=>'pending'===_0x534923['status'])['length']&&(this['status']='finished'));}}class AIReviewSystemCheckRun extends AIReviewCheckRun{get['subTitle'](){if(!this['_reviewParams']||0x0===this['_reviewParams']['length'])return'';const _0x1f3725=[];if(this['_reviewParams']['length']>0x0&&this['_sourceCheck']['options'])for(let _0x2e3afb=0x0;_0x2e3afb<this['_reviewParams']['length'];_0x2e3afb++){if(!this['_reviewParams'][_0x2e3afb]||!this['_sourceCheck']['options'][_0x2e3afb])continue;const _0x2e2c8b=this['_sourceCheck']['options'][_0x2e3afb],_0x409f76=_0x2e2c8b['data']?.['find'](_0x57702d=>_0x57702d['id']===this['_reviewParams'][_0x2e3afb]);_0x409f76&&_0x1f3725['push'](_0x409f76['label']);}return _0x1f3725['join'](',\x20');}get['reviewName'](){return this['_composeReviewName']();}['_createApiRequest'](){return this['_aiConnector']['callSystemReview']({'reviewName':this['_composeReviewName'](),'content':this['_documentData']['content'],'args':this['_reviewArgs']});}['_sendRatingRequest'](_0x5eb40f,_0x4f2f31,_0x56f2b8){return this['_aiConnector']['upsertAIReviewRating'](this['reviewName'],_0x4f2f31,_0x5eb40f,_0x56f2b8);}['_composeReviewName'](){return!this['_reviewParams']||0x0===this['_reviewParams']['length']||this['_sourceCheck']['useArgs']?this['_sourceCheck']['apiId']:[this['_sourceCheck']['apiId'],...this['_reviewParams']]['join']('-');}}class AIReviewCoreController extends _0x530a64{['_aiConnector'];['_aiReviewCoreUi'];['_aiReviewCoreEditing'];['_aiReviewCheckList'];['_currentReviewCheckRun'];['_changeActivationSource']=null;static get['requires'](){return[AIConnector];}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}async['init'](){this['_initRequiredPlugins'](),this['_aiReviewCheckList']=await this['_getChecksList'](),this['listenTo'](this['_aiReviewCoreUi'],'getReviewCheckList',()=>{this['_aiReviewCoreUi']['setAvailableChecks'](this['_aiReviewCheckList']['checks']);}),this['listenTo'](this['_aiReviewCoreUi'],'runReviewCheck',async(_0x3e0d2f,_0x1e80b3)=>{const _0x2b0d19=this['_aiReviewCheckList']['getCheckById'](_0x1e80b3['id']);if(_0x2b0d19){this['_onReviewCheckRun'](_0x1e80b3),this['_aiReviewCoreEditing']['switchToReadOnly'](),this['_currentReviewCheckRun']=this['_createReviewCheckRun'](_0x1e80b3,_0x2b0d19),this['_aiReviewCoreUi']['setCheckResultTitle'](this['_currentReviewCheckRun']['title'],this['_currentReviewCheckRun']['subTitle']),this['_currentReviewCheckRun']['on']('reviewCheckRunUpdated',(_0x39f185,_0x46e507)=>{switch(_0x46e507['status']){case'data':case'loading':this['_aiReviewCoreUi']['showCheckRunResults'](_0x46e507);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'!==_0x46e507['status']&&'error-chunk'!==_0x46e507['status']&&'error-general'!==_0x46e507['status']||this['_currentReviewCheckRun']?.['sendRating']();}),this['_currentReviewCheckRun']['on']('reviewCheckResultAdded',(_0x2aea79,_0x4a84d3)=>{if(!this['_currentReviewCheckRun'])throw new at('ai-review-mode-no-current-check-run',this);const _0xd3e68c=this['_diffContent'](_0x4a84d3['editor'],_0x4a84d3['result']['contentInitial'],_0x4a84d3['result']['contentNew']);_0x4a84d3['source']['addResultChanges'](_0x4a84d3['result']['id'],_0xd3e68c);}),this['_currentReviewCheckRun']['on']('reviewCheckResultReady',(_0x57d60f,_0x510330)=>{for(const _0x403052 of _0x510330['changes'])this['_aiReviewCoreUi']['showCheckRunResult'](_0x403052);this['_markChangePositionInEditorContent'](_0x510330['changes'],_0x510330['source']['documentData']);}),this['_currentReviewCheckRun']['on']('reviewCheckResultChangeStatusUpdated',(_0x4f9b60,_0xbef3e)=>{this['_aiReviewCoreUi']['updateChangeState'](_0xbef3e['change']['id'],_0xbef3e['status']);}),this['_currentReviewCheckRun']['on']('reviewCheckResultActivated',(_0x401c0d,_0x51b333)=>{this['_onReviewCheckResultActivated'](_0x51b333);}),this['_currentReviewCheckRun']['on']('reviewCheckResultDeactivated',()=>{this['_onReviewCheckResultDeactivated']();});try{await this['_currentReviewCheckRun']['start']();}catch(_0x5279f5){_0x5279f5 instanceof Error&&_0x5279f5['message']['includes']('ai-request-aborted')||(_0x5279f5 instanceof at?this['_logError'](_0x5279f5):this['_logError'](new at('ai-review-mode-check-run-failed',this,void 0x0,_0x5279f5)));}}else this['_logError'](new at('ai-review-mode-source-check-not-found',this,{'checkId':_0x1e80b3['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 _0x304c3d=this['_currentReviewCheckRun']['getActiveChanges']();if(!_0x304c3d['length'])return;this['_aiReviewCoreEditing']['applyChange'](_0x304c3d['map'](_0x485163=>_0x485163['id']));const _0x482822=this['_currentReviewCheckRun'];_0x482822['markAllChangesAsAccepted'](),_0x482822['sendRating']();}),this['listenTo'](this['_aiReviewCoreUi'],'acceptChange',(_0x2bfaae,_0x4c4888)=>{this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['isChangeActive'](_0x4c4888['id'])&&(this['_aiReviewCoreEditing']['applyChange']([_0x4c4888['id']]),this['_currentReviewCheckRun']['markChangeAsAccepted'](_0x4c4888['id']),this['_aiReviewCoreUi']['hideChangeBalloon'](),this['_currentReviewCheckRun']['sendRating'](_0x4c4888['id']));}),this['listenTo'](this['_aiReviewCoreUi'],'dismissChange',(_0x9d2c87,_0x1b7502)=>{this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['isChangeActive'](_0x1b7502['id'])&&(this['_aiReviewCoreEditing']['rejectChange'](_0x1b7502['id']),this['_currentReviewCheckRun']['markChangeAsRejected'](_0x1b7502['id']),this['_aiReviewCoreUi']['hideChangeBalloon'](),this['_currentReviewCheckRun']['sendRating'](_0x1b7502['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',(_0x5751c0,_0x69b176)=>{this['_onActivateChange'](_0x69b176);}),this['listenTo'](this['_aiReviewCoreUi'],'deactivateChange',(_0x39963d,_0x3cdb88)=>{this['_onDeactivateChange'](_0x3cdb88);}),this['listenTo'](this['_aiReviewCoreEditing']['emitter'],'changeMarkerClicked',(_0xaf044f,_0x1bbf84)=>{this['_onChangeMarkerClicked'](_0xaf044f,_0x1bbf84);}),this['listenTo'](this['_aiReviewCoreEditing']['emitter'],'changeMarkerHovered',(_0x4be679,_0xf74a0)=>{this['_onChangeMarkerHovered'](_0x4be679,_0xf74a0);}),this['listenTo'](this['_aiReviewCoreEditing']['emitter'],'changeMarkerBlurred',()=>{this['_onChangeMarkerBlurred']();}),this['listenTo'](this['_aiReviewCoreEditing']['emitter'],'changeMarkerRemoved',(_0x292a2a,_0x4dbb68)=>{this['_onChangeMarkerRemoved'](_0x292a2a,_0x4dbb68);}),this['listenTo'](this['_aiReviewCoreEditing']['emitter'],'changeMarkerRestored',(_0x1c764d,_0x259fb7)=>{this['_onChangeMarkerRestored'](_0x1c764d,_0x259fb7);});}['_createReviewCheckRun'](_0x2d315d,_0x571aea){return new AIReviewSystemCheckRun(this['_aiReviewCoreEditing']['getDocumentData'](),_0x571aea,this['_aiConnector'],_0x2d315d['params'],_0x2d315d['args']);}['_onChangeMarkerRemoved'](_0x44309b,_0x328b1a){this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['markChangeAsOutdated'](_0x328b1a['changeId']);}['_onChangeMarkerRestored'](_0x1581fe,_0x5360c3){this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['markChangeAsPending'](_0x5360c3['changeId']);}['_onCheckRunFinished'](){this['_aiReviewCoreUi']['showReviewCompletedView']();}['_initRequiredPlugins'](){this['_aiConnector']=this['context']['plugins']['get']('AIConnector');}['_onReviewRunLeave'](_0x14bc0d=!0x1){this['_currentReviewCheckRun']&&(this['_currentReviewCheckRun']['hasModifications']||this['_currentReviewCheckRun']['sendRating'](),this['_currentReviewCheckRun']['stopListening'](),this['_currentReviewCheckRun']['abort'](),this['_currentReviewCheckRun']=void 0x0),_0x14bc0d&&this['_aiReviewCoreUi']['showReviewCheckList'](),this['_aiReviewCoreEditing']['clearAllMarkers'](),this['_aiReviewCoreEditing']['switchToEdit'](),this['_changeActivationSource']=null;for(const _0x5d603f of this['_aiReviewCoreEditing']['getEditors']())_0x5d603f['editing']['view']['change'](_0x4aa3eb=>{for(const _0x37fa43 of _0x5d603f['editing']['view']['document']['getRoots']())_0x4aa3eb['removeClass']('ck-ai_review-diff',_0x37fa43),_0x4aa3eb['removeClass']('ck-ai_review-highlights',_0x37fa43),_0x4aa3eb['removeClass']('ck-ai-translate-mode-content',_0x37fa43);});}['_getTranslationWithDefault'](_0x2e932a,_0x472cf8){const _0x4a0b4a=Hi(this['context']['locale'],_0x2e932a);return _0x4a0b4a===_0x2e932a?_0x472cf8:_0x4a0b4a;}['_logError'](_0x1c50d9,_0x5cefc5=!0x1){Ct(_0x1c50d9['message']),_0x5cefc5||(_0x1c50d9['message']['startsWith']('ai-review-mode-models-unable-to-retrieve')?this['_aiReviewCoreUi']['showGeneralReviewCoreErrorView']():this['_aiReviewCoreUi']['showGeneralResultsErrorView']());}['_scrollToChange'](_0x55471a){if('content'===this['_changeActivationSource']){const _0x225ca1=this['_aiReviewCoreUi']['getChangeElement'](_0x55471a);_0x225ca1&&ft(_0x225ca1['closest']('.ck-ai_review__check-run-result')||_0x225ca1);}else{if('panel'===this['_changeActivationSource']){const _0x21bf9b=this['_getChangeContentElement'](_0x55471a);if(!_0x21bf9b)return;wt({'target':_0x21bf9b,'viewportOffset':{'top':0x55,'left':0x0,'bottom':0x0,'right':0x0},'ancestorOffset':0x14,'alignToTop':!0x0});}}}}const Yn=[{'id':'custom','commandId':'custom','title':'Custom\x20command','description':'Type\x20a\x20custom\x20command\x20to\x20review\x20the\x20content\x20exactly\x20as\x20you\x20need.','isParameterized':!0x0},{'id':'correctness','commandId':'correctness','title':'Correctness','description':'Ensure\x20the\x20text\x20is\x20factually\x20accurate\x20and\x20free\x20of\x20errors.','isParameterized':!0x1},{'id':'clarity','commandId':'clarity','title':'Clarity','description':'Improve\x20the\x20clarity\x20and\x20readability\x20of\x20the\x20text.','isParameterized':!0x1},{'id':'readability','commandId':'readability','title':'Readability','description':'Enhance\x20the\x20overall\x20readability\x20of\x20the\x20text.','isParameterized':!0x1},{'id':'length','commandId':'make','title':'Adjust\x20length','description':'Refine\x20text\x20length\x20to\x20match\x20your\x20needs.','isParameterized':!0x0,'options':[{'formType':'dropdown','label':'Adjust\x20length','default':'longer','data':[{'label':'Longer','id':'longer'},{'label':'Shorter','id':'shorter'}]}]},{'id':'tone','commandId':'make-tone','title':'Adjust\x20tone\x20and\x20style','description':'Choose\x20tone\x20and\x20style\x20to\x20change\x20content\x20as\x20you\x20need.','isParameterized':!0x0,'options':[{'formType':'dropdown','label':'Adjust\x20tone\x20and\x20style','default':'casual','data':[{'label':'Casual','id':'casual'},{'label':'Direct','id':'direct'},{'label':'Friendly','id':'friendly'},{'label':'Confident','id':'confident'},{'label':'Professional','id':'professional'}]}]}];class AIReviewCheck{['id'];['commandId'];['title'];['description'];['isParameterized'];['useArgs'];['options'];['args'];get['apiId'](){return this['commandId'];}constructor(_0x47d5b1){this['id']=_0x47d5b1['id'],this['commandId']=_0x47d5b1['commandId'],this['title']=_0x47d5b1['title'],this['description']=_0x47d5b1['description'],this['isParameterized']=_0x47d5b1['isParameterized'],this['useArgs']=_0x47d5b1['useArgs'],this['options']=_0x47d5b1['options'],this['args']=_0x47d5b1['args'];}}class AIReviewCheckList extends ht(){['_checks']=[];['setupChecks'](_0x1222b9){this['_checks']=_0x1222b9['map'](_0x14ceec=>new AIReviewCheck(_0x14ceec));}get['checks'](){return this['_checks'];}['getCheckById'](_0x32d0b1){return this['checks']['find'](_0x40f69d=>_0x40f69d['id']===_0x32d0b1);}['removeCheckById'](_0x442a0d){this['_checks']=this['_checks']['filter'](_0x5390db=>_0x5390db['id']!==_0x442a0d);}}class AIReviewCheckCustom extends AIReviewCheck{['_models']=[];['_defaultModel']=null;constructor(_0x22cdd0,_0x439b5e,_0x3d7dbc){super(_0x22cdd0),this['_models']=_0x439b5e,this['_defaultModel']=_0x3d7dbc;}get['models'](){return this['_models'];}get['defaultModel'](){return this['_defaultModel'];}}class AIReviewCheckExtra extends AIReviewCheck{['isExtra']=!0x0;['prompt'];['model'];['_defaultModel']=null;constructor(_0xc63ed1,_0x147615,_0x3fe583){super(_0xc63ed1),this['prompt']=_0xc63ed1['prompt'],this['model']=_0xc63ed1['model'],this['model']?this['_defaultModel']=_0x147615['find'](_0x3e19fd=>_0x3e19fd['id']===this['model'])||null:this['_defaultModel']=_0x3fe583;}get['defaultModel'](){return this['_defaultModel'];}}class AIReviewModeCheckList extends AIReviewCheckList{['_allModels']=[];['_recommendedModels']=[];['_defaultModel']=null;constructor(_0x2387da,_0x3977b3,_0x3a7b50){super(),this['_allModels']=_0x2387da,this['_recommendedModels']=_0x3977b3,this['_defaultModel']=_0x3a7b50;}['setupChecks'](_0x573804){this['_checks']=_0x573804['map'](_0x4308ef=>!0x0===_0x4308ef['isExtra']?new AIReviewCheckExtra(_0x4308ef,this['_allModels'],this['_defaultModel']):'custom'===_0x4308ef['id']?new AIReviewCheckCustom(_0x4308ef,this['_recommendedModels'],this['_defaultModel']):new AIReviewCheck(_0x4308ef));}}class AIReviewCustomCheckRun extends AIReviewCheckRun{['_prompt'];['_model'];constructor(_0x435e07,_0x458b6b,_0x28c1d8,_0xb2397c,_0x4d049d){super(_0x28c1d8,_0xb2397c,_0x4d049d),this['_prompt']=_0x435e07,this['_model']=_0x458b6b;}get['subTitle'](){return this['_prompt'];}['_createApiRequest'](){return this['_aiConnector']['callCustomReview']({'content':this['_documentData']['content'],'prompt':this['_prompt'],'model':this['_model']});}['_sendRatingRequest'](_0xee7423,_0x250e42,_0xa015bd){return this['_aiConnector']['upsertCustomAIReviewRating'](_0x250e42,_0xee7423,_0xa015bd);}}class AIReviewExtraCheckRun extends AIReviewCustomCheckRun{get['subTitle'](){return'';}set['prompt'](_0x2ac24a){this['_prompt']=_0x2ac24a;}set['model'](_0x172a83){this['_model']=_0x172a83;}}class AIReviewModeController extends AIReviewCoreController{static get['pluginName'](){return'AIReviewModeController';}['_isDiffOn']=!0x1;['_hasDefaultAvailableCommands']=!0x1;constructor(_0x1f12c5){super(_0x1f12c5),this['_hasDefaultAvailableCommands']=!this['context']['config']['get']('ai.review.availableCommands'),this['context']['config']['define']('ai.review.availableCommands',Yn['map'](_0x2d66b1=>_0x2d66b1['id'])),this['context']['config']['define']('ai.review.extraCommands',[]);}async['init'](){await super['init'](),this['listenTo'](this['_aiReviewCoreUi'],'toggleDiff',(_0xf0d00,_0x530cfa)=>{this['_isDiffOn']=_0x530cfa['on'],this['_onDiffChange'](this['_isDiffOn']);});}['_initRequiredPlugins'](){super['_initRequiredPlugins'](),this['_aiReviewCoreUi']=this['context']['plugins']['get']('AIReviewModeUI'),this['_aiReviewCoreEditing']=this['context']['plugins']['get']('AIReviewCoreEditing');}['_createReviewCheckRun'](_0x3d8573,_0x4e67f5){return _0x3d8573['isCustom']?new AIReviewCustomCheckRun(_0x3d8573['args']['prompt'],_0x3d8573['args']['model'],this['_aiReviewCoreEditing']['getDocumentData'](),_0x4e67f5,this['_aiConnector']):_0x4e67f5['isExtra']?new AIReviewExtraCheckRun(_0x4e67f5['prompt'],_0x4e67f5['defaultModel']['id'],this['_aiReviewCoreEditing']['getDocumentData'](),_0x4e67f5,this['_aiConnector']):new AIReviewSystemCheckRun(this['_aiReviewCoreEditing']['getDocumentData'](),_0x4e67f5,this['_aiConnector'],_0x3d8573['params'],_0x3d8573['args']);}['_onReviewCheckResultActivated'](_0xf24cf0){this['_aiReviewCoreUi']['setActiveStateInResults'](_0xf24cf0['change']['id']),this['_scrollToChange'](_0xf24cf0['change']['id']);const _0x47c8dc=this['_aiReviewCoreEditing']['getMarkerElementForChange'](_0xf24cf0['change']['id']);if(!_0x47c8dc)return;const _0x2ea545=this['_aiReviewCoreEditing']['getEditorForChange'](_0xf24cf0['change']['id'])??this['_aiReviewCoreEditing']['getEditor']();this['_aiReviewCoreUi']['showChangeBalloon'](_0xf24cf0['change'],()=>_0x47c8dc['getElement'](),void 0x0,'click',this['_getBalloonDomRoot'](_0x2ea545,_0x47c8dc['modelRange']['root']['rootName']),_0x2ea545?.['ui']?.['viewportOffset']),this['_aiReviewCoreEditing']['setMarkersInElementAsActive'](_0xf24cf0['change']['id']);}['_onReviewCheckResultDeactivated'](){this['_aiReviewCoreUi']['resetActiveStateInResults'](),this['_aiReviewCoreUi']['hideChangeBalloon'](),this['_aiReviewCoreEditing']['setAllMarkersAsInactive']();}['_onActivateChange'](_0x270afe){this['_currentReviewCheckRun']&&'click'===_0x270afe['uiInteraction']&&(this['_changeActivationSource']='panel',this['_currentReviewCheckRun']['activateChange'](_0x270afe['id']));}['_onDeactivateChange'](_0x1a2d46){this['_currentReviewCheckRun']&&'balloon'===_0x1a2d46['origin']&&this['_currentReviewCheckRun']['deactivateChange']();}['_onChangeMarkerClicked'](_0x5359b0,_0x8133c1){if(!this['_currentReviewCheckRun'])return;this['_changeActivationSource']='content',this['_currentReviewCheckRun']['activateChange'](_0x8133c1['changeId']);const _0x5d9252=this['_currentReviewCheckRun']['getChangeById'](_0x8133c1['changeId']);if(!_0x5d9252)return;const _0x4b9f63=this['_aiReviewCoreEditing']['getMarkerElementForChange'](_0x8133c1['changeId']),_0x1a2f79=this['_aiReviewCoreEditing']['getEditorForChange'](_0x8133c1['changeId'])??this['_aiReviewCoreEditing']['getEditor']();this['_aiReviewCoreUi']['showChangeBalloon'](_0x5d9252,_0x8133c1['markerElement'],_0x8133c1['domEvent'],'click',this['_getBalloonDomRoot'](_0x1a2f79,_0x4b9f63?.['modelRange']['root']['rootName']),_0x1a2f79?.['ui']?.['viewportOffset']);}['_onChangeMarkerHovered'](_0x2e3179,_0x518846){if(!this['_currentReviewCheckRun'])return;if(this['_currentReviewCheckRun']['isAnyChangeActivated']())return;const _0x1b22b4=this['_currentReviewCheckRun']['getChangeById'](_0x518846['changeId']);if(!_0x1b22b4)return;const _0x3526ed=this['_aiReviewCoreEditing']['getMarkerElementForChange'](_0x518846['changeId']),_0xcf4d5a=this['_aiReviewCoreEditing']['getEditorForChange'](_0x518846['changeId'])??this['_aiReviewCoreEditing']['getEditor']();this['_aiReviewCoreUi']['showChangeBalloon'](_0x1b22b4,_0x518846['markerElement'],_0x518846['domEvent'],'hover',this['_getBalloonDomRoot'](_0xcf4d5a,_0x3526ed?.['modelRange']['root']['rootName']),_0xcf4d5a?.['ui']?.['viewportOffset']);}['_onChangeMarkerBlurred'](){if(!this['_currentReviewCheckRun'])return;this['_currentReviewCheckRun']['isAnyChangeActivated']()||this['_aiReviewCoreUi']['hideChangeBalloon']();}['_getChangeContentElement'](_0x57fc6e){const _0x5b57fa=this['_aiReviewCoreEditing']['getMarkerElementForChange'](_0x57fc6e);return _0x5b57fa?_0x5b57fa['getElement']():null;}['_markChangePositionInEditorContent'](_0x160783,_0x3efc75){this['_aiReviewCoreEditing']['markChangePositionInEditorContent'](_0x160783,_0x3efc75);}['_diffContent'](_0x1074db,_0x12cbb1,_0x1ce913){return this['_aiReviewCoreEditing']['diffContent'](_0x1074db,_0x12cbb1,_0x1ce913,!0x1);}['_onReviewCheckRun'](){this['_onDiffChange'](this['_isDiffOn']);}['_onDiffChange'](_0x51ebba){_0x51ebba?this['_aiReviewCoreUi']['hideDiffInBalloon']():this['_aiReviewCoreUi']['showDiffInBalloon']();for(const _0x560850 of this['_aiReviewCoreEditing']['getEditors']())_0x560850['editing']['view']['change'](_0x52f4ea=>{for(const _0x22a071 of _0x560850['editing']['view']['document']['getRoots']()){for(const _0x4769ef of _0x22a071['getClassNames']())_0x4769ef['startsWith']('ck-ai_review-')&&_0x52f4ea['removeClass'](_0x4769ef,_0x22a071);_0x52f4ea['addClass'](_0x51ebba?'ck-ai_review-diff':'ck-ai_review-highlights',_0x22a071);}});}['_getBalloonDomRoot'](_0x3ec328,_0x11b167){const _0x1705af=_0x3ec328['editing']['view'];if(_0x11b167){const _0x453b9a=_0x1705af['getDomRoot'](_0x11b167);if(_0x453b9a)return _0x453b9a;}return _0x1705af['getDomRoot']()??void 0x0;}async['_getChecksList'](){const _0x8f2c1b=[...Yn,...this['_getExtraChecks']()],_0x436366=this['context']['config']['get']('ai.review.availableCommands')||[];this['_logErrorForNonExistentChecks'](_0x436366,_0x8f2c1b);let _0x3077b5=_0x8f2c1b;this['_hasDefaultAvailableCommands']||(_0x3077b5=_0x436366['map'](_0x30c5c3=>_0x8f2c1b['find'](_0x482a5d=>_0x482a5d['id']===_0x30c5c3))['filter'](_0x43224f=>!!_0x43224f)),_0x3077b5=_0x3077b5['map'](_0x53d7e8=>_0x53d7e8['isExtra']?_0x53d7e8:this['_translateReviewCheck'](_0x53d7e8));const _0x2d4de1=_0x3077b5['some'](_0x41ddb7=>_0x41ddb7['isExtra']||'custom'===_0x41ddb7['id']);let _0x24dfb9=[],_0x3d7e41=[],_0x1da619=null;if(_0x2d4de1){const _0x102dd7=await this['_getModels']();_0x24dfb9=_0x102dd7['all'],_0x3d7e41=_0x102dd7['recommended'],_0x1da619=_0x102dd7['default'];}const _0x564ce4=new AIReviewModeCheckList(_0x24dfb9,_0x3d7e41,_0x1da619);return _0x564ce4['setupChecks'](_0x3077b5),_0x2d4de1&&this['_filterChecksWithMissingModel'](_0x564ce4),_0x564ce4;}['_getExtraChecks'](){return(this['context']['config']['get']('ai.review.extraCommands')||[])['map'](_0xc39882=>({'id':_0xc39882['id'],'commandId':_0xc39882['id'],'title':_0xc39882['label'],'description':_0xc39882['description'],'isParameterized':!0x1,'isExtra':!0x0,'prompt':_0xc39882['prompt'],'model':_0xc39882['model']}));}['_logErrorForNonExistentChecks'](_0xb1d0f0,_0x485117){const _0x5c68ea=_0xb1d0f0['filter'](_0x9a5a92=>!_0x485117['some'](_0x49b5cc=>_0x49b5cc['id']===_0x9a5a92));_0x5c68ea['length']&&this['_logError'](new at('ai-review-mode-non-existent-commands-used',this,{'commandIds':_0x5c68ea['join'](',\x20')}),!0x0);}async['_getModels'](){try{const _0x4a9a8f=new AIModels({'connector':this['_aiConnector'],'config':this['context']['config']['get']('ai.models'),'locale':this['context']['locale']});return{'all':await _0x4a9a8f['getAll'](),'recommended':await _0x4a9a8f['getAvailableModels'](),'default':await _0x4a9a8f['getDefault']()};}catch(_0x3c53c4){return this['_logError'](new at('ai-review-mode-models-unable-to-retrieve',this,void 0x0,_0x3c53c4)),{'all':[],'recommended':[],'default':null};}}['_translateReviewCheck'](_0x599a29){const _0x11e00d='AI_REVIEW_CHECK_'+_0x599a29['id']['toUpperCase']()['replaceAll']('-','_'),_0x12d9a3={..._0x599a29,'title':this['_getTranslationWithDefault'](_0x11e00d+'_TITLE',_0x599a29['title']),'description':this['_getTranslationWithDefault'](_0x11e00d+'_DESCRIPTION',_0x599a29['description'])};return _0x599a29['options']&&(_0x12d9a3['options']=_0x599a29['options']['map'](_0x52750a=>({..._0x52750a,'label':this['_getTranslationWithDefault'](_0x11e00d+'_OPTIONS_LABEL',_0x52750a['label']||''),'data':_0x52750a['data']?_0x52750a['data']['map'](_0x4749e6=>({..._0x4749e6,'label':this['_getTranslationWithDefault'](_0x11e00d+'_OPTIONS_DATA_'+_0x4749e6['id']['toUpperCase'](),_0x4749e6['label'])})):void 0x0}))),_0x12d9a3;}['_filterChecksWithMissingModel'](_0x4f510e){const _0x353677=[];_0x4f510e['checks']['forEach'](_0x33bdd0=>{(_0x33bdd0 instanceof AIReviewCheckExtra&&!_0x33bdd0['defaultModel']||_0x33bdd0 instanceof AIReviewCheckCustom&&!_0x33bdd0['models']['length'])&&_0x353677['push'](_0x33bdd0['id']);}),_0x353677['length']&&_0x353677['forEach'](_0x329611=>{_0x4f510e['removeCheckById'](_0x329611),this['_logError'](new at('ai-review-mode-command-unavailable-due-to-missing-model',this,{'commandId':_0x329611}),!0x0);});}}class AIReviewMode extends _0x530a64{static get['requires'](){return[AIReviewModeController,AIReviewModeUI,AIReviewCoreEditing];}static get['pluginName'](){return'AIReviewMode';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}class AITranslateCheck extends AIReviewCheck{get['apiId'](){return'translate';}}class AITranslateCheckList extends AIReviewCheckList{['setupChecks'](_0x4d6dc0){this['_checks']=_0x4d6dc0['map'](_0x2b4cd6=>new AITranslateCheck(_0x2b4cd6));}}class AITranslateCheckRun extends AIReviewSystemCheckRun{['_title'];constructor(_0x1c1fd9,_0x12df2e,_0x277801,_0x16c8af,_0x1ea0af,_0x4e7913){super(_0x1c1fd9,_0x12df2e,_0x277801,_0x1ea0af,_0x4e7913),this['_title']=_0x16c8af;}get['title'](){return this['_title'];}get['subTitle'](){return this['_sourceCheck']['title'];}}class AITranslateController extends AIReviewCoreController{static get['pluginName'](){return'AITranslateController';}constructor(_0x2f71e4){super(_0x2f71e4),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'](_0x41c106,_0xa5d9b5){return new AITranslateCheckRun(this['_aiReviewCoreEditing']['getDocumentData'](),_0xa5d9b5,this['_aiConnector'],Hi(this['context']['locale'],'AI_REVIEW_CHECK_TRANSLATE_TITLE'),_0x41c106['params'],_0x41c106['args']);}['_onReviewCheckResultActivated'](_0x31a2f9){this['_aiReviewCoreUi']['setActiveStateInResults'](_0x31a2f9['change']['id']),this['_aiReviewCoreEditing']['setMarkersInElementAsActive'](_0x31a2f9['change']['id']);}['_onReviewCheckResultDeactivated'](){this['_aiReviewCoreEditing']['setAllMarkersAsInactive'](),this['_aiReviewCoreUi']['resetActiveStateInResults']();}['_onActivateChange'](_0x473388){this['_currentReviewCheckRun']&&('hover'===_0x473388['uiInteraction']&&(this['_changeActivationSource']='panel',this['_currentReviewCheckRun']['activateChange'](_0x473388['id'])),'click'===_0x473388['uiInteraction']&&this['_scrollToChange'](_0x473388['id']));}['_onDeactivateChange'](_0x587eef){this['_currentReviewCheckRun']&&'panel'===_0x587eef['origin']&&this['_currentReviewCheckRun']['deactivateChange']();}['_onChangeMarkerClicked'](_0x4914ec,_0x4a85da){this['_currentReviewCheckRun']&&(this['_changeActivationSource']='content',this['_currentReviewCheckRun']['activateChange'](_0x4a85da['changeId']),this['_scrollToChange'](_0x4a85da['changeId']));}['_onChangeMarkerHovered'](_0x134843,_0x27b234){this['_currentReviewCheckRun']&&(this['_changeActivationSource']='content',this['_currentReviewCheckRun']['activateChange'](_0x27b234['changeId']),this['_aiReviewCoreEditing']['reactivateMarkers'](_0x27b234['changeId']));}['_onChangeMarkerBlurred'](){this['_currentReviewCheckRun']&&'content'===this['_changeActivationSource']&&(this['_currentReviewCheckRun']['deactivateChange'](),this['_aiReviewCoreEditing']['setAllMarkersAsInactive']());}['_getChangeContentElement'](_0x39eaed){return this['_aiReviewCoreEditing']['getContentElementForChange'](_0x39eaed);}['_markChangePositionInEditorContent'](_0x367a58,_0x28040c){this['_aiReviewCoreEditing']['markChangePositionInEditorContent'](_0x367a58,_0x28040c);}['_diffContent'](_0x2c3f61,_0x242aa8,_0x52490a){return this['_aiReviewCoreEditing']['diffContent'](_0x2c3f61,_0x242aa8,_0x52490a,!0x0);}['_onReviewCheckRun'](){for(const _0x56bc04 of this['_aiReviewCoreEditing']['getEditors']())_0x56bc04['editing']['view']['change'](_0x265bd6=>{for(const _0x183a54 of _0x56bc04['editing']['view']['document']['getRoots']())_0x265bd6['addClass']('ck-ai-translate-mode-content',_0x183a54);});}async['_getChecksList'](){const _0x5f2a93=[],_0x26ce35=this['context']['config']['get']('ai.translate.languages')||[];for(const _0x2e6ce3 of _0x26ce35)_0x5f2a93['push']({'title':_0x2e6ce3['label'],'id':_0x2e6ce3['id'],'commandId':_0x2e6ce3['id'],'description':'','isParameterized':!0x1,'useArgs':!0x0,'args':{'language':_0x2e6ce3['id']}});const _0x3280e8=new AITranslateCheckList();return _0x3280e8['setupChecks'](this['_translateChecks'](_0x5f2a93)),_0x3280e8;}['_translateChecks'](_0x5af38b){return _0x5af38b['map'](_0x3cdbd7=>{const _0x1d2190='AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_'+_0x3cdbd7['title']['toUpperCase']()['replaceAll']('-','_');return{..._0x3cdbd7,'title':this['_getTranslationWithDefault'](_0x1d2190,_0x3cdbd7['title'])};});}}class AITranslateCheckResultsView extends AIReviewCoreUICheckResultsView{constructor(_0x44e176,_0x55d699){super(_0x44e176,_0x55d699),this['on']('set:isLoading',(_0x2c7b85,_0x121275,_0x4e3ddc)=>{_0x4e3ddc&&(this['headerTitle']=Hi(this['locale'],'AI_TRANSLATE_CHECK_RESULTS_LOADING_TITLE'));}),this['on']('set:isResultReady',(_0x55f608,_0x264915,_0x20b6a6)=>{_0x20b6a6&&(this['headerTitle']=Hi(this['locale'],'AI_TRANSLATE_CHECK_RESULTS_READY_TITLE'));});}['_createAcceptAllButtonView'](){const _0x4f748f=super['_createAcceptAllButtonView']();return _0x4f748f['set']('label',Hi(this['locale'],'AI_TRANSLATE_ACCEPT_ALL')),_0x4f748f;}['_createExitReviewButtonView'](){const _0x401f48=super['_createExitReviewButtonView']();return _0x401f48['set']('label',Hi(this['locale'],'AI_CHAT_HISTORY_CANCEL')),_0x401f48;}}class AITranslateCheckListView extends AIReviewCoreReviewCheckListView{['_setupTemplate'](){const _0x9cf755=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-translate__check-list-wrapper',_0x9cf755['if']('isVisible','ck-hidden',_0x3f69c5=>!_0x3f69c5)]},'children':[{'tag':'div','attributes':{'class':['ck-ai-translate__check-list-header']},'children':[{'tag':'h2','children':[{'text':Hi(this['locale'],'AI_TRANSLATE_CHECK_LIST_HEADER_TITLE')}]},{'tag':'p','children':[{'text':Hi(this['locale'],'AI_TRANSLATE_CHECK_LIST_HEADER_DESCRIPTION')}]}]},{'tag':'div','attributes':{'class':['ck-ai_review__check-list',_0x9cf755['if']('isVisible','ck-hidden',_0x3d9444=>!_0x3d9444)]},'children':this['_checkViews']}]});}}class AITranslateUI extends AIReviewCoreUI{static get['pluginName'](){return'AITranslateUI';}['createMainView'](){const _0x29b5db=this['context']['plugins']['get']('AITabs'),_0x21ca50=this['context']['locale'],_0x561f30=new AIHeaderView(_0x21ca50,{'label':Hi(_0x21ca50,'AI_REVIEW_CHECK_TRANSLATE_TITLE'),'icon':_0xb0c3ee,'class':'ck-ai-header_review-translate','showResizeButton':_0x29b5db['showResizeButton']});_0x561f30['delegate']('resizeTabs')['to'](_0x29b5db),_0x561f30['bind']('isMaximized')['to'](_0x29b5db['view'],'isMaximized',_0x4f01ac=>_0x4f01ac);const _0x4340f9=new AIReviewCoreView(_0x21ca50,{'header':_0x561f30,'list':new AITranslateCheckListView(_0x21ca50),'results':new AITranslateCheckResultsView(_0x21ca50,{'generalErrorText':Hi(_0x21ca50,'AI_TRANSLATE_GENERAL_ERROR_MESSAGE')}),'completed':new AIReviewCoreReviewCompletedView(_0x21ca50,{'headerText':Hi(_0x21ca50,'AI_TRANSLATE_FINISH_HEADER_TITLE'),'emptyResultsText':Hi(_0x21ca50,'AI_TRANSLATE_EMPTY_RESULTS_TEXT'),'buttonText':Hi(_0x21ca50,'AI_TRANSLATE_FINISH_BUTTON_LABEL')})});return _0x4340f9['extendTemplate']({'attributes':{'class':'ck-ai-translate-mode'}}),_0x4340f9;}['registerTab'](){const _0x3470de=this['context']['plugins']['get']('AITabs');_0x3470de['view']['on']('activateTab',(_0xa42443,{newTab:_0x5cb116,oldTab:_0x24f56d})=>{'translate'===_0x5cb116?this['fire']('getReviewCheckList'):'translate'===_0x24f56d&&this['fire']('leaveReview');}),_0x3470de['view']['addTab']({'id':'translate','buttonLabel':Hi(this['context']['locale'],'AI_REVIEW_CHECK_TRANSLATE_TITLE'),'buttonIcon':_0xb0c3ee,'order':0x0,'content':this['_mainView']});}}class AITranslate extends _0x530a64{static get['requires'](){return[AITranslateController,AITranslateUI,AIReviewCoreEditing];}static get['pluginName'](){return'AITranslate';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}export{AIActions,AIAdapter,AIAssistant,AIAssistantUI,AIBalloon,AIChat,AIChatController,AIChatFeedCustomElementView,AIChatHistory,AIChatHistoryController,AIChatHistoryUI,AIChatInteraction,AIChatShortcuts,AIChatUI,AIConnector,AIEditing,AIEditorIntegration,AIInteraction,AIQuickActions,AIQuickActionsUI,AIReply,AIRequestError,AIReviewCheck,AIReviewCheckResult,AIReviewCheckResultChange,AIReviewCheckRun,AIReviewMode,AIReviewCoreController as AIReviewModeController,AIReviewCoreEditing as AIReviewModeEditing,AIReviewModeUI,AITabs,AITabsMainView,AITabsView,AITextAdapter,AIToggleButtonUI,AITranslate,AITranslateController,AITranslateUI,AWSTextAdapter,OpenAITextAdapter,ShowAIAssistantCommand,ToggleAICommand,Gi as createResizeButton,Di as getDefaultAICommands};
|