@ckeditor/ckeditor5-ai 48.0.0-alpha.4 → 48.0.0-alpha.6
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/aiactions/aiactions.d.ts +1 -10
- package/dist/aichat/model/aichatcontext.d.ts +5 -5
- package/dist/aichat/ui/controls/aichatcontextitembuttonview.d.ts +1 -1
- package/dist/aichatshortcuts/aichatshortcuts.d.ts +7 -19
- package/dist/aicore/aiconnector.d.ts +1 -1
- package/dist/aicore/model/aicontext.d.ts +15 -36
- package/dist/aiquickactions/aiquickactions.d.ts +6 -15
- package/dist/aiquickactions/aiquickactionsui.d.ts +1 -9
- package/dist/index-editor.css +27 -14
- package/dist/index.css +27 -14
- package/dist/index.d.ts +2 -2
- package/dist/index.js +6 -5
- 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,8 +20,9 @@
|
|
|
20
20
|
*
|
|
21
21
|
*
|
|
22
22
|
*/
|
|
23
|
-
import{Plugin as _0x10493d,Command as _0x10c9cf,ContextPlugin as _0x3397b8,Editor as _0x562c83}from'@ckeditor/ckeditor5-core/dist/index.js';import{IconCopy as _0x5804e6,IconCheck as _0x27f2cb,IconError as _0x3fb858,IconSubmit as _0x44c7fc,IconAIHistory as _0x468df9,IconMagicWand as _0x39348e,IconRobotPencil as _0x12eaf9,IconMaximize as _0x3bc949,IconMinimize as _0x538e2e,IconShowChangesOn as _0x3ca4ea,IconShowChangesOff as _0xc7caf0,IconDocument as _0x397866,IconBoxWithCross as _0x34fe88,IconBoxWithCheck as _0x3de973,IconBoxWithMarker as _0x565935,IconInfo as _0x5bdc98,IconWeb as _0x6e68f0,IconClose as _0x46185c,IconSelection as _0x465fab,IconFileUpload as _0x2f082a,IconLink as _0x4b626c,IconBulb as _0x1b9751,IconAI as _0x1b4f0d,IconPreviousArrow as _0x10fb63,IconDocumentOutline as _0x2d5691,IconLoupe as _0x2827ef,IconCancel as _0x3523ed,IconPaperClip as _0x2202a6,IconBrowseFiles as _0x38431d,IconDropdownArrow as _0x2fb5d2,IconStop as _0x251c48,IconAIChat as _0x17727b,IconPlus as _0x152924,IconPin as _0x39cfe1,IconThreeHorizontalDots as _0x4da6e4,IconAIReview as _0x3e03ba,IconAITranslate as _0x24ec53,IconAIAskAI as _0x3a9cf8,IconThumbUp as _0x2dbec3,IconThumbDown as _0x388309,IconChevronDown as _0x438400,IconChevronUp as _0x36707d,IconAIQuickActions as _0x4ba3ea,IconAIChatCommands as _0xb5a195,IconAIImproveWriting as _0x59dc92,IconAIContinueWriting as _0x3049bb,IconAIGrammarCheck as _0x2fb0ae,IconAIAdjustLength as _0x2b09aa,IconAIChangeTone as _0x1ae53f,IconAIOther as tt,IconRefresh as et,IconNextArrow as it,IconOutdated as st,IconEye as nt,IconEyeCrossedOut as rt,IconChevronRight as at}from'@ckeditor/ckeditor5-icons/dist/index.js';import{uid as ot,CKEditorError as ht,ObservableMixin as ct,global as lt,isVisible as ut,Rect as dt,Collection as _t,FocusTracker as At,KeystrokeHandler as gt,first as It,toArray as Et,EmitterMixin as pt,logWarning as Tt,logError as mt,scrollViewportToShowTarget as Ct,insertToPriorityArray as wt,scrollAncestorsToShowTarget as ft,ResizeObserver as St,_isMotionReduced as bt,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 _0x1e478d,FormHeaderView as _0x3e3394,HighlightedTextView as _0x159fa8,ViewCollection as _0x54be0e,FileDialogButtonView as _0x2e6eb4,InputTextView as _0x33f65d,SearchTextView as _0x261b76,ListItemButtonView as _0xf089fd,ButtonLabelWithHighlightView as _0x1ec96d,DropdownMenuPanelPositioningFunctions as _0x2697ed,BalloonToolbar as _0x24e423,FormRowView as _0xae7a14,TextareaView as _0x14f3b5}from'@ckeditor/ckeditor5-ui/dist/index.js';import{ClipboardPipeline as _0x40ccc9,ClipboardMarkersUtils as _0x1c0d8f}from'@ckeditor/ckeditor5-clipboard/dist/index.js';import{ViewDocumentDomEventData as _0x480413,ViewDataTransfer as _0x309e15,ViewUpcastWriter as _0x532020,Matcher as _0x48c970,_DetachOperation as _0xa8a483,_insertIntoModelNodeList as _0x5800b0,_removeFromModelNodeList as _0xe00d8e,ModelRange as _0x519c43,transformOperationSets as _0x4976b5,ViewDowncastWriter as _0x5448c0,ModelDocumentFragment as _0x2b7448,ModelPosition as _0x87183,ModelTreeWalker as _0x3ac2ad,MarkerOperation as _0x6e7aad,InsertOperation as _0x35208a}from'@ckeditor/ckeditor5-engine/dist/index.js';import{unescape as _0x1325ef,escape as _0x575f0b,cloneDeep as _0x4397ac,escapeRegExp as _0x1b6061,debounce as _0x2cfb3d}from'es-toolkit/compat';import{BedrockRuntimeClient as _0x58933f,InvokeModelWithResponseStreamCommand as _0x3562c4,InvokeModelCommand as _0x3fa44b}from'@aws-sdk/client-bedrock-runtime';import{createParser as _0x27b766}from'eventsource-parser';import{CloudServices as _0x3d7dc0}from'@ckeditor/ckeditor5-cloud-services/dist/index.js';import{parseDocument as _0x5c37e0}from'htmlparser2';import{isTag as _0x204373,findOne as _0x5b37e1,getParent as _0x141eb9,findAll as _0x53eb72,removeElement as _0x544b32,replaceElement as _0x3a9dc6,prepend as _0xaa920a,prependChild as _0x23eccc,appendChild as _0x49a967,append as _0x16e185,find as _0x3fabc1,isComment as _0x3a3fef,getChildren as ti,textContent as _0xe69844}from'domutils';import _0x3dc878 from'dom-serializer';import{Document as _0x2a3183,Element as _0x3f0955,Text as _0x39bfd5,cloneNode as _0x12387e,isDocument as _0x4aee55,isText as _0x21b97c,NodeWithChildren as _0x179458}from'domhandler';import{MarkdownGfmMdToHtmlDefaultPlugins as _0x239e44,MarkdownGfmMdToHtml as _0x2ca85a}from'@ckeditor/ckeditor5-markdown-gfm/dist/index.js';import _0x2345ca from'rehype-sanitize';import{fixElementSuggestionRange as _0x2798de,DocumentCompare as _0x43d889,DATA_ID_MODEL_ATTRIBUTE as _0x5ebb0a,ConfirmMixin as _0x16fcf4,LateFocusDropdownButtonView as _0x2acc95,getAllMarkersDomElementsSorted as _0x3c0422,SuggestionsConversion as _0x4b9ba0,DATA_ID_VIEW_ATTRIBUTE as _0x500725,getMarkerDomElement as _0x58d31c}from'@ckeditor/ckeditor5-collaboration-core/dist/index.js';import _0x103ded from'morphdom';import{diffArrays as _0x20e0b5}from'diff';const Si='_ungrouppedCommands';function bi(_0x165c1f,_0x3d0991){const _0x77c298=(0x0,_0x3d0991['t'])('Other');return _0x165c1f['length']?'groupId'in _0x165c1f[0x0]?_0x165c1f:[{'groupId':Si,'groupLabel':_0x77c298,'order':0x1/0x0,'commands':_0x165c1f}]:[{'groupId':Si,'groupLabel':_0x77c298,'order':0x1/0x0,'commands':[]}];}const Ri=globalThis['DataTransfer'],Oi='ai-ui';class ki extends _0x10493d{static get['pluginName'](){return'AIAssistantEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const {editor:_0x71ed53}=this,_0x27b671=['ck-fake-ai-selection'];_0x71ed53['config']['get']('ai.assistant.useTheme')&&_0x27b671['push']('ck-ai-assistant-ui_theme'),_0x71ed53['conversion']['for']('editingDowncast')['markerToHighlight']({'model':Oi,'view':{'classes':_0x27b671,'priority':0xc}}),_0x71ed53['conversion']['for']('editingDowncast')['markerToElement']({'model':Oi,'view':(_0xae9932,{writer:_0x299b23})=>{if(!_0xae9932['markerRange']['isCollapsed'])return null;const _0x16d771=_0x299b23['createUIElement']('span');return _0x299b23['addClass'](['ck-fake-ai-selection','ck-fake-ai-selection_collapsed'],_0x16d771),_0x16d771;}});}['afterInit'](){!async function(_0x16fd05){const _0x5ccddd=_0x521fbe([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]),_0x1540aa=0x3dffc4e1,_0x4aa6db=0x3df841c9^_0x1540aa,_0x546230=window[_0x521fbe([0x44,0x61,0x74,0x65])][_0x521fbe([0x6e,0x6f,0x77])](),_0x59a423=_0x16fd05[_0x521fbe([0x65,0x64,0x69,0x74,0x6f,0x72])],_0x29f715=new window[(_0x521fbe([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x4e6bf3=>{_0x59a423[_0x521fbe([0x6f,0x6e,0x63,0x65])](_0x521fbe([0x72,0x65,0x61,0x64,0x79]),_0x4e6bf3);}),_0x242018={[_0x521fbe([0x6b,0x74,0x79])]:_0x521fbe([0x45,0x43]),[_0x521fbe([0x75,0x73,0x65])]:_0x521fbe([0x73,0x69,0x67]),[_0x521fbe([0x63,0x72,0x76])]:_0x521fbe([0x50,0x2d,0x32,0x35,0x36]),[_0x521fbe([0x78])]:_0x521fbe([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]),[_0x521fbe([0x79])]:_0x521fbe([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]),[_0x521fbe([0x61,0x6c,0x67])]:_0x521fbe([0x45,0x53,0x32,0x35,0x36])},_0x26a916=_0x59a423[_0x521fbe([0x63,0x6f,0x6e,0x66,0x69,0x67])][_0x521fbe([0x67,0x65,0x74])](_0x521fbe([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79]));async function _0x1ac0e1(){let _0x4d05e7,_0x39b76e=null,_0x2d24aa=null;try{if(_0x26a916==_0x521fbe([0x47,0x50,0x4c]))return _0x521fbe([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]);if(_0x4d05e7=_0x5eb01a(),!_0x4d05e7)return _0x521fbe([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);return _0x4d05e7[_0x521fbe([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])]&&(_0x2d24aa=_0x3c1bf8(_0x4d05e7[_0x521fbe([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])],_0x4d05e7[_0x521fbe([0x6a,0x74,0x69])])),await _0x1372d4()?_0x209d3a()?_0x3eea69()?_0x521fbe([0x45,0x78,0x70,0x69,0x72,0x65,0x64]):_0x64ec13()?(_0x4d05e7[_0x521fbe([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])]==_0x521fbe([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e])&&(_0x39b76e=_0x4ccaae(_0x521fbe([0x45,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e,0x4c,0x69,0x6d,0x69,0x74]))),await _0x19ff8b()):_0x521fbe([0x44,0x6f,0x6d,0x61,0x69,0x6e,0x4c,0x69,0x6d,0x69,0x74]):_0x521fbe([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]):_0x521fbe([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}catch{return _0x521fbe([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}function _0x3eea69(){const _0xc7678b=[_0x521fbe([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e]),_0x521fbe([0x74,0x72,0x69,0x61,0x6c])][_0x521fbe([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x4d05e7[_0x521fbe([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])])?_0x546230/0x3e8:0xe10*_0x4aa6db;return _0x4d05e7[_0x521fbe([0x65,0x78,0x70])]<_0xc7678b;}function _0x209d3a(){const _0x17ed12=_0x4d05e7[_0x521fbe([0x66,0x65,0x61,0x74,0x75,0x72,0x65,0x73])];return!!_0x17ed12&&(!!_0x17ed12[_0x521fbe([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x521fbe([0x2a]))||!!_0x17ed12[_0x521fbe([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x521fbe([0x41,0x49])));}function _0x64ec13(){const _0x4b2577=_0x4d05e7[_0x521fbe([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x64,0x48,0x6f,0x73,0x74,0x73])];if(!_0x4b2577||0x0==_0x4b2577[_0x521fbe([0x6c,0x65,0x6e,0x67,0x74,0x68])])return!0x0;const {hostname:_0x2bc0f8}=new URL(window[_0x521fbe([0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e])]['href']);if(_0x4b2577[_0x521fbe([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x2bc0f8))return!0x0;const _0x5acc91=_0x2bc0f8[_0x521fbe([0x73,0x70,0x6c,0x69,0x74])](_0x521fbe([0x2e]));return _0x4b2577[_0x521fbe([0x66,0x69,0x6c,0x74,0x65,0x72])](_0x9964ac=>_0x9964ac[_0x521fbe([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x521fbe([0x2a])))[_0x521fbe([0x6d,0x61,0x70])](_0x5b1e7c=>_0x5b1e7c[_0x521fbe([0x73,0x70,0x6c,0x69,0x74])](_0x521fbe([0x2e])))[_0x521fbe([0x66,0x69,0x6c,0x74,0x65,0x72])](_0x1a1ece=>_0x1a1ece[_0x521fbe([0x6c,0x65,0x6e,0x67,0x74,0x68])]<=_0x5acc91[_0x521fbe([0x6c,0x65,0x6e,0x67,0x74,0x68])])[_0x521fbe([0x6d,0x61,0x70])](_0x10c512=>Array(_0x5acc91[_0x521fbe([0x6c,0x65,0x6e,0x67,0x74,0x68])]-_0x10c512[_0x521fbe([0x6c,0x65,0x6e,0x67,0x74,0x68])])[_0x521fbe([0x66,0x69,0x6c,0x6c])](_0x10c512[0x0]===_0x521fbe([0x2a])?_0x521fbe([0x2a]):'')[_0x521fbe([0x63,0x6f,0x6e,0x63,0x61,0x74])](_0x10c512))[_0x521fbe([0x73,0x6f,0x6d,0x65])](_0x358087=>_0x5acc91[_0x521fbe([0x65,0x76,0x65,0x72,0x79])]((_0x405cc7,_0x1cb53e)=>_0x358087[_0x1cb53e]===_0x405cc7||_0x358087[_0x1cb53e]===_0x521fbe([0x2a])));}function _0x19ff8b(){return _0x39b76e&&_0x2d24aa?new window[(_0x521fbe([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0x24b81b,_0x22b2cf)=>{_0x39b76e[_0x521fbe([0x74,0x68,0x65,0x6e])](_0x24b81b,_0x22b2cf),_0x2d24aa[_0x521fbe([0x74,0x68,0x65,0x6e])](_0x93d28f=>{_0x93d28f!=_0x521fbe([0x56,0x61,0x6c,0x69,0x64])&&_0x24b81b(_0x93d28f);},_0x22b2cf);}):_0x39b76e||_0x2d24aa||_0x521fbe([0x56,0x61,0x6c,0x69,0x64]);}}function _0x3c1bf8(_0x5e3671,_0xe61a5b){return new window[(_0x521fbe([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x3ef9c7=>{if(_0x4bef8f())return _0x3ef9c7(_0x521fbe([0x56,0x61,0x6c,0x69,0x64]));_0x521fa1(),_0x59a423[_0x521fbe([0x64,0x65,0x63,0x6f,0x72,0x61,0x74,0x65])](_0x521fbe([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]));let _0x15cde8=!0x1;const _0x28e3ba=ot();function _0xdeacc5(_0x320055){return!!_0x320055&&(typeof _0x320055===_0x521fbe([0x6f,0x62,0x6a,0x65,0x63,0x74])||typeof _0x320055===_0x521fbe([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]))&&typeof _0x320055[_0x521fbe([0x74,0x68,0x65,0x6e])]===_0x521fbe([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e])&&typeof _0x320055[_0x521fbe([0x63,0x61,0x74,0x63,0x68])]===_0x521fbe([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]);}function _0x2d8e50(_0x54fd57){_0x5e3411(_0x54fd57)[_0x521fbe([0x74,0x68,0x65,0x6e])](_0xfc80fc=>{if(!_0xfc80fc||_0xfc80fc[_0x521fbe([0x73,0x74,0x61,0x74,0x75,0x73])]!=_0x521fbe([0x6f,0x6b]))return _0x521fbe([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]);return _0xff57a0(_0x321e73(_0x28e3ba+_0xe61a5b))!=_0xfc80fc[_0x521fbe([0x76,0x65,0x72,0x69,0x66,0x69,0x63,0x61,0x74,0x69,0x6f,0x6e])]?_0x521fbe([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]):_0x521fbe([0x56,0x61,0x6c,0x69,0x64]);})[_0x521fbe([0x74,0x68,0x65,0x6e])](_0x225c8c=>(_0x4110bb(),_0x225c8c),()=>{const _0x1f2fe9=_0x1fb2d3();return null==_0x1f2fe9?(_0x4110bb(),_0x521fbe([0x56,0x61,0x6c,0x69,0x64])):_0x521fbe(_0x546230-_0x1f2fe9>(0x19f340e1^_0x1540aa)?[0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]:[0x56,0x61,0x6c,0x69,0x64]);})[_0x521fbe([0x74,0x68,0x65,0x6e])](_0x3ef9c7)[_0x521fbe([0x63,0x61,0x74,0x63,0x68])](()=>{_0x3ef9c7(_0x521fbe([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});const _0x19a16f=0x3dc92a61^_0x1540aa;function _0x4110bb(){const _0x27a490=_0x521fbe([0x6c,0x6c,0x63,0x74,0x2d])+_0xff57a0(_0x321e73(_0x5e3671)),_0x476ccf=_0x850595(_0xff57a0(window[_0x521fbe([0x4d,0x61,0x74,0x68])][_0x521fbe([0x63,0x65,0x69,0x6c])](_0x546230/_0x19a16f)));window[_0x521fbe([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0x521fbe([0x73,0x65,0x74,0x49,0x74,0x65,0x6d])](_0x27a490,_0x476ccf);}function _0x1fb2d3(){const _0x491225=_0x521fbe([0x6c,0x6c,0x63,0x74,0x2d])+_0xff57a0(_0x321e73(_0x5e3671)),_0x1ba59c=window[_0x521fbe([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0x521fbe([0x67,0x65,0x74,0x49,0x74,0x65,0x6d])](_0x491225);return _0x1ba59c?window[_0x521fbe([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x850595(_0x1ba59c),0x10)*_0x19a16f:null;}function _0x5e3411(_0x21043a){return new window[(_0x521fbe([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0x4d70e8,_0x215494)=>{_0x21043a[_0x521fbe([0x74,0x68,0x65,0x6e])](_0x4d70e8,_0x215494),window[_0x521fbe([0x73,0x65,0x74,0x54,0x69,0x6d,0x65,0x6f,0x75,0x74])](_0x215494,0x3dfe1021^_0x1540aa);});}}_0x59a423[_0x521fbe([0x6f,0x6e])](_0x521fbe([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),(_0x4c769e,_0x5590d5)=>{if(_0x5590d5[0x0]!=_0x5e3671)return _0x3ef9c7(_0x521fbe([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));_0x5590d5[0x1]={..._0x5590d5[0x1],[_0x521fbe([0x72,0x65,0x71,0x75,0x65,0x73,0x74,0x49,0x64])]:_0x28e3ba};},{[_0x521fbe([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0x521fbe([0x68,0x69,0x67,0x68])}),_0x59a423[_0x521fbe([0x6f,0x6e])](_0x521fbe([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),_0x298401=>{_0xdeacc5(_0x298401[_0x521fbe([0x72,0x65,0x74,0x75,0x72,0x6e])])&&(_0x15cde8=!0x0,_0x2d8e50(_0x298401[_0x521fbe([0x72,0x65,0x74,0x75,0x72,0x6e])]));},{[_0x521fbe([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0x521fbe([0x6c,0x6f,0x77])}),_0x29f715[_0x521fbe([0x74,0x68,0x65,0x6e])](()=>{_0x15cde8||_0x3ef9c7(_0x521fbe([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});});function _0x4bef8f(){return _0x59a423[_0x521fbe([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0x521fbe([0x76,0x69,0x65,0x77])][_0x521fbe([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]==_0x521fbe([0x61,0x75,0x74,0x6f]);}function _0x521fa1(){_0x59a423[_0x521fbe([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0x521fbe([0x76,0x69,0x65,0x77])][_0x521fbe([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]=_0x521fbe([0x61,0x75,0x74,0x6f]);}}function _0x4ccaae(_0x483a87){const _0x39813b=[new window[(_0x521fbe([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x224d05=>setTimeout(_0x224d05,0x3df6fa2d^_0x1540aa)),_0x29f715[_0x521fbe([0x74,0x68,0x65,0x6e])](()=>new window[(_0x521fbe([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x5a27b9=>{let _0x292d6a=0x0;_0x59a423[_0x521fbe([0x6d,0x6f,0x64,0x65,0x6c])][_0x521fbe([0x6f,0x6e])](_0x521fbe([0x61,0x70,0x70,0x6c,0x79,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e]),(_0x2b6ed1,_0x18e6bd)=>{_0x18e6bd[0x0][_0x521fbe([0x69,0x73,0x44,0x6f,0x63,0x75,0x6d,0x65,0x6e,0x74,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e])]&&_0x292d6a++,_0x292d6a==(0x3dffc109^_0x1540aa)&&(_0x5a27b9(),_0x2b6ed1[_0x521fbe([0x6f,0x66,0x66])]());});}))];return window[_0x521fbe([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65])][_0x521fbe([0x72,0x61,0x63,0x65])](_0x39813b)[_0x521fbe([0x74,0x68,0x65,0x6e])](()=>_0x483a87);}async function _0xef2b23(){await _0x29f715,_0x59a423[_0x521fbe([0x6d,0x6f,0x64,0x65,0x6c])][_0x521fbe([0x63,0x68,0x61,0x6e,0x67,0x65])]=_0x22f2f8,_0x59a423[_0x521fbe([0x6d,0x6f,0x64,0x65,0x6c])][_0x521fbe([0x65,0x6e,0x71,0x75,0x65,0x75,0x65,0x43,0x68,0x61,0x6e,0x67,0x65])]=_0x22f2f8,_0x59a423[_0x521fbe([0x65,0x6e,0x61,0x62,0x6c,0x65,0x52,0x65,0x61,0x64,0x4f,0x6e,0x6c,0x79,0x4d,0x6f,0x64,0x65])](_0x521fbe([0x6d,0x6f,0x64,0x65,0x6c]));}function _0x3be8f1(_0x216ffa){const _0x59ca09=_0x389c59();_0x59a423[_0x59ca09]=_0x521fbe([0x61,0x69,0x4c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79])+_0x216ffa,_0x216ffa!=_0x521fbe([0x56,0x61,0x6c,0x69,0x64])&&_0xef2b23();}function _0x389c59(){const _0x53cfab=window[_0x521fbe([0x53,0x74,0x72,0x69,0x6e,0x67])](window[_0x521fbe([0x70,0x65,0x72,0x66,0x6f,0x72,0x6d,0x61,0x6e,0x63,0x65])][_0x521fbe([0x6e,0x6f,0x77])]())[_0x521fbe([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](_0x521fbe([0x2e]),'');let _0x477eb1=_0x521fbe([0x6e]);for(let _0x70922a=0x0;_0x70922a<_0x53cfab[_0x521fbe([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0x70922a+=0x2){let _0x393fdd=window[_0x521fbe([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x53cfab[_0x521fbe([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0x70922a,_0x70922a+0x2));_0x393fdd>=_0x5ccddd[_0x521fbe([0x6c,0x65,0x6e,0x67,0x74,0x68])]&&(_0x393fdd-=_0x5ccddd[_0x521fbe([0x6c,0x65,0x6e,0x67,0x74,0x68])]),_0x477eb1+=_0x5ccddd[_0x393fdd];}return _0x477eb1;}function _0x5eb01a(){const _0x3c1910=_0x26a916[_0x521fbe([0x73,0x70,0x6c,0x69,0x74])](_0x521fbe([0x2e]));if(0x3!=_0x3c1910[_0x521fbe([0x6c,0x65,0x6e,0x67,0x74,0x68])])return null;return _0x9ccf9e(_0x3c1910[0x1]);function _0x9ccf9e(_0x4d5743){const _0x56f6ac=_0x2f61f7(_0x4d5743);return _0x56f6ac&&_0x128f38()?_0x56f6ac:null;function _0x128f38(){const _0x2e5822=_0x56f6ac[_0x521fbe([0x6a,0x74,0x69])],_0x2f76a0=window[_0x521fbe([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x2e5822[_0x521fbe([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0x2e5822[_0x521fbe([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8),0x10),_0x38be94={..._0x56f6ac,[_0x521fbe([0x6a,0x74,0x69])]:_0x2e5822[_0x521fbe([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](0x0,_0x2e5822[_0x521fbe([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8)};return delete _0x38be94[_0x521fbe([0x76,0x63])],_0x321e73(_0x38be94)==_0x2f76a0;}}}async function _0x1372d4(){let _0x40b081=!0x0;try{const _0x5bc7fe=_0x26a916[_0x521fbe([0x73,0x70,0x6c,0x69,0x74])](_0x521fbe([0x2e])),[_0xf250ad,_0x393a0e,_0x48d35a]=_0x5bc7fe;return _0x7a0777(_0xf250ad),await _0x4a2199(_0xf250ad,_0x393a0e,_0x48d35a),_0x40b081;}catch{return!0x1;}function _0x7a0777(_0x5f7c7c){const _0xce4d83=_0x2f61f7(_0x5f7c7c);_0xce4d83&&_0xce4d83[_0x521fbe([0x61,0x6c,0x67])]==_0x521fbe([0x45,0x53,0x32,0x35,0x36])||(_0x40b081=!0x1);}async function _0x4a2199(_0x522bf9,_0x48ba5d,_0x42ee8a){const _0x5b0b9e=window[_0x521fbe([0x55,0x69,0x6e,0x74,0x38,0x41,0x72,0x72,0x61,0x79])][_0x521fbe([0x66,0x72,0x6f,0x6d])](_0x32063b(_0x42ee8a),_0x2083a3=>_0x2083a3[_0x521fbe([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](0x0)),_0x2353c5=new window[(_0x521fbe([0x54,0x65,0x78,0x74,0x45,0x6e,0x63,0x6f,0x64,0x65,0x72]))]()[_0x521fbe([0x65,0x6e,0x63,0x6f,0x64,0x65])](_0x522bf9+_0x521fbe([0x2e])+_0x48ba5d),_0x2e7d6a=window[_0x521fbe([0x63,0x72,0x79,0x70,0x74,0x6f])][_0x521fbe([0x73,0x75,0x62,0x74,0x6c,0x65])];if(!_0x2e7d6a)return;const _0x4f28eb=await _0x2e7d6a[_0x521fbe([0x69,0x6d,0x70,0x6f,0x72,0x74,0x4b,0x65,0x79])](_0x521fbe([0x6a,0x77,0x6b]),_0x242018,{[_0x521fbe([0x6e,0x61,0x6d,0x65])]:_0x521fbe([0x45,0x43,0x44,0x53,0x41]),[_0x521fbe([0x6e,0x61,0x6d,0x65,0x64,0x43,0x75,0x72,0x76,0x65])]:_0x521fbe([0x50,0x2d,0x32,0x35,0x36])},!0x1,[_0x521fbe([0x76,0x65,0x72,0x69,0x66,0x79])]);await _0x2e7d6a[_0x521fbe([0x76,0x65,0x72,0x69,0x66,0x79])]({[_0x521fbe([0x6e,0x61,0x6d,0x65])]:_0x521fbe([0x45,0x43,0x44,0x53,0x41]),[_0x521fbe([0x68,0x61,0x73,0x68])]:{[_0x521fbe([0x6e,0x61,0x6d,0x65])]:_0x521fbe([0x53,0x48,0x41,0x2d,0x32,0x35,0x36])}},_0x4f28eb,_0x5b0b9e,_0x2353c5)||(_0x40b081=!0x1);}}function _0x2f61f7(_0x749bd3){return _0x749bd3[_0x521fbe([0x73,0x74,0x61,0x72,0x74,0x73,0x57,0x69,0x74,0x68])](_0x521fbe([0x65,0x79]))?JSON[_0x521fbe([0x70,0x61,0x72,0x73,0x65])](_0x32063b(_0x749bd3)):null;}function _0x32063b(_0x11b37c){return window[_0x521fbe([0x61,0x74,0x6f,0x62])](_0x11b37c[_0x521fbe([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/-/g,_0x521fbe([0x2b]))[_0x521fbe([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/_/g,_0x521fbe([0x2f])));}function _0x321e73(_0x4ebd38){let _0x25c334=0x1505;function _0xd4d670(_0x3e8de0){for(let _0x176abd=0x0;_0x176abd<_0x3e8de0[_0x521fbe([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0x176abd++){const _0x4265d6=_0x3e8de0[_0x521fbe([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](_0x176abd);_0x25c334=(_0x25c334<<0x5)+_0x25c334+_0x4265d6,_0x25c334&=_0x25c334;}}function _0x44c70b(_0x44cb84){Array[_0x521fbe([0x69,0x73,0x41,0x72,0x72,0x61,0x79])](_0x44cb84)?_0x44cb84[_0x521fbe([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](_0x44c70b):_0x44cb84&&typeof _0x44cb84==_0x521fbe([0x6f,0x62,0x6a,0x65,0x63,0x74])?Object[_0x521fbe([0x65,0x6e,0x74,0x72,0x69,0x65,0x73])](_0x44cb84)[_0x521fbe([0x73,0x6f,0x72,0x74])]()[_0x521fbe([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](([_0x2fddf6,_0x400b98])=>{_0xd4d670(_0x2fddf6),_0x44c70b(_0x400b98);}):_0xd4d670(window[_0x521fbe([0x53,0x74,0x72,0x69,0x6e,0x67])](_0x44cb84));}return _0x44c70b(_0x4ebd38),_0x25c334>>>0x0;}function _0xff57a0(_0x1c5dd2){return _0x1c5dd2[_0x521fbe([0x74,0x6f,0x53,0x74,0x72,0x69,0x6e,0x67])](0x10)[_0x521fbe([0x70,0x61,0x64,0x53,0x74,0x61,0x72,0x74])](0x8,_0x521fbe([0x30]));}function _0x850595(_0x51a4cb){return _0x51a4cb[_0x521fbe([0x73,0x70,0x6c,0x69,0x74])]('')[_0x521fbe([0x72,0x65,0x76,0x65,0x72,0x73,0x65])]()[_0x521fbe([0x6a,0x6f,0x69,0x6e])]('');}function _0x22f2f8(){}function _0x521fbe(_0x58d34c){return _0x58d34c['map'](_0x8446d3=>String['fromCharCode'](_0x8446d3))['join']('');}_0x3be8f1(await _0x1ac0e1());}(this);}['showFakeVisualSelection'](){const _0x3ba8c2=this['editor']['model'];_0x3ba8c2['change'](_0x385f86=>{const _0x37548e=_0x3ba8c2['document']['selection']['getRanges']();let _0x258479=0x0;for(const _0x29f845 of _0x37548e){const _0x110dd1=Oi+':'+_0x258479;if(_0x3ba8c2['markers']['has'](_0x110dd1))_0x385f86['updateMarker'](_0x110dd1,{'range':_0x29f845});else{if(_0x29f845['start']['isAtEnd']){const _0x54f10c=_0x29f845['start']['getLastMatchingPosition'](({item:_0x3cfec8})=>!_0x3ba8c2['schema']['isContent'](_0x3cfec8),{'boundaries':_0x29f845});_0x385f86['addMarker'](_0x110dd1,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x385f86['createRange'](_0x54f10c,_0x29f845['end'])});}else _0x385f86['addMarker'](_0x110dd1,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x29f845});}_0x258479++;}});}['hideFakeVisualSelection'](){const _0x8cbe9a=this['editor']['model'],_0x484810=Array['from'](this['editor']['model']['markers']['getMarkersGroup'](Oi));_0x484810['length']&&_0x8cbe9a['change'](_0x279ccc=>{_0x484810['forEach'](_0x35e8e9=>{_0x279ccc['removeMarker'](_0x35e8e9);});});}['insertContent'](_0x156dba,_0x34cb24){const _0x811bf=this['_getAISelection'](),_0xdc56c=_0x34cb24||_0x811bf['getFirstRange']();this['editor']['model']['canEditAt'](_0xdc56c)&&this['editor']['model']['change'](_0x188595=>{this['hideFakeVisualSelection'](),_0x34cb24||this['_resetContentOfSelectedTableCells'](_0x188595,_0x811bf),this['_pasteHTMLUsingClipboard']({'insertAt':_0xdc56c,'writer':_0x188595,'html':_0x156dba});});}['insertContentBelow'](_0x4a04a7){const {model:_0x416efe}=this['editor'],_0x17ae5b=this['_getAISelection']();_0x416efe['change'](()=>{const _0x6602b3=this['_prepareTableInsertBelowPosition'](_0x4a04a7,_0x17ae5b)||this['_getDefaultInsertBelowPosition'](_0x17ae5b);this['insertContent'](_0x4a04a7,_0x6602b3);});}['_getAISelection'](){const _0x592071=this['editor']['model'],_0x597607=Array['from'](_0x592071['markers']['getMarkersGroup'](Oi))['map'](_0x393abf=>_0x393abf['getRange']());return _0x592071['createSelection'](_0x597607);}['_pasteHTMLUsingClipboard']({writer:_0x2adc41,html:_0x396419,insertAt:_0x3f6cca}){const {view:_0x3ff091}=this['editor']['editing'],_0x5f5825=this['editor']['plugins']['get'](_0x40ccc9),_0x3e8b18=new Ri();_0x3e8b18['setData']('text/html',_0x396419);const _0x325060=new ClipboardEvent('paste',{'clipboardData':_0x3e8b18}),_0x3ddcab=new _0x480413(_0x3ff091,_0x325060,{'dataTransfer':new _0x309e15(_0x3e8b18)});_0x2adc41['setSelection'](_0x3f6cca);const _0x1257f5=(_0x47b1d7,_0x38a85f)=>{_0x38a85f['resultRange']&&_0x2adc41['setSelection'](_0x38a85f['resultRange']);};_0x5f5825['once']('contentInsertion',_0x1257f5,{'priority':'lowest'}),_0x3ff091['document']['fire']('paste',_0x3ddcab),_0x5f5825['off']('contentInsertion',_0x1257f5);}['_getDefaultInsertBelowPosition'](_0x2cfdb7){const {model:_0x238d45}=this['editor'],_0x288b51=Array['from'](_0x2cfdb7['getSelectedBlocks']());return _0x288b51['length']?_0x238d45['createPositionAfter'](_0x288b51['pop']()):_0x2cfdb7['getLastPosition']();}['_prepareTableInsertBelowPosition'](_0x83205f,_0x168eac){const {model:_0x3b1d76,plugins:_0x1612c3}=this['editor'];if(_0x1612c3['has']('TableUtils')){const _0x53f207=_0x1612c3['get']('TableUtils')['getSelectedTableCells'](_0x168eac);if(_0x53f207['length']){const _0x1be10f=this['_getTableRowCountFromContent'](_0x83205f),_0x808653=this['_createEmptyTableRows'](_0x53f207,_0x1be10f);return _0x3b1d76['createPositionAt'](_0x808653,0x0);}}return null;}['_getTableRowCountFromContent'](_0x35a5c7){const _0x346d37=this['editor']['plugins']['get']('TableUtils'),_0x269dd3=this['editor']['data']['parse'](_0x35a5c7),_0x16130a=Array['from'](_0x269dd3['getChildren']())['filter'](_0x459d39=>_0x459d39['is']('element','table'));let _0x467e82=0x0;return _0x16130a['forEach'](_0x661a55=>{_0x467e82+=_0x346d37['getRows'](_0x661a55);}),_0x467e82;}['_createEmptyTableRows'](_0x4bf0c3,_0x181615){const _0x2d67fd=this['editor']['plugins']['get']('TableUtils'),_0x5033f5=_0x2d67fd['getRowIndexes'](_0x4bf0c3),_0x31e736=_0x2d67fd['getColumnIndexes'](_0x4bf0c3),_0x2049f5=_0x5033f5['last']+0x1,_0x1386ab=_0x31e736['first'],_0x5d015f=_0x4bf0c3[0x0]['findAncestor']('table');for(let _0x3b1b07=0x0;_0x3b1b07<_0x181615;_0x3b1b07++)_0x2d67fd['insertRows'](_0x5d015f,{'at':_0x2049f5});return _0x5d015f['getChild'](_0x2049f5)['getChild'](_0x1386ab);}['_resetContentOfSelectedTableCells'](_0x12a9d5,_0x47c778){const {plugins:_0x2f0ad4}=this['editor'],{model:_0x220176}=_0x12a9d5;if(!_0x2f0ad4['has']('TableUtils'))return;_0x2f0ad4['get']('TableUtils')['getSelectedTableCells'](_0x47c778)['length']&&_0x220176['deleteContent'](_0x47c778);}}class Ni extends _0x10493d{static get['pluginName'](){return'AIAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['afterInit'](){if(!this['textAdapter'])throw new ht('aiadapter-text-adapter-not-set',null);}}class vi extends Error{constructor(_0x383982){super(_0x383982),this['name']='AIRequestError';}}function yi(_0x3ad04a,_0x4d7c5a,_0x37832d){const t=_0x3ad04a['t'];switch(_0x4d7c5a){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',_0x37832d);case'Error\x20during\x20AI\x20content\x20generation:\x20%0':return t('Error\x20during\x20AI\x20content\x20generation:\x20%0',_0x37832d);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'},_0x37832d);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_FAILED':return t({'id':'AI_ERROR_FAILED','string':'Failed\x20to\x20communicate\x20with\x20the\x20AI\x20service'});default:return _0x4d7c5a;}}class xi extends _0x10c9cf{['_commandDefinitions'];constructor(_0x4031d1,_0x55188e){super(_0x4031d1),this['_commandDefinitions']=_0x55188e,this['set']('enabledCommandsIds',[]),this['on']('change:_hasContext',(_0x366f67,_0x50458d,_0x54de80)=>{this['isEnabled']&&(this['enabledCommandsIds']=Li(this['_commandDefinitions'],_0x54de80));}),this['set']('_hasContext',!0x1),this['on']('change:isEnabled',(_0x3926de,_0x115a87,_0x2d409b)=>{this['enabledCommandsIds']=_0x2d409b?Li(this['_commandDefinitions'],this['_hasContext']):[];});}['refresh'](){const _0xbd3e72=this['editor']['model'];this['_hasContext']=function(_0x360bc3){const _0x8d00ec=_0x360bc3['document']['selection'];return _0x8d00ec['isCollapsed']?0x0!==[..._0x8d00ec['getSelectedBlocks']()]['length']&&![..._0x8d00ec['getSelectedBlocks']()][0x0]['isEmpty']:!!_0x360bc3['hasContent'](_0x8d00ec['getFirstRange']());}(_0xbd3e72);const _0xf9a47c=_0xbd3e72['document']['selection'],_0x47e0b4=this['editor']['config']['get']('ai.assistant.disabledElements');for(const _0x53cb74 of _0xf9a47c['getRanges']())for(const _0x21f23c of _0x53cb74['getItems']())if(_0x21f23c['is']('element')&&_0x47e0b4['includes'](_0x21f23c['name']))return void(this['isEnabled']=!0x1);this['isEnabled']=!0x0;}['execute'](_0x2e8b30='',_0x2a4e04='',_0x4e92ba='custom'){this['editor']['plugins']['get'](Xi)['showUI'](_0x2e8b30,_0x2a4e04,_0x4e92ba);}}function Li(_0x407fca,_0x178908){const _0x52a237=new Set();for(const _0x27462e of _0x407fca['values']())(_0x178908||!0x1===_0x27462e['requiresContent'])&&_0x52a237['add'](_0x27462e['id']);return Array['from'](_0x52a237);}const Di=new RegExp(/^(.*?)<[a-zA-Z][a-zA-Z0-9_\-.]*[ >]/,'is');class Pi extends/* #__PURE__ -- @preserve */
|
|
24
|
-
ct(){['editor'];['textAdapter'];['view'];['_sanitizationContainer'];['_domParser'];['_xmlSerializer'];constructor(_0x101db3,_0x42a196,_0x54b975){super(),this['editor']=_0x101db3,this['textAdapter']=_0x42a196,this['_sanitizationContainer']=document['createElement']('div'),this['_domParser']=new DOMParser(),this['_xmlSerializer']=new XMLSerializer(),this['view']=_0x54b975,this['set']({'initialContext':'','currentContext':'','currentResponse':'','previousContext':void 0x0,'previousQuery':void 0x0,'previousLabel':void 0x0,'isProcessing':!0x1}),this['on']('set:currentContext',(_0x1168c7,_0x4b09e8,_0x21fbd5)=>{this['view']['value']=this['_sanitizeHTML'](_0x21fbd5);}),this['listenTo'](this['view'],'submitPrompt',(_0xb9f15a,_0x53919c)=>{const _0x255cf3=this['currentContext']||this['initialContext'];this['_handleQuery'](_0x53919c,_0x255cf3,'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:_0xa10c33,query:_0x30a607,htmlContent:_0x2034bf,label:_0x1b5bd9,mainActionLabel:_0x2b70fb}){this['view']['prompt']=_0x1b5bd9,this['view']['mainAction']=_0x2b70fb,this['initialContext']=_0x2034bf,_0x30a607&&(this['view']['isRendered']?this['_handleQuery'](_0x30a607,_0x2034bf,_0xa10c33,_0x1b5bd9):this['view']['once']('render',()=>{this['_handleQuery'](_0x30a607,_0x2034bf,_0xa10c33,_0x1b5bd9);}));}['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'](_0x2cee87,_0x3031c4,_0xcf82e6,_0x516f71){return this['isProcessing']=!0x0,this['view']['startProcessing'](),this['previousContext']=_0x3031c4,this['previousQuery']=_0x2cee87,this['previousLabel']=_0x516f71||_0x2cee87,this['previousActionId']=_0xcf82e6,new Promise(_0x17ad00=>{this['textAdapter']['makeRequest']({'query':_0x2cee87,'context':_0x3031c4,'onData':_0x39ed5f=>{this['currentResponse']=_0x39ed5f,this['currentContext']=this['_parseAndNormalizeContent'](this['currentResponse']);},'actionId':_0xcf82e6})['then'](()=>{!this['currentContext']&&this['currentResponse']&&(this['currentContext']=this['_parseAndNormalizeContent'](this['currentResponse'],!0x0));})['catch'](_0x887c6f=>{_0x887c6f instanceof vi?this['view']['handleError'](_0x887c6f['message']):this['view']['handleError'](),_0x17ad00();})['finally'](()=>{this['stopProcessing'](),_0x17ad00();});});}['_parseAndNormalizeContent'](_0x349ca2,_0x190641=!0x1){const _0x2fd63c=Di['exec'](_0x349ca2);_0x349ca2=_0x2fd63c?_0x349ca2['substring'](_0x2fd63c[0x1]['length']):_0x349ca2['length']<0x64&&!_0x190641?'':this['_stripMarkdownSyntax'](_0x349ca2);const _0x3a4e63=this['_domParser']['parseFromString'](_0x349ca2,'text/html');if(_0x2fd63c){const _0x177a9c=Array['from'](_0x3a4e63['body']['childNodes']);_0x177a9c['reverse']();for(const _0x2c07f9 of _0x177a9c){if(_0x2c07f9['nodeType']==Node['ELEMENT_NODE'])break;_0x2c07f9['remove']();}}const _0x5b9329=this['editor']['data']['processor']['toView'](this['_xmlSerializer']['serializeToString'](_0x3a4e63['body']));this['_isH1TagSupportEnabled']()||this['_normalizeResponseHeadings'](_0x5b9329);const _0x2fa1cd=this['editor']['config']['get']('ai.assistant.preserveComments'),_0x2d86d5=this['editor']['data']['toModel'](_0x5b9329);return _0x2fa1cd||_0x2d86d5['markers']['clear'](),this['editor']['data']['stringify'](_0x2d86d5);}['_normalizeResponseHeadings'](_0x335c83){const _0x339776=new _0x532020(this['editor']['editing']['view']['document']),_0x331069=new _0x48c970({'name':/^h[1-5]$/}),_0x2b7db2=[];let _0x368856=!0x1;for(const _0x27f619 of _0x335c83)_0x27f619['is']('element')&&_0x331069['match'](_0x27f619)&&(_0x2b7db2['push'](_0x27f619),'h1'==_0x27f619['name']&&(_0x368856=!0x0));if(_0x368856){for(const _0x450db4 of _0x2b7db2)_0x339776['rename']('h'+(parseInt(_0x450db4['name'][0x1])+0x1),_0x450db4);}}['_isH1TagSupportEnabled'](){const {data:_0x4a95aa,editing:_0x3e9c89}=this['editor'],_0x528db0=_0x4a95aa['htmlProcessor']['toView']('<h1></h1>'),_0x3f6a7e=_0x4a95aa['toView'](_0x4a95aa['toModel'](_0x528db0));return!!_0x3e9c89['view']['domConverter']['viewToDom'](_0x3f6a7e)['querySelector']('h1');}['_sanitizeHTML'](_0x18c5c){return this['editor']['editing']['view']['domConverter']['setContentOf'](this['_sanitizationContainer'],_0x18c5c),this['_sanitizationContainer']['innerHTML'];}['_stripMarkdownSyntax'](_0x14ef8d){const _0x9e379a=_0x14ef8d['trim']();return _0x9e379a['startsWith']('```html')?_0x9e379a['endsWith']('```')?_0x9e379a['substring'](0x7,_0x9e379a['length']-0x3):_0x9e379a['substring'](0x7):_0x14ef8d;}}const Hi={'REPLACE':'replace','INSERT':'insert'};class Mi extends kt{constructor(_0x1ec02e){super(_0x1ec02e),this['set']('isVisible',!0x1),this['set']('mainAction',Hi['REPLACE']),this['replaceButton']=this['_createButton']('','ck-button-action'),this['replaceButton']['bind']('label')['to'](this,'mainAction',_0x286d84=>yi(_0x1ec02e,'AI_'+_0x286d84['toUpperCase']()+'_CONTENT')),this['insertButton']=this['_createButton'](yi(_0x1ec02e,'Insert\x20below')),this['tryAgainButton']=this['_createButton'](yi(_0x1ec02e,'Try\x20again')),this['stopButton']=this['_createButton'](yi(_0x1ec02e,'Stop'));const _0x3077fe=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':['ck-ai-form__toolbar',_0x3077fe['if']('isVisible','ck-hidden',_0x16c43d=>!_0x16c43d)]}}),this['items']['addMany']([this['replaceButton'],this['insertButton'],this['tryAgainButton'],this['stopButton']]);}['_createButton'](_0x429dd4,_0x3e705d){const _0x776439=new Nt(this['locale']);return _0x776439['set']({'label':_0x429dd4,'class':_0x3e705d||'','isVisible':!0x0,'withText':!0x0}),_0x776439;}}class Ui extends vt{['contentFieldView'];['copyButtonView'];constructor(_0x5c4742,_0x32d32f=''){super(_0x5c4742),this['set']({'value':null,'isVisible':!0x1,'isProcessing':!0x1});const _0x621503=this['bindTemplate'];this['contentFieldView']=new Vi(_0x5c4742,_0x32d32f),this['copyButtonView']=this['_createCopyButton'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area-wrapper',_0x621503['if']('isVisible','ck-hidden',_0x1cd681=>!_0x1cd681)],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area',_0x621503['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 _0x16e3c2=!0x1;this['on']('change:value',(_0x3f6de5,_0xe01a46,_0xabb177)=>{const _0x4ee283=!this['contentFieldView']['element']['querySelector']('.ck-ai-form__loader');this['contentFieldView']['setContent'](_0xabb177),this['isProcessing']&&_0x4ee283&&!_0x16e3c2&&this['element']['scrollTo']({'top':this['element']['scrollHeight'],'behavior':'smooth'});}),this['on']('change:isProcessing',(_0x210b25,_0x66fc4a,_0x13e9be)=>{_0x16e3c2=!0x1,_0x13e9be?(this['value']=null,this['contentFieldView']['appendLoader']()):this['value']||this['contentFieldView']['setContent']('');}),this['listenTo'](this['element'],'wheel',()=>{_0x16e3c2=!0x0;}),this['listenTo'](this['element'],'mousedown',()=>{_0x16e3c2=!0x0;});}['focus'](){this['element']['focus']();}['_createCopyButton'](){const _0x2a23bb=this['locale'],_0x5e5f29=new Nt(this['locale']),_0xc87df0='ck-ai-form__copy-button';return _0x5e5f29['set']({'label':yi(_0x2a23bb,'Copy'),'icon':_0x5804e6,'class':_0xc87df0,'tooltip':!0x0}),_0x5e5f29['bind']('isVisible')['to'](this,'value',_0xbb7f6b=>!!_0xbb7f6b),_0x5e5f29['bind']('isEnabled')['to'](this,'isProcessing',_0x2bbe48=>!_0x2bbe48),_0x5e5f29['on']('execute',()=>{this['_copyHTMLToClipboard'](this['contentFieldView']['element']),_0x5e5f29['icon']=_0x27f2cb,_0x5e5f29['class']=_0xc87df0+'\x20ck-ai-form__copy-button--copied',this['focus'](),setTimeout(()=>{_0x5e5f29['icon']=_0x5804e6,_0x5e5f29['class']=_0xc87df0;},0x3e8);}),_0x5e5f29;}['_copyHTMLToClipboard'](_0x162bd7){const {window:_0x59e166,document:_0x2fada8}=lt;if(_0x59e166['ClipboardItem']){const {Blob:_0x2549e2,ClipboardItem:_0x5384e5}=_0x59e166,_0x18acfb=[new _0x5384e5({'text/html':new _0x2549e2([_0x162bd7['innerHTML']],{'type':'text/html'}),'text/plain':new _0x2549e2([_0x162bd7['textContent']||''],{'type':'text/plain'})})];navigator['clipboard']['write'](_0x18acfb);}else{const _0x318150=_0x2fada8['createElement']('div');_0x318150['style']['position']='absolute',_0x318150['style']['left']='-9999px',_0x318150['innerHTML']='<span>[</span>'+_0x162bd7['innerHTML']+'<span>]</span>',_0x2fada8['body']['appendChild'](_0x318150);const _0xc89fd=_0x2fada8['createRange']();_0xc89fd['setStartAfter'](_0x318150['firstElementChild']),_0xc89fd['setEndBefore'](_0x318150['lastElementChild']);const _0x47be45=_0x59e166['getSelection']();_0x47be45['removeAllRanges'](),_0x47be45['addRange'](_0xc89fd),_0x2fada8['execCommand']('copy'),_0x318150['remove']();}}}class Vi extends vt{constructor(_0x338a93,_0x4c69a0=''){super(_0x338a93),this['loaderView']=this['_createLoader'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-content',_0x4c69a0,'ck-reset_all-excluded','ck-ai-form__content-field']}});}['setContent'](_0x23c329){this['element']['innerHTML']=_0x23c329;}['appendLoader'](){this['element']['appendChild'](this['loaderView']['element']);}['_createLoader'](){const _0x4bcb78=new vt(),_0x35603c=this['locale'],_0x1b4781=new yt();return _0x1b4781['isVisible']=!0x0,_0x4bcb78['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__loader']},'children':[_0x1b4781,{'text':yi(_0x35603c,'AI\x20is\x20writing...')}]}),_0x4bcb78['render'](),_0x4bcb78;}}class Bi extends vt{constructor(_0x5cd831,_0x3b5851=''){super(_0x5cd831);const _0x193e6a=new xt(),_0x203322=this['bindTemplate'];this['set']('text',_0x3b5851),_0x193e6a['content']=_0x3fb858,this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__error']},'children':[_0x193e6a,{'text':_0x203322['to']('text')}]});}}class Gi extends Lt{['submitButtonView'];['showHistoryButtonView'];constructor(_0x1650f5,_0x504c2c){super(_0x1650f5,_0x504c2c),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',(_0x27a967,_0x533e45)=>{_0x27a967['target']==this['queryView']['fieldView']['element']&&(this['submit'](),_0x533e45());});}['_createSubmitButton'](){const _0x1e34ca=new Nt(this['locale']),_0x260730=this['locale'];return _0x1e34ca['set']({'icon':_0x44c7fc,'label':yi(_0x260730,'Submit'),'isVisible':!0x0,'tooltip':!0x0,'class':'ck-ai-form__submit'}),_0x1e34ca['on']('execute',()=>{this['submit']();}),_0x1e34ca['bind']('isEnabled')['to'](this['queryView']['fieldView'],'isEmpty',this,'isEnabled',(_0x381d6b,_0x231fa3)=>!_0x381d6b&&_0x231fa3),_0x1e34ca;}['_createShowHistoryButton'](){const _0x4a49bd=new Nt(this['locale']),_0x54db6e=this['resultsView'],_0x2cb5de=this['locale'];_0x4a49bd['set']({'label':yi(_0x2cb5de,'History'),'withText':!0x1,'icon':_0x468df9,'tooltip':!0x0,'tooltipPosition':'sw','class':'ck-ai-form__toggle-history'}),_0x4a49bd['bind']('isOn')['to'](_0x54db6e,'isVisible'),_0x4a49bd['bind']('isEnabled')['to'](this,'isEnabled'),_0x4a49bd['on']('execute',()=>{_0x54db6e['isVisible']=!_0x54db6e['isVisible'],_0x54db6e['isVisible']?this['filteredView']['focus']():this['focus']();});const _0x34ce4f=()=>{lt['window']['requestAnimationFrame'](()=>{if(ut(this['element'])){const _0x495108=new dt(this['queryView']['fieldView']['element']),_0x22397c=_0x495108['width'],_0x2c3e56='rtl'===_0x2cb5de['uiLanguageDirection']?'left':'right';_0x495108['excludeScrollbarsAndBorders'](),_0x4a49bd['element']['style'][_0x2c3e56]=_0x22397c-_0x495108['width']+0x1+'px';}});};return this['queryView']['fieldView']['on']('update',_0x34ce4f),this['on']('render',_0x34ce4f),_0x4a49bd;}['submit'](){const _0x293357=this['queryView']['fieldView']['element']['value'];this['fire']('submit',_0x293357);}['focus'](_0x48558c){-0x1===_0x48558c?this['focusCycler']['focusLast']():this['focusCycler']['focusFirst']();}}class Fi extends Dt{['historyGroupView'];['clearHistoryButton'];constructor(_0x3ba3c4){super(_0x3ba3c4),this['clearHistoryButton']=this['_createClearHistoryButton'](),this['historyGroupView']=new Pt(),this['historyGroupView']['children']['add'](this['clearHistoryButton'],0x1),this['historyGroupView']['label']=yi(_0x3ba3c4,'Prompt\x20history'),this['historyGroupView']['items']['delegate']('execute')['to'](this),this['items']['add'](this['historyGroupView']);}['filter'](){let _0x4d16cc=0x0;for(const _0x37b7c7 of this['items'])_0x4d16cc+=_0x37b7c7['items']['length'];return{'resultsCount':_0x4d16cc,'totalItemsCount':_0x4d16cc};}['_createClearHistoryButton'](){const _0x2abf86=this['locale'],_0x28f319=new Nt(this['locale']);return _0x28f319['set']({'label':'('+yi(_0x2abf86,'Clear')+')','withText':!0x0}),_0x28f319['on']('execute',()=>this['fire']('clearHistory')),_0x28f319;}}class Ki extends Ht{constructor(_0x4a243d){super();const _0x3ba741=new Mt(),_0x44347d=new Nt(this['locale'],_0x3ba741);this['children']['add'](_0x44347d),_0x44347d['set']({'label':_0x4a243d['prompt'],'withText':!0x0}),_0x44347d['on']('execute',()=>{this['fire']('execute',{'value':_0x1325ef(_0x4a243d['prompt'])});});}}const Wi='CKEditor/AIFormView/PromptHistory';class Yi extends _t{constructor(){super(),this['_loadFromSessionStorage'](),this['on']('add',(_0x48b71c,_0x18114b)=>{const _0x374b45=$i(_0x18114b['prompt']);for(const _0x4750fe of this)if(_0x4750fe!=_0x18114b&&$i(_0x4750fe['prompt'])===_0x374b45){this['remove'](_0x4750fe);break;}this['length']>0x14&&this['remove'](this['last']),this['_saveToSessionStorage']();}),this['on']('remove',()=>{this['_saveToSessionStorage']();});}['_loadFromSessionStorage'](){const _0x23069e=sessionStorage['getItem'](Wi)||'[]';this['addMany'](JSON['parse'](_0x23069e));}['_saveToSessionStorage'](){sessionStorage['setItem'](Wi,JSON['stringify'](this['map'](_0x1254fc=>_0x1254fc)));}}function $i(_0x17b592){return _0x17b592['toLowerCase']()['trim']();}class qi extends vt{['focusTracker'];['keystrokes'];['contentArea'];['toolbar'];['promptView'];['errorView'];['_focusables'];['focusCycler'];['_promptHistory'];constructor(_0x586cd3,_0x47bd06,_0x497b39=''){super(_0x586cd3),this['set']('isEnabled',!0x0),this['set']('isProcessing',!0x1),this['set']('prompt',''),this['set']('value',''),this['set']('isError',!0x1),this['set']('mainAction',Hi['REPLACE']),this['_promptHistory']=new Yi(),this['errorView']=new Bi(_0x586cd3),this['contentArea']=new Ui(_0x586cd3,_0x497b39),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 At(),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 _0x5d0af2=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form',_0x47bd06],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-form-content']},'children':[{'tag':'div','attributes':{'class':[_0x5d0af2['if']('isError','ck-hidden',_0x439711=>!_0x439711)]},'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'](_0x5807e1=0x1){-0x1===_0x5807e1?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 _0x326237=this['locale'],_0x6a8119=new Gi(_0x326237,{'queryView':{'label':yi(_0x326237,'Ask\x20AI\x20to\x20edit\x20or\x20generate'),'creator':Vt,'showIcon':!0x1,'showResetButton':!0x1},'infoView':{'text':{'noSearchableItems':{'primary':yi(_0x326237,'Empty\x20history'),'secondary':yi(_0x326237,'Ask\x20AI\x20and\x20your\x20prompts\x20will\x20be\x20listed\x20here\x20for\x20you\x20to\x20use\x20later.')}}},'filteredView':this['_createHistoryView'](),'queryMinChars':0x1/0x0,'resetOnBlur':!0x1});return _0x6a8119['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',(_0x2253f2,_0x5cad61)=>_0x2253f2&&!_0x5cad61),this['listenTo'](_0x6a8119,'submit',(_0x473073,_0x5a808a)=>{this['prompt']=_0x5a808a;const _0x2a3024=_0x575f0b(_0x5a808a);this['fire']('submitPrompt',_0x2a3024),_0x5a808a['trim']()&&this['_promptHistory']['add']({'prompt':_0x2a3024},0x0);},{'priority':'high'}),_0x6a8119;}['_createHistoryView'](){const _0x3fb33c=new Fi(this['locale']);return _0x3fb33c['historyGroupView']['items']['bindTo'](this['_promptHistory'])['as'](Ki),_0x3fb33c['on']('clearHistory',()=>{this['_promptHistory']['clear'](),this['promptView']['search'](''),this['promptView']['focus']();}),_0x3fb33c;}['_createToolbar'](){const _0x6ba8=new Mi(this['locale']);return _0x6ba8['replaceButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',this,'value',(_0x14cd34,_0x49260d,_0xfea5a0)=>_0x14cd34&&!_0x49260d&&!!_0xfea5a0),_0x6ba8['replaceButton']['delegate']('execute')['to'](this,'replaceContent'),_0x6ba8['insertButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',this,'value',(_0x525214,_0x32c282,_0x5d100a)=>_0x525214&&!_0x32c282&&!!_0x5d100a),_0x6ba8['insertButton']['delegate']('execute')['to'](this,'insertContentBelow'),_0x6ba8['tryAgainButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',(_0x1248ec,_0x2bfba0)=>_0x1248ec&&!_0x2bfba0),_0x6ba8['tryAgainButton']['delegate']('execute')['to'](this,'tryAgainEvent'),_0x6ba8['stopButton']['bind']('isEnabled')['to'](this,'isProcessing'),_0x6ba8['stopButton']['delegate']('execute')['to'](this,'stopProcessing'),_0x6ba8;}['startProcessing'](){this['value']='',this['isError']=!0x1,this['isProcessing']=!0x0,this['contentArea']['isVisible']=!0x0,this['toolbar']['isVisible']=!0x0,this['contentArea']['focus']();}['finishProcessing'](){const _0x1dcbdc=this['locale'];this['isProcessing']=!0x1,this['prompt']='',this['promptView']['reset'](),this['value']&&(this['promptView']['queryView']['label']=yi(_0x1dcbdc,'Ask\x20AI\x20to\x20improve\x20generated\x20text'));}['handleError'](_0x4015a6){const _0x1e88e2=this['locale'];this['finishProcessing'](),this['isError']=!0x0,this['errorView']['text']=_0x4015a6||yi(_0x1e88e2,'AI_ERROR_FAILED'),this['value']||(this['contentArea']['isVisible']=!0x1);}}const Qi=globalThis['DataTransfer'];class Xi extends _0x10493d{['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[_0x1c0d8f,ki,Ni,Bt];}constructor(_0x3c5582){super(_0x3c5582),_0x3c5582['config']['define']('ai.assistant.disabledElements',['media','rawHtml','tableOfContents']),_0x3c5582['config']['define']('ai.assistant.contentAreaCssClass',''),_0x3c5582['config']['define']('ai.assistant.useTheme',!0x0),this['_uiCssClasses']='ck-ai-assistant-ui'+(_0x3c5582['config']['get']('ai.assistant.useTheme')?'\x20ck-ai-assistant-ui_theme':'');}['init'](){const {editor:_0x355373}=this;this['_aiAdapter']=_0x355373['plugins']['get'](Ni),this['_dialog']=_0x355373['plugins']['get'](Bt),this['_formView']=null,this['_commandDefinitions']=this['_getResolvedCommandsDefinitions']();const _0x237658=new xi(_0x355373,Array['from'](this['_commandDefinitions']['values']()));_0x355373['commands']['add']('showAIAssistant',_0x237658),_0x355373['ui']['componentFactory']['add']('aiCommands',_0x584960=>{const _0x5afbb6=Gt(_0x584960);return _0x5afbb6['set']({'class':'ck-ai-commands-dropdown\x20'+this['_uiCssClasses']}),_0x5afbb6['buttonView']['set']({'label':yi(_0x584960,'AI\x20Commands'),'icon':_0x39348e,'tooltip':!0x0}),_0x5afbb6['on']('execute',_0x1eb2f4=>this['_onExecute'](_0x1eb2f4['source']['id'])),Ft(_0x5afbb6,_0x355373['ui']['view']['body'],function(_0x164653){const _0x3b06c5=bi(_0x164653['config']['get']('ai.assistant.commands'),_0x164653['locale']),_0x412b60=ji(_0x164653,_0x3b06c5)['filter'](_0x5500bc=>_0x5500bc['commands']['length']);if(0x1===_0x412b60['length'])return ji(_0x164653,_0x412b60[0x0]['commands'])['map'](_0x2cd1a3=>({'id':_0x2cd1a3['id'],'label':_0x2cd1a3['label']}));return _0x412b60['map'](_0x56f4a0=>{const {groupId:_0x5464bf,groupLabel:_0x2f07a7,commands:_0x24ed0b}=_0x56f4a0,_0x13540e=ji(_0x164653,_0x24ed0b)['map'](_0xfad005=>({'id':_0xfad005['id'],'label':_0xfad005['label']}));return{'id':_0x5464bf,'menu':_0x2f07a7||_0x5464bf,'children':_0x13540e};});}(_0x355373),{'ariaLabel':yi(_0x584960,'AI\x20Commands')}),_0x5afbb6['menuView']['menuPanelClass']='ck-ai-commands-dropdown\x20'+this['_uiCssClasses'],_0x237658['on']('change:enabledCommandsIds',_0x33c747),_0x5afbb6['menuView']['once']('render',_0x33c747),_0x5afbb6;function _0x33c747(){_0x5afbb6['isEnabled']=_0x237658['enabledCommandsIds']['length']>0x0;for(const _0x50df55 of _0x5afbb6['menuView']['buttons'])_0x50df55['isEnabled']=_0x237658['enabledCommandsIds']['includes'](_0x50df55['id']);}}),_0x355373['ui']['componentFactory']['add']('menuBar:aiCommands',_0x3c33e4=>{const _0x3a0883=new Kt(_0x3c33e4);_0x3a0883['buttonView']['set']({'label':yi(_0x3c33e4,'AI\x20Commands'),'icon':_0x39348e}),_0x3a0883['bind']('isEnabled')['to'](_0x237658,'enabledCommandsIds',_0x1f94e2=>_0x1f94e2['length']>0x0);const _0x4a1401=bi(_0x355373['config']['get']('ai.assistant.commands'),_0x3c33e4);return this['_populateMenuBarMenu'](_0x237658,_0x3a0883,_0x4a1401,_0x3d870e=>this['_onExecute'](_0x3d870e)),_0x3a0883;}),_0x355373['ui']['componentFactory']['add']('aiAssistant',()=>{const _0x51cc2b=this['_createAIAssistantUIButton'](Nt);return _0x51cc2b['set']({'tooltip':!0x0,'class':'ck-ai-assistant-button\x20'+this['_uiCssClasses']}),_0x51cc2b;}),_0x355373['ui']['componentFactory']['add']('menuBar:aiAssistant',()=>{const _0x5960c2=this['_createAIAssistantUIButton'](Wt);return _0x5960c2['set']({'role':'menuitemcheckbox'}),_0x5960c2;}),this['licenseKey']=this['editor']['config']['get']('licenseKey');const _0x50bf03=this['editor'];this['_licenseKeyCheckInterval']=setInterval(()=>{let _0x3d19b9;for(const _0x4fa6a0 in _0x50bf03){const _0x53682e=_0x4fa6a0,_0x3c1798=_0x50bf03[_0x53682e];if('aiLicenseKeyValid'==_0x3c1798||'aiLicenseKeyInvalid'==_0x3c1798||'aiLicenseKeyExpired'==_0x3c1798||'aiLicenseKeyDomainLimit'==_0x3c1798||'aiLicenseKeyNotAllowed'==_0x3c1798||'aiLicenseKeyEvaluationLimit'==_0x3c1798||'aiLicenseKeyUsageLimit'==_0x3c1798){delete _0x50bf03[_0x53682e],_0x3d19b9=_0x3c1798,clearInterval(this['_licenseKeyCheckInterval']),this['_licenseKeyCheckInterval']=void 0x0;break;}}'aiLicenseKeyInvalid'==_0x3d19b9&&_0x50bf03['_showLicenseError']('invalid'),'aiLicenseKeyExpired'==_0x3d19b9&&_0x50bf03['_showLicenseError']('expired'),'aiLicenseKeyDomainLimit'==_0x3d19b9&&_0x50bf03['_showLicenseError']('domainLimit'),'aiLicenseKeyNotAllowed'==_0x3d19b9&&_0x50bf03['_showLicenseError']('featureNotAllowed','AIAssistant'),'aiLicenseKeyEvaluationLimit'==_0x3d19b9&&_0x50bf03['_showLicenseError']('evaluationLimit'),'aiLicenseKeyUsageLimit'==_0x3d19b9&&_0x50bf03['_showLicenseError']('usageLimit');},0x3e8);}['destroy'](){super['destroy'](),this['_licenseKeyCheckInterval']&&clearInterval(this['_licenseKeyCheckInterval']);}['showUI'](_0x2df150='',_0x45d1f3='',_0x1f735d='custom'){const _0xfef80e=this['editor'],_0x11fd09=_0xfef80e['editing']['view'],_0x5bfb62=_0xfef80e['plugins']['get'](ki),_0x560eec=_0xfef80e['plugins']['get'](_0x1c0d8f);_0x5bfb62['showFakeVisualSelection']();const _0x503c60=new Qi(),_0x1e027c=new ClipboardEvent('copy',{'clipboardData':_0x503c60}),_0x58c9c1=new _0x309e15(_0x503c60),_0x5aec38=new _0x480413(_0x11fd09,_0x1e027c,{'dataTransfer':_0x58c9c1});_0x560eec['_forceMarkersCopy']('comment',()=>{_0x11fd09['document']['fire']('copy',_0x5aec38);}),this['_formView']||(this['_initView'](),this['_aiAssistantController']=new Pi(_0xfef80e,this['_aiAdapter']['textAdapter'],this['_formView']));let _0xa18e76=_0x58c9c1['getData']('text/html');const _0x1ab22b=_0xfef80e['model']['document']['selection'],_0x547c56=Array['from'](_0x1ab22b['getRanges']());0x1===_0x547c56['length']&&_0x547c56[0x0]['isFlat']&&!_0x1ab22b['getSelectedElement']()&&''!==_0xa18e76['replace'](/ /g,'')['trim']()&&(_0xa18e76='<p>'+_0xa18e76+'</p>'),this['_aiAssistantController']['updateView']({'actionId':_0x1f735d,'query':_0x2df150,'htmlContent':_0xa18e76,'label':_0x45d1f3,'mainActionLabel':Hi[_0xfef80e['model']['document']['selection']['isCollapsed']?'INSERT':'REPLACE']}),'aiAssistant'!==this['_dialog']['id']?this['_dialog']['show']({'id':'aiAssistant','icon':_0x12eaf9,'title':yi(this['editor']['locale'],'AI\x20Assistant'),'content':this['_formView'],'position':Yt['EDITOR_TOP_SIDE'],'onShow':()=>{this['_formView']['focus']();},'onHide':()=>{this['_aiAssistantController']['reset'](),_0x5bfb62['hideFakeVisualSelection']();}}):this['_dialog']['view']['wasMoved']||this['_dialog']['view']['updatePosition']();}['hideUI'](){this['_dialog']['hide']();}['_getResolvedCommandsDefinitions'](){const _0x3e25f0=new Map(),_0xd3e413=bi(this['editor']['config']['get']('ai.assistant.commands'),this['editor']['locale']);for(const _0x5e53b4 of _0xd3e413)for(const _0x259953 of _0x5e53b4['commands'])_0x3e25f0['set'](_0x259953['id'],{..._0x259953,'groupId':_0x5e53b4['groupId'],'groupLabel':_0x5e53b4['groupLabel']||_0x5e53b4['groupId']});return _0x3e25f0;}['_createAIAssistantUIButton'](_0x109484){const _0x55a141=this['editor'],_0x526e99=_0x55a141['commands']['get']('showAIAssistant'),_0x3d4226=new _0x109484(_0x55a141['locale']);return _0x3d4226['set']({'label':yi(_0x55a141['locale'],'AI\x20Assistant'),'icon':_0x12eaf9,'isToggleable':!0x0}),_0x3d4226['bind']('isEnabled')['to'](_0x526e99),_0x3d4226['bind']('isOn')['to'](this['_dialog'],'id',_0x48431a=>'aiAssistant'===_0x48431a),this['listenTo'](_0x3d4226,'execute',()=>{_0x3d4226['isOn']?this['hideUI']():_0x526e99['execute']();}),_0x3d4226;}['_initView'](){const _0x1e9e98=this['editor']['plugins']['get'](ki);this['_formView']=new qi(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',()=>{_0x1e9e98['insertContent'](this['_aiAssistantController']['currentContext']),this['hideUI']();}),this['listenTo'](this['_formView'],'insertContentBelow',()=>{_0x1e9e98['insertContentBelow'](this['_aiAssistantController']['currentContext']),this['hideUI']();}),this['_initAriaAiStatusChangeAnnouncements']();}['_initAriaAiStatusChangeAnnouncements'](){const {locale:_0x1d7b31,ui:{ariaLiveAnnouncer:_0xa8a22}}=this['editor'];this['_formView']['contentArea']['on']('change:isProcessing',(_0x5c527b,_0x5c2aad,_0x5f32e7)=>{const _0x5e0d42=this['_aiAssistantController']['currentContext'];_0x5f32e7?_0xa8a22['announce'](yi(_0x1d7b31,'AI\x20is\x20writing')):_0x5e0d42&&_0xa8a22['announce'](yi(_0x1d7b31,'Generated\x20content:\x20%0',_0x5e0d42),{'politeness':'polite','isUnsafeHTML':!0x0});}),this['_formView']['on']('change:isError',(_0x2ce4a5,_0x2e8f33,_0x25618e)=>{if(_0x25618e){const _0x592382=this['_formView']['errorView']['text'];_0xa8a22['announce'](yi(_0x1d7b31,'Error\x20during\x20AI\x20content\x20generation:\x20%0',_0x592382));}});}['_onExecute'](_0x43991f){const _0x1e71ef=this['_commandDefinitions']['get'](_0x43991f),_0x3e271f=this['editor'],_0x16e441=_0x3e271f['model']['document']['selection'],_0x5a7c0d=_0x3e271f['commands']['get']('showAIAssistant'),_0x3e72a3=_0x3e271f['plugins']['get'](ki),_0x498776=''+(_0x1e71ef['groupId']!==Si?_0x1e71ef['groupLabel']+':\x20':'')+_0x1e71ef['label'];if(!0x1!==_0x1e71ef['requiresContent']&&_0x16e441['isCollapsed']){const _0x4a1959=It(_0x16e441['getSelectedBlocks']())||_0x3e271f['model']['schema']['getLimitElement'](_0x16e441);_0x3e271f['model']['change'](_0x28ac38=>{_0x28ac38['setSelection'](_0x4a1959,'in');});}_0x3e72a3['showFakeVisualSelection'](),_0x5a7c0d['execute'](_0x1e71ef['prompt'],_0x498776,'command:'+_0x43991f);}['_populateMenuBarMenu'](_0x3d58e5,_0x198cd9,_0x3fa244,_0x38202c){const _0x573dc1=this['editor'],_0x1dff66=_0x573dc1['locale'],_0x244a45=new $t(_0x1dff66),_0x12f40d=ji(_0x573dc1,_0x3fa244)['filter'](_0x1cfd37=>_0x1cfd37['commands']['length']);0x1===_0x12f40d['length']?this['_getMenuBarGroupButtons']({'command':_0x3d58e5,'commands':_0x12f40d[0x0]['commands'],'parentMenuView':_0x198cd9,'onExecute':_0x38202c})['forEach'](_0x4fc1a7=>_0x244a45['items']['add'](_0x4fc1a7)):_0x12f40d['forEach'](({groupId:_0x17fd1e,groupLabel:_0x39045e,commands:_0x420624})=>{const _0x33b5e2=new qt(_0x1dff66,_0x198cd9),_0x356d15=new Kt(_0x1dff66),_0x596a08=new $t(_0x1dff66),_0x587d24=this['_getMenuBarGroupButtons']({'command':_0x3d58e5,'commands':_0x420624,'parentMenuView':_0x356d15,'onExecute':_0x38202c});_0x356d15['buttonView']['set']({'label':_0x39045e||_0x17fd1e}),_0x356d15['delegate']('execute')['to'](_0x198cd9),_0x596a08['items']['addMany'](_0x587d24),_0x356d15['panelView']['children']['add'](_0x596a08),_0x33b5e2['children']['add'](_0x356d15),_0x244a45['items']['add'](_0x33b5e2);}),_0x198cd9['panelView']['children']['add'](_0x244a45);}['_getMenuBarGroupButtons']({command:_0x349e86,commands:_0x42aa98,parentMenuView:_0x48936b,onExecute:_0x20e64d}){const _0x3a99a3=this['editor'],_0x3dae11=_0x3a99a3['locale'];return ji(_0x3a99a3,_0x42aa98)['map'](_0x93f2be=>{const _0x31e61c=new qt(_0x3dae11,_0x48936b),_0x25ebab=new Wt(_0x3dae11);return _0x25ebab['set']({'label':_0x93f2be['label']}),_0x25ebab['delegate']('execute')['to'](_0x48936b),_0x25ebab['on']('execute',()=>_0x20e64d(_0x93f2be['id'])),_0x25ebab['bind']('isEnabled')['to'](_0x349e86,'enabledCommandsIds',_0x450bfc=>_0x450bfc['includes'](_0x93f2be['id'])),_0x31e61c['children']['add'](_0x25ebab),_0x31e61c;});}}function zi(_0x1395c2,_0x46f1ee){return void 0x0!==_0x1395c2['order']&&void 0x0===_0x46f1ee['order']?0x1:void 0x0===_0x1395c2['order']&&void 0x0!==_0x46f1ee['order']?-0x1:void 0x0!==_0x1395c2['order']&&void 0x0!==_0x46f1ee['order']?_0x1395c2['order']-_0x46f1ee['order']:0x0;}function ji(_0x1298bb,_0xfe7376){_0xfe7376['sort'](zi);const _0x154834={},_0x3841b8=[];for(const _0x383d5e of _0xfe7376)if(void 0x0!==_0x383d5e['order']){if(_0x383d5e['order']in _0x154834)throw new ht('ai-commands-config-order-collision',_0x1298bb,{'conflictingDefinitions':[_0x383d5e,_0x154834[_0x383d5e['order']]]});_0x154834[_0x383d5e['order']]=_0x383d5e,_0x3841b8['splice'](_0x383d5e['order'],0x0,_0x383d5e);}else _0x3841b8['push'](_0x383d5e);return _0x3841b8;}class Ji extends _0x10493d{static get['requires'](){return[Xi,ki];}static get['pluginName'](){return'AIAssistant';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x5633b1){super(_0x5633b1);const _0x8699d8=_0x5633b1['config'],_0xaad54c=_0x5633b1['locale'];_0x8699d8['define']('ai.assistant.preserveComments',!0x0),_0x8699d8['define']('ai.assistant.commands',Zi(_0xaad54c)),_0x8699d8['define']('ai.assistant.extraCommandGroups',[]),_0x8699d8['define']('ai.assistant.removeCommands',[]);let _0x2f5327=bi(_0x8699d8['get']('ai.assistant.commands'),_0xaad54c);const _0x42468d=_0x8699d8['get']('ai.assistant.extraCommandGroups'),_0x469a74=_0x8699d8['get']('ai.assistant.removeCommands');_0x42468d['forEach'](_0x27dedb=>{const _0x176f4d=_0x2f5327['find'](_0x434925=>_0x434925['groupId']===_0x27dedb['groupId']);_0x176f4d?_0x176f4d['commands']=_0x176f4d['commands']['concat'](_0x27dedb['commands']):_0x2f5327['push'](_0x27dedb);}),_0x2f5327=_0x2f5327['filter'](_0x212ef5=>!_0x469a74['includes'](_0x212ef5['groupId'])),_0x2f5327['forEach'](_0x29d673=>{_0x29d673['commands']=_0x29d673['commands']['filter'](_0x3f4fd9=>!_0x469a74['includes'](_0x3f4fd9['id']));}),_0x8699d8['set']('ai.assistant.commands',_0x2f5327);}}function Zi(_0x3d9100){return[{'groupId':'editOrReview','groupLabel':yi(_0x3d9100,'Edit\x20or\x20review'),'commands':[{'id':'improveWriting','label':yi(_0x3d9100,'Improve\x20writing'),'prompt':'Fix\x20spelling\x20mistakes,\x20use\x20proper\x20grammar\x20and\x20apply\x20good\x20writing\x20practices.\x20Do\x20not\x20lose\x20the\x20original\x20meaning.'},{'id':'makeShorter','label':yi(_0x3d9100,'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':yi(_0x3d9100,'Make\x20longer'),'prompt':'Improve\x20this\x20content\x20by\x20using\x20descriptive\x20language\x20and\x20inserting\x20more\x20information\x20and\x20more\x20detailed\x20explanations.'},{'id':'simplifyLanguage','label':yi(_0x3d9100,'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':yi(_0x3d9100,'Generate\x20from\x20selection'),'commands':[{'id':'summarize','label':yi(_0x3d9100,'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':yi(_0x3d9100,'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':yi(_0x3d9100,'Change\x20tone'),'commands':[{'id':'professional','label':yi(_0x3d9100,'Professional'),'prompt':'Improve\x20using\x20polished,\x20formal,\x20and\x20respectful\x20language\x20to\x20convey\x20professional\x20expertise\x20and\x20competence.'},{'id':'casual','label':yi(_0x3d9100,'Casual'),'prompt':'Improve\x20using\x20casual,\x20informal\x20language\x20to\x20convey\x20a\x20casual\x20conversation\x20with\x20a\x20real\x20person.'},{'id':'direct','label':yi(_0x3d9100,'Direct'),'prompt':'Improve\x20using\x20direct\x20language,\x20using\x20only\x20the\x20essential\x20information.'},{'id':'confident','label':yi(_0x3d9100,'Confident'),'prompt':'Improve\x20using\x20compelling,\x20optimistic\x20language\x20to\x20convey\x20confidence\x20in\x20the\x20writing.'},{'id':'friendly','label':yi(_0x3d9100,'Friendly'),'prompt':'Improve\x20using\x20friendly,\x20comforting\x20language,\x20to\x20convey\x20understanding\x20and\x20empathy.'}]},{'groupId':'changeStyle','groupLabel':yi(_0x3d9100,'Change\x20style'),'commands':[{'id':'business','label':yi(_0x3d9100,'Business'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20business\x20professional\x20with\x20formal\x20language.'},{'id':'legal','label':yi(_0x3d9100,'Legal'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20legal\x20professional\x20using\x20valid\x20legal\x20terminology.'},{'id':'journalism','label':yi(_0x3d9100,'Journalism'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20journalist\x20using\x20engaging\x20language\x20to\x20convey\x20the\x20importance\x20of\x20the\x20information.'},{'id':'poetic','label':yi(_0x3d9100,'Poetic'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20poem\x20using\x20poetic\x20techniques\x20without\x20losing\x20the\x20original\x20meaning.'}]},{'groupId':'translate','groupLabel':yi(_0x3d9100,'Translate'),'commands':[{'id':'translateEnglish','label':yi(_0x3d9100,'English'),'prompt':'Translate\x20the\x20content\x20to\x20English\x20language.'},{'id':'translateSpanish','label':yi(_0x3d9100,'Spanish'),'prompt':'Translate\x20the\x20content\x20to\x20Spanish\x20language.'},{'id':'translatePortuguese','label':yi(_0x3d9100,'Portuguese'),'prompt':'Translate\x20the\x20content\x20to\x20Portuguese\x20language.'},{'id':'translateGerman','label':yi(_0x3d9100,'German'),'prompt':'Translate\x20the\x20content\x20to\x20German\x20language.'},{'id':'translateFrench','label':yi(_0x3d9100,'French'),'prompt':'Translate\x20the\x20content\x20to\x20French\x20language.'},{'id':'translateChinese','label':yi(_0x3d9100,'Simplified\x20Chinese'),'prompt':'Translate\x20the\x20content\x20to\x20Simplified\x20Chinese\x20language.'},{'id':'translateHindi','label':yi(_0x3d9100,'Hindi'),'prompt':'Translate\x20the\x20content\x20to\x20Hindi\x20language.'},{'id':'translateArabic','label':yi(_0x3d9100,'Arabic'),'prompt':'Translate\x20the\x20content\x20to\x20Arabic\x20language.'}]}];}class ts extends _0x10493d{['abortController'];static get['requires'](){return[Ni];}constructor(_0x2030d6){super(_0x2030d6),this['abortController']=new AbortController();}['init'](){this['editor']['plugins']['get'](Ni)['textAdapter']=this;}['abort'](){this['abortController']['signal']['aborted']||(this['abortController']['abort'](),this['abortController']=new AbortController());}async['makeRequest'](_0x4c5198){return this['sendRequest'](_0x4c5198)['catch'](_0x3433a4=>{if(_0x3433a4 instanceof vi)return Promise['reject'](_0x3433a4);if('AbortError'==_0x3433a4['name'])return Promise['resolve']();throw console['error'](_0x3433a4),new ht('aitextadapter-send-request-failed',null);});}async['_prepareRequestHeaders'](_0x3bd2f2,_0x57daa2){const _0xafa61=this['editor']['locale'],_0x490b05={'Content-Type':'application/json'};if('object'==typeof _0x3bd2f2)Object['assign'](_0x490b05,_0x3bd2f2);else{if(_0x3bd2f2)try{const _0x3b5b2c=await _0x3bd2f2(_0x57daa2);Object['assign'](_0x490b05,_0x3b5b2c);}catch{return Promise['reject'](new vi(yi(_0xafa61,'AI_ERROR_GET_HEADERS')));}}return _0x490b05;}async['_prepareRequestParameters'](_0x3bbcb6,_0x1a6e96){const _0x394228=this['editor']['locale'];if('object'==typeof _0x3bbcb6)return _0x3bbcb6;try{return await _0x3bbcb6(_0x1a6e96);}catch{return Promise['reject'](new vi(yi(_0x394228,'AI_ERROR_GET_PARAMETERS')));}}}class es extends ts{['_apiUrl'];['_requestHeaders'];['_requestParameters'];static get['pluginName'](){return'OpenAITextAdapter';}constructor(_0x433727){super(_0x433727),_0x433727['config']['define']('ai.assistant.adapter.openAI.apiUrl','https://api.openai.com/v1/chat/completions'),_0x433727['config']['get']('ai.assistant.adapter.openAI.requestParameters')||_0x433727['config']['define']('ai.assistant.adapter.openAI.requestParameters',{'model':'gpt-4o','temperature':0x1,'top_p':0x1,'stream':!0x0}),this['_apiUrl']=_0x433727['config']['get']('ai.assistant.adapter.openAI.apiUrl'),this['_requestHeaders']=_0x433727['config']['get']('ai.assistant.adapter.openAI.requestHeaders')||{},this['_requestParameters']=_0x433727['config']['get']('ai.assistant.adapter.openAI.requestParameters');}async['sendRequest']({query:_0x8fd05b,context:_0x31194e,onData:_0x5a5b36,actionId:_0x3f0bef}){const _0x247fb2=this['editor']['locale'],_0x59dee1=await this['prepareMessages'](_0x8fd05b,_0x31194e,_0x3f0bef),_0x5610c0=await this['_prepareRequestHeaders'](this['_requestHeaders'],_0x3f0bef),_0x5c25c3=await this['_prepareRequestParameters'](this['_requestParameters'],_0x3f0bef),_0x365b84={'messages':_0x59dee1,..._0x5c25c3},_0x31cb50={'method':'POST','headers':_0x5610c0,'body':JSON['stringify'](_0x365b84),'signal':this['abortController']['signal']},_0x4daf4a=await fetch(this['_apiUrl'],_0x31cb50);if(_0x4daf4a['ok'])return _0x5c25c3['stream']?await this['_readStreamableResponse'](_0x4daf4a,_0x5a5b36):await this['_readStaticResponse'](_0x4daf4a,_0x5a5b36),Promise['resolve']();{const _0x13b6ce=await _0x4daf4a['text']();return _0x13b6ce['includes']('context_length_exceeded')?Promise['reject'](new vi(yi(_0x247fb2,'AI_ERROR_CONTEXT_LENGTH'))):_0x13b6ce['includes']('Moderation')?Promise['reject'](new vi(yi(_0x247fb2,'AI_ERROR_MODERATION'))):Promise['reject'](new Error(_0x13b6ce));}}async['prepareMessages'](_0x4f9c1c,_0x16f5c7,_0x5c9607){let _0x2e0fdd,_0x4d29a1;return _0x16f5c7?(_0x2e0fdd='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.',_0x4d29a1='Instruction:\x0a'+_0x4f9c1c+'\x0aYou\x20must\x20keep\x20the\x20text\x20formatting.\x0a\x0aContent:\x0a'+_0x16f5c7):(_0x2e0fdd='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.',_0x4d29a1=_0x4f9c1c),[{'role':'system','content':_0x2e0fdd},{'role':'user','content':_0x4d29a1}];}async['_readStreamableResponse'](_0x8d5e36,_0x550349){const _0x538f5a=_0x8d5e36['body']['getReader'](),_0x2397ae=new TextDecoder();let _0x207628='',_0x25f4fc='',_0x56ab28='',_0x2b64c2=!0x1;for(;!_0x2b64c2;){const {done:_0x4fdc0e,value:_0x359a8e}=await _0x538f5a['read'](),_0x1cc15c=_0x207628+_0x2397ae['decode'](_0x359a8e);let _0x2de859='';_0x2b64c2=_0x4fdc0e;try{_0x2de859=this['_cleanUpData'](_0x1cc15c),_0x207628='';}catch{_0x207628=_0x1cc15c;continue;}_0x25f4fc+=_0x2de859,!_0x2b64c2&&this['_isBufferIncomplete'](_0x25f4fc)||_0x25f4fc&&(_0x56ab28+=_0x25f4fc,_0x25f4fc='',_0x550349(_0x56ab28));}return Promise['resolve']();}async['_readStaticResponse'](_0x5eabe2,_0x26b61c){return _0x26b61c((await _0x5eabe2['json']())['choices'][0x0]['message']['content']),Promise['resolve']();}['_isBufferIncomplete'](_0xa07bf6){const _0xc70444=_0xa07bf6['split']('<')['length']!==_0xa07bf6['split']('>')['length'],_0xeb0ad=_0xa07bf6['length']<0x1e;return _0xc70444&&_0xeb0ad;}['_cleanUpData'](_0x3f04e6){return _0x3f04e6['split'](/\n(?![^{]*\})/g)['map'](_0x13cc0e=>_0x13cc0e['replace']('data:\x20',''))['filter'](_0x4bb4d6=>_0x4bb4d6&&_0x4bb4d6['length']>0x0&&'[DONE]'!==_0x4bb4d6)['map'](_0x3279a5=>{const {choices:_0x49df3d}=JSON['parse'](_0x3279a5);if(_0x49df3d[0x0]?.['delta']?.['content'])return _0x49df3d[0x0]['delta']['content'];})['filter'](_0x1e68b8=>_0x1e68b8)['join']('');}}class is extends ts{['_apiUrl'];['_requestHeaders'];['_bedrockClientConfig'];['_requestParameters'];static get['pluginName'](){return'AWSTextAdapter';}constructor(_0x3dde79){super(_0x3dde79),_0x3dde79['config']['get']('ai.assistant.adapter.aws.requestParameters')||_0x3dde79['config']['define']('ai.assistant.adapter.aws.requestParameters',{'model':'anthropic.claude-v2','max_tokens_to_sample':0x7d0,'temperature':0x1,'top_p':0x1,'top_k':0xfa,'anthropic_version':'bedrock-2023-05-31','stream':!0x0}),this['_apiUrl']=_0x3dde79['config']['get']('ai.assistant.adapter.aws.apiUrl'),this['_bedrockClientConfig']=_0x3dde79['config']['get']('ai.assistant.adapter.aws.bedrockClientConfig'),this['_requestHeaders']=_0x3dde79['config']['get']('ai.assistant.adapter.aws.requestHeaders'),this['_requestParameters']=_0x3dde79['config']['get']('ai.assistant.adapter.aws.requestParameters');}async['sendRequest']({query:_0x5aa449,context:_0x1b8617,onData:_0x4b37c1,actionId:_0x5ea7c1}){const {model:_0x46bc09,stream:_0x208069,..._0x47dbe9}=await this['_prepareRequestParameters'](this['_requestParameters'],_0x5ea7c1),_0x52ba01={'prompt':await this['preparePrompt'](_0x5aa449,_0x1b8617,_0x46bc09,_0x5ea7c1),..._0x47dbe9};this['_apiUrl']?await this['_processProxyRequest'](_0x52ba01,_0x46bc09,_0x208069,_0x4b37c1,_0x5ea7c1):await this['_processAWSRequest'](_0x52ba01,_0x46bc09,_0x208069,_0x4b37c1);}async['preparePrompt'](_0x4df1ff,_0x155e8e,_0x4278d7,_0x38015c){let _0x876a77,_0x4a6451;return _0x155e8e?(_0x876a77='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.',_0x4a6451='Instruction:\x0a'+_0x4df1ff+'\x0aYou\x20must\x20keep\x20the\x20text\x20formatting.\x0a\x0aContent:\x0a'+_0x155e8e):(_0x876a77='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.',_0x4a6451=_0x4df1ff),'meta.llama'==this['getModelFamily'](_0x4278d7)?'<<SYS>>\x0a'+_0x876a77+'\x0a<</SYS>>\x0a[INST]\x0a'+_0x4a6451+'\x0a[/INST]':'Human:\x0a'+_0x876a77+'\x0a'+_0x4a6451+'\x0a\x0aAssistant:';}['getModelFamily'](_0x212b08){if(/^anthropic\.claude/['test'](_0x212b08))return'anthropic.claude';if(/^ai21\.j2/['test'](_0x212b08))return'ai21.j2';if(/^cohere\.command/['test'](_0x212b08))return'cohere.command';if(/^meta\.llama/['test'](_0x212b08))return'meta.llama';throw new vi(yi(this['editor']['locale'],'AI_ERROR_UNSUPPORTED_MODEL',_0x212b08));}async['_processProxyRequest'](_0x17f527,_0x29edf2,_0x4c8a1a,_0x1658e2,_0x195f38){const _0x966d94={'method':'POST','headers':await this['_prepareRequestHeaders'](this['_requestHeaders'],_0x195f38),'body':JSON['stringify']({..._0x17f527,'model':_0x29edf2,'stream':_0x4c8a1a}),'signal':this['abortController']['signal']},_0x33aa4b=await fetch(this['_apiUrl'],_0x966d94);_0x4c8a1a?await this['_readStreamableResponse'](_0x33aa4b,_0x29edf2,_0x1658e2):await this['_readStaticResponse'](_0x33aa4b,_0x29edf2,_0x1658e2);}async['_processAWSRequest'](_0xeeb5e1,_0x22aced,_0x564839,_0xed46cf){const _0x569dab=new _0x58933f(this['_bedrockClientConfig']),_0x2dbfe2={'body':JSON['stringify'](_0xeeb5e1),'contentType':'application/json','accept':'application/json','modelId':_0x22aced};let _0x100a05;if(_0x564839){const _0x33b2ec=new _0x3562c4(_0x2dbfe2);_0x100a05=await _0x569dab['send'](_0x33b2ec,{'abortSignal':this['abortController']['signal']}),await this['_readAsyncIterableResponse'](_0x100a05,_0x22aced,_0xed46cf);}else{const _0x597461=new _0x3fa44b(_0x2dbfe2);_0x100a05=await _0x569dab['send'](_0x597461,{'abortSignal':this['abortController']['signal']}),await this['_readStaticResponse'](_0x100a05,_0x22aced,_0xed46cf);}}async['_readAsyncIterableResponse'](_0x2ee424,_0x195de8,_0x23c291){const _0x46c775=_0x2ee424['body'],_0x57b607=new TextDecoder('utf-8');let _0x5680de='';for await(const _0x4f230c of _0x46c775)if(_0x4f230c['chunk']){const _0x382d90=_0x57b607['decode'](_0x4f230c['chunk']['bytes']),_0x1bbfd8=JSON['parse'](_0x382d90);_0x5680de+=this['_getGeneratedText'](_0x1bbfd8,_0x195de8),_0x23c291(_0x5680de);}return Promise['resolve']();}async['_readStreamableResponse'](_0xca68c8,_0x5aca1d,_0x1b35d2){const _0x4d593f=_0xca68c8['body'],_0x4be80f=new TextDecoder('utf-8'),_0x1591a4=_0x4d593f['getReader']();let _0x2ae758='',_0x29388e='',_0x5e5157=!0x1;for(;!_0x5e5157;){const {done:_0x297a21,value:_0x50b1ee}=await _0x1591a4['read']();if(_0x5e5157=_0x297a21,_0x5e5157)break;const _0x55a023=(_0x2ae758+_0x4be80f['decode'](_0x50b1ee))['split']('\x0a')['map'](_0x30df69=>{try{return _0x2ae758='',JSON['parse'](_0x30df69);}catch{return _0x2ae758=_0x30df69,null;}})['filter'](_0xa32d51=>null!==_0xa32d51);_0x55a023['length']&&(_0x29388e+=_0x55a023['map'](_0x2cf153=>this['_getGeneratedText'](_0x2cf153,_0x5aca1d))['join'](''),_0x1b35d2(_0x29388e));}return Promise['resolve']();}async['_readStaticResponse'](_0x555781,_0x555bb2,_0x22c7ad){let _0xf92a5f;return _0xf92a5f=_0x555781 instanceof Response?await _0x555781['json']():JSON['parse'](new TextDecoder('utf-8')['decode'](_0x555781['body'])),(_0x22c7ad(this['_getGeneratedText'](_0xf92a5f,_0x555bb2)),Promise['resolve']());}['_getGeneratedText'](_0x4443ad,_0x58064e){switch(this['getModelFamily'](_0x58064e)){case'anthropic.claude':return _0x4443ad['completion'];case'ai21.j2':return _0x4443ad['completions'][0x0]['data']['text'];case'cohere.command':return _0x4443ad['generations'][0x0]['text'];case'meta.llama':return _0x4443ad['generation'];}}}class ss extends Nt{constructor(_0x513618,_0x5ec54b={}){super(_0x513618),this['isToggleable']=!0x0,this['set']('side',_0x5ec54b['side']||'top');const _0x49599a=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':['ck-tab-button',...Et(_0x5ec54b['class']||[]),_0x49599a['to']('side',_0x239ad8=>'ck-tab-button_'+_0x239ad8),_0x49599a['to']('class')]}});}['show'](){this['set']('isVisible',!0x0);}['hide'](){this['set']('isVisible',!0x1);}}class ns extends vt{['children'];constructor(_0x30fcea,_0xafa665={}){super(_0x30fcea);const _0x43f3ad=this['bindTemplate'];this['set']('isVisible',!0x1),this['set']('class',''),this['children']=this['createCollection'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck-tab-panel',...Et(_0xafa665['class']||[]),_0x43f3ad['to']('class'),_0x43f3ad['if']('isVisible','ck-hidden',_0x196580=>!_0x196580)]},'children':this['children']});}['show'](){this['set']('isVisible',!0x0);}['hide'](){this['set']('isVisible',!0x1);}}class rs extends vt{['buttonViews']=this['createCollection']();['panelViews']=this['createCollection']();['_tabs']=new Map();constructor(_0x154035,_0x57bc3a={}){super(_0x154035),this['set']('class',void 0x0),this['set']('activeTab',null),this['set']('side',_0x57bc3a['side']||'top'),this['set']('isMaximized',!0x1);const _0x509ec9=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset','ck-tabs',...Et(_0x57bc3a['class']||[]),_0x509ec9['to']('side',_0x2855fa=>'ck-tabs_'+_0x2855fa),_0x509ec9['to']('class'),_0x509ec9['to']('isMaximized',_0x5e6bbd=>_0x5e6bbd?'ck-ai-tabs_maximized':'')],'tabindex':'0'},'children':[{'tag':'div','attributes':{'class':['ck','ck-tabs__buttons-container',_0x509ec9['to']('side',_0xf381f0=>'ck-tabs__buttons-container_'+_0xf381f0)]},'children':this['buttonViews']},{'tag':'div','attributes':{'class':['ck','ck-tabs__panels-container',_0x509ec9['to']('side',_0x3274a8=>'ck-tabs__panels-container_'+_0x3274a8)]},'children':this['panelViews']},...Et(_0x57bc3a['children']||[])]});}['getTabIds'](){return[...this['_tabs']['keys']()];}['getTab'](_0xf9f685){const _0x13cea6=this['_tabs']['get'](_0xf9f685);return _0x13cea6||null;}['addTab'](_0x2ee983){const _0x7e4f4e=this['_setupButton']({'id':_0x2ee983['id'],'label':_0x2ee983['buttonLabel'],'icon':_0x2ee983['buttonIcon'],'order':_0x2ee983['order']}),_0x2a39fc=new ns(this['locale']);return _0x2a39fc['render'](),_0x2ee983['content']&&_0x2a39fc['children']['add'](_0x2ee983['content']),this['panelViews']['add'](_0x2a39fc),this['_tabs']['set'](_0x2ee983['id'],{'button':_0x7e4f4e,'panel':_0x2a39fc,'order':void 0x0!==_0x2ee983['order']?_0x2ee983['order']:null}),this['fire']('addTab:'+_0x2ee983['id'],{'id':_0x2ee983['id'],'button':_0x7e4f4e,'panel':_0x2a39fc}),null===this['activeTab']?this['activateTab'](_0x2ee983['id']):this['_hidePanel'](_0x2ee983['id']),{'button':_0x7e4f4e,'panel':_0x2a39fc};}['activateTab'](_0x7d063a){if(null!==_0x7d063a&&!this['getTab'](_0x7d063a))throw new ht('ui-tabsview-tab-not-found',{'tabs':this,'tabId':_0x7d063a});this['activeTab']!==_0x7d063a&&(this['activeTab']&&this['_hidePanel'](this['activeTab']),this['activeTab']=_0x7d063a,_0x7d063a&&this['_showPanel'](_0x7d063a),this['fire']('activateTab:'+_0x7d063a,_0x7d063a));}['showTab'](_0x461098){if(!this['getTab'](_0x461098))throw new ht('ui-tabsview-tab-not-found',{'tabs':this,'tabId':_0x461098});this['_showPanel'](_0x461098),this['_showButton'](_0x461098),this['fire']('show:'+_0x461098,_0x461098);}['hideTab'](_0x35a0fc){if(!this['getTab'](_0x35a0fc))throw new ht('ui-tabsview-tab-not-found',{'tabs':this,'tabId':_0x35a0fc});const _0x52c77e=this['activeTab'];this['_hidePanel'](_0x35a0fc),this['_hideButton'](_0x35a0fc);const _0x26a33f=this['getTabIds']();_0x52c77e===_0x35a0fc&&_0x26a33f['length']>0x1&&this['activateTab'](_0x26a33f['find'](_0x8cb935=>_0x8cb935!==_0x35a0fc)),this['fire']('hide:'+_0x35a0fc,_0x35a0fc);}['_getPanel'](_0x5a033f){const _0x5f017b=this['_tabs']['get'](_0x5a033f);return _0x5f017b?_0x5f017b['panel']:null;}['_showPanel'](_0x52f5a){null!==this['activeTab']&&this['activeTab']!==_0x52f5a||this['_getPanel'](_0x52f5a)['show']();}['_hidePanel'](_0x5d7737){const _0x179192=this['_getPanel'](_0x5d7737);_0x179192['isVisible']&&(this['activeTab']===_0x5d7737&&(this['activeTab']=null),_0x179192['hide']());}['_getButton'](_0x39975b){const _0x4cb4f6=this['_tabs']['get'](_0x39975b);return _0x4cb4f6?_0x4cb4f6['button']:null;}['_showButton'](_0x53d3c6){this['_getButton'](_0x53d3c6)['show']();}['_hideButton'](_0x5f348a){this['_getButton'](_0x5f348a)['hide']();}['_setupButton'](_0x1c01d7){const _0x2f2f25=new ss(this['locale'],{'side':this['side']}),_0x498a81=this['buttonViews'];if(_0x2f2f25['set']({'label':_0x1c01d7['label'],'icon':_0x1c01d7['icon'],'tooltip':!0x0,'withText':!0x0}),_0x2f2f25['bind']('isOn')['to'](this,'activeTab',_0x18f875=>_0x18f875===_0x1c01d7['id']),_0x2f2f25['bind']('side')['to'](this,'side'),_0x1c01d7['order']){const _0x3cef23=[...this['_tabs']]['reduce']((_0x2a3061,_0x25d0da)=>{const _0x525913=_0x25d0da[0x0],{order:_0x5b0225}=_0x25d0da[0x1];return!_0x5b0225||_0x5b0225>_0x1c01d7['order']?_0x2a3061:_0x5b0225>=_0x2a3061['order']?{'id':_0x525913,'order':_0x5b0225}:_0x2a3061;},{'id':'','order':0x0}),_0x4ac66a=_0x498a81['getIndex'](this['_getButton'](_0x3cef23['id']));_0x498a81['add'](_0x2f2f25,_0x4ac66a+0x1);}else _0x498a81['add'](_0x2f2f25);return _0x2f2f25['on']('execute',()=>{this['activateTab'](_0x1c01d7['id']);}),_0x2f2f25;}}const as=['overlay','sidebar','custom'],os=['left','right'];class hs extends rs{constructor(_0x43358e,_0x57f64a={}){super(_0x43358e,_0x57f64a),this['set']('type',_0x57f64a['type']||'sidebar'),this['set']('side',_0x57f64a['side']||'right'),this['set']('isVisible',_0x57f64a['visibleByDefault']??!0x0);const _0x26e257=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':['ck-ai-tabs',_0x26e257['if']('type','ck-ai-tabs__overlay',_0x1e332a=>'overlay'===_0x1e332a),_0x26e257['if']('type','ck-ai-tabs__sidebar',_0x35e8b2=>'sidebar'===_0x35e8b2),_0x26e257['if']('isVisible','ck-hidden',_0x162673=>!_0x162673)]}}),this['buttonViews']['on']('add',(_0x46726e,_0x743bb9)=>{_0x743bb9['set']('withText',!0x1);});}}class cs extends _0x3397b8{['view'];['container']=null;['showResizeButton']=!0x0;static get['pluginName'](){return'AITabs';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x5f1c75){super(_0x5f1c75);const _0x457e34=this['context']['config']['get']('ai.container');if(this['set']('side','right'),!_0x457e34)throw new ht('ai-tabs-configuration-not-found');if(void 0x0!==_0x457e34['showResizeButton']&&(this['showResizeButton']=_0x457e34['showResizeButton']),'sidebar'!==_0x457e34['type']&&'overlay'!==_0x457e34['type']||_0x457e34['side']&&(this['side']=_0x457e34['side']),'sidebar'===_0x457e34['type']){if(this['container']=_0x457e34['element'],this['set']('type','sidebar'),!this['container'])throw new ht('ai-tabs-sidebar-container-element-not-found');}else'overlay'===_0x457e34['type']?(this['container']=document['body'],this['set']('type','overlay')):(this['container']=null,this['set']('type','custom'));this['view']=new hs(this['context']['locale'],{'side':this['side'],'type':this['type'],'visibleByDefault':void 0x0===_0x457e34['visibleByDefault']||_0x457e34['visibleByDefault']}),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 _0x562c83&&this['context']['ui']['focusTracker']['add'](this['view']['element']);}['switchType'](_0x439928){if(_0x439928&&this['type']!==_0x439928){if(!as['includes'](_0x439928))throw new ht('ai-tabs-unsupported-ui-type');this['type']=_0x439928;}}['switchSide'](_0x7c185a){if(_0x7c185a&&this['side']!==_0x7c185a){if(!os['includes'](_0x7c185a))throw new ht('ai-tabs-unsupported-ui-side');this['side']=_0x7c185a;}}['resize'](){this['view']['isMaximized']=!this['view']['isMaximized'],this['fire']('resizedTabs',this['view']['isMaximized']);}['destroy'](){super['destroy'](),this['view']['destroy'](),this['view']['element']&&this['view']['element']['remove']();}}class ls extends _0x3397b8{['_apiUrl'];['_token'];['_decoder'];['_responseCache'];static get['requires'](){return[_0x3d7dc0];}static get['pluginName'](){return'AIConnector';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x21f4c8){super(_0x21f4c8),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 _0x422814=this['context']['plugins']['get'](_0x3d7dc0);if(!_0x422814['token'])throw new ht('ai-missing-token',this);this['_token']=_0x422814['token'];}['startConversation'](_0x508c30,_0x5e8c44){const _0x28c0f1=this['_sendApiRequest']('/conversations','POST',{'id':_0x508c30,'group':_0x5e8c44});return{'getConversation':async()=>(await _0x28c0f1['request'])['json'](),'abortController':_0x28c0f1['abortController']};}['queryAssistant']({message:_0x1d493b,conversationId:_0x436bc2,parts:_0x20c83f,capabilities:_0x461ce1,model:_0x43d6ae,attributes:_0x4838c2}){const _0x2b9b65={'prompt':_0x1d493b,'content':_0x20c83f,'model':_0x43d6ae,..._0x461ce1&&{'capabilities':_0x461ce1},..._0x4838c2&&{'attributes':_0x4838c2}},_0x1397c8=this['_sendApiRequest']('/conversations/'+_0x436bc2+'/messages','POST',_0x2b9b65);return{'getStream':async()=>{const _0xd2f559=(await _0x1397c8['request'])['body'];return this['_getStreamReader'](_0xd2f559);},'abortController':_0x1397c8['abortController']};}['executeCustomAction']({content:_0x3c1577,message:_0x4166dc,model:_0x54f32a,outputFormat:_0x13b5b0}){const _0x392cb3={'content':[{'type':'text','content':_0x3c1577}],'prompt':_0x4166dc,'model':_0x54f32a,'outputFormat':_0x13b5b0},_0x23815e=this['_sendApiRequest']('/actions/custom/calls','POST',_0x392cb3);return{'getStream':async()=>{const _0x5322f3=(await _0x23815e['request'])['body'];return this['_getStreamReader'](_0x5322f3);},'abortController':_0x23815e['abortController']};}['executeAction']({actionName:_0x3ce835,content:_0x37d2d8,args:_0x319649}){const _0x46f818={'content':[{'type':'text','content':_0x37d2d8}],'args':_0x319649},_0x27bd68=this['_sendApiRequest']('/actions/system/'+_0x3ce835+'/calls','POST',_0x46f818);return{'getStream':async()=>{const _0xe85d69=(await _0x27bd68['request'])['body'];return this['_getStreamReader'](_0xe85d69);},'abortController':_0x27bd68['abortController']};}['uploadFile'](_0x31c3ac,_0x35f37b,_0x3b5e42){const _0x555d01=new FormData();_0x555d01['append']('file',_0x35f37b,_0x35f37b['name']),_0x3b5e42&&_0x555d01['append']('attributes',JSON['stringify'](_0x3b5e42));const _0x159041=this['_sendApiRequest']('/conversations/'+_0x31c3ac+'/files','POST',_0x555d01);return{'getId':async()=>(await _0x159041['request'])['json'](),'abortController':_0x159041['abortController']};}['fetchDocument'](_0x2b79ec,_0x5e24e4){const _0x3a8cdd=this['_sendApiRequest']('/conversations/'+_0x2b79ec+'/documents/'+_0x5e24e4,'GET');return{'getDocument':async()=>(await _0x3a8cdd['request'])['json'](),'abortController':_0x3a8cdd['abortController']};}['uploadDocument'](_0x380cdf,_0x528f4a,_0x180301){const _0x5e3fd7={'content':_0x528f4a};_0x180301&&(_0x5e3fd7['attributes']=_0x180301);const _0x524474=this['_sendApiRequest']('/conversations/'+_0x380cdf+'/documents','POST',_0x5e3fd7);return{'getId':async()=>(await _0x524474['request'])['json'](),'abortController':_0x524474['abortController']};}['fetchConversations'](_0x1451cb,_0x5ce515={}){const _0x15a361=new URLSearchParams();_0x15a361['append']('group',_0x1451cb),_0x15a361['append']('excludeEmpty',!0x1!==_0x5ce515['excludeEmpty']?'true':'false'),_0x15a361['append']('limit',_0x5ce515['limit']?_0x5ce515['limit']['toString']():'100'),_0x15a361['append']('sortBy',_0x5ce515['sortBy']?_0x5ce515['sortBy']:'createdAt'),_0x15a361['append']('order',_0x5ce515['order']?_0x5ce515['order']:'desc');const _0x4e1381=this['_sendApiRequest']('/conversations?'+_0x15a361['toString'](),'GET');return{'getConversations':async()=>{const _0x42cdd2=await _0x4e1381['request'];return(await _0x42cdd2['json']())['items'];},'abortController':_0x4e1381['abortController']};}['deleteConversation'](_0x308aff){const _0x2b5ca4=this['_sendApiRequest']('/conversations/'+_0x308aff,'DELETE');return{'execute':async()=>{await _0x2b5ca4['request'];},'abortController':_0x2b5ca4['abortController']};}['updateConversation'](_0x13cca4,_0x415a04){const _0x4ae148=this['_sendApiRequest']('/conversations/'+_0x13cca4,'PATCH',_0x415a04);return{'getResult':async()=>(await _0x4ae148['request'],_0x415a04),'abortController':_0x4ae148['abortController']};}['fetchConversation'](_0x17aa02){const _0xb36293=this['_sendApiRequest']('/conversations/'+_0x17aa02,'GET');return{'getConversation':async()=>(await _0xb36293['request'])['json'](),'abortController':_0xb36293['abortController']};}['fetchConversationMessages'](_0x8394f5){const _0x569c43=this['_sendApiRequest']('/conversations/'+_0x8394f5+'/messages','GET');return{'getMessages':async()=>{const _0xb472cc=await _0x569c43['request'];return(await _0xb472cc['json']())['items'];},'abortController':_0x569c43['abortController']};}['uploadUrl'](_0x2f60fd,_0x1f7d85,_0x13fa96){const _0x476959=this['_sendApiRequest']('/conversations/'+_0x2f60fd+'/web-resources','POST',{'url':_0x1f7d85,'attributes':_0x13fa96});return{'getId':async()=>(await _0x476959['request'])['json'](),'abortController':_0x476959['abortController']};}['getModels'](_0x32b15a='en'){const _0x380869=new URLSearchParams();_0x380869['append']('language',_0x32b15a);const _0x37747e='/models/1?'+_0x380869['toString'](),_0x2e086d=this['_sendApiRequest'](_0x37747e,'GET',void 0x0,!0x0);return{'list':async()=>await(await _0x2e086d['request'])['json'](),'abortController':_0x2e086d['abortController']};}['deleteFile'](_0x2e2356,_0x3be08c){const _0x33bacb=this['_sendApiRequest']('/conversations/'+_0x2e2356+'/files/'+_0x3be08c,'DELETE');return{'execute':async()=>{await _0x33bacb['request'];},'abortController':_0x33bacb['abortController']};}['deleteDocument'](_0x3e18df,_0x51596b){const _0x4ddea7=this['_sendApiRequest']('/conversations/'+_0x3e18df+'/documents/'+_0x51596b,'DELETE');return{'execute':async()=>{await _0x4ddea7['request'];},'abortController':_0x4ddea7['abortController']};}['deleteWebResource'](_0x481ec9,_0x381b54){const _0x1b135f=this['_sendApiRequest']('/conversations/'+_0x481ec9+'/web-resources/'+_0x381b54,'DELETE');return{'execute':async()=>{await _0x1b135f['request'];},'abortController':_0x1b135f['abortController']};}['callSystemReview']({reviewName:_0x285ece,content:_0x27d1de,args:_0x4d08fb}){const _0x4fe28a=this['_sendApiRequest']('/reviews/system/'+_0x285ece+'/calls','POST',{'content':[{'type':'text','content':_0x27d1de}],'args':_0x4d08fb});return{'getStream':async()=>{const _0x2db91f=(await _0x4fe28a['request'])['body'];return this['_getStreamReader'](_0x2db91f);},'abortController':_0x4fe28a['abortController']};}['callCustomReview']({content:_0x1ad0c8,prompt:_0x1d1caf,model:_0x46a16b}){const _0x60c289=this['_sendApiRequest']('/reviews/custom/calls','POST',{'content':[{'type':'text','content':_0x1ad0c8}],'prompt':_0x1d1caf,'model':_0x46a16b});return{'getStream':async()=>{const _0x3b5aa0=(await _0x60c289['request'])['body'];return this['_getStreamReader'](_0x3b5aa0);},'abortController':_0x60c289['abortController']};}['upsertAIChatRating'](_0x248043,_0x3d5091,_0x633d26){const _0x1e222c=this['_sendApiRequest']('/conversations/'+_0x248043+'/messages/'+_0x3d5091+'/ratings','PUT',{'positiveCount':_0x633d26['positiveCount'],'totalCount':_0x633d26['totalCount'],'modificationId':_0x633d26['modificationId']});return{'execute':async()=>{await _0x1e222c['request'];},'abortController':_0x1e222c['abortController']};}['upsertAIActionRating'](_0x2d5a08,_0x3172bf,_0x127ce3){const _0x230f53=this['_sendApiRequest']('/actions/system/'+_0x2d5a08+'/calls/'+_0x3172bf+'/ratings','PUT',{'positiveCount':_0x127ce3['positiveCount'],'totalCount':_0x127ce3['totalCount']});return{'execute':async()=>{await _0x230f53['request'];},'abortController':_0x230f53['abortController']};}['upsertCustomAIActionRating'](_0x3a350f,_0x7991fc){const _0x2c94a5=this['_sendApiRequest']('/actions/custom/calls/'+_0x3a350f+'/ratings','PUT',{'positiveCount':_0x7991fc['positiveCount'],'totalCount':_0x7991fc['totalCount']});return{'execute':async()=>{await _0x2c94a5['request'];},'abortController':_0x2c94a5['abortController']};}['upsertAIReviewRating'](_0x3f2e82,_0x1815d4,_0x540b5d,_0x2b0bce){const _0x5e1d87=this['_sendApiRequest']('/reviews/system/'+_0x3f2e82+'/calls/'+_0x1815d4+'/ratings','PUT',{'positiveCount':_0x540b5d['positiveCount'],'totalCount':_0x540b5d['totalCount'],'dataId':_0x2b0bce});return{'execute':async()=>{await _0x5e1d87['request'];},'abortController':_0x5e1d87['abortController']};}['upsertCustomAIReviewRating'](_0x535808,_0x4361f0,_0x28310b){const _0x5ec4d3=this['_sendApiRequest']('/reviews/custom/calls/'+_0x535808+'/ratings','PUT',{'positiveCount':_0x4361f0['positiveCount'],'totalCount':_0x4361f0['totalCount'],'dataId':_0x28310b});return{'execute':async()=>{await _0x5ec4d3['request'];},'abortController':_0x5ec4d3['abortController']};}['_sendApiRequest'](_0xc57bee,_0xfbef24,_0x3a3a99,_0x32129f=!0x1){const _0x48047e=new AbortController(),_0x2ec659=_0x32129f?_0xfbef24+':'+_0xc57bee:null;if(_0x2ec659){const _0x414856=this['_responseCache']['get'](_0x2ec659);if(_0x414856)return{'request':_0x414856['then'](_0x5d0af7=>_0x5d0af7['clone']()),'abortController':_0x48047e};}const _0x276014=_0x3a3a99 instanceof FormData,_0x27c2ec={'Authorization':'Bearer\x20'+this['_token']?.['value']};_0x3a3a99&&!_0x276014&&(_0x27c2ec['Content-Type']='application/json');const _0x33f1f5={'method':_0xfbef24,'headers':_0x27c2ec,'signal':_0x48047e['signal']};_0x3a3a99&&(_0x33f1f5['body']=_0x276014?_0x3a3a99:JSON['stringify'](_0x3a3a99));const _0xb101b4=fetch(''+this['_apiUrl']+_0xc57bee,_0x33f1f5)['catch'](_0x18cc2b=>{_0x2ec659&&this['_responseCache']['delete'](_0x2ec659),this['_handleError'](_0x18cc2b);})['then'](_0x3b328a=>_0x3b328a['ok']?_0x3b328a:_0x3b328a['json']()['then'](_0x5006dd=>{throw _0x2ec659&&this['_responseCache']['delete'](_0x2ec659),{'url':this['_apiUrl'],'path':_0xc57bee,'method':_0xfbef24,'body':_0x3a3a99,'status':(_0x3b328a||{})['status'],'statusText':(_0x3b328a||{})['statusText'],'code':_0x5006dd['code'],'message':_0x5006dd['message'],'traceId':_0x5006dd['traceId']};}));return _0x2ec659&&this['_responseCache']['set'](_0x2ec659,_0xb101b4['then'](_0x218df9=>_0x218df9['clone']())),{'request':_0xb101b4,'abortController':_0x48047e};}async*['_getStreamReader'](_0x1e0536){const _0x5da863=[],_0x1bad68=_0x1e0536['getReader'](),_0x5eb78b=_0x27b766({'onError':_0x1f11b3=>{this['_handleError'](_0x1f11b3);},'onEvent':_0x530930=>{_0x530930['data']=JSON['parse'](_0x530930['data']),_0x5da863['push'](_0x530930);}});try{let _0x318b95=!0x1;for(;!_0x318b95;){const {done:_0x8e52fb,value:_0x3776c9}=await _0x1bad68['read']();_0x8e52fb&&(_0x318b95=!0x0),_0x5eb78b['feed'](this['_decoder']['decode'](_0x3776c9,{'stream':!0x0})),yield*_0x5da863,_0x5da863['length']=0x0;}}catch(_0x4171df){this['_handleError'](_0x4171df);}finally{_0x1bad68['releaseLock'](),_0x5eb78b['reset']();}}['_handleError'](_0x2a8de0){if(_0x2a8de0 instanceof ht)throw _0x2a8de0;if(_0x2a8de0 instanceof Error&&'AbortError'===_0x2a8de0['name'])throw new ht('ai-request-aborted',this,{'originalError':_0x2a8de0});throw new ht('ai-request-failed',this,{'originalError':_0x2a8de0});}}function us(_0xbd8ab,_0x385800,_0x10a43f){const t=_0xbd8ab['t'];switch(_0x385800){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'},_0x10a43f);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':'The\x20request\x20was\x20aborted.'});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.'},_0x10a43f);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.'},_0x10a43f);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.'},_0x10a43f);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'},_0x10a43f);case'AI_CHAT_SUGGESTION_ACTION_SUGGEST':return t({'id':'AI_CHAT_SUGGESTION_ACTION_SUGGEST','string':'Suggest'},_0x10a43f);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'},_0x10a43f);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.'},_0x10a43f);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.'},_0x10a43f);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.'},_0x10a43f);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.'},_0x10a43f);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'},_0x10a43f);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.'},_0x10a43f);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 _0x385800;}}const ds='ck-ai-button-primary',_s='ck-ai-button-secondary',As='ck-ai-button-tertiary';function gs(_0x35c44e,_0x3dbd85){const _0x266879=new Nt(_0x35c44e),_0x38a84f=us(_0x35c44e,'AI_TABS_LABEL_MINIMIZE'),_0xe0d3c2=us(_0x35c44e,'AI_TABS_LABEL_MAXIMIZE');return _0x266879['set']({'withText':!0x1,'icon':_0x3bc949,'tooltip':!0x0,'class':'ck-ai-tabs__resize\x20'+As}),_0x266879['bind']('label')['to'](_0x3dbd85,'isMaximized',_0x48d607=>_0x48d607?_0x38a84f:_0xe0d3c2),_0x266879['bind']('icon')['to'](_0x3dbd85,'isMaximized',_0x218af4=>_0x218af4?_0x538e2e:_0x3bc949),_0x266879['bind']('isOn')['to'](_0x3dbd85,'isMaximized'),_0x266879['on']('execute',()=>{_0x3dbd85['fire']('resizeTabs');}),_0x266879;}function Is(_0x38d909){return _0x5c37e0(_0x38d909);}function Es(_0x3fc275){return _0x3dc878(_0x3fc275);}function ps(_0x614ecd,_0x2bd41d,_0x5b1c10){const _0x4eb093=null!==_0x2bd41d?_0x54bad6=>_0x54bad6['attribs'][_0x614ecd]===_0x2bd41d:_0x2d8bcb=>Boolean(_0x2d8bcb['attribs'][_0x614ecd]);return _0x5b37e1(_0x318bed=>_0x204373(_0x318bed)&&_0x4eb093(_0x318bed),_0x5b1c10);}function Ts(_0x19568b,_0x1fbbbc,_0x1a272b){const _0x281c9b=null!==_0x1fbbbc?_0x10a854=>_0x10a854['attribs'][_0x19568b]===_0x1fbbbc:_0x1f7693=>Boolean(_0x1f7693['attribs'][_0x19568b]);return _0x53eb72(_0x5a5b50=>_0x204373(_0x5a5b50)&&_0x281c9b(_0x5a5b50),_0x1a272b);}function ms(_0x1a2d59,_0x421050){return _0x1a2d59&&_0x204373(_0x1a2d59)?_0x1a2d59['attribs'][_0x421050]:null;}function Cs(_0x49d051,_0x542a77,_0x3752dd){_0x204373(_0x49d051)&&(null===_0x3752dd?delete _0x49d051['attribs'][_0x542a77]:_0x49d051['attribs'][_0x542a77]=_0x3752dd);}function ws(_0x56a1ad,_0x4ac81d,_0x1a202d){const _0x1dfce8=_0x4ac81d['cloneNode'](!0x0);'beforebegin'===_0x1a202d?_0xaa920a(_0x56a1ad,_0x1dfce8):'afterbegin'===_0x1a202d?_0x23eccc(_0x56a1ad,_0x1dfce8):'beforeend'===_0x1a202d?_0x49a967(_0x56a1ad,_0x1dfce8):'afterend'===_0x1a202d&&_0x16e185(_0x56a1ad,_0x1dfce8);}function fs(_0x42b159){const _0x34ff42=[];let _0x64ed27=_0x42b159;for(;_0x64ed27;)_0x64ed27=_0x141eb9(_0x64ed27),_0x64ed27&&_0x34ff42['push'](_0x64ed27);return _0x34ff42;}function Ss(_0x1ea573){return _0x1ea573['replace'](/^\s+/gm,'')['replace'](/\s+$/gm,'')['replace'](/\n*/g,'')['replace'](/\s+/g,'\x20')['replace'](/>\s*</g,'><');}function bs(_0x1e2194){let _0x426755=0x0;for(;_0x1e2194['parentNode'];)_0x1e2194=_0x1e2194['parentNode'],_0x426755++;return _0x426755;}function Rs(_0x10fb3b){const _0x2f2e0f=[];let _0x296052=_0x10fb3b['nextSibling'];for(;_0x296052;)_0x2f2e0f['push'](_0x296052),_0x296052=_0x296052['nextSibling'];_0x2f2e0f['forEach'](_0x581363=>{_0x544b32(_0x581363);});}class Os extends/* #__PURE__ -- @preserve */
|
|
25
|
-
|
|
26
|
-
ct(){['_generateUid'];['_touchedNodesState']={'newIds':[],'modifiedIds':[],'removedIds':[],'invalidIds':[],'lastTouchedId':null};['_existingDataIds']=new Set();constructor(_0x4a141b){super(),this['_generateUid']=_0x4a141b||ot;}['merge'](_0x17f67f,_0x72b14,_0x3d390a){const _0x3a65b3=_0x17f67f['cloneNode'](!0x0);if(0x0===_0x72b14['childNodes']['length']){const _0x490a5e=[];return Ts('data-id','new-element',_0x3a65b3)['forEach'](_0x52e83a=>{const _0x34d07d=this['_generateUid']();Cs(_0x52e83a,'data-id',_0x34d07d),_0x490a5e['push'](_0x34d07d);}),this['_removeSpecialComments'](_0x3a65b3),{'parsedContent':_0x3a65b3,'newNodeIds':_0x490a5e,'modifiedNodeIds':[],'removedNodeIds':[]};}_0x3d390a&&_0x3d390a['markUnstableElements']&&this['_markLastTagElementUnstable'](_0x3a65b3),this['_touchedNodesState']['newIds']=[],this['_touchedNodesState']['modifiedIds']=[],this['_touchedNodesState']['removedIds']=[],this['_touchedNodesState']['invalidIds']=[],this['_touchedNodesState']['lastTouchedId']=null,this['_existingDataIds']=new Set(Ts('data-id',null,_0x72b14)['map'](_0x196aca=>ms(_0x196aca,'data-id'))['filter'](_0x333eec=>!!_0x333eec));let _0x2e3ecc=-0x1,_0x287642=!0x1;const _0x2c9858=_0x3a65b3['childNodes'],_0xafd77f=Array['from'](_0x2c9858)['filter'](_0x4ffd81=>!(0x3===_0x4ffd81['nodeType']&&''===Es(_0x4ffd81)['trim']())),_0xd16ce0=_0xafd77f['length'];for(let _0x5ce97f=0x0;_0x5ce97f<_0xd16ce0;_0x5ce97f++){const _0x29ba1a=_0xafd77f[_0x5ce97f],_0x308651=_0xafd77f[_0x5ce97f+0x1];if(this['_isNewNode'](_0x29ba1a)){if(-0x1===_0x2e3ecc&&(_0x2e3ecc=_0x5ce97f),this['_markWrappedElements'](_0x29ba1a),!this['_isNewNode'](_0x308651)){const [_0x28e32c,_0x3b7719]=this['_findReferenceNode'](_0x29ba1a,_0x287642,_0x72b14);if(_0x28e32c){const _0x20b278=Array['from'](_0xafd77f)['slice'](_0x2e3ecc,_0x5ce97f+0x1);this['_insertNodes'](_0x28e32c,_0x20b278,_0x3b7719),_0x2e3ecc=-0x1;}}}else{if(this['_isExistingContentComment'](_0x29ba1a))_0x287642=!0x0;else{if(this['_isExistingNode'](_0x29ba1a)){const _0x36e253=ms(_0x29ba1a,'data-id');if(_0x36e253&&this['_existingDataIds']['has'](_0x36e253)){const _0x2ad7c4=ps('data-id',_0x36e253,_0x72b14);this['_replaceNode'](_0x2ad7c4,_0x29ba1a);}if(this['_touchedNodesState']['removedIds']['includes'](_0x36e253)){const _0x253ae6=this['_touchedNodesState']['removedIds']['indexOf'](_0x36e253);this['_touchedNodesState']['removedIds']['splice'](_0x253ae6,0x1);}}else{if(this['_isDelNode'](_0x29ba1a)){const _0x421d88=ms(_0x29ba1a,'data-id');this['_touchedNodesState']['modifiedIds']['includes'](_0x421d88)||this['_storeDeletedElementIds'](_0x29ba1a);}}}}}for(const _0x302a8b of this['_touchedNodesState']['removedIds']){const _0x2fdcf1=ps('data-id',_0x302a8b,_0x72b14);if(_0x2fdcf1){if(_0x3d390a&&_0x3d390a['replaceRemovedWith']){this['_touchedNodesState']['lastTouchedId']=_0x302a8b;const _0x4d7284=_0x3d390a['replaceRemovedWith']['cloneNode'](!0x0);Cs(_0x4d7284,'data-id',_0x302a8b),Cs(_0x4d7284,'data-removed','true'),_0x3a9dc6(_0x2fdcf1,_0x4d7284);}else _0x544b32(_0x2fdcf1);}}if(Ts('data-wrapped-id',null,_0x72b14)['forEach'](_0x539894=>{const _0x4bb608=ps('data-id',ms(_0x539894,'data-wrapped-id'),_0x72b14);var _0x27d3c3,_0xac302f;_0x4bb608&&(_0xac302f=_0x539894,_0x544b32(_0x27d3c3=_0x4bb608),_0x3a9dc6(_0xac302f,_0x27d3c3));}),Ts('data-id','new-element',_0x72b14)['forEach'](_0x3e6452=>{const _0x484cba=this['_getUid'](_0x3e6452);Cs(_0x3e6452,'data-id',_0x484cba),this['_touchedNodesState']['newIds']['push'](_0x484cba);}),this['_removeSpecialComments'](_0x72b14),_0x3d390a&&_0x3d390a['markUnstableElements']&&this['_markUnstableElements'](_0x72b14,_0x3d390a['markUnstableElementsDepth']||0x0),_0x3d390a&&_0x3d390a['cutAfterLastChange']&&this['_touchedNodesState']['lastTouchedId']){let _0x27045e=ps('data-id',this['_touchedNodesState']['lastTouchedId'],_0x72b14);for(;_0x27045e;)Rs(_0x27045e),_0x27045e=_0x27045e['parentNode'];}return{'parsedContent':_0x72b14,'newNodeIds':this['_touchedNodesState']['newIds'],'modifiedNodeIds':this['_touchedNodesState']['modifiedIds'],'removedNodeIds':this['_touchedNodesState']['removedIds']};}['_insertNodes'](_0x5f4250,_0x4159c5,_0x25833c){for(const _0x3d5adc of _0x4159c5){const _0x86759e=this['_getUid'](_0x3d5adc);Cs(_0x3d5adc,'data-id',_0x86759e),this['_touchedNodesState']['newIds']['push'](_0x86759e),this['_touchedNodesState']['lastTouchedId']=_0x86759e;}const _0x4f8f8a='afterbegin'===_0x25833c||'afterend'===_0x25833c?_0x4159c5['reverse']():_0x4159c5;for(const _0x4ffcd9 of _0x4f8f8a)ws(_0x5f4250,_0x4ffcd9,_0x25833c);}['_replaceNode'](_0x9ddcca,_0x437869){if(!_0x9ddcca)return;if(_0xf198bb=_0x437869,Ss(Es(_0x9ddcca))===Ss(Es(_0xf198bb)))return;var _0xf198bb;const _0x1f4d9e=this['_getUid'](_0x9ddcca);Cs(_0x437869,'data-id',_0x1f4d9e),this['_touchedNodesState']['modifiedIds']['push'](_0x1f4d9e),this['_touchedNodesState']['lastTouchedId']=_0x1f4d9e,_0x3a9dc6(_0x9ddcca,_0x437869['cloneNode'](!0x0));}['_findReferenceNode'](_0x5942a9,_0x51bb2f,_0x551faf){const _0x123a17=this['_findPrevElementWithDataId'](_0x5942a9,!0x1);if(_0x123a17){const _0xc971f4=this['_getNodeDataId'](_0x123a17),_0x53598c=ps('data-id',_0xc971f4,_0x551faf);if(_0x53598c)return[_0x53598c,'afterend'];this['_touchedNodesState']['invalidIds']['push'](_0xc971f4);}const _0xc76c5b=this['_findNextElementWithDataId'](_0x5942a9,!0x1);if(_0xc76c5b){const _0x3f2d6e=this['_getNodeDataId'](_0xc76c5b),_0x58f8f6=ps('data-id',_0x3f2d6e,_0x551faf);if(_0x58f8f6)return[_0x58f8f6,'beforebegin'];this['_touchedNodesState']['invalidIds']['push'](_0x3f2d6e);}return _0x51bb2f?_0x5942a9['nextSibling']?this['_findFallbackReferenceNode'](_0x5942a9,_0x551faf):[_0x551faf['childNodes'][_0x551faf['childNodes']['length']-0x1],'afterend']:[_0x551faf['childNodes'][0x0],'beforebegin'];}['_findFallbackReferenceNode'](_0x1b1f91,_0x377b9c){const _0x597cec=[],_0x441201=this['_findPrevElementWithDataId'](_0x1b1f91,!0x0);if(_0x441201){const _0x494108=ps('data-id',this['_getNodeDataId'](_0x441201),_0x377b9c);_0x494108&&_0x597cec['push']([_0x494108,'afterend']);}const _0x5dfdeb=this['_findNextElementWithDataId'](_0x1b1f91,!0x0);if(_0x5dfdeb){const _0x231c04=ps('data-id',this['_getNodeDataId'](_0x5dfdeb),_0x377b9c);_0x231c04&&_0x597cec['push']([_0x231c04,'beforebegin']);}if(_0x597cec['length']>0x1)return bs(_0x597cec[0x0][0x0])<=bs(_0x597cec[0x1][0x0])?_0x597cec[0x0]:_0x597cec[0x1];return 0x1===_0x597cec['length']?_0x597cec[0x0]:[_0x377b9c['lastChild'],'afterend'];}['_findNextElementWithDataId'](_0x14b9fa,_0x356869){let _0x7db55f=_0x14b9fa['nextSibling'],_0x503e19=null,_0x4bf7c3=!0x1;for(;_0x7db55f;){if(_0x3a3fef(_0x7db55f)){if(this['_isDelNode'](_0x7db55f)&&(_0x503e19=_0x7db55f),this['_isExistingContentComment'](_0x7db55f)&&_0x356869&&!_0x4bf7c3){_0x4bf7c3=!0x0,_0x7db55f=_0x7db55f['nextSibling'];continue;}break;}const _0x2340b4=ms(_0x7db55f,'data-id');if(_0x2340b4&&'new-element'!==_0x2340b4&&this['_existingDataIds']['has'](_0x2340b4)){_0x503e19=_0x7db55f;break;}_0x7db55f=_0x7db55f['nextSibling'];}return _0x503e19;}['_findPrevElementWithDataId'](_0x360953,_0x437dec){let _0x4bd64e=_0x360953['previousSibling'],_0x81088b=null,_0x45154c=!0x1;for(;_0x4bd64e;){if(_0x3a3fef(_0x4bd64e)){if(this['_isDelNode'](_0x4bd64e)&&(_0x81088b=_0x4bd64e),this['_isExistingContentComment'](_0x4bd64e)&&_0x437dec&&!_0x45154c){_0x45154c=!0x0,_0x4bd64e=_0x4bd64e['previousSibling'];continue;}break;}const _0x55c10c=ms(_0x4bd64e,'data-id');if(_0x55c10c&&'new-element'!==_0x55c10c&&this['_existingDataIds']['has'](_0x55c10c)){_0x81088b=_0x4bd64e;break;}_0x4bd64e=_0x4bd64e['previousSibling'];}return _0x81088b;}['_markWrappedElements'](_0x21c75b){_0x204373(_0x21c75b)&&Ts('data-id',null,_0x21c75b)['forEach'](_0x2910b4=>{this['_isExistingNode'](_0x2910b4)&&!this['_hasWrappedParent'](_0x2910b4)&&(Cs(_0x2910b4,'data-wrapped-id',ms(_0x2910b4,'data-id')),Cs(_0x2910b4,'data-id',null));});}['_getNodeDataId'](_0x344795){if(!_0x344795)return null;if(_0x204373(_0x344795))return ms(_0x344795,'data-id');if(_0x3a3fef(_0x344795)){const _0x2ae70c=Es(_0x344795)['match'](/removed[\s*-]data-id="([^"]+)"/);if(_0x2ae70c&&_0x2ae70c[0x1])return _0x2ae70c[0x1];}return null;}['_storeDeletedElementIds'](_0x2a4556){if(_0x3a3fef(_0x2a4556)){const _0x459fa6=Es(_0x2a4556)['match'](/removed[\s*-]data-id="([^"]+)"/);_0x459fa6&&_0x459fa6[0x1]&&this['_touchedNodesState']['removedIds']['push'](_0x459fa6[0x1]);}}['_getUid'](_0x21c729){return this['_isExistingNode'](_0x21c729)?ms(_0x21c729,'data-id'):this['_generateUid']();}['_removeSpecialComments'](_0x3f51ae){(function(_0x5901ea){return _0x3fabc1(_0xca2503=>_0x3a3fef(_0xca2503),_0x5901ea,!0x0,0x1/0x0);}(_0x3f51ae)['filter'](_0xb6d60f=>this['_isDelNode'](_0xb6d60f)||this['_isExistingContentComment'](_0xb6d60f))['forEach'](_0x44e264=>{_0x544b32(_0x44e264);}));}['_markLastTagElementUnstable'](_0x46dbba){const _0x346953=_0x46dbba['childNodes'],_0x3c6376=_0x346953[_0x346953['length']-0x1];_0x3c6376&&_0x204373(_0x3c6376)&&Cs(_0x3c6376,'data-unstable','true');}['_markUnstableElements'](_0x38b8dc,_0x3f54c7){const _0x516ba4=ps('data-unstable','true',_0x38b8dc);if(!_0x516ba4)return;const _0x19ef4c=fs(_0x516ba4)['slice'](0x0,-0x1),_0x113c95=_0x19ef4c['length'];let _0x53e0e4=_0x516ba4;if(_0x113c95>_0x3f54c7){let _0x4bc39b=_0x113c95,_0x110c58=null;for(;_0x4bc39b>_0x3f54c7&&_0x4bc39b>=0x0;)_0x4bc39b--,_0x110c58=_0x19ef4c[_0x4bc39b];_0x110c58&&(_0x53e0e4=_0x110c58,Cs(_0x516ba4,'data-unstable',null),Cs(_0x110c58,'data-unstable','true'));}else{if(_0x113c95<_0x3f54c7){let _0x3ff811=_0x113c95,_0x3cd0b9=_0x516ba4;for(;_0x3ff811<_0x3f54c7;){const _0x484e06=_0x3cd0b9['childNodes']['filter'](_0x47047d=>_0x204373(_0x47047d));if(0x0===_0x484e06['length'])break;_0x3ff811++,_0x3cd0b9=_0x484e06[_0x484e06['length']-0x1];}_0x3cd0b9&&(_0x53e0e4=_0x3cd0b9,Cs(_0x516ba4,'data-unstable',null),Cs(_0x3cd0b9,'data-unstable','true'));}}let _0x24dfa3=_0x53e0e4;for(;_0x24dfa3;){for(;_0x24dfa3['nextSibling'];)_0x24dfa3=_0x24dfa3['nextSibling'],_0x204373(_0x24dfa3)&&Cs(_0x24dfa3,'data-unstable','true');_0x24dfa3=_0x24dfa3['parentNode'];}}['_isNewNode'](_0x197c62){return Boolean('new-element'===ms(_0x197c62,'data-id'));}['_isExistingNode'](_0x5dfcb1){return Boolean((ms(_0x5dfcb1,'data-id')||'')['length']>0x0&&'new-element'!==ms(_0x5dfcb1,'data-id'));}['_isDelNode'](_0x21d6f3){return!!_0x21d6f3&&Boolean(_0x3a3fef(_0x21d6f3)&&Es(_0x21d6f3)['match'](/removed[\s*-]data-id="[^"]+"/));}['_hasWrappedParent'](_0xf795be){let _0x523761=_0xf795be['parentNode'];for(;_0x523761;){if(ms(_0x523761,'data-wrapped-id'))return!0x0;_0x523761=_0x523761['parentNode'];}return!0x1;}['_isExistingContentComment'](_0x4fe03c){return Boolean(_0x3a3fef(_0x4fe03c)&&Es(_0x4fe03c)['match'](/\s*existing[\s*-](content|document)\s*/g));}}function Ns({editor:_0x128ce6,changeGroups:_0x3ff3ac,documentContextContent:_0x5162f6,showDiff:_0x129408,trimUnchanged:_0x43012f=!0x0}){return _0x3ff3ac['map'](_0xe387a6=>{const _0x493b0b=new _0x2a3183([]),_0x5e3fa4=new _0x2a3183([]);for(const _0x1121ba of _0xe387a6['changes'])if(_0x129408&&'removed'==_0x1121ba['type']||_0x5e3fa4['children']['push'](_0x1121ba['node']['cloneNode'](!0x0)),'new'!=_0x1121ba['type']&&(_0x129408||'removed'!=_0x1121ba['type'])){const _0x230e85=_0x5b37e1(_0x391277=>ms(_0x391277,'data-id')==_0x1121ba['id'],_0x5162f6,!0x0);_0x230e85&&_0x493b0b['children']['push'](_0x230e85['cloneNode'](!0x0));}const {content:_0x42abbc,hasChanges:_0x31192b}=function(_0x46d1b1,_0xcf366,_0x18bd3e,_0x1a86f8,_0x459c32=!0x0){const _0x470caf=_0x46d1b1['plugins']['get']('DocumentCompare'),_0x3cb629=Es(_0xcf366),_0x211145=Es(_0x18bd3e),_0x5d0a01=_0x46d1b1['data']['parse'](_0x3cb629,'$root'),_0x49b5cf=_0x46d1b1['model']['createPositionAt'](_0x5d0a01,0x0),_0x8a5c49=_0x470caf['getDiff'](_0x3cb629,_0x211145,{'anchor':_0x49b5cf,'markDeletions':_0x1a86f8}),_0x22ed5d=_0x8a5c49['getOperations']();if(0x0==_0x22ed5d['length'])return{'content':_0xcf366['cloneNode'](!0x0),'hasChanges':!0x1};_0x1a86f8?function(_0x3199f1,_0x24a458,_0x49f89c){if(0x0==_0x3199f1['length'])return;const _0x13914e=_0x49f89c['plugins']['get']('DocumentCompare'),_0x4e0e71=_0x49f89c['plugins']['get']('SuggestionsConversion');_0x49f89c['model']['change'](_0x434091=>{const _0x3c8971=new Set();for(let _0x15efc4=0x0;_0x15efc4<_0x3199f1['length'];_0x15efc4++){const _0x23c37d=_0x3199f1[_0x15efc4];if(_0x23c37d['baseVersion']=null,_0x23c37d['isDocumentOperation']=!0x1,_0x13914e['isMarkedRemoveOperation'](_0x23c37d)){const _0x28c7c7=_0x2798de(_0x23c37d['newRange'],_0x49f89c['model']),_0x38a225='suggestion:deletion:'+ot()+':$aiSuggestion';_0x24a458['markers']['set'](_0x38a225,_0x28c7c7);}else switch(_0x23c37d['type']){case'rename':{if(_0x23c37d['oldName']==_0x23c37d['newName'])break;_0x434091['batch']['addOperation'](_0x23c37d),_0x49f89c['model']['applyOperation'](_0x23c37d);const _0x156104='$elementName',_0x358405=_0x23c37d['position'],_0xb8fc74=_0x49f89c['model']['createRange'](_0x358405,_0x49f89c['model']['createPositionAt'](_0x358405['nodeAfter'],'end')),_0x2ce8b2='suggestion:attribute:'+_0x156104+':'+ot()+':$aiSuggestion';_0x24a458['markers']['set'](_0x2ce8b2,_0xb8fc74);break;}case'addAttribute':case'removeAttribute':case'changeAttribute':{if(_0x23c37d['oldValue']==_0x23c37d['newValue'])break;_0x434091['batch']['addOperation'](_0x23c37d),_0x49f89c['model']['applyOperation'](_0x23c37d);const _0x2ca0ae=_0x23c37d['key'];if(!_0x4e0e71['isRegisteredAttribute'](_0x2ca0ae))break;const _0x5b9fb8=_0x2798de(_0x23c37d['range'],_0x49f89c['model']),_0x166255='suggestion:attribute:'+_0x2ca0ae+':'+ot()+':$aiSuggestion';_0x24a458['markers']['set'](_0x166255,_0x5b9fb8);break;}case'insert':{_0x434091['batch']['addOperation'](_0x23c37d),_0x49f89c['model']['applyOperation'](_0x23c37d);if(_0x3199f1[_0x15efc4+0x1]&&'move'==_0x3199f1[_0x15efc4+0x1]['type']){vs(_0x24a458,_0x23c37d);break;}const _0x5dd2d9=_0x23c37d['position'],_0x536186=_0x23c37d['howMany'],_0x3dcd27=_0x2798de(_0x49f89c['model']['createRange'](_0x5dd2d9,_0x5dd2d9['getShiftedBy'](_0x536186)),_0x49f89c['model']),_0x52e731='suggestion:insertion:'+ot()+':$aiSuggestion';_0x24a458['markers']['set'](_0x52e731,_0x3dcd27);break;}case'split':{_0x434091['batch']['addOperation'](_0x23c37d),_0x49f89c['model']['applyOperation'](_0x23c37d);const _0x2afe2c=_0x23c37d['splitPosition'],_0x3c1ec2=_0x23c37d['moveTargetPosition'],_0x54bfd2=_0x49f89c['model']['createRange'](_0x2afe2c,_0x3c1ec2),_0x15a5b3='suggestion:insertion:'+ot()+':$aiSuggestion';_0x24a458['markers']['set'](_0x15a5b3,_0x54bfd2);break;}case'move':{_0x434091['batch']['addOperation'](_0x23c37d),_0x49f89c['model']['applyOperation'](_0x23c37d),_0x3199f1[_0x15efc4-0x1]&&'insert'==_0x3199f1[_0x15efc4-0x1]['type']&&vs(_0x24a458,_0x23c37d);const _0x1c007e=_0x23c37d['getMovedRangeStart'](),_0x5c8876=_0x23c37d['howMany'];for(let _0x2f2030=0x0;_0x2f2030<_0x5c8876;_0x2f2030++){const _0x56f717=_0x1c007e['getShiftedBy'](_0x2f2030)['nodeAfter'];_0x3c8971['add'](_0x56f717);}break;}case'remove':{const _0x3590f4=_0x23c37d['sourcePosition'],_0x37a5a9=_0x23c37d['howMany'],_0x4e6309=new _0xa8a483(_0x3590f4,_0x37a5a9);_0x434091['batch']['addOperation'](_0x4e6309),_0x49f89c['model']['applyOperation'](_0x4e6309);break;}}}for(const _0x43d0aa of _0x3c8971){const _0x498a17=_0x49f89c['model']['createRangeOn'](_0x43d0aa),_0x19d169='suggestion:formatBlock:$fakeWrap:'+ot()+':$aiSuggestion';_0x24a458['markers']['set'](_0x19d169,_0x2798de(_0x498a17,_0x49f89c['model']));}});}(_0x22ed5d,_0x5d0a01,_0x46d1b1):_0x46d1b1['model']['change'](_0x149a06=>{for(const _0x2fb838 of _0x22ed5d)if('remove'==_0x2fb838['type']){const _0x3d0531=_0x2fb838['sourcePosition'],_0x4cad86=_0x2fb838['howMany'],_0x35276f=new _0xa8a483(_0x3d0531,_0x4cad86);_0x149a06['batch']['addOperation'](_0x35276f),_0x46d1b1['model']['applyOperation'](_0x35276f);}else{if('marker'==_0x2fb838['type']){const _0x56ca55=_0x2fb838['name'],_0x3447fd=_0x2fb838['newRange'];null!==_0x3447fd?_0x5d0a01['markers']['set'](_0x56ca55,_0x3447fd):_0x5d0a01['markers']['delete'](_0x56ca55);}else _0x2fb838['baseVersion']=null,_0x2fb838['isDocumentOperation']=!0x1,_0x149a06['batch']['addOperation'](_0x2fb838),_0x46d1b1['model']['applyOperation'](_0x2fb838);}});if(_0x459c32){const _0x273627=ys(_0x46d1b1,_0x22ed5d,_0x5d0a01);xs(_0x46d1b1['model'],_0x273627),function(_0x369227,_0x5fe6a1){const _0x150dd6=_0x5fe6a1['getFirstRange']()['start'];let _0xc30a3a=_0x5fe6a1['getFirstRange']()['end'];const _0x256897=_0x150dd6['root'];(_0xc30a3a['textNode']||_0xc30a3a['nodeAfter']&&_0xc30a3a['nodeAfter']['is']('$text'))&&(_0x5800b0(_0xc30a3a,'...'),_0xc30a3a=_0xc30a3a['getShiftedBy'](0x3)),(_0x150dd6['textNode']||_0x150dd6['nodeBefore']&&_0x150dd6['nodeBefore']['is']('$text'))&&(_0x5800b0(_0x150dd6,'...'),function(_0x1405e9,_0x382673,_0x15b8a5){for(let [_0x43ec73,_0x369b99]of _0x1405e9['markers']){const _0x417690=_0x369b99['_getTransformedByInsertion'](_0x382673,_0x15b8a5,!0x1);_0x369b99=_0x417690[0x0],_0x1405e9['markers']['set'](_0x43ec73,_0x369b99);}}(_0x256897,_0x150dd6,0x3),_0x150dd6['parent']==_0xc30a3a['parent']&&(_0xc30a3a=_0xc30a3a['getShiftedBy'](0x3)));const _0x2ed2d5=_0x369227['createRange'](_0x369227['createPositionAt'](_0x256897,0x0),_0x150dd6),_0x4a512e=_0x369227['createRange'](_0xc30a3a,_0x369227['createPositionAt'](_0x256897,'end')),_0x4a1ace=[..._0x2ed2d5['getMinimalFlatRanges'](),..._0x4a512e['getMinimalFlatRanges']()];_0x4a1ace['reverse']();for(const _0x54328b of _0x4a1ace)_0xe00d8e(_0x54328b),Ds(_0x256897,_0x54328b);}(_0x46d1b1['model'],_0x273627);}const _0x380c12=_0x46d1b1['data']['stringify'](_0x5d0a01,{'showSuggestionHighlights':!0x0});return{'content':Is(_0x380c12),'hasChanges':!0x0};}(_0x128ce6,_0x493b0b,_0x5e3fa4,_0x129408,_0x43012f);return{'type':_0xe387a6['changes'][0x0]['type'],'index':_0xe387a6['index'],'content':_0x42abbc,'hasChanges':_0x31192b};});}function vs(_0x273bb5,_0x2e2578){for(const [_0xb79b24,_0x4293f8]of _0x273bb5['markers']){const _0x3867c5=_0x519c43['_createFromRanges'](_0x4293f8['getTransformedByOperation'](_0x2e2578));_0x273bb5['markers']['set'](_0xb79b24,_0x3867c5);}}function ys(_0x15fc79,_0x24851b,_0x1dab47){const _0x394166=_0x15fc79['plugins']['get']('DocumentCompare');let _0x33263a=_0x15fc79['model']['createPositionAt'](_0x1dab47,Number['POSITIVE_INFINITY']),_0x98861b=_0x15fc79['model']['createPositionAt'](_0x1dab47,0x0);for(const _0x267088 of _0x24851b){let _0x5b85c3,_0x1fcccf;if(_0x394166['isMarkedRemoveOperation'](_0x267088))_0x5b85c3=_0x267088['newRange']['start'],_0x1fcccf=_0x267088['newRange']['end'];else switch(_0x33263a=_0x33263a['getTransformedByOperation'](_0x267088),_0x98861b=_0x98861b['getTransformedByOperation'](_0x267088),_0x267088['type']){case'rename':_0x5b85c3=_0x267088['position'],_0x1fcccf=_0x5b85c3['getShiftedBy'](0x1);break;case'addAttribute':case'removeAttribute':case'changeAttribute':_0x5b85c3=_0x267088['range']['start'],_0x1fcccf=_0x267088['range']['end'];break;case'insert':_0x5b85c3=_0x267088['position'],_0x1fcccf=_0x5b85c3['getShiftedBy'](_0x267088['howMany']);break;case'split':_0x5b85c3=_0x267088['splitPosition'],_0x1fcccf=_0x267088['moveTargetPosition'];break;case'merge':{const _0x3f1163=_0x267088['targetPosition']['path']['slice'](0x0,-0x1);_0x5b85c3=_0x15fc79['model']['createPositionFromPath'](_0x1dab47,_0x3f1163),_0x1fcccf=_0x5b85c3['getShiftedBy'](0x1);break;}case'remove':{const _0x2c36ec=_0x267088['howMany'],_0x5d10d7=_0x267088['sourcePosition']['_getTransformedByInsertion'](_0x267088['targetPosition'],_0x2c36ec),_0x4719d8=_0x267088['getMovedRangeStart']();'remove'==_0x267088['type']?(_0x5b85c3=_0x5d10d7,_0x1fcccf=_0x5d10d7):(_0x5b85c3=_0x4719d8,_0x1fcccf=_0x4719d8['getShiftedBy'](_0x2c36ec));break;}}_0x5b85c3&&_0x5b85c3['isBefore'](_0x33263a)&&(_0x33263a=_0x5b85c3['clone'](),_0x33263a['stickiness']='toNone'),_0x1fcccf&&_0x1fcccf['isAfter'](_0x98861b)&&(_0x98861b=_0x1fcccf['clone'](),_0x98861b['stickiness']='toNone');}return _0x15fc79['model']['createSelection'](_0x15fc79['model']['createRange'](_0x33263a,_0x98861b));}function xs(_0x474153,_0x3adee4){Ls(_0x474153,_0x3adee4,'forward');const _0x32e0c2=_0x3adee4['getFirstRange']();_0x3adee4['setTo']([]),_0x3adee4['setTo'](_0x32e0c2,{'backward':!0x0}),Ls(_0x474153,_0x3adee4,'backward');}function Ls(_0x428833,_0x5e1a13,_0x10249f){let _0x3af323=0x14;for(;_0x3af323;){_0x428833['modifySelection'](_0x5e1a13,{'unit':'word','direction':_0x10249f}),_0x3af323--;const _0x198abe=_0x5e1a13['focus']['forward'==_0x10249f?'nodeBefore':'nodeAfter'];if(_0x198abe&&_0x198abe['is']('element')&&_0x428833['schema']['isBlock'](_0x198abe)&&_0x428833['schema']['isObject'](_0x198abe))break;}}function Ds(_0x5ea892,_0x2664ca){for(const [_0x1e500f,_0x2a9eb1]of _0x5ea892['markers']){const _0xd898fb=_0x2a9eb1['_getTransformedByDeletion'](_0x2664ca['start'],_0x2664ca['end']['offset']-_0x2664ca['start']['offset']);null!=_0xd898fb?_0x5ea892['markers']['set'](_0x1e500f,_0xd898fb):_0x5ea892['markers']['delete'](_0x1e500f);}}class Ps extends ct(){['id'];['interactionId'];['type'];['sources']=[];['parsedContent']=new _0x2a3183([]);['parsedMergedContent']=new _0x2a3183([]);['changeGroups']=[];['areActionsDisabled']=!0x1;['documentContextContent'];['aiResponseParser'];['aiResponseApplier'];['editor'];['cachedSuggestionContentParts']={'withDiff':[],'withoutDiff':[]};constructor({type:_0x443fe1,content:_0x3205b9='',isDone:_0x534f74=!0x1,interactionId:_0x224dac,areActionsDisabled:_0x417da5,documentContextContent:_0x4d8091,editor:_0x27b765,id:_0x465bef}){super(),this['id']=_0x465bef||ot(),this['interactionId']=_0x224dac,this['type']=_0x443fe1,this['areActionsDisabled']=!!_0x417da5,this['editor']=_0x27b765,this['aiResponseParser']=new Os(),this['aiResponseApplier']=new ks(),this['documentContextContent']=Is(_0x4d8091||''),this['set']('isDone',_0x534f74),this['on']('change:content',()=>{this['onContentChange']();}),this['set']('content',_0x3205b9);}['appendContent'](_0x1221e8){this['set']('content',this['content']+_0x1221e8);}['done'](){this['isDone']||(this['set']('isDone',!0x0),this['onContentChange']());}['destroy'](){this['stopListening']();}['setChangeGroupState'](_0x17177f,_0x4a0e40){this['changeGroups'][_0x17177f]['state']=_0x4a0e40,this['fire']('replyChangeGroupStateUpdated',{'reply':this,'index':_0x17177f,'state':_0x4a0e40});}['getContentParts']({showDiff:_0x1edcb7,groupIndex:_0x38fcb9}){if(!this['editor'])throw new ht('ai-get-editor-from-context-no-editor',null,{'aiReply':this});const _0x5975f9=this['_getCachedContentParts'](_0x1edcb7,_0x38fcb9);if(_0x5975f9)return _0x5975f9;let _0x44c492=[];if(void 0x0===_0x38fcb9)_0x44c492=this['changeGroups'];else{const _0x41d1a0=this['changeGroups']['find'](({index:_0x45fe1e})=>_0x45fe1e===_0x38fcb9);if(!_0x41d1a0)throw new ht('ai-reply-get-content-parts-group-not-found',null,{'aiReply':this,'groupIndex':_0x38fcb9});_0x44c492=[_0x41d1a0];}const _0x44f3e3=Ns({'editor':this['editor'],'showDiff':_0x1edcb7,'changeGroups':_0x44c492,'documentContextContent':this['documentContextContent']});return this['_setCachedContentParts'](_0x1edcb7,_0x44f3e3),_0x44f3e3;}['_getCachedContentParts'](_0x3c3fbb,_0x299b06){const _0x1204e9=_0x3c3fbb?'withDiff':'withoutDiff';if(!this['cachedSuggestionContentParts'][_0x1204e9]['length'])return null;const _0x2d6a04=this['cachedSuggestionContentParts'][_0x1204e9];if(void 0x0===_0x299b06)return _0x2d6a04['length']>0x0&&_0x2d6a04['length']!==this['changeGroups']['length']?(this['_setCachedContentParts'](_0x3c3fbb,null),null):_0x4397ac(_0x2d6a04);{const _0xe46a26=_0x2d6a04['find'](({index:_0x124a61})=>_0x124a61===_0x299b06);if(_0xe46a26)return[_0x4397ac(_0xe46a26)];}return null;}['_setCachedContentParts'](_0xabe254,_0x276c46){const _0x3c20fc=_0xabe254?'withDiff':'withoutDiff';_0x276c46?_0x276c46['forEach'](_0x12e239=>{const _0x20fc2a=this['cachedSuggestionContentParts'][_0x3c20fc],_0x562c15=_0x20fc2a['find'](({index:_0x286b7c})=>_0x286b7c===_0x12e239['index']);if(_0x562c15){const _0x1be0ed=_0x20fc2a['indexOf'](_0x562c15);_0x20fc2a['splice'](_0x1be0ed,0x1,_0x12e239);}else _0x20fc2a['push'](_0x12e239);}):this['cachedSuggestionContentParts'][_0x3c20fc]['length']=0x0;}['onContentChange'](){if('modification'===this['type']){this['parsedContent']=this['aiResponseParser']['parseAndNormalizeHTML'](this['content']);const _0xbadf15=this['changeGroups'];this['updateChangeGroups']();const _0x3235f0=this['_getDifferentChangeGroups'](_0xbadf15,this['changeGroups']);(_0x3235f0['length']||this['isDone'])&&(this['fire']('replyContentUpdated',this,_0x3235f0),this['cachedSuggestionContentParts']['withDiff']['length']=this['cachedSuggestionContentParts']['withoutDiff']['length']=0x0);}else this['parsedContent']=this['aiResponseParser']['convertMarkdownToHTML'](this['content']),this['fire']('replyContentUpdated',this);}['_getDifferentChangeGroups'](_0x43df40,_0xd9045){const _0x12c38a=[];for(const _0x531a11 of _0xd9045){const _0x3f4bc6=_0x43df40[_0x531a11['index']];_0x3f4bc6?_0x3f4bc6['changes']['length']!==_0x531a11['changes']['length']?_0x12c38a['push'](_0x531a11):_0x3f4bc6['changes']['forEach']((_0x308efe,_0x5df7c9)=>{const _0x31701f=_0x531a11['changes'][_0x5df7c9];_0x308efe['id']!==_0x31701f['id']&&_0x12c38a['push'](_0x531a11);}):_0x12c38a['push'](_0x531a11);}return _0x12c38a;}['updateChangeGroups'](){const _0x249e22=new _0x3f0955('p',{},[new _0x3f0955('span',{'style':'color:\x20#808080;\x20font-style:\x20italic'},[new _0x39bfd5(us(this['editor']['locale'],'AI_SUGGESTION_CONTENT_PART_REMOVED'))])]),_0x56e206=this['aiResponseApplier']['merge'](this['parsedContent'],this['documentContextContent']['cloneNode'](!0x0),{'markUnstableElements':!this['isDone'],'replaceRemovedWith':_0x249e22,'cutAfterLastChange':!this['isDone']});if(!_0x56e206['modifiedNodeIds']['length']&&!this['isDone'])return;this['parsedMergedContent']=_0x56e206['parsedContent'];let _0x31584c=[];if(_0x53eb72(_0x419a9d=>{const _0x1eb58d=ms(_0x419a9d,'data-id');if(!_0x1eb58d||!_0x35e88b(_0x1eb58d))return!0x1;const _0x5d203b=[_0x419a9d,...fs(_0x419a9d)]['at'](-0x2);if(_0x419a9d!=_0x5d203b){const _0x13abc5=ms(_0x5d203b,'data-id');_0x35e88b(_0x13abc5)||(_0x31584c['push']({'node':_0x5d203b,'id':_0x13abc5,'type':'modified'}),_0x56e206['modifiedNodeIds']['push'](_0x13abc5));}else _0x56e206['modifiedNodeIds']['includes'](_0x1eb58d)?_0x31584c['push']({'node':_0x419a9d,'type':'modified','id':_0x1eb58d}):_0x56e206['newNodeIds']['includes'](_0x1eb58d)?_0x31584c['push']({'node':_0x419a9d,'type':'new','id':_0x1eb58d,'anchorId':ms(_0x419a9d['previousSibling'],'data-id')}):_0x31584c['push']({'node':_0x419a9d,'type':'removed','id':_0x1eb58d});return!0x0;},this['parsedMergedContent']),_0x31584c=_0x31584c['filter'](({node:_0x58dcc5})=>[...fs(_0x58dcc5),_0x58dcc5]['every'](_0x2ddeae=>!ms(_0x2ddeae,'data-unstable'))),0x0==_0x31584c['length'])return;const _0x3de174=[[_0x31584c[0x0]]];for(let _0x802b84=0x1;_0x802b84<_0x31584c['length'];_0x802b84++){const _0x57ee66=_0x3de174[_0x3de174['length']-0x1],_0x1d6f16=_0x57ee66[_0x57ee66['length']-0x1];_0x31584c[_0x802b84]['node']['previousSibling']==_0x1d6f16['node']&&'modified'!=_0x31584c[_0x802b84]['type']&&'modified'!=_0x1d6f16['type']?_0x57ee66['push'](_0x31584c[_0x802b84]):_0x3de174['push']([_0x31584c[_0x802b84]]);}for(const _0x6a1e91 of _0x3de174){const _0x15bd8e=_0x6a1e91[0x0],_0x571f87=_0x6a1e91[_0x6a1e91['length']-0x1],_0x2614fb=_0x50d94b(_0x15bd8e['node']['previousSibling']);_0x2614fb&&_0x6a1e91['unshift'](_0x2614fb);const _0x51ce10=_0x50d94b(_0x571f87['node']['nextSibling']);_0x51ce10&&_0x6a1e91['push'](_0x51ce10);}function _0x35e88b(_0x3aef1d){return _0x56e206['modifiedNodeIds']['includes'](_0x3aef1d)||_0x56e206['newNodeIds']['includes'](_0x3aef1d)||_0x56e206['removedNodeIds']['includes'](_0x3aef1d);}function _0x50d94b(_0x31b8a7){if(_0x31b8a7&&ms(_0x31b8a7,'data-id')&&!ms(_0x31b8a7,'data-unstable')){const _0x33390c=ms(_0x31b8a7,'data-id');if(!_0x35e88b(_0x33390c))return{'node':_0x31b8a7,'type':'context','id':_0x33390c};}return null;}this['changeGroups']=_0x3de174['map']((_0x11b0f4,_0x5ecec1)=>({'changes':_0x11b0f4,'state':'pending','index':_0x5ecec1}));}}const Hs=['interactionCreated','interactionStarted','interactionStopped','interactionFinished','interactionDestroyed','replyCreated','replyContentUpdated','replyChangeGroupStateUpdated','setConversationTitle','webSearchStarted','webSearchFinished','reasoningStarted','reasoningFinished','toolDataReceived','error'];class Ms extends pt(){['id'];['replies']=[];['currentReply'];['messageId'];['actionCallId'];['currentRequest'];['connector'];['isStopped']=!0x1;['isDestroyed']=!0x1;['editor'];['_isReasoning']=!0x1;['_isWebSearching']=!0x1;constructor({connector:_0x25168b,editor:_0x53c6e8}){super(),this['id']=ot(),this['connector']=_0x25168b,this['isStopped']=!0x0,this['editor']=_0x53c6e8;}async['start'](){const _0x4ace01=[];let _0x58065b,_0x1fa5b5,_0x52f855;this['isStopped']=!0x1;try{this['currentRequest']=await this['sendRequest'](),this['fire']('interactionStarted',this);const _0x3e0c6c=await this['currentRequest']['getStream']();for await(const _0x3ae6c3 of _0x3e0c6c){if(this['isStopped'])return;if('error'==_0x3ae6c3['event'])return void this['fire']('error',{'error':new ht('ai-chat-interaction-error',this)});switch(_0x3ae6c3['event']){case'message-metadata':this['messageId']=_0x3ae6c3['data']['messageId'];break;case'action-metadata':this['actionCallId']=_0x3ae6c3['data']['callId'];break;case'conversation-title':this['setConversationTitle'](_0x3ae6c3['data']['conversationTitle'],!0x0);break;case'source':_0x4ace01['push'](_0x3ae6c3['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'](),_0x58065b='modification-delta'==_0x3ae6c3['event']?'modification':'text',_0x1fa5b5='modification-delta'==_0x3ae6c3['event']?_0x3ae6c3['data']['id']:void 0x0,this['currentReply']&&this['currentReply']['type']!=_0x58065b&&(this['currentReply']['done'](),this['currentReply']=void 0x0),this['currentReply']||(this['currentReply']=this['createReply']({'type':_0x58065b,'interactionId':this['id'],'id':_0x1fa5b5}),'modification'==_0x58065b&&(this['currentReply']['sources']=_0x4ace01['splice'](0x0))),this['currentReply']['appendContent'](_0x3ae6c3['data']['textDelta']);break;case'mcp-tool-result':_0x52f855=JSON['parse'](_0x3ae6c3['data']['result']),this['_handleToolResultData']({'toolName':_0x3ae6c3['data']['toolName'],'data':_0x52f855['data'],'attributes':_0x52f855['attributes']});break;case'mcp-tool-notification':this['_handleToolNotificationData']({'toolName':_0x3ae6c3['data']['toolName'],'data':_0x3ae6c3['data']['data']});}}}finally{this['isStopped']||(this['currentReply']&&_0x4ace01['length']>0x0&&(this['currentReply']['sources']=_0x4ace01['splice'](0x0)),this['_finalizeInteraction'](),this['fire']('interactionFinished',this));}}['stop'](){this['isStopped']||(this['_finalizeInteraction'](),this['fire']('interactionStopped',this));}['getReply'](_0x366cc7){return this['replies']['find'](_0x3c5be2=>_0x3c5be2['id']===_0x366cc7);}['destroy'](){this['isDestroyed']||(this['stop'](),this['replies']['forEach'](_0x4b926b=>_0x4b926b['destroy']()),this['replies']=[],this['isDestroyed']=!0x0,this['fire']('interactionDestroyed',this),this['stopListening']());}['createReply'](_0xfdf25e){const _0x420b7b=new Ps({'editor':this['editor'],'documentContextContent':this['getDocumentContext']()?.['content'],..._0xfdf25e});return this['replies']['push'](_0x420b7b),_0x420b7b['delegate'](...Hs)['to'](this),this['fire']('replyCreated',_0x420b7b),_0x420b7b;}['setConversationTitle'](_0x4056f7,_0x21fc54=!0x1){this['fire']('setConversationTitle',_0x4056f7,_0x21fc54);}['resetWebSearchState'](){this['_isWebSearching']&&(this['_isWebSearching']=!0x1,this['fire']('webSearchFinished',this));}['resetReasoningState'](){this['_isReasoning']&&(this['_isReasoning']=!0x1,this['fire']('reasoningFinished',this));}['_handleToolResultData'](_0x42a1b5){this['fire']('toolDataReceived',{'type':'result','toolName':_0x42a1b5['toolName'],'data':structuredClone(_0x42a1b5['data']||{}),'attributes':structuredClone(_0x42a1b5['attributes']||{})},this);}['_handleToolNotificationData'](_0x2f3537){this['fire']('toolDataReceived',{'type':'notification','toolName':_0x2f3537['toolName'],'data':structuredClone(_0x2f3537['data'])},this);}['_finalizeInteraction'](){this['isStopped']=!0x0,this['currentRequest']&&this['currentRequest']['abortController']['abort'](),this['currentReply']&&this['currentReply']['done'](),this['currentRequest']=this['currentReply']=void 0x0;}}var Us=function(_0x15e98a){return _0x15e98a['TOOL']='mcp-tool-context',_0x15e98a['FILE']='file',_0x15e98a['DOCUMENT']='document',_0x15e98a['URL']='web-resource',_0x15e98a['TEXT']='text',_0x15e98a['SELECTION']='selection',_0x15e98a;}({}),Vs=function(_0x5e8ca8){return _0x5e8ca8['TEXT']='text',_0x5e8ca8['MARKDOWN']='markdown',_0x5e8ca8['HTML']='html',_0x5e8ca8;}({});const Bs=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']]),Gs=['contextItemAdded','contextItemRemoved','contextItemLoadingEnded','contextSent','error','addContextOptionsChanged','sourceResourcesLoaded','resourceStateChanged','uploadProgressChanged'];class Fs extends ct(){['_connector'];['_config'];['_ownerId'];constructor({connector:_0x150a9c,config:_0x47fc33,ownerId:_0x17cd0b}){super(),this['_connector']=_0x150a9c,this['_config']=_0x47fc33,this['_ownerId']=_0x17cd0b;}['init'](){this['_pendingContextItems']=new Map(),this['_conversationContextItems']=new Map(),this['_ongoingUploads']=new Map(),this['_ongoingUploadOperations']=new Map(),this['_setAddContextOptionsDefaultState']();}['getPendingContextItems'](){return this['_pendingContextItems'];}async['populateFromMessage'](_0x3299b0){const _0x88e64f=await this['_createContextItemFromContent'](_0x3299b0);return this['_addToConversationContextItem'](_0x88e64f),'current-document'===_0x88e64f['uiId']&&this['_toggleAddCurrentDocumentOptionVisibility'](),_0x88e64f;}async['_createContextItemFromContent'](_0x2a553c){if(_0x2a553c['type']===Us['DOCUMENT']){const _0x6152b0=await this['_connector']['fetchDocument'](this['_ownerId'],_0x2a553c['id'])['getDocument']();return{'id':'current-document','uiId':'current-document','label':'Current\x20document','type':_0x2a553c['type'],'content':_0x6152b0['content'],'hidden':this['_conversationContextItems']['has']('current-document'),'version':_0x6152b0['attributes']?.['version'],'sessionId':_0x6152b0['attributes']?.['sessionId']};}if(_0x2a553c['type']===Us['TOOL'])return{'id':_0x2a553c['id'],'uiId':_0x2a553c['id'],'label':_0x2a553c['data']?.['label']||_0x2a553c['id'],'type':Us['TOOL'],'mcpServerName':_0x2a553c['mcpServerName'],'toolName':_0x2a553c['toolName'],'data':_0x2a553c['data']||{}};return{'id':_0x2a553c['id'],'uiId':_0x2a553c['id'],'label':_0x2a553c['attributes']?.['label']||_0x2a553c['name']||_0x2a553c['url']||_0x2a553c['id'],'type':_0x2a553c['type'],..._0x2a553c?.['attributes']?.['resourceId']?{'resourceId':_0x2a553c['attributes']?.['resourceId']}:{}};}['getSentContextItems'](){return new Map(this['_conversationContextItems']);}['removeFromContext'](_0x27a323){const _0x4f449b=this['_pendingContextItems']['get'](_0x27a323);_0x4f449b?.['isReadOnly']||this['_removeContextItem'](_0x27a323);}['clearPendingContextItems'](){if(0x0===this['_pendingContextItems']['size'])return;for(const _0x4f77dc of this['_pendingContextItems']['values']())this['_removeContextItem'](_0x4f77dc['uiId']);const _0x4afcd0=this['_conversationContextItems']['get']('current-document')||this['_pendingContextItems']['get']('current-document');_0x4afcd0&&this['_addContextItem']({..._0x4afcd0,'isReadOnly':!0x0,'hidden':!0x0});}['addToConversationContext'](_0x3f910d){for(const _0x47173e of _0x3f910d['values']())this['_addToConversationContextItem'](_0x47173e);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'](_0x26a337){return Array['from'](_0x26a337['values']())['map'](_0x404fdf=>this['_mapContextItemToRequestData'](_0x404fdf))['filter'](_0x3bac85=>null!==_0x3bac85);}async['addFilesToContext'](_0x46aee7,_0x44e8c0,_0x5c67dc=Us['FILE']){const _0x491f3c='files-'+ot();this['_startUploadOperation'](_0x491f3c);try{await Promise['all'](_0x46aee7['map'](async _0x3f13c0=>{const _0x5017d8='file-'+ot(),_0x50c4d8=_0x575f0b(_0x3f13c0['name']);try{this['_addContextItem']({'type':_0x5c67dc,'label':_0x44e8c0?.['label']||_0x50c4d8,'uiId':_0x5017d8,'resourceId':_0x44e8c0?.['resourceId']},!0x0);const _0x458c6a=this['_connector']['uploadFile'](this['_ownerId'],_0x3f13c0,_0x44e8c0);this['_ongoingUploads']['set'](_0x5017d8,_0x458c6a['abortController']);const {id:_0x3c484c}=await _0x458c6a['getId']();this['_ongoingUploads']['delete'](_0x5017d8),this['_finishContextItemLoading']({'type':_0x5c67dc,'id':_0x3c484c,'label':_0x44e8c0?.['label']||_0x50c4d8,'uiId':_0x5017d8,'resourceId':_0x44e8c0?.['resourceId']},!0x1);}catch(_0x2c2b6f){this['_ongoingUploads']['delete'](_0x5017d8);if(!(_0x2c2b6f instanceof ht&&_0x2c2b6f['message']['startsWith']('ai-request-aborted'))){const _0x38728f=Bs['get'](_0x2c2b6f['code'])||'ai-chat-file-upload-failed',_0x4f45a9=new ht(_0x38728f,null,{'fileName':_0x50c4d8,..._0x2c2b6f});_0x4f45a9['stack']=_0x2c2b6f['stack'],this['fire']('error',{'error':_0x4f45a9});}this['_removeContextItem'](_0x5017d8);}}));}finally{this['_finishUploadOperation'](_0x491f3c);}}['addCurrentDocumentToContext'](_0x51e8e3){if(this['isCurrentDocumentInContext']()||!this['_addContextOptionsState']['document']['enabled'])return;const _0x3212dd={'type':Us['DOCUMENT'],'uiId':'current-document','label':_0x51e8e3,'isReadOnly':this['_conversationContextItems']['has']('current-document'),'hidden':this['_conversationContextItems']['has']('current-document')};this['_addContextItem'](_0x3212dd);}async['updateCurrentDocument'](_0x3892fe,_0x2f5524,_0x2a1baf,_0x29a563){const _0x282f80=this['_pendingContextItems']['get']('current-document');if(_0x282f80&&_0x3892fe){_0x282f80['selection']=_0x29a563?_0x29a563['map'](_0x4fcd27=>({'start':_0x4fcd27['start'],'end':_0x4fcd27['end']})):[];try{if(_0x282f80['version']===_0x2f5524)return;const {id:_0x57399a}=await this['_connector']['uploadDocument'](this['_ownerId'],_0x3892fe,{'version':_0x2f5524,'sessionId':_0x2a1baf})['getId']();_0x282f80['id']=_0x57399a,_0x282f80['content']=_0x3892fe,_0x282f80['version']=_0x2f5524,_0x282f80['sessionId']=_0x2a1baf;}catch(_0x3d0911){const _0x36a813=new ht('ai-chat-document-upload-failed',null);_0x36a813['stack']=_0x3d0911['stack'],this['fire']('error',{'error':_0x36a813});}}}['addSelectionToContext'](_0xe0edcb){this['_addContextItem']({'type':Us['SELECTION'],'label':_0xe0edcb,'uiId':'selection','content':_0xe0edcb});}['removeSelectionFromContext'](){this['_removeContextItem']('selection');}async['addUrlToContext'](_0x1dfab9,_0x2db252){const _0x32d384='url-'+ot();this['_startUploadOperation'](_0x32d384);const _0x479496='url-'+ot();try{this['_addContextItem']({'type':Us['URL'],'label':_0x2db252?.['label']||_0x1dfab9,'uiId':_0x479496,'resourceId':_0x2db252?.['resourceId']},!0x0);const _0x50f5f0=this['_connector']['uploadUrl'](this['_ownerId'],_0x1dfab9,_0x2db252);this['_ongoingUploads']['set'](_0x479496,_0x50f5f0['abortController']);const {id:_0x294f25}=await _0x50f5f0['getId']();this['_ongoingUploads']['delete'](_0x479496),this['_finishContextItemLoading']({'type':Us['URL'],'id':_0x294f25,'label':_0x2db252?.['label']||_0x1dfab9,'uiId':_0x479496,'resourceId':_0x2db252?.['resourceId']},!0x1);}catch(_0x5431d5){this['_ongoingUploads']['delete'](_0x479496),(_0x5431d5['message']['startsWith']('ai-request-aborted')||this['fire']('error',{'error':new ht('ai-chat-url-upload-failed',this,{'url':_0x1dfab9,'originalError':_0x5431d5}),'url':_0x1dfab9}),this['_removeContextItem'](_0x479496));}finally{this['_finishUploadOperation'](_0x32d384);}}['addToolItemToContext'](_0x11f729){_0x11f729['id']=_0x11f729['id']??ot()['substring'](0x0,0x15),this['_pendingContextItems']['set'](_0x11f729['uiId'],_0x11f729),this['fire']('contextItemAdded',{'contextItem':_0x11f729,'isLoading':!0x1});}async['loadSourceResources'](_0x1caa90,_0x59fdc9,_0x53481f){const _0x17e280=this['_addContextOptionsState']['sources']['find'](_0x595e58=>_0x595e58['id']===_0x1caa90);if(!_0x17e280)return this['fire']('error',{'error':new ht('ai-chat-source-not-found',this,{'sourceId':_0x1caa90}),'sourceId':_0x1caa90}),[];try{const _0x39caaa=(await _0x17e280['getResources'](_0x59fdc9))['map'](_0x2c2142=>{const _0x3ed3c1=this['_isResourceInContext'](_0x2c2142['id']);return{..._0x2c2142,'isInContext':_0x3ed3c1};});return _0x17e280['resources']=_0x39caaa,this['fire']('sourceResourcesLoaded',{'sourceId':_0x1caa90,'source':_0x17e280,'resources':_0x39caaa,'uid':_0x53481f}),_0x39caaa;}catch(_0x3b5dcd){return this['fire']('error',{'error':new ht('ai-chat-source-resources-load-failed',this,{'sourceId':_0x1caa90,'originalError':_0x3b5dcd}),'sourceId':_0x1caa90,'sourceLabel':_0x17e280['label']}),[];}}async['addResourceToContext'](_0x592ee6,_0x4ed124){if(this['_isResourceInContext'](_0x4ed124['id']))return;let _0x22c878=_0x4ed124['data'];if(!_0x22c878&&_0x592ee6['getData'])try{_0x22c878=await _0x592ee6['getData'](_0x4ed124['id']);}catch(_0x3b4436){return void this['fire']('error',{'error':new ht('ai-chat-resource-load-failed',this,{'resourceId':_0x4ed124['id'],'sourceId':_0x592ee6['id'],'originalError':_0x3b4436}),'resourceId':_0x4ed124['id'],'sourceId':_0x592ee6['id']});}if(_0x22c878)switch(_0x4ed124['type']){case Us['URL']:if('string'!=typeof _0x22c878)return void this['fire']('error',{'error':new ht('ai-chat-context-invalid-data',this,{'resourceId':_0x4ed124['id'],'sourceId':_0x592ee6['id'],'expectedType':'string','actualType':typeof _0x22c878}),'resourceId':_0x4ed124['id'],'sourceId':_0x592ee6['id']});await this['addUrlToContext'](_0x22c878,{'label':_0x4ed124['label'],'resourceId':_0x4ed124['id']});break;case Us['FILE']:if(!(_0x22c878 instanceof File))return void this['fire']('error',{'error':new ht('ai-chat-context-invalid-data',this,{'resourceId':_0x4ed124['id'],'sourceId':_0x592ee6['id'],'expectedType':'File','actualType':typeof _0x22c878}),'resourceId':_0x4ed124['id'],'sourceId':_0x592ee6['id']});await this['addFilesToContext']([_0x22c878],{'label':_0x4ed124['label'],'resourceId':_0x4ed124['id']});break;case Us['TEXT']:if('object'!=typeof _0x22c878||!('content'in _0x22c878)||!('type'in _0x22c878))return void this['fire']('error',{'error':new ht('ai-chat-context-invalid-data',this,{'resourceId':_0x4ed124['id'],'sourceId':_0x592ee6['id'],'expectedType':'object\x20with\x20content\x20and\x20type\x20properties','actualType':typeof _0x22c878}),'resourceId':_0x4ed124['id'],'sourceId':_0x592ee6['id']});_0x22c878=Fs['_convertTextResourceToFile'](_0x22c878,_0x4ed124['label']),await this['addFilesToContext']([_0x22c878],{'label':_0x4ed124['label'],'resourceId':_0x4ed124['id']},Us['TEXT']);break;case Us['TOOL']:break;default:this['fire']('error',{'error':new ht('ai-chat-context-unsupported-type',this,{'resourceId':_0x4ed124['id'],'sourceId':_0x592ee6['id'],'resourceType':_0x4ed124['type']}),'resourceId':_0x4ed124['id'],'sourceId':_0x592ee6['id']});}else this['fire']('error',{'error':new ht('ai-chat-resource-no-data',this,{'resourceId':_0x4ed124['id'],'sourceId':_0x592ee6['id']}),'resourceId':_0x4ed124['id'],'sourceId':_0x592ee6['id']});}static['_convertTextResourceToFile'](_0xaa96c1,_0x2246ea){switch(_0xaa96c1['type']){case Vs['MARKDOWN']:return new File([_0xaa96c1['content']],_0x2246ea,{'type':'text/markdown'});case Vs['HTML']:return new File([_0xaa96c1['content']],_0x2246ea,{'type':'text/html'});default:return new File([_0xaa96c1['content']],_0x2246ea,{'type':'text/plain'});}}static['_mapContextItemToRequestData'](_0x104a54){switch(_0x104a54['type']){case Us['FILE']:return{'type':Us['FILE'],'id':_0x104a54['id']};case Us['URL']:return{'type':Us['URL'],'id':_0x104a54['id']};case Us['DOCUMENT']:return{'type':Us['DOCUMENT'],'id':_0x104a54['id'],..._0x104a54['selection']?.['length']&&{'selection':_0x104a54['selection']}};case Us['TEXT']:return{'type':Us['FILE'],'id':_0x104a54['id']};case Us['TOOL']:{const _0x5f389a=_0x104a54;return{'type':Us['TOOL'],'mcpServerName':_0x5f389a['mcpServerName'],'toolName':_0x5f389a['toolName'],'data':_0x5f389a['data'],'id':_0x5f389a['id']};}default:return null;}}['_addContextItem'](_0x4a0d46,_0x2e1108=!0x1){if(this['_pendingContextItems']['set'](_0x4a0d46['uiId'],_0x4a0d46),_0x4a0d46['hidden']||this['fire']('contextItemAdded',{'contextItem':_0x4a0d46,'isLoading':_0x2e1108}),'current-document'===_0x4a0d46['uiId']&&this['_toggleAddCurrentDocumentOptionVisibility'](),_0x4a0d46['resourceId']){const _0x4ac5b4=this['_findSourceIdsByResourceId'](_0x4a0d46['resourceId']);_0x4ac5b4&&_0x4ac5b4['forEach'](_0x141cb4=>{this['_updateResourceInContextState'](_0x141cb4,_0x4a0d46['resourceId'],!0x0);});}}['_removeContextItem'](_0x484e76){const _0x1f401d=this['_pendingContextItems']['get'](_0x484e76),_0x1f7853=this['_ongoingUploads']['get'](_0x484e76);if(_0x1f7853&&(_0x1f7853['abort'](),this['_ongoingUploads']['delete'](_0x484e76)),_0x1f401d?.['resourceId']){const _0x354058=this['_findSourceIdsByResourceId'](_0x1f401d['resourceId']);_0x354058&&_0x354058['forEach'](_0x46fbb6=>{this['_updateResourceInContextState'](_0x46fbb6,_0x1f401d['resourceId'],!0x1);});}this['_pendingContextItems']['delete'](_0x484e76),this['fire']('contextItemRemoved',{'uiId':_0x484e76,'type':_0x1f401d?.['type']}),'current-document'===_0x484e76&&this['_toggleAddCurrentDocumentOptionVisibility']();}['_finishContextItemLoading'](_0x13bc49,_0x44a587){if(this['_pendingContextItems']['has'](_0x13bc49['uiId'])&&(this['_pendingContextItems']['set'](_0x13bc49['uiId'],_0x13bc49),this['fire']('contextItemLoadingEnded',{'contextItem':_0x13bc49,'isLoading':_0x44a587}),_0x13bc49['resourceId'])){const _0x3d0008=this['_findSourceIdsByResourceId'](_0x13bc49['resourceId']);_0x3d0008&&_0x3d0008['forEach'](_0x27baa3=>{this['_updateResourceInContextState'](_0x27baa3,_0x13bc49['resourceId'],!0x0);});}}['_addToConversationContextItem'](_0x4ca6a3){this['_conversationContextItems']['set'](_0x4ca6a3['uiId'],_0x4ca6a3);}['_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'](_0x4ed8d6=>({..._0x4ed8d6,'enabled':!0x0}))??[]},this['fire']('addContextOptionsChanged',{'options':this['_addContextOptionsState']});}['_getCustomSourcesInitialState'](){return this['_config']?.['sources']?.['map'](_0x4a3012=>({..._0x4a3012,'resources':[]}))??[];}['_toggleAddCurrentDocumentOptionVisibility'](){const _0x286996=this['isCurrentDocumentInContext']()||this['isCurrentDocumentInConversation']();this['_addContextOptionsState']['document']['isHidden']=_0x286996,this['fire']('addContextOptionsChanged',{'options':this['_addContextOptionsState']});}['_isResourceInContext'](_0x19a32e){for(const _0x196fba of this['_pendingContextItems']['values']())if(_0x196fba['resourceId']===_0x19a32e)return!0x0;for(const _0x471c5f of this['_conversationContextItems']['values']())if(_0x471c5f['resourceId']===_0x19a32e)return!0x0;return!0x1;}['_findSourceIdsByResourceId'](_0x564ca2){const _0x30deea=[];for(const _0x4c0217 of this['_addContextOptionsState']['sources']){_0x4c0217['resources']['find'](_0x1956ea=>_0x1956ea['id']===_0x564ca2)&&_0x30deea['push'](_0x4c0217['id']);}return 0x0===_0x30deea['length']?null:_0x30deea;}['_updateResourceInContextState'](_0xeefd1f,_0x1a29e2,_0x3585a8){const _0x1a9bee=this['_addContextOptionsState']['sources']['find'](_0x4d1c2e=>_0x4d1c2e['id']===_0xeefd1f);if(!_0x1a9bee)return;const _0x117e3d=_0x1a9bee['resources']['find'](_0xac1222=>_0xac1222['id']===_0x1a29e2);_0x117e3d&&(_0x117e3d['isInContext']=_0x3585a8,this['fire']('resourceStateChanged',{'sourceId':_0xeefd1f,'resourceId':_0x1a29e2,'isInContext':_0x3585a8}));}['_startUploadOperation'](_0x4dccbe){this['_ongoingUploadOperations']['set'](_0x4dccbe,!0x0),this['_ongoingUploadOperations']['size']&&this['fire']('uploadProgressChanged',{'isUploadInProgress':!0x0});}['_finishUploadOperation'](_0x1519c6){this['_ongoingUploadOperations']['delete'](_0x1519c6),0x0===this['_ongoingUploadOperations']['size']&&this['fire']('uploadProgressChanged',{'isUploadInProgress':!0x1});}}const Ks=['capabilitiesUpdated'];class Ws extends pt(){['_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'](_0x4fe84f){const _0x13d3e9={};return _0x4fe84f&&_0x4fe84f['isWebSearchEnabled']&&(_0x13d3e9['webSearch']={}),_0x4fe84f&&_0x4fe84f['isReasoningEnabled']&&(_0x13d3e9['reasoning']={}),_0x13d3e9;}['toggleWebSearch'](){this['setWebSearch'](!this['_isWebSearchEnabled']);}['toggleReasoning'](){this['setReasoning'](!this['_isReasoningEnabled']);}['setWebSearch'](_0x27a633){_0x27a633!==this['_isWebSearchEnabled']&&(this['_isWebSearchEnabled']=_0x27a633,this['fire']('capabilitiesUpdated',this['getCapabilitiesConfig']()));}['setReasoning'](_0x4b2ef0){_0x4b2ef0!==this['_isReasoningEnabled']&&(this['_isReasoningEnabled']=_0x4b2ef0,this['fire']('capabilitiesUpdated',this['getCapabilitiesConfig']()));}}class Ys extends Ms{['userMessage'];['conversationId'];['contextItems']=new Map();['capabilities'];['model'];['attributes'];constructor(_0x158c44){super(_0x158c44),this['conversationId']=_0x158c44['conversationId'],this['contextItems']=_0x158c44['contextItems'],this['capabilities']=_0x158c44['capabilities'],this['userMessage']=_0x158c44['userMessage'],this['model']=_0x158c44['model'],this['attributes']=_0x158c44['attributes'];}async['sendRequest'](){return this['connector']['queryAssistant']({'message':this['userMessage'],'conversationId':this['conversationId'],'parts':Fs['mapContextItemsToRequestData'](this['contextItems']),'capabilities':Ws['getCapabilitiesRequestData'](this['capabilities']),'model':this['model'],'attributes':this['attributes']});}['getDocumentContext'](){return this['contextItems']['get']('current-document');}}class $s extends pt(){['id'];['isStarted']=!0x1;['isFromHistory'];['interactions']=[];['currentInteraction'];['selectedModel'];['connector'];['options'];constructor(_0xc1362c){super(),this['options']=_0xc1362c,this['connector']=_0xc1362c['connector'],this['chatModels']=_0xc1362c['chatModels'],this['id']=_0xc1362c['conversationId'],this['isFromHistory']=_0xc1362c['isFromHistory'];}async['init'](_0x3eaa0d){try{this['chatContext']=new Fs({'connector':this['connector'],'config':_0x3eaa0d,'ownerId':this['id']}),this['chatContext']['delegate'](...Gs)['to'](this),this['chatContext']['init'](),this['chatCapabilities']=new Ws(),this['chatCapabilities']['delegate'](...Ks)['to'](this),this['chatCapabilities']['init']();const _0x58c1a1=await this['chatModels']['getAvailableModels']();this['fire']('conversationInitialized',{'availableModels':_0x58c1a1});const _0x48cb4b=await this['chatModels']['getModel'](this['options']['selectedModelId']);_0x48cb4b&&await this['setModel'](_0x48cb4b);}catch(_0xbf31a7){const _0x27911a=new ht('ai-chat-conversation-init-failed',null,{'message':_0xbf31a7['message']||_0xbf31a7});_0x27911a['stack']=_0xbf31a7['stack'],this['fire']('error',{'error':_0x27911a});}}async['start'](){if(this['isStarted'])throw new ht('ai-chat-conversation-already-started',null,{'conversation':this});if(!this['selectedModel'])throw new ht('ai-chat-conversation-start-no-model-selected',null,{'conversation':this});try{const {id:_0x898074}=await this['connector']['startConversation'](this['id'],this['options']['group'])['getConversation']();this['id']=_0x898074,this['isStarted']=!0x0,this['fire']('conversationStarted',{'conversationId':this['id'],'selectedModel':this['selectedModel']});}catch(_0x385db4){const _0x2bc618=new ht('ai-chat-conversation-start-failed',null,{'message':_0x385db4['message'],'conversationId':this['id']});throw _0x2bc618['stack']=_0x385db4['stack'],this['fire']('error',{'error':_0x2bc618}),_0x2bc618;}}async['load'](_0x208575,_0x1a06c0){try{const _0x1cf121=await this['connector']['fetchConversation'](_0x208575)['getConversation'](),_0x597337=await this['connector']['fetchConversationMessages'](_0x208575)['getMessages'](),_0x432f81=_0x597337[0x0]['model'];this['isStarted']=!0x0,this['id']=_0x1cf121['id'],'title'in _0x1cf121?this['fire']('setConversationTitle',_0x1cf121['title'],!0x0):this['fire']('setConversationTitle','',!0x0);const _0x445bad=(await this['chatModels']['getAll']())['find'](_0x2d1fb3=>_0x2d1fb3['id']['toLowerCase']()===_0x432f81['toLowerCase']());return this['selectedModel']=_0x445bad,this['fire']('modelSelected',{'selectedModel':_0x445bad,'isDisabled':!0x0}),await this['_processMessagesToInteractions'](_0x597337,_0x1a06c0,_0x432f81),this['currentInteraction']=void 0x0,this;}catch(_0x3ea88b){const _0x32b920=new ht('ai-chat-conversation-init-from-id-failed',null,{'message':_0x3ea88b['message'],'conversationId':_0x208575});throw _0x32b920['stack']=_0x3ea88b['stack'],this['fire']('error',{'error':_0x32b920}),_0x32b920;}}async['_processMessagesToInteractions'](_0x5f0275,_0x2bcbbc,_0x29ba30){let _0xba2334;for(const _0x4de089 of _0x5f0275)if('user'===_0x4de089['role']){const _0x331b00=await this['_extractContextItems'](_0x4de089),_0x2d65a0={'isReasoningEnabled':Object['hasOwn'](_0x4de089['capabilities'],'reasoning'),'isWebSearchEnabled':Object['hasOwn'](_0x4de089['capabilities'],'webSearch')};_0xba2334=this['createInteraction']({'userMessage':_0x4de089['prompt'],'contextItems':_0x331b00,'capabilities':_0x2d65a0,'modelId':_0x29ba30,'attributes':_0x4de089['attributes']}),this['currentInteraction']=_0xba2334,this['chatContext']['addToConversationContext'](this['currentInteraction']['contextItems']);}else{if('assistant'===_0x4de089['role']&&_0xba2334){const _0x7b6613=[];for(const _0x297427 of _0x4de089['content'])switch(_0x297427['type']){case'text':case'modification':{const _0x336ea6=_0xba2334['getDocumentContext']()?.['sessionId']!==_0x2bcbbc;_0xba2334['currentReply']=_0xba2334['createReply']({'type':_0x297427['type'],'isDone':!0x0,'interactionId':_0xba2334['id'],'areActionsDisabled':_0x336ea6}),_0xba2334['currentReply']['appendContent'](_0x297427['content']),_0x7b6613['length']>0x0&&(_0xba2334['currentReply']['sources']=_0x7b6613['splice'](0x0));break;}case'url':_0x7b6613['push'](_0x297427);break;case'mcp-tool-result':{const {data:_0x3bbe78,attributes:_0x450b58}=JSON['parse'](_0x297427['content']);_0xba2334['_handleToolResultData']({'toolName':_0x297427['toolName'],'data':_0x3bbe78,'attributes':_0x450b58});break;}}}}}async['_extractContextItems'](_0x7c4aec){const _0x25a1ac=new Map();if(!_0x7c4aec['content'])return _0x25a1ac;for(const _0x1a38e6 of _0x7c4aec['content']){const _0x429380=await this['chatContext']['populateFromMessage'](_0x1a38e6);_0x429380&&_0x25a1ac['set'](_0x429380['id'],_0x429380);}return _0x25a1ac;}async['handleUserInteraction']({userMessage:_0x2b258b,attributes:_0x53df6c}){if(!this['isStarted'])throw new ht('ai-chat-handle-user-conversation-not-initialized',null,{'conversation':this});if(this['currentInteraction'])throw new ht('ai-chat-handle-user-interaction-already-in-progress',null,{'conversation':this});try{const _0x534cc2=this['chatContext']['getPendingContextItems'](),_0xe99a70=this['chatCapabilities']['getCapabilitiesConfig'](),_0x4e9a4a=this['selectedModel']['id'];this['currentInteraction']=this['createInteraction']({'userMessage':_0x2b258b,'contextItems':_0x534cc2,'capabilities':_0xe99a70,'modelId':_0x4e9a4a,'attributes':_0x53df6c}),await this['currentInteraction']['start'](),this['chatContext']['addToConversationContext'](this['currentInteraction']['contextItems']);}catch(_0x8100dc){if(_0x8100dc instanceof ht)this['fire']('error',{'interactionId':this['currentInteraction']?this['currentInteraction']['id']:void 0x0,'error':_0x8100dc});else{const _0xbc7d46=Bs['get'](_0x8100dc['code'])||'ai-chat-handle-user-interaction-start-failed';this['fire']('error',{'interactionId':this['currentInteraction']?this['currentInteraction']['id']:void 0x0,'error':new ht(_0xbc7d46,null,{'error':_0x8100dc})});}}finally{this['currentInteraction']?.['stop'](),this['currentInteraction']=void 0x0;}}['createInteraction']({userMessage:_0x5ead76,contextItems:_0x4a232f,capabilities:_0x57011d,modelId:_0xa0d831,attributes:_0x3b4619}){const _0xec539=new Ys({'userMessage':_0x5ead76,'contextItems':_0x4a232f,'capabilities':_0x57011d,'conversationId':this['id'],'connector':this['connector'],'editor':this['options']['getEditor']&&this['options']['getEditor'](),'model':_0xa0d831,'attributes':_0x3b4619});return _0xec539['delegate'](...Hs)['to'](this),this['interactions']['push'](_0xec539),this['fire']('interactionCreated',_0xec539),_0xec539;}['getInteraction'](_0x1221c5){return this['interactions']['find'](_0x248c7e=>_0x248c7e['id']===_0x1221c5);}['removeInteraction'](_0x5c7293){const _0x286fb1=this['getInteraction'](_0x5c7293);_0x286fb1&&(_0x286fb1['destroy'](),this['interactions']['splice'](this['interactions']['indexOf'](_0x286fb1),0x1));}get['lastInteraction'](){return this['interactions'][this['interactions']['length']-0x1];}['addCurrentDocumentToContext'](_0x1a34fa){this['chatContext']['addCurrentDocumentToContext'](_0x1a34fa);}async['updateCurrentDocumentInContext']({content:_0x4cd5a2,version:_0x1a14e3,sessionId:_0xbc5667,selections:_0x46c096}){await this['chatContext']['updateCurrentDocument'](_0x4cd5a2,_0x1a14e3,_0xbc5667,_0x46c096);}['getCurrentDocumentContext'](){return this['currentInteraction']?.['getDocumentContext']()?.['content']||'';}['addSelectionToContext'](_0x17e42e){this['chatContext']['addSelectionToContext'](_0x17e42e);}['removeSelectionFromContext'](){this['chatContext']['removeSelectionFromContext']();}['addFilesToContext'](_0x31541e){this['chatContext']['addFilesToContext'](_0x31541e);}['addUrlToContext'](_0x3f918f){this['chatContext']['addUrlToContext'](_0x3f918f);}['addToolItemToContext'](_0x50abb1){this['chatContext']['addToolItemToContext'](_0x50abb1);}['addResourceToContext'](_0x15ec58,_0x4b6328){this['chatContext']['addResourceToContext'](_0x15ec58,_0x4b6328);}['loadSourceResources'](_0xa65794,_0x41d796,_0x467cc7){return this['chatContext']['loadSourceResources'](_0xa65794,_0x41d796,_0x467cc7);}['removeFromContext'](_0x53367d){this['chatContext']['removeFromContext'](_0x53367d);}['setWebSearch'](_0x21133a){this['chatCapabilities']['setWebSearch'](_0x21133a);}['toggleWebSearch'](){this['chatCapabilities']['toggleWebSearch']();}['setReasoning'](_0x5c5b7b){this['chatCapabilities']['setReasoning'](_0x5c5b7b);}['toggleReasoning'](){this['chatCapabilities']['toggleReasoning']();}['isCurrentDocumentInContext'](){return this['chatContext']['isCurrentDocumentInContext']();}['isCurrentDocumentInConversation'](){return this['chatContext']['isCurrentDocumentInConversation']();}['isSelectionInContext'](){return this['chatContext']['isSelectionInContext']();}async['setModel'](_0x4f27df){_0x4f27df?!0x1===await this['chatModels']['isAvailable'](_0x4f27df)&&(Tt('ai-chat-conversation-set-model-not-available',{'conversation':this,'model':_0x4f27df}),_0x4f27df=(await this['chatModels']['getAvailableModels']())[0x0]):(Tt('ai-chat-conversation-set-model-null',{'conversation':this}),_0x4f27df=(await this['chatModels']['getAvailableModels']())[0x0]),_0x4f27df['id']!==this['selectedModel']?.['id']&&(this['selectedModel']=_0x4f27df,this['chatCapabilities']['reset'](),this['fire']('modelSelected',{'selectedModel':_0x4f27df}));}}class qs extends pt(){['_connector'];['_config'];['_locale'];['_modelList']=[];['_modelsRequest']=null;constructor({connector:_0x55fc05,config:_0x416b36,locale:_0x22359c}){super(),this['_connector']=_0x55fc05,this['_config']=_0x416b36,this['_locale']=_0x22359c;}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 _0x5368d2=await this['getAll']();let _0x39df3f;return _0x39df3f=this['_availableModels']?this['_filterModels'](_0x5368d2,this['_availableModels']):_0x5368d2['filter'](_0x4d2cb0=>_0x4d2cb0['recommended']),_0x39df3f;}async['getModel'](_0x342f9f){const _0xc47705=await this['getAll']();if(!_0xc47705['length'])return null;if(_0x342f9f){const _0x183fb3=this['_getModelById'](_0xc47705,_0x342f9f);if(_0x183fb3)return _0x183fb3;Tt('ai-chat-model-id-unrecognized',{'modelId':_0x342f9f,'fallBackModelId':this['_defaultModelId']});}return this['getDefault']();}async['getDefault'](){const _0x5923ca=await this['getAvailableModels']();if(!_0x5923ca['length'])return null;if(this['_defaultModelId']){const _0x193b95=this['_getModelById'](_0x5923ca,this['_defaultModelId']);if(_0x193b95)return _0x193b95;Tt('ai-chat-default-model-id-unrecognized',{'defaultModelId':this['_defaultModelId'],'fallBackModelId':_0x5923ca[0x0]['id']});}return _0x5923ca[0x0];}async['isAvailable'](_0x463d9f){return(await this['getAvailableModels']())['some'](_0x20db57=>_0x20db57['name']===_0x463d9f['name']&&_0x20db57['provider']===_0x463d9f['provider']);}async['_retrieveModels'](){if(!this['_modelList']['length'])try{const _0x43e026=this['_locale']['uiLanguage']||'en',_0x37af01=this['_connector']['getModels'](_0x43e026),_0x30ead2=await _0x37af01['list']();this['_modelList']=_0x30ead2['items']['map'](_0x5b91d2=>Qs(_0x5b91d2)?{..._0x5b91d2,'name':us(this['_locale'],'AI_MODEL_NAME_AUTO')}:_0x5b91d2);}catch(_0x2ef6b4){throw mt('ai-models-unable-to-retrieve',{'error':_0x2ef6b4}),_0x2ef6b4;}return[...this['_modelList']];}['_filterModels'](_0x24b2ff,_0x62f952){let _0x1bc1e1;if(_0x62f952){_0x1bc1e1=[];const _0x2e66=new Set(),_0x1ff45c='string'==typeof _0x62f952?[_0x62f952['toLocaleLowerCase']()]:_0x62f952['map'](_0x34937d=>_0x34937d['toLocaleLowerCase']());for(const _0x8556f7 of _0x1ff45c)for(const _0x47c5a6 of _0x24b2ff)!_0x2e66['has'](_0x47c5a6['id'])&&this['_isMatchingFilter'](_0x47c5a6,_0x8556f7)&&(_0x1bc1e1['push'](_0x47c5a6),_0x2e66['add'](_0x47c5a6['id']));}else _0x1bc1e1=_0x24b2ff;return _0x1bc1e1;}['_isMatchingFilter'](_0x596d45,_0x25b640){const _0x58b2bc=_0x596d45['id']['toLocaleLowerCase'](),_0x1c33bc=_0x596d45['name']['toLocaleLowerCase'](),_0x257d82=_0x596d45['provider']['toLocaleLowerCase']();return _0x58b2bc===_0x25b640||_0x1c33bc===_0x25b640||Qs(_0x596d45)&&'auto'===_0x25b640||_0x257d82===_0x25b640||_0x58b2bc['startsWith'](_0x25b640);}['_getModelById'](_0x3658f4,_0x54e328){return _0x3658f4['find'](_0x4108a1=>Qs(_0x4108a1)&&'auto'===_0x54e328?_0x4108a1:_0x4108a1['id']===_0x54e328)||null;}}function Qs(_0x38e5a9){return _0x38e5a9['id']['startsWith']('agent');}function Xs(_0x28a343){if(_0x28a343 instanceof _0x562c83)return _0x28a343;if(_0x28a343?.['editors']&&_0x28a343['editors']['get'](0x0))return _0x28a343['editors']['length']>0x1&&console['warn']('AIChat:\x20Multiple\x20editor\x20instances\x20detected.\x20Only\x20the\x20first\x20editor\x20instance\x20will\x20be\x20used\x20for\x20AI\x20operations.\x20This\x20configuration\x20is\x20not\x20fully\x20supported\x20and\x20may\x20lead\x20to\x20unexpected\x20behavior.'),_0x28a343['editors']['get'](0x0);throw new ht('ai-get-editor-from-context-no-editor');}function zs({editor:_0x3a4969,interaction:_0x41ad23,reply:_0x28d950,groups:_0xd48d0c,transform:_0x70fbab,documentCompare:_0x5495f7,documentCompareOptions:_0xc250fe}){const _0x271e7f=_0x41ad23['getDocumentContext']();if(!_0x271e7f)return[];const _0x5eb3aa=_0x271e7f['content'],_0x410e41=_0x271e7f['version'],_0x2a9302=_0x28d950['documentContextContent']['cloneNode'](!0x0);for(const {changes:_0x5530ce}of _0xd48d0c){const _0x4c0173=_0x5530ce['filter'](_0x2672a4=>'new'!=_0x2672a4['type'])['map'](_0x563cc4=>ps('data-id',_0x563cc4['id'],_0x2a9302)),_0x3e0c0a=_0x5530ce['filter'](_0x109175=>'removed'!=_0x109175['type'])['map'](_0x5a6861=>_0x5a6861['node']['cloneNode'](!0x0));let _0x1df06d=null;if(_0x4c0173['length']){_0x1df06d=_0x4c0173[0x0]['previousSibling'];for(let _0x15b46e=0x0;_0x15b46e<_0x4c0173['length'];_0x15b46e++)_0x544b32(_0x4c0173[_0x15b46e]);}if(_0x3e0c0a['length']){_0x1df06d||(_0x5530ce[0x0]['anchorId']?_0x1df06d=ps('data-id',_0x5530ce[0x0]['anchorId'],_0x2a9302):(_0x1df06d=_0x3e0c0a['shift'](),_0x23eccc(_0x2a9302,_0x1df06d)));for(let _0x2b9e2e=0x0;_0x2b9e2e<_0x3e0c0a['length'];_0x2b9e2e++)_0x16e185(_0x1df06d,_0x3e0c0a[_0x2b9e2e]),_0x1df06d=_0x3e0c0a[_0x2b9e2e];}}const _0x5d7e0d=Es(_0x2a9302),_0x4baebf=_0x5495f7['getDiff'](_0x5eb3aa,_0x5d7e0d,_0xc250fe)['getOperations']();if(_0x70fbab){const _0x210e12=_0x3a4969['model']['document']['history']['getOperations'](_0x410e41),_0x3b2ecb={'document':_0x3a4969['model']['document'],'useRelations':!0x1,'padWithNoOps':!0x1};return _0x4976b5(_0x4baebf,_0x210e12,_0x3b2ecb)['operationsA'];}return _0x4baebf;}function js(_0x535370,_0x325d90){if('marker'!=_0x325d90['type'])return;const _0x11a5ea=_0x535370['model']['markers']['get'](_0x325d90['name']);_0x11a5ea&&(_0x325d90['oldRange']=_0x11a5ea['getRange']());}class Js extends _0x3397b8{['activeConversation'];['_aiEditing'];['_aiConnector'];['_aiChatUi'];['_aiChatModels'];['_aiChatBalloon'];['_batchToChanges']=new Map();['_currentPreviewedChangeGroup']=null;['_bodyCollection'];static get['requires'](){return[ls,_0x43d889];}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 qs({'connector':this['_aiConnector'],'config':this['context']['config']['get']('ai.models'),'locale':this['context']['locale']});const _0x25bf6c=this['context']['plugins']['get']('AITabs');this['listenTo'](this['_aiChatUi'],'startConversation',()=>{this['_startConversationSafely']();}),this['listenTo'](this['_aiChatUi'],'sendUserMessage',(_0x141183,_0x4762d4)=>{this['_handleUIUserMessage']({'message':_0x4762d4});}),this['listenTo'](_0x25bf6c,'resizedTabs',(_0x44115a,_0x35f192)=>{this['_setIsMaximized'](_0x35f192);}),this['listenTo'](this['_aiChatUi'],'resizeTabs',()=>{_0x25bf6c['resize']();}),this['listenTo'](_0x25bf6c['view'],'change:activeTab',(_0x461e2d,_0x465c2d,_0x480e56)=>{'chat'!==_0x480e56&&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',(_0x1e9a0f,_0x227753)=>{this['activeConversation']?.['addFilesToContext'](Array['from'](_0x227753));}),this['listenTo'](this['_aiChatUi'],'addUrlToContext',(_0x15d1d9,_0x23937a)=>{this['activeConversation']?.['addUrlToContext'](_0x23937a);}),this['listenTo'](this['_aiChatUi'],'executeCustomItemCallback',(_0x233d5f,_0x1b54b8)=>{_0x1b54b8['callback'](this['context']);}),this['listenTo'](this['_aiChatUi'],'addResourceToContext',(_0x41b9e8,_0x32a9ae)=>{this['activeConversation']?.['addResourceToContext'](_0x32a9ae['source'],_0x32a9ae['resource']);}),this['listenTo'](this['_aiChatUi'],'removeContextItem',(_0x4c9da3,_0x39e73d)=>{this['_removeFromContext'](_0x39e73d);}),this['listenTo'](this['_aiChatUi'],'loadSourceResources',(_0x1bd1a1,_0x4205e8)=>{this['activeConversation']?.['loadSourceResources'](_0x4205e8['sourceId'],_0x4205e8['query'],_0x4205e8['uid']);}),this['listenTo'](this['_aiChatUi'],'toggleWebSearch',()=>{this['_toggleWebSearch']();}),this['listenTo'](this['_aiChatUi'],'toggleReasoning',()=>{this['_toggleReasoning']();}),this['listenTo'](this['_aiChatUi'],'selectModel',(_0x47e7b2,_0x226c8c)=>{this['activeConversation']?.['setModel'](_0x226c8c);}),this['listenTo'](this['_aiChatUi'],'like',(_0x3d9b3a,{replyId:_0x380aea})=>{console['log']('Liked\x20response',_0x380aea);}),this['listenTo'](this['_aiChatUi'],'dislike',(_0x4e7d06,{replyId:_0x542644})=>{console['log']('Disliked\x20response',_0x542644);}),this['listenTo'](this['_aiChatUi'],'insertSuggestion',(_0x234579,_0x133191)=>{this['_insertSuggestion'](_0x133191);}),this['listenTo'](this['_aiChatUi'],'showChangeInText',(_0x5e0369,{replyId:_0x20c1b6,partIndex:_0xa41f0d})=>{this['_aiChatBalloonShowDiff']=this['_aiChatUi']['showDiff'],this['_openBalloonFor'](_0x20c1b6,_0xa41f0d);}),this['listenTo'](this['_aiChatUi'],'mouseOverSuggestion',(_0x4d086b,{replyId:_0x2d032e,partIndex:_0x175da2})=>{const _0xefdb97=this['_getDocumentRangeForReplyChanges'](_0x2d032e,_0x175da2);_0xefdb97&&'$graveyard'!=_0xefdb97['range']['root']['rootName']&&this['_aiEditing']['showFakeVisualSelection']({'ranges':[_0xefdb97['range']],'id':'change-area','priority':0xa});}),this['listenTo'](this['_aiChatUi'],'mouseLeaveSuggestion',()=>{this['_aiEditing']['hideFakeVisualSelection']('change-area');}),this['listenTo'](this['_aiChatUi'],'applySuggestion',(_0x34d0d6,_0x21f41e)=>{this['_aiEditing']['hideFakeVisualSelection']('change-area'),this['_applySuggestion'](_0x21f41e);}),this['listenTo'](this['_aiChatUi'],'toggleSuggestionDisplayMode',async(_0x38461b,{replyId:_0x4d2937,showDiff:_0x564e62})=>{const {reply:_0x123b93}=this['getInteractionAndReplyById'](_0x4d2937),_0x462f9b=_0x123b93['getContentParts']({'showDiff':_0x564e62});await this['_aiChatUi']['updateFeedItemAIReplySuggestionContent']({'id':_0x123b93['id'],'parts':_0x462f9b,'renderingStrategy':'static'});}),this['listenTo'](this['_aiChatUi'],'rejectSuggestion',(_0x11fc98,{replyId:_0x456df5,partIndex:_0x226823})=>{this['_rejectSuggestion']({'replyId':_0x456df5,'partIndex':_0x226823}),this['_aiEditing']['hideFakeVisualSelection']('change-area');}),this['context']['plugins']['has']('AIChatBalloon')&&(this['_aiChatBalloon']=this['context']['plugins']['get']('AIChatBalloon'),this['set']('_aiChatBalloonShowDiff',!0x1),this['_aiChatBalloon']['bind']('showDiff')['to'](this,'_aiChatBalloonShowDiff'),this['listenTo'](this['_aiChatBalloon'],'toggleSuggestionDisplayMode',()=>{const {replyId:_0x58c940,partIndex:_0x4114da}=this['_currentPreviewedChangeGroup'];this['_aiChatBalloonShowDiff']=!this['_aiChatBalloonShowDiff'];const {reply:_0x96aed4}=this['getInteractionAndReplyById'](_0x58c940),_0x50bde9=_0x96aed4['getContentParts']({'showDiff':this['_aiChatBalloonShowDiff'],'groupIndex':_0x4114da});this['_aiChatBalloon']['updateContent']({'part':_0x50bde9[0x0],'renderingStrategy':'static','keepErrors':!0x0});}),this['listenTo'](this['_aiChatBalloon'],'applySuggestion',()=>{const {replyId:_0x3a5933,partIndex:_0x43df76}=this['_currentPreviewedChangeGroup'];this['_applySuggestion']({'replyId':_0x3a5933,'partIndex':_0x43df76}),this['_aiChatBalloon']['setState']('accepted');}),this['listenTo'](this['_aiChatBalloon'],'insertSuggestion',()=>{const {replyId:_0x423b02,partIndex:_0x3c8c98}=this['_currentPreviewedChangeGroup'];this['_insertSuggestion']({'replyId':_0x423b02,'partIndex':_0x3c8c98}),this['_aiChatBalloon']['setState']('accepted');}),this['listenTo'](this['_aiChatBalloon'],'rejectSuggestion',()=>{const {replyId:_0x5071b3,partIndex:_0x1b085e}=this['_currentPreviewedChangeGroup'];this['_rejectSuggestion']({'replyId':_0x5071b3,'partIndex':_0x1b085e}),this['_aiChatBalloon']['setState']('rejected');}),this['listenTo'](this['_aiChatBalloon'],'showNext',()=>{const {replyId:_0x14b8be,partIndex:_0x1ffab0}=this['_currentPreviewedChangeGroup'],_0x211af0=this['_getPresentableSiblingContentPartIndex'](_0x14b8be,_0x1ffab0,'next');null!==_0x211af0&&this['_openBalloonFor'](_0x14b8be,_0x211af0);}),this['listenTo'](this['_aiChatBalloon'],'showPrevious',()=>{const {replyId:_0x543ae9,partIndex:_0x35034a}=this['_currentPreviewedChangeGroup'],_0x50996d=this['_getPresentableSiblingContentPartIndex'](_0x543ae9,_0x35034a,'previous');null!==_0x50996d&&this['_openBalloonFor'](_0x543ae9,_0x50996d);}),this['listenTo'](this['_aiChatBalloon'],'dialogClosed',(_0x55460f,{id:_0xb8f076})=>{if('aiChatBalloon'!==_0xb8f076)return;const {replyId:_0x2b1a84,partIndex:_0x3a5048}=this['_currentPreviewedChangeGroup'];this['_currentPreviewedChangeGroup']=null,this['_aiChatUi']['setFeedItemAIReplySuggestionPartActive']({'id':_0x2b1a84,'index':_0x3a5048,'isActive':!0x1});}));}async['afterInit'](){this['context']instanceof _0x562c83?this['_integrateEditor'](this['context']):this['listenTo'](this['context']['editors'],'add',(_0x34f6ea,_0x3a0675)=>{_0x3a0675['on']('ready',()=>{this['_integrateEditor'](_0x3a0675);});});const _0x574eba=this['context']['config']['get']('ai.chat.initialConversation');let _0x3a14f8=_0x574eba;if('lastCreated'!=_0x574eba||(_0x3a14f8=await this['_getLastCreatedConversationId'](),_0x3a14f8))return'new'==_0x3a14f8?this['_startConversationSafely']():this['loadConversation'](_0x3a14f8);}async['destroy'](){return await this['_stopLastInteraction'](),this['_bodyCollection']['detachFromDom'](),super['destroy']();}async['loadConversation'](_0x1f3ad5){this['context']['plugins']['has']('AIChatBalloon')&&this['context']['plugins']['get']('AIChatBalloon')['close'](),(this['context']['plugins']['get'](cs)['view']['activateTab']('chat'),this['_aiChatUi']['setFeedItemRenderingStrategy']('static'),this['_aiChatUi']['toggleLoadingSkeleton'](!0x0),await this['_stopLastInteraction']());try{await this['_aiConnector']['fetchConversation'](_0x1f3ad5)['getConversation'](),await this['_startConversationSafely'](_0x1f3ad5),this['_updateConversationTitle']('\x20'),await this['activeConversation']['load'](_0x1f3ad5,this['_aiEditing']['sessionId']),this['activeConversation']['isCurrentDocumentInConversation']()&&this['addCurrentDocumentToChatContext']();}catch(_0x8d3099){this['_aiChatUi']['addFeedItemError']({'errorMessage':us(this['context']['locale'],'AI_CHAT_UNABLE_TO_LOAD_CONVERSATION'),'id':_0x1f3ad5}),this['_logError'](new ht('ai-chat-conversation-not-found',this,{'error':_0x8d3099}));}finally{this['_aiChatUi']['startAutoScroll'](),this['_aiChatUi']['setFeedItemRenderingStrategy']('streaming'),this['_aiChatUi']['toggleLoadingSkeleton'](!0x1);}}['registerToolDataCallback'](_0x4ca96a){let _0x1c0347=null,_0x7252fe=null;this['on']('toolDataReceived',(_0x47cab2,_0x3cb111,_0x331492)=>{_0x331492['id']!==_0x1c0347&&(_0x1c0347=_0x331492['id'],_0x7252fe=this['_getAIChatFeedAPI'](_0x331492)),_0x4ca96a(_0x3cb111,_0x7252fe);});}['addCurrentDocumentToChatContext'](){this['activeConversation']?.['addCurrentDocumentToContext'](us(this['context']['locale'],'AI_CHAT_CONTEXT_CURRENT_DOCUMENT'));}async['addSelectionToChatContext'](){const _0x477c36=this['_aiEditing']['getSelectionText']();this['activeConversation']?.['addSelectionToContext'](_0x477c36),this['addCurrentDocumentToChatContext']();}['removeSelectionFromChatContext'](){this['activeConversation']?.['removeSelectionFromContext']();}['focusPromptInput'](){this['_aiChatUi']['focusPromptInput']();}async['startConversation'](){await this['_startConversationSafely']();}async['sendMessage'](_0x40ddaa){await this['_handleUIUserMessage'](_0x40ddaa);}['getGroupId'](){const _0x3c5ac0=this['context']['config']['get']('collaboration.channelId');if(!_0x3c5ac0)throw new ht('ai-chat-missing-channel-id',this);return _0x3c5ac0;}['_handleRemovedConversation'](_0x50699){this['activeConversation']['id']===_0x50699&&this['_startConversationSafely']();}['_insertSuggestion'](_0x138afe){const _0x239ceb=Xs(this['context']);if(!_0x239ceb['plugins']['has']('TrackChanges'))throw new ht('ai-no-track-changes',null);const _0x523cb6=this['context']['plugins']['get']('DocumentCompare'),{reply:_0x40a0d1,interaction:_0x4a014f}=this['getInteractionAndReplyById'](_0x138afe['replyId']),_0xe6c507=this['_getDocumentRangeForReplyChanges'](_0x138afe['replyId'],_0x138afe['partIndex']),_0x5821d2=void 0x0!==_0x138afe['partIndex']?[_0x40a0d1['changeGroups'][_0x138afe['partIndex']]]:_0x40a0d1['changeGroups']['filter'](_0x1da322=>'pending'==_0x1da322['state']),_0x39f202=_0x5821d2['map'](_0x57e963=>_0x40a0d1['changeGroups']['indexOf'](_0x57e963));if(!_0xe6c507||'$graveyard'==_0xe6c507['range']['root']['rootName'])return void _0x39f202['forEach'](_0x227770=>_0x40a0d1['setChangeGroupState'](_0x227770,'outdated'));_0x39f202['forEach'](_0x4b57e1=>_0x40a0d1['setChangeGroupState'](_0x4b57e1,'accepted'));const _0x4a4eb7=zs({'editor':_0x239ceb,'reply':_0x40a0d1,'interaction':_0x4a014f,'groups':_0x5821d2,'transform':!0x0,'documentCompare':_0x523cb6,'documentCompareOptions':{'anchor':'main','markDeletions':!0x0}});let _0x4efc83;_0xe6c507&&this['_scrollToSuggestionRange'](_0xe6c507['range']),_0x239ceb['model']['change'](_0x319f53=>{_0x4efc83=_0x319f53['batch'],_0x239ceb['plugins']['get']('TrackChangesEditing')['_applyOperationsAsSuggestions'](_0x4a4eb7),this['_aiEditing']['hideFakeVisualSelection']('change-area');}),this['_batchToChanges']['set'](_0x4efc83,{'interactionId':_0x4a014f['id'],'replyId':_0x40a0d1['id'],'indexes':_0x39f202['slice']()}),this['_updateRatings'](_0x40a0d1);}['_applySuggestion'](_0x7c9e73){const _0x1820d2=Xs(this['context']),_0x39cc38=this['context']['plugins']['get'](_0x43d889),{reply:_0x453948,interaction:_0x1a7979}=this['getInteractionAndReplyById'](_0x7c9e73['replyId']),_0x2f6a4b=this['_getDocumentRangeForReplyChanges'](_0x7c9e73['replyId'],_0x7c9e73['partIndex']),_0x469eff=void 0x0!==_0x7c9e73['partIndex']?[_0x453948['changeGroups'][_0x7c9e73['partIndex']]]:_0x453948['changeGroups']['filter'](_0x1ab7ba=>'pending'==_0x1ab7ba['state']),_0x5900ab=_0x469eff['map'](_0x4e8a19=>_0x453948['changeGroups']['indexOf'](_0x4e8a19));if(!_0x2f6a4b||'$graveyard'==_0x2f6a4b['range']['root']['rootName'])return void _0x5900ab['forEach'](_0x57fee5=>_0x453948['setChangeGroupState'](_0x57fee5,'outdated'));_0x5900ab['forEach'](_0x41d82a=>_0x453948['setChangeGroupState'](_0x41d82a,'accepted'));const _0x5f258f=zs({'editor':_0x1820d2,'reply':_0x453948,'interaction':_0x1a7979,'groups':_0x469eff,'transform':!0x0,'documentCompare':_0x39cc38,'documentCompareOptions':{'anchor':'main','markDeletions':!0x1}});let _0x18aa5c;_0x2f6a4b&&this['_scrollToSuggestionRange'](_0x2f6a4b['range']),_0x1820d2['model']['change'](_0x2d4805=>{_0x18aa5c=_0x2d4805['batch'];for(const _0x3359ff of _0x5f258f)_0x3359ff['baseVersion']=_0x1820d2['model']['document']['version'],js(_0x1820d2,_0x3359ff),_0x2d4805['batch']['addOperation'](_0x3359ff),_0x1820d2['model']['applyOperation'](_0x3359ff);}),this['_batchToChanges']['set'](_0x18aa5c,{'interactionId':_0x1a7979['id'],'replyId':_0x453948['id'],'indexes':_0x5900ab['slice']()}),this['_updateRatings'](_0x453948);}['_rejectSuggestion'](_0x431f44){const {reply:_0x31ec3a}=this['getInteractionAndReplyById'](_0x431f44['replyId']);_0x31ec3a['setChangeGroupState'](_0x431f44['partIndex'],'rejected');}['_openBalloonFor'](_0x141ee0,_0x209172){if(!this['_aiChatBalloon'])return;const {reply:_0x3da5e0}=this['getInteractionAndReplyById'](_0x141ee0),_0x3d62e5=_0x3da5e0['getContentParts']({'showDiff':this['_aiChatBalloonShowDiff']});let _0x413ed7,_0x13803e;if(void 0x0!==_0x209172?(_0x13803e=_0x3d62e5['find'](_0xa6e4c2=>_0xa6e4c2['index']==_0x209172),_0x413ed7=_0x13803e?.['index']):(_0x13803e=_0x3d62e5[0x0],_0x413ed7=_0x13803e['index']),this['_currentPreviewedChangeGroup']?.['replyId']==_0x141ee0&&this['_currentPreviewedChangeGroup']?.['partIndex']==_0x413ed7)return;const _0x1c33f1=this['_getUserPresentableContentPartDocumentRange'](_0x141ee0,_0x3da5e0,_0x13803e);if(!_0x1c33f1)return void this['_aiChatBalloon']['close']();this['_currentPreviewedChangeGroup']={'replyId':_0x141ee0,'partIndex':_0x413ed7},this['_scrollToSuggestionRange'](_0x1c33f1,!0x0);const _0x27e4e9=this['_getPresentableSiblingContentPartIndex'](_0x141ee0,_0x413ed7,'next');this['_aiChatBalloon']['updateContent']({'part':_0x13803e,'renderingStrategy':'static'}),this['_aiChatBalloon']['open']({'index':_0x413ed7,'title':us(this['context']['locale'],'AI_BALLOON_HEADER_TITLE',(_0x413ed7+0x1)['toString']()),'showRotator':null!==_0x27e4e9,'ranges':[_0x1c33f1],'areActionsDisabled':_0x3da5e0['areActionsDisabled']}),this['_aiChatBalloon']['setState']('pending'),this['_aiChatUi']['scrollFeedToSuggestion'](_0x141ee0,_0x413ed7),this['_aiChatUi']['setFeedItemAIReplySuggestionPartActive']({'id':_0x141ee0,'index':_0x413ed7,'isActive':!0x0});}['_getPresentableSiblingContentPartIndex'](_0x3db801,_0x136f54,_0x4884cd){const {reply:_0x36bf90}=this['getInteractionAndReplyById'](_0x3db801),_0x444da5=_0x36bf90['getContentParts']({'showDiff':this['_aiChatBalloonShowDiff']});if(0x1==_0x444da5['length'])return null;const _0xd5180b=_0x444da5['findIndex'](_0x5233bb=>_0x5233bb['index']==_0x136f54),_0x1d20bd='next'==_0x4884cd?0x1:-0x1;let _0x23c62d=_0x444da5['at']((_0xd5180b+_0x1d20bd)%_0x444da5['length'])['index'],_0xede9c2=_0x444da5[_0x23c62d];for(;!this['_getUserPresentableContentPartDocumentRange'](_0x3db801,_0x36bf90,_0xede9c2);){if(_0x23c62d=_0x444da5['at']((_0x23c62d+_0x1d20bd)%_0x444da5['length'])['index'],_0x23c62d===_0xd5180b)return null;_0xede9c2=_0x444da5[_0x23c62d];}return _0x23c62d;}['_getUserPresentableContentPartDocumentRange'](_0x4454ab,_0x14e373,_0x460ab8){const _0x481958=_0x14e373['changeGroups'];if(!_0x460ab8['hasChanges'])return null;const _0x223f8b=_0x481958['find'](_0x51e921=>_0x51e921['index']==_0x460ab8['index']);if('pending'!==_0x223f8b?.['state'])return null;const _0x2117b8=this['_getDocumentRangeForReplyChanges'](_0x4454ab,_0x460ab8['index']);if(!_0x2117b8)return null;const {range:_0x52f320,currentIndex:_0x407a03}=_0x2117b8;return'$graveyard'==_0x52f320['root']['rootName']?(_0x14e373['setChangeGroupState'](_0x407a03,'outdated'),null):_0x2117b8['range'];}['_getDocumentRangeForReplyChanges'](_0x3210f2,_0x4b5791){const _0x5472ed=Xs(this['context']),{reply:_0x263a63,interaction:_0x893eb1}=this['getInteractionAndReplyById'](_0x3210f2),_0x2f2255=_0x263a63['changeGroups']['filter'](_0x6c66d7=>'pending'==_0x6c66d7['state']),_0x2d8555=_0x2f2255['map'](_0x375fe4=>_0x263a63['changeGroups']['indexOf'](_0x375fe4));void 0x0===_0x4b5791&&(_0x4b5791=_0x2d8555[0x0]);const _0x3d43a0=_0x2d8555['indexOf'](_0x4b5791);if(-0x1==_0x3d43a0)return null;const _0x4e3565=_0x2f2255[_0x3d43a0],_0x4a5e9c=new _0x2a3183([]),_0x31026e=new _0x2a3183([]);for(const _0x119d75 of _0x4e3565['changes'])if('removed'!=_0x119d75['type']&&_0x31026e['children']['push'](_0x119d75['node']['cloneNode'](!0x0)),'new'!=_0x119d75['type']){const _0x2306dc=_0x5b37e1(_0x43028d=>ms(_0x43028d,'data-id')==_0x119d75['id'],_0x263a63['documentContextContent'],!0x0);_0x4a5e9c['children']['push'](_0x2306dc['cloneNode'](!0x0));}if(0x0==_0x4a5e9c['children']['length']){if(_0x4e3565['changes'][0x0]['anchorId']){const _0x1e457e=ps('data-id',_0x4e3565['changes'][0x0]['anchorId'],_0x263a63['documentContextContent']);_0x4a5e9c['children']['unshift'](_0x1e457e['cloneNode'](!0x0)),_0x31026e['children']['unshift'](_0x1e457e['cloneNode'](!0x0)),_0x1e457e['nextSibling']&&(_0x4a5e9c['children']['push'](_0x1e457e['nextSibling']['cloneNode'](!0x0)),_0x31026e['children']['push'](_0x1e457e['nextSibling']['cloneNode'](!0x0)));}else{const _0x34803b=_0x263a63['documentContextContent']['children'][0x0];if(!_0x34803b)return null;_0x4a5e9c['children']['push'](_0x34803b['cloneNode'](!0x0)),_0x31026e['children']['push'](_0x34803b['cloneNode'](!0x0));}}const _0x277584=_0x893eb1['getDocumentContext'](),_0x2133fe=_0x5472ed['data']['parse'](_0x277584['content']),_0x933915=Es(_0x4a5e9c),_0x2630ad=_0x5472ed['data']['parse'](_0x933915),_0x8c1afd=_0x5472ed['data']['parse'](_0x933915),_0x592bf0=_0x5472ed['model']['createPositionAt'](_0x2630ad,0x0),_0x53bc16=Es(_0x31026e),_0x598bfe={'anchor':_0x592bf0,'markDeletions':!0x1},_0x373a9c=_0x5472ed['plugins']['get'](_0x43d889)['getDiff'](_0x933915,_0x53bc16,_0x598bfe)['getOperations']();if(!_0x373a9c['length'])return null;_0x5472ed['model']['change'](_0x457d76=>{for(const _0x2cedc2 of _0x373a9c)if('remove'==_0x2cedc2['type']){const _0x334c91=_0x2cedc2['sourcePosition'],_0x1670f5=_0x2cedc2['howMany'],_0x708c4e=new _0xa8a483(_0x334c91,_0x1670f5);_0x457d76['batch']['addOperation'](_0x708c4e),_0x5472ed['model']['applyOperation'](_0x708c4e);}else'marker'!==_0x2cedc2['type']&&(_0x2cedc2['baseVersion']=null,_0x2cedc2['isDocumentOperation']=!0x1,_0x457d76['batch']['addOperation'](_0x2cedc2),_0x5472ed['model']['applyOperation'](_0x2cedc2));});const _0xe81756=ys(_0x5472ed,_0x373a9c,_0x2630ad);xs(_0x5472ed['model'],_0xe81756);const _0x4fb868=_0xe81756['getFirstRange']()['start']['path']['slice'](),_0x447131=_0xe81756['getFirstRange']()['end']['path']['slice'](),_0x4c8048=[];let _0x150851=_0x2630ad,_0x5a5b7a=_0x8c1afd;for(let _0x5a1d78=0x0;_0x5a1d78<_0x447131['length'];_0x5a1d78++){const _0x4a5cfe=_0x150851['maxOffset']-_0x447131[_0x5a1d78];_0x4c8048[_0x5a1d78]=_0x5a5b7a['maxOffset']-_0x4a5cfe,_0x150851=_0x150851['getChildAtOffset'](_0x447131[_0x5a1d78]),_0x5a5b7a=_0x5a5b7a['getChildAtOffset'](_0x4c8048[_0x5a1d78]);}const _0x4227d4=_0x5472ed['model']['createRange'](_0x5472ed['model']['createPositionFromPath'](_0x8c1afd,_0x4fb868),_0x5472ed['model']['createPositionFromPath'](_0x8c1afd,_0x4c8048)),_0xff0c5=_0x8c1afd['getChild'](0x0)['getAttribute'](_0x5ebb0a),_0x83af0a=Array['from'](_0x2133fe['getChildren']())['find'](_0x246df9=>_0x246df9['getAttribute'](_0x5ebb0a)==_0xff0c5)['getPath'](),_0x26c56f=_0x4227d4['start']['path']['slice'](),_0x2d0e7d=_0x4227d4['end']['path']['slice']();_0x26c56f[0x0]=_0x83af0a[0x0]+_0x26c56f[0x0],_0x2d0e7d[0x0]=_0x83af0a[0x0]+_0x2d0e7d[0x0];let _0x264787=_0x5472ed['model']['createRange'](_0x5472ed['model']['createPositionFromPath'](_0x5472ed['model']['document']['getRoot'](),_0x26c56f),_0x5472ed['model']['createPositionFromPath'](_0x5472ed['model']['document']['getRoot'](),_0x2d0e7d));const _0x3882b9=_0x5472ed['model']['document']['history']['getOperations'](_0x277584['version']);for(const _0x1f67a2 of _0x3882b9)_0x264787=_0x519c43['_createFromRanges'](_0x264787['getTransformedByOperation'](_0x1f67a2));return{'range':_0x264787,'currentIndex':_0x4b5791};}['_integrateEditor'](_0x36868a){if(_0x36868a['plugins']['has']('Undo')){const _0x176e03=_0x36868a['commands']['get']('undo'),_0x158ef5=_0x36868a['commands']['get']('redo');this['listenTo'](_0x176e03,'revert',(_0x3118b8,_0x464ea7,_0x6907b4)=>{const _0x5022f9=this['_batchToChanges']['get'](_0x464ea7);if(!_0x5022f9)return;const _0x226bf9=this['activeConversation']['getInteraction'](_0x5022f9['interactionId'])['getReply'](_0x5022f9['replyId']);_0x5022f9['indexes']['forEach'](_0x5e9366=>_0x226bf9['setChangeGroupState'](_0x5e9366,'pending')),this['_batchToChanges']['delete'](_0x464ea7),this['_batchToChanges']['set'](_0x6907b4,_0x5022f9);}),this['listenTo'](_0x158ef5,'revert',(_0x627677,_0x415f9a,_0x4102bc)=>{const _0x3143f7=this['_batchToChanges']['get'](_0x415f9a);if(!_0x3143f7)return;const _0x1e2fde=this['activeConversation']['getInteraction'](_0x3143f7['interactionId'])['getReply'](_0x3143f7['replyId']);_0x3143f7['indexes']['forEach'](_0x541bcd=>_0x1e2fde['setChangeGroupState'](_0x541bcd,'accepted')),this['_batchToChanges']['delete'](_0x415f9a),this['_batchToChanges']['set'](_0x4102bc,_0x3143f7);});}const _0x3dd402=_0x36868a['config']['get']('ai.chat.context');_0x3dd402['alwaysAddSelection']&&_0x3dd402['document']['enabled']&&this['listenTo'](_0x36868a['model']['document']['selection'],'change:range',(_0x3631c2,_0x229c6b)=>{if(!_0x229c6b['directChange'])return;'chat'===_0x36868a['plugins']['get']('AITabs')['view']['activeTab']&&(_0x36868a['model']['hasContent'](_0x36868a['model']['document']['selection'])?this['addSelectionToChatContext']():this['removeSelectionFromChatContext']());});}async['_getLastCreatedConversationId'](){const _0xc27dd9=this['_aiConnector']['fetchConversations'](this['getGroupId'](),{'limit':0x1,'sortBy':'createdAt'});try{const _0x3a5110=await _0xc27dd9['getConversations']();return _0x3a5110['length']?_0x3a5110[0x0]['id']:'new';}catch(_0x562fbf){return this['_aiChatUi']['addFeedItemError']({'errorMessage':us(this['context']['locale'],'AI_CHAT_UNABLE_TO_LOAD_CONVERSATION'),'id':ot()}),this['_logError'](new ht('ai-chat-conversation-init-failed',this,{'error':_0x562fbf})),this['_aiChatUi']['toggleLoadingSkeleton'](!0x1),this['_aiChatUi']['disableControls'](),null;}}async['_startConversationSafely'](_0xa09a3c){try{this['_aiChatUi']['enableControls'](),await this['_handleStartConversation'](_0xa09a3c);}catch(_0x103172){this['_aiChatUi']['addFeedItemError']({'errorMessage':us(this['context']['locale'],'AI_CHAT_UNABLE_TO_START_CONVERSATION'),'id':_0xa09a3c||ot()}),console['error'](_0x103172),this['activeConversation']=void 0x0,this['_aiChatUi']['disableControls']();}}async['_handleStartConversation'](_0x53a47a){let _0x2b17af;this['context']['plugins']['has']('AIChatBalloon')&&this['context']['plugins']['get']('AIChatBalloon')['close'](),_0x53a47a||!this['activeConversation']?_0x2b17af=this['context']['config']['get']('ai.models.defaultModelId'):this['_aiChatUi']['isModelAvailable']&&(_0x2b17af=this['activeConversation']['selectedModel']['id']),await this['_stopLastInteraction']();const _0x436f3d=this['getGroupId'](),_0x5b2b76=_0x53a47a||ot();this['activeConversation']=new $s({'connector':this['_aiConnector'],'chatModels':this['_aiChatModels'],'selectedModelId':_0x2b17af,'conversationId':_0x5b2b76,'group':_0x436f3d,'getEditor':()=>Xs(this['context']),'isFromHistory':!!_0x53a47a}),this['activeConversation']['delegate']('toolDataReceived','interactionStarted')['to'](this),this['activeConversation']['delegate']('toolDataReceived','interactionCreated','replyCreated')['to'](this),this['on']('interactionCreated',(_0xe50535,_0x5a7c40)=>{this['_aiChatUi']['addFeedItemUserMessage'](_0x5a7c40);}),this['on']('replyCreated',(_0x12fe03,_0x58d7e1)=>{this['_addFeedItemReply'](_0x58d7e1);}),this['activeConversation']['on']('conversationInitialized',(_0x65fdb3,_0x343fa0)=>{this['_aiChatUi']['createConversation'](_0x343fa0),this['_aiChatUi']['resetMessageInput'](),this['_aiChatUi']['clearPendingContextUI'](),this['_aiChatUi']['clearConversationContextUI'](),_0x53a47a||(this['_aiChatUi']['resetConversationTitle'](),this['addCurrentDocumentToChatContext']());}),this['activeConversation']['on']('uploadProgressChanged',(_0x467f18,_0x2b30b4)=>{this['_aiChatUi']['setIsUploadInProgress'](_0x2b30b4['isUploadInProgress']);}),this['activeConversation']['on']('webSearchStarted',()=>{const _0x254f76=this['_aiChatUi']['prepareLoadingMessage']({'isWebSearchEnabled':!0x0,'isReasoningEnabled':!0x1});this['_aiChatUi']['setLoadingMessage'](_0x254f76);}),this['activeConversation']['on']('reasoningStarted',()=>{const _0xb4c8c=this['_aiChatUi']['prepareLoadingMessage']({'isWebSearchEnabled':!0x1,'isReasoningEnabled':!0x0});this['_aiChatUi']['setLoadingMessage'](_0xb4c8c);}),this['activeConversation']['on']('webSearchFinished',(_0x1dd79e,_0xaf35c9)=>{this['_aiChatUi']['addFeedInteractionHeader'](_0xaf35c9,{'isWebSearchEnabled':!0x0,'isReasoningEnabled':!0x1});}),this['activeConversation']['on']('reasoningFinished',(_0x596dfe,_0x246856)=>{this['_aiChatUi']['addFeedInteractionHeader'](_0x246856,{'isWebSearchEnabled':!0x1,'isReasoningEnabled':!0x0});}),this['activeConversation']['on']('interactionStarted',()=>{this['_aiChatUi']['startInteraction']();}),this['activeConversation']['on']('interactionFinished',async()=>{await this['_aiChatUi']['finishInteraction']();}),this['activeConversation']['on']('interactionDestroyed',(_0x14dbd5,_0x39f055)=>{this['_aiChatUi']['removeFeedInteraction'](_0x39f055['id']);}),this['activeConversation']['on']('setConversationTitle',(_0x4b3ce7,_0xa210f1,_0x4965b1)=>{this['_updateConversationTitle'](_0xa210f1,_0x4965b1);}),this['activeConversation']['on']('replyContentUpdated',async(_0x22df12,_0x18ce91)=>{await this['_updateReplyContent']({'reply':_0x18ce91});}),this['activeConversation']['on']('replyChangeGroupStateUpdated',(_0x1087df,{reply:_0x46e6b0,index:_0x5d68a8,state:_0xcaad1b})=>{this['_aiChatUi']['updateFeedItemAIReplySuggestionPartState']({'id':_0x46e6b0['id'],'index':_0x5d68a8,'state':_0xcaad1b}),this['_currentPreviewedChangeGroup']?.['replyId']['includes'](_0x46e6b0['id'])&&this['_currentPreviewedChangeGroup']?.['partIndex']==_0x5d68a8&&this['_aiChatBalloon']?.['setState'](_0xcaad1b);}),this['activeConversation']['on']('contextItemAdded',(_0x5a16d0,_0x5187f2)=>{if(this['_aiChatUi']['addContextItem'](_0x5187f2['contextItem'],_0x5187f2['isLoading']),'selection'===_0x5187f2['contextItem']['type']){const _0x14c1eb=[...Xs(this['context'])['model']['document']['selection']['getRanges']()];this['_aiEditing']['showFakeVisualSelection']({'ranges':_0x14c1eb,'id':'context','priority':0x1});}}),this['activeConversation']['on']('contextItemRemoved',(_0x1dc155,_0x1331d7)=>{this['_aiChatUi']['removeContextItem'](_0x1331d7['uiId']),'current-document'==_0x1331d7['uiId']&&this['removeSelectionFromChatContext'](),'selection'===_0x1331d7['type']&&this['_aiEditing']['hideFakeVisualSelection']('context');}),this['activeConversation']['on']('contextItemLoadingEnded',(_0xc770f8,_0x2ba587)=>{this['_aiChatUi']['setContextItemLoading'](_0x2ba587['contextItem']['uiId'],_0x2ba587['isLoading']);}),this['activeConversation']['on']('contextSent',(_0x17e9e9,_0x391392)=>{this['_aiChatUi']['setConversationContext'](_0x391392['contextItems']);}),this['activeConversation']['on']('addContextOptionsChanged',(_0x3dbc7c,_0x5414d0)=>{this['_aiChatUi']['setAddContextOptions'](_0x5414d0['options']);}),this['activeConversation']['on']('sourceResourcesLoaded',(_0x261779,_0x2431ae)=>{this['_aiChatUi']['populateSourceResourceBalloon'](_0x2431ae['sourceId'],_0x2431ae['source'],_0x2431ae['resources'],_0x2431ae['uid']);}),this['activeConversation']['on']('resourceStateChanged',(_0x595b45,_0xa25696)=>{this['_aiChatUi']['updateResourceState'](_0xa25696['sourceId'],_0xa25696['resourceId'],_0xa25696['isInContext']);}),this['activeConversation']['on']('capabilitiesUpdated',(_0x528a48,_0x31edc9)=>{this['_aiChatUi']['updateCapabilities'](_0x31edc9);}),this['activeConversation']['on']('modelSelected',async(_0x3e0b66,_0x1b73cd)=>{const _0x3f4a1f=(await this['_aiChatModels']['getAll']())['find'](_0x54e907=>_0x54e907['id']===_0x1b73cd['selectedModel']?.['id'])||null;this['_aiChatUi']['setSelectedModel'](_0x3f4a1f,_0x1b73cd['isDisabled']);}),this['activeConversation']['on']('error',(_0x39a65f,{error:_0x126cac,interactionId:_0x281fd1,fileName:_0x26eb9f,url:_0x58145c,sourceId:_0x7a7591,sourceLabel:_0x35ad65})=>{const _0x4bb13b=_0x281fd1?_0x281fd1+':'+ot():ot();_0x126cac['message']['startsWith']('ai-request-aborted')?this['_aiChatUi']['addFeedItemStaticMessage']({'staticMessage':us(this['context']['locale'],'AI_CHAT_ABORTED_MESSAGE'),'id':_0x4bb13b}):_0x126cac['message']['startsWith']('ai-chat-conversation-init-failed')||_0x126cac['message']['startsWith']('ai-chat-conversation-start-failed')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':us(this['context']['locale'],'AI_CHAT_UNABLE_TO_START_CONVERSATION'),'id':_0x4bb13b}),this['_logError'](_0x126cac)):_0x126cac['message']['startsWith']('ai-chat-file-upload-failed')?this['_aiChatUi']['addFeedItemError']({'errorMessage':us(this['context']['locale'],'AI_CHAT_CONTEXT_UNABLE_TO_UPLOAD_FILE',_0x26eb9f),'id':_0x4bb13b}):_0x126cac['message']['startsWith']('ai-chat-url-upload-failed')?this['_aiChatUi']['addFeedItemError']({'errorMessage':us(this['context']['locale'],'AI_CHAT_CONTEXT_UNABLE_TO_UPLOAD_URL',_0x58145c),'id':_0x4bb13b}):_0x126cac['message']['startsWith']('ai-chat-context-invalid-data')?this['_aiChatUi']['addFeedItemError']({'errorMessage':us(this['context']['locale'],'AI_CHAT_CONTEXT_INVALID_DATA'),'id':_0x4bb13b}):_0x126cac['message']['startsWith']('ai-chat-context-unsupported-type')?this['_aiChatUi']['addFeedItemError']({'errorMessage':us(this['context']['locale'],'AI_CHAT_CONTEXT_UNSUPPORTED_TYPE'),'id':_0x4bb13b}):_0x126cac['message']['startsWith']('ai-chat-source-resources-load-failed')?(_0x7a7591&&this['_aiChatUi']['closeSourceResourceBalloon'](_0x7a7591),this['_aiChatUi']['addFeedItemError']({'errorMessage':us(this['context']['locale'],'AI_CHAT_CONTEXT_UNABLE_TO_LOAD_RESOURCES',_0x35ad65||'source'),'id':_0x4bb13b}),this['_logError'](_0x126cac)):_0x126cac['message']['startsWith']('ai-chat-resource-load-failed')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':us(this['context']['locale'],'AI_CHAT_RESOURCE_LOAD_FAILED'),'id':_0x4bb13b}),this['_logError'](_0x126cac)):_0x126cac['message']['startsWith']('ai-chat-invalid-request')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':us(this['context']['locale'],'AI_CHAT_INVALID_REQUEST'),'id':_0x4bb13b}),this['_logError'](_0x126cac)):_0x126cac['message']['startsWith']('ai-chat-context-unsupported-file-type')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':us(this['context']['locale'],'AI_CHAT_CONTEXT_UNSUPPORTED_FILE_TYPE'),'id':_0x4bb13b}),this['_logError'](_0x126cac)):_0x126cac['message']['startsWith']('ai-chat-context-file-too-large')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':us(this['context']['locale'],'AI_CHAT_CONTEXT_FILE_TOO_LARGE'),'id':_0x4bb13b}),this['_logError'](_0x126cac)):_0x126cac['message']['startsWith']('ai-chat-context-file-too-many-pages')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':us(this['context']['locale'],'AI_CHAT_CONTEXT_FILE_TOO_MANY_PAGES'),'id':_0x4bb13b}),this['_logError'](_0x126cac)):_0x126cac['message']['startsWith']('ai-chat-context-form-data-size-limits-exceeded')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':us(this['context']['locale'],'AI_CHAT_CONTEXT_FORM_DATA_SIZE_LIMITS_EXCEEDED'),'id':_0x4bb13b}),this['_logError'](_0x126cac)):(this['_aiChatUi']['addFeedItemError']({'errorMessage':us(this['context']['locale'],'AI_CHAT_GENERIC_ERROR'),'id':_0x4bb13b}),this['_logError'](_0x126cac));}),await this['activeConversation']['init'](this['context']['config']['get']('ai.chat.context')),_0x53a47a||await this['activeConversation']['start']();}async['_handleUIUserMessage']({message:_0x5da6c9,attributes:_0x40916a}){if(!this['activeConversation'])throw new ht('ai-chat-controller-no-active-conversation');if(this['activeConversation']['isCurrentDocumentInContext']()){const _0x1b1e64=await this['_aiEditing']['getDocumentData']();await this['activeConversation']['updateCurrentDocumentInContext'](_0x1b1e64);}this['activeConversation']['id']&&this['activeConversation']['isStarted']&&await this['activeConversation']['handleUserInteraction']({'userMessage':_0x5da6c9,'attributes':_0x40916a});}['_setIsMaximized'](_0x2f6ef9){this['_aiChatUi']['setIsMaximized'](_0x2f6ef9);}['_logError'](_0x2b8816){mt(_0x2b8816['message']);}['_removeFromContext'](_0xa4377){this['activeConversation']?.['removeFromContext'](_0xa4377);}['_toggleWebSearch'](){this['activeConversation']?.['toggleWebSearch']();}['_toggleReasoning'](){this['activeConversation']?.['toggleReasoning']();}['getInteractionAndReplyById'](_0x565abe){const [_0x117fc2,_0x23557a]=_0x565abe['split'](':'),_0xc7fdf5=this['activeConversation']['getInteraction'](_0x117fc2),_0x530b6c=_0xc7fdf5['getReply'](_0x23557a);return{'interaction':_0xc7fdf5,'reply':_0x530b6c};}['_scrollToSuggestionRange'](_0x305446,_0x2085f7=!0x1){const _0x4382a3=Xs(this['context']),_0x1d3fd4={'target':_0x4382a3['editing']['view']['domConverter']['viewRangeToDom'](_0x4382a3['editing']['mapper']['toViewRange'](_0x305446)),'viewportOffset':{'top':0x96,'left':0x0,'bottom':0x32,'right':0x0},'ancestorOffset':0x14,'alignToTop':_0x2085f7};_0x2085f7&&(_0x1d3fd4['alignToTop']=!0x0),Ct(_0x1d3fd4);}['_updateConversationTitle'](_0x2640c9,_0x2fe4e0=!0x1){this['_aiChatUi']['setConversationTitle'](_0x2640c9||us(this['context']['locale'],'AI_CHAT_UNTITLED_CONVERSATION'),_0x2fe4e0);}['_addFeedItemReply'](_0x4d3019){'text'===_0x4d3019['type']?this['_aiChatUi']['addFeedItemAIReply'](_0x4d3019):this['_aiChatUi']['addFeedItemAISuggestion'](_0x4d3019);}async['_updateReplyContent']({reply:_0x285449,renderingStrategy:_0x3e6574}){const {id:_0x5f515b,interactionId:_0x41df2d,isDone:_0x26843a,type:_0x1563d0,parsedContent:_0x189ebe}=_0x285449,_0x17012c=_0x41df2d+':'+_0x5f515b;if('modification'===_0x1563d0){const _0x1d659e=_0x285449['getContentParts']({'showDiff':this['_aiChatUi']['showDiff']});await this['_aiChatUi']['updateFeedItemAIReplySuggestionContent']({'id':_0x17012c,'parts':_0x1d659e,'renderingStrategy':_0x3e6574,'isDone':_0x26843a});}else'text'===_0x1563d0&&await this['_aiChatUi']['updateFeedItemAIReplyContent']({'id':_0x17012c,'parsedContent':_0x189ebe,'renderingStrategy':_0x3e6574,'isDone':_0x26843a});_0x26843a&&_0x285449['sources']['length']>0x0&&this['_aiChatUi']['updateFeedItemAIReplySources'](_0x17012c,_0x285449['sources']);}async['_stopLastInteraction'](){const _0x58965f=this['activeConversation']?.['lastInteraction'];_0x58965f&&(_0x58965f['stop'](),this['_aiChatUi']['stopInteraction'](_0x58965f));}async['_flushLastInteractionUI'](){const _0x2e30b8=this['activeConversation']?.['lastInteraction'];if(_0x2e30b8){for await(const _0x360153 of _0x2e30b8['replies'])this['_aiChatUi']['hasFeedItem'](_0x360153['id'])||this['_addFeedItemReply'](_0x360153),await this['_updateReplyContent']({'reply':_0x360153,'renderingStrategy':'static'});}}['_updateRatings'](_0x361098){const _0x4da8da={'positiveCount':_0x361098['changeGroups']['filter'](_0x2adcc0=>'accepted'===_0x2adcc0['state'])['length'],'totalCount':_0x361098['changeGroups']['length'],'modificationId':_0x361098['id']},_0x11e4c5=this['activeConversation']['getInteraction'](_0x361098['interactionId'])['messageId'];_0x11e4c5&&this['_aiConnector']['upsertAIChatRating'](this['activeConversation']['id'],_0x11e4c5,_0x4da8da);}['_getAIChatFeedAPI'](_0x2589a9){const _0x1269da=this['_aiChatUi'],_0x2e500b=()=>{_0x2589a9['resetWebSearchState'](),_0x2589a9['resetReasoningState'](),_0x1269da['clearLoadingMessage']();},_0x3ddfc0=()=>{_0x2589a9['currentReply']&&(_0x2589a9['currentReply']['done'](),_0x2589a9['currentReply']=void 0x0);};return{'insertTextReply':(_0x23b6a4,_0x36dd44)=>{_0x3ddfc0(),_0x2e500b();const _0xcd44e1=_0x2589a9['currentReply']=_0x2589a9['createReply']({'type':'text','interactionId':_0x2589a9['id'],'content':_0x23b6a4,'id':_0x36dd44||ot()});return _0x3ddfc0(),_0xcd44e1;},'insertCustomElement':async(_0xee09a7,_0x1eab15)=>(_0x3ddfc0(),_0x2e500b(),_0x1269da['addFeedItemCustomElement'](_0xee09a7,_0x1eab15||ot())),'setLoadingMessage':_0x25e408=>{_0x1269da['setLoadingMessage'](_0x25e408);},'clearLoadingMessage':()=>{_0x1269da['clearLoadingMessage']();}};}}const Zs='ai-selection';class tn extends _0x3397b8{constructor(_0x5453a3){super(_0x5453a3),this['context']['config']['define']('ai.models.showModelSelector',!0x0);}['_outputDataProcessor'];['_fakeSelections']=[];['_sessionId'];static get['pluginName'](){return'AIEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}get['sessionId'](){if(!this['_sessionId']){const _0x319b7b=Xs(this['context']),_0x5e4180=_0x319b7b['plugins']['has']('RealTimeCollaborationClient')&&_0x319b7b['plugins']['get']('RealTimeCollaborationClient')['sessionId'];this['_sessionId']=_0x5e4180||ot();}return this['_sessionId'];}async['getDocumentData'](){const _0x4726d9=Xs(this['context']),_0x52c52c=_0x4726d9['model'],_0x43754b=_0x4726d9['data']['toView'](_0x52c52c['document']['getRoot'](),{'convertAiChatSelectionMarker':!0x0}),_0x2296a4=new _0x5448c0(_0x4726d9['editing']['view']['document']);this['_setDataIdsOnChildren'](_0x43754b,_0x2296a4);let _0x36f284=await this['_getDocumentDataStringFromView'](_0x43754b);const _0x51f9d7=this['_getMarkersInDocumentOrder'](),_0x2d75d3=[];for(const _0x3aeea5 of _0x51f9d7){const _0x2d3aeb='<'+_0x3aeea5['name']+':start></'+_0x3aeea5['name']+':start>',_0x5f22f3=_0x36f284['indexOf'](_0x2d3aeb);_0x36f284=_0x36f284['substring'](0x0,_0x5f22f3)+_0x36f284['substring'](_0x5f22f3+_0x2d3aeb['length']);const _0x357582='<'+_0x3aeea5['name']+':end></'+_0x3aeea5['name']+':end>',_0x1a069d=_0x36f284['indexOf'](_0x357582);_0x36f284=_0x36f284['substring'](0x0,_0x1a069d)+_0x36f284['substring'](_0x1a069d+_0x357582['length']),_0x2d75d3['push']({'markerName':_0x3aeea5['name'],'start':_0x5f22f3,'end':_0x1a069d,'htmlFragment':_0x36f284['substring'](_0x5f22f3,_0x1a069d)});}return{'content':_0x36f284,'version':_0x4726d9['model']['document']['version'],'sessionId':this['sessionId'],'selections':_0x2d75d3};}async['afterInit'](){this['context']instanceof _0x562c83?this['_integrateEditor'](this['context']):this['listenTo'](this['context']['editors'],'add',(_0x572d7b,_0x1c2f79)=>{_0x1c2f79['on']('ready',()=>{this['_integrateEditor'](_0x1c2f79);});});}['_setOutputDataProcessor'](_0x248d24){this['_outputDataProcessor']=_0x248d24;}async['_getDocumentDataStringFromView'](_0x1c7a6e){let _0x5cafa3;const _0x29c3a5=Xs(this['context']);if(this['_outputDataProcessor']){const _0x5534cc=_0x29c3a5['data']['processor']['domConverter']['viewToDom'](_0x1c7a6e),_0x28f897=await this['_outputDataProcessor'](_0x5534cc);_0x5cafa3=_0x29c3a5['data']['processor']['htmlWriter']['getHtml'](_0x28f897);}else _0x5cafa3=_0x29c3a5['data']['processor']['toData'](_0x1c7a6e);return _0x5cafa3;}['_integrateEditor'](_0x4bab61){_0x4bab61['conversion']['for']('editingDowncast')['markerToHighlight']({'model':Zs,'view':({markerName:_0x527a14})=>({'classes':['ck-ai-assistant-ui_theme','ck-fake-ai-selection','ck-fake-ai-selection-'+_0x527a14['split'](':')[0x1]],'priority':0xc})}),_0x4bab61['conversion']['for']('dataDowncast')['markerToElement']({'model':Zs,'view':(_0x51af07,{writer:_0x35448c,options:_0x33616b})=>_0x33616b['convertAiChatSelectionMarker']?_0x35448c['createUIElement'](_0x51af07['markerName']+':'+(_0x51af07['isOpening']?'start':'end')):null});}['showFakeVisualSelection'](_0x5703d5){const _0xf7519f=this['_fakeSelections'][0x0]||null;this['_addFakeSelection'](_0x5703d5);const _0x2f1468=this['_fakeSelections'][0x0]||null;this['_refreshFakeSelection'](_0xf7519f,_0x2f1468);}['hideFakeVisualSelection'](_0x2ad318){const _0x33558a=this['_fakeSelections'][0x0]||null;this['_removeFakeSelectionById'](_0x2ad318);const _0x790082=this['_fakeSelections'][0x0]||null;this['_refreshFakeSelection'](_0x33558a,_0x790082);}async['modelToDataWithIds'](_0x48b825){const _0x140e54=Xs(this['context']),_0x556759=_0x140e54['data']['toView'](_0x48b825),_0x34cfea=new _0x5448c0(_0x140e54['editing']['view']['document']);return this['_setDataIdsOnChildren'](_0x556759,_0x34cfea),this['_getDocumentDataStringFromView'](_0x556759);}['_setDataIdsOnChildren'](_0x4cba96,_0x2355a3){let _0x4fbd83=!0x1;const _0x471a4a=new Set();for(const _0x15a6b6 of _0x4cba96['getChildren']()){if(!_0x15a6b6['is']('view:element'))continue;const _0x347ce6=_0x15a6b6['is']('view:containerElement'),_0x14bb41=_0x15a6b6['is']('view:emptyElement'),_0x3553da=this['_setDataIdsOnChildren'](_0x15a6b6,_0x2355a3);if(_0x15a6b6['hasAttribute']('data-id')){_0x4fbd83=!0x0,_0x471a4a['add'](_0x15a6b6['getAttribute']('data-id'));continue;}(_0x347ce6||_0x14bb41||_0x3553da)&&(_0x2355a3['setAttribute']('data-id',this['_nextDataId'](_0x471a4a),_0x15a6b6),_0x4fbd83=!0x0);}return _0x4fbd83;}['_nextDataId'](_0x35e688){let _0x4bb830;do{_0x4bb830='';for(let _0x13f5f2=0x0;_0x13f5f2<0x4;_0x13f5f2++)_0x4bb830+=String['fromCharCode'](0x61+Math['floor'](0x1a*Math['random']()));}while(_0x35e688['has'](_0x4bb830));return _0x35e688['add'](_0x4bb830),_0x4bb830;}['getSelectionText'](){const {model:_0x4bc8db}=Xs(this['context']),_0x1b530e=_0x4bc8db['document']['selection'],_0x1defd0=[],_0x594317=Array['from'](_0x1b530e['getRanges']());_0x594317['sort']((_0x3f73b1,_0x5e4bea)=>_0x3f73b1['start']['isBefore'](_0x5e4bea['start'])?-0x1:0x1);for(const _0x3b663e of _0x594317)for(const _0x230ee1 of _0x3b663e['getItems']())_0x230ee1['is']('$textProxy')?_0x1defd0['push'](_0x230ee1['data']):_0x230ee1['is']('element')&&_0x1defd0['length']>0x0&&'\x20'!==_0x1defd0[_0x1defd0['length']-0x1]&&_0x1defd0['push']('\x20');return _0x1defd0['length']?'\x22'+_0x1defd0['join']('')['trim']()+'\x22':us(this['context']['locale'],'AI_CHAT_CONTEXT_DOCUMENT_SELECTION_LABEL');}['_removeFakeSelectionById'](_0x1ae59b){for(let _0x3ccf13=0x0;_0x3ccf13<this['_fakeSelections']['length'];_0x3ccf13++)if(this['_fakeSelections'][_0x3ccf13]['id']==_0x1ae59b)return void this['_fakeSelections']['splice'](_0x3ccf13,0x1);}['_addFakeSelection'](_0x57c14e){this['_removeFakeSelectionById'](_0x57c14e['id']),wt(this['_fakeSelections'],_0x57c14e);}['_refreshFakeSelection'](_0x29225a,_0x21f064){if(_0x29225a==_0x21f064)return;const _0x392b09=Xs(this['context']),_0x427a8a=_0x392b09['model'];_0x427a8a['change'](_0x33e883=>{if(_0x29225a){const _0x370922=_0x392b09['model']['markers']['getMarkersGroup'](Zs);for(const _0x4cdbee of _0x370922)_0x33e883['removeMarker'](_0x4cdbee);}if(_0x21f064)for(let _0x540968=0x0;_0x540968<_0x21f064['ranges']['length'];_0x540968++){let _0x48c83f=_0x21f064['ranges'][_0x540968];const _0x6abdaa=Zs+':'+_0x21f064['id']+':'+_0x540968;if(_0x48c83f['start']['isAtEnd']){const _0x8f936a=_0x48c83f['start']['getLastMatchingPosition'](({item:_0x45faa6})=>!_0x427a8a['schema']['isContent'](_0x45faa6),{'boundaries':_0x48c83f});_0x48c83f=_0x33e883['createRange'](_0x8f936a,_0x48c83f['end']);}_0x33e883['addMarker'](_0x6abdaa,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x48c83f});}});}['_getMarkersInDocumentOrder'](){const _0xa20d4a=Xs(this['context'])['model'];return Array['from'](_0xa20d4a['markers']['getMarkersGroup'](Zs))['sort']((_0xa75b13,_0x3053ee)=>_0xa75b13['getStart']()['isBefore'](_0x3053ee['getStart']())?-0x1:_0xa75b13['getStart']()['isAfter'](_0x3053ee['getStart']())?0x1:0x0);}}const en=['showChangeInText','insertSuggestion','applySuggestion','rejectSuggestion','mouseOverSuggestion','mouseLeaveSuggestion','toggleSuggestionDisplayMode','like','dislike'],sn=[...en,'startConversation','resizeTabs','sendUserMessage','abortPromptStream','addDocumentToContext','addFileToContext','addUrlToContext','executeCustomItemCallback','addResourceToContext','removeContextItem','loadSourceResources','toggleWebSearch','toggleReasoning','selectModel'];class nn{['options'];['isStreaming']=!0x1;['document']=null;['nodesList']=[];['currentIndex']=0x0;['timeoutAbortController']=null;['lastUpdateTime']=0x0;constructor(_0x425553){this['options']={'delay':_0x425553['delay']??0x14,'textNodeStyle':_0x425553['textNodeStyle'],'onStreamUpdate':_0x425553['onStreamUpdate']||(()=>{})};}async['stream']({document:_0x3658a5,targetElement:_0x640eed,abortSignal:_0x4c0ab4}){this['isStreaming']&&this['stop'](),_0x4c0ab4?.['addEventListener']('abort',this['stop']['bind'](this)),this['document']=_0x12387e(_0x3658a5,!0x0),this['nodesList']=this['getParsedDocumentNodeList'](),this['isStreaming']=!0x0,this['currentIndex']>this['nodesList']['length']&&(this['currentIndex']=this['nodesList']['length']);for(let _0x387cb0=0x0;_0x387cb0<this['currentIndex'];_0x387cb0++)this['nodesList'][_0x387cb0]['shouldBeStreamed']=!0x0;do{const _0x203d29=Date['now'](),_0x490b1f=this['nodesList'][this['currentIndex']],_0x4a6694=_0x203d29-this['lastUpdateTime'];if(_0x490b1f){_0x490b1f['shouldBeStreamed']=!0x0;let _0x3a3487=_0x490b1f['parent'];for(;_0x3a3487;)_0x3a3487['shouldBeStreamed']=!0x0,_0x3a3487=_0x3a3487['parent'];}if(_0x4a6694<this['options']['delay'])try{const {promise:_0x599586,abortController:_0x4488a0}=hn(this['options']['delay']-_0x4a6694);this['timeoutAbortController']=_0x4488a0,await _0x599586;}catch(_0x384667){return;}_0x103ded(_0x640eed,'<'+_0x640eed['tagName']+'>'+this['renderNode'](this['document'])+'</'+_0x640eed['tagName']+'>',{'childrenOnly':!0x0}),this['options']['onStreamUpdate']&&this['options']['onStreamUpdate'](),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:_0x527518}){Array['from'](_0x527518['querySelectorAll']('span[data-ck-html-streamer-word-chunk]'))['reverse']()['forEach'](_0x9d0483=>{_0x9d0483['replaceWith'](_0x9d0483['childNodes'][0x0]);});}['stop'](){this['isStreaming']=!0x1,this['timeoutAbortController']&&(this['timeoutAbortController']['abort'](),this['timeoutAbortController']=null);}['renderNode'](_0x2e7804){let _0x44a388='';if(function(_0x26a339){return _0x4aee55(_0x26a339);}(_0x2e7804)){for(const _0x3d5fbd of _0x2e7804['children'])_0x44a388+=this['renderNode'](_0x3d5fbd);}else{if(on(_0x2e7804)){if(!_0x2e7804['shouldBeStreamed'])return'';const _0x34c258=_0x2e7804,_0x5ea850=Object['entries'](_0x34c258['attribs'])['map'](([_0x4b472e,_0x12ee22])=>_0x4b472e+'=\x22'+_0x12ee22+'\x22')['join']('\x20');_0x44a388+='<'+_0x34c258['tagName']+(_0x5ea850?'\x20'+_0x5ea850:'')+'>';for(const _0x5ed726 of ti(_0x34c258))_0x44a388+=this['renderNode'](_0x5ed726);_0x44a388+='</'+_0x34c258['tagName']+'>';}else{if(!an(_0x2e7804))return'';if(!_0x2e7804['shouldBeStreamed'])return'';!function(_0x2107ad){if(!_0x2107ad['parent']||!on(_0x2107ad['parent']))return!0x1;if(!rn['includes'](_0x2107ad['parent']['tagName']))return!0x1;return!_0xe69844(_0x2107ad)['match'](/^\s*[<>]\s*$/);}(_0x2e7804)?_0x44a388+=_0x3dc878(_0x2e7804):_0x44a388+=_0x3dc878(new _0x3f0955('span',{'data-ck-html-streamer-word-chunk':'','style':this['options']['textNodeStyle']},[_0x2e7804]));}}return _0x44a388;}['getParsedDocumentNodeList'](){const _0x5de0d8=[];return function(_0x10b767,_0x37ff15){const _0x25e9d6=_0x1fbf85=>{if(_0x37ff15(_0x1fbf85),_0x1fbf85 instanceof _0x179458)for(let _0x475b9d=0x0;_0x475b9d<_0x1fbf85['children']['length'];_0x475b9d++){const _0x2230e9=_0x1fbf85['children'][_0x475b9d];_0x25e9d6(_0x2230e9);}};for(let _0x1233c2=0x0;_0x1233c2<_0x10b767['children']['length'];_0x1233c2++)_0x25e9d6(_0x10b767['children'][_0x1233c2]);}(this['document'],_0x1a70c2=>{if(an(_0x1a70c2)){const _0x26675b=this['splitTextNodeIntoWordNodes'](_0x1a70c2);_0x26675b['length']&&_0x5de0d8['push'](..._0x26675b);}_0x1a70c2['isWordSplitSource']||_0x1a70c2['isWordSplitResult']||_0x5de0d8['push'](_0x1a70c2);}),_0x5de0d8;}['splitTextNodeIntoWordNodes'](_0x3848a){if(_0x3848a['isWordSplitSource']||_0x3848a['isWordSplitResult'])return[];const _0x14ff7b=_0xe69844(_0x3848a)['match'](/(?:\s*\S+\s*)/g),_0xa16051=[];if(_0x14ff7b&&_0x14ff7b['length']>0x1){for(const _0x31ea31 of _0x14ff7b){const _0x700fc5=new _0x39bfd5(_0x31ea31);_0x700fc5['isWordSplitResult']=!0x0,_0xaa920a(_0x3848a,_0x700fc5),_0xa16051['push'](_0x700fc5);}_0x3848a['isWordSplitSource']=!0x0,_0x544b32(_0x3848a);}return _0xa16051;}}const rn=['p','li','td','th','span','h1','h2','h3','h4','h5','h6','b','strong','i','em','mark','del','ins','sup','sub','a','code','div'];function an(_0x2321c4){return _0x21b97c(_0x2321c4);}function on(_0x3cc8ea){return _0x204373(_0x3cc8ea);}function hn(_0x2aa867){const _0x3e4abd=new AbortController();return{'promise':new Promise((_0x45ba66,_0x2e1901)=>{const _0x4d54d7=setTimeout(_0x45ba66,_0x2aa867);_0x3e4abd['signal']['addEventListener']('abort',()=>{clearTimeout(_0x4d54d7),_0x2e1901();});}),'abortController':_0x3e4abd};}class cn extends vt{['options'];['content']='';['htmlStreamer'];['children'];constructor(_0x96d23){super();const _0xda5bfc=this['bindTemplate'];this['set']('isDone',!0x1),this['set']('isVisible',!0x0),this['htmlStreamer']=new nn({'textNodeStyle':'animation:\x20ck-html-streamer-fade-in\x20.5s','delay':0x14}),this['options']=_0x96d23,this['children']=this['createCollection'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed__item',_0xda5bfc['if']('isDone','ck-ai-chat__feed__item_done'),_0xda5bfc['if']('isVisible','ck-hidden',_0x149f8b=>!_0x149f8b),'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'](_0x5b0c08=>{_0x5b0c08['removeAttribute']('data-id');}),this['isDone']=!0x0;}async['streamIntoElement'](_0x30adaf,_0x1ff0cf,_0x5ec661){await this['htmlStreamer']['stream']({'document':_0x30adaf,'targetElement':_0x1ff0cf,'abortSignal':_0x5ec661});}}class ln extends vt{['showChangesToggleView'];constructor(_0x379cc1,_0x1ce24a){super(_0x379cc1),this['set']('isShowChangesToggleVisible',!0x0),this['showChangesToggleView']=new un(_0x379cc1),this['showChangesToggleView']['set']({'class':'ck-ai-suggestion__header__show-changes-toggle\x20ck-ai-chat-controls-button\x20'+As,'label':us(_0x379cc1,'AI_SUGGESTION_BUTTON_SHOW_CHANGES'),'withText':!0x0}),this['showChangesToggleView']['isOn']=_0x1ce24a['showDiff'],this['showChangesToggleView']['bind']('isVisible')['to'](this,'isShowChangesToggleVisible'),this['showChangesToggleView']['bind']('icon')['to'](this['showChangesToggleView'],'isOn',_0x5758a6=>_0x5758a6?_0x3ca4ea:_0xc7caf0),this['showChangesToggleView']['on']('execute',()=>{this['showChangesToggleView']['isOn']=!this['showChangesToggleView']['isOn'],this['fire']('toggleShowChanges',{'isOn':this['showChangesToggleView']['isOn']});});const _0x478e06=new xt();_0x478e06['content']=_0x397866,this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__header',!0x1===_0x1ce24a['showHeader']?'ck-hidden':null]['filter'](Boolean)},'children':[_0x478e06,{'tag':'span','children':[us(_0x379cc1,'AI_SUGGESTION_HEADER_TITLE')]},this['showChangesToggleView']]});}}class un extends Nt{['render'](){super['render'](),this['children']['remove'](this['iconView']),this['children']['add'](this['iconView']);}}const dn={'accepted':_0x3de973,'rejected':_0x34fe88,'outdated':_0x34fe88};class _n extends vt{['stateIconView'];constructor(_0x109c27){super(_0x109c27);const _0x2f5c22=this['bindTemplate'];this['set']('state','accepted'),this['set']('isVisible',!0x0),this['stateIconView']=new An(),this['stateIconView']['bind']('state')['to'](this),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__content-part-state',_0x2f5c22['to']('state',_0x545de8=>'ck-ai-suggestion__content-part-state_'+_0x545de8),_0x2f5c22['if']('isVisible','ck-hidden',_0x4da02a=>!_0x4da02a)]},'children':[{'tag':'span','attributes':{'class':['ck-ai-suggestion__content-part-state__label']},'children':[{'text':_0x2f5c22['to']('state',_0x1c2b0a=>{switch(_0x1c2b0a){case'accepted':return us(_0x109c27,'AI_SUGGESTION_CONTENT_PART_STATE_ACCEPTED');case'rejected':return us(_0x109c27,'AI_SUGGESTION_CONTENT_PART_STATE_REJECTED');case'outdated':return us(_0x109c27,'AI_SUGGESTION_CONTENT_PART_STATE_OUTDATED');}})}]},this['stateIconView']]});}['setState'](_0x9e1de3){this['state']=_0x9e1de3;}}class An extends xt{constructor(){super(),this['set']('state','accepted'),this['content']=dn[this['state']],this['on']('change:state',()=>{this['content']=dn[this['state']];});}}class gn extends kt{['_applyButton'];['_suggestButton'];constructor(_0x3d7972,_0x3e3a4f,_0x4dc9df){super(_0x3d7972);const _0x18b29c=Boolean(_0x4dc9df);this['set']('isEnabled',!_0x18b29c),this['set']('isVisible',!0x0),this['class']='ck-ai-suggestion-content-part-toolbar';const _0x124e88=[];if(_0x18b29c){const _0x417d34=new Nt(_0x3d7972);_0x417d34['set']({'label':us(_0x3d7972,'AI_SUGGESTION_DISABLED_TOOLTIP_MESSAGE'),'tooltip':!0x0,'tooltipPosition':'n','withText':!0x1,'icon':_0x5bdc98}),_0x124e88['push'](_0x417d34);}else{_0x3e3a4f['includes']('applySuggestion')&&(this['_applyButton']=new Nt(_0x3d7972),this['_applyButton']['set']({'label':us(_0x3d7972,'AI_SUGGESTION_CONTENT_PART_APPLY'),'tooltip':!0x0,'tooltipPosition':'n','withText':!0x1,'icon':_0x3de973}),this['_applyButton']['bind']('isEnabled')['to'](this),this['_applyButton']['on']('execute',()=>{this['fire']('applySuggestion');}),_0x124e88['push'](this['_applyButton'])),_0x3e3a4f['includes']('insertSuggestion')&&(this['_suggestButton']=new Nt(_0x3d7972),this['_suggestButton']['set']({'label':us(_0x3d7972,'AI_SUGGESTION_CONTENT_PART_ADD_SUGGESTION'),'tooltip':!0x0,'tooltipPosition':'n','withText':!0x1,'icon':_0x565935}),this['_suggestButton']['bind']('isEnabled')['to'](this),this['_suggestButton']['on']('execute',()=>{this['fire']('insertSuggestion');}),_0x124e88['push'](this['_suggestButton']));const _0x4b5199=new Nt(_0x3d7972);_0x4b5199['set']({'label':us(_0x3d7972,'AI_SUGGESTION_CONTENT_PART_REJECT'),'tooltip':!0x0,'tooltipPosition':'n','withText':!0x1,'icon':_0x34fe88}),_0x4b5199['bind']('isEnabled')['to'](this),_0x4b5199['on']('execute',()=>{this['fire']('rejectSuggestion');}),_0x124e88['push'](_0x4b5199);}this['items']['addMany'](_0x124e88);const _0xd4f597=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':[_0xd4f597['if']('isVisible','ck-hidden',_0x1d6a34=>!_0x1d6a34)]}});}['setButtonsVisibility']({showApplyButton:_0x5a81cd,showSuggestButton:_0xf1d826}){this['_applyButton']&&(this['_applyButton']['isVisible']=_0x5a81cd),this['_suggestButton']&&(this['_suggestButton']['isVisible']=_0xf1d826);}}class In extends vt{['toolbarView'];['stateView'];['titleLabelView'];['children'];constructor(_0x349048,{part:_0x468d41,uiIndex:_0x41fcfd,availableActions:_0x2ab154,areActionsDisabled:_0x5db5c5}){super(_0x349048),this['set']('isEnabled',!0x0),this['set']('state','pending'),this['toolbarView']=new gn(_0x349048,_0x2ab154,_0x5db5c5),this['toolbarView']['on']('rejectSuggestion',()=>{this['fire']('rejectSuggestion',{'index':_0x468d41['index']});}),this['toolbarView']['on']('insertSuggestion',()=>{this['fire']('insertSuggestion',{'index':_0x468d41['index']});}),this['toolbarView']['on']('applySuggestion',()=>{this['fire']('applySuggestion',{'index':_0x468d41['index']});}),this['toolbarView']['bind']('isEnabled')['to'](this),this['stateView']=new _n(_0x349048),this['titleLabelView']=new En(_0x349048,_0x41fcfd),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',(_0x2d9157,_0x175521,_0x4aea04,_0x47256d)=>{'pending'===_0x47256d?this['children']['remove'](this['toolbarView']):this['children']['remove'](this['stateView']),'pending'===_0x4aea04?this['children']['add'](this['toolbarView']):(this['stateView']['setState'](_0x4aea04),this['children']['add'](this['stateView']));});}}class En extends vt{constructor(_0x5465df,_0x465908){super(_0x5465df),this['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai-suggestion__body__content-part__title__label']},'children':[us(_0x5465df,'AI_SUGGESTION_CONTENT_PART_TITLE',_0x465908['toString']())]});}}class pn extends vt{['htmlStreamer'];constructor(_0x4846dc){super(_0x4846dc),this['htmlStreamer']=new nn({'textNodeStyle':'animation:\x20ck-html-streamer-fade-in\x20.5s','delay':0x14}),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-content','ck-reset_all-excluded','ck-ai-suggestion-streamable-content']}});}async['update']({part:_0x1d9905,renderingStrategy:_0x297030,abortSignal:_0x4fb5d0}){'streaming'===_0x297030?await this['htmlStreamer']['stream']({'document':_0x1d9905['content'],'targetElement':this['element'],'abortSignal':_0x4fb5d0}):this['element']['innerHTML']=Es(_0x1d9905['content']);}['clear'](){this['htmlStreamer']['reset'](),this['element']['innerHTML']='';}}class Tn extends vt{['_children'];['_headerView'];['_streamableContentView'];constructor(_0x447f53,{part:_0x352518,uiIndex:_0x3f5058,areActionsDisabled:_0x161ea6,availableActions:_0x174573}){super(_0x447f53);const _0x53a138=this['bindTemplate'];this['set']('state','pending'),this['set']('isDone',!0x1),this['set']('isVisible',!0x1),this['set']('isActive',!0x1),this['set']('isEnabled',!0x1);const _0xbcdbff=()=>{this['isEnabled']=this['isDone']&&'pending'==this['state']&&!_0x161ea6;};this['on']('change:state',_0xbcdbff),this['on']('change:isDone',_0xbcdbff),_0xbcdbff(),this['_children']=this['createCollection'](),this['_headerView']=new In(_0x447f53,{'part':_0x352518,'uiIndex':_0x3f5058,'availableActions':_0x174573,'areActionsDisabled':_0x161ea6}),this['_headerView']['bind']('isEnabled','state')['to'](this),this['_headerView']['delegate'](...en)['to'](this),this['_streamableContentView']=new pn(_0x447f53),this['_children']['addMany']([this['_headerView'],this['_streamableContentView']]),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__body__content-part',_0x53a138['to']('state',_0x30fab4=>'ck-ai-suggestion__body__content-part_'+_0x30fab4),_0x53a138['if']('isEnabled','ck-ai-suggestion__body__content-part_enabled'),_0x53a138['if']('isActive','ck-ai-suggestion__body__content-part_active'),_0x53a138['if']('isVisible','ck-hidden',_0xd53cd1=>!_0xd53cd1)]},'children':this['_children'],'on':{'mouseenter':_0x53a138['to'](()=>{this['isEnabled']&&this['fire']('mouseOverSuggestion',{'index':_0x352518['index']});}),'mouseleave':_0x53a138['to'](()=>{this['isEnabled']&&this['fire']('mouseLeaveSuggestion',{'index':_0x352518['index']});}),'click':_0x53a138['to'](_0x1992b4=>{const _0x44de62=_0x1992b4['target'];this['isEnabled']&&!this['_headerView']['toolbarView']['element']['contains'](_0x44de62)&&this['fire']('showChangeInText',{'index':_0x352518['index']});})}});}async['updateContent']({part:_0xe01eb3,renderingStrategy:_0x2e4843,showUnchangedParts:_0x3d7830=!0x1,abortSignal:_0x2279ac}){this['partDefinition']=_0xe01eb3,this['isVisible']=this['partDefinition']['hasChanges']||_0x3d7830,this['isVisible']&&await this['_streamableContentView']['update']({'part':_0xe01eb3,'renderingStrategy':_0x2e4843,'abortSignal':_0x2279ac});}['markAsDone'](){this['isDone']=!0x0;}}class mn extends pt(){['queue']=[];['isProcessing']=!0x1;['_abortController'];async['enqueue'](_0x30ca55){const _0x31c15b=this['createTask'](_0x30ca55);return this['queue']['push'](_0x31c15b),this['_processQueue'](),_0x31c15b['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(_0x490585=>{this['once']('_queueEmpty',()=>{_0x490585();});}):Promise['resolve']();}async['_processQueue'](){if(!this['isProcessing']){this['_abortController']=new AbortController(),this['isProcessing']=!0x0;try{for(;this['queue']['length']&&this['isProcessing'];){const _0xa9c0e2=this['queue']['shift']();try{await _0xa9c0e2['callback'](this['_abortController']['signal']),_0xa9c0e2['resolve']();}catch(_0x3107a9){_0xa9c0e2['reject'](_0x3107a9);}}}finally{this['isProcessing']=!0x1,this['_abortController']=void 0x0;}this['fire']('_queueEmpty');}}['createTask'](_0x41fcdf){let _0xb9eb0f,_0x23b9b8;const _0x4b56fc=new Promise((_0x204c8c,_0x62fe53)=>{_0xb9eb0f=_0x204c8c,_0x23b9b8=_0x62fe53;});return{'callback':_0x41fcdf,'resolve':_0xb9eb0f,'reject':_0x23b9b8,'completePromise':_0x4b56fc};}}class Cn extends cn{constructor(_0x3b0e5d){super(_0x3b0e5d),this['extendTemplate']({'attributes':{'class':['ck-ai-notification','warning'===_0x3b0e5d['level']?'ck-ai-notification_warning':'ck-ai-notification_error']}});}['render'](){super['render'](),this['setContent'](this['options']['initialContent']),this['markAsDone']();}['setContent'](_0x54a3b4){this['element']['innerHTML']=_0x54a3b4;}}const wn=['applySuggestion','insertSuggestion'];class fn extends vt{['_applyChangesButton'];['_insertSuggestionsButton'];['children'];constructor(_0x42c22c,_0x158b08=[...wn],_0x3b37be){super(_0x42c22c);const _0x1a96ea=this['bindTemplate'],_0x6fd7a0=Boolean(_0x3b37be);if(this['set']('isEnabled',!_0x6fd7a0),this['set']('isVisible',!0x1),this['set']('isTrackChangesOn',!0x1),this['children']=this['createCollection'](),_0x6fd7a0){const _0x3fc8f5=new Nt(_0x42c22c);_0x3fc8f5['set']({'label':us(_0x42c22c,'AI_SUGGESTION_DISABLED_TOOLTIP_MESSAGE'),'tooltip':!0x0,'tooltipPosition':'n','withText':!0x1,'icon':_0x5bdc98});const _0x3ab018=new vt(_0x42c22c);_0x3ab018['setTemplate']({'tag':'div','attributes':{'class':'ck-ai-chat__feed__suggestion__actions__info'},'children':[{'tag':'p','children':[us(_0x42c22c,'AI_SUGGESTION_DISABLED_FEED_MESSAGE'),_0x3fc8f5]}]}),this['children']['add'](_0x3ab018);}else this['_applyChangesButton']=new Nt(_0x42c22c),this['_applyChangesButton']['set']({'label':us(_0x42c22c,'AI_CHAT_SUGGESTION_ACTION_APPLY_ALL'),'withText':!0x0,'type':'button','isVisible':_0x158b08['includes']('applySuggestion'),'class':ds}),this['_insertSuggestionsButton']=new Nt(_0x42c22c),this['_insertSuggestionsButton']['set']({'label':us(_0x42c22c,'AI_CHAT_SUGGESTION_ACTION_SUGGEST_ALL'),'withText':!0x0,'type':'button','isVisible':_0x158b08['includes']('insertSuggestion'),'class':_s}),this['_insertSuggestionsButton']['on']('execute',()=>{this['fire']('insertSuggestion');}),this['_applyChangesButton']['on']('execute',()=>{this['fire']('applySuggestion');}),[this['_applyChangesButton'],this['_insertSuggestionsButton']]['forEach'](_0x3e64d6=>{_0x3e64d6['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',_0x1a96ea['if']('isVisible','ck-hidden',_0x2c0e49=>!_0x2c0e49)]},'children':this['children']}),this['on']('change:isTrackChangesOn',()=>{this['_applyChangesButton']&&(this['_applyChangesButton']['isVisible']=!this['isTrackChangesOn']);});}['updateVisibility'](_0x2f0b4d){this['isVisible']=_0x2f0b4d;}['_switchButtonLabelsPlurality'](_0x1076db){this['_applyChangesButton']&&this['_insertSuggestionsButton']&&(_0x1076db?(this['_applyChangesButton']['label']=us(this['locale'],'AI_CHAT_SUGGESTION_ACTION_APPLY_ALL'),this['_insertSuggestionsButton']['label']=us(this['locale'],'AI_CHAT_SUGGESTION_ACTION_SUGGEST_ALL')):(this['_applyChangesButton']['label']=us(this['locale'],'AI_CHAT_SUGGESTION_ACTION_APPLY'),this['_insertSuggestionsButton']['label']=us(this['locale'],'AI_CHAT_SUGGESTION_ACTION_SUGGEST')));}}class Sn extends vt{['children'];['balloonPanelView'];['bodyCollection'];constructor(_0x5211a9,_0x301de9){super(_0x5211a9),this['bodyCollection']=_0x301de9,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',_0x260d96=>!_0x260d96)]},'children':this['children']});const _0x13c5d2=new vt(this['locale']),_0x167991=new xt();_0x167991['content']=_0x6e68f0,_0x13c5d2['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-web-sources__header']},'children':[_0x167991,{'tag':'span','children':[{'text':us(this['locale'],'AI_CHAT_SOURCES_HEADER')}]}]}),this['children']['add'](_0x13c5d2),this['_setupBalloonPanel'](_0x5211a9);}['addSource'](_0x1b0163){this['children']['add'](new bn(this['locale'],_0x1b0163,this['balloonPanelView']));}['_setupBalloonPanel'](_0x1c5bef){this['balloonPanelView']=new Xt(_0x1c5bef),this['balloonPanelView']['extendTemplate']({'attributes':{'class':['ck-ai-web-source__tooltip-balloon']}}),this['bodyCollection']['add'](this['balloonPanelView']);}}class bn extends Nt{['balloonPanelView'];['source'];constructor(_0x3e9d7b,_0xb894b2,_0x57e9ab){super(_0x3e9d7b),this['source']=_0xb894b2,this['balloonPanelView']=_0x57e9ab,this['set']({'label':_0xb894b2['title'],'class':['ck\x20ck-ai-web-source'],'withText':!0x0});const _0xd71aaa=this['bindTemplate'];if(this['extendTemplate']({'on':{'click':_0xd71aaa['to'](()=>{window['open'](_0xb894b2['url'],'_blank');}),'mouseenter':_0xd71aaa['to'](()=>{this['_showTooltip']();}),'mouseleave':_0xd71aaa['to'](()=>{this['_hideTooltip']();})}}),_0xb894b2['favicon']){const _0x144150=new vt(_0x3e9d7b);_0x144150['setTemplate']({'tag':'img','attributes':{'src':_0xb894b2['favicon']||_0x6e68f0,'alt':_0xb894b2['title'],'class':['ck-ai-web-source__image']}}),this['children']['add'](_0x144150);}else this['set']('icon',_0x6e68f0);}['_createTooltipContentView'](_0x3eb740,_0xcc3811){const _0x1c3c29=new vt(_0x3eb740),_0x136e02=[];let _0x303dd9;_0xcc3811?.['favicon']?(_0x303dd9=new vt(_0x3eb740),_0x303dd9['setTemplate']({'tag':'img','attributes':{'src':_0xcc3811['favicon'],'alt':_0xcc3811['title'],'class':['ck-ai-web-source__tooltip-image']}})):(_0x303dd9=new xt(),_0x303dd9['content']=_0x6e68f0,_0x303dd9['extendTemplate']({'attributes':{'alt':_0xcc3811['title'],'class':['ck-ai-web-source__tooltip-image']}})),_0x136e02['push'](_0x303dd9);const _0x258a08=new vt(_0x3eb740);_0x258a08['setTemplate']({'tag':'a','attributes':{'class':['ck-ai-web-source__tooltip-url'],'href':_0xcc3811['url']},'children':[{'text':new URL(_0xcc3811['url'])?.['hostname']}]}),_0x136e02['push'](_0x258a08);const _0x300b88=new vt(_0x3eb740);_0x300b88['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-web-source__tooltip-row']},'children':_0x136e02});const _0x1d299f=new vt(_0x3eb740);return _0x1d299f['setTemplate']({'tag':'span','attributes':{'class':['ck-ai-web-source__tooltip-row','ck-ai-web-source__tooltip-title']},'children':[{'text':_0xcc3811['title']['length']>0x190?_0xcc3811['title']['substring'](0x0,0x190)+'...':_0xcc3811['title']}]}),_0x1c3c29['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-web-source__tooltip']},'children':[_0x300b88,_0x1d299f]}),_0x1c3c29;}['_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 _0x244ab1=this['_createTooltipContentView'](this['locale'],this['source']);this['balloonPanelView']['content']['add'](_0x244ab1);}}class Rn extends vt{['_actionsView'];['_sourcesView'];['_children'];['_areActionsDisabled'];['_showUnchangedParts'];['_updateContentPartsPromiseQueue'];['_emptyPartsWarningView'];['_availableActions'];['_cachedContentParts']=[];constructor(_0x40c9ca,_0x375a34){super(_0x40c9ca);const {areActionsDisabled:_0x43d249,showUnchangedParts:_0x2dd010,availableActions:_0x3dd961}=_0x375a34;this['_areActionsDisabled']=_0x43d249,this['_showUnchangedParts']=_0x2dd010,this['_availableActions']=_0x3dd961,this['set']('hasPendingParts',!0x1),this['set']('isTrackChangesOn',!0x1),this['_children']=this['createCollection'](),this['_updateContentPartsPromiseQueue']=new mn(),this['_emptyPartsWarningView']=new Cn({'id':'empty-parts-warning','initialContent':us(_0x40c9ca,'AI_SUGGESTION_EMPTY_PART_WARNING'),'level':'warning'}),this['_emptyPartsWarningView']['isVisible']=!0x1,this['_actionsView']=new fn(_0x40c9ca,_0x375a34['availableActions'],this['_areActionsDisabled']),this['_actionsView']['bind']('isTrackChangesOn')['to'](this),this['_sourcesView']=new Sn(this['locale'],_0x375a34['bodyCollection']),_0x375a34['areActionsDisabled']?this['_actionsView']['isEnabled']=!0x1:this['_actionsView']['bind']('isEnabled')['to'](this,'hasPendingParts'),this['_actionsView']['delegate'](...en)['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']]});}get['partsCount'](){return this['_children']['length'];}async['updateContentParts']({parts:_0x45af8c,renderingStrategy:_0x2e9202,abortSignal:_0xa8feb1}){this['_children']['length']?_0x45af8c['forEach'](_0x46c5da=>{const _0x5cd705=this['_cachedContentParts']['findIndex'](_0x183efd=>_0x183efd['index']==_0x46c5da['index']);-0x1===_0x5cd705?this['_cachedContentParts']['push'](_0x46c5da):this['_cachedContentParts'][_0x5cd705]=_0x46c5da;}):this['_cachedContentParts']=_0x45af8c;const _0x2f792b=this['_showUnchangedParts']?_0x45af8c:_0x45af8c['filter'](_0x520222=>_0x520222['hasChanges']);this['_actionsView']['_switchButtonLabelsPlurality'](_0x2f792b['length']>0x1);for(const _0x2c7d39 of _0x2f792b)this['_updateContentPartsPromiseQueue']['enqueue'](async _0x27a138=>{let _0x45988e=this['getPartView'](_0x2c7d39['index']);_0x45988e||(_0x45988e=new Tn(this['locale'],{'part':_0x2c7d39,'uiIndex':this['_children']['length']+0x1,'areActionsDisabled':this['_areActionsDisabled'],'availableActions':this['_availableActions']}),_0x45988e['delegate'](...en)['to'](this),this['_children']['add'](_0x45988e),this['hasPendingParts']=!0x0),await _0x45988e['updateContent']({'part':_0x2c7d39,'renderingStrategy':_0x2e9202,'showUnchangedParts':this['_showUnchangedParts'],'abortSignal':_0x27a138}),_0x45988e['markAsDone']();});return _0xa8feb1?.['addEventListener']('abort',()=>{this['_updateContentPartsPromiseQueue']['abort']();}),this['_updateContentPartsPromiseQueue']['queueEmptyPromise'];}['updatePartState'](_0x115df8,_0x4998d6){const _0x13d042=this['getPartView'](_0x115df8);_0x13d042&&(_0x13d042['state']=_0x4998d6),this['hasPendingParts']='pending'==_0x4998d6||Array['from'](this['_children'])['some'](_0x31027d=>'pending'==_0x31027d['state']);}['setPartActive'](_0xda230d,_0x4eeeb9){if(!0x1===_0xda230d){for(const _0x391746 of this['_children'])_0x391746['isActive']=!0x1;}else{const _0x4fb92e=this['getPartView'](_0xda230d);_0x4fb92e&&(_0x4fb92e['isActive']=_0x4eeeb9);}}['updateSources'](_0x1817b1){_0x1817b1['forEach'](_0x56206a=>this['_sourcesView']['addSource'](_0x56206a)),this['_sourcesView']['isVisible']=!0x0;}['getPartView'](_0x480d58){return this['_children']['find'](_0x5a8948=>_0x5a8948['partDefinition']['index']==_0x480d58)??null;}['markAsDone'](){if(!this['_showUnchangedParts']){const _0x1d4d4e=!this['_cachedContentParts']['find'](({hasChanges:_0x5578a3})=>_0x5578a3),_0x546204=!!this['_cachedContentParts']['find'](({hasChanges:_0x109441})=>!_0x109441);this['_emptyPartsWarningView']['isVisible']=0x0==this['_children']['length']||_0x546204,_0x1d4d4e?this['_emptyPartsWarningView']['setContent'](us(this['locale'],'AI_SUGGESTION_NO_PARTS_WARNING')):this['_emptyPartsWarningView']['setContent'](us(this['locale'],'AI_SUGGESTION_EMPTY_PART_WARNING'));}this['_children']['forEach'](_0x101158=>_0x101158['markAsDone']()),this['_actionsView']['updateVisibility'](this['hasNonEmptyParts']);}get['hasNonEmptyParts'](){return this['_children']['filter'](_0x20c415=>_0x20c415['partDefinition']['hasChanges'])['length']>0x0;}}class On extends vt{['bodyView'];['children'];['headerView'];constructor(_0x16006b,_0x20c4fa,_0xce866d){super(_0x16006b);const {showDiff:_0x3cd495,areActionsDisabled:_0x2b9691,showUnchangedParts:_0x598a1c,availableActions:_0xc3f4db}=_0x20c4fa;this['set']('isTrackChangesOn',!0x1),this['set']('areChangesVisible',!0x1),this['children']=this['createCollection'](),this['headerView']=new ln(_0x16006b,{'showDiff':_0x3cd495}),this['headerView']['on']('toggleShowChanges',(_0x2bb0d7,_0x33904b)=>{this['areChangesVisible']=_0x33904b['isOn'],this['fire']('toggleSuggestionDisplayMode',{'showDiff':_0x33904b['isOn']});}),this['children']['add'](this['headerView']),this['bodyView']=new Rn(_0x16006b,{'areActionsDisabled':_0x2b9691,'showUnchangedParts':!!_0x598a1c,'availableActions':_0xc3f4db,'bodyCollection':_0xce866d}),this['bodyView']['delegate'](...en)['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'](_0x2929a1){await this['bodyView']['updateContentParts'](_0x2929a1);}['updateSources'](_0x311bac){this['bodyView']['updateSources'](_0x311bac);}['markAsDone'](){this['bodyView']['markAsDone'](),this['headerView']&&(this['headerView']['isShowChangesToggleVisible']=this['bodyView']['hasNonEmptyParts']);}}class kn extends cn{['containerView'];constructor(_0x22bb37,_0x2cdd57,_0x4aad25){super(_0x2cdd57),this['set']('isTrackChangesOn',!0x1),this['containerView']=new On(_0x22bb37,{'showDiff':_0x2cdd57['showDiff'],'areActionsDisabled':_0x2cdd57['areActionsDisabled'],'availableActions':_0x2cdd57['availableActions']},_0x4aad25),this['containerView']['on']('toggleSuggestionDisplayMode',(_0x5021bb,_0x34e990)=>{this['fire']('toggleSuggestionDisplayMode',{'replyId':this['options']['id'],'showDiff':_0x34e990['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',(_0x1ec1d3,{index:_0x338df8})=>{this['fire']('showChangeInText',{'replyId':this['options']['id'],'partIndex':_0x338df8});}),this['containerView']['on']('applySuggestion',(_0xddb339,{index:_0x2e5ea9}={})=>{this['fire']('applySuggestion',{'replyId':this['options']['id'],'partIndex':_0x2e5ea9});}),this['containerView']['on']('insertSuggestion',(_0x4f5aa7,{index:_0x4ff6c0}={})=>{this['fire']('insertSuggestion',{'replyId':this['options']['id'],'partIndex':_0x4ff6c0});}),this['containerView']['on']('rejectSuggestion',(_0x529129,{index:_0x4058b9})=>{this['fire']('rejectSuggestion',{'replyId':this['options']['id'],'partIndex':_0x4058b9});}),this['containerView']['on']('mouseOverSuggestion',(_0x2be88e,{index:_0x210ed2})=>{this['fire']('mouseOverSuggestion',{'replyId':this['options']['id'],'partIndex':_0x210ed2});}),this['containerView']['on']('mouseLeaveSuggestion',(_0x211254,{index:_0x7a1a81})=>{this['fire']('mouseLeaveSuggestion',{'replyId':this['options']['id'],'partIndex':_0x7a1a81});}),this['children']['addMany']([this['containerView']]),this['extendTemplate']({'attributes':{'class':['ck-ai-chat__feed__ai-suggestion']}});}async['updateContent'](_0x33a9c6){await this['containerView']['updateContent'](_0x33a9c6);}['updatePartState'](_0x29b92d,_0x5a7a87){this['containerView']['bodyView']['updatePartState'](_0x29b92d,_0x5a7a87);}['setPartActive'](_0x155abd,_0x34cc12){!0x1===_0x155abd?this['containerView']['bodyView']['setPartActive'](!0x1):this['containerView']['bodyView']['setPartActive'](_0x155abd,_0x34cc12);}['updateSources'](_0x5b9e8c){this['containerView']['updateSources'](_0x5b9e8c);}['getPartView'](_0x29433a){return this['containerView']['bodyView']['getPartView'](_0x29433a);}['markAsDone'](){super['markAsDone'](),this['containerView']['markAsDone']();}}class Nn extends cn{['replyContainer'];['_bodyCollection'];constructor(_0x1a258c,_0x3cdc30,_0x495462){super(_0x3cdc30),this['_bodyCollection']=_0x495462,this['locale']=_0x1a258c,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':Is(this['options']['initialContent']),'renderingStrategy':'static'}),this['markAsDone']());}async['updateContent']({parsedContent:_0x503a20,renderingStrategy:_0x1405c1,abortSignal:_0x2faa81}){'streaming'===_0x1405c1?await this['streamIntoElement'](_0x503a20,this['replyContainer']['element'],_0x2faa81):this['replyContainer']['element']['innerHTML']=_0x3dc878(_0x503a20);}['updateSources'](_0x4ea46c){const _0x433db5=new Sn(this['locale'],this['_bodyCollection']);_0x433db5['children']['addMany'](_0x4ea46c['map'](_0x6209da=>new bn(this['locale'],_0x6209da,_0x433db5['balloonPanelView']))),_0x433db5['isVisible']=!0x0,this['children']['add'](_0x433db5);}}class vn extends yt{constructor(_0x24eb98=void 0x0){super();const _0x2528c5=_0x24eb98?'ck-ai-spinner_'+_0x24eb98:'';this['extendTemplate']({'tag':'span','attributes':{'class':['ck-ai-spinner',_0x2528c5]}});}}const yn={'file':_0x2f082a,'document':_0x397866,'web-resource':_0x4b626c,'text':_0x2f082a,'selection':_0x465fab,'mcp-tool-context':_0x397866},xn='ck-ai-chat-context-chip',Ln='ck-ai-chat-context-chip_wide',Dn='ck-ai-chat-context-chip_document',Pn='ck-ai-chat-context-chip__label',Hn='ck-ai-chat-context-chip__type-icon',Mn='ck-ai-chat-context-controls__chip-tooltip',Un='n';class Vn extends Nt{constructor(_0x469b58,_0x2e7c46,_0x2ebb90,_0x18166e,_0x321bbf=!0x1){super(_0x469b58),this['_isAnimationOnEnterEnabled']=_0x18166e,this['_initializeProperties'](_0x2e7c46,_0x2ebb90,_0x321bbf),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'](_0x55c78c,_0x44219a,_0x2b1c12){this['set']('label',_0x55c78c['label']),this['set']('tooltip',!0x0),this['set']('itemType',_0x55c78c['type']),this['set']('id',_0x55c78c['uiId']),this['set']('readonly',_0x44219a),this['set']('isLoading',_0x2b1c12);}['_setupTemplate'](){const _0x5e01ea=this['_createIconView'](),_0x173561=this['_createRemoveButton'](),_0x1dd82f=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':this['_createTemplateAttributes'](_0x1dd82f),'children':this['_createTemplateChildren'](_0x5e01ea,_0x173561,_0x1dd82f)});}['_createTemplateAttributes'](_0x4fdba2){return{'class':[xn,_0x4fdba2['if']('itemType',Dn,_0x2cd290=>'document'==_0x2cd290),_0x4fdba2['if']('itemType',Ln,_0x548fb3=>'selection'==_0x548fb3)],'data-cke-tooltip-text':_0x4fdba2['to']('label',Bn),'data-cke-tooltip-position':Un,'data-cke-tooltip-class':Mn};}['_createTemplateChildren'](_0xd96c9e,_0x202ba1,_0x5411a0){const _0x218f60=this['_createLabelElement'](_0x5411a0),_0x262aef=this['_createLoaderIcon']();return this['readonly']?[_0xd96c9e,_0x218f60]:[_0xd96c9e,_0x262aef,_0x218f60,_0x202ba1];}['_createLabelElement'](_0x19f439){return{'tag':'span','attributes':{'class':Pn},'children':[{'text':_0x19f439['to']('label')}]};}['_createRemoveButton'](){const _0x195ea8=new Nt(this['locale']);return _0x195ea8['set']({'label':us(this['locale'],'AI_CHAT_CONTEXT_REMOVE_FROM_CONTEXT'),'icon':_0x46185c}),this['_setupRemoveButtonEvent'](_0x195ea8),_0x195ea8;}['_setupRemoveButtonEvent'](_0x2be110){_0x2be110['on']('execute',()=>{this['fire']('removeContextItemChip',this['id']);});}['_createIconView'](){const _0x52e7e9=this['bindTemplate'],_0x43ead0=new xt();return _0x43ead0['content']=yn[this['itemType']],_0x43ead0['extendTemplate']({'attributes':{'class':[Hn,_0x52e7e9['if']('isLoading','ck-hidden',_0x2c4920=>_0x2c4920)]}}),_0x43ead0;}['_handleAnimationEndOnce'](_0x28eebb,_0x4fb3b5){if(!_0x28eebb)return;const _0x4d0283=()=>{_0x4fb3b5(),_0x28eebb['removeEventListener']('animationend',_0x4d0283),_0x28eebb['removeEventListener']('webkitAnimationEnd',_0x4d0283);};_0x28eebb['addEventListener']('animationend',_0x4d0283),_0x28eebb['addEventListener']('webkitAnimationEnd',_0x4d0283);}['_createLoaderIcon'](){const _0xe6eabe=new vn('small');return _0xe6eabe['bind']('isVisible')['to'](this,'isLoading',_0x351463=>_0x351463),_0xe6eabe;}}function Bn(_0x2982b5){if(!_0x2982b5)return _0x2982b5;if(_0x2982b5['length']<=0x78)return _0x2982b5;const _0x44c644=_0x2982b5['slice'](0x0,0x78),_0x886d99=_0x44c644['lastIndexOf']('\x20');return(_0x886d99>0x0?_0x44c644['slice'](0x0,_0x886d99):_0x44c644)+'…';}const Gn={'maxVisibleRows':0x2,'rowDetectionTolerance':0x5,'showMoreLabelPrefix':'+\x20','viewportOffset':{'top':0x64,'bottom':0xa}},Fn='300px';class Kn{['_locale'];['_config'];['_visibleChips'];['_overflowChips'];['_showMoreButtonView']=null;['_showMoreBalloonPanelView']=null;['_containerElement']=null;['_bodyCollection'];['_parentView']=null;['_intersectionObserver']=null;['_pendingCalculation']=!0x1;constructor(_0x18a95a,_0x1d3d9e,_0x357663,_0x5e46b3,_0xc99789){this['_locale']=_0x18a95a,this['_visibleChips']=_0x1d3d9e,this['_config']={...Gn,..._0x357663,'cssClasses':{'controlsButton':'','calculationContainer':'ck-calculation-container',..._0x357663['cssClasses']}},this['_overflowChips']=new _t(),this['_bodyCollection']=_0x5e46b3,this['_parentView']=_0xc99789||null;}['setContainerElement'](_0x4210ee){this['_intersectionObserver']&&(this['_intersectionObserver']['disconnect'](),this['_intersectionObserver']=null),this['_containerElement']=_0x4210ee,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 _0x162d2b=[...this['_visibleChips'],...this['_overflowChips']],_0x2fb94a=this['_createCalculationContainer'](),_0x436d97=this['_calculateOverflowInContainer'](_0x2fb94a,_0x162d2b),_0x2c2bf0=_0x2fb94a['_ancestorsToRestore'];_0x2c2bf0&&this['_restoreAncestorVisibility'](_0x2c2bf0),_0x2fb94a['remove'](),this['_applyOverflowResults'](_0x162d2b,_0x436d97);}['_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 _0x142f87=new Nt(this['_locale']);_0x142f87['set']({'label':'','withText':!0x0,'isToggleable':!0x0});const _0x30825b=[this['_config']['cssClasses']['showMoreButton']];return this['_config']['cssClasses']['controlsButton']&&_0x30825b['push'](this['_config']['cssClasses']['controlsButton']),_0x142f87['extendTemplate']({'attributes':{'class':_0x30825b}}),_0x142f87;}['_createShowMoreBalloonPanelView'](){const _0x15b9ae=new Xt(this['_locale']);return _0x15b9ae['extendTemplate']({'attributes':{'class':this['_config']['cssClasses']['showMoreBalloon']}}),this['_bodyCollection']['add'](_0x15b9ae),_0x15b9ae;}['_updateBalloonContent'](){if(this['_showMoreBalloonPanelView']&&(this['_showMoreBalloonPanelView']['content']['clear'](),this['_overflowChips']['length']>0x0)){this['_overflowChips']['forEach'](_0x51f1f3=>{_0x51f1f3['disableAnimationOnEnter']();});const _0x1dc331=new vt(this['_locale']);_0x1dc331['setTemplate']({'tag':'div','attributes':{'class':this['_config']['cssClasses']['overflowContainer']},'children':this['_overflowChips']}),this['_showMoreBalloonPanelView']['content']['add'](_0x1dc331);}}['_handleShowMoreButtonClick'](){this['_showMoreButtonView']['isOn']?this['hideBalloonPanel']():this['showBalloonPanel']();}['_updateShowMoreButtonVisibility'](){const _0x3af709=this['_overflowChips']['length']>0x0;this['_showMoreButtonView']?.['element']&&(this['_showMoreButtonView']['element']['style']['display']=_0x3af709?'':'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'](_0x3f1d73){const _0x59a74b=this['_containerElement']?.['tagName']['toLowerCase']()||'div',_0x4fc99e=this['_containerElement']?.['classList'];if(_0x4fc99e){const _0x3072d9=_0x4fc99e[0x0]||'',_0x6bd5ff=_0x3f1d73['querySelector']('.'+_0x3072d9),_0xbd09c=_0x3f1d73['querySelector'](_0x59a74b);return _0x6bd5ff||_0xbd09c||_0x3f1d73;}return _0x3f1d73['querySelector'](_0x59a74b)||_0x3f1d73;}['_calculateContainerWidth'](){const _0x27bb2f=this['_parentView']?.['element']||this['_containerElement'];if(!_0x27bb2f)return Fn;const _0x52aa5f=window['getComputedStyle'](_0x27bb2f)['width'];if('auto'===_0x52aa5f||'0px'===_0x52aa5f||!_0x52aa5f){const _0x2bb74b=_0x27bb2f['parentElement'];if(_0x2bb74b){const _0xff67de=window['getComputedStyle'](_0x2bb74b);return'auto'!==_0xff67de['width']?_0xff67de['width']:Fn;}return Fn;}return _0x52aa5f;}['_applyCalculationStyles'](_0x1070b5,_0x431429){this['_config']['cssClasses']['calculationContainer']&&_0x1070b5['classList']['add'](this['_config']['cssClasses']['calculationContainer']),_0x1070b5['style']['width']=_0x431429,_0x1070b5['style']['position']='absolute',_0x1070b5['style']['top']='-9999px',_0x1070b5['style']['left']='-9999px',_0x1070b5['style']['opacity']='0',_0x1070b5['style']['pointerEvents']='none',_0x1070b5['style']['zIndex']='-1',_0x1070b5['style']['visibility']='visible\x20!important',_0x1070b5['style']['display']='block\x20!important',_0x1070b5['style']['boxSizing']='border-box';}['_restoreAncestorVisibility'](_0x37eee6){_0x37eee6['forEach'](({element:_0x21c721,originalDisplay:_0x29a1f4,originalVisibility:_0x450056})=>{_0x21c721['style']['display']=_0x29a1f4,_0x21c721['style']['visibility']=_0x450056;});}['_makeAncestorsVisible'](_0x472c52){const _0x3cbc51=[];let _0xe8ccab=_0x472c52;for(;_0xe8ccab&&_0xe8ccab!==document['body'];){const _0x1805ce=window['getComputedStyle'](_0xe8ccab);'none'!==_0x1805ce['display']&&'hidden'!==_0x1805ce['visibility']||(_0x3cbc51['push']({'element':_0xe8ccab,'originalDisplay':_0xe8ccab['style']['display'],'originalVisibility':_0xe8ccab['style']['visibility']}),_0xe8ccab['style']['display']='block',_0xe8ccab['style']['visibility']='visible'),_0xe8ccab=_0xe8ccab['parentElement'];}return _0x3cbc51;}['_createContainerElements'](){let _0x4cdf54,_0x804d17;return this['_parentView']?.['element']?(_0x4cdf54=this['_parentView']['element']['cloneNode'](!0x0),_0x804d17=this['_findTargetContainer'](_0x4cdf54)):(_0x4cdf54=document['createElement']('div'),_0x804d17=_0x4cdf54),{'calculationContainer':_0x4cdf54,'targetContainer':_0x804d17};}['_createCalculationContainer'](){const {calculationContainer:_0xdc8d90,targetContainer:_0x2e8333}=this['_createContainerElements'](),_0x5a71bf=this['_calculateContainerWidth']();this['_applyCalculationStyles'](_0xdc8d90,_0x5a71bf);const _0x1edfad=this['_parentView']?.['element']||this['_containerElement'],_0x1f70c5=_0x1edfad?.['parentElement'];_0x1f70c5?_0x1f70c5['appendChild'](_0xdc8d90):document['body']['appendChild'](_0xdc8d90),_0xdc8d90['_targetContainer']=_0x2e8333;const _0xf75804=this['_makeAncestorsVisible'](_0x1f70c5||null);return _0xdc8d90['offsetWidth'],_0xdc8d90['_ancestorsToRestore']=_0xf75804,_0xdc8d90;}['_calculateOverflowInContainer'](_0x422616,_0x1c96a0){const _0x40d5ff=_0x422616['_targetContainer']||_0x422616,_0xa318dc=[],{rowCount:_0x12bf68}=this['_renderChipsAndCountRows'](_0x40d5ff,_0x1c96a0);if(_0x12bf68<=this['_config']['maxVisibleRows'])return _0xa318dc;const _0x390029=_0x1c96a0['slice']();for(;_0x390029['length']>0x0;){if(this['_testButtonFit'](_0x422616,_0x40d5ff,_0x390029)){const _0x1f0a98=_0x1c96a0['filter'](_0x5d5f20=>!_0x390029['includes'](_0x5d5f20));_0xa318dc['push'](..._0x1f0a98);break;}if(!_0x390029['pop']())break;}return _0xa318dc;}['_renderChipsAndCountRows'](_0x7064aa,_0x525199){_0x7064aa['innerHTML']='',_0x525199['forEach'](_0x5ea176=>{if(_0x5ea176['element']){const _0x12ae94=_0x5ea176['element']['cloneNode'](!0x0);_0x7064aa['appendChild'](_0x12ae94);}}),_0x7064aa['offsetWidth'];const _0x146165=_0x7064aa['children'],_0x562760=[];return Array['from'](_0x146165)['forEach'](_0x205dfc=>{const _0x543595=_0x205dfc['getBoundingClientRect']()['top'];_0x562760['some'](_0x3b4282=>Math['abs'](_0x3b4282-_0x543595)<this['_config']['rowDetectionTolerance'])||_0x562760['push'](_0x543595);}),{'rowCount':_0x562760['length']};}['_createMockButton'](){const _0xed653f=document['createElement']('button');return _0xed653f['className']=this['_config']['cssClasses']['showMoreButton'],this['_config']['cssClasses']['controlsButton']&&_0xed653f['classList']['add'](this['_config']['cssClasses']['controlsButton']),_0xed653f['textContent']='+\x201',_0xed653f;}['_testButtonFit'](_0x288045,_0x1c9570,_0x7cc5e8){this['_renderChipsAndCountRows'](_0x1c9570,_0x7cc5e8);const _0x51a378=this['_createMockButton']();_0x288045['appendChild'](_0x51a378),_0x288045['offsetWidth'];const _0x2a4e40=[..._0x1c9570['children'],_0x51a378],_0x5d2b6d=[];_0x2a4e40['forEach'](_0x2770d0=>{const _0x448cd3=_0x2770d0['getBoundingClientRect']()['top'];_0x5d2b6d['some'](_0x175e74=>Math['abs'](_0x175e74-_0x448cd3)<this['_config']['rowDetectionTolerance'])||_0x5d2b6d['push'](_0x448cd3);});const _0x16ff43=_0x5d2b6d['length'];return _0x51a378['remove'](),_0x16ff43<=this['_config']['maxVisibleRows'];}['_distributeChips'](_0x48b82d,_0x371b5c){this['_visibleChips']['clear'](),this['_overflowChips']['clear'](),_0x48b82d['forEach'](_0xe3b04e=>{_0x371b5c['includes'](_0xe3b04e)?this['_overflowChips']['add'](_0xe3b04e):this['_visibleChips']['add'](_0xe3b04e);});}['_updateOverflowUI'](_0x5c3769){if(_0x5c3769>0x0&&!this['_showMoreButtonView']&&this['_createShowMoreButton'](),_0x5c3769>0x0&&this['_showMoreButtonView']){const _0x30aadc=''+this['_config']['showMoreLabelPrefix']+(_0x5c3769<0x63?_0x5c3769:'99');this['_showMoreButtonView']['label']=_0x30aadc;}this['_updateBalloonContent'](),this['_updateShowMoreButtonVisibility'](),this['_repinBalloonPanel']();}['_applyOverflowResults'](_0x456127,_0x44732d){this['_distributeChips'](_0x456127,_0x44732d),this['_updateOverflowUI'](_0x44732d['length']);}['_setupVisibilityObserver'](){this['_containerElement']&&'undefined'!=typeof IntersectionObserver&&(this['_intersectionObserver']=new IntersectionObserver(_0x3b7820=>{_0x3b7820[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 _0x575846=this['_containerElement']['getBoundingClientRect']();if(0x0===_0x575846['width']||0x0===_0x575846['height'])return!0x1;const _0x2204d6=window['innerHeight']||document['documentElement']['clientHeight'],_0x2ee80c=window['innerWidth']||document['documentElement']['clientWidth'],_0x3fa84c=0xc8;return _0x575846['bottom']>=-0xc8&&_0x575846['top']<=_0x2204d6+_0x3fa84c&&_0x575846['right']>=-0xc8&&_0x575846['left']<=_0x2ee80c+_0x3fa84c;}}const Wn='ck-ai-chat__feed__context-chips',Yn='ck-ai-chat-context-chips-wrapper',$n='ck-ai-chat-context-chips-wrapper-balloon',qn='ck-ai-chat-controls-button',Qn='ck-ai-chat-controls_context_show-more-button',Xn='ck-ai-chat-context-controls__show-more-balloon-panel';class zn extends vt{['_contextChips']=this['createCollection']();['_overflowManager'];['_bodyCollection'];constructor(_0x1db250,_0x3efe68,_0x343bad){super(_0x1db250),this['_bodyCollection']=_0x343bad,this['_createContextChips'](_0x3efe68);const _0x347a6c={'cssClasses':{'showMoreButton':Qn+'\x20'+As,'showMoreBalloon':Xn,'overflowContainer':$n,'controlsButton':qn}};this['_overflowManager']=new Kn(_0x1db250,this['_contextChips'],_0x347a6c,this['_bodyCollection'],this),this['setTemplate']({'tag':'div','attributes':{'class':[Wn,'ck','ck-reset_all']},'children':[{'tag':'div','attributes':{'class':Yn},'children':this['_contextChips']}]});}['render'](){super['render']();const _0x21588f=this['element']['querySelector']('.'+Yn);_0x21588f&&(this['_overflowManager']['setContainerElement'](_0x21588f),this['_overflowManager']['reorganizeChips']());}['destroy'](){super['destroy'](),this['_overflowManager']['destroy']();}['_createContextChips'](_0x193481){for(const _0x1f013c of _0x193481){const _0x4d423b=new Vn(this['locale'],_0x1f013c,!0x0,!0x1);this['_contextChips']['add'](_0x4d423b);}}}class jn extends cn{['_contextChipsView']=null;['_locale'];['_bodyCollection'];['_messageContentView'];constructor(_0x22e4ba,_0x3c7c59,_0x41c961){super(_0x3c7c59),this['_locale']=_0x22e4ba,this['_bodyCollection']=_0x41c961,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 zn(this['_locale'],this['options']['contextItems']['filter'](_0x28e755=>!_0x28e755['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 Jn extends cn{['capabilities'];constructor(_0x2ca0fd,_0x4b26fb){super(_0x4b26fb);const {isWebSearchEnabled:_0x2708a2,isReasoningEnabled:_0x2eae08}=_0x4b26fb['capabilities'],_0x19dcda=[];let _0x148862='';_0x2708a2&&_0x2eae08?(_0x148862=us(_0x2ca0fd,'AI_CHAT_FEED_REPLY_ITEM_USED_WEB_SEARCH_REASONING'),_0x19dcda['push'](Zn(_0x6e68f0)),_0x19dcda['push'](Zn(_0x1b9751))):_0x2708a2?(_0x148862=us(_0x2ca0fd,'AI_CHAT_FEED_REPLY_ITEM_USED_WEB_SEARCH'),_0x19dcda['push'](Zn(_0x6e68f0))):_0x2eae08&&(_0x148862=us(_0x2ca0fd,'AI_CHAT_FEED_REPLY_ITEM_USED_REASONING'),_0x19dcda['push'](Zn(_0x1b9751))),this['extendTemplate']({'attributes':{'class':['ck-ai-chat__feed__interaction-header',_0x148862?'':'ck-hidden']}});const _0x272fd2=new vt();_0x272fd2['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed__interaction-header__capabilities']},'children':[..._0x19dcda,{'tag':'span','attributes':{'class':['ck-ai-chat__feed__interaction-header__capabilities__text']},'children':[_0x148862]}]}),this['children']['add'](_0x272fd2),this['capabilities']=_0x4b26fb['capabilities'];}}function Zn(_0x1f1867){const _0x4bf10b=new xt();return _0x4bf10b['content']=_0x1f1867,_0x4bf10b;}const tr=['wheel','touchstart','pointerdown','keydown'],er=['ArrowUp','ArrowDown','PageUp','PageDown','Home','End','\x20'];class ir{['element'];['animationFrameId'];['isRunning'];['abortController'];['isUserPaused'];constructor(_0x12060d){this['element']=_0x12060d,this['animationFrameId']=null,this['isRunning']=!0x1,this['abortController']=new AbortController(),this['isUserPaused']=!0x1;for(const _0x17ceed of tr){const _0x507a53='keydown'!==_0x17ceed;this['element']['addEventListener'](_0x17ceed,this['_onUserEvent']['bind'](this),{'passive':_0x507a53,'signal':this['abortController']['signal']});}}['start'](){this['isRunning']||(this['isRunning']=!0x0,this['isUserPaused']=!0x1,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'](_0x4f44d1){if(this['isRunning']){if('keydown'===_0x4f44d1['type']){const _0x10b4e4=_0x4f44d1['key'];if(!er['includes'](_0x10b4e4))return;}_0x4f44d1 instanceof WheelEvent?_0x4f44d1['deltaY']<0x0?this['isUserPaused']=!0x0:this['isUserPaused']=!this['_isAtBottom']():this['isUserPaused']=!0x0;}}['_isAtBottom'](){const {scrollTop:_0xe54346,scrollHeight:_0x11fefd,clientHeight:_0x2db63f}=this['element'];return _0x11fefd-_0xe54346-_0x2db63f<=0x5;}['_rafUpdate'](){this['isRunning']&&(this['isUserPaused']||this['element']['scrollTo']({'top':this['element']['scrollHeight'],'behavior':'auto'}),this['animationFrameId']=requestAnimationFrame(this['_rafUpdate']['bind'](this)));}}class sr extends vt{constructor(_0x5340fd,_0x2efbe8){super(_0x5340fd),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-skeleton']},'children':this['_createSkeletonItems'](_0x2efbe8)});}['_createSkeletonItems'](_0x11f40a){const _0x3c101a=['ck','ck-ai-skeleton__item'];return _0x11f40a['map'](_0x16d320=>{let _0x22519d='';switch(_0x16d320['attributes']['align']){case'right':_0x22519d='margin-left:\x20auto;\x20margin-right:\x200;\x20text-align:\x20right;';break;case'center':_0x22519d='margin-left:\x20auto;\x20margin-right:\x20auto;\x20text-align:\x20center;';break;case'left':_0x22519d='margin-left:\x200;\x20margin-right:\x20auto;\x20text-align:\x20left;';}return{'tag':_0x16d320['tag'],'attributes':{'class':[..._0x3c101a,_0x16d320['attributes']['class']?_0x16d320['attributes']['class']:''],'style':'width:\x20'+_0x16d320['attributes']['width']+';\x20height:\x20'+_0x16d320['attributes']['height']+';'+_0x22519d}};});}}const nr={'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':rr(0x5,'100%','44px','right'),'aiChatResources':rr(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 rr(_0xa0b414,_0x42de6c,_0x521e1f,_0xbc6c95){return new Array(_0xa0b414)['fill'](null)['map'](()=>({'tag':'div','attributes':{'width':_0x42de6c,'height':_0x521e1f,'align':_0xbc6c95}}));}class ar extends cn{constructor(_0x43ce72){super(_0x43ce72),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 or extends vt{['children'];['scrollManager'];['_bodyCollection'];constructor(_0x54d0ae,_0xab5ac6){super(_0x54d0ae),this['_bodyCollection']=_0xab5ac6,this['set']('isPending',!0x1),this['set']('loadingMessage',''),this['set']('isLoadingSkeletonVisible',!0x1),this['set']('isTrackChangesOn',!0x1),this['children']=this['createCollection'](),this['children']['delegate'](...sn)['to'](this),this['_setupTemplate']();}['render'](){super['render'](),this['scrollManager']=new ir(this['element']);}['destroy'](){super['destroy'](),this['scrollManager']['destroy']();}['clear'](){this['children']['clear']();}['addItem'](_0x580079,_0x223f3e){let _0x10e695;return'ai-reply'===_0x580079?_0x10e695=new Nn(this['locale'],_0x223f3e,this['_bodyCollection']):'ai-suggestion-reply'===_0x580079?(_0x10e695=new kn(this['locale'],_0x223f3e,this['_bodyCollection']),_0x10e695['bind']('isTrackChangesOn')['to'](this)):_0x10e695='user-message'===_0x580079?new jn(this['locale'],_0x223f3e,this['_bodyCollection']):'interaction-header'===_0x580079?new Jn(this['locale'],_0x223f3e):'custom-element'===_0x580079?new ar(_0x223f3e):new Cn(_0x223f3e),this['children']['add'](_0x10e695),_0x10e695;}async['updateReplyItem']({id:_0x3e8de9,parsedContent:_0x15628d,renderingStrategy:_0x245c79,abortSignal:_0x5500fb}){const _0x289a4d=this['getItemById'](_0x3e8de9);if(!(_0x289a4d instanceof Nn))throw new ht('ai-chat-feed-view-item-not-a-reply-item',null,{'itemView':_0x289a4d,'id':_0x3e8de9,'parsedContent':_0x15628d});await _0x289a4d['updateContent']({'parsedContent':_0x15628d,'renderingStrategy':_0x245c79,'abortSignal':_0x5500fb});}async['updateWebSources'](_0x3d8fde,_0xf89e20){const _0x3dbba0=this['getItemById'](_0x3d8fde);if(_0x3dbba0 instanceof kn)_0x3dbba0['updateSources'](_0xf89e20);else{if(!(_0x3dbba0 instanceof Nn))throw new ht('ai-chat-feed-view-item-not-a-suggestion-or-reply-item',null,{'itemView':_0x3dbba0,'id':_0x3d8fde,'sources':_0xf89e20});_0x3dbba0['updateSources'](_0xf89e20);}}async['updateSuggestionItem']({id:_0x463812,parts:_0x4b2c24,renderingStrategy:_0x4e6c8d,abortSignal:_0x30ed83}){const _0x5dfc37=this['getItemById'](_0x463812);if(!(_0x5dfc37 instanceof kn))throw new ht('ai-chat-feed-view-item-not-a-suggestion-item',null,{'itemView':_0x5dfc37,'id':_0x463812,'parts':_0x4b2c24});await _0x5dfc37['updateContent']({'parts':_0x4b2c24,'renderingStrategy':_0x4e6c8d,'abortSignal':_0x30ed83});}['updateSuggestionPartState']({id:_0x40cd5d,index:_0x2b9d38,state:_0x2851fb}){const _0xd74bf4=this['getItemById'](_0x40cd5d);if(!(_0xd74bf4 instanceof kn))throw new ht('ai-chat-feed-view-item-not-a-suggestion-item',this,{'id':_0x40cd5d});_0xd74bf4['updatePartState'](_0x2b9d38,_0x2851fb);}['setSuggestionPartActive']({id:_0x3facd6,index:_0x3396e7,isActive:_0x368d3a}){const _0x33a801=this['getItemById'](_0x3facd6);if(!(_0x33a801 instanceof kn))throw new ht('ai-chat-feed-view-item-not-a-suggestion-item',this,{'id':_0x3facd6});this['children']['filter'](_0x442971=>_0x442971 instanceof kn)['forEach'](_0xe33b5d=>{_0xe33b5d['setPartActive'](!0x1);}),_0x33a801['setPartActive'](_0x3396e7,_0x368d3a);}['markItemAsDone'](_0x428e7c){this['getItemById'](_0x428e7c)['markAsDone']();}['getItemIds'](){return this['children']['map'](_0x45818f=>_0x45818f['options']['id']);}['removeItem'](_0x2bb76d){this['children']['remove'](this['getItemById'](_0x2bb76d));}['hasItem'](_0x993520){return!!this['children']['find'](_0x29e043=>_0x29e043['options']['id']['includes'](_0x993520));}['scrollToSuggestion'](_0x4bb2c3,_0x339603){const _0x4bd137=this['getItemById'](_0x4bb2c3);if(!(_0x4bd137 instanceof kn))return void Tt('ck-ai-chat-feed-view-scroll-to-suggestion-invalid-item',{'replyId':_0x4bb2c3,'partIndex':_0x339603});const _0x629fa9=_0x4bd137['getPartView'](_0x339603);_0x629fa9?ft(_0x629fa9['element'],0x14,this['element']['parentElement'],!0x0,!0x0):Tt('ck-ai-chat-feed-view-scroll-to-suggestion-part-view-not-found',{'replyId':_0x4bb2c3,'partIndex':_0x339603});}['_setupTemplate'](){this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed']},'children':this['_createTemplateChildren']()});}['_createTemplateChildren'](){const _0x478c62=this['_createSkeletonLoader']();return[this['_createFeedItems'](),_0x478c62,this['_createFeedLoader']()];}['_createSkeletonLoader'](){const _0x33c8cd=new sr(this['locale'],nr['aiFeed']);return _0x33c8cd['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isLoadingSkeletonVisible','ck-hidden',_0x1ed32f=>!_0x1ed32f)]}}),_0x33c8cd;}['_createFeedItems'](){const _0x1f9b71=new vt(this['locale']);return _0x1f9b71['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed__items',this['bindTemplate']['if']('isLoadingSkeletonVisible','ck-hidden')]},'children':this['children']}),_0x1f9b71;}['_createFeedLoader'](){const _0x226ed9=new vt(this['locale']);return _0x226ed9['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__loader',this['bindTemplate']['if']('isPending','ck-hidden',_0x5b1f44=>!_0x5b1f44)]},'children':this['_createLoaderChildren']()}),_0x226ed9;}['_createLoaderChildren'](){const _0x37c01b=new vn();return _0x37c01b['isVisible']=!0x0,[_0x37c01b,{'tag':'span','attributes':{'class':['ck','ck-ai-chat__loader-text']},'children':[{'text':this['bindTemplate']['to']('loadingMessage')}]}];}['getItemById'](_0x37da45){const _0x27b94e=this['children']['find'](_0x8c5643=>_0x8c5643['options']['id']['includes'](_0x37da45));if(!_0x27b94e)throw new ht('ai-chat-feed-view-item-not-found',this,{'id':_0x37da45});return _0x27b94e;}['setLoadingMessage'](_0x3beea7){this['set']('loadingMessage',_0x3beea7);}['toggleLoadingSkeleton'](_0x1e1662){this['set']('isLoadingSkeletonVisible',_0x1e1662);}['startAutoScroll'](){this['scrollManager']['start']();}['stopAutoScroll'](){this['scrollManager']['stop']();}}class hr extends Dt{['filter'](){let _0x577218=0x0;for(const _0xdf287f of this['items'])_0x577218+=_0xdf287f['items']['length'];return{'resultsCount':_0x577218,'totalItemsCount':_0x577218};}}const cr='ck-ai-chat__prompt-input_highlighted';class lr extends Lt{['submitButtonView'];static ['MIN_ROWS']=0x1;static ['MAX_ROWS']=0xc;['_addContextButtonView'];['_queryViewResizeObserver'];constructor(_0x49c309,_0x3a75c3){super(_0x49c309,{'queryView':{'label':'','creator':Vt,'showIcon':!0x1,'showResetButton':!0x1},'filteredView':new hr(_0x49c309),'queryMinChars':0x1/0x0,'resetOnBlur':!0x1}),this['set']('isEmpty',!0x0),this['set']('isUploadInProgress',!0x1),this['_addContextButtonView']=_0x3a75c3,this['_queryViewResizeObserver']=null,this['queryView']['fieldView']['minRows']=lr['MIN_ROWS'],this['queryView']['fieldView']['maxRows']=lr['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',(_0x29218d,_0x405add)=>!_0x29218d&&!_0x405add),this['focusableChildren']['add'](this['submitButtonView']);}['render'](){super['render'](),this['queryView']['fieldWrapperChildren']['add'](this['submitButtonView']),this['keystrokes']['set']('enter',(_0x3f5b99,_0x444eca)=>{this['isUploadInProgress']||this['isEmpty']||_0x3f5b99['target']==this['queryView']['fieldView']['element']&&(this['submit'](),_0x444eca());}),this['queryView']['fieldView']['on']('update',()=>{this['isEmpty']=''===this['queryView']['fieldView']['element']['value']?.['trim']();});}['destroy'](){super['destroy'](),this['_queryViewResizeObserver']&&this['_queryViewResizeObserver']['destroy']();}['submit'](){const _0x1c1fee=this['queryView']['fieldView']['element']['value']?.['trim']();if(!_0x1c1fee)return this['queryView']['errorText']=us(this['locale'],'AI_CHAT_PROMPT_EMPTY_ERROR'),void(this['queryView']['fieldView']['hasError']=!0x0);this['queryView']['fieldView']['hasError']=!0x1;const _0x5ac5b7=_0x575f0b(_0x1c1fee);this['fire']('sendUserMessage',_0x5ac5b7),this['queryView']['fieldView']['reset']();}['setPlaceholderText'](_0x130b7a){this['queryView']['fieldView']['set']('placeholder',_0x130b7a);}['focus'](_0x1823e3=!0x1){super['focus'](),_0x1823e3&&(this['element']['classList']['contains'](cr)||(this['element']['classList']['add'](cr),setTimeout(()=>{this['element']['classList']['remove'](cr);},0x320)));}['_createSubmitButton'](){const _0x193d8c=new Nt(this['locale']);return _0x193d8c['set']({'icon':_0x44c7fc,'label':us(this['locale'],'AI_CHAT_LABEL_SUBMIT'),'isVisible':!0x0,'tooltip':!0x0,'class':'ck-ai-chat__prompt-submit-button\x20'+ds,'isEnabled':!0x1}),_0x193d8c['on']('execute',()=>{this['submit']();}),_0x193d8c;}['setIsUploadInProgress'](_0x3bb18a){this['isUploadInProgress']=_0x3bb18a;}['_setUpAddContextButtonPositioning'](){const _0x1c84b7=this['locale'],_0x4954bb=()=>{lt['window']['requestAnimationFrame'](()=>{if(ut(this['element'])){const _0x3d8cfc=new dt(this['queryView']['fieldView']['element']),_0x5f6814=new dt(this['_addContextButtonView']['element']),_0x2e3551=_0x3d8cfc['width'],_0x26aff8='rtl'===_0x1c84b7['uiLanguageDirection']?'right':'left';_0x3d8cfc['excludeScrollbarsAndBorders']();const _0x2af005=_0x2e3551-_0x3d8cfc['width']+0x1;this['_addContextButtonView']['element']['style'][_0x26aff8]='calc('+(_0x2e3551-_0x5f6814['width']-_0x2af005)+'px\x20-\x20var(--ck-spacing-tiny))';}});};this['queryView']['fieldView']['on']('update',_0x4954bb),this['on']('render',()=>{_0x4954bb(),this['_queryViewResizeObserver']=new St(this['queryView']['fieldView']['element'],()=>{_0x4954bb();});});}}const ur='ck-ai-chat__prompt-capabilities',dr='ck-ai-chat-controls-button',_r='ck-ai-chat-controls-button--commands',Ar='ck-ai-chat-controls__model-selection',gr='ck-ai-chat-controls__model-selection__item-name',Ir='ck-ai-chat-controls__model-selection__item-description',Er='ck-ai-chat-controls__model-selection__item-capabilities',pr='n';class Tr extends vt{['_webSearchButton'];['_reasoningButton'];['_commandsButton'];['_modelSelectionDropdown'];['_modelSelectionDropdownItems'];['_modelNameView'];constructor(_0x20245f){super(_0x20245f),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',_0x7f2e82=>'selector'===_0x7f2e82),this['_modelSelectionDropdown']['buttonView']['bind']('tooltip')['to'](this,'modelSelectorEnabled',_0x42b234=>_0x42b234?this['_modelSelectionDropdown']['buttonView']['label']:us(this['locale'],'AI_CHAT_MODEL_SELECTOR_DISABLED_TOOLTIP')),this['_modelSelectionDropdown']['bind']('isEnabled')['to'](this,'modelSelectorEnabled',_0x52a779=>_0x52a779),this['_webSearchButton']['bind']('isOn')['to'](this,'webSearchActive',_0x2afdd8=>_0x2afdd8),this['_webSearchButton']['bind']('tooltip')['to'](this,'webSearchActive',_0x175df4=>us(this['locale'],_0x175df4?'AI_CHAT_DISABLE_WEB_SEARCH':'AI_CHAT_ENABLE_WEB_SEARCH')),this['_reasoningButton']['bind']('isOn')['to'](this,'reasoningActive',_0x33f479=>_0x33f479),this['_reasoningButton']['bind']('tooltip')['to'](this,'reasoningActive',_0x4dc9ce=>us(this['locale'],_0x4dc9ce?'AI_CHAT_DISABLE_REASONING':'AI_CHAT_ENABLE_REASONING')),this['setTemplate']({'tag':'div','attributes':{'class':[ur]},'children':[this['_modelSelectionDropdown'],this['_modelNameView'],this['_webSearchButton'],this['_reasoningButton'],this['_commandsButton']]}),this['_modelSelectionDropdownItems']=new _t(),jt(this['_modelSelectionDropdown'],this['_modelSelectionDropdownItems']);}['setModelList'](_0x20295f,_0x3286ed){if(_0x3286ed)this['set']('modelDisplayMode','hidden');else{const _0xc7bdf0=0x1===_0x20295f['length'];this['set']('modelDisplayMode',_0xc7bdf0?'name':'selector');}if(this['_modelSelectionDropdownItems']['clear'](),_0x20295f?.['length'])for(const _0x14c306 of _0x20295f){const _0x38884d=new Jt({'label':_0x14c306['name'],'withText':!0x0,'role':'menuitemradio','id':_0x14c306['id'],'model':_0x14c306});_0x38884d['bind']('isOn')['to'](this,'activeModelId',_0x4dd341=>_0x4dd341===_0x14c306['id']),this['_modelSelectionDropdownItems']['add']({'type':'button','model':_0x38884d,'labelView':new mr(this['locale'],_0x14c306)});}}['setWebSearch'](_0x7f0f6b){this['set']('webSearchActive',_0x7f0f6b);}['setReasoning'](_0x5853e2){this['set']('reasoningActive',_0x5853e2);}['setModel'](_0x17d0e7){if(!_0x17d0e7)return;this['activeModelId']=_0x17d0e7['id'],this['activeModelName']=_0x17d0e7['name']||_0x17d0e7['id'],this['_modelSelectionDropdown']['buttonView']['set']('label',_0x17d0e7['name']),this['_modelSelectionDropdown']['buttonView']['set']('tooltip',_0x17d0e7['name']);const _0x39f5bb=_0x17d0e7['capabilities']['webSearch']?.['enabled']??!0x1;this['set']('webSearchActive',!0x1),this['_webSearchButton']['set']('isOn',!0x1),this['_webSearchButton']['set']('isEnabled',_0x39f5bb),this['_webSearchButton']['set']('isVisible',_0x39f5bb);const _0x2a4e41=_0x17d0e7['capabilities']['reasoning']?.['enabled']??!0x1;this['set']('reasoningActive',!0x1),this['_reasoningButton']['set']('isOn',!0x1),this['_reasoningButton']['set']('isEnabled',_0x2a4e41),this['_reasoningButton']['set']('isVisible',_0x2a4e41);}['enableModelSelector'](){this['set']('modelSelectorEnabled',!0x0);}['disableModelSelector'](_0x5a7fc9){this['set']('modelSelectorEnabled',!0x1),_0x5a7fc9&&this['set']('modelDisplayMode','hidden');}['_createWebSearchButton'](){const _0x3b366d=new Nt();return _0x3b366d['set']({'label':us(this['locale'],'AI_CHAT_SEARCH_WEB'),'icon':_0x6e68f0,'class':dr+'\x20'+As,'isToggleable':!0x0,'tooltipPosition':pr}),_0x3b366d['on']('execute',()=>{this['fire']('toggleWebSearch');}),_0x3b366d;}['_createReasoningButton'](){const _0x1315c1=new Nt();return _0x1315c1['set']({'label':us(this['locale'],'AI_CHAT_REASONING'),'icon':_0x1b9751,'class':dr+'\x20'+As,'isToggleable':!0x0,'tooltipPosition':pr}),_0x1315c1['on']('execute',()=>{this['fire']('toggleReasoning');}),_0x1315c1;}['_createCommandsButton'](){const _0x52c2b3=new Nt();return _0x52c2b3['set']({'label':us(this['locale'],'AI_CHAT_COMMANDS'),'icon':_0x1b4f0d,'withText':!0x0,'class':dr+'\x20'+As,'isToggleable':!0x0,'tooltip':us(this['locale'],'AI_CHAT_COMMANDS'),'tooltipPosition':pr}),_0x52c2b3['extendTemplate']({'attributes':{'class':[_r]}}),_0x52c2b3['on']('execute',()=>{console['log']('Commands\x20are\x20not\x20implemented\x20yet.'),alert('Commands\x20are\x20not\x20implemented\x20yet.');}),_0x52c2b3;}['_createModelSelectionDropdown'](){const _0x4b7f8f=Gt(this['locale']);return _0x4b7f8f['set']({'panelPosition':'ne','class':[Ar]}),_0x4b7f8f['buttonView']['set']({'label':us(this['locale'],'AI_CHAT_MODEL_SELECTOR_ENABLED_TOOLTIP'),'withText':!0x0,'tooltip':!0x0,'tooltipPosition':pr,'class':As}),this['listenTo'](_0x4b7f8f,'execute',_0x458519=>{this['fire']('selectModel',_0x458519['source']['model']);}),_0x4b7f8f;}['_createModelNameView'](){const _0x1be957=new Cr(this['locale']);return _0x1be957['bind']('text')['to'](this,'activeModelName',_0x3ba334=>_0x3ba334??''),_0x1be957['bind']('isVisible')['to'](this,'modelDisplayMode',_0x512d0f=>'name'===_0x512d0f),_0x1be957;}}let mr=class extends Mt{constructor(_0x30cef9,_0x17b77f){super();const _0x201019=this['bindTemplate'],_0xd20100=this['createCollection']();this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-button__label'],'style':_0x201019['to']('style'),'id':_0x201019['to']('id')},'children':[{'tag':'div','attributes':{'class':[gr]},'children':[{'text':_0x201019['to']('text')}]},{'tag':'div','attributes':{'class':[Ir]},'children':[{'tag':'span','children':[{'text':_0x17b77f['description']}]}]},{'tag':'div','attributes':{'class':[Er]},'children':_0xd20100}]}),_0xd20100['addMany'](this['_getCapabilityParts'](_0x30cef9,_0x6e68f0,'AI_CHAT_SEARCH_WEB',_0x17b77f['capabilities']['webSearch']?.['enabled']??!0x1)),_0xd20100['addMany'](this['_getCapabilityParts'](_0x30cef9,_0x1b9751,'AI_CHAT_REASONING',_0x17b77f['capabilities']['reasoning']?.['enabled']??!0x1));}['_getCapabilityParts'](_0x3d17c3,_0xe6d04d,_0x461012,_0x5d685d){const _0xd2f8f9=new xt();_0xd2f8f9['content']=_0xe6d04d;const _0x5c80f2=new vt(_0x3d17c3);_0x5c80f2['setTemplate']({'tag':'span','children':[{'text':us(_0x3d17c3,_0x461012)+':\x20'}]});const _0x217bda=new vt(_0x3d17c3);return _0x217bda['setTemplate']({'tag':'span','children':[{'text':us(_0x3d17c3,_0x5d685d?'AI_CHAT_CAPABILITIES_YES':'AI_CHAT_CAPABILITIES_NO')}]}),[_0xd2f8f9,_0x5c80f2,_0x217bda];}},Cr=class extends vt{constructor(_0x2a42a1){super(_0x2a42a1),this['set']('text',void 0x0),this['set']('isVisible',!0x0);const _0x1fed84=this['bindTemplate'];this['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai-chat-controls__model-name',_0x1fed84['if']('isVisible','ck-hidden',_0x58ef82=>!_0x58ef82)]},'children':[{'text':_0x1fed84['to']('text')}]});}};const wr='ck-ai-chat-context-controls__url-form',fr='ck-ai-chat-context-controls__url-input-section';class Sr extends vt{['focusTracker'];['keystrokes'];['_focusables'];['focusCycler'];['urlInputField'];['backButton'];['confirmButton'];constructor(_0x17134a){super(_0x17134a),this['focusTracker']=new At(),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'](_0x1569a8=>{this['focusTracker']['add'](_0x1569a8['element']),this['keystrokes']['listenTo'](_0x1569a8['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'](_0x1767a4){this['urlInputField']['errorText']=_0x1767a4,this['_updateConfirmButtonState'](),this['fire']('refreshBalloon');}['clearError'](){this['urlInputField']['errorText']=null,this['_updateConfirmButtonState']();}['_createBackButton'](){const _0x391743=new Nt(this['locale']);return _0x391743['set']({'icon':_0x10fb63,'tooltip':us(this['locale'],'AI_CHAT_CONTEXT_URL_BACK_TO_CONTEXT'),'tooltipPosition':'n','class':['ck-button-icon\x20ck-button-back']}),this['on']('change:withBackButton',(_0x1904c8,_0x356fd6,_0x50ea38)=>{_0x391743['set']({'class':['ck-button-icon\x20ck-button-back'+(_0x50ea38?'':'\x20ck-hidden')]});}),_0x391743;}['_createUrlInputField'](){const _0x191391=new te(this['locale'],_0x1e478d);return _0x191391['set']({'label':us(this['locale'],'AI_CHAT_CONTEXT_URL_LABEL'),'class':'ck-labeled-field-view_empty'}),_0x191391['fieldView']['set']({'placeholder':us(this['locale'],'AI_CHAT_CONTEXT_URL_PLACEHOLDER')}),_0x191391;}['_createConfirmButton'](){const _0x2c09f6=new Nt(this['locale']);return _0x2c09f6['set']({'icon':_0x27f2cb,'tooltip':us(this['locale'],'AI_CHAT_CONTEXT_URL_ADD_URL'),'tooltipPosition':'n','class':'ck-button-icon','type':'submit','isEnabled':!0x1}),_0x2c09f6;}['_setupTemplate'](){const _0x589f28=new _0x3e3394(this['locale'],{'label':us(this['locale'],'AI_CHAT_CONTEXT_URL_ADD_URL'),'class':'ck-ai-header\x20ck-ai-header_small\x20ck-ai-header_context-url'});_0x589f28['children']['add'](this['backButton'],0x0),this['setTemplate']({'tag':'form','attributes':{'class':wr,'tabindex':'-1'},'children':[_0x589f28,{'tag':'div','attributes':{'class':fr},'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',_0x4bbeb5=>{_0x4bbeb5['stop'](),this['_handleSubmit']();});}['_setupKeystrokes'](){this['keystrokes']['set']('esc',(_0x4c1a01,_0x4c7721)=>{this['clear'](),this['fire']('cancel'),_0x4c7721();});}['_handleSubmit'](){const _0x1754da=this['getValue']()['trim']();_0x1754da?this['_isValidUrl'](_0x1754da)?(this['clearError'](),this['fire']('submitUrl',_0x1754da)):this['setError'](us(this['locale'],'AI_CHAT_CONTEXT_URL_INVALID_ERROR')):this['setError'](us(this['locale'],'AI_CHAT_CONTEXT_URL_EMPTY_ERROR'));}['_updateConfirmButtonState'](){const _0x298a37=this['getValue']()['trim'](),_0x152cf7=!!this['urlInputField']['errorText'];this['confirmButton']['isEnabled']=_0x298a37['length']>0x0&&!_0x152cf7;}['_isValidUrl'](_0x2cecc2){try{return!!new URL(_0x2cecc2);}catch{return!0x1;}}}const br='ck-ai-chat-resources__item',Rr='ck-ai-chat-resources__item--in-context',Or='ck-ai-chat-resources__item-title',kr='ck-ai-chat-resources__item__icon';class Nr extends Ht{['resource'];['_titleView'];['_iconView'];constructor(_0x3ff7c2,_0x135a2c){super(_0x3ff7c2),this['resource']=_0x135a2c,this['set']('isInContext',!!_0x135a2c['isInContext']),this['_titleView']=this['_createTitleView'](),this['_iconView']=this['_createIconView'](),this['_setupTemplate']();}['render'](){super['render']();}['getResourceIcon'](_0x2b59a0){if(_0x2b59a0['isInContext'])return _0x27f2cb;switch(_0x2b59a0['type']){case Us['DOCUMENT']:return _0x397866;case Us['URL']:return _0x4b626c;case Us['FILE']:case Us['TEXT']:return _0x2f082a;default:return _0x2d5691;}}['highlightText'](_0x12c32f){if(!_0x12c32f||''===_0x12c32f['trim']())return void this['_titleView']['highlightText'](null);const _0x332a4f=new RegExp(_0x1b6061(_0x12c32f),'gi');this['_titleView']['highlightText'](_0x332a4f);}['updateResourceState'](_0x268ad4){this['resource']['isInContext']=_0x268ad4,this['isInContext']=_0x268ad4,this['_updateIcon']();}['_createTitleView'](){const _0x2ff347=new _0x159fa8();return _0x2ff347['text']=this['resource']['label'],_0x2ff347['extendTemplate']({'tag':'span','attributes':{'class':[Or]}}),_0x2ff347;}['_createIconView'](){const _0xe60b15=new xt();return _0xe60b15['content']=this['getResourceIcon'](this['resource']),_0xe60b15;}['_setupTemplate'](){const _0x144f57=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':[br,_0x144f57['if']('isVisible','ck-hidden',_0x4424f6=>!_0x4424f6),_0x144f57['if']('isInContext',Rr)]},'children':[{'tag':'div','attributes':{'class':[kr]},'children':[this['_iconView']]},this['_titleView']],'on':{'click':_0x144f57['to']('execute')}});}['_updateIcon'](){this['_iconView']['content']=this['getResourceIcon'](this['resource']);}}const vr='ck-ai-chat-resources__list';class yr extends Dt{['_source'];constructor(_0x1dde74,_0x1c768c){super(_0x1dde74),this['_source']=_0x1c768c,this['extendTemplate']({'attributes':{'class':[vr]}});}['setResources'](_0x2501c9,_0x5b120b){this['items']['clear']();let _0x45ddf0=_0x2501c9;if(this['_source']['useDefaultFiltering']&&_0x5b120b&&''!==_0x5b120b['trim']()){const _0x320811=new RegExp(_0x5b120b['replace'](/[.*+?^${}()|[\]\\]/g,'\x5c$&'),'gi');_0x45ddf0=_0x2501c9['filter'](_0x4124cc=>_0x320811['test'](_0x4124cc['label']));}for(const _0x15dc92 of _0x45ddf0){const _0x3492e3=new Nr(this['locale'],_0x15dc92);_0x3492e3['on']('execute',()=>{this['_handleResourceSelection'](this['_source'],_0x15dc92);}),this['items']['add'](_0x3492e3);}this['_source']['useDefaultFiltering']&&this['highlightText'](_0x5b120b);}['highlightText'](_0x17dd56){this['_source']['useDefaultFiltering']&&this['items']['forEach'](_0xa56001=>{_0xa56001['highlightText'](_0x17dd56);});}['updateResourceState'](_0x45b24a,_0x23b459){for(const _0x26ea3c of this['items']){const _0x20bdae=_0x26ea3c;_0x20bdae['resource']['id']===_0x45b24a&&_0x20bdae['updateResourceState'](_0x23b459);}}['_handleResourceSelection'](_0x5a3901,_0x50efb3){this['fire']('addResourceToContext',{'source':_0x5a3901,'resource':_0x50efb3});}}class xr extends te{['iconView'];['resetButtonView'];['_viewConfig'];constructor(_0x62157c){const t=_0x62157c['t'],_0x2f83e0={'showResetButton':!0x0,'showIcon':!0x0,'creator':_0x1e478d,'label':us(_0x62157c,'AI_CHAT_SEARCH_RESOURCES')};super(_0x62157c,_0x2f83e0['creator']),this['label']=_0x2f83e0['label'],this['_viewConfig']=_0x2f83e0,this['_viewConfig']['showIcon']&&this['_setupSearchIcon'](),this['_viewConfig']['showResetButton']&&this['_setupResetButton'](_0x62157c,t),this['_setupEventListeners']();}['reset'](){this['fieldView']['reset'](),this['_viewConfig']['showResetButton']&&this['resetButtonView']&&(this['resetButtonView']['isVisible']=!0x1),this['search']('');}['search'](_0x37c49d){this['fire']('search',_0x37c49d);}['getQuery'](){return this['fieldView']['element']?.['value']||'';}['_setupSearchIcon'](){this['iconView']=new xt(),this['iconView']['content']=_0x2827ef,this['fieldWrapperChildren']['add'](this['iconView'],0x0),this['extendTemplate']({'attributes':{'class':'ck-search__query_with-icon'}});}['_setupResetButton'](_0x33d2b9,t){this['resetButtonView']=new Nt(_0x33d2b9),this['resetButtonView']['set']({'label':t('Clear'),'icon':_0x3523ed,'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',_0x29f49d=>!_0x29f49d),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 Lr extends vt{['_searchView'];['_searchSection'];['_searchInputVisibleFrom'];['_resourcesListView'];['_skeletonLoader'];['_source'];['children'];['_latestLoadResourcesUid']=null;constructor(_0x339e77,_0x4b77d8){super(_0x339e77),this['_source']=_0x4b77d8['source'],this['_searchInputVisibleFrom']=_0x4b77d8['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 _0x54be0e([this['_skeletonLoader'],this['_resourcesListView']]),this['setTemplate']({'tag':'div','attributes':{'class':'ck-ai-chat-resources'},'children':this['children']});}['_createSearchView'](){return new xr(this['locale']);}['_createSearchSection'](){const _0x1d5f82=new vt(this['locale']);return _0x1d5f82['setTemplate']({'tag':'div','attributes':{'class':'ck\x20ck-search'},'children':[this['_searchView']]}),this['_searchView']['on']('search',(_0x291225,_0x4eb280)=>{this['loadResources'](_0x4eb280),this['_source']['useDefaultFiltering']&&this['_resourcesListView']['highlightText'](_0x4eb280);}),_0x1d5f82;}['_createResourcesListView'](){const _0x4a2a36=new yr(this['locale'],this['_source']);return _0x4a2a36['delegate']('addResourceToContext')['to'](this),_0x4a2a36['extendTemplate']({'attributes':{'class':this['bindTemplate']['if']('isLoading','ck-hidden')}}),_0x4a2a36;}['_createSkeletonView'](){const _0x7c346d=new sr(this['locale'],nr['aiChatResources']);return _0x7c346d['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isLoading','ck-hidden',_0x1e1af7=>!_0x1e1af7)]}}),_0x7c346d;}['render'](){super['render'](),this['loadResources']('');}['loadResources'](_0xd534a8){const _0x558558=ot();this['_latestLoadResourcesUid']=_0x558558,this['fire']('loadSourceResources',{'sourceId':this['_source']['id'],'query':_0xd534a8,'uid':_0x558558}),this['isLoading']=!0x0;}['setResources'](_0x6d8ee9,_0xfd1437){if(_0xfd1437&&_0xfd1437!==this['_latestLoadResourcesUid'])return;const _0x3d0bee=this['_source']['useDefaultFiltering']?this['_searchView']['getQuery']():'';this['_resourcesListView']['setResources'](_0x6d8ee9,_0x3d0bee),_0x6d8ee9['length']>=this['_searchInputVisibleFrom']&&!this['children']['has'](this['_searchSection'])&&this['children']['add'](this['_searchSection'],0x0),requestAnimationFrame(()=>{this['isLoading']=!0x1;});}['updateResourceState'](_0x1be9ce,_0x2a4e35){this['_resourcesListView']['updateResourceState'](_0x1be9ce,_0x2a4e35);}}const Dr='ck-ai-chat-context-controls__source-balloon-panel',Pr='ck-button-icon\x20ck-button-back',Hr='ck-ai-header\x20ck-ai-header_small\x20ck-ai-header_source';class Mr{['_sourceResourceBalloons']=new Map();['_bodyCollection'];['_locale'];['_config'];constructor(_0x23c7e9,_0x1f3aae,_0x51820c){this['_locale']=_0x23c7e9,this['_bodyCollection']=_0x1f3aae,this['_config']=_0x51820c;}['showSourceResourcesBalloon']({source:_0xe6429a,withBackButton:_0x5e0f29}){let _0x44064f=this['_sourceResourceBalloons']['get'](_0xe6429a['id']);_0x44064f||(_0x44064f=this['_createSourceResourceBalloonPanel'](),this['_sourceResourceBalloons']['set'](_0xe6429a['id'],_0x44064f),this['_setupSingleResourceBalloonClickOutsideHandler'](_0x44064f)),this['_addSourceResourceContent']({'balloonPanel':_0x44064f,'source':_0xe6429a,'withBackButton':_0x5e0f29}),_0x44064f['show']();const _0x444d57=this['_config']['getTargetElement']();_0x444d57&&_0x44064f['pin']({'target':_0x444d57,'limiter':this['_config']['getLimiterElement']()});}['populateSourceResourceBalloon'](_0x275a3c,_0xd97fed,_0x362c73){const _0x4eb2ad=this['_sourceResourceBalloons']['get'](_0x275a3c);if(!_0x4eb2ad)return;const _0x424a47=this['_getResourcesViewFromBalloon'](_0x4eb2ad);_0x424a47&&(_0x424a47['setResources'](_0xd97fed,_0x362c73),_0x424a47['once']('change:isLoading',()=>{_0x4eb2ad['pin']({'target':this['_config']['getTargetElement'](),'limiter':this['_config']['getLimiterElement']()});}));}['closeSourceResourceBalloon'](_0x41290b){const _0x573e09=this['_sourceResourceBalloons']['get'](_0x41290b);_0x573e09&&requestAnimationFrame(()=>{_0x573e09['hide'](),this['_sourceResourceBalloons']['delete'](_0x41290b),this['_config']['onBalloonClosed']();});}['isAnyResourceBalloonVisible'](){for(const _0x4377ca of this['_sourceResourceBalloons']['values']())if(_0x4377ca['isVisible'])return!0x0;return!0x1;}['updateResourceState'](_0x1398da,_0x2ca387,_0x1e1380){const _0x376935=this['_sourceResourceBalloons']['get'](_0x1398da);if(!_0x376935||!_0x376935['isVisible'])return;const _0x100b01=this['_config']['getTargetElement']();if(!_0x100b01)return;_0x376935['pin']({'target':_0x100b01,'limiter':this['_config']['getLimiterElement']()});const _0x15b44f=this['_getResourcesViewFromBalloon'](_0x376935);_0x15b44f&&_0x15b44f['updateResourceState'](_0x2ca387,_0x1e1380);}['destroy'](){for(const _0x16311c of this['_sourceResourceBalloons']['values']())_0x16311c['destroy']();this['_sourceResourceBalloons']['clear']();}['_createSourceResourceBalloonPanel'](){const _0x5286a8=new Xt(this['_locale']);return _0x5286a8['extendTemplate']({'attributes':{'class':Dr}}),this['_bodyCollection']['add'](_0x5286a8),_0x5286a8;}['_addSourceResourceContent']({balloonPanel:_0x3beff2,source:_0x452a85,withBackButton:_0x1c1415}){_0x3beff2['content']['clear']();const _0x1e504a=this['_createBalloonHeader']({'balloonPanel':_0x3beff2,'source':_0x452a85,'withBackButton':_0x1c1415});_0x3beff2['content']['add'](_0x1e504a);const _0x3c3aac=this['_createBalloonResourcesView'](_0x452a85);_0x3beff2['content']['add'](_0x3c3aac);}['_createBalloonHeader']({balloonPanel:_0x4d4944,source:_0x52ae78,withBackButton:_0x5702cc}){const _0x371dd9=new _0x3e3394(this['_locale'],{'label':_0x52ae78['label'],'class':Hr});return _0x5702cc&&_0x371dd9['children']['add'](this['_createBackButton'](_0x4d4944),0x0),_0x371dd9;}['_createBackButton'](_0x2c7d20){const _0x43b545=new Nt(this['_locale']);return _0x43b545['set']({'icon':_0x10fb63,'tooltip':us(this['_locale'],'AI_CHAT_CONTEXT_URL_BACK_TO_CONTEXT'),'tooltipPosition':'n','class':Pr}),_0x43b545['on']('execute',()=>{_0x2c7d20['hide'](),this['_config']['onBackToContext']();}),_0x43b545;}['_createBalloonResourcesView'](_0x1791ef){const _0x3a55ed=new Lr(this['_locale'],{'source':_0x1791ef,'searchInputVisibleFrom':this['_config']['searchInputVisibleFrom']});return _0x3a55ed['on']('loadSourceResources',(_0x28eaac,_0x50424a)=>{this['_config']['onLoadSourceResources'](_0x50424a);}),_0x3a55ed['on']('addResourceToContext',(_0x4a98e9,_0x4591f0)=>{this['_config']['onResourceSelected'](_0x4591f0['source'],_0x4591f0['resource']),this['closeSourceResourceBalloon'](_0x1791ef['id']);}),_0x3a55ed;}['_getResourcesViewFromBalloon'](_0x1db4d7){const _0x51b5eb=_0x1db4d7['content']['get'](0x1);return _0x51b5eb instanceof Lr?_0x51b5eb:null;}['_setupSingleResourceBalloonClickOutsideHandler'](_0x129290){zt({'emitter':_0x129290,'contextElements':[_0x129290['element']],'callback':()=>{_0x129290['hide'](),this['_config']['onBalloonClosed']();},'activator':()=>_0x129290['isVisible']});}}const Ur=['addDocumentToContext','addFileToContext','addUrlToContext','addResourceToContext','removeContextItem','loadSourceResources','executeCustomItemCallback'],Vr='ck-ai-chat-context-controls',Br='ck-ai-chat-context-controls__pending-contexts',Gr='ck-ai-chat-context-controls__add-context-balloon-panel',Fr='ck-ai-chat-context-controls__add-context-button',Kr='ck-ai-chat-context-controls__url-balloon-panel',Wr='ck-ai-chat-context-controls__balloon-button',Yr='ck-ai-chat-context-controls__balloon-button-source',$r='ck-ai-chat-controls-button',qr='ck-ai-chat-context-chips-wrapper-balloon',Qr='ck-ai-chat-controls_context_show-more-button',Xr='ck-ai-chat-context-controls__show-more-balloon-panel',zr='ck-ai-chat',jr=[Xt['defaultPositions']['northArrowSouthWest'],Xt['defaultPositions']['northArrowSouth'],Xt['defaultPositions']['northArrowSouthEast'],Xt['defaultPositions']['southArrowNorthWest'],Xt['defaultPositions']['southArrowNorth'],Xt['defaultPositions']['southArrowNorthEast']];class Jr extends vt{['addContextButtonView'];['_currentContextsChips']=this['createCollection']();['_conversationContextsChips']=this['createCollection']();['_overflowManager'];['_addContextBalloonPanelView'];['_urlBalloonPanelView'];['_urlInputView'];['_resourcesBalloonView'];['_addContextBalloonConfig'];['_hasExactlyOneSource']=!0x1;['bodyCollection'];constructor(_0x3c6887,_0x1806ee){super(_0x3c6887),this['bodyCollection']=_0x1806ee['bodyCollection'],this['_currentContextsChips']=this['createCollection'](),this['_conversationContextsChips']=this['createCollection'](),this['addContextButtonView']=this['_createAddContextButtonView'](_0x3c6887),this['_addContextBalloonPanelView']=this['_createAddContextBalloonPanelView'](_0x3c6887),this['_urlBalloonPanelView']=this['_createUrlBalloonPanelView'](_0x3c6887),this['_resourcesBalloonView']=this['_createResourcesBalloonView'](_0x3c6887,_0x1806ee);const _0x296669={'cssClasses':{'showMoreButton':Qr+'\x20'+As,'showMoreBalloon':Xr,'overflowContainer':qr,'controlsButton':$r}};this['_overflowManager']=new Kn(_0x3c6887,this['_currentContextsChips'],_0x296669,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'](_0x5e2cc1,_0x1ba08a){const _0x4438e1=this['_createContextButton'](_0x5e2cc1,'current',!0x0,_0x1ba08a);this['_addContextToCollection'](_0x4438e1,this['_currentContextsChips']),this['_overflowManager']['reorganizeChips']();}['removeContextItem'](_0x3a0545){this['_removeContextFromCollection'](_0x3a0545,this['_currentContextsChips']),this['_removeContextFromCollection'](_0x3a0545,this['_overflowManager']['overflowChips']),this['_overflowManager']['reorganizeChips']();}['setContextItemLoading'](_0x396c19,_0x5ee62c){let _0x39e79d=this['_currentContextsChips']['find'](_0x115fb1=>_0x115fb1['id']===_0x396c19);_0x39e79d||(_0x39e79d=this['_overflowManager']['overflowChips']['find'](_0x219d66=>_0x219d66['id']===_0x396c19)),_0x39e79d&&(_0x39e79d['isLoading']=_0x5ee62c);}['setConversationContext'](_0x52b72f){this['_conversationContextsChips']['clear']();for(const _0x5aa912 of _0x52b72f){const _0x20fa39=this['_createContextButton'](_0x5aa912,'conversation',!0x1,!0x1);this['_addContextToCollection'](_0x20fa39,this['_conversationContextsChips']);}}['clearCurrentContextItems'](){this['_currentContextsChips']['clear'](),this['_overflowManager']['clear']();}['clearConversationContextItems'](){this['_conversationContextsChips']['clear']();}['updateResourceState'](_0x1597a5,_0x18f659,_0x1b0a6f){this['_resourcesBalloonView']['updateResourceState'](_0x1597a5,_0x18f659,_0x1b0a6f);}['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:_0x334718,withBackButton:_0x5e422e}){this['_resourcesBalloonView']['showSourceResourcesBalloon']({'source':_0x334718,'withBackButton':_0x5e422e}),this['addContextButtonView']['isOn']=!0x0;}['populateSourceResourceBalloon'](_0x5bcb0f,_0x1909a3,_0x566a50,_0x530b9f){this['_resourcesBalloonView']['populateSourceResourceBalloon'](_0x5bcb0f,_0x566a50,_0x530b9f);}['closeSourceResourceBalloon'](_0xe163d9){this['_resourcesBalloonView']['closeSourceResourceBalloon'](_0xe163d9),this['addContextButtonView']['isOn']=!0x1;}['setAddContextOptions'](_0x25ef34){this['_setBalloonPanelContent'](this['_addContextBalloonPanelView'],this['locale'],_0x25ef34),this['_setAddContextButtonEnabled'](_0x25ef34);}['_setAddContextButtonEnabled'](_0x9ea987){const _0x33928b=!_0x9ea987['document']['isHidden']&&_0x9ea987['document']['enabled'],_0x4bc4aa=_0x9ea987['urls']['enabled'],_0x5a4555=_0x9ea987['files']['enabled'],_0x6000ea=_0x9ea987['sources']['length']>0x0,_0x23e985=_0x9ea987['customItems']&&_0x9ea987['customItems']['length']>0x0;this['addContextButtonView']['isEnabled']=_0x33928b||_0x4bc4aa||_0x5a4555||_0x6000ea||_0x23e985;}['_setupTemplate'](){this['setTemplate']({'tag':'div','attributes':{'class':[Vr,'ck-reset_all-excluded']},'children':[{'tag':'div','attributes':{'class':Br},'children':this['_currentContextsChips']}]});}['_bindEventHandlers'](){this['addContextButtonView']['on']('execute',()=>{this['_handleAddContextButtonClick']();});}['_createAddContextButtonView'](_0x46ea02){const _0x3e0765=new Nt(_0x46ea02);return _0x3e0765['set']({'label':us(_0x46ea02,'AI_CHAT_CONTEXT_ADD_CONTEXT'),'class':$r+'\x20'+Fr+'\x20'+As,'icon':_0x2202a6,'isToggleable':!0x0,'tooltip':!0x0,'tooltipPosition':'sw'}),_0x3e0765;}['_createAddContextBalloonPanelView'](_0x247384){return this['_createBaseBalloonPanel'](_0x247384,Gr);}['_createUrlBalloonPanelView'](_0x4fe21c){const _0x439a76=this['_createBaseBalloonPanel'](_0x4fe21c,Kr);return this['_addUrlContent'](_0x439a76,_0x4fe21c),_0x439a76;}['_createResourcesBalloonView'](_0x2fa7c4,_0x51d118){const _0x4b2017={'searchInputVisibleFrom':_0x51d118['searchInputVisibleFrom'],'onBackToContext':()=>{this['showAddContextBalloonPanel'](),this['_addContextBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':jr});},'onResourceSelected':(_0x66d548,_0x3ae692)=>{this['fire']('addResourceToContext',{'source':_0x66d548,'resource':_0x3ae692});},'onLoadSourceResources':_0x501a1f=>{this['fire']('loadSourceResources',_0x501a1f);},'onBalloonClosed':()=>{this['addContextButtonView']['isOn']=!0x1;},'getLimiterElement':()=>this['_getLimiterElement'](),'getTargetElement':()=>this['addContextButtonView']['element']};return new Mr(_0x2fa7c4,_0x51d118['bodyCollection'],_0x4b2017);}['_getLimiterElement'](){return this['element']?.['closest']('.'+zr)||document['body'];}['_createBaseBalloonPanel'](_0x50fdb9,_0x3f3f59){const _0xdfc6c=new Xt(_0x50fdb9);return _0xdfc6c['extendTemplate']({'attributes':{'class':_0x3f3f59}}),this['bodyCollection']['add'](_0xdfc6c),_0xdfc6c;}['_setBalloonPanelContent'](_0x33427f,_0x6cd654,_0x3c1557){if(_0x33427f['content']['clear'](),!_0x3c1557['document']['isHidden']&&_0x3c1557['document']['enabled']){const _0x33627f=this['_createBalloonButton'](_0x6cd654,{'label':us(_0x6cd654,'AI_CHAT_CONTEXT_CURRENT_DOCUMENT'),'icon':_0x397866});_0x33627f['on']('execute',()=>{this['fire']('addDocumentToContext'),this['hideAddContextBalloonPanel']();}),_0x33427f['content']['add'](_0x33627f);}if(_0x3c1557['urls']['enabled']){const _0x3be07a=this['_createBalloonButton'](_0x6cd654,{'label':us(_0x6cd654,'AI_CHAT_CONTEXT_URL_LABEL'),'icon':_0x4b626c});_0x3be07a['on']('execute',()=>{this['hideAddContextBalloonPanel'](),this['showUrlBalloonPanel'](),this['_urlBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':jr}),this['_urlInputView']['focus']();}),_0x33427f['content']['add'](_0x3be07a);}if(_0x3c1557['files']['enabled']){const _0x1bcf75=new _0x2e6eb4(_0x6cd654);_0x1bcf75['set']({'label':us(_0x6cd654,'AI_CHAT_CONTEXT_FILE_LABEL'),'icon':_0x38431d,'withText':!0x0,'tooltip':!0x0,'class':Wr,'allowMultipleFiles':!0x0}),_0x1bcf75['on']('execute',()=>{this['hideAddContextBalloonPanel']();}),_0x1bcf75['on']('done',(_0x27c51c,_0x3625fb)=>{this['fire']('addFileToContext',_0x3625fb);}),_0x1bcf75['tooltip']=!0x0,_0x33427f['content']['add'](_0x1bcf75);}for(const _0x4aa6d2 of _0x3c1557['sources']){const _0x36ca2e=this['_createBalloonButton'](_0x6cd654,{'label':_0x4aa6d2['label'],'icon':_0x4aa6d2['icon']||_0x2d5691,'type':'source'});_0x33427f['content']['add'](_0x36ca2e),_0x36ca2e['on']('execute',()=>{this['hideAddContextBalloonPanel'](),this['_showSourceResourcesBalloon']({'source':_0x4aa6d2,'withBackButton':!this['_hasExactlyOneSource']});});}for(const _0x2f7702 of _0x3c1557['customItems']||[]){const _0x4a0439=this['_createBalloonButton'](_0x6cd654,{'label':_0x2f7702['label'],'icon':_0x2f7702['icon']||_0x2d5691,'type':'customItem'});_0x33427f['content']['add'](_0x4a0439),_0x4a0439['on']('execute',()=>{this['hideAddContextBalloonPanel'](),this['fire']('executeCustomItemCallback',_0x2f7702);});}this['_hasExactlyOneSource']=0x1===_0x33427f['content']['length'],this['_urlInputView']['withBackButton']=!this['_hasExactlyOneSource'];}['_addUrlContent'](_0x3d9388,_0x216dcb){this['_urlInputView']=new Sr(_0x216dcb),this['_urlInputView']['on']('submitUrl',(_0x3d558e,_0x35f8ac)=>{this['_handleUrlSubmit'](_0x35f8ac);}),this['_urlInputView']['on']('cancel',()=>{this['hideUrlBalloonPanel'](),this['_hasExactlyOneSource']||(this['showAddContextBalloonPanel'](),this['_addContextBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':jr}));}),this['_urlInputView']['on']('refreshBalloon',()=>{this['_urlBalloonPanelView']['isVisible']&&this['_urlBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':jr});}),_0x3d9388['content']['add'](this['_urlInputView']);}['_createBalloonButton'](_0x52a50b,_0x3630ed){const _0x285dc9='source'===_0x3630ed['type']?new Zr(_0x52a50b):new Nt(_0x52a50b);return _0x285dc9['set']({'label':_0x3630ed['label'],'icon':_0x3630ed['icon'],'withText':!0x0,'tooltip':!0x0,'tooltipPosition':'sw','class':Wr}),_0x285dc9;}['_setupAllBalloonClickOutsideHandlers'](){this['_setupAddContextBalloonClickOutsideHandler'](),this['_setupUrlBalloonClickOutsideHandler']();}['_setupUrlBalloonClickOutsideHandler'](){zt({'emitter':this['_urlBalloonPanelView'],'contextElements':[this['_urlBalloonPanelView']['element']],'callback':()=>{this['hideUrlBalloonPanel']();},'activator':()=>this['_urlBalloonPanelView']['isVisible']});}['_toggleAddContextBalloon'](_0xa5c785){const _0x57141c=this['_addContextBalloonConfig'];_0x57141c['buttonView']['isOn']=_0xa5c785,_0xa5c785?_0x57141c['balloonView']['show']():_0x57141c['balloonView']['hide']();}['_setupAddContextBalloonClickOutsideHandler'](){const {balloonView:_0x15eb35,buttonView:_0x45e14d,hideMethod:_0x3534cf}=this['_addContextBalloonConfig'];zt({'emitter':_0x15eb35,'contextElements':[_0x15eb35['element'],_0x45e14d['element']],'callback':()=>{_0x3534cf();},'activator':()=>_0x45e14d['isOn']&&!this['_urlBalloonPanelView']['isVisible']&&!this['_resourcesBalloonView']['isAnyResourceBalloonVisible']()});}['_createContextButton'](_0x334ab6,_0x7f857,_0x1e6c8f=!0x1,_0x5600d6=!0x1){const _0x41ec12='conversation'===_0x7f857||!0x0===_0x334ab6['isReadOnly'],_0x556964=new Vn(this['locale'],_0x334ab6,_0x41ec12,_0x1e6c8f,_0x5600d6);return _0x41ec12||_0x556964['on']('removeContextItemChip',()=>{this['fire']('removeContextItem',_0x556964['id']);}),_0x556964;}['_addContextToCollection'](_0x4960ec,_0x3057ea){_0x3057ea['add'](_0x4960ec,0x0);}['_removeContextFromCollection'](_0x368ab2,_0xe540ac){const _0x53e242=_0xe540ac['find'](_0x276482=>_0x276482['id']===_0x368ab2);_0x53e242&&_0xe540ac['remove'](_0x53e242);}['_handleAddContextButtonClick'](){this['addContextButtonView']['isOn']?this['hideAddContextBalloonPanel']():(this['showAddContextBalloonPanel'](),this['_addContextBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':jr}),this['_hasExactlyOneSource']&&this['_addContextBalloonPanelView']['content']['get'](0x0)?.['fire']('execute'));}['_handleUrlSubmit'](_0x1f51c2){this['_urlInputView']['clear'](),this['hideUrlBalloonPanel'](),this['fire']('addUrlToContext',_0x1f51c2);}}class Zr extends Nt{['arrowView'];constructor(_0x52ba8b){super(_0x52ba8b),this['set']({'withText':!0x0,'role':'menuitem'}),this['arrowView']=this['_createArrowView'](),this['extendTemplate']({'attributes':{'class':[Yr]}});}['render'](){super['render'](),this['children']['add'](this['arrowView']);}['_createArrowView'](){const _0x34bea5=new xt();return _0x34bea5['content']=_0x2fb5d2,_0x34bea5['extendTemplate']({'attributes':{'class':Yr+'__arrow'}}),_0x34bea5;}}class ta extends vt{['_cancelButtonView'];['_loaderView'];constructor(_0x4dc242){super(_0x4dc242),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 _0x25ec6f=new Nt(this['locale']);return _0x25ec6f['set']({'label':us(this['locale'],'AI_CHAT_STOP_GENERATING'),'withText':!0x0,'class':_s+'\x20ck-ai-button-stop-generating','icon':_0x251c48}),_0x25ec6f['on']('execute',()=>{this['fire']('abortPromptStream');}),_0x25ec6f;}['_createLoaderView'](){const _0x1f6809=new vt(this['locale']);return _0x1f6809['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':us(this['locale'],'AI_CHAT_IS_WRITING')}]}),_0x1f6809;}}class ea extends vt{['_contextPanelView'];['_promptInputView'];['_promptCapabilitiesView'];['_loaderView'];['_modelUnavailableMessageView'];['_shouldRestorePromptInputFocus'];constructor(_0xae3082,_0x175eae){super(_0xae3082),this['_contextPanelView']=this['_createContextPanelView'](_0xae3082,{'bodyCollection':_0x175eae['bodyCollection'],'searchInputVisibleFrom':_0x175eae['contextResourcesSearchInputVisibleFrom']}),this['_promptInputView']=this['_createPromptInputView'](_0xae3082),this['_promptCapabilitiesView']=this['_createPromptCapabilitiesView'](_0xae3082),this['_loaderView']=this['_createLoaderView'](_0xae3082),this['_modelUnavailableMessageView']=this['_createModelUnavailableMessageView'](_0xae3082),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'](...Ur)['to'](this),this['set']('isModelAvailable',!0x0),this['set']('isDisabled',!0x1);const _0x3deffb=this['bindTemplate'];this['setTemplate']({'tag':'form','attributes':{'class':['ck','ck-ai-chat-controls',_0x3deffb['if']('isDisabled','ck-ai-chat-controls-disabled')]},'children':[{'tag':'div','attributes':{'class':[_0x3deffb['if']('isLoading','ck-hidden',_0x1e2462=>_0x1e2462||!this['isModelAvailable']),_0x3deffb['if']('isModelAvailable','ck-hidden',_0x33a614=>!_0x33a614||this['isLoading'])]},'children':[this['_contextPanelView'],this['_promptInputView'],this['_promptCapabilitiesView']]},{'tag':'div','attributes':{'class':[_0x3deffb['if']('isLoading','ck-hidden',_0x5b3667=>!_0x5b3667)]},'children':[this['_loaderView']]},{'tag':'div','attributes':{'class':[_0x3deffb['if']('isModelAvailable','ck-hidden',_0x3a26ff=>_0x3a26ff)]},'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'](_0x1c3a60,_0x169bfa){return new Jr(_0x1c3a60,_0x169bfa);}['_createPromptInputView'](_0x2401a6){return new lr(_0x2401a6,this['_contextPanelView']['addContextButtonView']);}['_createPromptCapabilitiesView'](_0x354495){return new Tr(_0x354495);}['_createLoaderView'](_0x32571b){return new ta(_0x32571b);}['_createModelUnavailableMessageView'](_0x4e0acd){const _0x398050=new ia(_0x4e0acd);return _0x398050['delegate']('startConversation')['to'](this),_0x398050;}['_handlePromptInputFocus'](_0x4f540d,_0x27d3b5,_0x17626c){_0x17626c?this['_shouldRestorePromptInputFocus']=!0x0:this['_shouldRestorePromptInputFocus']&&this['_promptInputView']['focus']();}['addContextItem'](_0x453a6f,_0x175a2f){this['_contextPanelView']['addContextItem'](_0x453a6f,_0x175a2f);}['removeContextItem'](_0x4e3a9f){this['_contextPanelView']['removeContextItem'](_0x4e3a9f);}['setContextItemLoading'](_0xe047cb,_0x476a7e){this['_contextPanelView']['setContextItemLoading'](_0xe047cb,_0x476a7e);}['setIsUploadInProgress'](_0x3d8060){this['_promptInputView']['setIsUploadInProgress'](_0x3d8060);}['setConversationContext'](_0x3138cf){this['_contextPanelView']['setConversationContext'](_0x3138cf);}['clearPendingContextUI'](){this['_contextPanelView']['clearCurrentContextItems']();}['clearConversationContextUI'](){this['_contextPanelView']['clearConversationContextItems']();}['updateResourceState'](_0x131274,_0x4fd419,_0x371713){this['_contextPanelView']['updateResourceState'](_0x131274,_0x4fd419,_0x371713);}['setWebSearch'](_0x49d3d9){this['_promptCapabilitiesView']['setWebSearch'](_0x49d3d9);}['setReasoning'](_0x502f82){this['_promptCapabilitiesView']['setReasoning'](_0x502f82);}['resetMessageInput'](){this['_promptInputView']['reset']();}['setAddContextOptions'](_0x158f6a){this['_contextPanelView']['setAddContextOptions'](_0x158f6a);}['setInputPlaceholder'](_0x373093){this['_promptInputView']['setPlaceholderText'](_0x373093);}['setModelList'](_0x3b2f0c,_0x2ca9f0){this['_promptCapabilitiesView']['setModelList'](_0x3b2f0c,_0x2ca9f0);}['setModel'](_0x1c1be0){_0x1c1be0?(this['isModelAvailable']=!0x0,this['_promptCapabilitiesView']['setModel'](_0x1c1be0)):this['isModelAvailable']=!0x1;}['enableModelSelector'](){this['_promptCapabilitiesView']['enableModelSelector']();}['disableModelSelector'](_0x2fbdf5){this['_promptCapabilitiesView']['disableModelSelector'](_0x2fbdf5);}['populateSourceResourceBalloon'](_0xa992a6,_0x4805ee,_0x17131e,_0x3c8869){this['_contextPanelView']['populateSourceResourceBalloon'](_0xa992a6,_0x4805ee,_0x17131e,_0x3c8869);}['closeSourceResourceBalloon'](_0x46a735){this['_contextPanelView']['closeSourceResourceBalloon'](_0x46a735);}['focusPromptInput'](_0x5b9cf9=!0x1){this['_promptInputView']['focus'](_0x5b9cf9);}['setPromptInputValue'](_0x454669){this['_promptInputView']['queryView']['fieldView']['reset'](),this['_promptInputView']['queryView']['fieldView']['value']=_0x454669;}}class ia extends vt{constructor(_0x5a61d1){super(_0x5a61d1);const _0x42bfa8=new Nt(_0x5a61d1);_0x42bfa8['set']({'label':us(this['locale'],'AI_CHAT_MODEL_UNAVAILABLE_MESSAGE_BUTTON'),'withText':!0x0,'class':['ck-ai-chat-controls__start-new-chat-button'],'tooltip':''}),_0x42bfa8['delegate']('execute')['to'](this,'startConversation'),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat-controls-model-unavailable-message']},'children':[{'tag':'p','children':[{'text':us(this['locale'],'AI_CHAT_MODEL_UNAVAILABLE_MESSAGE_TEXT')+'\x20'},_0x42bfa8]}]});}}class sa extends _0x3e3394{['conversationStartButton'];['resizeButton'];constructor(_0x1c5b91,_0x3dc004){super(_0x1c5b91,{'label':us(_0x1c5b91,'AI_CHAT_HEADING'),'class':'ck-ai-header\x20ck-ai-header_chat','icon':_0x17727b}),this['set']('isMaximized',!0x1),this['conversationStartButton']=this['_createStartConversationButton'](_0x1c5b91),this['children']['add'](this['conversationStartButton']),_0x3dc004&&(this['resizeButton']=gs(_0x1c5b91,this),this['children']['add'](this['resizeButton']));}['_createStartConversationButton'](_0x138e5f){const _0x24aaa5=new Nt(_0x138e5f);return _0x24aaa5['set']({'label':us(this['locale'],'AI_CHAT_LABEL_NEW_CHAT'),'withText':!0x0,'icon':_0x152924,'class':'ck-ai-chat__start-conversation\x20'+_s}),_0x24aaa5['on']('execute',()=>{this['fire']('startConversation');}),_0x24aaa5;}}class na extends vt{constructor(_0x218274){super(_0x218274),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-disclaimer']},'children':[{'tag':'p','attributes':{'class':['ck','ck-ai-disclaimer__content']},'children':[{'text':us(_0x218274,'AI_DISCLAIMER_TEXT')}]}]});}}class ra extends vt{['chatHeader'];['chatFeed'];['chatControls'];['chatDisclaimer'];['_bodyCollection'];constructor(_0x11f8d8,_0x4a3d55){super(_0x11f8d8),this['_bodyCollection']=new Qt(_0x11f8d8),this['_bodyCollection']['attachToDom'](),this['chatHeader']=new sa(_0x11f8d8,_0x4a3d55['showResizeButton']),this['chatHeader']['delegate'](...sn)['to'](this),this['chatFeed']=new or(_0x11f8d8,this['_bodyCollection']),this['chatFeed']['delegate'](...sn)['to'](this),this['chatControls']=new ea(_0x11f8d8,{'bodyCollection':this['_bodyCollection'],'contextResourcesSearchInputVisibleFrom':_0x4a3d55['contextResourcesSearchInputVisibleFrom']}),this['chatControls']['delegate'](...sn)['to'](this),this['chatDisclaimer']=new na(_0x11f8d8),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset_all','ck-ai-chat','ck-rounded-corners'],'dir':_0x11f8d8['uiLanguageDirection']},'children':[this['chatHeader'],this['chatFeed'],this['chatControls'],this['chatDisclaimer']]});}['populateSourceResourceBalloon'](_0x1fdfc6,_0x5e413c,_0x1621e9,_0x24ccb9){this['chatControls']['populateSourceResourceBalloon'](_0x1fdfc6,_0x5e413c,_0x1621e9,_0x24ccb9);}['closeSourceResourceBalloon'](_0x480b1a){this['chatControls']['closeSourceResourceBalloon'](_0x480b1a);}['destroy'](){this['_bodyCollection']['detachFromDom'](),super['destroy']();}}class aa extends _0x3397b8{static get['requires'](){return[cs];}['_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(_0x2a0289){super(_0x2a0289);const _0x33ca5a=this['context']['plugins']['get']('AITabs');this['set']('isBusy',!0x1),this['_promiseQueue']=new mn(),this['_view']=new ra(this['context']['locale'],{'showResizeButton':_0x33ca5a['showResizeButton'],'contextResourcesSearchInputVisibleFrom':this['context']['config']['get']('ai.chat.context.searchInputVisibleFrom')}),this['_view']['delegate'](...sn)['to'](this),this['_view']['on']('toggleSuggestionDisplayMode',(_0x2f1c80,{showDiff:_0x4327d7})=>{this['showDiff']=_0x4327d7;}),_0x33ca5a['view']['addTab']({'id':'chat','buttonLabel':us(this['context']['locale'],'AI_CHAT_HEADING'),'buttonIcon':_0x17727b,'order':0x0,'content':this['_view']}),this['_view']['chatControls']['bind']('isLoading')['to'](this,'isBusy',_0xa6a1ec=>_0xa6a1ec),this['_view']['chatFeed']['bind']('isPending')['to'](this,'isBusy',_0x518b8d=>_0x518b8d),this['_view']['chatControls']['setInputPlaceholder'](this['_getInputPlaceholder']()),this['bind']('isModelAvailable')['to'](this['_view']['chatControls'],'isModelAvailable');}['destroy'](){super['destroy'](),this['_titleAnimationInterval']&&clearInterval(this['_titleAnimationInterval']);}['createConversation'](_0x5dfa6d){const _0x331bc9=this['context']['config']['get']('ai.chat.welcomeMessage')??us(this['context']['locale'],'AI_CHAT_WELCOME_MESSAGE');this['_view']['chatFeed']['clear'](),this['_view']['chatControls']['enableModelSelector'](),this['_view']['chatControls']['setModelList'](_0x5dfa6d['availableModels'],!this['context']['config']['get']('ai.models.showModelSelector')),this['addFeedItemStaticMessage']({'id':'conversation-start','staticMessage':_0x331bc9}),this['fire']('conversationCreated');}async['addFeedItemStaticMessage']({id:_0x1f15de,staticMessage:_0x59d471}){return this['_promiseQueue']['enqueue'](async()=>{this['_view']['chatFeed']['addItem']('ai-reply',{'id':_0x1f15de,'initialContent':'<p>'+_0x59d471+'</p>'});});}async['addFeedItemUserMessage'](_0xf70232){const _0x38fb7a=_0xf70232['attributes']?.['displayedPrompt']||_0xf70232['userMessage'];return this['_promiseQueue']['enqueue'](async()=>{this['_view']['chatFeed']['addItem']('user-message',{'contextItems':Array['from'](_0xf70232['contextItems']['values']()),'initialContent':'<p>'+_0x38fb7a+'</p>','id':_0xf70232['id']});});}async['addFeedItemError']({errorMessage:_0x4ec623,id:_0x33f045}){return this['_promiseQueue']['enqueue'](async()=>{this['_view']['chatFeed']['addItem']('error-message',{'initialContent':'<p>'+_0x4ec623+'</p>','id':_0x33f045});});}async['addFeedItemAIReply'](_0x56e4b3){return this['_promiseQueue']['enqueue'](async()=>{this['_view']['chatFeed']['addItem']('ai-reply',{'id':_0x56e4b3['interactionId']+':'+_0x56e4b3['id']}),this['clearLoadingMessage']();});}async['addFeedItemAISuggestion'](_0x4f2f76){const _0x33e2f0=Xs(this['context']);let _0x4cbbe9=_0x33e2f0['config']['get']('ai.availableReplyActions')||[...wn];if(_0x33e2f0['plugins']['has']('TrackChanges')){if(!this['_isTrackChangesCommandValueBound']){this['_isTrackChangesCommandValueBound']=!0x0;const _0x3caba0=_0x33e2f0['commands']['get']('trackChanges');this['_view']['chatFeed']['bind']('isTrackChangesOn')['to'](_0x3caba0,'value');}}else _0x4cbbe9=_0x4cbbe9['filter'](_0x72b79b=>'insertSuggestion'!=_0x72b79b);return this['_promiseQueue']['enqueue'](async()=>{this['_view']['chatFeed']['addItem']('ai-suggestion-reply',{'id':_0x4f2f76['interactionId']+':'+_0x4f2f76['id'],'areActionsDisabled':_0x4f2f76['areActionsDisabled'],'showDiff':this['showDiff'],'availableActions':_0x4cbbe9}),this['clearLoadingMessage']();});}async['addFeedInteractionHeader'](_0x480523,_0xebf089){return this['_promiseQueue']['enqueue'](async()=>{const _0x2ae484=this['_view']['chatFeed']['children']['last'];if(_0x2ae484 instanceof Jn)return this['_view']['chatFeed']['children']['remove'](_0x2ae484),void this['_view']['chatFeed']['addItem']('interaction-header',{'id':_0x480523['id'],'capabilities':{'isWebSearchEnabled':_0x2ae484['capabilities']['isWebSearchEnabled']||_0xebf089['isWebSearchEnabled'],'isReasoningEnabled':_0x2ae484['capabilities']['isReasoningEnabled']||_0xebf089['isReasoningEnabled']}});this['_view']['chatFeed']['addItem']('interaction-header',{'id':_0x480523['id'],'capabilities':_0xebf089});});}async['addFeedItemCustomElement'](_0x18f626,_0x4891b0){let _0x581608;return await this['_promiseQueue']['enqueue'](async()=>{_0x581608=this['_view']['chatFeed']['addItem']('custom-element',{'content':_0x18f626,'id':_0x4891b0});}),_0x581608;}['removeFeedItem'](_0x270d26){this['_view']['chatFeed']['removeItem'](_0x270d26);}['hasFeedItem'](_0x35c735){return this['_view']['chatFeed']['hasItem'](_0x35c735);}['updateFeedInteractionHeader'](_0xc15ffd){const _0x430fd0=this['_view']['chatFeed']['children']['find'](_0x455ced=>_0x455ced['options']['id']==_0xc15ffd['id']&&_0x455ced instanceof Jn);_0x430fd0&&_0x430fd0['set']('isVisible',_0xc15ffd['isVisible']);}async['updateFeedItemAIReplyContent'](_0x306da9){const _0x39cba3=_0x306da9['renderingStrategy']||this['feedItemRenderingStrategy'];return this['_promiseQueue']['enqueue'](async _0x54c7fd=>{await this['_view']['chatFeed']['updateReplyItem']({..._0x306da9,'abortSignal':_0x54c7fd,'renderingStrategy':_0x39cba3}),_0x306da9['isDone']&&this['markFeedItemAsDone'](_0x306da9['id']);});}['updateFeedItemAIReplySources'](_0x21cf69,_0x56cc2b){this['_view']['chatFeed']['updateWebSources'](_0x21cf69,_0x56cc2b);}async['updateFeedItemAIReplySuggestionContent'](_0x16d514){const _0x5b4a30=_0x16d514['renderingStrategy']||this['feedItemRenderingStrategy'];return this['_promiseQueue']['enqueue'](async _0x20497f=>{await this['_view']['chatFeed']['updateSuggestionItem']({..._0x16d514,'abortSignal':_0x20497f,'renderingStrategy':_0x5b4a30}),_0x16d514['isDone']&&this['markFeedItemAsDone'](_0x16d514['id']);});}['updateFeedItemAIReplySuggestionPartState'](_0x3bff1){this['_view']['chatFeed']['updateSuggestionPartState'](_0x3bff1);}['setFeedItemAIReplySuggestionPartActive'](_0x586090){this['_view']['chatFeed']['setSuggestionPartActive'](_0x586090);}['markFeedItemAsDone'](_0xcc5632){this['_view']['chatFeed']['markItemAsDone'](_0xcc5632);}['removeFeedInteraction'](_0x759641){this['_view']['chatFeed']['getItemIds']()['filter'](_0x52dccc=>_0x52dccc['startsWith'](_0x759641))['forEach'](_0x2fe4aa=>this['_view']['chatFeed']['removeItem'](_0x2fe4aa));}['startInteraction'](){const _0xc18933=this['prepareLoadingMessage']({'isWebSearchEnabled':!0x1,'isReasoningEnabled':!0x1});this['setLoadingMessage'](_0xc18933),this['_view']['chatControls']['disableModelSelector'](!this['context']['config']['get']('ai.models.showModelSelector')),this['isBusy']=!0x0,this['_view']['chatFeed']['startAutoScroll']();}['stopInteraction'](_0x8e26a9){this['_promiseQueue']['abort'](),this['_view']['chatFeed']['getItemIds']()['filter'](_0x365c1f=>_0x365c1f['startsWith'](_0x8e26a9['id']))['forEach'](_0x3e869e=>this['markFeedItemAsDone'](_0x3e869e)),this['isBusy']=!0x1,this['_view']['chatFeed']['stopAutoScroll']();}async['finishInteraction'](){return this['_promiseQueue']['queueEmptyPromise']['then'](()=>{this['isBusy']=!0x1,this['_view']['chatFeed']['stopAutoScroll']();});}['addContextItem'](_0x18e325,_0x189dbd){this['_view']['chatControls']['addContextItem'](_0x18e325,_0x189dbd);}['removeContextItem'](_0x235d6a){this['_view']['chatControls']['removeContextItem'](_0x235d6a);}['setContextItemLoading'](_0x32e1e2,_0x3918e7){this['_view']['chatControls']['setContextItemLoading'](_0x32e1e2,_0x3918e7);}['setIsUploadInProgress'](_0x17a63d){this['_view']['chatControls']['setIsUploadInProgress'](_0x17a63d);}['setConversationContext'](_0x54b172){this['_view']['chatControls']['setConversationContext'](_0x54b172);}['clearPendingContextUI'](){this['_view']['chatControls']['clearPendingContextUI']();}['clearConversationContextUI'](){this['_view']['chatControls']['clearConversationContextUI']();}['updateResourceState'](_0x15affd,_0x2cf38a,_0x1cd098){this['_view']['chatControls']['updateResourceState'](_0x15affd,_0x2cf38a,_0x1cd098);}['resetMessageInput'](){this['_view']['chatControls']['resetMessageInput'](),this['_view']['chatControls']['setInputPlaceholder'](this['_getInputPlaceholder']());}['setAddContextOptions'](_0xcb1d7c){this['_view']['chatControls']['setAddContextOptions'](_0xcb1d7c);}['updateCapabilities'](_0x2fc1fc){this['_view']['chatControls']['setWebSearch'](_0x2fc1fc['isWebSearchEnabled']),this['_view']['chatControls']['setReasoning'](_0x2fc1fc['isReasoningEnabled']),this['_view']['chatControls']['setInputPlaceholder'](this['_getInputPlaceholder'](_0x2fc1fc));}['setSelectedModel'](_0x5d568d,_0x26308d){this['_view']['chatControls']['setModel'](_0x5d568d),_0x26308d&&this['_view']['chatControls']['disableModelSelector'](!0x1);}['setFeedItemRenderingStrategy'](_0x3908ce){this['feedItemRenderingStrategy']=_0x3908ce;}['toggleLoadingSkeleton'](_0x382eeb){this['_view']['chatFeed']['toggleLoadingSkeleton'](_0x382eeb);}['resetConversationTitle'](){this['setConversationTitle'](us(this['context']['locale'],'AI_CHAT_HEADING'));}['setConversationTitle'](_0x5b4f4a,_0x1759bd=!0x1){if(_0x1759bd&&!bt()&&_0x5b4f4a['length'])return this['_view']['chatHeader']['label']='',void this['_animateConversationTitle'](_0x5b4f4a);this['_view']['chatHeader']['label']=_0x5b4f4a;}['setLoadingMessage'](_0x11d521){this['_view']['chatFeed']['setLoadingMessage'](_0x11d521);}['clearLoadingMessage'](){this['_view']['chatFeed']['setLoadingMessage']('');}['_animateConversationTitle'](_0x266f21){let _0x2ceb82=0x0;clearInterval(this['_titleAnimationInterval']),this['_titleAnimationInterval']=setInterval(()=>{this['_view']['chatHeader']['label']=this['_view']['chatHeader']['label']+_0x266f21[_0x2ceb82],_0x2ceb82++,_0x2ceb82===_0x266f21['length']&&clearInterval(this['_titleAnimationInterval']);},0x1e);}['setIsMaximized'](_0x247bac){this['_view']['chatHeader']['isMaximized']=_0x247bac;}['prepareLoadingMessage'](_0x5cf058){return _0x5cf058['isWebSearchEnabled']&&_0x5cf058['isReasoningEnabled']?us(this['context']['locale'],'AI_CHAT_FEED_LOADING_MESSAGE_WEBSEARCH_REASONING'):_0x5cf058['isWebSearchEnabled']?us(this['context']['locale'],'AI_CHAT_FEED_LOADING_MESSAGE_WEBSEARCH'):_0x5cf058['isReasoningEnabled']?us(this['context']['locale'],'AI_CHAT_FEED_LOADING_MESSAGE_REASONING'):us(this['context']['locale'],'AI_CHAT_FEED_LOADING_MESSAGE_REGULAR');}['_getInputPlaceholder'](_0x753360){return _0x753360?_0x753360['isWebSearchEnabled']&&_0x753360['isReasoningEnabled']?us(this['context']['locale'],'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_WEBSEARCH_REASONING'):_0x753360['isWebSearchEnabled']?us(this['context']['locale'],'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_WEBSEARCH'):_0x753360['isReasoningEnabled']?us(this['context']['locale'],'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_REASONING'):us(this['context']['locale'],'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_REGULAR'):us(this['context']['locale'],'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_REGULAR');}['populateSourceResourceBalloon'](_0x59e651,_0x3d61f1,_0x31c7e0,_0x3cee67){this['_view']['populateSourceResourceBalloon'](_0x59e651,_0x3d61f1,_0x31c7e0,_0x3cee67);}['closeSourceResourceBalloon'](_0x1d6070){this['_view']['closeSourceResourceBalloon'](_0x1d6070);}['setPromptInputValue'](_0x7490ee){this['_view']['chatControls']['setPromptInputValue'](_0x7490ee);}['focusPromptInput'](_0x37a42c=!0x1){this['_view']['chatControls']['focusPromptInput'](_0x37a42c);}['scrollFeedToSuggestion'](_0x1e0675,_0x33c272){this['_view']['chatFeed']['scrollToSuggestion'](_0x1e0675,_0x33c272);}['startAutoScroll'](){this['_view']['chatFeed']['startAutoScroll']();}['disableControls'](){this['_view']['chatControls']['isDisabled']=!0x0;}['enableControls'](){this['_view']['chatControls']['isDisabled']=!0x1;}}class oa extends Dt{['sections'];constructor(_0x122f7f,_0x1dc197){super(_0x122f7f),this['sections']=_0x1dc197,this['items']['addMany'](this['sections']),this['extendTemplate']({'attributes':{'class':['ck-ai-chat-history__sections']}});}['filter'](_0x42547f){let _0x13ece0=0x0,_0x11b66c=0x0;for(const _0x40f4d2 of this['sections']){const {resultsCount:_0x131f3b,totalItemsCount:_0x153606}=_0x40f4d2['filter'](_0x42547f);_0x13ece0+=_0x131f3b,_0x11b66c+=_0x153606;}return{'resultsCount':_0x13ece0,'totalItemsCount':_0x11b66c};}}class ha extends Ht{['title'];['itemsViews'];['_itemsListView'];constructor(_0x451861,{title:_0x12e728,items:_0x6f6cbd}){super(_0x451861);const _0x174fa4=this['bindTemplate'];this['set']('isVisible',!0x0),this['title']=_0x12e728,this['itemsViews']=_0x6f6cbd;const _0x35d147=new vt(_0x451861);_0x35d147['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-chat-history__section-title']},'children':[this['title']]}),this['_itemsListView']=new Dt(_0x451861),this['_itemsListView']['items']['addMany'](this['itemsViews']),this['setTemplate']({'tag':'li','attributes':{'class':['ck-ai-chat-history__section',_0x174fa4['if']('isVisible','ck-hidden',_0x35df70=>!_0x35df70)]},'children':[_0x35d147,this['_itemsListView']]});}['filter'](_0x4ba211){const _0x5e84b2=this['itemsViews']['length'];let _0x51945d=0x0;for(const _0x483930 of this['itemsViews']){if(_0x4ba211){const _0x408c72=_0x483930['isMatching'](_0x4ba211);_0x483930['isVisible']=!!_0x408c72,_0x483930['highlightText'](_0x4ba211);}else _0x483930['isVisible']=!0x0,_0x483930['highlightText'](null);_0x483930['isVisible']&&_0x51945d++;}return this['isVisible']=_0x51945d>0x0,{'resultsCount':_0x51945d,'totalItemsCount':_0x5e84b2};}['getItem'](_0x3290c0){return this['itemsViews']['find'](_0x366a49=>_0x366a49['id']===_0x3290c0);}['removeItem'](_0x581ac3){const _0x2da154=this['itemsViews']['indexOf'](_0x581ac3);-0x1!==_0x2da154&&(this['itemsViews']['splice'](_0x2da154,0x1),this['_itemsListView']['items']['remove'](_0x581ac3));}}class ca extends/* #__PURE__ -- @preserve */
|
|
27
|
-
_0x16fcf4(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(_0x28f775,_0x494b9e){super(_0x28f775);const _0x37f9ab=this['bindTemplate'];this['set']('isEdit',!0x1),this['set']('isVisible',!0x0),this['set']('pinned',!!_0x494b9e['pinned']),this['set']('loadingState',null),this['id']=_0x494b9e['id'];const {title:_0x3986b2,createdAt:_0x4cd6b0,active:_0x549ddb=!0x1}=_0x494b9e;this['_titleView']=new _0x159fa8(),this['_titleView']['text']=_0x3986b2,this['_titleView']['extendTemplate']({'attributes':{'class':['ck-ai-chat-history__item-title']}});const _0x1d661d=this['_createCheckView'](),_0x4e7aeb=this['_createPinButtonView'](_0x28f775),_0x4930af=this['_createMenuDropdownView'](),_0x4e9b4d=this['_createEditInputView'](_0x28f775,_0x3986b2),_0x494458=this['_createAcceptEditButtonView'](_0x28f775,_0x4e9b4d),_0x8a08e=this['_createCancelEditButtonView'](_0x28f775,_0x4e9b4d);this['actions']=this['createCollection'](),this['mainContent']=this['createCollection'](),this['mainContent']['add'](this['_titleView']),this['actions']['add'](_0x4e7aeb),this['actions']['add'](_0x4930af),this['on']('change:isEdit',(_0x244fa7,_0x3d8cb6,_0x2ffb72)=>{this['actions']['clear'](),this['mainContent']['clear'](),_0x2ffb72?(this['actions']['add'](_0x494458),this['actions']['add'](_0x8a08e),this['mainContent']['add'](_0x4e9b4d),_0x4e9b4d['element']['focus']()):(this['actions']['add'](_0x4e7aeb),this['actions']['add'](_0x4930af),this['mainContent']['add'](this['_titleView']));}),this['setTemplate']({'tag':'li','attributes':{'class':['ck-ai-chat-history__item',_0x549ddb?'ck-ai-chat-history__item--active':'',_0x37f9ab['if']('isVisible','ck-hidden',_0x31cf2c=>!_0x31cf2c),_0x37f9ab['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',_0x37f9ab['if']('loadingState','ck-hidden',_0x2a6d20=>!!_0x2a6d20)]},'children':_0x549ddb?[_0x1d661d]:[]},{'tag':'div','attributes':{'class':['ck-ai-loader',_0x37f9ab['if']('loadingState','ck-hidden',_0x171e99=>!_0x171e99)]},'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',_0x37f9ab['if']('loadingState','ck-hidden',_0x24009e=>!!_0x24009e)]},'children':this['mainContent']},{'tag':'div','attributes':{'class':['ck-ai-loader__text',_0x37f9ab['if']('loadingState','ck-hidden',_0x46d388=>!_0x46d388)]},'children':[{'text':_0x37f9ab['to']('loadingState',_0x1cfb82=>_0x1cfb82?us(this['locale'],ca['LOADING_LABELS'][_0x1cfb82]):'')}]}]},{'tag':'span','attributes':{'class':['ck-ai-chat-history__item-date']},'children':[_0x4cd6b0]}]},{'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'](_0x19eec3){this['_titleView']['text']=_0x575f0b(_0x19eec3);}['updateLoadingState'](_0x319a88,_0xa221a9){this['set']('loadingState',_0xa221a9?_0x319a88:null);}['_createCheckView'](){const _0x2d1f0f=new xt();return _0x2d1f0f['set']({'content':_0x27f2cb}),_0x2d1f0f;}['_createPinButtonView'](_0x1c9074){const _0x16fe91=new Nt(_0x1c9074);return _0x16fe91['set']({'label':us(_0x1c9074,'AI_CHAT_HISTORY_PIN_BUTTON'),'icon':_0x39cfe1,'withText':!0x1,'tooltip':!0x0}),_0x16fe91['bind']('isOn')['to'](this,'pinned'),_0x16fe91['on']('execute',()=>{const _0x375c98=!this['pinned'];this['fire']('setConversationPinned',{'id':this['id'],'pinned':_0x375c98});}),_0x16fe91;}['_createMenuDropdownView'](){const _0x3c2ece=Gt(this['locale'],_0x2acc95),_0x135de9=_0x3c2ece['panelView']['children'];_0x3c2ece['buttonView']['set']({'label':us(this['locale'],'AI_CHAT_HISTORY_SHOW_MORE_ITEMS'),'icon':_0x4da6e4}),_0x3c2ece['panelPosition']='sw';const _0x2026c0=new Nt(this['locale']);_0x2026c0['label']=us(this['locale'],'AI_CHAT_HISTORY_EDIT_NAME'),_0x2026c0['withText']=!0x0,_0x2026c0['on']('execute',()=>{this['isEdit']=!0x0;});const _0xc716f8=new Nt(this['locale']);_0xc716f8['label']=us(this['locale'],'AI_CHAT_HISTORY_REMOVE'),_0xc716f8['withText']=!0x0,_0xc716f8['on']('execute',()=>{this['showConfirm'](us(this['locale'],'AI_CHAT_HISTORY_REMOVE_CONFIRM'),this['element'])['then'](()=>{this['fire']('removeConversation',{'id':this['id']});});});const _0x1937d9=new Dt(this['locale']),_0x87d216=new Ht(this['locale']);_0x87d216['children']['add'](_0x2026c0);const _0x59e5e9=new Ht(this['locale']);return _0x59e5e9['children']['add'](_0xc716f8),_0x1937d9['items']['addMany']([_0x87d216,_0x59e5e9]),_0x135de9['add'](_0x1937d9),_0x3c2ece;}['_createEditInputView'](_0x20d2ea,_0x4a5f5e){const _0x404584=new _0x33f65d(_0x20d2ea),_0x2578aa=_0x404584['bindTemplate'];return _0x404584['value']=_0x4a5f5e,_0x404584['extendTemplate']({'on':{'keydown':_0x2578aa['to'](_0x481166=>{'Enter'==_0x481166['key']&&this['_commitEditInputValue'](_0x404584);})}}),_0x404584;}['_createAcceptEditButtonView'](_0x57cc6e,_0x2ef1d7){const _0x5e0e5f=new Nt(_0x57cc6e);return _0x5e0e5f['set']({'icon':_0x27f2cb,'withText':!0x1,'tooltip':us(_0x57cc6e,'AI_CHAT_HISTORY_ACCEPT')}),_0x5e0e5f['extendTemplate']({'attributes':{'class':['ck-confirm-view-submit']}}),_0x5e0e5f['on']('execute',()=>{this['_commitEditInputValue'](_0x2ef1d7);}),_0x5e0e5f;}['_commitEditInputValue'](_0x3cd953){const _0x442a5a=_0x3cd953['element']['value']||'';this['_titleView']['text']=_0x442a5a,this['isEdit']=!0x1,this['fire']('editConversationTitle',{'id':this['id'],'title':_0x442a5a});}['_createCancelEditButtonView'](_0x3b31da,_0x3ed617){const _0x3a70a0=new Nt(_0x3b31da);return _0x3a70a0['set']({'icon':_0x3523ed,'withText':!0x1,'tooltip':us(_0x3b31da,'AI_CHAT_HISTORY_CANCEL')}),_0x3a70a0['extendTemplate']({'attributes':{'class':['ck-confirm-view-cancel']}}),_0x3a70a0['on']('execute',()=>{this['isEdit']=!0x1,_0x3ed617['value']=this['_titleView']['text']||'',this['fire']('edit:cancel');}),_0x3a70a0;}['_createSpinnerView'](){const _0x171c36=new vn('tiny');return _0x171c36['isVisible']=!0x0,_0x171c36;}['isMatching'](_0x54af68){return this['_titleView']&&'string'==typeof this['_titleView']['text']&&this['_titleView']['text']['match'](_0x54af68)?{'title':!0x0}:null;}['highlightText'](_0x11aa16){this['_titleView']['highlightText'](_0x11aa16);}}class la extends vt{['searchView'];['mainErrorView'];['skeletonView'];['emptyView'];['sectionsView'];['resizeButton'];constructor(_0x1d6f3a,_0x3eefd8){super(_0x1d6f3a),this['set']('hasItems',!0x1),this['set']('isLoading',!0x0),this['set']('errorMessage',''),this['set']('isMaximized',!0x1),this['set']('isSearchViewVisible',!0x1),this['set']('isEmptyViewVisible',!0x1),this['set']('isMainErrorViewVisible',!0x1);const _0x5161a6=new _0x3e3394(_0x1d6f3a,{'label':us(_0x1d6f3a,'AI_CHAT_HISTORY_HEADING'),'icon':_0x468df9,'class':'ck-ai-header\x20ck-ai-header_history'});_0x3eefd8&&(this['resizeButton']=gs(_0x1d6f3a,this),_0x5161a6['children']['add'](this['resizeButton'])),this['sectionsView']=new oa(_0x1d6f3a,[]),this['sectionsView']['delegate'](...ua)['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',_0x5e40d7=>!_0x5e40d7)]}}),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':[_0x5161a6,{'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 _0x402215=new _0x261b76(this['locale'],{'filteredView':this['sectionsView'],'queryView':{'label':us(this['locale'],'AI_CHAT_HISTORY_SEARCH_LABEL')},'infoView':{'text':{'notFound':{'primary':_0x6c10b=>us(this['locale'],'AI_CHAT_HISTORY_SEARCH_NOT_FOUND_PRIMARY',_0x6c10b),'secondary':us(this['locale'],'AI_CHAT_HISTORY_SEARCH_NOT_FOUND_SECONDARY')}}}}),_0x3369dd=this['_createErrorView']();return _0x3369dd['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('errorMessage','ck-hidden',_0x32969c=>!_0x32969c)]}}),_0x402215['on']('render',()=>{_0x402215['children']['add'](_0x3369dd,0x1);}),_0x402215['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isSearchViewVisible','ck-hidden',_0x28933a=>!_0x28933a)]}}),_0x402215;}['_createSkeletonView'](){const _0x2c34d9=new sr(this['locale'],nr['aiHistory']);return _0x2c34d9['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isLoading','ck-hidden',_0x36d26d=>!_0x36d26d)]}}),_0x2c34d9;}['_createErrorView'](){const _0x44a708=new vt(this['locale']),_0x250785=new Nt(this['locale']);_0x250785['set']({'withText':!0x1,'icon':_0x3523ed,'class':'ck-ai-notification_error__dismiss-button'}),_0x250785['bind']('isVisible')['to'](this,'hasItems',_0x4ca9cc=>!!_0x4ca9cc),_0x250785['on']('execute',()=>{this['errorMessage']='';});const _0x49c5b7=this['bindTemplate'];return _0x44a708['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-notification','ck-ai-notification_error']},'children':[{'tag':'p','children':[{'text':_0x49c5b7['to']('errorMessage')}]},_0x250785]}),_0x44a708;}['_createEmptyStateView'](){const _0x291d27=new Nt(this['locale']);_0x291d27['set']({'label':us(this['locale'],'AI_CHAT_LABEL_NEW_CHAT'),'withText':!0x0,'icon':_0x152924,'class':'ck-ai-chat__start-conversation\x20'+_s}),_0x291d27['on']('execute',()=>{this['fire']('openChat');});const _0xb27031=new vt(this['locale']);return _0xb27031['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-chat-history__empty',this['bindTemplate']['if']('isEmptyViewVisible','ck-hidden',_0x1708b7=>!_0x1708b7)]},'children':[{'tag':'p','attributes':{'class':['ck-ai-chat-history__empty-message']},'children':[us(this['locale'],'AI_CHAT_HISTORY_EMPTY_MESSAGE')]},_0x291d27]}),_0xb27031;}['_createListItemViews'](_0x1785d5,_0x598ff7){const _0x49a287=[];for(const _0x4bbaaf of _0x1785d5){const _0xd4bc10=new ca(_0x598ff7,_0x4bbaaf);_0xd4bc10['delegate'](...ua)['to'](this),_0x49a287['push'](_0xd4bc10);}return _0x49a287;}['updateHistoryItemsWithCategories'](_0x5179d7){const _0x576496=this['locale']||'en',_0x150272=[];for(const _0x98e900 of _0x5179d7){const _0x4198c4=this['_createListItemViews'](_0x98e900['items'],_0x576496);_0x150272['push'](new ha(_0x576496,{'title':_0x98e900['title'],'items':_0x4198c4}));}this['sectionsView']['sections']=_0x150272,this['sectionsView']['items']['clear'](),this['sectionsView']['items']['addMany'](_0x150272),this['hasItems']=_0x5179d7['some'](_0x4fd341=>_0x4fd341['items']['length']>0x0),this['_refreshSearch']();}['removeHistoryItem'](_0x1b2844){for(const _0x95f246 of this['sectionsView']['sections']){const _0x1b7a3a=_0x95f246['getItem'](_0x1b2844);if(_0x1b7a3a){if(_0x95f246['removeItem'](_0x1b7a3a),0x0===_0x95f246['itemsViews']['length']){const _0x135392=this['sectionsView']['sections']['indexOf'](_0x95f246);-0x1!==_0x135392&&(this['sectionsView']['sections']['splice'](_0x135392,0x1),this['sectionsView']['items']['remove'](_0x95f246));}this['hasItems']=this['sectionsView']['sections']['length']>0x0,this['_refreshSearch']();break;}}}['updateItemTitle'](_0x359633,_0x1c07b9){for(const _0xc29aed of this['sectionsView']['sections']){const _0x5466a8=_0xc29aed['getItem'](_0x359633);if(_0x5466a8){_0x5466a8['updateTitle'](_0x1c07b9);break;}}}['updateItemLoadingState'](_0xa7b525,_0x1bc86a,_0x3ec317){for(const _0x17d762 of this['sectionsView']['sections']){const _0x54ecac=_0x17d762['getItem'](_0xa7b525);if(_0x54ecac){_0x54ecac['updateLoadingState'](_0x1bc86a,_0x3ec317);break;}}}['_refreshSearch'](){if(this['hasItems']){const _0x13a052=this['searchView']['queryView']['fieldView']?.['element']?.['value']||'';this['searchView']['search'](_0x13a052);}}}const ua=['showConversationHistory','removeConversation','editConversationTitle','setConversationPinned','selectConversation','openChat','resizeTabs'];class da extends _0x3397b8{static get['requires'](){return[cs];}['_historyView'];static get['pluginName'](){return'AIChatHistoryUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x4248b5){super(_0x4248b5);const _0x3e8ba0=this['context']['plugins']['get']('AITabs');this['_historyView']=new la(this['context']['locale'],_0x3e8ba0['showResizeButton']),this['_historyView']['delegate'](...ua)['to'](this),_0x3e8ba0['view']['addTab']({'id':'history','buttonLabel':us(this['context']['locale'],'AI_CHAT_HISTORY_HEADING'),'buttonIcon':_0x468df9,'order':0x0,'content':this['_historyView']});}['removeHistoryItem'](_0x29e592){this['_historyView']['removeHistoryItem'](_0x29e592);}['updateItems'](_0x367e2c){this['_historyView']['updateHistoryItemsWithCategories'](_0x367e2c);}['updateItemTitle'](_0x39d78b,_0x3c244d){this['_historyView']['updateItemTitle'](_0x39d78b,_0x3c244d);}['updateItemLoadingState'](_0x4f5f64,_0xf2cf57,_0x32a72f){this['_historyView']['updateItemLoadingState'](_0x4f5f64,_0xf2cf57,_0x32a72f);}['setLoadingSkeleton'](_0x5da463){this['_historyView']['isLoading']=_0x5da463;}['showError'](_0x332381){this['_historyView']['errorMessage']=_0x332381;}['hideError'](){this['_historyView']['errorMessage']='';}['setIsMaximized'](_0x38f52c){this['_historyView']['isMaximized']=_0x38f52c;}}class _a extends ct(){['id'];['createdAt'];constructor({id:_0x5090e1,title:_0x5de301,createdAt:_0x580af9,updatedAt:_0x5ac62f,pinned:_0x48482d}){super(),this['id']=_0x5090e1,this['createdAt']=new Date(_0x580af9),this['set']('title',_0x5de301),this['set']('updatedAt',_0x5ac62f?new Date(_0x5ac62f):null),this['set']('pinned',_0x48482d||!0x1);}['updateTitle'](_0x536452){this['set']('title',_0x575f0b(_0x536452)),this['updatedAt']=new Date();}['updatePinned'](_0x1c5952){this['set']('pinned',_0x1c5952),this['updatedAt']=new Date();}}class Aa extends pt(){['items']=[];['connector'];['group'];constructor({connector:_0x25f1f0,group:_0x1e8fa9}){super(),this['connector']=_0x25f1f0,this['group']=_0x1e8fa9;}async['init'](){try{const _0x2ea3ad=this['connector']['fetchConversations'](this['group']),_0x12fa9f=await _0x2ea3ad['getConversations']();this['loadItems'](_0x12fa9f);}catch(_0x5cd809){this['fire']('error',{'error':_0x5cd809,'operation':'init'});}}['addItem'](_0x32b663){this['items']['push'](_0x32b663);}async['removeItem'](_0x5f3681){const _0x3b22cd=this['items']['findIndex'](_0x123521=>_0x123521['id']===_0x5f3681);if(-0x1===_0x3b22cd)return!0x1;try{return await this['connector']['deleteConversation'](_0x5f3681)['execute'](),this['items']['splice'](_0x3b22cd,0x1),this['fire']('itemRemoved',{'itemId':_0x5f3681}),!0x0;}catch(_0x586145){return this['fire']('error',{'error':_0x586145,'operation':'removeItem','itemId':_0x5f3681}),!0x1;}}['getItem'](_0x5cfe8a){return this['items']['find'](_0x1895a5=>_0x1895a5['id']===_0x5cfe8a);}async['updateItemTitle'](_0xc869e3,_0x4b4fa7){const _0x31a0f9=this['getItem'](_0xc869e3);if(!_0x31a0f9)return!0x1;try{return await this['connector']['updateConversation'](_0xc869e3,{'title':_0x4b4fa7})['getResult'](),_0x31a0f9['updateTitle'](_0x4b4fa7),this['fire']('itemUpdated',{'itemId':_0xc869e3,'updates':{'title':_0x4b4fa7}}),!0x0;}catch(_0x5130be){return this['fire']('error',{'error':_0x5130be,'operation':'updateItemTitle','itemId':_0xc869e3}),!0x1;}}async['updateItemPinned'](_0x4123c2,_0xab724b){const _0x443f0f=this['getItem'](_0x4123c2);if(!_0x443f0f)return!0x1;try{return await this['connector']['updateConversation'](_0x4123c2,{'pinned':_0xab724b})['getResult'](),_0x443f0f['updatePinned'](_0xab724b),this['fire']('itemUpdated',{'itemId':_0x4123c2,'updates':{'pinned':_0xab724b}}),!0x0;}catch(_0x217093){return this['fire']('error',{'error':_0x217093,'operation':'updateItemPinned','itemId':_0x4123c2}),!0x1;}}['loadItems'](_0x486a39){try{this['items']=[],_0x486a39['map'](_0x1effaf=>{this['addItem'](new _a(_0x1effaf));}),this['fire']('itemsLoaded',{'items':[...this['items']]});}catch(_0x3f7d6b){this['fire']('error',{'error':_0x3f7d6b,'operation':'loadItems'});}}['getItems'](_0x55cfff={}){const _0x12115a=void 0x0!==_0x55cfff['pinned']&&_0x55cfff['pinned'],_0x48efd0=_0x55cfff['from']?new Date(_0x55cfff['from']['getFullYear'](),_0x55cfff['from']['getMonth'](),_0x55cfff['from']['getDate']()):null,_0x2774a8=_0x55cfff['to']?new Date(_0x55cfff['to']['getFullYear'](),_0x55cfff['to']['getMonth'](),_0x55cfff['to']['getDate']()):null;return this['items']['filter'](_0x1fd711=>{if(_0x1fd711['pinned']!==_0x12115a)return!0x1;if(_0x2774a8){const _0x18028c=new Date(_0x1fd711['createdAt']['getFullYear'](),_0x1fd711['createdAt']['getMonth'](),_0x1fd711['createdAt']['getDate']());return _0x48efd0?_0x48efd0['getTime']()===_0x2774a8['getTime']()?_0x18028c['getTime']()===_0x48efd0['getTime']():_0x18028c<_0x2774a8&&_0x18028c>=_0x48efd0:_0x18028c<_0x2774a8;}return!0x0;});}}class ga extends _0x3397b8{['_aiConnector'];['_aiChatHistoryUi'];['_aiChatController'];static get['requires'](){return[ls,Js,da,cs];}static get['pluginName'](){return'AIChatHistoryController';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){this['_aiConnector']=this['context']['plugins']['get'](ls),this['_aiChatHistoryUi']=this['context']['plugins']['get'](da),this['_aiChatController']=this['context']['plugins']['get'](Js);const _0x4b872b=this['context']['plugins']['get'](cs);try{const _0x5ca36a=this['_aiChatController']['getGroupId']();this['history']=new Aa({'connector':this['_aiConnector'],'group':_0x5ca36a}),this['listenTo'](this['_aiChatHistoryUi'],'removeConversation',(_0x188a58,_0x7645c3)=>{this['_setItemLoading'](_0x7645c3['id'],'remove'),this['_handleRemove'](_0x7645c3['id']);}),this['listenTo'](this['_aiChatHistoryUi'],'editConversationTitle',(_0x2afe06,_0x2b8b55)=>{this['_setItemLoading'](_0x2b8b55['id'],'rename'),this['_handleEditTitle'](_0x2b8b55['id'],_0x2b8b55['title']);}),this['listenTo'](this['history'],'itemUpdated',(_0x151e61,_0xdf20)=>{void 0x0!==_0xdf20['updates']['title']&&this['_aiChatHistoryUi']['updateItemTitle'](_0xdf20['itemId'],_0xdf20['updates']['title']),void 0x0!==_0xdf20['updates']['pinned']&&this['_updateHistoryItemsUI'](),this['_clearItemLoading'](_0xdf20['itemId']);}),this['listenTo'](this['history'],'itemRemoved',(_0x1390c1,_0x855916)=>{this['_aiChatController']['_handleRemovedConversation'](_0x855916['itemId']),this['_aiChatHistoryUi']['removeHistoryItem'](_0x855916['itemId']),this['_clearItemLoading'](_0x855916['itemId']);}),this['listenTo'](this['history'],'itemsLoaded',()=>{this['_updateHistoryItemsUI']();}),this['listenTo'](this['history'],'error',(_0x2a8024,_0x36339f)=>{this['_handleHistoryErrorUI'](_0x36339f['error'],_0x36339f['operation'],_0x36339f['itemId']);}),this['listenTo'](this['_aiChatHistoryUi'],'selectConversation',(_0x3a9b44,_0x319848)=>{this['_handleSelectConversation'](_0x319848['id']);}),this['listenTo'](this['_aiChatHistoryUi'],'setConversationPinned',(_0x5406fd,_0x555c75)=>{const _0x4f5353=_0x555c75['pinned']?'pin':'unpin';this['_setItemLoading'](_0x555c75['id'],_0x4f5353),this['_handleTogglePin'](_0x555c75['id'],_0x555c75['pinned']);}),this['listenTo'](this['_aiChatHistoryUi'],'openChat',()=>{_0x4b872b['view']['activateTab']('chat');}),this['listenTo'](this['_aiChatController'],'change:activeConversation',()=>{this['_updateHistoryItemsUI']();}),_0x4b872b['view']['on']('activateTab:history',()=>{this['_showConversationHistory']();}),this['listenTo'](_0x4b872b,'resizedTabs',(_0x3c72cb,_0x494f05)=>{this['_setIsMaximized'](_0x494f05);}),this['listenTo'](this['_aiChatHistoryUi'],'resizeTabs',()=>{_0x4b872b['resize']();});}catch(_0x1deff4){this['_handleHistoryErrorUI'](_0x1deff4,'init');}}async['_handleEditTitle'](_0x4882c2,_0x4882d8){await this['history']['updateItemTitle'](_0x4882c2,_0x4882d8);}async['_handleTogglePin'](_0x43b5b4,_0x42339e){await this['history']['updateItemPinned'](_0x43b5b4,_0x42339e);}async['_handleRemove'](_0xb68b13){await this['history']['removeItem'](_0xb68b13);}async['_handleSelectConversation'](_0x180279){await this['_aiChatController']['loadConversation'](_0x180279);}async['_showConversationHistory'](){this['_aiChatHistoryUi']['showError'](''),this['_aiChatHistoryUi']['setLoadingSkeleton'](!0x0),await this['history']['init'](),this['_aiChatHistoryUi']['setLoadingSkeleton'](!0x1);}['_updateHistoryItemsUI'](){const _0x3404e6=this['_aiChatController']['activeConversation']?.['id'],_0x3c95b8=this['_getCategorizedItems']()['map'](_0x50156c=>({'title':_0x50156c['title'],'items':_0x50156c['items']['map'](_0x62d292=>({'id':_0x62d292['id'],'title':_0x62d292['title']||us(this['context']['locale'],'AI_CHAT_UNTITLED_CONVERSATION'),'createdAt':new Date(_0x62d292['createdAt'])['toLocaleDateString'](),'active':_0x62d292['id']===_0x3404e6,'pinned':_0x62d292['pinned']}))}));this['_aiChatHistoryUi']['updateItems'](_0x3c95b8);}['_setItemLoading'](_0x38c443,_0x100631){this['_aiChatHistoryUi']['updateItemLoadingState'](_0x38c443,_0x100631,!0x0);}['_clearItemLoading'](_0x318f4a){this['_aiChatHistoryUi']['updateItemLoadingState'](_0x318f4a,null,!0x1);}['_handleHistoryErrorUI'](_0x302ade,_0x5d2f15,_0x12d12f){const _0x4d1910=this['_generateErrorMessage'](_0x5d2f15,_0x12d12f);this['_aiChatHistoryUi']['showError'](_0x4d1910),_0x12d12f&&this['_clearItemLoading'](_0x12d12f),this['_aiChatHistoryUi']['setLoadingSkeleton'](!0x1);}['_generateErrorMessage'](_0x491ab3,_0x20243a){const _0x500df9=_0x20243a?this['history']['getItem'](_0x20243a):null,_0x3cfb3b=_0x500df9?.['title']||us(this['context']['locale'],'AI_CHAT_UNTITLED_CONVERSATION');switch(_0x491ab3){case'updateItemTitle':return us(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_UPDATE_TITLE',_0x3cfb3b);case'updateItemPinned':{const _0x4568c8=us(this['context']['locale'],_0x500df9?.['pinned']?'AI_CHAT_HISTORY_UNPIN_ACTION':'AI_CHAT_HISTORY_PIN_ACTION');return us(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_UPDATE_PINNED',[_0x4568c8,_0x3cfb3b]);}case'removeItem':return us(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_REMOVE_ITEM',_0x3cfb3b);case'init':case'loadItems':return us(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_LOAD_ITEMS');default:return us(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_GENERIC');}}['_getCategorizedItems'](){const _0x21fe0b=new Date(),_0x1db48f=new Date(_0x21fe0b['getFullYear'](),_0x21fe0b['getMonth'](),_0x21fe0b['getDate']()),_0x269024=new Date(_0x1db48f);_0x269024['setDate'](_0x269024['getDate']()-0x1);const _0x5629f=new Date(_0x1db48f);_0x5629f['setDate'](_0x5629f['getDate']()-0xe);const _0x30f6de=this['history']['getItems']({'pinned':!0x0}),_0x4a31a3=this['history']['getItems']({'from':_0x1db48f,'to':_0x1db48f}),_0x37671a=this['history']['getItems']({'from':_0x269024,'to':_0x269024}),_0x4e92b1=this['history']['getItems']({'from':_0x5629f,'to':_0x269024}),_0x1dc1d2=this['history']['getItems']({'to':_0x5629f}),_0x511785=[];return _0x30f6de['length']>0x0&&_0x511785['push']({'title':us(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_PINNED'),'items':_0x30f6de}),_0x4a31a3['length']>0x0&&_0x511785['push']({'title':us(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_TODAY'),'items':_0x4a31a3}),_0x37671a['length']>0x0&&_0x511785['push']({'title':us(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_YESTERDAY'),'items':_0x37671a}),_0x4e92b1['length']>0x0&&_0x511785['push']({'title':us(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_LAST_14_DAYS'),'items':_0x4e92b1}),_0x1dc1d2['length']>0x0&&_0x511785['push']({'title':us(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_LATER'),'items':_0x1dc1d2}),_0x511785;}['_setIsMaximized'](_0x37e06f){this['_aiChatHistoryUi']['setIsMaximized'](_0x37e06f);}}class Ia extends _0x3397b8{static get['requires'](){return[ga,da];}static get['pluginName'](){return'AIChatHistory';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}class Ea extends _0x3397b8{static get['requires'](){return[Js,tn,aa,Ia];}static get['pluginName'](){return'AIChat';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x495a2e){super(_0x495a2e),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 pa extends Nt{['id'];constructor(_0x50d04a,_0x469e83){super(_0x50d04a);const {id:_0x1ea8b7,type:_0x3e6d2c,icon:_0x5cee47}=_0x469e83;this['id']=_0x1ea8b7,this['set']({'label':_0x469e83['label'],'withText':!0x0,'class':'ck-ai-chat-shortcut'}),this['extendTemplate']({'attributes':{'data-cke-ai-shortcut-id':_0x469e83['id']}}),_0x5cee47?this['icon']=_0x5cee47:'chat'===_0x3e6d2c?this['icon']=_0x17727b:'review'===_0x3e6d2c?this['icon']=_0x3e03ba:'translate'===_0x3e6d2c&&(this['icon']=_0x24ec53);}}class Ta extends vt{['listView'];constructor(_0x130a41,_0x1b474c){super(_0x130a41);const _0x4d11db=_0x1b474c['map'](_0x4ed475=>{const _0x316d40=new Ht(this['locale']),_0x1ebae5=new pa(this['locale'],_0x4ed475);return _0x316d40['children']['add'](_0x1ebae5),_0x1ebae5['delegate']('execute')['to'](this),_0x316d40;});this['listView']=new Dt(this['locale']),this['listView']['items']['addMany'](_0x4d11db),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat-shortcuts']},'children':[this['listView']]});}}const ma='chat-shortcuts';var Ca=function(_0x40a5a8){return _0x40a5a8['CHAT']='chat',_0x40a5a8['REVIEW']='review',_0x40a5a8['TRANSLATE']='translate',_0x40a5a8;}({});class wa extends _0x3397b8{['_shortcuts'];['_shortcutsView'];['_aiChatUI'];static get['requires'](){return[aa];}static get['pluginName'](){return'AIChatShortcuts';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){this['_aiChatUI']=this['context']['plugins']['get'](aa),this['_shortcuts']=this['context']['config']['get']('ai.chat.shortcuts')??[];const _0x40f6c5=this['context']['plugins']['get']('AIChatController');this['_shortcuts']['length']&&(this['_validateShortcuts'](),this['_aiChatUI']['on']('conversationCreated',()=>{_0x40f6c5['activeConversation']['isFromHistory']||this['_injectShortcuts']();}),this['listenTo'](_0x40f6c5,'interactionStarted',()=>{this['_removeShortcuts']();}));}['_validateShortcuts'](){const _0x32df2e=Object['values'](Ca);this['_shortcuts']['forEach'](_0xbb2cd4=>{let _0x5162a7=!0x0;if(_0xbb2cd4['id']&&_0xbb2cd4['label']&&_0x32df2e['includes'](_0xbb2cd4['type'])?'chat'===_0xbb2cd4['type']&&(_0x5162a7='string'==typeof _0xbb2cd4['prompt']):_0x5162a7=!0x1,!_0x5162a7)throw new ht('ai-chat-shortcuts-invalid-config',this['context'],{'shortcut':_0xbb2cd4});});}['_injectShortcuts'](){const _0x4dd40b=this['context']['plugins']['get'](aa);this['_shortcutsView']=new Ta(this['context']['locale'],this['_shortcuts']),this['_shortcutsView']['render'](),_0x4dd40b['addFeedItemCustomElement'](this['_shortcutsView']['element'],ma),this['_shortcutsView']['on']('execute',_0x11a93c=>{const _0x2bb30d=_0x11a93c['source']['id'];this['_executeShortcut'](_0x2bb30d);});}['_removeShortcuts'](){const _0x100cae=this['context']['plugins']['get'](aa);_0x100cae['hasFeedItem'](ma)&&_0x100cae['removeFeedItem'](ma),this['_shortcutsView']?.['destroy']();}['_executeShortcut'](_0x15ca77){const _0x448293=this['_shortcuts']['find'](_0x25972a=>_0x25972a['id']===_0x15ca77),_0x534a62=_0x448293['type'];'chat'===_0x534a62?this['_runChatShortcut'](_0x448293):'review'===_0x534a62?_0x448293['commandId']?this['_runReviewShortcut'](_0x448293):this['_switchTab']('reviewMode'):'translate'===_0x534a62&&(_0x448293['language']?this['_runTranslateShortcut'](_0x448293):this['_switchTab']('translate'));}['_switchTab'](_0x5392bd){if(!this['context']['plugins']['has']('AITabs'))throw new ht('ai-chat-shortcuts-ai-tabs-not-found',this['context'],{'tabName':_0x5392bd});this['context']['plugins']['get']('AITabs')['view']['activateTab'](_0x5392bd);}async['_runChatShortcut']({prompt:_0x42d50e,draftMode:_0x136c39,useWebSearch:_0x189229=!0x1,useReasoning:_0x29e525=!0x1,model:_0xdf4bd0}){const _0x4e2dc9=this['context']['plugins']['get']('AIChatController'),_0x32757f=_0x4e2dc9['activeConversation'];let _0x509069;_0x509069=_0xdf4bd0?await _0x32757f['chatModels']['getModel'](_0xdf4bd0):await _0x32757f['chatModels']['getDefault'](),_0x509069&&await _0x32757f['setModel'](_0x509069),_0x32757f['setWebSearch'](_0x189229),_0x32757f['setReasoning'](_0x29e525),_0x4e2dc9['addCurrentDocumentToChatContext'](),_0x136c39?(this['_aiChatUI']['setPromptInputValue'](_0x42d50e),this['_aiChatUI']['focusPromptInput'](!0x0)):_0x4e2dc9['sendMessage']({'message':_0x42d50e});}['_runReviewShortcut']({commandId:_0x1825c9,model:_0x4a09a8,prompt:_0x5e3512,params:_0x4aacb4}){if(!this['context']['plugins']['has']('AIReviewModeUI'))throw new ht('ai-chat-shortcuts-review-mode-not-found',this['context']);this['_switchTab']('reviewMode');const _0x11f151={'id':_0x1825c9,'isCustom':'custom'===_0x1825c9};_0x4a09a8&&_0x5e3512&&(_0x11f151['args']={'model':_0x4a09a8,'prompt':_0x5e3512}),_0x4aacb4&&(_0x11f151['params']=_0x4aacb4),this['context']['plugins']['get']('AIReviewModeUI')['fire']('runReviewCheck',_0x11f151);}['_runTranslateShortcut']({language:_0x1b20c4}){if(!this['context']['plugins']['has']('AITranslateUI'))throw new ht('ai-chat-shortcuts-translate-not-found',this['context']);this['_switchTab']('translate'),this['context']['plugins']['get']('AITranslateUI')['fire']('runReviewCheck',{'id':_0x1b20c4,'args':{'language':_0x1b20c4}});}}class fa extends _0x10c9cf{constructor(_0x5a00f0){super(_0x5a00f0);const _0x717b10=_0x5a00f0['plugins']['get']('AITabs')['view'];this['bind']('value')['to'](_0x717b10,'isVisible'),this['isEnabled']=!0x0;}['execute'](){const _0x318d47=this['editor']['plugins']['get']('AITabs')['view'];_0x318d47['isVisible']=!_0x318d47['isVisible'];}}class Sa extends _0x10493d{static get['requires'](){return[cs];}static get['pluginName'](){return'AIToggleButtonUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const _0xd536d1=this['editor'];_0xd536d1['commands']['add']('toggleAi',new fa(_0xd536d1)),_0xd536d1['ui']['componentFactory']['add']('toggleAi',()=>{const _0x550334=this['_createAIUIButton'](Nt);return _0x550334['set']({'tooltip':!0x0,'class':'ck-ai-toggle-button'}),_0x550334;}),_0xd536d1['ui']['componentFactory']['add']('menuBar:toggleAi',()=>{const _0x54201f=this['_createAIUIButton'](Wt);return _0x54201f['set']({'role':'menuitemcheckbox'}),_0x54201f;});}['_createAIUIButton'](_0x2e42d9){const _0x4f2b2c=this['editor'],_0x1ac63f=_0x4f2b2c['commands']['get']('toggleAi'),_0x7305f7=new _0x2e42d9(_0x4f2b2c['locale']);return _0x7305f7['set']({'label':us(_0x4f2b2c['locale'],'AI_TOGGLE_BUTTON_LABEL'),'icon':_0x3a9cf8,'isToggleable':!0x0}),_0x7305f7['bind']('isEnabled')['to'](_0x1ac63f),_0x7305f7['bind']('isOn')['to'](_0x1ac63f,'value',_0x800b54=>!!_0x800b54),this['listenTo'](_0x7305f7,'execute',()=>{_0x1ac63f['execute']();}),_0x7305f7;}}const ba=['applySuggestion','insertSuggestion','showNext','showPrevious'];class Ra extends vt{['_errorView'];constructor(_0x1ac333){super(_0x1ac333),this['set']('_errorMessage',''),this['set']('_isErrorVisible',!0x1);}['showBlockingError'](_0x554878){this['showError'](_0x554878);}['showError'](_0x714516){this['_errorView']||(this['_errorView']=this['_createErrorView']()),this['_errorMessage']=_0x714516,this['_isErrorVisible']=!0x0;}['hideError'](){this['_isErrorVisible']=!0x1;}['_createErrorView'](){const _0x37e6b2=new vt(this['locale']),_0x8ace6f=new vt(this['locale']);return _0x8ace6f['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai-suggestion__error-text']},'children':[{'text':this['bindTemplate']['to']('_errorMessage')}]}),_0x37e6b2['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__error','ck-ai-balloon-error',this['bindTemplate']['if']('_isErrorVisible','ck-hidden',_0x556b3d=>!_0x556b3d)]},'children':[_0x8ace6f]}),_0x37e6b2;}}const Oa=0xa;class ka extends _0x3397b8{static get['requires'](){return[tn];}static get['pluginName'](){return'AIBalloon';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['isOpen']=!0x1;['_currentConfig'];['_isUpdatingMarkers']=!0x1;['open'](_0x3231e8){const {id:_0x9634e}=this['_currentConfig']??{};this['_currentConfig']=_0x3231e8;const {id:_0x5bb4e2}=this['_currentConfig'];this['isOpen']&&_0x9634e===_0x5bb4e2?this['_updateDialog']():this['_showDialog']();}['close'](){const _0x1cdfdf=Xs(this['context'])['plugins']['get']('Dialog');_0x1cdfdf['isOpen']&&this['_currentConfig']&&_0x1cdfdf['id']===this['_currentConfig']['id']&&_0x1cdfdf['hide']();}['_updateDialog'](){const _0x13dd9a=Xs(this['context'])['plugins']['get']('Dialog'),{icon:_0x5e13ef,title:_0x323c37}=this['_currentConfig'];_0x13dd9a['view']?.['headerView']&&(_0x13dd9a['view']['headerView']['label']=_0x323c37,_0x13dd9a['view']['headerView']['iconView']&&_0x5e13ef&&(_0x13dd9a['view']['headerView']['iconView']['content']=_0x5e13ef)),this['_isUpdatingMarkers']=!0x0,this['_showFakeVisualSelection'](),this['_isUpdatingMarkers']=!0x1,_0x13dd9a['view']?.['updatePosition']();}['_showFakeVisualSelection'](){this['context']['plugins']['get'](tn)['showFakeVisualSelection']({'ranges':this['_currentConfig']['ranges'],'id':'balloon','priority':0x64}),window['getSelection']()?.['removeAllRanges']();}['_hideFakeVisualSelection'](){this['context']['plugins']['get'](tn)['hideFakeVisualSelection']('balloon');}['_showDialog'](){const _0x4bd461=Xs(this['context'])['plugins']['get']('Dialog'),{id:_0x50f36f,title:_0x1e9338,icon:_0x101bdf,class:_0x3db73b,mainView:_0x289e01}=this['_currentConfig'];_0x289e01['delegate'](...ba)['to'](this),_0x4bd461['show']({'title':_0x1e9338,'icon':_0x101bdf,'hasCloseButton':!0x0,'id':_0x50f36f,'position':this['_calculateDialogPosition']['bind'](this),'className':'ck-ai-balloon\x20'+(_0x3db73b||''),'content':_0x289e01,'onShow':_0x3a8765=>{this['_showFakeVisualSelection'](),this['_setupFakeVisualSelectionMarkerRemovalListener']();const _0xb5b858=this['_getSelectionElements']();_0xb5b858&&_0xb5b858[0x0]&&Ct({'target':_0xb5b858[0x0],'ancestorOffset':0x14,'alignToTop':!0x0,'viewportOffset':{'top':0x14,'bottom':0x14,'left':0x0,'right':0x0}}),this['isOpen']=!0x0,_0x3a8765['once']('hide',()=>{this['fire']('beforeDialogClosed',{'id':_0x50f36f});},{'priority':'high'});},'onHide':()=>{this['_hideFakeVisualSelection'](),this['_cleanupFakeVisualSelectionMarkerRemovalListener'](),this['fire']('dialogClosed',{'id':_0x50f36f}),this['isOpen']=!0x1;}});}['_calculateDialogPosition'](_0x1aa02f,_0x106f04){if(!_0x106f04)return null;const _0x471c7f=this['_getSelectionElements']();if(!_0x471c7f||0x0===_0x471c7f['length'])return{'left':Math['round'](_0x106f04['left']+_0x106f04['width']/0x2-_0x1aa02f['width']/0x2),'top':Math['round'](_0x106f04['top']+_0x106f04['height']/0x2-_0x1aa02f['height']/0x2)};const _0x4cce61=Math['round'](_0x106f04['left']+_0x106f04['width']/0x2-_0x1aa02f['width']/0x2),_0x571d60=_0x471c7f['map'](_0x1f42d9=>new dt(_0x1f42d9)),_0x132ad3=_0x1aa02f['height'];return{'left':_0x4cce61,'top':this['_calculateOptimalTopPosition'](_0x571d60,_0x132ad3,_0x106f04)};}['_calculateOptimalTopPosition'](_0x4c864e,_0x2dd44f,_0x589659){const _0x2fe714=new dt(lt['window']),_0x594827=_0x4c864e['map'](_0x25007d=>_0x25007d['getVisible']())['filter'](_0x4b42b8=>_0x4b42b8),_0x4aa014=dt['getBoundingRect'](_0x594827);if(!_0x4aa014)return Math['round'](_0x589659['top']+_0x589659['height']/0x2);const _0x2ec2fe=_0x2fe714['getIntersection'](_0x4aa014);if(!_0x2ec2fe)return Math['round'](_0x589659['top']+_0x589659['height']/0x2);const _0x12a22a=_0x589659['getVisible'](),_0x1d2bae=_0x12a22a&&_0x4aa014['height']>_0x12a22a['height'],_0x4eace3=_0x2ec2fe['top'],_0xd12096=_0x2ec2fe['bottom'];if(_0x1d2bae){const _0x36be1c=(_0x12a22a||_0x2fe714)['height']/0x2-_0x2dd44f/0x2,_0x3931c5=_0x4eace3-Oa-_0x589659['top'],_0x2abe7e=_0x589659['bottom']-_0xd12096-Oa;return _0x3931c5>=_0x2dd44f?Math['max'](Oa,_0x4eace3-_0x2dd44f-Oa):_0x2abe7e>=_0x2dd44f?_0xd12096+Oa:Math['max'](Oa,_0x36be1c);}const _0x7e6849=_0x4eace3-_0x2dd44f,_0x24d216=_0x589659['bottom']-_0xd12096-Oa,_0x2c7c29=_0x4eace3-Oa-_0x589659['top'];let _0x33b5d6;if(_0x24d216>=_0x2dd44f)_0x33b5d6=_0xd12096+Oa;else{if(_0x2c7c29>=_0x2dd44f)_0x33b5d6=_0x7e6849-Oa;else _0x33b5d6=_0x4eace3+_0x4aa014['height']/0x2-_0x2dd44f/0x2;}return _0x33b5d6;}['_setupFakeVisualSelectionMarkerRemovalListener'](){const _0x41c8d3=Xs(this['context']);this['listenTo'](_0x41c8d3['model']['document'],'change',()=>{if(!this['_isUpdatingMarkers']){for(const {name:_0x3ad4b6,data:{newRange:_0x1f9ee3}}of _0x41c8d3['model']['document']['differ']['getChangedMarkers']())if(_0x3ad4b6['startsWith'](Zs+':')&&(_0x1f9ee3&&(_0x1f9ee3['start']['isEqual'](_0x1f9ee3['end'])||'$graveyard'==_0x1f9ee3['root']['rootName'])||null==_0x1f9ee3)){const _0x427ae5=us(this['context']['locale'],'AI_BALLOON_SELECTION_REMOVED_ERROR');this['_currentConfig']['mainView']['showBlockingError'](_0x427ae5),this['fire']('selectionRemoved');}}});}['_cleanupFakeVisualSelectionMarkerRemovalListener'](){const _0x121907=Xs(this['context']);this['_currentConfig']['mainView']['hideError'](),this['stopListening'](_0x121907['model']['document']);}['_getSelectionElements'](){const _0x54ad95=Xs(this['context']);return _0x3c0422(_0x54ad95['editing'],[..._0x54ad95['model']['markers']['getMarkersGroup']('ai-selection'),..._0x54ad95['model']['markers']['getMarkersGroup']('ai-balloon-selection')]);}}class Na extends kt{['copyButton'];['likeButton'];['dislikeButton'];['showChangesButton'];['_config'];constructor(_0x43f6d3,_0x11977e={}){super(_0x43f6d3),this['set']('isEnabled',!0x0),this['set']('isShowChangesOn',!0x1),this['_config']={'showCopy':!0x1,'showLike':!0x1,'showDislike':!0x1,..._0x11977e};const _0x3f69bf=!(this['_config']['showCopy']||this['_config']['showChanges']||this['_config']['showLike']||this['_config']['showDislike']||this['_config']['customView']?.['length']);this['class']=_0x3f69bf?'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'](_0x7fb815){this['showChangesButton']['isEnabled']=_0x7fb815;}['_setupRatingButtons'](){this['likeButton']=new Nt(this['locale']),this['likeButton']['set']({'icon':_0x2dbec3,'label':us(this['locale'],'AI_MINI_TOOLBAR_LIKE'),'class':As,'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':_0x388309,'label':us(this['locale'],'AI_MINI_TOOLBAR_DISLIKE'),'class':As,'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':_0x5804e6,'label':us(this['locale'],'AI_MINI_TOOLBAR_COPY'),'class':'ck-ai-mini-toolbar-copy-button\x20'+As,'tooltip':!0x0}),this['copyButton']['bind']('isEnabled')['to'](this);const _0x510b0a=new xt();_0x510b0a['set']({'content':_0x27f2cb}),_0x510b0a['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'+As,setTimeout(()=>{this['copyButton']['class']='ck-ai-mini-toolbar-copy-button\x20'+As;},0x7d0);}),this['copyButton']['children']['add'](_0x510b0a);}['_setupShowChangesButton'](){this['showChangesButton']=new Nt(this['locale']),this['showChangesButton']['set']({'icon':_0xc7caf0,'label':us(this['locale'],'AI_SUGGESTION_BUTTON_SHOW_CHANGES'),'withText':'full'==this['_config']['showChanges'],'tooltip':'full'!=this['_config']['showChanges'],'class':As}),this['showChangesButton']['bind']('isOn')['to'](this,'isShowChangesOn'),this['showChangesButton']['bind']('isEnabled')['to'](this),this['showChangesButton']['bind']('icon')['to'](this,'isShowChangesOn',_0x2eeeba=>_0x2eeeba?_0x3ca4ea:_0xc7caf0),this['showChangesButton']['on']('execute',()=>{this['fire']('toggleShowChanges');});}}class va extends Ra{['children'];['nextButtonView'];['previousButtonView'];['focusCycler'];['_focusables'];['_focusTracker'];['_keystrokes'];['_config'];['_streamableContentView'];['_toolbarContainerView'];['_partToolbarView'];['_stateView'];['_miniToolbarView'];constructor(_0x2453ab,_0x37b379){super(_0x2453ab);const _0x310a78=this['bindTemplate'];this['set']('showDiff',!0x1),this['set']('_state','pending'),this['_focusTracker']=new At(),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']=_0x37b379,this['nextButtonView']=this['_createNextButtonView'](),this['previousButtonView']=this['_createPreviousButtonView'](),this['_streamableContentView']=new pn(_0x2453ab),this['_partToolbarView']=new gn(_0x2453ab,_0x37b379['availableActions']),this['_partToolbarView']['delegate']('applySuggestion','insertSuggestion','rejectSuggestion')['to'](this),this['_togglePartToolbarButtonsVisibility'](_0x37b379),this['_stateView']=new _n(_0x2453ab),this['_stateView']['isVisible']=!0x1,this['_miniToolbarView']=new Na(_0x2453ab,{'showChanges':'full'}),this['_miniToolbarView']['bind']('isShowChangesOn')['to'](this,'showDiff'),this['_miniToolbarView']['on']('toggleShowChanges',()=>{this['fire']('toggleSuggestionDisplayMode');}),this['_toolbarContainerView']=new ya(_0x2453ab,[this['_partToolbarView'],this['_stateView'],this['_miniToolbarView']]),this['children']=this['createCollection']([this['_streamableContentView'],this['_toolbarContainerView']]),this['on']('change:_state',(_0x1c1e06,_0xaddbd5,_0x40bd24,_0x496eef)=>{let _0x42a65e,_0x2c5fae;'pending'===_0x496eef?(_0x42a65e=this['_partToolbarView'],_0x2c5fae=this['_stateView']):(_0x42a65e=this['_stateView'],_0x2c5fae=this['_partToolbarView']),this['_stateView']['setState'](_0x40bd24),_0x42a65e['isVisible']=!0x1,_0x2c5fae['isVisible']=!0x0;}),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat-balloon-main',_0x310a78['to']('_state',_0x6558a6=>'ck-ai-chat-balloon-main_state_'+_0x6558a6)]},'children':this['children']}),this['on']('change:isTrackChangesOn',()=>{this['_togglePartToolbarButtonsVisibility'](_0x37b379);});}['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'](_0x2b66d0){_0x2b66d0?.['keepErrors']||this['hideError'](),await this['_streamableContentView']['update'](_0x2b66d0);}['setState'](_0x5c6f59){this['_state']=_0x5c6f59;}['showError'](_0x537791){super['showError'](_0x537791),this['children']['has'](this['_errorView'])||this['children']['add'](this['_errorView'],0x0);}['hideError'](){this['_isErrorVisible']&&(super['hideError'](),this['togglePartToolbarEnabled'](!0x0));}['showBlockingError'](_0x13e620){super['showBlockingError'](_0x13e620),this['togglePartToolbarEnabled'](!0x1);}['toggleRotatorButtonsVisibility'](_0x19a51f){this['nextButtonView']['isVisible']=this['previousButtonView']['isVisible']=_0x19a51f;}['togglePartToolbarEnabled'](_0x251db9){this['_partToolbarView']['isEnabled']=_0x251db9;}['_togglePartToolbarButtonsVisibility']({showApplyButton:_0x5c6775,showSuggestButton:_0x20dd4c}){_0x5c6775=_0x5c6775&&!this['isTrackChangesOn']&&this['_config']['availableActions']['includes']('applySuggestion'),_0x20dd4c=_0x20dd4c&&this['_config']['availableActions']['includes']('insertSuggestion'),this['_partToolbarView']['setButtonsVisibility']({'showApplyButton':_0x5c6775,'showSuggestButton':_0x20dd4c});}['_createNextButtonView'](){const _0x48f045=new Nt(this['locale']);return _0x48f045['set']({'icon':_0x438400,'label':us(this['locale'],'AI_BALLOON_NEXT_LABEL'),'isVisible':!0x0}),_0x48f045['on']('execute',()=>{this['fire']('showNext');}),_0x48f045;}['_createPreviousButtonView'](){const _0x50eedc=new Nt(this['locale']);return _0x50eedc['set']({'icon':_0x36707d,'label':us(this['locale'],'AI_BALLOON_PREVIOUS_LABEL'),'isVisible':!0x0}),_0x50eedc['on']('execute',()=>{this['fire']('showPrevious');}),_0x50eedc;}}class ya extends vt{constructor(_0x1baaae,_0x3f731d){super(_0x1baaae),this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-chat-balloon__toolbar-container']},'children':_0x3f731d});}}class xa extends _0x10493d{static get['requires'](){return[Bt,ka];}static get['pluginName'](){return'AIChatBalloon';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['_chatBalloonView'];constructor(_0x1abdb2){super(_0x1abdb2),this['set']('showDiff',!0x1);}['open'](_0x42150d){const _0x2cc54c=this['editor'];this['_chatBalloonView']||(this['_chatBalloonView']=this['_createChatBalloonView']()),_0x2cc54c['plugins']['get']('AIBalloon')['open']({..._0x42150d,'id':'aiChatBalloon','class':'ck-ai-chat-balloon','mainView':this['_chatBalloonView']}),this['_toggleRotatorButtonsInDialogHeader'](_0x42150d['showRotator']),this['_chatBalloonView']['togglePartToolbarEnabled'](!_0x42150d['areActionsDisabled']),this['_restoreDefaultViewFocus']();}['close'](){this['editor']['plugins']['get']('AIBalloon')['close']();}['updateContent'](_0x204487){return this['_chatBalloonView']||(this['_chatBalloonView']=this['_createChatBalloonView']()),this['_chatBalloonView']['updateContent'](_0x204487);}['setState'](_0x1d3072){this['_chatBalloonView']&&this['_chatBalloonView']['setState'](_0x1d3072);}['_createChatBalloonView'](){const _0x4521b0=this['editor'],_0x33272d=_0x4521b0['plugins']['get']('AIBalloon'),_0x235c0a=_0x4521b0['commands']['get']('trackChanges');let _0x481e7c=_0x4521b0['config']['get']('ai.availableReplyActions')||[...wn];_0x4521b0['plugins']['has']('TrackChanges')||(_0x481e7c=_0x481e7c['filter'](_0x2f6a53=>'insertSuggestion'!=_0x2f6a53));const _0x4cf3b8=new va(_0x4521b0['locale'],{'availableActions':_0x481e7c,'showApplyButton':!0x0,'showSuggestButton':!!_0x235c0a});return _0x4cf3b8['bind']('showDiff')['to'](this),_0x4cf3b8['delegate'](...en)['to'](this),_0x4cf3b8['delegate']('showPrevious','showNext')['to'](this),_0x33272d['delegate']('dialogClosed')['to'](this),_0x4cf3b8['on']('applySuggestion',this['_restoreDefaultViewFocus']['bind'](this)),_0x4cf3b8['on']('insertSuggestion',this['_restoreDefaultViewFocus']['bind'](this)),_0x4cf3b8['on']('rejectSuggestion',this['_restoreDefaultViewFocus']['bind'](this)),_0x235c0a&&_0x4cf3b8['bind']('isTrackChangesOn')['to'](_0x235c0a,'value'),_0x4cf3b8['render'](),_0x4cf3b8;}['_toggleRotatorButtonsInDialogHeader'](_0x2a2a85){const _0x20f77f=this['editor'],_0x2f1a1c=_0x20f77f['plugins']['get']('Dialog')['view']['headerView']['children'];this['_chatBalloonView']['toggleRotatorButtonsVisibility'](_0x2a2a85),_0x2f1a1c['has'](this['_chatBalloonView']['previousButtonView'])||(_0x2f1a1c['addMany']([this['_chatBalloonView']['previousButtonView'],this['_chatBalloonView']['nextButtonView']],0x0),_0x20f77f['plugins']['get']('AIBalloon')['once']('beforeDialogClosed',()=>{_0x2f1a1c['remove'](this['_chatBalloonView']['previousButtonView']),_0x2f1a1c['remove'](this['_chatBalloonView']['nextButtonView']);}));}['_restoreDefaultViewFocus'](){this['_chatBalloonView']['focus']();}}class La extends _0x10493d{static get['requires'](){return[Sa,xa,_0x4b9ba0];}static get['pluginName'](){return'AIEditorIntegration';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}function Da(_0x3b28df){const {editor:_0x18495e,action:_0x118c64,withText:_0x1683dc=!0x1,withIcon:_0x37faa4=!0x0,isInDropdown:_0x5468f6=!0x0,shouldPreventFocus:_0x4bbcd6=!0x1}=_0x3b28df;return()=>{const _0x5da31d=_0x18495e['locale'],_0x52f30b=new Nt(_0x5da31d),_0x42f900=_0x52f30b['bindTemplate'];_0x5468f6&&_0x52f30b['extendTemplate']({'on':{'mouseenter':_0x42f900['to'](()=>{_0x4bbcd6&&_0x4bbcd6()||_0x52f30b['focus']();})}});const _0x2f6b9a=_0x118c64['icon']??_0x118c64['parent']?.['icon'];return _0x52f30b['set']({'label':_0x118c64['label'],'withText':_0x1683dc,'role':'menuitem','icon':_0x37faa4?_0x2f6b9a??_0x4ba3ea:void 0x0,'tooltip':!_0x1683dc,'class':'ck-ai-quick-actions-button','isEnabled':_0x118c64['isEnabled']}),_0x52f30b['on']('execute',()=>{_0x18495e['editing']['view']['focus'](),_0x18495e['commands']['execute']('aiQuickAction',_0x118c64);}),_0x52f30b;};}class Pa extends _0xf089fd{['arrowView'];constructor(_0x58a4b8,_0x1e8c84){super(_0x58a4b8,_0x1e8c84);const _0x1a8713=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',_0x496263=>String(_0x496263)),'data-cke-tooltip-disabled':_0x1a8713['to']('isOn')},'on':{'mouseenter':_0x1a8713['to']('mouseenter')}});}['render'](){super['render'](),this['children']['add'](this['arrowView']);}['_createArrowView'](){const _0x2d6eb4=new xt();return _0x2d6eb4['content']=_0x2fb5d2,_0x2d6eb4['extendTemplate']({'attributes':{'class':'ck-dropdown-menu-list__nested-menu__button__arrow'}}),_0x2d6eb4;}}class Ha extends Dt{['_allListItems'];['_allSearchableItems'];constructor(_0x552333,_0x23a8e6,_0x15fa04){super(_0x552333),this['_allListItems']=_0x23a8e6,this['_allSearchableItems']=_0x15fa04;}['filter'](_0x2b2a5f){if(!_0x2b2a5f)return this['items']['clear'](),this['items']['addMany'](this['_allListItems']),this['_clearHighlight'](),{'resultsCount':this['_allListItems']['length'],'totalItemsCount':this['_allListItems']['length']};const _0x17e084=_0x2b2a5f['source']['toLowerCase']()['trim'](),_0x140f16=this['_allSearchableItems']['filter'](_0x3007ea=>(_0x3007ea['groupLabel']?_0x3007ea['label']+'\x20('+_0x3007ea['groupLabel']+')':_0x3007ea['label'])['toLowerCase']()['includes'](_0x17e084));return this['items']['clear'](),this['items']['addMany'](_0x140f16['sort']((_0x42681,_0x185ee7)=>{const _0x35b890=_0x42681['groupLabel'],_0x110f2c=_0x185ee7['groupLabel'];return _0x35b890||_0x110f2c?_0x35b890?0x1:-0x1:0x0;})['map'](_0x31b860=>_0x31b860['item'])),this['_highlightQuery'](_0x17e084,_0x140f16),{'resultsCount':_0x140f16['length'],'totalItemsCount':this['_allSearchableItems']['length']};}['_highlightQuery'](_0x289139,_0x260df0){if(!_0x289139)return;const _0x320cf4=new RegExp(_0x1b6061(_0x289139),'gi');_0x260df0['forEach'](_0x34c01f=>{_0x34c01f['highlightViews']&&_0x34c01f['highlightViews']['forEach'](_0x5dea90=>{'function'==typeof _0x5dea90['highlightText']&&_0x5dea90['highlightText'](_0x320cf4);});});}['_clearHighlight'](){this['_allSearchableItems']['forEach'](_0x4de32f=>{_0x4de32f['highlightViews']&&_0x4de32f['highlightViews']['forEach'](_0x6770f9=>{'function'==typeof _0x6770f9['highlightText']&&_0x6770f9['highlightText'](null);});});}}const Ma='menu',Ua='menuitem';class Va extends vt{['_bodyCollection'];['optionsListView'];['_searchTextView']=null;['_allSearchableItems']=[];['children'];['focusTracker'];['keystrokes'];['_focusables'];['focusCycler'];['_openNestedPanels']=new Set();['_hasSearch'];constructor(_0x4655d8,_0x163ebf,_0x3ae736,_0x56399a,_0x584db1=!0x1){const _0x1dc60e=_0x4655d8['locale'];super(_0x1dc60e),this['_bodyCollection']=_0x56399a,this['_hasSearch']=_0x584db1;const _0x5dc3c2=this['_createListItems'](_0x4655d8,_0x163ebf,_0x3ae736);this['optionsListView']=new Ha(_0x1dc60e,_0x5dc3c2,this['_allSearchableItems']),this['optionsListView']['role']=Ma,this['optionsListView']['items']['addMany'](_0x5dc3c2),this['focusTracker']=new At(),this['keystrokes']=new gt(),_0x584db1&&(this['_searchTextView']=this['_createSearchTextView']()),this['_focusables']=_0x5dc3c2,this['focusCycler']=new Ut({'focusables':this['_focusables'],'focusTracker':this['focusTracker'],'keystrokeHandler':this['keystrokes']}),_0x584db1&&this['_searchTextView']&&this['focusCycler']['chain'](this['_searchTextView']['focusCycler']);const _0x39106a=_0x584db1&&this['_searchTextView']?[this['_searchTextView']]:[this['optionsListView']];this['children']=new _0x54be0e(_0x39106a),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset_all','ck-ai-quick-actions','ck-rounded-corners'],'dir':_0x1dc60e['uiLanguageDirection']},'children':this['children']});}['_createSearchTextView'](){return new _0x261b76(this['locale'],{'filteredView':this['optionsListView'],'queryView':{'label':us(this['locale'],'AI_QUICK_ACTIONS_SEARCH')},'class':'ck-ai-quick-actions-search','infoView':{'text':{'notFound':{'primary':us(this['locale'],'AI_QUICK_ACTIONS_SEARCH_NOT_FOUND')}}}});}['_isSearchFocused'](){if(!this['_hasSearch']||!this['_searchTextView']||!this['_searchTextView']['queryView']['fieldView']['element'])return!0x1;const _0x1f479d=this['_searchTextView']['queryView']['fieldView']['element']['ownerDocument']?.['activeElement'];return this['_searchTextView']['queryView']['fieldView']['element']['contains'](_0x1f479d);}['_createListItems'](_0x1026a6,_0x1cdb22,_0x10a8f3){const _0x23cf6f=new _0x54be0e();return _0x1cdb22['forEach'](_0x374840=>{if('actions'in _0x374840){const {listItem:_0x45363d}=this['_createActionGroupButton'](_0x1026a6,_0x374840,_0x10a8f3);_0x23cf6f['add'](_0x45363d),_0x374840['actions']['forEach'](_0x4b6fa1=>{this['_createActionButton'](_0x1026a6,_0x4b6fa1,_0x374840['label'],_0x374840['icon']);const {listItem:_0x57f349,highlightViews:_0x35bb5e}=this['_createSearchResultActionButton'](_0x1026a6,_0x4b6fa1,_0x374840['label'],_0x374840['icon']);this['_allSearchableItems']['push']({'item':_0x57f349,'label':_0x4b6fa1['label'],'groupLabel':_0x374840['label'],'highlightViews':_0x35bb5e});});}else{const {listItem:_0x38012d}=this['_createActionButton'](_0x1026a6,_0x374840);_0x23cf6f['add'](_0x38012d);const _0x13a642=_0x38012d['children']['first'];if(_0x13a642){const {listItem:_0x61927b,highlightViews:_0x5118aa}=this['_createSearchResultActionButton'](_0x1026a6,_0x374840);this['_allSearchableItems']['push']({'item':_0x61927b,'label':_0x13a642['label']||'','highlightViews':_0x5118aa});}}}),_0x23cf6f;}['_createActionButton'](_0x3309da,_0x3376dd,_0x5f3be7,_0x15614e){const _0x4223df=new Ht(this['locale']);if(_0x5f3be7&&_0x15614e){const _0x3408bf=new Nt(this['locale']),_0x383aa5=_0x3408bf['bindTemplate'],_0x497321=new _0x159fa8();_0x497321['text']=_0x3376dd['label'];const _0x60d267=new _0x159fa8();_0x60d267['text']=_0x5f3be7;const _0x37079b=new xt();_0x37079b['content']=_0x15614e,_0x37079b['extendTemplate']({'attributes':{'class':'ck-ai-quick-actions-button__group-icon'}});const _0x5f483d=new vt(this['locale']);_0x5f483d['setTemplate']({'tag':'span','attributes':{'class':'ck-ai-quick-actions-button_with-group__open-paren'},'children':[{'text':'\x20('}]});const _0x1c3f0b=new vt(this['locale']);return _0x1c3f0b['setTemplate']({'tag':'span','attributes':{'class':'ck-ai-quick-actions-button_with-group__close-paren'},'children':[{'text':')'}]}),_0x3408bf['set']({'label':_0x3376dd['label']+'\x20('+_0x5f3be7+')','withText':!0x0,'role':'menuitem','class':'ck-ai-quick-actions-button\x20ck-ai-quick-actions-button_with-group','tooltip':!0x1}),_0x3408bf['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':[_0x497321,_0x5f483d,_0x37079b,_0x60d267,_0x1c3f0b],'on':{'mouseenter':_0x383aa5['to'](()=>{this['_isSearchFocused']()||_0x3408bf['focus']();}),'click':_0x383aa5['to'](()=>{_0x3408bf['fire']('execute');})}}),_0x3408bf['on']('execute',()=>{_0x3309da['editing']['view']['focus'](),_0x3309da['commands']['execute']('aiQuickAction',_0x3376dd);}),_0x4223df['children']['add'](_0x3408bf),{'listItem':_0x4223df,'highlightViews':[_0x497321,_0x60d267]};}{const _0x50b17a=new _0x1ec96d(),_0x527ed4=new Nt(this['locale'],_0x50b17a),_0xdb9650=_0x527ed4['bindTemplate'],_0x50135c=_0x3376dd['icon']??_0x3376dd['parent']?.['icon'],_0xe4a8e9=void 0x0!==_0x3376dd['icon'];return _0x527ed4['set']({'label':_0x3376dd['label'],'withText':!0x0,'role':'menuitem','icon':_0xe4a8e9?_0x50135c??_0x4ba3ea:void 0x0,'tooltip':!0x1,'class':'ck-ai-quick-actions-button'}),_0x527ed4['extendTemplate']({'on':{'mouseenter':_0xdb9650['to'](()=>{this['_isSearchFocused']()||_0x527ed4['focus']();})}}),_0x527ed4['on']('execute',()=>{_0x3309da['editing']['view']['focus'](),_0x3309da['commands']['execute']('aiQuickAction',_0x3376dd);}),_0x4223df['children']['add'](_0x527ed4),{'listItem':_0x4223df,'highlightViews':[_0x50b17a]};}}['_createSearchResultActionButton'](_0x4b6814,_0x417bf9,_0x58e3f6,_0x3fb930){return _0x58e3f6&&_0x3fb930?this['_createSearchResultGroupedActionButton'](_0x4b6814,_0x417bf9,_0x58e3f6,_0x3fb930):this['_createSearchResultIndividualActionButton'](_0x4b6814,_0x417bf9);}['_createSearchResultGroupedActionButton'](_0x9eb794,_0x22704e,_0x2c828e,_0x558890){const _0x172901=new Ht(this['locale']),_0x141d32=new Nt(this['locale']),_0x13f20c=_0x141d32['bindTemplate'],{view:_0x15354b,highlightView:_0x55a923}=this['_createSearchResultGroupRow'](_0x2c828e,_0x558890),{view:_0x155b58,highlightView:_0x1b102b}=this['_createSearchResultActionRow'](_0x22704e['label']),_0x55be0b=this['_createSearchResultContentView'](_0x15354b,_0x155b58);return _0x141d32['set']({'label':_0x22704e['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}),_0x141d32['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':[_0x55be0b],'on':{'mouseenter':_0x13f20c['to'](()=>{this['_isSearchFocused']()||_0x141d32['focus']();}),'click':_0x13f20c['to'](()=>{this['_handleSearchResultButtonClick'](_0x141d32);})}}),this['_setupActionButtonExecution'](_0x141d32,_0x9eb794,_0x22704e),_0x172901['children']['add'](_0x141d32),{'listItem':_0x172901,'highlightViews':[_0x55a923,_0x1b102b]};}['_createSearchResultIndividualActionButton'](_0x28ddca,_0x1e4626){const _0x315e69=new Ht(this['locale']),_0x304d32=new _0x1ec96d(),_0x2a9103=new Nt(this['locale'],_0x304d32),_0x5c5cb2=_0x2a9103['bindTemplate'];return _0x2a9103['set']({'label':_0x1e4626['label'],'withText':!0x0,'role':'menuitem','icon':void 0x0,'tooltip':!0x1,'class':'ck-ai-quick-actions-button\x20ck-ai-quick-actions-search-result-button'}),_0x2a9103['extendTemplate']({'on':{'mouseenter':_0x5c5cb2['to'](()=>{this['_isSearchFocused']()||_0x2a9103['focus']();})}}),this['_setupActionButtonExecution'](_0x2a9103,_0x28ddca,_0x1e4626),_0x315e69['children']['add'](_0x2a9103),{'listItem':_0x315e69,'highlightViews':[_0x304d32]};}['_createSearchResultGroupRow'](_0x3440aa,_0x2ede66){const _0xe7254b=new vt(this['locale']),_0x96d127=new xt();_0x96d127['content']=_0x2ede66,_0x96d127['extendTemplate']({'attributes':{'class':'ck-ai-quick-actions-button__group-icon'}});const _0xdeb227=new _0x159fa8();return _0xdeb227['text']=_0x3440aa,_0xe7254b['setTemplate']({'tag':'div','attributes':{'class':'ck-ai-quick-actions-search-result__group-row'},'children':[_0x96d127,_0xdeb227]}),{'view':_0xe7254b,'highlightView':_0xdeb227};}['_createSearchResultActionRow'](_0x17ad6a){const _0x1aa966=new vt(this['locale']),_0x1b8aa3=new _0x159fa8();return _0x1b8aa3['text']=_0x17ad6a,_0x1aa966['setTemplate']({'tag':'div','attributes':{'class':'ck-ai-quick-actions-search-result__action-row'},'children':[_0x1b8aa3]}),{'view':_0x1aa966,'highlightView':_0x1b8aa3};}['_createSearchResultContentView'](_0x270497,_0x3f5cbe){const _0x3a7282=new vt(this['locale']);return _0x3a7282['setTemplate']({'tag':'div','attributes':{'class':'ck-ai-quick-actions-search-result__content'},'children':[_0x270497,_0x3f5cbe]}),_0x3a7282;}['_setupActionButtonExecution'](_0x568131,_0x3899d5,_0x26a4c4){_0x568131['on']('execute',()=>{_0x3899d5['editing']['view']['focus'](),_0x3899d5['commands']['execute']('aiQuickAction',_0x26a4c4);});}['_createActionGroupButton'](_0x5b6f58,_0x50ddc2,_0x42a952){const _0x1b266d=new Ht(this['locale']),_0x407e38=new _0x1ec96d(),_0x5b1dba=new Pa(this['locale'],_0x407e38),_0x26b05b=_0x5b1dba['bindTemplate'],_0x19d6b7=this['_getPanelKeystroke'](_0x42a952),_0x20e04a=this['_createGroupActionsList'](_0x5b6f58,_0x50ddc2['actions'],_0x42a952);_0x5b1dba['set']({'label':_0x50ddc2['label'],'withText':!0x0,'role':Ua,'icon':_0x50ddc2['icon']??_0x4ba3ea,'isEnabled':_0x50ddc2['actions']['some'](_0x45a315=>_0x45a315['isEnabled'])}),_0x5b1dba['extendTemplate']({'on':{'mouseenter':_0x26b05b['to'](()=>{this['_isSearchFocused']()||_0x5b1dba['focus']();})}});const _0x21474f=new Xt(this['locale']);return _0x21474f['extendTemplate']({'attributes':{'class':['ck','ck-reset_all','ck-ai-quick-actions-group-panel','ck-dropdown-menu__nested-menu__panel']},'on':{'keydown':_0x26b05b['to'](_0x4a045a=>{this['_handlePanelKeydown'](_0x4a045a,_0x19d6b7,_0x5b1dba,_0x21474f);})}}),_0x5b1dba['bind']('isOn')['to'](_0x21474f,'isVisible'),this['_bodyCollection']['add'](_0x21474f),_0x21474f['content']['add'](_0x20e04a),this['_setupGroupMenuBehavior'](_0x5b1dba,_0x21474f),_0x1b266d['children']['add'](_0x5b1dba),{'listItem':_0x1b266d,'highlightView':_0x407e38};}['_createGroupActionsList'](_0x51d422,_0x30cb71,_0x3e1a97){const _0x3f3d94=new Dt(this['locale']);return _0x3f3d94['extendTemplate']({'attributes':{'class':['ck','ck-reset_all','ck-ai-quick-actions-group-list','ck-dropdown-menu-list']}}),_0x30cb71['forEach'](_0x3348a3=>{const _0x722bfe=new Ht(this['locale']),_0x2a7856=Da({'editor':_0x51d422,'action':_0x3348a3,'withText':!0x0,'withIcon':!0x1,'isInDropdown':!0x0,'shouldPreventFocus':()=>this['_isSearchFocused']()})();_0x722bfe['children']['add'](_0x2a7856),_0x3e1a97['focusTracker']['add'](_0x2a7856),_0x3f3d94['items']['add'](_0x722bfe);}),_0x3f3d94;}['_setupGroupMenuBehavior'](_0x5a8985,_0x30b219){const _0x4a0262=_0x5a8985['bindTemplate'],_0x8acf8e=this['_getButtonKeystroke'](_0x5a8985);_0x5a8985['extendTemplate']({'attributes':{'class':['ck-ai-quick-actions-group-button']},'on':{'mouseenter':_0x4a0262['to'](()=>{this['_showNestedPanel'](_0x30b219,_0x5a8985);}),'mouseleave':_0x4a0262['to'](_0xb42969=>{const _0x16b293=_0xb42969['relatedTarget'];this['_isMovingToNestedMenu'](_0x16b293,_0x30b219)||this['_hideNestedPanel'](_0x30b219);}),'keydown':_0x4a0262['to'](_0x165bdf=>{_0x165bdf['key']==_0x8acf8e&&(this['_showNestedPanel'](_0x30b219,_0x5a8985),_0x30b219['content']['get'](0x0)['focus']());})}}),_0x30b219['on']('render',()=>{_0x30b219['element']?.['addEventListener']('mouseleave',_0x289b18=>{const _0x588fa6=_0x289b18['relatedTarget'];_0x5a8985['element']?.['contains'](_0x588fa6)||this['_isMovingToNestedMenu'](_0x588fa6,_0x30b219)||this['_hideNestedPanel'](_0x30b219);});});}['_showNestedPanel'](_0x2259f4,_0x1efebf){this['_openNestedPanels']['forEach'](_0x4d6380=>{_0x4d6380!==_0x2259f4&&_0x4d6380['isVisible']&&_0x4d6380['hide']();}),_0x2259f4['show'](),_0x2259f4['pin']({'positions':[_0x2697ed['eastSouth']],'target':_0x1efebf['element'],'fitInViewport':!0x0}),this['_openNestedPanels']['add'](_0x2259f4);}['_hideNestedPanel'](_0x38d6e1){_0x38d6e1['hide'](),this['_openNestedPanels']['delete'](_0x38d6e1);}['_hideAllNestedPanels'](){this['_openNestedPanels']['forEach'](_0x53384c=>_0x53384c['hide']()),this['_openNestedPanels']['clear']();}['_isMovingToNestedMenu'](_0x28e57a,_0x23b91d){if(!_0x28e57a)return!0x1;if(_0x23b91d['element']?.['contains'](_0x28e57a))return!0x0;const _0x49bc17=_0x28e57a;return _0x49bc17['closest']&&(null!==_0x49bc17['closest']('.ck-ai-quick-actions-group-panel')||null!==_0x49bc17['closest']('.ck-ai-quick-actions-group-list')||null!==_0x49bc17['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'](_0x1cfdea){return'rtl'===_0x1cfdea['locale']['uiLanguageDirection']?'ArrowRight':'ArrowLeft';}['_getButtonKeystroke'](_0x3be0bf){return'rtl'===_0x3be0bf['locale']['uiLanguageDirection']?'ArrowLeft':'ArrowRight';}['_handlePanelKeydown'](_0x5bcaf7,_0x1ee6a6,_0x1eef73,_0x4e40d7){_0x5bcaf7['key']==_0x1ee6a6&&(_0x1eef73['focus'](),this['_hideNestedPanel'](_0x4e40d7));}['_handleSearchResultButtonClick'](_0x232fd3){_0x232fd3['fire']('execute');}}function Ba(_0x40a6a8){const {editor:_0x20ed65,content:_0x26a761,buttonDefinition:_0x87a9af,bodyCollection:_0x175885,hasSearch:_0x99c2e9=!0x1}=_0x40a6a8;return()=>{const _0x40cb17=_0x20ed65['locale'],_0x5bd244=Gt(_0x40cb17);_0x5bd244['buttonView']['set']({'icon':_0x87a9af['icon']??_0x4ba3ea,'label':_0x87a9af['label'],'tooltip':!0x0}),_0x5bd244['set']({'class':'ck-ai-quick-actions-dropdown'});const _0x11e9fe=new Va(_0x20ed65,_0x26a761,_0x5bd244,_0x175885,_0x99c2e9);return _0x5bd244['panelView']['children']['add'](_0x11e9fe),_0x99c2e9&&_0x5bd244['on']('change:isOpen',(_0x56190d,_0x2c7b2d,_0x72a726)=>{if(_0x72a726){if(_0x20ed65['plugins']['has']('AIEditing')){const _0x13ace7=_0x20ed65['plugins']['get'](tn),_0x582640=_0x20ed65['model']['document']['selection'],_0x2fc0de=Array['from'](_0x582640['getRanges']());_0x2fc0de['length']>0x0&&_0x13ace7['showFakeVisualSelection']({'ranges':_0x2fc0de,'id':'quick-action','priority':0x14});}}else _0x20ed65['plugins']['has']('AIEditing')&&_0x20ed65['plugins']['get'](tn)['hideFakeVisualSelection']('quick-action'),_0x11e9fe['resetSearch']();}),_0x5bd244;};}const Ga='<task>For\x20given\x20selected\x20part\x20of\x20HTML\x20document\x20you\x20must\x20explain\x20the\x20meaning\x20of\x20it\x27s\x20content\x20clearly\x20and\x20in\x20plain\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).Avoid\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><constraints>1.\x20You\x20MUST\x20NOT\x20perform\x20any\x20edits\x20or\x20modifications\x20on\x20provided\x20document.2.\x20You\x20MUST\x20NOT\x20include\x20document\x20modifications\x20in\x20your\x20response.3.\x20Your\x20message\x20should\x20only\x20include\x20explanation.\x20Do\x20not\x20add\x20any\x20additional\x20text,\x20flattery,\x20questions\x20or\x20followup\x20suggestions.</constraints>',Fa='<task>For\x20the\x20given\x20selected\x20part\x20of\x20an\x20HTML\x20document\x20you\x20must\x20summarize\x20its\x20content\x20in\x20a\x20few\x20sentences,\x20keeping\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><constraints>1.\x20You\x20MUST\x20NOT\x20perform\x20any\x20edits\x20or\x20modifications\x20on\x20the\x20provided\x20document.2.\x20You\x20MUST\x20NOT\x20include\x20document\x20modifications\x20in\x20your\x20response.3.\x20Your\x20message\x20should\x20only\x20include\x20the\x20summary.\x20Do\x20not\x20add\x20any\x20additional\x20text,\x20flattery,\x20questions\x20or\x20followup\x20suggestions.</constraints>',Ka='<task>For\x20the\x20given\x20selected\x20part\x20of\x20an\x20HTML\x20document\x20you\x20must\x20extract\x20and\x20present\x20the\x20key\x20points\x20from\x20its\x20content.</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><constraints>1.\x20You\x20MUST\x20NOT\x20perform\x20any\x20edits\x20or\x20modifications\x20on\x20the\x20provided\x20document.2.\x20You\x20MUST\x20NOT\x20include\x20document\x20modifications\x20in\x20your\x20response.3.\x20Your\x20message\x20should\x20only\x20include\x20the\x20extracted\x20key\x20points.\x20Do\x20not\x20add\x20any\x20additional\x20text,\x20flattery,\x20questions\x20or\x20followup\x20suggestions.</constraints>';var Wa=function(_0x349d74){return _0x349d74['chat']='AIChat',_0x349d74['action']='AIActions',_0x349d74;}({});class Ya extends _0x10493d{static get['requires'](){return[_0x24e423,ls];}static get['pluginName'](){return'AIQuickActionsUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}async['init'](){const _0x5a8ddd=await this['_getDefaultAndCustomActions']();this['_prepareQuickActionsDefinition'](_0x5a8ddd),this['_initializeQuickActionsComponentsAndCommands']();}static['getDefaultQuickActions'](_0x5058e6){return function(_0x1a7d58){const _0x55f1da=new Intl['DisplayNames'](['en'],{'type':'language'})['of'](_0x1a7d58['uiLanguage']),_0x4c07a6=_0x55f1da||'English',_0x296167=[{'id':'ask-ai','label':us(_0x1a7d58,'AI_QUICK_ACTIONS_ASK_AI'),'type':no['CHAT'],'icon':_0xb5a195},{'id':'chat-commands','label':us(_0x1a7d58,'AI_QUICK_ACTIONS_CHAT_COMMANDS'),'icon':_0xb5a195,'actions':[{'id':'explain','label':us(_0x1a7d58,'AI_QUICK_ACTIONS_EXPLAIN'),'displayedPrompt':us(_0x1a7d58,'AI_QUICK_ACTIONS_EXPLAIN'),'prompt':Ga['replace']('%0',_0x4c07a6),'type':no['CHAT']},{'id':'summarize','label':us(_0x1a7d58,'AI_QUICK_ACTIONS_SUMMARIZE'),'displayedPrompt':us(_0x1a7d58,'AI_QUICK_ACTIONS_SUMMARIZE'),'prompt':Fa['replace']('%0',_0x4c07a6),'type':no['CHAT']},{'id':'highlight-key-points','label':us(_0x1a7d58,'AI_QUICK_ACTIONS_HIGHLIGHT_KEY_POINTS'),'displayedPrompt':us(_0x1a7d58,'AI_QUICK_ACTIONS_HIGHLIGHT_KEY_POINTS'),'prompt':Ka['replace']('%0',_0x4c07a6),'type':no['CHAT']}]},{'id':'improve-writing','label':us(_0x1a7d58,'AI_QUICK_ACTIONS_IMPROVE_WRITING'),'type':no['ACTION'],'icon':_0x59dc92},{'id':'continue','label':us(_0x1a7d58,'AI_QUICK_ACTIONS_CONTINUE_WRITING'),'type':no['ACTION'],'icon':_0x3049bb},{'id':'fix-grammar','label':us(_0x1a7d58,'AI_QUICK_ACTIONS_FIX_GRAMMAR_SPELLING'),'type':no['ACTION'],'icon':_0x2fb0ae},{'id':'adjust-length','label':us(_0x1a7d58,'AI_QUICK_ACTIONS_ADJUST_LENGTH'),'icon':_0x2b09aa,'actions':[{'id':'make-shorter','label':us(_0x1a7d58,'AI_QUICK_ACTIONS_MAKE_SHORTER'),'type':no['ACTION']},{'id':'make-longer','label':us(_0x1a7d58,'AI_QUICK_ACTIONS_MAKE_LONGER'),'type':no['ACTION']}]},{'id':'change-tone','label':us(_0x1a7d58,'AI_QUICK_ACTIONS_CHANGE_TONE'),'icon':_0x1ae53f,'actions':[{'id':'make-tone-casual','label':us(_0x1a7d58,'AI_QUICK_ACTIONS_MORE_CASUAL'),'type':no['ACTION']},{'id':'make-tone-direct','label':us(_0x1a7d58,'AI_QUICK_ACTIONS_MORE_DIRECT'),'type':no['ACTION']},{'id':'make-tone-friendly','label':us(_0x1a7d58,'AI_QUICK_ACTIONS_MORE_FRIENDLY'),'type':no['ACTION']},{'id':'make-tone-confident','label':us(_0x1a7d58,'AI_QUICK_ACTIONS_MORE_CONFIDENT'),'type':no['ACTION']},{'id':'make-tone-professional','label':us(_0x1a7d58,'AI_QUICK_ACTIONS_MORE_PROFESSIONAL'),'type':no['ACTION']}]},{'id':'translate','label':us(_0x1a7d58,'AI_QUICK_ACTIONS_TRANSLATE'),'icon':_0x24ec53,'actions':[{'id':'translate-to-english','label':us(_0x1a7d58,'AI_QUICK_ACTIONS_TRANSLATE_ENGLISH'),'type':no['ACTION'],'actionName':'translate','args':{'language':'english'}},{'id':'translate-to-chinese','label':us(_0x1a7d58,'AI_QUICK_ACTIONS_TRANSLATE_CHINESE'),'type':no['ACTION'],'actionName':'translate','args':{'language':'chinese'}},{'id':'translate-to-spanish','label':us(_0x1a7d58,'AI_QUICK_ACTIONS_TRANSLATE_SPANISH'),'type':no['ACTION'],'actionName':'translate','args':{'language':'spanish'}},{'id':'translate-to-german','label':us(_0x1a7d58,'AI_QUICK_ACTIONS_TRANSLATE_GERMAN'),'type':no['ACTION'],'actionName':'translate','args':{'language':'german'}},{'id':'translate-to-french','label':us(_0x1a7d58,'AI_QUICK_ACTIONS_TRANSLATE_FRENCH'),'type':no['ACTION'],'actionName':'translate','args':{'language':'french'}},{'id':'translate-to-japanese','label':us(_0x1a7d58,'AI_QUICK_ACTIONS_TRANSLATE_JAPANESE'),'type':no['ACTION'],'actionName':'translate','args':{'language':'japanese'}},{'id':'translate-to-portuguese','label':us(_0x1a7d58,'AI_QUICK_ACTIONS_TRANSLATE_PORTUGUESE'),'type':no['ACTION'],'actionName':'translate','args':{'language':'portuguese'}},{'id':'translate-to-korean','label':us(_0x1a7d58,'AI_QUICK_ACTIONS_TRANSLATE_KOREAN'),'type':no['ACTION'],'actionName':'translate','args':{'language':'korean'}},{'id':'translate-to-italian','label':us(_0x1a7d58,'AI_QUICK_ACTIONS_TRANSLATE_ITALIAN'),'type':no['ACTION'],'actionName':'translate','args':{'language':'italian'}},{'id':'translate-to-russian','label':us(_0x1a7d58,'AI_QUICK_ACTIONS_TRANSLATE_RUSSIAN'),'type':no['ACTION'],'actionName':'translate','args':{'language':'russian'}}]},{'id':'other','label':us(_0x1a7d58,'AI_QUICK_ACTIONS_OTHER'),'icon':tt,'actions':[]}];return _0x296167;}(_0x5058e6);}async['_getDefaultAndCustomActions'](){const _0x42c421=Ya['getDefaultQuickActions'](this['editor']['locale']),_0x40bc3f=this['editor']['config']['get']('ai.quickActions.extraCommands')||[];let _0x196555=[];try{_0x196555=await new qs({'connector':this['editor']['plugins']['get']('AIConnector'),'locale':this['editor']['locale']})['getAll']();}catch(_0x3ef506){const _0x184400=new ht('ai-quick-actions-models-unable-to-retrieve',this,{'error':_0x3ef506});mt(_0x184400['message']);}finally{const _0xe74d6b=_0x40bc3f['map'](_0xfd9d79=>({..._0xfd9d79,'type':'chat'===_0xfd9d79['type']?no['CHAT']:no['ACTION'],'icon':void 0x0}));_0x42c421['find'](_0x34c5a7=>'other'===_0x34c5a7['id'])['actions']['push'](..._0xe74d6b),_0x42c421['forEach'](_0x28d4d8=>{if('actions'in _0x28d4d8)_0x28d4d8['actions']['forEach'](_0x7b0880=>{if(_0x7b0880['isEnabled']=!!_0x196555['find'](_0x3d2df5=>_0x3d2df5['id']===_0x7b0880['model'])||void 0x0===_0x7b0880['model'],!_0x7b0880['isEnabled']){const _0x5e9d57=new ht('ai-quick-actions-unavailable-model',this,{'actionId':_0x7b0880['id'],'modelId':_0x7b0880['model']});mt(_0x5e9d57['message']);}});else{if(_0x28d4d8['isEnabled']=!!_0x196555['find'](_0x20e388=>_0x20e388['id']===_0x28d4d8['model'])||void 0x0===_0x28d4d8['model'],!_0x28d4d8['isEnabled']){const _0x31be90=new ht('ai-quick-actions-unavailable-model',this,{'actionId':_0x28d4d8['id'],'modelId':_0x28d4d8['model']});mt(_0x31be90['message']);}}});}return _0x42c421;}['_initializeQuickActionsComponentsAndCommands'](){const _0x8d1b5a=new Qt(this['editor']['locale']);_0x8d1b5a['attachToDom'](),this['_initializeQuickActionsDropdown'](_0x8d1b5a),this['_initializeQuickActionsMenuBar'](),this['_initializeQuickActionsComponents'](_0x8d1b5a);}['_initializeQuickActionsDropdown'](_0x7df313){const _0x427ccb=this['editor']['config']['get']('ai.quickActions.isSearchEnabled')??!0x0;this['editor']['ui']['componentFactory']['add']('aiQuickActions',Ba({'editor':this['editor'],'content':this['_quickActionsDefinition'],'buttonDefinition':{'icon':_0x4ba3ea,'label':us(this['editor']['locale'],'AI_QUICK_ACTIONS_HEADING')},'bodyCollection':_0x7df313,'hasSearch':_0x427ccb}));}['_prepareQuickActionsDefinition'](_0x5b9fdd){this['_quickActionsDefinition']=_0x5b9fdd['map'](_0x5aafa5=>{if('actions'in _0x5aafa5){const _0x2d1410=_0x5aafa5;return{..._0x2d1410,'actions':_0x2d1410['actions']['map'](_0x2192e4=>{const {actions:_0x58fb56,..._0x64e991}=_0x2d1410;return{..._0x2192e4,'parent':_0x64e991};})['filter'](_0xc55ea9=>this['_shouldIncludeAction'](_0xc55ea9))};}return _0x5aafa5;})['filter'](_0x4171e9=>'actions'in _0x4171e9?_0x4171e9['actions']['length']>0x0:this['_shouldIncludeAction'](_0x4171e9));}['_shouldIncludeAction'](_0x355b82){const _0x588bf4=this['editor']['config']['get']('ai.quickActions.removeCommands')||[];return this['editor']['plugins']['has'](Wa[_0x355b82['type']])&&!_0x588bf4['includes'](_0x355b82['id'])&&!(_0x355b82['type']===no['CHAT']&&!0x1===this['editor']['config']['get']('ai.chat.context.document.enabled'));}['_initializeQuickActionsComponents'](_0x345a26){this['_quickActionsDefinition']['forEach'](_0xb3c4c1=>{if('actions'in _0xb3c4c1){const _0x551ff3=Ba({'editor':this['editor'],'content':_0xb3c4c1['actions'],'buttonDefinition':_0xb3c4c1,'bodyCollection':_0x345a26});this['editor']['ui']['componentFactory']['add'](_0xb3c4c1['id'],_0x551ff3),_0xb3c4c1['actions']['forEach'](_0x22038a=>{const _0x457671=Da({'editor':this['editor'],'action':_0x22038a});this['editor']['ui']['componentFactory']['add'](_0x22038a['id'],_0x457671);});}else{const _0x339a4a=Da({'editor':this['editor'],'action':_0xb3c4c1,'withText':!0x1,'withIcon':!0x0,'isInDropdown':!0x1});this['editor']['ui']['componentFactory']['add'](_0xb3c4c1['id'],_0x339a4a);}});}['_initializeQuickActionsMenuBar'](){this['editor']['ui']['componentFactory']['add']('menuBar:aiQuickActions',_0x15c784=>{const _0x6260af=new Kt(_0x15c784),_0x860066=us(_0x15c784,'AI_QUICK_ACTIONS_HEADING');_0x6260af['buttonView']['set']({'label':_0x860066,'icon':_0x4ba3ea});const _0x16fd91=new $t(_0x15c784);_0x16fd91['set']({'ariaLabel':_0x860066,'role':'menu'}),this['_quickActionsDefinition']['forEach'](_0x5ab3f4=>{if('actions'in _0x5ab3f4){const _0x2f1253=_0x5ab3f4,_0x330454=new qt(_0x15c784,_0x6260af),_0x4d9d82=new Kt(_0x15c784),_0x4b5051=new $t(_0x15c784);_0x4d9d82['buttonView']['set']({'label':_0x2f1253['label'],'icon':_0x2f1253['icon']}),_0x2f1253['actions']['forEach'](_0x35bbc2=>{const _0x2384f2=new qt(_0x15c784,_0x4d9d82),_0x322cb4=new Wt(_0x15c784);_0x322cb4['set']({'label':_0x35bbc2['label'],'icon':_0x35bbc2['icon'],'role':'menuitem','isEnabled':_0x35bbc2['isEnabled']}),_0x322cb4['on']('execute',()=>{this['_executeQuickAction'](_0x35bbc2);}),_0x322cb4['delegate']('execute')['to'](_0x4d9d82),_0x2384f2['children']['add'](_0x322cb4),_0x4b5051['items']['add'](_0x2384f2);}),_0x4d9d82['panelView']['children']['add'](_0x4b5051),_0x330454['children']['add'](_0x4d9d82),_0x16fd91['items']['add'](_0x330454);}else{const _0x55c88f=_0x5ab3f4,_0x3deff6=new qt(_0x15c784,_0x6260af),_0xcc921f=new Wt(_0x15c784);_0xcc921f['set']({'label':_0x55c88f['label'],'icon':_0x55c88f['icon'],'role':'menuitem','isEnabled':_0x55c88f['isEnabled']}),_0xcc921f['on']('execute',()=>{this['_executeQuickAction'](_0x55c88f);}),_0xcc921f['delegate']('execute')['to'](_0x6260af),_0x3deff6['children']['add'](_0xcc921f),_0x16fd91['items']['add'](_0x3deff6);}});const _0x1b6a02=Object['values'](Wa)['some'](_0x4fa9e9=>this['editor']['plugins']['has'](_0x4fa9e9));return _0x6260af['set']({'isEnabled':_0x1b6a02}),_0x6260af['panelView']['children']['add'](_0x16fd91),_0x6260af;});}['_executeQuickAction'](_0x2260ae){const _0x1f6e61=this['editor'];_0x1f6e61['editing']['view']['focus'](),_0x1f6e61['commands']['execute']('aiQuickAction',_0x2260ae);const _0x1ea28f=_0x1f6e61['ui']['view']['menuBarView'];_0x1ea28f&&_0x1ea28f['close']&&_0x1ea28f['close']();}}class $a extends _0x10c9cf{['execute'](_0x7fd62){switch(this['_expandSelectionIfCollapsed'](),_0x7fd62['type']){case no['CHAT']:if(!this['editor']['plugins']['has']('AIChat')){const _0x18ead1=us(this['editor']['locale'],'AI_QUICK_ACTIONS_PLUGIN_NOT_FOUND','AIChat');throw new ht('ai-quick-actions-plugin-not-found',this['editor'],{'errorMessage':_0x18ead1});}this['_handleAIChatAction'](_0x7fd62);break;case no['ACTION']:if(!this['editor']['plugins']['has']('AIActions')){const _0x306ef1=us(this['editor']['locale'],'AI_QUICK_ACTIONS_PLUGIN_NOT_FOUND','AIActions');throw new ht('ai-quick-actions-plugin-not-found',this['editor'],{'errorMessage':_0x306ef1});}this['_handleAIActionsAction'](_0x7fd62);}}async['_handleAIChatAction'](_0x383582){const _0x5f2b04=this['editor']['plugins']['get']('AIChatController'),_0x362c58=this['editor']['plugins']['get']('AITabs')['view'];if(_0x362c58['isVisible']||(_0x362c58['isVisible']=!0x0),'chat'!==_0x362c58['activeTab']&&_0x362c58['activateTab']('chat'),'ask-ai'===_0x383582['id'])_0x5f2b04['removeSelectionFromChatContext'](),_0x5f2b04['addSelectionToChatContext'](),_0x5f2b04['focusPromptInput']();else await _0x5f2b04['startConversation'](),_0x5f2b04['removeSelectionFromChatContext'](),_0x5f2b04['addSelectionToChatContext'](),_0x5f2b04['focusPromptInput'](),await _0x5f2b04['sendMessage']({'message':_0x383582['prompt']||_0x383582['displayedPrompt']||_0x383582['label'],'attributes':{'quickActionData':{'id':_0x383582['id']},'displayedPrompt':_0x383582['displayedPrompt']}});}['_expandSelectionIfCollapsed'](){const _0x3b4f08=this['editor'],_0x434c77=_0x3b4f08['model']['document']['selection'];if(!_0x434c77['isCollapsed'])return;const _0x55a39f=It(_0x434c77['getSelectedBlocks']())||_0x3b4f08['model']['schema']['getLimitElement'](_0x434c77);_0x3b4f08['model']['change'](_0x1f4c08=>{_0x1f4c08['setSelection'](_0x55a39f,'in');});}['_handleAIActionsActionLabel'](_0x188ef4){return _0x188ef4['parent']?.['label']&&'other'!==_0x188ef4['parent']?.['id']?_0x188ef4['parent']['label']+':\x20'+_0x188ef4['label']:_0x188ef4['label'];}async['_handleAIActionsAction'](_0x3c21cc){const _0x25e369=this['editor']['plugins']['get']('AIActions'),_0x3a633a=_0x3c21cc['prompt']?{'userMessage':_0x3c21cc['prompt'],'model':_0x3c21cc['model']}:{'actionName':_0x3c21cc['actionName']||_0x3c21cc['id'],'args':_0x3c21cc['args']},_0x2c19e3=this['_handleAIActionsActionLabel'](_0x3c21cc);await _0x25e369['executeAction'](_0x3a633a,_0x2c19e3,_0x3c21cc['icon']);}}class qa extends _0x10493d{static get['pluginName'](){return'AIQuickActionsEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const _0x204f76=this['editor'],_0x285ce2=new $a(this['editor']);if(_0x204f76['commands']['add']('aiQuickAction',_0x285ce2),_0x204f76['plugins']['has']('AIChat')){const _0xa2cbfb=this['editor']['plugins']['get']('AIChatController');_0x204f76['model']['document']['selection']['on']('change:range',(_0x42f149,_0x286edf)=>{_0x286edf['directChange']&&_0xa2cbfb['removeSelectionFromChatContext']();});}}}class Qa extends Ps{['updateChangeGroups'](){if(this['parsedMergedContent']=this['parsedContent']['cloneNode'](!0x0),0x0==this['parsedMergedContent']['childNodes']['length'])return void(this['changeGroups']=[]);const _0x564479=this['documentContextContent']['children']['map'](_0x23c06c=>({'node':_0x23c06c,'id':ms(_0x23c06c,'data-id')})),_0x2947f5=this['parsedMergedContent']['children']['map'](_0x9ed1d3=>({'node':_0x9ed1d3,'id':ms(_0x9ed1d3,'data-id')||ot()})),_0x27efbc=_0x20e0b5(_0x564479,_0x2947f5,{'comparator':(_0x2d9513,_0x5ed3af)=>_0x2d9513['id']==_0x5ed3af['id'],'oneChangePerToken':!0x0});if(!this['isDone']){for(;_0x27efbc['length']&&_0x27efbc[_0x27efbc['length']-0x1]['removed'];)_0x27efbc['pop']();}const _0x1c3583=_0x27efbc['map'](_0x33aec9=>{const _0x4fa256=_0x33aec9['added']?'new':_0x33aec9['removed']?'removed':'modified';return{'node':_0x33aec9['value'][0x0]['node'],'type':_0x4fa256,'id':_0x33aec9['value'][0x0]['id']};});this['changeGroups']=[{'changes':_0x1c3583,'state':'pending','index':0x0}];}['_getDifferentChangeGroups'](_0xbb8aba,_0x5dda2b){return _0x5dda2b;}}class Xa extends Ms{['content'];['version'];['actionName'];['args'];['userMessage'];['model'];['hasError']=!0x1;constructor(_0x2ca447){super(_0x2ca447),this['content']=_0x2ca447['content'],this['version']=_0x2ca447['version'],this['actionName']=_0x2ca447['actionName'],this['args']=_0x2ca447['args'],this['userMessage']=_0x2ca447['userMessage'],this['model']=_0x2ca447['model'];}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':Us['TEXT'],'content':this['content'],'version':this['version'],'label':'Current\x20document','uiId':'current-document'};}['createReply'](_0x444f60){const _0x1bf293=new Qa({'editor':this['editor'],'documentContextContent':this['content'],..._0x444f60});return this['replies']['push'](_0x1bf293),_0x1bf293['delegate'](...Hs)['to'](this),this['fire']('replyCreated',_0x1bf293),_0x1bf293;}}class za extends kt{constructor(_0x5b55b1,_0x2cfc9f=!0x0,_0x4d6a46=!0x0){super(_0x5b55b1),this['set']('isEnabled',!0x1),_0x2cfc9f&&(this['applyButton']=this['_createButton'](us(_0x5b55b1,'AI_BALLOON_APPLY_BUTTON'),ds),this['applyButton']['bind']('isEnabled')['to'](this),this['items']['add'](this['applyButton'])),_0x4d6a46&&(this['suggestButton']=this['_createButton'](us(_0x5b55b1,'AI_BALLOON_SUGGEST_BUTTON'),_0x2cfc9f?_s:ds),this['suggestButton']['bind']('isEnabled')['to'](this),this['items']['add'](this['suggestButton'])),this['setButtonsVisibility']({'showApplyButton':_0x2cfc9f,'showSuggestButton':_0x4d6a46}),this['extendTemplate']({'attributes':{'class':['ck-ai-balloon__toolbar']}});}['setButtonsVisibility']({showApplyButton:_0x91e99b,showSuggestButton:_0x5d450d}){this['applyButton']&&(this['applyButton']['isVisible']=_0x91e99b),this['suggestButton']&&(this['suggestButton']['isVisible']=_0x5d450d);}['_createButton'](_0x1b42a6,_0x3b19ed){const _0x13fcfa=new Nt(this['locale']);return _0x13fcfa['set']({'label':_0x1b42a6,'class':_0x3b19ed,'isVisible':!0x0,'withText':!0x0}),_0x13fcfa;}}class ja extends vt{constructor(_0x2c0532){super(_0x2c0532),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-balloon__disclaimer']},'children':[{'tag':'p','attributes':{'class':['ck','ck-ai-balloon__disclaimer-content']},'children':[{'text':us(_0x2c0532,'AI_DISCLAIMER_TEXT')}]}]});}}class Ja extends vt{constructor(_0x4f0122){super(_0x4f0122),this['set']('isVisible',!0x0);const _0x48ca80=new vn('small');_0x48ca80['isVisible']=!0x0;const _0x17dc8d=new vt(this['locale']);_0x17dc8d['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai-suggestion__loader-text']},'children':[us(this['locale'],'AI_CHAT_IS_WRITING')]}),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__loader',this['bindTemplate']['if']('isVisible','ck-hidden',_0x460ab0=>!_0x460ab0)]},'children':[_0x48ca80,_0x17dc8d]});}}class Za extends Ra{['focusCycler'];['_config'];['_contentWrapper'];['_streamableContentView'];['_toolbarView'];['_miniToolbarView'];['_loaderView'];['_disclaimerView'];['_focusTracker'];['_keystrokes'];['_dialogContent'];['_focusables'];['_scrollManager'];['_navigationPreviousButton'];['_navigationNextButton'];['_navigationTryAgainButton'];['_navigationCounter'];constructor(_0x26d8ab,_0x39d5a2){super(_0x26d8ab),this['set']('isBusy',!0x1),this['set']('isTrackChangesOn',!0x1),this['set']('_isLoading',!0x1),this['set']('_hasError',!0x1),this['_config']=_0x39d5a2,this['_focusTracker']=new At(),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 _0x54be0e(),this['_addContentWrapper'](_0x39d5a2),this['_addDisclaimerView'](),this['_addToolbar'](_0x39d5a2),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'](_0x39d5a2);});}['render'](){super['render']();for(const _0x2089cb of this['_focusables'])this['_focusTracker']['add'](_0x2089cb['element']);this['_keystrokes']['listenTo'](this['element']),this['_initializeScrollManager']();}['destroy'](){super['destroy'](),this['_scrollManager']&&this['_scrollManager']['destroy']();}['focus'](_0x17680d){-0x1===_0x17680d?this['focusCycler']['focusLast']():this['focusCycler']['focusFirst']();}['setIsLoading'](_0x3155bc){this['_isLoading']=_0x3155bc;}['setErrorState'](){this['_hasError']=!0x0,this['_miniToolbarView']['toggleShowChangesEnabled'](!0x1);}['clearErrorState'](){this['_hasError']=!0x1,this['_miniToolbarView']['toggleShowChangesEnabled'](!0x0);}['showError'](_0x42eb48){super['showError'](_0x42eb48),this['_dialogContent']['has'](this['_errorView'])||this['_dialogContent']['add'](this['_errorView'],0x0);}['hideError'](){super['hideError'](),this['clearErrorState']();}['showBlockingError'](_0x4d518d){super['showBlockingError'](_0x4d518d),this['setErrorState']();}['addMiniToolbarItem'](_0x5b9025){this['_miniToolbarView']['items']['has'](_0x5b9025)||this['_miniToolbarView']['items']['add'](_0x5b9025);}['removeMiniToolbarItem'](_0x1fe760){this['_miniToolbarView']['items']['has'](_0x1fe760)&&this['_miniToolbarView']['items']['remove'](_0x1fe760);}['showLoader'](){this['_loaderView']&&(this['_isLoading']=!0x0);}['hideLoader'](){this['_loaderView']&&(this['_isLoading']=!0x1);}['_toggleToolbarButtonsVisibility']({showApplyButton:_0x51d1b3,showSuggestButton:_0x21a1c3}){_0x51d1b3=_0x51d1b3&&!this['isTrackChangesOn']&&this['_config']['availableActions']['includes']('applySuggestion'),_0x21a1c3=_0x21a1c3&&this['_config']['availableActions']['includes']('insertSuggestion'),this['_toolbarView']['setButtonsVisibility']({'showApplyButton':_0x51d1b3,'showSuggestButton':_0x21a1c3});}async['updateContent'](_0x348a08){await this['_streamableContentView']['update'](_0x348a08);}['clearContent'](){this['_streamableContentView']['clear']();}['_addContentWrapper'](_0x45e574){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'](_0x45e574['miniToolbarConfig'])]}),this['_dialogContent']['add'](this['_contentWrapper']);}['_addDisclaimerView'](){this['_disclaimerView']=new ja(this['locale']),this['_dialogContent']['add'](this['_disclaimerView']);}['_addToolbar']({showApplyButton:_0x4d0afb,showSuggestButton:_0x144674}){this['_toolbarView']=new za(this['locale'],_0x4d0afb,_0x144674),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',(_0x132aa6,_0x4a5c24,_0x562483)=>!(_0x132aa6||_0x4a5c24||_0x562483)),this['_toggleToolbarButtonsVisibility']({'showApplyButton':_0x4d0afb,'showSuggestButton':_0x144674}),this['_dialogContent']['add'](this['_toolbarView']);}['_createMiniToolbar'](_0x1750c5){return this['_miniToolbarView']=new Na(this['locale'],_0x1750c5),this['_miniToolbarView']['delegate'](...en)['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',(_0x29946c,_0x161075)=>!(_0x29946c||_0x161075)),this['_miniToolbarView'];}['_createLoaderView'](){return this['_loaderView']=new Ja(this['locale']),this['_loaderView']['bind']('isVisible')['to'](this,'_isLoading'),this['_loaderView'];}['_createStreamableContentView'](){return this['_streamableContentView']=new pn(this['locale']),this['_streamableContentView'];}['_setupMiniToolbarButtons'](){const _0x5a3e26=new Nt(this['locale']),_0x18efff=new Nt(this['locale']),_0xaf0fb7=new to(this['locale']),_0x4a377d=new Nt(this['locale']);_0x5a3e26['set']({'icon':et,'label':us(this['locale'],'AI_ACTIONS_TRY_AGAIN'),'tooltip':!0x0,'class':'ck-ai-custom-action-button\x20'+As}),_0x18efff['set']({'icon':_0x10fb63,'tooltip':us(this['locale'],'AI_ACTIONS_PREVIOUS_INTERACTION'),'class':'ck-ai-navigation-button\x20ck-ai-previous-button\x20'+As}),_0x4a377d['set']({'icon':it,'tooltip':us(this['locale'],'AI_ACTIONS_NEXT_INTERACTION'),'class':'ck-ai-navigation-button\x20ck-ai-next-button\x20'+As}),_0x5a3e26['bind']('isEnabled')['to'](this,'isBusy',_0x1ebe8a=>!_0x1ebe8a),_0x5a3e26['on']('execute',()=>{this['fire']('tryAgain');}),_0x18efff['bind']('isEnabled')['to'](this,'isBusy',_0x2125fc=>!_0x2125fc),_0x18efff['on']('execute',()=>{this['fire']('showPrevious');}),_0x4a377d['bind']('isEnabled')['to'](this,'isBusy',_0xdb28dd=>!_0xdb28dd),_0x4a377d['on']('execute',()=>{this['fire']('showNext');}),this['_navigationPreviousButton']=_0x18efff,this['_navigationCounter']=_0xaf0fb7,this['_navigationNextButton']=_0x4a377d,this['_navigationTryAgainButton']=_0x5a3e26;}['updateMiniToolbarButtons'](_0x5008ff,_0x193cdb){this['_navigationPreviousButton']||this['_setupMiniToolbarButtons']();const _0x3dc844=_0x5008ff>0x1;if(this['addMiniToolbarItem'](this['_navigationTryAgainButton']),_0x3dc844){this['addMiniToolbarItem'](this['_navigationPreviousButton']),this['addMiniToolbarItem'](this['_navigationCounter']),this['addMiniToolbarItem'](this['_navigationNextButton']);const _0x345070=_0x5008ff-_0x193cdb;this['_navigationCounter']['setInteractionCount'](_0x345070+'/'+_0x5008ff),this['_navigationPreviousButton']['isEnabled']=_0x193cdb<_0x5008ff-0x1,this['_navigationNextButton']['isEnabled']=_0x193cdb>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'](_0x1212b2){this['_isLoading']=_0x1212b2;}['resetShowChangesButton'](){this['_miniToolbarView']['isShowChangesOn']=!0x1;}['_initializeScrollManager'](){const _0x53718b=this['_getScrollableElement']();_0x53718b&&!this['_scrollManager']&&(this['_scrollManager']=new ir(_0x53718b));}['_getScrollableElement'](){return this['_streamableContentView']['element'];}}class to extends vt{constructor(_0x1ae447){super(_0x1ae447);const _0x494b8e=this['bindTemplate'];this['set']('interactionCount','1/1'),this['setTemplate']({'tag':'span','attributes':{'class':['ck-ai-interaction-counter']},'children':[{'text':_0x494b8e['to']('interactionCount')}]});}['setInteractionCount'](_0x4d485c){this['set']('interactionCount',_0x4d485c);}}class eo extends _0x10493d{static get['requires'](){return[ls,Bt,tn,ka,_0x43d889];}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(_0x2fe776){super(_0x2fe776),this['_bodyCollection']=new Qt(this['editor']['locale']),this['_bodyCollection']['attachToDom'](),this['_aiConnector']=this['editor']['plugins']['get']('AIConnector'),this['set']('isBusy',!0x1),this['_promiseQueue']=new mn();}['stopInteraction'](){this['_stopInteraction']();}async['executeAction'](_0x52bf33,_0x1142d5,_0x3dc822){if(this['_stopInteraction'](),this['editor']['plugins']['has']('TableSelection')){if(this['editor']['plugins']['get']('TableSelection')['getSelectedTableCells']()){const {modelFragment:_0xf97c4,anchorData:_0x528e61}=this['_getExecuteDataInTable']();return this['_executeAction'](_0x52bf33,_0xf97c4,_0x528e61,_0x1142d5,_0x3dc822);}}const {modelFragment:_0x8c1530,anchorData:_0x147585}=this['_getExecuteDataRegular']();return this['_executeAction'](_0x52bf33,_0x8c1530,_0x147585,_0x1142d5,_0x3dc822);}async['destroy'](){return this['_stopInteraction'](),this['_bodyCollection']['detachFromDom'](),super['destroy']();}['_createActionsBalloonView'](){const _0x46735b=this['editor']['plugins']['has']('TrackChanges');let _0x17dc12=this['editor']['config']['get']('ai.availableReplyActions')||[...wn];_0x46735b||(_0x17dc12=_0x17dc12['filter'](_0x1b659e=>'insertSuggestion'!=_0x1b659e));const _0x4173f6=this['editor']['commands']['get']('trackChanges'),_0x21a58f=new Za(this['editor']['locale'],{'showApplyButton':!0x0,'showSuggestButton':_0x46735b,'miniToolbarConfig':{'showChanges':'icon'},'availableActions':_0x17dc12});return _0x21a58f['bind']('isBusy')['to'](this),_0x4173f6&&_0x21a58f['bind']('isTrackChangesOn')['to'](_0x4173f6,'value'),_0x21a58f['on']('tryAgain',()=>{this['_refreshInteraction']();}),_0x21a58f['on']('showPrevious',()=>{this['_navigateToPrevious']();}),_0x21a58f['on']('showNext',()=>{this['_navigateToNext']();}),_0x21a58f;}['_getExecuteDataRegular'](){const _0x528b65=this['editor']['model']['document']['selection'];if(_0x528b65['isCollapsed']){const _0x19e075=It(_0x528b65['getSelectedBlocks']())||this['editor']['model']['schema']['getLimitElement'](_0x528b65);this['editor']['model']['change'](_0x1ec2c8=>{_0x1ec2c8['setSelection'](_0x19e075,'in');});}const _0x2e8a79=_0x528b65['getFirstRange'](),_0x4f2550=this['_wrapWithCommonAncestors'](this['editor']['model']['getSelectedContent'](_0x528b65),_0x2e8a79['start'],_0x2e8a79['end']);this['_copyMarkersToFragment'](_0x4f2550,_0x528b65,{'isTableSelection':!0x1});const _0x5cbb49=_0x528b65['getFirstRange']()['start'],_0x4a0402=new Map();let _0x3580d0=_0x4f2550;for(let _0x5613a5=0x0;_0x5613a5<_0x5cbb49['path']['length'];_0x5613a5++)_0x4a0402['set'](_0x3580d0,_0x5cbb49['path'][_0x5613a5]),_0x3580d0=_0x3580d0['getChild'](0x0);return{'modelFragment':_0x4f2550,'anchorData':_0x4a0402};}['_getExecuteDataInTable'](){const _0x22eb86=this['editor']['model']['document']['selection'],_0x317a97=this['editor']['plugins']['get']('TableSelection')['getSelectionAsFragment'](),_0x4d3bb3=_0x22eb86['getFirstRange']()['start']['parent']['parent'],_0x5ce8bb=this['editor']['model']['createRange'](this['editor']['model']['createPositionBefore'](_0x4d3bb3),this['editor']['model']['createPositionAfter'](_0x4d3bb3)),_0x4ecc72=this['_wrapWithCommonAncestors'](_0x317a97,_0x5ce8bb['start'],_0x5ce8bb['end']);this['_copyMarkersToFragment'](_0x4ecc72,_0x22eb86,{'isTableSelection':!0x0});const _0x5bae3a=_0x22eb86['getFirstRange']()['start'],_0x1af5a6=new Map();let _0x1b4786=_0x4ecc72;for(let _0x5add6a=0x0;_0x5add6a<_0x5bae3a['path']['length'];_0x5add6a++)if(_0x1af5a6['set'](_0x1b4786,_0x5bae3a['path'][_0x5add6a]),_0x5add6a<_0x5bae3a['path']['length']-0x1)_0x1b4786=_0x1b4786['getChild'](0x0);else{let _0x12dd86=_0x1b4786['nextSibling'];for(;_0x12dd86;)_0x1af5a6['set'](_0x12dd86,_0x5bae3a['path'][_0x5add6a]),_0x12dd86=_0x12dd86['nextSibling'];}return{'modelFragment':_0x4ecc72,'anchorData':_0x1af5a6};}async['_executeAction'](_0x1fffc5,_0x21ca53,_0x51d2c9,_0x488749,_0x45de1c){const _0x93f04=this['editor']['plugins']['get'](tn),_0x59344e=this['editor']['plugins']['get'](ka),_0x3240a8=this['editor']['model']['document']['selection'],_0x3a81ee=await _0x93f04['modelToDataWithIds'](_0x21ca53),_0x10d7e6=this['editor']['model']['document']['version'],_0x4b316a=[..._0x3240a8['getRanges']()];return this['_actionsBalloonView']||(this['_actionsBalloonView']=this['_createActionsBalloonView']()),this['_clearInteractionHistory'](),this['_clearErrorState'](),this['_balloonShowDiff']=!0x1,this['_actionsBalloonView']['resetShowChangesButton'](),this['_actionsBalloonView']['clearContent'](),_0x59344e['open']({'index':0x3e8*Math['random']()%0x3e8,'title':_0x488749,'icon':_0x45de1c||_0x4ba3ea,'mainView':this['_actionsBalloonView'],'class':'ck-ai-actions-balloon','ranges':_0x4b316a,'id':'aiActionsBalloon'}),this['_setLoadingState'](),this['stopListening'](this['_actionsBalloonView']),this['stopListening'](_0x59344e),this['_interactionParams']={'action':_0x1fffc5,'content':_0x3a81ee,'version':_0x10d7e6,'aiBalloon':_0x59344e,'modelFragment':_0x21ca53,'anchorData':_0x51d2c9},this['_setupApplyListeners'](),this['listenTo'](_0x59344e,'selectionRemoved',()=>{this['_stopInteraction'](),this['_actionsBalloonView']['disableMiniToolbarButtons']();}),this['listenTo'](_0x59344e,'dialogClosed',(_0x29e8ce,{id:_0x55a8d6})=>{if('aiActionsBalloon'===_0x55a8d6){if(this['_interaction']&&this['_interaction']['replies']['length']>0x0){const _0x6eb7bd=this['_interaction']['replies'][this['_interaction']['replies']['length']-0x1],_0x37b356=_0x6eb7bd['changeGroups'][0x0];_0x37b356&&'pending'===_0x37b356['state']&&_0x6eb7bd['setChangeGroupState'](0x0,'rejected');}this['_stopInteraction'](),this['_clearInteractionHistory'](),this['stopListening'](this['_actionsBalloonView']),this['stopListening'](_0x59344e);}}),this['_createInteraction'](_0x3a81ee,_0x10d7e6,_0x59344e,_0x1fffc5);}['_setupApplyListeners'](){if(!this['_interactionParams'])return;const {modelFragment:_0x3ff6fe,anchorData:_0x4154f3}=this['_interactionParams'];this['listenTo'](this['_actionsBalloonView'],'applySuggestion',()=>{this['_applyChanges'](_0x3ff6fe,_0x4154f3,!0x1);}),this['listenTo'](this['_actionsBalloonView'],'insertSuggestion',()=>{this['_applyChanges'](_0x3ff6fe,_0x4154f3,!0x0);});}['_wrapWithCommonAncestors'](_0x277cc5,_0x461a14,_0x4b51ff){const _0x43f31c=this['editor']['model']['createRange'](_0x461a14,_0x4b51ff)['getCommonAncestor'](),_0x587aca=_0x43f31c['is']('documentFragment')?[]:_0x43f31c['getAncestors']({'includeSelf':!0x0})['slice'](0x1);if(_0x587aca['length']){const _0x41c0db=_0x587aca['map'](_0x343781=>_0x343781['_clone'](!0x1));for(let _0xe67f07=0x1;_0xe67f07<_0x41c0db['length'];_0xe67f07++)_0x41c0db[_0xe67f07-0x1]['_appendChild'](_0x41c0db[_0xe67f07]);return _0x41c0db[_0x41c0db['length']-0x1]['_appendChild'](_0x277cc5),new _0x2b7448(_0x41c0db[0x0]);}return _0x277cc5;}['_copyMarkersToFragment'](_0x3db1e8,_0x32ca86,_0xa7d403={'isTableSelection':!0x1}){const _0x574918=this['editor']['model'],_0x110df4=Array['from'](_0x32ca86['getRanges']()),_0x1269b7=_0x32ca86['getFirstRange']()['start'];for(const _0x28acde of _0x574918['markers']){if(_0x28acde['name']['startsWith'](Zs)||!_0x28acde['affectsData'])continue;const _0x2ee05d=_0x28acde['getRange']();if(!_0x110df4['some'](_0x181a69=>_0x181a69['containsRange'](_0x2ee05d,!0x0)))continue;const _0x3c4165=this['_regularCalculateMarkerPath'](_0x2ee05d['start'],_0x1269b7,_0xa7d403['isTableSelection']),_0x46fe66=this['_regularCalculateMarkerPath'](_0x2ee05d['end'],_0x1269b7,_0xa7d403['isTableSelection']),_0x54c6ac=_0x574918['createPositionFromPath'](_0x3db1e8,_0x3c4165),_0x3329b1=_0x574918['createPositionFromPath'](_0x3db1e8,_0x46fe66);if(!_0x54c6ac['isEqual'](_0x3329b1)){const _0x2cf625=_0x574918['createRange'](_0x54c6ac,_0x3329b1);_0x3db1e8['markers']['set'](_0x28acde['name'],_0x2cf625);}}}['_regularCalculateMarkerPath'](_0xff634c,_0x9c524c,_0x1caca4=!0x1){const _0x67dcd3=[..._0xff634c['path']['slice']()];for(let _0x2e425f=0x0;_0x2e425f<Math['max'](_0x9c524c['path']['length'],_0xff634c['path']['length']);_0x2e425f++){const _0x10ca4b=_0x9c524c['path'][_0x2e425f]||0x0,_0x36ddd7=(_0xff634c['path'][_0x2e425f]||0x0)-_0x10ca4b;if(_0x67dcd3[_0x2e425f]=_0x36ddd7,0x0!==_0x36ddd7&&!_0x1caca4)break;}return _0x67dcd3;}async['_createInteraction'](_0x35e5db,_0x1026e2,_0xbd72e2,_0x4313d5){const _0x455647=this['editor'];this['_interactionParams']||(this['_interactionParams']={'action':_0x4313d5,'content':_0x35e5db,'version':_0x1026e2,'aiBalloon':_0xbd72e2,'modelFragment':this['editor']['model']['getSelectedContent'](this['editor']['model']['document']['selection']),'anchorData':new Map()});const _0x5b9630=new Xa({'connector':this['_aiConnector'],'editor':_0x455647,'content':_0x35e5db,'version':_0x1026e2,..._0x4313d5});this['_interactions']['push'](_0x5b9630);const _0x2ca846=(_0x45c26e,_0x2544e7=!0x1,_0x359da9='streaming')=>this['_promiseQueue']['enqueue'](async _0x5a73d3=>{try{const _0x1b2c99=Ns({'editor':_0x455647,'changeGroups':_0x45c26e['changeGroups'],'documentContextContent':_0x45c26e['documentContextContent'],'showDiff':_0x2544e7,'trimUnchanged':!0x1});_0x1b2c99['length']&&await this['_actionsBalloonView']['updateContent']({'part':_0x1b2c99[0x0],'renderingStrategy':_0x359da9,'abortSignal':_0x5a73d3});}catch(_0x136b22){if(this['_isAbortError'](_0x136b22))return;throw _0x136b22;}});this['_interaction']['on']('replyCreated',(_0x5384de,_0x4ca63f)=>{this['_actionsBalloonView']['hideLoader'](),this['_actionsBalloonView']['startAutoScroll'](),_0x2ca846(_0x4ca63f)['catch'](_0x64ca64=>{this['_isAbortError'](_0x64ca64)||(console['error']('Error\x20updating\x20content\x20in\x20replyCreated:',_0x64ca64),this['_setErrorState'](_0x5b9630));});}),this['_interaction']['on']('replyContentUpdated',(_0x3e0cee,_0x4a98de)=>{_0x2ca846(_0x4a98de)['catch'](_0x3eb205=>{this['_isAbortError'](_0x3eb205)||(console['error']('Error\x20updating\x20content\x20in\x20replyContentUpdated:',_0x3eb205),this['_setErrorState'](_0x5b9630));});}),this['_interaction']['on']('interactionFinished',async()=>{try{await this['_clearLoadingState'](),this['_actionsBalloonView']['updateMiniToolbarButtons'](this['_interactions']['length'],this['_currentInteractionIndex']),await this['_promiseQueue']['queueEmptyPromise'];}catch(_0x4f7a3f){this['_isAbortError'](_0x4f7a3f)||(console['error']('Error\x20clearing\x20loading\x20state\x20in\x20interactionFinished:',_0x4f7a3f),this['_setErrorState'](_0x5b9630));}finally{this['_actionsBalloonView']['stopAutoScroll']();}}),this['listenTo'](this['_actionsBalloonView'],'toggleSuggestionDisplayMode',async(_0x25e6b9,{showDiff:_0x420017})=>{try{this['_balloonShowDiff']=_0x420017;const _0x3eb041=this['_interaction']['replies'][this['_interaction']['replies']['length']-0x1];_0x3eb041&&await _0x2ca846(_0x3eb041,_0x420017,'static');}catch(_0x306c41){this['_isAbortError'](_0x306c41)||(console['error']('Error\x20updating\x20content\x20in\x20toggleSuggestionDisplayMode:',_0x306c41),this['_setErrorState'](_0x5b9630));}}),this['_interaction']['on']('replyChangeGroupStateUpdated',(_0x3e3c0f,{reply:_0x4ab2c8})=>{const _0x404fb5={'positiveCount':_0x4ab2c8['changeGroups']['filter'](_0x3c8b4e=>'accepted'===_0x3c8b4e['state'])['length'],'totalCount':_0x4ab2c8['changeGroups']['length']},_0x4a3050=this['_interaction']['actionCallId'],_0x5787f9=this['_interaction']['actionName'];_0x5787f9?this['_aiConnector']['upsertAIActionRating'](_0x5787f9,_0x4a3050,_0x404fb5):this['_aiConnector']['upsertCustomAIActionRating'](_0x4a3050,_0x404fb5);}),this['_setLoadingState']();try{const _0x4f02fe=await this['_interaction']['start']();return this['_actionsBalloonView']['updateMiniToolbarButtons'](this['_interactions']['length'],this['_currentInteractionIndex']),_0x4f02fe;}catch(_0x4eb7f7){if(this['_isAbortError'](_0x4eb7f7))return;this['_actionsBalloonView']['hideLoader'](),this['_setErrorState'](_0x5b9630);}}['_applyChanges'](_0x30db79,_0x58784c,_0x341074){const _0x3bb42a=this['editor'];if(_0x341074&&!_0x3bb42a['plugins']['has']('TrackChanges'))throw new ht('ai-no-track-changes',null);const _0x41c65d=this['editor']['plugins']['get'](_0x43d889),_0x47585a=this['_interactions'][this['_interactions']['length']-0x1-this['_currentInteractionIndex']];if(!_0x47585a||!_0x47585a['replies']['length'])return;const _0x11c703=_0x47585a['replies'][_0x47585a['replies']['length']-0x1],_0x3534ea=_0x11c703['changeGroups'];_0x11c703['setChangeGroupState'](0x0,'accepted');let _0x156d44=zs({'editor':_0x3bb42a,'reply':_0x11c703,'interaction':_0x47585a,'groups':_0x3534ea,'transform':!0x1,'documentCompare':_0x41c65d,'documentCompareOptions':{'anchor':_0x3bb42a['model']['createPositionAt'](_0x30db79,0x0),'markDeletions':_0x341074}});_0x156d44=this['_filterOperationsOutsideRange'](_0x156d44,_0x58784c);for(const _0x227a42 of _0x156d44)this['_anchorOperation'](_0x58784c,_0x227a42,_0x3bb42a['model']['document']['getRoot']());const _0x1fd2c3=_0x47585a['getDocumentContext']()['version'],_0x44cdb9=_0x3bb42a['model']['document']['history']['getOperations'](_0x1fd2c3),_0x26aed0={'document':_0x3bb42a['model']['document'],'useRelations':!0x1,'padWithNoOps':!0x1},_0x4c28d6=_0x4976b5(_0x156d44,_0x44cdb9,_0x26aed0)['operationsA'];_0x3bb42a['model']['change'](_0x8dec17=>{if(_0x8dec17['setSelection'](_0x3bb42a['model']['document']['selection']['focus']),_0x341074)_0x3bb42a['plugins']['get']('TrackChangesEditing')['_applyOperationsAsSuggestions'](_0x4c28d6);else{for(const _0x4009f7 of _0x4c28d6)_0x4009f7['baseVersion']=_0x3bb42a['model']['document']['version'],js(_0x3bb42a,_0x4009f7),_0x8dec17['batch']['addOperation'](_0x4009f7),_0x3bb42a['model']['applyOperation'](_0x4009f7);}}),this['editor']['plugins']['get']('AIBalloon')['close']();}['_filterOperationsOutsideRange'](_0x439407,_0x24a66d){return _0x439407['filter'](_0x44650f=>{if('rename'==_0x44650f['type']){const _0x197f21=_0x44650f['position']['nodeAfter'];return!_0x24a66d['has'](_0x197f21);}if(_0x44650f['type']['indexOf']('Attribute')>-0x1){const _0x22423f=_0x44650f['range']['start']['nodeAfter'];return!_0x24a66d['has'](_0x22423f);}return!0x0;});}['_anchorOperation'](_0x113470,_0xc78cbc,_0xdaaf4b){const _0x33d137=_0xc78cbc['clone']();for(const _0x1d31ae in _0xc78cbc){const _0x195157=_0xc78cbc[_0x1d31ae];_0x195157 instanceof _0x519c43?_0xc78cbc[_0x1d31ae]=new _0x519c43(_0x243cf9(_0x195157['start']),_0x243cf9(_0x195157['end'])):_0x195157 instanceof _0x87183&&(_0xc78cbc[_0x1d31ae]=_0x243cf9(_0x195157));}if(['insert','move','remove','reinsert','split','merge']['includes'](_0x33d137['type'])){if(_0x33d137['isDocumentOperation']=!0x1,_0x33d137['baseVersion']=null,'remove'==_0x33d137['type']){const _0x144617=_0x33d137['sourcePosition'],_0x450a3b=_0x33d137['howMany'];new _0xa8a483(_0x144617,_0x450a3b)['_execute']();}else _0x33d137['_execute']();}function _0x243cf9(_0x375b6b){if('$graveyard'==_0x375b6b['root']['rootName'])return _0x375b6b;const _0x4795cb=[];let _0x46d518=_0x375b6b['root'];for(let _0xd6816f=0x0;_0xd6816f<_0x375b6b['path']['length'];_0xd6816f++){const _0x877927=_0x113470['get'](_0x46d518)||0x0;_0x4795cb[_0xd6816f]=_0x375b6b['path'][_0xd6816f]+_0x877927,_0x46d518=_0x46d518['getChildAtOffset'](_0x375b6b['path'][_0xd6816f]);}return new _0x87183(_0xdaaf4b,_0x4795cb,_0x375b6b['stickiness']);}}['_refreshInteraction'](){if(!this['_interactionParams'])return;this['_interactions']['length']>0x0&&this['_stopInteraction'](),this['_currentInteractionIndex']=0x0,this['_balloonShowDiff']=!0x1;const {action:_0x3627cb,content:_0x35b82a,version:_0x5c1943,aiBalloon:_0x54ff64}=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'](_0x35b82a,_0x5c1943,_0x54ff64,_0x3627cb)['catch'](_0x535854=>{this['_isAbortError'](_0x535854)||console['error']('Error\x20refreshing\x20interaction:',_0x535854);});}['_isAbortError'](_0x223253){return!!_0x223253['message']&&_0x223253['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 _0x2eb1ed=this['_interactions']['length'];this['_currentInteractionIndex']<_0x2eb1ed-0x1&&this['_displayInteractionAtIndex'](this['_currentInteractionIndex']+0x1);}['_navigateToNext'](){this['_currentInteractionIndex']>0x0&&this['_displayInteractionAtIndex'](this['_currentInteractionIndex']-0x1);}async['_displayInteractionAtIndex'](_0x4127b0){if(!this['_interactionParams'])return;this['_currentInteractionIndex']=_0x4127b0;const _0x267a1d=this['_interactions'][this['_interactions']['length']-0x1-this['_currentInteractionIndex']];if(!_0x267a1d)return;if(_0x267a1d['hasError'])return this['_setErrorState'](_0x267a1d),void this['_actionsBalloonView']['updateMiniToolbarButtons'](this['_interactions']['length'],this['_currentInteractionIndex']);if(!_0x267a1d['replies']['length'])return;this['_actionsBalloonView']['hideError'](),this['_interactionParams']&&this['_clearErrorState']();const _0x223c40=_0x267a1d['replies'][_0x267a1d['replies']['length']-0x1];if(_0x223c40){const _0x41cd69=this['editor'];try{const _0x50a30a=Ns({'editor':_0x41cd69,'changeGroups':_0x223c40['changeGroups'],'documentContextContent':_0x223c40['documentContextContent'],'showDiff':this['_balloonShowDiff'],'trimUnchanged':!0x1});await new Promise(_0x554837=>setTimeout(_0x554837,0x32)),await this['_actionsBalloonView']['updateContent']({'part':_0x50a30a[0x0],'renderingStrategy':'static','abortSignal':new AbortController()['signal']});}catch(_0x33f397){this['_isAbortError'](_0x33f397)||console['error']('Error\x20updating\x20content\x20during\x20navigation:',_0x33f397);}}this['_actionsBalloonView']['updateMiniToolbarButtons'](this['_interactions']['length'],this['_currentInteractionIndex']);}['_setLoadingState'](){this['_actionsBalloonView']['setIsLoading'](!0x0),this['isBusy']=!0x0;}async['_setErrorState'](_0x35be17){const _0x532fd3=us(this['editor']['locale'],'AI_ACTIONS_GENERIC_ERROR');this['_actionsBalloonView']['showError'](_0x532fd3),_0x35be17['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);}}var io=function(_0x18a036){return _0x18a036['CONTINUE']='continue',_0x18a036['FIX_GRAMMAR']='fix-grammar',_0x18a036['IMPROVE_WRITING']='improve-writing',_0x18a036['MAKE_LONGER']='make-longer',_0x18a036['MAKE_SHORTER']='make-shorter',_0x18a036['MAKE_TONE_CASUAL']='make-tone-casual',_0x18a036['MAKE_TONE_FORMAL']='make-tone-formal',_0x18a036['TRANSLATE']='translate',_0x18a036;}({});class so extends _0x10493d{static get['requires'](){return[Ya,qa,eo];}static get['pluginName'](){return'AIQuickActions';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x285904){super(_0x285904),_0x285904['config']['define']('ai.quickActions',{'extraCommands':[],'removeCommands':[],'isSearchEnabled':!0x0});}}var no=function(_0x145d25){return _0x145d25['CHAT']='chat',_0x145d25['ACTION']='action',_0x145d25;}({});class ro extends vt{['resultResponseView'];['acceptButtonView'];['dismissButtonView'];['infoButtonView'];['outdatedButtonView'];constructor(_0x4b8e61,_0x3d9894){super(_0x4b8e61),this['id']=_0x3d9894,this['set']('status','pending'),this['set']('changeId',_0x3d9894),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',(_0x339b2e,_0x6333da)=>{_0x6333da&&_0x6333da['target']&&'A'===_0x6333da['target']['tagName']&&_0x6333da['preventDefault'](),this['fire']('activateChange',{'id':_0x3d9894,'source':this,'uiInteraction':'click'});}),this['on']('mouseover',()=>{this['fire']('activateChange',{'id':_0x3d9894,'source':this,'uiInteraction':'hover'});}),this['on']('mouseout',()=>{this['fire']('deactivateChange',{'origin':'panel','id':_0x3d9894,'source':this});});}['setItemAsActive'](){this['isActive']=!0x0;}['setItemAsInactive'](){this['isActive']=!0x1;}['_createResultResponseView'](){const _0x475f08=new vt(this['locale']);return _0x475f08['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',_0x24d207=>!_0x24d207)]}}),_0x475f08;}['_createAcceptButtonView'](){const _0x334004=new Nt(this['locale']);return _0x334004['set']({'label':us(this['locale'],'AI_REVIEW_MODE_ACCEPT_CHANGE'),'withText':!0x0}),_0x334004['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x196e17=>{this['fire']('acceptChange',{'id':this['changeId']}),_0x196e17['stopPropagation']();})},'attributes':{'class':[_s,'ck-ai_review__check-run-result-accept-button',this['bindTemplate']['if']('status','ck-hidden',_0x376157=>'pending'!==_0x376157&&'accepted'!==_0x376157),this['bindTemplate']['if']('status','ck-ai_review__check-run-result-accept-button',_0x454e4b=>'pending'===_0x454e4b),this['bindTemplate']['if']('status','ck-ai_review__check-run-result-status-button',_0x2f9bb1=>'accepted'===_0x2f9bb1)]}}),this['on']('change:status',(_0x386f33,_0x117529,_0x5ac890)=>{_0x334004['isEnabled']='pending'===_0x5ac890,'accepted'===_0x5ac890&&(_0x334004['label']=us(this['locale'],'AI_REVIEW_MODE_CHECK_STATUS_ACCEPTED'),_0x334004['icon']=_0x27f2cb);}),_0x334004;}['_createDismissButtonView'](){const _0x14c5f6=new Nt(this['locale']);return _0x14c5f6['set']({'label':us(this['locale'],'AI_REVIEW_MODE_DISMISS_CHANGE'),'withText':!0x0}),_0x14c5f6['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x35bf63=>{this['fire']('dismissChange',{'id':this['changeId']}),_0x35bf63['stopPropagation']();})},'attributes':{'class':[As,this['bindTemplate']['if']('status','ck-hidden',_0x1e0983=>'pending'!==_0x1e0983&&'rejected'!==_0x1e0983),this['bindTemplate']['if']('status','ck-ai_review__check-run-result-dismiss-button',_0x294a92=>'pending'===_0x294a92),this['bindTemplate']['if']('status','ck-ai_review__check-run-result-status-button',_0x24ba00=>'rejected'===_0x24ba00)]}}),this['on']('change:status',(_0x24aefe,_0x559d10,_0x361a2e)=>{_0x14c5f6['isEnabled']='pending'===_0x361a2e,'rejected'===_0x361a2e&&(_0x14c5f6['label']=us(this['locale'],'AI_REVIEW_MODE_CHECK_STATUS_REJECTED'),_0x14c5f6['icon']=_0x3523ed);}),_0x14c5f6;}['_createInfoButtonView'](){const _0x4bab83=new Nt(this['locale']);return _0x4bab83['set']({'label':us(this['locale'],'AI_REVIEW_MODE_LEARN_MORE'),'icon':_0x5bdc98,'tooltip':!0x0,'isToggleable':!0x0,'role':'menuitemcheckbox','class':As+'\x20ck-ai_review__check-run-result-info-button\x20ck-hidden'}),_0x4bab83['bind']('isOn')['to'](this,'isInfoToggleOn',_0x573587=>_0x573587),_0x4bab83['on']('execute',()=>{this['isInfoToggleOn']=!this['isInfoToggleOn'];}),_0x4bab83;}['_createOutdatedButtonView'](){const _0x22c9d6=new Nt(this['locale']);return _0x22c9d6['set']({'label':us(this['locale'],'AI_REVIEW_MODE_CHECK_STATUS_OUTDATED'),'icon':st,'withText':!0x0,'isEnabled':!0x1}),_0x22c9d6['extendTemplate']({'attributes':{'class':[As,'ck-ai_review__check-run-result-status-button',this['bindTemplate']['if']('status','ck-hidden',_0x58f7ca=>'outdated'!==_0x58f7ca)],'disabled':'disabled'}}),_0x22c9d6;}}class ao extends Xt{['resultItemView'];['_pinnedRectIndex']=void 0x0;['_pinnedTargetElement']=void 0x0;['_pinnedTargetChangeId']=void 0x0;constructor(_0x536eea,_0x2eaa8a){super(_0x536eea),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']()),_0x2eaa8a['add'](this);}['render'](){super['render'](),this['_setupClickOutsideHandler']();}['updateContent'](_0x463a85){this['resultItemView']['changeId']=_0x463a85['id'],this['resultItemView']['resultResponseView']['element']['innerHTML']=_0x463a85['contentDiffed'];}['showBalloon'](_0x21f8be,_0x24c6d4,_0x375dbd,_0x53d940,_0x4bf441,_0x543cf1){const _0x4403ab=_0x24c6d4();if(!_0x4403ab)return;this['updateContent'](_0x21f8be),this['show']();const _0x38027c=Array['from'](_0x4403ab['getClientRects']())['reverse'](),_0x911207=this['_getPointedRectIndexFromEvent'](_0x375dbd,_0x38027c),_0x1ee15f=_0x38027c[_0x911207??0x0];'click'===_0x53d940?(this['isDiffActive']=!0x0,this['pin']({'target':()=>this['_getBestRectPositionOnClick'](_0x24c6d4(),_0x911207,_0x21f8be['id'],_0x4bf441,_0x543cf1)||_0x1ee15f})):'hover'===_0x53d940&&(this['isDiffActive']=!0x1,this['pin']({'target':()=>this['_getBestRectPositionOnHover'](_0x24c6d4(),_0x911207,_0x21f8be['id'])||_0x1ee15f}));}['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 _0x79c2b7=[this['element']];return this['_pinnedTargetElement']&&_0x79c2b7['push'](this['_pinnedTargetElement']),_0x79c2b7;},'callback':()=>{this['hide'](),this['unpin'](),this['deactivateChange'](),this['_pinnedTargetElement']=void 0x0,this['_pinnedRectIndex']=void 0x0,this['_pinnedTargetChangeId']=void 0x0;}});}['_createContentView'](){const _0x389127=new vt();return this['resultItemView']=new ro(this['locale'],''),this['resultItemView']['resultResponseView']['extendTemplate']({'attributes':{'class':['ck-content']}}),this['resultItemView']['delegate']('acceptChange','dismissChange')['to'](this),_0x389127['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']]}]}),_0x389127;}['_getBestRectPositionOnClick'](_0x59f794,_0x330279,_0x47b290,_0xcc7643,_0x752c78){if(!_0x59f794)return null;const _0x19a257=this['position']['replace']('arrow_',''),_0x45044c=Array['from'](_0x59f794['getClientRects']());let _0x521f27,_0x452cd4=_0x45044c['reverse']();return void 0x0!==_0x330279&&this['_isPinnedRectVisible'](_0x452cd4[_0x330279],_0xcc7643,_0x752c78)?(_0x521f27=_0x452cd4[_0x330279],this['_pinnedRectIndex']=_0x330279):this['_isPinnedRectVisible'](_0x452cd4[0x0],_0xcc7643,_0x752c78)&&void 0x0===_0x330279?_0x521f27=_0x452cd4[0x0]:(_0x452cd4='s'==_0x19a257[0x0]?[..._0x45044c]['reverse']():_0x45044c,_0x452cd4['forEach'](_0x2e229d=>{this['_isPinnedRectVisible'](_0x2e229d,_0xcc7643,_0x752c78)&&(_0x521f27=_0x2e229d);})),this['_pinnedTargetChangeId']=_0x47b290,this['_pinnedTargetElement']=_0x59f794,_0x521f27||_0x59f794['getBoundingClientRect']();}['_getBestRectPositionOnHover'](_0x44be5b,_0x150e70,_0x1b64da){if(!_0x44be5b)return null;const _0xe40412=Array['from'](_0x44be5b['getClientRects']())['reverse']();if(void 0x0===this['_pinnedRectIndex']&&void 0x0!==_0x150e70&&this['_pinnedTargetChangeId']!==_0x1b64da)return this['_pinnedRectIndex']=_0x150e70,this['_pinnedTargetElement']=_0x44be5b,this['_pinnedTargetChangeId']=_0x1b64da,_0xe40412[_0x150e70];if(void 0x0!==this['_pinnedRectIndex']&&this['_pinnedTargetChangeId']===_0x1b64da){if(_0x44be5b!==this['_pinnedTargetElement'])return Array['from'](this['_pinnedTargetElement']['getClientRects']())['reverse']()[this['_pinnedRectIndex']];return _0xe40412[this['_pinnedRectIndex']];}return void 0x0!==_0x150e70&&this['_pinnedTargetChangeId']!==_0x1b64da?(this['_pinnedRectIndex']=_0x150e70,this['_pinnedTargetElement']=_0x44be5b,this['_pinnedTargetChangeId']=_0x1b64da,_0xe40412[_0x150e70]):_0x44be5b['getBoundingClientRect']();}['_getPointedRectIndexFromEvent'](_0x279856,_0x4ffd76){if(_0x279856)for(let _0x157982=0x0;_0x157982<_0x4ffd76['length'];_0x157982++){const _0x10dd09=_0x4ffd76[_0x157982];if(_0x279856['clientX']>=_0x10dd09['left']-0x3&&_0x279856['clientX']<=_0x10dd09['right']+0x3&&_0x279856['clientY']>=_0x10dd09['top']-0x3&&_0x279856['clientY']<=_0x10dd09['bottom']+0x3)return _0x157982;}}['_isPinnedRectVisible'](_0x1b4fb4,_0x1e49ae,_0x492601){const _0x491e97=new dt(_0x1b4fb4),_0x2f12b6=_0x1e49ae||document['documentElement'],_0x1049af=_0x491e97['getIntersection'](Rt(_0x492601)),_0x4d0506=new dt(_0x2f12b6)['getIntersection'](_0x491e97);return!!(_0x1049af&&_0x4d0506&&_0x491e97['width']>0x0);}}const oo=['getReviewCheckList','runReviewCheck','abortReviewStream','toggleDiff','acceptAllChanges','leaveReviewCoreResultList','activateChange','deactivateChange','acceptChange','dismissChange','learnMore','finishReview','retryReview'];class ho extends _0x3397b8{['_mainView'];['_balloonSuggestionView'];['_bodyCollection'];static get['requires'](){return[cs];}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0xd1534d){super(_0xd1534d),this['_bodyCollection']=new Qt(this['context']['locale']),this['_bodyCollection']['attachToDom'](),this['_mainView']=this['createMainView'](),this['_mainView']['delegate'](...oo)['to'](this),this['_balloonSuggestionView']=new ao(this['context']['locale'],this['_bodyCollection']),this['_balloonSuggestionView']['delegate']('acceptChange','dismissChange','deactivateChange')['to'](this);}['init'](){const _0x2c7483=this['context']['plugins']['get']('AITabs');this['registerTab'](_0x2c7483);}['destroy'](){this['_bodyCollection']['detachFromDom'](),super['destroy']();}['setAvailableChecks'](_0xe4fd6d){if(!this['_mainView']['reviewCheckListView']['hasChecks']()){const _0x52b1ab=!this['context']['config']['get']('ai.models.showModelSelector');this['_mainView']['reviewCheckListView']['setChecks'](_0xe4fd6d,_0x52b1ab);}this['_mainView']['showReviewCheckListView']();}['showReviewCheckList'](){this['fire']('getReviewCheckList');}['showCheckRunResults'](_0x452c25){_0x452c25&&('error-general'!==_0x452c25['status']?'error-chunk'!==_0x452c25['status']?this['_mainView']['showReviewCheckResultsView']():this['showChunkErrorView']():this['showGeneralResultsErrorView']());}['showCheckRunResult'](_0x1a3d03){this['_mainView']['addCheckRunResult'](_0x1a3d03);}['showGeneralResultsErrorView'](){this['_mainView']['showGeneralResultsErrorView']();}['showGeneralReviewCoreErrorView'](_0x3801d6){this['_mainView']['showGeneralReviewCoreErrorView'](_0x3801d6??us(this['context']['locale'],'AI_REVIEW_INITIALIZATION_ERROR_MESSAGE'));}['showChunkErrorView'](){this['_mainView']['showChunkErrorView']();}['setCheckResultTitle'](_0xfec776,_0x2089be){this['_mainView']['reviewCheckResultsView']['setTitle'](_0xfec776,_0x2089be);}['setActiveStateInResults'](_0x4c2a51){this['_mainView']['reviewCheckResultsView']['getResults']()['forEach'](_0x2cdbf9=>{_0x2cdbf9['id']===_0x4c2a51&&_0x2cdbf9['setItemAsActive']();});}['resetActiveStateInResults'](){this['_mainView']['reviewCheckResultsView']['getResults']()['forEach'](_0x5484c3=>_0x5484c3['setItemAsInactive']());}['updateChangeState'](_0x5f3442,_0x5d864f){'accepted'===_0x5d864f||'rejected'===_0x5d864f||'outdated'===_0x5d864f?this['_mainView']['reviewCheckResultsView']['hideResult'](_0x5f3442,_0x5d864f):this['_mainView']['reviewCheckResultsView']['showResult'](_0x5f3442,_0x5d864f);}['showReviewCompletedView'](){this['_mainView']['showReviewCompletedView']();}['showActionsWhenResultIsReady'](){this['_mainView']['showActionsWhenResultIsReady']();}['showNoChangesView'](){this['_mainView']['showNoChangesView']();}['hideActionsWhenResultIsReady'](){this['_mainView']['hideActionsWhenResultIsReady']();}['showChangeBalloon'](_0x3b4718,_0x2213cc,_0x2c4f00,_0x245d96,_0x933c2b,_0x30c24d){this['_balloonSuggestionView']['showBalloon'](_0x3b4718,_0x2213cc,_0x2c4f00,_0x245d96,_0x933c2b,_0x30c24d);}['hideChangeBalloon'](){this['_balloonSuggestionView']['hideBalloon']();}['hideDiffInBalloon'](){this['_balloonSuggestionView']['hideDiffInBalloon']();}['showDiffInBalloon'](){this['_balloonSuggestionView']['showDiffInBalloon']();}['getChangeElement'](_0xfedd85){const _0x1a9cfd=this['_mainView']['reviewCheckResultsView']['getResults']()['find'](_0x304ade=>_0x304ade['id']===_0xfedd85);return _0x1a9cfd?_0x1a9cfd['element']:null;}['deactivateChange'](){this['_balloonSuggestionView']['deactivateChange']();}}class co extends vt{constructor(_0x259fc9){super(_0x259fc9),this['set']('isVisible',!0x1),this['set']('errorMessage','');const _0x45ead0=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai_review__general-error-container',_0x45ead0['if']('isVisible','ck-hidden',_0x342b63=>!_0x342b63)]},'children':[{'tag':'p','attributes':{'class':'ck\x20ck-ai-notification\x20ck-ai-notification_error'},'children':[{'text':_0x45ead0['to']('errorMessage')}]}]});}}class lo extends vt{['reviewCoreHeader'];['generalErrorView'];['reviewCheckListView'];['reviewCheckResultsView'];['reviewCompletedView'];constructor(_0x2a231a,_0x145ec5){super(_0x2a231a),this['reviewCoreHeader']=_0x145ec5['header'],this['generalErrorView']=new co(_0x2a231a),this['reviewCheckListView']=_0x145ec5['list'],this['reviewCheckListView']['delegate'](...oo)['to'](this),this['reviewCheckResultsView']=_0x145ec5['results'],this['reviewCheckResultsView']['delegate'](...oo)['to'](this),this['reviewCompletedView']=_0x145ec5['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'](_0x21089f){this['reviewCheckResultsView']['addResult'](_0x21089f),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'](_0x1c537e){this['generalErrorView']['set']('isVisible',!0x0),this['generalErrorView']['errorMessage']=_0x1c537e;}['showGeneralResultsErrorView'](){this['reviewCheckResultsView']['set']('isLoading',!0x1),this['showActionsWhenResultIsReady'](),this['reviewCheckResultsView']['showGeneralErrorMessage']();}['showChunkErrorView'](){this['reviewCheckResultsView']['set']('isLoading',!0x1),this['showActionsWhenResultIsReady'](),this['reviewCheckResultsView']['showChunkErrorMessage']();}}class uo extends Nt{constructor(_0x3d7764,_0x500624){super(_0x500624),this['set']({'label':_0x3d7764,'withText':!0x0,'class':ds}),this['on']('execute',()=>{this['fire']('finishReview');});}}class _o extends Ht{['_resultViews'];['_resultsHeader'];['reviewDisclaimer'];['_cancelButtonView'];['_acceptAllButtonView'];['_exitReviewButtonView'];['_toggleDiffButtonView'];['_errorMessageView'];['_finishReviewButtonView'];['_contents'];constructor(_0x5d58f1,_0x59d228){super(_0x5d58f1),this['_contents']=_0x59d228,this['_resultViews']=new _0x54be0e(),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['_errorMessageView']=this['_createErrorView'](),this['reviewDisclaimer']=new na(_0x5d58f1),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 _0x4dbb43=this['_createCombinedSkeletonLoader'](),_0x178099=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-run',_0x178099['if']('isLoading','ck-ai_review__check-run_loading',_0x3ecb39=>_0x3ecb39),_0x178099['if']('isResultReady','ck-ai_review__check-run_ready',_0x4dbc7d=>_0x4dbc7d),_0x178099['if']('isVisible','ck-hidden',_0x19783b=>!_0x19783b)]},'children':[this['_resultsHeader'],{'tag':'div','attributes':{'class':['ck-ai_review__check-run-results-wrapper']},'children':[this['_errorMessageView'],{'tag':'div','attributes':{'class':['ck-ai_review__check-run-results-container','ck-reset_all-excluded',this['bindTemplate']['if']('isLoading','ck-hidden',_0x5f43cb=>_0x5f43cb)]},'children':this['_resultViews']},_0x4dbb43]},this['reviewDisclaimer']]});}['clearResults'](){this['_resultViews']['clear']();}['getResults'](){return this['_resultViews'];}['addResult'](_0x25e236){const _0xc1a4e4=new ro(this['locale'],_0x25e236['id']);_0xc1a4e4['delegate']('acceptChange','dismissChange','activateChange','deactivateChange')['to'](this),this['_resultViews']['add'](_0xc1a4e4),_0xc1a4e4['resultResponseView']['element']['innerHTML']=_0x25e236['contentDiffed'];}['hideResult'](_0x7318b0,_0x39db3d){if('pending'===_0x39db3d)return;const _0x2961e7=this['_resultViews']['find'](_0x510a8e=>_0x510a8e['id']===_0x7318b0);_0x2961e7&&(_0x2961e7['status']=_0x39db3d,_0x2961e7['element']?.['classList']['add']('ck-ai_review__check-run-result_grayout'));}['showResult'](_0xa464de,_0x5688ed){if('pending'!==_0x5688ed)return;const _0x5e3c79=this['_resultViews']['find'](_0x25eb75=>_0x25eb75['id']===_0xa464de);_0x5e3c79&&(_0x5e3c79['status']=_0x5688ed,_0x5e3c79['element']?.['classList']['remove']('ck-ai_review__check-run-result_grayout'));}['setTitle'](_0x453f8b,_0x7d7345){this['headerTitle']=_0x453f8b,this['headerSubtitle']=_0x7d7345||'';}['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 sr(this['locale'],nr['aiReviewChecks']);}['_createCombinedSkeletonLoader'](){const _0x46f79c=new vt(this['locale']),_0x4ba617=[];for(let _0x1c3bac=0x0;_0x1c3bac<0x10;_0x1c3bac++){const _0xaa4895=this['_createSkeletonLoader']();_0xaa4895['extendTemplate']({'attributes':{'class':['ck-ai_review__check-run-skeleton-item']}}),_0x4ba617['push'](_0xaa4895);}return _0x46f79c['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-run-skeleton-container',this['bindTemplate']['if']('isLoading','ck-hidden',_0x131025=>!_0x131025)]},'children':_0x4ba617}),_0x46f79c;}['_createErrorView'](){const _0x310120=new vt(this['locale']),_0x33dacc=new Nt(this['locale']),t=this['locale']['t'];return _0x310120['delegate']('retryReview')['to'](this),_0x33dacc['set']({'label':t('Try\x20again'),'withText':!0x0,'class':_s+'\x20ck-ai_review__check-run-error-retry-button'}),_0x33dacc['on']('execute',()=>{this['fire']('retryReview');}),_0x310120['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-run-error-container',this['bindTemplate']['if']('showErrorMessage','ck-hidden',_0xf675ca=>!_0xf675ca),this['bindTemplate']['if']('errorType','ck-ai_review__check-run-error-container_border-bottom',_0x475f9e=>'chunk'===_0x475f9e)]},'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',_0x145d2b=>'chunk'===_0x145d2b)]},'children':[{'tag':'p','attributes':{'class':['ck-ai-notification__content',this['bindTemplate']['if']('errorType','ck-hidden',_0x31f6f4=>'general'!==_0x31f6f4)]},'children':[{'text':this['_contents']['generalErrorText']}]},{'tag':'p','attributes':{'class':['ck-ai-notification__content',this['bindTemplate']['if']('errorType','ck-hidden',_0x52c8f6=>'chunk'!==_0x52c8f6)]},'children':[{'text':us(this['locale'],'AI_REVIEW_MODE_CHUNK_ERROR_MESSAGE')}]}]},_0x33dacc]}),_0x310120;}['_createCancelButtonView'](){const _0x2b8620=new Nt(this['locale']);return _0x2b8620['set']({'label':us(this['locale'],'AI_REVIEW_MODE_STOP_GENERATING'),'withText':!0x0,'class':[_s+'\x20ck-ai-button-stop-generating'],'icon':_0x251c48}),_0x2b8620['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isResultReady','ck-hidden',_0x53e8e6=>_0x53e8e6),this['bindTemplate']['if']('isCompleted','ck-hidden',_0x274df3=>_0x274df3)]}}),_0x2b8620['on']('execute',()=>{this['fire']('abortReviewStream');}),_0x2b8620;}['_createToggleDiffButtonView'](){const _0x25895f=new Nt(this['locale']);_0x25895f['set']({'tooltip':!0x0,'isToggleable':!0x0,'role':'menuitemcheckbox'}),_0x25895f['bind']('isEnabled')['to'](this,'isError',_0x402128=>!_0x402128),_0x25895f['extendTemplate']({'attributes':{'class':[_s,'ck-ai_review__check-run-toggle-diff-button',this['bindTemplate']['if']('isResultReady','ck-hidden',_0x8e4ac1=>!_0x8e4ac1),this['bindTemplate']['if']('isCompleted','ck-hidden',_0x1c8e1d=>_0x1c8e1d)]}});const _0x5d503a=us(this['locale'],'AI_REVIEW_MODE_HIDE_CHANGES'),_0x398d9c=us(this['locale'],'AI_REVIEW_MODE_SHOW_CHANGES');return _0x25895f['bind']('isOn')['to'](this,'isToggleDiffOn',_0x2dd974=>_0x2dd974),_0x25895f['bind']('icon')['to'](this,'isToggleDiffOn',_0x29d02d=>_0x29d02d?nt:rt),_0x25895f['bind']('label')['to'](this,'isToggleDiffOn',_0x33ae23=>_0x33ae23?_0x5d503a:_0x398d9c),_0x25895f['on']('execute',()=>{this['isToggleDiffOn']=!this['isToggleDiffOn'],this['fire']('toggleDiff',{'on':this['isToggleDiffOn']});}),_0x25895f;}['_createAcceptAllButtonView'](){const _0x27a447=new Nt(this['locale']);return _0x27a447['set']({'label':us(this['locale'],'AI_REVIEW_MODE_ACCEPT_ALL'),'withText':!0x0}),_0x27a447['bind']('isEnabled')['to'](this,'isError',_0x4437e2=>!_0x4437e2),_0x27a447['extendTemplate']({'attributes':{'class':[ds,'ck-ai_review__check-run-accept-all-button',this['bindTemplate']['if']('isResultReady','ck-hidden',_0xab7089=>!_0xab7089),this['bindTemplate']['if']('isCompleted','ck-hidden',_0x3755f3=>_0x3755f3)]}}),_0x27a447['on']('execute',()=>{this['fire']('acceptAllChanges');}),_0x27a447;}['_createExitReviewButtonView'](){const _0x7a9a57=new Nt(this['locale']);return _0x7a9a57['set']({'label':us(this['locale'],'AI_REVIEW_MODE_EXIT_REVIEW'),'withText':!0x0}),_0x7a9a57['extendTemplate']({'attributes':{'class':[As,'ck-ai_review__check-run-exit-button',this['bindTemplate']['if']('isResultReady','ck-hidden',_0x3bbbad=>!_0x3bbbad),this['bindTemplate']['if']('isCompleted','ck-hidden',_0x151bbc=>_0x151bbc)]}}),_0x7a9a57['on']('execute',()=>{this['fire']('leaveReviewCoreResultList');}),_0x7a9a57;}['_createResultHeaderView'](){const _0x2a61ea=new vt(this['locale']),_0x27bb78=this['_createTitleView']();return _0x2a61ea['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-run-results-header',this['bindTemplate']['if']('isCompleted','ck-ai_review__review-completed-header',_0x374715=>_0x374715)]},'children':[_0x27bb78,{'tag':'div','attributes':{'class':['ck-ai_review__check-run-results-header-buttons']},'children':[this['_cancelButtonView'],this['_acceptAllButtonView'],this['_exitReviewButtonView'],this['_toggleDiffButtonView'],this['_finishReviewButtonView']]}]}),_0x2a61ea;}['_createTitleView'](){const _0x1afca4=new vt(this['locale']),_0x48513b=new vn();return _0x48513b['bind']('isVisible')['to'](this,'isResultReady',_0x39fe30=>!_0x39fe30),_0x1afca4['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-run-results-header-title-wrapper']},'children':[_0x48513b,{'tag':'div','attributes':{'class':['ck-ai_review__check-run-results-header-title-content',this['bindTemplate']['if']('isCompleted','ck-hidden',_0x43efe4=>_0x43efe4)]},'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',_0xdfb274=>!_0xdfb274)]},'children':[{'text':us(this['locale'],'AI_REVIEW_MODE_FINISH_REVIEW_HEADER_TITLE')}]}]}),_0x1afca4;}['_createFinishReviewButtonView'](){const _0x5a97f4=new uo(us(this['locale'],'AI_REVIEW_MODE_FINISH_REVIEW_BUTTON_LABEL'),this['locale']);return _0x5a97f4['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isCompleted','ck-hidden',_0x5698d1=>!_0x5698d1)]}}),_0x5a97f4['delegate']('finishReview')['to'](this),_0x5a97f4;}}class Ao extends Ht{['_resultsHeader'];['_finishReviewButtonView'];constructor(_0x41248e,_0x382c96){super(_0x41248e),this['_finishReviewButtonView']=this['_createFinishReviewButtonView'](_0x382c96['buttonText']),this['_resultsHeader']=this['_createResultHeaderView'](_0x382c96['headerText']);const _0x46e46d=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__review-completed',_0x46e46d['if']('isVisible','ck-hidden',_0x3e3b3d=>!_0x3e3b3d)]},'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':_0x382c96['emptyResultsText']}]}]}]});}['_createFinishReviewButtonView'](_0x204bd1){const _0x564442=new uo(_0x204bd1,this['locale']);return _0x564442['delegate']('finishReview')['to'](this),_0x564442;}['_createResultHeaderView'](_0x54eb38){const _0x5e0241=new vt(this['locale']);return _0x5e0241['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':_0x54eb38}]},{'tag':'div','attributes':{'class':['ck-ai_review__review-completed-header-buttons']},'children':[this['_finishReviewButtonView']]}]}),_0x5e0241;}}class go extends vt{['_dropdownView'];['_defaultValue'];['_defaultLabel'];constructor(_0xbeb215,_0x1cc6de){super(_0xbeb215),this['_defaultValue']=_0x1cc6de['default']||(_0x1cc6de['data']['length']>0x0?_0x1cc6de['data'][0x0]['id']:''),this['_defaultLabel']=_0x1cc6de['data']['find'](_0xb8259c=>_0xb8259c['id']===this['_defaultValue'])?.['label']||'',this['set']('formValue',''),this['_dropdownView']=Gt(this['locale']);const _0x150d4f=this['_prepareListOptions'](_0x1cc6de['data']);jt(this['_dropdownView'],_0x150d4f,{'role':'menu','ariaLabel':_0x1cc6de['label']}),this['_dropdownView']['buttonView']['set']({'label':this['_defaultLabel'],'withText':!0x0}),this['_dropdownView']['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x5c0cc7=>{_0x5c0cc7['stopPropagation']();})}}),this['listenTo'](this['_dropdownView'],'execute',_0x17b4fc=>{this['formValue']=_0x17b4fc['source']['model']['id'],this['_dropdownView']['buttonView']['label']=_0x17b4fc['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'](_0x24561d=[]){const _0x925f98=new _t();this['resetToDefault']();for(const _0x578d0c of _0x24561d){const _0x15e87a=new Jt({'label':_0x578d0c['label'],'withText':!0x0,'role':'menuitemradio','id':_0x578d0c['id'],'model':_0x578d0c});_0x15e87a['bind']('isOn')['to'](this,'formValue',_0xf338cf=>_0xf338cf===_0x15e87a['id']);const _0x355f13={'type':'button','model':_0x15e87a};_0x925f98['add'](_0x355f13);}return _0x925f98;}}class Io extends Ht{['_formItem']=null;constructor(_0x38611f,_0x1ca021,_0x542e45){super(_0x38611f),this['argsKey']=_0x1ca021?.['argsKey'];if('dropdown'===_0x1ca021['formType'])this['_formItem']=new go(this['locale'],_0x1ca021);this['set']('value',''),this['bind']('value')['to'](this['_formItem'],'formValue');const _0x237ed6=new _0xae7a14(this['locale'],{'children':[this['_formItem']],'class':[_0x542e45?'ck-form__row_with-submit':'']});_0x542e45&&_0x237ed6['children']['add'](_0x542e45),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai_review__form-item','ck-reset_all']},'children':[_0x237ed6]});}['resetToDefault'](){this['_formItem']['resetToDefault']();}}class Eo extends _0x14f3b5{['keystrokes'];static ['MIN_ROWS']=0x1;static ['MAX_ROWS']=0xc;constructor(_0x149dbc){super(_0x149dbc),this['set']('isEmpty',!0x0),this['keystrokes']=new gt(),this['minRows']=Eo['MIN_ROWS'],this['maxRows']=Eo['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 po extends vt{['focusTracker']=new At();['keystrokes']=new gt();['focusCycler'];['_focusables']=new _0x54be0e();['submitButtonView'];['cancelButtonView'];['promptInputView'];['actionsFooterView'];['_modelSelectionDropdown'];['_modelNameView'];['_modelSelectionDropdownItems'];['_check'];['_defaultValue'];['_defaultLabel'];constructor(_0x48f2c1,_0x11af2a,_0x3b1fe9=!0x1){super(_0x48f2c1),this['_check']=_0x11af2a,this['set']('prompt',''),this['set']('modelId',''),this['set']('modelDisplayMode','selector'),this['set']('activeModelName',null),this['_defaultValue']=_0x11af2a['defaultModel']?_0x11af2a['defaultModel']['id']:'',this['_defaultLabel']=_0x11af2a['defaultModel']?_0x11af2a['defaultModel']['name']:'',this['submitButtonView']=this['_createSubmitButtonView'](),this['cancelButtonView']=this['_createCancelButtonView'](),(this['promptInputView']=new te(this['locale'],()=>new Eo(_0x48f2c1)),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 _t(),this['_modelNameView']=this['_createModelNameView'](),this['_setModelList'](_0x3b1fe9),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 _0xae7a14(this['locale'],{'children':[this['promptInputView']]}),new _0xae7a14(this['locale'],{'children':[this['actionsFooterView']]})]}),this['promptInputView']['fieldView']['keystrokes']['set']('Enter',(_0x342cd4,_0x570217)=>{this['_isValid']()?(this['fire']('runReviewCheck',{'id':'custom','args':{'prompt':this['prompt'],'model':this['modelId']},'isCustom':!0x0}),_0x570217()):_0x570217();}),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'](_0x217159=>{this['_focusables']['add'](_0x217159),this['focusTracker']['add'](_0x217159['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 _0x1eae62 of this['_getFormValidators']()){const _0x2e35e6=_0x1eae62();if(_0x2e35e6)return this['promptInputView']['errorText']=_0x2e35e6,!0x1;}return!0x0;}['_getFormValidators'](){return[()=>{if(0x0===this['promptInputView']['fieldView']['value']?.['trim']()['length'])return us(this['locale'],'AI_REVIEW_MODE_PROMPT_EMPTY_ERROR');}];}['_createSubmitButtonView'](){const _0x435406=new Nt(this['locale']),t=this['locale']['t'];return _0x435406['set']({'label':t('Submit'),'withText':!0x0,'class':ds}),_0x435406['on']('execute',()=>{this['_isValid']()&&this['fire']('runReviewCheck',{'id':'custom','args':{'prompt':this['prompt'],'model':this['modelId']},'isCustom':!0x0});}),_0x435406;}['_createCancelButtonView'](){const _0x357163=new Nt(this['locale']),t=this['locale']['t'];return _0x357163['set']({'label':t('Cancel'),'withText':!0x0,'class':As}),_0x357163['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x43927a=>{_0x43927a['stopPropagation']();})}}),_0x357163['on']('execute',()=>{this['resetToDefault'](),this['fire']('closeCustomCheck');}),_0x357163;}['_setModelList'](_0x2f0a48){this['_modelSelectionDropdownItems']['clear']();const _0x2940db=this['_check']['models'];if(_0x2f0a48)this['set']('modelDisplayMode','hidden');else{const _0x397a03=0x1===_0x2940db['length'];this['set']('modelDisplayMode',_0x397a03?'name':'selector');}if(this['resetToDefault'](),_0x2940db?.['length']){0x1===_0x2940db['length']&&this['set']('activeModelName',_0x2940db[0x0]['name']||_0x2940db[0x0]['id']);for(const _0x3227f8 of _0x2940db){const _0x79b004=new Jt({'label':_0x3227f8['name'],'withText':!0x0,'role':'menuitemradio','id':_0x3227f8['id'],'model':_0x3227f8});_0x79b004['bind']('isOn')['to'](this,'modelId',_0x524451=>_0x524451===_0x3227f8['id']),this['_modelSelectionDropdownItems']['add']({'type':'button','model':_0x79b004,'labelView':new mo(this['locale'],_0x3227f8)});}}}['_createModelSelectionDropdown'](){const _0x4c84be=Gt(this['locale']);return _0x4c84be['set']({'panelPosition':'se','class':'ck-ai_review__check-list-item-model-dropdown'}),_0x4c84be['buttonView']['set']({'label':this['_defaultLabel'],'withText':!0x0,'tooltip':!0x0,'class':As}),_0x4c84be['buttonView']['bind']('isVisible')['to'](this,'modelDisplayMode',_0x2ba387=>'selector'===_0x2ba387),this['listenTo'](_0x4c84be,'execute',_0x2ba6d8=>{this['modelId']=_0x2ba6d8['source']['model']['id'],_0x4c84be['buttonView']['label']=_0x2ba6d8['source']['label'];}),_0x4c84be;}['_createModelNameView'](){const _0xc311c4=new To(this['locale']);return _0xc311c4['bind']('text')['to'](this,'activeModelName',_0x4b8acb=>_0x4b8acb??''),_0xc311c4['bind']('isVisible')['to'](this,'modelDisplayMode',_0x5c62cf=>'name'===_0x5c62cf),_0xc311c4;}['_createActionsFooterView'](){const _0x506c0f=new vt(this['locale']);return _0x506c0f['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']]}]}),_0x506c0f;}}class To extends vt{constructor(_0x295ce5){super(_0x295ce5),this['set']('text',void 0x0),this['set']('isVisible',!0x0);const _0x2169a9=this['bindTemplate'];this['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai_review__check-list-item-model-name',_0x2169a9['if']('isVisible','ck-hidden',_0x2b1bd6=>!_0x2b1bd6)]},'children':[{'text':_0x2169a9['to']('text')}]});}}class mo extends Mt{constructor(_0x59213b,_0x454ea3){super();const _0x1abdd2=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-button__label'],'style':_0x1abdd2['to']('style'),'id':_0x1abdd2['to']('id')},'children':[{'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-model-dropdown-name']},'children':[{'tag':'span','children':[{'text':_0x1abdd2['to']('text')}]}]},{'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-model-dropdown-description']},'children':[{'tag':'span','children':[_0x454ea3['description']||'']}]}]});}}class Co extends Ht{['_formItemsCollection']=new _0x54be0e();['_customCheckView']=null;['_hideModels']=!0x1;constructor(_0x453fbf,_0x589508,_0x15ed38,_0x151ab8=!0x1){super(_0x453fbf),this['_hideModels']=_0x151ab8,this['set']('isParametrizedViewOpen',!0x1),this['set']('isListItemRendered',!0x1),this['set']('isItemParametrized',_0x589508['isParameterized']);const _0x385294=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',_0x20113c=>_0x20113c),this['bindTemplate']['if']('isListItemRendered','ck-ai_review__check-list-item_rendered',_0x25d861=>_0x25d861)],'style':{'--ck-ai-review-check-list-item-index':_0x15ed38}},'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':_0x589508['title']}]},_0x385294]},{'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-description']},'children':_0x589508['description']?[{'text':_0x589508['description']}]:[]}]}]},..._0x589508['isParameterized']?[this['_createParameterizedView'](_0x589508)]:[],...'custom'===_0x589508['id']?[this['_createCustomView'](_0x589508,this['_hideModels'])]:[]]}),this['on']('click',()=>{_0x589508['isParameterized']?this['isParametrizedViewOpen']=!0x0:this['fire']('runReviewCheck',{'id':_0x589508['id'],'args':_0x589508['useArgs']?_0x589508['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'](_0x59e329=>{_0x59e329['resetToDefault']();}),this['_customCheckView']&&this['_customCheckView']['resetToDefault']();}['_createIconView'](){const _0x500df7=new xt();return _0x500df7['content']=at,_0x500df7['extendTemplate']({'attributes':{'class':['ck-ai_review__check-list-item-title-icon']}}),_0x500df7;}['_createParameterizedView'](_0x18736e){const _0x5ba112=new vt(),_0x41f845=this['_createFormView'](_0x18736e);return _0x5ba112['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-parameterized',this['bindTemplate']['if']('isParametrizedViewOpen','ck-hidden',_0x9a69fb=>!_0x9a69fb)]},'children':[_0x41f845]}),_0x5ba112;}['_createFormView'](_0x5470cb){const _0x403eb9=new vt(),_0x8c3c67=Array['isArray'](_0x5470cb['options'])?_0x5470cb['options']:[],_0xc1a51c=new Nt(this['locale']),t=this['locale']['t'];_0xc1a51c['set']({'label':t('Submit'),'withText':!0x0,'class':ds}),_0xc1a51c['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x4e9edb=>{_0x4e9edb['stopPropagation']();})}}),_0xc1a51c['on']('execute',()=>{const _0x490820=[],_0xb6b988={};this['_formItemsCollection']['forEach'](_0x43c331=>{_0x490820['push'](_0x43c331['value']),_0x5470cb['useArgs']&&_0x5470cb['options']&&(_0xb6b988[_0x43c331['argsKey']]=_0x43c331['value']);}),this['fire']('runReviewCheck',{'id':_0x5470cb['id'],'params':_0x490820['length']?_0x490820:void 0x0,'args':Object['keys'](_0xb6b988)['length']?_0xb6b988:void 0x0});});const _0x101e79=_0x8c3c67['length'];return _0x8c3c67['forEach']((_0x2d15e0,_0x45889b)=>{const _0x659836=_0x45889b===_0x101e79-0x1;this['_formItemsCollection']['add'](new Io(this['locale'],_0x2d15e0,_0x659836?_0xc1a51c:null));}),_0x403eb9['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-parameterized-form']},'children':this['_formItemsCollection']}),_0x403eb9;}['_createCustomView'](_0x7df387,_0x547a37=!0x1){return this['_customCheckView']=new po(this['locale'],_0x7df387,_0x547a37),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',_0x33ddf9=>!_0x33ddf9)]}}),this['_customCheckView']['delegate']('runReviewCheck')['to'](this),this['listenTo'](this['_customCheckView'],'closeCustomCheck',()=>{this['isParametrizedViewOpen']=!0x1;}),this['on']('change:isParametrizedViewOpen',(_0x4a403c,_0x70eee6,_0x53fc28)=>{_0x53fc28||this['_customCheckView']['resetFormValidationStatus']();}),this['_customCheckView'];}}class wo extends Ht{['_checkViews'];constructor(_0xf9dacd){super(_0xf9dacd),this['_checkViews']=new _0x54be0e(),this['_setupTemplate']();}['setChecks'](_0x3caf89,_0x5e2ea7=!0x1){this['_checkViews']['clear']();for(const [_0x3893d7,_0xb6ee9a]of _0x3caf89['entries']()){const _0x1e281c=new Co(this['locale'],_0xb6ee9a,_0x3893d7,_0x5e2ea7);_0x1e281c['delegate']('runReviewCheck')['to'](this),this['_checkViews']['add'](_0x1e281c);}}['hasChecks'](){return this['_checkViews']['length']>0x0;}['resetAllParameterizedChecks'](){for(const _0x5ed2a2 of this['_checkViews'])_0x5ed2a2 instanceof Co&&_0x5ed2a2['resetToDefault']();}['_setupTemplate'](){const _0x1b78e7=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-list',_0x1b78e7['if']('isVisible','ck-hidden',_0x3d922e=>!_0x3d922e)]},'children':this['_checkViews']});}}class fo extends ho{static get['pluginName'](){return'AIReviewModeUI';}['createMainView'](){const _0x1fa80f=this['context']['locale'],_0xf108ca=new _0x3e3394(_0x1fa80f,{'label':us(_0x1fa80f,'AI_REVIEW_MODE'),'icon':_0x3e03ba,'class':'ck-ai-header\x20ck-ai-header_review'});return new lo(this['context']['locale'],{'header':_0xf108ca,'list':new wo(_0x1fa80f),'results':new _o(_0x1fa80f,{'generalErrorText':us(_0x1fa80f,'AI_REVIEW_MODE_GENERAL_ERROR_MESSAGE')}),'completed':new Ao(_0x1fa80f,{'headerText':us(_0x1fa80f,'AI_REVIEW_MODE_FINISH_REVIEW_HEADER_TITLE'),'emptyResultsText':us(_0x1fa80f,'AI_REVIEW_MODE_EMPTY_RESULTS_TEXT'),'buttonText':us(_0x1fa80f,'AI_REVIEW_MODE_FINISH_REVIEW_BUTTON_LABEL')})});}['registerTab'](){const _0x10b189=this['context']['plugins']['get']('AITabs');_0x10b189['view']['on']('activateTab',(_0x2ad5d2,_0xad57f7)=>{'reviewMode'===_0xad57f7?this['fire']('getReviewCheckList'):this['fire']('leaveReview');}),_0x10b189['view']['addTab']({'id':'reviewMode','buttonLabel':us(this['context']['locale'],'AI_REVIEW_MODE'),'buttonIcon':_0x3e03ba,'order':0x0,'content':this['_mainView']});}}const So='review-';class bo extends _0x3397b8{static get['requires'](){return[_0x43d889,tn];}static get['pluginName'](){return'AIReviewCoreEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['_markers']=new Map();['_activeMarkers']=new Set();['_domEmitter'];['_eventEmitter'];constructor(_0xa34736){super(_0xa34736),this['_domEmitter']=new(Ot())(),this['_eventEmitter']=new(pt())();}get['emitter'](){return this['_eventEmitter'];}['afterInit'](){const _0x1f9706=Xs(this['context']);_0x1f9706['conversion']['for']('editingDowncast')['markerToElement']({'model':So+'insert','view':(_0x3dc84c,{writer:_0x434a62})=>{const _0x371ad9=this['_markers']['get'](_0x3dc84c['markerName']),_0x2d1440={'class':'ck-ai_review-marker_add'+(this['_activeMarkers']['has'](_0x371ad9?.['id']||'')?'\x20ck-ai_review__change_active':''),'data-marker-id':_0x3dc84c['markerName']};return _0x434a62['createUIElement']('span',_0x2d1440,function(_0x2f1b40){const _0x2f261c=this['toDomElement'](_0x2f1b40);return _0x2f261c['innerHTML']=_0x371ad9?.['content']?.['asString']||'',_0x2f261c;});}}),_0x1f9706['conversion']['for']('editingDowncast')['markerToHighlight']({'model':So+'remove-only','view':_0x3026f3=>{const _0x4a1514=this['_markers']['get'](_0x3026f3['markerName']),_0xd4e43d=['ck-ai_review-marker_strikethrough'];return this['_activeMarkers']['has'](_0x4a1514?.['id']||'')&&_0xd4e43d['push']('ck-ai_review__change_active'),{'classes':_0xd4e43d,'attributes':{'data-marker-id':_0x3026f3['markerName']}};}}),_0x1f9706['conversion']['for']('editingDowncast')['markerToHighlight']({'model':So+'remove-context','view':_0x2badb4=>{const _0x1a015f=this['_markers']['get'](_0x2badb4['markerName']),_0x972cc3=['ck-ai_review-marker_underline'];return this['_activeMarkers']['has'](_0x1a015f?.['id']||'')&&_0x972cc3['push']('ck-ai_review__change_active'),{'classes':_0x972cc3,'attributes':{'data-marker-id':_0x2badb4['markerName']}};}}),_0x1f9706['conversion']['for']('editingDowncast')['markerToHighlight']({'model':So+'remove-text','view':_0x453c00=>{const _0x143a3a=this['_markers']['get'](_0x453c00['markerName']),_0x41464f=['ck-ai_review-marker_hide'];return this['_activeMarkers']['has'](_0x143a3a?.['id']||'')&&_0x41464f['push']('ck-ai_review__change_active'),{'classes':_0x41464f,'attributes':{'data-marker-id':_0x453c00['markerName']}};}}),_0x1f9706['conversion']['for']('dataDowncast')['markerToElement']({'model':So+'suggestion-context','view':(_0x10d1d9,{writer:_0x271ca6})=>_0x271ca6['createRawElement']('span',{'class':'ck-ai_review-marker_context-'+(_0x10d1d9['isOpening']?'start':'end')})}),_0x1f9706['conversion']['for']('downcast')['attributeToAttribute']({'model':_0x5ebb0a,'view':_0x500725});const _0x4f1025=_0x1f9706['ui']['getEditableElement']()||document['body'];this['_domEmitter']['listenTo'](_0x4f1025,'mouseup',(_0x19cee1,_0xce49bc)=>{const _0x12086c=_0xce49bc['target'],_0x16f2df=this['_findMarkerElement'](_0x12086c);if(!_0x16f2df)return;const _0x58610c=_0x16f2df['getAttribute']('data-marker-id'),_0x48d5a1=_0x58610c['split'](':')['pop']()?.['split']('_')[0x0];this['_eventEmitter']['fire']('changeMarkerClicked',{'markerId':_0x58610c,'changeId':_0x48d5a1,'markerElement':()=>this['_findMarkerElementById'](_0x58610c),'domEvent':_0xce49bc});},{'usePassive':!0x0,'priority':'highest'}),this['_domEmitter']['listenTo'](_0x4f1025,'mouseover',(_0x250f2e,_0x373558)=>{const _0x1f513d=_0x373558['target'],_0x3718e9=_0x373558['relatedTarget'];let _0x44fda2=this['_findMarkerElement'](_0x1f513d);if(!_0x44fda2&&_0x3718e9&&(_0x44fda2=this['_findMarkerElement'](_0x3718e9)),!_0x44fda2)return;const _0x583864=_0x44fda2['getAttribute']('data-marker-id'),_0x46dbfe=_0x583864['split'](':')['pop']()?.['split']('_')[0x0];this['_eventEmitter']['fire']('changeMarkerHovered',{'changeId':_0x46dbfe,'markerElement':()=>this['_findMarkerElementById'](_0x583864),'domEvent':_0x373558});}),this['_domEmitter']['listenTo'](document,'mouseover',_0x2cfb3d((_0x5b8651,_0x14e146)=>{const _0x36eedd=_0x14e146['target'];if(this['_findMarkerElement'](_0x36eedd))return;_0x36eedd['closest']('.ck-reset.ck-ai_review-balloon-panel-suggestion')||this['_eventEmitter']['fire']('changeMarkerBlurred');},0xc8)),_0x1f9706['model']['document']['registerPostFixer'](_0x53e6ce=>this['_validateMarkers'](_0x1f9706,_0x53e6ce)),_0x1f9706['model']['document']['on']('change',()=>this['_handleMarkerChanges'](_0x1f9706));}['getDocumentData'](){const _0x3022cf=this['context']['plugins']['get']('AIEditing'),_0x188c68=Xs(this['context']),_0x592de4=_0x188c68['model'],_0x3dabbf=new _0x2b7448();for(const _0x414bdb of _0x592de4['document']['getRoot']()['getChildren']()){const _0x2bb492=_0x414bdb['_clone'](!0x0);_0x3dabbf['_appendChild'](_0x2bb492);}for(const _0x1f12bf of _0x592de4['markers'])_0x3dabbf['markers']['set'](_0x1f12bf['name'],this['_changeRangeOwnerDocument'](_0x1f12bf['getRange']()['clone'](),_0x3dabbf));const _0xc1dbe1=new _0x3ac2ad({'ignoreElementEnd':!0x0,'startPosition':_0x592de4['createPositionAt'](_0x3dabbf,0x0)}),_0x3e4083=new Set(),_0x5e2c7d=new Map();for(const {item:_0x27b741}of _0xc1dbe1){if(!_0x27b741['is']('$textProxy'))continue;const _0x42c346=_0x27b741['parent'];if(_0x42c346&&_0x42c346['is']('element')){const _0x1b6603=this['_upsertDataId'](_0x42c346,()=>_0x3022cf['_nextDataId'](_0x3e4083));_0x3e4083['add'](_0x1b6603);for(const _0x1cc394 of _0x42c346['getChildren']())_0x1cc394['is']('element')&&_0x3e4083['add'](this['_upsertDataId'](_0x1cc394,()=>_0x3022cf['_nextDataId'](_0x3e4083)));let _0x2ac9fa=_0x42c346;for(;_0x2ac9fa['parent']&&!_0x2ac9fa['parent']['is']('documentFragment');)_0x2ac9fa=_0x2ac9fa['parent'],_0x2ac9fa['hasAttribute'](_0x5ebb0a)&&_0x2ac9fa['_removeAttribute'](_0x5ebb0a);_0x5e2c7d['set'](_0x1b6603,{'path':_0x42c346['getPath'](),'getContent':this['_createGetContentUsingDataIdFn'](_0x2ac9fa['_clone'](!0x0),_0x1b6603,_0x188c68['data'])}),_0xc1dbe1['jumpTo'](_0x592de4['createPositionAfter'](_0x42c346));}}return{'content':_0x188c68['data']['processor']['toData'](_0x188c68['data']['toView'](_0x3dabbf)),'version':_0x188c68['model']['document']['version'],'elements':_0x5e2c7d};}['diffContent'](_0x117a31,_0x22129b,_0x493aee=!0x1){const _0x150ca6=[],_0x82c15d=Xs(this['context']),_0xc36a1d=_0x82c15d['data']['parse'](_0x22129b,'$documentFragment'),_0x50f1eb=_0x82c15d['data']['parse'](_0x117a31,'$documentFragment'),_0x56fc97=_0x82c15d['model']['createPositionAt'](_0x50f1eb,0x0);if(this['_haveSingleTopLevelElement'](_0xc36a1d)){if(!this['_hasSameTopLevelElement'](_0x50f1eb,_0xc36a1d))return _0x150ca6;}else{const _0x54052f=_0x82c15d['model']['schema'];if(!this['_haveOnlyInlineContent'](_0x50f1eb,_0x54052f)||!this['_haveOnlyInlineContent'](_0xc36a1d,_0x54052f))return _0x150ca6;}const _0x17c73a=this['context']['plugins']['get']('DocumentCompare')['getDiff'](_0x117a31,_0x22129b,{'anchor':_0x56fc97,'markDeletions':!0x0})['getOperations']()['filter'](_0x450092=>'insert'===_0x450092['type']||'marker'===_0x450092['type']&&_0x450092['name']['startsWith']('$markedRemove')),_0x287cfa=this['_groupAdjacentOperations'](_0x17c73a),_0x4067cd=[];if(_0x493aee){if(_0x287cfa['length']){const _0x3b7823=_0x287cfa[0x0]['operations'][0x0],_0x5c782a='insert'===_0x3b7823['type']?_0x3b7823['position']:_0x3b7823['newRange']['start'],_0x2af010=this['_getPositionLimitingRange'](_0x5c782a,_0x82c15d,'inside'),_0xdd2786=_0x2af010?_0xc36a1d['getChild'](0x0)['getChildren']():_0xc36a1d['getChildren'](),_0x1845dd=_0x2af010||_0x82c15d['model']['createRangeIn'](_0x50f1eb),_0x567b5a=[new _0x6e7aad('$markedRemove:synthetic'+ot(),null,_0x1845dd,_0x82c15d['model']['document']['model']['markers'],!0x0,_0x82c15d['model']['document']['version']+0x1),new _0x35208a(_0x1845dd['end'],_0xdd2786,_0x82c15d['model']['document']['version']+0x2)];_0x4067cd['push']({'operations':_0x567b5a,'operationsIsolated':_0x567b5a,'groupOffset':0x0});}}else _0x4067cd['push'](..._0x287cfa);let _0x17b292=0x0;return _0x82c15d['model']['change'](_0xbc2b9f=>{for(let _0x383ee4=0x0;_0x383ee4<_0x4067cd['length'];_0x383ee4++){const _0x4e5c93=_0x4067cd[_0x383ee4],_0x26d89e=_0xbc2b9f['createDocumentFragment']();for(const _0x29eb9c of _0x50f1eb['getChildren']())_0xbc2b9f['append'](_0x29eb9c['_clone'](!0x0),_0x26d89e);for(const _0x510baf of _0x4e5c93['operationsIsolated'])if('insert'===_0x510baf['type']){const _0x2415ec=_0x510baf;_0x2415ec['baseVersion']=null,_0x2415ec['isDocumentOperation']=!0x1,this['_changeOperationOwnerDocument'](_0x2415ec,_0x26d89e),_0xbc2b9f['batch']['addOperation'](_0x510baf),_0x82c15d['model']['applyOperation'](_0x510baf);const _0x3c14f0='suggestion:insertion:id:authorId:'+_0x17b292++,_0x49b063=_0x82c15d['model']['createRange'](_0x2415ec['position'],_0x2415ec['position']['getShiftedBy'](_0x2415ec['howMany']));_0x26d89e['markers']['set'](_0x3c14f0,_0x49b063);}else{if('marker'===_0x510baf['type']&&_0x510baf['name']['startsWith']('$markedRemove')){const _0x1f144a=_0x510baf,_0x5b0408='suggestion:deletion:id:authorId:'+_0x17b292++;this['_changeOperationOwnerDocument'](_0x1f144a,_0x26d89e),_0x26d89e['markers']['set'](_0x5b0408,_0x1f144a['newRange']);}}if(_0x493aee)_0x150ca6['push']({..._0x4e5c93,'context':this['_createGetContentFn'](_0x50f1eb,_0x82c15d['data']),'content':this['_createGetContentFn'](_0x50f1eb,_0x82c15d['data'])});else{const _0x592b70=this['_getChangeContext'](this['_changePositionOwnerDocument'](this['_getOperationStart'](_0x4e5c93['operationsIsolated'][0x0]),_0x26d89e),this['_changePositionOwnerDocument'](this['_getOperationEnd'](_0x4e5c93['operationsIsolated'][_0x4e5c93['operationsIsolated']['length']-0x1]),_0x26d89e));_0x26d89e['markers']['set'](So+'suggestion-context',new _0x519c43(_0x592b70['start'],_0x592b70['end'])),_0x150ca6['push']({..._0x4e5c93,'context':this['_createGetContextFn'](_0x26d89e,_0x82c15d['data'],{'ellipsisBefore':_0x592b70['hasContentBefore'],'ellipsisAfter':_0x592b70['hasContentAfter']}),'content':this['_createGetContentFn'](_0x26d89e,_0x82c15d['data'])});}}}),_0x150ca6;}['markChangePositionInEditorContent'](_0x58e016,_0x301e61){if(!_0x58e016['length'])return;const _0x304f9d=_0x58e016[0x0]['parent']['id'],_0x124761=_0x301e61['elements']['get'](_0x304f9d);if(!_0x124761)return void console['warn']('No\x20element\x20found\x20for\x20ID:\x20'+_0x304f9d);const _0x38065b=_0x124761['path'],_0x328e32=Xs(this['context']),_0x159e3d=_0x328e32['model']['document']['history']['getOperations'](_0x301e61['version']),_0x2ab7da=[];for(const _0xe4526 of _0x58e016){const _0x574d36=_0xe4526['operationsIsolated']['map'](_0x2735d8=>this['_translateOperationToEditorContent'](_0x2735d8,_0x38065b,_0x328e32['model']['document']['getRoots']()[0x0]));if(!_0x574d36||!_0x574d36['length'])continue;const _0x40dfbd=_0x574d36['every'](_0x57d2f3=>'marker'===_0x57d2f3['type']&&_0x57d2f3['name']['startsWith']('$markedRemove')),_0x13ff69={'document':_0x328e32['model']['document'],'useRelations':!0x1,'padWithNoOps':!0x1},_0x76dbfa=_0x4976b5(_0x574d36,_0x159e3d,_0x13ff69)['operationsA'];for(const _0x1456df of _0x76dbfa)if('insert'===_0x1456df['type']){const _0x5baed1=_0x1456df,_0x59535f=_0x5baed1['nodes'];_0x328e32['model']['change'](_0x4b49cc=>{const _0xc88fea=_0x4b49cc['createDocumentFragment']();for(const _0x38ca3a of _0x59535f)_0x4b49cc['append'](_0x38ca3a['_clone'](!0x0),_0xc88fea);_0x2ab7da['push']({'start':_0x5baed1['position'],'end':_0x5baed1['position'],'type':'insert','groupId':_0xe4526['id'],'content':{'asString':this['_createGetContentFn'](_0xc88fea,_0x328e32['data'])(),'asFragment':_0xc88fea}});});}else{if('marker'===_0x1456df['type']&&_0x1456df['name']['startsWith']('$markedRemove')){const _0x306837=_0x1456df;let _0x2f2e95='remove-text';if(_0x40dfbd){const _0xb3c378=this['_findAdjacentContextDistance'](_0x306837['newRange']['start'],'backward',_0x328e32['model']['schema']),_0x41711e=this['_findAdjacentContextDistance'](_0x306837['newRange']['end'],'forward',_0x328e32['model']['schema']);if(_0xb3c378||_0x41711e){const _0x2488a3=_0x306837['newRange']['start']['getShiftedBy'](-_0xb3c378),_0x1ecbce=_0x306837['newRange']['end']['getShiftedBy'](_0x41711e);_0x2ab7da['push']({'start':_0x2488a3,'end':_0x1ecbce,'groupId':_0xe4526['id'],'type':'remove-context'});}else _0x2f2e95='remove-only';}_0x2ab7da['push']({'start':_0x306837['newRange']['start'],'end':_0x306837['newRange']['end'],'groupId':_0xe4526['id'],'type':_0x2f2e95});}}}this['_insertMarkers'](_0x2ab7da);}['clearAllMarkers'](){const _0x2659fe=Xs(this['context']);_0x2659fe['model']['change'](_0x1065d4=>{for(const _0x440dc3 of this['_markers']['keys']())_0x2659fe['model']['markers']['get'](_0x440dc3)&&_0x1065d4['removeMarker'](_0x440dc3);}),this['_markers']['clear'](),this['_activeMarkers']['clear']();}['switchToReadOnly'](){Xs(this['context'])['enableReadOnlyMode']('ai-review');}['switchToEdit'](){Xs(this['context'])['disableReadOnlyMode']('ai-review');}['applyChange'](_0x40905e){const _0x51832c=Xs(this['context']),_0x3aa47e=_0x51832c['model'],_0xc79c7=_0x40905e['map'](_0x402987=>this['_getMarkersDataForGroup'](_0x402987))['flat']();_0x3aa47e['change'](_0x3c3fa3=>{for(const _0x4ef790 of _0xc79c7){const _0x48046a=_0x51832c['model']['markers']['get'](_0x4ef790['id']);if(_0x48046a){if('insert'===_0x4ef790['type']){if(!_0x4ef790['content'])continue;_0x3aa47e['insertContent'](_0x4ef790['content']['asFragment']||null,_0x48046a['getRange']()['start']);}else'remove-text'!==_0x4ef790['type']&&'remove-only'!==_0x4ef790['type']||_0x3aa47e['deleteContent'](_0x3aa47e['createSelection'](_0x48046a['getRange']()));_0x3c3fa3['removeMarker'](_0x4ef790['id']),this['_markers']['delete'](_0x4ef790['id']);}}});}['rejectChange'](_0x4e6e8b){const _0x28bd5b=Xs(this['context']),_0x3e7c8c=this['_getMarkersDataForGroup'](_0x4e6e8b);_0x28bd5b['model']['change'](_0x424d3a=>{for(const _0x5bc991 of _0x3e7c8c)_0x424d3a['removeMarker'](_0x5bc991['id']),this['_markers']['delete'](_0x5bc991['id']);});}['getEditor'](){return Xs(this['context']);}['getMarkerElementForChange'](_0x884820){const _0x1dab7b=Array['from'](this['_markers']['values']())['filter'](_0x42f8ba=>_0x42f8ba['groupId']===_0x884820);if(!_0x1dab7b['length'])return null;const _0x50a466=0x1===_0x1dab7b['length']?_0x1dab7b[0x0]:this['_sortMarkers'](_0x1dab7b)[0x0],_0x19a64a=Xs(this['context'])['model']['markers']['get'](_0x50a466['id']);if(!_0x19a64a)return null;return{'modelRange':_0x19a64a['getRange'](),'getElement':()=>this['_findMarkerElementById'](_0x50a466['id'])};}['getContentElementForChange'](_0x422e0d){const _0x41061d=Array['from'](this['_markers']['values']())['filter'](_0x3d92d2=>_0x3d92d2['groupId']===_0x422e0d);if(!_0x41061d['length'])return null;const _0x3ca684=0x1===_0x41061d['length']?_0x41061d[0x0]:this['_sortMarkers'](_0x41061d)[0x0],_0x1805b6=Xs(this['context']),_0x63c14a=_0x1805b6['model']['markers']['get'](_0x3ca684['id']);if(!_0x63c14a)return null;const _0x5e4026=_0x63c14a['getRange'](),_0x2c3e88=_0x1805b6['editing']['view']['getDomRoot']();if(!_0x2c3e88||!_0x5e4026)return null;let _0x200c1c=_0x5e4026['start']['parent'];for(;_0x200c1c['parent']&&'$root'!==_0x200c1c['parent']['name'];)_0x200c1c=_0x200c1c['parent'];if(!_0x200c1c||!_0x200c1c['name'])return null;const _0x3bf4d6=_0x2c3e88['querySelector']('[data-marker-id=\x22'+_0x3ca684['id']+'\x22]');if(!_0x3bf4d6)return null;let _0x3037c8=null;_0x1805b6['model']['change'](_0x530257=>{_0x3037c8=_0x530257['createDocumentFragment'](),_0x530257['append'](_0x200c1c['_clone'](!0x0),_0x3037c8);});const _0x291a5f=_0x1805b6['data']['toView'](_0x3037c8)['getChild'](0x0);return _0x3bf4d6['closest'](_0x291a5f['name']);}['reactivateMarkers'](_0x18e82f){const _0x59c393=this['_getMarkersDataForGroup'](_0x18e82f);if(!_0x59c393['length'])return;const _0x60e592=Array['from'](this['_activeMarkers'])['sort'](),_0x1bf693=Array['from'](new Set(_0x59c393['map'](_0x184e2f=>_0x184e2f['id'])))['sort']();_0x60e592['join']('|')!==_0x1bf693['join']('|')&&(this['setAllMarkersAsInactive'](),this['setMarkersInElementAsActive'](_0x18e82f));}['setMarkersInElementAsActive'](_0x39919c){const _0x486d68=this['_getMarkersDataForGroup'](_0x39919c);if(!_0x486d68['length'])return;const _0x51906b=Xs(this['context']),_0x4e54f9=new Set(_0x486d68['map'](_0x3f2485=>_0x3f2485['id'])),_0xf99813=Array['from'](_0x4e54f9['values']())['map'](_0x2a36a3=>_0x51906b['model']['markers']['get'](_0x2a36a3))['filter'](_0x22f73e=>!!_0x22f73e);_0x4e54f9['forEach'](_0x135e6a=>{this['_activeMarkers']['add'](_0x135e6a);}),_0x51906b['model']['change'](()=>{_0xf99813['forEach'](_0x34bbd3=>{_0x51906b['editing']['reconvertMarker'](_0x34bbd3);});});}['setAllMarkersAsInactive'](){const _0x5865cc=Array['from'](this['_activeMarkers']);if(!_0x5865cc['length'])return;this['_activeMarkers']['clear']();const _0x31a833=Xs(this['context']),_0x5ae57c=_0x5865cc['map'](_0x553c99=>_0x31a833['model']['markers']['get'](_0x553c99))['filter'](_0x307e63=>!!_0x307e63);_0x31a833['model']['change'](()=>{_0x5ae57c['forEach'](_0x4184e3=>{_0x31a833['editing']['reconvertMarker'](_0x4184e3);});});}['_getPositionLimitingRange'](_0x38a0af,_0x3fd1d0,_0x5e6247='outside'){if(!_0x38a0af)return null;let _0x520cd3=_0x38a0af['parent'];for(;_0x520cd3&&_0x520cd3['parent']&&'$root'!==_0x520cd3['parent']['name']&&!_0x3fd1d0['model']['schema']['isLimit'](_0x520cd3)&&!_0x3fd1d0['model']['schema']['isBlock'](_0x520cd3);)_0x520cd3=_0x520cd3['parent'];if(!_0x520cd3||!_0x520cd3['name']||'$root'===_0x520cd3['name'])return null;let _0x334458=null;return _0x3fd1d0['model']['change'](_0x55aab1=>{_0x334458='inside'===_0x5e6247?_0x55aab1['createRangeIn'](_0x520cd3):_0x55aab1['createRangeOn'](_0x520cd3);}),_0x334458;}['_validateMarkers'](_0x1d819d,_0x472f6d){const _0x4d9cbb=Array['from'](this['_markers']['keys']()),_0x452740=new Map();for(const _0x465dca of _0x4d9cbb){const _0xe53e9c=_0x1d819d['model']['markers']['get'](_0x465dca);if(!_0xe53e9c)continue;const _0x5c5af7=_0xe53e9c['getStart']()['path'][0x0];_0x452740['has'](_0x5c5af7)||_0x452740['set'](_0x5c5af7,[]),_0x452740['get'](_0x5c5af7)['push'](_0xe53e9c);}const _0x25ce77=new Set();for(const _0x16f79c of _0x1d819d['model']['document']['differ']['getChanges']()){let _0x455404=-0x1,_0x237819=null;if('insert'===_0x16f79c['type'])_0x237819=new _0x519c43(_0x16f79c['position'],_0x16f79c['position']['getShiftedBy'](_0x16f79c['length'])),_0x455404=_0x16f79c['position']['path'][0x0];else{if('remove'!==_0x16f79c['type'])continue;_0x237819=new _0x519c43(_0x16f79c['position']),_0x455404=_0x16f79c['position']['path'][0x0];}const _0x50c473=_0x452740['get'](_0x455404)||[];if(_0x50c473['length']){for(const _0x5ad5cd of _0x50c473)if(_0x237819['root']['rootName']===_0x5ad5cd['getRange']()['root']['rootName']&&('insert'!==_0x16f79c['type']||!_0x237819['containsRange'](_0x5ad5cd['getRange']()))&&(_0x237819['isIntersecting'](_0x5ad5cd['getRange']())||_0x237819['start']['isTouching'](_0x5ad5cd['getRange']()['end'])||_0x237819['end']['isTouching'](_0x5ad5cd['getRange']()['start']))){const _0xc1e9b0=this['_parseMarkerName'](_0x5ad5cd['name']);Array['from'](this['_markers']['values']())['filter'](_0xd5984=>_0xd5984['groupId']===_0xc1e9b0['groupId'])['forEach'](_0x55f4ed=>_0x25ce77['add'](_0x55f4ed['id']));}}}if(_0x25ce77['size']){for(const _0x1831e8 of _0x25ce77)_0x472f6d['removeMarker'](_0x1831e8);return!0x0;}return!0x1;}['_handleMarkerChanges'](_0x172d96){for(const {name:_0x529711,data:_0x11ece4}of _0x172d96['model']['document']['differ']['getChangedMarkers']()){if(!_0x529711['startsWith'](So))continue;const _0x3d92fe=_0x11ece4['oldRange'],_0x1f8f68=_0x11ece4['newRange'],_0x2aa4c8=_0x3d92fe&&'$graveyard'===_0x3d92fe['root']['rootName'],_0x2a709f=_0x1f8f68&&'$graveyard'===_0x1f8f68['root']['rootName'];if(_0x2aa4c8&&_0x2a709f)continue;const _0xc09b41=this['_parseMarkerName'](_0x529711);this['_markers']['get'](_0x529711)&&(_0x2a709f||!_0x1f8f68?this['_eventEmitter']['fire']('changeMarkerRemoved',{'markerId':_0x529711,'changeId':_0xc09b41['groupId']}):_0x2aa4c8&&_0x1f8f68&&this['_eventEmitter']['fire']('changeMarkerRestored',{'markerId':_0x529711,'changeId':_0xc09b41['groupId']}));}}['_parseMarkerName'](_0x27ce78){const _0x5752d6=_0x27ce78['split'](':'),_0x1932eb=(_0x5752d6[0x1]||'')['split']('_');return{'prefix':_0x5752d6[0x0],'groupId':_0x1932eb[0x0],'suffix':_0x1932eb[0x1]};}['_translateOperationToEditorContent'](_0x55c684,_0xa9519c,_0x367cc7){if('insert'===_0x55c684['type']){const _0x32b136=_0x55c684;return new _0x35208a(this['_changePosition'](_0xa9519c['concat'](_0x32b136['position']['offset']),_0x367cc7),_0x32b136['nodes'],_0x32b136['baseVersion']);}if('marker'===_0x55c684['type']&&_0x55c684['name']['startsWith']('$markedRemove')){const _0x84ab0d=_0x55c684;return new _0x6e7aad(_0x84ab0d['name'],_0x84ab0d['oldRange'],this['_changeRange'](_0x84ab0d['newRange'],_0xa9519c['concat'](_0x84ab0d['newRange']['start']['offset']),_0xa9519c['concat'](_0x84ab0d['newRange']['end']['offset']),_0x367cc7),_0x84ab0d['_markers'],_0x84ab0d['affectsData'],_0x84ab0d['baseVersion']);}return _0x55c684;}['_groupAdjacentOperations'](_0x5c6ac7){if(!_0x5c6ac7['length'])return[];const _0x467c22=[];let _0x394f14=0x0,_0x2e2e82=0x0,_0x1477cb=[];for(let _0x3c7ac2=0x0;_0x3c7ac2<=_0x5c6ac7['length'];_0x3c7ac2++){const _0x12b382=_0x5c6ac7[_0x3c7ac2],_0x56766f=_0x5c6ac7[_0x3c7ac2-0x1];!_0x12b382||_0x56766f&&!this['_getOperationEnd'](_0x56766f)['isTouching'](this['_getOperationStart'](_0x12b382))?(_0x467c22['push']({'operations':_0x1477cb,'operationsIsolated':_0x1477cb['map'](_0x5a2e0c=>this['_shiftOperation'](_0x5a2e0c['clone'](),-_0x2e2e82)),'groupOffset':_0x394f14}),_0x1477cb=_0x12b382?[_0x12b382]:[],_0x2e2e82+=_0x394f14,_0x394f14=0x0):_0x1477cb['push'](_0x12b382),_0x12b382&&'insert'===_0x12b382['type']&&(_0x394f14+=_0x12b382['howMany']);}return _0x467c22;}['_findAdjacentContextDistance'](_0x6d27bf,_0x467548,_0x30bc36,_0x47e54a=0x1){const _0x62f81a=new _0x3ac2ad({'startPosition':_0x6d27bf,'direction':_0x467548});let _0x433675=0x0;for(let _0x29140e=0x0;_0x29140e<_0x47e54a;_0x29140e++){let _0x3b97ac=0x0,_0x258362=!0x1,_0x1f092b='forward'===_0x467548?/^\W*\w+/:/\w+\W*$/;for(const {item:_0x19c204}of _0x62f81a)if(_0x19c204['is']('$textProxy')){const _0x2f3008=_0x1f092b['exec'](_0x19c204['data']);if(_0x2f3008&&_0x2f3008['length']){if(_0x3b97ac+='forward'===_0x467548?_0x2f3008['index']+_0x2f3008[0x0]['length']:_0x19c204['data']['length']-_0x2f3008['index'],_0x2f3008[0x0]['length']!==_0x19c204['data']['length'])break;_0x258362=!0x0,_0x1f092b='forward'===_0x467548?/^\w+/:/\w+$/;}else{if(_0x258362)break;_0x3b97ac+=_0x19c204['offsetSize'];}}else{if(_0x19c204['is']('element')){_0x30bc36['isInline'](_0x19c204)&&!_0x258362&&(_0x3b97ac+=0x1);break;}}_0x433675+=_0x3b97ac,_0x62f81a['jumpTo'](_0x6d27bf['getShiftedBy']('forward'===_0x467548?_0x433675:-_0x433675));}return _0x433675;}['_getChangeContext'](_0x3c0af5,_0x3fed33){const _0x140b5e=Xs(this['context'])['model']['schema'],_0x33dd39=this['_findAdjacentContextDistance'](_0x3c0af5,'backward',_0x140b5e,0x6),_0x4a7bd3=this['_findAdjacentContextDistance'](_0x3fed33,'forward',_0x140b5e,0x6),_0xb7d213=_0x3c0af5['getShiftedBy'](-_0x33dd39),_0x51dc2e=_0x3fed33['getShiftedBy'](_0x4a7bd3);return{'start':_0xb7d213,'end':_0x51dc2e,'hasContentBefore':!_0xb7d213['isAtStart'],'hasContentAfter':!_0x51dc2e['isAtEnd']};}['_insertMarkers'](_0x3e9ff9){const _0x10379b=this['context']['plugins']['get']('AIEditing'),_0x474ecf=new Set();Xs(this['context'])['model']['change'](_0x6ed60d=>{for(const _0x808aa0 of _0x3e9ff9){const _0x472772=''+So+_0x808aa0['type']+':'+_0x808aa0['groupId']+'_'+_0x10379b['_nextDataId'](_0x474ecf);this['_markers']['set'](_0x472772,{'id':_0x472772,'groupId':_0x808aa0['groupId'],'type':_0x808aa0['type'],'content':_0x808aa0['content']}),_0x6ed60d['addMarker'](_0x472772,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x6ed60d['createRange'](_0x808aa0['start'],_0x808aa0['end'])});}});}['_createGetContextFn'](_0x4d6e17,_0x346f62,_0x40b2a7){let _0x1cf106='';return()=>{if(!_0x1cf106){const _0x2edc9e=_0x346f62['toView'](_0x4d6e17,{'showSuggestionHighlights':!0x0});let _0x2d7f27=_0x2edc9e['getChild'](0x0);if(_0x2d7f27['is']('containerElement')||(_0x2d7f27=_0x2edc9e),!_0x2d7f27)return'';let _0x12a7bd=!0x1;const _0x110f1f=[];for(const _0x40efe6 of _0x2d7f27['getChildren']())_0x40efe6['is']('element','span')&&_0x40efe6['hasClass']('ck-ai_review-marker_context-end')&&(_0x12a7bd=!0x1),_0x12a7bd&&_0x110f1f['push'](_0x40efe6),_0x40efe6['is']('element','span')&&_0x40efe6['hasClass']('ck-ai_review-marker_context-start')&&(_0x12a7bd=!0x0);_0x2d7f27['_removeChildren'](0x0,_0x2d7f27['childCount']),_0x40b2a7?.['ellipsisBefore']&&_0x2d7f27['_appendChild']('…'),_0x2d7f27['_appendChild'](_0x110f1f),_0x40b2a7?.['ellipsisAfter']&&_0x2d7f27['_appendChild']('…');const _0x40461e=_0x346f62['htmlProcessor']['domConverter']['viewToDom'](_0x2edc9e),_0x1837be=_0x346f62['htmlProcessor']['htmlWriter']['getHtml'](_0x40461e);_0x1cf106=_0x1837be;}return _0x1cf106;};}['_createGetContentFn'](_0x5c8c6b,_0x353763){let _0x578fcc='';return()=>(_0x578fcc||(_0x578fcc=_0x353763['stringify'](_0x5c8c6b,{'showSuggestionHighlights':!0x0})),_0x578fcc);}['_createGetContentUsingDataIdFn'](_0x137cd2,_0x347991,_0x2bab6d){let _0x481d6b='';return()=>{if(!_0x481d6b){const _0x5517ad=_0x2bab6d['toView'](new _0x2b7448(_0x137cd2)),_0xee6978=_0x2bab6d['htmlProcessor']['domConverter']['viewToDom'](_0x5517ad)['querySelector']('[data-id=\x22'+_0x347991+'\x22]');_0x481d6b=_0xee6978?.['outerHTML']||'';}return _0x481d6b;};}['_findMarkerElement'](_0x2565e9,_0x43d8ca=0x5){let _0x22a69a=_0x2565e9,_0x54fc21=null;for(let _0x267239=0x0;_0x267239<_0x43d8ca&&_0x22a69a;_0x267239++){if(!_0x22a69a['className']){_0x22a69a=_0x22a69a['parentElement'];continue;}if(!(''+_0x22a69a['className'])['includes']('ck-ai_review-marker_')){_0x22a69a=_0x22a69a['parentElement'];continue;}if(!_0x22a69a['getAttribute']('data-marker-id'))break;_0x54fc21=_0x22a69a;break;}return _0x54fc21;}['_findMarkerElementById'](_0x333d8f){const _0x80e6b5=Xs(this['context']),_0x32b366=_0x80e6b5['model']['markers']['get'](_0x333d8f);return _0x32b366?_0x58d31c(_0x80e6b5['editing'],_0x32b366):null;}['_getMarkersDataForGroup'](_0x5e8ef8){return Array['from'](this['_markers']['values']())['filter'](_0x5b9c1a=>_0x5b9c1a['groupId']===_0x5e8ef8);}['_getOperationStart'](_0x4d7a7c){return'insert'===_0x4d7a7c['type']?_0x4d7a7c['position']:_0x4d7a7c['newRange']['start'];}['_getOperationEnd'](_0x31d4b2,_0x3ca58a=!0x1){return'insert'===_0x31d4b2['type']?_0x3ca58a?_0x31d4b2['position']:_0x31d4b2['position']['getShiftedBy'](_0x31d4b2['howMany']):_0x31d4b2['newRange']['end'];}['_shiftOperation'](_0x432ec4,_0x1c9ecb){return'insert'===_0x432ec4['type']?_0x432ec4['position']=_0x432ec4['position']['getShiftedBy'](_0x1c9ecb):'marker'===_0x432ec4['type']&&_0x432ec4['newRange']&&(_0x432ec4['newRange']=new _0x519c43(_0x432ec4['newRange']['start']['getShiftedBy'](_0x1c9ecb),_0x432ec4['newRange']['end']['getShiftedBy'](_0x1c9ecb))),_0x432ec4;}['_changeOperationOwnerDocument'](_0x930039,_0x1ae315){'insert'===_0x930039['type']?_0x930039['position']=this['_changePositionOwnerDocument'](_0x930039['position'],_0x1ae315):'marker'===_0x930039['type']&&_0x930039['newRange']&&(_0x930039['newRange']=this['_changeRangeOwnerDocument'](_0x930039['newRange'],_0x1ae315));}['_changePositionOwnerDocument'](_0x463ddb,_0x56aede){return new _0x87183(_0x56aede,_0x463ddb['path']);}['_changeRangeOwnerDocument'](_0x2f4aa5,_0x4f6302){return new _0x519c43(this['_changePositionOwnerDocument'](_0x2f4aa5['start'],_0x4f6302),this['_changePositionOwnerDocument'](_0x2f4aa5['end'],_0x4f6302));}['_changePosition'](_0x338734,_0x42c752){return new _0x87183(_0x42c752,[..._0x338734]);}['_changeRange'](_0x9bc931,_0x166e30,_0x558318,_0x5b8201){return new _0x519c43(this['_changePosition'](_0x166e30,_0x5b8201),this['_changePosition'](_0x558318,_0x5b8201));}['_sortMarkers'](_0x2df0d3){const _0x564e1c=_0x22b8df=>{switch(_0x22b8df){case'insert':return 0x0;case'remove-context':return 0x1;case'remove-only':return 0x2;case'remove-text':return 0x3;}};return _0x2df0d3['sort']((_0x361475,_0x25ae6a)=>_0x564e1c(_0x361475['type'])-_0x564e1c(_0x25ae6a['type']));}['_hasSameTopLevelElement'](_0x246124,_0x5612d2){const _0x1683fb=_0x246124['getChild'](0x0),_0x1cc0fc=_0x5612d2['getChild'](0x0);return!(!_0x1683fb||!_0x1cc0fc)&&((!_0x1683fb['is']('element')||!_0x1cc0fc['is']('element')||_0x1683fb['name']===_0x1cc0fc['name'])&&!(_0x1683fb['is']('element')&&!_0x1cc0fc['is']('element')||!_0x1683fb['is']('element')&&_0x1cc0fc['is']('element')));}['_haveSingleTopLevelElement'](_0x2c7e0f){return 0x1===_0x2c7e0f['childCount'];}['_haveOnlyInlineContent'](_0x100591,_0x2a886f){for(const _0x18f1b7 of _0x100591['getChildren']())if(_0x18f1b7['is']('element')&&!_0x2a886f['isInline'](_0x18f1b7))return!0x1;return!0x0;}['_upsertDataId'](_0x189a8b,_0x14ca00){let _0x313e3f=_0x189a8b['getAttribute'](_0x5ebb0a);return _0x313e3f||(_0x313e3f=_0x14ca00(),_0x189a8b['_setAttribute'](_0x5ebb0a,_0x313e3f)),_0x313e3f;}}class Ro extends pt(){['id'];['contentNew'];['contentInitial'];['documentVersion'];constructor({id:_0x5b3604,contentNew:_0x46bd5d,contentInitial:_0x193317,documentVersion:_0x3711a7}){super(),this['id']=_0x5b3604,this['contentNew']=_0x46bd5d,this['contentInitial']=_0x193317,this['documentVersion']=_0x3711a7;}}class Oo extends ct(){['id'];['parent'];['_data'];['_editorOperations']=[];constructor(_0x3cf1b9,_0x304365,_0x39e387){super(),this['id']=_0x3cf1b9,this['parent']=_0x39e387,this['_data']=_0x304365,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 ko extends ct(){['id']=ot();['callId'];['_results']=new Map();['_changes']=[];['_sourceCheck'];['_documentData'];['_aiConnector'];['_reviewParams'];['_reviewArgs'];['_activeRequest']=null;['_currentError'];['_wasAborted']=!0x1;constructor(_0x58c96d,_0x488f40,_0x30a0dd,_0x35f2f5,_0x5c7567){super(),this['_sourceCheck']=_0x488f40,this['_documentData']=_0x58c96d,this['_aiConnector']=_0x30a0dd,this['_reviewParams']=_0x35f2f5,this['_reviewArgs']=_0x5c7567,this['on']('change:status',(_0x515209,_0x400f59,_0x3148b7)=>{'aborted'==_0x3148b7&&(this['_wasAborted']=!0x0),this['fire']('reviewCheckRunUpdated',{'status':_0x3148b7,'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'](_0x2f1ef7=>'pending'===_0x2f1ef7['status']);}get['currentError'](){return this['_currentError'];}['updateDocumentData'](_0x4e7bf3){this['_documentData']=_0x4e7bf3;}async['start'](){this['status']='loading',this['_currentError']=void 0x0;try{this['_activeRequest']=this['_createApiRequest']();const _0x25c4f3=await this['_activeRequest']['getStream']();this['status']='data';for await(const _0xc608e7 of _0x25c4f3)'unmodified'!==_0xc608e7['data']['operation']&&('error'!==_0xc608e7['data']['operation']?'review-metadata'!==_0xc608e7['event']?this['_addReviewCheckResult'](_0xc608e7['data']['dataId'],_0xc608e7['data']['textDelta']):this['callId']=_0xc608e7['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(_0x168ad6){this['_currentError']=_0x168ad6,_0x168ad6 instanceof Error&&_0x168ad6['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'](_0x5103fe,_0x227b81){const _0x471c14=this['_results']['get'](_0x5103fe);if(!_0x471c14)return;if(0x0===_0x227b81['length'])return;const _0x484843=[];_0x227b81['forEach']((_0x4b88ff,_0x261867)=>{const _0x26f2fa=new Oo(_0x471c14['id']+'-'+_0x261867,_0x4b88ff,_0x471c14);_0x26f2fa['on']('change:status',()=>{this['fire']('reviewCheckResultChangeStatusUpdated',{'change':_0x26f2fa,'status':_0x26f2fa['status']});}),_0x26f2fa['on']('change:isActivated',()=>{_0x26f2fa['isActivated']?this['fire']('reviewCheckResultActivated',{'change':_0x26f2fa}):this['fire']('reviewCheckResultDeactivated',{'change':_0x26f2fa});}),this['_changes']['push'](_0x26f2fa),_0x484843['push'](_0x26f2fa);}),this['fire']('reviewCheckResultReady',{'changes':_0x484843,'result':_0x471c14,'source':this});}['abort'](){this['_activeRequest']&&(this['_activeRequest']['abortController']['abort'](),this['_activeRequest']=null,this['status']='aborted');}['isChangeActive'](_0x2addfa){const _0x2d2025=this['_changes']['find'](_0x2eb91c=>_0x2eb91c['id']===_0x2addfa);return!(!_0x2d2025||'pending'!==_0x2d2025['status']);}['isAnyChangeActivated'](){return this['_changes']['some'](_0x3bd9b3=>!0x0===_0x3bd9b3['isActivated']);}['getActiveChanges'](){return this['_changes']['filter'](_0x43cce5=>'pending'===_0x43cce5['status']);}['getChangeById'](_0x22d26d){return this['_changes']['find'](_0x517f22=>_0x517f22['id']===_0x22d26d);}['markAllChangesAsAccepted'](){for(const _0x55bc3b of this['_changes'])'pending'===_0x55bc3b['status']&&(_0x55bc3b['status']='accepted');this['_checkIfFinished']();}['markChangeAsAccepted'](_0x58240b){const _0x4cb280=this['_changes']['find'](_0x1f4181=>_0x1f4181['id']===_0x58240b);_0x4cb280&&'pending'===_0x4cb280['status']&&(_0x4cb280['status']='accepted'),this['_checkIfFinished']();}['markChangeAsRejected'](_0x29fa89){const _0x54a358=this['_changes']['find'](_0x1595ee=>_0x1595ee['id']===_0x29fa89);_0x54a358&&'pending'===_0x54a358['status']&&(_0x54a358['status']='rejected'),this['_checkIfFinished']();}['markChangeAsOutdated'](_0x417050){const _0x360d2e=this['_changes']['find'](_0x444647=>_0x444647['id']===_0x417050);_0x360d2e&&'pending'===_0x360d2e['status']&&(_0x360d2e['status']='outdated'),this['_checkIfFinished']();}['markChangeAsPending'](_0x5b1561){const _0x599efa=this['_changes']['find'](_0x563ac4=>_0x563ac4['id']===_0x5b1561);_0x599efa&&'outdated'===_0x599efa['status']&&(_0x599efa['status']='pending'),this['_checkIfFinished']();}['activateChange'](_0x748c4f){this['_changes']['filter'](_0x4b592a=>_0x4b592a['isActivated']&&_0x4b592a['id']!==_0x748c4f)['forEach'](_0x522bab=>{_0x522bab['isActivated']=!0x1;});const _0x41e684=this['_changes']['find'](_0x24ed3f=>_0x24ed3f['id']===_0x748c4f);_0x41e684&&'pending'===_0x41e684['status']&&(_0x41e684['isActivated']=!0x0);}['deactivateChange'](){this['_changes']['filter'](_0x334623=>_0x334623['isActivated'])['forEach'](_0x78f12a=>{_0x78f12a['isActivated']=!0x1;});}['forceReadyState'](){this['status']='ready';}async['sendRating'](_0x10446f){if('initialized'===this['status']||'loading'===this['status']||'data'===this['status']||this['_wasAborted'])return;if(!this['callId']||0x0===this['_changes']['length'])return;let _0x2e9bbc;if(_0x10446f){const _0x1d51a7=this['_changes']['find'](_0x60100e=>_0x60100e['id']===_0x10446f);if(_0x1d51a7&&_0x1d51a7['isRated'])return;_0x1d51a7&&(_0x2e9bbc=_0x1d51a7['parent']['id'],_0x1d51a7['isRated']=!0x0);}const _0x1847a1={'positiveCount':this['_changes']['filter'](_0x3ac212=>'accepted'===_0x3ac212['status'])['length'],'totalCount':this['_changes']['length']};this['_sendRatingRequest'](_0x1847a1,this['callId'],_0x2e9bbc);}['_addReviewCheckResult'](_0x32725e,_0x1ec19a){const _0x4d8c53=this['_documentData']['elements']['get'](_0x32725e);if(!_0x4d8c53)return;const _0xef8824=_0x4d8c53['getContent']();if(_0xef8824===_0x1ec19a)return;const _0x444270=new Ro({'id':_0x32725e,'contentInitial':_0xef8824,'contentNew':_0x1ec19a,'documentVersion':this['_documentData']['version']});this['_results']['set'](_0x444270['id'],_0x444270),this['fire']('reviewCheckResultAdded',{'result':_0x444270,'source':this});}['_checkIfFinished'](){'finished'===this['status']&&(this['_changes']['filter'](_0x1c92c3=>'pending'===_0x1c92c3['status'])['length']>0x0&&(this['status']='ready')),'ready'===this['status']&&(0x0===this['_changes']['filter'](_0x205a7e=>'pending'===_0x205a7e['status'])['length']&&(this['status']='finished'));}}class No extends ko{get['subTitle'](){if(!this['_reviewParams']||0x0===this['_reviewParams']['length'])return'';const _0x1029bb=[];if(this['_reviewParams']['length']>0x0&&this['_sourceCheck']['options'])for(let _0x41ee84=0x0;_0x41ee84<this['_reviewParams']['length'];_0x41ee84++){if(!this['_reviewParams'][_0x41ee84]||!this['_sourceCheck']['options'][_0x41ee84])continue;const _0x4017a1=this['_sourceCheck']['options'][_0x41ee84],_0x3ce57d=_0x4017a1['data']?.['find'](_0x36f25c=>_0x36f25c['id']===this['_reviewParams'][_0x41ee84]);_0x3ce57d&&_0x1029bb['push'](_0x3ce57d['label']);}return _0x1029bb['join'](',\x20');}get['reviewName'](){return this['_composeReviewName']();}['_createApiRequest'](){return this['_aiConnector']['callSystemReview']({'reviewName':this['_composeReviewName'](),'content':this['_documentData']['content'],'args':this['_reviewArgs']});}['_sendRatingRequest'](_0x58c6da,_0x13a54c,_0x446144){return this['_aiConnector']['upsertAIReviewRating'](this['reviewName'],_0x13a54c,_0x58c6da,_0x446144);}['_composeReviewName'](){return!this['_reviewParams']||0x0===this['_reviewParams']['length']||this['_sourceCheck']['useArgs']?this['_sourceCheck']['apiId']:[this['_sourceCheck']['apiId'],...this['_reviewParams']]['join']('-');}}class vo extends _0x3397b8{['_aiConnector'];['_aiReviewCoreUi'];['_aiReviewCoreEditing'];['_aiReviewCheckList'];['_currentReviewCheckRun'];['_changeActivationSource']=null;static get['requires'](){return[ls];}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(_0x4f63b7,_0x47e65e)=>{const _0xa66f1f=this['_aiReviewCheckList']['getCheckById'](_0x47e65e['id']);if(_0xa66f1f){this['_onReviewCheckRun'](_0x47e65e),this['_aiReviewCoreEditing']['switchToReadOnly'](),this['_currentReviewCheckRun']=this['_createReviewCheckRun'](_0x47e65e,_0xa66f1f),this['_aiReviewCoreUi']['setCheckResultTitle'](this['_currentReviewCheckRun']['title'],this['_currentReviewCheckRun']['subTitle']),this['_currentReviewCheckRun']['on']('reviewCheckRunUpdated',(_0x456e2a,_0x14c811)=>{switch(_0x14c811['status']){case'data':case'loading':this['_aiReviewCoreUi']['showCheckRunResults'](_0x14c811);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 ht('ai-review-mode-check-run-general-error',this,void 0x0,this['_currentReviewCheckRun']?.['currentError']));break;case'error-chunk':this['_aiReviewCoreUi']['showChunkErrorView'](),this['_logError'](new ht('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'!==_0x14c811['status']&&'error-chunk'!==_0x14c811['status']&&'error-general'!==_0x14c811['status']||this['_currentReviewCheckRun']?.['sendRating']();}),this['_currentReviewCheckRun']['on']('reviewCheckResultAdded',(_0x11a3de,_0x540539)=>{if(!this['_currentReviewCheckRun'])throw new ht('ai-review-mode-no-current-check-run',this);const _0x236260=this['_diffContent'](_0x540539['result']['contentInitial'],_0x540539['result']['contentNew']);_0x540539['source']['addResultChanges'](_0x540539['result']['id'],_0x236260);}),this['_currentReviewCheckRun']['on']('reviewCheckResultReady',(_0x56fa1d,_0x38ea60)=>{for(const _0x58fc30 of _0x38ea60['changes'])this['_aiReviewCoreUi']['showCheckRunResult'](_0x58fc30);this['_markChangePositionInEditorContent'](_0x38ea60['changes'],_0x38ea60['source']['documentData']);}),this['_currentReviewCheckRun']['on']('reviewCheckResultChangeStatusUpdated',(_0x29455e,_0x306b91)=>{this['_aiReviewCoreUi']['updateChangeState'](_0x306b91['change']['id'],_0x306b91['status']);}),this['_currentReviewCheckRun']['on']('reviewCheckResultActivated',(_0x3da93f,_0x33d40b)=>{this['_onReviewCheckResultActivated'](_0x33d40b);}),this['_currentReviewCheckRun']['on']('reviewCheckResultDeactivated',()=>{this['_onReviewCheckResultDeactivated']();});try{await this['_currentReviewCheckRun']['start']();}catch(_0x3d4a86){_0x3d4a86 instanceof Error&&_0x3d4a86['message']['includes']('ai-request-aborted')||(_0x3d4a86 instanceof ht?this['_logError'](_0x3d4a86):this['_logError'](new ht('ai-review-mode-check-run-failed',this,void 0x0,_0x3d4a86)));}}else this['_logError'](new ht('ai-review-mode-source-check-not-found',this,{'checkId':_0x47e65e['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 _0x8a271a=this['_currentReviewCheckRun']['getActiveChanges']();if(!_0x8a271a['length'])return;this['_aiReviewCoreEditing']['applyChange'](_0x8a271a['map'](_0x43db8a=>_0x43db8a['id']));const _0x4274ce=this['_currentReviewCheckRun'];_0x4274ce['markAllChangesAsAccepted'](),_0x4274ce['sendRating']();}),this['listenTo'](this['_aiReviewCoreUi'],'acceptChange',(_0x4842fd,_0x27c27a)=>{this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['isChangeActive'](_0x27c27a['id'])&&(this['_aiReviewCoreEditing']['applyChange']([_0x27c27a['id']]),this['_currentReviewCheckRun']['markChangeAsAccepted'](_0x27c27a['id']),this['_aiReviewCoreUi']['hideChangeBalloon'](),this['_currentReviewCheckRun']['sendRating'](_0x27c27a['id']));}),this['listenTo'](this['_aiReviewCoreUi'],'dismissChange',(_0x34e1c1,_0x1ff53e)=>{this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['isChangeActive'](_0x1ff53e['id'])&&(this['_aiReviewCoreEditing']['rejectChange'](_0x1ff53e['id']),this['_currentReviewCheckRun']['markChangeAsRejected'](_0x1ff53e['id']),this['_aiReviewCoreUi']['hideChangeBalloon'](),this['_currentReviewCheckRun']['sendRating'](_0x1ff53e['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',(_0x193a31,_0x26111a)=>{this['_onActivateChange'](_0x26111a);}),this['listenTo'](this['_aiReviewCoreUi'],'deactivateChange',(_0x3a55ce,_0xbfa976)=>{this['_onDeactivateChange'](_0xbfa976);}),this['listenTo'](this['_aiReviewCoreEditing']['emitter'],'changeMarkerClicked',(_0x1c0ade,_0x1abaf2)=>{this['_onChangeMarkerClicked'](_0x1c0ade,_0x1abaf2);}),this['listenTo'](this['_aiReviewCoreEditing']['emitter'],'changeMarkerHovered',(_0x198aa7,_0x3212a6)=>{this['_onChangeMarkerHovered'](_0x198aa7,_0x3212a6);}),this['listenTo'](this['_aiReviewCoreEditing']['emitter'],'changeMarkerBlurred',()=>{this['_onChangeMarkerBlurred']();}),this['listenTo'](this['_aiReviewCoreEditing']['emitter'],'changeMarkerRemoved',(_0x5d60a4,_0x952af)=>{this['_onChangeMarkerRemoved'](_0x5d60a4,_0x952af);}),this['listenTo'](this['_aiReviewCoreEditing']['emitter'],'changeMarkerRestored',(_0x499b9e,_0x1aa693)=>{this['_onChangeMarkerRestored'](_0x499b9e,_0x1aa693);});}['_createReviewCheckRun'](_0xf9e7d3,_0xf8de58){return new No(this['_aiReviewCoreEditing']['getDocumentData'](),_0xf8de58,this['_aiConnector'],_0xf9e7d3['params'],_0xf9e7d3['args']);}['_onChangeMarkerRemoved'](_0x1103a3,_0x5ba63b){this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['markChangeAsOutdated'](_0x5ba63b['changeId']);}['_onChangeMarkerRestored'](_0x1b3c1a,_0x27b97e){this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['markChangeAsPending'](_0x27b97e['changeId']);}['_onCheckRunFinished'](){this['_aiReviewCoreUi']['showReviewCompletedView']();}['_initRequiredPlugins'](){this['_aiConnector']=this['context']['plugins']['get']('AIConnector');}['_onReviewRunLeave'](_0x692dc0=!0x1){this['_currentReviewCheckRun']&&(this['_currentReviewCheckRun']['hasModifications']||this['_currentReviewCheckRun']['sendRating'](),this['_currentReviewCheckRun']['stopListening'](),this['_currentReviewCheckRun']['abort'](),this['_currentReviewCheckRun']=void 0x0),_0x692dc0&&this['_aiReviewCoreUi']['showReviewCheckList'](),this['_aiReviewCoreEditing']['clearAllMarkers'](),this['_aiReviewCoreEditing']['switchToEdit'](),this['_changeActivationSource']=null;const _0x85df24=this['_aiReviewCoreEditing']['getEditor']();_0x85df24&&_0x85df24['editing']['view']['change'](_0x3a9a47=>{const _0xc4baca=_0x85df24['editing']['view']['document']['getRoot']();_0x3a9a47['removeClass']('ck-ai_review-diff',_0xc4baca),_0x3a9a47['removeClass']('ck-ai_review-highlights',_0xc4baca),_0x3a9a47['removeClass']('ck-ai-translate-mode-content',_0xc4baca);});}['_getTranslationWithDefault'](_0x1f9c9d,_0x39c3e0){const _0x7648a9=us(this['context']['locale'],_0x1f9c9d);return _0x7648a9===_0x1f9c9d?_0x39c3e0:_0x7648a9;}['_logError'](_0x534a91,_0x41aceb=!0x1){mt(_0x534a91['message']),_0x41aceb||(_0x534a91['message']['startsWith']('ai-review-mode-models-unable-to-retrieve')?this['_aiReviewCoreUi']['showGeneralReviewCoreErrorView']():this['_aiReviewCoreUi']['showGeneralResultsErrorView']());}['_scrollToChange'](_0x2a507a){if('content'===this['_changeActivationSource']){const _0x23c928=this['_aiReviewCoreUi']['getChangeElement'](_0x2a507a);_0x23c928&&ft(_0x23c928['closest']('.ck-ai_review__check-run-result')||_0x23c928);}else{if('panel'===this['_changeActivationSource']){const _0x396cc3=this['_getChangeContentElement'](_0x2a507a);if(!_0x396cc3)return;Ct({'target':_0x396cc3,'viewportOffset':{'top':0x55,'left':0x0,'bottom':0x0,'right':0x0},'ancestorOffset':0x14,'alignToTop':!0x0});}}}}const yo=[{'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 xo{['id'];['commandId'];['title'];['description'];['isParameterized'];['useArgs'];['options'];['args'];get['apiId'](){return this['commandId'];}constructor(_0x4534d6){this['id']=_0x4534d6['id'],this['commandId']=_0x4534d6['commandId'],this['title']=_0x4534d6['title'],this['description']=_0x4534d6['description'],this['isParameterized']=_0x4534d6['isParameterized'],this['useArgs']=_0x4534d6['useArgs'],this['options']=_0x4534d6['options'],this['args']=_0x4534d6['args'];}}class Lo extends ct(){['_checks']=[];['setupChecks'](_0x2df7b3){this['_checks']=_0x2df7b3['map'](_0x5b4803=>new xo(_0x5b4803));}get['checks'](){return this['_checks'];}['getCheckById'](_0x2e68c0){return this['checks']['find'](_0x561665=>_0x561665['id']===_0x2e68c0);}['removeCheckById'](_0x75fec0){this['_checks']=this['_checks']['filter'](_0x372e45=>_0x372e45['id']!==_0x75fec0);}}class Do extends xo{['_models']=[];['_defaultModel']=null;constructor(_0x15a116,_0x2506dc,_0x3fe28e){super(_0x15a116),this['_models']=_0x2506dc,this['_defaultModel']=_0x3fe28e;}get['models'](){return this['_models'];}get['defaultModel'](){return this['_defaultModel'];}}class Po extends xo{['isExtra']=!0x0;['prompt'];['model'];['_defaultModel']=null;constructor(_0x2c8b76,_0x10cd70,_0x384385){super(_0x2c8b76),this['prompt']=_0x2c8b76['prompt'],this['model']=_0x2c8b76['model'],this['model']?this['_defaultModel']=_0x10cd70['find'](_0x25c3bc=>_0x25c3bc['id']===this['model'])||null:this['_defaultModel']=_0x384385;}get['defaultModel'](){return this['_defaultModel'];}}class Ho extends Lo{['_allModels']=[];['_recommendedModels']=[];['_defaultModel']=null;constructor(_0x402620,_0x5af4d5,_0x236e5f){super(),this['_allModels']=_0x402620,this['_recommendedModels']=_0x5af4d5,this['_defaultModel']=_0x236e5f;}['setupChecks'](_0x47967a){this['_checks']=_0x47967a['map'](_0x2a9716=>!0x0===_0x2a9716['isExtra']?new Po(_0x2a9716,this['_allModels'],this['_defaultModel']):'custom'===_0x2a9716['id']?new Do(_0x2a9716,this['_recommendedModels'],this['_defaultModel']):new xo(_0x2a9716));}}class Mo extends ko{['_prompt'];['_model'];constructor(_0x151336,_0x4c1bec,_0x4c3d46,_0x494e0c,_0x457b13){super(_0x4c3d46,_0x494e0c,_0x457b13),this['_prompt']=_0x151336,this['_model']=_0x4c1bec;}get['subTitle'](){return this['_prompt'];}['_createApiRequest'](){return this['_aiConnector']['callCustomReview']({'content':this['_documentData']['content'],'prompt':this['_prompt'],'model':this['_model']});}['_sendRatingRequest'](_0x2b41be,_0xf87299,_0x4572fa){return this['_aiConnector']['upsertCustomAIReviewRating'](_0xf87299,_0x2b41be,_0x4572fa);}}class Uo extends Mo{get['subTitle'](){return'';}set['prompt'](_0x430fa6){this['_prompt']=_0x430fa6;}set['model'](_0x101794){this['_model']=_0x101794;}}class Vo extends vo{static get['pluginName'](){return'AIReviewModeController';}['_isDiffOn']=!0x1;['_hasDefaultAvailableCommands']=!0x1;constructor(_0x3b44ab){super(_0x3b44ab),this['_hasDefaultAvailableCommands']=!this['context']['config']['get']('ai.review.availableCommands'),this['context']['config']['define']('ai.review.availableCommands',yo['map'](_0x400711=>_0x400711['id'])),this['context']['config']['define']('ai.review.extraCommands',[]);}async['init'](){await super['init'](),this['listenTo'](this['_aiReviewCoreUi'],'toggleDiff',(_0x58cbf6,_0x186bda)=>{this['_isDiffOn']=_0x186bda['on'],this['_onDiffChange'](this['_isDiffOn']);});}['_initRequiredPlugins'](){super['_initRequiredPlugins'](),this['_aiReviewCoreUi']=this['context']['plugins']['get']('AIReviewModeUI'),this['_aiReviewCoreEditing']=this['context']['plugins']['get']('AIReviewCoreEditing');}['_createReviewCheckRun'](_0x36b4a0,_0xa7f6f6){return _0x36b4a0['isCustom']?new Mo(_0x36b4a0['args']['prompt'],_0x36b4a0['args']['model'],this['_aiReviewCoreEditing']['getDocumentData'](),_0xa7f6f6,this['_aiConnector']):_0xa7f6f6['isExtra']?new Uo(_0xa7f6f6['prompt'],_0xa7f6f6['defaultModel']['id'],this['_aiReviewCoreEditing']['getDocumentData'](),_0xa7f6f6,this['_aiConnector']):new No(this['_aiReviewCoreEditing']['getDocumentData'](),_0xa7f6f6,this['_aiConnector'],_0x36b4a0['params'],_0x36b4a0['args']);}['_onReviewCheckResultActivated'](_0x271e02){this['_aiReviewCoreUi']['setActiveStateInResults'](_0x271e02['change']['id']),this['_scrollToChange'](_0x271e02['change']['id']);const _0x482f82=this['_aiReviewCoreEditing']['getMarkerElementForChange'](_0x271e02['change']['id']);if(!_0x482f82)return;const _0x498245=this['_aiReviewCoreEditing']['getEditor']();this['_aiReviewCoreUi']['showChangeBalloon'](_0x271e02['change'],()=>_0x482f82['getElement'](),void 0x0,'click',_0x498245?.['editing']?.['view']?.['getDomRoot'](),_0x498245?.['ui']?.['viewportOffset']),this['_aiReviewCoreEditing']['setMarkersInElementAsActive'](_0x271e02['change']['id']);}['_onReviewCheckResultDeactivated'](){this['_aiReviewCoreUi']['resetActiveStateInResults'](),this['_aiReviewCoreUi']['hideChangeBalloon'](),this['_aiReviewCoreEditing']['setAllMarkersAsInactive']();}['_onActivateChange'](_0x3b62ea){this['_currentReviewCheckRun']&&'click'===_0x3b62ea['uiInteraction']&&(this['_changeActivationSource']='panel',this['_currentReviewCheckRun']['activateChange'](_0x3b62ea['id']));}['_onDeactivateChange'](_0x29a36d){this['_currentReviewCheckRun']&&'balloon'===_0x29a36d['origin']&&this['_currentReviewCheckRun']['deactivateChange']();}['_onChangeMarkerClicked'](_0x14e303,_0x531c7d){if(!this['_currentReviewCheckRun'])return;this['_changeActivationSource']='content',this['_currentReviewCheckRun']['activateChange'](_0x531c7d['changeId']);const _0x126637=this['_currentReviewCheckRun']['getChangeById'](_0x531c7d['changeId']);if(!_0x126637)return;const _0x4be101=this['_aiReviewCoreEditing']['getEditor']();this['_aiReviewCoreUi']['showChangeBalloon'](_0x126637,_0x531c7d['markerElement'],_0x531c7d['domEvent'],'click',_0x4be101?.['editing']?.['view']?.['getDomRoot'](),_0x4be101?.['ui']?.['viewportOffset']);}['_onChangeMarkerHovered'](_0x35deda,_0x1e0946){if(!this['_currentReviewCheckRun'])return;if(this['_currentReviewCheckRun']['isAnyChangeActivated']())return;const _0x4092b3=this['_currentReviewCheckRun']['getChangeById'](_0x1e0946['changeId']);if(!_0x4092b3)return;const _0x497c56=this['_aiReviewCoreEditing']['getEditor']();this['_aiReviewCoreUi']['showChangeBalloon'](_0x4092b3,_0x1e0946['markerElement'],_0x1e0946['domEvent'],'hover',_0x497c56?.['editing']?.['view']?.['getDomRoot'](),_0x497c56?.['ui']?.['viewportOffset']);}['_onChangeMarkerBlurred'](){if(!this['_currentReviewCheckRun'])return;this['_currentReviewCheckRun']['isAnyChangeActivated']()||this['_aiReviewCoreUi']['hideChangeBalloon']();}['_getChangeContentElement'](_0x46f72a){const _0x496036=this['_aiReviewCoreEditing']['getMarkerElementForChange'](_0x46f72a);return _0x496036?_0x496036['getElement']():null;}['_markChangePositionInEditorContent'](_0xd3b2b6,_0xdb3818){this['_aiReviewCoreEditing']['markChangePositionInEditorContent'](_0xd3b2b6,_0xdb3818);}['_diffContent'](_0x4c259f,_0x3c5413){return this['_aiReviewCoreEditing']['diffContent'](_0x4c259f,_0x3c5413);}['_onReviewCheckRun'](){this['_onDiffChange'](this['_isDiffOn']);}['_onDiffChange'](_0x160f8f){const _0x140454=this['_aiReviewCoreEditing']['getEditor']();_0x160f8f?this['_aiReviewCoreUi']['hideDiffInBalloon']():this['_aiReviewCoreUi']['showDiffInBalloon'](),_0x140454&&_0x140454['editing']['view']['change'](_0x263c33=>{const _0x36a6a4=_0x140454['editing']['view']['document']['getRoot']();for(const _0x1eba61 of _0x36a6a4['getClassNames']())_0x1eba61['startsWith']('ck-ai_review-')&&_0x263c33['removeClass'](_0x1eba61,_0x36a6a4);_0x263c33['addClass'](_0x160f8f?'ck-ai_review-diff':'ck-ai_review-highlights',_0x36a6a4);});}async['_getChecksList'](){const _0x407bc8=[...yo,...this['_getExtraChecks']()],_0x486d0d=this['context']['config']['get']('ai.review.availableCommands')||[];this['_logErrorForNonExistentChecks'](_0x486d0d,_0x407bc8);let _0x242193=_0x407bc8;this['_hasDefaultAvailableCommands']||(_0x242193=_0x486d0d['map'](_0x18026e=>_0x407bc8['find'](_0x6953f5=>_0x6953f5['id']===_0x18026e))['filter'](_0x15e244=>!!_0x15e244)),_0x242193=_0x242193['map'](_0x50eaac=>_0x50eaac['isExtra']?_0x50eaac:this['_translateReviewCheck'](_0x50eaac));const _0x5a660b=_0x242193['some'](_0x39c2a4=>_0x39c2a4['isExtra']||'custom'===_0x39c2a4['id']);let _0x5ea340=[],_0x2d1cf8=[],_0x5d8784=null;if(_0x5a660b){const _0x370674=await this['_getModels']();_0x5ea340=_0x370674['all'],_0x2d1cf8=_0x370674['recommended'],_0x5d8784=_0x370674['default'];}const _0x290190=new Ho(_0x5ea340,_0x2d1cf8,_0x5d8784);return _0x290190['setupChecks'](_0x242193),_0x5a660b&&this['_filterChecksWithMissingModel'](_0x290190),_0x290190;}['_getExtraChecks'](){return(this['context']['config']['get']('ai.review.extraCommands')||[])['map'](_0x20a46a=>({'id':_0x20a46a['id'],'commandId':_0x20a46a['id'],'title':_0x20a46a['label'],'description':_0x20a46a['description'],'isParameterized':!0x1,'isExtra':!0x0,'prompt':_0x20a46a['prompt'],'model':_0x20a46a['model']}));}['_logErrorForNonExistentChecks'](_0x2aad2e,_0x4e3dc9){const _0xb22f89=_0x2aad2e['filter'](_0x17b7e3=>!_0x4e3dc9['some'](_0x215ca3=>_0x215ca3['id']===_0x17b7e3));_0xb22f89['length']&&this['_logError'](new ht('ai-review-mode-non-existent-commands-used',this,{'commandIds':_0xb22f89['join'](',\x20')}),!0x0);}async['_getModels'](){try{const _0x278b75=new qs({'connector':this['_aiConnector'],'config':this['context']['config']['get']('ai.models'),'locale':this['context']['locale']});return{'all':await _0x278b75['getAll'](),'recommended':await _0x278b75['getAvailableModels'](),'default':await _0x278b75['getDefault']()};}catch(_0x3c14ec){return this['_logError'](new ht('ai-review-mode-models-unable-to-retrieve',this,void 0x0,_0x3c14ec)),{'all':[],'recommended':[],'default':null};}}['_translateReviewCheck'](_0x97c6fb){const _0x18772a='AI_REVIEW_CHECK_'+_0x97c6fb['id']['toUpperCase']()['replaceAll']('-','_'),_0x47e22a={..._0x97c6fb,'title':this['_getTranslationWithDefault'](_0x18772a+'_TITLE',_0x97c6fb['title']),'description':this['_getTranslationWithDefault'](_0x18772a+'_DESCRIPTION',_0x97c6fb['description'])};return _0x97c6fb['options']&&(_0x47e22a['options']=_0x97c6fb['options']['map'](_0x5798fc=>({..._0x5798fc,'label':this['_getTranslationWithDefault'](_0x18772a+'_OPTIONS_LABEL',_0x5798fc['label']||''),'data':_0x5798fc['data']?_0x5798fc['data']['map'](_0x498e64=>({..._0x498e64,'label':this['_getTranslationWithDefault'](_0x18772a+'_OPTIONS_DATA_'+_0x498e64['id']['toUpperCase'](),_0x498e64['label'])})):void 0x0}))),_0x47e22a;}['_filterChecksWithMissingModel'](_0x149f24){const _0x2396b6=[];_0x149f24['checks']['forEach'](_0x3f758b=>{(_0x3f758b instanceof Po&&!_0x3f758b['defaultModel']||_0x3f758b instanceof Do&&!_0x3f758b['models']['length'])&&_0x2396b6['push'](_0x3f758b['id']);}),_0x2396b6['length']&&_0x2396b6['forEach'](_0x54c6c5=>{_0x149f24['removeCheckById'](_0x54c6c5),this['_logError'](new ht('ai-review-mode-command-unavailable-due-to-missing-model',this,{'commandId':_0x54c6c5}),!0x0);});}}class Bo extends _0x3397b8{static get['requires'](){return[Vo,fo,bo];}static get['pluginName'](){return'AIReviewMode';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}class Go extends xo{get['apiId'](){return'translate';}}class Fo extends Lo{['setupChecks'](_0x137b51){this['_checks']=_0x137b51['map'](_0x2233d7=>new Go(_0x2233d7));}}class Ko extends No{['_title'];constructor(_0x106f36,_0xc19f59,_0x12480f,_0x39b0a3,_0x1417fc,_0x31b7ec){super(_0x106f36,_0xc19f59,_0x12480f,_0x1417fc,_0x31b7ec),this['_title']=_0x39b0a3;}get['title'](){return this['_title'];}get['subTitle'](){return this['_sourceCheck']['title'];}}class Wo extends vo{static get['pluginName'](){return'AITranslateController';}constructor(_0x4ca217){super(_0x4ca217),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'](_0x32bd87,_0x5c799a){return new Ko(this['_aiReviewCoreEditing']['getDocumentData'](),_0x5c799a,this['_aiConnector'],us(this['context']['locale'],'AI_REVIEW_CHECK_TRANSLATE_TITLE'),_0x32bd87['params'],_0x32bd87['args']);}['_onReviewCheckResultActivated'](_0x5a4f59){this['_aiReviewCoreUi']['setActiveStateInResults'](_0x5a4f59['change']['id']),this['_aiReviewCoreEditing']['setMarkersInElementAsActive'](_0x5a4f59['change']['id']);}['_onReviewCheckResultDeactivated'](){this['_aiReviewCoreEditing']['setAllMarkersAsInactive'](),this['_aiReviewCoreUi']['resetActiveStateInResults']();}['_onActivateChange'](_0xf5795){this['_currentReviewCheckRun']&&('hover'===_0xf5795['uiInteraction']&&(this['_changeActivationSource']='panel',this['_currentReviewCheckRun']['activateChange'](_0xf5795['id'])),'click'===_0xf5795['uiInteraction']&&this['_scrollToChange'](_0xf5795['id']));}['_onDeactivateChange'](_0x5ba619){this['_currentReviewCheckRun']&&'panel'===_0x5ba619['origin']&&this['_currentReviewCheckRun']['deactivateChange']();}['_onChangeMarkerClicked'](_0x58210b,_0x230282){this['_currentReviewCheckRun']&&(this['_changeActivationSource']='content',this['_currentReviewCheckRun']['activateChange'](_0x230282['changeId']),this['_scrollToChange'](_0x230282['changeId']));}['_onChangeMarkerHovered'](_0x22d07a,_0x126861){this['_currentReviewCheckRun']&&(this['_changeActivationSource']='content',this['_currentReviewCheckRun']['activateChange'](_0x126861['changeId']),this['_aiReviewCoreEditing']['reactivateMarkers'](_0x126861['changeId']));}['_onChangeMarkerBlurred'](){this['_currentReviewCheckRun']&&'content'===this['_changeActivationSource']&&(this['_currentReviewCheckRun']['deactivateChange'](),this['_aiReviewCoreEditing']['setAllMarkersAsInactive']());}['_getChangeContentElement'](_0x3dcab9){return this['_aiReviewCoreEditing']['getContentElementForChange'](_0x3dcab9);}['_markChangePositionInEditorContent'](_0x2037e7,_0x4862f4){this['_aiReviewCoreEditing']['markChangePositionInEditorContent'](_0x2037e7,_0x4862f4);}['_diffContent'](_0xebdcb6,_0x4fda3d){return this['_aiReviewCoreEditing']['diffContent'](_0xebdcb6,_0x4fda3d,!0x0);}['_onReviewCheckRun'](){const _0x3739a0=this['_aiReviewCoreEditing']['getEditor']();_0x3739a0&&_0x3739a0['editing']['view']['change'](_0xfc330b=>{const _0x543785=_0x3739a0['editing']['view']['document']['getRoot']();for(const _0x531dd4 of _0x543785['getClassNames']())(_0x531dd4['startsWith']('ck-ai-review-')||'ck-ai-translate-'===_0x531dd4)&&_0xfc330b['removeClass'](_0x531dd4,_0x543785);_0xfc330b['addClass']('ck-ai-translate-mode-content',_0x543785);});}async['_getChecksList'](){const _0x252019=[],_0x4a4c25=this['context']['config']['get']('ai.translate.languages')||[];for(const _0x13db41 of _0x4a4c25)_0x252019['push']({'title':_0x13db41['label'],'id':_0x13db41['id'],'commandId':_0x13db41['id'],'description':'','isParameterized':!0x1,'useArgs':!0x0,'args':{'language':_0x13db41['id']}});const _0x3d6924=new Fo();return _0x3d6924['setupChecks'](this['_translateChecks'](_0x252019)),_0x3d6924;}['_translateChecks'](_0x3a148d){return _0x3a148d['map'](_0x225258=>{const _0x592fdd='AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_'+_0x225258['title']['toUpperCase']()['replaceAll']('-','_');return{..._0x225258,'title':this['_getTranslationWithDefault'](_0x592fdd,_0x225258['title'])};});}}class Yo extends _o{constructor(_0x1e2284,_0x33fb6d){super(_0x1e2284,_0x33fb6d),this['on']('set:isLoading',(_0xe563ce,_0x5de1bf,_0x5c1518)=>{_0x5c1518&&(this['headerTitle']=us(this['locale'],'AI_TRANSLATE_CHECK_RESULTS_LOADING_TITLE'));}),this['on']('set:isResultReady',(_0x192e79,_0x54ba92,_0x25d3c6)=>{_0x25d3c6&&(this['headerTitle']=us(this['locale'],'AI_TRANSLATE_CHECK_RESULTS_READY_TITLE'));});}['_createAcceptAllButtonView'](){const _0x34b188=super['_createAcceptAllButtonView']();return _0x34b188['set']('label',us(this['locale'],'AI_TRANSLATE_ACCEPT_ALL')),_0x34b188;}['_createExitReviewButtonView'](){const _0xd02799=super['_createExitReviewButtonView']();return _0xd02799['set']('label',us(this['locale'],'AI_CHAT_HISTORY_CANCEL')),_0xd02799;}}class $o extends wo{['_setupTemplate'](){const _0x4ba9ba=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-translate__check-list-wrapper',_0x4ba9ba['if']('isVisible','ck-hidden',_0x1ce6e0=>!_0x1ce6e0)]},'children':[{'tag':'div','attributes':{'class':['ck-ai-translate__check-list-header']},'children':[{'tag':'h2','children':[{'text':us(this['locale'],'AI_TRANSLATE_CHECK_LIST_HEADER_TITLE')}]},{'tag':'p','children':[{'text':us(this['locale'],'AI_TRANSLATE_CHECK_LIST_HEADER_DESCRIPTION')}]}]},{'tag':'div','attributes':{'class':['ck-ai_review__check-list',_0x4ba9ba['if']('isVisible','ck-hidden',_0x3cc688=>!_0x3cc688)]},'children':this['_checkViews']}]});}}class qo extends ho{static get['pluginName'](){return'AITranslateUI';}['createMainView'](){const _0x1aa8b3=this['context']['locale'],_0x4705cb=new _0x3e3394(_0x1aa8b3,{'label':us(_0x1aa8b3,'AI_REVIEW_CHECK_TRANSLATE_TITLE'),'icon':_0x24ec53,'class':'ck-ai-header\x20ck-ai-header_review-translate'}),_0x1a6b06=new lo(_0x1aa8b3,{'header':_0x4705cb,'list':new $o(_0x1aa8b3),'results':new Yo(_0x1aa8b3,{'generalErrorText':us(_0x1aa8b3,'AI_TRANSLATE_GENERAL_ERROR_MESSAGE')}),'completed':new Ao(_0x1aa8b3,{'headerText':us(_0x1aa8b3,'AI_TRANSLATE_FINISH_HEADER_TITLE'),'emptyResultsText':us(_0x1aa8b3,'AI_TRANSLATE_EMPTY_RESULTS_TEXT'),'buttonText':us(_0x1aa8b3,'AI_TRANSLATE_FINISH_BUTTON_LABEL')})});return _0x1a6b06['extendTemplate']({'attributes':{'class':'ck-ai-translate-mode'}}),_0x1a6b06;}['registerTab'](){const _0x5b00c6=this['context']['plugins']['get']('AITabs');_0x5b00c6['view']['on']('activateTab',(_0x3536aa,_0x34e650)=>{'translate'===_0x34e650?this['fire']('getReviewCheckList'):this['fire']('leaveReview');}),_0x5b00c6['view']['addTab']({'id':'translate','buttonLabel':us(this['context']['locale'],'AI_REVIEW_CHECK_TRANSLATE_TITLE'),'buttonIcon':_0x24ec53,'order':0x0,'content':this['_mainView']});}}class Qo extends _0x3397b8{static get['requires'](){return[Wo,qo,bo];}static get['pluginName'](){return'AITranslate';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}export{eo as AIActions,io as AIActionsNames,Ni as AIAdapter,Ji as AIAssistant,Xi as AIAssistantUI,ka as AIBalloon,Ea as AIChat,Js as AIChatController,Ia as AIChatHistory,ga as AIChatHistoryController,da as AIChatHistoryUI,wa as AIChatShortcuts,aa as AIChatUI,ls as AIConnector,tn as AIEditing,La as AIEditorIntegration,no as AIQuickActionType,so as AIQuickActions,Ya as AIQuickActionsUI,vi as AIRequestError,xo as AIReviewCheck,Ro as AIReviewCheckResult,ko as AIReviewCheckRun,Bo as AIReviewMode,vo as AIReviewModeController,bo as AIReviewModeEditing,fo as AIReviewModeUI,cs as AITabs,ts as AITextAdapter,Sa as AIToggleButtonUI,Qo as AITranslate,Wo as AITranslateController,qo as AITranslateUI,is as AWSTextAdapter,es as OpenAITextAdapter,xi as ShowAIAssistantCommand,fa as ToggleAICommand,gs as createResizeButton,Zi as getDefaultAICommands};
|
|
23
|
+
import{Plugin as _0x4210c9,Command as _0x1296c1,ContextPlugin as _0x31818a,Editor as _0x25289c}from'@ckeditor/ckeditor5-core/dist/index.js';import{IconCopy as _0x12c29b,IconCheck as _0x177f85,IconError as _0x30ee79,IconSubmit as _0x56b34f,IconAIHistory as _0xe68f34,IconMagicWand as _0x3d12d0,IconRobotPencil as _0x2d49ff,IconMaximize as _0x39ec7a,IconMinimize as _0x3e0dad,IconShowChangesOn as _0x5e73e2,IconShowChangesOff as _0xacb23c,IconDocument as _0x29737e,IconBoxWithCross as _0x2dfefc,IconBoxWithCheck as _0x59e1e6,IconBoxWithMarker as _0x37d56e,IconInfo as _0x411b77,IconWeb as _0xbe0d02,IconCancel as _0x40d9e4,IconSelection as _0x2d2ae4,IconFileUpload as _0x5b9fd7,IconLink as _0x32f27e,IconBulb as _0x1bff55,IconAI as _0x34d184,IconPreviousArrow as _0x3edf4c,IconDocumentOutline as _0x5952ea,IconLoupe as _0x44e30b,IconPaperClip as _0x1da30d,IconBrowseFiles as _0x105c99,IconDropdownArrow as _0x3c1855,IconStop as _0x2ffb29,IconAIChat as _0x353b1b,IconPlus as _0x20b289,IconPin as _0x2467ba,IconThreeHorizontalDots as _0xf04a61,IconAIReview as _0x58f833,IconAITranslate as _0x4d6fdb,IconAIAskAI as _0x314fa8,IconThumbUp as _0x264ec0,IconThumbDown as _0x85ec1e,IconChevronDown as _0x3f0499,IconChevronUp as _0x23f2f3,IconAIQuickActions as _0x39f4a5,IconAIChatCommands as _0x598ed8,IconAIImproveWriting as _0x134ca9,IconAIContinueWriting as _0x3344fe,IconAIGrammarCheck as _0x59e7d5,IconAIAdjustLength as _0x2f582d,IconAIChangeTone as _0x196a17,IconAIOther as _0x4a7a5a,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 at,CKEditorError as ot,ObservableMixin as ht,global as ct,isVisible as lt,Rect as ut,Collection as dt,FocusTracker as _t,KeystrokeHandler as At,first as gt,toArray as It,EmitterMixin as Et,logWarning as pt,logError as Tt,scrollViewportToShowTarget as mt,insertToPriorityArray as Ct,scrollAncestorsToShowTarget as wt,ResizeObserver as ft,_isMotionReduced as St,getConstrainedViewportRect as bt,DomEmitterMixin as Rt}from'@ckeditor/ckeditor5-utils/dist/index.js';import{ToolbarView as Ot,ButtonView as kt,View as Nt,SpinnerView as vt,IconView as yt,AutocompleteView as xt,ListView as Lt,ListItemGroupView as Dt,ListItemView as Pt,ButtonLabelView as Ht,FocusCycler as Mt,createLabeledTextarea as Ut,Dialog as Vt,createDropdown as Bt,addMenuToDropdown as Gt,MenuBarMenuView as Ft,MenuBarMenuListItemButtonView as Kt,DialogViewPosition as Wt,MenuBarMenuListView as Yt,MenuBarMenuListItemView as $t,BodyCollection as qt,BalloonPanelView as Qt,clickOutsideHandler as Xt,addListToDropdown as zt,UIModel as jt,submitHandler as Jt,LabeledFieldView as Zt,createLabeledInputText as te,FormHeaderView as _0x52d3ea,HighlightedTextView as _0x16beb0,ViewCollection as _0x24b273,FileDialogButtonView as _0x44b73a,InputTextView as _0x1e6483,SearchTextView as _0x4a6391,ListItemButtonView as _0x5ea5ba,ButtonLabelWithHighlightView as _0x5288db,DropdownMenuPanelPositioningFunctions as _0x32ec52,BalloonToolbar as _0x379bab,FormRowView as _0x5c545c,TextareaView as _0x308b78}from'@ckeditor/ckeditor5-ui/dist/index.js';import{ClipboardPipeline as _0xbd8bd7,ClipboardMarkersUtils as _0xb18b54}from'@ckeditor/ckeditor5-clipboard/dist/index.js';import{ViewDocumentDomEventData as _0x17def6,ViewDataTransfer as _0x4e2945,ViewUpcastWriter as _0x24e25e,Matcher as _0x171f7d,_DetachOperation as _0x5d2b40,_insertIntoModelNodeList as _0x4a0dd7,_removeFromModelNodeList as _0x1cd220,ModelRange as _0x132eb5,transformOperationSets as _0x256a0e,ViewDowncastWriter as _0x57cd91,ModelDocumentFragment as _0x8bbd24,ModelPosition as _0x17c5ae,ModelTreeWalker as _0x58c78b,MarkerOperation as _0x111ba1,InsertOperation as _0x33642}from'@ckeditor/ckeditor5-engine/dist/index.js';import{unescape as _0x29752a,escape as _0x5b8af7,cloneDeep as _0x37806b,escapeRegExp as _0x29a81f,debounce as _0x17280a}from'es-toolkit/compat';import{BedrockRuntimeClient as _0x47ddb2,InvokeModelWithResponseStreamCommand as _0x4220bd,InvokeModelCommand as _0x4b6602}from'@aws-sdk/client-bedrock-runtime';import{createParser as _0x4cd3e5}from'eventsource-parser';import{CloudServices as _0x26c361}from'@ckeditor/ckeditor5-cloud-services/dist/index.js';import{parseDocument as _0x23c6b9}from'htmlparser2';import{isTag as _0x3003c8,findOne as _0x661d7,getParent as _0x16611c,findAll as _0x5e6828,removeElement as _0x9eae66,replaceElement as _0x4cd04e,prepend as _0xe19e73,prependChild as _0x36b9f0,appendChild as _0x2e33db,append as _0x2fe3a2,find as _0x26bbac,isComment as _0x459db9,getChildren as _0x2ac150,textContent as ti}from'domutils';import _0x345257 from'dom-serializer';import{Document as _0x539efd,Element as _0x507e32,Text as _0x28eb0b,cloneNode as _0x1753f2,isDocument as _0x1a12ea,isText as _0x2d8928,NodeWithChildren as _0x3de140}from'domhandler';import{MarkdownGfmMdToHtmlDefaultPlugins as _0x6384fa,MarkdownGfmMdToHtml as _0x4390d4}from'@ckeditor/ckeditor5-markdown-gfm/dist/index.js';import _0x5a1661 from'rehype-sanitize';import{fixElementSuggestionRange as _0x47b395,DocumentCompare as _0x55bfdc,DATA_ID_MODEL_ATTRIBUTE as _0x222570,ConfirmMixin as _0x16c245,getAllMarkersDomElementsSorted as _0x592957,SuggestionsConversion as _0x4df9ab,DATA_ID_VIEW_ATTRIBUTE as _0x163c4c,getMarkerDomElement as _0x1973f5}from'@ckeditor/ckeditor5-collaboration-core/dist/index.js';import _0x51d6f8 from'morphdom';import{diffArrays as _0x2077a5}from'diff';const wi='_ungrouppedCommands';function fi(_0x1fee38,_0x252643){const _0x26dd35=(0x0,_0x252643['t'])('Other');return _0x1fee38['length']?'groupId'in _0x1fee38[0x0]?_0x1fee38:[{'groupId':wi,'groupLabel':_0x26dd35,'order':0x1/0x0,'commands':_0x1fee38}]:[{'groupId':wi,'groupLabel':_0x26dd35,'order':0x1/0x0,'commands':[]}];}const Si=globalThis['DataTransfer'],bi='ai-ui';class Ri extends _0x4210c9{static get['pluginName'](){return'AIAssistantEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const {editor:_0x4c0e67}=this,_0x27bcbb=['ck-fake-ai-selection'];_0x4c0e67['config']['get']('ai.assistant.useTheme')&&_0x27bcbb['push']('ck-ai-assistant-ui_theme'),_0x4c0e67['conversion']['for']('editingDowncast')['markerToHighlight']({'model':bi,'view':{'classes':_0x27bcbb,'priority':0xc}}),_0x4c0e67['conversion']['for']('editingDowncast')['markerToElement']({'model':bi,'view':(_0x18cb72,{writer:_0x25a6fd})=>{if(!_0x18cb72['markerRange']['isCollapsed'])return null;const _0x1be541=_0x25a6fd['createUIElement']('span');return _0x25a6fd['addClass'](['ck-fake-ai-selection','ck-fake-ai-selection_collapsed'],_0x1be541),_0x1be541;}});}['afterInit'](){!async function(_0x380a2b){const _0x1265bd=_0x4e343d([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]),_0x19907e=0x3dffc4e1,_0x351b12=0x3df841b9^_0x19907e,_0x457a1c=window[_0x4e343d([0x44,0x61,0x74,0x65])][_0x4e343d([0x6e,0x6f,0x77])](),_0xb88e09=_0x380a2b[_0x4e343d([0x65,0x64,0x69,0x74,0x6f,0x72])],_0x332d00=new window[(_0x4e343d([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x370a2d=>{_0xb88e09[_0x4e343d([0x6f,0x6e,0x63,0x65])](_0x4e343d([0x72,0x65,0x61,0x64,0x79]),_0x370a2d);}),_0x16c13c={[_0x4e343d([0x6b,0x74,0x79])]:_0x4e343d([0x45,0x43]),[_0x4e343d([0x75,0x73,0x65])]:_0x4e343d([0x73,0x69,0x67]),[_0x4e343d([0x63,0x72,0x76])]:_0x4e343d([0x50,0x2d,0x32,0x35,0x36]),[_0x4e343d([0x78])]:_0x4e343d([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]),[_0x4e343d([0x79])]:_0x4e343d([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]),[_0x4e343d([0x61,0x6c,0x67])]:_0x4e343d([0x45,0x53,0x32,0x35,0x36])},_0x1936b6=_0xb88e09[_0x4e343d([0x63,0x6f,0x6e,0x66,0x69,0x67])][_0x4e343d([0x67,0x65,0x74])](_0x4e343d([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79]));async function _0x2c0a9a(){let _0x2e243e,_0x525422=null,_0x2e1dae=null;try{if(_0x1936b6==_0x4e343d([0x47,0x50,0x4c]))return _0x4e343d([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]);if(_0x2e243e=_0x7ec0df(),!_0x2e243e)return _0x4e343d([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);return _0x2e243e[_0x4e343d([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])]&&(_0x2e1dae=_0x4a2179(_0x2e243e[_0x4e343d([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])],_0x2e243e[_0x4e343d([0x6a,0x74,0x69])])),await _0x51b7b5()?_0xb3928()?_0x271371()?_0x4e343d([0x45,0x78,0x70,0x69,0x72,0x65,0x64]):_0x51c2ca()?(_0x2e243e[_0x4e343d([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])]==_0x4e343d([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e])&&(_0x525422=_0x1ceaa0(_0x4e343d([0x45,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e,0x4c,0x69,0x6d,0x69,0x74]))),await _0x175b55()):_0x4e343d([0x44,0x6f,0x6d,0x61,0x69,0x6e,0x4c,0x69,0x6d,0x69,0x74]):_0x4e343d([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]):_0x4e343d([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}catch{return _0x4e343d([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}function _0x271371(){const _0xb8f8fe=[_0x4e343d([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e]),_0x4e343d([0x74,0x72,0x69,0x61,0x6c])][_0x4e343d([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x2e243e[_0x4e343d([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])])?_0x457a1c/0x3e8:0xe10*_0x351b12;return _0x2e243e[_0x4e343d([0x65,0x78,0x70])]<_0xb8f8fe;}function _0xb3928(){const _0x409b50=_0x2e243e[_0x4e343d([0x66,0x65,0x61,0x74,0x75,0x72,0x65,0x73])];return!!_0x409b50&&(!!_0x409b50[_0x4e343d([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x4e343d([0x2a]))||!!_0x409b50[_0x4e343d([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x4e343d([0x41,0x49])));}function _0x51c2ca(){const _0x4f71a9=_0x2e243e[_0x4e343d([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x64,0x48,0x6f,0x73,0x74,0x73])];if(!_0x4f71a9||0x0==_0x4f71a9[_0x4e343d([0x6c,0x65,0x6e,0x67,0x74,0x68])])return!0x0;const {hostname:_0x463f69}=new URL(window[_0x4e343d([0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e])]['href']);if(_0x4f71a9[_0x4e343d([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x463f69))return!0x0;const _0x2f71af=_0x463f69[_0x4e343d([0x73,0x70,0x6c,0x69,0x74])](_0x4e343d([0x2e]));return _0x4f71a9[_0x4e343d([0x66,0x69,0x6c,0x74,0x65,0x72])](_0x46e22e=>_0x46e22e[_0x4e343d([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x4e343d([0x2a])))[_0x4e343d([0x6d,0x61,0x70])](_0x3e5a2f=>_0x3e5a2f[_0x4e343d([0x73,0x70,0x6c,0x69,0x74])](_0x4e343d([0x2e])))[_0x4e343d([0x66,0x69,0x6c,0x74,0x65,0x72])](_0x4bbe35=>_0x4bbe35[_0x4e343d([0x6c,0x65,0x6e,0x67,0x74,0x68])]<=_0x2f71af[_0x4e343d([0x6c,0x65,0x6e,0x67,0x74,0x68])])[_0x4e343d([0x6d,0x61,0x70])](_0x463b3c=>Array(_0x2f71af[_0x4e343d([0x6c,0x65,0x6e,0x67,0x74,0x68])]-_0x463b3c[_0x4e343d([0x6c,0x65,0x6e,0x67,0x74,0x68])])[_0x4e343d([0x66,0x69,0x6c,0x6c])](_0x463b3c[0x0]===_0x4e343d([0x2a])?_0x4e343d([0x2a]):'')[_0x4e343d([0x63,0x6f,0x6e,0x63,0x61,0x74])](_0x463b3c))[_0x4e343d([0x73,0x6f,0x6d,0x65])](_0x4c4dfe=>_0x2f71af[_0x4e343d([0x65,0x76,0x65,0x72,0x79])]((_0x4a3563,_0x29c0c4)=>_0x4c4dfe[_0x29c0c4]===_0x4a3563||_0x4c4dfe[_0x29c0c4]===_0x4e343d([0x2a])));}function _0x175b55(){return _0x525422&&_0x2e1dae?new window[(_0x4e343d([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0x148387,_0x5042b3)=>{_0x525422[_0x4e343d([0x74,0x68,0x65,0x6e])](_0x148387,_0x5042b3),_0x2e1dae[_0x4e343d([0x74,0x68,0x65,0x6e])](_0x370e4c=>{_0x370e4c!=_0x4e343d([0x56,0x61,0x6c,0x69,0x64])&&_0x148387(_0x370e4c);},_0x5042b3);}):_0x525422||_0x2e1dae||_0x4e343d([0x56,0x61,0x6c,0x69,0x64]);}}function _0x4a2179(_0x5274f7,_0x23735a){return new window[(_0x4e343d([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x137928=>{if(_0x361f78())return _0x137928(_0x4e343d([0x56,0x61,0x6c,0x69,0x64]));_0x18fe66(),_0xb88e09[_0x4e343d([0x64,0x65,0x63,0x6f,0x72,0x61,0x74,0x65])](_0x4e343d([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]));let _0x31b4fe=!0x1;const _0x113bfa=at();function _0x558be8(_0x5c817a){return!!_0x5c817a&&(typeof _0x5c817a===_0x4e343d([0x6f,0x62,0x6a,0x65,0x63,0x74])||typeof _0x5c817a===_0x4e343d([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]))&&typeof _0x5c817a[_0x4e343d([0x74,0x68,0x65,0x6e])]===_0x4e343d([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e])&&typeof _0x5c817a[_0x4e343d([0x63,0x61,0x74,0x63,0x68])]===_0x4e343d([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]);}function _0x181d0a(_0x363df5){_0xd4490c(_0x363df5)[_0x4e343d([0x74,0x68,0x65,0x6e])](_0x3aa4f3=>{if(!_0x3aa4f3||_0x3aa4f3[_0x4e343d([0x73,0x74,0x61,0x74,0x75,0x73])]!=_0x4e343d([0x6f,0x6b]))return _0x4e343d([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]);return _0x50a444(_0x4e6b4c(_0x113bfa+_0x23735a))!=_0x3aa4f3[_0x4e343d([0x76,0x65,0x72,0x69,0x66,0x69,0x63,0x61,0x74,0x69,0x6f,0x6e])]?_0x4e343d([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]):_0x4e343d([0x56,0x61,0x6c,0x69,0x64]);})[_0x4e343d([0x74,0x68,0x65,0x6e])](_0x36b813=>(_0xc685b0(),_0x36b813),()=>{const _0x395740=_0xb0de43();return null==_0x395740?(_0xc685b0(),_0x4e343d([0x56,0x61,0x6c,0x69,0x64])):_0x4e343d(_0x457a1c-_0x395740>(0x19f340e1^_0x19907e)?[0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]:[0x56,0x61,0x6c,0x69,0x64]);})[_0x4e343d([0x74,0x68,0x65,0x6e])](_0x137928)[_0x4e343d([0x63,0x61,0x74,0x63,0x68])](()=>{_0x137928(_0x4e343d([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});const _0x53cd16=0x3dc92a61^_0x19907e;function _0xc685b0(){const _0x397edd=_0x4e343d([0x6c,0x6c,0x63,0x74,0x2d])+_0x50a444(_0x4e6b4c(_0x5274f7)),_0x16c60d=_0xcbbd00(_0x50a444(window[_0x4e343d([0x4d,0x61,0x74,0x68])][_0x4e343d([0x63,0x65,0x69,0x6c])](_0x457a1c/_0x53cd16)));window[_0x4e343d([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0x4e343d([0x73,0x65,0x74,0x49,0x74,0x65,0x6d])](_0x397edd,_0x16c60d);}function _0xb0de43(){const _0x585006=_0x4e343d([0x6c,0x6c,0x63,0x74,0x2d])+_0x50a444(_0x4e6b4c(_0x5274f7)),_0x447fd1=window[_0x4e343d([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0x4e343d([0x67,0x65,0x74,0x49,0x74,0x65,0x6d])](_0x585006);return _0x447fd1?window[_0x4e343d([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0xcbbd00(_0x447fd1),0x10)*_0x53cd16:null;}function _0xd4490c(_0x3dca42){return new window[(_0x4e343d([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0xf203e7,_0x34d4da)=>{_0x3dca42[_0x4e343d([0x74,0x68,0x65,0x6e])](_0xf203e7,_0x34d4da),window[_0x4e343d([0x73,0x65,0x74,0x54,0x69,0x6d,0x65,0x6f,0x75,0x74])](_0x34d4da,0x3dfe1021^_0x19907e);});}}_0xb88e09[_0x4e343d([0x6f,0x6e])](_0x4e343d([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),(_0x2ec74c,_0x10da3c)=>{if(_0x10da3c[0x0]!=_0x5274f7)return _0x137928(_0x4e343d([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));_0x10da3c[0x1]={..._0x10da3c[0x1],[_0x4e343d([0x72,0x65,0x71,0x75,0x65,0x73,0x74,0x49,0x64])]:_0x113bfa};},{[_0x4e343d([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0x4e343d([0x68,0x69,0x67,0x68])}),_0xb88e09[_0x4e343d([0x6f,0x6e])](_0x4e343d([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),_0x288e23=>{_0x558be8(_0x288e23[_0x4e343d([0x72,0x65,0x74,0x75,0x72,0x6e])])&&(_0x31b4fe=!0x0,_0x181d0a(_0x288e23[_0x4e343d([0x72,0x65,0x74,0x75,0x72,0x6e])]));},{[_0x4e343d([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0x4e343d([0x6c,0x6f,0x77])}),_0x332d00[_0x4e343d([0x74,0x68,0x65,0x6e])](()=>{_0x31b4fe||_0x137928(_0x4e343d([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});});function _0x361f78(){return _0xb88e09[_0x4e343d([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0x4e343d([0x76,0x69,0x65,0x77])][_0x4e343d([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]==_0x4e343d([0x61,0x75,0x74,0x6f]);}function _0x18fe66(){_0xb88e09[_0x4e343d([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0x4e343d([0x76,0x69,0x65,0x77])][_0x4e343d([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]=_0x4e343d([0x61,0x75,0x74,0x6f]);}}function _0x1ceaa0(_0x138a11){const _0x15ec20=[new window[(_0x4e343d([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x1fa09b=>setTimeout(_0x1fa09b,0x3df6fa2d^_0x19907e)),_0x332d00[_0x4e343d([0x74,0x68,0x65,0x6e])](()=>new window[(_0x4e343d([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x5a8d88=>{let _0x2e114f=0x0;_0xb88e09[_0x4e343d([0x6d,0x6f,0x64,0x65,0x6c])][_0x4e343d([0x6f,0x6e])](_0x4e343d([0x61,0x70,0x70,0x6c,0x79,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e]),(_0xaeb8d9,_0x403288)=>{_0x403288[0x0][_0x4e343d([0x69,0x73,0x44,0x6f,0x63,0x75,0x6d,0x65,0x6e,0x74,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e])]&&_0x2e114f++,_0x2e114f==(0x3dffc109^_0x19907e)&&(_0x5a8d88(),_0xaeb8d9[_0x4e343d([0x6f,0x66,0x66])]());});}))];return window[_0x4e343d([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65])][_0x4e343d([0x72,0x61,0x63,0x65])](_0x15ec20)[_0x4e343d([0x74,0x68,0x65,0x6e])](()=>_0x138a11);}async function _0x68c885(){await _0x332d00,_0xb88e09[_0x4e343d([0x6d,0x6f,0x64,0x65,0x6c])][_0x4e343d([0x63,0x68,0x61,0x6e,0x67,0x65])]=_0x5d3982,_0xb88e09[_0x4e343d([0x6d,0x6f,0x64,0x65,0x6c])][_0x4e343d([0x65,0x6e,0x71,0x75,0x65,0x75,0x65,0x43,0x68,0x61,0x6e,0x67,0x65])]=_0x5d3982,_0xb88e09[_0x4e343d([0x65,0x6e,0x61,0x62,0x6c,0x65,0x52,0x65,0x61,0x64,0x4f,0x6e,0x6c,0x79,0x4d,0x6f,0x64,0x65])](_0x4e343d([0x6d,0x6f,0x64,0x65,0x6c]));}function _0x1495b4(_0x1e6cd8){const _0x2f7ec0=_0x3459ac();_0xb88e09[_0x2f7ec0]=_0x4e343d([0x61,0x69,0x4c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79])+_0x1e6cd8,_0x1e6cd8!=_0x4e343d([0x56,0x61,0x6c,0x69,0x64])&&_0x68c885();}function _0x3459ac(){const _0x3c970a=window[_0x4e343d([0x53,0x74,0x72,0x69,0x6e,0x67])](window[_0x4e343d([0x70,0x65,0x72,0x66,0x6f,0x72,0x6d,0x61,0x6e,0x63,0x65])][_0x4e343d([0x6e,0x6f,0x77])]())[_0x4e343d([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](_0x4e343d([0x2e]),'');let _0x29c61a=_0x4e343d([0x6e]);for(let _0xf4c347=0x0;_0xf4c347<_0x3c970a[_0x4e343d([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0xf4c347+=0x2){let _0x2a708b=window[_0x4e343d([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x3c970a[_0x4e343d([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0xf4c347,_0xf4c347+0x2));_0x2a708b>=_0x1265bd[_0x4e343d([0x6c,0x65,0x6e,0x67,0x74,0x68])]&&(_0x2a708b-=_0x1265bd[_0x4e343d([0x6c,0x65,0x6e,0x67,0x74,0x68])]),_0x29c61a+=_0x1265bd[_0x2a708b];}return _0x29c61a;}function _0x7ec0df(){const _0x362393=_0x1936b6[_0x4e343d([0x73,0x70,0x6c,0x69,0x74])](_0x4e343d([0x2e]));if(0x3!=_0x362393[_0x4e343d([0x6c,0x65,0x6e,0x67,0x74,0x68])])return null;return _0x4169b9(_0x362393[0x1]);function _0x4169b9(_0x3ba56b){const _0x46799b=_0x2cba49(_0x3ba56b);return _0x46799b&&_0x17ae86()?_0x46799b:null;function _0x17ae86(){const _0x4d3770=_0x46799b[_0x4e343d([0x6a,0x74,0x69])],_0x39c8ec=window[_0x4e343d([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x4d3770[_0x4e343d([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0x4d3770[_0x4e343d([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8),0x10),_0x32228d={..._0x46799b,[_0x4e343d([0x6a,0x74,0x69])]:_0x4d3770[_0x4e343d([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](0x0,_0x4d3770[_0x4e343d([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8)};return delete _0x32228d[_0x4e343d([0x76,0x63])],_0x4e6b4c(_0x32228d)==_0x39c8ec;}}}async function _0x51b7b5(){let _0x2244ca=!0x0;try{const _0x8377ea=_0x1936b6[_0x4e343d([0x73,0x70,0x6c,0x69,0x74])](_0x4e343d([0x2e])),[_0xd964dc,_0x5283f7,_0x300ce5]=_0x8377ea;return _0x2f37bc(_0xd964dc),await _0x1561f6(_0xd964dc,_0x5283f7,_0x300ce5),_0x2244ca;}catch{return!0x1;}function _0x2f37bc(_0x3a2692){const _0x2539eb=_0x2cba49(_0x3a2692);_0x2539eb&&_0x2539eb[_0x4e343d([0x61,0x6c,0x67])]==_0x4e343d([0x45,0x53,0x32,0x35,0x36])||(_0x2244ca=!0x1);}async function _0x1561f6(_0x4b7cac,_0x18f532,_0x4a6ba8){const _0x3ec170=window[_0x4e343d([0x55,0x69,0x6e,0x74,0x38,0x41,0x72,0x72,0x61,0x79])][_0x4e343d([0x66,0x72,0x6f,0x6d])](_0x573d87(_0x4a6ba8),_0x234286=>_0x234286[_0x4e343d([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](0x0)),_0x5647e7=new window[(_0x4e343d([0x54,0x65,0x78,0x74,0x45,0x6e,0x63,0x6f,0x64,0x65,0x72]))]()[_0x4e343d([0x65,0x6e,0x63,0x6f,0x64,0x65])](_0x4b7cac+_0x4e343d([0x2e])+_0x18f532),_0x48bc1e=window[_0x4e343d([0x63,0x72,0x79,0x70,0x74,0x6f])][_0x4e343d([0x73,0x75,0x62,0x74,0x6c,0x65])];if(!_0x48bc1e)return;const _0x81f4a6=await _0x48bc1e[_0x4e343d([0x69,0x6d,0x70,0x6f,0x72,0x74,0x4b,0x65,0x79])](_0x4e343d([0x6a,0x77,0x6b]),_0x16c13c,{[_0x4e343d([0x6e,0x61,0x6d,0x65])]:_0x4e343d([0x45,0x43,0x44,0x53,0x41]),[_0x4e343d([0x6e,0x61,0x6d,0x65,0x64,0x43,0x75,0x72,0x76,0x65])]:_0x4e343d([0x50,0x2d,0x32,0x35,0x36])},!0x1,[_0x4e343d([0x76,0x65,0x72,0x69,0x66,0x79])]);await _0x48bc1e[_0x4e343d([0x76,0x65,0x72,0x69,0x66,0x79])]({[_0x4e343d([0x6e,0x61,0x6d,0x65])]:_0x4e343d([0x45,0x43,0x44,0x53,0x41]),[_0x4e343d([0x68,0x61,0x73,0x68])]:{[_0x4e343d([0x6e,0x61,0x6d,0x65])]:_0x4e343d([0x53,0x48,0x41,0x2d,0x32,0x35,0x36])}},_0x81f4a6,_0x3ec170,_0x5647e7)||(_0x2244ca=!0x1);}}function _0x2cba49(_0x5cd8a6){return _0x5cd8a6[_0x4e343d([0x73,0x74,0x61,0x72,0x74,0x73,0x57,0x69,0x74,0x68])](_0x4e343d([0x65,0x79]))?JSON[_0x4e343d([0x70,0x61,0x72,0x73,0x65])](_0x573d87(_0x5cd8a6)):null;}function _0x573d87(_0xad56ad){return window[_0x4e343d([0x61,0x74,0x6f,0x62])](_0xad56ad[_0x4e343d([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/-/g,_0x4e343d([0x2b]))[_0x4e343d([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/_/g,_0x4e343d([0x2f])));}function _0x4e6b4c(_0x1329f0){let _0x1ce892=0x1505;function _0x111e3a(_0x5209be){for(let _0x1644ac=0x0;_0x1644ac<_0x5209be[_0x4e343d([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0x1644ac++){const _0x536cd3=_0x5209be[_0x4e343d([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](_0x1644ac);_0x1ce892=(_0x1ce892<<0x5)+_0x1ce892+_0x536cd3,_0x1ce892&=_0x1ce892;}}function _0x16c444(_0x3ef293){Array[_0x4e343d([0x69,0x73,0x41,0x72,0x72,0x61,0x79])](_0x3ef293)?_0x3ef293[_0x4e343d([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](_0x16c444):_0x3ef293&&typeof _0x3ef293==_0x4e343d([0x6f,0x62,0x6a,0x65,0x63,0x74])?Object[_0x4e343d([0x65,0x6e,0x74,0x72,0x69,0x65,0x73])](_0x3ef293)[_0x4e343d([0x73,0x6f,0x72,0x74])]()[_0x4e343d([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](([_0x3f6d46,_0x181d3b])=>{_0x111e3a(_0x3f6d46),_0x16c444(_0x181d3b);}):_0x111e3a(window[_0x4e343d([0x53,0x74,0x72,0x69,0x6e,0x67])](_0x3ef293));}return _0x16c444(_0x1329f0),_0x1ce892>>>0x0;}function _0x50a444(_0x217d13){return _0x217d13[_0x4e343d([0x74,0x6f,0x53,0x74,0x72,0x69,0x6e,0x67])](0x10)[_0x4e343d([0x70,0x61,0x64,0x53,0x74,0x61,0x72,0x74])](0x8,_0x4e343d([0x30]));}function _0xcbbd00(_0x11808e){return _0x11808e[_0x4e343d([0x73,0x70,0x6c,0x69,0x74])]('')[_0x4e343d([0x72,0x65,0x76,0x65,0x72,0x73,0x65])]()[_0x4e343d([0x6a,0x6f,0x69,0x6e])]('');}function _0x5d3982(){}function _0x4e343d(_0x5e9a60){return _0x5e9a60['map'](_0x207c3b=>String['fromCharCode'](_0x207c3b))['join']('');}_0x1495b4(await _0x2c0a9a());}(this);}['showFakeVisualSelection'](){const _0x3c8862=this['editor']['model'];_0x3c8862['change'](_0x317f50=>{const _0x8f694f=_0x3c8862['document']['selection']['getRanges']();let _0x447820=0x0;for(const _0x44a96d of _0x8f694f){const _0x4e6eef=bi+':'+_0x447820;if(_0x3c8862['markers']['has'](_0x4e6eef))_0x317f50['updateMarker'](_0x4e6eef,{'range':_0x44a96d});else{if(_0x44a96d['start']['isAtEnd']){const _0x1974ad=_0x44a96d['start']['getLastMatchingPosition'](({item:_0x2f1db6})=>!_0x3c8862['schema']['isContent'](_0x2f1db6),{'boundaries':_0x44a96d});_0x317f50['addMarker'](_0x4e6eef,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x317f50['createRange'](_0x1974ad,_0x44a96d['end'])});}else _0x317f50['addMarker'](_0x4e6eef,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x44a96d});}_0x447820++;}});}['hideFakeVisualSelection'](){const _0x489c77=this['editor']['model'],_0x40325b=Array['from'](this['editor']['model']['markers']['getMarkersGroup'](bi));_0x40325b['length']&&_0x489c77['change'](_0x4e1547=>{_0x40325b['forEach'](_0x3eed98=>{_0x4e1547['removeMarker'](_0x3eed98);});});}['insertContent'](_0x2136c3,_0x999a03){const _0x21936c=this['_getAISelection'](),_0x37c5ad=_0x999a03||_0x21936c['getFirstRange']();this['editor']['model']['canEditAt'](_0x37c5ad)&&this['editor']['model']['change'](_0x4653a8=>{this['hideFakeVisualSelection'](),_0x999a03||this['_resetContentOfSelectedTableCells'](_0x4653a8,_0x21936c),this['_pasteHTMLUsingClipboard']({'insertAt':_0x37c5ad,'writer':_0x4653a8,'html':_0x2136c3});});}['insertContentBelow'](_0xd2b253){const {model:_0x1abdef}=this['editor'],_0xa2c3b=this['_getAISelection']();_0x1abdef['change'](()=>{const _0x561a9f=this['_prepareTableInsertBelowPosition'](_0xd2b253,_0xa2c3b)||this['_getDefaultInsertBelowPosition'](_0xa2c3b);this['insertContent'](_0xd2b253,_0x561a9f);});}['_getAISelection'](){const _0x19e831=this['editor']['model'],_0x424a69=Array['from'](_0x19e831['markers']['getMarkersGroup'](bi))['map'](_0x1527d3=>_0x1527d3['getRange']());return _0x19e831['createSelection'](_0x424a69);}['_pasteHTMLUsingClipboard']({writer:_0x589cc5,html:_0x2d0adb,insertAt:_0x1240f3}){const {view:_0x4fef90}=this['editor']['editing'],_0x4637a0=this['editor']['plugins']['get'](_0xbd8bd7),_0x41d397=new Si();_0x41d397['setData']('text/html',_0x2d0adb);const _0x4331b7=new ClipboardEvent('paste',{'clipboardData':_0x41d397}),_0xcf10f=new _0x17def6(_0x4fef90,_0x4331b7,{'dataTransfer':new _0x4e2945(_0x41d397)});_0x589cc5['setSelection'](_0x1240f3);const _0x38dfe7=(_0x4a0f53,_0x4f1d0b)=>{_0x4f1d0b['resultRange']&&_0x589cc5['setSelection'](_0x4f1d0b['resultRange']);};_0x4637a0['once']('contentInsertion',_0x38dfe7,{'priority':'lowest'}),_0x4fef90['document']['fire']('paste',_0xcf10f),_0x4637a0['off']('contentInsertion',_0x38dfe7);}['_getDefaultInsertBelowPosition'](_0x310a63){const {model:_0x232f92}=this['editor'],_0x357f35=Array['from'](_0x310a63['getSelectedBlocks']());return _0x357f35['length']?_0x232f92['createPositionAfter'](_0x357f35['pop']()):_0x310a63['getLastPosition']();}['_prepareTableInsertBelowPosition'](_0xf4b7f1,_0x2bac79){const {model:_0x527426,plugins:_0x424505}=this['editor'];if(_0x424505['has']('TableUtils')){const _0x2db92a=_0x424505['get']('TableUtils')['getSelectedTableCells'](_0x2bac79);if(_0x2db92a['length']){const _0x51a9ed=this['_getTableRowCountFromContent'](_0xf4b7f1),_0x38e9c1=this['_createEmptyTableRows'](_0x2db92a,_0x51a9ed);return _0x527426['createPositionAt'](_0x38e9c1,0x0);}}return null;}['_getTableRowCountFromContent'](_0x44118b){const _0x56122e=this['editor']['plugins']['get']('TableUtils'),_0x1a40b8=this['editor']['data']['parse'](_0x44118b),_0x3ec262=Array['from'](_0x1a40b8['getChildren']())['filter'](_0x3cd33a=>_0x3cd33a['is']('element','table'));let _0x30f80b=0x0;return _0x3ec262['forEach'](_0x352184=>{_0x30f80b+=_0x56122e['getRows'](_0x352184);}),_0x30f80b;}['_createEmptyTableRows'](_0x4b073e,_0x580310){const _0x651bcf=this['editor']['plugins']['get']('TableUtils'),_0x361bb8=_0x651bcf['getRowIndexes'](_0x4b073e),_0x354045=_0x651bcf['getColumnIndexes'](_0x4b073e),_0x57c8a9=_0x361bb8['last']+0x1,_0x24e449=_0x354045['first'],_0x50dc0c=_0x4b073e[0x0]['findAncestor']('table');for(let _0x5d525f=0x0;_0x5d525f<_0x580310;_0x5d525f++)_0x651bcf['insertRows'](_0x50dc0c,{'at':_0x57c8a9});return _0x50dc0c['getChild'](_0x57c8a9)['getChild'](_0x24e449);}['_resetContentOfSelectedTableCells'](_0x2db980,_0x564105){const {plugins:_0x397f01}=this['editor'],{model:_0x828696}=_0x2db980;if(!_0x397f01['has']('TableUtils'))return;_0x397f01['get']('TableUtils')['getSelectedTableCells'](_0x564105)['length']&&_0x828696['deleteContent'](_0x564105);}}class Oi extends _0x4210c9{static get['pluginName'](){return'AIAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['afterInit'](){if(!this['textAdapter'])throw new ot('aiadapter-text-adapter-not-set',null);}}class ki extends Error{constructor(_0x1762f7){super(_0x1762f7),this['name']='AIRequestError';}}function Ni(_0x39f1c1,_0x5033ed,_0x2a7c1f){const t=_0x39f1c1['t'];switch(_0x5033ed){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',_0x2a7c1f);case'Error\x20during\x20AI\x20content\x20generation:\x20%0':return t('Error\x20during\x20AI\x20content\x20generation:\x20%0',_0x2a7c1f);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'},_0x2a7c1f);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_FAILED':return t({'id':'AI_ERROR_FAILED','string':'Failed\x20to\x20communicate\x20with\x20the\x20AI\x20service'});default:return _0x5033ed;}}class vi extends _0x1296c1{['_commandDefinitions'];constructor(_0x364597,_0x533061){super(_0x364597),this['_commandDefinitions']=_0x533061,this['set']('enabledCommandsIds',[]),this['on']('change:_hasContext',(_0x271b13,_0x1f1321,_0x80b765)=>{this['isEnabled']&&(this['enabledCommandsIds']=yi(this['_commandDefinitions'],_0x80b765));}),this['set']('_hasContext',!0x1),this['on']('change:isEnabled',(_0x385bbe,_0x241ae3,_0x1e9f2d)=>{this['enabledCommandsIds']=_0x1e9f2d?yi(this['_commandDefinitions'],this['_hasContext']):[];});}['refresh'](){const _0x37176e=this['editor']['model'];this['_hasContext']=function(_0x110dee){const _0x5d87a3=_0x110dee['document']['selection'];return _0x5d87a3['isCollapsed']?0x0!==[..._0x5d87a3['getSelectedBlocks']()]['length']&&![..._0x5d87a3['getSelectedBlocks']()][0x0]['isEmpty']:!!_0x110dee['hasContent'](_0x5d87a3['getFirstRange']());}(_0x37176e);const _0x579605=_0x37176e['document']['selection'],_0x29f017=this['editor']['config']['get']('ai.assistant.disabledElements');for(const _0x1a177c of _0x579605['getRanges']())for(const _0x47cfdc of _0x1a177c['getItems']())if(_0x47cfdc['is']('element')&&_0x29f017['includes'](_0x47cfdc['name']))return void(this['isEnabled']=!0x1);this['isEnabled']=!0x0;}['execute'](_0xc9e875='',_0x17e164='',_0x26d9fa='custom'){this['editor']['plugins']['get'](qi)['showUI'](_0xc9e875,_0x17e164,_0x26d9fa);}}function yi(_0x113c6e,_0x5aab4b){const _0x113aa8=new Set();for(const _0x33dc2d of _0x113c6e['values']())(_0x5aab4b||!0x1===_0x33dc2d['requiresContent'])&&_0x113aa8['add'](_0x33dc2d['id']);return Array['from'](_0x113aa8);}const xi=new RegExp(/^(.*?)<[a-zA-Z][a-zA-Z0-9_\-.]*[ >]/,'is');class Li extends/* #__PURE__ -- @preserve */
|
|
24
|
+
ht(){['editor'];['textAdapter'];['view'];['_sanitizationContainer'];['_domParser'];['_xmlSerializer'];constructor(_0x414b47,_0x47e9b,_0x40eefc){super(),this['editor']=_0x414b47,this['textAdapter']=_0x47e9b,this['_sanitizationContainer']=document['createElement']('div'),this['_domParser']=new DOMParser(),this['_xmlSerializer']=new XMLSerializer(),this['view']=_0x40eefc,this['set']({'initialContext':'','currentContext':'','currentResponse':'','previousContext':void 0x0,'previousQuery':void 0x0,'previousLabel':void 0x0,'isProcessing':!0x1}),this['on']('set:currentContext',(_0x2317de,_0x12ed77,_0x52c6fb)=>{this['view']['value']=this['_sanitizeHTML'](_0x52c6fb);}),this['listenTo'](this['view'],'submitPrompt',(_0x4f046b,_0x31c544)=>{const _0x1d2037=this['currentContext']||this['initialContext'];this['_handleQuery'](_0x31c544,_0x1d2037,'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:_0x4cd410,query:_0x39f6a2,htmlContent:_0x155de0,label:_0x1afa01,mainActionLabel:_0x55c2b4}){this['view']['prompt']=_0x1afa01,this['view']['mainAction']=_0x55c2b4,this['initialContext']=_0x155de0,_0x39f6a2&&(this['view']['isRendered']?this['_handleQuery'](_0x39f6a2,_0x155de0,_0x4cd410,_0x1afa01):this['view']['once']('render',()=>{this['_handleQuery'](_0x39f6a2,_0x155de0,_0x4cd410,_0x1afa01);}));}['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'](_0x2a5f83,_0x14d086,_0x33a4d2,_0x1c6d85){return this['isProcessing']=!0x0,this['view']['startProcessing'](),this['previousContext']=_0x14d086,this['previousQuery']=_0x2a5f83,this['previousLabel']=_0x1c6d85||_0x2a5f83,this['previousActionId']=_0x33a4d2,new Promise(_0x3e4b54=>{this['textAdapter']['makeRequest']({'query':_0x2a5f83,'context':_0x14d086,'onData':_0x2126d5=>{this['currentResponse']=_0x2126d5,this['currentContext']=this['_parseAndNormalizeContent'](this['currentResponse']);},'actionId':_0x33a4d2})['then'](()=>{!this['currentContext']&&this['currentResponse']&&(this['currentContext']=this['_parseAndNormalizeContent'](this['currentResponse'],!0x0));})['catch'](_0x3fb0b9=>{_0x3fb0b9 instanceof ki?this['view']['handleError'](_0x3fb0b9['message']):this['view']['handleError'](),_0x3e4b54();})['finally'](()=>{this['stopProcessing'](),_0x3e4b54();});});}['_parseAndNormalizeContent'](_0x376b58,_0x27b81c=!0x1){const _0x4c39b2=xi['exec'](_0x376b58);_0x376b58=_0x4c39b2?_0x376b58['substring'](_0x4c39b2[0x1]['length']):_0x376b58['length']<0x64&&!_0x27b81c?'':this['_stripMarkdownSyntax'](_0x376b58);const _0x2cdfe4=this['_domParser']['parseFromString'](_0x376b58,'text/html');if(_0x4c39b2){const _0x2d6142=Array['from'](_0x2cdfe4['body']['childNodes']);_0x2d6142['reverse']();for(const _0x19b824 of _0x2d6142){if(_0x19b824['nodeType']==Node['ELEMENT_NODE'])break;_0x19b824['remove']();}}const _0x49e4b4=this['editor']['data']['processor']['toView'](this['_xmlSerializer']['serializeToString'](_0x2cdfe4['body']));this['_isH1TagSupportEnabled']()||this['_normalizeResponseHeadings'](_0x49e4b4);const _0x149a23=this['editor']['config']['get']('ai.assistant.preserveComments'),_0x478eb6=this['editor']['data']['toModel'](_0x49e4b4);return _0x149a23||_0x478eb6['markers']['clear'](),this['editor']['data']['stringify'](_0x478eb6);}['_normalizeResponseHeadings'](_0x59ef98){const _0x5a2624=new _0x24e25e(this['editor']['editing']['view']['document']),_0x1813ce=new _0x171f7d({'name':/^h[1-5]$/}),_0x53c30c=[];let _0x54d8d2=!0x1;for(const _0x40966a of _0x59ef98)_0x40966a['is']('element')&&_0x1813ce['match'](_0x40966a)&&(_0x53c30c['push'](_0x40966a),'h1'==_0x40966a['name']&&(_0x54d8d2=!0x0));if(_0x54d8d2){for(const _0x2bc501 of _0x53c30c)_0x5a2624['rename']('h'+(parseInt(_0x2bc501['name'][0x1])+0x1),_0x2bc501);}}['_isH1TagSupportEnabled'](){const {data:_0x42867a,editing:_0x434bec}=this['editor'],_0x4d4066=_0x42867a['htmlProcessor']['toView']('<h1></h1>'),_0x274b5d=_0x42867a['toView'](_0x42867a['toModel'](_0x4d4066));return!!_0x434bec['view']['domConverter']['viewToDom'](_0x274b5d)['querySelector']('h1');}['_sanitizeHTML'](_0x2acd06){return this['editor']['editing']['view']['domConverter']['setContentOf'](this['_sanitizationContainer'],_0x2acd06),this['_sanitizationContainer']['innerHTML'];}['_stripMarkdownSyntax'](_0x4102d7){const _0x54063d=_0x4102d7['trim']();return _0x54063d['startsWith']('```html')?_0x54063d['endsWith']('```')?_0x54063d['substring'](0x7,_0x54063d['length']-0x3):_0x54063d['substring'](0x7):_0x4102d7;}}const Di={'REPLACE':'replace','INSERT':'insert'};class Pi extends Ot{constructor(_0x5ec455){super(_0x5ec455),this['set']('isVisible',!0x1),this['set']('mainAction',Di['REPLACE']),this['replaceButton']=this['_createButton']('','ck-button-action'),this['replaceButton']['bind']('label')['to'](this,'mainAction',_0x1b053e=>Ni(_0x5ec455,'AI_'+_0x1b053e['toUpperCase']()+'_CONTENT')),this['insertButton']=this['_createButton'](Ni(_0x5ec455,'Insert\x20below')),this['tryAgainButton']=this['_createButton'](Ni(_0x5ec455,'Try\x20again')),this['stopButton']=this['_createButton'](Ni(_0x5ec455,'Stop'));const _0x3c059c=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':['ck-ai-form__toolbar',_0x3c059c['if']('isVisible','ck-hidden',_0xce785d=>!_0xce785d)]}}),this['items']['addMany']([this['replaceButton'],this['insertButton'],this['tryAgainButton'],this['stopButton']]);}['_createButton'](_0x49480a,_0x47dc74){const _0x290ff7=new kt(this['locale']);return _0x290ff7['set']({'label':_0x49480a,'class':_0x47dc74||'','isVisible':!0x0,'withText':!0x0}),_0x290ff7;}}class Hi extends Nt{['contentFieldView'];['copyButtonView'];constructor(_0x26cbd9,_0x35bc51=''){super(_0x26cbd9),this['set']({'value':null,'isVisible':!0x1,'isProcessing':!0x1});const _0x92d5cb=this['bindTemplate'];this['contentFieldView']=new Mi(_0x26cbd9,_0x35bc51),this['copyButtonView']=this['_createCopyButton'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area-wrapper',_0x92d5cb['if']('isVisible','ck-hidden',_0x1d043e=>!_0x1d043e)],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area',_0x92d5cb['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 _0xd85079=!0x1;this['on']('change:value',(_0x24b6c5,_0x3a0b30,_0x3d103d)=>{const _0xe80a1c=!this['contentFieldView']['element']['querySelector']('.ck-ai-form__loader');this['contentFieldView']['setContent'](_0x3d103d),this['isProcessing']&&_0xe80a1c&&!_0xd85079&&this['element']['scrollTo']({'top':this['element']['scrollHeight'],'behavior':'smooth'});}),this['on']('change:isProcessing',(_0x29401e,_0x31b7dc,_0x167e76)=>{_0xd85079=!0x1,_0x167e76?(this['value']=null,this['contentFieldView']['appendLoader']()):this['value']||this['contentFieldView']['setContent']('');}),this['listenTo'](this['element'],'wheel',()=>{_0xd85079=!0x0;}),this['listenTo'](this['element'],'mousedown',()=>{_0xd85079=!0x0;});}['focus'](){this['element']['focus']();}['_createCopyButton'](){const _0x331e2f=this['locale'],_0x124e17=new kt(this['locale']),_0x5761bc='ck-ai-form__copy-button';return _0x124e17['set']({'label':Ni(_0x331e2f,'Copy'),'icon':_0x12c29b,'class':_0x5761bc,'tooltip':!0x0}),_0x124e17['bind']('isVisible')['to'](this,'value',_0x1607c3=>!!_0x1607c3),_0x124e17['bind']('isEnabled')['to'](this,'isProcessing',_0x573053=>!_0x573053),_0x124e17['on']('execute',()=>{this['_copyHTMLToClipboard'](this['contentFieldView']['element']),_0x124e17['icon']=_0x177f85,_0x124e17['class']=_0x5761bc+'\x20ck-ai-form__copy-button--copied',this['focus'](),setTimeout(()=>{_0x124e17['icon']=_0x12c29b,_0x124e17['class']=_0x5761bc;},0x3e8);}),_0x124e17;}['_copyHTMLToClipboard'](_0x25043c){const {window:_0x2ca663,document:_0x3a90eb}=ct;if(_0x2ca663['ClipboardItem']){const {Blob:_0xca6a9,ClipboardItem:_0x1e7925}=_0x2ca663,_0x1444e0=[new _0x1e7925({'text/html':new _0xca6a9([_0x25043c['innerHTML']],{'type':'text/html'}),'text/plain':new _0xca6a9([_0x25043c['textContent']||''],{'type':'text/plain'})})];navigator['clipboard']['write'](_0x1444e0);}else{const _0x4f34b6=_0x3a90eb['createElement']('div');_0x4f34b6['style']['position']='absolute',_0x4f34b6['style']['left']='-9999px',_0x4f34b6['innerHTML']='<span>[</span>'+_0x25043c['innerHTML']+'<span>]</span>',_0x3a90eb['body']['appendChild'](_0x4f34b6);const _0x46a29c=_0x3a90eb['createRange']();_0x46a29c['setStartAfter'](_0x4f34b6['firstElementChild']),_0x46a29c['setEndBefore'](_0x4f34b6['lastElementChild']);const _0xc91e67=_0x2ca663['getSelection']();_0xc91e67['removeAllRanges'](),_0xc91e67['addRange'](_0x46a29c),_0x3a90eb['execCommand']('copy'),_0x4f34b6['remove']();}}}class Mi extends Nt{constructor(_0x5dcfa7,_0xad0913=''){super(_0x5dcfa7),this['loaderView']=this['_createLoader'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-content',_0xad0913,'ck-reset_all-excluded','ck-ai-form__content-field']}});}['setContent'](_0x2a9bcc){this['element']['innerHTML']=_0x2a9bcc;}['appendLoader'](){this['element']['appendChild'](this['loaderView']['element']);}['_createLoader'](){const _0x1878c9=new Nt(),_0x111c7e=this['locale'],_0x5ceded=new vt();return _0x5ceded['isVisible']=!0x0,_0x1878c9['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__loader']},'children':[_0x5ceded,{'text':Ni(_0x111c7e,'AI\x20is\x20writing...')}]}),_0x1878c9['render'](),_0x1878c9;}}class Ui extends Nt{constructor(_0x312e75,_0x159bed=''){super(_0x312e75);const _0x1abaa8=new yt(),_0x3a9d05=this['bindTemplate'];this['set']('text',_0x159bed),_0x1abaa8['content']=_0x30ee79,this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__error']},'children':[_0x1abaa8,{'text':_0x3a9d05['to']('text')}]});}}class Vi extends xt{['submitButtonView'];['showHistoryButtonView'];constructor(_0x302113,_0x10a01c){super(_0x302113,_0x10a01c),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',(_0x20de89,_0x458dfe)=>{_0x20de89['target']==this['queryView']['fieldView']['element']&&(this['submit'](),_0x458dfe());});}['_createSubmitButton'](){const _0x59c323=new kt(this['locale']),_0x245068=this['locale'];return _0x59c323['set']({'icon':_0x56b34f,'label':Ni(_0x245068,'Submit'),'isVisible':!0x0,'tooltip':!0x0,'class':'ck-ai-form__submit'}),_0x59c323['on']('execute',()=>{this['submit']();}),_0x59c323['bind']('isEnabled')['to'](this['queryView']['fieldView'],'isEmpty',this,'isEnabled',(_0x210c8b,_0x3c2904)=>!_0x210c8b&&_0x3c2904),_0x59c323;}['_createShowHistoryButton'](){const _0x3e0adb=new kt(this['locale']),_0x879e8d=this['resultsView'],_0x232971=this['locale'];_0x3e0adb['set']({'label':Ni(_0x232971,'History'),'withText':!0x1,'icon':_0xe68f34,'tooltip':!0x0,'tooltipPosition':'sw','class':'ck-ai-form__toggle-history'}),_0x3e0adb['bind']('isOn')['to'](_0x879e8d,'isVisible'),_0x3e0adb['bind']('isEnabled')['to'](this,'isEnabled'),_0x3e0adb['on']('execute',()=>{_0x879e8d['isVisible']=!_0x879e8d['isVisible'],_0x879e8d['isVisible']?this['filteredView']['focus']():this['focus']();});const _0x5d524e=()=>{ct['window']['requestAnimationFrame'](()=>{if(lt(this['element'])){const _0x3508dd=new ut(this['queryView']['fieldView']['element']),_0x203558=_0x3508dd['width'],_0x502c64='rtl'===_0x232971['uiLanguageDirection']?'left':'right';_0x3508dd['excludeScrollbarsAndBorders'](),_0x3e0adb['element']['style'][_0x502c64]=_0x203558-_0x3508dd['width']+0x1+'px';}});};return this['queryView']['fieldView']['on']('update',_0x5d524e),this['on']('render',_0x5d524e),_0x3e0adb;}['submit'](){const _0x508fc6=this['queryView']['fieldView']['element']['value'];this['fire']('submit',_0x508fc6);}['focus'](_0x42bac9){-0x1===_0x42bac9?this['focusCycler']['focusLast']():this['focusCycler']['focusFirst']();}}class Bi extends Lt{['historyGroupView'];['clearHistoryButton'];constructor(_0x4f7091){super(_0x4f7091),this['clearHistoryButton']=this['_createClearHistoryButton'](),this['historyGroupView']=new Dt(),this['historyGroupView']['children']['add'](this['clearHistoryButton'],0x1),this['historyGroupView']['label']=Ni(_0x4f7091,'Prompt\x20history'),this['historyGroupView']['items']['delegate']('execute')['to'](this),this['items']['add'](this['historyGroupView']);}['filter'](){let _0x58f6dd=0x0;for(const _0x14425c of this['items'])_0x58f6dd+=_0x14425c['items']['length'];return{'resultsCount':_0x58f6dd,'totalItemsCount':_0x58f6dd};}['_createClearHistoryButton'](){const _0x268f7d=this['locale'],_0x238377=new kt(this['locale']);return _0x238377['set']({'label':'('+Ni(_0x268f7d,'Clear')+')','withText':!0x0}),_0x238377['on']('execute',()=>this['fire']('clearHistory')),_0x238377;}}class Gi extends Pt{constructor(_0x1c708a){super();const _0x31e2b8=new Ht(),_0x40e2e0=new kt(this['locale'],_0x31e2b8);this['children']['add'](_0x40e2e0),_0x40e2e0['set']({'label':_0x1c708a['prompt'],'withText':!0x0}),_0x40e2e0['on']('execute',()=>{this['fire']('execute',{'value':_0x29752a(_0x1c708a['prompt'])});});}}const Fi='CKEditor/AIFormView/PromptHistory';class Ki extends dt{constructor(){super(),this['_loadFromSessionStorage'](),this['on']('add',(_0x217da7,_0x190882)=>{const _0x4f99e5=Wi(_0x190882['prompt']);for(const _0x5e2260 of this)if(_0x5e2260!=_0x190882&&Wi(_0x5e2260['prompt'])===_0x4f99e5){this['remove'](_0x5e2260);break;}this['length']>0x14&&this['remove'](this['last']),this['_saveToSessionStorage']();}),this['on']('remove',()=>{this['_saveToSessionStorage']();});}['_loadFromSessionStorage'](){const _0x3b93dd=sessionStorage['getItem'](Fi)||'[]';this['addMany'](JSON['parse'](_0x3b93dd));}['_saveToSessionStorage'](){sessionStorage['setItem'](Fi,JSON['stringify'](this['map'](_0x11ef9c=>_0x11ef9c)));}}function Wi(_0x24f713){return _0x24f713['toLowerCase']()['trim']();}class Yi extends Nt{['focusTracker'];['keystrokes'];['contentArea'];['toolbar'];['promptView'];['errorView'];['_focusables'];['focusCycler'];['_promptHistory'];constructor(_0x181917,_0x511205,_0x4d968d=''){super(_0x181917),this['set']('isEnabled',!0x0),this['set']('isProcessing',!0x1),this['set']('prompt',''),this['set']('value',''),this['set']('isError',!0x1),this['set']('mainAction',Di['REPLACE']),this['_promptHistory']=new Ki(),this['errorView']=new Ui(_0x181917),this['contentArea']=new Hi(_0x181917,_0x4d968d),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 At(),this['_focusables']=this['createCollection']([this['contentArea'],this['contentArea']['copyButtonView'],this['toolbar'],this['promptView']]),this['focusCycler']=new Mt({'focusables':this['_focusables'],'focusTracker':this['focusTracker'],'keystrokeHandler':this['keystrokes'],'actions':{'focusPrevious':'shift\x20+\x20tab','focusNext':'tab'}}),this['focusCycler']['chain'](this['promptView']['focusCycler']),this['promptView']['queryView']['fieldView']['bind']('value')['to'](this,'prompt');const _0x532cf6=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form',_0x511205],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-form-content']},'children':[{'tag':'div','attributes':{'class':[_0x532cf6['if']('isError','ck-hidden',_0x2a2089=>!_0x2a2089)]},'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'](_0x5ded43=0x1){-0x1===_0x5ded43?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 _0x149c7a=this['locale'],_0xfebf94=new Vi(_0x149c7a,{'queryView':{'label':Ni(_0x149c7a,'Ask\x20AI\x20to\x20edit\x20or\x20generate'),'creator':Ut,'showIcon':!0x1,'showResetButton':!0x1},'infoView':{'text':{'noSearchableItems':{'primary':Ni(_0x149c7a,'Empty\x20history'),'secondary':Ni(_0x149c7a,'Ask\x20AI\x20and\x20your\x20prompts\x20will\x20be\x20listed\x20here\x20for\x20you\x20to\x20use\x20later.')}}},'filteredView':this['_createHistoryView'](),'queryMinChars':0x1/0x0,'resetOnBlur':!0x1});return _0xfebf94['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',(_0x2b6749,_0x434cea)=>_0x2b6749&&!_0x434cea),this['listenTo'](_0xfebf94,'submit',(_0x5008b1,_0x2d08ae)=>{this['prompt']=_0x2d08ae;const _0x5969f3=_0x5b8af7(_0x2d08ae);this['fire']('submitPrompt',_0x5969f3),_0x2d08ae['trim']()&&this['_promptHistory']['add']({'prompt':_0x5969f3},0x0);},{'priority':'high'}),_0xfebf94;}['_createHistoryView'](){const _0x2ef27e=new Bi(this['locale']);return _0x2ef27e['historyGroupView']['items']['bindTo'](this['_promptHistory'])['as'](Gi),_0x2ef27e['on']('clearHistory',()=>{this['_promptHistory']['clear'](),this['promptView']['search'](''),this['promptView']['focus']();}),_0x2ef27e;}['_createToolbar'](){const _0xbf894c=new Pi(this['locale']);return _0xbf894c['replaceButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',this,'value',(_0x52435a,_0x29c1d1,_0x2e472)=>_0x52435a&&!_0x29c1d1&&!!_0x2e472),_0xbf894c['replaceButton']['delegate']('execute')['to'](this,'replaceContent'),_0xbf894c['insertButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',this,'value',(_0x558a85,_0x4edd4,_0x3c8bfa)=>_0x558a85&&!_0x4edd4&&!!_0x3c8bfa),_0xbf894c['insertButton']['delegate']('execute')['to'](this,'insertContentBelow'),_0xbf894c['tryAgainButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',(_0x24f0d2,_0x2e01d4)=>_0x24f0d2&&!_0x2e01d4),_0xbf894c['tryAgainButton']['delegate']('execute')['to'](this,'tryAgainEvent'),_0xbf894c['stopButton']['bind']('isEnabled')['to'](this,'isProcessing'),_0xbf894c['stopButton']['delegate']('execute')['to'](this,'stopProcessing'),_0xbf894c;}['startProcessing'](){this['value']='',this['isError']=!0x1,this['isProcessing']=!0x0,this['contentArea']['isVisible']=!0x0,this['toolbar']['isVisible']=!0x0,this['contentArea']['focus']();}['finishProcessing'](){const _0x3178f2=this['locale'];this['isProcessing']=!0x1,this['prompt']='',this['promptView']['reset'](),this['value']&&(this['promptView']['queryView']['label']=Ni(_0x3178f2,'Ask\x20AI\x20to\x20improve\x20generated\x20text'));}['handleError'](_0x5e4be0){const _0x14f928=this['locale'];this['finishProcessing'](),this['isError']=!0x0,this['errorView']['text']=_0x5e4be0||Ni(_0x14f928,'AI_ERROR_FAILED'),this['value']||(this['contentArea']['isVisible']=!0x1);}}const $i=globalThis['DataTransfer'];class qi extends _0x4210c9{['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[_0xb18b54,Ri,Oi,Vt];}constructor(_0x2bd39c){super(_0x2bd39c),_0x2bd39c['config']['define']('ai.assistant.disabledElements',['media','rawHtml','tableOfContents']),_0x2bd39c['config']['define']('ai.assistant.contentAreaCssClass',''),_0x2bd39c['config']['define']('ai.assistant.useTheme',!0x0),this['_uiCssClasses']='ck-ai-assistant-ui'+(_0x2bd39c['config']['get']('ai.assistant.useTheme')?'\x20ck-ai-assistant-ui_theme':'');}['init'](){const {editor:_0x54fa8d}=this;this['_aiAdapter']=_0x54fa8d['plugins']['get'](Oi),this['_dialog']=_0x54fa8d['plugins']['get'](Vt),this['_formView']=null,this['_commandDefinitions']=this['_getResolvedCommandsDefinitions']();const _0x49a16b=new vi(_0x54fa8d,Array['from'](this['_commandDefinitions']['values']()));_0x54fa8d['commands']['add']('showAIAssistant',_0x49a16b),_0x54fa8d['ui']['componentFactory']['add']('aiCommands',_0x3b84be=>{const _0x1612de=Bt(_0x3b84be);return _0x1612de['set']({'class':'ck-ai-commands-dropdown\x20'+this['_uiCssClasses']}),_0x1612de['buttonView']['set']({'label':Ni(_0x3b84be,'AI\x20Commands'),'icon':_0x3d12d0,'tooltip':!0x0}),_0x1612de['on']('execute',_0x54c980=>this['_onExecute'](_0x54c980['source']['id'])),Gt(_0x1612de,_0x54fa8d['ui']['view']['body'],function(_0x5131f7){const _0x4c2849=fi(_0x5131f7['config']['get']('ai.assistant.commands'),_0x5131f7['locale']),_0x53116f=Xi(_0x5131f7,_0x4c2849)['filter'](_0x69a68d=>_0x69a68d['commands']['length']);if(0x1===_0x53116f['length'])return Xi(_0x5131f7,_0x53116f[0x0]['commands'])['map'](_0x498f94=>({'id':_0x498f94['id'],'label':_0x498f94['label']}));return _0x53116f['map'](_0x3c5657=>{const {groupId:_0x1f47cb,groupLabel:_0x3f92fd,commands:_0x5f2f37}=_0x3c5657,_0x1376a7=Xi(_0x5131f7,_0x5f2f37)['map'](_0x17fd05=>({'id':_0x17fd05['id'],'label':_0x17fd05['label']}));return{'id':_0x1f47cb,'menu':_0x3f92fd||_0x1f47cb,'children':_0x1376a7};});}(_0x54fa8d),{'ariaLabel':Ni(_0x3b84be,'AI\x20Commands')}),_0x1612de['menuView']['menuPanelClass']='ck-ai-commands-dropdown\x20'+this['_uiCssClasses'],_0x49a16b['on']('change:enabledCommandsIds',_0x1a4544),_0x1612de['menuView']['once']('render',_0x1a4544),_0x1612de;function _0x1a4544(){_0x1612de['isEnabled']=_0x49a16b['enabledCommandsIds']['length']>0x0;for(const _0x264dec of _0x1612de['menuView']['buttons'])_0x264dec['isEnabled']=_0x49a16b['enabledCommandsIds']['includes'](_0x264dec['id']);}}),_0x54fa8d['ui']['componentFactory']['add']('menuBar:aiCommands',_0x4927e4=>{const _0xeeb804=new Ft(_0x4927e4);_0xeeb804['buttonView']['set']({'label':Ni(_0x4927e4,'AI\x20Commands'),'icon':_0x3d12d0}),_0xeeb804['bind']('isEnabled')['to'](_0x49a16b,'enabledCommandsIds',_0x53c4d2=>_0x53c4d2['length']>0x0);const _0xb87183=fi(_0x54fa8d['config']['get']('ai.assistant.commands'),_0x4927e4);return this['_populateMenuBarMenu'](_0x49a16b,_0xeeb804,_0xb87183,_0x23f5d9=>this['_onExecute'](_0x23f5d9)),_0xeeb804;}),_0x54fa8d['ui']['componentFactory']['add']('aiAssistant',()=>{const _0x249e09=this['_createAIAssistantUIButton'](kt);return _0x249e09['set']({'tooltip':!0x0,'class':'ck-ai-assistant-button\x20'+this['_uiCssClasses']}),_0x249e09;}),_0x54fa8d['ui']['componentFactory']['add']('menuBar:aiAssistant',()=>{const _0x121df0=this['_createAIAssistantUIButton'](Kt);return _0x121df0['set']({'role':'menuitemcheckbox'}),_0x121df0;}),this['licenseKey']=this['editor']['config']['get']('licenseKey');const _0x5028e9=this['editor'];this['_licenseKeyCheckInterval']=setInterval(()=>{let _0x9f679f;for(const _0x1284ec in _0x5028e9){const _0x48e2b3=_0x1284ec,_0x3d5d10=_0x5028e9[_0x48e2b3];if('aiLicenseKeyValid'==_0x3d5d10||'aiLicenseKeyInvalid'==_0x3d5d10||'aiLicenseKeyExpired'==_0x3d5d10||'aiLicenseKeyDomainLimit'==_0x3d5d10||'aiLicenseKeyNotAllowed'==_0x3d5d10||'aiLicenseKeyEvaluationLimit'==_0x3d5d10||'aiLicenseKeyUsageLimit'==_0x3d5d10){delete _0x5028e9[_0x48e2b3],_0x9f679f=_0x3d5d10,clearInterval(this['_licenseKeyCheckInterval']),this['_licenseKeyCheckInterval']=void 0x0;break;}}'aiLicenseKeyInvalid'==_0x9f679f&&_0x5028e9['_showLicenseError']('invalid'),'aiLicenseKeyExpired'==_0x9f679f&&_0x5028e9['_showLicenseError']('expired'),'aiLicenseKeyDomainLimit'==_0x9f679f&&_0x5028e9['_showLicenseError']('domainLimit'),'aiLicenseKeyNotAllowed'==_0x9f679f&&_0x5028e9['_showLicenseError']('featureNotAllowed','AIAssistant'),'aiLicenseKeyEvaluationLimit'==_0x9f679f&&_0x5028e9['_showLicenseError']('evaluationLimit'),'aiLicenseKeyUsageLimit'==_0x9f679f&&_0x5028e9['_showLicenseError']('usageLimit');},0x3e8);}['destroy'](){super['destroy'](),this['_licenseKeyCheckInterval']&&clearInterval(this['_licenseKeyCheckInterval']);}['showUI'](_0x1123eb='',_0x3b46be='',_0x510146='custom'){const _0x47f8d5=this['editor'],_0x4a855d=_0x47f8d5['editing']['view'],_0xe4759e=_0x47f8d5['plugins']['get'](Ri),_0x30f5b3=_0x47f8d5['plugins']['get'](_0xb18b54);_0xe4759e['showFakeVisualSelection']();const _0x55b810=new $i(),_0x21b380=new ClipboardEvent('copy',{'clipboardData':_0x55b810}),_0x46ad86=new _0x4e2945(_0x55b810),_0x27fa85=new _0x17def6(_0x4a855d,_0x21b380,{'dataTransfer':_0x46ad86});_0x30f5b3['_forceMarkersCopy']('comment',()=>{_0x4a855d['document']['fire']('copy',_0x27fa85);}),this['_formView']||(this['_initView'](),this['_aiAssistantController']=new Li(_0x47f8d5,this['_aiAdapter']['textAdapter'],this['_formView']));let _0x25b268=_0x46ad86['getData']('text/html');const _0x22baae=_0x47f8d5['model']['document']['selection'],_0x244f97=Array['from'](_0x22baae['getRanges']());0x1===_0x244f97['length']&&_0x244f97[0x0]['isFlat']&&!_0x22baae['getSelectedElement']()&&''!==_0x25b268['replace'](/ /g,'')['trim']()&&(_0x25b268='<p>'+_0x25b268+'</p>'),this['_aiAssistantController']['updateView']({'actionId':_0x510146,'query':_0x1123eb,'htmlContent':_0x25b268,'label':_0x3b46be,'mainActionLabel':Di[_0x47f8d5['model']['document']['selection']['isCollapsed']?'INSERT':'REPLACE']}),'aiAssistant'!==this['_dialog']['id']?this['_dialog']['show']({'id':'aiAssistant','icon':_0x2d49ff,'title':Ni(this['editor']['locale'],'AI\x20Assistant'),'content':this['_formView'],'position':Wt['EDITOR_TOP_SIDE'],'onShow':()=>{this['_formView']['focus']();},'onHide':()=>{this['_aiAssistantController']['reset'](),_0xe4759e['hideFakeVisualSelection']();}}):this['_dialog']['view']['wasMoved']||this['_dialog']['view']['updatePosition']();}['hideUI'](){this['_dialog']['hide']();}['_getResolvedCommandsDefinitions'](){const _0x462702=new Map(),_0x124a42=fi(this['editor']['config']['get']('ai.assistant.commands'),this['editor']['locale']);for(const _0x5ebd59 of _0x124a42)for(const _0x187f16 of _0x5ebd59['commands'])_0x462702['set'](_0x187f16['id'],{..._0x187f16,'groupId':_0x5ebd59['groupId'],'groupLabel':_0x5ebd59['groupLabel']||_0x5ebd59['groupId']});return _0x462702;}['_createAIAssistantUIButton'](_0x28a08a){const _0x401fac=this['editor'],_0x2fa8be=_0x401fac['commands']['get']('showAIAssistant'),_0x24375b=new _0x28a08a(_0x401fac['locale']);return _0x24375b['set']({'label':Ni(_0x401fac['locale'],'AI\x20Assistant'),'icon':_0x2d49ff,'isToggleable':!0x0}),_0x24375b['bind']('isEnabled')['to'](_0x2fa8be),_0x24375b['bind']('isOn')['to'](this['_dialog'],'id',_0x402861=>'aiAssistant'===_0x402861),this['listenTo'](_0x24375b,'execute',()=>{_0x24375b['isOn']?this['hideUI']():_0x2fa8be['execute']();}),_0x24375b;}['_initView'](){const _0x57586d=this['editor']['plugins']['get'](Ri);this['_formView']=new Yi(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',()=>{_0x57586d['insertContent'](this['_aiAssistantController']['currentContext']),this['hideUI']();}),this['listenTo'](this['_formView'],'insertContentBelow',()=>{_0x57586d['insertContentBelow'](this['_aiAssistantController']['currentContext']),this['hideUI']();}),this['_initAriaAiStatusChangeAnnouncements']();}['_initAriaAiStatusChangeAnnouncements'](){const {locale:_0x3c9670,ui:{ariaLiveAnnouncer:_0x1d55ed}}=this['editor'];this['_formView']['contentArea']['on']('change:isProcessing',(_0x3be819,_0x5156ba,_0x208488)=>{const _0xac7481=this['_aiAssistantController']['currentContext'];_0x208488?_0x1d55ed['announce'](Ni(_0x3c9670,'AI\x20is\x20writing')):_0xac7481&&_0x1d55ed['announce'](Ni(_0x3c9670,'Generated\x20content:\x20%0',_0xac7481),{'politeness':'polite','isUnsafeHTML':!0x0});}),this['_formView']['on']('change:isError',(_0x115599,_0x35e472,_0x3877b0)=>{if(_0x3877b0){const _0x157b3b=this['_formView']['errorView']['text'];_0x1d55ed['announce'](Ni(_0x3c9670,'Error\x20during\x20AI\x20content\x20generation:\x20%0',_0x157b3b));}});}['_onExecute'](_0x3346b6){const _0x3d470c=this['_commandDefinitions']['get'](_0x3346b6),_0x3c50e2=this['editor'],_0x5b90fd=_0x3c50e2['model']['document']['selection'],_0x4b9570=_0x3c50e2['commands']['get']('showAIAssistant'),_0x4b0b31=_0x3c50e2['plugins']['get'](Ri),_0x10b203=''+(_0x3d470c['groupId']!==wi?_0x3d470c['groupLabel']+':\x20':'')+_0x3d470c['label'];if(!0x1!==_0x3d470c['requiresContent']&&_0x5b90fd['isCollapsed']){const _0x1ade6a=gt(_0x5b90fd['getSelectedBlocks']())||_0x3c50e2['model']['schema']['getLimitElement'](_0x5b90fd);_0x3c50e2['model']['change'](_0x94dcb9=>{_0x94dcb9['setSelection'](_0x1ade6a,'in');});}_0x4b0b31['showFakeVisualSelection'](),_0x4b9570['execute'](_0x3d470c['prompt'],_0x10b203,'command:'+_0x3346b6);}['_populateMenuBarMenu'](_0x281ba8,_0x5f871d,_0x536fb5,_0x40320f){const _0x3225af=this['editor'],_0x29c627=_0x3225af['locale'],_0x21186e=new Yt(_0x29c627),_0xff2255=Xi(_0x3225af,_0x536fb5)['filter'](_0x487f39=>_0x487f39['commands']['length']);0x1===_0xff2255['length']?this['_getMenuBarGroupButtons']({'command':_0x281ba8,'commands':_0xff2255[0x0]['commands'],'parentMenuView':_0x5f871d,'onExecute':_0x40320f})['forEach'](_0x3ebf63=>_0x21186e['items']['add'](_0x3ebf63)):_0xff2255['forEach'](({groupId:_0x56e0d8,groupLabel:_0x38cf0e,commands:_0x210e67})=>{const _0x36ad28=new $t(_0x29c627,_0x5f871d),_0x3306b0=new Ft(_0x29c627),_0x46bc52=new Yt(_0x29c627),_0x430348=this['_getMenuBarGroupButtons']({'command':_0x281ba8,'commands':_0x210e67,'parentMenuView':_0x3306b0,'onExecute':_0x40320f});_0x3306b0['buttonView']['set']({'label':_0x38cf0e||_0x56e0d8}),_0x3306b0['delegate']('execute')['to'](_0x5f871d),_0x46bc52['items']['addMany'](_0x430348),_0x3306b0['panelView']['children']['add'](_0x46bc52),_0x36ad28['children']['add'](_0x3306b0),_0x21186e['items']['add'](_0x36ad28);}),_0x5f871d['panelView']['children']['add'](_0x21186e);}['_getMenuBarGroupButtons']({command:_0x3b0ee6,commands:_0x39e81b,parentMenuView:_0x4ea723,onExecute:_0x4ecc69}){const _0x2e2859=this['editor'],_0x1f3012=_0x2e2859['locale'];return Xi(_0x2e2859,_0x39e81b)['map'](_0x43917c=>{const _0x4f8f49=new $t(_0x1f3012,_0x4ea723),_0x204589=new Kt(_0x1f3012);return _0x204589['set']({'label':_0x43917c['label']}),_0x204589['delegate']('execute')['to'](_0x4ea723),_0x204589['on']('execute',()=>_0x4ecc69(_0x43917c['id'])),_0x204589['bind']('isEnabled')['to'](_0x3b0ee6,'enabledCommandsIds',_0x8774ff=>_0x8774ff['includes'](_0x43917c['id'])),_0x4f8f49['children']['add'](_0x204589),_0x4f8f49;});}}function Qi(_0x2bca07,_0x1f3d51){return void 0x0!==_0x2bca07['order']&&void 0x0===_0x1f3d51['order']?0x1:void 0x0===_0x2bca07['order']&&void 0x0!==_0x1f3d51['order']?-0x1:void 0x0!==_0x2bca07['order']&&void 0x0!==_0x1f3d51['order']?_0x2bca07['order']-_0x1f3d51['order']:0x0;}function Xi(_0x256d5d,_0x1861ae){_0x1861ae['sort'](Qi);const _0x16fa0d={},_0xf77df3=[];for(const _0x42c843 of _0x1861ae)if(void 0x0!==_0x42c843['order']){if(_0x42c843['order']in _0x16fa0d)throw new ot('ai-commands-config-order-collision',_0x256d5d,{'conflictingDefinitions':[_0x42c843,_0x16fa0d[_0x42c843['order']]]});_0x16fa0d[_0x42c843['order']]=_0x42c843,_0xf77df3['splice'](_0x42c843['order'],0x0,_0x42c843);}else _0xf77df3['push'](_0x42c843);return _0xf77df3;}class zi extends _0x4210c9{static get['requires'](){return[qi,Ri];}static get['pluginName'](){return'AIAssistant';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x447823){super(_0x447823);const _0x1a880a=_0x447823['config'],_0x5a0485=_0x447823['locale'];_0x1a880a['define']('ai.assistant.preserveComments',!0x0),_0x1a880a['define']('ai.assistant.commands',ji(_0x5a0485)),_0x1a880a['define']('ai.assistant.extraCommandGroups',[]),_0x1a880a['define']('ai.assistant.removeCommands',[]);let _0x2cd088=fi(_0x1a880a['get']('ai.assistant.commands'),_0x5a0485);const _0x3b6097=_0x1a880a['get']('ai.assistant.extraCommandGroups'),_0x5d33ea=_0x1a880a['get']('ai.assistant.removeCommands');_0x3b6097['forEach'](_0xb8a40f=>{const _0x21b526=_0x2cd088['find'](_0x19c1f3=>_0x19c1f3['groupId']===_0xb8a40f['groupId']);_0x21b526?_0x21b526['commands']=_0x21b526['commands']['concat'](_0xb8a40f['commands']):_0x2cd088['push'](_0xb8a40f);}),_0x2cd088=_0x2cd088['filter'](_0x5146be=>!_0x5d33ea['includes'](_0x5146be['groupId'])),_0x2cd088['forEach'](_0xfb2b7c=>{_0xfb2b7c['commands']=_0xfb2b7c['commands']['filter'](_0x56c5fe=>!_0x5d33ea['includes'](_0x56c5fe['id']));}),_0x1a880a['set']('ai.assistant.commands',_0x2cd088);}}function ji(_0x4392ac){return[{'groupId':'editOrReview','groupLabel':Ni(_0x4392ac,'Edit\x20or\x20review'),'commands':[{'id':'improveWriting','label':Ni(_0x4392ac,'Improve\x20writing'),'prompt':'Fix\x20spelling\x20mistakes,\x20use\x20proper\x20grammar\x20and\x20apply\x20good\x20writing\x20practices.\x20Do\x20not\x20lose\x20the\x20original\x20meaning.'},{'id':'makeShorter','label':Ni(_0x4392ac,'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':Ni(_0x4392ac,'Make\x20longer'),'prompt':'Improve\x20this\x20content\x20by\x20using\x20descriptive\x20language\x20and\x20inserting\x20more\x20information\x20and\x20more\x20detailed\x20explanations.'},{'id':'simplifyLanguage','label':Ni(_0x4392ac,'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':Ni(_0x4392ac,'Generate\x20from\x20selection'),'commands':[{'id':'summarize','label':Ni(_0x4392ac,'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':Ni(_0x4392ac,'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':Ni(_0x4392ac,'Change\x20tone'),'commands':[{'id':'professional','label':Ni(_0x4392ac,'Professional'),'prompt':'Improve\x20using\x20polished,\x20formal,\x20and\x20respectful\x20language\x20to\x20convey\x20professional\x20expertise\x20and\x20competence.'},{'id':'casual','label':Ni(_0x4392ac,'Casual'),'prompt':'Improve\x20using\x20casual,\x20informal\x20language\x20to\x20convey\x20a\x20casual\x20conversation\x20with\x20a\x20real\x20person.'},{'id':'direct','label':Ni(_0x4392ac,'Direct'),'prompt':'Improve\x20using\x20direct\x20language,\x20using\x20only\x20the\x20essential\x20information.'},{'id':'confident','label':Ni(_0x4392ac,'Confident'),'prompt':'Improve\x20using\x20compelling,\x20optimistic\x20language\x20to\x20convey\x20confidence\x20in\x20the\x20writing.'},{'id':'friendly','label':Ni(_0x4392ac,'Friendly'),'prompt':'Improve\x20using\x20friendly,\x20comforting\x20language,\x20to\x20convey\x20understanding\x20and\x20empathy.'}]},{'groupId':'changeStyle','groupLabel':Ni(_0x4392ac,'Change\x20style'),'commands':[{'id':'business','label':Ni(_0x4392ac,'Business'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20business\x20professional\x20with\x20formal\x20language.'},{'id':'legal','label':Ni(_0x4392ac,'Legal'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20legal\x20professional\x20using\x20valid\x20legal\x20terminology.'},{'id':'journalism','label':Ni(_0x4392ac,'Journalism'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20journalist\x20using\x20engaging\x20language\x20to\x20convey\x20the\x20importance\x20of\x20the\x20information.'},{'id':'poetic','label':Ni(_0x4392ac,'Poetic'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20poem\x20using\x20poetic\x20techniques\x20without\x20losing\x20the\x20original\x20meaning.'}]},{'groupId':'translate','groupLabel':Ni(_0x4392ac,'Translate'),'commands':[{'id':'translateEnglish','label':Ni(_0x4392ac,'English'),'prompt':'Translate\x20the\x20content\x20to\x20English\x20language.'},{'id':'translateSpanish','label':Ni(_0x4392ac,'Spanish'),'prompt':'Translate\x20the\x20content\x20to\x20Spanish\x20language.'},{'id':'translatePortuguese','label':Ni(_0x4392ac,'Portuguese'),'prompt':'Translate\x20the\x20content\x20to\x20Portuguese\x20language.'},{'id':'translateGerman','label':Ni(_0x4392ac,'German'),'prompt':'Translate\x20the\x20content\x20to\x20German\x20language.'},{'id':'translateFrench','label':Ni(_0x4392ac,'French'),'prompt':'Translate\x20the\x20content\x20to\x20French\x20language.'},{'id':'translateChinese','label':Ni(_0x4392ac,'Simplified\x20Chinese'),'prompt':'Translate\x20the\x20content\x20to\x20Simplified\x20Chinese\x20language.'},{'id':'translateHindi','label':Ni(_0x4392ac,'Hindi'),'prompt':'Translate\x20the\x20content\x20to\x20Hindi\x20language.'},{'id':'translateArabic','label':Ni(_0x4392ac,'Arabic'),'prompt':'Translate\x20the\x20content\x20to\x20Arabic\x20language.'}]}];}class Ji extends _0x4210c9{['abortController'];static get['requires'](){return[Oi];}constructor(_0x58017c){super(_0x58017c),this['abortController']=new AbortController();}['init'](){this['editor']['plugins']['get'](Oi)['textAdapter']=this;}['abort'](){this['abortController']['signal']['aborted']||(this['abortController']['abort'](),this['abortController']=new AbortController());}async['makeRequest'](_0x478c6b){return this['sendRequest'](_0x478c6b)['catch'](_0x1e1339=>{if(_0x1e1339 instanceof ki)return Promise['reject'](_0x1e1339);if('AbortError'==_0x1e1339['name'])return Promise['resolve']();throw console['error'](_0x1e1339),new ot('aitextadapter-send-request-failed',null);});}async['_prepareRequestHeaders'](_0x317f1a,_0x1c865b){const _0x45a8f4=this['editor']['locale'],_0x5970ca={'Content-Type':'application/json'};if('object'==typeof _0x317f1a)Object['assign'](_0x5970ca,_0x317f1a);else{if(_0x317f1a)try{const _0x54b238=await _0x317f1a(_0x1c865b);Object['assign'](_0x5970ca,_0x54b238);}catch{return Promise['reject'](new ki(Ni(_0x45a8f4,'AI_ERROR_GET_HEADERS')));}}return _0x5970ca;}async['_prepareRequestParameters'](_0x5a946b,_0x48599a){const _0x5484bf=this['editor']['locale'];if('object'==typeof _0x5a946b)return _0x5a946b;try{return await _0x5a946b(_0x48599a);}catch{return Promise['reject'](new ki(Ni(_0x5484bf,'AI_ERROR_GET_PARAMETERS')));}}}class Zi extends Ji{['_apiUrl'];['_requestHeaders'];['_requestParameters'];static get['pluginName'](){return'OpenAITextAdapter';}constructor(_0x5ad2c8){super(_0x5ad2c8),_0x5ad2c8['config']['define']('ai.assistant.adapter.openAI.apiUrl','https://api.openai.com/v1/chat/completions'),_0x5ad2c8['config']['get']('ai.assistant.adapter.openAI.requestParameters')||_0x5ad2c8['config']['define']('ai.assistant.adapter.openAI.requestParameters',{'model':'gpt-4o','temperature':0x1,'top_p':0x1,'stream':!0x0}),this['_apiUrl']=_0x5ad2c8['config']['get']('ai.assistant.adapter.openAI.apiUrl'),this['_requestHeaders']=_0x5ad2c8['config']['get']('ai.assistant.adapter.openAI.requestHeaders')||{},this['_requestParameters']=_0x5ad2c8['config']['get']('ai.assistant.adapter.openAI.requestParameters');}async['sendRequest']({query:_0x3d12df,context:_0x1d5804,onData:_0x5f324e,actionId:_0x566ec8}){const _0xbb4440=this['editor']['locale'],_0x605f66=await this['prepareMessages'](_0x3d12df,_0x1d5804,_0x566ec8),_0x5c90d8=await this['_prepareRequestHeaders'](this['_requestHeaders'],_0x566ec8),_0x41c54e=await this['_prepareRequestParameters'](this['_requestParameters'],_0x566ec8),_0x3398c1={'messages':_0x605f66,..._0x41c54e},_0x350d26={'method':'POST','headers':_0x5c90d8,'body':JSON['stringify'](_0x3398c1),'signal':this['abortController']['signal']},_0x18f20c=await fetch(this['_apiUrl'],_0x350d26);if(_0x18f20c['ok'])return _0x41c54e['stream']?await this['_readStreamableResponse'](_0x18f20c,_0x5f324e):await this['_readStaticResponse'](_0x18f20c,_0x5f324e),Promise['resolve']();{const _0x3dbb2f=await _0x18f20c['text']();return _0x3dbb2f['includes']('context_length_exceeded')?Promise['reject'](new ki(Ni(_0xbb4440,'AI_ERROR_CONTEXT_LENGTH'))):_0x3dbb2f['includes']('Moderation')?Promise['reject'](new ki(Ni(_0xbb4440,'AI_ERROR_MODERATION'))):Promise['reject'](new Error(_0x3dbb2f));}}async['prepareMessages'](_0x3a5a15,_0x3a7d86,_0x33e00c){let _0x5f412a,_0x2df7b5;return _0x3a7d86?(_0x5f412a='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.',_0x2df7b5='Instruction:\x0a'+_0x3a5a15+'\x0aYou\x20must\x20keep\x20the\x20text\x20formatting.\x0a\x0aContent:\x0a'+_0x3a7d86):(_0x5f412a='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.',_0x2df7b5=_0x3a5a15),[{'role':'system','content':_0x5f412a},{'role':'user','content':_0x2df7b5}];}async['_readStreamableResponse'](_0x4ddf92,_0xc33219){const _0x3082f3=_0x4ddf92['body']['getReader'](),_0x247094=new TextDecoder();let _0x1397d5='',_0x335fdb='',_0xfa42ec='',_0x6e0fd8=!0x1;for(;!_0x6e0fd8;){const {done:_0x231b7f,value:_0x39b37d}=await _0x3082f3['read'](),_0x51efb8=_0x1397d5+_0x247094['decode'](_0x39b37d);let _0x31b5bb='';_0x6e0fd8=_0x231b7f;try{_0x31b5bb=this['_cleanUpData'](_0x51efb8),_0x1397d5='';}catch{_0x1397d5=_0x51efb8;continue;}_0x335fdb+=_0x31b5bb,!_0x6e0fd8&&this['_isBufferIncomplete'](_0x335fdb)||_0x335fdb&&(_0xfa42ec+=_0x335fdb,_0x335fdb='',_0xc33219(_0xfa42ec));}return Promise['resolve']();}async['_readStaticResponse'](_0x34bd46,_0x291737){return _0x291737((await _0x34bd46['json']())['choices'][0x0]['message']['content']),Promise['resolve']();}['_isBufferIncomplete'](_0x7f212a){const _0xfec6d5=_0x7f212a['split']('<')['length']!==_0x7f212a['split']('>')['length'],_0x2d15be=_0x7f212a['length']<0x1e;return _0xfec6d5&&_0x2d15be;}['_cleanUpData'](_0x5050bf){return _0x5050bf['split'](/\n(?![^{]*\})/g)['map'](_0x582c29=>_0x582c29['replace']('data:\x20',''))['filter'](_0x35d84c=>_0x35d84c&&_0x35d84c['length']>0x0&&'[DONE]'!==_0x35d84c)['map'](_0x30aba3=>{const {choices:_0x143c18}=JSON['parse'](_0x30aba3);if(_0x143c18[0x0]?.['delta']?.['content'])return _0x143c18[0x0]['delta']['content'];})['filter'](_0x2d9788=>_0x2d9788)['join']('');}}class ts extends Ji{['_apiUrl'];['_requestHeaders'];['_bedrockClientConfig'];['_requestParameters'];static get['pluginName'](){return'AWSTextAdapter';}constructor(_0x473119){super(_0x473119),_0x473119['config']['get']('ai.assistant.adapter.aws.requestParameters')||_0x473119['config']['define']('ai.assistant.adapter.aws.requestParameters',{'model':'anthropic.claude-v2','max_tokens_to_sample':0x7d0,'temperature':0x1,'top_p':0x1,'top_k':0xfa,'anthropic_version':'bedrock-2023-05-31','stream':!0x0}),this['_apiUrl']=_0x473119['config']['get']('ai.assistant.adapter.aws.apiUrl'),this['_bedrockClientConfig']=_0x473119['config']['get']('ai.assistant.adapter.aws.bedrockClientConfig'),this['_requestHeaders']=_0x473119['config']['get']('ai.assistant.adapter.aws.requestHeaders'),this['_requestParameters']=_0x473119['config']['get']('ai.assistant.adapter.aws.requestParameters');}async['sendRequest']({query:_0x1a6bed,context:_0x3060f8,onData:_0xa9234e,actionId:_0x45ac62}){const {model:_0x4f179a,stream:_0x231dea,..._0x4e9191}=await this['_prepareRequestParameters'](this['_requestParameters'],_0x45ac62),_0x4b9eee={'prompt':await this['preparePrompt'](_0x1a6bed,_0x3060f8,_0x4f179a,_0x45ac62),..._0x4e9191};this['_apiUrl']?await this['_processProxyRequest'](_0x4b9eee,_0x4f179a,_0x231dea,_0xa9234e,_0x45ac62):await this['_processAWSRequest'](_0x4b9eee,_0x4f179a,_0x231dea,_0xa9234e);}async['preparePrompt'](_0x59bed0,_0x4dfa52,_0x330d4d,_0x4ab61f){let _0x4a84e7,_0x2b16a3;return _0x4dfa52?(_0x4a84e7='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.',_0x2b16a3='Instruction:\x0a'+_0x59bed0+'\x0aYou\x20must\x20keep\x20the\x20text\x20formatting.\x0a\x0aContent:\x0a'+_0x4dfa52):(_0x4a84e7='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.',_0x2b16a3=_0x59bed0),'meta.llama'==this['getModelFamily'](_0x330d4d)?'<<SYS>>\x0a'+_0x4a84e7+'\x0a<</SYS>>\x0a[INST]\x0a'+_0x2b16a3+'\x0a[/INST]':'Human:\x0a'+_0x4a84e7+'\x0a'+_0x2b16a3+'\x0a\x0aAssistant:';}['getModelFamily'](_0x272c30){if(/^anthropic\.claude/['test'](_0x272c30))return'anthropic.claude';if(/^ai21\.j2/['test'](_0x272c30))return'ai21.j2';if(/^cohere\.command/['test'](_0x272c30))return'cohere.command';if(/^meta\.llama/['test'](_0x272c30))return'meta.llama';throw new ki(Ni(this['editor']['locale'],'AI_ERROR_UNSUPPORTED_MODEL',_0x272c30));}async['_processProxyRequest'](_0x1a11fa,_0x56d106,_0x1dafec,_0x7bab7a,_0xda9509){const _0x33e9a2={'method':'POST','headers':await this['_prepareRequestHeaders'](this['_requestHeaders'],_0xda9509),'body':JSON['stringify']({..._0x1a11fa,'model':_0x56d106,'stream':_0x1dafec}),'signal':this['abortController']['signal']},_0x4bad3f=await fetch(this['_apiUrl'],_0x33e9a2);_0x1dafec?await this['_readStreamableResponse'](_0x4bad3f,_0x56d106,_0x7bab7a):await this['_readStaticResponse'](_0x4bad3f,_0x56d106,_0x7bab7a);}async['_processAWSRequest'](_0x4aa588,_0xaeefc,_0x1664b2,_0x332c6f){const _0x39219a=new _0x47ddb2(this['_bedrockClientConfig']),_0x487623={'body':JSON['stringify'](_0x4aa588),'contentType':'application/json','accept':'application/json','modelId':_0xaeefc};let _0x2a9e58;if(_0x1664b2){const _0x2be3e0=new _0x4220bd(_0x487623);_0x2a9e58=await _0x39219a['send'](_0x2be3e0,{'abortSignal':this['abortController']['signal']}),await this['_readAsyncIterableResponse'](_0x2a9e58,_0xaeefc,_0x332c6f);}else{const _0x37e409=new _0x4b6602(_0x487623);_0x2a9e58=await _0x39219a['send'](_0x37e409,{'abortSignal':this['abortController']['signal']}),await this['_readStaticResponse'](_0x2a9e58,_0xaeefc,_0x332c6f);}}async['_readAsyncIterableResponse'](_0x295824,_0x93b98a,_0x5bca7b){const _0x597875=_0x295824['body'],_0x2328ae=new TextDecoder('utf-8');let _0x459dff='';for await(const _0x5a46a1 of _0x597875)if(_0x5a46a1['chunk']){const _0x3c2bb5=_0x2328ae['decode'](_0x5a46a1['chunk']['bytes']),_0x165eca=JSON['parse'](_0x3c2bb5);_0x459dff+=this['_getGeneratedText'](_0x165eca,_0x93b98a),_0x5bca7b(_0x459dff);}return Promise['resolve']();}async['_readStreamableResponse'](_0x4cb8ee,_0x5d07d5,_0xaa7325){const _0x2f073e=_0x4cb8ee['body'],_0x533ef7=new TextDecoder('utf-8'),_0x2d0225=_0x2f073e['getReader']();let _0x57810d='',_0x132fb7='',_0x3ab48e=!0x1;for(;!_0x3ab48e;){const {done:_0x10e7d8,value:_0x56bba5}=await _0x2d0225['read']();if(_0x3ab48e=_0x10e7d8,_0x3ab48e)break;const _0x59cd52=(_0x57810d+_0x533ef7['decode'](_0x56bba5))['split']('\x0a')['map'](_0x2f05fe=>{try{return _0x57810d='',JSON['parse'](_0x2f05fe);}catch{return _0x57810d=_0x2f05fe,null;}})['filter'](_0x1e51b2=>null!==_0x1e51b2);_0x59cd52['length']&&(_0x132fb7+=_0x59cd52['map'](_0x471a20=>this['_getGeneratedText'](_0x471a20,_0x5d07d5))['join'](''),_0xaa7325(_0x132fb7));}return Promise['resolve']();}async['_readStaticResponse'](_0x356260,_0x393ae6,_0x453026){let _0x878e2d;return _0x878e2d=_0x356260 instanceof Response?await _0x356260['json']():JSON['parse'](new TextDecoder('utf-8')['decode'](_0x356260['body'])),(_0x453026(this['_getGeneratedText'](_0x878e2d,_0x393ae6)),Promise['resolve']());}['_getGeneratedText'](_0x5487bd,_0x8844b9){switch(this['getModelFamily'](_0x8844b9)){case'anthropic.claude':return _0x5487bd['completion'];case'ai21.j2':return _0x5487bd['completions'][0x0]['data']['text'];case'cohere.command':return _0x5487bd['generations'][0x0]['text'];case'meta.llama':return _0x5487bd['generation'];}}}class es extends kt{constructor(_0xbd3c7f,_0x4d3a3e={}){super(_0xbd3c7f),this['isToggleable']=!0x0,this['set']('side',_0x4d3a3e['side']||'top');const _0x2a58ef=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':['ck-tab-button',...It(_0x4d3a3e['class']||[]),_0x2a58ef['to']('side',_0x16fda3=>'ck-tab-button_'+_0x16fda3),_0x2a58ef['to']('class')]}});}['show'](){this['set']('isVisible',!0x0);}['hide'](){this['set']('isVisible',!0x1);}}class is extends Nt{['children'];constructor(_0x1879a3,_0x1b9744={}){super(_0x1879a3);const _0x33d369=this['bindTemplate'];this['set']('isVisible',!0x1),this['set']('class',''),this['children']=this['createCollection'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck-tab-panel',...It(_0x1b9744['class']||[]),_0x33d369['to']('class'),_0x33d369['if']('isVisible','ck-hidden',_0x1930f6=>!_0x1930f6)]},'children':this['children']});}['show'](){this['set']('isVisible',!0x0);}['hide'](){this['set']('isVisible',!0x1);}}class ss extends Nt{['buttonViews']=this['createCollection']();['panelViews']=this['createCollection']();['_tabs']=new Map();constructor(_0x2e1a64,_0x472883={}){super(_0x2e1a64),this['set']('class',void 0x0),this['set']('activeTab',null),this['set']('side',_0x472883['side']||'top'),this['set']('isMaximized',!0x1);const _0x3986b2=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset','ck-tabs',...It(_0x472883['class']||[]),_0x3986b2['to']('side',_0x588e11=>'ck-tabs_'+_0x588e11),_0x3986b2['to']('class'),_0x3986b2['to']('isMaximized',_0x18d678=>_0x18d678?'ck-ai-tabs_maximized':'')],'tabindex':'0'},'children':[{'tag':'div','attributes':{'class':['ck','ck-tabs__buttons-container',_0x3986b2['to']('side',_0x5d4aa3=>'ck-tabs__buttons-container_'+_0x5d4aa3)]},'children':this['buttonViews']},{'tag':'div','attributes':{'class':['ck','ck-tabs__panels-container',_0x3986b2['to']('side',_0x3c8661=>'ck-tabs__panels-container_'+_0x3c8661)]},'children':this['panelViews']},...It(_0x472883['children']||[])]});}['getTabIds'](){return[...this['_tabs']['keys']()];}['getTab'](_0x6345e3){const _0x4f127c=this['_tabs']['get'](_0x6345e3);return _0x4f127c||null;}['addTab'](_0x4a390d){const _0x2952e2=this['_setupButton']({'id':_0x4a390d['id'],'label':_0x4a390d['buttonLabel'],'icon':_0x4a390d['buttonIcon'],'order':_0x4a390d['order']}),_0x15631a=new is(this['locale']);return _0x15631a['render'](),_0x4a390d['content']&&_0x15631a['children']['add'](_0x4a390d['content']),this['panelViews']['add'](_0x15631a),this['_tabs']['set'](_0x4a390d['id'],{'button':_0x2952e2,'panel':_0x15631a,'order':void 0x0!==_0x4a390d['order']?_0x4a390d['order']:null}),this['fire']('addTab:'+_0x4a390d['id'],{'id':_0x4a390d['id'],'button':_0x2952e2,'panel':_0x15631a}),null===this['activeTab']?this['activateTab'](_0x4a390d['id']):this['_hidePanel'](_0x4a390d['id']),{'button':_0x2952e2,'panel':_0x15631a};}['activateTab'](_0x4f75c7){if(null!==_0x4f75c7&&!this['getTab'](_0x4f75c7))throw new ot('ui-tabsview-tab-not-found',{'tabs':this,'tabId':_0x4f75c7});this['activeTab']!==_0x4f75c7&&(this['activeTab']&&this['_hidePanel'](this['activeTab']),this['activeTab']=_0x4f75c7,_0x4f75c7&&this['_showPanel'](_0x4f75c7),this['fire']('activateTab:'+_0x4f75c7,_0x4f75c7));}['showTab'](_0x4d254b){if(!this['getTab'](_0x4d254b))throw new ot('ui-tabsview-tab-not-found',{'tabs':this,'tabId':_0x4d254b});this['_showPanel'](_0x4d254b),this['_showButton'](_0x4d254b),this['fire']('show:'+_0x4d254b,_0x4d254b);}['hideTab'](_0x2ec273){if(!this['getTab'](_0x2ec273))throw new ot('ui-tabsview-tab-not-found',{'tabs':this,'tabId':_0x2ec273});const _0x22f6f0=this['activeTab'];this['_hidePanel'](_0x2ec273),this['_hideButton'](_0x2ec273);const _0x2918b1=this['getTabIds']();_0x22f6f0===_0x2ec273&&_0x2918b1['length']>0x1&&this['activateTab'](_0x2918b1['find'](_0xcd46ab=>_0xcd46ab!==_0x2ec273)),this['fire']('hide:'+_0x2ec273,_0x2ec273);}['_getPanel'](_0x1f8551){const _0xe15ca6=this['_tabs']['get'](_0x1f8551);return _0xe15ca6?_0xe15ca6['panel']:null;}['_showPanel'](_0x2ec4a5){null!==this['activeTab']&&this['activeTab']!==_0x2ec4a5||this['_getPanel'](_0x2ec4a5)['show']();}['_hidePanel'](_0x2e9341){const _0x2401a8=this['_getPanel'](_0x2e9341);_0x2401a8['isVisible']&&(this['activeTab']===_0x2e9341&&(this['activeTab']=null),_0x2401a8['hide']());}['_getButton'](_0x52d154){const _0xd7ee9a=this['_tabs']['get'](_0x52d154);return _0xd7ee9a?_0xd7ee9a['button']:null;}['_showButton'](_0x44faaf){this['_getButton'](_0x44faaf)['show']();}['_hideButton'](_0x17fdbe){this['_getButton'](_0x17fdbe)['hide']();}['_setupButton'](_0x16f28a){const _0xbb434e=new es(this['locale'],{'side':this['side']}),_0x324873=this['buttonViews'];if(_0xbb434e['set']({'label':_0x16f28a['label'],'icon':_0x16f28a['icon'],'tooltip':!0x0,'withText':!0x0}),_0xbb434e['bind']('isOn')['to'](this,'activeTab',_0x1f8901=>_0x1f8901===_0x16f28a['id']),_0xbb434e['bind']('side')['to'](this,'side'),_0x16f28a['order']){const _0xe9b1e9=[...this['_tabs']]['reduce']((_0xb2df06,_0x4c3f16)=>{const _0x4ce4ea=_0x4c3f16[0x0],{order:_0x187994}=_0x4c3f16[0x1];return!_0x187994||_0x187994>_0x16f28a['order']?_0xb2df06:_0x187994>=_0xb2df06['order']?{'id':_0x4ce4ea,'order':_0x187994}:_0xb2df06;},{'id':'','order':0x0}),_0x4c8ef2=_0x324873['getIndex'](this['_getButton'](_0xe9b1e9['id']));_0x324873['add'](_0xbb434e,_0x4c8ef2+0x1);}else _0x324873['add'](_0xbb434e);return _0xbb434e['on']('execute',()=>{this['activateTab'](_0x16f28a['id']);}),_0xbb434e;}}const ns=['overlay','sidebar','custom'],rs=['left','right'];class as extends ss{constructor(_0x445160,_0xf4b7a4={}){super(_0x445160,_0xf4b7a4),this['set']('type',_0xf4b7a4['type']||'sidebar'),this['set']('side',_0xf4b7a4['side']||'right'),this['set']('isVisible',_0xf4b7a4['visibleByDefault']??!0x0);const _0x59b243=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':['ck-ai-tabs',_0x59b243['if']('type','ck-ai-tabs__overlay',_0x3cfe5b=>'overlay'===_0x3cfe5b),_0x59b243['if']('type','ck-ai-tabs__sidebar',_0x5e6727=>'sidebar'===_0x5e6727),_0x59b243['if']('isVisible','ck-hidden',_0x298e71=>!_0x298e71)]}}),this['buttonViews']['on']('add',(_0x3633bd,_0x123455)=>{_0x123455['set']('withText',!0x1);});}}class os extends _0x31818a{['view'];['container']=null;['showResizeButton']=!0x0;static get['pluginName'](){return'AITabs';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x20c651){super(_0x20c651);const _0x356083=this['context']['config']['get']('ai.container');if(this['set']('side','right'),!_0x356083)throw new ot('ai-tabs-configuration-not-found');if(void 0x0!==_0x356083['showResizeButton']&&(this['showResizeButton']=_0x356083['showResizeButton']),'sidebar'!==_0x356083['type']&&'overlay'!==_0x356083['type']||_0x356083['side']&&(this['side']=_0x356083['side']),'sidebar'===_0x356083['type']){if(this['container']=_0x356083['element'],this['set']('type','sidebar'),!this['container'])throw new ot('ai-tabs-sidebar-container-element-not-found');}else'overlay'===_0x356083['type']?(this['container']=document['body'],this['set']('type','overlay')):(this['container']=null,this['set']('type','custom'));this['view']=new as(this['context']['locale'],{'side':this['side'],'type':this['type'],'visibleByDefault':void 0x0===_0x356083['visibleByDefault']||_0x356083['visibleByDefault']}),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 _0x25289c&&this['context']['ui']['focusTracker']['add'](this['view']['element']);}['switchType'](_0x568973){if(_0x568973&&this['type']!==_0x568973){if(!ns['includes'](_0x568973))throw new ot('ai-tabs-unsupported-ui-type');this['type']=_0x568973;}}['switchSide'](_0x507afc){if(_0x507afc&&this['side']!==_0x507afc){if(!rs['includes'](_0x507afc))throw new ot('ai-tabs-unsupported-ui-side');this['side']=_0x507afc;}}['resize'](){this['view']['isMaximized']=!this['view']['isMaximized'],this['fire']('resizedTabs',this['view']['isMaximized']);}['destroy'](){super['destroy'](),this['view']['destroy'](),this['view']['element']&&this['view']['element']['remove']();}}class hs extends _0x31818a{['_apiUrl'];['_token'];['_decoder'];['_responseCache'];static get['requires'](){return[_0x26c361];}static get['pluginName'](){return'AIConnector';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x2ba4ee){super(_0x2ba4ee),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 _0x8e5d53=this['context']['plugins']['get'](_0x26c361);if(!_0x8e5d53['token'])throw new ot('ai-missing-token',this);this['_token']=_0x8e5d53['token'];}['startConversation'](_0x163441,_0xc9ac8d){const _0x1db14b=this['_sendApiRequest']('/conversations','POST',{'id':_0x163441,'group':_0xc9ac8d});return{'getConversation':async()=>(await _0x1db14b['request'])['json'](),'abortController':_0x1db14b['abortController']};}['queryAssistant']({message:_0x4b42e1,conversationId:_0x16eab7,parts:_0x387eb9,capabilities:_0x4a420c,model:_0x274f23,attributes:_0x2890bb}){const _0x3efad2={'prompt':_0x4b42e1,'content':_0x387eb9,'model':_0x274f23,..._0x4a420c&&{'capabilities':_0x4a420c},..._0x2890bb&&{'attributes':_0x2890bb}},_0x4c38c3=this['_sendApiRequest']('/conversations/'+_0x16eab7+'/messages','POST',_0x3efad2);return{'getStream':async()=>{const _0x11db17=(await _0x4c38c3['request'])['body'];return this['_getStreamReader'](_0x11db17);},'abortController':_0x4c38c3['abortController']};}['executeCustomAction']({content:_0x1d45e1,message:_0x1a36ac,model:_0x164515,outputFormat:_0x5c6e1e}){const _0x18b903={'content':[{'type':'text','content':_0x1d45e1}],'prompt':_0x1a36ac,'model':_0x164515,'outputFormat':_0x5c6e1e},_0x36b1a5=this['_sendApiRequest']('/actions/custom/calls','POST',_0x18b903);return{'getStream':async()=>{const _0x4abdf4=(await _0x36b1a5['request'])['body'];return this['_getStreamReader'](_0x4abdf4);},'abortController':_0x36b1a5['abortController']};}['executeAction']({actionName:_0x1a154d,content:_0x3ffdac,args:_0x36e228}){const _0x5246a0={'content':[{'type':'text','content':_0x3ffdac}],'args':_0x36e228},_0x1a4d78=this['_sendApiRequest']('/actions/system/'+_0x1a154d+'/calls','POST',_0x5246a0);return{'getStream':async()=>{const _0xf73d75=(await _0x1a4d78['request'])['body'];return this['_getStreamReader'](_0xf73d75);},'abortController':_0x1a4d78['abortController']};}['uploadFile'](_0x30a3d2,_0x21971d,_0x4bb209){const _0x10af70=new FormData();_0x10af70['append']('file',_0x21971d,_0x21971d['name']),_0x4bb209&&_0x10af70['append']('attributes',JSON['stringify'](_0x4bb209));const _0x2afb00=this['_sendApiRequest']('/conversations/'+_0x30a3d2+'/files','POST',_0x10af70);return{'getId':async()=>(await _0x2afb00['request'])['json'](),'abortController':_0x2afb00['abortController']};}['fetchDocument'](_0x4c8d68,_0x4b616a){const _0x2ccc8a=this['_sendApiRequest']('/conversations/'+_0x4c8d68+'/documents/'+_0x4b616a,'GET');return{'getDocument':async()=>(await _0x2ccc8a['request'])['json'](),'abortController':_0x2ccc8a['abortController']};}['uploadDocument'](_0x1cdd97,_0x498d27,_0x4600db){const _0x50d6bb={'content':_0x498d27};_0x4600db&&(_0x50d6bb['attributes']=_0x4600db);const _0x1799db=this['_sendApiRequest']('/conversations/'+_0x1cdd97+'/documents','POST',_0x50d6bb);return{'getId':async()=>(await _0x1799db['request'])['json'](),'abortController':_0x1799db['abortController']};}['fetchConversations'](_0x34381d,_0x2e4ecd={}){const _0x36cb4a=new URLSearchParams();_0x36cb4a['append']('group',_0x34381d),_0x36cb4a['append']('excludeEmpty',!0x1!==_0x2e4ecd['excludeEmpty']?'true':'false'),_0x36cb4a['append']('limit',_0x2e4ecd['limit']?_0x2e4ecd['limit']['toString']():'100'),_0x36cb4a['append']('sortBy',_0x2e4ecd['sortBy']?_0x2e4ecd['sortBy']:'createdAt'),_0x36cb4a['append']('order',_0x2e4ecd['order']?_0x2e4ecd['order']:'desc');const _0x18faf6=this['_sendApiRequest']('/conversations?'+_0x36cb4a['toString'](),'GET');return{'getConversations':async()=>{const _0x485019=await _0x18faf6['request'];return(await _0x485019['json']())['items'];},'abortController':_0x18faf6['abortController']};}['deleteConversation'](_0x1e643e){const _0xb1b84c=this['_sendApiRequest']('/conversations/'+_0x1e643e,'DELETE');return{'execute':async()=>{await _0xb1b84c['request'];},'abortController':_0xb1b84c['abortController']};}['updateConversation'](_0x40e3c4,_0x40ae56){const _0x401f71=this['_sendApiRequest']('/conversations/'+_0x40e3c4,'PATCH',_0x40ae56);return{'getResult':async()=>(await _0x401f71['request'],_0x40ae56),'abortController':_0x401f71['abortController']};}['fetchConversation'](_0x24b8ee){const _0x91a7d0=this['_sendApiRequest']('/conversations/'+_0x24b8ee,'GET');return{'getConversation':async()=>(await _0x91a7d0['request'])['json'](),'abortController':_0x91a7d0['abortController']};}['fetchConversationMessages'](_0x454578){const _0x3dc4e5=this['_sendApiRequest']('/conversations/'+_0x454578+'/messages','GET');return{'getMessages':async()=>{const _0x1ae27e=await _0x3dc4e5['request'];return(await _0x1ae27e['json']())['items'];},'abortController':_0x3dc4e5['abortController']};}['uploadUrl'](_0x5a9fb4,_0x1c2486,_0x5e4588){const _0x310d63=this['_sendApiRequest']('/conversations/'+_0x5a9fb4+'/web-resources','POST',{'url':_0x1c2486,'attributes':_0x5e4588});return{'getId':async()=>(await _0x310d63['request'])['json'](),'abortController':_0x310d63['abortController']};}['getModels'](_0x2a3352='en'){const _0x2a713d=new URLSearchParams();_0x2a713d['append']('language',_0x2a3352);const _0x4dc80f='/models/1?'+_0x2a713d['toString'](),_0xd8aec2=this['_sendApiRequest'](_0x4dc80f,'GET',void 0x0,!0x0);return{'list':async()=>await(await _0xd8aec2['request'])['json'](),'abortController':_0xd8aec2['abortController']};}['deleteFile'](_0x1cb34d,_0x1de214){const _0x21b243=this['_sendApiRequest']('/conversations/'+_0x1cb34d+'/files/'+_0x1de214,'DELETE');return{'execute':async()=>{await _0x21b243['request'];},'abortController':_0x21b243['abortController']};}['deleteDocument'](_0x5a9bc3,_0x160422){const _0x93153d=this['_sendApiRequest']('/conversations/'+_0x5a9bc3+'/documents/'+_0x160422,'DELETE');return{'execute':async()=>{await _0x93153d['request'];},'abortController':_0x93153d['abortController']};}['deleteWebResource'](_0x237f4c,_0x18856c){const _0x3fe85e=this['_sendApiRequest']('/conversations/'+_0x237f4c+'/web-resources/'+_0x18856c,'DELETE');return{'execute':async()=>{await _0x3fe85e['request'];},'abortController':_0x3fe85e['abortController']};}['callSystemReview']({reviewName:_0x12bd18,content:_0x58c643,args:_0x4ff294}){const _0x5081e6=this['_sendApiRequest']('/reviews/system/'+_0x12bd18+'/calls','POST',{'content':[{'type':'text','content':_0x58c643}],'args':_0x4ff294});return{'getStream':async()=>{const _0x28ecb2=(await _0x5081e6['request'])['body'];return this['_getStreamReader'](_0x28ecb2);},'abortController':_0x5081e6['abortController']};}['callCustomReview']({content:_0x283e9f,prompt:_0x5e6eca,model:_0x414c4f}){const _0x84cbe3=this['_sendApiRequest']('/reviews/custom/calls','POST',{'content':[{'type':'text','content':_0x283e9f}],'prompt':_0x5e6eca,'model':_0x414c4f});return{'getStream':async()=>{const _0xa2f248=(await _0x84cbe3['request'])['body'];return this['_getStreamReader'](_0xa2f248);},'abortController':_0x84cbe3['abortController']};}['upsertAIChatRating'](_0xb0678a,_0x45101b,_0x60f162){const _0x277e23=this['_sendApiRequest']('/conversations/'+_0xb0678a+'/messages/'+_0x45101b+'/ratings','PUT',{'positiveCount':_0x60f162['positiveCount'],'totalCount':_0x60f162['totalCount'],'modificationId':_0x60f162['modificationId']});return{'execute':async()=>{await _0x277e23['request'];},'abortController':_0x277e23['abortController']};}['upsertAIActionRating'](_0x5afda9,_0x679ec3,_0x243827){const _0x3fbc3a=this['_sendApiRequest']('/actions/system/'+_0x5afda9+'/calls/'+_0x679ec3+'/ratings','PUT',{'positiveCount':_0x243827['positiveCount'],'totalCount':_0x243827['totalCount']});return{'execute':async()=>{await _0x3fbc3a['request'];},'abortController':_0x3fbc3a['abortController']};}['upsertCustomAIActionRating'](_0x5b255d,_0x396c39){const _0xc6d34b=this['_sendApiRequest']('/actions/custom/calls/'+_0x5b255d+'/ratings','PUT',{'positiveCount':_0x396c39['positiveCount'],'totalCount':_0x396c39['totalCount']});return{'execute':async()=>{await _0xc6d34b['request'];},'abortController':_0xc6d34b['abortController']};}['upsertAIReviewRating'](_0x291327,_0x4a9b65,_0x326b0a,_0x53f522){const _0x1dce29=this['_sendApiRequest']('/reviews/system/'+_0x291327+'/calls/'+_0x4a9b65+'/ratings','PUT',{'positiveCount':_0x326b0a['positiveCount'],'totalCount':_0x326b0a['totalCount'],'dataId':_0x53f522});return{'execute':async()=>{await _0x1dce29['request'];},'abortController':_0x1dce29['abortController']};}['upsertCustomAIReviewRating'](_0x3b7094,_0x2457b7,_0x53d2c3){const _0x56c5e9=this['_sendApiRequest']('/reviews/custom/calls/'+_0x3b7094+'/ratings','PUT',{'positiveCount':_0x2457b7['positiveCount'],'totalCount':_0x2457b7['totalCount'],'dataId':_0x53d2c3});return{'execute':async()=>{await _0x56c5e9['request'];},'abortController':_0x56c5e9['abortController']};}['_sendApiRequest'](_0x5c49b6,_0x4d9fbe,_0x289ff1,_0x5d0538=!0x1){const _0x536d0a=new AbortController(),_0xfca116=_0x5d0538?_0x4d9fbe+':'+_0x5c49b6:null;if(_0xfca116){const _0x5a034e=this['_responseCache']['get'](_0xfca116);if(_0x5a034e)return{'request':_0x5a034e['then'](_0x527ea7=>_0x527ea7['clone']()),'abortController':_0x536d0a};}const _0x50d6a1=_0x289ff1 instanceof FormData,_0x1f5cc9={'Authorization':'Bearer\x20'+this['_token']?.['value']};_0x289ff1&&!_0x50d6a1&&(_0x1f5cc9['Content-Type']='application/json');const _0x1b680f={'method':_0x4d9fbe,'headers':_0x1f5cc9,'signal':_0x536d0a['signal']};_0x289ff1&&(_0x1b680f['body']=_0x50d6a1?_0x289ff1:JSON['stringify'](_0x289ff1));const _0x58314d=fetch(''+this['_apiUrl']+_0x5c49b6,_0x1b680f)['catch'](_0x31fc58=>{_0xfca116&&this['_responseCache']['delete'](_0xfca116),this['_handleError'](_0x31fc58);})['then'](_0x54d1b4=>_0x54d1b4['ok']?_0x54d1b4:_0x54d1b4['json']()['then'](_0x180edf=>{throw _0xfca116&&this['_responseCache']['delete'](_0xfca116),{'url':this['_apiUrl'],'path':_0x5c49b6,'method':_0x4d9fbe,'body':_0x289ff1,'status':(_0x54d1b4||{})['status'],'statusText':(_0x54d1b4||{})['statusText'],'code':_0x180edf['code'],'message':_0x180edf['message'],'traceId':_0x180edf['traceId']};}));return _0xfca116&&this['_responseCache']['set'](_0xfca116,_0x58314d['then'](_0x1fa1b3=>_0x1fa1b3['clone']())),{'request':_0x58314d,'abortController':_0x536d0a};}async*['_getStreamReader'](_0x49b827){const _0x258da6=[],_0x2fd436=_0x49b827['getReader'](),_0x163c23=_0x4cd3e5({'onError':_0x19a624=>{this['_handleError'](_0x19a624);},'onEvent':_0x3f4358=>{_0x3f4358['data']=JSON['parse'](_0x3f4358['data']),_0x258da6['push'](_0x3f4358);}});try{let _0xb62ae5=!0x1;for(;!_0xb62ae5;){const {done:_0x295e0d,value:_0x4fbdfe}=await _0x2fd436['read']();_0x295e0d&&(_0xb62ae5=!0x0),_0x163c23['feed'](this['_decoder']['decode'](_0x4fbdfe,{'stream':!0x0})),yield*_0x258da6,_0x258da6['length']=0x0;}}catch(_0x570956){this['_handleError'](_0x570956);}finally{_0x2fd436['releaseLock'](),_0x163c23['reset']();}}['_handleError'](_0x18fe7c){if(_0x18fe7c instanceof ot)throw _0x18fe7c;if(_0x18fe7c instanceof Error&&'AbortError'===_0x18fe7c['name'])throw new ot('ai-request-aborted',this,{'originalError':_0x18fe7c});throw new ot('ai-request-failed',this,{'originalError':_0x18fe7c});}}function cs(_0x179156,_0x24d8a1,_0x34e9f0){const t=_0x179156['t'];switch(_0x24d8a1){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'},_0x34e9f0);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':'The\x20request\x20was\x20aborted.'});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.'},_0x34e9f0);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.'},_0x34e9f0);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.'},_0x34e9f0);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'},_0x34e9f0);case'AI_CHAT_SUGGESTION_ACTION_SUGGEST':return t({'id':'AI_CHAT_SUGGESTION_ACTION_SUGGEST','string':'Suggest'},_0x34e9f0);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'},_0x34e9f0);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.'},_0x34e9f0);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.'},_0x34e9f0);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.'},_0x34e9f0);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.'},_0x34e9f0);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'},_0x34e9f0);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.'},_0x34e9f0);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 _0x24d8a1;}}const ls='ck-ai-button-primary',us='ck-ai-button-secondary',ds='ck-ai-button-tertiary';function _s(_0x37607a,_0x23d38a){const _0xcb7576=new kt(_0x37607a),_0x515333=cs(_0x37607a,'AI_TABS_LABEL_MINIMIZE'),_0x3e354b=cs(_0x37607a,'AI_TABS_LABEL_MAXIMIZE');return _0xcb7576['set']({'withText':!0x1,'icon':_0x39ec7a,'tooltip':!0x0,'class':'ck-ai-tabs__resize\x20'+ds}),_0xcb7576['bind']('label')['to'](_0x23d38a,'isMaximized',_0x51ce4b=>_0x51ce4b?_0x515333:_0x3e354b),_0xcb7576['bind']('icon')['to'](_0x23d38a,'isMaximized',_0x402a6f=>_0x402a6f?_0x3e0dad:_0x39ec7a),_0xcb7576['bind']('isOn')['to'](_0x23d38a,'isMaximized'),_0xcb7576['on']('execute',()=>{_0x23d38a['fire']('resizeTabs');}),_0xcb7576;}function As(_0x5e9fbe){return _0x23c6b9(_0x5e9fbe);}function gs(_0x21c8be){return _0x345257(_0x21c8be);}function Is(_0x565c87,_0x49c506,_0x9e8f8f){const _0x2d411f=null!==_0x49c506?_0xdf3f71=>_0xdf3f71['attribs'][_0x565c87]===_0x49c506:_0x1ab083=>Boolean(_0x1ab083['attribs'][_0x565c87]);return _0x661d7(_0x608a1b=>_0x3003c8(_0x608a1b)&&_0x2d411f(_0x608a1b),_0x9e8f8f);}function Es(_0x2b01d7,_0xb8763c,_0x459780){const _0x2812bc=null!==_0xb8763c?_0x2741dd=>_0x2741dd['attribs'][_0x2b01d7]===_0xb8763c:_0x56595f=>Boolean(_0x56595f['attribs'][_0x2b01d7]);return _0x5e6828(_0x12366a=>_0x3003c8(_0x12366a)&&_0x2812bc(_0x12366a),_0x459780);}function ps(_0x232c69,_0x1d6057){return _0x232c69&&_0x3003c8(_0x232c69)?_0x232c69['attribs'][_0x1d6057]:null;}function Ts(_0x2188f6,_0x53a7be,_0x1bd067){_0x3003c8(_0x2188f6)&&(null===_0x1bd067?delete _0x2188f6['attribs'][_0x53a7be]:_0x2188f6['attribs'][_0x53a7be]=_0x1bd067);}function ms(_0x244a59,_0x334dba,_0x38c88c){const _0x4e201c=_0x334dba['cloneNode'](!0x0);'beforebegin'===_0x38c88c?_0xe19e73(_0x244a59,_0x4e201c):'afterbegin'===_0x38c88c?_0x36b9f0(_0x244a59,_0x4e201c):'beforeend'===_0x38c88c?_0x2e33db(_0x244a59,_0x4e201c):'afterend'===_0x38c88c&&_0x2fe3a2(_0x244a59,_0x4e201c);}function Cs(_0x3bbda5){const _0x1de9a8=[];let _0x43d365=_0x3bbda5;for(;_0x43d365;)_0x43d365=_0x16611c(_0x43d365),_0x43d365&&_0x1de9a8['push'](_0x43d365);return _0x1de9a8;}function ws(_0x42db5f){return _0x42db5f['replace'](/^\s+/gm,'')['replace'](/\s+$/gm,'')['replace'](/\n*/g,'')['replace'](/\s+/g,'\x20')['replace'](/>\s*</g,'><');}function fs(_0x4a3496){let _0x543edc=0x0;for(;_0x4a3496['parentNode'];)_0x4a3496=_0x4a3496['parentNode'],_0x543edc++;return _0x543edc;}function Ss(_0x1461b1){const _0x5a3409=[];let _0x44ef07=_0x1461b1['nextSibling'];for(;_0x44ef07;)_0x5a3409['push'](_0x44ef07),_0x44ef07=_0x44ef07['nextSibling'];_0x5a3409['forEach'](_0x424ea7=>{_0x9eae66(_0x424ea7);});}class bs extends/* #__PURE__ -- @preserve */
|
|
25
|
+
ht(){['_m2html'];constructor(){super();const _0x338848=Object['entries'](_0x6384fa),_0x2ac980=_0x338848['findIndex'](([_0x51ca32])=>'rehypeDomRaw'===_0x51ca32);if(-0x1===_0x2ac980)throw new ot('ai-response-parser-unable-to-set-up-parser');_0x338848['splice'](_0x2ac980+0x1,0x0,['rehypeSanitize',_0x5a1661]),this['_m2html']=new _0x4390d4({'plugins':Object['fromEntries'](_0x338848)});}['convertMarkdownToHTML'](_0x12dde5){const _0x45bf70=this['_m2html']['parse'](_0x12dde5);return this['parseAndNormalizeHTML'](_0x45bf70);}['parseAndNormalizeHTML'](_0x10e2e4){return this['_parseHTML'](_0x10e2e4);}['_parseHTML'](_0x3bc7a1){const _0x23abc4=As('<dummy>'+_0x3bc7a1['replace'](/^\t+/gm,'\x20')['replace'](/\n*/g,'')['replace'](/\s+/g,'\x20')['replace'](/<[^>]*?$/g,'')+'</dummy>');return _0x23abc4['children']=_0x23abc4['children'][0x0]['children'],_0x23abc4;}}class Rs extends/* #__PURE__ -- @preserve */
|
|
26
|
+
ht(){['_generateUid'];['_touchedNodesState']={'newIds':[],'modifiedIds':[],'removedIds':[],'invalidIds':[],'lastTouchedId':null};['_existingDataIds']=new Set();constructor(_0x827eb7){super(),this['_generateUid']=_0x827eb7||at;}['merge'](_0x210bfa,_0x4eac72,_0x333921){const _0x48bbf7=_0x210bfa['cloneNode'](!0x0);if(0x0===_0x4eac72['childNodes']['length']){const _0x5d8020=[];return Es('data-id','new-element',_0x48bbf7)['forEach'](_0x2f16bb=>{const _0x7a4aca=this['_generateUid']();Ts(_0x2f16bb,'data-id',_0x7a4aca),_0x5d8020['push'](_0x7a4aca);}),this['_removeSpecialComments'](_0x48bbf7),{'parsedContent':_0x48bbf7,'newNodeIds':_0x5d8020,'modifiedNodeIds':[],'removedNodeIds':[]};}_0x333921&&_0x333921['markUnstableElements']&&this['_markLastTagElementUnstable'](_0x48bbf7),this['_touchedNodesState']['newIds']=[],this['_touchedNodesState']['modifiedIds']=[],this['_touchedNodesState']['removedIds']=[],this['_touchedNodesState']['invalidIds']=[],this['_touchedNodesState']['lastTouchedId']=null,this['_existingDataIds']=new Set(Es('data-id',null,_0x4eac72)['map'](_0x17fcca=>ps(_0x17fcca,'data-id'))['filter'](_0x5595a5=>!!_0x5595a5));let _0x3b59c3=-0x1,_0x242e4a=!0x1;const _0x116cb0=_0x48bbf7['childNodes'],_0x49f59a=Array['from'](_0x116cb0)['filter'](_0x19077d=>!(0x3===_0x19077d['nodeType']&&''===gs(_0x19077d)['trim']())),_0x134714=_0x49f59a['length'];for(let _0x15e1fc=0x0;_0x15e1fc<_0x134714;_0x15e1fc++){const _0x4ef4fe=_0x49f59a[_0x15e1fc],_0x1a9d28=_0x49f59a[_0x15e1fc+0x1];if(this['_isNewNode'](_0x4ef4fe)){if(-0x1===_0x3b59c3&&(_0x3b59c3=_0x15e1fc),this['_markWrappedElements'](_0x4ef4fe),!this['_isNewNode'](_0x1a9d28)){const [_0x45b68b,_0x94cb6f]=this['_findReferenceNode'](_0x4ef4fe,_0x242e4a,_0x4eac72);if(_0x45b68b){const _0x3283b3=Array['from'](_0x49f59a)['slice'](_0x3b59c3,_0x15e1fc+0x1);this['_insertNodes'](_0x45b68b,_0x3283b3,_0x94cb6f),_0x3b59c3=-0x1;}}}else{if(this['_isExistingContentComment'](_0x4ef4fe))_0x242e4a=!0x0;else{if(this['_isExistingNode'](_0x4ef4fe)){const _0x59fb=ps(_0x4ef4fe,'data-id');if(_0x59fb&&this['_existingDataIds']['has'](_0x59fb)){const _0x3f0dd2=Is('data-id',_0x59fb,_0x4eac72);this['_replaceNode'](_0x3f0dd2,_0x4ef4fe);}if(this['_touchedNodesState']['removedIds']['includes'](_0x59fb)){const _0x310ff7=this['_touchedNodesState']['removedIds']['indexOf'](_0x59fb);this['_touchedNodesState']['removedIds']['splice'](_0x310ff7,0x1);}}else{if(this['_isDelNode'](_0x4ef4fe)){const _0x2ea4fa=ps(_0x4ef4fe,'data-id');this['_touchedNodesState']['modifiedIds']['includes'](_0x2ea4fa)||this['_storeDeletedElementIds'](_0x4ef4fe);}}}}}for(const _0xc3d22a of this['_touchedNodesState']['removedIds']){const _0x5e8803=Is('data-id',_0xc3d22a,_0x4eac72);if(_0x5e8803){if(_0x333921&&_0x333921['replaceRemovedWith']){this['_touchedNodesState']['lastTouchedId']=_0xc3d22a;const _0x3bc272=_0x333921['replaceRemovedWith']['cloneNode'](!0x0);Ts(_0x3bc272,'data-id',_0xc3d22a),Ts(_0x3bc272,'data-removed','true'),_0x4cd04e(_0x5e8803,_0x3bc272);}else _0x9eae66(_0x5e8803);}}if(Es('data-wrapped-id',null,_0x4eac72)['forEach'](_0x365399=>{const _0x1b6403=Is('data-id',ps(_0x365399,'data-wrapped-id'),_0x4eac72);var _0x1b5065,_0x1bdea5;_0x1b6403&&(_0x1bdea5=_0x365399,_0x9eae66(_0x1b5065=_0x1b6403),_0x4cd04e(_0x1bdea5,_0x1b5065));}),Es('data-id','new-element',_0x4eac72)['forEach'](_0x278618=>{const _0x363b5=this['_getUid'](_0x278618);Ts(_0x278618,'data-id',_0x363b5),this['_touchedNodesState']['newIds']['push'](_0x363b5);}),this['_removeSpecialComments'](_0x4eac72),_0x333921&&_0x333921['markUnstableElements']&&this['_markUnstableElements'](_0x4eac72,_0x333921['markUnstableElementsDepth']||0x0),_0x333921&&_0x333921['cutAfterLastChange']&&this['_touchedNodesState']['lastTouchedId']){let _0x2148a7=Is('data-id',this['_touchedNodesState']['lastTouchedId'],_0x4eac72);for(;_0x2148a7;)Ss(_0x2148a7),_0x2148a7=_0x2148a7['parentNode'];}return{'parsedContent':_0x4eac72,'newNodeIds':this['_touchedNodesState']['newIds'],'modifiedNodeIds':this['_touchedNodesState']['modifiedIds'],'removedNodeIds':this['_touchedNodesState']['removedIds']};}['_insertNodes'](_0x3ff407,_0x4717ff,_0x309043){for(const _0x24ca1a of _0x4717ff){const _0xc6889f=this['_getUid'](_0x24ca1a);Ts(_0x24ca1a,'data-id',_0xc6889f),this['_touchedNodesState']['newIds']['push'](_0xc6889f),this['_touchedNodesState']['lastTouchedId']=_0xc6889f;}const _0x32d1bb='afterbegin'===_0x309043||'afterend'===_0x309043?_0x4717ff['reverse']():_0x4717ff;for(const _0x2dbe9f of _0x32d1bb)ms(_0x3ff407,_0x2dbe9f,_0x309043);}['_replaceNode'](_0x36d9c6,_0x258b5a){if(!_0x36d9c6)return;if(_0xda222f=_0x258b5a,ws(gs(_0x36d9c6))===ws(gs(_0xda222f)))return;var _0xda222f;const _0x470660=this['_getUid'](_0x36d9c6);Ts(_0x258b5a,'data-id',_0x470660),this['_touchedNodesState']['modifiedIds']['push'](_0x470660),this['_touchedNodesState']['lastTouchedId']=_0x470660,_0x4cd04e(_0x36d9c6,_0x258b5a['cloneNode'](!0x0));}['_findReferenceNode'](_0x487e22,_0x144440,_0x1177f6){const _0x576c45=this['_findPrevElementWithDataId'](_0x487e22,!0x1);if(_0x576c45){const _0x11eb36=this['_getNodeDataId'](_0x576c45),_0x31e95e=Is('data-id',_0x11eb36,_0x1177f6);if(_0x31e95e)return[_0x31e95e,'afterend'];this['_touchedNodesState']['invalidIds']['push'](_0x11eb36);}const _0x542d68=this['_findNextElementWithDataId'](_0x487e22,!0x1);if(_0x542d68){const _0x3b1ecd=this['_getNodeDataId'](_0x542d68),_0x31286f=Is('data-id',_0x3b1ecd,_0x1177f6);if(_0x31286f)return[_0x31286f,'beforebegin'];this['_touchedNodesState']['invalidIds']['push'](_0x3b1ecd);}return _0x144440?_0x487e22['nextSibling']?this['_findFallbackReferenceNode'](_0x487e22,_0x1177f6):[_0x1177f6['childNodes'][_0x1177f6['childNodes']['length']-0x1],'afterend']:[_0x1177f6['childNodes'][0x0],'beforebegin'];}['_findFallbackReferenceNode'](_0x13247e,_0x226f49){const _0x53c243=[],_0x46f0ff=this['_findPrevElementWithDataId'](_0x13247e,!0x0);if(_0x46f0ff){const _0x4dc2d2=Is('data-id',this['_getNodeDataId'](_0x46f0ff),_0x226f49);_0x4dc2d2&&_0x53c243['push']([_0x4dc2d2,'afterend']);}const _0x4d3d6e=this['_findNextElementWithDataId'](_0x13247e,!0x0);if(_0x4d3d6e){const _0x52afe3=Is('data-id',this['_getNodeDataId'](_0x4d3d6e),_0x226f49);_0x52afe3&&_0x53c243['push']([_0x52afe3,'beforebegin']);}if(_0x53c243['length']>0x1)return fs(_0x53c243[0x0][0x0])<=fs(_0x53c243[0x1][0x0])?_0x53c243[0x0]:_0x53c243[0x1];return 0x1===_0x53c243['length']?_0x53c243[0x0]:[_0x226f49['lastChild'],'afterend'];}['_findNextElementWithDataId'](_0x324aeb,_0x2c51bf){let _0x39ecc1=_0x324aeb['nextSibling'],_0x21d38d=null,_0x32b593=!0x1;for(;_0x39ecc1;){if(_0x459db9(_0x39ecc1)){if(this['_isDelNode'](_0x39ecc1)&&(_0x21d38d=_0x39ecc1),this['_isExistingContentComment'](_0x39ecc1)&&_0x2c51bf&&!_0x32b593){_0x32b593=!0x0,_0x39ecc1=_0x39ecc1['nextSibling'];continue;}break;}const _0x2a5ef6=ps(_0x39ecc1,'data-id');if(_0x2a5ef6&&'new-element'!==_0x2a5ef6&&this['_existingDataIds']['has'](_0x2a5ef6)){_0x21d38d=_0x39ecc1;break;}_0x39ecc1=_0x39ecc1['nextSibling'];}return _0x21d38d;}['_findPrevElementWithDataId'](_0x1f260a,_0x146f12){let _0x50d4cf=_0x1f260a['previousSibling'],_0x6ebbb3=null,_0x17f8cc=!0x1;for(;_0x50d4cf;){if(_0x459db9(_0x50d4cf)){if(this['_isDelNode'](_0x50d4cf)&&(_0x6ebbb3=_0x50d4cf),this['_isExistingContentComment'](_0x50d4cf)&&_0x146f12&&!_0x17f8cc){_0x17f8cc=!0x0,_0x50d4cf=_0x50d4cf['previousSibling'];continue;}break;}const _0x3cf33c=ps(_0x50d4cf,'data-id');if(_0x3cf33c&&'new-element'!==_0x3cf33c&&this['_existingDataIds']['has'](_0x3cf33c)){_0x6ebbb3=_0x50d4cf;break;}_0x50d4cf=_0x50d4cf['previousSibling'];}return _0x6ebbb3;}['_markWrappedElements'](_0x5459b7){_0x3003c8(_0x5459b7)&&Es('data-id',null,_0x5459b7)['forEach'](_0x113657=>{this['_isExistingNode'](_0x113657)&&!this['_hasWrappedParent'](_0x113657)&&(Ts(_0x113657,'data-wrapped-id',ps(_0x113657,'data-id')),Ts(_0x113657,'data-id',null));});}['_getNodeDataId'](_0x463f37){if(!_0x463f37)return null;if(_0x3003c8(_0x463f37))return ps(_0x463f37,'data-id');if(_0x459db9(_0x463f37)){const _0x13704a=gs(_0x463f37)['match'](/removed[\s*-]data-id="([^"]+)"/);if(_0x13704a&&_0x13704a[0x1])return _0x13704a[0x1];}return null;}['_storeDeletedElementIds'](_0x5100f3){if(_0x459db9(_0x5100f3)){const _0x8a5ff4=gs(_0x5100f3)['match'](/removed[\s*-]data-id="([^"]+)"/);_0x8a5ff4&&_0x8a5ff4[0x1]&&this['_touchedNodesState']['removedIds']['push'](_0x8a5ff4[0x1]);}}['_getUid'](_0x8ac8a1){return this['_isExistingNode'](_0x8ac8a1)?ps(_0x8ac8a1,'data-id'):this['_generateUid']();}['_removeSpecialComments'](_0x5be4fa){(function(_0x13f2d4){return _0x26bbac(_0x866a3f=>_0x459db9(_0x866a3f),_0x13f2d4,!0x0,0x1/0x0);}(_0x5be4fa)['filter'](_0x3bfcc8=>this['_isDelNode'](_0x3bfcc8)||this['_isExistingContentComment'](_0x3bfcc8))['forEach'](_0x19c073=>{_0x9eae66(_0x19c073);}));}['_markLastTagElementUnstable'](_0x7adf08){const _0x16a28a=_0x7adf08['childNodes'],_0x3b5b7d=_0x16a28a[_0x16a28a['length']-0x1];_0x3b5b7d&&_0x3003c8(_0x3b5b7d)&&Ts(_0x3b5b7d,'data-unstable','true');}['_markUnstableElements'](_0x12b808,_0x2921ec){const _0x266afc=Is('data-unstable','true',_0x12b808);if(!_0x266afc)return;const _0x537f7a=Cs(_0x266afc)['slice'](0x0,-0x1),_0x112ad3=_0x537f7a['length'];let _0x26f219=_0x266afc;if(_0x112ad3>_0x2921ec){let _0xb7f96b=_0x112ad3,_0x2b2e78=null;for(;_0xb7f96b>_0x2921ec&&_0xb7f96b>=0x0;)_0xb7f96b--,_0x2b2e78=_0x537f7a[_0xb7f96b];_0x2b2e78&&(_0x26f219=_0x2b2e78,Ts(_0x266afc,'data-unstable',null),Ts(_0x2b2e78,'data-unstable','true'));}else{if(_0x112ad3<_0x2921ec){let _0xd6a257=_0x112ad3,_0x203277=_0x266afc;for(;_0xd6a257<_0x2921ec;){const _0x271983=_0x203277['childNodes']['filter'](_0x1064b7=>_0x3003c8(_0x1064b7));if(0x0===_0x271983['length'])break;_0xd6a257++,_0x203277=_0x271983[_0x271983['length']-0x1];}_0x203277&&(_0x26f219=_0x203277,Ts(_0x266afc,'data-unstable',null),Ts(_0x203277,'data-unstable','true'));}}let _0x5d28d9=_0x26f219;for(;_0x5d28d9;){for(;_0x5d28d9['nextSibling'];)_0x5d28d9=_0x5d28d9['nextSibling'],_0x3003c8(_0x5d28d9)&&Ts(_0x5d28d9,'data-unstable','true');_0x5d28d9=_0x5d28d9['parentNode'];}}['_isNewNode'](_0x4c5371){return Boolean('new-element'===ps(_0x4c5371,'data-id'));}['_isExistingNode'](_0x3c2200){return Boolean((ps(_0x3c2200,'data-id')||'')['length']>0x0&&'new-element'!==ps(_0x3c2200,'data-id'));}['_isDelNode'](_0x5cf7b7){return!!_0x5cf7b7&&Boolean(_0x459db9(_0x5cf7b7)&&gs(_0x5cf7b7)['match'](/removed[\s*-]data-id="[^"]+"/));}['_hasWrappedParent'](_0xe781c1){let _0x2e5925=_0xe781c1['parentNode'];for(;_0x2e5925;){if(ps(_0x2e5925,'data-wrapped-id'))return!0x0;_0x2e5925=_0x2e5925['parentNode'];}return!0x1;}['_isExistingContentComment'](_0x5b30df){return Boolean(_0x459db9(_0x5b30df)&&gs(_0x5b30df)['match'](/\s*existing[\s*-](content|document)\s*/g));}}function Os({editor:_0x327658,changeGroups:_0x2e9c6c,documentContextContent:_0x3b8d65,showDiff:_0x32b7f1,trimUnchanged:_0x2bc079=!0x0}){return _0x2e9c6c['map'](_0x26e5a9=>{const _0x4aa108=new _0x539efd([]),_0x4e02b4=new _0x539efd([]);for(const _0x5f1375 of _0x26e5a9['changes'])if(_0x32b7f1&&'removed'==_0x5f1375['type']||_0x4e02b4['children']['push'](_0x5f1375['node']['cloneNode'](!0x0)),'new'!=_0x5f1375['type']&&(_0x32b7f1||'removed'!=_0x5f1375['type'])){const _0x4ccf58=_0x661d7(_0x1ec4ef=>ps(_0x1ec4ef,'data-id')==_0x5f1375['id'],_0x3b8d65,!0x0);_0x4ccf58&&_0x4aa108['children']['push'](_0x4ccf58['cloneNode'](!0x0));}const {content:_0x7fe255,hasChanges:_0x1bd649}=function(_0x519071,_0x50576d,_0x1731ce,_0x4b347d,_0xb6194c=!0x0){const _0x2a88fc=_0x519071['plugins']['get']('DocumentCompare'),_0x40bd68=gs(_0x50576d),_0x2c97a5=gs(_0x1731ce),_0x5af2ad=_0x519071['data']['parse'](_0x40bd68,'$root'),_0x165644=_0x519071['model']['createPositionAt'](_0x5af2ad,0x0),_0x22222a=_0x2a88fc['getDiff'](_0x40bd68,_0x2c97a5,{'anchor':_0x165644,'markDeletions':_0x4b347d}),_0x4021da=_0x22222a['getOperations']();if(0x0==_0x4021da['length'])return{'content':_0x50576d['cloneNode'](!0x0),'hasChanges':!0x1};_0x4b347d?function(_0x27297c,_0x119e29,_0xaa1643){if(0x0==_0x27297c['length'])return;const _0x56a09a=_0xaa1643['plugins']['get']('DocumentCompare'),_0x224dc0=_0xaa1643['plugins']['get']('SuggestionsConversion');_0xaa1643['model']['change'](_0x487a37=>{const _0x17fc02=new Set();for(let _0x187da7=0x0;_0x187da7<_0x27297c['length'];_0x187da7++){const _0x51d267=_0x27297c[_0x187da7];if(_0x51d267['baseVersion']=null,_0x51d267['isDocumentOperation']=!0x1,_0x56a09a['isMarkedRemoveOperation'](_0x51d267)){const _0x7e9d0d=_0x47b395(_0x51d267['newRange'],_0xaa1643['model']),_0x2d88a='suggestion:deletion:'+at()+':$aiSuggestion';_0x119e29['markers']['set'](_0x2d88a,_0x7e9d0d);}else switch(_0x51d267['type']){case'rename':{if(_0x51d267['oldName']==_0x51d267['newName'])break;_0x487a37['batch']['addOperation'](_0x51d267),_0xaa1643['model']['applyOperation'](_0x51d267);const _0x405bd5='$elementName',_0x15d1b9=_0x51d267['position'],_0x2ceab2=_0xaa1643['model']['createRange'](_0x15d1b9,_0xaa1643['model']['createPositionAt'](_0x15d1b9['nodeAfter'],'end')),_0xaf6388='suggestion:attribute:'+_0x405bd5+':'+at()+':$aiSuggestion';_0x119e29['markers']['set'](_0xaf6388,_0x2ceab2);break;}case'addAttribute':case'removeAttribute':case'changeAttribute':{if(_0x51d267['oldValue']==_0x51d267['newValue'])break;_0x487a37['batch']['addOperation'](_0x51d267),_0xaa1643['model']['applyOperation'](_0x51d267);const _0x39d61c=_0x51d267['key'];if(!_0x224dc0['isRegisteredAttribute'](_0x39d61c))break;const _0x3312a7=_0x47b395(_0x51d267['range'],_0xaa1643['model']),_0x41fddc='suggestion:attribute:'+_0x39d61c+':'+at()+':$aiSuggestion';_0x119e29['markers']['set'](_0x41fddc,_0x3312a7);break;}case'insert':{_0x487a37['batch']['addOperation'](_0x51d267),_0xaa1643['model']['applyOperation'](_0x51d267);if(_0x27297c[_0x187da7+0x1]&&'move'==_0x27297c[_0x187da7+0x1]['type']){ks(_0x119e29,_0x51d267);break;}const _0x2f78db=_0x51d267['position'],_0x5239b5=_0x51d267['howMany'],_0x45e1db=_0x47b395(_0xaa1643['model']['createRange'](_0x2f78db,_0x2f78db['getShiftedBy'](_0x5239b5)),_0xaa1643['model']),_0x1402e1='suggestion:insertion:'+at()+':$aiSuggestion';_0x119e29['markers']['set'](_0x1402e1,_0x45e1db);break;}case'split':{_0x487a37['batch']['addOperation'](_0x51d267),_0xaa1643['model']['applyOperation'](_0x51d267);const _0x5d00a0=_0x51d267['splitPosition'],_0x4f5305=_0x51d267['moveTargetPosition'],_0x1d6667=_0xaa1643['model']['createRange'](_0x5d00a0,_0x4f5305),_0x176e8e='suggestion:insertion:'+at()+':$aiSuggestion';_0x119e29['markers']['set'](_0x176e8e,_0x1d6667);break;}case'move':{_0x487a37['batch']['addOperation'](_0x51d267),_0xaa1643['model']['applyOperation'](_0x51d267),_0x27297c[_0x187da7-0x1]&&'insert'==_0x27297c[_0x187da7-0x1]['type']&&ks(_0x119e29,_0x51d267);const _0x3bfe1c=_0x51d267['getMovedRangeStart'](),_0x1c0ea3=_0x51d267['howMany'];for(let _0x39bfc3=0x0;_0x39bfc3<_0x1c0ea3;_0x39bfc3++){const _0x256e99=_0x3bfe1c['getShiftedBy'](_0x39bfc3)['nodeAfter'];_0x17fc02['add'](_0x256e99);}break;}case'remove':{const _0xd64aa2=_0x51d267['sourcePosition'],_0x1d690d=_0x51d267['howMany'],_0x1ffde2=new _0x5d2b40(_0xd64aa2,_0x1d690d);_0x487a37['batch']['addOperation'](_0x1ffde2),_0xaa1643['model']['applyOperation'](_0x1ffde2);break;}}}for(const _0x2d48ff of _0x17fc02){const _0xe5fe56=_0xaa1643['model']['createRangeOn'](_0x2d48ff),_0x24afb9='suggestion:formatBlock:$fakeWrap:'+at()+':$aiSuggestion';_0x119e29['markers']['set'](_0x24afb9,_0x47b395(_0xe5fe56,_0xaa1643['model']));}});}(_0x4021da,_0x5af2ad,_0x519071):_0x519071['model']['change'](_0x4b6863=>{for(const _0x38ad57 of _0x4021da)if('remove'==_0x38ad57['type']){const _0x41f701=_0x38ad57['sourcePosition'],_0x31f718=_0x38ad57['howMany'],_0x7632c6=new _0x5d2b40(_0x41f701,_0x31f718);_0x4b6863['batch']['addOperation'](_0x7632c6),_0x519071['model']['applyOperation'](_0x7632c6);}else{if('marker'==_0x38ad57['type']){const _0x2cbf1e=_0x38ad57['name'],_0xc00e99=_0x38ad57['newRange'];null!==_0xc00e99?_0x5af2ad['markers']['set'](_0x2cbf1e,_0xc00e99):_0x5af2ad['markers']['delete'](_0x2cbf1e);}else _0x38ad57['baseVersion']=null,_0x38ad57['isDocumentOperation']=!0x1,_0x4b6863['batch']['addOperation'](_0x38ad57),_0x519071['model']['applyOperation'](_0x38ad57);}});if(_0xb6194c){const _0x133c49=Ns(_0x519071,_0x4021da,_0x5af2ad);vs(_0x519071['model'],_0x133c49),function(_0x47b5cc,_0x127832){const _0x237bb6=_0x127832['getFirstRange']()['start'];let _0x1093aa=_0x127832['getFirstRange']()['end'];const _0x1cac07=_0x237bb6['root'];(_0x1093aa['textNode']||_0x1093aa['nodeAfter']&&_0x1093aa['nodeAfter']['is']('$text'))&&(_0x4a0dd7(_0x1093aa,'...'),_0x1093aa=_0x1093aa['getShiftedBy'](0x3)),(_0x237bb6['textNode']||_0x237bb6['nodeBefore']&&_0x237bb6['nodeBefore']['is']('$text'))&&(_0x4a0dd7(_0x237bb6,'...'),function(_0x5cc133,_0x175664,_0x22cb22){for(let [_0x47569d,_0x159e27]of _0x5cc133['markers']){const _0x1a9786=_0x159e27['_getTransformedByInsertion'](_0x175664,_0x22cb22,!0x1);_0x159e27=_0x1a9786[0x0],_0x5cc133['markers']['set'](_0x47569d,_0x159e27);}}(_0x1cac07,_0x237bb6,0x3),_0x237bb6['parent']==_0x1093aa['parent']&&(_0x1093aa=_0x1093aa['getShiftedBy'](0x3)));const _0x5873a2=_0x47b5cc['createRange'](_0x47b5cc['createPositionAt'](_0x1cac07,0x0),_0x237bb6),_0x66bcf2=_0x47b5cc['createRange'](_0x1093aa,_0x47b5cc['createPositionAt'](_0x1cac07,'end')),_0x1c57c5=[..._0x5873a2['getMinimalFlatRanges'](),..._0x66bcf2['getMinimalFlatRanges']()];_0x1c57c5['reverse']();for(const _0x303616 of _0x1c57c5)_0x1cd220(_0x303616),xs(_0x1cac07,_0x303616);}(_0x519071['model'],_0x133c49);}const _0x444667=_0x519071['data']['stringify'](_0x5af2ad,{'showSuggestionHighlights':!0x0});return{'content':As(_0x444667),'hasChanges':!0x0};}(_0x327658,_0x4aa108,_0x4e02b4,_0x32b7f1,_0x2bc079);return{'type':_0x26e5a9['changes'][0x0]['type'],'index':_0x26e5a9['index'],'content':_0x7fe255,'hasChanges':_0x1bd649};});}function ks(_0x5d581a,_0x488340){for(const [_0x3b5c3e,_0x25cfd0]of _0x5d581a['markers']){const _0x47efbe=_0x132eb5['_createFromRanges'](_0x25cfd0['getTransformedByOperation'](_0x488340));_0x5d581a['markers']['set'](_0x3b5c3e,_0x47efbe);}}function Ns(_0x16a0fe,_0x450c12,_0x4d7d21){const _0x3edc5b=_0x16a0fe['plugins']['get']('DocumentCompare');let _0x3a7438=_0x16a0fe['model']['createPositionAt'](_0x4d7d21,Number['POSITIVE_INFINITY']),_0x321d64=_0x16a0fe['model']['createPositionAt'](_0x4d7d21,0x0);for(const _0x5e8d53 of _0x450c12){let _0x373f61,_0x3d11a1;if(_0x3edc5b['isMarkedRemoveOperation'](_0x5e8d53))_0x373f61=_0x5e8d53['newRange']['start'],_0x3d11a1=_0x5e8d53['newRange']['end'];else switch(_0x3a7438=_0x3a7438['getTransformedByOperation'](_0x5e8d53),_0x321d64=_0x321d64['getTransformedByOperation'](_0x5e8d53),_0x5e8d53['type']){case'rename':_0x373f61=_0x5e8d53['position'],_0x3d11a1=_0x373f61['getShiftedBy'](0x1);break;case'addAttribute':case'removeAttribute':case'changeAttribute':_0x373f61=_0x5e8d53['range']['start'],_0x3d11a1=_0x5e8d53['range']['end'];break;case'insert':_0x373f61=_0x5e8d53['position'],_0x3d11a1=_0x373f61['getShiftedBy'](_0x5e8d53['howMany']);break;case'split':_0x373f61=_0x5e8d53['splitPosition'],_0x3d11a1=_0x5e8d53['moveTargetPosition'];break;case'merge':{const _0x5c48da=_0x5e8d53['targetPosition']['path']['slice'](0x0,-0x1);_0x373f61=_0x16a0fe['model']['createPositionFromPath'](_0x4d7d21,_0x5c48da),_0x3d11a1=_0x373f61['getShiftedBy'](0x1);break;}case'remove':{const _0x59145f=_0x5e8d53['howMany'],_0x22dba0=_0x5e8d53['sourcePosition']['_getTransformedByInsertion'](_0x5e8d53['targetPosition'],_0x59145f),_0x519ca8=_0x5e8d53['getMovedRangeStart']();'remove'==_0x5e8d53['type']?(_0x373f61=_0x22dba0,_0x3d11a1=_0x22dba0):(_0x373f61=_0x519ca8,_0x3d11a1=_0x519ca8['getShiftedBy'](_0x59145f));break;}}_0x373f61&&_0x373f61['isBefore'](_0x3a7438)&&(_0x3a7438=_0x373f61['clone'](),_0x3a7438['stickiness']='toNone'),_0x3d11a1&&_0x3d11a1['isAfter'](_0x321d64)&&(_0x321d64=_0x3d11a1['clone'](),_0x321d64['stickiness']='toNone');}return _0x16a0fe['model']['createSelection'](_0x16a0fe['model']['createRange'](_0x3a7438,_0x321d64));}function vs(_0x5bd3ab,_0x2873e7){ys(_0x5bd3ab,_0x2873e7,'forward');const _0x1d0ab9=_0x2873e7['getFirstRange']();_0x2873e7['setTo']([]),_0x2873e7['setTo'](_0x1d0ab9,{'backward':!0x0}),ys(_0x5bd3ab,_0x2873e7,'backward');}function ys(_0x37adae,_0x4abe01,_0x182c92){let _0x5b236a=0x14;for(;_0x5b236a;){_0x37adae['modifySelection'](_0x4abe01,{'unit':'word','direction':_0x182c92}),_0x5b236a--;const _0x297858=_0x4abe01['focus']['forward'==_0x182c92?'nodeBefore':'nodeAfter'];if(_0x297858&&_0x297858['is']('element')&&_0x37adae['schema']['isBlock'](_0x297858)&&_0x37adae['schema']['isObject'](_0x297858))break;}}function xs(_0x377bcb,_0x32cc6b){for(const [_0x151098,_0x467c47]of _0x377bcb['markers']){const _0x50d6df=_0x467c47['_getTransformedByDeletion'](_0x32cc6b['start'],_0x32cc6b['end']['offset']-_0x32cc6b['start']['offset']);null!=_0x50d6df?_0x377bcb['markers']['set'](_0x151098,_0x50d6df):_0x377bcb['markers']['delete'](_0x151098);}}class Ls extends ht(){['id'];['interactionId'];['type'];['sources']=[];['parsedContent']=new _0x539efd([]);['parsedMergedContent']=new _0x539efd([]);['changeGroups']=[];['areActionsDisabled']=!0x1;['documentContextContent'];['aiResponseParser'];['aiResponseApplier'];['editor'];['cachedSuggestionContentParts']={'withDiff':[],'withoutDiff':[]};constructor({type:_0x3c1cad,content:_0x2675b5='',isDone:_0x56af0f=!0x1,interactionId:_0xbd1a72,areActionsDisabled:_0x4c1887,documentContextContent:_0x171e5e,editor:_0x56f150,id:_0x4f9d4e}){super(),this['id']=_0x4f9d4e||at(),this['interactionId']=_0xbd1a72,this['type']=_0x3c1cad,this['areActionsDisabled']=!!_0x4c1887,this['editor']=_0x56f150,this['aiResponseParser']=new bs(),this['aiResponseApplier']=new Rs(),this['documentContextContent']=As(_0x171e5e||''),this['set']('isDone',_0x56af0f),this['on']('change:content',()=>{this['onContentChange']();}),this['set']('content',_0x2675b5);}['appendContent'](_0x9cdcec){this['set']('content',this['content']+_0x9cdcec);}['done'](){this['isDone']||(this['set']('isDone',!0x0),this['onContentChange']());}['destroy'](){this['stopListening']();}['setChangeGroupState'](_0x13ab05,_0x536424){this['changeGroups'][_0x13ab05]['state']=_0x536424,this['fire']('replyChangeGroupStateUpdated',{'reply':this,'index':_0x13ab05,'state':_0x536424});}['getContentParts']({showDiff:_0x32f60f,groupIndex:_0x2d8dae}){if(!this['editor'])throw new ot('ai-get-editor-from-context-no-editor',null,{'aiReply':this});const _0x5a549f=this['_getCachedContentParts'](_0x32f60f,_0x2d8dae);if(_0x5a549f)return _0x5a549f;let _0x51c58d=[];if(void 0x0===_0x2d8dae)_0x51c58d=this['changeGroups'];else{const _0x3896b4=this['changeGroups']['find'](({index:_0x7baf3c})=>_0x7baf3c===_0x2d8dae);if(!_0x3896b4)throw new ot('ai-reply-get-content-parts-group-not-found',null,{'aiReply':this,'groupIndex':_0x2d8dae});_0x51c58d=[_0x3896b4];}const _0x53b919=Os({'editor':this['editor'],'showDiff':_0x32f60f,'changeGroups':_0x51c58d,'documentContextContent':this['documentContextContent']});return this['_setCachedContentParts'](_0x32f60f,_0x53b919),_0x53b919;}['_getCachedContentParts'](_0x521d01,_0x646796){const _0x300832=_0x521d01?'withDiff':'withoutDiff';if(!this['cachedSuggestionContentParts'][_0x300832]['length'])return null;const _0x352d5b=this['cachedSuggestionContentParts'][_0x300832];if(void 0x0===_0x646796)return _0x352d5b['length']>0x0&&_0x352d5b['length']!==this['changeGroups']['length']?(this['_setCachedContentParts'](_0x521d01,null),null):_0x37806b(_0x352d5b);{const _0x2206e2=_0x352d5b['find'](({index:_0x722647})=>_0x722647===_0x646796);if(_0x2206e2)return[_0x37806b(_0x2206e2)];}return null;}['_setCachedContentParts'](_0x2c98b5,_0x24a4fa){const _0x1ad06b=_0x2c98b5?'withDiff':'withoutDiff';_0x24a4fa?_0x24a4fa['forEach'](_0x209034=>{const _0x3ea464=this['cachedSuggestionContentParts'][_0x1ad06b],_0x2a39a1=_0x3ea464['find'](({index:_0x5e4683})=>_0x5e4683===_0x209034['index']);if(_0x2a39a1){const _0x30aaf7=_0x3ea464['indexOf'](_0x2a39a1);_0x3ea464['splice'](_0x30aaf7,0x1,_0x209034);}else _0x3ea464['push'](_0x209034);}):this['cachedSuggestionContentParts'][_0x1ad06b]['length']=0x0;}['onContentChange'](){if('modification'===this['type']){this['parsedContent']=this['aiResponseParser']['parseAndNormalizeHTML'](this['content']);const _0x3144b9=this['changeGroups'];this['updateChangeGroups']();const _0x1b48c0=this['_getDifferentChangeGroups'](_0x3144b9,this['changeGroups']);(_0x1b48c0['length']||this['isDone'])&&(this['fire']('replyContentUpdated',this,_0x1b48c0),this['cachedSuggestionContentParts']['withDiff']['length']=this['cachedSuggestionContentParts']['withoutDiff']['length']=0x0);}else this['parsedContent']=this['aiResponseParser']['convertMarkdownToHTML'](this['content']),this['fire']('replyContentUpdated',this);}['_getDifferentChangeGroups'](_0x51f9bb,_0x4fb758){const _0x561f2b=[];for(const _0x2a00f5 of _0x4fb758){const _0x5308d4=_0x51f9bb[_0x2a00f5['index']];_0x5308d4?_0x5308d4['changes']['length']!==_0x2a00f5['changes']['length']?_0x561f2b['push'](_0x2a00f5):_0x5308d4['changes']['forEach']((_0x2054cf,_0x52992b)=>{const _0x2e55cb=_0x2a00f5['changes'][_0x52992b];_0x2054cf['id']!==_0x2e55cb['id']&&_0x561f2b['push'](_0x2a00f5);}):_0x561f2b['push'](_0x2a00f5);}return _0x561f2b;}['updateChangeGroups'](){const _0x37ce8f=new _0x507e32('p',{},[new _0x507e32('span',{'style':'color:\x20#808080;\x20font-style:\x20italic'},[new _0x28eb0b(cs(this['editor']['locale'],'AI_SUGGESTION_CONTENT_PART_REMOVED'))])]),_0x1d78d7=this['aiResponseApplier']['merge'](this['parsedContent'],this['documentContextContent']['cloneNode'](!0x0),{'markUnstableElements':!this['isDone'],'replaceRemovedWith':_0x37ce8f,'cutAfterLastChange':!this['isDone']});if(!_0x1d78d7['modifiedNodeIds']['length']&&!this['isDone'])return;this['parsedMergedContent']=_0x1d78d7['parsedContent'];let _0x29f585=[];if(_0x5e6828(_0x4caf93=>{const _0x3b0785=ps(_0x4caf93,'data-id');if(!_0x3b0785||!_0xf7c472(_0x3b0785))return!0x1;const _0x1d9cab=[_0x4caf93,...Cs(_0x4caf93)]['at'](-0x2);if(_0x4caf93!=_0x1d9cab){const _0x39d2ae=ps(_0x1d9cab,'data-id');_0xf7c472(_0x39d2ae)||(_0x29f585['push']({'node':_0x1d9cab,'id':_0x39d2ae,'type':'modified'}),_0x1d78d7['modifiedNodeIds']['push'](_0x39d2ae));}else _0x1d78d7['modifiedNodeIds']['includes'](_0x3b0785)?_0x29f585['push']({'node':_0x4caf93,'type':'modified','id':_0x3b0785}):_0x1d78d7['newNodeIds']['includes'](_0x3b0785)?_0x29f585['push']({'node':_0x4caf93,'type':'new','id':_0x3b0785,'anchorId':ps(_0x4caf93['previousSibling'],'data-id')}):_0x29f585['push']({'node':_0x4caf93,'type':'removed','id':_0x3b0785});return!0x0;},this['parsedMergedContent']),_0x29f585=_0x29f585['filter'](({node:_0x2cfb83})=>[...Cs(_0x2cfb83),_0x2cfb83]['every'](_0xeae38e=>!ps(_0xeae38e,'data-unstable'))),0x0==_0x29f585['length'])return;const _0x4b0492=[[_0x29f585[0x0]]];for(let _0x3f9de6=0x1;_0x3f9de6<_0x29f585['length'];_0x3f9de6++){const _0x25a6d0=_0x4b0492[_0x4b0492['length']-0x1],_0x2a7d67=_0x25a6d0[_0x25a6d0['length']-0x1];_0x29f585[_0x3f9de6]['node']['previousSibling']==_0x2a7d67['node']&&'modified'!=_0x29f585[_0x3f9de6]['type']&&'modified'!=_0x2a7d67['type']?_0x25a6d0['push'](_0x29f585[_0x3f9de6]):_0x4b0492['push']([_0x29f585[_0x3f9de6]]);}for(const _0x2dd2c8 of _0x4b0492){const _0x4348d7=_0x2dd2c8[0x0],_0x174c76=_0x2dd2c8[_0x2dd2c8['length']-0x1],_0x286007=_0x29deff(_0x4348d7['node']['previousSibling']);_0x286007&&_0x2dd2c8['unshift'](_0x286007);const _0x4c9d66=_0x29deff(_0x174c76['node']['nextSibling']);_0x4c9d66&&_0x2dd2c8['push'](_0x4c9d66);}function _0xf7c472(_0x293ecd){return _0x1d78d7['modifiedNodeIds']['includes'](_0x293ecd)||_0x1d78d7['newNodeIds']['includes'](_0x293ecd)||_0x1d78d7['removedNodeIds']['includes'](_0x293ecd);}function _0x29deff(_0x5977e7){if(_0x5977e7&&ps(_0x5977e7,'data-id')&&!ps(_0x5977e7,'data-unstable')){const _0x1a5bf7=ps(_0x5977e7,'data-id');if(!_0xf7c472(_0x1a5bf7))return{'node':_0x5977e7,'type':'context','id':_0x1a5bf7};}return null;}this['changeGroups']=_0x4b0492['map']((_0x1955af,_0x19549a)=>({'changes':_0x1955af,'state':'pending','index':_0x19549a}));}}const Ds=['interactionCreated','interactionStarted','interactionStopped','interactionFinished','interactionDestroyed','replyCreated','replyContentUpdated','replyChangeGroupStateUpdated','setConversationTitle','webSearchStarted','webSearchFinished','reasoningStarted','reasoningFinished','toolDataReceived','error'];class Ps extends Et(){['id'];['replies']=[];['currentReply'];['messageId'];['actionCallId'];['currentRequest'];['connector'];['isStopped']=!0x1;['isDestroyed']=!0x1;['editor'];['_isReasoning']=!0x1;['_isWebSearching']=!0x1;constructor({connector:_0x3bd172,editor:_0x531e75}){super(),this['id']=at(),this['connector']=_0x3bd172,this['isStopped']=!0x0,this['editor']=_0x531e75;}async['start'](){const _0x1304bf=[];let _0x5de79c,_0x2092e1,_0x179185;this['isStopped']=!0x1;try{this['currentRequest']=await this['sendRequest'](),this['fire']('interactionStarted',this);const _0x5d3808=await this['currentRequest']['getStream']();for await(const _0x49ef37 of _0x5d3808){if(this['isStopped'])return;if('error'==_0x49ef37['event'])return void this['fire']('error',{'error':new ot('ai-chat-interaction-error',this)});switch(_0x49ef37['event']){case'message-metadata':this['messageId']=_0x49ef37['data']['messageId'];break;case'action-metadata':this['actionCallId']=_0x49ef37['data']['callId'];break;case'conversation-title':this['setConversationTitle'](_0x49ef37['data']['conversationTitle'],!0x0);break;case'source':_0x1304bf['push'](_0x49ef37['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'](),_0x5de79c='modification-delta'==_0x49ef37['event']?'modification':'text',_0x2092e1='modification-delta'==_0x49ef37['event']?_0x49ef37['data']['id']:void 0x0,this['currentReply']&&this['currentReply']['type']!=_0x5de79c&&(this['currentReply']['done'](),this['currentReply']=void 0x0),this['currentReply']||(this['currentReply']=this['createReply']({'type':_0x5de79c,'interactionId':this['id'],'id':_0x2092e1}),'modification'==_0x5de79c&&(this['currentReply']['sources']=_0x1304bf['splice'](0x0))),this['currentReply']['appendContent'](_0x49ef37['data']['textDelta']);break;case'mcp-tool-result':_0x179185=JSON['parse'](_0x49ef37['data']['result']),this['_handleToolResultData']({'toolName':_0x49ef37['data']['toolName'],'data':_0x179185['data'],'attributes':_0x179185['attributes']});break;case'mcp-tool-notification':this['_handleToolNotificationData']({'toolName':_0x49ef37['data']['toolName'],'data':_0x49ef37['data']['data']});}}}finally{this['isStopped']||(this['currentReply']&&_0x1304bf['length']>0x0&&(this['currentReply']['sources']=_0x1304bf['splice'](0x0)),this['_finalizeInteraction'](),this['fire']('interactionFinished',this));}}['stop'](){this['isStopped']||(this['_finalizeInteraction'](),this['fire']('interactionStopped',this));}['getReply'](_0x5a7e05){return this['replies']['find'](_0x28a0b9=>_0x28a0b9['id']===_0x5a7e05);}['destroy'](){this['isDestroyed']||(this['stop'](),this['replies']['forEach'](_0x503658=>_0x503658['destroy']()),this['replies']=[],this['isDestroyed']=!0x0,this['fire']('interactionDestroyed',this),this['stopListening']());}['createReply'](_0x563265){const _0x251a36=new Ls({'editor':this['editor'],'documentContextContent':this['getDocumentContext']()?.['content'],..._0x563265});return this['replies']['push'](_0x251a36),_0x251a36['delegate'](...Ds)['to'](this),this['fire']('replyCreated',_0x251a36),_0x251a36;}['setConversationTitle'](_0x24f423,_0x2b8bd4=!0x1){this['fire']('setConversationTitle',_0x24f423,_0x2b8bd4);}['resetWebSearchState'](){this['_isWebSearching']&&(this['_isWebSearching']=!0x1,this['fire']('webSearchFinished',this));}['resetReasoningState'](){this['_isReasoning']&&(this['_isReasoning']=!0x1,this['fire']('reasoningFinished',this));}['_handleToolResultData'](_0x4190fc){this['fire']('toolDataReceived',{'type':'result','toolName':_0x4190fc['toolName'],'data':structuredClone(_0x4190fc['data']||{}),'attributes':structuredClone(_0x4190fc['attributes']||{})},this);}['_handleToolNotificationData'](_0x2c837d){this['fire']('toolDataReceived',{'type':'notification','toolName':_0x2c837d['toolName'],'data':structuredClone(_0x2c837d['data'])},this);}['_finalizeInteraction'](){this['isStopped']=!0x0,this['currentRequest']&&this['currentRequest']['abortController']['abort'](),this['currentReply']&&this['currentReply']['done'](),this['currentRequest']=this['currentReply']=void 0x0;}}const Hs=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']]),Ms=['contextItemAdded','contextItemRemoved','contextItemLoadingEnded','contextSent','error','addContextOptionsChanged','sourceResourcesLoaded','resourceStateChanged','uploadProgressChanged'];class Us extends ht(){['_connector'];['_config'];['_ownerId'];constructor({connector:_0xbfc654,config:_0x124e75,ownerId:_0x357481}){super(),this['_connector']=_0xbfc654,this['_config']=_0x124e75,this['_ownerId']=_0x357481;}['init'](){this['_pendingContextItems']=new Map(),this['_conversationContextItems']=new Map(),this['_ongoingUploads']=new Map(),this['_ongoingUploadOperations']=new Map(),this['_setAddContextOptionsDefaultState']();}['getPendingContextItems'](){return this['_pendingContextItems'];}async['populateFromMessage'](_0x2f1979){const _0x46972f=await this['_createContextItemFromContent'](_0x2f1979);return this['_addToConversationContextItem'](_0x46972f),'current-document'===_0x46972f['uiId']&&this['_toggleAddCurrentDocumentOptionVisibility'](),_0x46972f;}async['_createContextItemFromContent'](_0x3af96e){if('document'===_0x3af96e['type']){const _0x378027=await this['_connector']['fetchDocument'](this['_ownerId'],_0x3af96e['id'])['getDocument']();return{'id':'current-document','uiId':'current-document','label':'Current\x20document','type':_0x3af96e['type'],'content':_0x378027['content'],'hidden':this['_conversationContextItems']['has']('current-document'),'version':_0x378027['attributes']?.['version'],'sessionId':_0x378027['attributes']?.['sessionId']};}if('mcp-tool-context'===_0x3af96e['type'])return{'id':_0x3af96e['id'],'uiId':_0x3af96e['id'],'label':_0x3af96e['data']?.['label']||_0x3af96e['id'],'type':'mcp-tool-context','mcpServerName':_0x3af96e['mcpServerName'],'toolName':_0x3af96e['toolName'],'data':_0x3af96e['data']||{}};return{'id':_0x3af96e['id'],'uiId':_0x3af96e['id'],'label':_0x3af96e['attributes']?.['label']||_0x3af96e['name']||_0x3af96e['url']||_0x3af96e['id'],'type':_0x3af96e['type'],..._0x3af96e?.['attributes']?.['resourceId']?{'resourceId':_0x3af96e['attributes']?.['resourceId']}:{}};}['getSentContextItems'](){return new Map(this['_conversationContextItems']);}['removeFromContext'](_0x32b665){const _0x5109fa=this['_pendingContextItems']['get'](_0x32b665);_0x5109fa?.['isReadOnly']||this['_removeContextItem'](_0x32b665);}['clearPendingContextItems'](){if(0x0===this['_pendingContextItems']['size'])return;for(const _0x2ddf30 of this['_pendingContextItems']['values']())this['_removeContextItem'](_0x2ddf30['uiId']);const _0x327d6f=this['_conversationContextItems']['get']('current-document')||this['_pendingContextItems']['get']('current-document');_0x327d6f&&this['_addContextItem']({..._0x327d6f,'isReadOnly':!0x0,'hidden':!0x0});}['addToConversationContext'](_0x27c23a){for(const _0x23a36f of _0x27c23a['values']())this['_addToConversationContextItem'](_0x23a36f);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'](_0x280fde){return Array['from'](_0x280fde['values']())['map'](_0x32f849=>this['_mapContextItemToRequestData'](_0x32f849))['filter'](_0x40f3ad=>null!==_0x40f3ad);}async['addFilesToContext'](_0x10f1db,_0x3cea2b,_0x2a4847='file'){const _0x55765e='files-'+at();this['_startUploadOperation'](_0x55765e);try{await Promise['all'](_0x10f1db['map'](async _0x487cb8=>{const _0xa3b873='file-'+at(),_0x20da8e=_0x5b8af7(_0x487cb8['name']);try{this['_addContextItem']({'type':_0x2a4847,'label':_0x3cea2b?.['label']||_0x20da8e,'uiId':_0xa3b873,'resourceId':_0x3cea2b?.['resourceId']},!0x0);const _0xd9008b=this['_connector']['uploadFile'](this['_ownerId'],_0x487cb8,_0x3cea2b);this['_ongoingUploads']['set'](_0xa3b873,_0xd9008b['abortController']);const {id:_0x2aadea}=await _0xd9008b['getId']();this['_ongoingUploads']['delete'](_0xa3b873),this['_finishContextItemLoading']({'type':_0x2a4847,'id':_0x2aadea,'label':_0x3cea2b?.['label']||_0x20da8e,'uiId':_0xa3b873,'resourceId':_0x3cea2b?.['resourceId']},!0x1);}catch(_0x44e451){this['_ongoingUploads']['delete'](_0xa3b873);if(!(_0x44e451 instanceof ot&&_0x44e451['message']['startsWith']('ai-request-aborted'))){const _0x5ba1a2=Hs['get'](_0x44e451['code'])||'ai-chat-file-upload-failed',_0x11ab17=new ot(_0x5ba1a2,null,{'fileName':_0x20da8e,..._0x44e451});_0x11ab17['stack']=_0x44e451['stack'],this['fire']('error',{'error':_0x11ab17});}this['_removeContextItem'](_0xa3b873);}}));}finally{this['_finishUploadOperation'](_0x55765e);}}['addCurrentDocumentToContext'](_0x1981b4){if(this['isCurrentDocumentInContext']()||!this['_addContextOptionsState']['document']['enabled'])return;const _0x323e38={'type':'document','uiId':'current-document','label':_0x1981b4,'isReadOnly':this['_conversationContextItems']['has']('current-document'),'hidden':this['_conversationContextItems']['has']('current-document')};this['_addContextItem'](_0x323e38);}async['updateCurrentDocument'](_0x251558,_0x289561,_0x42e1f5,_0x192d5f){const _0x243eda=this['_pendingContextItems']['get']('current-document');if(_0x243eda&&_0x251558){_0x243eda['selection']=_0x192d5f?_0x192d5f['map'](_0x55394e=>({'start':_0x55394e['start'],'end':_0x55394e['end']})):[];try{if(_0x243eda['version']===_0x289561)return;const {id:_0x3bf56d}=await this['_connector']['uploadDocument'](this['_ownerId'],_0x251558,{'version':_0x289561,'sessionId':_0x42e1f5})['getId']();_0x243eda['id']=_0x3bf56d,_0x243eda['content']=_0x251558,_0x243eda['version']=_0x289561,_0x243eda['sessionId']=_0x42e1f5;}catch(_0x4fc50e){const _0x5a1aa6=new ot('ai-chat-document-upload-failed',null);_0x5a1aa6['stack']=_0x4fc50e['stack'],this['fire']('error',{'error':_0x5a1aa6});}}}['addSelectionToContext'](_0x191a20){this['_addContextItem']({'type':'selection','label':_0x191a20,'uiId':'selection','content':_0x191a20});}['removeSelectionFromContext'](){this['_removeContextItem']('selection');}async['addUrlToContext'](_0x130875,_0x594964){const _0x57c411='url-'+at();this['_startUploadOperation'](_0x57c411);const _0xf9e43f='url-'+at();try{this['_addContextItem']({'type':'web-resource','label':_0x594964?.['label']||_0x130875,'uiId':_0xf9e43f,'resourceId':_0x594964?.['resourceId']},!0x0);const _0xde832b=this['_connector']['uploadUrl'](this['_ownerId'],_0x130875,_0x594964);this['_ongoingUploads']['set'](_0xf9e43f,_0xde832b['abortController']);const {id:_0x494123}=await _0xde832b['getId']();this['_ongoingUploads']['delete'](_0xf9e43f),this['_finishContextItemLoading']({'type':'web-resource','id':_0x494123,'label':_0x594964?.['label']||_0x130875,'uiId':_0xf9e43f,'resourceId':_0x594964?.['resourceId']},!0x1);}catch(_0x596797){this['_ongoingUploads']['delete'](_0xf9e43f),(_0x596797['message']['startsWith']('ai-request-aborted')||this['fire']('error',{'error':new ot('ai-chat-url-upload-failed',this,{'url':_0x130875,'originalError':_0x596797}),'url':_0x130875}),this['_removeContextItem'](_0xf9e43f));}finally{this['_finishUploadOperation'](_0x57c411);}}['addToolItemToContext'](_0x343956){_0x343956['id']=_0x343956['id']??at()['substring'](0x0,0x15),this['_pendingContextItems']['set'](_0x343956['uiId'],_0x343956),this['fire']('contextItemAdded',{'contextItem':_0x343956,'isLoading':!0x1});}async['loadSourceResources'](_0x5177ab,_0x282f42,_0x383351){const _0x4be43e=this['_addContextOptionsState']['sources']['find'](_0x12eee0=>_0x12eee0['id']===_0x5177ab);if(!_0x4be43e)return this['fire']('error',{'error':new ot('ai-chat-source-not-found',this,{'sourceId':_0x5177ab}),'sourceId':_0x5177ab}),[];try{const _0x255e94=(await _0x4be43e['getResources'](_0x282f42))['map'](_0x12fda1=>{const _0x35daaa=this['_isResourceInContext'](_0x12fda1['id']);return{..._0x12fda1,'isInContext':_0x35daaa};});return _0x4be43e['resources']=_0x255e94,this['fire']('sourceResourcesLoaded',{'sourceId':_0x5177ab,'source':_0x4be43e,'resources':_0x255e94,'uid':_0x383351}),_0x255e94;}catch(_0x17b3f6){return this['fire']('error',{'error':new ot('ai-chat-source-resources-load-failed',this,{'sourceId':_0x5177ab,'originalError':_0x17b3f6}),'sourceId':_0x5177ab,'sourceLabel':_0x4be43e['label']}),[];}}async['addResourceToContext'](_0x1ad039,_0x43c419){if(this['_isResourceInContext'](_0x43c419['id']))return;let _0x4e2a8c=_0x43c419['data'];if(!_0x4e2a8c&&_0x1ad039['getData'])try{_0x4e2a8c=await _0x1ad039['getData'](_0x43c419['id']);}catch(_0x9a4be5){return void this['fire']('error',{'error':new ot('ai-chat-resource-load-failed',this,{'resourceId':_0x43c419['id'],'sourceId':_0x1ad039['id'],'originalError':_0x9a4be5}),'resourceId':_0x43c419['id'],'sourceId':_0x1ad039['id']});}if(_0x4e2a8c)switch(_0x43c419['type']){case'web-resource':if('string'!=typeof _0x4e2a8c)return void this['fire']('error',{'error':new ot('ai-chat-context-invalid-data',this,{'resourceId':_0x43c419['id'],'sourceId':_0x1ad039['id'],'expectedType':'string','actualType':typeof _0x4e2a8c}),'resourceId':_0x43c419['id'],'sourceId':_0x1ad039['id']});await this['addUrlToContext'](_0x4e2a8c,{'label':_0x43c419['label'],'resourceId':_0x43c419['id']});break;case'file':if(!(_0x4e2a8c instanceof File))return void this['fire']('error',{'error':new ot('ai-chat-context-invalid-data',this,{'resourceId':_0x43c419['id'],'sourceId':_0x1ad039['id'],'expectedType':'File','actualType':typeof _0x4e2a8c}),'resourceId':_0x43c419['id'],'sourceId':_0x1ad039['id']});await this['addFilesToContext']([_0x4e2a8c],{'label':_0x43c419['label'],'resourceId':_0x43c419['id']});break;case'text':if('object'!=typeof _0x4e2a8c||!('content'in _0x4e2a8c)||!('type'in _0x4e2a8c))return void this['fire']('error',{'error':new ot('ai-chat-context-invalid-data',this,{'resourceId':_0x43c419['id'],'sourceId':_0x1ad039['id'],'expectedType':'object\x20with\x20content\x20and\x20type\x20properties','actualType':typeof _0x4e2a8c}),'resourceId':_0x43c419['id'],'sourceId':_0x1ad039['id']});_0x4e2a8c=Us['_convertTextResourceToFile'](_0x4e2a8c,_0x43c419['label']),await this['addFilesToContext']([_0x4e2a8c],{'label':_0x43c419['label'],'resourceId':_0x43c419['id']},'text');break;case'mcp-tool-context':break;default:this['fire']('error',{'error':new ot('ai-chat-context-unsupported-type',this,{'resourceId':_0x43c419['id'],'sourceId':_0x1ad039['id'],'resourceType':_0x43c419['type']}),'resourceId':_0x43c419['id'],'sourceId':_0x1ad039['id']});}else this['fire']('error',{'error':new ot('ai-chat-resource-no-data',this,{'resourceId':_0x43c419['id'],'sourceId':_0x1ad039['id']}),'resourceId':_0x43c419['id'],'sourceId':_0x1ad039['id']});}static['_convertTextResourceToFile'](_0x476487,_0xa2b512){switch(_0x476487['type']){case'markdown':return new File([_0x476487['content']],_0xa2b512,{'type':'text/markdown'});case'html':return new File([_0x476487['content']],_0xa2b512,{'type':'text/html'});default:return new File([_0x476487['content']],_0xa2b512,{'type':'text/plain'});}}static['_mapContextItemToRequestData'](_0x3b8356){switch(_0x3b8356['type']){case'file':case'text':return{'type':'file','id':_0x3b8356['id']};case'web-resource':return{'type':'web-resource','id':_0x3b8356['id']};case'document':return{'type':'document','id':_0x3b8356['id'],..._0x3b8356['selection']?.['length']&&{'selection':_0x3b8356['selection']}};case'mcp-tool-context':{const _0x482700=_0x3b8356;return{'type':'mcp-tool-context','mcpServerName':_0x482700['mcpServerName'],'toolName':_0x482700['toolName'],'data':_0x482700['data'],'id':_0x482700['id']};}default:return null;}}['_addContextItem'](_0x9f02f1,_0x73a876=!0x1){if(this['_pendingContextItems']['set'](_0x9f02f1['uiId'],_0x9f02f1),_0x9f02f1['hidden']||this['fire']('contextItemAdded',{'contextItem':_0x9f02f1,'isLoading':_0x73a876}),'current-document'===_0x9f02f1['uiId']&&this['_toggleAddCurrentDocumentOptionVisibility'](),_0x9f02f1['resourceId']){const _0x1499b2=this['_findSourceIdsByResourceId'](_0x9f02f1['resourceId']);_0x1499b2&&_0x1499b2['forEach'](_0x35c3f0=>{this['_updateResourceInContextState'](_0x35c3f0,_0x9f02f1['resourceId'],!0x0);});}}['_removeContextItem'](_0x24f0a6){const _0x47ff9d=this['_pendingContextItems']['get'](_0x24f0a6),_0x236fcf=this['_ongoingUploads']['get'](_0x24f0a6);if(_0x236fcf&&(_0x236fcf['abort'](),this['_ongoingUploads']['delete'](_0x24f0a6)),_0x47ff9d?.['resourceId']){const _0x593ca2=this['_findSourceIdsByResourceId'](_0x47ff9d['resourceId']);_0x593ca2&&_0x593ca2['forEach'](_0x1f72e7=>{this['_updateResourceInContextState'](_0x1f72e7,_0x47ff9d['resourceId'],!0x1);});}this['_pendingContextItems']['delete'](_0x24f0a6),this['fire']('contextItemRemoved',{'uiId':_0x24f0a6,'type':_0x47ff9d?.['type']}),'current-document'===_0x24f0a6&&this['_toggleAddCurrentDocumentOptionVisibility']();}['_finishContextItemLoading'](_0xc72e08,_0x2335f9){if(this['_pendingContextItems']['has'](_0xc72e08['uiId'])&&(this['_pendingContextItems']['set'](_0xc72e08['uiId'],_0xc72e08),this['fire']('contextItemLoadingEnded',{'contextItem':_0xc72e08,'isLoading':_0x2335f9}),_0xc72e08['resourceId'])){const _0x535cc2=this['_findSourceIdsByResourceId'](_0xc72e08['resourceId']);_0x535cc2&&_0x535cc2['forEach'](_0x511b08=>{this['_updateResourceInContextState'](_0x511b08,_0xc72e08['resourceId'],!0x0);});}}['_addToConversationContextItem'](_0x37bbd7){this['_conversationContextItems']['set'](_0x37bbd7['uiId'],_0x37bbd7);}['_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'](_0x5738f2=>({..._0x5738f2,'enabled':!0x0}))??[]},this['fire']('addContextOptionsChanged',{'options':this['_addContextOptionsState']});}['_getCustomSourcesInitialState'](){return this['_config']?.['sources']?.['map'](_0x5a99e=>({..._0x5a99e,'resources':[]}))??[];}['_toggleAddCurrentDocumentOptionVisibility'](){const _0x42dd96=this['isCurrentDocumentInContext']()||this['isCurrentDocumentInConversation']();this['_addContextOptionsState']['document']['isHidden']=_0x42dd96,this['fire']('addContextOptionsChanged',{'options':this['_addContextOptionsState']});}['_isResourceInContext'](_0x16e817){for(const _0x20db47 of this['_pendingContextItems']['values']())if(_0x20db47['resourceId']===_0x16e817)return!0x0;for(const _0x5e32ff of this['_conversationContextItems']['values']())if(_0x5e32ff['resourceId']===_0x16e817)return!0x0;return!0x1;}['_findSourceIdsByResourceId'](_0x12d9c6){const _0x3ae3a0=[];for(const _0x5017f8 of this['_addContextOptionsState']['sources']){_0x5017f8['resources']['find'](_0x857b4f=>_0x857b4f['id']===_0x12d9c6)&&_0x3ae3a0['push'](_0x5017f8['id']);}return 0x0===_0x3ae3a0['length']?null:_0x3ae3a0;}['_updateResourceInContextState'](_0x50428d,_0x44ee59,_0x1c0772){const _0x30c19c=this['_addContextOptionsState']['sources']['find'](_0x531d47=>_0x531d47['id']===_0x50428d);if(!_0x30c19c)return;const _0x130319=_0x30c19c['resources']['find'](_0x594aaa=>_0x594aaa['id']===_0x44ee59);_0x130319&&(_0x130319['isInContext']=_0x1c0772,this['fire']('resourceStateChanged',{'sourceId':_0x50428d,'resourceId':_0x44ee59,'isInContext':_0x1c0772}));}['_startUploadOperation'](_0x1dd80e){this['_ongoingUploadOperations']['set'](_0x1dd80e,!0x0),this['_ongoingUploadOperations']['size']&&this['fire']('uploadProgressChanged',{'isUploadInProgress':!0x0});}['_finishUploadOperation'](_0xb546f1){this['_ongoingUploadOperations']['delete'](_0xb546f1),0x0===this['_ongoingUploadOperations']['size']&&this['fire']('uploadProgressChanged',{'isUploadInProgress':!0x1});}}const Vs=['capabilitiesUpdated'];class Bs extends Et(){['_isWebSearchEnabled'];['_isReasoningEnabled'];constructor(){super(),this['_isWebSearchEnabled']=!0x1,this['_isReasoningEnabled']=!0x1;}['init'](){this['reset']();}['reset'](){this['setWebSearch'](!0x1),this['setReasoning'](!0x1);}['getCapabilitiesConfig'](){return{'isWebSearchEnabled':this['_isWebSearchEnabled'],'isReasoningEnabled':this['_isReasoningEnabled']};}static['getCapabilitiesRequestData'](_0x3a8572){const _0x367295={};return _0x3a8572&&_0x3a8572['isWebSearchEnabled']&&(_0x367295['webSearch']={}),_0x3a8572&&_0x3a8572['isReasoningEnabled']&&(_0x367295['reasoning']={}),_0x367295;}['toggleWebSearch'](){this['setWebSearch'](!this['_isWebSearchEnabled']);}['toggleReasoning'](){this['setReasoning'](!this['_isReasoningEnabled']);}['setWebSearch'](_0x4e33dd){_0x4e33dd!==this['_isWebSearchEnabled']&&(this['_isWebSearchEnabled']=_0x4e33dd,this['fire']('capabilitiesUpdated',this['getCapabilitiesConfig']()));}['setReasoning'](_0x4aadaf){_0x4aadaf!==this['_isReasoningEnabled']&&(this['_isReasoningEnabled']=_0x4aadaf,this['fire']('capabilitiesUpdated',this['getCapabilitiesConfig']()));}}class Gs extends Ps{['userMessage'];['conversationId'];['contextItems']=new Map();['capabilities'];['model'];['attributes'];constructor(_0x3126d3){super(_0x3126d3),this['conversationId']=_0x3126d3['conversationId'],this['contextItems']=_0x3126d3['contextItems'],this['capabilities']=_0x3126d3['capabilities'],this['userMessage']=_0x3126d3['userMessage'],this['model']=_0x3126d3['model'],this['attributes']=_0x3126d3['attributes'];}async['sendRequest'](){return this['connector']['queryAssistant']({'message':this['userMessage'],'conversationId':this['conversationId'],'parts':Us['mapContextItemsToRequestData'](this['contextItems']),'capabilities':Bs['getCapabilitiesRequestData'](this['capabilities']),'model':this['model'],'attributes':this['attributes']});}['getDocumentContext'](){return this['contextItems']['get']('current-document');}}class Fs extends Et(){['id'];['isStarted']=!0x1;['isFromHistory'];['interactions']=[];['currentInteraction'];['selectedModel'];['connector'];['options'];constructor(_0x2d5ea6){super(),this['options']=_0x2d5ea6,this['connector']=_0x2d5ea6['connector'],this['chatModels']=_0x2d5ea6['chatModels'],this['id']=_0x2d5ea6['conversationId'],this['isFromHistory']=_0x2d5ea6['isFromHistory'];}async['init'](_0x12dd09){try{this['chatContext']=new Us({'connector':this['connector'],'config':_0x12dd09,'ownerId':this['id']}),this['chatContext']['delegate'](...Ms)['to'](this),this['chatContext']['init'](),this['chatCapabilities']=new Bs(),this['chatCapabilities']['delegate'](...Vs)['to'](this),this['chatCapabilities']['init']();const _0x2345ae=await this['chatModels']['getAvailableModels']();this['fire']('conversationInitialized',{'availableModels':_0x2345ae});const _0x57859f=await this['chatModels']['getModel'](this['options']['selectedModelId']);_0x57859f&&await this['setModel'](_0x57859f);}catch(_0x21965f){const _0x2cfa2e=new ot('ai-chat-conversation-init-failed',null,{'message':_0x21965f['message']||_0x21965f});_0x2cfa2e['stack']=_0x21965f['stack'],this['fire']('error',{'error':_0x2cfa2e});}}async['start'](){if(this['isStarted'])throw new ot('ai-chat-conversation-already-started',null,{'conversation':this});if(!this['selectedModel'])throw new ot('ai-chat-conversation-start-no-model-selected',null,{'conversation':this});try{const {id:_0x3c964a}=await this['connector']['startConversation'](this['id'],this['options']['group'])['getConversation']();this['id']=_0x3c964a,this['isStarted']=!0x0,this['fire']('conversationStarted',{'conversationId':this['id'],'selectedModel':this['selectedModel']});}catch(_0x249eaf){const _0x3b890c=new ot('ai-chat-conversation-start-failed',null,{'message':_0x249eaf['message'],'conversationId':this['id']});throw _0x3b890c['stack']=_0x249eaf['stack'],this['fire']('error',{'error':_0x3b890c}),_0x3b890c;}}async['load'](_0x207363,_0x1f779d){try{const _0xddd02a=await this['connector']['fetchConversation'](_0x207363)['getConversation'](),_0x3fb829=await this['connector']['fetchConversationMessages'](_0x207363)['getMessages'](),_0x1b4c8b=_0x3fb829[0x0]['model'];this['isStarted']=!0x0,this['id']=_0xddd02a['id'],'title'in _0xddd02a?this['fire']('setConversationTitle',_0xddd02a['title'],!0x0):this['fire']('setConversationTitle','',!0x0);const _0x3856c8=(await this['chatModels']['getAll']())['find'](_0x4e42bc=>_0x4e42bc['id']['toLowerCase']()===_0x1b4c8b['toLowerCase']());return this['selectedModel']=_0x3856c8,this['fire']('modelSelected',{'selectedModel':_0x3856c8,'isDisabled':!0x0}),await this['_processMessagesToInteractions'](_0x3fb829,_0x1f779d,_0x1b4c8b),this['currentInteraction']=void 0x0,this;}catch(_0x4707d2){const _0x395183=new ot('ai-chat-conversation-init-from-id-failed',null,{'message':_0x4707d2['message'],'conversationId':_0x207363});throw _0x395183['stack']=_0x4707d2['stack'],this['fire']('error',{'error':_0x395183}),_0x395183;}}async['_processMessagesToInteractions'](_0x4abacf,_0x422854,_0xbf9b76){let _0x87182f;for(const _0x2689ce of _0x4abacf)if('user'===_0x2689ce['role']){const _0x2241c0=await this['_extractContextItems'](_0x2689ce),_0x40cb63={'isReasoningEnabled':Object['hasOwn'](_0x2689ce['capabilities'],'reasoning'),'isWebSearchEnabled':Object['hasOwn'](_0x2689ce['capabilities'],'webSearch')};_0x87182f=this['createInteraction']({'userMessage':_0x2689ce['prompt'],'contextItems':_0x2241c0,'capabilities':_0x40cb63,'modelId':_0xbf9b76,'attributes':_0x2689ce['attributes']}),this['currentInteraction']=_0x87182f,this['chatContext']['addToConversationContext'](this['currentInteraction']['contextItems']);}else{if('assistant'===_0x2689ce['role']&&_0x87182f){const _0x2575b1=[];for(const _0x294879 of _0x2689ce['content'])switch(_0x294879['type']){case'text':case'modification':{const _0x3428c8=_0x87182f['getDocumentContext']()?.['sessionId']!==_0x422854;_0x87182f['currentReply']=_0x87182f['createReply']({'type':_0x294879['type'],'isDone':!0x0,'interactionId':_0x87182f['id'],'areActionsDisabled':_0x3428c8}),_0x87182f['currentReply']['appendContent'](_0x294879['content']),_0x2575b1['length']>0x0&&(_0x87182f['currentReply']['sources']=_0x2575b1['splice'](0x0));break;}case'url':_0x2575b1['push'](_0x294879);break;case'mcp-tool-result':{const {data:_0x5160e7,attributes:_0x2a891f}=JSON['parse'](_0x294879['content']);_0x87182f['_handleToolResultData']({'toolName':_0x294879['toolName'],'data':_0x5160e7,'attributes':_0x2a891f});break;}}}}}async['_extractContextItems'](_0x1a691a){const _0x546c2e=new Map();if(!_0x1a691a['content'])return _0x546c2e;for(const _0x56979b of _0x1a691a['content']){const _0x1f3934=await this['chatContext']['populateFromMessage'](_0x56979b);_0x1f3934&&_0x546c2e['set'](_0x1f3934['id'],_0x1f3934);}return _0x546c2e;}async['handleUserInteraction']({userMessage:_0x34265c,attributes:_0x32d9d5}){if(!this['isStarted'])throw new ot('ai-chat-handle-user-conversation-not-initialized',null,{'conversation':this});if(this['currentInteraction'])throw new ot('ai-chat-handle-user-interaction-already-in-progress',null,{'conversation':this});try{const _0x5dcab8=this['chatContext']['getPendingContextItems'](),_0x4c3d53=this['chatCapabilities']['getCapabilitiesConfig'](),_0x5eb7ca=this['selectedModel']['id'];this['currentInteraction']=this['createInteraction']({'userMessage':_0x34265c,'contextItems':_0x5dcab8,'capabilities':_0x4c3d53,'modelId':_0x5eb7ca,'attributes':_0x32d9d5}),await this['currentInteraction']['start'](),this['chatContext']['addToConversationContext'](this['currentInteraction']['contextItems']);}catch(_0x4d575e){if(_0x4d575e instanceof ot)this['fire']('error',{'interactionId':this['currentInteraction']?this['currentInteraction']['id']:void 0x0,'error':_0x4d575e});else{const _0x2f3a0e=Hs['get'](_0x4d575e['code'])||'ai-chat-handle-user-interaction-start-failed';this['fire']('error',{'interactionId':this['currentInteraction']?this['currentInteraction']['id']:void 0x0,'error':new ot(_0x2f3a0e,null,{'error':_0x4d575e})});}}finally{this['currentInteraction']?.['stop'](),this['currentInteraction']=void 0x0;}}['createInteraction']({userMessage:_0x11be7e,contextItems:_0xe0e8c4,capabilities:_0x59599a,modelId:_0x5cd883,attributes:_0x574001}){const _0x5a8af4=new Gs({'userMessage':_0x11be7e,'contextItems':_0xe0e8c4,'capabilities':_0x59599a,'conversationId':this['id'],'connector':this['connector'],'editor':this['options']['getEditor']&&this['options']['getEditor'](),'model':_0x5cd883,'attributes':_0x574001});return _0x5a8af4['delegate'](...Ds)['to'](this),this['interactions']['push'](_0x5a8af4),this['fire']('interactionCreated',_0x5a8af4),_0x5a8af4;}['getInteraction'](_0x260379){return this['interactions']['find'](_0xaee906=>_0xaee906['id']===_0x260379);}['removeInteraction'](_0x4cfad5){const _0x4026b4=this['getInteraction'](_0x4cfad5);_0x4026b4&&(_0x4026b4['destroy'](),this['interactions']['splice'](this['interactions']['indexOf'](_0x4026b4),0x1));}get['lastInteraction'](){return this['interactions'][this['interactions']['length']-0x1];}['addCurrentDocumentToContext'](_0x7199b1){this['chatContext']['addCurrentDocumentToContext'](_0x7199b1);}async['updateCurrentDocumentInContext']({content:_0x550aa2,version:_0x549570,sessionId:_0x34fa87,selections:_0x3e727b}){await this['chatContext']['updateCurrentDocument'](_0x550aa2,_0x549570,_0x34fa87,_0x3e727b);}['getCurrentDocumentContext'](){return this['currentInteraction']?.['getDocumentContext']()?.['content']||'';}['addSelectionToContext'](_0x70478){this['chatContext']['addSelectionToContext'](_0x70478);}['removeSelectionFromContext'](){this['chatContext']['removeSelectionFromContext']();}['addFilesToContext'](_0x1088f1){this['chatContext']['addFilesToContext'](_0x1088f1);}['addUrlToContext'](_0x307d30){this['chatContext']['addUrlToContext'](_0x307d30);}['addToolItemToContext'](_0x23e669){this['chatContext']['addToolItemToContext'](_0x23e669);}['addResourceToContext'](_0x430fff,_0x2d1e6f){this['chatContext']['addResourceToContext'](_0x430fff,_0x2d1e6f);}['loadSourceResources'](_0x1a2c28,_0x388ca7,_0x2b27cf){return this['chatContext']['loadSourceResources'](_0x1a2c28,_0x388ca7,_0x2b27cf);}['removeFromContext'](_0x3b003a){this['chatContext']['removeFromContext'](_0x3b003a);}['setWebSearch'](_0x1d50f7){this['chatCapabilities']['setWebSearch'](_0x1d50f7);}['toggleWebSearch'](){this['chatCapabilities']['toggleWebSearch']();}['setReasoning'](_0x515050){this['chatCapabilities']['setReasoning'](_0x515050);}['toggleReasoning'](){this['chatCapabilities']['toggleReasoning']();}['isCurrentDocumentInContext'](){return this['chatContext']['isCurrentDocumentInContext']();}['isCurrentDocumentInConversation'](){return this['chatContext']['isCurrentDocumentInConversation']();}['isSelectionInContext'](){return this['chatContext']['isSelectionInContext']();}async['setModel'](_0x1f3794){_0x1f3794?!0x1===await this['chatModels']['isAvailable'](_0x1f3794)&&(pt('ai-chat-conversation-set-model-not-available',{'conversation':this,'model':_0x1f3794}),_0x1f3794=(await this['chatModels']['getAvailableModels']())[0x0]):(pt('ai-chat-conversation-set-model-null',{'conversation':this}),_0x1f3794=(await this['chatModels']['getAvailableModels']())[0x0]),_0x1f3794['id']!==this['selectedModel']?.['id']&&(this['selectedModel']=_0x1f3794,this['chatCapabilities']['reset'](),this['fire']('modelSelected',{'selectedModel':_0x1f3794}));}}class Ks extends Et(){['_connector'];['_config'];['_locale'];['_modelList']=[];['_modelsRequest']=null;constructor({connector:_0x2512ab,config:_0x3ea85d,locale:_0x1421bc}){super(),this['_connector']=_0x2512ab,this['_config']=_0x3ea85d,this['_locale']=_0x1421bc;}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 _0x389e6=await this['getAll']();let _0x59ca3d;return _0x59ca3d=this['_availableModels']?this['_filterModels'](_0x389e6,this['_availableModels']):_0x389e6['filter'](_0x3454de=>_0x3454de['recommended']),_0x59ca3d;}async['getModel'](_0x32bf56){const _0x25483f=await this['getAll']();if(!_0x25483f['length'])return null;if(_0x32bf56){const _0x1d3b27=this['_getModelById'](_0x25483f,_0x32bf56);if(_0x1d3b27)return _0x1d3b27;pt('ai-chat-model-id-unrecognized',{'modelId':_0x32bf56,'fallBackModelId':this['_defaultModelId']});}return this['getDefault']();}async['getDefault'](){const _0x820206=await this['getAvailableModels']();if(!_0x820206['length'])return null;if(this['_defaultModelId']){const _0x18e754=this['_getModelById'](_0x820206,this['_defaultModelId']);if(_0x18e754)return _0x18e754;pt('ai-chat-default-model-id-unrecognized',{'defaultModelId':this['_defaultModelId'],'fallBackModelId':_0x820206[0x0]['id']});}return _0x820206[0x0];}async['isAvailable'](_0x577dc0){return(await this['getAvailableModels']())['some'](_0xdffbf9=>_0xdffbf9['name']===_0x577dc0['name']&&_0xdffbf9['provider']===_0x577dc0['provider']);}async['_retrieveModels'](){if(!this['_modelList']['length'])try{const _0x3915b8=this['_locale']['uiLanguage']||'en',_0x5c5078=this['_connector']['getModels'](_0x3915b8),_0x21f0f8=await _0x5c5078['list']();this['_modelList']=_0x21f0f8['items']['map'](_0x537479=>Ws(_0x537479)?{..._0x537479,'name':cs(this['_locale'],'AI_MODEL_NAME_AUTO')}:_0x537479);}catch(_0x405424){throw Tt('ai-models-unable-to-retrieve',{'error':_0x405424}),_0x405424;}return[...this['_modelList']];}['_filterModels'](_0x3be788,_0x123136){let _0x520127;if(_0x123136){_0x520127=[];const _0x5de832=new Set(),_0x3fc8f1='string'==typeof _0x123136?[_0x123136['toLocaleLowerCase']()]:_0x123136['map'](_0x2d29fa=>_0x2d29fa['toLocaleLowerCase']());for(const _0x48585b of _0x3fc8f1)for(const _0x32f879 of _0x3be788)!_0x5de832['has'](_0x32f879['id'])&&this['_isMatchingFilter'](_0x32f879,_0x48585b)&&(_0x520127['push'](_0x32f879),_0x5de832['add'](_0x32f879['id']));}else _0x520127=_0x3be788;return _0x520127;}['_isMatchingFilter'](_0x527671,_0x11f437){const _0x30c8de=_0x527671['id']['toLocaleLowerCase'](),_0x3754df=_0x527671['name']['toLocaleLowerCase'](),_0xcd4377=_0x527671['provider']['toLocaleLowerCase']();return _0x30c8de===_0x11f437||_0x3754df===_0x11f437||Ws(_0x527671)&&'auto'===_0x11f437||_0xcd4377===_0x11f437||_0x30c8de['startsWith'](_0x11f437);}['_getModelById'](_0x2d0b73,_0x53f35d){return _0x2d0b73['find'](_0xdb8cab=>Ws(_0xdb8cab)&&'auto'===_0x53f35d?_0xdb8cab:_0xdb8cab['id']===_0x53f35d)||null;}}function Ws(_0x455f38){return _0x455f38['id']['startsWith']('agent');}function Ys(_0x1549f8){if(_0x1549f8 instanceof _0x25289c)return _0x1549f8;if(_0x1549f8?.['editors']&&_0x1549f8['editors']['get'](0x0))return _0x1549f8['editors']['length']>0x1&&console['warn']('AIChat:\x20Multiple\x20editor\x20instances\x20detected.\x20Only\x20the\x20first\x20editor\x20instance\x20will\x20be\x20used\x20for\x20AI\x20operations.\x20This\x20configuration\x20is\x20not\x20fully\x20supported\x20and\x20may\x20lead\x20to\x20unexpected\x20behavior.'),_0x1549f8['editors']['get'](0x0);throw new ot('ai-get-editor-from-context-no-editor');}function $s({editor:_0xe92685,interaction:_0xd5b03c,reply:_0x8c5fe0,groups:_0x58fb30,transform:_0x582d4e,documentCompare:_0x5a0930,documentCompareOptions:_0x5a7da0}){const _0x30c7d0=_0xd5b03c['getDocumentContext']();if(!_0x30c7d0)return[];const _0x280fbd=_0x30c7d0['content'],_0x1fa32a=_0x30c7d0['version'],_0x2a02cf=_0x8c5fe0['documentContextContent']['cloneNode'](!0x0);for(const {changes:_0x102965}of _0x58fb30){const _0x57e1a3=_0x102965['filter'](_0x23f552=>'new'!=_0x23f552['type'])['map'](_0x3f73fb=>Is('data-id',_0x3f73fb['id'],_0x2a02cf)),_0x4eb7ff=_0x102965['filter'](_0x662118=>'removed'!=_0x662118['type'])['map'](_0x1d99c2=>_0x1d99c2['node']['cloneNode'](!0x0));let _0x52f799=null;if(_0x57e1a3['length']){_0x52f799=_0x57e1a3[0x0]['previousSibling'];for(let _0x49733d=0x0;_0x49733d<_0x57e1a3['length'];_0x49733d++)_0x9eae66(_0x57e1a3[_0x49733d]);}if(_0x4eb7ff['length']){_0x52f799||(_0x102965[0x0]['anchorId']?_0x52f799=Is('data-id',_0x102965[0x0]['anchorId'],_0x2a02cf):(_0x52f799=_0x4eb7ff['shift'](),_0x36b9f0(_0x2a02cf,_0x52f799)));for(let _0x4dbf5f=0x0;_0x4dbf5f<_0x4eb7ff['length'];_0x4dbf5f++)_0x2fe3a2(_0x52f799,_0x4eb7ff[_0x4dbf5f]),_0x52f799=_0x4eb7ff[_0x4dbf5f];}}const _0x28feb4=gs(_0x2a02cf),_0x584430=_0x5a0930['getDiff'](_0x280fbd,_0x28feb4,_0x5a7da0)['getOperations']();if(_0x582d4e){const _0xe0ad68=_0xe92685['model']['document']['history']['getOperations'](_0x1fa32a),_0x55aa9c={'document':_0xe92685['model']['document'],'useRelations':!0x1,'padWithNoOps':!0x1};return _0x256a0e(_0x584430,_0xe0ad68,_0x55aa9c)['operationsA'];}return _0x584430;}function qs(_0x3ca4b6,_0x268032){if('marker'!=_0x268032['type'])return;const _0x124e1b=_0x3ca4b6['model']['markers']['get'](_0x268032['name']);_0x124e1b&&(_0x268032['oldRange']=_0x124e1b['getRange']());}class Qs extends _0x31818a{['activeConversation'];['_aiEditing'];['_aiConnector'];['_aiChatUi'];['_aiChatModels'];['_aiChatBalloon'];['_batchToChanges']=new Map();['_currentPreviewedChangeGroup']=null;['_bodyCollection'];static get['requires'](){return[hs,_0x55bfdc];}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 Ks({'connector':this['_aiConnector'],'config':this['context']['config']['get']('ai.models'),'locale':this['context']['locale']});const _0x7a4647=this['context']['plugins']['get']('AITabs');this['listenTo'](this['_aiChatUi'],'startConversation',()=>{this['_startConversationSafely']();}),this['listenTo'](this['_aiChatUi'],'sendUserMessage',(_0x1d2a1c,_0x294432)=>{this['_handleUIUserMessage']({'message':_0x294432});}),this['listenTo'](_0x7a4647,'resizedTabs',(_0x49da41,_0x13bae1)=>{this['_setIsMaximized'](_0x13bae1);}),this['listenTo'](this['_aiChatUi'],'resizeTabs',()=>{_0x7a4647['resize']();}),this['listenTo'](_0x7a4647['view'],'change:activeTab',(_0x333a09,_0x51b48e,_0x421dd0)=>{'chat'!==_0x421dd0&&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',(_0x583c22,_0x26d5f0)=>{this['activeConversation']?.['addFilesToContext'](Array['from'](_0x26d5f0));}),this['listenTo'](this['_aiChatUi'],'addUrlToContext',(_0xe42c84,_0x8ac820)=>{this['activeConversation']?.['addUrlToContext'](_0x8ac820);}),this['listenTo'](this['_aiChatUi'],'executeCustomItemCallback',(_0x2bc615,_0x4976a2)=>{_0x4976a2['callback'](this['context']);}),this['listenTo'](this['_aiChatUi'],'addResourceToContext',(_0x48b6f6,_0x571f61)=>{this['activeConversation']?.['addResourceToContext'](_0x571f61['source'],_0x571f61['resource']);}),this['listenTo'](this['_aiChatUi'],'removeContextItem',(_0x17546f,_0x121cf1)=>{this['_removeFromContext'](_0x121cf1);}),this['listenTo'](this['_aiChatUi'],'loadSourceResources',(_0x2744bd,_0x488cd4)=>{this['activeConversation']?.['loadSourceResources'](_0x488cd4['sourceId'],_0x488cd4['query'],_0x488cd4['uid']);}),this['listenTo'](this['_aiChatUi'],'toggleWebSearch',()=>{this['_toggleWebSearch']();}),this['listenTo'](this['_aiChatUi'],'toggleReasoning',()=>{this['_toggleReasoning']();}),this['listenTo'](this['_aiChatUi'],'selectModel',(_0x5775bb,_0x25d1fe)=>{this['activeConversation']?.['setModel'](_0x25d1fe);}),this['listenTo'](this['_aiChatUi'],'like',(_0x40aa66,{replyId:_0x127a27})=>{console['log']('Liked\x20response',_0x127a27);}),this['listenTo'](this['_aiChatUi'],'dislike',(_0x103133,{replyId:_0x5796a5})=>{console['log']('Disliked\x20response',_0x5796a5);}),this['listenTo'](this['_aiChatUi'],'insertSuggestion',(_0x3fa362,_0x2cfbbd)=>{this['_insertSuggestion'](_0x2cfbbd);}),this['listenTo'](this['_aiChatUi'],'showChangeInText',(_0x25cabb,{replyId:_0x2eb424,partIndex:_0x4817f8})=>{this['_aiChatBalloonShowDiff']=this['_aiChatUi']['showDiff'],this['_openBalloonFor'](_0x2eb424,_0x4817f8);}),this['listenTo'](this['_aiChatUi'],'mouseOverSuggestion',(_0x2f675d,{replyId:_0x20819f,partIndex:_0x116332})=>{const _0x2d3881=this['_getDocumentRangeForReplyChanges'](_0x20819f,_0x116332);_0x2d3881&&'$graveyard'!=_0x2d3881['range']['root']['rootName']&&this['_aiEditing']['showFakeVisualSelection']({'ranges':[_0x2d3881['range']],'id':'change-area','priority':0xa});}),this['listenTo'](this['_aiChatUi'],'mouseLeaveSuggestion',()=>{this['_aiEditing']['hideFakeVisualSelection']('change-area');}),this['listenTo'](this['_aiChatUi'],'applySuggestion',(_0x364926,_0x8c197f)=>{this['_aiEditing']['hideFakeVisualSelection']('change-area'),this['_applySuggestion'](_0x8c197f);}),this['listenTo'](this['_aiChatUi'],'toggleSuggestionDisplayMode',async(_0x4aeb64,{replyId:_0x36d9dd,showDiff:_0x2b0662})=>{const {reply:_0x6a045d}=this['getInteractionAndReplyById'](_0x36d9dd),_0x49b200=_0x6a045d['getContentParts']({'showDiff':_0x2b0662});await this['_aiChatUi']['updateFeedItemAIReplySuggestionContent']({'id':_0x6a045d['id'],'parts':_0x49b200,'renderingStrategy':'static'});}),this['listenTo'](this['_aiChatUi'],'rejectSuggestion',(_0x140457,{replyId:_0x112b2b,partIndex:_0x16e154})=>{this['_rejectSuggestion']({'replyId':_0x112b2b,'partIndex':_0x16e154}),this['_aiEditing']['hideFakeVisualSelection']('change-area');}),this['context']['plugins']['has']('AIChatBalloon')&&(this['_aiChatBalloon']=this['context']['plugins']['get']('AIChatBalloon'),this['set']('_aiChatBalloonShowDiff',!0x1),this['_aiChatBalloon']['bind']('showDiff')['to'](this,'_aiChatBalloonShowDiff'),this['listenTo'](this['_aiChatBalloon'],'toggleSuggestionDisplayMode',()=>{const {replyId:_0x52360d,partIndex:_0x2d00d2}=this['_currentPreviewedChangeGroup'];this['_aiChatBalloonShowDiff']=!this['_aiChatBalloonShowDiff'];const {reply:_0x325643}=this['getInteractionAndReplyById'](_0x52360d),_0x2f51e9=_0x325643['getContentParts']({'showDiff':this['_aiChatBalloonShowDiff'],'groupIndex':_0x2d00d2});this['_aiChatBalloon']['updateContent']({'part':_0x2f51e9[0x0],'renderingStrategy':'static','keepErrors':!0x0});}),this['listenTo'](this['_aiChatBalloon'],'applySuggestion',()=>{const {replyId:_0x305407,partIndex:_0x4b1408}=this['_currentPreviewedChangeGroup'];this['_applySuggestion']({'replyId':_0x305407,'partIndex':_0x4b1408}),this['_aiChatBalloon']['setState']('accepted');}),this['listenTo'](this['_aiChatBalloon'],'insertSuggestion',()=>{const {replyId:_0x35bf01,partIndex:_0x1883db}=this['_currentPreviewedChangeGroup'];this['_insertSuggestion']({'replyId':_0x35bf01,'partIndex':_0x1883db}),this['_aiChatBalloon']['setState']('accepted');}),this['listenTo'](this['_aiChatBalloon'],'rejectSuggestion',()=>{const {replyId:_0x3dcca5,partIndex:_0x412b20}=this['_currentPreviewedChangeGroup'];this['_rejectSuggestion']({'replyId':_0x3dcca5,'partIndex':_0x412b20}),this['_aiChatBalloon']['setState']('rejected');}),this['listenTo'](this['_aiChatBalloon'],'showNext',()=>{const {replyId:_0xfa84c2,partIndex:_0x3ad86b}=this['_currentPreviewedChangeGroup'],_0x45f3ed=this['_getPresentableSiblingContentPartIndex'](_0xfa84c2,_0x3ad86b,'next');null!==_0x45f3ed&&this['_openBalloonFor'](_0xfa84c2,_0x45f3ed);}),this['listenTo'](this['_aiChatBalloon'],'showPrevious',()=>{const {replyId:_0x55c375,partIndex:_0x5091e4}=this['_currentPreviewedChangeGroup'],_0x3d4a0b=this['_getPresentableSiblingContentPartIndex'](_0x55c375,_0x5091e4,'previous');null!==_0x3d4a0b&&this['_openBalloonFor'](_0x55c375,_0x3d4a0b);}),this['listenTo'](this['_aiChatBalloon'],'dialogClosed',(_0x57ab49,{id:_0x3b8ebe})=>{if('aiChatBalloon'!==_0x3b8ebe)return;const {replyId:_0x59ca69,partIndex:_0x1ce77b}=this['_currentPreviewedChangeGroup'];this['_currentPreviewedChangeGroup']=null,this['_aiChatUi']['setFeedItemAIReplySuggestionPartActive']({'id':_0x59ca69,'index':_0x1ce77b,'isActive':!0x1});})),this['on']('interactionCreated',(_0xd00058,_0x5573fe)=>{this['_aiChatUi']['addFeedItemUserMessage'](_0x5573fe);}),this['on']('replyCreated',(_0x53b289,_0x452b63)=>{this['_addFeedItemReply'](_0x452b63);});}async['afterInit'](){this['context']instanceof _0x25289c?this['_integrateEditor'](this['context']):this['listenTo'](this['context']['editors'],'add',(_0x59cd49,_0x869e96)=>{_0x869e96['on']('ready',()=>{this['_integrateEditor'](_0x869e96);});});const _0x329876=this['context']['config']['get']('ai.chat.initialConversation');let _0x3f1b06=_0x329876;if('lastCreated'!=_0x329876||(_0x3f1b06=await this['_getLastCreatedConversationId'](),_0x3f1b06))return'new'==_0x3f1b06?this['_startConversationSafely']():this['loadConversation'](_0x3f1b06);}async['destroy'](){return await this['_stopLastInteraction'](),this['_bodyCollection']['detachFromDom'](),super['destroy']();}async['loadConversation'](_0x1398c9){this['context']['plugins']['has']('AIChatBalloon')&&this['context']['plugins']['get']('AIChatBalloon')['close'](),(this['context']['plugins']['get'](os)['view']['activateTab']('chat'),this['_aiChatUi']['setFeedItemRenderingStrategy']('static'),this['_aiChatUi']['toggleLoadingSkeleton'](!0x0),await this['_stopLastInteraction']());try{await this['_aiConnector']['fetchConversation'](_0x1398c9)['getConversation'](),await this['_startConversationSafely'](_0x1398c9),this['_updateConversationTitle']('\x20'),await this['activeConversation']['load'](_0x1398c9,this['_aiEditing']['sessionId']),this['activeConversation']['isCurrentDocumentInConversation']()&&this['addCurrentDocumentToChatContext']();}catch(_0x12bf6f){this['_aiChatUi']['addFeedItemError']({'errorMessage':cs(this['context']['locale'],'AI_CHAT_UNABLE_TO_LOAD_CONVERSATION'),'id':_0x1398c9}),this['_logError'](new ot('ai-chat-conversation-not-found',this,{'error':_0x12bf6f}));}finally{this['_aiChatUi']['startAutoScroll'](),this['_aiChatUi']['setFeedItemRenderingStrategy']('streaming'),this['_aiChatUi']['toggleLoadingSkeleton'](!0x1);}}['registerToolDataCallback'](_0x4d0fcc){let _0x530b39=null,_0x127764=null;this['on']('toolDataReceived',(_0x1b2e8d,_0x2a4abe,_0x5e03e5)=>{_0x5e03e5['id']!==_0x530b39&&(_0x530b39=_0x5e03e5['id'],_0x127764=this['_getAIChatFeedAPI'](_0x5e03e5)),_0x4d0fcc(_0x2a4abe,_0x127764);});}['addCurrentDocumentToChatContext'](){this['activeConversation']?.['addCurrentDocumentToContext'](cs(this['context']['locale'],'AI_CHAT_CONTEXT_CURRENT_DOCUMENT'));}async['addSelectionToChatContext'](){const _0x2bf26c=this['_aiEditing']['getSelectionText']();this['activeConversation']?.['addSelectionToContext'](_0x2bf26c),this['addCurrentDocumentToChatContext']();}['removeSelectionFromChatContext'](){this['activeConversation']?.['removeSelectionFromContext']();}['focusPromptInput'](){this['_aiChatUi']['focusPromptInput']();}async['startConversation'](){await this['_startConversationSafely']();}async['sendMessage'](_0x4176b8){await this['_handleUIUserMessage'](_0x4176b8);}['getGroupId'](){const _0x27ea8a=this['context']['config']['get']('collaboration.channelId');if(!_0x27ea8a)throw new ot('ai-chat-missing-channel-id',this);return _0x27ea8a;}['_handleRemovedConversation'](_0x132bd7){this['activeConversation']['id']===_0x132bd7&&this['_startConversationSafely']();}['_insertSuggestion'](_0x42a49d){const _0x1d2534=Ys(this['context']);if(!_0x1d2534['plugins']['has']('TrackChanges'))throw new ot('ai-no-track-changes',null);const _0x579b5e=this['context']['plugins']['get']('DocumentCompare'),{reply:_0x19cbc3,interaction:_0x2c7057}=this['getInteractionAndReplyById'](_0x42a49d['replyId']),_0x277c9b=this['_getDocumentRangeForReplyChanges'](_0x42a49d['replyId'],_0x42a49d['partIndex']),_0x48e5ce=void 0x0!==_0x42a49d['partIndex']?[_0x19cbc3['changeGroups'][_0x42a49d['partIndex']]]:_0x19cbc3['changeGroups']['filter'](_0x371776=>'pending'==_0x371776['state']),_0x366edb=_0x48e5ce['map'](_0xd8361f=>_0x19cbc3['changeGroups']['indexOf'](_0xd8361f));if(!_0x277c9b||'$graveyard'==_0x277c9b['range']['root']['rootName'])return void _0x366edb['forEach'](_0x137fe9=>_0x19cbc3['setChangeGroupState'](_0x137fe9,'outdated'));_0x366edb['forEach'](_0x3e9352=>_0x19cbc3['setChangeGroupState'](_0x3e9352,'accepted'));const _0x5f119b=$s({'editor':_0x1d2534,'reply':_0x19cbc3,'interaction':_0x2c7057,'groups':_0x48e5ce,'transform':!0x0,'documentCompare':_0x579b5e,'documentCompareOptions':{'anchor':'main','markDeletions':!0x0}});let _0xc4c960;_0x277c9b&&this['_scrollToSuggestionRange'](_0x277c9b['range']),_0x1d2534['model']['change'](_0x18bfb8=>{_0xc4c960=_0x18bfb8['batch'],_0x1d2534['plugins']['get']('TrackChangesEditing')['_applyOperationsAsSuggestions'](_0x5f119b),this['_aiEditing']['hideFakeVisualSelection']('change-area');}),this['_batchToChanges']['set'](_0xc4c960,{'interactionId':_0x2c7057['id'],'replyId':_0x19cbc3['id'],'indexes':_0x366edb['slice']()}),this['_updateRatings'](_0x19cbc3);}['_applySuggestion'](_0x2e9b9d){const _0x26c025=Ys(this['context']),_0x489973=this['context']['plugins']['get'](_0x55bfdc),{reply:_0x35fec6,interaction:_0x3f5889}=this['getInteractionAndReplyById'](_0x2e9b9d['replyId']),_0x3eb8a4=this['_getDocumentRangeForReplyChanges'](_0x2e9b9d['replyId'],_0x2e9b9d['partIndex']),_0x101e10=void 0x0!==_0x2e9b9d['partIndex']?[_0x35fec6['changeGroups'][_0x2e9b9d['partIndex']]]:_0x35fec6['changeGroups']['filter'](_0x6fab90=>'pending'==_0x6fab90['state']),_0x47f36b=_0x101e10['map'](_0x11f1ad=>_0x35fec6['changeGroups']['indexOf'](_0x11f1ad));if(!_0x3eb8a4||'$graveyard'==_0x3eb8a4['range']['root']['rootName'])return void _0x47f36b['forEach'](_0x494351=>_0x35fec6['setChangeGroupState'](_0x494351,'outdated'));_0x47f36b['forEach'](_0x5344c6=>_0x35fec6['setChangeGroupState'](_0x5344c6,'accepted'));const _0x1d68ec=$s({'editor':_0x26c025,'reply':_0x35fec6,'interaction':_0x3f5889,'groups':_0x101e10,'transform':!0x0,'documentCompare':_0x489973,'documentCompareOptions':{'anchor':'main','markDeletions':!0x1}});let _0x2854a3;_0x3eb8a4&&this['_scrollToSuggestionRange'](_0x3eb8a4['range']),_0x26c025['model']['change'](_0x4ac9b8=>{_0x2854a3=_0x4ac9b8['batch'];for(const _0x5de5f8 of _0x1d68ec)_0x5de5f8['baseVersion']=_0x26c025['model']['document']['version'],qs(_0x26c025,_0x5de5f8),_0x4ac9b8['batch']['addOperation'](_0x5de5f8),_0x26c025['model']['applyOperation'](_0x5de5f8);}),this['_batchToChanges']['set'](_0x2854a3,{'interactionId':_0x3f5889['id'],'replyId':_0x35fec6['id'],'indexes':_0x47f36b['slice']()}),this['_updateRatings'](_0x35fec6);}['_rejectSuggestion'](_0x1cef9a){const {reply:_0x19c57b}=this['getInteractionAndReplyById'](_0x1cef9a['replyId']);_0x19c57b['setChangeGroupState'](_0x1cef9a['partIndex'],'rejected');}['_openBalloonFor'](_0x4b7cf4,_0x56cb01){if(!this['_aiChatBalloon'])return;const {reply:_0x7ff893}=this['getInteractionAndReplyById'](_0x4b7cf4),_0x5c7fcb=_0x7ff893['getContentParts']({'showDiff':this['_aiChatBalloonShowDiff']});let _0x15a6f0,_0x2ec836;if(void 0x0!==_0x56cb01?(_0x2ec836=_0x5c7fcb['find'](_0x98c91c=>_0x98c91c['index']==_0x56cb01),_0x15a6f0=_0x2ec836?.['index']):(_0x2ec836=_0x5c7fcb[0x0],_0x15a6f0=_0x2ec836['index']),this['_currentPreviewedChangeGroup']?.['replyId']==_0x4b7cf4&&this['_currentPreviewedChangeGroup']?.['partIndex']==_0x15a6f0)return;const _0x406572=this['_getUserPresentableContentPartDocumentRange'](_0x4b7cf4,_0x7ff893,_0x2ec836);if(!_0x406572)return void this['_aiChatBalloon']['close']();this['_currentPreviewedChangeGroup']={'replyId':_0x4b7cf4,'partIndex':_0x15a6f0},this['_scrollToSuggestionRange'](_0x406572,!0x0);const _0x5b8d1e=this['_getPresentableSiblingContentPartIndex'](_0x4b7cf4,_0x15a6f0,'next');this['_aiChatBalloon']['updateContent']({'part':_0x2ec836,'renderingStrategy':'static'}),this['_aiChatBalloon']['open']({'index':_0x15a6f0,'title':cs(this['context']['locale'],'AI_BALLOON_HEADER_TITLE',(_0x15a6f0+0x1)['toString']()),'showRotator':null!==_0x5b8d1e,'ranges':[_0x406572],'areActionsDisabled':_0x7ff893['areActionsDisabled']}),this['_aiChatBalloon']['setState']('pending'),this['_aiChatUi']['scrollFeedToSuggestion'](_0x4b7cf4,_0x15a6f0),this['_aiChatUi']['setFeedItemAIReplySuggestionPartActive']({'id':_0x4b7cf4,'index':_0x15a6f0,'isActive':!0x0});}['_getPresentableSiblingContentPartIndex'](_0x402e15,_0x22a950,_0x33e406){const {reply:_0x14c70c}=this['getInteractionAndReplyById'](_0x402e15),_0x3440df=_0x14c70c['getContentParts']({'showDiff':this['_aiChatBalloonShowDiff']});if(0x1==_0x3440df['length'])return null;const _0x544152=_0x3440df['findIndex'](_0x672e40=>_0x672e40['index']==_0x22a950),_0x1c714b='next'==_0x33e406?0x1:-0x1;let _0x350b86=_0x3440df['at']((_0x544152+_0x1c714b)%_0x3440df['length'])['index'],_0x26c102=_0x3440df[_0x350b86];for(;!this['_getUserPresentableContentPartDocumentRange'](_0x402e15,_0x14c70c,_0x26c102);){if(_0x350b86=_0x3440df['at']((_0x350b86+_0x1c714b)%_0x3440df['length'])['index'],_0x350b86===_0x544152)return null;_0x26c102=_0x3440df[_0x350b86];}return _0x350b86;}['_getUserPresentableContentPartDocumentRange'](_0x3bf69d,_0x3ef437,_0x2588e8){const _0xf2afc3=_0x3ef437['changeGroups'];if(!_0x2588e8['hasChanges'])return null;const _0x122f66=_0xf2afc3['find'](_0x5edd19=>_0x5edd19['index']==_0x2588e8['index']);if('pending'!==_0x122f66?.['state'])return null;const _0x13dc45=this['_getDocumentRangeForReplyChanges'](_0x3bf69d,_0x2588e8['index']);if(!_0x13dc45)return null;const {range:_0x25ba12,currentIndex:_0x2e4da1}=_0x13dc45;return'$graveyard'==_0x25ba12['root']['rootName']?(_0x3ef437['setChangeGroupState'](_0x2e4da1,'outdated'),null):_0x13dc45['range'];}['_getDocumentRangeForReplyChanges'](_0x282d47,_0x164f8f){const _0x21e51e=Ys(this['context']),{reply:_0x19877e,interaction:_0x5b2d45}=this['getInteractionAndReplyById'](_0x282d47),_0x22070d=_0x19877e['changeGroups']['filter'](_0x2e3bbd=>'pending'==_0x2e3bbd['state']),_0x1ced39=_0x22070d['map'](_0x30b7ce=>_0x19877e['changeGroups']['indexOf'](_0x30b7ce));void 0x0===_0x164f8f&&(_0x164f8f=_0x1ced39[0x0]);const _0xf645a1=_0x1ced39['indexOf'](_0x164f8f);if(-0x1==_0xf645a1)return null;const _0x2a571c=_0x22070d[_0xf645a1],_0x467a2b=new _0x539efd([]),_0x32eef9=new _0x539efd([]);for(const _0x22b587 of _0x2a571c['changes'])if('removed'!=_0x22b587['type']&&_0x32eef9['children']['push'](_0x22b587['node']['cloneNode'](!0x0)),'new'!=_0x22b587['type']){const _0x16d927=_0x661d7(_0x5f386d=>ps(_0x5f386d,'data-id')==_0x22b587['id'],_0x19877e['documentContextContent'],!0x0);_0x467a2b['children']['push'](_0x16d927['cloneNode'](!0x0));}if(0x0==_0x467a2b['children']['length']){if(_0x2a571c['changes'][0x0]['anchorId']){const _0x23bf55=Is('data-id',_0x2a571c['changes'][0x0]['anchorId'],_0x19877e['documentContextContent']);_0x467a2b['children']['unshift'](_0x23bf55['cloneNode'](!0x0)),_0x32eef9['children']['unshift'](_0x23bf55['cloneNode'](!0x0)),_0x23bf55['nextSibling']&&(_0x467a2b['children']['push'](_0x23bf55['nextSibling']['cloneNode'](!0x0)),_0x32eef9['children']['push'](_0x23bf55['nextSibling']['cloneNode'](!0x0)));}else{const _0xfd5c11=_0x19877e['documentContextContent']['children'][0x0];if(!_0xfd5c11)return null;_0x467a2b['children']['push'](_0xfd5c11['cloneNode'](!0x0)),_0x32eef9['children']['push'](_0xfd5c11['cloneNode'](!0x0));}}const _0x173fca=_0x5b2d45['getDocumentContext'](),_0x311bc2=_0x21e51e['data']['parse'](_0x173fca['content']),_0x28d3fb=gs(_0x467a2b),_0x5f52db=_0x21e51e['data']['parse'](_0x28d3fb),_0x3e028c=_0x21e51e['data']['parse'](_0x28d3fb),_0x1dc0dc=_0x21e51e['model']['createPositionAt'](_0x5f52db,0x0),_0x221b62=gs(_0x32eef9),_0x119ffc={'anchor':_0x1dc0dc,'markDeletions':!0x1},_0x3a65a0=_0x21e51e['plugins']['get'](_0x55bfdc)['getDiff'](_0x28d3fb,_0x221b62,_0x119ffc)['getOperations']();if(!_0x3a65a0['length'])return null;_0x21e51e['model']['change'](_0x1e3008=>{for(const _0x4b1251 of _0x3a65a0)if('remove'==_0x4b1251['type']){const _0xa6def1=_0x4b1251['sourcePosition'],_0x5d9aa3=_0x4b1251['howMany'],_0x13dad3=new _0x5d2b40(_0xa6def1,_0x5d9aa3);_0x1e3008['batch']['addOperation'](_0x13dad3),_0x21e51e['model']['applyOperation'](_0x13dad3);}else'marker'!==_0x4b1251['type']&&(_0x4b1251['baseVersion']=null,_0x4b1251['isDocumentOperation']=!0x1,_0x1e3008['batch']['addOperation'](_0x4b1251),_0x21e51e['model']['applyOperation'](_0x4b1251));});const _0x55d48b=Ns(_0x21e51e,_0x3a65a0,_0x5f52db);vs(_0x21e51e['model'],_0x55d48b);const _0x7a2fd=_0x55d48b['getFirstRange']()['start']['path']['slice'](),_0xa6a0b2=_0x55d48b['getFirstRange']()['end']['path']['slice'](),_0x5d484f=[];let _0x186730=_0x5f52db,_0x390f47=_0x3e028c;for(let _0x443e09=0x0;_0x443e09<_0xa6a0b2['length'];_0x443e09++){const _0x2a6152=_0x186730['maxOffset']-_0xa6a0b2[_0x443e09];_0x5d484f[_0x443e09]=_0x390f47['maxOffset']-_0x2a6152,_0x186730=_0x186730['getChildAtOffset'](_0xa6a0b2[_0x443e09]),_0x390f47=_0x390f47['getChildAtOffset'](_0x5d484f[_0x443e09]);}const _0x29c9ef=_0x21e51e['model']['createRange'](_0x21e51e['model']['createPositionFromPath'](_0x3e028c,_0x7a2fd),_0x21e51e['model']['createPositionFromPath'](_0x3e028c,_0x5d484f)),_0x3bf628=_0x3e028c['getChild'](0x0)['getAttribute'](_0x222570),_0x1f0475=Array['from'](_0x311bc2['getChildren']())['find'](_0x37c2d0=>_0x37c2d0['getAttribute'](_0x222570)==_0x3bf628)['getPath'](),_0x2d4147=_0x29c9ef['start']['path']['slice'](),_0x4c5842=_0x29c9ef['end']['path']['slice']();_0x2d4147[0x0]=_0x1f0475[0x0]+_0x2d4147[0x0],_0x4c5842[0x0]=_0x1f0475[0x0]+_0x4c5842[0x0];let _0x4d2292=_0x21e51e['model']['createRange'](_0x21e51e['model']['createPositionFromPath'](_0x21e51e['model']['document']['getRoot'](),_0x2d4147),_0x21e51e['model']['createPositionFromPath'](_0x21e51e['model']['document']['getRoot'](),_0x4c5842));const _0x6efff5=_0x21e51e['model']['document']['history']['getOperations'](_0x173fca['version']);for(const _0x4b3ce7 of _0x6efff5)_0x4d2292=_0x132eb5['_createFromRanges'](_0x4d2292['getTransformedByOperation'](_0x4b3ce7));return{'range':_0x4d2292,'currentIndex':_0x164f8f};}['_integrateEditor'](_0x30a7a4){if(_0x30a7a4['plugins']['has']('Undo')){const _0x1a1de6=_0x30a7a4['commands']['get']('undo'),_0x39c311=_0x30a7a4['commands']['get']('redo');this['listenTo'](_0x1a1de6,'revert',(_0x19b686,_0x5d4e3e,_0x3addaa)=>{const _0x24d0cd=this['_batchToChanges']['get'](_0x5d4e3e);if(!_0x24d0cd)return;const _0x181a17=this['activeConversation']['getInteraction'](_0x24d0cd['interactionId'])['getReply'](_0x24d0cd['replyId']);_0x24d0cd['indexes']['forEach'](_0x21931e=>_0x181a17['setChangeGroupState'](_0x21931e,'pending')),this['_batchToChanges']['delete'](_0x5d4e3e),this['_batchToChanges']['set'](_0x3addaa,_0x24d0cd);}),this['listenTo'](_0x39c311,'revert',(_0x3254ef,_0x415883,_0x4bd0b6)=>{const _0x4a6029=this['_batchToChanges']['get'](_0x415883);if(!_0x4a6029)return;const _0x412478=this['activeConversation']['getInteraction'](_0x4a6029['interactionId'])['getReply'](_0x4a6029['replyId']);_0x4a6029['indexes']['forEach'](_0x428c04=>_0x412478['setChangeGroupState'](_0x428c04,'accepted')),this['_batchToChanges']['delete'](_0x415883),this['_batchToChanges']['set'](_0x4bd0b6,_0x4a6029);});}const _0x288300=_0x30a7a4['config']['get']('ai.chat.context');_0x288300['alwaysAddSelection']&&_0x288300['document']['enabled']&&this['listenTo'](_0x30a7a4['model']['document']['selection'],'change:range',(_0x2e8894,_0x5a44fb)=>{if(!_0x5a44fb['directChange'])return;'chat'===_0x30a7a4['plugins']['get']('AITabs')['view']['activeTab']&&(_0x30a7a4['model']['hasContent'](_0x30a7a4['model']['document']['selection'])?this['addSelectionToChatContext']():this['removeSelectionFromChatContext']());});}async['_getLastCreatedConversationId'](){const _0x332d5a=this['_aiConnector']['fetchConversations'](this['getGroupId'](),{'limit':0x1,'sortBy':'createdAt'});try{const _0x25e8e9=await _0x332d5a['getConversations']();return _0x25e8e9['length']?_0x25e8e9[0x0]['id']:'new';}catch(_0x29aeba){return this['_aiChatUi']['addFeedItemError']({'errorMessage':cs(this['context']['locale'],'AI_CHAT_UNABLE_TO_LOAD_CONVERSATION'),'id':at()}),this['_logError'](new ot('ai-chat-conversation-init-failed',this,{'error':_0x29aeba})),this['_aiChatUi']['toggleLoadingSkeleton'](!0x1),this['_aiChatUi']['disableControls'](),null;}}async['_startConversationSafely'](_0x252a98){try{this['_aiChatUi']['enableControls'](),await this['_handleStartConversation'](_0x252a98);}catch(_0x3fdc10){this['_aiChatUi']['addFeedItemError']({'errorMessage':cs(this['context']['locale'],'AI_CHAT_UNABLE_TO_START_CONVERSATION'),'id':_0x252a98||at()}),console['error'](_0x3fdc10),this['activeConversation']=void 0x0,this['_aiChatUi']['disableControls']();}}async['_handleStartConversation'](_0x43b892){let _0x511b20;this['context']['plugins']['has']('AIChatBalloon')&&this['context']['plugins']['get']('AIChatBalloon')['close'](),_0x43b892||!this['activeConversation']?_0x511b20=this['context']['config']['get']('ai.models.defaultModelId'):this['_aiChatUi']['isModelAvailable']&&(_0x511b20=this['activeConversation']['selectedModel']['id']),await this['_stopLastInteraction']();const _0x1a0f12=this['getGroupId'](),_0x43970c=_0x43b892||at();this['activeConversation']=new Fs({'connector':this['_aiConnector'],'chatModels':this['_aiChatModels'],'selectedModelId':_0x511b20,'conversationId':_0x43970c,'group':_0x1a0f12,'getEditor':()=>Ys(this['context']),'isFromHistory':!!_0x43b892}),this['activeConversation']['delegate']('toolDataReceived','interactionCreated','interactionStarted','replyCreated')['to'](this),this['activeConversation']['on']('conversationInitialized',(_0x441d36,_0x7a8a8)=>{this['_aiChatUi']['createConversation'](_0x7a8a8),this['_aiChatUi']['resetMessageInput'](),this['_aiChatUi']['clearPendingContextUI'](),this['_aiChatUi']['clearConversationContextUI'](),_0x43b892||(this['_aiChatUi']['resetConversationTitle'](),this['addCurrentDocumentToChatContext']());}),this['activeConversation']['on']('uploadProgressChanged',(_0x3ab013,_0x417c14)=>{this['_aiChatUi']['setIsUploadInProgress'](_0x417c14['isUploadInProgress']);}),this['activeConversation']['on']('webSearchStarted',()=>{const _0x5f0969=this['_aiChatUi']['prepareLoadingMessage']({'isWebSearchEnabled':!0x0,'isReasoningEnabled':!0x1});this['_aiChatUi']['setLoadingMessage'](_0x5f0969);}),this['activeConversation']['on']('reasoningStarted',()=>{const _0x2be9f5=this['_aiChatUi']['prepareLoadingMessage']({'isWebSearchEnabled':!0x1,'isReasoningEnabled':!0x0});this['_aiChatUi']['setLoadingMessage'](_0x2be9f5);}),this['activeConversation']['on']('webSearchFinished',(_0x575c8c,_0x285b8a)=>{this['_aiChatUi']['addFeedInteractionHeader'](_0x285b8a,{'isWebSearchEnabled':!0x0,'isReasoningEnabled':!0x1});}),this['activeConversation']['on']('reasoningFinished',(_0xcce456,_0x2e97e4)=>{this['_aiChatUi']['addFeedInteractionHeader'](_0x2e97e4,{'isWebSearchEnabled':!0x1,'isReasoningEnabled':!0x0});}),this['activeConversation']['on']('interactionStarted',()=>{this['_aiChatUi']['startInteraction']();}),this['activeConversation']['on']('interactionFinished',async()=>{await this['_aiChatUi']['finishInteraction']();}),this['activeConversation']['on']('interactionDestroyed',(_0x3673d2,_0x4bca5a)=>{this['_aiChatUi']['removeFeedInteraction'](_0x4bca5a['id']);}),this['activeConversation']['on']('setConversationTitle',(_0x39cc34,_0x57567c,_0x240879)=>{this['_updateConversationTitle'](_0x57567c,_0x240879);}),this['activeConversation']['on']('replyContentUpdated',async(_0x2b3c25,_0x50dbff)=>{await this['_updateReplyContent']({'reply':_0x50dbff});}),this['activeConversation']['on']('replyChangeGroupStateUpdated',(_0x27421f,{reply:_0x503f1a,index:_0x41c266,state:_0x737cfc})=>{this['_aiChatUi']['updateFeedItemAIReplySuggestionPartState']({'id':_0x503f1a['id'],'index':_0x41c266,'state':_0x737cfc}),this['_currentPreviewedChangeGroup']?.['replyId']['includes'](_0x503f1a['id'])&&this['_currentPreviewedChangeGroup']?.['partIndex']==_0x41c266&&this['_aiChatBalloon']?.['setState'](_0x737cfc);}),this['activeConversation']['on']('contextItemAdded',(_0x3a254a,_0x4acee9)=>{if(this['_aiChatUi']['addContextItem'](_0x4acee9['contextItem'],_0x4acee9['isLoading']),'selection'===_0x4acee9['contextItem']['type']){const _0x15aeb5=[...Ys(this['context'])['model']['document']['selection']['getRanges']()];this['_aiEditing']['showFakeVisualSelection']({'ranges':_0x15aeb5,'id':'context','priority':0x1});}}),this['activeConversation']['on']('contextItemRemoved',(_0x3f6c87,_0x30bdb1)=>{this['_aiChatUi']['removeContextItem'](_0x30bdb1['uiId']),'current-document'==_0x30bdb1['uiId']&&this['removeSelectionFromChatContext'](),'selection'===_0x30bdb1['type']&&this['_aiEditing']['hideFakeVisualSelection']('context');}),this['activeConversation']['on']('contextItemLoadingEnded',(_0x400cac,_0x38fcc9)=>{this['_aiChatUi']['setContextItemLoading'](_0x38fcc9['contextItem']['uiId'],_0x38fcc9['isLoading']);}),this['activeConversation']['on']('contextSent',(_0x59c4a8,_0x456241)=>{this['_aiChatUi']['setConversationContext'](_0x456241['contextItems']);}),this['activeConversation']['on']('addContextOptionsChanged',(_0xc7c6ea,_0x185bca)=>{this['_aiChatUi']['setAddContextOptions'](_0x185bca['options']);}),this['activeConversation']['on']('sourceResourcesLoaded',(_0xd64ca,_0xe7d74c)=>{this['_aiChatUi']['populateSourceResourceBalloon'](_0xe7d74c['sourceId'],_0xe7d74c['source'],_0xe7d74c['resources'],_0xe7d74c['uid']);}),this['activeConversation']['on']('resourceStateChanged',(_0x28d847,_0x775df2)=>{this['_aiChatUi']['updateResourceState'](_0x775df2['sourceId'],_0x775df2['resourceId'],_0x775df2['isInContext']);}),this['activeConversation']['on']('capabilitiesUpdated',(_0x298555,_0x3347db)=>{this['_aiChatUi']['updateCapabilities'](_0x3347db);}),this['activeConversation']['on']('modelSelected',async(_0x346d10,_0x15a166)=>{const _0x4453bc=(await this['_aiChatModels']['getAll']())['find'](_0x59ac60=>_0x59ac60['id']===_0x15a166['selectedModel']?.['id'])||null;this['_aiChatUi']['setSelectedModel'](_0x4453bc,_0x15a166['isDisabled']);}),this['activeConversation']['on']('error',(_0x379bef,{error:_0x3db9ff,interactionId:_0x289fc6,fileName:_0x19fbf0,url:_0x28be5d,sourceId:_0x1635d1,sourceLabel:_0x42cc6d})=>{const _0x405e81=_0x289fc6?_0x289fc6+':'+at():at();_0x3db9ff['message']['startsWith']('ai-request-aborted')?this['_aiChatUi']['addFeedItemStaticMessage']({'staticMessage':cs(this['context']['locale'],'AI_CHAT_ABORTED_MESSAGE'),'id':_0x405e81}):_0x3db9ff['message']['startsWith']('ai-chat-conversation-init-failed')||_0x3db9ff['message']['startsWith']('ai-chat-conversation-start-failed')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':cs(this['context']['locale'],'AI_CHAT_UNABLE_TO_START_CONVERSATION'),'id':_0x405e81}),this['_logError'](_0x3db9ff)):_0x3db9ff['message']['startsWith']('ai-chat-file-upload-failed')?this['_aiChatUi']['addFeedItemError']({'errorMessage':cs(this['context']['locale'],'AI_CHAT_CONTEXT_UNABLE_TO_UPLOAD_FILE',_0x19fbf0),'id':_0x405e81}):_0x3db9ff['message']['startsWith']('ai-chat-url-upload-failed')?this['_aiChatUi']['addFeedItemError']({'errorMessage':cs(this['context']['locale'],'AI_CHAT_CONTEXT_UNABLE_TO_UPLOAD_URL',_0x28be5d),'id':_0x405e81}):_0x3db9ff['message']['startsWith']('ai-chat-context-invalid-data')?this['_aiChatUi']['addFeedItemError']({'errorMessage':cs(this['context']['locale'],'AI_CHAT_CONTEXT_INVALID_DATA'),'id':_0x405e81}):_0x3db9ff['message']['startsWith']('ai-chat-context-unsupported-type')?this['_aiChatUi']['addFeedItemError']({'errorMessage':cs(this['context']['locale'],'AI_CHAT_CONTEXT_UNSUPPORTED_TYPE'),'id':_0x405e81}):_0x3db9ff['message']['startsWith']('ai-chat-source-resources-load-failed')?(_0x1635d1&&this['_aiChatUi']['closeSourceResourceBalloon'](_0x1635d1),this['_aiChatUi']['addFeedItemError']({'errorMessage':cs(this['context']['locale'],'AI_CHAT_CONTEXT_UNABLE_TO_LOAD_RESOURCES',_0x42cc6d||'source'),'id':_0x405e81}),this['_logError'](_0x3db9ff)):_0x3db9ff['message']['startsWith']('ai-chat-resource-load-failed')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':cs(this['context']['locale'],'AI_CHAT_RESOURCE_LOAD_FAILED'),'id':_0x405e81}),this['_logError'](_0x3db9ff)):_0x3db9ff['message']['startsWith']('ai-chat-invalid-request')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':cs(this['context']['locale'],'AI_CHAT_INVALID_REQUEST'),'id':_0x405e81}),this['_logError'](_0x3db9ff)):_0x3db9ff['message']['startsWith']('ai-chat-context-unsupported-file-type')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':cs(this['context']['locale'],'AI_CHAT_CONTEXT_UNSUPPORTED_FILE_TYPE'),'id':_0x405e81}),this['_logError'](_0x3db9ff)):_0x3db9ff['message']['startsWith']('ai-chat-context-file-too-large')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':cs(this['context']['locale'],'AI_CHAT_CONTEXT_FILE_TOO_LARGE'),'id':_0x405e81}),this['_logError'](_0x3db9ff)):_0x3db9ff['message']['startsWith']('ai-chat-context-file-too-many-pages')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':cs(this['context']['locale'],'AI_CHAT_CONTEXT_FILE_TOO_MANY_PAGES'),'id':_0x405e81}),this['_logError'](_0x3db9ff)):_0x3db9ff['message']['startsWith']('ai-chat-context-form-data-size-limits-exceeded')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':cs(this['context']['locale'],'AI_CHAT_CONTEXT_FORM_DATA_SIZE_LIMITS_EXCEEDED'),'id':_0x405e81}),this['_logError'](_0x3db9ff)):(this['_aiChatUi']['addFeedItemError']({'errorMessage':cs(this['context']['locale'],'AI_CHAT_GENERIC_ERROR'),'id':_0x405e81}),this['_logError'](_0x3db9ff));}),await this['activeConversation']['init'](this['context']['config']['get']('ai.chat.context')),_0x43b892||await this['activeConversation']['start']();}async['_handleUIUserMessage']({message:_0x40ae67,attributes:_0x398fe9}){if(!this['activeConversation'])throw new ot('ai-chat-controller-no-active-conversation');if(this['activeConversation']['isCurrentDocumentInContext']()){const _0x29187f=await this['_aiEditing']['getDocumentData']();await this['activeConversation']['updateCurrentDocumentInContext'](_0x29187f);}this['activeConversation']['id']&&this['activeConversation']['isStarted']&&await this['activeConversation']['handleUserInteraction']({'userMessage':_0x40ae67,'attributes':_0x398fe9});}['_setIsMaximized'](_0x338eb9){this['_aiChatUi']['setIsMaximized'](_0x338eb9);}['_logError'](_0x452a67){Tt(_0x452a67['message']);}['_removeFromContext'](_0x54607a){this['activeConversation']?.['removeFromContext'](_0x54607a);}['_toggleWebSearch'](){this['activeConversation']?.['toggleWebSearch']();}['_toggleReasoning'](){this['activeConversation']?.['toggleReasoning']();}['getInteractionAndReplyById'](_0x14364a){const [_0xa9eca6,_0x55d425]=_0x14364a['split'](':'),_0x1d51bc=this['activeConversation']['getInteraction'](_0xa9eca6),_0x4b821f=_0x1d51bc['getReply'](_0x55d425);return{'interaction':_0x1d51bc,'reply':_0x4b821f};}['_scrollToSuggestionRange'](_0x2dcaaf,_0x471be9=!0x1){const _0x496931=Ys(this['context']),_0x380d13={'target':_0x496931['editing']['view']['domConverter']['viewRangeToDom'](_0x496931['editing']['mapper']['toViewRange'](_0x2dcaaf)),'viewportOffset':{'top':0x96,'left':0x0,'bottom':0x32,'right':0x0},'ancestorOffset':0x14,'alignToTop':_0x471be9};_0x471be9&&(_0x380d13['alignToTop']=!0x0),mt(_0x380d13);}['_updateConversationTitle'](_0x2a1001,_0x283a72=!0x1){this['_aiChatUi']['setConversationTitle'](_0x2a1001||cs(this['context']['locale'],'AI_CHAT_UNTITLED_CONVERSATION'),_0x283a72);}['_addFeedItemReply'](_0x3a6592){'text'===_0x3a6592['type']?this['_aiChatUi']['addFeedItemAIReply'](_0x3a6592):this['_aiChatUi']['addFeedItemAISuggestion'](_0x3a6592);}async['_updateReplyContent']({reply:_0x40d543,renderingStrategy:_0x291fe8}){const {id:_0x6bca00,interactionId:_0x4d72d,isDone:_0xea54b4,type:_0x1a4503,parsedContent:_0x48b0a5}=_0x40d543,_0x43b040=_0x4d72d+':'+_0x6bca00;if('modification'===_0x1a4503){const _0x12335b=_0x40d543['getContentParts']({'showDiff':this['_aiChatUi']['showDiff']});await this['_aiChatUi']['updateFeedItemAIReplySuggestionContent']({'id':_0x43b040,'parts':_0x12335b,'renderingStrategy':_0x291fe8,'isDone':_0xea54b4});}else'text'===_0x1a4503&&await this['_aiChatUi']['updateFeedItemAIReplyContent']({'id':_0x43b040,'parsedContent':_0x48b0a5,'renderingStrategy':_0x291fe8,'isDone':_0xea54b4});_0xea54b4&&_0x40d543['sources']['length']>0x0&&this['_aiChatUi']['updateFeedItemAIReplySources'](_0x43b040,_0x40d543['sources']);}async['_stopLastInteraction'](){const _0x37073e=this['activeConversation']?.['lastInteraction'];_0x37073e&&(_0x37073e['stop'](),this['_aiChatUi']['stopInteraction'](_0x37073e));}async['_flushLastInteractionUI'](){const _0xa543ed=this['activeConversation']?.['lastInteraction'];if(_0xa543ed){for await(const _0x57954d of _0xa543ed['replies'])this['_aiChatUi']['hasFeedItem'](_0x57954d['id'])||this['_addFeedItemReply'](_0x57954d),await this['_updateReplyContent']({'reply':_0x57954d,'renderingStrategy':'static'});}}['_updateRatings'](_0x440b6f){const _0x19bddf={'positiveCount':_0x440b6f['changeGroups']['filter'](_0x22d0e6=>'accepted'===_0x22d0e6['state'])['length'],'totalCount':_0x440b6f['changeGroups']['length'],'modificationId':_0x440b6f['id']},_0x5b42d8=this['activeConversation']['getInteraction'](_0x440b6f['interactionId'])['messageId'];_0x5b42d8&&this['_aiConnector']['upsertAIChatRating'](this['activeConversation']['id'],_0x5b42d8,_0x19bddf);}['_getAIChatFeedAPI'](_0x6bab62){const _0x38e7b3=this['_aiChatUi'],_0x39e067=()=>{_0x6bab62['resetWebSearchState'](),_0x6bab62['resetReasoningState'](),_0x38e7b3['clearLoadingMessage']();},_0x358b2b=()=>{_0x6bab62['currentReply']&&(_0x6bab62['currentReply']['done'](),_0x6bab62['currentReply']=void 0x0);};return{'insertTextReply':(_0x585d0d,_0x4a7e34)=>{_0x358b2b(),_0x39e067();const _0x5487cf=_0x6bab62['currentReply']=_0x6bab62['createReply']({'type':'text','interactionId':_0x6bab62['id'],'content':_0x585d0d,'id':_0x4a7e34||at()});return _0x358b2b(),_0x5487cf;},'insertCustomElement':async(_0x10708d,_0x41d622)=>(_0x358b2b(),_0x39e067(),_0x38e7b3['addFeedItemCustomElement'](_0x10708d,_0x41d622||at())),'setLoadingMessage':_0x339270=>{_0x38e7b3['setLoadingMessage'](_0x339270);},'clearLoadingMessage':()=>{_0x38e7b3['clearLoadingMessage']();}};}}const Xs='ai-selection';class zs extends _0x31818a{constructor(_0x221cbc){super(_0x221cbc),this['context']['config']['define']('ai.models.showModelSelector',!0x0);}['_outputDataProcessor'];['_fakeSelections']=[];['_sessionId'];static get['pluginName'](){return'AIEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}get['sessionId'](){if(!this['_sessionId']){const _0x1b8616=Ys(this['context']),_0x4c4f5a=_0x1b8616['plugins']['has']('RealTimeCollaborationClient')&&_0x1b8616['plugins']['get']('RealTimeCollaborationClient')['sessionId'];this['_sessionId']=_0x4c4f5a||at();}return this['_sessionId'];}async['getDocumentData'](){const _0x26f665=Ys(this['context']),_0xa33236=_0x26f665['model'],_0x184c91=_0x26f665['data']['toView'](_0xa33236['document']['getRoot'](),{'convertAiChatSelectionMarker':!0x0}),_0x210e45=new _0x57cd91(_0x26f665['editing']['view']['document']);this['_setDataIdsOnChildren'](_0x184c91,_0x210e45);let _0x49231a=await this['_getDocumentDataStringFromView'](_0x184c91);const _0x26999b=this['_getMarkersInDocumentOrder'](),_0x1f9fa3=[];for(const _0x2bd363 of _0x26999b){const _0x297bd3='<'+_0x2bd363['name']+':start></'+_0x2bd363['name']+':start>',_0x2b5bb3=_0x49231a['indexOf'](_0x297bd3);_0x49231a=_0x49231a['substring'](0x0,_0x2b5bb3)+_0x49231a['substring'](_0x2b5bb3+_0x297bd3['length']);const _0x5bd110='<'+_0x2bd363['name']+':end></'+_0x2bd363['name']+':end>',_0x31e5c8=_0x49231a['indexOf'](_0x5bd110);_0x49231a=_0x49231a['substring'](0x0,_0x31e5c8)+_0x49231a['substring'](_0x31e5c8+_0x5bd110['length']),_0x1f9fa3['push']({'markerName':_0x2bd363['name'],'start':_0x2b5bb3,'end':_0x31e5c8,'htmlFragment':_0x49231a['substring'](_0x2b5bb3,_0x31e5c8)});}return{'content':_0x49231a,'version':_0x26f665['model']['document']['version'],'sessionId':this['sessionId'],'selections':_0x1f9fa3};}async['afterInit'](){this['context']instanceof _0x25289c?this['_integrateEditor'](this['context']):this['listenTo'](this['context']['editors'],'add',(_0x1ab7b2,_0x1a2e8f)=>{_0x1a2e8f['on']('ready',()=>{this['_integrateEditor'](_0x1a2e8f);});});}['_setOutputDataProcessor'](_0x42c0cf){this['_outputDataProcessor']=_0x42c0cf;}async['_getDocumentDataStringFromView'](_0x1a355d){let _0x2d8be8;const _0x3ba659=Ys(this['context']);if(this['_outputDataProcessor']){const _0x2c581e=_0x3ba659['data']['processor']['domConverter']['viewToDom'](_0x1a355d),_0x5255b3=await this['_outputDataProcessor'](_0x2c581e);_0x2d8be8=_0x3ba659['data']['processor']['htmlWriter']['getHtml'](_0x5255b3);}else _0x2d8be8=_0x3ba659['data']['processor']['toData'](_0x1a355d);return _0x2d8be8;}['_integrateEditor'](_0x146bc8){_0x146bc8['conversion']['for']('editingDowncast')['markerToHighlight']({'model':Xs,'view':({markerName:_0x9662e})=>({'classes':['ck-ai-assistant-ui_theme','ck-fake-ai-selection','ck-fake-ai-selection-'+_0x9662e['split'](':')[0x1]],'priority':0xc})}),_0x146bc8['conversion']['for']('dataDowncast')['markerToElement']({'model':Xs,'view':(_0x460a75,{writer:_0x145403,options:_0x25f7db})=>_0x25f7db['convertAiChatSelectionMarker']?_0x145403['createUIElement'](_0x460a75['markerName']+':'+(_0x460a75['isOpening']?'start':'end')):null});}['showFakeVisualSelection'](_0x3eb633){const _0x1cffae=this['_fakeSelections'][0x0]||null;this['_addFakeSelection'](_0x3eb633);const _0x4eebbd=this['_fakeSelections'][0x0]||null;this['_refreshFakeSelection'](_0x1cffae,_0x4eebbd);}['hideFakeVisualSelection'](_0x4cd1c4){const _0x11c883=this['_fakeSelections'][0x0]||null;this['_removeFakeSelectionById'](_0x4cd1c4);const _0x2809ea=this['_fakeSelections'][0x0]||null;this['_refreshFakeSelection'](_0x11c883,_0x2809ea);}async['modelToDataWithIds'](_0x5cf367){const _0x221621=Ys(this['context']),_0x2bf166=_0x221621['data']['toView'](_0x5cf367),_0x178852=new _0x57cd91(_0x221621['editing']['view']['document']);return this['_setDataIdsOnChildren'](_0x2bf166,_0x178852),this['_getDocumentDataStringFromView'](_0x2bf166);}['_setDataIdsOnChildren'](_0x10f926,_0x23faee){let _0x3275f7=!0x1;const _0x29e9fb=new Set();for(const _0x40a1b0 of _0x10f926['getChildren']()){if(!_0x40a1b0['is']('view:element'))continue;const _0x47755e=_0x40a1b0['is']('view:containerElement'),_0x328ec0=_0x40a1b0['is']('view:emptyElement'),_0xe49809=this['_setDataIdsOnChildren'](_0x40a1b0,_0x23faee);if(_0x40a1b0['hasAttribute']('data-id')){_0x3275f7=!0x0,_0x29e9fb['add'](_0x40a1b0['getAttribute']('data-id'));continue;}(_0x47755e||_0x328ec0||_0xe49809)&&(_0x23faee['setAttribute']('data-id',this['_nextDataId'](_0x29e9fb),_0x40a1b0),_0x3275f7=!0x0);}return _0x3275f7;}['_nextDataId'](_0x47b0ea){let _0x473625;do{_0x473625='';for(let _0x3e6856=0x0;_0x3e6856<0x4;_0x3e6856++)_0x473625+=String['fromCharCode'](0x61+Math['floor'](0x1a*Math['random']()));}while(_0x47b0ea['has'](_0x473625));return _0x47b0ea['add'](_0x473625),_0x473625;}['getSelectionText'](){const {model:_0x3fdf43}=Ys(this['context']),_0x58f214=_0x3fdf43['document']['selection'],_0x174c8c=[],_0x2240cf=Array['from'](_0x58f214['getRanges']());_0x2240cf['sort']((_0x277224,_0x347f81)=>_0x277224['start']['isBefore'](_0x347f81['start'])?-0x1:0x1);for(const _0x5ca175 of _0x2240cf)for(const _0x4c9774 of _0x5ca175['getItems']())_0x4c9774['is']('$textProxy')?_0x174c8c['push'](_0x4c9774['data']):_0x4c9774['is']('element')&&_0x174c8c['length']>0x0&&'\x20'!==_0x174c8c[_0x174c8c['length']-0x1]&&_0x174c8c['push']('\x20');return _0x174c8c['length']?'\x22'+_0x174c8c['join']('')['trim']()+'\x22':cs(this['context']['locale'],'AI_CHAT_CONTEXT_DOCUMENT_SELECTION_LABEL');}['_removeFakeSelectionById'](_0x23417c){for(let _0x5934ca=0x0;_0x5934ca<this['_fakeSelections']['length'];_0x5934ca++)if(this['_fakeSelections'][_0x5934ca]['id']==_0x23417c)return void this['_fakeSelections']['splice'](_0x5934ca,0x1);}['_addFakeSelection'](_0x37c8c2){this['_removeFakeSelectionById'](_0x37c8c2['id']),Ct(this['_fakeSelections'],_0x37c8c2);}['_refreshFakeSelection'](_0x22d371,_0x4327ba){if(_0x22d371==_0x4327ba)return;const _0x16998f=Ys(this['context']),_0x5a7139=_0x16998f['model'];_0x5a7139['change'](_0x340c8e=>{if(_0x22d371){const _0x3615a3=_0x16998f['model']['markers']['getMarkersGroup'](Xs);for(const _0x39c5a7 of _0x3615a3)_0x340c8e['removeMarker'](_0x39c5a7);}if(_0x4327ba)for(let _0x3b6bfc=0x0;_0x3b6bfc<_0x4327ba['ranges']['length'];_0x3b6bfc++){let _0x5c75da=_0x4327ba['ranges'][_0x3b6bfc];const _0x138d28=Xs+':'+_0x4327ba['id']+':'+_0x3b6bfc;if(_0x5c75da['start']['isAtEnd']){const _0x4b9a24=_0x5c75da['start']['getLastMatchingPosition'](({item:_0x46cae4})=>!_0x5a7139['schema']['isContent'](_0x46cae4),{'boundaries':_0x5c75da});_0x5c75da=_0x340c8e['createRange'](_0x4b9a24,_0x5c75da['end']);}_0x340c8e['addMarker'](_0x138d28,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x5c75da});}});}['_getMarkersInDocumentOrder'](){const _0x19b4ab=Ys(this['context'])['model'];return Array['from'](_0x19b4ab['markers']['getMarkersGroup'](Xs))['sort']((_0x30a10c,_0x3c7dee)=>_0x30a10c['getStart']()['isBefore'](_0x3c7dee['getStart']())?-0x1:_0x30a10c['getStart']()['isAfter'](_0x3c7dee['getStart']())?0x1:0x0);}}const js=['showChangeInText','insertSuggestion','applySuggestion','rejectSuggestion','mouseOverSuggestion','mouseLeaveSuggestion','toggleSuggestionDisplayMode','like','dislike'],Js=[...js,'startConversation','resizeTabs','sendUserMessage','abortPromptStream','addDocumentToContext','addFileToContext','addUrlToContext','executeCustomItemCallback','addResourceToContext','removeContextItem','loadSourceResources','toggleWebSearch','toggleReasoning','selectModel'];class Zs{['options'];['isStreaming']=!0x1;['document']=null;['nodesList']=[];['currentIndex']=0x0;['timeoutAbortController']=null;['lastUpdateTime']=0x0;constructor(_0x29489b){this['options']={'delay':_0x29489b['delay']??0x14,'textNodeStyle':_0x29489b['textNodeStyle'],'onStreamUpdate':_0x29489b['onStreamUpdate']||(()=>{})};}async['stream']({document:_0x2f9cce,targetElement:_0x3e6a81,abortSignal:_0x526896}){this['isStreaming']&&this['stop'](),_0x526896?.['addEventListener']('abort',this['stop']['bind'](this)),this['document']=_0x1753f2(_0x2f9cce,!0x0),this['nodesList']=this['getParsedDocumentNodeList'](),this['isStreaming']=!0x0,this['currentIndex']>this['nodesList']['length']&&(this['currentIndex']=this['nodesList']['length']);for(let _0x561a03=0x0;_0x561a03<this['currentIndex'];_0x561a03++)this['nodesList'][_0x561a03]['shouldBeStreamed']=!0x0;do{const _0x247a12=Date['now'](),_0x2d091e=this['nodesList'][this['currentIndex']],_0x2775f3=_0x247a12-this['lastUpdateTime'];if(_0x2d091e){_0x2d091e['shouldBeStreamed']=!0x0;let _0xdae194=_0x2d091e['parent'];for(;_0xdae194;)_0xdae194['shouldBeStreamed']=!0x0,_0xdae194=_0xdae194['parent'];}if(_0x2775f3<this['options']['delay'])try{const {promise:_0xe426ea,abortController:_0x535a14}=nn(this['options']['delay']-_0x2775f3);this['timeoutAbortController']=_0x535a14,await _0xe426ea;}catch(_0x32cb84){return;}_0x51d6f8(_0x3e6a81,'<'+_0x3e6a81['tagName']+'>'+this['renderNode'](this['document'])+'</'+_0x3e6a81['tagName']+'>',{'childrenOnly':!0x0}),this['options']['onStreamUpdate']&&this['options']['onStreamUpdate'](),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:_0x319e0b}){Array['from'](_0x319e0b['querySelectorAll']('span[data-ck-html-streamer-word-chunk]'))['reverse']()['forEach'](_0x60c6e=>{_0x60c6e['replaceWith'](_0x60c6e['childNodes'][0x0]);});}['stop'](){this['isStreaming']=!0x1,this['timeoutAbortController']&&(this['timeoutAbortController']['abort'](),this['timeoutAbortController']=null);}['renderNode'](_0x167c69){let _0x5e3116='';if(function(_0x4888dd){return _0x1a12ea(_0x4888dd);}(_0x167c69)){for(const _0x2eb328 of _0x167c69['children'])_0x5e3116+=this['renderNode'](_0x2eb328);}else{if(sn(_0x167c69)){if(!_0x167c69['shouldBeStreamed'])return'';const _0x50a200=_0x167c69,_0x676713=Object['entries'](_0x50a200['attribs'])['map'](([_0x48c910,_0x219097])=>_0x48c910+'=\x22'+_0x219097+'\x22')['join']('\x20');_0x5e3116+='<'+_0x50a200['tagName']+(_0x676713?'\x20'+_0x676713:'')+'>';for(const _0x2b193a of _0x2ac150(_0x50a200))_0x5e3116+=this['renderNode'](_0x2b193a);_0x5e3116+='</'+_0x50a200['tagName']+'>';}else{if(!en(_0x167c69))return'';if(!_0x167c69['shouldBeStreamed'])return'';!function(_0x44e1de){if(!_0x44e1de['parent']||!sn(_0x44e1de['parent']))return!0x1;if(!tn['includes'](_0x44e1de['parent']['tagName']))return!0x1;return!ti(_0x44e1de)['match'](/^\s*[<>]\s*$/);}(_0x167c69)?_0x5e3116+=_0x345257(_0x167c69):_0x5e3116+=_0x345257(new _0x507e32('span',{'data-ck-html-streamer-word-chunk':'','style':this['options']['textNodeStyle']},[_0x167c69]));}}return _0x5e3116;}['getParsedDocumentNodeList'](){const _0x49423a=[];return function(_0x2bf846,_0x2c302b){const _0x653030=_0x6cb51=>{if(_0x2c302b(_0x6cb51),_0x6cb51 instanceof _0x3de140)for(let _0x3cc4ef=0x0;_0x3cc4ef<_0x6cb51['children']['length'];_0x3cc4ef++){const _0x5eb075=_0x6cb51['children'][_0x3cc4ef];_0x653030(_0x5eb075);}};for(let _0x1d7d50=0x0;_0x1d7d50<_0x2bf846['children']['length'];_0x1d7d50++)_0x653030(_0x2bf846['children'][_0x1d7d50]);}(this['document'],_0x398a81=>{if(en(_0x398a81)){const _0x17266b=this['splitTextNodeIntoWordNodes'](_0x398a81);_0x17266b['length']&&_0x49423a['push'](..._0x17266b);}_0x398a81['isWordSplitSource']||_0x398a81['isWordSplitResult']||_0x49423a['push'](_0x398a81);}),_0x49423a;}['splitTextNodeIntoWordNodes'](_0x434c9e){if(_0x434c9e['isWordSplitSource']||_0x434c9e['isWordSplitResult'])return[];const _0x3ea695=ti(_0x434c9e)['match'](/(?:\s*\S+\s*)/g),_0x30c1a8=[];if(_0x3ea695&&_0x3ea695['length']>0x1){for(const _0x432890 of _0x3ea695){const _0x1c81ed=new _0x28eb0b(_0x432890);_0x1c81ed['isWordSplitResult']=!0x0,_0xe19e73(_0x434c9e,_0x1c81ed),_0x30c1a8['push'](_0x1c81ed);}_0x434c9e['isWordSplitSource']=!0x0,_0x9eae66(_0x434c9e);}return _0x30c1a8;}}const tn=['p','li','td','th','span','h1','h2','h3','h4','h5','h6','b','strong','i','em','mark','del','ins','sup','sub','a','code','div'];function en(_0xb53fe0){return _0x2d8928(_0xb53fe0);}function sn(_0x419e6a){return _0x3003c8(_0x419e6a);}function nn(_0x52c92f){const _0x574ddc=new AbortController();return{'promise':new Promise((_0x3ac17b,_0x345914)=>{const _0x17ff0f=setTimeout(_0x3ac17b,_0x52c92f);_0x574ddc['signal']['addEventListener']('abort',()=>{clearTimeout(_0x17ff0f),_0x345914();});}),'abortController':_0x574ddc};}class rn extends Nt{['options'];['content']='';['htmlStreamer'];['children'];constructor(_0x4722b4){super();const _0x3d2662=this['bindTemplate'];this['set']('isDone',!0x1),this['set']('isVisible',!0x0),this['htmlStreamer']=new Zs({'textNodeStyle':'animation:\x20ck-html-streamer-fade-in\x20.5s','delay':0x14}),this['options']=_0x4722b4,this['children']=this['createCollection'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed__item',_0x3d2662['if']('isDone','ck-ai-chat__feed__item_done'),_0x3d2662['if']('isVisible','ck-hidden',_0x5ce73c=>!_0x5ce73c),'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'](_0x20a649=>{_0x20a649['removeAttribute']('data-id');}),this['isDone']=!0x0;}async['streamIntoElement'](_0x2ab5ef,_0x390ab7,_0x3ac472){await this['htmlStreamer']['stream']({'document':_0x2ab5ef,'targetElement':_0x390ab7,'abortSignal':_0x3ac472});}}class an extends Nt{['showChangesToggleView'];constructor(_0x37ae96,_0x1a7155){super(_0x37ae96),this['set']('isShowChangesToggleVisible',!0x0),this['showChangesToggleView']=new on(_0x37ae96),this['showChangesToggleView']['set']({'class':'ck-ai-suggestion__header__show-changes-toggle\x20ck-ai-chat-controls-button\x20'+ds,'label':cs(_0x37ae96,'AI_SUGGESTION_BUTTON_SHOW_CHANGES'),'withText':!0x0}),this['showChangesToggleView']['isOn']=_0x1a7155['showDiff'],this['showChangesToggleView']['bind']('isVisible')['to'](this,'isShowChangesToggleVisible'),this['showChangesToggleView']['bind']('icon')['to'](this['showChangesToggleView'],'isOn',_0x181307=>_0x181307?_0x5e73e2:_0xacb23c),this['showChangesToggleView']['on']('execute',()=>{this['showChangesToggleView']['isOn']=!this['showChangesToggleView']['isOn'],this['fire']('toggleShowChanges',{'isOn':this['showChangesToggleView']['isOn']});});const _0x196d3a=new yt();_0x196d3a['content']=_0x29737e,this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__header',!0x1===_0x1a7155['showHeader']?'ck-hidden':null]['filter'](Boolean)},'children':[_0x196d3a,{'tag':'span','children':[cs(_0x37ae96,'AI_SUGGESTION_HEADER_TITLE')]},this['showChangesToggleView']]});}}class on extends kt{['render'](){super['render'](),this['children']['remove'](this['iconView']),this['children']['add'](this['iconView']);}}const hn={'accepted':_0x59e1e6,'rejected':_0x2dfefc,'outdated':_0x2dfefc};class cn extends Nt{['stateIconView'];constructor(_0x4eda5c){super(_0x4eda5c);const _0x2502bc=this['bindTemplate'];this['set']('state','accepted'),this['set']('isVisible',!0x0),this['stateIconView']=new ln(),this['stateIconView']['bind']('state')['to'](this),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__content-part-state',_0x2502bc['to']('state',_0x4a4e0d=>'ck-ai-suggestion__content-part-state_'+_0x4a4e0d),_0x2502bc['if']('isVisible','ck-hidden',_0x5f0143=>!_0x5f0143)]},'children':[{'tag':'span','attributes':{'class':['ck-ai-suggestion__content-part-state__label']},'children':[{'text':_0x2502bc['to']('state',_0x4ff545=>{switch(_0x4ff545){case'accepted':return cs(_0x4eda5c,'AI_SUGGESTION_CONTENT_PART_STATE_ACCEPTED');case'rejected':return cs(_0x4eda5c,'AI_SUGGESTION_CONTENT_PART_STATE_REJECTED');case'outdated':return cs(_0x4eda5c,'AI_SUGGESTION_CONTENT_PART_STATE_OUTDATED');}})}]},this['stateIconView']]});}['setState'](_0x154467){this['state']=_0x154467;}}class ln extends yt{constructor(){super(),this['set']('state','accepted'),this['content']=hn[this['state']],this['on']('change:state',()=>{this['content']=hn[this['state']];});}}class un extends Ot{['_applyButton'];['_suggestButton'];constructor(_0x275dc6,_0x297a9c,_0x6e53e4){super(_0x275dc6);const _0x3e1102=Boolean(_0x6e53e4);this['set']('isEnabled',!_0x3e1102),this['set']('isVisible',!0x0),this['class']='ck-ai-suggestion-content-part-toolbar';const _0x58210f=[];if(_0x3e1102){const _0x12af3d=new kt(_0x275dc6);_0x12af3d['set']({'label':cs(_0x275dc6,'AI_SUGGESTION_DISABLED_TOOLTIP_MESSAGE'),'tooltip':!0x0,'withText':!0x1,'icon':_0x411b77}),_0x12af3d['extendTemplate']({'attributes':{'data-cke-tooltip-class':'ck-ai-suggestion-content-part-disabled-actions-tooltip'}}),_0x58210f['push'](_0x12af3d);}else{_0x297a9c['includes']('applySuggestion')&&(this['_applyButton']=new kt(_0x275dc6),this['_applyButton']['set']({'label':cs(_0x275dc6,'AI_SUGGESTION_CONTENT_PART_APPLY'),'tooltip':!0x0,'tooltipPosition':'n','withText':!0x1,'icon':_0x59e1e6}),this['_applyButton']['bind']('isEnabled')['to'](this),this['_applyButton']['on']('execute',()=>{this['fire']('applySuggestion');}),_0x58210f['push'](this['_applyButton'])),_0x297a9c['includes']('insertSuggestion')&&(this['_suggestButton']=new kt(_0x275dc6),this['_suggestButton']['set']({'label':cs(_0x275dc6,'AI_SUGGESTION_CONTENT_PART_ADD_SUGGESTION'),'tooltip':!0x0,'tooltipPosition':'n','withText':!0x1,'icon':_0x37d56e}),this['_suggestButton']['bind']('isEnabled')['to'](this),this['_suggestButton']['on']('execute',()=>{this['fire']('insertSuggestion');}),_0x58210f['push'](this['_suggestButton']));const _0xdd3fe7=new kt(_0x275dc6);_0xdd3fe7['set']({'label':cs(_0x275dc6,'AI_SUGGESTION_CONTENT_PART_REJECT'),'tooltip':!0x0,'tooltipPosition':'n','withText':!0x1,'icon':_0x2dfefc}),_0xdd3fe7['bind']('isEnabled')['to'](this),_0xdd3fe7['on']('execute',()=>{this['fire']('rejectSuggestion');}),_0x58210f['push'](_0xdd3fe7);}this['items']['addMany'](_0x58210f);const _0x1a5238=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':[_0x1a5238['if']('isVisible','ck-hidden',_0x4ca327=>!_0x4ca327)]}});}['setButtonsVisibility']({showApplyButton:_0x346abc,showSuggestButton:_0x2a465c}){this['_applyButton']&&(this['_applyButton']['isVisible']=_0x346abc),this['_suggestButton']&&(this['_suggestButton']['isVisible']=_0x2a465c);}}class dn extends Nt{['toolbarView'];['stateView'];['titleLabelView'];['children'];constructor(_0x2ab1db,{part:_0x4c0dde,uiIndex:_0x4e7d28,availableActions:_0x456220,areActionsDisabled:_0xbe0f12}){super(_0x2ab1db),this['set']('isEnabled',!0x0),this['set']('state','pending'),this['toolbarView']=new un(_0x2ab1db,_0x456220,_0xbe0f12),this['toolbarView']['on']('rejectSuggestion',()=>{this['fire']('rejectSuggestion',{'index':_0x4c0dde['index']});}),this['toolbarView']['on']('insertSuggestion',()=>{this['fire']('insertSuggestion',{'index':_0x4c0dde['index']});}),this['toolbarView']['on']('applySuggestion',()=>{this['fire']('applySuggestion',{'index':_0x4c0dde['index']});}),this['toolbarView']['bind']('isEnabled')['to'](this),this['stateView']=new cn(_0x2ab1db),this['titleLabelView']=new _n(_0x2ab1db,_0x4e7d28),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',(_0x3e60f4,_0x1fddf6,_0x3576e4,_0x23f65f)=>{'pending'===_0x23f65f?this['children']['remove'](this['toolbarView']):this['children']['remove'](this['stateView']),'pending'===_0x3576e4?this['children']['add'](this['toolbarView']):(this['stateView']['setState'](_0x3576e4),this['children']['add'](this['stateView']));});}}class _n extends Nt{constructor(_0x414a53,_0x4e967e){super(_0x414a53),this['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai-suggestion__body__content-part__title__label']},'children':[cs(_0x414a53,'AI_SUGGESTION_CONTENT_PART_TITLE',_0x4e967e['toString']())]});}}class An extends Nt{['htmlStreamer'];constructor(_0x584ff8){super(_0x584ff8),this['htmlStreamer']=new Zs({'textNodeStyle':'animation:\x20ck-html-streamer-fade-in\x20.5s','delay':0x14}),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-content','ck-reset_all-excluded','ck-ai-suggestion-streamable-content']}});}async['update']({part:_0x53b625,renderingStrategy:_0x40fd26,abortSignal:_0x4ed8a6}){'streaming'===_0x40fd26?await this['htmlStreamer']['stream']({'document':_0x53b625['content'],'targetElement':this['element'],'abortSignal':_0x4ed8a6}):this['element']['innerHTML']=gs(_0x53b625['content']);}['clear'](){this['htmlStreamer']['reset'](),this['element']['innerHTML']='';}}class gn extends Nt{['_children'];['_headerView'];['_streamableContentView'];constructor(_0x443793,{part:_0x368696,uiIndex:_0x400e72,areActionsDisabled:_0x439393,availableActions:_0x567bf4}){super(_0x443793);const _0x3ed89f=this['bindTemplate'];this['set']('state','pending'),this['set']('isDone',!0x1),this['set']('isVisible',!0x1),this['set']('isActive',!0x1),this['set']('isEnabled',!0x1);const _0x52f590=()=>{this['isEnabled']=this['isDone']&&'pending'==this['state']&&!_0x439393;};this['on']('change:state',_0x52f590),this['on']('change:isDone',_0x52f590),_0x52f590(),this['_children']=this['createCollection'](),this['_headerView']=new dn(_0x443793,{'part':_0x368696,'uiIndex':_0x400e72,'availableActions':_0x567bf4,'areActionsDisabled':_0x439393}),this['_headerView']['bind']('isEnabled','state')['to'](this),this['_headerView']['delegate'](...js)['to'](this),this['_streamableContentView']=new An(_0x443793),this['_children']['addMany']([this['_headerView'],this['_streamableContentView']]),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__body__content-part',_0x3ed89f['to']('state',_0x128f1a=>'ck-ai-suggestion__body__content-part_'+_0x128f1a),_0x3ed89f['if']('isEnabled','ck-ai-suggestion__body__content-part_enabled'),_0x3ed89f['if']('isActive','ck-ai-suggestion__body__content-part_active'),_0x3ed89f['if']('isVisible','ck-hidden',_0x2cc127=>!_0x2cc127)]},'children':this['_children'],'on':{'mouseenter':_0x3ed89f['to'](()=>{this['isEnabled']&&this['fire']('mouseOverSuggestion',{'index':_0x368696['index']});}),'mouseleave':_0x3ed89f['to'](()=>{this['isEnabled']&&this['fire']('mouseLeaveSuggestion',{'index':_0x368696['index']});}),'click':_0x3ed89f['to'](_0x4778fe=>{const _0x3d29ae=_0x4778fe['target'];this['isEnabled']&&!this['_headerView']['toolbarView']['element']['contains'](_0x3d29ae)&&this['fire']('showChangeInText',{'index':_0x368696['index']});})}});}async['updateContent']({part:_0x5de769,renderingStrategy:_0x24210b,showUnchangedParts:_0x17d319=!0x1,abortSignal:_0xe90587}){this['partDefinition']=_0x5de769,this['isVisible']=this['partDefinition']['hasChanges']||_0x17d319,this['isVisible']&&await this['_streamableContentView']['update']({'part':_0x5de769,'renderingStrategy':_0x24210b,'abortSignal':_0xe90587});}['markAsDone'](){this['isDone']=!0x0;}}class In extends Et(){['queue']=[];['isProcessing']=!0x1;['_abortController'];async['enqueue'](_0x1e79a0){const _0x299a16=this['createTask'](_0x1e79a0);return this['queue']['push'](_0x299a16),this['_processQueue'](),_0x299a16['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(_0x40b978=>{this['once']('_queueEmpty',()=>{_0x40b978();});}):Promise['resolve']();}async['_processQueue'](){if(!this['isProcessing']){this['_abortController']=new AbortController(),this['isProcessing']=!0x0;try{for(;this['queue']['length']&&this['isProcessing'];){const _0x86e1cb=this['queue']['shift']();try{await _0x86e1cb['callback'](this['_abortController']['signal']),_0x86e1cb['resolve']();}catch(_0x2fb7ab){_0x86e1cb['reject'](_0x2fb7ab);}}}finally{this['isProcessing']=!0x1,this['_abortController']=void 0x0;}this['fire']('_queueEmpty');}}['createTask'](_0x204300){let _0x59b0d3,_0x4bdbeb;const _0xad17d1=new Promise((_0x131614,_0x2e9b10)=>{_0x59b0d3=_0x131614,_0x4bdbeb=_0x2e9b10;});return{'callback':_0x204300,'resolve':_0x59b0d3,'reject':_0x4bdbeb,'completePromise':_0xad17d1};}}class En extends rn{constructor(_0x3c967a){super(_0x3c967a),this['extendTemplate']({'attributes':{'class':['ck-ai-notification','warning'===_0x3c967a['level']?'ck-ai-notification_warning':'ck-ai-notification_error']}});}['render'](){super['render'](),this['setContent'](this['options']['initialContent']),this['markAsDone']();}['setContent'](_0x265c8d){this['element']['innerHTML']=_0x265c8d;}}const pn=['applySuggestion','insertSuggestion'];class Tn extends Nt{['_applyChangesButton'];['_insertSuggestionsButton'];['children'];constructor(_0x11bae9,_0x5a956a=[...pn],_0x44bc0a){super(_0x11bae9);const _0x27e806=this['bindTemplate'],_0x3b8c9a=Boolean(_0x44bc0a);if(this['set']('isEnabled',!_0x3b8c9a),this['set']('isVisible',!0x1),this['set']('isTrackChangesOn',!0x1),this['children']=this['createCollection'](),_0x3b8c9a){const _0x3ce94e=new kt(_0x11bae9);_0x3ce94e['set']({'label':cs(_0x11bae9,'AI_SUGGESTION_DISABLED_TOOLTIP_MESSAGE'),'tooltip':!0x0,'withText':!0x1,'icon':_0x411b77}),_0x3ce94e['extendTemplate']({'attributes':{'data-cke-tooltip-class':'ck-ai-suggestion-content-part-disabled-actions-tooltip'}});const _0x2de3f6=new Nt(_0x11bae9);_0x2de3f6['setTemplate']({'tag':'div','attributes':{'class':'ck-ai-chat__feed__suggestion__actions__info'},'children':[{'tag':'p','children':[cs(_0x11bae9,'AI_SUGGESTION_DISABLED_FEED_MESSAGE'),_0x3ce94e]}]}),this['children']['add'](_0x2de3f6);}else this['_applyChangesButton']=new kt(_0x11bae9),this['_applyChangesButton']['set']({'label':cs(_0x11bae9,'AI_CHAT_SUGGESTION_ACTION_APPLY_ALL'),'withText':!0x0,'type':'button','isVisible':_0x5a956a['includes']('applySuggestion'),'class':ls}),this['_insertSuggestionsButton']=new kt(_0x11bae9),this['_insertSuggestionsButton']['set']({'label':cs(_0x11bae9,'AI_CHAT_SUGGESTION_ACTION_SUGGEST_ALL'),'withText':!0x0,'type':'button','isVisible':_0x5a956a['includes']('insertSuggestion'),'class':us}),this['_insertSuggestionsButton']['on']('execute',()=>{this['fire']('insertSuggestion');}),this['_applyChangesButton']['on']('execute',()=>{this['fire']('applySuggestion');}),[this['_applyChangesButton'],this['_insertSuggestionsButton']]['forEach'](_0x334d53=>{_0x334d53['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',_0x27e806['if']('isVisible','ck-hidden',_0x1e7a64=>!_0x1e7a64)]},'children':this['children']}),this['on']('change:isTrackChangesOn',()=>{this['_applyChangesButton']&&(this['_applyChangesButton']['isVisible']=!this['isTrackChangesOn']);});}['updateVisibility'](_0x36b8a0){this['isVisible']=_0x36b8a0;}['_switchButtonLabelsPlurality'](_0x46d357){this['_applyChangesButton']&&this['_insertSuggestionsButton']&&(_0x46d357?(this['_applyChangesButton']['label']=cs(this['locale'],'AI_CHAT_SUGGESTION_ACTION_APPLY_ALL'),this['_insertSuggestionsButton']['label']=cs(this['locale'],'AI_CHAT_SUGGESTION_ACTION_SUGGEST_ALL')):(this['_applyChangesButton']['label']=cs(this['locale'],'AI_CHAT_SUGGESTION_ACTION_APPLY'),this['_insertSuggestionsButton']['label']=cs(this['locale'],'AI_CHAT_SUGGESTION_ACTION_SUGGEST')));}}class mn extends Nt{['children'];['balloonPanelView'];['bodyCollection'];constructor(_0x13f498,_0x3fd4f7){super(_0x13f498),this['bodyCollection']=_0x3fd4f7,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',_0x30050d=>!_0x30050d)]},'children':this['children']});const _0x5ac00a=new Nt(this['locale']),_0x5d4cc1=new yt();_0x5d4cc1['content']=_0xbe0d02,_0x5ac00a['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-web-sources__header']},'children':[_0x5d4cc1,{'tag':'span','children':[{'text':cs(this['locale'],'AI_CHAT_SOURCES_HEADER')}]}]}),this['children']['add'](_0x5ac00a),this['_setupBalloonPanel'](_0x13f498);}['addSource'](_0x317fae){this['children']['add'](new Cn(this['locale'],_0x317fae,this['balloonPanelView']));}['_setupBalloonPanel'](_0x2cb3cb){this['balloonPanelView']=new Qt(_0x2cb3cb),this['balloonPanelView']['extendTemplate']({'attributes':{'class':['ck-ai-web-source__tooltip-balloon']}}),this['bodyCollection']['add'](this['balloonPanelView']);}}class Cn extends kt{['balloonPanelView'];['source'];constructor(_0x5bc234,_0x4981e9,_0x3e3ee4){super(_0x5bc234),this['source']=_0x4981e9,this['balloonPanelView']=_0x3e3ee4,this['set']({'label':_0x4981e9['title'],'class':['ck\x20ck-ai-web-source'],'withText':!0x0});const _0x4594af=this['bindTemplate'];if(this['extendTemplate']({'on':{'click':_0x4594af['to'](()=>{window['open'](_0x4981e9['url'],'_blank');}),'mouseenter':_0x4594af['to'](()=>{this['_showTooltip']();}),'mouseleave':_0x4594af['to'](()=>{this['_hideTooltip']();})}}),_0x4981e9['favicon']){const _0x456899=new Nt(_0x5bc234);_0x456899['setTemplate']({'tag':'img','attributes':{'src':_0x4981e9['favicon']||_0xbe0d02,'alt':_0x4981e9['title'],'class':['ck-ai-web-source__image']}}),this['children']['add'](_0x456899);}else this['set']('icon',_0xbe0d02);}['_createTooltipContentView'](_0x45780a,_0x3e7ae2){const _0x57f4ed=new Nt(_0x45780a),_0x24c0b7=[];let _0x4dce54;_0x3e7ae2?.['favicon']?(_0x4dce54=new Nt(_0x45780a),_0x4dce54['setTemplate']({'tag':'img','attributes':{'src':_0x3e7ae2['favicon'],'alt':_0x3e7ae2['title'],'class':['ck-ai-web-source__tooltip-image']}})):(_0x4dce54=new yt(),_0x4dce54['content']=_0xbe0d02,_0x4dce54['extendTemplate']({'attributes':{'alt':_0x3e7ae2['title'],'class':['ck-ai-web-source__tooltip-image']}})),_0x24c0b7['push'](_0x4dce54);const _0x5961d1=new Nt(_0x45780a);_0x5961d1['setTemplate']({'tag':'a','attributes':{'class':['ck-ai-web-source__tooltip-url'],'href':_0x3e7ae2['url']},'children':[{'text':new URL(_0x3e7ae2['url'])?.['hostname']}]}),_0x24c0b7['push'](_0x5961d1);const _0x7f4e5d=new Nt(_0x45780a);_0x7f4e5d['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-web-source__tooltip-row']},'children':_0x24c0b7});const _0x1dd86e=new Nt(_0x45780a);return _0x1dd86e['setTemplate']({'tag':'span','attributes':{'class':['ck-ai-web-source__tooltip-row','ck-ai-web-source__tooltip-title']},'children':[{'text':_0x3e7ae2['title']['length']>0x190?_0x3e7ae2['title']['substring'](0x0,0x190)+'...':_0x3e7ae2['title']}]}),_0x57f4ed['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-web-source__tooltip']},'children':[_0x7f4e5d,_0x1dd86e]}),_0x57f4ed;}['_showTooltip'](){this['_updateTooltipContent'](),this['balloonPanelView']['pin']({'target':this['element'],'positions':[Qt['defaultPositions']['northArrowSouth'],Qt['defaultPositions']['northArrowSouthWest'],Qt['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 _0x161b7b=this['_createTooltipContentView'](this['locale'],this['source']);this['balloonPanelView']['content']['add'](_0x161b7b);}}class wn extends Nt{['_actionsView'];['_sourcesView'];['_children'];['_areActionsDisabled'];['_showUnchangedParts'];['_updateContentPartsPromiseQueue'];['_emptyPartsWarningView'];['_availableActions'];['_cachedContentParts']=[];constructor(_0x1d569f,_0x364cea){super(_0x1d569f);const {areActionsDisabled:_0x2a316a,showUnchangedParts:_0x259988,availableActions:_0x3ae8aa}=_0x364cea;this['_areActionsDisabled']=_0x2a316a,this['_showUnchangedParts']=_0x259988,this['_availableActions']=_0x3ae8aa,this['set']('hasPendingParts',!0x1),this['set']('isTrackChangesOn',!0x1),this['_children']=this['createCollection'](),this['_updateContentPartsPromiseQueue']=new In(),this['_emptyPartsWarningView']=new En({'id':'empty-parts-warning','initialContent':cs(_0x1d569f,'AI_SUGGESTION_EMPTY_PART_WARNING'),'level':'warning'}),this['_emptyPartsWarningView']['isVisible']=!0x1,this['_actionsView']=new Tn(_0x1d569f,_0x364cea['availableActions'],this['_areActionsDisabled']),this['_actionsView']['bind']('isTrackChangesOn')['to'](this),this['_sourcesView']=new mn(this['locale'],_0x364cea['bodyCollection']),_0x364cea['areActionsDisabled']?this['_actionsView']['isEnabled']=!0x1:this['_actionsView']['bind']('isEnabled')['to'](this,'hasPendingParts'),this['_actionsView']['delegate'](...js)['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']]});}get['partsCount'](){return this['_children']['length'];}async['updateContentParts']({parts:_0x37642d,renderingStrategy:_0x4994ab,abortSignal:_0x38fff3}){this['_children']['length']?_0x37642d['forEach'](_0x9646a3=>{const _0x4e899f=this['_cachedContentParts']['findIndex'](_0xc304cd=>_0xc304cd['index']==_0x9646a3['index']);-0x1===_0x4e899f?this['_cachedContentParts']['push'](_0x9646a3):this['_cachedContentParts'][_0x4e899f]=_0x9646a3;}):this['_cachedContentParts']=_0x37642d;const _0x4227f0=this['_showUnchangedParts']?_0x37642d:_0x37642d['filter'](_0x3a45a1=>_0x3a45a1['hasChanges']);this['_actionsView']['_switchButtonLabelsPlurality'](_0x4227f0['length']>0x1);for(const _0x1a7ee6 of _0x4227f0)this['_updateContentPartsPromiseQueue']['enqueue'](async _0x3f2ce2=>{let _0x9d60e=this['getPartView'](_0x1a7ee6['index']);_0x9d60e||(_0x9d60e=new gn(this['locale'],{'part':_0x1a7ee6,'uiIndex':this['_children']['length']+0x1,'areActionsDisabled':this['_areActionsDisabled'],'availableActions':this['_availableActions']}),_0x9d60e['delegate'](...js)['to'](this),this['_children']['add'](_0x9d60e),this['hasPendingParts']=!0x0),await _0x9d60e['updateContent']({'part':_0x1a7ee6,'renderingStrategy':_0x4994ab,'showUnchangedParts':this['_showUnchangedParts'],'abortSignal':_0x3f2ce2}),_0x9d60e['markAsDone']();});return _0x38fff3?.['addEventListener']('abort',()=>{this['_updateContentPartsPromiseQueue']['abort']();}),this['_updateContentPartsPromiseQueue']['queueEmptyPromise'];}['updatePartState'](_0x22c7f6,_0x3d0664){const _0x28e024=this['getPartView'](_0x22c7f6);_0x28e024&&(_0x28e024['state']=_0x3d0664),this['hasPendingParts']='pending'==_0x3d0664||Array['from'](this['_children'])['some'](_0x266ecd=>'pending'==_0x266ecd['state']);}['setPartActive'](_0x3230ed,_0x1a92b2){if(!0x1===_0x3230ed){for(const _0x399b5e of this['_children'])_0x399b5e['isActive']=!0x1;}else{const _0x38aa17=this['getPartView'](_0x3230ed);_0x38aa17&&(_0x38aa17['isActive']=_0x1a92b2);}}['updateSources'](_0x521d19){_0x521d19['forEach'](_0x1b48a9=>this['_sourcesView']['addSource'](_0x1b48a9)),this['_sourcesView']['isVisible']=!0x0;}['getPartView'](_0xb4f2f){return this['_children']['find'](_0x5e18d8=>_0x5e18d8['partDefinition']['index']==_0xb4f2f)??null;}['markAsDone'](){if(!this['_showUnchangedParts']){const _0x45e41e=!this['_cachedContentParts']['find'](({hasChanges:_0x4f0f7e})=>_0x4f0f7e),_0x34247d=!!this['_cachedContentParts']['find'](({hasChanges:_0x4a66d6})=>!_0x4a66d6);this['_emptyPartsWarningView']['isVisible']=0x0==this['_children']['length']||_0x34247d,_0x45e41e?this['_emptyPartsWarningView']['setContent'](cs(this['locale'],'AI_SUGGESTION_NO_PARTS_WARNING')):this['_emptyPartsWarningView']['setContent'](cs(this['locale'],'AI_SUGGESTION_EMPTY_PART_WARNING'));}this['_children']['forEach'](_0x2f1c93=>_0x2f1c93['markAsDone']()),this['_actionsView']['updateVisibility'](this['hasNonEmptyParts']);}get['hasNonEmptyParts'](){return this['_children']['filter'](_0x3a0364=>_0x3a0364['partDefinition']['hasChanges'])['length']>0x0;}}class fn extends Nt{['bodyView'];['children'];['headerView'];constructor(_0x3b9d95,_0xac53c4,_0x318a9d){super(_0x3b9d95);const {showDiff:_0xb45d0d,areActionsDisabled:_0x3ba5a1,showUnchangedParts:_0x4b7245,availableActions:_0x504ce2}=_0xac53c4;this['set']('isTrackChangesOn',!0x1),this['set']('areChangesVisible',!0x1),this['children']=this['createCollection'](),this['headerView']=new an(_0x3b9d95,{'showDiff':_0xb45d0d}),this['headerView']['on']('toggleShowChanges',(_0x301b9b,_0x55e89d)=>{this['areChangesVisible']=_0x55e89d['isOn'],this['fire']('toggleSuggestionDisplayMode',{'showDiff':_0x55e89d['isOn']});}),this['children']['add'](this['headerView']),this['bodyView']=new wn(_0x3b9d95,{'areActionsDisabled':_0x3ba5a1,'showUnchangedParts':!!_0x4b7245,'availableActions':_0x504ce2,'bodyCollection':_0x318a9d}),this['bodyView']['delegate'](...js)['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'](_0x21de37){await this['bodyView']['updateContentParts'](_0x21de37);}['updateSources'](_0x334eef){this['bodyView']['updateSources'](_0x334eef);}['markAsDone'](){this['bodyView']['markAsDone'](),this['headerView']&&(this['headerView']['isShowChangesToggleVisible']=this['bodyView']['hasNonEmptyParts']);}}class Sn extends rn{['containerView'];constructor(_0xe7204,_0x3b6cd2,_0x42d13e){super(_0x3b6cd2),this['set']('isTrackChangesOn',!0x1),this['containerView']=new fn(_0xe7204,{'showDiff':_0x3b6cd2['showDiff'],'areActionsDisabled':_0x3b6cd2['areActionsDisabled'],'availableActions':_0x3b6cd2['availableActions']},_0x42d13e),this['containerView']['on']('toggleSuggestionDisplayMode',(_0x158b49,_0x5a3abc)=>{this['fire']('toggleSuggestionDisplayMode',{'replyId':this['options']['id'],'showDiff':_0x5a3abc['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',(_0x4111d9,{index:_0x32f049})=>{this['fire']('showChangeInText',{'replyId':this['options']['id'],'partIndex':_0x32f049});}),this['containerView']['on']('applySuggestion',(_0x4c7a4e,{index:_0x543cb5}={})=>{this['fire']('applySuggestion',{'replyId':this['options']['id'],'partIndex':_0x543cb5});}),this['containerView']['on']('insertSuggestion',(_0x20e87f,{index:_0x397b9e}={})=>{this['fire']('insertSuggestion',{'replyId':this['options']['id'],'partIndex':_0x397b9e});}),this['containerView']['on']('rejectSuggestion',(_0x48f48d,{index:_0x590288})=>{this['fire']('rejectSuggestion',{'replyId':this['options']['id'],'partIndex':_0x590288});}),this['containerView']['on']('mouseOverSuggestion',(_0x6f74a3,{index:_0x3b70d7})=>{this['fire']('mouseOverSuggestion',{'replyId':this['options']['id'],'partIndex':_0x3b70d7});}),this['containerView']['on']('mouseLeaveSuggestion',(_0x4e061,{index:_0x1cc8a2})=>{this['fire']('mouseLeaveSuggestion',{'replyId':this['options']['id'],'partIndex':_0x1cc8a2});}),this['children']['addMany']([this['containerView']]),this['extendTemplate']({'attributes':{'class':['ck-ai-chat__feed__ai-suggestion']}});}async['updateContent'](_0x5621cd){await this['containerView']['updateContent'](_0x5621cd);}['updatePartState'](_0x5e3f12,_0x24464c){this['containerView']['bodyView']['updatePartState'](_0x5e3f12,_0x24464c);}['setPartActive'](_0x3d2f91,_0x5da65b){!0x1===_0x3d2f91?this['containerView']['bodyView']['setPartActive'](!0x1):this['containerView']['bodyView']['setPartActive'](_0x3d2f91,_0x5da65b);}['updateSources'](_0x3c812a){this['containerView']['updateSources'](_0x3c812a);}['getPartView'](_0x2d82bf){return this['containerView']['bodyView']['getPartView'](_0x2d82bf);}['markAsDone'](){super['markAsDone'](),this['containerView']['markAsDone']();}}class bn extends rn{['replyContainer'];['_bodyCollection'];constructor(_0x2216dc,_0x390a31,_0x218f8a){super(_0x390a31),this['_bodyCollection']=_0x218f8a,this['locale']=_0x2216dc,this['extendTemplate']({'attributes':{'class':['ck-ai-chat__feed__ai-reply']}}),this['replyContainer']=new Nt(),this['replyContainer']['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset_all-excluded','ck-ai-chat__feed__ai-reply-container']}}),this['children']['add'](this['replyContainer']);}async['render'](){super['render'](),this['options']['initialContent']&&(await this['updateContent']({'parsedContent':As(this['options']['initialContent']),'renderingStrategy':'static'}),this['markAsDone']());}async['updateContent']({parsedContent:_0x2a15e0,renderingStrategy:_0x5d0a0c,abortSignal:_0x2285ee}){'streaming'===_0x5d0a0c?await this['streamIntoElement'](_0x2a15e0,this['replyContainer']['element'],_0x2285ee):this['replyContainer']['element']['innerHTML']=_0x345257(_0x2a15e0);}['updateSources'](_0x5740c9){const _0x502660=new mn(this['locale'],this['_bodyCollection']);_0x502660['children']['addMany'](_0x5740c9['map'](_0x2d4479=>new Cn(this['locale'],_0x2d4479,_0x502660['balloonPanelView']))),_0x502660['isVisible']=!0x0,this['children']['add'](_0x502660);}}class Rn extends vt{constructor(_0x16dda1=void 0x0){super();const _0xe85d48=_0x16dda1?'ck-ai-spinner_'+_0x16dda1:'';this['extendTemplate']({'tag':'span','attributes':{'class':['ck-ai-spinner',_0xe85d48]}});}}const On={'file':_0x5b9fd7,'document':_0x29737e,'web-resource':_0x32f27e,'text':_0x5b9fd7,'selection':_0x2d2ae4,'mcp-tool-context':_0x29737e},kn='ck-ai-chat-context-chip',Nn='ck-ai-chat-context-chip_wide',vn='ck-ai-chat-context-chip_document',yn='ck-ai-chat-context-chip__label',xn='ck-ai-chat-context-chip__type-icon',Ln='ck-ai-chat-context-controls__chip-tooltip',Dn='n';class Pn extends kt{constructor(_0x240928,_0x1110cf,_0xb933d9,_0x16a15f,_0x340131=!0x1){super(_0x240928),this['_isAnimationOnEnterEnabled']=_0x16a15f,this['_initializeProperties'](_0x1110cf,_0xb933d9,_0x340131),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'](_0x362587,_0x5ba110,_0x35e796){this['set']('label',_0x362587['label']),this['set']('tooltip',!0x0),this['set']('itemType',_0x362587['type']),this['set']('id',_0x362587['uiId']),this['set']('readonly',_0x5ba110),this['set']('isLoading',_0x35e796);}['_setupTemplate'](){const _0x2e332f=this['_createIconView'](),_0x200e27=this['_createRemoveButton'](),_0x20c3f1=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':this['_createTemplateAttributes'](_0x20c3f1),'children':this['_createTemplateChildren'](_0x2e332f,_0x200e27,_0x20c3f1)});}['_createTemplateAttributes'](_0x5cf9f9){return{'class':[kn,_0x5cf9f9['if']('itemType',vn,_0x322677=>'document'==_0x322677),_0x5cf9f9['if']('itemType',Nn,_0x461242=>'selection'==_0x461242)],'data-cke-tooltip-text':_0x5cf9f9['to']('label',Hn),'data-cke-tooltip-position':Dn,'data-cke-tooltip-class':Ln};}['_createTemplateChildren'](_0x36e42d,_0x13d57c,_0x1c5ce4){const _0x237b8a=this['_createLabelElement'](_0x1c5ce4),_0x4ec51e=this['_createLoaderIcon']();return this['readonly']?[_0x36e42d,_0x237b8a]:[_0x36e42d,_0x4ec51e,_0x237b8a,_0x13d57c];}['_createLabelElement'](_0x19c589){return{'tag':'span','attributes':{'class':yn},'children':[{'text':_0x19c589['to']('label')}]};}['_createRemoveButton'](){const _0x344397=new kt(this['locale']);return _0x344397['set']({'label':cs(this['locale'],'AI_CHAT_CONTEXT_REMOVE_FROM_CONTEXT'),'icon':_0x40d9e4}),this['_setupRemoveButtonEvent'](_0x344397),_0x344397;}['_setupRemoveButtonEvent'](_0x37eb98){_0x37eb98['on']('execute',()=>{this['fire']('removeContextItemChip',this['id']);});}['_createIconView'](){const _0x50440c=this['bindTemplate'],_0x202e30=new yt();return _0x202e30['content']=On[this['itemType']],_0x202e30['extendTemplate']({'attributes':{'class':[xn,_0x50440c['if']('isLoading','ck-hidden',_0x59fe96=>_0x59fe96)]}}),_0x202e30;}['_handleAnimationEndOnce'](_0x3af33a,_0x2ecbf4){if(!_0x3af33a)return;const _0x51dc5a=()=>{_0x2ecbf4(),_0x3af33a['removeEventListener']('animationend',_0x51dc5a),_0x3af33a['removeEventListener']('webkitAnimationEnd',_0x51dc5a);};_0x3af33a['addEventListener']('animationend',_0x51dc5a),_0x3af33a['addEventListener']('webkitAnimationEnd',_0x51dc5a);}['_createLoaderIcon'](){const _0x3292f0=new Rn('small');return _0x3292f0['bind']('isVisible')['to'](this,'isLoading',_0x1bbcc1=>_0x1bbcc1),_0x3292f0;}}function Hn(_0x4dc053){if(!_0x4dc053)return _0x4dc053;if(_0x4dc053['length']<=0x78)return _0x4dc053;const _0x40f64c=_0x4dc053['slice'](0x0,0x78),_0x25ddb7=_0x40f64c['lastIndexOf']('\x20');return(_0x25ddb7>0x0?_0x40f64c['slice'](0x0,_0x25ddb7):_0x40f64c)+'…';}const Mn={'maxVisibleRows':0x2,'rowDetectionTolerance':0x5,'showMoreLabelPrefix':'+\x20','viewportOffset':{'top':0x64,'bottom':0xa}},Un='300px';class Vn{['_locale'];['_config'];['_visibleChips'];['_overflowChips'];['_showMoreButtonView']=null;['_showMoreBalloonPanelView']=null;['_containerElement']=null;['_bodyCollection'];['_parentView']=null;['_intersectionObserver']=null;['_pendingCalculation']=!0x1;constructor(_0x51f277,_0x34473e,_0x16a0c3,_0x34f532,_0x5e664f){this['_locale']=_0x51f277,this['_visibleChips']=_0x34473e,this['_config']={...Mn,..._0x16a0c3,'cssClasses':{'controlsButton':'','calculationContainer':'ck-calculation-container',..._0x16a0c3['cssClasses']}},this['_overflowChips']=new dt(),this['_bodyCollection']=_0x34f532,this['_parentView']=_0x5e664f||null;}['setContainerElement'](_0x51530b){this['_intersectionObserver']&&(this['_intersectionObserver']['disconnect'](),this['_intersectionObserver']=null),this['_containerElement']=_0x51530b,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 _0x19bbcf=[...this['_visibleChips'],...this['_overflowChips']],_0x314f24=this['_createCalculationContainer'](),_0x35c765=this['_calculateOverflowInContainer'](_0x314f24,_0x19bbcf),_0x4aa252=_0x314f24['_ancestorsToRestore'];_0x4aa252&&this['_restoreAncestorVisibility'](_0x4aa252),_0x314f24['remove'](),this['_applyOverflowResults'](_0x19bbcf,_0x35c765);}['_createShowMoreButton'](){this['_showMoreButtonView']=this['_createShowMoreButtonView'](),this['_showMoreBalloonPanelView']=this['_createShowMoreBalloonPanelView'](),this['_showMoreButtonView']['render'](),this['_containerElement']['appendChild'](this['_showMoreButtonView']['element']),this['_showMoreButtonView']['on']('execute',()=>{this['_handleShowMoreButtonClick']();}),Xt({'emitter':this['_showMoreBalloonPanelView'],'contextElements':[this['_showMoreBalloonPanelView']['element'],this['_showMoreButtonView']['element']],'callback':()=>this['hideBalloonPanel'](),'activator':()=>this['_showMoreButtonView']['isOn']});}['_createShowMoreButtonView'](){const _0x309c3a=new kt(this['_locale']);_0x309c3a['set']({'label':'','withText':!0x0,'isToggleable':!0x0});const _0x27527b=[this['_config']['cssClasses']['showMoreButton']];return this['_config']['cssClasses']['controlsButton']&&_0x27527b['push'](this['_config']['cssClasses']['controlsButton']),_0x309c3a['extendTemplate']({'attributes':{'class':_0x27527b}}),_0x309c3a;}['_createShowMoreBalloonPanelView'](){const _0x260903=new Qt(this['_locale']);return _0x260903['extendTemplate']({'attributes':{'class':this['_config']['cssClasses']['showMoreBalloon']}}),this['_bodyCollection']['add'](_0x260903),_0x260903;}['_updateBalloonContent'](){if(this['_showMoreBalloonPanelView']&&(this['_showMoreBalloonPanelView']['content']['clear'](),this['_overflowChips']['length']>0x0)){this['_overflowChips']['forEach'](_0x39e543=>{_0x39e543['disableAnimationOnEnter']();});const _0x3f9620=new Nt(this['_locale']);_0x3f9620['setTemplate']({'tag':'div','attributes':{'class':this['_config']['cssClasses']['overflowContainer']},'children':this['_overflowChips']}),this['_showMoreBalloonPanelView']['content']['add'](_0x3f9620);}}['_handleShowMoreButtonClick'](){this['_showMoreButtonView']['isOn']?this['hideBalloonPanel']():this['showBalloonPanel']();}['_updateShowMoreButtonVisibility'](){const _0x221fe8=this['_overflowChips']['length']>0x0;this['_showMoreButtonView']?.['element']&&(this['_showMoreButtonView']['element']['style']['display']=_0x221fe8?'':'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'](_0x1ad117){const _0x247c2d=this['_containerElement']?.['tagName']['toLowerCase']()||'div',_0x1aa0b9=this['_containerElement']?.['classList'];if(_0x1aa0b9){const _0x323c3e=_0x1aa0b9[0x0]||'',_0x7aeed=_0x1ad117['querySelector']('.'+_0x323c3e),_0x1d3378=_0x1ad117['querySelector'](_0x247c2d);return _0x7aeed||_0x1d3378||_0x1ad117;}return _0x1ad117['querySelector'](_0x247c2d)||_0x1ad117;}['_calculateContainerWidth'](){const _0x31ba4b=this['_parentView']?.['element']||this['_containerElement'];if(!_0x31ba4b)return Un;const _0x470491=window['getComputedStyle'](_0x31ba4b)['width'];if('auto'===_0x470491||'0px'===_0x470491||!_0x470491){const _0x3ca9c2=_0x31ba4b['parentElement'];if(_0x3ca9c2){const _0x5d3466=window['getComputedStyle'](_0x3ca9c2);return'auto'!==_0x5d3466['width']?_0x5d3466['width']:Un;}return Un;}return _0x470491;}['_applyCalculationStyles'](_0x574a33,_0x3ee06d){this['_config']['cssClasses']['calculationContainer']&&_0x574a33['classList']['add'](this['_config']['cssClasses']['calculationContainer']),_0x574a33['style']['width']=_0x3ee06d,_0x574a33['style']['position']='absolute',_0x574a33['style']['top']='-9999px',_0x574a33['style']['left']='-9999px',_0x574a33['style']['opacity']='0',_0x574a33['style']['pointerEvents']='none',_0x574a33['style']['zIndex']='-1',_0x574a33['style']['visibility']='visible\x20!important',_0x574a33['style']['display']='block\x20!important',_0x574a33['style']['boxSizing']='border-box';}['_restoreAncestorVisibility'](_0x1557c8){_0x1557c8['forEach'](({element:_0x34f407,originalDisplay:_0x2615ff,originalVisibility:_0x2c058b})=>{_0x34f407['style']['display']=_0x2615ff,_0x34f407['style']['visibility']=_0x2c058b;});}['_makeAncestorsVisible'](_0x53da9d){const _0xc9a908=[];let _0x118d64=_0x53da9d;for(;_0x118d64&&_0x118d64!==document['body'];){const _0x3da411=window['getComputedStyle'](_0x118d64);'none'!==_0x3da411['display']&&'hidden'!==_0x3da411['visibility']||(_0xc9a908['push']({'element':_0x118d64,'originalDisplay':_0x118d64['style']['display'],'originalVisibility':_0x118d64['style']['visibility']}),_0x118d64['style']['display']='block',_0x118d64['style']['visibility']='visible'),_0x118d64=_0x118d64['parentElement'];}return _0xc9a908;}['_createContainerElements'](){let _0x19053b,_0x2d76ae;return this['_parentView']?.['element']?(_0x19053b=this['_parentView']['element']['cloneNode'](!0x0),_0x2d76ae=this['_findTargetContainer'](_0x19053b)):(_0x19053b=document['createElement']('div'),_0x2d76ae=_0x19053b),{'calculationContainer':_0x19053b,'targetContainer':_0x2d76ae};}['_createCalculationContainer'](){const {calculationContainer:_0x125eeb,targetContainer:_0x37c1b5}=this['_createContainerElements'](),_0x1c2e2b=this['_calculateContainerWidth']();this['_applyCalculationStyles'](_0x125eeb,_0x1c2e2b);const _0xe7988=this['_parentView']?.['element']||this['_containerElement'],_0x5110c8=_0xe7988?.['parentElement'];_0x5110c8?_0x5110c8['appendChild'](_0x125eeb):document['body']['appendChild'](_0x125eeb),_0x125eeb['_targetContainer']=_0x37c1b5;const _0x5dda5d=this['_makeAncestorsVisible'](_0x5110c8||null);return _0x125eeb['offsetWidth'],_0x125eeb['_ancestorsToRestore']=_0x5dda5d,_0x125eeb;}['_calculateOverflowInContainer'](_0x5ab97b,_0x296d4e){const _0xf5015e=_0x5ab97b['_targetContainer']||_0x5ab97b,_0x207cc5=[],{rowCount:_0x47e13d}=this['_renderChipsAndCountRows'](_0xf5015e,_0x296d4e);if(_0x47e13d<=this['_config']['maxVisibleRows'])return _0x207cc5;const _0x44503c=_0x296d4e['slice']();for(;_0x44503c['length']>0x0;){if(this['_testButtonFit'](_0x5ab97b,_0xf5015e,_0x44503c)){const _0x48f5e9=_0x296d4e['filter'](_0x10e494=>!_0x44503c['includes'](_0x10e494));_0x207cc5['push'](..._0x48f5e9);break;}if(!_0x44503c['pop']())break;}return _0x207cc5;}['_renderChipsAndCountRows'](_0x2c1957,_0xf3391){_0x2c1957['innerHTML']='',_0xf3391['forEach'](_0x4b9faf=>{if(_0x4b9faf['element']){const _0x419b5b=_0x4b9faf['element']['cloneNode'](!0x0);_0x2c1957['appendChild'](_0x419b5b);}}),_0x2c1957['offsetWidth'];const _0x322417=_0x2c1957['children'],_0x322284=[];return Array['from'](_0x322417)['forEach'](_0xe4d606=>{const _0xbf4c1c=_0xe4d606['getBoundingClientRect']()['top'];_0x322284['some'](_0x15af47=>Math['abs'](_0x15af47-_0xbf4c1c)<this['_config']['rowDetectionTolerance'])||_0x322284['push'](_0xbf4c1c);}),{'rowCount':_0x322284['length']};}['_createMockButton'](){const _0x480336=document['createElement']('button');return _0x480336['className']=this['_config']['cssClasses']['showMoreButton'],this['_config']['cssClasses']['controlsButton']&&_0x480336['classList']['add'](this['_config']['cssClasses']['controlsButton']),_0x480336['textContent']='+\x201',_0x480336;}['_testButtonFit'](_0x44794b,_0xad6cbf,_0x49988c){this['_renderChipsAndCountRows'](_0xad6cbf,_0x49988c);const _0x482f11=this['_createMockButton']();_0x44794b['appendChild'](_0x482f11),_0x44794b['offsetWidth'];const _0x5b22c2=[..._0xad6cbf['children'],_0x482f11],_0xf9ce43=[];_0x5b22c2['forEach'](_0x240dff=>{const _0x4f4315=_0x240dff['getBoundingClientRect']()['top'];_0xf9ce43['some'](_0x5a6ddb=>Math['abs'](_0x5a6ddb-_0x4f4315)<this['_config']['rowDetectionTolerance'])||_0xf9ce43['push'](_0x4f4315);});const _0x15d40d=_0xf9ce43['length'];return _0x482f11['remove'](),_0x15d40d<=this['_config']['maxVisibleRows'];}['_distributeChips'](_0x5201f9,_0x53049e){this['_visibleChips']['clear'](),this['_overflowChips']['clear'](),_0x5201f9['forEach'](_0x3702fa=>{_0x53049e['includes'](_0x3702fa)?this['_overflowChips']['add'](_0x3702fa):this['_visibleChips']['add'](_0x3702fa);});}['_updateOverflowUI'](_0x5af1cc){if(_0x5af1cc>0x0&&!this['_showMoreButtonView']&&this['_createShowMoreButton'](),_0x5af1cc>0x0&&this['_showMoreButtonView']){const _0x27b316=''+this['_config']['showMoreLabelPrefix']+(_0x5af1cc<0x63?_0x5af1cc:'99');this['_showMoreButtonView']['label']=_0x27b316;}this['_updateBalloonContent'](),this['_updateShowMoreButtonVisibility'](),this['_repinBalloonPanel']();}['_applyOverflowResults'](_0xb9df2c,_0x272d8a){this['_distributeChips'](_0xb9df2c,_0x272d8a),this['_updateOverflowUI'](_0x272d8a['length']);}['_setupVisibilityObserver'](){this['_containerElement']&&'undefined'!=typeof IntersectionObserver&&(this['_intersectionObserver']=new IntersectionObserver(_0x13b74e=>{_0x13b74e[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 _0x23767b=this['_containerElement']['getBoundingClientRect']();if(0x0===_0x23767b['width']||0x0===_0x23767b['height'])return!0x1;const _0x3cfde8=window['innerHeight']||document['documentElement']['clientHeight'],_0x41992b=window['innerWidth']||document['documentElement']['clientWidth'],_0x530fed=0xc8;return _0x23767b['bottom']>=-0xc8&&_0x23767b['top']<=_0x3cfde8+_0x530fed&&_0x23767b['right']>=-0xc8&&_0x23767b['left']<=_0x41992b+_0x530fed;}}const Bn='ck-ai-chat__feed__context-chips',Gn='ck-ai-chat-context-chips-wrapper',Fn='ck-ai-chat-context-chips-wrapper-balloon',Kn='ck-ai-chat-controls-button',Wn='ck-ai-chat-controls_context_show-more-button',Yn='ck-ai-chat-context-controls__show-more-balloon-panel';class $n extends Nt{['_contextChips']=this['createCollection']();['_overflowManager'];['_bodyCollection'];constructor(_0x52d62e,_0x1940b4,_0x3e9745){super(_0x52d62e),this['_bodyCollection']=_0x3e9745,this['_createContextChips'](_0x1940b4);const _0x5233ce={'cssClasses':{'showMoreButton':Wn+'\x20'+ds,'showMoreBalloon':Yn,'overflowContainer':Fn,'controlsButton':Kn}};this['_overflowManager']=new Vn(_0x52d62e,this['_contextChips'],_0x5233ce,this['_bodyCollection'],this),this['setTemplate']({'tag':'div','attributes':{'class':[Bn,'ck','ck-reset_all']},'children':[{'tag':'div','attributes':{'class':Gn},'children':this['_contextChips']}]});}['render'](){super['render']();const _0x25659c=this['element']['querySelector']('.'+Gn);_0x25659c&&(this['_overflowManager']['setContainerElement'](_0x25659c),this['_overflowManager']['reorganizeChips']());}['destroy'](){super['destroy'](),this['_overflowManager']['destroy']();}['_createContextChips'](_0x411bfe){for(const _0x32476b of _0x411bfe){const _0x2129eb=new Pn(this['locale'],_0x32476b,!0x0,!0x1);this['_contextChips']['add'](_0x2129eb);}}}class qn extends rn{['_contextChipsView']=null;['_locale'];['_bodyCollection'];['_messageContentView'];constructor(_0x302e59,_0x5892c8,_0x18c420){super(_0x5892c8),this['_locale']=_0x302e59,this['_bodyCollection']=_0x18c420,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 $n(this['_locale'],this['options']['contextItems']['filter'](_0x517c9b=>!_0x517c9b['hidden']),this['_bodyCollection']),this['_contextChipsView']['extendTemplate']({'attributes':{'class':'ck-ai-chat__feed__context-chips'}}),this['children']['add'](this['_contextChipsView']));}['_createMessageContentView'](){this['_messageContentView']=new Nt(this['_locale']),this['_messageContentView']['setTemplate']({'tag':'div','attributes':{'class':'ck-ai-chat__feed__message-content'}}),this['children']['add'](this['_messageContentView']);}['render'](){super['render'](),this['_messageContentView']['element']['innerHTML']=this['options']['initialContent'],this['markAsDone']();}}class Qn extends rn{['capabilities'];constructor(_0x3c979b,_0x756059){super(_0x756059);const {isWebSearchEnabled:_0x572767,isReasoningEnabled:_0xcbe66e}=_0x756059['capabilities'],_0x7566c2=[];let _0x4eb65e='';_0x572767&&_0xcbe66e?(_0x4eb65e=cs(_0x3c979b,'AI_CHAT_FEED_REPLY_ITEM_USED_WEB_SEARCH_REASONING'),_0x7566c2['push'](Xn(_0xbe0d02)),_0x7566c2['push'](Xn(_0x1bff55))):_0x572767?(_0x4eb65e=cs(_0x3c979b,'AI_CHAT_FEED_REPLY_ITEM_USED_WEB_SEARCH'),_0x7566c2['push'](Xn(_0xbe0d02))):_0xcbe66e&&(_0x4eb65e=cs(_0x3c979b,'AI_CHAT_FEED_REPLY_ITEM_USED_REASONING'),_0x7566c2['push'](Xn(_0x1bff55))),this['extendTemplate']({'attributes':{'class':['ck-ai-chat__feed__interaction-header',_0x4eb65e?'':'ck-hidden']}});const _0x31b5b8=new Nt();_0x31b5b8['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed__interaction-header__capabilities']},'children':[..._0x7566c2,{'tag':'span','attributes':{'class':['ck-ai-chat__feed__interaction-header__capabilities__text']},'children':[_0x4eb65e]}]}),this['children']['add'](_0x31b5b8),this['capabilities']=_0x756059['capabilities'];}}function Xn(_0x343297){const _0x8d6c11=new yt();return _0x8d6c11['content']=_0x343297,_0x8d6c11;}const zn=['wheel','touchstart','pointerdown','keydown'],jn=['ArrowUp','ArrowDown','PageUp','PageDown','Home','End','\x20'];class Jn{['element'];['animationFrameId'];['isRunning'];['abortController'];['isUserPaused'];constructor(_0x4b473f){this['element']=_0x4b473f,this['animationFrameId']=null,this['isRunning']=!0x1,this['abortController']=new AbortController(),this['isUserPaused']=!0x1;for(const _0x443808 of zn){const _0x3b8204='keydown'!==_0x443808;this['element']['addEventListener'](_0x443808,this['_onUserEvent']['bind'](this),{'passive':_0x3b8204,'signal':this['abortController']['signal']});}}['start'](){this['isRunning']||(this['isRunning']=!0x0,this['isUserPaused']=!0x1,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'](_0x41b81e){if(this['isRunning']){if('keydown'===_0x41b81e['type']){const _0x4e9b8a=_0x41b81e['key'];if(!jn['includes'](_0x4e9b8a))return;}_0x41b81e instanceof WheelEvent?_0x41b81e['deltaY']<0x0?this['isUserPaused']=!0x0:this['isUserPaused']=!this['_isAtBottom']():this['isUserPaused']=!0x0;}}['_isAtBottom'](){const {scrollTop:_0x2ee4a4,scrollHeight:_0x279e13,clientHeight:_0x5b6a6f}=this['element'];return _0x279e13-_0x2ee4a4-_0x5b6a6f<=0x5;}['_rafUpdate'](){this['isRunning']&&(this['isUserPaused']||this['element']['scrollTo']({'top':this['element']['scrollHeight'],'behavior':'auto'}),this['animationFrameId']=requestAnimationFrame(this['_rafUpdate']['bind'](this)));}}class Zn extends Nt{constructor(_0x1b2e35,_0x460e58){super(_0x1b2e35),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-skeleton']},'children':this['_createSkeletonItems'](_0x460e58)});}['_createSkeletonItems'](_0x5b48da){const _0x598ace=['ck','ck-ai-skeleton__item'];return _0x5b48da['map'](_0x5d7887=>{let _0x4d7d59='';switch(_0x5d7887['attributes']['align']){case'right':_0x4d7d59='margin-left:\x20auto;\x20margin-right:\x200;\x20text-align:\x20right;';break;case'center':_0x4d7d59='margin-left:\x20auto;\x20margin-right:\x20auto;\x20text-align:\x20center;';break;case'left':_0x4d7d59='margin-left:\x200;\x20margin-right:\x20auto;\x20text-align:\x20left;';}return{'tag':_0x5d7887['tag'],'attributes':{'class':[..._0x598ace,_0x5d7887['attributes']['class']?_0x5d7887['attributes']['class']:''],'style':'width:\x20'+_0x5d7887['attributes']['width']+';\x20height:\x20'+_0x5d7887['attributes']['height']+';'+_0x4d7d59}};});}}const tr={'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':er(0x5,'100%','44px','right'),'aiChatResources':er(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 er(_0x536cfd,_0x568cf0,_0x42266f,_0x4857f5){return new Array(_0x536cfd)['fill'](null)['map'](()=>({'tag':'div','attributes':{'width':_0x568cf0,'height':_0x42266f,'align':_0x4857f5}}));}class ir extends rn{constructor(_0x5d8878){super(_0x5d8878),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 sr extends Nt{['children'];['scrollManager'];['_bodyCollection'];constructor(_0x520ab8,_0x4f12f7){super(_0x520ab8),this['_bodyCollection']=_0x4f12f7,this['set']('isPending',!0x1),this['set']('loadingMessage',''),this['set']('isLoadingSkeletonVisible',!0x1),this['set']('isTrackChangesOn',!0x1),this['children']=this['createCollection'](),this['children']['delegate'](...Js)['to'](this),this['_setupTemplate']();}['render'](){super['render'](),this['scrollManager']=new Jn(this['element']);}['destroy'](){super['destroy'](),this['scrollManager']['destroy']();}['clear'](){this['children']['clear']();}['addItem'](_0x3b78dd,_0x10b72e){let _0x1cd588;return'ai-reply'===_0x3b78dd?_0x1cd588=new bn(this['locale'],_0x10b72e,this['_bodyCollection']):'ai-suggestion-reply'===_0x3b78dd?(_0x1cd588=new Sn(this['locale'],_0x10b72e,this['_bodyCollection']),_0x1cd588['bind']('isTrackChangesOn')['to'](this)):_0x1cd588='user-message'===_0x3b78dd?new qn(this['locale'],_0x10b72e,this['_bodyCollection']):'interaction-header'===_0x3b78dd?new Qn(this['locale'],_0x10b72e):'custom-element'===_0x3b78dd?new ir(_0x10b72e):new En(_0x10b72e),this['children']['add'](_0x1cd588),_0x1cd588;}async['updateReplyItem']({id:_0x480b17,parsedContent:_0x477511,renderingStrategy:_0x1909d2,abortSignal:_0xf4133a}){const _0x23199e=this['getItemById'](_0x480b17);if(!(_0x23199e instanceof bn))throw new ot('ai-chat-feed-view-item-not-a-reply-item',null,{'itemView':_0x23199e,'id':_0x480b17,'parsedContent':_0x477511});await _0x23199e['updateContent']({'parsedContent':_0x477511,'renderingStrategy':_0x1909d2,'abortSignal':_0xf4133a});}async['updateWebSources'](_0x8bfc3b,_0x3f260f){const _0x4aba7f=this['getItemById'](_0x8bfc3b);if(_0x4aba7f instanceof Sn)_0x4aba7f['updateSources'](_0x3f260f);else{if(!(_0x4aba7f instanceof bn))throw new ot('ai-chat-feed-view-item-not-a-suggestion-or-reply-item',null,{'itemView':_0x4aba7f,'id':_0x8bfc3b,'sources':_0x3f260f});_0x4aba7f['updateSources'](_0x3f260f);}}async['updateSuggestionItem']({id:_0x307993,parts:_0x3a3a2a,renderingStrategy:_0x20a372,abortSignal:_0x178aa9}){const _0x306541=this['getItemById'](_0x307993);if(!(_0x306541 instanceof Sn))throw new ot('ai-chat-feed-view-item-not-a-suggestion-item',null,{'itemView':_0x306541,'id':_0x307993,'parts':_0x3a3a2a});await _0x306541['updateContent']({'parts':_0x3a3a2a,'renderingStrategy':_0x20a372,'abortSignal':_0x178aa9});}['updateSuggestionPartState']({id:_0xc57501,index:_0x3ebe9c,state:_0x4c65e3}){const _0x2623b7=this['getItemById'](_0xc57501);if(!(_0x2623b7 instanceof Sn))throw new ot('ai-chat-feed-view-item-not-a-suggestion-item',this,{'id':_0xc57501});_0x2623b7['updatePartState'](_0x3ebe9c,_0x4c65e3);}['setSuggestionPartActive']({id:_0x1b4b90,index:_0xa0f62a,isActive:_0x38c98e}){const _0x45263d=this['getItemById'](_0x1b4b90);if(!(_0x45263d instanceof Sn))throw new ot('ai-chat-feed-view-item-not-a-suggestion-item',this,{'id':_0x1b4b90});this['children']['filter'](_0x57c587=>_0x57c587 instanceof Sn)['forEach'](_0xfe70a0=>{_0xfe70a0['setPartActive'](!0x1);}),_0x45263d['setPartActive'](_0xa0f62a,_0x38c98e);}['markItemAsDone'](_0x18183f){this['getItemById'](_0x18183f)['markAsDone']();}['getItemIds'](){return this['children']['map'](_0x5929e8=>_0x5929e8['options']['id']);}['removeItem'](_0x137141){this['children']['remove'](this['getItemById'](_0x137141));}['hasItem'](_0x3516ab){return!!this['children']['find'](_0x37ad89=>_0x37ad89['options']['id']['includes'](_0x3516ab));}['scrollToSuggestion'](_0x331ec5,_0x19a187){const _0x357273=this['getItemById'](_0x331ec5);if(!(_0x357273 instanceof Sn))return void pt('ck-ai-chat-feed-view-scroll-to-suggestion-invalid-item',{'replyId':_0x331ec5,'partIndex':_0x19a187});const _0x13b561=_0x357273['getPartView'](_0x19a187);_0x13b561?wt(_0x13b561['element'],0x14,this['element']['parentElement'],!0x0,!0x0):pt('ck-ai-chat-feed-view-scroll-to-suggestion-part-view-not-found',{'replyId':_0x331ec5,'partIndex':_0x19a187});}['_setupTemplate'](){this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed']},'children':this['_createTemplateChildren']()});}['_createTemplateChildren'](){const _0x99566b=this['_createSkeletonLoader']();return[this['_createFeedItems'](),_0x99566b,this['_createFeedLoader']()];}['_createSkeletonLoader'](){const _0x4db6e8=new Zn(this['locale'],tr['aiFeed']);return _0x4db6e8['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isLoadingSkeletonVisible','ck-hidden',_0x11a091=>!_0x11a091)]}}),_0x4db6e8;}['_createFeedItems'](){const _0x5d98d9=new Nt(this['locale']);return _0x5d98d9['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed__items',this['bindTemplate']['if']('isLoadingSkeletonVisible','ck-hidden')]},'children':this['children']}),_0x5d98d9;}['_createFeedLoader'](){const _0x3ece5e=new Nt(this['locale']);return _0x3ece5e['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__loader',this['bindTemplate']['if']('isPending','ck-hidden',_0xae5899=>!_0xae5899)]},'children':this['_createLoaderChildren']()}),_0x3ece5e;}['_createLoaderChildren'](){const _0x598a30=new Rn();return _0x598a30['isVisible']=!0x0,[_0x598a30,{'tag':'span','attributes':{'class':['ck','ck-ai-chat__loader-text']},'children':[{'text':this['bindTemplate']['to']('loadingMessage')}]}];}['getItemById'](_0xe91bf4){const _0x266cb1=this['children']['find'](_0x3cc48c=>_0x3cc48c['options']['id']['includes'](_0xe91bf4));if(!_0x266cb1)throw new ot('ai-chat-feed-view-item-not-found',this,{'id':_0xe91bf4});return _0x266cb1;}['setLoadingMessage'](_0x3066a7){this['set']('loadingMessage',_0x3066a7);}['toggleLoadingSkeleton'](_0x8c4a4c){this['set']('isLoadingSkeletonVisible',_0x8c4a4c);}['startAutoScroll'](){this['scrollManager']['start']();}['stopAutoScroll'](){this['scrollManager']['stop']();}}class nr extends Lt{['filter'](){let _0x1d9dfd=0x0;for(const _0xdbe307 of this['items'])_0x1d9dfd+=_0xdbe307['items']['length'];return{'resultsCount':_0x1d9dfd,'totalItemsCount':_0x1d9dfd};}}const rr='ck-ai-chat__prompt-input_highlighted';class ar extends xt{['submitButtonView'];static ['MIN_ROWS']=0x1;static ['MAX_ROWS']=0xc;['_addContextButtonView'];['_queryViewResizeObserver'];constructor(_0x43d9fc,_0xd1726b){super(_0x43d9fc,{'queryView':{'label':'','creator':Ut,'showIcon':!0x1,'showResetButton':!0x1},'filteredView':new nr(_0x43d9fc),'queryMinChars':0x1/0x0,'resetOnBlur':!0x1}),this['set']('isEmpty',!0x0),this['set']('isUploadInProgress',!0x1),this['_addContextButtonView']=_0xd1726b,this['_queryViewResizeObserver']=null,this['queryView']['fieldView']['minRows']=ar['MIN_ROWS'],this['queryView']['fieldView']['maxRows']=ar['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',(_0x5738c2,_0x1c05b1)=>!_0x5738c2&&!_0x1c05b1),this['focusableChildren']['add'](this['submitButtonView']);}['render'](){super['render'](),this['queryView']['fieldWrapperChildren']['add'](this['submitButtonView']),this['keystrokes']['set']('enter',(_0x1d33a5,_0x46e568)=>{this['isUploadInProgress']||this['isEmpty']||_0x1d33a5['target']==this['queryView']['fieldView']['element']&&(this['submit'](),_0x46e568());}),this['queryView']['fieldView']['on']('update',()=>{this['isEmpty']=''===this['queryView']['fieldView']['element']['value']?.['trim']();});}['destroy'](){super['destroy'](),this['_queryViewResizeObserver']&&this['_queryViewResizeObserver']['destroy']();}['submit'](){const _0x33612d=this['queryView']['fieldView']['element']['value']?.['trim']();if(!_0x33612d)return this['queryView']['errorText']=cs(this['locale'],'AI_CHAT_PROMPT_EMPTY_ERROR'),void(this['queryView']['fieldView']['hasError']=!0x0);this['queryView']['fieldView']['hasError']=!0x1;const _0x1253aa=_0x5b8af7(_0x33612d);this['fire']('sendUserMessage',_0x1253aa),this['queryView']['fieldView']['reset']();}['setPlaceholderText'](_0x4355f0){this['queryView']['fieldView']['set']('placeholder',_0x4355f0);}['focus'](_0x35065f=!0x1){super['focus'](),_0x35065f&&(this['element']['classList']['contains'](rr)||(this['element']['classList']['add'](rr),setTimeout(()=>{this['element']['classList']['remove'](rr);},0x320)));}['_createSubmitButton'](){const _0x3650df=new kt(this['locale']);return _0x3650df['set']({'icon':_0x56b34f,'label':cs(this['locale'],'AI_CHAT_LABEL_SUBMIT'),'isVisible':!0x0,'tooltip':!0x0,'class':'ck-ai-chat__prompt-submit-button\x20'+ls,'isEnabled':!0x1}),_0x3650df['on']('execute',()=>{this['submit']();}),_0x3650df;}['setIsUploadInProgress'](_0x191073){this['isUploadInProgress']=_0x191073;}['_setUpAddContextButtonPositioning'](){const _0x3efb34=this['locale'],_0x5bd271=()=>{ct['window']['requestAnimationFrame'](()=>{if(lt(this['element'])){const _0x576fcb=new ut(this['queryView']['fieldView']['element']),_0x586f21=new ut(this['_addContextButtonView']['element']),_0xee5e5a=_0x576fcb['width'],_0x20e4a1='rtl'===_0x3efb34['uiLanguageDirection']?'right':'left';_0x576fcb['excludeScrollbarsAndBorders']();const _0x419c11=_0xee5e5a-_0x576fcb['width']+0x1;this['_addContextButtonView']['element']['style'][_0x20e4a1]='calc('+(_0xee5e5a-_0x586f21['width']-_0x419c11)+'px\x20-\x20var(--ck-spacing-tiny))';}});};this['queryView']['fieldView']['on']('update',_0x5bd271),this['on']('render',()=>{_0x5bd271(),this['_queryViewResizeObserver']=new ft(this['queryView']['fieldView']['element'],()=>{_0x5bd271();});});}}const or='ck-ai-chat__prompt-capabilities',hr='ck-ai-chat-controls-button',cr='ck-ai-chat-controls-button--commands',lr='ck-ai-chat-controls__model-selection',ur='ck-ai-chat-controls__model-selection__item-name',dr='ck-ai-chat-controls__model-selection__item-description',_r='ck-ai-chat-controls__model-selection__item-capabilities',Ar='n';class gr extends Nt{['_webSearchButton'];['_reasoningButton'];['_commandsButton'];['_modelSelectionDropdown'];['_modelSelectionDropdownItems'];['_modelNameView'];constructor(_0x36c000){super(_0x36c000),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',_0x3d7a23=>'selector'===_0x3d7a23),this['_modelSelectionDropdown']['buttonView']['bind']('tooltip')['to'](this,'modelSelectorEnabled',_0xfbb2f9=>_0xfbb2f9?this['_modelSelectionDropdown']['buttonView']['label']:cs(this['locale'],'AI_CHAT_MODEL_SELECTOR_DISABLED_TOOLTIP')),this['_modelSelectionDropdown']['bind']('isEnabled')['to'](this,'modelSelectorEnabled',_0x54387d=>_0x54387d),this['_webSearchButton']['bind']('isOn')['to'](this,'webSearchActive',_0x104fdd=>_0x104fdd),this['_webSearchButton']['bind']('tooltip')['to'](this,'webSearchActive',_0x340f4a=>cs(this['locale'],_0x340f4a?'AI_CHAT_DISABLE_WEB_SEARCH':'AI_CHAT_ENABLE_WEB_SEARCH')),this['_reasoningButton']['bind']('isOn')['to'](this,'reasoningActive',_0x360f27=>_0x360f27),this['_reasoningButton']['bind']('tooltip')['to'](this,'reasoningActive',_0x3922da=>cs(this['locale'],_0x3922da?'AI_CHAT_DISABLE_REASONING':'AI_CHAT_ENABLE_REASONING')),this['setTemplate']({'tag':'div','attributes':{'class':[or]},'children':[this['_modelSelectionDropdown'],this['_modelNameView'],this['_webSearchButton'],this['_reasoningButton'],this['_commandsButton']]}),this['_modelSelectionDropdownItems']=new dt(),zt(this['_modelSelectionDropdown'],this['_modelSelectionDropdownItems']);}['setModelList'](_0x1240ec,_0x3f95e4){if(_0x3f95e4)this['set']('modelDisplayMode','hidden');else{const _0x52de8e=0x1===_0x1240ec['length'];this['set']('modelDisplayMode',_0x52de8e?'name':'selector');}if(this['_modelSelectionDropdownItems']['clear'](),_0x1240ec?.['length'])for(const _0x42c84b of _0x1240ec){const _0x17c129=new jt({'label':_0x42c84b['name'],'withText':!0x0,'role':'menuitemradio','id':_0x42c84b['id'],'model':_0x42c84b});_0x17c129['bind']('isOn')['to'](this,'activeModelId',_0x207822=>_0x207822===_0x42c84b['id']),this['_modelSelectionDropdownItems']['add']({'type':'button','model':_0x17c129,'labelView':new Ir(this['locale'],_0x42c84b)});}}['setWebSearch'](_0x2707ad){this['set']('webSearchActive',_0x2707ad);}['setReasoning'](_0x1bb680){this['set']('reasoningActive',_0x1bb680);}['setModel'](_0x2fc5f8){if(!_0x2fc5f8)return;this['activeModelId']=_0x2fc5f8['id'],this['activeModelName']=_0x2fc5f8['name']||_0x2fc5f8['id'],this['_modelSelectionDropdown']['buttonView']['set']('label',_0x2fc5f8['name']),this['_modelSelectionDropdown']['buttonView']['set']('tooltip',_0x2fc5f8['name']);const _0xd132e4=_0x2fc5f8['capabilities']['webSearch']?.['enabled']??!0x1;this['set']('webSearchActive',!0x1),this['_webSearchButton']['set']('isOn',!0x1),this['_webSearchButton']['set']('isEnabled',_0xd132e4),this['_webSearchButton']['set']('isVisible',_0xd132e4);const _0xd16543=_0x2fc5f8['capabilities']['reasoning']?.['enabled']??!0x1;this['set']('reasoningActive',!0x1),this['_reasoningButton']['set']('isOn',!0x1),this['_reasoningButton']['set']('isEnabled',_0xd16543),this['_reasoningButton']['set']('isVisible',_0xd16543);}['enableModelSelector'](){this['set']('modelSelectorEnabled',!0x0);}['disableModelSelector'](_0x15ede2){this['set']('modelSelectorEnabled',!0x1),_0x15ede2&&this['set']('modelDisplayMode','hidden');}['_createWebSearchButton'](){const _0x444ee9=new kt();return _0x444ee9['set']({'label':cs(this['locale'],'AI_CHAT_SEARCH_WEB'),'icon':_0xbe0d02,'class':hr+'\x20'+ds,'isToggleable':!0x0,'tooltipPosition':Ar}),_0x444ee9['on']('execute',()=>{this['fire']('toggleWebSearch');}),_0x444ee9;}['_createReasoningButton'](){const _0x57d395=new kt();return _0x57d395['set']({'label':cs(this['locale'],'AI_CHAT_REASONING'),'icon':_0x1bff55,'class':hr+'\x20'+ds,'isToggleable':!0x0,'tooltipPosition':Ar}),_0x57d395['on']('execute',()=>{this['fire']('toggleReasoning');}),_0x57d395;}['_createCommandsButton'](){const _0x159ef1=new kt();return _0x159ef1['set']({'label':cs(this['locale'],'AI_CHAT_COMMANDS'),'icon':_0x34d184,'withText':!0x0,'class':hr+'\x20'+ds,'isToggleable':!0x0,'tooltip':cs(this['locale'],'AI_CHAT_COMMANDS'),'tooltipPosition':Ar}),_0x159ef1['extendTemplate']({'attributes':{'class':[cr]}}),_0x159ef1['on']('execute',()=>{console['log']('Commands\x20are\x20not\x20implemented\x20yet.'),alert('Commands\x20are\x20not\x20implemented\x20yet.');}),_0x159ef1;}['_createModelSelectionDropdown'](){const _0x15979c=Bt(this['locale']);return _0x15979c['set']({'panelPosition':'ne','class':[lr]}),_0x15979c['buttonView']['set']({'label':cs(this['locale'],'AI_CHAT_MODEL_SELECTOR_ENABLED_TOOLTIP'),'withText':!0x0,'tooltip':!0x0,'tooltipPosition':Ar,'class':ds}),this['listenTo'](_0x15979c,'execute',_0x5c3079=>{this['fire']('selectModel',_0x5c3079['source']['model']);}),_0x15979c;}['_createModelNameView'](){const _0x572462=new Er(this['locale']);return _0x572462['bind']('text')['to'](this,'activeModelName',_0x25472a=>_0x25472a??''),_0x572462['bind']('isVisible')['to'](this,'modelDisplayMode',_0x380ec4=>'name'===_0x380ec4),_0x572462;}}let Ir=class extends Ht{constructor(_0x22e40f,_0x18c538){super();const _0x309b9d=this['bindTemplate'],_0x16f9bb=this['createCollection']();this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-button__label'],'style':_0x309b9d['to']('style'),'id':_0x309b9d['to']('id')},'children':[{'tag':'div','attributes':{'class':[ur]},'children':[{'text':_0x309b9d['to']('text')}]},{'tag':'div','attributes':{'class':[dr]},'children':[{'tag':'span','children':[{'text':_0x18c538['description']}]}]},{'tag':'div','attributes':{'class':[_r]},'children':_0x16f9bb}]}),_0x16f9bb['addMany'](this['_getCapabilityParts'](_0x22e40f,_0xbe0d02,'AI_CHAT_SEARCH_WEB',_0x18c538['capabilities']['webSearch']?.['enabled']??!0x1)),_0x16f9bb['addMany'](this['_getCapabilityParts'](_0x22e40f,_0x1bff55,'AI_CHAT_REASONING',_0x18c538['capabilities']['reasoning']?.['enabled']??!0x1));}['_getCapabilityParts'](_0x45895a,_0x24b371,_0x488e30,_0x5eb259){const _0x918d26=new yt();_0x918d26['content']=_0x24b371;const _0x2230e8=new Nt(_0x45895a);_0x2230e8['setTemplate']({'tag':'span','children':[{'text':cs(_0x45895a,_0x488e30)+':\x20'}]});const _0x5cfca0=new Nt(_0x45895a);return _0x5cfca0['setTemplate']({'tag':'span','children':[{'text':cs(_0x45895a,_0x5eb259?'AI_CHAT_CAPABILITIES_YES':'AI_CHAT_CAPABILITIES_NO')}]}),[_0x918d26,_0x2230e8,_0x5cfca0];}},Er=class extends Nt{constructor(_0x13fea8){super(_0x13fea8),this['set']('text',void 0x0),this['set']('isVisible',!0x0);const _0x17db69=this['bindTemplate'];this['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai-chat-controls__model-name',_0x17db69['if']('isVisible','ck-hidden',_0x31c8ed=>!_0x31c8ed)]},'children':[{'text':_0x17db69['to']('text')}]});}};const pr='ck-ai-chat-context-controls__url-form',Tr='ck-ai-chat-context-controls__url-input-section';class mr extends Nt{['focusTracker'];['keystrokes'];['_focusables'];['focusCycler'];['urlInputField'];['backButton'];['confirmButton'];constructor(_0x3ac2e3){super(_0x3ac2e3),this['focusTracker']=new _t(),this['keystrokes']=new At(),this['backButton']=this['_createBackButton'](),this['urlInputField']=this['_createUrlInputField'](),this['confirmButton']=this['_createConfirmButton'](),this['_focusables']=this['createCollection']([this['backButton'],this['urlInputField'],this['confirmButton']]),this['focusCycler']=new Mt({'focusables':this['_focusables'],'focusTracker':this['focusTracker'],'keystrokeHandler':this['keystrokes'],'actions':{'focusPrevious':'shift+tab','focusNext':'tab'}}),this['set']('withBackButton',!0x0),this['_setupTemplate'](),this['_setupEventHandlers'](),this['_setupKeystrokes']();}['render'](){super['render'](),this['_focusables']['forEach'](_0x5eabaf=>{this['focusTracker']['add'](_0x5eabaf['element']),this['keystrokes']['listenTo'](_0x5eabaf['element']);}),Jt({'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'](_0x57e106){this['urlInputField']['errorText']=_0x57e106,this['_updateConfirmButtonState'](),this['fire']('refreshBalloon');}['clearError'](){this['urlInputField']['errorText']=null,this['_updateConfirmButtonState']();}['_createBackButton'](){const _0x449833=new kt(this['locale']);return _0x449833['set']({'icon':_0x3edf4c,'tooltip':cs(this['locale'],'AI_CHAT_CONTEXT_URL_BACK_TO_CONTEXT'),'tooltipPosition':'n','class':['ck-button-icon\x20ck-button-back']}),this['on']('change:withBackButton',(_0x4d97b3,_0x12b849,_0x55a42d)=>{_0x449833['set']({'class':['ck-button-icon\x20ck-button-back'+(_0x55a42d?'':'\x20ck-hidden')]});}),_0x449833;}['_createUrlInputField'](){const _0x3b23ee=new Zt(this['locale'],te);return _0x3b23ee['set']({'label':cs(this['locale'],'AI_CHAT_CONTEXT_URL_LABEL'),'class':'ck-labeled-field-view_empty'}),_0x3b23ee['fieldView']['set']({'placeholder':cs(this['locale'],'AI_CHAT_CONTEXT_URL_PLACEHOLDER')}),_0x3b23ee;}['_createConfirmButton'](){const _0x76ad73=new kt(this['locale']);return _0x76ad73['set']({'icon':_0x177f85,'tooltip':cs(this['locale'],'AI_CHAT_CONTEXT_URL_ADD_URL'),'tooltipPosition':'n','class':'ck-button-icon','type':'submit','isEnabled':!0x1}),_0x76ad73;}['_setupTemplate'](){const _0x11f5f9=new _0x52d3ea(this['locale'],{'label':cs(this['locale'],'AI_CHAT_CONTEXT_URL_ADD_URL'),'class':'ck-ai-header\x20ck-ai-header_small\x20ck-ai-header_context-url'});_0x11f5f9['children']['add'](this['backButton'],0x0),this['setTemplate']({'tag':'form','attributes':{'class':pr,'tabindex':'-1'},'children':[_0x11f5f9,{'tag':'div','attributes':{'class':Tr},'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',_0x59b493=>{_0x59b493['stop'](),this['_handleSubmit']();});}['_setupKeystrokes'](){this['keystrokes']['set']('esc',(_0x34e367,_0x270eda)=>{this['clear'](),this['fire']('cancel'),_0x270eda();});}['_handleSubmit'](){const _0xb85d7a=this['getValue']()['trim']();_0xb85d7a?this['_isValidUrl'](_0xb85d7a)?(this['clearError'](),this['fire']('submitUrl',_0xb85d7a)):this['setError'](cs(this['locale'],'AI_CHAT_CONTEXT_URL_INVALID_ERROR')):this['setError'](cs(this['locale'],'AI_CHAT_CONTEXT_URL_EMPTY_ERROR'));}['_updateConfirmButtonState'](){const _0x17bbb2=this['getValue']()['trim'](),_0x6b65d1=!!this['urlInputField']['errorText'];this['confirmButton']['isEnabled']=_0x17bbb2['length']>0x0&&!_0x6b65d1;}['_isValidUrl'](_0xdae88f){try{return!!new URL(_0xdae88f);}catch{return!0x1;}}}const Cr='ck-ai-chat-resources__item',wr='ck-ai-chat-resources__item--in-context',fr='ck-ai-chat-resources__item-title',Sr='ck-ai-chat-resources__item__icon';class br extends Pt{['resource'];['_titleView'];['_iconView'];constructor(_0x44313b,_0x778260){super(_0x44313b),this['resource']=_0x778260,this['set']('isInContext',!!_0x778260['isInContext']),this['_titleView']=this['_createTitleView'](),this['_iconView']=this['_createIconView'](),this['_setupTemplate']();}['render'](){super['render']();}['getResourceIcon'](_0x108eb1){if(_0x108eb1['isInContext'])return _0x177f85;switch(_0x108eb1['type']){case'document':return _0x29737e;case'web-resource':return _0x32f27e;case'file':case'text':return _0x5b9fd7;default:return _0x5952ea;}}['highlightText'](_0x57c3f0){if(!_0x57c3f0||''===_0x57c3f0['trim']())return void this['_titleView']['highlightText'](null);const _0x4437d4=new RegExp(_0x29a81f(_0x57c3f0),'gi');this['_titleView']['highlightText'](_0x4437d4);}['updateResourceState'](_0x2f1e86){this['resource']['isInContext']=_0x2f1e86,this['isInContext']=_0x2f1e86,this['_updateIcon']();}['_createTitleView'](){const _0x235104=new _0x16beb0();return _0x235104['text']=this['resource']['label'],_0x235104['extendTemplate']({'tag':'span','attributes':{'class':[fr]}}),_0x235104;}['_createIconView'](){const _0xaa8a72=new yt();return _0xaa8a72['content']=this['getResourceIcon'](this['resource']),_0xaa8a72;}['_setupTemplate'](){const _0x1fe49b=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':[Cr,_0x1fe49b['if']('isVisible','ck-hidden',_0x55eb12=>!_0x55eb12),_0x1fe49b['if']('isInContext',wr)]},'children':[{'tag':'div','attributes':{'class':[Sr]},'children':[this['_iconView']]},this['_titleView']],'on':{'click':_0x1fe49b['to']('execute')}});}['_updateIcon'](){this['_iconView']['content']=this['getResourceIcon'](this['resource']);}}const Rr='ck-ai-chat-resources__list';class Or extends Lt{['_source'];constructor(_0x2d048f,_0x28c624){super(_0x2d048f),this['_source']=_0x28c624,this['extendTemplate']({'attributes':{'class':[Rr]}});}['setResources'](_0x78481a,_0x28607d){this['items']['clear']();let _0x2c2162=_0x78481a;if(this['_source']['useDefaultFiltering']&&_0x28607d&&''!==_0x28607d['trim']()){const _0x8ace10=new RegExp(_0x28607d['replace'](/[.*+?^${}()|[\]\\]/g,'\x5c$&'),'gi');_0x2c2162=_0x78481a['filter'](_0x59d205=>_0x8ace10['test'](_0x59d205['label']));}for(const _0x187db1 of _0x2c2162){const _0x4cad8f=new br(this['locale'],_0x187db1);_0x4cad8f['on']('execute',()=>{this['_handleResourceSelection'](this['_source'],_0x187db1);}),this['items']['add'](_0x4cad8f);}this['_source']['useDefaultFiltering']&&this['highlightText'](_0x28607d);}['highlightText'](_0x326833){this['_source']['useDefaultFiltering']&&this['items']['forEach'](_0x1ef590=>{_0x1ef590['highlightText'](_0x326833);});}['updateResourceState'](_0xc97b44,_0x28f58e){for(const _0x4e50d6 of this['items']){const _0x44762b=_0x4e50d6;_0x44762b['resource']['id']===_0xc97b44&&_0x44762b['updateResourceState'](_0x28f58e);}}['_handleResourceSelection'](_0x460cfd,_0x2a9251){this['fire']('addResourceToContext',{'source':_0x460cfd,'resource':_0x2a9251});}}class kr extends Zt{['iconView'];['resetButtonView'];['_viewConfig'];constructor(_0x19be52){const t=_0x19be52['t'],_0x2d4242={'showResetButton':!0x0,'showIcon':!0x0,'creator':te,'label':cs(_0x19be52,'AI_CHAT_SEARCH_RESOURCES')};super(_0x19be52,_0x2d4242['creator']),this['label']=_0x2d4242['label'],this['_viewConfig']=_0x2d4242,this['_viewConfig']['showIcon']&&this['_setupSearchIcon'](),this['_viewConfig']['showResetButton']&&this['_setupResetButton'](_0x19be52,t),this['_setupEventListeners']();}['reset'](){this['fieldView']['reset'](),this['_viewConfig']['showResetButton']&&this['resetButtonView']&&(this['resetButtonView']['isVisible']=!0x1),this['search']('');}['search'](_0x4909cc){this['fire']('search',_0x4909cc);}['getQuery'](){return this['fieldView']['element']?.['value']||'';}['_setupSearchIcon'](){this['iconView']=new yt(),this['iconView']['content']=_0x44e30b,this['fieldWrapperChildren']['add'](this['iconView'],0x0),this['extendTemplate']({'attributes':{'class':'ck-search__query_with-icon'}});}['_setupResetButton'](_0x36b168,t){this['resetButtonView']=new kt(_0x36b168),this['resetButtonView']['set']({'label':t('Clear'),'icon':_0x40d9e4,'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',_0x533420=>!_0x533420),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 Nr extends Nt{['_searchView'];['_searchSection'];['_searchInputVisibleFrom'];['_resourcesListView'];['_skeletonLoader'];['_source'];['children'];['_latestLoadResourcesUid']=null;constructor(_0x40cb05,_0x477835){super(_0x40cb05),this['_source']=_0x477835['source'],this['_searchInputVisibleFrom']=_0x477835['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 _0x24b273([this['_skeletonLoader'],this['_resourcesListView']]),this['setTemplate']({'tag':'div','attributes':{'class':'ck-ai-chat-resources'},'children':this['children']});}['_createSearchView'](){return new kr(this['locale']);}['_createSearchSection'](){const _0x2cc453=new Nt(this['locale']);return _0x2cc453['setTemplate']({'tag':'div','attributes':{'class':'ck\x20ck-search'},'children':[this['_searchView']]}),this['_searchView']['on']('search',(_0x4ea8fa,_0x39c6ff)=>{this['loadResources'](_0x39c6ff),this['_source']['useDefaultFiltering']&&this['_resourcesListView']['highlightText'](_0x39c6ff);}),_0x2cc453;}['_createResourcesListView'](){const _0x567a04=new Or(this['locale'],this['_source']);return _0x567a04['delegate']('addResourceToContext')['to'](this),_0x567a04['extendTemplate']({'attributes':{'class':this['bindTemplate']['if']('isLoading','ck-hidden')}}),_0x567a04;}['_createSkeletonView'](){const _0x5be19e=new Zn(this['locale'],tr['aiChatResources']);return _0x5be19e['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isLoading','ck-hidden',_0x3b49f3=>!_0x3b49f3)]}}),_0x5be19e;}['render'](){super['render'](),this['loadResources']('');}['loadResources'](_0x211e77){const _0x16d751=at();this['_latestLoadResourcesUid']=_0x16d751,this['fire']('loadSourceResources',{'sourceId':this['_source']['id'],'query':_0x211e77,'uid':_0x16d751}),this['isLoading']=!0x0;}['setResources'](_0x54b4b8,_0x3594f1){if(_0x3594f1&&_0x3594f1!==this['_latestLoadResourcesUid'])return;const _0x187e3b=this['_source']['useDefaultFiltering']?this['_searchView']['getQuery']():'';this['_resourcesListView']['setResources'](_0x54b4b8,_0x187e3b),_0x54b4b8['length']>=this['_searchInputVisibleFrom']&&!this['children']['has'](this['_searchSection'])&&this['children']['add'](this['_searchSection'],0x0),requestAnimationFrame(()=>{this['isLoading']=!0x1;});}['updateResourceState'](_0x25025c,_0x2a6790){this['_resourcesListView']['updateResourceState'](_0x25025c,_0x2a6790);}}const vr='ck-ai-chat-context-controls__source-balloon-panel',yr='ck-button-icon\x20ck-button-back',xr='ck-ai-header\x20ck-ai-header_small\x20ck-ai-header_source';class Lr{['_sourceResourceBalloons']=new Map();['_bodyCollection'];['_locale'];['_config'];constructor(_0x8e6e2,_0x17f083,_0x354508){this['_locale']=_0x8e6e2,this['_bodyCollection']=_0x17f083,this['_config']=_0x354508;}['showSourceResourcesBalloon']({source:_0x10dec6,withBackButton:_0x2aee3e}){let _0x50d4a1=this['_sourceResourceBalloons']['get'](_0x10dec6['id']);_0x50d4a1||(_0x50d4a1=this['_createSourceResourceBalloonPanel'](),this['_sourceResourceBalloons']['set'](_0x10dec6['id'],_0x50d4a1),this['_setupSingleResourceBalloonClickOutsideHandler'](_0x50d4a1)),this['_addSourceResourceContent']({'balloonPanel':_0x50d4a1,'source':_0x10dec6,'withBackButton':_0x2aee3e}),_0x50d4a1['show']();const _0x2c1d6a=this['_config']['getTargetElement']();_0x2c1d6a&&_0x50d4a1['pin']({'target':_0x2c1d6a,'limiter':this['_config']['getLimiterElement']()});}['populateSourceResourceBalloon'](_0x1103ba,_0x36c217,_0x26db93){const _0x57e2f7=this['_sourceResourceBalloons']['get'](_0x1103ba);if(!_0x57e2f7)return;const _0x4c115f=this['_getResourcesViewFromBalloon'](_0x57e2f7);_0x4c115f&&(_0x4c115f['setResources'](_0x36c217,_0x26db93),_0x4c115f['once']('change:isLoading',()=>{_0x57e2f7['pin']({'target':this['_config']['getTargetElement'](),'limiter':this['_config']['getLimiterElement']()});}));}['closeSourceResourceBalloon'](_0x4f4ef3){const _0x29bbd7=this['_sourceResourceBalloons']['get'](_0x4f4ef3);_0x29bbd7&&requestAnimationFrame(()=>{_0x29bbd7['hide'](),this['_sourceResourceBalloons']['delete'](_0x4f4ef3),this['_config']['onBalloonClosed']();});}['isAnyResourceBalloonVisible'](){for(const _0x454493 of this['_sourceResourceBalloons']['values']())if(_0x454493['isVisible'])return!0x0;return!0x1;}['updateResourceState'](_0x216d58,_0x17c3a0,_0x1bc6b2){const _0x5cb89b=this['_sourceResourceBalloons']['get'](_0x216d58);if(!_0x5cb89b||!_0x5cb89b['isVisible'])return;const _0x247d5d=this['_config']['getTargetElement']();if(!_0x247d5d)return;_0x5cb89b['pin']({'target':_0x247d5d,'limiter':this['_config']['getLimiterElement']()});const _0x165b93=this['_getResourcesViewFromBalloon'](_0x5cb89b);_0x165b93&&_0x165b93['updateResourceState'](_0x17c3a0,_0x1bc6b2);}['destroy'](){for(const _0x4198a9 of this['_sourceResourceBalloons']['values']())_0x4198a9['destroy']();this['_sourceResourceBalloons']['clear']();}['_createSourceResourceBalloonPanel'](){const _0x458d67=new Qt(this['_locale']);return _0x458d67['extendTemplate']({'attributes':{'class':vr}}),this['_bodyCollection']['add'](_0x458d67),_0x458d67;}['_addSourceResourceContent']({balloonPanel:_0x43dd74,source:_0x31f99d,withBackButton:_0x13891b}){_0x43dd74['content']['clear']();const _0x22cfa2=this['_createBalloonHeader']({'balloonPanel':_0x43dd74,'source':_0x31f99d,'withBackButton':_0x13891b});_0x43dd74['content']['add'](_0x22cfa2);const _0x4357be=this['_createBalloonResourcesView'](_0x31f99d);_0x43dd74['content']['add'](_0x4357be);}['_createBalloonHeader']({balloonPanel:_0x3b7e24,source:_0x1ca2a4,withBackButton:_0x52d8b1}){const _0x531393=new _0x52d3ea(this['_locale'],{'label':_0x1ca2a4['label'],'class':xr});return _0x52d8b1&&_0x531393['children']['add'](this['_createBackButton'](_0x3b7e24),0x0),_0x531393;}['_createBackButton'](_0x291a22){const _0x5e77bd=new kt(this['_locale']);return _0x5e77bd['set']({'icon':_0x3edf4c,'tooltip':cs(this['_locale'],'AI_CHAT_CONTEXT_URL_BACK_TO_CONTEXT'),'tooltipPosition':'n','class':yr}),_0x5e77bd['on']('execute',()=>{_0x291a22['hide'](),this['_config']['onBackToContext']();}),_0x5e77bd;}['_createBalloonResourcesView'](_0x2d534e){const _0x56de81=new Nr(this['_locale'],{'source':_0x2d534e,'searchInputVisibleFrom':this['_config']['searchInputVisibleFrom']});return _0x56de81['on']('loadSourceResources',(_0x4198a5,_0x1dbc9c)=>{this['_config']['onLoadSourceResources'](_0x1dbc9c);}),_0x56de81['on']('addResourceToContext',(_0x4e4528,_0x8b4c4d)=>{this['_config']['onResourceSelected'](_0x8b4c4d['source'],_0x8b4c4d['resource']),this['closeSourceResourceBalloon'](_0x2d534e['id']);}),_0x56de81;}['_getResourcesViewFromBalloon'](_0x1c7172){const _0x4bf82f=_0x1c7172['content']['get'](0x1);return _0x4bf82f instanceof Nr?_0x4bf82f:null;}['_setupSingleResourceBalloonClickOutsideHandler'](_0xbfbc59){Xt({'emitter':_0xbfbc59,'contextElements':[_0xbfbc59['element']],'callback':()=>{_0xbfbc59['hide'](),this['_config']['onBalloonClosed']();},'activator':()=>_0xbfbc59['isVisible']});}}const Dr=['addDocumentToContext','addFileToContext','addUrlToContext','addResourceToContext','removeContextItem','loadSourceResources','executeCustomItemCallback'],Pr='ck-ai-chat-context-controls',Hr='ck-ai-chat-context-controls__pending-contexts',Mr='ck-ai-chat-context-controls__add-context-balloon-panel',Ur='ck-ai-chat-context-controls__add-context-button',Vr='ck-ai-chat-context-controls__url-balloon-panel',Br='ck-ai-chat-context-controls__balloon-button',Gr='ck-ai-chat-context-controls__balloon-button-source',Fr='ck-ai-chat-controls-button',Kr='ck-ai-chat-context-chips-wrapper-balloon',Wr='ck-ai-chat-controls_context_show-more-button',Yr='ck-ai-chat-context-controls__show-more-balloon-panel',$r='ck-ai-chat',qr=[Qt['defaultPositions']['northArrowSouthWest'],Qt['defaultPositions']['northArrowSouth'],Qt['defaultPositions']['northArrowSouthEast'],Qt['defaultPositions']['southArrowNorthWest'],Qt['defaultPositions']['southArrowNorth'],Qt['defaultPositions']['southArrowNorthEast']];class Qr extends Nt{['addContextButtonView'];['_currentContextsChips']=this['createCollection']();['_conversationContextsChips']=this['createCollection']();['_overflowManager'];['_addContextBalloonPanelView'];['_urlBalloonPanelView'];['_urlInputView'];['_resourcesBalloonView'];['_addContextBalloonConfig'];['_hasExactlyOneSource']=!0x1;['bodyCollection'];constructor(_0x1004f7,_0x26e664){super(_0x1004f7),this['bodyCollection']=_0x26e664['bodyCollection'],this['_currentContextsChips']=this['createCollection'](),this['_conversationContextsChips']=this['createCollection'](),this['addContextButtonView']=this['_createAddContextButtonView'](_0x1004f7),this['_addContextBalloonPanelView']=this['_createAddContextBalloonPanelView'](_0x1004f7),this['_urlBalloonPanelView']=this['_createUrlBalloonPanelView'](_0x1004f7),this['_resourcesBalloonView']=this['_createResourcesBalloonView'](_0x1004f7,_0x26e664);const _0x49d598={'cssClasses':{'showMoreButton':Wr+'\x20'+ds,'showMoreBalloon':Yr,'overflowContainer':Kr,'controlsButton':Fr}};this['_overflowManager']=new Vn(_0x1004f7,this['_currentContextsChips'],_0x49d598,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'](_0xed407c,_0x862612){const _0x18eee9=this['_createContextButton'](_0xed407c,'current',!0x0,_0x862612);this['_addContextToCollection'](_0x18eee9,this['_currentContextsChips']),this['_overflowManager']['reorganizeChips']();}['removeContextItem'](_0x1ab2a6){this['_removeContextFromCollection'](_0x1ab2a6,this['_currentContextsChips']),this['_removeContextFromCollection'](_0x1ab2a6,this['_overflowManager']['overflowChips']),this['_overflowManager']['reorganizeChips']();}['setContextItemLoading'](_0xfd521c,_0x4ba7d4){let _0x53363a=this['_currentContextsChips']['find'](_0x45c6c=>_0x45c6c['id']===_0xfd521c);_0x53363a||(_0x53363a=this['_overflowManager']['overflowChips']['find'](_0x39f234=>_0x39f234['id']===_0xfd521c)),_0x53363a&&(_0x53363a['isLoading']=_0x4ba7d4);}['setConversationContext'](_0x4255c6){this['_conversationContextsChips']['clear']();for(const _0xa31e of _0x4255c6){const _0x4bdf28=this['_createContextButton'](_0xa31e,'conversation',!0x1,!0x1);this['_addContextToCollection'](_0x4bdf28,this['_conversationContextsChips']);}}['clearCurrentContextItems'](){this['_currentContextsChips']['clear'](),this['_overflowManager']['clear']();}['clearConversationContextItems'](){this['_conversationContextsChips']['clear']();}['updateResourceState'](_0x142186,_0xfaf55,_0xea66f6){this['_resourcesBalloonView']['updateResourceState'](_0x142186,_0xfaf55,_0xea66f6);}['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:_0x55de56,withBackButton:_0x4ed585}){this['_resourcesBalloonView']['showSourceResourcesBalloon']({'source':_0x55de56,'withBackButton':_0x4ed585}),this['addContextButtonView']['isOn']=!0x0;}['populateSourceResourceBalloon'](_0x17db89,_0x2ad539,_0x16a1fe,_0x20a9cc){this['_resourcesBalloonView']['populateSourceResourceBalloon'](_0x17db89,_0x16a1fe,_0x20a9cc);}['closeSourceResourceBalloon'](_0xfcceb5){this['_resourcesBalloonView']['closeSourceResourceBalloon'](_0xfcceb5),this['addContextButtonView']['isOn']=!0x1;}['setAddContextOptions'](_0x2c4cb7){this['_setBalloonPanelContent'](this['_addContextBalloonPanelView'],this['locale'],_0x2c4cb7),this['_setAddContextButtonEnabled'](_0x2c4cb7);}['_setAddContextButtonEnabled'](_0x4e076f){const _0x30e069=!_0x4e076f['document']['isHidden']&&_0x4e076f['document']['enabled'],_0x8adb5d=_0x4e076f['urls']['enabled'],_0x45d185=_0x4e076f['files']['enabled'],_0x2097f5=_0x4e076f['sources']['length']>0x0,_0x5c7e44=_0x4e076f['customItems']&&_0x4e076f['customItems']['length']>0x0;this['addContextButtonView']['isEnabled']=_0x30e069||_0x8adb5d||_0x45d185||_0x2097f5||_0x5c7e44;}['_setupTemplate'](){this['setTemplate']({'tag':'div','attributes':{'class':[Pr,'ck-reset_all-excluded']},'children':[{'tag':'div','attributes':{'class':Hr},'children':this['_currentContextsChips']}]});}['_bindEventHandlers'](){this['addContextButtonView']['on']('execute',()=>{this['_handleAddContextButtonClick']();});}['_createAddContextButtonView'](_0x200f07){const _0x116fe3=new kt(_0x200f07);return _0x116fe3['set']({'label':cs(_0x200f07,'AI_CHAT_CONTEXT_ADD_CONTEXT'),'class':Fr+'\x20'+Ur+'\x20'+ds,'icon':_0x1da30d,'isToggleable':!0x0,'tooltip':!0x0,'tooltipPosition':'sw'}),_0x116fe3;}['_createAddContextBalloonPanelView'](_0x2ba794){return this['_createBaseBalloonPanel'](_0x2ba794,Mr);}['_createUrlBalloonPanelView'](_0xd5db16){const _0x1c3718=this['_createBaseBalloonPanel'](_0xd5db16,Vr);return this['_addUrlContent'](_0x1c3718,_0xd5db16),_0x1c3718;}['_createResourcesBalloonView'](_0x47b6d3,_0x3e01ce){const _0x490e05={'searchInputVisibleFrom':_0x3e01ce['searchInputVisibleFrom'],'onBackToContext':()=>{this['showAddContextBalloonPanel'](),this['_addContextBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':qr});},'onResourceSelected':(_0x528e16,_0x3db431)=>{this['fire']('addResourceToContext',{'source':_0x528e16,'resource':_0x3db431});},'onLoadSourceResources':_0x5e3dff=>{this['fire']('loadSourceResources',_0x5e3dff);},'onBalloonClosed':()=>{this['addContextButtonView']['isOn']=!0x1;},'getLimiterElement':()=>this['_getLimiterElement'](),'getTargetElement':()=>this['addContextButtonView']['element']};return new Lr(_0x47b6d3,_0x3e01ce['bodyCollection'],_0x490e05);}['_getLimiterElement'](){return this['element']?.['closest']('.'+$r)||document['body'];}['_createBaseBalloonPanel'](_0x55cc46,_0x4c22c5){const _0xb973f3=new Qt(_0x55cc46);return _0xb973f3['extendTemplate']({'attributes':{'class':_0x4c22c5}}),this['bodyCollection']['add'](_0xb973f3),_0xb973f3;}['_setBalloonPanelContent'](_0x1f8552,_0x15c0bf,_0x3f927d){if(_0x1f8552['content']['clear'](),!_0x3f927d['document']['isHidden']&&_0x3f927d['document']['enabled']){const _0x1b0384=this['_createBalloonButton'](_0x15c0bf,{'label':cs(_0x15c0bf,'AI_CHAT_CONTEXT_CURRENT_DOCUMENT'),'icon':_0x29737e});_0x1b0384['on']('execute',()=>{this['fire']('addDocumentToContext'),this['hideAddContextBalloonPanel']();}),_0x1f8552['content']['add'](_0x1b0384);}if(_0x3f927d['urls']['enabled']){const _0x3f42f8=this['_createBalloonButton'](_0x15c0bf,{'label':cs(_0x15c0bf,'AI_CHAT_CONTEXT_URL_LABEL'),'icon':_0x32f27e});_0x3f42f8['on']('execute',()=>{this['hideAddContextBalloonPanel'](),this['showUrlBalloonPanel'](),this['_urlBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':qr}),this['_urlInputView']['focus']();}),_0x1f8552['content']['add'](_0x3f42f8);}if(_0x3f927d['files']['enabled']){const _0x2c0a21=new _0x44b73a(_0x15c0bf);_0x2c0a21['set']({'label':cs(_0x15c0bf,'AI_CHAT_CONTEXT_FILE_LABEL'),'icon':_0x105c99,'withText':!0x0,'tooltip':!0x0,'class':Br,'allowMultipleFiles':!0x0}),_0x2c0a21['on']('execute',()=>{this['hideAddContextBalloonPanel']();}),_0x2c0a21['on']('done',(_0x1e4120,_0x222f46)=>{this['fire']('addFileToContext',_0x222f46);}),_0x2c0a21['tooltip']=!0x0,_0x1f8552['content']['add'](_0x2c0a21);}for(const _0xf83509 of _0x3f927d['sources']){const _0x9a75bd=this['_createBalloonButton'](_0x15c0bf,{'label':_0xf83509['label'],'icon':_0xf83509['icon']||_0x5952ea,'type':'source'});_0x1f8552['content']['add'](_0x9a75bd),_0x9a75bd['on']('execute',()=>{this['hideAddContextBalloonPanel'](),this['_showSourceResourcesBalloon']({'source':_0xf83509,'withBackButton':!this['_hasExactlyOneSource']});});}for(const _0x3f35dd of _0x3f927d['customItems']||[]){const _0x4de4bd=this['_createBalloonButton'](_0x15c0bf,{'label':_0x3f35dd['label'],'icon':_0x3f35dd['icon']||_0x5952ea,'type':'customItem'});_0x1f8552['content']['add'](_0x4de4bd),_0x4de4bd['on']('execute',()=>{this['hideAddContextBalloonPanel'](),this['fire']('executeCustomItemCallback',_0x3f35dd);});}this['_hasExactlyOneSource']=0x1===_0x1f8552['content']['length'],this['_urlInputView']['withBackButton']=!this['_hasExactlyOneSource'];}['_addUrlContent'](_0x44e7d3,_0x32bdaf){this['_urlInputView']=new mr(_0x32bdaf),this['_urlInputView']['on']('submitUrl',(_0x160475,_0x70d3cc)=>{this['_handleUrlSubmit'](_0x70d3cc);}),this['_urlInputView']['on']('cancel',()=>{this['hideUrlBalloonPanel'](),this['_hasExactlyOneSource']||(this['showAddContextBalloonPanel'](),this['_addContextBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':qr}));}),this['_urlInputView']['on']('refreshBalloon',()=>{this['_urlBalloonPanelView']['isVisible']&&this['_urlBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':qr});}),_0x44e7d3['content']['add'](this['_urlInputView']);}['_createBalloonButton'](_0x4e308a,_0x129fa6){const _0x31e1c4='source'===_0x129fa6['type']?new Xr(_0x4e308a):new kt(_0x4e308a);return _0x31e1c4['set']({'label':_0x129fa6['label'],'icon':_0x129fa6['icon'],'withText':!0x0,'tooltip':!0x0,'tooltipPosition':'sw','class':Br}),_0x31e1c4;}['_setupAllBalloonClickOutsideHandlers'](){this['_setupAddContextBalloonClickOutsideHandler'](),this['_setupUrlBalloonClickOutsideHandler']();}['_setupUrlBalloonClickOutsideHandler'](){Xt({'emitter':this['_urlBalloonPanelView'],'contextElements':[this['_urlBalloonPanelView']['element']],'callback':()=>{this['hideUrlBalloonPanel']();},'activator':()=>this['_urlBalloonPanelView']['isVisible']});}['_toggleAddContextBalloon'](_0x2d179e){const _0x35dd17=this['_addContextBalloonConfig'];_0x35dd17['buttonView']['isOn']=_0x2d179e,_0x2d179e?_0x35dd17['balloonView']['show']():_0x35dd17['balloonView']['hide']();}['_setupAddContextBalloonClickOutsideHandler'](){const {balloonView:_0x111b1f,buttonView:_0x1a21dd,hideMethod:_0x2b0c90}=this['_addContextBalloonConfig'];Xt({'emitter':_0x111b1f,'contextElements':[_0x111b1f['element'],_0x1a21dd['element']],'callback':()=>{_0x2b0c90();},'activator':()=>_0x1a21dd['isOn']&&!this['_urlBalloonPanelView']['isVisible']&&!this['_resourcesBalloonView']['isAnyResourceBalloonVisible']()});}['_createContextButton'](_0x4f89af,_0x45fd1f,_0x5e9edf=!0x1,_0x3b9ac7=!0x1){const _0xefc474='conversation'===_0x45fd1f||!0x0===_0x4f89af['isReadOnly'],_0x37042a=new Pn(this['locale'],_0x4f89af,_0xefc474,_0x5e9edf,_0x3b9ac7);return _0xefc474||_0x37042a['on']('removeContextItemChip',()=>{this['fire']('removeContextItem',_0x37042a['id']);}),_0x37042a;}['_addContextToCollection'](_0x2e4be1,_0x2de4d3){_0x2de4d3['add'](_0x2e4be1,0x0);}['_removeContextFromCollection'](_0x137490,_0x3f64f2){const _0x189eeb=_0x3f64f2['find'](_0x5213ea=>_0x5213ea['id']===_0x137490);_0x189eeb&&_0x3f64f2['remove'](_0x189eeb);}['_handleAddContextButtonClick'](){this['addContextButtonView']['isOn']?this['hideAddContextBalloonPanel']():(this['showAddContextBalloonPanel'](),this['_addContextBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':qr}),this['_hasExactlyOneSource']&&this['_addContextBalloonPanelView']['content']['get'](0x0)?.['fire']('execute'));}['_handleUrlSubmit'](_0x3eb48e){this['_urlInputView']['clear'](),this['hideUrlBalloonPanel'](),this['fire']('addUrlToContext',_0x3eb48e);}}class Xr extends kt{['arrowView'];constructor(_0x1f0396){super(_0x1f0396),this['set']({'withText':!0x0,'role':'menuitem'}),this['arrowView']=this['_createArrowView'](),this['extendTemplate']({'attributes':{'class':[Gr]}});}['render'](){super['render'](),this['children']['add'](this['arrowView']);}['_createArrowView'](){const _0x54baaf=new yt();return _0x54baaf['content']=_0x3c1855,_0x54baaf['extendTemplate']({'attributes':{'class':Gr+'__arrow'}}),_0x54baaf;}}class zr extends Nt{['_cancelButtonView'];['_loaderView'];constructor(_0x361407){super(_0x361407),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 _0x1d2e3f=new kt(this['locale']);return _0x1d2e3f['set']({'label':cs(this['locale'],'AI_CHAT_STOP_GENERATING'),'withText':!0x0,'class':us+'\x20ck-ai-button-stop-generating','icon':_0x2ffb29}),_0x1d2e3f['on']('execute',()=>{this['fire']('abortPromptStream');}),_0x1d2e3f;}['_createLoaderView'](){const _0x4ec944=new Nt(this['locale']);return _0x4ec944['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':cs(this['locale'],'AI_CHAT_IS_WRITING')}]}),_0x4ec944;}}class jr extends Nt{['_contextPanelView'];['_promptInputView'];['_promptCapabilitiesView'];['_loaderView'];['_modelUnavailableMessageView'];['_shouldRestorePromptInputFocus'];constructor(_0x1340da,_0x2a08b2){super(_0x1340da),this['_contextPanelView']=this['_createContextPanelView'](_0x1340da,{'bodyCollection':_0x2a08b2['bodyCollection'],'searchInputVisibleFrom':_0x2a08b2['contextResourcesSearchInputVisibleFrom']}),this['_promptInputView']=this['_createPromptInputView'](_0x1340da),this['_promptCapabilitiesView']=this['_createPromptCapabilitiesView'](_0x1340da),this['_loaderView']=this['_createLoaderView'](_0x1340da),this['_modelUnavailableMessageView']=this['_createModelUnavailableMessageView'](_0x1340da),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'](...Dr)['to'](this),this['set']('isModelAvailable',!0x0),this['set']('isDisabled',!0x1);const _0x3b5a32=this['bindTemplate'];this['setTemplate']({'tag':'form','attributes':{'class':['ck','ck-ai-chat-controls',_0x3b5a32['if']('isDisabled','ck-ai-chat-controls-disabled')]},'children':[{'tag':'div','attributes':{'class':[_0x3b5a32['if']('isLoading','ck-hidden',_0x495f16=>_0x495f16||!this['isModelAvailable']),_0x3b5a32['if']('isModelAvailable','ck-hidden',_0x3321a0=>!_0x3321a0||this['isLoading'])]},'children':[this['_contextPanelView'],this['_promptInputView'],this['_promptCapabilitiesView']]},{'tag':'div','attributes':{'class':[_0x3b5a32['if']('isLoading','ck-hidden',_0x5b0d7f=>!_0x5b0d7f)]},'children':[this['_loaderView']]},{'tag':'div','attributes':{'class':[_0x3b5a32['if']('isModelAvailable','ck-hidden',_0x2ba0dc=>_0x2ba0dc)]},'children':[this['_modelUnavailableMessageView']]}]}),Xt({'emitter':this['_promptInputView'],'activator':()=>this['isLoading'],'contextElements':()=>[this['element']],'callback':()=>{this['_shouldRestorePromptInputFocus']=!0x1;}}),this['on']('change:isLoading',this['_handlePromptInputFocus'],{'priority':'low'});}['_createContextPanelView'](_0x21e4da,_0x5a3431){return new Qr(_0x21e4da,_0x5a3431);}['_createPromptInputView'](_0x3393a8){return new ar(_0x3393a8,this['_contextPanelView']['addContextButtonView']);}['_createPromptCapabilitiesView'](_0x95cde4){return new gr(_0x95cde4);}['_createLoaderView'](_0x1ec89e){return new zr(_0x1ec89e);}['_createModelUnavailableMessageView'](_0x1eea43){const _0x501e76=new Jr(_0x1eea43);return _0x501e76['delegate']('startConversation')['to'](this),_0x501e76;}['_handlePromptInputFocus'](_0x3207fd,_0x40ca25,_0x1ce762){_0x1ce762?this['_shouldRestorePromptInputFocus']=!0x0:this['_shouldRestorePromptInputFocus']&&this['_promptInputView']['focus']();}['addContextItem'](_0x5a76d7,_0x129c29){this['_contextPanelView']['addContextItem'](_0x5a76d7,_0x129c29);}['removeContextItem'](_0xbefa65){this['_contextPanelView']['removeContextItem'](_0xbefa65);}['setContextItemLoading'](_0x3eaee0,_0x497c14){this['_contextPanelView']['setContextItemLoading'](_0x3eaee0,_0x497c14);}['setIsUploadInProgress'](_0x3c86dc){this['_promptInputView']['setIsUploadInProgress'](_0x3c86dc);}['setConversationContext'](_0x38e63b){this['_contextPanelView']['setConversationContext'](_0x38e63b);}['clearPendingContextUI'](){this['_contextPanelView']['clearCurrentContextItems']();}['clearConversationContextUI'](){this['_contextPanelView']['clearConversationContextItems']();}['updateResourceState'](_0x53697f,_0x5abbbd,_0x5a0c78){this['_contextPanelView']['updateResourceState'](_0x53697f,_0x5abbbd,_0x5a0c78);}['setWebSearch'](_0x91b0e9){this['_promptCapabilitiesView']['setWebSearch'](_0x91b0e9);}['setReasoning'](_0x112eb6){this['_promptCapabilitiesView']['setReasoning'](_0x112eb6);}['resetMessageInput'](){this['_promptInputView']['reset']();}['setAddContextOptions'](_0x2c517f){this['_contextPanelView']['setAddContextOptions'](_0x2c517f);}['setInputPlaceholder'](_0x4ffaa8){this['_promptInputView']['setPlaceholderText'](_0x4ffaa8);}['setModelList'](_0x28aa82,_0x315eb2){this['_promptCapabilitiesView']['setModelList'](_0x28aa82,_0x315eb2);}['setModel'](_0x4a6efc){_0x4a6efc?(this['isModelAvailable']=!0x0,this['_promptCapabilitiesView']['setModel'](_0x4a6efc)):this['isModelAvailable']=!0x1;}['enableModelSelector'](){this['_promptCapabilitiesView']['enableModelSelector']();}['disableModelSelector'](_0x49bd37){this['_promptCapabilitiesView']['disableModelSelector'](_0x49bd37);}['populateSourceResourceBalloon'](_0x2bec8f,_0xbf64fd,_0x3dcad4,_0x1bf956){this['_contextPanelView']['populateSourceResourceBalloon'](_0x2bec8f,_0xbf64fd,_0x3dcad4,_0x1bf956);}['closeSourceResourceBalloon'](_0x134aed){this['_contextPanelView']['closeSourceResourceBalloon'](_0x134aed);}['focusPromptInput'](_0x42ef8d=!0x1){this['_promptInputView']['focus'](_0x42ef8d);}['setPromptInputValue'](_0x6ef409){this['_promptInputView']['queryView']['fieldView']['reset'](),this['_promptInputView']['queryView']['fieldView']['value']=_0x6ef409;}}class Jr extends Nt{constructor(_0x1f6053){super(_0x1f6053);const _0x547cab=new kt(_0x1f6053);_0x547cab['set']({'label':cs(this['locale'],'AI_CHAT_MODEL_UNAVAILABLE_MESSAGE_BUTTON'),'withText':!0x0,'class':['ck-ai-chat-controls__start-new-chat-button'],'tooltip':''}),_0x547cab['delegate']('execute')['to'](this,'startConversation'),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat-controls-model-unavailable-message']},'children':[{'tag':'p','children':[{'text':cs(this['locale'],'AI_CHAT_MODEL_UNAVAILABLE_MESSAGE_TEXT')+'\x20'},_0x547cab]}]});}}class Zr extends _0x52d3ea{['conversationStartButton'];['resizeButton'];constructor(_0x534318,_0x25634b){super(_0x534318,{'label':cs(_0x534318,'AI_CHAT_HEADING'),'class':'ck-ai-header\x20ck-ai-header_chat','icon':_0x353b1b}),this['set']('isMaximized',!0x1),this['conversationStartButton']=this['_createStartConversationButton'](_0x534318),this['children']['add'](this['conversationStartButton']),_0x25634b&&(this['resizeButton']=_s(_0x534318,this),this['children']['add'](this['resizeButton']));}['_createStartConversationButton'](_0x583818){const _0x572824=new kt(_0x583818);return _0x572824['set']({'label':cs(this['locale'],'AI_CHAT_LABEL_NEW_CHAT'),'withText':!0x0,'icon':_0x20b289,'class':'ck-ai-chat__start-conversation\x20'+us}),_0x572824['on']('execute',()=>{this['fire']('startConversation');}),_0x572824;}}class ta extends Nt{constructor(_0x2b9fce){super(_0x2b9fce),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-disclaimer']},'children':[{'tag':'p','attributes':{'class':['ck','ck-ai-disclaimer__content']},'children':[{'text':cs(_0x2b9fce,'AI_DISCLAIMER_TEXT')}]}]});}}class ea extends Nt{['chatHeader'];['chatFeed'];['chatControls'];['chatDisclaimer'];['_bodyCollection'];constructor(_0x48b263,_0x41db62){super(_0x48b263),this['_bodyCollection']=new qt(_0x48b263),this['_bodyCollection']['attachToDom'](),this['chatHeader']=new Zr(_0x48b263,_0x41db62['showResizeButton']),this['chatHeader']['delegate'](...Js)['to'](this),this['chatFeed']=new sr(_0x48b263,this['_bodyCollection']),this['chatFeed']['delegate'](...Js)['to'](this),this['chatControls']=new jr(_0x48b263,{'bodyCollection':this['_bodyCollection'],'contextResourcesSearchInputVisibleFrom':_0x41db62['contextResourcesSearchInputVisibleFrom']}),this['chatControls']['delegate'](...Js)['to'](this),this['chatDisclaimer']=new ta(_0x48b263),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset_all','ck-ai-chat','ck-rounded-corners'],'dir':_0x48b263['uiLanguageDirection']},'children':[this['chatHeader'],this['chatFeed'],this['chatControls'],this['chatDisclaimer']]});}['populateSourceResourceBalloon'](_0x3ca95d,_0x2785e7,_0x255f7b,_0x452084){this['chatControls']['populateSourceResourceBalloon'](_0x3ca95d,_0x2785e7,_0x255f7b,_0x452084);}['closeSourceResourceBalloon'](_0x2e5703){this['chatControls']['closeSourceResourceBalloon'](_0x2e5703);}['destroy'](){this['_bodyCollection']['detachFromDom'](),super['destroy']();}}class ia extends _0x31818a{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(_0x3f5bd1){super(_0x3f5bd1);const _0x647dd5=this['context']['plugins']['get']('AITabs');this['set']('isBusy',!0x1),this['_promiseQueue']=new In(),this['_view']=new ea(this['context']['locale'],{'showResizeButton':_0x647dd5['showResizeButton'],'contextResourcesSearchInputVisibleFrom':this['context']['config']['get']('ai.chat.context.searchInputVisibleFrom')}),this['_view']['delegate'](...Js)['to'](this),this['_view']['on']('toggleSuggestionDisplayMode',(_0x357a5c,{showDiff:_0x38afe4})=>{this['showDiff']=_0x38afe4;}),_0x647dd5['view']['addTab']({'id':'chat','buttonLabel':cs(this['context']['locale'],'AI_CHAT_HEADING'),'buttonIcon':_0x353b1b,'order':0x0,'content':this['_view']}),this['_view']['chatControls']['bind']('isLoading')['to'](this,'isBusy',_0x997757=>_0x997757),this['_view']['chatFeed']['bind']('isPending')['to'](this,'isBusy',_0x2fb41e=>_0x2fb41e),this['_view']['chatControls']['setInputPlaceholder'](this['_getInputPlaceholder']()),this['bind']('isModelAvailable')['to'](this['_view']['chatControls'],'isModelAvailable');}['destroy'](){super['destroy'](),this['_titleAnimationInterval']&&clearInterval(this['_titleAnimationInterval']);}['createConversation'](_0x15f03c){const _0x3cdd3a=this['context']['config']['get']('ai.chat.welcomeMessage')??cs(this['context']['locale'],'AI_CHAT_WELCOME_MESSAGE');this['_view']['chatFeed']['clear'](),this['_view']['chatControls']['enableModelSelector'](),this['_view']['chatControls']['setModelList'](_0x15f03c['availableModels'],!this['context']['config']['get']('ai.models.showModelSelector')),this['addFeedItemStaticMessage']({'id':'conversation-start','staticMessage':_0x3cdd3a}),this['fire']('conversationCreated');}async['addFeedItemStaticMessage']({id:_0x39b301,staticMessage:_0x390692}){return this['_promiseQueue']['enqueue'](async()=>{this['_view']['chatFeed']['addItem']('ai-reply',{'id':_0x39b301,'initialContent':'<p>'+_0x390692+'</p>'});});}async['addFeedItemUserMessage'](_0x371bdf){const _0x4e257f=_0x371bdf['attributes']?.['displayedPrompt']||_0x371bdf['userMessage'];return this['_promiseQueue']['enqueue'](async()=>{this['_view']['chatFeed']['addItem']('user-message',{'contextItems':Array['from'](_0x371bdf['contextItems']['values']()),'initialContent':'<p>'+_0x4e257f+'</p>','id':_0x371bdf['id']});});}async['addFeedItemError']({errorMessage:_0x12b517,id:_0x2a2c01}){return this['_promiseQueue']['enqueue'](async()=>{this['_view']['chatFeed']['addItem']('error-message',{'initialContent':'<p>'+_0x12b517+'</p>','id':_0x2a2c01});});}async['addFeedItemAIReply'](_0x29a280){return this['_promiseQueue']['enqueue'](async()=>{this['_view']['chatFeed']['addItem']('ai-reply',{'id':_0x29a280['interactionId']+':'+_0x29a280['id']}),this['clearLoadingMessage']();});}async['addFeedItemAISuggestion'](_0x2ceba8){const _0x3ea0ac=Ys(this['context']);let _0xa49854=_0x3ea0ac['config']['get']('ai.availableReplyActions')||[...pn];if(_0x3ea0ac['plugins']['has']('TrackChanges')){if(!this['_isTrackChangesCommandValueBound']){this['_isTrackChangesCommandValueBound']=!0x0;const _0x558ac6=_0x3ea0ac['commands']['get']('trackChanges');this['_view']['chatFeed']['bind']('isTrackChangesOn')['to'](_0x558ac6,'value');}}else _0xa49854=_0xa49854['filter'](_0x2d532c=>'insertSuggestion'!=_0x2d532c);return this['_promiseQueue']['enqueue'](async()=>{this['_view']['chatFeed']['addItem']('ai-suggestion-reply',{'id':_0x2ceba8['interactionId']+':'+_0x2ceba8['id'],'areActionsDisabled':_0x2ceba8['areActionsDisabled'],'showDiff':this['showDiff'],'availableActions':_0xa49854}),this['clearLoadingMessage']();});}async['addFeedInteractionHeader'](_0x4862f9,_0x22f724){return this['_promiseQueue']['enqueue'](async()=>{const _0x2c1e22=this['_view']['chatFeed']['children']['last'];if(_0x2c1e22 instanceof Qn)return this['_view']['chatFeed']['children']['remove'](_0x2c1e22),void this['_view']['chatFeed']['addItem']('interaction-header',{'id':_0x4862f9['id'],'capabilities':{'isWebSearchEnabled':_0x2c1e22['capabilities']['isWebSearchEnabled']||_0x22f724['isWebSearchEnabled'],'isReasoningEnabled':_0x2c1e22['capabilities']['isReasoningEnabled']||_0x22f724['isReasoningEnabled']}});this['_view']['chatFeed']['addItem']('interaction-header',{'id':_0x4862f9['id'],'capabilities':_0x22f724});});}async['addFeedItemCustomElement'](_0x1a8530,_0x15c82f){let _0x26e9fe;return await this['_promiseQueue']['enqueue'](async()=>{_0x26e9fe=this['_view']['chatFeed']['addItem']('custom-element',{'content':_0x1a8530,'id':_0x15c82f});}),_0x26e9fe;}['removeFeedItem'](_0x56535f){this['_view']['chatFeed']['removeItem'](_0x56535f);}['hasFeedItem'](_0x1d63d5){return this['_view']['chatFeed']['hasItem'](_0x1d63d5);}['updateFeedInteractionHeader'](_0x2aea64){const _0x5cbc63=this['_view']['chatFeed']['children']['find'](_0x5f59cf=>_0x5f59cf['options']['id']==_0x2aea64['id']&&_0x5f59cf instanceof Qn);_0x5cbc63&&_0x5cbc63['set']('isVisible',_0x2aea64['isVisible']);}async['updateFeedItemAIReplyContent'](_0xf23c1){const _0x53e923=_0xf23c1['renderingStrategy']||this['feedItemRenderingStrategy'];return this['_promiseQueue']['enqueue'](async _0xf2b776=>{await this['_view']['chatFeed']['updateReplyItem']({..._0xf23c1,'abortSignal':_0xf2b776,'renderingStrategy':_0x53e923}),_0xf23c1['isDone']&&this['markFeedItemAsDone'](_0xf23c1['id']);});}['updateFeedItemAIReplySources'](_0x2b8abd,_0x4dbbf4){this['_view']['chatFeed']['updateWebSources'](_0x2b8abd,_0x4dbbf4);}async['updateFeedItemAIReplySuggestionContent'](_0x192e6b){const _0x5da65d=_0x192e6b['renderingStrategy']||this['feedItemRenderingStrategy'];return this['_promiseQueue']['enqueue'](async _0x30e0c5=>{await this['_view']['chatFeed']['updateSuggestionItem']({..._0x192e6b,'abortSignal':_0x30e0c5,'renderingStrategy':_0x5da65d}),_0x192e6b['isDone']&&this['markFeedItemAsDone'](_0x192e6b['id']);});}['updateFeedItemAIReplySuggestionPartState'](_0x226187){this['_view']['chatFeed']['updateSuggestionPartState'](_0x226187);}['setFeedItemAIReplySuggestionPartActive'](_0x18fbdc){this['_view']['chatFeed']['setSuggestionPartActive'](_0x18fbdc);}['markFeedItemAsDone'](_0x248e73){this['_view']['chatFeed']['markItemAsDone'](_0x248e73);}['removeFeedInteraction'](_0x332f27){this['_view']['chatFeed']['getItemIds']()['filter'](_0xe537c3=>_0xe537c3['startsWith'](_0x332f27))['forEach'](_0x270c04=>this['_view']['chatFeed']['removeItem'](_0x270c04));}['startInteraction'](){const _0x4e93f9=this['prepareLoadingMessage']({'isWebSearchEnabled':!0x1,'isReasoningEnabled':!0x1});this['setLoadingMessage'](_0x4e93f9),this['_view']['chatControls']['disableModelSelector'](!this['context']['config']['get']('ai.models.showModelSelector')),this['isBusy']=!0x0,this['_view']['chatFeed']['startAutoScroll']();}['stopInteraction'](_0x21aafc){this['_promiseQueue']['abort'](),this['_view']['chatFeed']['getItemIds']()['filter'](_0x26bccb=>_0x26bccb['startsWith'](_0x21aafc['id']))['forEach'](_0x153c18=>this['markFeedItemAsDone'](_0x153c18)),this['isBusy']=!0x1,this['_view']['chatFeed']['stopAutoScroll']();}async['finishInteraction'](){return this['_promiseQueue']['queueEmptyPromise']['then'](()=>{this['isBusy']=!0x1,this['_view']['chatFeed']['stopAutoScroll']();});}['addContextItem'](_0x371647,_0x38219f){this['_view']['chatControls']['addContextItem'](_0x371647,_0x38219f);}['removeContextItem'](_0xc8c2ee){this['_view']['chatControls']['removeContextItem'](_0xc8c2ee);}['setContextItemLoading'](_0x37072e,_0x224f3a){this['_view']['chatControls']['setContextItemLoading'](_0x37072e,_0x224f3a);}['setIsUploadInProgress'](_0x97be36){this['_view']['chatControls']['setIsUploadInProgress'](_0x97be36);}['setConversationContext'](_0x395cc3){this['_view']['chatControls']['setConversationContext'](_0x395cc3);}['clearPendingContextUI'](){this['_view']['chatControls']['clearPendingContextUI']();}['clearConversationContextUI'](){this['_view']['chatControls']['clearConversationContextUI']();}['updateResourceState'](_0x50f2a4,_0xc9994e,_0xdde51){this['_view']['chatControls']['updateResourceState'](_0x50f2a4,_0xc9994e,_0xdde51);}['resetMessageInput'](){this['_view']['chatControls']['resetMessageInput'](),this['_view']['chatControls']['setInputPlaceholder'](this['_getInputPlaceholder']());}['setAddContextOptions'](_0x14c9a5){this['_view']['chatControls']['setAddContextOptions'](_0x14c9a5);}['updateCapabilities'](_0x2bc80b){this['_view']['chatControls']['setWebSearch'](_0x2bc80b['isWebSearchEnabled']),this['_view']['chatControls']['setReasoning'](_0x2bc80b['isReasoningEnabled']),this['_view']['chatControls']['setInputPlaceholder'](this['_getInputPlaceholder'](_0x2bc80b));}['setSelectedModel'](_0x5d7e95,_0xe0f7dc){this['_view']['chatControls']['setModel'](_0x5d7e95),_0xe0f7dc&&this['_view']['chatControls']['disableModelSelector'](!0x1);}['setFeedItemRenderingStrategy'](_0x317e1c){this['feedItemRenderingStrategy']=_0x317e1c;}['toggleLoadingSkeleton'](_0x5aacde){this['_view']['chatFeed']['toggleLoadingSkeleton'](_0x5aacde);}['resetConversationTitle'](){this['setConversationTitle'](cs(this['context']['locale'],'AI_CHAT_HEADING'));}['setConversationTitle'](_0x3bc454,_0x528b25=!0x1){if(_0x528b25&&!St()&&_0x3bc454['length'])return this['_view']['chatHeader']['label']='',void this['_animateConversationTitle'](_0x3bc454);this['_view']['chatHeader']['label']=_0x3bc454;}['setLoadingMessage'](_0x48aa56){this['_view']['chatFeed']['setLoadingMessage'](_0x48aa56);}['clearLoadingMessage'](){this['_view']['chatFeed']['setLoadingMessage']('');}['_animateConversationTitle'](_0x206537){let _0x21f006=0x0;clearInterval(this['_titleAnimationInterval']),this['_titleAnimationInterval']=setInterval(()=>{this['_view']['chatHeader']['label']=this['_view']['chatHeader']['label']+_0x206537[_0x21f006],_0x21f006++,_0x21f006===_0x206537['length']&&clearInterval(this['_titleAnimationInterval']);},0x1e);}['setIsMaximized'](_0x53a53b){this['_view']['chatHeader']['isMaximized']=_0x53a53b;}['prepareLoadingMessage'](_0x2e09d9){return _0x2e09d9['isWebSearchEnabled']&&_0x2e09d9['isReasoningEnabled']?cs(this['context']['locale'],'AI_CHAT_FEED_LOADING_MESSAGE_WEBSEARCH_REASONING'):_0x2e09d9['isWebSearchEnabled']?cs(this['context']['locale'],'AI_CHAT_FEED_LOADING_MESSAGE_WEBSEARCH'):_0x2e09d9['isReasoningEnabled']?cs(this['context']['locale'],'AI_CHAT_FEED_LOADING_MESSAGE_REASONING'):cs(this['context']['locale'],'AI_CHAT_FEED_LOADING_MESSAGE_REGULAR');}['_getInputPlaceholder'](_0x4e07ba){return _0x4e07ba?_0x4e07ba['isWebSearchEnabled']&&_0x4e07ba['isReasoningEnabled']?cs(this['context']['locale'],'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_WEBSEARCH_REASONING'):_0x4e07ba['isWebSearchEnabled']?cs(this['context']['locale'],'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_WEBSEARCH'):_0x4e07ba['isReasoningEnabled']?cs(this['context']['locale'],'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_REASONING'):cs(this['context']['locale'],'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_REGULAR'):cs(this['context']['locale'],'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_REGULAR');}['populateSourceResourceBalloon'](_0x1ee5bc,_0x39a510,_0x97b9e1,_0x5b13db){this['_view']['populateSourceResourceBalloon'](_0x1ee5bc,_0x39a510,_0x97b9e1,_0x5b13db);}['closeSourceResourceBalloon'](_0x9cf867){this['_view']['closeSourceResourceBalloon'](_0x9cf867);}['setPromptInputValue'](_0x13aff6){this['_view']['chatControls']['setPromptInputValue'](_0x13aff6);}['focusPromptInput'](_0x2be3e1=!0x1){this['_view']['chatControls']['focusPromptInput'](_0x2be3e1);}['scrollFeedToSuggestion'](_0x2ff397,_0x5aeac6){this['_view']['chatFeed']['scrollToSuggestion'](_0x2ff397,_0x5aeac6);}['startAutoScroll'](){this['_view']['chatFeed']['startAutoScroll']();}['disableControls'](){this['_view']['chatControls']['isDisabled']=!0x0;}['enableControls'](){this['_view']['chatControls']['isDisabled']=!0x1;}}class sa extends Lt{['sections'];constructor(_0x59dcd2,_0x4ffac7){super(_0x59dcd2),this['sections']=_0x4ffac7,this['items']['addMany'](this['sections']),this['extendTemplate']({'attributes':{'class':['ck-ai-chat-history__sections']}});}['filter'](_0xaaf3ba){let _0x1e418e=0x0,_0x18c95f=0x0;for(const _0x1bc3b9 of this['sections']){const {resultsCount:_0x4d1ea8,totalItemsCount:_0x5adc63}=_0x1bc3b9['filter'](_0xaaf3ba);_0x1e418e+=_0x4d1ea8,_0x18c95f+=_0x5adc63;}return{'resultsCount':_0x1e418e,'totalItemsCount':_0x18c95f};}}class na extends Pt{['title'];['itemsViews'];['_itemsListView'];constructor(_0x13eb91,{title:_0x6636f9,items:_0x610450}){super(_0x13eb91);const _0x401c89=this['bindTemplate'];this['set']('isVisible',!0x0),this['title']=_0x6636f9,this['itemsViews']=_0x610450;const _0x292c52=new Nt(_0x13eb91);_0x292c52['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-chat-history__section-title']},'children':[this['title']]}),this['_itemsListView']=new Lt(_0x13eb91),this['_itemsListView']['items']['addMany'](this['itemsViews']),this['setTemplate']({'tag':'li','attributes':{'class':['ck-ai-chat-history__section',_0x401c89['if']('isVisible','ck-hidden',_0x312fe3=>!_0x312fe3)]},'children':[_0x292c52,this['_itemsListView']]});}['filter'](_0x21ab35){const _0x3ee012=this['itemsViews']['length'];let _0x4141f2=0x0;for(const _0x2f8d80 of this['itemsViews']){if(_0x21ab35){const _0x48670f=_0x2f8d80['isMatching'](_0x21ab35);_0x2f8d80['isVisible']=!!_0x48670f,_0x2f8d80['highlightText'](_0x21ab35);}else _0x2f8d80['isVisible']=!0x0,_0x2f8d80['highlightText'](null);_0x2f8d80['isVisible']&&_0x4141f2++;}return this['isVisible']=_0x4141f2>0x0,{'resultsCount':_0x4141f2,'totalItemsCount':_0x3ee012};}['getItem'](_0x8bd2bf){return this['itemsViews']['find'](_0x4c38e2=>_0x4c38e2['id']===_0x8bd2bf);}['removeItem'](_0x523af5){const _0x26d4c2=this['itemsViews']['indexOf'](_0x523af5);-0x1!==_0x26d4c2&&(this['itemsViews']['splice'](_0x26d4c2,0x1),this['_itemsListView']['items']['remove'](_0x523af5));}}class ra extends/* #__PURE__ -- @preserve */
|
|
27
|
+
_0x16c245(Pt){['id'];static ['LOADING_LABELS']={'remove':'AI_CHAT_HISTORY_LOADING_REMOVING','rename':'AI_CHAT_HISTORY_LOADING_RENAMING','pin':'AI_CHAT_HISTORY_LOADING_PINNING','unpin':'AI_CHAT_HISTORY_LOADING_UNPINNING'};['actions'];['mainContent'];['_titleView'];constructor(_0x1566e6,_0x275df1){super(_0x1566e6);const _0x5e919d=this['bindTemplate'];this['set']('isEdit',!0x1),this['set']('isVisible',!0x0),this['set']('pinned',!!_0x275df1['pinned']),this['set']('loadingState',null),this['id']=_0x275df1['id'];const {title:_0x5c4c73,createdAt:_0x5a4bcc,active:_0x1baf87=!0x1}=_0x275df1;this['_titleView']=new _0x16beb0(),this['_titleView']['text']=_0x5c4c73,this['_titleView']['extendTemplate']({'attributes':{'class':['ck-ai-chat-history__item-title']}});const _0x1c3694=this['_createCheckView'](),_0x4e0d23=this['_createPinButtonView'](_0x1566e6),_0x29e9e5=this['_createMenuDropdownView'](),_0x25a5f=this['_createEditInputView'](_0x1566e6,_0x5c4c73),_0x494ed0=this['_createAcceptEditButtonView'](_0x1566e6,_0x25a5f),_0x3e6a65=this['_createCancelEditButtonView'](_0x1566e6,_0x25a5f);this['actions']=this['createCollection'](),this['mainContent']=this['createCollection'](),this['mainContent']['add'](this['_titleView']),this['actions']['add'](_0x4e0d23),this['actions']['add'](_0x29e9e5),this['on']('change:isEdit',(_0x2382ef,_0x188f70,_0x357f69)=>{this['actions']['clear'](),this['mainContent']['clear'](),_0x357f69?(this['actions']['add'](_0x494ed0),this['actions']['add'](_0x3e6a65),this['mainContent']['add'](_0x25a5f),_0x25a5f['element']['focus']()):(this['actions']['add'](_0x4e0d23),this['actions']['add'](_0x29e9e5),this['mainContent']['add'](this['_titleView']));}),this['setTemplate']({'tag':'li','attributes':{'class':['ck-ai-chat-history__item',_0x1baf87?'ck-ai-chat-history__item--active':'',_0x5e919d['if']('isVisible','ck-hidden',_0x19b574=>!_0x19b574),_0x5e919d['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',_0x5e919d['if']('loadingState','ck-hidden',_0x5a55cc=>!!_0x5a55cc)]},'children':_0x1baf87?[_0x1c3694]:[]},{'tag':'div','attributes':{'class':['ck-ai-loader',_0x5e919d['if']('loadingState','ck-hidden',_0x2fe7ff=>!_0x2fe7ff)]},'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',_0x5e919d['if']('loadingState','ck-hidden',_0x36639c=>!!_0x36639c)]},'children':this['mainContent']},{'tag':'div','attributes':{'class':['ck-ai-loader__text',_0x5e919d['if']('loadingState','ck-hidden',_0x2fbf24=>!_0x2fbf24)]},'children':[{'text':_0x5e919d['to']('loadingState',_0x597237=>_0x597237?cs(this['locale'],ra['LOADING_LABELS'][_0x597237]):'')}]}]},{'tag':'span','attributes':{'class':['ck-ai-chat-history__item-date']},'children':[_0x5a4bcc]}]},{'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'](_0x1a02f4){this['_titleView']['text']=_0x5b8af7(_0x1a02f4);}['updateLoadingState'](_0xa203c8,_0x4e69a1){this['set']('loadingState',_0x4e69a1?_0xa203c8:null);}['_createCheckView'](){const _0x308755=new yt();return _0x308755['set']({'content':_0x177f85}),_0x308755;}['_createPinButtonView'](_0x3f6d14){const _0x248e0c=new kt(_0x3f6d14);return _0x248e0c['set']({'label':cs(_0x3f6d14,'AI_CHAT_HISTORY_PIN_BUTTON'),'icon':_0x2467ba,'withText':!0x1,'tooltip':!0x0}),_0x248e0c['bind']('isOn')['to'](this,'pinned'),_0x248e0c['on']('execute',()=>{const _0x4300f5=!this['pinned'];this['fire']('setConversationPinned',{'id':this['id'],'pinned':_0x4300f5});}),_0x248e0c;}['_createMenuDropdownView'](){const _0x9a88c3=Bt(this['locale']),_0x1b0de9=_0x9a88c3['panelView']['children'];_0x9a88c3['buttonView']['set']({'label':cs(this['locale'],'AI_CHAT_HISTORY_SHOW_MORE_ITEMS'),'icon':_0xf04a61}),_0x9a88c3['panelPosition']='sw';const _0x268d6b=new kt(this['locale']);_0x268d6b['label']=cs(this['locale'],'AI_CHAT_HISTORY_EDIT_NAME'),_0x268d6b['withText']=!0x0,_0x268d6b['on']('execute',()=>{this['isEdit']=!0x0;});const _0x5be10b=new kt(this['locale']);_0x5be10b['label']=cs(this['locale'],'AI_CHAT_HISTORY_REMOVE'),_0x5be10b['withText']=!0x0,_0x5be10b['on']('execute',()=>{this['showConfirm'](cs(this['locale'],'AI_CHAT_HISTORY_REMOVE_CONFIRM'),this['element'])['then'](()=>{this['fire']('removeConversation',{'id':this['id']});});});const _0x151f71=new Lt(this['locale']),_0x428b73=new Pt(this['locale']);_0x428b73['children']['add'](_0x268d6b);const _0x5e72ca=new Pt(this['locale']);return _0x5e72ca['children']['add'](_0x5be10b),_0x151f71['items']['addMany']([_0x428b73,_0x5e72ca]),_0x1b0de9['add'](_0x151f71),_0x9a88c3;}['_createEditInputView'](_0x5e16ae,_0x13eaf3){const _0xebcc=new _0x1e6483(_0x5e16ae),_0x50366a=_0xebcc['bindTemplate'];return _0xebcc['value']=_0x13eaf3,_0xebcc['extendTemplate']({'on':{'keydown':_0x50366a['to'](_0x3f8c3c=>{'Enter'==_0x3f8c3c['key']&&this['_commitEditInputValue'](_0xebcc);})}}),_0xebcc;}['_createAcceptEditButtonView'](_0x387ef1,_0x1d9363){const _0x2c375d=new kt(_0x387ef1);return _0x2c375d['set']({'icon':_0x177f85,'withText':!0x1,'tooltip':cs(_0x387ef1,'AI_CHAT_HISTORY_ACCEPT')}),_0x2c375d['extendTemplate']({'attributes':{'class':['ck-confirm-view-submit']}}),_0x2c375d['on']('execute',()=>{this['_commitEditInputValue'](_0x1d9363);}),_0x2c375d;}['_commitEditInputValue'](_0x48d542){const _0x365776=_0x48d542['element']['value']||'';this['_titleView']['text']=_0x365776,this['isEdit']=!0x1,this['fire']('editConversationTitle',{'id':this['id'],'title':_0x365776});}['_createCancelEditButtonView'](_0x1ce30e,_0x3a652e){const _0x16de28=new kt(_0x1ce30e);return _0x16de28['set']({'icon':_0x40d9e4,'withText':!0x1,'tooltip':cs(_0x1ce30e,'AI_CHAT_HISTORY_CANCEL')}),_0x16de28['extendTemplate']({'attributes':{'class':['ck-confirm-view-cancel']}}),_0x16de28['on']('execute',()=>{this['isEdit']=!0x1,_0x3a652e['value']=this['_titleView']['text']||'',this['fire']('edit:cancel');}),_0x16de28;}['_createSpinnerView'](){const _0x3ce824=new Rn('tiny');return _0x3ce824['isVisible']=!0x0,_0x3ce824;}['isMatching'](_0x2ae109){return this['_titleView']&&'string'==typeof this['_titleView']['text']&&this['_titleView']['text']['match'](_0x2ae109)?{'title':!0x0}:null;}['highlightText'](_0x52b6d0){this['_titleView']['highlightText'](_0x52b6d0);}}class aa extends Nt{['searchView'];['mainErrorView'];['skeletonView'];['emptyView'];['sectionsView'];['resizeButton'];constructor(_0x435aa7,_0xf817a){super(_0x435aa7),this['set']('hasItems',!0x1),this['set']('isLoading',!0x0),this['set']('errorMessage',''),this['set']('isMaximized',!0x1),this['set']('isSearchViewVisible',!0x1),this['set']('isEmptyViewVisible',!0x1),this['set']('isMainErrorViewVisible',!0x1);const _0x2b18d3=new _0x52d3ea(_0x435aa7,{'label':cs(_0x435aa7,'AI_CHAT_HISTORY_HEADING'),'icon':_0xe68f34,'class':'ck-ai-header\x20ck-ai-header_history'});_0xf817a&&(this['resizeButton']=_s(_0x435aa7,this),_0x2b18d3['children']['add'](this['resizeButton'])),this['sectionsView']=new sa(_0x435aa7,[]),this['sectionsView']['delegate'](...oa)['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',_0xe64e5=>!_0xe64e5)]}}),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':[_0x2b18d3,{'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 _0x316002=new _0x4a6391(this['locale'],{'filteredView':this['sectionsView'],'queryView':{'label':cs(this['locale'],'AI_CHAT_HISTORY_SEARCH_LABEL')},'infoView':{'text':{'notFound':{'primary':_0x416794=>cs(this['locale'],'AI_CHAT_HISTORY_SEARCH_NOT_FOUND_PRIMARY',_0x416794),'secondary':cs(this['locale'],'AI_CHAT_HISTORY_SEARCH_NOT_FOUND_SECONDARY')}}}}),_0x3b714a=this['_createErrorView']();return _0x3b714a['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('errorMessage','ck-hidden',_0x479a7b=>!_0x479a7b)]}}),_0x316002['on']('render',()=>{_0x316002['children']['add'](_0x3b714a,0x1);}),_0x316002['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isSearchViewVisible','ck-hidden',_0x5996c4=>!_0x5996c4)]}}),_0x316002;}['_createSkeletonView'](){const _0x3acfeb=new Zn(this['locale'],tr['aiHistory']);return _0x3acfeb['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isLoading','ck-hidden',_0x1e4114=>!_0x1e4114)]}}),_0x3acfeb;}['_createErrorView'](){const _0x1eb054=new Nt(this['locale']),_0x38e08e=new kt(this['locale']);_0x38e08e['set']({'withText':!0x1,'icon':_0x40d9e4,'class':'ck-ai-notification_error__dismiss-button'}),_0x38e08e['bind']('isVisible')['to'](this,'hasItems',_0xe97251=>!!_0xe97251),_0x38e08e['on']('execute',()=>{this['errorMessage']='';});const _0x5dc8d2=this['bindTemplate'];return _0x1eb054['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-notification','ck-ai-notification_error']},'children':[{'tag':'p','children':[{'text':_0x5dc8d2['to']('errorMessage')}]},_0x38e08e]}),_0x1eb054;}['_createEmptyStateView'](){const _0x2b340a=new kt(this['locale']);_0x2b340a['set']({'label':cs(this['locale'],'AI_CHAT_LABEL_NEW_CHAT'),'withText':!0x0,'icon':_0x20b289,'class':'ck-ai-chat__start-conversation\x20'+us}),_0x2b340a['on']('execute',()=>{this['fire']('openChat');});const _0x10eb93=new Nt(this['locale']);return _0x10eb93['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-chat-history__empty',this['bindTemplate']['if']('isEmptyViewVisible','ck-hidden',_0x57f8a7=>!_0x57f8a7)]},'children':[{'tag':'p','attributes':{'class':['ck-ai-chat-history__empty-message']},'children':[cs(this['locale'],'AI_CHAT_HISTORY_EMPTY_MESSAGE')]},_0x2b340a]}),_0x10eb93;}['_createListItemViews'](_0x2f4c77,_0x1252db){const _0x2d16a3=[];for(const _0x38355f of _0x2f4c77){const _0xadac9=new ra(_0x1252db,_0x38355f);_0xadac9['delegate'](...oa)['to'](this),_0x2d16a3['push'](_0xadac9);}return _0x2d16a3;}['updateHistoryItemsWithCategories'](_0x673044){const _0x1779e9=this['locale']||'en',_0x2e0aa5=[];for(const _0x2791ce of _0x673044){const _0x318ca3=this['_createListItemViews'](_0x2791ce['items'],_0x1779e9);_0x2e0aa5['push'](new na(_0x1779e9,{'title':_0x2791ce['title'],'items':_0x318ca3}));}this['sectionsView']['sections']=_0x2e0aa5,this['sectionsView']['items']['clear'](),this['sectionsView']['items']['addMany'](_0x2e0aa5),this['hasItems']=_0x673044['some'](_0x5d3d52=>_0x5d3d52['items']['length']>0x0),this['_refreshSearch']();}['removeHistoryItem'](_0x717042){for(const _0x48c171 of this['sectionsView']['sections']){const _0x3d4770=_0x48c171['getItem'](_0x717042);if(_0x3d4770){if(_0x48c171['removeItem'](_0x3d4770),0x0===_0x48c171['itemsViews']['length']){const _0xfb9df6=this['sectionsView']['sections']['indexOf'](_0x48c171);-0x1!==_0xfb9df6&&(this['sectionsView']['sections']['splice'](_0xfb9df6,0x1),this['sectionsView']['items']['remove'](_0x48c171));}this['hasItems']=this['sectionsView']['sections']['length']>0x0,this['_refreshSearch']();break;}}}['updateItemTitle'](_0x2ebe98,_0x30fe44){for(const _0x14cfcb of this['sectionsView']['sections']){const _0x57db79=_0x14cfcb['getItem'](_0x2ebe98);if(_0x57db79){_0x57db79['updateTitle'](_0x30fe44);break;}}}['updateItemLoadingState'](_0x435c8d,_0x1f8f60,_0x587aee){for(const _0x3e2156 of this['sectionsView']['sections']){const _0x420457=_0x3e2156['getItem'](_0x435c8d);if(_0x420457){_0x420457['updateLoadingState'](_0x1f8f60,_0x587aee);break;}}}['_refreshSearch'](){if(this['hasItems']){const _0x59f163=this['searchView']['queryView']['fieldView']?.['element']?.['value']||'';this['searchView']['search'](_0x59f163);}}}const oa=['showConversationHistory','removeConversation','editConversationTitle','setConversationPinned','selectConversation','openChat','resizeTabs'];class ha extends _0x31818a{static get['requires'](){return[os];}['_historyView'];static get['pluginName'](){return'AIChatHistoryUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x298dac){super(_0x298dac);const _0xbc9c1f=this['context']['plugins']['get']('AITabs');this['_historyView']=new aa(this['context']['locale'],_0xbc9c1f['showResizeButton']),this['_historyView']['delegate'](...oa)['to'](this),_0xbc9c1f['view']['addTab']({'id':'history','buttonLabel':cs(this['context']['locale'],'AI_CHAT_HISTORY_HEADING'),'buttonIcon':_0xe68f34,'order':0x0,'content':this['_historyView']});}['removeHistoryItem'](_0x3d16d8){this['_historyView']['removeHistoryItem'](_0x3d16d8);}['updateItems'](_0x170936){this['_historyView']['updateHistoryItemsWithCategories'](_0x170936);}['updateItemTitle'](_0x31422a,_0xb9b559){this['_historyView']['updateItemTitle'](_0x31422a,_0xb9b559);}['updateItemLoadingState'](_0x2581d7,_0x3bae1c,_0x169306){this['_historyView']['updateItemLoadingState'](_0x2581d7,_0x3bae1c,_0x169306);}['setLoadingSkeleton'](_0x1618a4){this['_historyView']['isLoading']=_0x1618a4;}['showError'](_0x2b1f68){this['_historyView']['errorMessage']=_0x2b1f68;}['hideError'](){this['_historyView']['errorMessage']='';}['setIsMaximized'](_0x243bef){this['_historyView']['isMaximized']=_0x243bef;}}class ca extends ht(){['id'];['createdAt'];constructor({id:_0x5e9f69,title:_0x51690f,createdAt:_0x1d7b57,updatedAt:_0x50ac5b,pinned:_0x6afd2f}){super(),this['id']=_0x5e9f69,this['createdAt']=new Date(_0x1d7b57),this['set']('title',_0x51690f),this['set']('updatedAt',_0x50ac5b?new Date(_0x50ac5b):null),this['set']('pinned',_0x6afd2f||!0x1);}['updateTitle'](_0x1bbfd2){this['set']('title',_0x5b8af7(_0x1bbfd2)),this['updatedAt']=new Date();}['updatePinned'](_0x461c43){this['set']('pinned',_0x461c43),this['updatedAt']=new Date();}}class la extends Et(){['items']=[];['connector'];['group'];constructor({connector:_0x3e4eff,group:_0x2be83c}){super(),this['connector']=_0x3e4eff,this['group']=_0x2be83c;}async['init'](){try{const _0x342e5c=this['connector']['fetchConversations'](this['group']),_0x2c29be=await _0x342e5c['getConversations']();this['loadItems'](_0x2c29be);}catch(_0x10469c){this['fire']('error',{'error':_0x10469c,'operation':'init'});}}['addItem'](_0x312db0){this['items']['push'](_0x312db0);}async['removeItem'](_0x8dffca){const _0xf06f2c=this['items']['findIndex'](_0x24f34b=>_0x24f34b['id']===_0x8dffca);if(-0x1===_0xf06f2c)return!0x1;try{return await this['connector']['deleteConversation'](_0x8dffca)['execute'](),this['items']['splice'](_0xf06f2c,0x1),this['fire']('itemRemoved',{'itemId':_0x8dffca}),!0x0;}catch(_0x1165bf){return this['fire']('error',{'error':_0x1165bf,'operation':'removeItem','itemId':_0x8dffca}),!0x1;}}['getItem'](_0x48ed5d){return this['items']['find'](_0x44ec6b=>_0x44ec6b['id']===_0x48ed5d);}async['updateItemTitle'](_0x453515,_0x4ec960){const _0x314f5a=this['getItem'](_0x453515);if(!_0x314f5a)return!0x1;try{return await this['connector']['updateConversation'](_0x453515,{'title':_0x4ec960})['getResult'](),_0x314f5a['updateTitle'](_0x4ec960),this['fire']('itemUpdated',{'itemId':_0x453515,'updates':{'title':_0x4ec960}}),!0x0;}catch(_0xdc0b68){return this['fire']('error',{'error':_0xdc0b68,'operation':'updateItemTitle','itemId':_0x453515}),!0x1;}}async['updateItemPinned'](_0xbccd1c,_0x5bae00){const _0x33d618=this['getItem'](_0xbccd1c);if(!_0x33d618)return!0x1;try{return await this['connector']['updateConversation'](_0xbccd1c,{'pinned':_0x5bae00})['getResult'](),_0x33d618['updatePinned'](_0x5bae00),this['fire']('itemUpdated',{'itemId':_0xbccd1c,'updates':{'pinned':_0x5bae00}}),!0x0;}catch(_0x1c9bb4){return this['fire']('error',{'error':_0x1c9bb4,'operation':'updateItemPinned','itemId':_0xbccd1c}),!0x1;}}['loadItems'](_0x171851){try{this['items']=[],_0x171851['map'](_0x2985e5=>{this['addItem'](new ca(_0x2985e5));}),this['fire']('itemsLoaded',{'items':[...this['items']]});}catch(_0x7b720d){this['fire']('error',{'error':_0x7b720d,'operation':'loadItems'});}}['getItems'](_0x44f42a={}){const _0x36960d=void 0x0!==_0x44f42a['pinned']&&_0x44f42a['pinned'],_0x338852=_0x44f42a['from']?new Date(_0x44f42a['from']['getFullYear'](),_0x44f42a['from']['getMonth'](),_0x44f42a['from']['getDate']()):null,_0xaa1427=_0x44f42a['to']?new Date(_0x44f42a['to']['getFullYear'](),_0x44f42a['to']['getMonth'](),_0x44f42a['to']['getDate']()):null;return this['items']['filter'](_0x1d9ed8=>{if(_0x1d9ed8['pinned']!==_0x36960d)return!0x1;if(_0xaa1427){const _0x2480d9=new Date(_0x1d9ed8['createdAt']['getFullYear'](),_0x1d9ed8['createdAt']['getMonth'](),_0x1d9ed8['createdAt']['getDate']());return _0x338852?_0x338852['getTime']()===_0xaa1427['getTime']()?_0x2480d9['getTime']()===_0x338852['getTime']():_0x2480d9<_0xaa1427&&_0x2480d9>=_0x338852:_0x2480d9<_0xaa1427;}return!0x0;});}}class ua extends _0x31818a{['_aiConnector'];['_aiChatHistoryUi'];['_aiChatController'];static get['requires'](){return[hs,Qs,ha,os];}static get['pluginName'](){return'AIChatHistoryController';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){this['_aiConnector']=this['context']['plugins']['get'](hs),this['_aiChatHistoryUi']=this['context']['plugins']['get'](ha),this['_aiChatController']=this['context']['plugins']['get'](Qs);const _0xb896e3=this['context']['plugins']['get'](os);try{const _0x43cd8d=this['_aiChatController']['getGroupId']();this['history']=new la({'connector':this['_aiConnector'],'group':_0x43cd8d}),this['listenTo'](this['_aiChatHistoryUi'],'removeConversation',(_0x1fa79e,_0x4070a4)=>{this['_setItemLoading'](_0x4070a4['id'],'remove'),this['_handleRemove'](_0x4070a4['id']);}),this['listenTo'](this['_aiChatHistoryUi'],'editConversationTitle',(_0x18c219,_0x3cc715)=>{this['_setItemLoading'](_0x3cc715['id'],'rename'),this['_handleEditTitle'](_0x3cc715['id'],_0x3cc715['title']);}),this['listenTo'](this['history'],'itemUpdated',(_0x203268,_0x61647)=>{void 0x0!==_0x61647['updates']['title']&&this['_aiChatHistoryUi']['updateItemTitle'](_0x61647['itemId'],_0x61647['updates']['title']),void 0x0!==_0x61647['updates']['pinned']&&this['_updateHistoryItemsUI'](),this['_clearItemLoading'](_0x61647['itemId']);}),this['listenTo'](this['history'],'itemRemoved',(_0x3f2767,_0x370330)=>{this['_aiChatController']['_handleRemovedConversation'](_0x370330['itemId']),this['_aiChatHistoryUi']['removeHistoryItem'](_0x370330['itemId']),this['_clearItemLoading'](_0x370330['itemId']);}),this['listenTo'](this['history'],'itemsLoaded',()=>{this['_updateHistoryItemsUI']();}),this['listenTo'](this['history'],'error',(_0xfbdec8,_0x3a083e)=>{this['_handleHistoryErrorUI'](_0x3a083e['error'],_0x3a083e['operation'],_0x3a083e['itemId']);}),this['listenTo'](this['_aiChatHistoryUi'],'selectConversation',(_0x4cb00a,_0x398de3)=>{this['_handleSelectConversation'](_0x398de3['id']);}),this['listenTo'](this['_aiChatHistoryUi'],'setConversationPinned',(_0x2bdb64,_0x4533c3)=>{const _0x5c69e7=_0x4533c3['pinned']?'pin':'unpin';this['_setItemLoading'](_0x4533c3['id'],_0x5c69e7),this['_handleTogglePin'](_0x4533c3['id'],_0x4533c3['pinned']);}),this['listenTo'](this['_aiChatHistoryUi'],'openChat',()=>{_0xb896e3['view']['activateTab']('chat');}),this['listenTo'](this['_aiChatController'],'change:activeConversation',()=>{this['_updateHistoryItemsUI']();}),_0xb896e3['view']['on']('activateTab:history',()=>{this['_showConversationHistory']();}),this['listenTo'](_0xb896e3,'resizedTabs',(_0x12774e,_0xacdc39)=>{this['_setIsMaximized'](_0xacdc39);}),this['listenTo'](this['_aiChatHistoryUi'],'resizeTabs',()=>{_0xb896e3['resize']();});}catch(_0x4c4ecc){this['_handleHistoryErrorUI'](_0x4c4ecc,'init');}}async['_handleEditTitle'](_0x3ca0f4,_0x1fe722){await this['history']['updateItemTitle'](_0x3ca0f4,_0x1fe722);}async['_handleTogglePin'](_0x353eac,_0x2cfd3a){await this['history']['updateItemPinned'](_0x353eac,_0x2cfd3a);}async['_handleRemove'](_0x1a60ee){await this['history']['removeItem'](_0x1a60ee);}async['_handleSelectConversation'](_0x167d6e){await this['_aiChatController']['loadConversation'](_0x167d6e);}async['_showConversationHistory'](){this['_aiChatHistoryUi']['showError'](''),this['_aiChatHistoryUi']['setLoadingSkeleton'](!0x0),await this['history']['init'](),this['_aiChatHistoryUi']['setLoadingSkeleton'](!0x1);}['_updateHistoryItemsUI'](){const _0x4cdd78=this['_aiChatController']['activeConversation']?.['id'],_0xbd6087=this['_getCategorizedItems']()['map'](_0xa8d36d=>({'title':_0xa8d36d['title'],'items':_0xa8d36d['items']['map'](_0x5e7368=>({'id':_0x5e7368['id'],'title':_0x5e7368['title']||cs(this['context']['locale'],'AI_CHAT_UNTITLED_CONVERSATION'),'createdAt':new Date(_0x5e7368['createdAt'])['toLocaleDateString'](),'active':_0x5e7368['id']===_0x4cdd78,'pinned':_0x5e7368['pinned']}))}));this['_aiChatHistoryUi']['updateItems'](_0xbd6087);}['_setItemLoading'](_0x20d155,_0x14c191){this['_aiChatHistoryUi']['updateItemLoadingState'](_0x20d155,_0x14c191,!0x0);}['_clearItemLoading'](_0x1a0e90){this['_aiChatHistoryUi']['updateItemLoadingState'](_0x1a0e90,null,!0x1);}['_handleHistoryErrorUI'](_0xd5da0a,_0xf40052,_0x557651){const _0x557ee8=this['_generateErrorMessage'](_0xf40052,_0x557651);this['_aiChatHistoryUi']['showError'](_0x557ee8),_0x557651&&this['_clearItemLoading'](_0x557651),this['_aiChatHistoryUi']['setLoadingSkeleton'](!0x1);}['_generateErrorMessage'](_0x971a1a,_0x566184){const _0x20b738=_0x566184?this['history']['getItem'](_0x566184):null,_0x52f0c0=_0x20b738?.['title']||cs(this['context']['locale'],'AI_CHAT_UNTITLED_CONVERSATION');switch(_0x971a1a){case'updateItemTitle':return cs(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_UPDATE_TITLE',_0x52f0c0);case'updateItemPinned':{const _0x5185a3=cs(this['context']['locale'],_0x20b738?.['pinned']?'AI_CHAT_HISTORY_UNPIN_ACTION':'AI_CHAT_HISTORY_PIN_ACTION');return cs(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_UPDATE_PINNED',[_0x5185a3,_0x52f0c0]);}case'removeItem':return cs(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_REMOVE_ITEM',_0x52f0c0);case'init':case'loadItems':return cs(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_LOAD_ITEMS');default:return cs(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_GENERIC');}}['_getCategorizedItems'](){const _0x1a6169=new Date(),_0x43bdd5=new Date(_0x1a6169['getFullYear'](),_0x1a6169['getMonth'](),_0x1a6169['getDate']()),_0x45d558=new Date(_0x43bdd5);_0x45d558['setDate'](_0x45d558['getDate']()-0x1);const _0x3f477c=new Date(_0x43bdd5);_0x3f477c['setDate'](_0x3f477c['getDate']()-0xe);const _0x26e686=this['history']['getItems']({'pinned':!0x0}),_0x381c3d=this['history']['getItems']({'from':_0x43bdd5,'to':_0x43bdd5}),_0x1a8266=this['history']['getItems']({'from':_0x45d558,'to':_0x45d558}),_0x4325c2=this['history']['getItems']({'from':_0x3f477c,'to':_0x45d558}),_0x284936=this['history']['getItems']({'to':_0x3f477c}),_0x52f185=[];return _0x26e686['length']>0x0&&_0x52f185['push']({'title':cs(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_PINNED'),'items':_0x26e686}),_0x381c3d['length']>0x0&&_0x52f185['push']({'title':cs(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_TODAY'),'items':_0x381c3d}),_0x1a8266['length']>0x0&&_0x52f185['push']({'title':cs(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_YESTERDAY'),'items':_0x1a8266}),_0x4325c2['length']>0x0&&_0x52f185['push']({'title':cs(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_LAST_14_DAYS'),'items':_0x4325c2}),_0x284936['length']>0x0&&_0x52f185['push']({'title':cs(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_LATER'),'items':_0x284936}),_0x52f185;}['_setIsMaximized'](_0x337be0){this['_aiChatHistoryUi']['setIsMaximized'](_0x337be0);}}class da extends _0x31818a{static get['requires'](){return[ua,ha];}static get['pluginName'](){return'AIChatHistory';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}class _a extends _0x31818a{static get['requires'](){return[Qs,zs,ia,da];}static get['pluginName'](){return'AIChat';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x658080){super(_0x658080),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 Aa extends kt{['id'];constructor(_0x7dfb12,_0x47fa77){super(_0x7dfb12);const {id:_0xb1b059,type:_0x5a2538,icon:_0x1a9baf}=_0x47fa77;this['id']=_0xb1b059,this['set']({'label':_0x47fa77['label'],'withText':!0x0,'class':'ck-ai-chat-shortcut'}),this['extendTemplate']({'attributes':{'data-cke-ai-shortcut-id':_0x47fa77['id']}}),_0x1a9baf?this['icon']=_0x1a9baf:'chat'===_0x5a2538?this['icon']=_0x353b1b:'review'===_0x5a2538?this['icon']=_0x58f833:'translate'===_0x5a2538&&(this['icon']=_0x4d6fdb);}}class ga extends Nt{['listView'];constructor(_0x375174,_0x199de3){super(_0x375174);const _0x5618d4=_0x199de3['map'](_0x24b3e4=>{const _0x2ac1a5=new Pt(this['locale']),_0x10c14d=new Aa(this['locale'],_0x24b3e4);return _0x2ac1a5['children']['add'](_0x10c14d),_0x10c14d['delegate']('execute')['to'](this),_0x2ac1a5;});this['listView']=new Lt(this['locale']),this['listView']['items']['addMany'](_0x5618d4),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat-shortcuts']},'children':[this['listView']]});}}const Ia='chat-shortcuts';class Ea extends _0x31818a{['_shortcuts'];['_shortcutsView'];['_aiChatUI'];static get['requires'](){return[ia];}static get['pluginName'](){return'AIChatShortcuts';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){this['_aiChatUI']=this['context']['plugins']['get'](ia),this['_shortcuts']=this['context']['config']['get']('ai.chat.shortcuts')??[];const _0x3d63e0=this['context']['plugins']['get']('AIChatController');this['_shortcuts']['length']&&(this['_validateShortcuts'](),this['_aiChatUI']['on']('conversationCreated',()=>{_0x3d63e0['activeConversation']['isFromHistory']||this['_injectShortcuts']();}),this['listenTo'](_0x3d63e0,'interactionStarted',()=>{this['_removeShortcuts']();}));}['_validateShortcuts'](){const _0x2f5c1c=['chat','review','translate'];this['_shortcuts']['forEach'](_0x211635=>{let _0x51a6d4=!0x0;if(_0x211635['id']&&_0x211635['label']&&_0x2f5c1c['includes'](_0x211635['type'])?'chat'===_0x211635['type']&&(_0x51a6d4='string'==typeof _0x211635['prompt']):_0x51a6d4=!0x1,!_0x51a6d4)throw new ot('ai-chat-shortcuts-invalid-config',this['context'],{'shortcut':_0x211635});});}['_injectShortcuts'](){const _0x5da8af=this['context']['plugins']['get'](ia);this['_shortcutsView']=new ga(this['context']['locale'],this['_shortcuts']),this['_shortcutsView']['render'](),_0x5da8af['addFeedItemCustomElement'](this['_shortcutsView']['element'],Ia),this['_shortcutsView']['on']('execute',_0x2224ab=>{const _0x32e57e=_0x2224ab['source']['id'];this['_executeShortcut'](_0x32e57e);});}['_removeShortcuts'](){const _0x345e2a=this['context']['plugins']['get'](ia);_0x345e2a['hasFeedItem'](Ia)&&_0x345e2a['removeFeedItem'](Ia),this['_shortcutsView']?.['destroy']();}['_executeShortcut'](_0x1e3c83){const _0x26d2ff=this['_shortcuts']['find'](_0x2a8f10=>_0x2a8f10['id']===_0x1e3c83),_0x1bfd22=_0x26d2ff['type'];'chat'===_0x1bfd22?this['_runChatShortcut'](_0x26d2ff):'review'===_0x1bfd22?_0x26d2ff['commandId']?this['_runReviewShortcut'](_0x26d2ff):this['_switchTab']('reviewMode'):'translate'===_0x1bfd22&&(_0x26d2ff['language']?this['_runTranslateShortcut'](_0x26d2ff):this['_switchTab']('translate'));}['_switchTab'](_0x2cde97){if(!this['context']['plugins']['has']('AITabs'))throw new ot('ai-chat-shortcuts-ai-tabs-not-found',this['context'],{'tabName':_0x2cde97});this['context']['plugins']['get']('AITabs')['view']['activateTab'](_0x2cde97);}async['_runChatShortcut']({prompt:_0x180080,draftMode:_0x5ecc81,useWebSearch:_0x54e38b=!0x1,useReasoning:_0x1d2851=!0x1,model:_0xe60167}){const _0x230b07=this['context']['plugins']['get']('AIChatController'),_0x263d7f=_0x230b07['activeConversation'];let _0x532ca5;_0x532ca5=_0xe60167?await _0x263d7f['chatModels']['getModel'](_0xe60167):await _0x263d7f['chatModels']['getDefault'](),_0x532ca5&&await _0x263d7f['setModel'](_0x532ca5),_0x263d7f['setWebSearch'](_0x54e38b),_0x263d7f['setReasoning'](_0x1d2851),_0x230b07['addCurrentDocumentToChatContext'](),_0x5ecc81?(this['_aiChatUI']['setPromptInputValue'](_0x180080),this['_aiChatUI']['focusPromptInput'](!0x0)):_0x230b07['sendMessage']({'message':_0x180080});}['_runReviewShortcut']({commandId:_0x295389,model:_0x2e2605,prompt:_0x566146,params:_0x3cc949}){if(!this['context']['plugins']['has']('AIReviewModeUI'))throw new ot('ai-chat-shortcuts-review-mode-not-found',this['context']);this['_switchTab']('reviewMode');const _0x1579d1={'id':_0x295389,'isCustom':'custom'===_0x295389};_0x2e2605&&_0x566146&&(_0x1579d1['args']={'model':_0x2e2605,'prompt':_0x566146}),_0x3cc949&&(_0x1579d1['params']=_0x3cc949),this['context']['plugins']['get']('AIReviewModeUI')['fire']('runReviewCheck',_0x1579d1);}['_runTranslateShortcut']({language:_0x2b8d86}){if(!this['context']['plugins']['has']('AITranslateUI'))throw new ot('ai-chat-shortcuts-translate-not-found',this['context']);this['_switchTab']('translate'),this['context']['plugins']['get']('AITranslateUI')['fire']('runReviewCheck',{'id':_0x2b8d86,'args':{'language':_0x2b8d86}});}}class pa extends _0x1296c1{constructor(_0x7e7553){super(_0x7e7553);const _0x7bda3f=_0x7e7553['plugins']['get']('AITabs')['view'];this['bind']('value')['to'](_0x7bda3f,'isVisible'),this['isEnabled']=!0x0;}['execute'](){const _0xd71303=this['editor']['plugins']['get']('AITabs')['view'];_0xd71303['isVisible']=!_0xd71303['isVisible'];}}class Ta extends _0x4210c9{static get['requires'](){return[os];}static get['pluginName'](){return'AIToggleButtonUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const _0x492bd9=this['editor'];_0x492bd9['commands']['add']('toggleAi',new pa(_0x492bd9)),_0x492bd9['ui']['componentFactory']['add']('toggleAi',()=>{const _0x30ef8b=this['_createAIUIButton'](kt);return _0x30ef8b['set']({'tooltip':!0x0,'class':'ck-ai-toggle-button'}),_0x30ef8b;}),_0x492bd9['ui']['componentFactory']['add']('menuBar:toggleAi',()=>{const _0x2feb95=this['_createAIUIButton'](Kt);return _0x2feb95['set']({'role':'menuitemcheckbox'}),_0x2feb95;});}['_createAIUIButton'](_0x39aca9){const _0x5d1b0a=this['editor'],_0x162d43=_0x5d1b0a['commands']['get']('toggleAi'),_0x1b4c4f=new _0x39aca9(_0x5d1b0a['locale']);return _0x1b4c4f['set']({'label':cs(_0x5d1b0a['locale'],'AI_TOGGLE_BUTTON_LABEL'),'icon':_0x314fa8,'isToggleable':!0x0}),_0x1b4c4f['bind']('isEnabled')['to'](_0x162d43),_0x1b4c4f['bind']('isOn')['to'](_0x162d43,'value',_0x5e7d4d=>!!_0x5e7d4d),this['listenTo'](_0x1b4c4f,'execute',()=>{_0x162d43['execute']();}),_0x1b4c4f;}}const ma=['applySuggestion','insertSuggestion','showNext','showPrevious'];class Ca extends Nt{['_errorView'];constructor(_0x2ab059){super(_0x2ab059),this['set']('_errorMessage',''),this['set']('_isErrorVisible',!0x1);}['showBlockingError'](_0x4e13c2){this['showError'](_0x4e13c2);}['showError'](_0x3f569c){this['_errorView']||(this['_errorView']=this['_createErrorView']()),this['_errorMessage']=_0x3f569c,this['_isErrorVisible']=!0x0;}['hideError'](){this['_isErrorVisible']=!0x1;}['_createErrorView'](){const _0x1624d2=new Nt(this['locale']),_0x54fc6f=new Nt(this['locale']);return _0x54fc6f['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai-suggestion__error-text']},'children':[{'text':this['bindTemplate']['to']('_errorMessage')}]}),_0x1624d2['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__error','ck-ai-balloon-error',this['bindTemplate']['if']('_isErrorVisible','ck-hidden',_0x47facc=>!_0x47facc)]},'children':[_0x54fc6f]}),_0x1624d2;}}const wa=0xa;class fa extends _0x31818a{static get['requires'](){return[zs];}static get['pluginName'](){return'AIBalloon';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['isOpen']=!0x1;['_currentConfig'];['_isUpdatingMarkers']=!0x1;['open'](_0x3d89f8){const {id:_0x24ea8d}=this['_currentConfig']??{};this['_currentConfig']=_0x3d89f8;const {id:_0x2421b7}=this['_currentConfig'];this['isOpen']&&_0x24ea8d===_0x2421b7?this['_updateDialog']():this['_showDialog']();}['close'](){const _0x207a7c=Ys(this['context'])['plugins']['get']('Dialog');_0x207a7c['isOpen']&&this['_currentConfig']&&_0x207a7c['id']===this['_currentConfig']['id']&&_0x207a7c['hide']();}['_updateDialog'](){const _0x5a125a=Ys(this['context'])['plugins']['get']('Dialog'),{icon:_0x2eeef9,title:_0x53d9d9}=this['_currentConfig'];_0x5a125a['view']?.['headerView']&&(_0x5a125a['view']['headerView']['label']=_0x53d9d9,_0x5a125a['view']['headerView']['iconView']&&_0x2eeef9&&(_0x5a125a['view']['headerView']['iconView']['content']=_0x2eeef9)),this['_isUpdatingMarkers']=!0x0,this['_showFakeVisualSelection'](),this['_isUpdatingMarkers']=!0x1,_0x5a125a['view']?.['updatePosition']();}['_showFakeVisualSelection'](){this['context']['plugins']['get'](zs)['showFakeVisualSelection']({'ranges':this['_currentConfig']['ranges'],'id':'balloon','priority':0x64}),window['getSelection']()?.['removeAllRanges']();}['_hideFakeVisualSelection'](){this['context']['plugins']['get'](zs)['hideFakeVisualSelection']('balloon');}['_showDialog'](){const _0x9ce2cf=Ys(this['context'])['plugins']['get']('Dialog'),{id:_0x469872,title:_0x4d9375,icon:_0x43b0e0,class:_0x479451,mainView:_0x41fbca}=this['_currentConfig'];_0x41fbca['delegate'](...ma)['to'](this),_0x9ce2cf['show']({'title':_0x4d9375,'icon':_0x43b0e0,'hasCloseButton':!0x0,'id':_0x469872,'position':this['_calculateDialogPosition']['bind'](this),'className':'ck-ai-balloon\x20'+(_0x479451||''),'content':_0x41fbca,'onShow':_0x451672=>{this['_showFakeVisualSelection'](),this['_setupFakeVisualSelectionMarkerRemovalListener']();const _0x55b1e8=this['_getSelectionElements']();_0x55b1e8&&_0x55b1e8[0x0]&&mt({'target':_0x55b1e8[0x0],'ancestorOffset':0x14,'alignToTop':!0x0,'viewportOffset':{'top':0x14,'bottom':0x14,'left':0x0,'right':0x0}}),this['isOpen']=!0x0,_0x451672['once']('hide',()=>{this['fire']('beforeDialogClosed',{'id':_0x469872});},{'priority':'high'});},'onHide':()=>{this['_hideFakeVisualSelection'](),this['_cleanupFakeVisualSelectionMarkerRemovalListener'](),this['fire']('dialogClosed',{'id':_0x469872}),this['isOpen']=!0x1;}});}['_calculateDialogPosition'](_0x2be6d1,_0x5d6fac){if(!_0x5d6fac)return null;const _0x58827f=this['_getSelectionElements']();if(!_0x58827f||0x0===_0x58827f['length'])return{'left':Math['round'](_0x5d6fac['left']+_0x5d6fac['width']/0x2-_0x2be6d1['width']/0x2),'top':Math['round'](_0x5d6fac['top']+_0x5d6fac['height']/0x2-_0x2be6d1['height']/0x2)};const _0x3d1573=Math['round'](_0x5d6fac['left']+_0x5d6fac['width']/0x2-_0x2be6d1['width']/0x2),_0x9495a1=_0x58827f['map'](_0x1eefc4=>new ut(_0x1eefc4)),_0x3ca737=_0x2be6d1['height'];return{'left':_0x3d1573,'top':this['_calculateOptimalTopPosition'](_0x9495a1,_0x3ca737,_0x5d6fac)};}['_calculateOptimalTopPosition'](_0x379d36,_0x565f94,_0x55779d){const _0x493126=new ut(ct['window']),_0x436965=_0x379d36['map'](_0x282473=>_0x282473['getVisible']())['filter'](_0xa7c9ec=>_0xa7c9ec),_0x36f685=ut['getBoundingRect'](_0x436965);if(!_0x36f685)return Math['round'](_0x55779d['top']+_0x55779d['height']/0x2);const _0x4e3fa0=_0x493126['getIntersection'](_0x36f685);if(!_0x4e3fa0)return Math['round'](_0x55779d['top']+_0x55779d['height']/0x2);const _0x2b893c=_0x55779d['getVisible'](),_0x18d9e3=_0x2b893c&&_0x36f685['height']>_0x2b893c['height'],_0x4a0a31=_0x4e3fa0['top'],_0x5543f3=_0x4e3fa0['bottom'];if(_0x18d9e3){const _0x10f9f5=(_0x2b893c||_0x493126)['height']/0x2-_0x565f94/0x2,_0x391c46=_0x4a0a31-wa-_0x55779d['top'],_0x4873cd=_0x55779d['bottom']-_0x5543f3-wa;return _0x391c46>=_0x565f94?Math['max'](wa,_0x4a0a31-_0x565f94-wa):_0x4873cd>=_0x565f94?_0x5543f3+wa:Math['max'](wa,_0x10f9f5);}const _0x7f184c=_0x4a0a31-_0x565f94,_0x1a353e=_0x55779d['bottom']-_0x5543f3-wa,_0xae42bb=_0x4a0a31-wa-_0x55779d['top'];let _0x54980c;if(_0x1a353e>=_0x565f94)_0x54980c=_0x5543f3+wa;else{if(_0xae42bb>=_0x565f94)_0x54980c=_0x7f184c-wa;else _0x54980c=_0x4a0a31+_0x36f685['height']/0x2-_0x565f94/0x2;}return _0x54980c;}['_setupFakeVisualSelectionMarkerRemovalListener'](){const _0x34e48e=Ys(this['context']);this['listenTo'](_0x34e48e['model']['document'],'change',()=>{if(!this['_isUpdatingMarkers']){for(const {name:_0x1b0113,data:{newRange:_0x1575b1}}of _0x34e48e['model']['document']['differ']['getChangedMarkers']())if(_0x1b0113['startsWith'](Xs+':')&&(_0x1575b1&&(_0x1575b1['start']['isEqual'](_0x1575b1['end'])||'$graveyard'==_0x1575b1['root']['rootName'])||null==_0x1575b1)){const _0x3435e6=cs(this['context']['locale'],'AI_BALLOON_SELECTION_REMOVED_ERROR');this['_currentConfig']['mainView']['showBlockingError'](_0x3435e6),this['fire']('selectionRemoved');}}});}['_cleanupFakeVisualSelectionMarkerRemovalListener'](){const _0x59ddd2=Ys(this['context']);this['_currentConfig']['mainView']['hideError'](),this['stopListening'](_0x59ddd2['model']['document']);}['_getSelectionElements'](){const _0x2d9c29=Ys(this['context']);return _0x592957(_0x2d9c29['editing'],[..._0x2d9c29['model']['markers']['getMarkersGroup']('ai-selection'),..._0x2d9c29['model']['markers']['getMarkersGroup']('ai-balloon-selection')]);}}class Sa extends Ot{['copyButton'];['likeButton'];['dislikeButton'];['showChangesButton'];['_config'];constructor(_0x3d4415,_0x2fd61e={}){super(_0x3d4415),this['set']('isEnabled',!0x0),this['set']('isShowChangesOn',!0x1),this['_config']={'showCopy':!0x1,'showLike':!0x1,'showDislike':!0x1,..._0x2fd61e};const _0x374fee=!(this['_config']['showCopy']||this['_config']['showChanges']||this['_config']['showLike']||this['_config']['showDislike']||this['_config']['customView']?.['length']);this['class']=_0x374fee?'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'](_0x31c66e){this['showChangesButton']['isEnabled']=_0x31c66e;}['_setupRatingButtons'](){this['likeButton']=new kt(this['locale']),this['likeButton']['set']({'icon':_0x264ec0,'label':cs(this['locale'],'AI_MINI_TOOLBAR_LIKE'),'class':ds,'tooltip':!0x0}),this['likeButton']['bind']('isEnabled')['to'](this),this['likeButton']['on']('execute',()=>{this['fire']('like');}),this['dislikeButton']=new kt(this['locale']),this['dislikeButton']['set']({'icon':_0x85ec1e,'label':cs(this['locale'],'AI_MINI_TOOLBAR_DISLIKE'),'class':ds,'tooltip':!0x0}),this['dislikeButton']['bind']('isEnabled')['to'](this),this['dislikeButton']['on']('execute',()=>{this['fire']('dislike');});}['_setupCopyButton'](){this['copyButton']=new kt(this['locale']),this['copyButton']['set']({'icon':_0x12c29b,'label':cs(this['locale'],'AI_MINI_TOOLBAR_COPY'),'class':'ck-ai-mini-toolbar-copy-button\x20'+ds,'tooltip':!0x0}),this['copyButton']['bind']('isEnabled')['to'](this);const _0x4fa46b=new yt();_0x4fa46b['set']({'content':_0x177f85}),_0x4fa46b['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'+ds,setTimeout(()=>{this['copyButton']['class']='ck-ai-mini-toolbar-copy-button\x20'+ds;},0x7d0);}),this['copyButton']['children']['add'](_0x4fa46b);}['_setupShowChangesButton'](){this['showChangesButton']=new kt(this['locale']),this['showChangesButton']['set']({'icon':_0xacb23c,'label':cs(this['locale'],'AI_SUGGESTION_BUTTON_SHOW_CHANGES'),'withText':'full'==this['_config']['showChanges'],'tooltip':'full'!=this['_config']['showChanges'],'class':ds}),this['showChangesButton']['bind']('isOn')['to'](this,'isShowChangesOn'),this['showChangesButton']['bind']('isEnabled')['to'](this),this['showChangesButton']['bind']('icon')['to'](this,'isShowChangesOn',_0x47a27d=>_0x47a27d?_0x5e73e2:_0xacb23c),this['showChangesButton']['on']('execute',()=>{this['fire']('toggleShowChanges');});}}class ba extends Ca{['children'];['nextButtonView'];['previousButtonView'];['focusCycler'];['_focusables'];['_focusTracker'];['_keystrokes'];['_config'];['_streamableContentView'];['_toolbarContainerView'];['_partToolbarView'];['_stateView'];['_miniToolbarView'];constructor(_0x21e040,_0x1eff73){super(_0x21e040);const _0x1d497f=this['bindTemplate'];this['set']('showDiff',!0x1),this['set']('_state','pending'),this['_focusTracker']=new _t(),this['_keystrokes']=new At(),this['_focusables']=this['createCollection'](),this['focusCycler']=new Mt({'focusables':this['_focusables'],'focusTracker':this['_focusTracker'],'keystrokeHandler':this['_keystrokes'],'actions':{'focusPrevious':'shift\x20+\x20tab','focusNext':'tab'}}),this['_config']=_0x1eff73,this['nextButtonView']=this['_createNextButtonView'](),this['previousButtonView']=this['_createPreviousButtonView'](),this['_streamableContentView']=new An(_0x21e040),this['_partToolbarView']=new un(_0x21e040,_0x1eff73['availableActions']),this['_partToolbarView']['delegate']('applySuggestion','insertSuggestion','rejectSuggestion')['to'](this),this['_togglePartToolbarButtonsVisibility'](_0x1eff73),this['_stateView']=new cn(_0x21e040),this['_stateView']['isVisible']=!0x1,this['_miniToolbarView']=new Sa(_0x21e040,{'showChanges':'full'}),this['_miniToolbarView']['bind']('isShowChangesOn')['to'](this,'showDiff'),this['_miniToolbarView']['on']('toggleShowChanges',()=>{this['fire']('toggleSuggestionDisplayMode');}),this['_toolbarContainerView']=new Ra(_0x21e040,[this['_partToolbarView'],this['_stateView'],this['_miniToolbarView']]),this['children']=this['createCollection']([this['_streamableContentView'],this['_toolbarContainerView']]),this['on']('change:_state',(_0x2bd91c,_0x28de9b,_0x240339,_0x12e546)=>{let _0x353dfd,_0x440540;'pending'===_0x12e546?(_0x353dfd=this['_partToolbarView'],_0x440540=this['_stateView']):(_0x353dfd=this['_stateView'],_0x440540=this['_partToolbarView']),this['_stateView']['setState'](_0x240339),_0x353dfd['isVisible']=!0x1,_0x440540['isVisible']=!0x0;}),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat-balloon-main',_0x1d497f['to']('_state',_0x36aabc=>'ck-ai-chat-balloon-main_state_'+_0x36aabc)]},'children':this['children']}),this['on']('change:isTrackChangesOn',()=>{this['_togglePartToolbarButtonsVisibility'](_0x1eff73);});}['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'](_0x1c4b2f){_0x1c4b2f?.['keepErrors']||this['hideError'](),await this['_streamableContentView']['update'](_0x1c4b2f);}['setState'](_0x3642e){this['_state']=_0x3642e;}['showError'](_0x498191){super['showError'](_0x498191),this['children']['has'](this['_errorView'])||this['children']['add'](this['_errorView'],0x0);}['hideError'](){this['_isErrorVisible']&&(super['hideError'](),this['togglePartToolbarEnabled'](!0x0));}['showBlockingError'](_0x4c42a2){super['showBlockingError'](_0x4c42a2),this['togglePartToolbarEnabled'](!0x1);}['toggleRotatorButtonsVisibility'](_0x5025d7){this['nextButtonView']['isVisible']=this['previousButtonView']['isVisible']=_0x5025d7;}['togglePartToolbarEnabled'](_0x977a0a){this['_partToolbarView']['isEnabled']=_0x977a0a;}['_togglePartToolbarButtonsVisibility']({showApplyButton:_0x29077c,showSuggestButton:_0x7b99d3}){_0x29077c=_0x29077c&&!this['isTrackChangesOn']&&this['_config']['availableActions']['includes']('applySuggestion'),_0x7b99d3=_0x7b99d3&&this['_config']['availableActions']['includes']('insertSuggestion'),this['_partToolbarView']['setButtonsVisibility']({'showApplyButton':_0x29077c,'showSuggestButton':_0x7b99d3});}['_createNextButtonView'](){const _0x5f0e8b=new kt(this['locale']);return _0x5f0e8b['set']({'icon':_0x3f0499,'label':cs(this['locale'],'AI_BALLOON_NEXT_LABEL'),'isVisible':!0x0}),_0x5f0e8b['on']('execute',()=>{this['fire']('showNext');}),_0x5f0e8b;}['_createPreviousButtonView'](){const _0x119744=new kt(this['locale']);return _0x119744['set']({'icon':_0x23f2f3,'label':cs(this['locale'],'AI_BALLOON_PREVIOUS_LABEL'),'isVisible':!0x0}),_0x119744['on']('execute',()=>{this['fire']('showPrevious');}),_0x119744;}}class Ra extends Nt{constructor(_0x517d29,_0x1c75af){super(_0x517d29),this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-chat-balloon__toolbar-container']},'children':_0x1c75af});}}class Oa extends _0x4210c9{static get['requires'](){return[Vt,fa];}static get['pluginName'](){return'AIChatBalloon';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['_chatBalloonView'];constructor(_0x177d1c){super(_0x177d1c),this['set']('showDiff',!0x1);}['open'](_0x58fe17){const _0x481bce=this['editor'];this['_chatBalloonView']||(this['_chatBalloonView']=this['_createChatBalloonView']()),_0x481bce['plugins']['get']('AIBalloon')['open']({..._0x58fe17,'id':'aiChatBalloon','class':'ck-ai-chat-balloon','mainView':this['_chatBalloonView']}),this['_toggleRotatorButtonsInDialogHeader'](_0x58fe17['showRotator']),this['_chatBalloonView']['togglePartToolbarEnabled'](!_0x58fe17['areActionsDisabled']),this['_restoreDefaultViewFocus']();}['close'](){this['editor']['plugins']['get']('AIBalloon')['close']();}['updateContent'](_0x24e92f){return this['_chatBalloonView']||(this['_chatBalloonView']=this['_createChatBalloonView']()),this['_chatBalloonView']['updateContent'](_0x24e92f);}['setState'](_0x53df22){this['_chatBalloonView']&&this['_chatBalloonView']['setState'](_0x53df22);}['_createChatBalloonView'](){const _0x5064bc=this['editor'],_0x2fe6e0=_0x5064bc['plugins']['get']('AIBalloon'),_0x3c6586=_0x5064bc['commands']['get']('trackChanges');let _0x246c47=_0x5064bc['config']['get']('ai.availableReplyActions')||[...pn];_0x5064bc['plugins']['has']('TrackChanges')||(_0x246c47=_0x246c47['filter'](_0x1d7962=>'insertSuggestion'!=_0x1d7962));const _0x34f3bc=new ba(_0x5064bc['locale'],{'availableActions':_0x246c47,'showApplyButton':!0x0,'showSuggestButton':!!_0x3c6586});return _0x34f3bc['bind']('showDiff')['to'](this),_0x34f3bc['delegate'](...js)['to'](this),_0x34f3bc['delegate']('showPrevious','showNext')['to'](this),_0x2fe6e0['delegate']('dialogClosed')['to'](this),_0x34f3bc['on']('applySuggestion',this['_restoreDefaultViewFocus']['bind'](this)),_0x34f3bc['on']('insertSuggestion',this['_restoreDefaultViewFocus']['bind'](this)),_0x34f3bc['on']('rejectSuggestion',this['_restoreDefaultViewFocus']['bind'](this)),_0x3c6586&&_0x34f3bc['bind']('isTrackChangesOn')['to'](_0x3c6586,'value'),_0x34f3bc['render'](),_0x34f3bc;}['_toggleRotatorButtonsInDialogHeader'](_0xd68bae){const _0x1f9092=this['editor'],_0x4c7243=_0x1f9092['plugins']['get']('Dialog')['view']['headerView']['children'];this['_chatBalloonView']['toggleRotatorButtonsVisibility'](_0xd68bae),_0x4c7243['has'](this['_chatBalloonView']['previousButtonView'])||(_0x4c7243['addMany']([this['_chatBalloonView']['previousButtonView'],this['_chatBalloonView']['nextButtonView']],0x0),_0x1f9092['plugins']['get']('AIBalloon')['once']('beforeDialogClosed',()=>{_0x4c7243['remove'](this['_chatBalloonView']['previousButtonView']),_0x4c7243['remove'](this['_chatBalloonView']['nextButtonView']);}));}['_restoreDefaultViewFocus'](){this['_chatBalloonView']['focus']();}}class ka extends _0x4210c9{static get['requires'](){return[Ta,Oa,_0x4df9ab];}static get['pluginName'](){return'AIEditorIntegration';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}function Na(_0x332c4f){const {editor:_0x2112ba,action:_0x16b093,withText:_0x9f6126=!0x1,withIcon:_0x6400c0=!0x0,isInDropdown:_0x4ef82f=!0x0,shouldPreventFocus:_0x1981b2=!0x1}=_0x332c4f;return()=>{const _0x43de87=_0x2112ba['locale'],_0x5a4981=new kt(_0x43de87),_0x242e1c=_0x5a4981['bindTemplate'];_0x4ef82f&&_0x5a4981['extendTemplate']({'on':{'mouseenter':_0x242e1c['to'](()=>{_0x1981b2&&_0x1981b2()||_0x5a4981['focus']();})}});const _0x56f6bf=_0x16b093['icon']??_0x16b093['parent']?.['icon'];return _0x5a4981['set']({'label':_0x16b093['label'],'withText':_0x9f6126,'role':'menuitem','icon':_0x6400c0?_0x56f6bf??_0x39f4a5:void 0x0,'tooltip':!_0x9f6126,'class':'ck-ai-quick-actions-button','isEnabled':_0x16b093['isEnabled']}),_0x5a4981['on']('execute',()=>{_0x2112ba['editing']['view']['focus'](),_0x2112ba['commands']['execute']('aiQuickAction',_0x16b093);}),_0x5a4981;};}class va extends _0x5ea5ba{['arrowView'];constructor(_0x453850,_0x13601b){super(_0x453850,_0x13601b);const _0x133bd7=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',_0x172bf4=>String(_0x172bf4)),'data-cke-tooltip-disabled':_0x133bd7['to']('isOn')},'on':{'mouseenter':_0x133bd7['to']('mouseenter')}});}['render'](){super['render'](),this['children']['add'](this['arrowView']);}['_createArrowView'](){const _0x128e47=new yt();return _0x128e47['content']=_0x3c1855,_0x128e47['extendTemplate']({'attributes':{'class':'ck-dropdown-menu-list__nested-menu__button__arrow'}}),_0x128e47;}}class ya extends Lt{['_allListItems'];['_allSearchableItems'];constructor(_0x24c765,_0x1102e0,_0x45fb43){super(_0x24c765),this['_allListItems']=_0x1102e0,this['_allSearchableItems']=_0x45fb43;}['filter'](_0x11ca82){if(!_0x11ca82)return this['items']['clear'](),this['items']['addMany'](this['_allListItems']),this['_clearHighlight'](),{'resultsCount':this['_allListItems']['length'],'totalItemsCount':this['_allListItems']['length']};const _0x4cc353=_0x11ca82['source']['toLowerCase']()['trim'](),_0x4fdc88=this['_allSearchableItems']['filter'](_0x2768b9=>(_0x2768b9['groupLabel']?_0x2768b9['label']+'\x20('+_0x2768b9['groupLabel']+')':_0x2768b9['label'])['toLowerCase']()['includes'](_0x4cc353));return this['items']['clear'](),this['items']['addMany'](_0x4fdc88['sort']((_0x37041c,_0x5a5f8c)=>{const _0x537351=_0x37041c['groupLabel'],_0xc24d86=_0x5a5f8c['groupLabel'];return _0x537351||_0xc24d86?_0x537351?0x1:-0x1:0x0;})['map'](_0x28ff8a=>_0x28ff8a['item'])),this['_highlightQuery'](_0x4cc353,_0x4fdc88),{'resultsCount':_0x4fdc88['length'],'totalItemsCount':this['_allSearchableItems']['length']};}['_highlightQuery'](_0x353ef5,_0x244295){if(!_0x353ef5)return;const _0x13dd3a=new RegExp(_0x29a81f(_0x353ef5),'gi');_0x244295['forEach'](_0x432722=>{_0x432722['highlightViews']&&_0x432722['highlightViews']['forEach'](_0x59c349=>{'function'==typeof _0x59c349['highlightText']&&_0x59c349['highlightText'](_0x13dd3a);});});}['_clearHighlight'](){this['_allSearchableItems']['forEach'](_0x264577=>{_0x264577['highlightViews']&&_0x264577['highlightViews']['forEach'](_0x2f99d2=>{'function'==typeof _0x2f99d2['highlightText']&&_0x2f99d2['highlightText'](null);});});}}const xa='menu',La='menuitem';class Da extends Nt{['_bodyCollection'];['optionsListView'];['_searchTextView']=null;['_allSearchableItems']=[];['children'];['focusTracker'];['keystrokes'];['_focusables'];['focusCycler'];['_openNestedPanels']=new Set();['_hasSearch'];constructor(_0x1126be,_0x5ea9c0,_0x4161c3,_0x42310d,_0x28fd62=!0x1){const _0x2430a6=_0x1126be['locale'];super(_0x2430a6),this['_bodyCollection']=_0x42310d,this['_hasSearch']=_0x28fd62;const _0x2c8041=this['_createListItems'](_0x1126be,_0x5ea9c0,_0x4161c3);this['optionsListView']=new ya(_0x2430a6,_0x2c8041,this['_allSearchableItems']),this['optionsListView']['role']=xa,this['optionsListView']['items']['addMany'](_0x2c8041),this['focusTracker']=new _t(),this['keystrokes']=new At(),_0x28fd62&&(this['_searchTextView']=this['_createSearchTextView']()),this['_focusables']=_0x2c8041,this['focusCycler']=new Mt({'focusables':this['_focusables'],'focusTracker':this['focusTracker'],'keystrokeHandler':this['keystrokes']}),_0x28fd62&&this['_searchTextView']&&this['focusCycler']['chain'](this['_searchTextView']['focusCycler']);const _0x1ad4a3=_0x28fd62&&this['_searchTextView']?[this['_searchTextView']]:[this['optionsListView']];this['children']=new _0x24b273(_0x1ad4a3),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset_all','ck-ai-quick-actions','ck-rounded-corners'],'dir':_0x2430a6['uiLanguageDirection']},'children':this['children']});}['_createSearchTextView'](){return new _0x4a6391(this['locale'],{'filteredView':this['optionsListView'],'queryView':{'label':cs(this['locale'],'AI_QUICK_ACTIONS_SEARCH')},'class':'ck-ai-quick-actions-search','infoView':{'text':{'notFound':{'primary':cs(this['locale'],'AI_QUICK_ACTIONS_SEARCH_NOT_FOUND')}}}});}['_isSearchFocused'](){if(!this['_hasSearch']||!this['_searchTextView']||!this['_searchTextView']['queryView']['fieldView']['element'])return!0x1;const _0x402739=this['_searchTextView']['queryView']['fieldView']['element']['ownerDocument']?.['activeElement'];return this['_searchTextView']['queryView']['fieldView']['element']['contains'](_0x402739);}['_createListItems'](_0x47d3b1,_0x50546e,_0x4c83fb){const _0xa031ef=new _0x24b273();return _0x50546e['forEach'](_0xc1ecdb=>{if('actions'in _0xc1ecdb){const {listItem:_0x45e516}=this['_createActionGroupButton'](_0x47d3b1,_0xc1ecdb,_0x4c83fb);_0xa031ef['add'](_0x45e516),_0xc1ecdb['actions']['forEach'](_0x27a48a=>{this['_createActionButton'](_0x47d3b1,_0x27a48a,_0xc1ecdb['label'],_0xc1ecdb['icon']);const {listItem:_0x1b7867,highlightViews:_0x59a73b}=this['_createSearchResultActionButton'](_0x47d3b1,_0x27a48a,_0xc1ecdb['label'],_0xc1ecdb['icon']);this['_allSearchableItems']['push']({'item':_0x1b7867,'label':_0x27a48a['label'],'groupLabel':_0xc1ecdb['label'],'highlightViews':_0x59a73b});});}else{const {listItem:_0xe43ad5}=this['_createActionButton'](_0x47d3b1,_0xc1ecdb);_0xa031ef['add'](_0xe43ad5);const _0x4b4730=_0xe43ad5['children']['first'];if(_0x4b4730){const {listItem:_0x4c0e61,highlightViews:_0x461d71}=this['_createSearchResultActionButton'](_0x47d3b1,_0xc1ecdb);this['_allSearchableItems']['push']({'item':_0x4c0e61,'label':_0x4b4730['label']||'','highlightViews':_0x461d71});}}}),_0xa031ef;}['_createActionButton'](_0x351c23,_0x1ba1df,_0x360c73,_0x33d13a){const _0x227be4=new Pt(this['locale']);if(_0x360c73&&_0x33d13a){const _0x3368f4=new kt(this['locale']),_0x3665c5=_0x3368f4['bindTemplate'],_0x515f82=new _0x16beb0();_0x515f82['text']=_0x1ba1df['label'];const _0xb2b746=new _0x16beb0();_0xb2b746['text']=_0x360c73;const _0x3618a1=new yt();_0x3618a1['content']=_0x33d13a,_0x3618a1['extendTemplate']({'attributes':{'class':'ck-ai-quick-actions-button__group-icon'}});const _0x450d9e=new Nt(this['locale']);_0x450d9e['setTemplate']({'tag':'span','attributes':{'class':'ck-ai-quick-actions-button_with-group__open-paren'},'children':[{'text':'\x20('}]});const _0x213f1a=new Nt(this['locale']);return _0x213f1a['setTemplate']({'tag':'span','attributes':{'class':'ck-ai-quick-actions-button_with-group__close-paren'},'children':[{'text':')'}]}),_0x3368f4['set']({'label':_0x1ba1df['label']+'\x20('+_0x360c73+')','withText':!0x0,'role':'menuitem','class':'ck-ai-quick-actions-button\x20ck-ai-quick-actions-button_with-group','tooltip':!0x1}),_0x3368f4['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':[_0x515f82,_0x450d9e,_0x3618a1,_0xb2b746,_0x213f1a],'on':{'mouseenter':_0x3665c5['to'](()=>{this['_isSearchFocused']()||_0x3368f4['focus']();}),'click':_0x3665c5['to'](()=>{_0x3368f4['fire']('execute');})}}),_0x3368f4['on']('execute',()=>{_0x351c23['editing']['view']['focus'](),_0x351c23['commands']['execute']('aiQuickAction',_0x1ba1df);}),_0x227be4['children']['add'](_0x3368f4),{'listItem':_0x227be4,'highlightViews':[_0x515f82,_0xb2b746]};}{const _0x3ed65b=new _0x5288db(),_0x2da82f=new kt(this['locale'],_0x3ed65b),_0x4d50b8=_0x2da82f['bindTemplate'],_0x318b6f=_0x1ba1df['icon']??_0x1ba1df['parent']?.['icon'],_0xf4ec9a=void 0x0!==_0x1ba1df['icon'];return _0x2da82f['set']({'label':_0x1ba1df['label'],'withText':!0x0,'role':'menuitem','icon':_0xf4ec9a?_0x318b6f??_0x39f4a5:void 0x0,'tooltip':!0x1,'class':'ck-ai-quick-actions-button'}),_0x2da82f['extendTemplate']({'on':{'mouseenter':_0x4d50b8['to'](()=>{this['_isSearchFocused']()||_0x2da82f['focus']();})}}),_0x2da82f['on']('execute',()=>{_0x351c23['editing']['view']['focus'](),_0x351c23['commands']['execute']('aiQuickAction',_0x1ba1df);}),_0x227be4['children']['add'](_0x2da82f),{'listItem':_0x227be4,'highlightViews':[_0x3ed65b]};}}['_createSearchResultActionButton'](_0x57eb75,_0x3afcba,_0x343c7d,_0x5787b7){return _0x343c7d&&_0x5787b7?this['_createSearchResultGroupedActionButton'](_0x57eb75,_0x3afcba,_0x343c7d,_0x5787b7):this['_createSearchResultIndividualActionButton'](_0x57eb75,_0x3afcba);}['_createSearchResultGroupedActionButton'](_0x9018b2,_0x521f65,_0x3ab39b,_0x125824){const _0x120c6d=new Pt(this['locale']),_0x524fe5=new kt(this['locale']),_0x18e0bf=_0x524fe5['bindTemplate'],{view:_0x516003,highlightView:_0x3ebc0f}=this['_createSearchResultGroupRow'](_0x3ab39b,_0x125824),{view:_0x2e893d,highlightView:_0x397e63}=this['_createSearchResultActionRow'](_0x521f65['label']),_0x46b088=this['_createSearchResultContentView'](_0x516003,_0x2e893d);return _0x524fe5['set']({'label':_0x521f65['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}),_0x524fe5['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':[_0x46b088],'on':{'mouseenter':_0x18e0bf['to'](()=>{this['_isSearchFocused']()||_0x524fe5['focus']();}),'click':_0x18e0bf['to'](()=>{this['_handleSearchResultButtonClick'](_0x524fe5);})}}),this['_setupActionButtonExecution'](_0x524fe5,_0x9018b2,_0x521f65),_0x120c6d['children']['add'](_0x524fe5),{'listItem':_0x120c6d,'highlightViews':[_0x3ebc0f,_0x397e63]};}['_createSearchResultIndividualActionButton'](_0x2f17f7,_0x1c091e){const _0x1e7404=new Pt(this['locale']),_0xbf3405=new _0x5288db(),_0x2f5402=new kt(this['locale'],_0xbf3405),_0x4229b2=_0x2f5402['bindTemplate'];return _0x2f5402['set']({'label':_0x1c091e['label'],'withText':!0x0,'role':'menuitem','icon':void 0x0,'tooltip':!0x1,'class':'ck-ai-quick-actions-button\x20ck-ai-quick-actions-search-result-button'}),_0x2f5402['extendTemplate']({'on':{'mouseenter':_0x4229b2['to'](()=>{this['_isSearchFocused']()||_0x2f5402['focus']();})}}),this['_setupActionButtonExecution'](_0x2f5402,_0x2f17f7,_0x1c091e),_0x1e7404['children']['add'](_0x2f5402),{'listItem':_0x1e7404,'highlightViews':[_0xbf3405]};}['_createSearchResultGroupRow'](_0x13450b,_0x189f9f){const _0x963500=new Nt(this['locale']),_0x563b46=new yt();_0x563b46['content']=_0x189f9f,_0x563b46['extendTemplate']({'attributes':{'class':'ck-ai-quick-actions-button__group-icon'}});const _0x3fd70e=new _0x16beb0();return _0x3fd70e['text']=_0x13450b,_0x963500['setTemplate']({'tag':'div','attributes':{'class':'ck-ai-quick-actions-search-result__group-row'},'children':[_0x563b46,_0x3fd70e]}),{'view':_0x963500,'highlightView':_0x3fd70e};}['_createSearchResultActionRow'](_0x4b72df){const _0x319ceb=new Nt(this['locale']),_0x4df4bc=new _0x16beb0();return _0x4df4bc['text']=_0x4b72df,_0x319ceb['setTemplate']({'tag':'div','attributes':{'class':'ck-ai-quick-actions-search-result__action-row'},'children':[_0x4df4bc]}),{'view':_0x319ceb,'highlightView':_0x4df4bc};}['_createSearchResultContentView'](_0x21f91a,_0x171b03){const _0x59f28a=new Nt(this['locale']);return _0x59f28a['setTemplate']({'tag':'div','attributes':{'class':'ck-ai-quick-actions-search-result__content'},'children':[_0x21f91a,_0x171b03]}),_0x59f28a;}['_setupActionButtonExecution'](_0x30f1c0,_0x159b54,_0x3f1ec0){_0x30f1c0['on']('execute',()=>{_0x159b54['editing']['view']['focus'](),_0x159b54['commands']['execute']('aiQuickAction',_0x3f1ec0);});}['_createActionGroupButton'](_0x1d9b0e,_0x80a26,_0x7d9c27){const _0x172de2=new Pt(this['locale']),_0x3fd713=new _0x5288db(),_0x1a985e=new va(this['locale'],_0x3fd713),_0x27479f=_0x1a985e['bindTemplate'],_0x468ecb=this['_getPanelKeystroke'](_0x7d9c27),_0x432b52=this['_createGroupActionsList'](_0x1d9b0e,_0x80a26['actions'],_0x7d9c27);_0x1a985e['set']({'label':_0x80a26['label'],'withText':!0x0,'role':La,'icon':_0x80a26['icon']??_0x39f4a5,'isEnabled':_0x80a26['actions']['some'](_0x303b6a=>_0x303b6a['isEnabled'])}),_0x1a985e['extendTemplate']({'on':{'mouseenter':_0x27479f['to'](()=>{this['_isSearchFocused']()||_0x1a985e['focus']();})}});const _0x1b71c9=new Qt(this['locale']);return _0x1b71c9['extendTemplate']({'attributes':{'class':['ck','ck-reset_all','ck-ai-quick-actions-group-panel','ck-dropdown-menu__nested-menu__panel']},'on':{'keydown':_0x27479f['to'](_0x3a817e=>{this['_handlePanelKeydown'](_0x3a817e,_0x468ecb,_0x1a985e,_0x1b71c9);})}}),_0x1a985e['bind']('isOn')['to'](_0x1b71c9,'isVisible'),this['_bodyCollection']['add'](_0x1b71c9),_0x1b71c9['content']['add'](_0x432b52),this['_setupGroupMenuBehavior'](_0x1a985e,_0x1b71c9),_0x172de2['children']['add'](_0x1a985e),{'listItem':_0x172de2,'highlightView':_0x3fd713};}['_createGroupActionsList'](_0x250d95,_0x47c9f0,_0x48dda9){const _0x592f92=new Lt(this['locale']);return _0x592f92['extendTemplate']({'attributes':{'class':['ck','ck-reset_all','ck-ai-quick-actions-group-list','ck-dropdown-menu-list']}}),_0x47c9f0['forEach'](_0x41bbfa=>{const _0x3ef610=new Pt(this['locale']),_0x49ea6b=Na({'editor':_0x250d95,'action':_0x41bbfa,'withText':!0x0,'withIcon':!0x1,'isInDropdown':!0x0,'shouldPreventFocus':()=>this['_isSearchFocused']()})();_0x3ef610['children']['add'](_0x49ea6b),_0x48dda9['focusTracker']['add'](_0x49ea6b),_0x592f92['items']['add'](_0x3ef610);}),_0x592f92;}['_setupGroupMenuBehavior'](_0x3b650e,_0x1a045c){const _0x28dd8c=_0x3b650e['bindTemplate'],_0x55ca27=this['_getButtonKeystroke'](_0x3b650e);_0x3b650e['extendTemplate']({'attributes':{'class':['ck-ai-quick-actions-group-button']},'on':{'mouseenter':_0x28dd8c['to'](()=>{this['_showNestedPanel'](_0x1a045c,_0x3b650e);}),'mouseleave':_0x28dd8c['to'](_0x46f0f4=>{const _0xf7fb96=_0x46f0f4['relatedTarget'];this['_isMovingToNestedMenu'](_0xf7fb96,_0x1a045c)||this['_hideNestedPanel'](_0x1a045c);}),'keydown':_0x28dd8c['to'](_0x1e8e0f=>{_0x1e8e0f['key']==_0x55ca27&&(this['_showNestedPanel'](_0x1a045c,_0x3b650e),_0x1a045c['content']['get'](0x0)['focus']());})}}),_0x1a045c['on']('render',()=>{_0x1a045c['element']?.['addEventListener']('mouseleave',_0x4adf00=>{const _0x3af417=_0x4adf00['relatedTarget'];_0x3b650e['element']?.['contains'](_0x3af417)||this['_isMovingToNestedMenu'](_0x3af417,_0x1a045c)||this['_hideNestedPanel'](_0x1a045c);});});}['_showNestedPanel'](_0xed65e8,_0x5593f8){this['_openNestedPanels']['forEach'](_0x2a286a=>{_0x2a286a!==_0xed65e8&&_0x2a286a['isVisible']&&_0x2a286a['hide']();}),_0xed65e8['show'](),_0xed65e8['pin']({'positions':[_0x32ec52['eastSouth']],'target':_0x5593f8['element'],'fitInViewport':!0x0}),this['_openNestedPanels']['add'](_0xed65e8);}['_hideNestedPanel'](_0x26a0ef){_0x26a0ef['hide'](),this['_openNestedPanels']['delete'](_0x26a0ef);}['_hideAllNestedPanels'](){this['_openNestedPanels']['forEach'](_0x5b5ed9=>_0x5b5ed9['hide']()),this['_openNestedPanels']['clear']();}['_isMovingToNestedMenu'](_0x5a31af,_0x531fdb){if(!_0x5a31af)return!0x1;if(_0x531fdb['element']?.['contains'](_0x5a31af))return!0x0;const _0x422500=_0x5a31af;return _0x422500['closest']&&(null!==_0x422500['closest']('.ck-ai-quick-actions-group-panel')||null!==_0x422500['closest']('.ck-ai-quick-actions-group-list')||null!==_0x422500['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'](_0x527ed4){return'rtl'===_0x527ed4['locale']['uiLanguageDirection']?'ArrowRight':'ArrowLeft';}['_getButtonKeystroke'](_0x598692){return'rtl'===_0x598692['locale']['uiLanguageDirection']?'ArrowLeft':'ArrowRight';}['_handlePanelKeydown'](_0x1cf69c,_0x2487b0,_0x30ab4a,_0x11943e){_0x1cf69c['key']==_0x2487b0&&(_0x30ab4a['focus'](),this['_hideNestedPanel'](_0x11943e));}['_handleSearchResultButtonClick'](_0x3691dc){_0x3691dc['fire']('execute');}}function Pa(_0x47791a){const {editor:_0xc8795b,content:_0x505c9e,buttonDefinition:_0xae0a00,bodyCollection:_0x315b34,hasSearch:_0x600bb9=!0x1}=_0x47791a;return()=>{const _0x359c57=_0xc8795b['locale'],_0x387d08=Bt(_0x359c57);_0x387d08['buttonView']['set']({'icon':_0xae0a00['icon']??_0x39f4a5,'label':_0xae0a00['label'],'tooltip':!0x0}),_0x387d08['set']({'class':'ck-ai-quick-actions-dropdown'});const _0x1c84be=new Da(_0xc8795b,_0x505c9e,_0x387d08,_0x315b34,_0x600bb9);return _0x387d08['panelView']['children']['add'](_0x1c84be),_0x600bb9&&_0x387d08['on']('change:isOpen',(_0x53814b,_0x395c71,_0x101db9)=>{if(_0x101db9){if(_0xc8795b['plugins']['has']('AIEditing')){const _0x5e1c4a=_0xc8795b['plugins']['get'](zs),_0x3f72cc=_0xc8795b['model']['document']['selection'],_0x1cb6d7=Array['from'](_0x3f72cc['getRanges']());_0x1cb6d7['length']>0x0&&_0x5e1c4a['showFakeVisualSelection']({'ranges':_0x1cb6d7,'id':'quick-action','priority':0x14});}}else _0xc8795b['plugins']['has']('AIEditing')&&_0xc8795b['plugins']['get'](zs)['hideFakeVisualSelection']('quick-action'),_0x1c84be['resetSearch']();}),_0x387d08;};}const Ha='<task>For\x20given\x20selected\x20part\x20of\x20HTML\x20document\x20you\x20must\x20explain\x20the\x20meaning\x20of\x20it\x27s\x20content\x20clearly\x20and\x20in\x20plain\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).Avoid\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><constraints>1.\x20You\x20MUST\x20NOT\x20perform\x20any\x20edits\x20or\x20modifications\x20on\x20provided\x20document.2.\x20You\x20MUST\x20NOT\x20include\x20document\x20modifications\x20in\x20your\x20response.3.\x20Your\x20message\x20should\x20only\x20include\x20explanation.\x20Do\x20not\x20add\x20any\x20additional\x20text,\x20flattery,\x20questions\x20or\x20followup\x20suggestions.</constraints>',Ma='<task>For\x20the\x20given\x20selected\x20part\x20of\x20an\x20HTML\x20document\x20you\x20must\x20summarize\x20its\x20content\x20in\x20a\x20few\x20sentences,\x20keeping\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><constraints>1.\x20You\x20MUST\x20NOT\x20perform\x20any\x20edits\x20or\x20modifications\x20on\x20the\x20provided\x20document.2.\x20You\x20MUST\x20NOT\x20include\x20document\x20modifications\x20in\x20your\x20response.3.\x20Your\x20message\x20should\x20only\x20include\x20the\x20summary.\x20Do\x20not\x20add\x20any\x20additional\x20text,\x20flattery,\x20questions\x20or\x20followup\x20suggestions.</constraints>',Ua='<task>For\x20the\x20given\x20selected\x20part\x20of\x20an\x20HTML\x20document\x20you\x20must\x20extract\x20and\x20present\x20the\x20key\x20points\x20from\x20its\x20content.</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><constraints>1.\x20You\x20MUST\x20NOT\x20perform\x20any\x20edits\x20or\x20modifications\x20on\x20the\x20provided\x20document.2.\x20You\x20MUST\x20NOT\x20include\x20document\x20modifications\x20in\x20your\x20response.3.\x20Your\x20message\x20should\x20only\x20include\x20the\x20extracted\x20key\x20points.\x20Do\x20not\x20add\x20any\x20additional\x20text,\x20flattery,\x20questions\x20or\x20followup\x20suggestions.</constraints>',Va=/* #__PURE__ -- @preserve */
|
|
28
|
+
((()=>({'chat':'AIChat','action':'AIActions'}))());class Ba extends _0x4210c9{static get['requires'](){return[_0x379bab,hs];}static get['pluginName'](){return'AIQuickActionsUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}async['init'](){const _0x5e83ed=await this['_getDefaultAndCustomActions']();this['_prepareQuickActionsDefinition'](_0x5e83ed),this['_initializeQuickActionsComponentsAndCommands']();}static['getDefaultQuickActions'](_0x5485b9){return function(_0x105096){const _0x34b648=new Intl['DisplayNames'](['en'],{'type':'language'})['of'](_0x105096['uiLanguage']),_0x344f42=_0x34b648||'English',_0x302519=[{'id':'ask-ai','label':cs(_0x105096,'AI_QUICK_ACTIONS_ASK_AI'),'type':'chat','icon':_0x598ed8},{'id':'chat-commands','label':cs(_0x105096,'AI_QUICK_ACTIONS_CHAT_COMMANDS'),'icon':_0x598ed8,'actions':[{'id':'explain','label':cs(_0x105096,'AI_QUICK_ACTIONS_EXPLAIN'),'displayedPrompt':cs(_0x105096,'AI_QUICK_ACTIONS_EXPLAIN'),'prompt':Ha['replace']('%0',_0x344f42),'type':'chat'},{'id':'summarize','label':cs(_0x105096,'AI_QUICK_ACTIONS_SUMMARIZE'),'displayedPrompt':cs(_0x105096,'AI_QUICK_ACTIONS_SUMMARIZE'),'prompt':Ma['replace']('%0',_0x344f42),'type':'chat'},{'id':'highlight-key-points','label':cs(_0x105096,'AI_QUICK_ACTIONS_HIGHLIGHT_KEY_POINTS'),'displayedPrompt':cs(_0x105096,'AI_QUICK_ACTIONS_HIGHLIGHT_KEY_POINTS'),'prompt':Ua['replace']('%0',_0x344f42),'type':'chat'}]},{'id':'improve-writing','label':cs(_0x105096,'AI_QUICK_ACTIONS_IMPROVE_WRITING'),'type':'action','icon':_0x134ca9},{'id':'continue','label':cs(_0x105096,'AI_QUICK_ACTIONS_CONTINUE_WRITING'),'type':'action','icon':_0x3344fe},{'id':'fix-grammar','label':cs(_0x105096,'AI_QUICK_ACTIONS_FIX_GRAMMAR_SPELLING'),'type':'action','icon':_0x59e7d5},{'id':'adjust-length','label':cs(_0x105096,'AI_QUICK_ACTIONS_ADJUST_LENGTH'),'icon':_0x2f582d,'actions':[{'id':'make-shorter','label':cs(_0x105096,'AI_QUICK_ACTIONS_MAKE_SHORTER'),'type':'action'},{'id':'make-longer','label':cs(_0x105096,'AI_QUICK_ACTIONS_MAKE_LONGER'),'type':'action'}]},{'id':'change-tone','label':cs(_0x105096,'AI_QUICK_ACTIONS_CHANGE_TONE'),'icon':_0x196a17,'actions':[{'id':'make-tone-casual','label':cs(_0x105096,'AI_QUICK_ACTIONS_MORE_CASUAL'),'type':'action'},{'id':'make-tone-direct','label':cs(_0x105096,'AI_QUICK_ACTIONS_MORE_DIRECT'),'type':'action'},{'id':'make-tone-friendly','label':cs(_0x105096,'AI_QUICK_ACTIONS_MORE_FRIENDLY'),'type':'action'},{'id':'make-tone-confident','label':cs(_0x105096,'AI_QUICK_ACTIONS_MORE_CONFIDENT'),'type':'action'},{'id':'make-tone-professional','label':cs(_0x105096,'AI_QUICK_ACTIONS_MORE_PROFESSIONAL'),'type':'action'}]},{'id':'translate','label':cs(_0x105096,'AI_QUICK_ACTIONS_TRANSLATE'),'icon':_0x4d6fdb,'actions':[{'id':'translate-to-english','label':cs(_0x105096,'AI_QUICK_ACTIONS_TRANSLATE_ENGLISH'),'type':'action','actionName':'translate','args':{'language':'english'}},{'id':'translate-to-chinese','label':cs(_0x105096,'AI_QUICK_ACTIONS_TRANSLATE_CHINESE'),'type':'action','actionName':'translate','args':{'language':'chinese'}},{'id':'translate-to-spanish','label':cs(_0x105096,'AI_QUICK_ACTIONS_TRANSLATE_SPANISH'),'type':'action','actionName':'translate','args':{'language':'spanish'}},{'id':'translate-to-german','label':cs(_0x105096,'AI_QUICK_ACTIONS_TRANSLATE_GERMAN'),'type':'action','actionName':'translate','args':{'language':'german'}},{'id':'translate-to-french','label':cs(_0x105096,'AI_QUICK_ACTIONS_TRANSLATE_FRENCH'),'type':'action','actionName':'translate','args':{'language':'french'}},{'id':'translate-to-japanese','label':cs(_0x105096,'AI_QUICK_ACTIONS_TRANSLATE_JAPANESE'),'type':'action','actionName':'translate','args':{'language':'japanese'}},{'id':'translate-to-portuguese','label':cs(_0x105096,'AI_QUICK_ACTIONS_TRANSLATE_PORTUGUESE'),'type':'action','actionName':'translate','args':{'language':'portuguese'}},{'id':'translate-to-korean','label':cs(_0x105096,'AI_QUICK_ACTIONS_TRANSLATE_KOREAN'),'type':'action','actionName':'translate','args':{'language':'korean'}},{'id':'translate-to-italian','label':cs(_0x105096,'AI_QUICK_ACTIONS_TRANSLATE_ITALIAN'),'type':'action','actionName':'translate','args':{'language':'italian'}},{'id':'translate-to-russian','label':cs(_0x105096,'AI_QUICK_ACTIONS_TRANSLATE_RUSSIAN'),'type':'action','actionName':'translate','args':{'language':'russian'}}]},{'id':'other','label':cs(_0x105096,'AI_QUICK_ACTIONS_OTHER'),'icon':_0x4a7a5a,'actions':[]}];return _0x302519;}(_0x5485b9);}async['_getDefaultAndCustomActions'](){const _0xd09bc3=Ba['getDefaultQuickActions'](this['editor']['locale']),_0x4b98bc=this['editor']['config']['get']('ai.quickActions.extraCommands')||[];let _0x4fbdd3=[];try{_0x4fbdd3=await new Ks({'connector':this['editor']['plugins']['get']('AIConnector'),'locale':this['editor']['locale']})['getAll']();}catch(_0x4d8669){const _0x31aa40=new ot('ai-quick-actions-models-unable-to-retrieve',this,{'error':_0x4d8669});Tt(_0x31aa40['message']);}finally{const _0x30d0a9=_0x4b98bc['map'](_0x1274d3=>({..._0x1274d3,'type':'chat'===_0x1274d3['type']?'chat':'action','icon':void 0x0}));_0xd09bc3['find'](_0x58d82f=>'other'===_0x58d82f['id'])['actions']['push'](..._0x30d0a9),_0xd09bc3['forEach'](_0x1db3d7=>{if('actions'in _0x1db3d7)_0x1db3d7['actions']['forEach'](_0x3ea9fa=>{if(_0x3ea9fa['isEnabled']=!!_0x4fbdd3['find'](_0x2936a9=>_0x2936a9['id']===_0x3ea9fa['model'])||void 0x0===_0x3ea9fa['model'],!_0x3ea9fa['isEnabled']){const _0x2e6e35=new ot('ai-quick-actions-unavailable-model',this,{'actionId':_0x3ea9fa['id'],'modelId':_0x3ea9fa['model']});Tt(_0x2e6e35['message']);}});else{if(_0x1db3d7['isEnabled']=!!_0x4fbdd3['find'](_0x32ad73=>_0x32ad73['id']===_0x1db3d7['model'])||void 0x0===_0x1db3d7['model'],!_0x1db3d7['isEnabled']){const _0x3766db=new ot('ai-quick-actions-unavailable-model',this,{'actionId':_0x1db3d7['id'],'modelId':_0x1db3d7['model']});Tt(_0x3766db['message']);}}});}return _0xd09bc3;}['_initializeQuickActionsComponentsAndCommands'](){const _0x409a68=new qt(this['editor']['locale']);_0x409a68['attachToDom'](),this['_initializeQuickActionsDropdown'](_0x409a68),this['_initializeQuickActionsMenuBar'](),this['_initializeQuickActionsComponents'](_0x409a68);}['_initializeQuickActionsDropdown'](_0x8f6513){const _0x53dfe3=this['editor']['config']['get']('ai.quickActions.isSearchEnabled')??!0x0;this['editor']['ui']['componentFactory']['add']('aiQuickActions',Pa({'editor':this['editor'],'content':this['_quickActionsDefinition'],'buttonDefinition':{'icon':_0x39f4a5,'label':cs(this['editor']['locale'],'AI_QUICK_ACTIONS_HEADING')},'bodyCollection':_0x8f6513,'hasSearch':_0x53dfe3}));}['_prepareQuickActionsDefinition'](_0x445227){this['_quickActionsDefinition']=_0x445227['map'](_0x3f0459=>{if('actions'in _0x3f0459){const _0x1e9d6a=_0x3f0459;return{..._0x1e9d6a,'actions':_0x1e9d6a['actions']['map'](_0x1b9177=>{const {actions:_0x2297f3,..._0x494150}=_0x1e9d6a;return{..._0x1b9177,'parent':_0x494150};})['filter'](_0x49f91f=>this['_shouldIncludeAction'](_0x49f91f))};}return _0x3f0459;})['filter'](_0x1e73f9=>'actions'in _0x1e73f9?_0x1e73f9['actions']['length']>0x0:this['_shouldIncludeAction'](_0x1e73f9));}['_shouldIncludeAction'](_0x2c33bf){const _0x2cd8ef=this['editor']['config']['get']('ai.quickActions.removeCommands')||[];return this['editor']['plugins']['has'](Va[_0x2c33bf['type']])&&!_0x2cd8ef['includes'](_0x2c33bf['id'])&&!('chat'===_0x2c33bf['type']&&!0x1===this['editor']['config']['get']('ai.chat.context.document.enabled'));}['_initializeQuickActionsComponents'](_0x49daca){this['_quickActionsDefinition']['forEach'](_0x58eafc=>{if('actions'in _0x58eafc){const _0x12b309=Pa({'editor':this['editor'],'content':_0x58eafc['actions'],'buttonDefinition':_0x58eafc,'bodyCollection':_0x49daca});this['editor']['ui']['componentFactory']['add'](_0x58eafc['id'],_0x12b309),_0x58eafc['actions']['forEach'](_0x5a4700=>{const _0x3e2224=Na({'editor':this['editor'],'action':_0x5a4700});this['editor']['ui']['componentFactory']['add'](_0x5a4700['id'],_0x3e2224);});}else{const _0x1b1cc0=Na({'editor':this['editor'],'action':_0x58eafc,'withText':!0x1,'withIcon':!0x0,'isInDropdown':!0x1});this['editor']['ui']['componentFactory']['add'](_0x58eafc['id'],_0x1b1cc0);}});}['_initializeQuickActionsMenuBar'](){this['editor']['ui']['componentFactory']['add']('menuBar:aiQuickActions',_0x2c03c3=>{const _0x477d3a=new Ft(_0x2c03c3),_0x269928=cs(_0x2c03c3,'AI_QUICK_ACTIONS_HEADING');_0x477d3a['buttonView']['set']({'label':_0x269928,'icon':_0x39f4a5});const _0x11cd6e=new Yt(_0x2c03c3);_0x11cd6e['set']({'ariaLabel':_0x269928,'role':'menu'}),this['_quickActionsDefinition']['forEach'](_0x455916=>{if('actions'in _0x455916){const _0x4226f0=_0x455916,_0x5920a1=new $t(_0x2c03c3,_0x477d3a),_0x296fae=new Ft(_0x2c03c3),_0x66f9b8=new Yt(_0x2c03c3);_0x296fae['buttonView']['set']({'label':_0x4226f0['label'],'icon':_0x4226f0['icon']}),_0x4226f0['actions']['forEach'](_0x1b198a=>{const _0x43befa=new $t(_0x2c03c3,_0x296fae),_0x539ed8=new Kt(_0x2c03c3);_0x539ed8['set']({'label':_0x1b198a['label'],'icon':_0x1b198a['icon'],'role':'menuitem','isEnabled':_0x1b198a['isEnabled']}),_0x539ed8['on']('execute',()=>{this['_executeQuickAction'](_0x1b198a);}),_0x539ed8['delegate']('execute')['to'](_0x296fae),_0x43befa['children']['add'](_0x539ed8),_0x66f9b8['items']['add'](_0x43befa);}),_0x296fae['panelView']['children']['add'](_0x66f9b8),_0x5920a1['children']['add'](_0x296fae),_0x11cd6e['items']['add'](_0x5920a1);}else{const _0x26425d=_0x455916,_0xda2441=new $t(_0x2c03c3,_0x477d3a),_0xb7d6cf=new Kt(_0x2c03c3);_0xb7d6cf['set']({'label':_0x26425d['label'],'icon':_0x26425d['icon'],'role':'menuitem','isEnabled':_0x26425d['isEnabled']}),_0xb7d6cf['on']('execute',()=>{this['_executeQuickAction'](_0x26425d);}),_0xb7d6cf['delegate']('execute')['to'](_0x477d3a),_0xda2441['children']['add'](_0xb7d6cf),_0x11cd6e['items']['add'](_0xda2441);}});const _0x51a4c3=Object['values'](Va)['some'](_0xf5300=>this['editor']['plugins']['has'](_0xf5300));return _0x477d3a['set']({'isEnabled':_0x51a4c3}),_0x477d3a['panelView']['children']['add'](_0x11cd6e),_0x477d3a;});}['_executeQuickAction'](_0x17841b){const _0x588351=this['editor'];_0x588351['editing']['view']['focus'](),_0x588351['commands']['execute']('aiQuickAction',_0x17841b);const _0x520a8c=_0x588351['ui']['view']['menuBarView'];_0x520a8c&&_0x520a8c['close']&&_0x520a8c['close']();}}class Ga extends _0x1296c1{['execute'](_0x4fe2c6){switch(this['_expandSelectionIfCollapsed'](),_0x4fe2c6['type']){case'chat':if(!this['editor']['plugins']['has']('AIChat')){const _0x2afda5=cs(this['editor']['locale'],'AI_QUICK_ACTIONS_PLUGIN_NOT_FOUND','AIChat');throw new ot('ai-quick-actions-plugin-not-found',this['editor'],{'errorMessage':_0x2afda5});}this['_handleAIChatAction'](_0x4fe2c6);break;case'action':if(!this['editor']['plugins']['has']('AIActions')){const _0x4ff6f7=cs(this['editor']['locale'],'AI_QUICK_ACTIONS_PLUGIN_NOT_FOUND','AIActions');throw new ot('ai-quick-actions-plugin-not-found',this['editor'],{'errorMessage':_0x4ff6f7});}this['_handleAIActionsAction'](_0x4fe2c6);}}async['_handleAIChatAction'](_0x477fca){const _0xb35d78=this['editor']['plugins']['get']('AIChatController'),_0x2e1bad=this['editor']['plugins']['get']('AITabs')['view'];if(_0x2e1bad['isVisible']||(_0x2e1bad['isVisible']=!0x0),'chat'!==_0x2e1bad['activeTab']&&_0x2e1bad['activateTab']('chat'),'ask-ai'===_0x477fca['id'])_0xb35d78['removeSelectionFromChatContext'](),_0xb35d78['addSelectionToChatContext'](),_0xb35d78['focusPromptInput']();else await _0xb35d78['startConversation'](),_0xb35d78['removeSelectionFromChatContext'](),_0xb35d78['addSelectionToChatContext'](),_0xb35d78['focusPromptInput'](),await _0xb35d78['sendMessage']({'message':_0x477fca['prompt']||_0x477fca['displayedPrompt']||_0x477fca['label'],'attributes':{'quickActionData':{'id':_0x477fca['id']},'displayedPrompt':_0x477fca['displayedPrompt']}});}['_expandSelectionIfCollapsed'](){const _0x5c37f0=this['editor'],_0x40d609=_0x5c37f0['model']['document']['selection'];if(!_0x40d609['isCollapsed'])return;const _0x4b1d77=gt(_0x40d609['getSelectedBlocks']())||_0x5c37f0['model']['schema']['getLimitElement'](_0x40d609);_0x5c37f0['model']['change'](_0x34d649=>{_0x34d649['setSelection'](_0x4b1d77,'in');});}['_handleAIActionsActionLabel'](_0x1e6732){return _0x1e6732['parent']?.['label']&&'other'!==_0x1e6732['parent']?.['id']?_0x1e6732['parent']['label']+':\x20'+_0x1e6732['label']:_0x1e6732['label'];}async['_handleAIActionsAction'](_0x1fee44){const _0x4512a4=this['editor']['plugins']['get']('AIActions'),_0x49bdee=_0x1fee44['prompt']?{'userMessage':_0x1fee44['prompt'],'model':_0x1fee44['model']}:{'actionName':_0x1fee44['actionName']||_0x1fee44['id'],'args':_0x1fee44['args']},_0x29c13d=this['_handleAIActionsActionLabel'](_0x1fee44);await _0x4512a4['executeAction'](_0x49bdee,_0x29c13d,_0x1fee44['icon']);}}class Fa extends _0x4210c9{static get['pluginName'](){return'AIQuickActionsEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const _0xd41a44=this['editor'],_0x4e4fa5=new Ga(this['editor']);if(_0xd41a44['commands']['add']('aiQuickAction',_0x4e4fa5),_0xd41a44['plugins']['has']('AIChat')){const _0x2f77c3=this['editor']['plugins']['get']('AIChatController');_0xd41a44['model']['document']['selection']['on']('change:range',(_0x187f47,_0x1859fe)=>{_0x1859fe['directChange']&&_0x2f77c3['removeSelectionFromChatContext']();});}}}class Ka extends Ls{['updateChangeGroups'](){if(this['parsedMergedContent']=this['parsedContent']['cloneNode'](!0x0),0x0==this['parsedMergedContent']['childNodes']['length'])return void(this['changeGroups']=[]);const _0x544926=this['documentContextContent']['children']['map'](_0x2a34e1=>({'node':_0x2a34e1,'id':ps(_0x2a34e1,'data-id')})),_0xb85005=this['parsedMergedContent']['children']['map'](_0x1499dc=>({'node':_0x1499dc,'id':ps(_0x1499dc,'data-id')||at()})),_0x3adbd9=_0x2077a5(_0x544926,_0xb85005,{'comparator':(_0x49cad2,_0x18055a)=>_0x49cad2['id']==_0x18055a['id'],'oneChangePerToken':!0x0});if(!this['isDone']){for(;_0x3adbd9['length']&&_0x3adbd9[_0x3adbd9['length']-0x1]['removed'];)_0x3adbd9['pop']();}const _0x1ba537=_0x3adbd9['map'](_0x38a8f8=>{const _0x1422f0=_0x38a8f8['added']?'new':_0x38a8f8['removed']?'removed':'modified';return{'node':_0x38a8f8['value'][0x0]['node'],'type':_0x1422f0,'id':_0x38a8f8['value'][0x0]['id']};});this['changeGroups']=[{'changes':_0x1ba537,'state':'pending','index':0x0}];}['_getDifferentChangeGroups'](_0x5210b3,_0x17e242){return _0x17e242;}}class Wa extends Ps{['content'];['version'];['actionName'];['args'];['userMessage'];['model'];['hasError']=!0x1;constructor(_0x746687){super(_0x746687),this['content']=_0x746687['content'],this['version']=_0x746687['version'],this['actionName']=_0x746687['actionName'],this['args']=_0x746687['args'],this['userMessage']=_0x746687['userMessage'],this['model']=_0x746687['model'];}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'](_0x4ce27a){const _0x4b190d=new Ka({'editor':this['editor'],'documentContextContent':this['content'],..._0x4ce27a});return this['replies']['push'](_0x4b190d),_0x4b190d['delegate'](...Ds)['to'](this),this['fire']('replyCreated',_0x4b190d),_0x4b190d;}}class Ya extends Ot{constructor(_0x11ec65,_0x559642=!0x0,_0x49332a=!0x0){super(_0x11ec65),this['set']('isEnabled',!0x1),_0x559642&&(this['applyButton']=this['_createButton'](cs(_0x11ec65,'AI_BALLOON_APPLY_BUTTON'),ls),this['applyButton']['bind']('isEnabled')['to'](this),this['items']['add'](this['applyButton'])),_0x49332a&&(this['suggestButton']=this['_createButton'](cs(_0x11ec65,'AI_BALLOON_SUGGEST_BUTTON'),_0x559642?us:ls),this['suggestButton']['bind']('isEnabled')['to'](this),this['items']['add'](this['suggestButton'])),this['setButtonsVisibility']({'showApplyButton':_0x559642,'showSuggestButton':_0x49332a}),this['extendTemplate']({'attributes':{'class':['ck-ai-balloon__toolbar']}});}['setButtonsVisibility']({showApplyButton:_0x525be8,showSuggestButton:_0x50236c}){this['applyButton']&&(this['applyButton']['isVisible']=_0x525be8),this['suggestButton']&&(this['suggestButton']['isVisible']=_0x50236c);}['_createButton'](_0x135930,_0x272fdd){const _0x302db5=new kt(this['locale']);return _0x302db5['set']({'label':_0x135930,'class':_0x272fdd,'isVisible':!0x0,'withText':!0x0}),_0x302db5;}}class $a extends Nt{constructor(_0x6d92c2){super(_0x6d92c2),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-balloon__disclaimer']},'children':[{'tag':'p','attributes':{'class':['ck','ck-ai-balloon__disclaimer-content']},'children':[{'text':cs(_0x6d92c2,'AI_DISCLAIMER_TEXT')}]}]});}}class qa extends Nt{constructor(_0x5d6b8b){super(_0x5d6b8b),this['set']('isVisible',!0x0);const _0xed3a63=new Rn('small');_0xed3a63['isVisible']=!0x0;const _0x4ef508=new Nt(this['locale']);_0x4ef508['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai-suggestion__loader-text']},'children':[cs(this['locale'],'AI_CHAT_IS_WRITING')]}),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__loader',this['bindTemplate']['if']('isVisible','ck-hidden',_0x38c836=>!_0x38c836)]},'children':[_0xed3a63,_0x4ef508]});}}class Qa extends Ca{['focusCycler'];['_config'];['_contentWrapper'];['_streamableContentView'];['_toolbarView'];['_miniToolbarView'];['_loaderView'];['_disclaimerView'];['_focusTracker'];['_keystrokes'];['_dialogContent'];['_focusables'];['_scrollManager'];['_navigationPreviousButton'];['_navigationNextButton'];['_navigationTryAgainButton'];['_navigationCounter'];constructor(_0x549f8b,_0xb06995){super(_0x549f8b),this['set']('isBusy',!0x1),this['set']('isTrackChangesOn',!0x1),this['set']('_isLoading',!0x1),this['set']('_hasError',!0x1),this['_config']=_0xb06995,this['_focusTracker']=new _t(),this['_keystrokes']=new At(),this['_focusables']=this['createCollection'](),this['focusCycler']=new Mt({'focusables':this['_focusables'],'focusTracker':this['_focusTracker'],'keystrokeHandler':this['_keystrokes'],'actions':{'focusPrevious':'shift\x20+\x20tab','focusNext':'tab'}}),this['_dialogContent']=new _0x24b273(),this['_addContentWrapper'](_0xb06995),this['_addDisclaimerView'](),this['_addToolbar'](_0xb06995),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'](_0xb06995);});}['render'](){super['render']();for(const _0x30e902 of this['_focusables'])this['_focusTracker']['add'](_0x30e902['element']);this['_keystrokes']['listenTo'](this['element']),this['_initializeScrollManager']();}['destroy'](){super['destroy'](),this['_scrollManager']&&this['_scrollManager']['destroy']();}['focus'](_0x1194a3){-0x1===_0x1194a3?this['focusCycler']['focusLast']():this['focusCycler']['focusFirst']();}['setIsLoading'](_0x51d3f8){this['_isLoading']=_0x51d3f8;}['setErrorState'](){this['_hasError']=!0x0,this['_miniToolbarView']['toggleShowChangesEnabled'](!0x1);}['clearErrorState'](){this['_hasError']=!0x1,this['_miniToolbarView']['toggleShowChangesEnabled'](!0x0);}['showError'](_0x42257e){super['showError'](_0x42257e),this['_dialogContent']['has'](this['_errorView'])||this['_dialogContent']['add'](this['_errorView'],0x0);}['hideError'](){super['hideError'](),this['clearErrorState']();}['showBlockingError'](_0x3e6e87){super['showBlockingError'](_0x3e6e87),this['setErrorState']();}['addMiniToolbarItem'](_0x5c8091){this['_miniToolbarView']['items']['has'](_0x5c8091)||this['_miniToolbarView']['items']['add'](_0x5c8091);}['removeMiniToolbarItem'](_0xfba1f){this['_miniToolbarView']['items']['has'](_0xfba1f)&&this['_miniToolbarView']['items']['remove'](_0xfba1f);}['showLoader'](){this['_loaderView']&&(this['_isLoading']=!0x0);}['hideLoader'](){this['_loaderView']&&(this['_isLoading']=!0x1);}['_toggleToolbarButtonsVisibility']({showApplyButton:_0x1aeed3,showSuggestButton:_0x2a48be}){_0x1aeed3=_0x1aeed3&&!this['isTrackChangesOn']&&this['_config']['availableActions']['includes']('applySuggestion'),_0x2a48be=_0x2a48be&&this['_config']['availableActions']['includes']('insertSuggestion'),this['_toolbarView']['setButtonsVisibility']({'showApplyButton':_0x1aeed3,'showSuggestButton':_0x2a48be});}async['updateContent'](_0x4057c2){await this['_streamableContentView']['update'](_0x4057c2);}['clearContent'](){this['_streamableContentView']['clear']();}['_addContentWrapper'](_0x347bfc){this['_contentWrapper']=new Nt(this['locale']),this['_contentWrapper']['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-actions-balloon-content']},'children':[{'tag':'div','attributes':{'class':['ck-ai-actions-balloon-content-wrapper']},'children':[this['_createLoaderView'](),this['_createStreamableContentView']()]},this['_createMiniToolbar'](_0x347bfc['miniToolbarConfig'])]}),this['_dialogContent']['add'](this['_contentWrapper']);}['_addDisclaimerView'](){this['_disclaimerView']=new $a(this['locale']),this['_dialogContent']['add'](this['_disclaimerView']);}['_addToolbar']({showApplyButton:_0x204efb,showSuggestButton:_0xbf625a}){this['_toolbarView']=new Ya(this['locale'],_0x204efb,_0xbf625a),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',(_0x2b569f,_0x330eae,_0x3b708c)=>!(_0x2b569f||_0x330eae||_0x3b708c)),this['_toggleToolbarButtonsVisibility']({'showApplyButton':_0x204efb,'showSuggestButton':_0xbf625a}),this['_dialogContent']['add'](this['_toolbarView']);}['_createMiniToolbar'](_0x1432ee){return this['_miniToolbarView']=new Sa(this['locale'],_0x1432ee),this['_miniToolbarView']['delegate'](...js)['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',(_0x35d4b3,_0x5bd892)=>!(_0x35d4b3||_0x5bd892)),this['_miniToolbarView'];}['_createLoaderView'](){return this['_loaderView']=new qa(this['locale']),this['_loaderView']['bind']('isVisible')['to'](this,'_isLoading'),this['_loaderView'];}['_createStreamableContentView'](){return this['_streamableContentView']=new An(this['locale']),this['_streamableContentView'];}['_setupMiniToolbarButtons'](){const _0xacd207=new kt(this['locale']),_0x4f87a5=new kt(this['locale']),_0x4da3a3=new Xa(this['locale']),_0x228b5e=new kt(this['locale']);_0xacd207['set']({'icon':tt,'label':cs(this['locale'],'AI_ACTIONS_TRY_AGAIN'),'tooltip':!0x0,'class':'ck-ai-custom-action-button\x20'+ds}),_0x4f87a5['set']({'icon':_0x3edf4c,'tooltip':cs(this['locale'],'AI_ACTIONS_PREVIOUS_INTERACTION'),'class':'ck-ai-navigation-button\x20ck-ai-previous-button\x20'+ds}),_0x228b5e['set']({'icon':et,'tooltip':cs(this['locale'],'AI_ACTIONS_NEXT_INTERACTION'),'class':'ck-ai-navigation-button\x20ck-ai-next-button\x20'+ds}),_0xacd207['bind']('isEnabled')['to'](this,'isBusy',_0x3af5e9=>!_0x3af5e9),_0xacd207['on']('execute',()=>{this['fire']('tryAgain');}),_0x4f87a5['bind']('isEnabled')['to'](this,'isBusy',_0x2bf31e=>!_0x2bf31e),_0x4f87a5['on']('execute',()=>{this['fire']('showPrevious');}),_0x228b5e['bind']('isEnabled')['to'](this,'isBusy',_0x14c40e=>!_0x14c40e),_0x228b5e['on']('execute',()=>{this['fire']('showNext');}),this['_navigationPreviousButton']=_0x4f87a5,this['_navigationCounter']=_0x4da3a3,this['_navigationNextButton']=_0x228b5e,this['_navigationTryAgainButton']=_0xacd207;}['updateMiniToolbarButtons'](_0x360ce6,_0x46bc6c){this['_navigationPreviousButton']||this['_setupMiniToolbarButtons']();const _0x1e37e1=_0x360ce6>0x1;if(this['addMiniToolbarItem'](this['_navigationTryAgainButton']),_0x1e37e1){this['addMiniToolbarItem'](this['_navigationPreviousButton']),this['addMiniToolbarItem'](this['_navigationCounter']),this['addMiniToolbarItem'](this['_navigationNextButton']);const _0x138907=_0x360ce6-_0x46bc6c;this['_navigationCounter']['setInteractionCount'](_0x138907+'/'+_0x360ce6),this['_navigationPreviousButton']['isEnabled']=_0x46bc6c<_0x360ce6-0x1,this['_navigationNextButton']['isEnabled']=_0x46bc6c>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'](_0x58f181){this['_isLoading']=_0x58f181;}['resetShowChangesButton'](){this['_miniToolbarView']['isShowChangesOn']=!0x1;}['_initializeScrollManager'](){const _0x2e7b77=this['_getScrollableElement']();_0x2e7b77&&!this['_scrollManager']&&(this['_scrollManager']=new Jn(_0x2e7b77));}['_getScrollableElement'](){return this['_streamableContentView']['element'];}}class Xa extends Nt{constructor(_0x1d9585){super(_0x1d9585);const _0x1dd3ac=this['bindTemplate'];this['set']('interactionCount','1/1'),this['setTemplate']({'tag':'span','attributes':{'class':['ck-ai-interaction-counter']},'children':[{'text':_0x1dd3ac['to']('interactionCount')}]});}['setInteractionCount'](_0x11351d){this['set']('interactionCount',_0x11351d);}}class za extends _0x4210c9{static get['requires'](){return[hs,Vt,zs,fa,_0x55bfdc];}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(_0x420df6){super(_0x420df6),this['_bodyCollection']=new qt(this['editor']['locale']),this['_bodyCollection']['attachToDom'](),this['_aiConnector']=this['editor']['plugins']['get']('AIConnector'),this['set']('isBusy',!0x1),this['_promiseQueue']=new In();}['stopInteraction'](){this['_stopInteraction']();}async['executeAction'](_0x386c0b,_0x22a679,_0x2bcecb){if(this['_stopInteraction'](),this['editor']['plugins']['has']('TableSelection')){if(this['editor']['plugins']['get']('TableSelection')['getSelectedTableCells']()){const {modelFragment:_0x24b5e1,anchorData:_0x4bdb0b}=this['_getExecuteDataInTable']();return this['_executeAction'](_0x386c0b,_0x24b5e1,_0x4bdb0b,_0x22a679,_0x2bcecb);}}const {modelFragment:_0x7b0fc5,anchorData:_0x211162}=this['_getExecuteDataRegular']();return this['_executeAction'](_0x386c0b,_0x7b0fc5,_0x211162,_0x22a679,_0x2bcecb);}async['destroy'](){return this['_stopInteraction'](),this['_bodyCollection']['detachFromDom'](),super['destroy']();}['_createActionsBalloonView'](){const _0x16fd0f=this['editor']['plugins']['has']('TrackChanges');let _0x13ecfa=this['editor']['config']['get']('ai.availableReplyActions')||[...pn];_0x16fd0f||(_0x13ecfa=_0x13ecfa['filter'](_0x3ead7d=>'insertSuggestion'!=_0x3ead7d));const _0x386e81=this['editor']['commands']['get']('trackChanges'),_0x11ae9f=new Qa(this['editor']['locale'],{'showApplyButton':!0x0,'showSuggestButton':_0x16fd0f,'miniToolbarConfig':{'showChanges':'icon'},'availableActions':_0x13ecfa});return _0x11ae9f['bind']('isBusy')['to'](this),_0x386e81&&_0x11ae9f['bind']('isTrackChangesOn')['to'](_0x386e81,'value'),_0x11ae9f['on']('tryAgain',()=>{this['_refreshInteraction']();}),_0x11ae9f['on']('showPrevious',()=>{this['_navigateToPrevious']();}),_0x11ae9f['on']('showNext',()=>{this['_navigateToNext']();}),_0x11ae9f;}['_getExecuteDataRegular'](){const _0x4a1d42=this['editor']['model']['document']['selection'];if(_0x4a1d42['isCollapsed']){const _0x8da938=gt(_0x4a1d42['getSelectedBlocks']())||this['editor']['model']['schema']['getLimitElement'](_0x4a1d42);this['editor']['model']['change'](_0x310d9d=>{_0x310d9d['setSelection'](_0x8da938,'in');});}const _0xf63dac=_0x4a1d42['getFirstRange'](),_0x5e3c8a=this['_wrapWithCommonAncestors'](this['editor']['model']['getSelectedContent'](_0x4a1d42),_0xf63dac['start'],_0xf63dac['end']);this['_copyMarkersToFragment'](_0x5e3c8a,_0x4a1d42,{'isTableSelection':!0x1});const _0x26dd7a=_0x4a1d42['getFirstRange']()['start'],_0x546f7c=new Map();let _0x5ae390=_0x5e3c8a;for(let _0x2140e2=0x0;_0x2140e2<_0x26dd7a['path']['length'];_0x2140e2++)_0x546f7c['set'](_0x5ae390,_0x26dd7a['path'][_0x2140e2]),_0x5ae390=_0x5ae390['getChild'](0x0);return{'modelFragment':_0x5e3c8a,'anchorData':_0x546f7c};}['_getExecuteDataInTable'](){const _0x187052=this['editor']['model']['document']['selection'],_0x4ef0fd=this['editor']['plugins']['get']('TableSelection')['getSelectionAsFragment'](),_0x1c7205=_0x187052['getFirstRange']()['start']['parent']['parent'],_0x5e25be=this['editor']['model']['createRange'](this['editor']['model']['createPositionBefore'](_0x1c7205),this['editor']['model']['createPositionAfter'](_0x1c7205)),_0x4d3af8=this['_wrapWithCommonAncestors'](_0x4ef0fd,_0x5e25be['start'],_0x5e25be['end']);this['_copyMarkersToFragment'](_0x4d3af8,_0x187052,{'isTableSelection':!0x0});const _0x160b07=_0x187052['getFirstRange']()['start'],_0x36124c=new Map();let _0x20c2a2=_0x4d3af8;for(let _0x2b5c8e=0x0;_0x2b5c8e<_0x160b07['path']['length'];_0x2b5c8e++)if(_0x36124c['set'](_0x20c2a2,_0x160b07['path'][_0x2b5c8e]),_0x2b5c8e<_0x160b07['path']['length']-0x1)_0x20c2a2=_0x20c2a2['getChild'](0x0);else{let _0x39efa2=_0x20c2a2['nextSibling'];for(;_0x39efa2;)_0x36124c['set'](_0x39efa2,_0x160b07['path'][_0x2b5c8e]),_0x39efa2=_0x39efa2['nextSibling'];}return{'modelFragment':_0x4d3af8,'anchorData':_0x36124c};}async['_executeAction'](_0x49ea90,_0x1da33f,_0x3b8e9d,_0x40161f,_0x3314a7){const _0x273d0b=this['editor']['plugins']['get'](zs),_0x40fd7c=this['editor']['plugins']['get'](fa),_0x2af949=this['editor']['model']['document']['selection'],_0x2afb3d=await _0x273d0b['modelToDataWithIds'](_0x1da33f),_0x3eee52=this['editor']['model']['document']['version'],_0x49b249=[..._0x2af949['getRanges']()];return this['_actionsBalloonView']||(this['_actionsBalloonView']=this['_createActionsBalloonView']()),this['_clearInteractionHistory'](),this['_clearErrorState'](),this['_balloonShowDiff']=!0x1,this['_actionsBalloonView']['resetShowChangesButton'](),this['_actionsBalloonView']['clearContent'](),_0x40fd7c['open']({'index':0x3e8*Math['random']()%0x3e8,'title':_0x40161f,'icon':_0x3314a7||_0x39f4a5,'mainView':this['_actionsBalloonView'],'class':'ck-ai-actions-balloon','ranges':_0x49b249,'id':'aiActionsBalloon'}),this['_setLoadingState'](),this['stopListening'](this['_actionsBalloonView']),this['stopListening'](_0x40fd7c),this['_interactionParams']={'action':_0x49ea90,'content':_0x2afb3d,'version':_0x3eee52,'aiBalloon':_0x40fd7c,'modelFragment':_0x1da33f,'anchorData':_0x3b8e9d},this['_setupApplyListeners'](),this['listenTo'](_0x40fd7c,'selectionRemoved',()=>{this['_stopInteraction'](),this['_actionsBalloonView']['disableMiniToolbarButtons']();}),this['listenTo'](_0x40fd7c,'dialogClosed',(_0x1d1af2,{id:_0x2c3b8d})=>{if('aiActionsBalloon'===_0x2c3b8d){if(this['_interaction']&&this['_interaction']['replies']['length']>0x0){const _0x279123=this['_interaction']['replies'][this['_interaction']['replies']['length']-0x1],_0x5d897d=_0x279123['changeGroups'][0x0];_0x5d897d&&'pending'===_0x5d897d['state']&&_0x279123['setChangeGroupState'](0x0,'rejected');}this['_stopInteraction'](),this['_clearInteractionHistory'](),this['stopListening'](this['_actionsBalloonView']),this['stopListening'](_0x40fd7c);}}),this['_createInteraction'](_0x2afb3d,_0x3eee52,_0x40fd7c,_0x49ea90);}['_setupApplyListeners'](){if(!this['_interactionParams'])return;const {modelFragment:_0x1a5f3f,anchorData:_0x2376a4}=this['_interactionParams'];this['listenTo'](this['_actionsBalloonView'],'applySuggestion',()=>{this['_applyChanges'](_0x1a5f3f,_0x2376a4,!0x1);}),this['listenTo'](this['_actionsBalloonView'],'insertSuggestion',()=>{this['_applyChanges'](_0x1a5f3f,_0x2376a4,!0x0);});}['_wrapWithCommonAncestors'](_0x5c5dc9,_0x26c20a,_0xdf7922){const _0x4dc9ac=this['editor']['model']['createRange'](_0x26c20a,_0xdf7922)['getCommonAncestor'](),_0x50e5dc=_0x4dc9ac['is']('documentFragment')?[]:_0x4dc9ac['getAncestors']({'includeSelf':!0x0})['slice'](0x1);if(_0x50e5dc['length']){const _0x46a1b2=_0x50e5dc['map'](_0x43ab75=>_0x43ab75['_clone'](!0x1));for(let _0x7f05e=0x1;_0x7f05e<_0x46a1b2['length'];_0x7f05e++)_0x46a1b2[_0x7f05e-0x1]['_appendChild'](_0x46a1b2[_0x7f05e]);return _0x46a1b2[_0x46a1b2['length']-0x1]['_appendChild'](_0x5c5dc9),new _0x8bbd24(_0x46a1b2[0x0]);}return _0x5c5dc9;}['_copyMarkersToFragment'](_0x23e973,_0x18c9c9,_0x2f9930={'isTableSelection':!0x1}){const _0x8e0b11=this['editor']['model'],_0x2bf639=Array['from'](_0x18c9c9['getRanges']()),_0x45cf81=_0x18c9c9['getFirstRange']()['start'];for(const _0x3ab017 of _0x8e0b11['markers']){if(_0x3ab017['name']['startsWith'](Xs)||!_0x3ab017['affectsData'])continue;const _0x2da224=_0x3ab017['getRange']();if(!_0x2bf639['some'](_0x2a7c0e=>_0x2a7c0e['containsRange'](_0x2da224,!0x0)))continue;const _0x16e6f8=this['_regularCalculateMarkerPath'](_0x2da224['start'],_0x45cf81,_0x2f9930['isTableSelection']),_0x46c546=this['_regularCalculateMarkerPath'](_0x2da224['end'],_0x45cf81,_0x2f9930['isTableSelection']),_0x53308a=_0x8e0b11['createPositionFromPath'](_0x23e973,_0x16e6f8),_0xa7643f=_0x8e0b11['createPositionFromPath'](_0x23e973,_0x46c546);if(!_0x53308a['isEqual'](_0xa7643f)){const _0x13bd0d=_0x8e0b11['createRange'](_0x53308a,_0xa7643f);_0x23e973['markers']['set'](_0x3ab017['name'],_0x13bd0d);}}}['_regularCalculateMarkerPath'](_0x463dbe,_0x5a0790,_0x1207b9=!0x1){const _0x49f064=[..._0x463dbe['path']['slice']()];for(let _0x372b4d=0x0;_0x372b4d<Math['max'](_0x5a0790['path']['length'],_0x463dbe['path']['length']);_0x372b4d++){const _0x5e9272=_0x5a0790['path'][_0x372b4d]||0x0,_0x56e7ce=(_0x463dbe['path'][_0x372b4d]||0x0)-_0x5e9272;if(_0x49f064[_0x372b4d]=_0x56e7ce,0x0!==_0x56e7ce&&!_0x1207b9)break;}return _0x49f064;}async['_createInteraction'](_0x1d40ed,_0x55269c,_0x28574d,_0x16d95a){const _0x10523=this['editor'];this['_interactionParams']||(this['_interactionParams']={'action':_0x16d95a,'content':_0x1d40ed,'version':_0x55269c,'aiBalloon':_0x28574d,'modelFragment':this['editor']['model']['getSelectedContent'](this['editor']['model']['document']['selection']),'anchorData':new Map()});const _0x4d7f67=new Wa({'connector':this['_aiConnector'],'editor':_0x10523,'content':_0x1d40ed,'version':_0x55269c,..._0x16d95a});this['_interactions']['push'](_0x4d7f67);const _0x2789a5=(_0x45f35c,_0x1bd3f8=!0x1,_0x5edc76='streaming')=>this['_promiseQueue']['enqueue'](async _0x4c9f2a=>{try{const _0x5969e6=Os({'editor':_0x10523,'changeGroups':_0x45f35c['changeGroups'],'documentContextContent':_0x45f35c['documentContextContent'],'showDiff':_0x1bd3f8,'trimUnchanged':!0x1});_0x5969e6['length']&&await this['_actionsBalloonView']['updateContent']({'part':_0x5969e6[0x0],'renderingStrategy':_0x5edc76,'abortSignal':_0x4c9f2a});}catch(_0x474e8e){if(this['_isAbortError'](_0x474e8e))return;throw _0x474e8e;}});this['_interaction']['on']('replyCreated',(_0x2d77e0,_0x2ed0dd)=>{this['_actionsBalloonView']['hideLoader'](),this['_actionsBalloonView']['startAutoScroll'](),_0x2789a5(_0x2ed0dd)['catch'](_0x56e4c9=>{this['_isAbortError'](_0x56e4c9)||(console['error']('Error\x20updating\x20content\x20in\x20replyCreated:',_0x56e4c9),this['_setErrorState'](_0x4d7f67));});}),this['_interaction']['on']('replyContentUpdated',(_0x181900,_0x3acdc0)=>{_0x2789a5(_0x3acdc0)['catch'](_0xfdf111=>{this['_isAbortError'](_0xfdf111)||(console['error']('Error\x20updating\x20content\x20in\x20replyContentUpdated:',_0xfdf111),this['_setErrorState'](_0x4d7f67));});}),this['_interaction']['on']('interactionFinished',async()=>{try{await this['_clearLoadingState'](),this['_actionsBalloonView']['updateMiniToolbarButtons'](this['_interactions']['length'],this['_currentInteractionIndex']),await this['_promiseQueue']['queueEmptyPromise'];}catch(_0x1e289c){this['_isAbortError'](_0x1e289c)||(console['error']('Error\x20clearing\x20loading\x20state\x20in\x20interactionFinished:',_0x1e289c),this['_setErrorState'](_0x4d7f67));}finally{this['_actionsBalloonView']['stopAutoScroll']();}}),this['listenTo'](this['_actionsBalloonView'],'toggleSuggestionDisplayMode',async(_0x434c65,{showDiff:_0xf5c8ba})=>{try{this['_balloonShowDiff']=_0xf5c8ba;const _0x36e0b6=this['_interaction']['replies'][this['_interaction']['replies']['length']-0x1];_0x36e0b6&&await _0x2789a5(_0x36e0b6,_0xf5c8ba,'static');}catch(_0x58d33e){this['_isAbortError'](_0x58d33e)||(console['error']('Error\x20updating\x20content\x20in\x20toggleSuggestionDisplayMode:',_0x58d33e),this['_setErrorState'](_0x4d7f67));}}),this['_interaction']['on']('replyChangeGroupStateUpdated',(_0x448f7f,{reply:_0x5e61cf})=>{const _0x3a7046={'positiveCount':_0x5e61cf['changeGroups']['filter'](_0x3ea4d0=>'accepted'===_0x3ea4d0['state'])['length'],'totalCount':_0x5e61cf['changeGroups']['length']},_0xcf1ca7=this['_interaction']['actionCallId'],_0x4915ad=this['_interaction']['actionName'];_0x4915ad?this['_aiConnector']['upsertAIActionRating'](_0x4915ad,_0xcf1ca7,_0x3a7046):this['_aiConnector']['upsertCustomAIActionRating'](_0xcf1ca7,_0x3a7046);}),this['_setLoadingState']();try{const _0x1f5204=await this['_interaction']['start']();return this['_actionsBalloonView']['updateMiniToolbarButtons'](this['_interactions']['length'],this['_currentInteractionIndex']),_0x1f5204;}catch(_0x1b6e81){if(this['_isAbortError'](_0x1b6e81))return;this['_actionsBalloonView']['hideLoader'](),this['_setErrorState'](_0x4d7f67);}}['_applyChanges'](_0xf499b1,_0x564e21,_0x361446){const _0x45f2ee=this['editor'];if(_0x361446&&!_0x45f2ee['plugins']['has']('TrackChanges'))throw new ot('ai-no-track-changes',null);const _0x53af17=this['editor']['plugins']['get'](_0x55bfdc),_0x3f44d3=this['_interactions'][this['_interactions']['length']-0x1-this['_currentInteractionIndex']];if(!_0x3f44d3||!_0x3f44d3['replies']['length'])return;const _0x36b865=_0x3f44d3['replies'][_0x3f44d3['replies']['length']-0x1],_0x44b1ff=_0x36b865['changeGroups'];_0x36b865['setChangeGroupState'](0x0,'accepted');let _0x5ac70b=$s({'editor':_0x45f2ee,'reply':_0x36b865,'interaction':_0x3f44d3,'groups':_0x44b1ff,'transform':!0x1,'documentCompare':_0x53af17,'documentCompareOptions':{'anchor':_0x45f2ee['model']['createPositionAt'](_0xf499b1,0x0),'markDeletions':_0x361446}});_0x5ac70b=this['_filterOperationsOutsideRange'](_0x5ac70b,_0x564e21);for(const _0x52d735 of _0x5ac70b)this['_anchorOperation'](_0x564e21,_0x52d735,_0x45f2ee['model']['document']['getRoot']());const _0x580094=_0x3f44d3['getDocumentContext']()['version'],_0x2f4db1=_0x45f2ee['model']['document']['history']['getOperations'](_0x580094),_0x38c239={'document':_0x45f2ee['model']['document'],'useRelations':!0x1,'padWithNoOps':!0x1},_0x4dfa9f=_0x256a0e(_0x5ac70b,_0x2f4db1,_0x38c239)['operationsA'];_0x45f2ee['model']['change'](_0x12ead6=>{if(_0x12ead6['setSelection'](_0x45f2ee['model']['document']['selection']['focus']),_0x361446)_0x45f2ee['plugins']['get']('TrackChangesEditing')['_applyOperationsAsSuggestions'](_0x4dfa9f);else{for(const _0x528bac of _0x4dfa9f)_0x528bac['baseVersion']=_0x45f2ee['model']['document']['version'],qs(_0x45f2ee,_0x528bac),_0x12ead6['batch']['addOperation'](_0x528bac),_0x45f2ee['model']['applyOperation'](_0x528bac);}}),this['editor']['plugins']['get']('AIBalloon')['close']();}['_filterOperationsOutsideRange'](_0x1226dc,_0x394497){return _0x1226dc['filter'](_0x411c0a=>{if('rename'==_0x411c0a['type']){const _0x3fca41=_0x411c0a['position']['nodeAfter'];return!_0x394497['has'](_0x3fca41);}if(_0x411c0a['type']['indexOf']('Attribute')>-0x1){const _0x44321a=_0x411c0a['range']['start']['nodeAfter'];return!_0x394497['has'](_0x44321a);}return!0x0;});}['_anchorOperation'](_0x258b97,_0x271590,_0x45718a){const _0x49ceb0=_0x271590['clone']();for(const _0x537bfe in _0x271590){const _0x57f40b=_0x271590[_0x537bfe];_0x57f40b instanceof _0x132eb5?_0x271590[_0x537bfe]=new _0x132eb5(_0x181e64(_0x57f40b['start']),_0x181e64(_0x57f40b['end'])):_0x57f40b instanceof _0x17c5ae&&(_0x271590[_0x537bfe]=_0x181e64(_0x57f40b));}if(['insert','move','remove','reinsert','split','merge']['includes'](_0x49ceb0['type'])){if(_0x49ceb0['isDocumentOperation']=!0x1,_0x49ceb0['baseVersion']=null,'remove'==_0x49ceb0['type']){const _0x5de493=_0x49ceb0['sourcePosition'],_0x2ab8a4=_0x49ceb0['howMany'];new _0x5d2b40(_0x5de493,_0x2ab8a4)['_execute']();}else _0x49ceb0['_execute']();}function _0x181e64(_0x1a385a){if('$graveyard'==_0x1a385a['root']['rootName'])return _0x1a385a;const _0x1d4714=[];let _0x276625=_0x1a385a['root'];for(let _0x2e0c53=0x0;_0x2e0c53<_0x1a385a['path']['length'];_0x2e0c53++){const _0x21da4a=_0x258b97['get'](_0x276625)||0x0;_0x1d4714[_0x2e0c53]=_0x1a385a['path'][_0x2e0c53]+_0x21da4a,_0x276625=_0x276625['getChildAtOffset'](_0x1a385a['path'][_0x2e0c53]);}return new _0x17c5ae(_0x45718a,_0x1d4714,_0x1a385a['stickiness']);}}['_refreshInteraction'](){if(!this['_interactionParams'])return;this['_interactions']['length']>0x0&&this['_stopInteraction'](),this['_currentInteractionIndex']=0x0,this['_balloonShowDiff']=!0x1;const {action:_0x4737d9,content:_0x25a3ed,version:_0x1528c2,aiBalloon:_0x34cb78}=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'](_0x25a3ed,_0x1528c2,_0x34cb78,_0x4737d9)['catch'](_0x2551fd=>{this['_isAbortError'](_0x2551fd)||console['error']('Error\x20refreshing\x20interaction:',_0x2551fd);});}['_isAbortError'](_0x5246bf){return!!_0x5246bf['message']&&_0x5246bf['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 _0x117461=this['_interactions']['length'];this['_currentInteractionIndex']<_0x117461-0x1&&this['_displayInteractionAtIndex'](this['_currentInteractionIndex']+0x1);}['_navigateToNext'](){this['_currentInteractionIndex']>0x0&&this['_displayInteractionAtIndex'](this['_currentInteractionIndex']-0x1);}async['_displayInteractionAtIndex'](_0x1dc0b4){if(!this['_interactionParams'])return;this['_currentInteractionIndex']=_0x1dc0b4;const _0x52bcdd=this['_interactions'][this['_interactions']['length']-0x1-this['_currentInteractionIndex']];if(!_0x52bcdd)return;if(_0x52bcdd['hasError'])return this['_setErrorState'](_0x52bcdd),void this['_actionsBalloonView']['updateMiniToolbarButtons'](this['_interactions']['length'],this['_currentInteractionIndex']);if(!_0x52bcdd['replies']['length'])return;this['_actionsBalloonView']['hideError'](),this['_interactionParams']&&this['_clearErrorState']();const _0x46067e=_0x52bcdd['replies'][_0x52bcdd['replies']['length']-0x1];if(_0x46067e){const _0x24ca67=this['editor'];try{const _0x38afc2=Os({'editor':_0x24ca67,'changeGroups':_0x46067e['changeGroups'],'documentContextContent':_0x46067e['documentContextContent'],'showDiff':this['_balloonShowDiff'],'trimUnchanged':!0x1});await new Promise(_0x5299dc=>setTimeout(_0x5299dc,0x32)),await this['_actionsBalloonView']['updateContent']({'part':_0x38afc2[0x0],'renderingStrategy':'static','abortSignal':new AbortController()['signal']});}catch(_0x52953b){this['_isAbortError'](_0x52953b)||console['error']('Error\x20updating\x20content\x20during\x20navigation:',_0x52953b);}}this['_actionsBalloonView']['updateMiniToolbarButtons'](this['_interactions']['length'],this['_currentInteractionIndex']);}['_setLoadingState'](){this['_actionsBalloonView']['setIsLoading'](!0x0),this['isBusy']=!0x0;}async['_setErrorState'](_0x318a99){const _0x2b8661=cs(this['editor']['locale'],'AI_ACTIONS_GENERIC_ERROR');this['_actionsBalloonView']['showError'](_0x2b8661),_0x318a99['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 ja extends _0x4210c9{static get['requires'](){return[Ba,Fa,za];}static get['pluginName'](){return'AIQuickActions';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x4945b7){super(_0x4945b7),_0x4945b7['config']['define']('ai.quickActions',{'extraCommands':[],'removeCommands':[],'isSearchEnabled':!0x0});}}class Ja extends Nt{['resultResponseView'];['acceptButtonView'];['dismissButtonView'];['infoButtonView'];['outdatedButtonView'];constructor(_0x146e35,_0xe08ea7){super(_0x146e35),this['id']=_0xe08ea7,this['set']('status','pending'),this['set']('changeId',_0xe08ea7),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',(_0x1560e0,_0x4713cc)=>{_0x4713cc&&_0x4713cc['target']&&'A'===_0x4713cc['target']['tagName']&&_0x4713cc['preventDefault'](),this['fire']('activateChange',{'id':_0xe08ea7,'source':this,'uiInteraction':'click'});}),this['on']('mouseover',()=>{this['fire']('activateChange',{'id':_0xe08ea7,'source':this,'uiInteraction':'hover'});}),this['on']('mouseout',()=>{this['fire']('deactivateChange',{'origin':'panel','id':_0xe08ea7,'source':this});});}['setItemAsActive'](){this['isActive']=!0x0;}['setItemAsInactive'](){this['isActive']=!0x1;}['_createResultResponseView'](){const _0x5a2f0e=new Nt(this['locale']);return _0x5a2f0e['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',_0x1d7190=>!_0x1d7190)]}}),_0x5a2f0e;}['_createAcceptButtonView'](){const _0x3dfe17=new kt(this['locale']);return _0x3dfe17['set']({'label':cs(this['locale'],'AI_REVIEW_MODE_ACCEPT_CHANGE'),'withText':!0x0}),_0x3dfe17['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x2de949=>{this['fire']('acceptChange',{'id':this['changeId']}),_0x2de949['stopPropagation']();})},'attributes':{'class':[this['bindTemplate']['if']('status','ck-hidden',_0x3d4e86=>'pending'!==_0x3d4e86&&'accepted'!==_0x3d4e86),this['bindTemplate']['if']('status',us,_0x54de4=>'pending'===_0x54de4),this['bindTemplate']['if']('status',ds,_0x494fd4=>'pending'!==_0x494fd4),this['bindTemplate']['if']('status','ck-ai_review__check-run-result-status-button',_0x32140f=>'accepted'===_0x32140f)]}}),this['on']('change:status',(_0x44e608,_0x3a9c15,_0x46657f)=>{_0x3dfe17['isEnabled']='pending'===_0x46657f,'accepted'===_0x46657f&&(_0x3dfe17['label']=cs(this['locale'],'AI_REVIEW_MODE_CHECK_STATUS_ACCEPTED'),_0x3dfe17['icon']=_0x177f85);}),_0x3dfe17;}['_createDismissButtonView'](){const _0x5c75d1=new kt(this['locale']);return _0x5c75d1['set']({'label':cs(this['locale'],'AI_REVIEW_MODE_DISMISS_CHANGE'),'withText':!0x0}),_0x5c75d1['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x1c38d0=>{this['fire']('dismissChange',{'id':this['changeId']}),_0x1c38d0['stopPropagation']();})},'attributes':{'class':[ds,this['bindTemplate']['if']('status','ck-hidden',_0x35eb1f=>'pending'!==_0x35eb1f&&'rejected'!==_0x35eb1f),this['bindTemplate']['if']('status','ck-ai_review__check-run-result-dismiss-button',_0x4b06fc=>'pending'===_0x4b06fc),this['bindTemplate']['if']('status','ck-ai_review__check-run-result-status-button',_0x593dac=>'rejected'===_0x593dac)]}}),this['on']('change:status',(_0x78a9b6,_0x57353f,_0x3a9809)=>{_0x5c75d1['isEnabled']='pending'===_0x3a9809,'rejected'===_0x3a9809&&(_0x5c75d1['label']=cs(this['locale'],'AI_REVIEW_MODE_CHECK_STATUS_REJECTED'),_0x5c75d1['icon']=_0x40d9e4);}),_0x5c75d1;}['_createInfoButtonView'](){const _0x1aa8d7=new kt(this['locale']);return _0x1aa8d7['set']({'label':cs(this['locale'],'AI_REVIEW_MODE_LEARN_MORE'),'icon':_0x411b77,'tooltip':!0x0,'isToggleable':!0x0,'role':'menuitemcheckbox','class':ds+'\x20ck-ai_review__check-run-result-info-button\x20ck-hidden'}),_0x1aa8d7['bind']('isOn')['to'](this,'isInfoToggleOn',_0x4c4ba4=>_0x4c4ba4),_0x1aa8d7['on']('execute',()=>{this['isInfoToggleOn']=!this['isInfoToggleOn'];}),_0x1aa8d7;}['_createOutdatedButtonView'](){const _0xa59965=new kt(this['locale']);return _0xa59965['set']({'label':cs(this['locale'],'AI_REVIEW_MODE_CHECK_STATUS_OUTDATED'),'icon':it,'withText':!0x0,'isEnabled':!0x1}),_0xa59965['extendTemplate']({'attributes':{'class':[ds,'ck-ai_review__check-run-result-status-button',this['bindTemplate']['if']('status','ck-hidden',_0x461919=>'outdated'!==_0x461919)],'disabled':'disabled'}}),_0xa59965;}}class Za extends Qt{['resultItemView'];['_pinnedRectIndex']=void 0x0;['_pinnedTargetElement']=void 0x0;['_pinnedTargetChangeId']=void 0x0;constructor(_0x4e730a,_0x3a8ee7){super(_0x4e730a),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']()),_0x3a8ee7['add'](this);}['render'](){super['render'](),this['_setupClickOutsideHandler']();}['updateContent'](_0x4b4592){this['resultItemView']['changeId']=_0x4b4592['id'],this['resultItemView']['resultResponseView']['element']['innerHTML']=_0x4b4592['contentDiffed'];}['showBalloon'](_0x369a71,_0x1d28ff,_0x21fc5d,_0x4bd305,_0x55f42e,_0x1b30ae){const _0x1f3ea9=_0x1d28ff();if(!_0x1f3ea9)return;this['updateContent'](_0x369a71),this['show']();const _0x2b4f56=Array['from'](_0x1f3ea9['getClientRects']())['reverse'](),_0x134591=this['_getPointedRectIndexFromEvent'](_0x21fc5d,_0x2b4f56),_0x5a022a=_0x2b4f56[_0x134591??0x0];'click'===_0x4bd305?(this['isDiffActive']=!0x0,this['pin']({'target':()=>this['_getBestRectPositionOnClick'](_0x1d28ff(),_0x134591,_0x369a71['id'],_0x55f42e,_0x1b30ae)||_0x5a022a})):'hover'===_0x4bd305&&(this['isDiffActive']=!0x1,this['pin']({'target':()=>this['_getBestRectPositionOnHover'](_0x1d28ff(),_0x134591,_0x369a71['id'])||_0x5a022a}));}['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'](){Xt({'emitter':this,'activator':()=>this['isVisible'],'contextElements':()=>{const _0x1d432f=[this['element']];return this['_pinnedTargetElement']&&_0x1d432f['push'](this['_pinnedTargetElement']),_0x1d432f;},'callback':()=>{this['hide'](),this['unpin'](),this['deactivateChange'](),this['_pinnedTargetElement']=void 0x0,this['_pinnedRectIndex']=void 0x0,this['_pinnedTargetChangeId']=void 0x0;}});}['_createContentView'](){const _0x1605e6=new Nt();return this['resultItemView']=new Ja(this['locale'],''),this['resultItemView']['resultResponseView']['extendTemplate']({'attributes':{'class':['ck-content']}}),this['resultItemView']['delegate']('acceptChange','dismissChange')['to'](this),_0x1605e6['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']]}]}),_0x1605e6;}['_getBestRectPositionOnClick'](_0x28cba5,_0x1ea0f7,_0x14d2c7,_0x473a61,_0x25a27c){if(!_0x28cba5)return null;const _0x559881=this['position']['replace']('arrow_',''),_0x3859c7=Array['from'](_0x28cba5['getClientRects']());let _0x5f28e4,_0x70c8b=_0x3859c7['reverse']();return void 0x0!==_0x1ea0f7&&this['_isPinnedRectVisible'](_0x70c8b[_0x1ea0f7],_0x473a61,_0x25a27c)?(_0x5f28e4=_0x70c8b[_0x1ea0f7],this['_pinnedRectIndex']=_0x1ea0f7):this['_isPinnedRectVisible'](_0x70c8b[0x0],_0x473a61,_0x25a27c)&&void 0x0===_0x1ea0f7?_0x5f28e4=_0x70c8b[0x0]:(_0x70c8b='s'==_0x559881[0x0]?[..._0x3859c7]['reverse']():_0x3859c7,_0x70c8b['forEach'](_0x4c50a8=>{this['_isPinnedRectVisible'](_0x4c50a8,_0x473a61,_0x25a27c)&&(_0x5f28e4=_0x4c50a8);})),this['_pinnedTargetChangeId']=_0x14d2c7,this['_pinnedTargetElement']=_0x28cba5,_0x5f28e4||_0x28cba5['getBoundingClientRect']();}['_getBestRectPositionOnHover'](_0x1cc5e2,_0x1a1059,_0x231a9e){if(!_0x1cc5e2)return null;const _0x1e9501=Array['from'](_0x1cc5e2['getClientRects']())['reverse']();if(void 0x0===this['_pinnedRectIndex']&&void 0x0!==_0x1a1059&&this['_pinnedTargetChangeId']!==_0x231a9e)return this['_pinnedRectIndex']=_0x1a1059,this['_pinnedTargetElement']=_0x1cc5e2,this['_pinnedTargetChangeId']=_0x231a9e,_0x1e9501[_0x1a1059];if(void 0x0!==this['_pinnedRectIndex']&&this['_pinnedTargetChangeId']===_0x231a9e){if(_0x1cc5e2!==this['_pinnedTargetElement'])return Array['from'](this['_pinnedTargetElement']['getClientRects']())['reverse']()[this['_pinnedRectIndex']];return _0x1e9501[this['_pinnedRectIndex']];}return void 0x0!==_0x1a1059&&this['_pinnedTargetChangeId']!==_0x231a9e?(this['_pinnedRectIndex']=_0x1a1059,this['_pinnedTargetElement']=_0x1cc5e2,this['_pinnedTargetChangeId']=_0x231a9e,_0x1e9501[_0x1a1059]):_0x1cc5e2['getBoundingClientRect']();}['_getPointedRectIndexFromEvent'](_0x33f94f,_0x37467a){if(_0x33f94f)for(let _0x1cd177=0x0;_0x1cd177<_0x37467a['length'];_0x1cd177++){const _0x186bc1=_0x37467a[_0x1cd177];if(_0x33f94f['clientX']>=_0x186bc1['left']-0x3&&_0x33f94f['clientX']<=_0x186bc1['right']+0x3&&_0x33f94f['clientY']>=_0x186bc1['top']-0x3&&_0x33f94f['clientY']<=_0x186bc1['bottom']+0x3)return _0x1cd177;}}['_isPinnedRectVisible'](_0x2a33cb,_0x47bf8e,_0x15f858){const _0x5e42c7=new ut(_0x2a33cb),_0x474527=_0x47bf8e||document['documentElement'],_0x75f13e=_0x5e42c7['getIntersection'](bt(_0x15f858)),_0x46485c=new ut(_0x474527)['getIntersection'](_0x5e42c7);return!!(_0x75f13e&&_0x46485c&&_0x5e42c7['width']>0x0);}}const to=['getReviewCheckList','runReviewCheck','abortReviewStream','toggleDiff','acceptAllChanges','leaveReviewCoreResultList','activateChange','deactivateChange','acceptChange','dismissChange','learnMore','finishReview','retryReview'];class eo extends _0x31818a{['_mainView'];['_balloonSuggestionView'];['_bodyCollection'];static get['requires'](){return[os];}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x407b73){super(_0x407b73),this['_bodyCollection']=new qt(this['context']['locale']),this['_bodyCollection']['attachToDom'](),this['_mainView']=this['createMainView'](),this['_mainView']['delegate'](...to)['to'](this),this['_balloonSuggestionView']=new Za(this['context']['locale'],this['_bodyCollection']),this['_balloonSuggestionView']['delegate']('acceptChange','dismissChange','deactivateChange')['to'](this);}['init'](){const _0x35fd76=this['context']['plugins']['get']('AITabs');this['registerTab'](_0x35fd76);}['destroy'](){this['_bodyCollection']['detachFromDom'](),super['destroy']();}['setAvailableChecks'](_0x3b6beb){if(!this['_mainView']['reviewCheckListView']['hasChecks']()){const _0xf0b28f=!this['context']['config']['get']('ai.models.showModelSelector');this['_mainView']['reviewCheckListView']['setChecks'](_0x3b6beb,_0xf0b28f);}this['_mainView']['showReviewCheckListView']();}['showReviewCheckList'](){this['fire']('getReviewCheckList');}['showCheckRunResults'](_0x2ce58f){_0x2ce58f&&('error-general'!==_0x2ce58f['status']?'error-chunk'!==_0x2ce58f['status']?this['_mainView']['showReviewCheckResultsView']():this['showChunkErrorView']():this['showGeneralResultsErrorView']());}['showCheckRunResult'](_0x3285e0){this['_mainView']['addCheckRunResult'](_0x3285e0);}['showGeneralResultsErrorView'](){this['_mainView']['showGeneralResultsErrorView']();}['showGeneralReviewCoreErrorView'](_0xa9af1c){this['_mainView']['showGeneralReviewCoreErrorView'](_0xa9af1c??cs(this['context']['locale'],'AI_REVIEW_INITIALIZATION_ERROR_MESSAGE'));}['showChunkErrorView'](){this['_mainView']['showChunkErrorView']();}['setCheckResultTitle'](_0x3b3444,_0x5ef44c){this['_mainView']['reviewCheckResultsView']['setTitle'](_0x3b3444,_0x5ef44c);}['setActiveStateInResults'](_0x4cb9cc){this['_mainView']['reviewCheckResultsView']['getResults']()['forEach'](_0x4dd236=>{_0x4dd236['id']===_0x4cb9cc&&_0x4dd236['setItemAsActive']();});}['resetActiveStateInResults'](){this['_mainView']['reviewCheckResultsView']['getResults']()['forEach'](_0x47593c=>_0x47593c['setItemAsInactive']());}['updateChangeState'](_0x4117a3,_0x2f466d){'accepted'===_0x2f466d||'rejected'===_0x2f466d||'outdated'===_0x2f466d?this['_mainView']['reviewCheckResultsView']['hideResult'](_0x4117a3,_0x2f466d):this['_mainView']['reviewCheckResultsView']['showResult'](_0x4117a3,_0x2f466d);}['showReviewCompletedView'](){this['_mainView']['showReviewCompletedView']();}['showActionsWhenResultIsReady'](){this['_mainView']['showActionsWhenResultIsReady']();}['showNoChangesView'](){this['_mainView']['showNoChangesView']();}['hideActionsWhenResultIsReady'](){this['_mainView']['hideActionsWhenResultIsReady']();}['showChangeBalloon'](_0x238f86,_0x4dba5d,_0x5c6c60,_0x334523,_0x344ed3,_0x3a03fd){this['_balloonSuggestionView']['showBalloon'](_0x238f86,_0x4dba5d,_0x5c6c60,_0x334523,_0x344ed3,_0x3a03fd);}['hideChangeBalloon'](){this['_balloonSuggestionView']['hideBalloon']();}['hideDiffInBalloon'](){this['_balloonSuggestionView']['hideDiffInBalloon']();}['showDiffInBalloon'](){this['_balloonSuggestionView']['showDiffInBalloon']();}['getChangeElement'](_0x551e05){const _0x17f92f=this['_mainView']['reviewCheckResultsView']['getResults']()['find'](_0x35f52f=>_0x35f52f['id']===_0x551e05);return _0x17f92f?_0x17f92f['element']:null;}['deactivateChange'](){this['_balloonSuggestionView']['deactivateChange']();}}class io extends Nt{constructor(_0x20afe4){super(_0x20afe4),this['set']('isVisible',!0x1),this['set']('errorMessage','');const _0x1e76d5=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai_review__general-error-container',_0x1e76d5['if']('isVisible','ck-hidden',_0x2bc929=>!_0x2bc929)]},'children':[{'tag':'p','attributes':{'class':'ck\x20ck-ai-notification\x20ck-ai-notification_error'},'children':[{'text':_0x1e76d5['to']('errorMessage')}]}]});}}class so extends Nt{['reviewCoreHeader'];['generalErrorView'];['reviewCheckListView'];['reviewCheckResultsView'];['reviewCompletedView'];constructor(_0x30a5cf,_0x402f41){super(_0x30a5cf),this['reviewCoreHeader']=_0x402f41['header'],this['generalErrorView']=new io(_0x30a5cf),this['reviewCheckListView']=_0x402f41['list'],this['reviewCheckListView']['delegate'](...to)['to'](this),this['reviewCheckResultsView']=_0x402f41['results'],this['reviewCheckResultsView']['delegate'](...to)['to'](this),this['reviewCompletedView']=_0x402f41['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'](_0x2295d0){this['reviewCheckResultsView']['addResult'](_0x2295d0),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'](_0x33ba23){this['generalErrorView']['set']('isVisible',!0x0),this['generalErrorView']['errorMessage']=_0x33ba23;}['showGeneralResultsErrorView'](){this['reviewCheckResultsView']['set']('isLoading',!0x1),this['showActionsWhenResultIsReady'](),this['reviewCheckResultsView']['showGeneralErrorMessage']();}['showChunkErrorView'](){this['reviewCheckResultsView']['set']('isLoading',!0x1),this['showActionsWhenResultIsReady'](),this['reviewCheckResultsView']['showChunkErrorMessage']();}}class no extends kt{constructor(_0x201e6a,_0x261e57){super(_0x261e57),this['set']({'label':_0x201e6a,'withText':!0x0,'class':ls}),this['on']('execute',()=>{this['fire']('finishReview');});}}class ro extends Pt{['_resultViews'];['_resultsHeader'];['reviewDisclaimer'];['_cancelButtonView'];['_acceptAllButtonView'];['_exitReviewButtonView'];['_toggleDiffButtonView'];['_errorMessageView'];['_finishReviewButtonView'];['_contents'];constructor(_0x3138ea,_0x57d00a){super(_0x3138ea),this['_contents']=_0x57d00a,this['_resultViews']=new _0x24b273(),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['_errorMessageView']=this['_createErrorView'](),this['reviewDisclaimer']=new ta(_0x3138ea),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 _0x2c3590=this['_createCombinedSkeletonLoader'](),_0x34e45c=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-run',_0x34e45c['if']('isLoading','ck-ai_review__check-run_loading',_0x17c1f7=>_0x17c1f7),_0x34e45c['if']('isResultReady','ck-ai_review__check-run_ready',_0x44e91b=>_0x44e91b),_0x34e45c['if']('isVisible','ck-hidden',_0x5362aa=>!_0x5362aa)]},'children':[this['_resultsHeader'],{'tag':'div','attributes':{'class':['ck-ai_review__check-run-results-wrapper']},'children':[this['_errorMessageView'],{'tag':'div','attributes':{'class':['ck-ai_review__check-run-results-container','ck-reset_all-excluded',this['bindTemplate']['if']('isLoading','ck-hidden',_0x2557ec=>_0x2557ec)]},'children':this['_resultViews']},_0x2c3590]},this['reviewDisclaimer']]});}['clearResults'](){this['_resultViews']['clear']();}['getResults'](){return this['_resultViews'];}['addResult'](_0x48c023){const _0x3431db=new Ja(this['locale'],_0x48c023['id']);_0x3431db['delegate']('acceptChange','dismissChange','activateChange','deactivateChange')['to'](this),this['_resultViews']['add'](_0x3431db),_0x3431db['resultResponseView']['element']['innerHTML']=_0x48c023['contentDiffed'];}['hideResult'](_0x30bd0a,_0x26afc6){if('pending'===_0x26afc6)return;const _0x35ba4a=this['_resultViews']['find'](_0x142870=>_0x142870['id']===_0x30bd0a);_0x35ba4a&&(_0x35ba4a['status']=_0x26afc6,_0x35ba4a['element']?.['classList']['add']('ck-ai_review__check-run-result_grayout'));}['showResult'](_0x1522e6,_0x3149c3){if('pending'!==_0x3149c3)return;const _0x1da2c5=this['_resultViews']['find'](_0x6a21fc=>_0x6a21fc['id']===_0x1522e6);_0x1da2c5&&(_0x1da2c5['status']=_0x3149c3,_0x1da2c5['element']?.['classList']['remove']('ck-ai_review__check-run-result_grayout'));}['setTitle'](_0x369919,_0x56425a){this['headerTitle']=_0x369919,this['headerSubtitle']=_0x56425a||'';}['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 Zn(this['locale'],tr['aiReviewChecks']);}['_createCombinedSkeletonLoader'](){const _0x491ceb=new Nt(this['locale']),_0x18bf9d=[];for(let _0x43ff4f=0x0;_0x43ff4f<0x10;_0x43ff4f++){const _0x526733=this['_createSkeletonLoader']();_0x526733['extendTemplate']({'attributes':{'class':['ck-ai_review__check-run-skeleton-item']}}),_0x18bf9d['push'](_0x526733);}return _0x491ceb['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-run-skeleton-container',this['bindTemplate']['if']('isLoading','ck-hidden',_0x459a60=>!_0x459a60)]},'children':_0x18bf9d}),_0x491ceb;}['_createErrorView'](){const _0xb95b57=new Nt(this['locale']),_0x3cabf6=new kt(this['locale']),t=this['locale']['t'];return _0xb95b57['delegate']('retryReview')['to'](this),_0x3cabf6['set']({'label':t('Try\x20again'),'withText':!0x0,'class':us+'\x20ck-ai_review__check-run-error-retry-button'}),_0x3cabf6['on']('execute',()=>{this['fire']('retryReview');}),_0xb95b57['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-run-error-container',this['bindTemplate']['if']('showErrorMessage','ck-hidden',_0x4761fe=>!_0x4761fe),this['bindTemplate']['if']('errorType','ck-ai_review__check-run-error-container_border-bottom',_0xf4d1ad=>'chunk'===_0xf4d1ad)]},'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',_0x281791=>'chunk'===_0x281791)]},'children':[{'tag':'p','attributes':{'class':['ck-ai-notification__content',this['bindTemplate']['if']('errorType','ck-hidden',_0x58523c=>'general'!==_0x58523c)]},'children':[{'text':this['_contents']['generalErrorText']}]},{'tag':'p','attributes':{'class':['ck-ai-notification__content',this['bindTemplate']['if']('errorType','ck-hidden',_0x2d2bfe=>'chunk'!==_0x2d2bfe)]},'children':[{'text':cs(this['locale'],'AI_REVIEW_MODE_CHUNK_ERROR_MESSAGE')}]}]},_0x3cabf6]}),_0xb95b57;}['_createCancelButtonView'](){const _0x4eaf84=new kt(this['locale']);return _0x4eaf84['set']({'label':cs(this['locale'],'AI_REVIEW_MODE_STOP_GENERATING'),'withText':!0x0,'class':[us+'\x20ck-ai-button-stop-generating'],'icon':_0x2ffb29}),_0x4eaf84['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isResultReady','ck-hidden',_0x288f65=>_0x288f65),this['bindTemplate']['if']('isCompleted','ck-hidden',_0x1f5074=>_0x1f5074)]}}),_0x4eaf84['on']('execute',()=>{this['fire']('abortReviewStream');}),_0x4eaf84;}['_createToggleDiffButtonView'](){const _0x1b29ca=new kt(this['locale']);_0x1b29ca['set']({'tooltip':!0x0,'isToggleable':!0x0,'role':'menuitemcheckbox'}),_0x1b29ca['bind']('isEnabled')['to'](this,'isError',_0x1474a7=>!_0x1474a7),_0x1b29ca['extendTemplate']({'attributes':{'class':[us,'ck-ai_review__check-run-toggle-diff-button',this['bindTemplate']['if']('isResultReady','ck-hidden',_0x3b4a4b=>!_0x3b4a4b),this['bindTemplate']['if']('isCompleted','ck-hidden',_0x432113=>_0x432113)]}});const _0x4292f3=cs(this['locale'],'AI_REVIEW_MODE_HIDE_CHANGES'),_0x3749fe=cs(this['locale'],'AI_REVIEW_MODE_SHOW_CHANGES');return _0x1b29ca['bind']('isOn')['to'](this,'isToggleDiffOn',_0x1e71fc=>_0x1e71fc),_0x1b29ca['bind']('icon')['to'](this,'isToggleDiffOn',_0x51b904=>_0x51b904?st:nt),_0x1b29ca['bind']('label')['to'](this,'isToggleDiffOn',_0x4f269d=>_0x4f269d?_0x4292f3:_0x3749fe),_0x1b29ca['on']('execute',()=>{this['isToggleDiffOn']=!this['isToggleDiffOn'],this['fire']('toggleDiff',{'on':this['isToggleDiffOn']});}),_0x1b29ca;}['_createAcceptAllButtonView'](){const _0x3fd523=new kt(this['locale']);return _0x3fd523['set']({'label':cs(this['locale'],'AI_REVIEW_MODE_ACCEPT_ALL'),'withText':!0x0}),_0x3fd523['bind']('isEnabled')['to'](this,'isError',_0x316744=>!_0x316744),_0x3fd523['extendTemplate']({'attributes':{'class':[ls,'ck-ai_review__check-run-accept-all-button',this['bindTemplate']['if']('isResultReady','ck-hidden',_0x5327a6=>!_0x5327a6),this['bindTemplate']['if']('isCompleted','ck-hidden',_0x144145=>_0x144145)]}}),_0x3fd523['on']('execute',()=>{this['fire']('acceptAllChanges');}),_0x3fd523;}['_createExitReviewButtonView'](){const _0x1d18a=new kt(this['locale']);return _0x1d18a['set']({'label':cs(this['locale'],'AI_REVIEW_MODE_EXIT_REVIEW'),'withText':!0x0}),_0x1d18a['extendTemplate']({'attributes':{'class':[ds,'ck-ai_review__check-run-exit-button',this['bindTemplate']['if']('isResultReady','ck-hidden',_0x2189a9=>!_0x2189a9),this['bindTemplate']['if']('isCompleted','ck-hidden',_0x12ebf9=>_0x12ebf9)]}}),_0x1d18a['on']('execute',()=>{this['fire']('leaveReviewCoreResultList');}),_0x1d18a;}['_createResultHeaderView'](){const _0x18c2e6=new Nt(this['locale']),_0xccd1c6=this['_createTitleView']();return _0x18c2e6['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-run-results-header',this['bindTemplate']['if']('isCompleted','ck-ai_review__review-completed-header',_0x93650=>_0x93650)]},'children':[_0xccd1c6,{'tag':'div','attributes':{'class':['ck-ai_review__check-run-results-header-buttons']},'children':[this['_cancelButtonView'],this['_acceptAllButtonView'],this['_exitReviewButtonView'],this['_toggleDiffButtonView'],this['_finishReviewButtonView']]}]}),_0x18c2e6;}['_createTitleView'](){const _0x78b5a0=new Nt(this['locale']),_0x585052=new Rn();return _0x585052['bind']('isVisible')['to'](this,'isResultReady',_0x416e89=>!_0x416e89),_0x78b5a0['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-run-results-header-title-wrapper']},'children':[_0x585052,{'tag':'div','attributes':{'class':['ck-ai_review__check-run-results-header-title-content',this['bindTemplate']['if']('isCompleted','ck-hidden',_0x58dea5=>_0x58dea5)]},'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',_0x2a7bd3=>!_0x2a7bd3)]},'children':[{'text':cs(this['locale'],'AI_REVIEW_MODE_FINISH_REVIEW_HEADER_TITLE')}]}]}),_0x78b5a0;}['_createFinishReviewButtonView'](){const _0x224d15=new no(cs(this['locale'],'AI_REVIEW_MODE_FINISH_REVIEW_BUTTON_LABEL'),this['locale']);return _0x224d15['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isCompleted','ck-hidden',_0x39b4f5=>!_0x39b4f5)]}}),_0x224d15['delegate']('finishReview')['to'](this),_0x224d15;}}class ao extends Pt{['_resultsHeader'];['_finishReviewButtonView'];constructor(_0x1ffeab,_0x3cc05e){super(_0x1ffeab),this['_finishReviewButtonView']=this['_createFinishReviewButtonView'](_0x3cc05e['buttonText']),this['_resultsHeader']=this['_createResultHeaderView'](_0x3cc05e['headerText']);const _0x1b2509=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__review-completed',_0x1b2509['if']('isVisible','ck-hidden',_0x3eecfb=>!_0x3eecfb)]},'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':_0x3cc05e['emptyResultsText']}]}]}]});}['_createFinishReviewButtonView'](_0x35d737){const _0x38280e=new no(_0x35d737,this['locale']);return _0x38280e['delegate']('finishReview')['to'](this),_0x38280e;}['_createResultHeaderView'](_0x141f0c){const _0x12ac49=new Nt(this['locale']);return _0x12ac49['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':_0x141f0c}]},{'tag':'div','attributes':{'class':['ck-ai_review__review-completed-header-buttons']},'children':[this['_finishReviewButtonView']]}]}),_0x12ac49;}}class oo extends Nt{['_dropdownView'];['_defaultValue'];['_defaultLabel'];constructor(_0x14cded,_0x1fdadd){super(_0x14cded),this['_defaultValue']=_0x1fdadd['default']||(_0x1fdadd['data']['length']>0x0?_0x1fdadd['data'][0x0]['id']:''),this['_defaultLabel']=_0x1fdadd['data']['find'](_0x4037f3=>_0x4037f3['id']===this['_defaultValue'])?.['label']||'',this['set']('formValue',''),this['_dropdownView']=Bt(this['locale']);const _0x544fff=this['_prepareListOptions'](_0x1fdadd['data']);zt(this['_dropdownView'],_0x544fff,{'role':'menu','ariaLabel':_0x1fdadd['label']}),this['_dropdownView']['buttonView']['set']({'label':this['_defaultLabel'],'withText':!0x0}),this['_dropdownView']['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x2c6ede=>{_0x2c6ede['stopPropagation']();})}}),this['listenTo'](this['_dropdownView'],'execute',_0x108267=>{this['formValue']=_0x108267['source']['model']['id'],this['_dropdownView']['buttonView']['label']=_0x108267['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'](_0xfe894d=[]){const _0x14fe3e=new dt();this['resetToDefault']();for(const _0x4e1de5 of _0xfe894d){const _0xaf6fb9=new jt({'label':_0x4e1de5['label'],'withText':!0x0,'role':'menuitemradio','id':_0x4e1de5['id'],'model':_0x4e1de5});_0xaf6fb9['bind']('isOn')['to'](this,'formValue',_0x11fc31=>_0x11fc31===_0xaf6fb9['id']);const _0x50f077={'type':'button','model':_0xaf6fb9};_0x14fe3e['add'](_0x50f077);}return _0x14fe3e;}}class ho extends Pt{['_formItem']=null;constructor(_0xee9782,_0x241926,_0x1b3c49){super(_0xee9782),this['argsKey']=_0x241926?.['argsKey'];if('dropdown'===_0x241926['formType'])this['_formItem']=new oo(this['locale'],_0x241926);this['set']('value',''),this['bind']('value')['to'](this['_formItem'],'formValue');const _0x5064df=new _0x5c545c(this['locale'],{'children':[this['_formItem']],'class':[_0x1b3c49?'ck-form__row_with-submit':'']});_0x1b3c49&&_0x5064df['children']['add'](_0x1b3c49),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai_review__form-item','ck-reset_all']},'children':[_0x5064df]});}['resetToDefault'](){this['_formItem']['resetToDefault']();}}class co extends _0x308b78{['keystrokes'];static ['MIN_ROWS']=0x1;static ['MAX_ROWS']=0xc;constructor(_0x4b82e5){super(_0x4b82e5),this['set']('isEmpty',!0x0),this['keystrokes']=new At(),this['minRows']=co['MIN_ROWS'],this['maxRows']=co['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 lo extends Nt{['focusTracker']=new _t();['keystrokes']=new At();['focusCycler'];['_focusables']=new _0x24b273();['submitButtonView'];['cancelButtonView'];['promptInputView'];['actionsFooterView'];['_modelSelectionDropdown'];['_modelNameView'];['_modelSelectionDropdownItems'];['_check'];['_defaultValue'];['_defaultLabel'];constructor(_0x317894,_0x3134ed,_0x277a1f=!0x1){super(_0x317894),this['_check']=_0x3134ed,this['set']('prompt',''),this['set']('modelId',''),this['set']('modelDisplayMode','selector'),this['set']('activeModelName',null),this['_defaultValue']=_0x3134ed['defaultModel']?_0x3134ed['defaultModel']['id']:'',this['_defaultLabel']=_0x3134ed['defaultModel']?_0x3134ed['defaultModel']['name']:'',this['submitButtonView']=this['_createSubmitButtonView'](),this['cancelButtonView']=this['_createCancelButtonView'](),(this['promptInputView']=new Zt(this['locale'],()=>new co(_0x317894)),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'](_0x277a1f),zt(this['_modelSelectionDropdown'],this['_modelSelectionDropdownItems']),this['actionsFooterView']=this['_createActionsFooterView'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-custom-actions']},'children':[new _0x5c545c(this['locale'],{'children':[this['promptInputView']]}),new _0x5c545c(this['locale'],{'children':[this['actionsFooterView']]})]}),this['promptInputView']['fieldView']['keystrokes']['set']('Enter',(_0x51e5f6,_0x257c8d)=>{this['_isValid']()?(this['fire']('runReviewCheck',{'id':'custom','args':{'prompt':this['prompt'],'model':this['modelId']},'isCustom':!0x0}),_0x257c8d()):_0x257c8d();}),this['focusCycler']=new Mt({'focusables':this['_focusables'],'focusTracker':this['focusTracker'],'keystrokeHandler':this['keystrokes'],'actions':{'focusPrevious':'shift\x20+\x20tab','focusNext':'tab'}}));}['render'](){super['render'](),([this['promptInputView'],this['_modelSelectionDropdown'],this['cancelButtonView'],this['submitButtonView']]['forEach'](_0x56b8ce=>{this['_focusables']['add'](_0x56b8ce),this['focusTracker']['add'](_0x56b8ce['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 _0x5a096f of this['_getFormValidators']()){const _0x277601=_0x5a096f();if(_0x277601)return this['promptInputView']['errorText']=_0x277601,!0x1;}return!0x0;}['_getFormValidators'](){return[()=>{if(0x0===this['promptInputView']['fieldView']['value']?.['trim']()['length'])return cs(this['locale'],'AI_REVIEW_MODE_PROMPT_EMPTY_ERROR');}];}['_createSubmitButtonView'](){const _0x366a34=new kt(this['locale']),t=this['locale']['t'];return _0x366a34['set']({'label':t('Submit'),'withText':!0x0,'class':ls}),_0x366a34['on']('execute',()=>{this['_isValid']()&&this['fire']('runReviewCheck',{'id':'custom','args':{'prompt':this['prompt'],'model':this['modelId']},'isCustom':!0x0});}),_0x366a34;}['_createCancelButtonView'](){const _0x43951a=new kt(this['locale']),t=this['locale']['t'];return _0x43951a['set']({'label':t('Cancel'),'withText':!0x0,'class':ds}),_0x43951a['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x4df9b7=>{_0x4df9b7['stopPropagation']();})}}),_0x43951a['on']('execute',()=>{this['resetToDefault'](),this['fire']('closeCustomCheck');}),_0x43951a;}['_setModelList'](_0x2d5313){this['_modelSelectionDropdownItems']['clear']();const _0x231050=this['_check']['models'];if(_0x2d5313)this['set']('modelDisplayMode','hidden');else{const _0x40643f=0x1===_0x231050['length'];this['set']('modelDisplayMode',_0x40643f?'name':'selector');}if(this['resetToDefault'](),_0x231050?.['length']){0x1===_0x231050['length']&&this['set']('activeModelName',_0x231050[0x0]['name']||_0x231050[0x0]['id']);for(const _0x3b973b of _0x231050){const _0x444a6b=new jt({'label':_0x3b973b['name'],'withText':!0x0,'role':'menuitemradio','id':_0x3b973b['id'],'model':_0x3b973b});_0x444a6b['bind']('isOn')['to'](this,'modelId',_0x3180bb=>_0x3180bb===_0x3b973b['id']),this['_modelSelectionDropdownItems']['add']({'type':'button','model':_0x444a6b,'labelView':new _o(this['locale'],_0x3b973b)});}}}['_createModelSelectionDropdown'](){const _0x2d0b38=Bt(this['locale']);return _0x2d0b38['set']({'panelPosition':'se','class':'ck-ai_review__check-list-item-model-dropdown'}),_0x2d0b38['buttonView']['set']({'label':this['_defaultLabel'],'withText':!0x0,'tooltip':!0x0,'class':ds}),_0x2d0b38['buttonView']['bind']('isVisible')['to'](this,'modelDisplayMode',_0x5654cd=>'selector'===_0x5654cd),this['listenTo'](_0x2d0b38,'execute',_0x3f6ae3=>{this['modelId']=_0x3f6ae3['source']['model']['id'],_0x2d0b38['buttonView']['label']=_0x3f6ae3['source']['label'];}),_0x2d0b38;}['_createModelNameView'](){const _0x5de669=new uo(this['locale']);return _0x5de669['bind']('text')['to'](this,'activeModelName',_0x151d32=>_0x151d32??''),_0x5de669['bind']('isVisible')['to'](this,'modelDisplayMode',_0x567205=>'name'===_0x567205),_0x5de669;}['_createActionsFooterView'](){const _0x3bd998=new Nt(this['locale']);return _0x3bd998['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']]}]}),_0x3bd998;}}class uo extends Nt{constructor(_0xe0d61d){super(_0xe0d61d),this['set']('text',void 0x0),this['set']('isVisible',!0x0);const _0xd60a8d=this['bindTemplate'];this['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai_review__check-list-item-model-name',_0xd60a8d['if']('isVisible','ck-hidden',_0x378f98=>!_0x378f98)]},'children':[{'text':_0xd60a8d['to']('text')}]});}}class _o extends Ht{constructor(_0x4bd7e1,_0x566fa0){super();const _0x5bf908=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-button__label'],'style':_0x5bf908['to']('style'),'id':_0x5bf908['to']('id')},'children':[{'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-model-dropdown-name']},'children':[{'tag':'span','children':[{'text':_0x5bf908['to']('text')}]}]},{'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-model-dropdown-description']},'children':[{'tag':'span','children':[_0x566fa0['description']||'']}]}]});}}class Ao extends Pt{['_formItemsCollection']=new _0x24b273();['_customCheckView']=null;['_hideModels']=!0x1;constructor(_0x5dcc4d,_0x4970e,_0x6aa5b0,_0x3b87c8=!0x1){super(_0x5dcc4d),this['_hideModels']=_0x3b87c8,this['set']('isParametrizedViewOpen',!0x1),this['set']('isListItemRendered',!0x1),this['set']('isItemParametrized',_0x4970e['isParameterized']);const _0x44554c=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',_0x4bb8fd=>_0x4bb8fd),this['bindTemplate']['if']('isListItemRendered','ck-ai_review__check-list-item_rendered',_0x455c29=>_0x455c29)],'style':{'--ck-ai-review-check-list-item-index':_0x6aa5b0}},'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':_0x4970e['title']}]},_0x44554c]},{'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-description']},'children':_0x4970e['description']?[{'text':_0x4970e['description']}]:[]}]}]},..._0x4970e['isParameterized']?[this['_createParameterizedView'](_0x4970e)]:[],...'custom'===_0x4970e['id']?[this['_createCustomView'](_0x4970e,this['_hideModels'])]:[]]}),this['on']('click',()=>{_0x4970e['isParameterized']?this['isParametrizedViewOpen']=!0x0:this['fire']('runReviewCheck',{'id':_0x4970e['id'],'args':_0x4970e['useArgs']?_0x4970e['args']:void 0x0});}),requestAnimationFrame(()=>{this['isListItemRendered']=!0x0;});}['render'](){super['render'](),this['isItemParametrized']&&Xt({'emitter':this,'activator':()=>!0x0===this['isParametrizedViewOpen'],'contextElements':[this['element']],'callback':()=>{this['isParametrizedViewOpen']=!0x1;}});}['resetToDefault'](){this['isParametrizedViewOpen']=!0x1,this['_formItemsCollection']['forEach'](_0x55bea6=>{_0x55bea6['resetToDefault']();}),this['_customCheckView']&&this['_customCheckView']['resetToDefault']();}['_createIconView'](){const _0x15a5fb=new yt();return _0x15a5fb['content']=rt,_0x15a5fb['extendTemplate']({'attributes':{'class':['ck-ai_review__check-list-item-title-icon']}}),_0x15a5fb;}['_createParameterizedView'](_0x378ed8){const _0x4a3526=new Nt(),_0x1fd7c3=this['_createFormView'](_0x378ed8);return _0x4a3526['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-parameterized',this['bindTemplate']['if']('isParametrizedViewOpen','ck-hidden',_0x3e03bc=>!_0x3e03bc)]},'children':[_0x1fd7c3]}),_0x4a3526;}['_createFormView'](_0xd3ef7e){const _0x570278=new Nt(),_0x2cedf3=Array['isArray'](_0xd3ef7e['options'])?_0xd3ef7e['options']:[],_0x30a527=new kt(this['locale']),t=this['locale']['t'];_0x30a527['set']({'label':t('Submit'),'withText':!0x0,'class':ls}),_0x30a527['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0xe220d=>{_0xe220d['stopPropagation']();})}}),_0x30a527['on']('execute',()=>{const _0x29cb8b=[],_0x581c86={};this['_formItemsCollection']['forEach'](_0x1b94af=>{_0x29cb8b['push'](_0x1b94af['value']),_0xd3ef7e['useArgs']&&_0xd3ef7e['options']&&(_0x581c86[_0x1b94af['argsKey']]=_0x1b94af['value']);}),this['fire']('runReviewCheck',{'id':_0xd3ef7e['id'],'params':_0x29cb8b['length']?_0x29cb8b:void 0x0,'args':Object['keys'](_0x581c86)['length']?_0x581c86:void 0x0});});const _0x7a4731=_0x2cedf3['length'];return _0x2cedf3['forEach']((_0x5f4718,_0x111bb8)=>{const _0x41b4d6=_0x111bb8===_0x7a4731-0x1;this['_formItemsCollection']['add'](new ho(this['locale'],_0x5f4718,_0x41b4d6?_0x30a527:null));}),_0x570278['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-parameterized-form']},'children':this['_formItemsCollection']}),_0x570278;}['_createCustomView'](_0x417a10,_0x40be07=!0x1){return this['_customCheckView']=new lo(this['locale'],_0x417a10,_0x40be07),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',_0x43d4c8=>!_0x43d4c8)]}}),this['_customCheckView']['delegate']('runReviewCheck')['to'](this),this['listenTo'](this['_customCheckView'],'closeCustomCheck',()=>{this['isParametrizedViewOpen']=!0x1;}),this['on']('change:isParametrizedViewOpen',(_0x4d0b84,_0x478b85,_0x97cd31)=>{_0x97cd31||this['_customCheckView']['resetFormValidationStatus']();}),this['_customCheckView'];}}class go extends Pt{['_checkViews'];constructor(_0x232dea){super(_0x232dea),this['_checkViews']=new _0x24b273(),this['_setupTemplate']();}['setChecks'](_0x36140a,_0x2c6bb2=!0x1){this['_checkViews']['clear']();for(const [_0x26437f,_0x2327d7]of _0x36140a['entries']()){const _0x279abc=new Ao(this['locale'],_0x2327d7,_0x26437f,_0x2c6bb2);_0x279abc['delegate']('runReviewCheck')['to'](this),this['_checkViews']['add'](_0x279abc);}}['hasChecks'](){return this['_checkViews']['length']>0x0;}['resetAllParameterizedChecks'](){for(const _0x5c7eef of this['_checkViews'])_0x5c7eef instanceof Ao&&_0x5c7eef['resetToDefault']();}['_setupTemplate'](){const _0x5ce631=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-list',_0x5ce631['if']('isVisible','ck-hidden',_0x448e5a=>!_0x448e5a)]},'children':this['_checkViews']});}}class Io extends eo{static get['pluginName'](){return'AIReviewModeUI';}['createMainView'](){const _0x2bda1a=this['context']['locale'],_0xc4a04=new _0x52d3ea(_0x2bda1a,{'label':cs(_0x2bda1a,'AI_REVIEW_MODE'),'icon':_0x58f833,'class':'ck-ai-header\x20ck-ai-header_review'});return new so(this['context']['locale'],{'header':_0xc4a04,'list':new go(_0x2bda1a),'results':new ro(_0x2bda1a,{'generalErrorText':cs(_0x2bda1a,'AI_REVIEW_MODE_GENERAL_ERROR_MESSAGE')}),'completed':new ao(_0x2bda1a,{'headerText':cs(_0x2bda1a,'AI_REVIEW_MODE_FINISH_REVIEW_HEADER_TITLE'),'emptyResultsText':cs(_0x2bda1a,'AI_REVIEW_MODE_EMPTY_RESULTS_TEXT'),'buttonText':cs(_0x2bda1a,'AI_REVIEW_MODE_FINISH_REVIEW_BUTTON_LABEL')})});}['registerTab'](){const _0x7a1c37=this['context']['plugins']['get']('AITabs');_0x7a1c37['view']['on']('activateTab',(_0xab184,_0x5e0c3a)=>{'reviewMode'===_0x5e0c3a?this['fire']('getReviewCheckList'):this['fire']('leaveReview');}),_0x7a1c37['view']['addTab']({'id':'reviewMode','buttonLabel':cs(this['context']['locale'],'AI_REVIEW_MODE'),'buttonIcon':_0x58f833,'order':0x0,'content':this['_mainView']});}}const Eo='review-';class po extends _0x31818a{static get['requires'](){return[_0x55bfdc,zs];}static get['pluginName'](){return'AIReviewCoreEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['_markers']=new Map();['_activeMarkers']=new Set();['_domEmitter'];['_eventEmitter'];constructor(_0x2cf2b0){super(_0x2cf2b0),this['_domEmitter']=new(Rt())(),this['_eventEmitter']=new(Et())();}get['emitter'](){return this['_eventEmitter'];}['afterInit'](){const _0x1d7da7=Ys(this['context']);_0x1d7da7['conversion']['for']('editingDowncast')['markerToElement']({'model':Eo+'insert','view':(_0x264d56,{writer:_0x472a08})=>{const _0x5ba5e5=this['_markers']['get'](_0x264d56['markerName']),_0x52a3c6={'class':'ck-ai_review-marker_add'+(this['_activeMarkers']['has'](_0x5ba5e5?.['id']||'')?'\x20ck-ai_review__change_active':''),'data-marker-id':_0x264d56['markerName']};return _0x472a08['createUIElement']('span',_0x52a3c6,function(_0x42373e){const _0x35c3f7=this['toDomElement'](_0x42373e);return _0x35c3f7['innerHTML']=_0x5ba5e5?.['content']?.['asString']||'',_0x35c3f7;});}}),_0x1d7da7['conversion']['for']('editingDowncast')['markerToHighlight']({'model':Eo+'remove-only','view':_0x5a4412=>{const _0x5e45fb=this['_markers']['get'](_0x5a4412['markerName']),_0x21e149=['ck-ai_review-marker_strikethrough'];return this['_activeMarkers']['has'](_0x5e45fb?.['id']||'')&&_0x21e149['push']('ck-ai_review__change_active'),{'classes':_0x21e149,'attributes':{'data-marker-id':_0x5a4412['markerName']}};}}),_0x1d7da7['conversion']['for']('editingDowncast')['markerToHighlight']({'model':Eo+'remove-context','view':_0x41371f=>{const _0x56f663=this['_markers']['get'](_0x41371f['markerName']),_0xcf056=['ck-ai_review-marker_underline'];return this['_activeMarkers']['has'](_0x56f663?.['id']||'')&&_0xcf056['push']('ck-ai_review__change_active'),{'classes':_0xcf056,'attributes':{'data-marker-id':_0x41371f['markerName']}};}}),_0x1d7da7['conversion']['for']('editingDowncast')['markerToHighlight']({'model':Eo+'remove-text','view':_0x21edca=>{const _0x6115cb=this['_markers']['get'](_0x21edca['markerName']),_0x319ad0=['ck-ai_review-marker_hide'];return this['_activeMarkers']['has'](_0x6115cb?.['id']||'')&&_0x319ad0['push']('ck-ai_review__change_active'),{'classes':_0x319ad0,'attributes':{'data-marker-id':_0x21edca['markerName']}};}}),_0x1d7da7['conversion']['for']('dataDowncast')['markerToElement']({'model':Eo+'suggestion-context','view':(_0x115f88,{writer:_0x328165})=>_0x328165['createRawElement']('span',{'class':'ck-ai_review-marker_context-'+(_0x115f88['isOpening']?'start':'end')})}),_0x1d7da7['conversion']['for']('downcast')['attributeToAttribute']({'model':_0x222570,'view':_0x163c4c});const _0x2e2987=_0x1d7da7['ui']['getEditableElement']()||document['body'];this['_domEmitter']['listenTo'](_0x2e2987,'mouseup',(_0x3f2b54,_0x2e6781)=>{const _0x23e37a=_0x2e6781['target'],_0x2a7deb=this['_findMarkerElement'](_0x23e37a);if(!_0x2a7deb)return;const _0x5083b5=_0x2a7deb['getAttribute']('data-marker-id'),_0x585922=_0x5083b5['split'](':')['pop']()?.['split']('_')[0x0];this['_eventEmitter']['fire']('changeMarkerClicked',{'markerId':_0x5083b5,'changeId':_0x585922,'markerElement':()=>this['_findMarkerElementById'](_0x5083b5),'domEvent':_0x2e6781});},{'usePassive':!0x0,'priority':'highest'}),this['_domEmitter']['listenTo'](_0x2e2987,'mouseover',(_0x26211d,_0x56bab2)=>{const _0x345543=_0x56bab2['target'],_0x593ac9=_0x56bab2['relatedTarget'];let _0x4a17b1=this['_findMarkerElement'](_0x345543);if(!_0x4a17b1&&_0x593ac9&&(_0x4a17b1=this['_findMarkerElement'](_0x593ac9)),!_0x4a17b1)return;const _0x33a41d=_0x4a17b1['getAttribute']('data-marker-id'),_0x255fce=_0x33a41d['split'](':')['pop']()?.['split']('_')[0x0];this['_eventEmitter']['fire']('changeMarkerHovered',{'changeId':_0x255fce,'markerElement':()=>this['_findMarkerElementById'](_0x33a41d),'domEvent':_0x56bab2});}),this['_domEmitter']['listenTo'](document,'mouseover',_0x17280a((_0xa7cbe4,_0xf511b1)=>{const _0x44d0b8=_0xf511b1['target'];if(this['_findMarkerElement'](_0x44d0b8))return;_0x44d0b8['closest']('.ck-reset.ck-ai_review-balloon-panel-suggestion')||this['_eventEmitter']['fire']('changeMarkerBlurred');},0xc8)),_0x1d7da7['model']['document']['registerPostFixer'](_0xb8f6fb=>this['_validateMarkers'](_0x1d7da7,_0xb8f6fb)),_0x1d7da7['model']['document']['on']('change',()=>this['_handleMarkerChanges'](_0x1d7da7));}['getDocumentData'](){const _0x42ffed=this['context']['plugins']['get']('AIEditing'),_0x133c68=Ys(this['context']),_0x3516b3=_0x133c68['model'],_0x5d00fa=new _0x8bbd24();for(const _0xb256b5 of _0x3516b3['document']['getRoot']()['getChildren']()){const _0x1424af=_0xb256b5['_clone'](!0x0);_0x5d00fa['_appendChild'](_0x1424af);}for(const _0x4d0fad of _0x3516b3['markers'])_0x5d00fa['markers']['set'](_0x4d0fad['name'],this['_changeRangeOwnerDocument'](_0x4d0fad['getRange']()['clone'](),_0x5d00fa));const _0x23cb2d=new _0x58c78b({'ignoreElementEnd':!0x0,'startPosition':_0x3516b3['createPositionAt'](_0x5d00fa,0x0)}),_0x4dc2b6=new Set(),_0x28140c=new Map();for(const {item:_0x3d1e8f}of _0x23cb2d){if(!_0x3d1e8f['is']('$textProxy'))continue;const _0x5556e1=_0x3d1e8f['parent'];if(_0x5556e1&&_0x5556e1['is']('element')){const _0x33b1a8=this['_upsertDataId'](_0x5556e1,()=>_0x42ffed['_nextDataId'](_0x4dc2b6));_0x4dc2b6['add'](_0x33b1a8);for(const _0x222ac5 of _0x5556e1['getChildren']())_0x222ac5['is']('element')&&_0x4dc2b6['add'](this['_upsertDataId'](_0x222ac5,()=>_0x42ffed['_nextDataId'](_0x4dc2b6)));let _0x32d187=_0x5556e1;for(;_0x32d187['parent']&&!_0x32d187['parent']['is']('documentFragment');)_0x32d187=_0x32d187['parent'],_0x32d187['hasAttribute'](_0x222570)&&_0x32d187['_removeAttribute'](_0x222570);_0x28140c['set'](_0x33b1a8,{'path':_0x5556e1['getPath'](),'getContent':this['_createGetContentUsingDataIdFn'](_0x32d187['_clone'](!0x0),_0x33b1a8,_0x133c68['data'])}),_0x23cb2d['jumpTo'](_0x3516b3['createPositionAfter'](_0x5556e1));}}return{'content':_0x133c68['data']['processor']['toData'](_0x133c68['data']['toView'](_0x5d00fa)),'version':_0x133c68['model']['document']['version'],'elements':_0x28140c};}['diffContent'](_0x3a2bc0,_0x18f939,_0x541242=!0x1){const _0x1d4ed9=[],_0x466221=Ys(this['context']),_0x339edd=_0x466221['data']['parse'](_0x18f939,'$documentFragment'),_0x249572=_0x466221['data']['parse'](_0x3a2bc0,'$documentFragment'),_0x1b5820=_0x466221['model']['createPositionAt'](_0x249572,0x0);if(this['_haveSingleTopLevelElement'](_0x339edd)){if(!this['_hasSameTopLevelElement'](_0x249572,_0x339edd))return _0x1d4ed9;}else{const _0x434a20=_0x466221['model']['schema'];if(!this['_haveOnlyInlineContent'](_0x249572,_0x434a20)||!this['_haveOnlyInlineContent'](_0x339edd,_0x434a20))return _0x1d4ed9;}const _0x5e4ad5=this['context']['plugins']['get']('DocumentCompare')['getDiff'](_0x3a2bc0,_0x18f939,{'anchor':_0x1b5820,'markDeletions':!0x0})['getOperations']()['filter'](_0x37929d=>'insert'===_0x37929d['type']||'marker'===_0x37929d['type']&&_0x37929d['name']['startsWith']('$markedRemove')),_0x2d098c=this['_groupAdjacentOperations'](_0x5e4ad5),_0x400a23=[];if(_0x541242){if(_0x2d098c['length']){const _0x21498c=_0x2d098c[0x0]['operations'][0x0],_0x3b929c='insert'===_0x21498c['type']?_0x21498c['position']:_0x21498c['newRange']['start'],_0x46a324=this['_getPositionLimitingRange'](_0x3b929c,_0x466221,'inside'),_0x4a8baf=_0x46a324?_0x339edd['getChild'](0x0)['getChildren']():_0x339edd['getChildren'](),_0x4b933f=_0x46a324||_0x466221['model']['createRangeIn'](_0x249572),_0x4a715c=[new _0x111ba1('$markedRemove:synthetic'+at(),null,_0x4b933f,_0x466221['model']['document']['model']['markers'],!0x0,_0x466221['model']['document']['version']+0x1),new _0x33642(_0x4b933f['end'],_0x4a8baf,_0x466221['model']['document']['version']+0x2)];_0x400a23['push']({'operations':_0x4a715c,'operationsIsolated':_0x4a715c,'groupOffset':0x0});}}else _0x400a23['push'](..._0x2d098c);let _0x1ee3e1=0x0;return _0x466221['model']['change'](_0x3cdf5a=>{for(let _0x2eda7e=0x0;_0x2eda7e<_0x400a23['length'];_0x2eda7e++){const _0x15419d=_0x400a23[_0x2eda7e],_0x59f846=_0x3cdf5a['createDocumentFragment']();for(const _0x9f3041 of _0x249572['getChildren']())_0x3cdf5a['append'](_0x9f3041['_clone'](!0x0),_0x59f846);for(const _0xfa10c of _0x15419d['operationsIsolated'])if('insert'===_0xfa10c['type']){const _0x39108a=_0xfa10c;_0x39108a['baseVersion']=null,_0x39108a['isDocumentOperation']=!0x1,this['_changeOperationOwnerDocument'](_0x39108a,_0x59f846),_0x3cdf5a['batch']['addOperation'](_0xfa10c),_0x466221['model']['applyOperation'](_0xfa10c);const _0x47f996='suggestion:insertion:id:authorId:'+_0x1ee3e1++,_0x2ba3ec=_0x466221['model']['createRange'](_0x39108a['position'],_0x39108a['position']['getShiftedBy'](_0x39108a['howMany']));_0x59f846['markers']['set'](_0x47f996,_0x2ba3ec);}else{if('marker'===_0xfa10c['type']&&_0xfa10c['name']['startsWith']('$markedRemove')){const _0x50e968=_0xfa10c,_0x92f463='suggestion:deletion:id:authorId:'+_0x1ee3e1++;this['_changeOperationOwnerDocument'](_0x50e968,_0x59f846),_0x59f846['markers']['set'](_0x92f463,_0x50e968['newRange']);}}if(_0x541242)_0x1d4ed9['push']({..._0x15419d,'context':this['_createGetContentFn'](_0x249572,_0x466221['data']),'content':this['_createGetContentFn'](_0x249572,_0x466221['data'])});else{const _0x2b8d92=this['_getChangeContext'](this['_changePositionOwnerDocument'](this['_getOperationStart'](_0x15419d['operationsIsolated'][0x0]),_0x59f846),this['_changePositionOwnerDocument'](this['_getOperationEnd'](_0x15419d['operationsIsolated'][_0x15419d['operationsIsolated']['length']-0x1]),_0x59f846));_0x59f846['markers']['set'](Eo+'suggestion-context',new _0x132eb5(_0x2b8d92['start'],_0x2b8d92['end'])),_0x1d4ed9['push']({..._0x15419d,'context':this['_createGetContextFn'](_0x59f846,_0x466221['data'],{'ellipsisBefore':_0x2b8d92['hasContentBefore'],'ellipsisAfter':_0x2b8d92['hasContentAfter']}),'content':this['_createGetContentFn'](_0x59f846,_0x466221['data'])});}}}),_0x1d4ed9;}['markChangePositionInEditorContent'](_0x119e99,_0xe6c7f9){if(!_0x119e99['length'])return;const _0x24ceb5=_0x119e99[0x0]['parent']['id'],_0xe31dc=_0xe6c7f9['elements']['get'](_0x24ceb5);if(!_0xe31dc)return void console['warn']('No\x20element\x20found\x20for\x20ID:\x20'+_0x24ceb5);const _0x2719a9=_0xe31dc['path'],_0x32fbe4=Ys(this['context']),_0x41fbeb=_0x32fbe4['model']['document']['history']['getOperations'](_0xe6c7f9['version']),_0x5f3506=[];for(const _0xdbfb8c of _0x119e99){const _0x30bba1=_0xdbfb8c['operationsIsolated']['map'](_0x4507ba=>this['_translateOperationToEditorContent'](_0x4507ba,_0x2719a9,_0x32fbe4['model']['document']['getRoots']()[0x0]));if(!_0x30bba1||!_0x30bba1['length'])continue;const _0x1717ee=_0x30bba1['every'](_0x36b67e=>'marker'===_0x36b67e['type']&&_0x36b67e['name']['startsWith']('$markedRemove')),_0x2882b4={'document':_0x32fbe4['model']['document'],'useRelations':!0x1,'padWithNoOps':!0x1},_0x2ecdae=_0x256a0e(_0x30bba1,_0x41fbeb,_0x2882b4)['operationsA'];for(const _0x520223 of _0x2ecdae)if('insert'===_0x520223['type']){const _0x8a9c7b=_0x520223,_0x37bf86=_0x8a9c7b['nodes'];_0x32fbe4['model']['change'](_0x35cf92=>{const _0x459452=_0x35cf92['createDocumentFragment']();for(const _0x4fa6f2 of _0x37bf86)_0x35cf92['append'](_0x4fa6f2['_clone'](!0x0),_0x459452);_0x5f3506['push']({'start':_0x8a9c7b['position'],'end':_0x8a9c7b['position'],'type':'insert','groupId':_0xdbfb8c['id'],'content':{'asString':this['_createGetContentFn'](_0x459452,_0x32fbe4['data'])(),'asFragment':_0x459452}});});}else{if('marker'===_0x520223['type']&&_0x520223['name']['startsWith']('$markedRemove')){const _0x297cff=_0x520223;let _0x256a2a='remove-text';if(_0x1717ee){const _0x321aad=this['_findAdjacentContextDistance'](_0x297cff['newRange']['start'],'backward',_0x32fbe4['model']['schema']),_0x4ededb=this['_findAdjacentContextDistance'](_0x297cff['newRange']['end'],'forward',_0x32fbe4['model']['schema']);if(_0x321aad||_0x4ededb){const _0x1986f0=_0x297cff['newRange']['start']['getShiftedBy'](-_0x321aad),_0x50e3bc=_0x297cff['newRange']['end']['getShiftedBy'](_0x4ededb);_0x5f3506['push']({'start':_0x1986f0,'end':_0x50e3bc,'groupId':_0xdbfb8c['id'],'type':'remove-context'});}else _0x256a2a='remove-only';}_0x5f3506['push']({'start':_0x297cff['newRange']['start'],'end':_0x297cff['newRange']['end'],'groupId':_0xdbfb8c['id'],'type':_0x256a2a});}}}this['_insertMarkers'](_0x5f3506);}['clearAllMarkers'](){const _0x45ba60=Ys(this['context']);_0x45ba60['model']['change'](_0x1e1b78=>{for(const _0x1a125c of this['_markers']['keys']())_0x45ba60['model']['markers']['get'](_0x1a125c)&&_0x1e1b78['removeMarker'](_0x1a125c);}),this['_markers']['clear'](),this['_activeMarkers']['clear']();}['switchToReadOnly'](){Ys(this['context'])['enableReadOnlyMode']('ai-review');}['switchToEdit'](){Ys(this['context'])['disableReadOnlyMode']('ai-review');}['applyChange'](_0x6c61c0){const _0x3a4cf6=Ys(this['context']),_0xadfea5=_0x3a4cf6['model'],_0x2b1f67=_0x6c61c0['map'](_0x17d2c5=>this['_getMarkersDataForGroup'](_0x17d2c5))['flat']();_0xadfea5['change'](_0x530909=>{for(const _0x4711ea of _0x2b1f67){const _0x1d0da6=_0x3a4cf6['model']['markers']['get'](_0x4711ea['id']);if(_0x1d0da6){if('insert'===_0x4711ea['type']){if(!_0x4711ea['content'])continue;_0xadfea5['insertContent'](_0x4711ea['content']['asFragment']||null,_0x1d0da6['getRange']()['start']);}else'remove-text'!==_0x4711ea['type']&&'remove-only'!==_0x4711ea['type']||_0xadfea5['deleteContent'](_0xadfea5['createSelection'](_0x1d0da6['getRange']()));_0x530909['removeMarker'](_0x4711ea['id']),this['_markers']['delete'](_0x4711ea['id']);}}});}['rejectChange'](_0x4c9873){const _0xbf7180=Ys(this['context']),_0x3fe6cd=this['_getMarkersDataForGroup'](_0x4c9873);_0xbf7180['model']['change'](_0x1065a2=>{for(const _0x5a9163 of _0x3fe6cd)_0x1065a2['removeMarker'](_0x5a9163['id']),this['_markers']['delete'](_0x5a9163['id']);});}['getEditor'](){return Ys(this['context']);}['getMarkerElementForChange'](_0x853d00){const _0x2d973b=Array['from'](this['_markers']['values']())['filter'](_0xc426d5=>_0xc426d5['groupId']===_0x853d00);if(!_0x2d973b['length'])return null;const _0x5335b1=0x1===_0x2d973b['length']?_0x2d973b[0x0]:this['_sortMarkers'](_0x2d973b)[0x0],_0x35e160=Ys(this['context'])['model']['markers']['get'](_0x5335b1['id']);if(!_0x35e160)return null;return{'modelRange':_0x35e160['getRange'](),'getElement':()=>this['_findMarkerElementById'](_0x5335b1['id'])};}['getContentElementForChange'](_0x5194b4){const _0x27136f=Array['from'](this['_markers']['values']())['filter'](_0x2f3e16=>_0x2f3e16['groupId']===_0x5194b4);if(!_0x27136f['length'])return null;const _0x8ed7ae=0x1===_0x27136f['length']?_0x27136f[0x0]:this['_sortMarkers'](_0x27136f)[0x0],_0x3b0e0c=Ys(this['context']),_0x449bb9=_0x3b0e0c['model']['markers']['get'](_0x8ed7ae['id']);if(!_0x449bb9)return null;const _0x3bcf54=_0x449bb9['getRange'](),_0xf660c0=_0x3b0e0c['editing']['view']['getDomRoot']();if(!_0xf660c0||!_0x3bcf54)return null;let _0x2fbca2=_0x3bcf54['start']['parent'];for(;_0x2fbca2['parent']&&'$root'!==_0x2fbca2['parent']['name'];)_0x2fbca2=_0x2fbca2['parent'];if(!_0x2fbca2||!_0x2fbca2['name'])return null;const _0x53a52f=_0xf660c0['querySelector']('[data-marker-id=\x22'+_0x8ed7ae['id']+'\x22]');if(!_0x53a52f)return null;let _0x1f579c=null;_0x3b0e0c['model']['change'](_0x3df702=>{_0x1f579c=_0x3df702['createDocumentFragment'](),_0x3df702['append'](_0x2fbca2['_clone'](!0x0),_0x1f579c);});const _0x50f389=_0x3b0e0c['data']['toView'](_0x1f579c)['getChild'](0x0);return _0x53a52f['closest'](_0x50f389['name']);}['reactivateMarkers'](_0x289c9e){const _0x5254e9=this['_getMarkersDataForGroup'](_0x289c9e);if(!_0x5254e9['length'])return;const _0xb93f24=Array['from'](this['_activeMarkers'])['sort'](),_0x17c436=Array['from'](new Set(_0x5254e9['map'](_0x14dde2=>_0x14dde2['id'])))['sort']();_0xb93f24['join']('|')!==_0x17c436['join']('|')&&(this['setAllMarkersAsInactive'](),this['setMarkersInElementAsActive'](_0x289c9e));}['setMarkersInElementAsActive'](_0x5eefe5){const _0x38fdf1=this['_getMarkersDataForGroup'](_0x5eefe5);if(!_0x38fdf1['length'])return;const _0x5db92d=Ys(this['context']),_0x5bfc6a=new Set(_0x38fdf1['map'](_0x99a4bc=>_0x99a4bc['id'])),_0x6e14fa=Array['from'](_0x5bfc6a['values']())['map'](_0x2154eb=>_0x5db92d['model']['markers']['get'](_0x2154eb))['filter'](_0x2efb28=>!!_0x2efb28);_0x5bfc6a['forEach'](_0x1e531a=>{this['_activeMarkers']['add'](_0x1e531a);}),_0x5db92d['model']['change'](()=>{_0x6e14fa['forEach'](_0x3fd212=>{_0x5db92d['editing']['reconvertMarker'](_0x3fd212);});});}['setAllMarkersAsInactive'](){const _0x7212e9=Array['from'](this['_activeMarkers']);if(!_0x7212e9['length'])return;this['_activeMarkers']['clear']();const _0x1c34f9=Ys(this['context']),_0x4a2c00=_0x7212e9['map'](_0x2913a8=>_0x1c34f9['model']['markers']['get'](_0x2913a8))['filter'](_0x841b49=>!!_0x841b49);_0x1c34f9['model']['change'](()=>{_0x4a2c00['forEach'](_0x50dcc2=>{_0x1c34f9['editing']['reconvertMarker'](_0x50dcc2);});});}['_getPositionLimitingRange'](_0x46f83e,_0x3bbeac,_0x416440='outside'){if(!_0x46f83e)return null;let _0x42dcf2=_0x46f83e['parent'];for(;_0x42dcf2&&_0x42dcf2['parent']&&'$root'!==_0x42dcf2['parent']['name']&&!_0x3bbeac['model']['schema']['isLimit'](_0x42dcf2)&&!_0x3bbeac['model']['schema']['isBlock'](_0x42dcf2);)_0x42dcf2=_0x42dcf2['parent'];if(!_0x42dcf2||!_0x42dcf2['name']||'$root'===_0x42dcf2['name'])return null;let _0x4e7b07=null;return _0x3bbeac['model']['change'](_0x44a85f=>{_0x4e7b07='inside'===_0x416440?_0x44a85f['createRangeIn'](_0x42dcf2):_0x44a85f['createRangeOn'](_0x42dcf2);}),_0x4e7b07;}['_validateMarkers'](_0x2b3a8c,_0x3b5847){const _0x324b56=Array['from'](this['_markers']['keys']()),_0x5a8752=new Map();for(const _0x191729 of _0x324b56){const _0x4ad89c=_0x2b3a8c['model']['markers']['get'](_0x191729);if(!_0x4ad89c)continue;const _0x22cd4d=_0x4ad89c['getStart']()['path'][0x0];_0x5a8752['has'](_0x22cd4d)||_0x5a8752['set'](_0x22cd4d,[]),_0x5a8752['get'](_0x22cd4d)['push'](_0x4ad89c);}const _0x17e9a0=new Set();for(const _0x223937 of _0x2b3a8c['model']['document']['differ']['getChanges']()){let _0x5ec3d5=-0x1,_0xfbbe20=null;if('insert'===_0x223937['type'])_0xfbbe20=new _0x132eb5(_0x223937['position'],_0x223937['position']['getShiftedBy'](_0x223937['length'])),_0x5ec3d5=_0x223937['position']['path'][0x0];else{if('remove'!==_0x223937['type'])continue;_0xfbbe20=new _0x132eb5(_0x223937['position']),_0x5ec3d5=_0x223937['position']['path'][0x0];}const _0x4d47de=_0x5a8752['get'](_0x5ec3d5)||[];if(_0x4d47de['length']){for(const _0x51286a of _0x4d47de)if(_0xfbbe20['root']['rootName']===_0x51286a['getRange']()['root']['rootName']&&('insert'!==_0x223937['type']||!_0xfbbe20['containsRange'](_0x51286a['getRange']()))&&(_0xfbbe20['isIntersecting'](_0x51286a['getRange']())||_0xfbbe20['start']['isTouching'](_0x51286a['getRange']()['end'])||_0xfbbe20['end']['isTouching'](_0x51286a['getRange']()['start']))){const _0xf438c0=this['_parseMarkerName'](_0x51286a['name']);Array['from'](this['_markers']['values']())['filter'](_0x2cc868=>_0x2cc868['groupId']===_0xf438c0['groupId'])['forEach'](_0x41be69=>_0x17e9a0['add'](_0x41be69['id']));}}}if(_0x17e9a0['size']){for(const _0x172ba6 of _0x17e9a0)_0x3b5847['removeMarker'](_0x172ba6);return!0x0;}return!0x1;}['_handleMarkerChanges'](_0x17a96f){for(const {name:_0x16da88,data:_0xe2dcf}of _0x17a96f['model']['document']['differ']['getChangedMarkers']()){if(!_0x16da88['startsWith'](Eo))continue;const _0x36e774=_0xe2dcf['oldRange'],_0xd4cb72=_0xe2dcf['newRange'],_0x497b04=_0x36e774&&'$graveyard'===_0x36e774['root']['rootName'],_0x4b8106=_0xd4cb72&&'$graveyard'===_0xd4cb72['root']['rootName'];if(_0x497b04&&_0x4b8106)continue;const _0x44d545=this['_parseMarkerName'](_0x16da88);this['_markers']['get'](_0x16da88)&&(_0x4b8106||!_0xd4cb72?this['_eventEmitter']['fire']('changeMarkerRemoved',{'markerId':_0x16da88,'changeId':_0x44d545['groupId']}):_0x497b04&&_0xd4cb72&&this['_eventEmitter']['fire']('changeMarkerRestored',{'markerId':_0x16da88,'changeId':_0x44d545['groupId']}));}}['_parseMarkerName'](_0x338948){const _0x653d5c=_0x338948['split'](':'),_0x59e7b3=(_0x653d5c[0x1]||'')['split']('_');return{'prefix':_0x653d5c[0x0],'groupId':_0x59e7b3[0x0],'suffix':_0x59e7b3[0x1]};}['_translateOperationToEditorContent'](_0x372e8d,_0x36b36d,_0x189e69){if('insert'===_0x372e8d['type']){const _0x455f05=_0x372e8d;return new _0x33642(this['_changePosition'](_0x36b36d['concat'](_0x455f05['position']['offset']),_0x189e69),_0x455f05['nodes'],_0x455f05['baseVersion']);}if('marker'===_0x372e8d['type']&&_0x372e8d['name']['startsWith']('$markedRemove')){const _0x5d4a22=_0x372e8d;return new _0x111ba1(_0x5d4a22['name'],_0x5d4a22['oldRange'],this['_changeRange'](_0x5d4a22['newRange'],_0x36b36d['concat'](_0x5d4a22['newRange']['start']['offset']),_0x36b36d['concat'](_0x5d4a22['newRange']['end']['offset']),_0x189e69),_0x5d4a22['_markers'],_0x5d4a22['affectsData'],_0x5d4a22['baseVersion']);}return _0x372e8d;}['_groupAdjacentOperations'](_0x50fed8){if(!_0x50fed8['length'])return[];const _0x74f8b6=[];let _0x5e72f3=0x0,_0x2dad84=0x0,_0x299c09=[];for(let _0x472e55=0x0;_0x472e55<=_0x50fed8['length'];_0x472e55++){const _0x2db057=_0x50fed8[_0x472e55],_0x1fb5ca=_0x50fed8[_0x472e55-0x1];!_0x2db057||_0x1fb5ca&&!this['_getOperationEnd'](_0x1fb5ca)['isTouching'](this['_getOperationStart'](_0x2db057))?(_0x74f8b6['push']({'operations':_0x299c09,'operationsIsolated':_0x299c09['map'](_0x13d3f5=>this['_shiftOperation'](_0x13d3f5['clone'](),-_0x2dad84)),'groupOffset':_0x5e72f3}),_0x299c09=_0x2db057?[_0x2db057]:[],_0x2dad84+=_0x5e72f3,_0x5e72f3=0x0):_0x299c09['push'](_0x2db057),_0x2db057&&'insert'===_0x2db057['type']&&(_0x5e72f3+=_0x2db057['howMany']);}return _0x74f8b6;}['_findAdjacentContextDistance'](_0x14f828,_0x5795a4,_0x245a9f,_0x93db48=0x1){const _0xf2ac28=new _0x58c78b({'startPosition':_0x14f828,'direction':_0x5795a4});let _0x3b8b40=0x0;for(let _0x433402=0x0;_0x433402<_0x93db48;_0x433402++){let _0x5bb1d0=0x0,_0x2b72b3=!0x1,_0x4b03ba='forward'===_0x5795a4?/^\W*\w+/:/\w+\W*$/;for(const {item:_0x1bd42d}of _0xf2ac28)if(_0x1bd42d['is']('$textProxy')){const _0x502f0d=_0x4b03ba['exec'](_0x1bd42d['data']);if(_0x502f0d&&_0x502f0d['length']){if(_0x5bb1d0+='forward'===_0x5795a4?_0x502f0d['index']+_0x502f0d[0x0]['length']:_0x1bd42d['data']['length']-_0x502f0d['index'],_0x502f0d[0x0]['length']!==_0x1bd42d['data']['length'])break;_0x2b72b3=!0x0,_0x4b03ba='forward'===_0x5795a4?/^\w+/:/\w+$/;}else{if(_0x2b72b3)break;_0x5bb1d0+=_0x1bd42d['offsetSize'];}}else{if(_0x1bd42d['is']('element')){_0x245a9f['isInline'](_0x1bd42d)&&!_0x2b72b3&&(_0x5bb1d0+=0x1);break;}}_0x3b8b40+=_0x5bb1d0,_0xf2ac28['jumpTo'](_0x14f828['getShiftedBy']('forward'===_0x5795a4?_0x3b8b40:-_0x3b8b40));}return _0x3b8b40;}['_getChangeContext'](_0x43dcb0,_0x4252af){const _0x1f8e3d=Ys(this['context'])['model']['schema'],_0x5a0ae2=this['_findAdjacentContextDistance'](_0x43dcb0,'backward',_0x1f8e3d,0x6),_0x269ac1=this['_findAdjacentContextDistance'](_0x4252af,'forward',_0x1f8e3d,0x6),_0x3ff0c8=_0x43dcb0['getShiftedBy'](-_0x5a0ae2),_0x477deb=_0x4252af['getShiftedBy'](_0x269ac1);return{'start':_0x3ff0c8,'end':_0x477deb,'hasContentBefore':!_0x3ff0c8['isAtStart'],'hasContentAfter':!_0x477deb['isAtEnd']};}['_insertMarkers'](_0x2169dc){const _0x239146=this['context']['plugins']['get']('AIEditing'),_0x3e9752=new Set();Ys(this['context'])['model']['change'](_0x25b680=>{for(const _0xd49e04 of _0x2169dc){const _0x2acadf=''+Eo+_0xd49e04['type']+':'+_0xd49e04['groupId']+'_'+_0x239146['_nextDataId'](_0x3e9752);this['_markers']['set'](_0x2acadf,{'id':_0x2acadf,'groupId':_0xd49e04['groupId'],'type':_0xd49e04['type'],'content':_0xd49e04['content']}),_0x25b680['addMarker'](_0x2acadf,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x25b680['createRange'](_0xd49e04['start'],_0xd49e04['end'])});}});}['_createGetContextFn'](_0x4656ce,_0x35d0f6,_0x3a979a){let _0x5dba50='';return()=>{if(!_0x5dba50){const _0x4e6cf4=_0x35d0f6['toView'](_0x4656ce,{'showSuggestionHighlights':!0x0});let _0xc4f6e2=_0x4e6cf4['getChild'](0x0);if(_0xc4f6e2['is']('containerElement')||(_0xc4f6e2=_0x4e6cf4),!_0xc4f6e2)return'';let _0x597b81=!0x1;const _0x5bee01=[];for(const _0x57d1d5 of _0xc4f6e2['getChildren']())_0x57d1d5['is']('element','span')&&_0x57d1d5['hasClass']('ck-ai_review-marker_context-end')&&(_0x597b81=!0x1),_0x597b81&&_0x5bee01['push'](_0x57d1d5),_0x57d1d5['is']('element','span')&&_0x57d1d5['hasClass']('ck-ai_review-marker_context-start')&&(_0x597b81=!0x0);_0xc4f6e2['_removeChildren'](0x0,_0xc4f6e2['childCount']),_0x3a979a?.['ellipsisBefore']&&_0xc4f6e2['_appendChild']('…'),_0xc4f6e2['_appendChild'](_0x5bee01),_0x3a979a?.['ellipsisAfter']&&_0xc4f6e2['_appendChild']('…');const _0x43b743=_0x35d0f6['htmlProcessor']['domConverter']['viewToDom'](_0x4e6cf4),_0x5132fc=_0x35d0f6['htmlProcessor']['htmlWriter']['getHtml'](_0x43b743);_0x5dba50=_0x5132fc;}return _0x5dba50;};}['_createGetContentFn'](_0x5c7bb0,_0x169c6b){let _0x1fc322='';return()=>(_0x1fc322||(_0x1fc322=_0x169c6b['stringify'](_0x5c7bb0,{'showSuggestionHighlights':!0x0})),_0x1fc322);}['_createGetContentUsingDataIdFn'](_0x69ecda,_0x3fabb2,_0x340960){let _0x2f8272='';return()=>{if(!_0x2f8272){const _0x364186=_0x340960['toView'](new _0x8bbd24(_0x69ecda)),_0x5a76be=_0x340960['htmlProcessor']['domConverter']['viewToDom'](_0x364186)['querySelector']('[data-id=\x22'+_0x3fabb2+'\x22]');_0x2f8272=_0x5a76be?.['outerHTML']||'';}return _0x2f8272;};}['_findMarkerElement'](_0x3668bb,_0x206eee=0x5){let _0x55366b=_0x3668bb,_0x1d89f8=null;for(let _0xcc0538=0x0;_0xcc0538<_0x206eee&&_0x55366b;_0xcc0538++){if(!_0x55366b['className']){_0x55366b=_0x55366b['parentElement'];continue;}if(!(''+_0x55366b['className'])['includes']('ck-ai_review-marker_')){_0x55366b=_0x55366b['parentElement'];continue;}if(!_0x55366b['getAttribute']('data-marker-id'))break;_0x1d89f8=_0x55366b;break;}return _0x1d89f8;}['_findMarkerElementById'](_0x16b3fa){const _0x201334=Ys(this['context']),_0x67c260=_0x201334['model']['markers']['get'](_0x16b3fa);return _0x67c260?_0x1973f5(_0x201334['editing'],_0x67c260):null;}['_getMarkersDataForGroup'](_0x19830a){return Array['from'](this['_markers']['values']())['filter'](_0x5e1dfe=>_0x5e1dfe['groupId']===_0x19830a);}['_getOperationStart'](_0x10f75d){return'insert'===_0x10f75d['type']?_0x10f75d['position']:_0x10f75d['newRange']['start'];}['_getOperationEnd'](_0x1491e1,_0x2b7e8a=!0x1){return'insert'===_0x1491e1['type']?_0x2b7e8a?_0x1491e1['position']:_0x1491e1['position']['getShiftedBy'](_0x1491e1['howMany']):_0x1491e1['newRange']['end'];}['_shiftOperation'](_0x5cd605,_0x19cb45){return'insert'===_0x5cd605['type']?_0x5cd605['position']=_0x5cd605['position']['getShiftedBy'](_0x19cb45):'marker'===_0x5cd605['type']&&_0x5cd605['newRange']&&(_0x5cd605['newRange']=new _0x132eb5(_0x5cd605['newRange']['start']['getShiftedBy'](_0x19cb45),_0x5cd605['newRange']['end']['getShiftedBy'](_0x19cb45))),_0x5cd605;}['_changeOperationOwnerDocument'](_0x3a26b3,_0x4a7926){'insert'===_0x3a26b3['type']?_0x3a26b3['position']=this['_changePositionOwnerDocument'](_0x3a26b3['position'],_0x4a7926):'marker'===_0x3a26b3['type']&&_0x3a26b3['newRange']&&(_0x3a26b3['newRange']=this['_changeRangeOwnerDocument'](_0x3a26b3['newRange'],_0x4a7926));}['_changePositionOwnerDocument'](_0x2ba1a0,_0x387358){return new _0x17c5ae(_0x387358,_0x2ba1a0['path']);}['_changeRangeOwnerDocument'](_0x3c375e,_0x145a4f){return new _0x132eb5(this['_changePositionOwnerDocument'](_0x3c375e['start'],_0x145a4f),this['_changePositionOwnerDocument'](_0x3c375e['end'],_0x145a4f));}['_changePosition'](_0x5ce2d5,_0xf3f42b){return new _0x17c5ae(_0xf3f42b,[..._0x5ce2d5]);}['_changeRange'](_0x58ef75,_0x597939,_0x3426ae,_0x150b17){return new _0x132eb5(this['_changePosition'](_0x597939,_0x150b17),this['_changePosition'](_0x3426ae,_0x150b17));}['_sortMarkers'](_0x20359b){const _0x111603=_0x40af3a=>{switch(_0x40af3a){case'insert':return 0x0;case'remove-context':return 0x1;case'remove-only':return 0x2;case'remove-text':return 0x3;}};return _0x20359b['sort']((_0x2befa7,_0x55ab6c)=>_0x111603(_0x2befa7['type'])-_0x111603(_0x55ab6c['type']));}['_hasSameTopLevelElement'](_0x1f7067,_0xd2c724){const _0x35dca7=_0x1f7067['getChild'](0x0),_0x1284ea=_0xd2c724['getChild'](0x0);return!(!_0x35dca7||!_0x1284ea)&&((!_0x35dca7['is']('element')||!_0x1284ea['is']('element')||_0x35dca7['name']===_0x1284ea['name'])&&!(_0x35dca7['is']('element')&&!_0x1284ea['is']('element')||!_0x35dca7['is']('element')&&_0x1284ea['is']('element')));}['_haveSingleTopLevelElement'](_0x20bc29){return 0x1===_0x20bc29['childCount'];}['_haveOnlyInlineContent'](_0x270412,_0x5a1966){for(const _0x1d9495 of _0x270412['getChildren']())if(_0x1d9495['is']('element')&&!_0x5a1966['isInline'](_0x1d9495))return!0x1;return!0x0;}['_upsertDataId'](_0x18b2e9,_0x7ca87d){let _0x176faf=_0x18b2e9['getAttribute'](_0x222570);return _0x176faf||(_0x176faf=_0x7ca87d(),_0x18b2e9['_setAttribute'](_0x222570,_0x176faf)),_0x176faf;}}class To extends Et(){['id'];['contentNew'];['contentInitial'];['documentVersion'];constructor({id:_0x2bebf7,contentNew:_0x19da31,contentInitial:_0x2d89c8,documentVersion:_0x5653db}){super(),this['id']=_0x2bebf7,this['contentNew']=_0x19da31,this['contentInitial']=_0x2d89c8,this['documentVersion']=_0x5653db;}}class mo extends ht(){['id'];['parent'];['_data'];['_editorOperations']=[];constructor(_0xf4573,_0x19f54f,_0x2c4245){super(),this['id']=_0xf4573,this['parent']=_0x2c4245,this['_data']=_0x19f54f,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 Co extends ht(){['id']=at();['callId'];['_results']=new Map();['_changes']=[];['_sourceCheck'];['_documentData'];['_aiConnector'];['_reviewParams'];['_reviewArgs'];['_activeRequest']=null;['_currentError'];['_wasAborted']=!0x1;constructor(_0x23b118,_0x3a0540,_0x45fc36,_0x404c3a,_0x46fa21){super(),this['_sourceCheck']=_0x3a0540,this['_documentData']=_0x23b118,this['_aiConnector']=_0x45fc36,this['_reviewParams']=_0x404c3a,this['_reviewArgs']=_0x46fa21,this['on']('change:status',(_0x595a10,_0x4747c2,_0x203f05)=>{'aborted'==_0x203f05&&(this['_wasAborted']=!0x0),this['fire']('reviewCheckRunUpdated',{'status':_0x203f05,'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'](_0x35e95d=>'pending'===_0x35e95d['status']);}get['currentError'](){return this['_currentError'];}['updateDocumentData'](_0x5d4121){this['_documentData']=_0x5d4121;}async['start'](){this['status']='loading',this['_currentError']=void 0x0;try{this['_activeRequest']=this['_createApiRequest']();const _0x36cdb3=await this['_activeRequest']['getStream']();this['status']='data';for await(const _0xb6dceb of _0x36cdb3)'unmodified'!==_0xb6dceb['data']['operation']&&('error'!==_0xb6dceb['data']['operation']?'review-metadata'!==_0xb6dceb['event']?this['_addReviewCheckResult'](_0xb6dceb['data']['dataId'],_0xb6dceb['data']['textDelta']):this['callId']=_0xb6dceb['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(_0x23e609){this['_currentError']=_0x23e609,_0x23e609 instanceof Error&&_0x23e609['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'](_0x5c25fe,_0x5b9036){const _0xbc5602=this['_results']['get'](_0x5c25fe);if(!_0xbc5602)return;if(0x0===_0x5b9036['length'])return;const _0x4c3ce4=[];_0x5b9036['forEach']((_0x3d8d08,_0x26e2d2)=>{const _0xcc5ff0=new mo(_0xbc5602['id']+'-'+_0x26e2d2,_0x3d8d08,_0xbc5602);_0xcc5ff0['on']('change:status',()=>{this['fire']('reviewCheckResultChangeStatusUpdated',{'change':_0xcc5ff0,'status':_0xcc5ff0['status']});}),_0xcc5ff0['on']('change:isActivated',()=>{_0xcc5ff0['isActivated']?this['fire']('reviewCheckResultActivated',{'change':_0xcc5ff0}):this['fire']('reviewCheckResultDeactivated',{'change':_0xcc5ff0});}),this['_changes']['push'](_0xcc5ff0),_0x4c3ce4['push'](_0xcc5ff0);}),this['fire']('reviewCheckResultReady',{'changes':_0x4c3ce4,'result':_0xbc5602,'source':this});}['abort'](){this['_activeRequest']&&(this['_activeRequest']['abortController']['abort'](),this['_activeRequest']=null,this['status']='aborted');}['isChangeActive'](_0x47bab1){const _0x41f0eb=this['_changes']['find'](_0x297e2d=>_0x297e2d['id']===_0x47bab1);return!(!_0x41f0eb||'pending'!==_0x41f0eb['status']);}['isAnyChangeActivated'](){return this['_changes']['some'](_0xc8187e=>!0x0===_0xc8187e['isActivated']);}['getActiveChanges'](){return this['_changes']['filter'](_0x336171=>'pending'===_0x336171['status']);}['getChangeById'](_0x5acb6e){return this['_changes']['find'](_0xc78884=>_0xc78884['id']===_0x5acb6e);}['markAllChangesAsAccepted'](){for(const _0x30ec85 of this['_changes'])'pending'===_0x30ec85['status']&&(_0x30ec85['status']='accepted');this['_checkIfFinished']();}['markChangeAsAccepted'](_0x1272a0){const _0x162e46=this['_changes']['find'](_0x10fd58=>_0x10fd58['id']===_0x1272a0);_0x162e46&&'pending'===_0x162e46['status']&&(_0x162e46['status']='accepted'),this['_checkIfFinished']();}['markChangeAsRejected'](_0x2c0a47){const _0x3c41fc=this['_changes']['find'](_0x27c8e4=>_0x27c8e4['id']===_0x2c0a47);_0x3c41fc&&'pending'===_0x3c41fc['status']&&(_0x3c41fc['status']='rejected'),this['_checkIfFinished']();}['markChangeAsOutdated'](_0x1e9969){const _0x19e8c8=this['_changes']['find'](_0x197068=>_0x197068['id']===_0x1e9969);_0x19e8c8&&'pending'===_0x19e8c8['status']&&(_0x19e8c8['status']='outdated'),this['_checkIfFinished']();}['markChangeAsPending'](_0x474c3e){const _0xd48045=this['_changes']['find'](_0x3af546=>_0x3af546['id']===_0x474c3e);_0xd48045&&'outdated'===_0xd48045['status']&&(_0xd48045['status']='pending'),this['_checkIfFinished']();}['activateChange'](_0x4f5692){this['_changes']['filter'](_0x1e0d9a=>_0x1e0d9a['isActivated']&&_0x1e0d9a['id']!==_0x4f5692)['forEach'](_0x12347c=>{_0x12347c['isActivated']=!0x1;});const _0x39bdab=this['_changes']['find'](_0x4a9171=>_0x4a9171['id']===_0x4f5692);_0x39bdab&&'pending'===_0x39bdab['status']&&(_0x39bdab['isActivated']=!0x0);}['deactivateChange'](){this['_changes']['filter'](_0x19a706=>_0x19a706['isActivated'])['forEach'](_0xa180fe=>{_0xa180fe['isActivated']=!0x1;});}['forceReadyState'](){this['status']='ready';}async['sendRating'](_0x43be0d){if('initialized'===this['status']||'loading'===this['status']||'data'===this['status']||this['_wasAborted'])return;if(!this['callId']||0x0===this['_changes']['length'])return;let _0x299ccb;if(_0x43be0d){const _0x18e656=this['_changes']['find'](_0x31945=>_0x31945['id']===_0x43be0d);if(_0x18e656&&_0x18e656['isRated'])return;_0x18e656&&(_0x299ccb=_0x18e656['parent']['id'],_0x18e656['isRated']=!0x0);}const _0x5287e7={'positiveCount':this['_changes']['filter'](_0x497c34=>'accepted'===_0x497c34['status'])['length'],'totalCount':this['_changes']['length']};this['_sendRatingRequest'](_0x5287e7,this['callId'],_0x299ccb);}['_addReviewCheckResult'](_0x5e867c,_0x531685){const _0x32b9a9=this['_documentData']['elements']['get'](_0x5e867c);if(!_0x32b9a9)return;const _0x58b6c8=_0x32b9a9['getContent']();if(_0x58b6c8===_0x531685)return;const _0x2053ae=new To({'id':_0x5e867c,'contentInitial':_0x58b6c8,'contentNew':_0x531685,'documentVersion':this['_documentData']['version']});this['_results']['set'](_0x2053ae['id'],_0x2053ae),this['fire']('reviewCheckResultAdded',{'result':_0x2053ae,'source':this});}['_checkIfFinished'](){'finished'===this['status']&&(this['_changes']['filter'](_0x1946e3=>'pending'===_0x1946e3['status'])['length']>0x0&&(this['status']='ready')),'ready'===this['status']&&(0x0===this['_changes']['filter'](_0x5168a7=>'pending'===_0x5168a7['status'])['length']&&(this['status']='finished'));}}class wo extends Co{get['subTitle'](){if(!this['_reviewParams']||0x0===this['_reviewParams']['length'])return'';const _0x3c0220=[];if(this['_reviewParams']['length']>0x0&&this['_sourceCheck']['options'])for(let _0x4968ef=0x0;_0x4968ef<this['_reviewParams']['length'];_0x4968ef++){if(!this['_reviewParams'][_0x4968ef]||!this['_sourceCheck']['options'][_0x4968ef])continue;const _0x2b379d=this['_sourceCheck']['options'][_0x4968ef],_0x43d8ba=_0x2b379d['data']?.['find'](_0x3dead2=>_0x3dead2['id']===this['_reviewParams'][_0x4968ef]);_0x43d8ba&&_0x3c0220['push'](_0x43d8ba['label']);}return _0x3c0220['join'](',\x20');}get['reviewName'](){return this['_composeReviewName']();}['_createApiRequest'](){return this['_aiConnector']['callSystemReview']({'reviewName':this['_composeReviewName'](),'content':this['_documentData']['content'],'args':this['_reviewArgs']});}['_sendRatingRequest'](_0x480c8e,_0x4197f3,_0x4cc9a7){return this['_aiConnector']['upsertAIReviewRating'](this['reviewName'],_0x4197f3,_0x480c8e,_0x4cc9a7);}['_composeReviewName'](){return!this['_reviewParams']||0x0===this['_reviewParams']['length']||this['_sourceCheck']['useArgs']?this['_sourceCheck']['apiId']:[this['_sourceCheck']['apiId'],...this['_reviewParams']]['join']('-');}}class fo extends _0x31818a{['_aiConnector'];['_aiReviewCoreUi'];['_aiReviewCoreEditing'];['_aiReviewCheckList'];['_currentReviewCheckRun'];['_changeActivationSource']=null;static get['requires'](){return[hs];}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(_0x4de717,_0x3654d0)=>{const _0xe0ae29=this['_aiReviewCheckList']['getCheckById'](_0x3654d0['id']);if(_0xe0ae29){this['_onReviewCheckRun'](_0x3654d0),this['_aiReviewCoreEditing']['switchToReadOnly'](),this['_currentReviewCheckRun']=this['_createReviewCheckRun'](_0x3654d0,_0xe0ae29),this['_aiReviewCoreUi']['setCheckResultTitle'](this['_currentReviewCheckRun']['title'],this['_currentReviewCheckRun']['subTitle']),this['_currentReviewCheckRun']['on']('reviewCheckRunUpdated',(_0x56c90c,_0x5e97b8)=>{switch(_0x5e97b8['status']){case'data':case'loading':this['_aiReviewCoreUi']['showCheckRunResults'](_0x5e97b8);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 ot('ai-review-mode-check-run-general-error',this,void 0x0,this['_currentReviewCheckRun']?.['currentError']));break;case'error-chunk':this['_aiReviewCoreUi']['showChunkErrorView'](),this['_logError'](new ot('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'!==_0x5e97b8['status']&&'error-chunk'!==_0x5e97b8['status']&&'error-general'!==_0x5e97b8['status']||this['_currentReviewCheckRun']?.['sendRating']();}),this['_currentReviewCheckRun']['on']('reviewCheckResultAdded',(_0x695eac,_0x2070fd)=>{if(!this['_currentReviewCheckRun'])throw new ot('ai-review-mode-no-current-check-run',this);const _0x30473f=this['_diffContent'](_0x2070fd['result']['contentInitial'],_0x2070fd['result']['contentNew']);_0x2070fd['source']['addResultChanges'](_0x2070fd['result']['id'],_0x30473f);}),this['_currentReviewCheckRun']['on']('reviewCheckResultReady',(_0x91739f,_0xe3bd2e)=>{for(const _0xf8f7ef of _0xe3bd2e['changes'])this['_aiReviewCoreUi']['showCheckRunResult'](_0xf8f7ef);this['_markChangePositionInEditorContent'](_0xe3bd2e['changes'],_0xe3bd2e['source']['documentData']);}),this['_currentReviewCheckRun']['on']('reviewCheckResultChangeStatusUpdated',(_0x5116ed,_0x40b26d)=>{this['_aiReviewCoreUi']['updateChangeState'](_0x40b26d['change']['id'],_0x40b26d['status']);}),this['_currentReviewCheckRun']['on']('reviewCheckResultActivated',(_0x49bdae,_0x55ddea)=>{this['_onReviewCheckResultActivated'](_0x55ddea);}),this['_currentReviewCheckRun']['on']('reviewCheckResultDeactivated',()=>{this['_onReviewCheckResultDeactivated']();});try{await this['_currentReviewCheckRun']['start']();}catch(_0x44a6e9){_0x44a6e9 instanceof Error&&_0x44a6e9['message']['includes']('ai-request-aborted')||(_0x44a6e9 instanceof ot?this['_logError'](_0x44a6e9):this['_logError'](new ot('ai-review-mode-check-run-failed',this,void 0x0,_0x44a6e9)));}}else this['_logError'](new ot('ai-review-mode-source-check-not-found',this,{'checkId':_0x3654d0['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 _0x591287=this['_currentReviewCheckRun']['getActiveChanges']();if(!_0x591287['length'])return;this['_aiReviewCoreEditing']['applyChange'](_0x591287['map'](_0x709258=>_0x709258['id']));const _0x3cd48b=this['_currentReviewCheckRun'];_0x3cd48b['markAllChangesAsAccepted'](),_0x3cd48b['sendRating']();}),this['listenTo'](this['_aiReviewCoreUi'],'acceptChange',(_0xcae991,_0x54aef7)=>{this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['isChangeActive'](_0x54aef7['id'])&&(this['_aiReviewCoreEditing']['applyChange']([_0x54aef7['id']]),this['_currentReviewCheckRun']['markChangeAsAccepted'](_0x54aef7['id']),this['_aiReviewCoreUi']['hideChangeBalloon'](),this['_currentReviewCheckRun']['sendRating'](_0x54aef7['id']));}),this['listenTo'](this['_aiReviewCoreUi'],'dismissChange',(_0x4fa0bc,_0x12f93f)=>{this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['isChangeActive'](_0x12f93f['id'])&&(this['_aiReviewCoreEditing']['rejectChange'](_0x12f93f['id']),this['_currentReviewCheckRun']['markChangeAsRejected'](_0x12f93f['id']),this['_aiReviewCoreUi']['hideChangeBalloon'](),this['_currentReviewCheckRun']['sendRating'](_0x12f93f['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',(_0x458f68,_0x3944a9)=>{this['_onActivateChange'](_0x3944a9);}),this['listenTo'](this['_aiReviewCoreUi'],'deactivateChange',(_0x2616d5,_0x536255)=>{this['_onDeactivateChange'](_0x536255);}),this['listenTo'](this['_aiReviewCoreEditing']['emitter'],'changeMarkerClicked',(_0x54d237,_0x4bcc87)=>{this['_onChangeMarkerClicked'](_0x54d237,_0x4bcc87);}),this['listenTo'](this['_aiReviewCoreEditing']['emitter'],'changeMarkerHovered',(_0x8e13f7,_0x210612)=>{this['_onChangeMarkerHovered'](_0x8e13f7,_0x210612);}),this['listenTo'](this['_aiReviewCoreEditing']['emitter'],'changeMarkerBlurred',()=>{this['_onChangeMarkerBlurred']();}),this['listenTo'](this['_aiReviewCoreEditing']['emitter'],'changeMarkerRemoved',(_0x1c940f,_0x1bc5b6)=>{this['_onChangeMarkerRemoved'](_0x1c940f,_0x1bc5b6);}),this['listenTo'](this['_aiReviewCoreEditing']['emitter'],'changeMarkerRestored',(_0x4cb2e9,_0x5de6d1)=>{this['_onChangeMarkerRestored'](_0x4cb2e9,_0x5de6d1);});}['_createReviewCheckRun'](_0x2d3606,_0x3f47e8){return new wo(this['_aiReviewCoreEditing']['getDocumentData'](),_0x3f47e8,this['_aiConnector'],_0x2d3606['params'],_0x2d3606['args']);}['_onChangeMarkerRemoved'](_0x53a706,_0x44f6ff){this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['markChangeAsOutdated'](_0x44f6ff['changeId']);}['_onChangeMarkerRestored'](_0x2e83d7,_0x31a5f7){this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['markChangeAsPending'](_0x31a5f7['changeId']);}['_onCheckRunFinished'](){this['_aiReviewCoreUi']['showReviewCompletedView']();}['_initRequiredPlugins'](){this['_aiConnector']=this['context']['plugins']['get']('AIConnector');}['_onReviewRunLeave'](_0x5e2e12=!0x1){this['_currentReviewCheckRun']&&(this['_currentReviewCheckRun']['hasModifications']||this['_currentReviewCheckRun']['sendRating'](),this['_currentReviewCheckRun']['stopListening'](),this['_currentReviewCheckRun']['abort'](),this['_currentReviewCheckRun']=void 0x0),_0x5e2e12&&this['_aiReviewCoreUi']['showReviewCheckList'](),this['_aiReviewCoreEditing']['clearAllMarkers'](),this['_aiReviewCoreEditing']['switchToEdit'](),this['_changeActivationSource']=null;const _0x39ebb0=this['_aiReviewCoreEditing']['getEditor']();_0x39ebb0&&_0x39ebb0['editing']['view']['change'](_0x1f486f=>{const _0x4ed771=_0x39ebb0['editing']['view']['document']['getRoot']();_0x1f486f['removeClass']('ck-ai_review-diff',_0x4ed771),_0x1f486f['removeClass']('ck-ai_review-highlights',_0x4ed771),_0x1f486f['removeClass']('ck-ai-translate-mode-content',_0x4ed771);});}['_getTranslationWithDefault'](_0x503beb,_0x2183a1){const _0x27fccb=cs(this['context']['locale'],_0x503beb);return _0x27fccb===_0x503beb?_0x2183a1:_0x27fccb;}['_logError'](_0x17f221,_0x8880ba=!0x1){Tt(_0x17f221['message']),_0x8880ba||(_0x17f221['message']['startsWith']('ai-review-mode-models-unable-to-retrieve')?this['_aiReviewCoreUi']['showGeneralReviewCoreErrorView']():this['_aiReviewCoreUi']['showGeneralResultsErrorView']());}['_scrollToChange'](_0x1c12ea){if('content'===this['_changeActivationSource']){const _0x10b409=this['_aiReviewCoreUi']['getChangeElement'](_0x1c12ea);_0x10b409&&wt(_0x10b409['closest']('.ck-ai_review__check-run-result')||_0x10b409);}else{if('panel'===this['_changeActivationSource']){const _0x1c7e36=this['_getChangeContentElement'](_0x1c12ea);if(!_0x1c7e36)return;mt({'target':_0x1c7e36,'viewportOffset':{'top':0x55,'left':0x0,'bottom':0x0,'right':0x0},'ancestorOffset':0x14,'alignToTop':!0x0});}}}}const So=[{'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 bo{['id'];['commandId'];['title'];['description'];['isParameterized'];['useArgs'];['options'];['args'];get['apiId'](){return this['commandId'];}constructor(_0x54c91a){this['id']=_0x54c91a['id'],this['commandId']=_0x54c91a['commandId'],this['title']=_0x54c91a['title'],this['description']=_0x54c91a['description'],this['isParameterized']=_0x54c91a['isParameterized'],this['useArgs']=_0x54c91a['useArgs'],this['options']=_0x54c91a['options'],this['args']=_0x54c91a['args'];}}class Ro extends ht(){['_checks']=[];['setupChecks'](_0x20f673){this['_checks']=_0x20f673['map'](_0x5f57f6=>new bo(_0x5f57f6));}get['checks'](){return this['_checks'];}['getCheckById'](_0x2e26be){return this['checks']['find'](_0x15a760=>_0x15a760['id']===_0x2e26be);}['removeCheckById'](_0x208ad2){this['_checks']=this['_checks']['filter'](_0xaedc2d=>_0xaedc2d['id']!==_0x208ad2);}}class Oo extends bo{['_models']=[];['_defaultModel']=null;constructor(_0x355d17,_0xdc6eaf,_0x5248f1){super(_0x355d17),this['_models']=_0xdc6eaf,this['_defaultModel']=_0x5248f1;}get['models'](){return this['_models'];}get['defaultModel'](){return this['_defaultModel'];}}class ko extends bo{['isExtra']=!0x0;['prompt'];['model'];['_defaultModel']=null;constructor(_0x3bbd76,_0x474d83,_0x69b7ea){super(_0x3bbd76),this['prompt']=_0x3bbd76['prompt'],this['model']=_0x3bbd76['model'],this['model']?this['_defaultModel']=_0x474d83['find'](_0xc04d70=>_0xc04d70['id']===this['model'])||null:this['_defaultModel']=_0x69b7ea;}get['defaultModel'](){return this['_defaultModel'];}}class No extends Ro{['_allModels']=[];['_recommendedModels']=[];['_defaultModel']=null;constructor(_0xfb73ca,_0x4d1c4d,_0x4bbaad){super(),this['_allModels']=_0xfb73ca,this['_recommendedModels']=_0x4d1c4d,this['_defaultModel']=_0x4bbaad;}['setupChecks'](_0x457cfc){this['_checks']=_0x457cfc['map'](_0x1aae30=>!0x0===_0x1aae30['isExtra']?new ko(_0x1aae30,this['_allModels'],this['_defaultModel']):'custom'===_0x1aae30['id']?new Oo(_0x1aae30,this['_recommendedModels'],this['_defaultModel']):new bo(_0x1aae30));}}class vo extends Co{['_prompt'];['_model'];constructor(_0x2c9002,_0x5f3dea,_0x18ad76,_0x1f064e,_0x12582b){super(_0x18ad76,_0x1f064e,_0x12582b),this['_prompt']=_0x2c9002,this['_model']=_0x5f3dea;}get['subTitle'](){return this['_prompt'];}['_createApiRequest'](){return this['_aiConnector']['callCustomReview']({'content':this['_documentData']['content'],'prompt':this['_prompt'],'model':this['_model']});}['_sendRatingRequest'](_0x5f0bf2,_0x41af76,_0x4574a8){return this['_aiConnector']['upsertCustomAIReviewRating'](_0x41af76,_0x5f0bf2,_0x4574a8);}}class yo extends vo{get['subTitle'](){return'';}set['prompt'](_0x22cb80){this['_prompt']=_0x22cb80;}set['model'](_0x249e10){this['_model']=_0x249e10;}}class xo extends fo{static get['pluginName'](){return'AIReviewModeController';}['_isDiffOn']=!0x1;['_hasDefaultAvailableCommands']=!0x1;constructor(_0x2a96fa){super(_0x2a96fa),this['_hasDefaultAvailableCommands']=!this['context']['config']['get']('ai.review.availableCommands'),this['context']['config']['define']('ai.review.availableCommands',So['map'](_0x27eb02=>_0x27eb02['id'])),this['context']['config']['define']('ai.review.extraCommands',[]);}async['init'](){await super['init'](),this['listenTo'](this['_aiReviewCoreUi'],'toggleDiff',(_0xbc2df,_0x40bcbe)=>{this['_isDiffOn']=_0x40bcbe['on'],this['_onDiffChange'](this['_isDiffOn']);});}['_initRequiredPlugins'](){super['_initRequiredPlugins'](),this['_aiReviewCoreUi']=this['context']['plugins']['get']('AIReviewModeUI'),this['_aiReviewCoreEditing']=this['context']['plugins']['get']('AIReviewCoreEditing');}['_createReviewCheckRun'](_0x4e47ce,_0x1d6158){return _0x4e47ce['isCustom']?new vo(_0x4e47ce['args']['prompt'],_0x4e47ce['args']['model'],this['_aiReviewCoreEditing']['getDocumentData'](),_0x1d6158,this['_aiConnector']):_0x1d6158['isExtra']?new yo(_0x1d6158['prompt'],_0x1d6158['defaultModel']['id'],this['_aiReviewCoreEditing']['getDocumentData'](),_0x1d6158,this['_aiConnector']):new wo(this['_aiReviewCoreEditing']['getDocumentData'](),_0x1d6158,this['_aiConnector'],_0x4e47ce['params'],_0x4e47ce['args']);}['_onReviewCheckResultActivated'](_0x2cbc1e){this['_aiReviewCoreUi']['setActiveStateInResults'](_0x2cbc1e['change']['id']),this['_scrollToChange'](_0x2cbc1e['change']['id']);const _0xe8419b=this['_aiReviewCoreEditing']['getMarkerElementForChange'](_0x2cbc1e['change']['id']);if(!_0xe8419b)return;const _0x3167f8=this['_aiReviewCoreEditing']['getEditor']();this['_aiReviewCoreUi']['showChangeBalloon'](_0x2cbc1e['change'],()=>_0xe8419b['getElement'](),void 0x0,'click',_0x3167f8?.['editing']?.['view']?.['getDomRoot'](),_0x3167f8?.['ui']?.['viewportOffset']),this['_aiReviewCoreEditing']['setMarkersInElementAsActive'](_0x2cbc1e['change']['id']);}['_onReviewCheckResultDeactivated'](){this['_aiReviewCoreUi']['resetActiveStateInResults'](),this['_aiReviewCoreUi']['hideChangeBalloon'](),this['_aiReviewCoreEditing']['setAllMarkersAsInactive']();}['_onActivateChange'](_0x19d8b5){this['_currentReviewCheckRun']&&'click'===_0x19d8b5['uiInteraction']&&(this['_changeActivationSource']='panel',this['_currentReviewCheckRun']['activateChange'](_0x19d8b5['id']));}['_onDeactivateChange'](_0x799c00){this['_currentReviewCheckRun']&&'balloon'===_0x799c00['origin']&&this['_currentReviewCheckRun']['deactivateChange']();}['_onChangeMarkerClicked'](_0x262a69,_0x5b8f28){if(!this['_currentReviewCheckRun'])return;this['_changeActivationSource']='content',this['_currentReviewCheckRun']['activateChange'](_0x5b8f28['changeId']);const _0x21903e=this['_currentReviewCheckRun']['getChangeById'](_0x5b8f28['changeId']);if(!_0x21903e)return;const _0x4878a3=this['_aiReviewCoreEditing']['getEditor']();this['_aiReviewCoreUi']['showChangeBalloon'](_0x21903e,_0x5b8f28['markerElement'],_0x5b8f28['domEvent'],'click',_0x4878a3?.['editing']?.['view']?.['getDomRoot'](),_0x4878a3?.['ui']?.['viewportOffset']);}['_onChangeMarkerHovered'](_0x58e99d,_0x2713a0){if(!this['_currentReviewCheckRun'])return;if(this['_currentReviewCheckRun']['isAnyChangeActivated']())return;const _0x3223a0=this['_currentReviewCheckRun']['getChangeById'](_0x2713a0['changeId']);if(!_0x3223a0)return;const _0x45aeab=this['_aiReviewCoreEditing']['getEditor']();this['_aiReviewCoreUi']['showChangeBalloon'](_0x3223a0,_0x2713a0['markerElement'],_0x2713a0['domEvent'],'hover',_0x45aeab?.['editing']?.['view']?.['getDomRoot'](),_0x45aeab?.['ui']?.['viewportOffset']);}['_onChangeMarkerBlurred'](){if(!this['_currentReviewCheckRun'])return;this['_currentReviewCheckRun']['isAnyChangeActivated']()||this['_aiReviewCoreUi']['hideChangeBalloon']();}['_getChangeContentElement'](_0x12142e){const _0x41ac68=this['_aiReviewCoreEditing']['getMarkerElementForChange'](_0x12142e);return _0x41ac68?_0x41ac68['getElement']():null;}['_markChangePositionInEditorContent'](_0x67e876,_0x12ae74){this['_aiReviewCoreEditing']['markChangePositionInEditorContent'](_0x67e876,_0x12ae74);}['_diffContent'](_0x146e58,_0x27f551){return this['_aiReviewCoreEditing']['diffContent'](_0x146e58,_0x27f551);}['_onReviewCheckRun'](){this['_onDiffChange'](this['_isDiffOn']);}['_onDiffChange'](_0x1198a3){const _0x5f81f7=this['_aiReviewCoreEditing']['getEditor']();_0x1198a3?this['_aiReviewCoreUi']['hideDiffInBalloon']():this['_aiReviewCoreUi']['showDiffInBalloon'](),_0x5f81f7&&_0x5f81f7['editing']['view']['change'](_0x4f8148=>{const _0x189f12=_0x5f81f7['editing']['view']['document']['getRoot']();for(const _0x4b2721 of _0x189f12['getClassNames']())_0x4b2721['startsWith']('ck-ai_review-')&&_0x4f8148['removeClass'](_0x4b2721,_0x189f12);_0x4f8148['addClass'](_0x1198a3?'ck-ai_review-diff':'ck-ai_review-highlights',_0x189f12);});}async['_getChecksList'](){const _0x302d62=[...So,...this['_getExtraChecks']()],_0x144c63=this['context']['config']['get']('ai.review.availableCommands')||[];this['_logErrorForNonExistentChecks'](_0x144c63,_0x302d62);let _0x5513d8=_0x302d62;this['_hasDefaultAvailableCommands']||(_0x5513d8=_0x144c63['map'](_0x2d38cf=>_0x302d62['find'](_0x7e4e14=>_0x7e4e14['id']===_0x2d38cf))['filter'](_0x4cdd97=>!!_0x4cdd97)),_0x5513d8=_0x5513d8['map'](_0x5a6ae7=>_0x5a6ae7['isExtra']?_0x5a6ae7:this['_translateReviewCheck'](_0x5a6ae7));const _0x482ba8=_0x5513d8['some'](_0x48bb08=>_0x48bb08['isExtra']||'custom'===_0x48bb08['id']);let _0x49e6c3=[],_0x4dd619=[],_0x5abe1c=null;if(_0x482ba8){const _0x2c9a37=await this['_getModels']();_0x49e6c3=_0x2c9a37['all'],_0x4dd619=_0x2c9a37['recommended'],_0x5abe1c=_0x2c9a37['default'];}const _0x152a2a=new No(_0x49e6c3,_0x4dd619,_0x5abe1c);return _0x152a2a['setupChecks'](_0x5513d8),_0x482ba8&&this['_filterChecksWithMissingModel'](_0x152a2a),_0x152a2a;}['_getExtraChecks'](){return(this['context']['config']['get']('ai.review.extraCommands')||[])['map'](_0x286481=>({'id':_0x286481['id'],'commandId':_0x286481['id'],'title':_0x286481['label'],'description':_0x286481['description'],'isParameterized':!0x1,'isExtra':!0x0,'prompt':_0x286481['prompt'],'model':_0x286481['model']}));}['_logErrorForNonExistentChecks'](_0x2f949b,_0x149a4d){const _0x2f4943=_0x2f949b['filter'](_0x519f23=>!_0x149a4d['some'](_0x21acc4=>_0x21acc4['id']===_0x519f23));_0x2f4943['length']&&this['_logError'](new ot('ai-review-mode-non-existent-commands-used',this,{'commandIds':_0x2f4943['join'](',\x20')}),!0x0);}async['_getModels'](){try{const _0x3b3da3=new Ks({'connector':this['_aiConnector'],'config':this['context']['config']['get']('ai.models'),'locale':this['context']['locale']});return{'all':await _0x3b3da3['getAll'](),'recommended':await _0x3b3da3['getAvailableModels'](),'default':await _0x3b3da3['getDefault']()};}catch(_0x17aec8){return this['_logError'](new ot('ai-review-mode-models-unable-to-retrieve',this,void 0x0,_0x17aec8)),{'all':[],'recommended':[],'default':null};}}['_translateReviewCheck'](_0x2ac6c5){const _0x35f3bc='AI_REVIEW_CHECK_'+_0x2ac6c5['id']['toUpperCase']()['replaceAll']('-','_'),_0x58fc14={..._0x2ac6c5,'title':this['_getTranslationWithDefault'](_0x35f3bc+'_TITLE',_0x2ac6c5['title']),'description':this['_getTranslationWithDefault'](_0x35f3bc+'_DESCRIPTION',_0x2ac6c5['description'])};return _0x2ac6c5['options']&&(_0x58fc14['options']=_0x2ac6c5['options']['map'](_0x439231=>({..._0x439231,'label':this['_getTranslationWithDefault'](_0x35f3bc+'_OPTIONS_LABEL',_0x439231['label']||''),'data':_0x439231['data']?_0x439231['data']['map'](_0x30a16a=>({..._0x30a16a,'label':this['_getTranslationWithDefault'](_0x35f3bc+'_OPTIONS_DATA_'+_0x30a16a['id']['toUpperCase'](),_0x30a16a['label'])})):void 0x0}))),_0x58fc14;}['_filterChecksWithMissingModel'](_0x351af8){const _0x39bcec=[];_0x351af8['checks']['forEach'](_0x29b52d=>{(_0x29b52d instanceof ko&&!_0x29b52d['defaultModel']||_0x29b52d instanceof Oo&&!_0x29b52d['models']['length'])&&_0x39bcec['push'](_0x29b52d['id']);}),_0x39bcec['length']&&_0x39bcec['forEach'](_0xaad96=>{_0x351af8['removeCheckById'](_0xaad96),this['_logError'](new ot('ai-review-mode-command-unavailable-due-to-missing-model',this,{'commandId':_0xaad96}),!0x0);});}}class Lo extends _0x31818a{static get['requires'](){return[xo,Io,po];}static get['pluginName'](){return'AIReviewMode';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}class Do extends bo{get['apiId'](){return'translate';}}class Po extends Ro{['setupChecks'](_0x1119ca){this['_checks']=_0x1119ca['map'](_0x225086=>new Do(_0x225086));}}class Ho extends wo{['_title'];constructor(_0xa7f5cd,_0x5314c5,_0x4b743f,_0x2401ad,_0x484107,_0x2bfbd7){super(_0xa7f5cd,_0x5314c5,_0x4b743f,_0x484107,_0x2bfbd7),this['_title']=_0x2401ad;}get['title'](){return this['_title'];}get['subTitle'](){return this['_sourceCheck']['title'];}}class Mo extends fo{static get['pluginName'](){return'AITranslateController';}constructor(_0x2b82e4){super(_0x2b82e4),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'](_0x1b8db8,_0x34e3c0){return new Ho(this['_aiReviewCoreEditing']['getDocumentData'](),_0x34e3c0,this['_aiConnector'],cs(this['context']['locale'],'AI_REVIEW_CHECK_TRANSLATE_TITLE'),_0x1b8db8['params'],_0x1b8db8['args']);}['_onReviewCheckResultActivated'](_0xe69260){this['_aiReviewCoreUi']['setActiveStateInResults'](_0xe69260['change']['id']),this['_aiReviewCoreEditing']['setMarkersInElementAsActive'](_0xe69260['change']['id']);}['_onReviewCheckResultDeactivated'](){this['_aiReviewCoreEditing']['setAllMarkersAsInactive'](),this['_aiReviewCoreUi']['resetActiveStateInResults']();}['_onActivateChange'](_0xb9f293){this['_currentReviewCheckRun']&&('hover'===_0xb9f293['uiInteraction']&&(this['_changeActivationSource']='panel',this['_currentReviewCheckRun']['activateChange'](_0xb9f293['id'])),'click'===_0xb9f293['uiInteraction']&&this['_scrollToChange'](_0xb9f293['id']));}['_onDeactivateChange'](_0x686da5){this['_currentReviewCheckRun']&&'panel'===_0x686da5['origin']&&this['_currentReviewCheckRun']['deactivateChange']();}['_onChangeMarkerClicked'](_0x1431b2,_0x37c614){this['_currentReviewCheckRun']&&(this['_changeActivationSource']='content',this['_currentReviewCheckRun']['activateChange'](_0x37c614['changeId']),this['_scrollToChange'](_0x37c614['changeId']));}['_onChangeMarkerHovered'](_0x5f5890,_0x55ffb5){this['_currentReviewCheckRun']&&(this['_changeActivationSource']='content',this['_currentReviewCheckRun']['activateChange'](_0x55ffb5['changeId']),this['_aiReviewCoreEditing']['reactivateMarkers'](_0x55ffb5['changeId']));}['_onChangeMarkerBlurred'](){this['_currentReviewCheckRun']&&'content'===this['_changeActivationSource']&&(this['_currentReviewCheckRun']['deactivateChange'](),this['_aiReviewCoreEditing']['setAllMarkersAsInactive']());}['_getChangeContentElement'](_0x121310){return this['_aiReviewCoreEditing']['getContentElementForChange'](_0x121310);}['_markChangePositionInEditorContent'](_0x1dcc3c,_0xc20479){this['_aiReviewCoreEditing']['markChangePositionInEditorContent'](_0x1dcc3c,_0xc20479);}['_diffContent'](_0x540e1e,_0x3441ab){return this['_aiReviewCoreEditing']['diffContent'](_0x540e1e,_0x3441ab,!0x0);}['_onReviewCheckRun'](){const _0x43cd09=this['_aiReviewCoreEditing']['getEditor']();_0x43cd09&&_0x43cd09['editing']['view']['change'](_0x1005d8=>{const _0x375ba0=_0x43cd09['editing']['view']['document']['getRoot']();for(const _0x5f3df5 of _0x375ba0['getClassNames']())(_0x5f3df5['startsWith']('ck-ai-review-')||'ck-ai-translate-'===_0x5f3df5)&&_0x1005d8['removeClass'](_0x5f3df5,_0x375ba0);_0x1005d8['addClass']('ck-ai-translate-mode-content',_0x375ba0);});}async['_getChecksList'](){const _0x104672=[],_0x9fa8c3=this['context']['config']['get']('ai.translate.languages')||[];for(const _0x48206d of _0x9fa8c3)_0x104672['push']({'title':_0x48206d['label'],'id':_0x48206d['id'],'commandId':_0x48206d['id'],'description':'','isParameterized':!0x1,'useArgs':!0x0,'args':{'language':_0x48206d['id']}});const _0x5b27ac=new Po();return _0x5b27ac['setupChecks'](this['_translateChecks'](_0x104672)),_0x5b27ac;}['_translateChecks'](_0x263fb9){return _0x263fb9['map'](_0x4c5aa8=>{const _0x391cc8='AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_'+_0x4c5aa8['title']['toUpperCase']()['replaceAll']('-','_');return{..._0x4c5aa8,'title':this['_getTranslationWithDefault'](_0x391cc8,_0x4c5aa8['title'])};});}}class Uo extends ro{constructor(_0x2b7a48,_0x3c0ff8){super(_0x2b7a48,_0x3c0ff8),this['on']('set:isLoading',(_0x1f962f,_0x178abc,_0x240520)=>{_0x240520&&(this['headerTitle']=cs(this['locale'],'AI_TRANSLATE_CHECK_RESULTS_LOADING_TITLE'));}),this['on']('set:isResultReady',(_0x5ca7fa,_0x242c51,_0x27a222)=>{_0x27a222&&(this['headerTitle']=cs(this['locale'],'AI_TRANSLATE_CHECK_RESULTS_READY_TITLE'));});}['_createAcceptAllButtonView'](){const _0x58760c=super['_createAcceptAllButtonView']();return _0x58760c['set']('label',cs(this['locale'],'AI_TRANSLATE_ACCEPT_ALL')),_0x58760c;}['_createExitReviewButtonView'](){const _0xfd4e59=super['_createExitReviewButtonView']();return _0xfd4e59['set']('label',cs(this['locale'],'AI_CHAT_HISTORY_CANCEL')),_0xfd4e59;}}class Vo extends go{['_setupTemplate'](){const _0x4c8aea=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-translate__check-list-wrapper',_0x4c8aea['if']('isVisible','ck-hidden',_0xf5ca89=>!_0xf5ca89)]},'children':[{'tag':'div','attributes':{'class':['ck-ai-translate__check-list-header']},'children':[{'tag':'h2','children':[{'text':cs(this['locale'],'AI_TRANSLATE_CHECK_LIST_HEADER_TITLE')}]},{'tag':'p','children':[{'text':cs(this['locale'],'AI_TRANSLATE_CHECK_LIST_HEADER_DESCRIPTION')}]}]},{'tag':'div','attributes':{'class':['ck-ai_review__check-list',_0x4c8aea['if']('isVisible','ck-hidden',_0x894166=>!_0x894166)]},'children':this['_checkViews']}]});}}class Bo extends eo{static get['pluginName'](){return'AITranslateUI';}['createMainView'](){const _0x20708a=this['context']['locale'],_0x10fa2e=new _0x52d3ea(_0x20708a,{'label':cs(_0x20708a,'AI_REVIEW_CHECK_TRANSLATE_TITLE'),'icon':_0x4d6fdb,'class':'ck-ai-header\x20ck-ai-header_review-translate'}),_0x598481=new so(_0x20708a,{'header':_0x10fa2e,'list':new Vo(_0x20708a),'results':new Uo(_0x20708a,{'generalErrorText':cs(_0x20708a,'AI_TRANSLATE_GENERAL_ERROR_MESSAGE')}),'completed':new ao(_0x20708a,{'headerText':cs(_0x20708a,'AI_TRANSLATE_FINISH_HEADER_TITLE'),'emptyResultsText':cs(_0x20708a,'AI_TRANSLATE_EMPTY_RESULTS_TEXT'),'buttonText':cs(_0x20708a,'AI_TRANSLATE_FINISH_BUTTON_LABEL')})});return _0x598481['extendTemplate']({'attributes':{'class':'ck-ai-translate-mode'}}),_0x598481;}['registerTab'](){const _0x522584=this['context']['plugins']['get']('AITabs');_0x522584['view']['on']('activateTab',(_0x3ac5ae,_0x5b8c1a)=>{'translate'===_0x5b8c1a?this['fire']('getReviewCheckList'):this['fire']('leaveReview');}),_0x522584['view']['addTab']({'id':'translate','buttonLabel':cs(this['context']['locale'],'AI_REVIEW_CHECK_TRANSLATE_TITLE'),'buttonIcon':_0x4d6fdb,'order':0x0,'content':this['_mainView']});}}class Go extends _0x31818a{static get['requires'](){return[Mo,Bo,po];}static get['pluginName'](){return'AITranslate';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}export{za as AIActions,Oi as AIAdapter,zi as AIAssistant,qi as AIAssistantUI,fa as AIBalloon,_a as AIChat,Qs as AIChatController,da as AIChatHistory,ua as AIChatHistoryController,ha as AIChatHistoryUI,Ea as AIChatShortcuts,ia as AIChatUI,hs as AIConnector,zs as AIEditing,ka as AIEditorIntegration,ja as AIQuickActions,Ba as AIQuickActionsUI,ki as AIRequestError,bo as AIReviewCheck,To as AIReviewCheckResult,Co as AIReviewCheckRun,Lo as AIReviewMode,fo as AIReviewModeController,po as AIReviewModeEditing,Io as AIReviewModeUI,os as AITabs,Ji as AITextAdapter,Ta as AIToggleButtonUI,Go as AITranslate,Mo as AITranslateController,Bo as AITranslateUI,ts as AWSTextAdapter,Zi as OpenAITextAdapter,vi as ShowAIAssistantCommand,pa as ToggleAICommand,_s as createResizeButton,ji as getDefaultAICommands};
|