@ckeditor/ckeditor5-ai 48.1.0-alpha.5 → 48.1.0-alpha.7
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/aichat/aichatcontroller.d.ts +1 -1
- package/dist/aichat/model/aichatcontext.d.ts +7 -58
- package/dist/aichat/model/aichatconversation.d.ts +6 -20
- package/dist/aicore/aiconnector.d.ts +4 -0
- package/dist/aicore/aiediting.d.ts +2 -1
- 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 _0x45b757,Command as _0x65be43,ContextPlugin as _0x35ff8d,Editor as _0x45e816}from'@ckeditor/ckeditor5-core/dist/index.js';import{IconCopy as _0x3640b5,IconCheck as _0x51a320,IconError as _0x39d323,IconSubmit as _0xbc92a7,IconAIHistory as _0x578a8c,IconMagicWand as _0x2140f1,IconRobotPencil as _0x201c7c,IconMaximize as _0xb68bd5,IconMinimize as _0x30bd4f,IconShowChangesOn as _0x43b400,IconShowChangesOff as _0x75dd65,IconDocument as _0xded5c0,IconBoxWithCross as _0x44bc9f,IconBoxWithCheck as _0x5a16b4,IconBoxWithMarker as _0x54984e,IconInfo as _0x2f24b6,IconWeb as _0x3e498b,IconCancel as _0x48af93,IconSelection as _0x2028d1,IconFileUpload as _0x30bb37,IconLink as _0x4b251d,IconBulb as _0x38dc5f,IconAI as _0x44bae3,IconPreviousArrow as _0x2d0d1e,IconDocumentOutline as _0x19a54b,IconLoupe as _0x26b113,IconPaperClip as _0x1def42,IconBrowseFiles as _0x24d34d,IconDropdownArrow as _0x5afc68,IconStop as _0x41a00,IconPlus as _0x5a2bc9,IconAIChat as _0xbcb0f4,IconPin as _0x1d12ed,IconThreeHorizontalDots as _0xa472bb,IconAIReview as _0x12e6a2,IconAITranslate as _0x5a40c9,IconAIAskAI as _0x34aae7,IconThumbUp as _0x3c87f5,IconThumbDown as _0x4e5afa,IconChevronDown as _0x1e66f0,IconChevronUp as _0x2dfc5b,IconAIQuickActions as _0x333369,IconAIChatCommands as _0x2da0aa,IconAIImproveWriting as _0x24316d,IconAIContinueWriting as _0x274a46,IconAIGrammarCheck as _0x1a128e,IconAIAdjustLength as _0x4614f1,IconAIChangeTone as _0x170479,IconAIOther as _0xf3943c,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 _0x31c990,FormHeaderView as _0x58ed19,HighlightedTextView as _0x2605e7,ViewCollection as _0x19e880,FileDialogButtonView as _0x1a89fd,InputTextView as _0x2a08f6,SearchTextView as _0x27242a,ListItemButtonView as _0x5c6fa4,ButtonLabelWithHighlightView as _0x57e109,DropdownMenuPanelPositioningFunctions as _0x29f954,BalloonToolbar as _0x133ffc,FormRowView as _0x26f547,TextareaView as _0x1e77c0}from'@ckeditor/ckeditor5-ui/dist/index.js';import{ClipboardPipeline as _0x1e7f5c,ClipboardMarkersUtils as _0x197a4b}from'@ckeditor/ckeditor5-clipboard/dist/index.js';import{ViewDocumentDomEventData as _0x4a5708,ViewDataTransfer as _0x14be18,ViewUpcastWriter as _0x1d6502,Matcher as _0x542f4c,_DetachOperation as _0x3ca371,_insertIntoModelNodeList as _0x528d2e,_removeFromModelNodeList as _0x2f05cd,ModelRange as _0x2e58a9,transformOperationSets as _0x5bfae1,ViewDowncastWriter as _0x3dbbd3,ModelDocumentFragment as _0x5dc9eb,ModelPosition as _0x9f3aa5,ModelTreeWalker as _0x42715d,MarkerOperation as _0x37d5dc,InsertOperation as _0x375457}from'@ckeditor/ckeditor5-engine/dist/index.js';import{unescape as _0x50891f,escape as _0x3e39fc,cloneDeep as _0x591848,throttle as _0x2c7665,debounce as _0x2cdc06,escapeRegExp as _0xf93015}from'es-toolkit/compat';import{createParser as _0x3915bf}from'eventsource-parser';import{CloudServices as _0x19c4d3}from'@ckeditor/ckeditor5-cloud-services/dist/index.js';import{parseDocument as _0x40c2cf}from'htmlparser2';import{isTag as _0x252b51,findOne as _0x42364e,getParent as _0x412f90,findAll as _0x538dd8,removeElement as _0x4718cb,prepend as _0x2d6be7,prependChild as _0x3711aa,appendChild as _0x526a8f,append as _0x325097,find as _0x431494,isComment as _0x4f1746,replaceElement as _0x21418a,getChildren as _0x4754f3,textContent as _0x58d219}from'domutils';import ti from'dom-serializer';import{Document as _0x4760d6,Element as _0x3266dc,Text as _0x5adb0c,cloneNode as _0x36c6c8,isDocument as _0x5f4bc6,isText as _0x5133c6,NodeWithChildren as _0x5f3adb}from'domhandler';import{MarkdownGfmMdToHtmlDefaultPlugins as _0x59948f,MarkdownGfmMdToHtml as _0x307966}from'@ckeditor/ckeditor5-markdown-gfm/dist/index.js';import _0x72c6d8 from'rehype-sanitize';import{fixElementSuggestionRange as _0x47a21e,DocumentCompare as _0x10431c,DATA_ID_MODEL_ATTRIBUTE as _0x29c3ff,ConfirmMixin as _0x49ff75,getAllMarkersDomElementsSorted as _0x13b3c6,SuggestionsConversion as _0x528645,DATA_ID_VIEW_ATTRIBUTE as _0x3dbc12,getMarkerDomElement as _0x2c32ec}from'@ckeditor/ckeditor5-collaboration-core/dist/index.js';import _0x460d88 from'morphdom';import{diffArrays as _0xb989b2}from'diff';const Ci='_ungrouppedCommands';function wi(_0x279ea5,_0x498266){const _0x66e4ef=(0x0,_0x498266['t'])('Other');return _0x279ea5['length']?'groupId'in _0x279ea5[0x0]?_0x279ea5:[{'groupId':Ci,'groupLabel':_0x66e4ef,'order':0x1/0x0,'commands':_0x279ea5}]:[{'groupId':Ci,'groupLabel':_0x66e4ef,'order':0x1/0x0,'commands':[]}];}const fi=globalThis['DataTransfer'],bi='ai-ui';class Si extends _0x45b757{static get['pluginName'](){return'AIAssistantEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const {editor:_0x2cb78f}=this,_0x2659cc=['ck-fake-ai-selection'];_0x2cb78f['config']['get']('ai.assistant.useTheme')&&_0x2659cc['push']('ck-ai-assistant-ui_theme'),_0x2cb78f['conversion']['for']('editingDowncast')['markerToHighlight']({'model':bi,'view':{'classes':_0x2659cc,'priority':0xc}}),_0x2cb78f['conversion']['for']('editingDowncast')['markerToElement']({'model':bi,'view':(_0x4848a7,{writer:_0x3decc0})=>{if(!_0x4848a7['markerRange']['isCollapsed'])return null;const _0x218467=_0x3decc0['createUIElement']('span');return _0x3decc0['addClass'](['ck-fake-ai-selection','ck-fake-ai-selection_collapsed'],_0x218467),_0x218467;}});}['afterInit'](){!async function(_0x3c3e26){const _0x40a386=_0x270df1([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]),_0x48f680=0x3dffc4e1,_0x413c42=0x3df84d21^_0x48f680,_0x815566=window[_0x270df1([0x44,0x61,0x74,0x65])][_0x270df1([0x6e,0x6f,0x77])](),_0x1a914b=_0x3c3e26[_0x270df1([0x65,0x64,0x69,0x74,0x6f,0x72])],_0x4808eb=new window[(_0x270df1([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x240e9e=>{_0x1a914b[_0x270df1([0x6f,0x6e,0x63,0x65])](_0x270df1([0x72,0x65,0x61,0x64,0x79]),_0x240e9e);}),_0x12acfa={[_0x270df1([0x6b,0x74,0x79])]:_0x270df1([0x45,0x43]),[_0x270df1([0x75,0x73,0x65])]:_0x270df1([0x73,0x69,0x67]),[_0x270df1([0x63,0x72,0x76])]:_0x270df1([0x50,0x2d,0x32,0x35,0x36]),[_0x270df1([0x78])]:_0x270df1([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]),[_0x270df1([0x79])]:_0x270df1([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]),[_0x270df1([0x61,0x6c,0x67])]:_0x270df1([0x45,0x53,0x32,0x35,0x36])},_0x3b4b26=_0x1a914b[_0x270df1([0x63,0x6f,0x6e,0x66,0x69,0x67])][_0x270df1([0x67,0x65,0x74])](_0x270df1([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79]));async function _0x329fb9(){let _0x4bf2ae,_0x1da51f=null,_0x36e51b=null;try{if(_0x3b4b26==_0x270df1([0x47,0x50,0x4c]))return _0x270df1([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]);if(_0x4bf2ae=_0x62c59f(),!_0x4bf2ae)return _0x270df1([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);return _0x4bf2ae[_0x270df1([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])]&&(_0x36e51b=_0x3228a0(_0x4bf2ae[_0x270df1([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])],_0x4bf2ae[_0x270df1([0x6a,0x74,0x69])])),await _0x32f7cd()?_0x1e5ca0()?_0x350a51()?_0x270df1([0x45,0x78,0x70,0x69,0x72,0x65,0x64]):_0xe873af()?(_0x4bf2ae[_0x270df1([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])]==_0x270df1([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e])&&(_0x1da51f=_0x31274d(_0x270df1([0x45,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e,0x4c,0x69,0x6d,0x69,0x74]))),await _0x5decc8()):_0x270df1([0x44,0x6f,0x6d,0x61,0x69,0x6e,0x4c,0x69,0x6d,0x69,0x74]):_0x270df1([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]):_0x270df1([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}catch{return _0x270df1([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}function _0x350a51(){const _0x43db22=[_0x270df1([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e]),_0x270df1([0x74,0x72,0x69,0x61,0x6c])][_0x270df1([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x4bf2ae[_0x270df1([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])])?_0x815566/0x3e8:0xe10*_0x413c42;return _0x4bf2ae[_0x270df1([0x65,0x78,0x70])]<_0x43db22;}function _0x1e5ca0(){const _0x32dd2b=_0x4bf2ae[_0x270df1([0x66,0x65,0x61,0x74,0x75,0x72,0x65,0x73])];return!!_0x32dd2b&&(!!_0x32dd2b[_0x270df1([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x270df1([0x2a]))||!!_0x32dd2b[_0x270df1([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x270df1([0x41,0x49])));}function _0xe873af(){const _0x4f7daa=_0x4bf2ae[_0x270df1([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x64,0x48,0x6f,0x73,0x74,0x73])];if(!_0x4f7daa||0x0==_0x4f7daa[_0x270df1([0x6c,0x65,0x6e,0x67,0x74,0x68])])return!0x0;const {hostname:_0x286c3f}=new URL(window[_0x270df1([0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e])]['href']);if(_0x4f7daa[_0x270df1([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x286c3f))return!0x0;const _0x3e0ee7=_0x286c3f[_0x270df1([0x73,0x70,0x6c,0x69,0x74])](_0x270df1([0x2e]));return _0x4f7daa[_0x270df1([0x66,0x69,0x6c,0x74,0x65,0x72])](_0x57d404=>_0x57d404[_0x270df1([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x270df1([0x2a])))[_0x270df1([0x6d,0x61,0x70])](_0x216a60=>_0x216a60[_0x270df1([0x73,0x70,0x6c,0x69,0x74])](_0x270df1([0x2e])))[_0x270df1([0x66,0x69,0x6c,0x74,0x65,0x72])](_0x3ec6b7=>_0x3ec6b7[_0x270df1([0x6c,0x65,0x6e,0x67,0x74,0x68])]<=_0x3e0ee7[_0x270df1([0x6c,0x65,0x6e,0x67,0x74,0x68])])[_0x270df1([0x6d,0x61,0x70])](_0x5573cc=>Array(_0x3e0ee7[_0x270df1([0x6c,0x65,0x6e,0x67,0x74,0x68])]-_0x5573cc[_0x270df1([0x6c,0x65,0x6e,0x67,0x74,0x68])])[_0x270df1([0x66,0x69,0x6c,0x6c])](_0x5573cc[0x0]===_0x270df1([0x2a])?_0x270df1([0x2a]):'')[_0x270df1([0x63,0x6f,0x6e,0x63,0x61,0x74])](_0x5573cc))[_0x270df1([0x73,0x6f,0x6d,0x65])](_0xeec6b7=>_0x3e0ee7[_0x270df1([0x65,0x76,0x65,0x72,0x79])]((_0x4f4344,_0xc56c5a)=>_0xeec6b7[_0xc56c5a]===_0x4f4344||_0xeec6b7[_0xc56c5a]===_0x270df1([0x2a])));}function _0x5decc8(){return _0x1da51f&&_0x36e51b?new window[(_0x270df1([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0x1498e4,_0x1ede06)=>{_0x1da51f[_0x270df1([0x74,0x68,0x65,0x6e])](_0x1498e4,_0x1ede06),_0x36e51b[_0x270df1([0x74,0x68,0x65,0x6e])](_0x10d542=>{_0x10d542!=_0x270df1([0x56,0x61,0x6c,0x69,0x64])&&_0x1498e4(_0x10d542);},_0x1ede06);}):_0x1da51f||_0x36e51b||_0x270df1([0x56,0x61,0x6c,0x69,0x64]);}}function _0x3228a0(_0xd21d2b,_0x33b449){return new window[(_0x270df1([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x376ac5=>{if(_0x6901e8())return _0x376ac5(_0x270df1([0x56,0x61,0x6c,0x69,0x64]));_0x4e51dd(),_0x1a914b[_0x270df1([0x64,0x65,0x63,0x6f,0x72,0x61,0x74,0x65])](_0x270df1([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]));let _0x23217a=!0x1;const _0x2be2db=ot();function _0x2c1aaf(_0x48ffc4){return!!_0x48ffc4&&(typeof _0x48ffc4===_0x270df1([0x6f,0x62,0x6a,0x65,0x63,0x74])||typeof _0x48ffc4===_0x270df1([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]))&&typeof _0x48ffc4[_0x270df1([0x74,0x68,0x65,0x6e])]===_0x270df1([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e])&&typeof _0x48ffc4[_0x270df1([0x63,0x61,0x74,0x63,0x68])]===_0x270df1([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]);}function _0x13d743(_0x6d11c3){_0x6b2f00(_0x6d11c3)[_0x270df1([0x74,0x68,0x65,0x6e])](_0x2b5302=>{if(!_0x2b5302||_0x2b5302[_0x270df1([0x73,0x74,0x61,0x74,0x75,0x73])]!=_0x270df1([0x6f,0x6b]))return _0x270df1([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]);return _0x246ede(_0x44599f(_0x2be2db+_0x33b449))!=_0x2b5302[_0x270df1([0x76,0x65,0x72,0x69,0x66,0x69,0x63,0x61,0x74,0x69,0x6f,0x6e])]?_0x270df1([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]):_0x270df1([0x56,0x61,0x6c,0x69,0x64]);})[_0x270df1([0x74,0x68,0x65,0x6e])](_0x2e2e9a=>(_0x188d6c(),_0x2e2e9a),()=>{const _0x1ff122=_0xe67484();return null==_0x1ff122?(_0x188d6c(),_0x270df1([0x56,0x61,0x6c,0x69,0x64])):_0x270df1(_0x815566-_0x1ff122>(0x19f340e1^_0x48f680)?[0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]:[0x56,0x61,0x6c,0x69,0x64]);})[_0x270df1([0x74,0x68,0x65,0x6e])](_0x376ac5)[_0x270df1([0x63,0x61,0x74,0x63,0x68])](()=>{_0x376ac5(_0x270df1([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});const _0x5a128c=0x3dc92a61^_0x48f680;function _0x188d6c(){const _0x41b47d=_0x270df1([0x6c,0x6c,0x63,0x74,0x2d])+_0x246ede(_0x44599f(_0xd21d2b)),_0x2eb3ee=_0x1b2f82(_0x246ede(window[_0x270df1([0x4d,0x61,0x74,0x68])][_0x270df1([0x63,0x65,0x69,0x6c])](_0x815566/_0x5a128c)));window[_0x270df1([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0x270df1([0x73,0x65,0x74,0x49,0x74,0x65,0x6d])](_0x41b47d,_0x2eb3ee);}function _0xe67484(){const _0x46fa17=_0x270df1([0x6c,0x6c,0x63,0x74,0x2d])+_0x246ede(_0x44599f(_0xd21d2b)),_0x36a668=window[_0x270df1([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0x270df1([0x67,0x65,0x74,0x49,0x74,0x65,0x6d])](_0x46fa17);return _0x36a668?window[_0x270df1([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x1b2f82(_0x36a668),0x10)*_0x5a128c:null;}function _0x6b2f00(_0x41699e){return new window[(_0x270df1([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0x4697dc,_0x1fc651)=>{_0x41699e[_0x270df1([0x74,0x68,0x65,0x6e])](_0x4697dc,_0x1fc651),window[_0x270df1([0x73,0x65,0x74,0x54,0x69,0x6d,0x65,0x6f,0x75,0x74])](_0x1fc651,0x3dfe1021^_0x48f680);});}}_0x1a914b[_0x270df1([0x6f,0x6e])](_0x270df1([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),(_0x2f550d,_0x67e397)=>{if(_0x67e397[0x0]!=_0xd21d2b)return _0x376ac5(_0x270df1([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));_0x67e397[0x1]={..._0x67e397[0x1],[_0x270df1([0x72,0x65,0x71,0x75,0x65,0x73,0x74,0x49,0x64])]:_0x2be2db};},{[_0x270df1([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0x270df1([0x68,0x69,0x67,0x68])}),_0x1a914b[_0x270df1([0x6f,0x6e])](_0x270df1([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),_0x30d151=>{_0x2c1aaf(_0x30d151[_0x270df1([0x72,0x65,0x74,0x75,0x72,0x6e])])&&(_0x23217a=!0x0,_0x13d743(_0x30d151[_0x270df1([0x72,0x65,0x74,0x75,0x72,0x6e])]));},{[_0x270df1([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0x270df1([0x6c,0x6f,0x77])}),_0x4808eb[_0x270df1([0x74,0x68,0x65,0x6e])](()=>{_0x23217a||_0x376ac5(_0x270df1([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});});function _0x6901e8(){return _0x1a914b[_0x270df1([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0x270df1([0x76,0x69,0x65,0x77])][_0x270df1([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]==_0x270df1([0x61,0x75,0x74,0x6f]);}function _0x4e51dd(){_0x1a914b[_0x270df1([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0x270df1([0x76,0x69,0x65,0x77])][_0x270df1([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]=_0x270df1([0x61,0x75,0x74,0x6f]);}}function _0x31274d(_0xd408d1){const _0xa4ebbd=[new window[(_0x270df1([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x52af33=>setTimeout(_0x52af33,0x3df6fa2d^_0x48f680)),_0x4808eb[_0x270df1([0x74,0x68,0x65,0x6e])](()=>new window[(_0x270df1([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x1bb510=>{let _0x37a761=0x0;_0x1a914b[_0x270df1([0x6d,0x6f,0x64,0x65,0x6c])][_0x270df1([0x6f,0x6e])](_0x270df1([0x61,0x70,0x70,0x6c,0x79,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e]),(_0x1f1c15,_0x162907)=>{_0x162907[0x0][_0x270df1([0x69,0x73,0x44,0x6f,0x63,0x75,0x6d,0x65,0x6e,0x74,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e])]&&_0x37a761++,_0x37a761==(0x3dffc109^_0x48f680)&&(_0x1bb510(),_0x1f1c15[_0x270df1([0x6f,0x66,0x66])]());});}))];return window[_0x270df1([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65])][_0x270df1([0x72,0x61,0x63,0x65])](_0xa4ebbd)[_0x270df1([0x74,0x68,0x65,0x6e])](()=>_0xd408d1);}async function _0x190592(){await _0x4808eb,_0x1a914b[_0x270df1([0x6d,0x6f,0x64,0x65,0x6c])][_0x270df1([0x63,0x68,0x61,0x6e,0x67,0x65])]=_0x1a7509,_0x1a914b[_0x270df1([0x6d,0x6f,0x64,0x65,0x6c])][_0x270df1([0x65,0x6e,0x71,0x75,0x65,0x75,0x65,0x43,0x68,0x61,0x6e,0x67,0x65])]=_0x1a7509,_0x1a914b[_0x270df1([0x65,0x6e,0x61,0x62,0x6c,0x65,0x52,0x65,0x61,0x64,0x4f,0x6e,0x6c,0x79,0x4d,0x6f,0x64,0x65])](_0x270df1([0x6d,0x6f,0x64,0x65,0x6c]));}function _0x4afa17(_0xd3620d){const _0x479510=_0x476a83();_0x1a914b[_0x479510]=_0x270df1([0x61,0x69,0x4c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79])+_0xd3620d,_0xd3620d!=_0x270df1([0x56,0x61,0x6c,0x69,0x64])&&_0x190592();}function _0x476a83(){const _0xbfc6d3=window[_0x270df1([0x53,0x74,0x72,0x69,0x6e,0x67])](window[_0x270df1([0x70,0x65,0x72,0x66,0x6f,0x72,0x6d,0x61,0x6e,0x63,0x65])][_0x270df1([0x6e,0x6f,0x77])]())[_0x270df1([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](_0x270df1([0x2e]),'');let _0x4a6b4a=_0x270df1([0x6e]);for(let _0x5640c8=0x0;_0x5640c8<_0xbfc6d3[_0x270df1([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0x5640c8+=0x2){let _0x369bbe=window[_0x270df1([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0xbfc6d3[_0x270df1([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0x5640c8,_0x5640c8+0x2));_0x369bbe>=_0x40a386[_0x270df1([0x6c,0x65,0x6e,0x67,0x74,0x68])]&&(_0x369bbe-=_0x40a386[_0x270df1([0x6c,0x65,0x6e,0x67,0x74,0x68])]),_0x4a6b4a+=_0x40a386[_0x369bbe];}return _0x4a6b4a;}function _0x62c59f(){const _0x43d684=_0x3b4b26[_0x270df1([0x73,0x70,0x6c,0x69,0x74])](_0x270df1([0x2e]));if(0x3!=_0x43d684[_0x270df1([0x6c,0x65,0x6e,0x67,0x74,0x68])])return null;return _0x67747c(_0x43d684[0x1]);function _0x67747c(_0x58ea2b){const _0x3c1559=_0x323cf0(_0x58ea2b);return _0x3c1559&&_0xfc7cca()?_0x3c1559:null;function _0xfc7cca(){const _0x35073e=_0x3c1559[_0x270df1([0x6a,0x74,0x69])],_0x2c9a81=window[_0x270df1([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x35073e[_0x270df1([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0x35073e[_0x270df1([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8),0x10),_0x173d9e={..._0x3c1559,[_0x270df1([0x6a,0x74,0x69])]:_0x35073e[_0x270df1([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](0x0,_0x35073e[_0x270df1([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8)};return delete _0x173d9e[_0x270df1([0x76,0x63])],_0x44599f(_0x173d9e)==_0x2c9a81;}}}async function _0x32f7cd(){let _0x23ebf5=!0x0;try{const _0x26e9d3=_0x3b4b26[_0x270df1([0x73,0x70,0x6c,0x69,0x74])](_0x270df1([0x2e])),[_0x3ddba5,_0x45b3e9,_0xd673f4]=_0x26e9d3;return _0xf1c9b0(_0x3ddba5),await _0x3d4658(_0x3ddba5,_0x45b3e9,_0xd673f4),_0x23ebf5;}catch{return!0x1;}function _0xf1c9b0(_0x4dd561){const _0x23f164=_0x323cf0(_0x4dd561);_0x23f164&&_0x23f164[_0x270df1([0x61,0x6c,0x67])]==_0x270df1([0x45,0x53,0x32,0x35,0x36])||(_0x23ebf5=!0x1);}async function _0x3d4658(_0x4b3121,_0x317c4f,_0x3b751e){const _0x33f320=window[_0x270df1([0x55,0x69,0x6e,0x74,0x38,0x41,0x72,0x72,0x61,0x79])][_0x270df1([0x66,0x72,0x6f,0x6d])](_0xe129a6(_0x3b751e),_0x4b6c3c=>_0x4b6c3c[_0x270df1([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](0x0)),_0x3d72d7=new window[(_0x270df1([0x54,0x65,0x78,0x74,0x45,0x6e,0x63,0x6f,0x64,0x65,0x72]))]()[_0x270df1([0x65,0x6e,0x63,0x6f,0x64,0x65])](_0x4b3121+_0x270df1([0x2e])+_0x317c4f),_0x43508f=window[_0x270df1([0x63,0x72,0x79,0x70,0x74,0x6f])][_0x270df1([0x73,0x75,0x62,0x74,0x6c,0x65])];if(!_0x43508f)return;const _0x283b49=await _0x43508f[_0x270df1([0x69,0x6d,0x70,0x6f,0x72,0x74,0x4b,0x65,0x79])](_0x270df1([0x6a,0x77,0x6b]),_0x12acfa,{[_0x270df1([0x6e,0x61,0x6d,0x65])]:_0x270df1([0x45,0x43,0x44,0x53,0x41]),[_0x270df1([0x6e,0x61,0x6d,0x65,0x64,0x43,0x75,0x72,0x76,0x65])]:_0x270df1([0x50,0x2d,0x32,0x35,0x36])},!0x1,[_0x270df1([0x76,0x65,0x72,0x69,0x66,0x79])]);await _0x43508f[_0x270df1([0x76,0x65,0x72,0x69,0x66,0x79])]({[_0x270df1([0x6e,0x61,0x6d,0x65])]:_0x270df1([0x45,0x43,0x44,0x53,0x41]),[_0x270df1([0x68,0x61,0x73,0x68])]:{[_0x270df1([0x6e,0x61,0x6d,0x65])]:_0x270df1([0x53,0x48,0x41,0x2d,0x32,0x35,0x36])}},_0x283b49,_0x33f320,_0x3d72d7)||(_0x23ebf5=!0x1);}}function _0x323cf0(_0x5e3f0f){return _0x5e3f0f[_0x270df1([0x73,0x74,0x61,0x72,0x74,0x73,0x57,0x69,0x74,0x68])](_0x270df1([0x65,0x79]))?JSON[_0x270df1([0x70,0x61,0x72,0x73,0x65])](_0xe129a6(_0x5e3f0f)):null;}function _0xe129a6(_0x26c745){return window[_0x270df1([0x61,0x74,0x6f,0x62])](_0x26c745[_0x270df1([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/-/g,_0x270df1([0x2b]))[_0x270df1([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/_/g,_0x270df1([0x2f])));}function _0x44599f(_0x51ca94){let _0x47f863=0x1505;function _0x146d17(_0x30c693){for(let _0x187344=0x0;_0x187344<_0x30c693[_0x270df1([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0x187344++){const _0x26ef2b=_0x30c693[_0x270df1([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](_0x187344);_0x47f863=(_0x47f863<<0x5)+_0x47f863+_0x26ef2b,_0x47f863&=_0x47f863;}}function _0x317d74(_0x1a1bf9){Array[_0x270df1([0x69,0x73,0x41,0x72,0x72,0x61,0x79])](_0x1a1bf9)?_0x1a1bf9[_0x270df1([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](_0x317d74):_0x1a1bf9&&typeof _0x1a1bf9==_0x270df1([0x6f,0x62,0x6a,0x65,0x63,0x74])?Object[_0x270df1([0x65,0x6e,0x74,0x72,0x69,0x65,0x73])](_0x1a1bf9)[_0x270df1([0x73,0x6f,0x72,0x74])]()[_0x270df1([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](([_0x1c447e,_0x4b1205])=>{_0x146d17(_0x1c447e),_0x317d74(_0x4b1205);}):_0x146d17(window[_0x270df1([0x53,0x74,0x72,0x69,0x6e,0x67])](_0x1a1bf9));}return _0x317d74(_0x51ca94),_0x47f863>>>0x0;}function _0x246ede(_0x4e2c9e){return _0x4e2c9e[_0x270df1([0x74,0x6f,0x53,0x74,0x72,0x69,0x6e,0x67])](0x10)[_0x270df1([0x70,0x61,0x64,0x53,0x74,0x61,0x72,0x74])](0x8,_0x270df1([0x30]));}function _0x1b2f82(_0x326adb){return _0x326adb[_0x270df1([0x73,0x70,0x6c,0x69,0x74])]('')[_0x270df1([0x72,0x65,0x76,0x65,0x72,0x73,0x65])]()[_0x270df1([0x6a,0x6f,0x69,0x6e])]('');}function _0x1a7509(){}function _0x270df1(_0x39a4d6){return _0x39a4d6['map'](_0x587b3a=>String['fromCharCode'](_0x587b3a))['join']('');}_0x4afa17(await _0x329fb9());}(this);}['showFakeVisualSelection'](){const _0x2c83d2=this['editor']['model'];_0x2c83d2['change'](_0x210ca9=>{const _0x384b5d=_0x2c83d2['document']['selection']['getRanges']();let _0x5353ef=0x0;for(const _0xc59f17 of _0x384b5d){const _0xa6cad7=bi+':'+_0x5353ef;if(_0x2c83d2['markers']['has'](_0xa6cad7))_0x210ca9['updateMarker'](_0xa6cad7,{'range':_0xc59f17});else{if(_0xc59f17['start']['isAtEnd']){const _0x58fd62=_0xc59f17['start']['getLastMatchingPosition'](({item:_0x5dde31})=>!_0x2c83d2['schema']['isContent'](_0x5dde31),{'boundaries':_0xc59f17});_0x210ca9['addMarker'](_0xa6cad7,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x210ca9['createRange'](_0x58fd62,_0xc59f17['end'])});}else _0x210ca9['addMarker'](_0xa6cad7,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0xc59f17});}_0x5353ef++;}});}['hideFakeVisualSelection'](){const _0x31b5eb=this['editor']['model'],_0x43d8b6=Array['from'](this['editor']['model']['markers']['getMarkersGroup'](bi));_0x43d8b6['length']&&_0x31b5eb['change'](_0x31b9d1=>{_0x43d8b6['forEach'](_0x1a8de5=>{_0x31b9d1['removeMarker'](_0x1a8de5);});});}['insertContent'](_0x5510c7,_0x488cb5){const _0x483288=this['_getAISelection'](),_0x3a72f9=_0x488cb5||_0x483288['getFirstRange']();this['editor']['model']['canEditAt'](_0x3a72f9)&&this['editor']['model']['change'](_0x35f7be=>{this['hideFakeVisualSelection'](),_0x488cb5||this['_resetContentOfSelectedTableCells'](_0x35f7be,_0x483288),this['_pasteHTMLUsingClipboard']({'insertAt':_0x3a72f9,'writer':_0x35f7be,'html':_0x5510c7});});}['insertContentBelow'](_0x3026bb){const {model:_0x1384be}=this['editor'],_0x19f258=this['_getAISelection']();_0x1384be['change'](()=>{const _0x67e71e=this['_prepareTableInsertBelowPosition'](_0x3026bb,_0x19f258)||this['_getDefaultInsertBelowPosition'](_0x19f258);this['insertContent'](_0x3026bb,_0x67e71e);});}['_getAISelection'](){const _0x28d582=this['editor']['model'],_0x4dead8=Array['from'](_0x28d582['markers']['getMarkersGroup'](bi))['map'](_0x4b8e53=>_0x4b8e53['getRange']());return _0x28d582['createSelection'](_0x4dead8);}['_pasteHTMLUsingClipboard']({writer:_0xad9f38,html:_0x2584c5,insertAt:_0x3aa3ea}){const {view:_0x3ce8c8}=this['editor']['editing'],_0x34a62b=this['editor']['plugins']['get'](_0x1e7f5c),_0x3ff723=new fi();_0x3ff723['setData']('text/html',_0x2584c5);const _0x2e971f=new ClipboardEvent('paste',{'clipboardData':_0x3ff723}),_0x4e4bc8=new _0x4a5708(_0x3ce8c8,_0x2e971f,{'dataTransfer':new _0x14be18(_0x3ff723)});_0xad9f38['setSelection'](_0x3aa3ea);const _0x11e0f3=(_0x154bde,_0x58c072)=>{_0x58c072['resultRange']&&_0xad9f38['setSelection'](_0x58c072['resultRange']);};_0x34a62b['once']('contentInsertion',_0x11e0f3,{'priority':'lowest'}),_0x3ce8c8['document']['fire']('paste',_0x4e4bc8),_0x34a62b['off']('contentInsertion',_0x11e0f3);}['_getDefaultInsertBelowPosition'](_0x4fbb91){const {model:_0x5197a3}=this['editor'],_0x77059f=Array['from'](_0x4fbb91['getSelectedBlocks']());return _0x77059f['length']?_0x5197a3['createPositionAfter'](_0x77059f['pop']()):_0x4fbb91['getLastPosition']();}['_prepareTableInsertBelowPosition'](_0x329dea,_0x4e1c55){const {model:_0x279256,plugins:_0x3906d7}=this['editor'];if(_0x3906d7['has']('TableUtils')){const _0x262012=_0x3906d7['get']('TableUtils')['getSelectedTableCells'](_0x4e1c55);if(_0x262012['length']){const _0x57614a=this['_getTableRowCountFromContent'](_0x329dea),_0x5395bd=this['_createEmptyTableRows'](_0x262012,_0x57614a);return _0x279256['createPositionAt'](_0x5395bd,0x0);}}return null;}['_getTableRowCountFromContent'](_0x26f8a8){const _0x3d0041=this['editor']['plugins']['get']('TableUtils'),_0x486872=this['editor']['data']['parse'](_0x26f8a8),_0xc26cf9=Array['from'](_0x486872['getChildren']())['filter'](_0x46995d=>_0x46995d['is']('element','table'));let _0x3b08af=0x0;return _0xc26cf9['forEach'](_0x11c7be=>{_0x3b08af+=_0x3d0041['getRows'](_0x11c7be);}),_0x3b08af;}['_createEmptyTableRows'](_0x2d927a,_0x163835){const _0x5bdeaf=this['editor']['plugins']['get']('TableUtils'),_0x3b739f=_0x5bdeaf['getRowIndexes'](_0x2d927a),_0x2607f2=_0x5bdeaf['getColumnIndexes'](_0x2d927a),_0x43ca42=_0x3b739f['last']+0x1,_0x2f4c23=_0x2607f2['first'],_0x2358f0=_0x2d927a[0x0]['findAncestor']('table');for(let _0x2a6c39=0x0;_0x2a6c39<_0x163835;_0x2a6c39++)_0x5bdeaf['insertRows'](_0x2358f0,{'at':_0x43ca42});return _0x2358f0['getChild'](_0x43ca42)['getChild'](_0x2f4c23);}['_resetContentOfSelectedTableCells'](_0x16f2b5,_0x58cc67){const {plugins:_0xb959c7}=this['editor'],{model:_0x60f624}=_0x16f2b5;if(!_0xb959c7['has']('TableUtils'))return;_0xb959c7['get']('TableUtils')['getSelectedTableCells'](_0x58cc67)['length']&&_0x60f624['deleteContent'](_0x58cc67);}}class Ri extends _0x45b757{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(_0x4249bb){super(_0x4249bb),this['name']='AIRequestError';}}function ki(_0x1aa57e,_0x6a8d08,_0x8d787){const t=_0x1aa57e['t'];switch(_0x6a8d08){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',_0x8d787);case'Error\x20during\x20AI\x20content\x20generation:\x20%0':return t('Error\x20during\x20AI\x20content\x20generation:\x20%0',_0x8d787);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'},_0x8d787);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 _0x6a8d08;}}class Ni extends _0x65be43{['_commandDefinitions'];constructor(_0x3f52ed,_0x46f4be){super(_0x3f52ed),this['_commandDefinitions']=_0x46f4be,this['set']('enabledCommandsIds',[]),this['on']('change:_hasContext',(_0x4fa8a2,_0x401beb,_0x3d32b9)=>{this['isEnabled']&&(this['enabledCommandsIds']=vi(this['_commandDefinitions'],_0x3d32b9));}),this['set']('_hasContext',!0x1),this['on']('change:isEnabled',(_0x3d697c,_0x23debb,_0x2652af)=>{this['enabledCommandsIds']=_0x2652af?vi(this['_commandDefinitions'],this['_hasContext']):[];});}['refresh'](){const _0x1ce181=this['editor']['model'];this['_hasContext']=function(_0x69e0a1){const _0x88193f=_0x69e0a1['document']['selection'];return _0x88193f['isCollapsed']?0x0!==[..._0x88193f['getSelectedBlocks']()]['length']&&![..._0x88193f['getSelectedBlocks']()][0x0]['isEmpty']:!!_0x69e0a1['hasContent'](_0x88193f['getFirstRange']());}(_0x1ce181);const _0x167bc7=_0x1ce181['document']['selection'],_0x1536cf=this['editor']['config']['get']('ai.assistant.disabledElements');for(const _0x44d856 of _0x167bc7['getRanges']())for(const _0x190c9a of _0x44d856['getItems']())if(_0x190c9a['is']('element')&&_0x1536cf['includes'](_0x190c9a['name']))return void(this['isEnabled']=!0x1);this['isEnabled']=!0x0;}['execute'](_0x41cd85='',_0x2ef249='',_0x14182f='custom'){this['editor']['plugins']['get']($i)['showUI'](_0x41cd85,_0x2ef249,_0x14182f);}}function vi(_0x3387f0,_0xfd706d){const _0xfae70c=new Set();for(const _0x66f848 of _0x3387f0['values']())(_0xfd706d||!0x1===_0x66f848['requiresContent'])&&_0xfae70c['add'](_0x66f848['id']);return Array['from'](_0xfae70c);}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(_0xafc92a,_0x53f72e,_0x113e7a){super(),this['editor']=_0xafc92a,this['textAdapter']=_0x53f72e,this['_sanitizationContainer']=document['createElement']('div'),this['_domParser']=new DOMParser(),this['_xmlSerializer']=new XMLSerializer(),this['view']=_0x113e7a,this['set']({'initialContext':'','currentContext':'','currentResponse':'','previousContext':void 0x0,'previousQuery':void 0x0,'previousLabel':void 0x0,'isProcessing':!0x1}),this['on']('set:currentContext',(_0x4c615a,_0x2dcab3,_0x3c36f7)=>{this['view']['value']=this['_sanitizeHTML'](_0x3c36f7);}),this['listenTo'](this['view'],'submitPrompt',(_0x5b32f4,_0x121967)=>{const _0x2f4b85=this['currentContext']||this['initialContext'];this['_handleQuery'](_0x121967,_0x2f4b85,'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:_0xe61910,query:_0x37904d,htmlContent:_0x3e82dd,label:_0x3de8a9,mainActionLabel:_0x2ba237}){this['view']['prompt']=_0x3de8a9,this['view']['mainAction']=_0x2ba237,this['initialContext']=_0x3e82dd,_0x37904d&&(this['view']['isRendered']?this['_handleQuery'](_0x37904d,_0x3e82dd,_0xe61910,_0x3de8a9):this['view']['once']('render',()=>{this['_handleQuery'](_0x37904d,_0x3e82dd,_0xe61910,_0x3de8a9);}));}['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'](_0x4f0745,_0xc88692,_0x393fd7,_0x2132c0){return this['isProcessing']=!0x0,this['view']['startProcessing'](),this['previousContext']=_0xc88692,this['previousQuery']=_0x4f0745,this['previousLabel']=_0x2132c0||_0x4f0745,this['previousActionId']=_0x393fd7,new Promise(_0x4bcd4e=>{this['textAdapter']['makeRequest']({'query':_0x4f0745,'context':_0xc88692,'onData':_0x1c1486=>{this['currentResponse']=_0x1c1486,this['currentContext']=this['_parseAndNormalizeContent'](this['currentResponse']);},'actionId':_0x393fd7})['then'](()=>{!this['currentContext']&&this['currentResponse']&&(this['currentContext']=this['_parseAndNormalizeContent'](this['currentResponse'],!0x0));})['catch'](_0x28ae84=>{_0x28ae84 instanceof Oi?this['view']['handleError'](_0x28ae84['message']):this['view']['handleError'](),_0x4bcd4e();})['finally'](()=>{this['stopProcessing'](),_0x4bcd4e();});});}['_parseAndNormalizeContent'](_0x353e7e,_0x254e6a=!0x1){const _0x2cf07d=yi['exec'](_0x353e7e);_0x353e7e=_0x2cf07d?_0x353e7e['substring'](_0x2cf07d[0x1]['length']):_0x353e7e['length']<0x64&&!_0x254e6a?'':this['_stripMarkdownSyntax'](_0x353e7e);const _0x187083=this['_domParser']['parseFromString'](_0x353e7e,'text/html');if(_0x2cf07d){const _0x4167eb=Array['from'](_0x187083['body']['childNodes']);_0x4167eb['reverse']();for(const _0x3d4d9d of _0x4167eb){if(_0x3d4d9d['nodeType']==Node['ELEMENT_NODE'])break;_0x3d4d9d['remove']();}}const _0x53cec1=this['editor']['data']['processor']['toView'](this['_xmlSerializer']['serializeToString'](_0x187083['body']));this['_isH1TagSupportEnabled']()||this['_normalizeResponseHeadings'](_0x53cec1);const _0xaaec32=this['editor']['config']['get']('ai.assistant.preserveComments'),_0x2521e9=this['editor']['data']['toModel'](_0x53cec1);return _0xaaec32||_0x2521e9['markers']['clear'](),this['editor']['data']['stringify'](_0x2521e9);}['_normalizeResponseHeadings'](_0x5c125e){const _0x2db0bc=new _0x1d6502(this['editor']['editing']['view']['document']),_0x597704=new _0x542f4c({'name':/^h[1-5]$/}),_0x537617=[];let _0x2d35b7=!0x1;for(const _0x58e35b of _0x5c125e)_0x58e35b['is']('element')&&_0x597704['match'](_0x58e35b)&&(_0x537617['push'](_0x58e35b),'h1'==_0x58e35b['name']&&(_0x2d35b7=!0x0));if(_0x2d35b7){for(const _0x574d2b of _0x537617)_0x2db0bc['rename']('h'+(parseInt(_0x574d2b['name'][0x1])+0x1),_0x574d2b);}}['_isH1TagSupportEnabled'](){const {data:_0x2b7105,editing:_0x229602}=this['editor'],_0x10fef8=_0x2b7105['htmlProcessor']['toView']('<h1></h1>'),_0x5aafab=_0x2b7105['toView'](_0x2b7105['toModel'](_0x10fef8));return!!_0x229602['view']['domConverter']['viewToDom'](_0x5aafab)['querySelector']('h1');}['_sanitizeHTML'](_0x473525){return this['editor']['editing']['view']['domConverter']['setContentOf'](this['_sanitizationContainer'],_0x473525),this['_sanitizationContainer']['innerHTML'];}['_stripMarkdownSyntax'](_0x24d5c1){const _0x41526c=_0x24d5c1['trim']();return _0x41526c['startsWith']('```html')?_0x41526c['endsWith']('```')?_0x41526c['substring'](0x7,_0x41526c['length']-0x3):_0x41526c['substring'](0x7):_0x24d5c1;}}const Li={'REPLACE':'replace','INSERT':'insert'};class Di extends kt{constructor(_0x233551){super(_0x233551),this['set']('isVisible',!0x1),this['set']('mainAction',Li['REPLACE']),this['replaceButton']=this['_createButton']('','ck-button-action'),this['replaceButton']['bind']('label')['to'](this,'mainAction',_0x3f861e=>ki(_0x233551,'AI_'+_0x3f861e['toUpperCase']()+'_CONTENT')),this['insertButton']=this['_createButton'](ki(_0x233551,'Insert\x20below')),this['tryAgainButton']=this['_createButton'](ki(_0x233551,'Try\x20again')),this['stopButton']=this['_createButton'](ki(_0x233551,'Stop'));const _0x3e1307=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':['ck-ai-form__toolbar',_0x3e1307['if']('isVisible','ck-hidden',_0x16a85b=>!_0x16a85b)]}}),this['items']['addMany']([this['replaceButton'],this['insertButton'],this['tryAgainButton'],this['stopButton']]);}['_createButton'](_0x2f51d8,_0x4dccf3){const _0x521291=new Nt(this['locale']);return _0x521291['set']({'label':_0x2f51d8,'class':_0x4dccf3||'','isVisible':!0x0,'withText':!0x0}),_0x521291;}}class Pi extends vt{['contentFieldView'];['copyButtonView'];constructor(_0x5ebddf,_0x27902f=''){super(_0x5ebddf),this['set']({'value':null,'isVisible':!0x1,'isProcessing':!0x1});const _0x23caa6=this['bindTemplate'];this['contentFieldView']=new Hi(_0x5ebddf,_0x27902f),this['copyButtonView']=this['_createCopyButton'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area-wrapper',_0x23caa6['if']('isVisible','ck-hidden',_0x2cd025=>!_0x2cd025)],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area',_0x23caa6['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 _0x338002=!0x1;this['on']('change:value',(_0x4db046,_0x253660,_0x573d59)=>{const _0x4e9472=!this['contentFieldView']['element']['querySelector']('.ck-ai-form__loader');this['contentFieldView']['setContent'](_0x573d59),this['isProcessing']&&_0x4e9472&&!_0x338002&&this['element']['scrollTo']({'top':this['element']['scrollHeight'],'behavior':'smooth'});}),this['on']('change:isProcessing',(_0x45004d,_0x263721,_0x3d75bb)=>{_0x338002=!0x1,_0x3d75bb?(this['value']=null,this['contentFieldView']['appendLoader']()):this['value']||this['contentFieldView']['setContent']('');}),this['listenTo'](this['element'],'wheel',()=>{_0x338002=!0x0;}),this['listenTo'](this['element'],'mousedown',()=>{_0x338002=!0x0;});}['focus'](){this['element']['focus']();}['_createCopyButton'](){const _0x1ee017=this['locale'],_0x2433f9=new Nt(this['locale']),_0x1b8525='ck-ai-form__copy-button';return _0x2433f9['set']({'label':ki(_0x1ee017,'Copy'),'icon':_0x3640b5,'class':_0x1b8525,'tooltip':!0x0}),_0x2433f9['bind']('isVisible')['to'](this,'value',_0x1cc2a3=>!!_0x1cc2a3),_0x2433f9['bind']('isEnabled')['to'](this,'isProcessing',_0x265221=>!_0x265221),_0x2433f9['on']('execute',()=>{this['_copyHTMLToClipboard'](this['contentFieldView']['element']),_0x2433f9['icon']=_0x51a320,_0x2433f9['class']=_0x1b8525+'\x20ck-ai-form__copy-button--copied',this['focus'](),setTimeout(()=>{_0x2433f9['icon']=_0x3640b5,_0x2433f9['class']=_0x1b8525;},0x3e8);}),_0x2433f9;}['_copyHTMLToClipboard'](_0x33a803){const {window:_0x45388c,document:_0x475152}=ct;if(_0x45388c['ClipboardItem']){const {Blob:_0x44d6fa,ClipboardItem:_0x4f343e}=_0x45388c,_0x1fc39c=[new _0x4f343e({'text/html':new _0x44d6fa([_0x33a803['innerHTML']],{'type':'text/html'}),'text/plain':new _0x44d6fa([_0x33a803['textContent']||''],{'type':'text/plain'})})];navigator['clipboard']['write'](_0x1fc39c);}else{const _0x40d4e0=_0x475152['createElement']('div');_0x40d4e0['style']['position']='absolute',_0x40d4e0['style']['left']='-9999px',_0x40d4e0['innerHTML']='<span>[</span>'+_0x33a803['innerHTML']+'<span>]</span>',_0x475152['body']['appendChild'](_0x40d4e0);const _0x4d724f=_0x475152['createRange']();_0x4d724f['setStartAfter'](_0x40d4e0['firstElementChild']),_0x4d724f['setEndBefore'](_0x40d4e0['lastElementChild']);const _0x5a4879=_0x45388c['getSelection']();_0x5a4879['removeAllRanges'](),_0x5a4879['addRange'](_0x4d724f),_0x475152['execCommand']('copy'),_0x40d4e0['remove']();}}}class Hi extends vt{constructor(_0x3bc45d,_0x5137a7=''){super(_0x3bc45d),this['loaderView']=this['_createLoader'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-content',_0x5137a7,'ck-reset_all-excluded','ck-ai-form__content-field']}});}['setContent'](_0x18244){this['element']['innerHTML']=_0x18244;}['appendLoader'](){this['element']['appendChild'](this['loaderView']['element']);}['_createLoader'](){const _0x47e6ad=new vt(),_0x3bd30d=this['locale'],_0x141e35=new yt();return _0x141e35['isVisible']=!0x0,_0x47e6ad['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__loader']},'children':[_0x141e35,{'text':ki(_0x3bd30d,'AI\x20is\x20writing...')}]}),_0x47e6ad['render'](),_0x47e6ad;}}class Mi extends vt{constructor(_0x282b47,_0x63b329=''){super(_0x282b47);const _0x321b3e=new xt(),_0x4a88f2=this['bindTemplate'];this['set']('text',_0x63b329),_0x321b3e['content']=_0x39d323,this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__error']},'children':[_0x321b3e,{'text':_0x4a88f2['to']('text')}]});}}class Ui extends Lt{['submitButtonView'];['showHistoryButtonView'];constructor(_0x52da60,_0x2fe2e1){super(_0x52da60,_0x2fe2e1),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',(_0x35099e,_0x3a2ba4)=>{_0x35099e['target']==this['queryView']['fieldView']['element']&&(this['submit'](),_0x3a2ba4());});}['_createSubmitButton'](){const _0x3cb33f=new Nt(this['locale']),_0x109e42=this['locale'];return _0x3cb33f['set']({'icon':_0xbc92a7,'label':ki(_0x109e42,'Submit'),'isVisible':!0x0,'tooltip':!0x0,'class':'ck-ai-form__submit'}),_0x3cb33f['on']('execute',()=>{this['submit']();}),_0x3cb33f['bind']('isEnabled')['to'](this['queryView']['fieldView'],'isEmpty',this,'isEnabled',(_0x42466a,_0x46a05f)=>!_0x42466a&&_0x46a05f),_0x3cb33f;}['_createShowHistoryButton'](){const _0x1e5034=new Nt(this['locale']),_0x5be8eb=this['resultsView'],_0x1aa3f0=this['locale'];_0x1e5034['set']({'label':ki(_0x1aa3f0,'History'),'withText':!0x1,'icon':_0x578a8c,'tooltip':!0x0,'tooltipPosition':'sw','class':'ck-ai-form__toggle-history'}),_0x1e5034['bind']('isOn')['to'](_0x5be8eb,'isVisible'),_0x1e5034['bind']('isEnabled')['to'](this,'isEnabled'),_0x1e5034['on']('execute',()=>{_0x5be8eb['isVisible']=!_0x5be8eb['isVisible'],_0x5be8eb['isVisible']?this['filteredView']['focus']():this['focus']();});const _0x469b8f=()=>{ct['window']['requestAnimationFrame'](()=>{if(lt(this['element'])){const _0x48026a=new ut(this['queryView']['fieldView']['element']),_0x146106=_0x48026a['width'],_0x1ddea8='rtl'===_0x1aa3f0['uiLanguageDirection']?'left':'right';_0x48026a['excludeScrollbarsAndBorders'](),_0x1e5034['element']['style'][_0x1ddea8]=_0x146106-_0x48026a['width']+0x1+'px';}});};return this['queryView']['fieldView']['on']('update',_0x469b8f),this['on']('render',_0x469b8f),_0x1e5034;}['submit'](){const _0x5e970d=this['queryView']['fieldView']['element']['value'];this['fire']('submit',_0x5e970d);}['focus'](_0x2c085e){-0x1===_0x2c085e?this['focusCycler']['focusLast']():this['focusCycler']['focusFirst']();}}class Vi extends Dt{['historyGroupView'];['clearHistoryButton'];constructor(_0x177d88){super(_0x177d88),this['clearHistoryButton']=this['_createClearHistoryButton'](),this['historyGroupView']=new Pt(),this['historyGroupView']['children']['add'](this['clearHistoryButton'],0x1),this['historyGroupView']['label']=ki(_0x177d88,'Prompt\x20history'),this['historyGroupView']['items']['delegate']('execute')['to'](this),this['items']['add'](this['historyGroupView']);}['filter'](){let _0x5389f9=0x0;for(const _0x4fee28 of this['items'])_0x5389f9+=_0x4fee28['items']['length'];return{'resultsCount':_0x5389f9,'totalItemsCount':_0x5389f9};}['_createClearHistoryButton'](){const _0x4846f5=this['locale'],_0x8ca9ff=new Nt(this['locale']);return _0x8ca9ff['set']({'label':'('+ki(_0x4846f5,'Clear')+')','withText':!0x0}),_0x8ca9ff['on']('execute',()=>this['fire']('clearHistory')),_0x8ca9ff;}}class Bi extends Ht{constructor(_0x5005cb){super();const _0x543bec=new Mt(),_0x597932=new Nt(this['locale'],_0x543bec);this['children']['add'](_0x597932),_0x597932['set']({'label':_0x5005cb['prompt'],'withText':!0x0}),_0x597932['on']('execute',()=>{this['fire']('execute',{'value':_0x50891f(_0x5005cb['prompt'])});});}}const Gi='CKEditor/AIFormView/PromptHistory';class Fi extends dt{constructor(){super(),this['_loadFromSessionStorage'](),this['on']('add',(_0x3cda3d,_0x2715f9)=>{const _0x3f4314=Ki(_0x2715f9['prompt']);for(const _0x29a6e4 of this)if(_0x29a6e4!=_0x2715f9&&Ki(_0x29a6e4['prompt'])===_0x3f4314){this['remove'](_0x29a6e4);break;}this['length']>0x14&&this['remove'](this['last']),this['_saveToSessionStorage']();}),this['on']('remove',()=>{this['_saveToSessionStorage']();});}['_loadFromSessionStorage'](){const _0x4a203b=sessionStorage['getItem'](Gi)||'[]';this['addMany'](JSON['parse'](_0x4a203b));}['_saveToSessionStorage'](){sessionStorage['setItem'](Gi,JSON['stringify'](this['map'](_0x254efc=>_0x254efc)));}}function Ki(_0x4fabfc){return _0x4fabfc['toLowerCase']()['trim']();}class Wi extends vt{['focusTracker'];['keystrokes'];['contentArea'];['toolbar'];['promptView'];['errorView'];['_focusables'];['focusCycler'];['_promptHistory'];constructor(_0xefa9e3,_0x4c6fbc,_0x3291aa=''){super(_0xefa9e3),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(_0xefa9e3),this['contentArea']=new Pi(_0xefa9e3,_0x3291aa),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 _0xa31764=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form',_0x4c6fbc],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-form-content']},'children':[{'tag':'div','attributes':{'class':[_0xa31764['if']('isError','ck-hidden',_0x59461c=>!_0x59461c)]},'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'](_0x3b3409=0x1){-0x1===_0x3b3409?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 _0x110a1b=this['locale'],_0x58e870=new Ui(_0x110a1b,{'queryView':{'label':ki(_0x110a1b,'Ask\x20AI\x20to\x20edit\x20or\x20generate'),'creator':Vt,'showIcon':!0x1,'showResetButton':!0x1},'infoView':{'text':{'noSearchableItems':{'primary':ki(_0x110a1b,'Empty\x20history'),'secondary':ki(_0x110a1b,'Ask\x20AI\x20and\x20your\x20prompts\x20will\x20be\x20listed\x20here\x20for\x20you\x20to\x20use\x20later.')}}},'filteredView':this['_createHistoryView'](),'queryMinChars':0x1/0x0,'resetOnBlur':!0x1});return _0x58e870['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',(_0x176f54,_0x3f252d)=>_0x176f54&&!_0x3f252d),this['listenTo'](_0x58e870,'submit',(_0x498a8d,_0x284936)=>{this['prompt']=_0x284936;const _0x481d7a=_0x3e39fc(_0x284936);this['fire']('submitPrompt',_0x481d7a),_0x284936['trim']()&&this['_promptHistory']['add']({'prompt':_0x481d7a},0x0);},{'priority':'high'}),_0x58e870;}['_createHistoryView'](){const _0x2a2b67=new Vi(this['locale']);return _0x2a2b67['historyGroupView']['items']['bindTo'](this['_promptHistory'])['as'](Bi),_0x2a2b67['on']('clearHistory',()=>{this['_promptHistory']['clear'](),this['promptView']['search'](''),this['promptView']['focus']();}),_0x2a2b67;}['_createToolbar'](){const _0x178803=new Di(this['locale']);return _0x178803['replaceButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',this,'value',(_0x223369,_0x4a16aa,_0x3d0e2a)=>_0x223369&&!_0x4a16aa&&!!_0x3d0e2a),_0x178803['replaceButton']['delegate']('execute')['to'](this,'replaceContent'),_0x178803['insertButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',this,'value',(_0x133ecc,_0x4294a2,_0x109090)=>_0x133ecc&&!_0x4294a2&&!!_0x109090),_0x178803['insertButton']['delegate']('execute')['to'](this,'insertContentBelow'),_0x178803['tryAgainButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',(_0x56c72d,_0x34e9d9)=>_0x56c72d&&!_0x34e9d9),_0x178803['tryAgainButton']['delegate']('execute')['to'](this,'tryAgainEvent'),_0x178803['stopButton']['bind']('isEnabled')['to'](this,'isProcessing'),_0x178803['stopButton']['delegate']('execute')['to'](this,'stopProcessing'),_0x178803;}['startProcessing'](){this['value']='',this['isError']=!0x1,this['isProcessing']=!0x0,this['contentArea']['isVisible']=!0x0,this['toolbar']['isVisible']=!0x0,this['contentArea']['focus']();}['finishProcessing'](){const _0x184d29=this['locale'];this['isProcessing']=!0x1,this['prompt']='',this['promptView']['reset'](),this['value']&&(this['promptView']['queryView']['label']=ki(_0x184d29,'Ask\x20AI\x20to\x20improve\x20generated\x20text'));}['handleError'](_0x4e590b){const _0x5f4d69=this['locale'];this['finishProcessing'](),this['isError']=!0x0,this['errorView']['text']=_0x4e590b||ki(_0x5f4d69,'AI_ERROR_FAILED'),this['value']||(this['contentArea']['isVisible']=!0x1);}}const Yi=globalThis['DataTransfer'];class $i extends _0x45b757{['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[_0x197a4b,Si,Ri,Bt];}constructor(_0x1ab70c){super(_0x1ab70c),_0x1ab70c['config']['define']('ai.assistant.disabledElements',['media','rawHtml','tableOfContents']),_0x1ab70c['config']['define']('ai.assistant.contentAreaCssClass',''),_0x1ab70c['config']['define']('ai.assistant.useTheme',!0x0),this['_uiCssClasses']='ck-ai-assistant-ui'+(_0x1ab70c['config']['get']('ai.assistant.useTheme')?'\x20ck-ai-assistant-ui_theme':'');}['init'](){const {editor:_0x90f422}=this;this['_aiAdapter']=_0x90f422['plugins']['get'](Ri),this['_dialog']=_0x90f422['plugins']['get'](Bt),this['_formView']=null,this['_commandDefinitions']=this['_getResolvedCommandsDefinitions']();const _0x525246=new Ni(_0x90f422,Array['from'](this['_commandDefinitions']['values']()));_0x90f422['commands']['add']('showAIAssistant',_0x525246),_0x90f422['ui']['componentFactory']['add']('aiCommands',_0x86b381=>{const _0x33ac63=Gt(_0x86b381);return _0x33ac63['set']({'class':'ck-ai-commands-dropdown\x20'+this['_uiCssClasses']}),_0x33ac63['buttonView']['set']({'label':ki(_0x86b381,'AI\x20Commands'),'icon':_0x2140f1,'tooltip':!0x0}),_0x33ac63['on']('execute',_0x350520=>this['_onExecute'](_0x350520['source']['id'])),Ft(_0x33ac63,_0x90f422['ui']['view']['body'],function(_0x424334){const _0x507290=wi(_0x424334['config']['get']('ai.assistant.commands'),_0x424334['locale']),_0x20fe73=Qi(_0x424334,_0x507290)['filter'](_0x3e7617=>_0x3e7617['commands']['length']);if(0x1===_0x20fe73['length'])return Qi(_0x424334,_0x20fe73[0x0]['commands'])['map'](_0x572a6c=>({'id':_0x572a6c['id'],'label':_0x572a6c['label']}));return _0x20fe73['map'](_0x564ef4=>{const {groupId:_0x1601de,groupLabel:_0xdf648d,commands:_0x314cd9}=_0x564ef4,_0x3f7523=Qi(_0x424334,_0x314cd9)['map'](_0x416c9b=>({'id':_0x416c9b['id'],'label':_0x416c9b['label']}));return{'id':_0x1601de,'menu':_0xdf648d||_0x1601de,'children':_0x3f7523};});}(_0x90f422),{'ariaLabel':ki(_0x86b381,'AI\x20Commands')}),_0x33ac63['menuView']['menuPanelClass']='ck-ai-commands-dropdown\x20'+this['_uiCssClasses'],_0x525246['on']('change:enabledCommandsIds',_0x1308f7),_0x33ac63['menuView']['once']('render',_0x1308f7),_0x33ac63;function _0x1308f7(){_0x33ac63['isEnabled']=_0x525246['enabledCommandsIds']['length']>0x0;for(const _0x32ae46 of _0x33ac63['menuView']['buttons'])_0x32ae46['isEnabled']=_0x525246['enabledCommandsIds']['includes'](_0x32ae46['id']);}}),_0x90f422['ui']['componentFactory']['add']('menuBar:aiCommands',_0x9d3b7c=>{const _0x1097ce=new Kt(_0x9d3b7c);_0x1097ce['buttonView']['set']({'label':ki(_0x9d3b7c,'AI\x20Commands'),'icon':_0x2140f1}),_0x1097ce['bind']('isEnabled')['to'](_0x525246,'enabledCommandsIds',_0x31098d=>_0x31098d['length']>0x0);const _0x428264=wi(_0x90f422['config']['get']('ai.assistant.commands'),_0x9d3b7c);return this['_populateMenuBarMenu'](_0x525246,_0x1097ce,_0x428264,_0x3f59fb=>this['_onExecute'](_0x3f59fb)),_0x1097ce;}),_0x90f422['ui']['componentFactory']['add']('aiAssistant',()=>{const _0x13392c=this['_createAIAssistantUIButton'](Nt);return _0x13392c['set']({'tooltip':!0x0,'class':'ck-ai-assistant-button\x20'+this['_uiCssClasses']}),_0x13392c;}),_0x90f422['ui']['componentFactory']['add']('menuBar:aiAssistant',()=>{const _0x25cbe0=this['_createAIAssistantUIButton'](Wt);return _0x25cbe0['set']({'role':'menuitemcheckbox'}),_0x25cbe0;}),this['licenseKey']=this['editor']['config']['get']('licenseKey');const _0x6a3ae=this['editor'];this['_licenseKeyCheckInterval']=setInterval(()=>{let _0x2692c0;for(const _0x41f6ce in _0x6a3ae){const _0x5a8edb=_0x41f6ce,_0x438fbc=_0x6a3ae[_0x5a8edb];if('aiLicenseKeyValid'==_0x438fbc||'aiLicenseKeyInvalid'==_0x438fbc||'aiLicenseKeyExpired'==_0x438fbc||'aiLicenseKeyDomainLimit'==_0x438fbc||'aiLicenseKeyNotAllowed'==_0x438fbc||'aiLicenseKeyEvaluationLimit'==_0x438fbc||'aiLicenseKeyUsageLimit'==_0x438fbc){delete _0x6a3ae[_0x5a8edb],_0x2692c0=_0x438fbc,clearInterval(this['_licenseKeyCheckInterval']),this['_licenseKeyCheckInterval']=void 0x0;break;}}'aiLicenseKeyInvalid'==_0x2692c0&&_0x6a3ae['_showLicenseError']('invalid'),'aiLicenseKeyExpired'==_0x2692c0&&_0x6a3ae['_showLicenseError']('expired'),'aiLicenseKeyDomainLimit'==_0x2692c0&&_0x6a3ae['_showLicenseError']('domainLimit'),'aiLicenseKeyNotAllowed'==_0x2692c0&&_0x6a3ae['_showLicenseError']('featureNotAllowed','AIAssistant'),'aiLicenseKeyEvaluationLimit'==_0x2692c0&&_0x6a3ae['_showLicenseError']('evaluationLimit'),'aiLicenseKeyUsageLimit'==_0x2692c0&&_0x6a3ae['_showLicenseError']('usageLimit');},0x3e8);}['destroy'](){super['destroy'](),this['_licenseKeyCheckInterval']&&clearInterval(this['_licenseKeyCheckInterval']);}['showUI'](_0x31bb30='',_0x2a3a83='',_0x3ed735='custom'){const _0xf87d64=this['editor'],_0x4c8ad5=_0xf87d64['editing']['view'],_0x589731=_0xf87d64['plugins']['get'](Si),_0x27d5d0=_0xf87d64['plugins']['get'](_0x197a4b);_0x589731['showFakeVisualSelection']();const _0xba304c=new Yi(),_0x3a4ca5=new ClipboardEvent('copy',{'clipboardData':_0xba304c}),_0x409119=new _0x14be18(_0xba304c),_0x9717d3=new _0x4a5708(_0x4c8ad5,_0x3a4ca5,{'dataTransfer':_0x409119});_0x27d5d0['_forceMarkersCopy']('comment',()=>{_0x4c8ad5['document']['fire']('copy',_0x9717d3);}),this['_formView']||(this['_initView'](),this['_aiAssistantController']=new xi(_0xf87d64,this['_aiAdapter']['textAdapter'],this['_formView']));let _0x1ba38e=_0x409119['getData']('text/html');const _0x9a18a6=_0xf87d64['model']['document']['selection'],_0x7655eb=Array['from'](_0x9a18a6['getRanges']());0x1===_0x7655eb['length']&&_0x7655eb[0x0]['isFlat']&&!_0x9a18a6['getSelectedElement']()&&''!==_0x1ba38e['replace'](/ /g,'')['trim']()&&(_0x1ba38e='<p>'+_0x1ba38e+'</p>'),this['_aiAssistantController']['updateView']({'actionId':_0x3ed735,'query':_0x31bb30,'htmlContent':_0x1ba38e,'label':_0x2a3a83,'mainActionLabel':Li[_0xf87d64['model']['document']['selection']['isCollapsed']?'INSERT':'REPLACE']}),'aiAssistant'!==this['_dialog']['id']?this['_dialog']['show']({'id':'aiAssistant','icon':_0x201c7c,'title':ki(this['editor']['locale'],'AI\x20Assistant'),'content':this['_formView'],'position':Yt['EDITOR_TOP_SIDE'],'onShow':()=>{this['_formView']['focus']();},'onHide':()=>{this['_aiAssistantController']['reset'](),_0x589731['hideFakeVisualSelection']();}}):this['_dialog']['view']['wasMoved']||this['_dialog']['view']['updatePosition']();}['hideUI'](){this['_dialog']['hide']();}['_getResolvedCommandsDefinitions'](){const _0x2e9b1c=new Map(),_0x108ac9=wi(this['editor']['config']['get']('ai.assistant.commands'),this['editor']['locale']);for(const _0x35ed67 of _0x108ac9)for(const _0xdf6b2 of _0x35ed67['commands'])_0x2e9b1c['set'](_0xdf6b2['id'],{..._0xdf6b2,'groupId':_0x35ed67['groupId'],'groupLabel':_0x35ed67['groupLabel']||_0x35ed67['groupId']});return _0x2e9b1c;}['_createAIAssistantUIButton'](_0x85257c){const _0x26db45=this['editor'],_0x3ca669=_0x26db45['commands']['get']('showAIAssistant'),_0x1439a0=new _0x85257c(_0x26db45['locale']);return _0x1439a0['set']({'label':ki(_0x26db45['locale'],'AI\x20Assistant'),'icon':_0x201c7c,'isToggleable':!0x0}),_0x1439a0['bind']('isEnabled')['to'](_0x3ca669),_0x1439a0['bind']('isOn')['to'](this['_dialog'],'id',_0xaec475=>'aiAssistant'===_0xaec475),this['listenTo'](_0x1439a0,'execute',()=>{_0x1439a0['isOn']?this['hideUI']():_0x3ca669['execute']();}),_0x1439a0;}['_initView'](){const _0x139679=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',()=>{_0x139679['insertContent'](this['_aiAssistantController']['currentContext']),this['hideUI']();}),this['listenTo'](this['_formView'],'insertContentBelow',()=>{_0x139679['insertContentBelow'](this['_aiAssistantController']['currentContext']),this['hideUI']();}),this['_initAriaAiStatusChangeAnnouncements']();}['_initAriaAiStatusChangeAnnouncements'](){const {locale:_0x76edfa,ui:{ariaLiveAnnouncer:_0x7ca24f}}=this['editor'];this['_formView']['contentArea']['on']('change:isProcessing',(_0x80b800,_0x29c823,_0x43f4cb)=>{const _0x581405=this['_aiAssistantController']['currentContext'];_0x43f4cb?_0x7ca24f['announce'](ki(_0x76edfa,'AI\x20is\x20writing')):_0x581405&&_0x7ca24f['announce'](ki(_0x76edfa,'Generated\x20content:\x20%0',_0x581405),{'politeness':'polite','isUnsafeHTML':!0x0});}),this['_formView']['on']('change:isError',(_0x597c69,_0x5698e4,_0x404861)=>{if(_0x404861){const _0x2cc71a=this['_formView']['errorView']['text'];_0x7ca24f['announce'](ki(_0x76edfa,'Error\x20during\x20AI\x20content\x20generation:\x20%0',_0x2cc71a));}});}['_onExecute'](_0x5f1737){const _0x165ba4=this['_commandDefinitions']['get'](_0x5f1737),_0x485352=this['editor'],_0x596549=_0x485352['model']['document']['selection'],_0x1f95f7=_0x485352['commands']['get']('showAIAssistant'),_0xc27728=_0x485352['plugins']['get'](Si),_0x3ff4ad=''+(_0x165ba4['groupId']!==Ci?_0x165ba4['groupLabel']+':\x20':'')+_0x165ba4['label'];if(!0x1!==_0x165ba4['requiresContent']&&_0x596549['isCollapsed']){const _0x5cfc85=At(_0x596549['getSelectedBlocks']())||_0x485352['model']['schema']['getLimitElement'](_0x596549);_0x485352['model']['change'](_0x1099a3=>{_0x1099a3['setSelection'](_0x5cfc85,'in');});}_0xc27728['showFakeVisualSelection'](),_0x1f95f7['execute'](_0x165ba4['prompt'],_0x3ff4ad,'command:'+_0x5f1737);}['_populateMenuBarMenu'](_0x733901,_0x23271b,_0x5f207f,_0x20162b){const _0x50d642=this['editor'],_0x58b210=_0x50d642['locale'],_0x5278a1=new $t(_0x58b210),_0x3fa83c=Qi(_0x50d642,_0x5f207f)['filter'](_0x5bae15=>_0x5bae15['commands']['length']);0x1===_0x3fa83c['length']?this['_getMenuBarGroupButtons']({'command':_0x733901,'commands':_0x3fa83c[0x0]['commands'],'parentMenuView':_0x23271b,'onExecute':_0x20162b})['forEach'](_0x4792d5=>_0x5278a1['items']['add'](_0x4792d5)):_0x3fa83c['forEach'](({groupId:_0xb79a15,groupLabel:_0x3b0725,commands:_0x4c9541})=>{const _0x1e5982=new qt(_0x58b210,_0x23271b),_0x1a73c4=new Kt(_0x58b210),_0xc12679=new $t(_0x58b210),_0x585a32=this['_getMenuBarGroupButtons']({'command':_0x733901,'commands':_0x4c9541,'parentMenuView':_0x1a73c4,'onExecute':_0x20162b});_0x1a73c4['buttonView']['set']({'label':_0x3b0725||_0xb79a15}),_0x1a73c4['delegate']('execute')['to'](_0x23271b),_0xc12679['items']['addMany'](_0x585a32),_0x1a73c4['panelView']['children']['add'](_0xc12679),_0x1e5982['children']['add'](_0x1a73c4),_0x5278a1['items']['add'](_0x1e5982);}),_0x23271b['panelView']['children']['add'](_0x5278a1);}['_getMenuBarGroupButtons']({command:_0x48d83e,commands:_0x108786,parentMenuView:_0x597e30,onExecute:_0xb86f91}){const _0x2201c3=this['editor'],_0x581c98=_0x2201c3['locale'];return Qi(_0x2201c3,_0x108786)['map'](_0x1675fd=>{const _0x27b672=new qt(_0x581c98,_0x597e30),_0x489f2c=new Wt(_0x581c98);return _0x489f2c['set']({'label':_0x1675fd['label']}),_0x489f2c['delegate']('execute')['to'](_0x597e30),_0x489f2c['on']('execute',()=>_0xb86f91(_0x1675fd['id'])),_0x489f2c['bind']('isEnabled')['to'](_0x48d83e,'enabledCommandsIds',_0x5c2981=>_0x5c2981['includes'](_0x1675fd['id'])),_0x27b672['children']['add'](_0x489f2c),_0x27b672;});}}function qi(_0x536eca,_0x1009a3){return void 0x0!==_0x536eca['order']&&void 0x0===_0x1009a3['order']?0x1:void 0x0===_0x536eca['order']&&void 0x0!==_0x1009a3['order']?-0x1:void 0x0!==_0x536eca['order']&&void 0x0!==_0x1009a3['order']?_0x536eca['order']-_0x1009a3['order']:0x0;}function Qi(_0x1af651,_0x5a16b3){_0x5a16b3['sort'](qi);const _0x21314c={},_0x5af8ff=[];for(const _0x458fd4 of _0x5a16b3)if(void 0x0!==_0x458fd4['order']){if(_0x458fd4['order']in _0x21314c)throw new at('ai-commands-config-order-collision',_0x1af651,{'conflictingDefinitions':[_0x458fd4,_0x21314c[_0x458fd4['order']]]});_0x21314c[_0x458fd4['order']]=_0x458fd4,_0x5af8ff['splice'](_0x458fd4['order'],0x0,_0x458fd4);}else _0x5af8ff['push'](_0x458fd4);return _0x5af8ff;}class Xi extends _0x45b757{static get['requires'](){return[$i,Si];}static get['pluginName'](){return'AIAssistant';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0xc09c3f){super(_0xc09c3f);const _0x4e7b6d=_0xc09c3f['config'],_0x5efa19=_0xc09c3f['locale'];_0x4e7b6d['define']('ai.assistant.preserveComments',!0x0),_0x4e7b6d['define']('ai.assistant.commands',zi(_0x5efa19)),_0x4e7b6d['define']('ai.assistant.extraCommandGroups',[]),_0x4e7b6d['define']('ai.assistant.removeCommands',[]);let _0x432ebf=wi(_0x4e7b6d['get']('ai.assistant.commands'),_0x5efa19);const _0xf5e154=_0x4e7b6d['get']('ai.assistant.extraCommandGroups'),_0x5bf00a=_0x4e7b6d['get']('ai.assistant.removeCommands');_0xf5e154['forEach'](_0x3dbab2=>{const _0x406a81=_0x432ebf['find'](_0x1c5f8a=>_0x1c5f8a['groupId']===_0x3dbab2['groupId']);_0x406a81?_0x406a81['commands']=_0x406a81['commands']['concat'](_0x3dbab2['commands']):_0x432ebf['push'](_0x3dbab2);}),_0x432ebf=_0x432ebf['filter'](_0x4f66f6=>!_0x5bf00a['includes'](_0x4f66f6['groupId'])),_0x432ebf['forEach'](_0x439bb4=>{_0x439bb4['commands']=_0x439bb4['commands']['filter'](_0x2a24f6=>!_0x5bf00a['includes'](_0x2a24f6['id']));}),_0x4e7b6d['set']('ai.assistant.commands',_0x432ebf);}}function zi(_0x1afe89){return[{'groupId':'editOrReview','groupLabel':ki(_0x1afe89,'Edit\x20or\x20review'),'commands':[{'id':'improveWriting','label':ki(_0x1afe89,'Improve\x20writing'),'prompt':'Fix\x20spelling\x20mistakes,\x20use\x20proper\x20grammar\x20and\x20apply\x20good\x20writing\x20practices.\x20Do\x20not\x20lose\x20the\x20original\x20meaning.'},{'id':'makeShorter','label':ki(_0x1afe89,'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(_0x1afe89,'Make\x20longer'),'prompt':'Improve\x20this\x20content\x20by\x20using\x20descriptive\x20language\x20and\x20inserting\x20more\x20information\x20and\x20more\x20detailed\x20explanations.'},{'id':'simplifyLanguage','label':ki(_0x1afe89,'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(_0x1afe89,'Generate\x20from\x20selection'),'commands':[{'id':'summarize','label':ki(_0x1afe89,'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(_0x1afe89,'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(_0x1afe89,'Change\x20tone'),'commands':[{'id':'professional','label':ki(_0x1afe89,'Professional'),'prompt':'Improve\x20using\x20polished,\x20formal,\x20and\x20respectful\x20language\x20to\x20convey\x20professional\x20expertise\x20and\x20competence.'},{'id':'casual','label':ki(_0x1afe89,'Casual'),'prompt':'Improve\x20using\x20casual,\x20informal\x20language\x20to\x20convey\x20a\x20casual\x20conversation\x20with\x20a\x20real\x20person.'},{'id':'direct','label':ki(_0x1afe89,'Direct'),'prompt':'Improve\x20using\x20direct\x20language,\x20using\x20only\x20the\x20essential\x20information.'},{'id':'confident','label':ki(_0x1afe89,'Confident'),'prompt':'Improve\x20using\x20compelling,\x20optimistic\x20language\x20to\x20convey\x20confidence\x20in\x20the\x20writing.'},{'id':'friendly','label':ki(_0x1afe89,'Friendly'),'prompt':'Improve\x20using\x20friendly,\x20comforting\x20language,\x20to\x20convey\x20understanding\x20and\x20empathy.'}]},{'groupId':'changeStyle','groupLabel':ki(_0x1afe89,'Change\x20style'),'commands':[{'id':'business','label':ki(_0x1afe89,'Business'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20business\x20professional\x20with\x20formal\x20language.'},{'id':'legal','label':ki(_0x1afe89,'Legal'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20legal\x20professional\x20using\x20valid\x20legal\x20terminology.'},{'id':'journalism','label':ki(_0x1afe89,'Journalism'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20journalist\x20using\x20engaging\x20language\x20to\x20convey\x20the\x20importance\x20of\x20the\x20information.'},{'id':'poetic','label':ki(_0x1afe89,'Poetic'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20poem\x20using\x20poetic\x20techniques\x20without\x20losing\x20the\x20original\x20meaning.'}]},{'groupId':'translate','groupLabel':ki(_0x1afe89,'Translate'),'commands':[{'id':'translateEnglish','label':ki(_0x1afe89,'English'),'prompt':'Translate\x20the\x20content\x20to\x20English\x20language.'},{'id':'translateSpanish','label':ki(_0x1afe89,'Spanish'),'prompt':'Translate\x20the\x20content\x20to\x20Spanish\x20language.'},{'id':'translatePortuguese','label':ki(_0x1afe89,'Portuguese'),'prompt':'Translate\x20the\x20content\x20to\x20Portuguese\x20language.'},{'id':'translateGerman','label':ki(_0x1afe89,'German'),'prompt':'Translate\x20the\x20content\x20to\x20German\x20language.'},{'id':'translateFrench','label':ki(_0x1afe89,'French'),'prompt':'Translate\x20the\x20content\x20to\x20French\x20language.'},{'id':'translateChinese','label':ki(_0x1afe89,'Simplified\x20Chinese'),'prompt':'Translate\x20the\x20content\x20to\x20Simplified\x20Chinese\x20language.'},{'id':'translateHindi','label':ki(_0x1afe89,'Hindi'),'prompt':'Translate\x20the\x20content\x20to\x20Hindi\x20language.'},{'id':'translateArabic','label':ki(_0x1afe89,'Arabic'),'prompt':'Translate\x20the\x20content\x20to\x20Arabic\x20language.'}]}];}class ji extends _0x45b757{['abortController'];static get['requires'](){return[Ri];}constructor(_0x397d7d){super(_0x397d7d),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'](_0x5b929e){return this['sendRequest'](_0x5b929e)['catch'](_0x420d03=>{if(_0x420d03 instanceof Oi)return Promise['reject'](_0x420d03);if('AbortError'==_0x420d03['name'])return Promise['resolve']();throw console['error'](_0x420d03),new at('aitextadapter-send-request-failed',null);});}async['_prepareRequestHeaders'](_0x2a9d74,_0x1bc6b3){const _0x3082a8=this['editor']['locale'],_0x451aaa={'Content-Type':'application/json'};if('object'==typeof _0x2a9d74)Object['assign'](_0x451aaa,_0x2a9d74);else{if(_0x2a9d74)try{const _0x57b4c9=await _0x2a9d74(_0x1bc6b3);Object['assign'](_0x451aaa,_0x57b4c9);}catch{return Promise['reject'](new Oi(ki(_0x3082a8,'AI_ERROR_GET_HEADERS')));}}return _0x451aaa;}async['_prepareRequestParameters'](_0x40e19d,_0x1d918d){const _0x2da9b3=this['editor']['locale'];if('object'==typeof _0x40e19d)return _0x40e19d;try{return await _0x40e19d(_0x1d918d);}catch{return Promise['reject'](new Oi(ki(_0x2da9b3,'AI_ERROR_GET_PARAMETERS')));}}}class Ji extends ji{['_apiUrl'];['_requestHeaders'];['_requestParameters'];static get['pluginName'](){return'OpenAITextAdapter';}constructor(_0x2dd5d8){super(_0x2dd5d8),_0x2dd5d8['config']['define']('ai.assistant.adapter.openAI.apiUrl','https://api.openai.com/v1/chat/completions'),_0x2dd5d8['config']['get']('ai.assistant.adapter.openAI.requestParameters')||_0x2dd5d8['config']['define']('ai.assistant.adapter.openAI.requestParameters',{'model':'gpt-4o','temperature':0x1,'top_p':0x1,'stream':!0x0}),this['_apiUrl']=_0x2dd5d8['config']['get']('ai.assistant.adapter.openAI.apiUrl'),this['_requestHeaders']=_0x2dd5d8['config']['get']('ai.assistant.adapter.openAI.requestHeaders')||{},this['_requestParameters']=_0x2dd5d8['config']['get']('ai.assistant.adapter.openAI.requestParameters');}async['sendRequest']({query:_0xd6b57e,context:_0x1a4c87,onData:_0x2375df,actionId:_0x453dbe}){const _0x3c684d=this['editor']['locale'],_0x5bac22=await this['prepareMessages'](_0xd6b57e,_0x1a4c87,_0x453dbe),_0x22901f=await this['_prepareRequestHeaders'](this['_requestHeaders'],_0x453dbe),_0x4d972c=await this['_prepareRequestParameters'](this['_requestParameters'],_0x453dbe),_0x57b582={'messages':_0x5bac22,..._0x4d972c},_0x10dc27={'method':'POST','headers':_0x22901f,'body':JSON['stringify'](_0x57b582),'signal':this['abortController']['signal']},_0x288e8f=await fetch(this['_apiUrl'],_0x10dc27);if(_0x288e8f['ok'])return _0x4d972c['stream']?await this['_readStreamableResponse'](_0x288e8f,_0x2375df):await this['_readStaticResponse'](_0x288e8f,_0x2375df),Promise['resolve']();{const _0x20583e=await _0x288e8f['text']();return _0x20583e['includes']('context_length_exceeded')?Promise['reject'](new Oi(ki(_0x3c684d,'AI_ERROR_CONTEXT_LENGTH'))):_0x20583e['includes']('Moderation')?Promise['reject'](new Oi(ki(_0x3c684d,'AI_ERROR_MODERATION'))):Promise['reject'](new Error(_0x20583e));}}async['prepareMessages'](_0x11c45e,_0x70b10f,_0x37a7f8){let _0x3913ad,_0x386806;return _0x70b10f?(_0x3913ad='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.',_0x386806='Instruction:\x0a'+_0x11c45e+'\x0aYou\x20must\x20keep\x20the\x20text\x20formatting.\x0a\x0aContent:\x0a'+_0x70b10f):(_0x3913ad='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.',_0x386806=_0x11c45e),[{'role':'system','content':_0x3913ad},{'role':'user','content':_0x386806}];}async['_readStreamableResponse'](_0x5f1e39,_0x5e2308){const _0x3fa7b8=_0x5f1e39['body']['getReader'](),_0x2444bf=new TextDecoder();let _0x1833d3='',_0x407353='',_0x2f0c45='',_0x55eac9=!0x1;for(;!_0x55eac9;){const {done:_0x36df2d,value:_0x5e6c62}=await _0x3fa7b8['read'](),_0x52694c=_0x1833d3+_0x2444bf['decode'](_0x5e6c62);let _0x35d2cc='';_0x55eac9=_0x36df2d;try{_0x35d2cc=this['_cleanUpData'](_0x52694c),_0x1833d3='';}catch{_0x1833d3=_0x52694c;continue;}_0x407353+=_0x35d2cc,!_0x55eac9&&this['_isBufferIncomplete'](_0x407353)||_0x407353&&(_0x2f0c45+=_0x407353,_0x407353='',_0x5e2308(_0x2f0c45));}return Promise['resolve']();}async['_readStaticResponse'](_0x3fe846,_0x4f45a2){return _0x4f45a2((await _0x3fe846['json']())['choices'][0x0]['message']['content']),Promise['resolve']();}['_isBufferIncomplete'](_0x318881){const _0x55b707=_0x318881['split']('<')['length']!==_0x318881['split']('>')['length'],_0x5baf76=_0x318881['length']<0x1e;return _0x55b707&&_0x5baf76;}['_cleanUpData'](_0x690738){return _0x690738['split'](/\n(?![^{]*\})/g)['map'](_0x316c47=>_0x316c47['replace']('data:\x20',''))['filter'](_0x39204d=>_0x39204d&&_0x39204d['length']>0x0&&'[DONE]'!==_0x39204d)['map'](_0xe33c2b=>{const {choices:_0x2aa76d}=JSON['parse'](_0xe33c2b);if(_0x2aa76d[0x0]?.['delta']?.['content'])return _0x2aa76d[0x0]['delta']['content'];})['filter'](_0x5d0bdf=>_0x5d0bdf)['join']('');}}class Zi extends ji{static get['pluginName'](){return'AWSTextAdapter';}['init'](){super['init'](),It('ai-aws-adapter-not-supported');}async['sendRequest'](_0x236093){throw Et('ai-aws-adapter-not-supported'),new Oi(ki(this['editor']['locale'],'AI_ERROR_AWS_NOT_SUPPORTED'));}}class ts extends Nt{constructor(_0x12c055,_0x483fa2={}){super(_0x12c055),this['isToggleable']=!0x0,this['set']('side',_0x483fa2['side']||'top');const _0x248dc2=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':['ck-tab-button',...pt(_0x483fa2['class']||[]),_0x248dc2['to']('side',_0x13084e=>'ck-tab-button_'+_0x13084e),_0x248dc2['to']('class')]}});}['show'](){this['set']('isVisible',!0x0);}['hide'](){this['set']('isVisible',!0x1);}}class es extends vt{['children'];constructor(_0x2ec6ce,_0x218a5a={}){super(_0x2ec6ce);const _0x378fb6=this['bindTemplate'];this['set']('isVisible',!0x1),this['set']('class',''),this['children']=this['createCollection'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-tab-panel',...pt(_0x218a5a['class']||[]),_0x378fb6['to']('class'),_0x378fb6['if']('isVisible','ck-hidden',_0x23d3b3=>!_0x23d3b3)]},'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(_0x3207b2,_0x33ceb6={}){super(_0x3207b2),this['set']('class',void 0x0),this['set']('activeTab',null),this['set']('side',_0x33ceb6['side']||'top'),this['set']('isMaximized',!0x1),this['set']('collapsible',_0x33ceb6['collapsible']||!0x1),this['set']('_isMaximizedActive',!0x1),this['bind']('_isMaximizedActive')['to'](this,'isMaximized',this,'activeTab',(_0x1dd9d5,_0x15a091)=>_0x1dd9d5&&null!==_0x15a091);const _0x49f307=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset','ck-tabs',...pt(_0x33ceb6['class']||[]),_0x49f307['to']('side',_0x2a36d6=>'ck-tabs_'+_0x2a36d6),_0x49f307['to']('class'),_0x49f307['if']('_isMaximizedActive','ck-ai-tabs_maximized'),_0x49f307['to']('activeTab',_0x1fb310=>null===_0x1fb310?'ck-ai-tabs_collapsed':'')],'tabindex':'0'},'children':[{'tag':'div','attributes':{'class':['ck','ck-tabs__buttons-container',_0x49f307['to']('side',_0x5f5d16=>'ck-tabs__buttons-container_'+_0x5f5d16)]},'children':this['buttonViews']},{'tag':'div','attributes':{'class':['ck','ck-tabs__panels-container',_0x49f307['to']('side',_0x2645bc=>'ck-tabs__panels-container_'+_0x2645bc)]},'children':this['panelViews']},...pt(_0x33ceb6['children']||[])]});}['getTabIds'](){return[...this['_tabs']['keys']()];}['getTab'](_0x121b31){const _0x167aae=this['_tabs']['get'](_0x121b31);return _0x167aae||null;}['addTab'](_0x352a8a){const _0x2545c2=this['_setupButton']({'id':_0x352a8a['id'],'label':_0x352a8a['buttonLabel'],'icon':_0x352a8a['buttonIcon'],'order':_0x352a8a['order']}),_0x312e2f=new es(this['locale']);return _0x312e2f['render'](),_0x352a8a['content']&&_0x312e2f['children']['add'](_0x352a8a['content']),this['panelViews']['add'](_0x312e2f),this['_tabs']['set'](_0x352a8a['id'],{'button':_0x2545c2,'panel':_0x312e2f,'order':void 0x0!==_0x352a8a['order']?_0x352a8a['order']:null}),this['fire']('addTab:'+_0x352a8a['id'],{'id':_0x352a8a['id'],'button':_0x2545c2,'panel':_0x312e2f}),null===this['activeTab']?this['activateTab'](_0x352a8a['id']):this['_hidePanel'](_0x352a8a['id']),{'button':_0x2545c2,'panel':_0x312e2f};}['activateTab'](_0x1dfead){if(null!==_0x1dfead&&!this['getTab'](_0x1dfead))throw new at('ui-tabsview-tab-not-found',{'tabs':this,'tabId':_0x1dfead});if(this['activeTab']===_0x1dfead)return;const _0x194cad=this['activeTab'];this['activeTab']&&this['_hidePanel'](this['activeTab']),this['activeTab']=_0x1dfead,_0x1dfead&&this['_showPanel'](_0x1dfead),this['fire']('activateTab:'+_0x1dfead,{'newTab':_0x1dfead,'oldTab':_0x194cad});}['toggleTabPanel'](_0x202285){if(!this['getTab'](_0x202285))throw new at('ui-tabsview-tab-not-found',{'tabs':this,'tabId':_0x202285});this['activeTab']===_0x202285?this['collapsible']&&(this['activeTab']=null):this['activateTab'](_0x202285);}['showTab'](_0x53ad28){if(!this['getTab'](_0x53ad28))throw new at('ui-tabsview-tab-not-found',{'tabs':this,'tabId':_0x53ad28});this['_showPanel'](_0x53ad28),this['_showButton'](_0x53ad28),this['fire']('show:'+_0x53ad28,_0x53ad28);}['hideTab'](_0x225b48){if(!this['getTab'](_0x225b48))throw new at('ui-tabsview-tab-not-found',{'tabs':this,'tabId':_0x225b48});const _0x24f824=this['activeTab'];this['_hidePanel'](_0x225b48),this['_hideButton'](_0x225b48);const _0x4033fa=this['getTabIds']();_0x24f824===_0x225b48&&_0x4033fa['length']>0x1&&this['activateTab'](_0x4033fa['find'](_0x1cb8f3=>_0x1cb8f3!==_0x225b48)),this['fire']('hide:'+_0x225b48,_0x225b48);}['_getPanel'](_0x510727){const _0xf8c223=this['_tabs']['get'](_0x510727);return _0xf8c223?_0xf8c223['panel']:null;}['_showPanel'](_0xcf47af){null!==this['activeTab']&&this['activeTab']!==_0xcf47af||this['_getPanel'](_0xcf47af)['show']();}['_hidePanel'](_0x28953e){const _0x29dfa9=this['_getPanel'](_0x28953e);_0x29dfa9['isVisible']&&(this['activeTab']===_0x28953e&&(this['activeTab']=null),_0x29dfa9['hide']());}['_getButton'](_0x2acf57){const _0x73cd15=this['_tabs']['get'](_0x2acf57);return _0x73cd15?_0x73cd15['button']:null;}['_showButton'](_0x4f8c60){this['_getButton'](_0x4f8c60)['show']();}['_hideButton'](_0x43d77f){this['_getButton'](_0x43d77f)['hide']();}['_setupButton'](_0x39cc75){const _0x4df8b5=new ts(this['locale'],{'side':this['side']}),_0x4ac9ab=this['buttonViews'];if(_0x4df8b5['set']({'label':_0x39cc75['label'],'icon':_0x39cc75['icon'],'tooltip':!0x0,'withText':!0x0}),_0x4df8b5['bind']('isOn')['to'](this,'activeTab',_0x2c28c3=>_0x2c28c3===_0x39cc75['id']),_0x4df8b5['bind']('side')['to'](this,'side'),_0x39cc75['order']){const _0x18706a=[...this['_tabs']]['reduce']((_0x3d22f9,_0x39b1de)=>{const _0x500f85=_0x39b1de[0x0],{order:_0x28d6fb}=_0x39b1de[0x1];return!_0x28d6fb||_0x28d6fb>_0x39cc75['order']?_0x3d22f9:_0x28d6fb>=_0x3d22f9['order']?{'id':_0x500f85,'order':_0x28d6fb}:_0x3d22f9;},{'id':'','order':0x0}),_0x2890ec=_0x4ac9ab['getIndex'](this['_getButton'](_0x18706a['id']));_0x4ac9ab['add'](_0x4df8b5,_0x2890ec+0x1);}else _0x4ac9ab['add'](_0x4df8b5);return _0x4df8b5['on']('execute',()=>{this['toggleTabPanel'](_0x39cc75['id']);}),_0x4df8b5;}}const ss=['overlay','sidebar','custom'],ns=['left','right'];class rs extends is{constructor(_0x5bad5,_0x34ca69={}){super(_0x5bad5,_0x34ca69),this['set']('type',_0x34ca69['type']||'sidebar'),this['set']('side',_0x34ca69['side']||'right'),this['set']('isVisible',_0x34ca69['visibleByDefault']??!0x0);const _0x253fee=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':['ck-ai-tabs',_0x253fee['if']('type','ck-ai-tabs__overlay',_0x395de2=>'overlay'===_0x395de2),_0x253fee['if']('type','ck-ai-tabs__sidebar',_0x1dea5e=>'sidebar'===_0x1dea5e),_0x253fee['if']('isVisible','ck-hidden',_0x2d57cf=>!_0x2d57cf)]}}),this['buttonViews']['on']('add',(_0x3d44c4,_0x14aeec)=>{_0x14aeec['set']('withText',!0x1);});}}class os extends _0x35ff8d{['view'];['container']=null;['showResizeButton']=!0x0;static get['pluginName'](){return'AITabs';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x8b6bdb){if(super(_0x8b6bdb),!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 _0xa32925=this['context']['config']['get']('ai.container');if(this['set']('side','right'),void 0x0!==_0xa32925['showResizeButton']&&(this['showResizeButton']=_0xa32925['showResizeButton']),'sidebar'!==_0xa32925['type']&&'overlay'!==_0xa32925['type']||_0xa32925['side']&&(this['side']=_0xa32925['side']),'sidebar'===_0xa32925['type']){if(this['container']=_0xa32925['element'],this['set']('type','sidebar'),!this['container'])throw new at('ai-tabs-sidebar-container-element-not-found');}else'overlay'===_0xa32925['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':_0xa32925['visibleByDefault'],'collapsible':_0xa32925['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 _0x45e816&&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'](_0x4dc5db){if(_0x4dc5db&&this['type']!==_0x4dc5db){if(!ss['includes'](_0x4dc5db))throw new at('ai-tabs-unsupported-ui-type');this['type']=_0x4dc5db;}}['switchSide'](_0x19a240){if(_0x19a240&&this['side']!==_0x19a240){if(!ns['includes'](_0x19a240))throw new at('ai-tabs-unsupported-ui-side');this['side']=_0x19a240;}}['destroy'](){super['destroy'](),this['view']['destroy'](),this['view']['element']&&this['view']['element']['remove']();}}class as extends _0x35ff8d{['_apiUrl'];['_token'];['_decoder'];['_responseCache'];static get['requires'](){return[_0x19c4d3];}static get['pluginName'](){return'AIConnector';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x45f0b0){super(_0x45f0b0),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 _0x4cdd72=this['context']['plugins']['get'](_0x19c4d3);if(!_0x4cdd72['token'])throw new at('ai-missing-token',this);this['_token']=_0x4cdd72['token'];}['startConversation'](_0xa1700e,_0x26058b){const _0x4541e6=this['_sendApiRequest']('/conversations','POST',{'id':_0xa1700e,'group':_0x26058b});return{'getConversation':async()=>(await _0x4541e6['request'])['json'](),'abortController':_0x4541e6['abortController']};}['queryAssistant']({message:_0x3ebaad,conversationId:_0x1c7532,parts:_0x3211df,capabilities:_0x3033e3,model:_0x19254a,attributes:_0x5ea6aa}){const _0x12a3d7={'prompt':_0x3ebaad,'content':_0x3211df,'model':_0x19254a,..._0x3033e3&&{'capabilities':_0x3033e3},..._0x5ea6aa&&{'attributes':_0x5ea6aa}},_0x4ae613=this['_sendApiRequest']('/conversations/'+_0x1c7532+'/messages','POST',_0x12a3d7);return{'getStream':async()=>{const _0x5b25b3=(await _0x4ae613['request'])['body'];return this['_getStreamReader'](_0x5b25b3);},'abortController':_0x4ae613['abortController']};}['executeCustomAction']({content:_0x371608,message:_0x10c122,model:_0xcd32c6,outputFormat:_0x5e3b0f}){const _0x29d0e8={'content':[{'type':'text','content':_0x371608}],'prompt':_0x10c122,'model':_0xcd32c6,'outputFormat':_0x5e3b0f},_0x1333f7=this['_sendApiRequest']('/actions/custom/calls','POST',_0x29d0e8);return{'getStream':async()=>{const _0x22e9f9=(await _0x1333f7['request'])['body'];return this['_getStreamReader'](_0x22e9f9);},'abortController':_0x1333f7['abortController']};}['executeAction']({actionName:_0x1d70c3,content:_0x3e0c59,args:_0x4c93ad}){const _0x55495f={'content':[{'type':'text','content':_0x3e0c59}],'args':_0x4c93ad},_0x5ad252=this['_sendApiRequest']('/actions/system/'+_0x1d70c3+'/calls','POST',_0x55495f);return{'getStream':async()=>{const _0x1e9c56=(await _0x5ad252['request'])['body'];return this['_getStreamReader'](_0x1e9c56);},'abortController':_0x5ad252['abortController']};}['uploadFile'](_0x2d07cc,_0x2e19a2,_0x3b2fdd){const _0x4474f4=new FormData();_0x4474f4['append']('file',_0x2e19a2,_0x2e19a2['name']),_0x3b2fdd&&_0x4474f4['append']('attributes',JSON['stringify'](_0x3b2fdd));const _0x290e0d=this['_sendApiRequest']('/conversations/'+_0x2d07cc+'/files','POST',_0x4474f4);return{'getId':async()=>(await _0x290e0d['request'])['json'](),'abortController':_0x290e0d['abortController']};}['fetchDocument'](_0x52020b,_0x28919a){const _0x2e12d7=this['_sendApiRequest']('/conversations/'+_0x52020b+'/documents/'+_0x28919a,'GET');return{'getDocument':async()=>(await _0x2e12d7['request'])['json'](),'abortController':_0x2e12d7['abortController']};}['uploadDocument'](_0x2d75d7,_0x466e3d,_0x3e13c8){const _0x519938={'content':_0x466e3d};_0x3e13c8&&(_0x519938['attributes']=_0x3e13c8);const _0x257c83=this['_sendApiRequest']('/conversations/'+_0x2d75d7+'/documents','POST',_0x519938);return{'getId':async()=>(await _0x257c83['request'])['json'](),'abortController':_0x257c83['abortController']};}['uploadDocuments'](_0x4bfe9b,_0x4c4f9c){const _0x40e9d0={'documents':_0x4c4f9c['map'](_0x540ce5=>({'content':_0x540ce5['content'],'attributes':{'version':_0x540ce5['version'],'sessionId':_0x540ce5['sessionId'],'selections':_0x540ce5['selections']},...void 0x0!==_0x540ce5['name']?{'name':_0x540ce5['name']}:{},...void 0x0!==_0x540ce5['description']?{'description':_0x540ce5['description']}:{}}))},_0x5d926b=this['_sendApiRequest']('/conversations/'+_0x4bfe9b+'/documents/batch','POST',_0x40e9d0);return{'getIds':async()=>(await _0x5d926b['request'])['json'](),'abortController':_0x5d926b['abortController']};}['fetchDocuments'](_0x258f1d,_0x582e28){const _0x5f07a2=new URLSearchParams();_0x5f07a2['append']('documentIds',_0x582e28['join'](','));const _0x40e4b2=this['_sendApiRequest']('/conversations/'+_0x258f1d+'/documents/batch?'+_0x5f07a2['toString'](),'GET');return{'getDocuments':async()=>(await _0x40e4b2['request'])['json'](),'abortController':_0x40e4b2['abortController']};}['fetchConversations'](_0x2e3712,_0x21115f={}){const _0x256b83=new URLSearchParams();_0x256b83['append']('group',_0x2e3712),_0x256b83['append']('excludeEmpty',!0x1!==_0x21115f['excludeEmpty']?'true':'false'),_0x256b83['append']('limit',_0x21115f['limit']?_0x21115f['limit']['toString']():'100'),_0x256b83['append']('sortBy',_0x21115f['sortBy']?_0x21115f['sortBy']:'createdAt'),_0x256b83['append']('order',_0x21115f['order']?_0x21115f['order']:'desc');const _0x5aba92=this['_sendApiRequest']('/conversations?'+_0x256b83['toString'](),'GET');return{'getConversations':async()=>{const _0xd07dbb=await _0x5aba92['request'];return(await _0xd07dbb['json']())['items'];},'abortController':_0x5aba92['abortController']};}['deleteConversation'](_0x21c9f3){const _0x5822a8=this['_sendApiRequest']('/conversations/'+_0x21c9f3,'DELETE');return{'execute':async()=>{await _0x5822a8['request'];},'abortController':_0x5822a8['abortController']};}['updateConversation'](_0x5f3607,_0x19db10){const _0x62b15c=this['_sendApiRequest']('/conversations/'+_0x5f3607,'PATCH',_0x19db10);return{'getResult':async()=>(await _0x62b15c['request'],_0x19db10),'abortController':_0x62b15c['abortController']};}['fetchConversation'](_0xcff234){const _0x4f44f1=this['_sendApiRequest']('/conversations/'+_0xcff234,'GET');return{'getConversation':async()=>(await _0x4f44f1['request'])['json'](),'abortController':_0x4f44f1['abortController']};}['fetchConversationMessages'](_0x5f53f3){const _0x2d1baf=this['_sendApiRequest']('/conversations/'+_0x5f53f3+'/messages','GET');return{'getMessages':async()=>{const _0x49f4a7=await _0x2d1baf['request'];return(await _0x49f4a7['json']())['items'];},'abortController':_0x2d1baf['abortController']};}['uploadUrl'](_0x5962d1,_0x4fcb33,_0x4fee05){const _0x4ef40c=this['_sendApiRequest']('/conversations/'+_0x5962d1+'/web-resources','POST',{'url':_0x4fcb33,'attributes':_0x4fee05});return{'getId':async()=>(await _0x4ef40c['request'])['json'](),'abortController':_0x4ef40c['abortController']};}['getModels'](_0x109ef0='en'){const _0x53212a=new URLSearchParams();_0x53212a['append']('language',_0x109ef0);const _0x2d9781='/models/1?'+_0x53212a['toString'](),_0x2165f8=this['_sendApiRequest'](_0x2d9781,'GET',void 0x0,!0x0);return{'list':async()=>await(await _0x2165f8['request'])['json'](),'abortController':_0x2165f8['abortController']};}['deleteFile'](_0x799c12,_0x88515f){const _0x5f172a=this['_sendApiRequest']('/conversations/'+_0x799c12+'/files/'+_0x88515f,'DELETE');return{'execute':async()=>{await _0x5f172a['request'];},'abortController':_0x5f172a['abortController']};}['deleteDocument'](_0x2a2196,_0x5e34bf){const _0x517010=this['_sendApiRequest']('/conversations/'+_0x2a2196+'/documents/'+_0x5e34bf,'DELETE');return{'execute':async()=>{await _0x517010['request'];},'abortController':_0x517010['abortController']};}['deleteWebResource'](_0x2b72e9,_0x49ffff){const _0x44bd0f=this['_sendApiRequest']('/conversations/'+_0x2b72e9+'/web-resources/'+_0x49ffff,'DELETE');return{'execute':async()=>{await _0x44bd0f['request'];},'abortController':_0x44bd0f['abortController']};}['callSystemReview']({reviewName:_0x28546a,content:_0x29e6f0,args:_0x40a5db}){const _0x2379a1=this['_sendApiRequest']('/reviews/system/'+_0x28546a+'/calls','POST',{'content':[{'type':'text','content':_0x29e6f0}],'args':_0x40a5db});return{'getStream':async()=>{const _0x383253=(await _0x2379a1['request'])['body'];return this['_getStreamReader'](_0x383253);},'abortController':_0x2379a1['abortController']};}['callCustomReview']({content:_0x1e3e97,prompt:_0x586b96,model:_0x5dea31}){const _0x42b699=this['_sendApiRequest']('/reviews/custom/calls','POST',{'content':[{'type':'text','content':_0x1e3e97}],'prompt':_0x586b96,'model':_0x5dea31});return{'getStream':async()=>{const _0x4fcbd0=(await _0x42b699['request'])['body'];return this['_getStreamReader'](_0x4fcbd0);},'abortController':_0x42b699['abortController']};}['upsertAIChatRating'](_0x43d764,_0x3a24c7,_0x35d886){const _0x4db505=this['_sendApiRequest']('/conversations/'+_0x43d764+'/messages/'+_0x3a24c7+'/ratings','PUT',{'positiveCount':_0x35d886['positiveCount'],'totalCount':_0x35d886['totalCount'],'modificationId':_0x35d886['modificationId']});return{'execute':async()=>{await _0x4db505['request'];},'abortController':_0x4db505['abortController']};}['upsertAIActionRating'](_0x3e0db2,_0x5d5421,_0x54e845){const _0x22d654=this['_sendApiRequest']('/actions/system/'+_0x3e0db2+'/calls/'+_0x5d5421+'/ratings','PUT',{'positiveCount':_0x54e845['positiveCount'],'totalCount':_0x54e845['totalCount']});return{'execute':async()=>{await _0x22d654['request'];},'abortController':_0x22d654['abortController']};}['upsertCustomAIActionRating'](_0x3d69e5,_0x3da0b9){const _0x36ccf2=this['_sendApiRequest']('/actions/custom/calls/'+_0x3d69e5+'/ratings','PUT',{'positiveCount':_0x3da0b9['positiveCount'],'totalCount':_0x3da0b9['totalCount']});return{'execute':async()=>{await _0x36ccf2['request'];},'abortController':_0x36ccf2['abortController']};}['upsertAIReviewRating'](_0x2b4af6,_0x34b1c6,_0x4c35e2,_0x5a13fc){const _0x1545f2=this['_sendApiRequest']('/reviews/system/'+_0x2b4af6+'/calls/'+_0x34b1c6+'/ratings','PUT',{'positiveCount':_0x4c35e2['positiveCount'],'totalCount':_0x4c35e2['totalCount'],'dataId':_0x5a13fc});return{'execute':async()=>{await _0x1545f2['request'];},'abortController':_0x1545f2['abortController']};}['upsertCustomAIReviewRating'](_0x3bfbc2,_0x4628ab,_0x3e1e7b){const _0x328198=this['_sendApiRequest']('/reviews/custom/calls/'+_0x3bfbc2+'/ratings','PUT',{'positiveCount':_0x4628ab['positiveCount'],'totalCount':_0x4628ab['totalCount'],'dataId':_0x3e1e7b});return{'execute':async()=>{await _0x328198['request'];},'abortController':_0x328198['abortController']};}['_sendApiRequest'](_0x4989c4,_0x4df396,_0xb96f5b,_0x8478b3=!0x1){const _0x3a3883=new AbortController(),_0xa4c0bb=_0x8478b3?_0x4df396+':'+_0x4989c4:null;if(_0xa4c0bb){const _0x38bcc0=this['_responseCache']['get'](_0xa4c0bb);if(_0x38bcc0)return{'request':_0x38bcc0['then'](_0x12a3f1=>_0x12a3f1['clone']()),'abortController':_0x3a3883};}const _0x1d187b=_0xb96f5b instanceof FormData,_0x281d36={'Authorization':'Bearer\x20'+this['_token']?.['value'],'x-feature-flags':'multi-document','X-Editor-Version':mt};_0xb96f5b&&!_0x1d187b&&(_0x281d36['Content-Type']='application/json');const _0x41cf5d={'method':_0x4df396,'headers':_0x281d36,'signal':_0x3a3883['signal']};_0xb96f5b&&(_0x41cf5d['body']=_0x1d187b?_0xb96f5b:JSON['stringify'](_0xb96f5b));const _0x53753a=fetch(''+this['_apiUrl']+_0x4989c4,_0x41cf5d)['catch'](_0x2e00cf=>{_0xa4c0bb&&this['_responseCache']['delete'](_0xa4c0bb),this['_handleError'](_0x2e00cf);})['then'](_0x463d53=>_0x463d53['ok']?_0x463d53:_0x463d53['json']()['then'](_0x39f301=>{throw _0xa4c0bb&&this['_responseCache']['delete'](_0xa4c0bb),{'url':this['_apiUrl'],'path':_0x4989c4,'method':_0x4df396,'body':_0xb96f5b,'status':(_0x463d53||{})['status'],'statusText':(_0x463d53||{})['statusText'],'code':_0x39f301['code'],'message':_0x39f301['message'],'traceId':_0x39f301['traceId']};}));return _0xa4c0bb&&this['_responseCache']['set'](_0xa4c0bb,_0x53753a['then'](_0x31f370=>_0x31f370['clone']())),{'request':_0x53753a,'abortController':_0x3a3883};}async*['_getStreamReader'](_0x5097ce){const _0x31b5db=[],_0x3d5c85=_0x5097ce['getReader'](),_0x31c6b2=_0x3915bf({'onError':_0x438daf=>{this['_handleError'](_0x438daf);},'onEvent':_0x13be38=>{_0x13be38['data']=JSON['parse'](_0x13be38['data']),_0x31b5db['push'](_0x13be38);}});try{let _0x53fd60=!0x1;for(;!_0x53fd60;){const {done:_0x18b0bd,value:_0x569a32}=await _0x3d5c85['read']();_0x18b0bd&&(_0x53fd60=!0x0),_0x31c6b2['feed'](this['_decoder']['decode'](_0x569a32,{'stream':!0x0})),yield*_0x31b5db,_0x31b5db['length']=0x0;}}catch(_0x22e20e){this['_handleError'](_0x22e20e);}finally{_0x3d5c85['releaseLock'](),_0x31c6b2['reset']();}}['_handleError'](_0x368ea9){if(_0x368ea9 instanceof at)throw _0x368ea9;if(_0x368ea9 instanceof Error&&'AbortError'===_0x368ea9['name'])throw new at('ai-request-aborted',this,{'originalError':_0x368ea9});throw new at('ai-request-failed',this,{'originalError':_0x368ea9});}}function hs(_0x357b1f,_0x1e811f,_0x5efae4){const t=_0x357b1f['t'];switch(_0x1e811f){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'},_0x5efae4);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.'},_0x5efae4);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.'},_0x5efae4);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.'},_0x5efae4);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'},_0x5efae4);case'AI_CHAT_SUGGESTION_ACTION_SUGGEST':return t({'id':'AI_CHAT_SUGGESTION_ACTION_SUGGEST','string':'Suggest'},_0x5efae4);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'},_0x5efae4);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.'},_0x5efae4);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.'},_0x5efae4);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.'},_0x5efae4);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.'},_0x5efae4);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'},_0x5efae4);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.'},_0x5efae4);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 _0x1e811f;}}const cs='ck-ai-button-primary',ls='ck-ai-button-secondary',us='ck-ai-button-tertiary';function ds(_0x145f23,_0x3a0fe7){const _0x51a74d=new Nt(_0x145f23),_0x11681f=hs(_0x145f23,'AI_TABS_LABEL_MINIMIZE'),_0x5e7e97=hs(_0x145f23,'AI_TABS_LABEL_MAXIMIZE');return _0x51a74d['set']({'withText':!0x1,'icon':_0xb68bd5,'tooltip':!0x0,'class':'ck-ai-tabs__resize\x20'+us}),_0x51a74d['bind']('label')['to'](_0x3a0fe7,'isMaximized',_0x48e508=>_0x48e508?_0x11681f:_0x5e7e97),_0x51a74d['bind']('icon')['to'](_0x3a0fe7,'isMaximized',_0x996c05=>_0x996c05?_0x30bd4f:_0xb68bd5),_0x51a74d['bind']('isOn')['to'](_0x3a0fe7,'isMaximized'),_0x51a74d['on']('execute',()=>{_0x3a0fe7['fire']('resizeTabs');}),_0x51a74d;}function _s(_0x3e47c3){return _0x40c2cf(_0x3e47c3);}function gs(_0x11695e){return ti(_0x11695e);}function As(_0x38c147,_0x21fd74,_0x3058a0){const _0x1bdf27=null!==_0x21fd74?_0x42e516=>_0x42e516['attribs'][_0x38c147]===_0x21fd74:_0x44b839=>Boolean(_0x44b839['attribs'][_0x38c147]);return _0x42364e(_0x4ddb78=>_0x252b51(_0x4ddb78)&&_0x1bdf27(_0x4ddb78),_0x3058a0);}function Is(_0x3ec6f4,_0x516dd7,_0x3d521a){const _0x43b045=null!==_0x516dd7?_0x2aa7a2=>_0x2aa7a2['attribs'][_0x3ec6f4]===_0x516dd7:_0x4ededb=>Boolean(_0x4ededb['attribs'][_0x3ec6f4]);return _0x538dd8(_0x3ffbae=>_0x252b51(_0x3ffbae)&&_0x43b045(_0x3ffbae),_0x3d521a);}function Es(_0x1611e6,_0xb6837c){return _0x1611e6&&_0x252b51(_0x1611e6)?_0x1611e6['attribs'][_0xb6837c]:null;}function ps(_0x2374b8,_0x3e5651,_0x13322d){_0x252b51(_0x2374b8)&&(null===_0x13322d?delete _0x2374b8['attribs'][_0x3e5651]:_0x2374b8['attribs'][_0x3e5651]=_0x13322d);}function ms(_0x4c4bd4,_0x2d2b5b,_0x5cc9f1){const _0x247974=_0x2d2b5b['cloneNode'](!0x0);'beforebegin'===_0x5cc9f1?_0x2d6be7(_0x4c4bd4,_0x247974):'afterbegin'===_0x5cc9f1?_0x3711aa(_0x4c4bd4,_0x247974):'beforeend'===_0x5cc9f1?_0x526a8f(_0x4c4bd4,_0x247974):'afterend'===_0x5cc9f1&&_0x325097(_0x4c4bd4,_0x247974);}function Ts(_0x4102ba){const _0x138bde=[];let _0x41b28c=_0x4102ba;for(;_0x41b28c;)_0x41b28c=_0x412f90(_0x41b28c),_0x41b28c&&_0x138bde['push'](_0x41b28c);return _0x138bde;}function Cs(_0x165058){return _0x165058['replace'](/^\s+/gm,'')['replace'](/\s+$/gm,'')['replace'](/\n*/g,'')['replace'](/\s+/g,'\x20')['replace'](/>\s*</g,'><');}function ws(_0x137779){let _0x9ed662=0x0;for(;_0x137779['parentNode'];)_0x137779=_0x137779['parentNode'],_0x9ed662++;return _0x9ed662;}function fs(_0x5af9bc){const _0x58a04e=[];let _0x2e5428=_0x5af9bc['nextSibling'];for(;_0x2e5428;)_0x58a04e['push'](_0x2e5428),_0x2e5428=_0x2e5428['nextSibling'];_0x58a04e['forEach'](_0x503b0f=>{_0x4718cb(_0x503b0f);});}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(_0x46d6c5){super(),this['_generateUid']=_0x46d6c5||(()=>'e'+String(this['_uidCounter']++));}['merge'](_0x5de9b1,_0x15656d,_0x31d4fd){this['_uidCounter']=0x0;const _0x5c7b54=_0x5de9b1['cloneNode'](!0x0),_0x13584a=_0x5c7b54['childNodes'],_0x95fec=Array['from'](_0x13584a)['filter'](_0x1f6515=>!(0x3===_0x1f6515['nodeType']&&''===gs(_0x1f6515)['trim']())),_0x3ebc56=_0x95fec['length'],_0xbee48f=new Map();for(const _0x24e185 of _0x95fec)_0x24e185&&_0x252b51(_0x24e185)&&void 0x0===_0x24e185['attribs']['data-id']&&ps(_0x24e185,'data-id','new-element');if(0x0===_0x15656d['childNodes']['length']){const _0xf7b5a1=[];return Is('data-id','new-element',_0x5c7b54)['forEach'](_0x2e7c9b=>{const _0x38d299=this['_generateUid']();ps(_0x2e7c9b,'data-id',_0x38d299),_0xf7b5a1['push'](_0x38d299);}),this['_removeSpecialComments'](_0x5c7b54),{'parsedContent':_0x5c7b54,'newNodeIds':_0xf7b5a1,'modifiedNodeIds':[],'removedNodeIds':[],'newAnchorIds':_0xbee48f};}_0x31d4fd&&_0x31d4fd['markUnstableElements']&&this['_markLastTagElementUnstable'](_0x5c7b54),this['_touchedNodesState']['newIds']=[],this['_touchedNodesState']['modifiedIds']=[],this['_touchedNodesState']['removedIds']=[],this['_touchedNodesState']['invalidIds']=[],this['_touchedNodesState']['lastTouchedId']=null,this['_existingDataIds']=new Set(Is('data-id',null,_0x15656d)['map'](_0x273324=>Es(_0x273324,'data-id'))['filter'](_0x5067f4=>!!_0x5067f4));let _0xefeab4=-0x1,_0x2403aa=!0x1;for(let _0x32e9be=0x0;_0x32e9be<_0x3ebc56;_0x32e9be++){const _0x39a9bf=_0x95fec[_0x32e9be],_0x50641b=_0x95fec[_0x32e9be+0x1];if(this['_isNewNode'](_0x39a9bf)){if(-0x1===_0xefeab4&&(_0xefeab4=_0x32e9be),this['_markWrappedElements'](_0x39a9bf),!this['_isNewNode'](_0x50641b)){const [_0x263d37,_0x454f8b]=this['_findReferenceNode'](_0x39a9bf,_0x2403aa,_0x15656d);if(_0x263d37){const _0x16504f=Array['from'](_0x95fec)['slice'](_0xefeab4,_0x32e9be+0x1),_0x20d6bf=Es(_0x263d37,'data-id');if(this['_insertNodes'](_0x263d37,_0x16504f,_0x454f8b),_0x20d6bf)for(const _0xaa8690 of _0x16504f){const _0x161cfa=Es(_0xaa8690,'data-id');_0x161cfa&&_0xbee48f['set'](_0x161cfa,_0x20d6bf);}_0xefeab4=-0x1;}}}else{if(this['_isExistingContentComment'](_0x39a9bf))_0x2403aa=!0x0;else{if(this['_isExistingNode'](_0x39a9bf)){const _0x1f5e66=Es(_0x39a9bf,'data-id');if(_0x1f5e66&&this['_existingDataIds']['has'](_0x1f5e66)){const _0x5896d2=As('data-id',_0x1f5e66,_0x15656d);this['_replaceNode'](_0x5896d2,_0x39a9bf);}}else{if(this['_isDelNode'](_0x39a9bf)){const _0x2389da=this['_getNodeDataId'](_0x39a9bf);!!As('data-id',_0x2389da,_0x5c7b54)||this['_touchedNodesState']['removedIds']['push'](_0x2389da);}}}}}for(const _0x5d940b of this['_touchedNodesState']['removedIds']){const _0x2c2cf3=As('data-id',_0x5d940b,_0x15656d);_0x2c2cf3&&this['_removeNode'](_0x2c2cf3,_0x5d940b,_0x31d4fd);}if(Is('data-id','new-element',_0x15656d)['forEach'](_0x3ca024=>{const _0x559dd5=this['_getUid'](_0x3ca024);ps(_0x3ca024,'data-id',_0x559dd5),this['_touchedNodesState']['newIds']['push'](_0x559dd5);}),this['_removeSpecialComments'](_0x15656d),_0x31d4fd&&_0x31d4fd['markUnstableElements']&&this['_markUnstableElements'](_0x15656d,_0x31d4fd['markUnstableElementsDepth']||0x0),this['_processWrappedElements'](_0x15656d,_0x31d4fd),_0x31d4fd&&_0x31d4fd['cutAfterLastChange']&&this['_touchedNodesState']['lastTouchedId']){const _0xcc9161=Is('data-id',this['_touchedNodesState']['lastTouchedId'],_0x15656d);let _0x2a8ac9=_0xcc9161[_0xcc9161['length']-0x1];for(;_0x2a8ac9;)fs(_0x2a8ac9),_0x2a8ac9=_0x2a8ac9['parentNode'];}return{'parsedContent':_0x15656d,'newNodeIds':this['_touchedNodesState']['newIds'],'modifiedNodeIds':this['_touchedNodesState']['modifiedIds'],'removedNodeIds':this['_touchedNodesState']['removedIds'],'newAnchorIds':_0xbee48f};}['_insertNodes'](_0x200488,_0x41ec1c,_0xcd2e30){for(const _0x1fd942 of _0x41ec1c){const _0x5973ce=this['_getUid'](_0x1fd942);ps(_0x1fd942,'data-id',_0x5973ce),this['_touchedNodesState']['newIds']['push'](_0x5973ce),this['_touchedNodesState']['lastTouchedId']=_0x5973ce;}const _0x248267='afterbegin'===_0xcd2e30||'afterend'===_0xcd2e30?_0x41ec1c['reverse']():_0x41ec1c;for(const _0x18f164 of _0x248267)ms(_0x200488,_0x18f164,_0xcd2e30);}['_replaceNode'](_0xd25ff9,_0x537da0){if(!_0xd25ff9)return;if(_0x114d7d=_0x537da0,Cs(gs(_0xd25ff9))===Cs(gs(_0x114d7d)))return;var _0x114d7d;const _0x1650b4=this['_getUid'](_0xd25ff9);ps(_0x537da0,'data-id',_0x1650b4),this['_touchedNodesState']['modifiedIds']['push'](_0x1650b4),this['_touchedNodesState']['lastTouchedId']=_0x1650b4,_0x21418a(_0xd25ff9,_0x537da0['cloneNode'](!0x0));}['_removeNode'](_0x4dc04f,_0x478bec,_0x7fda1a){if(_0x7fda1a&&_0x7fda1a['replaceRemovedWith']){this['_touchedNodesState']['lastTouchedId']=_0x478bec;const _0x2b75a7=_0x7fda1a['replaceRemovedWith']['cloneNode'](!0x0);ps(_0x2b75a7,'data-id',_0x478bec),ps(_0x2b75a7,'data-removed','true'),_0x21418a(_0x4dc04f,_0x2b75a7);}else _0x4718cb(_0x4dc04f);}['_findReferenceNode'](_0x15fcac,_0x14ec45,_0x35d3fe){const _0x2500cc=this['_findPrevElementWithDataId'](_0x15fcac,!0x1);if(_0x2500cc){const _0x485306=this['_getNodeDataId'](_0x2500cc),_0x213c7f=As('data-id',_0x485306,_0x35d3fe);if(_0x213c7f)return[_0x213c7f,'afterend'];this['_touchedNodesState']['invalidIds']['push'](_0x485306);}const _0x3247eb=this['_findNextElementWithDataId'](_0x15fcac,!0x1);if(_0x3247eb){const _0x43e87d=this['_getNodeDataId'](_0x3247eb),_0x278c3f=As('data-id',_0x43e87d,_0x35d3fe);if(_0x278c3f)return[_0x278c3f,'beforebegin'];this['_touchedNodesState']['invalidIds']['push'](_0x43e87d);}return _0x14ec45?_0x15fcac['nextSibling']?this['_findFallbackReferenceNode'](_0x15fcac,_0x35d3fe):[_0x35d3fe['childNodes'][_0x35d3fe['childNodes']['length']-0x1],'afterend']:[_0x35d3fe['childNodes'][0x0],'beforebegin'];}['_findFallbackReferenceNode'](_0x5209d6,_0x3b38ab){const _0x23e44a=[],_0x327d49=this['_findPrevElementWithDataId'](_0x5209d6,!0x0);if(_0x327d49){const _0x49f956=As('data-id',this['_getNodeDataId'](_0x327d49),_0x3b38ab);_0x49f956&&_0x23e44a['push']([_0x49f956,'afterend']);}const _0x3b12e8=this['_findNextElementWithDataId'](_0x5209d6,!0x0);if(_0x3b12e8){const _0x54a36d=As('data-id',this['_getNodeDataId'](_0x3b12e8),_0x3b38ab);_0x54a36d&&_0x23e44a['push']([_0x54a36d,'beforebegin']);}if(_0x23e44a['length']>0x1)return ws(_0x23e44a[0x0][0x0])<=ws(_0x23e44a[0x1][0x0])?_0x23e44a[0x0]:_0x23e44a[0x1];return 0x1===_0x23e44a['length']?_0x23e44a[0x0]:[_0x3b38ab['lastChild'],'afterend'];}['_findNextElementWithDataId'](_0x40cdec,_0x381103){let _0x4fe6fd=_0x40cdec['nextSibling'],_0x46e8cc=null,_0x2cfa2e=!0x1;for(;_0x4fe6fd;){if(_0x4f1746(_0x4fe6fd)){if(this['_isDelNode'](_0x4fe6fd)&&(_0x46e8cc=_0x4fe6fd),this['_isExistingContentComment'](_0x4fe6fd)&&_0x381103&&!_0x2cfa2e){_0x2cfa2e=!0x0,_0x4fe6fd=_0x4fe6fd['nextSibling'];continue;}break;}const _0x5b7ac0=Es(_0x4fe6fd,'data-id');if(_0x5b7ac0&&'new-element'!==_0x5b7ac0&&this['_existingDataIds']['has'](_0x5b7ac0)){_0x46e8cc=_0x4fe6fd;break;}_0x4fe6fd=_0x4fe6fd['nextSibling'];}return _0x46e8cc;}['_findPrevElementWithDataId'](_0x18e5fc,_0x5e3e7f){let _0x18dbb1=_0x18e5fc['previousSibling'],_0x204a5c=null,_0xd65115=!0x1;for(;_0x18dbb1;){if(_0x4f1746(_0x18dbb1)){if(this['_isDelNode'](_0x18dbb1)&&(_0x204a5c=_0x18dbb1),this['_isExistingContentComment'](_0x18dbb1)&&_0x5e3e7f&&!_0xd65115){_0xd65115=!0x0,_0x18dbb1=_0x18dbb1['previousSibling'];continue;}break;}const _0x5238f2=Es(_0x18dbb1,'data-id');if(_0x5238f2&&'new-element'!==_0x5238f2&&this['_existingDataIds']['has'](_0x5238f2)){_0x204a5c=_0x18dbb1;break;}_0x18dbb1=_0x18dbb1['previousSibling'];}return _0x204a5c;}['_markWrappedElements'](_0x415188){_0x252b51(_0x415188)&&Is('data-id',null,_0x415188)['forEach'](_0x3ba28e=>{this['_isExistingNode'](_0x3ba28e)&&(ps(_0x3ba28e,'data-wrapped-id',Es(_0x3ba28e,'data-id')),ps(_0x3ba28e,'data-id',null));});}['_processWrappedElements'](_0x3c0c9b,_0x178000){Is('data-wrapped-id',null,_0x3c0c9b)['forEach'](_0x2bd811=>{const _0x3acc94=Es(_0x2bd811,'data-wrapped-id');if(Es(_0x2bd811,'data-unstable')||this['_hasUnstableParent'](_0x2bd811))return;const _0xff6e7d=As('data-id',_0x3acc94,_0x3c0c9b);ps(_0x2bd811,'data-id',_0x3acc94),ps(_0x2bd811,'data-wrapped-id',null),_0xff6e7d&&(this['_removeNode'](_0xff6e7d,_0x3acc94,_0x178000),this['_touchedNodesState']['removedIds']['push'](_0x3acc94),this['_touchedNodesState']['lastTouchedId']=_0x3acc94);});}['_hasUnstableParent'](_0x5749db){let _0x29db6d=_0x5749db['parentNode'];for(;_0x29db6d;){if(Es(_0x29db6d,'data-unstable'))return!0x0;_0x29db6d=_0x29db6d['parentNode'];}return!0x1;}['_getNodeDataId'](_0x27bff8){if(!_0x27bff8)return null;if(_0x252b51(_0x27bff8))return Es(_0x27bff8,'data-id');if(_0x4f1746(_0x27bff8)){const _0x448427=gs(_0x27bff8)['match'](/removed[\s*-]data-id="([^"]+)"/);if(_0x448427&&_0x448427[0x1])return _0x448427[0x1];}return null;}['_getUid'](_0x23afa3){return this['_isExistingNode'](_0x23afa3)?Es(_0x23afa3,'data-id'):this['_generateUid']();}['_removeSpecialComments'](_0x3cd8b4){(function(_0x2c3b69){return _0x431494(_0x2a0d43=>_0x4f1746(_0x2a0d43),_0x2c3b69,!0x0,0x1/0x0);}(_0x3cd8b4)['filter'](_0x123a04=>this['_isDelNode'](_0x123a04)||this['_isExistingContentComment'](_0x123a04))['forEach'](_0x98d741=>{_0x4718cb(_0x98d741);}));}['_markLastTagElementUnstable'](_0x5eb7a1){const _0x14c124=_0x5eb7a1['childNodes'],_0x3adc5d=_0x14c124[_0x14c124['length']-0x1];_0x3adc5d&&_0x252b51(_0x3adc5d)&&ps(_0x3adc5d,'data-unstable','true');}['_markUnstableElements'](_0x457cb7,_0x322f9c){const _0x4b6c1a=As('data-unstable','true',_0x457cb7);if(!_0x4b6c1a)return;const _0x5f180b=Ts(_0x4b6c1a)['slice'](0x0,-0x1),_0x37f6a9=_0x5f180b['length'];let _0x1d48fe=_0x4b6c1a;if(_0x37f6a9>_0x322f9c){let _0x1f64d0=_0x37f6a9,_0x2db905=null;for(;_0x1f64d0>_0x322f9c&&_0x1f64d0>=0x0;)_0x1f64d0--,_0x2db905=_0x5f180b[_0x1f64d0];_0x2db905&&(_0x1d48fe=_0x2db905,ps(_0x4b6c1a,'data-unstable',null),ps(_0x2db905,'data-unstable','true'));}else{if(_0x37f6a9<_0x322f9c){let _0x45f93d=_0x37f6a9,_0x1ab728=_0x4b6c1a;for(;_0x45f93d<_0x322f9c;){const _0x430fbf=_0x1ab728['childNodes']['filter'](_0x4d4756=>_0x252b51(_0x4d4756));if(0x0===_0x430fbf['length'])break;_0x45f93d++,_0x1ab728=_0x430fbf[_0x430fbf['length']-0x1];}_0x1ab728&&(_0x1d48fe=_0x1ab728,ps(_0x4b6c1a,'data-unstable',null),ps(_0x1ab728,'data-unstable','true'));}}let _0x397e34=_0x1d48fe;for(;_0x397e34;){for(;_0x397e34['nextSibling'];)_0x397e34=_0x397e34['nextSibling'],_0x252b51(_0x397e34)&&ps(_0x397e34,'data-unstable','true');_0x397e34=_0x397e34['parentNode'];}}['_isNewNode'](_0x85567b){return Boolean('new-element'===Es(_0x85567b,'data-id'));}['_isExistingNode'](_0x418e87){return Boolean((Es(_0x418e87,'data-id')||'')['length']>0x0&&'new-element'!==Es(_0x418e87,'data-id'));}['_isDelNode'](_0x5ee9ee){return!!_0x5ee9ee&&Boolean(_0x4f1746(_0x5ee9ee)&&gs(_0x5ee9ee)['match'](/removed[\s*-]data-id="[^"]+"/));}['_isExistingContentComment'](_0x4675ca){return Boolean(_0x4f1746(_0x4675ca)&&gs(_0x4675ca)['match'](/\s*existing[\s*-](content|document)\s*/g));}}function Rs({editor:_0x51c3c4,changeGroups:_0x5e7c52,documentContextContent:_0x2b2f81,showDiff:_0x9427fd,trimUnchanged:_0x32848d=!0x0}){return _0x5e7c52['map'](_0x528431=>{const _0x27c4c0=new _0x4760d6([]),_0x28e392=new _0x4760d6([]),_0x38ee34=new Set();for(const _0x38d2d0 of _0x528431['changes'])'new'==_0x38d2d0['type']&&Is('data-id',null,_0x38d2d0['node'])['forEach'](_0x452b68=>{_0x38ee34['add'](Es(_0x452b68,'data-id'));});for(const _0x511498 of _0x528431['changes'])if('removed'!=_0x511498['type']?_0x28e392['children']['push'](_0x511498['node']['cloneNode'](!0x0)):_0x9427fd||_0x38ee34['has'](_0x511498['id'])||_0x28e392['children']['push'](_0x511498['node']['cloneNode'](!0x0)),'new'!=_0x511498['type']&&(_0x9427fd||'removed'!=_0x511498['type'])){const _0x265085=_0x42364e(_0x3e66b0=>Es(_0x3e66b0,'data-id')==_0x511498['id'],_0x2b2f81,!0x0);_0x265085&&_0x27c4c0['children']['push'](_0x265085['cloneNode'](!0x0));}const {content:_0x78d7e,hasChanges:_0x2d2ecf}=function(_0x38b068,_0xcb4c1e,_0x40c24a,_0x4d7d3c,_0x3efa22=!0x0){const _0x123880=_0x38b068['plugins']['get']('DocumentCompare'),_0x132b42=gs(_0xcb4c1e),_0x2ffd38=gs(_0x40c24a),_0xe837e6=_0x38b068['data']['parse'](_0x132b42,'$root'),_0x3e1894=_0x38b068['model']['createPositionAt'](_0xe837e6,0x0),_0x1d6d40=_0x123880['getDiff'](_0x132b42,_0x2ffd38,{'anchor':_0x3e1894,'markDeletions':_0x4d7d3c,'targetEditor':_0x38b068}),_0x856b01=_0x1d6d40['getOperations']();if(0x0==_0x856b01['length'])return{'content':_0xcb4c1e['cloneNode'](!0x0),'hasChanges':!0x1};_0x4d7d3c?function(_0x8cda8b,_0x5e349a,_0x5649f6){if(0x0==_0x8cda8b['length'])return;const _0x2ffc4a=_0x5649f6['plugins']['get']('DocumentCompare'),_0x340de8=_0x5649f6['plugins']['get']('SuggestionsConversion');_0x5649f6['model']['change'](_0x5b0aab=>{const _0x31bedc=new Set();for(let _0x48321b=0x0;_0x48321b<_0x8cda8b['length'];_0x48321b++){const _0xb6637c=_0x8cda8b[_0x48321b];if(_0xb6637c['baseVersion']=null,_0xb6637c['isDocumentOperation']=!0x1,_0x2ffc4a['isMarkedRemoveOperation'](_0xb6637c)){const _0x1204f2=_0x47a21e(_0xb6637c['newRange'],_0x5649f6['model']),_0x364ce4='suggestion:deletion:'+ot()+':$aiSuggestion';_0x5e349a['markers']['set'](_0x364ce4,_0x1204f2);}else switch(_0xb6637c['type']){case'rename':{if(_0xb6637c['oldName']==_0xb6637c['newName'])break;_0x5b0aab['batch']['addOperation'](_0xb6637c),_0x5649f6['model']['applyOperation'](_0xb6637c);const _0x3ad7a8='$elementName',_0x3b0983=_0xb6637c['position'],_0x2d8c45=_0x5649f6['model']['createRange'](_0x3b0983,_0x5649f6['model']['createPositionAt'](_0x3b0983['nodeAfter'],'end')),_0x7301b4='suggestion:attribute:'+_0x3ad7a8+':'+ot()+':$aiSuggestion';_0x5e349a['markers']['set'](_0x7301b4,_0x2d8c45);break;}case'addAttribute':case'removeAttribute':case'changeAttribute':{if(_0xb6637c['oldValue']==_0xb6637c['newValue'])break;_0x5b0aab['batch']['addOperation'](_0xb6637c),_0x5649f6['model']['applyOperation'](_0xb6637c);const _0x494ec1=_0xb6637c['key'];if(!_0x340de8['isRegisteredAttribute'](_0x494ec1))break;const _0x28d7dc=_0x47a21e(_0xb6637c['range'],_0x5649f6['model']),_0xac1017='suggestion:attribute:'+_0x494ec1+':'+ot()+':$aiSuggestion';_0x5e349a['markers']['set'](_0xac1017,_0x28d7dc);break;}case'insert':{_0x5b0aab['batch']['addOperation'](_0xb6637c),_0x5649f6['model']['applyOperation'](_0xb6637c);if(_0x8cda8b[_0x48321b+0x1]&&'move'==_0x8cda8b[_0x48321b+0x1]['type']){Os(_0x5e349a,_0xb6637c);break;}const _0x32f746=_0xb6637c['position'],_0x2d604b=_0xb6637c['howMany'],_0x1464f7=_0x47a21e(_0x5649f6['model']['createRange'](_0x32f746,_0x32f746['getShiftedBy'](_0x2d604b)),_0x5649f6['model']),_0x3de285='suggestion:insertion:'+ot()+':$aiSuggestion';_0x5e349a['markers']['set'](_0x3de285,_0x1464f7);break;}case'split':{_0x5b0aab['batch']['addOperation'](_0xb6637c),_0x5649f6['model']['applyOperation'](_0xb6637c);const _0x642cd0=_0xb6637c['splitPosition'],_0x4217f7=_0xb6637c['moveTargetPosition'],_0x278ca9=_0x5649f6['model']['createRange'](_0x642cd0,_0x4217f7),_0x18d34d='suggestion:insertion:'+ot()+':$aiSuggestion';_0x5e349a['markers']['set'](_0x18d34d,_0x278ca9);break;}case'move':{_0x5b0aab['batch']['addOperation'](_0xb6637c),_0x5649f6['model']['applyOperation'](_0xb6637c),_0x8cda8b[_0x48321b-0x1]&&'insert'==_0x8cda8b[_0x48321b-0x1]['type']&&Os(_0x5e349a,_0xb6637c);const _0x311909=_0xb6637c['getMovedRangeStart'](),_0xe89239=_0xb6637c['howMany'];for(let _0xd9ab10=0x0;_0xd9ab10<_0xe89239;_0xd9ab10++){const _0x2229d8=_0x311909['getShiftedBy'](_0xd9ab10)['nodeAfter'];_0x31bedc['add'](_0x2229d8);}break;}case'remove':{const _0x3f11cd=_0xb6637c['sourcePosition'],_0x3edd04=_0xb6637c['howMany'],_0x2d5cc5=new _0x3ca371(_0x3f11cd,_0x3edd04);_0x5b0aab['batch']['addOperation'](_0x2d5cc5),_0x5649f6['model']['applyOperation'](_0x2d5cc5);break;}}}for(const _0x38b784 of _0x31bedc){const _0x432c2d=_0x5649f6['model']['createRangeOn'](_0x38b784),_0x2b39ad='suggestion:formatBlock:$fakeWrap:'+ot()+':$aiSuggestion';_0x5e349a['markers']['set'](_0x2b39ad,_0x47a21e(_0x432c2d,_0x5649f6['model']));}});}(_0x856b01,_0xe837e6,_0x38b068):_0x38b068['model']['change'](_0x3db86d=>{for(const _0x3e4246 of _0x856b01)if('remove'==_0x3e4246['type']){const _0x4cfea6=_0x3e4246['sourcePosition'],_0xdd193e=_0x3e4246['howMany'],_0x335332=new _0x3ca371(_0x4cfea6,_0xdd193e);_0x3db86d['batch']['addOperation'](_0x335332),_0x38b068['model']['applyOperation'](_0x335332);}else{if('marker'==_0x3e4246['type']){const _0x3e8d18=_0x3e4246['name'],_0x45ffc8=_0x3e4246['newRange'];null!==_0x45ffc8?_0xe837e6['markers']['set'](_0x3e8d18,_0x45ffc8):_0xe837e6['markers']['delete'](_0x3e8d18);}else _0x3e4246['baseVersion']=null,_0x3e4246['isDocumentOperation']=!0x1,_0x3db86d['batch']['addOperation'](_0x3e4246),_0x38b068['model']['applyOperation'](_0x3e4246);}});if(_0x3efa22){const _0x5401b7=ks(_0x38b068,_0x856b01,_0xe837e6);Ns(_0x38b068['model'],_0x5401b7),function(_0x4b0d8f,_0x49b86f){const _0x38e616=_0x49b86f['getFirstRange']()['start'];let _0x5d1e8e=_0x49b86f['getFirstRange']()['end'];const _0x1f24c0=_0x38e616['root'];(_0x5d1e8e['textNode']||_0x5d1e8e['nodeAfter']&&_0x5d1e8e['nodeAfter']['is']('$text'))&&(_0x528d2e(_0x5d1e8e,'...'),_0x5d1e8e=_0x5d1e8e['getShiftedBy'](0x3)),(_0x38e616['textNode']||_0x38e616['nodeBefore']&&_0x38e616['nodeBefore']['is']('$text'))&&(_0x528d2e(_0x38e616,'...'),function(_0x51817f,_0x80c76f,_0x12d86f){for(let [_0x5eaa9a,_0x33276c]of _0x51817f['markers']){const _0x543312=_0x33276c['_getTransformedByInsertion'](_0x80c76f,_0x12d86f,!0x1);_0x33276c=_0x543312[0x0],_0x51817f['markers']['set'](_0x5eaa9a,_0x33276c);}}(_0x1f24c0,_0x38e616,0x3),_0x38e616['parent']==_0x5d1e8e['parent']&&(_0x5d1e8e=_0x5d1e8e['getShiftedBy'](0x3)));const _0x3a8d51=_0x4b0d8f['createRange'](_0x4b0d8f['createPositionAt'](_0x1f24c0,0x0),_0x38e616),_0x3b073b=_0x4b0d8f['createRange'](_0x5d1e8e,_0x4b0d8f['createPositionAt'](_0x1f24c0,'end')),_0x156936=[..._0x3a8d51['getMinimalFlatRanges'](),..._0x3b073b['getMinimalFlatRanges']()];_0x156936['reverse']();for(const _0xcb1967 of _0x156936)_0x2f05cd(_0xcb1967),ys(_0x1f24c0,_0xcb1967);}(_0x38b068['model'],_0x5401b7);}const _0x194d7f=_0x38b068['data']['stringify'](_0xe837e6,{'showSuggestionHighlights':!0x0});return{'content':_s(_0x194d7f),'hasChanges':!0x0};}(_0x51c3c4,_0x27c4c0,_0x28e392,_0x9427fd,_0x32848d);return{'type':_0x528431['changes'][0x0]['type'],'index':_0x528431['index'],'content':_0x78d7e,'hasChanges':_0x2d2ecf};});}function Os(_0x211199,_0x57d0f3){for(const [_0x3b17e2,_0x430de3]of _0x211199['markers']){const _0x279669=_0x2e58a9['_createFromRanges'](_0x430de3['getTransformedByOperation'](_0x57d0f3));_0x211199['markers']['set'](_0x3b17e2,_0x279669);}}function ks(_0x9ab336,_0x14a13c,_0x3c6e27){const _0x18e1af=_0x9ab336['plugins']['get']('DocumentCompare');let _0x25a12f=_0x9ab336['model']['createPositionAt'](_0x3c6e27,Number['POSITIVE_INFINITY']),_0x4dc8ee=_0x9ab336['model']['createPositionAt'](_0x3c6e27,0x0);for(const _0x3a6acf of _0x14a13c){let _0x4f50fb,_0xea4106;if(_0x18e1af['isMarkedRemoveOperation'](_0x3a6acf))_0x4f50fb=_0x3a6acf['newRange']['start'],_0xea4106=_0x3a6acf['newRange']['end'];else switch(_0x25a12f=_0x25a12f['getTransformedByOperation'](_0x3a6acf),_0x4dc8ee=_0x4dc8ee['getTransformedByOperation'](_0x3a6acf),_0x3a6acf['type']){case'rename':_0x4f50fb=_0x3a6acf['position'],_0xea4106=_0x4f50fb['getShiftedBy'](0x1);break;case'addAttribute':case'removeAttribute':case'changeAttribute':_0x4f50fb=_0x3a6acf['range']['start'],_0xea4106=_0x3a6acf['range']['end'];break;case'insert':_0x4f50fb=_0x3a6acf['position'],_0xea4106=_0x4f50fb['getShiftedBy'](_0x3a6acf['howMany']);break;case'split':_0x4f50fb=_0x3a6acf['splitPosition'],_0xea4106=_0x3a6acf['moveTargetPosition'];break;case'merge':{const _0x2f2578=_0x3a6acf['targetPosition']['path']['slice'](0x0,-0x1);_0x4f50fb=_0x9ab336['model']['createPositionFromPath'](_0x3c6e27,_0x2f2578),_0xea4106=_0x4f50fb['getShiftedBy'](0x1);break;}case'move':case'remove':{const _0x2ca537=_0x3a6acf['howMany'],_0xa87429=_0x3a6acf['sourcePosition']['_getTransformedByInsertion'](_0x3a6acf['targetPosition'],_0x2ca537),_0x4fd13e=_0x3a6acf['getMovedRangeStart']();'remove'==_0x3a6acf['type']?(_0x4f50fb=_0xa87429,_0xea4106=_0xa87429):(_0x4f50fb=_0x4fd13e,_0xea4106=_0x4fd13e['getShiftedBy'](_0x2ca537));break;}}_0x4f50fb&&_0x4f50fb['isBefore'](_0x25a12f)&&(_0x25a12f=_0x4f50fb['clone'](),_0x25a12f['stickiness']='toNone'),_0xea4106&&_0xea4106['isAfter'](_0x4dc8ee)&&(_0x4dc8ee=_0xea4106['clone'](),_0x4dc8ee['stickiness']='toNone');}return _0x9ab336['model']['createSelection'](_0x9ab336['model']['createRange'](_0x25a12f,_0x4dc8ee));}function Ns(_0x5df36b,_0x5365b9){vs(_0x5df36b,_0x5365b9,'forward');const _0x304787=_0x5365b9['getFirstRange']();_0x5365b9['setTo']([]),_0x5365b9['setTo'](_0x304787,{'backward':!0x0}),vs(_0x5df36b,_0x5365b9,'backward');}function vs(_0x17d024,_0x81f0ca,_0x184871){let _0x3d73b4=0x14;for(;_0x3d73b4;){_0x17d024['modifySelection'](_0x81f0ca,{'unit':'word','direction':_0x184871}),_0x3d73b4--;const _0x7e8eef=_0x81f0ca['focus']['forward'==_0x184871?'nodeBefore':'nodeAfter'];if(_0x7e8eef&&_0x7e8eef['is']('element')&&_0x17d024['schema']['isBlock'](_0x7e8eef)&&_0x17d024['schema']['isObject'](_0x7e8eef))break;}}function ys(_0x335aed,_0x383165){for(const [_0x4315d7,_0x593d3b]of _0x335aed['markers']){const _0x30efa6=_0x593d3b['_getTransformedByDeletion'](_0x383165['start'],_0x383165['end']['offset']-_0x383165['start']['offset']);null!=_0x30efa6?_0x335aed['markers']['set'](_0x4315d7,_0x30efa6):_0x335aed['markers']['delete'](_0x4315d7);}}class xs extends ht(){['id'];['interactionId'];['type'];['sources']=[];['parsedContent']=new _0x4760d6([]);['parsedMergedContent']=new _0x4760d6([]);['changeGroups']=[];['areActionsDisabled']=!0x1;['isFromHistory']=!0x1;['documentContextContent'];['documentId'];['dataIdDocumentSources'];['newNodeAnchorIds']=new Map();['aiResponseParser'];['aiResponseApplier'];['locale'];['cachedSuggestionContentParts']={'withDiff':[],'withoutDiff':[]};constructor({type:_0xfed197,content:_0x4b27de='',isDone:_0x2b1e6f=!0x1,isComplete:_0xdc6dad,interactionId:_0x5e587e,areActionsDisabled:_0x54a2c6,isFromHistory:_0x3b7551=!0x1,documentContextContent:_0x4b55d1,dataIdDocumentSources:_0x20a35d,documentId:_0x27adb6,locale:_0x348c63,id:_0x109abd}){super(),this['id']=_0x109abd||ot(),this['interactionId']=_0x5e587e,this['type']=_0xfed197,this['areActionsDisabled']=!!_0x54a2c6,this['locale']=_0x348c63,this['dataIdDocumentSources']=_0x20a35d,this['documentId']=_0x27adb6,this['isFromHistory']=_0x3b7551,this['aiResponseParser']=new bs(),this['aiResponseApplier']=new Ss(),this['documentContextContent']=_s(_0x4b55d1||''),this['set']('isDone',_0x2b1e6f),this['set']('isComplete',_0xdc6dad??_0x2b1e6f),this['on']('change:content',()=>{this['onContentChange']();}),this['set']('content',_0x4b27de);}['appendContent'](_0x412c80){this['set']('content',this['content']+_0x412c80);}['done'](_0x3c2489=!0x0){this['isComplete']=_0x3c2489,this['isDone']||(this['set']('isDone',!0x0),this['onContentChange']());}['destroy'](){this['stopListening']();}['setChangeGroupState'](_0x59175f,_0x557f8f){this['changeGroups'][_0x59175f]['state']=_0x557f8f,this['fire']('replyChangeGroupStateUpdated',{'reply':this,'index':_0x59175f,'state':_0x557f8f});}['getContentParts']({showDiff:_0x5407d9,groupIndex:_0x33b716,editor:_0x5f29e2}){const _0x2ef05f=this['_getCachedContentParts'](_0x5407d9,_0x33b716);if(_0x2ef05f)return _0x2ef05f;let _0x144095=[];if(void 0x0===_0x33b716)_0x144095=this['changeGroups'];else{const _0x4f1cef=this['changeGroups']['find'](({index:_0x1c1777})=>_0x1c1777===_0x33b716);if(!_0x4f1cef)throw new at('ai-reply-get-content-parts-group-not-found',null,{'aiReply':this,'groupIndex':_0x33b716});_0x144095=[_0x4f1cef];}const _0x1e6704=Rs({'editor':_0x5f29e2,'showDiff':_0x5407d9,'changeGroups':_0x144095,'documentContextContent':this['documentContextContent']});return this['_setCachedContentParts'](_0x5407d9,_0x1e6704),_0x1e6704;}['_getCachedContentParts'](_0x4aad7c,_0x522f08){const _0x2f0f72=_0x4aad7c?'withDiff':'withoutDiff';if(!this['cachedSuggestionContentParts'][_0x2f0f72]['length'])return null;const _0x2b5ec0=this['cachedSuggestionContentParts'][_0x2f0f72];if(void 0x0===_0x522f08)return _0x2b5ec0['length']>0x0&&_0x2b5ec0['length']!==this['changeGroups']['length']?(this['_setCachedContentParts'](_0x4aad7c,null),null):_0x591848(_0x2b5ec0);{const _0x12e4eb=_0x2b5ec0['find'](({index:_0x42b796})=>_0x42b796===_0x522f08);if(_0x12e4eb)return[_0x591848(_0x12e4eb)];}return null;}['_setCachedContentParts'](_0x38792b,_0x539338){const _0x404e9c=_0x38792b?'withDiff':'withoutDiff';_0x539338?_0x539338['forEach'](_0x59f416=>{const _0x515179=this['cachedSuggestionContentParts'][_0x404e9c],_0x41fdfc=_0x515179['find'](({index:_0x2632a6})=>_0x2632a6===_0x59f416['index']);if(_0x41fdfc){const _0x5d471a=_0x515179['indexOf'](_0x41fdfc);_0x515179['splice'](_0x5d471a,0x1,_0x59f416);}else _0x515179['push'](_0x59f416);}):this['cachedSuggestionContentParts'][_0x404e9c]['length']=0x0;}['onContentChange'](){if('modification'===this['type']){this['parsedContent']=this['aiResponseParser']['parseAndNormalizeHTML'](this['content']);const _0x53808f=this['changeGroups'];this['updateChangeGroups']();const _0x9c1324=this['_getDifferentChangeGroups'](_0x53808f,this['changeGroups']);(_0x9c1324['length']||this['isDone'])&&(this['fire']('replyContentUpdated',this,_0x9c1324),this['cachedSuggestionContentParts']['withDiff']['length']=this['cachedSuggestionContentParts']['withoutDiff']['length']=0x0);}else this['parsedContent']=this['aiResponseParser']['convertMarkdownToHTML'](this['content']),this['fire']('replyContentUpdated',this);}['_getDifferentChangeGroups'](_0x13aa3e,_0x5bbd07){const _0x15d6fb=[];for(const _0x2cb738 of _0x5bbd07){const _0x26352b=_0x13aa3e[_0x2cb738['index']];_0x26352b?_0x26352b['changes']['length']!==_0x2cb738['changes']['length']?_0x15d6fb['push'](_0x2cb738):_0x26352b['changes']['forEach']((_0xef369b,_0x296e9c)=>{const _0x44d4ba=_0x2cb738['changes'][_0x296e9c];_0xef369b['id']!==_0x44d4ba['id']&&_0x15d6fb['push'](_0x2cb738);}):_0x15d6fb['push'](_0x2cb738);}return _0x15d6fb;}['updateChangeGroups'](){const _0x5d8c3d=this['locale']?new _0x3266dc('p',{},[new _0x3266dc('span',{'style':'color:\x20#808080;\x20font-style:\x20italic'},[new _0x5adb0c(hs(this['locale'],'AI_SUGGESTION_CONTENT_PART_REMOVED'))])]):void 0x0,_0x100815=this['aiResponseApplier']['merge'](this['parsedContent'],this['documentContextContent']['cloneNode'](!0x0),{'markUnstableElements':!this['isDone']||!this['isComplete'],'replaceRemovedWith':_0x5d8c3d,'cutAfterLastChange':!this['isDone']||!this['isComplete']});if(!_0x100815['modifiedNodeIds']['length']&&!this['isDone'])return;this['parsedMergedContent']=_0x100815['parsedContent'],this['newNodeAnchorIds']=_0x100815['newAnchorIds'];let _0x4e7601=[];if(_0x538dd8(_0x20a326=>{const _0x2bd0c2=Es(_0x20a326,'data-id');if(!_0x2bd0c2||!_0x5ca13f(_0x2bd0c2))return!0x1;const _0x2f0856=[_0x20a326,...Ts(_0x20a326)]['at'](-0x2);if(_0x20a326!=_0x2f0856){const _0x21bbd5=Es(_0x2f0856,'data-id');_0x5ca13f(_0x21bbd5)||(_0x4e7601['push']({'node':_0x2f0856,'id':_0x21bbd5,'type':'modified'}),_0x100815['modifiedNodeIds']['push'](_0x21bbd5));}else _0x100815['modifiedNodeIds']['includes'](_0x2bd0c2)?_0x4e7601['push']({'node':_0x20a326,'type':'modified','id':_0x2bd0c2}):_0x100815['newNodeIds']['includes'](_0x2bd0c2)?_0x4e7601['push']({'node':_0x20a326,'type':'new','id':_0x2bd0c2,'anchorId':Es(_0x20a326['previousSibling'],'data-id')}):_0x4e7601['push']({'node':_0x20a326,'type':'removed','id':_0x2bd0c2});return!0x0;},this['parsedMergedContent']),_0x4e7601=_0x4e7601['filter'](({node:_0xeb41da})=>[...Ts(_0xeb41da),_0xeb41da]['every'](_0x10126a=>!Es(_0x10126a,'data-unstable'))),0x0==_0x4e7601['length'])return;const _0xd5bc5e=[[_0x4e7601[0x0]]];for(let _0x23d095=0x1;_0x23d095<_0x4e7601['length'];_0x23d095++){const _0x4076b8=_0xd5bc5e[_0xd5bc5e['length']-0x1],_0x10fb32=_0x4076b8[_0x4076b8['length']-0x1];_0x4e7601[_0x23d095]['node']['previousSibling']==_0x10fb32['node']&&'modified'!=_0x4e7601[_0x23d095]['type']&&'modified'!=_0x10fb32['type']&&this['_isSameDocument'](_0x4e7601[_0x23d095]['node'],_0x10fb32['node'])?_0x4076b8['push'](_0x4e7601[_0x23d095]):_0xd5bc5e['push']([_0x4e7601[_0x23d095]]);}for(const _0x3e5034 of _0xd5bc5e){const _0x51c722=_0x3e5034[0x0],_0x338dda=_0x3e5034[_0x3e5034['length']-0x1],_0x3e25c7=_0x1c47cc(_0x51c722['node']['previousSibling']);_0x3e25c7&&this['_isSameDocument'](_0x3e25c7['node'],_0x51c722['node'])&&_0x3e5034['unshift'](_0x3e25c7);const _0x4948b0=_0x1c47cc(_0x338dda['node']['nextSibling']);_0x4948b0&&this['_isSameDocument'](_0x4948b0['node'],_0x338dda['node'])&&_0x3e5034['push'](_0x4948b0);}function _0x5ca13f(_0x239f6c){return _0x100815['modifiedNodeIds']['includes'](_0x239f6c)||_0x100815['newNodeIds']['includes'](_0x239f6c)||_0x100815['removedNodeIds']['includes'](_0x239f6c);}function _0x1c47cc(_0x180764){if(_0x180764&&Es(_0x180764,'data-id')&&!Es(_0x180764,'data-unstable')){const _0x501cb6=Es(_0x180764,'data-id');if(!_0x5ca13f(_0x501cb6))return{'node':_0x180764,'type':'context','id':_0x501cb6};}return null;}this['changeGroups']=_0xd5bc5e['map']((_0x255efa,_0x41cd66)=>({'changes':_0x255efa,'state':'pending','index':_0x41cd66}));}['_isSameDocument'](_0x1471fa,_0x19f33a){if(!this['dataIdDocumentSources']?.['size'])return!0x0;const _0x531c0b=this['_resolveDocumentSource'](_0x1471fa),_0x123a5d=this['_resolveDocumentSource'](_0x19f33a);return!_0x531c0b||!_0x123a5d||_0x531c0b['editor']===_0x123a5d['editor']&&_0x531c0b['rootName']===_0x123a5d['rootName'];}['_resolveDocumentSource'](_0x5dd78a){if(!_0x5dd78a||!this['dataIdDocumentSources'])return;const _0x1b4b0c=Es(_0x5dd78a,'data-id');if(_0x1b4b0c){const _0x2c8254=this['dataIdDocumentSources']['get'](_0x1b4b0c);if(_0x2c8254)return _0x2c8254;const _0x36e46d=this['newNodeAnchorIds']['get'](_0x1b4b0c),_0x2df7ce=_0x36e46d?this['dataIdDocumentSources']['get'](_0x36e46d):void 0x0;if(_0x2df7ce)return _0x2df7ce;}for(let _0xb4be85=_0x5dd78a['previousSibling'];_0xb4be85;_0xb4be85=_0xb4be85['previousSibling']){const _0x3d88f6=Es(_0xb4be85,'data-id'),_0x11fda8=_0x3d88f6?this['dataIdDocumentSources']['get'](_0x3d88f6):void 0x0;if(_0x11fda8)return _0x11fda8;}for(let _0x2a1f36=_0x5dd78a['nextSibling'];_0x2a1f36;_0x2a1f36=_0x2a1f36['nextSibling']){const _0x47f0ed=Es(_0x2a1f36,'data-id'),_0x3a5e5=_0x47f0ed?this['dataIdDocumentSources']['get'](_0x47f0ed):void 0x0;if(_0x3a5e5)return _0x3a5e5;}}}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:_0x50d6f4,locale:_0x59d91a}){super(),this['id']=ot(),this['connector']=_0x50d6f4,this['isStopped']=!0x0,this['locale']=_0x59d91a;}async['start'](){const _0x1ae833=[];let _0x57b29d,_0x45e18b,_0x5f544d,_0xb93119=!0x1;this['isStopped']=!0x1;try{this['currentRequest']=await this['sendRequest'](),this['fire']('interactionStarted',this);const _0x581705=await this['currentRequest']['getStream']();for await(const _0x127560 of _0x581705){if(this['isStopped'])return;if('error'==_0x127560['event'])return void this['fire']('error',{'error':new at('ai-chat-interaction-error',this)});switch(_0x127560['event']){case'message-metadata':this['messageId']=_0x127560['data']['messageId'];break;case'action-metadata':this['actionCallId']=_0x127560['data']['callId'];break;case'conversation-title':this['setConversationTitle'](_0x127560['data']['conversationTitle'],!0x0);break;case'source':_0x1ae833['push'](_0x127560['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'](),_0x57b29d='modification-delta'==_0x127560['event']?'modification':'text',_0x45e18b='modification-delta'==_0x127560['event']?_0x127560['data']['id']:void 0x0,this['currentReply']&&this['currentReply']['type']!=_0x57b29d&&(this['currentReply']['done'](),this['currentReply']=void 0x0),this['currentReply']?'modification-delta'==_0x127560['event']&&(this['currentReply']['documentId']=_0x127560['data']['documentId']):(this['currentReply']=this['createReply']({'type':_0x57b29d,'interactionId':this['id'],'id':_0x45e18b,...'modification-delta'==_0x127560['event']&&{'documentId':_0x127560['data']['documentId']}}),'modification'==_0x57b29d&&(this['currentReply']['sources']=_0x1ae833['splice'](0x0))),this['currentReply']['appendContent'](_0x127560['data']['textDelta']);break;case'mcp-tool-result':_0x5f544d=JSON['parse'](_0x127560['data']['result']),this['_handleToolResultData']({'toolName':_0x127560['data']['toolName'],'data':_0x5f544d['data'],'attributes':_0x5f544d['attributes']});break;case'mcp-tool-notification':this['_handleToolNotificationData']({'toolName':_0x127560['data']['toolName'],'data':_0x127560['data']['data']});}}_0xb93119=!0x0;}finally{this['isStopped']||(this['currentReply']&&_0x1ae833['length']>0x0&&(this['currentReply']['sources']=_0x1ae833['splice'](0x0)),this['_finalizeInteraction'](_0xb93119),this['fire']('interactionFinished',this));}}['stop'](){this['isStopped']||(this['_finalizeInteraction'](),this['fire']('interactionStopped',this));}['getReply'](_0x55aa17){return this['replies']['find'](_0x5df67b=>_0x5df67b['id']===_0x55aa17);}['destroy'](){this['isDestroyed']||(this['stop'](),this['replies']['forEach'](_0x2a118c=>_0x2a118c['destroy']()),this['replies']=[],this['isDestroyed']=!0x0,this['fire']('interactionDestroyed',this),this['stopListening']());}['createReply'](_0x476a8b){const _0xfc994a=new xs({'locale':this['locale'],'documentContextContent':this['getDocumentContext']()?.['content'],'dataIdDocumentSources':this['getDocumentContext']()?.['dataIdDocumentSources'],..._0x476a8b});return this['replies']['push'](_0xfc994a),_0xfc994a['delegate'](...Ls)['to'](this),this['fire']('replyCreated',_0xfc994a),_0xfc994a;}['setConversationTitle'](_0x51f239,_0x3d6d53=!0x1){this['fire']('setConversationTitle',_0x51f239,_0x3d6d53);}['resetWebSearchState'](){this['_isWebSearching']&&(this['_isWebSearching']=!0x1,this['fire']('webSearchFinished',this));}['resetReasoningState'](){this['_isReasoning']&&(this['_isReasoning']=!0x1,this['fire']('reasoningFinished',this));}['_handleToolResultData'](_0x106210){this['fire']('toolDataReceived',{'type':'result','toolName':_0x106210['toolName'],'data':structuredClone(_0x106210['data']||{}),'attributes':structuredClone(_0x106210['attributes']||{})},this);}['_handleToolNotificationData'](_0x492f9c){this['fire']('toolDataReceived',{'type':'notification','toolName':_0x492f9c['toolName'],'data':structuredClone(_0x492f9c['data'])},this);}['_finalizeInteraction'](_0x202569=!0x1){this['isStopped']=!0x0,this['currentRequest']&&this['currentRequest']['abortController']['abort'](),this['currentReply']&&this['currentReply']['done'](_0x202569),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:_0x51e6bf,config:_0x144a26,ownerId:_0x5e4b59}){super(),this['_connector']=_0x51e6bf,this['_config']=_0x144a26,this['_ownerId']=_0x5e4b59;}['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'](_0x43ed6b){if(_0x43ed6b)return this['_documentSources']['get'](_0x43ed6b);}['getSourceByDataId'](_0x2168ec){if(_0x2168ec)return this['_dataIdToSource']['get'](_0x2168ec);}['getDocumentContextSlice'](_0x2f0140){const _0x42a56b=this['getDocumentSource'](_0x2f0140);if(_0x42a56b)return{'editor':_0x42a56b['editor'],'rootName':_0x42a56b['rootName'],'html':_0x42a56b['content'],'version':_0x42a56b['version']};}['getDocumentContextSliceByDataId'](_0x189aef){const _0x59b8d4=this['getSourceByDataId'](_0x189aef);return _0x59b8d4?this['getDocumentContextSlice'](_0x59b8d4['documentId']):void 0x0;}['getPendingContextItems'](){return this['_pendingContextItems'];}async['populateFromMessage'](_0x26edc3){const _0x549e5f=await this['_createContextItemFromContent'](_0x26edc3);return this['_addToConversationContextItem'](_0x549e5f),'current-document'===_0x549e5f['uiId']&&this['_toggleAddCurrentDocumentOptionVisibility'](),_0x549e5f;}async['populateDocumentsFromUserMessage'](_0x396b52,_0x416409){const _0x46b447=_0x396b52['filter'](_0x294e17=>'document'===_0x294e17['type']);if(0x0===_0x46b447['length'])return{'hasUnmatched':!0x1};if(0x1===_0x46b447['length'])return{'contextItem':await this['populateFromMessage'](_0x46b447[0x0]),'hasUnmatched':!0x1};const _0x5e6ef9=_0x46b447['map'](_0x4194fd=>_0x4194fd['id']),_0x20200f=await this['_connector']['fetchDocuments'](this['_ownerId'],_0x5e6ef9)['getDocuments'](),_0x16a917=new Map(_0x20200f['map'](_0x317435=>[_0x317435['id'],_0x317435]));this['_documentSources']['clear'](),this['_dataIdToSource']['clear']();const _0x35b280=[];let _0x51522b=!0x1;for(const _0x4e0229 of _0x46b447){const _0x11fefc=_0x16a917['get'](_0x4e0229['id']);if(!_0x11fefc)continue;const _0x4b357d=this['_matchDocumentToRoot'](_0x11fefc,_0x416409),_0x24de54=_0x416409[0x0]&&this['_getFirstRoot'](_0x416409[0x0]);_0x4b357d||(_0x51522b=!0x0);const _0x26c2ac=_0x4b357d?.['editor']??_0x24de54?.['editor'],_0x156416=_0x4b357d?.['rootName']??_0x24de54?.['rootName'];if(_0x26c2ac&&_0x156416){const _0x2a6b86={'editor':_0x26c2ac,'rootName':_0x156416,'content':_0x11fefc['content'],'version':_0x11fefc['attributes']?.['version']??0x0,'name':_0x11fefc['name'],'description':_0x11fefc['description']};this['_documentSources']['set'](_0x11fefc['id'],_0x2a6b86);const _0x3c2447=_s(_0x11fefc['content']);for(const _0x638041 of _0x538dd8(_0x9e059=>!!Es(_0x9e059,'data-id'),_0x3c2447)){const _0x3b1329=Es(_0x638041,'data-id');_0x3b1329&&this['_dataIdToSource']['set'](_0x3b1329,{..._0x2a6b86,'documentId':_0x11fefc['id']});}}_0x35b280['push']({'id':_0x11fefc['id'],'content':_0x11fefc['content'],'version':_0x11fefc['attributes']?.['version']??0x0,'sessionId':_0x11fefc['attributes']?.['sessionId']??null,'selection':[]});}const _0x49a32f={'id':'current-document','uiId':'current-document','label':'Current\x20document','type':'document','hidden':this['_conversationContextItems']['has']('current-document'),'documents':_0x35b280,'dataIdDocumentSources':new Map(this['_dataIdToSource'])};return this['_addToConversationContextItem'](_0x49a32f),this['_toggleAddCurrentDocumentOptionVisibility'](),{'contextItem':_0x49a32f,'hasUnmatched':_0x51522b};}['_matchDocumentToRoot'](_0x18710e,_0x278a6a){if(_0x18710e['name'])for(const _0x4b429c of _0x278a6a){const _0x17ebfc=_0x4b429c['config']['get']('roots')||{};for(const _0x51665b of _0x4b429c['model']['document']['getRoots']()){if('$graveyard'===_0x51665b['rootName'])continue;const _0x78eaca=_0x17ebfc[_0x51665b['rootName']];if(_0x51665b['rootName']===_0x18710e['name']&&_0x78eaca?.['description']===_0x18710e['description'])return{'editor':_0x4b429c,'rootName':_0x51665b['rootName']};}}}['_getFirstRoot'](_0xc33a61){for(const _0x542df4 of _0xc33a61['model']['document']['getRoots']())if('$graveyard'!==_0x542df4['rootName'])return{'editor':_0xc33a61,'rootName':_0x542df4['rootName']};}async['_createContextItemFromContent'](_0x6f5db5){if('document'===_0x6f5db5['type']){const _0x41f0b6=await this['_connector']['fetchDocument'](this['_ownerId'],_0x6f5db5['id'])['getDocument']();return{'id':'current-document','uiId':'current-document','label':'Current\x20document','type':_0x6f5db5['type'],'content':_0x41f0b6['content'],'hidden':this['_conversationContextItems']['has']('current-document'),'version':_0x41f0b6['attributes']?.['version'],'sessionId':_0x41f0b6['attributes']?.['sessionId']};}if('mcp-tool-context'===_0x6f5db5['type'])return{'id':_0x6f5db5['id'],'uiId':_0x6f5db5['id'],'label':_0x6f5db5['data']?.['label']||_0x6f5db5['id'],'type':'mcp-tool-context','mcpServerName':_0x6f5db5['mcpServerName'],'toolName':_0x6f5db5['toolName'],'data':_0x6f5db5['data']||{}};return{'id':_0x6f5db5['id'],'uiId':_0x6f5db5['id'],'label':_0x6f5db5['attributes']?.['label']||_0x6f5db5['name']||_0x6f5db5['url']||_0x6f5db5['id'],'type':_0x6f5db5['type'],..._0x6f5db5?.['attributes']?.['resourceId']?{'resourceId':_0x6f5db5['attributes']?.['resourceId']}:{}};}['getSentContextItems'](){return new Map(this['_conversationContextItems']);}['removeFromContext'](_0x2a0734){const _0x1930dd=this['_pendingContextItems']['get'](_0x2a0734);_0x1930dd?.['isReadOnly']||this['_removeContextItem'](_0x2a0734);}['clearPendingContextItems'](){if(0x0===this['_pendingContextItems']['size'])return;for(const _0x4ac1ea of this['_pendingContextItems']['values']())this['_removeContextItem'](_0x4ac1ea['uiId']);const _0x195173=this['_conversationContextItems']['get']('current-document')||this['_pendingContextItems']['get']('current-document');_0x195173&&this['_addContextItem']({..._0x195173,'isReadOnly':!0x0,'hidden':!0x0});}['addToConversationContext'](_0x578433){for(const _0x5d12aa of _0x578433['values']())this['_addToConversationContextItem'](_0x5d12aa);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'](_0x1d3043){return Array['from'](_0x1d3043['values']())['flatMap'](_0x3febc7=>this['_mapContextItemToRequestData'](_0x3febc7));}async['addFilesToContext'](_0x442734,_0x2c2b3e,_0x437be3='file'){const _0x7e98e6='files-'+ot();this['_startUploadOperation'](_0x7e98e6);try{await Promise['all'](_0x442734['map'](async _0x2fe761=>{const _0x49b1c9='file-'+ot(),_0x3d0b43=_0x3e39fc(_0x2fe761['name']);try{this['_addContextItem']({'type':_0x437be3,'label':_0x2c2b3e?.['label']||_0x3d0b43,'uiId':_0x49b1c9,'resourceId':_0x2c2b3e?.['resourceId']},!0x0);const _0x3ff6be=this['_connector']['uploadFile'](this['_ownerId'],_0x2fe761,_0x2c2b3e);this['_ongoingUploads']['set'](_0x49b1c9,_0x3ff6be['abortController']);const {id:_0xe8ffbf}=await _0x3ff6be['getId']();this['_ongoingUploads']['delete'](_0x49b1c9),this['_finishContextItemLoading']({'type':_0x437be3,'id':_0xe8ffbf,'label':_0x2c2b3e?.['label']||_0x3d0b43,'uiId':_0x49b1c9,'resourceId':_0x2c2b3e?.['resourceId']},!0x1);}catch(_0x3e67c0){this['_ongoingUploads']['delete'](_0x49b1c9);if(!(_0x3e67c0 instanceof at&&_0x3e67c0['message']['startsWith']('ai-request-aborted'))){const _0x30a3cf=Ps['get'](_0x3e67c0['code'])||'ai-chat-file-upload-failed',_0x2d0b15=new at(_0x30a3cf,null,{'fileName':_0x3d0b43,..._0x3e67c0});_0x2d0b15['stack']=_0x3e67c0['stack'],this['fire']('error',{'error':_0x2d0b15});}this['_removeContextItem'](_0x49b1c9);}}));}finally{this['_finishUploadOperation'](_0x7e98e6);}}['addCurrentDocumentToContext'](_0x531173){if(this['isCurrentDocumentInContext']()||!this['_addContextOptionsState']['document']['enabled'])return;const _0x334b26={'type':'document','uiId':'current-document','label':_0x531173,'isReadOnly':this['_conversationContextItems']['has']('current-document'),'hidden':this['_conversationContextItems']['has']('current-document')};this['_addContextItem'](_0x334b26);}async['updateCurrentDocument'](_0x5cbf5e,_0x4721c8,_0x4e0838,_0x302ae2){const _0x5911c9=this['_pendingContextItems']['get']('current-document');if(_0x5911c9&&_0x5cbf5e){_0x5911c9['selection']=_0x302ae2?_0x302ae2['map'](_0x819304=>({'start':_0x819304['start'],'end':_0x819304['end']})):[];try{if(_0x5911c9['version']===_0x4721c8)return;const {id:_0x2e4bc5}=await this['_connector']['uploadDocument'](this['_ownerId'],_0x5cbf5e,{'version':_0x4721c8,'sessionId':_0x4e0838})['getId']();_0x5911c9['id']=_0x2e4bc5,_0x5911c9['content']=_0x5cbf5e,_0x5911c9['version']=_0x4721c8,_0x5911c9['sessionId']=_0x4e0838;}catch(_0x2ec6a7){const _0x1f32b=new at('ai-chat-document-upload-failed',null);_0x1f32b['stack']=_0x2ec6a7['stack'],this['fire']('error',{'error':_0x1f32b});}}}async['updateDocuments'](_0x496079){const _0x2a73a2=this['_pendingContextItems']['get']('current-document');if(!_0x2a73a2||!_0x496079['length']||_0x496079['every'](_0x3297ac=>!_0x3297ac['content']))return;_0x496079['length']>0x1&&_0x496079['some'](_0x579490=>!_0x579490['description'])&&It('ai-chat-documents-missing-description');const _0x2eeaad=_0x3570b0=>_0x3570b0?_0x3570b0['map'](_0x3083e1=>({'start':_0x3083e1['start'],'end':_0x3083e1['end']})):[],_0x434628=_0x2a73a2['documents']??[];if(_0x434628['length']===_0x496079['length']&&_0x496079['every']((_0x27f05c,_0x44c992)=>_0x434628[_0x44c992]?.['version']===_0x27f05c['version']))_0x2a73a2['documents']=_0x434628['map']((_0x4e8abc,_0x46a1d9)=>({..._0x4e8abc,'selection':_0x2eeaad(_0x496079[_0x46a1d9]['selections'])}));else try{const _0x39c69d=await this['_connector']['uploadDocuments'](this['_ownerId'],_0x496079)['getIds']();_0x2a73a2['documents']=_0x496079['map']((_0xad57e3,_0xbdb371)=>({'id':_0x39c69d[_0xbdb371]?.['id'],'content':_0xad57e3['content'],'version':_0xad57e3['version'],'sessionId':_0xad57e3['sessionId'],'selection':_0x2eeaad(_0xad57e3['selections'])})),this['_documentSources']['clear'](),this['_dataIdToSource']['clear']();for(let _0xeaa8ff=0x0;_0xeaa8ff<_0x496079['length'];_0xeaa8ff++){const _0x27b1ee=_0x39c69d[_0xeaa8ff]?.['id'],_0x356f00=_0x496079[_0xeaa8ff];if(!_0x27b1ee)continue;const _0xca313f={'editor':_0x356f00['editor'],'rootName':_0x356f00['rootName'],'content':_0x356f00['content'],'version':_0x356f00['version'],'name':_0x356f00['name'],'description':_0x356f00['description']};this['_documentSources']['set'](_0x27b1ee,_0xca313f);const _0x338e61=_s(_0x356f00['content']);for(const _0x3d3740 of _0x538dd8(_0x550699=>!!Es(_0x550699,'data-id'),_0x338e61)){const _0x21c321=Es(_0x3d3740,'data-id');_0x21c321&&this['_dataIdToSource']['set'](_0x21c321,{..._0xca313f,'documentId':_0x27b1ee});}}_0x2a73a2['dataIdDocumentSources']=new Map(this['_dataIdToSource']);}catch(_0x3488ab){const _0x5ab64b=new at('ai-chat-document-upload-failed',null);_0x5ab64b['stack']=_0x3488ab['stack'],this['fire']('error',{'error':_0x5ab64b});}}['addSelectionToContext'](_0x506d8){this['_addContextItem']({'type':'selection','label':_0x506d8,'uiId':'selection','content':_0x506d8});}['removeSelectionFromContext'](){this['_removeContextItem']('selection');}async['addUrlToContext'](_0x2c8b9a,_0x1084ce){const _0x2411ae='url-'+ot();this['_startUploadOperation'](_0x2411ae);const _0x5383f3='url-'+ot();try{this['_addContextItem']({'type':'web-resource','label':_0x1084ce?.['label']||_0x2c8b9a,'uiId':_0x5383f3,'resourceId':_0x1084ce?.['resourceId']},!0x0);const _0x2e3e76=this['_connector']['uploadUrl'](this['_ownerId'],_0x2c8b9a,_0x1084ce);this['_ongoingUploads']['set'](_0x5383f3,_0x2e3e76['abortController']);const {id:_0x28210c}=await _0x2e3e76['getId']();this['_ongoingUploads']['delete'](_0x5383f3),this['_finishContextItemLoading']({'type':'web-resource','id':_0x28210c,'label':_0x1084ce?.['label']||_0x2c8b9a,'uiId':_0x5383f3,'resourceId':_0x1084ce?.['resourceId']},!0x1);}catch(_0xb7d1de){this['_ongoingUploads']['delete'](_0x5383f3),(_0xb7d1de['message']['startsWith']('ai-request-aborted')||this['fire']('error',{'error':new at('ai-chat-url-upload-failed',this,{'url':_0x2c8b9a,'originalError':_0xb7d1de}),'url':_0x2c8b9a}),this['_removeContextItem'](_0x5383f3));}finally{this['_finishUploadOperation'](_0x2411ae);}}['addToolItemToContext'](_0x3da916){_0x3da916['id']=_0x3da916['id']??ot()['substring'](0x0,0x15),this['_pendingContextItems']['set'](_0x3da916['uiId'],_0x3da916),this['fire']('contextItemAdded',{'contextItem':_0x3da916,'isLoading':!0x1});}async['loadSourceResources'](_0x144e37,_0x87496b,_0x534e72){const _0x5acd18=this['_addContextOptionsState']['sources']['find'](_0x38b9d0=>_0x38b9d0['id']===_0x144e37);if(!_0x5acd18)return this['fire']('error',{'error':new at('ai-chat-source-not-found',this,{'sourceId':_0x144e37}),'sourceId':_0x144e37}),[];try{const _0x267c14=(await _0x5acd18['getResources'](_0x87496b))['map'](_0x51d138=>{const _0x3751e7=this['_isResourceInContext'](_0x51d138['id']);return{..._0x51d138,'isInContext':_0x3751e7};});return _0x5acd18['resources']=_0x267c14,this['fire']('sourceResourcesLoaded',{'sourceId':_0x144e37,'source':_0x5acd18,'resources':_0x267c14,'uid':_0x534e72}),_0x267c14;}catch(_0xd65497){return this['fire']('error',{'error':new at('ai-chat-source-resources-load-failed',this,{'sourceId':_0x144e37,'originalError':_0xd65497}),'sourceId':_0x144e37,'sourceLabel':_0x5acd18['label']}),[];}}async['addResourceToContext'](_0x4519d9,_0x480a39){if(this['_isResourceInContext'](_0x480a39['id']))return;let _0x257156=_0x480a39['data'];if(!_0x257156&&_0x4519d9['getData'])try{_0x257156=await _0x4519d9['getData'](_0x480a39['id']);}catch(_0x3a7aab){return void this['fire']('error',{'error':new at('ai-chat-resource-load-failed',this,{'resourceId':_0x480a39['id'],'sourceId':_0x4519d9['id'],'originalError':_0x3a7aab}),'resourceId':_0x480a39['id'],'sourceId':_0x4519d9['id']});}if(_0x257156)switch(_0x480a39['type']){case'web-resource':if('string'!=typeof _0x257156)return void this['fire']('error',{'error':new at('ai-chat-context-invalid-data',this,{'resourceId':_0x480a39['id'],'sourceId':_0x4519d9['id'],'expectedType':'string','actualType':typeof _0x257156}),'resourceId':_0x480a39['id'],'sourceId':_0x4519d9['id']});await this['addUrlToContext'](_0x257156,{'label':_0x480a39['label'],'resourceId':_0x480a39['id']});break;case'file':if(!(_0x257156 instanceof File))return void this['fire']('error',{'error':new at('ai-chat-context-invalid-data',this,{'resourceId':_0x480a39['id'],'sourceId':_0x4519d9['id'],'expectedType':'File','actualType':typeof _0x257156}),'resourceId':_0x480a39['id'],'sourceId':_0x4519d9['id']});await this['addFilesToContext']([_0x257156],{'label':_0x480a39['label'],'resourceId':_0x480a39['id']});break;case'text':if('object'!=typeof _0x257156||!('content'in _0x257156)||!('type'in _0x257156))return void this['fire']('error',{'error':new at('ai-chat-context-invalid-data',this,{'resourceId':_0x480a39['id'],'sourceId':_0x4519d9['id'],'expectedType':'object\x20with\x20content\x20and\x20type\x20properties','actualType':typeof _0x257156}),'resourceId':_0x480a39['id'],'sourceId':_0x4519d9['id']});_0x257156=Ms['_convertTextResourceToFile'](_0x257156,_0x480a39['label']),await this['addFilesToContext']([_0x257156],{'label':_0x480a39['label'],'resourceId':_0x480a39['id']},'text');break;case'mcp-tool-context':break;default:this['fire']('error',{'error':new at('ai-chat-context-unsupported-type',this,{'resourceId':_0x480a39['id'],'sourceId':_0x4519d9['id'],'resourceType':_0x480a39['type']}),'resourceId':_0x480a39['id'],'sourceId':_0x4519d9['id']});}else this['fire']('error',{'error':new at('ai-chat-resource-no-data',this,{'resourceId':_0x480a39['id'],'sourceId':_0x4519d9['id']}),'resourceId':_0x480a39['id'],'sourceId':_0x4519d9['id']});}static['_convertTextResourceToFile'](_0x5ee54e,_0xef0099){switch(_0x5ee54e['type']){case'markdown':return new File([_0x5ee54e['content']],_0xef0099,{'type':'text/markdown'});case'html':return new File([_0x5ee54e['content']],_0xef0099,{'type':'text/html'});default:return new File([_0x5ee54e['content']],_0xef0099,{'type':'text/plain'});}}static['_mapContextItemToRequestData'](_0x29395b){switch(_0x29395b['type']){case'file':case'text':return[{'type':'file','id':_0x29395b['id']}];case'web-resource':return[{'type':'web-resource','id':_0x29395b['id']}];case'document':return _0x29395b['documents']?.['length']?_0x29395b['documents']['map'](_0x2453b4=>({'type':'document','id':_0x2453b4['id'],..._0x2453b4['selection']?.['length']&&{'selection':_0x2453b4['selection']}})):[{'type':'document','id':_0x29395b['id'],..._0x29395b['selection']?.['length']&&{'selection':_0x29395b['selection']}}];case'mcp-tool-context':{const _0x39a92c=_0x29395b;return[{'type':'mcp-tool-context','mcpServerName':_0x39a92c['mcpServerName'],'toolName':_0x39a92c['toolName'],'data':{..._0x39a92c['data'],'label':_0x39a92c['label']||_0x39a92c['data']?.['label']||_0x39a92c['id']},'id':_0x39a92c['id']}];}default:return[];}}['_addContextItem'](_0x484747,_0x177957=!0x1){if(this['_pendingContextItems']['set'](_0x484747['uiId'],_0x484747),_0x484747['hidden']||this['fire']('contextItemAdded',{'contextItem':_0x484747,'isLoading':_0x177957}),'current-document'===_0x484747['uiId']&&this['_toggleAddCurrentDocumentOptionVisibility'](),_0x484747['resourceId']){const _0x517315=this['_findSourceIdsByResourceId'](_0x484747['resourceId']);_0x517315&&_0x517315['forEach'](_0x3cc402=>{this['_updateResourceInContextState'](_0x3cc402,_0x484747['resourceId'],!0x0);});}}['_removeContextItem'](_0x50c845){const _0x209d04=this['_pendingContextItems']['get'](_0x50c845),_0x341feb=this['_ongoingUploads']['get'](_0x50c845);if(_0x341feb&&(_0x341feb['abort'](),this['_ongoingUploads']['delete'](_0x50c845)),_0x209d04?.['resourceId']){const _0x1d9a8b=this['_findSourceIdsByResourceId'](_0x209d04['resourceId']);_0x1d9a8b&&_0x1d9a8b['forEach'](_0x78af76=>{this['_updateResourceInContextState'](_0x78af76,_0x209d04['resourceId'],!0x1);});}this['_pendingContextItems']['delete'](_0x50c845),this['fire']('contextItemRemoved',{'uiId':_0x50c845,'type':_0x209d04?.['type']}),'current-document'===_0x50c845&&this['_toggleAddCurrentDocumentOptionVisibility']();}['_finishContextItemLoading'](_0x24a8d3,_0x30b42d){if(this['_pendingContextItems']['has'](_0x24a8d3['uiId'])&&(this['_pendingContextItems']['set'](_0x24a8d3['uiId'],_0x24a8d3),this['fire']('contextItemLoadingEnded',{'contextItem':_0x24a8d3,'isLoading':_0x30b42d}),_0x24a8d3['resourceId'])){const _0x3243f3=this['_findSourceIdsByResourceId'](_0x24a8d3['resourceId']);_0x3243f3&&_0x3243f3['forEach'](_0x5dec9f=>{this['_updateResourceInContextState'](_0x5dec9f,_0x24a8d3['resourceId'],!0x0);});}}['_addToConversationContextItem'](_0x44d7d4){this['_conversationContextItems']['set'](_0x44d7d4['uiId'],_0x44d7d4);}['_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'](_0x41a8cb=>({..._0x41a8cb,'enabled':!0x0}))??[]},this['fire']('addContextOptionsChanged',{'options':this['_addContextOptionsState']});}['_getCustomSourcesInitialState'](){return this['_config']?.['sources']?.['map'](_0x4d0e26=>({..._0x4d0e26,'resources':[]}))??[];}['_toggleAddCurrentDocumentOptionVisibility'](){const _0x2c205b=this['isCurrentDocumentInContext']()||this['isCurrentDocumentInConversation']();this['_addContextOptionsState']['document']['isHidden']=_0x2c205b,this['fire']('addContextOptionsChanged',{'options':this['_addContextOptionsState']});}['_isResourceInContext'](_0x327566){for(const _0x6b95da of this['_pendingContextItems']['values']())if(_0x6b95da['resourceId']===_0x327566)return!0x0;for(const _0x3e168e of this['_conversationContextItems']['values']())if(_0x3e168e['resourceId']===_0x327566)return!0x0;return!0x1;}['_findSourceIdsByResourceId'](_0x26b4a1){const _0x1b13e4=[];for(const _0x5b4ad3 of this['_addContextOptionsState']['sources']){_0x5b4ad3['resources']['find'](_0x2862cd=>_0x2862cd['id']===_0x26b4a1)&&_0x1b13e4['push'](_0x5b4ad3['id']);}return 0x0===_0x1b13e4['length']?null:_0x1b13e4;}['_updateResourceInContextState'](_0x463b7c,_0x478365,_0x101d60){const _0x1b5bc1=this['_addContextOptionsState']['sources']['find'](_0x5080cb=>_0x5080cb['id']===_0x463b7c);if(!_0x1b5bc1)return;const _0x12ea8d=_0x1b5bc1['resources']['find'](_0x58cca7=>_0x58cca7['id']===_0x478365);_0x12ea8d&&(_0x12ea8d['isInContext']=_0x101d60,this['fire']('resourceStateChanged',{'sourceId':_0x463b7c,'resourceId':_0x478365,'isInContext':_0x101d60}));}['_startUploadOperation'](_0x2c757d){this['_ongoingUploadOperations']['set'](_0x2c757d,!0x0),this['_ongoingUploadOperations']['size']&&this['fire']('uploadProgressChanged',{'isUploadInProgress':!0x0});}['_finishUploadOperation'](_0xf45d65){this['_ongoingUploadOperations']['delete'](_0xf45d65),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'](_0x4fe5b8){const _0x4bbf17={};return _0x4fe5b8&&_0x4fe5b8['isWebSearchEnabled']&&(_0x4bbf17['webSearch']={}),_0x4fe5b8&&_0x4fe5b8['isReasoningEnabled']&&(_0x4bbf17['reasoning']={}),_0x4bbf17;}['toggleWebSearch'](){this['setWebSearch'](!this['_isWebSearchEnabled']);}['toggleReasoning'](){this['setReasoning'](!this['_isReasoningEnabled']);}['setWebSearch'](_0x172e03){_0x172e03!==this['_isWebSearchEnabled']&&(this['_isWebSearchEnabled']=_0x172e03,this['fire']('capabilitiesUpdated',this['getCapabilitiesConfig']()));}['setReasoning'](_0x564016){_0x564016!==this['_isReasoningEnabled']&&(this['_isReasoningEnabled']=_0x564016,this['fire']('capabilitiesUpdated',this['getCapabilitiesConfig']()));}}class Bs extends Ds{['userMessage'];['conversationId'];['contextItems']=new Map();['capabilities'];['model'];['attributes'];constructor(_0x4a0617){super(_0x4a0617),this['conversationId']=_0x4a0617['conversationId'],this['contextItems']=_0x4a0617['contextItems'],this['capabilities']=_0x4a0617['capabilities'],this['userMessage']=_0x4a0617['userMessage'],this['model']=_0x4a0617['model'],this['attributes']=_0x4a0617['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'](_0x198d75){const _0x26913d=this['getDocumentContext']();if(_0x26913d?.['documents']?.['length']){const _0x12777f=_0x26913d['documents']['map'](_0x2096e3=>_0x2096e3['content']??'')['join']('');if(_0x12777f)return super['createReply']({'documentContextContent':_0x12777f,..._0x198d75});}return super['createReply'](_0x198d75);}}class Gs extends Tt(){['id'];['isStarted']=!0x1;['isFromHistory'];['interactions']=[];['currentInteraction'];['selectedModel'];['connector'];['options'];constructor(_0x216e37){super(),this['options']=_0x216e37,this['connector']=_0x216e37['connector'],this['chatModels']=_0x216e37['chatModels'],this['id']=_0x216e37['conversationId'],this['isFromHistory']=_0x216e37['isFromHistory'];}async['init'](_0xa55352){try{this['chatContext']=new Ms({'connector':this['connector'],'config':_0xa55352,'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 _0x5547d1=await this['chatModels']['getAvailableModels']();this['fire']('conversationInitialized',{'availableModels':_0x5547d1});const _0x130229=await this['chatModels']['getModel'](this['options']['selectedModelId']);_0x130229&&await this['setModel'](_0x130229);}catch(_0x1ea58c){const _0x45d208=new at('ai-chat-conversation-init-failed',null,{'message':_0x1ea58c['message']||_0x1ea58c});_0x45d208['stack']=_0x1ea58c['stack'],this['fire']('error',{'error':_0x45d208});}}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:_0x9fcc45}=await this['connector']['startConversation'](this['id'],this['options']['group'])['getConversation']();this['id']=_0x9fcc45,this['isStarted']=!0x0,this['fire']('conversationStarted',{'conversationId':this['id'],'selectedModel':this['selectedModel']});}catch(_0x42e783){const _0x42d339=new at('ai-chat-conversation-start-failed',null,{'message':_0x42e783['message'],'conversationId':this['id']});throw _0x42d339['stack']=_0x42e783['stack'],this['fire']('error',{'error':_0x42d339}),_0x42d339;}}async['load'](_0x1fedb4,_0xe77f7d){try{const _0xd4c5f4=await this['connector']['fetchConversation'](_0x1fedb4)['getConversation'](),_0x13463e=await this['connector']['fetchConversationMessages'](_0x1fedb4)['getMessages'](),_0x4a7844=_0x13463e[0x0]['model'];this['isStarted']=!0x0,this['id']=_0xd4c5f4['id'],'title'in _0xd4c5f4?this['fire']('setConversationTitle',_0xd4c5f4['title'],!0x0):this['fire']('setConversationTitle','',!0x0);const _0x1baedd=(await this['chatModels']['getAll']())['find'](_0x2b4502=>_0x2b4502['id']['toLowerCase']()===_0x4a7844['toLowerCase']());return this['selectedModel']=_0x1baedd,this['fire']('modelSelected',{'selectedModel':_0x1baedd,'isDisabled':!0x0}),await this['_processMessagesToInteractions'](_0x13463e,_0xe77f7d,_0x4a7844),this['currentInteraction']=void 0x0,this;}catch(_0x42a8d2){const _0x2b1fa6=new at('ai-chat-conversation-init-from-id-failed',null,{'message':_0x42a8d2['message'],'conversationId':_0x1fedb4});throw _0x2b1fa6['stack']=_0x42a8d2['stack'],this['fire']('error',{'error':_0x2b1fa6}),_0x2b1fa6;}}async['_processMessagesToInteractions'](_0x52ccb7,_0x7c8b27,_0x5890ab){let _0x5d41b9,_0x45f7fb=!0x1;for(const _0x4d69da of _0x52ccb7)if('user'===_0x4d69da['role']){const {contextItems:_0x33e98e,hasUnmatched:_0x57bb10}=await this['_extractContextItems'](_0x4d69da);_0x45f7fb=_0x57bb10;const _0x4b8abc={'isReasoningEnabled':Object['hasOwn'](_0x4d69da['capabilities'],'reasoning'),'isWebSearchEnabled':Object['hasOwn'](_0x4d69da['capabilities'],'webSearch')};_0x5d41b9=this['createInteraction']({'userMessage':_0x4d69da['prompt'],'contextItems':_0x33e98e,'capabilities':_0x4b8abc,'modelId':_0x5890ab,'attributes':_0x4d69da['attributes']}),this['currentInteraction']=_0x5d41b9,this['chatContext']['addToConversationContext'](this['currentInteraction']['contextItems']);}else{if('assistant'===_0x4d69da['role']&&_0x5d41b9){const _0x494ead=[];for(const _0x537a30 of _0x4d69da['content'])switch(_0x537a30['type']){case'text':case'modification':{const _0x3d2f3b=_0x5d41b9['getDocumentContext'](),_0x310e5f=(_0x3d2f3b?.['documents']?.['length']?_0x3d2f3b['documents']['some'](_0xe5b8d0=>_0xe5b8d0['sessionId']!==_0x7c8b27):_0x3d2f3b?.['sessionId']!==_0x7c8b27)||_0x45f7fb;_0x5d41b9['currentReply']?.['type']!==_0x537a30['type']&&(_0x5d41b9['currentReply']=_0x5d41b9['createReply']({'type':_0x537a30['type'],'isDone':!0x0,'interactionId':_0x5d41b9['id'],'areActionsDisabled':_0x310e5f,'isFromHistory':!0x0}),_0x494ead['length']>0x0&&(_0x5d41b9['currentReply']['sources']=_0x494ead['splice'](0x0))),_0x5d41b9['currentReply']['appendContent'](_0x537a30['content']);break;}case'url':_0x494ead['push'](_0x537a30);break;case'mcp-tool-result':{const {data:_0x20395e,attributes:_0x1b2bfa}=JSON['parse'](_0x537a30['content']);_0x5d41b9['_handleToolResultData']({'toolName':_0x537a30['toolName'],'data':_0x20395e,'attributes':_0x1b2bfa});break;}}}}}async['_extractContextItems'](_0x5c8ee4){const _0x4eff71=new Map();if(!_0x5c8ee4['content'])return{'contextItems':_0x4eff71,'hasUnmatched':!0x1};const _0x19c4ef=this['_resolveEditors'](),{contextItem:_0x3bdbd8,hasUnmatched:_0x5b8c95}=await this['chatContext']['populateDocumentsFromUserMessage'](_0x5c8ee4['content'],_0x19c4ef);_0x3bdbd8&&_0x4eff71['set'](_0x3bdbd8['id'],_0x3bdbd8);for(const _0x495b4c of _0x5c8ee4['content']){if('document'===_0x495b4c['type'])continue;const _0x290e25=await this['chatContext']['populateFromMessage'](_0x495b4c);_0x290e25&&_0x4eff71['set'](_0x290e25['id'],_0x290e25);}return{'contextItems':_0x4eff71,'hasUnmatched':_0x5b8c95};}['_resolveEditors'](){return this['options']['getEditors']?this['options']['getEditors']():this['options']['getEditor']?[this['options']['getEditor']()]:[];}async['handleUserInteraction']({userMessage:_0x245c79,attributes:_0xef3921}){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 _0x163712=this['chatContext']['getPendingContextItems'](),_0x4c0107=this['chatCapabilities']['getCapabilitiesConfig'](),_0x1db39c=this['selectedModel']['id'];this['currentInteraction']=this['createInteraction']({'userMessage':_0x245c79,'contextItems':_0x163712,'capabilities':_0x4c0107,'modelId':_0x1db39c,'attributes':_0xef3921}),await this['currentInteraction']['start'](),this['chatContext']['addToConversationContext'](this['currentInteraction']['contextItems']);}catch(_0x2e3dd8){if(_0x2e3dd8 instanceof at)this['fire']('error',{'interactionId':this['currentInteraction']?this['currentInteraction']['id']:void 0x0,'error':_0x2e3dd8});else{const _0x56f8ca=Ps['get'](_0x2e3dd8['code'])||'ai-chat-handle-user-interaction-start-failed';this['fire']('error',{'interactionId':this['currentInteraction']?this['currentInteraction']['id']:void 0x0,'error':new at(_0x56f8ca,null,{'error':_0x2e3dd8})});}}finally{this['currentInteraction']?.['stop'](),this['currentInteraction']=void 0x0;}}['createInteraction']({userMessage:_0x116f3c,contextItems:_0x5e564d,capabilities:_0x40d1f6,modelId:_0x5958ee,attributes:_0x2d9ae4}){const _0xcb96cd=new Bs({'userMessage':_0x116f3c,'contextItems':_0x5e564d,'capabilities':_0x40d1f6,'conversationId':this['id'],'connector':this['connector'],'locale':this['options']['locale'],'model':_0x5958ee,'attributes':_0x2d9ae4});return _0xcb96cd['delegate'](...Ls)['to'](this),this['interactions']['push'](_0xcb96cd),this['fire']('interactionCreated',_0xcb96cd),_0xcb96cd;}['getInteraction'](_0x1dba2e){return this['interactions']['find'](_0x4c3721=>_0x4c3721['id']===_0x1dba2e);}['removeInteraction'](_0x5b8e11){const _0x514d6a=this['getInteraction'](_0x5b8e11);_0x514d6a&&(_0x514d6a['destroy'](),this['interactions']['splice'](this['interactions']['indexOf'](_0x514d6a),0x1));}get['lastInteraction'](){return this['interactions'][this['interactions']['length']-0x1];}['addCurrentDocumentToContext'](_0x636131){this['chatContext']['addCurrentDocumentToContext'](_0x636131);}async['updateCurrentDocumentInContext']({content:_0x3859d7,version:_0x450f9d,sessionId:_0x48ad46,selections:_0x513d80}){await this['chatContext']['updateCurrentDocument'](_0x3859d7,_0x450f9d,_0x48ad46,_0x513d80);}async['updateDocumentsInContext'](_0x26bbc2){await this['chatContext']['updateDocuments'](_0x26bbc2);}['getSourceByDataId'](_0x222cc5){return this['chatContext']['getSourceByDataId'](_0x222cc5);}['getDocumentContextSliceByDataId'](_0x17bca2){return this['chatContext']['getDocumentContextSliceByDataId'](_0x17bca2);}['getCurrentDocumentContext'](){return this['currentInteraction']?.['getDocumentContext']()?.['content']||'';}['addSelectionToContext'](_0x503da5){this['chatContext']['addSelectionToContext'](_0x503da5);}['removeSelectionFromContext'](){this['chatContext']['removeSelectionFromContext']();}['addFilesToContext'](_0x5f478c){this['chatContext']['addFilesToContext'](_0x5f478c);}['addUrlToContext'](_0x1ffc76){this['chatContext']['addUrlToContext'](_0x1ffc76);}['addToolItemToContext'](_0x45cfc9){this['chatContext']['addToolItemToContext'](_0x45cfc9);}['addResourceToContext'](_0x199bfd,_0x4fb3a2){this['chatContext']['addResourceToContext'](_0x199bfd,_0x4fb3a2);}['loadSourceResources'](_0x1f12eb,_0x1ee487,_0x33581a){return this['chatContext']['loadSourceResources'](_0x1f12eb,_0x1ee487,_0x33581a);}['removeFromContext'](_0x24f885){this['chatContext']['removeFromContext'](_0x24f885);}['setWebSearch'](_0x4f9489){this['chatCapabilities']['setWebSearch'](_0x4f9489);}['toggleWebSearch'](){this['chatCapabilities']['toggleWebSearch']();}['setReasoning'](_0x2da6c4){this['chatCapabilities']['setReasoning'](_0x2da6c4);}['toggleReasoning'](){this['chatCapabilities']['toggleReasoning']();}['isCurrentDocumentInContext'](){return this['chatContext']['isCurrentDocumentInContext']();}['isCurrentDocumentInConversation'](){return this['chatContext']['isCurrentDocumentInConversation']();}['isSelectionInContext'](){return this['chatContext']['isSelectionInContext']();}async['setModel'](_0xb0b374){_0xb0b374?!0x1===await this['chatModels']['isAvailable'](_0xb0b374)&&(It('ai-chat-conversation-set-model-not-available',{'conversation':this,'model':_0xb0b374}),_0xb0b374=(await this['chatModels']['getAvailableModels']())[0x0]):(It('ai-chat-conversation-set-model-null',{'conversation':this}),_0xb0b374=(await this['chatModels']['getAvailableModels']())[0x0]),_0xb0b374['id']!==this['selectedModel']?.['id']&&(this['selectedModel']=_0xb0b374,this['chatCapabilities']['reset'](),this['fire']('modelSelected',{'selectedModel':_0xb0b374}));}}class Fs extends Tt(){['_connector'];['_config'];['_locale'];['_modelList']=[];['_modelsRequest']=null;constructor({connector:_0x3777c4,config:_0x4aee43,locale:_0x49f6e9}){super(),this['_connector']=_0x3777c4,this['_config']=_0x4aee43,this['_locale']=_0x49f6e9;}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 _0xdfdad7=await this['getAll']();let _0x1931c8;return _0x1931c8=this['_availableModels']?this['_filterModels'](_0xdfdad7,this['_availableModels']):_0xdfdad7['filter'](_0x1e9f13=>_0x1e9f13['recommended']),_0x1931c8;}async['getModel'](_0x11319b){const _0x22d82f=await this['getAll']();if(!_0x22d82f['length'])return null;if(_0x11319b){const _0xdb76b3=this['_getModelById'](_0x22d82f,_0x11319b);if(_0xdb76b3)return _0xdb76b3;It('ai-chat-model-id-unrecognized',{'modelId':_0x11319b,'fallBackModelId':this['_defaultModelId']});}return this['getDefault']();}async['getDefault'](){const _0x2ed234=await this['getAvailableModels']();if(!_0x2ed234['length'])return null;if(this['_defaultModelId']){const _0x2d459d=this['_getModelById'](_0x2ed234,this['_defaultModelId']);if(_0x2d459d)return _0x2d459d;It('ai-chat-default-model-id-unrecognized',{'defaultModelId':this['_defaultModelId'],'fallBackModelId':_0x2ed234[0x0]['id']});}return _0x2ed234[0x0];}async['isAvailable'](_0x243ff3){return(await this['getAvailableModels']())['some'](_0x255491=>_0x255491['name']===_0x243ff3['name']&&_0x255491['provider']===_0x243ff3['provider']);}async['_retrieveModels'](){if(!this['_modelList']['length'])try{const _0x155267=this['_locale']['uiLanguage']||'en',_0x52bb8e=this['_connector']['getModels'](_0x155267),_0x297fb8=await _0x52bb8e['list']();this['_modelList']=_0x297fb8['items']['map'](_0x113b19=>Ks(_0x113b19)?{..._0x113b19,'name':hs(this['_locale'],'AI_MODEL_NAME_AUTO')}:_0x113b19);}catch(_0x19c2ef){throw Et('ai-models-unable-to-retrieve',{'error':_0x19c2ef}),_0x19c2ef;}return[...this['_modelList']];}['_filterModels'](_0x4fc40c,_0x1807bd){let _0x37313c;if(_0x1807bd){_0x37313c=[];const _0x190c54=new Set(),_0x2cfda0='string'==typeof _0x1807bd?[_0x1807bd['toLocaleLowerCase']()]:_0x1807bd['map'](_0x1165d5=>_0x1165d5['toLocaleLowerCase']());for(const _0x3b5d8f of _0x2cfda0)for(const _0xbd134f of _0x4fc40c)!_0x190c54['has'](_0xbd134f['id'])&&this['_isMatchingFilter'](_0xbd134f,_0x3b5d8f)&&(_0x37313c['push'](_0xbd134f),_0x190c54['add'](_0xbd134f['id']));}else _0x37313c=_0x4fc40c;return _0x37313c;}['_isMatchingFilter'](_0xb28db,_0x49071a){const _0x843670=_0xb28db['id']['toLocaleLowerCase'](),_0x3155a=_0xb28db['name']['toLocaleLowerCase'](),_0x44144b=_0xb28db['provider']['toLocaleLowerCase']();return _0x843670===_0x49071a||_0x3155a===_0x49071a||Ks(_0xb28db)&&'auto'===_0x49071a||_0x44144b===_0x49071a||_0x843670['startsWith'](_0x49071a);}['_getModelById'](_0x937eb6,_0x59fa95){return _0x937eb6['find'](_0x2c994b=>Ks(_0x2c994b)&&'auto'===_0x59fa95?_0x2c994b:_0x2c994b['id']===_0x59fa95)||null;}}function Ks(_0x4671e0){return _0x4671e0['id']['startsWith']('agent');}function Ws(_0x3571a0){return _0x3571a0?_0x3571a0 instanceof _0x45e816?[_0x3571a0]:_0x3571a0['editors']&&0x0!==_0x3571a0['editors']['length']?Array['from'](_0x3571a0['editors']):[]:[];}function Ys(_0x538adc){const _0x49bcf3=Ws(_0x538adc);if(!_0x49bcf3['length'])throw new at('ai-get-editor-from-context-no-editor');if(0x1===_0x49bcf3['length'])return _0x49bcf3[0x0];const _0x44cdc2=_0x49bcf3['find'](_0x21c538=>_0x21c538['ui']?.['focusTracker']?.['isFocused']);if(_0x44cdc2)return _0x44cdc2;const _0x583951=function(_0x474c8d){if(_0x474c8d instanceof _0x45e816)return;const _0x54225e=_0x474c8d;if(!_0x54225e['plugins']||!_0x54225e['plugins']['has']('AIEditing'))return;const _0x3cbcb6=_0x54225e['plugins']['get']('AIEditing');return _0x3cbcb6['getLastContentFocusedEditor']?.();}(_0x538adc);return _0x583951&&_0x49bcf3['includes'](_0x583951)?_0x583951:_0x49bcf3[0x0];}function $s(_0x5b377a){return Ys(_0x5b377a);}function qs({editor:_0x3fff91,interaction:_0x3265ed,reply:_0x2c1f27,groups:_0x43888a,transform:_0x245d45,documentCompare:_0x2b7b7c,documentCompareOptions:_0x10f1d6,documentContextSlice:_0x11b853}){const _0x36c92d=_0x3265ed['getDocumentContext']();if(!_0x36c92d)return[];const _0x135ddc=_0x2c1f27['documentContextContent']['cloneNode'](!0x0);for(const {changes:_0x2dd09a}of _0x43888a){const _0x47b233=_0x2dd09a['filter'](_0x3c1e1e=>'new'!=_0x3c1e1e['type'])['map'](_0x1fa69c=>As('data-id',_0x1fa69c['id'],_0x135ddc)),_0x3e0ed9=_0x2dd09a['filter'](_0x4dfc86=>'removed'!=_0x4dfc86['type'])['map'](_0x14797f=>_0x14797f['node']['cloneNode'](!0x0));let _0x166678=null;if(_0x47b233['length']){_0x166678=_0x47b233[0x0]['previousSibling'];for(let _0x90a811=0x0;_0x90a811<_0x47b233['length'];_0x90a811++)_0x4718cb(_0x47b233[_0x90a811]);}if(_0x3e0ed9['length']){_0x166678||(_0x2dd09a[0x0]['anchorId']?_0x166678=As('data-id',_0x2dd09a[0x0]['anchorId'],_0x135ddc):(_0x166678=_0x3e0ed9['shift'](),_0x3711aa(_0x135ddc,_0x166678)));for(let _0x27e253=0x0;_0x27e253<_0x3e0ed9['length'];_0x27e253++)_0x325097(_0x166678,_0x3e0ed9[_0x27e253]),_0x166678=_0x3e0ed9[_0x27e253];}}let _0x47e35b,_0x55c27d,_0x496a06,_0x154edb=_0x10f1d6;if(_0x11b853){_0x47e35b=_0x11b853['html'],_0x496a06=_0x11b853['version'],_0x154edb={..._0x10f1d6,'anchor':_0x11b853['rootName']};const _0x15126a=new _0x4760d6([]),_0x2e5030=_0x135ddc['children'],_0x2d297c=_0x2c1f27['dataIdDocumentSources'],_0x1a9256=_0x2c1f27['newNodeAnchorIds'],_0x22da51=_0x11b853['editor'],_0x5eb05f=_0x11b853['rootName'],_0x221911=new Array(_0x2e5030['length']),_0x201fea=_0x22e764=>_0x22e764?_0x22e764['editor']===_0x22da51&&_0x22e764['rootName']===_0x5eb05f:void 0x0;for(let _0x498af6=0x0;_0x498af6<_0x2e5030['length'];_0x498af6++){const _0x18b871=Es(_0x2e5030[_0x498af6],'data-id');if(!_0x18b871)continue;const _0x23b760=_0x201fea(_0x2d297c?.['get'](_0x18b871));if(void 0x0!==_0x23b760){_0x221911[_0x498af6]=_0x23b760;continue;}const _0x3d1978=_0x1a9256['get'](_0x18b871),_0x1fe952=_0x3d1978?_0x201fea(_0x2d297c?.['get'](_0x3d1978)):void 0x0;void 0x0!==_0x1fe952&&(_0x221911[_0x498af6]=_0x1fe952);}for(let _0x4522a2=0x0;_0x4522a2<_0x2e5030['length'];_0x4522a2++)if(void 0x0===_0x221911[_0x4522a2]){for(let _0x51fe08=_0x4522a2-0x1;_0x51fe08>=0x0;_0x51fe08--)if(void 0x0!==_0x221911[_0x51fe08]){_0x221911[_0x4522a2]=_0x221911[_0x51fe08];break;}if(void 0x0===_0x221911[_0x4522a2]){for(let _0x566ed0=_0x4522a2+0x1;_0x566ed0<_0x2e5030['length'];_0x566ed0++)if(void 0x0!==_0x221911[_0x566ed0]){_0x221911[_0x4522a2]=_0x221911[_0x566ed0];break;}}}for(let _0x1ff113=0x0;_0x1ff113<_0x2e5030['length'];_0x1ff113++)_0x221911[_0x1ff113]&&_0x15126a['children']['push'](_0x36c6c8(_0x2e5030[_0x1ff113],!0x0));_0x55c27d=gs(_0x15126a);}else _0x47e35b=_0x36c92d['content'],_0x496a06=_0x36c92d['version'],_0x55c27d=gs(_0x135ddc);const _0xa73710=_0x2b7b7c['getDiff'](_0x47e35b,_0x55c27d,{..._0x154edb,'targetEditor':_0x3fff91})['getOperations']();if(_0x245d45){const _0x1a4bc0=_0x3fff91['model']['document']['history']['getOperations'](_0x496a06),_0x3fcab3={'document':_0x3fff91['model']['document'],'useRelations':!0x1,'padWithNoOps':!0x1};return _0x5bfae1(_0xa73710,_0x1a4bc0,_0x3fcab3)['operationsA'];}return _0xa73710;}function Qs(_0x49017f,_0x39115f){if('marker'!=_0x39115f['type'])return;const _0x153010=_0x49017f['model']['markers']['get'](_0x39115f['name']);_0x153010&&(_0x39115f['oldRange']=_0x153010['getRange']());}class Xs extends _0x35ff8d{['activeConversation'];['_aiEditing'];['_aiConnector'];['_aiChatUi'];['_aiChatModels'];['_aiChatBalloon'];['_activeBalloon'];['_wiredBalloons']=new Set();['_batchToChanges']=new Map();['_currentPreviewedChangeGroup']=null;['_bodyCollection'];static get['requires'](){return[as,_0x10431c];}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 _0x54a9fa=this['context']['plugins']['get']('AITabs');this['listenTo'](this['_aiChatUi'],'startConversation',()=>{this['_startConversationSafely']();}),this['listenTo'](this['_aiChatUi'],'sendUserMessage',(_0x1402e7,_0x275f8d)=>{this['_handleUIUserMessage']({'message':_0x275f8d});}),this['listenTo'](_0x54a9fa['view'],'change:activeTab',(_0x3a63bb,_0x2fe1fc,_0x5e322b)=>{'chat'!==_0x5e322b&&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',(_0x247179,_0x15d2d0)=>{this['activeConversation']?.['addFilesToContext'](Array['from'](_0x15d2d0));}),this['listenTo'](this['_aiChatUi'],'addUrlToContext',(_0x3cf4ae,_0x33e2bd)=>{this['activeConversation']?.['addUrlToContext'](_0x33e2bd);}),this['listenTo'](this['_aiChatUi'],'executeCustomItemCallback',(_0x41f2ea,_0x15932c)=>{_0x15932c['callback'](this['context']);}),this['listenTo'](this['_aiChatUi'],'addResourceToContext',(_0x1bbaa5,_0x2955f2)=>{this['activeConversation']?.['addResourceToContext'](_0x2955f2['source'],_0x2955f2['resource']);}),this['listenTo'](this['_aiChatUi'],'removeContextItem',(_0x4a973b,_0x984bde)=>{this['_removeFromContext'](_0x984bde);}),this['listenTo'](this['_aiChatUi'],'loadSourceResources',(_0x403abc,_0xc20d68)=>{this['activeConversation']?.['loadSourceResources'](_0xc20d68['sourceId'],_0xc20d68['query'],_0xc20d68['uid']);}),this['listenTo'](this['_aiChatUi'],'toggleWebSearch',()=>{this['_toggleWebSearch']();}),this['listenTo'](this['_aiChatUi'],'toggleReasoning',()=>{this['_toggleReasoning']();}),this['listenTo'](this['_aiChatUi'],'selectModel',(_0x2c9006,_0x1b6c64)=>{this['activeConversation']?.['setModel'](_0x1b6c64);}),this['listenTo'](this['_aiChatUi'],'like',(_0x5e988b,{replyId:_0x4969f8})=>{console['log']('Liked\x20response',_0x4969f8);}),this['listenTo'](this['_aiChatUi'],'dislike',(_0x3889a8,{replyId:_0x17f453})=>{console['log']('Disliked\x20response',_0x17f453);}),this['listenTo'](this['_aiChatUi'],'insertSuggestion',(_0x3fb7af,_0x1866de)=>{this['_insertSuggestion'](_0x1866de);}),this['listenTo'](this['_aiChatUi'],'showChangeInText',(_0x206d3e,{replyId:_0x38129a,partIndex:_0x34823d})=>{this['_aiChatBalloonShowDiff']=this['_aiChatUi']['showDiff'],this['_openBalloonFor'](_0x38129a,_0x34823d);}),this['listenTo'](this['_aiChatUi'],'mouseOverSuggestion',(_0x3535f2,{replyId:_0x39dd25,partIndex:_0x494609})=>{const _0x30b209=this['_getDocumentRangeForReplyChanges'](_0x39dd25,_0x494609);_0x30b209&&'$graveyard'!=_0x30b209['range']['root']['rootName']&&this['_aiEditing']['showFakeVisualSelection']({'ranges':[_0x30b209['range']],'id':'change-area','priority':0xa});}),this['listenTo'](this['_aiChatUi'],'mouseLeaveSuggestion',()=>{this['_aiEditing']['hideFakeVisualSelection']('change-area');}),this['listenTo'](this['_aiChatUi'],'applySuggestion',(_0x29e5c3,_0x3ac858)=>{this['_aiEditing']['hideFakeVisualSelection']('change-area'),this['_applySuggestion'](_0x3ac858);}),this['listenTo'](this['_aiChatUi'],'toggleSuggestionDisplayMode',async(_0x2017af,{replyId:_0x5dcd6c,showDiff:_0x1b77aa})=>{const {reply:_0x445426}=this['getInteractionAndReplyById'](_0x5dcd6c),_0x5de707=_0x445426['getContentParts']({'showDiff':_0x1b77aa,'editor':$s(this['context'])});await this['_aiChatUi']['updateFeedItemAIReplySuggestionContent']({'id':_0x445426['id'],'parts':_0x5de707});}),this['listenTo'](this['_aiChatUi'],'rejectSuggestion',(_0x3df051,{replyId:_0x29f6ba,partIndex:_0x4b41aa})=>{this['_rejectSuggestion']({'replyId':_0x29f6ba,'partIndex':_0x4b41aa}),this['_aiEditing']['hideFakeVisualSelection']('change-area');}),this['set']('_aiChatBalloonShowDiff',!0x1),this['context']['plugins']['has']('AIChatBalloon')&&(this['_aiChatBalloon']=this['context']['plugins']['get']('AIChatBalloon')),this['on']('interactionCreated',(_0xc73a9d,_0x274ef2)=>{this['_aiChatUi']['addFeedItemUserMessage'](_0x274ef2);}),this['on']('replyCreated',(_0x289755,_0x268e37)=>{this['_addFeedItemReply'](_0x268e37);});}async['afterInit'](){this['context']instanceof _0x45e816?this['_integrateEditor'](this['context']):this['listenTo'](this['context']['editors'],'add',(_0x38c0b2,_0x3ce7fa)=>{_0x3ce7fa['on']('ready',()=>{this['_integrateEditor'](_0x3ce7fa);});});const _0x4492d6=this['context']['config']['get']('ai.chat.initialConversation');let _0x4881f3=_0x4492d6;if('lastCreated'!=_0x4492d6||(_0x4881f3=await this['_getLastCreatedConversationId'](),_0x4881f3))return'new'==_0x4881f3?this['_startConversationSafely']():this['loadConversation'](_0x4881f3);}async['destroy'](){return await this['_stopLastInteraction'](),this['_bodyCollection']['detachFromDom'](),super['destroy']();}async['loadConversation'](_0x12e2f5){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'](_0x12e2f5)['getConversation'](),await this['_startConversationSafely']({'id':_0x12e2f5}),this['_updateConversationTitle']('\x20'),await this['activeConversation']['load'](_0x12e2f5,this['_aiEditing']['sessionId']),this['activeConversation']['isCurrentDocumentInConversation']()&&this['addCurrentDocumentToChatContext']();}catch(_0x3ec8e4){this['_aiChatUi']['addFeedItemError']({'errorMessage':hs(this['context']['locale'],'AI_CHAT_UNABLE_TO_LOAD_CONVERSATION'),'id':_0x12e2f5}),this['_logError'](new at('ai-chat-conversation-not-found',this,{'error':_0x3ec8e4}));}finally{this['_aiChatUi']['startAutoScroll']({'smooth':!0x1}),this['_aiChatUi']['setFeedItemRenderingStrategy']('streaming'),this['_aiChatUi']['toggleLoadingSkeleton'](!0x1);}}['registerToolDataCallback'](_0x2e258c){let _0x5232ab=null,_0x231363=null;this['on']('toolDataReceived',(_0x346a7c,_0xee6c2a,_0x359c93)=>{_0x359c93['id']!==_0x5232ab&&(_0x5232ab=_0x359c93['id'],_0x231363=this['_getAIChatFeedAPI'](_0x359c93)),_0x2e258c(_0xee6c2a,_0x231363);});}['addCurrentDocumentToChatContext'](){this['activeConversation']?.['addCurrentDocumentToContext'](hs(this['context']['locale'],'AI_CHAT_CONTEXT_CURRENT_DOCUMENT'));}async['addSelectionToChatContext'](){const _0x9b0413=this['_aiEditing']['getSelectionText']();this['activeConversation']?.['addSelectionToContext'](_0x9b0413),this['addCurrentDocumentToChatContext']();}['removeSelectionFromChatContext'](){this['activeConversation']?.['removeSelectionFromContext']();}['focusPromptInput'](){this['_aiChatUi']['focusPromptInput']();}async['startConversation'](_0x33aa59){await this['_startConversationSafely']({'modelId':_0x33aa59?.['modelId']});}async['sendMessage'](_0x3487d9){await this['_handleUIUserMessage'](_0x3487d9);}['getGroupId'](){const _0x24b329=this['context']['config']['get']('collaboration.channelId');if(!_0x24b329)throw new at('ai-chat-missing-channel-id',this);return _0x24b329;}['_handleRemovedConversation'](_0x5c8d37){this['activeConversation']['id']===_0x5c8d37&&this['_startConversationSafely']();}['_insertSuggestion'](_0x2d5579){const _0x85ccfc=this['context']['plugins']['get']('DocumentCompare'),{reply:_0x4dc91b,interaction:_0x5e8a02}=this['getInteractionAndReplyById'](_0x2d5579['replyId']),_0x2051c3=void 0x0!==_0x2d5579['partIndex']?[_0x4dc91b['changeGroups'][_0x2d5579['partIndex']]]:_0x4dc91b['changeGroups']['filter'](_0x48706e=>'pending'==_0x48706e['state']);for(const _0xaf49f3 of this['_groupChangesByTarget'](_0x4dc91b,_0x2051c3)){const {target:_0x7daec2,groups:_0x237e9f,groupsIndexes:_0x51cc87,slice:_0x5755a0}=_0xaf49f3;if(!_0x7daec2['editor']['plugins']['has']('TrackChanges'))throw new at('ai-no-track-changes',null);const _0x2c283a=this['_getDocumentRangeForReplyChanges'](_0x2d5579['replyId'],_0x51cc87[0x0]);if(!_0x2c283a||'$graveyard'==_0x2c283a['range']['root']['rootName']){_0x51cc87['forEach'](_0x2134bb=>_0x4dc91b['setChangeGroupState'](_0x2134bb,'outdated'));continue;}_0x51cc87['forEach'](_0x2614f5=>_0x4dc91b['setChangeGroupState'](_0x2614f5,'accepted'));const _0x3d618a=qs({'editor':_0x7daec2['editor'],'reply':_0x4dc91b,'interaction':_0x5e8a02,'groups':_0x237e9f,'transform':!0x0,'documentCompare':_0x85ccfc,'documentCompareOptions':{'anchor':_0x5755a0?.['rootName']??'main','markDeletions':!0x0},'documentContextSlice':_0x5755a0});let _0x56f07d;this['_scrollToSuggestionRange'](_0x2c283a['range'],!0x1,_0x7daec2['editor']),_0x7daec2['editor']['model']['change'](_0x2d999f=>{_0x56f07d=_0x2d999f['batch'],_0x7daec2['editor']['plugins']['get']('TrackChangesEditing')['_applyOperationsAsSuggestions'](_0x3d618a),this['_aiEditing']['hideFakeVisualSelection']('change-area');}),this['_batchToChanges']['set'](_0x56f07d,{'interactionId':_0x5e8a02['id'],'replyId':_0x4dc91b['id'],'indexes':_0x51cc87['slice']()});}this['_updateRatings'](_0x4dc91b);}['_applySuggestion'](_0x4095d6){const _0x271b69=this['context']['plugins']['get'](_0x10431c),{reply:_0x1ac288,interaction:_0x817724}=this['getInteractionAndReplyById'](_0x4095d6['replyId']),_0x2d7e14=void 0x0!==_0x4095d6['partIndex']?[_0x1ac288['changeGroups'][_0x4095d6['partIndex']]]:_0x1ac288['changeGroups']['filter'](_0x557ef4=>'pending'==_0x557ef4['state']);for(const _0x524a0c of this['_groupChangesByTarget'](_0x1ac288,_0x2d7e14)){const {target:_0x342750,groups:_0x55089b,groupsIndexes:_0x267757,slice:_0x38b6c3}=_0x524a0c,_0x16f54c=this['_getDocumentRangeForReplyChanges'](_0x4095d6['replyId'],_0x267757[0x0]);if(!_0x16f54c||'$graveyard'==_0x16f54c['range']['root']['rootName']){_0x267757['forEach'](_0x12da43=>_0x1ac288['setChangeGroupState'](_0x12da43,'outdated'));continue;}_0x267757['forEach'](_0x3ce970=>_0x1ac288['setChangeGroupState'](_0x3ce970,'accepted'));const _0x342cce=qs({'editor':_0x342750['editor'],'reply':_0x1ac288,'interaction':_0x817724,'groups':_0x55089b,'transform':!0x0,'documentCompare':_0x271b69,'documentCompareOptions':{'anchor':_0x38b6c3?.['rootName']??'main','markDeletions':!0x1},'documentContextSlice':_0x38b6c3});let _0x2541e3;this['_scrollToSuggestionRange'](_0x16f54c['range'],!0x1,_0x342750['editor']),_0x342750['editor']['model']['change'](_0x259e3b=>{_0x2541e3=_0x259e3b['batch'];for(const _0x5464bf of _0x342cce)_0x5464bf['baseVersion']=_0x342750['editor']['model']['document']['version'],Qs(_0x342750['editor'],_0x5464bf),_0x259e3b['batch']['addOperation'](_0x5464bf),_0x342750['editor']['model']['applyOperation'](_0x5464bf);}),this['_batchToChanges']['set'](_0x2541e3,{'interactionId':_0x817724['id'],'replyId':_0x1ac288['id'],'indexes':_0x267757['slice']()});}this['_updateRatings'](_0x1ac288);}['_rejectSuggestion'](_0x2859ec){const {reply:_0x1f26f6}=this['getInteractionAndReplyById'](_0x2859ec['replyId']);_0x1f26f6['setChangeGroupState'](_0x2859ec['partIndex'],'rejected');}['_openBalloonFor'](_0x3d0385,_0x12291d){if(!this['_aiChatBalloon'])return;const {reply:_0x56044d}=this['getInteractionAndReplyById'](_0x3d0385),_0x5dbf45=_0x56044d['getContentParts']({'showDiff':this['_aiChatBalloonShowDiff'],'editor':$s(this['context'])});let _0x16bee0,_0x33cc68;if(void 0x0!==_0x12291d?(_0x33cc68=_0x5dbf45['find'](_0x256945=>_0x256945['index']==_0x12291d),_0x16bee0=_0x33cc68?.['index']):(_0x33cc68=_0x5dbf45[0x0],_0x16bee0=_0x33cc68['index']),this['_currentPreviewedChangeGroup']?.['replyId']==_0x3d0385&&this['_currentPreviewedChangeGroup']?.['partIndex']==_0x16bee0)return;const _0xdf531a=this['_getUserPresentableContentPartDocumentRange'](_0x3d0385,_0x56044d,_0x33cc68),_0x38465a=_0x56044d['changeGroups']['find'](_0x22e39f=>_0x22e39f['index']==_0x16bee0),_0x2eda95=_0x38465a?this['_resolveGroupTarget'](_0x56044d,_0x38465a):null,_0x3bf30d=_0x2eda95?.['editor']??$s(this['context']),_0x4bfc91=_0x3bf30d['plugins']['has']('AIChatBalloon')?_0x3bf30d['plugins']['get']('AIChatBalloon'):this['_aiChatBalloon'];if(this['_activeBalloon']&&this['_activeBalloon']!==_0x4bfc91&&this['_activeBalloon']['close'](),!_0xdf531a)return _0x4bfc91['close'](),void(this['_activeBalloon']=void 0x0);this['_activeBalloon']=_0x4bfc91,this['_currentPreviewedChangeGroup']={'replyId':_0x3d0385,'partIndex':_0x16bee0},this['_scrollToSuggestionRange'](_0xdf531a,!0x0,_0x3bf30d);const _0x3c6a0c=this['_getPresentableSiblingContentPartIndex'](_0x3d0385,_0x16bee0,'next');_0x4bfc91['updateContent']({'part':_0x33cc68,'renderingStrategy':'static'}),_0x4bfc91['open']({'index':_0x16bee0,'title':hs(this['context']['locale'],'AI_BALLOON_HEADER_TITLE',(_0x16bee0+0x1)['toString']()),'showRotator':null!==_0x3c6a0c,'ranges':[_0xdf531a],'areActionsDisabled':_0x56044d['areActionsDisabled'],'targetEditor':_0x3bf30d}),_0x4bfc91['setState']('pending'),this['_aiChatUi']['scrollFeedToSuggestion'](_0x3d0385,_0x16bee0),this['_aiChatUi']['setFeedItemAIReplySuggestionPartActive']({'id':_0x3d0385,'index':_0x16bee0,'isActive':!0x0});}['_getPresentableSiblingContentPartIndex'](_0x37077f,_0x4a1518,_0x4fc657){const {reply:_0x17a84d}=this['getInteractionAndReplyById'](_0x37077f),_0x25c179=_0x17a84d['getContentParts']({'showDiff':this['_aiChatBalloonShowDiff'],'editor':$s(this['context'])});if(0x1==_0x25c179['length'])return null;const _0x1ffa75=_0x25c179['findIndex'](_0x47a5d2=>_0x47a5d2['index']==_0x4a1518),_0x4c7abd='next'==_0x4fc657?0x1:-0x1;let _0x2ad47e=_0x25c179['at']((_0x1ffa75+_0x4c7abd)%_0x25c179['length'])['index'],_0xf6a55a=_0x25c179[_0x2ad47e];for(;!this['_getUserPresentableContentPartDocumentRange'](_0x37077f,_0x17a84d,_0xf6a55a);){if(_0x2ad47e=_0x25c179['at']((_0x2ad47e+_0x4c7abd)%_0x25c179['length'])['index'],_0x2ad47e===_0x1ffa75)return null;_0xf6a55a=_0x25c179[_0x2ad47e];}return _0x2ad47e;}['_getUserPresentableContentPartDocumentRange'](_0x221690,_0x2e8865,_0x2d0fc7){const _0x46c77e=_0x2e8865['changeGroups'];if(!_0x2d0fc7['hasChanges'])return null;const _0x201836=_0x46c77e['find'](_0x5b0eb7=>_0x5b0eb7['index']==_0x2d0fc7['index']);if('pending'!==_0x201836?.['state'])return null;const _0x5d9d43=this['_getDocumentRangeForReplyChanges'](_0x221690,_0x2d0fc7['index']);if(!_0x5d9d43)return _0x2e8865['setChangeGroupState'](_0x2d0fc7['index'],'outdated'),null;const {range:_0x55c46a,currentIndex:_0x536df2}=_0x5d9d43;return'$graveyard'==_0x55c46a['root']['rootName']?(_0x2e8865['setChangeGroupState'](_0x536df2,'outdated'),null):_0x5d9d43['range'];}['_getDocumentRangeForReplyChanges'](_0x8998be,_0x3948b0){const {reply:_0x597a88}=this['getInteractionAndReplyById'](_0x8998be),_0x1a2e5c=_0x597a88['changeGroups']['filter'](_0x170d06=>'pending'==_0x170d06['state']),_0x4db328=_0x1a2e5c['map'](_0x479fbf=>_0x597a88['changeGroups']['indexOf'](_0x479fbf));void 0x0===_0x3948b0&&(_0x3948b0=_0x4db328[0x0]);const _0x466be9=_0x4db328['indexOf'](_0x3948b0);if(-0x1==_0x466be9)return null;const _0x481fe1=_0x1a2e5c[_0x466be9],_0x46fd44=this['_resolveGroupTarget'](_0x597a88,_0x481fe1);if(!_0x46fd44)return null;const {editor:_0x419878,root:_0x5a2f8e,parsedDocumentContent:_0x95a48,serializedDocumentContent:_0x1f23fc,version:_0x542574}=_0x46fd44,_0x384a8f=new _0x4760d6([]),_0x2eb175=new _0x4760d6([]);for(const _0x500118 of _0x481fe1['changes']){const _0x5b6e15=this['activeConversation']?.['getSourceByDataId'](_0x500118['id']);if((!_0x5b6e15||_0x5b6e15['editor']===_0x46fd44['editor']&&_0x5b6e15['rootName']===_0x46fd44['root']['rootName'])&&('removed'!=_0x500118['type']&&_0x2eb175['children']['push'](_0x500118['node']['cloneNode'](!0x0)),'new'!=_0x500118['type'])){const _0x838160=_0x42364e(_0x5492b1=>Es(_0x5492b1,'data-id')==_0x500118['id'],_0x95a48,!0x0);if(!_0x838160)return null;_0x384a8f['children']['push'](_0x838160['cloneNode'](!0x0));}}if(0x0==_0x384a8f['children']['length']){if(_0x481fe1['changes'][0x0]['anchorId']){const _0x2a69f2=As('data-id',_0x481fe1['changes'][0x0]['anchorId'],_0x95a48);_0x384a8f['children']['unshift'](_0x2a69f2['cloneNode'](!0x0)),_0x2eb175['children']['unshift'](_0x2a69f2['cloneNode'](!0x0)),_0x2a69f2['nextSibling']&&(_0x384a8f['children']['push'](_0x2a69f2['nextSibling']['cloneNode'](!0x0)),_0x2eb175['children']['push'](_0x2a69f2['nextSibling']['cloneNode'](!0x0)));}else{const _0x39e504=_0x95a48['children'][0x0];if(!_0x39e504)return null;_0x384a8f['children']['push'](_0x39e504['cloneNode'](!0x0)),_0x2eb175['children']['push'](_0x39e504['cloneNode'](!0x0));}}const _0x41dc88=_0x419878['data']['parse'](_0x1f23fc),_0x1ba830=gs(_0x384a8f),_0x3086d0=_0x419878['data']['parse'](_0x1ba830),_0xf05ede=_0x419878['data']['parse'](_0x1ba830),_0x531529=_0x419878['model']['createPositionAt'](_0x3086d0,0x0),_0x36ef0c=gs(_0x2eb175),_0xf02c49={'targetEditor':_0x419878,'anchor':_0x531529,'markDeletions':!0x1},_0x3cabf0=_0x419878['plugins']['get'](_0x10431c)['getDiff'](_0x1ba830,_0x36ef0c,_0xf02c49)['getOperations']();if(!_0x3cabf0['length'])return null;_0x419878['model']['change'](_0x19b1fa=>{for(const _0x1b0d4c of _0x3cabf0)if('remove'==_0x1b0d4c['type']){const _0x2261c8=_0x1b0d4c['sourcePosition'],_0xb4f4b7=_0x1b0d4c['howMany'],_0x10dda5=new _0x3ca371(_0x2261c8,_0xb4f4b7);_0x19b1fa['batch']['addOperation'](_0x10dda5),_0x419878['model']['applyOperation'](_0x10dda5);}else'marker'!==_0x1b0d4c['type']&&(_0x1b0d4c['baseVersion']=null,_0x1b0d4c['isDocumentOperation']=!0x1,_0x19b1fa['batch']['addOperation'](_0x1b0d4c),_0x419878['model']['applyOperation'](_0x1b0d4c));});const _0x241da7=ks(_0x419878,_0x3cabf0,_0x3086d0);Ns(_0x419878['model'],_0x241da7);const _0x158112=_0x241da7['getFirstRange']()['start']['path']['slice'](),_0x4b86f1=_0x241da7['getFirstRange']()['end']['path']['slice'](),_0x52f06a=[];let _0x278a07=_0x3086d0,_0x53adb4=_0xf05ede;for(let _0x157c3c=0x0;_0x157c3c<_0x4b86f1['length'];_0x157c3c++){const _0x507cf0=_0x278a07['maxOffset']-_0x4b86f1[_0x157c3c];_0x52f06a[_0x157c3c]=_0x53adb4['maxOffset']-_0x507cf0,_0x278a07=_0x278a07['getChildAtOffset'](_0x4b86f1[_0x157c3c]),_0x53adb4=_0x53adb4['getChildAtOffset'](_0x52f06a[_0x157c3c]);}const _0x217d21=_0x419878['model']['createRange'](_0x419878['model']['createPositionFromPath'](_0xf05ede,_0x158112),_0x419878['model']['createPositionFromPath'](_0xf05ede,_0x52f06a)),_0x13c003=_0xf05ede['getChild'](0x0)['getAttribute'](_0x29c3ff),_0x7ce6c8=Array['from'](_0x41dc88['getChildren']())['find'](_0xaf51e8=>_0xaf51e8['getAttribute'](_0x29c3ff)==_0x13c003)['getPath'](),_0x324969=_0x217d21['start']['path']['slice'](),_0x3632e0=_0x217d21['end']['path']['slice']();_0x324969[0x0]=_0x7ce6c8[0x0]+_0x324969[0x0],_0x3632e0[0x0]=_0x7ce6c8[0x0]+_0x3632e0[0x0];let _0x4eb941=_0x419878['model']['createRange'](_0x419878['model']['createPositionFromPath'](_0x5a2f8e,_0x324969),_0x419878['model']['createPositionFromPath'](_0x5a2f8e,_0x3632e0));const _0x1309f3=_0x419878['model']['document']['history']['getOperations'](_0x542574);for(const _0x43e1ad of _0x1309f3)_0x4eb941=_0x2e58a9['_createFromRanges'](_0x4eb941['getTransformedByOperation'](_0x43e1ad));return{'range':_0x4eb941,'currentIndex':_0x3948b0};}['_integrateEditorBalloon'](_0x328b6){if(!_0x328b6['plugins']['has']('AIChatBalloon'))return;const _0x4e58b7=_0x328b6['plugins']['get']('AIChatBalloon');this['_wiredBalloons']['has'](_0x4e58b7)||(this['_wiredBalloons']['add'](_0x4e58b7),this['_aiChatBalloon']||(this['_aiChatBalloon']=_0x4e58b7),_0x4e58b7['bind']('showDiff')['to'](this,'_aiChatBalloonShowDiff'),this['listenTo'](_0x4e58b7,'toggleSuggestionDisplayMode',()=>{const {replyId:_0x4b6367,partIndex:_0x215172}=this['_currentPreviewedChangeGroup'];this['_aiChatBalloonShowDiff']=!this['_aiChatBalloonShowDiff'];const {reply:_0x59a81d}=this['getInteractionAndReplyById'](_0x4b6367),_0x5eeec3=_0x59a81d['changeGroups']['find'](_0x2eb37e=>_0x2eb37e['index']===_0x215172),_0x179182=_0x5eeec3?this['_resolveGroupTarget'](_0x59a81d,_0x5eeec3):null,_0x5d09ac=_0x59a81d['getContentParts']({'showDiff':this['_aiChatBalloonShowDiff'],'groupIndex':_0x215172,'editor':_0x179182?.['editor']??$s(this['context'])});(this['_activeBalloon']??_0x4e58b7)['updateContent']({'part':_0x5d09ac[0x0],'renderingStrategy':'static','keepErrors':!0x0});}),this['listenTo'](_0x4e58b7,'applySuggestion',()=>{const {replyId:_0x4ea432,partIndex:_0x535507}=this['_currentPreviewedChangeGroup'];this['_applySuggestion']({'replyId':_0x4ea432,'partIndex':_0x535507}),(this['_activeBalloon']??_0x4e58b7)['setState']('accepted');}),this['listenTo'](_0x4e58b7,'insertSuggestion',()=>{const {replyId:_0x5bcb09,partIndex:_0x2b05ba}=this['_currentPreviewedChangeGroup'];this['_insertSuggestion']({'replyId':_0x5bcb09,'partIndex':_0x2b05ba}),(this['_activeBalloon']??_0x4e58b7)['setState']('accepted');}),this['listenTo'](_0x4e58b7,'rejectSuggestion',()=>{const {replyId:_0x56e570,partIndex:_0x39c5c4}=this['_currentPreviewedChangeGroup'];this['_rejectSuggestion']({'replyId':_0x56e570,'partIndex':_0x39c5c4}),(this['_activeBalloon']??_0x4e58b7)['setState']('rejected');}),this['listenTo'](_0x4e58b7,'showNext',()=>{const {replyId:_0x4a6b3f,partIndex:_0x4124a2}=this['_currentPreviewedChangeGroup'],_0x1346a7=this['_getPresentableSiblingContentPartIndex'](_0x4a6b3f,_0x4124a2,'next');null!==_0x1346a7&&this['_openBalloonFor'](_0x4a6b3f,_0x1346a7);}),this['listenTo'](_0x4e58b7,'showPrevious',()=>{const {replyId:_0x1ce3c1,partIndex:_0x24ef16}=this['_currentPreviewedChangeGroup'],_0xa64196=this['_getPresentableSiblingContentPartIndex'](_0x1ce3c1,_0x24ef16,'previous');null!==_0xa64196&&this['_openBalloonFor'](_0x1ce3c1,_0xa64196);}),this['listenTo'](_0x4e58b7,'dialogClosed',(_0x36219f,{id:_0x7bafe7})=>{if('aiChatBalloon'!==_0x7bafe7)return;const {replyId:_0x16c96b,partIndex:_0x17666f}=this['_currentPreviewedChangeGroup'];this['_currentPreviewedChangeGroup']=null,this['_aiChatUi']['setFeedItemAIReplySuggestionPartActive']({'id':_0x16c96b,'index':_0x17666f,'isActive':!0x1}),this['_activeBalloon']===_0x4e58b7&&(this['_activeBalloon']=void 0x0);}));}['_integrateEditor'](_0x123bd1){if(this['_integrateEditorBalloon'](_0x123bd1),_0x123bd1['plugins']['has']('Undo')){const _0x2fe164=_0x123bd1['commands']['get']('undo'),_0x25f189=_0x123bd1['commands']['get']('redo');this['listenTo'](_0x2fe164,'revert',(_0x290c16,_0x10d177,_0x3af5ae)=>{const _0x238a84=this['_batchToChanges']['get'](_0x10d177);if(!_0x238a84)return;const _0x786435=this['activeConversation']['getInteraction'](_0x238a84['interactionId']),_0x3493a6=_0x786435?.['getReply'](_0x238a84['replyId']);this['_batchToChanges']['delete'](_0x10d177),_0x786435&&_0x3493a6&&(_0x238a84['indexes']['forEach'](_0x116407=>_0x3493a6['setChangeGroupState'](_0x116407,'pending')),this['_batchToChanges']['set'](_0x3af5ae,_0x238a84));}),this['listenTo'](_0x25f189,'revert',(_0x471bd6,_0x25681c,_0x14fcc3)=>{const _0x2734a4=this['_batchToChanges']['get'](_0x25681c);if(!_0x2734a4)return;const _0x1db9b7=this['activeConversation']['getInteraction'](_0x2734a4['interactionId']),_0x14e4e3=_0x1db9b7?.['getReply'](_0x2734a4['replyId']);this['_batchToChanges']['delete'](_0x25681c),_0x1db9b7&&_0x14e4e3&&(_0x2734a4['indexes']['forEach'](_0x3a3047=>_0x14e4e3['setChangeGroupState'](_0x3a3047,'accepted')),this['_batchToChanges']['set'](_0x14fcc3,_0x2734a4));});}const _0x2e1663=_0x123bd1['config']['get']('ai.chat.context');_0x2e1663['alwaysAddSelection']&&_0x2e1663['document']['enabled']&&this['listenTo'](_0x123bd1['model']['document']['selection'],'change:range',(_0x2a4866,_0x599b0f)=>{if(!_0x599b0f['directChange'])return;'chat'===_0x123bd1['plugins']['get']('AITabs')['view']['activeTab']&&(_0x123bd1['model']['hasContent'](_0x123bd1['model']['document']['selection'])?this['addSelectionToChatContext']():this['removeSelectionFromChatContext']());});}async['_getLastCreatedConversationId'](){const _0x47d7c5=this['_aiConnector']['fetchConversations'](this['getGroupId'](),{'limit':0x1,'sortBy':'createdAt'});try{const _0x25ea94=await _0x47d7c5['getConversations']();return _0x25ea94['length']?_0x25ea94[0x0]['id']:'new';}catch(_0xa083b6){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':_0xa083b6})),this['_aiChatUi']['toggleLoadingSkeleton'](!0x1),this['_aiChatUi']['disableControls'](),null;}}async['_startConversationSafely'](_0x1a7654={}){try{this['_aiChatUi']['enableControls'](),await this['_handleStartConversation'](_0x1a7654);}catch(_0x28a43b){this['_aiChatUi']['addFeedItemError']({'errorMessage':hs(this['context']['locale'],'AI_CHAT_UNABLE_TO_START_CONVERSATION'),'id':_0x1a7654['id']||ot()}),console['error'](_0x28a43b),this['activeConversation']=void 0x0,this['_aiChatUi']['disableControls']();}}async['_handleStartConversation']({id:_0x5e0cdd,modelId:_0x2fd0cc}={}){this['_activeBalloon']?.['close'](),this['_activeBalloon']=void 0x0,this['_currentPreviewedChangeGroup']=null;let _0x5c8345=_0x2fd0cc;_0x5c8345||(_0x5e0cdd||!this['activeConversation']?_0x5c8345=this['context']['config']['get']('ai.models.defaultModelId'):this['_aiChatUi']['isModelAvailable']&&(_0x5c8345=this['activeConversation']['selectedModel']['id'])),await this['_stopLastInteraction']();const _0x589980=this['getGroupId'](),_0x189b1a=_0x5e0cdd||ot();let _0x290cb0;this['activeConversation']=new Gs({'connector':this['_aiConnector'],'chatModels':this['_aiChatModels'],'selectedModelId':_0x5c8345,'conversationId':_0x189b1a,'group':_0x589980,'getEditor':()=>$s(this['context']),'getEditors':()=>Ws(this['context']),'locale':this['context']['locale'],'isFromHistory':!!_0x5e0cdd}),this['activeConversation']['delegate']('toolDataReceived','interactionCreated','interactionStarted','replyCreated')['to'](this),this['activeConversation']['on']('conversationInitialized',(_0x57f5d4,_0x48980c)=>{this['_aiChatUi']['createConversation'](_0x48980c),this['_aiChatUi']['resetMessageInput'](),this['_aiChatUi']['clearPendingContextUI'](),this['_aiChatUi']['clearConversationContextUI'](),_0x5e0cdd||(this['_aiChatUi']['resetConversationTitle'](),this['addCurrentDocumentToChatContext']());}),this['activeConversation']['on']('uploadProgressChanged',(_0x33fd7d,_0x4b41dc)=>{this['_aiChatUi']['setIsUploadInProgress'](_0x4b41dc['isUploadInProgress']);}),this['activeConversation']['on']('webSearchStarted',()=>{const _0x28bb13=this['_aiChatUi']['prepareLoadingMessage']({'isWebSearchEnabled':!0x0,'isReasoningEnabled':!0x1});this['_aiChatUi']['setLoadingMessage'](_0x28bb13);}),this['activeConversation']['on']('reasoningStarted',()=>{const _0x363112=this['_aiChatUi']['prepareLoadingMessage']({'isWebSearchEnabled':!0x1,'isReasoningEnabled':!0x0});this['_aiChatUi']['setLoadingMessage'](_0x363112);}),this['activeConversation']['on']('webSearchFinished',(_0xce35f5,_0x396a56)=>{this['_aiChatUi']['addFeedInteractionHeader'](_0x396a56,{'isWebSearchEnabled':!0x0,'isReasoningEnabled':!0x1});}),this['activeConversation']['on']('reasoningFinished',(_0x4ca86e,_0x2e2e32)=>{this['_aiChatUi']['addFeedInteractionHeader'](_0x2e2e32,{'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',(_0x52a817,_0x3d4449)=>{this['_aiChatUi']['removeFeedInteraction'](_0x3d4449['id']);}),this['activeConversation']['on']('setConversationTitle',(_0x58892c,_0xbb3f9f,_0x1fff58)=>{this['_updateConversationTitle'](_0xbb3f9f,_0x1fff58);}),this['activeConversation']['on']('replyContentUpdated',async(_0x53edda,_0xfb78f3)=>{void 0x0!==_0x290cb0&&_0x290cb0!==_0xfb78f3['id']&&this['_updateReplyContentThrottled']['flush'](),_0x290cb0=_0xfb78f3['id'],await this['_updateReplyContentThrottled']({'reply':_0xfb78f3});}),this['activeConversation']['on']('replyChangeGroupStateUpdated',(_0x38d2a1,{reply:_0x34922e,index:_0x596a77,state:_0x1856b3})=>{this['_aiChatUi']['updateFeedItemAIReplySuggestionPartState']({'id':_0x34922e['id'],'index':_0x596a77,'state':_0x1856b3}),this['_currentPreviewedChangeGroup']?.['replyId']['includes'](_0x34922e['id'])&&this['_currentPreviewedChangeGroup']?.['partIndex']==_0x596a77&&(this['_activeBalloon']??this['_aiChatBalloon'])?.['setState'](_0x1856b3);}),this['activeConversation']['on']('contextItemAdded',(_0x18241a,_0xcdead5)=>{if(this['_aiChatUi']['addContextItem'](_0xcdead5['contextItem'],_0xcdead5['isLoading']),'selection'===_0xcdead5['contextItem']['type']){const _0x55dd38=[...$s(this['context'])['model']['document']['selection']['getRanges']()];this['_aiEditing']['showFakeVisualSelection']({'ranges':_0x55dd38,'id':'context','priority':0x1});}}),this['activeConversation']['on']('contextItemRemoved',(_0x1effde,_0x2df509)=>{this['_aiChatUi']['removeContextItem'](_0x2df509['uiId']),'current-document'==_0x2df509['uiId']&&this['removeSelectionFromChatContext'](),'selection'===_0x2df509['type']&&this['_aiEditing']['hideFakeVisualSelection']('context');}),this['activeConversation']['on']('contextItemLoadingEnded',(_0x40b130,_0x149695)=>{this['_aiChatUi']['setContextItemLoading'](_0x149695['contextItem']['uiId'],_0x149695['isLoading']);}),this['activeConversation']['on']('contextSent',(_0x251ac4,_0x368bea)=>{this['_aiChatUi']['setConversationContext'](_0x368bea['contextItems']);}),this['activeConversation']['on']('addContextOptionsChanged',(_0x174b46,_0x14bdcd)=>{this['_aiChatUi']['setAddContextOptions'](_0x14bdcd['options']);}),this['activeConversation']['on']('sourceResourcesLoaded',(_0x2adecb,_0xf089eb)=>{this['_aiChatUi']['populateSourceResourceBalloon'](_0xf089eb['sourceId'],_0xf089eb['source'],_0xf089eb['resources'],_0xf089eb['uid']);}),this['activeConversation']['on']('resourceStateChanged',(_0x4a04ea,_0x3982f5)=>{this['_aiChatUi']['updateResourceState'](_0x3982f5['sourceId'],_0x3982f5['resourceId'],_0x3982f5['isInContext']);}),this['activeConversation']['on']('capabilitiesUpdated',(_0x3782a3,_0x25fe57)=>{this['_aiChatUi']['updateCapabilities'](_0x25fe57);}),this['activeConversation']['on']('modelSelected',async(_0x4b8a71,_0x39cb2f)=>{const _0x2e9b8c=(await this['_aiChatModels']['getAll']())['find'](_0x3bb513=>_0x3bb513['id']===_0x39cb2f['selectedModel']?.['id'])||null;this['_aiChatUi']['setSelectedModel'](_0x2e9b8c,_0x39cb2f['isDisabled']);}),this['activeConversation']['on']('error',(_0xc088b3,{error:_0x23fb61,interactionId:_0x1c97aa,fileName:_0x5ac24b,url:_0x94cd97,sourceId:_0x5710e0,sourceLabel:_0xa76236})=>{const _0x909042=_0x1c97aa?_0x1c97aa+':'+ot():ot();_0x23fb61['message']['startsWith']('ai-request-aborted')?this['_aiChatUi']['addFeedItemStaticMessage']({'staticMessage':hs(this['context']['locale'],'AI_CHAT_ABORTED_MESSAGE'),'id':_0x909042}):_0x23fb61['message']['startsWith']('ai-chat-conversation-init-failed')||_0x23fb61['message']['startsWith']('ai-chat-conversation-start-failed')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':hs(this['context']['locale'],'AI_CHAT_UNABLE_TO_START_CONVERSATION'),'id':_0x909042}),this['_logError'](_0x23fb61)):_0x23fb61['message']['startsWith']('ai-chat-file-upload-failed')?this['_aiChatUi']['addFeedItemError']({'errorMessage':hs(this['context']['locale'],'AI_CHAT_CONTEXT_UNABLE_TO_UPLOAD_FILE',_0x5ac24b),'id':_0x909042}):_0x23fb61['message']['startsWith']('ai-chat-url-upload-failed')?this['_aiChatUi']['addFeedItemError']({'errorMessage':hs(this['context']['locale'],'AI_CHAT_CONTEXT_UNABLE_TO_UPLOAD_URL',_0x94cd97),'id':_0x909042}):_0x23fb61['message']['startsWith']('ai-chat-context-invalid-data')?this['_aiChatUi']['addFeedItemError']({'errorMessage':hs(this['context']['locale'],'AI_CHAT_CONTEXT_INVALID_DATA'),'id':_0x909042}):_0x23fb61['message']['startsWith']('ai-chat-context-unsupported-type')?this['_aiChatUi']['addFeedItemError']({'errorMessage':hs(this['context']['locale'],'AI_CHAT_CONTEXT_UNSUPPORTED_TYPE'),'id':_0x909042}):_0x23fb61['message']['startsWith']('ai-chat-source-resources-load-failed')?(_0x5710e0&&this['_aiChatUi']['closeSourceResourceBalloon'](_0x5710e0),this['_aiChatUi']['addFeedItemError']({'errorMessage':hs(this['context']['locale'],'AI_CHAT_CONTEXT_UNABLE_TO_LOAD_RESOURCES',_0xa76236||'source'),'id':_0x909042}),this['_logError'](_0x23fb61)):_0x23fb61['message']['startsWith']('ai-chat-resource-load-failed')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':hs(this['context']['locale'],'AI_CHAT_RESOURCE_LOAD_FAILED'),'id':_0x909042}),this['_logError'](_0x23fb61)):_0x23fb61['message']['startsWith']('ai-chat-invalid-request')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':hs(this['context']['locale'],'AI_CHAT_INVALID_REQUEST'),'id':_0x909042}),this['_logError'](_0x23fb61)):_0x23fb61['message']['startsWith']('ai-chat-context-unsupported-file-type')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':hs(this['context']['locale'],'AI_CHAT_CONTEXT_UNSUPPORTED_FILE_TYPE'),'id':_0x909042}),this['_logError'](_0x23fb61)):_0x23fb61['message']['startsWith']('ai-chat-context-file-too-large')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':hs(this['context']['locale'],'AI_CHAT_CONTEXT_FILE_TOO_LARGE'),'id':_0x909042}),this['_logError'](_0x23fb61)):_0x23fb61['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':_0x909042}),this['_logError'](_0x23fb61)):_0x23fb61['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':_0x909042}),this['_logError'](_0x23fb61)):(this['_aiChatUi']['addFeedItemError']({'errorMessage':hs(this['context']['locale'],'AI_CHAT_GENERIC_ERROR'),'id':_0x909042}),this['_logError'](_0x23fb61));}),await this['activeConversation']['init'](this['context']['config']['get']('ai.chat.context')),_0x5e0cdd||await this['activeConversation']['start']();}async['_handleUIUserMessage']({message:_0x53a529,attributes:_0x87b734}){if(!this['activeConversation'])throw new at('ai-chat-controller-no-active-conversation');if(this['activeConversation']['isCurrentDocumentInContext']()){const _0x523c01=await this['_aiEditing']['getDocumentData']();_0x523c01['length']>0x1?await this['activeConversation']['updateDocumentsInContext'](_0x523c01):await this['activeConversation']['updateCurrentDocumentInContext'](_0x523c01[0x0]);}this['activeConversation']['id']&&this['activeConversation']['isStarted']&&await this['activeConversation']['handleUserInteraction']({'userMessage':_0x53a529,'attributes':_0x87b734});}['_logError'](_0x253999){Et(_0x253999['message']);}['_removeFromContext'](_0xe13bf1){this['activeConversation']?.['removeFromContext'](_0xe13bf1);}['_toggleWebSearch'](){this['activeConversation']?.['toggleWebSearch']();}['_toggleReasoning'](){this['activeConversation']?.['toggleReasoning']();}['getInteractionAndReplyById'](_0x10ca93){const [_0x64296c,_0x4f6c8c]=_0x10ca93['split'](':'),_0x3b603a=this['activeConversation']['getInteraction'](_0x64296c),_0x42f294=_0x3b603a['getReply'](_0x4f6c8c);return{'interaction':_0x3b603a,'reply':_0x42f294};}['_resolveGroupTarget'](_0x4858f2,_0x416bac){const _0x4e2f61=[..._0x416bac['changes']['filter'](_0x5d785c=>'context'!==_0x5d785c['type']),..._0x416bac['changes']['filter'](_0x53e749=>'context'===_0x53e749['type'])];for(const _0x363661 of _0x4e2f61){const _0xc5a7d8=_0x4858f2['newNodeAnchorIds']['get'](_0x363661['id']),_0xe5e901=this['activeConversation']?.['getSourceByDataId'](_0x363661['id'])||this['activeConversation']?.['getSourceByDataId'](_0xc5a7d8)||this['activeConversation']?.['getSourceByDataId'](_0x363661['anchorId']??void 0x0);if(_0xe5e901){if('destroyed'===_0xe5e901['editor']['state'])return null;const _0x197c6a=_0xe5e901['editor']['model']['document']['getRoot'](_0xe5e901['rootName']);return _0x197c6a?{'editor':_0xe5e901['editor'],'root':_0x197c6a,'parsedDocumentContent':_s(_0xe5e901['content']),'serializedDocumentContent':_0xe5e901['content'],'version':_0xe5e901['version']}:null;}}const _0x4c62c4=$s(this['context']),_0xa134cd=this['activeConversation']['getInteraction'](_0x4858f2['interactionId']),_0x2ac133=_0xa134cd?.['getDocumentContext']();return{'editor':_0x4c62c4,'root':_0x4c62c4['model']['document']['getRoot'](),'parsedDocumentContent':_0x4858f2['documentContextContent'],'serializedDocumentContent':_0x2ac133?.['content'],'version':_0x2ac133?.['version']};}['_groupChangesByTarget'](_0x46878a,_0x43731f){const _0x206d1e=new Map();for(const _0x5229e4 of _0x43731f){const _0x27574e=this['_resolveGroupTarget'](_0x46878a,_0x5229e4);if(!_0x27574e)continue;const _0x3f6505=(_0x27574e['editor']['id']||'e')+'|'+_0x27574e['root']['rootName'];let _0xbe0a01=_0x206d1e['get'](_0x3f6505);if(!_0xbe0a01){let _0x5adc88;for(const _0xe9077d of[..._0x5229e4['changes']['filter'](_0x55d093=>'context'!==_0x55d093['type']),..._0x5229e4['changes']['filter'](_0x46510e=>'context'===_0x46510e['type'])])if(_0x5adc88=this['activeConversation']?.['getDocumentContextSliceByDataId'](_0xe9077d['id'])||this['activeConversation']?.['getDocumentContextSliceByDataId'](_0x46878a['newNodeAnchorIds']['get'](_0xe9077d['id'])),_0x5adc88)break;_0xbe0a01={'target':{'editor':_0x27574e['editor'],'root':_0x27574e['root']},'slice':_0x5adc88,'groups':[],'groupsIndexes':[]},_0x206d1e['set'](_0x3f6505,_0xbe0a01);}_0xbe0a01['groups']['push'](_0x5229e4),_0xbe0a01['groupsIndexes']['push'](_0x46878a['changeGroups']['indexOf'](_0x5229e4));}return Array['from'](_0x206d1e['values']());}['_scrollToSuggestionRange'](_0x1c8eb8,_0x2069a2=!0x1,_0x23a55d){_0x23a55d??=$s(this['context']);const _0x2869df={'target':_0x23a55d['editing']['view']['domConverter']['viewRangeToDom'](_0x23a55d['editing']['mapper']['toViewRange'](_0x1c8eb8)),'viewportOffset':{'top':0x96,'left':0x0,'bottom':0x32,'right':0x0},'ancestorOffset':0x14,'alignToTop':_0x2069a2};_0x2069a2&&(_0x2869df['alignToTop']=!0x0),Ct(_0x2869df);}['_updateConversationTitle'](_0x25c460,_0x1d67cf=!0x1){this['_aiChatUi']['setConversationTitle'](_0x25c460||hs(this['context']['locale'],'AI_CHAT_UNTITLED_CONVERSATION'),_0x1d67cf);}['_addFeedItemReply'](_0xbac31){'text'===_0xbac31['type']?this['_aiChatUi']['addFeedItemAIReply'](_0xbac31):this['_aiChatUi']['addFeedItemAISuggestion'](_0xbac31);}async['_updateReplyContent']({reply:_0x475632,renderingStrategy:_0xc2431f}){const {id:_0x354ed0,interactionId:_0x4f4f89,isDone:_0x340451,type:_0x432f91,parsedContent:_0x1eb782}=_0x475632,_0x20dd48=_0x4f4f89+':'+_0x354ed0;if('modification'===_0x432f91){const _0x510124=_0x475632['getContentParts']({'showDiff':this['_aiChatUi']['showDiff'],'editor':$s(this['context'])});await this['_aiChatUi']['updateFeedItemAIReplySuggestionContent']({'id':_0x20dd48,'parts':_0x510124,'isDone':_0x340451,'skipLoadingEffects':_0x475632['isFromHistory']});}else'text'===_0x432f91&&await this['_aiChatUi']['updateFeedItemAIReplyContent']({'id':_0x20dd48,'parsedContent':_0x1eb782,'renderingStrategy':_0xc2431f,'isDone':_0x340451});_0x340451&&_0x475632['sources']['length']>0x0&&this['_aiChatUi']['updateFeedItemAIReplySources'](_0x20dd48,_0x475632['sources']);}['_updateReplyContentThrottled']=_0x2c7665(this['_updateReplyContent']['bind'](this),0xc8);async['_stopLastInteraction'](){const _0x170aff=this['activeConversation']?.['lastInteraction'];_0x170aff&&(_0x170aff['stop'](),this['_aiChatUi']['stopInteraction'](_0x170aff)),this['_updateReplyContentThrottled']['cancel']();}async['_flushLastInteractionUI'](){const _0x565cfa=this['activeConversation']?.['lastInteraction'];if(_0x565cfa){for await(const _0x227c3b of _0x565cfa['replies'])this['_aiChatUi']['hasFeedItem'](_0x227c3b['id'])||this['_addFeedItemReply'](_0x227c3b),await this['_updateReplyContent']({'reply':_0x227c3b,'renderingStrategy':'static'});}}['_updateRatings'](_0x159099){const _0xa07cdc={'positiveCount':_0x159099['changeGroups']['filter'](_0x6f642d=>'accepted'===_0x6f642d['state'])['length'],'totalCount':_0x159099['changeGroups']['length'],'modificationId':_0x159099['id']},_0x3b4576=this['activeConversation']['getInteraction'](_0x159099['interactionId'])['messageId'];_0x3b4576&&this['_aiConnector']['upsertAIChatRating'](this['activeConversation']['id'],_0x3b4576,_0xa07cdc);}['_getAIChatFeedAPI'](_0x31d9c0){const _0x351bd4=this['_aiChatUi'],_0x3bc63b=()=>{_0x31d9c0['resetWebSearchState'](),_0x31d9c0['resetReasoningState'](),_0x351bd4['clearLoadingMessage']();},_0x56cec4=()=>{_0x31d9c0['currentReply']&&(_0x31d9c0['currentReply']['done'](),_0x31d9c0['currentReply']=void 0x0);};return{'insertTextReply':(_0x43d2fd,_0xff8538)=>{_0x56cec4(),_0x3bc63b();const _0x85404e=_0x31d9c0['currentReply']=_0x31d9c0['createReply']({'type':'text','interactionId':_0x31d9c0['id'],'content':_0x43d2fd,'id':_0xff8538||ot()});return _0x56cec4(),_0x85404e;},'insertCustomElement':async(_0x3d8067,_0x1fb409)=>(_0x56cec4(),_0x3bc63b(),_0x351bd4['addFeedItemCustomElement'](_0x3d8067,_0x1fb409||ot())),'setLoadingMessage':_0x68316f=>{_0x351bd4['setLoadingMessage'](_0x68316f);},'clearLoadingMessage':()=>{_0x351bd4['clearLoadingMessage']();}};}}const zs='ai-selection',js=['br'];class Js extends _0x35ff8d{constructor(_0x43df53){super(_0x43df53),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 _0x120c81=Ws(this['context']),_0x51b521=_0x120c81['find'](_0x492e19=>_0x492e19['plugins']['has']('RealTimeCollaborationClient'))||_0x120c81[0x0],_0x38b317=_0x51b521['plugins']['has']('RealTimeCollaborationClient')&&_0x51b521['plugins']['get']('RealTimeCollaborationClient')['sessionId'];this['_sessionId']=_0x38b317||ot();}return this['_sessionId'];}async['getDocumentData'](){const _0x5cb590=Ws(this['context']);if(!_0x5cb590['length'])throw new at('ai-get-editor-from-context-no-editor');const _0x549471=[],_0xff3fa6=new Set();for(const _0x527f55 of _0x5cb590){const _0xb6d063=_0x527f55['config']['get']('roots')||{};for(const _0x152ca8 of _0x527f55['model']['document']['getRoots']()){if('$graveyard'===_0x152ca8['rootName'])continue;const _0x1c0078=await this['_getDocumentDataForEditorRoot'](_0x527f55,_0x152ca8,_0xff3fa6),_0x256455=_0xb6d063[_0x152ca8['rootName']];_0x549471['push']({'editor':_0x527f55,'rootName':_0x152ca8['rootName'],'content':_0x1c0078['content'],'version':_0x1c0078['version'],'sessionId':this['sessionId'],'selections':_0x1c0078['selections'],'name':_0x152ca8['rootName'],'description':_0x256455?.['description']});}}return _0x549471;}async['_getDocumentDataForEditorRoot'](_0x369316,_0x224887,_0x228d83){const _0x42ae7d=_0x369316['data']['toView'](_0x224887,{'convertAiChatSelectionMarker':!0x0}),_0x93631b=new _0x3dbbd3(_0x369316['editing']['view']['document']);this['_setDataIdsOnChildren'](_0x42ae7d,_0x93631b,_0x228d83);let _0x1a7356=await this['_getDocumentDataStringFromView'](_0x42ae7d,_0x369316);const _0x11c620=this['_getMarkersInDocumentOrder'](_0x369316,_0x224887),_0x5924b6=[];for(const _0x325e77 of _0x11c620){const _0x521644='<'+_0x325e77['name']+':start></'+_0x325e77['name']+':start>',_0x453269=_0x1a7356['indexOf'](_0x521644);_0x1a7356=_0x1a7356['substring'](0x0,_0x453269)+_0x1a7356['substring'](_0x453269+_0x521644['length']);const _0x2764d3='<'+_0x325e77['name']+':end></'+_0x325e77['name']+':end>',_0x8d9ca6=_0x1a7356['indexOf'](_0x2764d3);_0x1a7356=_0x1a7356['substring'](0x0,_0x8d9ca6)+_0x1a7356['substring'](_0x8d9ca6+_0x2764d3['length']),_0x5924b6['push']({'markerName':_0x325e77['name'],'start':_0x453269,'end':_0x8d9ca6,'htmlFragment':_0x1a7356['substring'](_0x453269,_0x8d9ca6)});}return{'content':_0x1a7356,'version':_0x369316['model']['document']['version'],'selections':_0x5924b6};}async['afterInit'](){this['context']instanceof _0x45e816?this['_integrateEditor'](this['context']):this['listenTo'](this['context']['editors'],'add',(_0xcad004,_0x241109)=>{_0x241109['on']('ready',()=>{this['_integrateEditor'](_0x241109);});});}['_setOutputDataProcessor'](_0x19a235){this['_outputDataProcessor']=_0x19a235;}async['_getDocumentDataStringFromView'](_0x1f0fff,_0x420fe5){let _0xbfbac9;if(this['_outputDataProcessor']){const _0x47afee=_0x420fe5['data']['processor']['domConverter']['viewToDom'](_0x1f0fff),_0x4225d4=await this['_outputDataProcessor'](_0x47afee);_0xbfbac9=_0x420fe5['data']['processor']['htmlWriter']['getHtml'](_0x4225d4);}else _0xbfbac9=_0x420fe5['data']['processor']['toData'](_0x1f0fff);return _0xbfbac9;}['_integrateEditor'](_0x3542c8){_0x3542c8['ui']['focusTracker']['on']('change:isFocused',(_0x247898,_0x16e859,_0x4fbc62)=>{_0x4fbc62&&(this['_lastContentFocusedEditor']=_0x3542c8);}),_0x3542c8['on']('destroy',()=>{this['_lastContentFocusedEditor']===_0x3542c8&&(this['_lastContentFocusedEditor']=void 0x0);}),_0x3542c8['conversion']['for']('editingDowncast')['markerToHighlight']({'model':zs,'view':({markerName:_0x476403})=>({'classes':['ck-ai-assistant-ui_theme','ck-fake-ai-selection','ck-fake-ai-selection-'+_0x476403['split'](':')[0x1]],'priority':0xc})}),_0x3542c8['conversion']['for']('dataDowncast')['markerToElement']({'model':zs+':context','view':(_0x29a0a6,{writer:_0x20eb26,options:_0x2668a7})=>_0x2668a7['convertAiChatSelectionMarker']?_0x20eb26['createUIElement'](_0x29a0a6['markerName']+':'+(_0x29a0a6['isOpening']?'start':'end')):null});}['showFakeVisualSelection'](_0x5f2fc6){const _0x1907bb=this['_fakeSelections'][0x0]||null;this['_addFakeSelection'](_0x5f2fc6);const _0x13d134=this['_fakeSelections'][0x0]||null;this['_refreshFakeSelection'](_0x1907bb,_0x13d134);}['hideFakeVisualSelection'](_0x344129){const _0x46eb40=this['_fakeSelections'][0x0]||null;this['_removeFakeSelectionById'](_0x344129);const _0x364e51=this['_fakeSelections'][0x0]||null;this['_refreshFakeSelection'](_0x46eb40,_0x364e51);}async['modelToDataWithIds'](_0x63edd3){const _0x4bbba3=$s(this['context']),_0x1a2878=_0x4bbba3['data']['toView'](_0x63edd3),_0x595f75=new _0x3dbbd3(_0x4bbba3['editing']['view']['document']);return this['_setDataIdsOnChildren'](_0x1a2878,_0x595f75),this['_getDocumentDataStringFromView'](_0x1a2878,_0x4bbba3);}['_setDataIdsOnChildren'](_0x125fae,_0xb6c30,_0x557013=new Set()){let _0x229416=!0x1;for(const _0x16e59a of _0x125fae['getChildren']()){if(!_0x16e59a['is']('view:element')||js['includes'](_0x16e59a['name']))continue;const _0xc09d00=_0x16e59a['is']('view:containerElement'),_0x5c6db5=_0x16e59a['is']('view:emptyElement'),_0x2a3b89=this['_setDataIdsOnChildren'](_0x16e59a,_0xb6c30,_0x557013);if(_0x16e59a['hasAttribute']('data-id')){_0x229416=!0x0,_0x557013['add'](_0x16e59a['getAttribute']('data-id'));continue;}(_0xc09d00||_0x5c6db5||_0x2a3b89)&&(_0xb6c30['setAttribute']('data-id',this['_nextDataId'](_0x557013),_0x16e59a),_0x229416=!0x0);}return _0x229416;}['_nextDataId'](_0x247a1f){let _0x697f6e;do{_0x697f6e='';for(let _0x37adc6=0x0;_0x37adc6<0x4;_0x37adc6++)_0x697f6e+=String['fromCharCode'](0x61+Math['floor'](0x1a*Math['random']()));}while(_0x247a1f['has'](_0x697f6e));return _0x247a1f['add'](_0x697f6e),_0x697f6e;}['getSelectionText'](){const {model:_0x3dc7da}=$s(this['context']),_0x35f349=_0x3dc7da['document']['selection'],_0x3dca40=[],_0x382a8b=Array['from'](_0x35f349['getRanges']());_0x382a8b['sort']((_0x7512c6,_0x161227)=>_0x7512c6['start']['isBefore'](_0x161227['start'])?-0x1:0x1);for(const _0x3d877a of _0x382a8b)for(const _0x2b2c5c of _0x3d877a['getItems']())_0x2b2c5c['is']('$textProxy')?_0x3dca40['push'](_0x2b2c5c['data']):_0x2b2c5c['is']('element')&&_0x3dca40['length']>0x0&&'\x20'!==_0x3dca40[_0x3dca40['length']-0x1]&&_0x3dca40['push']('\x20');return _0x3dca40['length']?'\x22'+_0x3dca40['join']('')['trim']()+'\x22':hs(this['context']['locale'],'AI_CHAT_CONTEXT_DOCUMENT_SELECTION_LABEL');}['_removeFakeSelectionById'](_0x5c3013){for(let _0x944d2=0x0;_0x944d2<this['_fakeSelections']['length'];_0x944d2++)if(this['_fakeSelections'][_0x944d2]['id']==_0x5c3013)return void this['_fakeSelections']['splice'](_0x944d2,0x1);}['_addFakeSelection'](_0x9d8e35){this['_removeFakeSelectionById'](_0x9d8e35['id']),wt(this['_fakeSelections'],_0x9d8e35);}['_refreshFakeSelection'](_0x23f13a,_0x121ce8){if(_0x23f13a==_0x121ce8)return;const _0x4f4808=_0x23f13a?this['_getEditorForFakeSelection'](_0x23f13a):null,_0xe00270=_0x121ce8?this['_getEditorForFakeSelection'](_0x121ce8):null,_0x1699f2=(_0x978b9,_0x4ba418)=>{const _0x5d775e=_0x4ba418['model']['markers']['getMarkersGroup'](zs);for(const _0x2b7f5b of _0x5d775e)_0x978b9['removeMarker'](_0x2b7f5b);},_0x39c356=(_0x14996c,_0x28bced,_0x19386f)=>{const _0x264760=_0x28bced['model'];for(let _0x4df720=0x0;_0x4df720<_0x19386f['ranges']['length'];_0x4df720++){let _0x2b2767=_0x19386f['ranges'][_0x4df720];const _0x23cede=zs+':'+_0x19386f['id']+':'+_0x4df720;if(_0x2b2767['start']['isAtEnd']){const _0x99b9e7=_0x2b2767['start']['getLastMatchingPosition'](({item:_0x5cfb4f})=>!_0x264760['schema']['isContent'](_0x5cfb4f),{'boundaries':_0x2b2767});_0x2b2767=_0x14996c['createRange'](_0x99b9e7,_0x2b2767['end']);}_0x14996c['addMarker'](_0x23cede,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x2b2767});}};_0x4f4808&&_0xe00270&&_0x4f4808===_0xe00270&&_0x121ce8?_0x4f4808['model']['change'](_0x52d66e=>{_0x1699f2(_0x52d66e,_0x4f4808),_0x39c356(_0x52d66e,_0xe00270,_0x121ce8);}):(_0x4f4808&&_0x4f4808['model']['change'](_0x4def84=>_0x1699f2(_0x4def84,_0x4f4808)),_0xe00270&&_0x121ce8&&_0xe00270['model']['change'](_0x457d9f=>_0x39c356(_0x457d9f,_0xe00270,_0x121ce8)));}['_getEditorForFakeSelection'](_0x30c436){if(!_0x30c436['ranges']['length'])return $s(this['context']);const _0x160d03=_0x30c436['ranges'][0x0]['root']['document'];return Ws(this['context'])['find'](_0x46a34c=>_0x46a34c['model']['document']===_0x160d03)??$s(this['context']);}['_getMarkersInDocumentOrder'](_0x278963,_0x160dcf){const _0x473b60=Array['from'](_0x278963['model']['markers']['getMarkersGroup'](zs+':context'));return(_0x160dcf?_0x473b60['filter'](_0x25f79a=>{const _0x2c255b=_0x25f79a['getRange']();return _0x2c255b&&_0x2c255b['root']['rootName']===_0x160dcf['rootName'];}):_0x473b60)['sort']((_0x1b39fa,_0x3f426c)=>_0x1b39fa['getStart']()['isBefore'](_0x3f426c['getStart']())?-0x1:_0x1b39fa['getStart']()['isAfter'](_0x3f426c['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(_0x57d41a){const _0x5cc316=new AbortController();return{'promise':new Promise((_0x88dd07,_0x3f4bd4)=>{const _0x2eec1a=setTimeout(_0x88dd07,_0x57d41a);_0x5cc316['signal']['addEventListener']('abort',()=>{clearTimeout(_0x2eec1a),_0x3f4bd4();});}),'abortController':_0x5cc316};}class sn{['options'];['isStreaming']=!0x1;['document']=null;['nodesList']=[];['currentIndex']=0x0;['timeoutAbortController']=null;['lastUpdateTime']=0x0;constructor(_0x3fc111){this['options']={'delay':_0x3fc111?.['delay']??0xa,'textNodeStyle':_0x3fc111?.['textNodeStyle']??'animation:\x20ck-html-streamer-fade-in\x20.3s'};}async['stream']({document:_0x2d7a6c,targetElement:_0x4726fc,abortSignal:_0x4142cb}){this['isStreaming']&&this['stop'](),_0x4142cb?.['addEventListener']('abort',this['stop']['bind'](this)),this['document']=_0x36c6c8(_0x2d7a6c,!0x0),this['nodesList']=this['getParsedDocumentNodeList'](),this['isStreaming']=!0x0,this['currentIndex']>this['nodesList']['length']&&(this['currentIndex']=this['nodesList']['length']);for(let _0x5872b4=0x0;_0x5872b4<this['currentIndex'];_0x5872b4++)this['nodesList'][_0x5872b4]['shouldBeStreamed']=!0x0;do{const _0x56a9b0=Date['now'](),_0x37285d=this['nodesList'][this['currentIndex']],_0x559d86=_0x56a9b0-this['lastUpdateTime'];if(_0x37285d){_0x37285d['shouldBeStreamed']=!0x0;let _0x87f409=_0x37285d['parent'];for(;_0x87f409;)_0x87f409['shouldBeStreamed']=!0x0,_0x87f409=_0x87f409['parent'];}if(_0x559d86<this['options']['delay'])try{const {promise:_0x28c2f2,abortController:_0x555ac6}=en(this['options']['delay']-_0x559d86);this['timeoutAbortController']=_0x555ac6,await _0x28c2f2;}catch(_0x37dc78){return;}_0x460d88(_0x4726fc,'<'+_0x4726fc['tagName']+'>'+this['renderNode'](this['document'])+'</'+_0x4726fc['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:_0x3f0b3f}){Array['from'](_0x3f0b3f['querySelectorAll']('span[data-ck-html-streamer-word-chunk]'))['reverse']()['forEach'](_0x586027=>{_0x586027['replaceWith'](_0x586027['childNodes'][0x0]);});}['stop'](){this['isStreaming']=!0x1,this['timeoutAbortController']&&(this['timeoutAbortController']['abort'](),this['timeoutAbortController']=null);}['renderNode'](_0x3e43cd){let _0x22b925='';if(function(_0x48bc4f){return _0x5f4bc6(_0x48bc4f);}(_0x3e43cd)){for(const _0x519a2d of _0x3e43cd['children'])_0x22b925+=this['renderNode'](_0x519a2d);}else{if(on(_0x3e43cd)){if(!_0x3e43cd['shouldBeStreamed'])return'';const _0x305d77=_0x3e43cd,_0x10e657=Object['entries'](_0x305d77['attribs'])['map'](([_0x361a0a,_0x3000c2])=>_0x361a0a+'=\x22'+_0x3000c2+'\x22')['join']('\x20');_0x22b925+='<'+_0x305d77['tagName']+(_0x10e657?'\x20'+_0x10e657:'')+'>';for(const _0x1a9450 of _0x4754f3(_0x305d77))_0x22b925+=this['renderNode'](_0x1a9450);_0x22b925+='</'+_0x305d77['tagName']+'>';}else{if(!rn(_0x3e43cd))return'';if(!_0x3e43cd['shouldBeStreamed'])return'';!function(_0x19704a){if(!_0x19704a['parent']||!on(_0x19704a['parent']))return!0x1;if(!nn['includes'](_0x19704a['parent']['tagName']))return!0x1;return!_0x58d219(_0x19704a)['match'](/^\s*[<>]\s*$/);}(_0x3e43cd)?_0x22b925+=ti(_0x3e43cd):_0x22b925+=ti(new _0x3266dc('span',{'data-ck-html-streamer-word-chunk':'','style':this['options']['textNodeStyle']},[_0x3e43cd]));}}return _0x22b925;}['getParsedDocumentNodeList'](){const _0x34ea68=[];return function(_0x957fff,_0x5ca493){const _0x16862b=_0x39a9bd=>{if(_0x5ca493(_0x39a9bd),_0x39a9bd instanceof _0x5f3adb)for(let _0x34198c=0x0;_0x34198c<_0x39a9bd['children']['length'];_0x34198c++){const _0x126629=_0x39a9bd['children'][_0x34198c];_0x16862b(_0x126629);}};for(let _0x2f2e2e=0x0;_0x2f2e2e<_0x957fff['children']['length'];_0x2f2e2e++)_0x16862b(_0x957fff['children'][_0x2f2e2e]);}(this['document'],_0x367d41=>{if(rn(_0x367d41)){const _0x5c58e5=this['splitTextNodeIntoWordNodes'](_0x367d41);_0x5c58e5['length']&&_0x34ea68['push'](..._0x5c58e5);}_0x367d41['isWordSplitSource']||_0x367d41['isWordSplitResult']||_0x34ea68['push'](_0x367d41);}),_0x34ea68;}['splitTextNodeIntoWordNodes'](_0x506c06){if(_0x506c06['isWordSplitSource']||_0x506c06['isWordSplitResult'])return[];const _0x28a9cf=_0x58d219(_0x506c06)['match'](/(?:\s*\S+\s*)/g),_0xc0eec1=[];if(_0x28a9cf&&_0x28a9cf['length']>0x1){for(const _0x9ce2e8 of _0x28a9cf){const _0x457f2d=new _0x5adb0c(_0x9ce2e8);_0x457f2d['isWordSplitResult']=!0x0,_0x2d6be7(_0x506c06,_0x457f2d),_0xc0eec1['push'](_0x457f2d);}_0x506c06['isWordSplitSource']=!0x0,_0x4718cb(_0x506c06);}return _0xc0eec1;}}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(_0x20c7fb){return _0x5133c6(_0x20c7fb);}function on(_0x3511e1){return _0x252b51(_0x3511e1);}class an extends vt{['options'];['content']='';['htmlStreamer'];['children'];constructor(_0x3577e1){super();const _0x2d9f80=this['bindTemplate'];this['set']('isDone',!0x1),this['set']('isVisible',!0x0),this['htmlStreamer']=new sn(),this['options']=_0x3577e1,this['children']=this['createCollection'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed__item',_0x2d9f80['if']('isDone','ck-ai-chat__feed__item_done'),_0x2d9f80['if']('isVisible','ck-hidden',_0x4f36b5=>!_0x4f36b5),'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'](_0x2346d4=>{_0x2346d4['removeAttribute']('data-id');}),this['isDone']=!0x0;}async['streamIntoElement'](_0xce660,_0x2679fb,_0x183f7e){await this['htmlStreamer']['stream']({'document':_0xce660,'targetElement':_0x2679fb,'abortSignal':_0x183f7e});}}class hn extends vt{['showChangesToggleView'];constructor(_0x1f6b40,_0x20ecc9){super(_0x1f6b40),this['set']('isShowChangesToggleVisible',!0x0),this['showChangesToggleView']=new cn(_0x1f6b40),this['showChangesToggleView']['set']({'class':'ck-ai-suggestion__header__show-changes-toggle\x20ck-ai-chat-controls-button\x20'+us,'label':hs(_0x1f6b40,'AI_SUGGESTION_BUTTON_SHOW_CHANGES'),'withText':!0x0}),this['showChangesToggleView']['isOn']=_0x20ecc9['showDiff'],this['showChangesToggleView']['bind']('isVisible')['to'](this,'isShowChangesToggleVisible'),this['showChangesToggleView']['bind']('icon')['to'](this['showChangesToggleView'],'isOn',_0x113221=>_0x113221?_0x43b400:_0x75dd65),this['showChangesToggleView']['on']('execute',()=>{this['showChangesToggleView']['isOn']=!this['showChangesToggleView']['isOn'],this['fire']('toggleShowChanges',{'isOn':this['showChangesToggleView']['isOn']});});const _0x4ce3c9=new xt();_0x4ce3c9['content']=_0xded5c0,this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__header',!0x1===_0x20ecc9['showHeader']?'ck-hidden':null]['filter'](Boolean)},'children':[_0x4ce3c9,{'tag':'span','children':[hs(_0x1f6b40,'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':_0x5a16b4,'rejected':_0x44bc9f,'outdated':_0x44bc9f};class un extends vt{['stateIconView'];constructor(_0x18afa){super(_0x18afa);const _0x1ffc69=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',_0x1ffc69['to']('state',_0x3473ee=>'ck-ai-suggestion__content-part-state_'+_0x3473ee),_0x1ffc69['if']('isVisible','ck-hidden',_0x43c8db=>!_0x43c8db)]},'children':[{'tag':'span','attributes':{'class':['ck-ai-suggestion__content-part-state__label']},'children':[{'text':_0x1ffc69['to']('state',_0x1150aa=>{switch(_0x1150aa){case'accepted':return hs(_0x18afa,'AI_SUGGESTION_CONTENT_PART_STATE_ACCEPTED');case'rejected':return hs(_0x18afa,'AI_SUGGESTION_CONTENT_PART_STATE_REJECTED');case'outdated':return hs(_0x18afa,'AI_SUGGESTION_CONTENT_PART_STATE_OUTDATED');}})}]},this['stateIconView']]});}['setState'](_0xc3516c){this['state']=_0xc3516c;}}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(_0x2b3fa7,_0x2d99ca,_0x34cb59){super(_0x2b3fa7);const _0x396ef1=Boolean(_0x34cb59);this['set']('isEnabled',!_0x396ef1),this['set']('isVisible',!0x0),this['class']='ck-ai-suggestion-content-part-toolbar';const _0x43feb5=[];if(_0x396ef1){const _0x25cdf6=new Nt(_0x2b3fa7);_0x25cdf6['set']({'label':hs(_0x2b3fa7,'AI_SUGGESTION_DISABLED_TOOLTIP_MESSAGE'),'tooltip':!0x0,'withText':!0x1,'icon':_0x2f24b6}),_0x25cdf6['extendTemplate']({'attributes':{'data-cke-tooltip-class':'ck-ai-suggestion-content-part-disabled-actions-tooltip'}}),_0x43feb5['push'](_0x25cdf6);}else{_0x2d99ca['includes']('applySuggestion')&&(this['_applyButton']=new Nt(_0x2b3fa7),this['_applyButton']['set']({'label':hs(_0x2b3fa7,'AI_SUGGESTION_CONTENT_PART_APPLY'),'tooltip':!0x0,'tooltipPosition':'n','withText':!0x1,'icon':_0x5a16b4}),this['_applyButton']['bind']('isEnabled')['to'](this),this['_applyButton']['on']('execute',()=>{this['fire']('applySuggestion');}),_0x43feb5['push'](this['_applyButton'])),_0x2d99ca['includes']('insertSuggestion')&&(this['_suggestButton']=new Nt(_0x2b3fa7),this['_suggestButton']['set']({'label':hs(_0x2b3fa7,'AI_SUGGESTION_CONTENT_PART_ADD_SUGGESTION'),'tooltip':!0x0,'tooltipPosition':'n','withText':!0x1,'icon':_0x54984e}),this['_suggestButton']['bind']('isEnabled')['to'](this),this['_suggestButton']['on']('execute',()=>{this['fire']('insertSuggestion');}),_0x43feb5['push'](this['_suggestButton']));const _0x13521a=new Nt(_0x2b3fa7);_0x13521a['set']({'label':hs(_0x2b3fa7,'AI_SUGGESTION_CONTENT_PART_REJECT'),'tooltip':!0x0,'tooltipPosition':'n','withText':!0x1,'icon':_0x44bc9f}),_0x13521a['bind']('isEnabled')['to'](this),_0x13521a['on']('execute',()=>{this['fire']('rejectSuggestion');}),_0x43feb5['push'](_0x13521a);}this['items']['addMany'](_0x43feb5);const _0x245ff7=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':[_0x245ff7['if']('isVisible','ck-hidden',_0x56451f=>!_0x56451f)]}});}['setButtonsVisibility']({showApplyButton:_0x25fe58,showSuggestButton:_0x20d6a7}){this['_applyButton']&&(this['_applyButton']['isVisible']=_0x25fe58),this['_suggestButton']&&(this['_suggestButton']['isVisible']=_0x20d6a7);}}class gn extends vt{['toolbarView'];['stateView'];['titleLabelView'];['children'];constructor(_0x3e1c3b,{part:_0x2378d8,uiIndex:_0xcc0299,availableActions:_0x38b1b5,areActionsDisabled:_0x520169}){super(_0x3e1c3b),this['set']('isEnabled',!0x0),this['set']('state','pending'),this['toolbarView']=new _n(_0x3e1c3b,_0x38b1b5,_0x520169),this['toolbarView']['on']('rejectSuggestion',()=>{this['fire']('rejectSuggestion',{'index':_0x2378d8['index']});}),this['toolbarView']['on']('insertSuggestion',()=>{this['fire']('insertSuggestion',{'index':_0x2378d8['index']});}),this['toolbarView']['on']('applySuggestion',()=>{this['fire']('applySuggestion',{'index':_0x2378d8['index']});}),this['toolbarView']['bind']('isEnabled')['to'](this),this['stateView']=new un(_0x3e1c3b),this['titleLabelView']=new An(_0x3e1c3b,_0xcc0299),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',(_0x4dca16,_0x3e019f,_0x62406f,_0x157498)=>{'pending'===_0x157498?this['children']['remove'](this['toolbarView']):this['children']['remove'](this['stateView']),'pending'===_0x62406f?this['children']['add'](this['toolbarView']):(this['stateView']['setState'](_0x62406f),this['children']['add'](this['stateView']));});}}class An extends vt{constructor(_0x57673a,_0x16e59e){super(_0x57673a),this['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai-suggestion__body__content-part__title__label']},'children':[hs(_0x57673a,'AI_SUGGESTION_CONTENT_PART_TITLE',_0x16e59e['toString']())]});}}class In extends vt{['htmlStreamer'];constructor(_0x7ec12f){super(_0x7ec12f),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:_0x190370,renderingStrategy:_0x4e8d68,abortSignal:_0x35d948}){'streaming'===_0x4e8d68?await this['htmlStreamer']['stream']({'document':_0x190370['content'],'targetElement':this['element'],'abortSignal':_0x35d948}):_0x460d88(this['element'],'<'+this['element']['tagName']+'>'+gs(_0x190370['content'])+'</'+this['element']['tagName']+'>',{'childrenOnly':!0x0});}['clear'](){this['htmlStreamer']['reset'](),this['element']['innerHTML']='';}}class En extends vt{['_children'];['_headerView'];['_streamableContentView'];constructor(_0xc2fa48,{part:_0x2e7611,uiIndex:_0x370cc2,areActionsDisabled:_0x1bbbce,availableActions:_0x676e65}){super(_0xc2fa48);const _0x4cc6f6=this['bindTemplate'];this['set']('state','pending'),this['set']('isDone',!0x1),this['set']('isVisible',!0x1),this['set']('isActive',!0x1),this['set']('isEnabled',!0x1);const _0x2ad3c9=()=>{this['isEnabled']=this['isDone']&&'pending'==this['state']&&!_0x1bbbce;};this['on']('change:state',_0x2ad3c9),this['on']('change:isDone',_0x2ad3c9),_0x2ad3c9(),this['_children']=this['createCollection'](),this['_headerView']=new gn(_0xc2fa48,{'part':_0x2e7611,'uiIndex':_0x370cc2,'availableActions':_0x676e65,'areActionsDisabled':_0x1bbbce}),this['_headerView']['bind']('isEnabled','state')['to'](this),this['_headerView']['delegate'](...Zs)['to'](this),this['_streamableContentView']=new In(_0xc2fa48),this['_children']['addMany']([this['_headerView'],this['_streamableContentView']]),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__body__content-part',_0x4cc6f6['to']('state',_0x2252a9=>'ck-ai-suggestion__body__content-part_'+_0x2252a9),_0x4cc6f6['if']('isEnabled','ck-ai-suggestion__body__content-part_enabled'),_0x4cc6f6['if']('isActive','ck-ai-suggestion__body__content-part_active'),_0x4cc6f6['if']('isVisible','ck-hidden',_0x474837=>!_0x474837)]},'children':this['_children'],'on':{'mouseenter':_0x4cc6f6['to'](()=>{this['isEnabled']&&this['fire']('mouseOverSuggestion',{'index':_0x2e7611['index']});}),'mouseleave':_0x4cc6f6['to'](()=>{this['isEnabled']&&this['fire']('mouseLeaveSuggestion',{'index':_0x2e7611['index']});}),'click':_0x4cc6f6['to'](_0x4417b7=>{const _0x404b8f=_0x4417b7['target'];this['isEnabled']&&!this['_headerView']['toolbarView']['element']['contains'](_0x404b8f)&&this['fire']('showChangeInText',{'index':_0x2e7611['index']});})}});}async['updateContent']({part:_0x225596,showUnchangedParts:_0xebb570=!0x1,abortSignal:_0x4de9ef}){this['partDefinition']=_0x225596,this['isVisible']=this['partDefinition']['hasChanges']||_0xebb570,this['isVisible']&&await this['_streamableContentView']['update']({'part':_0x225596,'renderingStrategy':'static','abortSignal':_0x4de9ef});}['markAsDone'](){this['isDone']=!0x0;}}class pn extends vt{constructor(_0x128aa4,_0xfae48){super(_0x128aa4),this['set']('isVisible',!0x0),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-skeleton',this['bindTemplate']['if']('isVisible','ck-hidden',_0x40b686=>!_0x40b686)]},'children':this['_createSkeletonItems'](_0xfae48)});}['_createSkeletonItems'](_0x4b3691){const _0x12e725=['ck','ck-ai-skeleton__item'];return _0x4b3691['map'](_0x111ce9=>{let _0x1d994f='';switch(_0x111ce9['attributes']['align']){case'right':_0x1d994f='margin-left:\x20auto;\x20margin-right:\x200;\x20text-align:\x20right;';break;case'center':_0x1d994f='margin-left:\x20auto;\x20margin-right:\x20auto;\x20text-align:\x20center;';break;case'left':_0x1d994f='margin-left:\x200;\x20margin-right:\x20auto;\x20text-align:\x20left;';}return{'tag':_0x111ce9['tag'],'attributes':{'class':[..._0x12e725,_0x111ce9['attributes']['class']?_0x111ce9['attributes']['class']:''],'style':'width:\x20'+_0x111ce9['attributes']['width']+';\x20height:\x20'+_0x111ce9['attributes']['height']+';'+_0x1d994f}};});}}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(_0x3c43d7,_0x506279,_0x2f90b6,_0x2f9203){return new Array(_0x3c43d7)['fill'](null)['map'](()=>({'tag':'div','attributes':{'width':_0x506279,'height':_0x2f90b6,'align':_0x2f9203}}));}class Cn extends Tt(){['queue']=[];['isProcessing']=!0x1;['_abortController'];async['enqueue'](_0x4609d5){const _0x4c6fa5=this['createTask'](_0x4609d5);return this['queue']['push'](_0x4c6fa5),this['_processQueue'](),_0x4c6fa5['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(_0x2d030c=>{this['once']('_queueEmpty',()=>{_0x2d030c();});}):Promise['resolve']();}async['_processQueue'](){if(!this['isProcessing']){this['_abortController']=new AbortController(),this['isProcessing']=!0x0;try{for(;this['queue']['length']&&this['isProcessing'];){const _0x2d8bcc=this['queue']['shift']();try{await _0x2d8bcc['callback'](this['_abortController']['signal']),_0x2d8bcc['resolve']();}catch(_0x10e238){_0x2d8bcc['reject'](_0x10e238);}}}finally{this['isProcessing']=!0x1,this['_abortController']=void 0x0;}this['fire']('_queueEmpty');}}['createTask'](_0xfdff4c){let _0x29cffe,_0x96f710;const _0x97d5cb=new Promise((_0x47e9a6,_0x15bc72)=>{_0x29cffe=_0x47e9a6,_0x96f710=_0x15bc72;});return{'callback':_0xfdff4c,'resolve':_0x29cffe,'reject':_0x96f710,'completePromise':_0x97d5cb};}}class wn extends an{constructor(_0x3319c3){super(_0x3319c3),this['extendTemplate']({'attributes':{'class':['ck-ai-notification','warning'===_0x3319c3['level']?'ck-ai-notification_warning':'ck-ai-notification_error']}});}['render'](){super['render'](),this['setContent'](this['options']['initialContent']),this['markAsDone']();}['setContent'](_0xd0abfb){this['element']['innerHTML']=_0xd0abfb;}}const fn=['applySuggestion','insertSuggestion'];class bn extends vt{['_applyChangesButton'];['_insertSuggestionsButton'];['children'];constructor(_0x18ab26,_0x430309=[...fn],_0x3e0a32){super(_0x18ab26);const _0x4081ad=this['bindTemplate'],_0x388a09=Boolean(_0x3e0a32);if(this['set']('isEnabled',!_0x388a09),this['set']('isVisible',!0x1),this['set']('isTrackChangesOn',!0x1),this['children']=this['createCollection'](),_0x388a09){const _0x144571=new Nt(_0x18ab26);_0x144571['set']({'label':hs(_0x18ab26,'AI_SUGGESTION_DISABLED_TOOLTIP_MESSAGE'),'tooltip':!0x0,'withText':!0x1,'icon':_0x2f24b6}),_0x144571['extendTemplate']({'attributes':{'data-cke-tooltip-class':'ck-ai-suggestion-content-part-disabled-actions-tooltip'}});const _0x3ae109=new vt(_0x18ab26);_0x3ae109['setTemplate']({'tag':'div','attributes':{'class':'ck-ai-chat__feed__suggestion__actions__info'},'children':[{'tag':'p','children':[hs(_0x18ab26,'AI_SUGGESTION_DISABLED_FEED_MESSAGE'),_0x144571]}]}),this['children']['add'](_0x3ae109);}else this['_applyChangesButton']=new Nt(_0x18ab26),this['_applyChangesButton']['set']({'label':hs(_0x18ab26,'AI_CHAT_SUGGESTION_ACTION_APPLY_ALL'),'withText':!0x0,'type':'button','isVisible':_0x430309['includes']('applySuggestion'),'class':cs}),this['_insertSuggestionsButton']=new Nt(_0x18ab26),this['_insertSuggestionsButton']['set']({'label':hs(_0x18ab26,'AI_CHAT_SUGGESTION_ACTION_SUGGEST_ALL'),'withText':!0x0,'type':'button','isVisible':_0x430309['includes']('insertSuggestion'),'class':ls}),this['_insertSuggestionsButton']['on']('execute',()=>{this['fire']('insertSuggestion');}),this['_applyChangesButton']['on']('execute',()=>{this['fire']('applySuggestion');}),[this['_applyChangesButton'],this['_insertSuggestionsButton']]['forEach'](_0x32272c=>{_0x32272c['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',_0x4081ad['if']('isVisible','ck-hidden',_0x59de3a=>!_0x59de3a)]},'children':this['children']}),this['on']('change:isTrackChangesOn',()=>{this['_applyChangesButton']&&(this['_applyChangesButton']['isVisible']=!this['isTrackChangesOn']);});}['updateVisibility'](_0x27f538){this['isVisible']=_0x27f538;}['_switchButtonLabelsPlurality'](_0x24b004){this['_applyChangesButton']&&this['_insertSuggestionsButton']&&(_0x24b004?(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(_0x3f43bd,_0x4edf70){super(_0x3f43bd),this['bodyCollection']=_0x4edf70,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',_0x39e023=>!_0x39e023)]},'children':this['children']});const _0x5d98b8=new vt(this['locale']),_0x2ca9a2=new xt();_0x2ca9a2['content']=_0x3e498b,_0x5d98b8['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-web-sources__header']},'children':[_0x2ca9a2,{'tag':'span','children':[{'text':hs(this['locale'],'AI_CHAT_SOURCES_HEADER')}]}]}),this['children']['add'](_0x5d98b8),this['_setupBalloonPanel'](_0x3f43bd);}['addSource'](_0x2252df){this['children']['add'](new Rn(this['locale'],_0x2252df,this['balloonPanelView']));}['_setupBalloonPanel'](_0x18e303){this['balloonPanelView']=new Xt(_0x18e303),this['balloonPanelView']['extendTemplate']({'attributes':{'class':['ck-ai-web-source__tooltip-balloon']}}),this['bodyCollection']['add'](this['balloonPanelView']);}}class Rn extends Nt{['balloonPanelView'];['source'];constructor(_0x56b40a,_0x351d20,_0x55f9ef){super(_0x56b40a),this['source']=_0x351d20,this['balloonPanelView']=_0x55f9ef,this['set']({'label':_0x351d20['title'],'class':['ck\x20ck-ai-web-source'],'withText':!0x0});const _0x438228=this['bindTemplate'];if(this['extendTemplate']({'on':{'click':_0x438228['to'](()=>{window['open'](_0x351d20['url'],'_blank');}),'mouseenter':_0x438228['to'](()=>{this['_showTooltip']();}),'mouseleave':_0x438228['to'](()=>{this['_hideTooltip']();})}}),_0x351d20['favicon']){const _0x1b29dc=new vt(_0x56b40a);_0x1b29dc['setTemplate']({'tag':'img','attributes':{'src':_0x351d20['favicon']||_0x3e498b,'alt':_0x351d20['title'],'class':['ck-ai-web-source__image']}}),this['children']['add'](_0x1b29dc);}else this['set']('icon',_0x3e498b);}['_createTooltipContentView'](_0x107eaf,_0x4e1797){const _0x30947b=new vt(_0x107eaf),_0x4ff054=[];let _0x519f27;_0x4e1797?.['favicon']?(_0x519f27=new vt(_0x107eaf),_0x519f27['setTemplate']({'tag':'img','attributes':{'src':_0x4e1797['favicon'],'alt':_0x4e1797['title'],'class':['ck-ai-web-source__tooltip-image']}})):(_0x519f27=new xt(),_0x519f27['content']=_0x3e498b,_0x519f27['extendTemplate']({'attributes':{'alt':_0x4e1797['title'],'class':['ck-ai-web-source__tooltip-image']}})),_0x4ff054['push'](_0x519f27);const _0x914c8=new vt(_0x107eaf);_0x914c8['setTemplate']({'tag':'a','attributes':{'class':['ck-ai-web-source__tooltip-url'],'href':_0x4e1797['url']},'children':[{'text':new URL(_0x4e1797['url'])?.['hostname']}]}),_0x4ff054['push'](_0x914c8);const _0x124066=new vt(_0x107eaf);_0x124066['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-web-source__tooltip-row']},'children':_0x4ff054});const _0x392be7=new vt(_0x107eaf);return _0x392be7['setTemplate']({'tag':'span','attributes':{'class':['ck-ai-web-source__tooltip-row','ck-ai-web-source__tooltip-title']},'children':[{'text':_0x4e1797['title']['length']>0x190?_0x4e1797['title']['substring'](0x0,0x190)+'...':_0x4e1797['title']}]}),_0x30947b['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-web-source__tooltip']},'children':[_0x124066,_0x392be7]}),_0x30947b;}['_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 _0x368ba4=this['_createTooltipContentView'](this['locale'],this['source']);this['balloonPanelView']['content']['add'](_0x368ba4);}}class On extends vt{['_actionsView'];['_sourcesView'];['_children'];['_skeletonView'];['_showSkeletonDebounced']=_0x2cdc06(()=>{this['_skeletonView']['isVisible']=!0x0,this['_skeletonShownAt']=Date['now']();},0x3e8);['_skeletonShownAt']=null;['_areActionsDisabled'];['_showUnchangedParts'];['_updateContentPartsPromiseQueue'];['_emptyPartsWarningView'];['_availableActions'];['_cachedContentParts']=[];constructor(_0xdfecbd,_0x300b38){super(_0xdfecbd);const {areActionsDisabled:_0x3d665c,showUnchangedParts:_0xfbb762,availableActions:_0x518537}=_0x300b38;this['_areActionsDisabled']=_0x3d665c,this['_showUnchangedParts']=_0xfbb762,this['_availableActions']=_0x518537,this['set']('hasPendingParts',!0x1),this['set']('isTrackChangesOn',!0x1),this['_children']=this['createCollection'](),this['_skeletonView']=new pn(_0xdfecbd,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(_0xdfecbd,'AI_SUGGESTION_EMPTY_PART_WARNING'),'level':'warning'}),this['_emptyPartsWarningView']['isVisible']=!0x1,this['_actionsView']=new bn(_0xdfecbd,_0x300b38['availableActions'],this['_areActionsDisabled']),this['_actionsView']['bind']('isTrackChangesOn')['to'](this),this['_sourcesView']=new Sn(this['locale'],_0x300b38['bodyCollection']),_0x300b38['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'](_0x11914d=>_0x11914d instanceof En);}async['updateContentParts']({parts:_0x2ea5a4,abortSignal:_0x26f285,skipLoadingEffects:_0xd46735}){this['_cachedContentParts']['length']?_0x2ea5a4['forEach'](_0x36df0c=>{const _0x5ceb9f=this['_cachedContentParts']['findIndex'](_0x332809=>_0x332809['index']==_0x36df0c['index']);-0x1===_0x5ceb9f?this['_cachedContentParts']['push'](_0x36df0c):this['_cachedContentParts'][_0x5ceb9f]=_0x36df0c;}):this['_cachedContentParts']=_0x2ea5a4;const _0x203a2e=this['_showUnchangedParts']?_0x2ea5a4:_0x2ea5a4['filter'](_0x15296d=>_0x15296d['hasChanges']);this['_actionsView']['_switchButtonLabelsPlurality'](_0x203a2e['length']>0x1),_0xd46735&&(this['_showSkeletonDebounced']['cancel'](),this['_skeletonView']['isVisible']=!0x1);for(const _0x498f71 of _0x203a2e)this['_updateContentPartsPromiseQueue']['enqueue'](async _0x1a392a=>{let _0xa32191=this['getPartView'](_0x498f71['index']);if(!_0xa32191){if(_0xa32191=new En(this['locale'],{'part':_0x498f71,'uiIndex':this['_contentPartViews']['length']+0x1,'areActionsDisabled':this['_areActionsDisabled'],'availableActions':this['_availableActions']}),_0xa32191['delegate'](...Zs)['to'](this),!_0xd46735&&(this['_showSkeletonDebounced']['cancel'](),await this['_awaitMinimumSkeletonDisplayTime'](_0x1a392a),_0x1a392a['aborted']))return;this['_skeletonView']['isVisible']=!0x1,this['_children']['add'](_0xa32191,this['_children']['length']-0x1),this['hasPendingParts']=!0x0,_0xd46735||this['_showSkeletonDebounced']();}await _0xa32191['updateContent']({'part':_0x498f71,'showUnchangedParts':this['_showUnchangedParts'],'abortSignal':_0x1a392a}),_0xa32191['markAsDone']();});return _0x26f285?.['addEventListener']('abort',()=>{this['_updateContentPartsPromiseQueue']['abort'](),this['_showSkeletonDebounced']['cancel'](),this['_skeletonView']['isVisible']=!0x1;}),this['_updateContentPartsPromiseQueue']['queueEmptyPromise'];}['updatePartState'](_0x1695af,_0x5e8a93){const _0xcb2a5a=this['getPartView'](_0x1695af);_0xcb2a5a&&(_0xcb2a5a['state']=_0x5e8a93),this['hasPendingParts']='pending'==_0x5e8a93||this['_contentPartViews']['some'](_0x293a30=>'pending'==_0x293a30['state']);}['setPartActive'](_0x5648ae,_0x2066d4){if(!0x1===_0x5648ae){for(const _0x316141 of this['_contentPartViews'])_0x316141['isActive']=!0x1;}else{const _0x4e2c1c=this['getPartView'](_0x5648ae);_0x4e2c1c&&(_0x4e2c1c['isActive']=_0x2066d4);}}['updateSources'](_0x53e877){_0x53e877['forEach'](_0x1fb1b0=>this['_sourcesView']['addSource'](_0x1fb1b0)),this['_sourcesView']['isVisible']=!0x0;}['getPartView'](_0x1f8fb1){return this['_contentPartViews']['find'](_0x3abe91=>_0x3abe91['partDefinition']['index']==_0x1f8fb1)??null;}['markAsDone'](){if(!this['_showUnchangedParts']){const _0x4ea185=!this['_cachedContentParts']['find'](({hasChanges:_0x1ae0ac})=>_0x1ae0ac),_0x188ed6=!!this['_cachedContentParts']['find'](({hasChanges:_0xea9823})=>!_0xea9823);this['_emptyPartsWarningView']['isVisible']=0x0==this['_contentPartViews']['length']||_0x188ed6,_0x4ea185?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'](_0x4a99f6=>_0x4a99f6['markAsDone']()),this['_skeletonView']['isVisible']=!0x1,this['_showSkeletonDebounced']['cancel'](),this['_actionsView']['updateVisibility'](this['hasNonEmptyParts']);}async['_awaitMinimumSkeletonDisplayTime'](_0x3aa39d){if(!this['_skeletonView']['isVisible']||null===this['_skeletonShownAt'])return;const _0x258d7b=0x3e8-(Date['now']()-this['_skeletonShownAt']);if(this['_skeletonShownAt']=null,_0x258d7b>0x0){const {promise:_0x41f9dd,abortController:_0x52fa91}=en(_0x258d7b);_0x3aa39d?.['addEventListener']('abort',()=>_0x52fa91['abort']()),await _0x41f9dd['catch'](()=>{});}}get['hasNonEmptyParts'](){return this['_contentPartViews']['filter'](_0xf7438=>_0xf7438['partDefinition']['hasChanges'])['length']>0x0;}}class kn extends vt{['bodyView'];['children'];['headerView'];constructor(_0x184cab,_0x1c2577,_0xd64d9c){super(_0x184cab);const {showDiff:_0x296183,areActionsDisabled:_0x538318,showUnchangedParts:_0x432c58,availableActions:_0x2c54a8}=_0x1c2577;this['set']('isTrackChangesOn',!0x1),this['set']('areChangesVisible',!0x1),this['children']=this['createCollection'](),this['headerView']=new hn(_0x184cab,{'showDiff':_0x296183}),this['headerView']['on']('toggleShowChanges',(_0x4004b7,_0x5adb24)=>{this['areChangesVisible']=_0x5adb24['isOn'],this['fire']('toggleSuggestionDisplayMode',{'showDiff':_0x5adb24['isOn']});}),this['children']['add'](this['headerView']),this['bodyView']=new On(_0x184cab,{'areActionsDisabled':_0x538318,'showUnchangedParts':!!_0x432c58,'availableActions':_0x2c54a8,'bodyCollection':_0xd64d9c}),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'](_0x20c424){await this['bodyView']['updateContentParts'](_0x20c424);}['updateSources'](_0x5612aa){this['bodyView']['updateSources'](_0x5612aa);}['markAsDone'](){this['bodyView']['markAsDone'](),this['headerView']&&(this['headerView']['isShowChangesToggleVisible']=this['bodyView']['hasNonEmptyParts']);}}class Nn extends an{['containerView'];constructor(_0x31fb20,_0x32b13a,_0x2cd446){super(_0x32b13a),this['set']('isTrackChangesOn',!0x1),this['containerView']=new kn(_0x31fb20,{'showDiff':_0x32b13a['showDiff'],'areActionsDisabled':_0x32b13a['areActionsDisabled'],'availableActions':_0x32b13a['availableActions']},_0x2cd446),this['containerView']['on']('toggleSuggestionDisplayMode',(_0x7ad984,_0x39cceb)=>{this['fire']('toggleSuggestionDisplayMode',{'replyId':this['options']['id'],'showDiff':_0x39cceb['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',(_0x512edc,{index:_0x416e93})=>{this['fire']('showChangeInText',{'replyId':this['options']['id'],'partIndex':_0x416e93});}),this['containerView']['on']('applySuggestion',(_0x297a27,{index:_0x549101}={})=>{this['fire']('applySuggestion',{'replyId':this['options']['id'],'partIndex':_0x549101});}),this['containerView']['on']('insertSuggestion',(_0x1613e6,{index:_0x5531dd}={})=>{this['fire']('insertSuggestion',{'replyId':this['options']['id'],'partIndex':_0x5531dd});}),this['containerView']['on']('rejectSuggestion',(_0x34a06d,{index:_0x571f79})=>{this['fire']('rejectSuggestion',{'replyId':this['options']['id'],'partIndex':_0x571f79});}),this['containerView']['on']('mouseOverSuggestion',(_0x340d0e,{index:_0x4661e4})=>{this['fire']('mouseOverSuggestion',{'replyId':this['options']['id'],'partIndex':_0x4661e4});}),this['containerView']['on']('mouseLeaveSuggestion',(_0x52aa17,{index:_0x5c79a8})=>{this['fire']('mouseLeaveSuggestion',{'replyId':this['options']['id'],'partIndex':_0x5c79a8});}),this['children']['addMany']([this['containerView']]),this['extendTemplate']({'attributes':{'class':['ck-ai-chat__feed__ai-suggestion']}});}async['updateContent'](_0x2136e3){await this['containerView']['updateContent'](_0x2136e3);}['updatePartState'](_0x436d29,_0x281218){this['containerView']['bodyView']['updatePartState'](_0x436d29,_0x281218);}['setPartActive'](_0x2e8624,_0x4c4b91){!0x1===_0x2e8624?this['containerView']['bodyView']['setPartActive'](!0x1):this['containerView']['bodyView']['setPartActive'](_0x2e8624,_0x4c4b91);}['updateSources'](_0x2bf9a1){this['containerView']['updateSources'](_0x2bf9a1);}['getPartView'](_0x536824){return this['containerView']['bodyView']['getPartView'](_0x536824);}['markAsDone'](){super['markAsDone'](),this['containerView']['markAsDone']();}}class vn extends an{['replyContainer'];['_bodyCollection'];constructor(_0x369149,_0x4f6b75,_0x29aad2){super(_0x4f6b75),this['_bodyCollection']=_0x29aad2,this['locale']=_0x369149,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:_0x56ac1d,renderingStrategy:_0x4f4c04,abortSignal:_0xd34fb5}){'streaming'===_0x4f4c04?await this['streamIntoElement'](_0x56ac1d,this['replyContainer']['element'],_0xd34fb5):this['replyContainer']['element']['innerHTML']=ti(_0x56ac1d);}['updateSources'](_0x181d35){const _0x2debad=new Sn(this['locale'],this['_bodyCollection']);_0x2debad['children']['addMany'](_0x181d35['map'](_0x3ca27e=>new Rn(this['locale'],_0x3ca27e,_0x2debad['balloonPanelView']))),_0x2debad['isVisible']=!0x0,this['children']['add'](_0x2debad);}}class yn extends yt{constructor(_0x2744e1=void 0x0){super();const _0xcfe922=_0x2744e1?'ck-ai-spinner_'+_0x2744e1:'';this['extendTemplate']({'tag':'span','attributes':{'class':['ck-ai-spinner',_0xcfe922]}});}}const xn={'file':_0x30bb37,'document':_0xded5c0,'web-resource':_0x4b251d,'text':_0x30bb37,'selection':_0x2028d1,'mcp-tool-context':_0xded5c0},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(_0x294c48,_0x316a0e,_0xdfbac0,_0x446a6c,_0x1da999=!0x1){super(_0x294c48),this['_isAnimationOnEnterEnabled']=_0x446a6c,this['_initializeProperties'](_0x316a0e,_0xdfbac0,_0x1da999),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'](_0xca93,_0x3328ce,_0x52c8e0){this['set']('label',_0xca93['label']),this['set']('tooltip',!0x0),this['set']('itemType',_0xca93['type']),this['set']('id',_0xca93['uiId']),this['set']('readonly',_0x3328ce),this['set']('isLoading',_0x52c8e0);}['_setupTemplate'](){const _0x25d176=this['_createIconView'](),_0x30daa9=this['_createRemoveButton'](),_0x214aa4=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':this['_createTemplateAttributes'](_0x214aa4),'children':this['_createTemplateChildren'](_0x25d176,_0x30daa9,_0x214aa4)});}['_createTemplateAttributes'](_0x8cc128){return{'class':[Ln,_0x8cc128['if']('itemType',Pn,_0xc06cf9=>'document'==_0xc06cf9),_0x8cc128['if']('itemType',Dn,_0xa33005=>'selection'==_0xa33005)],'data-cke-tooltip-text':_0x8cc128['to']('label',Gn),'data-cke-tooltip-position':Vn,'data-cke-tooltip-class':Un};}['_createTemplateChildren'](_0xb1aba1,_0xa62a8d,_0x2cf548){const _0x28ebf0=this['_createLabelElement'](_0x2cf548),_0x4400f1=this['_createLoaderIcon']();return this['readonly']?[_0xb1aba1,_0x28ebf0]:[_0xb1aba1,_0x4400f1,_0x28ebf0,_0xa62a8d];}['_createLabelElement'](_0x292ba2){return{'tag':'span','attributes':{'class':Hn},'children':[{'text':_0x292ba2['to']('label')}]};}['_createRemoveButton'](){const _0x3ca547=new Nt(this['locale']);return _0x3ca547['set']({'label':hs(this['locale'],'AI_CHAT_CONTEXT_REMOVE_FROM_CONTEXT'),'icon':_0x48af93}),this['_setupRemoveButtonEvent'](_0x3ca547),_0x3ca547;}['_setupRemoveButtonEvent'](_0x3e8fa4){_0x3e8fa4['on']('execute',()=>{this['fire']('removeContextItemChip',this['id']);});}['_createIconView'](){const _0x3c9955=this['bindTemplate'],_0x437938=new xt();return _0x437938['content']=xn[this['itemType']],_0x437938['extendTemplate']({'attributes':{'class':[Mn,_0x3c9955['if']('isLoading','ck-hidden',_0xfb48ae=>_0xfb48ae)]}}),_0x437938;}['_handleAnimationEndOnce'](_0x256eea,_0x280794){if(!_0x256eea)return;const _0x47c556=()=>{_0x280794(),_0x256eea['removeEventListener']('animationend',_0x47c556),_0x256eea['removeEventListener']('webkitAnimationEnd',_0x47c556);};_0x256eea['addEventListener']('animationend',_0x47c556),_0x256eea['addEventListener']('webkitAnimationEnd',_0x47c556);}['_createLoaderIcon'](){const _0xd247b3=new yn('small');return _0xd247b3['bind']('isVisible')['to'](this,'isLoading',_0x2c21cf=>_0x2c21cf),_0xd247b3;}}function Gn(_0x4c1a3d){if(!_0x4c1a3d)return _0x4c1a3d;if(_0x4c1a3d['length']<=0x78)return _0x4c1a3d;const _0x407923=_0x4c1a3d['slice'](0x0,0x78),_0x25fa48=_0x407923['lastIndexOf']('\x20');return(_0x25fa48>0x0?_0x407923['slice'](0x0,_0x25fa48):_0x407923)+'…';}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(_0xd8d823,_0x19fa2f,_0x5d0e1a,_0x2c653f,_0x2de9d8){this['_locale']=_0xd8d823,this['_visibleChips']=_0x19fa2f,this['_config']={...Fn,..._0x5d0e1a,'cssClasses':{'controlsButton':'','calculationContainer':'ck-calculation-container',..._0x5d0e1a['cssClasses']}},this['_overflowChips']=new dt(),this['_bodyCollection']=_0x2c653f,this['_parentView']=_0x2de9d8||null;}['setContainerElement'](_0xd91df6){this['_intersectionObserver']&&(this['_intersectionObserver']['disconnect'](),this['_intersectionObserver']=null),this['_containerElement']=_0xd91df6,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 _0x45ceca=[...this['_visibleChips'],...this['_overflowChips']],_0x2ad896=this['_createCalculationContainer'](),_0x5bc469=this['_calculateOverflowInContainer'](_0x2ad896,_0x45ceca),_0x5e06d4=_0x2ad896['_ancestorsToRestore'];_0x5e06d4&&this['_restoreAncestorVisibility'](_0x5e06d4),_0x2ad896['remove'](),this['_applyOverflowResults'](_0x45ceca,_0x5bc469);}['_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 _0x3a3453=new Nt(this['_locale']);_0x3a3453['set']({'label':'','withText':!0x0,'isToggleable':!0x0});const _0x59293c=[this['_config']['cssClasses']['showMoreButton']];return this['_config']['cssClasses']['controlsButton']&&_0x59293c['push'](this['_config']['cssClasses']['controlsButton']),_0x3a3453['extendTemplate']({'attributes':{'class':_0x59293c}}),_0x3a3453;}['_createShowMoreBalloonPanelView'](){const _0x32d376=new Xt(this['_locale']);return _0x32d376['extendTemplate']({'attributes':{'class':this['_config']['cssClasses']['showMoreBalloon']}}),this['_bodyCollection']['add'](_0x32d376),_0x32d376;}['_updateBalloonContent'](){if(this['_showMoreBalloonPanelView']&&(this['_showMoreBalloonPanelView']['content']['clear'](),this['_overflowChips']['length']>0x0)){this['_overflowChips']['forEach'](_0x192418=>{_0x192418['disableAnimationOnEnter']();});const _0x1d92aa=new vt(this['_locale']);_0x1d92aa['setTemplate']({'tag':'div','attributes':{'class':this['_config']['cssClasses']['overflowContainer']},'children':this['_overflowChips']}),this['_showMoreBalloonPanelView']['content']['add'](_0x1d92aa);}}['_handleShowMoreButtonClick'](){this['_showMoreButtonView']['isOn']?this['hideBalloonPanel']():this['showBalloonPanel']();}['_updateShowMoreButtonVisibility'](){const _0x452d1d=this['_overflowChips']['length']>0x0;this['_showMoreButtonView']?.['element']&&(this['_showMoreButtonView']['element']['style']['display']=_0x452d1d?'':'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'](_0x2c3710){const _0x1f00a1=this['_containerElement']?.['tagName']['toLowerCase']()||'div',_0x218c4d=this['_containerElement']?.['classList'];if(_0x218c4d){const _0x4a2caa=_0x218c4d[0x0]||'',_0x4f1217=_0x2c3710['querySelector']('.'+_0x4a2caa),_0x292a2b=_0x2c3710['querySelector'](_0x1f00a1);return _0x4f1217||_0x292a2b||_0x2c3710;}return _0x2c3710['querySelector'](_0x1f00a1)||_0x2c3710;}['_calculateContainerWidth'](){const _0x3a9907=this['_parentView']?.['element']||this['_containerElement'];if(!_0x3a9907)return Kn;const _0xfe799b=window['getComputedStyle'](_0x3a9907)['width'];if('auto'===_0xfe799b||'0px'===_0xfe799b||!_0xfe799b){const _0x82586a=_0x3a9907['parentElement'];if(_0x82586a){const _0x24025f=window['getComputedStyle'](_0x82586a);return'auto'!==_0x24025f['width']?_0x24025f['width']:Kn;}return Kn;}return _0xfe799b;}['_applyCalculationStyles'](_0x391dfe,_0x3f3bb1){this['_config']['cssClasses']['calculationContainer']&&_0x391dfe['classList']['add'](this['_config']['cssClasses']['calculationContainer']),_0x391dfe['style']['width']=_0x3f3bb1,_0x391dfe['style']['position']='absolute',_0x391dfe['style']['top']='-9999px',_0x391dfe['style']['left']='-9999px',_0x391dfe['style']['opacity']='0',_0x391dfe['style']['pointerEvents']='none',_0x391dfe['style']['zIndex']='-1',_0x391dfe['style']['visibility']='visible\x20!important',_0x391dfe['style']['display']='block\x20!important',_0x391dfe['style']['boxSizing']='border-box';}['_restoreAncestorVisibility'](_0xadd5d6){_0xadd5d6['forEach'](({element:_0x117249,originalDisplay:_0x56d911,originalVisibility:_0x33e599})=>{_0x117249['style']['display']=_0x56d911,_0x117249['style']['visibility']=_0x33e599;});}['_makeAncestorsVisible'](_0x11efb3){const _0x24e8ac=[];let _0x408526=_0x11efb3;for(;_0x408526&&_0x408526!==document['body'];){const _0x20759e=window['getComputedStyle'](_0x408526);'none'!==_0x20759e['display']&&'hidden'!==_0x20759e['visibility']||(_0x24e8ac['push']({'element':_0x408526,'originalDisplay':_0x408526['style']['display'],'originalVisibility':_0x408526['style']['visibility']}),_0x408526['style']['display']='block',_0x408526['style']['visibility']='visible'),_0x408526=_0x408526['parentElement'];}return _0x24e8ac;}['_createContainerElements'](){let _0x502d71,_0x3540c2;return this['_parentView']?.['element']?(_0x502d71=this['_parentView']['element']['cloneNode'](!0x0),_0x3540c2=this['_findTargetContainer'](_0x502d71)):(_0x502d71=document['createElement']('div'),_0x3540c2=_0x502d71),{'calculationContainer':_0x502d71,'targetContainer':_0x3540c2};}['_createCalculationContainer'](){const {calculationContainer:_0x27ec3e,targetContainer:_0x402a2a}=this['_createContainerElements'](),_0x1f1219=this['_calculateContainerWidth']();this['_applyCalculationStyles'](_0x27ec3e,_0x1f1219);const _0x2f447a=this['_parentView']?.['element']||this['_containerElement'],_0x78c4e1=_0x2f447a?.['parentElement'];_0x78c4e1?_0x78c4e1['appendChild'](_0x27ec3e):document['body']['appendChild'](_0x27ec3e),_0x27ec3e['_targetContainer']=_0x402a2a;const _0x1d3b51=this['_makeAncestorsVisible'](_0x78c4e1||null);return _0x27ec3e['offsetWidth'],_0x27ec3e['_ancestorsToRestore']=_0x1d3b51,_0x27ec3e;}['_calculateOverflowInContainer'](_0x27b822,_0x50f789){const _0x47d3b1=_0x27b822['_targetContainer']||_0x27b822,_0x2f28d7=[],{rowCount:_0x4181cb}=this['_renderChipsAndCountRows'](_0x47d3b1,_0x50f789);if(_0x4181cb<=this['_config']['maxVisibleRows'])return _0x2f28d7;const _0x22aebf=_0x50f789['slice']();for(;_0x22aebf['length']>0x0;){if(this['_testButtonFit'](_0x27b822,_0x47d3b1,_0x22aebf)){const _0x178ab4=_0x50f789['filter'](_0x40e1a4=>!_0x22aebf['includes'](_0x40e1a4));_0x2f28d7['push'](..._0x178ab4);break;}if(!_0x22aebf['pop']())break;}return _0x2f28d7;}['_renderChipsAndCountRows'](_0x57242b,_0x5e5ba3){_0x57242b['innerHTML']='',_0x5e5ba3['forEach'](_0xc120e9=>{if(_0xc120e9['element']){const _0x522deb=_0xc120e9['element']['cloneNode'](!0x0);_0x57242b['appendChild'](_0x522deb);}}),_0x57242b['offsetWidth'];const _0x4d9ef5=_0x57242b['children'],_0x1e1780=[];return Array['from'](_0x4d9ef5)['forEach'](_0x3e5e60=>{const _0x394927=_0x3e5e60['getBoundingClientRect']()['top'];_0x1e1780['some'](_0x2f6de0=>Math['abs'](_0x2f6de0-_0x394927)<this['_config']['rowDetectionTolerance'])||_0x1e1780['push'](_0x394927);}),{'rowCount':_0x1e1780['length']};}['_createMockButton'](){const _0x1a8acf=document['createElement']('button');return _0x1a8acf['className']=this['_config']['cssClasses']['showMoreButton'],this['_config']['cssClasses']['controlsButton']&&_0x1a8acf['classList']['add'](this['_config']['cssClasses']['controlsButton']),_0x1a8acf['textContent']='+\x201',_0x1a8acf;}['_testButtonFit'](_0x1d2950,_0x50c202,_0xa8a1be){this['_renderChipsAndCountRows'](_0x50c202,_0xa8a1be);const _0x190da8=this['_createMockButton']();_0x1d2950['appendChild'](_0x190da8),_0x1d2950['offsetWidth'];const _0x343fb8=[..._0x50c202['children'],_0x190da8],_0x59e54c=[];_0x343fb8['forEach'](_0x3c2fdc=>{const _0x3b9cfd=_0x3c2fdc['getBoundingClientRect']()['top'];_0x59e54c['some'](_0x40dfce=>Math['abs'](_0x40dfce-_0x3b9cfd)<this['_config']['rowDetectionTolerance'])||_0x59e54c['push'](_0x3b9cfd);});const _0x2f8d63=_0x59e54c['length'];return _0x190da8['remove'](),_0x2f8d63<=this['_config']['maxVisibleRows'];}['_distributeChips'](_0x113e60,_0x240eb8){this['_visibleChips']['clear'](),this['_overflowChips']['clear'](),_0x113e60['forEach'](_0x141132=>{_0x240eb8['includes'](_0x141132)?this['_overflowChips']['add'](_0x141132):this['_visibleChips']['add'](_0x141132);});}['_updateOverflowUI'](_0x4573bc){if(_0x4573bc>0x0&&!this['_showMoreButtonView']&&this['_createShowMoreButton'](),_0x4573bc>0x0&&this['_showMoreButtonView']){const _0x524a4d=''+this['_config']['showMoreLabelPrefix']+(_0x4573bc<0x63?_0x4573bc:'99');this['_showMoreButtonView']['label']=_0x524a4d;}this['_updateBalloonContent'](),this['_updateShowMoreButtonVisibility'](),this['_repinBalloonPanel']();}['_applyOverflowResults'](_0x3668a3,_0xed7f18){this['_distributeChips'](_0x3668a3,_0xed7f18),this['_updateOverflowUI'](_0xed7f18['length']);}['_setupVisibilityObserver'](){this['_containerElement']&&'undefined'!=typeof IntersectionObserver&&(this['_intersectionObserver']=new IntersectionObserver(_0x283737=>{_0x283737[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 _0x2109fc=this['_containerElement']['getBoundingClientRect']();if(0x0===_0x2109fc['width']||0x0===_0x2109fc['height'])return!0x1;const _0xd35698=window['innerHeight']||document['documentElement']['clientHeight'],_0x58bd6f=window['innerWidth']||document['documentElement']['clientWidth'],_0x355bd5=0xc8;return _0x2109fc['bottom']>=-0xc8&&_0x2109fc['top']<=_0xd35698+_0x355bd5&&_0x2109fc['right']>=-0xc8&&_0x2109fc['left']<=_0x58bd6f+_0x355bd5;}}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(_0x14a00e,_0x4d6fac,_0x30b8bd){super(_0x14a00e),this['_bodyCollection']=_0x30b8bd,this['_createContextChips'](_0x4d6fac);const _0x1695de={'cssClasses':{'showMoreButton':Xn+'\x20'+us,'showMoreBalloon':zn,'overflowContainer':qn,'controlsButton':Qn}};this['_overflowManager']=new Wn(_0x14a00e,this['_contextChips'],_0x1695de,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 _0x36bbc4=this['element']['querySelector']('.'+$n);_0x36bbc4&&(this['_overflowManager']['setContainerElement'](_0x36bbc4),this['_overflowManager']['reorganizeChips']());}['destroy'](){super['destroy'](),this['_overflowManager']['destroy']();}['_createContextChips'](_0x38fc7b){for(const _0x4219dc of _0x38fc7b){const _0x596dcd=new Bn(this['locale'],_0x4219dc,!0x0,!0x1);this['_contextChips']['add'](_0x596dcd);}}}class Jn extends an{['_contextChipsView']=null;['_locale'];['_bodyCollection'];['_messageContentView'];constructor(_0x3f3d4f,_0x78ce74,_0x13e390){super(_0x78ce74),this['_locale']=_0x3f3d4f,this['_bodyCollection']=_0x13e390,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'](_0x3c16a3=>!_0x3c16a3['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(_0x519e06,_0x5a3dcd){super(_0x5a3dcd);const {isWebSearchEnabled:_0x46c8bf,isReasoningEnabled:_0x428a45}=_0x5a3dcd['capabilities'],_0x521547=[];let _0x5d06e4='';_0x46c8bf&&_0x428a45?(_0x5d06e4=hs(_0x519e06,'AI_CHAT_FEED_REPLY_ITEM_USED_WEB_SEARCH_REASONING'),_0x521547['push'](tr(_0x3e498b)),_0x521547['push'](tr(_0x38dc5f))):_0x46c8bf?(_0x5d06e4=hs(_0x519e06,'AI_CHAT_FEED_REPLY_ITEM_USED_WEB_SEARCH'),_0x521547['push'](tr(_0x3e498b))):_0x428a45&&(_0x5d06e4=hs(_0x519e06,'AI_CHAT_FEED_REPLY_ITEM_USED_REASONING'),_0x521547['push'](tr(_0x38dc5f))),this['extendTemplate']({'attributes':{'class':['ck-ai-chat__feed__interaction-header',_0x5d06e4?'':'ck-hidden']}});const _0x1918b6=new vt();_0x1918b6['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed__interaction-header__capabilities']},'children':[..._0x521547,{'tag':'span','attributes':{'class':['ck-ai-chat__feed__interaction-header__capabilities__text']},'children':[_0x5d06e4]}]}),this['children']['add'](_0x1918b6),this['capabilities']=_0x5a3dcd['capabilities'];}}function tr(_0x1ca67f){const _0x417bb1=new xt();return _0x417bb1['content']=_0x1ca67f,_0x417bb1;}const er=['wheel','touchstart','pointerdown','keydown'],ir=['ArrowUp','ArrowDown','PageUp','PageDown','Home','End','\x20'];class sr{['element'];['animationFrameId'];['isRunning'];['abortController'];['isUserPaused'];['scrollBehavior'];constructor(_0x1c00d0){this['element']=_0x1c00d0,this['animationFrameId']=null,this['isRunning']=!0x1,this['abortController']=new AbortController(),this['isUserPaused']=!0x1,this['scrollBehavior']='smooth';for(const _0xbf2d53 of er){const _0x4296fd='keydown'!==_0xbf2d53;this['element']['addEventListener'](_0xbf2d53,this['_onUserEvent']['bind'](this),{'passive':_0x4296fd,'signal':this['abortController']['signal']});}}['start']({smooth:_0x223c3d=!0x0}={}){this['isRunning']||(this['isRunning']=!0x0,this['isUserPaused']=!0x1,this['scrollBehavior']=_0x223c3d?'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'](_0xd177f8){if(this['isRunning']){if('keydown'===_0xd177f8['type']){const _0x1ee943=_0xd177f8['key'];if(!ir['includes'](_0x1ee943))return;}_0xd177f8 instanceof WheelEvent?_0xd177f8['deltaY']<0x0?this['isUserPaused']=!0x0:this['isUserPaused']=!this['_isAtBottom']():this['isUserPaused']=!0x0;}}['_isAtBottom'](){const {scrollTop:_0x5cffee,scrollHeight:_0x21b2fe,clientHeight:_0x2249cd}=this['element'];return _0x21b2fe-_0x5cffee-_0x2249cd<=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(_0x2bc2c6){super(_0x2bc2c6),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(_0x160cac,_0x1206d5){super(_0x160cac),this['_bodyCollection']=_0x1206d5,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'](_0x35b08f,_0x4e3243){let _0x41a4c2;return'ai-reply'===_0x35b08f?_0x41a4c2=new vn(this['locale'],_0x4e3243,this['_bodyCollection']):'ai-suggestion-reply'===_0x35b08f?(_0x41a4c2=new Nn(this['locale'],_0x4e3243,this['_bodyCollection']),_0x41a4c2['bind']('isTrackChangesOn')['to'](this)):_0x41a4c2='user-message'===_0x35b08f?new Jn(this['locale'],_0x4e3243,this['_bodyCollection']):'interaction-header'===_0x35b08f?new Zn(this['locale'],_0x4e3243):'custom-element'===_0x35b08f?new nr(_0x4e3243):new wn(_0x4e3243),this['children']['add'](_0x41a4c2),_0x41a4c2;}async['updateReplyItem']({id:_0x2a74cf,parsedContent:_0x11958f,renderingStrategy:_0x2626f3,abortSignal:_0x239cd6}){const _0x306d20=this['getItemById'](_0x2a74cf);if(!(_0x306d20 instanceof vn))throw new at('ai-chat-feed-view-item-not-a-reply-item',null,{'itemView':_0x306d20,'id':_0x2a74cf,'parsedContent':_0x11958f});await _0x306d20['updateContent']({'parsedContent':_0x11958f,'renderingStrategy':_0x2626f3,'abortSignal':_0x239cd6});}async['updateWebSources'](_0x1e5a86,_0x2fa59f){const _0x24176b=this['getItemById'](_0x1e5a86);if(_0x24176b instanceof Nn)_0x24176b['updateSources'](_0x2fa59f);else{if(!(_0x24176b instanceof vn))throw new at('ai-chat-feed-view-item-not-a-suggestion-or-reply-item',null,{'itemView':_0x24176b,'id':_0x1e5a86,'sources':_0x2fa59f});_0x24176b['updateSources'](_0x2fa59f);}}async['updateSuggestionItem']({id:_0x3b1a9b,parts:_0x1f2bdc,abortSignal:_0x54a132,skipLoadingEffects:_0x4e36ea}){const _0x35846e=this['getItemById'](_0x3b1a9b);if(!(_0x35846e instanceof Nn))throw new at('ai-chat-feed-view-item-not-a-suggestion-item',null,{'itemView':_0x35846e,'id':_0x3b1a9b,'parts':_0x1f2bdc});await _0x35846e['updateContent']({'parts':_0x1f2bdc,'abortSignal':_0x54a132,'skipLoadingEffects':_0x4e36ea});}['updateSuggestionPartState']({id:_0x22c2a2,index:_0x59ea34,state:_0x1d7e69}){const _0x5719df=this['getItemById'](_0x22c2a2);if(!(_0x5719df instanceof Nn))throw new at('ai-chat-feed-view-item-not-a-suggestion-item',this,{'id':_0x22c2a2});_0x5719df['updatePartState'](_0x59ea34,_0x1d7e69);}['setSuggestionPartActive']({id:_0x2777f1,index:_0x1159f9,isActive:_0x2b94f6}){const _0x34504d=this['getItemById'](_0x2777f1);if(!(_0x34504d instanceof Nn))throw new at('ai-chat-feed-view-item-not-a-suggestion-item',this,{'id':_0x2777f1});this['children']['filter'](_0x5cbc60=>_0x5cbc60 instanceof Nn)['forEach'](_0x184174=>{_0x184174['setPartActive'](!0x1);}),_0x34504d['setPartActive'](_0x1159f9,_0x2b94f6);}['markItemAsDone'](_0x26304c){this['getItemById'](_0x26304c)['markAsDone']();}['getItemIds'](){return this['children']['map'](_0x13050a=>_0x13050a['options']['id']);}['removeItem'](_0x5924dc){this['children']['remove'](this['getItemById'](_0x5924dc));}['hasItem'](_0x5d7c0f){return!!this['children']['find'](_0x80cf70=>_0x80cf70['options']['id']['includes'](_0x5d7c0f));}['scrollToSuggestion'](_0x42e18b,_0x57956d){const _0xaca6c1=this['getItemById'](_0x42e18b);if(!(_0xaca6c1 instanceof Nn))return void It('ck-ai-chat-feed-view-scroll-to-suggestion-invalid-item',{'replyId':_0x42e18b,'partIndex':_0x57956d});const _0x36ac93=_0xaca6c1['getPartView'](_0x57956d);_0x36ac93?ft(_0x36ac93['element'],0x14,this['element']['parentElement'],!0x0,!0x0):It('ck-ai-chat-feed-view-scroll-to-suggestion-part-view-not-found',{'replyId':_0x42e18b,'partIndex':_0x57956d});}['_setupTemplate'](){this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed']},'children':this['_createTemplateChildren']()});}['_createTemplateChildren'](){const _0x2b45fb=this['_createSkeletonLoader']();return[this['_createFeedItems'](),_0x2b45fb,this['_createFeedLoader']()];}['_createSkeletonLoader'](){const _0x3eb254=new pn(this['locale'],mn['aiFeed']);return _0x3eb254['bind']('isVisible')['to'](this,'isLoadingSkeletonVisible'),_0x3eb254;}['_createFeedItems'](){const _0x378ca5=new vt(this['locale']);return _0x378ca5['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed__items',this['bindTemplate']['if']('isLoadingSkeletonVisible','ck-hidden')]},'children':this['children']}),_0x378ca5;}['_createFeedLoader'](){const _0x2214c9=new vt(this['locale']);return _0x2214c9['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__loader',this['bindTemplate']['if']('loadingMessage','ck-hidden',_0x4024e4=>!_0x4024e4)]},'children':this['_createLoaderChildren']()}),_0x2214c9;}['_createLoaderChildren'](){const _0xe3ce3=new yn();return _0xe3ce3['isVisible']=!0x0,[_0xe3ce3,{'tag':'span','attributes':{'class':['ck','ck-ai-chat__loader-text']},'children':[{'text':this['bindTemplate']['to']('loadingMessage')}]}];}['getItemById'](_0x338249){const _0x2f8c77=this['children']['find'](_0x232370=>_0x232370['options']['id']['includes'](_0x338249));if(!_0x2f8c77)throw new at('ai-chat-feed-view-item-not-found',this,{'id':_0x338249});return _0x2f8c77;}['setLoadingMessage'](_0x53d0bb){this['set']('loadingMessage',_0x53d0bb);}['toggleLoadingSkeleton'](_0xcdfc6){this['set']('isLoadingSkeletonVisible',_0xcdfc6);}['startAutoScroll'](_0x31e065={}){this['scrollManager']['start'](_0x31e065);}['stopAutoScroll'](){this['scrollManager']['stop']();}}class or extends Dt{['filter'](){let _0x3a41e6=0x0;for(const _0x1ac168 of this['items'])_0x3a41e6+=_0x1ac168['items']['length'];return{'resultsCount':_0x3a41e6,'totalItemsCount':_0x3a41e6};}}const ar='ck-ai-chat__prompt-input_highlighted';class hr extends Lt{['submitButtonView'];static ['MIN_ROWS']=0x1;static ['MAX_ROWS']=0xc;['_addContextButtonView'];['_queryViewResizeObserver'];constructor(_0x1dbfa2,_0x3bcceb){super(_0x1dbfa2,{'queryView':{'label':'','creator':Vt,'showIcon':!0x1,'showResetButton':!0x1},'filteredView':new or(_0x1dbfa2),'queryMinChars':0x1/0x0,'resetOnBlur':!0x1}),this['set']('isEmpty',!0x0),this['set']('isUploadInProgress',!0x1),this['_addContextButtonView']=_0x3bcceb,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',(_0x9e370b,_0x4a6248)=>!_0x9e370b&&!_0x4a6248),this['focusableChildren']['add'](this['submitButtonView']);}['render'](){super['render'](),this['queryView']['fieldWrapperChildren']['add'](this['submitButtonView']),this['keystrokes']['set']('enter',(_0x14ca7e,_0x4a0ddb)=>{this['isUploadInProgress']||this['isEmpty']||_0x14ca7e['target']==this['queryView']['fieldView']['element']&&(this['submit'](),_0x4a0ddb());}),this['queryView']['fieldView']['on']('update',()=>{this['isEmpty']=''===this['queryView']['fieldView']['element']['value']?.['trim']();});}['destroy'](){super['destroy'](),this['_queryViewResizeObserver']&&this['_queryViewResizeObserver']['destroy']();}['submit'](){const _0x2fd134=this['queryView']['fieldView']['element']['value']?.['trim']();if(!_0x2fd134)return this['queryView']['errorText']=hs(this['locale'],'AI_CHAT_PROMPT_EMPTY_ERROR'),void(this['queryView']['fieldView']['hasError']=!0x0);this['queryView']['fieldView']['hasError']=!0x1;const _0x5b043d=_0x3e39fc(_0x2fd134);this['fire']('sendUserMessage',_0x5b043d),this['queryView']['fieldView']['reset']();}['setPlaceholderText'](_0x1bdc7a){this['queryView']['fieldView']['set']('placeholder',_0x1bdc7a);}['focus'](_0x2208fc=!0x1){super['focus'](),_0x2208fc&&(this['element']['classList']['contains'](ar)||(this['element']['classList']['add'](ar),setTimeout(()=>{this['element']['classList']['remove'](ar);},0x320)));}['_createSubmitButton'](){const _0x2e994f=new Nt(this['locale']);return _0x2e994f['set']({'icon':_0xbc92a7,'label':hs(this['locale'],'AI_CHAT_LABEL_SUBMIT'),'isVisible':!0x0,'tooltip':!0x0,'class':'ck-ai-chat__prompt-submit-button\x20'+cs,'isEnabled':!0x1}),_0x2e994f['on']('execute',()=>{this['submit']();}),_0x2e994f;}['setIsUploadInProgress'](_0x3b78ce){this['isUploadInProgress']=_0x3b78ce;}['_setUpAddContextButtonPositioning'](){const _0x1eb27f=this['locale'],_0xc0ef75=()=>{ct['window']['requestAnimationFrame'](()=>{if(lt(this['element'])){const _0x4418ef=new ut(this['queryView']['fieldView']['element']),_0x8f18f9=new ut(this['_addContextButtonView']['element']),_0x1c1311=_0x4418ef['width'],_0x4085d6='rtl'===_0x1eb27f['uiLanguageDirection']?'right':'left';_0x4418ef['excludeScrollbarsAndBorders']();const _0x4aa7d3=_0x1c1311-_0x4418ef['width']+0x1;this['_addContextButtonView']['element']['style'][_0x4085d6]='calc('+(_0x1c1311-_0x8f18f9['width']-_0x4aa7d3)+'px\x20-\x20var(--ck-spacing-tiny))';}});};this['queryView']['fieldView']['on']('update',_0xc0ef75),this['on']('render',()=>{_0xc0ef75(),this['_queryViewResizeObserver']=new bt(this['queryView']['fieldView']['element'],()=>{_0xc0ef75();});});}}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(_0x1e5b22){super(_0x1e5b22),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',_0x5ebdc2=>'selector'===_0x5ebdc2),this['_modelSelectionDropdown']['buttonView']['bind']('tooltip')['to'](this,'modelSelectorEnabled',_0x3430d3=>_0x3430d3?this['_modelSelectionDropdown']['buttonView']['label']:hs(this['locale'],'AI_CHAT_MODEL_SELECTOR_DISABLED_TOOLTIP')),this['_modelSelectionDropdown']['bind']('isEnabled')['to'](this,'modelSelectorEnabled',_0x169f35=>_0x169f35),this['_webSearchButton']['bind']('isOn')['to'](this,'webSearchActive',_0x48a275=>_0x48a275),this['_webSearchButton']['bind']('tooltip')['to'](this,'webSearchActive',_0x4b3315=>hs(this['locale'],_0x4b3315?'AI_CHAT_DISABLE_WEB_SEARCH':'AI_CHAT_ENABLE_WEB_SEARCH')),this['_reasoningButton']['bind']('isOn')['to'](this,'reasoningActive',_0x346c2b=>_0x346c2b),this['_reasoningButton']['bind']('tooltip')['to'](this,'reasoningActive',_0x12fa8a=>hs(this['locale'],_0x12fa8a?'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'](_0x419fa2,_0xb595f9){if(_0xb595f9)this['set']('modelDisplayMode','hidden');else{const _0x220643=0x1===_0x419fa2['length'];this['set']('modelDisplayMode',_0x220643?'name':'selector');}if(this['_modelSelectionDropdownItems']['clear'](),_0x419fa2?.['length'])for(const _0x2b5429 of _0x419fa2){const _0x42444f=new Jt({'label':_0x2b5429['name'],'withText':!0x0,'role':'menuitemradio','id':_0x2b5429['id'],'model':_0x2b5429});_0x42444f['bind']('isOn')['to'](this,'activeModelId',_0x317f6c=>_0x317f6c===_0x2b5429['id']),this['_modelSelectionDropdownItems']['add']({'type':'button','model':_0x42444f,'labelView':new pr(this['locale'],_0x2b5429)});}}['setWebSearch'](_0x2c51b4){this['set']('webSearchActive',_0x2c51b4);}['setReasoning'](_0x499fa8){this['set']('reasoningActive',_0x499fa8);}['setModel'](_0x2e87cb){if(!_0x2e87cb)return;this['activeModelId']=_0x2e87cb['id'],this['activeModelName']=_0x2e87cb['name']||_0x2e87cb['id'],this['_modelSelectionDropdown']['buttonView']['set']('label',_0x2e87cb['name']),this['_modelSelectionDropdown']['buttonView']['set']('tooltip',_0x2e87cb['name']);const _0x2d4ff9=_0x2e87cb['capabilities']['webSearch']?.['enabled']??!0x1;this['set']('webSearchActive',!0x1),this['_webSearchButton']['set']('isOn',!0x1),this['_webSearchButton']['set']('isEnabled',_0x2d4ff9),this['_webSearchButton']['set']('isVisible',_0x2d4ff9);const _0x382ae8=_0x2e87cb['capabilities']['reasoning']?.['enabled']??!0x1;this['set']('reasoningActive',!0x1),this['_reasoningButton']['set']('isOn',!0x1),this['_reasoningButton']['set']('isEnabled',_0x382ae8),this['_reasoningButton']['set']('isVisible',_0x382ae8);}['enableModelSelector'](){this['set']('modelSelectorEnabled',!0x0);}['disableModelSelector'](_0x26e140){this['set']('modelSelectorEnabled',!0x1),_0x26e140&&this['set']('modelDisplayMode','hidden');}['_createWebSearchButton'](){const _0x35c221=new Nt();return _0x35c221['set']({'label':hs(this['locale'],'AI_CHAT_SEARCH_WEB'),'icon':_0x3e498b,'class':lr+'\x20'+us,'isToggleable':!0x0,'tooltipPosition':Ir}),_0x35c221['on']('execute',()=>{this['fire']('toggleWebSearch');}),_0x35c221;}['_createReasoningButton'](){const _0x14fd49=new Nt();return _0x14fd49['set']({'label':hs(this['locale'],'AI_CHAT_REASONING'),'icon':_0x38dc5f,'class':lr+'\x20'+us,'isToggleable':!0x0,'tooltipPosition':Ir}),_0x14fd49['on']('execute',()=>{this['fire']('toggleReasoning');}),_0x14fd49;}['_createCommandsButton'](){const _0x39b34a=new Nt();return _0x39b34a['set']({'label':hs(this['locale'],'AI_CHAT_COMMANDS'),'icon':_0x44bae3,'withText':!0x0,'class':lr+'\x20'+us,'isToggleable':!0x0,'tooltip':hs(this['locale'],'AI_CHAT_COMMANDS'),'tooltipPosition':Ir}),_0x39b34a['extendTemplate']({'attributes':{'class':[ur]}}),_0x39b34a['on']('execute',()=>{console['log']('Commands\x20are\x20not\x20implemented\x20yet.'),alert('Commands\x20are\x20not\x20implemented\x20yet.');}),_0x39b34a;}['_createModelSelectionDropdown'](){const _0x5f40b5=Gt(this['locale']);return _0x5f40b5['set']({'panelPosition':'ne','class':[dr]}),_0x5f40b5['buttonView']['set']({'label':hs(this['locale'],'AI_CHAT_MODEL_SELECTOR_ENABLED_TOOLTIP'),'withText':!0x0,'tooltip':!0x0,'tooltipPosition':Ir,'class':us}),this['listenTo'](_0x5f40b5,'execute',_0x59f2a5=>{this['fire']('selectModel',_0x59f2a5['source']['model']);}),_0x5f40b5;}['_createModelNameView'](){const _0x108138=new mr(this['locale']);return _0x108138['bind']('text')['to'](this,'activeModelName',_0x5e18e6=>_0x5e18e6??''),_0x108138['bind']('isVisible')['to'](this,'modelDisplayMode',_0x4f4922=>'name'===_0x4f4922),_0x108138;}}let pr=class extends Mt{constructor(_0x229f39,_0x4b0532){super();const _0x468da1=this['bindTemplate'],_0x3597ef=this['createCollection']();this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-button__label'],'style':_0x468da1['to']('style'),'id':_0x468da1['to']('id')},'children':[{'tag':'div','attributes':{'class':[_r]},'children':[{'text':_0x468da1['to']('text')}]},{'tag':'div','attributes':{'class':[gr]},'children':[{'tag':'span','children':[{'text':_0x4b0532['description']}]}]},{'tag':'div','attributes':{'class':[Ar]},'children':_0x3597ef}]}),_0x3597ef['addMany'](this['_getCapabilityParts'](_0x229f39,_0x3e498b,'AI_CHAT_SEARCH_WEB',_0x4b0532['capabilities']['webSearch']?.['enabled']??!0x1)),_0x3597ef['addMany'](this['_getCapabilityParts'](_0x229f39,_0x38dc5f,'AI_CHAT_REASONING',_0x4b0532['capabilities']['reasoning']?.['enabled']??!0x1));}['_getCapabilityParts'](_0x3d22ef,_0x447184,_0x5a0f1a,_0x492b17){const _0x3240ee=new xt();_0x3240ee['content']=_0x447184;const _0x29bc5d=new vt(_0x3d22ef);_0x29bc5d['setTemplate']({'tag':'span','children':[{'text':hs(_0x3d22ef,_0x5a0f1a)+':\x20'}]});const _0x9b7485=new vt(_0x3d22ef);return _0x9b7485['setTemplate']({'tag':'span','children':[{'text':hs(_0x3d22ef,_0x492b17?'AI_CHAT_CAPABILITIES_YES':'AI_CHAT_CAPABILITIES_NO')}]}),[_0x3240ee,_0x29bc5d,_0x9b7485];}},mr=class extends vt{constructor(_0x2edd3e){super(_0x2edd3e),this['set']('text',void 0x0),this['set']('isVisible',!0x0);const _0x402bb7=this['bindTemplate'];this['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai-chat-controls__model-name',_0x402bb7['if']('isVisible','ck-hidden',_0x40ea83=>!_0x40ea83)]},'children':[{'text':_0x402bb7['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(_0x1f502c){super(_0x1f502c),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'](_0x1d829e=>{this['focusTracker']['add'](_0x1d829e['element']),this['keystrokes']['listenTo'](_0x1d829e['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'](_0x23d573){this['urlInputField']['errorText']=_0x23d573,this['_updateConfirmButtonState'](),this['fire']('refreshBalloon');}['clearError'](){this['urlInputField']['errorText']=null,this['_updateConfirmButtonState']();}['_createBackButton'](){const _0x4fe9fb=new Nt(this['locale']);return _0x4fe9fb['set']({'icon':_0x2d0d1e,'tooltip':hs(this['locale'],'AI_CHAT_CONTEXT_URL_BACK_TO_CONTEXT'),'tooltipPosition':'n','class':['ck-button-icon\x20ck-button-back']}),this['on']('change:withBackButton',(_0x4529a3,_0x2eccff,_0x7e790f)=>{_0x4fe9fb['set']({'class':['ck-button-icon\x20ck-button-back'+(_0x7e790f?'':'\x20ck-hidden')]});}),_0x4fe9fb;}['_createUrlInputField'](){const _0x4f0b36=new te(this['locale'],_0x31c990);return _0x4f0b36['set']({'label':hs(this['locale'],'AI_CHAT_CONTEXT_URL_LABEL'),'class':'ck-labeled-field-view_empty'}),_0x4f0b36['fieldView']['set']({'placeholder':hs(this['locale'],'AI_CHAT_CONTEXT_URL_PLACEHOLDER')}),_0x4f0b36;}['_createConfirmButton'](){const _0x5a3417=new Nt(this['locale']);return _0x5a3417['set']({'icon':_0x51a320,'tooltip':hs(this['locale'],'AI_CHAT_CONTEXT_URL_ADD_URL'),'tooltipPosition':'n','class':'ck-button-icon','type':'submit','isEnabled':!0x1}),_0x5a3417;}['_setupTemplate'](){const _0x149247=new _0x58ed19(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'});_0x149247['children']['add'](this['backButton'],0x0),this['setTemplate']({'tag':'form','attributes':{'class':Tr,'tabindex':'-1'},'children':[_0x149247,{'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',_0xdb5d4a=>{_0xdb5d4a['stop'](),this['_handleSubmit']();});}['_setupKeystrokes'](){this['keystrokes']['set']('esc',(_0x1731a3,_0x3f8376)=>{this['clear'](),this['fire']('cancel'),_0x3f8376();});}['_handleSubmit'](){const _0xa5ed90=this['getValue']()['trim']();_0xa5ed90?this['_isValidUrl'](_0xa5ed90)?(this['clearError'](),this['fire']('submitUrl',_0xa5ed90)):this['setError'](hs(this['locale'],'AI_CHAT_CONTEXT_URL_INVALID_ERROR')):this['setError'](hs(this['locale'],'AI_CHAT_CONTEXT_URL_EMPTY_ERROR'));}['_updateConfirmButtonState'](){const _0x550a76=this['getValue']()['trim'](),_0x45cb87=!!this['urlInputField']['errorText'];this['confirmButton']['isEnabled']=_0x550a76['length']>0x0&&!_0x45cb87;}['_isValidUrl'](_0x291121){try{return!!new URL(_0x291121);}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(_0x158bfc,_0x37060c){super(_0x158bfc),this['resource']=_0x37060c,this['set']('isInContext',!!_0x37060c['isInContext']),this['_titleView']=this['_createTitleView'](),this['_iconView']=this['_createIconView'](),this['_setupTemplate']();}['render'](){super['render']();}['getResourceIcon'](_0x1a0bc9){if(_0x1a0bc9['isInContext'])return _0x51a320;switch(_0x1a0bc9['type']){case'document':return _0xded5c0;case'web-resource':return _0x4b251d;case'file':case'text':return _0x30bb37;default:return _0x19a54b;}}['highlightText'](_0x34bd72){if(!_0x34bd72||''===_0x34bd72['trim']())return void this['_titleView']['highlightText'](null);const _0x2aaabc=new RegExp(_0xf93015(_0x34bd72),'gi');this['_titleView']['highlightText'](_0x2aaabc);}['updateResourceState'](_0x1d8d5c){this['resource']['isInContext']=_0x1d8d5c,this['isInContext']=_0x1d8d5c,this['_updateIcon']();}['_createTitleView'](){const _0xa95fa2=new _0x2605e7();return _0xa95fa2['text']=this['resource']['label'],_0xa95fa2['extendTemplate']({'tag':'span','attributes':{'class':[Sr]}}),_0xa95fa2;}['_createIconView'](){const _0x3b5ab7=new xt();return _0x3b5ab7['content']=this['getResourceIcon'](this['resource']),_0x3b5ab7;}['_setupTemplate'](){const _0x17b1a6=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':[fr,_0x17b1a6['if']('isVisible','ck-hidden',_0xc9a0e1=>!_0xc9a0e1),_0x17b1a6['if']('isInContext',br)]},'children':[{'tag':'div','attributes':{'class':[Rr]},'children':[this['_iconView']]},this['_titleView']],'on':{'click':_0x17b1a6['to']('execute')}});}['_updateIcon'](){this['_iconView']['content']=this['getResourceIcon'](this['resource']);}}const kr='ck-ai-chat-resources__list';class Nr extends Dt{['_source'];constructor(_0xf701dd,_0x3f8602){super(_0xf701dd),this['_source']=_0x3f8602,this['extendTemplate']({'attributes':{'class':[kr]}});}['setResources'](_0x8cd6bf,_0x5adf4c){this['items']['clear']();let _0x48ab8c=_0x8cd6bf;if(this['_source']['useDefaultFiltering']&&_0x5adf4c&&''!==_0x5adf4c['trim']()){const _0x2100b2=new RegExp(_0x5adf4c['replace'](/[.*+?^${}()|[\]\\]/g,'\x5c$&'),'gi');_0x48ab8c=_0x8cd6bf['filter'](_0x2b2d4f=>_0x2100b2['test'](_0x2b2d4f['label']));}for(const _0x1cc67b of _0x48ab8c){const _0x2aea51=new Or(this['locale'],_0x1cc67b);_0x2aea51['on']('execute',()=>{this['_handleResourceSelection'](this['_source'],_0x1cc67b);}),this['items']['add'](_0x2aea51);}this['_source']['useDefaultFiltering']&&this['highlightText'](_0x5adf4c);}['highlightText'](_0x21b390){this['_source']['useDefaultFiltering']&&this['items']['forEach'](_0x183aa6=>{_0x183aa6['highlightText'](_0x21b390);});}['updateResourceState'](_0x1d6d0a,_0x482de0){for(const _0x1082d2 of this['items']){const _0x35d6ef=_0x1082d2;_0x35d6ef['resource']['id']===_0x1d6d0a&&_0x35d6ef['updateResourceState'](_0x482de0);}}['_handleResourceSelection'](_0x1bf56b,_0x5a602c){this['fire']('addResourceToContext',{'source':_0x1bf56b,'resource':_0x5a602c});}}class vr extends te{['iconView'];['resetButtonView'];['_viewConfig'];constructor(_0x2542d7){const t=_0x2542d7['t'],_0x5a2cd7={'showResetButton':!0x0,'showIcon':!0x0,'creator':_0x31c990,'label':hs(_0x2542d7,'AI_CHAT_SEARCH_RESOURCES')};super(_0x2542d7,_0x5a2cd7['creator']),this['label']=_0x5a2cd7['label'],this['_viewConfig']=_0x5a2cd7,this['_viewConfig']['showIcon']&&this['_setupSearchIcon'](),this['_viewConfig']['showResetButton']&&this['_setupResetButton'](_0x2542d7,t),this['_setupEventListeners']();}['reset'](){this['fieldView']['reset'](),this['_viewConfig']['showResetButton']&&this['resetButtonView']&&(this['resetButtonView']['isVisible']=!0x1),this['search']('');}['search'](_0x28740f){this['fire']('search',_0x28740f);}['getQuery'](){return this['fieldView']['element']?.['value']||'';}['_setupSearchIcon'](){this['iconView']=new xt(),this['iconView']['content']=_0x26b113,this['fieldWrapperChildren']['add'](this['iconView'],0x0),this['extendTemplate']({'attributes':{'class':'ck-search__query_with-icon'}});}['_setupResetButton'](_0x21a35b,t){this['resetButtonView']=new Nt(_0x21a35b),this['resetButtonView']['set']({'label':t('Clear'),'icon':_0x48af93,'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',_0xe5c153=>!_0xe5c153),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(_0x1d644,_0x2596b3){super(_0x1d644),this['_source']=_0x2596b3['source'],this['_searchInputVisibleFrom']=_0x2596b3['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 _0x19e880([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 _0x48d99d=new vt(this['locale']);return _0x48d99d['setTemplate']({'tag':'div','attributes':{'class':'ck\x20ck-search'},'children':[this['_searchView']]}),this['_searchView']['on']('search',(_0x454d3e,_0x14829f)=>{this['loadResources'](_0x14829f),this['_source']['useDefaultFiltering']&&this['_resourcesListView']['highlightText'](_0x14829f);}),_0x48d99d;}['_createResourcesListView'](){const _0x3131ac=new Nr(this['locale'],this['_source']);return _0x3131ac['delegate']('addResourceToContext')['to'](this),_0x3131ac['extendTemplate']({'attributes':{'class':this['bindTemplate']['if']('isLoading','ck-hidden')}}),_0x3131ac;}['_createSkeletonView'](){const _0x4cec57=new pn(this['locale'],mn['aiChatResources']);return _0x4cec57['bind']('isVisible')['to'](this,'isLoading'),_0x4cec57;}['render'](){super['render'](),this['loadResources']('');}['loadResources'](_0x48409){const _0x4c96b2=ot();this['_latestLoadResourcesUid']=_0x4c96b2,this['fire']('loadSourceResources',{'sourceId':this['_source']['id'],'query':_0x48409,'uid':_0x4c96b2}),this['isLoading']=!0x0;}['setResources'](_0x3e4822,_0x128a37){if(_0x128a37&&_0x128a37!==this['_latestLoadResourcesUid'])return;const _0x2e4d72=this['_source']['useDefaultFiltering']?this['_searchView']['getQuery']():'';this['_resourcesListView']['setResources'](_0x3e4822,_0x2e4d72),_0x3e4822['length']>=this['_searchInputVisibleFrom']&&!this['children']['has'](this['_searchSection'])&&this['children']['add'](this['_searchSection'],0x0),requestAnimationFrame(()=>{this['isLoading']=!0x1;});}['updateResourceState'](_0x3e15a5,_0x1c272b){this['_resourcesListView']['updateResourceState'](_0x3e15a5,_0x1c272b);}}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(_0x37d668,_0x2d1934,_0xecf943){this['_locale']=_0x37d668,this['_bodyCollection']=_0x2d1934,this['_config']=_0xecf943;}['showSourceResourcesBalloon']({source:_0x529743,withBackButton:_0x36a559}){let _0x366928=this['_sourceResourceBalloons']['get'](_0x529743['id']);_0x366928||(_0x366928=this['_createSourceResourceBalloonPanel'](),this['_sourceResourceBalloons']['set'](_0x529743['id'],_0x366928),this['_setupSingleResourceBalloonClickOutsideHandler'](_0x366928)),this['_addSourceResourceContent']({'balloonPanel':_0x366928,'source':_0x529743,'withBackButton':_0x36a559}),_0x366928['show']();const _0x500b75=this['_config']['getTargetElement']();_0x500b75&&_0x366928['pin']({'target':_0x500b75,'limiter':this['_config']['getLimiterElement']()});}['populateSourceResourceBalloon'](_0x2607d3,_0x4661ae,_0x3a6f20){const _0x3bacb0=this['_sourceResourceBalloons']['get'](_0x2607d3);if(!_0x3bacb0)return;const _0x454588=this['_getResourcesViewFromBalloon'](_0x3bacb0);_0x454588&&(_0x454588['setResources'](_0x4661ae,_0x3a6f20),_0x454588['once']('change:isLoading',()=>{_0x3bacb0['pin']({'target':this['_config']['getTargetElement'](),'limiter':this['_config']['getLimiterElement']()});}));}['closeSourceResourceBalloon'](_0x397e8e){const _0x4b9e63=this['_sourceResourceBalloons']['get'](_0x397e8e);_0x4b9e63&&requestAnimationFrame(()=>{_0x4b9e63['hide'](),this['_sourceResourceBalloons']['delete'](_0x397e8e),this['_config']['onBalloonClosed']();});}['isAnyResourceBalloonVisible'](){for(const _0x4b17e5 of this['_sourceResourceBalloons']['values']())if(_0x4b17e5['isVisible'])return!0x0;return!0x1;}['updateResourceState'](_0x40084b,_0x2cf5b2,_0x42b292){const _0x3ebba5=this['_sourceResourceBalloons']['get'](_0x40084b);if(!_0x3ebba5||!_0x3ebba5['isVisible'])return;const _0x19dc46=this['_config']['getTargetElement']();if(!_0x19dc46)return;_0x3ebba5['pin']({'target':_0x19dc46,'limiter':this['_config']['getLimiterElement']()});const _0x23e432=this['_getResourcesViewFromBalloon'](_0x3ebba5);_0x23e432&&_0x23e432['updateResourceState'](_0x2cf5b2,_0x42b292);}['destroy'](){for(const _0x46ec11 of this['_sourceResourceBalloons']['values']())_0x46ec11['destroy']();this['_sourceResourceBalloons']['clear']();}['_createSourceResourceBalloonPanel'](){const _0x3a748f=new Xt(this['_locale']);return _0x3a748f['extendTemplate']({'attributes':{'class':xr}}),this['_bodyCollection']['add'](_0x3a748f),_0x3a748f;}['_addSourceResourceContent']({balloonPanel:_0x27d09c,source:_0x132f81,withBackButton:_0x263dca}){_0x27d09c['content']['clear']();const _0x5490e9=this['_createBalloonHeader']({'balloonPanel':_0x27d09c,'source':_0x132f81,'withBackButton':_0x263dca});_0x27d09c['content']['add'](_0x5490e9);const _0x3cfd8a=this['_createBalloonResourcesView'](_0x132f81);_0x27d09c['content']['add'](_0x3cfd8a);}['_createBalloonHeader']({balloonPanel:_0x6679e,source:_0x18fe2e,withBackButton:_0x3fce70}){const _0x3a9f26=new _0x58ed19(this['_locale'],{'label':_0x18fe2e['label'],'class':Dr});return _0x3fce70&&_0x3a9f26['children']['add'](this['_createBackButton'](_0x6679e),0x0),_0x3a9f26;}['_createBackButton'](_0x5c13a1){const _0x1a55cc=new Nt(this['_locale']);return _0x1a55cc['set']({'icon':_0x2d0d1e,'tooltip':hs(this['_locale'],'AI_CHAT_CONTEXT_URL_BACK_TO_CONTEXT'),'tooltipPosition':'n','class':Lr}),_0x1a55cc['on']('execute',()=>{_0x5c13a1['hide'](),this['_config']['onBackToContext']();}),_0x1a55cc;}['_createBalloonResourcesView'](_0x2ec98f){const _0x49232d=new yr(this['_locale'],{'source':_0x2ec98f,'searchInputVisibleFrom':this['_config']['searchInputVisibleFrom']});return _0x49232d['on']('loadSourceResources',(_0x41e076,_0x48aeba)=>{this['_config']['onLoadSourceResources'](_0x48aeba);}),_0x49232d['on']('addResourceToContext',(_0x2197d7,_0x25f8ba)=>{this['_config']['onResourceSelected'](_0x25f8ba['source'],_0x25f8ba['resource']),this['closeSourceResourceBalloon'](_0x2ec98f['id']);}),_0x49232d;}['_getResourcesViewFromBalloon'](_0x11e5c8){const _0x1407c6=_0x11e5c8['content']['get'](0x1);return _0x1407c6 instanceof yr?_0x1407c6:null;}['_setupSingleResourceBalloonClickOutsideHandler'](_0xeaf237){zt({'emitter':_0xeaf237,'contextElements':[_0xeaf237['element']],'callback':()=>{_0xeaf237['hide'](),this['_config']['onBalloonClosed']();},'activator':()=>_0xeaf237['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(_0x12046f,_0x5ef623){super(_0x12046f),this['bodyCollection']=_0x5ef623['bodyCollection'],this['_currentContextsChips']=this['createCollection'](),this['_conversationContextsChips']=this['createCollection'](),this['addContextButtonView']=this['_createAddContextButtonView'](_0x12046f),this['_addContextBalloonPanelView']=this['_createAddContextBalloonPanelView'](_0x12046f),this['_urlBalloonPanelView']=this['_createUrlBalloonPanelView'](_0x12046f),this['_resourcesBalloonView']=this['_createResourcesBalloonView'](_0x12046f,_0x5ef623);const _0x21576e={'cssClasses':{'showMoreButton':$r+'\x20'+us,'showMoreBalloon':qr,'overflowContainer':Yr,'controlsButton':Wr}};this['_overflowManager']=new Wn(_0x12046f,this['_currentContextsChips'],_0x21576e,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'](_0x26eb29,_0x2ff12d){const _0x1e957c=this['_createContextButton'](_0x26eb29,'current',!0x0,_0x2ff12d);this['_addContextToCollection'](_0x1e957c,this['_currentContextsChips']),this['_overflowManager']['reorganizeChips']();}['removeContextItem'](_0x3b218){this['_removeContextFromCollection'](_0x3b218,this['_currentContextsChips']),this['_removeContextFromCollection'](_0x3b218,this['_overflowManager']['overflowChips']),this['_overflowManager']['reorganizeChips']();}['setContextItemLoading'](_0x132024,_0x384a80){let _0x456b27=this['_currentContextsChips']['find'](_0x452503=>_0x452503['id']===_0x132024);_0x456b27||(_0x456b27=this['_overflowManager']['overflowChips']['find'](_0x208d17=>_0x208d17['id']===_0x132024)),_0x456b27&&(_0x456b27['isLoading']=_0x384a80);}['setConversationContext'](_0x246529){this['_conversationContextsChips']['clear']();for(const _0x1eb79a of _0x246529){const _0x13cd05=this['_createContextButton'](_0x1eb79a,'conversation',!0x1,!0x1);this['_addContextToCollection'](_0x13cd05,this['_conversationContextsChips']);}}['clearCurrentContextItems'](){this['_currentContextsChips']['clear'](),this['_overflowManager']['clear']();}['clearConversationContextItems'](){this['_conversationContextsChips']['clear']();}['updateResourceState'](_0x4fc803,_0x185c37,_0x8b5fa9){this['_resourcesBalloonView']['updateResourceState'](_0x4fc803,_0x185c37,_0x8b5fa9);}['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:_0x4e530d,withBackButton:_0x1ee72f}){this['_resourcesBalloonView']['showSourceResourcesBalloon']({'source':_0x4e530d,'withBackButton':_0x1ee72f}),this['addContextButtonView']['isOn']=!0x0;}['populateSourceResourceBalloon'](_0x347b34,_0x1023cf,_0x5bdc4b,_0x5aab4d){this['_resourcesBalloonView']['populateSourceResourceBalloon'](_0x347b34,_0x5bdc4b,_0x5aab4d);}['closeSourceResourceBalloon'](_0x8cc803){this['_resourcesBalloonView']['closeSourceResourceBalloon'](_0x8cc803),this['addContextButtonView']['isOn']=!0x1;}['setAddContextOptions'](_0x4614ed){this['_setBalloonPanelContent'](this['_addContextBalloonPanelView'],this['locale'],_0x4614ed),this['_setAddContextButtonEnabled'](_0x4614ed);}['_setAddContextButtonEnabled'](_0x4f2213){const _0x6f7cc9=!_0x4f2213['document']['isHidden']&&_0x4f2213['document']['enabled'],_0x48839a=_0x4f2213['urls']['enabled'],_0x39e1b5=_0x4f2213['files']['enabled'],_0x18a1c1=_0x4f2213['sources']['length']>0x0,_0x4a9b0e=_0x4f2213['customItems']&&_0x4f2213['customItems']['length']>0x0;this['addContextButtonView']['isEnabled']=_0x6f7cc9||_0x48839a||_0x39e1b5||_0x18a1c1||_0x4a9b0e;}['_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'](_0x593bae){const _0x47eedd=new Nt(_0x593bae);return _0x47eedd['set']({'label':hs(_0x593bae,'AI_CHAT_CONTEXT_ADD_CONTEXT'),'class':Wr+'\x20'+Br+'\x20'+us,'icon':_0x1def42,'isToggleable':!0x0,'tooltip':!0x0,'tooltipPosition':'sw'}),_0x47eedd;}['_createAddContextBalloonPanelView'](_0x3fb9ff){return this['_createBaseBalloonPanel'](_0x3fb9ff,Vr);}['_createUrlBalloonPanelView'](_0x5dad83){const _0x39addf=this['_createBaseBalloonPanel'](_0x5dad83,Gr);return this['_addUrlContent'](_0x39addf,_0x5dad83),_0x39addf;}['_createResourcesBalloonView'](_0x3bfcd8,_0x51204e){const _0x5d467f={'searchInputVisibleFrom':_0x51204e['searchInputVisibleFrom'],'onBackToContext':()=>{this['showAddContextBalloonPanel'](),this['_addContextBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':Xr});},'onResourceSelected':(_0x504c3e,_0x55158a)=>{this['fire']('addResourceToContext',{'source':_0x504c3e,'resource':_0x55158a});},'onLoadSourceResources':_0x5e89aa=>{this['fire']('loadSourceResources',_0x5e89aa);},'onBalloonClosed':()=>{this['addContextButtonView']['isOn']=!0x1;},'getLimiterElement':()=>this['_getLimiterElement'](),'getTargetElement':()=>this['addContextButtonView']['element']};return new Pr(_0x3bfcd8,_0x51204e['bodyCollection'],_0x5d467f);}['_getLimiterElement'](){return this['element']?.['closest']('.'+Qr)||document['body'];}['_createBaseBalloonPanel'](_0x12de3c,_0x4954b5){const _0x2497b7=new Xt(_0x12de3c);return _0x2497b7['extendTemplate']({'attributes':{'class':_0x4954b5}}),this['bodyCollection']['add'](_0x2497b7),_0x2497b7;}['_setBalloonPanelContent'](_0x1735f9,_0x13c2fa,_0x23424f){if(_0x1735f9['content']['clear'](),!_0x23424f['document']['isHidden']&&_0x23424f['document']['enabled']){const _0x522f13=this['_createBalloonButton'](_0x13c2fa,{'label':hs(_0x13c2fa,'AI_CHAT_CONTEXT_CURRENT_DOCUMENT'),'icon':_0xded5c0});_0x522f13['on']('execute',()=>{this['fire']('addDocumentToContext'),this['hideAddContextBalloonPanel']();}),_0x1735f9['content']['add'](_0x522f13);}if(_0x23424f['urls']['enabled']){const _0x23c62a=this['_createBalloonButton'](_0x13c2fa,{'label':hs(_0x13c2fa,'AI_CHAT_CONTEXT_URL_LABEL'),'icon':_0x4b251d});_0x23c62a['on']('execute',()=>{this['hideAddContextBalloonPanel'](),this['showUrlBalloonPanel'](),this['_urlBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':Xr}),this['_urlInputView']['focus']();}),_0x1735f9['content']['add'](_0x23c62a);}if(_0x23424f['files']['enabled']){const _0x184296=new _0x1a89fd(_0x13c2fa);_0x184296['set']({'label':hs(_0x13c2fa,'AI_CHAT_CONTEXT_FILE_LABEL'),'icon':_0x24d34d,'withText':!0x0,'tooltip':!0x0,'class':Fr,'allowMultipleFiles':!0x0}),_0x184296['on']('execute',()=>{this['hideAddContextBalloonPanel']();}),_0x184296['on']('done',(_0x1fa43a,_0x1e1805)=>{this['fire']('addFileToContext',_0x1e1805);}),_0x184296['tooltip']=!0x0,_0x1735f9['content']['add'](_0x184296);}for(const _0x3d77ed of _0x23424f['sources']){const _0x268b96=this['_createBalloonButton'](_0x13c2fa,{'label':_0x3d77ed['label'],'icon':_0x3d77ed['icon']||_0x19a54b,'type':'source'});_0x1735f9['content']['add'](_0x268b96),_0x268b96['on']('execute',()=>{this['hideAddContextBalloonPanel'](),this['_showSourceResourcesBalloon']({'source':_0x3d77ed,'withBackButton':!this['_hasExactlyOneSource']});});}for(const _0x1fb5b6 of _0x23424f['customItems']||[]){const _0x436d7b=this['_createBalloonButton'](_0x13c2fa,{'label':_0x1fb5b6['label'],'icon':_0x1fb5b6['icon']||_0x19a54b,'type':'customItem'});_0x1735f9['content']['add'](_0x436d7b),_0x436d7b['on']('execute',()=>{this['hideAddContextBalloonPanel'](),this['fire']('executeCustomItemCallback',_0x1fb5b6);});}this['_hasExactlyOneSource']=0x1===_0x1735f9['content']['length'],this['_urlInputView']['withBackButton']=!this['_hasExactlyOneSource'];}['_addUrlContent'](_0x14c7be,_0xf97c33){this['_urlInputView']=new wr(_0xf97c33),this['_urlInputView']['on']('submitUrl',(_0x13dc8b,_0x3f3ff0)=>{this['_handleUrlSubmit'](_0x3f3ff0);}),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});}),_0x14c7be['content']['add'](this['_urlInputView']);}['_createBalloonButton'](_0x5e6fc9,_0x44b4ba){const _0x3365d7='source'===_0x44b4ba['type']?new jr(_0x5e6fc9):new Nt(_0x5e6fc9);return _0x3365d7['set']({'label':_0x44b4ba['label'],'icon':_0x44b4ba['icon'],'withText':!0x0,'tooltip':!0x0,'tooltipPosition':'sw','class':Fr}),_0x3365d7;}['_setupAllBalloonClickOutsideHandlers'](){this['_setupAddContextBalloonClickOutsideHandler'](),this['_setupUrlBalloonClickOutsideHandler']();}['_setupUrlBalloonClickOutsideHandler'](){zt({'emitter':this['_urlBalloonPanelView'],'contextElements':[this['_urlBalloonPanelView']['element']],'callback':()=>{this['hideUrlBalloonPanel']();},'activator':()=>this['_urlBalloonPanelView']['isVisible']});}['_toggleAddContextBalloon'](_0x56fea8){const _0x4c32a0=this['_addContextBalloonConfig'];_0x4c32a0['buttonView']['isOn']=_0x56fea8,_0x56fea8?_0x4c32a0['balloonView']['show']():_0x4c32a0['balloonView']['hide']();}['_setupAddContextBalloonClickOutsideHandler'](){const {balloonView:_0x4b57ba,buttonView:_0x5c2d86,hideMethod:_0xf79b12}=this['_addContextBalloonConfig'];zt({'emitter':_0x4b57ba,'contextElements':[_0x4b57ba['element'],_0x5c2d86['element']],'callback':()=>{_0xf79b12();},'activator':()=>_0x5c2d86['isOn']&&!this['_urlBalloonPanelView']['isVisible']&&!this['_resourcesBalloonView']['isAnyResourceBalloonVisible']()});}['_createContextButton'](_0x1ccb5e,_0xf55353,_0xd882aa=!0x1,_0x1fe0a4=!0x1){const _0x2464c8='conversation'===_0xf55353||!0x0===_0x1ccb5e['isReadOnly'],_0x37db4c=new Bn(this['locale'],_0x1ccb5e,_0x2464c8,_0xd882aa,_0x1fe0a4);return _0x2464c8||_0x37db4c['on']('removeContextItemChip',()=>{this['fire']('removeContextItem',_0x37db4c['id']);}),_0x37db4c;}['_addContextToCollection'](_0x892b1a,_0x515a48){_0x515a48['add'](_0x892b1a,0x0);}['_removeContextFromCollection'](_0x15903c,_0xc5524a){const _0x401a6c=_0xc5524a['find'](_0x3161ef=>_0x3161ef['id']===_0x15903c);_0x401a6c&&_0xc5524a['remove'](_0x401a6c);}['_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'](_0x7ade56){this['_urlInputView']['clear'](),this['hideUrlBalloonPanel'](),this['fire']('addUrlToContext',_0x7ade56);}}class jr extends Nt{['arrowView'];constructor(_0x57f377){super(_0x57f377),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 _0x4431b9=new xt();return _0x4431b9['content']=_0x5afc68,_0x4431b9['extendTemplate']({'attributes':{'class':Kr+'__arrow'}}),_0x4431b9;}}class Jr extends vt{['_cancelButtonView'];['_loaderView'];constructor(_0x206c6c){super(_0x206c6c),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 _0x1fbc6b=new Nt(this['locale']);return _0x1fbc6b['set']({'label':hs(this['locale'],'AI_CHAT_STOP_GENERATING'),'withText':!0x0,'class':ls+'\x20ck-ai-button-stop-generating','icon':_0x41a00}),_0x1fbc6b['on']('execute',()=>{this['fire']('abortPromptStream');}),_0x1fbc6b;}['_createLoaderView'](){const _0x5c7ce6=new vt(this['locale']);return _0x5c7ce6['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')}]}),_0x5c7ce6;}}class Zr extends vt{['_contextPanelView'];['_promptInputView'];['_promptCapabilitiesView'];['_loaderView'];['_modelUnavailableMessageView'];['_shouldRestorePromptInputFocus'];constructor(_0x3055ff,_0x588a1e){super(_0x3055ff),this['_contextPanelView']=this['_createContextPanelView'](_0x3055ff,{'bodyCollection':_0x588a1e['bodyCollection'],'searchInputVisibleFrom':_0x588a1e['contextResourcesSearchInputVisibleFrom']}),this['_promptInputView']=this['_createPromptInputView'](_0x3055ff),this['_promptCapabilitiesView']=this['_createPromptCapabilitiesView'](_0x3055ff),this['_loaderView']=this['_createLoaderView'](_0x3055ff),this['_modelUnavailableMessageView']=this['_createModelUnavailableMessageView'](_0x3055ff),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 _0x1a2aaf=this['bindTemplate'];this['setTemplate']({'tag':'form','attributes':{'class':['ck','ck-ai-chat-controls',_0x1a2aaf['if']('isDisabled','ck-ai-chat-controls-disabled')]},'children':[{'tag':'div','attributes':{'class':[_0x1a2aaf['if']('isLoading','ck-hidden',_0x267c27=>_0x267c27||!this['isModelAvailable']),_0x1a2aaf['if']('isModelAvailable','ck-hidden',_0x3074df=>!_0x3074df||this['isLoading'])]},'children':[this['_contextPanelView'],this['_promptInputView'],this['_promptCapabilitiesView']]},{'tag':'div','attributes':{'class':[_0x1a2aaf['if']('isLoading','ck-hidden',_0x1645d3=>!_0x1645d3)]},'children':[this['_loaderView']]},{'tag':'div','attributes':{'class':[_0x1a2aaf['if']('isModelAvailable','ck-hidden',_0x971943=>_0x971943)]},'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'](_0x341045,_0x501bf9){return new zr(_0x341045,_0x501bf9);}['_createPromptInputView'](_0x3d9570){return new hr(_0x3d9570,this['_contextPanelView']['addContextButtonView']);}['_createPromptCapabilitiesView'](_0x55d038){return new Er(_0x55d038);}['_createLoaderView'](_0x3c4ccc){return new Jr(_0x3c4ccc);}['_createModelUnavailableMessageView'](_0x410fbb){const _0xbe7c0e=new to(_0x410fbb);return _0xbe7c0e['delegate']('startConversation')['to'](this),_0xbe7c0e;}['_handlePromptInputFocus'](_0x54da82,_0x45a02c,_0x509613){_0x509613?this['_shouldRestorePromptInputFocus']=!0x0:this['_shouldRestorePromptInputFocus']&&this['_promptInputView']['focus']();}['addContextItem'](_0x377ea6,_0xdcbe95){this['_contextPanelView']['addContextItem'](_0x377ea6,_0xdcbe95);}['removeContextItem'](_0x1fa9e6){this['_contextPanelView']['removeContextItem'](_0x1fa9e6);}['setContextItemLoading'](_0x1d81dc,_0x1587a5){this['_contextPanelView']['setContextItemLoading'](_0x1d81dc,_0x1587a5);}['setIsUploadInProgress'](_0x470ee9){this['_promptInputView']['setIsUploadInProgress'](_0x470ee9);}['setConversationContext'](_0x4e1cb4){this['_contextPanelView']['setConversationContext'](_0x4e1cb4);}['clearPendingContextUI'](){this['_contextPanelView']['clearCurrentContextItems']();}['clearConversationContextUI'](){this['_contextPanelView']['clearConversationContextItems']();}['updateResourceState'](_0x195531,_0x58c301,_0x36d10a){this['_contextPanelView']['updateResourceState'](_0x195531,_0x58c301,_0x36d10a);}['setWebSearch'](_0x560d7d){this['_promptCapabilitiesView']['setWebSearch'](_0x560d7d);}['setReasoning'](_0x4e8608){this['_promptCapabilitiesView']['setReasoning'](_0x4e8608);}['resetMessageInput'](){this['_promptInputView']['reset']();}['setAddContextOptions'](_0x1ded6c){this['_contextPanelView']['setAddContextOptions'](_0x1ded6c);}['setInputPlaceholder'](_0x5a58aa){this['_promptInputView']['setPlaceholderText'](_0x5a58aa);}['setModelList'](_0x4b7547,_0xa32f9b){this['_promptCapabilitiesView']['setModelList'](_0x4b7547,_0xa32f9b);}['setModel'](_0x3b669e){_0x3b669e?(this['isModelAvailable']=!0x0,this['_promptCapabilitiesView']['setModel'](_0x3b669e)):this['isModelAvailable']=!0x1;}['enableModelSelector'](){this['_promptCapabilitiesView']['enableModelSelector']();}['disableModelSelector'](_0x2b90ef){this['_promptCapabilitiesView']['disableModelSelector'](_0x2b90ef);}['populateSourceResourceBalloon'](_0x2048c9,_0x1ea07b,_0xc3229a,_0x318e34){this['_contextPanelView']['populateSourceResourceBalloon'](_0x2048c9,_0x1ea07b,_0xc3229a,_0x318e34);}['closeSourceResourceBalloon'](_0x1e6dd1){this['_contextPanelView']['closeSourceResourceBalloon'](_0x1e6dd1);}['focusPromptInput'](_0x30e98f=!0x1){this['_promptInputView']['focus'](_0x30e98f);}['setPromptInputValue'](_0x449316){this['_promptInputView']['queryView']['fieldView']['reset'](),this['_promptInputView']['queryView']['fieldView']['value']=_0x449316;}}class to extends vt{constructor(_0x104dad){super(_0x104dad);const _0x2bae66=new Nt(_0x104dad);_0x2bae66['set']({'label':hs(this['locale'],'AI_CHAT_MODEL_UNAVAILABLE_MESSAGE_BUTTON'),'withText':!0x0,'class':['ck-ai-chat-controls__start-new-chat-button'],'tooltip':''}),_0x2bae66['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'},_0x2bae66]}]});}}class eo extends _0x58ed19{['resizeButton'];constructor(_0xd50cdc,_0x2f3cdd){super(_0xd50cdc,{'label':_0x2f3cdd['label'],'class':'ck-ai-header\x20'+_0x2f3cdd['class'],'icon':_0x2f3cdd['icon']}),this['set']('isMaximized',!0x1),_0x2f3cdd['content']&&this['children']['add'](_0x2f3cdd['content']),_0x2f3cdd['showResizeButton']&&(this['resizeButton']=ds(_0xd50cdc,this),this['children']['add'](this['resizeButton']));}}class io extends vt{constructor(_0x5561f0){super(_0x5561f0),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-disclaimer']},'children':[{'tag':'p','attributes':{'class':['ck','ck-ai-disclaimer__content']},'children':[{'text':hs(_0x5561f0,'AI_DISCLAIMER_TEXT')}]}]});}}function so(_0xc6ac53,_0x53f63d){const _0x1679ac=new Nt(_0xc6ac53);return _0x1679ac['set']({'label':hs(_0xc6ac53,'AI_CHAT_LABEL_NEW_CHAT'),'withText':!0x0,'icon':_0x5a2bc9,'class':'ck-ai-chat__start-conversation\x20'+ls}),_0x1679ac['on']('execute',()=>{_0x53f63d['fire']('startConversation');}),_0x1679ac;}class no extends vt{['chatHeader'];['chatFeed'];['chatControls'];['chatDisclaimer'];['_bodyCollection'];constructor(_0x363412,_0x348577){super(_0x363412),this['_bodyCollection']=new Qt(_0x363412),this['_bodyCollection']['attachToDom']();const _0x4faeb3=so(_0x363412,this);this['chatHeader']=new eo(_0x363412,{'label':hs(_0x363412,'AI_CHAT_HEADING'),'icon':_0xbcb0f4,'class':'ck-ai-header_chat','content':_0x4faeb3,'showResizeButton':_0x348577['showResizeButton']}),this['chatHeader']['delegate']('resizeTabs')['to'](this),this['chatFeed']=new rr(_0x363412,this['_bodyCollection']),this['chatFeed']['delegate'](...tn)['to'](this),this['chatControls']=new Zr(_0x363412,{'bodyCollection':this['_bodyCollection'],'contextResourcesSearchInputVisibleFrom':_0x348577['contextResourcesSearchInputVisibleFrom']}),this['chatControls']['delegate'](...tn)['to'](this),this['chatDisclaimer']=new io(_0x363412),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset_all','ck-ai-chat','ck-rounded-corners'],'dir':_0x363412['uiLanguageDirection']},'children':[this['chatHeader'],this['chatFeed'],this['chatControls'],this['chatDisclaimer']]});}['populateSourceResourceBalloon'](_0x32f695,_0x4e8e31,_0x355fed,_0x14e4fa){this['chatControls']['populateSourceResourceBalloon'](_0x32f695,_0x4e8e31,_0x355fed,_0x14e4fa);}['closeSourceResourceBalloon'](_0x2216af){this['chatControls']['closeSourceResourceBalloon'](_0x2216af);}['destroy'](){this['_bodyCollection']['detachFromDom'](),super['destroy']();}}class ro extends _0x35ff8d{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(_0x174697){super(_0x174697);const _0x51e1a5=this['context']['plugins']['get']('AITabs');this['set']('isBusy',!0x1),this['_promiseQueue']=new Cn(),this['_view']=new no(this['context']['locale'],{'showResizeButton':_0x51e1a5['showResizeButton'],'contextResourcesSearchInputVisibleFrom':this['context']['config']['get']('ai.chat.context.searchInputVisibleFrom')}),this['_view']['delegate']('resizeTabs')['to'](_0x51e1a5),this['_view']['delegate'](...tn)['to'](this),this['_view']['on']('toggleSuggestionDisplayMode',(_0x47568e,{showDiff:_0x5db6dc})=>{this['showDiff']=_0x5db6dc;}),_0x51e1a5['view']['addTab']({'id':'chat','buttonLabel':hs(this['context']['locale'],'AI_CHAT_HEADING'),'buttonIcon':_0xbcb0f4,'order':0x0,'content':this['_view']}),this['_view']['chatHeader']['bind']('isMaximized')['to'](_0x51e1a5['view'],'isMaximized',_0x3f6d85=>_0x3f6d85),this['_view']['chatControls']['bind']('isLoading')['to'](this,'isBusy',_0xda690a=>_0xda690a),this['_view']['chatControls']['setInputPlaceholder'](this['_getInputPlaceholder']()),this['bind']('isModelAvailable')['to'](this['_view']['chatControls'],'isModelAvailable');}['destroy'](){super['destroy'](),this['_titleAnimationInterval']&&clearInterval(this['_titleAnimationInterval']);}['createConversation'](_0x1b4329){const _0x4bcb70=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'](_0x1b4329['availableModels'],!this['context']['config']['get']('ai.models.showModelSelector')),this['addFeedItemStaticMessage']({'id':'conversation-start','staticMessage':_0x4bcb70}),this['fire']('conversationCreated');}async['addFeedItemStaticMessage']({id:_0x5997a2,staticMessage:_0x10bf21}){return this['_promiseQueue']['enqueue'](async()=>{this['_view']['chatFeed']['addItem']('ai-reply',{'id':_0x5997a2,'initialContent':'<p>'+_0x10bf21+'</p>'});});}async['addFeedItemUserMessage'](_0x30cd14){const _0x52b232=_0x30cd14['attributes']?.['displayedPrompt']||_0x30cd14['userMessage'];return this['_promiseQueue']['enqueue'](async()=>{this['_view']['chatFeed']['addItem']('user-message',{'contextItems':Array['from'](_0x30cd14['contextItems']['values']()),'initialContent':'<p>'+_0x52b232+'</p>','id':_0x30cd14['id']});});}async['addFeedItemError']({errorMessage:_0x598bce,id:_0x408281}){return this['_promiseQueue']['enqueue'](async()=>{this['_view']['chatFeed']['addItem']('error-message',{'initialContent':'<p>'+_0x598bce+'</p>','id':_0x408281});});}async['addFeedItemAIReply'](_0x32d799){return this['_promiseQueue']['enqueue'](async()=>{this['_view']['chatFeed']['addItem']('ai-reply',{'id':_0x32d799['interactionId']+':'+_0x32d799['id']}),this['clearLoadingMessage']();});}async['addFeedItemAISuggestion'](_0x320e57){const _0x37eabf=$s(this['context']);let _0x4a7382=_0x37eabf['config']['get']('ai.availableReplyActions')||[...fn];if(_0x37eabf['plugins']['has']('TrackChanges')){if(!this['_isTrackChangesCommandValueBound']){this['_isTrackChangesCommandValueBound']=!0x0;const _0x1d03c9=_0x37eabf['commands']['get']('trackChanges');this['_view']['chatFeed']['bind']('isTrackChangesOn')['to'](_0x1d03c9,'value');}}else _0x4a7382=_0x4a7382['filter'](_0x5743ff=>'insertSuggestion'!=_0x5743ff);return this['_promiseQueue']['enqueue'](async()=>{this['_view']['chatFeed']['addItem']('ai-suggestion-reply',{'id':_0x320e57['interactionId']+':'+_0x320e57['id'],'areActionsDisabled':_0x320e57['areActionsDisabled'],'showDiff':this['showDiff'],'availableActions':_0x4a7382}),this['clearLoadingMessage']();});}async['addFeedInteractionHeader'](_0x42a240,_0xfeaaa1){return this['_promiseQueue']['enqueue'](async()=>{const _0x2f4d3d=this['_view']['chatFeed']['children']['last'];if(_0x2f4d3d instanceof Zn)return this['_view']['chatFeed']['children']['remove'](_0x2f4d3d),void this['_view']['chatFeed']['addItem']('interaction-header',{'id':_0x42a240['id'],'capabilities':{'isWebSearchEnabled':_0x2f4d3d['capabilities']['isWebSearchEnabled']||_0xfeaaa1['isWebSearchEnabled'],'isReasoningEnabled':_0x2f4d3d['capabilities']['isReasoningEnabled']||_0xfeaaa1['isReasoningEnabled']}});this['_view']['chatFeed']['addItem']('interaction-header',{'id':_0x42a240['id'],'capabilities':_0xfeaaa1});});}async['addFeedItemCustomElement'](_0xde1553,_0x30daa0){let _0x3c4424;return await this['_promiseQueue']['enqueue'](async()=>{_0x3c4424=this['_view']['chatFeed']['addItem']('custom-element',{'content':_0xde1553,'id':_0x30daa0});}),_0x3c4424;}['removeFeedItem'](_0x148564){this['_view']['chatFeed']['removeItem'](_0x148564);}['hasFeedItem'](_0x3df71c){return this['_view']['chatFeed']['hasItem'](_0x3df71c);}['updateFeedInteractionHeader'](_0x77f9d4){const _0xc905ba=this['_view']['chatFeed']['children']['find'](_0x1fc2bc=>_0x1fc2bc['options']['id']==_0x77f9d4['id']&&_0x1fc2bc instanceof Zn);_0xc905ba&&_0xc905ba['set']('isVisible',_0x77f9d4['isVisible']);}async['updateFeedItemAIReplyContent'](_0x11d08c){const _0x3c269a=_0x11d08c['renderingStrategy']||this['feedItemRenderingStrategy'];return this['_promiseQueue']['enqueue'](async _0x1b832b=>{await this['_view']['chatFeed']['updateReplyItem']({..._0x11d08c,'abortSignal':_0x1b832b,'renderingStrategy':_0x3c269a}),_0x11d08c['isDone']&&this['markFeedItemAsDone'](_0x11d08c['id']);});}['updateFeedItemAIReplySources'](_0x29f474,_0x4cd0fb){this['_view']['chatFeed']['updateWebSources'](_0x29f474,_0x4cd0fb);}async['updateFeedItemAIReplySuggestionContent'](_0x38d5a4){return this['_promiseQueue']['enqueue'](async _0x57b1c7=>{await this['_view']['chatFeed']['updateSuggestionItem']({..._0x38d5a4,'abortSignal':_0x57b1c7}),_0x38d5a4['isDone']&&this['markFeedItemAsDone'](_0x38d5a4['id']);});}['updateFeedItemAIReplySuggestionPartState'](_0x4c9e8d){this['_view']['chatFeed']['updateSuggestionPartState'](_0x4c9e8d);}['setFeedItemAIReplySuggestionPartActive'](_0x2c8efc){this['_view']['chatFeed']['setSuggestionPartActive'](_0x2c8efc);}['markFeedItemAsDone'](_0x5c2492){this['_view']['chatFeed']['markItemAsDone'](_0x5c2492);}['removeFeedInteraction'](_0x2f5633){this['_view']['chatFeed']['getItemIds']()['filter'](_0x36ba9e=>_0x36ba9e['startsWith'](_0x2f5633))['forEach'](_0x400508=>this['_view']['chatFeed']['removeItem'](_0x400508));}['startInteraction'](){const _0x18bda6=this['prepareLoadingMessage']({'isWebSearchEnabled':!0x1,'isReasoningEnabled':!0x1});this['setLoadingMessage'](_0x18bda6),this['_view']['chatControls']['disableModelSelector'](!this['context']['config']['get']('ai.models.showModelSelector')),this['isBusy']=!0x0,this['_view']['chatFeed']['startAutoScroll']();}['stopInteraction'](_0x236a05){this['_promiseQueue']['abort'](),this['_view']['chatFeed']['getItemIds']()['filter'](_0x5de695=>_0x5de695['startsWith'](_0x236a05['id']))['forEach'](_0x579261=>this['markFeedItemAsDone'](_0x579261)),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'](_0x213327,_0x398c26){this['_view']['chatControls']['addContextItem'](_0x213327,_0x398c26);}['removeContextItem'](_0x17a2de){this['_view']['chatControls']['removeContextItem'](_0x17a2de);}['setContextItemLoading'](_0x210d49,_0x5ac0ea){this['_view']['chatControls']['setContextItemLoading'](_0x210d49,_0x5ac0ea);}['setIsUploadInProgress'](_0x25088d){this['_view']['chatControls']['setIsUploadInProgress'](_0x25088d);}['setConversationContext'](_0xec12e0){this['_view']['chatControls']['setConversationContext'](_0xec12e0);}['clearPendingContextUI'](){this['_view']['chatControls']['clearPendingContextUI']();}['clearConversationContextUI'](){this['_view']['chatControls']['clearConversationContextUI']();}['updateResourceState'](_0x39bb94,_0x4fe20e,_0x151036){this['_view']['chatControls']['updateResourceState'](_0x39bb94,_0x4fe20e,_0x151036);}['resetMessageInput'](){this['_view']['chatControls']['resetMessageInput'](),this['_view']['chatControls']['setInputPlaceholder'](this['_getInputPlaceholder']());}['setAddContextOptions'](_0x4d82ff){this['_view']['chatControls']['setAddContextOptions'](_0x4d82ff);}['updateCapabilities'](_0x35a249){this['_view']['chatControls']['setWebSearch'](_0x35a249['isWebSearchEnabled']),this['_view']['chatControls']['setReasoning'](_0x35a249['isReasoningEnabled']),this['_view']['chatControls']['setInputPlaceholder'](this['_getInputPlaceholder'](_0x35a249));}['setSelectedModel'](_0x5f55e4,_0x30d06a){this['_view']['chatControls']['setModel'](_0x5f55e4),_0x30d06a&&this['_view']['chatControls']['disableModelSelector'](!0x1);}['setFeedItemRenderingStrategy'](_0x42f338){this['feedItemRenderingStrategy']=_0x42f338;}['toggleLoadingSkeleton'](_0x69d0c2){this['_view']['chatFeed']['toggleLoadingSkeleton'](_0x69d0c2);}['resetConversationTitle'](){this['setConversationTitle'](hs(this['context']['locale'],'AI_CHAT_HEADING'));}['setConversationTitle'](_0x3eee90,_0x5866f4=!0x1){if(_0x5866f4&&!St()&&_0x3eee90['length'])return this['_view']['chatHeader']['label']='',void this['_animateConversationTitle'](_0x3eee90);this['_view']['chatHeader']['label']=_0x3eee90;}['setLoadingMessage'](_0x53caf6){this['_view']['chatFeed']['setLoadingMessage'](_0x53caf6);}['clearLoadingMessage'](){this['_view']['chatFeed']['setLoadingMessage']('');}['_animateConversationTitle'](_0x225b3f){let _0x2f0380=0x0;clearInterval(this['_titleAnimationInterval']),this['_titleAnimationInterval']=setInterval(()=>{this['_view']['chatHeader']['label']=this['_view']['chatHeader']['label']+_0x225b3f[_0x2f0380],_0x2f0380++,_0x2f0380===_0x225b3f['length']&&clearInterval(this['_titleAnimationInterval']);},0x1e);}['prepareLoadingMessage'](_0x3d8eb3){return _0x3d8eb3['isWebSearchEnabled']&&_0x3d8eb3['isReasoningEnabled']?hs(this['context']['locale'],'AI_CHAT_FEED_LOADING_MESSAGE_WEBSEARCH_REASONING'):_0x3d8eb3['isWebSearchEnabled']?hs(this['context']['locale'],'AI_CHAT_FEED_LOADING_MESSAGE_WEBSEARCH'):_0x3d8eb3['isReasoningEnabled']?hs(this['context']['locale'],'AI_CHAT_FEED_LOADING_MESSAGE_REASONING'):hs(this['context']['locale'],'AI_CHAT_FEED_LOADING_MESSAGE_REGULAR');}['_getInputPlaceholder'](_0x422ab8){return _0x422ab8?_0x422ab8['isWebSearchEnabled']&&_0x422ab8['isReasoningEnabled']?hs(this['context']['locale'],'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_WEBSEARCH_REASONING'):_0x422ab8['isWebSearchEnabled']?hs(this['context']['locale'],'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_WEBSEARCH'):_0x422ab8['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'](_0x4e3ebb,_0x334676,_0x2968b4,_0x3a0be9){this['_view']['populateSourceResourceBalloon'](_0x4e3ebb,_0x334676,_0x2968b4,_0x3a0be9);}['closeSourceResourceBalloon'](_0x5045e9){this['_view']['closeSourceResourceBalloon'](_0x5045e9);}['setPromptInputValue'](_0x4edb88){this['_view']['chatControls']['setPromptInputValue'](_0x4edb88);}['focusPromptInput'](_0x3c514a=!0x1){this['_view']['chatControls']['focusPromptInput'](_0x3c514a);}['scrollFeedToSuggestion'](_0x32180d,_0x20bb7e){this['_view']['chatFeed']['scrollToSuggestion'](_0x32180d,_0x20bb7e);}['startAutoScroll'](_0x429a0a={}){this['_view']['chatFeed']['startAutoScroll'](_0x429a0a);}['disableControls'](){this['_view']['chatControls']['isDisabled']=!0x0;}['enableControls'](){this['_view']['chatControls']['isDisabled']=!0x1;}}class oo extends Dt{['sections'];constructor(_0x4cd385,_0x5f30e5){super(_0x4cd385),this['sections']=_0x5f30e5,this['items']['addMany'](this['sections']),this['extendTemplate']({'attributes':{'class':['ck-ai-chat-history__sections']}});}['filter'](_0x9799b7){let _0x2ab960=0x0,_0x1705cb=0x0;for(const _0x5bc439 of this['sections']){const {resultsCount:_0x3511ee,totalItemsCount:_0x55f831}=_0x5bc439['filter'](_0x9799b7);_0x2ab960+=_0x3511ee,_0x1705cb+=_0x55f831;}return{'resultsCount':_0x2ab960,'totalItemsCount':_0x1705cb};}}class ao extends Ht{['title'];['itemsViews'];['_itemsListView'];constructor(_0x992125,{title:_0x48d495,items:_0x3ff0b6}){super(_0x992125);const _0x5cc53b=this['bindTemplate'];this['set']('isVisible',!0x0),this['title']=_0x48d495,this['itemsViews']=_0x3ff0b6;const _0x372480=new vt(_0x992125);_0x372480['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-chat-history__section-title']},'children':[this['title']]}),this['_itemsListView']=new Dt(_0x992125),this['_itemsListView']['items']['addMany'](this['itemsViews']),this['setTemplate']({'tag':'li','attributes':{'class':['ck-ai-chat-history__section',_0x5cc53b['if']('isVisible','ck-hidden',_0x2585e6=>!_0x2585e6)]},'children':[_0x372480,this['_itemsListView']]});}['filter'](_0x51b2d7){const _0xb95090=this['itemsViews']['length'];let _0x36d2be=0x0;for(const _0x5edbcb of this['itemsViews']){if(_0x51b2d7){const _0x5552ac=_0x5edbcb['isMatching'](_0x51b2d7);_0x5edbcb['isVisible']=!!_0x5552ac,_0x5edbcb['highlightText'](_0x51b2d7);}else _0x5edbcb['isVisible']=!0x0,_0x5edbcb['highlightText'](null);_0x5edbcb['isVisible']&&_0x36d2be++;}return this['isVisible']=_0x36d2be>0x0,{'resultsCount':_0x36d2be,'totalItemsCount':_0xb95090};}['getItem'](_0x3a4dab){return this['itemsViews']['find'](_0x88a4cf=>_0x88a4cf['id']===_0x3a4dab);}['removeItem'](_0x4e7f7e){const _0x34e01b=this['itemsViews']['indexOf'](_0x4e7f7e);-0x1!==_0x34e01b&&(this['itemsViews']['splice'](_0x34e01b,0x1),this['_itemsListView']['items']['remove'](_0x4e7f7e));}}class ho extends/* #__PURE__ -- @preserve */
|
|
27
|
-
_0x49ff75(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(_0x454188,_0x171e92){super(_0x454188);const _0x468943=this['bindTemplate'];this['set']('isEdit',!0x1),this['set']('isVisible',!0x0),this['set']('pinned',!!_0x171e92['pinned']),this['set']('loadingState',null),this['set']('title',_0x171e92['title']),this['id']=_0x171e92['id'];const {createdAt:_0x52fa86,active:_0x3e32c1=!0x1}=_0x171e92;this['_titleView']=new _0x2605e7(),this['_titleView']['bind']('text')['to'](this,'title',t=>_0x3e39fc(t||'')),this['_titleView']['extendTemplate']({'attributes':{'class':['ck-ai-chat-history__item-title']}});const _0x1d044e=this['_createCheckView'](),_0x18759e=this['_createPinButtonView'](_0x454188),_0x4acd58=this['_createMenuDropdownView'](),_0x145631=this['_createEditInputView'](_0x454188),_0x538343=this['_createAcceptEditButtonView'](_0x454188,_0x145631),_0x1fec4e=this['_createCancelEditButtonView'](_0x454188);this['actions']=this['createCollection'](),this['mainContent']=this['createCollection'](),this['mainContent']['add'](this['_titleView']),this['actions']['add'](_0x18759e),this['actions']['add'](_0x4acd58),this['on']('change:isEdit',(_0x5da7c3,_0x5bb353,_0x4b778d)=>{this['actions']['clear'](),this['mainContent']['clear'](),_0x4b778d?(this['actions']['add'](_0x538343),this['actions']['add'](_0x1fec4e),this['mainContent']['add'](_0x145631),_0x145631['element']['value']=this['title']||'',_0x145631['element']['focus']()):(this['actions']['add'](_0x18759e),this['actions']['add'](_0x4acd58),this['mainContent']['add'](this['_titleView']));}),this['setTemplate']({'tag':'li','attributes':{'class':['ck-ai-chat-history__item',_0x3e32c1?'ck-ai-chat-history__item--active':'',_0x468943['if']('isVisible','ck-hidden',_0x115346=>!_0x115346),_0x468943['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',_0x468943['if']('loadingState','ck-hidden',_0xe24fe4=>!!_0xe24fe4)]},'children':_0x3e32c1?[_0x1d044e]:[]},{'tag':'div','attributes':{'class':['ck-ai-loader',_0x468943['if']('loadingState','ck-hidden',_0xafa079=>!_0xafa079)]},'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',_0x468943['if']('loadingState','ck-hidden',_0x3abd8f=>!!_0x3abd8f)]},'children':this['mainContent']},{'tag':'div','attributes':{'class':['ck-ai-loader__text',_0x468943['if']('loadingState','ck-hidden',_0x30f33b=>!_0x30f33b)]},'children':[{'text':_0x468943['to']('loadingState',_0x262228=>_0x262228?hs(this['locale'],ho['LOADING_LABELS'][_0x262228]):'')}]}]},{'tag':'span','attributes':{'class':['ck-ai-chat-history__item-date']},'children':[_0x52fa86]}]},{'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'](_0x4067bb){this['set']('title',_0x4067bb);}['updateLoadingState'](_0x554024,_0x16a7c9){this['set']('loadingState',_0x16a7c9?_0x554024:null);}['_createCheckView'](){const _0xa3ae8=new xt();return _0xa3ae8['set']({'content':_0x51a320}),_0xa3ae8;}['_createPinButtonView'](_0x4daadd){const _0x1547b9=new Nt(_0x4daadd);return _0x1547b9['set']({'label':hs(_0x4daadd,'AI_CHAT_HISTORY_PIN_BUTTON'),'icon':_0x1d12ed,'withText':!0x1,'tooltip':!0x0}),_0x1547b9['bind']('isOn')['to'](this,'pinned'),_0x1547b9['on']('execute',()=>{const _0x33b822=!this['pinned'];this['fire']('setConversationPinned',{'id':this['id'],'pinned':_0x33b822});}),_0x1547b9;}['_createMenuDropdownView'](){const _0x995956=Gt(this['locale']),_0x5de5bd=_0x995956['panelView']['children'];_0x995956['buttonView']['set']({'label':hs(this['locale'],'AI_CHAT_HISTORY_SHOW_MORE_ITEMS'),'icon':_0xa472bb}),_0x995956['panelPosition']='sw';const _0xcb1162=new Nt(this['locale']);_0xcb1162['label']=hs(this['locale'],'AI_CHAT_HISTORY_EDIT_NAME'),_0xcb1162['withText']=!0x0,_0xcb1162['on']('execute',()=>{this['isEdit']=!0x0;});const _0x3b00e1=new Nt(this['locale']);_0x3b00e1['label']=hs(this['locale'],'AI_CHAT_HISTORY_REMOVE'),_0x3b00e1['withText']=!0x0,_0x3b00e1['on']('execute',()=>{this['showConfirm'](hs(this['locale'],'AI_CHAT_HISTORY_REMOVE_CONFIRM'),this['element'])['then'](()=>{this['fire']('removeConversation',{'id':this['id']});});});const _0x3929e4=new Dt(this['locale']),_0x403575=new Ht(this['locale']);_0x403575['children']['add'](_0xcb1162);const _0x330ad3=new Ht(this['locale']);return _0x330ad3['children']['add'](_0x3b00e1),_0x3929e4['items']['addMany']([_0x403575,_0x330ad3]),_0x5de5bd['add'](_0x3929e4),_0x995956;}['_createEditInputView'](_0x618d47){const _0x3f4fad=new _0x2a08f6(_0x618d47),_0x66b22=_0x3f4fad['bindTemplate'];return _0x3f4fad['extendTemplate']({'on':{'keydown':_0x66b22['to'](_0x4b0db4=>{'Enter'==_0x4b0db4['key']&&this['_commitEditInputValue'](_0x3f4fad);})}}),_0x3f4fad;}['_createAcceptEditButtonView'](_0x3ed2d8,_0x39ee8d){const _0x54fe92=new Nt(_0x3ed2d8);return _0x54fe92['set']({'icon':_0x51a320,'withText':!0x1,'tooltip':hs(_0x3ed2d8,'AI_CHAT_HISTORY_ACCEPT')}),_0x54fe92['extendTemplate']({'attributes':{'class':['ck-confirm-view-submit']}}),_0x54fe92['on']('execute',()=>{this['_commitEditInputValue'](_0x39ee8d);}),_0x54fe92;}['_commitEditInputValue'](_0x40ac63){const _0x1535ca=_0x40ac63['element']['value']||'';this['isEdit']=!0x1,this['fire']('editConversationTitle',{'id':this['id'],'title':_0x1535ca});}['_createCancelEditButtonView'](_0x385dd1){const _0x1c5247=new Nt(_0x385dd1);return _0x1c5247['set']({'icon':_0x48af93,'withText':!0x1,'tooltip':hs(_0x385dd1,'AI_CHAT_HISTORY_CANCEL')}),_0x1c5247['extendTemplate']({'attributes':{'class':['ck-confirm-view-cancel']}}),_0x1c5247['on']('execute',()=>{this['isEdit']=!0x1,this['fire']('edit:cancel');}),_0x1c5247;}['_createSpinnerView'](){const _0x2ce607=new yn('tiny');return _0x2ce607['isVisible']=!0x0,_0x2ce607;}['isMatching'](_0x5cdc7c){return'string'==typeof this['title']&&this['title']['match'](_0x5cdc7c)?{'title':!0x0}:null;}['highlightText'](_0x26a449){this['_titleView']['highlightText'](_0x26a449);}}class co extends vt{['headerView'];['searchView'];['mainErrorView'];['skeletonView'];['emptyView'];['sectionsView'];constructor(_0x3bb657,_0x2e31b2){super(_0x3bb657),this['set']('hasItems',!0x1),this['set']('isLoading',!0x0),this['set']('errorMessage',''),this['set']('isSearchViewVisible',!0x1),this['set']('isEmptyViewVisible',!0x1),this['set']('isMainErrorViewVisible',!0x1);const _0x453d98=so(_0x3bb657,this);this['headerView']=new eo(_0x3bb657,{'label':hs(_0x3bb657,'AI_CHAT_HISTORY_HEADING'),'icon':_0x578a8c,'class':'ck-ai-header_history','content':_0x453d98,'showResizeButton':_0x2e31b2}),this['headerView']['delegate']('resizeTabs')['to'](this),this['sectionsView']=new oo(_0x3bb657,[]),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',_0x4b6087=>!_0x4b6087)]}}),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 _0x4d232c=new _0x27242a(this['locale'],{'filteredView':this['sectionsView'],'queryView':{'label':hs(this['locale'],'AI_CHAT_HISTORY_SEARCH_LABEL')},'infoView':{'text':{'notFound':{'primary':_0x5c58ee=>hs(this['locale'],'AI_CHAT_HISTORY_SEARCH_NOT_FOUND_PRIMARY',_0x5c58ee),'secondary':hs(this['locale'],'AI_CHAT_HISTORY_SEARCH_NOT_FOUND_SECONDARY')}}}}),_0x366087=this['_createErrorView']();return _0x366087['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('errorMessage','ck-hidden',_0x14c167=>!_0x14c167)]}}),_0x4d232c['on']('render',()=>{_0x4d232c['children']['add'](_0x366087,0x1);}),_0x4d232c['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isSearchViewVisible','ck-hidden',_0x5688ed=>!_0x5688ed)]}}),_0x4d232c;}['_createSkeletonView'](){const _0x2e0c87=new pn(this['locale'],mn['aiHistory']);return _0x2e0c87['bind']('isVisible')['to'](this,'isLoading'),_0x2e0c87;}['_createErrorView'](){const _0x229839=new vt(this['locale']),_0x327739=new Nt(this['locale']);_0x327739['set']({'withText':!0x1,'icon':_0x48af93,'class':'ck-ai-notification_error__dismiss-button'}),_0x327739['bind']('isVisible')['to'](this,'hasItems',_0x4f5d05=>!!_0x4f5d05),_0x327739['on']('execute',()=>{this['errorMessage']='';});const _0x144add=this['bindTemplate'];return _0x229839['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-notification','ck-ai-notification_error']},'children':[{'tag':'p','children':[{'text':_0x144add['to']('errorMessage')}]},_0x327739]}),_0x229839;}['_createEmptyStateView'](){const _0x422af2=new vt(this['locale']);return _0x422af2['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-chat-history__empty',this['bindTemplate']['if']('isEmptyViewVisible','ck-hidden',_0x444382=>!_0x444382)]},'children':[{'tag':'p','attributes':{'class':['ck-ai-chat-history__empty-message']},'children':[hs(this['locale'],'AI_CHAT_HISTORY_EMPTY_MESSAGE')]}]}),_0x422af2;}['_createListItemViews'](_0x94c8a,_0x120bc3){const _0x10a7bb=[];for(const _0x2694b9 of _0x94c8a){const _0x2b70a5=new ho(_0x120bc3,_0x2694b9);_0x2b70a5['delegate'](...lo)['to'](this),_0x10a7bb['push'](_0x2b70a5);}return _0x10a7bb;}['updateHistoryItemsWithCategories'](_0x1fa3c4){const _0x178b63=this['locale']||'en',_0x216b4f=[];for(const _0x4eaa8d of _0x1fa3c4){const _0x27feeb=this['_createListItemViews'](_0x4eaa8d['items'],_0x178b63);_0x216b4f['push'](new ao(_0x178b63,{'title':_0x4eaa8d['title'],'items':_0x27feeb}));}this['sectionsView']['sections']=_0x216b4f,this['sectionsView']['items']['clear'](),this['sectionsView']['items']['addMany'](_0x216b4f),this['hasItems']=_0x1fa3c4['some'](_0x5485f9=>_0x5485f9['items']['length']>0x0),this['_refreshSearch']();}['removeHistoryItem'](_0x515e06){for(const _0x299af9 of this['sectionsView']['sections']){const _0xd7db24=_0x299af9['getItem'](_0x515e06);if(_0xd7db24){if(_0x299af9['removeItem'](_0xd7db24),0x0===_0x299af9['itemsViews']['length']){const _0x4860c9=this['sectionsView']['sections']['indexOf'](_0x299af9);-0x1!==_0x4860c9&&(this['sectionsView']['sections']['splice'](_0x4860c9,0x1),this['sectionsView']['items']['remove'](_0x299af9));}this['hasItems']=this['sectionsView']['sections']['length']>0x0,this['_refreshSearch']();break;}}}['updateItemTitle'](_0x4df8fa,_0x192ecf){for(const _0x4d5548 of this['sectionsView']['sections']){const _0x4e5ef1=_0x4d5548['getItem'](_0x4df8fa);if(_0x4e5ef1){_0x4e5ef1['updateTitle'](_0x192ecf);break;}}}['updateItemLoadingState'](_0x4077da,_0x5632d3,_0x521af8){for(const _0x1e6597 of this['sectionsView']['sections']){const _0x3eb8b2=_0x1e6597['getItem'](_0x4077da);if(_0x3eb8b2){_0x3eb8b2['updateLoadingState'](_0x5632d3,_0x521af8);break;}}}['_refreshSearch'](){if(this['hasItems']){const _0x442ad2=this['searchView']['queryView']['fieldView']?.['element']?.['value']||'';this['searchView']['search'](_0x442ad2);}}}const lo=['showConversationHistory','removeConversation','editConversationTitle','setConversationPinned','selectConversation','startConversation'];class uo extends _0x35ff8d{static get['requires'](){return[os];}['_historyView'];static get['pluginName'](){return'AIChatHistoryUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0xd0851c){super(_0xd0851c);const _0x4dd586=this['context']['plugins']['get']('AITabs');this['_historyView']=new co(this['context']['locale'],_0x4dd586['showResizeButton']),this['_historyView']['delegate']('resizeTabs')['to'](_0x4dd586),this['_historyView']['delegate'](...lo)['to'](this),this['_historyView']['headerView']['bind']('isMaximized')['to'](_0x4dd586['view'],'isMaximized',_0x5aa2a4=>_0x5aa2a4),_0x4dd586['view']['addTab']({'id':'history','buttonLabel':hs(this['context']['locale'],'AI_CHAT_HISTORY_HEADING'),'buttonIcon':_0x578a8c,'order':0x0,'content':this['_historyView']});}['removeHistoryItem'](_0x5256ef){this['_historyView']['removeHistoryItem'](_0x5256ef);}['updateItems'](_0x537a35){this['_historyView']['updateHistoryItemsWithCategories'](_0x537a35);}['updateItemTitle'](_0x550ea,_0x51956c){this['_historyView']['updateItemTitle'](_0x550ea,_0x51956c);}['updateItemLoadingState'](_0x5729ab,_0xcfa2e,_0x1913e6){this['_historyView']['updateItemLoadingState'](_0x5729ab,_0xcfa2e,_0x1913e6);}['setLoadingSkeleton'](_0x184989){this['_historyView']['isLoading']=_0x184989;}['showError'](_0x1e934a){this['_historyView']['errorMessage']=_0x1e934a;}['hideError'](){this['_historyView']['errorMessage']='';}}class _o extends ht(){['id'];['createdAt'];constructor({id:_0x422d60,title:_0x49c5d2,createdAt:_0x4dabfe,updatedAt:_0x1fbf3b,pinned:_0x294a95}){super(),this['id']=_0x422d60,this['createdAt']=new Date(_0x4dabfe),this['set']('title',_0x49c5d2),this['set']('updatedAt',_0x1fbf3b?new Date(_0x1fbf3b):null),this['set']('pinned',_0x294a95||!0x1);}['updateTitle'](_0x71f67f){this['set']('title',_0x71f67f),this['updatedAt']=new Date();}['updatePinned'](_0x490c9c){this['set']('pinned',_0x490c9c),this['updatedAt']=new Date();}}class go extends Tt(){['items']=[];['connector'];['group'];constructor({connector:_0x34f29e,group:_0x4c7655}){super(),this['connector']=_0x34f29e,this['group']=_0x4c7655;}async['init'](){try{const _0x5a595b=this['connector']['fetchConversations'](this['group']),_0x4d50f8=await _0x5a595b['getConversations']();this['loadItems'](_0x4d50f8);}catch(_0x548429){this['fire']('error',{'error':_0x548429,'operation':'init'});}}['addItem'](_0x327a43){this['items']['push'](_0x327a43);}async['removeItem'](_0x5324aa){const _0x2bdd90=this['items']['findIndex'](_0x431a51=>_0x431a51['id']===_0x5324aa);if(-0x1===_0x2bdd90)return!0x1;try{return await this['connector']['deleteConversation'](_0x5324aa)['execute'](),this['items']['splice'](_0x2bdd90,0x1),this['fire']('itemRemoved',{'itemId':_0x5324aa}),!0x0;}catch(_0x6056bb){return this['fire']('error',{'error':_0x6056bb,'operation':'removeItem','itemId':_0x5324aa}),!0x1;}}['getItem'](_0xc97cca){return this['items']['find'](_0x36a923=>_0x36a923['id']===_0xc97cca);}async['updateItemTitle'](_0x205667,_0xcf1fb9){const _0x9ba870=this['getItem'](_0x205667);if(!_0x9ba870)return!0x1;try{return await this['connector']['updateConversation'](_0x205667,{'title':_0xcf1fb9})['getResult'](),_0x9ba870['updateTitle'](_0xcf1fb9),this['fire']('itemUpdated',{'itemId':_0x205667,'updates':{'title':_0xcf1fb9}}),!0x0;}catch(_0x1d3701){return this['fire']('error',{'error':_0x1d3701,'operation':'updateItemTitle','itemId':_0x205667}),!0x1;}}async['updateItemPinned'](_0x27d2d3,_0x253510){const _0x3b7c48=this['getItem'](_0x27d2d3);if(!_0x3b7c48)return!0x1;try{return await this['connector']['updateConversation'](_0x27d2d3,{'pinned':_0x253510})['getResult'](),_0x3b7c48['updatePinned'](_0x253510),this['fire']('itemUpdated',{'itemId':_0x27d2d3,'updates':{'pinned':_0x253510}}),!0x0;}catch(_0x484f64){return this['fire']('error',{'error':_0x484f64,'operation':'updateItemPinned','itemId':_0x27d2d3}),!0x1;}}['loadItems'](_0x55c3ff){try{this['items']=[],_0x55c3ff['map'](_0x163d67=>{this['addItem'](new _o(_0x163d67));}),this['fire']('itemsLoaded',{'items':[...this['items']]});}catch(_0x3e337c){this['fire']('error',{'error':_0x3e337c,'operation':'loadItems'});}}['getItems'](_0x12f064={}){const _0x17e000=void 0x0!==_0x12f064['pinned']&&_0x12f064['pinned'],_0x426226=_0x12f064['from']?new Date(_0x12f064['from']['getFullYear'](),_0x12f064['from']['getMonth'](),_0x12f064['from']['getDate']()):null,_0x2664fa=_0x12f064['to']?new Date(_0x12f064['to']['getFullYear'](),_0x12f064['to']['getMonth'](),_0x12f064['to']['getDate']()):null;return this['items']['filter'](_0x48b3c6=>{if(_0x48b3c6['pinned']!==_0x17e000)return!0x1;if(_0x2664fa){const _0x30e987=new Date(_0x48b3c6['createdAt']['getFullYear'](),_0x48b3c6['createdAt']['getMonth'](),_0x48b3c6['createdAt']['getDate']());return _0x426226?_0x426226['getTime']()===_0x2664fa['getTime']()?_0x30e987['getTime']()===_0x426226['getTime']():_0x30e987<_0x2664fa&&_0x30e987>=_0x426226:_0x30e987<_0x2664fa;}return!0x0;});}}class Ao extends _0x35ff8d{['_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 _0x2bc127=this['context']['plugins']['get'](os);try{const _0xd1dfc7=this['_aiChatController']['getGroupId']();this['history']=new go({'connector':this['_aiConnector'],'group':_0xd1dfc7}),this['listenTo'](this['_aiChatHistoryUi'],'removeConversation',(_0x9c574a,_0x1c0088)=>{this['_setItemLoading'](_0x1c0088['id'],'remove'),this['_handleRemove'](_0x1c0088['id']);}),this['listenTo'](this['_aiChatHistoryUi'],'editConversationTitle',(_0x3e4ea4,_0x371485)=>{this['_setItemLoading'](_0x371485['id'],'rename'),this['_handleEditTitle'](_0x371485['id'],_0x371485['title']);}),this['listenTo'](this['history'],'itemUpdated',(_0x56233f,_0x2d4a4a)=>{void 0x0!==_0x2d4a4a['updates']['title']&&this['_aiChatHistoryUi']['updateItemTitle'](_0x2d4a4a['itemId'],_0x2d4a4a['updates']['title']),void 0x0!==_0x2d4a4a['updates']['pinned']&&this['_updateHistoryItemsUI'](),this['_clearItemLoading'](_0x2d4a4a['itemId']);}),this['listenTo'](this['history'],'itemRemoved',(_0x5b9fd5,_0x2acf93)=>{this['_aiChatController']['_handleRemovedConversation'](_0x2acf93['itemId']),this['_aiChatHistoryUi']['removeHistoryItem'](_0x2acf93['itemId']),this['_clearItemLoading'](_0x2acf93['itemId']);}),this['listenTo'](this['history'],'itemsLoaded',()=>{this['_updateHistoryItemsUI']();}),this['listenTo'](this['history'],'error',(_0x21f0c1,_0x2d4965)=>{this['_handleHistoryErrorUI'](_0x2d4965['error'],_0x2d4965['operation'],_0x2d4965['itemId']);}),this['listenTo'](this['_aiChatHistoryUi'],'selectConversation',(_0x4daf9b,_0x59d88f)=>{this['_handleSelectConversation'](_0x59d88f['id']);}),this['listenTo'](this['_aiChatHistoryUi'],'setConversationPinned',(_0x2371ea,_0x1a3248)=>{const _0x35c413=_0x1a3248['pinned']?'pin':'unpin';this['_setItemLoading'](_0x1a3248['id'],_0x35c413),this['_handleTogglePin'](_0x1a3248['id'],_0x1a3248['pinned']);}),this['listenTo'](this['_aiChatHistoryUi'],'startConversation',()=>{this['_aiChatController']['startConversation'](),_0x2bc127['view']['activateTab']('chat');}),this['listenTo'](this['_aiChatController'],'change:activeConversation',()=>{this['_updateHistoryItemsUI']();}),_0x2bc127['view']['on']('activateTab:history',()=>{this['_showConversationHistory']();});}catch(_0x4e5b1a){this['_handleHistoryErrorUI'](_0x4e5b1a,'init');}}async['_handleEditTitle'](_0x243d7d,_0x280641){await this['history']['updateItemTitle'](_0x243d7d,_0x280641);}async['_handleTogglePin'](_0x3265df,_0x135e9f){await this['history']['updateItemPinned'](_0x3265df,_0x135e9f);}async['_handleRemove'](_0x4e1430){await this['history']['removeItem'](_0x4e1430);}async['_handleSelectConversation'](_0x3ed87c){await this['_aiChatController']['loadConversation'](_0x3ed87c);}async['_showConversationHistory'](){this['_aiChatHistoryUi']['showError'](''),this['_aiChatHistoryUi']['setLoadingSkeleton'](!0x0),await this['history']['init'](),this['_aiChatHistoryUi']['setLoadingSkeleton'](!0x1);}['_updateHistoryItemsUI'](){const _0x233c44=this['_aiChatController']['activeConversation']?.['id'],_0x145564=this['_getCategorizedItems']()['map'](_0x31b430=>({'title':_0x31b430['title'],'items':_0x31b430['items']['map'](_0x292aa3=>({'id':_0x292aa3['id'],'title':_0x292aa3['title']||hs(this['context']['locale'],'AI_CHAT_UNTITLED_CONVERSATION'),'createdAt':new Date(_0x292aa3['createdAt'])['toLocaleDateString'](),'active':_0x292aa3['id']===_0x233c44,'pinned':_0x292aa3['pinned']}))}));this['_aiChatHistoryUi']['updateItems'](_0x145564);}['_setItemLoading'](_0x48827f,_0x1ca419){this['_aiChatHistoryUi']['updateItemLoadingState'](_0x48827f,_0x1ca419,!0x0);}['_clearItemLoading'](_0x61d3a9){this['_aiChatHistoryUi']['updateItemLoadingState'](_0x61d3a9,null,!0x1);}['_handleHistoryErrorUI'](_0x457bda,_0x3fea8e,_0x3d84ab){const _0x2726c0=this['_generateErrorMessage'](_0x3fea8e,_0x3d84ab);this['_aiChatHistoryUi']['showError'](_0x2726c0),_0x3d84ab&&this['_clearItemLoading'](_0x3d84ab),this['_aiChatHistoryUi']['setLoadingSkeleton'](!0x1);}['_generateErrorMessage'](_0x595107,_0x231de0){const _0x3e7e5d=_0x231de0?this['history']['getItem'](_0x231de0):null,_0x5aec3c=_0x3e7e5d?.['title']||hs(this['context']['locale'],'AI_CHAT_UNTITLED_CONVERSATION');switch(_0x595107){case'updateItemTitle':return hs(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_UPDATE_TITLE',_0x5aec3c);case'updateItemPinned':{const _0x248cd7=hs(this['context']['locale'],_0x3e7e5d?.['pinned']?'AI_CHAT_HISTORY_UNPIN_ACTION':'AI_CHAT_HISTORY_PIN_ACTION');return hs(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_UPDATE_PINNED',[_0x248cd7,_0x5aec3c]);}case'removeItem':return hs(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_REMOVE_ITEM',_0x5aec3c);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 _0x5972c6=new Date(),_0x233a22=new Date(_0x5972c6['getFullYear'](),_0x5972c6['getMonth'](),_0x5972c6['getDate']()),_0x386aaa=new Date(_0x233a22);_0x386aaa['setDate'](_0x386aaa['getDate']()-0x1);const _0x403460=new Date(_0x233a22);_0x403460['setDate'](_0x403460['getDate']()-0xe);const _0x1c0a2c=this['history']['getItems']({'pinned':!0x0}),_0x99a5db=this['history']['getItems']({'from':_0x233a22,'to':_0x233a22}),_0x126362=this['history']['getItems']({'from':_0x386aaa,'to':_0x386aaa}),_0x2fa369=this['history']['getItems']({'from':_0x403460,'to':_0x386aaa}),_0x1c93d3=this['history']['getItems']({'to':_0x403460}),_0x108ea9=[];return _0x1c0a2c['length']>0x0&&_0x108ea9['push']({'title':hs(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_PINNED'),'items':_0x1c0a2c}),_0x99a5db['length']>0x0&&_0x108ea9['push']({'title':hs(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_TODAY'),'items':_0x99a5db}),_0x126362['length']>0x0&&_0x108ea9['push']({'title':hs(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_YESTERDAY'),'items':_0x126362}),_0x2fa369['length']>0x0&&_0x108ea9['push']({'title':hs(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_LAST_14_DAYS'),'items':_0x2fa369}),_0x1c93d3['length']>0x0&&_0x108ea9['push']({'title':hs(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_LATER'),'items':_0x1c93d3}),_0x108ea9;}}class Io extends _0x35ff8d{static get['requires'](){return[Ao,uo];}static get['pluginName'](){return'AIChatHistory';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}class Eo extends _0x35ff8d{static get['requires'](){return[Xs,Js,ro,Io];}static get['pluginName'](){return'AIChat';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x24f321){super(_0x24f321),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(_0x246587,_0x48e78f){super(_0x246587);const {id:_0x3ad9b6,type:_0xfff8c,icon:_0x35153e}=_0x48e78f;this['id']=_0x3ad9b6,this['set']({'label':_0x48e78f['label'],'withText':!0x0,'class':'ck-ai-chat-shortcut'}),this['extendTemplate']({'attributes':{'data-cke-ai-shortcut-id':_0x48e78f['id']}}),_0x35153e?this['icon']=_0x35153e:'chat'===_0xfff8c?this['icon']=_0xbcb0f4:'review'===_0xfff8c?this['icon']=_0x12e6a2:'translate'===_0xfff8c&&(this['icon']=_0x5a40c9);}}class mo extends vt{['listView'];constructor(_0x97e300,_0x12906c){super(_0x97e300);const _0x177be0=_0x12906c['map'](_0x22fd2b=>{const _0x444163=new Ht(this['locale']),_0x22288f=new po(this['locale'],_0x22fd2b);return _0x444163['children']['add'](_0x22288f),_0x22288f['delegate']('execute')['to'](this),_0x444163;});this['listView']=new Dt(this['locale']),this['listView']['items']['addMany'](_0x177be0),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat-shortcuts']},'children':[this['listView']]});}}const To='chat-shortcuts';class Co extends _0x35ff8d{['_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 _0x1859ff=this['context']['plugins']['get']('AIChatController');this['_shortcuts']['length']&&(this['_validateShortcuts'](),this['_aiChatUI']['on']('conversationCreated',()=>{_0x1859ff['activeConversation']['isFromHistory']||this['_injectShortcuts']();}),this['listenTo'](_0x1859ff,'interactionStarted',()=>{this['_removeShortcuts']();}));}['_validateShortcuts'](){const _0xc010c1=['chat','review','translate'];this['_shortcuts']['forEach'](_0x8fd24e=>{let _0x42a201=!0x0;if(_0x8fd24e['id']&&_0x8fd24e['label']&&_0xc010c1['includes'](_0x8fd24e['type'])?'chat'===_0x8fd24e['type']&&(_0x42a201='string'==typeof _0x8fd24e['prompt']):_0x42a201=!0x1,!_0x42a201)throw new at('ai-chat-shortcuts-invalid-config',this['context'],{'shortcut':_0x8fd24e});});}['_injectShortcuts'](){const _0x4054b2=this['context']['plugins']['get'](ro);this['_shortcutsView']=new mo(this['context']['locale'],this['_shortcuts']),this['_shortcutsView']['render'](),_0x4054b2['addFeedItemCustomElement'](this['_shortcutsView']['element'],To),this['_shortcutsView']['on']('execute',_0x694108=>{const _0x1626c5=_0x694108['source']['id'];this['_executeShortcut'](_0x1626c5);});}['_removeShortcuts'](){const _0x1bdee8=this['context']['plugins']['get'](ro);_0x1bdee8['hasFeedItem'](To)&&_0x1bdee8['removeFeedItem'](To),this['_shortcutsView']?.['destroy']();}['_executeShortcut'](_0x36b18d){const _0x274ee9=this['_shortcuts']['find'](_0x1bdb3e=>_0x1bdb3e['id']===_0x36b18d),_0xf92e47=_0x274ee9['type'];'chat'===_0xf92e47?this['_runChatShortcut'](_0x274ee9):'review'===_0xf92e47?_0x274ee9['commandId']?this['_runReviewShortcut'](_0x274ee9):this['_switchTab']('reviewMode'):'translate'===_0xf92e47&&(_0x274ee9['language']?this['_runTranslateShortcut'](_0x274ee9):this['_switchTab']('translate'));}['_switchTab'](_0x2c51b8){if(!this['context']['plugins']['has']('AITabs'))throw new at('ai-chat-shortcuts-ai-tabs-not-found',this['context'],{'tabName':_0x2c51b8});this['context']['plugins']['get']('AITabs')['view']['activateTab'](_0x2c51b8);}async['_runChatShortcut']({prompt:_0x4d2222,draftMode:_0x5ecbfd,useWebSearch:_0x57d926=!0x1,useReasoning:_0x3d68e4=!0x1,model:_0x1f1a46}){const _0x1d9394=this['context']['plugins']['get']('AIChatController'),_0x4c9769=_0x1d9394['activeConversation'];let _0x579614;_0x579614=_0x1f1a46?await _0x4c9769['chatModels']['getModel'](_0x1f1a46):await _0x4c9769['chatModels']['getDefault'](),_0x579614&&await _0x4c9769['setModel'](_0x579614),_0x4c9769['setWebSearch'](_0x57d926),_0x4c9769['setReasoning'](_0x3d68e4),_0x1d9394['addCurrentDocumentToChatContext'](),_0x5ecbfd?(this['_aiChatUI']['setPromptInputValue'](_0x4d2222),this['_aiChatUI']['focusPromptInput'](!0x0)):_0x1d9394['sendMessage']({'message':_0x4d2222});}['_runReviewShortcut']({commandId:_0x415789,model:_0x54b2af,prompt:_0x4d5500,params:_0x28280d}){if(!this['context']['plugins']['has']('AIReviewModeUI'))throw new at('ai-chat-shortcuts-review-mode-not-found',this['context']);this['_switchTab']('reviewMode');const _0x174b93={'id':_0x415789,'isCustom':'custom'===_0x415789};_0x54b2af&&_0x4d5500&&(_0x174b93['args']={'model':_0x54b2af,'prompt':_0x4d5500}),_0x28280d&&(_0x174b93['params']=_0x28280d),this['context']['plugins']['get']('AIReviewModeUI')['fire']('runReviewCheck',_0x174b93);}['_runTranslateShortcut']({language:_0x2454e4}){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':_0x2454e4,'args':{'language':_0x2454e4}});}}class wo extends _0x65be43{constructor(_0xf054c9){super(_0xf054c9);const _0x2deb27=_0xf054c9['plugins']['get']('AITabs')['view'];this['bind']('value')['to'](_0x2deb27,'isVisible'),this['isEnabled']=!0x0;}['execute'](){const _0x2dda1e=this['editor']['plugins']['get']('AITabs')['view'];_0x2dda1e['isVisible']=!_0x2dda1e['isVisible'];}}class fo extends _0x45b757{static get['requires'](){return[os];}static get['pluginName'](){return'AIToggleButtonUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const _0x1dc48c=this['editor'];_0x1dc48c['commands']['add']('toggleAi',new wo(_0x1dc48c)),_0x1dc48c['ui']['componentFactory']['add']('toggleAi',()=>{const _0x25dcdc=this['_createAIUIButton'](Nt);return _0x25dcdc['set']({'tooltip':!0x0,'class':'ck-ai-toggle-button'}),_0x25dcdc;}),_0x1dc48c['ui']['componentFactory']['add']('menuBar:toggleAi',()=>{const _0x5d420d=this['_createAIUIButton'](Wt);return _0x5d420d['set']({'role':'menuitemcheckbox'}),_0x5d420d;});}['_createAIUIButton'](_0x3b26ab){const _0x45978a=this['editor'],_0x506bba=_0x45978a['commands']['get']('toggleAi'),_0x34c1ae=new _0x3b26ab(_0x45978a['locale']);return _0x34c1ae['set']({'label':hs(_0x45978a['locale'],'AI_TOGGLE_BUTTON_LABEL'),'icon':_0x34aae7,'isToggleable':!0x0}),_0x34c1ae['bind']('isEnabled')['to'](_0x506bba),_0x34c1ae['bind']('isOn')['to'](_0x506bba,'value',_0x4b9d9c=>!!_0x4b9d9c),this['listenTo'](_0x34c1ae,'execute',()=>{_0x506bba['execute']();}),_0x34c1ae;}}const bo=['applySuggestion','insertSuggestion','showNext','showPrevious'];class So extends vt{['_errorView'];constructor(_0x218a34){super(_0x218a34),this['set']('_errorMessage',''),this['set']('_isErrorVisible',!0x1);}['showBlockingError'](_0x1daf4f){this['showError'](_0x1daf4f);}['showError'](_0x4d1632){this['_errorView']||(this['_errorView']=this['_createErrorView']()),this['_errorMessage']=_0x4d1632,this['_isErrorVisible']=!0x0;}['hideError'](){this['_isErrorVisible']=!0x1;}['_createErrorView'](){const _0x4645f7=new vt(this['locale']),_0x5bc841=new vt(this['locale']);return _0x5bc841['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai-suggestion__error-text']},'children':[{'text':this['bindTemplate']['to']('_errorMessage')}]}),_0x4645f7['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__error','ck-ai-balloon-error',this['bindTemplate']['if']('_isErrorVisible','ck-hidden',_0x520d21=>!_0x520d21)]},'children':[_0x5bc841]}),_0x4645f7;}}const Ro=0xa;class Oo extends _0x35ff8d{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'](_0x391648){const {id:_0x2b5899}=this['_currentConfig']??{};this['_currentConfig']=_0x391648;const {id:_0x449077}=this['_currentConfig'];this['isOpen']&&_0x2b5899===_0x449077?this['_updateDialog']():this['_showDialog']();}['close'](){const _0x560078=this['_getTargetEditor']()['plugins']['get']('Dialog');_0x560078['isOpen']&&this['_currentConfig']&&_0x560078['id']===this['_currentConfig']['id']&&_0x560078['hide']();}['_updateDialog'](){const _0x146b93=this['_getTargetEditor']()['plugins']['get']('Dialog'),{icon:_0x12c4e6,title:_0x3ba01a}=this['_currentConfig'];_0x146b93['view']?.['headerView']&&(_0x146b93['view']['headerView']['label']=_0x3ba01a,_0x146b93['view']['headerView']['iconView']&&_0x12c4e6&&(_0x146b93['view']['headerView']['iconView']['content']=_0x12c4e6)),this['_isUpdatingMarkers']=!0x0,this['_showFakeVisualSelection'](),this['_isUpdatingMarkers']=!0x1,_0x146b93['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 _0x4bbfc7=this['_getTargetEditor']()['plugins']['get']('Dialog'),{id:_0x4a1c1d,title:_0x3c4d13,icon:_0x14f28f,class:_0x240a91,mainView:_0x41fbb8}=this['_currentConfig'];_0x41fbb8['delegate'](...bo)['to'](this),_0x4bbfc7['show']({'title':_0x3c4d13,'icon':_0x14f28f,'hasCloseButton':!0x0,'id':_0x4a1c1d,'position':this['_calculateDialogPosition']['bind'](this),'className':'ck-ai-balloon\x20'+(_0x240a91||''),'content':_0x41fbb8,'onShow':_0x20d3c4=>{this['_showFakeVisualSelection'](),this['_setupFakeVisualSelectionMarkerRemovalListener'](),_0x20d3c4['view']?.['updatePosition']();const _0x33f74e=this['_getSelectionElements']();_0x33f74e&&_0x33f74e[0x0]&&Ct({'target':_0x33f74e[0x0],'ancestorOffset':0x14,'alignToTop':!0x0,'viewportOffset':{'top':0x14,'bottom':0x14,'left':0x0,'right':0x0}}),this['isOpen']=!0x0,_0x20d3c4['once']('hide',()=>{this['fire']('beforeDialogClosed',{'id':_0x4a1c1d});},{'priority':'high'});},'onHide':()=>{this['_hideFakeVisualSelection'](),this['_cleanupFakeVisualSelectionMarkerRemovalListener'](),this['fire']('dialogClosed',{'id':_0x4a1c1d}),this['isOpen']=!0x1;}});}['_calculateDialogPosition'](_0x5c7810,_0x121ed5){if(!_0x121ed5){const _0x1bee12=this['_getTargetRootDomRect']();if(!_0x1bee12)return null;_0x121ed5=_0x1bee12;}const _0x273adf=this['_getSelectionElements']();if(!_0x273adf||0x0===_0x273adf['length'])return{'left':Math['round'](_0x121ed5['left']+_0x121ed5['width']/0x2-_0x5c7810['width']/0x2),'top':Math['round'](_0x121ed5['top']+_0x121ed5['height']/0x2-_0x5c7810['height']/0x2)};const _0x15f1df=Math['round'](_0x121ed5['left']+_0x121ed5['width']/0x2-_0x5c7810['width']/0x2),_0x2ccf71=_0x273adf['map'](_0x51938d=>new ut(_0x51938d)),_0xe39e8f=_0x5c7810['height'];return{'left':_0x15f1df,'top':this['_calculateOptimalTopPosition'](_0x2ccf71,_0xe39e8f,_0x121ed5)};}['_calculateOptimalTopPosition'](_0x26c1e3,_0x573cc4,_0x52e13f){const _0x352f94=new ut(ct['window']),_0x382671=_0x26c1e3['map'](_0x3c09c3=>_0x3c09c3['getVisible']())['filter'](_0x2e3ada=>_0x2e3ada),_0x3987ae=ut['getBoundingRect'](_0x382671);if(!_0x3987ae)return Math['round'](_0x52e13f['top']+_0x52e13f['height']/0x2);const _0x33cef3=_0x352f94['getIntersection'](_0x3987ae);if(!_0x33cef3)return Math['round'](_0x52e13f['top']+_0x52e13f['height']/0x2);const _0x6c6c71=_0x52e13f['getVisible'](),_0x12f69d=_0x6c6c71&&_0x3987ae['height']>_0x6c6c71['height'],_0x1d8892=_0x33cef3['top'],_0x1e3862=_0x33cef3['bottom'];if(_0x12f69d){const _0x9c02ce=(_0x6c6c71||_0x352f94)['height']/0x2-_0x573cc4/0x2,_0x5a019c=_0x1d8892-Ro-_0x52e13f['top'],_0x4bde6b=_0x52e13f['bottom']-_0x1e3862-Ro;return _0x5a019c>=_0x573cc4?Math['max'](Ro,_0x1d8892-_0x573cc4-Ro):_0x4bde6b>=_0x573cc4?_0x1e3862+Ro:Math['max'](Ro,_0x9c02ce);}const _0x34186e=_0x1d8892-_0x573cc4,_0x554fd7=_0x52e13f['bottom']-_0x1e3862-Ro,_0x12cf79=_0x1d8892-Ro-_0x52e13f['top'];let _0x53a802;if(_0x554fd7>=_0x573cc4)_0x53a802=_0x1e3862+Ro;else{if(_0x12cf79>=_0x573cc4)_0x53a802=_0x34186e-Ro;else _0x53a802=_0x1d8892+_0x3987ae['height']/0x2-_0x573cc4/0x2;}return _0x53a802;}['_setupFakeVisualSelectionMarkerRemovalListener'](){const _0xc52757=this['_getTargetEditor']();this['listenTo'](_0xc52757['model']['document'],'change',()=>{if(!this['_isUpdatingMarkers']){for(const {name:_0x310016,data:{newRange:_0x4bc24b}}of _0xc52757['model']['document']['differ']['getChangedMarkers']())if(_0x310016['startsWith'](zs+':')&&(_0x4bc24b&&(_0x4bc24b['start']['isEqual'](_0x4bc24b['end'])||'$graveyard'==_0x4bc24b['root']['rootName'])||null==_0x4bc24b)){const _0x130215=hs(this['context']['locale'],'AI_BALLOON_SELECTION_REMOVED_ERROR');this['_currentConfig']['mainView']['showBlockingError'](_0x130215),this['fire']('selectionRemoved');}}});}['_cleanupFakeVisualSelectionMarkerRemovalListener'](){const _0xff9f7d=this['_getTargetEditor']();this['_currentConfig']['mainView']['hideError'](),this['stopListening'](_0xff9f7d['model']['document']);}['_getSelectionElements'](){const _0x448582=this['_getTargetEditor']();return _0x13b3c6(_0x448582['editing'],[..._0x448582['model']['markers']['getMarkersGroup']('ai-selection'),..._0x448582['model']['markers']['getMarkersGroup']('ai-balloon-selection')]);}['_getTargetRootDomRect'](){const _0x552629=this['_currentConfig']?.['ranges']?.[0x0]?.['root'];if(!_0x552629)return null;const _0x20c432=this['_getTargetEditor'](),_0x450711=_0x20c432['editing']['view']['document']['getRoot'](_0x552629['rootName']);if(!_0x450711)return null;const _0x568d9f=_0x20c432['editing']['view']['domConverter']['mapViewToDom'](_0x450711);return _0x568d9f&&_0x568d9f instanceof HTMLElement?new ut(_0x568d9f):null;}}class ko extends kt{['copyButton'];['likeButton'];['dislikeButton'];['showChangesButton'];['_config'];constructor(_0xa03de8,_0x14cca4={}){super(_0xa03de8),this['set']('isEnabled',!0x0),this['set']('isShowChangesOn',!0x1),this['_config']={'showCopy':!0x1,'showLike':!0x1,'showDislike':!0x1,..._0x14cca4};const _0x28ff4b=!(this['_config']['showCopy']||this['_config']['showChanges']||this['_config']['showLike']||this['_config']['showDislike']||this['_config']['customView']?.['length']);this['class']=_0x28ff4b?'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'](_0x459e8d){this['showChangesButton']['isEnabled']=_0x459e8d;}['_setupRatingButtons'](){this['likeButton']=new Nt(this['locale']),this['likeButton']['set']({'icon':_0x3c87f5,'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':_0x4e5afa,'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':_0x3640b5,'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 _0xc6a36a=new xt();_0xc6a36a['set']({'content':_0x51a320}),_0xc6a36a['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'](_0xc6a36a);}['_setupShowChangesButton'](){this['showChangesButton']=new Nt(this['locale']),this['showChangesButton']['set']({'icon':_0x75dd65,'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',_0x1df38e=>_0x1df38e?_0x43b400:_0x75dd65),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(_0x30c274,_0x20621b){super(_0x30c274);const _0x58e573=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']=_0x20621b,this['nextButtonView']=this['_createNextButtonView'](),this['previousButtonView']=this['_createPreviousButtonView'](),this['_streamableContentView']=new In(_0x30c274),this['_partToolbarView']=new _n(_0x30c274,_0x20621b['availableActions']),this['_partToolbarView']['delegate']('applySuggestion','insertSuggestion','rejectSuggestion')['to'](this),this['_togglePartToolbarButtonsVisibility'](_0x20621b),this['_stateView']=new un(_0x30c274),this['_stateView']['isVisible']=!0x1,this['_miniToolbarView']=new ko(_0x30c274,{'showChanges':'full'}),this['_miniToolbarView']['bind']('isShowChangesOn')['to'](this,'showDiff'),this['_miniToolbarView']['on']('toggleShowChanges',()=>{this['fire']('toggleSuggestionDisplayMode');}),this['_toolbarContainerView']=new vo(_0x30c274,[this['_partToolbarView'],this['_stateView'],this['_miniToolbarView']]),this['children']=this['createCollection']([this['_streamableContentView'],this['_toolbarContainerView']]),this['on']('change:_state',(_0x28e075,_0x4301f2,_0x5bb673,_0x1172bb)=>{let _0x52d3f5,_0x1fe42b;'pending'===_0x1172bb?(_0x52d3f5=this['_partToolbarView'],_0x1fe42b=this['_stateView']):(_0x52d3f5=this['_stateView'],_0x1fe42b=this['_partToolbarView']),this['_stateView']['setState'](_0x5bb673),_0x52d3f5['isVisible']=!0x1,_0x1fe42b['isVisible']=!0x0;}),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat-balloon-main',_0x58e573['to']('_state',_0x554052=>'ck-ai-chat-balloon-main_state_'+_0x554052)]},'children':this['children']}),this['on']('change:isTrackChangesOn',()=>{this['_togglePartToolbarButtonsVisibility'](_0x20621b);});}['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'](_0x344c70){_0x344c70?.['keepErrors']||this['hideError'](),await this['_streamableContentView']['update'](_0x344c70);}['setState'](_0x1c21fa){this['_state']=_0x1c21fa;}['showError'](_0xff0315){super['showError'](_0xff0315),this['children']['has'](this['_errorView'])||this['children']['add'](this['_errorView'],0x0);}['hideError'](){this['_isErrorVisible']&&(super['hideError'](),this['togglePartToolbarEnabled'](!0x0));}['showBlockingError'](_0x2aebc0){super['showBlockingError'](_0x2aebc0),this['togglePartToolbarEnabled'](!0x1);}['toggleRotatorButtonsVisibility'](_0x5152b6){this['nextButtonView']['isVisible']=this['previousButtonView']['isVisible']=_0x5152b6;}['togglePartToolbarEnabled'](_0x443259){this['_partToolbarView']['isEnabled']=_0x443259;}['_togglePartToolbarButtonsVisibility']({showApplyButton:_0x1c7988,showSuggestButton:_0x2853af}){_0x1c7988=_0x1c7988&&!this['isTrackChangesOn']&&this['_config']['availableActions']['includes']('applySuggestion'),_0x2853af=_0x2853af&&this['_config']['availableActions']['includes']('insertSuggestion'),this['_partToolbarView']['setButtonsVisibility']({'showApplyButton':_0x1c7988,'showSuggestButton':_0x2853af});}['_createNextButtonView'](){const _0x42b70d=new Nt(this['locale']);return _0x42b70d['set']({'icon':_0x1e66f0,'label':hs(this['locale'],'AI_BALLOON_NEXT_LABEL'),'isVisible':!0x0}),_0x42b70d['on']('execute',()=>{this['fire']('showNext');}),_0x42b70d;}['_createPreviousButtonView'](){const _0xefaf1f=new Nt(this['locale']);return _0xefaf1f['set']({'icon':_0x2dfc5b,'label':hs(this['locale'],'AI_BALLOON_PREVIOUS_LABEL'),'isVisible':!0x0}),_0xefaf1f['on']('execute',()=>{this['fire']('showPrevious');}),_0xefaf1f;}}class vo extends vt{constructor(_0xe2334e,_0x47c33b){super(_0xe2334e),this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-chat-balloon__toolbar-container']},'children':_0x47c33b});}}class yo extends _0x45b757{static get['requires'](){return[Bt,Oo];}static get['pluginName'](){return'AIChatBalloon';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['_chatBalloonView'];constructor(_0x45ef6b){super(_0x45ef6b),this['set']('showDiff',!0x1);}['open'](_0x47fdc7){const _0x32bf0b=this['editor'];this['_chatBalloonView']||(this['_chatBalloonView']=this['_createChatBalloonView']()),_0x32bf0b['plugins']['get']('AIBalloon')['open']({..._0x47fdc7,'id':'aiChatBalloon','class':'ck-ai-chat-balloon','mainView':this['_chatBalloonView']}),this['_toggleRotatorButtonsInDialogHeader'](_0x47fdc7['showRotator']),this['_chatBalloonView']['togglePartToolbarEnabled'](!_0x47fdc7['areActionsDisabled']),this['_restoreDefaultViewFocus']();}['close'](){this['editor']['plugins']['get']('AIBalloon')['close']();}['updateContent'](_0x491d67){return this['_chatBalloonView']||(this['_chatBalloonView']=this['_createChatBalloonView']()),this['_chatBalloonView']['updateContent'](_0x491d67);}['setState'](_0x63c414){this['_chatBalloonView']&&this['_chatBalloonView']['setState'](_0x63c414);}['_createChatBalloonView'](){const _0x280e3c=this['editor'],_0x107f1b=_0x280e3c['plugins']['get']('AIBalloon'),_0x5b4423=_0x280e3c['commands']['get']('trackChanges');let _0x5611ef=_0x280e3c['config']['get']('ai.availableReplyActions')||[...fn];_0x280e3c['plugins']['has']('TrackChanges')||(_0x5611ef=_0x5611ef['filter'](_0x4362ed=>'insertSuggestion'!=_0x4362ed));const _0x2e873d=new No(_0x280e3c['locale'],{'availableActions':_0x5611ef,'showApplyButton':!0x0,'showSuggestButton':!!_0x5b4423});return _0x2e873d['bind']('showDiff')['to'](this),_0x2e873d['delegate'](...Zs)['to'](this),_0x2e873d['delegate']('showPrevious','showNext')['to'](this),_0x107f1b['delegate']('dialogClosed')['to'](this),_0x2e873d['on']('applySuggestion',this['_restoreDefaultViewFocus']['bind'](this)),_0x2e873d['on']('insertSuggestion',this['_restoreDefaultViewFocus']['bind'](this)),_0x2e873d['on']('rejectSuggestion',this['_restoreDefaultViewFocus']['bind'](this)),_0x5b4423&&_0x2e873d['bind']('isTrackChangesOn')['to'](_0x5b4423,'value'),_0x2e873d['render'](),_0x2e873d;}['_toggleRotatorButtonsInDialogHeader'](_0x4b7701){const _0x18f882=this['editor'],_0x4974b8=_0x18f882['plugins']['get']('Dialog')['view']['headerView']['children'];this['_chatBalloonView']['toggleRotatorButtonsVisibility'](_0x4b7701),_0x4974b8['has'](this['_chatBalloonView']['previousButtonView'])||(_0x4974b8['addMany']([this['_chatBalloonView']['previousButtonView'],this['_chatBalloonView']['nextButtonView']],0x0),_0x18f882['plugins']['get']('AIBalloon')['once']('beforeDialogClosed',()=>{_0x4974b8['remove'](this['_chatBalloonView']['previousButtonView']),_0x4974b8['remove'](this['_chatBalloonView']['nextButtonView']);}));}['_restoreDefaultViewFocus'](){this['_chatBalloonView']['focus']();}}class xo extends _0x45b757{static get['requires'](){return[fo,yo,_0x528645];}static get['pluginName'](){return'AIEditorIntegration';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}function Lo(_0x4983e0){const {editor:_0x27a6b9,action:_0x3c45e9,withText:_0x4f3cb3=!0x1,withIcon:_0x156ccb=!0x0,isInDropdown:_0x58618d=!0x0,shouldPreventFocus:_0xba6fdc=!0x1}=_0x4983e0;return()=>{const _0x5ab45c=_0x27a6b9['locale'],_0x1f6bd3=new Nt(_0x5ab45c),_0x5665ac=_0x1f6bd3['bindTemplate'];_0x58618d&&_0x1f6bd3['extendTemplate']({'on':{'mouseenter':_0x5665ac['to'](()=>{_0xba6fdc&&_0xba6fdc()||_0x1f6bd3['focus']();})}});const _0x25ef37=_0x3c45e9['icon']??_0x3c45e9['parent']?.['icon'];return _0x1f6bd3['set']({'label':_0x3c45e9['label'],'withText':_0x4f3cb3,'role':'menuitem','icon':_0x156ccb?_0x25ef37??_0x333369:void 0x0,'tooltip':!_0x4f3cb3,'class':'ck-ai-quick-actions-button','isEnabled':_0x3c45e9['isEnabled']}),_0x1f6bd3['on']('execute',()=>{_0x27a6b9['editing']['view']['focus'](),_0x27a6b9['commands']['execute']('aiQuickAction',_0x3c45e9);}),_0x1f6bd3;};}class Do extends _0x5c6fa4{['arrowView'];constructor(_0x3fbe22,_0x569e01){super(_0x3fbe22,_0x569e01);const _0x5dc1ac=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',_0x4b79ec=>String(_0x4b79ec)),'data-cke-tooltip-disabled':_0x5dc1ac['to']('isOn')},'on':{'mouseenter':_0x5dc1ac['to']('mouseenter')}});}['render'](){super['render'](),this['children']['add'](this['arrowView']);}['_createArrowView'](){const _0x1f7b12=new xt();return _0x1f7b12['content']=_0x5afc68,_0x1f7b12['extendTemplate']({'attributes':{'class':'ck-dropdown-menu-list__nested-menu__button__arrow'}}),_0x1f7b12;}}class Po extends Dt{['_allListItems'];['_allSearchableItems'];constructor(_0x5c44bc,_0x177104,_0x53c99e){super(_0x5c44bc),this['_allListItems']=_0x177104,this['_allSearchableItems']=_0x53c99e;}['filter'](_0x31373f){if(!_0x31373f)return this['items']['clear'](),this['items']['addMany'](this['_allListItems']),this['_clearHighlight'](),{'resultsCount':this['_allListItems']['length'],'totalItemsCount':this['_allListItems']['length']};const _0x5ce9f4=_0x31373f['source']['toLowerCase']()['trim'](),_0x48ab73=this['_allSearchableItems']['filter'](_0x3a9819=>(_0x3a9819['groupLabel']?_0x3a9819['label']+'\x20('+_0x3a9819['groupLabel']+')':_0x3a9819['label'])['toLowerCase']()['includes'](_0x5ce9f4));return this['items']['clear'](),this['items']['addMany'](_0x48ab73['sort']((_0x445ade,_0x179c59)=>{const _0x46108d=_0x445ade['groupLabel'],_0x4dc418=_0x179c59['groupLabel'];return _0x46108d||_0x4dc418?_0x46108d?0x1:-0x1:0x0;})['map'](_0x467a69=>_0x467a69['item'])),this['_highlightQuery'](_0x5ce9f4,_0x48ab73),{'resultsCount':_0x48ab73['length'],'totalItemsCount':this['_allSearchableItems']['length']};}['_highlightQuery'](_0x836d86,_0x472909){if(!_0x836d86)return;const _0xd39c81=new RegExp(_0xf93015(_0x836d86),'gi');_0x472909['forEach'](_0x18447b=>{_0x18447b['highlightViews']&&_0x18447b['highlightViews']['forEach'](_0x20d888=>{'function'==typeof _0x20d888['highlightText']&&_0x20d888['highlightText'](_0xd39c81);});});}['_clearHighlight'](){this['_allSearchableItems']['forEach'](_0x102c97=>{_0x102c97['highlightViews']&&_0x102c97['highlightViews']['forEach'](_0x3508f3=>{'function'==typeof _0x3508f3['highlightText']&&_0x3508f3['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(_0x32471a,_0x23b113,_0x41c285,_0xd1d690,_0x3173bf=!0x1){const _0x5aba3e=_0x32471a['locale'];super(_0x5aba3e),this['_bodyCollection']=_0xd1d690,this['_hasSearch']=_0x3173bf;const _0x247d6f=this['_createListItems'](_0x32471a,_0x23b113,_0x41c285);this['optionsListView']=new Po(_0x5aba3e,_0x247d6f,this['_allSearchableItems']),this['optionsListView']['role']=Ho,this['optionsListView']['items']['addMany'](_0x247d6f),this['focusTracker']=new _t(),this['keystrokes']=new gt(),_0x3173bf&&(this['_searchTextView']=this['_createSearchTextView']()),this['_focusables']=_0x247d6f,this['focusCycler']=new Ut({'focusables':this['_focusables'],'focusTracker':this['focusTracker'],'keystrokeHandler':this['keystrokes']}),_0x3173bf&&this['_searchTextView']&&this['focusCycler']['chain'](this['_searchTextView']['focusCycler']);const _0x5324fb=_0x3173bf&&this['_searchTextView']?[this['_searchTextView']]:[this['optionsListView']];this['children']=new _0x19e880(_0x5324fb),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset_all','ck-ai-quick-actions','ck-rounded-corners'],'dir':_0x5aba3e['uiLanguageDirection']},'children':this['children']});}['_createSearchTextView'](){return new _0x27242a(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 _0x56ca87=this['_searchTextView']['queryView']['fieldView']['element']['ownerDocument']?.['activeElement'];return this['_searchTextView']['queryView']['fieldView']['element']['contains'](_0x56ca87);}['_createListItems'](_0x1e8737,_0x489c38,_0x23c9f4){const _0x4897e2=new _0x19e880();return _0x489c38['forEach'](_0x4ff81f=>{if('actions'in _0x4ff81f){const {listItem:_0x799a67}=this['_createActionGroupButton'](_0x1e8737,_0x4ff81f,_0x23c9f4);_0x4897e2['add'](_0x799a67),_0x4ff81f['actions']['forEach'](_0x3b2e47=>{this['_createActionButton'](_0x1e8737,_0x3b2e47,_0x4ff81f['label'],_0x4ff81f['icon']);const {listItem:_0x2b18b7,highlightViews:_0x48e13d}=this['_createSearchResultActionButton'](_0x1e8737,_0x3b2e47,_0x4ff81f['label'],_0x4ff81f['icon']);this['_allSearchableItems']['push']({'item':_0x2b18b7,'label':_0x3b2e47['label'],'groupLabel':_0x4ff81f['label'],'highlightViews':_0x48e13d});});}else{const {listItem:_0x3be19c}=this['_createActionButton'](_0x1e8737,_0x4ff81f);_0x4897e2['add'](_0x3be19c);const _0x392400=_0x3be19c['children']['first'];if(_0x392400){const {listItem:_0x1f907e,highlightViews:_0x4cbefe}=this['_createSearchResultActionButton'](_0x1e8737,_0x4ff81f);this['_allSearchableItems']['push']({'item':_0x1f907e,'label':_0x392400['label']||'','highlightViews':_0x4cbefe});}}}),_0x4897e2;}['_createActionButton'](_0xe15113,_0x545391,_0x7f5bea,_0x5afb3){const _0x1b47b8=new Ht(this['locale']);if(_0x7f5bea&&_0x5afb3){const _0xfae37e=new Nt(this['locale']),_0x296ef5=_0xfae37e['bindTemplate'],_0xacb361=new _0x2605e7();_0xacb361['text']=_0x545391['label'];const _0x6fa58a=new _0x2605e7();_0x6fa58a['text']=_0x7f5bea;const _0x1e5fce=new xt();_0x1e5fce['content']=_0x5afb3,_0x1e5fce['extendTemplate']({'attributes':{'class':'ck-ai-quick-actions-button__group-icon'}});const _0x4f0a40=new vt(this['locale']);_0x4f0a40['setTemplate']({'tag':'span','attributes':{'class':'ck-ai-quick-actions-button_with-group__open-paren'},'children':[{'text':'\x20('}]});const _0x4d9a3e=new vt(this['locale']);return _0x4d9a3e['setTemplate']({'tag':'span','attributes':{'class':'ck-ai-quick-actions-button_with-group__close-paren'},'children':[{'text':')'}]}),_0xfae37e['set']({'label':_0x545391['label']+'\x20('+_0x7f5bea+')','withText':!0x0,'role':'menuitem','class':'ck-ai-quick-actions-button\x20ck-ai-quick-actions-button_with-group','tooltip':!0x1}),_0xfae37e['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':[_0xacb361,_0x4f0a40,_0x1e5fce,_0x6fa58a,_0x4d9a3e],'on':{'mouseenter':_0x296ef5['to'](()=>{this['_isSearchFocused']()||_0xfae37e['focus']();}),'click':_0x296ef5['to'](()=>{_0xfae37e['fire']('execute');})}}),_0xfae37e['on']('execute',()=>{_0xe15113['editing']['view']['focus'](),_0xe15113['commands']['execute']('aiQuickAction',_0x545391);}),_0x1b47b8['children']['add'](_0xfae37e),{'listItem':_0x1b47b8,'highlightViews':[_0xacb361,_0x6fa58a]};}{const _0x241e57=new _0x57e109(),_0x20cb74=new Nt(this['locale'],_0x241e57),_0x97810a=_0x20cb74['bindTemplate'],_0x40bcfb=_0x545391['icon']??_0x545391['parent']?.['icon'],_0x1d77ae=void 0x0!==_0x545391['icon'];return _0x20cb74['set']({'label':_0x545391['label'],'withText':!0x0,'role':'menuitem','icon':_0x1d77ae?_0x40bcfb??_0x333369:void 0x0,'tooltip':!0x1,'class':'ck-ai-quick-actions-button'}),_0x20cb74['extendTemplate']({'on':{'mouseenter':_0x97810a['to'](()=>{this['_isSearchFocused']()||_0x20cb74['focus']();})}}),_0x20cb74['on']('execute',()=>{_0xe15113['editing']['view']['focus'](),_0xe15113['commands']['execute']('aiQuickAction',_0x545391);}),_0x1b47b8['children']['add'](_0x20cb74),{'listItem':_0x1b47b8,'highlightViews':[_0x241e57]};}}['_createSearchResultActionButton'](_0x26dcfe,_0x321873,_0x2e4dda,_0x58ffda){return _0x2e4dda&&_0x58ffda?this['_createSearchResultGroupedActionButton'](_0x26dcfe,_0x321873,_0x2e4dda,_0x58ffda):this['_createSearchResultIndividualActionButton'](_0x26dcfe,_0x321873);}['_createSearchResultGroupedActionButton'](_0xd1f998,_0x923f31,_0x354da1,_0x2dcd2b){const _0x2e9067=new Ht(this['locale']),_0x25319c=new Nt(this['locale']),_0x5892e3=_0x25319c['bindTemplate'],{view:_0x4f7f8c,highlightView:_0x50f21e}=this['_createSearchResultGroupRow'](_0x354da1,_0x2dcd2b),{view:_0x1a24bd,highlightView:_0x41f78f}=this['_createSearchResultActionRow'](_0x923f31['label']),_0x39424b=this['_createSearchResultContentView'](_0x4f7f8c,_0x1a24bd);return _0x25319c['set']({'label':_0x923f31['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}),_0x25319c['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':[_0x39424b],'on':{'mouseenter':_0x5892e3['to'](()=>{this['_isSearchFocused']()||_0x25319c['focus']();}),'click':_0x5892e3['to'](()=>{this['_handleSearchResultButtonClick'](_0x25319c);})}}),this['_setupActionButtonExecution'](_0x25319c,_0xd1f998,_0x923f31),_0x2e9067['children']['add'](_0x25319c),{'listItem':_0x2e9067,'highlightViews':[_0x50f21e,_0x41f78f]};}['_createSearchResultIndividualActionButton'](_0x4eb37f,_0x57c0b4){const _0x51ab66=new Ht(this['locale']),_0x270359=new _0x57e109(),_0x31926a=new Nt(this['locale'],_0x270359),_0x1aa350=_0x31926a['bindTemplate'];return _0x31926a['set']({'label':_0x57c0b4['label'],'withText':!0x0,'role':'menuitem','icon':void 0x0,'tooltip':!0x1,'class':'ck-ai-quick-actions-button\x20ck-ai-quick-actions-search-result-button'}),_0x31926a['extendTemplate']({'on':{'mouseenter':_0x1aa350['to'](()=>{this['_isSearchFocused']()||_0x31926a['focus']();})}}),this['_setupActionButtonExecution'](_0x31926a,_0x4eb37f,_0x57c0b4),_0x51ab66['children']['add'](_0x31926a),{'listItem':_0x51ab66,'highlightViews':[_0x270359]};}['_createSearchResultGroupRow'](_0x1a1a87,_0x457c50){const _0x43d28c=new vt(this['locale']),_0x2a6efd=new xt();_0x2a6efd['content']=_0x457c50,_0x2a6efd['extendTemplate']({'attributes':{'class':'ck-ai-quick-actions-button__group-icon'}});const _0x8f99b6=new _0x2605e7();return _0x8f99b6['text']=_0x1a1a87,_0x43d28c['setTemplate']({'tag':'div','attributes':{'class':'ck-ai-quick-actions-search-result__group-row'},'children':[_0x2a6efd,_0x8f99b6]}),{'view':_0x43d28c,'highlightView':_0x8f99b6};}['_createSearchResultActionRow'](_0x123e3d){const _0x31bc10=new vt(this['locale']),_0x3054c6=new _0x2605e7();return _0x3054c6['text']=_0x123e3d,_0x31bc10['setTemplate']({'tag':'div','attributes':{'class':'ck-ai-quick-actions-search-result__action-row'},'children':[_0x3054c6]}),{'view':_0x31bc10,'highlightView':_0x3054c6};}['_createSearchResultContentView'](_0x14a206,_0x55b064){const _0x509c89=new vt(this['locale']);return _0x509c89['setTemplate']({'tag':'div','attributes':{'class':'ck-ai-quick-actions-search-result__content'},'children':[_0x14a206,_0x55b064]}),_0x509c89;}['_setupActionButtonExecution'](_0x9ac423,_0x1f4015,_0x1dc3e6){_0x9ac423['on']('execute',()=>{_0x1f4015['editing']['view']['focus'](),_0x1f4015['commands']['execute']('aiQuickAction',_0x1dc3e6);});}['_createActionGroupButton'](_0x2e63de,_0x383012,_0x25eb75){const _0x2f2e24=new Ht(this['locale']),_0x5d72b4=new _0x57e109(),_0x325c4b=new Do(this['locale'],_0x5d72b4),_0x485274=_0x325c4b['bindTemplate'],_0x2d8651=this['_getPanelKeystroke'](_0x25eb75),_0x3877e4=this['_createGroupActionsList'](_0x2e63de,_0x383012['actions'],_0x25eb75);_0x325c4b['set']({'label':_0x383012['label'],'withText':!0x0,'role':Mo,'icon':_0x383012['icon']??_0x333369,'isEnabled':_0x383012['actions']['some'](_0x57f0cc=>_0x57f0cc['isEnabled'])}),_0x325c4b['extendTemplate']({'on':{'mouseenter':_0x485274['to'](()=>{this['_isSearchFocused']()||_0x325c4b['focus']();})}});const _0xe6d9b=new Xt(this['locale']);return _0xe6d9b['extendTemplate']({'attributes':{'class':['ck','ck-reset_all','ck-ai-quick-actions-group-panel','ck-dropdown-menu__nested-menu__panel']},'on':{'keydown':_0x485274['to'](_0x21adbc=>{this['_handlePanelKeydown'](_0x21adbc,_0x2d8651,_0x325c4b,_0xe6d9b);})}}),_0x325c4b['bind']('isOn')['to'](_0xe6d9b,'isVisible'),this['_bodyCollection']['add'](_0xe6d9b),_0xe6d9b['content']['add'](_0x3877e4),this['_setupGroupMenuBehavior'](_0x325c4b,_0xe6d9b),_0x2f2e24['children']['add'](_0x325c4b),{'listItem':_0x2f2e24,'highlightView':_0x5d72b4};}['_createGroupActionsList'](_0xcf7fe1,_0x34c2ed,_0x3e6f55){const _0x9808ae=new Dt(this['locale']);return _0x9808ae['extendTemplate']({'attributes':{'class':['ck','ck-reset_all','ck-ai-quick-actions-group-list','ck-dropdown-menu-list']}}),_0x34c2ed['forEach'](_0x1fecd0=>{const _0x244c12=new Ht(this['locale']),_0x3bcc79=Lo({'editor':_0xcf7fe1,'action':_0x1fecd0,'withText':!0x0,'withIcon':!0x1,'isInDropdown':!0x0,'shouldPreventFocus':()=>this['_isSearchFocused']()})();_0x244c12['children']['add'](_0x3bcc79),_0x3e6f55['focusTracker']['add'](_0x3bcc79),_0x9808ae['items']['add'](_0x244c12);}),_0x9808ae;}['_setupGroupMenuBehavior'](_0x5826fe,_0x1d88b2){const _0x47f354=_0x5826fe['bindTemplate'],_0x9bb12f=this['_getButtonKeystroke'](_0x5826fe);_0x5826fe['extendTemplate']({'attributes':{'class':['ck-ai-quick-actions-group-button']},'on':{'mouseenter':_0x47f354['to'](()=>{this['_showNestedPanel'](_0x1d88b2,_0x5826fe);}),'mouseleave':_0x47f354['to'](_0xf4b781=>{const _0x5ac682=_0xf4b781['relatedTarget'];this['_isMovingToNestedMenu'](_0x5ac682,_0x1d88b2)||this['_hideNestedPanel'](_0x1d88b2);}),'keydown':_0x47f354['to'](_0x72037e=>{_0x72037e['key']==_0x9bb12f&&(this['_showNestedPanel'](_0x1d88b2,_0x5826fe),_0x1d88b2['content']['get'](0x0)['focus']());})}}),_0x1d88b2['on']('render',()=>{_0x1d88b2['element']?.['addEventListener']('mouseleave',_0x4f5c24=>{const _0x306ece=_0x4f5c24['relatedTarget'];_0x5826fe['element']?.['contains'](_0x306ece)||this['_isMovingToNestedMenu'](_0x306ece,_0x1d88b2)||this['_hideNestedPanel'](_0x1d88b2);});});}['_showNestedPanel'](_0x891b06,_0x33b355){this['_openNestedPanels']['forEach'](_0x26a37e=>{_0x26a37e!==_0x891b06&&_0x26a37e['isVisible']&&_0x26a37e['hide']();}),_0x891b06['show'](),_0x891b06['pin']({'positions':[_0x29f954['eastSouth']],'target':_0x33b355['element'],'fitInViewport':!0x0}),this['_openNestedPanels']['add'](_0x891b06);}['_hideNestedPanel'](_0x59a5a2){_0x59a5a2['hide'](),this['_openNestedPanels']['delete'](_0x59a5a2);}['_hideAllNestedPanels'](){this['_openNestedPanels']['forEach'](_0x455bf1=>_0x455bf1['hide']()),this['_openNestedPanels']['clear']();}['_isMovingToNestedMenu'](_0x12305a,_0x51d14d){if(!_0x12305a)return!0x1;if(_0x51d14d['element']?.['contains'](_0x12305a))return!0x0;const _0x4e6b3e=_0x12305a;return _0x4e6b3e['closest']&&(null!==_0x4e6b3e['closest']('.ck-ai-quick-actions-group-panel')||null!==_0x4e6b3e['closest']('.ck-ai-quick-actions-group-list')||null!==_0x4e6b3e['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'](_0x2b6ca3){return'rtl'===_0x2b6ca3['locale']['uiLanguageDirection']?'ArrowRight':'ArrowLeft';}['_getButtonKeystroke'](_0x3b1d3c){return'rtl'===_0x3b1d3c['locale']['uiLanguageDirection']?'ArrowLeft':'ArrowRight';}['_handlePanelKeydown'](_0x5c600d,_0x3d5cf9,_0xd0fc28,_0xf2c2bf){_0x5c600d['key']==_0x3d5cf9&&(_0xd0fc28['focus'](),this['_hideNestedPanel'](_0xf2c2bf));}['_handleSearchResultButtonClick'](_0x3debe8){_0x3debe8['fire']('execute');}}function Vo(_0x5a6614){const {editor:_0x561b81,content:_0x1dde23,buttonDefinition:_0x2ad247,bodyCollection:_0x13906f,hasSearch:_0x423f43=!0x1}=_0x5a6614;return()=>{const _0x37b06e=_0x561b81['locale'],_0x1d489d=_0x561b81['commands']['get']('aiQuickAction'),_0x405661=Gt(_0x37b06e);_0x405661['bind']('isEnabled')['to'](_0x1d489d),_0x405661['buttonView']['set']({'icon':_0x2ad247['icon']??_0x333369,'label':_0x2ad247['label'],'tooltip':!0x0}),_0x405661['set']({'class':'ck-ai-quick-actions-dropdown'});const _0x23afbd=new Uo(_0x561b81,_0x1dde23,_0x405661,_0x13906f,_0x423f43);return _0x405661['panelView']['children']['add'](_0x23afbd),_0x423f43&&_0x405661['on']('change:isOpen',(_0x5bb2a2,_0x584dc5,_0x407a6c)=>{if(_0x407a6c){if(_0x561b81['plugins']['has']('AIEditing')){const _0x4f05e1=_0x561b81['plugins']['get'](Js),_0x4cd8e1=_0x561b81['model']['document']['selection'],_0x5084ff=Array['from'](_0x4cd8e1['getRanges']());_0x5084ff['length']>0x0&&_0x4f05e1['showFakeVisualSelection']({'ranges':_0x5084ff,'id':'quick-action','priority':0x14});}}else _0x561b81['plugins']['has']('AIEditing')&&_0x561b81['plugins']['get'](Js)['hideFakeVisualSelection']('quick-action'),_0x23afbd['resetSearch']();}),_0x405661;};}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 _0x45b757{static get['requires'](){return[_0x133ffc,as];}static get['pluginName'](){return'AIQuickActionsUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}async['init'](){const _0x30fb3b=await this['_getDefaultAndCustomActions']();this['_prepareQuickActionsDefinition'](_0x30fb3b),this['_initializeQuickActionsComponentsAndCommands']();}static['getDefaultQuickActions'](_0x16ad97){return function(_0x423bcd){const _0x1689fd=new Intl['DisplayNames'](['en'],{'type':'language'})['of'](_0x423bcd['uiLanguage']),_0x1fe361=_0x1689fd||'English',_0xf96f1a=[{'id':'ask-ai','label':hs(_0x423bcd,'AI_QUICK_ACTIONS_ASK_AI'),'type':'chat','icon':_0x2da0aa},{'id':'chat-commands','label':hs(_0x423bcd,'AI_QUICK_ACTIONS_CHAT_COMMANDS'),'icon':_0x2da0aa,'actions':[{'id':'explain','label':hs(_0x423bcd,'AI_QUICK_ACTIONS_EXPLAIN'),'displayedPrompt':hs(_0x423bcd,'AI_QUICK_ACTIONS_EXPLAIN'),'prompt':Bo['replace']('%0',_0x1fe361),'type':'chat'},{'id':'summarize','label':hs(_0x423bcd,'AI_QUICK_ACTIONS_SUMMARIZE'),'displayedPrompt':hs(_0x423bcd,'AI_QUICK_ACTIONS_SUMMARIZE'),'prompt':Go['replace']('%0',_0x1fe361),'type':'chat'},{'id':'highlight-key-points','label':hs(_0x423bcd,'AI_QUICK_ACTIONS_HIGHLIGHT_KEY_POINTS'),'displayedPrompt':hs(_0x423bcd,'AI_QUICK_ACTIONS_HIGHLIGHT_KEY_POINTS'),'prompt':Fo['replace']('%0',_0x1fe361),'type':'chat'}]},{'id':'improve-writing','label':hs(_0x423bcd,'AI_QUICK_ACTIONS_IMPROVE_WRITING'),'type':'action','icon':_0x24316d},{'id':'continue','label':hs(_0x423bcd,'AI_QUICK_ACTIONS_CONTINUE_WRITING'),'type':'action','icon':_0x274a46},{'id':'fix-grammar','label':hs(_0x423bcd,'AI_QUICK_ACTIONS_FIX_GRAMMAR_SPELLING'),'type':'action','icon':_0x1a128e},{'id':'adjust-length','label':hs(_0x423bcd,'AI_QUICK_ACTIONS_ADJUST_LENGTH'),'icon':_0x4614f1,'actions':[{'id':'make-shorter','label':hs(_0x423bcd,'AI_QUICK_ACTIONS_MAKE_SHORTER'),'type':'action'},{'id':'make-longer','label':hs(_0x423bcd,'AI_QUICK_ACTIONS_MAKE_LONGER'),'type':'action'}]},{'id':'change-tone','label':hs(_0x423bcd,'AI_QUICK_ACTIONS_CHANGE_TONE'),'icon':_0x170479,'actions':[{'id':'make-tone-casual','label':hs(_0x423bcd,'AI_QUICK_ACTIONS_MORE_CASUAL'),'type':'action'},{'id':'make-tone-direct','label':hs(_0x423bcd,'AI_QUICK_ACTIONS_MORE_DIRECT'),'type':'action'},{'id':'make-tone-friendly','label':hs(_0x423bcd,'AI_QUICK_ACTIONS_MORE_FRIENDLY'),'type':'action'},{'id':'make-tone-confident','label':hs(_0x423bcd,'AI_QUICK_ACTIONS_MORE_CONFIDENT'),'type':'action'},{'id':'make-tone-professional','label':hs(_0x423bcd,'AI_QUICK_ACTIONS_MORE_PROFESSIONAL'),'type':'action'}]},{'id':'translate','label':hs(_0x423bcd,'AI_QUICK_ACTIONS_TRANSLATE'),'icon':_0x5a40c9,'actions':[{'id':'translate-to-english','label':hs(_0x423bcd,'AI_QUICK_ACTIONS_TRANSLATE_ENGLISH'),'type':'action','actionName':'translate','args':{'language':'english'}},{'id':'translate-to-chinese','label':hs(_0x423bcd,'AI_QUICK_ACTIONS_TRANSLATE_CHINESE'),'type':'action','actionName':'translate','args':{'language':'chinese'}},{'id':'translate-to-spanish','label':hs(_0x423bcd,'AI_QUICK_ACTIONS_TRANSLATE_SPANISH'),'type':'action','actionName':'translate','args':{'language':'spanish'}},{'id':'translate-to-german','label':hs(_0x423bcd,'AI_QUICK_ACTIONS_TRANSLATE_GERMAN'),'type':'action','actionName':'translate','args':{'language':'german'}},{'id':'translate-to-french','label':hs(_0x423bcd,'AI_QUICK_ACTIONS_TRANSLATE_FRENCH'),'type':'action','actionName':'translate','args':{'language':'french'}},{'id':'translate-to-japanese','label':hs(_0x423bcd,'AI_QUICK_ACTIONS_TRANSLATE_JAPANESE'),'type':'action','actionName':'translate','args':{'language':'japanese'}},{'id':'translate-to-portuguese','label':hs(_0x423bcd,'AI_QUICK_ACTIONS_TRANSLATE_PORTUGUESE'),'type':'action','actionName':'translate','args':{'language':'portuguese'}},{'id':'translate-to-korean','label':hs(_0x423bcd,'AI_QUICK_ACTIONS_TRANSLATE_KOREAN'),'type':'action','actionName':'translate','args':{'language':'korean'}},{'id':'translate-to-italian','label':hs(_0x423bcd,'AI_QUICK_ACTIONS_TRANSLATE_ITALIAN'),'type':'action','actionName':'translate','args':{'language':'italian'}},{'id':'translate-to-russian','label':hs(_0x423bcd,'AI_QUICK_ACTIONS_TRANSLATE_RUSSIAN'),'type':'action','actionName':'translate','args':{'language':'russian'}}]},{'id':'other','label':hs(_0x423bcd,'AI_QUICK_ACTIONS_OTHER'),'icon':_0xf3943c,'actions':[]}];return _0xf96f1a;}(_0x16ad97);}async['_getDefaultAndCustomActions'](){const _0x102628=Wo['getDefaultQuickActions'](this['editor']['locale']),_0x491660=this['editor']['config']['get']('ai.quickActions.extraCommands')||[];let _0x435403,_0x3957c2=[];try{const _0x1a9b48=new Fs({'connector':this['editor']['plugins']['get']('AIConnector'),'config':this['editor']['config']['get']('ai.models'),'locale':this['editor']['locale']});_0x3957c2=await _0x1a9b48['getAll'](),_0x435403=(await _0x1a9b48['getDefault']())?.['id'];}catch(_0x30a2b0){const _0x307c64=new at('ai-quick-actions-models-unable-to-retrieve',this,{'error':_0x30a2b0});Et(_0x307c64['message']);}finally{const _0x27ebc8=_0x491660['map'](_0x5b9730=>({..._0x5b9730,'type':'chat'===_0x5b9730['type']?'chat':'action','model':'chat'!==_0x5b9730['type']?_0x5b9730['model']||_0x435403:_0x5b9730['model'],'icon':void 0x0}));_0x102628['find'](_0x4e4805=>'other'===_0x4e4805['id'])['actions']['push'](..._0x27ebc8),_0x102628['forEach'](_0x1e3661=>{if('actions'in _0x1e3661)_0x1e3661['actions']['forEach'](_0x3cc29e=>{if(_0x3cc29e['isEnabled']=!!_0x3957c2['find'](_0xda4ff9=>_0xda4ff9['id']===_0x3cc29e['model'])||void 0x0===_0x3cc29e['model'],!_0x3cc29e['isEnabled']){const _0x5e7c8d=new at('ai-quick-actions-unavailable-model',this,{'actionId':_0x3cc29e['id'],'modelId':_0x3cc29e['model']});Et(_0x5e7c8d['message']);}});else{if(_0x1e3661['isEnabled']=!!_0x3957c2['find'](_0x418fe5=>_0x418fe5['id']===_0x1e3661['model'])||void 0x0===_0x1e3661['model'],!_0x1e3661['isEnabled']){const _0x5b5248=new at('ai-quick-actions-unavailable-model',this,{'actionId':_0x1e3661['id'],'modelId':_0x1e3661['model']});Et(_0x5b5248['message']);}}});}return _0x102628;}['_initializeQuickActionsComponentsAndCommands'](){const _0x1e7493=new Qt(this['editor']['locale']);_0x1e7493['attachToDom'](),this['_initializeQuickActionsDropdown'](_0x1e7493),this['_initializeQuickActionsMenuBar'](),this['_initializeQuickActionsComponents'](_0x1e7493);}['_initializeQuickActionsDropdown'](_0x1373d6){const _0x1654a2=this['editor']['config']['get']('ai.quickActions.isSearchEnabled')??!0x0;this['editor']['ui']['componentFactory']['add']('aiQuickActions',Vo({'editor':this['editor'],'content':this['_quickActionsDefinition'],'buttonDefinition':{'icon':_0x333369,'label':hs(this['editor']['locale'],'AI_QUICK_ACTIONS_HEADING')},'bodyCollection':_0x1373d6,'hasSearch':_0x1654a2}));}['_prepareQuickActionsDefinition'](_0x14fbd5){this['_quickActionsDefinition']=_0x14fbd5['map'](_0x3e1ebe=>{if('actions'in _0x3e1ebe){const _0x1678fe=_0x3e1ebe;return{..._0x1678fe,'actions':_0x1678fe['actions']['map'](_0x131659=>{const {actions:_0x5b7183,..._0x2fde11}=_0x1678fe;return{..._0x131659,'parent':_0x2fde11};})['filter'](_0x218428=>this['_shouldIncludeAction'](_0x218428))};}return _0x3e1ebe;})['filter'](_0xb238da=>'actions'in _0xb238da?_0xb238da['actions']['length']>0x0:this['_shouldIncludeAction'](_0xb238da));}['_shouldIncludeAction'](_0x3cd12a){const _0x2ddf31=this['editor']['config']['get']('ai.quickActions.removeCommands')||[];return this['editor']['plugins']['has'](Ko[_0x3cd12a['type']])&&!_0x2ddf31['includes'](_0x3cd12a['id'])&&!('chat'===_0x3cd12a['type']&&!0x1===this['editor']['config']['get']('ai.chat.context.document.enabled'));}['_initializeQuickActionsComponents'](_0xd7549f){this['_quickActionsDefinition']['forEach'](_0x1f024c=>{if('actions'in _0x1f024c){const _0x5e8100=Vo({'editor':this['editor'],'content':_0x1f024c['actions'],'buttonDefinition':_0x1f024c,'bodyCollection':_0xd7549f});this['editor']['ui']['componentFactory']['add'](_0x1f024c['id'],_0x5e8100),_0x1f024c['actions']['forEach'](_0x4df99d=>{const _0x39ae22=Lo({'editor':this['editor'],'action':_0x4df99d});this['editor']['ui']['componentFactory']['add'](_0x4df99d['id'],_0x39ae22);});}else{const _0x23dda2=Lo({'editor':this['editor'],'action':_0x1f024c,'withText':!0x1,'withIcon':!0x0,'isInDropdown':!0x1});this['editor']['ui']['componentFactory']['add'](_0x1f024c['id'],_0x23dda2);}});}['_initializeQuickActionsMenuBar'](){this['editor']['ui']['componentFactory']['add']('menuBar:aiQuickActions',_0x5aa998=>{const _0x1e05a9=this['editor']['commands']['get']('aiQuickAction'),_0x1119a3=new Kt(_0x5aa998),_0x42b9f8=hs(_0x5aa998,'AI_QUICK_ACTIONS_HEADING');_0x1119a3['buttonView']['set']({'label':_0x42b9f8,'icon':_0x333369});const _0x51725a=new $t(_0x5aa998);return _0x51725a['set']({'ariaLabel':_0x42b9f8,'role':'menu'}),this['_quickActionsDefinition']['forEach'](_0xbee99a=>{if('actions'in _0xbee99a){const _0x219a8b=_0xbee99a,_0x51f7b0=new qt(_0x5aa998,_0x1119a3),_0x6c7a48=new Kt(_0x5aa998),_0x2ba699=new $t(_0x5aa998);_0x6c7a48['buttonView']['set']({'label':_0x219a8b['label'],'icon':_0x219a8b['icon']}),_0x219a8b['actions']['forEach'](_0x2b43a5=>{const _0x54624d=new qt(_0x5aa998,_0x6c7a48),_0x334abf=new Wt(_0x5aa998);_0x334abf['set']({'label':_0x2b43a5['label'],'icon':_0x2b43a5['icon'],'role':'menuitem','isEnabled':_0x2b43a5['isEnabled']}),_0x334abf['on']('execute',()=>{this['_executeQuickAction'](_0x2b43a5);}),_0x334abf['delegate']('execute')['to'](_0x6c7a48),_0x54624d['children']['add'](_0x334abf),_0x2ba699['items']['add'](_0x54624d);}),_0x6c7a48['panelView']['children']['add'](_0x2ba699),_0x51f7b0['children']['add'](_0x6c7a48),_0x51725a['items']['add'](_0x51f7b0);}else{const _0x3ee4e7=_0xbee99a,_0x39e541=new qt(_0x5aa998,_0x1119a3),_0x16261b=new Wt(_0x5aa998);_0x16261b['set']({'label':_0x3ee4e7['label'],'icon':_0x3ee4e7['icon'],'role':'menuitem','isEnabled':_0x3ee4e7['isEnabled']}),_0x16261b['on']('execute',()=>{this['_executeQuickAction'](_0x3ee4e7);}),_0x16261b['delegate']('execute')['to'](_0x1119a3),_0x39e541['children']['add'](_0x16261b),_0x51725a['items']['add'](_0x39e541);}}),(Object['values'](Ko)['some'](_0x32d26b=>this['editor']['plugins']['has'](_0x32d26b))?_0x1119a3['bind']('isEnabled')['to'](_0x1e05a9):_0x1119a3['set']({'isEnabled':!0x1}),_0x1119a3['panelView']['children']['add'](_0x51725a),_0x1119a3);});}['_executeQuickAction'](_0x2da617){const _0x5c09d4=this['editor'];_0x5c09d4['editing']['view']['focus'](),_0x5c09d4['commands']['execute']('aiQuickAction',_0x2da617);const _0x2585eb=_0x5c09d4['ui']['view']['menuBarView'];_0x2585eb&&_0x2585eb['close']&&_0x2585eb['close']();}}class Yo extends _0x65be43{['execute'](_0x54e030){switch(this['_expandSelectionIfCollapsed'](),_0x54e030['type']){case'chat':if(!this['editor']['plugins']['has']('AIChat')){const _0x38907e=hs(this['editor']['locale'],'AI_QUICK_ACTIONS_PLUGIN_NOT_FOUND','AIChat');throw new at('ai-quick-actions-plugin-not-found',this['editor'],{'errorMessage':_0x38907e});}this['_handleAIChatAction'](_0x54e030);break;case'action':if(!this['editor']['plugins']['has']('AIActions')){const _0x502089=hs(this['editor']['locale'],'AI_QUICK_ACTIONS_PLUGIN_NOT_FOUND','AIActions');throw new at('ai-quick-actions-plugin-not-found',this['editor'],{'errorMessage':_0x502089});}this['_handleAIActionsAction'](_0x54e030);}}async['_handleAIChatAction'](_0x1c8abd){const _0x548796=this['editor']['plugins']['get']('AIChatController'),_0x137774=this['editor']['plugins']['get']('AITabs')['view'];if(_0x137774['isVisible']||(_0x137774['isVisible']=!0x0),'chat'!==_0x137774['activeTab']&&_0x137774['activateTab']('chat'),'ask-ai'===_0x1c8abd['id'])_0x548796['removeSelectionFromChatContext'](),_0x548796['addSelectionToChatContext'](),_0x548796['focusPromptInput']();else await _0x548796['startConversation']({'modelId':_0x1c8abd['model']}),_0x548796['removeSelectionFromChatContext'](),_0x548796['addSelectionToChatContext'](),_0x548796['focusPromptInput'](),await _0x548796['sendMessage']({'message':_0x1c8abd['prompt']||_0x1c8abd['displayedPrompt']||_0x1c8abd['label'],'attributes':{'quickActionData':{'id':_0x1c8abd['id']},'displayedPrompt':_0x1c8abd['displayedPrompt']}});}['_expandSelectionIfCollapsed'](){const _0x1dc0a4=this['editor'],_0x129529=_0x1dc0a4['model']['document']['selection'];if(!_0x129529['isCollapsed'])return;const _0x3cfcd3=At(_0x129529['getSelectedBlocks']())||_0x1dc0a4['model']['schema']['getLimitElement'](_0x129529);_0x1dc0a4['model']['change'](_0x3aa751=>{_0x3aa751['setSelection'](_0x3cfcd3,'in');});}['_handleAIActionsActionLabel'](_0x502bc2){return _0x502bc2['parent']?.['label']&&'other'!==_0x502bc2['parent']?.['id']?_0x502bc2['parent']['label']+':\x20'+_0x502bc2['label']:_0x502bc2['label'];}async['_handleAIActionsAction'](_0x494610){const _0x3b9c87=this['editor']['plugins']['get']('AIActions'),_0x17d023=_0x494610['prompt']?{'userMessage':_0x494610['prompt'],'model':_0x494610['model']}:{'actionName':_0x494610['actionName']||_0x494610['id'],'args':_0x494610['args']},_0x32ef99=this['_handleAIActionsActionLabel'](_0x494610);await _0x3b9c87['executeAction'](_0x17d023,_0x32ef99,_0x494610['icon']);}}class $o extends _0x45b757{static get['pluginName'](){return'AIQuickActionsEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const _0x3219dc=this['editor'],_0x561688=new Yo(this['editor']);if(_0x3219dc['commands']['add']('aiQuickAction',_0x561688),_0x3219dc['plugins']['has']('AIChat')){const _0x2df5c7=this['editor']['plugins']['get']('AIChatController');_0x3219dc['model']['document']['selection']['on']('change:range',(_0x4efd71,_0x1c71d1)=>{_0x1c71d1['directChange']&&_0x2df5c7['removeSelectionFromChatContext']();});}}}class qo extends xs{['updateChangeGroups'](){if(this['parsedMergedContent']=this['parsedContent']['cloneNode'](!0x0),0x0==this['parsedMergedContent']['childNodes']['length'])return void(this['changeGroups']=[]);const _0xad46dc=this['documentContextContent']['children']['map'](_0x120664=>({'node':_0x120664,'id':Es(_0x120664,'data-id')})),_0xbe385b=this['parsedMergedContent']['children']['map'](_0x2c2416=>({'node':_0x2c2416,'id':Es(_0x2c2416,'data-id')||ot()})),_0x3bdfc5=_0xb989b2(_0xad46dc,_0xbe385b,{'comparator':(_0x5773ee,_0x1c778b)=>_0x5773ee['id']==_0x1c778b['id'],'oneChangePerToken':!0x0});if(!this['isDone']||!this['isComplete']){for(;_0x3bdfc5['length']&&_0x3bdfc5[_0x3bdfc5['length']-0x1]['removed'];)_0x3bdfc5['pop']();}const _0x3faf91=_0x3bdfc5['map'](_0x4fdeb9=>{const _0x4617d6=_0x4fdeb9['added']?'new':_0x4fdeb9['removed']?'removed':'modified';return{'node':_0x4fdeb9['value'][0x0]['node'],'type':_0x4617d6,'id':_0x4fdeb9['value'][0x0]['id']};});this['changeGroups']=[{'changes':_0x3faf91,'state':'pending','index':0x0}];}['_getDifferentChangeGroups'](_0x20f2a7,_0x509465){return _0x509465;}}class Qo extends Ds{['content'];['version'];['actionName'];['args'];['userMessage'];['model'];['hasError']=!0x1;['stoppedExplicitly']=!0x1;constructor(_0x2007a2){super(_0x2007a2),this['content']=_0x2007a2['content'],this['version']=_0x2007a2['version'],this['actionName']=_0x2007a2['actionName'],this['args']=_0x2007a2['args'],this['userMessage']=_0x2007a2['userMessage'],this['model']=_0x2007a2['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'](_0x177ab3){const _0x3d1140=new qo({'locale':this['locale'],'documentContextContent':this['content'],..._0x177ab3});return this['replies']['push'](_0x3d1140),_0x3d1140['delegate'](...Ls)['to'](this),this['fire']('replyCreated',_0x3d1140),_0x3d1140;}}class Xo extends kt{constructor(_0x43bf6f,_0x4e157e=!0x0,_0x477c57=!0x0){super(_0x43bf6f),this['set']('isEnabled',!0x1),_0x4e157e&&(this['applyButton']=this['_createButton'](hs(_0x43bf6f,'AI_BALLOON_APPLY_BUTTON'),cs),this['applyButton']['bind']('isEnabled')['to'](this),this['items']['add'](this['applyButton'])),_0x477c57&&(this['suggestButton']=this['_createButton'](hs(_0x43bf6f,'AI_BALLOON_SUGGEST_BUTTON'),_0x4e157e?ls:cs),this['suggestButton']['bind']('isEnabled')['to'](this),this['items']['add'](this['suggestButton'])),this['setButtonsVisibility']({'showApplyButton':_0x4e157e,'showSuggestButton':_0x477c57}),this['extendTemplate']({'attributes':{'class':['ck-ai-balloon__toolbar']}});}['setButtonsVisibility']({showApplyButton:_0x4dee50,showSuggestButton:_0x296c62}){this['applyButton']&&(this['applyButton']['isVisible']=_0x4dee50),this['suggestButton']&&(this['suggestButton']['isVisible']=_0x296c62);}['_createButton'](_0x3ef09a,_0x462806){const _0x10d793=new Nt(this['locale']);return _0x10d793['set']({'label':_0x3ef09a,'class':_0x462806,'isVisible':!0x0,'withText':!0x0}),_0x10d793;}}class zo extends vt{constructor(_0x25ee31){super(_0x25ee31),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(_0x25ee31,'AI_DISCLAIMER_TEXT')}]}]});}}class jo extends vt{constructor(_0x47191d){super(_0x47191d),this['set']('isVisible',!0x0);const _0x19cb21=new yn('small');_0x19cb21['isVisible']=!0x0;const _0x26977c=new vt(this['locale']);_0x26977c['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',_0x550be2=>!_0x550be2)]},'children':[_0x19cb21,_0x26977c]});}}class Jo extends So{['focusCycler'];['_config'];['_contentWrapper'];['_streamableContentView'];['_toolbarView'];['_miniToolbarView'];['_loaderView'];['_disclaimerView'];['_focusTracker'];['_keystrokes'];['_dialogContent'];['_focusables'];['_scrollManager'];['_navigationPreviousButton'];['_navigationNextButton'];['_navigationTryAgainButton'];['_navigationCounter'];constructor(_0x3b71f9,_0x158473){super(_0x3b71f9),this['set']('isBusy',!0x1),this['set']('isTrackChangesOn',!0x1),this['set']('_isLoading',!0x1),this['set']('_hasError',!0x1),this['_config']=_0x158473,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 _0x19e880(),this['_addContentWrapper'](_0x158473),this['_addDisclaimerView'](),this['_addToolbar'](_0x158473),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'](_0x158473);});}['render'](){super['render']();for(const _0x54e909 of this['_focusables'])this['_focusTracker']['add'](_0x54e909['element']);this['_keystrokes']['listenTo'](this['element']),this['_initializeScrollManager']();}['destroy'](){super['destroy'](),this['_scrollManager']&&this['_scrollManager']['destroy']();}['focus'](_0x1c0551){-0x1===_0x1c0551?this['focusCycler']['focusLast']():this['focusCycler']['focusFirst']();}['setIsLoading'](_0x359c69){this['_isLoading']=_0x359c69;}['setErrorState'](){this['_hasError']=!0x0,this['_miniToolbarView']['toggleShowChangesEnabled'](!0x1);}['clearErrorState'](){this['_hasError']=!0x1,this['_miniToolbarView']['toggleShowChangesEnabled'](!0x0);}['showError'](_0x2d45fb){super['showError'](_0x2d45fb),this['_dialogContent']['has'](this['_errorView'])||this['_dialogContent']['add'](this['_errorView'],0x0);}['hideError'](){super['hideError'](),this['clearErrorState']();}['showBlockingError'](_0x5d6c8c){super['showBlockingError'](_0x5d6c8c),this['setErrorState']();}['addMiniToolbarItem'](_0x14b702){this['_miniToolbarView']['items']['has'](_0x14b702)||this['_miniToolbarView']['items']['add'](_0x14b702);}['removeMiniToolbarItem'](_0x1a7580){this['_miniToolbarView']['items']['has'](_0x1a7580)&&this['_miniToolbarView']['items']['remove'](_0x1a7580);}['showLoader'](){this['_loaderView']&&(this['_isLoading']=!0x0);}['hideLoader'](){this['_loaderView']&&(this['_isLoading']=!0x1);}['_toggleToolbarButtonsVisibility']({showApplyButton:_0x2ca5b0,showSuggestButton:_0xa7a9ff}){_0x2ca5b0=_0x2ca5b0&&!this['isTrackChangesOn']&&this['_config']['availableActions']['includes']('applySuggestion'),_0xa7a9ff=_0xa7a9ff&&this['_config']['availableActions']['includes']('insertSuggestion'),this['_toolbarView']['setButtonsVisibility']({'showApplyButton':_0x2ca5b0,'showSuggestButton':_0xa7a9ff});}async['updateContent'](_0x4e5ce3){await this['_streamableContentView']['update'](_0x4e5ce3);}['clearContent'](){this['_streamableContentView']['clear']();}['_addContentWrapper'](_0x5999e6){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'](_0x5999e6['miniToolbarConfig'])]}),this['_dialogContent']['add'](this['_contentWrapper']);}['_addDisclaimerView'](){this['_disclaimerView']=new zo(this['locale']),this['_dialogContent']['add'](this['_disclaimerView']);}['_addToolbar']({showApplyButton:_0x33d018,showSuggestButton:_0x28dbfc}){this['_toolbarView']=new Xo(this['locale'],_0x33d018,_0x28dbfc),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',(_0x125409,_0x1f98a4,_0x2e2416)=>!(_0x125409||_0x1f98a4||_0x2e2416)),this['_toggleToolbarButtonsVisibility']({'showApplyButton':_0x33d018,'showSuggestButton':_0x28dbfc}),this['_dialogContent']['add'](this['_toolbarView']);}['_createMiniToolbar'](_0x4b27bb){return this['_miniToolbarView']=new ko(this['locale'],_0x4b27bb),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',(_0x912cc,_0x48b794)=>!(_0x912cc||_0x48b794)),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 _0xf20d3e=new Nt(this['locale']),_0x567735=new Nt(this['locale']),_0x3fbf59=new Zo(this['locale']),_0x5a9a5a=new Nt(this['locale']);_0xf20d3e['set']({'icon':tt,'label':hs(this['locale'],'AI_ACTIONS_TRY_AGAIN'),'tooltip':!0x0,'class':'ck-ai-custom-action-button\x20'+us}),_0x567735['set']({'icon':_0x2d0d1e,'tooltip':hs(this['locale'],'AI_ACTIONS_PREVIOUS_INTERACTION'),'class':'ck-ai-navigation-button\x20ck-ai-previous-button\x20'+us}),_0x5a9a5a['set']({'icon':et,'tooltip':hs(this['locale'],'AI_ACTIONS_NEXT_INTERACTION'),'class':'ck-ai-navigation-button\x20ck-ai-next-button\x20'+us}),_0xf20d3e['bind']('isEnabled')['to'](this,'isBusy',_0x330718=>!_0x330718),_0xf20d3e['on']('execute',()=>{this['fire']('tryAgain');}),_0x567735['bind']('isEnabled')['to'](this,'isBusy',_0x34b357=>!_0x34b357),_0x567735['on']('execute',()=>{this['fire']('showPrevious');}),_0x5a9a5a['bind']('isEnabled')['to'](this,'isBusy',_0x238c75=>!_0x238c75),_0x5a9a5a['on']('execute',()=>{this['fire']('showNext');}),this['_navigationPreviousButton']=_0x567735,this['_navigationCounter']=_0x3fbf59,this['_navigationNextButton']=_0x5a9a5a,this['_navigationTryAgainButton']=_0xf20d3e;}['updateMiniToolbarButtons'](_0x1731b6,_0x4c47ca){this['_navigationPreviousButton']||this['_setupMiniToolbarButtons']();const _0x439cf4=_0x1731b6>0x1;if(this['addMiniToolbarItem'](this['_navigationTryAgainButton']),_0x439cf4){this['addMiniToolbarItem'](this['_navigationPreviousButton']),this['addMiniToolbarItem'](this['_navigationCounter']),this['addMiniToolbarItem'](this['_navigationNextButton']);const _0x58fbbc=_0x1731b6-_0x4c47ca;this['_navigationCounter']['setInteractionCount'](_0x58fbbc+'/'+_0x1731b6),this['_navigationPreviousButton']['isEnabled']=_0x4c47ca<_0x1731b6-0x1,this['_navigationNextButton']['isEnabled']=_0x4c47ca>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'](_0x337dec){this['_isLoading']=_0x337dec;}['resetShowChangesButton'](){this['_miniToolbarView']['isShowChangesOn']=!0x1;}['_initializeScrollManager'](){const _0x4578bd=this['_getScrollableElement']();_0x4578bd&&!this['_scrollManager']&&(this['_scrollManager']=new sr(_0x4578bd));}['_getScrollableElement'](){return this['_streamableContentView']['element'];}}class Zo extends vt{constructor(_0x544b34){super(_0x544b34);const _0x1a9c64=this['bindTemplate'];this['set']('interactionCount','1/1'),this['setTemplate']({'tag':'span','attributes':{'class':['ck-ai-interaction-counter']},'children':[{'text':_0x1a9c64['to']('interactionCount')}]});}['setInteractionCount'](_0x2942ab){this['set']('interactionCount',_0x2942ab);}}class ta extends _0x45b757{static get['requires'](){return[as,Bt,Js,Oo,_0x10431c];}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(_0x22baa2){super(_0x22baa2),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'](_0x34fec6,_0x4eb0f2,_0x123611){if(this['_stopInteraction'](),this['editor']['plugins']['has']('TableSelection')){if(this['editor']['plugins']['get']('TableSelection')['getSelectedTableCells']()){const {modelFragment:_0xa1ae89,anchorData:_0x194716,root:_0x5e30ed}=this['_getExecuteDataInTable']();return this['_executeAction'](_0x34fec6,_0xa1ae89,_0x194716,_0x5e30ed,_0x4eb0f2,_0x123611);}}const {modelFragment:_0x52c894,anchorData:_0x2409da,root:_0x4f17e0}=this['_getExecuteDataRegular']();return this['_executeAction'](_0x34fec6,_0x52c894,_0x2409da,_0x4f17e0,_0x4eb0f2,_0x123611);}async['destroy'](){return this['_stopInteraction'](),this['_bodyCollection']['detachFromDom'](),super['destroy']();}['_createActionsBalloonView'](){const _0x278e1d=this['editor']['plugins']['has']('TrackChanges');let _0x29f87c=this['editor']['config']['get']('ai.availableReplyActions')||[...fn];_0x278e1d||(_0x29f87c=_0x29f87c['filter'](_0x436150=>'insertSuggestion'!=_0x436150));const _0x45fc4c=this['editor']['commands']['get']('trackChanges'),_0x4a63b5=new Jo(this['editor']['locale'],{'showApplyButton':!0x0,'showSuggestButton':_0x278e1d,'miniToolbarConfig':{'showChanges':'icon'},'availableActions':_0x29f87c});return _0x4a63b5['bind']('isBusy')['to'](this),_0x45fc4c&&_0x4a63b5['bind']('isTrackChangesOn')['to'](_0x45fc4c,'value'),_0x4a63b5['on']('tryAgain',()=>{this['_refreshInteraction']();}),_0x4a63b5['on']('showPrevious',()=>{this['_navigateToPrevious']();}),_0x4a63b5['on']('showNext',()=>{this['_navigateToNext']();}),_0x4a63b5;}['_getExecuteDataRegular'](){const _0x2e7005=this['editor']['model']['document']['selection'],_0x194d99=_0x2e7005['getFirstRange']()['start']['root'];if(_0x2e7005['isCollapsed']){const _0x2b1219=At(_0x2e7005['getSelectedBlocks']())||this['editor']['model']['schema']['getLimitElement'](_0x2e7005);this['editor']['model']['change'](_0x41f4a1=>{_0x41f4a1['setSelection'](_0x2b1219,'in');});}const _0x12ef64=_0x2e7005['getFirstRange'](),_0x3c44ea=this['_wrapWithCommonAncestors'](this['editor']['model']['getSelectedContent'](_0x2e7005),_0x12ef64['start'],_0x12ef64['end']);this['_copyMarkersToFragment'](_0x3c44ea,_0x2e7005,{'isTableSelection':!0x1});const _0x25c623=_0x2e7005['getFirstRange']()['start'],_0x1263f7=new Map();let _0x1d5d23=_0x3c44ea;for(let _0x4b9faa=0x0;_0x4b9faa<_0x25c623['path']['length'];_0x4b9faa++)_0x1263f7['set'](_0x1d5d23,_0x25c623['path'][_0x4b9faa]),_0x1d5d23=_0x1d5d23['getChild'](0x0);return{'modelFragment':_0x3c44ea,'anchorData':_0x1263f7,'root':_0x194d99};}['_getExecuteDataInTable'](){const _0x1ee720=this['editor']['model']['document']['selection'],_0x336ad7=this['editor']['plugins']['get']('TableSelection'),_0x194643=_0x1ee720['getFirstRange']()['start']['root'],_0x3b7307=_0x336ad7['getSelectionAsFragment'](),_0x3f16ba=_0x1ee720['getFirstRange']()['start']['parent']['parent'],_0x2b3b96=this['editor']['model']['createRange'](this['editor']['model']['createPositionBefore'](_0x3f16ba),this['editor']['model']['createPositionAfter'](_0x3f16ba)),_0x52ff24=this['_wrapWithCommonAncestors'](_0x3b7307,_0x2b3b96['start'],_0x2b3b96['end']);this['_copyMarkersToFragment'](_0x52ff24,_0x1ee720,{'isTableSelection':!0x0});const _0x3c1a73=_0x1ee720['getFirstRange']()['start'],_0x12ac7a=new Map();let _0x1a9024=_0x52ff24;for(let _0x36e211=0x0;_0x36e211<_0x3c1a73['path']['length'];_0x36e211++)if(_0x12ac7a['set'](_0x1a9024,_0x3c1a73['path'][_0x36e211]),_0x36e211<_0x3c1a73['path']['length']-0x1)_0x1a9024=_0x1a9024['getChild'](0x0);else{let _0x341445=_0x1a9024['nextSibling'];for(;_0x341445;)_0x12ac7a['set'](_0x341445,_0x3c1a73['path'][_0x36e211]),_0x341445=_0x341445['nextSibling'];}return{'modelFragment':_0x52ff24,'anchorData':_0x12ac7a,'root':_0x194643};}async['_executeAction'](_0x33a021,_0x45bd55,_0xf1e660,_0x2e1190,_0x1a02a9,_0x2ad76a){const _0x23f526=this['editor']['plugins']['get'](Js),_0x3eb6b9=this['editor']['plugins']['get'](Oo),_0x20e5b2=this['editor']['model']['document']['selection'],_0x17babf=await _0x23f526['modelToDataWithIds'](_0x45bd55),_0x47951c=this['editor']['model']['document']['version'],_0x11c2e9=[..._0x20e5b2['getRanges']()];return this['_actionsBalloonView']||(this['_actionsBalloonView']=this['_createActionsBalloonView']()),this['_clearInteractionHistory'](),this['_clearErrorState'](),this['_balloonShowDiff']=!0x1,this['_actionsBalloonView']['resetShowChangesButton'](),this['_actionsBalloonView']['clearContent'](),_0x3eb6b9['open']({'index':0x3e8*Math['random']()%0x3e8,'title':_0x1a02a9,'icon':_0x2ad76a||_0x333369,'mainView':this['_actionsBalloonView'],'class':'ck-ai-actions-balloon','ranges':_0x11c2e9,'id':'aiActionsBalloon'}),this['_setLoadingState'](),this['stopListening'](this['_actionsBalloonView']),this['stopListening'](_0x3eb6b9),this['_interactionParams']={'action':_0x33a021,'content':_0x17babf,'version':_0x47951c,'aiBalloon':_0x3eb6b9,'modelFragment':_0x45bd55,'anchorData':_0xf1e660,'root':_0x2e1190},this['_setupApplyListeners'](),this['listenTo'](_0x3eb6b9,'selectionRemoved',()=>{this['_stopInteraction'](),this['_actionsBalloonView']['disableMiniToolbarButtons']();}),this['listenTo'](_0x3eb6b9,'dialogClosed',(_0x49f0e2,{id:_0x158667})=>{if('aiActionsBalloon'===_0x158667){for(const _0x1c95b3 of this['_interactions']){if(0x0===_0x1c95b3['replies']['length']||_0x1c95b3['stoppedExplicitly'])continue;const _0x3fe41a=_0x1c95b3['replies'][_0x1c95b3['replies']['length']-0x1],_0x349a26=_0x3fe41a['changeGroups'][0x0];_0x349a26&&'pending'===_0x349a26['state']&&_0x3fe41a['setChangeGroupState'](0x0,'rejected');}this['_stopInteraction'](),this['_clearInteractionHistory'](),this['stopListening'](this['_actionsBalloonView']),this['stopListening'](_0x3eb6b9);}}),this['_createInteraction'](_0x17babf,_0x47951c,_0x3eb6b9,_0x33a021);}['_setupApplyListeners'](){if(!this['_interactionParams'])return;const {modelFragment:_0xdc0b1,anchorData:_0x4f1877,root:_0x1523d1}=this['_interactionParams'];this['listenTo'](this['_actionsBalloonView'],'applySuggestion',()=>{this['_applyChanges'](_0xdc0b1,_0x4f1877,_0x1523d1,!0x1);}),this['listenTo'](this['_actionsBalloonView'],'insertSuggestion',()=>{this['_applyChanges'](_0xdc0b1,_0x4f1877,_0x1523d1,!0x0);});}['_wrapWithCommonAncestors'](_0x5e396b,_0x72f36b,_0x378d59){const _0x286a6b=this['editor']['model']['createRange'](_0x72f36b,_0x378d59)['getCommonAncestor'](),_0x31067d=_0x286a6b['is']('documentFragment')?[]:_0x286a6b['getAncestors']({'includeSelf':!0x0})['slice'](0x1);if(_0x31067d['length']){const _0x5ac2a5=_0x31067d['map'](_0x59a12c=>_0x59a12c['_clone'](!0x1));for(let _0x85d37b=0x1;_0x85d37b<_0x5ac2a5['length'];_0x85d37b++)_0x5ac2a5[_0x85d37b-0x1]['_appendChild'](_0x5ac2a5[_0x85d37b]);return _0x5ac2a5[_0x5ac2a5['length']-0x1]['_appendChild'](_0x5e396b),new _0x5dc9eb(_0x5ac2a5[0x0]);}return _0x5e396b;}['_copyMarkersToFragment'](_0x5eaccc,_0x5aa2fd,_0x3e5fe9={'isTableSelection':!0x1}){const _0x38f31c=this['editor']['model'],_0x14fa89=Array['from'](_0x5aa2fd['getRanges']()),_0x26e6ad=_0x5aa2fd['getFirstRange']()['start'];for(const _0x5eea46 of _0x38f31c['markers']){if(_0x5eea46['name']['startsWith'](zs)||!_0x5eea46['affectsData'])continue;const _0x578fd4=_0x5eea46['getRange']();if(!_0x14fa89['some'](_0xce412=>_0xce412['containsRange'](_0x578fd4,!0x0)))continue;const _0x30f040=this['_regularCalculateMarkerPath'](_0x578fd4['start'],_0x26e6ad,_0x3e5fe9['isTableSelection']),_0x16b65c=this['_regularCalculateMarkerPath'](_0x578fd4['end'],_0x26e6ad,_0x3e5fe9['isTableSelection']),_0x264a5b=_0x38f31c['createPositionFromPath'](_0x5eaccc,_0x30f040),_0x10aa09=_0x38f31c['createPositionFromPath'](_0x5eaccc,_0x16b65c);if(!_0x264a5b['isEqual'](_0x10aa09)){const _0x45f19c=_0x38f31c['createRange'](_0x264a5b,_0x10aa09);_0x5eaccc['markers']['set'](_0x5eea46['name'],_0x45f19c);}}}['_regularCalculateMarkerPath'](_0x320d5a,_0x43fd42,_0xb24eb3=!0x1){const _0x159474=[..._0x320d5a['path']['slice']()];for(let _0x472955=0x0;_0x472955<Math['max'](_0x43fd42['path']['length'],_0x320d5a['path']['length']);_0x472955++){const _0x4d9c21=_0x43fd42['path'][_0x472955]||0x0,_0x15f101=(_0x320d5a['path'][_0x472955]||0x0)-_0x4d9c21;if(_0x159474[_0x472955]=_0x15f101,0x0!==_0x15f101&&!_0xb24eb3)break;}return _0x159474;}async['_createInteraction'](_0x304a28,_0x570aa5,_0x2e28a8,_0x4668af){const _0x4ce381=this['editor'];this['_interactionParams']||(this['_interactionParams']={'action':_0x4668af,'content':_0x304a28,'version':_0x570aa5,'aiBalloon':_0x2e28a8,'modelFragment':this['editor']['model']['getSelectedContent'](this['editor']['model']['document']['selection']),'anchorData':new Map(),'root':this['editor']['model']['document']['selection']['getFirstRange']()['start']['root']});const _0x540cee=new Qo({'connector':this['_aiConnector'],'locale':_0x4ce381['locale'],'content':_0x304a28,'version':_0x570aa5,..._0x4668af});this['_interactions']['push'](_0x540cee);const _0x5ac617=(_0x4b8812,_0x2011fb=!0x1,_0x302188='streaming')=>this['_promiseQueue']['enqueue'](async _0x546958=>{try{const _0x26b71f=Rs({'editor':_0x4ce381,'changeGroups':_0x4b8812['changeGroups'],'documentContextContent':_0x4b8812['documentContextContent'],'showDiff':_0x2011fb,'trimUnchanged':!0x1});_0x26b71f['length']&&await this['_actionsBalloonView']['updateContent']({'part':_0x26b71f[0x0],'renderingStrategy':_0x302188,'abortSignal':_0x546958});}catch(_0x1b7ec1){if(this['_isAbortError'](_0x1b7ec1))return;throw _0x1b7ec1;}});_0x540cee['on']('replyCreated',(_0x20ddb0,_0x5ddf95)=>{this['_actionsBalloonView']['hideLoader'](),this['_actionsBalloonView']['startAutoScroll'](),_0x5ac617(_0x5ddf95)['catch'](_0x511f77=>{this['_isAbortError'](_0x511f77)||(console['error']('Error\x20updating\x20content\x20in\x20replyCreated:',_0x511f77),this['_setErrorState'](_0x540cee));});}),_0x540cee['on']('replyContentUpdated',(_0x2b0988,_0x50b01b)=>{_0x5ac617(_0x50b01b)['catch'](_0x2029f9=>{this['_isAbortError'](_0x2029f9)||(console['error']('Error\x20updating\x20content\x20in\x20replyContentUpdated:',_0x2029f9),this['_setErrorState'](_0x540cee));});}),_0x540cee['on']('interactionFinished',async()=>{try{await this['_clearLoadingState'](),this['_actionsBalloonView']['updateMiniToolbarButtons'](this['_interactions']['length'],this['_currentInteractionIndex']),await this['_promiseQueue']['queueEmptyPromise'];}catch(_0x427f46){this['_isAbortError'](_0x427f46)||(console['error']('Error\x20clearing\x20loading\x20state\x20in\x20interactionFinished:',_0x427f46),this['_setErrorState'](_0x540cee));}finally{this['_actionsBalloonView']['stopAutoScroll']();}}),this['listenTo'](this['_actionsBalloonView'],'toggleSuggestionDisplayMode',async(_0xb7a0f3,{showDiff:_0x5af485})=>{try{this['_balloonShowDiff']=_0x5af485;const _0x13e5d9=this['_interaction']['replies'][this['_interaction']['replies']['length']-0x1];_0x13e5d9&&await _0x5ac617(_0x13e5d9,_0x5af485,'static');}catch(_0x1efa59){this['_isAbortError'](_0x1efa59)||(console['error']('Error\x20updating\x20content\x20in\x20toggleSuggestionDisplayMode:',_0x1efa59),this['_setErrorState'](_0x540cee));}}),_0x540cee['on']('replyChangeGroupStateUpdated',()=>{const _0x30395d={'positiveCount':_0x540cee['replies']['reduce']((_0x2cc958,_0x3c3645)=>_0x2cc958+_0x3c3645['changeGroups']['filter'](_0x543d8f=>'accepted'===_0x543d8f['state'])['length'],0x0),'totalCount':_0x540cee['replies']['reduce']((_0x10879b,_0x19ee44)=>_0x10879b+_0x19ee44['changeGroups']['length'],0x0)},_0x412abb=_0x540cee['actionCallId'],_0x56734d=_0x540cee['actionName'];_0x56734d?this['_aiConnector']['upsertAIActionRating'](_0x56734d,_0x412abb,_0x30395d):this['_aiConnector']['upsertCustomAIActionRating'](_0x412abb,_0x30395d);}),this['_setLoadingState']();try{const _0x46fb71=await _0x540cee['start']();return this['_actionsBalloonView']['updateMiniToolbarButtons'](this['_interactions']['length'],this['_currentInteractionIndex']),_0x46fb71;}catch(_0x2528a5){if(this['_isAbortError'](_0x2528a5))return;this['_actionsBalloonView']['hideLoader'](),this['_setErrorState'](_0x540cee);}}['_applyChanges'](_0x3ad9e1,_0x326a88,_0x67dddd,_0x592379){const _0x4fb46b=this['editor'];if(_0x592379&&!_0x4fb46b['plugins']['has']('TrackChanges'))throw new at('ai-no-track-changes',null);const _0x59aa00=this['editor']['plugins']['get'](_0x10431c),_0x4398d8=this['_interactions'][this['_interactions']['length']-0x1-this['_currentInteractionIndex']];if(!_0x4398d8||!_0x4398d8['replies']['length'])return;const _0x24c1db=_0x4398d8['replies'][_0x4398d8['replies']['length']-0x1],_0x5bfd1a=_0x24c1db['changeGroups'];_0x24c1db['setChangeGroupState'](0x0,'accepted');let _0x16c161=qs({'editor':_0x4fb46b,'reply':_0x24c1db,'interaction':_0x4398d8,'groups':_0x5bfd1a,'transform':!0x1,'documentCompare':_0x59aa00,'documentCompareOptions':{'anchor':_0x4fb46b['model']['createPositionAt'](_0x3ad9e1,0x0),'markDeletions':_0x592379}});_0x16c161=this['_filterOperationsOutsideRange'](_0x16c161,_0x326a88);for(const _0x15636f of _0x16c161)this['_anchorOperation'](_0x326a88,_0x15636f,_0x67dddd);const _0x33f6d2=_0x4398d8['getDocumentContext']()['version'],_0x448916=_0x4fb46b['model']['document']['history']['getOperations'](_0x33f6d2),_0x35e8f3={'document':_0x4fb46b['model']['document'],'useRelations':!0x1,'padWithNoOps':!0x1},_0x392f07=_0x5bfae1(_0x16c161,_0x448916,_0x35e8f3)['operationsA'];_0x4fb46b['model']['change'](_0x28a645=>{if(_0x28a645['setSelection'](_0x4fb46b['model']['document']['selection']['focus']),_0x592379)_0x4fb46b['plugins']['get']('TrackChangesEditing')['_applyOperationsAsSuggestions'](_0x392f07);else{for(const _0x483914 of _0x392f07)_0x483914['baseVersion']=_0x4fb46b['model']['document']['version'],Qs(_0x4fb46b,_0x483914),_0x28a645['batch']['addOperation'](_0x483914),_0x4fb46b['model']['applyOperation'](_0x483914);}}),this['editor']['plugins']['get']('AIBalloon')['close']();}['_filterOperationsOutsideRange'](_0x238a9d,_0x3c668d){return _0x238a9d['filter'](_0x29a761=>{if('rename'==_0x29a761['type']){const _0x5349af=_0x29a761['position']['nodeAfter'];return!_0x3c668d['has'](_0x5349af);}if(_0x29a761['type']['indexOf']('Attribute')>-0x1){const _0x20bd70=_0x29a761['range']['start']['nodeAfter'];return!_0x3c668d['has'](_0x20bd70);}return!0x0;});}['_anchorOperation'](_0x50262f,_0x494c12,_0x4c8eb3){const _0x266e63=_0x494c12['clone']();for(const _0x2d8e73 in _0x494c12){const _0xd30fa5=_0x494c12[_0x2d8e73];_0xd30fa5 instanceof _0x2e58a9?_0x494c12[_0x2d8e73]=new _0x2e58a9(_0x16d819(_0xd30fa5['start']),_0x16d819(_0xd30fa5['end'])):_0xd30fa5 instanceof _0x9f3aa5&&(_0x494c12[_0x2d8e73]=_0x16d819(_0xd30fa5));}if(['insert','move','remove','reinsert','split','merge']['includes'](_0x266e63['type'])){if(_0x266e63['isDocumentOperation']=!0x1,_0x266e63['baseVersion']=null,'remove'==_0x266e63['type']){const _0x1df972=_0x266e63['sourcePosition'],_0x999c85=_0x266e63['howMany'];new _0x3ca371(_0x1df972,_0x999c85)['_execute']();}else _0x266e63['_execute']();}function _0x16d819(_0x15270b){if('$graveyard'==_0x15270b['root']['rootName'])return _0x15270b;const _0x391140=[];let _0x2b9bdc=_0x15270b['root'];for(let _0x353fbe=0x0;_0x353fbe<_0x15270b['path']['length'];_0x353fbe++){const _0x14cc91=_0x50262f['get'](_0x2b9bdc)||0x0;_0x391140[_0x353fbe]=_0x15270b['path'][_0x353fbe]+_0x14cc91,_0x2b9bdc=_0x2b9bdc['getChildAtOffset'](_0x15270b['path'][_0x353fbe]);}return new _0x9f3aa5(_0x4c8eb3,_0x391140,_0x15270b['stickiness']);}}['_refreshInteraction'](){if(!this['_interactionParams'])return;this['_interactions']['length']>0x0&&this['_stopInteraction'](),this['_currentInteractionIndex']=0x0,this['_balloonShowDiff']=!0x1;const {action:_0x2899a5,content:_0x46f2fa,version:_0x332c9b,aiBalloon:_0x454d75}=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'](_0x46f2fa,_0x332c9b,_0x454d75,_0x2899a5)['catch'](_0x3fff80=>{this['_isAbortError'](_0x3fff80)||console['error']('Error\x20refreshing\x20interaction:',_0x3fff80);});}['_isAbortError'](_0x6173df){return!!_0x6173df['message']&&_0x6173df['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 _0x2448e4=this['_interactions']['length'];this['_currentInteractionIndex']<_0x2448e4-0x1&&this['_displayInteractionAtIndex'](this['_currentInteractionIndex']+0x1);}['_navigateToNext'](){this['_currentInteractionIndex']>0x0&&this['_displayInteractionAtIndex'](this['_currentInteractionIndex']-0x1);}async['_displayInteractionAtIndex'](_0x452dc1){if(!this['_interactionParams'])return;this['_currentInteractionIndex']=_0x452dc1;const _0x406c15=this['_interactions'][this['_interactions']['length']-0x1-this['_currentInteractionIndex']];if(!_0x406c15)return;if(_0x406c15['hasError'])return this['_setErrorState'](_0x406c15),void this['_actionsBalloonView']['updateMiniToolbarButtons'](this['_interactions']['length'],this['_currentInteractionIndex']);if(!_0x406c15['replies']['length'])return;this['_actionsBalloonView']['hideError'](),this['_interactionParams']&&this['_clearErrorState']();const _0x288031=_0x406c15['replies'][_0x406c15['replies']['length']-0x1];if(_0x288031){const _0x50e11e=this['editor'];try{const _0x65757c=Rs({'editor':_0x50e11e,'changeGroups':_0x288031['changeGroups'],'documentContextContent':_0x288031['documentContextContent'],'showDiff':this['_balloonShowDiff'],'trimUnchanged':!0x1});await new Promise(_0x33fe7=>setTimeout(_0x33fe7,0x32)),await this['_actionsBalloonView']['updateContent']({'part':_0x65757c[0x0],'renderingStrategy':'static','abortSignal':new AbortController()['signal']});}catch(_0x45874b){this['_isAbortError'](_0x45874b)||console['error']('Error\x20updating\x20content\x20during\x20navigation:',_0x45874b);}}this['_actionsBalloonView']['updateMiniToolbarButtons'](this['_interactions']['length'],this['_currentInteractionIndex']);}['_setLoadingState'](){this['_actionsBalloonView']['setIsLoading'](!0x0),this['isBusy']=!0x0;}async['_setErrorState'](_0x5a67ad){const _0x1e81c0=hs(this['editor']['locale'],'AI_ACTIONS_GENERIC_ERROR');this['_actionsBalloonView']['showError'](_0x1e81c0),_0x5a67ad['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 _0x45b757{static get['requires'](){return[Wo,$o,ta];}static get['pluginName'](){return'AIQuickActions';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x2a91a3){super(_0x2a91a3),_0x2a91a3['config']['define']('ai.quickActions',{'extraCommands':[],'removeCommands':[],'isSearchEnabled':!0x0});}}class ia extends vt{['resultResponseView'];['acceptButtonView'];['dismissButtonView'];['infoButtonView'];['outdatedButtonView'];constructor(_0x21ba98,_0x46f0f9){super(_0x21ba98),this['id']=_0x46f0f9,this['set']('status','pending'),this['set']('changeId',_0x46f0f9),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',(_0x5f1d0b,_0x252562)=>{_0x252562&&_0x252562['target']&&'A'===_0x252562['target']['tagName']&&_0x252562['preventDefault'](),this['fire']('activateChange',{'id':_0x46f0f9,'source':this,'uiInteraction':'click'});}),this['on']('mouseover',()=>{this['fire']('activateChange',{'id':_0x46f0f9,'source':this,'uiInteraction':'hover'});}),this['on']('mouseout',()=>{this['fire']('deactivateChange',{'origin':'panel','id':_0x46f0f9,'source':this});});}['setItemAsActive'](){this['isActive']=!0x0;}['setItemAsInactive'](){this['isActive']=!0x1;}['_createResultResponseView'](){const _0x26d120=new vt(this['locale']);return _0x26d120['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',_0x541ff5=>!_0x541ff5)]}}),_0x26d120;}['_createAcceptButtonView'](){const _0x531421=new Nt(this['locale']);return _0x531421['set']({'label':hs(this['locale'],'AI_REVIEW_MODE_ACCEPT_CHANGE'),'withText':!0x0}),_0x531421['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x54bc03=>{this['fire']('acceptChange',{'id':this['changeId']}),_0x54bc03['stopPropagation']();})},'attributes':{'class':[this['bindTemplate']['if']('status','ck-hidden',_0x5a5057=>'pending'!==_0x5a5057&&'accepted'!==_0x5a5057),this['bindTemplate']['if']('status',ls,_0x2709c7=>'pending'===_0x2709c7),this['bindTemplate']['if']('status',us,_0x1e9a0b=>'pending'!==_0x1e9a0b),this['bindTemplate']['if']('status','ck-ai_review__check-run-result-status-button',_0x46ae01=>'accepted'===_0x46ae01)]}}),this['on']('change:status',(_0xd58a64,_0x2db6eb,_0x12ba40)=>{_0x531421['isEnabled']='pending'===_0x12ba40,'accepted'===_0x12ba40&&(_0x531421['label']=hs(this['locale'],'AI_REVIEW_MODE_CHECK_STATUS_ACCEPTED'),_0x531421['icon']=_0x51a320);}),_0x531421;}['_createDismissButtonView'](){const _0x5234d2=new Nt(this['locale']);return _0x5234d2['set']({'label':hs(this['locale'],'AI_REVIEW_MODE_DISMISS_CHANGE'),'withText':!0x0}),_0x5234d2['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x2bf5ba=>{this['fire']('dismissChange',{'id':this['changeId']}),_0x2bf5ba['stopPropagation']();})},'attributes':{'class':[us,this['bindTemplate']['if']('status','ck-hidden',_0x5cc9f2=>'pending'!==_0x5cc9f2&&'rejected'!==_0x5cc9f2),this['bindTemplate']['if']('status','ck-ai_review__check-run-result-dismiss-button',_0x3602af=>'pending'===_0x3602af),this['bindTemplate']['if']('status','ck-ai_review__check-run-result-status-button',_0x1baa3a=>'rejected'===_0x1baa3a)]}}),this['on']('change:status',(_0x11cf85,_0x47b4c4,_0x4a1df6)=>{_0x5234d2['isEnabled']='pending'===_0x4a1df6,'rejected'===_0x4a1df6&&(_0x5234d2['label']=hs(this['locale'],'AI_REVIEW_MODE_CHECK_STATUS_REJECTED'),_0x5234d2['icon']=_0x48af93);}),_0x5234d2;}['_createInfoButtonView'](){const _0x983d78=new Nt(this['locale']);return _0x983d78['set']({'label':hs(this['locale'],'AI_REVIEW_MODE_LEARN_MORE'),'icon':_0x2f24b6,'tooltip':!0x0,'isToggleable':!0x0,'role':'menuitemcheckbox','class':us+'\x20ck-ai_review__check-run-result-info-button\x20ck-hidden'}),_0x983d78['bind']('isOn')['to'](this,'isInfoToggleOn',_0x3ff40e=>_0x3ff40e),_0x983d78['on']('execute',()=>{this['isInfoToggleOn']=!this['isInfoToggleOn'];}),_0x983d78;}['_createOutdatedButtonView'](){const _0x2631e0=new Nt(this['locale']);return _0x2631e0['set']({'label':hs(this['locale'],'AI_REVIEW_MODE_CHECK_STATUS_OUTDATED'),'icon':it,'withText':!0x0,'isEnabled':!0x1}),_0x2631e0['extendTemplate']({'attributes':{'class':[us,'ck-ai_review__check-run-result-status-button',this['bindTemplate']['if']('status','ck-hidden',_0x5ece45=>'outdated'!==_0x5ece45)],'disabled':'disabled'}}),_0x2631e0;}}class sa extends Xt{['resultItemView'];['_pinnedRectIndex']=void 0x0;['_pinnedTargetElement']=void 0x0;['_pinnedTargetChangeId']=void 0x0;constructor(_0x53d5fe,_0x599e4d){super(_0x53d5fe),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']()),_0x599e4d['add'](this);}['render'](){super['render'](),this['_setupClickOutsideHandler']();}['updateContent'](_0x453851){this['resultItemView']['changeId']=_0x453851['id'],this['resultItemView']['resultResponseView']['element']['innerHTML']=_0x453851['contentDiffed'];}['showBalloon'](_0x4c495c,_0x299d02,_0x1e4e77,_0x21aef9,_0xd42985,_0x3d1131){const _0x250b9c=_0x299d02();if(!_0x250b9c)return;this['updateContent'](_0x4c495c),this['show']();const _0x4f7edb=Array['from'](_0x250b9c['getClientRects']())['reverse'](),_0x2d8c7c=this['_getPointedRectIndexFromEvent'](_0x1e4e77,_0x4f7edb),_0x3a603e=_0x4f7edb[_0x2d8c7c??0x0];'click'===_0x21aef9?(this['isDiffActive']=!0x0,this['pin']({'target':()=>this['_getBestRectPositionOnClick'](_0x299d02(),_0x2d8c7c,_0x4c495c['id'],_0xd42985,_0x3d1131)||_0x3a603e})):'hover'===_0x21aef9&&(this['isDiffActive']=!0x1,this['pin']({'target':()=>this['_getBestRectPositionOnHover'](_0x299d02(),_0x2d8c7c,_0x4c495c['id'])||_0x3a603e}));}['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 _0x50d5b7=[this['element']];return this['_pinnedTargetElement']&&_0x50d5b7['push'](this['_pinnedTargetElement']),_0x50d5b7;},'callback':()=>{this['hide'](),this['unpin'](),this['deactivateChange'](),this['_pinnedTargetElement']=void 0x0,this['_pinnedRectIndex']=void 0x0,this['_pinnedTargetChangeId']=void 0x0;}});}['_createContentView'](){const _0x4ea673=new vt();return this['resultItemView']=new ia(this['locale'],''),this['resultItemView']['resultResponseView']['extendTemplate']({'attributes':{'class':['ck-content']}}),this['resultItemView']['delegate']('acceptChange','dismissChange')['to'](this),_0x4ea673['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']]}]}),_0x4ea673;}['_getBestRectPositionOnClick'](_0x9dfdef,_0x179509,_0x16417c,_0x439058,_0x5b8328){if(!_0x9dfdef)return null;const _0x14262d=this['position']['replace']('arrow_',''),_0x27432b=Array['from'](_0x9dfdef['getClientRects']());let _0x3964e5,_0x53a283=_0x27432b['reverse']();return void 0x0!==_0x179509&&this['_isPinnedRectVisible'](_0x53a283[_0x179509],_0x439058,_0x5b8328)?(_0x3964e5=_0x53a283[_0x179509],this['_pinnedRectIndex']=_0x179509):this['_isPinnedRectVisible'](_0x53a283[0x0],_0x439058,_0x5b8328)&&void 0x0===_0x179509?_0x3964e5=_0x53a283[0x0]:(_0x53a283='s'==_0x14262d[0x0]?[..._0x27432b]['reverse']():_0x27432b,_0x53a283['forEach'](_0x42879a=>{this['_isPinnedRectVisible'](_0x42879a,_0x439058,_0x5b8328)&&(_0x3964e5=_0x42879a);})),this['_pinnedTargetChangeId']=_0x16417c,this['_pinnedTargetElement']=_0x9dfdef,_0x3964e5||_0x9dfdef['getBoundingClientRect']();}['_getBestRectPositionOnHover'](_0x54e949,_0x423b18,_0x282aa2){if(!_0x54e949)return null;const _0x179f21=Array['from'](_0x54e949['getClientRects']())['reverse']();if(void 0x0===this['_pinnedRectIndex']&&void 0x0!==_0x423b18&&this['_pinnedTargetChangeId']!==_0x282aa2)return this['_pinnedRectIndex']=_0x423b18,this['_pinnedTargetElement']=_0x54e949,this['_pinnedTargetChangeId']=_0x282aa2,_0x179f21[_0x423b18];if(void 0x0!==this['_pinnedRectIndex']&&this['_pinnedTargetChangeId']===_0x282aa2){if(_0x54e949!==this['_pinnedTargetElement'])return Array['from'](this['_pinnedTargetElement']['getClientRects']())['reverse']()[this['_pinnedRectIndex']];return _0x179f21[this['_pinnedRectIndex']];}return void 0x0!==_0x423b18&&this['_pinnedTargetChangeId']!==_0x282aa2?(this['_pinnedRectIndex']=_0x423b18,this['_pinnedTargetElement']=_0x54e949,this['_pinnedTargetChangeId']=_0x282aa2,_0x179f21[_0x423b18]):_0x54e949['getBoundingClientRect']();}['_getPointedRectIndexFromEvent'](_0x3f6660,_0x57c631){if(_0x3f6660)for(let _0x16cb37=0x0;_0x16cb37<_0x57c631['length'];_0x16cb37++){const _0x4b3d04=_0x57c631[_0x16cb37];if(_0x3f6660['clientX']>=_0x4b3d04['left']-0x3&&_0x3f6660['clientX']<=_0x4b3d04['right']+0x3&&_0x3f6660['clientY']>=_0x4b3d04['top']-0x3&&_0x3f6660['clientY']<=_0x4b3d04['bottom']+0x3)return _0x16cb37;}}['_isPinnedRectVisible'](_0x3a0efe,_0x4fbf4f,_0x55dedc){const _0x598279=new ut(_0x3a0efe),_0x9f73a4=_0x4fbf4f||document['documentElement'],_0x11b58e=_0x598279['getIntersection'](Rt(_0x55dedc)),_0x3cc167=new ut(_0x9f73a4)['getIntersection'](_0x598279);return!!(_0x11b58e&&_0x3cc167&&_0x598279['width']>0x0);}}const na=['getReviewCheckList','runReviewCheck','abortReviewStream','toggleDiff','acceptAllChanges','leaveReviewCoreResultList','activateChange','deactivateChange','acceptChange','dismissChange','learnMore','finishReview','retryReview'];class ra extends _0x35ff8d{['_mainView'];['_balloonSuggestionView'];['_bodyCollection'];static get['requires'](){return[os];}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x209edb){super(_0x209edb),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 _0x4118ac=this['context']['plugins']['get']('AITabs');this['registerTab'](_0x4118ac);}['destroy'](){this['_bodyCollection']['detachFromDom'](),super['destroy']();}['setAvailableChecks'](_0x3a08ea){if(!this['_mainView']['reviewCheckListView']['hasChecks']()){const _0x3cec39=!this['context']['config']['get']('ai.models.showModelSelector');this['_mainView']['reviewCheckListView']['setChecks'](_0x3a08ea,_0x3cec39);}this['_mainView']['showReviewCheckListView']();}['showReviewCheckList'](){this['fire']('getReviewCheckList');}['showCheckRunResults'](_0x42256c){_0x42256c&&('error-general'!==_0x42256c['status']?'error-chunk'!==_0x42256c['status']?this['_mainView']['showReviewCheckResultsView']():this['showChunkErrorView']():this['showGeneralResultsErrorView']());}['showCheckRunResult'](_0x3c3da4){this['_mainView']['addCheckRunResult'](_0x3c3da4);}['showGeneralResultsErrorView'](){this['_mainView']['showGeneralResultsErrorView']();}['showGeneralReviewCoreErrorView'](_0x2ef9e4){this['_mainView']['showGeneralReviewCoreErrorView'](_0x2ef9e4??hs(this['context']['locale'],'AI_REVIEW_INITIALIZATION_ERROR_MESSAGE'));}['showChunkErrorView'](){this['_mainView']['showChunkErrorView']();}['setCheckResultTitle'](_0x3d40d0,_0x2ef97b){this['_mainView']['reviewCheckResultsView']['setTitle'](_0x3d40d0,_0x2ef97b);}['setActiveStateInResults'](_0x707a7d){this['_mainView']['reviewCheckResultsView']['getResults']()['forEach'](_0x597e20=>{_0x597e20['id']===_0x707a7d&&_0x597e20['setItemAsActive']();});}['resetActiveStateInResults'](){this['_mainView']['reviewCheckResultsView']['getResults']()['forEach'](_0x44e149=>_0x44e149['setItemAsInactive']());}['updateChangeState'](_0x285972,_0x28c4ea){'accepted'===_0x28c4ea||'rejected'===_0x28c4ea||'outdated'===_0x28c4ea?this['_mainView']['reviewCheckResultsView']['hideResult'](_0x285972,_0x28c4ea):this['_mainView']['reviewCheckResultsView']['showResult'](_0x285972,_0x28c4ea);}['showReviewCompletedView'](){this['_mainView']['showReviewCompletedView']();}['showActionsWhenResultIsReady'](){this['_mainView']['showActionsWhenResultIsReady']();}['showNoChangesView'](){this['_mainView']['showNoChangesView']();}['hideActionsWhenResultIsReady'](){this['_mainView']['hideActionsWhenResultIsReady']();}['showChangeBalloon'](_0x3ec32f,_0x3db52c,_0x2a1885,_0x5df18c,_0x2a984b,_0x2ece39){this['_balloonSuggestionView']['showBalloon'](_0x3ec32f,_0x3db52c,_0x2a1885,_0x5df18c,_0x2a984b,_0x2ece39);}['hideChangeBalloon'](){this['_balloonSuggestionView']['hideBalloon']();}['hideDiffInBalloon'](){this['_balloonSuggestionView']['hideDiffInBalloon']();}['showDiffInBalloon'](){this['_balloonSuggestionView']['showDiffInBalloon']();}['getChangeElement'](_0x1af26e){const _0x20e3c4=this['_mainView']['reviewCheckResultsView']['getResults']()['find'](_0x57c1bb=>_0x57c1bb['id']===_0x1af26e);return _0x20e3c4?_0x20e3c4['element']:null;}['deactivateChange'](){this['_balloonSuggestionView']['deactivateChange']();}}class oa extends vt{constructor(_0x99cc5c){super(_0x99cc5c),this['set']('isVisible',!0x1),this['set']('errorMessage','');const _0x37e952=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai_review__general-error-container',_0x37e952['if']('isVisible','ck-hidden',_0x14f3f8=>!_0x14f3f8)]},'children':[{'tag':'p','attributes':{'class':'ck\x20ck-ai-notification\x20ck-ai-notification_error'},'children':[{'text':_0x37e952['to']('errorMessage')}]}]});}}class aa extends vt{['reviewCoreHeader'];['generalErrorView'];['reviewCheckListView'];['reviewCheckResultsView'];['reviewCompletedView'];constructor(_0x323a5d,_0x4f5874){super(_0x323a5d),this['reviewCoreHeader']=_0x4f5874['header'],this['generalErrorView']=new oa(_0x323a5d),this['reviewCheckListView']=_0x4f5874['list'],this['reviewCheckListView']['delegate'](...na)['to'](this),this['reviewCheckResultsView']=_0x4f5874['results'],this['reviewCheckResultsView']['delegate'](...na)['to'](this),this['reviewCompletedView']=_0x4f5874['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'](_0x1fb3b1){this['reviewCheckResultsView']['addResult'](_0x1fb3b1),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'](_0x323df8){this['generalErrorView']['set']('isVisible',!0x0),this['generalErrorView']['errorMessage']=_0x323df8;}['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(_0x4422e6,_0x5a3ff4){super(_0x5a3ff4),this['set']({'label':_0x4422e6,'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(_0x56d6bc,_0x71dc9c){super(_0x56d6bc),this['_contents']=_0x71dc9c,this['_resultViews']=new _0x19e880(),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(_0x56d6bc),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 _0x4f0c1d=this['_createCombinedSkeletonLoader'](),_0xb20bb3=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-run',_0xb20bb3['if']('isLoading','ck-ai_review__check-run_loading',_0x4475a8=>_0x4475a8),_0xb20bb3['if']('isResultReady','ck-ai_review__check-run_ready',_0x25e887=>_0x25e887),_0xb20bb3['if']('isVisible','ck-hidden',_0x574860=>!_0x574860)]},'children':[this['_resultsHeader'],this['_errorMessageView'],this['_resultsBody'],_0x4f0c1d,this['reviewDisclaimer']]});}['clearResults'](){this['_resultViews']['clear'](),this['_resultsBody']['element']&&(this['_resultsBody']['element']['scrollTop']=0x0);}['getResults'](){return this['_resultViews'];}['addResult'](_0x298213){const _0x70c6eb=new ia(this['locale'],_0x298213['id']);_0x70c6eb['delegate']('acceptChange','dismissChange','activateChange','deactivateChange')['to'](this),this['_resultViews']['add'](_0x70c6eb),_0x70c6eb['resultResponseView']['element']['innerHTML']=_0x298213['contentDiffed'];}['hideResult'](_0x7ad327,_0x358327){if('pending'===_0x358327)return;const _0x77e03b=this['_resultViews']['find'](_0x56f1ef=>_0x56f1ef['id']===_0x7ad327);_0x77e03b&&(_0x77e03b['status']=_0x358327,_0x77e03b['element']?.['classList']['add']('ck-ai_review__check-run-result_grayout'));}['showResult'](_0x5bf591,_0x431117){if('pending'!==_0x431117)return;const _0x51de55=this['_resultViews']['find'](_0x560974=>_0x560974['id']===_0x5bf591);_0x51de55&&(_0x51de55['status']=_0x431117,_0x51de55['element']?.['classList']['remove']('ck-ai_review__check-run-result_grayout'));}['setTitle'](_0x12038e,_0x11990f){this['headerTitle']=_0x12038e,this['headerSubtitle']=_0x11990f||'';}['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 _0x409bbc=new vt(this['locale']),_0x434179=[];for(let _0x7c592e=0x0;_0x7c592e<0x10;_0x7c592e++){const _0x20fe67=this['_createSkeletonLoader']();_0x20fe67['extendTemplate']({'attributes':{'class':['ck-ai_review__check-run-skeleton-item']}}),_0x434179['push'](_0x20fe67);}return _0x409bbc['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-run-skeleton-container',this['bindTemplate']['if']('isLoading','ck-hidden',_0x594e49=>!_0x594e49)]},'children':_0x434179}),_0x409bbc;}['_createResultsBodyView'](){const _0x5b5e84=new vt(this['locale']);return _0x5b5e84['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-run-results-container','ck-reset_all-excluded',this['bindTemplate']['if']('isLoading','ck-hidden',_0x560040=>_0x560040)]},'children':this['_resultViews']}),_0x5b5e84;}['_createErrorView'](){const _0x117421=new vt(this['locale']),_0x4e6362=new Nt(this['locale']),t=this['locale']['t'];return _0x117421['delegate']('retryReview')['to'](this),_0x4e6362['set']({'label':t('Try\x20again'),'withText':!0x0,'class':ls+'\x20ck-ai_review__check-run-error-retry-button'}),_0x4e6362['on']('execute',()=>{this['fire']('retryReview');}),_0x117421['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-run-error-container',this['bindTemplate']['if']('showErrorMessage','ck-hidden',_0x442591=>!_0x442591),this['bindTemplate']['if']('errorType','ck-ai_review__check-run-error-container_border-bottom',_0x581d55=>'chunk'===_0x581d55)]},'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',_0x411cba=>'chunk'===_0x411cba)]},'children':[{'tag':'p','attributes':{'class':['ck-ai-notification__content',this['bindTemplate']['if']('errorType','ck-hidden',_0x8d14f8=>'general'!==_0x8d14f8)]},'children':[{'text':this['_contents']['generalErrorText']}]},{'tag':'p','attributes':{'class':['ck-ai-notification__content',this['bindTemplate']['if']('errorType','ck-hidden',_0x6e282f=>'chunk'!==_0x6e282f)]},'children':[{'text':hs(this['locale'],'AI_REVIEW_MODE_CHUNK_ERROR_MESSAGE')}]}]},_0x4e6362]}),_0x117421;}['_createCancelButtonView'](){const _0x7e7b86=new Nt(this['locale']);return _0x7e7b86['set']({'label':hs(this['locale'],'AI_REVIEW_MODE_STOP_GENERATING'),'withText':!0x0,'class':[ls+'\x20ck-ai-button-stop-generating'],'icon':_0x41a00}),_0x7e7b86['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isResultReady','ck-hidden',_0x4d3237=>_0x4d3237),this['bindTemplate']['if']('isCompleted','ck-hidden',_0x1c87cd=>_0x1c87cd)]}}),_0x7e7b86['on']('execute',()=>{this['fire']('abortReviewStream');}),_0x7e7b86;}['_createToggleDiffButtonView'](){const _0x412321=new Nt(this['locale']);_0x412321['set']({'tooltip':!0x0,'isToggleable':!0x0,'role':'menuitemcheckbox'}),_0x412321['bind']('isEnabled')['to'](this,'isError',_0x358512=>!_0x358512),_0x412321['extendTemplate']({'attributes':{'class':[ls,'ck-ai_review__check-run-toggle-diff-button',this['bindTemplate']['if']('isResultReady','ck-hidden',_0x2f4e71=>!_0x2f4e71),this['bindTemplate']['if']('isCompleted','ck-hidden',_0x944ec8=>_0x944ec8)]}});const _0x8b512b=hs(this['locale'],'AI_REVIEW_MODE_HIDE_CHANGES'),_0x482cc2=hs(this['locale'],'AI_REVIEW_MODE_SHOW_CHANGES');return _0x412321['bind']('isOn')['to'](this,'isToggleDiffOn',_0x35b04a=>_0x35b04a),_0x412321['bind']('icon')['to'](this,'isToggleDiffOn',_0x129884=>_0x129884?st:nt),_0x412321['bind']('label')['to'](this,'isToggleDiffOn',_0xe2aad5=>_0xe2aad5?_0x8b512b:_0x482cc2),_0x412321['on']('execute',()=>{this['isToggleDiffOn']=!this['isToggleDiffOn'],this['fire']('toggleDiff',{'on':this['isToggleDiffOn']});}),_0x412321;}['_createAcceptAllButtonView'](){const _0x34a1c4=new Nt(this['locale']);return _0x34a1c4['set']({'label':hs(this['locale'],'AI_REVIEW_MODE_ACCEPT_ALL'),'withText':!0x0}),_0x34a1c4['bind']('isEnabled')['to'](this,'isError',_0xd94714=>!_0xd94714),_0x34a1c4['extendTemplate']({'attributes':{'class':[cs,'ck-ai_review__check-run-accept-all-button',this['bindTemplate']['if']('isResultReady','ck-hidden',_0x51edd4=>!_0x51edd4),this['bindTemplate']['if']('isCompleted','ck-hidden',_0x44ed80=>_0x44ed80)]}}),_0x34a1c4['on']('execute',()=>{this['fire']('acceptAllChanges');}),_0x34a1c4;}['_createExitReviewButtonView'](){const _0x2f6257=new Nt(this['locale']);return _0x2f6257['set']({'label':hs(this['locale'],'AI_REVIEW_MODE_EXIT_REVIEW'),'withText':!0x0}),_0x2f6257['extendTemplate']({'attributes':{'class':[us,'ck-ai_review__check-run-exit-button',this['bindTemplate']['if']('isResultReady','ck-hidden',_0xe41273=>!_0xe41273),this['bindTemplate']['if']('isCompleted','ck-hidden',_0x4d311e=>_0x4d311e)]}}),_0x2f6257['on']('execute',()=>{this['fire']('leaveReviewCoreResultList');}),_0x2f6257;}['_createResultHeaderView'](){const _0x8fa235=new vt(this['locale']),_0x482582=this['_createTitleView']();return _0x8fa235['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-run-results-header',this['bindTemplate']['if']('isCompleted','ck-ai_review__review-completed-header',_0x24857d=>_0x24857d)]},'children':[_0x482582,{'tag':'div','attributes':{'class':['ck-ai_review__check-run-results-header-buttons']},'children':[this['_cancelButtonView'],this['_acceptAllButtonView'],this['_exitReviewButtonView'],this['_toggleDiffButtonView'],this['_finishReviewButtonView']]}]}),_0x8fa235;}['_createTitleView'](){const _0x181ab1=new vt(this['locale']),_0x133218=new yn();return _0x133218['bind']('isVisible')['to'](this,'isResultReady',_0x146127=>!_0x146127),_0x181ab1['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-run-results-header-title-wrapper']},'children':[_0x133218,{'tag':'div','attributes':{'class':['ck-ai_review__check-run-results-header-title-content',this['bindTemplate']['if']('isCompleted','ck-hidden',_0xde01c0=>_0xde01c0)]},'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',_0x36d5ae=>!_0x36d5ae)]},'children':[{'text':hs(this['locale'],'AI_REVIEW_MODE_FINISH_REVIEW_HEADER_TITLE')}]}]}),_0x181ab1;}['_createFinishReviewButtonView'](){const _0x399bc0=new ha(hs(this['locale'],'AI_REVIEW_MODE_FINISH_REVIEW_BUTTON_LABEL'),this['locale']);return _0x399bc0['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isCompleted','ck-hidden',_0x306fd9=>!_0x306fd9)]}}),_0x399bc0['delegate']('finishReview')['to'](this),_0x399bc0;}}class la extends Ht{['_resultsHeader'];['_finishReviewButtonView'];constructor(_0x1d8952,_0x245992){super(_0x1d8952),this['_finishReviewButtonView']=this['_createFinishReviewButtonView'](_0x245992['buttonText']),this['_resultsHeader']=this['_createResultHeaderView'](_0x245992['headerText']);const _0x54211a=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__review-completed',_0x54211a['if']('isVisible','ck-hidden',_0x3d6b1d=>!_0x3d6b1d)]},'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':_0x245992['emptyResultsText']}]}]}]});}['_createFinishReviewButtonView'](_0x54820a){const _0x24ac20=new ha(_0x54820a,this['locale']);return _0x24ac20['delegate']('finishReview')['to'](this),_0x24ac20;}['_createResultHeaderView'](_0x36566c){const _0x4f004e=new vt(this['locale']);return _0x4f004e['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':_0x36566c}]},{'tag':'div','attributes':{'class':['ck-ai_review__review-completed-header-buttons']},'children':[this['_finishReviewButtonView']]}]}),_0x4f004e;}}class ua extends vt{['_dropdownView'];['_defaultValue'];['_defaultLabel'];constructor(_0x9c79d8,_0x5c6a2c){super(_0x9c79d8),this['_defaultValue']=_0x5c6a2c['default']||(_0x5c6a2c['data']['length']>0x0?_0x5c6a2c['data'][0x0]['id']:''),this['_defaultLabel']=_0x5c6a2c['data']['find'](_0x26d7bb=>_0x26d7bb['id']===this['_defaultValue'])?.['label']||'',this['set']('formValue',''),this['_dropdownView']=Gt(this['locale']);const _0x3dd7bb=this['_prepareListOptions'](_0x5c6a2c['data']);jt(this['_dropdownView'],_0x3dd7bb,{'role':'menu','ariaLabel':_0x5c6a2c['label']}),this['_dropdownView']['buttonView']['set']({'label':this['_defaultLabel'],'withText':!0x0}),this['_dropdownView']['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x49955e=>{_0x49955e['stopPropagation']();})}}),this['listenTo'](this['_dropdownView'],'execute',_0x1d46b9=>{this['formValue']=_0x1d46b9['source']['model']['id'],this['_dropdownView']['buttonView']['label']=_0x1d46b9['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'](_0x3eaffa=[]){const _0xc5ea5a=new dt();this['resetToDefault']();for(const _0x1471cf of _0x3eaffa){const _0x5e5747=new Jt({'label':_0x1471cf['label'],'withText':!0x0,'role':'menuitemradio','id':_0x1471cf['id'],'model':_0x1471cf});_0x5e5747['bind']('isOn')['to'](this,'formValue',_0x47bcb3=>_0x47bcb3===_0x5e5747['id']);const _0x113748={'type':'button','model':_0x5e5747};_0xc5ea5a['add'](_0x113748);}return _0xc5ea5a;}}class da extends Ht{['_formItem']=null;constructor(_0x448e88,_0x1ccec5,_0x11b12e){super(_0x448e88),this['argsKey']=_0x1ccec5?.['argsKey'];if('dropdown'===_0x1ccec5['formType'])this['_formItem']=new ua(this['locale'],_0x1ccec5);this['set']('value',''),this['bind']('value')['to'](this['_formItem'],'formValue');const _0x43e067=new _0x26f547(this['locale'],{'children':[this['_formItem']],'class':[_0x11b12e?'ck-form__row_with-submit':'']});_0x11b12e&&_0x43e067['children']['add'](_0x11b12e),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai_review__form-item','ck-reset_all']},'children':[_0x43e067]});}['resetToDefault'](){this['_formItem']['resetToDefault']();}}class _a extends _0x1e77c0{['keystrokes'];static ['MIN_ROWS']=0x1;static ['MAX_ROWS']=0xc;constructor(_0x540b0e){super(_0x540b0e),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 _0x19e880();['submitButtonView'];['cancelButtonView'];['promptInputView'];['actionsFooterView'];['_modelSelectionDropdown'];['_modelNameView'];['_modelSelectionDropdownItems'];['_check'];['_defaultValue'];['_defaultLabel'];constructor(_0x15bd16,_0x4435c3,_0x29d7ef=!0x1){super(_0x15bd16),this['_check']=_0x4435c3,this['set']('prompt',''),this['set']('modelId',''),this['set']('modelDisplayMode','selector'),this['set']('activeModelName',null),this['_defaultValue']=_0x4435c3['defaultModel']?_0x4435c3['defaultModel']['id']:'',this['_defaultLabel']=_0x4435c3['defaultModel']?_0x4435c3['defaultModel']['name']:'',this['submitButtonView']=this['_createSubmitButtonView'](),this['cancelButtonView']=this['_createCancelButtonView'](),(this['promptInputView']=new te(this['locale'],()=>new _a(_0x15bd16)),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'](_0x29d7ef),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 _0x26f547(this['locale'],{'children':[this['promptInputView']]}),new _0x26f547(this['locale'],{'children':[this['actionsFooterView']]})]}),this['promptInputView']['fieldView']['keystrokes']['set']('Enter',(_0x17ba3a,_0x1dea5a)=>{this['_isValid']()?(this['fire']('runReviewCheck',{'id':'custom','args':{'prompt':this['prompt'],'model':this['modelId']},'isCustom':!0x0}),_0x1dea5a()):_0x1dea5a();}),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'](_0x638161=>{this['_focusables']['add'](_0x638161),this['focusTracker']['add'](_0x638161['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 _0x5f3e9e of this['_getFormValidators']()){const _0x282a6b=_0x5f3e9e();if(_0x282a6b)return this['promptInputView']['errorText']=_0x282a6b,!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 _0x117794=new Nt(this['locale']),t=this['locale']['t'];return _0x117794['set']({'label':t('Submit'),'withText':!0x0,'class':cs}),_0x117794['on']('execute',()=>{this['_isValid']()&&this['fire']('runReviewCheck',{'id':'custom','args':{'prompt':this['prompt'],'model':this['modelId']},'isCustom':!0x0});}),_0x117794;}['_createCancelButtonView'](){const _0x3de171=new Nt(this['locale']),t=this['locale']['t'];return _0x3de171['set']({'label':t('Cancel'),'withText':!0x0,'class':us}),_0x3de171['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x1fbd8f=>{_0x1fbd8f['stopPropagation']();})}}),_0x3de171['on']('execute',()=>{this['resetToDefault'](),this['fire']('closeCustomCheck');}),_0x3de171;}['_setModelList'](_0x5b5958){this['_modelSelectionDropdownItems']['clear']();const _0x13d841=this['_check']['models'];if(_0x5b5958)this['set']('modelDisplayMode','hidden');else{const _0x3dfd98=0x1===_0x13d841['length'];this['set']('modelDisplayMode',_0x3dfd98?'name':'selector');}if(this['resetToDefault'](),_0x13d841?.['length']){0x1===_0x13d841['length']&&this['set']('activeModelName',_0x13d841[0x0]['name']||_0x13d841[0x0]['id']);for(const _0x322567 of _0x13d841){const _0x1a985f=new Jt({'label':_0x322567['name'],'withText':!0x0,'role':'menuitemradio','id':_0x322567['id'],'model':_0x322567});_0x1a985f['bind']('isOn')['to'](this,'modelId',_0x45bc30=>_0x45bc30===_0x322567['id']),this['_modelSelectionDropdownItems']['add']({'type':'button','model':_0x1a985f,'labelView':new Ia(this['locale'],_0x322567)});}}}['_createModelSelectionDropdown'](){const _0x59628b=Gt(this['locale']);return _0x59628b['set']({'panelPosition':'se','class':'ck-ai_review__check-list-item-model-dropdown'}),_0x59628b['buttonView']['set']({'label':this['_defaultLabel'],'withText':!0x0,'tooltip':!0x0,'class':us}),_0x59628b['buttonView']['bind']('isVisible')['to'](this,'modelDisplayMode',_0x26f8e7=>'selector'===_0x26f8e7),this['listenTo'](_0x59628b,'execute',_0x5779a3=>{this['modelId']=_0x5779a3['source']['model']['id'],_0x59628b['buttonView']['label']=_0x5779a3['source']['label'];}),_0x59628b;}['_createModelNameView'](){const _0x41a8f2=new Aa(this['locale']);return _0x41a8f2['bind']('text')['to'](this,'activeModelName',_0x57db97=>_0x57db97??''),_0x41a8f2['bind']('isVisible')['to'](this,'modelDisplayMode',_0x343ce6=>'name'===_0x343ce6),_0x41a8f2;}['_createActionsFooterView'](){const _0x1cf29e=new vt(this['locale']);return _0x1cf29e['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']]}]}),_0x1cf29e;}}class Aa extends vt{constructor(_0x2a1e8a){super(_0x2a1e8a),this['set']('text',void 0x0),this['set']('isVisible',!0x0);const _0x2b8dda=this['bindTemplate'];this['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai_review__check-list-item-model-name',_0x2b8dda['if']('isVisible','ck-hidden',_0x459597=>!_0x459597)]},'children':[{'text':_0x2b8dda['to']('text')}]});}}class Ia extends Mt{constructor(_0xb71950,_0x59c3cf){super();const _0x1b0d6e=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-button__label'],'style':_0x1b0d6e['to']('style'),'id':_0x1b0d6e['to']('id')},'children':[{'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-model-dropdown-name']},'children':[{'tag':'span','children':[{'text':_0x1b0d6e['to']('text')}]}]},{'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-model-dropdown-description']},'children':[{'tag':'span','children':[_0x59c3cf['description']||'']}]}]});}}class Ea extends Ht{['_formItemsCollection']=new _0x19e880();['_customCheckView']=null;['_hideModels']=!0x1;constructor(_0x43736d,_0x292e55,_0xc7ee38,_0x496797=!0x1){super(_0x43736d),this['_hideModels']=_0x496797,this['set']('isParametrizedViewOpen',!0x1),this['set']('isListItemRendered',!0x1),this['set']('isItemParametrized',_0x292e55['isParameterized']);const _0x337a5e=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',_0x5d017b=>_0x5d017b),this['bindTemplate']['if']('isListItemRendered','ck-ai_review__check-list-item_rendered',_0x2f006a=>_0x2f006a)],'style':{'--ck-ai-review-check-list-item-index':_0xc7ee38}},'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':_0x292e55['title']}]},_0x337a5e]},{'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-description']},'children':_0x292e55['description']?[{'text':_0x292e55['description']}]:[]}]}]},..._0x292e55['isParameterized']?[this['_createParameterizedView'](_0x292e55)]:[],...'custom'===_0x292e55['id']?[this['_createCustomView'](_0x292e55,this['_hideModels'])]:[]]}),this['on']('click',()=>{_0x292e55['isParameterized']?this['isParametrizedViewOpen']=!0x0:this['fire']('runReviewCheck',{'id':_0x292e55['id'],'args':_0x292e55['useArgs']?_0x292e55['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'](_0x2cade6=>{_0x2cade6['resetToDefault']();}),this['_customCheckView']&&this['_customCheckView']['resetToDefault']();}['_createIconView'](){const _0x26786e=new xt();return _0x26786e['content']=rt,_0x26786e['extendTemplate']({'attributes':{'class':['ck-ai_review__check-list-item-title-icon']}}),_0x26786e;}['_createParameterizedView'](_0x535d45){const _0x1f3539=new vt(),_0x51c22d=this['_createFormView'](_0x535d45);return _0x1f3539['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-parameterized',this['bindTemplate']['if']('isParametrizedViewOpen','ck-hidden',_0x20479b=>!_0x20479b)]},'children':[_0x51c22d]}),_0x1f3539;}['_createFormView'](_0x3f9cf6){const _0x2eeb9f=new vt(),_0x1799f3=Array['isArray'](_0x3f9cf6['options'])?_0x3f9cf6['options']:[],_0x4a612a=new Nt(this['locale']),t=this['locale']['t'];_0x4a612a['set']({'label':t('Submit'),'withText':!0x0,'class':cs}),_0x4a612a['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0xfeba3c=>{_0xfeba3c['stopPropagation']();})}}),_0x4a612a['on']('execute',()=>{const _0x2b162b=[],_0x591c86={};this['_formItemsCollection']['forEach'](_0x3b714d=>{_0x2b162b['push'](_0x3b714d['value']),_0x3f9cf6['useArgs']&&_0x3f9cf6['options']&&(_0x591c86[_0x3b714d['argsKey']]=_0x3b714d['value']);}),this['fire']('runReviewCheck',{'id':_0x3f9cf6['id'],'params':_0x2b162b['length']?_0x2b162b:void 0x0,'args':Object['keys'](_0x591c86)['length']?_0x591c86:void 0x0});});const _0x5bf3f6=_0x1799f3['length'];return _0x1799f3['forEach']((_0x480963,_0x3ca6ab)=>{const _0x81caff=_0x3ca6ab===_0x5bf3f6-0x1;this['_formItemsCollection']['add'](new da(this['locale'],_0x480963,_0x81caff?_0x4a612a:null));}),_0x2eeb9f['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-parameterized-form']},'children':this['_formItemsCollection']}),_0x2eeb9f;}['_createCustomView'](_0x464be0,_0x2e6d22=!0x1){return this['_customCheckView']=new ga(this['locale'],_0x464be0,_0x2e6d22),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',_0x28eb6f=>!_0x28eb6f)]}}),this['_customCheckView']['delegate']('runReviewCheck')['to'](this),this['listenTo'](this['_customCheckView'],'closeCustomCheck',()=>{this['isParametrizedViewOpen']=!0x1;}),this['on']('change:isParametrizedViewOpen',(_0x57e7ab,_0x576f4f,_0x3cc886)=>{_0x3cc886||this['_customCheckView']['resetFormValidationStatus']();}),this['_customCheckView'];}}class pa extends Ht{['_checkViews'];constructor(_0x3027f0){super(_0x3027f0),this['_checkViews']=new _0x19e880(),this['_setupTemplate']();}['setChecks'](_0xd26db6,_0x57ae3a=!0x1){this['_checkViews']['clear']();for(const [_0x283f8e,_0x4e53c4]of _0xd26db6['entries']()){const _0xd7c711=new Ea(this['locale'],_0x4e53c4,_0x283f8e,_0x57ae3a);_0xd7c711['delegate']('runReviewCheck')['to'](this),this['_checkViews']['add'](_0xd7c711);}}['hasChecks'](){return this['_checkViews']['length']>0x0;}['resetAllParameterizedChecks'](){for(const _0x1df9f6 of this['_checkViews'])_0x1df9f6 instanceof Ea&&_0x1df9f6['resetToDefault']();}['_setupTemplate'](){const _0x162571=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-list',_0x162571['if']('isVisible','ck-hidden',_0x194b1e=>!_0x194b1e)]},'children':this['_checkViews']});}}class ma extends ra{static get['pluginName'](){return'AIReviewModeUI';}['createMainView'](){const _0x2e8898=this['context']['plugins']['get']('AITabs'),_0x38183b=this['context']['locale'],_0x18206c=new eo(_0x38183b,{'label':hs(_0x38183b,'AI_REVIEW_MODE'),'icon':_0x12e6a2,'class':'ck-ai-header_review','showResizeButton':_0x2e8898['showResizeButton']});return _0x18206c['delegate']('resizeTabs')['to'](_0x2e8898),_0x18206c['bind']('isMaximized')['to'](_0x2e8898['view'],'isMaximized',_0xd9184a=>_0xd9184a),new aa(this['context']['locale'],{'header':_0x18206c,'list':new pa(_0x38183b),'results':new ca(_0x38183b,{'generalErrorText':hs(_0x38183b,'AI_REVIEW_MODE_GENERAL_ERROR_MESSAGE')}),'completed':new la(_0x38183b,{'headerText':hs(_0x38183b,'AI_REVIEW_MODE_FINISH_REVIEW_HEADER_TITLE'),'emptyResultsText':hs(_0x38183b,'AI_REVIEW_MODE_EMPTY_RESULTS_TEXT'),'buttonText':hs(_0x38183b,'AI_REVIEW_MODE_FINISH_REVIEW_BUTTON_LABEL')})});}['registerTab'](){const _0x11d64f=this['context']['plugins']['get']('AITabs');_0x11d64f['view']['on']('activateTab',(_0x21b59a,{newTab:_0x3f9bd9,oldTab:_0x5d1b1a})=>{'reviewMode'===_0x3f9bd9?this['fire']('getReviewCheckList'):'reviewMode'===_0x5d1b1a&&this['fire']('leaveReview');}),_0x11d64f['view']['addTab']({'id':'reviewMode','buttonLabel':hs(this['context']['locale'],'AI_REVIEW_MODE'),'buttonIcon':_0x12e6a2,'order':0x0,'content':this['_mainView']});}}const Ta='review-',Ca=['softBreak'];class wa extends _0x35ff8d{static get['requires'](){return[_0x10431c,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(_0xd11105){super(_0xd11105),this['_domEmitter']=new(Ot())(),this['_eventEmitter']=new(Tt())();}get['emitter'](){return this['_eventEmitter'];}['afterInit'](){const _0x703f99=_0xbfe1af=>this['_scheduleAttachReviewEditingToEditor'](_0xbfe1af);if(this['_registerGlobalBalloonBlurHandler'](),this['context']instanceof _0x45e816)return void this['_attachReviewEditingToEditor'](this['context']);const _0x268a48=this['context'];for(const _0x4b7aba of _0x268a48['editors'])_0x703f99(_0x4b7aba);this['listenTo'](_0x268a48['editors'],'add',(_0x17e15b,_0x4cd899)=>{_0x703f99(_0x4cd899);}),this['listenTo'](_0x268a48['editors'],'remove',(_0x587aa0,_0x5e5bb4)=>{for(const [_0x533c95,_0x57ae20]of this['_markers'])_0x57ae20['editor']===_0x5e5bb4&&(this['_eventEmitter']['fire']('changeMarkerRemoved',{'markerId':_0x533c95,'changeId':_0x57ae20['groupId']}),this['_markers']['delete'](_0x533c95));});}['_scheduleAttachReviewEditingToEditor'](_0x1050c8){const _0x235f9c=()=>{'destroyed'!==_0x1050c8['state']&&_0x1050c8['conversion']&&this['_attachReviewEditingToEditor'](_0x1050c8);};if('ready'===_0x1050c8['state'])return void _0x235f9c();const _0xff702=()=>{this['stopListening'](_0x1050c8,'ready',_0xff702),_0x235f9c();};this['listenTo'](_0x1050c8,'ready',_0xff702);}['_attachReviewEditingToEditor'](_0x452939){this['_reviewEditingAttachedEditors']['has'](_0x452939)||(_0x452939['conversion']['for']('editingDowncast')['markerToElement']({'model':Ta+'insert','view':(_0x5f580b,{writer:_0x342643})=>{const _0x2fd5fd=this['_markers']['get'](_0x5f580b['markerName']),_0x4f4340={'class':'ck-ai_review-marker_add'+(this['_activeMarkers']['has'](_0x2fd5fd?.['id']||'')?'\x20ck-ai_review__change_active':''),'data-marker-id':_0x5f580b['markerName']};return _0x342643['createUIElement']('span',_0x4f4340,function(_0x360b53){const _0x6e19d5=this['toDomElement'](_0x360b53);return _0x6e19d5['innerHTML']=_0x2fd5fd?.['content']?.['asString']||'',_0x6e19d5;});}}),_0x452939['conversion']['for']('editingDowncast')['markerToHighlight']({'model':Ta+'remove-only','view':_0x5ca2fb=>{const _0x358c7c=this['_markers']['get'](_0x5ca2fb['markerName']),_0x4fdb29=['ck-ai_review-marker_strikethrough'];return this['_activeMarkers']['has'](_0x358c7c?.['id']||'')&&_0x4fdb29['push']('ck-ai_review__change_active'),{'classes':_0x4fdb29,'attributes':{'data-marker-id':_0x5ca2fb['markerName']}};}}),_0x452939['conversion']['for']('editingDowncast')['markerToHighlight']({'model':Ta+'remove-context','view':_0x3d524f=>{const _0x4b3f0e=this['_markers']['get'](_0x3d524f['markerName']),_0x1c258c=['ck-ai_review-marker_underline'];return this['_activeMarkers']['has'](_0x4b3f0e?.['id']||'')&&_0x1c258c['push']('ck-ai_review__change_active'),{'classes':_0x1c258c,'attributes':{'data-marker-id':_0x3d524f['markerName']}};}}),_0x452939['conversion']['for']('editingDowncast')['markerToHighlight']({'model':Ta+'remove-text','view':_0x5cbbdc=>{const _0x5d4590=this['_markers']['get'](_0x5cbbdc['markerName']),_0x78fc6e=['ck-ai_review-marker_hide'];return this['_activeMarkers']['has'](_0x5d4590?.['id']||'')&&_0x78fc6e['push']('ck-ai_review__change_active'),{'classes':_0x78fc6e,'attributes':{'data-marker-id':_0x5cbbdc['markerName']}};}}),_0x452939['conversion']['for']('dataDowncast')['markerToElement']({'model':Ta+'suggestion-context','view':(_0x48f19f,{writer:_0x57a9b2})=>_0x57a9b2['createRawElement']('span',{'class':'ck-ai_review-marker_context-'+(_0x48f19f['isOpening']?'start':'end')})}),_0x452939['conversion']['for']('downcast')['attributeToAttribute']({'model':_0x29c3ff,'view':_0x3dbc12}),this['_updateMouseMarkerInteractionListeners'](_0x452939),this['listenTo'](_0x452939,'addRoot',()=>this['_updateMouseMarkerInteractionListeners'](_0x452939),{'priority':'lowest'}),this['listenTo'](_0x452939,'detachRoot',()=>this['_updateMouseMarkerInteractionListeners'](_0x452939),{'priority':'lowest'}),_0x452939['model']['document']['registerPostFixer'](_0x1297e9=>this['_validateMarkers'](_0x452939,_0x1297e9)),_0x452939['model']['document']['on']('change',()=>this['_handleMarkerChanges'](_0x452939)),this['_reviewEditingAttachedEditors']['add'](_0x452939));}['_updateMouseMarkerInteractionListeners'](_0x6dd4a4){let _0x75a2cd=this['_boundEditables']['get'](_0x6dd4a4);_0x75a2cd||(_0x75a2cd=new Map(),this['_boundEditables']['set'](_0x6dd4a4,_0x75a2cd));const _0x2abc92=new Set(_0x6dd4a4['ui']['getEditableElementsNames']());for(const _0x54aa62 of _0x2abc92){if(_0x75a2cd['has'](_0x54aa62))continue;const _0x1c893f=_0x6dd4a4['ui']['getEditableElement'](_0x54aa62);_0x75a2cd['set'](_0x54aa62,_0x1c893f),this['_attachMouseMarkerInteractionListeners'](_0x1c893f);}for(const [_0x5ac2be,_0x45babb]of _0x75a2cd)_0x2abc92['has'](_0x5ac2be)||(_0x75a2cd['delete'](_0x5ac2be),this['_domEmitter']['stopListening'](_0x45babb));}['_attachMouseMarkerInteractionListeners'](_0x52b7ea){this['_domEmitter']['listenTo'](_0x52b7ea,'mouseup',(_0x559463,_0x1dd877)=>{const _0x19c18d=_0x1dd877['target'],_0x4027be=this['_findMarkerElement'](_0x19c18d);if(!_0x4027be)return;const _0x568bee=_0x4027be['getAttribute']('data-marker-id'),_0x4b235e=_0x568bee['split'](':')['pop']()?.['split']('_')[0x0];this['_eventEmitter']['fire']('changeMarkerClicked',{'markerId':_0x568bee,'changeId':_0x4b235e,'markerElement':()=>this['_findMarkerElementById'](_0x568bee),'domEvent':_0x1dd877});},{'usePassive':!0x0,'priority':'highest'}),this['_domEmitter']['listenTo'](_0x52b7ea,'mouseover',(_0x5123a4,_0x2c30ea)=>{const _0x3ecc80=_0x2c30ea['target'],_0x1d9cb4=_0x2c30ea['relatedTarget'];let _0x30dc3a=this['_findMarkerElement'](_0x3ecc80);if(!_0x30dc3a&&_0x1d9cb4&&(_0x30dc3a=this['_findMarkerElement'](_0x1d9cb4)),!_0x30dc3a)return;const _0x23a64a=_0x30dc3a['getAttribute']('data-marker-id'),_0x51d552=_0x23a64a['split'](':')['pop']()?.['split']('_')[0x0];this['_eventEmitter']['fire']('changeMarkerHovered',{'changeId':_0x51d552,'markerElement':()=>this['_findMarkerElementById'](_0x23a64a),'domEvent':_0x2c30ea});});}['_registerGlobalBalloonBlurHandler'](){this['_domEmitter']['listenTo'](document,'mouseover',_0x2cdc06((_0x13d123,_0x4fe59a)=>{const _0x39bd47=_0x4fe59a['target'];if(this['_findMarkerElement'](_0x39bd47))return;_0x39bd47['closest']('.ck-reset.ck-ai_review-balloon-panel-suggestion')||this['_eventEmitter']['fire']('changeMarkerBlurred');},0xc8));}['getDocumentData'](){const _0x46e7a2=this['context']['plugins']['get']('AIEditing'),_0x8f490b=Ws(this['context']);if(!_0x8f490b['length'])throw new at('ai-get-editor-from-context-no-editor',this);const _0x25856e=new Set(),_0x5014dd=[],_0x4aaa02=new Map();for(const _0x1404c5 of _0x8f490b)for(const _0x44e735 of _0x1404c5['model']['document']['getRoots']()){if('$graveyard'===_0x44e735['rootName'])continue;const _0x1e5650=this['_buildDocumentDataSliceForRoot'](_0x1404c5,_0x44e735,_0x46e7a2,_0x25856e);_0x5014dd['push'](_0x1e5650['content']);for(const [_0x3f124f,_0x520677]of _0x1e5650['elements'])_0x4aaa02['set'](_0x3f124f,_0x520677);}return{'elements':_0x4aaa02,'content':_0x5014dd['join']('')};}['_buildDocumentDataSliceForRoot'](_0x1dddfb,_0x5b9ca0,_0x2fefbe,_0x3197d){const _0x3b9958=_0x1dddfb['model'],_0x1b4365=new _0x5dc9eb();for(const _0x49fa77 of _0x5b9ca0['getChildren']())_0x1b4365['_appendChild'](_0x49fa77['_clone'](!0x0));for(const _0x1cb75d of _0x3b9958['markers']){const _0x311f18=_0x1cb75d['getRange']();_0x311f18&&_0x311f18['root']['rootName']===_0x5b9ca0['rootName']&&_0x1b4365['markers']['set'](_0x1cb75d['name'],this['_changeRangeOwnerDocument'](_0x311f18['clone'](),_0x1b4365));}const _0x3bc273=new Map(),_0x2d6237=_0x3b9958['document']['version'],_0x4ee068=new _0x42715d({'ignoreElementEnd':!0x0,'startPosition':_0x3b9958['createPositionAt'](_0x1b4365,0x0)});for(const {item:_0xbc000b}of _0x4ee068){if(!_0xbc000b['is']('$textProxy'))continue;const _0x103afc=_0xbc000b['parent'];if(!_0x103afc||!_0x103afc['is']('element'))continue;const _0x3576b3=this['_upsertDataId'](_0x103afc,()=>_0x2fefbe['_nextDataId'](_0x3197d));_0x3197d['add'](_0x3576b3);for(const _0x265fad of _0x103afc['getChildren']())_0x265fad['is']('element')&&(_0x265fad['name']&&Ca['includes'](_0x265fad['name'])||_0x3197d['add'](this['_upsertDataId'](_0x265fad,()=>_0x2fefbe['_nextDataId'](_0x3197d))));let _0x27df47=_0x103afc;for(;_0x27df47['parent']&&!_0x27df47['parent']['is']('documentFragment');)_0x27df47=_0x27df47['parent'],_0x27df47['hasAttribute'](_0x29c3ff)&&_0x27df47['_removeAttribute'](_0x29c3ff);_0x3bc273['set'](_0x3576b3,{'editor':_0x1dddfb,'rootName':_0x5b9ca0['rootName'],'path':_0x103afc['getPath'](),'documentVersion':_0x2d6237,'getContent':this['_createGetContentUsingDataIdFn'](_0x27df47['_clone'](!0x0),_0x3576b3,_0x1dddfb['data'])}),_0x4ee068['jumpTo'](_0x3b9958['createPositionAfter'](_0x103afc));}return{'content':_0x1dddfb['data']['processor']['toData'](_0x1dddfb['data']['toView'](_0x1b4365)),'elements':_0x3bc273};}['diffContent'](_0x2d9a7c,_0x4ad490,_0x3f4247,_0x3f3d95=!0x1){const _0x4023ca=[],_0x4a81af=_0x2d9a7c['data']['parse'](_0x3f4247,'$documentFragment'),_0x26fda7=_0x2d9a7c['data']['parse'](_0x4ad490,'$documentFragment'),_0x3d98b7=_0x2d9a7c['model']['createPositionAt'](_0x26fda7,0x0);if(this['_haveSingleTopLevelElement'](_0x4a81af)){if(!this['_hasSameTopLevelElement'](_0x26fda7,_0x4a81af))return _0x4023ca;}else{const _0x32893d=_0x2d9a7c['model']['schema'];if(!this['_haveOnlyInlineContent'](_0x26fda7,_0x32893d)||!this['_haveOnlyInlineContent'](_0x4a81af,_0x32893d))return _0x4023ca;}const _0x34b176=this['context']['plugins']['get']('DocumentCompare')['getDiff'](_0x4ad490,_0x3f4247,{'targetEditor':_0x2d9a7c,'anchor':_0x3d98b7,'markDeletions':!0x0})['getOperations']()['filter'](_0x16a01e=>'insert'===_0x16a01e['type']||'marker'===_0x16a01e['type']&&_0x16a01e['name']['startsWith']('$markedRemove')),_0x5004fb=this['_groupAdjacentOperations'](_0x34b176),_0x105406=[];if(_0x3f3d95){if(_0x5004fb['length']){const _0x18cd73=_0x5004fb[0x0]['operations'][0x0],_0x3f02b6='insert'===_0x18cd73['type']?_0x18cd73['position']:_0x18cd73['newRange']['start'],_0x3fdd51=this['_getPositionLimitingRange'](_0x3f02b6,_0x2d9a7c,'inside'),_0x34843c=_0x3fdd51?_0x4a81af['getChild'](0x0)['getChildren']():_0x4a81af['getChildren'](),_0x595f84=_0x3fdd51||_0x2d9a7c['model']['createRangeIn'](_0x26fda7),_0x4061a9=[new _0x37d5dc('$markedRemove:synthetic'+ot(),null,_0x595f84,_0x2d9a7c['model']['document']['model']['markers'],!0x0,_0x2d9a7c['model']['document']['version']+0x1),new _0x375457(_0x595f84['end'],_0x34843c,_0x2d9a7c['model']['document']['version']+0x2)];_0x105406['push']({'operations':_0x4061a9,'operationsIsolated':_0x4061a9,'groupOffset':0x0});}}else _0x105406['push'](..._0x5004fb);let _0x2a8ff4=0x0;return _0x2d9a7c['model']['change'](_0x201a60=>{for(let _0x1cb6c0=0x0;_0x1cb6c0<_0x105406['length'];_0x1cb6c0++){const _0x580437=_0x105406[_0x1cb6c0],_0x290c27=_0x201a60['createDocumentFragment']();for(const _0x2f809f of _0x26fda7['getChildren']())_0x201a60['append'](_0x2f809f['_clone'](!0x0),_0x290c27);for(const _0x3da07a of _0x580437['operationsIsolated'])if('insert'===_0x3da07a['type']){const _0x56169d=_0x3da07a;_0x56169d['baseVersion']=null,_0x56169d['isDocumentOperation']=!0x1,this['_changeOperationOwnerDocument'](_0x56169d,_0x290c27),_0x201a60['batch']['addOperation'](_0x3da07a),_0x2d9a7c['model']['applyOperation'](_0x3da07a);const _0x206092='suggestion:insertion:id:authorId:'+_0x2a8ff4++,_0x1b6545=_0x2d9a7c['model']['createRange'](_0x56169d['position'],_0x56169d['position']['getShiftedBy'](_0x56169d['howMany']));_0x290c27['markers']['set'](_0x206092,_0x1b6545);}else{if('marker'===_0x3da07a['type']&&_0x3da07a['name']['startsWith']('$markedRemove')){const _0x4159ae=_0x3da07a,_0x567078='suggestion:deletion:id:authorId:'+_0x2a8ff4++;this['_changeOperationOwnerDocument'](_0x4159ae,_0x290c27),_0x290c27['markers']['set'](_0x567078,_0x4159ae['newRange']);}}if(_0x3f3d95)_0x4023ca['push']({..._0x580437,'context':this['_createGetContentFn'](_0x26fda7,_0x2d9a7c['data']),'content':this['_createGetContentFn'](_0x26fda7,_0x2d9a7c['data'])});else{const _0x46a923=this['_getChangeContext'](this['_changePositionOwnerDocument'](this['_getOperationStart'](_0x580437['operationsIsolated'][0x0]),_0x290c27),this['_changePositionOwnerDocument'](this['_getOperationEnd'](_0x580437['operationsIsolated'][_0x580437['operationsIsolated']['length']-0x1]),_0x290c27),_0x2d9a7c);_0x290c27['markers']['set'](Ta+'suggestion-context',new _0x2e58a9(_0x46a923['start'],_0x46a923['end'])),_0x4023ca['push']({..._0x580437,'context':this['_createGetContextFn'](_0x290c27,_0x2d9a7c['data'],{'ellipsisBefore':_0x46a923['hasContentBefore'],'ellipsisAfter':_0x46a923['hasContentAfter']}),'content':this['_createGetContentFn'](_0x290c27,_0x2d9a7c['data'])});}}}),_0x4023ca;}['markChangePositionInEditorContent'](_0x5538c0,_0x724d11){if(!_0x5538c0['length'])return;const _0x336953=_0x5538c0[0x0]['parent']['id'],_0x197f98=_0x724d11['elements']['get'](_0x336953);if(!_0x197f98)return void console['warn']('No\x20element\x20found\x20for\x20ID:\x20'+_0x336953);const _0x333984=_0x197f98['path'],_0x4a56ff=_0x197f98['editor'],_0x56089b=_0x4a56ff['model']['document']['getRoot'](_0x197f98['rootName']);if(!_0x56089b)return void console['warn']('No\x20model\x20root\x20found\x20for\x20name:\x20'+_0x197f98['rootName']);const _0xa7ab51=_0x4a56ff['model']['document']['history']['getOperations'](_0x197f98['documentVersion']),_0x5e29fb=[];for(const _0x178f5a of _0x5538c0){const _0xf92cb4=_0x178f5a['operationsIsolated']['map'](_0x42d1a2=>this['_translateOperationToEditorContent'](_0x42d1a2,_0x333984,_0x56089b));if(!_0xf92cb4||!_0xf92cb4['length'])continue;const _0x15f4fc=_0xf92cb4['every'](_0x103a90=>'marker'===_0x103a90['type']&&_0x103a90['name']['startsWith']('$markedRemove')),_0x462ad6={'document':_0x4a56ff['model']['document'],'useRelations':!0x1,'padWithNoOps':!0x1},_0x57d294=_0x5bfae1(_0xf92cb4,_0xa7ab51,_0x462ad6)['operationsA'];for(const _0x34c27e of _0x57d294)if('insert'===_0x34c27e['type']){const _0x55d2e3=_0x34c27e,_0xde062d=_0x55d2e3['nodes'];_0x4a56ff['model']['change'](_0x543ea3=>{const _0x1735f0=_0x543ea3['createDocumentFragment']();for(const _0x21c3b1 of _0xde062d)_0x543ea3['append'](_0x21c3b1['_clone'](!0x0),_0x1735f0);_0x5e29fb['push']({'start':_0x55d2e3['position'],'end':_0x55d2e3['position'],'type':'insert','groupId':_0x178f5a['id'],'content':{'asString':this['_createGetContentFn'](_0x1735f0,_0x4a56ff['data'])(),'asFragment':_0x1735f0}});});}else{if('marker'===_0x34c27e['type']&&_0x34c27e['name']['startsWith']('$markedRemove')){const _0x5e7911=_0x34c27e;let _0x2cec44='remove-text';if(_0x15f4fc){const _0x233a24=this['_findAdjacentContextDistance'](_0x5e7911['newRange']['start'],'backward',_0x4a56ff['model']['schema']),_0x17e4aa=this['_findAdjacentContextDistance'](_0x5e7911['newRange']['end'],'forward',_0x4a56ff['model']['schema']);if(_0x233a24||_0x17e4aa){const _0x47b016=_0x5e7911['newRange']['start']['getShiftedBy'](-_0x233a24),_0x226c43=_0x5e7911['newRange']['end']['getShiftedBy'](_0x17e4aa);_0x5e29fb['push']({'start':_0x47b016,'end':_0x226c43,'groupId':_0x178f5a['id'],'type':'remove-context'});}else _0x2cec44='remove-only';}_0x5e29fb['push']({'start':_0x5e7911['newRange']['start'],'end':_0x5e7911['newRange']['end'],'groupId':_0x178f5a['id'],'type':_0x2cec44});}}}this['_insertMarkers'](_0x5e29fb,_0x4a56ff);}['clearAllMarkers'](){const _0x4d9522=new Map();for(const _0x1df9f3 of this['_markers']['keys']()){const _0x14805a=this['_markers']['get'](_0x1df9f3);_0x14805a?.['editor']&&(_0x4d9522['has'](_0x14805a['editor'])||_0x4d9522['set'](_0x14805a['editor'],[]),_0x4d9522['get'](_0x14805a['editor'])['push'](_0x1df9f3));}for(const [_0x2cc37e,_0x36a9e7]of _0x4d9522)_0x2cc37e['model']['change'](_0x5e89e8=>{for(const _0xe5df34 of _0x36a9e7)_0x2cc37e['model']['markers']['get'](_0xe5df34)&&_0x5e89e8['removeMarker'](_0xe5df34);});this['_markers']['clear'](),this['_activeMarkers']['clear']();}['switchToReadOnly'](){for(const _0x3ce093 of Ws(this['context']))_0x3ce093['enableReadOnlyMode']('ai-review');}['switchToEdit'](){for(const _0x1a748d of Ws(this['context']))_0x1a748d['disableReadOnlyMode']('ai-review');}['applyChange'](_0x90d046){const _0x15614e=_0x90d046['map'](_0x3cdc8a=>this['_getMarkersDataForGroup'](_0x3cdc8a))['flat'](),_0x50a608=new Map();for(const _0x135bc5 of _0x15614e)_0x50a608['has'](_0x135bc5['editor'])||_0x50a608['set'](_0x135bc5['editor'],[]),_0x50a608['get'](_0x135bc5['editor'])['push'](_0x135bc5);for(const [_0x3c1ab9,_0x3c8487]of _0x50a608){const _0x1170fc=_0x3c1ab9['model'];_0x1170fc['change'](_0xecd19d=>{for(const _0x4df83b of _0x3c8487){const _0x3bd1c1=_0x3c1ab9['model']['markers']['get'](_0x4df83b['id']);if(_0x3bd1c1){if('insert'===_0x4df83b['type']){if(!_0x4df83b['content'])continue;_0x1170fc['insertContent'](_0x4df83b['content']['asFragment']||null,_0x3bd1c1['getRange']()['start']);}else'remove-text'!==_0x4df83b['type']&&'remove-only'!==_0x4df83b['type']||_0x1170fc['deleteContent'](_0x1170fc['createSelection'](_0x3bd1c1['getRange']()));_0xecd19d['removeMarker'](_0x4df83b['id']),this['_markers']['delete'](_0x4df83b['id']);}}});}}['rejectChange'](_0x404254){const _0x464d65=this['_getMarkersDataForGroup'](_0x404254),_0x28170a=new Map();for(const _0x40f7d9 of _0x464d65)_0x28170a['has'](_0x40f7d9['editor'])||_0x28170a['set'](_0x40f7d9['editor'],[]),_0x28170a['get'](_0x40f7d9['editor'])['push'](_0x40f7d9);for(const [_0x52acc8,_0x305c5b]of _0x28170a)_0x52acc8['model']['change'](_0xa11d4b=>{for(const _0x55579b of _0x305c5b)_0xa11d4b['removeMarker'](_0x55579b['id']),this['_markers']['delete'](_0x55579b['id']);});}['getEditor'](){return $s(this['context']);}['getEditors'](){return Ws(this['context']);}['getEditorForChange'](_0x4290c1){const _0x263cc7=this['_getMarkersDataForGroup'](_0x4290c1);return _0x263cc7[0x0]?.['editor'];}['getMarkerElementForChange'](_0x136ce3){const _0x5d5b1f=Array['from'](this['_markers']['values']())['filter'](_0x2589af=>_0x2589af['groupId']===_0x136ce3);if(!_0x5d5b1f['length'])return null;const _0x24858f=0x1===_0x5d5b1f['length']?_0x5d5b1f[0x0]:this['_sortMarkers'](_0x5d5b1f)[0x0],_0x506528=_0x24858f['editor']['model']['markers']['get'](_0x24858f['id']);if(!_0x506528)return null;return{'modelRange':_0x506528['getRange'](),'getElement':()=>this['_findMarkerElementById'](_0x24858f['id'])};}['getContentElementForChange'](_0x2eb1b9){const _0x1795eb=Array['from'](this['_markers']['values']())['filter'](_0x2a3f60=>_0x2a3f60['groupId']===_0x2eb1b9);if(!_0x1795eb['length'])return null;const _0x3530f9=0x1===_0x1795eb['length']?_0x1795eb[0x0]:this['_sortMarkers'](_0x1795eb)[0x0],_0x4f21d1=_0x3530f9['editor'],_0x22a8aa=_0x4f21d1['model']['markers']['get'](_0x3530f9['id']);if(!_0x22a8aa)return null;const _0x38c31a=_0x22a8aa['getRange'](),_0x241a22=_0x4f21d1['editing']['view']['getDomRoot'](_0x38c31a['root']['rootName'])||_0x4f21d1['editing']['view']['getDomRoot']();if(!_0x241a22||!_0x38c31a)return null;let _0x43624c=_0x38c31a['start']['parent'];for(;_0x43624c['parent']&&'$root'!==_0x43624c['parent']['name'];)_0x43624c=_0x43624c['parent'];if(!_0x43624c||!_0x43624c['name'])return null;const _0x3f566e=_0x241a22['querySelector']('[data-marker-id=\x22'+_0x3530f9['id']+'\x22]');if(!_0x3f566e)return null;let _0x3a0b58=null;_0x4f21d1['model']['change'](_0x4dfb74=>{_0x3a0b58=_0x4dfb74['createDocumentFragment'](),_0x4dfb74['append'](_0x43624c['_clone'](!0x0),_0x3a0b58);});const _0x48fe26=_0x4f21d1['data']['toView'](_0x3a0b58)['getChild'](0x0);return _0x3f566e['closest'](_0x48fe26['name']);}['reactivateMarkers'](_0x567603){const _0x104d4c=this['_getMarkersDataForGroup'](_0x567603);if(!_0x104d4c['length'])return;const _0x5a00dc=Array['from'](this['_activeMarkers'])['sort'](),_0x1a3258=Array['from'](new Set(_0x104d4c['map'](_0x8aead6=>_0x8aead6['id'])))['sort']();_0x5a00dc['join']('|')!==_0x1a3258['join']('|')&&(this['setAllMarkersAsInactive'](),this['setMarkersInElementAsActive'](_0x567603));}['setMarkersInElementAsActive'](_0x2acd0b){const _0x1cd388=this['_getMarkersDataForGroup'](_0x2acd0b);if(!_0x1cd388['length'])return;const _0x3d904d=_0x1cd388[0x0]['editor'],_0x1b5cf3=new Set(_0x1cd388['map'](_0x1d4197=>_0x1d4197['id'])),_0x5aa629=Array['from'](_0x1b5cf3['values']())['map'](_0x36db38=>_0x3d904d['model']['markers']['get'](_0x36db38))['filter'](_0x195463=>!!_0x195463);_0x1b5cf3['forEach'](_0xe756af=>{this['_activeMarkers']['add'](_0xe756af);}),_0x3d904d['model']['change'](()=>{_0x5aa629['forEach'](_0x168272=>{_0x3d904d['editing']['reconvertMarker'](_0x168272);});});}['setAllMarkersAsInactive'](){const _0x301465=Array['from'](this['_activeMarkers']);if(!_0x301465['length'])return;this['_activeMarkers']['clear']();const _0x79fa8e=new Map();for(const _0x2f9b3a of _0x301465){const _0xe1c830=this['_markers']['get'](_0x2f9b3a);if(!_0xe1c830)continue;const _0x2917ad=_0xe1c830['editor'],_0x270f09=_0x2917ad['model']['markers']['get'](_0x2f9b3a);_0x270f09&&(_0x79fa8e['has'](_0x2917ad)||_0x79fa8e['set'](_0x2917ad,[]),_0x79fa8e['get'](_0x2917ad)['push'](_0x270f09));}for(const [_0x3be17c,_0x4303f4]of _0x79fa8e)_0x3be17c['model']['change'](()=>{_0x4303f4['forEach'](_0x3b55b6=>{_0x3be17c['editing']['reconvertMarker'](_0x3b55b6);});});}['_getPositionLimitingRange'](_0x5b61aa,_0x1e143d,_0x598c90='outside'){if(!_0x5b61aa)return null;let _0x5d3c98=_0x5b61aa['parent'];for(;_0x5d3c98&&_0x5d3c98['parent']&&'$root'!==_0x5d3c98['parent']['name']&&!_0x1e143d['model']['schema']['isLimit'](_0x5d3c98)&&!_0x1e143d['model']['schema']['isBlock'](_0x5d3c98);)_0x5d3c98=_0x5d3c98['parent'];if(!_0x5d3c98||!_0x5d3c98['name']||'$root'===_0x5d3c98['name'])return null;let _0xe836ab=null;return _0x1e143d['model']['change'](_0x31953a=>{_0xe836ab='inside'===_0x598c90?_0x31953a['createRangeIn'](_0x5d3c98):_0x31953a['createRangeOn'](_0x5d3c98);}),_0xe836ab;}['_validateMarkers'](_0x1547b0,_0xbdc301){const _0x33fdbc=Array['from'](this['_markers']['keys']()),_0x264484=new Map();for(const _0x2cac22 of _0x33fdbc){const _0x10312a=_0x1547b0['model']['markers']['get'](_0x2cac22);if(!_0x10312a)continue;const _0x2c4fc9=_0x10312a['getStart']()['root']['rootName']+':'+_0x10312a['getStart']()['path'][0x0];_0x264484['has'](_0x2c4fc9)||_0x264484['set'](_0x2c4fc9,[]),_0x264484['get'](_0x2c4fc9)['push'](_0x10312a);}const _0xbe5329=new Set();for(const _0xdda689 of _0x1547b0['model']['document']['differ']['getChanges']()){let _0x4c75a4='',_0x3e0e23=null;if('insert'===_0xdda689['type'])_0x3e0e23=new _0x2e58a9(_0xdda689['position'],_0xdda689['position']['getShiftedBy'](_0xdda689['length'])),_0x4c75a4=_0xdda689['position']['root']['rootName']+':'+_0xdda689['position']['path'][0x0];else{if('remove'!==_0xdda689['type'])continue;_0x3e0e23=new _0x2e58a9(_0xdda689['position']),_0x4c75a4=_0xdda689['position']['root']['rootName']+':'+_0xdda689['position']['path'][0x0];}const _0x37159c=_0x264484['get'](_0x4c75a4)||[];if(_0x37159c['length']){for(const _0x18eb9c of _0x37159c)if(_0x3e0e23['root']['rootName']===_0x18eb9c['getRange']()['root']['rootName']&&('insert'!==_0xdda689['type']||!_0x3e0e23['containsRange'](_0x18eb9c['getRange']()))&&(_0x3e0e23['isIntersecting'](_0x18eb9c['getRange']())||_0x3e0e23['start']['isTouching'](_0x18eb9c['getRange']()['end'])||_0x3e0e23['end']['isTouching'](_0x18eb9c['getRange']()['start']))){const _0x8f4eb2=this['_parseMarkerName'](_0x18eb9c['name']);Array['from'](this['_markers']['values']())['filter'](_0x5bbfbc=>_0x5bbfbc['groupId']===_0x8f4eb2['groupId'])['forEach'](_0x111c40=>_0xbe5329['add'](_0x111c40['id']));}}}if(_0xbe5329['size']){for(const _0x3e9d3a of _0xbe5329)_0xbdc301['removeMarker'](_0x3e9d3a);return!0x0;}return!0x1;}['_handleMarkerChanges'](_0xf20a2b){for(const {name:_0x3e30f9,data:_0x3f073e}of _0xf20a2b['model']['document']['differ']['getChangedMarkers']()){if(!_0x3e30f9['startsWith'](Ta))continue;const _0x547590=_0x3f073e['oldRange'],_0x2564b1=_0x3f073e['newRange'],_0x4cf80f=_0x547590&&'$graveyard'===_0x547590['root']['rootName'],_0x529ff2=_0x2564b1&&'$graveyard'===_0x2564b1['root']['rootName'];if(_0x4cf80f&&_0x529ff2)continue;const _0x97054f=this['_parseMarkerName'](_0x3e30f9);this['_markers']['get'](_0x3e30f9)&&(_0x529ff2||!_0x2564b1?this['_eventEmitter']['fire']('changeMarkerRemoved',{'markerId':_0x3e30f9,'changeId':_0x97054f['groupId']}):_0x4cf80f&&_0x2564b1&&this['_eventEmitter']['fire']('changeMarkerRestored',{'markerId':_0x3e30f9,'changeId':_0x97054f['groupId']}));}}['_parseMarkerName'](_0x2f95e9){const _0x219120=_0x2f95e9['split'](':'),_0x5787e9=(_0x219120[0x1]||'')['split']('_');return{'prefix':_0x219120[0x0],'groupId':_0x5787e9[0x0],'suffix':_0x5787e9[0x1]};}['_translateOperationToEditorContent'](_0x504c4b,_0x5684c9,_0x4b6be5){if('insert'===_0x504c4b['type']){const _0x22de53=_0x504c4b;return new _0x375457(this['_changePosition'](_0x5684c9['concat'](_0x22de53['position']['offset']),_0x4b6be5),_0x22de53['nodes'],_0x22de53['baseVersion']);}if('marker'===_0x504c4b['type']&&_0x504c4b['name']['startsWith']('$markedRemove')){const _0x489f21=_0x504c4b;return new _0x37d5dc(_0x489f21['name'],_0x489f21['oldRange'],this['_changeRange'](_0x489f21['newRange'],_0x5684c9['concat'](_0x489f21['newRange']['start']['offset']),_0x5684c9['concat'](_0x489f21['newRange']['end']['offset']),_0x4b6be5),_0x489f21['_markers'],_0x489f21['affectsData'],_0x489f21['baseVersion']);}return _0x504c4b;}['_groupAdjacentOperations'](_0x18ca6){if(!_0x18ca6['length'])return[];const _0x1d79ac=[];let _0xf72491=0x0,_0x439516=0x0,_0x105200=[];for(let _0x4025bd=0x0;_0x4025bd<=_0x18ca6['length'];_0x4025bd++){const _0x44f6ea=_0x18ca6[_0x4025bd],_0x1a35f6=_0x18ca6[_0x4025bd-0x1];!_0x44f6ea||_0x1a35f6&&!this['_getOperationEnd'](_0x1a35f6)['isTouching'](this['_getOperationStart'](_0x44f6ea))?(_0x1d79ac['push']({'operations':_0x105200,'operationsIsolated':_0x105200['map'](_0x14f280=>this['_shiftOperation'](_0x14f280['clone'](),-_0x439516)),'groupOffset':_0xf72491}),_0x105200=_0x44f6ea?[_0x44f6ea]:[],_0x439516+=_0xf72491,_0xf72491=0x0):_0x105200['push'](_0x44f6ea),_0x44f6ea&&'insert'===_0x44f6ea['type']&&(_0xf72491+=_0x44f6ea['howMany']);}return _0x1d79ac;}['_findAdjacentContextDistance'](_0x162925,_0x5390f0,_0x13f953,_0x3f4fa0=0x1){const _0x17aa74=new _0x42715d({'startPosition':_0x162925,'direction':_0x5390f0});let _0x7ab800=0x0;for(let _0x3ca200=0x0;_0x3ca200<_0x3f4fa0;_0x3ca200++){let _0x535e1c=0x0,_0x81c8b7=!0x1,_0x54b795='forward'===_0x5390f0?/^\W*\w+/:/\w+\W*$/;for(const {item:_0x3129c9}of _0x17aa74)if(_0x3129c9['is']('$textProxy')){const _0x1740e4=_0x54b795['exec'](_0x3129c9['data']);if(_0x1740e4&&_0x1740e4['length']){if(_0x535e1c+='forward'===_0x5390f0?_0x1740e4['index']+_0x1740e4[0x0]['length']:_0x3129c9['data']['length']-_0x1740e4['index'],_0x1740e4[0x0]['length']!==_0x3129c9['data']['length'])break;_0x81c8b7=!0x0,_0x54b795='forward'===_0x5390f0?/^\w+/:/\w+$/;}else{if(_0x81c8b7)break;_0x535e1c+=_0x3129c9['offsetSize'];}}else{if(_0x3129c9['is']('element')){_0x13f953['isInline'](_0x3129c9)&&!_0x81c8b7&&(_0x535e1c+=0x1);break;}}_0x7ab800+=_0x535e1c,_0x17aa74['jumpTo'](_0x162925['getShiftedBy']('forward'===_0x5390f0?_0x7ab800:-_0x7ab800));}return _0x7ab800;}['_getChangeContext'](_0x26bec,_0xcc5c79,_0x4a5957){const _0x195fe3=_0x4a5957['model']['schema'],_0x2da9ad=this['_findAdjacentContextDistance'](_0x26bec,'backward',_0x195fe3,0x6),_0x5aa12d=this['_findAdjacentContextDistance'](_0xcc5c79,'forward',_0x195fe3,0x6),_0x3754c1=_0x26bec['getShiftedBy'](-_0x2da9ad),_0x99f662=_0xcc5c79['getShiftedBy'](_0x5aa12d);return{'start':_0x3754c1,'end':_0x99f662,'hasContentBefore':!_0x3754c1['isAtStart'],'hasContentAfter':!_0x99f662['isAtEnd']};}['_insertMarkers'](_0x2627ca,_0x5f5a3d){const _0x3a6056=this['context']['plugins']['get']('AIEditing'),_0x7c9e5c=new Set();_0x5f5a3d['model']['change'](_0x33c97d=>{for(const _0x11cf26 of _0x2627ca){const _0x4e6754=''+Ta+_0x11cf26['type']+':'+_0x11cf26['groupId']+'_'+_0x3a6056['_nextDataId'](_0x7c9e5c);this['_markers']['set'](_0x4e6754,{'id':_0x4e6754,'groupId':_0x11cf26['groupId'],'type':_0x11cf26['type'],'content':_0x11cf26['content'],'editor':_0x5f5a3d}),_0x33c97d['addMarker'](_0x4e6754,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x33c97d['createRange'](_0x11cf26['start'],_0x11cf26['end'])});}});}['_createGetContextFn'](_0x3972bf,_0x5de14b,_0x218a36){let _0x3eca6d='';return()=>{if(!_0x3eca6d){const _0x1a94b4=_0x5de14b['toView'](_0x3972bf,{'showSuggestionHighlights':!0x0});let _0x2e69fd=_0x1a94b4['getChild'](0x0);if(_0x2e69fd['is']('containerElement')||(_0x2e69fd=_0x1a94b4),!_0x2e69fd)return'';let _0x30ae51=!0x1;const _0x33431d=[];for(const _0xb0b297 of _0x2e69fd['getChildren']())_0xb0b297['is']('element','span')&&_0xb0b297['hasClass']('ck-ai_review-marker_context-end')&&(_0x30ae51=!0x1),_0x30ae51&&_0x33431d['push'](_0xb0b297),_0xb0b297['is']('element','span')&&_0xb0b297['hasClass']('ck-ai_review-marker_context-start')&&(_0x30ae51=!0x0);_0x2e69fd['_removeChildren'](0x0,_0x2e69fd['childCount']),_0x218a36?.['ellipsisBefore']&&_0x2e69fd['_appendChild']('…'),_0x2e69fd['_appendChild'](_0x33431d),_0x218a36?.['ellipsisAfter']&&_0x2e69fd['_appendChild']('…');const _0x13aac1=_0x5de14b['htmlProcessor']['domConverter']['viewToDom'](_0x1a94b4),_0x257ed5=_0x5de14b['htmlProcessor']['htmlWriter']['getHtml'](_0x13aac1);_0x3eca6d=_0x257ed5;}return _0x3eca6d;};}['_createGetContentFn'](_0x5b7ad9,_0xf3f2ee){let _0x165fd4='';return()=>(_0x165fd4||(_0x165fd4=_0xf3f2ee['stringify'](_0x5b7ad9,{'showSuggestionHighlights':!0x0})),_0x165fd4);}['_createGetContentUsingDataIdFn'](_0x56cac1,_0x5c4731,_0x1ef297){let _0x59d473='';return()=>{if(!_0x59d473){const _0x21942e=_0x1ef297['toView'](new _0x5dc9eb(_0x56cac1)),_0x57cde4=_0x1ef297['htmlProcessor']['domConverter']['viewToDom'](_0x21942e)['querySelector']('[data-id=\x22'+_0x5c4731+'\x22]');_0x59d473=_0x57cde4?.['outerHTML']||'';}return _0x59d473;};}['_findMarkerElement'](_0x20a26b,_0x4b3cf5=0x5){let _0x31e8c3=_0x20a26b,_0x342c49=null;for(let _0x418a98=0x0;_0x418a98<_0x4b3cf5&&_0x31e8c3;_0x418a98++){if(!_0x31e8c3['className']){_0x31e8c3=_0x31e8c3['parentElement'];continue;}if(!(''+_0x31e8c3['className'])['includes']('ck-ai_review-marker_')){_0x31e8c3=_0x31e8c3['parentElement'];continue;}if(!_0x31e8c3['getAttribute']('data-marker-id'))break;_0x342c49=_0x31e8c3;break;}return _0x342c49;}['_findMarkerElementById'](_0x49d71e){const _0x13de77=this['_markers']['get'](_0x49d71e),_0x35638a=_0x13de77?.['editor']??$s(this['context']),_0xa0ff5a=_0x35638a['model']['markers']['get'](_0x49d71e);return _0xa0ff5a?_0x2c32ec(_0x35638a['editing'],_0xa0ff5a):null;}['_getMarkersDataForGroup'](_0x237937){return Array['from'](this['_markers']['values']())['filter'](_0x3d21c5=>_0x3d21c5['groupId']===_0x237937);}['_getOperationStart'](_0x597cf7){return'insert'===_0x597cf7['type']?_0x597cf7['position']:_0x597cf7['newRange']['start'];}['_getOperationEnd'](_0x3efa9e,_0x164508=!0x1){return'insert'===_0x3efa9e['type']?_0x164508?_0x3efa9e['position']:_0x3efa9e['position']['getShiftedBy'](_0x3efa9e['howMany']):_0x3efa9e['newRange']['end'];}['_shiftOperation'](_0x27ebe0,_0x470ed0){return'insert'===_0x27ebe0['type']?_0x27ebe0['position']=_0x27ebe0['position']['getShiftedBy'](_0x470ed0):'marker'===_0x27ebe0['type']&&_0x27ebe0['newRange']&&(_0x27ebe0['newRange']=new _0x2e58a9(_0x27ebe0['newRange']['start']['getShiftedBy'](_0x470ed0),_0x27ebe0['newRange']['end']['getShiftedBy'](_0x470ed0))),_0x27ebe0;}['_changeOperationOwnerDocument'](_0x402d3,_0x1a89b1){'insert'===_0x402d3['type']?_0x402d3['position']=this['_changePositionOwnerDocument'](_0x402d3['position'],_0x1a89b1):'marker'===_0x402d3['type']&&_0x402d3['newRange']&&(_0x402d3['newRange']=this['_changeRangeOwnerDocument'](_0x402d3['newRange'],_0x1a89b1));}['_changePositionOwnerDocument'](_0x169c24,_0x38477d){return new _0x9f3aa5(_0x38477d,_0x169c24['path']);}['_changeRangeOwnerDocument'](_0x3fc030,_0x501837){return new _0x2e58a9(this['_changePositionOwnerDocument'](_0x3fc030['start'],_0x501837),this['_changePositionOwnerDocument'](_0x3fc030['end'],_0x501837));}['_changePosition'](_0x3923a8,_0x6d8799){return new _0x9f3aa5(_0x6d8799,[..._0x3923a8]);}['_changeRange'](_0x185938,_0x22d9e9,_0x1ea022,_0x3d888d){return new _0x2e58a9(this['_changePosition'](_0x22d9e9,_0x3d888d),this['_changePosition'](_0x1ea022,_0x3d888d));}['_sortMarkers'](_0x589bc5){const _0x1b175a=_0x87b2e4=>{switch(_0x87b2e4){case'insert':return 0x0;case'remove-context':return 0x1;case'remove-only':return 0x2;case'remove-text':return 0x3;}};return _0x589bc5['sort']((_0x1ca7b2,_0x4da7ef)=>_0x1b175a(_0x1ca7b2['type'])-_0x1b175a(_0x4da7ef['type']));}['_hasSameTopLevelElement'](_0x144faf,_0x1f1306){const _0x49133b=_0x144faf['getChild'](0x0),_0x1d5d01=_0x1f1306['getChild'](0x0);return!(!_0x49133b||!_0x1d5d01)&&((!_0x49133b['is']('element')||!_0x1d5d01['is']('element')||_0x49133b['name']===_0x1d5d01['name'])&&!(_0x49133b['is']('element')&&!_0x1d5d01['is']('element')||!_0x49133b['is']('element')&&_0x1d5d01['is']('element')));}['_haveSingleTopLevelElement'](_0xd94812){return 0x1===_0xd94812['childCount'];}['_haveOnlyInlineContent'](_0x313b12,_0x26e714){for(const _0x104efa of _0x313b12['getChildren']())if(_0x104efa['is']('element')&&!_0x26e714['isInline'](_0x104efa))return!0x1;return!0x0;}['_upsertDataId'](_0x411140,_0x47451a){let _0x1d9f8f=_0x411140['getAttribute'](_0x29c3ff);return _0x1d9f8f||(_0x1d9f8f=_0x47451a(),_0x411140['_setAttribute'](_0x29c3ff,_0x1d9f8f)),_0x1d9f8f;}}class fa extends Tt(){['id'];['contentNew'];['contentInitial'];['documentVersion'];constructor({id:_0x3cd2cd,contentNew:_0x5cfa2b,contentInitial:_0x39b0ae,documentVersion:_0x327451}){super(),this['id']=_0x3cd2cd,this['contentNew']=_0x5cfa2b,this['contentInitial']=_0x39b0ae,this['documentVersion']=_0x327451;}}class ba extends ht(){['id'];['parent'];['_data'];['_editorOperations']=[];constructor(_0xb7ebc6,_0x51b63d,_0x5c94f6){super(),this['id']=_0xb7ebc6,this['parent']=_0x5c94f6,this['_data']=_0x51b63d,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(_0x245055,_0x3144fb,_0x116f0f,_0xe79d90,_0xc05130){super(),this['_sourceCheck']=_0x3144fb,this['_documentData']=_0x245055,this['_aiConnector']=_0x116f0f,this['_reviewParams']=_0xe79d90,this['_reviewArgs']=_0xc05130,this['on']('change:status',(_0x1fd93b,_0x1f17e4,_0x1c6a13)=>{'aborted'==_0x1c6a13&&(this['_wasAborted']=!0x0),this['fire']('reviewCheckRunUpdated',{'status':_0x1c6a13,'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'](_0x2e4177=>'pending'===_0x2e4177['status']);}get['currentError'](){return this['_currentError'];}['updateDocumentData'](_0x3519dd){this['_documentData']=_0x3519dd;}async['start'](){this['status']='loading',this['_currentError']=void 0x0;try{this['_activeRequest']=this['_createApiRequest']();const _0x21a642=await this['_activeRequest']['getStream']();this['status']='data';for await(const _0x4460a8 of _0x21a642)'unmodified'!==_0x4460a8['data']['operation']&&('error'!==_0x4460a8['data']['operation']?'review-metadata'!==_0x4460a8['event']?this['_addReviewCheckResult'](_0x4460a8['data']['dataId'],_0x4460a8['data']['textDelta']):this['callId']=_0x4460a8['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(_0xda3da5){this['_currentError']=_0xda3da5,_0xda3da5 instanceof Error&&_0xda3da5['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'](_0x52df8f,_0x26f2fe){const _0x556657=this['_results']['get'](_0x52df8f);if(!_0x556657)return;if(0x0===_0x26f2fe['length'])return;const _0x20c4db=[];_0x26f2fe['forEach']((_0x5a8b8e,_0x115160)=>{const _0x2316ed=new ba(_0x556657['id']+'-'+_0x115160,_0x5a8b8e,_0x556657);_0x2316ed['on']('change:status',()=>{this['fire']('reviewCheckResultChangeStatusUpdated',{'change':_0x2316ed,'status':_0x2316ed['status']});}),_0x2316ed['on']('change:isActivated',()=>{_0x2316ed['isActivated']?this['fire']('reviewCheckResultActivated',{'change':_0x2316ed}):this['fire']('reviewCheckResultDeactivated',{'change':_0x2316ed});}),this['_changes']['push'](_0x2316ed),_0x20c4db['push'](_0x2316ed);}),this['fire']('reviewCheckResultReady',{'changes':_0x20c4db,'result':_0x556657,'source':this});}['abort'](){this['_activeRequest']&&(this['_activeRequest']['abortController']['abort'](),this['_activeRequest']=null,this['status']='aborted');}['isChangeActive'](_0x3d61f1){const _0x43e8e7=this['_changes']['find'](_0x40f3b=>_0x40f3b['id']===_0x3d61f1);return!(!_0x43e8e7||'pending'!==_0x43e8e7['status']);}['isAnyChangeActivated'](){return this['_changes']['some'](_0x22bd61=>!0x0===_0x22bd61['isActivated']);}['getActiveChanges'](){return this['_changes']['filter'](_0x3aa608=>'pending'===_0x3aa608['status']);}['getChangeById'](_0x2dfc4b){return this['_changes']['find'](_0x281a4f=>_0x281a4f['id']===_0x2dfc4b);}['markAllChangesAsAccepted'](){for(const _0x3fcb39 of this['_changes'])'pending'===_0x3fcb39['status']&&(_0x3fcb39['status']='accepted');this['_checkIfFinished']();}['markChangeAsAccepted'](_0x466d30){const _0x5cbbb8=this['_changes']['find'](_0x33a76d=>_0x33a76d['id']===_0x466d30);_0x5cbbb8&&'pending'===_0x5cbbb8['status']&&(_0x5cbbb8['status']='accepted'),this['_checkIfFinished']();}['markChangeAsRejected'](_0x487813){const _0x185d78=this['_changes']['find'](_0x47a61d=>_0x47a61d['id']===_0x487813);_0x185d78&&'pending'===_0x185d78['status']&&(_0x185d78['status']='rejected'),this['_checkIfFinished']();}['markChangeAsOutdated'](_0x1a53ee){const _0x4c169f=this['_changes']['find'](_0x2b2fe0=>_0x2b2fe0['id']===_0x1a53ee);_0x4c169f&&'pending'===_0x4c169f['status']&&(_0x4c169f['status']='outdated'),this['_checkIfFinished']();}['markChangeAsPending'](_0x13b3c4){const _0x474fbb=this['_changes']['find'](_0xa437cf=>_0xa437cf['id']===_0x13b3c4);_0x474fbb&&'outdated'===_0x474fbb['status']&&(_0x474fbb['status']='pending'),this['_checkIfFinished']();}['activateChange'](_0x4e914f){this['_changes']['filter'](_0x5e03cf=>_0x5e03cf['isActivated']&&_0x5e03cf['id']!==_0x4e914f)['forEach'](_0x401e96=>{_0x401e96['isActivated']=!0x1;});const _0x105f91=this['_changes']['find'](_0x491ed4=>_0x491ed4['id']===_0x4e914f);_0x105f91&&'pending'===_0x105f91['status']&&(_0x105f91['isActivated']=!0x0);}['deactivateChange'](){this['_changes']['filter'](_0x4f1453=>_0x4f1453['isActivated'])['forEach'](_0x366d2b=>{_0x366d2b['isActivated']=!0x1;});}['forceReadyState'](){this['status']='ready';}async['sendRating'](_0xbb4f71){if('initialized'===this['status']||'loading'===this['status']||'data'===this['status']||this['_wasAborted'])return;if(!this['callId']||0x0===this['_changes']['length'])return;let _0x4a1c53;if(_0xbb4f71){const _0x359b84=this['_changes']['find'](_0x780c58=>_0x780c58['id']===_0xbb4f71);if(_0x359b84&&_0x359b84['isRated'])return;_0x359b84&&(_0x4a1c53=_0x359b84['parent']['id'],_0x359b84['isRated']=!0x0);}const _0x3496af={'positiveCount':this['_changes']['filter'](_0xc0f65f=>'accepted'===_0xc0f65f['status'])['length'],'totalCount':this['_changes']['length']};this['_sendRatingRequest'](_0x3496af,this['callId'],_0x4a1c53);}['_addReviewCheckResult'](_0x291177,_0x29812e){const _0x5ade15=this['_documentData']['elements']['get'](_0x291177);if(!_0x5ade15)return;const _0x13bbbd=_0x5ade15['getContent']();if(_0x13bbbd===_0x29812e)return;const _0x56ea7a=new fa({'id':_0x291177,'contentInitial':_0x13bbbd,'contentNew':_0x29812e,'documentVersion':_0x5ade15['documentVersion']});this['_results']['set'](_0x56ea7a['id'],_0x56ea7a),this['fire']('reviewCheckResultAdded',{'result':_0x56ea7a,'source':this,'editor':_0x5ade15['editor']});}['_checkIfFinished'](){'finished'===this['status']&&(this['_changes']['filter'](_0x39f6ec=>'pending'===_0x39f6ec['status'])['length']>0x0&&(this['status']='ready')),'ready'===this['status']&&(0x0===this['_changes']['filter'](_0x1c9f16=>'pending'===_0x1c9f16['status'])['length']&&(this['status']='finished'));}}class Ra extends Sa{get['subTitle'](){if(!this['_reviewParams']||0x0===this['_reviewParams']['length'])return'';const _0x2d4919=[];if(this['_reviewParams']['length']>0x0&&this['_sourceCheck']['options'])for(let _0x914eb=0x0;_0x914eb<this['_reviewParams']['length'];_0x914eb++){if(!this['_reviewParams'][_0x914eb]||!this['_sourceCheck']['options'][_0x914eb])continue;const _0x1469a0=this['_sourceCheck']['options'][_0x914eb],_0x4eef61=_0x1469a0['data']?.['find'](_0x1d3d3b=>_0x1d3d3b['id']===this['_reviewParams'][_0x914eb]);_0x4eef61&&_0x2d4919['push'](_0x4eef61['label']);}return _0x2d4919['join'](',\x20');}get['reviewName'](){return this['_composeReviewName']();}['_createApiRequest'](){return this['_aiConnector']['callSystemReview']({'reviewName':this['_composeReviewName'](),'content':this['_documentData']['content'],'args':this['_reviewArgs']});}['_sendRatingRequest'](_0x2f52c8,_0x2fb82a,_0x1f937d){return this['_aiConnector']['upsertAIReviewRating'](this['reviewName'],_0x2fb82a,_0x2f52c8,_0x1f937d);}['_composeReviewName'](){return!this['_reviewParams']||0x0===this['_reviewParams']['length']||this['_sourceCheck']['useArgs']?this['_sourceCheck']['apiId']:[this['_sourceCheck']['apiId'],...this['_reviewParams']]['join']('-');}}class Oa extends _0x35ff8d{['_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(_0x59c08e,_0x14c6d8)=>{const _0x533d14=this['_aiReviewCheckList']['getCheckById'](_0x14c6d8['id']);if(_0x533d14){this['_onReviewCheckRun'](_0x14c6d8),this['_aiReviewCoreEditing']['switchToReadOnly'](),this['_currentReviewCheckRun']=this['_createReviewCheckRun'](_0x14c6d8,_0x533d14),this['_aiReviewCoreUi']['setCheckResultTitle'](this['_currentReviewCheckRun']['title'],this['_currentReviewCheckRun']['subTitle']),this['_currentReviewCheckRun']['on']('reviewCheckRunUpdated',(_0x4a38fd,_0x590c70)=>{switch(_0x590c70['status']){case'data':case'loading':this['_aiReviewCoreUi']['showCheckRunResults'](_0x590c70);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'!==_0x590c70['status']&&'error-chunk'!==_0x590c70['status']&&'error-general'!==_0x590c70['status']||this['_currentReviewCheckRun']?.['sendRating']();}),this['_currentReviewCheckRun']['on']('reviewCheckResultAdded',(_0x166331,_0x3e31d1)=>{if(!this['_currentReviewCheckRun'])throw new at('ai-review-mode-no-current-check-run',this);const _0x47a99=this['_diffContent'](_0x3e31d1['editor'],_0x3e31d1['result']['contentInitial'],_0x3e31d1['result']['contentNew']);_0x3e31d1['source']['addResultChanges'](_0x3e31d1['result']['id'],_0x47a99);}),this['_currentReviewCheckRun']['on']('reviewCheckResultReady',(_0x38fb24,_0x511fb0)=>{for(const _0x35db69 of _0x511fb0['changes'])this['_aiReviewCoreUi']['showCheckRunResult'](_0x35db69);this['_markChangePositionInEditorContent'](_0x511fb0['changes'],_0x511fb0['source']['documentData']);}),this['_currentReviewCheckRun']['on']('reviewCheckResultChangeStatusUpdated',(_0x4f7127,_0x47f70e)=>{this['_aiReviewCoreUi']['updateChangeState'](_0x47f70e['change']['id'],_0x47f70e['status']);}),this['_currentReviewCheckRun']['on']('reviewCheckResultActivated',(_0x21a2c1,_0x1cdaef)=>{this['_onReviewCheckResultActivated'](_0x1cdaef);}),this['_currentReviewCheckRun']['on']('reviewCheckResultDeactivated',()=>{this['_onReviewCheckResultDeactivated']();});try{await this['_currentReviewCheckRun']['start']();}catch(_0x521c05){_0x521c05 instanceof Error&&_0x521c05['message']['includes']('ai-request-aborted')||(_0x521c05 instanceof at?this['_logError'](_0x521c05):this['_logError'](new at('ai-review-mode-check-run-failed',this,void 0x0,_0x521c05)));}}else this['_logError'](new at('ai-review-mode-source-check-not-found',this,{'checkId':_0x14c6d8['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 _0x3ea9ae=this['_currentReviewCheckRun']['getActiveChanges']();if(!_0x3ea9ae['length'])return;this['_aiReviewCoreEditing']['applyChange'](_0x3ea9ae['map'](_0x59522c=>_0x59522c['id']));const _0x109325=this['_currentReviewCheckRun'];_0x109325['markAllChangesAsAccepted'](),_0x109325['sendRating']();}),this['listenTo'](this['_aiReviewCoreUi'],'acceptChange',(_0x169140,_0x118473)=>{this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['isChangeActive'](_0x118473['id'])&&(this['_aiReviewCoreEditing']['applyChange']([_0x118473['id']]),this['_currentReviewCheckRun']['markChangeAsAccepted'](_0x118473['id']),this['_aiReviewCoreUi']['hideChangeBalloon'](),this['_currentReviewCheckRun']['sendRating'](_0x118473['id']));}),this['listenTo'](this['_aiReviewCoreUi'],'dismissChange',(_0x5c03d8,_0x44c8fa)=>{this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['isChangeActive'](_0x44c8fa['id'])&&(this['_aiReviewCoreEditing']['rejectChange'](_0x44c8fa['id']),this['_currentReviewCheckRun']['markChangeAsRejected'](_0x44c8fa['id']),this['_aiReviewCoreUi']['hideChangeBalloon'](),this['_currentReviewCheckRun']['sendRating'](_0x44c8fa['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',(_0x2f63fe,_0x119cd7)=>{this['_onActivateChange'](_0x119cd7);}),this['listenTo'](this['_aiReviewCoreUi'],'deactivateChange',(_0x5d0b2c,_0x45f3fe)=>{this['_onDeactivateChange'](_0x45f3fe);}),this['listenTo'](this['_aiReviewCoreEditing']['emitter'],'changeMarkerClicked',(_0x255158,_0x2c2f02)=>{this['_onChangeMarkerClicked'](_0x255158,_0x2c2f02);}),this['listenTo'](this['_aiReviewCoreEditing']['emitter'],'changeMarkerHovered',(_0x13d93b,_0x4dd57c)=>{this['_onChangeMarkerHovered'](_0x13d93b,_0x4dd57c);}),this['listenTo'](this['_aiReviewCoreEditing']['emitter'],'changeMarkerBlurred',()=>{this['_onChangeMarkerBlurred']();}),this['listenTo'](this['_aiReviewCoreEditing']['emitter'],'changeMarkerRemoved',(_0x398105,_0x22dea2)=>{this['_onChangeMarkerRemoved'](_0x398105,_0x22dea2);}),this['listenTo'](this['_aiReviewCoreEditing']['emitter'],'changeMarkerRestored',(_0x523c8d,_0x506db4)=>{this['_onChangeMarkerRestored'](_0x523c8d,_0x506db4);});}['_createReviewCheckRun'](_0x425988,_0x4cc009){return new Ra(this['_aiReviewCoreEditing']['getDocumentData'](),_0x4cc009,this['_aiConnector'],_0x425988['params'],_0x425988['args']);}['_onChangeMarkerRemoved'](_0xfd6eed,_0x3657f4){this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['markChangeAsOutdated'](_0x3657f4['changeId']);}['_onChangeMarkerRestored'](_0xb1fc8f,_0x266831){this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['markChangeAsPending'](_0x266831['changeId']);}['_onCheckRunFinished'](){this['_aiReviewCoreUi']['showReviewCompletedView']();}['_initRequiredPlugins'](){this['_aiConnector']=this['context']['plugins']['get']('AIConnector');}['_onReviewRunLeave'](_0x372395=!0x1){this['_currentReviewCheckRun']&&(this['_currentReviewCheckRun']['hasModifications']||this['_currentReviewCheckRun']['sendRating'](),this['_currentReviewCheckRun']['stopListening'](),this['_currentReviewCheckRun']['abort'](),this['_currentReviewCheckRun']=void 0x0),_0x372395&&this['_aiReviewCoreUi']['showReviewCheckList'](),this['_aiReviewCoreEditing']['clearAllMarkers'](),this['_aiReviewCoreEditing']['switchToEdit'](),this['_changeActivationSource']=null;for(const _0x71d519 of this['_aiReviewCoreEditing']['getEditors']())_0x71d519['editing']['view']['change'](_0x3c647b=>{for(const _0x509d58 of _0x71d519['editing']['view']['document']['getRoots']())_0x3c647b['removeClass']('ck-ai_review-diff',_0x509d58),_0x3c647b['removeClass']('ck-ai_review-highlights',_0x509d58),_0x3c647b['removeClass']('ck-ai-translate-mode-content',_0x509d58);});}['_getTranslationWithDefault'](_0x755cbd,_0x357749){const _0x1c04ca=hs(this['context']['locale'],_0x755cbd);return _0x1c04ca===_0x755cbd?_0x357749:_0x1c04ca;}['_logError'](_0x63d817,_0x1b1f49=!0x1){Et(_0x63d817['message']),_0x1b1f49||(_0x63d817['message']['startsWith']('ai-review-mode-models-unable-to-retrieve')?this['_aiReviewCoreUi']['showGeneralReviewCoreErrorView']():this['_aiReviewCoreUi']['showGeneralResultsErrorView']());}['_scrollToChange'](_0x4fcc4f){if('content'===this['_changeActivationSource']){const _0x57b19d=this['_aiReviewCoreUi']['getChangeElement'](_0x4fcc4f);_0x57b19d&&ft(_0x57b19d['closest']('.ck-ai_review__check-run-result')||_0x57b19d);}else{if('panel'===this['_changeActivationSource']){const _0x197cda=this['_getChangeContentElement'](_0x4fcc4f);if(!_0x197cda)return;Ct({'target':_0x197cda,'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(_0x57dde3){this['id']=_0x57dde3['id'],this['commandId']=_0x57dde3['commandId'],this['title']=_0x57dde3['title'],this['description']=_0x57dde3['description'],this['isParameterized']=_0x57dde3['isParameterized'],this['useArgs']=_0x57dde3['useArgs'],this['options']=_0x57dde3['options'],this['args']=_0x57dde3['args'];}}class va extends ht(){['_checks']=[];['setupChecks'](_0x15e05){this['_checks']=_0x15e05['map'](_0x513709=>new Na(_0x513709));}get['checks'](){return this['_checks'];}['getCheckById'](_0x58c31b){return this['checks']['find'](_0xb5f9be=>_0xb5f9be['id']===_0x58c31b);}['removeCheckById'](_0x32f0d7){this['_checks']=this['_checks']['filter'](_0x30acff=>_0x30acff['id']!==_0x32f0d7);}}class ya extends Na{['_models']=[];['_defaultModel']=null;constructor(_0x5a150b,_0x5459c0,_0x574529){super(_0x5a150b),this['_models']=_0x5459c0,this['_defaultModel']=_0x574529;}get['models'](){return this['_models'];}get['defaultModel'](){return this['_defaultModel'];}}class xa extends Na{['isExtra']=!0x0;['prompt'];['model'];['_defaultModel']=null;constructor(_0x216867,_0x3245be,_0x2de997){super(_0x216867),this['prompt']=_0x216867['prompt'],this['model']=_0x216867['model'],this['model']?this['_defaultModel']=_0x3245be['find'](_0x4b5e00=>_0x4b5e00['id']===this['model'])||null:this['_defaultModel']=_0x2de997;}get['defaultModel'](){return this['_defaultModel'];}}class La extends va{['_allModels']=[];['_recommendedModels']=[];['_defaultModel']=null;constructor(_0x1ab233,_0xbfadc,_0x513f05){super(),this['_allModels']=_0x1ab233,this['_recommendedModels']=_0xbfadc,this['_defaultModel']=_0x513f05;}['setupChecks'](_0x124950){this['_checks']=_0x124950['map'](_0x21c6cd=>!0x0===_0x21c6cd['isExtra']?new xa(_0x21c6cd,this['_allModels'],this['_defaultModel']):'custom'===_0x21c6cd['id']?new ya(_0x21c6cd,this['_recommendedModels'],this['_defaultModel']):new Na(_0x21c6cd));}}class Da extends Sa{['_prompt'];['_model'];constructor(_0x1cb877,_0x267478,_0xead924,_0x586eb0,_0x3ace78){super(_0xead924,_0x586eb0,_0x3ace78),this['_prompt']=_0x1cb877,this['_model']=_0x267478;}get['subTitle'](){return this['_prompt'];}['_createApiRequest'](){return this['_aiConnector']['callCustomReview']({'content':this['_documentData']['content'],'prompt':this['_prompt'],'model':this['_model']});}['_sendRatingRequest'](_0x132e8a,_0x101a15,_0x128cf5){return this['_aiConnector']['upsertCustomAIReviewRating'](_0x101a15,_0x132e8a,_0x128cf5);}}class Pa extends Da{get['subTitle'](){return'';}set['prompt'](_0x5e9724){this['_prompt']=_0x5e9724;}set['model'](_0x413e1f){this['_model']=_0x413e1f;}}class Ha extends Oa{static get['pluginName'](){return'AIReviewModeController';}['_isDiffOn']=!0x1;['_hasDefaultAvailableCommands']=!0x1;constructor(_0x2f3288){super(_0x2f3288),this['_hasDefaultAvailableCommands']=!this['context']['config']['get']('ai.review.availableCommands'),this['context']['config']['define']('ai.review.availableCommands',ka['map'](_0x7b3d06=>_0x7b3d06['id'])),this['context']['config']['define']('ai.review.extraCommands',[]);}async['init'](){await super['init'](),this['listenTo'](this['_aiReviewCoreUi'],'toggleDiff',(_0x1a4e7d,_0x440ffe)=>{this['_isDiffOn']=_0x440ffe['on'],this['_onDiffChange'](this['_isDiffOn']);});}['_initRequiredPlugins'](){super['_initRequiredPlugins'](),this['_aiReviewCoreUi']=this['context']['plugins']['get']('AIReviewModeUI'),this['_aiReviewCoreEditing']=this['context']['plugins']['get']('AIReviewCoreEditing');}['_createReviewCheckRun'](_0x45bc2d,_0x511aae){return _0x45bc2d['isCustom']?new Da(_0x45bc2d['args']['prompt'],_0x45bc2d['args']['model'],this['_aiReviewCoreEditing']['getDocumentData'](),_0x511aae,this['_aiConnector']):_0x511aae['isExtra']?new Pa(_0x511aae['prompt'],_0x511aae['defaultModel']['id'],this['_aiReviewCoreEditing']['getDocumentData'](),_0x511aae,this['_aiConnector']):new Ra(this['_aiReviewCoreEditing']['getDocumentData'](),_0x511aae,this['_aiConnector'],_0x45bc2d['params'],_0x45bc2d['args']);}['_onReviewCheckResultActivated'](_0xd968c1){this['_aiReviewCoreUi']['setActiveStateInResults'](_0xd968c1['change']['id']),this['_scrollToChange'](_0xd968c1['change']['id']);const _0x3aee91=this['_aiReviewCoreEditing']['getMarkerElementForChange'](_0xd968c1['change']['id']);if(!_0x3aee91)return;const _0x583c0c=this['_aiReviewCoreEditing']['getEditorForChange'](_0xd968c1['change']['id'])??this['_aiReviewCoreEditing']['getEditor']();this['_aiReviewCoreUi']['showChangeBalloon'](_0xd968c1['change'],()=>_0x3aee91['getElement'](),void 0x0,'click',this['_getBalloonDomRoot'](_0x583c0c,_0x3aee91['modelRange']['root']['rootName']),_0x583c0c?.['ui']?.['viewportOffset']),this['_aiReviewCoreEditing']['setMarkersInElementAsActive'](_0xd968c1['change']['id']);}['_onReviewCheckResultDeactivated'](){this['_aiReviewCoreUi']['resetActiveStateInResults'](),this['_aiReviewCoreUi']['hideChangeBalloon'](),this['_aiReviewCoreEditing']['setAllMarkersAsInactive']();}['_onActivateChange'](_0x1f4fee){this['_currentReviewCheckRun']&&'click'===_0x1f4fee['uiInteraction']&&(this['_changeActivationSource']='panel',this['_currentReviewCheckRun']['activateChange'](_0x1f4fee['id']));}['_onDeactivateChange'](_0x36cc84){this['_currentReviewCheckRun']&&'balloon'===_0x36cc84['origin']&&this['_currentReviewCheckRun']['deactivateChange']();}['_onChangeMarkerClicked'](_0x3da7a5,_0x578497){if(!this['_currentReviewCheckRun'])return;this['_changeActivationSource']='content',this['_currentReviewCheckRun']['activateChange'](_0x578497['changeId']);const _0x92c868=this['_currentReviewCheckRun']['getChangeById'](_0x578497['changeId']);if(!_0x92c868)return;const _0x461efd=this['_aiReviewCoreEditing']['getMarkerElementForChange'](_0x578497['changeId']),_0x429a97=this['_aiReviewCoreEditing']['getEditorForChange'](_0x578497['changeId'])??this['_aiReviewCoreEditing']['getEditor']();this['_aiReviewCoreUi']['showChangeBalloon'](_0x92c868,_0x578497['markerElement'],_0x578497['domEvent'],'click',this['_getBalloonDomRoot'](_0x429a97,_0x461efd?.['modelRange']['root']['rootName']),_0x429a97?.['ui']?.['viewportOffset']);}['_onChangeMarkerHovered'](_0x5d3393,_0x2fdc02){if(!this['_currentReviewCheckRun'])return;if(this['_currentReviewCheckRun']['isAnyChangeActivated']())return;const _0x1fa728=this['_currentReviewCheckRun']['getChangeById'](_0x2fdc02['changeId']);if(!_0x1fa728)return;const _0x47fae9=this['_aiReviewCoreEditing']['getMarkerElementForChange'](_0x2fdc02['changeId']),_0x2e9efd=this['_aiReviewCoreEditing']['getEditorForChange'](_0x2fdc02['changeId'])??this['_aiReviewCoreEditing']['getEditor']();this['_aiReviewCoreUi']['showChangeBalloon'](_0x1fa728,_0x2fdc02['markerElement'],_0x2fdc02['domEvent'],'hover',this['_getBalloonDomRoot'](_0x2e9efd,_0x47fae9?.['modelRange']['root']['rootName']),_0x2e9efd?.['ui']?.['viewportOffset']);}['_onChangeMarkerBlurred'](){if(!this['_currentReviewCheckRun'])return;this['_currentReviewCheckRun']['isAnyChangeActivated']()||this['_aiReviewCoreUi']['hideChangeBalloon']();}['_getChangeContentElement'](_0x2ab551){const _0x1ed8bc=this['_aiReviewCoreEditing']['getMarkerElementForChange'](_0x2ab551);return _0x1ed8bc?_0x1ed8bc['getElement']():null;}['_markChangePositionInEditorContent'](_0x5e7476,_0x444920){this['_aiReviewCoreEditing']['markChangePositionInEditorContent'](_0x5e7476,_0x444920);}['_diffContent'](_0x4889d5,_0x168cc5,_0x51b9c1){return this['_aiReviewCoreEditing']['diffContent'](_0x4889d5,_0x168cc5,_0x51b9c1,!0x1);}['_onReviewCheckRun'](){this['_onDiffChange'](this['_isDiffOn']);}['_onDiffChange'](_0x463e9b){_0x463e9b?this['_aiReviewCoreUi']['hideDiffInBalloon']():this['_aiReviewCoreUi']['showDiffInBalloon']();for(const _0x2aaf07 of this['_aiReviewCoreEditing']['getEditors']())_0x2aaf07['editing']['view']['change'](_0xc848d3=>{for(const _0x1c191c of _0x2aaf07['editing']['view']['document']['getRoots']()){for(const _0x512a33 of _0x1c191c['getClassNames']())_0x512a33['startsWith']('ck-ai_review-')&&_0xc848d3['removeClass'](_0x512a33,_0x1c191c);_0xc848d3['addClass'](_0x463e9b?'ck-ai_review-diff':'ck-ai_review-highlights',_0x1c191c);}});}['_getBalloonDomRoot'](_0x30d524,_0x12e104){const _0x3bff81=_0x30d524['editing']['view'];if(_0x12e104){const _0x5f1842=_0x3bff81['getDomRoot'](_0x12e104);if(_0x5f1842)return _0x5f1842;}return _0x3bff81['getDomRoot']()??void 0x0;}async['_getChecksList'](){const _0x3230aa=[...ka,...this['_getExtraChecks']()],_0x5c9724=this['context']['config']['get']('ai.review.availableCommands')||[];this['_logErrorForNonExistentChecks'](_0x5c9724,_0x3230aa);let _0x58415a=_0x3230aa;this['_hasDefaultAvailableCommands']||(_0x58415a=_0x5c9724['map'](_0x280b29=>_0x3230aa['find'](_0xb423f3=>_0xb423f3['id']===_0x280b29))['filter'](_0x4cf0e9=>!!_0x4cf0e9)),_0x58415a=_0x58415a['map'](_0x53a900=>_0x53a900['isExtra']?_0x53a900:this['_translateReviewCheck'](_0x53a900));const _0x53de38=_0x58415a['some'](_0x22790a=>_0x22790a['isExtra']||'custom'===_0x22790a['id']);let _0x473515=[],_0x4b6538=[],_0x3540a3=null;if(_0x53de38){const _0x3a1a2f=await this['_getModels']();_0x473515=_0x3a1a2f['all'],_0x4b6538=_0x3a1a2f['recommended'],_0x3540a3=_0x3a1a2f['default'];}const _0x32fc10=new La(_0x473515,_0x4b6538,_0x3540a3);return _0x32fc10['setupChecks'](_0x58415a),_0x53de38&&this['_filterChecksWithMissingModel'](_0x32fc10),_0x32fc10;}['_getExtraChecks'](){return(this['context']['config']['get']('ai.review.extraCommands')||[])['map'](_0x56978=>({'id':_0x56978['id'],'commandId':_0x56978['id'],'title':_0x56978['label'],'description':_0x56978['description'],'isParameterized':!0x1,'isExtra':!0x0,'prompt':_0x56978['prompt'],'model':_0x56978['model']}));}['_logErrorForNonExistentChecks'](_0x78b03c,_0x4b2cf4){const _0x1c6b0b=_0x78b03c['filter'](_0xe2fbc5=>!_0x4b2cf4['some'](_0x14cd9d=>_0x14cd9d['id']===_0xe2fbc5));_0x1c6b0b['length']&&this['_logError'](new at('ai-review-mode-non-existent-commands-used',this,{'commandIds':_0x1c6b0b['join'](',\x20')}),!0x0);}async['_getModels'](){try{const _0x575ba0=new Fs({'connector':this['_aiConnector'],'config':this['context']['config']['get']('ai.models'),'locale':this['context']['locale']});return{'all':await _0x575ba0['getAll'](),'recommended':await _0x575ba0['getAvailableModels'](),'default':await _0x575ba0['getDefault']()};}catch(_0x286999){return this['_logError'](new at('ai-review-mode-models-unable-to-retrieve',this,void 0x0,_0x286999)),{'all':[],'recommended':[],'default':null};}}['_translateReviewCheck'](_0x552946){const _0x54ccfe='AI_REVIEW_CHECK_'+_0x552946['id']['toUpperCase']()['replaceAll']('-','_'),_0x58d8c5={..._0x552946,'title':this['_getTranslationWithDefault'](_0x54ccfe+'_TITLE',_0x552946['title']),'description':this['_getTranslationWithDefault'](_0x54ccfe+'_DESCRIPTION',_0x552946['description'])};return _0x552946['options']&&(_0x58d8c5['options']=_0x552946['options']['map'](_0x3830d6=>({..._0x3830d6,'label':this['_getTranslationWithDefault'](_0x54ccfe+'_OPTIONS_LABEL',_0x3830d6['label']||''),'data':_0x3830d6['data']?_0x3830d6['data']['map'](_0x269a83=>({..._0x269a83,'label':this['_getTranslationWithDefault'](_0x54ccfe+'_OPTIONS_DATA_'+_0x269a83['id']['toUpperCase'](),_0x269a83['label'])})):void 0x0}))),_0x58d8c5;}['_filterChecksWithMissingModel'](_0x4ba964){const _0xf4e0ad=[];_0x4ba964['checks']['forEach'](_0x91c8ac=>{(_0x91c8ac instanceof xa&&!_0x91c8ac['defaultModel']||_0x91c8ac instanceof ya&&!_0x91c8ac['models']['length'])&&_0xf4e0ad['push'](_0x91c8ac['id']);}),_0xf4e0ad['length']&&_0xf4e0ad['forEach'](_0x252db7=>{_0x4ba964['removeCheckById'](_0x252db7),this['_logError'](new at('ai-review-mode-command-unavailable-due-to-missing-model',this,{'commandId':_0x252db7}),!0x0);});}}class Ma extends _0x35ff8d{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'](_0x2ef4e4){this['_checks']=_0x2ef4e4['map'](_0x16669b=>new Ua(_0x16669b));}}class Ba extends Ra{['_title'];constructor(_0xf68bb,_0x3d56e1,_0x59832d,_0x32173a,_0x4e082b,_0x3cef60){super(_0xf68bb,_0x3d56e1,_0x59832d,_0x4e082b,_0x3cef60),this['_title']=_0x32173a;}get['title'](){return this['_title'];}get['subTitle'](){return this['_sourceCheck']['title'];}}class Ga extends Oa{static get['pluginName'](){return'AITranslateController';}constructor(_0xbc304b){super(_0xbc304b),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'](_0x2db843,_0x4c1744){return new Ba(this['_aiReviewCoreEditing']['getDocumentData'](),_0x4c1744,this['_aiConnector'],hs(this['context']['locale'],'AI_REVIEW_CHECK_TRANSLATE_TITLE'),_0x2db843['params'],_0x2db843['args']);}['_onReviewCheckResultActivated'](_0x5b4329){this['_aiReviewCoreUi']['setActiveStateInResults'](_0x5b4329['change']['id']),this['_aiReviewCoreEditing']['setMarkersInElementAsActive'](_0x5b4329['change']['id']);}['_onReviewCheckResultDeactivated'](){this['_aiReviewCoreEditing']['setAllMarkersAsInactive'](),this['_aiReviewCoreUi']['resetActiveStateInResults']();}['_onActivateChange'](_0x59ae9a){this['_currentReviewCheckRun']&&('hover'===_0x59ae9a['uiInteraction']&&(this['_changeActivationSource']='panel',this['_currentReviewCheckRun']['activateChange'](_0x59ae9a['id'])),'click'===_0x59ae9a['uiInteraction']&&this['_scrollToChange'](_0x59ae9a['id']));}['_onDeactivateChange'](_0x4ce983){this['_currentReviewCheckRun']&&'panel'===_0x4ce983['origin']&&this['_currentReviewCheckRun']['deactivateChange']();}['_onChangeMarkerClicked'](_0x3980f9,_0xdbb054){this['_currentReviewCheckRun']&&(this['_changeActivationSource']='content',this['_currentReviewCheckRun']['activateChange'](_0xdbb054['changeId']),this['_scrollToChange'](_0xdbb054['changeId']));}['_onChangeMarkerHovered'](_0x435eb7,_0x2c6398){this['_currentReviewCheckRun']&&(this['_changeActivationSource']='content',this['_currentReviewCheckRun']['activateChange'](_0x2c6398['changeId']),this['_aiReviewCoreEditing']['reactivateMarkers'](_0x2c6398['changeId']));}['_onChangeMarkerBlurred'](){this['_currentReviewCheckRun']&&'content'===this['_changeActivationSource']&&(this['_currentReviewCheckRun']['deactivateChange'](),this['_aiReviewCoreEditing']['setAllMarkersAsInactive']());}['_getChangeContentElement'](_0x157ae8){return this['_aiReviewCoreEditing']['getContentElementForChange'](_0x157ae8);}['_markChangePositionInEditorContent'](_0x3c6ff0,_0x413a2a){this['_aiReviewCoreEditing']['markChangePositionInEditorContent'](_0x3c6ff0,_0x413a2a);}['_diffContent'](_0x7949ac,_0x275cef,_0x3871cd){return this['_aiReviewCoreEditing']['diffContent'](_0x7949ac,_0x275cef,_0x3871cd,!0x0);}['_onReviewCheckRun'](){for(const _0x219f93 of this['_aiReviewCoreEditing']['getEditors']())_0x219f93['editing']['view']['change'](_0x13836b=>{for(const _0x5d17f7 of _0x219f93['editing']['view']['document']['getRoots']())_0x13836b['addClass']('ck-ai-translate-mode-content',_0x5d17f7);});}async['_getChecksList'](){const _0x2e2d0a=[],_0x492ac2=this['context']['config']['get']('ai.translate.languages')||[];for(const _0x64f87f of _0x492ac2)_0x2e2d0a['push']({'title':_0x64f87f['label'],'id':_0x64f87f['id'],'commandId':_0x64f87f['id'],'description':'','isParameterized':!0x1,'useArgs':!0x0,'args':{'language':_0x64f87f['id']}});const _0x196eff=new Va();return _0x196eff['setupChecks'](this['_translateChecks'](_0x2e2d0a)),_0x196eff;}['_translateChecks'](_0x3107c7){return _0x3107c7['map'](_0x34ff43=>{const _0x42bcb7='AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_'+_0x34ff43['title']['toUpperCase']()['replaceAll']('-','_');return{..._0x34ff43,'title':this['_getTranslationWithDefault'](_0x42bcb7,_0x34ff43['title'])};});}}class Fa extends ca{constructor(_0x521eb4,_0xcf8b67){super(_0x521eb4,_0xcf8b67),this['on']('set:isLoading',(_0x19aba4,_0x36acc0,_0x1efa12)=>{_0x1efa12&&(this['headerTitle']=hs(this['locale'],'AI_TRANSLATE_CHECK_RESULTS_LOADING_TITLE'));}),this['on']('set:isResultReady',(_0x2f1250,_0x1f7b92,_0x16084a)=>{_0x16084a&&(this['headerTitle']=hs(this['locale'],'AI_TRANSLATE_CHECK_RESULTS_READY_TITLE'));});}['_createAcceptAllButtonView'](){const _0x2670cc=super['_createAcceptAllButtonView']();return _0x2670cc['set']('label',hs(this['locale'],'AI_TRANSLATE_ACCEPT_ALL')),_0x2670cc;}['_createExitReviewButtonView'](){const _0x14d569=super['_createExitReviewButtonView']();return _0x14d569['set']('label',hs(this['locale'],'AI_CHAT_HISTORY_CANCEL')),_0x14d569;}}class Ka extends pa{['_setupTemplate'](){const _0x3d2363=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-translate__check-list-wrapper',_0x3d2363['if']('isVisible','ck-hidden',_0x2b12aa=>!_0x2b12aa)]},'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',_0x3d2363['if']('isVisible','ck-hidden',_0x5a6b04=>!_0x5a6b04)]},'children':this['_checkViews']}]});}}class Wa extends ra{static get['pluginName'](){return'AITranslateUI';}['createMainView'](){const _0x3aed80=this['context']['plugins']['get']('AITabs'),_0x2264f9=this['context']['locale'],_0x5bf016=new eo(_0x2264f9,{'label':hs(_0x2264f9,'AI_REVIEW_CHECK_TRANSLATE_TITLE'),'icon':_0x5a40c9,'class':'ck-ai-header_review-translate','showResizeButton':_0x3aed80['showResizeButton']});_0x5bf016['delegate']('resizeTabs')['to'](_0x3aed80),_0x5bf016['bind']('isMaximized')['to'](_0x3aed80['view'],'isMaximized',_0x1efbb6=>_0x1efbb6);const _0x34cb32=new aa(_0x2264f9,{'header':_0x5bf016,'list':new Ka(_0x2264f9),'results':new Fa(_0x2264f9,{'generalErrorText':hs(_0x2264f9,'AI_TRANSLATE_GENERAL_ERROR_MESSAGE')}),'completed':new la(_0x2264f9,{'headerText':hs(_0x2264f9,'AI_TRANSLATE_FINISH_HEADER_TITLE'),'emptyResultsText':hs(_0x2264f9,'AI_TRANSLATE_EMPTY_RESULTS_TEXT'),'buttonText':hs(_0x2264f9,'AI_TRANSLATE_FINISH_BUTTON_LABEL')})});return _0x34cb32['extendTemplate']({'attributes':{'class':'ck-ai-translate-mode'}}),_0x34cb32;}['registerTab'](){const _0x26c1fd=this['context']['plugins']['get']('AITabs');_0x26c1fd['view']['on']('activateTab',(_0x1f3be8,{newTab:_0x520098,oldTab:_0x2271ae})=>{'translate'===_0x520098?this['fire']('getReviewCheckList'):'translate'===_0x2271ae&&this['fire']('leaveReview');}),_0x26c1fd['view']['addTab']({'id':'translate','buttonLabel':hs(this['context']['locale'],'AI_REVIEW_CHECK_TRANSLATE_TITLE'),'buttonIcon':_0x5a40c9,'order':0x0,'content':this['_mainView']});}}class Ya extends _0x35ff8d{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 _0x4f5a67,Command as _0x5c051f,ContextPlugin as _0x29a024,Editor as _0x1c72cb}from'@ckeditor/ckeditor5-core/dist/index.js';import{IconCopy as _0x2da51f,IconCheck as _0x2d2483,IconError as _0x2a490d,IconSubmit as _0x2fb024,IconAIHistory as _0x3d6612,IconMagicWand as _0xc91008,IconRobotPencil as _0x552044,IconMaximize as _0x3e6682,IconMinimize as _0x7cb3cb,IconShowChangesOn as _0x3ca403,IconShowChangesOff as _0x5a5d46,IconDocument as _0x5857a1,IconBoxWithCross as _0x12445e,IconBoxWithCheck as _0x306837,IconBoxWithMarker as _0x2e4bd0,IconInfo as _0x23ad4d,IconWeb as _0x3d1340,IconCancel as _0x49d6d3,IconSelection as _0x7f9bad,IconFileUpload as _0x361cff,IconLink as _0x4bff13,IconBulb as _0x345846,IconAI as _0x158742,IconPreviousArrow as _0x1e7391,IconDocumentOutline as _0x24d738,IconLoupe as _0x4d742c,IconPaperClip as _0xf96a54,IconBrowseFiles as _0x5b5059,IconDropdownArrow as _0x25f981,IconStop as _0x2d2f82,IconPlus as _0x5c01b7,IconAIChat as _0x188f09,IconPin as _0x12da21,IconThreeHorizontalDots as _0xaca51e,IconAIReview as _0xc96c5b,IconAITranslate as _0x3c67b8,IconAIAskAI as _0x4b6e58,IconThumbUp as _0x5ad9ad,IconThumbDown as _0x1db60a,IconChevronDown as _0x128b12,IconChevronUp as _0x4ffe99,IconAIQuickActions as _0x63550d,IconAIChatCommands as _0x5896ad,IconAIImproveWriting as _0xf6244a,IconAIContinueWriting as _0x26be3d,IconAIGrammarCheck as _0xff2f8,IconAIAdjustLength as _0x9f0aa1,IconAIChangeTone as _0x23b9f6,IconAIOther as _0x116abd,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 _0x4e1e5d,FormHeaderView as _0x5afc1f,HighlightedTextView as _0x2164c5,ViewCollection as _0x36a70d,FileDialogButtonView as _0x1356ca,InputTextView as _0x567a9e,SearchTextView as _0xd43eec,ListItemButtonView as _0x4bd876,ButtonLabelWithHighlightView as _0x3b441c,DropdownMenuPanelPositioningFunctions as _0x5110c8,BalloonToolbar as _0x56de99,FormRowView as _0xe481ff,TextareaView as _0x19b333}from'@ckeditor/ckeditor5-ui/dist/index.js';import{ClipboardPipeline as _0x353599,ClipboardMarkersUtils as _0xf8e7c}from'@ckeditor/ckeditor5-clipboard/dist/index.js';import{ViewDocumentDomEventData as _0x268957,ViewDataTransfer as _0x35d75f,ViewUpcastWriter as _0x4317e0,Matcher as _0x365f31,_DetachOperation as _0x1e19dc,_insertIntoModelNodeList as _0x3b17e2,_removeFromModelNodeList as _0x14bbcf,ModelRange as _0x2264dd,transformOperationSets as _0x3a354d,ViewDowncastWriter as _0x4e0ecd,ModelDocumentFragment as _0x5874c7,ModelPosition as _0x2c4a91,ModelTreeWalker as _0x3e9906,MarkerOperation as _0x44ffc1,InsertOperation as _0x5b3c73}from'@ckeditor/ckeditor5-engine/dist/index.js';import{unescape as _0x163604,escape as _0x5131f5,cloneDeep as _0x5c8906,throttle as _0x41e73f,debounce as _0x521085,escapeRegExp as _0x308cdf}from'es-toolkit/compat';import{createParser as _0x38655c}from'eventsource-parser';import{CloudServices as _0x1c01ce}from'@ckeditor/ckeditor5-cloud-services/dist/index.js';import{parseDocument as _0xc677a2}from'htmlparser2';import{isTag as _0x5c243a,findOne as _0x32608d,getParent as _0x51eedd,findAll as _0x58b8d1,removeElement as _0x48b852,prepend as _0x506989,prependChild as _0x57a9ea,appendChild as _0x30459f,append as _0xb4e700,find as _0x442d99,isComment as _0x471c29,replaceElement as _0x5deec6,getChildren as _0x295f3a,textContent as _0x8227a4}from'domutils';import ti from'dom-serializer';import{Document as _0x2f7da1,Element as _0xae4b38,Text as _0x303276,cloneNode as _0x4af169,isDocument as _0x39ed11,isText as _0x1de0fd,NodeWithChildren as _0x12418d}from'domhandler';import{MarkdownGfmMdToHtmlDefaultPlugins as _0x15195d,MarkdownGfmMdToHtml as _0x6fd27c}from'@ckeditor/ckeditor5-markdown-gfm/dist/index.js';import _0x548659 from'rehype-sanitize';import{fixElementSuggestionRange as _0x1a286c,DocumentCompare as _0x513dcf,DATA_ID_MODEL_ATTRIBUTE as _0x33ffd6,ConfirmMixin as _0x5b1fc6,getAllMarkersDomElementsSorted as _0x227c33,SuggestionsConversion as _0x5e5224,DATA_ID_VIEW_ATTRIBUTE as _0x689267,getMarkerDomElement as _0x12653e}from'@ckeditor/ckeditor5-collaboration-core/dist/index.js';import _0x17f24f from'morphdom';import{diffArrays as _0x1083b6}from'diff';const Ci='_ungrouppedCommands';function wi(_0x273cc1,_0x4a52da){const _0x3232f8=(0x0,_0x4a52da['t'])('Other');return _0x273cc1['length']?'groupId'in _0x273cc1[0x0]?_0x273cc1:[{'groupId':Ci,'groupLabel':_0x3232f8,'order':0x1/0x0,'commands':_0x273cc1}]:[{'groupId':Ci,'groupLabel':_0x3232f8,'order':0x1/0x0,'commands':[]}];}const fi=globalThis['DataTransfer'],bi='ai-ui';class Si extends _0x4f5a67{static get['pluginName'](){return'AIAssistantEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const {editor:_0x85fc6a}=this,_0x4e8be9=['ck-fake-ai-selection'];_0x85fc6a['config']['get']('ai.assistant.useTheme')&&_0x4e8be9['push']('ck-ai-assistant-ui_theme'),_0x85fc6a['conversion']['for']('editingDowncast')['markerToHighlight']({'model':bi,'view':{'classes':_0x4e8be9,'priority':0xc}}),_0x85fc6a['conversion']['for']('editingDowncast')['markerToElement']({'model':bi,'view':(_0x41708d,{writer:_0x28d29b})=>{if(!_0x41708d['markerRange']['isCollapsed'])return null;const _0x2cad4b=_0x28d29b['createUIElement']('span');return _0x28d29b['addClass'](['ck-fake-ai-selection','ck-fake-ai-selection_collapsed'],_0x2cad4b),_0x2cad4b;}});}['afterInit'](){!async function(_0x3dac1b){const _0x4483f9=_0x116f13([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]),_0x147c28=0x3dffc4e1,_0x465f85=0x3df84d39^_0x147c28,_0x50bf79=window[_0x116f13([0x44,0x61,0x74,0x65])][_0x116f13([0x6e,0x6f,0x77])](),_0x4183e6=_0x3dac1b[_0x116f13([0x65,0x64,0x69,0x74,0x6f,0x72])],_0x58c8e7=new window[(_0x116f13([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x5f9ddb=>{_0x4183e6[_0x116f13([0x6f,0x6e,0x63,0x65])](_0x116f13([0x72,0x65,0x61,0x64,0x79]),_0x5f9ddb);}),_0x937a1a={[_0x116f13([0x6b,0x74,0x79])]:_0x116f13([0x45,0x43]),[_0x116f13([0x75,0x73,0x65])]:_0x116f13([0x73,0x69,0x67]),[_0x116f13([0x63,0x72,0x76])]:_0x116f13([0x50,0x2d,0x32,0x35,0x36]),[_0x116f13([0x78])]:_0x116f13([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]),[_0x116f13([0x79])]:_0x116f13([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]),[_0x116f13([0x61,0x6c,0x67])]:_0x116f13([0x45,0x53,0x32,0x35,0x36])},_0x5ee7c4=_0x4183e6[_0x116f13([0x63,0x6f,0x6e,0x66,0x69,0x67])][_0x116f13([0x67,0x65,0x74])](_0x116f13([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79]));async function _0x2563b5(){let _0x21b692,_0x571196=null,_0x46b221=null;try{if(_0x5ee7c4==_0x116f13([0x47,0x50,0x4c]))return _0x116f13([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]);if(_0x21b692=_0x3bde07(),!_0x21b692)return _0x116f13([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);return _0x21b692[_0x116f13([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])]&&(_0x46b221=_0xd6e62c(_0x21b692[_0x116f13([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])],_0x21b692[_0x116f13([0x6a,0x74,0x69])])),await _0x260c48()?_0x138cba()?_0x168c87()?_0x116f13([0x45,0x78,0x70,0x69,0x72,0x65,0x64]):_0x13b009()?(_0x21b692[_0x116f13([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])]==_0x116f13([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e])&&(_0x571196=_0x126b1b(_0x116f13([0x45,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e,0x4c,0x69,0x6d,0x69,0x74]))),await _0x31cafe()):_0x116f13([0x44,0x6f,0x6d,0x61,0x69,0x6e,0x4c,0x69,0x6d,0x69,0x74]):_0x116f13([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]):_0x116f13([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}catch{return _0x116f13([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}function _0x168c87(){const _0x15cf79=[_0x116f13([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e]),_0x116f13([0x74,0x72,0x69,0x61,0x6c])][_0x116f13([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x21b692[_0x116f13([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])])?_0x50bf79/0x3e8:0xe10*_0x465f85;return _0x21b692[_0x116f13([0x65,0x78,0x70])]<_0x15cf79;}function _0x138cba(){const _0x7f3fd7=_0x21b692[_0x116f13([0x66,0x65,0x61,0x74,0x75,0x72,0x65,0x73])];return!!_0x7f3fd7&&(!!_0x7f3fd7[_0x116f13([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x116f13([0x2a]))||!!_0x7f3fd7[_0x116f13([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x116f13([0x41,0x49])));}function _0x13b009(){const _0x1d7511=_0x21b692[_0x116f13([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x64,0x48,0x6f,0x73,0x74,0x73])];if(!_0x1d7511||0x0==_0x1d7511[_0x116f13([0x6c,0x65,0x6e,0x67,0x74,0x68])])return!0x0;const {hostname:_0x187925}=new URL(window[_0x116f13([0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e])]['href']);if(_0x1d7511[_0x116f13([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x187925))return!0x0;const _0x5e1ff6=_0x187925[_0x116f13([0x73,0x70,0x6c,0x69,0x74])](_0x116f13([0x2e]));return _0x1d7511[_0x116f13([0x66,0x69,0x6c,0x74,0x65,0x72])](_0x35ba02=>_0x35ba02[_0x116f13([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x116f13([0x2a])))[_0x116f13([0x6d,0x61,0x70])](_0x39a65b=>_0x39a65b[_0x116f13([0x73,0x70,0x6c,0x69,0x74])](_0x116f13([0x2e])))[_0x116f13([0x66,0x69,0x6c,0x74,0x65,0x72])](_0x4a5483=>_0x4a5483[_0x116f13([0x6c,0x65,0x6e,0x67,0x74,0x68])]<=_0x5e1ff6[_0x116f13([0x6c,0x65,0x6e,0x67,0x74,0x68])])[_0x116f13([0x6d,0x61,0x70])](_0x514b58=>Array(_0x5e1ff6[_0x116f13([0x6c,0x65,0x6e,0x67,0x74,0x68])]-_0x514b58[_0x116f13([0x6c,0x65,0x6e,0x67,0x74,0x68])])[_0x116f13([0x66,0x69,0x6c,0x6c])](_0x514b58[0x0]===_0x116f13([0x2a])?_0x116f13([0x2a]):'')[_0x116f13([0x63,0x6f,0x6e,0x63,0x61,0x74])](_0x514b58))[_0x116f13([0x73,0x6f,0x6d,0x65])](_0x3217a7=>_0x5e1ff6[_0x116f13([0x65,0x76,0x65,0x72,0x79])]((_0x3541f6,_0x276a47)=>_0x3217a7[_0x276a47]===_0x3541f6||_0x3217a7[_0x276a47]===_0x116f13([0x2a])));}function _0x31cafe(){return _0x571196&&_0x46b221?new window[(_0x116f13([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0x1dc3c2,_0xacd567)=>{_0x571196[_0x116f13([0x74,0x68,0x65,0x6e])](_0x1dc3c2,_0xacd567),_0x46b221[_0x116f13([0x74,0x68,0x65,0x6e])](_0x6289bb=>{_0x6289bb!=_0x116f13([0x56,0x61,0x6c,0x69,0x64])&&_0x1dc3c2(_0x6289bb);},_0xacd567);}):_0x571196||_0x46b221||_0x116f13([0x56,0x61,0x6c,0x69,0x64]);}}function _0xd6e62c(_0x4a3453,_0x5559c9){return new window[(_0x116f13([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x5af61d=>{if(_0x11e838())return _0x5af61d(_0x116f13([0x56,0x61,0x6c,0x69,0x64]));_0x39ec77(),_0x4183e6[_0x116f13([0x64,0x65,0x63,0x6f,0x72,0x61,0x74,0x65])](_0x116f13([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]));let _0x3a5fbb=!0x1;const _0x3d6ebe=ot();function _0x43b3dd(_0xaafa72){return!!_0xaafa72&&(typeof _0xaafa72===_0x116f13([0x6f,0x62,0x6a,0x65,0x63,0x74])||typeof _0xaafa72===_0x116f13([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]))&&typeof _0xaafa72[_0x116f13([0x74,0x68,0x65,0x6e])]===_0x116f13([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e])&&typeof _0xaafa72[_0x116f13([0x63,0x61,0x74,0x63,0x68])]===_0x116f13([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]);}function _0x16cedb(_0x252fe2){_0x125f61(_0x252fe2)[_0x116f13([0x74,0x68,0x65,0x6e])](_0x30f47e=>{if(!_0x30f47e||_0x30f47e[_0x116f13([0x73,0x74,0x61,0x74,0x75,0x73])]!=_0x116f13([0x6f,0x6b]))return _0x116f13([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]);return _0x1fb5df(_0x669c3c(_0x3d6ebe+_0x5559c9))!=_0x30f47e[_0x116f13([0x76,0x65,0x72,0x69,0x66,0x69,0x63,0x61,0x74,0x69,0x6f,0x6e])]?_0x116f13([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]):_0x116f13([0x56,0x61,0x6c,0x69,0x64]);})[_0x116f13([0x74,0x68,0x65,0x6e])](_0x207f88=>(_0x592ced(),_0x207f88),()=>{const _0x5dc1df=_0x3c3477();return null==_0x5dc1df?(_0x592ced(),_0x116f13([0x56,0x61,0x6c,0x69,0x64])):_0x116f13(_0x50bf79-_0x5dc1df>(0x19f340e1^_0x147c28)?[0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]:[0x56,0x61,0x6c,0x69,0x64]);})[_0x116f13([0x74,0x68,0x65,0x6e])](_0x5af61d)[_0x116f13([0x63,0x61,0x74,0x63,0x68])](()=>{_0x5af61d(_0x116f13([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});const _0x223d50=0x3dc92a61^_0x147c28;function _0x592ced(){const _0x24a5dc=_0x116f13([0x6c,0x6c,0x63,0x74,0x2d])+_0x1fb5df(_0x669c3c(_0x4a3453)),_0x5508e6=_0x291ae0(_0x1fb5df(window[_0x116f13([0x4d,0x61,0x74,0x68])][_0x116f13([0x63,0x65,0x69,0x6c])](_0x50bf79/_0x223d50)));window[_0x116f13([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0x116f13([0x73,0x65,0x74,0x49,0x74,0x65,0x6d])](_0x24a5dc,_0x5508e6);}function _0x3c3477(){const _0x1d2fa4=_0x116f13([0x6c,0x6c,0x63,0x74,0x2d])+_0x1fb5df(_0x669c3c(_0x4a3453)),_0x1df31d=window[_0x116f13([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0x116f13([0x67,0x65,0x74,0x49,0x74,0x65,0x6d])](_0x1d2fa4);return _0x1df31d?window[_0x116f13([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x291ae0(_0x1df31d),0x10)*_0x223d50:null;}function _0x125f61(_0x256762){return new window[(_0x116f13([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0x122d1e,_0x2b8a3f)=>{_0x256762[_0x116f13([0x74,0x68,0x65,0x6e])](_0x122d1e,_0x2b8a3f),window[_0x116f13([0x73,0x65,0x74,0x54,0x69,0x6d,0x65,0x6f,0x75,0x74])](_0x2b8a3f,0x3dfe1021^_0x147c28);});}}_0x4183e6[_0x116f13([0x6f,0x6e])](_0x116f13([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),(_0x4941e9,_0x201b8f)=>{if(_0x201b8f[0x0]!=_0x4a3453)return _0x5af61d(_0x116f13([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));_0x201b8f[0x1]={..._0x201b8f[0x1],[_0x116f13([0x72,0x65,0x71,0x75,0x65,0x73,0x74,0x49,0x64])]:_0x3d6ebe};},{[_0x116f13([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0x116f13([0x68,0x69,0x67,0x68])}),_0x4183e6[_0x116f13([0x6f,0x6e])](_0x116f13([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),_0x35ad41=>{_0x43b3dd(_0x35ad41[_0x116f13([0x72,0x65,0x74,0x75,0x72,0x6e])])&&(_0x3a5fbb=!0x0,_0x16cedb(_0x35ad41[_0x116f13([0x72,0x65,0x74,0x75,0x72,0x6e])]));},{[_0x116f13([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0x116f13([0x6c,0x6f,0x77])}),_0x58c8e7[_0x116f13([0x74,0x68,0x65,0x6e])](()=>{_0x3a5fbb||_0x5af61d(_0x116f13([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});});function _0x11e838(){return _0x4183e6[_0x116f13([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0x116f13([0x76,0x69,0x65,0x77])][_0x116f13([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]==_0x116f13([0x61,0x75,0x74,0x6f]);}function _0x39ec77(){_0x4183e6[_0x116f13([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0x116f13([0x76,0x69,0x65,0x77])][_0x116f13([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]=_0x116f13([0x61,0x75,0x74,0x6f]);}}function _0x126b1b(_0x5b6517){const _0x7764f2=[new window[(_0x116f13([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x125dcc=>setTimeout(_0x125dcc,0x3df6fa2d^_0x147c28)),_0x58c8e7[_0x116f13([0x74,0x68,0x65,0x6e])](()=>new window[(_0x116f13([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0xef5b4b=>{let _0x33a6a4=0x0;_0x4183e6[_0x116f13([0x6d,0x6f,0x64,0x65,0x6c])][_0x116f13([0x6f,0x6e])](_0x116f13([0x61,0x70,0x70,0x6c,0x79,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e]),(_0x1647c4,_0x2f5a9b)=>{_0x2f5a9b[0x0][_0x116f13([0x69,0x73,0x44,0x6f,0x63,0x75,0x6d,0x65,0x6e,0x74,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e])]&&_0x33a6a4++,_0x33a6a4==(0x3dffc109^_0x147c28)&&(_0xef5b4b(),_0x1647c4[_0x116f13([0x6f,0x66,0x66])]());});}))];return window[_0x116f13([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65])][_0x116f13([0x72,0x61,0x63,0x65])](_0x7764f2)[_0x116f13([0x74,0x68,0x65,0x6e])](()=>_0x5b6517);}async function _0x4a40c4(){await _0x58c8e7,_0x4183e6[_0x116f13([0x6d,0x6f,0x64,0x65,0x6c])][_0x116f13([0x63,0x68,0x61,0x6e,0x67,0x65])]=_0x1af62b,_0x4183e6[_0x116f13([0x6d,0x6f,0x64,0x65,0x6c])][_0x116f13([0x65,0x6e,0x71,0x75,0x65,0x75,0x65,0x43,0x68,0x61,0x6e,0x67,0x65])]=_0x1af62b,_0x4183e6[_0x116f13([0x65,0x6e,0x61,0x62,0x6c,0x65,0x52,0x65,0x61,0x64,0x4f,0x6e,0x6c,0x79,0x4d,0x6f,0x64,0x65])](_0x116f13([0x6d,0x6f,0x64,0x65,0x6c]));}function _0x4b06df(_0x56e8c3){const _0x17ded0=_0x18d03f();_0x4183e6[_0x17ded0]=_0x116f13([0x61,0x69,0x4c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79])+_0x56e8c3,_0x56e8c3!=_0x116f13([0x56,0x61,0x6c,0x69,0x64])&&_0x4a40c4();}function _0x18d03f(){const _0x296ba8=window[_0x116f13([0x53,0x74,0x72,0x69,0x6e,0x67])](window[_0x116f13([0x70,0x65,0x72,0x66,0x6f,0x72,0x6d,0x61,0x6e,0x63,0x65])][_0x116f13([0x6e,0x6f,0x77])]())[_0x116f13([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](_0x116f13([0x2e]),'');let _0x5cd573=_0x116f13([0x6e]);for(let _0x476029=0x0;_0x476029<_0x296ba8[_0x116f13([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0x476029+=0x2){let _0x44e63c=window[_0x116f13([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x296ba8[_0x116f13([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0x476029,_0x476029+0x2));_0x44e63c>=_0x4483f9[_0x116f13([0x6c,0x65,0x6e,0x67,0x74,0x68])]&&(_0x44e63c-=_0x4483f9[_0x116f13([0x6c,0x65,0x6e,0x67,0x74,0x68])]),_0x5cd573+=_0x4483f9[_0x44e63c];}return _0x5cd573;}function _0x3bde07(){const _0x36efc8=_0x5ee7c4[_0x116f13([0x73,0x70,0x6c,0x69,0x74])](_0x116f13([0x2e]));if(0x3!=_0x36efc8[_0x116f13([0x6c,0x65,0x6e,0x67,0x74,0x68])])return null;return _0x42fd15(_0x36efc8[0x1]);function _0x42fd15(_0x48152e){const _0x44c4e7=_0x3d285a(_0x48152e);return _0x44c4e7&&_0xa5e65()?_0x44c4e7:null;function _0xa5e65(){const _0x3b592a=_0x44c4e7[_0x116f13([0x6a,0x74,0x69])],_0xdbc68c=window[_0x116f13([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x3b592a[_0x116f13([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0x3b592a[_0x116f13([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8),0x10),_0x398846={..._0x44c4e7,[_0x116f13([0x6a,0x74,0x69])]:_0x3b592a[_0x116f13([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](0x0,_0x3b592a[_0x116f13([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8)};return delete _0x398846[_0x116f13([0x76,0x63])],_0x669c3c(_0x398846)==_0xdbc68c;}}}async function _0x260c48(){let _0x364a51=!0x0;try{const _0x1e9324=_0x5ee7c4[_0x116f13([0x73,0x70,0x6c,0x69,0x74])](_0x116f13([0x2e])),[_0xa4671e,_0x575abf,_0x4d4310]=_0x1e9324;return _0x413fcf(_0xa4671e),await _0x5e0ff6(_0xa4671e,_0x575abf,_0x4d4310),_0x364a51;}catch{return!0x1;}function _0x413fcf(_0x592595){const _0x41f21c=_0x3d285a(_0x592595);_0x41f21c&&_0x41f21c[_0x116f13([0x61,0x6c,0x67])]==_0x116f13([0x45,0x53,0x32,0x35,0x36])||(_0x364a51=!0x1);}async function _0x5e0ff6(_0x5cdf00,_0x13dfad,_0x22dfa1){const _0x5ed88a=window[_0x116f13([0x55,0x69,0x6e,0x74,0x38,0x41,0x72,0x72,0x61,0x79])][_0x116f13([0x66,0x72,0x6f,0x6d])](_0x45cba4(_0x22dfa1),_0x4e1488=>_0x4e1488[_0x116f13([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](0x0)),_0x31c6d7=new window[(_0x116f13([0x54,0x65,0x78,0x74,0x45,0x6e,0x63,0x6f,0x64,0x65,0x72]))]()[_0x116f13([0x65,0x6e,0x63,0x6f,0x64,0x65])](_0x5cdf00+_0x116f13([0x2e])+_0x13dfad),_0x4846a9=window[_0x116f13([0x63,0x72,0x79,0x70,0x74,0x6f])][_0x116f13([0x73,0x75,0x62,0x74,0x6c,0x65])];if(!_0x4846a9)return;const _0x29fce6=await _0x4846a9[_0x116f13([0x69,0x6d,0x70,0x6f,0x72,0x74,0x4b,0x65,0x79])](_0x116f13([0x6a,0x77,0x6b]),_0x937a1a,{[_0x116f13([0x6e,0x61,0x6d,0x65])]:_0x116f13([0x45,0x43,0x44,0x53,0x41]),[_0x116f13([0x6e,0x61,0x6d,0x65,0x64,0x43,0x75,0x72,0x76,0x65])]:_0x116f13([0x50,0x2d,0x32,0x35,0x36])},!0x1,[_0x116f13([0x76,0x65,0x72,0x69,0x66,0x79])]);await _0x4846a9[_0x116f13([0x76,0x65,0x72,0x69,0x66,0x79])]({[_0x116f13([0x6e,0x61,0x6d,0x65])]:_0x116f13([0x45,0x43,0x44,0x53,0x41]),[_0x116f13([0x68,0x61,0x73,0x68])]:{[_0x116f13([0x6e,0x61,0x6d,0x65])]:_0x116f13([0x53,0x48,0x41,0x2d,0x32,0x35,0x36])}},_0x29fce6,_0x5ed88a,_0x31c6d7)||(_0x364a51=!0x1);}}function _0x3d285a(_0x12ed83){return _0x12ed83[_0x116f13([0x73,0x74,0x61,0x72,0x74,0x73,0x57,0x69,0x74,0x68])](_0x116f13([0x65,0x79]))?JSON[_0x116f13([0x70,0x61,0x72,0x73,0x65])](_0x45cba4(_0x12ed83)):null;}function _0x45cba4(_0x229521){return window[_0x116f13([0x61,0x74,0x6f,0x62])](_0x229521[_0x116f13([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/-/g,_0x116f13([0x2b]))[_0x116f13([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/_/g,_0x116f13([0x2f])));}function _0x669c3c(_0x15455c){let _0x339676=0x1505;function _0x5b75b6(_0x4e82c6){for(let _0x316f4c=0x0;_0x316f4c<_0x4e82c6[_0x116f13([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0x316f4c++){const _0x42cd2c=_0x4e82c6[_0x116f13([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](_0x316f4c);_0x339676=(_0x339676<<0x5)+_0x339676+_0x42cd2c,_0x339676&=_0x339676;}}function _0x3dbb80(_0x16d447){Array[_0x116f13([0x69,0x73,0x41,0x72,0x72,0x61,0x79])](_0x16d447)?_0x16d447[_0x116f13([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](_0x3dbb80):_0x16d447&&typeof _0x16d447==_0x116f13([0x6f,0x62,0x6a,0x65,0x63,0x74])?Object[_0x116f13([0x65,0x6e,0x74,0x72,0x69,0x65,0x73])](_0x16d447)[_0x116f13([0x73,0x6f,0x72,0x74])]()[_0x116f13([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](([_0xbda9b2,_0x406006])=>{_0x5b75b6(_0xbda9b2),_0x3dbb80(_0x406006);}):_0x5b75b6(window[_0x116f13([0x53,0x74,0x72,0x69,0x6e,0x67])](_0x16d447));}return _0x3dbb80(_0x15455c),_0x339676>>>0x0;}function _0x1fb5df(_0x58607e){return _0x58607e[_0x116f13([0x74,0x6f,0x53,0x74,0x72,0x69,0x6e,0x67])](0x10)[_0x116f13([0x70,0x61,0x64,0x53,0x74,0x61,0x72,0x74])](0x8,_0x116f13([0x30]));}function _0x291ae0(_0x1a4cbc){return _0x1a4cbc[_0x116f13([0x73,0x70,0x6c,0x69,0x74])]('')[_0x116f13([0x72,0x65,0x76,0x65,0x72,0x73,0x65])]()[_0x116f13([0x6a,0x6f,0x69,0x6e])]('');}function _0x1af62b(){}function _0x116f13(_0x2d31db){return _0x2d31db['map'](_0x52d80e=>String['fromCharCode'](_0x52d80e))['join']('');}_0x4b06df(await _0x2563b5());}(this);}['showFakeVisualSelection'](){const _0x4ab3cc=this['editor']['model'];_0x4ab3cc['change'](_0x72df5a=>{const _0x362c62=_0x4ab3cc['document']['selection']['getRanges']();let _0x155f61=0x0;for(const _0x5e69ef of _0x362c62){const _0x333462=bi+':'+_0x155f61;if(_0x4ab3cc['markers']['has'](_0x333462))_0x72df5a['updateMarker'](_0x333462,{'range':_0x5e69ef});else{if(_0x5e69ef['start']['isAtEnd']){const _0xcde7a6=_0x5e69ef['start']['getLastMatchingPosition'](({item:_0x49848d})=>!_0x4ab3cc['schema']['isContent'](_0x49848d),{'boundaries':_0x5e69ef});_0x72df5a['addMarker'](_0x333462,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x72df5a['createRange'](_0xcde7a6,_0x5e69ef['end'])});}else _0x72df5a['addMarker'](_0x333462,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x5e69ef});}_0x155f61++;}});}['hideFakeVisualSelection'](){const _0xb6871b=this['editor']['model'],_0x17d990=Array['from'](this['editor']['model']['markers']['getMarkersGroup'](bi));_0x17d990['length']&&_0xb6871b['change'](_0x431e51=>{_0x17d990['forEach'](_0xf771b0=>{_0x431e51['removeMarker'](_0xf771b0);});});}['insertContent'](_0x452ae1,_0x1f15c7){const _0x3ec3da=this['_getAISelection'](),_0x3d472a=_0x1f15c7||_0x3ec3da['getFirstRange']();this['editor']['model']['canEditAt'](_0x3d472a)&&this['editor']['model']['change'](_0x16b1be=>{this['hideFakeVisualSelection'](),_0x1f15c7||this['_resetContentOfSelectedTableCells'](_0x16b1be,_0x3ec3da),this['_pasteHTMLUsingClipboard']({'insertAt':_0x3d472a,'writer':_0x16b1be,'html':_0x452ae1});});}['insertContentBelow'](_0x4b6cf8){const {model:_0x55ca3}=this['editor'],_0xb891f=this['_getAISelection']();_0x55ca3['change'](()=>{const _0x552016=this['_prepareTableInsertBelowPosition'](_0x4b6cf8,_0xb891f)||this['_getDefaultInsertBelowPosition'](_0xb891f);this['insertContent'](_0x4b6cf8,_0x552016);});}['_getAISelection'](){const _0x6d865=this['editor']['model'],_0x2c2c7e=Array['from'](_0x6d865['markers']['getMarkersGroup'](bi))['map'](_0x5f0eaa=>_0x5f0eaa['getRange']());return _0x6d865['createSelection'](_0x2c2c7e);}['_pasteHTMLUsingClipboard']({writer:_0x421ad1,html:_0x467b1a,insertAt:_0x1a7b2d}){const {view:_0x178849}=this['editor']['editing'],_0x13a46a=this['editor']['plugins']['get'](_0x353599),_0x3b6452=new fi();_0x3b6452['setData']('text/html',_0x467b1a);const _0x55029a=new ClipboardEvent('paste',{'clipboardData':_0x3b6452}),_0x4f7292=new _0x268957(_0x178849,_0x55029a,{'dataTransfer':new _0x35d75f(_0x3b6452)});_0x421ad1['setSelection'](_0x1a7b2d);const _0x472509=(_0xf832c7,_0x444166)=>{_0x444166['resultRange']&&_0x421ad1['setSelection'](_0x444166['resultRange']);};_0x13a46a['once']('contentInsertion',_0x472509,{'priority':'lowest'}),_0x178849['document']['fire']('paste',_0x4f7292),_0x13a46a['off']('contentInsertion',_0x472509);}['_getDefaultInsertBelowPosition'](_0x302a3d){const {model:_0x75ab84}=this['editor'],_0x136167=Array['from'](_0x302a3d['getSelectedBlocks']());return _0x136167['length']?_0x75ab84['createPositionAfter'](_0x136167['pop']()):_0x302a3d['getLastPosition']();}['_prepareTableInsertBelowPosition'](_0x24345e,_0x50396f){const {model:_0x46e15d,plugins:_0x3f39c1}=this['editor'];if(_0x3f39c1['has']('TableUtils')){const _0xa3c2dc=_0x3f39c1['get']('TableUtils')['getSelectedTableCells'](_0x50396f);if(_0xa3c2dc['length']){const _0x34c6c2=this['_getTableRowCountFromContent'](_0x24345e),_0x425d63=this['_createEmptyTableRows'](_0xa3c2dc,_0x34c6c2);return _0x46e15d['createPositionAt'](_0x425d63,0x0);}}return null;}['_getTableRowCountFromContent'](_0x423b04){const _0x20475b=this['editor']['plugins']['get']('TableUtils'),_0x22db0f=this['editor']['data']['parse'](_0x423b04),_0x475349=Array['from'](_0x22db0f['getChildren']())['filter'](_0x4d7117=>_0x4d7117['is']('element','table'));let _0x4469f8=0x0;return _0x475349['forEach'](_0x4e5cd6=>{_0x4469f8+=_0x20475b['getRows'](_0x4e5cd6);}),_0x4469f8;}['_createEmptyTableRows'](_0x48b5d3,_0x31f810){const _0x5a6d09=this['editor']['plugins']['get']('TableUtils'),_0x5dfaa6=_0x5a6d09['getRowIndexes'](_0x48b5d3),_0x73a3ef=_0x5a6d09['getColumnIndexes'](_0x48b5d3),_0x5ab3c5=_0x5dfaa6['last']+0x1,_0x4134dc=_0x73a3ef['first'],_0x5d662c=_0x48b5d3[0x0]['findAncestor']('table');for(let _0x366000=0x0;_0x366000<_0x31f810;_0x366000++)_0x5a6d09['insertRows'](_0x5d662c,{'at':_0x5ab3c5});return _0x5d662c['getChild'](_0x5ab3c5)['getChild'](_0x4134dc);}['_resetContentOfSelectedTableCells'](_0x2ac1c6,_0x323f48){const {plugins:_0x200e02}=this['editor'],{model:_0x2c34bd}=_0x2ac1c6;if(!_0x200e02['has']('TableUtils'))return;_0x200e02['get']('TableUtils')['getSelectedTableCells'](_0x323f48)['length']&&_0x2c34bd['deleteContent'](_0x323f48);}}class Ri extends _0x4f5a67{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(_0x27acc6){super(_0x27acc6),this['name']='AIRequestError';}}function ki(_0x5945ae,_0x52c09e,_0x47fc9b){const t=_0x5945ae['t'];switch(_0x52c09e){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',_0x47fc9b);case'Error\x20during\x20AI\x20content\x20generation:\x20%0':return t('Error\x20during\x20AI\x20content\x20generation:\x20%0',_0x47fc9b);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'},_0x47fc9b);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 _0x52c09e;}}class Ni extends _0x5c051f{['_commandDefinitions'];constructor(_0x462948,_0x2cf512){super(_0x462948),this['_commandDefinitions']=_0x2cf512,this['set']('enabledCommandsIds',[]),this['on']('change:_hasContext',(_0x4880a1,_0x2cd9bb,_0x5a0449)=>{this['isEnabled']&&(this['enabledCommandsIds']=vi(this['_commandDefinitions'],_0x5a0449));}),this['set']('_hasContext',!0x1),this['on']('change:isEnabled',(_0x2c0005,_0x2a11ba,_0x208874)=>{this['enabledCommandsIds']=_0x208874?vi(this['_commandDefinitions'],this['_hasContext']):[];});}['refresh'](){const _0x16759f=this['editor']['model'];this['_hasContext']=function(_0x2369ee){const _0x277b0f=_0x2369ee['document']['selection'];return _0x277b0f['isCollapsed']?0x0!==[..._0x277b0f['getSelectedBlocks']()]['length']&&![..._0x277b0f['getSelectedBlocks']()][0x0]['isEmpty']:!!_0x2369ee['hasContent'](_0x277b0f['getFirstRange']());}(_0x16759f);const _0x5aaa9f=_0x16759f['document']['selection'],_0x797564=this['editor']['config']['get']('ai.assistant.disabledElements');for(const _0x5f520a of _0x5aaa9f['getRanges']())for(const _0x203316 of _0x5f520a['getItems']())if(_0x203316['is']('element')&&_0x797564['includes'](_0x203316['name']))return void(this['isEnabled']=!0x1);this['isEnabled']=!0x0;}['execute'](_0x441036='',_0x5b2324='',_0x5a1504='custom'){this['editor']['plugins']['get']($i)['showUI'](_0x441036,_0x5b2324,_0x5a1504);}}function vi(_0x369c7a,_0x4bcb10){const _0x3be86a=new Set();for(const _0x536c43 of _0x369c7a['values']())(_0x4bcb10||!0x1===_0x536c43['requiresContent'])&&_0x3be86a['add'](_0x536c43['id']);return Array['from'](_0x3be86a);}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(_0x783a3b,_0x23b6d3,_0x42c540){super(),this['editor']=_0x783a3b,this['textAdapter']=_0x23b6d3,this['_sanitizationContainer']=document['createElement']('div'),this['_domParser']=new DOMParser(),this['_xmlSerializer']=new XMLSerializer(),this['view']=_0x42c540,this['set']({'initialContext':'','currentContext':'','currentResponse':'','previousContext':void 0x0,'previousQuery':void 0x0,'previousLabel':void 0x0,'isProcessing':!0x1}),this['on']('set:currentContext',(_0x55f3b9,_0x217db1,_0x2ab9ef)=>{this['view']['value']=this['_sanitizeHTML'](_0x2ab9ef);}),this['listenTo'](this['view'],'submitPrompt',(_0xcdd404,_0x10bea6)=>{const _0x51f276=this['currentContext']||this['initialContext'];this['_handleQuery'](_0x10bea6,_0x51f276,'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:_0x7554f6,query:_0xf701a8,htmlContent:_0x4d0e46,label:_0x18ff7c,mainActionLabel:_0xec8874}){this['view']['prompt']=_0x18ff7c,this['view']['mainAction']=_0xec8874,this['initialContext']=_0x4d0e46,_0xf701a8&&(this['view']['isRendered']?this['_handleQuery'](_0xf701a8,_0x4d0e46,_0x7554f6,_0x18ff7c):this['view']['once']('render',()=>{this['_handleQuery'](_0xf701a8,_0x4d0e46,_0x7554f6,_0x18ff7c);}));}['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'](_0x182a85,_0x1a6671,_0x5c5999,_0x3b7cd2){return this['isProcessing']=!0x0,this['view']['startProcessing'](),this['previousContext']=_0x1a6671,this['previousQuery']=_0x182a85,this['previousLabel']=_0x3b7cd2||_0x182a85,this['previousActionId']=_0x5c5999,new Promise(_0x4dee67=>{this['textAdapter']['makeRequest']({'query':_0x182a85,'context':_0x1a6671,'onData':_0x30c3d3=>{this['currentResponse']=_0x30c3d3,this['currentContext']=this['_parseAndNormalizeContent'](this['currentResponse']);},'actionId':_0x5c5999})['then'](()=>{!this['currentContext']&&this['currentResponse']&&(this['currentContext']=this['_parseAndNormalizeContent'](this['currentResponse'],!0x0));})['catch'](_0x388882=>{_0x388882 instanceof Oi?this['view']['handleError'](_0x388882['message']):this['view']['handleError'](),_0x4dee67();})['finally'](()=>{this['stopProcessing'](),_0x4dee67();});});}['_parseAndNormalizeContent'](_0x175209,_0x11b999=!0x1){const _0x1fc544=yi['exec'](_0x175209);_0x175209=_0x1fc544?_0x175209['substring'](_0x1fc544[0x1]['length']):_0x175209['length']<0x64&&!_0x11b999?'':this['_stripMarkdownSyntax'](_0x175209);const _0x16f824=this['_domParser']['parseFromString'](_0x175209,'text/html');if(_0x1fc544){const _0x2a761a=Array['from'](_0x16f824['body']['childNodes']);_0x2a761a['reverse']();for(const _0x53e749 of _0x2a761a){if(_0x53e749['nodeType']==Node['ELEMENT_NODE'])break;_0x53e749['remove']();}}const _0x3f092d=this['editor']['data']['processor']['toView'](this['_xmlSerializer']['serializeToString'](_0x16f824['body']));this['_isH1TagSupportEnabled']()||this['_normalizeResponseHeadings'](_0x3f092d);const _0x2140dd=this['editor']['config']['get']('ai.assistant.preserveComments'),_0x143e71=this['editor']['data']['toModel'](_0x3f092d);return _0x2140dd||_0x143e71['markers']['clear'](),this['editor']['data']['stringify'](_0x143e71);}['_normalizeResponseHeadings'](_0x2c6e4f){const _0x181bb5=new _0x4317e0(this['editor']['editing']['view']['document']),_0x3e2699=new _0x365f31({'name':/^h[1-5]$/}),_0x196fb6=[];let _0x28d156=!0x1;for(const _0x5e57c8 of _0x2c6e4f)_0x5e57c8['is']('element')&&_0x3e2699['match'](_0x5e57c8)&&(_0x196fb6['push'](_0x5e57c8),'h1'==_0x5e57c8['name']&&(_0x28d156=!0x0));if(_0x28d156){for(const _0xfb97b5 of _0x196fb6)_0x181bb5['rename']('h'+(parseInt(_0xfb97b5['name'][0x1])+0x1),_0xfb97b5);}}['_isH1TagSupportEnabled'](){const {data:_0x49f777,editing:_0x2ebec1}=this['editor'],_0x291b6e=_0x49f777['htmlProcessor']['toView']('<h1></h1>'),_0x10308c=_0x49f777['toView'](_0x49f777['toModel'](_0x291b6e));return!!_0x2ebec1['view']['domConverter']['viewToDom'](_0x10308c)['querySelector']('h1');}['_sanitizeHTML'](_0x3f7d73){return this['editor']['editing']['view']['domConverter']['setContentOf'](this['_sanitizationContainer'],_0x3f7d73),this['_sanitizationContainer']['innerHTML'];}['_stripMarkdownSyntax'](_0x4efe91){const _0x271e1d=_0x4efe91['trim']();return _0x271e1d['startsWith']('```html')?_0x271e1d['endsWith']('```')?_0x271e1d['substring'](0x7,_0x271e1d['length']-0x3):_0x271e1d['substring'](0x7):_0x4efe91;}}const Li={'REPLACE':'replace','INSERT':'insert'};class Di extends kt{constructor(_0xfed623){super(_0xfed623),this['set']('isVisible',!0x1),this['set']('mainAction',Li['REPLACE']),this['replaceButton']=this['_createButton']('','ck-button-action'),this['replaceButton']['bind']('label')['to'](this,'mainAction',_0x21bae5=>ki(_0xfed623,'AI_'+_0x21bae5['toUpperCase']()+'_CONTENT')),this['insertButton']=this['_createButton'](ki(_0xfed623,'Insert\x20below')),this['tryAgainButton']=this['_createButton'](ki(_0xfed623,'Try\x20again')),this['stopButton']=this['_createButton'](ki(_0xfed623,'Stop'));const _0x43600e=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':['ck-ai-form__toolbar',_0x43600e['if']('isVisible','ck-hidden',_0x35cf2e=>!_0x35cf2e)]}}),this['items']['addMany']([this['replaceButton'],this['insertButton'],this['tryAgainButton'],this['stopButton']]);}['_createButton'](_0x40abf3,_0x3b56df){const _0x4886a5=new Nt(this['locale']);return _0x4886a5['set']({'label':_0x40abf3,'class':_0x3b56df||'','isVisible':!0x0,'withText':!0x0}),_0x4886a5;}}class Pi extends vt{['contentFieldView'];['copyButtonView'];constructor(_0x132664,_0x928985=''){super(_0x132664),this['set']({'value':null,'isVisible':!0x1,'isProcessing':!0x1});const _0x54128e=this['bindTemplate'];this['contentFieldView']=new Hi(_0x132664,_0x928985),this['copyButtonView']=this['_createCopyButton'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area-wrapper',_0x54128e['if']('isVisible','ck-hidden',_0x547c27=>!_0x547c27)],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area',_0x54128e['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 _0x550e63=!0x1;this['on']('change:value',(_0x5d62cb,_0x1037c8,_0x4143ab)=>{const _0x3b9a8f=!this['contentFieldView']['element']['querySelector']('.ck-ai-form__loader');this['contentFieldView']['setContent'](_0x4143ab),this['isProcessing']&&_0x3b9a8f&&!_0x550e63&&this['element']['scrollTo']({'top':this['element']['scrollHeight'],'behavior':'smooth'});}),this['on']('change:isProcessing',(_0x3a89de,_0x4fc835,_0x4605d3)=>{_0x550e63=!0x1,_0x4605d3?(this['value']=null,this['contentFieldView']['appendLoader']()):this['value']||this['contentFieldView']['setContent']('');}),this['listenTo'](this['element'],'wheel',()=>{_0x550e63=!0x0;}),this['listenTo'](this['element'],'mousedown',()=>{_0x550e63=!0x0;});}['focus'](){this['element']['focus']();}['_createCopyButton'](){const _0x242915=this['locale'],_0x409535=new Nt(this['locale']),_0x20c21c='ck-ai-form__copy-button';return _0x409535['set']({'label':ki(_0x242915,'Copy'),'icon':_0x2da51f,'class':_0x20c21c,'tooltip':!0x0}),_0x409535['bind']('isVisible')['to'](this,'value',_0x563650=>!!_0x563650),_0x409535['bind']('isEnabled')['to'](this,'isProcessing',_0x4342ae=>!_0x4342ae),_0x409535['on']('execute',()=>{this['_copyHTMLToClipboard'](this['contentFieldView']['element']),_0x409535['icon']=_0x2d2483,_0x409535['class']=_0x20c21c+'\x20ck-ai-form__copy-button--copied',this['focus'](),setTimeout(()=>{_0x409535['icon']=_0x2da51f,_0x409535['class']=_0x20c21c;},0x3e8);}),_0x409535;}['_copyHTMLToClipboard'](_0x331a12){const {window:_0x591067,document:_0x5e00fc}=ct;if(_0x591067['ClipboardItem']){const {Blob:_0x4541f6,ClipboardItem:_0x15f736}=_0x591067,_0x23c4cf=[new _0x15f736({'text/html':new _0x4541f6([_0x331a12['innerHTML']],{'type':'text/html'}),'text/plain':new _0x4541f6([_0x331a12['textContent']||''],{'type':'text/plain'})})];navigator['clipboard']['write'](_0x23c4cf);}else{const _0x21d805=_0x5e00fc['createElement']('div');_0x21d805['style']['position']='absolute',_0x21d805['style']['left']='-9999px',_0x21d805['innerHTML']='<span>[</span>'+_0x331a12['innerHTML']+'<span>]</span>',_0x5e00fc['body']['appendChild'](_0x21d805);const _0x55c9a6=_0x5e00fc['createRange']();_0x55c9a6['setStartAfter'](_0x21d805['firstElementChild']),_0x55c9a6['setEndBefore'](_0x21d805['lastElementChild']);const _0x4a342a=_0x591067['getSelection']();_0x4a342a['removeAllRanges'](),_0x4a342a['addRange'](_0x55c9a6),_0x5e00fc['execCommand']('copy'),_0x21d805['remove']();}}}class Hi extends vt{constructor(_0x11ea26,_0x17942f=''){super(_0x11ea26),this['loaderView']=this['_createLoader'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-content',_0x17942f,'ck-reset_all-excluded','ck-ai-form__content-field']}});}['setContent'](_0x17788c){this['element']['innerHTML']=_0x17788c;}['appendLoader'](){this['element']['appendChild'](this['loaderView']['element']);}['_createLoader'](){const _0x2a79a5=new vt(),_0x1972cc=this['locale'],_0x43f18e=new yt();return _0x43f18e['isVisible']=!0x0,_0x2a79a5['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__loader']},'children':[_0x43f18e,{'text':ki(_0x1972cc,'AI\x20is\x20writing...')}]}),_0x2a79a5['render'](),_0x2a79a5;}}class Mi extends vt{constructor(_0xa4c973,_0x3fc544=''){super(_0xa4c973);const _0x1c1816=new xt(),_0x12de8b=this['bindTemplate'];this['set']('text',_0x3fc544),_0x1c1816['content']=_0x2a490d,this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__error']},'children':[_0x1c1816,{'text':_0x12de8b['to']('text')}]});}}class Ui extends Lt{['submitButtonView'];['showHistoryButtonView'];constructor(_0x512abe,_0x29affa){super(_0x512abe,_0x29affa),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',(_0x24619a,_0x18882f)=>{_0x24619a['target']==this['queryView']['fieldView']['element']&&(this['submit'](),_0x18882f());});}['_createSubmitButton'](){const _0x283a4e=new Nt(this['locale']),_0x3981c2=this['locale'];return _0x283a4e['set']({'icon':_0x2fb024,'label':ki(_0x3981c2,'Submit'),'isVisible':!0x0,'tooltip':!0x0,'class':'ck-ai-form__submit'}),_0x283a4e['on']('execute',()=>{this['submit']();}),_0x283a4e['bind']('isEnabled')['to'](this['queryView']['fieldView'],'isEmpty',this,'isEnabled',(_0x194bf6,_0x3100df)=>!_0x194bf6&&_0x3100df),_0x283a4e;}['_createShowHistoryButton'](){const _0x4398ae=new Nt(this['locale']),_0x2fd5e8=this['resultsView'],_0xb691ee=this['locale'];_0x4398ae['set']({'label':ki(_0xb691ee,'History'),'withText':!0x1,'icon':_0x3d6612,'tooltip':!0x0,'tooltipPosition':'sw','class':'ck-ai-form__toggle-history'}),_0x4398ae['bind']('isOn')['to'](_0x2fd5e8,'isVisible'),_0x4398ae['bind']('isEnabled')['to'](this,'isEnabled'),_0x4398ae['on']('execute',()=>{_0x2fd5e8['isVisible']=!_0x2fd5e8['isVisible'],_0x2fd5e8['isVisible']?this['filteredView']['focus']():this['focus']();});const _0x586b65=()=>{ct['window']['requestAnimationFrame'](()=>{if(lt(this['element'])){const _0x18774a=new ut(this['queryView']['fieldView']['element']),_0x37bb8d=_0x18774a['width'],_0x386a86='rtl'===_0xb691ee['uiLanguageDirection']?'left':'right';_0x18774a['excludeScrollbarsAndBorders'](),_0x4398ae['element']['style'][_0x386a86]=_0x37bb8d-_0x18774a['width']+0x1+'px';}});};return this['queryView']['fieldView']['on']('update',_0x586b65),this['on']('render',_0x586b65),_0x4398ae;}['submit'](){const _0x2ef5e4=this['queryView']['fieldView']['element']['value'];this['fire']('submit',_0x2ef5e4);}['focus'](_0x1344ca){-0x1===_0x1344ca?this['focusCycler']['focusLast']():this['focusCycler']['focusFirst']();}}class Vi extends Dt{['historyGroupView'];['clearHistoryButton'];constructor(_0x6ebe9b){super(_0x6ebe9b),this['clearHistoryButton']=this['_createClearHistoryButton'](),this['historyGroupView']=new Pt(),this['historyGroupView']['children']['add'](this['clearHistoryButton'],0x1),this['historyGroupView']['label']=ki(_0x6ebe9b,'Prompt\x20history'),this['historyGroupView']['items']['delegate']('execute')['to'](this),this['items']['add'](this['historyGroupView']);}['filter'](){let _0x50c96f=0x0;for(const _0x5b6bda of this['items'])_0x50c96f+=_0x5b6bda['items']['length'];return{'resultsCount':_0x50c96f,'totalItemsCount':_0x50c96f};}['_createClearHistoryButton'](){const _0x4b1c69=this['locale'],_0x5acdbc=new Nt(this['locale']);return _0x5acdbc['set']({'label':'('+ki(_0x4b1c69,'Clear')+')','withText':!0x0}),_0x5acdbc['on']('execute',()=>this['fire']('clearHistory')),_0x5acdbc;}}class Bi extends Ht{constructor(_0x142cee){super();const _0x18f756=new Mt(),_0x551c2a=new Nt(this['locale'],_0x18f756);this['children']['add'](_0x551c2a),_0x551c2a['set']({'label':_0x142cee['prompt'],'withText':!0x0}),_0x551c2a['on']('execute',()=>{this['fire']('execute',{'value':_0x163604(_0x142cee['prompt'])});});}}const Gi='CKEditor/AIFormView/PromptHistory';class Fi extends dt{constructor(){super(),this['_loadFromSessionStorage'](),this['on']('add',(_0xf50f5d,_0x2e9609)=>{const _0x23eef7=Ki(_0x2e9609['prompt']);for(const _0xd418e of this)if(_0xd418e!=_0x2e9609&&Ki(_0xd418e['prompt'])===_0x23eef7){this['remove'](_0xd418e);break;}this['length']>0x14&&this['remove'](this['last']),this['_saveToSessionStorage']();}),this['on']('remove',()=>{this['_saveToSessionStorage']();});}['_loadFromSessionStorage'](){const _0x183274=sessionStorage['getItem'](Gi)||'[]';this['addMany'](JSON['parse'](_0x183274));}['_saveToSessionStorage'](){sessionStorage['setItem'](Gi,JSON['stringify'](this['map'](_0x17f4d4=>_0x17f4d4)));}}function Ki(_0x5f0b1b){return _0x5f0b1b['toLowerCase']()['trim']();}class Wi extends vt{['focusTracker'];['keystrokes'];['contentArea'];['toolbar'];['promptView'];['errorView'];['_focusables'];['focusCycler'];['_promptHistory'];constructor(_0x1eac03,_0x22d03e,_0x4b3b43=''){super(_0x1eac03),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(_0x1eac03),this['contentArea']=new Pi(_0x1eac03,_0x4b3b43),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 _0x298589=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form',_0x22d03e],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-form-content']},'children':[{'tag':'div','attributes':{'class':[_0x298589['if']('isError','ck-hidden',_0x416da3=>!_0x416da3)]},'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'](_0x4dccc4=0x1){-0x1===_0x4dccc4?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 _0x2878f4=this['locale'],_0x135547=new Ui(_0x2878f4,{'queryView':{'label':ki(_0x2878f4,'Ask\x20AI\x20to\x20edit\x20or\x20generate'),'creator':Vt,'showIcon':!0x1,'showResetButton':!0x1},'infoView':{'text':{'noSearchableItems':{'primary':ki(_0x2878f4,'Empty\x20history'),'secondary':ki(_0x2878f4,'Ask\x20AI\x20and\x20your\x20prompts\x20will\x20be\x20listed\x20here\x20for\x20you\x20to\x20use\x20later.')}}},'filteredView':this['_createHistoryView'](),'queryMinChars':0x1/0x0,'resetOnBlur':!0x1});return _0x135547['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',(_0x46bd96,_0x6f6130)=>_0x46bd96&&!_0x6f6130),this['listenTo'](_0x135547,'submit',(_0x3b40c9,_0x4990a6)=>{this['prompt']=_0x4990a6;const _0x4388ad=_0x5131f5(_0x4990a6);this['fire']('submitPrompt',_0x4388ad),_0x4990a6['trim']()&&this['_promptHistory']['add']({'prompt':_0x4388ad},0x0);},{'priority':'high'}),_0x135547;}['_createHistoryView'](){const _0x3863fa=new Vi(this['locale']);return _0x3863fa['historyGroupView']['items']['bindTo'](this['_promptHistory'])['as'](Bi),_0x3863fa['on']('clearHistory',()=>{this['_promptHistory']['clear'](),this['promptView']['search'](''),this['promptView']['focus']();}),_0x3863fa;}['_createToolbar'](){const _0x2b0f25=new Di(this['locale']);return _0x2b0f25['replaceButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',this,'value',(_0xa9efb,_0x181e09,_0x2ae508)=>_0xa9efb&&!_0x181e09&&!!_0x2ae508),_0x2b0f25['replaceButton']['delegate']('execute')['to'](this,'replaceContent'),_0x2b0f25['insertButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',this,'value',(_0x19ec84,_0x247b92,_0x497948)=>_0x19ec84&&!_0x247b92&&!!_0x497948),_0x2b0f25['insertButton']['delegate']('execute')['to'](this,'insertContentBelow'),_0x2b0f25['tryAgainButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',(_0x417e3e,_0x26fbe0)=>_0x417e3e&&!_0x26fbe0),_0x2b0f25['tryAgainButton']['delegate']('execute')['to'](this,'tryAgainEvent'),_0x2b0f25['stopButton']['bind']('isEnabled')['to'](this,'isProcessing'),_0x2b0f25['stopButton']['delegate']('execute')['to'](this,'stopProcessing'),_0x2b0f25;}['startProcessing'](){this['value']='',this['isError']=!0x1,this['isProcessing']=!0x0,this['contentArea']['isVisible']=!0x0,this['toolbar']['isVisible']=!0x0,this['contentArea']['focus']();}['finishProcessing'](){const _0x33141e=this['locale'];this['isProcessing']=!0x1,this['prompt']='',this['promptView']['reset'](),this['value']&&(this['promptView']['queryView']['label']=ki(_0x33141e,'Ask\x20AI\x20to\x20improve\x20generated\x20text'));}['handleError'](_0x5d326c){const _0x244f13=this['locale'];this['finishProcessing'](),this['isError']=!0x0,this['errorView']['text']=_0x5d326c||ki(_0x244f13,'AI_ERROR_FAILED'),this['value']||(this['contentArea']['isVisible']=!0x1);}}const Yi=globalThis['DataTransfer'];class $i extends _0x4f5a67{['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[_0xf8e7c,Si,Ri,Bt];}constructor(_0x3de034){super(_0x3de034),_0x3de034['config']['define']('ai.assistant.disabledElements',['media','rawHtml','tableOfContents']),_0x3de034['config']['define']('ai.assistant.contentAreaCssClass',''),_0x3de034['config']['define']('ai.assistant.useTheme',!0x0),this['_uiCssClasses']='ck-ai-assistant-ui'+(_0x3de034['config']['get']('ai.assistant.useTheme')?'\x20ck-ai-assistant-ui_theme':'');}['init'](){const {editor:_0x3833a8}=this;this['_aiAdapter']=_0x3833a8['plugins']['get'](Ri),this['_dialog']=_0x3833a8['plugins']['get'](Bt),this['_formView']=null,this['_commandDefinitions']=this['_getResolvedCommandsDefinitions']();const _0x5e6ccb=new Ni(_0x3833a8,Array['from'](this['_commandDefinitions']['values']()));_0x3833a8['commands']['add']('showAIAssistant',_0x5e6ccb),_0x3833a8['ui']['componentFactory']['add']('aiCommands',_0x57257f=>{const _0x10c823=Gt(_0x57257f);return _0x10c823['set']({'class':'ck-ai-commands-dropdown\x20'+this['_uiCssClasses']}),_0x10c823['buttonView']['set']({'label':ki(_0x57257f,'AI\x20Commands'),'icon':_0xc91008,'tooltip':!0x0}),_0x10c823['on']('execute',_0x916545=>this['_onExecute'](_0x916545['source']['id'])),Ft(_0x10c823,_0x3833a8['ui']['view']['body'],function(_0x1121a0){const _0x4154fc=wi(_0x1121a0['config']['get']('ai.assistant.commands'),_0x1121a0['locale']),_0x30e63e=Qi(_0x1121a0,_0x4154fc)['filter'](_0x23a2bd=>_0x23a2bd['commands']['length']);if(0x1===_0x30e63e['length'])return Qi(_0x1121a0,_0x30e63e[0x0]['commands'])['map'](_0x524f17=>({'id':_0x524f17['id'],'label':_0x524f17['label']}));return _0x30e63e['map'](_0x5701ad=>{const {groupId:_0x23583f,groupLabel:_0x44f90d,commands:_0x3688f1}=_0x5701ad,_0x329986=Qi(_0x1121a0,_0x3688f1)['map'](_0x5bea9d=>({'id':_0x5bea9d['id'],'label':_0x5bea9d['label']}));return{'id':_0x23583f,'menu':_0x44f90d||_0x23583f,'children':_0x329986};});}(_0x3833a8),{'ariaLabel':ki(_0x57257f,'AI\x20Commands')}),_0x10c823['menuView']['menuPanelClass']='ck-ai-commands-dropdown\x20'+this['_uiCssClasses'],_0x5e6ccb['on']('change:enabledCommandsIds',_0x579968),_0x10c823['menuView']['once']('render',_0x579968),_0x10c823;function _0x579968(){_0x10c823['isEnabled']=_0x5e6ccb['enabledCommandsIds']['length']>0x0;for(const _0x53af64 of _0x10c823['menuView']['buttons'])_0x53af64['isEnabled']=_0x5e6ccb['enabledCommandsIds']['includes'](_0x53af64['id']);}}),_0x3833a8['ui']['componentFactory']['add']('menuBar:aiCommands',_0x74038a=>{const _0x29e138=new Kt(_0x74038a);_0x29e138['buttonView']['set']({'label':ki(_0x74038a,'AI\x20Commands'),'icon':_0xc91008}),_0x29e138['bind']('isEnabled')['to'](_0x5e6ccb,'enabledCommandsIds',_0x374c6d=>_0x374c6d['length']>0x0);const _0x565e1f=wi(_0x3833a8['config']['get']('ai.assistant.commands'),_0x74038a);return this['_populateMenuBarMenu'](_0x5e6ccb,_0x29e138,_0x565e1f,_0x1ab523=>this['_onExecute'](_0x1ab523)),_0x29e138;}),_0x3833a8['ui']['componentFactory']['add']('aiAssistant',()=>{const _0x2e0c64=this['_createAIAssistantUIButton'](Nt);return _0x2e0c64['set']({'tooltip':!0x0,'class':'ck-ai-assistant-button\x20'+this['_uiCssClasses']}),_0x2e0c64;}),_0x3833a8['ui']['componentFactory']['add']('menuBar:aiAssistant',()=>{const _0x3e1b43=this['_createAIAssistantUIButton'](Wt);return _0x3e1b43['set']({'role':'menuitemcheckbox'}),_0x3e1b43;}),this['licenseKey']=this['editor']['config']['get']('licenseKey');const _0xa1c330=this['editor'];this['_licenseKeyCheckInterval']=setInterval(()=>{let _0x5c8b35;for(const _0x8cd596 in _0xa1c330){const _0x574506=_0x8cd596,_0x3de5f9=_0xa1c330[_0x574506];if('aiLicenseKeyValid'==_0x3de5f9||'aiLicenseKeyInvalid'==_0x3de5f9||'aiLicenseKeyExpired'==_0x3de5f9||'aiLicenseKeyDomainLimit'==_0x3de5f9||'aiLicenseKeyNotAllowed'==_0x3de5f9||'aiLicenseKeyEvaluationLimit'==_0x3de5f9||'aiLicenseKeyUsageLimit'==_0x3de5f9){delete _0xa1c330[_0x574506],_0x5c8b35=_0x3de5f9,clearInterval(this['_licenseKeyCheckInterval']),this['_licenseKeyCheckInterval']=void 0x0;break;}}'aiLicenseKeyInvalid'==_0x5c8b35&&_0xa1c330['_showLicenseError']('invalid'),'aiLicenseKeyExpired'==_0x5c8b35&&_0xa1c330['_showLicenseError']('expired'),'aiLicenseKeyDomainLimit'==_0x5c8b35&&_0xa1c330['_showLicenseError']('domainLimit'),'aiLicenseKeyNotAllowed'==_0x5c8b35&&_0xa1c330['_showLicenseError']('featureNotAllowed','AIAssistant'),'aiLicenseKeyEvaluationLimit'==_0x5c8b35&&_0xa1c330['_showLicenseError']('evaluationLimit'),'aiLicenseKeyUsageLimit'==_0x5c8b35&&_0xa1c330['_showLicenseError']('usageLimit');},0x3e8);}['destroy'](){super['destroy'](),this['_licenseKeyCheckInterval']&&clearInterval(this['_licenseKeyCheckInterval']);}['showUI'](_0x39f523='',_0x499448='',_0x334ed0='custom'){const _0x10538d=this['editor'],_0x369c0b=_0x10538d['editing']['view'],_0x1839b2=_0x10538d['plugins']['get'](Si),_0x555472=_0x10538d['plugins']['get'](_0xf8e7c);_0x1839b2['showFakeVisualSelection']();const _0x1f2986=new Yi(),_0x1f7b55=new ClipboardEvent('copy',{'clipboardData':_0x1f2986}),_0x1f5d5e=new _0x35d75f(_0x1f2986),_0x770ce1=new _0x268957(_0x369c0b,_0x1f7b55,{'dataTransfer':_0x1f5d5e});_0x555472['_forceMarkersCopy']('comment',()=>{_0x369c0b['document']['fire']('copy',_0x770ce1);}),this['_formView']||(this['_initView'](),this['_aiAssistantController']=new xi(_0x10538d,this['_aiAdapter']['textAdapter'],this['_formView']));let _0x4105c2=_0x1f5d5e['getData']('text/html');const _0x202fa8=_0x10538d['model']['document']['selection'],_0x117815=Array['from'](_0x202fa8['getRanges']());0x1===_0x117815['length']&&_0x117815[0x0]['isFlat']&&!_0x202fa8['getSelectedElement']()&&''!==_0x4105c2['replace'](/ /g,'')['trim']()&&(_0x4105c2='<p>'+_0x4105c2+'</p>'),this['_aiAssistantController']['updateView']({'actionId':_0x334ed0,'query':_0x39f523,'htmlContent':_0x4105c2,'label':_0x499448,'mainActionLabel':Li[_0x10538d['model']['document']['selection']['isCollapsed']?'INSERT':'REPLACE']}),'aiAssistant'!==this['_dialog']['id']?this['_dialog']['show']({'id':'aiAssistant','icon':_0x552044,'title':ki(this['editor']['locale'],'AI\x20Assistant'),'content':this['_formView'],'position':Yt['EDITOR_TOP_SIDE'],'onShow':()=>{this['_formView']['focus']();},'onHide':()=>{this['_aiAssistantController']['reset'](),_0x1839b2['hideFakeVisualSelection']();}}):this['_dialog']['view']['wasMoved']||this['_dialog']['view']['updatePosition']();}['hideUI'](){this['_dialog']['hide']();}['_getResolvedCommandsDefinitions'](){const _0x19fe27=new Map(),_0x492734=wi(this['editor']['config']['get']('ai.assistant.commands'),this['editor']['locale']);for(const _0x1b8baa of _0x492734)for(const _0x56cf1d of _0x1b8baa['commands'])_0x19fe27['set'](_0x56cf1d['id'],{..._0x56cf1d,'groupId':_0x1b8baa['groupId'],'groupLabel':_0x1b8baa['groupLabel']||_0x1b8baa['groupId']});return _0x19fe27;}['_createAIAssistantUIButton'](_0x57d68c){const _0x1a45b2=this['editor'],_0x52a763=_0x1a45b2['commands']['get']('showAIAssistant'),_0x19d215=new _0x57d68c(_0x1a45b2['locale']);return _0x19d215['set']({'label':ki(_0x1a45b2['locale'],'AI\x20Assistant'),'icon':_0x552044,'isToggleable':!0x0}),_0x19d215['bind']('isEnabled')['to'](_0x52a763),_0x19d215['bind']('isOn')['to'](this['_dialog'],'id',_0x5d6171=>'aiAssistant'===_0x5d6171),this['listenTo'](_0x19d215,'execute',()=>{_0x19d215['isOn']?this['hideUI']():_0x52a763['execute']();}),_0x19d215;}['_initView'](){const _0x25e4e9=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',()=>{_0x25e4e9['insertContent'](this['_aiAssistantController']['currentContext']),this['hideUI']();}),this['listenTo'](this['_formView'],'insertContentBelow',()=>{_0x25e4e9['insertContentBelow'](this['_aiAssistantController']['currentContext']),this['hideUI']();}),this['_initAriaAiStatusChangeAnnouncements']();}['_initAriaAiStatusChangeAnnouncements'](){const {locale:_0x5ea1ee,ui:{ariaLiveAnnouncer:_0x123881}}=this['editor'];this['_formView']['contentArea']['on']('change:isProcessing',(_0x56d618,_0x3bbeff,_0x20ca91)=>{const _0x595d83=this['_aiAssistantController']['currentContext'];_0x20ca91?_0x123881['announce'](ki(_0x5ea1ee,'AI\x20is\x20writing')):_0x595d83&&_0x123881['announce'](ki(_0x5ea1ee,'Generated\x20content:\x20%0',_0x595d83),{'politeness':'polite','isUnsafeHTML':!0x0});}),this['_formView']['on']('change:isError',(_0x691c01,_0x5a307e,_0x560d41)=>{if(_0x560d41){const _0x2cc2a0=this['_formView']['errorView']['text'];_0x123881['announce'](ki(_0x5ea1ee,'Error\x20during\x20AI\x20content\x20generation:\x20%0',_0x2cc2a0));}});}['_onExecute'](_0x340562){const _0x25569a=this['_commandDefinitions']['get'](_0x340562),_0x4f79bc=this['editor'],_0x20778=_0x4f79bc['model']['document']['selection'],_0x51e01d=_0x4f79bc['commands']['get']('showAIAssistant'),_0x4fd7a8=_0x4f79bc['plugins']['get'](Si),_0x54b084=''+(_0x25569a['groupId']!==Ci?_0x25569a['groupLabel']+':\x20':'')+_0x25569a['label'];if(!0x1!==_0x25569a['requiresContent']&&_0x20778['isCollapsed']){const _0x1c9e1a=At(_0x20778['getSelectedBlocks']())||_0x4f79bc['model']['schema']['getLimitElement'](_0x20778);_0x4f79bc['model']['change'](_0x32f8c5=>{_0x32f8c5['setSelection'](_0x1c9e1a,'in');});}_0x4fd7a8['showFakeVisualSelection'](),_0x51e01d['execute'](_0x25569a['prompt'],_0x54b084,'command:'+_0x340562);}['_populateMenuBarMenu'](_0x3f7bf8,_0xd64b16,_0x361bee,_0x48b036){const _0x25426a=this['editor'],_0x5bed49=_0x25426a['locale'],_0x4f7bdd=new $t(_0x5bed49),_0x21e89b=Qi(_0x25426a,_0x361bee)['filter'](_0xecce7f=>_0xecce7f['commands']['length']);0x1===_0x21e89b['length']?this['_getMenuBarGroupButtons']({'command':_0x3f7bf8,'commands':_0x21e89b[0x0]['commands'],'parentMenuView':_0xd64b16,'onExecute':_0x48b036})['forEach'](_0x30376d=>_0x4f7bdd['items']['add'](_0x30376d)):_0x21e89b['forEach'](({groupId:_0x1e6c0d,groupLabel:_0x4dafaa,commands:_0x20afca})=>{const _0x59a618=new qt(_0x5bed49,_0xd64b16),_0x4454f2=new Kt(_0x5bed49),_0x19b609=new $t(_0x5bed49),_0xbcf62b=this['_getMenuBarGroupButtons']({'command':_0x3f7bf8,'commands':_0x20afca,'parentMenuView':_0x4454f2,'onExecute':_0x48b036});_0x4454f2['buttonView']['set']({'label':_0x4dafaa||_0x1e6c0d}),_0x4454f2['delegate']('execute')['to'](_0xd64b16),_0x19b609['items']['addMany'](_0xbcf62b),_0x4454f2['panelView']['children']['add'](_0x19b609),_0x59a618['children']['add'](_0x4454f2),_0x4f7bdd['items']['add'](_0x59a618);}),_0xd64b16['panelView']['children']['add'](_0x4f7bdd);}['_getMenuBarGroupButtons']({command:_0x1c135f,commands:_0x23fd52,parentMenuView:_0x1eb3a8,onExecute:_0x412ed7}){const _0x168fbb=this['editor'],_0x2acd1b=_0x168fbb['locale'];return Qi(_0x168fbb,_0x23fd52)['map'](_0x5671f1=>{const _0x1306ec=new qt(_0x2acd1b,_0x1eb3a8),_0x4b7b71=new Wt(_0x2acd1b);return _0x4b7b71['set']({'label':_0x5671f1['label']}),_0x4b7b71['delegate']('execute')['to'](_0x1eb3a8),_0x4b7b71['on']('execute',()=>_0x412ed7(_0x5671f1['id'])),_0x4b7b71['bind']('isEnabled')['to'](_0x1c135f,'enabledCommandsIds',_0x17b1b3=>_0x17b1b3['includes'](_0x5671f1['id'])),_0x1306ec['children']['add'](_0x4b7b71),_0x1306ec;});}}function qi(_0x1c4463,_0x46f3c3){return void 0x0!==_0x1c4463['order']&&void 0x0===_0x46f3c3['order']?0x1:void 0x0===_0x1c4463['order']&&void 0x0!==_0x46f3c3['order']?-0x1:void 0x0!==_0x1c4463['order']&&void 0x0!==_0x46f3c3['order']?_0x1c4463['order']-_0x46f3c3['order']:0x0;}function Qi(_0x13daf3,_0x4d6159){_0x4d6159['sort'](qi);const _0x29087d={},_0x5eda2e=[];for(const _0x17861c of _0x4d6159)if(void 0x0!==_0x17861c['order']){if(_0x17861c['order']in _0x29087d)throw new at('ai-commands-config-order-collision',_0x13daf3,{'conflictingDefinitions':[_0x17861c,_0x29087d[_0x17861c['order']]]});_0x29087d[_0x17861c['order']]=_0x17861c,_0x5eda2e['splice'](_0x17861c['order'],0x0,_0x17861c);}else _0x5eda2e['push'](_0x17861c);return _0x5eda2e;}class Xi extends _0x4f5a67{static get['requires'](){return[$i,Si];}static get['pluginName'](){return'AIAssistant';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0xe21278){super(_0xe21278);const _0x185dde=_0xe21278['config'],_0x1ac304=_0xe21278['locale'];_0x185dde['define']('ai.assistant.preserveComments',!0x0),_0x185dde['define']('ai.assistant.commands',zi(_0x1ac304)),_0x185dde['define']('ai.assistant.extraCommandGroups',[]),_0x185dde['define']('ai.assistant.removeCommands',[]);let _0x43ddff=wi(_0x185dde['get']('ai.assistant.commands'),_0x1ac304);const _0x20fbcb=_0x185dde['get']('ai.assistant.extraCommandGroups'),_0x4b072c=_0x185dde['get']('ai.assistant.removeCommands');_0x20fbcb['forEach'](_0xee4be6=>{const _0x5c819d=_0x43ddff['find'](_0x2b6d10=>_0x2b6d10['groupId']===_0xee4be6['groupId']);_0x5c819d?_0x5c819d['commands']=_0x5c819d['commands']['concat'](_0xee4be6['commands']):_0x43ddff['push'](_0xee4be6);}),_0x43ddff=_0x43ddff['filter'](_0x3ebd21=>!_0x4b072c['includes'](_0x3ebd21['groupId'])),_0x43ddff['forEach'](_0x553131=>{_0x553131['commands']=_0x553131['commands']['filter'](_0x4773ff=>!_0x4b072c['includes'](_0x4773ff['id']));}),_0x185dde['set']('ai.assistant.commands',_0x43ddff);}}function zi(_0x5e361d){return[{'groupId':'editOrReview','groupLabel':ki(_0x5e361d,'Edit\x20or\x20review'),'commands':[{'id':'improveWriting','label':ki(_0x5e361d,'Improve\x20writing'),'prompt':'Fix\x20spelling\x20mistakes,\x20use\x20proper\x20grammar\x20and\x20apply\x20good\x20writing\x20practices.\x20Do\x20not\x20lose\x20the\x20original\x20meaning.'},{'id':'makeShorter','label':ki(_0x5e361d,'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(_0x5e361d,'Make\x20longer'),'prompt':'Improve\x20this\x20content\x20by\x20using\x20descriptive\x20language\x20and\x20inserting\x20more\x20information\x20and\x20more\x20detailed\x20explanations.'},{'id':'simplifyLanguage','label':ki(_0x5e361d,'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(_0x5e361d,'Generate\x20from\x20selection'),'commands':[{'id':'summarize','label':ki(_0x5e361d,'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(_0x5e361d,'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(_0x5e361d,'Change\x20tone'),'commands':[{'id':'professional','label':ki(_0x5e361d,'Professional'),'prompt':'Improve\x20using\x20polished,\x20formal,\x20and\x20respectful\x20language\x20to\x20convey\x20professional\x20expertise\x20and\x20competence.'},{'id':'casual','label':ki(_0x5e361d,'Casual'),'prompt':'Improve\x20using\x20casual,\x20informal\x20language\x20to\x20convey\x20a\x20casual\x20conversation\x20with\x20a\x20real\x20person.'},{'id':'direct','label':ki(_0x5e361d,'Direct'),'prompt':'Improve\x20using\x20direct\x20language,\x20using\x20only\x20the\x20essential\x20information.'},{'id':'confident','label':ki(_0x5e361d,'Confident'),'prompt':'Improve\x20using\x20compelling,\x20optimistic\x20language\x20to\x20convey\x20confidence\x20in\x20the\x20writing.'},{'id':'friendly','label':ki(_0x5e361d,'Friendly'),'prompt':'Improve\x20using\x20friendly,\x20comforting\x20language,\x20to\x20convey\x20understanding\x20and\x20empathy.'}]},{'groupId':'changeStyle','groupLabel':ki(_0x5e361d,'Change\x20style'),'commands':[{'id':'business','label':ki(_0x5e361d,'Business'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20business\x20professional\x20with\x20formal\x20language.'},{'id':'legal','label':ki(_0x5e361d,'Legal'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20legal\x20professional\x20using\x20valid\x20legal\x20terminology.'},{'id':'journalism','label':ki(_0x5e361d,'Journalism'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20journalist\x20using\x20engaging\x20language\x20to\x20convey\x20the\x20importance\x20of\x20the\x20information.'},{'id':'poetic','label':ki(_0x5e361d,'Poetic'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20poem\x20using\x20poetic\x20techniques\x20without\x20losing\x20the\x20original\x20meaning.'}]},{'groupId':'translate','groupLabel':ki(_0x5e361d,'Translate'),'commands':[{'id':'translateEnglish','label':ki(_0x5e361d,'English'),'prompt':'Translate\x20the\x20content\x20to\x20English\x20language.'},{'id':'translateSpanish','label':ki(_0x5e361d,'Spanish'),'prompt':'Translate\x20the\x20content\x20to\x20Spanish\x20language.'},{'id':'translatePortuguese','label':ki(_0x5e361d,'Portuguese'),'prompt':'Translate\x20the\x20content\x20to\x20Portuguese\x20language.'},{'id':'translateGerman','label':ki(_0x5e361d,'German'),'prompt':'Translate\x20the\x20content\x20to\x20German\x20language.'},{'id':'translateFrench','label':ki(_0x5e361d,'French'),'prompt':'Translate\x20the\x20content\x20to\x20French\x20language.'},{'id':'translateChinese','label':ki(_0x5e361d,'Simplified\x20Chinese'),'prompt':'Translate\x20the\x20content\x20to\x20Simplified\x20Chinese\x20language.'},{'id':'translateHindi','label':ki(_0x5e361d,'Hindi'),'prompt':'Translate\x20the\x20content\x20to\x20Hindi\x20language.'},{'id':'translateArabic','label':ki(_0x5e361d,'Arabic'),'prompt':'Translate\x20the\x20content\x20to\x20Arabic\x20language.'}]}];}class ji extends _0x4f5a67{['abortController'];static get['requires'](){return[Ri];}constructor(_0x3d6308){super(_0x3d6308),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'](_0x4297fa){return this['sendRequest'](_0x4297fa)['catch'](_0x49d313=>{if(_0x49d313 instanceof Oi)return Promise['reject'](_0x49d313);if('AbortError'==_0x49d313['name'])return Promise['resolve']();throw console['error'](_0x49d313),new at('aitextadapter-send-request-failed',null);});}async['_prepareRequestHeaders'](_0x272973,_0x5c160c){const _0x85be36=this['editor']['locale'],_0xe07dc8={'Content-Type':'application/json'};if('object'==typeof _0x272973)Object['assign'](_0xe07dc8,_0x272973);else{if(_0x272973)try{const _0x1c0920=await _0x272973(_0x5c160c);Object['assign'](_0xe07dc8,_0x1c0920);}catch{return Promise['reject'](new Oi(ki(_0x85be36,'AI_ERROR_GET_HEADERS')));}}return _0xe07dc8;}async['_prepareRequestParameters'](_0x554bbe,_0x33166d){const _0x5be625=this['editor']['locale'];if('object'==typeof _0x554bbe)return _0x554bbe;try{return await _0x554bbe(_0x33166d);}catch{return Promise['reject'](new Oi(ki(_0x5be625,'AI_ERROR_GET_PARAMETERS')));}}}class Ji extends ji{['_apiUrl'];['_requestHeaders'];['_requestParameters'];static get['pluginName'](){return'OpenAITextAdapter';}constructor(_0xfbad08){super(_0xfbad08),_0xfbad08['config']['define']('ai.assistant.adapter.openAI.apiUrl','https://api.openai.com/v1/chat/completions'),_0xfbad08['config']['get']('ai.assistant.adapter.openAI.requestParameters')||_0xfbad08['config']['define']('ai.assistant.adapter.openAI.requestParameters',{'model':'gpt-4o','temperature':0x1,'top_p':0x1,'stream':!0x0}),this['_apiUrl']=_0xfbad08['config']['get']('ai.assistant.adapter.openAI.apiUrl'),this['_requestHeaders']=_0xfbad08['config']['get']('ai.assistant.adapter.openAI.requestHeaders')||{},this['_requestParameters']=_0xfbad08['config']['get']('ai.assistant.adapter.openAI.requestParameters');}async['sendRequest']({query:_0x1b3e3e,context:_0x5c9b35,onData:_0x6544c7,actionId:_0x5dc69f}){const _0x11a5a1=this['editor']['locale'],_0x3d5376=await this['prepareMessages'](_0x1b3e3e,_0x5c9b35,_0x5dc69f),_0x49a731=await this['_prepareRequestHeaders'](this['_requestHeaders'],_0x5dc69f),_0x4e9dcd=await this['_prepareRequestParameters'](this['_requestParameters'],_0x5dc69f),_0x48bf5f={'messages':_0x3d5376,..._0x4e9dcd},_0x5b55c5={'method':'POST','headers':_0x49a731,'body':JSON['stringify'](_0x48bf5f),'signal':this['abortController']['signal']},_0x49f19e=await fetch(this['_apiUrl'],_0x5b55c5);if(_0x49f19e['ok'])return _0x4e9dcd['stream']?await this['_readStreamableResponse'](_0x49f19e,_0x6544c7):await this['_readStaticResponse'](_0x49f19e,_0x6544c7),Promise['resolve']();{const _0x1616dd=await _0x49f19e['text']();return _0x1616dd['includes']('context_length_exceeded')?Promise['reject'](new Oi(ki(_0x11a5a1,'AI_ERROR_CONTEXT_LENGTH'))):_0x1616dd['includes']('Moderation')?Promise['reject'](new Oi(ki(_0x11a5a1,'AI_ERROR_MODERATION'))):Promise['reject'](new Error(_0x1616dd));}}async['prepareMessages'](_0x36e23e,_0x452868,_0x3b7353){let _0x59c488,_0x4cc1df;return _0x452868?(_0x59c488='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.',_0x4cc1df='Instruction:\x0a'+_0x36e23e+'\x0aYou\x20must\x20keep\x20the\x20text\x20formatting.\x0a\x0aContent:\x0a'+_0x452868):(_0x59c488='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.',_0x4cc1df=_0x36e23e),[{'role':'system','content':_0x59c488},{'role':'user','content':_0x4cc1df}];}async['_readStreamableResponse'](_0x194aa8,_0x5b71ce){const _0x1a4ac7=_0x194aa8['body']['getReader'](),_0xbea5a1=new TextDecoder();let _0x2cc4d4='',_0x4bce4d='',_0x534b17='',_0x57163e=!0x1;for(;!_0x57163e;){const {done:_0x133bbc,value:_0x518c0f}=await _0x1a4ac7['read'](),_0x34b05a=_0x2cc4d4+_0xbea5a1['decode'](_0x518c0f);let _0x1bba27='';_0x57163e=_0x133bbc;try{_0x1bba27=this['_cleanUpData'](_0x34b05a),_0x2cc4d4='';}catch{_0x2cc4d4=_0x34b05a;continue;}_0x4bce4d+=_0x1bba27,!_0x57163e&&this['_isBufferIncomplete'](_0x4bce4d)||_0x4bce4d&&(_0x534b17+=_0x4bce4d,_0x4bce4d='',_0x5b71ce(_0x534b17));}return Promise['resolve']();}async['_readStaticResponse'](_0x4030b6,_0x5a42a7){return _0x5a42a7((await _0x4030b6['json']())['choices'][0x0]['message']['content']),Promise['resolve']();}['_isBufferIncomplete'](_0x58ca34){const _0x50e57d=_0x58ca34['split']('<')['length']!==_0x58ca34['split']('>')['length'],_0x9f976a=_0x58ca34['length']<0x1e;return _0x50e57d&&_0x9f976a;}['_cleanUpData'](_0x11f843){return _0x11f843['split'](/\n(?![^{]*\})/g)['map'](_0x18b50a=>_0x18b50a['replace']('data:\x20',''))['filter'](_0x198b1e=>_0x198b1e&&_0x198b1e['length']>0x0&&'[DONE]'!==_0x198b1e)['map'](_0x57e2ab=>{const {choices:_0x1a3fa8}=JSON['parse'](_0x57e2ab);if(_0x1a3fa8[0x0]?.['delta']?.['content'])return _0x1a3fa8[0x0]['delta']['content'];})['filter'](_0x4cbcd5=>_0x4cbcd5)['join']('');}}class Zi extends ji{static get['pluginName'](){return'AWSTextAdapter';}['init'](){super['init'](),It('ai-aws-adapter-not-supported');}async['sendRequest'](_0x1e1aa3){throw Et('ai-aws-adapter-not-supported'),new Oi(ki(this['editor']['locale'],'AI_ERROR_AWS_NOT_SUPPORTED'));}}class ts extends Nt{constructor(_0x14f6a7,_0xfa9c6a={}){super(_0x14f6a7),this['isToggleable']=!0x0,this['set']('side',_0xfa9c6a['side']||'top');const _0x2f9d8f=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':['ck-tab-button',...pt(_0xfa9c6a['class']||[]),_0x2f9d8f['to']('side',_0x142e85=>'ck-tab-button_'+_0x142e85),_0x2f9d8f['to']('class')]}});}['show'](){this['set']('isVisible',!0x0);}['hide'](){this['set']('isVisible',!0x1);}}class es extends vt{['children'];constructor(_0x4b7edc,_0x47d2cc={}){super(_0x4b7edc);const _0x45c66f=this['bindTemplate'];this['set']('isVisible',!0x1),this['set']('class',''),this['children']=this['createCollection'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-tab-panel',...pt(_0x47d2cc['class']||[]),_0x45c66f['to']('class'),_0x45c66f['if']('isVisible','ck-hidden',_0x1ecc34=>!_0x1ecc34)]},'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(_0x5acbd5,_0x5f532f={}){super(_0x5acbd5),this['set']('class',void 0x0),this['set']('activeTab',null),this['set']('side',_0x5f532f['side']||'top'),this['set']('isMaximized',!0x1),this['set']('collapsible',_0x5f532f['collapsible']||!0x1),this['set']('_isMaximizedActive',!0x1),this['bind']('_isMaximizedActive')['to'](this,'isMaximized',this,'activeTab',(_0x283e57,_0x156ac2)=>_0x283e57&&null!==_0x156ac2);const _0x161680=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset','ck-tabs',...pt(_0x5f532f['class']||[]),_0x161680['to']('side',_0x5a02d1=>'ck-tabs_'+_0x5a02d1),_0x161680['to']('class'),_0x161680['if']('_isMaximizedActive','ck-ai-tabs_maximized'),_0x161680['to']('activeTab',_0x48e044=>null===_0x48e044?'ck-ai-tabs_collapsed':'')],'tabindex':'0'},'children':[{'tag':'div','attributes':{'class':['ck','ck-tabs__buttons-container',_0x161680['to']('side',_0x1dd30c=>'ck-tabs__buttons-container_'+_0x1dd30c)]},'children':this['buttonViews']},{'tag':'div','attributes':{'class':['ck','ck-tabs__panels-container',_0x161680['to']('side',_0x7b5213=>'ck-tabs__panels-container_'+_0x7b5213)]},'children':this['panelViews']},...pt(_0x5f532f['children']||[])]});}['getTabIds'](){return[...this['_tabs']['keys']()];}['getTab'](_0x418179){const _0x2533a8=this['_tabs']['get'](_0x418179);return _0x2533a8||null;}['addTab'](_0x51c63c){const _0x2dccd6=this['_setupButton']({'id':_0x51c63c['id'],'label':_0x51c63c['buttonLabel'],'icon':_0x51c63c['buttonIcon'],'order':_0x51c63c['order']}),_0x54b3d3=new es(this['locale']);return _0x54b3d3['render'](),_0x51c63c['content']&&_0x54b3d3['children']['add'](_0x51c63c['content']),this['panelViews']['add'](_0x54b3d3),this['_tabs']['set'](_0x51c63c['id'],{'button':_0x2dccd6,'panel':_0x54b3d3,'order':void 0x0!==_0x51c63c['order']?_0x51c63c['order']:null}),this['fire']('addTab:'+_0x51c63c['id'],{'id':_0x51c63c['id'],'button':_0x2dccd6,'panel':_0x54b3d3}),null===this['activeTab']?this['activateTab'](_0x51c63c['id']):this['_hidePanel'](_0x51c63c['id']),{'button':_0x2dccd6,'panel':_0x54b3d3};}['activateTab'](_0x41f846){if(null!==_0x41f846&&!this['getTab'](_0x41f846))throw new at('ui-tabsview-tab-not-found',{'tabs':this,'tabId':_0x41f846});if(this['activeTab']===_0x41f846)return;const _0x2bc9de=this['activeTab'];this['activeTab']&&this['_hidePanel'](this['activeTab']),this['activeTab']=_0x41f846,_0x41f846&&this['_showPanel'](_0x41f846),this['fire']('activateTab:'+_0x41f846,{'newTab':_0x41f846,'oldTab':_0x2bc9de});}['toggleTabPanel'](_0x27ecfe){if(!this['getTab'](_0x27ecfe))throw new at('ui-tabsview-tab-not-found',{'tabs':this,'tabId':_0x27ecfe});this['activeTab']===_0x27ecfe?this['collapsible']&&(this['activeTab']=null):this['activateTab'](_0x27ecfe);}['showTab'](_0x1654f8){if(!this['getTab'](_0x1654f8))throw new at('ui-tabsview-tab-not-found',{'tabs':this,'tabId':_0x1654f8});this['_showPanel'](_0x1654f8),this['_showButton'](_0x1654f8),this['fire']('show:'+_0x1654f8,_0x1654f8);}['hideTab'](_0x5c8975){if(!this['getTab'](_0x5c8975))throw new at('ui-tabsview-tab-not-found',{'tabs':this,'tabId':_0x5c8975});const _0x57efb7=this['activeTab'];this['_hidePanel'](_0x5c8975),this['_hideButton'](_0x5c8975);const _0x1d8329=this['getTabIds']();_0x57efb7===_0x5c8975&&_0x1d8329['length']>0x1&&this['activateTab'](_0x1d8329['find'](_0x2c0080=>_0x2c0080!==_0x5c8975)),this['fire']('hide:'+_0x5c8975,_0x5c8975);}['_getPanel'](_0x548bc5){const _0xcf60=this['_tabs']['get'](_0x548bc5);return _0xcf60?_0xcf60['panel']:null;}['_showPanel'](_0x4116b0){null!==this['activeTab']&&this['activeTab']!==_0x4116b0||this['_getPanel'](_0x4116b0)['show']();}['_hidePanel'](_0x6a19c6){const _0x363b5d=this['_getPanel'](_0x6a19c6);_0x363b5d['isVisible']&&(this['activeTab']===_0x6a19c6&&(this['activeTab']=null),_0x363b5d['hide']());}['_getButton'](_0x4b4d9f){const _0x1b139f=this['_tabs']['get'](_0x4b4d9f);return _0x1b139f?_0x1b139f['button']:null;}['_showButton'](_0x4bc0e1){this['_getButton'](_0x4bc0e1)['show']();}['_hideButton'](_0x5595ce){this['_getButton'](_0x5595ce)['hide']();}['_setupButton'](_0x511ce4){const _0x40a9e2=new ts(this['locale'],{'side':this['side']}),_0xb24f81=this['buttonViews'];if(_0x40a9e2['set']({'label':_0x511ce4['label'],'icon':_0x511ce4['icon'],'tooltip':!0x0,'withText':!0x0}),_0x40a9e2['bind']('isOn')['to'](this,'activeTab',_0xc8f821=>_0xc8f821===_0x511ce4['id']),_0x40a9e2['bind']('side')['to'](this,'side'),_0x511ce4['order']){const _0x3b5312=[...this['_tabs']]['reduce']((_0x41c05d,_0x3bf427)=>{const _0x34a1ba=_0x3bf427[0x0],{order:_0x5bb17f}=_0x3bf427[0x1];return!_0x5bb17f||_0x5bb17f>_0x511ce4['order']?_0x41c05d:_0x5bb17f>=_0x41c05d['order']?{'id':_0x34a1ba,'order':_0x5bb17f}:_0x41c05d;},{'id':'','order':0x0}),_0xa0019e=_0xb24f81['getIndex'](this['_getButton'](_0x3b5312['id']));_0xb24f81['add'](_0x40a9e2,_0xa0019e+0x1);}else _0xb24f81['add'](_0x40a9e2);return _0x40a9e2['on']('execute',()=>{this['toggleTabPanel'](_0x511ce4['id']);}),_0x40a9e2;}}const ss=['overlay','sidebar','custom'],ns=['left','right'];class rs extends is{constructor(_0x1c180f,_0x296bd8={}){super(_0x1c180f,_0x296bd8),this['set']('type',_0x296bd8['type']||'sidebar'),this['set']('side',_0x296bd8['side']||'right'),this['set']('isVisible',_0x296bd8['visibleByDefault']??!0x0);const _0x4fa782=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':['ck-ai-tabs',_0x4fa782['if']('type','ck-ai-tabs__overlay',_0x5a60b5=>'overlay'===_0x5a60b5),_0x4fa782['if']('type','ck-ai-tabs__sidebar',_0x47493f=>'sidebar'===_0x47493f),_0x4fa782['if']('isVisible','ck-hidden',_0x10fbc9=>!_0x10fbc9)]}}),this['buttonViews']['on']('add',(_0x3f68fd,_0x4b6b44)=>{_0x4b6b44['set']('withText',!0x1);});}}class os extends _0x29a024{['view'];['container']=null;['showResizeButton']=!0x0;static get['pluginName'](){return'AITabs';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x3fe6c1){if(super(_0x3fe6c1),!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 _0x9de0ef=this['context']['config']['get']('ai.container');if(this['set']('side','right'),void 0x0!==_0x9de0ef['showResizeButton']&&(this['showResizeButton']=_0x9de0ef['showResizeButton']),'sidebar'!==_0x9de0ef['type']&&'overlay'!==_0x9de0ef['type']||_0x9de0ef['side']&&(this['side']=_0x9de0ef['side']),'sidebar'===_0x9de0ef['type']){if(this['container']=_0x9de0ef['element'],this['set']('type','sidebar'),!this['container'])throw new at('ai-tabs-sidebar-container-element-not-found');}else'overlay'===_0x9de0ef['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':_0x9de0ef['visibleByDefault'],'collapsible':_0x9de0ef['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 _0x1c72cb&&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'](_0x1a5d04){if(_0x1a5d04&&this['type']!==_0x1a5d04){if(!ss['includes'](_0x1a5d04))throw new at('ai-tabs-unsupported-ui-type');this['type']=_0x1a5d04;}}['switchSide'](_0x47d1e2){if(_0x47d1e2&&this['side']!==_0x47d1e2){if(!ns['includes'](_0x47d1e2))throw new at('ai-tabs-unsupported-ui-side');this['side']=_0x47d1e2;}}['destroy'](){super['destroy'](),this['view']['destroy'](),this['view']['element']&&this['view']['element']['remove']();}}class as extends _0x29a024{['_apiUrl'];['_token'];['_decoder'];['_responseCache'];static get['requires'](){return[_0x1c01ce];}static get['pluginName'](){return'AIConnector';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x134f4c){super(_0x134f4c),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 _0x5f1dd7=this['context']['plugins']['get'](_0x1c01ce);if(!_0x5f1dd7['token'])throw new at('ai-missing-token',this);this['_token']=_0x5f1dd7['token'];}['startConversation'](_0x48849,_0x3a499e){const _0x4c3994=this['_sendApiRequest']('/conversations','POST',{'id':_0x48849,'group':_0x3a499e});return{'getConversation':async()=>(await _0x4c3994['request'])['json'](),'abortController':_0x4c3994['abortController']};}['queryAssistant']({message:_0x105ff9,conversationId:_0x5af469,parts:_0x47ade3,capabilities:_0x4d5079,model:_0x5a7cc7,attributes:_0x382aa3}){const _0x3d25bf={'prompt':_0x105ff9,'content':_0x47ade3,'model':_0x5a7cc7,..._0x4d5079&&{'capabilities':_0x4d5079},..._0x382aa3&&{'attributes':_0x382aa3}},_0x4e450a=this['_sendApiRequest']('/conversations/'+_0x5af469+'/messages','POST',_0x3d25bf);return{'getStream':async()=>{const _0x154586=(await _0x4e450a['request'])['body'];return this['_getStreamReader'](_0x154586);},'abortController':_0x4e450a['abortController']};}['executeCustomAction']({content:_0x43a12f,message:_0x4168c8,model:_0x183022,outputFormat:_0x52f992}){const _0x50f1a6={'content':[{'type':'text','content':_0x43a12f}],'prompt':_0x4168c8,'model':_0x183022,'outputFormat':_0x52f992},_0x133745=this['_sendApiRequest']('/actions/custom/calls','POST',_0x50f1a6);return{'getStream':async()=>{const _0xbf07c8=(await _0x133745['request'])['body'];return this['_getStreamReader'](_0xbf07c8);},'abortController':_0x133745['abortController']};}['executeAction']({actionName:_0x37e4eb,content:_0x3b1d37,args:_0x4cc020}){const _0x4fe1b8={'content':[{'type':'text','content':_0x3b1d37}],'args':_0x4cc020},_0x370b53=this['_sendApiRequest']('/actions/system/'+_0x37e4eb+'/calls','POST',_0x4fe1b8);return{'getStream':async()=>{const _0x1c910c=(await _0x370b53['request'])['body'];return this['_getStreamReader'](_0x1c910c);},'abortController':_0x370b53['abortController']};}['uploadFile'](_0x523470,_0x5737d2,_0x4078d0){const _0x583dfb=new FormData();_0x583dfb['append']('file',_0x5737d2,_0x5737d2['name']),_0x4078d0&&_0x583dfb['append']('attributes',JSON['stringify'](_0x4078d0));const _0xd5d11d=this['_sendApiRequest']('/conversations/'+_0x523470+'/files','POST',_0x583dfb);return{'getId':async()=>(await _0xd5d11d['request'])['json'](),'abortController':_0xd5d11d['abortController']};}['fetchDocument'](_0x37df50,_0x1dab55){const _0x1a02b5=this['_sendApiRequest']('/conversations/'+_0x37df50+'/documents/'+_0x1dab55,'GET');return{'getDocument':async()=>(await _0x1a02b5['request'])['json'](),'abortController':_0x1a02b5['abortController']};}['uploadDocument'](_0x1ef10c,_0x2b9092,_0x39958f){const _0x346955={'content':_0x2b9092};_0x39958f&&(_0x346955['attributes']=_0x39958f);const _0x540b0b=this['_sendApiRequest']('/conversations/'+_0x1ef10c+'/documents','POST',_0x346955);return{'getId':async()=>(await _0x540b0b['request'])['json'](),'abortController':_0x540b0b['abortController']};}['uploadDocuments'](_0x4e8f4c,_0x2160d8){const _0x49bb57={'documents':_0x2160d8['map'](_0x2d2055=>({'content':_0x2d2055['content'],'attributes':{'version':_0x2d2055['version'],'sessionId':_0x2d2055['sessionId'],'channelId':_0x2d2055['channelId'],'rootName':_0x2d2055['rootName'],'selections':_0x2d2055['selections']},...void 0x0!==_0x2d2055['name']?{'name':_0x2d2055['name']}:{},...void 0x0!==_0x2d2055['description']?{'description':_0x2d2055['description']}:{}}))},_0x49bd12=this['_sendApiRequest']('/conversations/'+_0x4e8f4c+'/documents/batch','POST',_0x49bb57);return{'getIds':async()=>(await _0x49bd12['request'])['json'](),'abortController':_0x49bd12['abortController']};}['fetchDocuments'](_0xfab006,_0x172894){const _0x5165b1=new URLSearchParams();_0x5165b1['append']('documentIds',_0x172894['join'](','));const _0x1d4ac9=this['_sendApiRequest']('/conversations/'+_0xfab006+'/documents/batch?'+_0x5165b1['toString'](),'GET');return{'getDocuments':async()=>(await _0x1d4ac9['request'])['json'](),'abortController':_0x1d4ac9['abortController']};}['fetchConversations'](_0x5ebf24,_0x521a34={}){const _0x5b957b=new URLSearchParams();_0x5b957b['append']('group',_0x5ebf24),_0x5b957b['append']('excludeEmpty',!0x1!==_0x521a34['excludeEmpty']?'true':'false'),_0x5b957b['append']('limit',_0x521a34['limit']?_0x521a34['limit']['toString']():'100'),_0x5b957b['append']('sortBy',_0x521a34['sortBy']?_0x521a34['sortBy']:'createdAt'),_0x5b957b['append']('order',_0x521a34['order']?_0x521a34['order']:'desc');const _0x5dbbab=this['_sendApiRequest']('/conversations?'+_0x5b957b['toString'](),'GET');return{'getConversations':async()=>{const _0x379f6f=await _0x5dbbab['request'];return(await _0x379f6f['json']())['items'];},'abortController':_0x5dbbab['abortController']};}['deleteConversation'](_0xaa9578){const _0x5efe39=this['_sendApiRequest']('/conversations/'+_0xaa9578,'DELETE');return{'execute':async()=>{await _0x5efe39['request'];},'abortController':_0x5efe39['abortController']};}['updateConversation'](_0x2363e3,_0x3dad39){const _0x302d49=this['_sendApiRequest']('/conversations/'+_0x2363e3,'PATCH',_0x3dad39);return{'getResult':async()=>(await _0x302d49['request'],_0x3dad39),'abortController':_0x302d49['abortController']};}['fetchConversation'](_0x2e7643){const _0x1cf329=this['_sendApiRequest']('/conversations/'+_0x2e7643,'GET');return{'getConversation':async()=>(await _0x1cf329['request'])['json'](),'abortController':_0x1cf329['abortController']};}['fetchConversationMessages'](_0x4fff02){const _0x1b940c=this['_sendApiRequest']('/conversations/'+_0x4fff02+'/messages','GET');return{'getMessages':async()=>{const _0x38ceb1=await _0x1b940c['request'];return(await _0x38ceb1['json']())['items'];},'abortController':_0x1b940c['abortController']};}['uploadUrl'](_0x5de905,_0x41d488,_0x2bc37c){const _0x28f1d3=this['_sendApiRequest']('/conversations/'+_0x5de905+'/web-resources','POST',{'url':_0x41d488,'attributes':_0x2bc37c});return{'getId':async()=>(await _0x28f1d3['request'])['json'](),'abortController':_0x28f1d3['abortController']};}['getModels'](_0x12e54d='en'){const _0x2129fb=new URLSearchParams();_0x2129fb['append']('language',_0x12e54d);const _0x5a0e8e='/models/1?'+_0x2129fb['toString'](),_0x347fd7=this['_sendApiRequest'](_0x5a0e8e,'GET',void 0x0,!0x0);return{'list':async()=>await(await _0x347fd7['request'])['json'](),'abortController':_0x347fd7['abortController']};}['deleteFile'](_0x109891,_0x1c9a90){const _0x1766a7=this['_sendApiRequest']('/conversations/'+_0x109891+'/files/'+_0x1c9a90,'DELETE');return{'execute':async()=>{await _0x1766a7['request'];},'abortController':_0x1766a7['abortController']};}['deleteDocument'](_0x5ae678,_0x398d55){const _0x111b56=this['_sendApiRequest']('/conversations/'+_0x5ae678+'/documents/'+_0x398d55,'DELETE');return{'execute':async()=>{await _0x111b56['request'];},'abortController':_0x111b56['abortController']};}['deleteWebResource'](_0x1d52ab,_0x493b81){const _0x294cf0=this['_sendApiRequest']('/conversations/'+_0x1d52ab+'/web-resources/'+_0x493b81,'DELETE');return{'execute':async()=>{await _0x294cf0['request'];},'abortController':_0x294cf0['abortController']};}['callSystemReview']({reviewName:_0x780892,content:_0x29f321,args:_0x58d6f6}){const _0x4f5a02=this['_sendApiRequest']('/reviews/system/'+_0x780892+'/calls','POST',{'content':[{'type':'text','content':_0x29f321}],'args':_0x58d6f6});return{'getStream':async()=>{const _0x4f97e3=(await _0x4f5a02['request'])['body'];return this['_getStreamReader'](_0x4f97e3);},'abortController':_0x4f5a02['abortController']};}['callCustomReview']({content:_0x53d91b,prompt:_0x157bc5,model:_0x45be07}){const _0x2fabcb=this['_sendApiRequest']('/reviews/custom/calls','POST',{'content':[{'type':'text','content':_0x53d91b}],'prompt':_0x157bc5,'model':_0x45be07});return{'getStream':async()=>{const _0x25ab4e=(await _0x2fabcb['request'])['body'];return this['_getStreamReader'](_0x25ab4e);},'abortController':_0x2fabcb['abortController']};}['upsertAIChatRating'](_0x875030,_0x38c21e,_0x228524){const _0x303bf1=this['_sendApiRequest']('/conversations/'+_0x875030+'/messages/'+_0x38c21e+'/ratings','PUT',{'positiveCount':_0x228524['positiveCount'],'totalCount':_0x228524['totalCount'],'modificationId':_0x228524['modificationId']});return{'execute':async()=>{await _0x303bf1['request'];},'abortController':_0x303bf1['abortController']};}['upsertAIActionRating'](_0x42074a,_0x55d335,_0x95af64){const _0x38e95d=this['_sendApiRequest']('/actions/system/'+_0x42074a+'/calls/'+_0x55d335+'/ratings','PUT',{'positiveCount':_0x95af64['positiveCount'],'totalCount':_0x95af64['totalCount']});return{'execute':async()=>{await _0x38e95d['request'];},'abortController':_0x38e95d['abortController']};}['upsertCustomAIActionRating'](_0x5954d9,_0x3ac57c){const _0x24d1a5=this['_sendApiRequest']('/actions/custom/calls/'+_0x5954d9+'/ratings','PUT',{'positiveCount':_0x3ac57c['positiveCount'],'totalCount':_0x3ac57c['totalCount']});return{'execute':async()=>{await _0x24d1a5['request'];},'abortController':_0x24d1a5['abortController']};}['upsertAIReviewRating'](_0x303e48,_0x2eef83,_0x3ae485,_0x2b6d1a){const _0x3850ef=this['_sendApiRequest']('/reviews/system/'+_0x303e48+'/calls/'+_0x2eef83+'/ratings','PUT',{'positiveCount':_0x3ae485['positiveCount'],'totalCount':_0x3ae485['totalCount'],'dataId':_0x2b6d1a});return{'execute':async()=>{await _0x3850ef['request'];},'abortController':_0x3850ef['abortController']};}['upsertCustomAIReviewRating'](_0xcc6d8b,_0x48a4d1,_0x33dfb9){const _0x117d5b=this['_sendApiRequest']('/reviews/custom/calls/'+_0xcc6d8b+'/ratings','PUT',{'positiveCount':_0x48a4d1['positiveCount'],'totalCount':_0x48a4d1['totalCount'],'dataId':_0x33dfb9});return{'execute':async()=>{await _0x117d5b['request'];},'abortController':_0x117d5b['abortController']};}['_sendApiRequest'](_0x3b68c7,_0x5067a0,_0x22d5c1,_0x1d7687=!0x1){const _0x24c62c=new AbortController(),_0x1ec125=_0x1d7687?_0x5067a0+':'+_0x3b68c7:null;if(_0x1ec125){const _0xdc3695=this['_responseCache']['get'](_0x1ec125);if(_0xdc3695)return{'request':_0xdc3695['then'](_0x5ba8d5=>_0x5ba8d5['clone']()),'abortController':_0x24c62c};}const _0x3d1992=_0x22d5c1 instanceof FormData,_0x410c9f={'Authorization':'Bearer\x20'+this['_token']?.['value'],'X-Editor-Version':mt};_0x22d5c1&&!_0x3d1992&&(_0x410c9f['Content-Type']='application/json');const _0x481e8e={'method':_0x5067a0,'headers':_0x410c9f,'signal':_0x24c62c['signal']};_0x22d5c1&&(_0x481e8e['body']=_0x3d1992?_0x22d5c1:JSON['stringify'](_0x22d5c1));const _0xeae469=fetch(''+this['_apiUrl']+_0x3b68c7,_0x481e8e)['catch'](_0x5ac909=>{_0x1ec125&&this['_responseCache']['delete'](_0x1ec125),this['_handleError'](_0x5ac909);})['then'](_0x401448=>_0x401448['ok']?_0x401448:_0x401448['json']()['then'](_0xb0f6a6=>{throw _0x1ec125&&this['_responseCache']['delete'](_0x1ec125),{'url':this['_apiUrl'],'path':_0x3b68c7,'method':_0x5067a0,'body':_0x22d5c1,'status':(_0x401448||{})['status'],'statusText':(_0x401448||{})['statusText'],'code':_0xb0f6a6['code'],'message':_0xb0f6a6['message'],'traceId':_0xb0f6a6['traceId']};}));return _0x1ec125&&this['_responseCache']['set'](_0x1ec125,_0xeae469['then'](_0x3715e7=>_0x3715e7['clone']())),{'request':_0xeae469,'abortController':_0x24c62c};}async*['_getStreamReader'](_0x3f674c){const _0x2c2f41=[],_0x396528=_0x3f674c['getReader'](),_0x12784f=_0x38655c({'onError':_0x479566=>{this['_handleError'](_0x479566);},'onEvent':_0x21635e=>{_0x21635e['data']=JSON['parse'](_0x21635e['data']),_0x2c2f41['push'](_0x21635e);}});try{let _0x3c0df3=!0x1;for(;!_0x3c0df3;){const {done:_0x50fb4e,value:_0x4f36a9}=await _0x396528['read']();_0x50fb4e&&(_0x3c0df3=!0x0),_0x12784f['feed'](this['_decoder']['decode'](_0x4f36a9,{'stream':!0x0})),yield*_0x2c2f41,_0x2c2f41['length']=0x0;}}catch(_0x23548d){this['_handleError'](_0x23548d);}finally{_0x396528['releaseLock'](),_0x12784f['reset']();}}['_handleError'](_0x5c24bc){if(_0x5c24bc instanceof at)throw _0x5c24bc;if(_0x5c24bc instanceof Error&&'AbortError'===_0x5c24bc['name'])throw new at('ai-request-aborted',this,{'originalError':_0x5c24bc});throw new at('ai-request-failed',this,{'originalError':_0x5c24bc});}}function hs(_0x4efac7,_0x1fed5e,_0x2cf7a6){const t=_0x4efac7['t'];switch(_0x1fed5e){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'},_0x2cf7a6);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.'},_0x2cf7a6);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.'},_0x2cf7a6);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.'},_0x2cf7a6);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'},_0x2cf7a6);case'AI_CHAT_SUGGESTION_ACTION_SUGGEST':return t({'id':'AI_CHAT_SUGGESTION_ACTION_SUGGEST','string':'Suggest'},_0x2cf7a6);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'},_0x2cf7a6);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.'},_0x2cf7a6);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.'},_0x2cf7a6);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.'},_0x2cf7a6);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.'},_0x2cf7a6);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'},_0x2cf7a6);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.'},_0x2cf7a6);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 _0x1fed5e;}}const cs='ck-ai-button-primary',ls='ck-ai-button-secondary',us='ck-ai-button-tertiary';function ds(_0x180f99,_0x2c2bad){const _0x10a89e=new Nt(_0x180f99),_0x44a784=hs(_0x180f99,'AI_TABS_LABEL_MINIMIZE'),_0x242e3a=hs(_0x180f99,'AI_TABS_LABEL_MAXIMIZE');return _0x10a89e['set']({'withText':!0x1,'icon':_0x3e6682,'tooltip':!0x0,'class':'ck-ai-tabs__resize\x20'+us}),_0x10a89e['bind']('label')['to'](_0x2c2bad,'isMaximized',_0x591a75=>_0x591a75?_0x44a784:_0x242e3a),_0x10a89e['bind']('icon')['to'](_0x2c2bad,'isMaximized',_0x195c67=>_0x195c67?_0x7cb3cb:_0x3e6682),_0x10a89e['bind']('isOn')['to'](_0x2c2bad,'isMaximized'),_0x10a89e['on']('execute',()=>{_0x2c2bad['fire']('resizeTabs');}),_0x10a89e;}function _s(_0x3b4dcb){return _0xc677a2(_0x3b4dcb);}function gs(_0x5e69b4){return ti(_0x5e69b4);}function As(_0x161dc7,_0x2748b9,_0xa3f7c6){const _0x151080=null!==_0x2748b9?_0xb8b9e6=>_0xb8b9e6['attribs'][_0x161dc7]===_0x2748b9:_0x2c2e09=>Boolean(_0x2c2e09['attribs'][_0x161dc7]);return _0x32608d(_0x4bcd68=>_0x5c243a(_0x4bcd68)&&_0x151080(_0x4bcd68),_0xa3f7c6);}function Is(_0x799e64,_0x1e6efb,_0x366346){const _0x394560=null!==_0x1e6efb?_0x68ac9b=>_0x68ac9b['attribs'][_0x799e64]===_0x1e6efb:_0x421597=>Boolean(_0x421597['attribs'][_0x799e64]);return _0x58b8d1(_0x3cb0cd=>_0x5c243a(_0x3cb0cd)&&_0x394560(_0x3cb0cd),_0x366346);}function Es(_0x6d18a7,_0x4fbb97){return _0x6d18a7&&_0x5c243a(_0x6d18a7)?_0x6d18a7['attribs'][_0x4fbb97]:null;}function ps(_0x2229e0,_0x54a3d5,_0x3025d2){_0x5c243a(_0x2229e0)&&(null===_0x3025d2?delete _0x2229e0['attribs'][_0x54a3d5]:_0x2229e0['attribs'][_0x54a3d5]=_0x3025d2);}function ms(_0x159a6c,_0x16b246,_0x1dfcae){const _0x422b8f=_0x16b246['cloneNode'](!0x0);'beforebegin'===_0x1dfcae?_0x506989(_0x159a6c,_0x422b8f):'afterbegin'===_0x1dfcae?_0x57a9ea(_0x159a6c,_0x422b8f):'beforeend'===_0x1dfcae?_0x30459f(_0x159a6c,_0x422b8f):'afterend'===_0x1dfcae&&_0xb4e700(_0x159a6c,_0x422b8f);}function Ts(_0x138881){const _0x1bdfd0=[];let _0x431de6=_0x138881;for(;_0x431de6;)_0x431de6=_0x51eedd(_0x431de6),_0x431de6&&_0x1bdfd0['push'](_0x431de6);return _0x1bdfd0;}function Cs(_0xfdd0d1){return _0xfdd0d1['replace'](/^\s+/gm,'')['replace'](/\s+$/gm,'')['replace'](/\n*/g,'')['replace'](/\s+/g,'\x20')['replace'](/>\s*</g,'><');}function ws(_0x459018){let _0x4b1819=0x0;for(;_0x459018['parentNode'];)_0x459018=_0x459018['parentNode'],_0x4b1819++;return _0x4b1819;}function fs(_0x496132){const _0x7c13e6=[];let _0xdfc32=_0x496132['nextSibling'];for(;_0xdfc32;)_0x7c13e6['push'](_0xdfc32),_0xdfc32=_0xdfc32['nextSibling'];_0x7c13e6['forEach'](_0x36305d=>{_0x48b852(_0x36305d);});}class bs extends/* #__PURE__ -- @preserve */
|
|
25
|
+
ht(){['_m2html'];constructor(){super();const _0x5a7fba=Object['entries'](_0x15195d),_0x4797b7=_0x5a7fba['findIndex'](([_0x3a6b41])=>'rehypeDomRaw'===_0x3a6b41);if(-0x1===_0x4797b7)throw new at('ai-response-parser-unable-to-set-up-parser');_0x5a7fba['splice'](_0x4797b7+0x1,0x0,['rehypeSanitize',_0x548659]),this['_m2html']=new _0x6fd27c({'plugins':Object['fromEntries'](_0x5a7fba)});}['convertMarkdownToHTML'](_0xcac04d){const _0x55976b=this['_m2html']['parse'](_0xcac04d);return this['parseAndNormalizeHTML'](_0x55976b);}['parseAndNormalizeHTML'](_0x21e39a){return this['_parseHTML'](_0x21e39a);}['_parseHTML'](_0x321d13){const _0x2b392f=_s('<dummy>'+_0x321d13['replace'](/^\t+/gm,'\x20')['replace'](/\n*/g,'')['replace'](/\s+/g,'\x20')['replace'](/<[^>]*?$/g,'')+'</dummy>');return _0x2b392f['children']=_0x2b392f['children'][0x0]['children'],_0x2b392f;}}class Ss extends/* #__PURE__ -- @preserve */
|
|
26
|
+
ht(){['_generateUid'];['_uidCounter']=0x0;['_touchedNodesState']={'newIds':[],'modifiedIds':[],'removedIds':[],'invalidIds':[],'lastTouchedId':null};['_existingDataIds']=new Set();constructor(_0x3f1d8c){super(),this['_generateUid']=_0x3f1d8c||(()=>'e'+String(this['_uidCounter']++));}['merge'](_0x57ec7f,_0x1b817c,_0x3f5eda){this['_uidCounter']=0x0;const _0x2d1f10=_0x57ec7f['cloneNode'](!0x0),_0x50dccb=_0x2d1f10['childNodes'],_0x4e8740=Array['from'](_0x50dccb)['filter'](_0x359f8e=>!(0x3===_0x359f8e['nodeType']&&''===gs(_0x359f8e)['trim']())),_0x54066f=_0x4e8740['length'],_0x19aeb3=new Map();for(const _0x8f0d16 of _0x4e8740)_0x8f0d16&&_0x5c243a(_0x8f0d16)&&void 0x0===_0x8f0d16['attribs']['data-id']&&ps(_0x8f0d16,'data-id','new-element');if(0x0===_0x1b817c['childNodes']['length']){const _0x182077=[];return Is('data-id','new-element',_0x2d1f10)['forEach'](_0x8af2ff=>{const _0x5518a4=this['_generateUid']();ps(_0x8af2ff,'data-id',_0x5518a4),_0x182077['push'](_0x5518a4);}),this['_removeSpecialComments'](_0x2d1f10),{'parsedContent':_0x2d1f10,'newNodeIds':_0x182077,'modifiedNodeIds':[],'removedNodeIds':[],'newAnchorIds':_0x19aeb3};}_0x3f5eda&&_0x3f5eda['markUnstableElements']&&this['_markLastTagElementUnstable'](_0x2d1f10),this['_touchedNodesState']['newIds']=[],this['_touchedNodesState']['modifiedIds']=[],this['_touchedNodesState']['removedIds']=[],this['_touchedNodesState']['invalidIds']=[],this['_touchedNodesState']['lastTouchedId']=null,this['_existingDataIds']=new Set(Is('data-id',null,_0x1b817c)['map'](_0x16e2b9=>Es(_0x16e2b9,'data-id'))['filter'](_0x150510=>!!_0x150510));let _0x4db56e=-0x1,_0x188fdb=!0x1;for(let _0x35ddbc=0x0;_0x35ddbc<_0x54066f;_0x35ddbc++){const _0x4f7445=_0x4e8740[_0x35ddbc],_0x2cf05b=_0x4e8740[_0x35ddbc+0x1];if(this['_isNewNode'](_0x4f7445)){if(-0x1===_0x4db56e&&(_0x4db56e=_0x35ddbc),this['_markWrappedElements'](_0x4f7445),!this['_isNewNode'](_0x2cf05b)){const [_0x3c707e,_0x50bb56]=this['_findReferenceNode'](_0x4f7445,_0x188fdb,_0x1b817c);if(_0x3c707e){const _0x58495a=Array['from'](_0x4e8740)['slice'](_0x4db56e,_0x35ddbc+0x1),_0x5d034e=Es(_0x3c707e,'data-id');if(this['_insertNodes'](_0x3c707e,_0x58495a,_0x50bb56),_0x5d034e)for(const _0x5901fc of _0x58495a){const _0x38b464=Es(_0x5901fc,'data-id');_0x38b464&&_0x19aeb3['set'](_0x38b464,_0x5d034e);}_0x4db56e=-0x1;}}}else{if(this['_isExistingContentComment'](_0x4f7445))_0x188fdb=!0x0;else{if(this['_isExistingNode'](_0x4f7445)){const _0x32937f=Es(_0x4f7445,'data-id');if(_0x32937f&&this['_existingDataIds']['has'](_0x32937f)){const _0xfa6f1b=As('data-id',_0x32937f,_0x1b817c);this['_replaceNode'](_0xfa6f1b,_0x4f7445);}}else{if(this['_isDelNode'](_0x4f7445)){const _0x4ee529=this['_getNodeDataId'](_0x4f7445);!!As('data-id',_0x4ee529,_0x2d1f10)||this['_touchedNodesState']['removedIds']['push'](_0x4ee529);}}}}}for(const _0xe53453 of this['_touchedNodesState']['removedIds']){const _0x1e6be9=As('data-id',_0xe53453,_0x1b817c);_0x1e6be9&&this['_removeNode'](_0x1e6be9,_0xe53453,_0x3f5eda);}if(Is('data-id','new-element',_0x1b817c)['forEach'](_0x542322=>{const _0x5840d8=this['_getUid'](_0x542322);ps(_0x542322,'data-id',_0x5840d8),this['_touchedNodesState']['newIds']['push'](_0x5840d8);}),this['_removeSpecialComments'](_0x1b817c),_0x3f5eda&&_0x3f5eda['markUnstableElements']&&this['_markUnstableElements'](_0x1b817c,_0x3f5eda['markUnstableElementsDepth']||0x0),this['_processWrappedElements'](_0x1b817c,_0x3f5eda),_0x3f5eda&&_0x3f5eda['cutAfterLastChange']&&this['_touchedNodesState']['lastTouchedId']){const _0x4af90a=Is('data-id',this['_touchedNodesState']['lastTouchedId'],_0x1b817c);let _0x164480=_0x4af90a[_0x4af90a['length']-0x1];for(;_0x164480;)fs(_0x164480),_0x164480=_0x164480['parentNode'];}return{'parsedContent':_0x1b817c,'newNodeIds':this['_touchedNodesState']['newIds'],'modifiedNodeIds':this['_touchedNodesState']['modifiedIds'],'removedNodeIds':this['_touchedNodesState']['removedIds'],'newAnchorIds':_0x19aeb3};}['_insertNodes'](_0x12cc79,_0x31ec66,_0x3ae71c){for(const _0x53f627 of _0x31ec66){const _0x2012a9=this['_getUid'](_0x53f627);ps(_0x53f627,'data-id',_0x2012a9),this['_touchedNodesState']['newIds']['push'](_0x2012a9),this['_touchedNodesState']['lastTouchedId']=_0x2012a9;}const _0x182dc4='afterbegin'===_0x3ae71c||'afterend'===_0x3ae71c?_0x31ec66['reverse']():_0x31ec66;for(const _0x165ad6 of _0x182dc4)ms(_0x12cc79,_0x165ad6,_0x3ae71c);}['_replaceNode'](_0x13bfe3,_0x533a6f){if(!_0x13bfe3)return;if(_0x24baa0=_0x533a6f,Cs(gs(_0x13bfe3))===Cs(gs(_0x24baa0)))return;var _0x24baa0;const _0x10b92e=this['_getUid'](_0x13bfe3);ps(_0x533a6f,'data-id',_0x10b92e),this['_touchedNodesState']['modifiedIds']['push'](_0x10b92e),this['_touchedNodesState']['lastTouchedId']=_0x10b92e,_0x5deec6(_0x13bfe3,_0x533a6f['cloneNode'](!0x0));}['_removeNode'](_0x201570,_0x5cc408,_0xb80410){if(_0xb80410&&_0xb80410['replaceRemovedWith']){this['_touchedNodesState']['lastTouchedId']=_0x5cc408;const _0x35faaa=_0xb80410['replaceRemovedWith']['cloneNode'](!0x0);ps(_0x35faaa,'data-id',_0x5cc408),ps(_0x35faaa,'data-removed','true'),_0x5deec6(_0x201570,_0x35faaa);}else _0x48b852(_0x201570);}['_findReferenceNode'](_0x36595d,_0x2afb8a,_0x1ad9c4){const _0x3bc5d3=this['_findPrevElementWithDataId'](_0x36595d,!0x1);if(_0x3bc5d3){const _0x21c924=this['_getNodeDataId'](_0x3bc5d3),_0x15bb83=As('data-id',_0x21c924,_0x1ad9c4);if(_0x15bb83)return[_0x15bb83,'afterend'];this['_touchedNodesState']['invalidIds']['push'](_0x21c924);}const _0x1c23fd=this['_findNextElementWithDataId'](_0x36595d,!0x1);if(_0x1c23fd){const _0x4b3b0c=this['_getNodeDataId'](_0x1c23fd),_0x11cab2=As('data-id',_0x4b3b0c,_0x1ad9c4);if(_0x11cab2)return[_0x11cab2,'beforebegin'];this['_touchedNodesState']['invalidIds']['push'](_0x4b3b0c);}return _0x2afb8a?_0x36595d['nextSibling']?this['_findFallbackReferenceNode'](_0x36595d,_0x1ad9c4):[_0x1ad9c4['childNodes'][_0x1ad9c4['childNodes']['length']-0x1],'afterend']:[_0x1ad9c4['childNodes'][0x0],'beforebegin'];}['_findFallbackReferenceNode'](_0x36f6bd,_0x1ba755){const _0x494a73=[],_0x2d3ba6=this['_findPrevElementWithDataId'](_0x36f6bd,!0x0);if(_0x2d3ba6){const _0x634b04=As('data-id',this['_getNodeDataId'](_0x2d3ba6),_0x1ba755);_0x634b04&&_0x494a73['push']([_0x634b04,'afterend']);}const _0x355424=this['_findNextElementWithDataId'](_0x36f6bd,!0x0);if(_0x355424){const _0x379fec=As('data-id',this['_getNodeDataId'](_0x355424),_0x1ba755);_0x379fec&&_0x494a73['push']([_0x379fec,'beforebegin']);}if(_0x494a73['length']>0x1)return ws(_0x494a73[0x0][0x0])<=ws(_0x494a73[0x1][0x0])?_0x494a73[0x0]:_0x494a73[0x1];return 0x1===_0x494a73['length']?_0x494a73[0x0]:[_0x1ba755['lastChild'],'afterend'];}['_findNextElementWithDataId'](_0x1bb626,_0x5329db){let _0xd926c2=_0x1bb626['nextSibling'],_0x122d82=null,_0x7ebb36=!0x1;for(;_0xd926c2;){if(_0x471c29(_0xd926c2)){if(this['_isDelNode'](_0xd926c2)&&(_0x122d82=_0xd926c2),this['_isExistingContentComment'](_0xd926c2)&&_0x5329db&&!_0x7ebb36){_0x7ebb36=!0x0,_0xd926c2=_0xd926c2['nextSibling'];continue;}break;}const _0x14a827=Es(_0xd926c2,'data-id');if(_0x14a827&&'new-element'!==_0x14a827&&this['_existingDataIds']['has'](_0x14a827)){_0x122d82=_0xd926c2;break;}_0xd926c2=_0xd926c2['nextSibling'];}return _0x122d82;}['_findPrevElementWithDataId'](_0x3cdc89,_0x355e10){let _0x3a2b54=_0x3cdc89['previousSibling'],_0x11a627=null,_0x222fdc=!0x1;for(;_0x3a2b54;){if(_0x471c29(_0x3a2b54)){if(this['_isDelNode'](_0x3a2b54)&&(_0x11a627=_0x3a2b54),this['_isExistingContentComment'](_0x3a2b54)&&_0x355e10&&!_0x222fdc){_0x222fdc=!0x0,_0x3a2b54=_0x3a2b54['previousSibling'];continue;}break;}const _0x53309f=Es(_0x3a2b54,'data-id');if(_0x53309f&&'new-element'!==_0x53309f&&this['_existingDataIds']['has'](_0x53309f)){_0x11a627=_0x3a2b54;break;}_0x3a2b54=_0x3a2b54['previousSibling'];}return _0x11a627;}['_markWrappedElements'](_0x27174){_0x5c243a(_0x27174)&&Is('data-id',null,_0x27174)['forEach'](_0x4fd378=>{this['_isExistingNode'](_0x4fd378)&&(ps(_0x4fd378,'data-wrapped-id',Es(_0x4fd378,'data-id')),ps(_0x4fd378,'data-id',null));});}['_processWrappedElements'](_0x34c9c8,_0x5e0ff7){Is('data-wrapped-id',null,_0x34c9c8)['forEach'](_0x1cdbe5=>{const _0x34431a=Es(_0x1cdbe5,'data-wrapped-id');if(Es(_0x1cdbe5,'data-unstable')||this['_hasUnstableParent'](_0x1cdbe5))return;const _0x32b271=As('data-id',_0x34431a,_0x34c9c8);ps(_0x1cdbe5,'data-id',_0x34431a),ps(_0x1cdbe5,'data-wrapped-id',null),_0x32b271&&(this['_removeNode'](_0x32b271,_0x34431a,_0x5e0ff7),this['_touchedNodesState']['removedIds']['push'](_0x34431a),this['_touchedNodesState']['lastTouchedId']=_0x34431a);});}['_hasUnstableParent'](_0x554b86){let _0x14d3b6=_0x554b86['parentNode'];for(;_0x14d3b6;){if(Es(_0x14d3b6,'data-unstable'))return!0x0;_0x14d3b6=_0x14d3b6['parentNode'];}return!0x1;}['_getNodeDataId'](_0x4300ad){if(!_0x4300ad)return null;if(_0x5c243a(_0x4300ad))return Es(_0x4300ad,'data-id');if(_0x471c29(_0x4300ad)){const _0x13c9b6=gs(_0x4300ad)['match'](/removed[\s*-]data-id="([^"]+)"/);if(_0x13c9b6&&_0x13c9b6[0x1])return _0x13c9b6[0x1];}return null;}['_getUid'](_0x1fd7b0){return this['_isExistingNode'](_0x1fd7b0)?Es(_0x1fd7b0,'data-id'):this['_generateUid']();}['_removeSpecialComments'](_0x12b4fd){(function(_0x572071){return _0x442d99(_0x361e5c=>_0x471c29(_0x361e5c),_0x572071,!0x0,0x1/0x0);}(_0x12b4fd)['filter'](_0x3dcefc=>this['_isDelNode'](_0x3dcefc)||this['_isExistingContentComment'](_0x3dcefc))['forEach'](_0x4a0b2a=>{_0x48b852(_0x4a0b2a);}));}['_markLastTagElementUnstable'](_0x222515){const _0x5cd64b=_0x222515['childNodes'],_0x380448=_0x5cd64b[_0x5cd64b['length']-0x1];_0x380448&&_0x5c243a(_0x380448)&&ps(_0x380448,'data-unstable','true');}['_markUnstableElements'](_0x139190,_0x1e1c12){const _0x5715af=As('data-unstable','true',_0x139190);if(!_0x5715af)return;const _0xdd0b3f=Ts(_0x5715af)['slice'](0x0,-0x1),_0x59043b=_0xdd0b3f['length'];let _0x1d4e1a=_0x5715af;if(_0x59043b>_0x1e1c12){let _0x641538=_0x59043b,_0x40307b=null;for(;_0x641538>_0x1e1c12&&_0x641538>=0x0;)_0x641538--,_0x40307b=_0xdd0b3f[_0x641538];_0x40307b&&(_0x1d4e1a=_0x40307b,ps(_0x5715af,'data-unstable',null),ps(_0x40307b,'data-unstable','true'));}else{if(_0x59043b<_0x1e1c12){let _0x28afff=_0x59043b,_0x250c52=_0x5715af;for(;_0x28afff<_0x1e1c12;){const _0x571d28=_0x250c52['childNodes']['filter'](_0x4f2379=>_0x5c243a(_0x4f2379));if(0x0===_0x571d28['length'])break;_0x28afff++,_0x250c52=_0x571d28[_0x571d28['length']-0x1];}_0x250c52&&(_0x1d4e1a=_0x250c52,ps(_0x5715af,'data-unstable',null),ps(_0x250c52,'data-unstable','true'));}}let _0x13faa7=_0x1d4e1a;for(;_0x13faa7;){for(;_0x13faa7['nextSibling'];)_0x13faa7=_0x13faa7['nextSibling'],_0x5c243a(_0x13faa7)&&ps(_0x13faa7,'data-unstable','true');_0x13faa7=_0x13faa7['parentNode'];}}['_isNewNode'](_0x29de21){return Boolean('new-element'===Es(_0x29de21,'data-id'));}['_isExistingNode'](_0x576908){return Boolean((Es(_0x576908,'data-id')||'')['length']>0x0&&'new-element'!==Es(_0x576908,'data-id'));}['_isDelNode'](_0x3451db){return!!_0x3451db&&Boolean(_0x471c29(_0x3451db)&&gs(_0x3451db)['match'](/removed[\s*-]data-id="[^"]+"/));}['_isExistingContentComment'](_0x22c7bc){return Boolean(_0x471c29(_0x22c7bc)&&gs(_0x22c7bc)['match'](/\s*existing[\s*-](content|document)\s*/g));}}function Rs({editor:_0x2a4108,changeGroups:_0x206968,documentContextContent:_0x23bb2c,showDiff:_0x1264bf,trimUnchanged:_0x476f6f=!0x0}){return _0x206968['map'](_0x260229=>{const _0x59f43f=new _0x2f7da1([]),_0x24b04a=new _0x2f7da1([]),_0xbf08ec=new Set();for(const _0x23b106 of _0x260229['changes'])'new'==_0x23b106['type']&&Is('data-id',null,_0x23b106['node'])['forEach'](_0x2434a3=>{_0xbf08ec['add'](Es(_0x2434a3,'data-id'));});for(const _0x228a1c of _0x260229['changes'])if('removed'!=_0x228a1c['type']?_0x24b04a['children']['push'](_0x228a1c['node']['cloneNode'](!0x0)):_0x1264bf||_0xbf08ec['has'](_0x228a1c['id'])||_0x24b04a['children']['push'](_0x228a1c['node']['cloneNode'](!0x0)),'new'!=_0x228a1c['type']&&(_0x1264bf||'removed'!=_0x228a1c['type'])){const _0x25f7f3=_0x32608d(_0x4831f2=>Es(_0x4831f2,'data-id')==_0x228a1c['id'],_0x23bb2c,!0x0);_0x25f7f3&&_0x59f43f['children']['push'](_0x25f7f3['cloneNode'](!0x0));}const {content:_0x5c1a21,hasChanges:_0x5ad871}=function(_0x2a531c,_0x3ef1b0,_0x23d69b,_0x46e78c,_0x4876b9=!0x0){const _0x1a0800=_0x2a531c['plugins']['get']('DocumentCompare'),_0x20ebab=gs(_0x3ef1b0),_0x3bc134=gs(_0x23d69b),_0x1f90b5=_0x2a531c['data']['parse'](_0x20ebab,'$root'),_0x4889ff=_0x2a531c['model']['createPositionAt'](_0x1f90b5,0x0),_0x749de9=_0x1a0800['getDiff'](_0x20ebab,_0x3bc134,{'anchor':_0x4889ff,'markDeletions':_0x46e78c,'targetEditor':_0x2a531c}),_0x48375f=_0x749de9['getOperations']();if(0x0==_0x48375f['length'])return{'content':_0x3ef1b0['cloneNode'](!0x0),'hasChanges':!0x1};_0x46e78c?function(_0x321e9d,_0x2af1f3,_0x696844){if(0x0==_0x321e9d['length'])return;const _0x188f89=_0x696844['plugins']['get']('DocumentCompare'),_0x1ed767=_0x696844['plugins']['get']('SuggestionsConversion');_0x696844['model']['change'](_0x1d3d6f=>{const _0x42e890=new Set();for(let _0x5db988=0x0;_0x5db988<_0x321e9d['length'];_0x5db988++){const _0x261f23=_0x321e9d[_0x5db988];if(_0x261f23['baseVersion']=null,_0x261f23['isDocumentOperation']=!0x1,_0x188f89['isMarkedRemoveOperation'](_0x261f23)){const _0x23af3d=_0x1a286c(_0x261f23['newRange'],_0x696844['model']),_0x5540bc='suggestion:deletion:'+ot()+':$aiSuggestion';_0x2af1f3['markers']['set'](_0x5540bc,_0x23af3d);}else switch(_0x261f23['type']){case'rename':{if(_0x261f23['oldName']==_0x261f23['newName'])break;_0x1d3d6f['batch']['addOperation'](_0x261f23),_0x696844['model']['applyOperation'](_0x261f23);const _0x34b88e='$elementName',_0xe87f57=_0x261f23['position'],_0x2da875=_0x696844['model']['createRange'](_0xe87f57,_0x696844['model']['createPositionAt'](_0xe87f57['nodeAfter'],'end')),_0x150d14='suggestion:attribute:'+_0x34b88e+':'+ot()+':$aiSuggestion';_0x2af1f3['markers']['set'](_0x150d14,_0x2da875);break;}case'addAttribute':case'removeAttribute':case'changeAttribute':{if(_0x261f23['oldValue']==_0x261f23['newValue'])break;_0x1d3d6f['batch']['addOperation'](_0x261f23),_0x696844['model']['applyOperation'](_0x261f23);const _0x41283a=_0x261f23['key'];if(!_0x1ed767['isRegisteredAttribute'](_0x41283a))break;const _0x5444fa=_0x1a286c(_0x261f23['range'],_0x696844['model']),_0x22a5d4='suggestion:attribute:'+_0x41283a+':'+ot()+':$aiSuggestion';_0x2af1f3['markers']['set'](_0x22a5d4,_0x5444fa);break;}case'insert':{_0x1d3d6f['batch']['addOperation'](_0x261f23),_0x696844['model']['applyOperation'](_0x261f23);if(_0x321e9d[_0x5db988+0x1]&&'move'==_0x321e9d[_0x5db988+0x1]['type']){Os(_0x2af1f3,_0x261f23);break;}const _0x4cdd61=_0x261f23['position'],_0x2fb7b2=_0x261f23['howMany'],_0x5988d2=_0x1a286c(_0x696844['model']['createRange'](_0x4cdd61,_0x4cdd61['getShiftedBy'](_0x2fb7b2)),_0x696844['model']),_0x444efe='suggestion:insertion:'+ot()+':$aiSuggestion';_0x2af1f3['markers']['set'](_0x444efe,_0x5988d2);break;}case'split':{_0x1d3d6f['batch']['addOperation'](_0x261f23),_0x696844['model']['applyOperation'](_0x261f23);const _0x8afc07=_0x261f23['splitPosition'],_0x95abc5=_0x261f23['moveTargetPosition'],_0x3782e5=_0x696844['model']['createRange'](_0x8afc07,_0x95abc5),_0x54db69='suggestion:insertion:'+ot()+':$aiSuggestion';_0x2af1f3['markers']['set'](_0x54db69,_0x3782e5);break;}case'move':{_0x1d3d6f['batch']['addOperation'](_0x261f23),_0x696844['model']['applyOperation'](_0x261f23),_0x321e9d[_0x5db988-0x1]&&'insert'==_0x321e9d[_0x5db988-0x1]['type']&&Os(_0x2af1f3,_0x261f23);const _0x390828=_0x261f23['getMovedRangeStart'](),_0x546162=_0x261f23['howMany'];for(let _0x1d3eb9=0x0;_0x1d3eb9<_0x546162;_0x1d3eb9++){const _0x497e7d=_0x390828['getShiftedBy'](_0x1d3eb9)['nodeAfter'];_0x42e890['add'](_0x497e7d);}break;}case'remove':{const _0x431cbc=_0x261f23['sourcePosition'],_0x3febd2=_0x261f23['howMany'],_0x11d444=new _0x1e19dc(_0x431cbc,_0x3febd2);_0x1d3d6f['batch']['addOperation'](_0x11d444),_0x696844['model']['applyOperation'](_0x11d444);break;}}}for(const _0x260ee9 of _0x42e890){const _0xc1fd59=_0x696844['model']['createRangeOn'](_0x260ee9),_0x144a39='suggestion:formatBlock:$fakeWrap:'+ot()+':$aiSuggestion';_0x2af1f3['markers']['set'](_0x144a39,_0x1a286c(_0xc1fd59,_0x696844['model']));}});}(_0x48375f,_0x1f90b5,_0x2a531c):_0x2a531c['model']['change'](_0x5148f5=>{for(const _0x553494 of _0x48375f)if('remove'==_0x553494['type']){const _0x4d9731=_0x553494['sourcePosition'],_0xd10ee7=_0x553494['howMany'],_0x16f49a=new _0x1e19dc(_0x4d9731,_0xd10ee7);_0x5148f5['batch']['addOperation'](_0x16f49a),_0x2a531c['model']['applyOperation'](_0x16f49a);}else{if('marker'==_0x553494['type']){const _0x4cb1b5=_0x553494['name'],_0x294300=_0x553494['newRange'];null!==_0x294300?_0x1f90b5['markers']['set'](_0x4cb1b5,_0x294300):_0x1f90b5['markers']['delete'](_0x4cb1b5);}else _0x553494['baseVersion']=null,_0x553494['isDocumentOperation']=!0x1,_0x5148f5['batch']['addOperation'](_0x553494),_0x2a531c['model']['applyOperation'](_0x553494);}});if(_0x4876b9){const _0xbe5d6a=ks(_0x2a531c,_0x48375f,_0x1f90b5);Ns(_0x2a531c['model'],_0xbe5d6a),function(_0x70ffed,_0x282bb4){const _0x4f7016=_0x282bb4['getFirstRange']()['start'];let _0x2fa263=_0x282bb4['getFirstRange']()['end'];const _0x527b44=_0x4f7016['root'];(_0x2fa263['textNode']||_0x2fa263['nodeAfter']&&_0x2fa263['nodeAfter']['is']('$text'))&&(_0x3b17e2(_0x2fa263,'...'),_0x2fa263=_0x2fa263['getShiftedBy'](0x3)),(_0x4f7016['textNode']||_0x4f7016['nodeBefore']&&_0x4f7016['nodeBefore']['is']('$text'))&&(_0x3b17e2(_0x4f7016,'...'),function(_0x288c2f,_0x2c5965,_0xfbaaa7){for(let [_0x5c38d2,_0x5d311f]of _0x288c2f['markers']){const _0x922655=_0x5d311f['_getTransformedByInsertion'](_0x2c5965,_0xfbaaa7,!0x1);_0x5d311f=_0x922655[0x0],_0x288c2f['markers']['set'](_0x5c38d2,_0x5d311f);}}(_0x527b44,_0x4f7016,0x3),_0x4f7016['parent']==_0x2fa263['parent']&&(_0x2fa263=_0x2fa263['getShiftedBy'](0x3)));const _0x4b48c5=_0x70ffed['createRange'](_0x70ffed['createPositionAt'](_0x527b44,0x0),_0x4f7016),_0x2bd4c8=_0x70ffed['createRange'](_0x2fa263,_0x70ffed['createPositionAt'](_0x527b44,'end')),_0x3ab3c4=[..._0x4b48c5['getMinimalFlatRanges'](),..._0x2bd4c8['getMinimalFlatRanges']()];_0x3ab3c4['reverse']();for(const _0x52bd5f of _0x3ab3c4)_0x14bbcf(_0x52bd5f),ys(_0x527b44,_0x52bd5f);}(_0x2a531c['model'],_0xbe5d6a);}const _0x5f0887=_0x2a531c['data']['stringify'](_0x1f90b5,{'showSuggestionHighlights':!0x0});return{'content':_s(_0x5f0887),'hasChanges':!0x0};}(_0x2a4108,_0x59f43f,_0x24b04a,_0x1264bf,_0x476f6f);return{'type':_0x260229['changes'][0x0]['type'],'index':_0x260229['index'],'content':_0x5c1a21,'hasChanges':_0x5ad871};});}function Os(_0x54ea53,_0xe65af8){for(const [_0x22d390,_0x41ab54]of _0x54ea53['markers']){const _0x75dc8b=_0x2264dd['_createFromRanges'](_0x41ab54['getTransformedByOperation'](_0xe65af8));_0x54ea53['markers']['set'](_0x22d390,_0x75dc8b);}}function ks(_0x52ba59,_0x51ecc1,_0x4d5834){const _0x201be7=_0x52ba59['plugins']['get']('DocumentCompare');let _0x18b52d=_0x52ba59['model']['createPositionAt'](_0x4d5834,Number['POSITIVE_INFINITY']),_0x341f53=_0x52ba59['model']['createPositionAt'](_0x4d5834,0x0);for(const _0x12b5db of _0x51ecc1){let _0x1146a0,_0x27c3af;if(_0x201be7['isMarkedRemoveOperation'](_0x12b5db))_0x1146a0=_0x12b5db['newRange']['start'],_0x27c3af=_0x12b5db['newRange']['end'];else switch(_0x18b52d=_0x18b52d['getTransformedByOperation'](_0x12b5db),_0x341f53=_0x341f53['getTransformedByOperation'](_0x12b5db),_0x12b5db['type']){case'rename':_0x1146a0=_0x12b5db['position'],_0x27c3af=_0x1146a0['getShiftedBy'](0x1);break;case'addAttribute':case'removeAttribute':case'changeAttribute':_0x1146a0=_0x12b5db['range']['start'],_0x27c3af=_0x12b5db['range']['end'];break;case'insert':_0x1146a0=_0x12b5db['position'],_0x27c3af=_0x1146a0['getShiftedBy'](_0x12b5db['howMany']);break;case'split':_0x1146a0=_0x12b5db['splitPosition'],_0x27c3af=_0x12b5db['moveTargetPosition'];break;case'merge':{const _0x150be6=_0x12b5db['targetPosition']['path']['slice'](0x0,-0x1);_0x1146a0=_0x52ba59['model']['createPositionFromPath'](_0x4d5834,_0x150be6),_0x27c3af=_0x1146a0['getShiftedBy'](0x1);break;}case'move':case'remove':{const _0x556d1d=_0x12b5db['howMany'],_0x41a9ed=_0x12b5db['sourcePosition']['_getTransformedByInsertion'](_0x12b5db['targetPosition'],_0x556d1d),_0x57d26f=_0x12b5db['getMovedRangeStart']();'remove'==_0x12b5db['type']?(_0x1146a0=_0x41a9ed,_0x27c3af=_0x41a9ed):(_0x1146a0=_0x57d26f,_0x27c3af=_0x57d26f['getShiftedBy'](_0x556d1d));break;}}_0x1146a0&&_0x1146a0['isBefore'](_0x18b52d)&&(_0x18b52d=_0x1146a0['clone'](),_0x18b52d['stickiness']='toNone'),_0x27c3af&&_0x27c3af['isAfter'](_0x341f53)&&(_0x341f53=_0x27c3af['clone'](),_0x341f53['stickiness']='toNone');}return _0x52ba59['model']['createSelection'](_0x52ba59['model']['createRange'](_0x18b52d,_0x341f53));}function Ns(_0x4b9b25,_0x455728){vs(_0x4b9b25,_0x455728,'forward');const _0xe0c503=_0x455728['getFirstRange']();_0x455728['setTo']([]),_0x455728['setTo'](_0xe0c503,{'backward':!0x0}),vs(_0x4b9b25,_0x455728,'backward');}function vs(_0x335cc7,_0x4ec7e7,_0x515de4){let _0x2c1d0b=0x14;for(;_0x2c1d0b;){_0x335cc7['modifySelection'](_0x4ec7e7,{'unit':'word','direction':_0x515de4}),_0x2c1d0b--;const _0x1684d4=_0x4ec7e7['focus']['forward'==_0x515de4?'nodeBefore':'nodeAfter'];if(_0x1684d4&&_0x1684d4['is']('element')&&_0x335cc7['schema']['isBlock'](_0x1684d4)&&_0x335cc7['schema']['isObject'](_0x1684d4))break;}}function ys(_0x2cb861,_0x51d947){for(const [_0x385789,_0x3d0abf]of _0x2cb861['markers']){const _0x3784d6=_0x3d0abf['_getTransformedByDeletion'](_0x51d947['start'],_0x51d947['end']['offset']-_0x51d947['start']['offset']);null!=_0x3784d6?_0x2cb861['markers']['set'](_0x385789,_0x3784d6):_0x2cb861['markers']['delete'](_0x385789);}}class xs extends ht(){['id'];['interactionId'];['type'];['sources']=[];['parsedContent']=new _0x2f7da1([]);['parsedMergedContent']=new _0x2f7da1([]);['changeGroups']=[];['areActionsDisabled']=!0x1;['isFromHistory']=!0x1;['documentContextContent'];['documentId'];['dataIdDocumentSources'];['newNodeAnchorIds']=new Map();['aiResponseParser'];['aiResponseApplier'];['locale'];['cachedSuggestionContentParts']={'withDiff':[],'withoutDiff':[]};constructor({type:_0x2d6689,content:_0x136619='',isDone:_0x9a9ee1=!0x1,isComplete:_0xa9cbd2,interactionId:_0x388ff1,areActionsDisabled:_0x3672d0,isFromHistory:_0x414d19=!0x1,documentContextContent:_0x325c11,dataIdDocumentSources:_0xcf2135,documentId:_0x3b0e78,locale:_0x43aa66,id:_0x3b3c60}){super(),this['id']=_0x3b3c60||ot(),this['interactionId']=_0x388ff1,this['type']=_0x2d6689,this['areActionsDisabled']=!!_0x3672d0,this['locale']=_0x43aa66,this['dataIdDocumentSources']=_0xcf2135,this['documentId']=_0x3b0e78,this['isFromHistory']=_0x414d19,this['aiResponseParser']=new bs(),this['aiResponseApplier']=new Ss(),this['documentContextContent']=_s(_0x325c11||''),this['set']('isDone',_0x9a9ee1),this['set']('isComplete',_0xa9cbd2??_0x9a9ee1),this['on']('change:content',()=>{this['onContentChange']();}),this['set']('content',_0x136619);}['appendContent'](_0x5f4e7f){this['set']('content',this['content']+_0x5f4e7f);}['done'](_0x57a613=!0x0){this['isComplete']=_0x57a613,this['isDone']||(this['set']('isDone',!0x0),this['onContentChange']());}['destroy'](){this['stopListening']();}['setChangeGroupState'](_0x5ac6c5,_0x5cc742){this['changeGroups'][_0x5ac6c5]['state']=_0x5cc742,this['fire']('replyChangeGroupStateUpdated',{'reply':this,'index':_0x5ac6c5,'state':_0x5cc742});}['getContentParts']({showDiff:_0x126122,groupIndex:_0x38c6ac,editor:_0x225dc1}){const _0x1b7d4c=this['_getCachedContentParts'](_0x126122,_0x38c6ac);if(_0x1b7d4c)return _0x1b7d4c;let _0x3fe53c=[];if(void 0x0===_0x38c6ac)_0x3fe53c=this['changeGroups'];else{const _0x2dd01c=this['changeGroups']['find'](({index:_0x30a40c})=>_0x30a40c===_0x38c6ac);if(!_0x2dd01c)throw new at('ai-reply-get-content-parts-group-not-found',null,{'aiReply':this,'groupIndex':_0x38c6ac});_0x3fe53c=[_0x2dd01c];}const _0xef6af2=Rs({'editor':_0x225dc1,'showDiff':_0x126122,'changeGroups':_0x3fe53c,'documentContextContent':this['documentContextContent']});return this['_setCachedContentParts'](_0x126122,_0xef6af2),_0xef6af2;}['_getCachedContentParts'](_0x1ba2da,_0x37c87){const _0x400a6a=_0x1ba2da?'withDiff':'withoutDiff';if(!this['cachedSuggestionContentParts'][_0x400a6a]['length'])return null;const _0x11854b=this['cachedSuggestionContentParts'][_0x400a6a];if(void 0x0===_0x37c87)return _0x11854b['length']>0x0&&_0x11854b['length']!==this['changeGroups']['length']?(this['_setCachedContentParts'](_0x1ba2da,null),null):_0x5c8906(_0x11854b);{const _0x12258f=_0x11854b['find'](({index:_0x13d788})=>_0x13d788===_0x37c87);if(_0x12258f)return[_0x5c8906(_0x12258f)];}return null;}['_setCachedContentParts'](_0xbc542f,_0x59a6f6){const _0x5b8f6a=_0xbc542f?'withDiff':'withoutDiff';_0x59a6f6?_0x59a6f6['forEach'](_0x4e83f3=>{const _0x13eec0=this['cachedSuggestionContentParts'][_0x5b8f6a],_0x543282=_0x13eec0['find'](({index:_0x34cde8})=>_0x34cde8===_0x4e83f3['index']);if(_0x543282){const _0x2f6163=_0x13eec0['indexOf'](_0x543282);_0x13eec0['splice'](_0x2f6163,0x1,_0x4e83f3);}else _0x13eec0['push'](_0x4e83f3);}):this['cachedSuggestionContentParts'][_0x5b8f6a]['length']=0x0;}['onContentChange'](){if('modification'===this['type']){this['parsedContent']=this['aiResponseParser']['parseAndNormalizeHTML'](this['content']);const _0x40bc07=this['changeGroups'];this['updateChangeGroups']();const _0x2b7c73=this['_getDifferentChangeGroups'](_0x40bc07,this['changeGroups']);(_0x2b7c73['length']||this['isDone'])&&(this['fire']('replyContentUpdated',this,_0x2b7c73),this['cachedSuggestionContentParts']['withDiff']['length']=this['cachedSuggestionContentParts']['withoutDiff']['length']=0x0);}else this['parsedContent']=this['aiResponseParser']['convertMarkdownToHTML'](this['content']),this['fire']('replyContentUpdated',this);}['_getDifferentChangeGroups'](_0xada362,_0x25d186){const _0x24d316=[];for(const _0x5a4adf of _0x25d186){const _0x1ce177=_0xada362[_0x5a4adf['index']];_0x1ce177?_0x1ce177['changes']['length']!==_0x5a4adf['changes']['length']?_0x24d316['push'](_0x5a4adf):_0x1ce177['changes']['forEach']((_0x2b054a,_0x59e253)=>{const _0x455f70=_0x5a4adf['changes'][_0x59e253];_0x2b054a['id']!==_0x455f70['id']&&_0x24d316['push'](_0x5a4adf);}):_0x24d316['push'](_0x5a4adf);}return _0x24d316;}['updateChangeGroups'](){const _0x35f6e6=this['locale']?new _0xae4b38('p',{},[new _0xae4b38('span',{'style':'color:\x20#808080;\x20font-style:\x20italic'},[new _0x303276(hs(this['locale'],'AI_SUGGESTION_CONTENT_PART_REMOVED'))])]):void 0x0,_0x1338a0=this['aiResponseApplier']['merge'](this['parsedContent'],this['documentContextContent']['cloneNode'](!0x0),{'markUnstableElements':!this['isDone']||!this['isComplete'],'replaceRemovedWith':_0x35f6e6,'cutAfterLastChange':!this['isDone']||!this['isComplete']});if(!_0x1338a0['modifiedNodeIds']['length']&&!this['isDone'])return;this['parsedMergedContent']=_0x1338a0['parsedContent'],this['newNodeAnchorIds']=_0x1338a0['newAnchorIds'];let _0x36ea3e=[];if(_0x58b8d1(_0x2b973e=>{const _0x3337c4=Es(_0x2b973e,'data-id');if(!_0x3337c4||!_0x32c865(_0x3337c4))return!0x1;const _0x5376ba=[_0x2b973e,...Ts(_0x2b973e)]['at'](-0x2);if(_0x2b973e!=_0x5376ba){const _0x22014f=Es(_0x5376ba,'data-id');_0x32c865(_0x22014f)||(_0x36ea3e['push']({'node':_0x5376ba,'id':_0x22014f,'type':'modified'}),_0x1338a0['modifiedNodeIds']['push'](_0x22014f));}else _0x1338a0['modifiedNodeIds']['includes'](_0x3337c4)?_0x36ea3e['push']({'node':_0x2b973e,'type':'modified','id':_0x3337c4}):_0x1338a0['newNodeIds']['includes'](_0x3337c4)?_0x36ea3e['push']({'node':_0x2b973e,'type':'new','id':_0x3337c4,'anchorId':Es(_0x2b973e['previousSibling'],'data-id')}):_0x36ea3e['push']({'node':_0x2b973e,'type':'removed','id':_0x3337c4});return!0x0;},this['parsedMergedContent']),_0x36ea3e=_0x36ea3e['filter'](({node:_0x4c0a79})=>[...Ts(_0x4c0a79),_0x4c0a79]['every'](_0x7322c1=>!Es(_0x7322c1,'data-unstable'))),0x0==_0x36ea3e['length'])return;const _0x1e63df=[[_0x36ea3e[0x0]]];for(let _0x51b79b=0x1;_0x51b79b<_0x36ea3e['length'];_0x51b79b++){const _0x32eda0=_0x1e63df[_0x1e63df['length']-0x1],_0x22a25d=_0x32eda0[_0x32eda0['length']-0x1];_0x36ea3e[_0x51b79b]['node']['previousSibling']==_0x22a25d['node']&&'modified'!=_0x36ea3e[_0x51b79b]['type']&&'modified'!=_0x22a25d['type']&&this['_isSameDocument'](_0x36ea3e[_0x51b79b]['node'],_0x22a25d['node'])?_0x32eda0['push'](_0x36ea3e[_0x51b79b]):_0x1e63df['push']([_0x36ea3e[_0x51b79b]]);}for(const _0x4c0383 of _0x1e63df){const _0x4f9e97=_0x4c0383[0x0],_0x330f38=_0x4c0383[_0x4c0383['length']-0x1],_0x56d497=_0x1c6f98(_0x4f9e97['node']['previousSibling']);_0x56d497&&this['_isSameDocument'](_0x56d497['node'],_0x4f9e97['node'])&&_0x4c0383['unshift'](_0x56d497);const _0x4ac471=_0x1c6f98(_0x330f38['node']['nextSibling']);_0x4ac471&&this['_isSameDocument'](_0x4ac471['node'],_0x330f38['node'])&&_0x4c0383['push'](_0x4ac471);}function _0x32c865(_0x11eef6){return _0x1338a0['modifiedNodeIds']['includes'](_0x11eef6)||_0x1338a0['newNodeIds']['includes'](_0x11eef6)||_0x1338a0['removedNodeIds']['includes'](_0x11eef6);}function _0x1c6f98(_0x30c041){if(_0x30c041&&Es(_0x30c041,'data-id')&&!Es(_0x30c041,'data-unstable')){const _0x4c89d0=Es(_0x30c041,'data-id');if(!_0x32c865(_0x4c89d0))return{'node':_0x30c041,'type':'context','id':_0x4c89d0};}return null;}this['changeGroups']=_0x1e63df['map']((_0x38c2ad,_0x2e5ef6)=>({'changes':_0x38c2ad,'state':'pending','index':_0x2e5ef6}));}['_isSameDocument'](_0x4dd69b,_0x3137a8){if(!this['dataIdDocumentSources']?.['size'])return!0x0;const _0x2cb91f=this['_resolveDocumentSource'](_0x4dd69b),_0x29c91e=this['_resolveDocumentSource'](_0x3137a8);return!_0x2cb91f||!_0x29c91e||_0x2cb91f['editor']===_0x29c91e['editor']&&_0x2cb91f['rootName']===_0x29c91e['rootName'];}['_resolveDocumentSource'](_0x49d091){if(!_0x49d091||!this['dataIdDocumentSources'])return;const _0x12a2ec=Es(_0x49d091,'data-id');if(_0x12a2ec){const _0x6e48da=this['dataIdDocumentSources']['get'](_0x12a2ec);if(_0x6e48da)return _0x6e48da;const _0x12938d=this['newNodeAnchorIds']['get'](_0x12a2ec),_0x239b68=_0x12938d?this['dataIdDocumentSources']['get'](_0x12938d):void 0x0;if(_0x239b68)return _0x239b68;}for(let _0x249f88=_0x49d091['previousSibling'];_0x249f88;_0x249f88=_0x249f88['previousSibling']){const _0x40a722=Es(_0x249f88,'data-id'),_0x50f718=_0x40a722?this['dataIdDocumentSources']['get'](_0x40a722):void 0x0;if(_0x50f718)return _0x50f718;}for(let _0x1e9292=_0x49d091['nextSibling'];_0x1e9292;_0x1e9292=_0x1e9292['nextSibling']){const _0x97e04c=Es(_0x1e9292,'data-id'),_0x399f6c=_0x97e04c?this['dataIdDocumentSources']['get'](_0x97e04c):void 0x0;if(_0x399f6c)return _0x399f6c;}}}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:_0x25e3ee,locale:_0xbb556a}){super(),this['id']=ot(),this['connector']=_0x25e3ee,this['isStopped']=!0x0,this['locale']=_0xbb556a;}async['start'](){const _0x2dcd98=[];let _0x149369,_0xa70b13,_0x19036e,_0x5165c5=!0x1;this['isStopped']=!0x1;try{this['currentRequest']=await this['sendRequest'](),this['fire']('interactionStarted',this);const _0x24875b=await this['currentRequest']['getStream']();for await(const _0x59c4df of _0x24875b){if(this['isStopped'])return;if('error'==_0x59c4df['event'])return void this['fire']('error',{'error':new at('ai-chat-interaction-error',this)});switch(_0x59c4df['event']){case'message-metadata':this['messageId']=_0x59c4df['data']['messageId'];break;case'action-metadata':this['actionCallId']=_0x59c4df['data']['callId'];break;case'conversation-title':this['setConversationTitle'](_0x59c4df['data']['conversationTitle'],!0x0);break;case'source':_0x2dcd98['push'](_0x59c4df['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'](),_0x149369='modification-delta'==_0x59c4df['event']?'modification':'text',_0xa70b13='modification-delta'==_0x59c4df['event']?_0x59c4df['data']['id']:void 0x0,this['currentReply']&&this['currentReply']['type']!=_0x149369&&(this['currentReply']['done'](),this['currentReply']=void 0x0),this['currentReply']?'modification-delta'==_0x59c4df['event']&&(this['currentReply']['documentId']=_0x59c4df['data']['documentId']):(this['currentReply']=this['createReply']({'type':_0x149369,'interactionId':this['id'],'id':_0xa70b13,...'modification-delta'==_0x59c4df['event']&&{'documentId':_0x59c4df['data']['documentId']}}),'modification'==_0x149369&&(this['currentReply']['sources']=_0x2dcd98['splice'](0x0))),this['currentReply']['appendContent'](_0x59c4df['data']['textDelta']);break;case'mcp-tool-result':_0x19036e=JSON['parse'](_0x59c4df['data']['result']),this['_handleToolResultData']({'toolName':_0x59c4df['data']['toolName'],'data':_0x19036e['data'],'attributes':_0x19036e['attributes']});break;case'mcp-tool-notification':this['_handleToolNotificationData']({'toolName':_0x59c4df['data']['toolName'],'data':_0x59c4df['data']['data']});}}_0x5165c5=!0x0;}finally{this['isStopped']||(this['currentReply']&&_0x2dcd98['length']>0x0&&(this['currentReply']['sources']=_0x2dcd98['splice'](0x0)),this['_finalizeInteraction'](_0x5165c5),this['fire']('interactionFinished',this));}}['stop'](){this['isStopped']||(this['_finalizeInteraction'](),this['fire']('interactionStopped',this));}['getReply'](_0x235b6f){return this['replies']['find'](_0x1e1112=>_0x1e1112['id']===_0x235b6f);}['destroy'](){this['isDestroyed']||(this['stop'](),this['replies']['forEach'](_0x206311=>_0x206311['destroy']()),this['replies']=[],this['isDestroyed']=!0x0,this['fire']('interactionDestroyed',this),this['stopListening']());}['createReply'](_0x31f880){const _0x212821=new xs({'locale':this['locale'],'documentContextContent':this['getDocumentContext']()?.['content'],'dataIdDocumentSources':this['getDocumentContext']()?.['dataIdDocumentSources'],..._0x31f880});return this['replies']['push'](_0x212821),_0x212821['delegate'](...Ls)['to'](this),this['fire']('replyCreated',_0x212821),_0x212821;}['setConversationTitle'](_0x4a8c62,_0x1ff87e=!0x1){this['fire']('setConversationTitle',_0x4a8c62,_0x1ff87e);}['resetWebSearchState'](){this['_isWebSearching']&&(this['_isWebSearching']=!0x1,this['fire']('webSearchFinished',this));}['resetReasoningState'](){this['_isReasoning']&&(this['_isReasoning']=!0x1,this['fire']('reasoningFinished',this));}['_handleToolResultData'](_0x5b12e3){this['fire']('toolDataReceived',{'type':'result','toolName':_0x5b12e3['toolName'],'data':structuredClone(_0x5b12e3['data']||{}),'attributes':structuredClone(_0x5b12e3['attributes']||{})},this);}['_handleToolNotificationData'](_0x14c0c1){this['fire']('toolDataReceived',{'type':'notification','toolName':_0x14c0c1['toolName'],'data':structuredClone(_0x14c0c1['data'])},this);}['_finalizeInteraction'](_0x2cb84b=!0x1){this['isStopped']=!0x0,this['currentRequest']&&this['currentRequest']['abortController']['abort'](),this['currentReply']&&this['currentReply']['done'](_0x2cb84b),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:_0x5bdf81,config:_0x11d409,ownerId:_0x58871b}){super(),this['_connector']=_0x5bdf81,this['_config']=_0x11d409,this['_ownerId']=_0x58871b;}['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'](_0x4ed0a5){if(_0x4ed0a5)return this['_documentSources']['get'](_0x4ed0a5);}['getSourceByDataId'](_0x2686b3){if(_0x2686b3)return this['_dataIdToSource']['get'](_0x2686b3);}['_getDocumentContextSlice'](_0x20e541){const _0x194371=this['_getDocumentSource'](_0x20e541);if(_0x194371)return{'editor':_0x194371['editor'],'rootName':_0x194371['rootName'],'html':_0x194371['content'],'version':_0x194371['version']};}['getDocumentContextSliceByDataId'](_0x53f669){const _0x36fc3d=this['getSourceByDataId'](_0x53f669);return _0x36fc3d?this['_getDocumentContextSlice'](_0x36fc3d['documentId']):void 0x0;}['getPendingContextItems'](){return this['_pendingContextItems'];}async['populateFromMessage'](_0x536190){const _0x343800=await this['_createContextItemFromContent'](_0x536190);return this['_addToConversationContextItem'](_0x343800),'current-document'===_0x343800['uiId']&&this['_toggleAddCurrentDocumentOptionVisibility'](),_0x343800;}async['populateDocumentsFromMessage'](_0x45c86a,_0x4bdd6c){const _0xb9feb5=_0x45c86a['filter'](_0x6a8219=>'document'===_0x6a8219['type']);if(0x0===_0xb9feb5['length'])return{'hasUnmatched':!0x1};if(0x1===_0xb9feb5['length'])return{'contextItem':await this['populateFromMessage'](_0xb9feb5[0x0]),'hasUnmatched':!0x1};const _0xd3ab20=_0xb9feb5['map'](_0x2f7720=>_0x2f7720['id']),_0x4b6df4=await this['_connector']['fetchDocuments'](this['_ownerId'],_0xd3ab20)['getDocuments'](),_0x3b857f=new Map(_0x4b6df4['map'](_0x2e47be=>[_0x2e47be['id'],_0x2e47be]));this['_documentSources']['clear'](),this['_dataIdToSource']['clear']();const _0x4fa02f=[];let _0x4f412d=!0x1;for(const _0x32f63a of _0xb9feb5){const _0x550946=_0x3b857f['get'](_0x32f63a['id']);if(!_0x550946)continue;const _0x13bbae=this['_matchDocumentToRoot'](_0x550946,_0x4bdd6c),_0x20a283=_0x4bdd6c[0x0]&&this['_getFirstRoot'](_0x4bdd6c[0x0]);_0x13bbae||(_0x4f412d=!0x0);const _0x55da94=_0x13bbae?.['editor']??_0x20a283?.['editor'],_0x5c4bd0=_0x13bbae?.['rootName']??_0x20a283?.['rootName'];if(_0x55da94&&_0x5c4bd0){const _0x390e16={'editor':_0x55da94,'rootName':_0x5c4bd0,'content':_0x550946['content'],'version':_0x550946['attributes']?.['version']??0x0,'name':_0x550946['name'],'description':_0x550946['description']};this['_documentSources']['set'](_0x550946['id'],_0x390e16);const _0x503208=_s(_0x550946['content']);for(const _0x34f991 of _0x58b8d1(_0x91faec=>!!Es(_0x91faec,'data-id'),_0x503208)){const _0x56df3a=Es(_0x34f991,'data-id');_0x56df3a&&this['_dataIdToSource']['set'](_0x56df3a,{..._0x390e16,'documentId':_0x550946['id']});}}_0x4fa02f['push']({'id':_0x550946['id'],'content':_0x550946['content'],'version':_0x550946['attributes']?.['version']??0x0,'sessionId':_0x550946['attributes']?.['sessionId']??null,'selection':[]});}const _0x3d2d6c={'id':'current-document','uiId':'current-document','label':'Current\x20document','type':'document','hidden':this['_conversationContextItems']['has']('current-document'),'documents':_0x4fa02f,'dataIdDocumentSources':new Map(this['_dataIdToSource'])};return this['_addToConversationContextItem'](_0x3d2d6c),this['_toggleAddCurrentDocumentOptionVisibility'](),{'contextItem':_0x3d2d6c,'hasUnmatched':_0x4f412d};}['_matchDocumentToRoot'](_0x2932d5,_0x209287){const _0x100942=_0x2932d5['attributes']?.['channelId'],_0x4cfea4=_0x2932d5['attributes']?.['rootName'];if(_0x100942&&_0x4cfea4){for(const _0x238239 of _0x209287)if(_0x238239['config']['get']('collaboration.channelId')===_0x100942){for(const _0x431452 of _0x238239['model']['document']['getRoots']())if('$graveyard'!==_0x431452['rootName']&&_0x431452['rootName']===_0x4cfea4)return{'editor':_0x238239,'rootName':_0x431452['rootName']};}}}['_getFirstRoot'](_0x100a53){for(const _0x2d4d08 of _0x100a53['model']['document']['getRoots']())if('$graveyard'!==_0x2d4d08['rootName'])return{'editor':_0x100a53,'rootName':_0x2d4d08['rootName']};}async['_createContextItemFromContent'](_0xe29d0){if('document'===_0xe29d0['type']){const _0x409cd3=await this['_connector']['fetchDocument'](this['_ownerId'],_0xe29d0['id'])['getDocument']();return{'id':'current-document','uiId':'current-document','label':'Current\x20document','type':_0xe29d0['type'],'content':_0x409cd3['content'],'hidden':this['_conversationContextItems']['has']('current-document'),'version':_0x409cd3['attributes']?.['version'],'sessionId':_0x409cd3['attributes']?.['sessionId']};}if('mcp-tool-context'===_0xe29d0['type'])return{'id':_0xe29d0['id'],'uiId':_0xe29d0['id'],'label':_0xe29d0['data']?.['label']||_0xe29d0['id'],'type':'mcp-tool-context','mcpServerName':_0xe29d0['mcpServerName'],'toolName':_0xe29d0['toolName'],'data':_0xe29d0['data']||{}};return{'id':_0xe29d0['id'],'uiId':_0xe29d0['id'],'label':_0xe29d0['attributes']?.['label']||_0xe29d0['name']||_0xe29d0['url']||_0xe29d0['id'],'type':_0xe29d0['type'],..._0xe29d0?.['attributes']?.['resourceId']?{'resourceId':_0xe29d0['attributes']?.['resourceId']}:{}};}['getSentContextItems'](){return new Map(this['_conversationContextItems']);}['removeFromContext'](_0x576a6d){const _0x465630=this['_pendingContextItems']['get'](_0x576a6d);_0x465630?.['isReadOnly']||this['_removeContextItem'](_0x576a6d);}['clearPendingContextItems'](){if(0x0===this['_pendingContextItems']['size'])return;for(const _0x3ca6f7 of this['_pendingContextItems']['values']())this['_removeContextItem'](_0x3ca6f7['uiId']);const _0x4cfca6=this['_conversationContextItems']['get']('current-document')||this['_pendingContextItems']['get']('current-document');_0x4cfca6&&this['_addContextItem']({..._0x4cfca6,'isReadOnly':!0x0,'hidden':!0x0});}['addToConversationContext'](_0x2809e9){for(const _0x15ee06 of _0x2809e9['values']())this['_addToConversationContextItem'](_0x15ee06);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'](_0x2f1418){return Array['from'](_0x2f1418['values']())['flatMap'](_0x1dbd97=>this['_mapContextItemToRequestData'](_0x1dbd97));}async['addFilesToContext'](_0x18a8c8,_0x18e432,_0x490c36='file'){const _0x3ba4dc='files-'+ot();this['_startUploadOperation'](_0x3ba4dc);try{await Promise['all'](_0x18a8c8['map'](async _0x5c10f8=>{const _0x14acbf='file-'+ot(),_0x21005d=_0x5131f5(_0x5c10f8['name']);try{this['_addContextItem']({'type':_0x490c36,'label':_0x18e432?.['label']||_0x21005d,'uiId':_0x14acbf,'resourceId':_0x18e432?.['resourceId']},!0x0);const _0x262366=this['_connector']['uploadFile'](this['_ownerId'],_0x5c10f8,_0x18e432);this['_ongoingUploads']['set'](_0x14acbf,_0x262366['abortController']);const {id:_0x5bdb2e}=await _0x262366['getId']();this['_ongoingUploads']['delete'](_0x14acbf),this['_finishContextItemLoading']({'type':_0x490c36,'id':_0x5bdb2e,'label':_0x18e432?.['label']||_0x21005d,'uiId':_0x14acbf,'resourceId':_0x18e432?.['resourceId']},!0x1);}catch(_0x27d73e){this['_ongoingUploads']['delete'](_0x14acbf);if(!(_0x27d73e instanceof at&&_0x27d73e['message']['startsWith']('ai-request-aborted'))){const _0x9d076f=Ps['get'](_0x27d73e['code'])||'ai-chat-file-upload-failed',_0x116ad9=new at(_0x9d076f,null,{'fileName':_0x21005d,..._0x27d73e});_0x116ad9['stack']=_0x27d73e['stack'],this['fire']('error',{'error':_0x116ad9});}this['_removeContextItem'](_0x14acbf);}}));}finally{this['_finishUploadOperation'](_0x3ba4dc);}}['addCurrentDocumentToContext'](_0x5d21f1){if(this['isCurrentDocumentInContext']()||!this['_addContextOptionsState']['document']['enabled'])return;const _0x4cd386={'type':'document','uiId':'current-document','label':_0x5d21f1,'isReadOnly':this['_conversationContextItems']['has']('current-document'),'hidden':this['_conversationContextItems']['has']('current-document')};this['_addContextItem'](_0x4cd386);}async['updateCurrentDocument'](_0x46833f,_0x512229,_0x2272ac,_0x4d3631,_0x2f1f8d,_0x29c2be){const _0x2d2d25=this['_pendingContextItems']['get']('current-document');if(_0x2d2d25&&_0x46833f){_0x2d2d25['selection']=_0x29c2be?_0x29c2be['map'](_0x2dd2f2=>({'start':_0x2dd2f2['start'],'end':_0x2dd2f2['end']})):[];try{if(_0x2d2d25['version']===_0x512229)return;const {id:_0x2eb0df}=await this['_connector']['uploadDocument'](this['_ownerId'],_0x46833f,{'version':_0x512229,'sessionId':_0x2272ac,'channelId':_0x4d3631,'rootName':_0x2f1f8d})['getId']();_0x2d2d25['id']=_0x2eb0df,_0x2d2d25['content']=_0x46833f,_0x2d2d25['version']=_0x512229,_0x2d2d25['sessionId']=_0x2272ac;}catch(_0x9b0811){const _0x49be58=new at('ai-chat-document-upload-failed',null);_0x49be58['stack']=_0x9b0811['stack'],this['fire']('error',{'error':_0x49be58});}}}async['updateCurrentDocuments'](_0x1c8e13){const _0x36f483=this['_pendingContextItems']['get']('current-document');if(!_0x36f483||!_0x1c8e13['length']||_0x1c8e13['every'](_0x3a6730=>!_0x3a6730['content']))return;_0x1c8e13['length']>0x1&&_0x1c8e13['some'](_0x1735c9=>!_0x1735c9['description'])&&It('ai-chat-documents-missing-description');const _0x3c522a=_0x336005=>_0x336005?_0x336005['map'](_0x18134a=>({'start':_0x18134a['start'],'end':_0x18134a['end']})):[],_0xd48ef9=_0x36f483['documents']??[];if(_0xd48ef9['length']===_0x1c8e13['length']&&_0x1c8e13['every']((_0x3ce3a5,_0x1e1831)=>_0xd48ef9[_0x1e1831]?.['version']===_0x3ce3a5['version']))_0x36f483['documents']=_0xd48ef9['map']((_0x5bfccd,_0x275023)=>({..._0x5bfccd,'selection':_0x3c522a(_0x1c8e13[_0x275023]['selections'])}));else try{const _0x149ff9=await this['_connector']['uploadDocuments'](this['_ownerId'],_0x1c8e13)['getIds']();_0x36f483['documents']=_0x1c8e13['map']((_0x2877c8,_0x5cb3bc)=>({'id':_0x149ff9[_0x5cb3bc]?.['id'],'content':_0x2877c8['content'],'version':_0x2877c8['version'],'sessionId':_0x2877c8['sessionId'],'selection':_0x3c522a(_0x2877c8['selections'])})),this['_documentSources']['clear'](),this['_dataIdToSource']['clear']();for(let _0x9d51c8=0x0;_0x9d51c8<_0x1c8e13['length'];_0x9d51c8++){const _0xfb471f=_0x149ff9[_0x9d51c8]?.['id'],_0x2e1384=_0x1c8e13[_0x9d51c8];if(!_0xfb471f)continue;const _0x4b0784={'editor':_0x2e1384['editor'],'rootName':_0x2e1384['rootName'],'content':_0x2e1384['content'],'version':_0x2e1384['version'],'name':_0x2e1384['name'],'description':_0x2e1384['description']};this['_documentSources']['set'](_0xfb471f,_0x4b0784);const _0x13a9ea=_s(_0x2e1384['content']);for(const _0x1cfbae of _0x58b8d1(_0x4086ea=>!!Es(_0x4086ea,'data-id'),_0x13a9ea)){const _0x233c72=Es(_0x1cfbae,'data-id');_0x233c72&&this['_dataIdToSource']['set'](_0x233c72,{..._0x4b0784,'documentId':_0xfb471f});}}_0x36f483['dataIdDocumentSources']=new Map(this['_dataIdToSource']);}catch(_0x58b036){const _0x29f816=new at('ai-chat-document-upload-failed',null);_0x29f816['stack']=_0x58b036['stack'],this['fire']('error',{'error':_0x29f816});}}['addSelectionToContext'](_0x32710e){this['_addContextItem']({'type':'selection','label':_0x32710e,'uiId':'selection','content':_0x32710e});}['removeSelectionFromContext'](){this['_removeContextItem']('selection');}async['addUrlToContext'](_0x56db5c,_0x10e027){const _0x38902f='url-'+ot();this['_startUploadOperation'](_0x38902f);const _0x1043e3='url-'+ot();try{this['_addContextItem']({'type':'web-resource','label':_0x10e027?.['label']||_0x56db5c,'uiId':_0x1043e3,'resourceId':_0x10e027?.['resourceId']},!0x0);const _0x416673=this['_connector']['uploadUrl'](this['_ownerId'],_0x56db5c,_0x10e027);this['_ongoingUploads']['set'](_0x1043e3,_0x416673['abortController']);const {id:_0x145eaa}=await _0x416673['getId']();this['_ongoingUploads']['delete'](_0x1043e3),this['_finishContextItemLoading']({'type':'web-resource','id':_0x145eaa,'label':_0x10e027?.['label']||_0x56db5c,'uiId':_0x1043e3,'resourceId':_0x10e027?.['resourceId']},!0x1);}catch(_0x3aa0b7){this['_ongoingUploads']['delete'](_0x1043e3),(_0x3aa0b7['message']['startsWith']('ai-request-aborted')||this['fire']('error',{'error':new at('ai-chat-url-upload-failed',this,{'url':_0x56db5c,'originalError':_0x3aa0b7}),'url':_0x56db5c}),this['_removeContextItem'](_0x1043e3));}finally{this['_finishUploadOperation'](_0x38902f);}}['addToolItemToContext'](_0x33a518){_0x33a518['id']=_0x33a518['id']??ot()['substring'](0x0,0x15),this['_pendingContextItems']['set'](_0x33a518['uiId'],_0x33a518),this['fire']('contextItemAdded',{'contextItem':_0x33a518,'isLoading':!0x1});}async['loadSourceResources'](_0x12dc16,_0x29acc1,_0x171881){const _0x3ba21d=this['_addContextOptionsState']['sources']['find'](_0x1374a3=>_0x1374a3['id']===_0x12dc16);if(!_0x3ba21d)return this['fire']('error',{'error':new at('ai-chat-source-not-found',this,{'sourceId':_0x12dc16}),'sourceId':_0x12dc16}),[];try{const _0x2be684=(await _0x3ba21d['getResources'](_0x29acc1))['map'](_0x37b8d3=>{const _0x268b5b=this['_isResourceInContext'](_0x37b8d3['id']);return{..._0x37b8d3,'isInContext':_0x268b5b};});return _0x3ba21d['resources']=_0x2be684,this['fire']('sourceResourcesLoaded',{'sourceId':_0x12dc16,'source':_0x3ba21d,'resources':_0x2be684,'uid':_0x171881}),_0x2be684;}catch(_0x2fd1ee){return this['fire']('error',{'error':new at('ai-chat-source-resources-load-failed',this,{'sourceId':_0x12dc16,'originalError':_0x2fd1ee}),'sourceId':_0x12dc16,'sourceLabel':_0x3ba21d['label']}),[];}}async['addResourceToContext'](_0x1a6d3d,_0x2881c6){if(this['_isResourceInContext'](_0x2881c6['id']))return;let _0x3203ef=_0x2881c6['data'];if(!_0x3203ef&&_0x1a6d3d['getData'])try{_0x3203ef=await _0x1a6d3d['getData'](_0x2881c6['id']);}catch(_0xc009d3){return void this['fire']('error',{'error':new at('ai-chat-resource-load-failed',this,{'resourceId':_0x2881c6['id'],'sourceId':_0x1a6d3d['id'],'originalError':_0xc009d3}),'resourceId':_0x2881c6['id'],'sourceId':_0x1a6d3d['id']});}if(_0x3203ef)switch(_0x2881c6['type']){case'web-resource':if('string'!=typeof _0x3203ef)return void this['fire']('error',{'error':new at('ai-chat-context-invalid-data',this,{'resourceId':_0x2881c6['id'],'sourceId':_0x1a6d3d['id'],'expectedType':'string','actualType':typeof _0x3203ef}),'resourceId':_0x2881c6['id'],'sourceId':_0x1a6d3d['id']});await this['addUrlToContext'](_0x3203ef,{'label':_0x2881c6['label'],'resourceId':_0x2881c6['id']});break;case'file':if(!(_0x3203ef instanceof File))return void this['fire']('error',{'error':new at('ai-chat-context-invalid-data',this,{'resourceId':_0x2881c6['id'],'sourceId':_0x1a6d3d['id'],'expectedType':'File','actualType':typeof _0x3203ef}),'resourceId':_0x2881c6['id'],'sourceId':_0x1a6d3d['id']});await this['addFilesToContext']([_0x3203ef],{'label':_0x2881c6['label'],'resourceId':_0x2881c6['id']});break;case'text':if('object'!=typeof _0x3203ef||!('content'in _0x3203ef)||!('type'in _0x3203ef))return void this['fire']('error',{'error':new at('ai-chat-context-invalid-data',this,{'resourceId':_0x2881c6['id'],'sourceId':_0x1a6d3d['id'],'expectedType':'object\x20with\x20content\x20and\x20type\x20properties','actualType':typeof _0x3203ef}),'resourceId':_0x2881c6['id'],'sourceId':_0x1a6d3d['id']});_0x3203ef=Ms['_convertTextResourceToFile'](_0x3203ef,_0x2881c6['label']),await this['addFilesToContext']([_0x3203ef],{'label':_0x2881c6['label'],'resourceId':_0x2881c6['id']},'text');break;case'mcp-tool-context':break;default:this['fire']('error',{'error':new at('ai-chat-context-unsupported-type',this,{'resourceId':_0x2881c6['id'],'sourceId':_0x1a6d3d['id'],'resourceType':_0x2881c6['type']}),'resourceId':_0x2881c6['id'],'sourceId':_0x1a6d3d['id']});}else this['fire']('error',{'error':new at('ai-chat-resource-no-data',this,{'resourceId':_0x2881c6['id'],'sourceId':_0x1a6d3d['id']}),'resourceId':_0x2881c6['id'],'sourceId':_0x1a6d3d['id']});}static['_convertTextResourceToFile'](_0x148d10,_0x212d3f){switch(_0x148d10['type']){case'markdown':return new File([_0x148d10['content']],_0x212d3f,{'type':'text/markdown'});case'html':return new File([_0x148d10['content']],_0x212d3f,{'type':'text/html'});default:return new File([_0x148d10['content']],_0x212d3f,{'type':'text/plain'});}}static['_mapContextItemToRequestData'](_0x4e1bdf){switch(_0x4e1bdf['type']){case'file':case'text':return[{'type':'file','id':_0x4e1bdf['id']}];case'web-resource':return[{'type':'web-resource','id':_0x4e1bdf['id']}];case'document':return _0x4e1bdf['documents']?.['length']?_0x4e1bdf['documents']['map'](_0x18d8dd=>({'type':'document','id':_0x18d8dd['id'],..._0x18d8dd['selection']?.['length']&&{'selection':_0x18d8dd['selection']}})):[{'type':'document','id':_0x4e1bdf['id'],..._0x4e1bdf['selection']?.['length']&&{'selection':_0x4e1bdf['selection']}}];case'mcp-tool-context':{const _0x4e116f=_0x4e1bdf;return[{'type':'mcp-tool-context','mcpServerName':_0x4e116f['mcpServerName'],'toolName':_0x4e116f['toolName'],'data':{..._0x4e116f['data'],'label':_0x4e116f['label']||_0x4e116f['data']?.['label']||_0x4e116f['id']},'id':_0x4e116f['id']}];}default:return[];}}['_addContextItem'](_0x3c393a,_0x44399d=!0x1){if(this['_pendingContextItems']['set'](_0x3c393a['uiId'],_0x3c393a),_0x3c393a['hidden']||this['fire']('contextItemAdded',{'contextItem':_0x3c393a,'isLoading':_0x44399d}),'current-document'===_0x3c393a['uiId']&&this['_toggleAddCurrentDocumentOptionVisibility'](),_0x3c393a['resourceId']){const _0x2425aa=this['_findSourceIdsByResourceId'](_0x3c393a['resourceId']);_0x2425aa&&_0x2425aa['forEach'](_0x304154=>{this['_updateResourceInContextState'](_0x304154,_0x3c393a['resourceId'],!0x0);});}}['_removeContextItem'](_0x1367b4){const _0x3bdd0a=this['_pendingContextItems']['get'](_0x1367b4),_0x164096=this['_ongoingUploads']['get'](_0x1367b4);if(_0x164096&&(_0x164096['abort'](),this['_ongoingUploads']['delete'](_0x1367b4)),_0x3bdd0a?.['resourceId']){const _0x13642f=this['_findSourceIdsByResourceId'](_0x3bdd0a['resourceId']);_0x13642f&&_0x13642f['forEach'](_0x58f2fb=>{this['_updateResourceInContextState'](_0x58f2fb,_0x3bdd0a['resourceId'],!0x1);});}this['_pendingContextItems']['delete'](_0x1367b4),this['fire']('contextItemRemoved',{'uiId':_0x1367b4,'type':_0x3bdd0a?.['type']}),'current-document'===_0x1367b4&&this['_toggleAddCurrentDocumentOptionVisibility']();}['_finishContextItemLoading'](_0x338b07,_0x444d07){if(this['_pendingContextItems']['has'](_0x338b07['uiId'])&&(this['_pendingContextItems']['set'](_0x338b07['uiId'],_0x338b07),this['fire']('contextItemLoadingEnded',{'contextItem':_0x338b07,'isLoading':_0x444d07}),_0x338b07['resourceId'])){const _0x481152=this['_findSourceIdsByResourceId'](_0x338b07['resourceId']);_0x481152&&_0x481152['forEach'](_0xc9f5ae=>{this['_updateResourceInContextState'](_0xc9f5ae,_0x338b07['resourceId'],!0x0);});}}['_addToConversationContextItem'](_0x36018b){this['_conversationContextItems']['set'](_0x36018b['uiId'],_0x36018b);}['_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'](_0x5ecfdc=>({..._0x5ecfdc,'enabled':!0x0}))??[]},this['fire']('addContextOptionsChanged',{'options':this['_addContextOptionsState']});}['_getCustomSourcesInitialState'](){return this['_config']?.['sources']?.['map'](_0x555986=>({..._0x555986,'resources':[]}))??[];}['_toggleAddCurrentDocumentOptionVisibility'](){const _0x5d98da=this['isCurrentDocumentInContext']()||this['isCurrentDocumentInConversation']();this['_addContextOptionsState']['document']['isHidden']=_0x5d98da,this['fire']('addContextOptionsChanged',{'options':this['_addContextOptionsState']});}['_isResourceInContext'](_0x1d3e0e){for(const _0x15a305 of this['_pendingContextItems']['values']())if(_0x15a305['resourceId']===_0x1d3e0e)return!0x0;for(const _0x803f0f of this['_conversationContextItems']['values']())if(_0x803f0f['resourceId']===_0x1d3e0e)return!0x0;return!0x1;}['_findSourceIdsByResourceId'](_0xc19105){const _0x409134=[];for(const _0x40349c of this['_addContextOptionsState']['sources']){_0x40349c['resources']['find'](_0xe74979=>_0xe74979['id']===_0xc19105)&&_0x409134['push'](_0x40349c['id']);}return 0x0===_0x409134['length']?null:_0x409134;}['_updateResourceInContextState'](_0x103084,_0x1a49a4,_0x1b1f00){const _0x182dd5=this['_addContextOptionsState']['sources']['find'](_0x1696cf=>_0x1696cf['id']===_0x103084);if(!_0x182dd5)return;const _0x25291d=_0x182dd5['resources']['find'](_0x1f0393=>_0x1f0393['id']===_0x1a49a4);_0x25291d&&(_0x25291d['isInContext']=_0x1b1f00,this['fire']('resourceStateChanged',{'sourceId':_0x103084,'resourceId':_0x1a49a4,'isInContext':_0x1b1f00}));}['_startUploadOperation'](_0x21d2c8){this['_ongoingUploadOperations']['set'](_0x21d2c8,!0x0),this['_ongoingUploadOperations']['size']&&this['fire']('uploadProgressChanged',{'isUploadInProgress':!0x0});}['_finishUploadOperation'](_0x2bf922){this['_ongoingUploadOperations']['delete'](_0x2bf922),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'](_0x28f5fd){const _0xcb959b={};return _0x28f5fd&&_0x28f5fd['isWebSearchEnabled']&&(_0xcb959b['webSearch']={}),_0x28f5fd&&_0x28f5fd['isReasoningEnabled']&&(_0xcb959b['reasoning']={}),_0xcb959b;}['toggleWebSearch'](){this['setWebSearch'](!this['_isWebSearchEnabled']);}['toggleReasoning'](){this['setReasoning'](!this['_isReasoningEnabled']);}['setWebSearch'](_0x53d3c3){_0x53d3c3!==this['_isWebSearchEnabled']&&(this['_isWebSearchEnabled']=_0x53d3c3,this['fire']('capabilitiesUpdated',this['getCapabilitiesConfig']()));}['setReasoning'](_0x3782a8){_0x3782a8!==this['_isReasoningEnabled']&&(this['_isReasoningEnabled']=_0x3782a8,this['fire']('capabilitiesUpdated',this['getCapabilitiesConfig']()));}}class Bs extends Ds{['userMessage'];['conversationId'];['contextItems']=new Map();['capabilities'];['model'];['attributes'];constructor(_0x539911){super(_0x539911),this['conversationId']=_0x539911['conversationId'],this['contextItems']=_0x539911['contextItems'],this['capabilities']=_0x539911['capabilities'],this['userMessage']=_0x539911['userMessage'],this['model']=_0x539911['model'],this['attributes']=_0x539911['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'](_0x19eff2){const _0x1efc1a=this['getDocumentContext']();if(_0x1efc1a?.['documents']?.['length']){const _0x2e09e1=_0x1efc1a['documents']['map'](_0x573bf1=>_0x573bf1['content']??'')['join']('');if(_0x2e09e1)return super['createReply']({'documentContextContent':_0x2e09e1,..._0x19eff2});}return super['createReply'](_0x19eff2);}}class Gs extends Tt(){['id'];['isStarted']=!0x1;['isFromHistory'];['interactions']=[];['currentInteraction'];['selectedModel'];['connector'];['options'];constructor(_0x4f74a6){super(),this['options']=_0x4f74a6,this['connector']=_0x4f74a6['connector'],this['chatModels']=_0x4f74a6['chatModels'],this['id']=_0x4f74a6['conversationId'],this['isFromHistory']=_0x4f74a6['isFromHistory'];}async['init'](_0x1c523b){try{this['chatContext']=new Ms({'connector':this['connector'],'config':_0x1c523b,'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 _0x38582a=await this['chatModels']['getAvailableModels']();this['fire']('conversationInitialized',{'availableModels':_0x38582a});const _0xaa9e7c=await this['chatModels']['getModel'](this['options']['selectedModelId']);_0xaa9e7c&&await this['setModel'](_0xaa9e7c);}catch(_0x4aee88){const _0x45643f=new at('ai-chat-conversation-init-failed',null,{'message':_0x4aee88['message']||_0x4aee88});_0x45643f['stack']=_0x4aee88['stack'],this['fire']('error',{'error':_0x45643f});}}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:_0x5bb03c}=await this['connector']['startConversation'](this['id'],this['options']['group'])['getConversation']();this['id']=_0x5bb03c,this['isStarted']=!0x0,this['fire']('conversationStarted',{'conversationId':this['id'],'selectedModel':this['selectedModel']});}catch(_0x29a515){const _0x2b3676=new at('ai-chat-conversation-start-failed',null,{'message':_0x29a515['message'],'conversationId':this['id']});throw _0x2b3676['stack']=_0x29a515['stack'],this['fire']('error',{'error':_0x2b3676}),_0x2b3676;}}async['load'](_0x2ae7bd,_0x33bb97){try{const _0x3752da=await this['connector']['fetchConversation'](_0x2ae7bd)['getConversation'](),_0x54295f=await this['connector']['fetchConversationMessages'](_0x2ae7bd)['getMessages'](),_0x5559b5=_0x54295f[0x0]['model'];this['isStarted']=!0x0,this['id']=_0x3752da['id'],'title'in _0x3752da?this['fire']('setConversationTitle',_0x3752da['title'],!0x0):this['fire']('setConversationTitle','',!0x0);const _0xa71f93=(await this['chatModels']['getAll']())['find'](_0x3a6d13=>_0x3a6d13['id']['toLowerCase']()===_0x5559b5['toLowerCase']());return this['selectedModel']=_0xa71f93,this['fire']('modelSelected',{'selectedModel':_0xa71f93,'isDisabled':!0x0}),await this['_processMessagesToInteractions'](_0x54295f,_0x33bb97,_0x5559b5),this['currentInteraction']=void 0x0,this;}catch(_0x421ccb){const _0x9a7123=new at('ai-chat-conversation-init-from-id-failed',null,{'message':_0x421ccb['message'],'conversationId':_0x2ae7bd});throw _0x9a7123['stack']=_0x421ccb['stack'],this['fire']('error',{'error':_0x9a7123}),_0x9a7123;}}async['_processMessagesToInteractions'](_0x3e88ae,_0x53afd4,_0x58c362){let _0x1b54ff,_0x2b52d9=!0x1;for(const _0x45928c of _0x3e88ae)if('user'===_0x45928c['role']){const {contextItems:_0x10bca1,hasUnmatched:_0x25642b}=await this['_extractContextItems'](_0x45928c);_0x2b52d9=_0x25642b;const _0x5acc3f={'isReasoningEnabled':Object['hasOwn'](_0x45928c['capabilities'],'reasoning'),'isWebSearchEnabled':Object['hasOwn'](_0x45928c['capabilities'],'webSearch')};_0x1b54ff=this['createInteraction']({'userMessage':_0x45928c['prompt'],'contextItems':_0x10bca1,'capabilities':_0x5acc3f,'modelId':_0x58c362,'attributes':_0x45928c['attributes']}),this['currentInteraction']=_0x1b54ff,this['chatContext']['addToConversationContext'](this['currentInteraction']['contextItems']);}else{if('assistant'===_0x45928c['role']&&_0x1b54ff){const _0x10a910=[];for(const _0x5ee9d8 of _0x45928c['content'])switch(_0x5ee9d8['type']){case'text':case'modification':{const _0x591036=_0x1b54ff['getDocumentContext'](),_0x7dc04b=(_0x591036?.['documents']?.['length']?_0x591036['documents']['some'](_0x32a00e=>_0x32a00e['sessionId']!==_0x53afd4):_0x591036?.['sessionId']!==_0x53afd4)||_0x2b52d9;_0x1b54ff['currentReply']?.['type']!==_0x5ee9d8['type']&&(_0x1b54ff['currentReply']=_0x1b54ff['createReply']({'type':_0x5ee9d8['type'],'isDone':!0x0,'interactionId':_0x1b54ff['id'],'areActionsDisabled':_0x7dc04b,'isFromHistory':!0x0}),_0x10a910['length']>0x0&&(_0x1b54ff['currentReply']['sources']=_0x10a910['splice'](0x0))),_0x1b54ff['currentReply']['appendContent'](_0x5ee9d8['content']);break;}case'url':_0x10a910['push'](_0x5ee9d8);break;case'mcp-tool-result':{const {data:_0x48e9cf,attributes:_0x9a4cd1}=JSON['parse'](_0x5ee9d8['content']);_0x1b54ff['_handleToolResultData']({'toolName':_0x5ee9d8['toolName'],'data':_0x48e9cf,'attributes':_0x9a4cd1});break;}}}}}async['_extractContextItems'](_0x3d3fe0){const _0x4fe007=new Map();if(!_0x3d3fe0['content'])return{'contextItems':_0x4fe007,'hasUnmatched':!0x1};const _0x2fdd7e=this['_resolveEditors'](),{contextItem:_0x36050e,hasUnmatched:_0x2e52e3}=await this['chatContext']['populateDocumentsFromMessage'](_0x3d3fe0['content'],_0x2fdd7e);_0x36050e&&_0x4fe007['set'](_0x36050e['id'],_0x36050e);for(const _0x3bf41c of _0x3d3fe0['content']){if('document'===_0x3bf41c['type'])continue;const _0x4a826b=await this['chatContext']['populateFromMessage'](_0x3bf41c);_0x4a826b&&_0x4fe007['set'](_0x4a826b['id'],_0x4a826b);}return{'contextItems':_0x4fe007,'hasUnmatched':_0x2e52e3};}['_resolveEditors'](){return this['options']['getEditors']?this['options']['getEditors']():this['options']['getEditor']?[this['options']['getEditor']()]:[];}async['handleUserInteraction']({userMessage:_0x3e3844,attributes:_0xb64af4}){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 _0x5e3fde=this['chatContext']['getPendingContextItems'](),_0xe5e0ac=this['chatCapabilities']['getCapabilitiesConfig'](),_0x964701=this['selectedModel']['id'];this['currentInteraction']=this['createInteraction']({'userMessage':_0x3e3844,'contextItems':_0x5e3fde,'capabilities':_0xe5e0ac,'modelId':_0x964701,'attributes':_0xb64af4}),await this['currentInteraction']['start'](),this['chatContext']['addToConversationContext'](this['currentInteraction']['contextItems']);}catch(_0x3b9e9b){if(_0x3b9e9b instanceof at)this['fire']('error',{'interactionId':this['currentInteraction']?this['currentInteraction']['id']:void 0x0,'error':_0x3b9e9b});else{const _0x26d03d=Ps['get'](_0x3b9e9b['code'])||'ai-chat-handle-user-interaction-start-failed';this['fire']('error',{'interactionId':this['currentInteraction']?this['currentInteraction']['id']:void 0x0,'error':new at(_0x26d03d,null,{'error':_0x3b9e9b})});}}finally{this['currentInteraction']?.['stop'](),this['currentInteraction']=void 0x0;}}['createInteraction']({userMessage:_0x27858a,contextItems:_0x41ff2d,capabilities:_0x484987,modelId:_0x372559,attributes:_0x48fa28}){const _0x592036=new Bs({'userMessage':_0x27858a,'contextItems':_0x41ff2d,'capabilities':_0x484987,'conversationId':this['id'],'connector':this['connector'],'locale':this['options']['locale'],'model':_0x372559,'attributes':_0x48fa28});return _0x592036['delegate'](...Ls)['to'](this),this['interactions']['push'](_0x592036),this['fire']('interactionCreated',_0x592036),_0x592036;}['getInteraction'](_0x408fcb){return this['interactions']['find'](_0x4c4fc2=>_0x4c4fc2['id']===_0x408fcb);}['removeInteraction'](_0x458d23){const _0x17af90=this['getInteraction'](_0x458d23);_0x17af90&&(_0x17af90['destroy'](),this['interactions']['splice'](this['interactions']['indexOf'](_0x17af90),0x1));}get['lastInteraction'](){return this['interactions'][this['interactions']['length']-0x1];}['addCurrentDocumentToContext'](_0x2b28aa){this['chatContext']['addCurrentDocumentToContext'](_0x2b28aa);}async['updateCurrentDocumentInContext']({content:_0xe99f03,version:_0x3071ec,sessionId:_0x20432b,channelId:_0x3b0903,rootName:_0x305053,selections:_0x39bb36}){await this['chatContext']['updateCurrentDocument'](_0xe99f03,_0x3071ec,_0x20432b,_0x3b0903,_0x305053,_0x39bb36);}async['updateCurrentDocumentsInContext'](_0x216e4a){await this['chatContext']['updateCurrentDocuments'](_0x216e4a);}['getSourceByDataId'](_0x3a0cfc){return this['chatContext']['getSourceByDataId'](_0x3a0cfc);}['getDocumentContextSliceByDataId'](_0x39de0f){return this['chatContext']['getDocumentContextSliceByDataId'](_0x39de0f);}['getCurrentDocumentContext'](){return this['currentInteraction']?.['getDocumentContext']()?.['content']||'';}['addSelectionToContext'](_0x35c57b){this['chatContext']['addSelectionToContext'](_0x35c57b);}['removeSelectionFromContext'](){this['chatContext']['removeSelectionFromContext']();}['addFilesToContext'](_0x3b24e8){this['chatContext']['addFilesToContext'](_0x3b24e8);}['addUrlToContext'](_0x163494){this['chatContext']['addUrlToContext'](_0x163494);}['addToolItemToContext'](_0x4c50b1){this['chatContext']['addToolItemToContext'](_0x4c50b1);}['addResourceToContext'](_0x5c203c,_0x1015f5){this['chatContext']['addResourceToContext'](_0x5c203c,_0x1015f5);}['loadSourceResources'](_0x13751e,_0x5d0829,_0x149999){return this['chatContext']['loadSourceResources'](_0x13751e,_0x5d0829,_0x149999);}['removeFromContext'](_0x43bf8c){this['chatContext']['removeFromContext'](_0x43bf8c);}['setWebSearch'](_0x39b7f0){this['chatCapabilities']['setWebSearch'](_0x39b7f0);}['toggleWebSearch'](){this['chatCapabilities']['toggleWebSearch']();}['setReasoning'](_0x34d6ce){this['chatCapabilities']['setReasoning'](_0x34d6ce);}['toggleReasoning'](){this['chatCapabilities']['toggleReasoning']();}['isCurrentDocumentInContext'](){return this['chatContext']['isCurrentDocumentInContext']();}['isCurrentDocumentInConversation'](){return this['chatContext']['isCurrentDocumentInConversation']();}['isSelectionInContext'](){return this['chatContext']['isSelectionInContext']();}async['setModel'](_0x46a22e){_0x46a22e?!0x1===await this['chatModels']['isAvailable'](_0x46a22e)&&(It('ai-chat-conversation-set-model-not-available',{'conversation':this,'model':_0x46a22e}),_0x46a22e=(await this['chatModels']['getAvailableModels']())[0x0]):(It('ai-chat-conversation-set-model-null',{'conversation':this}),_0x46a22e=(await this['chatModels']['getAvailableModels']())[0x0]),_0x46a22e['id']!==this['selectedModel']?.['id']&&(this['selectedModel']=_0x46a22e,this['chatCapabilities']['reset'](),this['fire']('modelSelected',{'selectedModel':_0x46a22e}));}}class Fs extends Tt(){['_connector'];['_config'];['_locale'];['_modelList']=[];['_modelsRequest']=null;constructor({connector:_0x299c65,config:_0x4ce06b,locale:_0x486a43}){super(),this['_connector']=_0x299c65,this['_config']=_0x4ce06b,this['_locale']=_0x486a43;}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 _0x2b4035=await this['getAll']();let _0x5c68f9;return _0x5c68f9=this['_availableModels']?this['_filterModels'](_0x2b4035,this['_availableModels']):_0x2b4035['filter'](_0x4fde44=>_0x4fde44['recommended']),_0x5c68f9;}async['getModel'](_0x4bbacc){const _0x288c0e=await this['getAll']();if(!_0x288c0e['length'])return null;if(_0x4bbacc){const _0x2b3b60=this['_getModelById'](_0x288c0e,_0x4bbacc);if(_0x2b3b60)return _0x2b3b60;It('ai-chat-model-id-unrecognized',{'modelId':_0x4bbacc,'fallBackModelId':this['_defaultModelId']});}return this['getDefault']();}async['getDefault'](){const _0x4eeedc=await this['getAvailableModels']();if(!_0x4eeedc['length'])return null;if(this['_defaultModelId']){const _0x1be7ad=this['_getModelById'](_0x4eeedc,this['_defaultModelId']);if(_0x1be7ad)return _0x1be7ad;It('ai-chat-default-model-id-unrecognized',{'defaultModelId':this['_defaultModelId'],'fallBackModelId':_0x4eeedc[0x0]['id']});}return _0x4eeedc[0x0];}async['isAvailable'](_0x1e4d00){return(await this['getAvailableModels']())['some'](_0x48eace=>_0x48eace['name']===_0x1e4d00['name']&&_0x48eace['provider']===_0x1e4d00['provider']);}async['_retrieveModels'](){if(!this['_modelList']['length'])try{const _0x491515=this['_locale']['uiLanguage']||'en',_0x50189b=this['_connector']['getModels'](_0x491515),_0x53d3cf=await _0x50189b['list']();this['_modelList']=_0x53d3cf['items']['map'](_0x338261=>Ks(_0x338261)?{..._0x338261,'name':hs(this['_locale'],'AI_MODEL_NAME_AUTO')}:_0x338261);}catch(_0x4c4fda){throw Et('ai-models-unable-to-retrieve',{'error':_0x4c4fda}),_0x4c4fda;}return[...this['_modelList']];}['_filterModels'](_0x20f891,_0x257338){let _0x388067;if(_0x257338){_0x388067=[];const _0x1610e2=new Set(),_0x470187='string'==typeof _0x257338?[_0x257338['toLocaleLowerCase']()]:_0x257338['map'](_0x13bed4=>_0x13bed4['toLocaleLowerCase']());for(const _0x388ecb of _0x470187)for(const _0x3c5634 of _0x20f891)!_0x1610e2['has'](_0x3c5634['id'])&&this['_isMatchingFilter'](_0x3c5634,_0x388ecb)&&(_0x388067['push'](_0x3c5634),_0x1610e2['add'](_0x3c5634['id']));}else _0x388067=_0x20f891;return _0x388067;}['_isMatchingFilter'](_0x101898,_0x10447e){const _0xd71f10=_0x101898['id']['toLocaleLowerCase'](),_0x27c1fe=_0x101898['name']['toLocaleLowerCase'](),_0x580851=_0x101898['provider']['toLocaleLowerCase']();return _0xd71f10===_0x10447e||_0x27c1fe===_0x10447e||Ks(_0x101898)&&'auto'===_0x10447e||_0x580851===_0x10447e||_0xd71f10['startsWith'](_0x10447e);}['_getModelById'](_0x5ea1af,_0x1a7583){return _0x5ea1af['find'](_0x376b2f=>Ks(_0x376b2f)&&'auto'===_0x1a7583?_0x376b2f:_0x376b2f['id']===_0x1a7583)||null;}}function Ks(_0x4ab251){return _0x4ab251['id']['startsWith']('agent');}function Ws(_0x132f15){return _0x132f15?_0x132f15 instanceof _0x1c72cb?[_0x132f15]:_0x132f15['editors']&&0x0!==_0x132f15['editors']['length']?Array['from'](_0x132f15['editors']):[]:[];}function Ys(_0x50c800){const _0x2109ab=Ws(_0x50c800);if(!_0x2109ab['length'])throw new at('ai-get-editor-from-context-no-editor');if(0x1===_0x2109ab['length'])return _0x2109ab[0x0];const _0x3c8688=_0x2109ab['find'](_0x3fc0ab=>_0x3fc0ab['ui']?.['focusTracker']?.['isFocused']);if(_0x3c8688)return _0x3c8688;const _0x578b92=function(_0x5e01de){if(_0x5e01de instanceof _0x1c72cb)return;const _0x444b04=_0x5e01de;if(!_0x444b04['plugins']||!_0x444b04['plugins']['has']('AIEditing'))return;const _0x55186a=_0x444b04['plugins']['get']('AIEditing');return _0x55186a['getLastContentFocusedEditor']?.();}(_0x50c800);return _0x578b92&&_0x2109ab['includes'](_0x578b92)?_0x578b92:_0x2109ab[0x0];}function $s(_0x1f3130){return Ys(_0x1f3130);}function qs({editor:_0x1dc867,interaction:_0x35d9a4,reply:_0x54ab45,groups:_0x2e0c4f,transform:_0x1b7309,documentCompare:_0x6eb9d7,documentCompareOptions:_0x39435e,documentContextSlice:_0x608435}){const _0x36b417=_0x35d9a4['getDocumentContext']();if(!_0x36b417)return[];const _0xd81b32=_0x54ab45['documentContextContent']['cloneNode'](!0x0);for(const {changes:_0x141002}of _0x2e0c4f){const _0x7c513f=_0x141002['filter'](_0x5ccd09=>'new'!=_0x5ccd09['type'])['map'](_0x40cc12=>As('data-id',_0x40cc12['id'],_0xd81b32)),_0x13b452=_0x141002['filter'](_0x46f7f2=>'removed'!=_0x46f7f2['type'])['map'](_0x225939=>_0x225939['node']['cloneNode'](!0x0));let _0x4a2cea=null;if(_0x7c513f['length']){_0x4a2cea=_0x7c513f[0x0]['previousSibling'];for(let _0x51385f=0x0;_0x51385f<_0x7c513f['length'];_0x51385f++)_0x48b852(_0x7c513f[_0x51385f]);}if(_0x13b452['length']){_0x4a2cea||(_0x141002[0x0]['anchorId']?_0x4a2cea=As('data-id',_0x141002[0x0]['anchorId'],_0xd81b32):(_0x4a2cea=_0x13b452['shift'](),_0x57a9ea(_0xd81b32,_0x4a2cea)));for(let _0x15982f=0x0;_0x15982f<_0x13b452['length'];_0x15982f++)_0xb4e700(_0x4a2cea,_0x13b452[_0x15982f]),_0x4a2cea=_0x13b452[_0x15982f];}}let _0xd45f8d,_0x1be781,_0xcbda7c,_0x4751c6=_0x39435e;if(_0x608435){_0xd45f8d=_0x608435['html'],_0xcbda7c=_0x608435['version'],_0x4751c6={..._0x39435e,'anchor':_0x608435['rootName']};const _0x2d8138=new _0x2f7da1([]),_0x2eb8fa=_0xd81b32['children'],_0x33988e=_0x54ab45['dataIdDocumentSources'],_0x3756ed=_0x54ab45['newNodeAnchorIds'],_0x42534f=_0x608435['editor'],_0x151707=_0x608435['rootName'],_0x5117a6=new Array(_0x2eb8fa['length']),_0x599b1b=_0x30e6c0=>_0x30e6c0?_0x30e6c0['editor']===_0x42534f&&_0x30e6c0['rootName']===_0x151707:void 0x0;for(let _0x72354a=0x0;_0x72354a<_0x2eb8fa['length'];_0x72354a++){const _0x44bbf0=Es(_0x2eb8fa[_0x72354a],'data-id');if(!_0x44bbf0)continue;const _0x39eb24=_0x599b1b(_0x33988e?.['get'](_0x44bbf0));if(void 0x0!==_0x39eb24){_0x5117a6[_0x72354a]=_0x39eb24;continue;}const _0x4a7b7d=_0x3756ed['get'](_0x44bbf0),_0x26df51=_0x4a7b7d?_0x599b1b(_0x33988e?.['get'](_0x4a7b7d)):void 0x0;void 0x0!==_0x26df51&&(_0x5117a6[_0x72354a]=_0x26df51);}for(let _0x2a58b9=0x0;_0x2a58b9<_0x2eb8fa['length'];_0x2a58b9++)if(void 0x0===_0x5117a6[_0x2a58b9]){for(let _0x6ab55d=_0x2a58b9-0x1;_0x6ab55d>=0x0;_0x6ab55d--)if(void 0x0!==_0x5117a6[_0x6ab55d]){_0x5117a6[_0x2a58b9]=_0x5117a6[_0x6ab55d];break;}if(void 0x0===_0x5117a6[_0x2a58b9]){for(let _0xee0754=_0x2a58b9+0x1;_0xee0754<_0x2eb8fa['length'];_0xee0754++)if(void 0x0!==_0x5117a6[_0xee0754]){_0x5117a6[_0x2a58b9]=_0x5117a6[_0xee0754];break;}}}for(let _0x13dd1c=0x0;_0x13dd1c<_0x2eb8fa['length'];_0x13dd1c++)_0x5117a6[_0x13dd1c]&&_0x2d8138['children']['push'](_0x4af169(_0x2eb8fa[_0x13dd1c],!0x0));_0x1be781=gs(_0x2d8138);}else _0xd45f8d=_0x36b417['content'],_0xcbda7c=_0x36b417['version'],_0x1be781=gs(_0xd81b32);const _0xbcc587=_0x6eb9d7['getDiff'](_0xd45f8d,_0x1be781,{..._0x4751c6,'targetEditor':_0x1dc867})['getOperations']();if(_0x1b7309){const _0x3d6729=_0x1dc867['model']['document']['history']['getOperations'](_0xcbda7c),_0x546079={'document':_0x1dc867['model']['document'],'useRelations':!0x1,'padWithNoOps':!0x1};return _0x3a354d(_0xbcc587,_0x3d6729,_0x546079)['operationsA'];}return _0xbcc587;}function Qs(_0x40a348,_0x631879){if('marker'!=_0x631879['type'])return;const _0x1eead5=_0x40a348['model']['markers']['get'](_0x631879['name']);_0x1eead5&&(_0x631879['oldRange']=_0x1eead5['getRange']());}class Xs extends _0x29a024{['activeConversation'];['_aiEditing'];['_aiConnector'];['_aiChatUi'];['_aiChatModels'];['_aiChatBalloon'];['_activeBalloon'];['_wiredBalloons']=new Set();['_batchToChanges']=new Map();['_currentPreviewedChangeGroup']=null;['_bodyCollection'];static get['requires'](){return[as,_0x513dcf];}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 _0x1da24c=this['context']['plugins']['get']('AITabs');this['listenTo'](this['_aiChatUi'],'startConversation',()=>{this['_startConversationSafely']();}),this['listenTo'](this['_aiChatUi'],'sendUserMessage',(_0x37f3f4,_0x14257f)=>{this['_handleUIUserMessage']({'message':_0x14257f});}),this['listenTo'](_0x1da24c['view'],'change:activeTab',(_0x30e875,_0x355bb9,_0x516ea9)=>{'chat'!==_0x516ea9&&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',(_0x5895a2,_0x3d0e6e)=>{this['activeConversation']?.['addFilesToContext'](Array['from'](_0x3d0e6e));}),this['listenTo'](this['_aiChatUi'],'addUrlToContext',(_0x439b5e,_0x3d1359)=>{this['activeConversation']?.['addUrlToContext'](_0x3d1359);}),this['listenTo'](this['_aiChatUi'],'executeCustomItemCallback',(_0x341b56,_0x3a9877)=>{_0x3a9877['callback'](this['context']);}),this['listenTo'](this['_aiChatUi'],'addResourceToContext',(_0x244a52,_0x122412)=>{this['activeConversation']?.['addResourceToContext'](_0x122412['source'],_0x122412['resource']);}),this['listenTo'](this['_aiChatUi'],'removeContextItem',(_0x16c6ae,_0x186d6d)=>{this['_removeFromContext'](_0x186d6d);}),this['listenTo'](this['_aiChatUi'],'loadSourceResources',(_0xddf36d,_0x4f066c)=>{this['activeConversation']?.['loadSourceResources'](_0x4f066c['sourceId'],_0x4f066c['query'],_0x4f066c['uid']);}),this['listenTo'](this['_aiChatUi'],'toggleWebSearch',()=>{this['_toggleWebSearch']();}),this['listenTo'](this['_aiChatUi'],'toggleReasoning',()=>{this['_toggleReasoning']();}),this['listenTo'](this['_aiChatUi'],'selectModel',(_0x32e10d,_0x55617c)=>{this['activeConversation']?.['setModel'](_0x55617c);}),this['listenTo'](this['_aiChatUi'],'like',(_0x16e15e,{replyId:_0x38a20d})=>{console['log']('Liked\x20response',_0x38a20d);}),this['listenTo'](this['_aiChatUi'],'dislike',(_0x5c8404,{replyId:_0x13e922})=>{console['log']('Disliked\x20response',_0x13e922);}),this['listenTo'](this['_aiChatUi'],'insertSuggestion',(_0x75d383,_0x2d2bfd)=>{this['_insertSuggestion'](_0x2d2bfd);}),this['listenTo'](this['_aiChatUi'],'showChangeInText',(_0x3c9622,{replyId:_0x407c36,partIndex:_0x584787})=>{this['_aiChatBalloonShowDiff']=this['_aiChatUi']['showDiff'],this['_openBalloonFor'](_0x407c36,_0x584787);}),this['listenTo'](this['_aiChatUi'],'mouseOverSuggestion',(_0x501b7c,{replyId:_0x58650a,partIndex:_0x430428})=>{const _0x4f343c=this['_getDocumentRangeForReplyChanges'](_0x58650a,_0x430428);_0x4f343c&&'$graveyard'!=_0x4f343c['range']['root']['rootName']&&this['_aiEditing']['showFakeVisualSelection']({'ranges':[_0x4f343c['range']],'id':'change-area','priority':0xa});}),this['listenTo'](this['_aiChatUi'],'mouseLeaveSuggestion',()=>{this['_aiEditing']['hideFakeVisualSelection']('change-area');}),this['listenTo'](this['_aiChatUi'],'applySuggestion',(_0x1f3c6f,_0x341c45)=>{this['_aiEditing']['hideFakeVisualSelection']('change-area'),this['_applySuggestion'](_0x341c45);}),this['listenTo'](this['_aiChatUi'],'toggleSuggestionDisplayMode',async(_0x5054f1,{replyId:_0x27b748,showDiff:_0x440cf6})=>{const {reply:_0x4ecca0}=this['getInteractionAndReplyById'](_0x27b748),_0x575841=_0x4ecca0['getContentParts']({'showDiff':_0x440cf6,'editor':$s(this['context'])});await this['_aiChatUi']['updateFeedItemAIReplySuggestionContent']({'id':_0x4ecca0['id'],'parts':_0x575841});}),this['listenTo'](this['_aiChatUi'],'rejectSuggestion',(_0xdfd07,{replyId:_0x24943d,partIndex:_0x5d622a})=>{this['_rejectSuggestion']({'replyId':_0x24943d,'partIndex':_0x5d622a}),this['_aiEditing']['hideFakeVisualSelection']('change-area');}),this['set']('_aiChatBalloonShowDiff',!0x1),this['context']['plugins']['has']('AIChatBalloon')&&(this['_aiChatBalloon']=this['context']['plugins']['get']('AIChatBalloon')),this['on']('interactionCreated',(_0x267391,_0x5a1399)=>{this['_aiChatUi']['addFeedItemUserMessage'](_0x5a1399);}),this['on']('replyCreated',(_0x7d171f,_0x1933fd)=>{this['_addFeedItemReply'](_0x1933fd);});}async['afterInit'](){this['context']instanceof _0x1c72cb?this['_integrateEditor'](this['context']):this['listenTo'](this['context']['editors'],'add',(_0x3a9f25,_0x1d764f)=>{_0x1d764f['on']('ready',()=>{this['_integrateEditor'](_0x1d764f);});});const _0x442a60=this['context']['config']['get']('ai.chat.initialConversation');let _0x148c9c=_0x442a60;if('lastCreated'!=_0x442a60||(_0x148c9c=await this['_getLastCreatedConversationId'](),_0x148c9c))return'new'==_0x148c9c?this['_startConversationSafely']():this['loadConversation'](_0x148c9c);}async['destroy'](){return await this['_stopLastInteraction'](),this['_bodyCollection']['detachFromDom'](),super['destroy']();}async['loadConversation'](_0x233e4c){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'](_0x233e4c)['getConversation'](),await this['_startConversationSafely']({'id':_0x233e4c}),this['_updateConversationTitle']('\x20'),await this['activeConversation']['load'](_0x233e4c,this['_aiEditing']['sessionId']),this['activeConversation']['isCurrentDocumentInConversation']()&&this['addCurrentDocumentToChatContext']();}catch(_0xa4f3ca){this['_aiChatUi']['addFeedItemError']({'errorMessage':hs(this['context']['locale'],'AI_CHAT_UNABLE_TO_LOAD_CONVERSATION'),'id':_0x233e4c}),this['_logError'](new at('ai-chat-conversation-not-found',this,{'error':_0xa4f3ca}));}finally{this['_aiChatUi']['startAutoScroll']({'smooth':!0x1}),this['_aiChatUi']['setFeedItemRenderingStrategy']('streaming'),this['_aiChatUi']['toggleLoadingSkeleton'](!0x1);}}['registerToolDataCallback'](_0x5584ed){let _0x21b782=null,_0x106803=null;this['on']('toolDataReceived',(_0x497b0c,_0x295f66,_0x40201a)=>{_0x40201a['id']!==_0x21b782&&(_0x21b782=_0x40201a['id'],_0x106803=this['_getAIChatFeedAPI'](_0x40201a)),_0x5584ed(_0x295f66,_0x106803);});}['addCurrentDocumentToChatContext'](){this['activeConversation']?.['addCurrentDocumentToContext'](hs(this['context']['locale'],'AI_CHAT_CONTEXT_CURRENT_DOCUMENT'));}async['addSelectionToChatContext'](){const _0x2c28b3=this['_aiEditing']['getSelectionText']();this['activeConversation']?.['addSelectionToContext'](_0x2c28b3),this['addCurrentDocumentToChatContext']();}['removeSelectionFromChatContext'](){this['activeConversation']?.['removeSelectionFromContext']();}['focusPromptInput'](){this['_aiChatUi']['focusPromptInput']();}async['startConversation'](_0x3bb32b){await this['_startConversationSafely']({'modelId':_0x3bb32b?.['modelId']});}async['sendMessage'](_0x4d8ef3){await this['_handleUIUserMessage'](_0x4d8ef3);}['getGroupId'](){const _0x45e5f6=this['context']['config']['get']('collaboration.channelId');if(!_0x45e5f6)throw new at('ai-missing-channel-id',this);return _0x45e5f6;}['_handleRemovedConversation'](_0x111019){this['activeConversation']['id']===_0x111019&&this['_startConversationSafely']();}['_insertSuggestion'](_0x194e46){const _0x1ee8ce=this['context']['plugins']['get']('DocumentCompare'),{reply:_0x24b72c,interaction:_0x228272}=this['getInteractionAndReplyById'](_0x194e46['replyId']),_0x34f82=void 0x0!==_0x194e46['partIndex']?[_0x24b72c['changeGroups'][_0x194e46['partIndex']]]:_0x24b72c['changeGroups']['filter'](_0x1e1bb6=>'pending'==_0x1e1bb6['state']);for(const _0x304c77 of this['_groupChangesByTarget'](_0x24b72c,_0x34f82)){const {target:_0x48a33a,groups:_0x4b6647,groupsIndexes:_0x316e99,slice:_0x416fbc}=_0x304c77;if(!_0x48a33a['editor']['plugins']['has']('TrackChanges'))throw new at('ai-no-track-changes',null);const _0x2228b4=this['_getDocumentRangeForReplyChanges'](_0x194e46['replyId'],_0x316e99[0x0]);if(!_0x2228b4||'$graveyard'==_0x2228b4['range']['root']['rootName']){_0x316e99['forEach'](_0x5969ed=>_0x24b72c['setChangeGroupState'](_0x5969ed,'outdated'));continue;}_0x316e99['forEach'](_0x2e5911=>_0x24b72c['setChangeGroupState'](_0x2e5911,'accepted'));const _0x319993=qs({'editor':_0x48a33a['editor'],'reply':_0x24b72c,'interaction':_0x228272,'groups':_0x4b6647,'transform':!0x0,'documentCompare':_0x1ee8ce,'documentCompareOptions':{'anchor':_0x416fbc?.['rootName']??'main','markDeletions':!0x0},'documentContextSlice':_0x416fbc});let _0x2ecdff;this['_scrollToSuggestionRange'](_0x2228b4['range'],!0x1,_0x48a33a['editor']),_0x48a33a['editor']['model']['change'](_0x4c07a7=>{_0x2ecdff=_0x4c07a7['batch'],_0x48a33a['editor']['plugins']['get']('TrackChangesEditing')['_applyOperationsAsSuggestions'](_0x319993),this['_aiEditing']['hideFakeVisualSelection']('change-area');}),this['_batchToChanges']['set'](_0x2ecdff,{'interactionId':_0x228272['id'],'replyId':_0x24b72c['id'],'indexes':_0x316e99['slice']()});}this['_updateRatings'](_0x24b72c);}['_applySuggestion'](_0x2cf110){const _0x3d96e2=this['context']['plugins']['get'](_0x513dcf),{reply:_0x5cb531,interaction:_0x35590f}=this['getInteractionAndReplyById'](_0x2cf110['replyId']),_0x1b80e5=void 0x0!==_0x2cf110['partIndex']?[_0x5cb531['changeGroups'][_0x2cf110['partIndex']]]:_0x5cb531['changeGroups']['filter'](_0x3c2662=>'pending'==_0x3c2662['state']);for(const _0xd915bb of this['_groupChangesByTarget'](_0x5cb531,_0x1b80e5)){const {target:_0x59a420,groups:_0x1aea19,groupsIndexes:_0x56bbd5,slice:_0x1761a5}=_0xd915bb,_0x5878ad=this['_getDocumentRangeForReplyChanges'](_0x2cf110['replyId'],_0x56bbd5[0x0]);if(!_0x5878ad||'$graveyard'==_0x5878ad['range']['root']['rootName']){_0x56bbd5['forEach'](_0x2671ce=>_0x5cb531['setChangeGroupState'](_0x2671ce,'outdated'));continue;}_0x56bbd5['forEach'](_0x20e6dd=>_0x5cb531['setChangeGroupState'](_0x20e6dd,'accepted'));const _0x1427c1=qs({'editor':_0x59a420['editor'],'reply':_0x5cb531,'interaction':_0x35590f,'groups':_0x1aea19,'transform':!0x0,'documentCompare':_0x3d96e2,'documentCompareOptions':{'anchor':_0x1761a5?.['rootName']??'main','markDeletions':!0x1},'documentContextSlice':_0x1761a5});let _0x1899d1;this['_scrollToSuggestionRange'](_0x5878ad['range'],!0x1,_0x59a420['editor']),_0x59a420['editor']['model']['change'](_0x16b434=>{_0x1899d1=_0x16b434['batch'];for(const _0x3a3669 of _0x1427c1)_0x3a3669['baseVersion']=_0x59a420['editor']['model']['document']['version'],Qs(_0x59a420['editor'],_0x3a3669),_0x16b434['batch']['addOperation'](_0x3a3669),_0x59a420['editor']['model']['applyOperation'](_0x3a3669);}),this['_batchToChanges']['set'](_0x1899d1,{'interactionId':_0x35590f['id'],'replyId':_0x5cb531['id'],'indexes':_0x56bbd5['slice']()});}this['_updateRatings'](_0x5cb531);}['_rejectSuggestion'](_0xcc46cd){const {reply:_0x2f7e29}=this['getInteractionAndReplyById'](_0xcc46cd['replyId']);_0x2f7e29['setChangeGroupState'](_0xcc46cd['partIndex'],'rejected');}['_openBalloonFor'](_0x4e4d8c,_0x39105e){if(!this['_aiChatBalloon'])return;const {reply:_0x128287}=this['getInteractionAndReplyById'](_0x4e4d8c),_0x302a7e=_0x128287['getContentParts']({'showDiff':this['_aiChatBalloonShowDiff'],'editor':$s(this['context'])});let _0x61c9f3,_0x3e4f63;if(void 0x0!==_0x39105e?(_0x3e4f63=_0x302a7e['find'](_0x1fb2d2=>_0x1fb2d2['index']==_0x39105e),_0x61c9f3=_0x3e4f63?.['index']):(_0x3e4f63=_0x302a7e[0x0],_0x61c9f3=_0x3e4f63['index']),this['_currentPreviewedChangeGroup']?.['replyId']==_0x4e4d8c&&this['_currentPreviewedChangeGroup']?.['partIndex']==_0x61c9f3)return;const _0x289141=this['_getUserPresentableContentPartDocumentRange'](_0x4e4d8c,_0x128287,_0x3e4f63),_0x4cfa51=_0x128287['changeGroups']['find'](_0xf43e01=>_0xf43e01['index']==_0x61c9f3),_0x823092=_0x4cfa51?this['_resolveGroupTarget'](_0x128287,_0x4cfa51):null,_0x1da159=_0x823092?.['editor']??$s(this['context']),_0x590ad5=_0x1da159['plugins']['has']('AIChatBalloon')?_0x1da159['plugins']['get']('AIChatBalloon'):this['_aiChatBalloon'];if(this['_activeBalloon']&&this['_activeBalloon']!==_0x590ad5&&this['_activeBalloon']['close'](),!_0x289141)return _0x590ad5['close'](),void(this['_activeBalloon']=void 0x0);this['_activeBalloon']=_0x590ad5,this['_currentPreviewedChangeGroup']={'replyId':_0x4e4d8c,'partIndex':_0x61c9f3},this['_scrollToSuggestionRange'](_0x289141,!0x0,_0x1da159);const _0x18e770=this['_getPresentableSiblingContentPartIndex'](_0x4e4d8c,_0x61c9f3,'next');_0x590ad5['updateContent']({'part':_0x3e4f63,'renderingStrategy':'static'}),_0x590ad5['open']({'index':_0x61c9f3,'title':hs(this['context']['locale'],'AI_BALLOON_HEADER_TITLE',(_0x61c9f3+0x1)['toString']()),'showRotator':null!==_0x18e770,'ranges':[_0x289141],'areActionsDisabled':_0x128287['areActionsDisabled'],'targetEditor':_0x1da159}),_0x590ad5['setState']('pending'),this['_aiChatUi']['scrollFeedToSuggestion'](_0x4e4d8c,_0x61c9f3),this['_aiChatUi']['setFeedItemAIReplySuggestionPartActive']({'id':_0x4e4d8c,'index':_0x61c9f3,'isActive':!0x0});}['_getPresentableSiblingContentPartIndex'](_0x4b1dba,_0x3b3b68,_0x57a564){const {reply:_0x128f45}=this['getInteractionAndReplyById'](_0x4b1dba),_0xc4eb0c=_0x128f45['getContentParts']({'showDiff':this['_aiChatBalloonShowDiff'],'editor':$s(this['context'])});if(0x1==_0xc4eb0c['length'])return null;const _0x572714=_0xc4eb0c['findIndex'](_0x2e2805=>_0x2e2805['index']==_0x3b3b68),_0x4be823='next'==_0x57a564?0x1:-0x1;let _0x2cb6ce=_0xc4eb0c['at']((_0x572714+_0x4be823)%_0xc4eb0c['length'])['index'],_0x21acc7=_0xc4eb0c[_0x2cb6ce];for(;!this['_getUserPresentableContentPartDocumentRange'](_0x4b1dba,_0x128f45,_0x21acc7);){if(_0x2cb6ce=_0xc4eb0c['at']((_0x2cb6ce+_0x4be823)%_0xc4eb0c['length'])['index'],_0x2cb6ce===_0x572714)return null;_0x21acc7=_0xc4eb0c[_0x2cb6ce];}return _0x2cb6ce;}['_getUserPresentableContentPartDocumentRange'](_0x3df7ec,_0x4c0a1f,_0x42f5be){const _0x55ec91=_0x4c0a1f['changeGroups'];if(!_0x42f5be['hasChanges'])return null;const _0x442170=_0x55ec91['find'](_0x410fdc=>_0x410fdc['index']==_0x42f5be['index']);if('pending'!==_0x442170?.['state'])return null;const _0x5feeaf=this['_getDocumentRangeForReplyChanges'](_0x3df7ec,_0x42f5be['index']);if(!_0x5feeaf)return _0x4c0a1f['setChangeGroupState'](_0x42f5be['index'],'outdated'),null;const {range:_0x2d6914,currentIndex:_0x1dcfed}=_0x5feeaf;return'$graveyard'==_0x2d6914['root']['rootName']?(_0x4c0a1f['setChangeGroupState'](_0x1dcfed,'outdated'),null):_0x5feeaf['range'];}['_getDocumentRangeForReplyChanges'](_0x50aa6b,_0xa0b33d){const {reply:_0x341d1c}=this['getInteractionAndReplyById'](_0x50aa6b),_0x11c3ce=_0x341d1c['changeGroups']['filter'](_0x422618=>'pending'==_0x422618['state']),_0x237804=_0x11c3ce['map'](_0xcf7f8b=>_0x341d1c['changeGroups']['indexOf'](_0xcf7f8b));void 0x0===_0xa0b33d&&(_0xa0b33d=_0x237804[0x0]);const _0x420344=_0x237804['indexOf'](_0xa0b33d);if(-0x1==_0x420344)return null;const _0x535576=_0x11c3ce[_0x420344],_0x21f750=this['_resolveGroupTarget'](_0x341d1c,_0x535576);if(!_0x21f750)return null;const {editor:_0x204e5b,root:_0x325a67,parsedDocumentContent:_0x22c8e4,serializedDocumentContent:_0x168bf7,version:_0x7aa542}=_0x21f750,_0x2fc4e0=new _0x2f7da1([]),_0x59730b=new _0x2f7da1([]);for(const _0x27b6b2 of _0x535576['changes']){const _0x15cdb2=this['activeConversation']?.['getSourceByDataId'](_0x27b6b2['id']);if((!_0x15cdb2||_0x15cdb2['editor']===_0x21f750['editor']&&_0x15cdb2['rootName']===_0x21f750['root']['rootName'])&&('removed'!=_0x27b6b2['type']&&_0x59730b['children']['push'](_0x27b6b2['node']['cloneNode'](!0x0)),'new'!=_0x27b6b2['type'])){const _0x36ea55=_0x32608d(_0x128e81=>Es(_0x128e81,'data-id')==_0x27b6b2['id'],_0x22c8e4,!0x0);if(!_0x36ea55)return null;_0x2fc4e0['children']['push'](_0x36ea55['cloneNode'](!0x0));}}if(0x0==_0x2fc4e0['children']['length']){if(_0x535576['changes'][0x0]['anchorId']){const _0x4b7185=As('data-id',_0x535576['changes'][0x0]['anchorId'],_0x22c8e4);_0x2fc4e0['children']['unshift'](_0x4b7185['cloneNode'](!0x0)),_0x59730b['children']['unshift'](_0x4b7185['cloneNode'](!0x0)),_0x4b7185['nextSibling']&&(_0x2fc4e0['children']['push'](_0x4b7185['nextSibling']['cloneNode'](!0x0)),_0x59730b['children']['push'](_0x4b7185['nextSibling']['cloneNode'](!0x0)));}else{const _0x479130=_0x22c8e4['children'][0x0];if(!_0x479130)return null;_0x2fc4e0['children']['push'](_0x479130['cloneNode'](!0x0)),_0x59730b['children']['push'](_0x479130['cloneNode'](!0x0));}}const _0x20e726=_0x204e5b['data']['parse'](_0x168bf7),_0x57d16c=gs(_0x2fc4e0),_0x319d97=_0x204e5b['data']['parse'](_0x57d16c),_0x3a0155=_0x204e5b['data']['parse'](_0x57d16c),_0x270c87=_0x204e5b['model']['createPositionAt'](_0x319d97,0x0),_0x4d6042=gs(_0x59730b),_0x220998={'targetEditor':_0x204e5b,'anchor':_0x270c87,'markDeletions':!0x1},_0x59356a=_0x204e5b['plugins']['get'](_0x513dcf)['getDiff'](_0x57d16c,_0x4d6042,_0x220998)['getOperations']();if(!_0x59356a['length'])return null;_0x204e5b['model']['change'](_0x5d9e9b=>{for(const _0x596b0b of _0x59356a)if('remove'==_0x596b0b['type']){const _0x1ab843=_0x596b0b['sourcePosition'],_0x1363a9=_0x596b0b['howMany'],_0x5aeefc=new _0x1e19dc(_0x1ab843,_0x1363a9);_0x5d9e9b['batch']['addOperation'](_0x5aeefc),_0x204e5b['model']['applyOperation'](_0x5aeefc);}else'marker'!==_0x596b0b['type']&&(_0x596b0b['baseVersion']=null,_0x596b0b['isDocumentOperation']=!0x1,_0x5d9e9b['batch']['addOperation'](_0x596b0b),_0x204e5b['model']['applyOperation'](_0x596b0b));});const _0x2a19f4=ks(_0x204e5b,_0x59356a,_0x319d97);Ns(_0x204e5b['model'],_0x2a19f4);const _0x51453e=_0x2a19f4['getFirstRange']()['start']['path']['slice'](),_0x55ef89=_0x2a19f4['getFirstRange']()['end']['path']['slice'](),_0x5dd4f3=[];let _0x36200d=_0x319d97,_0x2e63ed=_0x3a0155;for(let _0x3ced50=0x0;_0x3ced50<_0x55ef89['length'];_0x3ced50++){const _0xd7d17b=_0x36200d['maxOffset']-_0x55ef89[_0x3ced50];_0x5dd4f3[_0x3ced50]=_0x2e63ed['maxOffset']-_0xd7d17b,_0x36200d=_0x36200d['getChildAtOffset'](_0x55ef89[_0x3ced50]),_0x2e63ed=_0x2e63ed['getChildAtOffset'](_0x5dd4f3[_0x3ced50]);}const _0x3b8b0b=_0x204e5b['model']['createRange'](_0x204e5b['model']['createPositionFromPath'](_0x3a0155,_0x51453e),_0x204e5b['model']['createPositionFromPath'](_0x3a0155,_0x5dd4f3)),_0x29f3eb=_0x3a0155['getChild'](0x0)['getAttribute'](_0x33ffd6),_0x3e8da8=Array['from'](_0x20e726['getChildren']())['find'](_0x13df5b=>_0x13df5b['getAttribute'](_0x33ffd6)==_0x29f3eb)['getPath'](),_0x395645=_0x3b8b0b['start']['path']['slice'](),_0x38f6e0=_0x3b8b0b['end']['path']['slice']();_0x395645[0x0]=_0x3e8da8[0x0]+_0x395645[0x0],_0x38f6e0[0x0]=_0x3e8da8[0x0]+_0x38f6e0[0x0];let _0x19e431=_0x204e5b['model']['createRange'](_0x204e5b['model']['createPositionFromPath'](_0x325a67,_0x395645),_0x204e5b['model']['createPositionFromPath'](_0x325a67,_0x38f6e0));const _0x5180f1=_0x204e5b['model']['document']['history']['getOperations'](_0x7aa542);for(const _0x3e6086 of _0x5180f1)_0x19e431=_0x2264dd['_createFromRanges'](_0x19e431['getTransformedByOperation'](_0x3e6086));return{'range':_0x19e431,'currentIndex':_0xa0b33d};}['_integrateEditorBalloon'](_0x36e911){if(!_0x36e911['plugins']['has']('AIChatBalloon'))return;const _0x36f9c0=_0x36e911['plugins']['get']('AIChatBalloon');this['_wiredBalloons']['has'](_0x36f9c0)||(this['_wiredBalloons']['add'](_0x36f9c0),this['_aiChatBalloon']||(this['_aiChatBalloon']=_0x36f9c0),_0x36f9c0['bind']('showDiff')['to'](this,'_aiChatBalloonShowDiff'),this['listenTo'](_0x36f9c0,'toggleSuggestionDisplayMode',()=>{const {replyId:_0x75d34a,partIndex:_0x228c7d}=this['_currentPreviewedChangeGroup'];this['_aiChatBalloonShowDiff']=!this['_aiChatBalloonShowDiff'];const {reply:_0x42c86f}=this['getInteractionAndReplyById'](_0x75d34a),_0x2f9cbf=_0x42c86f['changeGroups']['find'](_0x5c49bd=>_0x5c49bd['index']===_0x228c7d),_0x5efb4e=_0x2f9cbf?this['_resolveGroupTarget'](_0x42c86f,_0x2f9cbf):null,_0x5bf6f6=_0x42c86f['getContentParts']({'showDiff':this['_aiChatBalloonShowDiff'],'groupIndex':_0x228c7d,'editor':_0x5efb4e?.['editor']??$s(this['context'])});(this['_activeBalloon']??_0x36f9c0)['updateContent']({'part':_0x5bf6f6[0x0],'renderingStrategy':'static','keepErrors':!0x0});}),this['listenTo'](_0x36f9c0,'applySuggestion',()=>{const {replyId:_0x3d2e17,partIndex:_0x41906b}=this['_currentPreviewedChangeGroup'];this['_applySuggestion']({'replyId':_0x3d2e17,'partIndex':_0x41906b}),(this['_activeBalloon']??_0x36f9c0)['setState']('accepted');}),this['listenTo'](_0x36f9c0,'insertSuggestion',()=>{const {replyId:_0x3e55ea,partIndex:_0x2225cf}=this['_currentPreviewedChangeGroup'];this['_insertSuggestion']({'replyId':_0x3e55ea,'partIndex':_0x2225cf}),(this['_activeBalloon']??_0x36f9c0)['setState']('accepted');}),this['listenTo'](_0x36f9c0,'rejectSuggestion',()=>{const {replyId:_0x3a29cc,partIndex:_0x4db1dd}=this['_currentPreviewedChangeGroup'];this['_rejectSuggestion']({'replyId':_0x3a29cc,'partIndex':_0x4db1dd}),(this['_activeBalloon']??_0x36f9c0)['setState']('rejected');}),this['listenTo'](_0x36f9c0,'showNext',()=>{const {replyId:_0x861250,partIndex:_0x103c45}=this['_currentPreviewedChangeGroup'],_0x3ce07c=this['_getPresentableSiblingContentPartIndex'](_0x861250,_0x103c45,'next');null!==_0x3ce07c&&this['_openBalloonFor'](_0x861250,_0x3ce07c);}),this['listenTo'](_0x36f9c0,'showPrevious',()=>{const {replyId:_0x30fd95,partIndex:_0x3aea84}=this['_currentPreviewedChangeGroup'],_0x2ce46b=this['_getPresentableSiblingContentPartIndex'](_0x30fd95,_0x3aea84,'previous');null!==_0x2ce46b&&this['_openBalloonFor'](_0x30fd95,_0x2ce46b);}),this['listenTo'](_0x36f9c0,'dialogClosed',(_0x550658,{id:_0x9ba2de})=>{if('aiChatBalloon'!==_0x9ba2de)return;const {replyId:_0x4123f7,partIndex:_0x259c38}=this['_currentPreviewedChangeGroup'];this['_currentPreviewedChangeGroup']=null,this['_aiChatUi']['setFeedItemAIReplySuggestionPartActive']({'id':_0x4123f7,'index':_0x259c38,'isActive':!0x1}),this['_activeBalloon']===_0x36f9c0&&(this['_activeBalloon']=void 0x0);}));}['_integrateEditor'](_0x5757e8){if(this['_integrateEditorBalloon'](_0x5757e8),_0x5757e8['plugins']['has']('Undo')){const _0x43cb08=_0x5757e8['commands']['get']('undo'),_0x12d740=_0x5757e8['commands']['get']('redo');this['listenTo'](_0x43cb08,'revert',(_0x35e7e4,_0x17c7b1,_0x10d0a)=>{const _0xeb0576=this['_batchToChanges']['get'](_0x17c7b1);if(!_0xeb0576)return;const _0x2a67c4=this['activeConversation']['getInteraction'](_0xeb0576['interactionId']),_0x10a213=_0x2a67c4?.['getReply'](_0xeb0576['replyId']);this['_batchToChanges']['delete'](_0x17c7b1),_0x2a67c4&&_0x10a213&&(_0xeb0576['indexes']['forEach'](_0x239366=>_0x10a213['setChangeGroupState'](_0x239366,'pending')),this['_batchToChanges']['set'](_0x10d0a,_0xeb0576));}),this['listenTo'](_0x12d740,'revert',(_0x250cb9,_0x59bb54,_0x87f7b6)=>{const _0x4540dd=this['_batchToChanges']['get'](_0x59bb54);if(!_0x4540dd)return;const _0x71b7a0=this['activeConversation']['getInteraction'](_0x4540dd['interactionId']),_0x4c0591=_0x71b7a0?.['getReply'](_0x4540dd['replyId']);this['_batchToChanges']['delete'](_0x59bb54),_0x71b7a0&&_0x4c0591&&(_0x4540dd['indexes']['forEach'](_0x46fae9=>_0x4c0591['setChangeGroupState'](_0x46fae9,'accepted')),this['_batchToChanges']['set'](_0x87f7b6,_0x4540dd));});}const _0x43240c=_0x5757e8['config']['get']('ai.chat.context');_0x43240c['alwaysAddSelection']&&_0x43240c['document']['enabled']&&this['listenTo'](_0x5757e8['model']['document']['selection'],'change:range',(_0x248ce5,_0x11857e)=>{if(!_0x11857e['directChange'])return;'chat'===_0x5757e8['plugins']['get']('AITabs')['view']['activeTab']&&(_0x5757e8['model']['hasContent'](_0x5757e8['model']['document']['selection'])?this['addSelectionToChatContext']():this['removeSelectionFromChatContext']());});}async['_getLastCreatedConversationId'](){const _0x4ead6e=this['_aiConnector']['fetchConversations'](this['getGroupId'](),{'limit':0x1,'sortBy':'createdAt'});try{const _0x5eec82=await _0x4ead6e['getConversations']();return _0x5eec82['length']?_0x5eec82[0x0]['id']:'new';}catch(_0x2a2113){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':_0x2a2113})),this['_aiChatUi']['toggleLoadingSkeleton'](!0x1),this['_aiChatUi']['disableControls'](),null;}}async['_startConversationSafely'](_0x15e7f0={}){try{this['_aiChatUi']['enableControls'](),await this['_handleStartConversation'](_0x15e7f0);}catch(_0x2136e3){this['_aiChatUi']['addFeedItemError']({'errorMessage':hs(this['context']['locale'],'AI_CHAT_UNABLE_TO_START_CONVERSATION'),'id':_0x15e7f0['id']||ot()}),console['error'](_0x2136e3),this['activeConversation']=void 0x0,this['_aiChatUi']['disableControls']();}}async['_handleStartConversation']({id:_0x192818,modelId:_0x582f17}={}){this['_activeBalloon']?.['close'](),this['_activeBalloon']=void 0x0,this['_currentPreviewedChangeGroup']=null;let _0x1c5239=_0x582f17;_0x1c5239||(_0x192818||!this['activeConversation']?_0x1c5239=this['context']['config']['get']('ai.models.defaultModelId'):this['_aiChatUi']['isModelAvailable']&&(_0x1c5239=this['activeConversation']['selectedModel']['id'])),await this['_stopLastInteraction']();const _0x93de68=this['getGroupId'](),_0x52c0fe=_0x192818||ot();let _0x47123b;this['activeConversation']=new Gs({'connector':this['_aiConnector'],'chatModels':this['_aiChatModels'],'selectedModelId':_0x1c5239,'conversationId':_0x52c0fe,'group':_0x93de68,'getEditor':()=>$s(this['context']),'getEditors':()=>Ws(this['context']),'locale':this['context']['locale'],'isFromHistory':!!_0x192818}),this['activeConversation']['delegate']('toolDataReceived','interactionCreated','interactionStarted','replyCreated')['to'](this),this['activeConversation']['on']('conversationInitialized',(_0x3765b8,_0x2c69c4)=>{this['_aiChatUi']['createConversation'](_0x2c69c4),this['_aiChatUi']['resetMessageInput'](),this['_aiChatUi']['clearPendingContextUI'](),this['_aiChatUi']['clearConversationContextUI'](),_0x192818||(this['_aiChatUi']['resetConversationTitle'](),this['addCurrentDocumentToChatContext']());}),this['activeConversation']['on']('uploadProgressChanged',(_0x24ff7b,_0x2dcd6d)=>{this['_aiChatUi']['setIsUploadInProgress'](_0x2dcd6d['isUploadInProgress']);}),this['activeConversation']['on']('webSearchStarted',()=>{const _0x2e441f=this['_aiChatUi']['prepareLoadingMessage']({'isWebSearchEnabled':!0x0,'isReasoningEnabled':!0x1});this['_aiChatUi']['setLoadingMessage'](_0x2e441f);}),this['activeConversation']['on']('reasoningStarted',()=>{const _0x2cc056=this['_aiChatUi']['prepareLoadingMessage']({'isWebSearchEnabled':!0x1,'isReasoningEnabled':!0x0});this['_aiChatUi']['setLoadingMessage'](_0x2cc056);}),this['activeConversation']['on']('webSearchFinished',(_0x70ac34,_0x393840)=>{this['_aiChatUi']['addFeedInteractionHeader'](_0x393840,{'isWebSearchEnabled':!0x0,'isReasoningEnabled':!0x1});}),this['activeConversation']['on']('reasoningFinished',(_0x46e03d,_0x2027c8)=>{this['_aiChatUi']['addFeedInteractionHeader'](_0x2027c8,{'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',(_0x2c4015,_0x4077fe)=>{this['_aiChatUi']['removeFeedInteraction'](_0x4077fe['id']);}),this['activeConversation']['on']('setConversationTitle',(_0x2b3ae4,_0x4fb6b8,_0x20bfed)=>{this['_updateConversationTitle'](_0x4fb6b8,_0x20bfed);}),this['activeConversation']['on']('replyContentUpdated',async(_0x438ba1,_0x505532)=>{void 0x0!==_0x47123b&&_0x47123b!==_0x505532['id']&&this['_updateReplyContentThrottled']['flush'](),_0x47123b=_0x505532['id'],_0x505532['isFromHistory']?await this['_updateReplyContent']({'reply':_0x505532}):await this['_updateReplyContentThrottled']({'reply':_0x505532});}),this['activeConversation']['on']('replyChangeGroupStateUpdated',(_0x3f86d8,{reply:_0xa40097,index:_0x9acc66,state:_0x1850a7})=>{this['_aiChatUi']['updateFeedItemAIReplySuggestionPartState']({'id':_0xa40097['id'],'index':_0x9acc66,'state':_0x1850a7}),this['_currentPreviewedChangeGroup']?.['replyId']['includes'](_0xa40097['id'])&&this['_currentPreviewedChangeGroup']?.['partIndex']==_0x9acc66&&(this['_activeBalloon']??this['_aiChatBalloon'])?.['setState'](_0x1850a7);}),this['activeConversation']['on']('contextItemAdded',(_0x19f313,_0x511498)=>{if(this['_aiChatUi']['addContextItem'](_0x511498['contextItem'],_0x511498['isLoading']),'selection'===_0x511498['contextItem']['type']){const _0x2ab075=[...$s(this['context'])['model']['document']['selection']['getRanges']()];this['_aiEditing']['showFakeVisualSelection']({'ranges':_0x2ab075,'id':'context','priority':0x1});}}),this['activeConversation']['on']('contextItemRemoved',(_0x1625a3,_0x5bde22)=>{this['_aiChatUi']['removeContextItem'](_0x5bde22['uiId']),'current-document'==_0x5bde22['uiId']&&this['removeSelectionFromChatContext'](),'selection'===_0x5bde22['type']&&this['_aiEditing']['hideFakeVisualSelection']('context');}),this['activeConversation']['on']('contextItemLoadingEnded',(_0x137949,_0x475a1b)=>{this['_aiChatUi']['setContextItemLoading'](_0x475a1b['contextItem']['uiId'],_0x475a1b['isLoading']);}),this['activeConversation']['on']('contextSent',(_0x420c4f,_0x2ad059)=>{this['_aiChatUi']['setConversationContext'](_0x2ad059['contextItems']);}),this['activeConversation']['on']('addContextOptionsChanged',(_0x5e3abd,_0x202b2f)=>{this['_aiChatUi']['setAddContextOptions'](_0x202b2f['options']);}),this['activeConversation']['on']('sourceResourcesLoaded',(_0x2071ee,_0x3debae)=>{this['_aiChatUi']['populateSourceResourceBalloon'](_0x3debae['sourceId'],_0x3debae['source'],_0x3debae['resources'],_0x3debae['uid']);}),this['activeConversation']['on']('resourceStateChanged',(_0x1d734e,_0x56bb21)=>{this['_aiChatUi']['updateResourceState'](_0x56bb21['sourceId'],_0x56bb21['resourceId'],_0x56bb21['isInContext']);}),this['activeConversation']['on']('capabilitiesUpdated',(_0x39eed5,_0x44819a)=>{this['_aiChatUi']['updateCapabilities'](_0x44819a);}),this['activeConversation']['on']('modelSelected',async(_0xf5fbd4,_0x2fdbf3)=>{const _0x809ff0=(await this['_aiChatModels']['getAll']())['find'](_0x20fcaf=>_0x20fcaf['id']===_0x2fdbf3['selectedModel']?.['id'])||null;this['_aiChatUi']['setSelectedModel'](_0x809ff0,_0x2fdbf3['isDisabled']);}),this['activeConversation']['on']('error',(_0x3c289e,{error:_0x3d8b05,interactionId:_0x476a81,fileName:_0x4c10fc,url:_0x19ff40,sourceId:_0x5acd0c,sourceLabel:_0x563f5c})=>{const _0x13872f=_0x476a81?_0x476a81+':'+ot():ot();_0x3d8b05['message']['startsWith']('ai-request-aborted')?this['_aiChatUi']['addFeedItemStaticMessage']({'staticMessage':hs(this['context']['locale'],'AI_CHAT_ABORTED_MESSAGE'),'id':_0x13872f}):_0x3d8b05['message']['startsWith']('ai-chat-conversation-init-failed')||_0x3d8b05['message']['startsWith']('ai-chat-conversation-start-failed')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':hs(this['context']['locale'],'AI_CHAT_UNABLE_TO_START_CONVERSATION'),'id':_0x13872f}),this['_logError'](_0x3d8b05)):_0x3d8b05['message']['startsWith']('ai-chat-file-upload-failed')?this['_aiChatUi']['addFeedItemError']({'errorMessage':hs(this['context']['locale'],'AI_CHAT_CONTEXT_UNABLE_TO_UPLOAD_FILE',_0x4c10fc),'id':_0x13872f}):_0x3d8b05['message']['startsWith']('ai-chat-url-upload-failed')?this['_aiChatUi']['addFeedItemError']({'errorMessage':hs(this['context']['locale'],'AI_CHAT_CONTEXT_UNABLE_TO_UPLOAD_URL',_0x19ff40),'id':_0x13872f}):_0x3d8b05['message']['startsWith']('ai-chat-context-invalid-data')?this['_aiChatUi']['addFeedItemError']({'errorMessage':hs(this['context']['locale'],'AI_CHAT_CONTEXT_INVALID_DATA'),'id':_0x13872f}):_0x3d8b05['message']['startsWith']('ai-chat-context-unsupported-type')?this['_aiChatUi']['addFeedItemError']({'errorMessage':hs(this['context']['locale'],'AI_CHAT_CONTEXT_UNSUPPORTED_TYPE'),'id':_0x13872f}):_0x3d8b05['message']['startsWith']('ai-chat-source-resources-load-failed')?(_0x5acd0c&&this['_aiChatUi']['closeSourceResourceBalloon'](_0x5acd0c),this['_aiChatUi']['addFeedItemError']({'errorMessage':hs(this['context']['locale'],'AI_CHAT_CONTEXT_UNABLE_TO_LOAD_RESOURCES',_0x563f5c||'source'),'id':_0x13872f}),this['_logError'](_0x3d8b05)):_0x3d8b05['message']['startsWith']('ai-chat-resource-load-failed')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':hs(this['context']['locale'],'AI_CHAT_RESOURCE_LOAD_FAILED'),'id':_0x13872f}),this['_logError'](_0x3d8b05)):_0x3d8b05['message']['startsWith']('ai-chat-invalid-request')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':hs(this['context']['locale'],'AI_CHAT_INVALID_REQUEST'),'id':_0x13872f}),this['_logError'](_0x3d8b05)):_0x3d8b05['message']['startsWith']('ai-chat-context-unsupported-file-type')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':hs(this['context']['locale'],'AI_CHAT_CONTEXT_UNSUPPORTED_FILE_TYPE'),'id':_0x13872f}),this['_logError'](_0x3d8b05)):_0x3d8b05['message']['startsWith']('ai-chat-context-file-too-large')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':hs(this['context']['locale'],'AI_CHAT_CONTEXT_FILE_TOO_LARGE'),'id':_0x13872f}),this['_logError'](_0x3d8b05)):_0x3d8b05['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':_0x13872f}),this['_logError'](_0x3d8b05)):_0x3d8b05['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':_0x13872f}),this['_logError'](_0x3d8b05)):(this['_aiChatUi']['addFeedItemError']({'errorMessage':hs(this['context']['locale'],'AI_CHAT_GENERIC_ERROR'),'id':_0x13872f}),this['_logError'](_0x3d8b05));}),await this['activeConversation']['init'](this['context']['config']['get']('ai.chat.context')),_0x192818||await this['activeConversation']['start']();}async['_handleUIUserMessage']({message:_0x2aafc8,attributes:_0x18608c}){if(!this['activeConversation'])throw new at('ai-chat-controller-no-active-conversation');if(this['activeConversation']['isCurrentDocumentInContext']()){const _0x5b63b0=await this['_aiEditing']['getDocumentData']();_0x5b63b0['length']>0x1?await this['activeConversation']['updateCurrentDocumentsInContext'](_0x5b63b0):await this['activeConversation']['updateCurrentDocumentInContext'](_0x5b63b0[0x0]);}this['activeConversation']['id']&&this['activeConversation']['isStarted']&&await this['activeConversation']['handleUserInteraction']({'userMessage':_0x2aafc8,'attributes':_0x18608c});}['_logError'](_0x18177d){Et(_0x18177d['message']);}['_removeFromContext'](_0x4a555){this['activeConversation']?.['removeFromContext'](_0x4a555);}['_toggleWebSearch'](){this['activeConversation']?.['toggleWebSearch']();}['_toggleReasoning'](){this['activeConversation']?.['toggleReasoning']();}['getInteractionAndReplyById'](_0xd2cbe9){const [_0x3adc65,_0x20d19d]=_0xd2cbe9['split'](':'),_0x5ea957=this['activeConversation']['getInteraction'](_0x3adc65),_0x354d0a=_0x5ea957['getReply'](_0x20d19d);return{'interaction':_0x5ea957,'reply':_0x354d0a};}['_resolveGroupTarget'](_0x151732,_0x268f5c){const _0x78c95=[..._0x268f5c['changes']['filter'](_0x2d5f0e=>'context'!==_0x2d5f0e['type']),..._0x268f5c['changes']['filter'](_0x2f982d=>'context'===_0x2f982d['type'])];for(const _0x267ccd of _0x78c95){const _0x2c6ce4=_0x151732['newNodeAnchorIds']['get'](_0x267ccd['id']),_0x901287=this['activeConversation']?.['getSourceByDataId'](_0x267ccd['id'])||this['activeConversation']?.['getSourceByDataId'](_0x2c6ce4)||this['activeConversation']?.['getSourceByDataId'](_0x267ccd['anchorId']??void 0x0);if(_0x901287){if('destroyed'===_0x901287['editor']['state'])return null;const _0x40acad=_0x901287['editor']['model']['document']['getRoot'](_0x901287['rootName']);return _0x40acad?{'editor':_0x901287['editor'],'root':_0x40acad,'parsedDocumentContent':_s(_0x901287['content']),'serializedDocumentContent':_0x901287['content'],'version':_0x901287['version']}:null;}}const _0x23e2f2=$s(this['context']),_0x99ae66=this['activeConversation']['getInteraction'](_0x151732['interactionId']),_0x557639=_0x99ae66?.['getDocumentContext']();return{'editor':_0x23e2f2,'root':_0x23e2f2['model']['document']['getRoot'](),'parsedDocumentContent':_0x151732['documentContextContent'],'serializedDocumentContent':_0x557639?.['content'],'version':_0x557639?.['version']};}['_groupChangesByTarget'](_0x59cdff,_0x45a88d){const _0x1c9737=new Map();for(const _0x8cc3d7 of _0x45a88d){const _0x5b351a=this['_resolveGroupTarget'](_0x59cdff,_0x8cc3d7);if(!_0x5b351a)continue;const _0x464f6e=(_0x5b351a['editor']['id']||'e')+'|'+_0x5b351a['root']['rootName'];let _0x203ee4=_0x1c9737['get'](_0x464f6e);if(!_0x203ee4){let _0xb0dc9d;for(const _0x56bc00 of[..._0x8cc3d7['changes']['filter'](_0x524520=>'context'!==_0x524520['type']),..._0x8cc3d7['changes']['filter'](_0x1b1de5=>'context'===_0x1b1de5['type'])])if(_0xb0dc9d=this['activeConversation']?.['getDocumentContextSliceByDataId'](_0x56bc00['id'])||this['activeConversation']?.['getDocumentContextSliceByDataId'](_0x59cdff['newNodeAnchorIds']['get'](_0x56bc00['id'])),_0xb0dc9d)break;_0x203ee4={'target':{'editor':_0x5b351a['editor'],'root':_0x5b351a['root']},'slice':_0xb0dc9d,'groups':[],'groupsIndexes':[]},_0x1c9737['set'](_0x464f6e,_0x203ee4);}_0x203ee4['groups']['push'](_0x8cc3d7),_0x203ee4['groupsIndexes']['push'](_0x59cdff['changeGroups']['indexOf'](_0x8cc3d7));}return Array['from'](_0x1c9737['values']());}['_scrollToSuggestionRange'](_0x525f95,_0x3f313f=!0x1,_0xa2be74){const _0x126443={'target':_0xa2be74['editing']['view']['domConverter']['viewRangeToDom'](_0xa2be74['editing']['mapper']['toViewRange'](_0x525f95)),'viewportOffset':{'top':0x96,'left':0x0,'bottom':0x32,'right':0x0},'ancestorOffset':0x14,'alignToTop':_0x3f313f};_0x3f313f&&(_0x126443['alignToTop']=!0x0),Ct(_0x126443);}['_updateConversationTitle'](_0x3f64f9,_0x52ab3f=!0x1){this['_aiChatUi']['setConversationTitle'](_0x3f64f9||hs(this['context']['locale'],'AI_CHAT_UNTITLED_CONVERSATION'),_0x52ab3f);}['_addFeedItemReply'](_0x370a86){'text'===_0x370a86['type']?this['_aiChatUi']['addFeedItemAIReply'](_0x370a86):this['_aiChatUi']['addFeedItemAISuggestion'](_0x370a86);}async['_updateReplyContent']({reply:_0x48b0b9,renderingStrategy:_0x5c8558}){const {id:_0x2f7e95,interactionId:_0x4a5989,isDone:_0x3e5dc4,type:_0x56d047,parsedContent:_0x3e78ad}=_0x48b0b9,_0x1055c3=_0x4a5989+':'+_0x2f7e95;if('modification'===_0x56d047){const _0x535e53=_0x48b0b9['getContentParts']({'showDiff':this['_aiChatUi']['showDiff'],'editor':$s(this['context'])});await this['_aiChatUi']['updateFeedItemAIReplySuggestionContent']({'id':_0x1055c3,'parts':_0x535e53,'isDone':_0x3e5dc4,'skipLoadingEffects':_0x48b0b9['isFromHistory']});}else'text'===_0x56d047&&await this['_aiChatUi']['updateFeedItemAIReplyContent']({'id':_0x1055c3,'parsedContent':_0x3e78ad,'renderingStrategy':_0x5c8558,'isDone':_0x3e5dc4});_0x3e5dc4&&_0x48b0b9['sources']['length']>0x0&&this['_aiChatUi']['updateFeedItemAIReplySources'](_0x1055c3,_0x48b0b9['sources']);}['_updateReplyContentThrottled']=_0x41e73f(this['_updateReplyContent']['bind'](this),0xc8);async['_stopLastInteraction'](){const _0x238755=this['activeConversation']?.['lastInteraction'];_0x238755&&(_0x238755['stop'](),this['_aiChatUi']['stopInteraction'](_0x238755)),this['_updateReplyContentThrottled']['cancel']();}async['_flushLastInteractionUI'](){const _0x4a8aa6=this['activeConversation']?.['lastInteraction'];if(_0x4a8aa6){for await(const _0x286c32 of _0x4a8aa6['replies'])this['_aiChatUi']['hasFeedItem'](_0x286c32['id'])||this['_addFeedItemReply'](_0x286c32),await this['_updateReplyContent']({'reply':_0x286c32,'renderingStrategy':'static'});}}['_updateRatings'](_0x3c7ccc){const _0x228e49={'positiveCount':_0x3c7ccc['changeGroups']['filter'](_0x1b7480=>'accepted'===_0x1b7480['state'])['length'],'totalCount':_0x3c7ccc['changeGroups']['length'],'modificationId':_0x3c7ccc['id']},_0x5ad5c8=this['activeConversation']['getInteraction'](_0x3c7ccc['interactionId'])['messageId'];_0x5ad5c8&&this['_aiConnector']['upsertAIChatRating'](this['activeConversation']['id'],_0x5ad5c8,_0x228e49);}['_getAIChatFeedAPI'](_0x107b10){const _0x36bd72=this['_aiChatUi'],_0x214b43=()=>{_0x107b10['resetWebSearchState'](),_0x107b10['resetReasoningState'](),_0x36bd72['clearLoadingMessage']();},_0x47385a=()=>{_0x107b10['currentReply']&&(_0x107b10['currentReply']['done'](),_0x107b10['currentReply']=void 0x0);};return{'insertTextReply':(_0x37cc7f,_0x1c6996)=>{_0x47385a(),_0x214b43();const _0x4586af=_0x107b10['currentReply']=_0x107b10['createReply']({'type':'text','interactionId':_0x107b10['id'],'content':_0x37cc7f,'id':_0x1c6996||ot()});return _0x47385a(),_0x4586af;},'insertCustomElement':async(_0x1679eb,_0x46d0af)=>(_0x47385a(),_0x214b43(),_0x36bd72['addFeedItemCustomElement'](_0x1679eb,_0x46d0af||ot())),'setLoadingMessage':_0xd8030c=>{_0x36bd72['setLoadingMessage'](_0xd8030c);},'clearLoadingMessage':()=>{_0x36bd72['clearLoadingMessage']();}};}}const zs='ai-selection',js=['br'];class Js extends _0x29a024{constructor(_0x51836d){super(_0x51836d),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 _0x444c21=Ws(this['context']),_0x5869c2=_0x444c21['find'](_0x438a3e=>_0x438a3e['plugins']['has']('RealTimeCollaborationClient'))||_0x444c21[0x0],_0x1a4109=_0x5869c2['plugins']['has']('RealTimeCollaborationClient')&&_0x5869c2['plugins']['get']('RealTimeCollaborationClient')['sessionId'];this['_sessionId']=_0x1a4109||ot();}return this['_sessionId'];}async['getDocumentData'](){const _0x2205da=Ws(this['context']);if(!_0x2205da['length'])throw new at('ai-get-editor-from-context-no-editor');const _0x3769ae=[],_0x167424=new Set();for(const _0x4956f1 of _0x2205da){const _0x4d745c=_0x4956f1['config']['get']('roots')||{};for(const _0x5c2e2d of _0x4956f1['model']['document']['getRoots']()){if('$graveyard'===_0x5c2e2d['rootName'])continue;const _0x5975bd=await this['_getDocumentDataForEditorRoot'](_0x4956f1,_0x5c2e2d,_0x167424),_0xaecf7d=_0x4d745c[_0x5c2e2d['rootName']];let _0x5c619c;_0xaecf7d?.['label']?_0x5c619c=_0xaecf7d['label']:(It('ai-document-root-missing-label',{'editor':_0x4956f1,'rootConfig':_0xaecf7d}),_0x5c619c=_0x5c2e2d['rootName']),_0x3769ae['push']({'editor':_0x4956f1,'rootName':_0x5c2e2d['rootName'],'content':_0x5975bd['content'],'version':_0x5975bd['version'],'sessionId':this['sessionId'],'channelId':_0x4956f1['config']['get']('collaboration.channelId'),'selections':_0x5975bd['selections'],'name':_0x5c619c,'description':_0xaecf7d?.['description']});}}return _0x3769ae;}async['_getDocumentDataForEditorRoot'](_0x585f23,_0x301d9d,_0x30a01e){const _0x5d13a1=_0x585f23['data']['toView'](_0x301d9d,{'convertAiChatSelectionMarker':!0x0}),_0x5a14de=new _0x4e0ecd(_0x585f23['editing']['view']['document']);this['_setDataIdsOnChildren'](_0x5d13a1,_0x5a14de,_0x30a01e);let _0x523bb9=await this['_getDocumentDataStringFromView'](_0x5d13a1,_0x585f23);const _0x142337=this['_getMarkersInDocumentOrder'](_0x585f23,_0x301d9d),_0x55eb6e=[];for(const _0x4e954b of _0x142337){const _0x184e37='<'+_0x4e954b['name']+':start></'+_0x4e954b['name']+':start>',_0x3732f3=_0x523bb9['indexOf'](_0x184e37);_0x523bb9=_0x523bb9['substring'](0x0,_0x3732f3)+_0x523bb9['substring'](_0x3732f3+_0x184e37['length']);const _0x589734='<'+_0x4e954b['name']+':end></'+_0x4e954b['name']+':end>',_0x4d9776=_0x523bb9['indexOf'](_0x589734);_0x523bb9=_0x523bb9['substring'](0x0,_0x4d9776)+_0x523bb9['substring'](_0x4d9776+_0x589734['length']),_0x55eb6e['push']({'markerName':_0x4e954b['name'],'start':_0x3732f3,'end':_0x4d9776,'htmlFragment':_0x523bb9['substring'](_0x3732f3,_0x4d9776)});}return{'content':_0x523bb9,'version':_0x585f23['model']['document']['version'],'selections':_0x55eb6e};}async['afterInit'](){this['context']instanceof _0x1c72cb?this['_integrateEditor'](this['context']):this['listenTo'](this['context']['editors'],'add',(_0x3f05a8,_0x16da95)=>{_0x16da95['on']('ready',()=>{this['_integrateEditor'](_0x16da95);});});}['_setOutputDataProcessor'](_0x1065f9){this['_outputDataProcessor']=_0x1065f9;}async['_getDocumentDataStringFromView'](_0x5f497e,_0x4f39df){let _0x233704;if(this['_outputDataProcessor']){const _0x44334d=_0x4f39df['data']['processor']['domConverter']['viewToDom'](_0x5f497e),_0x3d0578=await this['_outputDataProcessor'](_0x44334d);_0x233704=_0x4f39df['data']['processor']['htmlWriter']['getHtml'](_0x3d0578);}else _0x233704=_0x4f39df['data']['processor']['toData'](_0x5f497e);return _0x233704;}['_integrateEditor'](_0x13726a){if(!_0x13726a['config']['get']('collaboration.channelId'))throw new at('ai-missing-channel-id',_0x13726a);_0x13726a['ui']['focusTracker']['on']('change:isFocused',(_0x47c9e1,_0x44a275,_0x375bf7)=>{_0x375bf7&&(this['_lastContentFocusedEditor']=_0x13726a);}),_0x13726a['on']('destroy',()=>{this['_lastContentFocusedEditor']===_0x13726a&&(this['_lastContentFocusedEditor']=void 0x0);}),_0x13726a['conversion']['for']('editingDowncast')['markerToHighlight']({'model':zs,'view':({markerName:_0x65db7c})=>({'classes':['ck-ai-assistant-ui_theme','ck-fake-ai-selection','ck-fake-ai-selection-'+_0x65db7c['split'](':')[0x1]],'priority':0xc})}),_0x13726a['conversion']['for']('dataDowncast')['markerToElement']({'model':zs+':context','view':(_0x5bfafe,{writer:_0x524c13,options:_0x26b164})=>_0x26b164['convertAiChatSelectionMarker']?_0x524c13['createUIElement'](_0x5bfafe['markerName']+':'+(_0x5bfafe['isOpening']?'start':'end')):null});}['showFakeVisualSelection'](_0x1498a2){const _0xbbe67=this['_fakeSelections'][0x0]||null;this['_addFakeSelection'](_0x1498a2);const _0x12ce85=this['_fakeSelections'][0x0]||null;this['_refreshFakeSelection'](_0xbbe67,_0x12ce85);}['hideFakeVisualSelection'](_0x5d6e11){const _0x5df9b1=this['_fakeSelections'][0x0]||null;this['_removeFakeSelectionById'](_0x5d6e11);const _0x22c2ae=this['_fakeSelections'][0x0]||null;this['_refreshFakeSelection'](_0x5df9b1,_0x22c2ae);}async['modelToDataWithIds'](_0x221e61){const _0x35379d=$s(this['context']),_0x11b8e0=_0x35379d['data']['toView'](_0x221e61),_0x5ced89=new _0x4e0ecd(_0x35379d['editing']['view']['document']);return this['_setDataIdsOnChildren'](_0x11b8e0,_0x5ced89),this['_getDocumentDataStringFromView'](_0x11b8e0,_0x35379d);}['_setDataIdsOnChildren'](_0xa885ea,_0x466a08,_0x22d1ab=new Set()){let _0x3a1263=!0x1;for(const _0x16776b of _0xa885ea['getChildren']()){if(!_0x16776b['is']('view:element')||js['includes'](_0x16776b['name']))continue;const _0x3acd3a=_0x16776b['is']('view:containerElement'),_0x2d2db2=_0x16776b['is']('view:emptyElement'),_0x17349b=this['_setDataIdsOnChildren'](_0x16776b,_0x466a08,_0x22d1ab);if(_0x16776b['hasAttribute']('data-id')){_0x3a1263=!0x0,_0x22d1ab['add'](_0x16776b['getAttribute']('data-id'));continue;}(_0x3acd3a||_0x2d2db2||_0x17349b)&&(_0x466a08['setAttribute']('data-id',this['_nextDataId'](_0x22d1ab),_0x16776b),_0x3a1263=!0x0);}return _0x3a1263;}['_nextDataId'](_0xdb5d9a){let _0x12b794;do{_0x12b794='';for(let _0x35ed55=0x0;_0x35ed55<0x4;_0x35ed55++)_0x12b794+=String['fromCharCode'](0x61+Math['floor'](0x1a*Math['random']()));}while(_0xdb5d9a['has'](_0x12b794));return _0xdb5d9a['add'](_0x12b794),_0x12b794;}['getSelectionText'](){const {model:_0x32d7a2}=$s(this['context']),_0x5d53d1=_0x32d7a2['document']['selection'],_0x404799=[],_0x4d41ca=Array['from'](_0x5d53d1['getRanges']());_0x4d41ca['sort']((_0xe62d28,_0x45ce4f)=>_0xe62d28['start']['isBefore'](_0x45ce4f['start'])?-0x1:0x1);for(const _0x454318 of _0x4d41ca)for(const _0x783f3f of _0x454318['getItems']())_0x783f3f['is']('$textProxy')?_0x404799['push'](_0x783f3f['data']):_0x783f3f['is']('element')&&_0x404799['length']>0x0&&'\x20'!==_0x404799[_0x404799['length']-0x1]&&_0x404799['push']('\x20');return _0x404799['length']?'\x22'+_0x404799['join']('')['trim']()+'\x22':hs(this['context']['locale'],'AI_CHAT_CONTEXT_DOCUMENT_SELECTION_LABEL');}['_removeFakeSelectionById'](_0x4a1f3f){for(let _0x3e9abc=0x0;_0x3e9abc<this['_fakeSelections']['length'];_0x3e9abc++)if(this['_fakeSelections'][_0x3e9abc]['id']==_0x4a1f3f)return void this['_fakeSelections']['splice'](_0x3e9abc,0x1);}['_addFakeSelection'](_0x35bea0){this['_removeFakeSelectionById'](_0x35bea0['id']),wt(this['_fakeSelections'],_0x35bea0);}['_refreshFakeSelection'](_0x2d55a8,_0x374ea4){if(_0x2d55a8==_0x374ea4)return;const _0x2734ba=_0x2d55a8?this['_getEditorForFakeSelection'](_0x2d55a8):null,_0x4073e9=_0x374ea4?this['_getEditorForFakeSelection'](_0x374ea4):null,_0x23203f=(_0x37143b,_0x450a9d)=>{const _0x46f1de=_0x450a9d['model']['markers']['getMarkersGroup'](zs);for(const _0x38022d of _0x46f1de)_0x37143b['removeMarker'](_0x38022d);},_0x35434f=(_0x3b1464,_0x36e831,_0x4af896)=>{const _0x198a3f=_0x36e831['model'];for(let _0x3af51d=0x0;_0x3af51d<_0x4af896['ranges']['length'];_0x3af51d++){let _0x1101a1=_0x4af896['ranges'][_0x3af51d];const _0x33cf6b=zs+':'+_0x4af896['id']+':'+_0x3af51d;if(_0x1101a1['start']['isAtEnd']){const _0x410b01=_0x1101a1['start']['getLastMatchingPosition'](({item:_0x15a0c2})=>!_0x198a3f['schema']['isContent'](_0x15a0c2),{'boundaries':_0x1101a1});_0x1101a1=_0x3b1464['createRange'](_0x410b01,_0x1101a1['end']);}_0x3b1464['addMarker'](_0x33cf6b,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x1101a1});}};_0x2734ba&&_0x4073e9&&_0x2734ba===_0x4073e9&&_0x374ea4?_0x2734ba['model']['change'](_0x5109ed=>{_0x23203f(_0x5109ed,_0x2734ba),_0x35434f(_0x5109ed,_0x4073e9,_0x374ea4);}):(_0x2734ba&&_0x2734ba['model']['change'](_0xa313f1=>_0x23203f(_0xa313f1,_0x2734ba)),_0x4073e9&&_0x374ea4&&_0x4073e9['model']['change'](_0x4a4cdd=>_0x35434f(_0x4a4cdd,_0x4073e9,_0x374ea4)));}['_getEditorForFakeSelection'](_0x41746a){if(!_0x41746a['ranges']['length'])return $s(this['context']);const _0x1535ad=_0x41746a['ranges'][0x0]['root']['document'];return Ws(this['context'])['find'](_0x46c211=>_0x46c211['model']['document']===_0x1535ad)??$s(this['context']);}['_getMarkersInDocumentOrder'](_0x255ee4,_0x4619f1){const _0x539869=Array['from'](_0x255ee4['model']['markers']['getMarkersGroup'](zs+':context'));return(_0x4619f1?_0x539869['filter'](_0x38b250=>{const _0x16724d=_0x38b250['getRange']();return _0x16724d&&_0x16724d['root']['rootName']===_0x4619f1['rootName'];}):_0x539869)['sort']((_0x2d5149,_0x49cdab)=>_0x2d5149['getStart']()['isBefore'](_0x49cdab['getStart']())?-0x1:_0x2d5149['getStart']()['isAfter'](_0x49cdab['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(_0x402a85){const _0x44ffe4=new AbortController();return{'promise':new Promise((_0x3e3915,_0x6d9f5c)=>{const _0x4bb1f0=setTimeout(_0x3e3915,_0x402a85);_0x44ffe4['signal']['addEventListener']('abort',()=>{clearTimeout(_0x4bb1f0),_0x6d9f5c();});}),'abortController':_0x44ffe4};}class sn{['options'];['isStreaming']=!0x1;['document']=null;['nodesList']=[];['currentIndex']=0x0;['timeoutAbortController']=null;['lastUpdateTime']=0x0;constructor(_0x548058){this['options']={'delay':_0x548058?.['delay']??0xa,'textNodeStyle':_0x548058?.['textNodeStyle']??'animation:\x20ck-html-streamer-fade-in\x20.3s'};}async['stream']({document:_0x56e1fc,targetElement:_0x50293b,abortSignal:_0x2f259d}){this['isStreaming']&&this['stop'](),_0x2f259d?.['addEventListener']('abort',this['stop']['bind'](this)),this['document']=_0x4af169(_0x56e1fc,!0x0),this['nodesList']=this['getParsedDocumentNodeList'](),this['isStreaming']=!0x0,this['currentIndex']>this['nodesList']['length']&&(this['currentIndex']=this['nodesList']['length']);for(let _0x3337df=0x0;_0x3337df<this['currentIndex'];_0x3337df++)this['nodesList'][_0x3337df]['shouldBeStreamed']=!0x0;do{const _0x2236b4=Date['now'](),_0x28ba77=this['nodesList'][this['currentIndex']],_0xd5ffd4=_0x2236b4-this['lastUpdateTime'];if(_0x28ba77){_0x28ba77['shouldBeStreamed']=!0x0;let _0x4cd9bb=_0x28ba77['parent'];for(;_0x4cd9bb;)_0x4cd9bb['shouldBeStreamed']=!0x0,_0x4cd9bb=_0x4cd9bb['parent'];}if(_0xd5ffd4<this['options']['delay'])try{const {promise:_0x4d5826,abortController:_0x4e1022}=en(this['options']['delay']-_0xd5ffd4);this['timeoutAbortController']=_0x4e1022,await _0x4d5826;}catch(_0x2ecd39){return;}_0x17f24f(_0x50293b,'<'+_0x50293b['tagName']+'>'+this['renderNode'](this['document'])+'</'+_0x50293b['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:_0x2bcaf8}){Array['from'](_0x2bcaf8['querySelectorAll']('span[data-ck-html-streamer-word-chunk]'))['reverse']()['forEach'](_0x51a2ac=>{_0x51a2ac['replaceWith'](_0x51a2ac['childNodes'][0x0]);});}['stop'](){this['isStreaming']=!0x1,this['timeoutAbortController']&&(this['timeoutAbortController']['abort'](),this['timeoutAbortController']=null);}['renderNode'](_0x3c7a95){let _0x4b0b5d='';if(function(_0x4649c6){return _0x39ed11(_0x4649c6);}(_0x3c7a95)){for(const _0x3c1ac9 of _0x3c7a95['children'])_0x4b0b5d+=this['renderNode'](_0x3c1ac9);}else{if(on(_0x3c7a95)){if(!_0x3c7a95['shouldBeStreamed'])return'';const _0x42adac=_0x3c7a95,_0x5ee01a=Object['entries'](_0x42adac['attribs'])['map'](([_0x3f35d4,_0x5eafb2])=>_0x3f35d4+'=\x22'+_0x5eafb2+'\x22')['join']('\x20');_0x4b0b5d+='<'+_0x42adac['tagName']+(_0x5ee01a?'\x20'+_0x5ee01a:'')+'>';for(const _0x3fa3b0 of _0x295f3a(_0x42adac))_0x4b0b5d+=this['renderNode'](_0x3fa3b0);_0x4b0b5d+='</'+_0x42adac['tagName']+'>';}else{if(!rn(_0x3c7a95))return'';if(!_0x3c7a95['shouldBeStreamed'])return'';!function(_0x570ca2){if(!_0x570ca2['parent']||!on(_0x570ca2['parent']))return!0x1;if(!nn['includes'](_0x570ca2['parent']['tagName']))return!0x1;return!_0x8227a4(_0x570ca2)['match'](/^\s*[<>]\s*$/);}(_0x3c7a95)?_0x4b0b5d+=ti(_0x3c7a95):_0x4b0b5d+=ti(new _0xae4b38('span',{'data-ck-html-streamer-word-chunk':'','style':this['options']['textNodeStyle']},[_0x3c7a95]));}}return _0x4b0b5d;}['getParsedDocumentNodeList'](){const _0x3acaa8=[];return function(_0xdb4b3,_0x5def18){const _0x512b79=_0x857878=>{if(_0x5def18(_0x857878),_0x857878 instanceof _0x12418d)for(let _0x1b5d8f=0x0;_0x1b5d8f<_0x857878['children']['length'];_0x1b5d8f++){const _0x4ed3f4=_0x857878['children'][_0x1b5d8f];_0x512b79(_0x4ed3f4);}};for(let _0x23d635=0x0;_0x23d635<_0xdb4b3['children']['length'];_0x23d635++)_0x512b79(_0xdb4b3['children'][_0x23d635]);}(this['document'],_0x17cb35=>{if(rn(_0x17cb35)){const _0x5bb181=this['splitTextNodeIntoWordNodes'](_0x17cb35);_0x5bb181['length']&&_0x3acaa8['push'](..._0x5bb181);}_0x17cb35['isWordSplitSource']||_0x17cb35['isWordSplitResult']||_0x3acaa8['push'](_0x17cb35);}),_0x3acaa8;}['splitTextNodeIntoWordNodes'](_0x4eddf2){if(_0x4eddf2['isWordSplitSource']||_0x4eddf2['isWordSplitResult'])return[];const _0x47b6b9=_0x8227a4(_0x4eddf2)['match'](/(?:\s*\S+\s*)/g),_0x2319ba=[];if(_0x47b6b9&&_0x47b6b9['length']>0x1){for(const _0x530350 of _0x47b6b9){const _0xda6a=new _0x303276(_0x530350);_0xda6a['isWordSplitResult']=!0x0,_0x506989(_0x4eddf2,_0xda6a),_0x2319ba['push'](_0xda6a);}_0x4eddf2['isWordSplitSource']=!0x0,_0x48b852(_0x4eddf2);}return _0x2319ba;}}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(_0x262955){return _0x1de0fd(_0x262955);}function on(_0x3bd8ac){return _0x5c243a(_0x3bd8ac);}class an extends vt{['options'];['content']='';['htmlStreamer'];['children'];constructor(_0x2cf7e4){super();const _0x67989f=this['bindTemplate'];this['set']('isDone',!0x1),this['set']('isVisible',!0x0),this['htmlStreamer']=new sn(),this['options']=_0x2cf7e4,this['children']=this['createCollection'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed__item',_0x67989f['if']('isDone','ck-ai-chat__feed__item_done'),_0x67989f['if']('isVisible','ck-hidden',_0x2dac88=>!_0x2dac88),'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'](_0x50b57d=>{_0x50b57d['removeAttribute']('data-id');}),this['isDone']=!0x0;}async['streamIntoElement'](_0x59d539,_0x12085d,_0x4a724a){await this['htmlStreamer']['stream']({'document':_0x59d539,'targetElement':_0x12085d,'abortSignal':_0x4a724a});}}class hn extends vt{['showChangesToggleView'];constructor(_0x4b7e15,_0x513bde){super(_0x4b7e15),this['set']('isShowChangesToggleVisible',!0x0),this['showChangesToggleView']=new cn(_0x4b7e15),this['showChangesToggleView']['set']({'class':'ck-ai-suggestion__header__show-changes-toggle\x20ck-ai-chat-controls-button\x20'+us,'label':hs(_0x4b7e15,'AI_SUGGESTION_BUTTON_SHOW_CHANGES'),'withText':!0x0}),this['showChangesToggleView']['isOn']=_0x513bde['showDiff'],this['showChangesToggleView']['bind']('isVisible')['to'](this,'isShowChangesToggleVisible'),this['showChangesToggleView']['bind']('icon')['to'](this['showChangesToggleView'],'isOn',_0x1e7a18=>_0x1e7a18?_0x3ca403:_0x5a5d46),this['showChangesToggleView']['on']('execute',()=>{this['showChangesToggleView']['isOn']=!this['showChangesToggleView']['isOn'],this['fire']('toggleShowChanges',{'isOn':this['showChangesToggleView']['isOn']});});const _0x106b08=new xt();_0x106b08['content']=_0x5857a1,this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__header',!0x1===_0x513bde['showHeader']?'ck-hidden':null]['filter'](Boolean)},'children':[_0x106b08,{'tag':'span','children':[hs(_0x4b7e15,'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':_0x306837,'rejected':_0x12445e,'outdated':_0x12445e};class un extends vt{['stateIconView'];constructor(_0x356d3b){super(_0x356d3b);const _0x642bd6=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',_0x642bd6['to']('state',_0xd5b3e=>'ck-ai-suggestion__content-part-state_'+_0xd5b3e),_0x642bd6['if']('isVisible','ck-hidden',_0x286d31=>!_0x286d31)]},'children':[{'tag':'span','attributes':{'class':['ck-ai-suggestion__content-part-state__label']},'children':[{'text':_0x642bd6['to']('state',_0x546ebc=>{switch(_0x546ebc){case'accepted':return hs(_0x356d3b,'AI_SUGGESTION_CONTENT_PART_STATE_ACCEPTED');case'rejected':return hs(_0x356d3b,'AI_SUGGESTION_CONTENT_PART_STATE_REJECTED');case'outdated':return hs(_0x356d3b,'AI_SUGGESTION_CONTENT_PART_STATE_OUTDATED');}})}]},this['stateIconView']]});}['setState'](_0x1300ca){this['state']=_0x1300ca;}}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(_0x286217,_0x4b67fa,_0xa9d3ba){super(_0x286217);const _0x1cb87a=Boolean(_0xa9d3ba);this['set']('isEnabled',!_0x1cb87a),this['set']('isVisible',!0x0),this['class']='ck-ai-suggestion-content-part-toolbar';const _0x3992f1=[];if(_0x1cb87a){const _0x185cd3=new Nt(_0x286217);_0x185cd3['set']({'label':hs(_0x286217,'AI_SUGGESTION_DISABLED_TOOLTIP_MESSAGE'),'tooltip':!0x0,'withText':!0x1,'icon':_0x23ad4d}),_0x185cd3['extendTemplate']({'attributes':{'data-cke-tooltip-class':'ck-ai-suggestion-content-part-disabled-actions-tooltip'}}),_0x3992f1['push'](_0x185cd3);}else{_0x4b67fa['includes']('applySuggestion')&&(this['_applyButton']=new Nt(_0x286217),this['_applyButton']['set']({'label':hs(_0x286217,'AI_SUGGESTION_CONTENT_PART_APPLY'),'tooltip':!0x0,'tooltipPosition':'n','withText':!0x1,'icon':_0x306837}),this['_applyButton']['bind']('isEnabled')['to'](this),this['_applyButton']['on']('execute',()=>{this['fire']('applySuggestion');}),_0x3992f1['push'](this['_applyButton'])),_0x4b67fa['includes']('insertSuggestion')&&(this['_suggestButton']=new Nt(_0x286217),this['_suggestButton']['set']({'label':hs(_0x286217,'AI_SUGGESTION_CONTENT_PART_ADD_SUGGESTION'),'tooltip':!0x0,'tooltipPosition':'n','withText':!0x1,'icon':_0x2e4bd0}),this['_suggestButton']['bind']('isEnabled')['to'](this),this['_suggestButton']['on']('execute',()=>{this['fire']('insertSuggestion');}),_0x3992f1['push'](this['_suggestButton']));const _0x1241cf=new Nt(_0x286217);_0x1241cf['set']({'label':hs(_0x286217,'AI_SUGGESTION_CONTENT_PART_REJECT'),'tooltip':!0x0,'tooltipPosition':'n','withText':!0x1,'icon':_0x12445e}),_0x1241cf['bind']('isEnabled')['to'](this),_0x1241cf['on']('execute',()=>{this['fire']('rejectSuggestion');}),_0x3992f1['push'](_0x1241cf);}this['items']['addMany'](_0x3992f1);const _0x26ed94=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':[_0x26ed94['if']('isVisible','ck-hidden',_0x3bd473=>!_0x3bd473)]}});}['setButtonsVisibility']({showApplyButton:_0x290ace,showSuggestButton:_0x20e4dd}){this['_applyButton']&&(this['_applyButton']['isVisible']=_0x290ace),this['_suggestButton']&&(this['_suggestButton']['isVisible']=_0x20e4dd);}}class gn extends vt{['toolbarView'];['stateView'];['titleLabelView'];['children'];constructor(_0x1a548e,{part:_0x2e2bfa,uiIndex:_0x442183,availableActions:_0x2f094f,areActionsDisabled:_0x374fba}){super(_0x1a548e),this['set']('isEnabled',!0x0),this['set']('state','pending'),this['toolbarView']=new _n(_0x1a548e,_0x2f094f,_0x374fba),this['toolbarView']['on']('rejectSuggestion',()=>{this['fire']('rejectSuggestion',{'index':_0x2e2bfa['index']});}),this['toolbarView']['on']('insertSuggestion',()=>{this['fire']('insertSuggestion',{'index':_0x2e2bfa['index']});}),this['toolbarView']['on']('applySuggestion',()=>{this['fire']('applySuggestion',{'index':_0x2e2bfa['index']});}),this['toolbarView']['bind']('isEnabled')['to'](this),this['stateView']=new un(_0x1a548e),this['titleLabelView']=new An(_0x1a548e,_0x442183),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',(_0x29d02e,_0x9ec5cf,_0x39cf3b,_0x42617f)=>{'pending'===_0x42617f?this['children']['remove'](this['toolbarView']):this['children']['remove'](this['stateView']),'pending'===_0x39cf3b?this['children']['add'](this['toolbarView']):(this['stateView']['setState'](_0x39cf3b),this['children']['add'](this['stateView']));});}}class An extends vt{constructor(_0x3a31f3,_0x5f4b80){super(_0x3a31f3),this['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai-suggestion__body__content-part__title__label']},'children':[hs(_0x3a31f3,'AI_SUGGESTION_CONTENT_PART_TITLE',_0x5f4b80['toString']())]});}}class In extends vt{['htmlStreamer'];constructor(_0x1fadf1){super(_0x1fadf1),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:_0x5d6ead,renderingStrategy:_0x132312,abortSignal:_0x421c10}){'streaming'===_0x132312?await this['htmlStreamer']['stream']({'document':_0x5d6ead['content'],'targetElement':this['element'],'abortSignal':_0x421c10}):_0x17f24f(this['element'],'<'+this['element']['tagName']+'>'+gs(_0x5d6ead['content'])+'</'+this['element']['tagName']+'>',{'childrenOnly':!0x0});}['clear'](){this['htmlStreamer']['reset'](),this['element']['innerHTML']='';}}class En extends vt{['_children'];['_headerView'];['_streamableContentView'];constructor(_0x328975,{part:_0x552b51,uiIndex:_0x2179f7,areActionsDisabled:_0x52652c,availableActions:_0x2afbb9}){super(_0x328975);const _0x28f54c=this['bindTemplate'];this['set']('state','pending'),this['set']('isDone',!0x1),this['set']('isVisible',!0x1),this['set']('isActive',!0x1),this['set']('isEnabled',!0x1);const _0x80106=()=>{this['isEnabled']=this['isDone']&&'pending'==this['state']&&!_0x52652c;};this['on']('change:state',_0x80106),this['on']('change:isDone',_0x80106),_0x80106(),this['_children']=this['createCollection'](),this['_headerView']=new gn(_0x328975,{'part':_0x552b51,'uiIndex':_0x2179f7,'availableActions':_0x2afbb9,'areActionsDisabled':_0x52652c}),this['_headerView']['bind']('isEnabled','state')['to'](this),this['_headerView']['delegate'](...Zs)['to'](this),this['_streamableContentView']=new In(_0x328975),this['_children']['addMany']([this['_headerView'],this['_streamableContentView']]),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__body__content-part',_0x28f54c['to']('state',_0x2509e0=>'ck-ai-suggestion__body__content-part_'+_0x2509e0),_0x28f54c['if']('isEnabled','ck-ai-suggestion__body__content-part_enabled'),_0x28f54c['if']('isActive','ck-ai-suggestion__body__content-part_active'),_0x28f54c['if']('isVisible','ck-hidden',_0x180809=>!_0x180809)]},'children':this['_children'],'on':{'mouseenter':_0x28f54c['to'](()=>{this['isEnabled']&&this['fire']('mouseOverSuggestion',{'index':_0x552b51['index']});}),'mouseleave':_0x28f54c['to'](()=>{this['isEnabled']&&this['fire']('mouseLeaveSuggestion',{'index':_0x552b51['index']});}),'click':_0x28f54c['to'](_0x4ead61=>{const _0x486839=_0x4ead61['target'];this['isEnabled']&&!this['_headerView']['toolbarView']['element']['contains'](_0x486839)&&this['fire']('showChangeInText',{'index':_0x552b51['index']});})}});}async['updateContent']({part:_0x2a3e10,showUnchangedParts:_0x58db31=!0x1,abortSignal:_0x5cce63}){this['partDefinition']=_0x2a3e10,this['isVisible']=this['partDefinition']['hasChanges']||_0x58db31,this['isVisible']&&await this['_streamableContentView']['update']({'part':_0x2a3e10,'renderingStrategy':'static','abortSignal':_0x5cce63});}['markAsDone'](){this['isDone']=!0x0;}}class pn extends vt{constructor(_0xff4208,_0x2ed979){super(_0xff4208),this['set']('isVisible',!0x0),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-skeleton',this['bindTemplate']['if']('isVisible','ck-hidden',_0x1683fc=>!_0x1683fc)]},'children':this['_createSkeletonItems'](_0x2ed979)});}['_createSkeletonItems'](_0x6064d0){const _0x16db4b=['ck','ck-ai-skeleton__item'];return _0x6064d0['map'](_0x1cdda9=>{let _0x4299a9='';switch(_0x1cdda9['attributes']['align']){case'right':_0x4299a9='margin-left:\x20auto;\x20margin-right:\x200;\x20text-align:\x20right;';break;case'center':_0x4299a9='margin-left:\x20auto;\x20margin-right:\x20auto;\x20text-align:\x20center;';break;case'left':_0x4299a9='margin-left:\x200;\x20margin-right:\x20auto;\x20text-align:\x20left;';}return{'tag':_0x1cdda9['tag'],'attributes':{'class':[..._0x16db4b,_0x1cdda9['attributes']['class']?_0x1cdda9['attributes']['class']:''],'style':'width:\x20'+_0x1cdda9['attributes']['width']+';\x20height:\x20'+_0x1cdda9['attributes']['height']+';'+_0x4299a9}};});}}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(_0x2f5cc8,_0x2007b7,_0x2aa641,_0x529313){return new Array(_0x2f5cc8)['fill'](null)['map'](()=>({'tag':'div','attributes':{'width':_0x2007b7,'height':_0x2aa641,'align':_0x529313}}));}class Cn extends Tt(){['queue']=[];['isProcessing']=!0x1;['_abortController'];async['enqueue'](_0x536ad5){const _0x3a53a2=this['createTask'](_0x536ad5);return this['queue']['push'](_0x3a53a2),this['_processQueue'](),_0x3a53a2['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(_0x42a160=>{this['once']('_queueEmpty',()=>{_0x42a160();});}):Promise['resolve']();}async['_processQueue'](){if(!this['isProcessing']){this['_abortController']=new AbortController(),this['isProcessing']=!0x0;try{for(;this['queue']['length']&&this['isProcessing'];){const _0x5eb7f0=this['queue']['shift']();try{await _0x5eb7f0['callback'](this['_abortController']['signal']),_0x5eb7f0['resolve']();}catch(_0x4f85bb){_0x5eb7f0['reject'](_0x4f85bb);}}}finally{this['isProcessing']=!0x1,this['_abortController']=void 0x0;}this['fire']('_queueEmpty');}}['createTask'](_0x365f7f){let _0x25c7a9,_0x310a22;const _0x56fd93=new Promise((_0x16e075,_0x32c5f9)=>{_0x25c7a9=_0x16e075,_0x310a22=_0x32c5f9;});return{'callback':_0x365f7f,'resolve':_0x25c7a9,'reject':_0x310a22,'completePromise':_0x56fd93};}}class wn extends an{constructor(_0xcafef8){super(_0xcafef8),this['extendTemplate']({'attributes':{'class':['ck-ai-notification','warning'===_0xcafef8['level']?'ck-ai-notification_warning':'ck-ai-notification_error']}});}['render'](){super['render'](),this['setContent'](this['options']['initialContent']),this['markAsDone']();}['setContent'](_0x2f0025){this['element']['innerHTML']=_0x2f0025;}}const fn=['applySuggestion','insertSuggestion'];class bn extends vt{['_applyChangesButton'];['_insertSuggestionsButton'];['children'];constructor(_0x383024,_0x58d1ed=[...fn],_0xd58d2e){super(_0x383024);const _0x5b41e4=this['bindTemplate'],_0x483109=Boolean(_0xd58d2e);if(this['set']('isEnabled',!_0x483109),this['set']('isVisible',!0x1),this['set']('isTrackChangesOn',!0x1),this['children']=this['createCollection'](),_0x483109){const _0x3c6b83=new Nt(_0x383024);_0x3c6b83['set']({'label':hs(_0x383024,'AI_SUGGESTION_DISABLED_TOOLTIP_MESSAGE'),'tooltip':!0x0,'withText':!0x1,'icon':_0x23ad4d}),_0x3c6b83['extendTemplate']({'attributes':{'data-cke-tooltip-class':'ck-ai-suggestion-content-part-disabled-actions-tooltip'}});const _0x2ef800=new vt(_0x383024);_0x2ef800['setTemplate']({'tag':'div','attributes':{'class':'ck-ai-chat__feed__suggestion__actions__info'},'children':[{'tag':'p','children':[hs(_0x383024,'AI_SUGGESTION_DISABLED_FEED_MESSAGE'),_0x3c6b83]}]}),this['children']['add'](_0x2ef800);}else this['_applyChangesButton']=new Nt(_0x383024),this['_applyChangesButton']['set']({'label':hs(_0x383024,'AI_CHAT_SUGGESTION_ACTION_APPLY_ALL'),'withText':!0x0,'type':'button','isVisible':_0x58d1ed['includes']('applySuggestion'),'class':cs}),this['_insertSuggestionsButton']=new Nt(_0x383024),this['_insertSuggestionsButton']['set']({'label':hs(_0x383024,'AI_CHAT_SUGGESTION_ACTION_SUGGEST_ALL'),'withText':!0x0,'type':'button','isVisible':_0x58d1ed['includes']('insertSuggestion'),'class':ls}),this['_insertSuggestionsButton']['on']('execute',()=>{this['fire']('insertSuggestion');}),this['_applyChangesButton']['on']('execute',()=>{this['fire']('applySuggestion');}),[this['_applyChangesButton'],this['_insertSuggestionsButton']]['forEach'](_0xfd1557=>{_0xfd1557['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',_0x5b41e4['if']('isVisible','ck-hidden',_0x1251c4=>!_0x1251c4)]},'children':this['children']}),this['on']('change:isTrackChangesOn',()=>{this['_applyChangesButton']&&(this['_applyChangesButton']['isVisible']=!this['isTrackChangesOn']);});}['updateVisibility'](_0x593988){this['isVisible']=_0x593988;}['_switchButtonLabelsPlurality'](_0x13e323){this['_applyChangesButton']&&this['_insertSuggestionsButton']&&(_0x13e323?(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(_0x385f9f,_0x5d27d0){super(_0x385f9f),this['bodyCollection']=_0x5d27d0,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',_0xed6de2=>!_0xed6de2)]},'children':this['children']});const _0x563eb9=new vt(this['locale']),_0x1cf583=new xt();_0x1cf583['content']=_0x3d1340,_0x563eb9['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-web-sources__header']},'children':[_0x1cf583,{'tag':'span','children':[{'text':hs(this['locale'],'AI_CHAT_SOURCES_HEADER')}]}]}),this['children']['add'](_0x563eb9),this['_setupBalloonPanel'](_0x385f9f);}['addSource'](_0x24a947){this['children']['add'](new Rn(this['locale'],_0x24a947,this['balloonPanelView']));}['_setupBalloonPanel'](_0x490613){this['balloonPanelView']=new Xt(_0x490613),this['balloonPanelView']['extendTemplate']({'attributes':{'class':['ck-ai-web-source__tooltip-balloon']}}),this['bodyCollection']['add'](this['balloonPanelView']);}}class Rn extends Nt{['balloonPanelView'];['source'];constructor(_0x55ce31,_0x42c359,_0x1bf5bf){super(_0x55ce31),this['source']=_0x42c359,this['balloonPanelView']=_0x1bf5bf,this['set']({'label':_0x42c359['title'],'class':['ck\x20ck-ai-web-source'],'withText':!0x0});const _0x41a867=this['bindTemplate'];if(this['extendTemplate']({'on':{'click':_0x41a867['to'](()=>{window['open'](_0x42c359['url'],'_blank');}),'mouseenter':_0x41a867['to'](()=>{this['_showTooltip']();}),'mouseleave':_0x41a867['to'](()=>{this['_hideTooltip']();})}}),_0x42c359['favicon']){const _0x1c0919=new vt(_0x55ce31);_0x1c0919['setTemplate']({'tag':'img','attributes':{'src':_0x42c359['favicon']||_0x3d1340,'alt':_0x42c359['title'],'class':['ck-ai-web-source__image']}}),this['children']['add'](_0x1c0919);}else this['set']('icon',_0x3d1340);}['_createTooltipContentView'](_0xceab6,_0x4abd1d){const _0x29028e=new vt(_0xceab6),_0x4fa328=[];let _0x4c19f9;_0x4abd1d?.['favicon']?(_0x4c19f9=new vt(_0xceab6),_0x4c19f9['setTemplate']({'tag':'img','attributes':{'src':_0x4abd1d['favicon'],'alt':_0x4abd1d['title'],'class':['ck-ai-web-source__tooltip-image']}})):(_0x4c19f9=new xt(),_0x4c19f9['content']=_0x3d1340,_0x4c19f9['extendTemplate']({'attributes':{'alt':_0x4abd1d['title'],'class':['ck-ai-web-source__tooltip-image']}})),_0x4fa328['push'](_0x4c19f9);const _0x334a66=new vt(_0xceab6);_0x334a66['setTemplate']({'tag':'a','attributes':{'class':['ck-ai-web-source__tooltip-url'],'href':_0x4abd1d['url']},'children':[{'text':new URL(_0x4abd1d['url'])?.['hostname']}]}),_0x4fa328['push'](_0x334a66);const _0x1c5ce3=new vt(_0xceab6);_0x1c5ce3['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-web-source__tooltip-row']},'children':_0x4fa328});const _0xc3128a=new vt(_0xceab6);return _0xc3128a['setTemplate']({'tag':'span','attributes':{'class':['ck-ai-web-source__tooltip-row','ck-ai-web-source__tooltip-title']},'children':[{'text':_0x4abd1d['title']['length']>0x190?_0x4abd1d['title']['substring'](0x0,0x190)+'...':_0x4abd1d['title']}]}),_0x29028e['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-web-source__tooltip']},'children':[_0x1c5ce3,_0xc3128a]}),_0x29028e;}['_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 _0x26500d=this['_createTooltipContentView'](this['locale'],this['source']);this['balloonPanelView']['content']['add'](_0x26500d);}}class On extends vt{['_actionsView'];['_sourcesView'];['_children'];['_skeletonView'];['_showSkeletonDebounced']=_0x521085(()=>{this['_skeletonView']['isVisible']=!0x0,this['_skeletonShownAt']=Date['now']();},0x3e8);['_skeletonShownAt']=null;['_areActionsDisabled'];['_showUnchangedParts'];['_updateContentPartsPromiseQueue'];['_emptyPartsWarningView'];['_availableActions'];['_cachedContentParts']=[];constructor(_0x594b0e,_0x29c005){super(_0x594b0e);const {areActionsDisabled:_0x3f05c0,showUnchangedParts:_0x27990d,availableActions:_0x52f277}=_0x29c005;this['_areActionsDisabled']=_0x3f05c0,this['_showUnchangedParts']=_0x27990d,this['_availableActions']=_0x52f277,this['set']('hasPendingParts',!0x1),this['set']('isTrackChangesOn',!0x1),this['_children']=this['createCollection'](),this['_skeletonView']=new pn(_0x594b0e,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(_0x594b0e,'AI_SUGGESTION_EMPTY_PART_WARNING'),'level':'warning'}),this['_emptyPartsWarningView']['isVisible']=!0x1,this['_actionsView']=new bn(_0x594b0e,_0x29c005['availableActions'],this['_areActionsDisabled']),this['_actionsView']['bind']('isTrackChangesOn')['to'](this),this['_sourcesView']=new Sn(this['locale'],_0x29c005['bodyCollection']),_0x29c005['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'](_0x139bea=>_0x139bea instanceof En);}async['updateContentParts']({parts:_0x20188f,abortSignal:_0x3c2b19,skipLoadingEffects:_0x2efb38}){this['_cachedContentParts']['length']?_0x20188f['forEach'](_0xc6d76b=>{const _0x26c59a=this['_cachedContentParts']['findIndex'](_0xebeafa=>_0xebeafa['index']==_0xc6d76b['index']);-0x1===_0x26c59a?this['_cachedContentParts']['push'](_0xc6d76b):this['_cachedContentParts'][_0x26c59a]=_0xc6d76b;}):this['_cachedContentParts']=_0x20188f;const _0x22b6a2=this['_showUnchangedParts']?_0x20188f:_0x20188f['filter'](_0x1fe105=>_0x1fe105['hasChanges']);this['_actionsView']['_switchButtonLabelsPlurality'](_0x22b6a2['length']>0x1),_0x2efb38&&(this['_showSkeletonDebounced']['cancel'](),this['_skeletonView']['isVisible']=!0x1);for(const _0x53799c of _0x22b6a2)this['_updateContentPartsPromiseQueue']['enqueue'](async _0x5f165c=>{let _0x1ffed0=this['getPartView'](_0x53799c['index']);if(!_0x1ffed0){if(_0x1ffed0=new En(this['locale'],{'part':_0x53799c,'uiIndex':this['_contentPartViews']['length']+0x1,'areActionsDisabled':this['_areActionsDisabled'],'availableActions':this['_availableActions']}),_0x1ffed0['delegate'](...Zs)['to'](this),!_0x2efb38&&(this['_showSkeletonDebounced']['cancel'](),await this['_awaitMinimumSkeletonDisplayTime'](_0x5f165c),_0x5f165c['aborted']))return;this['_skeletonView']['isVisible']=!0x1,this['_children']['add'](_0x1ffed0,this['_children']['length']-0x1),this['hasPendingParts']=!0x0,_0x2efb38||this['_showSkeletonDebounced']();}await _0x1ffed0['updateContent']({'part':_0x53799c,'showUnchangedParts':this['_showUnchangedParts'],'abortSignal':_0x5f165c}),_0x1ffed0['markAsDone']();});return _0x3c2b19?.['addEventListener']('abort',()=>{this['_updateContentPartsPromiseQueue']['abort'](),this['_showSkeletonDebounced']['cancel'](),this['_skeletonView']['isVisible']=!0x1;}),this['_updateContentPartsPromiseQueue']['queueEmptyPromise'];}['updatePartState'](_0x5a1b1d,_0x3955eb){const _0x53f6f2=this['getPartView'](_0x5a1b1d);_0x53f6f2&&(_0x53f6f2['state']=_0x3955eb),this['hasPendingParts']='pending'==_0x3955eb||this['_contentPartViews']['some'](_0x3831f7=>'pending'==_0x3831f7['state']);}['setPartActive'](_0x19712e,_0x28f4e5){if(!0x1===_0x19712e){for(const _0x209d1e of this['_contentPartViews'])_0x209d1e['isActive']=!0x1;}else{const _0x4316d0=this['getPartView'](_0x19712e);_0x4316d0&&(_0x4316d0['isActive']=_0x28f4e5);}}['updateSources'](_0x488942){_0x488942['forEach'](_0xbc2ebe=>this['_sourcesView']['addSource'](_0xbc2ebe)),this['_sourcesView']['isVisible']=!0x0;}['getPartView'](_0x1eae68){return this['_contentPartViews']['find'](_0x3ff9f0=>_0x3ff9f0['partDefinition']['index']==_0x1eae68)??null;}['markAsDone'](){if(!this['_showUnchangedParts']){const _0x3b43cf=!this['_cachedContentParts']['find'](({hasChanges:_0x4ade6a})=>_0x4ade6a),_0x3ba034=!!this['_cachedContentParts']['find'](({hasChanges:_0xfc50a0})=>!_0xfc50a0);this['_emptyPartsWarningView']['isVisible']=0x0==this['_contentPartViews']['length']||_0x3ba034,_0x3b43cf?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'](_0x5a9afc=>_0x5a9afc['markAsDone']()),this['_skeletonView']['isVisible']=!0x1,this['_showSkeletonDebounced']['cancel'](),this['_actionsView']['updateVisibility'](this['hasNonEmptyParts']);}async['_awaitMinimumSkeletonDisplayTime'](_0x2f2875){if(!this['_skeletonView']['isVisible']||null===this['_skeletonShownAt'])return;const _0x495be9=0x3e8-(Date['now']()-this['_skeletonShownAt']);if(this['_skeletonShownAt']=null,_0x495be9>0x0){const {promise:_0x5613ba,abortController:_0x54c41d}=en(_0x495be9);_0x2f2875?.['addEventListener']('abort',()=>_0x54c41d['abort']()),await _0x5613ba['catch'](()=>{});}}get['hasNonEmptyParts'](){return this['_contentPartViews']['filter'](_0x11e7a2=>_0x11e7a2['partDefinition']['hasChanges'])['length']>0x0;}}class kn extends vt{['bodyView'];['children'];['headerView'];constructor(_0x2b3e0b,_0x26d071,_0x334707){super(_0x2b3e0b);const {showDiff:_0x44ad10,areActionsDisabled:_0x59e686,showUnchangedParts:_0x2f6927,availableActions:_0x416e90}=_0x26d071;this['set']('isTrackChangesOn',!0x1),this['set']('areChangesVisible',!0x1),this['children']=this['createCollection'](),this['headerView']=new hn(_0x2b3e0b,{'showDiff':_0x44ad10}),this['headerView']['on']('toggleShowChanges',(_0x18a19e,_0x13984b)=>{this['areChangesVisible']=_0x13984b['isOn'],this['fire']('toggleSuggestionDisplayMode',{'showDiff':_0x13984b['isOn']});}),this['children']['add'](this['headerView']),this['bodyView']=new On(_0x2b3e0b,{'areActionsDisabled':_0x59e686,'showUnchangedParts':!!_0x2f6927,'availableActions':_0x416e90,'bodyCollection':_0x334707}),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'](_0x5ee64e){await this['bodyView']['updateContentParts'](_0x5ee64e);}['updateSources'](_0x3e9acc){this['bodyView']['updateSources'](_0x3e9acc);}['markAsDone'](){this['bodyView']['markAsDone'](),this['headerView']&&(this['headerView']['isShowChangesToggleVisible']=this['bodyView']['hasNonEmptyParts']);}}class Nn extends an{['containerView'];constructor(_0x40bc53,_0x1d1896,_0x48e7c8){super(_0x1d1896),this['set']('isTrackChangesOn',!0x1),this['containerView']=new kn(_0x40bc53,{'showDiff':_0x1d1896['showDiff'],'areActionsDisabled':_0x1d1896['areActionsDisabled'],'availableActions':_0x1d1896['availableActions']},_0x48e7c8),this['containerView']['on']('toggleSuggestionDisplayMode',(_0x21feef,_0x3d2f7b)=>{this['fire']('toggleSuggestionDisplayMode',{'replyId':this['options']['id'],'showDiff':_0x3d2f7b['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',(_0x44db8e,{index:_0x1ef8d5})=>{this['fire']('showChangeInText',{'replyId':this['options']['id'],'partIndex':_0x1ef8d5});}),this['containerView']['on']('applySuggestion',(_0x1d088e,{index:_0x231c73}={})=>{this['fire']('applySuggestion',{'replyId':this['options']['id'],'partIndex':_0x231c73});}),this['containerView']['on']('insertSuggestion',(_0x1d5327,{index:_0x41bdfe}={})=>{this['fire']('insertSuggestion',{'replyId':this['options']['id'],'partIndex':_0x41bdfe});}),this['containerView']['on']('rejectSuggestion',(_0xf4a1c5,{index:_0x48dee4})=>{this['fire']('rejectSuggestion',{'replyId':this['options']['id'],'partIndex':_0x48dee4});}),this['containerView']['on']('mouseOverSuggestion',(_0x35f70d,{index:_0x82b4f7})=>{this['fire']('mouseOverSuggestion',{'replyId':this['options']['id'],'partIndex':_0x82b4f7});}),this['containerView']['on']('mouseLeaveSuggestion',(_0x52dbbe,{index:_0x4bc863})=>{this['fire']('mouseLeaveSuggestion',{'replyId':this['options']['id'],'partIndex':_0x4bc863});}),this['children']['addMany']([this['containerView']]),this['extendTemplate']({'attributes':{'class':['ck-ai-chat__feed__ai-suggestion']}});}async['updateContent'](_0x224fba){await this['containerView']['updateContent'](_0x224fba);}['updatePartState'](_0x1402b0,_0x7f6de){this['containerView']['bodyView']['updatePartState'](_0x1402b0,_0x7f6de);}['setPartActive'](_0x396ea4,_0x30bc82){!0x1===_0x396ea4?this['containerView']['bodyView']['setPartActive'](!0x1):this['containerView']['bodyView']['setPartActive'](_0x396ea4,_0x30bc82);}['updateSources'](_0x8e6018){this['containerView']['updateSources'](_0x8e6018);}['getPartView'](_0x58c469){return this['containerView']['bodyView']['getPartView'](_0x58c469);}['markAsDone'](){super['markAsDone'](),this['containerView']['markAsDone']();}}class vn extends an{['replyContainer'];['_bodyCollection'];constructor(_0x838549,_0x539eda,_0x1184b4){super(_0x539eda),this['_bodyCollection']=_0x1184b4,this['locale']=_0x838549,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:_0x57f15d,renderingStrategy:_0x50749b,abortSignal:_0xf75eb5}){'streaming'===_0x50749b?await this['streamIntoElement'](_0x57f15d,this['replyContainer']['element'],_0xf75eb5):this['replyContainer']['element']['innerHTML']=ti(_0x57f15d);}['updateSources'](_0x14f8ab){const _0x56b45d=new Sn(this['locale'],this['_bodyCollection']);_0x56b45d['children']['addMany'](_0x14f8ab['map'](_0x2c6bf3=>new Rn(this['locale'],_0x2c6bf3,_0x56b45d['balloonPanelView']))),_0x56b45d['isVisible']=!0x0,this['children']['add'](_0x56b45d);}}class yn extends yt{constructor(_0x579c62=void 0x0){super();const _0x21a129=_0x579c62?'ck-ai-spinner_'+_0x579c62:'';this['extendTemplate']({'tag':'span','attributes':{'class':['ck-ai-spinner',_0x21a129]}});}}const xn={'file':_0x361cff,'document':_0x5857a1,'web-resource':_0x4bff13,'text':_0x361cff,'selection':_0x7f9bad,'mcp-tool-context':_0x5857a1},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(_0x24620e,_0x3408e3,_0x5aa64f,_0x15752a,_0x35d754=!0x1){super(_0x24620e),this['_isAnimationOnEnterEnabled']=_0x15752a,this['_initializeProperties'](_0x3408e3,_0x5aa64f,_0x35d754),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'](_0x2f0f87,_0x4e97ed,_0x3f4c42){this['set']('label',_0x2f0f87['label']),this['set']('tooltip',!0x0),this['set']('itemType',_0x2f0f87['type']),this['set']('id',_0x2f0f87['uiId']),this['set']('readonly',_0x4e97ed),this['set']('isLoading',_0x3f4c42);}['_setupTemplate'](){const _0x235ccf=this['_createIconView'](),_0x6b9840=this['_createRemoveButton'](),_0x160bf8=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':this['_createTemplateAttributes'](_0x160bf8),'children':this['_createTemplateChildren'](_0x235ccf,_0x6b9840,_0x160bf8)});}['_createTemplateAttributes'](_0x244470){return{'class':[Ln,_0x244470['if']('itemType',Pn,_0x10ca7c=>'document'==_0x10ca7c),_0x244470['if']('itemType',Dn,_0x4549f4=>'selection'==_0x4549f4)],'data-cke-tooltip-text':_0x244470['to']('label',Gn),'data-cke-tooltip-position':Vn,'data-cke-tooltip-class':Un};}['_createTemplateChildren'](_0x3aace2,_0x5b33e2,_0x256bc7){const _0x215607=this['_createLabelElement'](_0x256bc7),_0x5c0a29=this['_createLoaderIcon']();return this['readonly']?[_0x3aace2,_0x215607]:[_0x3aace2,_0x5c0a29,_0x215607,_0x5b33e2];}['_createLabelElement'](_0x4387b0){return{'tag':'span','attributes':{'class':Hn},'children':[{'text':_0x4387b0['to']('label')}]};}['_createRemoveButton'](){const _0x5b50b8=new Nt(this['locale']);return _0x5b50b8['set']({'label':hs(this['locale'],'AI_CHAT_CONTEXT_REMOVE_FROM_CONTEXT'),'icon':_0x49d6d3}),this['_setupRemoveButtonEvent'](_0x5b50b8),_0x5b50b8;}['_setupRemoveButtonEvent'](_0x21cfc5){_0x21cfc5['on']('execute',()=>{this['fire']('removeContextItemChip',this['id']);});}['_createIconView'](){const _0x33bd26=this['bindTemplate'],_0x488d87=new xt();return _0x488d87['content']=xn[this['itemType']],_0x488d87['extendTemplate']({'attributes':{'class':[Mn,_0x33bd26['if']('isLoading','ck-hidden',_0x40ef21=>_0x40ef21)]}}),_0x488d87;}['_handleAnimationEndOnce'](_0x40b048,_0x3afd19){if(!_0x40b048)return;const _0x52efd0=()=>{_0x3afd19(),_0x40b048['removeEventListener']('animationend',_0x52efd0),_0x40b048['removeEventListener']('webkitAnimationEnd',_0x52efd0);};_0x40b048['addEventListener']('animationend',_0x52efd0),_0x40b048['addEventListener']('webkitAnimationEnd',_0x52efd0);}['_createLoaderIcon'](){const _0x488874=new yn('small');return _0x488874['bind']('isVisible')['to'](this,'isLoading',_0x4c1dfe=>_0x4c1dfe),_0x488874;}}function Gn(_0x52c047){if(!_0x52c047)return _0x52c047;if(_0x52c047['length']<=0x78)return _0x52c047;const _0xca564f=_0x52c047['slice'](0x0,0x78),_0x181fc7=_0xca564f['lastIndexOf']('\x20');return(_0x181fc7>0x0?_0xca564f['slice'](0x0,_0x181fc7):_0xca564f)+'…';}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(_0x13b153,_0x28847e,_0x141651,_0x359b67,_0x6e44fa){this['_locale']=_0x13b153,this['_visibleChips']=_0x28847e,this['_config']={...Fn,..._0x141651,'cssClasses':{'controlsButton':'','calculationContainer':'ck-calculation-container',..._0x141651['cssClasses']}},this['_overflowChips']=new dt(),this['_bodyCollection']=_0x359b67,this['_parentView']=_0x6e44fa||null;}['setContainerElement'](_0x3d8212){this['_intersectionObserver']&&(this['_intersectionObserver']['disconnect'](),this['_intersectionObserver']=null),this['_containerElement']=_0x3d8212,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 _0x3bceda=[...this['_visibleChips'],...this['_overflowChips']],_0x463fa3=this['_createCalculationContainer'](),_0x1a05b8=this['_calculateOverflowInContainer'](_0x463fa3,_0x3bceda),_0x5db4d9=_0x463fa3['_ancestorsToRestore'];_0x5db4d9&&this['_restoreAncestorVisibility'](_0x5db4d9),_0x463fa3['remove'](),this['_applyOverflowResults'](_0x3bceda,_0x1a05b8);}['_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 _0x45f987=new Nt(this['_locale']);_0x45f987['set']({'label':'','withText':!0x0,'isToggleable':!0x0});const _0x174d20=[this['_config']['cssClasses']['showMoreButton']];return this['_config']['cssClasses']['controlsButton']&&_0x174d20['push'](this['_config']['cssClasses']['controlsButton']),_0x45f987['extendTemplate']({'attributes':{'class':_0x174d20}}),_0x45f987;}['_createShowMoreBalloonPanelView'](){const _0x2813e7=new Xt(this['_locale']);return _0x2813e7['extendTemplate']({'attributes':{'class':this['_config']['cssClasses']['showMoreBalloon']}}),this['_bodyCollection']['add'](_0x2813e7),_0x2813e7;}['_updateBalloonContent'](){if(this['_showMoreBalloonPanelView']&&(this['_showMoreBalloonPanelView']['content']['clear'](),this['_overflowChips']['length']>0x0)){this['_overflowChips']['forEach'](_0x3cd108=>{_0x3cd108['disableAnimationOnEnter']();});const _0x535b09=new vt(this['_locale']);_0x535b09['setTemplate']({'tag':'div','attributes':{'class':this['_config']['cssClasses']['overflowContainer']},'children':this['_overflowChips']}),this['_showMoreBalloonPanelView']['content']['add'](_0x535b09);}}['_handleShowMoreButtonClick'](){this['_showMoreButtonView']['isOn']?this['hideBalloonPanel']():this['showBalloonPanel']();}['_updateShowMoreButtonVisibility'](){const _0x222203=this['_overflowChips']['length']>0x0;this['_showMoreButtonView']?.['element']&&(this['_showMoreButtonView']['element']['style']['display']=_0x222203?'':'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'](_0x112301){const _0x29de6b=this['_containerElement']?.['tagName']['toLowerCase']()||'div',_0x3fcdb1=this['_containerElement']?.['classList'];if(_0x3fcdb1){const _0xb46d7d=_0x3fcdb1[0x0]||'',_0x109f7f=_0x112301['querySelector']('.'+_0xb46d7d),_0x1d4e4d=_0x112301['querySelector'](_0x29de6b);return _0x109f7f||_0x1d4e4d||_0x112301;}return _0x112301['querySelector'](_0x29de6b)||_0x112301;}['_calculateContainerWidth'](){const _0x1cd491=this['_parentView']?.['element']||this['_containerElement'];if(!_0x1cd491)return Kn;const _0x5bd736=window['getComputedStyle'](_0x1cd491)['width'];if('auto'===_0x5bd736||'0px'===_0x5bd736||!_0x5bd736){const _0x173704=_0x1cd491['parentElement'];if(_0x173704){const _0x1cb063=window['getComputedStyle'](_0x173704);return'auto'!==_0x1cb063['width']?_0x1cb063['width']:Kn;}return Kn;}return _0x5bd736;}['_applyCalculationStyles'](_0x221153,_0x3088e4){this['_config']['cssClasses']['calculationContainer']&&_0x221153['classList']['add'](this['_config']['cssClasses']['calculationContainer']),_0x221153['style']['width']=_0x3088e4,_0x221153['style']['position']='absolute',_0x221153['style']['top']='-9999px',_0x221153['style']['left']='-9999px',_0x221153['style']['opacity']='0',_0x221153['style']['pointerEvents']='none',_0x221153['style']['zIndex']='-1',_0x221153['style']['visibility']='visible\x20!important',_0x221153['style']['display']='block\x20!important',_0x221153['style']['boxSizing']='border-box';}['_restoreAncestorVisibility'](_0x51dad9){_0x51dad9['forEach'](({element:_0x1c5207,originalDisplay:_0x3f9302,originalVisibility:_0x2b650a})=>{_0x1c5207['style']['display']=_0x3f9302,_0x1c5207['style']['visibility']=_0x2b650a;});}['_makeAncestorsVisible'](_0x253121){const _0x4487ba=[];let _0xcef1f5=_0x253121;for(;_0xcef1f5&&_0xcef1f5!==document['body'];){const _0xb84a2d=window['getComputedStyle'](_0xcef1f5);'none'!==_0xb84a2d['display']&&'hidden'!==_0xb84a2d['visibility']||(_0x4487ba['push']({'element':_0xcef1f5,'originalDisplay':_0xcef1f5['style']['display'],'originalVisibility':_0xcef1f5['style']['visibility']}),_0xcef1f5['style']['display']='block',_0xcef1f5['style']['visibility']='visible'),_0xcef1f5=_0xcef1f5['parentElement'];}return _0x4487ba;}['_createContainerElements'](){let _0x3ace48,_0x224a5c;return this['_parentView']?.['element']?(_0x3ace48=this['_parentView']['element']['cloneNode'](!0x0),_0x224a5c=this['_findTargetContainer'](_0x3ace48)):(_0x3ace48=document['createElement']('div'),_0x224a5c=_0x3ace48),{'calculationContainer':_0x3ace48,'targetContainer':_0x224a5c};}['_createCalculationContainer'](){const {calculationContainer:_0x585464,targetContainer:_0x5705f6}=this['_createContainerElements'](),_0x362abd=this['_calculateContainerWidth']();this['_applyCalculationStyles'](_0x585464,_0x362abd);const _0x25d126=this['_parentView']?.['element']||this['_containerElement'],_0x3a4ec2=_0x25d126?.['parentElement'];_0x3a4ec2?_0x3a4ec2['appendChild'](_0x585464):document['body']['appendChild'](_0x585464),_0x585464['_targetContainer']=_0x5705f6;const _0x68d990=this['_makeAncestorsVisible'](_0x3a4ec2||null);return _0x585464['offsetWidth'],_0x585464['_ancestorsToRestore']=_0x68d990,_0x585464;}['_calculateOverflowInContainer'](_0x2961da,_0x3f4bb2){const _0x110f29=_0x2961da['_targetContainer']||_0x2961da,_0x339051=[],{rowCount:_0x525ac7}=this['_renderChipsAndCountRows'](_0x110f29,_0x3f4bb2);if(_0x525ac7<=this['_config']['maxVisibleRows'])return _0x339051;const _0xbae432=_0x3f4bb2['slice']();for(;_0xbae432['length']>0x0;){if(this['_testButtonFit'](_0x2961da,_0x110f29,_0xbae432)){const _0x41aeaf=_0x3f4bb2['filter'](_0x183fe3=>!_0xbae432['includes'](_0x183fe3));_0x339051['push'](..._0x41aeaf);break;}if(!_0xbae432['pop']())break;}return _0x339051;}['_renderChipsAndCountRows'](_0x370503,_0x3a282d){_0x370503['innerHTML']='',_0x3a282d['forEach'](_0x515354=>{if(_0x515354['element']){const _0xea8cc1=_0x515354['element']['cloneNode'](!0x0);_0x370503['appendChild'](_0xea8cc1);}}),_0x370503['offsetWidth'];const _0x633eea=_0x370503['children'],_0x3ac628=[];return Array['from'](_0x633eea)['forEach'](_0x2e925e=>{const _0x4367f1=_0x2e925e['getBoundingClientRect']()['top'];_0x3ac628['some'](_0x599c6a=>Math['abs'](_0x599c6a-_0x4367f1)<this['_config']['rowDetectionTolerance'])||_0x3ac628['push'](_0x4367f1);}),{'rowCount':_0x3ac628['length']};}['_createMockButton'](){const _0x22e467=document['createElement']('button');return _0x22e467['className']=this['_config']['cssClasses']['showMoreButton'],this['_config']['cssClasses']['controlsButton']&&_0x22e467['classList']['add'](this['_config']['cssClasses']['controlsButton']),_0x22e467['textContent']='+\x201',_0x22e467;}['_testButtonFit'](_0x4700c9,_0x15bfde,_0x1b70c2){this['_renderChipsAndCountRows'](_0x15bfde,_0x1b70c2);const _0x59bc5e=this['_createMockButton']();_0x4700c9['appendChild'](_0x59bc5e),_0x4700c9['offsetWidth'];const _0x440b28=[..._0x15bfde['children'],_0x59bc5e],_0x16f038=[];_0x440b28['forEach'](_0x3aa576=>{const _0x3d163e=_0x3aa576['getBoundingClientRect']()['top'];_0x16f038['some'](_0x3bc51d=>Math['abs'](_0x3bc51d-_0x3d163e)<this['_config']['rowDetectionTolerance'])||_0x16f038['push'](_0x3d163e);});const _0x2adcf4=_0x16f038['length'];return _0x59bc5e['remove'](),_0x2adcf4<=this['_config']['maxVisibleRows'];}['_distributeChips'](_0x45e972,_0x3bd9d9){this['_visibleChips']['clear'](),this['_overflowChips']['clear'](),_0x45e972['forEach'](_0x368b5e=>{_0x3bd9d9['includes'](_0x368b5e)?this['_overflowChips']['add'](_0x368b5e):this['_visibleChips']['add'](_0x368b5e);});}['_updateOverflowUI'](_0x5acfb7){if(_0x5acfb7>0x0&&!this['_showMoreButtonView']&&this['_createShowMoreButton'](),_0x5acfb7>0x0&&this['_showMoreButtonView']){const _0xd4200d=''+this['_config']['showMoreLabelPrefix']+(_0x5acfb7<0x63?_0x5acfb7:'99');this['_showMoreButtonView']['label']=_0xd4200d;}this['_updateBalloonContent'](),this['_updateShowMoreButtonVisibility'](),this['_repinBalloonPanel']();}['_applyOverflowResults'](_0x4f5dbb,_0x4251b9){this['_distributeChips'](_0x4f5dbb,_0x4251b9),this['_updateOverflowUI'](_0x4251b9['length']);}['_setupVisibilityObserver'](){this['_containerElement']&&'undefined'!=typeof IntersectionObserver&&(this['_intersectionObserver']=new IntersectionObserver(_0x2f882b=>{_0x2f882b[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 _0x7e993=this['_containerElement']['getBoundingClientRect']();if(0x0===_0x7e993['width']||0x0===_0x7e993['height'])return!0x1;const _0x5349ea=window['innerHeight']||document['documentElement']['clientHeight'],_0x504b7d=window['innerWidth']||document['documentElement']['clientWidth'],_0x527711=0xc8;return _0x7e993['bottom']>=-0xc8&&_0x7e993['top']<=_0x5349ea+_0x527711&&_0x7e993['right']>=-0xc8&&_0x7e993['left']<=_0x504b7d+_0x527711;}}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(_0x37f217,_0x2ccacd,_0x59e9f5){super(_0x37f217),this['_bodyCollection']=_0x59e9f5,this['_createContextChips'](_0x2ccacd);const _0x5975dc={'cssClasses':{'showMoreButton':Xn+'\x20'+us,'showMoreBalloon':zn,'overflowContainer':qn,'controlsButton':Qn}};this['_overflowManager']=new Wn(_0x37f217,this['_contextChips'],_0x5975dc,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 _0x1f0efb=this['element']['querySelector']('.'+$n);_0x1f0efb&&(this['_overflowManager']['setContainerElement'](_0x1f0efb),this['_overflowManager']['reorganizeChips']());}['destroy'](){super['destroy'](),this['_overflowManager']['destroy']();}['_createContextChips'](_0x44ee59){for(const _0x38bc55 of _0x44ee59){const _0x1ec09d=new Bn(this['locale'],_0x38bc55,!0x0,!0x1);this['_contextChips']['add'](_0x1ec09d);}}}class Jn extends an{['_contextChipsView']=null;['_locale'];['_bodyCollection'];['_messageContentView'];constructor(_0x52baf5,_0xfa3368,_0x3ef62b){super(_0xfa3368),this['_locale']=_0x52baf5,this['_bodyCollection']=_0x3ef62b,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'](_0x6ca806=>!_0x6ca806['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(_0x3e3da1,_0x27adfd){super(_0x27adfd);const {isWebSearchEnabled:_0x509b85,isReasoningEnabled:_0xac102c}=_0x27adfd['capabilities'],_0x2c562c=[];let _0x437b45='';_0x509b85&&_0xac102c?(_0x437b45=hs(_0x3e3da1,'AI_CHAT_FEED_REPLY_ITEM_USED_WEB_SEARCH_REASONING'),_0x2c562c['push'](tr(_0x3d1340)),_0x2c562c['push'](tr(_0x345846))):_0x509b85?(_0x437b45=hs(_0x3e3da1,'AI_CHAT_FEED_REPLY_ITEM_USED_WEB_SEARCH'),_0x2c562c['push'](tr(_0x3d1340))):_0xac102c&&(_0x437b45=hs(_0x3e3da1,'AI_CHAT_FEED_REPLY_ITEM_USED_REASONING'),_0x2c562c['push'](tr(_0x345846))),this['extendTemplate']({'attributes':{'class':['ck-ai-chat__feed__interaction-header',_0x437b45?'':'ck-hidden']}});const _0x2eaf84=new vt();_0x2eaf84['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed__interaction-header__capabilities']},'children':[..._0x2c562c,{'tag':'span','attributes':{'class':['ck-ai-chat__feed__interaction-header__capabilities__text']},'children':[_0x437b45]}]}),this['children']['add'](_0x2eaf84),this['capabilities']=_0x27adfd['capabilities'];}}function tr(_0x3107f5){const _0x194ae2=new xt();return _0x194ae2['content']=_0x3107f5,_0x194ae2;}const er=['wheel','touchstart','pointerdown','keydown'],ir=['ArrowUp','ArrowDown','PageUp','PageDown','Home','End','\x20'];class sr{['element'];['animationFrameId'];['isRunning'];['abortController'];['isUserPaused'];['scrollBehavior'];constructor(_0x3c61b7){this['element']=_0x3c61b7,this['animationFrameId']=null,this['isRunning']=!0x1,this['abortController']=new AbortController(),this['isUserPaused']=!0x1,this['scrollBehavior']='smooth';for(const _0x2827ea of er){const _0x4d72bd='keydown'!==_0x2827ea;this['element']['addEventListener'](_0x2827ea,this['_onUserEvent']['bind'](this),{'passive':_0x4d72bd,'signal':this['abortController']['signal']});}}['start']({smooth:_0x156edb=!0x0}={}){this['isRunning']||(this['isRunning']=!0x0,this['isUserPaused']=!0x1,this['scrollBehavior']=_0x156edb?'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'](_0xad1310){if(this['isRunning']){if('keydown'===_0xad1310['type']){const _0x3146d0=_0xad1310['key'];if(!ir['includes'](_0x3146d0))return;}_0xad1310 instanceof WheelEvent?_0xad1310['deltaY']<0x0?this['isUserPaused']=!0x0:this['isUserPaused']=!this['_isAtBottom']():this['isUserPaused']=!0x0;}}['_isAtBottom'](){const {scrollTop:_0x4e14ee,scrollHeight:_0x9035b2,clientHeight:_0x192c34}=this['element'];return _0x9035b2-_0x4e14ee-_0x192c34<=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(_0x765caf){super(_0x765caf),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(_0x535d60,_0x59ada7){super(_0x535d60),this['_bodyCollection']=_0x59ada7,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'](_0x4c5f47,_0x6c0f80){let _0x1aa10a;return'ai-reply'===_0x4c5f47?_0x1aa10a=new vn(this['locale'],_0x6c0f80,this['_bodyCollection']):'ai-suggestion-reply'===_0x4c5f47?(_0x1aa10a=new Nn(this['locale'],_0x6c0f80,this['_bodyCollection']),_0x1aa10a['bind']('isTrackChangesOn')['to'](this)):_0x1aa10a='user-message'===_0x4c5f47?new Jn(this['locale'],_0x6c0f80,this['_bodyCollection']):'interaction-header'===_0x4c5f47?new Zn(this['locale'],_0x6c0f80):'custom-element'===_0x4c5f47?new nr(_0x6c0f80):new wn(_0x6c0f80),this['children']['add'](_0x1aa10a),_0x1aa10a;}async['updateReplyItem']({id:_0x4cc773,parsedContent:_0x28dc46,renderingStrategy:_0x2f2815,abortSignal:_0x210574}){const _0x264492=this['getItemById'](_0x4cc773);if(!(_0x264492 instanceof vn))throw new at('ai-chat-feed-view-item-not-a-reply-item',null,{'itemView':_0x264492,'id':_0x4cc773,'parsedContent':_0x28dc46});await _0x264492['updateContent']({'parsedContent':_0x28dc46,'renderingStrategy':_0x2f2815,'abortSignal':_0x210574});}async['updateWebSources'](_0x34486c,_0x1fdce5){const _0x318418=this['getItemById'](_0x34486c);if(_0x318418 instanceof Nn)_0x318418['updateSources'](_0x1fdce5);else{if(!(_0x318418 instanceof vn))throw new at('ai-chat-feed-view-item-not-a-suggestion-or-reply-item',null,{'itemView':_0x318418,'id':_0x34486c,'sources':_0x1fdce5});_0x318418['updateSources'](_0x1fdce5);}}async['updateSuggestionItem']({id:_0x2accb8,parts:_0x2e1e35,abortSignal:_0x3abae2,skipLoadingEffects:_0x37d5a3}){const _0x58962e=this['getItemById'](_0x2accb8);if(!(_0x58962e instanceof Nn))throw new at('ai-chat-feed-view-item-not-a-suggestion-item',null,{'itemView':_0x58962e,'id':_0x2accb8,'parts':_0x2e1e35});await _0x58962e['updateContent']({'parts':_0x2e1e35,'abortSignal':_0x3abae2,'skipLoadingEffects':_0x37d5a3});}['updateSuggestionPartState']({id:_0x5ecac2,index:_0x1ccc15,state:_0x36c387}){const _0x8c1b5a=this['getItemById'](_0x5ecac2);if(!(_0x8c1b5a instanceof Nn))throw new at('ai-chat-feed-view-item-not-a-suggestion-item',this,{'id':_0x5ecac2});_0x8c1b5a['updatePartState'](_0x1ccc15,_0x36c387);}['setSuggestionPartActive']({id:_0x134603,index:_0x2112e7,isActive:_0x201b13}){const _0x31db77=this['getItemById'](_0x134603);if(!(_0x31db77 instanceof Nn))throw new at('ai-chat-feed-view-item-not-a-suggestion-item',this,{'id':_0x134603});this['children']['filter'](_0x40df0e=>_0x40df0e instanceof Nn)['forEach'](_0x5c115e=>{_0x5c115e['setPartActive'](!0x1);}),_0x31db77['setPartActive'](_0x2112e7,_0x201b13);}['markItemAsDone'](_0x140bed){this['getItemById'](_0x140bed)['markAsDone']();}['getItemIds'](){return this['children']['map'](_0x20625b=>_0x20625b['options']['id']);}['removeItem'](_0xdb173d){this['children']['remove'](this['getItemById'](_0xdb173d));}['hasItem'](_0x2a6664){return!!this['children']['find'](_0x12493e=>_0x12493e['options']['id']['includes'](_0x2a6664));}['scrollToSuggestion'](_0x12413c,_0x13d764){const _0x361e92=this['getItemById'](_0x12413c);if(!(_0x361e92 instanceof Nn))return void It('ck-ai-chat-feed-view-scroll-to-suggestion-invalid-item',{'replyId':_0x12413c,'partIndex':_0x13d764});const _0x16fbc6=_0x361e92['getPartView'](_0x13d764);_0x16fbc6?ft(_0x16fbc6['element'],0x14,this['element']['parentElement'],!0x0,!0x0):It('ck-ai-chat-feed-view-scroll-to-suggestion-part-view-not-found',{'replyId':_0x12413c,'partIndex':_0x13d764});}['_setupTemplate'](){this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed']},'children':this['_createTemplateChildren']()});}['_createTemplateChildren'](){const _0x1877e2=this['_createSkeletonLoader']();return[this['_createFeedItems'](),_0x1877e2,this['_createFeedLoader']()];}['_createSkeletonLoader'](){const _0x549a33=new pn(this['locale'],mn['aiFeed']);return _0x549a33['bind']('isVisible')['to'](this,'isLoadingSkeletonVisible'),_0x549a33;}['_createFeedItems'](){const _0x24ebf1=new vt(this['locale']);return _0x24ebf1['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed__items',this['bindTemplate']['if']('isLoadingSkeletonVisible','ck-hidden')]},'children':this['children']}),_0x24ebf1;}['_createFeedLoader'](){const _0x1b5b12=new vt(this['locale']);return _0x1b5b12['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__loader',this['bindTemplate']['if']('loadingMessage','ck-hidden',_0x557523=>!_0x557523)]},'children':this['_createLoaderChildren']()}),_0x1b5b12;}['_createLoaderChildren'](){const _0x5b86f4=new yn();return _0x5b86f4['isVisible']=!0x0,[_0x5b86f4,{'tag':'span','attributes':{'class':['ck','ck-ai-chat__loader-text']},'children':[{'text':this['bindTemplate']['to']('loadingMessage')}]}];}['getItemById'](_0x17883a){const _0x5c90d5=this['children']['find'](_0x556ccf=>_0x556ccf['options']['id']['includes'](_0x17883a));if(!_0x5c90d5)throw new at('ai-chat-feed-view-item-not-found',this,{'id':_0x17883a});return _0x5c90d5;}['setLoadingMessage'](_0x469443){this['set']('loadingMessage',_0x469443);}['toggleLoadingSkeleton'](_0x45e647){this['set']('isLoadingSkeletonVisible',_0x45e647);}['startAutoScroll'](_0x221d49={}){this['scrollManager']['start'](_0x221d49);}['stopAutoScroll'](){this['scrollManager']['stop']();}}class or extends Dt{['filter'](){let _0xcc01c7=0x0;for(const _0xb9269f of this['items'])_0xcc01c7+=_0xb9269f['items']['length'];return{'resultsCount':_0xcc01c7,'totalItemsCount':_0xcc01c7};}}const ar='ck-ai-chat__prompt-input_highlighted';class hr extends Lt{['submitButtonView'];static ['MIN_ROWS']=0x1;static ['MAX_ROWS']=0xc;['_addContextButtonView'];['_queryViewResizeObserver'];constructor(_0x39bbe7,_0x355ccc){super(_0x39bbe7,{'queryView':{'label':'','creator':Vt,'showIcon':!0x1,'showResetButton':!0x1},'filteredView':new or(_0x39bbe7),'queryMinChars':0x1/0x0,'resetOnBlur':!0x1}),this['set']('isEmpty',!0x0),this['set']('isUploadInProgress',!0x1),this['_addContextButtonView']=_0x355ccc,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',(_0x472b1b,_0x388d4a)=>!_0x472b1b&&!_0x388d4a),this['focusableChildren']['add'](this['submitButtonView']);}['render'](){super['render'](),this['queryView']['fieldWrapperChildren']['add'](this['submitButtonView']),this['keystrokes']['set']('enter',(_0x2af444,_0x45aee2)=>{this['isUploadInProgress']||this['isEmpty']||_0x2af444['target']==this['queryView']['fieldView']['element']&&(this['submit'](),_0x45aee2());}),this['queryView']['fieldView']['on']('update',()=>{this['isEmpty']=''===this['queryView']['fieldView']['element']['value']?.['trim']();});}['destroy'](){super['destroy'](),this['_queryViewResizeObserver']&&this['_queryViewResizeObserver']['destroy']();}['submit'](){const _0x1e2e10=this['queryView']['fieldView']['element']['value']?.['trim']();if(!_0x1e2e10)return this['queryView']['errorText']=hs(this['locale'],'AI_CHAT_PROMPT_EMPTY_ERROR'),void(this['queryView']['fieldView']['hasError']=!0x0);this['queryView']['fieldView']['hasError']=!0x1;const _0x1650ec=_0x5131f5(_0x1e2e10);this['fire']('sendUserMessage',_0x1650ec),this['queryView']['fieldView']['reset']();}['setPlaceholderText'](_0x40d9ab){this['queryView']['fieldView']['set']('placeholder',_0x40d9ab);}['focus'](_0x494a33=!0x1){super['focus'](),_0x494a33&&(this['element']['classList']['contains'](ar)||(this['element']['classList']['add'](ar),setTimeout(()=>{this['element']['classList']['remove'](ar);},0x320)));}['_createSubmitButton'](){const _0x3c412e=new Nt(this['locale']);return _0x3c412e['set']({'icon':_0x2fb024,'label':hs(this['locale'],'AI_CHAT_LABEL_SUBMIT'),'isVisible':!0x0,'tooltip':!0x0,'class':'ck-ai-chat__prompt-submit-button\x20'+cs,'isEnabled':!0x1}),_0x3c412e['on']('execute',()=>{this['submit']();}),_0x3c412e;}['setIsUploadInProgress'](_0x2e8b32){this['isUploadInProgress']=_0x2e8b32;}['_setUpAddContextButtonPositioning'](){const _0x2b1714=this['locale'],_0x518e5a=()=>{ct['window']['requestAnimationFrame'](()=>{if(lt(this['element'])){const _0x2657e0=new ut(this['queryView']['fieldView']['element']),_0xd65b73=new ut(this['_addContextButtonView']['element']),_0x538f82=_0x2657e0['width'],_0x5823b7='rtl'===_0x2b1714['uiLanguageDirection']?'right':'left';_0x2657e0['excludeScrollbarsAndBorders']();const _0x33f878=_0x538f82-_0x2657e0['width']+0x1;this['_addContextButtonView']['element']['style'][_0x5823b7]='calc('+(_0x538f82-_0xd65b73['width']-_0x33f878)+'px\x20-\x20var(--ck-spacing-tiny))';}});};this['queryView']['fieldView']['on']('update',_0x518e5a),this['on']('render',()=>{_0x518e5a(),this['_queryViewResizeObserver']=new bt(this['queryView']['fieldView']['element'],()=>{_0x518e5a();});});}}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(_0x11e1b9){super(_0x11e1b9),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',_0x5a90e8=>'selector'===_0x5a90e8),this['_modelSelectionDropdown']['buttonView']['bind']('tooltip')['to'](this,'modelSelectorEnabled',_0x461de5=>_0x461de5?this['_modelSelectionDropdown']['buttonView']['label']:hs(this['locale'],'AI_CHAT_MODEL_SELECTOR_DISABLED_TOOLTIP')),this['_modelSelectionDropdown']['bind']('isEnabled')['to'](this,'modelSelectorEnabled',_0x12d468=>_0x12d468),this['_webSearchButton']['bind']('isOn')['to'](this,'webSearchActive',_0x482f4a=>_0x482f4a),this['_webSearchButton']['bind']('tooltip')['to'](this,'webSearchActive',_0x4c1134=>hs(this['locale'],_0x4c1134?'AI_CHAT_DISABLE_WEB_SEARCH':'AI_CHAT_ENABLE_WEB_SEARCH')),this['_reasoningButton']['bind']('isOn')['to'](this,'reasoningActive',_0x1bd1b6=>_0x1bd1b6),this['_reasoningButton']['bind']('tooltip')['to'](this,'reasoningActive',_0x4ff0c9=>hs(this['locale'],_0x4ff0c9?'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'](_0x3f096f,_0x3b10d5){if(_0x3b10d5)this['set']('modelDisplayMode','hidden');else{const _0x363d06=0x1===_0x3f096f['length'];this['set']('modelDisplayMode',_0x363d06?'name':'selector');}if(this['_modelSelectionDropdownItems']['clear'](),_0x3f096f?.['length'])for(const _0x11936f of _0x3f096f){const _0x4648a7=new Jt({'label':_0x11936f['name'],'withText':!0x0,'role':'menuitemradio','id':_0x11936f['id'],'model':_0x11936f});_0x4648a7['bind']('isOn')['to'](this,'activeModelId',_0x540e4a=>_0x540e4a===_0x11936f['id']),this['_modelSelectionDropdownItems']['add']({'type':'button','model':_0x4648a7,'labelView':new pr(this['locale'],_0x11936f)});}}['setWebSearch'](_0xba5ebf){this['set']('webSearchActive',_0xba5ebf);}['setReasoning'](_0x2b5624){this['set']('reasoningActive',_0x2b5624);}['setModel'](_0x31aa48){if(!_0x31aa48)return;this['activeModelId']=_0x31aa48['id'],this['activeModelName']=_0x31aa48['name']||_0x31aa48['id'],this['_modelSelectionDropdown']['buttonView']['set']('label',_0x31aa48['name']),this['_modelSelectionDropdown']['buttonView']['set']('tooltip',_0x31aa48['name']);const _0x3a953b=_0x31aa48['capabilities']['webSearch']?.['enabled']??!0x1;this['set']('webSearchActive',!0x1),this['_webSearchButton']['set']('isOn',!0x1),this['_webSearchButton']['set']('isEnabled',_0x3a953b),this['_webSearchButton']['set']('isVisible',_0x3a953b);const _0x2df5aa=_0x31aa48['capabilities']['reasoning']?.['enabled']??!0x1;this['set']('reasoningActive',!0x1),this['_reasoningButton']['set']('isOn',!0x1),this['_reasoningButton']['set']('isEnabled',_0x2df5aa),this['_reasoningButton']['set']('isVisible',_0x2df5aa);}['enableModelSelector'](){this['set']('modelSelectorEnabled',!0x0);}['disableModelSelector'](_0x131c20){this['set']('modelSelectorEnabled',!0x1),_0x131c20&&this['set']('modelDisplayMode','hidden');}['_createWebSearchButton'](){const _0x1627d2=new Nt();return _0x1627d2['set']({'label':hs(this['locale'],'AI_CHAT_SEARCH_WEB'),'icon':_0x3d1340,'class':lr+'\x20'+us,'isToggleable':!0x0,'tooltipPosition':Ir}),_0x1627d2['on']('execute',()=>{this['fire']('toggleWebSearch');}),_0x1627d2;}['_createReasoningButton'](){const _0x355240=new Nt();return _0x355240['set']({'label':hs(this['locale'],'AI_CHAT_REASONING'),'icon':_0x345846,'class':lr+'\x20'+us,'isToggleable':!0x0,'tooltipPosition':Ir}),_0x355240['on']('execute',()=>{this['fire']('toggleReasoning');}),_0x355240;}['_createCommandsButton'](){const _0x256ed7=new Nt();return _0x256ed7['set']({'label':hs(this['locale'],'AI_CHAT_COMMANDS'),'icon':_0x158742,'withText':!0x0,'class':lr+'\x20'+us,'isToggleable':!0x0,'tooltip':hs(this['locale'],'AI_CHAT_COMMANDS'),'tooltipPosition':Ir}),_0x256ed7['extendTemplate']({'attributes':{'class':[ur]}}),_0x256ed7['on']('execute',()=>{console['log']('Commands\x20are\x20not\x20implemented\x20yet.'),alert('Commands\x20are\x20not\x20implemented\x20yet.');}),_0x256ed7;}['_createModelSelectionDropdown'](){const _0xa7abd=Gt(this['locale']);return _0xa7abd['set']({'panelPosition':'ne','class':[dr]}),_0xa7abd['buttonView']['set']({'label':hs(this['locale'],'AI_CHAT_MODEL_SELECTOR_ENABLED_TOOLTIP'),'withText':!0x0,'tooltip':!0x0,'tooltipPosition':Ir,'class':us}),this['listenTo'](_0xa7abd,'execute',_0x479aaa=>{this['fire']('selectModel',_0x479aaa['source']['model']);}),_0xa7abd;}['_createModelNameView'](){const _0x5f5733=new mr(this['locale']);return _0x5f5733['bind']('text')['to'](this,'activeModelName',_0x2363a4=>_0x2363a4??''),_0x5f5733['bind']('isVisible')['to'](this,'modelDisplayMode',_0x3191bb=>'name'===_0x3191bb),_0x5f5733;}}let pr=class extends Mt{constructor(_0x22493e,_0xfa7819){super();const _0xe60a2a=this['bindTemplate'],_0x1b74f0=this['createCollection']();this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-button__label'],'style':_0xe60a2a['to']('style'),'id':_0xe60a2a['to']('id')},'children':[{'tag':'div','attributes':{'class':[_r]},'children':[{'text':_0xe60a2a['to']('text')}]},{'tag':'div','attributes':{'class':[gr]},'children':[{'tag':'span','children':[{'text':_0xfa7819['description']}]}]},{'tag':'div','attributes':{'class':[Ar]},'children':_0x1b74f0}]}),_0x1b74f0['addMany'](this['_getCapabilityParts'](_0x22493e,_0x3d1340,'AI_CHAT_SEARCH_WEB',_0xfa7819['capabilities']['webSearch']?.['enabled']??!0x1)),_0x1b74f0['addMany'](this['_getCapabilityParts'](_0x22493e,_0x345846,'AI_CHAT_REASONING',_0xfa7819['capabilities']['reasoning']?.['enabled']??!0x1));}['_getCapabilityParts'](_0x472401,_0x5695c5,_0x167be1,_0x4b9514){const _0x357887=new xt();_0x357887['content']=_0x5695c5;const _0xeee145=new vt(_0x472401);_0xeee145['setTemplate']({'tag':'span','children':[{'text':hs(_0x472401,_0x167be1)+':\x20'}]});const _0xbfc5ea=new vt(_0x472401);return _0xbfc5ea['setTemplate']({'tag':'span','children':[{'text':hs(_0x472401,_0x4b9514?'AI_CHAT_CAPABILITIES_YES':'AI_CHAT_CAPABILITIES_NO')}]}),[_0x357887,_0xeee145,_0xbfc5ea];}},mr=class extends vt{constructor(_0x6cfc71){super(_0x6cfc71),this['set']('text',void 0x0),this['set']('isVisible',!0x0);const _0x4e01aa=this['bindTemplate'];this['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai-chat-controls__model-name',_0x4e01aa['if']('isVisible','ck-hidden',_0x7a5177=>!_0x7a5177)]},'children':[{'text':_0x4e01aa['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(_0x534c77){super(_0x534c77),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'](_0x61a1fa=>{this['focusTracker']['add'](_0x61a1fa['element']),this['keystrokes']['listenTo'](_0x61a1fa['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'](_0x462e31){this['urlInputField']['errorText']=_0x462e31,this['_updateConfirmButtonState'](),this['fire']('refreshBalloon');}['clearError'](){this['urlInputField']['errorText']=null,this['_updateConfirmButtonState']();}['_createBackButton'](){const _0x392d16=new Nt(this['locale']);return _0x392d16['set']({'icon':_0x1e7391,'tooltip':hs(this['locale'],'AI_CHAT_CONTEXT_URL_BACK_TO_CONTEXT'),'tooltipPosition':'n','class':['ck-button-icon\x20ck-button-back']}),this['on']('change:withBackButton',(_0x176341,_0x5adef7,_0x2654c8)=>{_0x392d16['set']({'class':['ck-button-icon\x20ck-button-back'+(_0x2654c8?'':'\x20ck-hidden')]});}),_0x392d16;}['_createUrlInputField'](){const _0x10f9ac=new te(this['locale'],_0x4e1e5d);return _0x10f9ac['set']({'label':hs(this['locale'],'AI_CHAT_CONTEXT_URL_LABEL'),'class':'ck-labeled-field-view_empty'}),_0x10f9ac['fieldView']['set']({'placeholder':hs(this['locale'],'AI_CHAT_CONTEXT_URL_PLACEHOLDER')}),_0x10f9ac;}['_createConfirmButton'](){const _0x2847ad=new Nt(this['locale']);return _0x2847ad['set']({'icon':_0x2d2483,'tooltip':hs(this['locale'],'AI_CHAT_CONTEXT_URL_ADD_URL'),'tooltipPosition':'n','class':'ck-button-icon','type':'submit','isEnabled':!0x1}),_0x2847ad;}['_setupTemplate'](){const _0x59a1bb=new _0x5afc1f(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'});_0x59a1bb['children']['add'](this['backButton'],0x0),this['setTemplate']({'tag':'form','attributes':{'class':Tr,'tabindex':'-1'},'children':[_0x59a1bb,{'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',_0x2a9d97=>{_0x2a9d97['stop'](),this['_handleSubmit']();});}['_setupKeystrokes'](){this['keystrokes']['set']('esc',(_0x4c259d,_0x2e887c)=>{this['clear'](),this['fire']('cancel'),_0x2e887c();});}['_handleSubmit'](){const _0xcccd56=this['getValue']()['trim']();_0xcccd56?this['_isValidUrl'](_0xcccd56)?(this['clearError'](),this['fire']('submitUrl',_0xcccd56)):this['setError'](hs(this['locale'],'AI_CHAT_CONTEXT_URL_INVALID_ERROR')):this['setError'](hs(this['locale'],'AI_CHAT_CONTEXT_URL_EMPTY_ERROR'));}['_updateConfirmButtonState'](){const _0x4ba5ef=this['getValue']()['trim'](),_0x3d365e=!!this['urlInputField']['errorText'];this['confirmButton']['isEnabled']=_0x4ba5ef['length']>0x0&&!_0x3d365e;}['_isValidUrl'](_0x536c54){try{return!!new URL(_0x536c54);}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(_0x210b42,_0x19efd2){super(_0x210b42),this['resource']=_0x19efd2,this['set']('isInContext',!!_0x19efd2['isInContext']),this['_titleView']=this['_createTitleView'](),this['_iconView']=this['_createIconView'](),this['_setupTemplate']();}['render'](){super['render']();}['getResourceIcon'](_0x3579ec){if(_0x3579ec['isInContext'])return _0x2d2483;switch(_0x3579ec['type']){case'document':return _0x5857a1;case'web-resource':return _0x4bff13;case'file':case'text':return _0x361cff;default:return _0x24d738;}}['highlightText'](_0x3cc94d){if(!_0x3cc94d||''===_0x3cc94d['trim']())return void this['_titleView']['highlightText'](null);const _0xfbb2ac=new RegExp(_0x308cdf(_0x3cc94d),'gi');this['_titleView']['highlightText'](_0xfbb2ac);}['updateResourceState'](_0x5bedc4){this['resource']['isInContext']=_0x5bedc4,this['isInContext']=_0x5bedc4,this['_updateIcon']();}['_createTitleView'](){const _0x515a8a=new _0x2164c5();return _0x515a8a['text']=this['resource']['label'],_0x515a8a['extendTemplate']({'tag':'span','attributes':{'class':[Sr]}}),_0x515a8a;}['_createIconView'](){const _0x3b656a=new xt();return _0x3b656a['content']=this['getResourceIcon'](this['resource']),_0x3b656a;}['_setupTemplate'](){const _0x1b9bf5=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':[fr,_0x1b9bf5['if']('isVisible','ck-hidden',_0x3d128a=>!_0x3d128a),_0x1b9bf5['if']('isInContext',br)]},'children':[{'tag':'div','attributes':{'class':[Rr]},'children':[this['_iconView']]},this['_titleView']],'on':{'click':_0x1b9bf5['to']('execute')}});}['_updateIcon'](){this['_iconView']['content']=this['getResourceIcon'](this['resource']);}}const kr='ck-ai-chat-resources__list';class Nr extends Dt{['_source'];constructor(_0x978fe3,_0x1b4ef3){super(_0x978fe3),this['_source']=_0x1b4ef3,this['extendTemplate']({'attributes':{'class':[kr]}});}['setResources'](_0x47fdd7,_0xbfcc9f){this['items']['clear']();let _0x519462=_0x47fdd7;if(this['_source']['useDefaultFiltering']&&_0xbfcc9f&&''!==_0xbfcc9f['trim']()){const _0xf0438=new RegExp(_0xbfcc9f['replace'](/[.*+?^${}()|[\]\\]/g,'\x5c$&'),'gi');_0x519462=_0x47fdd7['filter'](_0x53982b=>_0xf0438['test'](_0x53982b['label']));}for(const _0x338d61 of _0x519462){const _0x1c5ea1=new Or(this['locale'],_0x338d61);_0x1c5ea1['on']('execute',()=>{this['_handleResourceSelection'](this['_source'],_0x338d61);}),this['items']['add'](_0x1c5ea1);}this['_source']['useDefaultFiltering']&&this['highlightText'](_0xbfcc9f);}['highlightText'](_0x3201e9){this['_source']['useDefaultFiltering']&&this['items']['forEach'](_0x123f29=>{_0x123f29['highlightText'](_0x3201e9);});}['updateResourceState'](_0x13f605,_0x26d8f4){for(const _0x1915df of this['items']){const _0x1239db=_0x1915df;_0x1239db['resource']['id']===_0x13f605&&_0x1239db['updateResourceState'](_0x26d8f4);}}['_handleResourceSelection'](_0x12cbcb,_0x26b647){this['fire']('addResourceToContext',{'source':_0x12cbcb,'resource':_0x26b647});}}class vr extends te{['iconView'];['resetButtonView'];['_viewConfig'];constructor(_0x533f2e){const t=_0x533f2e['t'],_0x34cc1a={'showResetButton':!0x0,'showIcon':!0x0,'creator':_0x4e1e5d,'label':hs(_0x533f2e,'AI_CHAT_SEARCH_RESOURCES')};super(_0x533f2e,_0x34cc1a['creator']),this['label']=_0x34cc1a['label'],this['_viewConfig']=_0x34cc1a,this['_viewConfig']['showIcon']&&this['_setupSearchIcon'](),this['_viewConfig']['showResetButton']&&this['_setupResetButton'](_0x533f2e,t),this['_setupEventListeners']();}['reset'](){this['fieldView']['reset'](),this['_viewConfig']['showResetButton']&&this['resetButtonView']&&(this['resetButtonView']['isVisible']=!0x1),this['search']('');}['search'](_0x3f1279){this['fire']('search',_0x3f1279);}['getQuery'](){return this['fieldView']['element']?.['value']||'';}['_setupSearchIcon'](){this['iconView']=new xt(),this['iconView']['content']=_0x4d742c,this['fieldWrapperChildren']['add'](this['iconView'],0x0),this['extendTemplate']({'attributes':{'class':'ck-search__query_with-icon'}});}['_setupResetButton'](_0x386e15,t){this['resetButtonView']=new Nt(_0x386e15),this['resetButtonView']['set']({'label':t('Clear'),'icon':_0x49d6d3,'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',_0x19b0f2=>!_0x19b0f2),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(_0x20dd74,_0x4aa3c2){super(_0x20dd74),this['_source']=_0x4aa3c2['source'],this['_searchInputVisibleFrom']=_0x4aa3c2['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 _0x36a70d([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 _0x4c0073=new vt(this['locale']);return _0x4c0073['setTemplate']({'tag':'div','attributes':{'class':'ck\x20ck-search'},'children':[this['_searchView']]}),this['_searchView']['on']('search',(_0x4c42a9,_0x5378fe)=>{this['loadResources'](_0x5378fe),this['_source']['useDefaultFiltering']&&this['_resourcesListView']['highlightText'](_0x5378fe);}),_0x4c0073;}['_createResourcesListView'](){const _0x1bb0b7=new Nr(this['locale'],this['_source']);return _0x1bb0b7['delegate']('addResourceToContext')['to'](this),_0x1bb0b7['extendTemplate']({'attributes':{'class':this['bindTemplate']['if']('isLoading','ck-hidden')}}),_0x1bb0b7;}['_createSkeletonView'](){const _0x278651=new pn(this['locale'],mn['aiChatResources']);return _0x278651['bind']('isVisible')['to'](this,'isLoading'),_0x278651;}['render'](){super['render'](),this['loadResources']('');}['loadResources'](_0x452380){const _0x2b18ad=ot();this['_latestLoadResourcesUid']=_0x2b18ad,this['fire']('loadSourceResources',{'sourceId':this['_source']['id'],'query':_0x452380,'uid':_0x2b18ad}),this['isLoading']=!0x0;}['setResources'](_0x208d1a,_0x2fb440){if(_0x2fb440&&_0x2fb440!==this['_latestLoadResourcesUid'])return;const _0x5086a4=this['_source']['useDefaultFiltering']?this['_searchView']['getQuery']():'';this['_resourcesListView']['setResources'](_0x208d1a,_0x5086a4),_0x208d1a['length']>=this['_searchInputVisibleFrom']&&!this['children']['has'](this['_searchSection'])&&this['children']['add'](this['_searchSection'],0x0),requestAnimationFrame(()=>{this['isLoading']=!0x1;});}['updateResourceState'](_0x393739,_0x362b53){this['_resourcesListView']['updateResourceState'](_0x393739,_0x362b53);}}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(_0x547383,_0x2b2310,_0xf11021){this['_locale']=_0x547383,this['_bodyCollection']=_0x2b2310,this['_config']=_0xf11021;}['showSourceResourcesBalloon']({source:_0x25ae7a,withBackButton:_0x4fd1a5}){let _0x586ef=this['_sourceResourceBalloons']['get'](_0x25ae7a['id']);_0x586ef||(_0x586ef=this['_createSourceResourceBalloonPanel'](),this['_sourceResourceBalloons']['set'](_0x25ae7a['id'],_0x586ef),this['_setupSingleResourceBalloonClickOutsideHandler'](_0x586ef)),this['_addSourceResourceContent']({'balloonPanel':_0x586ef,'source':_0x25ae7a,'withBackButton':_0x4fd1a5}),_0x586ef['show']();const _0x511343=this['_config']['getTargetElement']();_0x511343&&_0x586ef['pin']({'target':_0x511343,'limiter':this['_config']['getLimiterElement']()});}['populateSourceResourceBalloon'](_0x5cd45a,_0x153cef,_0x4c8d20){const _0x1771c4=this['_sourceResourceBalloons']['get'](_0x5cd45a);if(!_0x1771c4)return;const _0x3aff04=this['_getResourcesViewFromBalloon'](_0x1771c4);_0x3aff04&&(_0x3aff04['setResources'](_0x153cef,_0x4c8d20),_0x3aff04['once']('change:isLoading',()=>{_0x1771c4['pin']({'target':this['_config']['getTargetElement'](),'limiter':this['_config']['getLimiterElement']()});}));}['closeSourceResourceBalloon'](_0x393b0a){const _0x1cdd9a=this['_sourceResourceBalloons']['get'](_0x393b0a);_0x1cdd9a&&requestAnimationFrame(()=>{_0x1cdd9a['hide'](),this['_sourceResourceBalloons']['delete'](_0x393b0a),this['_config']['onBalloonClosed']();});}['isAnyResourceBalloonVisible'](){for(const _0x5841e6 of this['_sourceResourceBalloons']['values']())if(_0x5841e6['isVisible'])return!0x0;return!0x1;}['updateResourceState'](_0x9a226e,_0x1d175b,_0x57273d){const _0x1195a1=this['_sourceResourceBalloons']['get'](_0x9a226e);if(!_0x1195a1||!_0x1195a1['isVisible'])return;const _0x216923=this['_config']['getTargetElement']();if(!_0x216923)return;_0x1195a1['pin']({'target':_0x216923,'limiter':this['_config']['getLimiterElement']()});const _0x4f1967=this['_getResourcesViewFromBalloon'](_0x1195a1);_0x4f1967&&_0x4f1967['updateResourceState'](_0x1d175b,_0x57273d);}['destroy'](){for(const _0x563a1f of this['_sourceResourceBalloons']['values']())_0x563a1f['destroy']();this['_sourceResourceBalloons']['clear']();}['_createSourceResourceBalloonPanel'](){const _0x31e5d4=new Xt(this['_locale']);return _0x31e5d4['extendTemplate']({'attributes':{'class':xr}}),this['_bodyCollection']['add'](_0x31e5d4),_0x31e5d4;}['_addSourceResourceContent']({balloonPanel:_0x33dbf1,source:_0x512341,withBackButton:_0x2bedcb}){_0x33dbf1['content']['clear']();const _0x452662=this['_createBalloonHeader']({'balloonPanel':_0x33dbf1,'source':_0x512341,'withBackButton':_0x2bedcb});_0x33dbf1['content']['add'](_0x452662);const _0xb43fdf=this['_createBalloonResourcesView'](_0x512341);_0x33dbf1['content']['add'](_0xb43fdf);}['_createBalloonHeader']({balloonPanel:_0x3c7e4c,source:_0x2e7ff7,withBackButton:_0x5dc405}){const _0x3d4fc4=new _0x5afc1f(this['_locale'],{'label':_0x2e7ff7['label'],'class':Dr});return _0x5dc405&&_0x3d4fc4['children']['add'](this['_createBackButton'](_0x3c7e4c),0x0),_0x3d4fc4;}['_createBackButton'](_0x9dd32b){const _0x7bc1b7=new Nt(this['_locale']);return _0x7bc1b7['set']({'icon':_0x1e7391,'tooltip':hs(this['_locale'],'AI_CHAT_CONTEXT_URL_BACK_TO_CONTEXT'),'tooltipPosition':'n','class':Lr}),_0x7bc1b7['on']('execute',()=>{_0x9dd32b['hide'](),this['_config']['onBackToContext']();}),_0x7bc1b7;}['_createBalloonResourcesView'](_0x488381){const _0x53effc=new yr(this['_locale'],{'source':_0x488381,'searchInputVisibleFrom':this['_config']['searchInputVisibleFrom']});return _0x53effc['on']('loadSourceResources',(_0x1deb54,_0x2b7333)=>{this['_config']['onLoadSourceResources'](_0x2b7333);}),_0x53effc['on']('addResourceToContext',(_0x2f82bf,_0xd8553e)=>{this['_config']['onResourceSelected'](_0xd8553e['source'],_0xd8553e['resource']),this['closeSourceResourceBalloon'](_0x488381['id']);}),_0x53effc;}['_getResourcesViewFromBalloon'](_0x500dbd){const _0x2e7ef3=_0x500dbd['content']['get'](0x1);return _0x2e7ef3 instanceof yr?_0x2e7ef3:null;}['_setupSingleResourceBalloonClickOutsideHandler'](_0x36d82b){zt({'emitter':_0x36d82b,'contextElements':[_0x36d82b['element']],'callback':()=>{_0x36d82b['hide'](),this['_config']['onBalloonClosed']();},'activator':()=>_0x36d82b['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(_0x5aac82,_0x22501e){super(_0x5aac82),this['bodyCollection']=_0x22501e['bodyCollection'],this['_currentContextsChips']=this['createCollection'](),this['_conversationContextsChips']=this['createCollection'](),this['addContextButtonView']=this['_createAddContextButtonView'](_0x5aac82),this['_addContextBalloonPanelView']=this['_createAddContextBalloonPanelView'](_0x5aac82),this['_urlBalloonPanelView']=this['_createUrlBalloonPanelView'](_0x5aac82),this['_resourcesBalloonView']=this['_createResourcesBalloonView'](_0x5aac82,_0x22501e);const _0x32eab3={'cssClasses':{'showMoreButton':$r+'\x20'+us,'showMoreBalloon':qr,'overflowContainer':Yr,'controlsButton':Wr}};this['_overflowManager']=new Wn(_0x5aac82,this['_currentContextsChips'],_0x32eab3,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'](_0xd5221d,_0x4f6e7c){const _0x2ef082=this['_createContextButton'](_0xd5221d,'current',!0x0,_0x4f6e7c);this['_addContextToCollection'](_0x2ef082,this['_currentContextsChips']),this['_overflowManager']['reorganizeChips']();}['removeContextItem'](_0x5bea96){this['_removeContextFromCollection'](_0x5bea96,this['_currentContextsChips']),this['_removeContextFromCollection'](_0x5bea96,this['_overflowManager']['overflowChips']),this['_overflowManager']['reorganizeChips']();}['setContextItemLoading'](_0x363df0,_0x54495a){let _0x1cf99e=this['_currentContextsChips']['find'](_0x4e4bf4=>_0x4e4bf4['id']===_0x363df0);_0x1cf99e||(_0x1cf99e=this['_overflowManager']['overflowChips']['find'](_0xa23ad=>_0xa23ad['id']===_0x363df0)),_0x1cf99e&&(_0x1cf99e['isLoading']=_0x54495a);}['setConversationContext'](_0x3e2fb1){this['_conversationContextsChips']['clear']();for(const _0x338e87 of _0x3e2fb1){const _0x48c1e0=this['_createContextButton'](_0x338e87,'conversation',!0x1,!0x1);this['_addContextToCollection'](_0x48c1e0,this['_conversationContextsChips']);}}['clearCurrentContextItems'](){this['_currentContextsChips']['clear'](),this['_overflowManager']['clear']();}['clearConversationContextItems'](){this['_conversationContextsChips']['clear']();}['updateResourceState'](_0x38b1db,_0x3bb344,_0x45ae55){this['_resourcesBalloonView']['updateResourceState'](_0x38b1db,_0x3bb344,_0x45ae55);}['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:_0x2b9fa7,withBackButton:_0x2e5d6f}){this['_resourcesBalloonView']['showSourceResourcesBalloon']({'source':_0x2b9fa7,'withBackButton':_0x2e5d6f}),this['addContextButtonView']['isOn']=!0x0;}['populateSourceResourceBalloon'](_0x379cfd,_0x3b1775,_0x3cfe0c,_0x2a379c){this['_resourcesBalloonView']['populateSourceResourceBalloon'](_0x379cfd,_0x3cfe0c,_0x2a379c);}['closeSourceResourceBalloon'](_0x56891a){this['_resourcesBalloonView']['closeSourceResourceBalloon'](_0x56891a),this['addContextButtonView']['isOn']=!0x1;}['setAddContextOptions'](_0x1fecbe){this['_setBalloonPanelContent'](this['_addContextBalloonPanelView'],this['locale'],_0x1fecbe),this['_setAddContextButtonEnabled'](_0x1fecbe);}['_setAddContextButtonEnabled'](_0x914c7c){const _0x102084=!_0x914c7c['document']['isHidden']&&_0x914c7c['document']['enabled'],_0x2e13bc=_0x914c7c['urls']['enabled'],_0x34ad91=_0x914c7c['files']['enabled'],_0x5c7aa0=_0x914c7c['sources']['length']>0x0,_0x49db63=_0x914c7c['customItems']&&_0x914c7c['customItems']['length']>0x0;this['addContextButtonView']['isEnabled']=_0x102084||_0x2e13bc||_0x34ad91||_0x5c7aa0||_0x49db63;}['_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'](_0xd1c9cf){const _0x5acefe=new Nt(_0xd1c9cf);return _0x5acefe['set']({'label':hs(_0xd1c9cf,'AI_CHAT_CONTEXT_ADD_CONTEXT'),'class':Wr+'\x20'+Br+'\x20'+us,'icon':_0xf96a54,'isToggleable':!0x0,'tooltip':!0x0,'tooltipPosition':'sw'}),_0x5acefe;}['_createAddContextBalloonPanelView'](_0x5dfbdd){return this['_createBaseBalloonPanel'](_0x5dfbdd,Vr);}['_createUrlBalloonPanelView'](_0x4bcd57){const _0x326cfa=this['_createBaseBalloonPanel'](_0x4bcd57,Gr);return this['_addUrlContent'](_0x326cfa,_0x4bcd57),_0x326cfa;}['_createResourcesBalloonView'](_0x5e1ca6,_0xff518e){const _0x3c519b={'searchInputVisibleFrom':_0xff518e['searchInputVisibleFrom'],'onBackToContext':()=>{this['showAddContextBalloonPanel'](),this['_addContextBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':Xr});},'onResourceSelected':(_0x109a44,_0x57c58e)=>{this['fire']('addResourceToContext',{'source':_0x109a44,'resource':_0x57c58e});},'onLoadSourceResources':_0x18694d=>{this['fire']('loadSourceResources',_0x18694d);},'onBalloonClosed':()=>{this['addContextButtonView']['isOn']=!0x1;},'getLimiterElement':()=>this['_getLimiterElement'](),'getTargetElement':()=>this['addContextButtonView']['element']};return new Pr(_0x5e1ca6,_0xff518e['bodyCollection'],_0x3c519b);}['_getLimiterElement'](){return this['element']?.['closest']('.'+Qr)||document['body'];}['_createBaseBalloonPanel'](_0x253392,_0x28c7cd){const _0x9daa05=new Xt(_0x253392);return _0x9daa05['extendTemplate']({'attributes':{'class':_0x28c7cd}}),this['bodyCollection']['add'](_0x9daa05),_0x9daa05;}['_setBalloonPanelContent'](_0xb9e1a1,_0x233a37,_0x1bda82){if(_0xb9e1a1['content']['clear'](),!_0x1bda82['document']['isHidden']&&_0x1bda82['document']['enabled']){const _0x4c65b6=this['_createBalloonButton'](_0x233a37,{'label':hs(_0x233a37,'AI_CHAT_CONTEXT_CURRENT_DOCUMENT'),'icon':_0x5857a1});_0x4c65b6['on']('execute',()=>{this['fire']('addDocumentToContext'),this['hideAddContextBalloonPanel']();}),_0xb9e1a1['content']['add'](_0x4c65b6);}if(_0x1bda82['urls']['enabled']){const _0x4e0113=this['_createBalloonButton'](_0x233a37,{'label':hs(_0x233a37,'AI_CHAT_CONTEXT_URL_LABEL'),'icon':_0x4bff13});_0x4e0113['on']('execute',()=>{this['hideAddContextBalloonPanel'](),this['showUrlBalloonPanel'](),this['_urlBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':Xr}),this['_urlInputView']['focus']();}),_0xb9e1a1['content']['add'](_0x4e0113);}if(_0x1bda82['files']['enabled']){const _0x55777d=new _0x1356ca(_0x233a37);_0x55777d['set']({'label':hs(_0x233a37,'AI_CHAT_CONTEXT_FILE_LABEL'),'icon':_0x5b5059,'withText':!0x0,'tooltip':!0x0,'class':Fr,'allowMultipleFiles':!0x0}),_0x55777d['on']('execute',()=>{this['hideAddContextBalloonPanel']();}),_0x55777d['on']('done',(_0x27db88,_0x48ac3d)=>{this['fire']('addFileToContext',_0x48ac3d);}),_0x55777d['tooltip']=!0x0,_0xb9e1a1['content']['add'](_0x55777d);}for(const _0x4af19d of _0x1bda82['sources']){const _0x497e14=this['_createBalloonButton'](_0x233a37,{'label':_0x4af19d['label'],'icon':_0x4af19d['icon']||_0x24d738,'type':'source'});_0xb9e1a1['content']['add'](_0x497e14),_0x497e14['on']('execute',()=>{this['hideAddContextBalloonPanel'](),this['_showSourceResourcesBalloon']({'source':_0x4af19d,'withBackButton':!this['_hasExactlyOneSource']});});}for(const _0x19d374 of _0x1bda82['customItems']||[]){const _0x43a566=this['_createBalloonButton'](_0x233a37,{'label':_0x19d374['label'],'icon':_0x19d374['icon']||_0x24d738,'type':'customItem'});_0xb9e1a1['content']['add'](_0x43a566),_0x43a566['on']('execute',()=>{this['hideAddContextBalloonPanel'](),this['fire']('executeCustomItemCallback',_0x19d374);});}this['_hasExactlyOneSource']=0x1===_0xb9e1a1['content']['length'],this['_urlInputView']['withBackButton']=!this['_hasExactlyOneSource'];}['_addUrlContent'](_0x1fbd87,_0x17facf){this['_urlInputView']=new wr(_0x17facf),this['_urlInputView']['on']('submitUrl',(_0x4aab74,_0x429ab2)=>{this['_handleUrlSubmit'](_0x429ab2);}),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});}),_0x1fbd87['content']['add'](this['_urlInputView']);}['_createBalloonButton'](_0xcd43e9,_0x15ccc){const _0x1741b5='source'===_0x15ccc['type']?new jr(_0xcd43e9):new Nt(_0xcd43e9);return _0x1741b5['set']({'label':_0x15ccc['label'],'icon':_0x15ccc['icon'],'withText':!0x0,'tooltip':!0x0,'tooltipPosition':'sw','class':Fr}),_0x1741b5;}['_setupAllBalloonClickOutsideHandlers'](){this['_setupAddContextBalloonClickOutsideHandler'](),this['_setupUrlBalloonClickOutsideHandler']();}['_setupUrlBalloonClickOutsideHandler'](){zt({'emitter':this['_urlBalloonPanelView'],'contextElements':[this['_urlBalloonPanelView']['element']],'callback':()=>{this['hideUrlBalloonPanel']();},'activator':()=>this['_urlBalloonPanelView']['isVisible']});}['_toggleAddContextBalloon'](_0x2be49b){const _0x2c296f=this['_addContextBalloonConfig'];_0x2c296f['buttonView']['isOn']=_0x2be49b,_0x2be49b?_0x2c296f['balloonView']['show']():_0x2c296f['balloonView']['hide']();}['_setupAddContextBalloonClickOutsideHandler'](){const {balloonView:_0x556b9d,buttonView:_0x5c2940,hideMethod:_0x12edb8}=this['_addContextBalloonConfig'];zt({'emitter':_0x556b9d,'contextElements':[_0x556b9d['element'],_0x5c2940['element']],'callback':()=>{_0x12edb8();},'activator':()=>_0x5c2940['isOn']&&!this['_urlBalloonPanelView']['isVisible']&&!this['_resourcesBalloonView']['isAnyResourceBalloonVisible']()});}['_createContextButton'](_0x19e4b7,_0x1d2336,_0x27821b=!0x1,_0x50ed56=!0x1){const _0x3958e9='conversation'===_0x1d2336||!0x0===_0x19e4b7['isReadOnly'],_0x512097=new Bn(this['locale'],_0x19e4b7,_0x3958e9,_0x27821b,_0x50ed56);return _0x3958e9||_0x512097['on']('removeContextItemChip',()=>{this['fire']('removeContextItem',_0x512097['id']);}),_0x512097;}['_addContextToCollection'](_0x21c681,_0x5ed439){_0x5ed439['add'](_0x21c681,0x0);}['_removeContextFromCollection'](_0x2534dc,_0x1a04d3){const _0x3fdd86=_0x1a04d3['find'](_0xa78ae0=>_0xa78ae0['id']===_0x2534dc);_0x3fdd86&&_0x1a04d3['remove'](_0x3fdd86);}['_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'](_0x6f4f62){this['_urlInputView']['clear'](),this['hideUrlBalloonPanel'](),this['fire']('addUrlToContext',_0x6f4f62);}}class jr extends Nt{['arrowView'];constructor(_0x4dcf35){super(_0x4dcf35),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 _0x3774f4=new xt();return _0x3774f4['content']=_0x25f981,_0x3774f4['extendTemplate']({'attributes':{'class':Kr+'__arrow'}}),_0x3774f4;}}class Jr extends vt{['_cancelButtonView'];['_loaderView'];constructor(_0x548bbe){super(_0x548bbe),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 _0x1ae09e=new Nt(this['locale']);return _0x1ae09e['set']({'label':hs(this['locale'],'AI_CHAT_STOP_GENERATING'),'withText':!0x0,'class':ls+'\x20ck-ai-button-stop-generating','icon':_0x2d2f82}),_0x1ae09e['on']('execute',()=>{this['fire']('abortPromptStream');}),_0x1ae09e;}['_createLoaderView'](){const _0x28331c=new vt(this['locale']);return _0x28331c['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')}]}),_0x28331c;}}class Zr extends vt{['_contextPanelView'];['_promptInputView'];['_promptCapabilitiesView'];['_loaderView'];['_modelUnavailableMessageView'];['_shouldRestorePromptInputFocus'];constructor(_0x1d5f60,_0x105595){super(_0x1d5f60),this['_contextPanelView']=this['_createContextPanelView'](_0x1d5f60,{'bodyCollection':_0x105595['bodyCollection'],'searchInputVisibleFrom':_0x105595['contextResourcesSearchInputVisibleFrom']}),this['_promptInputView']=this['_createPromptInputView'](_0x1d5f60),this['_promptCapabilitiesView']=this['_createPromptCapabilitiesView'](_0x1d5f60),this['_loaderView']=this['_createLoaderView'](_0x1d5f60),this['_modelUnavailableMessageView']=this['_createModelUnavailableMessageView'](_0x1d5f60),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 _0xcd749f=this['bindTemplate'];this['setTemplate']({'tag':'form','attributes':{'class':['ck','ck-ai-chat-controls',_0xcd749f['if']('isDisabled','ck-ai-chat-controls-disabled')]},'children':[{'tag':'div','attributes':{'class':[_0xcd749f['if']('isLoading','ck-hidden',_0x25f97c=>_0x25f97c||!this['isModelAvailable']),_0xcd749f['if']('isModelAvailable','ck-hidden',_0x15321a=>!_0x15321a||this['isLoading'])]},'children':[this['_contextPanelView'],this['_promptInputView'],this['_promptCapabilitiesView']]},{'tag':'div','attributes':{'class':[_0xcd749f['if']('isLoading','ck-hidden',_0x3521b1=>!_0x3521b1)]},'children':[this['_loaderView']]},{'tag':'div','attributes':{'class':[_0xcd749f['if']('isModelAvailable','ck-hidden',_0x1d95e6=>_0x1d95e6)]},'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'](_0x533012,_0x164b7e){return new zr(_0x533012,_0x164b7e);}['_createPromptInputView'](_0x1e55e9){return new hr(_0x1e55e9,this['_contextPanelView']['addContextButtonView']);}['_createPromptCapabilitiesView'](_0xdf276f){return new Er(_0xdf276f);}['_createLoaderView'](_0x54ec10){return new Jr(_0x54ec10);}['_createModelUnavailableMessageView'](_0x1f8b09){const _0x17812f=new to(_0x1f8b09);return _0x17812f['delegate']('startConversation')['to'](this),_0x17812f;}['_handlePromptInputFocus'](_0x4dd8f0,_0x4e7a60,_0x257d2c){_0x257d2c?this['_shouldRestorePromptInputFocus']=!0x0:this['_shouldRestorePromptInputFocus']&&this['_promptInputView']['focus']();}['addContextItem'](_0x231706,_0x3d91a6){this['_contextPanelView']['addContextItem'](_0x231706,_0x3d91a6);}['removeContextItem'](_0x31ded1){this['_contextPanelView']['removeContextItem'](_0x31ded1);}['setContextItemLoading'](_0x38024,_0x14a499){this['_contextPanelView']['setContextItemLoading'](_0x38024,_0x14a499);}['setIsUploadInProgress'](_0x2b2d7f){this['_promptInputView']['setIsUploadInProgress'](_0x2b2d7f);}['setConversationContext'](_0x4689ea){this['_contextPanelView']['setConversationContext'](_0x4689ea);}['clearPendingContextUI'](){this['_contextPanelView']['clearCurrentContextItems']();}['clearConversationContextUI'](){this['_contextPanelView']['clearConversationContextItems']();}['updateResourceState'](_0x4b2a3b,_0x5de5ac,_0x210cdd){this['_contextPanelView']['updateResourceState'](_0x4b2a3b,_0x5de5ac,_0x210cdd);}['setWebSearch'](_0xc4ea0d){this['_promptCapabilitiesView']['setWebSearch'](_0xc4ea0d);}['setReasoning'](_0x1903ff){this['_promptCapabilitiesView']['setReasoning'](_0x1903ff);}['resetMessageInput'](){this['_promptInputView']['reset']();}['setAddContextOptions'](_0xd80f16){this['_contextPanelView']['setAddContextOptions'](_0xd80f16);}['setInputPlaceholder'](_0x28f771){this['_promptInputView']['setPlaceholderText'](_0x28f771);}['setModelList'](_0x21d330,_0x19ae8a){this['_promptCapabilitiesView']['setModelList'](_0x21d330,_0x19ae8a);}['setModel'](_0x579828){_0x579828?(this['isModelAvailable']=!0x0,this['_promptCapabilitiesView']['setModel'](_0x579828)):this['isModelAvailable']=!0x1;}['enableModelSelector'](){this['_promptCapabilitiesView']['enableModelSelector']();}['disableModelSelector'](_0x5c6af8){this['_promptCapabilitiesView']['disableModelSelector'](_0x5c6af8);}['populateSourceResourceBalloon'](_0x5401b5,_0x48b639,_0xc986f8,_0x4a91a9){this['_contextPanelView']['populateSourceResourceBalloon'](_0x5401b5,_0x48b639,_0xc986f8,_0x4a91a9);}['closeSourceResourceBalloon'](_0x4787f7){this['_contextPanelView']['closeSourceResourceBalloon'](_0x4787f7);}['focusPromptInput'](_0x1cc762=!0x1){this['_promptInputView']['focus'](_0x1cc762);}['setPromptInputValue'](_0x30cc7e){this['_promptInputView']['queryView']['fieldView']['reset'](),this['_promptInputView']['queryView']['fieldView']['value']=_0x30cc7e;}}class to extends vt{constructor(_0x20a12a){super(_0x20a12a);const _0x3331c9=new Nt(_0x20a12a);_0x3331c9['set']({'label':hs(this['locale'],'AI_CHAT_MODEL_UNAVAILABLE_MESSAGE_BUTTON'),'withText':!0x0,'class':['ck-ai-chat-controls__start-new-chat-button'],'tooltip':''}),_0x3331c9['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'},_0x3331c9]}]});}}class eo extends _0x5afc1f{['resizeButton'];constructor(_0x9ae5f0,_0x221f7e){super(_0x9ae5f0,{'label':_0x221f7e['label'],'class':'ck-ai-header\x20'+_0x221f7e['class'],'icon':_0x221f7e['icon']}),this['set']('isMaximized',!0x1),_0x221f7e['content']&&this['children']['add'](_0x221f7e['content']),_0x221f7e['showResizeButton']&&(this['resizeButton']=ds(_0x9ae5f0,this),this['children']['add'](this['resizeButton']));}}class io extends vt{constructor(_0x31ef63){super(_0x31ef63),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-disclaimer']},'children':[{'tag':'p','attributes':{'class':['ck','ck-ai-disclaimer__content']},'children':[{'text':hs(_0x31ef63,'AI_DISCLAIMER_TEXT')}]}]});}}function so(_0x40a29c,_0x695781){const _0x33b16e=new Nt(_0x40a29c);return _0x33b16e['set']({'label':hs(_0x40a29c,'AI_CHAT_LABEL_NEW_CHAT'),'withText':!0x0,'icon':_0x5c01b7,'class':'ck-ai-chat__start-conversation\x20'+ls}),_0x33b16e['on']('execute',()=>{_0x695781['fire']('startConversation');}),_0x33b16e;}class no extends vt{['chatHeader'];['chatFeed'];['chatControls'];['chatDisclaimer'];['_bodyCollection'];constructor(_0x4c7fd9,_0xd18032){super(_0x4c7fd9),this['_bodyCollection']=new Qt(_0x4c7fd9),this['_bodyCollection']['attachToDom']();const _0x3bb7f2=so(_0x4c7fd9,this);this['chatHeader']=new eo(_0x4c7fd9,{'label':hs(_0x4c7fd9,'AI_CHAT_HEADING'),'icon':_0x188f09,'class':'ck-ai-header_chat','content':_0x3bb7f2,'showResizeButton':_0xd18032['showResizeButton']}),this['chatHeader']['delegate']('resizeTabs')['to'](this),this['chatFeed']=new rr(_0x4c7fd9,this['_bodyCollection']),this['chatFeed']['delegate'](...tn)['to'](this),this['chatControls']=new Zr(_0x4c7fd9,{'bodyCollection':this['_bodyCollection'],'contextResourcesSearchInputVisibleFrom':_0xd18032['contextResourcesSearchInputVisibleFrom']}),this['chatControls']['delegate'](...tn)['to'](this),this['chatDisclaimer']=new io(_0x4c7fd9),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset_all','ck-ai-chat','ck-rounded-corners'],'dir':_0x4c7fd9['uiLanguageDirection']},'children':[this['chatHeader'],this['chatFeed'],this['chatControls'],this['chatDisclaimer']]});}['populateSourceResourceBalloon'](_0x24eaa3,_0x4edabf,_0x280327,_0x37782d){this['chatControls']['populateSourceResourceBalloon'](_0x24eaa3,_0x4edabf,_0x280327,_0x37782d);}['closeSourceResourceBalloon'](_0x479e75){this['chatControls']['closeSourceResourceBalloon'](_0x479e75);}['destroy'](){this['_bodyCollection']['detachFromDom'](),super['destroy']();}}class ro extends _0x29a024{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(_0x40d4e0){super(_0x40d4e0);const _0x21c579=this['context']['plugins']['get']('AITabs');this['set']('isBusy',!0x1),this['_promiseQueue']=new Cn(),this['_view']=new no(this['context']['locale'],{'showResizeButton':_0x21c579['showResizeButton'],'contextResourcesSearchInputVisibleFrom':this['context']['config']['get']('ai.chat.context.searchInputVisibleFrom')}),this['_view']['delegate']('resizeTabs')['to'](_0x21c579),this['_view']['delegate'](...tn)['to'](this),this['_view']['on']('toggleSuggestionDisplayMode',(_0x517fc5,{showDiff:_0x2c56ed})=>{this['showDiff']=_0x2c56ed;}),_0x21c579['view']['addTab']({'id':'chat','buttonLabel':hs(this['context']['locale'],'AI_CHAT_HEADING'),'buttonIcon':_0x188f09,'order':0x0,'content':this['_view']}),this['_view']['chatHeader']['bind']('isMaximized')['to'](_0x21c579['view'],'isMaximized',_0x4c3111=>_0x4c3111),this['_view']['chatControls']['bind']('isLoading')['to'](this,'isBusy',_0x41c8cd=>_0x41c8cd),this['_view']['chatControls']['setInputPlaceholder'](this['_getInputPlaceholder']()),this['bind']('isModelAvailable')['to'](this['_view']['chatControls'],'isModelAvailable');}['destroy'](){super['destroy'](),this['_titleAnimationInterval']&&clearInterval(this['_titleAnimationInterval']);}['createConversation'](_0x40642d){const _0x4ce692=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'](_0x40642d['availableModels'],!this['context']['config']['get']('ai.models.showModelSelector')),this['addFeedItemStaticMessage']({'id':'conversation-start','staticMessage':_0x4ce692}),this['fire']('conversationCreated');}async['addFeedItemStaticMessage']({id:_0x19327f,staticMessage:_0x2c9a5b}){return this['_promiseQueue']['enqueue'](async()=>{this['_view']['chatFeed']['addItem']('ai-reply',{'id':_0x19327f,'initialContent':'<p>'+_0x2c9a5b+'</p>'});});}async['addFeedItemUserMessage'](_0x1bff64){const _0x6240cf=_0x1bff64['attributes']?.['displayedPrompt']||_0x1bff64['userMessage'];return this['_promiseQueue']['enqueue'](async()=>{this['_view']['chatFeed']['addItem']('user-message',{'contextItems':Array['from'](_0x1bff64['contextItems']['values']()),'initialContent':'<p>'+_0x6240cf+'</p>','id':_0x1bff64['id']});});}async['addFeedItemError']({errorMessage:_0x1bddc2,id:_0x2faf11}){return this['_promiseQueue']['enqueue'](async()=>{this['_view']['chatFeed']['addItem']('error-message',{'initialContent':'<p>'+_0x1bddc2+'</p>','id':_0x2faf11});});}async['addFeedItemAIReply'](_0x51e069){return this['_promiseQueue']['enqueue'](async()=>{this['_view']['chatFeed']['addItem']('ai-reply',{'id':_0x51e069['interactionId']+':'+_0x51e069['id']}),this['clearLoadingMessage']();});}async['addFeedItemAISuggestion'](_0x56c42d){const _0x452bb5=$s(this['context']);let _0x3c21e8=_0x452bb5['config']['get']('ai.availableReplyActions')||[...fn];if(_0x452bb5['plugins']['has']('TrackChanges')){if(!this['_isTrackChangesCommandValueBound']){this['_isTrackChangesCommandValueBound']=!0x0;const _0x3d6d74=_0x452bb5['commands']['get']('trackChanges');this['_view']['chatFeed']['bind']('isTrackChangesOn')['to'](_0x3d6d74,'value');}}else _0x3c21e8=_0x3c21e8['filter'](_0x29e826=>'insertSuggestion'!=_0x29e826);return this['_promiseQueue']['enqueue'](async()=>{this['_view']['chatFeed']['addItem']('ai-suggestion-reply',{'id':_0x56c42d['interactionId']+':'+_0x56c42d['id'],'areActionsDisabled':_0x56c42d['areActionsDisabled'],'showDiff':this['showDiff'],'availableActions':_0x3c21e8}),this['clearLoadingMessage']();});}async['addFeedInteractionHeader'](_0x37a7a0,_0x3b440d){return this['_promiseQueue']['enqueue'](async()=>{const _0x1811e1=this['_view']['chatFeed']['children']['last'];if(_0x1811e1 instanceof Zn)return this['_view']['chatFeed']['children']['remove'](_0x1811e1),void this['_view']['chatFeed']['addItem']('interaction-header',{'id':_0x37a7a0['id'],'capabilities':{'isWebSearchEnabled':_0x1811e1['capabilities']['isWebSearchEnabled']||_0x3b440d['isWebSearchEnabled'],'isReasoningEnabled':_0x1811e1['capabilities']['isReasoningEnabled']||_0x3b440d['isReasoningEnabled']}});this['_view']['chatFeed']['addItem']('interaction-header',{'id':_0x37a7a0['id'],'capabilities':_0x3b440d});});}async['addFeedItemCustomElement'](_0x1d9b07,_0x534001){let _0x15fb2a;return await this['_promiseQueue']['enqueue'](async()=>{_0x15fb2a=this['_view']['chatFeed']['addItem']('custom-element',{'content':_0x1d9b07,'id':_0x534001});}),_0x15fb2a;}['removeFeedItem'](_0x595862){this['_view']['chatFeed']['removeItem'](_0x595862);}['hasFeedItem'](_0x4f521e){return this['_view']['chatFeed']['hasItem'](_0x4f521e);}['updateFeedInteractionHeader'](_0x1d5653){const _0x3ac0d3=this['_view']['chatFeed']['children']['find'](_0x5366f2=>_0x5366f2['options']['id']==_0x1d5653['id']&&_0x5366f2 instanceof Zn);_0x3ac0d3&&_0x3ac0d3['set']('isVisible',_0x1d5653['isVisible']);}async['updateFeedItemAIReplyContent'](_0x236669){const _0x1af668=_0x236669['renderingStrategy']||this['feedItemRenderingStrategy'];return this['_promiseQueue']['enqueue'](async _0x4c2ad5=>{await this['_view']['chatFeed']['updateReplyItem']({..._0x236669,'abortSignal':_0x4c2ad5,'renderingStrategy':_0x1af668}),_0x236669['isDone']&&this['markFeedItemAsDone'](_0x236669['id']);});}['updateFeedItemAIReplySources'](_0x405a3d,_0x1d47a5){this['_view']['chatFeed']['updateWebSources'](_0x405a3d,_0x1d47a5);}async['updateFeedItemAIReplySuggestionContent'](_0x33ac06){return this['_promiseQueue']['enqueue'](async _0x44f8e3=>{await this['_view']['chatFeed']['updateSuggestionItem']({..._0x33ac06,'abortSignal':_0x44f8e3}),_0x33ac06['isDone']&&this['markFeedItemAsDone'](_0x33ac06['id']);});}['updateFeedItemAIReplySuggestionPartState'](_0x13673f){this['_view']['chatFeed']['updateSuggestionPartState'](_0x13673f);}['setFeedItemAIReplySuggestionPartActive'](_0x393c05){this['_view']['chatFeed']['setSuggestionPartActive'](_0x393c05);}['markFeedItemAsDone'](_0x140685){this['_view']['chatFeed']['markItemAsDone'](_0x140685);}['removeFeedInteraction'](_0x4a0e81){this['_view']['chatFeed']['getItemIds']()['filter'](_0x8610db=>_0x8610db['startsWith'](_0x4a0e81))['forEach'](_0x1488a0=>this['_view']['chatFeed']['removeItem'](_0x1488a0));}['startInteraction'](){const _0x188483=this['prepareLoadingMessage']({'isWebSearchEnabled':!0x1,'isReasoningEnabled':!0x1});this['setLoadingMessage'](_0x188483),this['_view']['chatControls']['disableModelSelector'](!this['context']['config']['get']('ai.models.showModelSelector')),this['isBusy']=!0x0,this['_view']['chatFeed']['startAutoScroll']();}['stopInteraction'](_0x5c8706){this['_promiseQueue']['abort'](),this['_view']['chatFeed']['getItemIds']()['filter'](_0x3f4138=>_0x3f4138['startsWith'](_0x5c8706['id']))['forEach'](_0xf8ad84=>this['markFeedItemAsDone'](_0xf8ad84)),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'](_0x5e1866,_0x4c3fa5){this['_view']['chatControls']['addContextItem'](_0x5e1866,_0x4c3fa5);}['removeContextItem'](_0x2edc63){this['_view']['chatControls']['removeContextItem'](_0x2edc63);}['setContextItemLoading'](_0x2e7a21,_0xbb642e){this['_view']['chatControls']['setContextItemLoading'](_0x2e7a21,_0xbb642e);}['setIsUploadInProgress'](_0x5492e7){this['_view']['chatControls']['setIsUploadInProgress'](_0x5492e7);}['setConversationContext'](_0x107375){this['_view']['chatControls']['setConversationContext'](_0x107375);}['clearPendingContextUI'](){this['_view']['chatControls']['clearPendingContextUI']();}['clearConversationContextUI'](){this['_view']['chatControls']['clearConversationContextUI']();}['updateResourceState'](_0x5e20c4,_0x27c4da,_0x3ad70f){this['_view']['chatControls']['updateResourceState'](_0x5e20c4,_0x27c4da,_0x3ad70f);}['resetMessageInput'](){this['_view']['chatControls']['resetMessageInput'](),this['_view']['chatControls']['setInputPlaceholder'](this['_getInputPlaceholder']());}['setAddContextOptions'](_0x100116){this['_view']['chatControls']['setAddContextOptions'](_0x100116);}['updateCapabilities'](_0x364389){this['_view']['chatControls']['setWebSearch'](_0x364389['isWebSearchEnabled']),this['_view']['chatControls']['setReasoning'](_0x364389['isReasoningEnabled']),this['_view']['chatControls']['setInputPlaceholder'](this['_getInputPlaceholder'](_0x364389));}['setSelectedModel'](_0x341307,_0x5ca842){this['_view']['chatControls']['setModel'](_0x341307),_0x5ca842&&this['_view']['chatControls']['disableModelSelector'](!0x1);}['setFeedItemRenderingStrategy'](_0x811254){this['feedItemRenderingStrategy']=_0x811254;}['toggleLoadingSkeleton'](_0x38f0fe){this['_view']['chatFeed']['toggleLoadingSkeleton'](_0x38f0fe);}['resetConversationTitle'](){this['setConversationTitle'](hs(this['context']['locale'],'AI_CHAT_HEADING'));}['setConversationTitle'](_0x3cf1b9,_0x207a70=!0x1){if(_0x207a70&&!St()&&_0x3cf1b9['length'])return this['_view']['chatHeader']['label']='',void this['_animateConversationTitle'](_0x3cf1b9);this['_view']['chatHeader']['label']=_0x3cf1b9;}['setLoadingMessage'](_0x37ade8){this['_view']['chatFeed']['setLoadingMessage'](_0x37ade8);}['clearLoadingMessage'](){this['_view']['chatFeed']['setLoadingMessage']('');}['_animateConversationTitle'](_0x2c0054){let _0x58e199=0x0;clearInterval(this['_titleAnimationInterval']),this['_titleAnimationInterval']=setInterval(()=>{this['_view']['chatHeader']['label']=this['_view']['chatHeader']['label']+_0x2c0054[_0x58e199],_0x58e199++,_0x58e199===_0x2c0054['length']&&clearInterval(this['_titleAnimationInterval']);},0x1e);}['prepareLoadingMessage'](_0x4c54b1){return _0x4c54b1['isWebSearchEnabled']&&_0x4c54b1['isReasoningEnabled']?hs(this['context']['locale'],'AI_CHAT_FEED_LOADING_MESSAGE_WEBSEARCH_REASONING'):_0x4c54b1['isWebSearchEnabled']?hs(this['context']['locale'],'AI_CHAT_FEED_LOADING_MESSAGE_WEBSEARCH'):_0x4c54b1['isReasoningEnabled']?hs(this['context']['locale'],'AI_CHAT_FEED_LOADING_MESSAGE_REASONING'):hs(this['context']['locale'],'AI_CHAT_FEED_LOADING_MESSAGE_REGULAR');}['_getInputPlaceholder'](_0x2c8173){return _0x2c8173?_0x2c8173['isWebSearchEnabled']&&_0x2c8173['isReasoningEnabled']?hs(this['context']['locale'],'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_WEBSEARCH_REASONING'):_0x2c8173['isWebSearchEnabled']?hs(this['context']['locale'],'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_WEBSEARCH'):_0x2c8173['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'](_0x41d0ce,_0x49f1aa,_0xa9720b,_0x41ffc7){this['_view']['populateSourceResourceBalloon'](_0x41d0ce,_0x49f1aa,_0xa9720b,_0x41ffc7);}['closeSourceResourceBalloon'](_0x59bd52){this['_view']['closeSourceResourceBalloon'](_0x59bd52);}['setPromptInputValue'](_0x1f6787){this['_view']['chatControls']['setPromptInputValue'](_0x1f6787);}['focusPromptInput'](_0x412246=!0x1){this['_view']['chatControls']['focusPromptInput'](_0x412246);}['scrollFeedToSuggestion'](_0xaa3a50,_0x38ec17){this['_view']['chatFeed']['scrollToSuggestion'](_0xaa3a50,_0x38ec17);}['startAutoScroll'](_0x14498b={}){this['_view']['chatFeed']['startAutoScroll'](_0x14498b);}['disableControls'](){this['_view']['chatControls']['isDisabled']=!0x0;}['enableControls'](){this['_view']['chatControls']['isDisabled']=!0x1;}}class oo extends Dt{['sections'];constructor(_0x48efb7,_0x316d02){super(_0x48efb7),this['sections']=_0x316d02,this['items']['addMany'](this['sections']),this['extendTemplate']({'attributes':{'class':['ck-ai-chat-history__sections']}});}['filter'](_0x516e1f){let _0x3b53ce=0x0,_0x1d1b67=0x0;for(const _0x3d1cc5 of this['sections']){const {resultsCount:_0x12d266,totalItemsCount:_0x12ef10}=_0x3d1cc5['filter'](_0x516e1f);_0x3b53ce+=_0x12d266,_0x1d1b67+=_0x12ef10;}return{'resultsCount':_0x3b53ce,'totalItemsCount':_0x1d1b67};}}class ao extends Ht{['title'];['itemsViews'];['_itemsListView'];constructor(_0x372aec,{title:_0x15a614,items:_0x2e97c9}){super(_0x372aec);const _0x43562e=this['bindTemplate'];this['set']('isVisible',!0x0),this['title']=_0x15a614,this['itemsViews']=_0x2e97c9;const _0x3d7642=new vt(_0x372aec);_0x3d7642['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-chat-history__section-title']},'children':[this['title']]}),this['_itemsListView']=new Dt(_0x372aec),this['_itemsListView']['items']['addMany'](this['itemsViews']),this['setTemplate']({'tag':'li','attributes':{'class':['ck-ai-chat-history__section',_0x43562e['if']('isVisible','ck-hidden',_0x26cdae=>!_0x26cdae)]},'children':[_0x3d7642,this['_itemsListView']]});}['filter'](_0x76e0dc){const _0x41edea=this['itemsViews']['length'];let _0x27f43e=0x0;for(const _0x3f71cf of this['itemsViews']){if(_0x76e0dc){const _0x1cd9dc=_0x3f71cf['isMatching'](_0x76e0dc);_0x3f71cf['isVisible']=!!_0x1cd9dc,_0x3f71cf['highlightText'](_0x76e0dc);}else _0x3f71cf['isVisible']=!0x0,_0x3f71cf['highlightText'](null);_0x3f71cf['isVisible']&&_0x27f43e++;}return this['isVisible']=_0x27f43e>0x0,{'resultsCount':_0x27f43e,'totalItemsCount':_0x41edea};}['getItem'](_0x3e67b5){return this['itemsViews']['find'](_0xef4e2f=>_0xef4e2f['id']===_0x3e67b5);}['removeItem'](_0x320d54){const _0x25d959=this['itemsViews']['indexOf'](_0x320d54);-0x1!==_0x25d959&&(this['itemsViews']['splice'](_0x25d959,0x1),this['_itemsListView']['items']['remove'](_0x320d54));}}class ho extends/* #__PURE__ -- @preserve */
|
|
27
|
+
_0x5b1fc6(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(_0x3926f6,_0x43acc2){super(_0x3926f6);const _0x13e74e=this['bindTemplate'];this['set']('isEdit',!0x1),this['set']('isVisible',!0x0),this['set']('pinned',!!_0x43acc2['pinned']),this['set']('loadingState',null),this['set']('title',_0x43acc2['title']),this['id']=_0x43acc2['id'];const {createdAt:_0x85b324,active:_0x27e7fb=!0x1}=_0x43acc2;this['_titleView']=new _0x2164c5(),this['_titleView']['bind']('text')['to'](this,'title',t=>_0x5131f5(t||'')),this['_titleView']['extendTemplate']({'attributes':{'class':['ck-ai-chat-history__item-title']}});const _0x4d518e=this['_createCheckView'](),_0xf991ae=this['_createPinButtonView'](_0x3926f6),_0x2c200d=this['_createMenuDropdownView'](),_0x5cecd4=this['_createEditInputView'](_0x3926f6),_0x38ae35=this['_createAcceptEditButtonView'](_0x3926f6,_0x5cecd4),_0x4ea679=this['_createCancelEditButtonView'](_0x3926f6);this['actions']=this['createCollection'](),this['mainContent']=this['createCollection'](),this['mainContent']['add'](this['_titleView']),this['actions']['add'](_0xf991ae),this['actions']['add'](_0x2c200d),this['on']('change:isEdit',(_0x428428,_0x11bc05,_0x5c48b2)=>{this['actions']['clear'](),this['mainContent']['clear'](),_0x5c48b2?(this['actions']['add'](_0x38ae35),this['actions']['add'](_0x4ea679),this['mainContent']['add'](_0x5cecd4),_0x5cecd4['element']['value']=this['title']||'',_0x5cecd4['element']['focus']()):(this['actions']['add'](_0xf991ae),this['actions']['add'](_0x2c200d),this['mainContent']['add'](this['_titleView']));}),this['setTemplate']({'tag':'li','attributes':{'class':['ck-ai-chat-history__item',_0x27e7fb?'ck-ai-chat-history__item--active':'',_0x13e74e['if']('isVisible','ck-hidden',_0x2093f6=>!_0x2093f6),_0x13e74e['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',_0x13e74e['if']('loadingState','ck-hidden',_0x4c25af=>!!_0x4c25af)]},'children':_0x27e7fb?[_0x4d518e]:[]},{'tag':'div','attributes':{'class':['ck-ai-loader',_0x13e74e['if']('loadingState','ck-hidden',_0x20cfc3=>!_0x20cfc3)]},'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',_0x13e74e['if']('loadingState','ck-hidden',_0x8cc294=>!!_0x8cc294)]},'children':this['mainContent']},{'tag':'div','attributes':{'class':['ck-ai-loader__text',_0x13e74e['if']('loadingState','ck-hidden',_0x2769c7=>!_0x2769c7)]},'children':[{'text':_0x13e74e['to']('loadingState',_0x726374=>_0x726374?hs(this['locale'],ho['LOADING_LABELS'][_0x726374]):'')}]}]},{'tag':'span','attributes':{'class':['ck-ai-chat-history__item-date']},'children':[_0x85b324]}]},{'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'](_0x4795be){this['set']('title',_0x4795be);}['updateLoadingState'](_0x214a34,_0x16691d){this['set']('loadingState',_0x16691d?_0x214a34:null);}['_createCheckView'](){const _0xaad56a=new xt();return _0xaad56a['set']({'content':_0x2d2483}),_0xaad56a;}['_createPinButtonView'](_0x1eb054){const _0x25346b=new Nt(_0x1eb054);return _0x25346b['set']({'label':hs(_0x1eb054,'AI_CHAT_HISTORY_PIN_BUTTON'),'icon':_0x12da21,'withText':!0x1,'tooltip':!0x0}),_0x25346b['bind']('isOn')['to'](this,'pinned'),_0x25346b['on']('execute',()=>{const _0x5381fe=!this['pinned'];this['fire']('setConversationPinned',{'id':this['id'],'pinned':_0x5381fe});}),_0x25346b;}['_createMenuDropdownView'](){const _0xf7a6f4=Gt(this['locale']),_0x3cfdcf=_0xf7a6f4['panelView']['children'];_0xf7a6f4['buttonView']['set']({'label':hs(this['locale'],'AI_CHAT_HISTORY_SHOW_MORE_ITEMS'),'icon':_0xaca51e}),_0xf7a6f4['panelPosition']='sw';const _0x42ddac=new Nt(this['locale']);_0x42ddac['label']=hs(this['locale'],'AI_CHAT_HISTORY_EDIT_NAME'),_0x42ddac['withText']=!0x0,_0x42ddac['on']('execute',()=>{this['isEdit']=!0x0;});const _0x264b3d=new Nt(this['locale']);_0x264b3d['label']=hs(this['locale'],'AI_CHAT_HISTORY_REMOVE'),_0x264b3d['withText']=!0x0,_0x264b3d['on']('execute',()=>{this['showConfirm'](hs(this['locale'],'AI_CHAT_HISTORY_REMOVE_CONFIRM'),this['element'])['then'](()=>{this['fire']('removeConversation',{'id':this['id']});});});const _0x52b894=new Dt(this['locale']),_0x21b7e4=new Ht(this['locale']);_0x21b7e4['children']['add'](_0x42ddac);const _0x51a45=new Ht(this['locale']);return _0x51a45['children']['add'](_0x264b3d),_0x52b894['items']['addMany']([_0x21b7e4,_0x51a45]),_0x3cfdcf['add'](_0x52b894),_0xf7a6f4;}['_createEditInputView'](_0x3d1b3a){const _0x233645=new _0x567a9e(_0x3d1b3a),_0x468f7c=_0x233645['bindTemplate'];return _0x233645['extendTemplate']({'on':{'keydown':_0x468f7c['to'](_0x861e1=>{'Enter'==_0x861e1['key']&&this['_commitEditInputValue'](_0x233645);})}}),_0x233645;}['_createAcceptEditButtonView'](_0x83c235,_0x4bca1b){const _0x5ad6a2=new Nt(_0x83c235);return _0x5ad6a2['set']({'icon':_0x2d2483,'withText':!0x1,'tooltip':hs(_0x83c235,'AI_CHAT_HISTORY_ACCEPT')}),_0x5ad6a2['extendTemplate']({'attributes':{'class':['ck-confirm-view-submit']}}),_0x5ad6a2['on']('execute',()=>{this['_commitEditInputValue'](_0x4bca1b);}),_0x5ad6a2;}['_commitEditInputValue'](_0x52133e){const _0x16296e=_0x52133e['element']['value']||'';this['isEdit']=!0x1,this['fire']('editConversationTitle',{'id':this['id'],'title':_0x16296e});}['_createCancelEditButtonView'](_0x360fe4){const _0xe921ad=new Nt(_0x360fe4);return _0xe921ad['set']({'icon':_0x49d6d3,'withText':!0x1,'tooltip':hs(_0x360fe4,'AI_CHAT_HISTORY_CANCEL')}),_0xe921ad['extendTemplate']({'attributes':{'class':['ck-confirm-view-cancel']}}),_0xe921ad['on']('execute',()=>{this['isEdit']=!0x1,this['fire']('edit:cancel');}),_0xe921ad;}['_createSpinnerView'](){const _0x797fe0=new yn('tiny');return _0x797fe0['isVisible']=!0x0,_0x797fe0;}['isMatching'](_0x32e74e){return'string'==typeof this['title']&&this['title']['match'](_0x32e74e)?{'title':!0x0}:null;}['highlightText'](_0x2e177e){this['_titleView']['highlightText'](_0x2e177e);}}class co extends vt{['headerView'];['searchView'];['mainErrorView'];['skeletonView'];['emptyView'];['sectionsView'];constructor(_0x48770e,_0x2176ab){super(_0x48770e),this['set']('hasItems',!0x1),this['set']('isLoading',!0x0),this['set']('errorMessage',''),this['set']('isSearchViewVisible',!0x1),this['set']('isEmptyViewVisible',!0x1),this['set']('isMainErrorViewVisible',!0x1);const _0x446f7b=so(_0x48770e,this);this['headerView']=new eo(_0x48770e,{'label':hs(_0x48770e,'AI_CHAT_HISTORY_HEADING'),'icon':_0x3d6612,'class':'ck-ai-header_history','content':_0x446f7b,'showResizeButton':_0x2176ab}),this['headerView']['delegate']('resizeTabs')['to'](this),this['sectionsView']=new oo(_0x48770e,[]),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',_0x117c26=>!_0x117c26)]}}),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 _0x47d5c7=new _0xd43eec(this['locale'],{'filteredView':this['sectionsView'],'queryView':{'label':hs(this['locale'],'AI_CHAT_HISTORY_SEARCH_LABEL')},'infoView':{'text':{'notFound':{'primary':_0x33ce19=>hs(this['locale'],'AI_CHAT_HISTORY_SEARCH_NOT_FOUND_PRIMARY',_0x33ce19),'secondary':hs(this['locale'],'AI_CHAT_HISTORY_SEARCH_NOT_FOUND_SECONDARY')}}}}),_0x3f29fe=this['_createErrorView']();return _0x3f29fe['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('errorMessage','ck-hidden',_0x48a5c2=>!_0x48a5c2)]}}),_0x47d5c7['on']('render',()=>{_0x47d5c7['children']['add'](_0x3f29fe,0x1);}),_0x47d5c7['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isSearchViewVisible','ck-hidden',_0x9ebea1=>!_0x9ebea1)]}}),_0x47d5c7;}['_createSkeletonView'](){const _0x95a32d=new pn(this['locale'],mn['aiHistory']);return _0x95a32d['bind']('isVisible')['to'](this,'isLoading'),_0x95a32d;}['_createErrorView'](){const _0x3cdf59=new vt(this['locale']),_0x5798ac=new Nt(this['locale']);_0x5798ac['set']({'withText':!0x1,'icon':_0x49d6d3,'class':'ck-ai-notification_error__dismiss-button'}),_0x5798ac['bind']('isVisible')['to'](this,'hasItems',_0x49df25=>!!_0x49df25),_0x5798ac['on']('execute',()=>{this['errorMessage']='';});const _0x5a1bc0=this['bindTemplate'];return _0x3cdf59['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-notification','ck-ai-notification_error']},'children':[{'tag':'p','children':[{'text':_0x5a1bc0['to']('errorMessage')}]},_0x5798ac]}),_0x3cdf59;}['_createEmptyStateView'](){const _0x4f1cab=new vt(this['locale']);return _0x4f1cab['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-chat-history__empty',this['bindTemplate']['if']('isEmptyViewVisible','ck-hidden',_0x8e1b75=>!_0x8e1b75)]},'children':[{'tag':'p','attributes':{'class':['ck-ai-chat-history__empty-message']},'children':[hs(this['locale'],'AI_CHAT_HISTORY_EMPTY_MESSAGE')]}]}),_0x4f1cab;}['_createListItemViews'](_0x18cae6,_0x57b72e){const _0x4c843b=[];for(const _0xa3ff6 of _0x18cae6){const _0x5212b0=new ho(_0x57b72e,_0xa3ff6);_0x5212b0['delegate'](...lo)['to'](this),_0x4c843b['push'](_0x5212b0);}return _0x4c843b;}['updateHistoryItemsWithCategories'](_0x3580b6){const _0xec3bc=this['locale']||'en',_0x5afb0c=[];for(const _0x1b1b9d of _0x3580b6){const _0x770470=this['_createListItemViews'](_0x1b1b9d['items'],_0xec3bc);_0x5afb0c['push'](new ao(_0xec3bc,{'title':_0x1b1b9d['title'],'items':_0x770470}));}this['sectionsView']['sections']=_0x5afb0c,this['sectionsView']['items']['clear'](),this['sectionsView']['items']['addMany'](_0x5afb0c),this['hasItems']=_0x3580b6['some'](_0x214b36=>_0x214b36['items']['length']>0x0),this['_refreshSearch']();}['removeHistoryItem'](_0x4f0700){for(const _0x469a15 of this['sectionsView']['sections']){const _0x4a5bed=_0x469a15['getItem'](_0x4f0700);if(_0x4a5bed){if(_0x469a15['removeItem'](_0x4a5bed),0x0===_0x469a15['itemsViews']['length']){const _0x44f94a=this['sectionsView']['sections']['indexOf'](_0x469a15);-0x1!==_0x44f94a&&(this['sectionsView']['sections']['splice'](_0x44f94a,0x1),this['sectionsView']['items']['remove'](_0x469a15));}this['hasItems']=this['sectionsView']['sections']['length']>0x0,this['_refreshSearch']();break;}}}['updateItemTitle'](_0xcbc115,_0x47baf6){for(const _0x3e45f5 of this['sectionsView']['sections']){const _0x27979e=_0x3e45f5['getItem'](_0xcbc115);if(_0x27979e){_0x27979e['updateTitle'](_0x47baf6);break;}}}['updateItemLoadingState'](_0x101d0e,_0x294dad,_0x41f3d4){for(const _0x4c91ed of this['sectionsView']['sections']){const _0x552b9c=_0x4c91ed['getItem'](_0x101d0e);if(_0x552b9c){_0x552b9c['updateLoadingState'](_0x294dad,_0x41f3d4);break;}}}['_refreshSearch'](){if(this['hasItems']){const _0x1eb416=this['searchView']['queryView']['fieldView']?.['element']?.['value']||'';this['searchView']['search'](_0x1eb416);}}}const lo=['showConversationHistory','removeConversation','editConversationTitle','setConversationPinned','selectConversation','startConversation'];class uo extends _0x29a024{static get['requires'](){return[os];}['_historyView'];static get['pluginName'](){return'AIChatHistoryUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x5672cd){super(_0x5672cd);const _0x2c4a06=this['context']['plugins']['get']('AITabs');this['_historyView']=new co(this['context']['locale'],_0x2c4a06['showResizeButton']),this['_historyView']['delegate']('resizeTabs')['to'](_0x2c4a06),this['_historyView']['delegate'](...lo)['to'](this),this['_historyView']['headerView']['bind']('isMaximized')['to'](_0x2c4a06['view'],'isMaximized',_0xa9b9e1=>_0xa9b9e1),_0x2c4a06['view']['addTab']({'id':'history','buttonLabel':hs(this['context']['locale'],'AI_CHAT_HISTORY_HEADING'),'buttonIcon':_0x3d6612,'order':0x0,'content':this['_historyView']});}['removeHistoryItem'](_0x379ccd){this['_historyView']['removeHistoryItem'](_0x379ccd);}['updateItems'](_0x252e0e){this['_historyView']['updateHistoryItemsWithCategories'](_0x252e0e);}['updateItemTitle'](_0x4aecb0,_0x5ee7b5){this['_historyView']['updateItemTitle'](_0x4aecb0,_0x5ee7b5);}['updateItemLoadingState'](_0x218660,_0x15fe5c,_0x6ef539){this['_historyView']['updateItemLoadingState'](_0x218660,_0x15fe5c,_0x6ef539);}['setLoadingSkeleton'](_0x494da3){this['_historyView']['isLoading']=_0x494da3;}['showError'](_0x53fa18){this['_historyView']['errorMessage']=_0x53fa18;}['hideError'](){this['_historyView']['errorMessage']='';}}class _o extends ht(){['id'];['createdAt'];constructor({id:_0x552b5e,title:_0x379397,createdAt:_0x5dee7a,updatedAt:_0x4a2a68,pinned:_0x2f6f65}){super(),this['id']=_0x552b5e,this['createdAt']=new Date(_0x5dee7a),this['set']('title',_0x379397),this['set']('updatedAt',_0x4a2a68?new Date(_0x4a2a68):null),this['set']('pinned',_0x2f6f65||!0x1);}['updateTitle'](_0x1bf3c7){this['set']('title',_0x1bf3c7),this['updatedAt']=new Date();}['updatePinned'](_0x17d005){this['set']('pinned',_0x17d005),this['updatedAt']=new Date();}}class go extends Tt(){['items']=[];['connector'];['group'];constructor({connector:_0x56fc4a,group:_0x89a780}){super(),this['connector']=_0x56fc4a,this['group']=_0x89a780;}async['init'](){try{const _0xdea303=this['connector']['fetchConversations'](this['group']),_0x42d6ba=await _0xdea303['getConversations']();this['loadItems'](_0x42d6ba);}catch(_0x160f26){this['fire']('error',{'error':_0x160f26,'operation':'init'});}}['addItem'](_0x47bd03){this['items']['push'](_0x47bd03);}async['removeItem'](_0x3ea080){const _0x297a9d=this['items']['findIndex'](_0x4a3910=>_0x4a3910['id']===_0x3ea080);if(-0x1===_0x297a9d)return!0x1;try{return await this['connector']['deleteConversation'](_0x3ea080)['execute'](),this['items']['splice'](_0x297a9d,0x1),this['fire']('itemRemoved',{'itemId':_0x3ea080}),!0x0;}catch(_0x1b3d72){return this['fire']('error',{'error':_0x1b3d72,'operation':'removeItem','itemId':_0x3ea080}),!0x1;}}['getItem'](_0x301aa){return this['items']['find'](_0x35f247=>_0x35f247['id']===_0x301aa);}async['updateItemTitle'](_0x44256e,_0x8d0e4){const _0x3d9713=this['getItem'](_0x44256e);if(!_0x3d9713)return!0x1;try{return await this['connector']['updateConversation'](_0x44256e,{'title':_0x8d0e4})['getResult'](),_0x3d9713['updateTitle'](_0x8d0e4),this['fire']('itemUpdated',{'itemId':_0x44256e,'updates':{'title':_0x8d0e4}}),!0x0;}catch(_0x181be1){return this['fire']('error',{'error':_0x181be1,'operation':'updateItemTitle','itemId':_0x44256e}),!0x1;}}async['updateItemPinned'](_0xd1f016,_0x2f3c8b){const _0x5203f8=this['getItem'](_0xd1f016);if(!_0x5203f8)return!0x1;try{return await this['connector']['updateConversation'](_0xd1f016,{'pinned':_0x2f3c8b})['getResult'](),_0x5203f8['updatePinned'](_0x2f3c8b),this['fire']('itemUpdated',{'itemId':_0xd1f016,'updates':{'pinned':_0x2f3c8b}}),!0x0;}catch(_0x1152ae){return this['fire']('error',{'error':_0x1152ae,'operation':'updateItemPinned','itemId':_0xd1f016}),!0x1;}}['loadItems'](_0x284edd){try{this['items']=[],_0x284edd['map'](_0x271967=>{this['addItem'](new _o(_0x271967));}),this['fire']('itemsLoaded',{'items':[...this['items']]});}catch(_0x34fa1a){this['fire']('error',{'error':_0x34fa1a,'operation':'loadItems'});}}['getItems'](_0x3f5a2e={}){const _0x4a66bb=void 0x0!==_0x3f5a2e['pinned']&&_0x3f5a2e['pinned'],_0x4d1870=_0x3f5a2e['from']?new Date(_0x3f5a2e['from']['getFullYear'](),_0x3f5a2e['from']['getMonth'](),_0x3f5a2e['from']['getDate']()):null,_0x1667a2=_0x3f5a2e['to']?new Date(_0x3f5a2e['to']['getFullYear'](),_0x3f5a2e['to']['getMonth'](),_0x3f5a2e['to']['getDate']()):null;return this['items']['filter'](_0x483f09=>{if(_0x483f09['pinned']!==_0x4a66bb)return!0x1;if(_0x1667a2){const _0x3122ad=new Date(_0x483f09['createdAt']['getFullYear'](),_0x483f09['createdAt']['getMonth'](),_0x483f09['createdAt']['getDate']());return _0x4d1870?_0x4d1870['getTime']()===_0x1667a2['getTime']()?_0x3122ad['getTime']()===_0x4d1870['getTime']():_0x3122ad<_0x1667a2&&_0x3122ad>=_0x4d1870:_0x3122ad<_0x1667a2;}return!0x0;});}}class Ao extends _0x29a024{['_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 _0x2543f2=this['context']['plugins']['get'](os);try{const _0x3bde97=this['_aiChatController']['getGroupId']();this['history']=new go({'connector':this['_aiConnector'],'group':_0x3bde97}),this['listenTo'](this['_aiChatHistoryUi'],'removeConversation',(_0x34accc,_0x51a693)=>{this['_setItemLoading'](_0x51a693['id'],'remove'),this['_handleRemove'](_0x51a693['id']);}),this['listenTo'](this['_aiChatHistoryUi'],'editConversationTitle',(_0x447164,_0x4912ca)=>{this['_setItemLoading'](_0x4912ca['id'],'rename'),this['_handleEditTitle'](_0x4912ca['id'],_0x4912ca['title']);}),this['listenTo'](this['history'],'itemUpdated',(_0x5bae14,_0x2160c8)=>{void 0x0!==_0x2160c8['updates']['title']&&this['_aiChatHistoryUi']['updateItemTitle'](_0x2160c8['itemId'],_0x2160c8['updates']['title']),void 0x0!==_0x2160c8['updates']['pinned']&&this['_updateHistoryItemsUI'](),this['_clearItemLoading'](_0x2160c8['itemId']);}),this['listenTo'](this['history'],'itemRemoved',(_0x1ccac5,_0x5ae896)=>{this['_aiChatController']['_handleRemovedConversation'](_0x5ae896['itemId']),this['_aiChatHistoryUi']['removeHistoryItem'](_0x5ae896['itemId']),this['_clearItemLoading'](_0x5ae896['itemId']);}),this['listenTo'](this['history'],'itemsLoaded',()=>{this['_updateHistoryItemsUI']();}),this['listenTo'](this['history'],'error',(_0x131bbc,_0x1824f5)=>{this['_handleHistoryErrorUI'](_0x1824f5['error'],_0x1824f5['operation'],_0x1824f5['itemId']);}),this['listenTo'](this['_aiChatHistoryUi'],'selectConversation',(_0x2a28e1,_0x5a62f5)=>{this['_handleSelectConversation'](_0x5a62f5['id']);}),this['listenTo'](this['_aiChatHistoryUi'],'setConversationPinned',(_0x4438d0,_0x2e1c27)=>{const _0x32bad2=_0x2e1c27['pinned']?'pin':'unpin';this['_setItemLoading'](_0x2e1c27['id'],_0x32bad2),this['_handleTogglePin'](_0x2e1c27['id'],_0x2e1c27['pinned']);}),this['listenTo'](this['_aiChatHistoryUi'],'startConversation',()=>{this['_aiChatController']['startConversation'](),_0x2543f2['view']['activateTab']('chat');}),this['listenTo'](this['_aiChatController'],'change:activeConversation',()=>{this['_updateHistoryItemsUI']();}),_0x2543f2['view']['on']('activateTab:history',()=>{this['_showConversationHistory']();});}catch(_0xd52c7e){this['_handleHistoryErrorUI'](_0xd52c7e,'init');}}async['_handleEditTitle'](_0x1b36ff,_0x20b1ce){await this['history']['updateItemTitle'](_0x1b36ff,_0x20b1ce);}async['_handleTogglePin'](_0x263e08,_0x312a82){await this['history']['updateItemPinned'](_0x263e08,_0x312a82);}async['_handleRemove'](_0x9f4b10){await this['history']['removeItem'](_0x9f4b10);}async['_handleSelectConversation'](_0x7e2b9f){await this['_aiChatController']['loadConversation'](_0x7e2b9f);}async['_showConversationHistory'](){this['_aiChatHistoryUi']['showError'](''),this['_aiChatHistoryUi']['setLoadingSkeleton'](!0x0),await this['history']['init'](),this['_aiChatHistoryUi']['setLoadingSkeleton'](!0x1);}['_updateHistoryItemsUI'](){const _0x2e7210=this['_aiChatController']['activeConversation']?.['id'],_0x408f1f=this['_getCategorizedItems']()['map'](_0x520f49=>({'title':_0x520f49['title'],'items':_0x520f49['items']['map'](_0x2c17b1=>({'id':_0x2c17b1['id'],'title':_0x2c17b1['title']||hs(this['context']['locale'],'AI_CHAT_UNTITLED_CONVERSATION'),'createdAt':new Date(_0x2c17b1['createdAt'])['toLocaleDateString'](),'active':_0x2c17b1['id']===_0x2e7210,'pinned':_0x2c17b1['pinned']}))}));this['_aiChatHistoryUi']['updateItems'](_0x408f1f);}['_setItemLoading'](_0x5d17f2,_0x29c122){this['_aiChatHistoryUi']['updateItemLoadingState'](_0x5d17f2,_0x29c122,!0x0);}['_clearItemLoading'](_0x156e17){this['_aiChatHistoryUi']['updateItemLoadingState'](_0x156e17,null,!0x1);}['_handleHistoryErrorUI'](_0x256800,_0x2ee4b3,_0x476341){const _0x250349=this['_generateErrorMessage'](_0x2ee4b3,_0x476341);this['_aiChatHistoryUi']['showError'](_0x250349),_0x476341&&this['_clearItemLoading'](_0x476341),this['_aiChatHistoryUi']['setLoadingSkeleton'](!0x1);}['_generateErrorMessage'](_0x1f0752,_0x1ca9aa){const _0x7ef0ff=_0x1ca9aa?this['history']['getItem'](_0x1ca9aa):null,_0x4a0649=_0x7ef0ff?.['title']||hs(this['context']['locale'],'AI_CHAT_UNTITLED_CONVERSATION');switch(_0x1f0752){case'updateItemTitle':return hs(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_UPDATE_TITLE',_0x4a0649);case'updateItemPinned':{const _0x1f8c7b=hs(this['context']['locale'],_0x7ef0ff?.['pinned']?'AI_CHAT_HISTORY_UNPIN_ACTION':'AI_CHAT_HISTORY_PIN_ACTION');return hs(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_UPDATE_PINNED',[_0x1f8c7b,_0x4a0649]);}case'removeItem':return hs(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_REMOVE_ITEM',_0x4a0649);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 _0x7b4210=new Date(),_0x4ad952=new Date(_0x7b4210['getFullYear'](),_0x7b4210['getMonth'](),_0x7b4210['getDate']()),_0x4513e8=new Date(_0x4ad952);_0x4513e8['setDate'](_0x4513e8['getDate']()-0x1);const _0x29a25d=new Date(_0x4ad952);_0x29a25d['setDate'](_0x29a25d['getDate']()-0xe);const _0x1f93d1=this['history']['getItems']({'pinned':!0x0}),_0xe2618c=this['history']['getItems']({'from':_0x4ad952,'to':_0x4ad952}),_0x1059f7=this['history']['getItems']({'from':_0x4513e8,'to':_0x4513e8}),_0x2cbd55=this['history']['getItems']({'from':_0x29a25d,'to':_0x4513e8}),_0x1b61b4=this['history']['getItems']({'to':_0x29a25d}),_0x40e2f3=[];return _0x1f93d1['length']>0x0&&_0x40e2f3['push']({'title':hs(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_PINNED'),'items':_0x1f93d1}),_0xe2618c['length']>0x0&&_0x40e2f3['push']({'title':hs(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_TODAY'),'items':_0xe2618c}),_0x1059f7['length']>0x0&&_0x40e2f3['push']({'title':hs(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_YESTERDAY'),'items':_0x1059f7}),_0x2cbd55['length']>0x0&&_0x40e2f3['push']({'title':hs(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_LAST_14_DAYS'),'items':_0x2cbd55}),_0x1b61b4['length']>0x0&&_0x40e2f3['push']({'title':hs(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_LATER'),'items':_0x1b61b4}),_0x40e2f3;}}class Io extends _0x29a024{static get['requires'](){return[Ao,uo];}static get['pluginName'](){return'AIChatHistory';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}class Eo extends _0x29a024{static get['requires'](){return[Xs,Js,ro,Io];}static get['pluginName'](){return'AIChat';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x3d6c7f){super(_0x3d6c7f),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(_0x3e2977,_0x4dfa44){super(_0x3e2977);const {id:_0x17cb0b,type:_0x5dfc22,icon:_0x447804}=_0x4dfa44;this['id']=_0x17cb0b,this['set']({'label':_0x4dfa44['label'],'withText':!0x0,'class':'ck-ai-chat-shortcut'}),this['extendTemplate']({'attributes':{'data-cke-ai-shortcut-id':_0x4dfa44['id']}}),_0x447804?this['icon']=_0x447804:'chat'===_0x5dfc22?this['icon']=_0x188f09:'review'===_0x5dfc22?this['icon']=_0xc96c5b:'translate'===_0x5dfc22&&(this['icon']=_0x3c67b8);}}class mo extends vt{['listView'];constructor(_0x31dc86,_0x36da0a){super(_0x31dc86);const _0x4f9a57=_0x36da0a['map'](_0x12e237=>{const _0x160503=new Ht(this['locale']),_0x17ca1c=new po(this['locale'],_0x12e237);return _0x160503['children']['add'](_0x17ca1c),_0x17ca1c['delegate']('execute')['to'](this),_0x160503;});this['listView']=new Dt(this['locale']),this['listView']['items']['addMany'](_0x4f9a57),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat-shortcuts']},'children':[this['listView']]});}}const To='chat-shortcuts';class Co extends _0x29a024{['_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 _0x37519a=this['context']['plugins']['get']('AIChatController');this['_shortcuts']['length']&&(this['_validateShortcuts'](),this['_aiChatUI']['on']('conversationCreated',()=>{_0x37519a['activeConversation']['isFromHistory']||this['_injectShortcuts']();}),this['listenTo'](_0x37519a,'interactionStarted',()=>{this['_removeShortcuts']();}));}['_validateShortcuts'](){const _0x34c739=['chat','review','translate'];this['_shortcuts']['forEach'](_0x557d61=>{let _0x2f842a=!0x0;if(_0x557d61['id']&&_0x557d61['label']&&_0x34c739['includes'](_0x557d61['type'])?'chat'===_0x557d61['type']&&(_0x2f842a='string'==typeof _0x557d61['prompt']):_0x2f842a=!0x1,!_0x2f842a)throw new at('ai-chat-shortcuts-invalid-config',this['context'],{'shortcut':_0x557d61});});}['_injectShortcuts'](){const _0x295327=this['context']['plugins']['get'](ro);this['_shortcutsView']=new mo(this['context']['locale'],this['_shortcuts']),this['_shortcutsView']['render'](),_0x295327['addFeedItemCustomElement'](this['_shortcutsView']['element'],To),this['_shortcutsView']['on']('execute',_0x47bb9c=>{const _0x32dc4a=_0x47bb9c['source']['id'];this['_executeShortcut'](_0x32dc4a);});}['_removeShortcuts'](){const _0x1b724e=this['context']['plugins']['get'](ro);_0x1b724e['hasFeedItem'](To)&&_0x1b724e['removeFeedItem'](To),this['_shortcutsView']?.['destroy']();}['_executeShortcut'](_0x222a85){const _0x2be922=this['_shortcuts']['find'](_0x3b9e43=>_0x3b9e43['id']===_0x222a85),_0x3404b3=_0x2be922['type'];'chat'===_0x3404b3?this['_runChatShortcut'](_0x2be922):'review'===_0x3404b3?_0x2be922['commandId']?this['_runReviewShortcut'](_0x2be922):this['_switchTab']('reviewMode'):'translate'===_0x3404b3&&(_0x2be922['language']?this['_runTranslateShortcut'](_0x2be922):this['_switchTab']('translate'));}['_switchTab'](_0x21fd70){if(!this['context']['plugins']['has']('AITabs'))throw new at('ai-chat-shortcuts-ai-tabs-not-found',this['context'],{'tabName':_0x21fd70});this['context']['plugins']['get']('AITabs')['view']['activateTab'](_0x21fd70);}async['_runChatShortcut']({prompt:_0x146ea0,draftMode:_0x189b1c,useWebSearch:_0x4763e8=!0x1,useReasoning:_0x302e90=!0x1,model:_0x2ac631}){const _0x45ff37=this['context']['plugins']['get']('AIChatController'),_0x3108d1=_0x45ff37['activeConversation'];let _0x92671f;_0x92671f=_0x2ac631?await _0x3108d1['chatModels']['getModel'](_0x2ac631):await _0x3108d1['chatModels']['getDefault'](),_0x92671f&&await _0x3108d1['setModel'](_0x92671f),_0x3108d1['setWebSearch'](_0x4763e8),_0x3108d1['setReasoning'](_0x302e90),_0x45ff37['addCurrentDocumentToChatContext'](),_0x189b1c?(this['_aiChatUI']['setPromptInputValue'](_0x146ea0),this['_aiChatUI']['focusPromptInput'](!0x0)):_0x45ff37['sendMessage']({'message':_0x146ea0});}['_runReviewShortcut']({commandId:_0xc18ec1,model:_0x18b474,prompt:_0x171f3f,params:_0x1d9f91}){if(!this['context']['plugins']['has']('AIReviewModeUI'))throw new at('ai-chat-shortcuts-review-mode-not-found',this['context']);this['_switchTab']('reviewMode');const _0x1c22b6={'id':_0xc18ec1,'isCustom':'custom'===_0xc18ec1};_0x18b474&&_0x171f3f&&(_0x1c22b6['args']={'model':_0x18b474,'prompt':_0x171f3f}),_0x1d9f91&&(_0x1c22b6['params']=_0x1d9f91),this['context']['plugins']['get']('AIReviewModeUI')['fire']('runReviewCheck',_0x1c22b6);}['_runTranslateShortcut']({language:_0x4469f1}){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':_0x4469f1,'args':{'language':_0x4469f1}});}}class wo extends _0x5c051f{constructor(_0x48520b){super(_0x48520b);const _0x3c1576=_0x48520b['plugins']['get']('AITabs')['view'];this['bind']('value')['to'](_0x3c1576,'isVisible'),this['isEnabled']=!0x0;}['execute'](){const _0x435f1e=this['editor']['plugins']['get']('AITabs')['view'];_0x435f1e['isVisible']=!_0x435f1e['isVisible'];}}class fo extends _0x4f5a67{static get['requires'](){return[os];}static get['pluginName'](){return'AIToggleButtonUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const _0x7b92bf=this['editor'];_0x7b92bf['commands']['add']('toggleAi',new wo(_0x7b92bf)),_0x7b92bf['ui']['componentFactory']['add']('toggleAi',()=>{const _0x34eb11=this['_createAIUIButton'](Nt);return _0x34eb11['set']({'tooltip':!0x0,'class':'ck-ai-toggle-button'}),_0x34eb11;}),_0x7b92bf['ui']['componentFactory']['add']('menuBar:toggleAi',()=>{const _0x5190c4=this['_createAIUIButton'](Wt);return _0x5190c4['set']({'role':'menuitemcheckbox'}),_0x5190c4;});}['_createAIUIButton'](_0x388af5){const _0x58eacd=this['editor'],_0x422bae=_0x58eacd['commands']['get']('toggleAi'),_0x5a9ccd=new _0x388af5(_0x58eacd['locale']);return _0x5a9ccd['set']({'label':hs(_0x58eacd['locale'],'AI_TOGGLE_BUTTON_LABEL'),'icon':_0x4b6e58,'isToggleable':!0x0}),_0x5a9ccd['bind']('isEnabled')['to'](_0x422bae),_0x5a9ccd['bind']('isOn')['to'](_0x422bae,'value',_0x3ce817=>!!_0x3ce817),this['listenTo'](_0x5a9ccd,'execute',()=>{_0x422bae['execute']();}),_0x5a9ccd;}}const bo=['applySuggestion','insertSuggestion','showNext','showPrevious'];class So extends vt{['_errorView'];constructor(_0x185c94){super(_0x185c94),this['set']('_errorMessage',''),this['set']('_isErrorVisible',!0x1);}['showBlockingError'](_0x120d5b){this['showError'](_0x120d5b);}['showError'](_0x466803){this['_errorView']||(this['_errorView']=this['_createErrorView']()),this['_errorMessage']=_0x466803,this['_isErrorVisible']=!0x0;}['hideError'](){this['_isErrorVisible']=!0x1;}['_createErrorView'](){const _0x3cafce=new vt(this['locale']),_0x2a98fe=new vt(this['locale']);return _0x2a98fe['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai-suggestion__error-text']},'children':[{'text':this['bindTemplate']['to']('_errorMessage')}]}),_0x3cafce['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__error','ck-ai-balloon-error',this['bindTemplate']['if']('_isErrorVisible','ck-hidden',_0x584799=>!_0x584799)]},'children':[_0x2a98fe]}),_0x3cafce;}}const Ro=0xa;class Oo extends _0x29a024{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'](_0x47a506){const {id:_0x286dbd}=this['_currentConfig']??{};this['_currentConfig']=_0x47a506;const {id:_0x2735fd}=this['_currentConfig'];this['isOpen']&&_0x286dbd===_0x2735fd?this['_updateDialog']():this['_showDialog']();}['close'](){const _0x2ebe83=this['_getTargetEditor']()['plugins']['get']('Dialog');_0x2ebe83['isOpen']&&this['_currentConfig']&&_0x2ebe83['id']===this['_currentConfig']['id']&&_0x2ebe83['hide']();}['_updateDialog'](){const _0x133fe1=this['_getTargetEditor']()['plugins']['get']('Dialog'),{icon:_0x48626e,title:_0x5bf8dc}=this['_currentConfig'];_0x133fe1['view']?.['headerView']&&(_0x133fe1['view']['headerView']['label']=_0x5bf8dc,_0x133fe1['view']['headerView']['iconView']&&_0x48626e&&(_0x133fe1['view']['headerView']['iconView']['content']=_0x48626e)),this['_isUpdatingMarkers']=!0x0,this['_showFakeVisualSelection'](),this['_isUpdatingMarkers']=!0x1,_0x133fe1['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 _0x27bfef=this['_getTargetEditor']()['plugins']['get']('Dialog'),{id:_0x4b4178,title:_0xcc39c3,icon:_0x8fe232,class:_0x14ce89,mainView:_0x30c78b}=this['_currentConfig'];_0x30c78b['delegate'](...bo)['to'](this),_0x27bfef['show']({'title':_0xcc39c3,'icon':_0x8fe232,'hasCloseButton':!0x0,'id':_0x4b4178,'position':this['_calculateDialogPosition']['bind'](this),'className':'ck-ai-balloon\x20'+(_0x14ce89||''),'content':_0x30c78b,'onShow':_0x4f5d8a=>{this['_showFakeVisualSelection'](),this['_setupFakeVisualSelectionMarkerRemovalListener'](),_0x4f5d8a['view']?.['updatePosition']();const _0x59fcd2=this['_getSelectionElements']();_0x59fcd2&&_0x59fcd2[0x0]&&Ct({'target':_0x59fcd2[0x0],'ancestorOffset':0x14,'alignToTop':!0x0,'viewportOffset':{'top':0x14,'bottom':0x14,'left':0x0,'right':0x0}}),this['isOpen']=!0x0,_0x4f5d8a['once']('hide',()=>{this['fire']('beforeDialogClosed',{'id':_0x4b4178});},{'priority':'high'});},'onHide':()=>{this['_hideFakeVisualSelection'](),this['_cleanupFakeVisualSelectionMarkerRemovalListener'](),this['fire']('dialogClosed',{'id':_0x4b4178}),this['isOpen']=!0x1;}});}['_calculateDialogPosition'](_0x5ecc41,_0x24ba42){if(!_0x24ba42){const _0x18ebca=this['_getTargetRootDomRect']();if(!_0x18ebca)return null;_0x24ba42=_0x18ebca;}const _0x5468e2=this['_getSelectionElements']();if(!_0x5468e2||0x0===_0x5468e2['length'])return{'left':Math['round'](_0x24ba42['left']+_0x24ba42['width']/0x2-_0x5ecc41['width']/0x2),'top':Math['round'](_0x24ba42['top']+_0x24ba42['height']/0x2-_0x5ecc41['height']/0x2)};const _0x2e730e=Math['round'](_0x24ba42['left']+_0x24ba42['width']/0x2-_0x5ecc41['width']/0x2),_0x530da7=_0x5468e2['map'](_0x3276f6=>new ut(_0x3276f6)),_0x588601=_0x5ecc41['height'];return{'left':_0x2e730e,'top':this['_calculateOptimalTopPosition'](_0x530da7,_0x588601,_0x24ba42)};}['_calculateOptimalTopPosition'](_0xf1851a,_0x49b885,_0x537db9){const _0x275eb9=new ut(ct['window']),_0x218433=_0xf1851a['map'](_0x3906bc=>_0x3906bc['getVisible']())['filter'](_0x5cc7a0=>_0x5cc7a0),_0x348754=ut['getBoundingRect'](_0x218433);if(!_0x348754)return Math['round'](_0x537db9['top']+_0x537db9['height']/0x2);const _0x1374ce=_0x275eb9['getIntersection'](_0x348754);if(!_0x1374ce)return Math['round'](_0x537db9['top']+_0x537db9['height']/0x2);const _0x5ccd3c=_0x537db9['getVisible'](),_0x248a86=_0x5ccd3c&&_0x348754['height']>_0x5ccd3c['height'],_0x655ca6=_0x1374ce['top'],_0xa480b6=_0x1374ce['bottom'];if(_0x248a86){const _0x5e3274=(_0x5ccd3c||_0x275eb9)['height']/0x2-_0x49b885/0x2,_0x235e15=_0x655ca6-Ro-_0x537db9['top'],_0x5a434a=_0x537db9['bottom']-_0xa480b6-Ro;return _0x235e15>=_0x49b885?Math['max'](Ro,_0x655ca6-_0x49b885-Ro):_0x5a434a>=_0x49b885?_0xa480b6+Ro:Math['max'](Ro,_0x5e3274);}const _0x46bfee=_0x655ca6-_0x49b885,_0x5db9db=_0x537db9['bottom']-_0xa480b6-Ro,_0x33e4cd=_0x655ca6-Ro-_0x537db9['top'];let _0x5bcdaa;if(_0x5db9db>=_0x49b885)_0x5bcdaa=_0xa480b6+Ro;else{if(_0x33e4cd>=_0x49b885)_0x5bcdaa=_0x46bfee-Ro;else _0x5bcdaa=_0x655ca6+_0x348754['height']/0x2-_0x49b885/0x2;}return _0x5bcdaa;}['_setupFakeVisualSelectionMarkerRemovalListener'](){const _0x47c177=this['_getTargetEditor']();this['listenTo'](_0x47c177['model']['document'],'change',()=>{if(!this['_isUpdatingMarkers']){for(const {name:_0x19b127,data:{newRange:_0x32deb1}}of _0x47c177['model']['document']['differ']['getChangedMarkers']())if(_0x19b127['startsWith'](zs+':')&&(_0x32deb1&&(_0x32deb1['start']['isEqual'](_0x32deb1['end'])||'$graveyard'==_0x32deb1['root']['rootName'])||null==_0x32deb1)){const _0x13dc25=hs(this['context']['locale'],'AI_BALLOON_SELECTION_REMOVED_ERROR');this['_currentConfig']['mainView']['showBlockingError'](_0x13dc25),this['fire']('selectionRemoved');}}});}['_cleanupFakeVisualSelectionMarkerRemovalListener'](){const _0x52ea7d=this['_getTargetEditor']();this['_currentConfig']['mainView']['hideError'](),this['stopListening'](_0x52ea7d['model']['document']);}['_getSelectionElements'](){const _0x2bcdc1=this['_getTargetEditor']();return _0x227c33(_0x2bcdc1['editing'],[..._0x2bcdc1['model']['markers']['getMarkersGroup']('ai-selection'),..._0x2bcdc1['model']['markers']['getMarkersGroup']('ai-balloon-selection')]);}['_getTargetRootDomRect'](){const _0x11c5c0=this['_currentConfig']?.['ranges']?.[0x0]?.['root'];if(!_0x11c5c0)return null;const _0x28083e=this['_getTargetEditor'](),_0x14ddc1=_0x28083e['editing']['view']['document']['getRoot'](_0x11c5c0['rootName']);if(!_0x14ddc1)return null;const _0x25f836=_0x28083e['editing']['view']['domConverter']['mapViewToDom'](_0x14ddc1);return _0x25f836&&_0x25f836 instanceof HTMLElement?new ut(_0x25f836):null;}}class ko extends kt{['copyButton'];['likeButton'];['dislikeButton'];['showChangesButton'];['_config'];constructor(_0x495f0d,_0x3ce7cd={}){super(_0x495f0d),this['set']('isEnabled',!0x0),this['set']('isShowChangesOn',!0x1),this['_config']={'showCopy':!0x1,'showLike':!0x1,'showDislike':!0x1,..._0x3ce7cd};const _0x3bdd97=!(this['_config']['showCopy']||this['_config']['showChanges']||this['_config']['showLike']||this['_config']['showDislike']||this['_config']['customView']?.['length']);this['class']=_0x3bdd97?'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'](_0x17f34a){this['showChangesButton']['isEnabled']=_0x17f34a;}['_setupRatingButtons'](){this['likeButton']=new Nt(this['locale']),this['likeButton']['set']({'icon':_0x5ad9ad,'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':_0x1db60a,'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':_0x2da51f,'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 _0x54143b=new xt();_0x54143b['set']({'content':_0x2d2483}),_0x54143b['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'](_0x54143b);}['_setupShowChangesButton'](){this['showChangesButton']=new Nt(this['locale']),this['showChangesButton']['set']({'icon':_0x5a5d46,'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',_0x201019=>_0x201019?_0x3ca403:_0x5a5d46),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(_0xbeaf90,_0x5cf7a1){super(_0xbeaf90);const _0x6c2a8=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']=_0x5cf7a1,this['nextButtonView']=this['_createNextButtonView'](),this['previousButtonView']=this['_createPreviousButtonView'](),this['_streamableContentView']=new In(_0xbeaf90),this['_partToolbarView']=new _n(_0xbeaf90,_0x5cf7a1['availableActions']),this['_partToolbarView']['delegate']('applySuggestion','insertSuggestion','rejectSuggestion')['to'](this),this['_togglePartToolbarButtonsVisibility'](_0x5cf7a1),this['_stateView']=new un(_0xbeaf90),this['_stateView']['isVisible']=!0x1,this['_miniToolbarView']=new ko(_0xbeaf90,{'showChanges':'full'}),this['_miniToolbarView']['bind']('isShowChangesOn')['to'](this,'showDiff'),this['_miniToolbarView']['on']('toggleShowChanges',()=>{this['fire']('toggleSuggestionDisplayMode');}),this['_toolbarContainerView']=new vo(_0xbeaf90,[this['_partToolbarView'],this['_stateView'],this['_miniToolbarView']]),this['children']=this['createCollection']([this['_streamableContentView'],this['_toolbarContainerView']]),this['on']('change:_state',(_0x219439,_0x270fb3,_0x4616b6,_0x4fc0be)=>{let _0xa0b881,_0x53b1ff;'pending'===_0x4fc0be?(_0xa0b881=this['_partToolbarView'],_0x53b1ff=this['_stateView']):(_0xa0b881=this['_stateView'],_0x53b1ff=this['_partToolbarView']),this['_stateView']['setState'](_0x4616b6),_0xa0b881['isVisible']=!0x1,_0x53b1ff['isVisible']=!0x0;}),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat-balloon-main',_0x6c2a8['to']('_state',_0x81e92=>'ck-ai-chat-balloon-main_state_'+_0x81e92)]},'children':this['children']}),this['on']('change:isTrackChangesOn',()=>{this['_togglePartToolbarButtonsVisibility'](_0x5cf7a1);});}['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'](_0x2a20cc){_0x2a20cc?.['keepErrors']||this['hideError'](),await this['_streamableContentView']['update'](_0x2a20cc);}['setState'](_0x15c56f){this['_state']=_0x15c56f;}['showError'](_0x28f220){super['showError'](_0x28f220),this['children']['has'](this['_errorView'])||this['children']['add'](this['_errorView'],0x0);}['hideError'](){this['_isErrorVisible']&&(super['hideError'](),this['togglePartToolbarEnabled'](!0x0));}['showBlockingError'](_0x563567){super['showBlockingError'](_0x563567),this['togglePartToolbarEnabled'](!0x1);}['toggleRotatorButtonsVisibility'](_0x13546){this['nextButtonView']['isVisible']=this['previousButtonView']['isVisible']=_0x13546;}['togglePartToolbarEnabled'](_0x1c8f23){this['_partToolbarView']['isEnabled']=_0x1c8f23;}['_togglePartToolbarButtonsVisibility']({showApplyButton:_0x4e4d46,showSuggestButton:_0x37a1c7}){_0x4e4d46=_0x4e4d46&&!this['isTrackChangesOn']&&this['_config']['availableActions']['includes']('applySuggestion'),_0x37a1c7=_0x37a1c7&&this['_config']['availableActions']['includes']('insertSuggestion'),this['_partToolbarView']['setButtonsVisibility']({'showApplyButton':_0x4e4d46,'showSuggestButton':_0x37a1c7});}['_createNextButtonView'](){const _0x53404b=new Nt(this['locale']);return _0x53404b['set']({'icon':_0x128b12,'label':hs(this['locale'],'AI_BALLOON_NEXT_LABEL'),'isVisible':!0x0}),_0x53404b['on']('execute',()=>{this['fire']('showNext');}),_0x53404b;}['_createPreviousButtonView'](){const _0x7d99b5=new Nt(this['locale']);return _0x7d99b5['set']({'icon':_0x4ffe99,'label':hs(this['locale'],'AI_BALLOON_PREVIOUS_LABEL'),'isVisible':!0x0}),_0x7d99b5['on']('execute',()=>{this['fire']('showPrevious');}),_0x7d99b5;}}class vo extends vt{constructor(_0x435c97,_0x458863){super(_0x435c97),this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-chat-balloon__toolbar-container']},'children':_0x458863});}}class yo extends _0x4f5a67{static get['requires'](){return[Bt,Oo];}static get['pluginName'](){return'AIChatBalloon';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['_chatBalloonView'];constructor(_0x3bc5d6){super(_0x3bc5d6),this['set']('showDiff',!0x1);}['open'](_0x39f4ed){const _0x5b413e=this['editor'];this['_chatBalloonView']||(this['_chatBalloonView']=this['_createChatBalloonView']()),_0x5b413e['plugins']['get']('AIBalloon')['open']({..._0x39f4ed,'id':'aiChatBalloon','class':'ck-ai-chat-balloon','mainView':this['_chatBalloonView']}),this['_toggleRotatorButtonsInDialogHeader'](_0x39f4ed['showRotator']),this['_chatBalloonView']['togglePartToolbarEnabled'](!_0x39f4ed['areActionsDisabled']),this['_restoreDefaultViewFocus']();}['close'](){this['editor']['plugins']['get']('AIBalloon')['close']();}['updateContent'](_0x4d18dd){return this['_chatBalloonView']||(this['_chatBalloonView']=this['_createChatBalloonView']()),this['_chatBalloonView']['updateContent'](_0x4d18dd);}['setState'](_0x1467d8){this['_chatBalloonView']&&this['_chatBalloonView']['setState'](_0x1467d8);}['_createChatBalloonView'](){const _0x4f4fea=this['editor'],_0xe217ab=_0x4f4fea['plugins']['get']('AIBalloon'),_0x37684c=_0x4f4fea['commands']['get']('trackChanges');let _0x3b6a70=_0x4f4fea['config']['get']('ai.availableReplyActions')||[...fn];_0x4f4fea['plugins']['has']('TrackChanges')||(_0x3b6a70=_0x3b6a70['filter'](_0x386dcb=>'insertSuggestion'!=_0x386dcb));const _0x2d9def=new No(_0x4f4fea['locale'],{'availableActions':_0x3b6a70,'showApplyButton':!0x0,'showSuggestButton':!!_0x37684c});return _0x2d9def['bind']('showDiff')['to'](this),_0x2d9def['delegate'](...Zs)['to'](this),_0x2d9def['delegate']('showPrevious','showNext')['to'](this),_0xe217ab['delegate']('dialogClosed')['to'](this),_0x2d9def['on']('applySuggestion',this['_restoreDefaultViewFocus']['bind'](this)),_0x2d9def['on']('insertSuggestion',this['_restoreDefaultViewFocus']['bind'](this)),_0x2d9def['on']('rejectSuggestion',this['_restoreDefaultViewFocus']['bind'](this)),_0x37684c&&_0x2d9def['bind']('isTrackChangesOn')['to'](_0x37684c,'value'),_0x2d9def['render'](),_0x2d9def;}['_toggleRotatorButtonsInDialogHeader'](_0x3249fd){const _0x2f515e=this['editor'],_0x2add1b=_0x2f515e['plugins']['get']('Dialog')['view']['headerView']['children'];this['_chatBalloonView']['toggleRotatorButtonsVisibility'](_0x3249fd),_0x2add1b['has'](this['_chatBalloonView']['previousButtonView'])||(_0x2add1b['addMany']([this['_chatBalloonView']['previousButtonView'],this['_chatBalloonView']['nextButtonView']],0x0),_0x2f515e['plugins']['get']('AIBalloon')['once']('beforeDialogClosed',()=>{_0x2add1b['remove'](this['_chatBalloonView']['previousButtonView']),_0x2add1b['remove'](this['_chatBalloonView']['nextButtonView']);}));}['_restoreDefaultViewFocus'](){this['_chatBalloonView']['focus']();}}class xo extends _0x4f5a67{static get['requires'](){return[fo,yo,_0x5e5224];}static get['pluginName'](){return'AIEditorIntegration';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}function Lo(_0x2ce2b9){const {editor:_0x25e3b9,action:_0x1081f1,withText:_0x5a5049=!0x1,withIcon:_0x50b99e=!0x0,isInDropdown:_0x24c005=!0x0,shouldPreventFocus:_0x121e64=!0x1}=_0x2ce2b9;return()=>{const _0x65c9e6=_0x25e3b9['locale'],_0x55975a=new Nt(_0x65c9e6),_0x543f34=_0x55975a['bindTemplate'];_0x24c005&&_0x55975a['extendTemplate']({'on':{'mouseenter':_0x543f34['to'](()=>{_0x121e64&&_0x121e64()||_0x55975a['focus']();})}});const _0x564636=_0x1081f1['icon']??_0x1081f1['parent']?.['icon'];return _0x55975a['set']({'label':_0x1081f1['label'],'withText':_0x5a5049,'role':'menuitem','icon':_0x50b99e?_0x564636??_0x63550d:void 0x0,'tooltip':!_0x5a5049,'class':'ck-ai-quick-actions-button','isEnabled':_0x1081f1['isEnabled']}),_0x55975a['on']('execute',()=>{_0x25e3b9['editing']['view']['focus'](),_0x25e3b9['commands']['execute']('aiQuickAction',_0x1081f1);}),_0x55975a;};}class Do extends _0x4bd876{['arrowView'];constructor(_0x4388da,_0x545346){super(_0x4388da,_0x545346);const _0x3636bc=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',_0x3ea56d=>String(_0x3ea56d)),'data-cke-tooltip-disabled':_0x3636bc['to']('isOn')},'on':{'mouseenter':_0x3636bc['to']('mouseenter')}});}['render'](){super['render'](),this['children']['add'](this['arrowView']);}['_createArrowView'](){const _0x4b18e7=new xt();return _0x4b18e7['content']=_0x25f981,_0x4b18e7['extendTemplate']({'attributes':{'class':'ck-dropdown-menu-list__nested-menu__button__arrow'}}),_0x4b18e7;}}class Po extends Dt{['_allListItems'];['_allSearchableItems'];constructor(_0x51b8fa,_0x5594da,_0x180f28){super(_0x51b8fa),this['_allListItems']=_0x5594da,this['_allSearchableItems']=_0x180f28;}['filter'](_0x151482){if(!_0x151482)return this['items']['clear'](),this['items']['addMany'](this['_allListItems']),this['_clearHighlight'](),{'resultsCount':this['_allListItems']['length'],'totalItemsCount':this['_allListItems']['length']};const _0x168da9=_0x151482['source']['toLowerCase']()['trim'](),_0x5866f8=this['_allSearchableItems']['filter'](_0x1a2a12=>(_0x1a2a12['groupLabel']?_0x1a2a12['label']+'\x20('+_0x1a2a12['groupLabel']+')':_0x1a2a12['label'])['toLowerCase']()['includes'](_0x168da9));return this['items']['clear'](),this['items']['addMany'](_0x5866f8['sort']((_0xeef4e4,_0x35fd70)=>{const _0x30292e=_0xeef4e4['groupLabel'],_0x32f643=_0x35fd70['groupLabel'];return _0x30292e||_0x32f643?_0x30292e?0x1:-0x1:0x0;})['map'](_0x5b8bf7=>_0x5b8bf7['item'])),this['_highlightQuery'](_0x168da9,_0x5866f8),{'resultsCount':_0x5866f8['length'],'totalItemsCount':this['_allSearchableItems']['length']};}['_highlightQuery'](_0x42867f,_0x60632b){if(!_0x42867f)return;const _0x2123ec=new RegExp(_0x308cdf(_0x42867f),'gi');_0x60632b['forEach'](_0x3068c4=>{_0x3068c4['highlightViews']&&_0x3068c4['highlightViews']['forEach'](_0x298999=>{'function'==typeof _0x298999['highlightText']&&_0x298999['highlightText'](_0x2123ec);});});}['_clearHighlight'](){this['_allSearchableItems']['forEach'](_0x299a68=>{_0x299a68['highlightViews']&&_0x299a68['highlightViews']['forEach'](_0x1bb4e1=>{'function'==typeof _0x1bb4e1['highlightText']&&_0x1bb4e1['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(_0x43ceac,_0xd35869,_0x595b12,_0x5f1749,_0x1441fc=!0x1){const _0x5b8a0d=_0x43ceac['locale'];super(_0x5b8a0d),this['_bodyCollection']=_0x5f1749,this['_hasSearch']=_0x1441fc;const _0x383de0=this['_createListItems'](_0x43ceac,_0xd35869,_0x595b12);this['optionsListView']=new Po(_0x5b8a0d,_0x383de0,this['_allSearchableItems']),this['optionsListView']['role']=Ho,this['optionsListView']['items']['addMany'](_0x383de0),this['focusTracker']=new _t(),this['keystrokes']=new gt(),_0x1441fc&&(this['_searchTextView']=this['_createSearchTextView']()),this['_focusables']=_0x383de0,this['focusCycler']=new Ut({'focusables':this['_focusables'],'focusTracker':this['focusTracker'],'keystrokeHandler':this['keystrokes']}),_0x1441fc&&this['_searchTextView']&&this['focusCycler']['chain'](this['_searchTextView']['focusCycler']);const _0x972676=_0x1441fc&&this['_searchTextView']?[this['_searchTextView']]:[this['optionsListView']];this['children']=new _0x36a70d(_0x972676),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset_all','ck-ai-quick-actions','ck-rounded-corners'],'dir':_0x5b8a0d['uiLanguageDirection']},'children':this['children']});}['_createSearchTextView'](){return new _0xd43eec(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 _0x204453=this['_searchTextView']['queryView']['fieldView']['element']['ownerDocument']?.['activeElement'];return this['_searchTextView']['queryView']['fieldView']['element']['contains'](_0x204453);}['_createListItems'](_0x189b18,_0x399187,_0x8d8ae2){const _0x4c0665=new _0x36a70d();return _0x399187['forEach'](_0x30e5bf=>{if('actions'in _0x30e5bf){const {listItem:_0x64fb2f}=this['_createActionGroupButton'](_0x189b18,_0x30e5bf,_0x8d8ae2);_0x4c0665['add'](_0x64fb2f),_0x30e5bf['actions']['forEach'](_0x2c401e=>{this['_createActionButton'](_0x189b18,_0x2c401e,_0x30e5bf['label'],_0x30e5bf['icon']);const {listItem:_0x1f494b,highlightViews:_0x35adf5}=this['_createSearchResultActionButton'](_0x189b18,_0x2c401e,_0x30e5bf['label'],_0x30e5bf['icon']);this['_allSearchableItems']['push']({'item':_0x1f494b,'label':_0x2c401e['label'],'groupLabel':_0x30e5bf['label'],'highlightViews':_0x35adf5});});}else{const {listItem:_0x180fc6}=this['_createActionButton'](_0x189b18,_0x30e5bf);_0x4c0665['add'](_0x180fc6);const _0x29e3aa=_0x180fc6['children']['first'];if(_0x29e3aa){const {listItem:_0x142974,highlightViews:_0xb9ea4b}=this['_createSearchResultActionButton'](_0x189b18,_0x30e5bf);this['_allSearchableItems']['push']({'item':_0x142974,'label':_0x29e3aa['label']||'','highlightViews':_0xb9ea4b});}}}),_0x4c0665;}['_createActionButton'](_0x4f19cf,_0x2c5133,_0x1624b9,_0x45682d){const _0x2863ca=new Ht(this['locale']);if(_0x1624b9&&_0x45682d){const _0x1fbf52=new Nt(this['locale']),_0x2332a8=_0x1fbf52['bindTemplate'],_0x2a6f67=new _0x2164c5();_0x2a6f67['text']=_0x2c5133['label'];const _0x4fff2f=new _0x2164c5();_0x4fff2f['text']=_0x1624b9;const _0x2f60a0=new xt();_0x2f60a0['content']=_0x45682d,_0x2f60a0['extendTemplate']({'attributes':{'class':'ck-ai-quick-actions-button__group-icon'}});const _0x4d6d83=new vt(this['locale']);_0x4d6d83['setTemplate']({'tag':'span','attributes':{'class':'ck-ai-quick-actions-button_with-group__open-paren'},'children':[{'text':'\x20('}]});const _0x7cbf61=new vt(this['locale']);return _0x7cbf61['setTemplate']({'tag':'span','attributes':{'class':'ck-ai-quick-actions-button_with-group__close-paren'},'children':[{'text':')'}]}),_0x1fbf52['set']({'label':_0x2c5133['label']+'\x20('+_0x1624b9+')','withText':!0x0,'role':'menuitem','class':'ck-ai-quick-actions-button\x20ck-ai-quick-actions-button_with-group','tooltip':!0x1}),_0x1fbf52['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':[_0x2a6f67,_0x4d6d83,_0x2f60a0,_0x4fff2f,_0x7cbf61],'on':{'mouseenter':_0x2332a8['to'](()=>{this['_isSearchFocused']()||_0x1fbf52['focus']();}),'click':_0x2332a8['to'](()=>{_0x1fbf52['fire']('execute');})}}),_0x1fbf52['on']('execute',()=>{_0x4f19cf['editing']['view']['focus'](),_0x4f19cf['commands']['execute']('aiQuickAction',_0x2c5133);}),_0x2863ca['children']['add'](_0x1fbf52),{'listItem':_0x2863ca,'highlightViews':[_0x2a6f67,_0x4fff2f]};}{const _0x281353=new _0x3b441c(),_0xc01908=new Nt(this['locale'],_0x281353),_0x50f10e=_0xc01908['bindTemplate'],_0x51a8d1=_0x2c5133['icon']??_0x2c5133['parent']?.['icon'],_0x5cc36e=void 0x0!==_0x2c5133['icon'];return _0xc01908['set']({'label':_0x2c5133['label'],'withText':!0x0,'role':'menuitem','icon':_0x5cc36e?_0x51a8d1??_0x63550d:void 0x0,'tooltip':!0x1,'class':'ck-ai-quick-actions-button'}),_0xc01908['extendTemplate']({'on':{'mouseenter':_0x50f10e['to'](()=>{this['_isSearchFocused']()||_0xc01908['focus']();})}}),_0xc01908['on']('execute',()=>{_0x4f19cf['editing']['view']['focus'](),_0x4f19cf['commands']['execute']('aiQuickAction',_0x2c5133);}),_0x2863ca['children']['add'](_0xc01908),{'listItem':_0x2863ca,'highlightViews':[_0x281353]};}}['_createSearchResultActionButton'](_0x6ce405,_0x5ba3eb,_0x30fc98,_0xba2fdd){return _0x30fc98&&_0xba2fdd?this['_createSearchResultGroupedActionButton'](_0x6ce405,_0x5ba3eb,_0x30fc98,_0xba2fdd):this['_createSearchResultIndividualActionButton'](_0x6ce405,_0x5ba3eb);}['_createSearchResultGroupedActionButton'](_0xe6e88e,_0x3476d8,_0x3a4821,_0x38409e){const _0x21f920=new Ht(this['locale']),_0x57e7c9=new Nt(this['locale']),_0x41535c=_0x57e7c9['bindTemplate'],{view:_0x46976b,highlightView:_0x15b69d}=this['_createSearchResultGroupRow'](_0x3a4821,_0x38409e),{view:_0x37b65d,highlightView:_0x177ea2}=this['_createSearchResultActionRow'](_0x3476d8['label']),_0x4efb0d=this['_createSearchResultContentView'](_0x46976b,_0x37b65d);return _0x57e7c9['set']({'label':_0x3476d8['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}),_0x57e7c9['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':[_0x4efb0d],'on':{'mouseenter':_0x41535c['to'](()=>{this['_isSearchFocused']()||_0x57e7c9['focus']();}),'click':_0x41535c['to'](()=>{this['_handleSearchResultButtonClick'](_0x57e7c9);})}}),this['_setupActionButtonExecution'](_0x57e7c9,_0xe6e88e,_0x3476d8),_0x21f920['children']['add'](_0x57e7c9),{'listItem':_0x21f920,'highlightViews':[_0x15b69d,_0x177ea2]};}['_createSearchResultIndividualActionButton'](_0x343618,_0xcd960c){const _0x577161=new Ht(this['locale']),_0xd528b3=new _0x3b441c(),_0x5755b4=new Nt(this['locale'],_0xd528b3),_0x4dece7=_0x5755b4['bindTemplate'];return _0x5755b4['set']({'label':_0xcd960c['label'],'withText':!0x0,'role':'menuitem','icon':void 0x0,'tooltip':!0x1,'class':'ck-ai-quick-actions-button\x20ck-ai-quick-actions-search-result-button'}),_0x5755b4['extendTemplate']({'on':{'mouseenter':_0x4dece7['to'](()=>{this['_isSearchFocused']()||_0x5755b4['focus']();})}}),this['_setupActionButtonExecution'](_0x5755b4,_0x343618,_0xcd960c),_0x577161['children']['add'](_0x5755b4),{'listItem':_0x577161,'highlightViews':[_0xd528b3]};}['_createSearchResultGroupRow'](_0xbec2a,_0x4c11b0){const _0x515c1c=new vt(this['locale']),_0x33b77e=new xt();_0x33b77e['content']=_0x4c11b0,_0x33b77e['extendTemplate']({'attributes':{'class':'ck-ai-quick-actions-button__group-icon'}});const _0x1567a8=new _0x2164c5();return _0x1567a8['text']=_0xbec2a,_0x515c1c['setTemplate']({'tag':'div','attributes':{'class':'ck-ai-quick-actions-search-result__group-row'},'children':[_0x33b77e,_0x1567a8]}),{'view':_0x515c1c,'highlightView':_0x1567a8};}['_createSearchResultActionRow'](_0x3926f9){const _0x516e57=new vt(this['locale']),_0xdb534e=new _0x2164c5();return _0xdb534e['text']=_0x3926f9,_0x516e57['setTemplate']({'tag':'div','attributes':{'class':'ck-ai-quick-actions-search-result__action-row'},'children':[_0xdb534e]}),{'view':_0x516e57,'highlightView':_0xdb534e};}['_createSearchResultContentView'](_0x512c75,_0xc78332){const _0x2e8ba3=new vt(this['locale']);return _0x2e8ba3['setTemplate']({'tag':'div','attributes':{'class':'ck-ai-quick-actions-search-result__content'},'children':[_0x512c75,_0xc78332]}),_0x2e8ba3;}['_setupActionButtonExecution'](_0x55e322,_0x3b5ea5,_0x2d915f){_0x55e322['on']('execute',()=>{_0x3b5ea5['editing']['view']['focus'](),_0x3b5ea5['commands']['execute']('aiQuickAction',_0x2d915f);});}['_createActionGroupButton'](_0x3f9893,_0x537513,_0x36157f){const _0xc27d30=new Ht(this['locale']),_0x3fce9d=new _0x3b441c(),_0x44a9f6=new Do(this['locale'],_0x3fce9d),_0x912c82=_0x44a9f6['bindTemplate'],_0x55a549=this['_getPanelKeystroke'](_0x36157f),_0x3a819a=this['_createGroupActionsList'](_0x3f9893,_0x537513['actions'],_0x36157f);_0x44a9f6['set']({'label':_0x537513['label'],'withText':!0x0,'role':Mo,'icon':_0x537513['icon']??_0x63550d,'isEnabled':_0x537513['actions']['some'](_0x4e13bc=>_0x4e13bc['isEnabled'])}),_0x44a9f6['extendTemplate']({'on':{'mouseenter':_0x912c82['to'](()=>{this['_isSearchFocused']()||_0x44a9f6['focus']();})}});const _0x3bec30=new Xt(this['locale']);return _0x3bec30['extendTemplate']({'attributes':{'class':['ck','ck-reset_all','ck-ai-quick-actions-group-panel','ck-dropdown-menu__nested-menu__panel']},'on':{'keydown':_0x912c82['to'](_0x414227=>{this['_handlePanelKeydown'](_0x414227,_0x55a549,_0x44a9f6,_0x3bec30);})}}),_0x44a9f6['bind']('isOn')['to'](_0x3bec30,'isVisible'),this['_bodyCollection']['add'](_0x3bec30),_0x3bec30['content']['add'](_0x3a819a),this['_setupGroupMenuBehavior'](_0x44a9f6,_0x3bec30),_0xc27d30['children']['add'](_0x44a9f6),{'listItem':_0xc27d30,'highlightView':_0x3fce9d};}['_createGroupActionsList'](_0x40b9f2,_0x1d88f2,_0x4039b1){const _0x48872a=new Dt(this['locale']);return _0x48872a['extendTemplate']({'attributes':{'class':['ck','ck-reset_all','ck-ai-quick-actions-group-list','ck-dropdown-menu-list']}}),_0x1d88f2['forEach'](_0x48441b=>{const _0x3bb6fa=new Ht(this['locale']),_0x309ef4=Lo({'editor':_0x40b9f2,'action':_0x48441b,'withText':!0x0,'withIcon':!0x1,'isInDropdown':!0x0,'shouldPreventFocus':()=>this['_isSearchFocused']()})();_0x3bb6fa['children']['add'](_0x309ef4),_0x4039b1['focusTracker']['add'](_0x309ef4),_0x48872a['items']['add'](_0x3bb6fa);}),_0x48872a;}['_setupGroupMenuBehavior'](_0x5a9dd8,_0x1ae0f7){const _0x55fdc4=_0x5a9dd8['bindTemplate'],_0x45a578=this['_getButtonKeystroke'](_0x5a9dd8);_0x5a9dd8['extendTemplate']({'attributes':{'class':['ck-ai-quick-actions-group-button']},'on':{'mouseenter':_0x55fdc4['to'](()=>{this['_showNestedPanel'](_0x1ae0f7,_0x5a9dd8);}),'mouseleave':_0x55fdc4['to'](_0x37140a=>{const _0xef1526=_0x37140a['relatedTarget'];this['_isMovingToNestedMenu'](_0xef1526,_0x1ae0f7)||this['_hideNestedPanel'](_0x1ae0f7);}),'keydown':_0x55fdc4['to'](_0x4e5da3=>{_0x4e5da3['key']==_0x45a578&&(this['_showNestedPanel'](_0x1ae0f7,_0x5a9dd8),_0x1ae0f7['content']['get'](0x0)['focus']());})}}),_0x1ae0f7['on']('render',()=>{_0x1ae0f7['element']?.['addEventListener']('mouseleave',_0x3845d4=>{const _0x2486d3=_0x3845d4['relatedTarget'];_0x5a9dd8['element']?.['contains'](_0x2486d3)||this['_isMovingToNestedMenu'](_0x2486d3,_0x1ae0f7)||this['_hideNestedPanel'](_0x1ae0f7);});});}['_showNestedPanel'](_0xe8c137,_0x443fb6){this['_openNestedPanels']['forEach'](_0x1e5ca1=>{_0x1e5ca1!==_0xe8c137&&_0x1e5ca1['isVisible']&&_0x1e5ca1['hide']();}),_0xe8c137['show'](),_0xe8c137['pin']({'positions':[_0x5110c8['eastSouth']],'target':_0x443fb6['element'],'fitInViewport':!0x0}),this['_openNestedPanels']['add'](_0xe8c137);}['_hideNestedPanel'](_0x5ce31a){_0x5ce31a['hide'](),this['_openNestedPanels']['delete'](_0x5ce31a);}['_hideAllNestedPanels'](){this['_openNestedPanels']['forEach'](_0x1f1807=>_0x1f1807['hide']()),this['_openNestedPanels']['clear']();}['_isMovingToNestedMenu'](_0x19902b,_0x48034b){if(!_0x19902b)return!0x1;if(_0x48034b['element']?.['contains'](_0x19902b))return!0x0;const _0x189541=_0x19902b;return _0x189541['closest']&&(null!==_0x189541['closest']('.ck-ai-quick-actions-group-panel')||null!==_0x189541['closest']('.ck-ai-quick-actions-group-list')||null!==_0x189541['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'](_0x506540){return'rtl'===_0x506540['locale']['uiLanguageDirection']?'ArrowRight':'ArrowLeft';}['_getButtonKeystroke'](_0x1bde8a){return'rtl'===_0x1bde8a['locale']['uiLanguageDirection']?'ArrowLeft':'ArrowRight';}['_handlePanelKeydown'](_0xe41d36,_0x3a057b,_0x7d00e3,_0xb5c080){_0xe41d36['key']==_0x3a057b&&(_0x7d00e3['focus'](),this['_hideNestedPanel'](_0xb5c080));}['_handleSearchResultButtonClick'](_0x5d5b8f){_0x5d5b8f['fire']('execute');}}function Vo(_0x40f9c0){const {editor:_0x8dae05,content:_0x472d43,buttonDefinition:_0x56c109,bodyCollection:_0x5a8a72,hasSearch:_0x402fbb=!0x1}=_0x40f9c0;return()=>{const _0x3047ea=_0x8dae05['locale'],_0x599141=_0x8dae05['commands']['get']('aiQuickAction'),_0x15ce70=Gt(_0x3047ea);_0x15ce70['bind']('isEnabled')['to'](_0x599141),_0x15ce70['buttonView']['set']({'icon':_0x56c109['icon']??_0x63550d,'label':_0x56c109['label'],'tooltip':!0x0}),_0x15ce70['set']({'class':'ck-ai-quick-actions-dropdown'});const _0x1c8e3c=new Uo(_0x8dae05,_0x472d43,_0x15ce70,_0x5a8a72,_0x402fbb);return _0x15ce70['panelView']['children']['add'](_0x1c8e3c),_0x402fbb&&_0x15ce70['on']('change:isOpen',(_0x3fa715,_0x21b6c,_0x4e58f4)=>{if(_0x4e58f4){if(_0x8dae05['plugins']['has']('AIEditing')){const _0x23efef=_0x8dae05['plugins']['get'](Js),_0x342963=_0x8dae05['model']['document']['selection'],_0x359601=Array['from'](_0x342963['getRanges']());_0x359601['length']>0x0&&_0x23efef['showFakeVisualSelection']({'ranges':_0x359601,'id':'quick-action','priority':0x14});}}else _0x8dae05['plugins']['has']('AIEditing')&&_0x8dae05['plugins']['get'](Js)['hideFakeVisualSelection']('quick-action'),_0x1c8e3c['resetSearch']();}),_0x15ce70;};}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 _0x4f5a67{static get['requires'](){return[_0x56de99,as];}static get['pluginName'](){return'AIQuickActionsUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}async['init'](){const _0x517e27=await this['_getDefaultAndCustomActions']();this['_prepareQuickActionsDefinition'](_0x517e27),this['_initializeQuickActionsComponentsAndCommands']();}static['getDefaultQuickActions'](_0x369607){return function(_0x309009){const _0x4cde4e=new Intl['DisplayNames'](['en'],{'type':'language'})['of'](_0x309009['uiLanguage']),_0x5b6375=_0x4cde4e||'English',_0x4f485d=[{'id':'ask-ai','label':hs(_0x309009,'AI_QUICK_ACTIONS_ASK_AI'),'type':'chat','icon':_0x5896ad},{'id':'chat-commands','label':hs(_0x309009,'AI_QUICK_ACTIONS_CHAT_COMMANDS'),'icon':_0x5896ad,'actions':[{'id':'explain','label':hs(_0x309009,'AI_QUICK_ACTIONS_EXPLAIN'),'displayedPrompt':hs(_0x309009,'AI_QUICK_ACTIONS_EXPLAIN'),'prompt':Bo['replace']('%0',_0x5b6375),'type':'chat'},{'id':'summarize','label':hs(_0x309009,'AI_QUICK_ACTIONS_SUMMARIZE'),'displayedPrompt':hs(_0x309009,'AI_QUICK_ACTIONS_SUMMARIZE'),'prompt':Go['replace']('%0',_0x5b6375),'type':'chat'},{'id':'highlight-key-points','label':hs(_0x309009,'AI_QUICK_ACTIONS_HIGHLIGHT_KEY_POINTS'),'displayedPrompt':hs(_0x309009,'AI_QUICK_ACTIONS_HIGHLIGHT_KEY_POINTS'),'prompt':Fo['replace']('%0',_0x5b6375),'type':'chat'}]},{'id':'improve-writing','label':hs(_0x309009,'AI_QUICK_ACTIONS_IMPROVE_WRITING'),'type':'action','icon':_0xf6244a},{'id':'continue','label':hs(_0x309009,'AI_QUICK_ACTIONS_CONTINUE_WRITING'),'type':'action','icon':_0x26be3d},{'id':'fix-grammar','label':hs(_0x309009,'AI_QUICK_ACTIONS_FIX_GRAMMAR_SPELLING'),'type':'action','icon':_0xff2f8},{'id':'adjust-length','label':hs(_0x309009,'AI_QUICK_ACTIONS_ADJUST_LENGTH'),'icon':_0x9f0aa1,'actions':[{'id':'make-shorter','label':hs(_0x309009,'AI_QUICK_ACTIONS_MAKE_SHORTER'),'type':'action'},{'id':'make-longer','label':hs(_0x309009,'AI_QUICK_ACTIONS_MAKE_LONGER'),'type':'action'}]},{'id':'change-tone','label':hs(_0x309009,'AI_QUICK_ACTIONS_CHANGE_TONE'),'icon':_0x23b9f6,'actions':[{'id':'make-tone-casual','label':hs(_0x309009,'AI_QUICK_ACTIONS_MORE_CASUAL'),'type':'action'},{'id':'make-tone-direct','label':hs(_0x309009,'AI_QUICK_ACTIONS_MORE_DIRECT'),'type':'action'},{'id':'make-tone-friendly','label':hs(_0x309009,'AI_QUICK_ACTIONS_MORE_FRIENDLY'),'type':'action'},{'id':'make-tone-confident','label':hs(_0x309009,'AI_QUICK_ACTIONS_MORE_CONFIDENT'),'type':'action'},{'id':'make-tone-professional','label':hs(_0x309009,'AI_QUICK_ACTIONS_MORE_PROFESSIONAL'),'type':'action'}]},{'id':'translate','label':hs(_0x309009,'AI_QUICK_ACTIONS_TRANSLATE'),'icon':_0x3c67b8,'actions':[{'id':'translate-to-english','label':hs(_0x309009,'AI_QUICK_ACTIONS_TRANSLATE_ENGLISH'),'type':'action','actionName':'translate','args':{'language':'english'}},{'id':'translate-to-chinese','label':hs(_0x309009,'AI_QUICK_ACTIONS_TRANSLATE_CHINESE'),'type':'action','actionName':'translate','args':{'language':'chinese'}},{'id':'translate-to-spanish','label':hs(_0x309009,'AI_QUICK_ACTIONS_TRANSLATE_SPANISH'),'type':'action','actionName':'translate','args':{'language':'spanish'}},{'id':'translate-to-german','label':hs(_0x309009,'AI_QUICK_ACTIONS_TRANSLATE_GERMAN'),'type':'action','actionName':'translate','args':{'language':'german'}},{'id':'translate-to-french','label':hs(_0x309009,'AI_QUICK_ACTIONS_TRANSLATE_FRENCH'),'type':'action','actionName':'translate','args':{'language':'french'}},{'id':'translate-to-japanese','label':hs(_0x309009,'AI_QUICK_ACTIONS_TRANSLATE_JAPANESE'),'type':'action','actionName':'translate','args':{'language':'japanese'}},{'id':'translate-to-portuguese','label':hs(_0x309009,'AI_QUICK_ACTIONS_TRANSLATE_PORTUGUESE'),'type':'action','actionName':'translate','args':{'language':'portuguese'}},{'id':'translate-to-korean','label':hs(_0x309009,'AI_QUICK_ACTIONS_TRANSLATE_KOREAN'),'type':'action','actionName':'translate','args':{'language':'korean'}},{'id':'translate-to-italian','label':hs(_0x309009,'AI_QUICK_ACTIONS_TRANSLATE_ITALIAN'),'type':'action','actionName':'translate','args':{'language':'italian'}},{'id':'translate-to-russian','label':hs(_0x309009,'AI_QUICK_ACTIONS_TRANSLATE_RUSSIAN'),'type':'action','actionName':'translate','args':{'language':'russian'}}]},{'id':'other','label':hs(_0x309009,'AI_QUICK_ACTIONS_OTHER'),'icon':_0x116abd,'actions':[]}];return _0x4f485d;}(_0x369607);}async['_getDefaultAndCustomActions'](){const _0x5de2f1=Wo['getDefaultQuickActions'](this['editor']['locale']),_0x2fddde=this['editor']['config']['get']('ai.quickActions.extraCommands')||[];let _0x46e607,_0x312608=[];try{const _0x545052=new Fs({'connector':this['editor']['plugins']['get']('AIConnector'),'config':this['editor']['config']['get']('ai.models'),'locale':this['editor']['locale']});_0x312608=await _0x545052['getAll'](),_0x46e607=(await _0x545052['getDefault']())?.['id'];}catch(_0x5a9a92){const _0x4433df=new at('ai-quick-actions-models-unable-to-retrieve',this,{'error':_0x5a9a92});Et(_0x4433df['message']);}finally{const _0x3567bc=_0x2fddde['map'](_0x38464d=>({..._0x38464d,'type':'chat'===_0x38464d['type']?'chat':'action','model':'chat'!==_0x38464d['type']?_0x38464d['model']||_0x46e607:_0x38464d['model'],'icon':void 0x0}));_0x5de2f1['find'](_0x2fcd79=>'other'===_0x2fcd79['id'])['actions']['push'](..._0x3567bc),_0x5de2f1['forEach'](_0x2c6954=>{if('actions'in _0x2c6954)_0x2c6954['actions']['forEach'](_0x33ee4c=>{if(_0x33ee4c['isEnabled']=!!_0x312608['find'](_0x4df898=>_0x4df898['id']===_0x33ee4c['model'])||void 0x0===_0x33ee4c['model'],!_0x33ee4c['isEnabled']){const _0x382358=new at('ai-quick-actions-unavailable-model',this,{'actionId':_0x33ee4c['id'],'modelId':_0x33ee4c['model']});Et(_0x382358['message']);}});else{if(_0x2c6954['isEnabled']=!!_0x312608['find'](_0x4a933a=>_0x4a933a['id']===_0x2c6954['model'])||void 0x0===_0x2c6954['model'],!_0x2c6954['isEnabled']){const _0x59163a=new at('ai-quick-actions-unavailable-model',this,{'actionId':_0x2c6954['id'],'modelId':_0x2c6954['model']});Et(_0x59163a['message']);}}});}return _0x5de2f1;}['_initializeQuickActionsComponentsAndCommands'](){const _0x5e344a=new Qt(this['editor']['locale']);_0x5e344a['attachToDom'](),this['_initializeQuickActionsDropdown'](_0x5e344a),this['_initializeQuickActionsMenuBar'](),this['_initializeQuickActionsComponents'](_0x5e344a);}['_initializeQuickActionsDropdown'](_0x27df9b){const _0x5b8053=this['editor']['config']['get']('ai.quickActions.isSearchEnabled')??!0x0;this['editor']['ui']['componentFactory']['add']('aiQuickActions',Vo({'editor':this['editor'],'content':this['_quickActionsDefinition'],'buttonDefinition':{'icon':_0x63550d,'label':hs(this['editor']['locale'],'AI_QUICK_ACTIONS_HEADING')},'bodyCollection':_0x27df9b,'hasSearch':_0x5b8053}));}['_prepareQuickActionsDefinition'](_0x57c505){this['_quickActionsDefinition']=_0x57c505['map'](_0x1c2811=>{if('actions'in _0x1c2811){const _0x47405f=_0x1c2811;return{..._0x47405f,'actions':_0x47405f['actions']['map'](_0x19d5f=>{const {actions:_0x295ba8,..._0x28b215}=_0x47405f;return{..._0x19d5f,'parent':_0x28b215};})['filter'](_0x165e01=>this['_shouldIncludeAction'](_0x165e01))};}return _0x1c2811;})['filter'](_0x319b77=>'actions'in _0x319b77?_0x319b77['actions']['length']>0x0:this['_shouldIncludeAction'](_0x319b77));}['_shouldIncludeAction'](_0x60e578){const _0x14a204=this['editor']['config']['get']('ai.quickActions.removeCommands')||[];return this['editor']['plugins']['has'](Ko[_0x60e578['type']])&&!_0x14a204['includes'](_0x60e578['id'])&&!('chat'===_0x60e578['type']&&!0x1===this['editor']['config']['get']('ai.chat.context.document.enabled'));}['_initializeQuickActionsComponents'](_0x131dd1){this['_quickActionsDefinition']['forEach'](_0x7e1d04=>{if('actions'in _0x7e1d04){const _0x57451c=Vo({'editor':this['editor'],'content':_0x7e1d04['actions'],'buttonDefinition':_0x7e1d04,'bodyCollection':_0x131dd1});this['editor']['ui']['componentFactory']['add'](_0x7e1d04['id'],_0x57451c),_0x7e1d04['actions']['forEach'](_0x5b13c1=>{const _0x3953ee=Lo({'editor':this['editor'],'action':_0x5b13c1});this['editor']['ui']['componentFactory']['add'](_0x5b13c1['id'],_0x3953ee);});}else{const _0x3d3079=Lo({'editor':this['editor'],'action':_0x7e1d04,'withText':!0x1,'withIcon':!0x0,'isInDropdown':!0x1});this['editor']['ui']['componentFactory']['add'](_0x7e1d04['id'],_0x3d3079);}});}['_initializeQuickActionsMenuBar'](){this['editor']['ui']['componentFactory']['add']('menuBar:aiQuickActions',_0x3f3ea1=>{const _0x20468e=this['editor']['commands']['get']('aiQuickAction'),_0x11362e=new Kt(_0x3f3ea1),_0x39e444=hs(_0x3f3ea1,'AI_QUICK_ACTIONS_HEADING');_0x11362e['buttonView']['set']({'label':_0x39e444,'icon':_0x63550d});const _0x4f5019=new $t(_0x3f3ea1);return _0x4f5019['set']({'ariaLabel':_0x39e444,'role':'menu'}),this['_quickActionsDefinition']['forEach'](_0x37a4ad=>{if('actions'in _0x37a4ad){const _0x5e5ff8=_0x37a4ad,_0x20e915=new qt(_0x3f3ea1,_0x11362e),_0x3106f6=new Kt(_0x3f3ea1),_0x5c7a48=new $t(_0x3f3ea1);_0x3106f6['buttonView']['set']({'label':_0x5e5ff8['label'],'icon':_0x5e5ff8['icon']}),_0x5e5ff8['actions']['forEach'](_0x2abde2=>{const _0x572220=new qt(_0x3f3ea1,_0x3106f6),_0x588fa8=new Wt(_0x3f3ea1);_0x588fa8['set']({'label':_0x2abde2['label'],'icon':_0x2abde2['icon'],'role':'menuitem','isEnabled':_0x2abde2['isEnabled']}),_0x588fa8['on']('execute',()=>{this['_executeQuickAction'](_0x2abde2);}),_0x588fa8['delegate']('execute')['to'](_0x3106f6),_0x572220['children']['add'](_0x588fa8),_0x5c7a48['items']['add'](_0x572220);}),_0x3106f6['panelView']['children']['add'](_0x5c7a48),_0x20e915['children']['add'](_0x3106f6),_0x4f5019['items']['add'](_0x20e915);}else{const _0x50e7d4=_0x37a4ad,_0x2d6d90=new qt(_0x3f3ea1,_0x11362e),_0x42d9e1=new Wt(_0x3f3ea1);_0x42d9e1['set']({'label':_0x50e7d4['label'],'icon':_0x50e7d4['icon'],'role':'menuitem','isEnabled':_0x50e7d4['isEnabled']}),_0x42d9e1['on']('execute',()=>{this['_executeQuickAction'](_0x50e7d4);}),_0x42d9e1['delegate']('execute')['to'](_0x11362e),_0x2d6d90['children']['add'](_0x42d9e1),_0x4f5019['items']['add'](_0x2d6d90);}}),(Object['values'](Ko)['some'](_0x146cd0=>this['editor']['plugins']['has'](_0x146cd0))?_0x11362e['bind']('isEnabled')['to'](_0x20468e):_0x11362e['set']({'isEnabled':!0x1}),_0x11362e['panelView']['children']['add'](_0x4f5019),_0x11362e);});}['_executeQuickAction'](_0x2d2031){const _0x28cadb=this['editor'];_0x28cadb['editing']['view']['focus'](),_0x28cadb['commands']['execute']('aiQuickAction',_0x2d2031);const _0x97fffe=_0x28cadb['ui']['view']['menuBarView'];_0x97fffe&&_0x97fffe['close']&&_0x97fffe['close']();}}class Yo extends _0x5c051f{['execute'](_0x543f6c){switch(this['_expandSelectionIfCollapsed'](),_0x543f6c['type']){case'chat':if(!this['editor']['plugins']['has']('AIChat')){const _0x4cdb0d=hs(this['editor']['locale'],'AI_QUICK_ACTIONS_PLUGIN_NOT_FOUND','AIChat');throw new at('ai-quick-actions-plugin-not-found',this['editor'],{'errorMessage':_0x4cdb0d});}this['_handleAIChatAction'](_0x543f6c);break;case'action':if(!this['editor']['plugins']['has']('AIActions')){const _0x36cb0c=hs(this['editor']['locale'],'AI_QUICK_ACTIONS_PLUGIN_NOT_FOUND','AIActions');throw new at('ai-quick-actions-plugin-not-found',this['editor'],{'errorMessage':_0x36cb0c});}this['_handleAIActionsAction'](_0x543f6c);}}async['_handleAIChatAction'](_0x3f2d9e){const _0x1d44ee=this['editor']['plugins']['get']('AIChatController'),_0x2be60e=this['editor']['plugins']['get']('AITabs')['view'];if(_0x2be60e['isVisible']||(_0x2be60e['isVisible']=!0x0),'chat'!==_0x2be60e['activeTab']&&_0x2be60e['activateTab']('chat'),'ask-ai'===_0x3f2d9e['id'])_0x1d44ee['removeSelectionFromChatContext'](),_0x1d44ee['addSelectionToChatContext'](),_0x1d44ee['focusPromptInput']();else await _0x1d44ee['startConversation']({'modelId':_0x3f2d9e['model']}),_0x1d44ee['removeSelectionFromChatContext'](),_0x1d44ee['addSelectionToChatContext'](),_0x1d44ee['focusPromptInput'](),await _0x1d44ee['sendMessage']({'message':_0x3f2d9e['prompt']||_0x3f2d9e['displayedPrompt']||_0x3f2d9e['label'],'attributes':{'quickActionData':{'id':_0x3f2d9e['id']},'displayedPrompt':_0x3f2d9e['displayedPrompt']}});}['_expandSelectionIfCollapsed'](){const _0x5c7932=this['editor'],_0x908266=_0x5c7932['model']['document']['selection'];if(!_0x908266['isCollapsed'])return;const _0xa46139=At(_0x908266['getSelectedBlocks']())||_0x5c7932['model']['schema']['getLimitElement'](_0x908266);_0x5c7932['model']['change'](_0x42d3cf=>{_0x42d3cf['setSelection'](_0xa46139,'in');});}['_handleAIActionsActionLabel'](_0x68512b){return _0x68512b['parent']?.['label']&&'other'!==_0x68512b['parent']?.['id']?_0x68512b['parent']['label']+':\x20'+_0x68512b['label']:_0x68512b['label'];}async['_handleAIActionsAction'](_0x30375c){const _0x5c7d56=this['editor']['plugins']['get']('AIActions'),_0x7532c9=_0x30375c['prompt']?{'userMessage':_0x30375c['prompt'],'model':_0x30375c['model']}:{'actionName':_0x30375c['actionName']||_0x30375c['id'],'args':_0x30375c['args']},_0x20d13e=this['_handleAIActionsActionLabel'](_0x30375c);await _0x5c7d56['executeAction'](_0x7532c9,_0x20d13e,_0x30375c['icon']);}}class $o extends _0x4f5a67{static get['pluginName'](){return'AIQuickActionsEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const _0xaa222f=this['editor'],_0x2d8fec=new Yo(this['editor']);if(_0xaa222f['commands']['add']('aiQuickAction',_0x2d8fec),_0xaa222f['plugins']['has']('AIChat')){const _0x35a07b=this['editor']['plugins']['get']('AIChatController');_0xaa222f['model']['document']['selection']['on']('change:range',(_0x3e2a8d,_0x3934e5)=>{_0x3934e5['directChange']&&_0x35a07b['removeSelectionFromChatContext']();});}}}class qo extends xs{['updateChangeGroups'](){if(this['parsedMergedContent']=this['parsedContent']['cloneNode'](!0x0),0x0==this['parsedMergedContent']['childNodes']['length'])return void(this['changeGroups']=[]);const _0x1f3d5a=this['documentContextContent']['children']['map'](_0x2e6274=>({'node':_0x2e6274,'id':Es(_0x2e6274,'data-id')})),_0x139a14=this['parsedMergedContent']['children']['map'](_0x19b951=>({'node':_0x19b951,'id':Es(_0x19b951,'data-id')||ot()})),_0x20da5a=_0x1083b6(_0x1f3d5a,_0x139a14,{'comparator':(_0x143891,_0x6e581a)=>_0x143891['id']==_0x6e581a['id'],'oneChangePerToken':!0x0});if(!this['isDone']||!this['isComplete']){for(;_0x20da5a['length']&&_0x20da5a[_0x20da5a['length']-0x1]['removed'];)_0x20da5a['pop']();}const _0x43ad64=_0x20da5a['map'](_0x45e058=>{const _0x3f6d8d=_0x45e058['added']?'new':_0x45e058['removed']?'removed':'modified';return{'node':_0x45e058['value'][0x0]['node'],'type':_0x3f6d8d,'id':_0x45e058['value'][0x0]['id']};});this['changeGroups']=[{'changes':_0x43ad64,'state':'pending','index':0x0}];}['_getDifferentChangeGroups'](_0x165a26,_0x15bc36){return _0x15bc36;}}class Qo extends Ds{['content'];['version'];['actionName'];['args'];['userMessage'];['model'];['hasError']=!0x1;['stoppedExplicitly']=!0x1;constructor(_0x3e2908){super(_0x3e2908),this['content']=_0x3e2908['content'],this['version']=_0x3e2908['version'],this['actionName']=_0x3e2908['actionName'],this['args']=_0x3e2908['args'],this['userMessage']=_0x3e2908['userMessage'],this['model']=_0x3e2908['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'](_0x4fb63f){const _0x2f7fe7=new qo({'locale':this['locale'],'documentContextContent':this['content'],..._0x4fb63f});return this['replies']['push'](_0x2f7fe7),_0x2f7fe7['delegate'](...Ls)['to'](this),this['fire']('replyCreated',_0x2f7fe7),_0x2f7fe7;}}class Xo extends kt{constructor(_0x3fc8a8,_0x24250f=!0x0,_0x1c9732=!0x0){super(_0x3fc8a8),this['set']('isEnabled',!0x1),_0x24250f&&(this['applyButton']=this['_createButton'](hs(_0x3fc8a8,'AI_BALLOON_APPLY_BUTTON'),cs),this['applyButton']['bind']('isEnabled')['to'](this),this['items']['add'](this['applyButton'])),_0x1c9732&&(this['suggestButton']=this['_createButton'](hs(_0x3fc8a8,'AI_BALLOON_SUGGEST_BUTTON'),_0x24250f?ls:cs),this['suggestButton']['bind']('isEnabled')['to'](this),this['items']['add'](this['suggestButton'])),this['setButtonsVisibility']({'showApplyButton':_0x24250f,'showSuggestButton':_0x1c9732}),this['extendTemplate']({'attributes':{'class':['ck-ai-balloon__toolbar']}});}['setButtonsVisibility']({showApplyButton:_0x3f5cd2,showSuggestButton:_0x2bae91}){this['applyButton']&&(this['applyButton']['isVisible']=_0x3f5cd2),this['suggestButton']&&(this['suggestButton']['isVisible']=_0x2bae91);}['_createButton'](_0x5cf3be,_0x5d8f7a){const _0x2db4c0=new Nt(this['locale']);return _0x2db4c0['set']({'label':_0x5cf3be,'class':_0x5d8f7a,'isVisible':!0x0,'withText':!0x0}),_0x2db4c0;}}class zo extends vt{constructor(_0x540fce){super(_0x540fce),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(_0x540fce,'AI_DISCLAIMER_TEXT')}]}]});}}class jo extends vt{constructor(_0x1ad79a){super(_0x1ad79a),this['set']('isVisible',!0x0);const _0x18ce64=new yn('small');_0x18ce64['isVisible']=!0x0;const _0x59147d=new vt(this['locale']);_0x59147d['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',_0xc111ac=>!_0xc111ac)]},'children':[_0x18ce64,_0x59147d]});}}class Jo extends So{['focusCycler'];['_config'];['_contentWrapper'];['_streamableContentView'];['_toolbarView'];['_miniToolbarView'];['_loaderView'];['_disclaimerView'];['_focusTracker'];['_keystrokes'];['_dialogContent'];['_focusables'];['_scrollManager'];['_navigationPreviousButton'];['_navigationNextButton'];['_navigationTryAgainButton'];['_navigationCounter'];constructor(_0x19f90d,_0xe0167e){super(_0x19f90d),this['set']('isBusy',!0x1),this['set']('isTrackChangesOn',!0x1),this['set']('_isLoading',!0x1),this['set']('_hasError',!0x1),this['_config']=_0xe0167e,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 _0x36a70d(),this['_addContentWrapper'](_0xe0167e),this['_addDisclaimerView'](),this['_addToolbar'](_0xe0167e),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'](_0xe0167e);});}['render'](){super['render']();for(const _0x43157e of this['_focusables'])this['_focusTracker']['add'](_0x43157e['element']);this['_keystrokes']['listenTo'](this['element']),this['_initializeScrollManager']();}['destroy'](){super['destroy'](),this['_scrollManager']&&this['_scrollManager']['destroy']();}['focus'](_0x2cb384){-0x1===_0x2cb384?this['focusCycler']['focusLast']():this['focusCycler']['focusFirst']();}['setIsLoading'](_0x9acbfb){this['_isLoading']=_0x9acbfb;}['setErrorState'](){this['_hasError']=!0x0,this['_miniToolbarView']['toggleShowChangesEnabled'](!0x1);}['clearErrorState'](){this['_hasError']=!0x1,this['_miniToolbarView']['toggleShowChangesEnabled'](!0x0);}['showError'](_0x34b68b){super['showError'](_0x34b68b),this['_dialogContent']['has'](this['_errorView'])||this['_dialogContent']['add'](this['_errorView'],0x0);}['hideError'](){super['hideError'](),this['clearErrorState']();}['showBlockingError'](_0x1e19f6){super['showBlockingError'](_0x1e19f6),this['setErrorState']();}['addMiniToolbarItem'](_0x1c1574){this['_miniToolbarView']['items']['has'](_0x1c1574)||this['_miniToolbarView']['items']['add'](_0x1c1574);}['removeMiniToolbarItem'](_0x1ef452){this['_miniToolbarView']['items']['has'](_0x1ef452)&&this['_miniToolbarView']['items']['remove'](_0x1ef452);}['showLoader'](){this['_loaderView']&&(this['_isLoading']=!0x0);}['hideLoader'](){this['_loaderView']&&(this['_isLoading']=!0x1);}['_toggleToolbarButtonsVisibility']({showApplyButton:_0x1282b6,showSuggestButton:_0x205c0f}){_0x1282b6=_0x1282b6&&!this['isTrackChangesOn']&&this['_config']['availableActions']['includes']('applySuggestion'),_0x205c0f=_0x205c0f&&this['_config']['availableActions']['includes']('insertSuggestion'),this['_toolbarView']['setButtonsVisibility']({'showApplyButton':_0x1282b6,'showSuggestButton':_0x205c0f});}async['updateContent'](_0x17c688){await this['_streamableContentView']['update'](_0x17c688);}['clearContent'](){this['_streamableContentView']['clear']();}['_addContentWrapper'](_0x28c22c){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'](_0x28c22c['miniToolbarConfig'])]}),this['_dialogContent']['add'](this['_contentWrapper']);}['_addDisclaimerView'](){this['_disclaimerView']=new zo(this['locale']),this['_dialogContent']['add'](this['_disclaimerView']);}['_addToolbar']({showApplyButton:_0x1bf55f,showSuggestButton:_0x250662}){this['_toolbarView']=new Xo(this['locale'],_0x1bf55f,_0x250662),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',(_0x21f155,_0x3b8d89,_0x145cae)=>!(_0x21f155||_0x3b8d89||_0x145cae)),this['_toggleToolbarButtonsVisibility']({'showApplyButton':_0x1bf55f,'showSuggestButton':_0x250662}),this['_dialogContent']['add'](this['_toolbarView']);}['_createMiniToolbar'](_0x4baa9f){return this['_miniToolbarView']=new ko(this['locale'],_0x4baa9f),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',(_0x5a33f9,_0x4c6bef)=>!(_0x5a33f9||_0x4c6bef)),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 _0x3464aa=new Nt(this['locale']),_0x19c486=new Nt(this['locale']),_0x191aa8=new Zo(this['locale']),_0x5d4cc8=new Nt(this['locale']);_0x3464aa['set']({'icon':tt,'label':hs(this['locale'],'AI_ACTIONS_TRY_AGAIN'),'tooltip':!0x0,'class':'ck-ai-custom-action-button\x20'+us}),_0x19c486['set']({'icon':_0x1e7391,'tooltip':hs(this['locale'],'AI_ACTIONS_PREVIOUS_INTERACTION'),'class':'ck-ai-navigation-button\x20ck-ai-previous-button\x20'+us}),_0x5d4cc8['set']({'icon':et,'tooltip':hs(this['locale'],'AI_ACTIONS_NEXT_INTERACTION'),'class':'ck-ai-navigation-button\x20ck-ai-next-button\x20'+us}),_0x3464aa['bind']('isEnabled')['to'](this,'isBusy',_0x4adc6b=>!_0x4adc6b),_0x3464aa['on']('execute',()=>{this['fire']('tryAgain');}),_0x19c486['bind']('isEnabled')['to'](this,'isBusy',_0x32b277=>!_0x32b277),_0x19c486['on']('execute',()=>{this['fire']('showPrevious');}),_0x5d4cc8['bind']('isEnabled')['to'](this,'isBusy',_0x31b924=>!_0x31b924),_0x5d4cc8['on']('execute',()=>{this['fire']('showNext');}),this['_navigationPreviousButton']=_0x19c486,this['_navigationCounter']=_0x191aa8,this['_navigationNextButton']=_0x5d4cc8,this['_navigationTryAgainButton']=_0x3464aa;}['updateMiniToolbarButtons'](_0x17e6eb,_0x1be413){this['_navigationPreviousButton']||this['_setupMiniToolbarButtons']();const _0x50f1a2=_0x17e6eb>0x1;if(this['addMiniToolbarItem'](this['_navigationTryAgainButton']),_0x50f1a2){this['addMiniToolbarItem'](this['_navigationPreviousButton']),this['addMiniToolbarItem'](this['_navigationCounter']),this['addMiniToolbarItem'](this['_navigationNextButton']);const _0x478089=_0x17e6eb-_0x1be413;this['_navigationCounter']['setInteractionCount'](_0x478089+'/'+_0x17e6eb),this['_navigationPreviousButton']['isEnabled']=_0x1be413<_0x17e6eb-0x1,this['_navigationNextButton']['isEnabled']=_0x1be413>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'](_0x5d8122){this['_isLoading']=_0x5d8122;}['resetShowChangesButton'](){this['_miniToolbarView']['isShowChangesOn']=!0x1;}['_initializeScrollManager'](){const _0x2b7049=this['_getScrollableElement']();_0x2b7049&&!this['_scrollManager']&&(this['_scrollManager']=new sr(_0x2b7049));}['_getScrollableElement'](){return this['_streamableContentView']['element'];}}class Zo extends vt{constructor(_0x153fa9){super(_0x153fa9);const _0x4446cd=this['bindTemplate'];this['set']('interactionCount','1/1'),this['setTemplate']({'tag':'span','attributes':{'class':['ck-ai-interaction-counter']},'children':[{'text':_0x4446cd['to']('interactionCount')}]});}['setInteractionCount'](_0x200e28){this['set']('interactionCount',_0x200e28);}}class ta extends _0x4f5a67{static get['requires'](){return[as,Bt,Js,Oo,_0x513dcf];}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(_0x18720e){super(_0x18720e),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'](_0x598d18,_0x4b84a6,_0x3136a3){if(this['_stopInteraction'](),this['editor']['plugins']['has']('TableSelection')){if(this['editor']['plugins']['get']('TableSelection')['getSelectedTableCells']()){const {modelFragment:_0x4ad58d,anchorData:_0x7e8f01,root:_0x2c46a2}=this['_getExecuteDataInTable']();return this['_executeAction'](_0x598d18,_0x4ad58d,_0x7e8f01,_0x2c46a2,_0x4b84a6,_0x3136a3);}}const {modelFragment:_0x13d45a,anchorData:_0x5ccd6c,root:_0xf259c1}=this['_getExecuteDataRegular']();return this['_executeAction'](_0x598d18,_0x13d45a,_0x5ccd6c,_0xf259c1,_0x4b84a6,_0x3136a3);}async['destroy'](){return this['_stopInteraction'](),this['_bodyCollection']['detachFromDom'](),super['destroy']();}['_createActionsBalloonView'](){const _0x281e32=this['editor']['plugins']['has']('TrackChanges');let _0x106bfa=this['editor']['config']['get']('ai.availableReplyActions')||[...fn];_0x281e32||(_0x106bfa=_0x106bfa['filter'](_0x488635=>'insertSuggestion'!=_0x488635));const _0x390486=this['editor']['commands']['get']('trackChanges'),_0x2e3fca=new Jo(this['editor']['locale'],{'showApplyButton':!0x0,'showSuggestButton':_0x281e32,'miniToolbarConfig':{'showChanges':'icon'},'availableActions':_0x106bfa});return _0x2e3fca['bind']('isBusy')['to'](this),_0x390486&&_0x2e3fca['bind']('isTrackChangesOn')['to'](_0x390486,'value'),_0x2e3fca['on']('tryAgain',()=>{this['_refreshInteraction']();}),_0x2e3fca['on']('showPrevious',()=>{this['_navigateToPrevious']();}),_0x2e3fca['on']('showNext',()=>{this['_navigateToNext']();}),_0x2e3fca;}['_getExecuteDataRegular'](){const _0x29985a=this['editor']['model']['document']['selection'],_0x52c999=_0x29985a['getFirstRange']()['start']['root'];if(_0x29985a['isCollapsed']){const _0x1014c3=At(_0x29985a['getSelectedBlocks']())||this['editor']['model']['schema']['getLimitElement'](_0x29985a);this['editor']['model']['change'](_0x544422=>{_0x544422['setSelection'](_0x1014c3,'in');});}const _0x89f4b2=_0x29985a['getFirstRange'](),_0x3e70a6=this['_wrapWithCommonAncestors'](this['editor']['model']['getSelectedContent'](_0x29985a),_0x89f4b2['start'],_0x89f4b2['end']);this['_copyMarkersToFragment'](_0x3e70a6,_0x29985a,{'isTableSelection':!0x1});const _0x310d68=_0x29985a['getFirstRange']()['start'],_0x404a33=new Map();let _0x323675=_0x3e70a6;for(let _0x3e7467=0x0;_0x3e7467<_0x310d68['path']['length'];_0x3e7467++)_0x404a33['set'](_0x323675,_0x310d68['path'][_0x3e7467]),_0x323675=_0x323675['getChild'](0x0);return{'modelFragment':_0x3e70a6,'anchorData':_0x404a33,'root':_0x52c999};}['_getExecuteDataInTable'](){const _0x3cf075=this['editor']['model']['document']['selection'],_0x86ad4e=this['editor']['plugins']['get']('TableSelection'),_0x144d4e=_0x3cf075['getFirstRange']()['start']['root'],_0x1b6602=_0x86ad4e['getSelectionAsFragment'](),_0x328523=_0x3cf075['getFirstRange']()['start']['parent']['parent'],_0x2b08f4=this['editor']['model']['createRange'](this['editor']['model']['createPositionBefore'](_0x328523),this['editor']['model']['createPositionAfter'](_0x328523)),_0x48db35=this['_wrapWithCommonAncestors'](_0x1b6602,_0x2b08f4['start'],_0x2b08f4['end']);this['_copyMarkersToFragment'](_0x48db35,_0x3cf075,{'isTableSelection':!0x0});const _0x1c1269=_0x3cf075['getFirstRange']()['start'],_0x42cef4=new Map();let _0x2d3429=_0x48db35;for(let _0x32a783=0x0;_0x32a783<_0x1c1269['path']['length'];_0x32a783++)if(_0x42cef4['set'](_0x2d3429,_0x1c1269['path'][_0x32a783]),_0x32a783<_0x1c1269['path']['length']-0x1)_0x2d3429=_0x2d3429['getChild'](0x0);else{let _0x49f9c3=_0x2d3429['nextSibling'];for(;_0x49f9c3;)_0x42cef4['set'](_0x49f9c3,_0x1c1269['path'][_0x32a783]),_0x49f9c3=_0x49f9c3['nextSibling'];}return{'modelFragment':_0x48db35,'anchorData':_0x42cef4,'root':_0x144d4e};}async['_executeAction'](_0x30543d,_0x4f7dae,_0x2a54da,_0x1dd0f2,_0x156dd7,_0x410a81){const _0x5358f4=this['editor']['plugins']['get'](Js),_0x3b367b=this['editor']['plugins']['get'](Oo),_0x1ff028=this['editor']['model']['document']['selection'],_0x2d0614=await _0x5358f4['modelToDataWithIds'](_0x4f7dae),_0x37fddd=this['editor']['model']['document']['version'],_0x2a8bea=[..._0x1ff028['getRanges']()];return this['_actionsBalloonView']||(this['_actionsBalloonView']=this['_createActionsBalloonView']()),this['_clearInteractionHistory'](),this['_clearErrorState'](),this['_balloonShowDiff']=!0x1,this['_actionsBalloonView']['resetShowChangesButton'](),this['_actionsBalloonView']['clearContent'](),_0x3b367b['open']({'index':0x3e8*Math['random']()%0x3e8,'title':_0x156dd7,'icon':_0x410a81||_0x63550d,'mainView':this['_actionsBalloonView'],'class':'ck-ai-actions-balloon','ranges':_0x2a8bea,'id':'aiActionsBalloon'}),this['_setLoadingState'](),this['stopListening'](this['_actionsBalloonView']),this['stopListening'](_0x3b367b),this['_interactionParams']={'action':_0x30543d,'content':_0x2d0614,'version':_0x37fddd,'aiBalloon':_0x3b367b,'modelFragment':_0x4f7dae,'anchorData':_0x2a54da,'root':_0x1dd0f2},this['_setupApplyListeners'](),this['listenTo'](_0x3b367b,'selectionRemoved',()=>{this['_stopInteraction'](),this['_actionsBalloonView']['disableMiniToolbarButtons']();}),this['listenTo'](_0x3b367b,'dialogClosed',(_0x348b50,{id:_0x35fa5a})=>{if('aiActionsBalloon'===_0x35fa5a){for(const _0x4d0820 of this['_interactions']){if(0x0===_0x4d0820['replies']['length']||_0x4d0820['stoppedExplicitly'])continue;const _0x568874=_0x4d0820['replies'][_0x4d0820['replies']['length']-0x1],_0x3ebfc0=_0x568874['changeGroups'][0x0];_0x3ebfc0&&'pending'===_0x3ebfc0['state']&&_0x568874['setChangeGroupState'](0x0,'rejected');}this['_stopInteraction'](),this['_clearInteractionHistory'](),this['stopListening'](this['_actionsBalloonView']),this['stopListening'](_0x3b367b);}}),this['_createInteraction'](_0x2d0614,_0x37fddd,_0x3b367b,_0x30543d);}['_setupApplyListeners'](){if(!this['_interactionParams'])return;const {modelFragment:_0x57220f,anchorData:_0x10b460,root:_0x1c8a1c}=this['_interactionParams'];this['listenTo'](this['_actionsBalloonView'],'applySuggestion',()=>{this['_applyChanges'](_0x57220f,_0x10b460,_0x1c8a1c,!0x1);}),this['listenTo'](this['_actionsBalloonView'],'insertSuggestion',()=>{this['_applyChanges'](_0x57220f,_0x10b460,_0x1c8a1c,!0x0);});}['_wrapWithCommonAncestors'](_0x431d43,_0x2df332,_0x5787f5){const _0x1eeede=this['editor']['model']['createRange'](_0x2df332,_0x5787f5)['getCommonAncestor'](),_0x4dca6c=_0x1eeede['is']('documentFragment')?[]:_0x1eeede['getAncestors']({'includeSelf':!0x0})['slice'](0x1);if(_0x4dca6c['length']){const _0x24e27c=_0x4dca6c['map'](_0x2fc896=>_0x2fc896['_clone'](!0x1));for(let _0x4919fe=0x1;_0x4919fe<_0x24e27c['length'];_0x4919fe++)_0x24e27c[_0x4919fe-0x1]['_appendChild'](_0x24e27c[_0x4919fe]);return _0x24e27c[_0x24e27c['length']-0x1]['_appendChild'](_0x431d43),new _0x5874c7(_0x24e27c[0x0]);}return _0x431d43;}['_copyMarkersToFragment'](_0x5db845,_0x26fd3f,_0x3d69e3={'isTableSelection':!0x1}){const _0x281ad4=this['editor']['model'],_0x6f4280=Array['from'](_0x26fd3f['getRanges']()),_0xc0bab7=_0x26fd3f['getFirstRange']()['start'];for(const _0x294242 of _0x281ad4['markers']){if(_0x294242['name']['startsWith'](zs)||!_0x294242['affectsData'])continue;const _0x4c71eb=_0x294242['getRange']();if(!_0x6f4280['some'](_0x5e2b9d=>_0x5e2b9d['containsRange'](_0x4c71eb,!0x0)))continue;const _0xefabe7=this['_regularCalculateMarkerPath'](_0x4c71eb['start'],_0xc0bab7,_0x3d69e3['isTableSelection']),_0x3d62a9=this['_regularCalculateMarkerPath'](_0x4c71eb['end'],_0xc0bab7,_0x3d69e3['isTableSelection']),_0x3c43ee=_0x281ad4['createPositionFromPath'](_0x5db845,_0xefabe7),_0x54df09=_0x281ad4['createPositionFromPath'](_0x5db845,_0x3d62a9);if(!_0x3c43ee['isEqual'](_0x54df09)){const _0x2516e2=_0x281ad4['createRange'](_0x3c43ee,_0x54df09);_0x5db845['markers']['set'](_0x294242['name'],_0x2516e2);}}}['_regularCalculateMarkerPath'](_0x2298ea,_0x399ac5,_0x14c2f9=!0x1){const _0x56ce9c=[..._0x2298ea['path']['slice']()];for(let _0x2f36d6=0x0;_0x2f36d6<Math['max'](_0x399ac5['path']['length'],_0x2298ea['path']['length']);_0x2f36d6++){const _0x1d6200=_0x399ac5['path'][_0x2f36d6]||0x0,_0x23a06c=(_0x2298ea['path'][_0x2f36d6]||0x0)-_0x1d6200;if(_0x56ce9c[_0x2f36d6]=_0x23a06c,0x0!==_0x23a06c&&!_0x14c2f9)break;}return _0x56ce9c;}async['_createInteraction'](_0x3496ba,_0x567028,_0x1e7647,_0x838e18){const _0x1dc92c=this['editor'];this['_interactionParams']||(this['_interactionParams']={'action':_0x838e18,'content':_0x3496ba,'version':_0x567028,'aiBalloon':_0x1e7647,'modelFragment':this['editor']['model']['getSelectedContent'](this['editor']['model']['document']['selection']),'anchorData':new Map(),'root':this['editor']['model']['document']['selection']['getFirstRange']()['start']['root']});const _0x20d0ec=new Qo({'connector':this['_aiConnector'],'locale':_0x1dc92c['locale'],'content':_0x3496ba,'version':_0x567028,..._0x838e18});this['_interactions']['push'](_0x20d0ec);const _0x46c1d7=(_0x29fdd5,_0x30a30f=!0x1,_0x41f14d='streaming')=>this['_promiseQueue']['enqueue'](async _0x745b00=>{try{const _0x252810=Rs({'editor':_0x1dc92c,'changeGroups':_0x29fdd5['changeGroups'],'documentContextContent':_0x29fdd5['documentContextContent'],'showDiff':_0x30a30f,'trimUnchanged':!0x1});_0x252810['length']&&await this['_actionsBalloonView']['updateContent']({'part':_0x252810[0x0],'renderingStrategy':_0x41f14d,'abortSignal':_0x745b00});}catch(_0x3b1b57){if(this['_isAbortError'](_0x3b1b57))return;throw _0x3b1b57;}});_0x20d0ec['on']('replyCreated',(_0x452441,_0x5d7d87)=>{this['_actionsBalloonView']['hideLoader'](),this['_actionsBalloonView']['startAutoScroll'](),_0x46c1d7(_0x5d7d87)['catch'](_0x35f38a=>{this['_isAbortError'](_0x35f38a)||(console['error']('Error\x20updating\x20content\x20in\x20replyCreated:',_0x35f38a),this['_setErrorState'](_0x20d0ec));});}),_0x20d0ec['on']('replyContentUpdated',(_0x6a0b4a,_0x55a0bf)=>{_0x46c1d7(_0x55a0bf)['catch'](_0x191f6e=>{this['_isAbortError'](_0x191f6e)||(console['error']('Error\x20updating\x20content\x20in\x20replyContentUpdated:',_0x191f6e),this['_setErrorState'](_0x20d0ec));});}),_0x20d0ec['on']('interactionFinished',async()=>{try{await this['_clearLoadingState'](),this['_actionsBalloonView']['updateMiniToolbarButtons'](this['_interactions']['length'],this['_currentInteractionIndex']),await this['_promiseQueue']['queueEmptyPromise'];}catch(_0x383315){this['_isAbortError'](_0x383315)||(console['error']('Error\x20clearing\x20loading\x20state\x20in\x20interactionFinished:',_0x383315),this['_setErrorState'](_0x20d0ec));}finally{this['_actionsBalloonView']['stopAutoScroll']();}}),this['listenTo'](this['_actionsBalloonView'],'toggleSuggestionDisplayMode',async(_0x3af811,{showDiff:_0x442c96})=>{try{this['_balloonShowDiff']=_0x442c96;const _0x23517b=this['_interaction']['replies'][this['_interaction']['replies']['length']-0x1];_0x23517b&&await _0x46c1d7(_0x23517b,_0x442c96,'static');}catch(_0x194364){this['_isAbortError'](_0x194364)||(console['error']('Error\x20updating\x20content\x20in\x20toggleSuggestionDisplayMode:',_0x194364),this['_setErrorState'](_0x20d0ec));}}),_0x20d0ec['on']('replyChangeGroupStateUpdated',()=>{const _0x4ffe08={'positiveCount':_0x20d0ec['replies']['reduce']((_0x2e63f2,_0x3c9124)=>_0x2e63f2+_0x3c9124['changeGroups']['filter'](_0x1f92af=>'accepted'===_0x1f92af['state'])['length'],0x0),'totalCount':_0x20d0ec['replies']['reduce']((_0x166dfd,_0x3074dc)=>_0x166dfd+_0x3074dc['changeGroups']['length'],0x0)},_0x2842f6=_0x20d0ec['actionCallId'],_0x2100e1=_0x20d0ec['actionName'];_0x2100e1?this['_aiConnector']['upsertAIActionRating'](_0x2100e1,_0x2842f6,_0x4ffe08):this['_aiConnector']['upsertCustomAIActionRating'](_0x2842f6,_0x4ffe08);}),this['_setLoadingState']();try{const _0x277150=await _0x20d0ec['start']();return this['_actionsBalloonView']['updateMiniToolbarButtons'](this['_interactions']['length'],this['_currentInteractionIndex']),_0x277150;}catch(_0x35ab7f){if(this['_isAbortError'](_0x35ab7f))return;this['_actionsBalloonView']['hideLoader'](),this['_setErrorState'](_0x20d0ec);}}['_applyChanges'](_0x41cafc,_0x4ba6e3,_0x196302,_0xd22c4d){const _0x43bccc=this['editor'];if(_0xd22c4d&&!_0x43bccc['plugins']['has']('TrackChanges'))throw new at('ai-no-track-changes',null);const _0x391109=this['editor']['plugins']['get'](_0x513dcf),_0xb4bf2d=this['_interactions'][this['_interactions']['length']-0x1-this['_currentInteractionIndex']];if(!_0xb4bf2d||!_0xb4bf2d['replies']['length'])return;const _0xcd67a8=_0xb4bf2d['replies'][_0xb4bf2d['replies']['length']-0x1],_0x101041=_0xcd67a8['changeGroups'];_0xcd67a8['setChangeGroupState'](0x0,'accepted');let _0x585d1c=qs({'editor':_0x43bccc,'reply':_0xcd67a8,'interaction':_0xb4bf2d,'groups':_0x101041,'transform':!0x1,'documentCompare':_0x391109,'documentCompareOptions':{'anchor':_0x43bccc['model']['createPositionAt'](_0x41cafc,0x0),'markDeletions':_0xd22c4d}});_0x585d1c=this['_filterOperationsOutsideRange'](_0x585d1c,_0x4ba6e3);for(const _0x3cfd51 of _0x585d1c)this['_anchorOperation'](_0x4ba6e3,_0x3cfd51,_0x196302);const _0x3a9069=_0xb4bf2d['getDocumentContext']()['version'],_0x4a7125=_0x43bccc['model']['document']['history']['getOperations'](_0x3a9069),_0x4dddb1={'document':_0x43bccc['model']['document'],'useRelations':!0x1,'padWithNoOps':!0x1},_0x180ceb=_0x3a354d(_0x585d1c,_0x4a7125,_0x4dddb1)['operationsA'];_0x43bccc['model']['change'](_0x3585f4=>{if(_0x3585f4['setSelection'](_0x43bccc['model']['document']['selection']['focus']),_0xd22c4d)_0x43bccc['plugins']['get']('TrackChangesEditing')['_applyOperationsAsSuggestions'](_0x180ceb);else{for(const _0x3d13d2 of _0x180ceb)_0x3d13d2['baseVersion']=_0x43bccc['model']['document']['version'],Qs(_0x43bccc,_0x3d13d2),_0x3585f4['batch']['addOperation'](_0x3d13d2),_0x43bccc['model']['applyOperation'](_0x3d13d2);}}),this['editor']['plugins']['get']('AIBalloon')['close']();}['_filterOperationsOutsideRange'](_0x57f76b,_0x2799cc){return _0x57f76b['filter'](_0xffe4b4=>{if('rename'==_0xffe4b4['type']){const _0x2a38eb=_0xffe4b4['position']['nodeAfter'];return!_0x2799cc['has'](_0x2a38eb);}if(_0xffe4b4['type']['indexOf']('Attribute')>-0x1){const _0x3e9824=_0xffe4b4['range']['start']['nodeAfter'];return!_0x2799cc['has'](_0x3e9824);}return!0x0;});}['_anchorOperation'](_0x32ada5,_0x102b2d,_0x18c7ce){const _0x3dd2da=_0x102b2d['clone']();for(const _0x15dab4 in _0x102b2d){const _0x40b98e=_0x102b2d[_0x15dab4];_0x40b98e instanceof _0x2264dd?_0x102b2d[_0x15dab4]=new _0x2264dd(_0x256a57(_0x40b98e['start']),_0x256a57(_0x40b98e['end'])):_0x40b98e instanceof _0x2c4a91&&(_0x102b2d[_0x15dab4]=_0x256a57(_0x40b98e));}if(['insert','move','remove','reinsert','split','merge']['includes'](_0x3dd2da['type'])){if(_0x3dd2da['isDocumentOperation']=!0x1,_0x3dd2da['baseVersion']=null,'remove'==_0x3dd2da['type']){const _0x533952=_0x3dd2da['sourcePosition'],_0x379ab7=_0x3dd2da['howMany'];new _0x1e19dc(_0x533952,_0x379ab7)['_execute']();}else _0x3dd2da['_execute']();}function _0x256a57(_0x1a177c){if('$graveyard'==_0x1a177c['root']['rootName'])return _0x1a177c;const _0x2cb92a=[];let _0x16714f=_0x1a177c['root'];for(let _0x24f44a=0x0;_0x24f44a<_0x1a177c['path']['length'];_0x24f44a++){const _0x4eca39=_0x32ada5['get'](_0x16714f)||0x0;_0x2cb92a[_0x24f44a]=_0x1a177c['path'][_0x24f44a]+_0x4eca39,_0x16714f=_0x16714f['getChildAtOffset'](_0x1a177c['path'][_0x24f44a]);}return new _0x2c4a91(_0x18c7ce,_0x2cb92a,_0x1a177c['stickiness']);}}['_refreshInteraction'](){if(!this['_interactionParams'])return;this['_interactions']['length']>0x0&&this['_stopInteraction'](),this['_currentInteractionIndex']=0x0,this['_balloonShowDiff']=!0x1;const {action:_0x162c10,content:_0xe2c8fa,version:_0x36849c,aiBalloon:_0x287f63}=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'](_0xe2c8fa,_0x36849c,_0x287f63,_0x162c10)['catch'](_0x5d8fcb=>{this['_isAbortError'](_0x5d8fcb)||console['error']('Error\x20refreshing\x20interaction:',_0x5d8fcb);});}['_isAbortError'](_0x5d06f1){return!!_0x5d06f1['message']&&_0x5d06f1['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 _0x26fb12=this['_interactions']['length'];this['_currentInteractionIndex']<_0x26fb12-0x1&&this['_displayInteractionAtIndex'](this['_currentInteractionIndex']+0x1);}['_navigateToNext'](){this['_currentInteractionIndex']>0x0&&this['_displayInteractionAtIndex'](this['_currentInteractionIndex']-0x1);}async['_displayInteractionAtIndex'](_0x556fad){if(!this['_interactionParams'])return;this['_currentInteractionIndex']=_0x556fad;const _0xd8b479=this['_interactions'][this['_interactions']['length']-0x1-this['_currentInteractionIndex']];if(!_0xd8b479)return;if(_0xd8b479['hasError'])return this['_setErrorState'](_0xd8b479),void this['_actionsBalloonView']['updateMiniToolbarButtons'](this['_interactions']['length'],this['_currentInteractionIndex']);if(!_0xd8b479['replies']['length'])return;this['_actionsBalloonView']['hideError'](),this['_interactionParams']&&this['_clearErrorState']();const _0x3dd3a7=_0xd8b479['replies'][_0xd8b479['replies']['length']-0x1];if(_0x3dd3a7){const _0x111855=this['editor'];try{const _0x10873b=Rs({'editor':_0x111855,'changeGroups':_0x3dd3a7['changeGroups'],'documentContextContent':_0x3dd3a7['documentContextContent'],'showDiff':this['_balloonShowDiff'],'trimUnchanged':!0x1});await new Promise(_0x443f35=>setTimeout(_0x443f35,0x32)),await this['_actionsBalloonView']['updateContent']({'part':_0x10873b[0x0],'renderingStrategy':'static','abortSignal':new AbortController()['signal']});}catch(_0x1e1fc3){this['_isAbortError'](_0x1e1fc3)||console['error']('Error\x20updating\x20content\x20during\x20navigation:',_0x1e1fc3);}}this['_actionsBalloonView']['updateMiniToolbarButtons'](this['_interactions']['length'],this['_currentInteractionIndex']);}['_setLoadingState'](){this['_actionsBalloonView']['setIsLoading'](!0x0),this['isBusy']=!0x0;}async['_setErrorState'](_0x1c5fed){const _0x34660f=hs(this['editor']['locale'],'AI_ACTIONS_GENERIC_ERROR');this['_actionsBalloonView']['showError'](_0x34660f),_0x1c5fed['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 _0x4f5a67{static get['requires'](){return[Wo,$o,ta];}static get['pluginName'](){return'AIQuickActions';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x443dfb){super(_0x443dfb),_0x443dfb['config']['define']('ai.quickActions',{'extraCommands':[],'removeCommands':[],'isSearchEnabled':!0x0});}}class ia extends vt{['resultResponseView'];['acceptButtonView'];['dismissButtonView'];['infoButtonView'];['outdatedButtonView'];constructor(_0x502617,_0x14f7ea){super(_0x502617),this['id']=_0x14f7ea,this['set']('status','pending'),this['set']('changeId',_0x14f7ea),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',(_0xf2d7e6,_0x3d92ee)=>{_0x3d92ee&&_0x3d92ee['target']&&'A'===_0x3d92ee['target']['tagName']&&_0x3d92ee['preventDefault'](),this['fire']('activateChange',{'id':_0x14f7ea,'source':this,'uiInteraction':'click'});}),this['on']('mouseover',()=>{this['fire']('activateChange',{'id':_0x14f7ea,'source':this,'uiInteraction':'hover'});}),this['on']('mouseout',()=>{this['fire']('deactivateChange',{'origin':'panel','id':_0x14f7ea,'source':this});});}['setItemAsActive'](){this['isActive']=!0x0;}['setItemAsInactive'](){this['isActive']=!0x1;}['_createResultResponseView'](){const _0x143488=new vt(this['locale']);return _0x143488['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',_0x340ac7=>!_0x340ac7)]}}),_0x143488;}['_createAcceptButtonView'](){const _0x5e2cb3=new Nt(this['locale']);return _0x5e2cb3['set']({'label':hs(this['locale'],'AI_REVIEW_MODE_ACCEPT_CHANGE'),'withText':!0x0}),_0x5e2cb3['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x59b58f=>{this['fire']('acceptChange',{'id':this['changeId']}),_0x59b58f['stopPropagation']();})},'attributes':{'class':[this['bindTemplate']['if']('status','ck-hidden',_0x13d7aa=>'pending'!==_0x13d7aa&&'accepted'!==_0x13d7aa),this['bindTemplate']['if']('status',ls,_0x294372=>'pending'===_0x294372),this['bindTemplate']['if']('status',us,_0x1213a0=>'pending'!==_0x1213a0),this['bindTemplate']['if']('status','ck-ai_review__check-run-result-status-button',_0x5be990=>'accepted'===_0x5be990)]}}),this['on']('change:status',(_0x2da5ea,_0x116e07,_0x1452ec)=>{_0x5e2cb3['isEnabled']='pending'===_0x1452ec,'accepted'===_0x1452ec&&(_0x5e2cb3['label']=hs(this['locale'],'AI_REVIEW_MODE_CHECK_STATUS_ACCEPTED'),_0x5e2cb3['icon']=_0x2d2483);}),_0x5e2cb3;}['_createDismissButtonView'](){const _0x310700=new Nt(this['locale']);return _0x310700['set']({'label':hs(this['locale'],'AI_REVIEW_MODE_DISMISS_CHANGE'),'withText':!0x0}),_0x310700['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x5ea4f5=>{this['fire']('dismissChange',{'id':this['changeId']}),_0x5ea4f5['stopPropagation']();})},'attributes':{'class':[us,this['bindTemplate']['if']('status','ck-hidden',_0x431060=>'pending'!==_0x431060&&'rejected'!==_0x431060),this['bindTemplate']['if']('status','ck-ai_review__check-run-result-dismiss-button',_0x4ad503=>'pending'===_0x4ad503),this['bindTemplate']['if']('status','ck-ai_review__check-run-result-status-button',_0x1b6264=>'rejected'===_0x1b6264)]}}),this['on']('change:status',(_0x26aae2,_0x251186,_0x4b28b5)=>{_0x310700['isEnabled']='pending'===_0x4b28b5,'rejected'===_0x4b28b5&&(_0x310700['label']=hs(this['locale'],'AI_REVIEW_MODE_CHECK_STATUS_REJECTED'),_0x310700['icon']=_0x49d6d3);}),_0x310700;}['_createInfoButtonView'](){const _0x55fb96=new Nt(this['locale']);return _0x55fb96['set']({'label':hs(this['locale'],'AI_REVIEW_MODE_LEARN_MORE'),'icon':_0x23ad4d,'tooltip':!0x0,'isToggleable':!0x0,'role':'menuitemcheckbox','class':us+'\x20ck-ai_review__check-run-result-info-button\x20ck-hidden'}),_0x55fb96['bind']('isOn')['to'](this,'isInfoToggleOn',_0x4cc893=>_0x4cc893),_0x55fb96['on']('execute',()=>{this['isInfoToggleOn']=!this['isInfoToggleOn'];}),_0x55fb96;}['_createOutdatedButtonView'](){const _0x7b9dc=new Nt(this['locale']);return _0x7b9dc['set']({'label':hs(this['locale'],'AI_REVIEW_MODE_CHECK_STATUS_OUTDATED'),'icon':it,'withText':!0x0,'isEnabled':!0x1}),_0x7b9dc['extendTemplate']({'attributes':{'class':[us,'ck-ai_review__check-run-result-status-button',this['bindTemplate']['if']('status','ck-hidden',_0x341320=>'outdated'!==_0x341320)],'disabled':'disabled'}}),_0x7b9dc;}}class sa extends Xt{['resultItemView'];['_pinnedRectIndex']=void 0x0;['_pinnedTargetElement']=void 0x0;['_pinnedTargetChangeId']=void 0x0;constructor(_0x32f4bf,_0x1aefe4){super(_0x32f4bf),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']()),_0x1aefe4['add'](this);}['render'](){super['render'](),this['_setupClickOutsideHandler']();}['updateContent'](_0x13abdb){this['resultItemView']['changeId']=_0x13abdb['id'],this['resultItemView']['resultResponseView']['element']['innerHTML']=_0x13abdb['contentDiffed'];}['showBalloon'](_0x2f1879,_0x48dbce,_0x2db377,_0xecb6e,_0x96b4a,_0x453123){const _0x10e1da=_0x48dbce();if(!_0x10e1da)return;this['updateContent'](_0x2f1879),this['show']();const _0x38737d=Array['from'](_0x10e1da['getClientRects']())['reverse'](),_0x5f1ca6=this['_getPointedRectIndexFromEvent'](_0x2db377,_0x38737d),_0x261de0=_0x38737d[_0x5f1ca6??0x0];'click'===_0xecb6e?(this['isDiffActive']=!0x0,this['pin']({'target':()=>this['_getBestRectPositionOnClick'](_0x48dbce(),_0x5f1ca6,_0x2f1879['id'],_0x96b4a,_0x453123)||_0x261de0})):'hover'===_0xecb6e&&(this['isDiffActive']=!0x1,this['pin']({'target':()=>this['_getBestRectPositionOnHover'](_0x48dbce(),_0x5f1ca6,_0x2f1879['id'])||_0x261de0}));}['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 _0x5df2c0=[this['element']];return this['_pinnedTargetElement']&&_0x5df2c0['push'](this['_pinnedTargetElement']),_0x5df2c0;},'callback':()=>{this['hide'](),this['unpin'](),this['deactivateChange'](),this['_pinnedTargetElement']=void 0x0,this['_pinnedRectIndex']=void 0x0,this['_pinnedTargetChangeId']=void 0x0;}});}['_createContentView'](){const _0x577f49=new vt();return this['resultItemView']=new ia(this['locale'],''),this['resultItemView']['resultResponseView']['extendTemplate']({'attributes':{'class':['ck-content']}}),this['resultItemView']['delegate']('acceptChange','dismissChange')['to'](this),_0x577f49['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']]}]}),_0x577f49;}['_getBestRectPositionOnClick'](_0x56dd62,_0x6359f5,_0x556b1d,_0x3ddcbc,_0x1217d5){if(!_0x56dd62)return null;const _0x120c4d=this['position']['replace']('arrow_',''),_0x52d16b=Array['from'](_0x56dd62['getClientRects']());let _0x3d42c6,_0x421a46=_0x52d16b['reverse']();return void 0x0!==_0x6359f5&&this['_isPinnedRectVisible'](_0x421a46[_0x6359f5],_0x3ddcbc,_0x1217d5)?(_0x3d42c6=_0x421a46[_0x6359f5],this['_pinnedRectIndex']=_0x6359f5):this['_isPinnedRectVisible'](_0x421a46[0x0],_0x3ddcbc,_0x1217d5)&&void 0x0===_0x6359f5?_0x3d42c6=_0x421a46[0x0]:(_0x421a46='s'==_0x120c4d[0x0]?[..._0x52d16b]['reverse']():_0x52d16b,_0x421a46['forEach'](_0x14de34=>{this['_isPinnedRectVisible'](_0x14de34,_0x3ddcbc,_0x1217d5)&&(_0x3d42c6=_0x14de34);})),this['_pinnedTargetChangeId']=_0x556b1d,this['_pinnedTargetElement']=_0x56dd62,_0x3d42c6||_0x56dd62['getBoundingClientRect']();}['_getBestRectPositionOnHover'](_0x32c915,_0x2dab61,_0x46476e){if(!_0x32c915)return null;const _0x260bf7=Array['from'](_0x32c915['getClientRects']())['reverse']();if(void 0x0===this['_pinnedRectIndex']&&void 0x0!==_0x2dab61&&this['_pinnedTargetChangeId']!==_0x46476e)return this['_pinnedRectIndex']=_0x2dab61,this['_pinnedTargetElement']=_0x32c915,this['_pinnedTargetChangeId']=_0x46476e,_0x260bf7[_0x2dab61];if(void 0x0!==this['_pinnedRectIndex']&&this['_pinnedTargetChangeId']===_0x46476e){if(_0x32c915!==this['_pinnedTargetElement'])return Array['from'](this['_pinnedTargetElement']['getClientRects']())['reverse']()[this['_pinnedRectIndex']];return _0x260bf7[this['_pinnedRectIndex']];}return void 0x0!==_0x2dab61&&this['_pinnedTargetChangeId']!==_0x46476e?(this['_pinnedRectIndex']=_0x2dab61,this['_pinnedTargetElement']=_0x32c915,this['_pinnedTargetChangeId']=_0x46476e,_0x260bf7[_0x2dab61]):_0x32c915['getBoundingClientRect']();}['_getPointedRectIndexFromEvent'](_0x35b32e,_0x136afa){if(_0x35b32e)for(let _0x130e4c=0x0;_0x130e4c<_0x136afa['length'];_0x130e4c++){const _0x41008a=_0x136afa[_0x130e4c];if(_0x35b32e['clientX']>=_0x41008a['left']-0x3&&_0x35b32e['clientX']<=_0x41008a['right']+0x3&&_0x35b32e['clientY']>=_0x41008a['top']-0x3&&_0x35b32e['clientY']<=_0x41008a['bottom']+0x3)return _0x130e4c;}}['_isPinnedRectVisible'](_0x23acec,_0x4ec263,_0x54381b){const _0x4bcb60=new ut(_0x23acec),_0x246b3f=_0x4ec263||document['documentElement'],_0x2a7e77=_0x4bcb60['getIntersection'](Rt(_0x54381b)),_0x3bf013=new ut(_0x246b3f)['getIntersection'](_0x4bcb60);return!!(_0x2a7e77&&_0x3bf013&&_0x4bcb60['width']>0x0);}}const na=['getReviewCheckList','runReviewCheck','abortReviewStream','toggleDiff','acceptAllChanges','leaveReviewCoreResultList','activateChange','deactivateChange','acceptChange','dismissChange','learnMore','finishReview','retryReview'];class ra extends _0x29a024{['_mainView'];['_balloonSuggestionView'];['_bodyCollection'];static get['requires'](){return[os];}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x36aaae){super(_0x36aaae),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 _0xc6d937=this['context']['plugins']['get']('AITabs');this['registerTab'](_0xc6d937);}['destroy'](){this['_bodyCollection']['detachFromDom'](),super['destroy']();}['setAvailableChecks'](_0x14a1f2){if(!this['_mainView']['reviewCheckListView']['hasChecks']()){const _0x28af4c=!this['context']['config']['get']('ai.models.showModelSelector');this['_mainView']['reviewCheckListView']['setChecks'](_0x14a1f2,_0x28af4c);}this['_mainView']['showReviewCheckListView']();}['showReviewCheckList'](){this['fire']('getReviewCheckList');}['showCheckRunResults'](_0x517ce4){_0x517ce4&&('error-general'!==_0x517ce4['status']?'error-chunk'!==_0x517ce4['status']?this['_mainView']['showReviewCheckResultsView']():this['showChunkErrorView']():this['showGeneralResultsErrorView']());}['showCheckRunResult'](_0xd3d931){this['_mainView']['addCheckRunResult'](_0xd3d931);}['showGeneralResultsErrorView'](){this['_mainView']['showGeneralResultsErrorView']();}['showGeneralReviewCoreErrorView'](_0x1c85c1){this['_mainView']['showGeneralReviewCoreErrorView'](_0x1c85c1??hs(this['context']['locale'],'AI_REVIEW_INITIALIZATION_ERROR_MESSAGE'));}['showChunkErrorView'](){this['_mainView']['showChunkErrorView']();}['setCheckResultTitle'](_0x4de558,_0x2ff1f5){this['_mainView']['reviewCheckResultsView']['setTitle'](_0x4de558,_0x2ff1f5);}['setActiveStateInResults'](_0x48f584){this['_mainView']['reviewCheckResultsView']['getResults']()['forEach'](_0x3031c4=>{_0x3031c4['id']===_0x48f584&&_0x3031c4['setItemAsActive']();});}['resetActiveStateInResults'](){this['_mainView']['reviewCheckResultsView']['getResults']()['forEach'](_0x405a68=>_0x405a68['setItemAsInactive']());}['updateChangeState'](_0x1cf502,_0x32f44c){'accepted'===_0x32f44c||'rejected'===_0x32f44c||'outdated'===_0x32f44c?this['_mainView']['reviewCheckResultsView']['hideResult'](_0x1cf502,_0x32f44c):this['_mainView']['reviewCheckResultsView']['showResult'](_0x1cf502,_0x32f44c);}['showReviewCompletedView'](){this['_mainView']['showReviewCompletedView']();}['showActionsWhenResultIsReady'](){this['_mainView']['showActionsWhenResultIsReady']();}['showNoChangesView'](){this['_mainView']['showNoChangesView']();}['hideActionsWhenResultIsReady'](){this['_mainView']['hideActionsWhenResultIsReady']();}['showChangeBalloon'](_0x214e4d,_0x3dc1f3,_0x382a72,_0x3df176,_0x19a21f,_0xc8e660){this['_balloonSuggestionView']['showBalloon'](_0x214e4d,_0x3dc1f3,_0x382a72,_0x3df176,_0x19a21f,_0xc8e660);}['hideChangeBalloon'](){this['_balloonSuggestionView']['hideBalloon']();}['hideDiffInBalloon'](){this['_balloonSuggestionView']['hideDiffInBalloon']();}['showDiffInBalloon'](){this['_balloonSuggestionView']['showDiffInBalloon']();}['getChangeElement'](_0x2bb68e){const _0x243e52=this['_mainView']['reviewCheckResultsView']['getResults']()['find'](_0x5308ab=>_0x5308ab['id']===_0x2bb68e);return _0x243e52?_0x243e52['element']:null;}['deactivateChange'](){this['_balloonSuggestionView']['deactivateChange']();}}class oa extends vt{constructor(_0x9c44d9){super(_0x9c44d9),this['set']('isVisible',!0x1),this['set']('errorMessage','');const _0x331cfb=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai_review__general-error-container',_0x331cfb['if']('isVisible','ck-hidden',_0x2dd74e=>!_0x2dd74e)]},'children':[{'tag':'p','attributes':{'class':'ck\x20ck-ai-notification\x20ck-ai-notification_error'},'children':[{'text':_0x331cfb['to']('errorMessage')}]}]});}}class aa extends vt{['reviewCoreHeader'];['generalErrorView'];['reviewCheckListView'];['reviewCheckResultsView'];['reviewCompletedView'];constructor(_0x1cdfa6,_0x1b099a){super(_0x1cdfa6),this['reviewCoreHeader']=_0x1b099a['header'],this['generalErrorView']=new oa(_0x1cdfa6),this['reviewCheckListView']=_0x1b099a['list'],this['reviewCheckListView']['delegate'](...na)['to'](this),this['reviewCheckResultsView']=_0x1b099a['results'],this['reviewCheckResultsView']['delegate'](...na)['to'](this),this['reviewCompletedView']=_0x1b099a['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'](_0x1e2c81){this['reviewCheckResultsView']['addResult'](_0x1e2c81),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'](_0x5e4db7){this['generalErrorView']['set']('isVisible',!0x0),this['generalErrorView']['errorMessage']=_0x5e4db7;}['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(_0x547cb8,_0x5afff7){super(_0x5afff7),this['set']({'label':_0x547cb8,'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(_0x1ca68e,_0x5c2b1d){super(_0x1ca68e),this['_contents']=_0x5c2b1d,this['_resultViews']=new _0x36a70d(),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(_0x1ca68e),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 _0x397ead=this['_createCombinedSkeletonLoader'](),_0x282b8b=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-run',_0x282b8b['if']('isLoading','ck-ai_review__check-run_loading',_0x3ac8eb=>_0x3ac8eb),_0x282b8b['if']('isResultReady','ck-ai_review__check-run_ready',_0x49726e=>_0x49726e),_0x282b8b['if']('isVisible','ck-hidden',_0x1bbfe0=>!_0x1bbfe0)]},'children':[this['_resultsHeader'],this['_errorMessageView'],this['_resultsBody'],_0x397ead,this['reviewDisclaimer']]});}['clearResults'](){this['_resultViews']['clear'](),this['_resultsBody']['element']&&(this['_resultsBody']['element']['scrollTop']=0x0);}['getResults'](){return this['_resultViews'];}['addResult'](_0x52e193){const _0x202de1=new ia(this['locale'],_0x52e193['id']);_0x202de1['delegate']('acceptChange','dismissChange','activateChange','deactivateChange')['to'](this),this['_resultViews']['add'](_0x202de1),_0x202de1['resultResponseView']['element']['innerHTML']=_0x52e193['contentDiffed'];}['hideResult'](_0xde8a02,_0x417b11){if('pending'===_0x417b11)return;const _0x4743e8=this['_resultViews']['find'](_0x43edf4=>_0x43edf4['id']===_0xde8a02);_0x4743e8&&(_0x4743e8['status']=_0x417b11,_0x4743e8['element']?.['classList']['add']('ck-ai_review__check-run-result_grayout'));}['showResult'](_0xe06a78,_0x201673){if('pending'!==_0x201673)return;const _0x370a5e=this['_resultViews']['find'](_0x42450e=>_0x42450e['id']===_0xe06a78);_0x370a5e&&(_0x370a5e['status']=_0x201673,_0x370a5e['element']?.['classList']['remove']('ck-ai_review__check-run-result_grayout'));}['setTitle'](_0x55dbc8,_0x224c8b){this['headerTitle']=_0x55dbc8,this['headerSubtitle']=_0x224c8b||'';}['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 _0x1da759=new vt(this['locale']),_0x489a9e=[];for(let _0x1e9176=0x0;_0x1e9176<0x10;_0x1e9176++){const _0x3b756e=this['_createSkeletonLoader']();_0x3b756e['extendTemplate']({'attributes':{'class':['ck-ai_review__check-run-skeleton-item']}}),_0x489a9e['push'](_0x3b756e);}return _0x1da759['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-run-skeleton-container',this['bindTemplate']['if']('isLoading','ck-hidden',_0x2d17f0=>!_0x2d17f0)]},'children':_0x489a9e}),_0x1da759;}['_createResultsBodyView'](){const _0x258ffb=new vt(this['locale']);return _0x258ffb['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-run-results-container','ck-reset_all-excluded',this['bindTemplate']['if']('isLoading','ck-hidden',_0x44b57c=>_0x44b57c)]},'children':this['_resultViews']}),_0x258ffb;}['_createErrorView'](){const _0x4e8a07=new vt(this['locale']),_0x12a38f=new Nt(this['locale']),t=this['locale']['t'];return _0x4e8a07['delegate']('retryReview')['to'](this),_0x12a38f['set']({'label':t('Try\x20again'),'withText':!0x0,'class':ls+'\x20ck-ai_review__check-run-error-retry-button'}),_0x12a38f['on']('execute',()=>{this['fire']('retryReview');}),_0x4e8a07['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-run-error-container',this['bindTemplate']['if']('showErrorMessage','ck-hidden',_0x2c95a8=>!_0x2c95a8),this['bindTemplate']['if']('errorType','ck-ai_review__check-run-error-container_border-bottom',_0x29ade4=>'chunk'===_0x29ade4)]},'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',_0x3d1645=>'chunk'===_0x3d1645)]},'children':[{'tag':'p','attributes':{'class':['ck-ai-notification__content',this['bindTemplate']['if']('errorType','ck-hidden',_0x5baa29=>'general'!==_0x5baa29)]},'children':[{'text':this['_contents']['generalErrorText']}]},{'tag':'p','attributes':{'class':['ck-ai-notification__content',this['bindTemplate']['if']('errorType','ck-hidden',_0x3ad06b=>'chunk'!==_0x3ad06b)]},'children':[{'text':hs(this['locale'],'AI_REVIEW_MODE_CHUNK_ERROR_MESSAGE')}]}]},_0x12a38f]}),_0x4e8a07;}['_createCancelButtonView'](){const _0x3e6511=new Nt(this['locale']);return _0x3e6511['set']({'label':hs(this['locale'],'AI_REVIEW_MODE_STOP_GENERATING'),'withText':!0x0,'class':[ls+'\x20ck-ai-button-stop-generating'],'icon':_0x2d2f82}),_0x3e6511['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isResultReady','ck-hidden',_0x263c78=>_0x263c78),this['bindTemplate']['if']('isCompleted','ck-hidden',_0x31f41d=>_0x31f41d)]}}),_0x3e6511['on']('execute',()=>{this['fire']('abortReviewStream');}),_0x3e6511;}['_createToggleDiffButtonView'](){const _0xae23c=new Nt(this['locale']);_0xae23c['set']({'tooltip':!0x0,'isToggleable':!0x0,'role':'menuitemcheckbox'}),_0xae23c['bind']('isEnabled')['to'](this,'isError',_0x36ed0f=>!_0x36ed0f),_0xae23c['extendTemplate']({'attributes':{'class':[ls,'ck-ai_review__check-run-toggle-diff-button',this['bindTemplate']['if']('isResultReady','ck-hidden',_0x226278=>!_0x226278),this['bindTemplate']['if']('isCompleted','ck-hidden',_0x56af04=>_0x56af04)]}});const _0x569b9e=hs(this['locale'],'AI_REVIEW_MODE_HIDE_CHANGES'),_0x5ecb17=hs(this['locale'],'AI_REVIEW_MODE_SHOW_CHANGES');return _0xae23c['bind']('isOn')['to'](this,'isToggleDiffOn',_0x5f1cc9=>_0x5f1cc9),_0xae23c['bind']('icon')['to'](this,'isToggleDiffOn',_0x7eb53d=>_0x7eb53d?st:nt),_0xae23c['bind']('label')['to'](this,'isToggleDiffOn',_0x1a4fe0=>_0x1a4fe0?_0x569b9e:_0x5ecb17),_0xae23c['on']('execute',()=>{this['isToggleDiffOn']=!this['isToggleDiffOn'],this['fire']('toggleDiff',{'on':this['isToggleDiffOn']});}),_0xae23c;}['_createAcceptAllButtonView'](){const _0x33e1c6=new Nt(this['locale']);return _0x33e1c6['set']({'label':hs(this['locale'],'AI_REVIEW_MODE_ACCEPT_ALL'),'withText':!0x0}),_0x33e1c6['bind']('isEnabled')['to'](this,'isError',_0x935e28=>!_0x935e28),_0x33e1c6['extendTemplate']({'attributes':{'class':[cs,'ck-ai_review__check-run-accept-all-button',this['bindTemplate']['if']('isResultReady','ck-hidden',_0x337810=>!_0x337810),this['bindTemplate']['if']('isCompleted','ck-hidden',_0x383c26=>_0x383c26)]}}),_0x33e1c6['on']('execute',()=>{this['fire']('acceptAllChanges');}),_0x33e1c6;}['_createExitReviewButtonView'](){const _0x42d042=new Nt(this['locale']);return _0x42d042['set']({'label':hs(this['locale'],'AI_REVIEW_MODE_EXIT_REVIEW'),'withText':!0x0}),_0x42d042['extendTemplate']({'attributes':{'class':[us,'ck-ai_review__check-run-exit-button',this['bindTemplate']['if']('isResultReady','ck-hidden',_0x2f4e7e=>!_0x2f4e7e),this['bindTemplate']['if']('isCompleted','ck-hidden',_0x2d1437=>_0x2d1437)]}}),_0x42d042['on']('execute',()=>{this['fire']('leaveReviewCoreResultList');}),_0x42d042;}['_createResultHeaderView'](){const _0x4ebbca=new vt(this['locale']),_0x3ecdd9=this['_createTitleView']();return _0x4ebbca['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-run-results-header',this['bindTemplate']['if']('isCompleted','ck-ai_review__review-completed-header',_0x6e314=>_0x6e314)]},'children':[_0x3ecdd9,{'tag':'div','attributes':{'class':['ck-ai_review__check-run-results-header-buttons']},'children':[this['_cancelButtonView'],this['_acceptAllButtonView'],this['_exitReviewButtonView'],this['_toggleDiffButtonView'],this['_finishReviewButtonView']]}]}),_0x4ebbca;}['_createTitleView'](){const _0x37f7ed=new vt(this['locale']),_0x4007d6=new yn();return _0x4007d6['bind']('isVisible')['to'](this,'isResultReady',_0x73d404=>!_0x73d404),_0x37f7ed['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-run-results-header-title-wrapper']},'children':[_0x4007d6,{'tag':'div','attributes':{'class':['ck-ai_review__check-run-results-header-title-content',this['bindTemplate']['if']('isCompleted','ck-hidden',_0x1d91f9=>_0x1d91f9)]},'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',_0x1700b6=>!_0x1700b6)]},'children':[{'text':hs(this['locale'],'AI_REVIEW_MODE_FINISH_REVIEW_HEADER_TITLE')}]}]}),_0x37f7ed;}['_createFinishReviewButtonView'](){const _0x287314=new ha(hs(this['locale'],'AI_REVIEW_MODE_FINISH_REVIEW_BUTTON_LABEL'),this['locale']);return _0x287314['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isCompleted','ck-hidden',_0x3f2c2b=>!_0x3f2c2b)]}}),_0x287314['delegate']('finishReview')['to'](this),_0x287314;}}class la extends Ht{['_resultsHeader'];['_finishReviewButtonView'];constructor(_0x39b03d,_0x3a7b0b){super(_0x39b03d),this['_finishReviewButtonView']=this['_createFinishReviewButtonView'](_0x3a7b0b['buttonText']),this['_resultsHeader']=this['_createResultHeaderView'](_0x3a7b0b['headerText']);const _0x242ad3=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__review-completed',_0x242ad3['if']('isVisible','ck-hidden',_0x5f2ac0=>!_0x5f2ac0)]},'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':_0x3a7b0b['emptyResultsText']}]}]}]});}['_createFinishReviewButtonView'](_0x5bf3a4){const _0x9b1769=new ha(_0x5bf3a4,this['locale']);return _0x9b1769['delegate']('finishReview')['to'](this),_0x9b1769;}['_createResultHeaderView'](_0x527f99){const _0x571aa9=new vt(this['locale']);return _0x571aa9['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':_0x527f99}]},{'tag':'div','attributes':{'class':['ck-ai_review__review-completed-header-buttons']},'children':[this['_finishReviewButtonView']]}]}),_0x571aa9;}}class ua extends vt{['_dropdownView'];['_defaultValue'];['_defaultLabel'];constructor(_0x13685f,_0x318870){super(_0x13685f),this['_defaultValue']=_0x318870['default']||(_0x318870['data']['length']>0x0?_0x318870['data'][0x0]['id']:''),this['_defaultLabel']=_0x318870['data']['find'](_0x517f35=>_0x517f35['id']===this['_defaultValue'])?.['label']||'',this['set']('formValue',''),this['_dropdownView']=Gt(this['locale']);const _0x4bcdd5=this['_prepareListOptions'](_0x318870['data']);jt(this['_dropdownView'],_0x4bcdd5,{'role':'menu','ariaLabel':_0x318870['label']}),this['_dropdownView']['buttonView']['set']({'label':this['_defaultLabel'],'withText':!0x0}),this['_dropdownView']['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x4eb7fe=>{_0x4eb7fe['stopPropagation']();})}}),this['listenTo'](this['_dropdownView'],'execute',_0x241ff7=>{this['formValue']=_0x241ff7['source']['model']['id'],this['_dropdownView']['buttonView']['label']=_0x241ff7['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'](_0x1e79fe=[]){const _0x1b8517=new dt();this['resetToDefault']();for(const _0x127cad of _0x1e79fe){const _0x3ada8d=new Jt({'label':_0x127cad['label'],'withText':!0x0,'role':'menuitemradio','id':_0x127cad['id'],'model':_0x127cad});_0x3ada8d['bind']('isOn')['to'](this,'formValue',_0x4d6223=>_0x4d6223===_0x3ada8d['id']);const _0x3e0a2a={'type':'button','model':_0x3ada8d};_0x1b8517['add'](_0x3e0a2a);}return _0x1b8517;}}class da extends Ht{['_formItem']=null;constructor(_0xfb7eb,_0x10adff,_0x16c303){super(_0xfb7eb),this['argsKey']=_0x10adff?.['argsKey'];if('dropdown'===_0x10adff['formType'])this['_formItem']=new ua(this['locale'],_0x10adff);this['set']('value',''),this['bind']('value')['to'](this['_formItem'],'formValue');const _0x19e42e=new _0xe481ff(this['locale'],{'children':[this['_formItem']],'class':[_0x16c303?'ck-form__row_with-submit':'']});_0x16c303&&_0x19e42e['children']['add'](_0x16c303),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai_review__form-item','ck-reset_all']},'children':[_0x19e42e]});}['resetToDefault'](){this['_formItem']['resetToDefault']();}}class _a extends _0x19b333{['keystrokes'];static ['MIN_ROWS']=0x1;static ['MAX_ROWS']=0xc;constructor(_0x62983e){super(_0x62983e),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 _0x36a70d();['submitButtonView'];['cancelButtonView'];['promptInputView'];['actionsFooterView'];['_modelSelectionDropdown'];['_modelNameView'];['_modelSelectionDropdownItems'];['_check'];['_defaultValue'];['_defaultLabel'];constructor(_0x5d4c27,_0x53c6ff,_0x44e467=!0x1){super(_0x5d4c27),this['_check']=_0x53c6ff,this['set']('prompt',''),this['set']('modelId',''),this['set']('modelDisplayMode','selector'),this['set']('activeModelName',null),this['_defaultValue']=_0x53c6ff['defaultModel']?_0x53c6ff['defaultModel']['id']:'',this['_defaultLabel']=_0x53c6ff['defaultModel']?_0x53c6ff['defaultModel']['name']:'',this['submitButtonView']=this['_createSubmitButtonView'](),this['cancelButtonView']=this['_createCancelButtonView'](),(this['promptInputView']=new te(this['locale'],()=>new _a(_0x5d4c27)),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'](_0x44e467),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 _0xe481ff(this['locale'],{'children':[this['promptInputView']]}),new _0xe481ff(this['locale'],{'children':[this['actionsFooterView']]})]}),this['promptInputView']['fieldView']['keystrokes']['set']('Enter',(_0x4f166e,_0xfacf51)=>{this['_isValid']()?(this['fire']('runReviewCheck',{'id':'custom','args':{'prompt':this['prompt'],'model':this['modelId']},'isCustom':!0x0}),_0xfacf51()):_0xfacf51();}),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'](_0x409c6b=>{this['_focusables']['add'](_0x409c6b),this['focusTracker']['add'](_0x409c6b['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 _0x575329 of this['_getFormValidators']()){const _0x45f5c4=_0x575329();if(_0x45f5c4)return this['promptInputView']['errorText']=_0x45f5c4,!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 _0x365717=new Nt(this['locale']),t=this['locale']['t'];return _0x365717['set']({'label':t('Submit'),'withText':!0x0,'class':cs}),_0x365717['on']('execute',()=>{this['_isValid']()&&this['fire']('runReviewCheck',{'id':'custom','args':{'prompt':this['prompt'],'model':this['modelId']},'isCustom':!0x0});}),_0x365717;}['_createCancelButtonView'](){const _0x2a31f6=new Nt(this['locale']),t=this['locale']['t'];return _0x2a31f6['set']({'label':t('Cancel'),'withText':!0x0,'class':us}),_0x2a31f6['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x14c946=>{_0x14c946['stopPropagation']();})}}),_0x2a31f6['on']('execute',()=>{this['resetToDefault'](),this['fire']('closeCustomCheck');}),_0x2a31f6;}['_setModelList'](_0x4846ac){this['_modelSelectionDropdownItems']['clear']();const _0x287619=this['_check']['models'];if(_0x4846ac)this['set']('modelDisplayMode','hidden');else{const _0x4386cf=0x1===_0x287619['length'];this['set']('modelDisplayMode',_0x4386cf?'name':'selector');}if(this['resetToDefault'](),_0x287619?.['length']){0x1===_0x287619['length']&&this['set']('activeModelName',_0x287619[0x0]['name']||_0x287619[0x0]['id']);for(const _0x6508dd of _0x287619){const _0x387a8d=new Jt({'label':_0x6508dd['name'],'withText':!0x0,'role':'menuitemradio','id':_0x6508dd['id'],'model':_0x6508dd});_0x387a8d['bind']('isOn')['to'](this,'modelId',_0x3603e7=>_0x3603e7===_0x6508dd['id']),this['_modelSelectionDropdownItems']['add']({'type':'button','model':_0x387a8d,'labelView':new Ia(this['locale'],_0x6508dd)});}}}['_createModelSelectionDropdown'](){const _0x460bac=Gt(this['locale']);return _0x460bac['set']({'panelPosition':'se','class':'ck-ai_review__check-list-item-model-dropdown'}),_0x460bac['buttonView']['set']({'label':this['_defaultLabel'],'withText':!0x0,'tooltip':!0x0,'class':us}),_0x460bac['buttonView']['bind']('isVisible')['to'](this,'modelDisplayMode',_0x528a49=>'selector'===_0x528a49),this['listenTo'](_0x460bac,'execute',_0x24cfcf=>{this['modelId']=_0x24cfcf['source']['model']['id'],_0x460bac['buttonView']['label']=_0x24cfcf['source']['label'];}),_0x460bac;}['_createModelNameView'](){const _0x10161f=new Aa(this['locale']);return _0x10161f['bind']('text')['to'](this,'activeModelName',_0x57228f=>_0x57228f??''),_0x10161f['bind']('isVisible')['to'](this,'modelDisplayMode',_0xbd5135=>'name'===_0xbd5135),_0x10161f;}['_createActionsFooterView'](){const _0x1a7e35=new vt(this['locale']);return _0x1a7e35['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']]}]}),_0x1a7e35;}}class Aa extends vt{constructor(_0x16467b){super(_0x16467b),this['set']('text',void 0x0),this['set']('isVisible',!0x0);const _0x137ad0=this['bindTemplate'];this['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai_review__check-list-item-model-name',_0x137ad0['if']('isVisible','ck-hidden',_0x4b8980=>!_0x4b8980)]},'children':[{'text':_0x137ad0['to']('text')}]});}}class Ia extends Mt{constructor(_0x5b0cc0,_0x57db90){super();const _0x53948c=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-button__label'],'style':_0x53948c['to']('style'),'id':_0x53948c['to']('id')},'children':[{'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-model-dropdown-name']},'children':[{'tag':'span','children':[{'text':_0x53948c['to']('text')}]}]},{'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-model-dropdown-description']},'children':[{'tag':'span','children':[_0x57db90['description']||'']}]}]});}}class Ea extends Ht{['_formItemsCollection']=new _0x36a70d();['_customCheckView']=null;['_hideModels']=!0x1;constructor(_0x3993a8,_0x4e7ec7,_0x1d72b2,_0x2dde4e=!0x1){super(_0x3993a8),this['_hideModels']=_0x2dde4e,this['set']('isParametrizedViewOpen',!0x1),this['set']('isListItemRendered',!0x1),this['set']('isItemParametrized',_0x4e7ec7['isParameterized']);const _0x2cdffe=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',_0x41d773=>_0x41d773),this['bindTemplate']['if']('isListItemRendered','ck-ai_review__check-list-item_rendered',_0x2d445f=>_0x2d445f)],'style':{'--ck-ai-review-check-list-item-index':_0x1d72b2}},'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':_0x4e7ec7['title']}]},_0x2cdffe]},{'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-description']},'children':_0x4e7ec7['description']?[{'text':_0x4e7ec7['description']}]:[]}]}]},..._0x4e7ec7['isParameterized']?[this['_createParameterizedView'](_0x4e7ec7)]:[],...'custom'===_0x4e7ec7['id']?[this['_createCustomView'](_0x4e7ec7,this['_hideModels'])]:[]]}),this['on']('click',()=>{_0x4e7ec7['isParameterized']?this['isParametrizedViewOpen']=!0x0:this['fire']('runReviewCheck',{'id':_0x4e7ec7['id'],'args':_0x4e7ec7['useArgs']?_0x4e7ec7['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'](_0xe72bd0=>{_0xe72bd0['resetToDefault']();}),this['_customCheckView']&&this['_customCheckView']['resetToDefault']();}['_createIconView'](){const _0x182bb0=new xt();return _0x182bb0['content']=rt,_0x182bb0['extendTemplate']({'attributes':{'class':['ck-ai_review__check-list-item-title-icon']}}),_0x182bb0;}['_createParameterizedView'](_0xc98a41){const _0x6b5b2c=new vt(),_0x3987d5=this['_createFormView'](_0xc98a41);return _0x6b5b2c['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-parameterized',this['bindTemplate']['if']('isParametrizedViewOpen','ck-hidden',_0x52f973=>!_0x52f973)]},'children':[_0x3987d5]}),_0x6b5b2c;}['_createFormView'](_0x3c14eb){const _0x42a304=new vt(),_0x7a4c95=Array['isArray'](_0x3c14eb['options'])?_0x3c14eb['options']:[],_0x3d1ac9=new Nt(this['locale']),t=this['locale']['t'];_0x3d1ac9['set']({'label':t('Submit'),'withText':!0x0,'class':cs}),_0x3d1ac9['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x163e9a=>{_0x163e9a['stopPropagation']();})}}),_0x3d1ac9['on']('execute',()=>{const _0x535a22=[],_0x47b069={};this['_formItemsCollection']['forEach'](_0x1bfc4e=>{_0x535a22['push'](_0x1bfc4e['value']),_0x3c14eb['useArgs']&&_0x3c14eb['options']&&(_0x47b069[_0x1bfc4e['argsKey']]=_0x1bfc4e['value']);}),this['fire']('runReviewCheck',{'id':_0x3c14eb['id'],'params':_0x535a22['length']?_0x535a22:void 0x0,'args':Object['keys'](_0x47b069)['length']?_0x47b069:void 0x0});});const _0x5625e6=_0x7a4c95['length'];return _0x7a4c95['forEach']((_0x1c26ac,_0x3cf13c)=>{const _0xfce4c4=_0x3cf13c===_0x5625e6-0x1;this['_formItemsCollection']['add'](new da(this['locale'],_0x1c26ac,_0xfce4c4?_0x3d1ac9:null));}),_0x42a304['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-parameterized-form']},'children':this['_formItemsCollection']}),_0x42a304;}['_createCustomView'](_0x1827f7,_0x567225=!0x1){return this['_customCheckView']=new ga(this['locale'],_0x1827f7,_0x567225),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',_0x239720=>!_0x239720)]}}),this['_customCheckView']['delegate']('runReviewCheck')['to'](this),this['listenTo'](this['_customCheckView'],'closeCustomCheck',()=>{this['isParametrizedViewOpen']=!0x1;}),this['on']('change:isParametrizedViewOpen',(_0x1e4e2f,_0x428bac,_0x7469d6)=>{_0x7469d6||this['_customCheckView']['resetFormValidationStatus']();}),this['_customCheckView'];}}class pa extends Ht{['_checkViews'];constructor(_0x2116df){super(_0x2116df),this['_checkViews']=new _0x36a70d(),this['_setupTemplate']();}['setChecks'](_0x54c13f,_0x1bb0b0=!0x1){this['_checkViews']['clear']();for(const [_0x4b52d6,_0x4a7d1e]of _0x54c13f['entries']()){const _0x2541b0=new Ea(this['locale'],_0x4a7d1e,_0x4b52d6,_0x1bb0b0);_0x2541b0['delegate']('runReviewCheck')['to'](this),this['_checkViews']['add'](_0x2541b0);}}['hasChecks'](){return this['_checkViews']['length']>0x0;}['resetAllParameterizedChecks'](){for(const _0x5688cb of this['_checkViews'])_0x5688cb instanceof Ea&&_0x5688cb['resetToDefault']();}['_setupTemplate'](){const _0x317796=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-list',_0x317796['if']('isVisible','ck-hidden',_0x110282=>!_0x110282)]},'children':this['_checkViews']});}}class ma extends ra{static get['pluginName'](){return'AIReviewModeUI';}['createMainView'](){const _0x47f84b=this['context']['plugins']['get']('AITabs'),_0x1f0059=this['context']['locale'],_0x2ee516=new eo(_0x1f0059,{'label':hs(_0x1f0059,'AI_REVIEW_MODE'),'icon':_0xc96c5b,'class':'ck-ai-header_review','showResizeButton':_0x47f84b['showResizeButton']});return _0x2ee516['delegate']('resizeTabs')['to'](_0x47f84b),_0x2ee516['bind']('isMaximized')['to'](_0x47f84b['view'],'isMaximized',_0x992e6d=>_0x992e6d),new aa(this['context']['locale'],{'header':_0x2ee516,'list':new pa(_0x1f0059),'results':new ca(_0x1f0059,{'generalErrorText':hs(_0x1f0059,'AI_REVIEW_MODE_GENERAL_ERROR_MESSAGE')}),'completed':new la(_0x1f0059,{'headerText':hs(_0x1f0059,'AI_REVIEW_MODE_FINISH_REVIEW_HEADER_TITLE'),'emptyResultsText':hs(_0x1f0059,'AI_REVIEW_MODE_EMPTY_RESULTS_TEXT'),'buttonText':hs(_0x1f0059,'AI_REVIEW_MODE_FINISH_REVIEW_BUTTON_LABEL')})});}['registerTab'](){const _0x248c86=this['context']['plugins']['get']('AITabs');_0x248c86['view']['on']('activateTab',(_0x527d16,{newTab:_0x471773,oldTab:_0x2c549b})=>{'reviewMode'===_0x471773?this['fire']('getReviewCheckList'):'reviewMode'===_0x2c549b&&this['fire']('leaveReview');}),_0x248c86['view']['addTab']({'id':'reviewMode','buttonLabel':hs(this['context']['locale'],'AI_REVIEW_MODE'),'buttonIcon':_0xc96c5b,'order':0x0,'content':this['_mainView']});}}const Ta='review-',Ca=['softBreak'];class wa extends _0x29a024{static get['requires'](){return[_0x513dcf,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(_0x3cc4d5){super(_0x3cc4d5),this['_domEmitter']=new(Ot())(),this['_eventEmitter']=new(Tt())();}get['emitter'](){return this['_eventEmitter'];}['afterInit'](){const _0x3ebdea=_0x1e8c06=>this['_scheduleAttachReviewEditingToEditor'](_0x1e8c06);if(this['_registerGlobalBalloonBlurHandler'](),this['context']instanceof _0x1c72cb)return void this['_attachReviewEditingToEditor'](this['context']);const _0x166a98=this['context'];for(const _0x1df02c of _0x166a98['editors'])_0x3ebdea(_0x1df02c);this['listenTo'](_0x166a98['editors'],'add',(_0x6b6f15,_0x42f034)=>{_0x3ebdea(_0x42f034);}),this['listenTo'](_0x166a98['editors'],'remove',(_0xeb2d59,_0x3bd129)=>{for(const [_0x3cd4a9,_0x26db96]of this['_markers'])_0x26db96['editor']===_0x3bd129&&(this['_eventEmitter']['fire']('changeMarkerRemoved',{'markerId':_0x3cd4a9,'changeId':_0x26db96['groupId']}),this['_markers']['delete'](_0x3cd4a9));});}['_scheduleAttachReviewEditingToEditor'](_0x5e41e5){const _0x5ad632=()=>{'destroyed'!==_0x5e41e5['state']&&_0x5e41e5['conversion']&&this['_attachReviewEditingToEditor'](_0x5e41e5);};if('ready'===_0x5e41e5['state'])return void _0x5ad632();const _0x2a4463=()=>{this['stopListening'](_0x5e41e5,'ready',_0x2a4463),_0x5ad632();};this['listenTo'](_0x5e41e5,'ready',_0x2a4463);}['_attachReviewEditingToEditor'](_0x2443fb){this['_reviewEditingAttachedEditors']['has'](_0x2443fb)||(_0x2443fb['conversion']['for']('editingDowncast')['markerToElement']({'model':Ta+'insert','view':(_0xffc3ff,{writer:_0xfa1de5})=>{const _0x12e249=this['_markers']['get'](_0xffc3ff['markerName']),_0x39e673={'class':'ck-ai_review-marker_add'+(this['_activeMarkers']['has'](_0x12e249?.['id']||'')?'\x20ck-ai_review__change_active':''),'data-marker-id':_0xffc3ff['markerName']};return _0xfa1de5['createUIElement']('span',_0x39e673,function(_0x181214){const _0x3398e7=this['toDomElement'](_0x181214);return _0x3398e7['innerHTML']=_0x12e249?.['content']?.['asString']||'',_0x3398e7;});}}),_0x2443fb['conversion']['for']('editingDowncast')['markerToHighlight']({'model':Ta+'remove-only','view':_0x3b8b3f=>{const _0x9f9005=this['_markers']['get'](_0x3b8b3f['markerName']),_0x519c59=['ck-ai_review-marker_strikethrough'];return this['_activeMarkers']['has'](_0x9f9005?.['id']||'')&&_0x519c59['push']('ck-ai_review__change_active'),{'classes':_0x519c59,'attributes':{'data-marker-id':_0x3b8b3f['markerName']}};}}),_0x2443fb['conversion']['for']('editingDowncast')['markerToHighlight']({'model':Ta+'remove-context','view':_0x1ced85=>{const _0x485a2c=this['_markers']['get'](_0x1ced85['markerName']),_0x51117f=['ck-ai_review-marker_underline'];return this['_activeMarkers']['has'](_0x485a2c?.['id']||'')&&_0x51117f['push']('ck-ai_review__change_active'),{'classes':_0x51117f,'attributes':{'data-marker-id':_0x1ced85['markerName']}};}}),_0x2443fb['conversion']['for']('editingDowncast')['markerToHighlight']({'model':Ta+'remove-text','view':_0x3028fa=>{const _0x1b6e94=this['_markers']['get'](_0x3028fa['markerName']),_0x991e40=['ck-ai_review-marker_hide'];return this['_activeMarkers']['has'](_0x1b6e94?.['id']||'')&&_0x991e40['push']('ck-ai_review__change_active'),{'classes':_0x991e40,'attributes':{'data-marker-id':_0x3028fa['markerName']}};}}),_0x2443fb['conversion']['for']('dataDowncast')['markerToElement']({'model':Ta+'suggestion-context','view':(_0x38f32b,{writer:_0x4d287d})=>_0x4d287d['createRawElement']('span',{'class':'ck-ai_review-marker_context-'+(_0x38f32b['isOpening']?'start':'end')})}),_0x2443fb['conversion']['for']('downcast')['attributeToAttribute']({'model':_0x33ffd6,'view':_0x689267}),this['_updateMouseMarkerInteractionListeners'](_0x2443fb),this['listenTo'](_0x2443fb,'addRoot',()=>this['_updateMouseMarkerInteractionListeners'](_0x2443fb),{'priority':'lowest'}),this['listenTo'](_0x2443fb,'detachRoot',()=>this['_updateMouseMarkerInteractionListeners'](_0x2443fb),{'priority':'lowest'}),_0x2443fb['model']['document']['registerPostFixer'](_0x529667=>this['_validateMarkers'](_0x2443fb,_0x529667)),_0x2443fb['model']['document']['on']('change',()=>this['_handleMarkerChanges'](_0x2443fb)),this['_reviewEditingAttachedEditors']['add'](_0x2443fb));}['_updateMouseMarkerInteractionListeners'](_0x3346e9){let _0x38d1b6=this['_boundEditables']['get'](_0x3346e9);_0x38d1b6||(_0x38d1b6=new Map(),this['_boundEditables']['set'](_0x3346e9,_0x38d1b6));const _0x22bca2=new Set(_0x3346e9['ui']['getEditableElementsNames']());for(const _0x2cab30 of _0x22bca2){if(_0x38d1b6['has'](_0x2cab30))continue;const _0x12904a=_0x3346e9['ui']['getEditableElement'](_0x2cab30);_0x38d1b6['set'](_0x2cab30,_0x12904a),this['_attachMouseMarkerInteractionListeners'](_0x12904a);}for(const [_0xe7064c,_0x124a43]of _0x38d1b6)_0x22bca2['has'](_0xe7064c)||(_0x38d1b6['delete'](_0xe7064c),this['_domEmitter']['stopListening'](_0x124a43));}['_attachMouseMarkerInteractionListeners'](_0x5c9ffb){this['_domEmitter']['listenTo'](_0x5c9ffb,'mouseup',(_0x3c60ca,_0x161722)=>{const _0x4c8413=_0x161722['target'],_0x4e031c=this['_findMarkerElement'](_0x4c8413);if(!_0x4e031c)return;const _0x2e6d86=_0x4e031c['getAttribute']('data-marker-id'),_0x3f01e1=_0x2e6d86['split'](':')['pop']()?.['split']('_')[0x0];this['_eventEmitter']['fire']('changeMarkerClicked',{'markerId':_0x2e6d86,'changeId':_0x3f01e1,'markerElement':()=>this['_findMarkerElementById'](_0x2e6d86),'domEvent':_0x161722});},{'usePassive':!0x0,'priority':'highest'}),this['_domEmitter']['listenTo'](_0x5c9ffb,'mouseover',(_0x1b38b2,_0xed944c)=>{const _0x13a60b=_0xed944c['target'],_0x365dd6=_0xed944c['relatedTarget'];let _0x2754dd=this['_findMarkerElement'](_0x13a60b);if(!_0x2754dd&&_0x365dd6&&(_0x2754dd=this['_findMarkerElement'](_0x365dd6)),!_0x2754dd)return;const _0x39d735=_0x2754dd['getAttribute']('data-marker-id'),_0x451ca3=_0x39d735['split'](':')['pop']()?.['split']('_')[0x0];this['_eventEmitter']['fire']('changeMarkerHovered',{'changeId':_0x451ca3,'markerElement':()=>this['_findMarkerElementById'](_0x39d735),'domEvent':_0xed944c});});}['_registerGlobalBalloonBlurHandler'](){this['_domEmitter']['listenTo'](document,'mouseover',_0x521085((_0x55e016,_0x15267d)=>{const _0x227c85=_0x15267d['target'];if(this['_findMarkerElement'](_0x227c85))return;_0x227c85['closest']('.ck-reset.ck-ai_review-balloon-panel-suggestion')||this['_eventEmitter']['fire']('changeMarkerBlurred');},0xc8));}['getDocumentData'](){const _0x3a925d=this['context']['plugins']['get']('AIEditing'),_0x492c8e=Ws(this['context']);if(!_0x492c8e['length'])throw new at('ai-get-editor-from-context-no-editor',this);const _0x27e894=new Set(),_0x2cf1e1=[],_0x1706bf=new Map();for(const _0x1b179a of _0x492c8e)for(const _0x3d0245 of _0x1b179a['model']['document']['getRoots']()){if('$graveyard'===_0x3d0245['rootName'])continue;const _0x3e6a1b=this['_buildDocumentDataSliceForRoot'](_0x1b179a,_0x3d0245,_0x3a925d,_0x27e894);_0x2cf1e1['push'](_0x3e6a1b['content']);for(const [_0x1895be,_0x25b603]of _0x3e6a1b['elements'])_0x1706bf['set'](_0x1895be,_0x25b603);}return{'elements':_0x1706bf,'content':_0x2cf1e1['join']('')};}['_buildDocumentDataSliceForRoot'](_0xc0b538,_0x52969d,_0x57aa1f,_0x5df6d6){const _0x12ae46=_0xc0b538['model'],_0x1d53c3=new _0x5874c7();for(const _0x25329f of _0x52969d['getChildren']())_0x1d53c3['_appendChild'](_0x25329f['_clone'](!0x0));for(const _0x404cc6 of _0x12ae46['markers']){const _0x248c7d=_0x404cc6['getRange']();_0x248c7d&&_0x248c7d['root']['rootName']===_0x52969d['rootName']&&_0x1d53c3['markers']['set'](_0x404cc6['name'],this['_changeRangeOwnerDocument'](_0x248c7d['clone'](),_0x1d53c3));}const _0x7018d9=new Map(),_0x54728c=_0x12ae46['document']['version'],_0x31a5bd=new _0x3e9906({'ignoreElementEnd':!0x0,'startPosition':_0x12ae46['createPositionAt'](_0x1d53c3,0x0)});for(const {item:_0x332cd5}of _0x31a5bd){if(!_0x332cd5['is']('$textProxy'))continue;const _0x199e36=_0x332cd5['parent'];if(!_0x199e36||!_0x199e36['is']('element'))continue;const _0x3792e2=this['_upsertDataId'](_0x199e36,()=>_0x57aa1f['_nextDataId'](_0x5df6d6));_0x5df6d6['add'](_0x3792e2);for(const _0x449a97 of _0x199e36['getChildren']())_0x449a97['is']('element')&&(_0x449a97['name']&&Ca['includes'](_0x449a97['name'])||_0x5df6d6['add'](this['_upsertDataId'](_0x449a97,()=>_0x57aa1f['_nextDataId'](_0x5df6d6))));let _0x5a752d=_0x199e36;for(;_0x5a752d['parent']&&!_0x5a752d['parent']['is']('documentFragment');)_0x5a752d=_0x5a752d['parent'],_0x5a752d['hasAttribute'](_0x33ffd6)&&_0x5a752d['_removeAttribute'](_0x33ffd6);_0x7018d9['set'](_0x3792e2,{'editor':_0xc0b538,'rootName':_0x52969d['rootName'],'path':_0x199e36['getPath'](),'documentVersion':_0x54728c,'getContent':this['_createGetContentUsingDataIdFn'](_0x5a752d['_clone'](!0x0),_0x3792e2,_0xc0b538['data'])}),_0x31a5bd['jumpTo'](_0x12ae46['createPositionAfter'](_0x199e36));}return{'content':_0xc0b538['data']['processor']['toData'](_0xc0b538['data']['toView'](_0x1d53c3)),'elements':_0x7018d9};}['diffContent'](_0x96c7fd,_0x243993,_0x324056,_0x3c602b=!0x1){const _0x1d0f49=[],_0x4f0e45=_0x96c7fd['data']['parse'](_0x324056,'$documentFragment'),_0x1bcadc=_0x96c7fd['data']['parse'](_0x243993,'$documentFragment'),_0x113f84=_0x96c7fd['model']['createPositionAt'](_0x1bcadc,0x0);if(this['_haveSingleTopLevelElement'](_0x4f0e45)){if(!this['_hasSameTopLevelElement'](_0x1bcadc,_0x4f0e45))return _0x1d0f49;}else{const _0x3d5bae=_0x96c7fd['model']['schema'];if(!this['_haveOnlyInlineContent'](_0x1bcadc,_0x3d5bae)||!this['_haveOnlyInlineContent'](_0x4f0e45,_0x3d5bae))return _0x1d0f49;}const _0x37e45f=this['context']['plugins']['get']('DocumentCompare')['getDiff'](_0x243993,_0x324056,{'targetEditor':_0x96c7fd,'anchor':_0x113f84,'markDeletions':!0x0})['getOperations']()['filter'](_0x95eb4=>'insert'===_0x95eb4['type']||'marker'===_0x95eb4['type']&&_0x95eb4['name']['startsWith']('$markedRemove')),_0x182cc4=this['_groupAdjacentOperations'](_0x37e45f),_0x431a32=[];if(_0x3c602b){if(_0x182cc4['length']){const _0x184c83=_0x182cc4[0x0]['operations'][0x0],_0x5113aa='insert'===_0x184c83['type']?_0x184c83['position']:_0x184c83['newRange']['start'],_0x1a4775=this['_getPositionLimitingRange'](_0x5113aa,_0x96c7fd,'inside'),_0x24f7c1=_0x1a4775?_0x4f0e45['getChild'](0x0)['getChildren']():_0x4f0e45['getChildren'](),_0x38501d=_0x1a4775||_0x96c7fd['model']['createRangeIn'](_0x1bcadc),_0x34446a=[new _0x44ffc1('$markedRemove:synthetic'+ot(),null,_0x38501d,_0x96c7fd['model']['document']['model']['markers'],!0x0,_0x96c7fd['model']['document']['version']+0x1),new _0x5b3c73(_0x38501d['end'],_0x24f7c1,_0x96c7fd['model']['document']['version']+0x2)];_0x431a32['push']({'operations':_0x34446a,'operationsIsolated':_0x34446a,'groupOffset':0x0});}}else _0x431a32['push'](..._0x182cc4);let _0x39445c=0x0;return _0x96c7fd['model']['change'](_0x184135=>{for(let _0x1bfe92=0x0;_0x1bfe92<_0x431a32['length'];_0x1bfe92++){const _0x374ea7=_0x431a32[_0x1bfe92],_0x57f01d=_0x184135['createDocumentFragment']();for(const _0x94befb of _0x1bcadc['getChildren']())_0x184135['append'](_0x94befb['_clone'](!0x0),_0x57f01d);for(const _0x5c9daa of _0x374ea7['operationsIsolated'])if('insert'===_0x5c9daa['type']){const _0x8b9e12=_0x5c9daa;_0x8b9e12['baseVersion']=null,_0x8b9e12['isDocumentOperation']=!0x1,this['_changeOperationOwnerDocument'](_0x8b9e12,_0x57f01d),_0x184135['batch']['addOperation'](_0x5c9daa),_0x96c7fd['model']['applyOperation'](_0x5c9daa);const _0x1addea='suggestion:insertion:id:authorId:'+_0x39445c++,_0x1d8419=_0x96c7fd['model']['createRange'](_0x8b9e12['position'],_0x8b9e12['position']['getShiftedBy'](_0x8b9e12['howMany']));_0x57f01d['markers']['set'](_0x1addea,_0x1d8419);}else{if('marker'===_0x5c9daa['type']&&_0x5c9daa['name']['startsWith']('$markedRemove')){const _0xae0847=_0x5c9daa,_0x10afb4='suggestion:deletion:id:authorId:'+_0x39445c++;this['_changeOperationOwnerDocument'](_0xae0847,_0x57f01d),_0x57f01d['markers']['set'](_0x10afb4,_0xae0847['newRange']);}}if(_0x3c602b)_0x1d0f49['push']({..._0x374ea7,'context':this['_createGetContentFn'](_0x1bcadc,_0x96c7fd['data']),'content':this['_createGetContentFn'](_0x1bcadc,_0x96c7fd['data'])});else{const _0x3a2ae8=this['_getChangeContext'](this['_changePositionOwnerDocument'](this['_getOperationStart'](_0x374ea7['operationsIsolated'][0x0]),_0x57f01d),this['_changePositionOwnerDocument'](this['_getOperationEnd'](_0x374ea7['operationsIsolated'][_0x374ea7['operationsIsolated']['length']-0x1]),_0x57f01d),_0x96c7fd);_0x57f01d['markers']['set'](Ta+'suggestion-context',new _0x2264dd(_0x3a2ae8['start'],_0x3a2ae8['end'])),_0x1d0f49['push']({..._0x374ea7,'context':this['_createGetContextFn'](_0x57f01d,_0x96c7fd['data'],{'ellipsisBefore':_0x3a2ae8['hasContentBefore'],'ellipsisAfter':_0x3a2ae8['hasContentAfter']}),'content':this['_createGetContentFn'](_0x57f01d,_0x96c7fd['data'])});}}}),_0x1d0f49;}['markChangePositionInEditorContent'](_0x37fd58,_0x32dd57){if(!_0x37fd58['length'])return;const _0x10c7e3=_0x37fd58[0x0]['parent']['id'],_0x574c1b=_0x32dd57['elements']['get'](_0x10c7e3);if(!_0x574c1b)return void console['warn']('No\x20element\x20found\x20for\x20ID:\x20'+_0x10c7e3);const _0x4c7f5e=_0x574c1b['path'],_0x4fdac4=_0x574c1b['editor'],_0x89b17=_0x4fdac4['model']['document']['getRoot'](_0x574c1b['rootName']);if(!_0x89b17)return void console['warn']('No\x20model\x20root\x20found\x20for\x20name:\x20'+_0x574c1b['rootName']);const _0x301afc=_0x4fdac4['model']['document']['history']['getOperations'](_0x574c1b['documentVersion']),_0x25b89f=[];for(const _0x46edcd of _0x37fd58){const _0x1cfe7e=_0x46edcd['operationsIsolated']['map'](_0x50207b=>this['_translateOperationToEditorContent'](_0x50207b,_0x4c7f5e,_0x89b17));if(!_0x1cfe7e||!_0x1cfe7e['length'])continue;const _0x47fc56=_0x1cfe7e['every'](_0x5d4820=>'marker'===_0x5d4820['type']&&_0x5d4820['name']['startsWith']('$markedRemove')),_0x1771a8={'document':_0x4fdac4['model']['document'],'useRelations':!0x1,'padWithNoOps':!0x1},_0x3e569c=_0x3a354d(_0x1cfe7e,_0x301afc,_0x1771a8)['operationsA'];for(const _0x55213e of _0x3e569c)if('insert'===_0x55213e['type']){const _0x5dbaf6=_0x55213e,_0x23c187=_0x5dbaf6['nodes'];_0x4fdac4['model']['change'](_0x17ccd0=>{const _0x1c6d55=_0x17ccd0['createDocumentFragment']();for(const _0x5b2dde of _0x23c187)_0x17ccd0['append'](_0x5b2dde['_clone'](!0x0),_0x1c6d55);_0x25b89f['push']({'start':_0x5dbaf6['position'],'end':_0x5dbaf6['position'],'type':'insert','groupId':_0x46edcd['id'],'content':{'asString':this['_createGetContentFn'](_0x1c6d55,_0x4fdac4['data'])(),'asFragment':_0x1c6d55}});});}else{if('marker'===_0x55213e['type']&&_0x55213e['name']['startsWith']('$markedRemove')){const _0x1e0501=_0x55213e;let _0x1769ce='remove-text';if(_0x47fc56){const _0x48b849=this['_findAdjacentContextDistance'](_0x1e0501['newRange']['start'],'backward',_0x4fdac4['model']['schema']),_0x43423d=this['_findAdjacentContextDistance'](_0x1e0501['newRange']['end'],'forward',_0x4fdac4['model']['schema']);if(_0x48b849||_0x43423d){const _0x1eb320=_0x1e0501['newRange']['start']['getShiftedBy'](-_0x48b849),_0x5e7ab3=_0x1e0501['newRange']['end']['getShiftedBy'](_0x43423d);_0x25b89f['push']({'start':_0x1eb320,'end':_0x5e7ab3,'groupId':_0x46edcd['id'],'type':'remove-context'});}else _0x1769ce='remove-only';}_0x25b89f['push']({'start':_0x1e0501['newRange']['start'],'end':_0x1e0501['newRange']['end'],'groupId':_0x46edcd['id'],'type':_0x1769ce});}}}this['_insertMarkers'](_0x25b89f,_0x4fdac4);}['clearAllMarkers'](){const _0x3260fb=new Map();for(const _0x3c8988 of this['_markers']['keys']()){const _0x2d643c=this['_markers']['get'](_0x3c8988);_0x2d643c?.['editor']&&(_0x3260fb['has'](_0x2d643c['editor'])||_0x3260fb['set'](_0x2d643c['editor'],[]),_0x3260fb['get'](_0x2d643c['editor'])['push'](_0x3c8988));}for(const [_0x440bc6,_0xf6e0f5]of _0x3260fb)_0x440bc6['model']['change'](_0x1ee87d=>{for(const _0x504f96 of _0xf6e0f5)_0x440bc6['model']['markers']['get'](_0x504f96)&&_0x1ee87d['removeMarker'](_0x504f96);});this['_markers']['clear'](),this['_activeMarkers']['clear']();}['switchToReadOnly'](){for(const _0x217b9b of Ws(this['context']))_0x217b9b['enableReadOnlyMode']('ai-review');}['switchToEdit'](){for(const _0xd53a90 of Ws(this['context']))_0xd53a90['disableReadOnlyMode']('ai-review');}['applyChange'](_0x10472b){const _0x4e9239=_0x10472b['map'](_0x6f7f2c=>this['_getMarkersDataForGroup'](_0x6f7f2c))['flat'](),_0x5987e1=new Map();for(const _0x5efc75 of _0x4e9239)_0x5987e1['has'](_0x5efc75['editor'])||_0x5987e1['set'](_0x5efc75['editor'],[]),_0x5987e1['get'](_0x5efc75['editor'])['push'](_0x5efc75);for(const [_0x19fa32,_0x43eb1c]of _0x5987e1){const _0x5d50c3=_0x19fa32['model'];_0x5d50c3['change'](_0x246d58=>{for(const _0x9af672 of _0x43eb1c){const _0x52beab=_0x19fa32['model']['markers']['get'](_0x9af672['id']);if(_0x52beab){if('insert'===_0x9af672['type']){if(!_0x9af672['content'])continue;_0x5d50c3['insertContent'](_0x9af672['content']['asFragment']||null,_0x52beab['getRange']()['start']);}else'remove-text'!==_0x9af672['type']&&'remove-only'!==_0x9af672['type']||_0x5d50c3['deleteContent'](_0x5d50c3['createSelection'](_0x52beab['getRange']()));_0x246d58['removeMarker'](_0x9af672['id']),this['_markers']['delete'](_0x9af672['id']);}}});}}['rejectChange'](_0x2d06ae){const _0x57ccad=this['_getMarkersDataForGroup'](_0x2d06ae),_0x46d6c4=new Map();for(const _0x49391d of _0x57ccad)_0x46d6c4['has'](_0x49391d['editor'])||_0x46d6c4['set'](_0x49391d['editor'],[]),_0x46d6c4['get'](_0x49391d['editor'])['push'](_0x49391d);for(const [_0xed4045,_0x36be02]of _0x46d6c4)_0xed4045['model']['change'](_0x13cfed=>{for(const _0x7cffa6 of _0x36be02)_0x13cfed['removeMarker'](_0x7cffa6['id']),this['_markers']['delete'](_0x7cffa6['id']);});}['getEditor'](){return $s(this['context']);}['getEditors'](){return Ws(this['context']);}['getEditorForChange'](_0x2dfdd5){const _0xe05995=this['_getMarkersDataForGroup'](_0x2dfdd5);return _0xe05995[0x0]?.['editor'];}['getMarkerElementForChange'](_0x24d6bc){const _0x462b43=Array['from'](this['_markers']['values']())['filter'](_0x4ecb65=>_0x4ecb65['groupId']===_0x24d6bc);if(!_0x462b43['length'])return null;const _0x332453=0x1===_0x462b43['length']?_0x462b43[0x0]:this['_sortMarkers'](_0x462b43)[0x0],_0x9fd89c=_0x332453['editor']['model']['markers']['get'](_0x332453['id']);if(!_0x9fd89c)return null;return{'modelRange':_0x9fd89c['getRange'](),'getElement':()=>this['_findMarkerElementById'](_0x332453['id'])};}['getContentElementForChange'](_0x17e003){const _0x1547ac=Array['from'](this['_markers']['values']())['filter'](_0x34dfcb=>_0x34dfcb['groupId']===_0x17e003);if(!_0x1547ac['length'])return null;const _0x9b1390=0x1===_0x1547ac['length']?_0x1547ac[0x0]:this['_sortMarkers'](_0x1547ac)[0x0],_0xdd13a0=_0x9b1390['editor'],_0x58fd1d=_0xdd13a0['model']['markers']['get'](_0x9b1390['id']);if(!_0x58fd1d)return null;const _0x1e620e=_0x58fd1d['getRange'](),_0x1e3a7e=_0xdd13a0['editing']['view']['getDomRoot'](_0x1e620e['root']['rootName'])||_0xdd13a0['editing']['view']['getDomRoot']();if(!_0x1e3a7e||!_0x1e620e)return null;let _0x1bea11=_0x1e620e['start']['parent'];for(;_0x1bea11['parent']&&'$root'!==_0x1bea11['parent']['name'];)_0x1bea11=_0x1bea11['parent'];if(!_0x1bea11||!_0x1bea11['name'])return null;const _0x661626=_0x1e3a7e['querySelector']('[data-marker-id=\x22'+_0x9b1390['id']+'\x22]');if(!_0x661626)return null;let _0x2e1818=null;_0xdd13a0['model']['change'](_0x500b96=>{_0x2e1818=_0x500b96['createDocumentFragment'](),_0x500b96['append'](_0x1bea11['_clone'](!0x0),_0x2e1818);});const _0x4dcbe7=_0xdd13a0['data']['toView'](_0x2e1818)['getChild'](0x0);return _0x661626['closest'](_0x4dcbe7['name']);}['reactivateMarkers'](_0x5ca792){const _0x233827=this['_getMarkersDataForGroup'](_0x5ca792);if(!_0x233827['length'])return;const _0x13b4cb=Array['from'](this['_activeMarkers'])['sort'](),_0x38dc0c=Array['from'](new Set(_0x233827['map'](_0x1adcb1=>_0x1adcb1['id'])))['sort']();_0x13b4cb['join']('|')!==_0x38dc0c['join']('|')&&(this['setAllMarkersAsInactive'](),this['setMarkersInElementAsActive'](_0x5ca792));}['setMarkersInElementAsActive'](_0x41c685){const _0x39b425=this['_getMarkersDataForGroup'](_0x41c685);if(!_0x39b425['length'])return;const _0x3b33e1=_0x39b425[0x0]['editor'],_0x3dee11=new Set(_0x39b425['map'](_0x408587=>_0x408587['id'])),_0x5d9c5c=Array['from'](_0x3dee11['values']())['map'](_0x3fc047=>_0x3b33e1['model']['markers']['get'](_0x3fc047))['filter'](_0x5cc4c8=>!!_0x5cc4c8);_0x3dee11['forEach'](_0x3890a5=>{this['_activeMarkers']['add'](_0x3890a5);}),_0x3b33e1['model']['change'](()=>{_0x5d9c5c['forEach'](_0x52b504=>{_0x3b33e1['editing']['reconvertMarker'](_0x52b504);});});}['setAllMarkersAsInactive'](){const _0x53b180=Array['from'](this['_activeMarkers']);if(!_0x53b180['length'])return;this['_activeMarkers']['clear']();const _0x4a3a7a=new Map();for(const _0x563e39 of _0x53b180){const _0x372179=this['_markers']['get'](_0x563e39);if(!_0x372179)continue;const _0xd31b03=_0x372179['editor'],_0x193f9c=_0xd31b03['model']['markers']['get'](_0x563e39);_0x193f9c&&(_0x4a3a7a['has'](_0xd31b03)||_0x4a3a7a['set'](_0xd31b03,[]),_0x4a3a7a['get'](_0xd31b03)['push'](_0x193f9c));}for(const [_0x307806,_0x287db9]of _0x4a3a7a)_0x307806['model']['change'](()=>{_0x287db9['forEach'](_0x592a2e=>{_0x307806['editing']['reconvertMarker'](_0x592a2e);});});}['_getPositionLimitingRange'](_0x4092cb,_0xa06583,_0x2d0396='outside'){if(!_0x4092cb)return null;let _0x2c696a=_0x4092cb['parent'];for(;_0x2c696a&&_0x2c696a['parent']&&'$root'!==_0x2c696a['parent']['name']&&!_0xa06583['model']['schema']['isLimit'](_0x2c696a)&&!_0xa06583['model']['schema']['isBlock'](_0x2c696a);)_0x2c696a=_0x2c696a['parent'];if(!_0x2c696a||!_0x2c696a['name']||'$root'===_0x2c696a['name'])return null;let _0x2631e5=null;return _0xa06583['model']['change'](_0xc02555=>{_0x2631e5='inside'===_0x2d0396?_0xc02555['createRangeIn'](_0x2c696a):_0xc02555['createRangeOn'](_0x2c696a);}),_0x2631e5;}['_validateMarkers'](_0x2eb9c3,_0x252243){const _0x514956=Array['from'](this['_markers']['keys']()),_0x37f712=new Map();for(const _0x1da657 of _0x514956){const _0x45ffa8=_0x2eb9c3['model']['markers']['get'](_0x1da657);if(!_0x45ffa8)continue;const _0x34da21=_0x45ffa8['getStart']()['root']['rootName']+':'+_0x45ffa8['getStart']()['path'][0x0];_0x37f712['has'](_0x34da21)||_0x37f712['set'](_0x34da21,[]),_0x37f712['get'](_0x34da21)['push'](_0x45ffa8);}const _0x350f90=new Set();for(const _0x752f3b of _0x2eb9c3['model']['document']['differ']['getChanges']()){let _0x2449a7='',_0x115e61=null;if('insert'===_0x752f3b['type'])_0x115e61=new _0x2264dd(_0x752f3b['position'],_0x752f3b['position']['getShiftedBy'](_0x752f3b['length'])),_0x2449a7=_0x752f3b['position']['root']['rootName']+':'+_0x752f3b['position']['path'][0x0];else{if('remove'!==_0x752f3b['type'])continue;_0x115e61=new _0x2264dd(_0x752f3b['position']),_0x2449a7=_0x752f3b['position']['root']['rootName']+':'+_0x752f3b['position']['path'][0x0];}const _0x4c6f08=_0x37f712['get'](_0x2449a7)||[];if(_0x4c6f08['length']){for(const _0x3b89bf of _0x4c6f08)if(_0x115e61['root']['rootName']===_0x3b89bf['getRange']()['root']['rootName']&&('insert'!==_0x752f3b['type']||!_0x115e61['containsRange'](_0x3b89bf['getRange']()))&&(_0x115e61['isIntersecting'](_0x3b89bf['getRange']())||_0x115e61['start']['isTouching'](_0x3b89bf['getRange']()['end'])||_0x115e61['end']['isTouching'](_0x3b89bf['getRange']()['start']))){const _0x3ca50b=this['_parseMarkerName'](_0x3b89bf['name']);Array['from'](this['_markers']['values']())['filter'](_0x197016=>_0x197016['groupId']===_0x3ca50b['groupId'])['forEach'](_0x533db6=>_0x350f90['add'](_0x533db6['id']));}}}if(_0x350f90['size']){for(const _0xb1b74c of _0x350f90)_0x252243['removeMarker'](_0xb1b74c);return!0x0;}return!0x1;}['_handleMarkerChanges'](_0x3aec6e){for(const {name:_0x21aa5d,data:_0x2ff08f}of _0x3aec6e['model']['document']['differ']['getChangedMarkers']()){if(!_0x21aa5d['startsWith'](Ta))continue;const _0x899dca=_0x2ff08f['oldRange'],_0x29e747=_0x2ff08f['newRange'],_0xb6a719=_0x899dca&&'$graveyard'===_0x899dca['root']['rootName'],_0x496221=_0x29e747&&'$graveyard'===_0x29e747['root']['rootName'];if(_0xb6a719&&_0x496221)continue;const _0x378211=this['_parseMarkerName'](_0x21aa5d);this['_markers']['get'](_0x21aa5d)&&(_0x496221||!_0x29e747?this['_eventEmitter']['fire']('changeMarkerRemoved',{'markerId':_0x21aa5d,'changeId':_0x378211['groupId']}):_0xb6a719&&_0x29e747&&this['_eventEmitter']['fire']('changeMarkerRestored',{'markerId':_0x21aa5d,'changeId':_0x378211['groupId']}));}}['_parseMarkerName'](_0x4bcd12){const _0x132011=_0x4bcd12['split'](':'),_0x32ef7b=(_0x132011[0x1]||'')['split']('_');return{'prefix':_0x132011[0x0],'groupId':_0x32ef7b[0x0],'suffix':_0x32ef7b[0x1]};}['_translateOperationToEditorContent'](_0x4586e7,_0x826cdc,_0x1a5c28){if('insert'===_0x4586e7['type']){const _0x47c9f=_0x4586e7;return new _0x5b3c73(this['_changePosition'](_0x826cdc['concat'](_0x47c9f['position']['offset']),_0x1a5c28),_0x47c9f['nodes'],_0x47c9f['baseVersion']);}if('marker'===_0x4586e7['type']&&_0x4586e7['name']['startsWith']('$markedRemove')){const _0x58237c=_0x4586e7;return new _0x44ffc1(_0x58237c['name'],_0x58237c['oldRange'],this['_changeRange'](_0x58237c['newRange'],_0x826cdc['concat'](_0x58237c['newRange']['start']['offset']),_0x826cdc['concat'](_0x58237c['newRange']['end']['offset']),_0x1a5c28),_0x58237c['_markers'],_0x58237c['affectsData'],_0x58237c['baseVersion']);}return _0x4586e7;}['_groupAdjacentOperations'](_0x377f1b){if(!_0x377f1b['length'])return[];const _0xdab51f=[];let _0x2d150c=0x0,_0x3028f5=0x0,_0x301ff2=[];for(let _0x542cd2=0x0;_0x542cd2<=_0x377f1b['length'];_0x542cd2++){const _0x22a4ed=_0x377f1b[_0x542cd2],_0x573667=_0x377f1b[_0x542cd2-0x1];!_0x22a4ed||_0x573667&&!this['_getOperationEnd'](_0x573667)['isTouching'](this['_getOperationStart'](_0x22a4ed))?(_0xdab51f['push']({'operations':_0x301ff2,'operationsIsolated':_0x301ff2['map'](_0x21aa18=>this['_shiftOperation'](_0x21aa18['clone'](),-_0x3028f5)),'groupOffset':_0x2d150c}),_0x301ff2=_0x22a4ed?[_0x22a4ed]:[],_0x3028f5+=_0x2d150c,_0x2d150c=0x0):_0x301ff2['push'](_0x22a4ed),_0x22a4ed&&'insert'===_0x22a4ed['type']&&(_0x2d150c+=_0x22a4ed['howMany']);}return _0xdab51f;}['_findAdjacentContextDistance'](_0x2cb4a9,_0x258d25,_0x39f80c,_0x1afc2a=0x1){const _0x804af3=new _0x3e9906({'startPosition':_0x2cb4a9,'direction':_0x258d25});let _0x2487b1=0x0;for(let _0x31e311=0x0;_0x31e311<_0x1afc2a;_0x31e311++){let _0x352d00=0x0,_0x362981=!0x1,_0x1260c7='forward'===_0x258d25?/^\W*\w+/:/\w+\W*$/;for(const {item:_0x3a891b}of _0x804af3)if(_0x3a891b['is']('$textProxy')){const _0x5ef2cf=_0x1260c7['exec'](_0x3a891b['data']);if(_0x5ef2cf&&_0x5ef2cf['length']){if(_0x352d00+='forward'===_0x258d25?_0x5ef2cf['index']+_0x5ef2cf[0x0]['length']:_0x3a891b['data']['length']-_0x5ef2cf['index'],_0x5ef2cf[0x0]['length']!==_0x3a891b['data']['length'])break;_0x362981=!0x0,_0x1260c7='forward'===_0x258d25?/^\w+/:/\w+$/;}else{if(_0x362981)break;_0x352d00+=_0x3a891b['offsetSize'];}}else{if(_0x3a891b['is']('element')){_0x39f80c['isInline'](_0x3a891b)&&!_0x362981&&(_0x352d00+=0x1);break;}}_0x2487b1+=_0x352d00,_0x804af3['jumpTo'](_0x2cb4a9['getShiftedBy']('forward'===_0x258d25?_0x2487b1:-_0x2487b1));}return _0x2487b1;}['_getChangeContext'](_0x3f4ab2,_0x9d2f1d,_0xd3b510){const _0xb63454=_0xd3b510['model']['schema'],_0x22a0ac=this['_findAdjacentContextDistance'](_0x3f4ab2,'backward',_0xb63454,0x6),_0x18b7cc=this['_findAdjacentContextDistance'](_0x9d2f1d,'forward',_0xb63454,0x6),_0x251042=_0x3f4ab2['getShiftedBy'](-_0x22a0ac),_0x518940=_0x9d2f1d['getShiftedBy'](_0x18b7cc);return{'start':_0x251042,'end':_0x518940,'hasContentBefore':!_0x251042['isAtStart'],'hasContentAfter':!_0x518940['isAtEnd']};}['_insertMarkers'](_0x573e9e,_0x3384a5){const _0x29e801=this['context']['plugins']['get']('AIEditing'),_0x2acdb9=new Set();_0x3384a5['model']['change'](_0x3dd22d=>{for(const _0x42aa70 of _0x573e9e){const _0x3a0376=''+Ta+_0x42aa70['type']+':'+_0x42aa70['groupId']+'_'+_0x29e801['_nextDataId'](_0x2acdb9);this['_markers']['set'](_0x3a0376,{'id':_0x3a0376,'groupId':_0x42aa70['groupId'],'type':_0x42aa70['type'],'content':_0x42aa70['content'],'editor':_0x3384a5}),_0x3dd22d['addMarker'](_0x3a0376,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x3dd22d['createRange'](_0x42aa70['start'],_0x42aa70['end'])});}});}['_createGetContextFn'](_0x4b9d53,_0x1d7690,_0x1cfbdd){let _0x376c86='';return()=>{if(!_0x376c86){const _0x46b026=_0x1d7690['toView'](_0x4b9d53,{'showSuggestionHighlights':!0x0});let _0x16ac41=_0x46b026['getChild'](0x0);if(_0x16ac41['is']('containerElement')||(_0x16ac41=_0x46b026),!_0x16ac41)return'';let _0x43c0ea=!0x1;const _0x4f07d7=[];for(const _0xf40c78 of _0x16ac41['getChildren']())_0xf40c78['is']('element','span')&&_0xf40c78['hasClass']('ck-ai_review-marker_context-end')&&(_0x43c0ea=!0x1),_0x43c0ea&&_0x4f07d7['push'](_0xf40c78),_0xf40c78['is']('element','span')&&_0xf40c78['hasClass']('ck-ai_review-marker_context-start')&&(_0x43c0ea=!0x0);_0x16ac41['_removeChildren'](0x0,_0x16ac41['childCount']),_0x1cfbdd?.['ellipsisBefore']&&_0x16ac41['_appendChild']('…'),_0x16ac41['_appendChild'](_0x4f07d7),_0x1cfbdd?.['ellipsisAfter']&&_0x16ac41['_appendChild']('…');const _0x20ae55=_0x1d7690['htmlProcessor']['domConverter']['viewToDom'](_0x46b026),_0x4f6fe4=_0x1d7690['htmlProcessor']['htmlWriter']['getHtml'](_0x20ae55);_0x376c86=_0x4f6fe4;}return _0x376c86;};}['_createGetContentFn'](_0x5dc38c,_0x31a092){let _0x296071='';return()=>(_0x296071||(_0x296071=_0x31a092['stringify'](_0x5dc38c,{'showSuggestionHighlights':!0x0})),_0x296071);}['_createGetContentUsingDataIdFn'](_0x553bc5,_0x2b2530,_0x4b4bb5){let _0x54aa6d='';return()=>{if(!_0x54aa6d){const _0x40f87e=_0x4b4bb5['toView'](new _0x5874c7(_0x553bc5)),_0x3db986=_0x4b4bb5['htmlProcessor']['domConverter']['viewToDom'](_0x40f87e)['querySelector']('[data-id=\x22'+_0x2b2530+'\x22]');_0x54aa6d=_0x3db986?.['outerHTML']||'';}return _0x54aa6d;};}['_findMarkerElement'](_0x28a9cb,_0x1ce89e=0x5){let _0x128856=_0x28a9cb,_0x4267c2=null;for(let _0x4a6b4f=0x0;_0x4a6b4f<_0x1ce89e&&_0x128856;_0x4a6b4f++){if(!_0x128856['className']){_0x128856=_0x128856['parentElement'];continue;}if(!(''+_0x128856['className'])['includes']('ck-ai_review-marker_')){_0x128856=_0x128856['parentElement'];continue;}if(!_0x128856['getAttribute']('data-marker-id'))break;_0x4267c2=_0x128856;break;}return _0x4267c2;}['_findMarkerElementById'](_0x38f68c){const _0x3fda5b=this['_markers']['get'](_0x38f68c),_0x740ab7=_0x3fda5b?.['editor']??$s(this['context']),_0x18931f=_0x740ab7['model']['markers']['get'](_0x38f68c);return _0x18931f?_0x12653e(_0x740ab7['editing'],_0x18931f):null;}['_getMarkersDataForGroup'](_0x2e6fca){return Array['from'](this['_markers']['values']())['filter'](_0x31f281=>_0x31f281['groupId']===_0x2e6fca);}['_getOperationStart'](_0x78e26e){return'insert'===_0x78e26e['type']?_0x78e26e['position']:_0x78e26e['newRange']['start'];}['_getOperationEnd'](_0x47a0d8,_0x5bcf38=!0x1){return'insert'===_0x47a0d8['type']?_0x5bcf38?_0x47a0d8['position']:_0x47a0d8['position']['getShiftedBy'](_0x47a0d8['howMany']):_0x47a0d8['newRange']['end'];}['_shiftOperation'](_0xca9b8f,_0x5c2b79){return'insert'===_0xca9b8f['type']?_0xca9b8f['position']=_0xca9b8f['position']['getShiftedBy'](_0x5c2b79):'marker'===_0xca9b8f['type']&&_0xca9b8f['newRange']&&(_0xca9b8f['newRange']=new _0x2264dd(_0xca9b8f['newRange']['start']['getShiftedBy'](_0x5c2b79),_0xca9b8f['newRange']['end']['getShiftedBy'](_0x5c2b79))),_0xca9b8f;}['_changeOperationOwnerDocument'](_0x2bbbe3,_0x1126f2){'insert'===_0x2bbbe3['type']?_0x2bbbe3['position']=this['_changePositionOwnerDocument'](_0x2bbbe3['position'],_0x1126f2):'marker'===_0x2bbbe3['type']&&_0x2bbbe3['newRange']&&(_0x2bbbe3['newRange']=this['_changeRangeOwnerDocument'](_0x2bbbe3['newRange'],_0x1126f2));}['_changePositionOwnerDocument'](_0x3dbdea,_0xf8d857){return new _0x2c4a91(_0xf8d857,_0x3dbdea['path']);}['_changeRangeOwnerDocument'](_0xa8dc97,_0x5a5e74){return new _0x2264dd(this['_changePositionOwnerDocument'](_0xa8dc97['start'],_0x5a5e74),this['_changePositionOwnerDocument'](_0xa8dc97['end'],_0x5a5e74));}['_changePosition'](_0x15f3c6,_0x5e09ca){return new _0x2c4a91(_0x5e09ca,[..._0x15f3c6]);}['_changeRange'](_0xaefb1d,_0x8eeb0f,_0x172ec7,_0x5c51d7){return new _0x2264dd(this['_changePosition'](_0x8eeb0f,_0x5c51d7),this['_changePosition'](_0x172ec7,_0x5c51d7));}['_sortMarkers'](_0x2ec6d6){const _0x5c3df4=_0x34ba1a=>{switch(_0x34ba1a){case'insert':return 0x0;case'remove-context':return 0x1;case'remove-only':return 0x2;case'remove-text':return 0x3;}};return _0x2ec6d6['sort']((_0x58676f,_0x4cb325)=>_0x5c3df4(_0x58676f['type'])-_0x5c3df4(_0x4cb325['type']));}['_hasSameTopLevelElement'](_0x1f73f8,_0x5dbf70){const _0x39e807=_0x1f73f8['getChild'](0x0),_0x16d759=_0x5dbf70['getChild'](0x0);return!(!_0x39e807||!_0x16d759)&&((!_0x39e807['is']('element')||!_0x16d759['is']('element')||_0x39e807['name']===_0x16d759['name'])&&!(_0x39e807['is']('element')&&!_0x16d759['is']('element')||!_0x39e807['is']('element')&&_0x16d759['is']('element')));}['_haveSingleTopLevelElement'](_0x3130e0){return 0x1===_0x3130e0['childCount'];}['_haveOnlyInlineContent'](_0x1e63d9,_0xfdd579){for(const _0x1cbf05 of _0x1e63d9['getChildren']())if(_0x1cbf05['is']('element')&&!_0xfdd579['isInline'](_0x1cbf05))return!0x1;return!0x0;}['_upsertDataId'](_0x542783,_0x338f52){let _0x33aa48=_0x542783['getAttribute'](_0x33ffd6);return _0x33aa48||(_0x33aa48=_0x338f52(),_0x542783['_setAttribute'](_0x33ffd6,_0x33aa48)),_0x33aa48;}}class fa extends Tt(){['id'];['contentNew'];['contentInitial'];['documentVersion'];constructor({id:_0x4cf91d,contentNew:_0x35276c,contentInitial:_0x40e46d,documentVersion:_0xb2f2ad}){super(),this['id']=_0x4cf91d,this['contentNew']=_0x35276c,this['contentInitial']=_0x40e46d,this['documentVersion']=_0xb2f2ad;}}class ba extends ht(){['id'];['parent'];['_data'];['_editorOperations']=[];constructor(_0x18ae5d,_0x85b8b2,_0x4227f1){super(),this['id']=_0x18ae5d,this['parent']=_0x4227f1,this['_data']=_0x85b8b2,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(_0x4998f0,_0x573ea8,_0x23a712,_0x3a8221,_0x486435){super(),this['_sourceCheck']=_0x573ea8,this['_documentData']=_0x4998f0,this['_aiConnector']=_0x23a712,this['_reviewParams']=_0x3a8221,this['_reviewArgs']=_0x486435,this['on']('change:status',(_0x57af59,_0x34759e,_0x2ce495)=>{'aborted'==_0x2ce495&&(this['_wasAborted']=!0x0),this['fire']('reviewCheckRunUpdated',{'status':_0x2ce495,'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'](_0x6cc06a=>'pending'===_0x6cc06a['status']);}get['currentError'](){return this['_currentError'];}['updateDocumentData'](_0x24add2){this['_documentData']=_0x24add2;}async['start'](){this['status']='loading',this['_currentError']=void 0x0;try{this['_activeRequest']=this['_createApiRequest']();const _0x2a78ac=await this['_activeRequest']['getStream']();this['status']='data';for await(const _0x48e059 of _0x2a78ac)'unmodified'!==_0x48e059['data']['operation']&&('error'!==_0x48e059['data']['operation']?'review-metadata'!==_0x48e059['event']?this['_addReviewCheckResult'](_0x48e059['data']['dataId'],_0x48e059['data']['textDelta']):this['callId']=_0x48e059['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(_0x4ab7f9){this['_currentError']=_0x4ab7f9,_0x4ab7f9 instanceof Error&&_0x4ab7f9['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'](_0x1259b0,_0x2b5cca){const _0x1028b6=this['_results']['get'](_0x1259b0);if(!_0x1028b6)return;if(0x0===_0x2b5cca['length'])return;const _0x51d062=[];_0x2b5cca['forEach']((_0xb0d10a,_0x5ca7d8)=>{const _0x4a69ec=new ba(_0x1028b6['id']+'-'+_0x5ca7d8,_0xb0d10a,_0x1028b6);_0x4a69ec['on']('change:status',()=>{this['fire']('reviewCheckResultChangeStatusUpdated',{'change':_0x4a69ec,'status':_0x4a69ec['status']});}),_0x4a69ec['on']('change:isActivated',()=>{_0x4a69ec['isActivated']?this['fire']('reviewCheckResultActivated',{'change':_0x4a69ec}):this['fire']('reviewCheckResultDeactivated',{'change':_0x4a69ec});}),this['_changes']['push'](_0x4a69ec),_0x51d062['push'](_0x4a69ec);}),this['fire']('reviewCheckResultReady',{'changes':_0x51d062,'result':_0x1028b6,'source':this});}['abort'](){this['_activeRequest']&&(this['_activeRequest']['abortController']['abort'](),this['_activeRequest']=null,this['status']='aborted');}['isChangeActive'](_0x5ec1ef){const _0x5d9ffa=this['_changes']['find'](_0x146a28=>_0x146a28['id']===_0x5ec1ef);return!(!_0x5d9ffa||'pending'!==_0x5d9ffa['status']);}['isAnyChangeActivated'](){return this['_changes']['some'](_0x46eafa=>!0x0===_0x46eafa['isActivated']);}['getActiveChanges'](){return this['_changes']['filter'](_0x250857=>'pending'===_0x250857['status']);}['getChangeById'](_0x5fc929){return this['_changes']['find'](_0x47803c=>_0x47803c['id']===_0x5fc929);}['markAllChangesAsAccepted'](){for(const _0x29e6f8 of this['_changes'])'pending'===_0x29e6f8['status']&&(_0x29e6f8['status']='accepted');this['_checkIfFinished']();}['markChangeAsAccepted'](_0x35b2d){const _0x33072e=this['_changes']['find'](_0x2bd2d3=>_0x2bd2d3['id']===_0x35b2d);_0x33072e&&'pending'===_0x33072e['status']&&(_0x33072e['status']='accepted'),this['_checkIfFinished']();}['markChangeAsRejected'](_0x47ca7e){const _0x1e4909=this['_changes']['find'](_0x568fb5=>_0x568fb5['id']===_0x47ca7e);_0x1e4909&&'pending'===_0x1e4909['status']&&(_0x1e4909['status']='rejected'),this['_checkIfFinished']();}['markChangeAsOutdated'](_0x5912a5){const _0x502d48=this['_changes']['find'](_0x30a9ba=>_0x30a9ba['id']===_0x5912a5);_0x502d48&&'pending'===_0x502d48['status']&&(_0x502d48['status']='outdated'),this['_checkIfFinished']();}['markChangeAsPending'](_0x1d9059){const _0x41a670=this['_changes']['find'](_0x47d2e4=>_0x47d2e4['id']===_0x1d9059);_0x41a670&&'outdated'===_0x41a670['status']&&(_0x41a670['status']='pending'),this['_checkIfFinished']();}['activateChange'](_0x4e3d87){this['_changes']['filter'](_0xfc8f=>_0xfc8f['isActivated']&&_0xfc8f['id']!==_0x4e3d87)['forEach'](_0x234bfb=>{_0x234bfb['isActivated']=!0x1;});const _0x1f4f0a=this['_changes']['find'](_0x3bbbb5=>_0x3bbbb5['id']===_0x4e3d87);_0x1f4f0a&&'pending'===_0x1f4f0a['status']&&(_0x1f4f0a['isActivated']=!0x0);}['deactivateChange'](){this['_changes']['filter'](_0x5a67b3=>_0x5a67b3['isActivated'])['forEach'](_0x1963b0=>{_0x1963b0['isActivated']=!0x1;});}['forceReadyState'](){this['status']='ready';}async['sendRating'](_0x363223){if('initialized'===this['status']||'loading'===this['status']||'data'===this['status']||this['_wasAborted'])return;if(!this['callId']||0x0===this['_changes']['length'])return;let _0x39ff27;if(_0x363223){const _0x3c52b1=this['_changes']['find'](_0xa8560=>_0xa8560['id']===_0x363223);if(_0x3c52b1&&_0x3c52b1['isRated'])return;_0x3c52b1&&(_0x39ff27=_0x3c52b1['parent']['id'],_0x3c52b1['isRated']=!0x0);}const _0xfe8db2={'positiveCount':this['_changes']['filter'](_0x2132c1=>'accepted'===_0x2132c1['status'])['length'],'totalCount':this['_changes']['length']};this['_sendRatingRequest'](_0xfe8db2,this['callId'],_0x39ff27);}['_addReviewCheckResult'](_0x3fd212,_0x100110){const _0x53ced6=this['_documentData']['elements']['get'](_0x3fd212);if(!_0x53ced6)return;const _0x39a786=_0x53ced6['getContent']();if(_0x39a786===_0x100110)return;const _0xb068bc=new fa({'id':_0x3fd212,'contentInitial':_0x39a786,'contentNew':_0x100110,'documentVersion':_0x53ced6['documentVersion']});this['_results']['set'](_0xb068bc['id'],_0xb068bc),this['fire']('reviewCheckResultAdded',{'result':_0xb068bc,'source':this,'editor':_0x53ced6['editor']});}['_checkIfFinished'](){'finished'===this['status']&&(this['_changes']['filter'](_0x13b417=>'pending'===_0x13b417['status'])['length']>0x0&&(this['status']='ready')),'ready'===this['status']&&(0x0===this['_changes']['filter'](_0x4a763f=>'pending'===_0x4a763f['status'])['length']&&(this['status']='finished'));}}class Ra extends Sa{get['subTitle'](){if(!this['_reviewParams']||0x0===this['_reviewParams']['length'])return'';const _0x5b0692=[];if(this['_reviewParams']['length']>0x0&&this['_sourceCheck']['options'])for(let _0x61f52f=0x0;_0x61f52f<this['_reviewParams']['length'];_0x61f52f++){if(!this['_reviewParams'][_0x61f52f]||!this['_sourceCheck']['options'][_0x61f52f])continue;const _0x44147f=this['_sourceCheck']['options'][_0x61f52f],_0x4eb49b=_0x44147f['data']?.['find'](_0x1b00cc=>_0x1b00cc['id']===this['_reviewParams'][_0x61f52f]);_0x4eb49b&&_0x5b0692['push'](_0x4eb49b['label']);}return _0x5b0692['join'](',\x20');}get['reviewName'](){return this['_composeReviewName']();}['_createApiRequest'](){return this['_aiConnector']['callSystemReview']({'reviewName':this['_composeReviewName'](),'content':this['_documentData']['content'],'args':this['_reviewArgs']});}['_sendRatingRequest'](_0x4ee895,_0x55397a,_0x30de75){return this['_aiConnector']['upsertAIReviewRating'](this['reviewName'],_0x55397a,_0x4ee895,_0x30de75);}['_composeReviewName'](){return!this['_reviewParams']||0x0===this['_reviewParams']['length']||this['_sourceCheck']['useArgs']?this['_sourceCheck']['apiId']:[this['_sourceCheck']['apiId'],...this['_reviewParams']]['join']('-');}}class Oa extends _0x29a024{['_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(_0x12b503,_0x543cda)=>{const _0x322aba=this['_aiReviewCheckList']['getCheckById'](_0x543cda['id']);if(_0x322aba){this['_onReviewCheckRun'](_0x543cda),this['_aiReviewCoreEditing']['switchToReadOnly'](),this['_currentReviewCheckRun']=this['_createReviewCheckRun'](_0x543cda,_0x322aba),this['_aiReviewCoreUi']['setCheckResultTitle'](this['_currentReviewCheckRun']['title'],this['_currentReviewCheckRun']['subTitle']),this['_currentReviewCheckRun']['on']('reviewCheckRunUpdated',(_0x4e602e,_0x5d5f7d)=>{switch(_0x5d5f7d['status']){case'data':case'loading':this['_aiReviewCoreUi']['showCheckRunResults'](_0x5d5f7d);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'!==_0x5d5f7d['status']&&'error-chunk'!==_0x5d5f7d['status']&&'error-general'!==_0x5d5f7d['status']||this['_currentReviewCheckRun']?.['sendRating']();}),this['_currentReviewCheckRun']['on']('reviewCheckResultAdded',(_0x4dc800,_0x4826e2)=>{if(!this['_currentReviewCheckRun'])throw new at('ai-review-mode-no-current-check-run',this);const _0xe67bdc=this['_diffContent'](_0x4826e2['editor'],_0x4826e2['result']['contentInitial'],_0x4826e2['result']['contentNew']);_0x4826e2['source']['addResultChanges'](_0x4826e2['result']['id'],_0xe67bdc);}),this['_currentReviewCheckRun']['on']('reviewCheckResultReady',(_0x287d81,_0x4c3f26)=>{for(const _0x31944a of _0x4c3f26['changes'])this['_aiReviewCoreUi']['showCheckRunResult'](_0x31944a);this['_markChangePositionInEditorContent'](_0x4c3f26['changes'],_0x4c3f26['source']['documentData']);}),this['_currentReviewCheckRun']['on']('reviewCheckResultChangeStatusUpdated',(_0x4a2e27,_0x4e6781)=>{this['_aiReviewCoreUi']['updateChangeState'](_0x4e6781['change']['id'],_0x4e6781['status']);}),this['_currentReviewCheckRun']['on']('reviewCheckResultActivated',(_0x4bc994,_0x47ce7c)=>{this['_onReviewCheckResultActivated'](_0x47ce7c);}),this['_currentReviewCheckRun']['on']('reviewCheckResultDeactivated',()=>{this['_onReviewCheckResultDeactivated']();});try{await this['_currentReviewCheckRun']['start']();}catch(_0xb32646){_0xb32646 instanceof Error&&_0xb32646['message']['includes']('ai-request-aborted')||(_0xb32646 instanceof at?this['_logError'](_0xb32646):this['_logError'](new at('ai-review-mode-check-run-failed',this,void 0x0,_0xb32646)));}}else this['_logError'](new at('ai-review-mode-source-check-not-found',this,{'checkId':_0x543cda['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 _0xb84ab9=this['_currentReviewCheckRun']['getActiveChanges']();if(!_0xb84ab9['length'])return;this['_aiReviewCoreEditing']['applyChange'](_0xb84ab9['map'](_0x5ae074=>_0x5ae074['id']));const _0x35e66e=this['_currentReviewCheckRun'];_0x35e66e['markAllChangesAsAccepted'](),_0x35e66e['sendRating']();}),this['listenTo'](this['_aiReviewCoreUi'],'acceptChange',(_0x28a571,_0x1df844)=>{this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['isChangeActive'](_0x1df844['id'])&&(this['_aiReviewCoreEditing']['applyChange']([_0x1df844['id']]),this['_currentReviewCheckRun']['markChangeAsAccepted'](_0x1df844['id']),this['_aiReviewCoreUi']['hideChangeBalloon'](),this['_currentReviewCheckRun']['sendRating'](_0x1df844['id']));}),this['listenTo'](this['_aiReviewCoreUi'],'dismissChange',(_0x1d43dc,_0x154cc3)=>{this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['isChangeActive'](_0x154cc3['id'])&&(this['_aiReviewCoreEditing']['rejectChange'](_0x154cc3['id']),this['_currentReviewCheckRun']['markChangeAsRejected'](_0x154cc3['id']),this['_aiReviewCoreUi']['hideChangeBalloon'](),this['_currentReviewCheckRun']['sendRating'](_0x154cc3['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',(_0x35a0f5,_0x1ac7f7)=>{this['_onActivateChange'](_0x1ac7f7);}),this['listenTo'](this['_aiReviewCoreUi'],'deactivateChange',(_0x5c90d9,_0x33cdf4)=>{this['_onDeactivateChange'](_0x33cdf4);}),this['listenTo'](this['_aiReviewCoreEditing']['emitter'],'changeMarkerClicked',(_0x3b05c0,_0x2b227c)=>{this['_onChangeMarkerClicked'](_0x3b05c0,_0x2b227c);}),this['listenTo'](this['_aiReviewCoreEditing']['emitter'],'changeMarkerHovered',(_0x349d20,_0x176155)=>{this['_onChangeMarkerHovered'](_0x349d20,_0x176155);}),this['listenTo'](this['_aiReviewCoreEditing']['emitter'],'changeMarkerBlurred',()=>{this['_onChangeMarkerBlurred']();}),this['listenTo'](this['_aiReviewCoreEditing']['emitter'],'changeMarkerRemoved',(_0x26a7ad,_0x286f83)=>{this['_onChangeMarkerRemoved'](_0x26a7ad,_0x286f83);}),this['listenTo'](this['_aiReviewCoreEditing']['emitter'],'changeMarkerRestored',(_0xb7671a,_0x300ec5)=>{this['_onChangeMarkerRestored'](_0xb7671a,_0x300ec5);});}['_createReviewCheckRun'](_0x4e62d9,_0x201479){return new Ra(this['_aiReviewCoreEditing']['getDocumentData'](),_0x201479,this['_aiConnector'],_0x4e62d9['params'],_0x4e62d9['args']);}['_onChangeMarkerRemoved'](_0x30d344,_0x3221f5){this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['markChangeAsOutdated'](_0x3221f5['changeId']);}['_onChangeMarkerRestored'](_0x158536,_0x380fcd){this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['markChangeAsPending'](_0x380fcd['changeId']);}['_onCheckRunFinished'](){this['_aiReviewCoreUi']['showReviewCompletedView']();}['_initRequiredPlugins'](){this['_aiConnector']=this['context']['plugins']['get']('AIConnector');}['_onReviewRunLeave'](_0xa53bfc=!0x1){this['_currentReviewCheckRun']&&(this['_currentReviewCheckRun']['hasModifications']||this['_currentReviewCheckRun']['sendRating'](),this['_currentReviewCheckRun']['stopListening'](),this['_currentReviewCheckRun']['abort'](),this['_currentReviewCheckRun']=void 0x0),_0xa53bfc&&this['_aiReviewCoreUi']['showReviewCheckList'](),this['_aiReviewCoreEditing']['clearAllMarkers'](),this['_aiReviewCoreEditing']['switchToEdit'](),this['_changeActivationSource']=null;for(const _0x2b591e of this['_aiReviewCoreEditing']['getEditors']())_0x2b591e['editing']['view']['change'](_0x47d8bb=>{for(const _0x44c6cd of _0x2b591e['editing']['view']['document']['getRoots']())_0x47d8bb['removeClass']('ck-ai_review-diff',_0x44c6cd),_0x47d8bb['removeClass']('ck-ai_review-highlights',_0x44c6cd),_0x47d8bb['removeClass']('ck-ai-translate-mode-content',_0x44c6cd);});}['_getTranslationWithDefault'](_0x20477d,_0x3b835d){const _0x454b89=hs(this['context']['locale'],_0x20477d);return _0x454b89===_0x20477d?_0x3b835d:_0x454b89;}['_logError'](_0x38b716,_0x263204=!0x1){Et(_0x38b716['message']),_0x263204||(_0x38b716['message']['startsWith']('ai-review-mode-models-unable-to-retrieve')?this['_aiReviewCoreUi']['showGeneralReviewCoreErrorView']():this['_aiReviewCoreUi']['showGeneralResultsErrorView']());}['_scrollToChange'](_0x2410c0){if('content'===this['_changeActivationSource']){const _0x161782=this['_aiReviewCoreUi']['getChangeElement'](_0x2410c0);_0x161782&&ft(_0x161782['closest']('.ck-ai_review__check-run-result')||_0x161782);}else{if('panel'===this['_changeActivationSource']){const _0x3bef5e=this['_getChangeContentElement'](_0x2410c0);if(!_0x3bef5e)return;Ct({'target':_0x3bef5e,'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(_0x3c151f){this['id']=_0x3c151f['id'],this['commandId']=_0x3c151f['commandId'],this['title']=_0x3c151f['title'],this['description']=_0x3c151f['description'],this['isParameterized']=_0x3c151f['isParameterized'],this['useArgs']=_0x3c151f['useArgs'],this['options']=_0x3c151f['options'],this['args']=_0x3c151f['args'];}}class va extends ht(){['_checks']=[];['setupChecks'](_0xc57395){this['_checks']=_0xc57395['map'](_0x1e1020=>new Na(_0x1e1020));}get['checks'](){return this['_checks'];}['getCheckById'](_0x42fc0c){return this['checks']['find'](_0x5e4473=>_0x5e4473['id']===_0x42fc0c);}['removeCheckById'](_0x4b432f){this['_checks']=this['_checks']['filter'](_0x28d393=>_0x28d393['id']!==_0x4b432f);}}class ya extends Na{['_models']=[];['_defaultModel']=null;constructor(_0x277cb4,_0x536c74,_0x364f24){super(_0x277cb4),this['_models']=_0x536c74,this['_defaultModel']=_0x364f24;}get['models'](){return this['_models'];}get['defaultModel'](){return this['_defaultModel'];}}class xa extends Na{['isExtra']=!0x0;['prompt'];['model'];['_defaultModel']=null;constructor(_0x38e5f4,_0xf4890,_0x4bc10b){super(_0x38e5f4),this['prompt']=_0x38e5f4['prompt'],this['model']=_0x38e5f4['model'],this['model']?this['_defaultModel']=_0xf4890['find'](_0x564e04=>_0x564e04['id']===this['model'])||null:this['_defaultModel']=_0x4bc10b;}get['defaultModel'](){return this['_defaultModel'];}}class La extends va{['_allModels']=[];['_recommendedModels']=[];['_defaultModel']=null;constructor(_0x28c3f9,_0x5e879e,_0x551182){super(),this['_allModels']=_0x28c3f9,this['_recommendedModels']=_0x5e879e,this['_defaultModel']=_0x551182;}['setupChecks'](_0x96a58a){this['_checks']=_0x96a58a['map'](_0x1df8b5=>!0x0===_0x1df8b5['isExtra']?new xa(_0x1df8b5,this['_allModels'],this['_defaultModel']):'custom'===_0x1df8b5['id']?new ya(_0x1df8b5,this['_recommendedModels'],this['_defaultModel']):new Na(_0x1df8b5));}}class Da extends Sa{['_prompt'];['_model'];constructor(_0x4b4b5e,_0x1c39be,_0x20d7f6,_0x45131e,_0x4490ae){super(_0x20d7f6,_0x45131e,_0x4490ae),this['_prompt']=_0x4b4b5e,this['_model']=_0x1c39be;}get['subTitle'](){return this['_prompt'];}['_createApiRequest'](){return this['_aiConnector']['callCustomReview']({'content':this['_documentData']['content'],'prompt':this['_prompt'],'model':this['_model']});}['_sendRatingRequest'](_0x12fbd7,_0xd9b90a,_0x43410b){return this['_aiConnector']['upsertCustomAIReviewRating'](_0xd9b90a,_0x12fbd7,_0x43410b);}}class Pa extends Da{get['subTitle'](){return'';}set['prompt'](_0x514d8f){this['_prompt']=_0x514d8f;}set['model'](_0x2e3aa6){this['_model']=_0x2e3aa6;}}class Ha extends Oa{static get['pluginName'](){return'AIReviewModeController';}['_isDiffOn']=!0x1;['_hasDefaultAvailableCommands']=!0x1;constructor(_0xd13f7c){super(_0xd13f7c),this['_hasDefaultAvailableCommands']=!this['context']['config']['get']('ai.review.availableCommands'),this['context']['config']['define']('ai.review.availableCommands',ka['map'](_0x247260=>_0x247260['id'])),this['context']['config']['define']('ai.review.extraCommands',[]);}async['init'](){await super['init'](),this['listenTo'](this['_aiReviewCoreUi'],'toggleDiff',(_0x2fab1a,_0x4b7d83)=>{this['_isDiffOn']=_0x4b7d83['on'],this['_onDiffChange'](this['_isDiffOn']);});}['_initRequiredPlugins'](){super['_initRequiredPlugins'](),this['_aiReviewCoreUi']=this['context']['plugins']['get']('AIReviewModeUI'),this['_aiReviewCoreEditing']=this['context']['plugins']['get']('AIReviewCoreEditing');}['_createReviewCheckRun'](_0x1a3f68,_0x1dd19e){return _0x1a3f68['isCustom']?new Da(_0x1a3f68['args']['prompt'],_0x1a3f68['args']['model'],this['_aiReviewCoreEditing']['getDocumentData'](),_0x1dd19e,this['_aiConnector']):_0x1dd19e['isExtra']?new Pa(_0x1dd19e['prompt'],_0x1dd19e['defaultModel']['id'],this['_aiReviewCoreEditing']['getDocumentData'](),_0x1dd19e,this['_aiConnector']):new Ra(this['_aiReviewCoreEditing']['getDocumentData'](),_0x1dd19e,this['_aiConnector'],_0x1a3f68['params'],_0x1a3f68['args']);}['_onReviewCheckResultActivated'](_0xe13643){this['_aiReviewCoreUi']['setActiveStateInResults'](_0xe13643['change']['id']),this['_scrollToChange'](_0xe13643['change']['id']);const _0x42b8f4=this['_aiReviewCoreEditing']['getMarkerElementForChange'](_0xe13643['change']['id']);if(!_0x42b8f4)return;const _0x4c75e0=this['_aiReviewCoreEditing']['getEditorForChange'](_0xe13643['change']['id'])??this['_aiReviewCoreEditing']['getEditor']();this['_aiReviewCoreUi']['showChangeBalloon'](_0xe13643['change'],()=>_0x42b8f4['getElement'](),void 0x0,'click',this['_getBalloonDomRoot'](_0x4c75e0,_0x42b8f4['modelRange']['root']['rootName']),_0x4c75e0?.['ui']?.['viewportOffset']),this['_aiReviewCoreEditing']['setMarkersInElementAsActive'](_0xe13643['change']['id']);}['_onReviewCheckResultDeactivated'](){this['_aiReviewCoreUi']['resetActiveStateInResults'](),this['_aiReviewCoreUi']['hideChangeBalloon'](),this['_aiReviewCoreEditing']['setAllMarkersAsInactive']();}['_onActivateChange'](_0x2cdd1e){this['_currentReviewCheckRun']&&'click'===_0x2cdd1e['uiInteraction']&&(this['_changeActivationSource']='panel',this['_currentReviewCheckRun']['activateChange'](_0x2cdd1e['id']));}['_onDeactivateChange'](_0x1746ac){this['_currentReviewCheckRun']&&'balloon'===_0x1746ac['origin']&&this['_currentReviewCheckRun']['deactivateChange']();}['_onChangeMarkerClicked'](_0x45f845,_0x47dd20){if(!this['_currentReviewCheckRun'])return;this['_changeActivationSource']='content',this['_currentReviewCheckRun']['activateChange'](_0x47dd20['changeId']);const _0x321a56=this['_currentReviewCheckRun']['getChangeById'](_0x47dd20['changeId']);if(!_0x321a56)return;const _0x54844c=this['_aiReviewCoreEditing']['getMarkerElementForChange'](_0x47dd20['changeId']),_0x442461=this['_aiReviewCoreEditing']['getEditorForChange'](_0x47dd20['changeId'])??this['_aiReviewCoreEditing']['getEditor']();this['_aiReviewCoreUi']['showChangeBalloon'](_0x321a56,_0x47dd20['markerElement'],_0x47dd20['domEvent'],'click',this['_getBalloonDomRoot'](_0x442461,_0x54844c?.['modelRange']['root']['rootName']),_0x442461?.['ui']?.['viewportOffset']);}['_onChangeMarkerHovered'](_0xb188ec,_0x40b205){if(!this['_currentReviewCheckRun'])return;if(this['_currentReviewCheckRun']['isAnyChangeActivated']())return;const _0x2ab5c=this['_currentReviewCheckRun']['getChangeById'](_0x40b205['changeId']);if(!_0x2ab5c)return;const _0x416250=this['_aiReviewCoreEditing']['getMarkerElementForChange'](_0x40b205['changeId']),_0x5c11eb=this['_aiReviewCoreEditing']['getEditorForChange'](_0x40b205['changeId'])??this['_aiReviewCoreEditing']['getEditor']();this['_aiReviewCoreUi']['showChangeBalloon'](_0x2ab5c,_0x40b205['markerElement'],_0x40b205['domEvent'],'hover',this['_getBalloonDomRoot'](_0x5c11eb,_0x416250?.['modelRange']['root']['rootName']),_0x5c11eb?.['ui']?.['viewportOffset']);}['_onChangeMarkerBlurred'](){if(!this['_currentReviewCheckRun'])return;this['_currentReviewCheckRun']['isAnyChangeActivated']()||this['_aiReviewCoreUi']['hideChangeBalloon']();}['_getChangeContentElement'](_0x5c1a42){const _0x2f812a=this['_aiReviewCoreEditing']['getMarkerElementForChange'](_0x5c1a42);return _0x2f812a?_0x2f812a['getElement']():null;}['_markChangePositionInEditorContent'](_0x5524e5,_0x487c24){this['_aiReviewCoreEditing']['markChangePositionInEditorContent'](_0x5524e5,_0x487c24);}['_diffContent'](_0x3d2107,_0x106c41,_0x4cd883){return this['_aiReviewCoreEditing']['diffContent'](_0x3d2107,_0x106c41,_0x4cd883,!0x1);}['_onReviewCheckRun'](){this['_onDiffChange'](this['_isDiffOn']);}['_onDiffChange'](_0x32f0c6){_0x32f0c6?this['_aiReviewCoreUi']['hideDiffInBalloon']():this['_aiReviewCoreUi']['showDiffInBalloon']();for(const _0x4cde22 of this['_aiReviewCoreEditing']['getEditors']())_0x4cde22['editing']['view']['change'](_0x1b9a07=>{for(const _0x203eae of _0x4cde22['editing']['view']['document']['getRoots']()){for(const _0x47d345 of _0x203eae['getClassNames']())_0x47d345['startsWith']('ck-ai_review-')&&_0x1b9a07['removeClass'](_0x47d345,_0x203eae);_0x1b9a07['addClass'](_0x32f0c6?'ck-ai_review-diff':'ck-ai_review-highlights',_0x203eae);}});}['_getBalloonDomRoot'](_0x35c501,_0x3db145){const _0x45f1cb=_0x35c501['editing']['view'];if(_0x3db145){const _0x40c69b=_0x45f1cb['getDomRoot'](_0x3db145);if(_0x40c69b)return _0x40c69b;}return _0x45f1cb['getDomRoot']()??void 0x0;}async['_getChecksList'](){const _0x3d1d7a=[...ka,...this['_getExtraChecks']()],_0x20b83a=this['context']['config']['get']('ai.review.availableCommands')||[];this['_logErrorForNonExistentChecks'](_0x20b83a,_0x3d1d7a);let _0x4a1cce=_0x3d1d7a;this['_hasDefaultAvailableCommands']||(_0x4a1cce=_0x20b83a['map'](_0x52f763=>_0x3d1d7a['find'](_0x3386f0=>_0x3386f0['id']===_0x52f763))['filter'](_0xacc6cf=>!!_0xacc6cf)),_0x4a1cce=_0x4a1cce['map'](_0x50a8f5=>_0x50a8f5['isExtra']?_0x50a8f5:this['_translateReviewCheck'](_0x50a8f5));const _0x335613=_0x4a1cce['some'](_0x332eb6=>_0x332eb6['isExtra']||'custom'===_0x332eb6['id']);let _0xe9b3f8=[],_0x165184=[],_0x32b9a1=null;if(_0x335613){const _0x4d55c0=await this['_getModels']();_0xe9b3f8=_0x4d55c0['all'],_0x165184=_0x4d55c0['recommended'],_0x32b9a1=_0x4d55c0['default'];}const _0x109ea5=new La(_0xe9b3f8,_0x165184,_0x32b9a1);return _0x109ea5['setupChecks'](_0x4a1cce),_0x335613&&this['_filterChecksWithMissingModel'](_0x109ea5),_0x109ea5;}['_getExtraChecks'](){return(this['context']['config']['get']('ai.review.extraCommands')||[])['map'](_0x2952af=>({'id':_0x2952af['id'],'commandId':_0x2952af['id'],'title':_0x2952af['label'],'description':_0x2952af['description'],'isParameterized':!0x1,'isExtra':!0x0,'prompt':_0x2952af['prompt'],'model':_0x2952af['model']}));}['_logErrorForNonExistentChecks'](_0x7fd580,_0x3cec84){const _0x482db2=_0x7fd580['filter'](_0x460263=>!_0x3cec84['some'](_0x5897d2=>_0x5897d2['id']===_0x460263));_0x482db2['length']&&this['_logError'](new at('ai-review-mode-non-existent-commands-used',this,{'commandIds':_0x482db2['join'](',\x20')}),!0x0);}async['_getModels'](){try{const _0x3bea66=new Fs({'connector':this['_aiConnector'],'config':this['context']['config']['get']('ai.models'),'locale':this['context']['locale']});return{'all':await _0x3bea66['getAll'](),'recommended':await _0x3bea66['getAvailableModels'](),'default':await _0x3bea66['getDefault']()};}catch(_0x3b13d1){return this['_logError'](new at('ai-review-mode-models-unable-to-retrieve',this,void 0x0,_0x3b13d1)),{'all':[],'recommended':[],'default':null};}}['_translateReviewCheck'](_0x42d58c){const _0x788f93='AI_REVIEW_CHECK_'+_0x42d58c['id']['toUpperCase']()['replaceAll']('-','_'),_0x49b869={..._0x42d58c,'title':this['_getTranslationWithDefault'](_0x788f93+'_TITLE',_0x42d58c['title']),'description':this['_getTranslationWithDefault'](_0x788f93+'_DESCRIPTION',_0x42d58c['description'])};return _0x42d58c['options']&&(_0x49b869['options']=_0x42d58c['options']['map'](_0x85900a=>({..._0x85900a,'label':this['_getTranslationWithDefault'](_0x788f93+'_OPTIONS_LABEL',_0x85900a['label']||''),'data':_0x85900a['data']?_0x85900a['data']['map'](_0x54c132=>({..._0x54c132,'label':this['_getTranslationWithDefault'](_0x788f93+'_OPTIONS_DATA_'+_0x54c132['id']['toUpperCase'](),_0x54c132['label'])})):void 0x0}))),_0x49b869;}['_filterChecksWithMissingModel'](_0x55f824){const _0x3a03a6=[];_0x55f824['checks']['forEach'](_0x24192c=>{(_0x24192c instanceof xa&&!_0x24192c['defaultModel']||_0x24192c instanceof ya&&!_0x24192c['models']['length'])&&_0x3a03a6['push'](_0x24192c['id']);}),_0x3a03a6['length']&&_0x3a03a6['forEach'](_0x4bbe33=>{_0x55f824['removeCheckById'](_0x4bbe33),this['_logError'](new at('ai-review-mode-command-unavailable-due-to-missing-model',this,{'commandId':_0x4bbe33}),!0x0);});}}class Ma extends _0x29a024{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'](_0x12831a){this['_checks']=_0x12831a['map'](_0x4ab4dd=>new Ua(_0x4ab4dd));}}class Ba extends Ra{['_title'];constructor(_0x1bc71b,_0x1c6a60,_0x5f1fbf,_0x4fa3dd,_0x448718,_0x4b808c){super(_0x1bc71b,_0x1c6a60,_0x5f1fbf,_0x448718,_0x4b808c),this['_title']=_0x4fa3dd;}get['title'](){return this['_title'];}get['subTitle'](){return this['_sourceCheck']['title'];}}class Ga extends Oa{static get['pluginName'](){return'AITranslateController';}constructor(_0xf369ec){super(_0xf369ec),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'](_0x261c3a,_0x39b516){return new Ba(this['_aiReviewCoreEditing']['getDocumentData'](),_0x39b516,this['_aiConnector'],hs(this['context']['locale'],'AI_REVIEW_CHECK_TRANSLATE_TITLE'),_0x261c3a['params'],_0x261c3a['args']);}['_onReviewCheckResultActivated'](_0x2d2d51){this['_aiReviewCoreUi']['setActiveStateInResults'](_0x2d2d51['change']['id']),this['_aiReviewCoreEditing']['setMarkersInElementAsActive'](_0x2d2d51['change']['id']);}['_onReviewCheckResultDeactivated'](){this['_aiReviewCoreEditing']['setAllMarkersAsInactive'](),this['_aiReviewCoreUi']['resetActiveStateInResults']();}['_onActivateChange'](_0x3a2e8d){this['_currentReviewCheckRun']&&('hover'===_0x3a2e8d['uiInteraction']&&(this['_changeActivationSource']='panel',this['_currentReviewCheckRun']['activateChange'](_0x3a2e8d['id'])),'click'===_0x3a2e8d['uiInteraction']&&this['_scrollToChange'](_0x3a2e8d['id']));}['_onDeactivateChange'](_0x386032){this['_currentReviewCheckRun']&&'panel'===_0x386032['origin']&&this['_currentReviewCheckRun']['deactivateChange']();}['_onChangeMarkerClicked'](_0x207449,_0x50ead5){this['_currentReviewCheckRun']&&(this['_changeActivationSource']='content',this['_currentReviewCheckRun']['activateChange'](_0x50ead5['changeId']),this['_scrollToChange'](_0x50ead5['changeId']));}['_onChangeMarkerHovered'](_0x8012d2,_0x4d2871){this['_currentReviewCheckRun']&&(this['_changeActivationSource']='content',this['_currentReviewCheckRun']['activateChange'](_0x4d2871['changeId']),this['_aiReviewCoreEditing']['reactivateMarkers'](_0x4d2871['changeId']));}['_onChangeMarkerBlurred'](){this['_currentReviewCheckRun']&&'content'===this['_changeActivationSource']&&(this['_currentReviewCheckRun']['deactivateChange'](),this['_aiReviewCoreEditing']['setAllMarkersAsInactive']());}['_getChangeContentElement'](_0x385e9e){return this['_aiReviewCoreEditing']['getContentElementForChange'](_0x385e9e);}['_markChangePositionInEditorContent'](_0x57da85,_0xb002ef){this['_aiReviewCoreEditing']['markChangePositionInEditorContent'](_0x57da85,_0xb002ef);}['_diffContent'](_0x50f574,_0x11f147,_0xce18fb){return this['_aiReviewCoreEditing']['diffContent'](_0x50f574,_0x11f147,_0xce18fb,!0x0);}['_onReviewCheckRun'](){for(const _0x47618a of this['_aiReviewCoreEditing']['getEditors']())_0x47618a['editing']['view']['change'](_0x347628=>{for(const _0x2cf3c8 of _0x47618a['editing']['view']['document']['getRoots']())_0x347628['addClass']('ck-ai-translate-mode-content',_0x2cf3c8);});}async['_getChecksList'](){const _0x40e834=[],_0x1192fb=this['context']['config']['get']('ai.translate.languages')||[];for(const _0x3cc139 of _0x1192fb)_0x40e834['push']({'title':_0x3cc139['label'],'id':_0x3cc139['id'],'commandId':_0x3cc139['id'],'description':'','isParameterized':!0x1,'useArgs':!0x0,'args':{'language':_0x3cc139['id']}});const _0x33a07b=new Va();return _0x33a07b['setupChecks'](this['_translateChecks'](_0x40e834)),_0x33a07b;}['_translateChecks'](_0x5c1086){return _0x5c1086['map'](_0x222aee=>{const _0x5e489e='AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_'+_0x222aee['title']['toUpperCase']()['replaceAll']('-','_');return{..._0x222aee,'title':this['_getTranslationWithDefault'](_0x5e489e,_0x222aee['title'])};});}}class Fa extends ca{constructor(_0x53e586,_0x515fe3){super(_0x53e586,_0x515fe3),this['on']('set:isLoading',(_0x45a72d,_0x44cd16,_0x1f29f4)=>{_0x1f29f4&&(this['headerTitle']=hs(this['locale'],'AI_TRANSLATE_CHECK_RESULTS_LOADING_TITLE'));}),this['on']('set:isResultReady',(_0x22fa84,_0x402920,_0x438380)=>{_0x438380&&(this['headerTitle']=hs(this['locale'],'AI_TRANSLATE_CHECK_RESULTS_READY_TITLE'));});}['_createAcceptAllButtonView'](){const _0x5a392a=super['_createAcceptAllButtonView']();return _0x5a392a['set']('label',hs(this['locale'],'AI_TRANSLATE_ACCEPT_ALL')),_0x5a392a;}['_createExitReviewButtonView'](){const _0x531ce3=super['_createExitReviewButtonView']();return _0x531ce3['set']('label',hs(this['locale'],'AI_CHAT_HISTORY_CANCEL')),_0x531ce3;}}class Ka extends pa{['_setupTemplate'](){const _0x273836=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-translate__check-list-wrapper',_0x273836['if']('isVisible','ck-hidden',_0x16375b=>!_0x16375b)]},'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',_0x273836['if']('isVisible','ck-hidden',_0x11f4f7=>!_0x11f4f7)]},'children':this['_checkViews']}]});}}class Wa extends ra{static get['pluginName'](){return'AITranslateUI';}['createMainView'](){const _0xce8e59=this['context']['plugins']['get']('AITabs'),_0x5bc519=this['context']['locale'],_0x1b234=new eo(_0x5bc519,{'label':hs(_0x5bc519,'AI_REVIEW_CHECK_TRANSLATE_TITLE'),'icon':_0x3c67b8,'class':'ck-ai-header_review-translate','showResizeButton':_0xce8e59['showResizeButton']});_0x1b234['delegate']('resizeTabs')['to'](_0xce8e59),_0x1b234['bind']('isMaximized')['to'](_0xce8e59['view'],'isMaximized',_0x3ba349=>_0x3ba349);const _0x598f74=new aa(_0x5bc519,{'header':_0x1b234,'list':new Ka(_0x5bc519),'results':new Fa(_0x5bc519,{'generalErrorText':hs(_0x5bc519,'AI_TRANSLATE_GENERAL_ERROR_MESSAGE')}),'completed':new la(_0x5bc519,{'headerText':hs(_0x5bc519,'AI_TRANSLATE_FINISH_HEADER_TITLE'),'emptyResultsText':hs(_0x5bc519,'AI_TRANSLATE_EMPTY_RESULTS_TEXT'),'buttonText':hs(_0x5bc519,'AI_TRANSLATE_FINISH_BUTTON_LABEL')})});return _0x598f74['extendTemplate']({'attributes':{'class':'ck-ai-translate-mode'}}),_0x598f74;}['registerTab'](){const _0x2810e9=this['context']['plugins']['get']('AITabs');_0x2810e9['view']['on']('activateTab',(_0x249d25,{newTab:_0x5e5a8c,oldTab:_0x1ac9e9})=>{'translate'===_0x5e5a8c?this['fire']('getReviewCheckList'):'translate'===_0x1ac9e9&&this['fire']('leaveReview');}),_0x2810e9['view']['addTab']({'id':'translate','buttonLabel':hs(this['context']['locale'],'AI_REVIEW_CHECK_TRANSLATE_TITLE'),'buttonIcon':_0x3c67b8,'order':0x0,'content':this['_mainView']});}}class Ya extends _0x29a024{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};
|