@ckeditor/ckeditor5-ai 48.0.0-alpha.1 → 48.0.0-alpha.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/index.js +5 -5
  2. package/package.json +12 -12
package/dist/index.js CHANGED
@@ -20,8 +20,8 @@
20
20
  *
21
21
  *
22
22
  */
23
- import{Plugin as _0x52790d,Command as _0x385b22,ContextPlugin as _0x20e290,Editor as _0x4433f2}from'@ckeditor/ckeditor5-core/dist/index.js';import{IconCopy as _0x20733a,IconCheck as _0x4dbbde,IconError as _0x51c23f,IconSubmit as _0x8a76b5,IconAIHistory as _0x206f96,IconMagicWand as _0x4b4868,IconRobotPencil as _0x270d7f,IconMaximize as _0xfe30ba,IconMinimize as _0x1df418,IconShowChangesOn as _0x25d95d,IconShowChangesOff as _0xb9919f,IconDocument as _0x4fd116,IconBoxWithCross as _0x3a109c,IconBoxWithCheck as _0x404dd0,IconBoxWithMarker as _0x7e05dc,IconInfo as _0x1b9c2f,IconWeb as _0x5c5297,IconClose as _0x18d7ee,IconSelection as _0x407f83,IconFileUpload as _0xc3480b,IconLink as _0xe48f7a,IconBulb as _0x2c0a2e,IconAI as _0x2b87ea,IconPreviousArrow as _0x1654b8,IconDocumentOutline as _0x5b0e49,IconLoupe as _0x381212,IconCancel as _0x2d333c,IconPaperClip as _0x3e47b3,IconBrowseFiles as _0x5606db,IconDropdownArrow as _0x348d35,IconStop as _0x39f907,IconAIChat as _0x29e983,IconPlus as _0x4282f7,IconPin as _0x5c8c8a,IconThreeHorizontalDots as _0x3d118e,IconAIReview as _0x373b59,IconAITranslate as _0x3ec8c7,IconAIAskAI as _0x2cb285,IconThumbUp as _0x2bef5e,IconThumbDown as _0x17058b,IconChevronDown as _0x128602,IconChevronUp as _0xe6b9f7,IconAIQuickActions as _0x25caf3,IconAIChatCommands as _0x36dbee,IconAIImproveWriting as _0x113eff,IconAIContinueWriting as _0x5eae5b,IconAIGrammarCheck as _0x502a9b,IconAIAdjustLength as _0x4b9c93,IconAIChangeTone as _0x428a27,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 _0x13bbb8,FormHeaderView as _0x4c7c2c,HighlightedTextView as _0x3faae3,ViewCollection as _0x2ebc1e,FileDialogButtonView as _0x24d181,InputTextView as _0x2dd1b7,SearchTextView as _0x1e1459,ListItemButtonView as _0x421b3e,ButtonLabelWithHighlightView as _0x1048f5,DropdownMenuPanelPositioningFunctions as _0x4423cb,BalloonToolbar as _0x179b32,FormRowView as _0x1542dd,TextareaView as _0x24ce98}from'@ckeditor/ckeditor5-ui/dist/index.js';import{ClipboardPipeline as _0x331886,ClipboardMarkersUtils as _0x1f2393}from'@ckeditor/ckeditor5-clipboard/dist/index.js';import{ViewDocumentDomEventData as _0xddd5e8,ViewDataTransfer as _0x9e3cb9,ViewUpcastWriter as _0x439338,Matcher as _0xa9734e,_DetachOperation as _0x3ff0e2,_insertIntoModelNodeList as _0x3a994f,_removeFromModelNodeList as _0x61787b,ModelRange as _0x1857bd,transformOperationSets as _0x1225df,ViewDowncastWriter as _0x12730c,ModelDocumentFragment as _0x2b97ae,ModelPosition as _0x392b93,ModelTreeWalker as _0x227fe4,MarkerOperation as _0x1a3635,InsertOperation as _0x1c2b0b}from'@ckeditor/ckeditor5-engine/dist/index.js';import{unescape as _0x369a92,escape as _0x31dc1d,cloneDeep as _0x175c10,escapeRegExp as _0x1d8d0d,debounce as _0x39a6a1}from'es-toolkit/compat';import{BedrockRuntimeClient as _0x3b7258,InvokeModelWithResponseStreamCommand as _0x37cfc5,InvokeModelCommand as _0x434b20}from'@aws-sdk/client-bedrock-runtime';import{createParser as _0x6e8aa9}from'eventsource-parser';import{CloudServices as _0x57eef5}from'@ckeditor/ckeditor5-cloud-services/dist/index.js';import{parseDocument as _0x753e49}from'htmlparser2';import{isTag as _0x5af81f,findOne as _0x5f061e,getParent as _0x5441af,findAll as _0x14ee28,removeElement as _0x2abe84,replaceElement as _0x5a3604,prepend as _0xaf8e9,prependChild as _0x4d95ac,appendChild as _0x3796bb,append as _0x58fef7,find as _0x42b7b4,isComment as _0x2eb15b,getChildren as ti,textContent as _0x5364bb}from'domutils';import _0x2dfbe5 from'dom-serializer';import{Document as _0x5326ca,Element as _0x4ea24a,Text as _0x2883a5,cloneNode as _0x183885,isDocument as _0x7d2ee4,isText as _0x1dbf73,NodeWithChildren as _0x471e20}from'domhandler';import{MarkdownGfmMdToHtmlDefaultPlugins as _0x1dbbed,MarkdownGfmMdToHtml as _0x59f280}from'@ckeditor/ckeditor5-markdown-gfm/dist/index.js';import _0x5dc3c1 from'rehype-sanitize';import{fixElementSuggestionRange as _0x120edb,DocumentCompare as _0x46bc33,DATA_ID_MODEL_ATTRIBUTE as _0x57a89f,ConfirmMixin as _0x450296,LateFocusDropdownButtonView as _0x155860,getAllMarkersDomElementsSorted as _0x173e3b,SuggestionsConversion as _0x3c59c2,DATA_ID_VIEW_ATTRIBUTE as _0x567c05,getMarkerDomElement as _0x4e32d2}from'@ckeditor/ckeditor5-collaboration-core/dist/index.js';import _0x382bf8 from'morphdom';import{diffArrays as _0x43d9cc}from'diff';const Si='_ungrouppedCommands';function bi(_0x107994,_0x160bec){const _0x8a71f2=(0x0,_0x160bec['t'])('Other');return _0x107994['length']?'groupId'in _0x107994[0x0]?_0x107994:[{'groupId':Si,'groupLabel':_0x8a71f2,'order':0x1/0x0,'commands':_0x107994}]:[{'groupId':Si,'groupLabel':_0x8a71f2,'order':0x1/0x0,'commands':[]}];}const Ri=globalThis['DataTransfer'],Oi='ai-ui';class ki extends _0x52790d{static get['pluginName'](){return'AIAssistantEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const {editor:_0xfc0f3d}=this,_0x2024db=['ck-fake-ai-selection'];_0xfc0f3d['config']['get']('ai.assistant.useTheme')&&_0x2024db['push']('ck-ai-assistant-ui_theme'),_0xfc0f3d['conversion']['for']('editingDowncast')['markerToHighlight']({'model':Oi,'view':{'classes':_0x2024db,'priority':0xc}}),_0xfc0f3d['conversion']['for']('editingDowncast')['markerToElement']({'model':Oi,'view':(_0x238683,{writer:_0xd9710b})=>{if(!_0x238683['markerRange']['isCollapsed'])return null;const _0x382ac6=_0xd9710b['createUIElement']('span');return _0xd9710b['addClass'](['ck-fake-ai-selection','ck-fake-ai-selection_collapsed'],_0x382ac6),_0x382ac6;}});}['afterInit'](){!async function(_0x23970c){const _0x3beaee=_0x12099a([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]),_0x1cf23f=0x3dffc4e1,_0xe1149=0x3df84001^_0x1cf23f,_0x54463a=window[_0x12099a([0x44,0x61,0x74,0x65])][_0x12099a([0x6e,0x6f,0x77])](),_0x195d94=_0x23970c[_0x12099a([0x65,0x64,0x69,0x74,0x6f,0x72])],_0x49c046=new window[(_0x12099a([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x92569c=>{_0x195d94[_0x12099a([0x6f,0x6e,0x63,0x65])](_0x12099a([0x72,0x65,0x61,0x64,0x79]),_0x92569c);}),_0x404a1e={[_0x12099a([0x6b,0x74,0x79])]:_0x12099a([0x45,0x43]),[_0x12099a([0x75,0x73,0x65])]:_0x12099a([0x73,0x69,0x67]),[_0x12099a([0x63,0x72,0x76])]:_0x12099a([0x50,0x2d,0x32,0x35,0x36]),[_0x12099a([0x78])]:_0x12099a([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]),[_0x12099a([0x79])]:_0x12099a([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]),[_0x12099a([0x61,0x6c,0x67])]:_0x12099a([0x45,0x53,0x32,0x35,0x36])},_0x3f4a06=_0x195d94[_0x12099a([0x63,0x6f,0x6e,0x66,0x69,0x67])][_0x12099a([0x67,0x65,0x74])](_0x12099a([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79]));async function _0x43f65c(){let _0x8caa02,_0x4b43c5=null,_0x2fdeec=null;try{if(_0x3f4a06==_0x12099a([0x47,0x50,0x4c]))return _0x12099a([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]);if(_0x8caa02=_0x2f2383(),!_0x8caa02)return _0x12099a([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);return _0x8caa02[_0x12099a([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])]&&(_0x2fdeec=_0x425ae6(_0x8caa02[_0x12099a([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])],_0x8caa02[_0x12099a([0x6a,0x74,0x69])])),await _0x214dc6()?_0x1d774e()?_0x3ef837()?_0x12099a([0x45,0x78,0x70,0x69,0x72,0x65,0x64]):_0xdfbc2f()?(_0x8caa02[_0x12099a([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])]==_0x12099a([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e])&&(_0x4b43c5=_0x4bde0e(_0x12099a([0x45,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e,0x4c,0x69,0x6d,0x69,0x74]))),await _0x14085b()):_0x12099a([0x44,0x6f,0x6d,0x61,0x69,0x6e,0x4c,0x69,0x6d,0x69,0x74]):_0x12099a([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]):_0x12099a([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}catch{return _0x12099a([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}function _0x3ef837(){const _0x533978=[_0x12099a([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e]),_0x12099a([0x74,0x72,0x69,0x61,0x6c])][_0x12099a([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x8caa02[_0x12099a([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])])?_0x54463a/0x3e8:0xe10*_0xe1149;return _0x8caa02[_0x12099a([0x65,0x78,0x70])]<_0x533978;}function _0x1d774e(){const _0x37ea9d=_0x8caa02[_0x12099a([0x66,0x65,0x61,0x74,0x75,0x72,0x65,0x73])];return!!_0x37ea9d&&(!!_0x37ea9d[_0x12099a([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x12099a([0x2a]))||!!_0x37ea9d[_0x12099a([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x12099a([0x41,0x49])));}function _0xdfbc2f(){const _0x5b2cd9=_0x8caa02[_0x12099a([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x64,0x48,0x6f,0x73,0x74,0x73])];if(!_0x5b2cd9||0x0==_0x5b2cd9[_0x12099a([0x6c,0x65,0x6e,0x67,0x74,0x68])])return!0x0;const {hostname:_0x17fea3}=new URL(window[_0x12099a([0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e])]['href']);if(_0x5b2cd9[_0x12099a([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x17fea3))return!0x0;const _0x2b1a63=_0x17fea3[_0x12099a([0x73,0x70,0x6c,0x69,0x74])](_0x12099a([0x2e]));return _0x5b2cd9[_0x12099a([0x66,0x69,0x6c,0x74,0x65,0x72])](_0x13f848=>_0x13f848[_0x12099a([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x12099a([0x2a])))[_0x12099a([0x6d,0x61,0x70])](_0x59d45c=>_0x59d45c[_0x12099a([0x73,0x70,0x6c,0x69,0x74])](_0x12099a([0x2e])))[_0x12099a([0x66,0x69,0x6c,0x74,0x65,0x72])](_0x32c786=>_0x32c786[_0x12099a([0x6c,0x65,0x6e,0x67,0x74,0x68])]<=_0x2b1a63[_0x12099a([0x6c,0x65,0x6e,0x67,0x74,0x68])])[_0x12099a([0x6d,0x61,0x70])](_0x4754d6=>Array(_0x2b1a63[_0x12099a([0x6c,0x65,0x6e,0x67,0x74,0x68])]-_0x4754d6[_0x12099a([0x6c,0x65,0x6e,0x67,0x74,0x68])])[_0x12099a([0x66,0x69,0x6c,0x6c])](_0x4754d6[0x0]===_0x12099a([0x2a])?_0x12099a([0x2a]):'')[_0x12099a([0x63,0x6f,0x6e,0x63,0x61,0x74])](_0x4754d6))[_0x12099a([0x73,0x6f,0x6d,0x65])](_0x5dbb98=>_0x2b1a63[_0x12099a([0x65,0x76,0x65,0x72,0x79])]((_0x24cf72,_0x38899b)=>_0x5dbb98[_0x38899b]===_0x24cf72||_0x5dbb98[_0x38899b]===_0x12099a([0x2a])));}function _0x14085b(){return _0x4b43c5&&_0x2fdeec?new window[(_0x12099a([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0x59d089,_0x4e6f31)=>{_0x4b43c5[_0x12099a([0x74,0x68,0x65,0x6e])](_0x59d089,_0x4e6f31),_0x2fdeec[_0x12099a([0x74,0x68,0x65,0x6e])](_0x5269ac=>{_0x5269ac!=_0x12099a([0x56,0x61,0x6c,0x69,0x64])&&_0x59d089(_0x5269ac);},_0x4e6f31);}):_0x4b43c5||_0x2fdeec||_0x12099a([0x56,0x61,0x6c,0x69,0x64]);}}function _0x425ae6(_0x4c40e8,_0x2574ea){return new window[(_0x12099a([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x348d0b=>{if(_0x1b726f())return _0x348d0b(_0x12099a([0x56,0x61,0x6c,0x69,0x64]));_0x18b018(),_0x195d94[_0x12099a([0x64,0x65,0x63,0x6f,0x72,0x61,0x74,0x65])](_0x12099a([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]));let _0x304599=!0x1;const _0x130c38=ot();function _0x3e5d78(_0x4fec29){return!!_0x4fec29&&(typeof _0x4fec29===_0x12099a([0x6f,0x62,0x6a,0x65,0x63,0x74])||typeof _0x4fec29===_0x12099a([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]))&&typeof _0x4fec29[_0x12099a([0x74,0x68,0x65,0x6e])]===_0x12099a([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e])&&typeof _0x4fec29[_0x12099a([0x63,0x61,0x74,0x63,0x68])]===_0x12099a([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]);}function _0x254469(_0x1b20a2){_0x1e3e6a(_0x1b20a2)[_0x12099a([0x74,0x68,0x65,0x6e])](_0xf2aa6b=>{if(!_0xf2aa6b||_0xf2aa6b[_0x12099a([0x73,0x74,0x61,0x74,0x75,0x73])]!=_0x12099a([0x6f,0x6b]))return _0x12099a([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]);return _0x778911(_0x222e2d(_0x130c38+_0x2574ea))!=_0xf2aa6b[_0x12099a([0x76,0x65,0x72,0x69,0x66,0x69,0x63,0x61,0x74,0x69,0x6f,0x6e])]?_0x12099a([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]):_0x12099a([0x56,0x61,0x6c,0x69,0x64]);})[_0x12099a([0x74,0x68,0x65,0x6e])](_0x452f0e=>(_0xb69cb8(),_0x452f0e),()=>{const _0x36623a=_0x3d74eb();return null==_0x36623a?(_0xb69cb8(),_0x12099a([0x56,0x61,0x6c,0x69,0x64])):_0x12099a(_0x54463a-_0x36623a>(0x19f340e1^_0x1cf23f)?[0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]:[0x56,0x61,0x6c,0x69,0x64]);})[_0x12099a([0x74,0x68,0x65,0x6e])](_0x348d0b)[_0x12099a([0x63,0x61,0x74,0x63,0x68])](()=>{_0x348d0b(_0x12099a([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});const _0x5b083b=0x3dc92a61^_0x1cf23f;function _0xb69cb8(){const _0x4720be=_0x12099a([0x6c,0x6c,0x63,0x74,0x2d])+_0x778911(_0x222e2d(_0x4c40e8)),_0x40adb1=_0x212f7f(_0x778911(window[_0x12099a([0x4d,0x61,0x74,0x68])][_0x12099a([0x63,0x65,0x69,0x6c])](_0x54463a/_0x5b083b)));window[_0x12099a([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0x12099a([0x73,0x65,0x74,0x49,0x74,0x65,0x6d])](_0x4720be,_0x40adb1);}function _0x3d74eb(){const _0x5ab878=_0x12099a([0x6c,0x6c,0x63,0x74,0x2d])+_0x778911(_0x222e2d(_0x4c40e8)),_0x3aa933=window[_0x12099a([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0x12099a([0x67,0x65,0x74,0x49,0x74,0x65,0x6d])](_0x5ab878);return _0x3aa933?window[_0x12099a([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x212f7f(_0x3aa933),0x10)*_0x5b083b:null;}function _0x1e3e6a(_0x35ff2f){return new window[(_0x12099a([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0x376b4f,_0x69b73f)=>{_0x35ff2f[_0x12099a([0x74,0x68,0x65,0x6e])](_0x376b4f,_0x69b73f),window[_0x12099a([0x73,0x65,0x74,0x54,0x69,0x6d,0x65,0x6f,0x75,0x74])](_0x69b73f,0x3dfe1021^_0x1cf23f);});}}_0x195d94[_0x12099a([0x6f,0x6e])](_0x12099a([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),(_0x3d82e2,_0xf62c51)=>{if(_0xf62c51[0x0]!=_0x4c40e8)return _0x348d0b(_0x12099a([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));_0xf62c51[0x1]={..._0xf62c51[0x1],[_0x12099a([0x72,0x65,0x71,0x75,0x65,0x73,0x74,0x49,0x64])]:_0x130c38};},{[_0x12099a([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0x12099a([0x68,0x69,0x67,0x68])}),_0x195d94[_0x12099a([0x6f,0x6e])](_0x12099a([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),_0xc751be=>{_0x3e5d78(_0xc751be[_0x12099a([0x72,0x65,0x74,0x75,0x72,0x6e])])&&(_0x304599=!0x0,_0x254469(_0xc751be[_0x12099a([0x72,0x65,0x74,0x75,0x72,0x6e])]));},{[_0x12099a([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0x12099a([0x6c,0x6f,0x77])}),_0x49c046[_0x12099a([0x74,0x68,0x65,0x6e])](()=>{_0x304599||_0x348d0b(_0x12099a([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});});function _0x1b726f(){return _0x195d94[_0x12099a([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0x12099a([0x76,0x69,0x65,0x77])][_0x12099a([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]==_0x12099a([0x61,0x75,0x74,0x6f]);}function _0x18b018(){_0x195d94[_0x12099a([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0x12099a([0x76,0x69,0x65,0x77])][_0x12099a([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]=_0x12099a([0x61,0x75,0x74,0x6f]);}}function _0x4bde0e(_0xe3428b){const _0x49319f=[new window[(_0x12099a([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x3907d2=>setTimeout(_0x3907d2,0x3df6fa2d^_0x1cf23f)),_0x49c046[_0x12099a([0x74,0x68,0x65,0x6e])](()=>new window[(_0x12099a([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x446813=>{let _0x36f37a=0x0;_0x195d94[_0x12099a([0x6d,0x6f,0x64,0x65,0x6c])][_0x12099a([0x6f,0x6e])](_0x12099a([0x61,0x70,0x70,0x6c,0x79,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e]),(_0x1c9627,_0xbcd0e7)=>{_0xbcd0e7[0x0][_0x12099a([0x69,0x73,0x44,0x6f,0x63,0x75,0x6d,0x65,0x6e,0x74,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e])]&&_0x36f37a++,_0x36f37a==(0x3dffc109^_0x1cf23f)&&(_0x446813(),_0x1c9627[_0x12099a([0x6f,0x66,0x66])]());});}))];return window[_0x12099a([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65])][_0x12099a([0x72,0x61,0x63,0x65])](_0x49319f)[_0x12099a([0x74,0x68,0x65,0x6e])](()=>_0xe3428b);}async function _0x2a13c3(){await _0x49c046,_0x195d94[_0x12099a([0x6d,0x6f,0x64,0x65,0x6c])][_0x12099a([0x63,0x68,0x61,0x6e,0x67,0x65])]=_0x27df75,_0x195d94[_0x12099a([0x6d,0x6f,0x64,0x65,0x6c])][_0x12099a([0x65,0x6e,0x71,0x75,0x65,0x75,0x65,0x43,0x68,0x61,0x6e,0x67,0x65])]=_0x27df75,_0x195d94[_0x12099a([0x65,0x6e,0x61,0x62,0x6c,0x65,0x52,0x65,0x61,0x64,0x4f,0x6e,0x6c,0x79,0x4d,0x6f,0x64,0x65])](_0x12099a([0x6d,0x6f,0x64,0x65,0x6c]));}function _0x4be6ac(_0x19a61f){const _0x1512e5=_0x31347d();_0x195d94[_0x1512e5]=_0x12099a([0x61,0x69,0x4c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79])+_0x19a61f,_0x19a61f!=_0x12099a([0x56,0x61,0x6c,0x69,0x64])&&_0x2a13c3();}function _0x31347d(){const _0x233a96=window[_0x12099a([0x53,0x74,0x72,0x69,0x6e,0x67])](window[_0x12099a([0x70,0x65,0x72,0x66,0x6f,0x72,0x6d,0x61,0x6e,0x63,0x65])][_0x12099a([0x6e,0x6f,0x77])]())[_0x12099a([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](_0x12099a([0x2e]),'');let _0x20c029=_0x12099a([0x6e]);for(let _0x4c4ec0=0x0;_0x4c4ec0<_0x233a96[_0x12099a([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0x4c4ec0+=0x2){let _0x11ad92=window[_0x12099a([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x233a96[_0x12099a([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0x4c4ec0,_0x4c4ec0+0x2));_0x11ad92>=_0x3beaee[_0x12099a([0x6c,0x65,0x6e,0x67,0x74,0x68])]&&(_0x11ad92-=_0x3beaee[_0x12099a([0x6c,0x65,0x6e,0x67,0x74,0x68])]),_0x20c029+=_0x3beaee[_0x11ad92];}return _0x20c029;}function _0x2f2383(){const _0x2251da=_0x3f4a06[_0x12099a([0x73,0x70,0x6c,0x69,0x74])](_0x12099a([0x2e]));if(0x3!=_0x2251da[_0x12099a([0x6c,0x65,0x6e,0x67,0x74,0x68])])return null;return _0x3e65f6(_0x2251da[0x1]);function _0x3e65f6(_0x539b77){const _0x35a46a=_0x29a69e(_0x539b77);return _0x35a46a&&_0x1e22f2()?_0x35a46a:null;function _0x1e22f2(){const _0x2c6f74=_0x35a46a[_0x12099a([0x6a,0x74,0x69])],_0x3a7611=window[_0x12099a([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x2c6f74[_0x12099a([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0x2c6f74[_0x12099a([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8),0x10),_0x2dfacb={..._0x35a46a,[_0x12099a([0x6a,0x74,0x69])]:_0x2c6f74[_0x12099a([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](0x0,_0x2c6f74[_0x12099a([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8)};return delete _0x2dfacb[_0x12099a([0x76,0x63])],_0x222e2d(_0x2dfacb)==_0x3a7611;}}}async function _0x214dc6(){let _0x4441bf=!0x0;try{const _0x3e7a6b=_0x3f4a06[_0x12099a([0x73,0x70,0x6c,0x69,0x74])](_0x12099a([0x2e])),[_0x185418,_0x4fdc48,_0x60a950]=_0x3e7a6b;return _0x5dc8de(_0x185418),await _0x43f916(_0x185418,_0x4fdc48,_0x60a950),_0x4441bf;}catch{return!0x1;}function _0x5dc8de(_0x1f233d){const _0x2e835c=_0x29a69e(_0x1f233d);_0x2e835c&&_0x2e835c[_0x12099a([0x61,0x6c,0x67])]==_0x12099a([0x45,0x53,0x32,0x35,0x36])||(_0x4441bf=!0x1);}async function _0x43f916(_0x5f493b,_0x2fd81c,_0x28a34f){const _0x26031c=window[_0x12099a([0x55,0x69,0x6e,0x74,0x38,0x41,0x72,0x72,0x61,0x79])][_0x12099a([0x66,0x72,0x6f,0x6d])](_0x40c642(_0x28a34f),_0x3cef2e=>_0x3cef2e[_0x12099a([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](0x0)),_0xd3be63=new window[(_0x12099a([0x54,0x65,0x78,0x74,0x45,0x6e,0x63,0x6f,0x64,0x65,0x72]))]()[_0x12099a([0x65,0x6e,0x63,0x6f,0x64,0x65])](_0x5f493b+_0x12099a([0x2e])+_0x2fd81c),_0x4c38fa=window[_0x12099a([0x63,0x72,0x79,0x70,0x74,0x6f])][_0x12099a([0x73,0x75,0x62,0x74,0x6c,0x65])];if(!_0x4c38fa)return;const _0x171273=await _0x4c38fa[_0x12099a([0x69,0x6d,0x70,0x6f,0x72,0x74,0x4b,0x65,0x79])](_0x12099a([0x6a,0x77,0x6b]),_0x404a1e,{[_0x12099a([0x6e,0x61,0x6d,0x65])]:_0x12099a([0x45,0x43,0x44,0x53,0x41]),[_0x12099a([0x6e,0x61,0x6d,0x65,0x64,0x43,0x75,0x72,0x76,0x65])]:_0x12099a([0x50,0x2d,0x32,0x35,0x36])},!0x1,[_0x12099a([0x76,0x65,0x72,0x69,0x66,0x79])]);await _0x4c38fa[_0x12099a([0x76,0x65,0x72,0x69,0x66,0x79])]({[_0x12099a([0x6e,0x61,0x6d,0x65])]:_0x12099a([0x45,0x43,0x44,0x53,0x41]),[_0x12099a([0x68,0x61,0x73,0x68])]:{[_0x12099a([0x6e,0x61,0x6d,0x65])]:_0x12099a([0x53,0x48,0x41,0x2d,0x32,0x35,0x36])}},_0x171273,_0x26031c,_0xd3be63)||(_0x4441bf=!0x1);}}function _0x29a69e(_0x81c47e){return _0x81c47e[_0x12099a([0x73,0x74,0x61,0x72,0x74,0x73,0x57,0x69,0x74,0x68])](_0x12099a([0x65,0x79]))?JSON[_0x12099a([0x70,0x61,0x72,0x73,0x65])](_0x40c642(_0x81c47e)):null;}function _0x40c642(_0x53fecf){return window[_0x12099a([0x61,0x74,0x6f,0x62])](_0x53fecf[_0x12099a([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/-/g,_0x12099a([0x2b]))[_0x12099a([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/_/g,_0x12099a([0x2f])));}function _0x222e2d(_0x7ab90e){let _0x51cde7=0x1505;function _0x4ffbe5(_0x3f29a8){for(let _0x125910=0x0;_0x125910<_0x3f29a8[_0x12099a([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0x125910++){const _0x487938=_0x3f29a8[_0x12099a([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](_0x125910);_0x51cde7=(_0x51cde7<<0x5)+_0x51cde7+_0x487938,_0x51cde7&=_0x51cde7;}}function _0x286be3(_0x472171){Array[_0x12099a([0x69,0x73,0x41,0x72,0x72,0x61,0x79])](_0x472171)?_0x472171[_0x12099a([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](_0x286be3):_0x472171&&typeof _0x472171==_0x12099a([0x6f,0x62,0x6a,0x65,0x63,0x74])?Object[_0x12099a([0x65,0x6e,0x74,0x72,0x69,0x65,0x73])](_0x472171)[_0x12099a([0x73,0x6f,0x72,0x74])]()[_0x12099a([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](([_0x1827f6,_0x2b8688])=>{_0x4ffbe5(_0x1827f6),_0x286be3(_0x2b8688);}):_0x4ffbe5(window[_0x12099a([0x53,0x74,0x72,0x69,0x6e,0x67])](_0x472171));}return _0x286be3(_0x7ab90e),_0x51cde7>>>0x0;}function _0x778911(_0x5c1617){return _0x5c1617[_0x12099a([0x74,0x6f,0x53,0x74,0x72,0x69,0x6e,0x67])](0x10)[_0x12099a([0x70,0x61,0x64,0x53,0x74,0x61,0x72,0x74])](0x8,_0x12099a([0x30]));}function _0x212f7f(_0x2115eb){return _0x2115eb[_0x12099a([0x73,0x70,0x6c,0x69,0x74])]('')[_0x12099a([0x72,0x65,0x76,0x65,0x72,0x73,0x65])]()[_0x12099a([0x6a,0x6f,0x69,0x6e])]('');}function _0x27df75(){}function _0x12099a(_0x55a975){return _0x55a975['map'](_0x40c81a=>String['fromCharCode'](_0x40c81a))['join']('');}_0x4be6ac(await _0x43f65c());}(this);}['showFakeVisualSelection'](){const _0x3ae6e9=this['editor']['model'];_0x3ae6e9['change'](_0x2246ff=>{const _0x3858f6=_0x3ae6e9['document']['selection']['getRanges']();let _0xf1f3b1=0x0;for(const _0x3d2a59 of _0x3858f6){const _0x1fbe3b=Oi+':'+_0xf1f3b1;if(_0x3ae6e9['markers']['has'](_0x1fbe3b))_0x2246ff['updateMarker'](_0x1fbe3b,{'range':_0x3d2a59});else{if(_0x3d2a59['start']['isAtEnd']){const _0x4e6c6a=_0x3d2a59['start']['getLastMatchingPosition'](({item:_0xa5018a})=>!_0x3ae6e9['schema']['isContent'](_0xa5018a),{'boundaries':_0x3d2a59});_0x2246ff['addMarker'](_0x1fbe3b,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x2246ff['createRange'](_0x4e6c6a,_0x3d2a59['end'])});}else _0x2246ff['addMarker'](_0x1fbe3b,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x3d2a59});}_0xf1f3b1++;}});}['hideFakeVisualSelection'](){const _0x492e48=this['editor']['model'],_0xf683f0=Array['from'](this['editor']['model']['markers']['getMarkersGroup'](Oi));_0xf683f0['length']&&_0x492e48['change'](_0x34b138=>{_0xf683f0['forEach'](_0x184c97=>{_0x34b138['removeMarker'](_0x184c97);});});}['insertContent'](_0x307b52,_0x182eba){const _0x282ab7=this['_getAISelection'](),_0x521831=_0x182eba||_0x282ab7['getFirstRange']();this['editor']['model']['canEditAt'](_0x521831)&&this['editor']['model']['change'](_0x5a8962=>{this['hideFakeVisualSelection'](),_0x182eba||this['_resetContentOfSelectedTableCells'](_0x5a8962,_0x282ab7),this['_pasteHTMLUsingClipboard']({'insertAt':_0x521831,'writer':_0x5a8962,'html':_0x307b52});});}['insertContentBelow'](_0x3b67e9){const {model:_0x1c0725}=this['editor'],_0x5b6352=this['_getAISelection']();_0x1c0725['change'](()=>{const _0xfae7c1=this['_prepareTableInsertBelowPosition'](_0x3b67e9,_0x5b6352)||this['_getDefaultInsertBelowPosition'](_0x5b6352);this['insertContent'](_0x3b67e9,_0xfae7c1);});}['_getAISelection'](){const _0x7340aa=this['editor']['model'],_0x28df05=Array['from'](_0x7340aa['markers']['getMarkersGroup'](Oi))['map'](_0x5581ac=>_0x5581ac['getRange']());return _0x7340aa['createSelection'](_0x28df05);}['_pasteHTMLUsingClipboard']({writer:_0xcad5ca,html:_0x107771,insertAt:_0x3a3697}){const {view:_0xf21355}=this['editor']['editing'],_0x4f0333=this['editor']['plugins']['get'](_0x331886),_0x1f611f=new Ri();_0x1f611f['setData']('text/html',_0x107771);const _0x10eb37=new ClipboardEvent('paste',{'clipboardData':_0x1f611f}),_0x9bcb4=new _0xddd5e8(_0xf21355,_0x10eb37,{'dataTransfer':new _0x9e3cb9(_0x1f611f)});_0xcad5ca['setSelection'](_0x3a3697);const _0x19214a=(_0x6565f0,_0x56e6f3)=>{_0x56e6f3['resultRange']&&_0xcad5ca['setSelection'](_0x56e6f3['resultRange']);};_0x4f0333['once']('contentInsertion',_0x19214a,{'priority':'lowest'}),_0xf21355['document']['fire']('paste',_0x9bcb4),_0x4f0333['off']('contentInsertion',_0x19214a);}['_getDefaultInsertBelowPosition'](_0x1e09ed){const {model:_0x1b25f7}=this['editor'],_0x21d71d=Array['from'](_0x1e09ed['getSelectedBlocks']());return _0x21d71d['length']?_0x1b25f7['createPositionAfter'](_0x21d71d['pop']()):_0x1e09ed['getLastPosition']();}['_prepareTableInsertBelowPosition'](_0x1bcd61,_0xeb5fea){const {model:_0x2774e1,plugins:_0x477034}=this['editor'];if(_0x477034['has']('TableUtils')){const _0x4d734f=_0x477034['get']('TableUtils')['getSelectedTableCells'](_0xeb5fea);if(_0x4d734f['length']){const _0x378b36=this['_getTableRowCountFromContent'](_0x1bcd61),_0x478041=this['_createEmptyTableRows'](_0x4d734f,_0x378b36);return _0x2774e1['createPositionAt'](_0x478041,0x0);}}return null;}['_getTableRowCountFromContent'](_0x1158fc){const _0x3bca1d=this['editor']['plugins']['get']('TableUtils'),_0x407024=this['editor']['data']['parse'](_0x1158fc),_0x1d36e1=Array['from'](_0x407024['getChildren']())['filter'](_0x1a03af=>_0x1a03af['is']('element','table'));let _0x3cd0c4=0x0;return _0x1d36e1['forEach'](_0x4aa7fb=>{_0x3cd0c4+=_0x3bca1d['getRows'](_0x4aa7fb);}),_0x3cd0c4;}['_createEmptyTableRows'](_0x252b70,_0xeb0174){const _0x1a6d4a=this['editor']['plugins']['get']('TableUtils'),_0x1fd7b5=_0x1a6d4a['getRowIndexes'](_0x252b70),_0xe2f2a7=_0x1a6d4a['getColumnIndexes'](_0x252b70),_0x4d8929=_0x1fd7b5['last']+0x1,_0x2eb518=_0xe2f2a7['first'],_0x1b9239=_0x252b70[0x0]['findAncestor']('table');for(let _0x5301d4=0x0;_0x5301d4<_0xeb0174;_0x5301d4++)_0x1a6d4a['insertRows'](_0x1b9239,{'at':_0x4d8929});return _0x1b9239['getChild'](_0x4d8929)['getChild'](_0x2eb518);}['_resetContentOfSelectedTableCells'](_0x3b2a0b,_0x39d68f){const {plugins:_0x535a19}=this['editor'],{model:_0x182b71}=_0x3b2a0b;if(!_0x535a19['has']('TableUtils'))return;_0x535a19['get']('TableUtils')['getSelectedTableCells'](_0x39d68f)['length']&&_0x182b71['deleteContent'](_0x39d68f);}}class Ni extends _0x52790d{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(_0x13a2cc){super(_0x13a2cc),this['name']='AIRequestError';}}function yi(_0x402a30,_0x218b14,_0x5afe74){const t=_0x402a30['t'];switch(_0x218b14){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',_0x5afe74);case'Error\x20during\x20AI\x20content\x20generation:\x20%0':return t('Error\x20during\x20AI\x20content\x20generation:\x20%0',_0x5afe74);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'},_0x5afe74);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 _0x218b14;}}class xi extends _0x385b22{['_commandDefinitions'];constructor(_0xa1f96a,_0x1ed3af){super(_0xa1f96a),this['_commandDefinitions']=_0x1ed3af,this['set']('enabledCommandsIds',[]),this['on']('change:_hasContext',(_0x121643,_0x43f120,_0x16c6ba)=>{this['isEnabled']&&(this['enabledCommandsIds']=Li(this['_commandDefinitions'],_0x16c6ba));}),this['set']('_hasContext',!0x1),this['on']('change:isEnabled',(_0x28cf0a,_0x2ed771,_0x3bb733)=>{this['enabledCommandsIds']=_0x3bb733?Li(this['_commandDefinitions'],this['_hasContext']):[];});}['refresh'](){const _0x501267=this['editor']['model'];this['_hasContext']=function(_0x4b2702){const _0x22a36c=_0x4b2702['document']['selection'];return _0x22a36c['isCollapsed']?0x0!==[..._0x22a36c['getSelectedBlocks']()]['length']&&![..._0x22a36c['getSelectedBlocks']()][0x0]['isEmpty']:!!_0x4b2702['hasContent'](_0x22a36c['getFirstRange']());}(_0x501267);const _0x4d169a=_0x501267['document']['selection'],_0x32683d=this['editor']['config']['get']('ai.assistant.disabledElements');for(const _0x11e39e of _0x4d169a['getRanges']())for(const _0x5a3721 of _0x11e39e['getItems']())if(_0x5a3721['is']('element')&&_0x32683d['includes'](_0x5a3721['name']))return void(this['isEnabled']=!0x1);this['isEnabled']=!0x0;}['execute'](_0x430480='',_0x308f21='',_0x4b12e9='custom'){this['editor']['plugins']['get'](Xi)['showUI'](_0x430480,_0x308f21,_0x4b12e9);}}function Li(_0x1f812f,_0x80b202){const _0x2046df=new Set();for(const _0x518154 of _0x1f812f['values']())(_0x80b202||!0x1===_0x518154['requiresContent'])&&_0x2046df['add'](_0x518154['id']);return Array['from'](_0x2046df);}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(_0x4a622b,_0x28c9a0,_0x3d745f){super(),this['editor']=_0x4a622b,this['textAdapter']=_0x28c9a0,this['_sanitizationContainer']=document['createElement']('div'),this['_domParser']=new DOMParser(),this['_xmlSerializer']=new XMLSerializer(),this['view']=_0x3d745f,this['set']({'initialContext':'','currentContext':'','currentResponse':'','previousContext':void 0x0,'previousQuery':void 0x0,'previousLabel':void 0x0,'isProcessing':!0x1}),this['on']('set:currentContext',(_0x1e668d,_0x40f9b2,_0x4e6341)=>{this['view']['value']=this['_sanitizeHTML'](_0x4e6341);}),this['listenTo'](this['view'],'submitPrompt',(_0x275156,_0x5e84f7)=>{const _0x264ad8=this['currentContext']||this['initialContext'];this['_handleQuery'](_0x5e84f7,_0x264ad8,'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:_0xcca56d,query:_0x1a2198,htmlContent:_0x362884,label:_0x202755,mainActionLabel:_0x28ec49}){this['view']['prompt']=_0x202755,this['view']['mainAction']=_0x28ec49,this['initialContext']=_0x362884,_0x1a2198&&(this['view']['isRendered']?this['_handleQuery'](_0x1a2198,_0x362884,_0xcca56d,_0x202755):this['view']['once']('render',()=>{this['_handleQuery'](_0x1a2198,_0x362884,_0xcca56d,_0x202755);}));}['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'](_0x5cb17b,_0x500ca7,_0x2124f4,_0x3cc0fa){return this['isProcessing']=!0x0,this['view']['startProcessing'](),this['previousContext']=_0x500ca7,this['previousQuery']=_0x5cb17b,this['previousLabel']=_0x3cc0fa||_0x5cb17b,this['previousActionId']=_0x2124f4,new Promise(_0x347b82=>{this['textAdapter']['makeRequest']({'query':_0x5cb17b,'context':_0x500ca7,'onData':_0x60b375=>{this['currentResponse']=_0x60b375,this['currentContext']=this['_parseAndNormalizeContent'](this['currentResponse']);},'actionId':_0x2124f4})['then'](()=>{!this['currentContext']&&this['currentResponse']&&(this['currentContext']=this['_parseAndNormalizeContent'](this['currentResponse'],!0x0));})['catch'](_0x39a52c=>{_0x39a52c instanceof vi?this['view']['handleError'](_0x39a52c['message']):this['view']['handleError'](),_0x347b82();})['finally'](()=>{this['stopProcessing'](),_0x347b82();});});}['_parseAndNormalizeContent'](_0xba42a2,_0xfc0a32=!0x1){const _0xd809b7=Di['exec'](_0xba42a2);_0xba42a2=_0xd809b7?_0xba42a2['substring'](_0xd809b7[0x1]['length']):_0xba42a2['length']<0x64&&!_0xfc0a32?'':this['_stripMarkdownSyntax'](_0xba42a2);const _0x211f43=this['_domParser']['parseFromString'](_0xba42a2,'text/html');if(_0xd809b7){const _0x38bbd0=Array['from'](_0x211f43['body']['childNodes']);_0x38bbd0['reverse']();for(const _0x2c5aa7 of _0x38bbd0){if(_0x2c5aa7['nodeType']==Node['ELEMENT_NODE'])break;_0x2c5aa7['remove']();}}const _0x15cd31=this['editor']['data']['processor']['toView'](this['_xmlSerializer']['serializeToString'](_0x211f43['body']));this['_isH1TagSupportEnabled']()||this['_normalizeResponseHeadings'](_0x15cd31);const _0x1f5e16=this['editor']['config']['get']('ai.assistant.preserveComments'),_0x1d1d17=this['editor']['data']['toModel'](_0x15cd31);return _0x1f5e16||_0x1d1d17['markers']['clear'](),this['editor']['data']['stringify'](_0x1d1d17);}['_normalizeResponseHeadings'](_0x1361aa){const _0x12ce62=new _0x439338(this['editor']['editing']['view']['document']),_0x10ebc7=new _0xa9734e({'name':/^h[1-5]$/}),_0x3a777c=[];let _0x2e9eac=!0x1;for(const _0x149832 of _0x1361aa)_0x149832['is']('element')&&_0x10ebc7['match'](_0x149832)&&(_0x3a777c['push'](_0x149832),'h1'==_0x149832['name']&&(_0x2e9eac=!0x0));if(_0x2e9eac){for(const _0x176245 of _0x3a777c)_0x12ce62['rename']('h'+(parseInt(_0x176245['name'][0x1])+0x1),_0x176245);}}['_isH1TagSupportEnabled'](){const {data:_0x65983c,editing:_0x36fa87}=this['editor'],_0x1eb912=_0x65983c['htmlProcessor']['toView']('<h1></h1>'),_0x51f22b=_0x65983c['toView'](_0x65983c['toModel'](_0x1eb912));return!!_0x36fa87['view']['domConverter']['viewToDom'](_0x51f22b)['querySelector']('h1');}['_sanitizeHTML'](_0x5d09e2){return this['editor']['editing']['view']['domConverter']['setContentOf'](this['_sanitizationContainer'],_0x5d09e2),this['_sanitizationContainer']['innerHTML'];}['_stripMarkdownSyntax'](_0x452fca){const _0x399a06=_0x452fca['trim']();return _0x399a06['startsWith']('```html')?_0x399a06['endsWith']('```')?_0x399a06['substring'](0x7,_0x399a06['length']-0x3):_0x399a06['substring'](0x7):_0x452fca;}}const Hi={'REPLACE':'replace','INSERT':'insert'};class Mi extends kt{constructor(_0x24d1d4){super(_0x24d1d4),this['set']('isVisible',!0x1),this['set']('mainAction',Hi['REPLACE']),this['replaceButton']=this['_createButton']('','ck-button-action'),this['replaceButton']['bind']('label')['to'](this,'mainAction',_0x36e2cb=>yi(_0x24d1d4,'AI_'+_0x36e2cb['toUpperCase']()+'_CONTENT')),this['insertButton']=this['_createButton'](yi(_0x24d1d4,'Insert\x20below')),this['tryAgainButton']=this['_createButton'](yi(_0x24d1d4,'Try\x20again')),this['stopButton']=this['_createButton'](yi(_0x24d1d4,'Stop'));const _0x9c6bfb=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':['ck-ai-form__toolbar',_0x9c6bfb['if']('isVisible','ck-hidden',_0xea3a8f=>!_0xea3a8f)]}}),this['items']['addMany']([this['replaceButton'],this['insertButton'],this['tryAgainButton'],this['stopButton']]);}['_createButton'](_0x3c641b,_0x26bd7d){const _0x4dc473=new Nt(this['locale']);return _0x4dc473['set']({'label':_0x3c641b,'class':_0x26bd7d||'','isVisible':!0x0,'withText':!0x0}),_0x4dc473;}}class Ui extends vt{['contentFieldView'];['copyButtonView'];constructor(_0x2cada1,_0xaaf186=''){super(_0x2cada1),this['set']({'value':null,'isVisible':!0x1,'isProcessing':!0x1});const _0x27b41c=this['bindTemplate'];this['contentFieldView']=new Vi(_0x2cada1,_0xaaf186),this['copyButtonView']=this['_createCopyButton'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area-wrapper',_0x27b41c['if']('isVisible','ck-hidden',_0x1bb30a=>!_0x1bb30a)],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area',_0x27b41c['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 _0x1fecb1=!0x1;this['on']('change:value',(_0x4a2b92,_0x2cd475,_0x4cad00)=>{const _0x388669=!this['contentFieldView']['element']['querySelector']('.ck-ai-form__loader');this['contentFieldView']['setContent'](_0x4cad00),this['isProcessing']&&_0x388669&&!_0x1fecb1&&this['element']['scrollTo']({'top':this['element']['scrollHeight'],'behavior':'smooth'});}),this['on']('change:isProcessing',(_0x447b74,_0x51028,_0x4de2f1)=>{_0x1fecb1=!0x1,_0x4de2f1?(this['value']=null,this['contentFieldView']['appendLoader']()):this['value']||this['contentFieldView']['setContent']('');}),this['listenTo'](this['element'],'wheel',()=>{_0x1fecb1=!0x0;}),this['listenTo'](this['element'],'mousedown',()=>{_0x1fecb1=!0x0;});}['focus'](){this['element']['focus']();}['_createCopyButton'](){const _0x230c0a=this['locale'],_0x2e43ee=new Nt(this['locale']),_0x572cd4='ck-ai-form__copy-button';return _0x2e43ee['set']({'label':yi(_0x230c0a,'Copy'),'icon':_0x20733a,'class':_0x572cd4,'tooltip':!0x0}),_0x2e43ee['bind']('isVisible')['to'](this,'value',_0x1b1730=>!!_0x1b1730),_0x2e43ee['bind']('isEnabled')['to'](this,'isProcessing',_0x389689=>!_0x389689),_0x2e43ee['on']('execute',()=>{this['_copyHTMLToClipboard'](this['contentFieldView']['element']),_0x2e43ee['icon']=_0x4dbbde,_0x2e43ee['class']=_0x572cd4+'\x20ck-ai-form__copy-button--copied',this['focus'](),setTimeout(()=>{_0x2e43ee['icon']=_0x20733a,_0x2e43ee['class']=_0x572cd4;},0x3e8);}),_0x2e43ee;}['_copyHTMLToClipboard'](_0x26d2e7){const {window:_0x5099a5,document:_0xf72acf}=lt;if(_0x5099a5['ClipboardItem']){const {Blob:_0xed6ae,ClipboardItem:_0x322cee}=_0x5099a5,_0x59ca30=[new _0x322cee({'text/html':new _0xed6ae([_0x26d2e7['innerHTML']],{'type':'text/html'}),'text/plain':new _0xed6ae([_0x26d2e7['textContent']||''],{'type':'text/plain'})})];navigator['clipboard']['write'](_0x59ca30);}else{const _0x28698a=_0xf72acf['createElement']('div');_0x28698a['style']['position']='absolute',_0x28698a['style']['left']='-9999px',_0x28698a['innerHTML']='<span>[</span>'+_0x26d2e7['innerHTML']+'<span>]</span>',_0xf72acf['body']['appendChild'](_0x28698a);const _0x55e3aa=_0xf72acf['createRange']();_0x55e3aa['setStartAfter'](_0x28698a['firstElementChild']),_0x55e3aa['setEndBefore'](_0x28698a['lastElementChild']);const _0xb82a90=_0x5099a5['getSelection']();_0xb82a90['removeAllRanges'](),_0xb82a90['addRange'](_0x55e3aa),_0xf72acf['execCommand']('copy'),_0x28698a['remove']();}}}class Vi extends vt{constructor(_0x2dd8da,_0x399a79=''){super(_0x2dd8da),this['loaderView']=this['_createLoader'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-content',_0x399a79,'ck-reset_all-excluded','ck-ai-form__content-field']}});}['setContent'](_0x3b4b06){this['element']['innerHTML']=_0x3b4b06;}['appendLoader'](){this['element']['appendChild'](this['loaderView']['element']);}['_createLoader'](){const _0x4e93e7=new vt(),_0x4c73e0=this['locale'],_0x2eff38=new yt();return _0x2eff38['isVisible']=!0x0,_0x4e93e7['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__loader']},'children':[_0x2eff38,{'text':yi(_0x4c73e0,'AI\x20is\x20writing...')}]}),_0x4e93e7['render'](),_0x4e93e7;}}class Bi extends vt{constructor(_0x3ac830,_0x21147e=''){super(_0x3ac830);const _0x2bde70=new xt(),_0x2bd2b9=this['bindTemplate'];this['set']('text',_0x21147e),_0x2bde70['content']=_0x51c23f,this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__error']},'children':[_0x2bde70,{'text':_0x2bd2b9['to']('text')}]});}}class Gi extends Lt{['submitButtonView'];['showHistoryButtonView'];constructor(_0x3c95e0,_0x2b7ae0){super(_0x3c95e0,_0x2b7ae0),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',(_0x448ba9,_0x25a301)=>{_0x448ba9['target']==this['queryView']['fieldView']['element']&&(this['submit'](),_0x25a301());});}['_createSubmitButton'](){const _0x3c87cc=new Nt(this['locale']),_0x14552b=this['locale'];return _0x3c87cc['set']({'icon':_0x8a76b5,'label':yi(_0x14552b,'Submit'),'isVisible':!0x0,'tooltip':!0x0,'class':'ck-ai-form__submit'}),_0x3c87cc['on']('execute',()=>{this['submit']();}),_0x3c87cc['bind']('isEnabled')['to'](this['queryView']['fieldView'],'isEmpty',this,'isEnabled',(_0x3a342d,_0x463525)=>!_0x3a342d&&_0x463525),_0x3c87cc;}['_createShowHistoryButton'](){const _0x55e8ae=new Nt(this['locale']),_0x3fcbf1=this['resultsView'],_0x3cc5ac=this['locale'];_0x55e8ae['set']({'label':yi(_0x3cc5ac,'History'),'withText':!0x1,'icon':_0x206f96,'tooltip':!0x0,'tooltipPosition':'sw','class':'ck-ai-form__toggle-history'}),_0x55e8ae['bind']('isOn')['to'](_0x3fcbf1,'isVisible'),_0x55e8ae['bind']('isEnabled')['to'](this,'isEnabled'),_0x55e8ae['on']('execute',()=>{_0x3fcbf1['isVisible']=!_0x3fcbf1['isVisible'],_0x3fcbf1['isVisible']?this['filteredView']['focus']():this['focus']();});const _0x5777fe=()=>{lt['window']['requestAnimationFrame'](()=>{if(ut(this['element'])){const _0x3ce3b1=new dt(this['queryView']['fieldView']['element']),_0x3d51cf=_0x3ce3b1['width'],_0x56696e='rtl'===_0x3cc5ac['uiLanguageDirection']?'left':'right';_0x3ce3b1['excludeScrollbarsAndBorders'](),_0x55e8ae['element']['style'][_0x56696e]=_0x3d51cf-_0x3ce3b1['width']+0x1+'px';}});};return this['queryView']['fieldView']['on']('update',_0x5777fe),this['on']('render',_0x5777fe),_0x55e8ae;}['submit'](){const _0x13b922=this['queryView']['fieldView']['element']['value'];this['fire']('submit',_0x13b922);}['focus'](_0x32b645){-0x1===_0x32b645?this['focusCycler']['focusLast']():this['focusCycler']['focusFirst']();}}class Fi extends Dt{['historyGroupView'];['clearHistoryButton'];constructor(_0x5653a1){super(_0x5653a1),this['clearHistoryButton']=this['_createClearHistoryButton'](),this['historyGroupView']=new Pt(),this['historyGroupView']['children']['add'](this['clearHistoryButton'],0x1),this['historyGroupView']['label']=yi(_0x5653a1,'Prompt\x20history'),this['historyGroupView']['items']['delegate']('execute')['to'](this),this['items']['add'](this['historyGroupView']);}['filter'](){let _0x3d267d=0x0;for(const _0x221392 of this['items'])_0x3d267d+=_0x221392['items']['length'];return{'resultsCount':_0x3d267d,'totalItemsCount':_0x3d267d};}['_createClearHistoryButton'](){const _0x2fb780=this['locale'],_0x2a3607=new Nt(this['locale']);return _0x2a3607['set']({'label':'('+yi(_0x2fb780,'Clear')+')','withText':!0x0}),_0x2a3607['on']('execute',()=>this['fire']('clearHistory')),_0x2a3607;}}class Ki extends Ht{constructor(_0x1aee15){super();const _0x112bc3=new Mt(),_0x56c024=new Nt(this['locale'],_0x112bc3);this['children']['add'](_0x56c024),_0x56c024['set']({'label':_0x1aee15['prompt'],'withText':!0x0}),_0x56c024['on']('execute',()=>{this['fire']('execute',{'value':_0x369a92(_0x1aee15['prompt'])});});}}const Wi='CKEditor/AIFormView/PromptHistory';class Yi extends _t{constructor(){super(),this['_loadFromSessionStorage'](),this['on']('add',(_0x38a192,_0x184b4f)=>{const _0x4529be=$i(_0x184b4f['prompt']);for(const _0x509d1d of this)if(_0x509d1d!=_0x184b4f&&$i(_0x509d1d['prompt'])===_0x4529be){this['remove'](_0x509d1d);break;}this['length']>0x14&&this['remove'](this['last']),this['_saveToSessionStorage']();}),this['on']('remove',()=>{this['_saveToSessionStorage']();});}['_loadFromSessionStorage'](){const _0x4e1f49=sessionStorage['getItem'](Wi)||'[]';this['addMany'](JSON['parse'](_0x4e1f49));}['_saveToSessionStorage'](){sessionStorage['setItem'](Wi,JSON['stringify'](this['map'](_0x5cf177=>_0x5cf177)));}}function $i(_0x1e8373){return _0x1e8373['toLowerCase']()['trim']();}class qi extends vt{['focusTracker'];['keystrokes'];['contentArea'];['toolbar'];['promptView'];['errorView'];['_focusables'];['focusCycler'];['_promptHistory'];constructor(_0x453994,_0x501e69,_0x33c4b2=''){super(_0x453994),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(_0x453994),this['contentArea']=new Ui(_0x453994,_0x33c4b2),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 _0x389b97=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form',_0x501e69],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-form-content']},'children':[{'tag':'div','attributes':{'class':[_0x389b97['if']('isError','ck-hidden',_0x4ec2b3=>!_0x4ec2b3)]},'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'](_0x3a1732=0x1){-0x1===_0x3a1732?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 _0x5e09da=this['locale'],_0x3b5e00=new Gi(_0x5e09da,{'queryView':{'label':yi(_0x5e09da,'Ask\x20AI\x20to\x20edit\x20or\x20generate'),'creator':Vt,'showIcon':!0x1,'showResetButton':!0x1},'infoView':{'text':{'noSearchableItems':{'primary':yi(_0x5e09da,'Empty\x20history'),'secondary':yi(_0x5e09da,'Ask\x20AI\x20and\x20your\x20prompts\x20will\x20be\x20listed\x20here\x20for\x20you\x20to\x20use\x20later.')}}},'filteredView':this['_createHistoryView'](),'queryMinChars':0x1/0x0,'resetOnBlur':!0x1});return _0x3b5e00['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',(_0xe0eb95,_0x131137)=>_0xe0eb95&&!_0x131137),this['listenTo'](_0x3b5e00,'submit',(_0x21e0d2,_0x47a462)=>{this['prompt']=_0x47a462;const _0x2d2140=_0x31dc1d(_0x47a462);this['fire']('submitPrompt',_0x2d2140),_0x47a462['trim']()&&this['_promptHistory']['add']({'prompt':_0x2d2140},0x0);},{'priority':'high'}),_0x3b5e00;}['_createHistoryView'](){const _0x475bdc=new Fi(this['locale']);return _0x475bdc['historyGroupView']['items']['bindTo'](this['_promptHistory'])['as'](Ki),_0x475bdc['on']('clearHistory',()=>{this['_promptHistory']['clear'](),this['promptView']['search'](''),this['promptView']['focus']();}),_0x475bdc;}['_createToolbar'](){const _0x4f818b=new Mi(this['locale']);return _0x4f818b['replaceButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',this,'value',(_0x347175,_0x203fc,_0x5f109e)=>_0x347175&&!_0x203fc&&!!_0x5f109e),_0x4f818b['replaceButton']['delegate']('execute')['to'](this,'replaceContent'),_0x4f818b['insertButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',this,'value',(_0xdac982,_0x51eb09,_0x3c7ed7)=>_0xdac982&&!_0x51eb09&&!!_0x3c7ed7),_0x4f818b['insertButton']['delegate']('execute')['to'](this,'insertContentBelow'),_0x4f818b['tryAgainButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',(_0xfda0a5,_0x167bd7)=>_0xfda0a5&&!_0x167bd7),_0x4f818b['tryAgainButton']['delegate']('execute')['to'](this,'tryAgainEvent'),_0x4f818b['stopButton']['bind']('isEnabled')['to'](this,'isProcessing'),_0x4f818b['stopButton']['delegate']('execute')['to'](this,'stopProcessing'),_0x4f818b;}['startProcessing'](){this['value']='',this['isError']=!0x1,this['isProcessing']=!0x0,this['contentArea']['isVisible']=!0x0,this['toolbar']['isVisible']=!0x0,this['contentArea']['focus']();}['finishProcessing'](){const _0xbe2d74=this['locale'];this['isProcessing']=!0x1,this['prompt']='',this['promptView']['reset'](),this['value']&&(this['promptView']['queryView']['label']=yi(_0xbe2d74,'Ask\x20AI\x20to\x20improve\x20generated\x20text'));}['handleError'](_0x3951d2){const _0xcb90ed=this['locale'];this['finishProcessing'](),this['isError']=!0x0,this['errorView']['text']=_0x3951d2||yi(_0xcb90ed,'AI_ERROR_FAILED'),this['value']||(this['contentArea']['isVisible']=!0x1);}}const Qi=globalThis['DataTransfer'];class Xi extends _0x52790d{['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[_0x1f2393,ki,Ni,Bt];}constructor(_0x20178a){super(_0x20178a),_0x20178a['config']['define']('ai.assistant.disabledElements',['media','rawHtml','tableOfContents']),_0x20178a['config']['define']('ai.assistant.contentAreaCssClass',''),_0x20178a['config']['define']('ai.assistant.useTheme',!0x0),this['_uiCssClasses']='ck-ai-assistant-ui'+(_0x20178a['config']['get']('ai.assistant.useTheme')?'\x20ck-ai-assistant-ui_theme':'');}['init'](){const {editor:_0x27f601}=this;this['_aiAdapter']=_0x27f601['plugins']['get'](Ni),this['_dialog']=_0x27f601['plugins']['get'](Bt),this['_formView']=null,this['_commandDefinitions']=this['_getResolvedCommandsDefinitions']();const _0x1b513d=new xi(_0x27f601,Array['from'](this['_commandDefinitions']['values']()));_0x27f601['commands']['add']('showAIAssistant',_0x1b513d),_0x27f601['ui']['componentFactory']['add']('aiCommands',_0x116261=>{const _0x5c2ee8=Gt(_0x116261);return _0x5c2ee8['set']({'class':'ck-ai-commands-dropdown\x20'+this['_uiCssClasses']}),_0x5c2ee8['buttonView']['set']({'label':yi(_0x116261,'AI\x20Commands'),'icon':_0x4b4868,'tooltip':!0x0}),_0x5c2ee8['on']('execute',_0x6ee942=>this['_onExecute'](_0x6ee942['source']['id'])),Ft(_0x5c2ee8,_0x27f601['ui']['view']['body'],function(_0x50ed49){const _0xed2461=bi(_0x50ed49['config']['get']('ai.assistant.commands'),_0x50ed49['locale']),_0x49ab07=ji(_0x50ed49,_0xed2461)['filter'](_0x8e47f0=>_0x8e47f0['commands']['length']);if(0x1===_0x49ab07['length'])return ji(_0x50ed49,_0x49ab07[0x0]['commands'])['map'](_0x33c3d5=>({'id':_0x33c3d5['id'],'label':_0x33c3d5['label']}));return _0x49ab07['map'](_0x2bfcbd=>{const {groupId:_0xce0a48,groupLabel:_0x193a7d,commands:_0xad64ca}=_0x2bfcbd,_0x269f8c=ji(_0x50ed49,_0xad64ca)['map'](_0x56a470=>({'id':_0x56a470['id'],'label':_0x56a470['label']}));return{'id':_0xce0a48,'menu':_0x193a7d||_0xce0a48,'children':_0x269f8c};});}(_0x27f601),{'ariaLabel':yi(_0x116261,'AI\x20Commands')}),_0x5c2ee8['menuView']['menuPanelClass']='ck-ai-commands-dropdown\x20'+this['_uiCssClasses'],_0x1b513d['on']('change:enabledCommandsIds',_0x48d275),_0x5c2ee8['menuView']['once']('render',_0x48d275),_0x5c2ee8;function _0x48d275(){_0x5c2ee8['isEnabled']=_0x1b513d['enabledCommandsIds']['length']>0x0;for(const _0x5e901d of _0x5c2ee8['menuView']['buttons'])_0x5e901d['isEnabled']=_0x1b513d['enabledCommandsIds']['includes'](_0x5e901d['id']);}}),_0x27f601['ui']['componentFactory']['add']('menuBar:aiCommands',_0x1c5e3b=>{const _0x2e8663=new Kt(_0x1c5e3b);_0x2e8663['buttonView']['set']({'label':yi(_0x1c5e3b,'AI\x20Commands'),'icon':_0x4b4868}),_0x2e8663['bind']('isEnabled')['to'](_0x1b513d,'enabledCommandsIds',_0x4b5a8f=>_0x4b5a8f['length']>0x0);const _0x5c5c87=bi(_0x27f601['config']['get']('ai.assistant.commands'),_0x1c5e3b);return this['_populateMenuBarMenu'](_0x1b513d,_0x2e8663,_0x5c5c87,_0xd3e5e0=>this['_onExecute'](_0xd3e5e0)),_0x2e8663;}),_0x27f601['ui']['componentFactory']['add']('aiAssistant',()=>{const _0x1dc5c0=this['_createAIAssistantUIButton'](Nt);return _0x1dc5c0['set']({'tooltip':!0x0,'class':'ck-ai-assistant-button\x20'+this['_uiCssClasses']}),_0x1dc5c0;}),_0x27f601['ui']['componentFactory']['add']('menuBar:aiAssistant',()=>{const _0x39d66f=this['_createAIAssistantUIButton'](Wt);return _0x39d66f['set']({'role':'menuitemcheckbox'}),_0x39d66f;}),this['licenseKey']=this['editor']['config']['get']('licenseKey');const _0x5d928e=this['editor'];this['_licenseKeyCheckInterval']=setInterval(()=>{let _0x2d573c;for(const _0x1351c3 in _0x5d928e){const _0x547059=_0x1351c3,_0x2af270=_0x5d928e[_0x547059];if('aiLicenseKeyValid'==_0x2af270||'aiLicenseKeyInvalid'==_0x2af270||'aiLicenseKeyExpired'==_0x2af270||'aiLicenseKeyDomainLimit'==_0x2af270||'aiLicenseKeyNotAllowed'==_0x2af270||'aiLicenseKeyEvaluationLimit'==_0x2af270||'aiLicenseKeyUsageLimit'==_0x2af270){delete _0x5d928e[_0x547059],_0x2d573c=_0x2af270,clearInterval(this['_licenseKeyCheckInterval']),this['_licenseKeyCheckInterval']=void 0x0;break;}}'aiLicenseKeyInvalid'==_0x2d573c&&_0x5d928e['_showLicenseError']('invalid'),'aiLicenseKeyExpired'==_0x2d573c&&_0x5d928e['_showLicenseError']('expired'),'aiLicenseKeyDomainLimit'==_0x2d573c&&_0x5d928e['_showLicenseError']('domainLimit'),'aiLicenseKeyNotAllowed'==_0x2d573c&&_0x5d928e['_showLicenseError']('featureNotAllowed','AIAssistant'),'aiLicenseKeyEvaluationLimit'==_0x2d573c&&_0x5d928e['_showLicenseError']('evaluationLimit'),'aiLicenseKeyUsageLimit'==_0x2d573c&&_0x5d928e['_showLicenseError']('usageLimit');},0x3e8);}['destroy'](){super['destroy'](),this['_licenseKeyCheckInterval']&&clearInterval(this['_licenseKeyCheckInterval']);}['showUI'](_0x3da2bd='',_0x8c58eb='',_0x532982='custom'){const _0x361ea5=this['editor'],_0x3f9cb4=_0x361ea5['editing']['view'],_0x26cae7=_0x361ea5['plugins']['get'](ki),_0x2df014=_0x361ea5['plugins']['get'](_0x1f2393);_0x26cae7['showFakeVisualSelection']();const _0x5729c9=new Qi(),_0x4504c0=new ClipboardEvent('copy',{'clipboardData':_0x5729c9}),_0x3ed367=new _0x9e3cb9(_0x5729c9),_0x11f275=new _0xddd5e8(_0x3f9cb4,_0x4504c0,{'dataTransfer':_0x3ed367});_0x2df014['_forceMarkersCopy']('comment',()=>{_0x3f9cb4['document']['fire']('copy',_0x11f275);}),this['_formView']||(this['_initView'](),this['_aiAssistantController']=new Pi(_0x361ea5,this['_aiAdapter']['textAdapter'],this['_formView']));let _0x52f2d3=_0x3ed367['getData']('text/html');const _0x400e01=_0x361ea5['model']['document']['selection'],_0x56f883=Array['from'](_0x400e01['getRanges']());0x1===_0x56f883['length']&&_0x56f883[0x0]['isFlat']&&!_0x400e01['getSelectedElement']()&&''!==_0x52f2d3['replace'](/&nbsp;/g,'')['trim']()&&(_0x52f2d3='<p>'+_0x52f2d3+'</p>'),this['_aiAssistantController']['updateView']({'actionId':_0x532982,'query':_0x3da2bd,'htmlContent':_0x52f2d3,'label':_0x8c58eb,'mainActionLabel':Hi[_0x361ea5['model']['document']['selection']['isCollapsed']?'INSERT':'REPLACE']}),'aiAssistant'!==this['_dialog']['id']?this['_dialog']['show']({'id':'aiAssistant','icon':_0x270d7f,'title':yi(this['editor']['locale'],'AI\x20Assistant'),'content':this['_formView'],'position':Yt['EDITOR_TOP_SIDE'],'onShow':()=>{this['_formView']['focus']();},'onHide':()=>{this['_aiAssistantController']['reset'](),_0x26cae7['hideFakeVisualSelection']();}}):this['_dialog']['view']['wasMoved']||this['_dialog']['view']['updatePosition']();}['hideUI'](){this['_dialog']['hide']();}['_getResolvedCommandsDefinitions'](){const _0x5c10aa=new Map(),_0x3cf7a2=bi(this['editor']['config']['get']('ai.assistant.commands'),this['editor']['locale']);for(const _0x474646 of _0x3cf7a2)for(const _0x416aa5 of _0x474646['commands'])_0x5c10aa['set'](_0x416aa5['id'],{..._0x416aa5,'groupId':_0x474646['groupId'],'groupLabel':_0x474646['groupLabel']||_0x474646['groupId']});return _0x5c10aa;}['_createAIAssistantUIButton'](_0x23fb5a){const _0x2f2837=this['editor'],_0x625d2e=_0x2f2837['commands']['get']('showAIAssistant'),_0x2facf7=new _0x23fb5a(_0x2f2837['locale']);return _0x2facf7['set']({'label':yi(_0x2f2837['locale'],'AI\x20Assistant'),'icon':_0x270d7f,'isToggleable':!0x0}),_0x2facf7['bind']('isEnabled')['to'](_0x625d2e),_0x2facf7['bind']('isOn')['to'](this['_dialog'],'id',_0x8b32f1=>'aiAssistant'===_0x8b32f1),this['listenTo'](_0x2facf7,'execute',()=>{_0x2facf7['isOn']?this['hideUI']():_0x625d2e['execute']();}),_0x2facf7;}['_initView'](){const _0x4d9b97=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',()=>{_0x4d9b97['insertContent'](this['_aiAssistantController']['currentContext']),this['hideUI']();}),this['listenTo'](this['_formView'],'insertContentBelow',()=>{_0x4d9b97['insertContentBelow'](this['_aiAssistantController']['currentContext']),this['hideUI']();}),this['_initAriaAiStatusChangeAnnouncements']();}['_initAriaAiStatusChangeAnnouncements'](){const {locale:_0x246b97,ui:{ariaLiveAnnouncer:_0x4ccb62}}=this['editor'];this['_formView']['contentArea']['on']('change:isProcessing',(_0x681eb5,_0x14d312,_0x181c95)=>{const _0x5e4e5a=this['_aiAssistantController']['currentContext'];_0x181c95?_0x4ccb62['announce'](yi(_0x246b97,'AI\x20is\x20writing')):_0x5e4e5a&&_0x4ccb62['announce'](yi(_0x246b97,'Generated\x20content:\x20%0',_0x5e4e5a),{'politeness':'polite','isUnsafeHTML':!0x0});}),this['_formView']['on']('change:isError',(_0x3c38ef,_0x4dfedd,_0x954aef)=>{if(_0x954aef){const _0x26e46a=this['_formView']['errorView']['text'];_0x4ccb62['announce'](yi(_0x246b97,'Error\x20during\x20AI\x20content\x20generation:\x20%0',_0x26e46a));}});}['_onExecute'](_0x5cf23f){const _0x44804e=this['_commandDefinitions']['get'](_0x5cf23f),_0x4b9758=this['editor'],_0x5ef883=_0x4b9758['model']['document']['selection'],_0x485012=_0x4b9758['commands']['get']('showAIAssistant'),_0x40c0e8=_0x4b9758['plugins']['get'](ki),_0x1cd25c=''+(_0x44804e['groupId']!==Si?_0x44804e['groupLabel']+':\x20':'')+_0x44804e['label'];if(!0x1!==_0x44804e['requiresContent']&&_0x5ef883['isCollapsed']){const _0x3ba970=It(_0x5ef883['getSelectedBlocks']())||_0x4b9758['model']['schema']['getLimitElement'](_0x5ef883);_0x4b9758['model']['change'](_0x2e82bb=>{_0x2e82bb['setSelection'](_0x3ba970,'in');});}_0x40c0e8['showFakeVisualSelection'](),_0x485012['execute'](_0x44804e['prompt'],_0x1cd25c,'command:'+_0x5cf23f);}['_populateMenuBarMenu'](_0x15441c,_0x5b4007,_0x1b539e,_0x50837b){const _0x1cbded=this['editor'],_0x133e82=_0x1cbded['locale'],_0x3e810c=new $t(_0x133e82),_0xfd3a04=ji(_0x1cbded,_0x1b539e)['filter'](_0x1aadb2=>_0x1aadb2['commands']['length']);0x1===_0xfd3a04['length']?this['_getMenuBarGroupButtons']({'command':_0x15441c,'commands':_0xfd3a04[0x0]['commands'],'parentMenuView':_0x5b4007,'onExecute':_0x50837b})['forEach'](_0x4f4afc=>_0x3e810c['items']['add'](_0x4f4afc)):_0xfd3a04['forEach'](({groupId:_0x21521e,groupLabel:_0x468529,commands:_0x4ca88a})=>{const _0x39ac50=new qt(_0x133e82,_0x5b4007),_0x178601=new Kt(_0x133e82),_0x490a33=new $t(_0x133e82),_0x336c96=this['_getMenuBarGroupButtons']({'command':_0x15441c,'commands':_0x4ca88a,'parentMenuView':_0x178601,'onExecute':_0x50837b});_0x178601['buttonView']['set']({'label':_0x468529||_0x21521e}),_0x178601['delegate']('execute')['to'](_0x5b4007),_0x490a33['items']['addMany'](_0x336c96),_0x178601['panelView']['children']['add'](_0x490a33),_0x39ac50['children']['add'](_0x178601),_0x3e810c['items']['add'](_0x39ac50);}),_0x5b4007['panelView']['children']['add'](_0x3e810c);}['_getMenuBarGroupButtons']({command:_0x17f984,commands:_0x49ce14,parentMenuView:_0x5d6d70,onExecute:_0x179abf}){const _0x10f507=this['editor'],_0x193bf8=_0x10f507['locale'];return ji(_0x10f507,_0x49ce14)['map'](_0xecfaab=>{const _0x4d6b23=new qt(_0x193bf8,_0x5d6d70),_0x224035=new Wt(_0x193bf8);return _0x224035['set']({'label':_0xecfaab['label']}),_0x224035['delegate']('execute')['to'](_0x5d6d70),_0x224035['on']('execute',()=>_0x179abf(_0xecfaab['id'])),_0x224035['bind']('isEnabled')['to'](_0x17f984,'enabledCommandsIds',_0x116136=>_0x116136['includes'](_0xecfaab['id'])),_0x4d6b23['children']['add'](_0x224035),_0x4d6b23;});}}function zi(_0x16aaed,_0x5e2898){return void 0x0!==_0x16aaed['order']&&void 0x0===_0x5e2898['order']?0x1:void 0x0===_0x16aaed['order']&&void 0x0!==_0x5e2898['order']?-0x1:void 0x0!==_0x16aaed['order']&&void 0x0!==_0x5e2898['order']?_0x16aaed['order']-_0x5e2898['order']:0x0;}function ji(_0x2b28cf,_0x41fa84){_0x41fa84['sort'](zi);const _0x3e5e35={},_0x45578a=[];for(const _0xe0c608 of _0x41fa84)if(void 0x0!==_0xe0c608['order']){if(_0xe0c608['order']in _0x3e5e35)throw new ht('ai-commands-config-order-collision',_0x2b28cf,{'conflictingDefinitions':[_0xe0c608,_0x3e5e35[_0xe0c608['order']]]});_0x3e5e35[_0xe0c608['order']]=_0xe0c608,_0x45578a['splice'](_0xe0c608['order'],0x0,_0xe0c608);}else _0x45578a['push'](_0xe0c608);return _0x45578a;}class Ji extends _0x52790d{static get['requires'](){return[Xi,ki];}static get['pluginName'](){return'AIAssistant';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x57499c){super(_0x57499c);const _0x53feef=_0x57499c['config'],_0xfc8e41=_0x57499c['locale'];_0x53feef['define']('ai.assistant.preserveComments',!0x0),_0x53feef['define']('ai.assistant.commands',Zi(_0xfc8e41)),_0x53feef['define']('ai.assistant.extraCommandGroups',[]),_0x53feef['define']('ai.assistant.removeCommands',[]);let _0x551c61=bi(_0x53feef['get']('ai.assistant.commands'),_0xfc8e41);const _0x15213c=_0x53feef['get']('ai.assistant.extraCommandGroups'),_0x388dc4=_0x53feef['get']('ai.assistant.removeCommands');_0x15213c['forEach'](_0x54011a=>{const _0xd21f05=_0x551c61['find'](_0x3c6d53=>_0x3c6d53['groupId']===_0x54011a['groupId']);_0xd21f05?_0xd21f05['commands']=_0xd21f05['commands']['concat'](_0x54011a['commands']):_0x551c61['push'](_0x54011a);}),_0x551c61=_0x551c61['filter'](_0x2e1676=>!_0x388dc4['includes'](_0x2e1676['groupId'])),_0x551c61['forEach'](_0x14f894=>{_0x14f894['commands']=_0x14f894['commands']['filter'](_0x35a232=>!_0x388dc4['includes'](_0x35a232['id']));}),_0x53feef['set']('ai.assistant.commands',_0x551c61);}}function Zi(_0xa93906){return[{'groupId':'editOrReview','groupLabel':yi(_0xa93906,'Edit\x20or\x20review'),'commands':[{'id':'improveWriting','label':yi(_0xa93906,'Improve\x20writing'),'prompt':'Fix\x20spelling\x20mistakes,\x20use\x20proper\x20grammar\x20and\x20apply\x20good\x20writing\x20practices.\x20Do\x20not\x20lose\x20the\x20original\x20meaning.'},{'id':'makeShorter','label':yi(_0xa93906,'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(_0xa93906,'Make\x20longer'),'prompt':'Improve\x20this\x20content\x20by\x20using\x20descriptive\x20language\x20and\x20inserting\x20more\x20information\x20and\x20more\x20detailed\x20explanations.'},{'id':'simplifyLanguage','label':yi(_0xa93906,'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(_0xa93906,'Generate\x20from\x20selection'),'commands':[{'id':'summarize','label':yi(_0xa93906,'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(_0xa93906,'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(_0xa93906,'Change\x20tone'),'commands':[{'id':'professional','label':yi(_0xa93906,'Professional'),'prompt':'Improve\x20using\x20polished,\x20formal,\x20and\x20respectful\x20language\x20to\x20convey\x20professional\x20expertise\x20and\x20competence.'},{'id':'casual','label':yi(_0xa93906,'Casual'),'prompt':'Improve\x20using\x20casual,\x20informal\x20language\x20to\x20convey\x20a\x20casual\x20conversation\x20with\x20a\x20real\x20person.'},{'id':'direct','label':yi(_0xa93906,'Direct'),'prompt':'Improve\x20using\x20direct\x20language,\x20using\x20only\x20the\x20essential\x20information.'},{'id':'confident','label':yi(_0xa93906,'Confident'),'prompt':'Improve\x20using\x20compelling,\x20optimistic\x20language\x20to\x20convey\x20confidence\x20in\x20the\x20writing.'},{'id':'friendly','label':yi(_0xa93906,'Friendly'),'prompt':'Improve\x20using\x20friendly,\x20comforting\x20language,\x20to\x20convey\x20understanding\x20and\x20empathy.'}]},{'groupId':'changeStyle','groupLabel':yi(_0xa93906,'Change\x20style'),'commands':[{'id':'business','label':yi(_0xa93906,'Business'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20business\x20professional\x20with\x20formal\x20language.'},{'id':'legal','label':yi(_0xa93906,'Legal'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20legal\x20professional\x20using\x20valid\x20legal\x20terminology.'},{'id':'journalism','label':yi(_0xa93906,'Journalism'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20journalist\x20using\x20engaging\x20language\x20to\x20convey\x20the\x20importance\x20of\x20the\x20information.'},{'id':'poetic','label':yi(_0xa93906,'Poetic'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20poem\x20using\x20poetic\x20techniques\x20without\x20losing\x20the\x20original\x20meaning.'}]},{'groupId':'translate','groupLabel':yi(_0xa93906,'Translate'),'commands':[{'id':'translateEnglish','label':yi(_0xa93906,'English'),'prompt':'Translate\x20the\x20content\x20to\x20English\x20language.'},{'id':'translateSpanish','label':yi(_0xa93906,'Spanish'),'prompt':'Translate\x20the\x20content\x20to\x20Spanish\x20language.'},{'id':'translatePortuguese','label':yi(_0xa93906,'Portuguese'),'prompt':'Translate\x20the\x20content\x20to\x20Portuguese\x20language.'},{'id':'translateGerman','label':yi(_0xa93906,'German'),'prompt':'Translate\x20the\x20content\x20to\x20German\x20language.'},{'id':'translateFrench','label':yi(_0xa93906,'French'),'prompt':'Translate\x20the\x20content\x20to\x20French\x20language.'},{'id':'translateChinese','label':yi(_0xa93906,'Simplified\x20Chinese'),'prompt':'Translate\x20the\x20content\x20to\x20Simplified\x20Chinese\x20language.'},{'id':'translateHindi','label':yi(_0xa93906,'Hindi'),'prompt':'Translate\x20the\x20content\x20to\x20Hindi\x20language.'},{'id':'translateArabic','label':yi(_0xa93906,'Arabic'),'prompt':'Translate\x20the\x20content\x20to\x20Arabic\x20language.'}]}];}class ts extends _0x52790d{['abortController'];static get['requires'](){return[Ni];}constructor(_0x58b008){super(_0x58b008),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'](_0x489adb){return this['sendRequest'](_0x489adb)['catch'](_0x49ccc8=>{if(_0x49ccc8 instanceof vi)return Promise['reject'](_0x49ccc8);if('AbortError'==_0x49ccc8['name'])return Promise['resolve']();throw console['error'](_0x49ccc8),new ht('aitextadapter-send-request-failed',null);});}async['_prepareRequestHeaders'](_0x2b067e,_0x17e10d){const _0x4c8306=this['editor']['locale'],_0x3b3d4e={'Content-Type':'application/json'};if('object'==typeof _0x2b067e)Object['assign'](_0x3b3d4e,_0x2b067e);else{if(_0x2b067e)try{const _0x5d0bb3=await _0x2b067e(_0x17e10d);Object['assign'](_0x3b3d4e,_0x5d0bb3);}catch{return Promise['reject'](new vi(yi(_0x4c8306,'AI_ERROR_GET_HEADERS')));}}return _0x3b3d4e;}async['_prepareRequestParameters'](_0x56ec1c,_0x17994e){const _0x19c7f8=this['editor']['locale'];if('object'==typeof _0x56ec1c)return _0x56ec1c;try{return await _0x56ec1c(_0x17994e);}catch{return Promise['reject'](new vi(yi(_0x19c7f8,'AI_ERROR_GET_PARAMETERS')));}}}class es extends ts{['_apiUrl'];['_requestHeaders'];['_requestParameters'];static get['pluginName'](){return'OpenAITextAdapter';}constructor(_0x33ad06){super(_0x33ad06),_0x33ad06['config']['define']('ai.assistant.adapter.openAI.apiUrl','https://api.openai.com/v1/chat/completions'),_0x33ad06['config']['get']('ai.assistant.adapter.openAI.requestParameters')||_0x33ad06['config']['define']('ai.assistant.adapter.openAI.requestParameters',{'model':'gpt-4o','temperature':0x1,'top_p':0x1,'stream':!0x0}),this['_apiUrl']=_0x33ad06['config']['get']('ai.assistant.adapter.openAI.apiUrl'),this['_requestHeaders']=_0x33ad06['config']['get']('ai.assistant.adapter.openAI.requestHeaders')||{},this['_requestParameters']=_0x33ad06['config']['get']('ai.assistant.adapter.openAI.requestParameters');}async['sendRequest']({query:_0x5b0979,context:_0x111c6f,onData:_0x290f9d,actionId:_0x3fdc4b}){const _0x32c359=this['editor']['locale'],_0x584e41=await this['prepareMessages'](_0x5b0979,_0x111c6f,_0x3fdc4b),_0x5ab4fa=await this['_prepareRequestHeaders'](this['_requestHeaders'],_0x3fdc4b),_0x3db3f9=await this['_prepareRequestParameters'](this['_requestParameters'],_0x3fdc4b),_0x464d58={'messages':_0x584e41,..._0x3db3f9},_0x6c76f8={'method':'POST','headers':_0x5ab4fa,'body':JSON['stringify'](_0x464d58),'signal':this['abortController']['signal']},_0x40ce00=await fetch(this['_apiUrl'],_0x6c76f8);if(_0x40ce00['ok'])return _0x3db3f9['stream']?await this['_readStreamableResponse'](_0x40ce00,_0x290f9d):await this['_readStaticResponse'](_0x40ce00,_0x290f9d),Promise['resolve']();{const _0x5259cf=await _0x40ce00['text']();return _0x5259cf['includes']('context_length_exceeded')?Promise['reject'](new vi(yi(_0x32c359,'AI_ERROR_CONTEXT_LENGTH'))):_0x5259cf['includes']('Moderation')?Promise['reject'](new vi(yi(_0x32c359,'AI_ERROR_MODERATION'))):Promise['reject'](new Error(_0x5259cf));}}async['prepareMessages'](_0x5655a3,_0x2239ae,_0x1fb3d0){let _0x2c7eb9,_0x5b0a7b;return _0x2239ae?(_0x2c7eb9='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.',_0x5b0a7b='Instruction:\x0a'+_0x5655a3+'\x0aYou\x20must\x20keep\x20the\x20text\x20formatting.\x0a\x0aContent:\x0a'+_0x2239ae):(_0x2c7eb9='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.',_0x5b0a7b=_0x5655a3),[{'role':'system','content':_0x2c7eb9},{'role':'user','content':_0x5b0a7b}];}async['_readStreamableResponse'](_0x40958e,_0x5c6956){const _0x4968ff=_0x40958e['body']['getReader'](),_0x1b0886=new TextDecoder();let _0x3832a0='',_0x5a5878='',_0x145eff='',_0x198ec9=!0x1;for(;!_0x198ec9;){const {done:_0x44d2fc,value:_0xf5d397}=await _0x4968ff['read'](),_0x48d227=_0x3832a0+_0x1b0886['decode'](_0xf5d397);let _0x11a7f1='';_0x198ec9=_0x44d2fc;try{_0x11a7f1=this['_cleanUpData'](_0x48d227),_0x3832a0='';}catch{_0x3832a0=_0x48d227;continue;}_0x5a5878+=_0x11a7f1,!_0x198ec9&&this['_isBufferIncomplete'](_0x5a5878)||_0x5a5878&&(_0x145eff+=_0x5a5878,_0x5a5878='',_0x5c6956(_0x145eff));}return Promise['resolve']();}async['_readStaticResponse'](_0x3fe945,_0x4a560e){return _0x4a560e((await _0x3fe945['json']())['choices'][0x0]['message']['content']),Promise['resolve']();}['_isBufferIncomplete'](_0x10cd68){const _0x327a8c=_0x10cd68['split']('<')['length']!==_0x10cd68['split']('>')['length'],_0x14fd56=_0x10cd68['length']<0x1e;return _0x327a8c&&_0x14fd56;}['_cleanUpData'](_0x387a9d){return _0x387a9d['split'](/\n(?![^{]*\})/g)['map'](_0xc3ccbe=>_0xc3ccbe['replace']('data:\x20',''))['filter'](_0x32b93c=>_0x32b93c&&_0x32b93c['length']>0x0&&'[DONE]'!==_0x32b93c)['map'](_0x2d7bb6=>{const {choices:_0x59b568}=JSON['parse'](_0x2d7bb6);if(_0x59b568[0x0]?.['delta']?.['content'])return _0x59b568[0x0]['delta']['content'];})['filter'](_0x219df9=>_0x219df9)['join']('');}}class is extends ts{['_apiUrl'];['_requestHeaders'];['_bedrockClientConfig'];['_requestParameters'];static get['pluginName'](){return'AWSTextAdapter';}constructor(_0x3e57df){super(_0x3e57df),_0x3e57df['config']['get']('ai.assistant.adapter.aws.requestParameters')||_0x3e57df['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']=_0x3e57df['config']['get']('ai.assistant.adapter.aws.apiUrl'),this['_bedrockClientConfig']=_0x3e57df['config']['get']('ai.assistant.adapter.aws.bedrockClientConfig'),this['_requestHeaders']=_0x3e57df['config']['get']('ai.assistant.adapter.aws.requestHeaders'),this['_requestParameters']=_0x3e57df['config']['get']('ai.assistant.adapter.aws.requestParameters');}async['sendRequest']({query:_0x141b74,context:_0x4986e1,onData:_0x479c77,actionId:_0x8ddb01}){const {model:_0x36108b,stream:_0x1939bf,..._0x2f7187}=await this['_prepareRequestParameters'](this['_requestParameters'],_0x8ddb01),_0x2c570e={'prompt':await this['preparePrompt'](_0x141b74,_0x4986e1,_0x36108b,_0x8ddb01),..._0x2f7187};this['_apiUrl']?await this['_processProxyRequest'](_0x2c570e,_0x36108b,_0x1939bf,_0x479c77,_0x8ddb01):await this['_processAWSRequest'](_0x2c570e,_0x36108b,_0x1939bf,_0x479c77);}async['preparePrompt'](_0x26dc44,_0x513cb6,_0xa2ecac,_0x53e2fa){let _0x423d94,_0x6ba39d;return _0x513cb6?(_0x423d94='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.',_0x6ba39d='Instruction:\x0a'+_0x26dc44+'\x0aYou\x20must\x20keep\x20the\x20text\x20formatting.\x0a\x0aContent:\x0a'+_0x513cb6):(_0x423d94='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.',_0x6ba39d=_0x26dc44),'meta.llama'==this['getModelFamily'](_0xa2ecac)?'<<SYS>>\x0a'+_0x423d94+'\x0a<</SYS>>\x0a[INST]\x0a'+_0x6ba39d+'\x0a[/INST]':'Human:\x0a'+_0x423d94+'\x0a'+_0x6ba39d+'\x0a\x0aAssistant:';}['getModelFamily'](_0x48269e){if(/^anthropic\.claude/['test'](_0x48269e))return'anthropic.claude';if(/^ai21\.j2/['test'](_0x48269e))return'ai21.j2';if(/^cohere\.command/['test'](_0x48269e))return'cohere.command';if(/^meta\.llama/['test'](_0x48269e))return'meta.llama';throw new vi(yi(this['editor']['locale'],'AI_ERROR_UNSUPPORTED_MODEL',_0x48269e));}async['_processProxyRequest'](_0x44e5f3,_0x362221,_0xc070eb,_0x54f9e8,_0x407667){const _0x46393b={'method':'POST','headers':await this['_prepareRequestHeaders'](this['_requestHeaders'],_0x407667),'body':JSON['stringify']({..._0x44e5f3,'model':_0x362221,'stream':_0xc070eb}),'signal':this['abortController']['signal']},_0x3d628b=await fetch(this['_apiUrl'],_0x46393b);_0xc070eb?await this['_readStreamableResponse'](_0x3d628b,_0x362221,_0x54f9e8):await this['_readStaticResponse'](_0x3d628b,_0x362221,_0x54f9e8);}async['_processAWSRequest'](_0x419f1f,_0x10f803,_0x2db5f0,_0x281b30){const _0x37c4a1=new _0x3b7258(this['_bedrockClientConfig']),_0x34b762={'body':JSON['stringify'](_0x419f1f),'contentType':'application/json','accept':'application/json','modelId':_0x10f803};let _0x5f5220;if(_0x2db5f0){const _0x24fc33=new _0x37cfc5(_0x34b762);_0x5f5220=await _0x37c4a1['send'](_0x24fc33,{'abortSignal':this['abortController']['signal']}),await this['_readAsyncIterableResponse'](_0x5f5220,_0x10f803,_0x281b30);}else{const _0x3cdb6d=new _0x434b20(_0x34b762);_0x5f5220=await _0x37c4a1['send'](_0x3cdb6d,{'abortSignal':this['abortController']['signal']}),await this['_readStaticResponse'](_0x5f5220,_0x10f803,_0x281b30);}}async['_readAsyncIterableResponse'](_0x1d760f,_0x4fe8a9,_0xd86597){const _0x5e7266=_0x1d760f['body'],_0x356fd5=new TextDecoder('utf-8');let _0x2812c3='';for await(const _0x12d268 of _0x5e7266)if(_0x12d268['chunk']){const _0x56b63a=_0x356fd5['decode'](_0x12d268['chunk']['bytes']),_0x41368f=JSON['parse'](_0x56b63a);_0x2812c3+=this['_getGeneratedText'](_0x41368f,_0x4fe8a9),_0xd86597(_0x2812c3);}return Promise['resolve']();}async['_readStreamableResponse'](_0x1b331f,_0x10c4d5,_0x3a1ffc){const _0x1353fb=_0x1b331f['body'],_0x5e1a10=new TextDecoder('utf-8'),_0x129939=_0x1353fb['getReader']();let _0x7e91bf='',_0x32e741='',_0x30dd76=!0x1;for(;!_0x30dd76;){const {done:_0x23a707,value:_0x263fe2}=await _0x129939['read']();if(_0x30dd76=_0x23a707,_0x30dd76)break;const _0x5c67fe=(_0x7e91bf+_0x5e1a10['decode'](_0x263fe2))['split']('\x0a')['map'](_0x5df988=>{try{return _0x7e91bf='',JSON['parse'](_0x5df988);}catch{return _0x7e91bf=_0x5df988,null;}})['filter'](_0x53f9f9=>null!==_0x53f9f9);_0x5c67fe['length']&&(_0x32e741+=_0x5c67fe['map'](_0x3d3ef9=>this['_getGeneratedText'](_0x3d3ef9,_0x10c4d5))['join'](''),_0x3a1ffc(_0x32e741));}return Promise['resolve']();}async['_readStaticResponse'](_0x166b9b,_0x5c7c22,_0x15d61c){let _0x170bc1;return _0x170bc1=_0x166b9b instanceof Response?await _0x166b9b['json']():JSON['parse'](new TextDecoder('utf-8')['decode'](_0x166b9b['body'])),(_0x15d61c(this['_getGeneratedText'](_0x170bc1,_0x5c7c22)),Promise['resolve']());}['_getGeneratedText'](_0x4e7b5d,_0xf5ffcb){switch(this['getModelFamily'](_0xf5ffcb)){case'anthropic.claude':return _0x4e7b5d['completion'];case'ai21.j2':return _0x4e7b5d['completions'][0x0]['data']['text'];case'cohere.command':return _0x4e7b5d['generations'][0x0]['text'];case'meta.llama':return _0x4e7b5d['generation'];}}}class ss extends Nt{constructor(_0x584686,_0x326a27={}){super(_0x584686),this['isToggleable']=!0x0,this['set']('side',_0x326a27['side']||'top');const _0x5857c3=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':['ck-tab-button',...Et(_0x326a27['class']||[]),_0x5857c3['to']('side',_0x381111=>'ck-tab-button_'+_0x381111),_0x5857c3['to']('class')]}});}['show'](){this['set']('isVisible',!0x0);}['hide'](){this['set']('isVisible',!0x1);}}class ns extends vt{['children'];constructor(_0x5c7c57,_0x17e104={}){super(_0x5c7c57);const _0x3a58a2=this['bindTemplate'];this['set']('isVisible',!0x1),this['set']('class',''),this['children']=this['createCollection'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck-tab-panel',...Et(_0x17e104['class']||[]),_0x3a58a2['to']('class'),_0x3a58a2['if']('isVisible','ck-hidden',_0x16b677=>!_0x16b677)]},'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(_0x40ebee,_0x57779f={}){super(_0x40ebee),this['set']('class',void 0x0),this['set']('activeTab',null),this['set']('side',_0x57779f['side']||'top'),this['set']('isMaximized',!0x1);const _0x1b53c3=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset','ck-tabs',...Et(_0x57779f['class']||[]),_0x1b53c3['to']('side',_0x12aeff=>'ck-tabs_'+_0x12aeff),_0x1b53c3['to']('class'),_0x1b53c3['to']('isMaximized',_0x4d231b=>_0x4d231b?'ck-ai-tabs_maximized':'')],'tabindex':'0'},'children':[{'tag':'div','attributes':{'class':['ck','ck-tabs__buttons-container',_0x1b53c3['to']('side',_0xa1d6d0=>'ck-tabs__buttons-container_'+_0xa1d6d0)]},'children':this['buttonViews']},{'tag':'div','attributes':{'class':['ck','ck-tabs__panels-container',_0x1b53c3['to']('side',_0x33bfec=>'ck-tabs__panels-container_'+_0x33bfec)]},'children':this['panelViews']},...Et(_0x57779f['children']||[])]});}['getTabIds'](){return[...this['_tabs']['keys']()];}['getTab'](_0x8e4aa){const _0x3f2c0d=this['_tabs']['get'](_0x8e4aa);return _0x3f2c0d||null;}['addTab'](_0x14e692){const _0x5c2bcc=this['_setupButton']({'id':_0x14e692['id'],'label':_0x14e692['buttonLabel'],'icon':_0x14e692['buttonIcon'],'order':_0x14e692['order']}),_0x5073fb=new ns(this['locale']);return _0x5073fb['render'](),_0x14e692['content']&&_0x5073fb['children']['add'](_0x14e692['content']),this['panelViews']['add'](_0x5073fb),this['_tabs']['set'](_0x14e692['id'],{'button':_0x5c2bcc,'panel':_0x5073fb,'order':void 0x0!==_0x14e692['order']?_0x14e692['order']:null}),this['fire']('addTab:'+_0x14e692['id'],{'id':_0x14e692['id'],'button':_0x5c2bcc,'panel':_0x5073fb}),null===this['activeTab']?this['activateTab'](_0x14e692['id']):this['_hidePanel'](_0x14e692['id']),{'button':_0x5c2bcc,'panel':_0x5073fb};}['activateTab'](_0x3adda1){if(null!==_0x3adda1&&!this['getTab'](_0x3adda1))throw new ht('ui-tabsview-tab-not-found',{'tabs':this,'tabId':_0x3adda1});this['activeTab']!==_0x3adda1&&(this['activeTab']&&this['_hidePanel'](this['activeTab']),this['activeTab']=_0x3adda1,_0x3adda1&&this['_showPanel'](_0x3adda1),this['fire']('activateTab:'+_0x3adda1,_0x3adda1));}['showTab'](_0x4a1f4e){if(!this['getTab'](_0x4a1f4e))throw new ht('ui-tabsview-tab-not-found',{'tabs':this,'tabId':_0x4a1f4e});this['_showPanel'](_0x4a1f4e),this['_showButton'](_0x4a1f4e),this['fire']('show:'+_0x4a1f4e,_0x4a1f4e);}['hideTab'](_0x5169b0){if(!this['getTab'](_0x5169b0))throw new ht('ui-tabsview-tab-not-found',{'tabs':this,'tabId':_0x5169b0});const _0x5aadf3=this['activeTab'];this['_hidePanel'](_0x5169b0),this['_hideButton'](_0x5169b0);const _0x3d335d=this['getTabIds']();_0x5aadf3===_0x5169b0&&_0x3d335d['length']>0x1&&this['activateTab'](_0x3d335d['find'](_0x2955cd=>_0x2955cd!==_0x5169b0)),this['fire']('hide:'+_0x5169b0,_0x5169b0);}['_getPanel'](_0x357d30){const _0x3b3cc1=this['_tabs']['get'](_0x357d30);return _0x3b3cc1?_0x3b3cc1['panel']:null;}['_showPanel'](_0x1e0f93){null!==this['activeTab']&&this['activeTab']!==_0x1e0f93||this['_getPanel'](_0x1e0f93)['show']();}['_hidePanel'](_0x45c54a){const _0x16ef77=this['_getPanel'](_0x45c54a);_0x16ef77['isVisible']&&(this['activeTab']===_0x45c54a&&(this['activeTab']=null),_0x16ef77['hide']());}['_getButton'](_0x50b28a){const _0x4d3f24=this['_tabs']['get'](_0x50b28a);return _0x4d3f24?_0x4d3f24['button']:null;}['_showButton'](_0x3082fe){this['_getButton'](_0x3082fe)['show']();}['_hideButton'](_0x3bbf3a){this['_getButton'](_0x3bbf3a)['hide']();}['_setupButton'](_0x2e8fe7){const _0x569ed5=new ss(this['locale'],{'side':this['side']}),_0x729d37=this['buttonViews'];if(_0x569ed5['set']({'label':_0x2e8fe7['label'],'icon':_0x2e8fe7['icon'],'tooltip':!0x0,'withText':!0x0}),_0x569ed5['bind']('isOn')['to'](this,'activeTab',_0x14a311=>_0x14a311===_0x2e8fe7['id']),_0x569ed5['bind']('side')['to'](this,'side'),_0x2e8fe7['order']){const _0xcebbb0=[...this['_tabs']]['reduce']((_0x285228,_0x12ea51)=>{const _0x2a3430=_0x12ea51[0x0],{order:_0x188b51}=_0x12ea51[0x1];return!_0x188b51||_0x188b51>_0x2e8fe7['order']?_0x285228:_0x188b51>=_0x285228['order']?{'id':_0x2a3430,'order':_0x188b51}:_0x285228;},{'id':'','order':0x0}),_0xc5ac90=_0x729d37['getIndex'](this['_getButton'](_0xcebbb0['id']));_0x729d37['add'](_0x569ed5,_0xc5ac90+0x1);}else _0x729d37['add'](_0x569ed5);return _0x569ed5['on']('execute',()=>{this['activateTab'](_0x2e8fe7['id']);}),_0x569ed5;}}const as=['overlay','sidebar','custom'],os=['left','right'];class hs extends rs{constructor(_0x22712c,_0x4218e5={}){super(_0x22712c,_0x4218e5),this['set']('type',_0x4218e5['type']||'sidebar'),this['set']('side',_0x4218e5['side']||'right'),this['set']('isVisible',_0x4218e5['visibleByDefault']??!0x0);const _0x2da7cb=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':['ck-ai-tabs',_0x2da7cb['if']('type','ck-ai-tabs__overlay',_0x3e3cc2=>'overlay'===_0x3e3cc2),_0x2da7cb['if']('type','ck-ai-tabs__sidebar',_0x193ea6=>'sidebar'===_0x193ea6),_0x2da7cb['if']('isVisible','ck-hidden',_0x39348a=>!_0x39348a)]}}),this['buttonViews']['on']('add',(_0x37880e,_0x28bcab)=>{_0x28bcab['set']('withText',!0x1);});}}class cs extends _0x20e290{['view'];['container']=null;['showResizeButton']=!0x0;static get['pluginName'](){return'AITabs';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x4720a4){super(_0x4720a4);const _0x17b5a4=this['context']['config']['get']('ai.container');if(this['set']('side','right'),!_0x17b5a4)throw new ht('ai-tabs-configuration-not-found');if(void 0x0!==_0x17b5a4['showResizeButton']&&(this['showResizeButton']=_0x17b5a4['showResizeButton']),'sidebar'!==_0x17b5a4['type']&&'overlay'!==_0x17b5a4['type']||_0x17b5a4['side']&&(this['side']=_0x17b5a4['side']),'sidebar'===_0x17b5a4['type']){if(this['container']=_0x17b5a4['element'],this['set']('type','sidebar'),!this['container'])throw new ht('ai-tabs-sidebar-container-element-not-found');}else'overlay'===_0x17b5a4['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===_0x17b5a4['visibleByDefault']||_0x17b5a4['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 _0x4433f2&&this['context']['ui']['focusTracker']['add'](this['view']['element']);}['switchType'](_0x22b1bd){if(_0x22b1bd&&this['type']!==_0x22b1bd){if(!as['includes'](_0x22b1bd))throw new ht('ai-tabs-unsupported-ui-type');this['type']=_0x22b1bd;}}['switchSide'](_0x5724ad){if(_0x5724ad&&this['side']!==_0x5724ad){if(!os['includes'](_0x5724ad))throw new ht('ai-tabs-unsupported-ui-side');this['side']=_0x5724ad;}}['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 _0x20e290{['_apiUrl'];['_token'];['_decoder'];['_responseCache'];static get['requires'](){return[_0x57eef5];}static get['pluginName'](){return'AIConnector';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x38cc87){super(_0x38cc87),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 _0xddf91=this['context']['plugins']['get'](_0x57eef5);if(!_0xddf91['token'])throw new ht('ai-missing-token',this);this['_token']=_0xddf91['token'];}['startConversation'](_0x38a8da,_0x3b5971){const _0x5b44bf=this['_sendApiRequest']('/conversations','POST',{'id':_0x38a8da,'group':_0x3b5971});return{'getConversation':async()=>(await _0x5b44bf['request'])['json'](),'abortController':_0x5b44bf['abortController']};}['queryAssistant']({message:_0x239366,conversationId:_0xc5667,parts:_0x4b8580,capabilities:_0x97d5ab,model:_0x51367d,attributes:_0x593519}){const _0x17fbdc={'prompt':_0x239366,'content':_0x4b8580,'model':_0x51367d,..._0x97d5ab&&{'capabilities':_0x97d5ab},..._0x593519&&{'attributes':_0x593519}},_0x710834=this['_sendApiRequest']('/conversations/'+_0xc5667+'/messages','POST',_0x17fbdc);return{'getStream':async()=>{const _0x3377d0=(await _0x710834['request'])['body'];return this['_getStreamReader'](_0x3377d0);},'abortController':_0x710834['abortController']};}['executeCustomAction']({content:_0x52a39b,message:_0xb639c7,model:_0x509b,outputFormat:_0x47e49a}){const _0x2f2fce={'content':[{'type':'text','content':_0x52a39b}],'prompt':_0xb639c7,'model':_0x509b,'outputFormat':_0x47e49a},_0x19c4c0=this['_sendApiRequest']('/actions/custom/calls','POST',_0x2f2fce);return{'getStream':async()=>{const _0x492b6e=(await _0x19c4c0['request'])['body'];return this['_getStreamReader'](_0x492b6e);},'abortController':_0x19c4c0['abortController']};}['executeAction']({actionName:_0x356523,content:_0x256c01,args:_0x113feb}){const _0x31ef07={'content':[{'type':'text','content':_0x256c01}],'args':_0x113feb},_0x486c3c=this['_sendApiRequest']('/actions/system/'+_0x356523+'/calls','POST',_0x31ef07);return{'getStream':async()=>{const _0xf22931=(await _0x486c3c['request'])['body'];return this['_getStreamReader'](_0xf22931);},'abortController':_0x486c3c['abortController']};}['uploadFile'](_0x2b6c31,_0x24bde5,_0x2d90d1){const _0x350cf4=new FormData();_0x350cf4['append']('file',_0x24bde5,_0x24bde5['name']),_0x2d90d1&&_0x350cf4['append']('attributes',JSON['stringify'](_0x2d90d1));const _0xdb61b6=this['_sendApiRequest']('/conversations/'+_0x2b6c31+'/files','POST',_0x350cf4);return{'getId':async()=>(await _0xdb61b6['request'])['json'](),'abortController':_0xdb61b6['abortController']};}['fetchDocument'](_0x483b4b,_0x40fde6){const _0xc4bf06=this['_sendApiRequest']('/conversations/'+_0x483b4b+'/documents/'+_0x40fde6,'GET');return{'getDocument':async()=>(await _0xc4bf06['request'])['json'](),'abortController':_0xc4bf06['abortController']};}['uploadDocument'](_0x18ee5d,_0x52c416,_0x1fb5ea){const _0x4948c2={'content':_0x52c416};_0x1fb5ea&&(_0x4948c2['attributes']=_0x1fb5ea);const _0x2434d5=this['_sendApiRequest']('/conversations/'+_0x18ee5d+'/documents','POST',_0x4948c2);return{'getId':async()=>(await _0x2434d5['request'])['json'](),'abortController':_0x2434d5['abortController']};}['fetchConversations'](_0x562fb0,_0x7c99e={}){const _0x5924db=new URLSearchParams();_0x5924db['append']('group',_0x562fb0),_0x5924db['append']('excludeEmpty',!0x1!==_0x7c99e['excludeEmpty']?'true':'false'),_0x5924db['append']('limit',_0x7c99e['limit']?_0x7c99e['limit']['toString']():'100'),_0x5924db['append']('sortBy',_0x7c99e['sortBy']?_0x7c99e['sortBy']:'createdAt'),_0x5924db['append']('order',_0x7c99e['order']?_0x7c99e['order']:'desc');const _0x535f75=this['_sendApiRequest']('/conversations?'+_0x5924db['toString'](),'GET');return{'getConversations':async()=>{const _0x385879=await _0x535f75['request'];return(await _0x385879['json']())['items'];},'abortController':_0x535f75['abortController']};}['deleteConversation'](_0x391a61){const _0x23dd07=this['_sendApiRequest']('/conversations/'+_0x391a61,'DELETE');return{'execute':async()=>{await _0x23dd07['request'];},'abortController':_0x23dd07['abortController']};}['updateConversation'](_0x55e69a,_0x371d61){const _0x9aabed=this['_sendApiRequest']('/conversations/'+_0x55e69a,'PATCH',_0x371d61);return{'getResult':async()=>(await _0x9aabed['request'],_0x371d61),'abortController':_0x9aabed['abortController']};}['fetchConversation'](_0x1b4308){const _0x1624ac=this['_sendApiRequest']('/conversations/'+_0x1b4308,'GET');return{'getConversation':async()=>(await _0x1624ac['request'])['json'](),'abortController':_0x1624ac['abortController']};}['fetchConversationMessages'](_0x1a282e){const _0x1c2e1c=this['_sendApiRequest']('/conversations/'+_0x1a282e+'/messages','GET');return{'getMessages':async()=>{const _0x4ca4ad=await _0x1c2e1c['request'];return(await _0x4ca4ad['json']())['items'];},'abortController':_0x1c2e1c['abortController']};}['uploadUrl'](_0x51db0f,_0x562fd7,_0xf1a297){const _0x2d3c88=this['_sendApiRequest']('/conversations/'+_0x51db0f+'/web-resources','POST',{'url':_0x562fd7,'attributes':_0xf1a297});return{'getId':async()=>(await _0x2d3c88['request'])['json'](),'abortController':_0x2d3c88['abortController']};}['getModels'](_0x328aaa='en'){const _0x39f7b3=new URLSearchParams();_0x39f7b3['append']('language',_0x328aaa);const _0x5d6b96='/models/1?'+_0x39f7b3['toString'](),_0x3fce68=this['_sendApiRequest'](_0x5d6b96,'GET',void 0x0,!0x0);return{'list':async()=>await(await _0x3fce68['request'])['json'](),'abortController':_0x3fce68['abortController']};}['deleteFile'](_0x55a7f5,_0x278ade){const _0x51c927=this['_sendApiRequest']('/conversations/'+_0x55a7f5+'/files/'+_0x278ade,'DELETE');return{'execute':async()=>{await _0x51c927['request'];},'abortController':_0x51c927['abortController']};}['deleteDocument'](_0x2c372b,_0x50fd33){const _0x58fe8b=this['_sendApiRequest']('/conversations/'+_0x2c372b+'/documents/'+_0x50fd33,'DELETE');return{'execute':async()=>{await _0x58fe8b['request'];},'abortController':_0x58fe8b['abortController']};}['deleteWebResource'](_0x130a81,_0x429a94){const _0x171332=this['_sendApiRequest']('/conversations/'+_0x130a81+'/web-resources/'+_0x429a94,'DELETE');return{'execute':async()=>{await _0x171332['request'];},'abortController':_0x171332['abortController']};}['callSystemReview']({reviewName:_0x50f48d,content:_0x1ffcb7,args:_0x2e383f}){const _0x1dfe37=this['_sendApiRequest']('/reviews/system/'+_0x50f48d+'/calls','POST',{'content':[{'type':'text','content':_0x1ffcb7}],'args':_0x2e383f});return{'getStream':async()=>{const _0x182624=(await _0x1dfe37['request'])['body'];return this['_getStreamReader'](_0x182624);},'abortController':_0x1dfe37['abortController']};}['callCustomReview']({content:_0x2dcbe8,prompt:_0x1fada6,model:_0x22800f}){const _0xb1c6d7=this['_sendApiRequest']('/reviews/custom/calls','POST',{'content':[{'type':'text','content':_0x2dcbe8}],'prompt':_0x1fada6,'model':_0x22800f});return{'getStream':async()=>{const _0x162393=(await _0xb1c6d7['request'])['body'];return this['_getStreamReader'](_0x162393);},'abortController':_0xb1c6d7['abortController']};}['upsertAIChatRating'](_0x23cedf,_0x563110,_0x326896){const _0x33dbbd=this['_sendApiRequest']('/conversations/'+_0x23cedf+'/messages/'+_0x563110+'/ratings','PUT',{'positiveCount':_0x326896['positiveCount'],'totalCount':_0x326896['totalCount'],'modificationId':_0x326896['modificationId']});return{'execute':async()=>{await _0x33dbbd['request'];},'abortController':_0x33dbbd['abortController']};}['upsertAIActionRating'](_0x476f20,_0x46560a,_0x543dca){const _0x2e2e64=this['_sendApiRequest']('/actions/system/'+_0x476f20+'/calls/'+_0x46560a+'/ratings','PUT',{'positiveCount':_0x543dca['positiveCount'],'totalCount':_0x543dca['totalCount']});return{'execute':async()=>{await _0x2e2e64['request'];},'abortController':_0x2e2e64['abortController']};}['upsertCustomAIActionRating'](_0x295538,_0x1d1f8c){const _0x5c5112=this['_sendApiRequest']('/actions/custom/calls/'+_0x295538+'/ratings','PUT',{'positiveCount':_0x1d1f8c['positiveCount'],'totalCount':_0x1d1f8c['totalCount']});return{'execute':async()=>{await _0x5c5112['request'];},'abortController':_0x5c5112['abortController']};}['upsertAIReviewRating'](_0x2e7995,_0x321e04,_0x3d077c,_0x118da5){const _0x3dffd2=this['_sendApiRequest']('/reviews/system/'+_0x2e7995+'/calls/'+_0x321e04+'/ratings','PUT',{'positiveCount':_0x3d077c['positiveCount'],'totalCount':_0x3d077c['totalCount'],'dataId':_0x118da5});return{'execute':async()=>{await _0x3dffd2['request'];},'abortController':_0x3dffd2['abortController']};}['upsertCustomAIReviewRating'](_0x24a7dc,_0x2c30de,_0x42ce3e){const _0x36d58e=this['_sendApiRequest']('/reviews/custom/calls/'+_0x24a7dc+'/ratings','PUT',{'positiveCount':_0x2c30de['positiveCount'],'totalCount':_0x2c30de['totalCount'],'dataId':_0x42ce3e});return{'execute':async()=>{await _0x36d58e['request'];},'abortController':_0x36d58e['abortController']};}['_sendApiRequest'](_0x180600,_0x235543,_0x51a0f2,_0x583dcc=!0x1){const _0x55a72c=new AbortController(),_0x424e83=_0x583dcc?_0x235543+':'+_0x180600:null;if(_0x424e83){const _0x35c5eb=this['_responseCache']['get'](_0x424e83);if(_0x35c5eb)return{'request':_0x35c5eb['then'](_0x2e03f5=>_0x2e03f5['clone']()),'abortController':_0x55a72c};}const _0x52c0fd=_0x51a0f2 instanceof FormData,_0x610a14={'Authorization':'Bearer\x20'+this['_token']?.['value']};_0x51a0f2&&!_0x52c0fd&&(_0x610a14['Content-Type']='application/json');const _0x19ea23={'method':_0x235543,'headers':_0x610a14,'signal':_0x55a72c['signal']};_0x51a0f2&&(_0x19ea23['body']=_0x52c0fd?_0x51a0f2:JSON['stringify'](_0x51a0f2));const _0x324fb5=fetch(''+this['_apiUrl']+_0x180600,_0x19ea23)['catch'](_0x51a988=>{_0x424e83&&this['_responseCache']['delete'](_0x424e83),this['_handleError'](_0x51a988);})['then'](_0x423315=>_0x423315['ok']?_0x423315:_0x423315['json']()['then'](_0x968c7f=>{throw _0x424e83&&this['_responseCache']['delete'](_0x424e83),{'url':this['_apiUrl'],'path':_0x180600,'method':_0x235543,'body':_0x51a0f2,'status':(_0x423315||{})['status'],'statusText':(_0x423315||{})['statusText'],'code':_0x968c7f['code'],'message':_0x968c7f['message'],'traceId':_0x968c7f['traceId']};}));return _0x424e83&&this['_responseCache']['set'](_0x424e83,_0x324fb5['then'](_0x13f507=>_0x13f507['clone']())),{'request':_0x324fb5,'abortController':_0x55a72c};}async*['_getStreamReader'](_0x1331ce){const _0x2d94ab=[],_0x4c0825=_0x1331ce['getReader'](),_0x2dba68=_0x6e8aa9({'onError':_0x24e802=>{this['_handleError'](_0x24e802);},'onEvent':_0x3da16b=>{_0x3da16b['data']=JSON['parse'](_0x3da16b['data']),_0x2d94ab['push'](_0x3da16b);}});try{let _0x9376ba=!0x1;for(;!_0x9376ba;){const {done:_0x34fee9,value:_0x5776f8}=await _0x4c0825['read']();_0x34fee9&&(_0x9376ba=!0x0),_0x2dba68['feed'](this['_decoder']['decode'](_0x5776f8,{'stream':!0x0})),yield*_0x2d94ab,_0x2d94ab['length']=0x0;}}catch(_0x5a00ba){this['_handleError'](_0x5a00ba);}finally{_0x4c0825['releaseLock'](),_0x2dba68['reset']();}}['_handleError'](_0x4635d7){if(_0x4635d7 instanceof ht)throw _0x4635d7;if(_0x4635d7 instanceof Error&&'AbortError'===_0x4635d7['name'])throw new ht('ai-request-aborted',this,{'originalError':_0x4635d7});throw new ht('ai-request-failed',this,{'originalError':_0x4635d7});}}function us(_0x3ce0e9,_0x3b409f,_0x4bab2e){const t=_0x3ce0e9['t'];switch(_0x3b409f){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'},_0x4bab2e);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.'},_0x4bab2e);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.'},_0x4bab2e);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.'},_0x4bab2e);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'},_0x4bab2e);case'AI_CHAT_SUGGESTION_ACTION_SUGGEST':return t({'id':'AI_CHAT_SUGGESTION_ACTION_SUGGEST','string':'Suggest'},_0x4bab2e);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'},_0x4bab2e);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.'},_0x4bab2e);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.'},_0x4bab2e);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.'},_0x4bab2e);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.'},_0x4bab2e);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'},_0x4bab2e);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.'},_0x4bab2e);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 _0x3b409f;}}const ds='ck-ai-button-primary',_s='ck-ai-button-secondary',As='ck-ai-button-tertiary';function gs(_0x2e7936,_0x454899){const _0x3228ea=new Nt(_0x2e7936),_0x543f46=us(_0x2e7936,'AI_TABS_LABEL_MINIMIZE'),_0x5addc6=us(_0x2e7936,'AI_TABS_LABEL_MAXIMIZE');return _0x3228ea['set']({'withText':!0x1,'icon':_0xfe30ba,'tooltip':!0x0,'class':'ck-ai-tabs__resize\x20'+As}),_0x3228ea['bind']('label')['to'](_0x454899,'isMaximized',_0x204dde=>_0x204dde?_0x543f46:_0x5addc6),_0x3228ea['bind']('icon')['to'](_0x454899,'isMaximized',_0x29c46a=>_0x29c46a?_0x1df418:_0xfe30ba),_0x3228ea['bind']('isOn')['to'](_0x454899,'isMaximized'),_0x3228ea['on']('execute',()=>{_0x454899['fire']('resizeTabs');}),_0x3228ea;}function Is(_0x5ac6c8){return _0x753e49(_0x5ac6c8);}function Es(_0x1c4b08){return _0x2dfbe5(_0x1c4b08);}function ps(_0xe8c55c,_0x259556,_0x10c7fc){const _0x57eb2d=null!==_0x259556?_0x1c9384=>_0x1c9384['attribs'][_0xe8c55c]===_0x259556:_0x13e6cc=>Boolean(_0x13e6cc['attribs'][_0xe8c55c]);return _0x5f061e(_0x4db295=>_0x5af81f(_0x4db295)&&_0x57eb2d(_0x4db295),_0x10c7fc);}function Ts(_0x57409b,_0xa63c03,_0x2965dc){const _0x499c1a=null!==_0xa63c03?_0x461e4e=>_0x461e4e['attribs'][_0x57409b]===_0xa63c03:_0x4c300f=>Boolean(_0x4c300f['attribs'][_0x57409b]);return _0x14ee28(_0x558681=>_0x5af81f(_0x558681)&&_0x499c1a(_0x558681),_0x2965dc);}function ms(_0x2c0a43,_0x358a10){return _0x2c0a43&&_0x5af81f(_0x2c0a43)?_0x2c0a43['attribs'][_0x358a10]:null;}function Cs(_0x3246c0,_0x5f54d1,_0xf19d32){_0x5af81f(_0x3246c0)&&(null===_0xf19d32?delete _0x3246c0['attribs'][_0x5f54d1]:_0x3246c0['attribs'][_0x5f54d1]=_0xf19d32);}function ws(_0xfd738c,_0x4e64e0,_0x4f7574){const _0x2081df=_0x4e64e0['cloneNode'](!0x0);'beforebegin'===_0x4f7574?_0xaf8e9(_0xfd738c,_0x2081df):'afterbegin'===_0x4f7574?_0x4d95ac(_0xfd738c,_0x2081df):'beforeend'===_0x4f7574?_0x3796bb(_0xfd738c,_0x2081df):'afterend'===_0x4f7574&&_0x58fef7(_0xfd738c,_0x2081df);}function fs(_0x17a257){const _0x107b65=[];let _0x428b8f=_0x17a257;for(;_0x428b8f;)_0x428b8f=_0x5441af(_0x428b8f),_0x428b8f&&_0x107b65['push'](_0x428b8f);return _0x107b65;}function Ss(_0x58e243){return _0x58e243['replace'](/^\s+/gm,'')['replace'](/\s+$/gm,'')['replace'](/\n*/g,'')['replace'](/\s+/g,'\x20')['replace'](/>\s*</g,'><');}function bs(_0x4a79fc){let _0x204c77=0x0;for(;_0x4a79fc['parentNode'];)_0x4a79fc=_0x4a79fc['parentNode'],_0x204c77++;return _0x204c77;}function Rs(_0x13a947){const _0x43b61e=[];let _0x7a8979=_0x13a947['nextSibling'];for(;_0x7a8979;)_0x43b61e['push'](_0x7a8979),_0x7a8979=_0x7a8979['nextSibling'];_0x43b61e['forEach'](_0x237117=>{_0x2abe84(_0x237117);});}class Os extends/* #__PURE__ -- @preserve */
25
- ct(){['_m2html'];constructor(){super();const _0x529391=Object['entries'](_0x1dbbed),_0xd87909=_0x529391['findIndex'](([_0x1bc8da])=>'rehypeDomRaw'===_0x1bc8da);if(-0x1===_0xd87909)throw new ht('ai-response-parser-unable-to-set-up-parser');_0x529391['splice'](_0xd87909+0x1,0x0,['rehypeSanitize',_0x5dc3c1]),this['_m2html']=new _0x59f280({'plugins':Object['fromEntries'](_0x529391)});}['convertMarkdownToHTML'](_0x43b623){const _0x55ae87=this['_m2html']['parse'](_0x43b623);return this['parseAndNormalizeHTML'](_0x55ae87);}['parseAndNormalizeHTML'](_0xfb6900){return this['_parseHTML'](_0xfb6900);}['_parseHTML'](_0x5c8a23){const _0x59cdc3=Is('<dummy>'+_0x5c8a23['replace'](/^\t+/gm,'\x20')['replace'](/\n*/g,'')['replace'](/\s+/g,'\x20')['replace'](/<[^>]*?$/g,'')+'</dummy>');return _0x59cdc3['children']=_0x59cdc3['children'][0x0]['children'],_0x59cdc3;}}class ks extends/* #__PURE__ -- @preserve */
26
- ct(){['_generateUid'];['_touchedNodesState']={'newIds':[],'modifiedIds':[],'removedIds':[],'invalidIds':[],'lastTouchedId':null};['_existingDataIds']=new Set();constructor(_0x54db7d){super(),this['_generateUid']=_0x54db7d||ot;}['merge'](_0xd04752,_0x3d5b7f,_0x58cdd1){const _0x48ffe4=_0xd04752['cloneNode'](!0x0);if(0x0===_0x3d5b7f['childNodes']['length']){const _0x17f12a=[];return Ts('data-id','new-element',_0x48ffe4)['forEach'](_0x27fc0d=>{const _0x3225de=this['_generateUid']();Cs(_0x27fc0d,'data-id',_0x3225de),_0x17f12a['push'](_0x3225de);}),this['_removeSpecialComments'](_0x48ffe4),{'parsedContent':_0x48ffe4,'newNodeIds':_0x17f12a,'modifiedNodeIds':[],'removedNodeIds':[]};}_0x58cdd1&&_0x58cdd1['markUnstableElements']&&this['_markLastTagElementUnstable'](_0x48ffe4),this['_touchedNodesState']['newIds']=[],this['_touchedNodesState']['modifiedIds']=[],this['_touchedNodesState']['removedIds']=[],this['_touchedNodesState']['invalidIds']=[],this['_touchedNodesState']['lastTouchedId']=null,this['_existingDataIds']=new Set(Ts('data-id',null,_0x3d5b7f)['map'](_0x4ee555=>ms(_0x4ee555,'data-id'))['filter'](_0x1585da=>!!_0x1585da));let _0x4f359e=-0x1,_0x5035f9=!0x1;const _0x49812f=_0x48ffe4['childNodes'],_0x576238=Array['from'](_0x49812f)['filter'](_0xc8b05c=>!(0x3===_0xc8b05c['nodeType']&&''===Es(_0xc8b05c)['trim']())),_0x2a8633=_0x576238['length'];for(let _0x15b3c8=0x0;_0x15b3c8<_0x2a8633;_0x15b3c8++){const _0x425b07=_0x576238[_0x15b3c8],_0x13fbf5=_0x576238[_0x15b3c8+0x1];if(this['_isNewNode'](_0x425b07)){if(-0x1===_0x4f359e&&(_0x4f359e=_0x15b3c8),this['_markWrappedElements'](_0x425b07),!this['_isNewNode'](_0x13fbf5)){const [_0x101ac1,_0x4a15fc]=this['_findReferenceNode'](_0x425b07,_0x5035f9,_0x3d5b7f);if(_0x101ac1){const _0x21a759=Array['from'](_0x576238)['slice'](_0x4f359e,_0x15b3c8+0x1);this['_insertNodes'](_0x101ac1,_0x21a759,_0x4a15fc),_0x4f359e=-0x1;}}}else{if(this['_isExistingContentComment'](_0x425b07))_0x5035f9=!0x0;else{if(this['_isExistingNode'](_0x425b07)){const _0x10c35f=ms(_0x425b07,'data-id');if(_0x10c35f&&this['_existingDataIds']['has'](_0x10c35f)){const _0x1f5b78=ps('data-id',_0x10c35f,_0x3d5b7f);this['_replaceNode'](_0x1f5b78,_0x425b07);}if(this['_touchedNodesState']['removedIds']['includes'](_0x10c35f)){const _0x3fb9d2=this['_touchedNodesState']['removedIds']['indexOf'](_0x10c35f);this['_touchedNodesState']['removedIds']['splice'](_0x3fb9d2,0x1);}}else{if(this['_isDelNode'](_0x425b07)){const _0x359cb4=ms(_0x425b07,'data-id');this['_touchedNodesState']['modifiedIds']['includes'](_0x359cb4)||this['_storeDeletedElementIds'](_0x425b07);}}}}}for(const _0x5a8113 of this['_touchedNodesState']['removedIds']){const _0xe95df4=ps('data-id',_0x5a8113,_0x3d5b7f);if(_0xe95df4){if(_0x58cdd1&&_0x58cdd1['replaceRemovedWith']){this['_touchedNodesState']['lastTouchedId']=_0x5a8113;const _0x500e20=_0x58cdd1['replaceRemovedWith']['cloneNode'](!0x0);Cs(_0x500e20,'data-id',_0x5a8113),Cs(_0x500e20,'data-removed','true'),_0x5a3604(_0xe95df4,_0x500e20);}else _0x2abe84(_0xe95df4);}}if(Ts('data-wrapped-id',null,_0x3d5b7f)['forEach'](_0x54d205=>{const _0x2459ee=ps('data-id',ms(_0x54d205,'data-wrapped-id'),_0x3d5b7f);var _0x132bed,_0x26dbf8;_0x2459ee&&(_0x26dbf8=_0x54d205,_0x2abe84(_0x132bed=_0x2459ee),_0x5a3604(_0x26dbf8,_0x132bed));}),Ts('data-id','new-element',_0x3d5b7f)['forEach'](_0x471d12=>{const _0x3e4555=this['_getUid'](_0x471d12);Cs(_0x471d12,'data-id',_0x3e4555),this['_touchedNodesState']['newIds']['push'](_0x3e4555);}),this['_removeSpecialComments'](_0x3d5b7f),_0x58cdd1&&_0x58cdd1['markUnstableElements']&&this['_markUnstableElements'](_0x3d5b7f,_0x58cdd1['markUnstableElementsDepth']||0x0),_0x58cdd1&&_0x58cdd1['cutAfterLastChange']&&this['_touchedNodesState']['lastTouchedId']){let _0x10eed9=ps('data-id',this['_touchedNodesState']['lastTouchedId'],_0x3d5b7f);for(;_0x10eed9;)Rs(_0x10eed9),_0x10eed9=_0x10eed9['parentNode'];}return{'parsedContent':_0x3d5b7f,'newNodeIds':this['_touchedNodesState']['newIds'],'modifiedNodeIds':this['_touchedNodesState']['modifiedIds'],'removedNodeIds':this['_touchedNodesState']['removedIds']};}['_insertNodes'](_0x4a1cd6,_0x29b85c,_0x1b0f45){for(const _0x10829e of _0x29b85c){const _0x4b536b=this['_getUid'](_0x10829e);Cs(_0x10829e,'data-id',_0x4b536b),this['_touchedNodesState']['newIds']['push'](_0x4b536b),this['_touchedNodesState']['lastTouchedId']=_0x4b536b;}const _0x8afaf='afterbegin'===_0x1b0f45||'afterend'===_0x1b0f45?_0x29b85c['reverse']():_0x29b85c;for(const _0x124c89 of _0x8afaf)ws(_0x4a1cd6,_0x124c89,_0x1b0f45);}['_replaceNode'](_0x5c026c,_0x8a1b3f){if(!_0x5c026c)return;if(_0x51874d=_0x8a1b3f,Ss(Es(_0x5c026c))===Ss(Es(_0x51874d)))return;var _0x51874d;const _0x593093=this['_getUid'](_0x5c026c);Cs(_0x8a1b3f,'data-id',_0x593093),this['_touchedNodesState']['modifiedIds']['push'](_0x593093),this['_touchedNodesState']['lastTouchedId']=_0x593093,_0x5a3604(_0x5c026c,_0x8a1b3f['cloneNode'](!0x0));}['_findReferenceNode'](_0xb4d558,_0x3157b3,_0x59bb53){const _0x2afb61=this['_findPrevElementWithDataId'](_0xb4d558,!0x1);if(_0x2afb61){const _0x228ef4=this['_getNodeDataId'](_0x2afb61),_0x288add=ps('data-id',_0x228ef4,_0x59bb53);if(_0x288add)return[_0x288add,'afterend'];this['_touchedNodesState']['invalidIds']['push'](_0x228ef4);}const _0x474e4c=this['_findNextElementWithDataId'](_0xb4d558,!0x1);if(_0x474e4c){const _0x3f90b8=this['_getNodeDataId'](_0x474e4c),_0x1f78d2=ps('data-id',_0x3f90b8,_0x59bb53);if(_0x1f78d2)return[_0x1f78d2,'beforebegin'];this['_touchedNodesState']['invalidIds']['push'](_0x3f90b8);}return _0x3157b3?_0xb4d558['nextSibling']?this['_findFallbackReferenceNode'](_0xb4d558,_0x59bb53):[_0x59bb53['childNodes'][_0x59bb53['childNodes']['length']-0x1],'afterend']:[_0x59bb53['childNodes'][0x0],'beforebegin'];}['_findFallbackReferenceNode'](_0x4a8414,_0x2229a0){const _0x463999=[],_0x4e2e42=this['_findPrevElementWithDataId'](_0x4a8414,!0x0);if(_0x4e2e42){const _0x1b400d=ps('data-id',this['_getNodeDataId'](_0x4e2e42),_0x2229a0);_0x1b400d&&_0x463999['push']([_0x1b400d,'afterend']);}const _0x5e4ebe=this['_findNextElementWithDataId'](_0x4a8414,!0x0);if(_0x5e4ebe){const _0x57af5a=ps('data-id',this['_getNodeDataId'](_0x5e4ebe),_0x2229a0);_0x57af5a&&_0x463999['push']([_0x57af5a,'beforebegin']);}if(_0x463999['length']>0x1)return bs(_0x463999[0x0][0x0])<=bs(_0x463999[0x1][0x0])?_0x463999[0x0]:_0x463999[0x1];return 0x1===_0x463999['length']?_0x463999[0x0]:[_0x2229a0['lastChild'],'afterend'];}['_findNextElementWithDataId'](_0x521b28,_0x546ea8){let _0x1ebc36=_0x521b28['nextSibling'],_0x4604f5=null,_0x5c90b3=!0x1;for(;_0x1ebc36;){if(_0x2eb15b(_0x1ebc36)){if(this['_isDelNode'](_0x1ebc36)&&(_0x4604f5=_0x1ebc36),this['_isExistingContentComment'](_0x1ebc36)&&_0x546ea8&&!_0x5c90b3){_0x5c90b3=!0x0,_0x1ebc36=_0x1ebc36['nextSibling'];continue;}break;}const _0x2fe9ea=ms(_0x1ebc36,'data-id');if(_0x2fe9ea&&'new-element'!==_0x2fe9ea&&this['_existingDataIds']['has'](_0x2fe9ea)){_0x4604f5=_0x1ebc36;break;}_0x1ebc36=_0x1ebc36['nextSibling'];}return _0x4604f5;}['_findPrevElementWithDataId'](_0x299a3f,_0x1be3a3){let _0x38f73c=_0x299a3f['previousSibling'],_0x53f9b7=null,_0x1cb5e1=!0x1;for(;_0x38f73c;){if(_0x2eb15b(_0x38f73c)){if(this['_isDelNode'](_0x38f73c)&&(_0x53f9b7=_0x38f73c),this['_isExistingContentComment'](_0x38f73c)&&_0x1be3a3&&!_0x1cb5e1){_0x1cb5e1=!0x0,_0x38f73c=_0x38f73c['previousSibling'];continue;}break;}const _0x20c327=ms(_0x38f73c,'data-id');if(_0x20c327&&'new-element'!==_0x20c327&&this['_existingDataIds']['has'](_0x20c327)){_0x53f9b7=_0x38f73c;break;}_0x38f73c=_0x38f73c['previousSibling'];}return _0x53f9b7;}['_markWrappedElements'](_0x5b58b1){_0x5af81f(_0x5b58b1)&&Ts('data-id',null,_0x5b58b1)['forEach'](_0x16b284=>{this['_isExistingNode'](_0x16b284)&&!this['_hasWrappedParent'](_0x16b284)&&(Cs(_0x16b284,'data-wrapped-id',ms(_0x16b284,'data-id')),Cs(_0x16b284,'data-id',null));});}['_getNodeDataId'](_0x521eef){if(!_0x521eef)return null;if(_0x5af81f(_0x521eef))return ms(_0x521eef,'data-id');if(_0x2eb15b(_0x521eef)){const _0x242ed0=Es(_0x521eef)['match'](/removed[\s*-]data-id="([^"]+)"/);if(_0x242ed0&&_0x242ed0[0x1])return _0x242ed0[0x1];}return null;}['_storeDeletedElementIds'](_0x2b674f){if(_0x2eb15b(_0x2b674f)){const _0x6cb08a=Es(_0x2b674f)['match'](/removed[\s*-]data-id="([^"]+)"/);_0x6cb08a&&_0x6cb08a[0x1]&&this['_touchedNodesState']['removedIds']['push'](_0x6cb08a[0x1]);}}['_getUid'](_0xf2b615){return this['_isExistingNode'](_0xf2b615)?ms(_0xf2b615,'data-id'):this['_generateUid']();}['_removeSpecialComments'](_0x22da73){(function(_0xe402af){return _0x42b7b4(_0x4d0e2a=>_0x2eb15b(_0x4d0e2a),_0xe402af,!0x0,0x1/0x0);}(_0x22da73)['filter'](_0x2c9030=>this['_isDelNode'](_0x2c9030)||this['_isExistingContentComment'](_0x2c9030))['forEach'](_0x138e60=>{_0x2abe84(_0x138e60);}));}['_markLastTagElementUnstable'](_0x9101fb){const _0x4ff083=_0x9101fb['childNodes'],_0x2e134e=_0x4ff083[_0x4ff083['length']-0x1];_0x2e134e&&_0x5af81f(_0x2e134e)&&Cs(_0x2e134e,'data-unstable','true');}['_markUnstableElements'](_0x48b8df,_0x3aba36){const _0x51cf0c=ps('data-unstable','true',_0x48b8df);if(!_0x51cf0c)return;const _0x3a299f=fs(_0x51cf0c)['slice'](0x0,-0x1),_0x15d61f=_0x3a299f['length'];let _0x478c80=_0x51cf0c;if(_0x15d61f>_0x3aba36){let _0x92757c=_0x15d61f,_0x2dabcb=null;for(;_0x92757c>_0x3aba36&&_0x92757c>=0x0;)_0x92757c--,_0x2dabcb=_0x3a299f[_0x92757c];_0x2dabcb&&(_0x478c80=_0x2dabcb,Cs(_0x51cf0c,'data-unstable',null),Cs(_0x2dabcb,'data-unstable','true'));}else{if(_0x15d61f<_0x3aba36){let _0x5a7636=_0x15d61f,_0x599be0=_0x51cf0c;for(;_0x5a7636<_0x3aba36;){const _0x54b8e2=_0x599be0['childNodes']['filter'](_0x2c679a=>_0x5af81f(_0x2c679a));if(0x0===_0x54b8e2['length'])break;_0x5a7636++,_0x599be0=_0x54b8e2[_0x54b8e2['length']-0x1];}_0x599be0&&(_0x478c80=_0x599be0,Cs(_0x51cf0c,'data-unstable',null),Cs(_0x599be0,'data-unstable','true'));}}let _0x1b89f4=_0x478c80;for(;_0x1b89f4;){for(;_0x1b89f4['nextSibling'];)_0x1b89f4=_0x1b89f4['nextSibling'],_0x5af81f(_0x1b89f4)&&Cs(_0x1b89f4,'data-unstable','true');_0x1b89f4=_0x1b89f4['parentNode'];}}['_isNewNode'](_0x4ee1b2){return Boolean('new-element'===ms(_0x4ee1b2,'data-id'));}['_isExistingNode'](_0x2b9ec9){return Boolean((ms(_0x2b9ec9,'data-id')||'')['length']>0x0&&'new-element'!==ms(_0x2b9ec9,'data-id'));}['_isDelNode'](_0xa43762){return!!_0xa43762&&Boolean(_0x2eb15b(_0xa43762)&&Es(_0xa43762)['match'](/removed[\s*-]data-id="[^"]+"/));}['_hasWrappedParent'](_0x240acc){let _0x342421=_0x240acc['parentNode'];for(;_0x342421;){if(ms(_0x342421,'data-wrapped-id'))return!0x0;_0x342421=_0x342421['parentNode'];}return!0x1;}['_isExistingContentComment'](_0x5f2888){return Boolean(_0x2eb15b(_0x5f2888)&&Es(_0x5f2888)['match'](/\s*existing[\s*-](content|document)\s*/g));}}function Ns({editor:_0x196407,changeGroups:_0x2d2caa,documentContextContent:_0x43c8c3,showDiff:_0x35f692,trimUnchanged:_0x2c5a5f=!0x0}){return _0x2d2caa['map'](_0x68cb8c=>{const _0x50f6fa=new _0x5326ca([]),_0x3fc94b=new _0x5326ca([]);for(const _0x51cdb1 of _0x68cb8c['changes'])if(_0x35f692&&'removed'==_0x51cdb1['type']||_0x3fc94b['children']['push'](_0x51cdb1['node']['cloneNode'](!0x0)),'new'!=_0x51cdb1['type']&&(_0x35f692||'removed'!=_0x51cdb1['type'])){const _0x2f5fed=_0x5f061e(_0x3debe5=>ms(_0x3debe5,'data-id')==_0x51cdb1['id'],_0x43c8c3,!0x0);_0x2f5fed&&_0x50f6fa['children']['push'](_0x2f5fed['cloneNode'](!0x0));}const {content:_0x263df8,hasChanges:_0x239b39}=function(_0x436c85,_0x4c401f,_0x72eed2,_0x3906a1,_0x3e8452=!0x0){const _0x17183f=_0x436c85['plugins']['get']('DocumentCompare'),_0x4f6035=Es(_0x4c401f),_0x220382=Es(_0x72eed2),_0x9d988d=_0x436c85['data']['parse'](_0x4f6035,'$root'),_0x31b3b1=_0x436c85['model']['createPositionAt'](_0x9d988d,0x0),_0x585f8f=_0x17183f['getDiff'](_0x4f6035,_0x220382,{'anchor':_0x31b3b1,'markDeletions':_0x3906a1}),_0x23955a=_0x585f8f['getOperations']();if(0x0==_0x23955a['length'])return{'content':_0x4c401f['cloneNode'](!0x0),'hasChanges':!0x1};_0x3906a1?function(_0x58239a,_0x4d8e11,_0x221859){if(0x0==_0x58239a['length'])return;const _0x27105a=_0x221859['plugins']['get']('DocumentCompare'),_0xd7e72b=_0x221859['plugins']['get']('SuggestionsConversion');_0x221859['model']['change'](_0x44d2d0=>{const _0x1d08e1=new Set();for(let _0x1d56d6=0x0;_0x1d56d6<_0x58239a['length'];_0x1d56d6++){const _0x5ed0dd=_0x58239a[_0x1d56d6];if(_0x5ed0dd['baseVersion']=null,_0x5ed0dd['isDocumentOperation']=!0x1,_0x27105a['isMarkedRemoveOperation'](_0x5ed0dd)){const _0x4a422b=_0x120edb(_0x5ed0dd['newRange'],_0x221859['model']),_0x1c7e0b='suggestion:deletion:'+ot()+':$aiSuggestion';_0x4d8e11['markers']['set'](_0x1c7e0b,_0x4a422b);}else switch(_0x5ed0dd['type']){case'rename':{if(_0x5ed0dd['oldName']==_0x5ed0dd['newName'])break;_0x44d2d0['batch']['addOperation'](_0x5ed0dd),_0x221859['model']['applyOperation'](_0x5ed0dd);const _0x58e23f='$elementName',_0x1be34e=_0x5ed0dd['position'],_0xdaeea7=_0x221859['model']['createRange'](_0x1be34e,_0x221859['model']['createPositionAt'](_0x1be34e['nodeAfter'],'end')),_0x201024='suggestion:attribute:'+_0x58e23f+':'+ot()+':$aiSuggestion';_0x4d8e11['markers']['set'](_0x201024,_0xdaeea7);break;}case'addAttribute':case'removeAttribute':case'changeAttribute':{if(_0x5ed0dd['oldValue']==_0x5ed0dd['newValue'])break;_0x44d2d0['batch']['addOperation'](_0x5ed0dd),_0x221859['model']['applyOperation'](_0x5ed0dd);const _0x1b45e0=_0x5ed0dd['key'];if(!_0xd7e72b['isRegisteredAttribute'](_0x1b45e0))break;const _0x3f06e4=_0x120edb(_0x5ed0dd['range'],_0x221859['model']),_0x4482e6='suggestion:attribute:'+_0x1b45e0+':'+ot()+':$aiSuggestion';_0x4d8e11['markers']['set'](_0x4482e6,_0x3f06e4);break;}case'insert':{_0x44d2d0['batch']['addOperation'](_0x5ed0dd),_0x221859['model']['applyOperation'](_0x5ed0dd);if(_0x58239a[_0x1d56d6+0x1]&&'move'==_0x58239a[_0x1d56d6+0x1]['type']){vs(_0x4d8e11,_0x5ed0dd);break;}const _0x2d3332=_0x5ed0dd['position'],_0x5ac4e8=_0x5ed0dd['howMany'],_0x262529=_0x120edb(_0x221859['model']['createRange'](_0x2d3332,_0x2d3332['getShiftedBy'](_0x5ac4e8)),_0x221859['model']),_0x1b6743='suggestion:insertion:'+ot()+':$aiSuggestion';_0x4d8e11['markers']['set'](_0x1b6743,_0x262529);break;}case'split':{_0x44d2d0['batch']['addOperation'](_0x5ed0dd),_0x221859['model']['applyOperation'](_0x5ed0dd);const _0x256543=_0x5ed0dd['splitPosition'],_0x556e65=_0x5ed0dd['moveTargetPosition'],_0xcca92=_0x221859['model']['createRange'](_0x256543,_0x556e65),_0x57cc08='suggestion:insertion:'+ot()+':$aiSuggestion';_0x4d8e11['markers']['set'](_0x57cc08,_0xcca92);break;}case'move':{_0x44d2d0['batch']['addOperation'](_0x5ed0dd),_0x221859['model']['applyOperation'](_0x5ed0dd),_0x58239a[_0x1d56d6-0x1]&&'insert'==_0x58239a[_0x1d56d6-0x1]['type']&&vs(_0x4d8e11,_0x5ed0dd);const _0x2e72f0=_0x5ed0dd['getMovedRangeStart'](),_0x14f32c=_0x5ed0dd['howMany'];for(let _0x487d69=0x0;_0x487d69<_0x14f32c;_0x487d69++){const _0x5b8d46=_0x2e72f0['getShiftedBy'](_0x487d69)['nodeAfter'];_0x1d08e1['add'](_0x5b8d46);}break;}case'remove':{const _0x36d4ed=_0x5ed0dd['sourcePosition'],_0x204e3b=_0x5ed0dd['howMany'],_0x55f84a=new _0x3ff0e2(_0x36d4ed,_0x204e3b);_0x44d2d0['batch']['addOperation'](_0x55f84a),_0x221859['model']['applyOperation'](_0x55f84a);break;}}}for(const _0x5c90b6 of _0x1d08e1){const _0xd07af2=_0x221859['model']['createRangeOn'](_0x5c90b6),_0x3b5973='suggestion:formatBlock:$fakeWrap:'+ot()+':$aiSuggestion';_0x4d8e11['markers']['set'](_0x3b5973,_0x120edb(_0xd07af2,_0x221859['model']));}});}(_0x23955a,_0x9d988d,_0x436c85):_0x436c85['model']['change'](_0xa3bac1=>{for(const _0x63c951 of _0x23955a)if('remove'==_0x63c951['type']){const _0x22b63d=_0x63c951['sourcePosition'],_0x2d16a7=_0x63c951['howMany'],_0x5cc1d6=new _0x3ff0e2(_0x22b63d,_0x2d16a7);_0xa3bac1['batch']['addOperation'](_0x5cc1d6),_0x436c85['model']['applyOperation'](_0x5cc1d6);}else{if('marker'==_0x63c951['type']){const _0xa04374=_0x63c951['name'],_0xe08591=_0x63c951['newRange'];null!==_0xe08591?_0x9d988d['markers']['set'](_0xa04374,_0xe08591):_0x9d988d['markers']['delete'](_0xa04374);}else _0x63c951['baseVersion']=null,_0x63c951['isDocumentOperation']=!0x1,_0xa3bac1['batch']['addOperation'](_0x63c951),_0x436c85['model']['applyOperation'](_0x63c951);}});if(_0x3e8452){const _0x4739fa=ys(_0x436c85,_0x23955a,_0x9d988d);xs(_0x436c85['model'],_0x4739fa),function(_0x2823cf,_0x2b6f63){const _0xd85eb3=_0x2b6f63['getFirstRange']()['start'];let _0x465748=_0x2b6f63['getFirstRange']()['end'];const _0x15ba80=_0xd85eb3['root'];(_0x465748['textNode']||_0x465748['nodeAfter']&&_0x465748['nodeAfter']['is']('$text'))&&(_0x3a994f(_0x465748,'...'),_0x465748=_0x465748['getShiftedBy'](0x3)),(_0xd85eb3['textNode']||_0xd85eb3['nodeBefore']&&_0xd85eb3['nodeBefore']['is']('$text'))&&(_0x3a994f(_0xd85eb3,'...'),function(_0x2c4431,_0xb431b3,_0x311646){for(let [_0x21d126,_0x32c3cc]of _0x2c4431['markers']){const _0x3d6b4e=_0x32c3cc['_getTransformedByInsertion'](_0xb431b3,_0x311646,!0x1);_0x32c3cc=_0x3d6b4e[0x0],_0x2c4431['markers']['set'](_0x21d126,_0x32c3cc);}}(_0x15ba80,_0xd85eb3,0x3),_0xd85eb3['parent']==_0x465748['parent']&&(_0x465748=_0x465748['getShiftedBy'](0x3)));const _0x3b73d8=_0x2823cf['createRange'](_0x2823cf['createPositionAt'](_0x15ba80,0x0),_0xd85eb3),_0x4a7b88=_0x2823cf['createRange'](_0x465748,_0x2823cf['createPositionAt'](_0x15ba80,'end')),_0x4ff482=[..._0x3b73d8['getMinimalFlatRanges'](),..._0x4a7b88['getMinimalFlatRanges']()];_0x4ff482['reverse']();for(const _0x2a0d3b of _0x4ff482)_0x61787b(_0x2a0d3b),Ds(_0x15ba80,_0x2a0d3b);}(_0x436c85['model'],_0x4739fa);}const _0x7b7cb5=_0x436c85['data']['stringify'](_0x9d988d,{'showSuggestionHighlights':!0x0});return{'content':Is(_0x7b7cb5),'hasChanges':!0x0};}(_0x196407,_0x50f6fa,_0x3fc94b,_0x35f692,_0x2c5a5f);return{'type':_0x68cb8c['changes'][0x0]['type'],'index':_0x68cb8c['index'],'content':_0x263df8,'hasChanges':_0x239b39};});}function vs(_0x1d7aea,_0x46a817){for(const [_0x2d8c6b,_0x1c433c]of _0x1d7aea['markers']){const _0x40d638=_0x1857bd['_createFromRanges'](_0x1c433c['getTransformedByOperation'](_0x46a817));_0x1d7aea['markers']['set'](_0x2d8c6b,_0x40d638);}}function ys(_0x351700,_0x92c471,_0x557d9e){const _0x415254=_0x351700['plugins']['get']('DocumentCompare');let _0x2501f9=_0x351700['model']['createPositionAt'](_0x557d9e,Number['POSITIVE_INFINITY']),_0x1de2c2=_0x351700['model']['createPositionAt'](_0x557d9e,0x0);for(const _0x30bf7b of _0x92c471){let _0x24114c,_0x4850ed;if(_0x415254['isMarkedRemoveOperation'](_0x30bf7b))_0x24114c=_0x30bf7b['newRange']['start'],_0x4850ed=_0x30bf7b['newRange']['end'];else switch(_0x2501f9=_0x2501f9['getTransformedByOperation'](_0x30bf7b),_0x1de2c2=_0x1de2c2['getTransformedByOperation'](_0x30bf7b),_0x30bf7b['type']){case'rename':_0x24114c=_0x30bf7b['position'],_0x4850ed=_0x24114c['getShiftedBy'](0x1);break;case'addAttribute':case'removeAttribute':case'changeAttribute':_0x24114c=_0x30bf7b['range']['start'],_0x4850ed=_0x30bf7b['range']['end'];break;case'insert':_0x24114c=_0x30bf7b['position'],_0x4850ed=_0x24114c['getShiftedBy'](_0x30bf7b['howMany']);break;case'split':_0x24114c=_0x30bf7b['splitPosition'],_0x4850ed=_0x30bf7b['moveTargetPosition'];break;case'merge':{const _0x218a5d=_0x30bf7b['targetPosition']['path']['slice'](0x0,-0x1);_0x24114c=_0x351700['model']['createPositionFromPath'](_0x557d9e,_0x218a5d),_0x4850ed=_0x24114c['getShiftedBy'](0x1);break;}case'remove':{const _0x221c03=_0x30bf7b['howMany'],_0x5eb122=_0x30bf7b['sourcePosition']['_getTransformedByInsertion'](_0x30bf7b['targetPosition'],_0x221c03),_0x52f958=_0x30bf7b['getMovedRangeStart']();'remove'==_0x30bf7b['type']?(_0x24114c=_0x5eb122,_0x4850ed=_0x5eb122):(_0x24114c=_0x52f958,_0x4850ed=_0x52f958['getShiftedBy'](_0x221c03));break;}}_0x24114c&&_0x24114c['isBefore'](_0x2501f9)&&(_0x2501f9=_0x24114c['clone'](),_0x2501f9['stickiness']='toNone'),_0x4850ed&&_0x4850ed['isAfter'](_0x1de2c2)&&(_0x1de2c2=_0x4850ed['clone'](),_0x1de2c2['stickiness']='toNone');}return _0x351700['model']['createSelection'](_0x351700['model']['createRange'](_0x2501f9,_0x1de2c2));}function xs(_0x5d858f,_0xa05d99){Ls(_0x5d858f,_0xa05d99,'forward');const _0xe75387=_0xa05d99['getFirstRange']();_0xa05d99['setTo']([]),_0xa05d99['setTo'](_0xe75387,{'backward':!0x0}),Ls(_0x5d858f,_0xa05d99,'backward');}function Ls(_0xc01291,_0x46a7bc,_0xac7e0a){let _0x16b1f4=0x14;for(;_0x16b1f4;){_0xc01291['modifySelection'](_0x46a7bc,{'unit':'word','direction':_0xac7e0a}),_0x16b1f4--;const _0x4c7d1d=_0x46a7bc['focus']['forward'==_0xac7e0a?'nodeBefore':'nodeAfter'];if(_0x4c7d1d&&_0x4c7d1d['is']('element')&&_0xc01291['schema']['isBlock'](_0x4c7d1d)&&_0xc01291['schema']['isObject'](_0x4c7d1d))break;}}function Ds(_0x1bda23,_0x5bc97f){for(const [_0x50f74d,_0x57e684]of _0x1bda23['markers']){const _0x213599=_0x57e684['_getTransformedByDeletion'](_0x5bc97f['start'],_0x5bc97f['end']['offset']-_0x5bc97f['start']['offset']);null!=_0x213599?_0x1bda23['markers']['set'](_0x50f74d,_0x213599):_0x1bda23['markers']['delete'](_0x50f74d);}}class Ps extends ct(){['id'];['interactionId'];['type'];['sources']=[];['parsedContent']=new _0x5326ca([]);['parsedMergedContent']=new _0x5326ca([]);['changeGroups']=[];['areActionsDisabled']=!0x1;['documentContextContent'];['aiResponseParser'];['aiResponseApplier'];['editor'];['cachedSuggestionContentParts']={'withDiff':[],'withoutDiff':[]};constructor({type:_0x5abbdb,content:_0x12e7f4='',isDone:_0x1dfe07=!0x1,interactionId:_0x3de058,areActionsDisabled:_0x27503c,documentContextContent:_0xee291c,editor:_0x29ef9d,id:_0x5c7ce1}){super(),this['id']=_0x5c7ce1||ot(),this['interactionId']=_0x3de058,this['type']=_0x5abbdb,this['areActionsDisabled']=!!_0x27503c,this['editor']=_0x29ef9d,this['aiResponseParser']=new Os(),this['aiResponseApplier']=new ks(),this['documentContextContent']=Is(_0xee291c||''),this['set']('isDone',_0x1dfe07),this['on']('change:content',()=>{this['onContentChange']();}),this['set']('content',_0x12e7f4);}['appendContent'](_0x41eeca){this['set']('content',this['content']+_0x41eeca);}['done'](){this['isDone']||(this['set']('isDone',!0x0),this['onContentChange']());}['destroy'](){this['stopListening']();}['setChangeGroupState'](_0x368f18,_0x5c7961){this['changeGroups'][_0x368f18]['state']=_0x5c7961,this['fire']('replyChangeGroupStateUpdated',{'reply':this,'index':_0x368f18,'state':_0x5c7961});}['getContentParts']({showDiff:_0x36704d,groupIndex:_0x56adc2}){if(!this['editor'])throw new ht('ai-get-editor-from-context-no-editor',null,{'aiReply':this});const _0x5e48fa=this['_getCachedContentParts'](_0x36704d,_0x56adc2);if(_0x5e48fa)return _0x5e48fa;let _0x59cc6c=[];if(void 0x0===_0x56adc2)_0x59cc6c=this['changeGroups'];else{const _0x46f3a6=this['changeGroups']['find'](({index:_0x18a0e5})=>_0x18a0e5===_0x56adc2);if(!_0x46f3a6)throw new ht('ai-reply-get-content-parts-group-not-found',null,{'aiReply':this,'groupIndex':_0x56adc2});_0x59cc6c=[_0x46f3a6];}const _0x5c7904=Ns({'editor':this['editor'],'showDiff':_0x36704d,'changeGroups':_0x59cc6c,'documentContextContent':this['documentContextContent']});return this['_setCachedContentParts'](_0x36704d,_0x5c7904),_0x5c7904;}['_getCachedContentParts'](_0x42a4fb,_0x1fa491){const _0x4f00f1=_0x42a4fb?'withDiff':'withoutDiff';if(!this['cachedSuggestionContentParts'][_0x4f00f1]['length'])return null;const _0x490348=this['cachedSuggestionContentParts'][_0x4f00f1];if(void 0x0===_0x1fa491)return _0x490348['length']>0x0&&_0x490348['length']!==this['changeGroups']['length']?(this['_setCachedContentParts'](_0x42a4fb,null),null):_0x175c10(_0x490348);{const _0x1cc0e6=_0x490348['find'](({index:_0x12b292})=>_0x12b292===_0x1fa491);if(_0x1cc0e6)return[_0x175c10(_0x1cc0e6)];}return null;}['_setCachedContentParts'](_0x1c792b,_0x4fd809){const _0x13573a=_0x1c792b?'withDiff':'withoutDiff';_0x4fd809?_0x4fd809['forEach'](_0x116d1b=>{const _0x4bfbb1=this['cachedSuggestionContentParts'][_0x13573a],_0x2c82ea=_0x4bfbb1['find'](({index:_0x2b767f})=>_0x2b767f===_0x116d1b['index']);if(_0x2c82ea){const _0x8f4350=_0x4bfbb1['indexOf'](_0x2c82ea);_0x4bfbb1['splice'](_0x8f4350,0x1,_0x116d1b);}else _0x4bfbb1['push'](_0x116d1b);}):this['cachedSuggestionContentParts'][_0x13573a]['length']=0x0;}['onContentChange'](){if('modification'===this['type']){this['parsedContent']=this['aiResponseParser']['parseAndNormalizeHTML'](this['content']);const _0x4a15d8=this['changeGroups'];this['updateChangeGroups']();const _0x2d357b=this['_getDifferentChangeGroups'](_0x4a15d8,this['changeGroups']);(_0x2d357b['length']||this['isDone'])&&(this['fire']('replyContentUpdated',this,_0x2d357b),this['cachedSuggestionContentParts']['withDiff']['length']=this['cachedSuggestionContentParts']['withoutDiff']['length']=0x0);}else this['parsedContent']=this['aiResponseParser']['convertMarkdownToHTML'](this['content']),this['fire']('replyContentUpdated',this);}['_getDifferentChangeGroups'](_0x387486,_0x5f3d0f){const _0x12fb2a=[];for(const _0x59dee8 of _0x5f3d0f){const _0x348fad=_0x387486[_0x59dee8['index']];_0x348fad?_0x348fad['changes']['length']!==_0x59dee8['changes']['length']?_0x12fb2a['push'](_0x59dee8):_0x348fad['changes']['forEach']((_0x173c1c,_0x59f14c)=>{const _0xf01dde=_0x59dee8['changes'][_0x59f14c];_0x173c1c['id']!==_0xf01dde['id']&&_0x12fb2a['push'](_0x59dee8);}):_0x12fb2a['push'](_0x59dee8);}return _0x12fb2a;}['updateChangeGroups'](){const _0x2b6ffa=new _0x4ea24a('p',{},[new _0x4ea24a('span',{'style':'color:\x20#808080;\x20font-style:\x20italic'},[new _0x2883a5(us(this['editor']['locale'],'AI_SUGGESTION_CONTENT_PART_REMOVED'))])]),_0x45e453=this['aiResponseApplier']['merge'](this['parsedContent'],this['documentContextContent']['cloneNode'](!0x0),{'markUnstableElements':!this['isDone'],'replaceRemovedWith':_0x2b6ffa,'cutAfterLastChange':!this['isDone']});if(!_0x45e453['modifiedNodeIds']['length']&&!this['isDone'])return;this['parsedMergedContent']=_0x45e453['parsedContent'];let _0x17a653=[];if(_0x14ee28(_0x47a89b=>{const _0x36522b=ms(_0x47a89b,'data-id');if(!_0x36522b||!_0x2f1b12(_0x36522b))return!0x1;const _0x2e683a=[_0x47a89b,...fs(_0x47a89b)]['at'](-0x2);if(_0x47a89b!=_0x2e683a){const _0x1a2adb=ms(_0x2e683a,'data-id');_0x2f1b12(_0x1a2adb)||(_0x17a653['push']({'node':_0x2e683a,'id':_0x1a2adb,'type':'modified'}),_0x45e453['modifiedNodeIds']['push'](_0x1a2adb));}else _0x45e453['modifiedNodeIds']['includes'](_0x36522b)?_0x17a653['push']({'node':_0x47a89b,'type':'modified','id':_0x36522b}):_0x45e453['newNodeIds']['includes'](_0x36522b)?_0x17a653['push']({'node':_0x47a89b,'type':'new','id':_0x36522b,'anchorId':ms(_0x47a89b['previousSibling'],'data-id')}):_0x17a653['push']({'node':_0x47a89b,'type':'removed','id':_0x36522b});return!0x0;},this['parsedMergedContent']),_0x17a653=_0x17a653['filter'](({node:_0x4b2546})=>[...fs(_0x4b2546),_0x4b2546]['every'](_0x4ea0c1=>!ms(_0x4ea0c1,'data-unstable'))),0x0==_0x17a653['length'])return;const _0x16f5af=[[_0x17a653[0x0]]];for(let _0x2ba3c7=0x1;_0x2ba3c7<_0x17a653['length'];_0x2ba3c7++){const _0x55ea1a=_0x16f5af[_0x16f5af['length']-0x1],_0x522ffe=_0x55ea1a[_0x55ea1a['length']-0x1];_0x17a653[_0x2ba3c7]['node']['previousSibling']==_0x522ffe['node']&&'modified'!=_0x17a653[_0x2ba3c7]['type']&&'modified'!=_0x522ffe['type']?_0x55ea1a['push'](_0x17a653[_0x2ba3c7]):_0x16f5af['push']([_0x17a653[_0x2ba3c7]]);}for(const _0x52217d of _0x16f5af){const _0xed4bca=_0x52217d[0x0],_0xa6a256=_0x52217d[_0x52217d['length']-0x1],_0xfe4633=_0x54b9b1(_0xed4bca['node']['previousSibling']);_0xfe4633&&_0x52217d['unshift'](_0xfe4633);const _0x81d1b9=_0x54b9b1(_0xa6a256['node']['nextSibling']);_0x81d1b9&&_0x52217d['push'](_0x81d1b9);}function _0x2f1b12(_0x312250){return _0x45e453['modifiedNodeIds']['includes'](_0x312250)||_0x45e453['newNodeIds']['includes'](_0x312250)||_0x45e453['removedNodeIds']['includes'](_0x312250);}function _0x54b9b1(_0x335b14){if(_0x335b14&&ms(_0x335b14,'data-id')&&!ms(_0x335b14,'data-unstable')){const _0x4aaa21=ms(_0x335b14,'data-id');if(!_0x2f1b12(_0x4aaa21))return{'node':_0x335b14,'type':'context','id':_0x4aaa21};}return null;}this['changeGroups']=_0x16f5af['map']((_0x412deb,_0x56e451)=>({'changes':_0x412deb,'state':'pending','index':_0x56e451}));}}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:_0xbd87de,editor:_0x2c5e8f}){super(),this['id']=ot(),this['connector']=_0xbd87de,this['isStopped']=!0x0,this['editor']=_0x2c5e8f;}async['start'](){const _0xb438fe=[];let _0x1084a5,_0xb3e634,_0x4981c7;this['isStopped']=!0x1;try{this['currentRequest']=await this['sendRequest'](),this['fire']('interactionStarted',this);const _0x4a2a7b=await this['currentRequest']['getStream']();for await(const _0x13cd30 of _0x4a2a7b){if(this['isStopped'])return;if('error'==_0x13cd30['event'])return void this['fire']('error',{'error':new ht('ai-chat-interaction-error',this)});switch(_0x13cd30['event']){case'message-metadata':this['messageId']=_0x13cd30['data']['messageId'];break;case'action-metadata':this['actionCallId']=_0x13cd30['data']['callId'];break;case'conversation-title':this['setConversationTitle'](_0x13cd30['data']['conversationTitle'],!0x0);break;case'source':_0xb438fe['push'](_0x13cd30['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'](),_0x1084a5='modification-delta'==_0x13cd30['event']?'modification':'text',_0xb3e634='modification-delta'==_0x13cd30['event']?_0x13cd30['data']['id']:void 0x0,this['currentReply']&&this['currentReply']['type']!=_0x1084a5&&(this['currentReply']['done'](),this['currentReply']=void 0x0),this['currentReply']||(this['currentReply']=this['createReply']({'type':_0x1084a5,'interactionId':this['id'],'id':_0xb3e634}),'modification'==_0x1084a5&&(this['currentReply']['sources']=_0xb438fe['splice'](0x0))),this['currentReply']['appendContent'](_0x13cd30['data']['textDelta']);break;case'mcp-tool-result':_0x4981c7=JSON['parse'](_0x13cd30['data']['result']),this['_handleToolResultData']({'toolName':_0x13cd30['data']['toolName'],'data':_0x4981c7['data'],'attributes':_0x4981c7['attributes']});break;case'mcp-tool-notification':this['_handleToolNotificationData']({'toolName':_0x13cd30['data']['toolName'],'data':_0x13cd30['data']['data']});}}}finally{this['isStopped']||(this['currentReply']&&_0xb438fe['length']>0x0&&(this['currentReply']['sources']=_0xb438fe['splice'](0x0)),this['_finalizeInteraction'](),this['fire']('interactionFinished',this));}}['stop'](){this['isStopped']||(this['_finalizeInteraction'](),this['fire']('interactionStopped',this));}['getReply'](_0x2706a0){return this['replies']['find'](_0x5ddf08=>_0x5ddf08['id']===_0x2706a0);}['destroy'](){this['isDestroyed']||(this['stop'](),this['replies']['forEach'](_0x2c4c1f=>_0x2c4c1f['destroy']()),this['replies']=[],this['isDestroyed']=!0x0,this['fire']('interactionDestroyed',this),this['stopListening']());}['createReply'](_0x2bafcf){const _0x112bcb=new Ps({'editor':this['editor'],'documentContextContent':this['getDocumentContext']()?.['content'],..._0x2bafcf});return this['replies']['push'](_0x112bcb),_0x112bcb['delegate'](...Hs)['to'](this),this['fire']('replyCreated',_0x112bcb),_0x112bcb;}['setConversationTitle'](_0x3696d2,_0x40d273=!0x1){this['fire']('setConversationTitle',_0x3696d2,_0x40d273);}['resetWebSearchState'](){this['_isWebSearching']&&(this['_isWebSearching']=!0x1,this['fire']('webSearchFinished',this));}['resetReasoningState'](){this['_isReasoning']&&(this['_isReasoning']=!0x1,this['fire']('reasoningFinished',this));}['_handleToolResultData'](_0x4b5297){this['fire']('toolDataReceived',{'type':'result','toolName':_0x4b5297['toolName'],'data':structuredClone(_0x4b5297['data']||{}),'attributes':structuredClone(_0x4b5297['attributes']||{})},this);}['_handleToolNotificationData'](_0x12f8cd){this['fire']('toolDataReceived',{'type':'notification','toolName':_0x12f8cd['toolName'],'data':structuredClone(_0x12f8cd['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(_0x133cfe){return _0x133cfe['TOOL']='mcp-tool-context',_0x133cfe['FILE']='file',_0x133cfe['DOCUMENT']='document',_0x133cfe['URL']='web-resource',_0x133cfe['TEXT']='text',_0x133cfe['SELECTION']='selection',_0x133cfe;}({}),Vs=function(_0x57edab){return _0x57edab['TEXT']='text',_0x57edab['MARKDOWN']='markdown',_0x57edab['HTML']='html',_0x57edab;}({});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:_0x1e554a,config:_0x1fcb1c,ownerId:_0x5a76ca}){super(),this['_connector']=_0x1e554a,this['_config']=_0x1fcb1c,this['_ownerId']=_0x5a76ca;}['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'](_0x3d47b8){const _0x491edd=await this['_createContextItemFromContent'](_0x3d47b8);return this['_addToConversationContextItem'](_0x491edd),'current-document'===_0x491edd['uiId']&&this['_toggleAddCurrentDocumentOptionVisibility'](),_0x491edd;}async['_createContextItemFromContent'](_0x5deaab){if(_0x5deaab['type']===Us['DOCUMENT']){const _0x32e46c=await this['_connector']['fetchDocument'](this['_ownerId'],_0x5deaab['id'])['getDocument']();return{'id':'current-document','uiId':'current-document','label':'Current\x20document','type':_0x5deaab['type'],'content':_0x32e46c['content'],'hidden':this['_conversationContextItems']['has']('current-document'),'version':_0x32e46c['attributes']?.['version'],'sessionId':_0x32e46c['attributes']?.['sessionId']};}if(_0x5deaab['type']===Us['TOOL'])return{'id':_0x5deaab['id'],'uiId':_0x5deaab['id'],'label':_0x5deaab['data']?.['label']||_0x5deaab['id'],'type':Us['TOOL'],'mcpServerName':_0x5deaab['mcpServerName'],'toolName':_0x5deaab['toolName'],'data':_0x5deaab['data']||{}};return{'id':_0x5deaab['id'],'uiId':_0x5deaab['id'],'label':_0x5deaab['attributes']?.['label']||_0x5deaab['name']||_0x5deaab['url']||_0x5deaab['id'],'type':_0x5deaab['type'],..._0x5deaab?.['attributes']?.['resourceId']?{'resourceId':_0x5deaab['attributes']?.['resourceId']}:{}};}['getSentContextItems'](){return new Map(this['_conversationContextItems']);}['removeFromContext'](_0x4b0997){const _0x13e90d=this['_pendingContextItems']['get'](_0x4b0997);_0x13e90d?.['isReadOnly']||this['_removeContextItem'](_0x4b0997);}['clearPendingContextItems'](){if(0x0===this['_pendingContextItems']['size'])return;for(const _0x2c0e48 of this['_pendingContextItems']['values']())this['_removeContextItem'](_0x2c0e48['uiId']);const _0x3521e7=this['_conversationContextItems']['get']('current-document')||this['_pendingContextItems']['get']('current-document');_0x3521e7&&this['_addContextItem']({..._0x3521e7,'isReadOnly':!0x0,'hidden':!0x0});}['addToConversationContext'](_0x28df46){for(const _0x18d700 of _0x28df46['values']())this['_addToConversationContextItem'](_0x18d700);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'](_0x4f6358){return Array['from'](_0x4f6358['values']())['map'](_0x18b3e4=>this['_mapContextItemToRequestData'](_0x18b3e4))['filter'](_0x298dc1=>null!==_0x298dc1);}async['addFilesToContext'](_0x4df02f,_0x54fe08,_0x367b64=Us['FILE']){const _0x28a575='files-'+ot();this['_startUploadOperation'](_0x28a575);try{await Promise['all'](_0x4df02f['map'](async _0x48a46a=>{const _0x533983='file-'+ot(),_0x5afe92=_0x31dc1d(_0x48a46a['name']);try{this['_addContextItem']({'type':_0x367b64,'label':_0x54fe08?.['label']||_0x5afe92,'uiId':_0x533983,'resourceId':_0x54fe08?.['resourceId']},!0x0);const _0x4fbb82=this['_connector']['uploadFile'](this['_ownerId'],_0x48a46a,_0x54fe08);this['_ongoingUploads']['set'](_0x533983,_0x4fbb82['abortController']);const {id:_0x3f3e63}=await _0x4fbb82['getId']();this['_ongoingUploads']['delete'](_0x533983),this['_finishContextItemLoading']({'type':_0x367b64,'id':_0x3f3e63,'label':_0x54fe08?.['label']||_0x5afe92,'uiId':_0x533983,'resourceId':_0x54fe08?.['resourceId']},!0x1);}catch(_0x38e1c3){this['_ongoingUploads']['delete'](_0x533983);if(!(_0x38e1c3 instanceof ht&&_0x38e1c3['message']['startsWith']('ai-request-aborted'))){const _0x421a73=Bs['get'](_0x38e1c3['code'])||'ai-chat-file-upload-failed',_0x4c9dfc=new ht(_0x421a73,null,{'fileName':_0x5afe92,..._0x38e1c3});_0x4c9dfc['stack']=_0x38e1c3['stack'],this['fire']('error',{'error':_0x4c9dfc});}this['_removeContextItem'](_0x533983);}}));}finally{this['_finishUploadOperation'](_0x28a575);}}['addCurrentDocumentToContext'](_0x3fadf8){if(this['isCurrentDocumentInContext']()||!this['_addContextOptionsState']['document']['enabled'])return;const _0x1c93fc={'type':Us['DOCUMENT'],'uiId':'current-document','label':_0x3fadf8,'isReadOnly':this['_conversationContextItems']['has']('current-document'),'hidden':this['_conversationContextItems']['has']('current-document')};this['_addContextItem'](_0x1c93fc);}async['updateCurrentDocument'](_0x7df444,_0x2a3d5e,_0x31f642,_0x403b0b){const _0x525707=this['_pendingContextItems']['get']('current-document');if(_0x525707&&_0x7df444){_0x525707['selection']=_0x403b0b?_0x403b0b['map'](_0x2032c8=>({'start':_0x2032c8['start'],'end':_0x2032c8['end']})):[];try{if(_0x525707['version']===_0x2a3d5e)return;const {id:_0x568b6c}=await this['_connector']['uploadDocument'](this['_ownerId'],_0x7df444,{'version':_0x2a3d5e,'sessionId':_0x31f642})['getId']();_0x525707['id']=_0x568b6c,_0x525707['content']=_0x7df444,_0x525707['version']=_0x2a3d5e,_0x525707['sessionId']=_0x31f642;}catch(_0x5b9fa3){const _0x1dac6a=new ht('ai-chat-document-upload-failed',null);_0x1dac6a['stack']=_0x5b9fa3['stack'],this['fire']('error',{'error':_0x1dac6a});}}}['addSelectionToContext'](_0x47c339){this['_addContextItem']({'type':Us['SELECTION'],'label':_0x47c339,'uiId':'selection','content':_0x47c339});}['removeSelectionFromContext'](){this['_removeContextItem']('selection');}async['addUrlToContext'](_0x4ade90,_0x41a6e3){const _0x3ccff4='url-'+ot();this['_startUploadOperation'](_0x3ccff4);const _0x1c2e12='url-'+ot();try{this['_addContextItem']({'type':Us['URL'],'label':_0x41a6e3?.['label']||_0x4ade90,'uiId':_0x1c2e12,'resourceId':_0x41a6e3?.['resourceId']},!0x0);const _0x536540=this['_connector']['uploadUrl'](this['_ownerId'],_0x4ade90,_0x41a6e3);this['_ongoingUploads']['set'](_0x1c2e12,_0x536540['abortController']);const {id:_0x57433b}=await _0x536540['getId']();this['_ongoingUploads']['delete'](_0x1c2e12),this['_finishContextItemLoading']({'type':Us['URL'],'id':_0x57433b,'label':_0x41a6e3?.['label']||_0x4ade90,'uiId':_0x1c2e12,'resourceId':_0x41a6e3?.['resourceId']},!0x1);}catch(_0x2b01ae){this['_ongoingUploads']['delete'](_0x1c2e12),(_0x2b01ae['message']['startsWith']('ai-request-aborted')||this['fire']('error',{'error':new ht('ai-chat-url-upload-failed',this,{'url':_0x4ade90,'originalError':_0x2b01ae}),'url':_0x4ade90}),this['_removeContextItem'](_0x1c2e12));}finally{this['_finishUploadOperation'](_0x3ccff4);}}['addToolItemToContext'](_0x3cb32e){_0x3cb32e['id']=_0x3cb32e['id']??ot()['substring'](0x0,0x15),this['_pendingContextItems']['set'](_0x3cb32e['uiId'],_0x3cb32e),this['fire']('contextItemAdded',{'contextItem':_0x3cb32e,'isLoading':!0x1});}async['loadSourceResources'](_0x4b093d,_0x2320c4,_0x42818b){const _0x48214b=this['_addContextOptionsState']['sources']['find'](_0x593ce3=>_0x593ce3['id']===_0x4b093d);if(!_0x48214b)return this['fire']('error',{'error':new ht('ai-chat-source-not-found',this,{'sourceId':_0x4b093d}),'sourceId':_0x4b093d}),[];try{const _0x50e6b1=(await _0x48214b['getResources'](_0x2320c4))['map'](_0x45e7b3=>{const _0x3ee719=this['_isResourceInContext'](_0x45e7b3['id']);return{..._0x45e7b3,'isInContext':_0x3ee719};});return _0x48214b['resources']=_0x50e6b1,this['fire']('sourceResourcesLoaded',{'sourceId':_0x4b093d,'source':_0x48214b,'resources':_0x50e6b1,'uid':_0x42818b}),_0x50e6b1;}catch(_0x21a998){return this['fire']('error',{'error':new ht('ai-chat-source-resources-load-failed',this,{'sourceId':_0x4b093d,'originalError':_0x21a998}),'sourceId':_0x4b093d,'sourceLabel':_0x48214b['label']}),[];}}async['addResourceToContext'](_0x34660e,_0x25c1fa){if(this['_isResourceInContext'](_0x25c1fa['id']))return;let _0x58bffc=_0x25c1fa['data'];if(!_0x58bffc&&_0x34660e['getData'])try{_0x58bffc=await _0x34660e['getData'](_0x25c1fa['id']);}catch(_0x1b50bb){return void this['fire']('error',{'error':new ht('ai-chat-resource-load-failed',this,{'resourceId':_0x25c1fa['id'],'sourceId':_0x34660e['id'],'originalError':_0x1b50bb}),'resourceId':_0x25c1fa['id'],'sourceId':_0x34660e['id']});}if(_0x58bffc)switch(_0x25c1fa['type']){case Us['URL']:if('string'!=typeof _0x58bffc)return void this['fire']('error',{'error':new ht('ai-chat-context-invalid-data',this,{'resourceId':_0x25c1fa['id'],'sourceId':_0x34660e['id'],'expectedType':'string','actualType':typeof _0x58bffc}),'resourceId':_0x25c1fa['id'],'sourceId':_0x34660e['id']});await this['addUrlToContext'](_0x58bffc,{'label':_0x25c1fa['label'],'resourceId':_0x25c1fa['id']});break;case Us['FILE']:if(!(_0x58bffc instanceof File))return void this['fire']('error',{'error':new ht('ai-chat-context-invalid-data',this,{'resourceId':_0x25c1fa['id'],'sourceId':_0x34660e['id'],'expectedType':'File','actualType':typeof _0x58bffc}),'resourceId':_0x25c1fa['id'],'sourceId':_0x34660e['id']});await this['addFilesToContext']([_0x58bffc],{'label':_0x25c1fa['label'],'resourceId':_0x25c1fa['id']});break;case Us['TEXT']:if('object'!=typeof _0x58bffc||!('content'in _0x58bffc)||!('type'in _0x58bffc))return void this['fire']('error',{'error':new ht('ai-chat-context-invalid-data',this,{'resourceId':_0x25c1fa['id'],'sourceId':_0x34660e['id'],'expectedType':'object\x20with\x20content\x20and\x20type\x20properties','actualType':typeof _0x58bffc}),'resourceId':_0x25c1fa['id'],'sourceId':_0x34660e['id']});_0x58bffc=Fs['_convertTextResourceToFile'](_0x58bffc,_0x25c1fa['label']),await this['addFilesToContext']([_0x58bffc],{'label':_0x25c1fa['label'],'resourceId':_0x25c1fa['id']},Us['TEXT']);break;case Us['TOOL']:break;default:this['fire']('error',{'error':new ht('ai-chat-context-unsupported-type',this,{'resourceId':_0x25c1fa['id'],'sourceId':_0x34660e['id'],'resourceType':_0x25c1fa['type']}),'resourceId':_0x25c1fa['id'],'sourceId':_0x34660e['id']});}else this['fire']('error',{'error':new ht('ai-chat-resource-no-data',this,{'resourceId':_0x25c1fa['id'],'sourceId':_0x34660e['id']}),'resourceId':_0x25c1fa['id'],'sourceId':_0x34660e['id']});}static['_convertTextResourceToFile'](_0x5b56d6,_0x461769){switch(_0x5b56d6['type']){case Vs['MARKDOWN']:return new File([_0x5b56d6['content']],_0x461769,{'type':'text/markdown'});case Vs['HTML']:return new File([_0x5b56d6['content']],_0x461769,{'type':'text/html'});default:return new File([_0x5b56d6['content']],_0x461769,{'type':'text/plain'});}}static['_mapContextItemToRequestData'](_0x1ff592){switch(_0x1ff592['type']){case Us['FILE']:return{'type':Us['FILE'],'id':_0x1ff592['id']};case Us['URL']:return{'type':Us['URL'],'id':_0x1ff592['id']};case Us['DOCUMENT']:return{'type':Us['DOCUMENT'],'id':_0x1ff592['id'],..._0x1ff592['selection']?.['length']&&{'selection':_0x1ff592['selection']}};case Us['TEXT']:return{'type':Us['FILE'],'id':_0x1ff592['id']};case Us['TOOL']:{const _0x1919c7=_0x1ff592;return{'type':Us['TOOL'],'mcpServerName':_0x1919c7['mcpServerName'],'toolName':_0x1919c7['toolName'],'data':_0x1919c7['data'],'id':_0x1919c7['id']};}default:return null;}}['_addContextItem'](_0x395efd,_0x1699c7=!0x1){if(this['_pendingContextItems']['set'](_0x395efd['uiId'],_0x395efd),_0x395efd['hidden']||this['fire']('contextItemAdded',{'contextItem':_0x395efd,'isLoading':_0x1699c7}),'current-document'===_0x395efd['uiId']&&this['_toggleAddCurrentDocumentOptionVisibility'](),_0x395efd['resourceId']){const _0x135aeb=this['_findSourceIdsByResourceId'](_0x395efd['resourceId']);_0x135aeb&&_0x135aeb['forEach'](_0x4859da=>{this['_updateResourceInContextState'](_0x4859da,_0x395efd['resourceId'],!0x0);});}}['_removeContextItem'](_0x4fa68c){const _0x2b19e8=this['_pendingContextItems']['get'](_0x4fa68c),_0x4be35d=this['_ongoingUploads']['get'](_0x4fa68c);if(_0x4be35d&&(_0x4be35d['abort'](),this['_ongoingUploads']['delete'](_0x4fa68c)),_0x2b19e8?.['resourceId']){const _0x2c974d=this['_findSourceIdsByResourceId'](_0x2b19e8['resourceId']);_0x2c974d&&_0x2c974d['forEach'](_0x23255c=>{this['_updateResourceInContextState'](_0x23255c,_0x2b19e8['resourceId'],!0x1);});}this['_pendingContextItems']['delete'](_0x4fa68c),this['fire']('contextItemRemoved',{'uiId':_0x4fa68c,'type':_0x2b19e8?.['type']}),'current-document'===_0x4fa68c&&this['_toggleAddCurrentDocumentOptionVisibility']();}['_finishContextItemLoading'](_0x4ffc9c,_0x28f512){if(this['_pendingContextItems']['has'](_0x4ffc9c['uiId'])&&(this['_pendingContextItems']['set'](_0x4ffc9c['uiId'],_0x4ffc9c),this['fire']('contextItemLoadingEnded',{'contextItem':_0x4ffc9c,'isLoading':_0x28f512}),_0x4ffc9c['resourceId'])){const _0x59bd80=this['_findSourceIdsByResourceId'](_0x4ffc9c['resourceId']);_0x59bd80&&_0x59bd80['forEach'](_0x5db6b7=>{this['_updateResourceInContextState'](_0x5db6b7,_0x4ffc9c['resourceId'],!0x0);});}}['_addToConversationContextItem'](_0x2e86a8){this['_conversationContextItems']['set'](_0x2e86a8['uiId'],_0x2e86a8);}['_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'](_0x289ef1=>({..._0x289ef1,'enabled':!0x0}))??[]},this['fire']('addContextOptionsChanged',{'options':this['_addContextOptionsState']});}['_getCustomSourcesInitialState'](){return this['_config']?.['sources']?.['map'](_0xfc2df7=>({..._0xfc2df7,'resources':[]}))??[];}['_toggleAddCurrentDocumentOptionVisibility'](){const _0x1c9d7d=this['isCurrentDocumentInContext']()||this['isCurrentDocumentInConversation']();this['_addContextOptionsState']['document']['isHidden']=_0x1c9d7d,this['fire']('addContextOptionsChanged',{'options':this['_addContextOptionsState']});}['_isResourceInContext'](_0x4420b7){for(const _0x30d860 of this['_pendingContextItems']['values']())if(_0x30d860['resourceId']===_0x4420b7)return!0x0;for(const _0x1a432f of this['_conversationContextItems']['values']())if(_0x1a432f['resourceId']===_0x4420b7)return!0x0;return!0x1;}['_findSourceIdsByResourceId'](_0x340cf6){const _0x4bfdd6=[];for(const _0x33dbf5 of this['_addContextOptionsState']['sources']){_0x33dbf5['resources']['find'](_0x4dac98=>_0x4dac98['id']===_0x340cf6)&&_0x4bfdd6['push'](_0x33dbf5['id']);}return 0x0===_0x4bfdd6['length']?null:_0x4bfdd6;}['_updateResourceInContextState'](_0xe62c21,_0xa935d0,_0x52f90b){const _0x2e88b7=this['_addContextOptionsState']['sources']['find'](_0x1a8963=>_0x1a8963['id']===_0xe62c21);if(!_0x2e88b7)return;const _0x1d86a7=_0x2e88b7['resources']['find'](_0x5ef8fb=>_0x5ef8fb['id']===_0xa935d0);_0x1d86a7&&(_0x1d86a7['isInContext']=_0x52f90b,this['fire']('resourceStateChanged',{'sourceId':_0xe62c21,'resourceId':_0xa935d0,'isInContext':_0x52f90b}));}['_startUploadOperation'](_0x2f579f){this['_ongoingUploadOperations']['set'](_0x2f579f,!0x0),this['_ongoingUploadOperations']['size']&&this['fire']('uploadProgressChanged',{'isUploadInProgress':!0x0});}['_finishUploadOperation'](_0x42a233){this['_ongoingUploadOperations']['delete'](_0x42a233),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'](_0x1db1af){const _0xa1d5a3={};return _0x1db1af&&_0x1db1af['isWebSearchEnabled']&&(_0xa1d5a3['webSearch']={}),_0x1db1af&&_0x1db1af['isReasoningEnabled']&&(_0xa1d5a3['reasoning']={}),_0xa1d5a3;}['toggleWebSearch'](){this['setWebSearch'](!this['_isWebSearchEnabled']);}['toggleReasoning'](){this['setReasoning'](!this['_isReasoningEnabled']);}['setWebSearch'](_0x4d2d4c){_0x4d2d4c!==this['_isWebSearchEnabled']&&(this['_isWebSearchEnabled']=_0x4d2d4c,this['fire']('capabilitiesUpdated',this['getCapabilitiesConfig']()));}['setReasoning'](_0x4e684c){_0x4e684c!==this['_isReasoningEnabled']&&(this['_isReasoningEnabled']=_0x4e684c,this['fire']('capabilitiesUpdated',this['getCapabilitiesConfig']()));}}class Ys extends Ms{['userMessage'];['conversationId'];['contextItems']=new Map();['capabilities'];['model'];['attributes'];constructor(_0x4303d6){super(_0x4303d6),this['conversationId']=_0x4303d6['conversationId'],this['contextItems']=_0x4303d6['contextItems'],this['capabilities']=_0x4303d6['capabilities'],this['userMessage']=_0x4303d6['userMessage'],this['model']=_0x4303d6['model'],this['attributes']=_0x4303d6['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(_0x290586){super(),this['options']=_0x290586,this['connector']=_0x290586['connector'],this['chatModels']=_0x290586['chatModels'],this['id']=_0x290586['conversationId'],this['isFromHistory']=_0x290586['isFromHistory'];}async['init'](_0x1d4e00){try{this['chatContext']=new Fs({'connector':this['connector'],'config':_0x1d4e00,'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 _0xf39af3=await this['chatModels']['getAvailableModels']();this['fire']('conversationInitialized',{'availableModels':_0xf39af3});const _0x3fb8f8=await this['chatModels']['getModel'](this['options']['selectedModelId']);_0x3fb8f8&&await this['setModel'](_0x3fb8f8);}catch(_0x791492){const _0x231a29=new ht('ai-chat-conversation-init-failed',null,{'message':_0x791492['message']||_0x791492});_0x231a29['stack']=_0x791492['stack'],this['fire']('error',{'error':_0x231a29});}}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:_0x504a6b}=await this['connector']['startConversation'](this['id'],this['options']['group'])['getConversation']();this['id']=_0x504a6b,this['isStarted']=!0x0,this['fire']('conversationStarted',{'conversationId':this['id'],'selectedModel':this['selectedModel']});}catch(_0x54e78d){const _0x1279fc=new ht('ai-chat-conversation-start-failed',null,{'message':_0x54e78d['message'],'conversationId':this['id']});throw _0x1279fc['stack']=_0x54e78d['stack'],this['fire']('error',{'error':_0x1279fc}),_0x1279fc;}}async['load'](_0x2c783d,_0x9008a0){try{const _0x5789a0=await this['connector']['fetchConversation'](_0x2c783d)['getConversation'](),_0x54f74b=await this['connector']['fetchConversationMessages'](_0x2c783d)['getMessages'](),_0x2e423e=_0x54f74b[0x0]['model'];this['isStarted']=!0x0,this['id']=_0x5789a0['id'],'title'in _0x5789a0?this['fire']('setConversationTitle',_0x5789a0['title'],!0x0):this['fire']('setConversationTitle','',!0x0);const _0xe2328b=(await this['chatModels']['getAll']())['find'](_0x387676=>_0x387676['id']['toLowerCase']()===_0x2e423e['toLowerCase']());return this['selectedModel']=_0xe2328b,this['fire']('modelSelected',{'selectedModel':_0xe2328b,'isDisabled':!0x0}),await this['_processMessagesToInteractions'](_0x54f74b,_0x9008a0,_0x2e423e),this['currentInteraction']=void 0x0,this;}catch(_0xf9305a){const _0x141d8c=new ht('ai-chat-conversation-init-from-id-failed',null,{'message':_0xf9305a['message'],'conversationId':_0x2c783d});throw _0x141d8c['stack']=_0xf9305a['stack'],this['fire']('error',{'error':_0x141d8c}),_0x141d8c;}}async['_processMessagesToInteractions'](_0x1a5a8a,_0x1825b1,_0x4d280f){let _0x498bb1;for(const _0x44bc96 of _0x1a5a8a)if('user'===_0x44bc96['role']){const _0x14d94b=await this['_extractContextItems'](_0x44bc96),_0x2869db={'isReasoningEnabled':Object['hasOwn'](_0x44bc96['capabilities'],'reasoning'),'isWebSearchEnabled':Object['hasOwn'](_0x44bc96['capabilities'],'webSearch')};_0x498bb1=this['createInteraction']({'userMessage':_0x44bc96['prompt'],'contextItems':_0x14d94b,'capabilities':_0x2869db,'modelId':_0x4d280f,'attributes':_0x44bc96['attributes']}),this['currentInteraction']=_0x498bb1,this['chatContext']['addToConversationContext'](this['currentInteraction']['contextItems']);}else{if('assistant'===_0x44bc96['role']&&_0x498bb1){const _0x5a04cc=[];for(const _0x322ab9 of _0x44bc96['content'])switch(_0x322ab9['type']){case'text':case'modification':{const _0x3ba4f0=_0x498bb1['getDocumentContext']()?.['sessionId']!==_0x1825b1;_0x498bb1['currentReply']=_0x498bb1['createReply']({'type':_0x322ab9['type'],'isDone':!0x0,'interactionId':_0x498bb1['id'],'areActionsDisabled':_0x3ba4f0}),_0x498bb1['currentReply']['appendContent'](_0x322ab9['content']),_0x5a04cc['length']>0x0&&(_0x498bb1['currentReply']['sources']=_0x5a04cc['splice'](0x0));break;}case'url':_0x5a04cc['push'](_0x322ab9);break;case'mcp-tool-result':{const {data:_0x4359f6,attributes:_0xb7923f}=JSON['parse'](_0x322ab9['content']);_0x498bb1['_handleToolResultData']({'toolName':_0x322ab9['toolName'],'data':_0x4359f6,'attributes':_0xb7923f});break;}}}}}async['_extractContextItems'](_0x3d4cd6){const _0x3d5489=new Map();if(!_0x3d4cd6['content'])return _0x3d5489;for(const _0x9a81ac of _0x3d4cd6['content']){const _0x15d1e4=await this['chatContext']['populateFromMessage'](_0x9a81ac);_0x15d1e4&&_0x3d5489['set'](_0x15d1e4['id'],_0x15d1e4);}return _0x3d5489;}async['handleUserInteraction']({userMessage:_0x4721c5,attributes:_0x13381c}){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 _0x367bfb=this['chatContext']['getPendingContextItems'](),_0x4ec3ae=this['chatCapabilities']['getCapabilitiesConfig'](),_0x223daf=this['selectedModel']['id'];this['currentInteraction']=this['createInteraction']({'userMessage':_0x4721c5,'contextItems':_0x367bfb,'capabilities':_0x4ec3ae,'modelId':_0x223daf,'attributes':_0x13381c}),await this['currentInteraction']['start'](),this['chatContext']['addToConversationContext'](this['currentInteraction']['contextItems']);}catch(_0xb3dceb){if(_0xb3dceb instanceof ht)this['fire']('error',{'interactionId':this['currentInteraction']?this['currentInteraction']['id']:void 0x0,'error':_0xb3dceb});else{const _0x44cf6e=Bs['get'](_0xb3dceb['code'])||'ai-chat-handle-user-interaction-start-failed';this['fire']('error',{'interactionId':this['currentInteraction']?this['currentInteraction']['id']:void 0x0,'error':new ht(_0x44cf6e,null,{'error':_0xb3dceb})});}}finally{this['currentInteraction']?.['stop'](),this['currentInteraction']=void 0x0;}}['createInteraction']({userMessage:_0xe91ff3,contextItems:_0x4dff12,capabilities:_0x3f7ccd,modelId:_0x39c0b1,attributes:_0x1ef4f5}){const _0x1e9573=new Ys({'userMessage':_0xe91ff3,'contextItems':_0x4dff12,'capabilities':_0x3f7ccd,'conversationId':this['id'],'connector':this['connector'],'editor':this['options']['getEditor']&&this['options']['getEditor'](),'model':_0x39c0b1,'attributes':_0x1ef4f5});return _0x1e9573['delegate'](...Hs)['to'](this),this['interactions']['push'](_0x1e9573),this['fire']('interactionCreated',_0x1e9573),_0x1e9573;}['getInteraction'](_0x569601){return this['interactions']['find'](_0x27afa5=>_0x27afa5['id']===_0x569601);}['removeInteraction'](_0x2a2931){const _0x39f107=this['getInteraction'](_0x2a2931);_0x39f107&&(_0x39f107['destroy'](),this['interactions']['splice'](this['interactions']['indexOf'](_0x39f107),0x1));}get['lastInteraction'](){return this['interactions'][this['interactions']['length']-0x1];}['addCurrentDocumentToContext'](_0x2f9dbf){this['chatContext']['addCurrentDocumentToContext'](_0x2f9dbf);}async['updateCurrentDocumentInContext']({content:_0x2dbf36,version:_0x393361,sessionId:_0x5ea467,selections:_0x23cb7f}){await this['chatContext']['updateCurrentDocument'](_0x2dbf36,_0x393361,_0x5ea467,_0x23cb7f);}['getCurrentDocumentContext'](){return this['currentInteraction']?.['getDocumentContext']()?.['content']||'';}['addSelectionToContext'](_0x40ec4b){this['chatContext']['addSelectionToContext'](_0x40ec4b);}['removeSelectionFromContext'](){this['chatContext']['removeSelectionFromContext']();}['addFilesToContext'](_0x540155){this['chatContext']['addFilesToContext'](_0x540155);}['addUrlToContext'](_0x5a96c1){this['chatContext']['addUrlToContext'](_0x5a96c1);}['addToolItemToContext'](_0x2649d0){this['chatContext']['addToolItemToContext'](_0x2649d0);}['addResourceToContext'](_0x5bf800,_0x22b948){this['chatContext']['addResourceToContext'](_0x5bf800,_0x22b948);}['loadSourceResources'](_0x30bb2e,_0x84e913,_0x1542b0){return this['chatContext']['loadSourceResources'](_0x30bb2e,_0x84e913,_0x1542b0);}['removeFromContext'](_0x1b3f36){this['chatContext']['removeFromContext'](_0x1b3f36);}['setWebSearch'](_0x4ece7b){this['chatCapabilities']['setWebSearch'](_0x4ece7b);}['toggleWebSearch'](){this['chatCapabilities']['toggleWebSearch']();}['setReasoning'](_0xe7b0df){this['chatCapabilities']['setReasoning'](_0xe7b0df);}['toggleReasoning'](){this['chatCapabilities']['toggleReasoning']();}['isCurrentDocumentInContext'](){return this['chatContext']['isCurrentDocumentInContext']();}['isCurrentDocumentInConversation'](){return this['chatContext']['isCurrentDocumentInConversation']();}['isSelectionInContext'](){return this['chatContext']['isSelectionInContext']();}async['setModel'](_0x5bf15c){_0x5bf15c?!0x1===await this['chatModels']['isAvailable'](_0x5bf15c)&&(Tt('ai-chat-conversation-set-model-not-available',{'conversation':this,'model':_0x5bf15c}),_0x5bf15c=(await this['chatModels']['getAvailableModels']())[0x0]):(Tt('ai-chat-conversation-set-model-null',{'conversation':this}),_0x5bf15c=(await this['chatModels']['getAvailableModels']())[0x0]),_0x5bf15c['id']!==this['selectedModel']?.['id']&&(this['selectedModel']=_0x5bf15c,this['chatCapabilities']['reset'](),this['fire']('modelSelected',{'selectedModel':_0x5bf15c}));}}class qs extends pt(){['_connector'];['_config'];['_locale'];['_modelList']=[];['_modelsRequest']=null;constructor({connector:_0x1e4898,config:_0x2866c1,locale:_0x2dd1a4}){super(),this['_connector']=_0x1e4898,this['_config']=_0x2866c1,this['_locale']=_0x2dd1a4;}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 _0x19a4a1=await this['getAll']();let _0x5b378e;return _0x5b378e=this['_availableModels']?this['_filterModels'](_0x19a4a1,this['_availableModels']):_0x19a4a1['filter'](_0x39e9c3=>_0x39e9c3['recommended']),_0x5b378e;}async['getModel'](_0x35deca){const _0x3b81c9=await this['getAll']();if(!_0x3b81c9['length'])return null;if(_0x35deca){const _0x4ddd99=this['_getModelById'](_0x3b81c9,_0x35deca);if(_0x4ddd99)return _0x4ddd99;Tt('ai-chat-model-id-unrecognized',{'modelId':_0x35deca,'fallBackModelId':this['_defaultModelId']});}return this['getDefault']();}async['getDefault'](){const _0x2821e5=await this['getAvailableModels']();if(!_0x2821e5['length'])return null;if(this['_defaultModelId']){const _0x5a285f=this['_getModelById'](_0x2821e5,this['_defaultModelId']);if(_0x5a285f)return _0x5a285f;Tt('ai-chat-default-model-id-unrecognized',{'defaultModelId':this['_defaultModelId'],'fallBackModelId':_0x2821e5[0x0]['id']});}return _0x2821e5[0x0];}async['isAvailable'](_0xf8f386){return(await this['getAvailableModels']())['some'](_0x4ddff3=>_0x4ddff3['name']===_0xf8f386['name']&&_0x4ddff3['provider']===_0xf8f386['provider']);}async['_retrieveModels'](){if(!this['_modelList']['length'])try{const _0x105d15=this['_locale']['uiLanguage']||'en',_0x54d16d=this['_connector']['getModels'](_0x105d15),_0x50b06d=await _0x54d16d['list']();this['_modelList']=_0x50b06d['items']['map'](_0x12d305=>Qs(_0x12d305)?{..._0x12d305,'name':us(this['_locale'],'AI_MODEL_NAME_AUTO')}:_0x12d305);}catch(_0x1e4ee6){throw mt('ai-models-unable-to-retrieve',{'error':_0x1e4ee6}),_0x1e4ee6;}return[...this['_modelList']];}['_filterModels'](_0x33e7df,_0xfe1203){let _0x367d10;if(_0xfe1203){_0x367d10=[];const _0x28307d=new Set(),_0x472232='string'==typeof _0xfe1203?[_0xfe1203['toLocaleLowerCase']()]:_0xfe1203['map'](_0x36145=>_0x36145['toLocaleLowerCase']());for(const _0x45bdc1 of _0x472232)for(const _0x376360 of _0x33e7df)!_0x28307d['has'](_0x376360['id'])&&this['_isMatchingFilter'](_0x376360,_0x45bdc1)&&(_0x367d10['push'](_0x376360),_0x28307d['add'](_0x376360['id']));}else _0x367d10=_0x33e7df;return _0x367d10;}['_isMatchingFilter'](_0x2976a0,_0x389eeb){const _0x5dc45f=_0x2976a0['id']['toLocaleLowerCase'](),_0x191475=_0x2976a0['name']['toLocaleLowerCase'](),_0x1621a5=_0x2976a0['provider']['toLocaleLowerCase']();return _0x5dc45f===_0x389eeb||_0x191475===_0x389eeb||Qs(_0x2976a0)&&'auto'===_0x389eeb||_0x1621a5===_0x389eeb||_0x5dc45f['startsWith'](_0x389eeb);}['_getModelById'](_0x2b7834,_0x4f230b){return _0x2b7834['find'](_0x4480b2=>Qs(_0x4480b2)&&'auto'===_0x4f230b?_0x4480b2:_0x4480b2['id']===_0x4f230b)||null;}}function Qs(_0x3165b5){return _0x3165b5['id']['startsWith']('agent');}function Xs(_0x2d234f){if(_0x2d234f instanceof _0x4433f2)return _0x2d234f;if(_0x2d234f?.['editors']&&_0x2d234f['editors']['get'](0x0))return _0x2d234f['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.'),_0x2d234f['editors']['get'](0x0);throw new ht('ai-get-editor-from-context-no-editor');}function zs({editor:_0xb1ea67,interaction:_0x2e763e,reply:_0x2c23f0,groups:_0x2bdb92,transform:_0x1c6bf3,documentCompare:_0x41a18b,documentCompareOptions:_0x27e44f}){const _0x314541=_0x2e763e['getDocumentContext']();if(!_0x314541)return[];const _0x39d23e=_0x314541['content'],_0xc2af10=_0x314541['version'],_0x1d3a90=_0x2c23f0['documentContextContent']['cloneNode'](!0x0);for(const {changes:_0x16965c}of _0x2bdb92){const _0x34e0eb=_0x16965c['filter'](_0x216886=>'new'!=_0x216886['type'])['map'](_0x285709=>ps('data-id',_0x285709['id'],_0x1d3a90)),_0x1fc177=_0x16965c['filter'](_0x43126b=>'removed'!=_0x43126b['type'])['map'](_0x442ed7=>_0x442ed7['node']['cloneNode'](!0x0));let _0x3d988a=null;if(_0x34e0eb['length']){_0x3d988a=_0x34e0eb[0x0]['previousSibling'];for(let _0x2288ff=0x0;_0x2288ff<_0x34e0eb['length'];_0x2288ff++)_0x2abe84(_0x34e0eb[_0x2288ff]);}if(_0x1fc177['length']){_0x3d988a||(_0x16965c[0x0]['anchorId']?_0x3d988a=ps('data-id',_0x16965c[0x0]['anchorId'],_0x1d3a90):(_0x3d988a=_0x1fc177['shift'](),_0x4d95ac(_0x1d3a90,_0x3d988a)));for(let _0x2c50bd=0x0;_0x2c50bd<_0x1fc177['length'];_0x2c50bd++)_0x58fef7(_0x3d988a,_0x1fc177[_0x2c50bd]),_0x3d988a=_0x1fc177[_0x2c50bd];}}const _0x5d1a49=Es(_0x1d3a90),_0xcda6f4=_0x41a18b['getDiff'](_0x39d23e,_0x5d1a49,_0x27e44f)['getOperations']();if(_0x1c6bf3){const _0x2bcff9=_0xb1ea67['model']['document']['history']['getOperations'](_0xc2af10),_0x533c74={'document':_0xb1ea67['model']['document'],'useRelations':!0x1,'padWithNoOps':!0x1};return _0x1225df(_0xcda6f4,_0x2bcff9,_0x533c74)['operationsA'];}return _0xcda6f4;}function js(_0x5511c3,_0x3e8fed){if('marker'!=_0x3e8fed['type'])return;const _0x11d2e8=_0x5511c3['model']['markers']['get'](_0x3e8fed['name']);_0x11d2e8&&(_0x3e8fed['oldRange']=_0x11d2e8['getRange']());}class Js extends _0x20e290{['activeConversation'];['_aiEditing'];['_aiConnector'];['_aiChatUi'];['_aiChatModels'];['_aiChatBalloon'];['_batchToChanges']=new Map();['_currentPreviewedChangeGroup']=null;['_bodyCollection'];static get['requires'](){return[ls,_0x46bc33];}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 _0xebe863=this['context']['plugins']['get']('AITabs');this['listenTo'](this['_aiChatUi'],'startConversation',()=>{this['_startConversationSafely']();}),this['listenTo'](this['_aiChatUi'],'sendUserMessage',(_0x407973,_0x28d34b)=>{this['_handleUIUserMessage']({'message':_0x28d34b});}),this['listenTo'](_0xebe863,'resizedTabs',(_0x7b680b,_0x22b38c)=>{this['_setIsMaximized'](_0x22b38c);}),this['listenTo'](this['_aiChatUi'],'resizeTabs',()=>{_0xebe863['resize']();}),this['listenTo'](_0xebe863['view'],'change:activeTab',(_0x322344,_0x5e369f,_0x47cf2b)=>{'chat'!==_0x47cf2b&&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',(_0x8aae0f,_0x35bdb5)=>{this['activeConversation']?.['addFilesToContext'](Array['from'](_0x35bdb5));}),this['listenTo'](this['_aiChatUi'],'addUrlToContext',(_0x1133a2,_0x9b9ba7)=>{this['activeConversation']?.['addUrlToContext'](_0x9b9ba7);}),this['listenTo'](this['_aiChatUi'],'executeCustomItemCallback',(_0x47c80e,_0x4e6ba9)=>{_0x4e6ba9['callback'](this['context']);}),this['listenTo'](this['_aiChatUi'],'addResourceToContext',(_0x4ca740,_0x173daf)=>{this['activeConversation']?.['addResourceToContext'](_0x173daf['source'],_0x173daf['resource']);}),this['listenTo'](this['_aiChatUi'],'removeContextItem',(_0x31dd41,_0x5bbbcf)=>{this['_removeFromContext'](_0x5bbbcf);}),this['listenTo'](this['_aiChatUi'],'loadSourceResources',(_0x1c3250,_0x16d2ff)=>{this['activeConversation']?.['loadSourceResources'](_0x16d2ff['sourceId'],_0x16d2ff['query'],_0x16d2ff['uid']);}),this['listenTo'](this['_aiChatUi'],'toggleWebSearch',()=>{this['_toggleWebSearch']();}),this['listenTo'](this['_aiChatUi'],'toggleReasoning',()=>{this['_toggleReasoning']();}),this['listenTo'](this['_aiChatUi'],'selectModel',(_0x12a3c5,_0x1cc807)=>{this['activeConversation']?.['setModel'](_0x1cc807);}),this['listenTo'](this['_aiChatUi'],'like',(_0x2e01ee,{replyId:_0x4e6bff})=>{console['log']('Liked\x20response',_0x4e6bff);}),this['listenTo'](this['_aiChatUi'],'dislike',(_0x5bb43b,{replyId:_0x1530f7})=>{console['log']('Disliked\x20response',_0x1530f7);}),this['listenTo'](this['_aiChatUi'],'insertSuggestion',(_0x420bc9,_0xf0cf20)=>{this['_insertSuggestion'](_0xf0cf20);}),this['listenTo'](this['_aiChatUi'],'showChangeInText',(_0x5311d3,{replyId:_0x4bbe87,partIndex:_0x12515f})=>{this['_aiChatBalloonShowDiff']=this['_aiChatUi']['showDiff'],this['_openBalloonFor'](_0x4bbe87,_0x12515f);}),this['listenTo'](this['_aiChatUi'],'mouseOverSuggestion',(_0x30f7d3,{replyId:_0x38a816,partIndex:_0x4cf0c7})=>{const _0x5de81a=this['_getDocumentRangeForReplyChanges'](_0x38a816,_0x4cf0c7);_0x5de81a&&'$graveyard'!=_0x5de81a['range']['root']['rootName']&&this['_aiEditing']['showFakeVisualSelection']({'ranges':[_0x5de81a['range']],'id':'change-area','priority':0xa});}),this['listenTo'](this['_aiChatUi'],'mouseLeaveSuggestion',()=>{this['_aiEditing']['hideFakeVisualSelection']('change-area');}),this['listenTo'](this['_aiChatUi'],'applySuggestion',(_0x21cd79,_0x327e38)=>{this['_aiEditing']['hideFakeVisualSelection']('change-area'),this['_applySuggestion'](_0x327e38);}),this['listenTo'](this['_aiChatUi'],'toggleSuggestionDisplayMode',async(_0x22b328,{replyId:_0xb9f27a,showDiff:_0x1b8378})=>{const {reply:_0x44be80}=this['getInteractionAndReplyById'](_0xb9f27a),_0x5edae9=_0x44be80['getContentParts']({'showDiff':_0x1b8378});await this['_aiChatUi']['updateFeedItemAIReplySuggestionContent']({'id':_0x44be80['id'],'parts':_0x5edae9,'renderingStrategy':'static'});}),this['listenTo'](this['_aiChatUi'],'rejectSuggestion',(_0x102b34,{replyId:_0x5d6f6a,partIndex:_0x2ad2d4})=>{this['_rejectSuggestion']({'replyId':_0x5d6f6a,'partIndex':_0x2ad2d4}),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:_0x1e8dbe,partIndex:_0xb7c0ed}=this['_currentPreviewedChangeGroup'];this['_aiChatBalloonShowDiff']=!this['_aiChatBalloonShowDiff'];const {reply:_0x6d548c}=this['getInteractionAndReplyById'](_0x1e8dbe),_0x1d7eb2=_0x6d548c['getContentParts']({'showDiff':this['_aiChatBalloonShowDiff'],'groupIndex':_0xb7c0ed});this['_aiChatBalloon']['updateContent']({'part':_0x1d7eb2[0x0],'renderingStrategy':'static','keepErrors':!0x0});}),this['listenTo'](this['_aiChatBalloon'],'applySuggestion',()=>{const {replyId:_0x1c38c5,partIndex:_0x42c226}=this['_currentPreviewedChangeGroup'];this['_applySuggestion']({'replyId':_0x1c38c5,'partIndex':_0x42c226}),this['_aiChatBalloon']['setState']('accepted');}),this['listenTo'](this['_aiChatBalloon'],'insertSuggestion',()=>{const {replyId:_0x4abe62,partIndex:_0x131ad3}=this['_currentPreviewedChangeGroup'];this['_insertSuggestion']({'replyId':_0x4abe62,'partIndex':_0x131ad3}),this['_aiChatBalloon']['setState']('accepted');}),this['listenTo'](this['_aiChatBalloon'],'rejectSuggestion',()=>{const {replyId:_0x362296,partIndex:_0x3c8788}=this['_currentPreviewedChangeGroup'];this['_rejectSuggestion']({'replyId':_0x362296,'partIndex':_0x3c8788}),this['_aiChatBalloon']['setState']('rejected');}),this['listenTo'](this['_aiChatBalloon'],'showNext',()=>{const {replyId:_0x52962f,partIndex:_0x255aa3}=this['_currentPreviewedChangeGroup'],_0x1e3aa5=this['_getPresentableSiblingContentPartIndex'](_0x52962f,_0x255aa3,'next');null!==_0x1e3aa5&&this['_openBalloonFor'](_0x52962f,_0x1e3aa5);}),this['listenTo'](this['_aiChatBalloon'],'showPrevious',()=>{const {replyId:_0xf3f2e3,partIndex:_0xd889b2}=this['_currentPreviewedChangeGroup'],_0x6c2ae2=this['_getPresentableSiblingContentPartIndex'](_0xf3f2e3,_0xd889b2,'previous');null!==_0x6c2ae2&&this['_openBalloonFor'](_0xf3f2e3,_0x6c2ae2);}),this['listenTo'](this['_aiChatBalloon'],'dialogClosed',(_0x5c3cde,{id:_0x5017fa})=>{if('aiChatBalloon'!==_0x5017fa)return;const {replyId:_0x1f37e7,partIndex:_0x3cf66a}=this['_currentPreviewedChangeGroup'];this['_currentPreviewedChangeGroup']=null,this['_aiChatUi']['setFeedItemAIReplySuggestionPartActive']({'id':_0x1f37e7,'index':_0x3cf66a,'isActive':!0x1});}));}async['afterInit'](){this['context']instanceof _0x4433f2?this['_integrateEditor'](this['context']):this['listenTo'](this['context']['editors'],'add',(_0x34a232,_0x15ba23)=>{_0x15ba23['on']('ready',()=>{this['_integrateEditor'](_0x15ba23);});});const _0x43efb7=this['context']['config']['get']('ai.chat.initialConversation');let _0x5ac0c3=_0x43efb7;if('lastCreated'!=_0x43efb7||(_0x5ac0c3=await this['_getLastCreatedConversationId'](),_0x5ac0c3))return'new'==_0x5ac0c3?this['_startConversationSafely']():this['loadConversation'](_0x5ac0c3);}async['destroy'](){return await this['_stopLastInteraction'](),this['_bodyCollection']['detachFromDom'](),super['destroy']();}async['loadConversation'](_0x47baef){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'](_0x47baef)['getConversation'](),await this['_startConversationSafely'](_0x47baef),this['_updateConversationTitle']('\x20'),await this['activeConversation']['load'](_0x47baef,this['_aiEditing']['sessionId']),this['activeConversation']['isCurrentDocumentInConversation']()&&this['addCurrentDocumentToChatContext']();}catch(_0x18dcc2){this['_aiChatUi']['addFeedItemError']({'errorMessage':us(this['context']['locale'],'AI_CHAT_UNABLE_TO_LOAD_CONVERSATION'),'id':_0x47baef}),this['_logError'](new ht('ai-chat-conversation-not-found',this,{'error':_0x18dcc2}));}finally{this['_aiChatUi']['startAutoScroll'](),this['_aiChatUi']['setFeedItemRenderingStrategy']('streaming'),this['_aiChatUi']['toggleLoadingSkeleton'](!0x1);}}['registerToolDataCallback'](_0x1d8c5b){let _0x4aed96=null,_0x16ae63=null;this['on']('toolDataReceived',(_0x1b8d11,_0x4e0d06,_0x3f4de7)=>{_0x3f4de7['id']!==_0x4aed96&&(_0x4aed96=_0x3f4de7['id'],_0x16ae63=this['_getAIChatFeedAPI'](_0x3f4de7)),_0x1d8c5b(_0x4e0d06,_0x16ae63);});}['addCurrentDocumentToChatContext'](){this['activeConversation']?.['addCurrentDocumentToContext'](us(this['context']['locale'],'AI_CHAT_CONTEXT_CURRENT_DOCUMENT'));}async['addSelectionToChatContext'](){const _0xe6c88d=this['_aiEditing']['getSelectionText']();this['activeConversation']?.['addSelectionToContext'](_0xe6c88d),this['addCurrentDocumentToChatContext']();}['removeSelectionFromChatContext'](){this['activeConversation']?.['removeSelectionFromContext']();}['focusPromptInput'](){this['_aiChatUi']['focusPromptInput']();}async['startConversation'](){await this['_startConversationSafely']();}async['sendMessage'](_0x5d8b96){await this['_handleUIUserMessage'](_0x5d8b96);}['getGroupId'](){const _0x1156aa=this['context']['config']['get']('collaboration.channelId');if(!_0x1156aa)throw new ht('ai-chat-missing-channel-id',this);return _0x1156aa;}['_handleRemovedConversation'](_0x5e10f0){this['activeConversation']['id']===_0x5e10f0&&this['_startConversationSafely']();}['_insertSuggestion'](_0x47563e){const _0xa971f6=Xs(this['context']);if(!_0xa971f6['plugins']['has']('TrackChanges'))throw new ht('ai-no-track-changes',null);const _0x568f57=this['context']['plugins']['get']('DocumentCompare'),{reply:_0x1f2440,interaction:_0x296f40}=this['getInteractionAndReplyById'](_0x47563e['replyId']),_0x3832ed=this['_getDocumentRangeForReplyChanges'](_0x47563e['replyId'],_0x47563e['partIndex']),_0x2b451b=void 0x0!==_0x47563e['partIndex']?[_0x1f2440['changeGroups'][_0x47563e['partIndex']]]:_0x1f2440['changeGroups']['filter'](_0x298682=>'pending'==_0x298682['state']),_0x1c792c=_0x2b451b['map'](_0x3fd3db=>_0x1f2440['changeGroups']['indexOf'](_0x3fd3db));if(!_0x3832ed||'$graveyard'==_0x3832ed['range']['root']['rootName'])return void _0x1c792c['forEach'](_0x2785f2=>_0x1f2440['setChangeGroupState'](_0x2785f2,'outdated'));_0x1c792c['forEach'](_0x2572c5=>_0x1f2440['setChangeGroupState'](_0x2572c5,'accepted'));const _0x317ba9=zs({'editor':_0xa971f6,'reply':_0x1f2440,'interaction':_0x296f40,'groups':_0x2b451b,'transform':!0x0,'documentCompare':_0x568f57,'documentCompareOptions':{'anchor':'main','markDeletions':!0x0}});let _0x2ba085;_0x3832ed&&this['_scrollToSuggestionRange'](_0x3832ed['range']),_0xa971f6['model']['change'](_0x4a5270=>{_0x2ba085=_0x4a5270['batch'],_0xa971f6['plugins']['get']('TrackChangesEditing')['_applyOperationsAsSuggestions'](_0x317ba9),this['_aiEditing']['hideFakeVisualSelection']('change-area');}),this['_batchToChanges']['set'](_0x2ba085,{'interactionId':_0x296f40['id'],'replyId':_0x1f2440['id'],'indexes':_0x1c792c['slice']()}),this['_updateRatings'](_0x1f2440);}['_applySuggestion'](_0xf725dd){const _0x5cf07f=Xs(this['context']),_0x272ca8=this['context']['plugins']['get'](_0x46bc33),{reply:_0x4ff02d,interaction:_0x48e7e8}=this['getInteractionAndReplyById'](_0xf725dd['replyId']),_0x45e1c1=this['_getDocumentRangeForReplyChanges'](_0xf725dd['replyId'],_0xf725dd['partIndex']),_0x33e7a7=void 0x0!==_0xf725dd['partIndex']?[_0x4ff02d['changeGroups'][_0xf725dd['partIndex']]]:_0x4ff02d['changeGroups']['filter'](_0x3977c3=>'pending'==_0x3977c3['state']),_0x45798d=_0x33e7a7['map'](_0xe9d7f=>_0x4ff02d['changeGroups']['indexOf'](_0xe9d7f));if(!_0x45e1c1||'$graveyard'==_0x45e1c1['range']['root']['rootName'])return void _0x45798d['forEach'](_0x14dfc9=>_0x4ff02d['setChangeGroupState'](_0x14dfc9,'outdated'));_0x45798d['forEach'](_0x135369=>_0x4ff02d['setChangeGroupState'](_0x135369,'accepted'));const _0x3923ab=zs({'editor':_0x5cf07f,'reply':_0x4ff02d,'interaction':_0x48e7e8,'groups':_0x33e7a7,'transform':!0x0,'documentCompare':_0x272ca8,'documentCompareOptions':{'anchor':'main','markDeletions':!0x1}});let _0x16e777;_0x45e1c1&&this['_scrollToSuggestionRange'](_0x45e1c1['range']),_0x5cf07f['model']['change'](_0x2c0fa0=>{_0x16e777=_0x2c0fa0['batch'];for(const _0x28aed2 of _0x3923ab)_0x28aed2['baseVersion']=_0x5cf07f['model']['document']['version'],js(_0x5cf07f,_0x28aed2),_0x2c0fa0['batch']['addOperation'](_0x28aed2),_0x5cf07f['model']['applyOperation'](_0x28aed2);}),this['_batchToChanges']['set'](_0x16e777,{'interactionId':_0x48e7e8['id'],'replyId':_0x4ff02d['id'],'indexes':_0x45798d['slice']()}),this['_updateRatings'](_0x4ff02d);}['_rejectSuggestion'](_0x3a6217){const {reply:_0x4d647e}=this['getInteractionAndReplyById'](_0x3a6217['replyId']);_0x4d647e['setChangeGroupState'](_0x3a6217['partIndex'],'rejected');}['_openBalloonFor'](_0x3c18b0,_0x39ed17){if(!this['_aiChatBalloon'])return;const {reply:_0x9c7777}=this['getInteractionAndReplyById'](_0x3c18b0),_0x37b0fe=_0x9c7777['getContentParts']({'showDiff':this['_aiChatBalloonShowDiff']});let _0x1d1a74,_0x5b9731;if(void 0x0!==_0x39ed17?(_0x5b9731=_0x37b0fe['find'](_0x155211=>_0x155211['index']==_0x39ed17),_0x1d1a74=_0x5b9731?.['index']):(_0x5b9731=_0x37b0fe[0x0],_0x1d1a74=_0x5b9731['index']),this['_currentPreviewedChangeGroup']?.['replyId']==_0x3c18b0&&this['_currentPreviewedChangeGroup']?.['partIndex']==_0x1d1a74)return;const _0x517425=this['_getUserPresentableContentPartDocumentRange'](_0x3c18b0,_0x9c7777,_0x5b9731);if(!_0x517425)return void this['_aiChatBalloon']['close']();this['_currentPreviewedChangeGroup']={'replyId':_0x3c18b0,'partIndex':_0x1d1a74},this['_scrollToSuggestionRange'](_0x517425,!0x0);const _0x449b9f=this['_getPresentableSiblingContentPartIndex'](_0x3c18b0,_0x1d1a74,'next');this['_aiChatBalloon']['updateContent']({'part':_0x5b9731,'renderingStrategy':'static'}),this['_aiChatBalloon']['open']({'index':_0x1d1a74,'title':us(this['context']['locale'],'AI_BALLOON_HEADER_TITLE',(_0x1d1a74+0x1)['toString']()),'showRotator':null!==_0x449b9f,'ranges':[_0x517425],'areActionsDisabled':_0x9c7777['areActionsDisabled']}),this['_aiChatBalloon']['setState']('pending'),this['_aiChatUi']['scrollFeedToSuggestion'](_0x3c18b0,_0x1d1a74),this['_aiChatUi']['setFeedItemAIReplySuggestionPartActive']({'id':_0x3c18b0,'index':_0x1d1a74,'isActive':!0x0});}['_getPresentableSiblingContentPartIndex'](_0x356193,_0x25c926,_0x2a763e){const {reply:_0x293ee5}=this['getInteractionAndReplyById'](_0x356193),_0x24a4c5=_0x293ee5['getContentParts']({'showDiff':this['_aiChatBalloonShowDiff']});if(0x1==_0x24a4c5['length'])return null;const _0x1862ef=_0x24a4c5['findIndex'](_0xca2d73=>_0xca2d73['index']==_0x25c926),_0x141a96='next'==_0x2a763e?0x1:-0x1;let _0x1b4dfa=_0x24a4c5['at']((_0x1862ef+_0x141a96)%_0x24a4c5['length'])['index'],_0x1415c0=_0x24a4c5[_0x1b4dfa];for(;!this['_getUserPresentableContentPartDocumentRange'](_0x356193,_0x293ee5,_0x1415c0);){if(_0x1b4dfa=_0x24a4c5['at']((_0x1b4dfa+_0x141a96)%_0x24a4c5['length'])['index'],_0x1b4dfa===_0x1862ef)return null;_0x1415c0=_0x24a4c5[_0x1b4dfa];}return _0x1b4dfa;}['_getUserPresentableContentPartDocumentRange'](_0x119976,_0x10d698,_0x3685aa){const _0x399d47=_0x10d698['changeGroups'];if(!_0x3685aa['hasChanges'])return null;const _0x36a927=_0x399d47['find'](_0x56e8bc=>_0x56e8bc['index']==_0x3685aa['index']);if('pending'!==_0x36a927?.['state'])return null;const _0x40c3bb=this['_getDocumentRangeForReplyChanges'](_0x119976,_0x3685aa['index']);if(!_0x40c3bb)return null;const {range:_0x5d62a1,currentIndex:_0x10f416}=_0x40c3bb;return'$graveyard'==_0x5d62a1['root']['rootName']?(_0x10d698['setChangeGroupState'](_0x10f416,'outdated'),null):_0x40c3bb['range'];}['_getDocumentRangeForReplyChanges'](_0xa00878,_0x44c0e9){const _0x23f835=Xs(this['context']),{reply:_0x228570,interaction:_0x3126e7}=this['getInteractionAndReplyById'](_0xa00878),_0x23e8e9=_0x228570['changeGroups']['filter'](_0x385a0e=>'pending'==_0x385a0e['state']),_0x4a764a=_0x23e8e9['map'](_0x149fe0=>_0x228570['changeGroups']['indexOf'](_0x149fe0));void 0x0===_0x44c0e9&&(_0x44c0e9=_0x4a764a[0x0]);const _0x28c192=_0x4a764a['indexOf'](_0x44c0e9);if(-0x1==_0x28c192)return null;const _0x581f10=_0x23e8e9[_0x28c192],_0x434195=new _0x5326ca([]),_0x4ff092=new _0x5326ca([]);for(const _0x235f89 of _0x581f10['changes'])if('removed'!=_0x235f89['type']&&_0x4ff092['children']['push'](_0x235f89['node']['cloneNode'](!0x0)),'new'!=_0x235f89['type']){const _0x5b4584=_0x5f061e(_0x3d68b6=>ms(_0x3d68b6,'data-id')==_0x235f89['id'],_0x228570['documentContextContent'],!0x0);_0x434195['children']['push'](_0x5b4584['cloneNode'](!0x0));}if(0x0==_0x434195['children']['length']){if(_0x581f10['changes'][0x0]['anchorId']){const _0x2af3af=ps('data-id',_0x581f10['changes'][0x0]['anchorId'],_0x228570['documentContextContent']);_0x434195['children']['unshift'](_0x2af3af['cloneNode'](!0x0)),_0x4ff092['children']['unshift'](_0x2af3af['cloneNode'](!0x0)),_0x2af3af['nextSibling']&&(_0x434195['children']['push'](_0x2af3af['nextSibling']['cloneNode'](!0x0)),_0x4ff092['children']['push'](_0x2af3af['nextSibling']['cloneNode'](!0x0)));}else{const _0x2481b9=_0x228570['documentContextContent']['children'][0x0];if(!_0x2481b9)return null;_0x434195['children']['push'](_0x2481b9['cloneNode'](!0x0)),_0x4ff092['children']['push'](_0x2481b9['cloneNode'](!0x0));}}const _0x50f909=_0x3126e7['getDocumentContext'](),_0x2f68df=_0x23f835['data']['parse'](_0x50f909['content']),_0x40f7e0=Es(_0x434195),_0x33c972=_0x23f835['data']['parse'](_0x40f7e0),_0xed6427=_0x23f835['data']['parse'](_0x40f7e0),_0x48922f=_0x23f835['model']['createPositionAt'](_0x33c972,0x0),_0xf1c047=Es(_0x4ff092),_0x4421fe={'anchor':_0x48922f,'markDeletions':!0x1},_0x4107d4=_0x23f835['plugins']['get'](_0x46bc33)['getDiff'](_0x40f7e0,_0xf1c047,_0x4421fe)['getOperations']();if(!_0x4107d4['length'])return null;_0x23f835['model']['change'](_0x3f0c03=>{for(const _0x572461 of _0x4107d4)if('remove'==_0x572461['type']){const _0xd71617=_0x572461['sourcePosition'],_0x8f4ebb=_0x572461['howMany'],_0x2987b8=new _0x3ff0e2(_0xd71617,_0x8f4ebb);_0x3f0c03['batch']['addOperation'](_0x2987b8),_0x23f835['model']['applyOperation'](_0x2987b8);}else'marker'!==_0x572461['type']&&(_0x572461['baseVersion']=null,_0x572461['isDocumentOperation']=!0x1,_0x3f0c03['batch']['addOperation'](_0x572461),_0x23f835['model']['applyOperation'](_0x572461));});const _0x5edea4=ys(_0x23f835,_0x4107d4,_0x33c972);xs(_0x23f835['model'],_0x5edea4);const _0x5e303f=_0x5edea4['getFirstRange']()['start']['path']['slice'](),_0x3624d4=_0x5edea4['getFirstRange']()['end']['path']['slice'](),_0x2db474=[];let _0x48109d=_0x33c972,_0xc36e6d=_0xed6427;for(let _0x42b604=0x0;_0x42b604<_0x3624d4['length'];_0x42b604++){const _0x435cfe=_0x48109d['maxOffset']-_0x3624d4[_0x42b604];_0x2db474[_0x42b604]=_0xc36e6d['maxOffset']-_0x435cfe,_0x48109d=_0x48109d['getChildAtOffset'](_0x3624d4[_0x42b604]),_0xc36e6d=_0xc36e6d['getChildAtOffset'](_0x2db474[_0x42b604]);}const _0x120ef1=_0x23f835['model']['createRange'](_0x23f835['model']['createPositionFromPath'](_0xed6427,_0x5e303f),_0x23f835['model']['createPositionFromPath'](_0xed6427,_0x2db474)),_0x207ac8=_0xed6427['getChild'](0x0)['getAttribute'](_0x57a89f),_0xa8376=Array['from'](_0x2f68df['getChildren']())['find'](_0x3243e4=>_0x3243e4['getAttribute'](_0x57a89f)==_0x207ac8)['getPath'](),_0x1758aa=_0x120ef1['start']['path']['slice'](),_0x378cea=_0x120ef1['end']['path']['slice']();_0x1758aa[0x0]=_0xa8376[0x0]+_0x1758aa[0x0],_0x378cea[0x0]=_0xa8376[0x0]+_0x378cea[0x0];let _0x5630a6=_0x23f835['model']['createRange'](_0x23f835['model']['createPositionFromPath'](_0x23f835['model']['document']['getRoot'](),_0x1758aa),_0x23f835['model']['createPositionFromPath'](_0x23f835['model']['document']['getRoot'](),_0x378cea));const _0x24dc4b=_0x23f835['model']['document']['history']['getOperations'](_0x50f909['version']);for(const _0x47991d of _0x24dc4b)_0x5630a6=_0x1857bd['_createFromRanges'](_0x5630a6['getTransformedByOperation'](_0x47991d));return{'range':_0x5630a6,'currentIndex':_0x44c0e9};}['_integrateEditor'](_0x256b73){if(_0x256b73['plugins']['has']('Undo')){const _0xf2ab71=_0x256b73['commands']['get']('undo'),_0x49b74f=_0x256b73['commands']['get']('redo');this['listenTo'](_0xf2ab71,'revert',(_0x4fa34b,_0x28ddb0,_0x54b264)=>{const _0x4c8a20=this['_batchToChanges']['get'](_0x28ddb0);if(!_0x4c8a20)return;const _0x4125ed=this['activeConversation']['getInteraction'](_0x4c8a20['interactionId'])['getReply'](_0x4c8a20['replyId']);_0x4c8a20['indexes']['forEach'](_0x29e6b6=>_0x4125ed['setChangeGroupState'](_0x29e6b6,'pending')),this['_batchToChanges']['delete'](_0x28ddb0),this['_batchToChanges']['set'](_0x54b264,_0x4c8a20);}),this['listenTo'](_0x49b74f,'revert',(_0x8a3fd0,_0x4b920c,_0x161503)=>{const _0x72a6e3=this['_batchToChanges']['get'](_0x4b920c);if(!_0x72a6e3)return;const _0x5d64ff=this['activeConversation']['getInteraction'](_0x72a6e3['interactionId'])['getReply'](_0x72a6e3['replyId']);_0x72a6e3['indexes']['forEach'](_0x1253ac=>_0x5d64ff['setChangeGroupState'](_0x1253ac,'accepted')),this['_batchToChanges']['delete'](_0x4b920c),this['_batchToChanges']['set'](_0x161503,_0x72a6e3);});}const _0xc10384=_0x256b73['config']['get']('ai.chat.context');_0xc10384['alwaysAddSelection']&&_0xc10384['document']['enabled']&&this['listenTo'](_0x256b73['model']['document']['selection'],'change:range',(_0x1dc48a,_0x563189)=>{if(!_0x563189['directChange'])return;'chat'===_0x256b73['plugins']['get']('AITabs')['view']['activeTab']&&(_0x256b73['model']['hasContent'](_0x256b73['model']['document']['selection'])?this['addSelectionToChatContext']():this['removeSelectionFromChatContext']());});}async['_getLastCreatedConversationId'](){const _0x7d9bab=this['_aiConnector']['fetchConversations'](this['getGroupId'](),{'limit':0x1,'sortBy':'createdAt'});try{const _0x5a36f9=await _0x7d9bab['getConversations']();return _0x5a36f9['length']?_0x5a36f9[0x0]['id']:'new';}catch(_0x9fbba5){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':_0x9fbba5})),this['_aiChatUi']['toggleLoadingSkeleton'](!0x1),this['_aiChatUi']['disableControls'](),null;}}async['_startConversationSafely'](_0x4000b4){try{this['_aiChatUi']['enableControls'](),await this['_handleStartConversation'](_0x4000b4);}catch(_0x37248a){this['_aiChatUi']['addFeedItemError']({'errorMessage':us(this['context']['locale'],'AI_CHAT_UNABLE_TO_START_CONVERSATION'),'id':_0x4000b4||ot()}),console['error'](_0x37248a),this['activeConversation']=void 0x0,this['_aiChatUi']['disableControls']();}}async['_handleStartConversation'](_0x560df2){let _0x1afe5d;this['context']['plugins']['has']('AIChatBalloon')&&this['context']['plugins']['get']('AIChatBalloon')['close'](),_0x560df2||!this['activeConversation']?_0x1afe5d=this['context']['config']['get']('ai.models.defaultModelId'):this['_aiChatUi']['isModelAvailable']&&(_0x1afe5d=this['activeConversation']['selectedModel']['id']),await this['_stopLastInteraction']();const _0x46ab23=this['getGroupId'](),_0x1d15af=_0x560df2||ot();this['activeConversation']=new $s({'connector':this['_aiConnector'],'chatModels':this['_aiChatModels'],'selectedModelId':_0x1afe5d,'conversationId':_0x1d15af,'group':_0x46ab23,'getEditor':()=>Xs(this['context']),'isFromHistory':!!_0x560df2}),this['activeConversation']['delegate']('toolDataReceived','interactionStarted')['to'](this),this['activeConversation']['delegate']('toolDataReceived','interactionCreated','replyCreated')['to'](this),this['on']('interactionCreated',(_0x27b488,_0x90a9fa)=>{this['_aiChatUi']['addFeedItemUserMessage'](_0x90a9fa);}),this['on']('replyCreated',(_0xd92ef3,_0x583130)=>{this['_addFeedItemReply'](_0x583130);}),this['activeConversation']['on']('conversationInitialized',(_0xda05f5,_0x29ab02)=>{this['_aiChatUi']['createConversation'](_0x29ab02),this['_aiChatUi']['resetMessageInput'](),this['_aiChatUi']['clearPendingContextUI'](),this['_aiChatUi']['clearConversationContextUI'](),_0x560df2||(this['_aiChatUi']['resetConversationTitle'](),this['addCurrentDocumentToChatContext']());}),this['activeConversation']['on']('uploadProgressChanged',(_0x49dc5d,_0x4c5503)=>{this['_aiChatUi']['setIsUploadInProgress'](_0x4c5503['isUploadInProgress']);}),this['activeConversation']['on']('webSearchStarted',()=>{const _0x18b96b=this['_aiChatUi']['prepareLoadingMessage']({'isWebSearchEnabled':!0x0,'isReasoningEnabled':!0x1});this['_aiChatUi']['setLoadingMessage'](_0x18b96b);}),this['activeConversation']['on']('reasoningStarted',()=>{const _0x2357ee=this['_aiChatUi']['prepareLoadingMessage']({'isWebSearchEnabled':!0x1,'isReasoningEnabled':!0x0});this['_aiChatUi']['setLoadingMessage'](_0x2357ee);}),this['activeConversation']['on']('webSearchFinished',(_0x2b2f98,_0x58dd67)=>{this['_aiChatUi']['addFeedInteractionHeader'](_0x58dd67,{'isWebSearchEnabled':!0x0,'isReasoningEnabled':!0x1});}),this['activeConversation']['on']('reasoningFinished',(_0x5cace9,_0x3e5957)=>{this['_aiChatUi']['addFeedInteractionHeader'](_0x3e5957,{'isWebSearchEnabled':!0x1,'isReasoningEnabled':!0x0});}),this['activeConversation']['on']('interactionStarted',()=>{this['_aiChatUi']['startInteraction']();}),this['activeConversation']['on']('interactionFinished',async()=>{await this['_aiChatUi']['finishInteraction']();}),this['activeConversation']['on']('interactionDestroyed',(_0x10ce22,_0x249824)=>{this['_aiChatUi']['removeFeedInteraction'](_0x249824['id']);}),this['activeConversation']['on']('setConversationTitle',(_0x8057db,_0x3dfe2d,_0x2ca926)=>{this['_updateConversationTitle'](_0x3dfe2d,_0x2ca926);}),this['activeConversation']['on']('replyContentUpdated',async(_0x5d9738,_0x6a0094)=>{await this['_updateReplyContent']({'reply':_0x6a0094});}),this['activeConversation']['on']('replyChangeGroupStateUpdated',(_0x3b8fb7,{reply:_0x3c6929,index:_0x449208,state:_0x4031da})=>{this['_aiChatUi']['updateFeedItemAIReplySuggestionPartState']({'id':_0x3c6929['id'],'index':_0x449208,'state':_0x4031da}),this['_currentPreviewedChangeGroup']?.['replyId']['includes'](_0x3c6929['id'])&&this['_currentPreviewedChangeGroup']?.['partIndex']==_0x449208&&this['_aiChatBalloon']?.['setState'](_0x4031da);}),this['activeConversation']['on']('contextItemAdded',(_0x2cbe18,_0x14d10a)=>{if(this['_aiChatUi']['addContextItem'](_0x14d10a['contextItem'],_0x14d10a['isLoading']),'selection'===_0x14d10a['contextItem']['type']){const _0xd2b5be=[...Xs(this['context'])['model']['document']['selection']['getRanges']()];this['_aiEditing']['showFakeVisualSelection']({'ranges':_0xd2b5be,'id':'context','priority':0x1});}}),this['activeConversation']['on']('contextItemRemoved',(_0x4a6394,_0xe45f5)=>{this['_aiChatUi']['removeContextItem'](_0xe45f5['uiId']),'current-document'==_0xe45f5['uiId']&&this['removeSelectionFromChatContext'](),'selection'===_0xe45f5['type']&&this['_aiEditing']['hideFakeVisualSelection']('context');}),this['activeConversation']['on']('contextItemLoadingEnded',(_0x63b443,_0x265777)=>{this['_aiChatUi']['setContextItemLoading'](_0x265777['contextItem']['uiId'],_0x265777['isLoading']);}),this['activeConversation']['on']('contextSent',(_0x2f3ae3,_0x53cd29)=>{this['_aiChatUi']['setConversationContext'](_0x53cd29['contextItems']);}),this['activeConversation']['on']('addContextOptionsChanged',(_0x11141f,_0x59b6cb)=>{this['_aiChatUi']['setAddContextOptions'](_0x59b6cb['options']);}),this['activeConversation']['on']('sourceResourcesLoaded',(_0x5353c0,_0x218b5f)=>{this['_aiChatUi']['populateSourceResourceBalloon'](_0x218b5f['sourceId'],_0x218b5f['source'],_0x218b5f['resources'],_0x218b5f['uid']);}),this['activeConversation']['on']('resourceStateChanged',(_0x404d7f,_0x52f7d7)=>{this['_aiChatUi']['updateResourceState'](_0x52f7d7['sourceId'],_0x52f7d7['resourceId'],_0x52f7d7['isInContext']);}),this['activeConversation']['on']('capabilitiesUpdated',(_0x12d484,_0x1ca821)=>{this['_aiChatUi']['updateCapabilities'](_0x1ca821);}),this['activeConversation']['on']('modelSelected',async(_0x4f2b92,_0x4c0947)=>{const _0x3a1e5e=(await this['_aiChatModels']['getAll']())['find'](_0x23cb74=>_0x23cb74['id']===_0x4c0947['selectedModel']?.['id'])||null;this['_aiChatUi']['setSelectedModel'](_0x3a1e5e,_0x4c0947['isDisabled']);}),this['activeConversation']['on']('error',(_0x4810f6,{error:_0x1fe475,interactionId:_0xc97e09,fileName:_0x28da0c,url:_0x232da9,sourceId:_0xa30770,sourceLabel:_0x288108})=>{const _0x5081e9=_0xc97e09?_0xc97e09+':'+ot():ot();_0x1fe475['message']['startsWith']('ai-request-aborted')?this['_aiChatUi']['addFeedItemStaticMessage']({'staticMessage':us(this['context']['locale'],'AI_CHAT_ABORTED_MESSAGE'),'id':_0x5081e9}):_0x1fe475['message']['startsWith']('ai-chat-conversation-init-failed')||_0x1fe475['message']['startsWith']('ai-chat-conversation-start-failed')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':us(this['context']['locale'],'AI_CHAT_UNABLE_TO_START_CONVERSATION'),'id':_0x5081e9}),this['_logError'](_0x1fe475)):_0x1fe475['message']['startsWith']('ai-chat-file-upload-failed')?this['_aiChatUi']['addFeedItemError']({'errorMessage':us(this['context']['locale'],'AI_CHAT_CONTEXT_UNABLE_TO_UPLOAD_FILE',_0x28da0c),'id':_0x5081e9}):_0x1fe475['message']['startsWith']('ai-chat-url-upload-failed')?this['_aiChatUi']['addFeedItemError']({'errorMessage':us(this['context']['locale'],'AI_CHAT_CONTEXT_UNABLE_TO_UPLOAD_URL',_0x232da9),'id':_0x5081e9}):_0x1fe475['message']['startsWith']('ai-chat-context-invalid-data')?this['_aiChatUi']['addFeedItemError']({'errorMessage':us(this['context']['locale'],'AI_CHAT_CONTEXT_INVALID_DATA'),'id':_0x5081e9}):_0x1fe475['message']['startsWith']('ai-chat-context-unsupported-type')?this['_aiChatUi']['addFeedItemError']({'errorMessage':us(this['context']['locale'],'AI_CHAT_CONTEXT_UNSUPPORTED_TYPE'),'id':_0x5081e9}):_0x1fe475['message']['startsWith']('ai-chat-source-resources-load-failed')?(_0xa30770&&this['_aiChatUi']['closeSourceResourceBalloon'](_0xa30770),this['_aiChatUi']['addFeedItemError']({'errorMessage':us(this['context']['locale'],'AI_CHAT_CONTEXT_UNABLE_TO_LOAD_RESOURCES',_0x288108||'source'),'id':_0x5081e9}),this['_logError'](_0x1fe475)):_0x1fe475['message']['startsWith']('ai-chat-resource-load-failed')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':us(this['context']['locale'],'AI_CHAT_RESOURCE_LOAD_FAILED'),'id':_0x5081e9}),this['_logError'](_0x1fe475)):_0x1fe475['message']['startsWith']('ai-chat-invalid-request')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':us(this['context']['locale'],'AI_CHAT_INVALID_REQUEST'),'id':_0x5081e9}),this['_logError'](_0x1fe475)):_0x1fe475['message']['startsWith']('ai-chat-context-unsupported-file-type')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':us(this['context']['locale'],'AI_CHAT_CONTEXT_UNSUPPORTED_FILE_TYPE'),'id':_0x5081e9}),this['_logError'](_0x1fe475)):_0x1fe475['message']['startsWith']('ai-chat-context-file-too-large')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':us(this['context']['locale'],'AI_CHAT_CONTEXT_FILE_TOO_LARGE'),'id':_0x5081e9}),this['_logError'](_0x1fe475)):_0x1fe475['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':_0x5081e9}),this['_logError'](_0x1fe475)):_0x1fe475['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':_0x5081e9}),this['_logError'](_0x1fe475)):(this['_aiChatUi']['addFeedItemError']({'errorMessage':us(this['context']['locale'],'AI_CHAT_GENERIC_ERROR'),'id':_0x5081e9}),this['_logError'](_0x1fe475));}),await this['activeConversation']['init'](this['context']['config']['get']('ai.chat.context')),_0x560df2||await this['activeConversation']['start']();}async['_handleUIUserMessage']({message:_0x47f6c3,attributes:_0x2f0309}){if(!this['activeConversation'])throw new ht('ai-chat-controller-no-active-conversation');if(this['activeConversation']['isCurrentDocumentInContext']()){const _0x40e098=await this['_aiEditing']['getDocumentData']();await this['activeConversation']['updateCurrentDocumentInContext'](_0x40e098);}this['activeConversation']['id']&&this['activeConversation']['isStarted']&&await this['activeConversation']['handleUserInteraction']({'userMessage':_0x47f6c3,'attributes':_0x2f0309});}['_setIsMaximized'](_0x4b2f15){this['_aiChatUi']['setIsMaximized'](_0x4b2f15);}['_logError'](_0x157ac5){mt(_0x157ac5['message']);}['_removeFromContext'](_0x5709a7){this['activeConversation']?.['removeFromContext'](_0x5709a7);}['_toggleWebSearch'](){this['activeConversation']?.['toggleWebSearch']();}['_toggleReasoning'](){this['activeConversation']?.['toggleReasoning']();}['getInteractionAndReplyById'](_0x5b59d4){const [_0x26836e,_0xefeb0e]=_0x5b59d4['split'](':'),_0x42a667=this['activeConversation']['getInteraction'](_0x26836e),_0x188a34=_0x42a667['getReply'](_0xefeb0e);return{'interaction':_0x42a667,'reply':_0x188a34};}['_scrollToSuggestionRange'](_0x2bf387,_0x192178=!0x1){const _0x8ee85c=Xs(this['context']),_0x51ccbb={'target':_0x8ee85c['editing']['view']['domConverter']['viewRangeToDom'](_0x8ee85c['editing']['mapper']['toViewRange'](_0x2bf387)),'viewportOffset':{'top':0x96,'left':0x0,'bottom':0x32,'right':0x0},'ancestorOffset':0x14,'alignToTop':_0x192178};_0x192178&&(_0x51ccbb['alignToTop']=!0x0),Ct(_0x51ccbb);}['_updateConversationTitle'](_0x5276f1,_0x49a27f=!0x1){this['_aiChatUi']['setConversationTitle'](_0x5276f1||us(this['context']['locale'],'AI_CHAT_UNTITLED_CONVERSATION'),_0x49a27f);}['_addFeedItemReply'](_0x8b2cc1){'text'===_0x8b2cc1['type']?this['_aiChatUi']['addFeedItemAIReply'](_0x8b2cc1):this['_aiChatUi']['addFeedItemAISuggestion'](_0x8b2cc1);}async['_updateReplyContent']({reply:_0x597000,renderingStrategy:_0x257874}){const {id:_0x5ba036,interactionId:_0x37ca4e,isDone:_0x5912bc,type:_0xde043b,parsedContent:_0x5e718f}=_0x597000,_0x82dfd6=_0x37ca4e+':'+_0x5ba036;if('modification'===_0xde043b){const _0x458f49=_0x597000['getContentParts']({'showDiff':this['_aiChatUi']['showDiff']});await this['_aiChatUi']['updateFeedItemAIReplySuggestionContent']({'id':_0x82dfd6,'parts':_0x458f49,'renderingStrategy':_0x257874,'isDone':_0x5912bc});}else'text'===_0xde043b&&await this['_aiChatUi']['updateFeedItemAIReplyContent']({'id':_0x82dfd6,'parsedContent':_0x5e718f,'renderingStrategy':_0x257874,'isDone':_0x5912bc});_0x5912bc&&_0x597000['sources']['length']>0x0&&this['_aiChatUi']['updateFeedItemAIReplySources'](_0x82dfd6,_0x597000['sources']);}async['_stopLastInteraction'](){const _0x5f580e=this['activeConversation']?.['lastInteraction'];_0x5f580e&&(_0x5f580e['stop'](),this['_aiChatUi']['stopInteraction'](_0x5f580e));}async['_flushLastInteractionUI'](){const _0x4c7227=this['activeConversation']?.['lastInteraction'];if(_0x4c7227){for await(const _0x172825 of _0x4c7227['replies'])this['_aiChatUi']['hasFeedItem'](_0x172825['id'])||this['_addFeedItemReply'](_0x172825),await this['_updateReplyContent']({'reply':_0x172825,'renderingStrategy':'static'});}}['_updateRatings'](_0x42db73){const _0x192072={'positiveCount':_0x42db73['changeGroups']['filter'](_0x2f6d55=>'accepted'===_0x2f6d55['state'])['length'],'totalCount':_0x42db73['changeGroups']['length'],'modificationId':_0x42db73['id']},_0x5783e1=this['activeConversation']['getInteraction'](_0x42db73['interactionId'])['messageId'];_0x5783e1&&this['_aiConnector']['upsertAIChatRating'](this['activeConversation']['id'],_0x5783e1,_0x192072);}['_getAIChatFeedAPI'](_0x3b4249){const _0x497975=this['_aiChatUi'],_0x6f4d07=()=>{_0x3b4249['resetWebSearchState'](),_0x3b4249['resetReasoningState'](),_0x497975['clearLoadingMessage']();},_0x2e3caa=()=>{_0x3b4249['currentReply']&&(_0x3b4249['currentReply']['done'](),_0x3b4249['currentReply']=void 0x0);};return{'insertTextReply':(_0x17439f,_0x6d4160)=>{_0x2e3caa(),_0x6f4d07();const _0xaf4eea=_0x3b4249['currentReply']=_0x3b4249['createReply']({'type':'text','interactionId':_0x3b4249['id'],'content':_0x17439f,'id':_0x6d4160||ot()});return _0x2e3caa(),_0xaf4eea;},'insertCustomElement':async(_0x498489,_0x3fd550)=>(_0x2e3caa(),_0x6f4d07(),_0x497975['addFeedItemCustomElement'](_0x498489,_0x3fd550||ot())),'setLoadingMessage':_0x3c9fde=>{_0x497975['setLoadingMessage'](_0x3c9fde);},'clearLoadingMessage':()=>{_0x497975['clearLoadingMessage']();}};}}const Zs='ai-selection';class tn extends _0x20e290{constructor(_0x3052f3){super(_0x3052f3),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 _0x9607b2=Xs(this['context']),_0x33a54a=_0x9607b2['plugins']['has']('RealTimeCollaborationClient')&&_0x9607b2['plugins']['get']('RealTimeCollaborationClient')['sessionId'];this['_sessionId']=_0x33a54a||ot();}return this['_sessionId'];}async['getDocumentData'](){const _0x1c7086=Xs(this['context']),_0x135de8=_0x1c7086['model'],_0x2c4dbf=_0x1c7086['data']['toView'](_0x135de8['document']['getRoot'](),{'convertAiChatSelectionMarker':!0x0}),_0x261052=new _0x12730c(_0x1c7086['editing']['view']['document']);this['_setDataIdsOnChildren'](_0x2c4dbf,_0x261052);let _0x3dd8e1=await this['_getDocumentDataStringFromView'](_0x2c4dbf);const _0x36a815=this['_getMarkersInDocumentOrder'](),_0x5c3222=[];for(const _0x1264c0 of _0x36a815){const _0x1131d8='<'+_0x1264c0['name']+':start></'+_0x1264c0['name']+':start>',_0x549ff0=_0x3dd8e1['indexOf'](_0x1131d8);_0x3dd8e1=_0x3dd8e1['substring'](0x0,_0x549ff0)+_0x3dd8e1['substring'](_0x549ff0+_0x1131d8['length']);const _0x33f3f4='<'+_0x1264c0['name']+':end></'+_0x1264c0['name']+':end>',_0x8ad733=_0x3dd8e1['indexOf'](_0x33f3f4);_0x3dd8e1=_0x3dd8e1['substring'](0x0,_0x8ad733)+_0x3dd8e1['substring'](_0x8ad733+_0x33f3f4['length']),_0x5c3222['push']({'markerName':_0x1264c0['name'],'start':_0x549ff0,'end':_0x8ad733,'htmlFragment':_0x3dd8e1['substring'](_0x549ff0,_0x8ad733)});}return{'content':_0x3dd8e1,'version':_0x1c7086['model']['document']['version'],'sessionId':this['sessionId'],'selections':_0x5c3222};}async['afterInit'](){this['context']instanceof _0x4433f2?this['_integrateEditor'](this['context']):this['listenTo'](this['context']['editors'],'add',(_0x197c14,_0x1ae313)=>{_0x1ae313['on']('ready',()=>{this['_integrateEditor'](_0x1ae313);});});}['_setOutputDataProcessor'](_0x26dea2){this['_outputDataProcessor']=_0x26dea2;}async['_getDocumentDataStringFromView'](_0x580de4){let _0x4380f8;const _0x1cb41c=Xs(this['context']);if(this['_outputDataProcessor']){const _0x4babba=_0x1cb41c['data']['processor']['domConverter']['viewToDom'](_0x580de4),_0x15619c=await this['_outputDataProcessor'](_0x4babba);_0x4380f8=_0x1cb41c['data']['processor']['htmlWriter']['getHtml'](_0x15619c);}else _0x4380f8=_0x1cb41c['data']['processor']['toData'](_0x580de4);return _0x4380f8;}['_integrateEditor'](_0x568de2){_0x568de2['conversion']['for']('editingDowncast')['markerToHighlight']({'model':Zs,'view':({markerName:_0x1c3d46})=>({'classes':['ck-ai-assistant-ui_theme','ck-fake-ai-selection','ck-fake-ai-selection-'+_0x1c3d46['split'](':')[0x1]],'priority':0xc})}),_0x568de2['conversion']['for']('dataDowncast')['markerToElement']({'model':Zs,'view':(_0x542e96,{writer:_0x55da90,options:_0x1b0a9d})=>_0x1b0a9d['convertAiChatSelectionMarker']?_0x55da90['createUIElement'](_0x542e96['markerName']+':'+(_0x542e96['isOpening']?'start':'end')):null});}['showFakeVisualSelection'](_0x486872){const _0x5b9d8a=this['_fakeSelections'][0x0]||null;this['_addFakeSelection'](_0x486872);const _0x13777c=this['_fakeSelections'][0x0]||null;this['_refreshFakeSelection'](_0x5b9d8a,_0x13777c);}['hideFakeVisualSelection'](_0x2cbeb3){const _0x2805c2=this['_fakeSelections'][0x0]||null;this['_removeFakeSelectionById'](_0x2cbeb3);const _0x527b80=this['_fakeSelections'][0x0]||null;this['_refreshFakeSelection'](_0x2805c2,_0x527b80);}async['modelToDataWithIds'](_0x1d94c4){const _0x258246=Xs(this['context']),_0x33c119=_0x258246['data']['toView'](_0x1d94c4),_0x3b5edb=new _0x12730c(_0x258246['editing']['view']['document']);return this['_setDataIdsOnChildren'](_0x33c119,_0x3b5edb),this['_getDocumentDataStringFromView'](_0x33c119);}['_setDataIdsOnChildren'](_0x581a2c,_0x37ce36){let _0x6313d6=!0x1;const _0x36a6ef=new Set();for(const _0x4e09d9 of _0x581a2c['getChildren']()){if(!_0x4e09d9['is']('view:element'))continue;const _0xfc5679=_0x4e09d9['is']('view:containerElement'),_0x2b318e=_0x4e09d9['is']('view:emptyElement'),_0xe0f428=this['_setDataIdsOnChildren'](_0x4e09d9,_0x37ce36);if(_0x4e09d9['hasAttribute']('data-id')){_0x6313d6=!0x0,_0x36a6ef['add'](_0x4e09d9['getAttribute']('data-id'));continue;}(_0xfc5679||_0x2b318e||_0xe0f428)&&(_0x37ce36['setAttribute']('data-id',this['_nextDataId'](_0x36a6ef),_0x4e09d9),_0x6313d6=!0x0);}return _0x6313d6;}['_nextDataId'](_0x176f92){let _0x546457;do{_0x546457='';for(let _0x508478=0x0;_0x508478<0x4;_0x508478++)_0x546457+=String['fromCharCode'](0x61+Math['floor'](0x1a*Math['random']()));}while(_0x176f92['has'](_0x546457));return _0x176f92['add'](_0x546457),_0x546457;}['getSelectionText'](){const {model:_0x387f94}=Xs(this['context']),_0x4c5cd9=_0x387f94['document']['selection'],_0x453372=[],_0x20ab2e=Array['from'](_0x4c5cd9['getRanges']());_0x20ab2e['sort']((_0x4e2229,_0x3f0fb6)=>_0x4e2229['start']['isBefore'](_0x3f0fb6['start'])?-0x1:0x1);for(const _0x5b1f0d of _0x20ab2e)for(const _0x577932 of _0x5b1f0d['getItems']())_0x577932['is']('$textProxy')?_0x453372['push'](_0x577932['data']):_0x577932['is']('element')&&_0x453372['length']>0x0&&'\x20'!==_0x453372[_0x453372['length']-0x1]&&_0x453372['push']('\x20');return _0x453372['length']?'\x22'+_0x453372['join']('')['trim']()+'\x22':us(this['context']['locale'],'AI_CHAT_CONTEXT_DOCUMENT_SELECTION_LABEL');}['_removeFakeSelectionById'](_0x5a46b5){for(let _0x24189b=0x0;_0x24189b<this['_fakeSelections']['length'];_0x24189b++)if(this['_fakeSelections'][_0x24189b]['id']==_0x5a46b5)return void this['_fakeSelections']['splice'](_0x24189b,0x1);}['_addFakeSelection'](_0x27ade2){this['_removeFakeSelectionById'](_0x27ade2['id']),wt(this['_fakeSelections'],_0x27ade2);}['_refreshFakeSelection'](_0xd8397c,_0x505e53){if(_0xd8397c==_0x505e53)return;const _0x166a2d=Xs(this['context']),_0x30e78f=_0x166a2d['model'];_0x30e78f['change'](_0xb5627f=>{if(_0xd8397c){const _0x32c85e=_0x166a2d['model']['markers']['getMarkersGroup'](Zs);for(const _0x403038 of _0x32c85e)_0xb5627f['removeMarker'](_0x403038);}if(_0x505e53)for(let _0x48daf1=0x0;_0x48daf1<_0x505e53['ranges']['length'];_0x48daf1++){let _0x36fe98=_0x505e53['ranges'][_0x48daf1];const _0xd17c7f=Zs+':'+_0x505e53['id']+':'+_0x48daf1;if(_0x36fe98['start']['isAtEnd']){const _0x5e408d=_0x36fe98['start']['getLastMatchingPosition'](({item:_0xb0dc1})=>!_0x30e78f['schema']['isContent'](_0xb0dc1),{'boundaries':_0x36fe98});_0x36fe98=_0xb5627f['createRange'](_0x5e408d,_0x36fe98['end']);}_0xb5627f['addMarker'](_0xd17c7f,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x36fe98});}});}['_getMarkersInDocumentOrder'](){const _0x532e6c=Xs(this['context'])['model'];return Array['from'](_0x532e6c['markers']['getMarkersGroup'](Zs))['sort']((_0x361f64,_0x1f1e8c)=>_0x361f64['getStart']()['isBefore'](_0x1f1e8c['getStart']())?-0x1:_0x361f64['getStart']()['isAfter'](_0x1f1e8c['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(_0x16b78a){this['options']={'delay':_0x16b78a['delay']??0x14,'textNodeStyle':_0x16b78a['textNodeStyle'],'onStreamUpdate':_0x16b78a['onStreamUpdate']||(()=>{})};}async['stream']({document:_0x1a7f0a,targetElement:_0x5d0ec3,abortSignal:_0x4799a5}){this['isStreaming']&&this['stop'](),_0x4799a5?.['addEventListener']('abort',this['stop']['bind'](this)),this['document']=_0x183885(_0x1a7f0a,!0x0),this['nodesList']=this['getParsedDocumentNodeList'](),this['isStreaming']=!0x0,this['currentIndex']>this['nodesList']['length']&&(this['currentIndex']=this['nodesList']['length']);for(let _0xc4b61d=0x0;_0xc4b61d<this['currentIndex'];_0xc4b61d++)this['nodesList'][_0xc4b61d]['shouldBeStreamed']=!0x0;do{const _0x361dfe=Date['now'](),_0x5333ff=this['nodesList'][this['currentIndex']],_0x661dad=_0x361dfe-this['lastUpdateTime'];if(_0x5333ff){_0x5333ff['shouldBeStreamed']=!0x0;let _0x4c519d=_0x5333ff['parent'];for(;_0x4c519d;)_0x4c519d['shouldBeStreamed']=!0x0,_0x4c519d=_0x4c519d['parent'];}if(_0x661dad<this['options']['delay'])try{const {promise:_0x898165,abortController:_0x4bc082}=hn(this['options']['delay']-_0x661dad);this['timeoutAbortController']=_0x4bc082,await _0x898165;}catch(_0x5df3a7){return;}_0x382bf8(_0x5d0ec3,'<'+_0x5d0ec3['tagName']+'>'+this['renderNode'](this['document'])+'</'+_0x5d0ec3['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:_0x5420b8}){Array['from'](_0x5420b8['querySelectorAll']('span[data-ck-html-streamer-word-chunk]'))['reverse']()['forEach'](_0x13ba67=>{_0x13ba67['replaceWith'](_0x13ba67['childNodes'][0x0]);});}['stop'](){this['isStreaming']=!0x1,this['timeoutAbortController']&&(this['timeoutAbortController']['abort'](),this['timeoutAbortController']=null);}['renderNode'](_0x190cbb){let _0x6002e7='';if(function(_0x293500){return _0x7d2ee4(_0x293500);}(_0x190cbb)){for(const _0x119b9c of _0x190cbb['children'])_0x6002e7+=this['renderNode'](_0x119b9c);}else{if(on(_0x190cbb)){if(!_0x190cbb['shouldBeStreamed'])return'';const _0x1efb33=_0x190cbb,_0x4d1f26=Object['entries'](_0x1efb33['attribs'])['map'](([_0x1d137b,_0x32be50])=>_0x1d137b+'=\x22'+_0x32be50+'\x22')['join']('\x20');_0x6002e7+='<'+_0x1efb33['tagName']+(_0x4d1f26?'\x20'+_0x4d1f26:'')+'>';for(const _0x3076f3 of ti(_0x1efb33))_0x6002e7+=this['renderNode'](_0x3076f3);_0x6002e7+='</'+_0x1efb33['tagName']+'>';}else{if(!an(_0x190cbb))return'';if(!_0x190cbb['shouldBeStreamed'])return'';!function(_0x1e259d){if(!_0x1e259d['parent']||!on(_0x1e259d['parent']))return!0x1;if(!rn['includes'](_0x1e259d['parent']['tagName']))return!0x1;return!_0x5364bb(_0x1e259d)['match'](/^\s*[<>]\s*$/);}(_0x190cbb)?_0x6002e7+=_0x2dfbe5(_0x190cbb):_0x6002e7+=_0x2dfbe5(new _0x4ea24a('span',{'data-ck-html-streamer-word-chunk':'','style':this['options']['textNodeStyle']},[_0x190cbb]));}}return _0x6002e7;}['getParsedDocumentNodeList'](){const _0x324281=[];return function(_0x25136b,_0xc71bb){const _0x4dfcba=_0x2fbb04=>{if(_0xc71bb(_0x2fbb04),_0x2fbb04 instanceof _0x471e20)for(let _0x28541b=0x0;_0x28541b<_0x2fbb04['children']['length'];_0x28541b++){const _0x125a76=_0x2fbb04['children'][_0x28541b];_0x4dfcba(_0x125a76);}};for(let _0x567998=0x0;_0x567998<_0x25136b['children']['length'];_0x567998++)_0x4dfcba(_0x25136b['children'][_0x567998]);}(this['document'],_0x3dd3e7=>{if(an(_0x3dd3e7)){const _0x48d991=this['splitTextNodeIntoWordNodes'](_0x3dd3e7);_0x48d991['length']&&_0x324281['push'](..._0x48d991);}_0x3dd3e7['isWordSplitSource']||_0x3dd3e7['isWordSplitResult']||_0x324281['push'](_0x3dd3e7);}),_0x324281;}['splitTextNodeIntoWordNodes'](_0x6fcde4){if(_0x6fcde4['isWordSplitSource']||_0x6fcde4['isWordSplitResult'])return[];const _0x1145b4=_0x5364bb(_0x6fcde4)['match'](/(?:\s*\S+\s*)/g),_0x46e330=[];if(_0x1145b4&&_0x1145b4['length']>0x1){for(const _0x17527a of _0x1145b4){const _0x41f2cc=new _0x2883a5(_0x17527a);_0x41f2cc['isWordSplitResult']=!0x0,_0xaf8e9(_0x6fcde4,_0x41f2cc),_0x46e330['push'](_0x41f2cc);}_0x6fcde4['isWordSplitSource']=!0x0,_0x2abe84(_0x6fcde4);}return _0x46e330;}}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(_0x389e8e){return _0x1dbf73(_0x389e8e);}function on(_0x5a2010){return _0x5af81f(_0x5a2010);}function hn(_0x5473de){const _0x5977c8=new AbortController();return{'promise':new Promise((_0x473165,_0x3657ab)=>{const _0x134336=setTimeout(_0x473165,_0x5473de);_0x5977c8['signal']['addEventListener']('abort',()=>{clearTimeout(_0x134336),_0x3657ab();});}),'abortController':_0x5977c8};}class cn extends vt{['options'];['content']='';['htmlStreamer'];['children'];constructor(_0x4b8267){super();const _0x2c7099=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']=_0x4b8267,this['children']=this['createCollection'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed__item',_0x2c7099['if']('isDone','ck-ai-chat__feed__item_done'),_0x2c7099['if']('isVisible','ck-hidden',_0x3ec490=>!_0x3ec490),'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'](_0x1c12b9=>{_0x1c12b9['removeAttribute']('data-id');}),this['isDone']=!0x0;}async['streamIntoElement'](_0x4a30a9,_0x61d842,_0x465a8f){await this['htmlStreamer']['stream']({'document':_0x4a30a9,'targetElement':_0x61d842,'abortSignal':_0x465a8f});}}class ln extends vt{['showChangesToggleView'];constructor(_0x1b3e4c,_0x1957cc){super(_0x1b3e4c),this['set']('isShowChangesToggleVisible',!0x0),this['showChangesToggleView']=new un(_0x1b3e4c),this['showChangesToggleView']['set']({'class':'ck-ai-suggestion__header__show-changes-toggle\x20ck-ai-chat-controls-button\x20'+As,'label':us(_0x1b3e4c,'AI_SUGGESTION_BUTTON_SHOW_CHANGES'),'withText':!0x0}),this['showChangesToggleView']['isOn']=_0x1957cc['showDiff'],this['showChangesToggleView']['bind']('isVisible')['to'](this,'isShowChangesToggleVisible'),this['showChangesToggleView']['bind']('icon')['to'](this['showChangesToggleView'],'isOn',_0x3427c5=>_0x3427c5?_0x25d95d:_0xb9919f),this['showChangesToggleView']['on']('execute',()=>{this['showChangesToggleView']['isOn']=!this['showChangesToggleView']['isOn'],this['fire']('toggleShowChanges',{'isOn':this['showChangesToggleView']['isOn']});});const _0x4f5e99=new xt();_0x4f5e99['content']=_0x4fd116,this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__header',!0x1===_0x1957cc['showHeader']?'ck-hidden':null]['filter'](Boolean)},'children':[_0x4f5e99,{'tag':'span','children':[us(_0x1b3e4c,'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':_0x404dd0,'rejected':_0x3a109c,'outdated':_0x3a109c};class _n extends vt{['stateIconView'];constructor(_0x3c2640){super(_0x3c2640);const _0x109edf=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',_0x109edf['to']('state',_0x31bb03=>'ck-ai-suggestion__content-part-state_'+_0x31bb03),_0x109edf['if']('isVisible','ck-hidden',_0x1e319c=>!_0x1e319c)]},'children':[{'tag':'span','attributes':{'class':['ck-ai-suggestion__content-part-state__label']},'children':[{'text':_0x109edf['to']('state',_0xf0dc0d=>{switch(_0xf0dc0d){case'accepted':return us(_0x3c2640,'AI_SUGGESTION_CONTENT_PART_STATE_ACCEPTED');case'rejected':return us(_0x3c2640,'AI_SUGGESTION_CONTENT_PART_STATE_REJECTED');case'outdated':return us(_0x3c2640,'AI_SUGGESTION_CONTENT_PART_STATE_OUTDATED');}})}]},this['stateIconView']]});}['setState'](_0x47ed4d){this['state']=_0x47ed4d;}}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(_0x8ccc78,_0x824cac,_0xf615b4){super(_0x8ccc78);const _0xe18ad=Boolean(_0xf615b4);this['set']('isEnabled',!_0xe18ad),this['set']('isVisible',!0x0),this['class']='ck-ai-suggestion-content-part-toolbar';const _0x22fca6=[];if(_0xe18ad){const _0x19bbd0=new Nt(_0x8ccc78);_0x19bbd0['set']({'label':us(_0x8ccc78,'AI_SUGGESTION_DISABLED_TOOLTIP_MESSAGE'),'tooltip':!0x0,'tooltipPosition':'n','withText':!0x1,'icon':_0x1b9c2f}),_0x22fca6['push'](_0x19bbd0);}else{_0x824cac['includes']('applySuggestion')&&(this['_applyButton']=new Nt(_0x8ccc78),this['_applyButton']['set']({'label':us(_0x8ccc78,'AI_SUGGESTION_CONTENT_PART_APPLY'),'tooltip':!0x0,'tooltipPosition':'n','withText':!0x1,'icon':_0x404dd0}),this['_applyButton']['bind']('isEnabled')['to'](this),this['_applyButton']['on']('execute',()=>{this['fire']('applySuggestion');}),_0x22fca6['push'](this['_applyButton'])),_0x824cac['includes']('insertSuggestion')&&(this['_suggestButton']=new Nt(_0x8ccc78),this['_suggestButton']['set']({'label':us(_0x8ccc78,'AI_SUGGESTION_CONTENT_PART_ADD_SUGGESTION'),'tooltip':!0x0,'tooltipPosition':'n','withText':!0x1,'icon':_0x7e05dc}),this['_suggestButton']['bind']('isEnabled')['to'](this),this['_suggestButton']['on']('execute',()=>{this['fire']('insertSuggestion');}),_0x22fca6['push'](this['_suggestButton']));const _0x335d6b=new Nt(_0x8ccc78);_0x335d6b['set']({'label':us(_0x8ccc78,'AI_SUGGESTION_CONTENT_PART_REJECT'),'tooltip':!0x0,'tooltipPosition':'n','withText':!0x1,'icon':_0x3a109c}),_0x335d6b['bind']('isEnabled')['to'](this),_0x335d6b['on']('execute',()=>{this['fire']('rejectSuggestion');}),_0x22fca6['push'](_0x335d6b);}this['items']['addMany'](_0x22fca6);const _0xa24274=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':[_0xa24274['if']('isVisible','ck-hidden',_0x458cbc=>!_0x458cbc)]}});}['setButtonsVisibility']({showApplyButton:_0x3a443e,showSuggestButton:_0x35d6c5}){this['_applyButton']&&(this['_applyButton']['isVisible']=_0x3a443e),this['_suggestButton']&&(this['_suggestButton']['isVisible']=_0x35d6c5);}}class In extends vt{['toolbarView'];['stateView'];['titleLabelView'];['children'];constructor(_0x433218,{part:_0x43f1b9,uiIndex:_0x1f8fc9,availableActions:_0x76d8fb,areActionsDisabled:_0x41bee3}){super(_0x433218),this['set']('isEnabled',!0x0),this['set']('state','pending'),this['toolbarView']=new gn(_0x433218,_0x76d8fb,_0x41bee3),this['toolbarView']['on']('rejectSuggestion',()=>{this['fire']('rejectSuggestion',{'index':_0x43f1b9['index']});}),this['toolbarView']['on']('insertSuggestion',()=>{this['fire']('insertSuggestion',{'index':_0x43f1b9['index']});}),this['toolbarView']['on']('applySuggestion',()=>{this['fire']('applySuggestion',{'index':_0x43f1b9['index']});}),this['toolbarView']['bind']('isEnabled')['to'](this),this['stateView']=new _n(_0x433218),this['titleLabelView']=new En(_0x433218,_0x1f8fc9),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',(_0x3d6aed,_0x3675a6,_0xc63fe9,_0x404a34)=>{'pending'===_0x404a34?this['children']['remove'](this['toolbarView']):this['children']['remove'](this['stateView']),'pending'===_0xc63fe9?this['children']['add'](this['toolbarView']):(this['stateView']['setState'](_0xc63fe9),this['children']['add'](this['stateView']));});}}class En extends vt{constructor(_0x4cf855,_0x14e85c){super(_0x4cf855),this['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai-suggestion__body__content-part__title__label']},'children':[us(_0x4cf855,'AI_SUGGESTION_CONTENT_PART_TITLE',_0x14e85c['toString']())]});}}class pn extends vt{['htmlStreamer'];constructor(_0x17c5b5){super(_0x17c5b5),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:_0x5a2d36,renderingStrategy:_0x11b54f,abortSignal:_0x44e7b9}){'streaming'===_0x11b54f?await this['htmlStreamer']['stream']({'document':_0x5a2d36['content'],'targetElement':this['element'],'abortSignal':_0x44e7b9}):this['element']['innerHTML']=Es(_0x5a2d36['content']);}['clear'](){this['htmlStreamer']['reset'](),this['element']['innerHTML']='';}}class Tn extends vt{['_children'];['_headerView'];['_streamableContentView'];constructor(_0x7c0165,{part:_0x275a20,uiIndex:_0x1d60cd,areActionsDisabled:_0x39bb95,availableActions:_0x5b20f1}){super(_0x7c0165);const _0x5f270e=this['bindTemplate'];this['set']('state','pending'),this['set']('isDone',!0x1),this['set']('isVisible',!0x1),this['set']('isActive',!0x1),this['set']('isEnabled',!0x1);const _0x41a9b5=()=>{this['isEnabled']=this['isDone']&&'pending'==this['state']&&!_0x39bb95;};this['on']('change:state',_0x41a9b5),this['on']('change:isDone',_0x41a9b5),_0x41a9b5(),this['_children']=this['createCollection'](),this['_headerView']=new In(_0x7c0165,{'part':_0x275a20,'uiIndex':_0x1d60cd,'availableActions':_0x5b20f1,'areActionsDisabled':_0x39bb95}),this['_headerView']['bind']('isEnabled','state')['to'](this),this['_headerView']['delegate'](...en)['to'](this),this['_streamableContentView']=new pn(_0x7c0165),this['_children']['addMany']([this['_headerView'],this['_streamableContentView']]),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__body__content-part',_0x5f270e['to']('state',_0x198256=>'ck-ai-suggestion__body__content-part_'+_0x198256),_0x5f270e['if']('isEnabled','ck-ai-suggestion__body__content-part_enabled'),_0x5f270e['if']('isActive','ck-ai-suggestion__body__content-part_active'),_0x5f270e['if']('isVisible','ck-hidden',_0x2f56e0=>!_0x2f56e0)]},'children':this['_children'],'on':{'mouseenter':_0x5f270e['to'](()=>{this['isEnabled']&&this['fire']('mouseOverSuggestion',{'index':_0x275a20['index']});}),'mouseleave':_0x5f270e['to'](()=>{this['isEnabled']&&this['fire']('mouseLeaveSuggestion',{'index':_0x275a20['index']});}),'click':_0x5f270e['to'](_0x55e9e1=>{const _0x22cdf2=_0x55e9e1['target'];this['isEnabled']&&!this['_headerView']['toolbarView']['element']['contains'](_0x22cdf2)&&this['fire']('showChangeInText',{'index':_0x275a20['index']});})}});}async['updateContent']({part:_0x399210,renderingStrategy:_0x4d02a0,showUnchangedParts:_0x4e9c2c=!0x1,abortSignal:_0x48e6a1}){this['partDefinition']=_0x399210,this['isVisible']=this['partDefinition']['hasChanges']||_0x4e9c2c,this['isVisible']&&await this['_streamableContentView']['update']({'part':_0x399210,'renderingStrategy':_0x4d02a0,'abortSignal':_0x48e6a1});}['markAsDone'](){this['isDone']=!0x0;}}class mn extends pt(){['queue']=[];['isProcessing']=!0x1;['_abortController'];async['enqueue'](_0x1081a1){const _0x512a27=this['createTask'](_0x1081a1);return this['queue']['push'](_0x512a27),this['_processQueue'](),_0x512a27['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(_0x195031=>{this['once']('_queueEmpty',()=>{_0x195031();});}):Promise['resolve']();}async['_processQueue'](){if(!this['isProcessing']){this['_abortController']=new AbortController(),this['isProcessing']=!0x0;try{for(;this['queue']['length']&&this['isProcessing'];){const _0x46ae22=this['queue']['shift']();try{await _0x46ae22['callback'](this['_abortController']['signal']),_0x46ae22['resolve']();}catch(_0x35c891){_0x46ae22['reject'](_0x35c891);}}}finally{this['isProcessing']=!0x1,this['_abortController']=void 0x0;}this['fire']('_queueEmpty');}}['createTask'](_0x3c436f){let _0x313ea8,_0x5acedd;const _0x371f04=new Promise((_0x18d12c,_0x570bd0)=>{_0x313ea8=_0x18d12c,_0x5acedd=_0x570bd0;});return{'callback':_0x3c436f,'resolve':_0x313ea8,'reject':_0x5acedd,'completePromise':_0x371f04};}}class Cn extends cn{constructor(_0x4ba08f){super(_0x4ba08f),this['extendTemplate']({'attributes':{'class':['ck-ai-notification','warning'===_0x4ba08f['level']?'ck-ai-notification_warning':'ck-ai-notification_error']}});}['render'](){super['render'](),this['setContent'](this['options']['initialContent']),this['markAsDone']();}['setContent'](_0x44cf0a){this['element']['innerHTML']=_0x44cf0a;}}const wn=['applySuggestion','insertSuggestion'];class fn extends vt{['_applyChangesButton'];['_insertSuggestionsButton'];['children'];constructor(_0xb5b527,_0x9f6f1c=[...wn],_0x3b9621){super(_0xb5b527);const _0x921e9b=this['bindTemplate'],_0x8156de=Boolean(_0x3b9621);if(this['set']('isEnabled',!_0x8156de),this['set']('isVisible',!0x1),this['set']('isTrackChangesOn',!0x1),this['children']=this['createCollection'](),_0x8156de){const _0xf5685a=new Nt(_0xb5b527);_0xf5685a['set']({'label':us(_0xb5b527,'AI_SUGGESTION_DISABLED_TOOLTIP_MESSAGE'),'tooltip':!0x0,'tooltipPosition':'n','withText':!0x1,'icon':_0x1b9c2f});const _0x52a771=new vt(_0xb5b527);_0x52a771['setTemplate']({'tag':'div','attributes':{'class':'ck-ai-chat__feed__suggestion__actions__info'},'children':[{'tag':'p','children':[us(_0xb5b527,'AI_SUGGESTION_DISABLED_FEED_MESSAGE'),_0xf5685a]}]}),this['children']['add'](_0x52a771);}else this['_applyChangesButton']=new Nt(_0xb5b527),this['_applyChangesButton']['set']({'label':us(_0xb5b527,'AI_CHAT_SUGGESTION_ACTION_APPLY_ALL'),'withText':!0x0,'type':'button','isVisible':_0x9f6f1c['includes']('applySuggestion'),'class':ds}),this['_insertSuggestionsButton']=new Nt(_0xb5b527),this['_insertSuggestionsButton']['set']({'label':us(_0xb5b527,'AI_CHAT_SUGGESTION_ACTION_SUGGEST_ALL'),'withText':!0x0,'type':'button','isVisible':_0x9f6f1c['includes']('insertSuggestion'),'class':_s}),this['_insertSuggestionsButton']['on']('execute',()=>{this['fire']('insertSuggestion');}),this['_applyChangesButton']['on']('execute',()=>{this['fire']('applySuggestion');}),[this['_applyChangesButton'],this['_insertSuggestionsButton']]['forEach'](_0xcaabe=>{_0xcaabe['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',_0x921e9b['if']('isVisible','ck-hidden',_0x410a57=>!_0x410a57)]},'children':this['children']}),this['on']('change:isTrackChangesOn',()=>{this['_applyChangesButton']&&(this['_applyChangesButton']['isVisible']=!this['isTrackChangesOn']);});}['updateVisibility'](_0xd4a54d){this['isVisible']=_0xd4a54d;}['_switchButtonLabelsPlurality'](_0xc22957){this['_applyChangesButton']&&this['_insertSuggestionsButton']&&(_0xc22957?(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(_0x2af841,_0x386e55){super(_0x2af841),this['bodyCollection']=_0x386e55,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',_0x5c353b=>!_0x5c353b)]},'children':this['children']});const _0x10ff19=new vt(this['locale']),_0x50f3a3=new xt();_0x50f3a3['content']=_0x5c5297,_0x10ff19['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-web-sources__header']},'children':[_0x50f3a3,{'tag':'span','children':[{'text':us(this['locale'],'AI_CHAT_SOURCES_HEADER')}]}]}),this['children']['add'](_0x10ff19),this['_setupBalloonPanel'](_0x2af841);}['addSource'](_0x399e49){this['children']['add'](new bn(this['locale'],_0x399e49,this['balloonPanelView']));}['_setupBalloonPanel'](_0x11295a){this['balloonPanelView']=new Xt(_0x11295a),this['balloonPanelView']['extendTemplate']({'attributes':{'class':['ck-ai-web-source__tooltip-balloon']}}),this['bodyCollection']['add'](this['balloonPanelView']);}}class bn extends Nt{['balloonPanelView'];['source'];constructor(_0x4e21a2,_0x40e306,_0x4d8b89){super(_0x4e21a2),this['source']=_0x40e306,this['balloonPanelView']=_0x4d8b89,this['set']({'label':_0x40e306['title'],'class':['ck\x20ck-ai-web-source'],'withText':!0x0});const _0x3b2fb7=this['bindTemplate'];if(this['extendTemplate']({'on':{'click':_0x3b2fb7['to'](()=>{window['open'](_0x40e306['url'],'_blank');}),'mouseenter':_0x3b2fb7['to'](()=>{this['_showTooltip']();}),'mouseleave':_0x3b2fb7['to'](()=>{this['_hideTooltip']();})}}),_0x40e306['favicon']){const _0x1f19ef=new vt(_0x4e21a2);_0x1f19ef['setTemplate']({'tag':'img','attributes':{'src':_0x40e306['favicon']||_0x5c5297,'alt':_0x40e306['title'],'class':['ck-ai-web-source__image']}}),this['children']['add'](_0x1f19ef);}else this['set']('icon',_0x5c5297);}['_createTooltipContentView'](_0xd20ee5,_0x41821b){const _0x1b7f85=new vt(_0xd20ee5),_0x16cc33=[];let _0x21aec5;_0x41821b?.['favicon']?(_0x21aec5=new vt(_0xd20ee5),_0x21aec5['setTemplate']({'tag':'img','attributes':{'src':_0x41821b['favicon'],'alt':_0x41821b['title'],'class':['ck-ai-web-source__tooltip-image']}})):(_0x21aec5=new xt(),_0x21aec5['content']=_0x5c5297,_0x21aec5['extendTemplate']({'attributes':{'alt':_0x41821b['title'],'class':['ck-ai-web-source__tooltip-image']}})),_0x16cc33['push'](_0x21aec5);const _0x1f8494=new vt(_0xd20ee5);_0x1f8494['setTemplate']({'tag':'a','attributes':{'class':['ck-ai-web-source__tooltip-url'],'href':_0x41821b['url']},'children':[{'text':new URL(_0x41821b['url'])?.['hostname']}]}),_0x16cc33['push'](_0x1f8494);const _0x3e6a81=new vt(_0xd20ee5);_0x3e6a81['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-web-source__tooltip-row']},'children':_0x16cc33});const _0x5e7dc6=new vt(_0xd20ee5);return _0x5e7dc6['setTemplate']({'tag':'span','attributes':{'class':['ck-ai-web-source__tooltip-row','ck-ai-web-source__tooltip-title']},'children':[{'text':_0x41821b['title']['length']>0x190?_0x41821b['title']['substring'](0x0,0x190)+'...':_0x41821b['title']}]}),_0x1b7f85['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-web-source__tooltip']},'children':[_0x3e6a81,_0x5e7dc6]}),_0x1b7f85;}['_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 _0x329185=this['_createTooltipContentView'](this['locale'],this['source']);this['balloonPanelView']['content']['add'](_0x329185);}}class Rn extends vt{['_actionsView'];['_sourcesView'];['_children'];['_areActionsDisabled'];['_showUnchangedParts'];['_updateContentPartsPromiseQueue'];['_emptyPartsWarningView'];['_availableActions'];['_cachedContentParts']=[];constructor(_0x486dbf,_0x840d01){super(_0x486dbf);const {areActionsDisabled:_0x37b8a5,showUnchangedParts:_0x3b4f73,availableActions:_0x3974e4}=_0x840d01;this['_areActionsDisabled']=_0x37b8a5,this['_showUnchangedParts']=_0x3b4f73,this['_availableActions']=_0x3974e4,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(_0x486dbf,'AI_SUGGESTION_EMPTY_PART_WARNING'),'level':'warning'}),this['_emptyPartsWarningView']['isVisible']=!0x1,this['_actionsView']=new fn(_0x486dbf,_0x840d01['availableActions'],this['_areActionsDisabled']),this['_actionsView']['bind']('isTrackChangesOn')['to'](this),this['_sourcesView']=new Sn(this['locale'],_0x840d01['bodyCollection']),_0x840d01['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:_0x170887,renderingStrategy:_0x2ec49b,abortSignal:_0x1cd01a}){this['_children']['length']?_0x170887['forEach'](_0x4c0ab7=>{const _0xf0fe84=this['_cachedContentParts']['findIndex'](_0x203692=>_0x203692['index']==_0x4c0ab7['index']);-0x1===_0xf0fe84?this['_cachedContentParts']['push'](_0x4c0ab7):this['_cachedContentParts'][_0xf0fe84]=_0x4c0ab7;}):this['_cachedContentParts']=_0x170887;const _0x55b802=this['_showUnchangedParts']?_0x170887:_0x170887['filter'](_0x6c0010=>_0x6c0010['hasChanges']);this['_actionsView']['_switchButtonLabelsPlurality'](_0x55b802['length']>0x1);for(const _0x5f19ee of _0x55b802)this['_updateContentPartsPromiseQueue']['enqueue'](async _0x3dcb45=>{let _0x215f98=this['getPartView'](_0x5f19ee['index']);_0x215f98||(_0x215f98=new Tn(this['locale'],{'part':_0x5f19ee,'uiIndex':this['_children']['length']+0x1,'areActionsDisabled':this['_areActionsDisabled'],'availableActions':this['_availableActions']}),_0x215f98['delegate'](...en)['to'](this),this['_children']['add'](_0x215f98),this['hasPendingParts']=!0x0),await _0x215f98['updateContent']({'part':_0x5f19ee,'renderingStrategy':_0x2ec49b,'showUnchangedParts':this['_showUnchangedParts'],'abortSignal':_0x3dcb45}),_0x215f98['markAsDone']();});return _0x1cd01a?.['addEventListener']('abort',()=>{this['_updateContentPartsPromiseQueue']['abort']();}),this['_updateContentPartsPromiseQueue']['queueEmptyPromise'];}['updatePartState'](_0x16e373,_0x10b06c){const _0x5331ec=this['getPartView'](_0x16e373);_0x5331ec&&(_0x5331ec['state']=_0x10b06c),this['hasPendingParts']='pending'==_0x10b06c||Array['from'](this['_children'])['some'](_0x598bff=>'pending'==_0x598bff['state']);}['setPartActive'](_0xf24ffc,_0x579400){if(!0x1===_0xf24ffc){for(const _0x39a730 of this['_children'])_0x39a730['isActive']=!0x1;}else{const _0x367fa0=this['getPartView'](_0xf24ffc);_0x367fa0&&(_0x367fa0['isActive']=_0x579400);}}['updateSources'](_0x7ab9fb){_0x7ab9fb['forEach'](_0x2a5811=>this['_sourcesView']['addSource'](_0x2a5811)),this['_sourcesView']['isVisible']=!0x0;}['getPartView'](_0x24a8d0){return this['_children']['find'](_0x4f4233=>_0x4f4233['partDefinition']['index']==_0x24a8d0)??null;}['markAsDone'](){if(!this['_showUnchangedParts']){const _0xe57278=!this['_cachedContentParts']['find'](({hasChanges:_0x427716})=>_0x427716),_0x56911e=!!this['_cachedContentParts']['find'](({hasChanges:_0x2ed2a4})=>!_0x2ed2a4);this['_emptyPartsWarningView']['isVisible']=0x0==this['_children']['length']||_0x56911e,_0xe57278?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'](_0x1885bf=>_0x1885bf['markAsDone']()),this['_actionsView']['updateVisibility'](this['hasNonEmptyParts']);}get['hasNonEmptyParts'](){return this['_children']['filter'](_0x5b6e29=>_0x5b6e29['partDefinition']['hasChanges'])['length']>0x0;}}class On extends vt{['bodyView'];['children'];['headerView'];constructor(_0x24aa1d,_0x40373a,_0x491cee){super(_0x24aa1d);const {showDiff:_0x53206d,areActionsDisabled:_0x50ab51,showUnchangedParts:_0x46708c,availableActions:_0x2e5912}=_0x40373a;this['set']('isTrackChangesOn',!0x1),this['set']('areChangesVisible',!0x1),this['children']=this['createCollection'](),this['headerView']=new ln(_0x24aa1d,{'showDiff':_0x53206d}),this['headerView']['on']('toggleShowChanges',(_0x22bd6e,_0x2cdc00)=>{this['areChangesVisible']=_0x2cdc00['isOn'],this['fire']('toggleSuggestionDisplayMode',{'showDiff':_0x2cdc00['isOn']});}),this['children']['add'](this['headerView']),this['bodyView']=new Rn(_0x24aa1d,{'areActionsDisabled':_0x50ab51,'showUnchangedParts':!!_0x46708c,'availableActions':_0x2e5912,'bodyCollection':_0x491cee}),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'](_0x4222a9){await this['bodyView']['updateContentParts'](_0x4222a9);}['updateSources'](_0x4bcf15){this['bodyView']['updateSources'](_0x4bcf15);}['markAsDone'](){this['bodyView']['markAsDone'](),this['headerView']&&(this['headerView']['isShowChangesToggleVisible']=this['bodyView']['hasNonEmptyParts']);}}class kn extends cn{['containerView'];constructor(_0xc63491,_0x361b70,_0x595391){super(_0x361b70),this['set']('isTrackChangesOn',!0x1),this['containerView']=new On(_0xc63491,{'showDiff':_0x361b70['showDiff'],'areActionsDisabled':_0x361b70['areActionsDisabled'],'availableActions':_0x361b70['availableActions']},_0x595391),this['containerView']['on']('toggleSuggestionDisplayMode',(_0x58d754,_0x2676d4)=>{this['fire']('toggleSuggestionDisplayMode',{'replyId':this['options']['id'],'showDiff':_0x2676d4['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',(_0x3f053f,{index:_0x20b666})=>{this['fire']('showChangeInText',{'replyId':this['options']['id'],'partIndex':_0x20b666});}),this['containerView']['on']('applySuggestion',(_0x46140b,{index:_0x5619a0}={})=>{this['fire']('applySuggestion',{'replyId':this['options']['id'],'partIndex':_0x5619a0});}),this['containerView']['on']('insertSuggestion',(_0x3d6c5f,{index:_0x441bc1}={})=>{this['fire']('insertSuggestion',{'replyId':this['options']['id'],'partIndex':_0x441bc1});}),this['containerView']['on']('rejectSuggestion',(_0x401bb2,{index:_0x385478})=>{this['fire']('rejectSuggestion',{'replyId':this['options']['id'],'partIndex':_0x385478});}),this['containerView']['on']('mouseOverSuggestion',(_0x28961e,{index:_0xfbe6f7})=>{this['fire']('mouseOverSuggestion',{'replyId':this['options']['id'],'partIndex':_0xfbe6f7});}),this['containerView']['on']('mouseLeaveSuggestion',(_0x1587b2,{index:_0x3a1d5d})=>{this['fire']('mouseLeaveSuggestion',{'replyId':this['options']['id'],'partIndex':_0x3a1d5d});}),this['children']['addMany']([this['containerView']]),this['extendTemplate']({'attributes':{'class':['ck-ai-chat__feed__ai-suggestion']}});}async['updateContent'](_0x43c3f5){await this['containerView']['updateContent'](_0x43c3f5);}['updatePartState'](_0x1f964f,_0x1e0d18){this['containerView']['bodyView']['updatePartState'](_0x1f964f,_0x1e0d18);}['setPartActive'](_0x24f60f,_0x50c809){!0x1===_0x24f60f?this['containerView']['bodyView']['setPartActive'](!0x1):this['containerView']['bodyView']['setPartActive'](_0x24f60f,_0x50c809);}['updateSources'](_0x5bdb59){this['containerView']['updateSources'](_0x5bdb59);}['getPartView'](_0x10f0fc){return this['containerView']['bodyView']['getPartView'](_0x10f0fc);}['markAsDone'](){super['markAsDone'](),this['containerView']['markAsDone']();}}class Nn extends cn{['replyContainer'];['_bodyCollection'];constructor(_0x1685aa,_0x130094,_0x34b2fc){super(_0x130094),this['_bodyCollection']=_0x34b2fc,this['locale']=_0x1685aa,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:_0x133c2d,renderingStrategy:_0x1aa5f8,abortSignal:_0x2b8a61}){'streaming'===_0x1aa5f8?await this['streamIntoElement'](_0x133c2d,this['replyContainer']['element'],_0x2b8a61):this['replyContainer']['element']['innerHTML']=_0x2dfbe5(_0x133c2d);}['updateSources'](_0x81460d){const _0x5e4ac0=new Sn(this['locale'],this['_bodyCollection']);_0x5e4ac0['children']['addMany'](_0x81460d['map'](_0x345e9d=>new bn(this['locale'],_0x345e9d,_0x5e4ac0['balloonPanelView']))),_0x5e4ac0['isVisible']=!0x0,this['children']['add'](_0x5e4ac0);}}class vn extends yt{constructor(_0x14c2f7=void 0x0){super();const _0x5c3e70=_0x14c2f7?'ck-ai-spinner_'+_0x14c2f7:'';this['extendTemplate']({'tag':'span','attributes':{'class':['ck-ai-spinner',_0x5c3e70]}});}}const yn={'file':_0xc3480b,'document':_0x4fd116,'web-resource':_0xe48f7a,'text':_0xc3480b,'selection':_0x407f83,'mcp-tool-context':_0x4fd116},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(_0x4a8664,_0x407087,_0x3ad70a,_0x2167da,_0x4ecd8d=!0x1){super(_0x4a8664),this['_isAnimationOnEnterEnabled']=_0x2167da,this['_initializeProperties'](_0x407087,_0x3ad70a,_0x4ecd8d),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'](_0x3c4159,_0x26fbc9,_0x32aa63){this['set']('label',_0x3c4159['label']),this['set']('tooltip',!0x0),this['set']('itemType',_0x3c4159['type']),this['set']('id',_0x3c4159['uiId']),this['set']('readonly',_0x26fbc9),this['set']('isLoading',_0x32aa63);}['_setupTemplate'](){const _0x596188=this['_createIconView'](),_0x55b42c=this['_createRemoveButton'](),_0x27864b=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':this['_createTemplateAttributes'](_0x27864b),'children':this['_createTemplateChildren'](_0x596188,_0x55b42c,_0x27864b)});}['_createTemplateAttributes'](_0x15084e){return{'class':[xn,_0x15084e['if']('itemType',Dn,_0x153fb7=>'document'==_0x153fb7),_0x15084e['if']('itemType',Ln,_0x2b4ae3=>'selection'==_0x2b4ae3)],'data-cke-tooltip-text':_0x15084e['to']('label',Bn),'data-cke-tooltip-position':Un,'data-cke-tooltip-class':Mn};}['_createTemplateChildren'](_0x266a3d,_0x50ec5e,_0x4e2cfe){const _0x773439=this['_createLabelElement'](_0x4e2cfe),_0x573559=this['_createLoaderIcon']();return this['readonly']?[_0x266a3d,_0x773439]:[_0x266a3d,_0x573559,_0x773439,_0x50ec5e];}['_createLabelElement'](_0x809624){return{'tag':'span','attributes':{'class':Pn},'children':[{'text':_0x809624['to']('label')}]};}['_createRemoveButton'](){const _0x421065=new Nt(this['locale']);return _0x421065['set']({'label':us(this['locale'],'AI_CHAT_CONTEXT_REMOVE_FROM_CONTEXT'),'icon':_0x18d7ee}),this['_setupRemoveButtonEvent'](_0x421065),_0x421065;}['_setupRemoveButtonEvent'](_0x10d6b4){_0x10d6b4['on']('execute',()=>{this['fire']('removeContextItemChip',this['id']);});}['_createIconView'](){const _0x58e62f=this['bindTemplate'],_0x4438b7=new xt();return _0x4438b7['content']=yn[this['itemType']],_0x4438b7['extendTemplate']({'attributes':{'class':[Hn,_0x58e62f['if']('isLoading','ck-hidden',_0x28b12b=>_0x28b12b)]}}),_0x4438b7;}['_handleAnimationEndOnce'](_0x4f9f58,_0x3f545d){if(!_0x4f9f58)return;const _0x59b136=()=>{_0x3f545d(),_0x4f9f58['removeEventListener']('animationend',_0x59b136),_0x4f9f58['removeEventListener']('webkitAnimationEnd',_0x59b136);};_0x4f9f58['addEventListener']('animationend',_0x59b136),_0x4f9f58['addEventListener']('webkitAnimationEnd',_0x59b136);}['_createLoaderIcon'](){const _0x4fe60f=new vn('small');return _0x4fe60f['bind']('isVisible')['to'](this,'isLoading',_0x1d0944=>_0x1d0944),_0x4fe60f;}}function Bn(_0x434d07){if(!_0x434d07)return _0x434d07;if(_0x434d07['length']<=0x78)return _0x434d07;const _0x8b72bc=_0x434d07['slice'](0x0,0x78),_0x2d5217=_0x8b72bc['lastIndexOf']('\x20');return(_0x2d5217>0x0?_0x8b72bc['slice'](0x0,_0x2d5217):_0x8b72bc)+'…';}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(_0x4f276d,_0x52c221,_0xf28732,_0x56ae42,_0xc945ee){this['_locale']=_0x4f276d,this['_visibleChips']=_0x52c221,this['_config']={...Gn,..._0xf28732,'cssClasses':{'controlsButton':'','calculationContainer':'ck-calculation-container',..._0xf28732['cssClasses']}},this['_overflowChips']=new _t(),this['_bodyCollection']=_0x56ae42,this['_parentView']=_0xc945ee||null;}['setContainerElement'](_0x379f13){this['_intersectionObserver']&&(this['_intersectionObserver']['disconnect'](),this['_intersectionObserver']=null),this['_containerElement']=_0x379f13,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 _0xe3c307=[...this['_visibleChips'],...this['_overflowChips']],_0x4077bd=this['_createCalculationContainer'](),_0x2e8e49=this['_calculateOverflowInContainer'](_0x4077bd,_0xe3c307),_0x34bd43=_0x4077bd['_ancestorsToRestore'];_0x34bd43&&this['_restoreAncestorVisibility'](_0x34bd43),_0x4077bd['remove'](),this['_applyOverflowResults'](_0xe3c307,_0x2e8e49);}['_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 _0xa7555d=new Nt(this['_locale']);_0xa7555d['set']({'label':'','withText':!0x0,'isToggleable':!0x0});const _0x1910aa=[this['_config']['cssClasses']['showMoreButton']];return this['_config']['cssClasses']['controlsButton']&&_0x1910aa['push'](this['_config']['cssClasses']['controlsButton']),_0xa7555d['extendTemplate']({'attributes':{'class':_0x1910aa}}),_0xa7555d;}['_createShowMoreBalloonPanelView'](){const _0x4b047e=new Xt(this['_locale']);return _0x4b047e['extendTemplate']({'attributes':{'class':this['_config']['cssClasses']['showMoreBalloon']}}),this['_bodyCollection']['add'](_0x4b047e),_0x4b047e;}['_updateBalloonContent'](){if(this['_showMoreBalloonPanelView']&&(this['_showMoreBalloonPanelView']['content']['clear'](),this['_overflowChips']['length']>0x0)){this['_overflowChips']['forEach'](_0x572f52=>{_0x572f52['disableAnimationOnEnter']();});const _0x3eb225=new vt(this['_locale']);_0x3eb225['setTemplate']({'tag':'div','attributes':{'class':this['_config']['cssClasses']['overflowContainer']},'children':this['_overflowChips']}),this['_showMoreBalloonPanelView']['content']['add'](_0x3eb225);}}['_handleShowMoreButtonClick'](){this['_showMoreButtonView']['isOn']?this['hideBalloonPanel']():this['showBalloonPanel']();}['_updateShowMoreButtonVisibility'](){const _0x4a735f=this['_overflowChips']['length']>0x0;this['_showMoreButtonView']?.['element']&&(this['_showMoreButtonView']['element']['style']['display']=_0x4a735f?'':'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'](_0x47fecf){const _0x39bce6=this['_containerElement']?.['tagName']['toLowerCase']()||'div',_0x5ca74a=this['_containerElement']?.['classList'];if(_0x5ca74a){const _0x358f0d=_0x5ca74a[0x0]||'',_0x5c9015=_0x47fecf['querySelector']('.'+_0x358f0d),_0x150235=_0x47fecf['querySelector'](_0x39bce6);return _0x5c9015||_0x150235||_0x47fecf;}return _0x47fecf['querySelector'](_0x39bce6)||_0x47fecf;}['_calculateContainerWidth'](){const _0x3c6f0e=this['_parentView']?.['element']||this['_containerElement'];if(!_0x3c6f0e)return Fn;const _0x3fcde2=window['getComputedStyle'](_0x3c6f0e)['width'];if('auto'===_0x3fcde2||'0px'===_0x3fcde2||!_0x3fcde2){const _0x489759=_0x3c6f0e['parentElement'];if(_0x489759){const _0x6dac16=window['getComputedStyle'](_0x489759);return'auto'!==_0x6dac16['width']?_0x6dac16['width']:Fn;}return Fn;}return _0x3fcde2;}['_applyCalculationStyles'](_0x46bdc4,_0x154366){this['_config']['cssClasses']['calculationContainer']&&_0x46bdc4['classList']['add'](this['_config']['cssClasses']['calculationContainer']),_0x46bdc4['style']['width']=_0x154366,_0x46bdc4['style']['position']='absolute',_0x46bdc4['style']['top']='-9999px',_0x46bdc4['style']['left']='-9999px',_0x46bdc4['style']['opacity']='0',_0x46bdc4['style']['pointerEvents']='none',_0x46bdc4['style']['zIndex']='-1',_0x46bdc4['style']['visibility']='visible\x20!important',_0x46bdc4['style']['display']='block\x20!important',_0x46bdc4['style']['boxSizing']='border-box';}['_restoreAncestorVisibility'](_0xa2e22e){_0xa2e22e['forEach'](({element:_0x519935,originalDisplay:_0x10e86a,originalVisibility:_0x1349b1})=>{_0x519935['style']['display']=_0x10e86a,_0x519935['style']['visibility']=_0x1349b1;});}['_makeAncestorsVisible'](_0x5533ff){const _0x5a4b22=[];let _0x126009=_0x5533ff;for(;_0x126009&&_0x126009!==document['body'];){const _0x1e5cbd=window['getComputedStyle'](_0x126009);'none'!==_0x1e5cbd['display']&&'hidden'!==_0x1e5cbd['visibility']||(_0x5a4b22['push']({'element':_0x126009,'originalDisplay':_0x126009['style']['display'],'originalVisibility':_0x126009['style']['visibility']}),_0x126009['style']['display']='block',_0x126009['style']['visibility']='visible'),_0x126009=_0x126009['parentElement'];}return _0x5a4b22;}['_createContainerElements'](){let _0x1514d6,_0xde0ff8;return this['_parentView']?.['element']?(_0x1514d6=this['_parentView']['element']['cloneNode'](!0x0),_0xde0ff8=this['_findTargetContainer'](_0x1514d6)):(_0x1514d6=document['createElement']('div'),_0xde0ff8=_0x1514d6),{'calculationContainer':_0x1514d6,'targetContainer':_0xde0ff8};}['_createCalculationContainer'](){const {calculationContainer:_0x5063b5,targetContainer:_0x5c53b7}=this['_createContainerElements'](),_0x21e3bf=this['_calculateContainerWidth']();this['_applyCalculationStyles'](_0x5063b5,_0x21e3bf);const _0x23d04d=this['_parentView']?.['element']||this['_containerElement'],_0x4eece7=_0x23d04d?.['parentElement'];_0x4eece7?_0x4eece7['appendChild'](_0x5063b5):document['body']['appendChild'](_0x5063b5),_0x5063b5['_targetContainer']=_0x5c53b7;const _0x1fd64e=this['_makeAncestorsVisible'](_0x4eece7||null);return _0x5063b5['offsetWidth'],_0x5063b5['_ancestorsToRestore']=_0x1fd64e,_0x5063b5;}['_calculateOverflowInContainer'](_0x10d764,_0x4174da){const _0x55d4f8=_0x10d764['_targetContainer']||_0x10d764,_0x18bba4=[],{rowCount:_0x7d9d4b}=this['_renderChipsAndCountRows'](_0x55d4f8,_0x4174da);if(_0x7d9d4b<=this['_config']['maxVisibleRows'])return _0x18bba4;const _0x1de7b4=_0x4174da['slice']();for(;_0x1de7b4['length']>0x0;){if(this['_testButtonFit'](_0x10d764,_0x55d4f8,_0x1de7b4)){const _0x7bfee9=_0x4174da['filter'](_0x9f56=>!_0x1de7b4['includes'](_0x9f56));_0x18bba4['push'](..._0x7bfee9);break;}if(!_0x1de7b4['pop']())break;}return _0x18bba4;}['_renderChipsAndCountRows'](_0x1dae8a,_0x4b1aee){_0x1dae8a['innerHTML']='',_0x4b1aee['forEach'](_0x36969a=>{if(_0x36969a['element']){const _0xa71199=_0x36969a['element']['cloneNode'](!0x0);_0x1dae8a['appendChild'](_0xa71199);}}),_0x1dae8a['offsetWidth'];const _0x126c25=_0x1dae8a['children'],_0x414756=[];return Array['from'](_0x126c25)['forEach'](_0x2eb5c1=>{const _0x370550=_0x2eb5c1['getBoundingClientRect']()['top'];_0x414756['some'](_0x5171d2=>Math['abs'](_0x5171d2-_0x370550)<this['_config']['rowDetectionTolerance'])||_0x414756['push'](_0x370550);}),{'rowCount':_0x414756['length']};}['_createMockButton'](){const _0x595ef2=document['createElement']('button');return _0x595ef2['className']=this['_config']['cssClasses']['showMoreButton'],this['_config']['cssClasses']['controlsButton']&&_0x595ef2['classList']['add'](this['_config']['cssClasses']['controlsButton']),_0x595ef2['textContent']='+\x201',_0x595ef2;}['_testButtonFit'](_0x494be,_0x337c1e,_0x426b40){this['_renderChipsAndCountRows'](_0x337c1e,_0x426b40);const _0x55a2ae=this['_createMockButton']();_0x494be['appendChild'](_0x55a2ae),_0x494be['offsetWidth'];const _0xd22832=[..._0x337c1e['children'],_0x55a2ae],_0x3cdfbc=[];_0xd22832['forEach'](_0x543b00=>{const _0x57e4bc=_0x543b00['getBoundingClientRect']()['top'];_0x3cdfbc['some'](_0xefb896=>Math['abs'](_0xefb896-_0x57e4bc)<this['_config']['rowDetectionTolerance'])||_0x3cdfbc['push'](_0x57e4bc);});const _0x169eb9=_0x3cdfbc['length'];return _0x55a2ae['remove'](),_0x169eb9<=this['_config']['maxVisibleRows'];}['_distributeChips'](_0x233642,_0x4de6ce){this['_visibleChips']['clear'](),this['_overflowChips']['clear'](),_0x233642['forEach'](_0x3957ee=>{_0x4de6ce['includes'](_0x3957ee)?this['_overflowChips']['add'](_0x3957ee):this['_visibleChips']['add'](_0x3957ee);});}['_updateOverflowUI'](_0x20eb6c){if(_0x20eb6c>0x0&&!this['_showMoreButtonView']&&this['_createShowMoreButton'](),_0x20eb6c>0x0&&this['_showMoreButtonView']){const _0x5047b8=''+this['_config']['showMoreLabelPrefix']+(_0x20eb6c<0x63?_0x20eb6c:'99');this['_showMoreButtonView']['label']=_0x5047b8;}this['_updateBalloonContent'](),this['_updateShowMoreButtonVisibility'](),this['_repinBalloonPanel']();}['_applyOverflowResults'](_0x500d16,_0x53d523){this['_distributeChips'](_0x500d16,_0x53d523),this['_updateOverflowUI'](_0x53d523['length']);}['_setupVisibilityObserver'](){this['_containerElement']&&'undefined'!=typeof IntersectionObserver&&(this['_intersectionObserver']=new IntersectionObserver(_0x59272c=>{_0x59272c[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 _0x4e634b=this['_containerElement']['getBoundingClientRect']();if(0x0===_0x4e634b['width']||0x0===_0x4e634b['height'])return!0x1;const _0x3df827=window['innerHeight']||document['documentElement']['clientHeight'],_0x550150=window['innerWidth']||document['documentElement']['clientWidth'],_0x4f8a6c=0xc8;return _0x4e634b['bottom']>=-0xc8&&_0x4e634b['top']<=_0x3df827+_0x4f8a6c&&_0x4e634b['right']>=-0xc8&&_0x4e634b['left']<=_0x550150+_0x4f8a6c;}}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(_0x165d73,_0x26a285,_0x3400ea){super(_0x165d73),this['_bodyCollection']=_0x3400ea,this['_createContextChips'](_0x26a285);const _0x34ed66={'cssClasses':{'showMoreButton':Qn+'\x20'+As,'showMoreBalloon':Xn,'overflowContainer':$n,'controlsButton':qn}};this['_overflowManager']=new Kn(_0x165d73,this['_contextChips'],_0x34ed66,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 _0x50943b=this['element']['querySelector']('.'+Yn);_0x50943b&&(this['_overflowManager']['setContainerElement'](_0x50943b),this['_overflowManager']['reorganizeChips']());}['destroy'](){super['destroy'](),this['_overflowManager']['destroy']();}['_createContextChips'](_0x4aee97){for(const _0x52db66 of _0x4aee97){const _0x1360ad=new Vn(this['locale'],_0x52db66,!0x0,!0x1);this['_contextChips']['add'](_0x1360ad);}}}class jn extends cn{['_contextChipsView']=null;['_locale'];['_bodyCollection'];['_messageContentView'];constructor(_0x370370,_0x39597c,_0x2c10df){super(_0x39597c),this['_locale']=_0x370370,this['_bodyCollection']=_0x2c10df,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'](_0x62eb4a=>!_0x62eb4a['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(_0x1bb1d2,_0x527ff1){super(_0x527ff1);const {isWebSearchEnabled:_0x468739,isReasoningEnabled:_0x20b03d}=_0x527ff1['capabilities'],_0x4a8b34=[];let _0x49d507='';_0x468739&&_0x20b03d?(_0x49d507=us(_0x1bb1d2,'AI_CHAT_FEED_REPLY_ITEM_USED_WEB_SEARCH_REASONING'),_0x4a8b34['push'](Zn(_0x5c5297)),_0x4a8b34['push'](Zn(_0x2c0a2e))):_0x468739?(_0x49d507=us(_0x1bb1d2,'AI_CHAT_FEED_REPLY_ITEM_USED_WEB_SEARCH'),_0x4a8b34['push'](Zn(_0x5c5297))):_0x20b03d&&(_0x49d507=us(_0x1bb1d2,'AI_CHAT_FEED_REPLY_ITEM_USED_REASONING'),_0x4a8b34['push'](Zn(_0x2c0a2e))),this['extendTemplate']({'attributes':{'class':['ck-ai-chat__feed__interaction-header',_0x49d507?'':'ck-hidden']}});const _0x551c0b=new vt();_0x551c0b['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed__interaction-header__capabilities']},'children':[..._0x4a8b34,{'tag':'span','attributes':{'class':['ck-ai-chat__feed__interaction-header__capabilities__text']},'children':[_0x49d507]}]}),this['children']['add'](_0x551c0b),this['capabilities']=_0x527ff1['capabilities'];}}function Zn(_0xee6055){const _0x3bd41c=new xt();return _0x3bd41c['content']=_0xee6055,_0x3bd41c;}const tr=['wheel','touchstart','pointerdown','keydown'],er=['ArrowUp','ArrowDown','PageUp','PageDown','Home','End','\x20'];class ir{['element'];['animationFrameId'];['isRunning'];['abortController'];['isUserPaused'];constructor(_0x2cffb9){this['element']=_0x2cffb9,this['animationFrameId']=null,this['isRunning']=!0x1,this['abortController']=new AbortController(),this['isUserPaused']=!0x1;for(const _0x35d8c1 of tr){const _0x60e397='keydown'!==_0x35d8c1;this['element']['addEventListener'](_0x35d8c1,this['_onUserEvent']['bind'](this),{'passive':_0x60e397,'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'](_0xbd1011){if(this['isRunning']){if('keydown'===_0xbd1011['type']){const _0x45fbf9=_0xbd1011['key'];if(!er['includes'](_0x45fbf9))return;}_0xbd1011 instanceof WheelEvent?_0xbd1011['deltaY']<0x0?this['isUserPaused']=!0x0:this['isUserPaused']=!this['_isAtBottom']():this['isUserPaused']=!0x0;}}['_isAtBottom'](){const {scrollTop:_0xc33f76,scrollHeight:_0x108051,clientHeight:_0xc770db}=this['element'];return _0x108051-_0xc33f76-_0xc770db<=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(_0x453d0f,_0x7f55bb){super(_0x453d0f),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-skeleton']},'children':this['_createSkeletonItems'](_0x7f55bb)});}['_createSkeletonItems'](_0x49a7fa){const _0x316941=['ck','ck-ai-skeleton__item'];return _0x49a7fa['map'](_0x42cdc1=>{let _0x35ff39='';switch(_0x42cdc1['attributes']['align']){case'right':_0x35ff39='margin-left:\x20auto;\x20margin-right:\x200;\x20text-align:\x20right;';break;case'center':_0x35ff39='margin-left:\x20auto;\x20margin-right:\x20auto;\x20text-align:\x20center;';break;case'left':_0x35ff39='margin-left:\x200;\x20margin-right:\x20auto;\x20text-align:\x20left;';}return{'tag':_0x42cdc1['tag'],'attributes':{'class':[..._0x316941,_0x42cdc1['attributes']['class']?_0x42cdc1['attributes']['class']:''],'style':'width:\x20'+_0x42cdc1['attributes']['width']+';\x20height:\x20'+_0x42cdc1['attributes']['height']+';'+_0x35ff39}};});}}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(_0x1d3369,_0x18d365,_0x276fa6,_0x39e451){return new Array(_0x1d3369)['fill'](null)['map'](()=>({'tag':'div','attributes':{'width':_0x18d365,'height':_0x276fa6,'align':_0x39e451}}));}class ar extends cn{constructor(_0xd4c6c9){super(_0xd4c6c9),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(_0x486591,_0x4633e1){super(_0x486591),this['_bodyCollection']=_0x4633e1,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'](_0x4dd649,_0x2f703a){let _0xb31578;return'ai-reply'===_0x4dd649?_0xb31578=new Nn(this['locale'],_0x2f703a,this['_bodyCollection']):'ai-suggestion-reply'===_0x4dd649?(_0xb31578=new kn(this['locale'],_0x2f703a,this['_bodyCollection']),_0xb31578['bind']('isTrackChangesOn')['to'](this)):_0xb31578='user-message'===_0x4dd649?new jn(this['locale'],_0x2f703a,this['_bodyCollection']):'interaction-header'===_0x4dd649?new Jn(this['locale'],_0x2f703a):'custom-element'===_0x4dd649?new ar(_0x2f703a):new Cn(_0x2f703a),this['children']['add'](_0xb31578),_0xb31578;}async['updateReplyItem']({id:_0x55f556,parsedContent:_0x11746f,renderingStrategy:_0x44d81e,abortSignal:_0x2aeb74}){const _0x4bc751=this['getItemById'](_0x55f556);if(!(_0x4bc751 instanceof Nn))throw new ht('ai-chat-feed-view-item-not-a-reply-item',null,{'itemView':_0x4bc751,'id':_0x55f556,'parsedContent':_0x11746f});await _0x4bc751['updateContent']({'parsedContent':_0x11746f,'renderingStrategy':_0x44d81e,'abortSignal':_0x2aeb74});}async['updateWebSources'](_0x540ff1,_0x26e4bb){const _0x5cdf97=this['getItemById'](_0x540ff1);if(_0x5cdf97 instanceof kn)_0x5cdf97['updateSources'](_0x26e4bb);else{if(!(_0x5cdf97 instanceof Nn))throw new ht('ai-chat-feed-view-item-not-a-suggestion-or-reply-item',null,{'itemView':_0x5cdf97,'id':_0x540ff1,'sources':_0x26e4bb});_0x5cdf97['updateSources'](_0x26e4bb);}}async['updateSuggestionItem']({id:_0x465f55,parts:_0x3e3a83,renderingStrategy:_0x361c51,abortSignal:_0x4b6a23}){const _0x4436fb=this['getItemById'](_0x465f55);if(!(_0x4436fb instanceof kn))throw new ht('ai-chat-feed-view-item-not-a-suggestion-item',null,{'itemView':_0x4436fb,'id':_0x465f55,'parts':_0x3e3a83});await _0x4436fb['updateContent']({'parts':_0x3e3a83,'renderingStrategy':_0x361c51,'abortSignal':_0x4b6a23});}['updateSuggestionPartState']({id:_0x15ddaf,index:_0x29c384,state:_0x36a90f}){const _0x471a90=this['getItemById'](_0x15ddaf);if(!(_0x471a90 instanceof kn))throw new ht('ai-chat-feed-view-item-not-a-suggestion-item',this,{'id':_0x15ddaf});_0x471a90['updatePartState'](_0x29c384,_0x36a90f);}['setSuggestionPartActive']({id:_0x4572c8,index:_0x2b67f6,isActive:_0x4cca4c}){const _0x1e80f6=this['getItemById'](_0x4572c8);if(!(_0x1e80f6 instanceof kn))throw new ht('ai-chat-feed-view-item-not-a-suggestion-item',this,{'id':_0x4572c8});this['children']['filter'](_0x388f24=>_0x388f24 instanceof kn)['forEach'](_0x4dff15=>{_0x4dff15['setPartActive'](!0x1);}),_0x1e80f6['setPartActive'](_0x2b67f6,_0x4cca4c);}['markItemAsDone'](_0x4d3885){this['getItemById'](_0x4d3885)['markAsDone']();}['getItemIds'](){return this['children']['map'](_0x300a70=>_0x300a70['options']['id']);}['removeItem'](_0x148b51){this['children']['remove'](this['getItemById'](_0x148b51));}['hasItem'](_0x342f62){return!!this['children']['find'](_0x38ec65=>_0x38ec65['options']['id']['includes'](_0x342f62));}['scrollToSuggestion'](_0x55452f,_0x390cc9){const _0x20b762=this['getItemById'](_0x55452f);if(!(_0x20b762 instanceof kn))return void Tt('ck-ai-chat-feed-view-scroll-to-suggestion-invalid-item',{'replyId':_0x55452f,'partIndex':_0x390cc9});const _0x4eaa9e=_0x20b762['getPartView'](_0x390cc9);_0x4eaa9e?ft(_0x4eaa9e['element'],0x14,this['element']['parentElement'],!0x0,!0x0):Tt('ck-ai-chat-feed-view-scroll-to-suggestion-part-view-not-found',{'replyId':_0x55452f,'partIndex':_0x390cc9});}['_setupTemplate'](){this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed']},'children':this['_createTemplateChildren']()});}['_createTemplateChildren'](){const _0x59d460=this['_createSkeletonLoader']();return[this['_createFeedItems'](),_0x59d460,this['_createFeedLoader']()];}['_createSkeletonLoader'](){const _0x2ea506=new sr(this['locale'],nr['aiFeed']);return _0x2ea506['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isLoadingSkeletonVisible','ck-hidden',_0xbe08f2=>!_0xbe08f2)]}}),_0x2ea506;}['_createFeedItems'](){const _0xa56dfd=new vt(this['locale']);return _0xa56dfd['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed__items',this['bindTemplate']['if']('isLoadingSkeletonVisible','ck-hidden')]},'children':this['children']}),_0xa56dfd;}['_createFeedLoader'](){const _0x178de5=new vt(this['locale']);return _0x178de5['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__loader',this['bindTemplate']['if']('isPending','ck-hidden',_0x5a5d6c=>!_0x5a5d6c)]},'children':this['_createLoaderChildren']()}),_0x178de5;}['_createLoaderChildren'](){const _0x53d07d=new vn();return _0x53d07d['isVisible']=!0x0,[_0x53d07d,{'tag':'span','attributes':{'class':['ck','ck-ai-chat__loader-text']},'children':[{'text':this['bindTemplate']['to']('loadingMessage')}]}];}['getItemById'](_0x2ed3f2){const _0x1ecdb2=this['children']['find'](_0x2e13b7=>_0x2e13b7['options']['id']['includes'](_0x2ed3f2));if(!_0x1ecdb2)throw new ht('ai-chat-feed-view-item-not-found',this,{'id':_0x2ed3f2});return _0x1ecdb2;}['setLoadingMessage'](_0x584f42){this['set']('loadingMessage',_0x584f42);}['toggleLoadingSkeleton'](_0x528c87){this['set']('isLoadingSkeletonVisible',_0x528c87);}['startAutoScroll'](){this['scrollManager']['start']();}['stopAutoScroll'](){this['scrollManager']['stop']();}}class hr extends Dt{['filter'](){let _0x283c7d=0x0;for(const _0x427fc0 of this['items'])_0x283c7d+=_0x427fc0['items']['length'];return{'resultsCount':_0x283c7d,'totalItemsCount':_0x283c7d};}}const cr='ck-ai-chat__prompt-input_highlighted';class lr extends Lt{['submitButtonView'];static ['MIN_ROWS']=0x1;static ['MAX_ROWS']=0xc;['_addContextButtonView'];['_queryViewResizeObserver'];constructor(_0x1eb61c,_0x57c359){super(_0x1eb61c,{'queryView':{'label':'','creator':Vt,'showIcon':!0x1,'showResetButton':!0x1},'filteredView':new hr(_0x1eb61c),'queryMinChars':0x1/0x0,'resetOnBlur':!0x1}),this['set']('isEmpty',!0x0),this['set']('isUploadInProgress',!0x1),this['_addContextButtonView']=_0x57c359,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',(_0x585e8c,_0x2899ef)=>!_0x585e8c&&!_0x2899ef),this['focusableChildren']['add'](this['submitButtonView']);}['render'](){super['render'](),this['queryView']['fieldWrapperChildren']['add'](this['submitButtonView']),this['keystrokes']['set']('enter',(_0x37354f,_0x5d9534)=>{this['isUploadInProgress']||this['isEmpty']||_0x37354f['target']==this['queryView']['fieldView']['element']&&(this['submit'](),_0x5d9534());}),this['queryView']['fieldView']['on']('update',()=>{this['isEmpty']=''===this['queryView']['fieldView']['element']['value']?.['trim']();});}['destroy'](){super['destroy'](),this['_queryViewResizeObserver']&&this['_queryViewResizeObserver']['destroy']();}['submit'](){const _0x100f79=this['queryView']['fieldView']['element']['value']?.['trim']();if(!_0x100f79)return this['queryView']['errorText']=us(this['locale'],'AI_CHAT_PROMPT_EMPTY_ERROR'),void(this['queryView']['fieldView']['hasError']=!0x0);this['queryView']['fieldView']['hasError']=!0x1;const _0xeb7465=_0x31dc1d(_0x100f79);this['fire']('sendUserMessage',_0xeb7465),this['queryView']['fieldView']['reset']();}['setPlaceholderText'](_0x5be3ff){this['queryView']['fieldView']['set']('placeholder',_0x5be3ff);}['focus'](_0x782233=!0x1){super['focus'](),_0x782233&&(this['element']['classList']['contains'](cr)||(this['element']['classList']['add'](cr),setTimeout(()=>{this['element']['classList']['remove'](cr);},0x320)));}['_createSubmitButton'](){const _0x1cea79=new Nt(this['locale']);return _0x1cea79['set']({'icon':_0x8a76b5,'label':us(this['locale'],'AI_CHAT_LABEL_SUBMIT'),'isVisible':!0x0,'tooltip':!0x0,'class':'ck-ai-chat__prompt-submit-button\x20'+ds,'isEnabled':!0x1}),_0x1cea79['on']('execute',()=>{this['submit']();}),_0x1cea79;}['setIsUploadInProgress'](_0x4f3603){this['isUploadInProgress']=_0x4f3603;}['_setUpAddContextButtonPositioning'](){const _0x5259fe=this['locale'],_0x129a21=()=>{lt['window']['requestAnimationFrame'](()=>{if(ut(this['element'])){const _0x1a3fc4=new dt(this['queryView']['fieldView']['element']),_0x1752dd=new dt(this['_addContextButtonView']['element']),_0x2d3694=_0x1a3fc4['width'],_0x1624d5='rtl'===_0x5259fe['uiLanguageDirection']?'right':'left';_0x1a3fc4['excludeScrollbarsAndBorders']();const _0x1388c9=_0x2d3694-_0x1a3fc4['width']+0x1;this['_addContextButtonView']['element']['style'][_0x1624d5]='calc('+(_0x2d3694-_0x1752dd['width']-_0x1388c9)+'px\x20-\x20var(--ck-spacing-tiny))';}});};this['queryView']['fieldView']['on']('update',_0x129a21),this['on']('render',()=>{_0x129a21(),this['_queryViewResizeObserver']=new St(this['queryView']['fieldView']['element'],()=>{_0x129a21();});});}}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(_0x3b0464){super(_0x3b0464),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',_0x35c5bb=>'selector'===_0x35c5bb),this['_modelSelectionDropdown']['buttonView']['bind']('tooltip')['to'](this,'modelSelectorEnabled',_0x139828=>_0x139828?this['_modelSelectionDropdown']['buttonView']['label']:us(this['locale'],'AI_CHAT_MODEL_SELECTOR_DISABLED_TOOLTIP')),this['_modelSelectionDropdown']['bind']('isEnabled')['to'](this,'modelSelectorEnabled',_0x96dc06=>_0x96dc06),this['_webSearchButton']['bind']('isOn')['to'](this,'webSearchActive',_0x3a737f=>_0x3a737f),this['_webSearchButton']['bind']('tooltip')['to'](this,'webSearchActive',_0x2a6390=>us(this['locale'],_0x2a6390?'AI_CHAT_DISABLE_WEB_SEARCH':'AI_CHAT_ENABLE_WEB_SEARCH')),this['_reasoningButton']['bind']('isOn')['to'](this,'reasoningActive',_0x1d5e6f=>_0x1d5e6f),this['_reasoningButton']['bind']('tooltip')['to'](this,'reasoningActive',_0x3d9808=>us(this['locale'],_0x3d9808?'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'](_0x23c789,_0x5a23cb){if(_0x5a23cb)this['set']('modelDisplayMode','hidden');else{const _0x75996f=0x1===_0x23c789['length'];this['set']('modelDisplayMode',_0x75996f?'name':'selector');}if(this['_modelSelectionDropdownItems']['clear'](),_0x23c789?.['length'])for(const _0x2979ed of _0x23c789){const _0x31853d=new Jt({'label':_0x2979ed['name'],'withText':!0x0,'role':'menuitemradio','id':_0x2979ed['id'],'model':_0x2979ed});_0x31853d['bind']('isOn')['to'](this,'activeModelId',_0x22ecc8=>_0x22ecc8===_0x2979ed['id']),this['_modelSelectionDropdownItems']['add']({'type':'button','model':_0x31853d,'labelView':new mr(this['locale'],_0x2979ed)});}}['setWebSearch'](_0x909ad){this['set']('webSearchActive',_0x909ad);}['setReasoning'](_0x4155ab){this['set']('reasoningActive',_0x4155ab);}['setModel'](_0x33361c){if(!_0x33361c)return;this['activeModelId']=_0x33361c['id'],this['activeModelName']=_0x33361c['name']||_0x33361c['id'],this['_modelSelectionDropdown']['buttonView']['set']('label',_0x33361c['name']),this['_modelSelectionDropdown']['buttonView']['set']('tooltip',_0x33361c['name']);const _0x153526=_0x33361c['capabilities']['webSearch']?.['enabled']??!0x1;this['set']('webSearchActive',!0x1),this['_webSearchButton']['set']('isOn',!0x1),this['_webSearchButton']['set']('isEnabled',_0x153526),this['_webSearchButton']['set']('isVisible',_0x153526);const _0x1f8fa6=_0x33361c['capabilities']['reasoning']?.['enabled']??!0x1;this['set']('reasoningActive',!0x1),this['_reasoningButton']['set']('isOn',!0x1),this['_reasoningButton']['set']('isEnabled',_0x1f8fa6),this['_reasoningButton']['set']('isVisible',_0x1f8fa6);}['enableModelSelector'](){this['set']('modelSelectorEnabled',!0x0);}['disableModelSelector'](_0x2bdc20){this['set']('modelSelectorEnabled',!0x1),_0x2bdc20&&this['set']('modelDisplayMode','hidden');}['_createWebSearchButton'](){const _0x2039f4=new Nt();return _0x2039f4['set']({'label':us(this['locale'],'AI_CHAT_SEARCH_WEB'),'icon':_0x5c5297,'class':dr+'\x20'+As,'isToggleable':!0x0,'tooltipPosition':pr}),_0x2039f4['on']('execute',()=>{this['fire']('toggleWebSearch');}),_0x2039f4;}['_createReasoningButton'](){const _0x559398=new Nt();return _0x559398['set']({'label':us(this['locale'],'AI_CHAT_REASONING'),'icon':_0x2c0a2e,'class':dr+'\x20'+As,'isToggleable':!0x0,'tooltipPosition':pr}),_0x559398['on']('execute',()=>{this['fire']('toggleReasoning');}),_0x559398;}['_createCommandsButton'](){const _0x21a975=new Nt();return _0x21a975['set']({'label':us(this['locale'],'AI_CHAT_COMMANDS'),'icon':_0x2b87ea,'withText':!0x0,'class':dr+'\x20'+As,'isToggleable':!0x0,'tooltip':us(this['locale'],'AI_CHAT_COMMANDS'),'tooltipPosition':pr}),_0x21a975['extendTemplate']({'attributes':{'class':[_r]}}),_0x21a975['on']('execute',()=>{console['log']('Commands\x20are\x20not\x20implemented\x20yet.'),alert('Commands\x20are\x20not\x20implemented\x20yet.');}),_0x21a975;}['_createModelSelectionDropdown'](){const _0x343bf9=Gt(this['locale']);return _0x343bf9['set']({'panelPosition':'ne','class':[Ar]}),_0x343bf9['buttonView']['set']({'label':us(this['locale'],'AI_CHAT_MODEL_SELECTOR_ENABLED_TOOLTIP'),'withText':!0x0,'tooltip':!0x0,'tooltipPosition':pr,'class':As}),this['listenTo'](_0x343bf9,'execute',_0x1b2287=>{this['fire']('selectModel',_0x1b2287['source']['model']);}),_0x343bf9;}['_createModelNameView'](){const _0x431aa0=new Cr(this['locale']);return _0x431aa0['bind']('text')['to'](this,'activeModelName',_0x591e44=>_0x591e44??''),_0x431aa0['bind']('isVisible')['to'](this,'modelDisplayMode',_0x11daf9=>'name'===_0x11daf9),_0x431aa0;}}let mr=class extends Mt{constructor(_0x477e5d,_0x389988){super();const _0x2e0d1a=this['bindTemplate'],_0x42569d=this['createCollection']();this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-button__label'],'style':_0x2e0d1a['to']('style'),'id':_0x2e0d1a['to']('id')},'children':[{'tag':'div','attributes':{'class':[gr]},'children':[{'text':_0x2e0d1a['to']('text')}]},{'tag':'div','attributes':{'class':[Ir]},'children':[{'tag':'span','children':[{'text':_0x389988['description']}]}]},{'tag':'div','attributes':{'class':[Er]},'children':_0x42569d}]}),_0x42569d['addMany'](this['_getCapabilityParts'](_0x477e5d,_0x5c5297,'AI_CHAT_SEARCH_WEB',_0x389988['capabilities']['webSearch']?.['enabled']??!0x1)),_0x42569d['addMany'](this['_getCapabilityParts'](_0x477e5d,_0x2c0a2e,'AI_CHAT_REASONING',_0x389988['capabilities']['reasoning']?.['enabled']??!0x1));}['_getCapabilityParts'](_0x3fd5ad,_0x37707c,_0x4370a6,_0x5f4c0b){const _0x4c41b1=new xt();_0x4c41b1['content']=_0x37707c;const _0x290139=new vt(_0x3fd5ad);_0x290139['setTemplate']({'tag':'span','children':[{'text':us(_0x3fd5ad,_0x4370a6)+':\x20'}]});const _0x37ee97=new vt(_0x3fd5ad);return _0x37ee97['setTemplate']({'tag':'span','children':[{'text':us(_0x3fd5ad,_0x5f4c0b?'AI_CHAT_CAPABILITIES_YES':'AI_CHAT_CAPABILITIES_NO')}]}),[_0x4c41b1,_0x290139,_0x37ee97];}},Cr=class extends vt{constructor(_0x3c5a81){super(_0x3c5a81),this['set']('text',void 0x0),this['set']('isVisible',!0x0);const _0x1c4570=this['bindTemplate'];this['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai-chat-controls__model-name',_0x1c4570['if']('isVisible','ck-hidden',_0x3d9e60=>!_0x3d9e60)]},'children':[{'text':_0x1c4570['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(_0x300c23){super(_0x300c23),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'](_0x15661a=>{this['focusTracker']['add'](_0x15661a['element']),this['keystrokes']['listenTo'](_0x15661a['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'](_0x248373){this['urlInputField']['errorText']=_0x248373,this['_updateConfirmButtonState'](),this['fire']('refreshBalloon');}['clearError'](){this['urlInputField']['errorText']=null,this['_updateConfirmButtonState']();}['_createBackButton'](){const _0xa50289=new Nt(this['locale']);return _0xa50289['set']({'icon':_0x1654b8,'tooltip':us(this['locale'],'AI_CHAT_CONTEXT_URL_BACK_TO_CONTEXT'),'tooltipPosition':'n','class':['ck-button-icon\x20ck-button-back']}),this['on']('change:withBackButton',(_0x16032f,_0x40cb20,_0xe6c84e)=>{_0xa50289['set']({'class':['ck-button-icon\x20ck-button-back'+(_0xe6c84e?'':'\x20ck-hidden')]});}),_0xa50289;}['_createUrlInputField'](){const _0x3cf95b=new te(this['locale'],_0x13bbb8);return _0x3cf95b['set']({'label':us(this['locale'],'AI_CHAT_CONTEXT_URL_LABEL'),'class':'ck-labeled-field-view_empty'}),_0x3cf95b['fieldView']['set']({'placeholder':us(this['locale'],'AI_CHAT_CONTEXT_URL_PLACEHOLDER')}),_0x3cf95b;}['_createConfirmButton'](){const _0x5e4255=new Nt(this['locale']);return _0x5e4255['set']({'icon':_0x4dbbde,'tooltip':us(this['locale'],'AI_CHAT_CONTEXT_URL_ADD_URL'),'tooltipPosition':'n','class':'ck-button-icon','type':'submit','isEnabled':!0x1}),_0x5e4255;}['_setupTemplate'](){const _0x46510d=new _0x4c7c2c(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'});_0x46510d['children']['add'](this['backButton'],0x0),this['setTemplate']({'tag':'form','attributes':{'class':wr,'tabindex':'-1'},'children':[_0x46510d,{'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',_0x49d35e=>{_0x49d35e['stop'](),this['_handleSubmit']();});}['_setupKeystrokes'](){this['keystrokes']['set']('esc',(_0x5591c3,_0xb45e2)=>{this['clear'](),this['fire']('cancel'),_0xb45e2();});}['_handleSubmit'](){const _0x431541=this['getValue']()['trim']();_0x431541?this['_isValidUrl'](_0x431541)?(this['clearError'](),this['fire']('submitUrl',_0x431541)):this['setError'](us(this['locale'],'AI_CHAT_CONTEXT_URL_INVALID_ERROR')):this['setError'](us(this['locale'],'AI_CHAT_CONTEXT_URL_EMPTY_ERROR'));}['_updateConfirmButtonState'](){const _0x4d287a=this['getValue']()['trim'](),_0x4f2077=!!this['urlInputField']['errorText'];this['confirmButton']['isEnabled']=_0x4d287a['length']>0x0&&!_0x4f2077;}['_isValidUrl'](_0x3d5c6d){try{return!!new URL(_0x3d5c6d);}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(_0xfcc22e,_0x556651){super(_0xfcc22e),this['resource']=_0x556651,this['set']('isInContext',!!_0x556651['isInContext']),this['_titleView']=this['_createTitleView'](),this['_iconView']=this['_createIconView'](),this['_setupTemplate']();}['render'](){super['render']();}['getResourceIcon'](_0x83ed4e){if(_0x83ed4e['isInContext'])return _0x4dbbde;switch(_0x83ed4e['type']){case Us['DOCUMENT']:return _0x4fd116;case Us['URL']:return _0xe48f7a;case Us['FILE']:case Us['TEXT']:return _0xc3480b;default:return _0x5b0e49;}}['highlightText'](_0x201b3b){if(!_0x201b3b||''===_0x201b3b['trim']())return void this['_titleView']['highlightText'](null);const _0x4c629b=new RegExp(_0x1d8d0d(_0x201b3b),'gi');this['_titleView']['highlightText'](_0x4c629b);}['updateResourceState'](_0x5831a3){this['resource']['isInContext']=_0x5831a3,this['isInContext']=_0x5831a3,this['_updateIcon']();}['_createTitleView'](){const _0x1f9159=new _0x3faae3();return _0x1f9159['text']=this['resource']['label'],_0x1f9159['extendTemplate']({'tag':'span','attributes':{'class':[Or]}}),_0x1f9159;}['_createIconView'](){const _0xbfc4=new xt();return _0xbfc4['content']=this['getResourceIcon'](this['resource']),_0xbfc4;}['_setupTemplate'](){const _0x6b4c24=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':[br,_0x6b4c24['if']('isVisible','ck-hidden',_0x49331f=>!_0x49331f),_0x6b4c24['if']('isInContext',Rr)]},'children':[{'tag':'div','attributes':{'class':[kr]},'children':[this['_iconView']]},this['_titleView']],'on':{'click':_0x6b4c24['to']('execute')}});}['_updateIcon'](){this['_iconView']['content']=this['getResourceIcon'](this['resource']);}}const vr='ck-ai-chat-resources__list';class yr extends Dt{['_source'];constructor(_0x59205a,_0x3183d4){super(_0x59205a),this['_source']=_0x3183d4,this['extendTemplate']({'attributes':{'class':[vr]}});}['setResources'](_0x44187f,_0x3db900){this['items']['clear']();let _0x5b288e=_0x44187f;if(this['_source']['useDefaultFiltering']&&_0x3db900&&''!==_0x3db900['trim']()){const _0xd7639=new RegExp(_0x3db900['replace'](/[.*+?^${}()|[\]\\]/g,'\x5c$&'),'gi');_0x5b288e=_0x44187f['filter'](_0x24160c=>_0xd7639['test'](_0x24160c['label']));}for(const _0x1186ee of _0x5b288e){const _0x263663=new Nr(this['locale'],_0x1186ee);_0x263663['on']('execute',()=>{this['_handleResourceSelection'](this['_source'],_0x1186ee);}),this['items']['add'](_0x263663);}this['_source']['useDefaultFiltering']&&this['highlightText'](_0x3db900);}['highlightText'](_0x10bede){this['_source']['useDefaultFiltering']&&this['items']['forEach'](_0x4a8faa=>{_0x4a8faa['highlightText'](_0x10bede);});}['updateResourceState'](_0x4be8e9,_0x45dade){for(const _0x539ff1 of this['items']){const _0x55d365=_0x539ff1;_0x55d365['resource']['id']===_0x4be8e9&&_0x55d365['updateResourceState'](_0x45dade);}}['_handleResourceSelection'](_0x399661,_0x51b5d9){this['fire']('addResourceToContext',{'source':_0x399661,'resource':_0x51b5d9});}}class xr extends te{['iconView'];['resetButtonView'];['_viewConfig'];constructor(_0x1dbe05){const t=_0x1dbe05['t'],_0x9e68cf={'showResetButton':!0x0,'showIcon':!0x0,'creator':_0x13bbb8,'label':us(_0x1dbe05,'AI_CHAT_SEARCH_RESOURCES')};super(_0x1dbe05,_0x9e68cf['creator']),this['label']=_0x9e68cf['label'],this['_viewConfig']=_0x9e68cf,this['_viewConfig']['showIcon']&&this['_setupSearchIcon'](),this['_viewConfig']['showResetButton']&&this['_setupResetButton'](_0x1dbe05,t),this['_setupEventListeners']();}['reset'](){this['fieldView']['reset'](),this['_viewConfig']['showResetButton']&&this['resetButtonView']&&(this['resetButtonView']['isVisible']=!0x1),this['search']('');}['search'](_0xbf489b){this['fire']('search',_0xbf489b);}['getQuery'](){return this['fieldView']['element']?.['value']||'';}['_setupSearchIcon'](){this['iconView']=new xt(),this['iconView']['content']=_0x381212,this['fieldWrapperChildren']['add'](this['iconView'],0x0),this['extendTemplate']({'attributes':{'class':'ck-search__query_with-icon'}});}['_setupResetButton'](_0x30777e,t){this['resetButtonView']=new Nt(_0x30777e),this['resetButtonView']['set']({'label':t('Clear'),'icon':_0x2d333c,'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',_0x32367b=>!_0x32367b),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(_0x140822,_0x4aea21){super(_0x140822),this['_source']=_0x4aea21['source'],this['_searchInputVisibleFrom']=_0x4aea21['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 _0x2ebc1e([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 _0x415e03=new vt(this['locale']);return _0x415e03['setTemplate']({'tag':'div','attributes':{'class':'ck\x20ck-search'},'children':[this['_searchView']]}),this['_searchView']['on']('search',(_0x44c1d2,_0x3b9592)=>{this['loadResources'](_0x3b9592),this['_source']['useDefaultFiltering']&&this['_resourcesListView']['highlightText'](_0x3b9592);}),_0x415e03;}['_createResourcesListView'](){const _0x13832e=new yr(this['locale'],this['_source']);return _0x13832e['delegate']('addResourceToContext')['to'](this),_0x13832e['extendTemplate']({'attributes':{'class':this['bindTemplate']['if']('isLoading','ck-hidden')}}),_0x13832e;}['_createSkeletonView'](){const _0x1bcf27=new sr(this['locale'],nr['aiChatResources']);return _0x1bcf27['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isLoading','ck-hidden',_0x4df242=>!_0x4df242)]}}),_0x1bcf27;}['render'](){super['render'](),this['loadResources']('');}['loadResources'](_0x1beb2d){const _0x3862fd=ot();this['_latestLoadResourcesUid']=_0x3862fd,this['fire']('loadSourceResources',{'sourceId':this['_source']['id'],'query':_0x1beb2d,'uid':_0x3862fd}),this['isLoading']=!0x0;}['setResources'](_0x4e0cf7,_0x5ec3b3){if(_0x5ec3b3&&_0x5ec3b3!==this['_latestLoadResourcesUid'])return;const _0x5c5dcc=this['_source']['useDefaultFiltering']?this['_searchView']['getQuery']():'';this['_resourcesListView']['setResources'](_0x4e0cf7,_0x5c5dcc),_0x4e0cf7['length']>=this['_searchInputVisibleFrom']&&!this['children']['has'](this['_searchSection'])&&this['children']['add'](this['_searchSection'],0x0),requestAnimationFrame(()=>{this['isLoading']=!0x1;});}['updateResourceState'](_0x2d6cd1,_0x5c375a){this['_resourcesListView']['updateResourceState'](_0x2d6cd1,_0x5c375a);}}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(_0x1caaf8,_0xaadd58,_0x11698f){this['_locale']=_0x1caaf8,this['_bodyCollection']=_0xaadd58,this['_config']=_0x11698f;}['showSourceResourcesBalloon']({source:_0x1b3dba,withBackButton:_0x25a24a}){let _0x1f859d=this['_sourceResourceBalloons']['get'](_0x1b3dba['id']);_0x1f859d||(_0x1f859d=this['_createSourceResourceBalloonPanel'](),this['_sourceResourceBalloons']['set'](_0x1b3dba['id'],_0x1f859d),this['_setupSingleResourceBalloonClickOutsideHandler'](_0x1f859d)),this['_addSourceResourceContent']({'balloonPanel':_0x1f859d,'source':_0x1b3dba,'withBackButton':_0x25a24a}),_0x1f859d['show']();const _0x10aba7=this['_config']['getTargetElement']();_0x10aba7&&_0x1f859d['pin']({'target':_0x10aba7,'limiter':this['_config']['getLimiterElement']()});}['populateSourceResourceBalloon'](_0x332992,_0x3dbe5b,_0x24700a){const _0x46b5ba=this['_sourceResourceBalloons']['get'](_0x332992);if(!_0x46b5ba)return;const _0x5ab4d8=this['_getResourcesViewFromBalloon'](_0x46b5ba);_0x5ab4d8&&(_0x5ab4d8['setResources'](_0x3dbe5b,_0x24700a),_0x5ab4d8['once']('change:isLoading',()=>{_0x46b5ba['pin']({'target':this['_config']['getTargetElement'](),'limiter':this['_config']['getLimiterElement']()});}));}['closeSourceResourceBalloon'](_0x5ab253){const _0x4616a7=this['_sourceResourceBalloons']['get'](_0x5ab253);_0x4616a7&&requestAnimationFrame(()=>{_0x4616a7['hide'](),this['_sourceResourceBalloons']['delete'](_0x5ab253),this['_config']['onBalloonClosed']();});}['isAnyResourceBalloonVisible'](){for(const _0x5eca3b of this['_sourceResourceBalloons']['values']())if(_0x5eca3b['isVisible'])return!0x0;return!0x1;}['updateResourceState'](_0x2a5751,_0x4b9b2d,_0xc64d67){const _0x4da032=this['_sourceResourceBalloons']['get'](_0x2a5751);if(!_0x4da032||!_0x4da032['isVisible'])return;const _0x40e81b=this['_config']['getTargetElement']();if(!_0x40e81b)return;_0x4da032['pin']({'target':_0x40e81b,'limiter':this['_config']['getLimiterElement']()});const _0x33bd65=this['_getResourcesViewFromBalloon'](_0x4da032);_0x33bd65&&_0x33bd65['updateResourceState'](_0x4b9b2d,_0xc64d67);}['destroy'](){for(const _0x42b420 of this['_sourceResourceBalloons']['values']())_0x42b420['destroy']();this['_sourceResourceBalloons']['clear']();}['_createSourceResourceBalloonPanel'](){const _0x279e1=new Xt(this['_locale']);return _0x279e1['extendTemplate']({'attributes':{'class':Dr}}),this['_bodyCollection']['add'](_0x279e1),_0x279e1;}['_addSourceResourceContent']({balloonPanel:_0x1609c2,source:_0xb08ab5,withBackButton:_0x2de64a}){_0x1609c2['content']['clear']();const _0x50988b=this['_createBalloonHeader']({'balloonPanel':_0x1609c2,'source':_0xb08ab5,'withBackButton':_0x2de64a});_0x1609c2['content']['add'](_0x50988b);const _0x29dadf=this['_createBalloonResourcesView'](_0xb08ab5);_0x1609c2['content']['add'](_0x29dadf);}['_createBalloonHeader']({balloonPanel:_0x24dec9,source:_0x590af2,withBackButton:_0x225137}){const _0x33af4b=new _0x4c7c2c(this['_locale'],{'label':_0x590af2['label'],'class':Hr});return _0x225137&&_0x33af4b['children']['add'](this['_createBackButton'](_0x24dec9),0x0),_0x33af4b;}['_createBackButton'](_0x28e910){const _0x50104d=new Nt(this['_locale']);return _0x50104d['set']({'icon':_0x1654b8,'tooltip':us(this['_locale'],'AI_CHAT_CONTEXT_URL_BACK_TO_CONTEXT'),'tooltipPosition':'n','class':Pr}),_0x50104d['on']('execute',()=>{_0x28e910['hide'](),this['_config']['onBackToContext']();}),_0x50104d;}['_createBalloonResourcesView'](_0x54d35f){const _0x291634=new Lr(this['_locale'],{'source':_0x54d35f,'searchInputVisibleFrom':this['_config']['searchInputVisibleFrom']});return _0x291634['on']('loadSourceResources',(_0x781adf,_0x47d30b)=>{this['_config']['onLoadSourceResources'](_0x47d30b);}),_0x291634['on']('addResourceToContext',(_0x51cc65,_0x308bee)=>{this['_config']['onResourceSelected'](_0x308bee['source'],_0x308bee['resource']),this['closeSourceResourceBalloon'](_0x54d35f['id']);}),_0x291634;}['_getResourcesViewFromBalloon'](_0xb3d0e1){const _0x4c62b0=_0xb3d0e1['content']['get'](0x1);return _0x4c62b0 instanceof Lr?_0x4c62b0:null;}['_setupSingleResourceBalloonClickOutsideHandler'](_0x4194b7){zt({'emitter':_0x4194b7,'contextElements':[_0x4194b7['element']],'callback':()=>{_0x4194b7['hide'](),this['_config']['onBalloonClosed']();},'activator':()=>_0x4194b7['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(_0x375ae6,_0x3d328a){super(_0x375ae6),this['bodyCollection']=_0x3d328a['bodyCollection'],this['_currentContextsChips']=this['createCollection'](),this['_conversationContextsChips']=this['createCollection'](),this['addContextButtonView']=this['_createAddContextButtonView'](_0x375ae6),this['_addContextBalloonPanelView']=this['_createAddContextBalloonPanelView'](_0x375ae6),this['_urlBalloonPanelView']=this['_createUrlBalloonPanelView'](_0x375ae6),this['_resourcesBalloonView']=this['_createResourcesBalloonView'](_0x375ae6,_0x3d328a);const _0x511f98={'cssClasses':{'showMoreButton':Qr+'\x20'+As,'showMoreBalloon':Xr,'overflowContainer':qr,'controlsButton':$r}};this['_overflowManager']=new Kn(_0x375ae6,this['_currentContextsChips'],_0x511f98,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'](_0x515604,_0x25d353){const _0x42de99=this['_createContextButton'](_0x515604,'current',!0x0,_0x25d353);this['_addContextToCollection'](_0x42de99,this['_currentContextsChips']),this['_overflowManager']['reorganizeChips']();}['removeContextItem'](_0x84efdd){this['_removeContextFromCollection'](_0x84efdd,this['_currentContextsChips']),this['_removeContextFromCollection'](_0x84efdd,this['_overflowManager']['overflowChips']),this['_overflowManager']['reorganizeChips']();}['setContextItemLoading'](_0x4507ec,_0x2ab072){let _0x437f4b=this['_currentContextsChips']['find'](_0x2c8c9b=>_0x2c8c9b['id']===_0x4507ec);_0x437f4b||(_0x437f4b=this['_overflowManager']['overflowChips']['find'](_0x864563=>_0x864563['id']===_0x4507ec)),_0x437f4b&&(_0x437f4b['isLoading']=_0x2ab072);}['setConversationContext'](_0x2f4f59){this['_conversationContextsChips']['clear']();for(const _0x1f28c1 of _0x2f4f59){const _0x3617f5=this['_createContextButton'](_0x1f28c1,'conversation',!0x1,!0x1);this['_addContextToCollection'](_0x3617f5,this['_conversationContextsChips']);}}['clearCurrentContextItems'](){this['_currentContextsChips']['clear'](),this['_overflowManager']['clear']();}['clearConversationContextItems'](){this['_conversationContextsChips']['clear']();}['updateResourceState'](_0x48c38c,_0x49f14f,_0xb71387){this['_resourcesBalloonView']['updateResourceState'](_0x48c38c,_0x49f14f,_0xb71387);}['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:_0x430b01,withBackButton:_0x352f8f}){this['_resourcesBalloonView']['showSourceResourcesBalloon']({'source':_0x430b01,'withBackButton':_0x352f8f}),this['addContextButtonView']['isOn']=!0x0;}['populateSourceResourceBalloon'](_0x45da70,_0x2379bf,_0x22d1b3,_0x5c2967){this['_resourcesBalloonView']['populateSourceResourceBalloon'](_0x45da70,_0x22d1b3,_0x5c2967);}['closeSourceResourceBalloon'](_0x112bd2){this['_resourcesBalloonView']['closeSourceResourceBalloon'](_0x112bd2),this['addContextButtonView']['isOn']=!0x1;}['setAddContextOptions'](_0x52ffdb){this['_setBalloonPanelContent'](this['_addContextBalloonPanelView'],this['locale'],_0x52ffdb),this['_setAddContextButtonEnabled'](_0x52ffdb);}['_setAddContextButtonEnabled'](_0x2fdfc0){const _0x409e84=!_0x2fdfc0['document']['isHidden']&&_0x2fdfc0['document']['enabled'],_0x7536fe=_0x2fdfc0['urls']['enabled'],_0x9224dc=_0x2fdfc0['files']['enabled'],_0xd6e02b=_0x2fdfc0['sources']['length']>0x0,_0x295d1c=_0x2fdfc0['customItems']&&_0x2fdfc0['customItems']['length']>0x0;this['addContextButtonView']['isEnabled']=_0x409e84||_0x7536fe||_0x9224dc||_0xd6e02b||_0x295d1c;}['_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'](_0x19d2c8){const _0x602f3c=new Nt(_0x19d2c8);return _0x602f3c['set']({'label':us(_0x19d2c8,'AI_CHAT_CONTEXT_ADD_CONTEXT'),'class':$r+'\x20'+Fr+'\x20'+As,'icon':_0x3e47b3,'isToggleable':!0x0,'tooltip':!0x0,'tooltipPosition':'sw'}),_0x602f3c;}['_createAddContextBalloonPanelView'](_0x45ef26){return this['_createBaseBalloonPanel'](_0x45ef26,Gr);}['_createUrlBalloonPanelView'](_0x44b282){const _0x5a5873=this['_createBaseBalloonPanel'](_0x44b282,Kr);return this['_addUrlContent'](_0x5a5873,_0x44b282),_0x5a5873;}['_createResourcesBalloonView'](_0xb20efc,_0x4b545e){const _0x3312b3={'searchInputVisibleFrom':_0x4b545e['searchInputVisibleFrom'],'onBackToContext':()=>{this['showAddContextBalloonPanel'](),this['_addContextBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':jr});},'onResourceSelected':(_0x3760d8,_0x3b9a67)=>{this['fire']('addResourceToContext',{'source':_0x3760d8,'resource':_0x3b9a67});},'onLoadSourceResources':_0x14d268=>{this['fire']('loadSourceResources',_0x14d268);},'onBalloonClosed':()=>{this['addContextButtonView']['isOn']=!0x1;},'getLimiterElement':()=>this['_getLimiterElement'](),'getTargetElement':()=>this['addContextButtonView']['element']};return new Mr(_0xb20efc,_0x4b545e['bodyCollection'],_0x3312b3);}['_getLimiterElement'](){return this['element']?.['closest']('.'+zr)||document['body'];}['_createBaseBalloonPanel'](_0x52284e,_0x20cb8f){const _0x150be1=new Xt(_0x52284e);return _0x150be1['extendTemplate']({'attributes':{'class':_0x20cb8f}}),this['bodyCollection']['add'](_0x150be1),_0x150be1;}['_setBalloonPanelContent'](_0x12ef92,_0x19163a,_0x21aecb){if(_0x12ef92['content']['clear'](),!_0x21aecb['document']['isHidden']&&_0x21aecb['document']['enabled']){const _0x434419=this['_createBalloonButton'](_0x19163a,{'label':us(_0x19163a,'AI_CHAT_CONTEXT_CURRENT_DOCUMENT'),'icon':_0x4fd116});_0x434419['on']('execute',()=>{this['fire']('addDocumentToContext'),this['hideAddContextBalloonPanel']();}),_0x12ef92['content']['add'](_0x434419);}if(_0x21aecb['urls']['enabled']){const _0x7bb747=this['_createBalloonButton'](_0x19163a,{'label':us(_0x19163a,'AI_CHAT_CONTEXT_URL_LABEL'),'icon':_0xe48f7a});_0x7bb747['on']('execute',()=>{this['hideAddContextBalloonPanel'](),this['showUrlBalloonPanel'](),this['_urlBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':jr}),this['_urlInputView']['focus']();}),_0x12ef92['content']['add'](_0x7bb747);}if(_0x21aecb['files']['enabled']){const _0xbb9276=new _0x24d181(_0x19163a);_0xbb9276['set']({'label':us(_0x19163a,'AI_CHAT_CONTEXT_FILE_LABEL'),'icon':_0x5606db,'withText':!0x0,'tooltip':!0x0,'class':Wr,'allowMultipleFiles':!0x0}),_0xbb9276['on']('execute',()=>{this['hideAddContextBalloonPanel']();}),_0xbb9276['on']('done',(_0x47a858,_0x443ef7)=>{this['fire']('addFileToContext',_0x443ef7);}),_0xbb9276['tooltip']=!0x0,_0x12ef92['content']['add'](_0xbb9276);}for(const _0x42098e of _0x21aecb['sources']){const _0x349f4b=this['_createBalloonButton'](_0x19163a,{'label':_0x42098e['label'],'icon':_0x42098e['icon']||_0x5b0e49,'type':'source'});_0x12ef92['content']['add'](_0x349f4b),_0x349f4b['on']('execute',()=>{this['hideAddContextBalloonPanel'](),this['_showSourceResourcesBalloon']({'source':_0x42098e,'withBackButton':!this['_hasExactlyOneSource']});});}for(const _0x2f4e4d of _0x21aecb['customItems']||[]){const _0x5e032a=this['_createBalloonButton'](_0x19163a,{'label':_0x2f4e4d['label'],'icon':_0x2f4e4d['icon']||_0x5b0e49,'type':'customItem'});_0x12ef92['content']['add'](_0x5e032a),_0x5e032a['on']('execute',()=>{this['hideAddContextBalloonPanel'](),this['fire']('executeCustomItemCallback',_0x2f4e4d);});}this['_hasExactlyOneSource']=0x1===_0x12ef92['content']['length'],this['_urlInputView']['withBackButton']=!this['_hasExactlyOneSource'];}['_addUrlContent'](_0x17a0b2,_0x11a836){this['_urlInputView']=new Sr(_0x11a836),this['_urlInputView']['on']('submitUrl',(_0x14ef57,_0x7f4090)=>{this['_handleUrlSubmit'](_0x7f4090);}),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});}),_0x17a0b2['content']['add'](this['_urlInputView']);}['_createBalloonButton'](_0xf995d4,_0x2db439){const _0x224050='source'===_0x2db439['type']?new Zr(_0xf995d4):new Nt(_0xf995d4);return _0x224050['set']({'label':_0x2db439['label'],'icon':_0x2db439['icon'],'withText':!0x0,'tooltip':!0x0,'tooltipPosition':'sw','class':Wr}),_0x224050;}['_setupAllBalloonClickOutsideHandlers'](){this['_setupAddContextBalloonClickOutsideHandler'](),this['_setupUrlBalloonClickOutsideHandler']();}['_setupUrlBalloonClickOutsideHandler'](){zt({'emitter':this['_urlBalloonPanelView'],'contextElements':[this['_urlBalloonPanelView']['element']],'callback':()=>{this['hideUrlBalloonPanel']();},'activator':()=>this['_urlBalloonPanelView']['isVisible']});}['_toggleAddContextBalloon'](_0x28a1fa){const _0x27969c=this['_addContextBalloonConfig'];_0x27969c['buttonView']['isOn']=_0x28a1fa,_0x28a1fa?_0x27969c['balloonView']['show']():_0x27969c['balloonView']['hide']();}['_setupAddContextBalloonClickOutsideHandler'](){const {balloonView:_0x1eca33,buttonView:_0x2a48c2,hideMethod:_0x350d9b}=this['_addContextBalloonConfig'];zt({'emitter':_0x1eca33,'contextElements':[_0x1eca33['element'],_0x2a48c2['element']],'callback':()=>{_0x350d9b();},'activator':()=>_0x2a48c2['isOn']&&!this['_urlBalloonPanelView']['isVisible']&&!this['_resourcesBalloonView']['isAnyResourceBalloonVisible']()});}['_createContextButton'](_0x52c054,_0x2b6baa,_0x3cd64c=!0x1,_0x5b7de9=!0x1){const _0x473191='conversation'===_0x2b6baa||!0x0===_0x52c054['isReadOnly'],_0x28a6f9=new Vn(this['locale'],_0x52c054,_0x473191,_0x3cd64c,_0x5b7de9);return _0x473191||_0x28a6f9['on']('removeContextItemChip',()=>{this['fire']('removeContextItem',_0x28a6f9['id']);}),_0x28a6f9;}['_addContextToCollection'](_0x301ea2,_0x4de65f){_0x4de65f['add'](_0x301ea2,0x0);}['_removeContextFromCollection'](_0x246b84,_0x5df60b){const _0x26c25c=_0x5df60b['find'](_0x2624b8=>_0x2624b8['id']===_0x246b84);_0x26c25c&&_0x5df60b['remove'](_0x26c25c);}['_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'](_0x120bde){this['_urlInputView']['clear'](),this['hideUrlBalloonPanel'](),this['fire']('addUrlToContext',_0x120bde);}}class Zr extends Nt{['arrowView'];constructor(_0x3da6f4){super(_0x3da6f4),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 _0x5da86d=new xt();return _0x5da86d['content']=_0x348d35,_0x5da86d['extendTemplate']({'attributes':{'class':Yr+'__arrow'}}),_0x5da86d;}}class ta extends vt{['_cancelButtonView'];['_loaderView'];constructor(_0x415a8d){super(_0x415a8d),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 _0x599f94=new Nt(this['locale']);return _0x599f94['set']({'label':us(this['locale'],'AI_CHAT_STOP_GENERATING'),'withText':!0x0,'class':_s+'\x20ck-ai-button-stop-generating','icon':_0x39f907}),_0x599f94['on']('execute',()=>{this['fire']('abortPromptStream');}),_0x599f94;}['_createLoaderView'](){const _0x133ea3=new vt(this['locale']);return _0x133ea3['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')}]}),_0x133ea3;}}class ea extends vt{['_contextPanelView'];['_promptInputView'];['_promptCapabilitiesView'];['_loaderView'];['_modelUnavailableMessageView'];['_shouldRestorePromptInputFocus'];constructor(_0x38b4fd,_0x17aef7){super(_0x38b4fd),this['_contextPanelView']=this['_createContextPanelView'](_0x38b4fd,{'bodyCollection':_0x17aef7['bodyCollection'],'searchInputVisibleFrom':_0x17aef7['contextResourcesSearchInputVisibleFrom']}),this['_promptInputView']=this['_createPromptInputView'](_0x38b4fd),this['_promptCapabilitiesView']=this['_createPromptCapabilitiesView'](_0x38b4fd),this['_loaderView']=this['_createLoaderView'](_0x38b4fd),this['_modelUnavailableMessageView']=this['_createModelUnavailableMessageView'](_0x38b4fd),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 _0x4be66c=this['bindTemplate'];this['setTemplate']({'tag':'form','attributes':{'class':['ck','ck-ai-chat-controls',_0x4be66c['if']('isDisabled','ck-ai-chat-controls-disabled')]},'children':[{'tag':'div','attributes':{'class':[_0x4be66c['if']('isLoading','ck-hidden',_0x215854=>_0x215854||!this['isModelAvailable']),_0x4be66c['if']('isModelAvailable','ck-hidden',_0x460874=>!_0x460874||this['isLoading'])]},'children':[this['_contextPanelView'],this['_promptInputView'],this['_promptCapabilitiesView']]},{'tag':'div','attributes':{'class':[_0x4be66c['if']('isLoading','ck-hidden',_0x30fad1=>!_0x30fad1)]},'children':[this['_loaderView']]},{'tag':'div','attributes':{'class':[_0x4be66c['if']('isModelAvailable','ck-hidden',_0x49c59e=>_0x49c59e)]},'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'](_0x512013,_0x6c0568){return new Jr(_0x512013,_0x6c0568);}['_createPromptInputView'](_0x5dcf17){return new lr(_0x5dcf17,this['_contextPanelView']['addContextButtonView']);}['_createPromptCapabilitiesView'](_0x405d86){return new Tr(_0x405d86);}['_createLoaderView'](_0x5e4c1b){return new ta(_0x5e4c1b);}['_createModelUnavailableMessageView'](_0x51723e){const _0x21414f=new ia(_0x51723e);return _0x21414f['delegate']('startConversation')['to'](this),_0x21414f;}['_handlePromptInputFocus'](_0x31e1db,_0xaee8be,_0x52d6b4){_0x52d6b4?this['_shouldRestorePromptInputFocus']=!0x0:this['_shouldRestorePromptInputFocus']&&this['_promptInputView']['focus']();}['addContextItem'](_0x41b802,_0x17960a){this['_contextPanelView']['addContextItem'](_0x41b802,_0x17960a);}['removeContextItem'](_0x1e21c6){this['_contextPanelView']['removeContextItem'](_0x1e21c6);}['setContextItemLoading'](_0x3bc0c2,_0x2e8169){this['_contextPanelView']['setContextItemLoading'](_0x3bc0c2,_0x2e8169);}['setIsUploadInProgress'](_0x1430c7){this['_promptInputView']['setIsUploadInProgress'](_0x1430c7);}['setConversationContext'](_0x2c0ad1){this['_contextPanelView']['setConversationContext'](_0x2c0ad1);}['clearPendingContextUI'](){this['_contextPanelView']['clearCurrentContextItems']();}['clearConversationContextUI'](){this['_contextPanelView']['clearConversationContextItems']();}['updateResourceState'](_0x2723aa,_0x29c3a9,_0x316ba7){this['_contextPanelView']['updateResourceState'](_0x2723aa,_0x29c3a9,_0x316ba7);}['setWebSearch'](_0x1e8f48){this['_promptCapabilitiesView']['setWebSearch'](_0x1e8f48);}['setReasoning'](_0x12ac09){this['_promptCapabilitiesView']['setReasoning'](_0x12ac09);}['resetMessageInput'](){this['_promptInputView']['reset']();}['setAddContextOptions'](_0x4885cb){this['_contextPanelView']['setAddContextOptions'](_0x4885cb);}['setInputPlaceholder'](_0x157cdd){this['_promptInputView']['setPlaceholderText'](_0x157cdd);}['setModelList'](_0x2c83dc,_0x1b4f34){this['_promptCapabilitiesView']['setModelList'](_0x2c83dc,_0x1b4f34);}['setModel'](_0xcbfcb8){_0xcbfcb8?(this['isModelAvailable']=!0x0,this['_promptCapabilitiesView']['setModel'](_0xcbfcb8)):this['isModelAvailable']=!0x1;}['enableModelSelector'](){this['_promptCapabilitiesView']['enableModelSelector']();}['disableModelSelector'](_0x1a5381){this['_promptCapabilitiesView']['disableModelSelector'](_0x1a5381);}['populateSourceResourceBalloon'](_0x837fec,_0x4f8cd1,_0x21e4fc,_0x3d1a7c){this['_contextPanelView']['populateSourceResourceBalloon'](_0x837fec,_0x4f8cd1,_0x21e4fc,_0x3d1a7c);}['closeSourceResourceBalloon'](_0x330f0f){this['_contextPanelView']['closeSourceResourceBalloon'](_0x330f0f);}['focusPromptInput'](_0x31b093=!0x1){this['_promptInputView']['focus'](_0x31b093);}['setPromptInputValue'](_0x384d40){this['_promptInputView']['queryView']['fieldView']['reset'](),this['_promptInputView']['queryView']['fieldView']['value']=_0x384d40;}}class ia extends vt{constructor(_0x419e6d){super(_0x419e6d);const _0x351844=new Nt(_0x419e6d);_0x351844['set']({'label':us(this['locale'],'AI_CHAT_MODEL_UNAVAILABLE_MESSAGE_BUTTON'),'withText':!0x0,'class':['ck-ai-chat-controls__start-new-chat-button'],'tooltip':''}),_0x351844['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'},_0x351844]}]});}}class sa extends _0x4c7c2c{['conversationStartButton'];['resizeButton'];constructor(_0x5d062c,_0x484aca){super(_0x5d062c,{'label':us(_0x5d062c,'AI_CHAT_HEADING'),'class':'ck-ai-header\x20ck-ai-header_chat','icon':_0x29e983}),this['set']('isMaximized',!0x1),this['conversationStartButton']=this['_createStartConversationButton'](_0x5d062c),this['children']['add'](this['conversationStartButton']),_0x484aca&&(this['resizeButton']=gs(_0x5d062c,this),this['children']['add'](this['resizeButton']));}['_createStartConversationButton'](_0x58b6b6){const _0x1d11aa=new Nt(_0x58b6b6);return _0x1d11aa['set']({'label':us(this['locale'],'AI_CHAT_LABEL_NEW_CHAT'),'withText':!0x0,'icon':_0x4282f7,'class':'ck-ai-chat__start-conversation\x20'+_s}),_0x1d11aa['on']('execute',()=>{this['fire']('startConversation');}),_0x1d11aa;}}class na extends vt{constructor(_0x1cf59d){super(_0x1cf59d),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-disclaimer']},'children':[{'tag':'p','attributes':{'class':['ck','ck-ai-disclaimer__content']},'children':[{'text':us(_0x1cf59d,'AI_DISCLAIMER_TEXT')}]}]});}}class ra extends vt{['chatHeader'];['chatFeed'];['chatControls'];['chatDisclaimer'];['_bodyCollection'];constructor(_0x1a58ce,_0xd804b9){super(_0x1a58ce),this['_bodyCollection']=new Qt(_0x1a58ce),this['_bodyCollection']['attachToDom'](),this['chatHeader']=new sa(_0x1a58ce,_0xd804b9['showResizeButton']),this['chatHeader']['delegate'](...sn)['to'](this),this['chatFeed']=new or(_0x1a58ce,this['_bodyCollection']),this['chatFeed']['delegate'](...sn)['to'](this),this['chatControls']=new ea(_0x1a58ce,{'bodyCollection':this['_bodyCollection'],'contextResourcesSearchInputVisibleFrom':_0xd804b9['contextResourcesSearchInputVisibleFrom']}),this['chatControls']['delegate'](...sn)['to'](this),this['chatDisclaimer']=new na(_0x1a58ce),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset_all','ck-ai-chat','ck-rounded-corners'],'dir':_0x1a58ce['uiLanguageDirection']},'children':[this['chatHeader'],this['chatFeed'],this['chatControls'],this['chatDisclaimer']]});}['populateSourceResourceBalloon'](_0x249ff4,_0x10cc3e,_0x2bf63f,_0x8f535e){this['chatControls']['populateSourceResourceBalloon'](_0x249ff4,_0x10cc3e,_0x2bf63f,_0x8f535e);}['closeSourceResourceBalloon'](_0x181218){this['chatControls']['closeSourceResourceBalloon'](_0x181218);}['destroy'](){this['_bodyCollection']['detachFromDom'](),super['destroy']();}}class aa extends _0x20e290{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(_0x252519){super(_0x252519);const _0x1f6bf7=this['context']['plugins']['get']('AITabs');this['set']('isBusy',!0x1),this['_promiseQueue']=new mn(),this['_view']=new ra(this['context']['locale'],{'showResizeButton':_0x1f6bf7['showResizeButton'],'contextResourcesSearchInputVisibleFrom':this['context']['config']['get']('ai.chat.context.searchInputVisibleFrom')}),this['_view']['delegate'](...sn)['to'](this),this['_view']['on']('toggleSuggestionDisplayMode',(_0x5bc729,{showDiff:_0x13a4c8})=>{this['showDiff']=_0x13a4c8;}),_0x1f6bf7['view']['addTab']({'id':'chat','buttonLabel':us(this['context']['locale'],'AI_CHAT_HEADING'),'buttonIcon':_0x29e983,'order':0x0,'content':this['_view']}),this['_view']['chatControls']['bind']('isLoading')['to'](this,'isBusy',_0x3b5407=>_0x3b5407),this['_view']['chatFeed']['bind']('isPending')['to'](this,'isBusy',_0x261aa9=>_0x261aa9),this['_view']['chatControls']['setInputPlaceholder'](this['_getInputPlaceholder']()),this['bind']('isModelAvailable')['to'](this['_view']['chatControls'],'isModelAvailable');}['destroy'](){super['destroy'](),this['_titleAnimationInterval']&&clearInterval(this['_titleAnimationInterval']);}['createConversation'](_0x2a79ff){const _0x3f367d=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'](_0x2a79ff['availableModels'],!this['context']['config']['get']('ai.models.showModelSelector')),this['addFeedItemStaticMessage']({'id':'conversation-start','staticMessage':_0x3f367d}),this['fire']('conversationCreated');}async['addFeedItemStaticMessage']({id:_0x52afe5,staticMessage:_0x1cf002}){return this['_promiseQueue']['enqueue'](async()=>{this['_view']['chatFeed']['addItem']('ai-reply',{'id':_0x52afe5,'initialContent':'<p>'+_0x1cf002+'</p>'});});}async['addFeedItemUserMessage'](_0x17282f){const _0x4de696=_0x17282f['attributes']?.['displayedPrompt']||_0x17282f['userMessage'];return this['_promiseQueue']['enqueue'](async()=>{this['_view']['chatFeed']['addItem']('user-message',{'contextItems':Array['from'](_0x17282f['contextItems']['values']()),'initialContent':'<p>'+_0x4de696+'</p>','id':_0x17282f['id']});});}async['addFeedItemError']({errorMessage:_0x59bf50,id:_0x31ae54}){return this['_promiseQueue']['enqueue'](async()=>{this['_view']['chatFeed']['addItem']('error-message',{'initialContent':'<p>'+_0x59bf50+'</p>','id':_0x31ae54});});}async['addFeedItemAIReply'](_0x156c09){return this['_promiseQueue']['enqueue'](async()=>{this['_view']['chatFeed']['addItem']('ai-reply',{'id':_0x156c09['interactionId']+':'+_0x156c09['id']}),this['clearLoadingMessage']();});}async['addFeedItemAISuggestion'](_0x78e703){const _0x3001c1=Xs(this['context']);let _0x417508=_0x3001c1['config']['get']('ai.availableReplyActions')||[...wn];if(_0x3001c1['plugins']['has']('TrackChanges')){if(!this['_isTrackChangesCommandValueBound']){this['_isTrackChangesCommandValueBound']=!0x0;const _0x2f1a27=_0x3001c1['commands']['get']('trackChanges');this['_view']['chatFeed']['bind']('isTrackChangesOn')['to'](_0x2f1a27,'value');}}else _0x417508=_0x417508['filter'](_0x113675=>'insertSuggestion'!=_0x113675);return this['_promiseQueue']['enqueue'](async()=>{this['_view']['chatFeed']['addItem']('ai-suggestion-reply',{'id':_0x78e703['interactionId']+':'+_0x78e703['id'],'areActionsDisabled':_0x78e703['areActionsDisabled'],'showDiff':this['showDiff'],'availableActions':_0x417508}),this['clearLoadingMessage']();});}async['addFeedInteractionHeader'](_0x469070,_0x32523d){return this['_promiseQueue']['enqueue'](async()=>{const _0x94b309=this['_view']['chatFeed']['children']['last'];if(_0x94b309 instanceof Jn)return this['_view']['chatFeed']['children']['remove'](_0x94b309),void this['_view']['chatFeed']['addItem']('interaction-header',{'id':_0x469070['id'],'capabilities':{'isWebSearchEnabled':_0x94b309['capabilities']['isWebSearchEnabled']||_0x32523d['isWebSearchEnabled'],'isReasoningEnabled':_0x94b309['capabilities']['isReasoningEnabled']||_0x32523d['isReasoningEnabled']}});this['_view']['chatFeed']['addItem']('interaction-header',{'id':_0x469070['id'],'capabilities':_0x32523d});});}async['addFeedItemCustomElement'](_0x3f9e78,_0x40eefe){let _0x93fd05;return await this['_promiseQueue']['enqueue'](async()=>{_0x93fd05=this['_view']['chatFeed']['addItem']('custom-element',{'content':_0x3f9e78,'id':_0x40eefe});}),_0x93fd05;}['removeFeedItem'](_0x497510){this['_view']['chatFeed']['removeItem'](_0x497510);}['hasFeedItem'](_0x56d299){return this['_view']['chatFeed']['hasItem'](_0x56d299);}['updateFeedInteractionHeader'](_0x56eb43){const _0x2a9627=this['_view']['chatFeed']['children']['find'](_0x4c19a6=>_0x4c19a6['options']['id']==_0x56eb43['id']&&_0x4c19a6 instanceof Jn);_0x2a9627&&_0x2a9627['set']('isVisible',_0x56eb43['isVisible']);}async['updateFeedItemAIReplyContent'](_0x39db46){const _0x51f9f3=_0x39db46['renderingStrategy']||this['feedItemRenderingStrategy'];return this['_promiseQueue']['enqueue'](async _0x30bb7c=>{await this['_view']['chatFeed']['updateReplyItem']({..._0x39db46,'abortSignal':_0x30bb7c,'renderingStrategy':_0x51f9f3}),_0x39db46['isDone']&&this['markFeedItemAsDone'](_0x39db46['id']);});}['updateFeedItemAIReplySources'](_0x18197f,_0x2048ac){this['_view']['chatFeed']['updateWebSources'](_0x18197f,_0x2048ac);}async['updateFeedItemAIReplySuggestionContent'](_0x4301fa){const _0x504b03=_0x4301fa['renderingStrategy']||this['feedItemRenderingStrategy'];return this['_promiseQueue']['enqueue'](async _0xbc5025=>{await this['_view']['chatFeed']['updateSuggestionItem']({..._0x4301fa,'abortSignal':_0xbc5025,'renderingStrategy':_0x504b03}),_0x4301fa['isDone']&&this['markFeedItemAsDone'](_0x4301fa['id']);});}['updateFeedItemAIReplySuggestionPartState'](_0x1f6107){this['_view']['chatFeed']['updateSuggestionPartState'](_0x1f6107);}['setFeedItemAIReplySuggestionPartActive'](_0x4231d2){this['_view']['chatFeed']['setSuggestionPartActive'](_0x4231d2);}['markFeedItemAsDone'](_0x1257f2){this['_view']['chatFeed']['markItemAsDone'](_0x1257f2);}['removeFeedInteraction'](_0x458f8e){this['_view']['chatFeed']['getItemIds']()['filter'](_0x36ea49=>_0x36ea49['startsWith'](_0x458f8e))['forEach'](_0x496efc=>this['_view']['chatFeed']['removeItem'](_0x496efc));}['startInteraction'](){const _0x53a36b=this['prepareLoadingMessage']({'isWebSearchEnabled':!0x1,'isReasoningEnabled':!0x1});this['setLoadingMessage'](_0x53a36b),this['_view']['chatControls']['disableModelSelector'](!this['context']['config']['get']('ai.models.showModelSelector')),this['isBusy']=!0x0,this['_view']['chatFeed']['startAutoScroll']();}['stopInteraction'](_0x1594be){this['_promiseQueue']['abort'](),this['_view']['chatFeed']['getItemIds']()['filter'](_0x2a3265=>_0x2a3265['startsWith'](_0x1594be['id']))['forEach'](_0x2121d4=>this['markFeedItemAsDone'](_0x2121d4)),this['isBusy']=!0x1,this['_view']['chatFeed']['stopAutoScroll']();}async['finishInteraction'](){return this['_promiseQueue']['queueEmptyPromise']['then'](()=>{this['isBusy']=!0x1,this['_view']['chatFeed']['stopAutoScroll']();});}['addContextItem'](_0x5e1c26,_0x331252){this['_view']['chatControls']['addContextItem'](_0x5e1c26,_0x331252);}['removeContextItem'](_0x26f99d){this['_view']['chatControls']['removeContextItem'](_0x26f99d);}['setContextItemLoading'](_0x3fcc64,_0xab85e8){this['_view']['chatControls']['setContextItemLoading'](_0x3fcc64,_0xab85e8);}['setIsUploadInProgress'](_0x5e033c){this['_view']['chatControls']['setIsUploadInProgress'](_0x5e033c);}['setConversationContext'](_0x5e0b31){this['_view']['chatControls']['setConversationContext'](_0x5e0b31);}['clearPendingContextUI'](){this['_view']['chatControls']['clearPendingContextUI']();}['clearConversationContextUI'](){this['_view']['chatControls']['clearConversationContextUI']();}['updateResourceState'](_0x2e5484,_0x55f09b,_0x2787d3){this['_view']['chatControls']['updateResourceState'](_0x2e5484,_0x55f09b,_0x2787d3);}['resetMessageInput'](){this['_view']['chatControls']['resetMessageInput'](),this['_view']['chatControls']['setInputPlaceholder'](this['_getInputPlaceholder']());}['setAddContextOptions'](_0x19349c){this['_view']['chatControls']['setAddContextOptions'](_0x19349c);}['updateCapabilities'](_0x562382){this['_view']['chatControls']['setWebSearch'](_0x562382['isWebSearchEnabled']),this['_view']['chatControls']['setReasoning'](_0x562382['isReasoningEnabled']),this['_view']['chatControls']['setInputPlaceholder'](this['_getInputPlaceholder'](_0x562382));}['setSelectedModel'](_0x481ca1,_0x50db52){this['_view']['chatControls']['setModel'](_0x481ca1),_0x50db52&&this['_view']['chatControls']['disableModelSelector'](!0x1);}['setFeedItemRenderingStrategy'](_0x442a7e){this['feedItemRenderingStrategy']=_0x442a7e;}['toggleLoadingSkeleton'](_0x1b69c3){this['_view']['chatFeed']['toggleLoadingSkeleton'](_0x1b69c3);}['resetConversationTitle'](){this['setConversationTitle'](us(this['context']['locale'],'AI_CHAT_HEADING'));}['setConversationTitle'](_0x2f101e,_0x51dd1b=!0x1){if(_0x51dd1b&&!bt()&&_0x2f101e['length'])return this['_view']['chatHeader']['label']='',void this['_animateConversationTitle'](_0x2f101e);this['_view']['chatHeader']['label']=_0x2f101e;}['setLoadingMessage'](_0x35af74){this['_view']['chatFeed']['setLoadingMessage'](_0x35af74);}['clearLoadingMessage'](){this['_view']['chatFeed']['setLoadingMessage']('');}['_animateConversationTitle'](_0x38b94b){let _0xcd568=0x0;clearInterval(this['_titleAnimationInterval']),this['_titleAnimationInterval']=setInterval(()=>{this['_view']['chatHeader']['label']=this['_view']['chatHeader']['label']+_0x38b94b[_0xcd568],_0xcd568++,_0xcd568===_0x38b94b['length']&&clearInterval(this['_titleAnimationInterval']);},0x1e);}['setIsMaximized'](_0x40bed1){this['_view']['chatHeader']['isMaximized']=_0x40bed1;}['prepareLoadingMessage'](_0x3bdac4){return _0x3bdac4['isWebSearchEnabled']&&_0x3bdac4['isReasoningEnabled']?us(this['context']['locale'],'AI_CHAT_FEED_LOADING_MESSAGE_WEBSEARCH_REASONING'):_0x3bdac4['isWebSearchEnabled']?us(this['context']['locale'],'AI_CHAT_FEED_LOADING_MESSAGE_WEBSEARCH'):_0x3bdac4['isReasoningEnabled']?us(this['context']['locale'],'AI_CHAT_FEED_LOADING_MESSAGE_REASONING'):us(this['context']['locale'],'AI_CHAT_FEED_LOADING_MESSAGE_REGULAR');}['_getInputPlaceholder'](_0x1be032){return _0x1be032?_0x1be032['isWebSearchEnabled']&&_0x1be032['isReasoningEnabled']?us(this['context']['locale'],'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_WEBSEARCH_REASONING'):_0x1be032['isWebSearchEnabled']?us(this['context']['locale'],'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_WEBSEARCH'):_0x1be032['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'](_0x12e8fb,_0x134ec0,_0x29ac3c,_0x1db354){this['_view']['populateSourceResourceBalloon'](_0x12e8fb,_0x134ec0,_0x29ac3c,_0x1db354);}['closeSourceResourceBalloon'](_0xaac87a){this['_view']['closeSourceResourceBalloon'](_0xaac87a);}['setPromptInputValue'](_0x2ba74f){this['_view']['chatControls']['setPromptInputValue'](_0x2ba74f);}['focusPromptInput'](_0x6ccdc8=!0x1){this['_view']['chatControls']['focusPromptInput'](_0x6ccdc8);}['scrollFeedToSuggestion'](_0x421bd2,_0xf349dc){this['_view']['chatFeed']['scrollToSuggestion'](_0x421bd2,_0xf349dc);}['startAutoScroll'](){this['_view']['chatFeed']['startAutoScroll']();}['disableControls'](){this['_view']['chatControls']['isDisabled']=!0x0;}['enableControls'](){this['_view']['chatControls']['isDisabled']=!0x1;}}class oa extends Dt{['sections'];constructor(_0x1efbcc,_0x560340){super(_0x1efbcc),this['sections']=_0x560340,this['items']['addMany'](this['sections']),this['extendTemplate']({'attributes':{'class':['ck-ai-chat-history__sections']}});}['filter'](_0x4253f9){let _0x370c98=0x0,_0x43c97c=0x0;for(const _0x1cbbae of this['sections']){const {resultsCount:_0x2c5b39,totalItemsCount:_0x375071}=_0x1cbbae['filter'](_0x4253f9);_0x370c98+=_0x2c5b39,_0x43c97c+=_0x375071;}return{'resultsCount':_0x370c98,'totalItemsCount':_0x43c97c};}}class ha extends Ht{['title'];['itemsViews'];['_itemsListView'];constructor(_0x5d421b,{title:_0x4af78e,items:_0x25fd29}){super(_0x5d421b);const _0x2a516a=this['bindTemplate'];this['set']('isVisible',!0x0),this['title']=_0x4af78e,this['itemsViews']=_0x25fd29;const _0x57b325=new vt(_0x5d421b);_0x57b325['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-chat-history__section-title']},'children':[this['title']]}),this['_itemsListView']=new Dt(_0x5d421b),this['_itemsListView']['items']['addMany'](this['itemsViews']),this['setTemplate']({'tag':'li','attributes':{'class':['ck-ai-chat-history__section',_0x2a516a['if']('isVisible','ck-hidden',_0x1e3175=>!_0x1e3175)]},'children':[_0x57b325,this['_itemsListView']]});}['filter'](_0x2478a8){const _0x269f4d=this['itemsViews']['length'];let _0x6d7af7=0x0;for(const _0x40a99a of this['itemsViews']){if(_0x2478a8){const _0x417026=_0x40a99a['isMatching'](_0x2478a8);_0x40a99a['isVisible']=!!_0x417026,_0x40a99a['highlightText'](_0x2478a8);}else _0x40a99a['isVisible']=!0x0,_0x40a99a['highlightText'](null);_0x40a99a['isVisible']&&_0x6d7af7++;}return this['isVisible']=_0x6d7af7>0x0,{'resultsCount':_0x6d7af7,'totalItemsCount':_0x269f4d};}['getItem'](_0x473625){return this['itemsViews']['find'](_0x4b826a=>_0x4b826a['id']===_0x473625);}['removeItem'](_0x398c78){const _0x1d3534=this['itemsViews']['indexOf'](_0x398c78);-0x1!==_0x1d3534&&(this['itemsViews']['splice'](_0x1d3534,0x1),this['_itemsListView']['items']['remove'](_0x398c78));}}class ca extends/* #__PURE__ -- @preserve */
27
- _0x450296(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(_0x145446,_0x1a0d95){super(_0x145446);const _0x54c3e1=this['bindTemplate'];this['set']('isEdit',!0x1),this['set']('isVisible',!0x0),this['set']('pinned',!!_0x1a0d95['pinned']),this['set']('loadingState',null),this['id']=_0x1a0d95['id'];const {title:_0x2675f4,createdAt:_0x4ccfdf,active:_0x3eed7e=!0x1}=_0x1a0d95;this['_titleView']=new _0x3faae3(),this['_titleView']['text']=_0x2675f4,this['_titleView']['extendTemplate']({'attributes':{'class':['ck-ai-chat-history__item-title']}});const _0x4494b7=this['_createCheckView'](),_0x5d996c=this['_createPinButtonView'](_0x145446),_0x56106b=this['_createMenuDropdownView'](),_0x24c697=this['_createEditInputView'](_0x145446,_0x2675f4),_0x5f0043=this['_createAcceptEditButtonView'](_0x145446,_0x24c697),_0x213208=this['_createCancelEditButtonView'](_0x145446,_0x24c697);this['actions']=this['createCollection'](),this['mainContent']=this['createCollection'](),this['mainContent']['add'](this['_titleView']),this['actions']['add'](_0x5d996c),this['actions']['add'](_0x56106b),this['on']('change:isEdit',(_0x19fcfd,_0x249654,_0x591ffe)=>{this['actions']['clear'](),this['mainContent']['clear'](),_0x591ffe?(this['actions']['add'](_0x5f0043),this['actions']['add'](_0x213208),this['mainContent']['add'](_0x24c697),_0x24c697['element']['focus']()):(this['actions']['add'](_0x5d996c),this['actions']['add'](_0x56106b),this['mainContent']['add'](this['_titleView']));}),this['setTemplate']({'tag':'li','attributes':{'class':['ck-ai-chat-history__item',_0x3eed7e?'ck-ai-chat-history__item--active':'',_0x54c3e1['if']('isVisible','ck-hidden',_0x5f02be=>!_0x5f02be),_0x54c3e1['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',_0x54c3e1['if']('loadingState','ck-hidden',_0x31efb2=>!!_0x31efb2)]},'children':_0x3eed7e?[_0x4494b7]:[]},{'tag':'div','attributes':{'class':['ck-ai-loader',_0x54c3e1['if']('loadingState','ck-hidden',_0x2b9cd0=>!_0x2b9cd0)]},'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',_0x54c3e1['if']('loadingState','ck-hidden',_0x57d13e=>!!_0x57d13e)]},'children':this['mainContent']},{'tag':'div','attributes':{'class':['ck-ai-loader__text',_0x54c3e1['if']('loadingState','ck-hidden',_0xa850cb=>!_0xa850cb)]},'children':[{'text':_0x54c3e1['to']('loadingState',_0x5df133=>_0x5df133?us(this['locale'],ca['LOADING_LABELS'][_0x5df133]):'')}]}]},{'tag':'span','attributes':{'class':['ck-ai-chat-history__item-date']},'children':[_0x4ccfdf]}]},{'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'](_0x43935b){this['_titleView']['text']=_0x31dc1d(_0x43935b);}['updateLoadingState'](_0x135261,_0x563211){this['set']('loadingState',_0x563211?_0x135261:null);}['_createCheckView'](){const _0x21b216=new xt();return _0x21b216['set']({'content':_0x4dbbde}),_0x21b216;}['_createPinButtonView'](_0x1f3de3){const _0x2eacf4=new Nt(_0x1f3de3);return _0x2eacf4['set']({'label':us(_0x1f3de3,'AI_CHAT_HISTORY_PIN_BUTTON'),'icon':_0x5c8c8a,'withText':!0x1,'tooltip':!0x0}),_0x2eacf4['bind']('isOn')['to'](this,'pinned'),_0x2eacf4['on']('execute',()=>{const _0x24ad11=!this['pinned'];this['fire']('setConversationPinned',{'id':this['id'],'pinned':_0x24ad11});}),_0x2eacf4;}['_createMenuDropdownView'](){const _0x21c4c3=Gt(this['locale'],_0x155860),_0x53a7fd=_0x21c4c3['panelView']['children'];_0x21c4c3['buttonView']['set']({'label':us(this['locale'],'AI_CHAT_HISTORY_SHOW_MORE_ITEMS'),'icon':_0x3d118e}),_0x21c4c3['panelPosition']='sw';const _0x2f2620=new Nt(this['locale']);_0x2f2620['label']=us(this['locale'],'AI_CHAT_HISTORY_EDIT_NAME'),_0x2f2620['withText']=!0x0,_0x2f2620['on']('execute',()=>{this['isEdit']=!0x0;});const _0x30b28d=new Nt(this['locale']);_0x30b28d['label']=us(this['locale'],'AI_CHAT_HISTORY_REMOVE'),_0x30b28d['withText']=!0x0,_0x30b28d['on']('execute',()=>{this['showConfirm'](us(this['locale'],'AI_CHAT_HISTORY_REMOVE_CONFIRM'),this['element'])['then'](()=>{this['fire']('removeConversation',{'id':this['id']});});});const _0x12428a=new Dt(this['locale']),_0xb45a81=new Ht(this['locale']);_0xb45a81['children']['add'](_0x2f2620);const _0x72d981=new Ht(this['locale']);return _0x72d981['children']['add'](_0x30b28d),_0x12428a['items']['addMany']([_0xb45a81,_0x72d981]),_0x53a7fd['add'](_0x12428a),_0x21c4c3;}['_createEditInputView'](_0x26d799,_0x1b460c){const _0x4e17f4=new _0x2dd1b7(_0x26d799),_0x5d7f11=_0x4e17f4['bindTemplate'];return _0x4e17f4['value']=_0x1b460c,_0x4e17f4['extendTemplate']({'on':{'keydown':_0x5d7f11['to'](_0x1967a9=>{'Enter'==_0x1967a9['key']&&this['_commitEditInputValue'](_0x4e17f4);})}}),_0x4e17f4;}['_createAcceptEditButtonView'](_0x41ab34,_0x40be36){const _0x22abe3=new Nt(_0x41ab34);return _0x22abe3['set']({'icon':_0x4dbbde,'withText':!0x1,'tooltip':us(_0x41ab34,'AI_CHAT_HISTORY_ACCEPT')}),_0x22abe3['extendTemplate']({'attributes':{'class':['ck-confirm-view-submit']}}),_0x22abe3['on']('execute',()=>{this['_commitEditInputValue'](_0x40be36);}),_0x22abe3;}['_commitEditInputValue'](_0x28de6e){const _0x3c4ad9=_0x28de6e['element']['value']||'';this['_titleView']['text']=_0x3c4ad9,this['isEdit']=!0x1,this['fire']('editConversationTitle',{'id':this['id'],'title':_0x3c4ad9});}['_createCancelEditButtonView'](_0x92cfe2,_0x54e473){const _0x2c1ed4=new Nt(_0x92cfe2);return _0x2c1ed4['set']({'icon':_0x2d333c,'withText':!0x1,'tooltip':us(_0x92cfe2,'AI_CHAT_HISTORY_CANCEL')}),_0x2c1ed4['extendTemplate']({'attributes':{'class':['ck-confirm-view-cancel']}}),_0x2c1ed4['on']('execute',()=>{this['isEdit']=!0x1,_0x54e473['value']=this['_titleView']['text']||'',this['fire']('edit:cancel');}),_0x2c1ed4;}['_createSpinnerView'](){const _0xb18783=new vn('tiny');return _0xb18783['isVisible']=!0x0,_0xb18783;}['isMatching'](_0x1af8b2){return this['_titleView']&&'string'==typeof this['_titleView']['text']&&this['_titleView']['text']['match'](_0x1af8b2)?{'title':!0x0}:null;}['highlightText'](_0x378f21){this['_titleView']['highlightText'](_0x378f21);}}class la extends vt{['searchView'];['mainErrorView'];['skeletonView'];['emptyView'];['sectionsView'];['resizeButton'];constructor(_0x291197,_0x40e2cc){super(_0x291197),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 _0x19bfbb=new _0x4c7c2c(_0x291197,{'label':us(_0x291197,'AI_CHAT_HISTORY_HEADING'),'icon':_0x206f96,'class':'ck-ai-header\x20ck-ai-header_history'});_0x40e2cc&&(this['resizeButton']=gs(_0x291197,this),_0x19bfbb['children']['add'](this['resizeButton'])),this['sectionsView']=new oa(_0x291197,[]),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',_0x378a08=>!_0x378a08)]}}),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':[_0x19bfbb,{'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 _0x505f12=new _0x1e1459(this['locale'],{'filteredView':this['sectionsView'],'queryView':{'label':us(this['locale'],'AI_CHAT_HISTORY_SEARCH_LABEL')},'infoView':{'text':{'notFound':{'primary':_0x7346a7=>us(this['locale'],'AI_CHAT_HISTORY_SEARCH_NOT_FOUND_PRIMARY',_0x7346a7),'secondary':us(this['locale'],'AI_CHAT_HISTORY_SEARCH_NOT_FOUND_SECONDARY')}}}}),_0x1ff909=this['_createErrorView']();return _0x1ff909['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('errorMessage','ck-hidden',_0x2092e5=>!_0x2092e5)]}}),_0x505f12['on']('render',()=>{_0x505f12['children']['add'](_0x1ff909,0x1);}),_0x505f12['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isSearchViewVisible','ck-hidden',_0x3718a5=>!_0x3718a5)]}}),_0x505f12;}['_createSkeletonView'](){const _0x2337ed=new sr(this['locale'],nr['aiHistory']);return _0x2337ed['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isLoading','ck-hidden',_0x483842=>!_0x483842)]}}),_0x2337ed;}['_createErrorView'](){const _0x34226b=new vt(this['locale']),_0x370301=new Nt(this['locale']);_0x370301['set']({'withText':!0x1,'icon':_0x2d333c,'class':'ck-ai-notification_error__dismiss-button'}),_0x370301['bind']('isVisible')['to'](this,'hasItems',_0x1f1e78=>!!_0x1f1e78),_0x370301['on']('execute',()=>{this['errorMessage']='';});const _0x247a0f=this['bindTemplate'];return _0x34226b['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-notification','ck-ai-notification_error']},'children':[{'tag':'p','children':[{'text':_0x247a0f['to']('errorMessage')}]},_0x370301]}),_0x34226b;}['_createEmptyStateView'](){const _0x6160b4=new Nt(this['locale']);_0x6160b4['set']({'label':us(this['locale'],'AI_CHAT_LABEL_NEW_CHAT'),'withText':!0x0,'icon':_0x4282f7,'class':'ck-ai-chat__start-conversation\x20'+_s}),_0x6160b4['on']('execute',()=>{this['fire']('openChat');});const _0x58df6f=new vt(this['locale']);return _0x58df6f['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-chat-history__empty',this['bindTemplate']['if']('isEmptyViewVisible','ck-hidden',_0x4cc1ee=>!_0x4cc1ee)]},'children':[{'tag':'p','attributes':{'class':['ck-ai-chat-history__empty-message']},'children':[us(this['locale'],'AI_CHAT_HISTORY_EMPTY_MESSAGE')]},_0x6160b4]}),_0x58df6f;}['_createListItemViews'](_0x12e7f8,_0x3287a6){const _0x7e5f80=[];for(const _0x3bba84 of _0x12e7f8){const _0x1218fb=new ca(_0x3287a6,_0x3bba84);_0x1218fb['delegate'](...ua)['to'](this),_0x7e5f80['push'](_0x1218fb);}return _0x7e5f80;}['updateHistoryItemsWithCategories'](_0x36c06c){const _0xe045b6=this['locale']||'en',_0x1bc944=[];for(const _0x4e5ee6 of _0x36c06c){const _0x4b1e60=this['_createListItemViews'](_0x4e5ee6['items'],_0xe045b6);_0x1bc944['push'](new ha(_0xe045b6,{'title':_0x4e5ee6['title'],'items':_0x4b1e60}));}this['sectionsView']['sections']=_0x1bc944,this['sectionsView']['items']['clear'](),this['sectionsView']['items']['addMany'](_0x1bc944),this['hasItems']=_0x36c06c['some'](_0x481443=>_0x481443['items']['length']>0x0),this['_refreshSearch']();}['removeHistoryItem'](_0x520011){for(const _0x21a285 of this['sectionsView']['sections']){const _0x166bfc=_0x21a285['getItem'](_0x520011);if(_0x166bfc){if(_0x21a285['removeItem'](_0x166bfc),0x0===_0x21a285['itemsViews']['length']){const _0x3cf72b=this['sectionsView']['sections']['indexOf'](_0x21a285);-0x1!==_0x3cf72b&&(this['sectionsView']['sections']['splice'](_0x3cf72b,0x1),this['sectionsView']['items']['remove'](_0x21a285));}this['hasItems']=this['sectionsView']['sections']['length']>0x0,this['_refreshSearch']();break;}}}['updateItemTitle'](_0x42169e,_0x4c2764){for(const _0x25fcc2 of this['sectionsView']['sections']){const _0x27cbcb=_0x25fcc2['getItem'](_0x42169e);if(_0x27cbcb){_0x27cbcb['updateTitle'](_0x4c2764);break;}}}['updateItemLoadingState'](_0x4206ab,_0x46347f,_0x44952e){for(const _0x2008f1 of this['sectionsView']['sections']){const _0x52cd70=_0x2008f1['getItem'](_0x4206ab);if(_0x52cd70){_0x52cd70['updateLoadingState'](_0x46347f,_0x44952e);break;}}}['_refreshSearch'](){if(this['hasItems']){const _0x5a2eb6=this['searchView']['queryView']['fieldView']?.['element']?.['value']||'';this['searchView']['search'](_0x5a2eb6);}}}const ua=['showConversationHistory','removeConversation','editConversationTitle','setConversationPinned','selectConversation','openChat','resizeTabs'];class da extends _0x20e290{static get['requires'](){return[cs];}['_historyView'];static get['pluginName'](){return'AIChatHistoryUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x389e3a){super(_0x389e3a);const _0x195829=this['context']['plugins']['get']('AITabs');this['_historyView']=new la(this['context']['locale'],_0x195829['showResizeButton']),this['_historyView']['delegate'](...ua)['to'](this),_0x195829['view']['addTab']({'id':'history','buttonLabel':us(this['context']['locale'],'AI_CHAT_HISTORY_HEADING'),'buttonIcon':_0x206f96,'order':0x0,'content':this['_historyView']});}['removeHistoryItem'](_0x2cb3c9){this['_historyView']['removeHistoryItem'](_0x2cb3c9);}['updateItems'](_0x11e7a9){this['_historyView']['updateHistoryItemsWithCategories'](_0x11e7a9);}['updateItemTitle'](_0xfe9d66,_0x383c9a){this['_historyView']['updateItemTitle'](_0xfe9d66,_0x383c9a);}['updateItemLoadingState'](_0x33d70e,_0x411b8d,_0x9618ac){this['_historyView']['updateItemLoadingState'](_0x33d70e,_0x411b8d,_0x9618ac);}['setLoadingSkeleton'](_0x1e5237){this['_historyView']['isLoading']=_0x1e5237;}['showError'](_0x255050){this['_historyView']['errorMessage']=_0x255050;}['hideError'](){this['_historyView']['errorMessage']='';}['setIsMaximized'](_0x56d5ab){this['_historyView']['isMaximized']=_0x56d5ab;}}class _a extends ct(){['id'];['createdAt'];constructor({id:_0x57dd51,title:_0x38c32c,createdAt:_0x475238,updatedAt:_0x3c8ff8,pinned:_0x566681}){super(),this['id']=_0x57dd51,this['createdAt']=new Date(_0x475238),this['set']('title',_0x38c32c),this['set']('updatedAt',_0x3c8ff8?new Date(_0x3c8ff8):null),this['set']('pinned',_0x566681||!0x1);}['updateTitle'](_0x4e5177){this['set']('title',_0x31dc1d(_0x4e5177)),this['updatedAt']=new Date();}['updatePinned'](_0x5578d2){this['set']('pinned',_0x5578d2),this['updatedAt']=new Date();}}class Aa extends pt(){['items']=[];['connector'];['group'];constructor({connector:_0x2195ed,group:_0x5bf843}){super(),this['connector']=_0x2195ed,this['group']=_0x5bf843;}async['init'](){try{const _0xb28b1b=this['connector']['fetchConversations'](this['group']),_0x690daa=await _0xb28b1b['getConversations']();this['loadItems'](_0x690daa);}catch(_0x9742ef){this['fire']('error',{'error':_0x9742ef,'operation':'init'});}}['addItem'](_0x330c1a){this['items']['push'](_0x330c1a);}async['removeItem'](_0x41c083){const _0x5eaf2a=this['items']['findIndex'](_0x12975b=>_0x12975b['id']===_0x41c083);if(-0x1===_0x5eaf2a)return!0x1;try{return await this['connector']['deleteConversation'](_0x41c083)['execute'](),this['items']['splice'](_0x5eaf2a,0x1),this['fire']('itemRemoved',{'itemId':_0x41c083}),!0x0;}catch(_0x9d1e53){return this['fire']('error',{'error':_0x9d1e53,'operation':'removeItem','itemId':_0x41c083}),!0x1;}}['getItem'](_0x25640d){return this['items']['find'](_0x5d4641=>_0x5d4641['id']===_0x25640d);}async['updateItemTitle'](_0x43e359,_0x411aa9){const _0x279eba=this['getItem'](_0x43e359);if(!_0x279eba)return!0x1;try{return await this['connector']['updateConversation'](_0x43e359,{'title':_0x411aa9})['getResult'](),_0x279eba['updateTitle'](_0x411aa9),this['fire']('itemUpdated',{'itemId':_0x43e359,'updates':{'title':_0x411aa9}}),!0x0;}catch(_0x40ec0d){return this['fire']('error',{'error':_0x40ec0d,'operation':'updateItemTitle','itemId':_0x43e359}),!0x1;}}async['updateItemPinned'](_0x43c25a,_0x4f0e49){const _0x58a98d=this['getItem'](_0x43c25a);if(!_0x58a98d)return!0x1;try{return await this['connector']['updateConversation'](_0x43c25a,{'pinned':_0x4f0e49})['getResult'](),_0x58a98d['updatePinned'](_0x4f0e49),this['fire']('itemUpdated',{'itemId':_0x43c25a,'updates':{'pinned':_0x4f0e49}}),!0x0;}catch(_0x55a137){return this['fire']('error',{'error':_0x55a137,'operation':'updateItemPinned','itemId':_0x43c25a}),!0x1;}}['loadItems'](_0x1010d9){try{this['items']=[],_0x1010d9['map'](_0x49c5a4=>{this['addItem'](new _a(_0x49c5a4));}),this['fire']('itemsLoaded',{'items':[...this['items']]});}catch(_0x130bce){this['fire']('error',{'error':_0x130bce,'operation':'loadItems'});}}['getItems'](_0x53b444={}){const _0x3a445d=void 0x0!==_0x53b444['pinned']&&_0x53b444['pinned'],_0x3ca95b=_0x53b444['from']?new Date(_0x53b444['from']['getFullYear'](),_0x53b444['from']['getMonth'](),_0x53b444['from']['getDate']()):null,_0x58f30c=_0x53b444['to']?new Date(_0x53b444['to']['getFullYear'](),_0x53b444['to']['getMonth'](),_0x53b444['to']['getDate']()):null;return this['items']['filter'](_0x1632a5=>{if(_0x1632a5['pinned']!==_0x3a445d)return!0x1;if(_0x58f30c){const _0x4b3829=new Date(_0x1632a5['createdAt']['getFullYear'](),_0x1632a5['createdAt']['getMonth'](),_0x1632a5['createdAt']['getDate']());return _0x3ca95b?_0x3ca95b['getTime']()===_0x58f30c['getTime']()?_0x4b3829['getTime']()===_0x3ca95b['getTime']():_0x4b3829<_0x58f30c&&_0x4b3829>=_0x3ca95b:_0x4b3829<_0x58f30c;}return!0x0;});}}class ga extends _0x20e290{['_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 _0x763dcf=this['context']['plugins']['get'](cs);try{const _0xb29879=this['_aiChatController']['getGroupId']();this['history']=new Aa({'connector':this['_aiConnector'],'group':_0xb29879}),this['listenTo'](this['_aiChatHistoryUi'],'removeConversation',(_0x167b06,_0x3359ed)=>{this['_setItemLoading'](_0x3359ed['id'],'remove'),this['_handleRemove'](_0x3359ed['id']);}),this['listenTo'](this['_aiChatHistoryUi'],'editConversationTitle',(_0x385ed8,_0x53138f)=>{this['_setItemLoading'](_0x53138f['id'],'rename'),this['_handleEditTitle'](_0x53138f['id'],_0x53138f['title']);}),this['listenTo'](this['history'],'itemUpdated',(_0x370f34,_0x4d308f)=>{void 0x0!==_0x4d308f['updates']['title']&&this['_aiChatHistoryUi']['updateItemTitle'](_0x4d308f['itemId'],_0x4d308f['updates']['title']),void 0x0!==_0x4d308f['updates']['pinned']&&this['_updateHistoryItemsUI'](),this['_clearItemLoading'](_0x4d308f['itemId']);}),this['listenTo'](this['history'],'itemRemoved',(_0x4c1dd3,_0x109bec)=>{this['_aiChatController']['_handleRemovedConversation'](_0x109bec['itemId']),this['_aiChatHistoryUi']['removeHistoryItem'](_0x109bec['itemId']),this['_clearItemLoading'](_0x109bec['itemId']);}),this['listenTo'](this['history'],'itemsLoaded',()=>{this['_updateHistoryItemsUI']();}),this['listenTo'](this['history'],'error',(_0x5d6096,_0x1a4f08)=>{this['_handleHistoryErrorUI'](_0x1a4f08['error'],_0x1a4f08['operation'],_0x1a4f08['itemId']);}),this['listenTo'](this['_aiChatHistoryUi'],'selectConversation',(_0x3fe925,_0x58dd05)=>{this['_handleSelectConversation'](_0x58dd05['id']);}),this['listenTo'](this['_aiChatHistoryUi'],'setConversationPinned',(_0x54da66,_0x326475)=>{const _0x399011=_0x326475['pinned']?'pin':'unpin';this['_setItemLoading'](_0x326475['id'],_0x399011),this['_handleTogglePin'](_0x326475['id'],_0x326475['pinned']);}),this['listenTo'](this['_aiChatHistoryUi'],'openChat',()=>{_0x763dcf['view']['activateTab']('chat');}),this['listenTo'](this['_aiChatController'],'change:activeConversation',()=>{this['_updateHistoryItemsUI']();}),_0x763dcf['view']['on']('activateTab:history',()=>{this['_showConversationHistory']();}),this['listenTo'](_0x763dcf,'resizedTabs',(_0x5d1045,_0x3d8c93)=>{this['_setIsMaximized'](_0x3d8c93);}),this['listenTo'](this['_aiChatHistoryUi'],'resizeTabs',()=>{_0x763dcf['resize']();});}catch(_0x223a90){this['_handleHistoryErrorUI'](_0x223a90,'init');}}async['_handleEditTitle'](_0x263f7e,_0x109dd6){await this['history']['updateItemTitle'](_0x263f7e,_0x109dd6);}async['_handleTogglePin'](_0x5e1945,_0x29a56b){await this['history']['updateItemPinned'](_0x5e1945,_0x29a56b);}async['_handleRemove'](_0x3ccca3){await this['history']['removeItem'](_0x3ccca3);}async['_handleSelectConversation'](_0x414f93){await this['_aiChatController']['loadConversation'](_0x414f93);}async['_showConversationHistory'](){this['_aiChatHistoryUi']['showError'](''),this['_aiChatHistoryUi']['setLoadingSkeleton'](!0x0),await this['history']['init'](),this['_aiChatHistoryUi']['setLoadingSkeleton'](!0x1);}['_updateHistoryItemsUI'](){const _0x1ab9f5=this['_aiChatController']['activeConversation']?.['id'],_0x54ca67=this['_getCategorizedItems']()['map'](_0xec8971=>({'title':_0xec8971['title'],'items':_0xec8971['items']['map'](_0xff5856=>({'id':_0xff5856['id'],'title':_0xff5856['title']||us(this['context']['locale'],'AI_CHAT_UNTITLED_CONVERSATION'),'createdAt':new Date(_0xff5856['createdAt'])['toLocaleDateString'](),'active':_0xff5856['id']===_0x1ab9f5,'pinned':_0xff5856['pinned']}))}));this['_aiChatHistoryUi']['updateItems'](_0x54ca67);}['_setItemLoading'](_0x9e6065,_0x1f99c8){this['_aiChatHistoryUi']['updateItemLoadingState'](_0x9e6065,_0x1f99c8,!0x0);}['_clearItemLoading'](_0x122c44){this['_aiChatHistoryUi']['updateItemLoadingState'](_0x122c44,null,!0x1);}['_handleHistoryErrorUI'](_0x497c31,_0x51281e,_0x3e2bf1){const _0x5a892a=this['_generateErrorMessage'](_0x51281e,_0x3e2bf1);this['_aiChatHistoryUi']['showError'](_0x5a892a),_0x3e2bf1&&this['_clearItemLoading'](_0x3e2bf1),this['_aiChatHistoryUi']['setLoadingSkeleton'](!0x1);}['_generateErrorMessage'](_0x207687,_0xcb46d4){const _0x5c6b82=_0xcb46d4?this['history']['getItem'](_0xcb46d4):null,_0x350bd2=_0x5c6b82?.['title']||us(this['context']['locale'],'AI_CHAT_UNTITLED_CONVERSATION');switch(_0x207687){case'updateItemTitle':return us(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_UPDATE_TITLE',_0x350bd2);case'updateItemPinned':{const _0x1ea115=us(this['context']['locale'],_0x5c6b82?.['pinned']?'AI_CHAT_HISTORY_UNPIN_ACTION':'AI_CHAT_HISTORY_PIN_ACTION');return us(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_UPDATE_PINNED',[_0x1ea115,_0x350bd2]);}case'removeItem':return us(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_REMOVE_ITEM',_0x350bd2);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 _0x1fbd2c=new Date(),_0x4c1523=new Date(_0x1fbd2c['getFullYear'](),_0x1fbd2c['getMonth'](),_0x1fbd2c['getDate']()),_0x3cc44f=new Date(_0x4c1523);_0x3cc44f['setDate'](_0x3cc44f['getDate']()-0x1);const _0x379edf=new Date(_0x4c1523);_0x379edf['setDate'](_0x379edf['getDate']()-0xe);const _0x428232=this['history']['getItems']({'pinned':!0x0}),_0x4c7053=this['history']['getItems']({'from':_0x4c1523,'to':_0x4c1523}),_0x10edac=this['history']['getItems']({'from':_0x3cc44f,'to':_0x3cc44f}),_0x240721=this['history']['getItems']({'from':_0x379edf,'to':_0x3cc44f}),_0x3d8dd1=this['history']['getItems']({'to':_0x379edf}),_0x230066=[];return _0x428232['length']>0x0&&_0x230066['push']({'title':us(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_PINNED'),'items':_0x428232}),_0x4c7053['length']>0x0&&_0x230066['push']({'title':us(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_TODAY'),'items':_0x4c7053}),_0x10edac['length']>0x0&&_0x230066['push']({'title':us(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_YESTERDAY'),'items':_0x10edac}),_0x240721['length']>0x0&&_0x230066['push']({'title':us(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_LAST_14_DAYS'),'items':_0x240721}),_0x3d8dd1['length']>0x0&&_0x230066['push']({'title':us(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_LATER'),'items':_0x3d8dd1}),_0x230066;}['_setIsMaximized'](_0x461e4a){this['_aiChatHistoryUi']['setIsMaximized'](_0x461e4a);}}class Ia extends _0x20e290{static get['requires'](){return[ga,da];}static get['pluginName'](){return'AIChatHistory';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}class Ea extends _0x20e290{static get['requires'](){return[Js,tn,aa,Ia];}static get['pluginName'](){return'AIChat';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x58a32f){super(_0x58a32f),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(_0x3af1ff,_0x170622){super(_0x3af1ff);const {id:_0x5cc01c,type:_0x2a611a,icon:_0x229ec0}=_0x170622;this['id']=_0x5cc01c,this['set']({'label':_0x170622['label'],'withText':!0x0,'class':'ck-ai-chat-shortcut'}),this['extendTemplate']({'attributes':{'data-cke-ai-shortcut-id':_0x170622['id']}}),_0x229ec0?this['icon']=_0x229ec0:'chat'===_0x2a611a?this['icon']=_0x29e983:'review'===_0x2a611a?this['icon']=_0x373b59:'translate'===_0x2a611a&&(this['icon']=_0x3ec8c7);}}class Ta extends vt{['listView'];constructor(_0x5dc18b,_0x34f7e6){super(_0x5dc18b);const _0x50b638=_0x34f7e6['map'](_0x6327f8=>{const _0x5bab3d=new Ht(this['locale']),_0x5980b9=new pa(this['locale'],_0x6327f8);return _0x5bab3d['children']['add'](_0x5980b9),_0x5980b9['delegate']('execute')['to'](this),_0x5bab3d;});this['listView']=new Dt(this['locale']),this['listView']['items']['addMany'](_0x50b638),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat-shortcuts']},'children':[this['listView']]});}}const ma='chat-shortcuts';var Ca=function(_0x4522ba){return _0x4522ba['CHAT']='chat',_0x4522ba['REVIEW']='review',_0x4522ba['TRANSLATE']='translate',_0x4522ba;}({});class wa extends _0x20e290{['_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 _0x49080=this['context']['plugins']['get']('AIChatController');this['_shortcuts']['length']&&(this['_validateShortcuts'](),this['_aiChatUI']['on']('conversationCreated',()=>{_0x49080['activeConversation']['isFromHistory']||this['_injectShortcuts']();}),this['listenTo'](_0x49080,'interactionStarted',()=>{this['_removeShortcuts']();}));}['_validateShortcuts'](){const _0x4241bd=Object['values'](Ca);this['_shortcuts']['forEach'](_0x1e9f8c=>{let _0x26e7f0=!0x0;if(_0x1e9f8c['id']&&_0x1e9f8c['label']&&_0x4241bd['includes'](_0x1e9f8c['type'])?'chat'===_0x1e9f8c['type']&&(_0x26e7f0='string'==typeof _0x1e9f8c['prompt']):_0x26e7f0=!0x1,!_0x26e7f0)throw new ht('ai-chat-shortcuts-invalid-config',this['context'],{'shortcut':_0x1e9f8c});});}['_injectShortcuts'](){const _0x90766d=this['context']['plugins']['get'](aa);this['_shortcutsView']=new Ta(this['context']['locale'],this['_shortcuts']),this['_shortcutsView']['render'](),_0x90766d['addFeedItemCustomElement'](this['_shortcutsView']['element'],ma),this['_shortcutsView']['on']('execute',_0x541b31=>{const _0x17c018=_0x541b31['source']['id'];this['_executeShortcut'](_0x17c018);});}['_removeShortcuts'](){const _0xbec0f1=this['context']['plugins']['get'](aa);_0xbec0f1['hasFeedItem'](ma)&&_0xbec0f1['removeFeedItem'](ma),this['_shortcutsView']?.['destroy']();}['_executeShortcut'](_0x3501da){const _0x4f46ef=this['_shortcuts']['find'](_0x36fcb3=>_0x36fcb3['id']===_0x3501da),_0x12c6c1=_0x4f46ef['type'];'chat'===_0x12c6c1?this['_runChatShortcut'](_0x4f46ef):'review'===_0x12c6c1?_0x4f46ef['commandId']?this['_runReviewShortcut'](_0x4f46ef):this['_switchTab']('reviewMode'):'translate'===_0x12c6c1&&(_0x4f46ef['language']?this['_runTranslateShortcut'](_0x4f46ef):this['_switchTab']('translate'));}['_switchTab'](_0x4ce8f1){if(!this['context']['plugins']['has']('AITabs'))throw new ht('ai-chat-shortcuts-ai-tabs-not-found',this['context'],{'tabName':_0x4ce8f1});this['context']['plugins']['get']('AITabs')['view']['activateTab'](_0x4ce8f1);}async['_runChatShortcut']({prompt:_0x2f3d67,draftMode:_0x1c15f4,useWebSearch:_0x6100e8=!0x1,useReasoning:_0x18a2f2=!0x1,model:_0x215377}){const _0x316061=this['context']['plugins']['get']('AIChatController'),_0x5bed7d=_0x316061['activeConversation'];let _0x1106b8;_0x1106b8=_0x215377?await _0x5bed7d['chatModels']['getModel'](_0x215377):await _0x5bed7d['chatModels']['getDefault'](),_0x1106b8&&await _0x5bed7d['setModel'](_0x1106b8),_0x5bed7d['setWebSearch'](_0x6100e8),_0x5bed7d['setReasoning'](_0x18a2f2),_0x316061['addCurrentDocumentToChatContext'](),_0x1c15f4?(this['_aiChatUI']['setPromptInputValue'](_0x2f3d67),this['_aiChatUI']['focusPromptInput'](!0x0)):_0x316061['sendMessage']({'message':_0x2f3d67});}['_runReviewShortcut']({commandId:_0xcb9947,model:_0x5d4dbf,prompt:_0x1182fe,params:_0x51b513}){if(!this['context']['plugins']['has']('AIReviewModeUI'))throw new ht('ai-chat-shortcuts-review-mode-not-found',this['context']);this['_switchTab']('reviewMode');const _0x3bb07d={'id':_0xcb9947,'isCustom':'custom'===_0xcb9947};_0x5d4dbf&&_0x1182fe&&(_0x3bb07d['args']={'model':_0x5d4dbf,'prompt':_0x1182fe}),_0x51b513&&(_0x3bb07d['params']=_0x51b513),this['context']['plugins']['get']('AIReviewModeUI')['fire']('runReviewCheck',_0x3bb07d);}['_runTranslateShortcut']({language:_0x5cf8c4}){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':_0x5cf8c4,'args':{'language':_0x5cf8c4}});}}class fa extends _0x385b22{constructor(_0x3c5bfa){super(_0x3c5bfa);const _0x4c2f3b=_0x3c5bfa['plugins']['get']('AITabs')['view'];this['bind']('value')['to'](_0x4c2f3b,'isVisible'),this['isEnabled']=!0x0;}['execute'](){const _0xb81e25=this['editor']['plugins']['get']('AITabs')['view'];_0xb81e25['isVisible']=!_0xb81e25['isVisible'];}}class Sa extends _0x52790d{static get['requires'](){return[cs];}static get['pluginName'](){return'AIToggleButtonUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const _0x54c20f=this['editor'];_0x54c20f['commands']['add']('toggleAi',new fa(_0x54c20f)),_0x54c20f['ui']['componentFactory']['add']('toggleAi',()=>{const _0x49608b=this['_createAIUIButton'](Nt);return _0x49608b['set']({'tooltip':!0x0,'class':'ck-ai-toggle-button'}),_0x49608b;}),_0x54c20f['ui']['componentFactory']['add']('menuBar:toggleAi',()=>{const _0x4e0b85=this['_createAIUIButton'](Wt);return _0x4e0b85['set']({'role':'menuitemcheckbox'}),_0x4e0b85;});}['_createAIUIButton'](_0x2b5ce4){const _0x572e4a=this['editor'],_0x146609=_0x572e4a['commands']['get']('toggleAi'),_0x1f8814=new _0x2b5ce4(_0x572e4a['locale']);return _0x1f8814['set']({'label':us(_0x572e4a['locale'],'AI_TOGGLE_BUTTON_LABEL'),'icon':_0x2cb285,'isToggleable':!0x0}),_0x1f8814['bind']('isEnabled')['to'](_0x146609),_0x1f8814['bind']('isOn')['to'](_0x146609,'value',_0x5ba1e3=>!!_0x5ba1e3),this['listenTo'](_0x1f8814,'execute',()=>{_0x146609['execute']();}),_0x1f8814;}}const ba=['applySuggestion','insertSuggestion','showNext','showPrevious'];class Ra extends vt{['_errorView'];constructor(_0x17ad58){super(_0x17ad58),this['set']('_errorMessage',''),this['set']('_isErrorVisible',!0x1);}['showBlockingError'](_0x57e016){this['showError'](_0x57e016);}['showError'](_0x29afab){this['_errorView']||(this['_errorView']=this['_createErrorView']()),this['_errorMessage']=_0x29afab,this['_isErrorVisible']=!0x0;}['hideError'](){this['_isErrorVisible']=!0x1;}['_createErrorView'](){const _0xf922dd=new vt(this['locale']),_0x456324=new vt(this['locale']);return _0x456324['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai-suggestion__error-text']},'children':[{'text':this['bindTemplate']['to']('_errorMessage')}]}),_0xf922dd['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__error','ck-ai-balloon-error',this['bindTemplate']['if']('_isErrorVisible','ck-hidden',_0x3dfac5=>!_0x3dfac5)]},'children':[_0x456324]}),_0xf922dd;}}const Oa=0xa;class ka extends _0x20e290{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'](_0x3a051c){const {id:_0x1a4d3e}=this['_currentConfig']??{};this['_currentConfig']=_0x3a051c;const {id:_0x2f6e27}=this['_currentConfig'];this['isOpen']&&_0x1a4d3e===_0x2f6e27?this['_updateDialog']():this['_showDialog']();}['close'](){const _0x5218b0=Xs(this['context'])['plugins']['get']('Dialog');_0x5218b0['isOpen']&&this['_currentConfig']&&_0x5218b0['id']===this['_currentConfig']['id']&&_0x5218b0['hide']();}['_updateDialog'](){const _0x1268ae=Xs(this['context'])['plugins']['get']('Dialog'),{icon:_0x31eafc,title:_0x5e8afd}=this['_currentConfig'];_0x1268ae['view']?.['headerView']&&(_0x1268ae['view']['headerView']['label']=_0x5e8afd,_0x1268ae['view']['headerView']['iconView']&&_0x31eafc&&(_0x1268ae['view']['headerView']['iconView']['content']=_0x31eafc)),this['_isUpdatingMarkers']=!0x0,this['_showFakeVisualSelection'](),this['_isUpdatingMarkers']=!0x1,_0x1268ae['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 _0x1b02a4=Xs(this['context'])['plugins']['get']('Dialog'),{id:_0x2dc72f,title:_0x3f845c,icon:_0x5ec3b9,class:_0x57e7ab,mainView:_0x589216}=this['_currentConfig'];_0x589216['delegate'](...ba)['to'](this),_0x1b02a4['show']({'title':_0x3f845c,'icon':_0x5ec3b9,'hasCloseButton':!0x0,'id':_0x2dc72f,'position':this['_calculateDialogPosition']['bind'](this),'className':'ck-ai-balloon\x20'+(_0x57e7ab||''),'content':_0x589216,'onShow':_0x576ed6=>{this['_showFakeVisualSelection'](),this['_setupFakeVisualSelectionMarkerRemovalListener']();const _0x4e96f1=this['_getSelectionElements']();_0x4e96f1&&_0x4e96f1[0x0]&&Ct({'target':_0x4e96f1[0x0],'ancestorOffset':0x14,'alignToTop':!0x0,'viewportOffset':{'top':0x14,'bottom':0x14,'left':0x0,'right':0x0}}),this['isOpen']=!0x0,_0x576ed6['once']('hide',()=>{this['fire']('beforeDialogClosed',{'id':_0x2dc72f});},{'priority':'high'});},'onHide':()=>{this['_hideFakeVisualSelection'](),this['_cleanupFakeVisualSelectionMarkerRemovalListener'](),this['fire']('dialogClosed',{'id':_0x2dc72f}),this['isOpen']=!0x1;}});}['_calculateDialogPosition'](_0x1cc6ee,_0x5ec907){if(!_0x5ec907)return null;const _0x2d7985=this['_getSelectionElements']();if(!_0x2d7985||0x0===_0x2d7985['length'])return{'left':Math['round'](_0x5ec907['left']+_0x5ec907['width']/0x2-_0x1cc6ee['width']/0x2),'top':Math['round'](_0x5ec907['top']+_0x5ec907['height']/0x2-_0x1cc6ee['height']/0x2)};const _0xe8d11e=Math['round'](_0x5ec907['left']+_0x5ec907['width']/0x2-_0x1cc6ee['width']/0x2),_0x3c242b=_0x2d7985['map'](_0x16d14f=>new dt(_0x16d14f)),_0xfd9f11=_0x1cc6ee['height'];return{'left':_0xe8d11e,'top':this['_calculateOptimalTopPosition'](_0x3c242b,_0xfd9f11,_0x5ec907)};}['_calculateOptimalTopPosition'](_0x3e3a8b,_0x5ba7c6,_0x56305a){const _0x3b98c9=new dt(lt['window']),_0x442b4e=_0x3e3a8b['map'](_0x5323a6=>_0x5323a6['getVisible']())['filter'](_0x459afd=>_0x459afd),_0x4117ca=dt['getBoundingRect'](_0x442b4e);if(!_0x4117ca)return Math['round'](_0x56305a['top']+_0x56305a['height']/0x2);const _0x2e5742=_0x3b98c9['getIntersection'](_0x4117ca);if(!_0x2e5742)return Math['round'](_0x56305a['top']+_0x56305a['height']/0x2);const _0x507dd7=_0x56305a['getVisible'](),_0x13e3fa=_0x507dd7&&_0x4117ca['height']>_0x507dd7['height'],_0x41fa93=_0x2e5742['top'],_0x1ff479=_0x2e5742['bottom'];if(_0x13e3fa){const _0x393c19=(_0x507dd7||_0x3b98c9)['height']/0x2-_0x5ba7c6/0x2,_0x4d72a0=_0x41fa93-Oa-_0x56305a['top'],_0x526080=_0x56305a['bottom']-_0x1ff479-Oa;return _0x4d72a0>=_0x5ba7c6?Math['max'](Oa,_0x41fa93-_0x5ba7c6-Oa):_0x526080>=_0x5ba7c6?_0x1ff479+Oa:Math['max'](Oa,_0x393c19);}const _0x11247c=_0x41fa93-_0x5ba7c6,_0x703ff8=_0x56305a['bottom']-_0x1ff479-Oa,_0x9d8c56=_0x41fa93-Oa-_0x56305a['top'];let _0x43b6b8;if(_0x703ff8>=_0x5ba7c6)_0x43b6b8=_0x1ff479+Oa;else{if(_0x9d8c56>=_0x5ba7c6)_0x43b6b8=_0x11247c-Oa;else _0x43b6b8=_0x41fa93+_0x4117ca['height']/0x2-_0x5ba7c6/0x2;}return _0x43b6b8;}['_setupFakeVisualSelectionMarkerRemovalListener'](){const _0xac86f0=Xs(this['context']);this['listenTo'](_0xac86f0['model']['document'],'change',()=>{if(!this['_isUpdatingMarkers']){for(const {name:_0x57b293,data:{newRange:_0x167445}}of _0xac86f0['model']['document']['differ']['getChangedMarkers']())if(_0x57b293['startsWith'](Zs+':')&&(_0x167445&&(_0x167445['start']['isEqual'](_0x167445['end'])||'$graveyard'==_0x167445['root']['rootName'])||null==_0x167445)){const _0x5dfa23=us(this['context']['locale'],'AI_BALLOON_SELECTION_REMOVED_ERROR');this['_currentConfig']['mainView']['showBlockingError'](_0x5dfa23),this['fire']('selectionRemoved');}}});}['_cleanupFakeVisualSelectionMarkerRemovalListener'](){const _0x277692=Xs(this['context']);this['_currentConfig']['mainView']['hideError'](),this['stopListening'](_0x277692['model']['document']);}['_getSelectionElements'](){const _0x27fe53=Xs(this['context']);return _0x173e3b(_0x27fe53['editing'],[..._0x27fe53['model']['markers']['getMarkersGroup']('ai-selection'),..._0x27fe53['model']['markers']['getMarkersGroup']('ai-balloon-selection')]);}}class Na extends kt{['copyButton'];['likeButton'];['dislikeButton'];['showChangesButton'];['_config'];constructor(_0x5172ad,_0x58066e={}){super(_0x5172ad),this['set']('isEnabled',!0x0),this['set']('isShowChangesOn',!0x1),this['_config']={'showCopy':!0x1,'showLike':!0x1,'showDislike':!0x1,..._0x58066e};const _0x4e300d=!(this['_config']['showCopy']||this['_config']['showChanges']||this['_config']['showLike']||this['_config']['showDislike']||this['_config']['customView']?.['length']);this['class']=_0x4e300d?'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'](_0x4cfa7d){this['showChangesButton']['isEnabled']=_0x4cfa7d;}['_setupRatingButtons'](){this['likeButton']=new Nt(this['locale']),this['likeButton']['set']({'icon':_0x2bef5e,'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':_0x17058b,'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':_0x20733a,'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 _0x53773b=new xt();_0x53773b['set']({'content':_0x4dbbde}),_0x53773b['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'](_0x53773b);}['_setupShowChangesButton'](){this['showChangesButton']=new Nt(this['locale']),this['showChangesButton']['set']({'icon':_0xb9919f,'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',_0x5c8343=>_0x5c8343?_0x25d95d:_0xb9919f),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(_0x48ca9a,_0xdc3a4f){super(_0x48ca9a);const _0x104ad9=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']=_0xdc3a4f,this['nextButtonView']=this['_createNextButtonView'](),this['previousButtonView']=this['_createPreviousButtonView'](),this['_streamableContentView']=new pn(_0x48ca9a),this['_partToolbarView']=new gn(_0x48ca9a,_0xdc3a4f['availableActions']),this['_partToolbarView']['delegate']('applySuggestion','insertSuggestion','rejectSuggestion')['to'](this),this['_togglePartToolbarButtonsVisibility'](_0xdc3a4f),this['_stateView']=new _n(_0x48ca9a),this['_stateView']['isVisible']=!0x1,this['_miniToolbarView']=new Na(_0x48ca9a,{'showChanges':'full'}),this['_miniToolbarView']['bind']('isShowChangesOn')['to'](this,'showDiff'),this['_miniToolbarView']['on']('toggleShowChanges',()=>{this['fire']('toggleSuggestionDisplayMode');}),this['_toolbarContainerView']=new ya(_0x48ca9a,[this['_partToolbarView'],this['_stateView'],this['_miniToolbarView']]),this['children']=this['createCollection']([this['_streamableContentView'],this['_toolbarContainerView']]),this['on']('change:_state',(_0x59cf8f,_0x536111,_0x42c427,_0x42e46e)=>{let _0x2bf988,_0x3616e3;'pending'===_0x42e46e?(_0x2bf988=this['_partToolbarView'],_0x3616e3=this['_stateView']):(_0x2bf988=this['_stateView'],_0x3616e3=this['_partToolbarView']),this['_stateView']['setState'](_0x42c427),_0x2bf988['isVisible']=!0x1,_0x3616e3['isVisible']=!0x0;}),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat-balloon-main',_0x104ad9['to']('_state',_0x37fb83=>'ck-ai-chat-balloon-main_state_'+_0x37fb83)]},'children':this['children']}),this['on']('change:isTrackChangesOn',()=>{this['_togglePartToolbarButtonsVisibility'](_0xdc3a4f);});}['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'](_0x424acb){_0x424acb?.['keepErrors']||this['hideError'](),await this['_streamableContentView']['update'](_0x424acb);}['setState'](_0x5bc2de){this['_state']=_0x5bc2de;}['showError'](_0x510999){super['showError'](_0x510999),this['children']['has'](this['_errorView'])||this['children']['add'](this['_errorView'],0x0);}['hideError'](){this['_isErrorVisible']&&(super['hideError'](),this['togglePartToolbarEnabled'](!0x0));}['showBlockingError'](_0x10bc20){super['showBlockingError'](_0x10bc20),this['togglePartToolbarEnabled'](!0x1);}['toggleRotatorButtonsVisibility'](_0x380b51){this['nextButtonView']['isVisible']=this['previousButtonView']['isVisible']=_0x380b51;}['togglePartToolbarEnabled'](_0x412815){this['_partToolbarView']['isEnabled']=_0x412815;}['_togglePartToolbarButtonsVisibility']({showApplyButton:_0xcec32a,showSuggestButton:_0x56007e}){_0xcec32a=_0xcec32a&&!this['isTrackChangesOn']&&this['_config']['availableActions']['includes']('applySuggestion'),_0x56007e=_0x56007e&&this['_config']['availableActions']['includes']('insertSuggestion'),this['_partToolbarView']['setButtonsVisibility']({'showApplyButton':_0xcec32a,'showSuggestButton':_0x56007e});}['_createNextButtonView'](){const _0x42e1d7=new Nt(this['locale']);return _0x42e1d7['set']({'icon':_0x128602,'label':us(this['locale'],'AI_BALLOON_NEXT_LABEL'),'isVisible':!0x0}),_0x42e1d7['on']('execute',()=>{this['fire']('showNext');}),_0x42e1d7;}['_createPreviousButtonView'](){const _0x3af4d3=new Nt(this['locale']);return _0x3af4d3['set']({'icon':_0xe6b9f7,'label':us(this['locale'],'AI_BALLOON_PREVIOUS_LABEL'),'isVisible':!0x0}),_0x3af4d3['on']('execute',()=>{this['fire']('showPrevious');}),_0x3af4d3;}}class ya extends vt{constructor(_0x1aa3b2,_0x41c88e){super(_0x1aa3b2),this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-chat-balloon__toolbar-container']},'children':_0x41c88e});}}class xa extends _0x52790d{static get['requires'](){return[Bt,ka];}static get['pluginName'](){return'AIChatBalloon';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['_chatBalloonView'];constructor(_0x533c78){super(_0x533c78),this['set']('showDiff',!0x1);}['open'](_0x26e21e){const _0x585c9b=this['editor'];this['_chatBalloonView']||(this['_chatBalloonView']=this['_createChatBalloonView']()),_0x585c9b['plugins']['get']('AIBalloon')['open']({..._0x26e21e,'id':'aiChatBalloon','class':'ck-ai-chat-balloon','mainView':this['_chatBalloonView']}),this['_toggleRotatorButtonsInDialogHeader'](_0x26e21e['showRotator']),this['_chatBalloonView']['togglePartToolbarEnabled'](!_0x26e21e['areActionsDisabled']),this['_restoreDefaultViewFocus']();}['close'](){this['editor']['plugins']['get']('AIBalloon')['close']();}['updateContent'](_0x4c857a){return this['_chatBalloonView']||(this['_chatBalloonView']=this['_createChatBalloonView']()),this['_chatBalloonView']['updateContent'](_0x4c857a);}['setState'](_0x4c4809){this['_chatBalloonView']&&this['_chatBalloonView']['setState'](_0x4c4809);}['_createChatBalloonView'](){const _0x3c5dae=this['editor'],_0x6c0464=_0x3c5dae['plugins']['get']('AIBalloon'),_0xc59982=_0x3c5dae['commands']['get']('trackChanges');let _0x5c369f=_0x3c5dae['config']['get']('ai.availableReplyActions')||[...wn];_0x3c5dae['plugins']['has']('TrackChanges')||(_0x5c369f=_0x5c369f['filter'](_0x502896=>'insertSuggestion'!=_0x502896));const _0x10425b=new va(_0x3c5dae['locale'],{'availableActions':_0x5c369f,'showApplyButton':!0x0,'showSuggestButton':!!_0xc59982});return _0x10425b['bind']('showDiff')['to'](this),_0x10425b['delegate'](...en)['to'](this),_0x10425b['delegate']('showPrevious','showNext')['to'](this),_0x6c0464['delegate']('dialogClosed')['to'](this),_0x10425b['on']('applySuggestion',this['_restoreDefaultViewFocus']['bind'](this)),_0x10425b['on']('insertSuggestion',this['_restoreDefaultViewFocus']['bind'](this)),_0x10425b['on']('rejectSuggestion',this['_restoreDefaultViewFocus']['bind'](this)),_0xc59982&&_0x10425b['bind']('isTrackChangesOn')['to'](_0xc59982,'value'),_0x10425b['render'](),_0x10425b;}['_toggleRotatorButtonsInDialogHeader'](_0x2bb13c){const _0xba3bc2=this['editor'],_0x26b5ba=_0xba3bc2['plugins']['get']('Dialog')['view']['headerView']['children'];this['_chatBalloonView']['toggleRotatorButtonsVisibility'](_0x2bb13c),_0x26b5ba['has'](this['_chatBalloonView']['previousButtonView'])||(_0x26b5ba['addMany']([this['_chatBalloonView']['previousButtonView'],this['_chatBalloonView']['nextButtonView']],0x0),_0xba3bc2['plugins']['get']('AIBalloon')['once']('beforeDialogClosed',()=>{_0x26b5ba['remove'](this['_chatBalloonView']['previousButtonView']),_0x26b5ba['remove'](this['_chatBalloonView']['nextButtonView']);}));}['_restoreDefaultViewFocus'](){this['_chatBalloonView']['focus']();}}class La extends _0x52790d{static get['requires'](){return[Sa,xa,_0x3c59c2];}static get['pluginName'](){return'AIEditorIntegration';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}function Da(_0x49d2f3){const {editor:_0x296e7c,action:_0x432990,withText:_0x2e991c=!0x1,withIcon:_0x5c8390=!0x0,isInDropdown:_0x459a16=!0x0,shouldPreventFocus:_0x459be8=!0x1}=_0x49d2f3;return()=>{const _0x1cefaf=_0x296e7c['locale'],_0x1203a2=new Nt(_0x1cefaf),_0x2efc0a=_0x1203a2['bindTemplate'];_0x459a16&&_0x1203a2['extendTemplate']({'on':{'mouseenter':_0x2efc0a['to'](()=>{_0x459be8&&_0x459be8()||_0x1203a2['focus']();})}});const _0x4b935e=_0x432990['icon']??_0x432990['parent']?.['icon'];return _0x1203a2['set']({'label':_0x432990['label'],'withText':_0x2e991c,'role':'menuitem','icon':_0x5c8390?_0x4b935e??_0x25caf3:void 0x0,'tooltip':!_0x2e991c,'class':'ck-ai-quick-actions-button','isEnabled':_0x432990['isEnabled']}),_0x1203a2['on']('execute',()=>{_0x296e7c['editing']['view']['focus'](),_0x296e7c['commands']['execute']('aiQuickAction',_0x432990);}),_0x1203a2;};}class Pa extends _0x421b3e{['arrowView'];constructor(_0x3ec528,_0x413e18){super(_0x3ec528,_0x413e18);const _0x5069f3=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',_0x38209d=>String(_0x38209d)),'data-cke-tooltip-disabled':_0x5069f3['to']('isOn')},'on':{'mouseenter':_0x5069f3['to']('mouseenter')}});}['render'](){super['render'](),this['children']['add'](this['arrowView']);}['_createArrowView'](){const _0x21d4da=new xt();return _0x21d4da['content']=_0x348d35,_0x21d4da['extendTemplate']({'attributes':{'class':'ck-dropdown-menu-list__nested-menu__button__arrow'}}),_0x21d4da;}}class Ha extends Dt{['_allListItems'];['_allSearchableItems'];constructor(_0x563d40,_0x4e4903,_0x5e7227){super(_0x563d40),this['_allListItems']=_0x4e4903,this['_allSearchableItems']=_0x5e7227;}['filter'](_0x4cbb52){if(!_0x4cbb52)return this['items']['clear'](),this['items']['addMany'](this['_allListItems']),this['_clearHighlight'](),{'resultsCount':this['_allListItems']['length'],'totalItemsCount':this['_allListItems']['length']};const _0x5cab53=_0x4cbb52['source']['toLowerCase']()['trim'](),_0x48c3f5=this['_allSearchableItems']['filter'](_0x487d70=>(_0x487d70['groupLabel']?_0x487d70['label']+'\x20('+_0x487d70['groupLabel']+')':_0x487d70['label'])['toLowerCase']()['includes'](_0x5cab53));return this['items']['clear'](),this['items']['addMany'](_0x48c3f5['sort']((_0x4d48f9,_0x375ebc)=>{const _0x3b51b5=_0x4d48f9['groupLabel'],_0x5ca264=_0x375ebc['groupLabel'];return _0x3b51b5||_0x5ca264?_0x3b51b5?0x1:-0x1:0x0;})['map'](_0x5a02dd=>_0x5a02dd['item'])),this['_highlightQuery'](_0x5cab53,_0x48c3f5),{'resultsCount':_0x48c3f5['length'],'totalItemsCount':this['_allSearchableItems']['length']};}['_highlightQuery'](_0x57ea90,_0x3f51a9){if(!_0x57ea90)return;const _0x27dc4f=new RegExp(_0x1d8d0d(_0x57ea90),'gi');_0x3f51a9['forEach'](_0x6383e6=>{_0x6383e6['highlightViews']&&_0x6383e6['highlightViews']['forEach'](_0x52d858=>{'function'==typeof _0x52d858['highlightText']&&_0x52d858['highlightText'](_0x27dc4f);});});}['_clearHighlight'](){this['_allSearchableItems']['forEach'](_0xaa6da=>{_0xaa6da['highlightViews']&&_0xaa6da['highlightViews']['forEach'](_0x52dc2b=>{'function'==typeof _0x52dc2b['highlightText']&&_0x52dc2b['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(_0x4ddd33,_0x1de909,_0x2804be,_0x2f80e2,_0x3f398d=!0x1){const _0x5c6998=_0x4ddd33['locale'];super(_0x5c6998),this['_bodyCollection']=_0x2f80e2,this['_hasSearch']=_0x3f398d;const _0xf3ab3b=this['_createListItems'](_0x4ddd33,_0x1de909,_0x2804be);this['optionsListView']=new Ha(_0x5c6998,_0xf3ab3b,this['_allSearchableItems']),this['optionsListView']['role']=Ma,this['optionsListView']['items']['addMany'](_0xf3ab3b),this['focusTracker']=new At(),this['keystrokes']=new gt(),_0x3f398d&&(this['_searchTextView']=this['_createSearchTextView']()),this['_focusables']=_0xf3ab3b,this['focusCycler']=new Ut({'focusables':this['_focusables'],'focusTracker':this['focusTracker'],'keystrokeHandler':this['keystrokes']}),_0x3f398d&&this['_searchTextView']&&this['focusCycler']['chain'](this['_searchTextView']['focusCycler']);const _0x417044=_0x3f398d&&this['_searchTextView']?[this['_searchTextView']]:[this['optionsListView']];this['children']=new _0x2ebc1e(_0x417044),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset_all','ck-ai-quick-actions','ck-rounded-corners'],'dir':_0x5c6998['uiLanguageDirection']},'children':this['children']});}['_createSearchTextView'](){return new _0x1e1459(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 _0x38907d=this['_searchTextView']['queryView']['fieldView']['element']['ownerDocument']?.['activeElement'];return this['_searchTextView']['queryView']['fieldView']['element']['contains'](_0x38907d);}['_createListItems'](_0x36bc45,_0x295008,_0x32c116){const _0x1cefd8=new _0x2ebc1e();return _0x295008['forEach'](_0x2a9e9d=>{if('actions'in _0x2a9e9d){const {listItem:_0x40250b}=this['_createActionGroupButton'](_0x36bc45,_0x2a9e9d,_0x32c116);_0x1cefd8['add'](_0x40250b),_0x2a9e9d['actions']['forEach'](_0x223207=>{this['_createActionButton'](_0x36bc45,_0x223207,_0x2a9e9d['label'],_0x2a9e9d['icon']);const {listItem:_0x524fdd,highlightViews:_0x3e7128}=this['_createSearchResultActionButton'](_0x36bc45,_0x223207,_0x2a9e9d['label'],_0x2a9e9d['icon']);this['_allSearchableItems']['push']({'item':_0x524fdd,'label':_0x223207['label'],'groupLabel':_0x2a9e9d['label'],'highlightViews':_0x3e7128});});}else{const {listItem:_0x2a9c1b}=this['_createActionButton'](_0x36bc45,_0x2a9e9d);_0x1cefd8['add'](_0x2a9c1b);const _0x143eae=_0x2a9c1b['children']['first'];if(_0x143eae){const {listItem:_0x56fafa,highlightViews:_0x38157c}=this['_createSearchResultActionButton'](_0x36bc45,_0x2a9e9d);this['_allSearchableItems']['push']({'item':_0x56fafa,'label':_0x143eae['label']||'','highlightViews':_0x38157c});}}}),_0x1cefd8;}['_createActionButton'](_0x42bcd6,_0x531ca0,_0x320b1d,_0xb321f6){const _0x355ec2=new Ht(this['locale']);if(_0x320b1d&&_0xb321f6){const _0x18fd82=new Nt(this['locale']),_0x2cdf17=_0x18fd82['bindTemplate'],_0x46f467=new _0x3faae3();_0x46f467['text']=_0x531ca0['label'];const _0x32015d=new _0x3faae3();_0x32015d['text']=_0x320b1d;const _0x1a2508=new xt();_0x1a2508['content']=_0xb321f6,_0x1a2508['extendTemplate']({'attributes':{'class':'ck-ai-quick-actions-button__group-icon'}});const _0x40384d=new vt(this['locale']);_0x40384d['setTemplate']({'tag':'span','attributes':{'class':'ck-ai-quick-actions-button_with-group__open-paren'},'children':[{'text':'\x20('}]});const _0x320173=new vt(this['locale']);return _0x320173['setTemplate']({'tag':'span','attributes':{'class':'ck-ai-quick-actions-button_with-group__close-paren'},'children':[{'text':')'}]}),_0x18fd82['set']({'label':_0x531ca0['label']+'\x20('+_0x320b1d+')','withText':!0x0,'role':'menuitem','class':'ck-ai-quick-actions-button\x20ck-ai-quick-actions-button_with-group','tooltip':!0x1}),_0x18fd82['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':[_0x46f467,_0x40384d,_0x1a2508,_0x32015d,_0x320173],'on':{'mouseenter':_0x2cdf17['to'](()=>{this['_isSearchFocused']()||_0x18fd82['focus']();}),'click':_0x2cdf17['to'](()=>{_0x18fd82['fire']('execute');})}}),_0x18fd82['on']('execute',()=>{_0x42bcd6['editing']['view']['focus'](),_0x42bcd6['commands']['execute']('aiQuickAction',_0x531ca0);}),_0x355ec2['children']['add'](_0x18fd82),{'listItem':_0x355ec2,'highlightViews':[_0x46f467,_0x32015d]};}{const _0x3deb9c=new _0x1048f5(),_0x1a049a=new Nt(this['locale'],_0x3deb9c),_0x3615dd=_0x1a049a['bindTemplate'],_0x244a78=_0x531ca0['icon']??_0x531ca0['parent']?.['icon'],_0x21fb23=void 0x0!==_0x531ca0['icon'];return _0x1a049a['set']({'label':_0x531ca0['label'],'withText':!0x0,'role':'menuitem','icon':_0x21fb23?_0x244a78??_0x25caf3:void 0x0,'tooltip':!0x1,'class':'ck-ai-quick-actions-button'}),_0x1a049a['extendTemplate']({'on':{'mouseenter':_0x3615dd['to'](()=>{this['_isSearchFocused']()||_0x1a049a['focus']();})}}),_0x1a049a['on']('execute',()=>{_0x42bcd6['editing']['view']['focus'](),_0x42bcd6['commands']['execute']('aiQuickAction',_0x531ca0);}),_0x355ec2['children']['add'](_0x1a049a),{'listItem':_0x355ec2,'highlightViews':[_0x3deb9c]};}}['_createSearchResultActionButton'](_0x4e1756,_0x1680c3,_0x3bac99,_0x422ac7){return _0x3bac99&&_0x422ac7?this['_createSearchResultGroupedActionButton'](_0x4e1756,_0x1680c3,_0x3bac99,_0x422ac7):this['_createSearchResultIndividualActionButton'](_0x4e1756,_0x1680c3);}['_createSearchResultGroupedActionButton'](_0x4d337c,_0x1df8ac,_0x38f27f,_0xfc6e5b){const _0x446a06=new Ht(this['locale']),_0x3a3f88=new Nt(this['locale']),_0x1f9510=_0x3a3f88['bindTemplate'],{view:_0x3fe5ce,highlightView:_0x4bf23f}=this['_createSearchResultGroupRow'](_0x38f27f,_0xfc6e5b),{view:_0x1f724d,highlightView:_0x58df3a}=this['_createSearchResultActionRow'](_0x1df8ac['label']),_0x187d9f=this['_createSearchResultContentView'](_0x3fe5ce,_0x1f724d);return _0x3a3f88['set']({'label':_0x1df8ac['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}),_0x3a3f88['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':[_0x187d9f],'on':{'mouseenter':_0x1f9510['to'](()=>{this['_isSearchFocused']()||_0x3a3f88['focus']();}),'click':_0x1f9510['to'](()=>{this['_handleSearchResultButtonClick'](_0x3a3f88);})}}),this['_setupActionButtonExecution'](_0x3a3f88,_0x4d337c,_0x1df8ac),_0x446a06['children']['add'](_0x3a3f88),{'listItem':_0x446a06,'highlightViews':[_0x4bf23f,_0x58df3a]};}['_createSearchResultIndividualActionButton'](_0x3a0976,_0x21ce64){const _0x583f4e=new Ht(this['locale']),_0x45a398=new _0x1048f5(),_0x5251b5=new Nt(this['locale'],_0x45a398),_0xb124c9=_0x5251b5['bindTemplate'];return _0x5251b5['set']({'label':_0x21ce64['label'],'withText':!0x0,'role':'menuitem','icon':void 0x0,'tooltip':!0x1,'class':'ck-ai-quick-actions-button\x20ck-ai-quick-actions-search-result-button'}),_0x5251b5['extendTemplate']({'on':{'mouseenter':_0xb124c9['to'](()=>{this['_isSearchFocused']()||_0x5251b5['focus']();})}}),this['_setupActionButtonExecution'](_0x5251b5,_0x3a0976,_0x21ce64),_0x583f4e['children']['add'](_0x5251b5),{'listItem':_0x583f4e,'highlightViews':[_0x45a398]};}['_createSearchResultGroupRow'](_0x48f9c5,_0x2806b8){const _0x3a9dfc=new vt(this['locale']),_0x550289=new xt();_0x550289['content']=_0x2806b8,_0x550289['extendTemplate']({'attributes':{'class':'ck-ai-quick-actions-button__group-icon'}});const _0x26692e=new _0x3faae3();return _0x26692e['text']=_0x48f9c5,_0x3a9dfc['setTemplate']({'tag':'div','attributes':{'class':'ck-ai-quick-actions-search-result__group-row'},'children':[_0x550289,_0x26692e]}),{'view':_0x3a9dfc,'highlightView':_0x26692e};}['_createSearchResultActionRow'](_0x30de89){const _0x54ab1a=new vt(this['locale']),_0x146a8e=new _0x3faae3();return _0x146a8e['text']=_0x30de89,_0x54ab1a['setTemplate']({'tag':'div','attributes':{'class':'ck-ai-quick-actions-search-result__action-row'},'children':[_0x146a8e]}),{'view':_0x54ab1a,'highlightView':_0x146a8e};}['_createSearchResultContentView'](_0x3b5b07,_0x254b0f){const _0x46efdc=new vt(this['locale']);return _0x46efdc['setTemplate']({'tag':'div','attributes':{'class':'ck-ai-quick-actions-search-result__content'},'children':[_0x3b5b07,_0x254b0f]}),_0x46efdc;}['_setupActionButtonExecution'](_0x520912,_0x23ba22,_0x38cad2){_0x520912['on']('execute',()=>{_0x23ba22['editing']['view']['focus'](),_0x23ba22['commands']['execute']('aiQuickAction',_0x38cad2);});}['_createActionGroupButton'](_0x566849,_0x390611,_0x5a651b){const _0x381fdc=new Ht(this['locale']),_0x4c9c33=new _0x1048f5(),_0x162066=new Pa(this['locale'],_0x4c9c33),_0x2cb28b=_0x162066['bindTemplate'],_0x5c7bb9=this['_getPanelKeystroke'](_0x5a651b),_0x375f60=this['_createGroupActionsList'](_0x566849,_0x390611['actions'],_0x5a651b);_0x162066['set']({'label':_0x390611['label'],'withText':!0x0,'role':Ua,'icon':_0x390611['icon']??_0x25caf3,'isEnabled':_0x390611['actions']['some'](_0x34f414=>_0x34f414['isEnabled'])}),_0x162066['extendTemplate']({'on':{'mouseenter':_0x2cb28b['to'](()=>{this['_isSearchFocused']()||_0x162066['focus']();})}});const _0x3a5a62=new Xt(this['locale']);return _0x3a5a62['extendTemplate']({'attributes':{'class':['ck','ck-reset_all','ck-ai-quick-actions-group-panel','ck-dropdown-menu__nested-menu__panel']},'on':{'keydown':_0x2cb28b['to'](_0x50c16c=>{this['_handlePanelKeydown'](_0x50c16c,_0x5c7bb9,_0x162066,_0x3a5a62);})}}),_0x162066['bind']('isOn')['to'](_0x3a5a62,'isVisible'),this['_bodyCollection']['add'](_0x3a5a62),_0x3a5a62['content']['add'](_0x375f60),this['_setupGroupMenuBehavior'](_0x162066,_0x3a5a62),_0x381fdc['children']['add'](_0x162066),{'listItem':_0x381fdc,'highlightView':_0x4c9c33};}['_createGroupActionsList'](_0x3496bc,_0xbf16f8,_0x41d1e0){const _0xc7cbc4=new Dt(this['locale']);return _0xc7cbc4['extendTemplate']({'attributes':{'class':['ck','ck-reset_all','ck-ai-quick-actions-group-list','ck-dropdown-menu-list']}}),_0xbf16f8['forEach'](_0x4511dd=>{const _0xaef425=new Ht(this['locale']),_0x1a5074=Da({'editor':_0x3496bc,'action':_0x4511dd,'withText':!0x0,'withIcon':!0x1,'isInDropdown':!0x0,'shouldPreventFocus':()=>this['_isSearchFocused']()})();_0xaef425['children']['add'](_0x1a5074),_0x41d1e0['focusTracker']['add'](_0x1a5074),_0xc7cbc4['items']['add'](_0xaef425);}),_0xc7cbc4;}['_setupGroupMenuBehavior'](_0x740f,_0x5ed180){const _0x75555=_0x740f['bindTemplate'],_0xc8f91f=this['_getButtonKeystroke'](_0x740f);_0x740f['extendTemplate']({'attributes':{'class':['ck-ai-quick-actions-group-button']},'on':{'mouseenter':_0x75555['to'](()=>{this['_showNestedPanel'](_0x5ed180,_0x740f);}),'mouseleave':_0x75555['to'](_0x5c9ff3=>{const _0x91efe1=_0x5c9ff3['relatedTarget'];this['_isMovingToNestedMenu'](_0x91efe1,_0x5ed180)||this['_hideNestedPanel'](_0x5ed180);}),'keydown':_0x75555['to'](_0x1ca55b=>{_0x1ca55b['key']==_0xc8f91f&&(this['_showNestedPanel'](_0x5ed180,_0x740f),_0x5ed180['content']['get'](0x0)['focus']());})}}),_0x5ed180['on']('render',()=>{_0x5ed180['element']?.['addEventListener']('mouseleave',_0x2ad026=>{const _0x1ef218=_0x2ad026['relatedTarget'];_0x740f['element']?.['contains'](_0x1ef218)||this['_isMovingToNestedMenu'](_0x1ef218,_0x5ed180)||this['_hideNestedPanel'](_0x5ed180);});});}['_showNestedPanel'](_0xf04e81,_0x161034){this['_openNestedPanels']['forEach'](_0x149d1d=>{_0x149d1d!==_0xf04e81&&_0x149d1d['isVisible']&&_0x149d1d['hide']();}),_0xf04e81['show'](),_0xf04e81['pin']({'positions':[_0x4423cb['eastSouth']],'target':_0x161034['element'],'fitInViewport':!0x0}),this['_openNestedPanels']['add'](_0xf04e81);}['_hideNestedPanel'](_0x3c35f7){_0x3c35f7['hide'](),this['_openNestedPanels']['delete'](_0x3c35f7);}['_hideAllNestedPanels'](){this['_openNestedPanels']['forEach'](_0x4d00d0=>_0x4d00d0['hide']()),this['_openNestedPanels']['clear']();}['_isMovingToNestedMenu'](_0x5215c3,_0x5c054d){if(!_0x5215c3)return!0x1;if(_0x5c054d['element']?.['contains'](_0x5215c3))return!0x0;const _0xa94373=_0x5215c3;return _0xa94373['closest']&&(null!==_0xa94373['closest']('.ck-ai-quick-actions-group-panel')||null!==_0xa94373['closest']('.ck-ai-quick-actions-group-list')||null!==_0xa94373['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'](_0x3d9ddc){return'rtl'===_0x3d9ddc['locale']['uiLanguageDirection']?'ArrowRight':'ArrowLeft';}['_getButtonKeystroke'](_0x11f4d7){return'rtl'===_0x11f4d7['locale']['uiLanguageDirection']?'ArrowLeft':'ArrowRight';}['_handlePanelKeydown'](_0x4079a6,_0x2a7b98,_0x2ad04b,_0x58193d){_0x4079a6['key']==_0x2a7b98&&(_0x2ad04b['focus'](),this['_hideNestedPanel'](_0x58193d));}['_handleSearchResultButtonClick'](_0x22756a){_0x22756a['fire']('execute');}}function Ba(_0x27e89b){const {editor:_0x144177,content:_0x55c851,buttonDefinition:_0x5c7779,bodyCollection:_0x1a90c4,hasSearch:_0x32e85d=!0x1}=_0x27e89b;return()=>{const _0x304457=_0x144177['locale'],_0x11cba6=Gt(_0x304457);_0x11cba6['buttonView']['set']({'icon':_0x5c7779['icon']??_0x25caf3,'label':_0x5c7779['label'],'tooltip':!0x0}),_0x11cba6['set']({'class':'ck-ai-quick-actions-dropdown'});const _0x515cf0=new Va(_0x144177,_0x55c851,_0x11cba6,_0x1a90c4,_0x32e85d);return _0x11cba6['panelView']['children']['add'](_0x515cf0),_0x32e85d&&_0x11cba6['on']('change:isOpen',(_0x5078d0,_0x2f7ae9,_0x1b4d49)=>{if(_0x1b4d49){if(_0x144177['plugins']['has']('AIEditing')){const _0x3983a9=_0x144177['plugins']['get'](tn),_0x37a35a=_0x144177['model']['document']['selection'],_0x354bcb=Array['from'](_0x37a35a['getRanges']());_0x354bcb['length']>0x0&&_0x3983a9['showFakeVisualSelection']({'ranges':_0x354bcb,'id':'quick-action','priority':0x14});}}else _0x144177['plugins']['has']('AIEditing')&&_0x144177['plugins']['get'](tn)['hideFakeVisualSelection']('quick-action'),_0x515cf0['resetSearch']();}),_0x11cba6;};}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(_0x4f671e){return _0x4f671e['chat']='AIChat',_0x4f671e['action']='AIActions',_0x4f671e;}({});class Ya extends _0x52790d{static get['requires'](){return[_0x179b32,ls];}static get['pluginName'](){return'AIQuickActionsUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}async['init'](){const _0x361cce=await this['_getDefaultAndCustomActions']();this['_prepareQuickActionsDefinition'](_0x361cce),this['_initializeQuickActionsComponentsAndCommands']();}static['getDefaultQuickActions'](_0x3ab38e){return function(_0x12ae8e){const _0x219122=new Intl['DisplayNames'](['en'],{'type':'language'})['of'](_0x12ae8e['uiLanguage']),_0x26d7db=_0x219122||'English',_0x1a4e61=[{'id':'ask-ai','label':us(_0x12ae8e,'AI_QUICK_ACTIONS_ASK_AI'),'type':no['CHAT'],'icon':_0x36dbee},{'id':'chat-commands','label':us(_0x12ae8e,'AI_QUICK_ACTIONS_CHAT_COMMANDS'),'icon':_0x36dbee,'actions':[{'id':'explain','label':us(_0x12ae8e,'AI_QUICK_ACTIONS_EXPLAIN'),'displayedPrompt':us(_0x12ae8e,'AI_QUICK_ACTIONS_EXPLAIN'),'prompt':Ga['replace']('%0',_0x26d7db),'type':no['CHAT']},{'id':'summarize','label':us(_0x12ae8e,'AI_QUICK_ACTIONS_SUMMARIZE'),'displayedPrompt':us(_0x12ae8e,'AI_QUICK_ACTIONS_SUMMARIZE'),'prompt':Fa['replace']('%0',_0x26d7db),'type':no['CHAT']},{'id':'highlight-key-points','label':us(_0x12ae8e,'AI_QUICK_ACTIONS_HIGHLIGHT_KEY_POINTS'),'displayedPrompt':us(_0x12ae8e,'AI_QUICK_ACTIONS_HIGHLIGHT_KEY_POINTS'),'prompt':Ka['replace']('%0',_0x26d7db),'type':no['CHAT']}]},{'id':'improve-writing','label':us(_0x12ae8e,'AI_QUICK_ACTIONS_IMPROVE_WRITING'),'type':no['ACTION'],'icon':_0x113eff},{'id':'continue','label':us(_0x12ae8e,'AI_QUICK_ACTIONS_CONTINUE_WRITING'),'type':no['ACTION'],'icon':_0x5eae5b},{'id':'fix-grammar','label':us(_0x12ae8e,'AI_QUICK_ACTIONS_FIX_GRAMMAR_SPELLING'),'type':no['ACTION'],'icon':_0x502a9b},{'id':'adjust-length','label':us(_0x12ae8e,'AI_QUICK_ACTIONS_ADJUST_LENGTH'),'icon':_0x4b9c93,'actions':[{'id':'make-shorter','label':us(_0x12ae8e,'AI_QUICK_ACTIONS_MAKE_SHORTER'),'type':no['ACTION']},{'id':'make-longer','label':us(_0x12ae8e,'AI_QUICK_ACTIONS_MAKE_LONGER'),'type':no['ACTION']}]},{'id':'change-tone','label':us(_0x12ae8e,'AI_QUICK_ACTIONS_CHANGE_TONE'),'icon':_0x428a27,'actions':[{'id':'make-tone-casual','label':us(_0x12ae8e,'AI_QUICK_ACTIONS_MORE_CASUAL'),'type':no['ACTION']},{'id':'make-tone-direct','label':us(_0x12ae8e,'AI_QUICK_ACTIONS_MORE_DIRECT'),'type':no['ACTION']},{'id':'make-tone-friendly','label':us(_0x12ae8e,'AI_QUICK_ACTIONS_MORE_FRIENDLY'),'type':no['ACTION']},{'id':'make-tone-confident','label':us(_0x12ae8e,'AI_QUICK_ACTIONS_MORE_CONFIDENT'),'type':no['ACTION']},{'id':'make-tone-professional','label':us(_0x12ae8e,'AI_QUICK_ACTIONS_MORE_PROFESSIONAL'),'type':no['ACTION']}]},{'id':'translate','label':us(_0x12ae8e,'AI_QUICK_ACTIONS_TRANSLATE'),'icon':_0x3ec8c7,'actions':[{'id':'translate-to-english','label':us(_0x12ae8e,'AI_QUICK_ACTIONS_TRANSLATE_ENGLISH'),'type':no['ACTION'],'actionName':'translate','args':{'language':'english'}},{'id':'translate-to-chinese','label':us(_0x12ae8e,'AI_QUICK_ACTIONS_TRANSLATE_CHINESE'),'type':no['ACTION'],'actionName':'translate','args':{'language':'chinese'}},{'id':'translate-to-spanish','label':us(_0x12ae8e,'AI_QUICK_ACTIONS_TRANSLATE_SPANISH'),'type':no['ACTION'],'actionName':'translate','args':{'language':'spanish'}},{'id':'translate-to-german','label':us(_0x12ae8e,'AI_QUICK_ACTIONS_TRANSLATE_GERMAN'),'type':no['ACTION'],'actionName':'translate','args':{'language':'german'}},{'id':'translate-to-french','label':us(_0x12ae8e,'AI_QUICK_ACTIONS_TRANSLATE_FRENCH'),'type':no['ACTION'],'actionName':'translate','args':{'language':'french'}},{'id':'translate-to-japanese','label':us(_0x12ae8e,'AI_QUICK_ACTIONS_TRANSLATE_JAPANESE'),'type':no['ACTION'],'actionName':'translate','args':{'language':'japanese'}},{'id':'translate-to-portuguese','label':us(_0x12ae8e,'AI_QUICK_ACTIONS_TRANSLATE_PORTUGUESE'),'type':no['ACTION'],'actionName':'translate','args':{'language':'portuguese'}},{'id':'translate-to-korean','label':us(_0x12ae8e,'AI_QUICK_ACTIONS_TRANSLATE_KOREAN'),'type':no['ACTION'],'actionName':'translate','args':{'language':'korean'}},{'id':'translate-to-italian','label':us(_0x12ae8e,'AI_QUICK_ACTIONS_TRANSLATE_ITALIAN'),'type':no['ACTION'],'actionName':'translate','args':{'language':'italian'}},{'id':'translate-to-russian','label':us(_0x12ae8e,'AI_QUICK_ACTIONS_TRANSLATE_RUSSIAN'),'type':no['ACTION'],'actionName':'translate','args':{'language':'russian'}}]},{'id':'other','label':us(_0x12ae8e,'AI_QUICK_ACTIONS_OTHER'),'icon':tt,'actions':[]}];return _0x1a4e61;}(_0x3ab38e);}async['_getDefaultAndCustomActions'](){const _0x326a67=Ya['getDefaultQuickActions'](this['editor']['locale']),_0x238e0b=this['editor']['config']['get']('ai.quickActions.extraCommands')||[];let _0x721107=[];try{_0x721107=await new qs({'connector':this['editor']['plugins']['get']('AIConnector'),'locale':this['editor']['locale']})['getAll']();}catch(_0x368444){const _0x300b11=new ht('ai-quick-actions-models-unable-to-retrieve',this,{'error':_0x368444});mt(_0x300b11['message']);}finally{const _0x622bbd=_0x238e0b['map'](_0x2db966=>({..._0x2db966,'type':'chat'===_0x2db966['type']?no['CHAT']:no['ACTION'],'icon':void 0x0}));_0x326a67['find'](_0x5914a6=>'other'===_0x5914a6['id'])['actions']['push'](..._0x622bbd),_0x326a67['forEach'](_0xcb63cf=>{if('actions'in _0xcb63cf)_0xcb63cf['actions']['forEach'](_0x43cadc=>{if(_0x43cadc['isEnabled']=!!_0x721107['find'](_0x3bc827=>_0x3bc827['id']===_0x43cadc['model'])||void 0x0===_0x43cadc['model'],!_0x43cadc['isEnabled']){const _0x562de0=new ht('ai-quick-actions-unavailable-model',this,{'actionId':_0x43cadc['id'],'modelId':_0x43cadc['model']});mt(_0x562de0['message']);}});else{if(_0xcb63cf['isEnabled']=!!_0x721107['find'](_0x551e65=>_0x551e65['id']===_0xcb63cf['model'])||void 0x0===_0xcb63cf['model'],!_0xcb63cf['isEnabled']){const _0x3f99ad=new ht('ai-quick-actions-unavailable-model',this,{'actionId':_0xcb63cf['id'],'modelId':_0xcb63cf['model']});mt(_0x3f99ad['message']);}}});}return _0x326a67;}['_initializeQuickActionsComponentsAndCommands'](){const _0x398eb3=new Qt(this['editor']['locale']);_0x398eb3['attachToDom'](),this['_initializeQuickActionsDropdown'](_0x398eb3),this['_initializeQuickActionsMenuBar'](),this['_initializeQuickActionsComponents'](_0x398eb3);}['_initializeQuickActionsDropdown'](_0x581734){const _0x548d84=this['editor']['config']['get']('ai.quickActions.isSearchEnabled')??!0x0;this['editor']['ui']['componentFactory']['add']('aiQuickActions',Ba({'editor':this['editor'],'content':this['_quickActionsDefinition'],'buttonDefinition':{'icon':_0x25caf3,'label':us(this['editor']['locale'],'AI_QUICK_ACTIONS_HEADING')},'bodyCollection':_0x581734,'hasSearch':_0x548d84}));}['_prepareQuickActionsDefinition'](_0x1ed4c0){this['_quickActionsDefinition']=_0x1ed4c0['map'](_0x1a0824=>{if('actions'in _0x1a0824){const _0x39c3ec=_0x1a0824;return{..._0x39c3ec,'actions':_0x39c3ec['actions']['map'](_0x245dd2=>{const {actions:_0x56d05c,..._0x7361c9}=_0x39c3ec;return{..._0x245dd2,'parent':_0x7361c9};})['filter'](_0x27c82a=>this['_shouldIncludeAction'](_0x27c82a))};}return _0x1a0824;})['filter'](_0x567006=>'actions'in _0x567006?_0x567006['actions']['length']>0x0:this['_shouldIncludeAction'](_0x567006));}['_shouldIncludeAction'](_0x31e799){const _0x5a12d4=this['editor']['config']['get']('ai.quickActions.removeCommands')||[];return this['editor']['plugins']['has'](Wa[_0x31e799['type']])&&!_0x5a12d4['includes'](_0x31e799['id'])&&!(_0x31e799['type']===no['CHAT']&&!0x1===this['editor']['config']['get']('ai.chat.context.document.enabled'));}['_initializeQuickActionsComponents'](_0x423123){this['_quickActionsDefinition']['forEach'](_0xbfcf23=>{if('actions'in _0xbfcf23){const _0x1874ea=Ba({'editor':this['editor'],'content':_0xbfcf23['actions'],'buttonDefinition':_0xbfcf23,'bodyCollection':_0x423123});this['editor']['ui']['componentFactory']['add'](_0xbfcf23['id'],_0x1874ea),_0xbfcf23['actions']['forEach'](_0x2f02b3=>{const _0x508367=Da({'editor':this['editor'],'action':_0x2f02b3});this['editor']['ui']['componentFactory']['add'](_0x2f02b3['id'],_0x508367);});}else{const _0x2f6f01=Da({'editor':this['editor'],'action':_0xbfcf23,'withText':!0x1,'withIcon':!0x0,'isInDropdown':!0x1});this['editor']['ui']['componentFactory']['add'](_0xbfcf23['id'],_0x2f6f01);}});}['_initializeQuickActionsMenuBar'](){this['editor']['ui']['componentFactory']['add']('menuBar:aiQuickActions',_0x2fb52a=>{const _0x79b0a0=new Kt(_0x2fb52a),_0x25825a=us(_0x2fb52a,'AI_QUICK_ACTIONS_HEADING');_0x79b0a0['buttonView']['set']({'label':_0x25825a,'icon':_0x25caf3});const _0x28206b=new $t(_0x2fb52a);_0x28206b['set']({'ariaLabel':_0x25825a,'role':'menu'}),this['_quickActionsDefinition']['forEach'](_0x5b7d85=>{if('actions'in _0x5b7d85){const _0x100356=_0x5b7d85,_0x35af79=new qt(_0x2fb52a,_0x79b0a0),_0x3bf325=new Kt(_0x2fb52a),_0x2dfc7e=new $t(_0x2fb52a);_0x3bf325['buttonView']['set']({'label':_0x100356['label'],'icon':_0x100356['icon']}),_0x100356['actions']['forEach'](_0xb34ad8=>{const _0x4a5c3c=new qt(_0x2fb52a,_0x3bf325),_0x2507e1=new Wt(_0x2fb52a);_0x2507e1['set']({'label':_0xb34ad8['label'],'icon':_0xb34ad8['icon'],'role':'menuitem','isEnabled':_0xb34ad8['isEnabled']}),_0x2507e1['on']('execute',()=>{this['_executeQuickAction'](_0xb34ad8);}),_0x2507e1['delegate']('execute')['to'](_0x3bf325),_0x4a5c3c['children']['add'](_0x2507e1),_0x2dfc7e['items']['add'](_0x4a5c3c);}),_0x3bf325['panelView']['children']['add'](_0x2dfc7e),_0x35af79['children']['add'](_0x3bf325),_0x28206b['items']['add'](_0x35af79);}else{const _0xaf0d52=_0x5b7d85,_0x2a428d=new qt(_0x2fb52a,_0x79b0a0),_0xa8fea1=new Wt(_0x2fb52a);_0xa8fea1['set']({'label':_0xaf0d52['label'],'icon':_0xaf0d52['icon'],'role':'menuitem','isEnabled':_0xaf0d52['isEnabled']}),_0xa8fea1['on']('execute',()=>{this['_executeQuickAction'](_0xaf0d52);}),_0xa8fea1['delegate']('execute')['to'](_0x79b0a0),_0x2a428d['children']['add'](_0xa8fea1),_0x28206b['items']['add'](_0x2a428d);}});const _0x3305b8=Object['values'](Wa)['some'](_0x143dcc=>this['editor']['plugins']['has'](_0x143dcc));return _0x79b0a0['set']({'isEnabled':_0x3305b8}),_0x79b0a0['panelView']['children']['add'](_0x28206b),_0x79b0a0;});}['_executeQuickAction'](_0x2070d5){const _0x481c9c=this['editor'];_0x481c9c['editing']['view']['focus'](),_0x481c9c['commands']['execute']('aiQuickAction',_0x2070d5);const _0x50a2e8=_0x481c9c['ui']['view']['menuBarView'];_0x50a2e8&&_0x50a2e8['close']&&_0x50a2e8['close']();}}class $a extends _0x385b22{['execute'](_0x3455b1){switch(this['_expandSelectionIfCollapsed'](),_0x3455b1['type']){case no['CHAT']:if(!this['editor']['plugins']['has']('AIChat')){const _0x4017d2=us(this['editor']['locale'],'AI_QUICK_ACTIONS_PLUGIN_NOT_FOUND','AIChat');throw new ht('ai-quick-actions-plugin-not-found',this['editor'],{'errorMessage':_0x4017d2});}this['_handleAIChatAction'](_0x3455b1);break;case no['ACTION']:if(!this['editor']['plugins']['has']('AIActions')){const _0x26ba12=us(this['editor']['locale'],'AI_QUICK_ACTIONS_PLUGIN_NOT_FOUND','AIActions');throw new ht('ai-quick-actions-plugin-not-found',this['editor'],{'errorMessage':_0x26ba12});}this['_handleAIActionsAction'](_0x3455b1);}}async['_handleAIChatAction'](_0x136f9d){const _0x82c940=this['editor']['plugins']['get']('AIChatController'),_0x9e32ab=this['editor']['plugins']['get']('AITabs')['view'];if(_0x9e32ab['isVisible']||(_0x9e32ab['isVisible']=!0x0),'chat'!==_0x9e32ab['activeTab']&&_0x9e32ab['activateTab']('chat'),'ask-ai'===_0x136f9d['id'])_0x82c940['removeSelectionFromChatContext'](),_0x82c940['addSelectionToChatContext'](),_0x82c940['focusPromptInput']();else await _0x82c940['startConversation'](),_0x82c940['removeSelectionFromChatContext'](),_0x82c940['addSelectionToChatContext'](),_0x82c940['focusPromptInput'](),await _0x82c940['sendMessage']({'message':_0x136f9d['prompt']||_0x136f9d['displayedPrompt']||_0x136f9d['label'],'attributes':{'quickActionData':{'id':_0x136f9d['id']},'displayedPrompt':_0x136f9d['displayedPrompt']}});}['_expandSelectionIfCollapsed'](){const _0x15e206=this['editor'],_0x195445=_0x15e206['model']['document']['selection'];if(!_0x195445['isCollapsed'])return;const _0x20cf9a=It(_0x195445['getSelectedBlocks']())||_0x15e206['model']['schema']['getLimitElement'](_0x195445);_0x15e206['model']['change'](_0x32a23e=>{_0x32a23e['setSelection'](_0x20cf9a,'in');});}['_handleAIActionsActionLabel'](_0x4b30c0){return _0x4b30c0['parent']?.['label']&&'other'!==_0x4b30c0['parent']?.['id']?_0x4b30c0['parent']['label']+':\x20'+_0x4b30c0['label']:_0x4b30c0['label'];}async['_handleAIActionsAction'](_0x32dad5){const _0x52c632=this['editor']['plugins']['get']('AIActions'),_0x65e762=_0x32dad5['prompt']?{'userMessage':_0x32dad5['prompt'],'model':_0x32dad5['model']}:{'actionName':_0x32dad5['actionName']||_0x32dad5['id'],'args':_0x32dad5['args']},_0x2d5126=this['_handleAIActionsActionLabel'](_0x32dad5);await _0x52c632['executeAction'](_0x65e762,_0x2d5126,_0x32dad5['icon']);}}class qa extends _0x52790d{static get['pluginName'](){return'AIQuickActionsEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const _0x5d7c0c=this['editor'],_0x36ced0=new $a(this['editor']);if(_0x5d7c0c['commands']['add']('aiQuickAction',_0x36ced0),_0x5d7c0c['plugins']['has']('AIChat')){const _0x5c2520=this['editor']['plugins']['get']('AIChatController');_0x5d7c0c['model']['document']['selection']['on']('change:range',(_0x195cee,_0x47ddb4)=>{_0x47ddb4['directChange']&&_0x5c2520['removeSelectionFromChatContext']();});}}}class Qa extends Ps{['updateChangeGroups'](){if(this['parsedMergedContent']=this['parsedContent']['cloneNode'](!0x0),0x0==this['parsedMergedContent']['childNodes']['length'])return void(this['changeGroups']=[]);const _0x304148=this['documentContextContent']['children']['map'](_0x1997f1=>({'node':_0x1997f1,'id':ms(_0x1997f1,'data-id')})),_0x33fd52=this['parsedMergedContent']['children']['map'](_0x488194=>({'node':_0x488194,'id':ms(_0x488194,'data-id')||ot()})),_0x240ea0=_0x43d9cc(_0x304148,_0x33fd52,{'comparator':(_0xdd779f,_0x3cca01)=>_0xdd779f['id']==_0x3cca01['id'],'oneChangePerToken':!0x0});if(!this['isDone']){for(;_0x240ea0['length']&&_0x240ea0[_0x240ea0['length']-0x1]['removed'];)_0x240ea0['pop']();}const _0x41245e=_0x240ea0['map'](_0x1ea2d5=>{const _0x5c5d68=_0x1ea2d5['added']?'new':_0x1ea2d5['removed']?'removed':'modified';return{'node':_0x1ea2d5['value'][0x0]['node'],'type':_0x5c5d68,'id':_0x1ea2d5['value'][0x0]['id']};});this['changeGroups']=[{'changes':_0x41245e,'state':'pending','index':0x0}];}['_getDifferentChangeGroups'](_0x28340a,_0x3a0961){return _0x3a0961;}}class Xa extends Ms{['content'];['version'];['actionName'];['args'];['userMessage'];['model'];['hasError']=!0x1;constructor(_0x53baed){super(_0x53baed),this['content']=_0x53baed['content'],this['version']=_0x53baed['version'],this['actionName']=_0x53baed['actionName'],this['args']=_0x53baed['args'],this['userMessage']=_0x53baed['userMessage'],this['model']=_0x53baed['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'](_0x25e187){const _0x2cd7fa=new Qa({'editor':this['editor'],'documentContextContent':this['content'],..._0x25e187});return this['replies']['push'](_0x2cd7fa),_0x2cd7fa['delegate'](...Hs)['to'](this),this['fire']('replyCreated',_0x2cd7fa),_0x2cd7fa;}}class za extends kt{constructor(_0x4870c1,_0x4025c5=!0x0,_0x11a45e=!0x0){super(_0x4870c1),this['set']('isEnabled',!0x1),_0x4025c5&&(this['applyButton']=this['_createButton'](us(_0x4870c1,'AI_BALLOON_APPLY_BUTTON'),ds),this['applyButton']['bind']('isEnabled')['to'](this),this['items']['add'](this['applyButton'])),_0x11a45e&&(this['suggestButton']=this['_createButton'](us(_0x4870c1,'AI_BALLOON_SUGGEST_BUTTON'),_0x4025c5?_s:ds),this['suggestButton']['bind']('isEnabled')['to'](this),this['items']['add'](this['suggestButton'])),this['setButtonsVisibility']({'showApplyButton':_0x4025c5,'showSuggestButton':_0x11a45e}),this['extendTemplate']({'attributes':{'class':['ck-ai-balloon__toolbar']}});}['setButtonsVisibility']({showApplyButton:_0x5ec2a5,showSuggestButton:_0x10a7ca}){this['applyButton']&&(this['applyButton']['isVisible']=_0x5ec2a5),this['suggestButton']&&(this['suggestButton']['isVisible']=_0x10a7ca);}['_createButton'](_0x35381f,_0x38b391){const _0x496509=new Nt(this['locale']);return _0x496509['set']({'label':_0x35381f,'class':_0x38b391,'isVisible':!0x0,'withText':!0x0}),_0x496509;}}class ja extends vt{constructor(_0x142cde){super(_0x142cde),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(_0x142cde,'AI_DISCLAIMER_TEXT')}]}]});}}class Ja extends vt{constructor(_0xbed41b){super(_0xbed41b),this['set']('isVisible',!0x0);const _0x4b9196=new vn('small');_0x4b9196['isVisible']=!0x0;const _0x4cc2b4=new vt(this['locale']);_0x4cc2b4['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',_0x3b8252=>!_0x3b8252)]},'children':[_0x4b9196,_0x4cc2b4]});}}class Za extends Ra{['focusCycler'];['_config'];['_contentWrapper'];['_streamableContentView'];['_toolbarView'];['_miniToolbarView'];['_loaderView'];['_disclaimerView'];['_focusTracker'];['_keystrokes'];['_dialogContent'];['_focusables'];['_scrollManager'];['_navigationPreviousButton'];['_navigationNextButton'];['_navigationTryAgainButton'];['_navigationCounter'];constructor(_0x133de3,_0x6e7993){super(_0x133de3),this['set']('isBusy',!0x1),this['set']('isTrackChangesOn',!0x1),this['set']('_isLoading',!0x1),this['set']('_hasError',!0x1),this['_config']=_0x6e7993,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 _0x2ebc1e(),this['_addContentWrapper'](_0x6e7993),this['_addDisclaimerView'](),this['_addToolbar'](_0x6e7993),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'](_0x6e7993);});}['render'](){super['render']();for(const _0x59b6ab of this['_focusables'])this['_focusTracker']['add'](_0x59b6ab['element']);this['_keystrokes']['listenTo'](this['element']),this['_initializeScrollManager']();}['destroy'](){super['destroy'](),this['_scrollManager']&&this['_scrollManager']['destroy']();}['focus'](_0x10c57b){-0x1===_0x10c57b?this['focusCycler']['focusLast']():this['focusCycler']['focusFirst']();}['setIsLoading'](_0x245061){this['_isLoading']=_0x245061;}['setErrorState'](){this['_hasError']=!0x0,this['_miniToolbarView']['toggleShowChangesEnabled'](!0x1);}['clearErrorState'](){this['_hasError']=!0x1,this['_miniToolbarView']['toggleShowChangesEnabled'](!0x0);}['showError'](_0x439d57){super['showError'](_0x439d57),this['_dialogContent']['has'](this['_errorView'])||this['_dialogContent']['add'](this['_errorView'],0x0);}['hideError'](){super['hideError'](),this['clearErrorState']();}['showBlockingError'](_0x191c27){super['showBlockingError'](_0x191c27),this['setErrorState']();}['addMiniToolbarItem'](_0x1ce2c7){this['_miniToolbarView']['items']['has'](_0x1ce2c7)||this['_miniToolbarView']['items']['add'](_0x1ce2c7);}['removeMiniToolbarItem'](_0x1dc1c4){this['_miniToolbarView']['items']['has'](_0x1dc1c4)&&this['_miniToolbarView']['items']['remove'](_0x1dc1c4);}['showLoader'](){this['_loaderView']&&(this['_isLoading']=!0x0);}['hideLoader'](){this['_loaderView']&&(this['_isLoading']=!0x1);}['_toggleToolbarButtonsVisibility']({showApplyButton:_0x40a94e,showSuggestButton:_0x133472}){_0x40a94e=_0x40a94e&&!this['isTrackChangesOn']&&this['_config']['availableActions']['includes']('applySuggestion'),_0x133472=_0x133472&&this['_config']['availableActions']['includes']('insertSuggestion'),this['_toolbarView']['setButtonsVisibility']({'showApplyButton':_0x40a94e,'showSuggestButton':_0x133472});}async['updateContent'](_0x3bdd89){await this['_streamableContentView']['update'](_0x3bdd89);}['clearContent'](){this['_streamableContentView']['clear']();}['_addContentWrapper'](_0x4db3ff){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'](_0x4db3ff['miniToolbarConfig'])]}),this['_dialogContent']['add'](this['_contentWrapper']);}['_addDisclaimerView'](){this['_disclaimerView']=new ja(this['locale']),this['_dialogContent']['add'](this['_disclaimerView']);}['_addToolbar']({showApplyButton:_0x1ba241,showSuggestButton:_0x39d836}){this['_toolbarView']=new za(this['locale'],_0x1ba241,_0x39d836),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',(_0x240afe,_0x266630,_0x2d9463)=>!(_0x240afe||_0x266630||_0x2d9463)),this['_toggleToolbarButtonsVisibility']({'showApplyButton':_0x1ba241,'showSuggestButton':_0x39d836}),this['_dialogContent']['add'](this['_toolbarView']);}['_createMiniToolbar'](_0x1b1398){return this['_miniToolbarView']=new Na(this['locale'],_0x1b1398),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',(_0x53d0b2,_0x252500)=>!(_0x53d0b2||_0x252500)),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 _0x46c8d5=new Nt(this['locale']),_0x4303ef=new Nt(this['locale']),_0x2f9a1b=new to(this['locale']),_0x1eadf1=new Nt(this['locale']);_0x46c8d5['set']({'icon':et,'label':us(this['locale'],'AI_ACTIONS_TRY_AGAIN'),'tooltip':!0x0,'class':'ck-ai-custom-action-button\x20'+As}),_0x4303ef['set']({'icon':_0x1654b8,'tooltip':us(this['locale'],'AI_ACTIONS_PREVIOUS_INTERACTION'),'class':'ck-ai-navigation-button\x20ck-ai-previous-button\x20'+As}),_0x1eadf1['set']({'icon':it,'tooltip':us(this['locale'],'AI_ACTIONS_NEXT_INTERACTION'),'class':'ck-ai-navigation-button\x20ck-ai-next-button\x20'+As}),_0x46c8d5['bind']('isEnabled')['to'](this,'isBusy',_0x4be8fc=>!_0x4be8fc),_0x46c8d5['on']('execute',()=>{this['fire']('tryAgain');}),_0x4303ef['bind']('isEnabled')['to'](this,'isBusy',_0xbf5c93=>!_0xbf5c93),_0x4303ef['on']('execute',()=>{this['fire']('showPrevious');}),_0x1eadf1['bind']('isEnabled')['to'](this,'isBusy',_0x2b70fb=>!_0x2b70fb),_0x1eadf1['on']('execute',()=>{this['fire']('showNext');}),this['_navigationPreviousButton']=_0x4303ef,this['_navigationCounter']=_0x2f9a1b,this['_navigationNextButton']=_0x1eadf1,this['_navigationTryAgainButton']=_0x46c8d5;}['updateMiniToolbarButtons'](_0x5ac7a1,_0x149e6f){this['_navigationPreviousButton']||this['_setupMiniToolbarButtons']();const _0x3c2c27=_0x5ac7a1>0x1;if(this['addMiniToolbarItem'](this['_navigationTryAgainButton']),_0x3c2c27){this['addMiniToolbarItem'](this['_navigationPreviousButton']),this['addMiniToolbarItem'](this['_navigationCounter']),this['addMiniToolbarItem'](this['_navigationNextButton']);const _0x454318=_0x5ac7a1-_0x149e6f;this['_navigationCounter']['setInteractionCount'](_0x454318+'/'+_0x5ac7a1),this['_navigationPreviousButton']['isEnabled']=_0x149e6f<_0x5ac7a1-0x1,this['_navigationNextButton']['isEnabled']=_0x149e6f>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'](_0x5b28c2){this['_isLoading']=_0x5b28c2;}['resetShowChangesButton'](){this['_miniToolbarView']['isShowChangesOn']=!0x1;}['_initializeScrollManager'](){const _0x4bf93c=this['_getScrollableElement']();_0x4bf93c&&!this['_scrollManager']&&(this['_scrollManager']=new ir(_0x4bf93c));}['_getScrollableElement'](){return this['_streamableContentView']['element'];}}class to extends vt{constructor(_0x1187c5){super(_0x1187c5);const _0x1fa839=this['bindTemplate'];this['set']('interactionCount','1/1'),this['setTemplate']({'tag':'span','attributes':{'class':['ck-ai-interaction-counter']},'children':[{'text':_0x1fa839['to']('interactionCount')}]});}['setInteractionCount'](_0x1a5c4f){this['set']('interactionCount',_0x1a5c4f);}}class eo extends _0x52790d{static get['requires'](){return[ls,Bt,tn,ka,_0x46bc33];}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(_0x57fd69){super(_0x57fd69),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'](_0x2868c3,_0x5e6c56,_0x21d5ed){if(this['_stopInteraction'](),this['editor']['plugins']['has']('TableSelection')){if(this['editor']['plugins']['get']('TableSelection')['getSelectedTableCells']()){const {modelFragment:_0x12028a,anchorData:_0x4758aa}=this['_getExecuteDataInTable']();return this['_executeAction'](_0x2868c3,_0x12028a,_0x4758aa,_0x5e6c56,_0x21d5ed);}}const {modelFragment:_0x5b6bc8,anchorData:_0x5cda6b}=this['_getExecuteDataRegular']();return this['_executeAction'](_0x2868c3,_0x5b6bc8,_0x5cda6b,_0x5e6c56,_0x21d5ed);}async['destroy'](){return this['_stopInteraction'](),this['_bodyCollection']['detachFromDom'](),super['destroy']();}['_createActionsBalloonView'](){const _0x5b59a0=this['editor']['plugins']['has']('TrackChanges');let _0x501878=this['editor']['config']['get']('ai.availableReplyActions')||[...wn];_0x5b59a0||(_0x501878=_0x501878['filter'](_0x18a0fc=>'insertSuggestion'!=_0x18a0fc));const _0x3ad455=this['editor']['commands']['get']('trackChanges'),_0x476413=new Za(this['editor']['locale'],{'showApplyButton':!0x0,'showSuggestButton':_0x5b59a0,'miniToolbarConfig':{'showChanges':'icon'},'availableActions':_0x501878});return _0x476413['bind']('isBusy')['to'](this),_0x3ad455&&_0x476413['bind']('isTrackChangesOn')['to'](_0x3ad455,'value'),_0x476413['on']('tryAgain',()=>{this['_refreshInteraction']();}),_0x476413['on']('showPrevious',()=>{this['_navigateToPrevious']();}),_0x476413['on']('showNext',()=>{this['_navigateToNext']();}),_0x476413;}['_getExecuteDataRegular'](){const _0x2a963c=this['editor']['model']['document']['selection'];if(_0x2a963c['isCollapsed']){const _0xd5d785=It(_0x2a963c['getSelectedBlocks']())||this['editor']['model']['schema']['getLimitElement'](_0x2a963c);this['editor']['model']['change'](_0x1b782a=>{_0x1b782a['setSelection'](_0xd5d785,'in');});}const _0x4d7bf8=_0x2a963c['getFirstRange'](),_0xedca54=this['_wrapWithCommonAncestors'](this['editor']['model']['getSelectedContent'](_0x2a963c),_0x4d7bf8['start'],_0x4d7bf8['end']);this['_copyMarkersToFragment'](_0xedca54,_0x2a963c,{'isTableSelection':!0x1});const _0x5790b0=_0x2a963c['getFirstRange']()['start'],_0x16ba2e=new Map();let _0xc37cc0=_0xedca54;for(let _0x550023=0x0;_0x550023<_0x5790b0['path']['length'];_0x550023++)_0x16ba2e['set'](_0xc37cc0,_0x5790b0['path'][_0x550023]),_0xc37cc0=_0xc37cc0['getChild'](0x0);return{'modelFragment':_0xedca54,'anchorData':_0x16ba2e};}['_getExecuteDataInTable'](){const _0x423cbd=this['editor']['model']['document']['selection'],_0x36aa00=this['editor']['plugins']['get']('TableSelection')['getSelectionAsFragment'](),_0x4ba5b8=_0x423cbd['getFirstRange']()['start']['parent']['parent'],_0x548bec=this['editor']['model']['createRange'](this['editor']['model']['createPositionBefore'](_0x4ba5b8),this['editor']['model']['createPositionAfter'](_0x4ba5b8)),_0x1c5a1a=this['_wrapWithCommonAncestors'](_0x36aa00,_0x548bec['start'],_0x548bec['end']);this['_copyMarkersToFragment'](_0x1c5a1a,_0x423cbd,{'isTableSelection':!0x0});const _0x1c0b80=_0x423cbd['getFirstRange']()['start'],_0x451502=new Map();let _0x1770cb=_0x1c5a1a;for(let _0x5f31fc=0x0;_0x5f31fc<_0x1c0b80['path']['length'];_0x5f31fc++)if(_0x451502['set'](_0x1770cb,_0x1c0b80['path'][_0x5f31fc]),_0x5f31fc<_0x1c0b80['path']['length']-0x1)_0x1770cb=_0x1770cb['getChild'](0x0);else{let _0x428abc=_0x1770cb['nextSibling'];for(;_0x428abc;)_0x451502['set'](_0x428abc,_0x1c0b80['path'][_0x5f31fc]),_0x428abc=_0x428abc['nextSibling'];}return{'modelFragment':_0x1c5a1a,'anchorData':_0x451502};}async['_executeAction'](_0x6f395e,_0x2c4fb0,_0x30e10c,_0x5124d6,_0x22e169){const _0x35d137=this['editor']['plugins']['get'](tn),_0x1ab9fb=this['editor']['plugins']['get'](ka),_0x218ec3=this['editor']['model']['document']['selection'],_0x5f5c28=await _0x35d137['modelToDataWithIds'](_0x2c4fb0),_0x61031=this['editor']['model']['document']['version'],_0x26841b=[..._0x218ec3['getRanges']()];return this['_actionsBalloonView']||(this['_actionsBalloonView']=this['_createActionsBalloonView']()),this['_clearInteractionHistory'](),this['_clearErrorState'](),this['_balloonShowDiff']=!0x1,this['_actionsBalloonView']['resetShowChangesButton'](),this['_actionsBalloonView']['clearContent'](),_0x1ab9fb['open']({'index':0x3e8*Math['random']()%0x3e8,'title':_0x5124d6,'icon':_0x22e169||_0x25caf3,'mainView':this['_actionsBalloonView'],'class':'ck-ai-actions-balloon','ranges':_0x26841b,'id':'aiActionsBalloon'}),this['_setLoadingState'](),this['stopListening'](this['_actionsBalloonView']),this['stopListening'](_0x1ab9fb),this['_interactionParams']={'action':_0x6f395e,'content':_0x5f5c28,'version':_0x61031,'aiBalloon':_0x1ab9fb,'modelFragment':_0x2c4fb0,'anchorData':_0x30e10c},this['_setupApplyListeners'](),this['listenTo'](_0x1ab9fb,'selectionRemoved',()=>{this['_stopInteraction'](),this['_actionsBalloonView']['disableMiniToolbarButtons']();}),this['listenTo'](_0x1ab9fb,'dialogClosed',(_0x5ba707,{id:_0x38b375})=>{if('aiActionsBalloon'===_0x38b375){if(this['_interaction']&&this['_interaction']['replies']['length']>0x0){const _0x2b126c=this['_interaction']['replies'][this['_interaction']['replies']['length']-0x1],_0x2bbdaf=_0x2b126c['changeGroups'][0x0];_0x2bbdaf&&'pending'===_0x2bbdaf['state']&&_0x2b126c['setChangeGroupState'](0x0,'rejected');}this['_stopInteraction'](),this['_clearInteractionHistory'](),this['stopListening'](this['_actionsBalloonView']),this['stopListening'](_0x1ab9fb);}}),this['_createInteraction'](_0x5f5c28,_0x61031,_0x1ab9fb,_0x6f395e);}['_setupApplyListeners'](){if(!this['_interactionParams'])return;const {modelFragment:_0x59cfc1,anchorData:_0x33cc19}=this['_interactionParams'];this['listenTo'](this['_actionsBalloonView'],'applySuggestion',()=>{this['_applyChanges'](_0x59cfc1,_0x33cc19,!0x1);}),this['listenTo'](this['_actionsBalloonView'],'insertSuggestion',()=>{this['_applyChanges'](_0x59cfc1,_0x33cc19,!0x0);});}['_wrapWithCommonAncestors'](_0x20e684,_0x9553d1,_0x5b8310){const _0x301e06=this['editor']['model']['createRange'](_0x9553d1,_0x5b8310)['getCommonAncestor'](),_0x896d79=_0x301e06['is']('documentFragment')?[]:_0x301e06['getAncestors']({'includeSelf':!0x0})['slice'](0x1);if(_0x896d79['length']){const _0x4b1aa9=_0x896d79['map'](_0x36ae80=>_0x36ae80['_clone'](!0x1));for(let _0x1f58d8=0x1;_0x1f58d8<_0x4b1aa9['length'];_0x1f58d8++)_0x4b1aa9[_0x1f58d8-0x1]['_appendChild'](_0x4b1aa9[_0x1f58d8]);return _0x4b1aa9[_0x4b1aa9['length']-0x1]['_appendChild'](_0x20e684),new _0x2b97ae(_0x4b1aa9[0x0]);}return _0x20e684;}['_copyMarkersToFragment'](_0x540999,_0x3ed0b7,_0x471411={'isTableSelection':!0x1}){const _0x20ecf9=this['editor']['model'],_0x31af19=Array['from'](_0x3ed0b7['getRanges']()),_0x1968c8=_0x3ed0b7['getFirstRange']()['start'];for(const _0x4c4975 of _0x20ecf9['markers']){if(_0x4c4975['name']['startsWith'](Zs)||!_0x4c4975['affectsData'])continue;const _0x54dc40=_0x4c4975['getRange']();if(!_0x31af19['some'](_0x1feef0=>_0x1feef0['containsRange'](_0x54dc40,!0x0)))continue;const _0x8cf725=this['_regularCalculateMarkerPath'](_0x54dc40['start'],_0x1968c8,_0x471411['isTableSelection']),_0x58fff5=this['_regularCalculateMarkerPath'](_0x54dc40['end'],_0x1968c8,_0x471411['isTableSelection']),_0x36bd02=_0x20ecf9['createPositionFromPath'](_0x540999,_0x8cf725),_0x56c97a=_0x20ecf9['createPositionFromPath'](_0x540999,_0x58fff5);if(!_0x36bd02['isEqual'](_0x56c97a)){const _0x5e75a7=_0x20ecf9['createRange'](_0x36bd02,_0x56c97a);_0x540999['markers']['set'](_0x4c4975['name'],_0x5e75a7);}}}['_regularCalculateMarkerPath'](_0x5198d5,_0x5ae92d,_0x59a9a2=!0x1){const _0x106225=[..._0x5198d5['path']['slice']()];for(let _0x4afeec=0x0;_0x4afeec<Math['max'](_0x5ae92d['path']['length'],_0x5198d5['path']['length']);_0x4afeec++){const _0x4c0f4a=_0x5ae92d['path'][_0x4afeec]||0x0,_0x2ea90e=(_0x5198d5['path'][_0x4afeec]||0x0)-_0x4c0f4a;if(_0x106225[_0x4afeec]=_0x2ea90e,0x0!==_0x2ea90e&&!_0x59a9a2)break;}return _0x106225;}async['_createInteraction'](_0x6b1f69,_0x118cea,_0x982222,_0x1edb67){const _0x4d2f6d=this['editor'];this['_interactionParams']||(this['_interactionParams']={'action':_0x1edb67,'content':_0x6b1f69,'version':_0x118cea,'aiBalloon':_0x982222,'modelFragment':this['editor']['model']['getSelectedContent'](this['editor']['model']['document']['selection']),'anchorData':new Map()});const _0x570844=new Xa({'connector':this['_aiConnector'],'editor':_0x4d2f6d,'content':_0x6b1f69,'version':_0x118cea,..._0x1edb67});this['_interactions']['push'](_0x570844);const _0x598355=(_0x3ac4d5,_0x280539=!0x1,_0x4fadc2='streaming')=>this['_promiseQueue']['enqueue'](async _0x55916f=>{try{const _0x2d3d86=Ns({'editor':_0x4d2f6d,'changeGroups':_0x3ac4d5['changeGroups'],'documentContextContent':_0x3ac4d5['documentContextContent'],'showDiff':_0x280539,'trimUnchanged':!0x1});_0x2d3d86['length']&&await this['_actionsBalloonView']['updateContent']({'part':_0x2d3d86[0x0],'renderingStrategy':_0x4fadc2,'abortSignal':_0x55916f});}catch(_0x1ede4e){if(this['_isAbortError'](_0x1ede4e))return;throw _0x1ede4e;}});this['_interaction']['on']('replyCreated',(_0xc7b08e,_0x5cf8ae)=>{this['_actionsBalloonView']['hideLoader'](),this['_actionsBalloonView']['startAutoScroll'](),_0x598355(_0x5cf8ae)['catch'](_0x296a55=>{this['_isAbortError'](_0x296a55)||(console['error']('Error\x20updating\x20content\x20in\x20replyCreated:',_0x296a55),this['_setErrorState'](_0x570844));});}),this['_interaction']['on']('replyContentUpdated',(_0x3684b3,_0x1f6eb5)=>{_0x598355(_0x1f6eb5)['catch'](_0x23858e=>{this['_isAbortError'](_0x23858e)||(console['error']('Error\x20updating\x20content\x20in\x20replyContentUpdated:',_0x23858e),this['_setErrorState'](_0x570844));});}),this['_interaction']['on']('interactionFinished',async()=>{try{await this['_clearLoadingState'](),this['_actionsBalloonView']['updateMiniToolbarButtons'](this['_interactions']['length'],this['_currentInteractionIndex']),await this['_promiseQueue']['queueEmptyPromise'];}catch(_0x4cfb68){this['_isAbortError'](_0x4cfb68)||(console['error']('Error\x20clearing\x20loading\x20state\x20in\x20interactionFinished:',_0x4cfb68),this['_setErrorState'](_0x570844));}finally{this['_actionsBalloonView']['stopAutoScroll']();}}),this['listenTo'](this['_actionsBalloonView'],'toggleSuggestionDisplayMode',async(_0x590602,{showDiff:_0x324aad})=>{try{this['_balloonShowDiff']=_0x324aad;const _0x43c055=this['_interaction']['replies'][this['_interaction']['replies']['length']-0x1];_0x43c055&&await _0x598355(_0x43c055,_0x324aad,'static');}catch(_0x31ad3a){this['_isAbortError'](_0x31ad3a)||(console['error']('Error\x20updating\x20content\x20in\x20toggleSuggestionDisplayMode:',_0x31ad3a),this['_setErrorState'](_0x570844));}}),this['_interaction']['on']('replyChangeGroupStateUpdated',(_0xc5628f,{reply:_0x51ec13})=>{const _0x3dc41d={'positiveCount':_0x51ec13['changeGroups']['filter'](_0xffd5a5=>'accepted'===_0xffd5a5['state'])['length'],'totalCount':_0x51ec13['changeGroups']['length']},_0x2b230d=this['_interaction']['actionCallId'],_0x16c3d7=this['_interaction']['actionName'];_0x16c3d7?this['_aiConnector']['upsertAIActionRating'](_0x16c3d7,_0x2b230d,_0x3dc41d):this['_aiConnector']['upsertCustomAIActionRating'](_0x2b230d,_0x3dc41d);}),this['_setLoadingState']();try{const _0x59571d=await this['_interaction']['start']();return this['_actionsBalloonView']['updateMiniToolbarButtons'](this['_interactions']['length'],this['_currentInteractionIndex']),_0x59571d;}catch(_0x199d91){if(this['_isAbortError'](_0x199d91))return;this['_actionsBalloonView']['hideLoader'](),this['_setErrorState'](_0x570844);}}['_applyChanges'](_0xd4c25f,_0x4cb595,_0x484681){const _0x563b7a=this['editor'];if(_0x484681&&!_0x563b7a['plugins']['has']('TrackChanges'))throw new ht('ai-no-track-changes',null);const _0x5cb586=this['editor']['plugins']['get'](_0x46bc33),_0x264998=this['_interactions'][this['_interactions']['length']-0x1-this['_currentInteractionIndex']];if(!_0x264998||!_0x264998['replies']['length'])return;const _0x412590=_0x264998['replies'][_0x264998['replies']['length']-0x1],_0x4161cc=_0x412590['changeGroups'];_0x412590['setChangeGroupState'](0x0,'accepted');let _0x2a16ba=zs({'editor':_0x563b7a,'reply':_0x412590,'interaction':_0x264998,'groups':_0x4161cc,'transform':!0x1,'documentCompare':_0x5cb586,'documentCompareOptions':{'anchor':_0x563b7a['model']['createPositionAt'](_0xd4c25f,0x0),'markDeletions':_0x484681}});_0x2a16ba=this['_filterOperationsOutsideRange'](_0x2a16ba,_0x4cb595);for(const _0x56600c of _0x2a16ba)this['_anchorOperation'](_0x4cb595,_0x56600c,_0x563b7a['model']['document']['getRoot']());const _0x2f2239=_0x264998['getDocumentContext']()['version'],_0x1da4d2=_0x563b7a['model']['document']['history']['getOperations'](_0x2f2239),_0x9d626a={'document':_0x563b7a['model']['document'],'useRelations':!0x1,'padWithNoOps':!0x1},_0x58e9c3=_0x1225df(_0x2a16ba,_0x1da4d2,_0x9d626a)['operationsA'];_0x563b7a['model']['change'](_0x3389d1=>{if(_0x3389d1['setSelection'](_0x563b7a['model']['document']['selection']['focus']),_0x484681)_0x563b7a['plugins']['get']('TrackChangesEditing')['_applyOperationsAsSuggestions'](_0x58e9c3);else{for(const _0x1659b7 of _0x58e9c3)_0x1659b7['baseVersion']=_0x563b7a['model']['document']['version'],js(_0x563b7a,_0x1659b7),_0x3389d1['batch']['addOperation'](_0x1659b7),_0x563b7a['model']['applyOperation'](_0x1659b7);}}),this['editor']['plugins']['get']('AIBalloon')['close']();}['_filterOperationsOutsideRange'](_0x58cde2,_0x3fde86){return _0x58cde2['filter'](_0x2d3e6d=>{if('rename'==_0x2d3e6d['type']){const _0x5c7b76=_0x2d3e6d['position']['nodeAfter'];return!_0x3fde86['has'](_0x5c7b76);}if(_0x2d3e6d['type']['indexOf']('Attribute')>-0x1){const _0x41dbd5=_0x2d3e6d['range']['start']['nodeAfter'];return!_0x3fde86['has'](_0x41dbd5);}return!0x0;});}['_anchorOperation'](_0xf0377c,_0x3362c8,_0x1f8dc9){const _0x2f2f90=_0x3362c8['clone']();for(const _0x4e895f in _0x3362c8){const _0x231a5e=_0x3362c8[_0x4e895f];_0x231a5e instanceof _0x1857bd?_0x3362c8[_0x4e895f]=new _0x1857bd(_0x74e583(_0x231a5e['start']),_0x74e583(_0x231a5e['end'])):_0x231a5e instanceof _0x392b93&&(_0x3362c8[_0x4e895f]=_0x74e583(_0x231a5e));}if(['insert','move','remove','reinsert','split','merge']['includes'](_0x2f2f90['type'])){if(_0x2f2f90['isDocumentOperation']=!0x1,_0x2f2f90['baseVersion']=null,'remove'==_0x2f2f90['type']){const _0x4cbadc=_0x2f2f90['sourcePosition'],_0x2c19cb=_0x2f2f90['howMany'];new _0x3ff0e2(_0x4cbadc,_0x2c19cb)['_execute']();}else _0x2f2f90['_execute']();}function _0x74e583(_0x36fba3){if('$graveyard'==_0x36fba3['root']['rootName'])return _0x36fba3;const _0x19fac0=[];let _0x236cf8=_0x36fba3['root'];for(let _0x4fb781=0x0;_0x4fb781<_0x36fba3['path']['length'];_0x4fb781++){const _0x347ca8=_0xf0377c['get'](_0x236cf8)||0x0;_0x19fac0[_0x4fb781]=_0x36fba3['path'][_0x4fb781]+_0x347ca8,_0x236cf8=_0x236cf8['getChildAtOffset'](_0x36fba3['path'][_0x4fb781]);}return new _0x392b93(_0x1f8dc9,_0x19fac0,_0x36fba3['stickiness']);}}['_refreshInteraction'](){if(!this['_interactionParams'])return;this['_interactions']['length']>0x0&&this['_stopInteraction'](),this['_currentInteractionIndex']=0x0,this['_balloonShowDiff']=!0x1;const {action:_0x2dd552,content:_0x1a2189,version:_0x9726b5,aiBalloon:_0x3f9230}=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'](_0x1a2189,_0x9726b5,_0x3f9230,_0x2dd552)['catch'](_0x56b84d=>{this['_isAbortError'](_0x56b84d)||console['error']('Error\x20refreshing\x20interaction:',_0x56b84d);});}['_isAbortError'](_0x597608){return!!_0x597608['message']&&_0x597608['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 _0xa0caee=this['_interactions']['length'];this['_currentInteractionIndex']<_0xa0caee-0x1&&this['_displayInteractionAtIndex'](this['_currentInteractionIndex']+0x1);}['_navigateToNext'](){this['_currentInteractionIndex']>0x0&&this['_displayInteractionAtIndex'](this['_currentInteractionIndex']-0x1);}async['_displayInteractionAtIndex'](_0x46317c){if(!this['_interactionParams'])return;this['_currentInteractionIndex']=_0x46317c;const _0x5d6b20=this['_interactions'][this['_interactions']['length']-0x1-this['_currentInteractionIndex']];if(!_0x5d6b20)return;if(_0x5d6b20['hasError'])return this['_setErrorState'](_0x5d6b20),void this['_actionsBalloonView']['updateMiniToolbarButtons'](this['_interactions']['length'],this['_currentInteractionIndex']);if(!_0x5d6b20['replies']['length'])return;this['_actionsBalloonView']['hideError'](),this['_interactionParams']&&this['_clearErrorState']();const _0x5a9245=_0x5d6b20['replies'][_0x5d6b20['replies']['length']-0x1];if(_0x5a9245){const _0x250486=this['editor'];try{const _0x2c4703=Ns({'editor':_0x250486,'changeGroups':_0x5a9245['changeGroups'],'documentContextContent':_0x5a9245['documentContextContent'],'showDiff':this['_balloonShowDiff'],'trimUnchanged':!0x1});await new Promise(_0x258514=>setTimeout(_0x258514,0x32)),await this['_actionsBalloonView']['updateContent']({'part':_0x2c4703[0x0],'renderingStrategy':'static','abortSignal':new AbortController()['signal']});}catch(_0x57b9d6){this['_isAbortError'](_0x57b9d6)||console['error']('Error\x20updating\x20content\x20during\x20navigation:',_0x57b9d6);}}this['_actionsBalloonView']['updateMiniToolbarButtons'](this['_interactions']['length'],this['_currentInteractionIndex']);}['_setLoadingState'](){this['_actionsBalloonView']['setIsLoading'](!0x0),this['isBusy']=!0x0;}async['_setErrorState'](_0x46cb59){const _0x39aa1c=us(this['editor']['locale'],'AI_ACTIONS_GENERIC_ERROR');this['_actionsBalloonView']['showError'](_0x39aa1c),_0x46cb59['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(_0x708078){return _0x708078['CONTINUE']='continue',_0x708078['FIX_GRAMMAR']='fix-grammar',_0x708078['IMPROVE_WRITING']='improve-writing',_0x708078['MAKE_LONGER']='make-longer',_0x708078['MAKE_SHORTER']='make-shorter',_0x708078['MAKE_TONE_CASUAL']='make-tone-casual',_0x708078['MAKE_TONE_FORMAL']='make-tone-formal',_0x708078['TRANSLATE']='translate',_0x708078;}({});class so extends _0x52790d{static get['requires'](){return[Ya,qa,eo];}static get['pluginName'](){return'AIQuickActions';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x55348c){super(_0x55348c),_0x55348c['config']['define']('ai.quickActions',{'extraCommands':[],'removeCommands':[],'isSearchEnabled':!0x0});}}var no=function(_0x301e4c){return _0x301e4c['CHAT']='chat',_0x301e4c['ACTION']='action',_0x301e4c;}({});class ro extends vt{['resultResponseView'];['acceptButtonView'];['dismissButtonView'];['infoButtonView'];['outdatedButtonView'];constructor(_0x403083,_0x282d6f){super(_0x403083),this['id']=_0x282d6f,this['set']('status','pending'),this['set']('changeId',_0x282d6f),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',(_0x16448d,_0x4ccfaf)=>{_0x4ccfaf&&_0x4ccfaf['target']&&'A'===_0x4ccfaf['target']['tagName']&&_0x4ccfaf['preventDefault'](),this['fire']('activateChange',{'id':_0x282d6f,'source':this,'uiInteraction':'click'});}),this['on']('mouseover',()=>{this['fire']('activateChange',{'id':_0x282d6f,'source':this,'uiInteraction':'hover'});}),this['on']('mouseout',()=>{this['fire']('deactivateChange',{'origin':'panel','id':_0x282d6f,'source':this});});}['setItemAsActive'](){this['isActive']=!0x0;}['setItemAsInactive'](){this['isActive']=!0x1;}['_createResultResponseView'](){const _0x2e912b=new vt(this['locale']);return _0x2e912b['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',_0x123457=>!_0x123457)]}}),_0x2e912b;}['_createAcceptButtonView'](){const _0x276f73=new Nt(this['locale']);return _0x276f73['set']({'label':us(this['locale'],'AI_REVIEW_MODE_ACCEPT_CHANGE'),'withText':!0x0}),_0x276f73['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x1d407e=>{this['fire']('acceptChange',{'id':this['changeId']}),_0x1d407e['stopPropagation']();})},'attributes':{'class':[_s,'ck-ai_review__check-run-result-accept-button',this['bindTemplate']['if']('status','ck-hidden',_0x37a0f4=>'pending'!==_0x37a0f4&&'accepted'!==_0x37a0f4),this['bindTemplate']['if']('status','ck-ai_review__check-run-result-accept-button',_0x191a52=>'pending'===_0x191a52),this['bindTemplate']['if']('status','ck-ai_review__check-run-result-status-button',_0x4d76d4=>'accepted'===_0x4d76d4)]}}),this['on']('change:status',(_0x1718e7,_0x5e733c,_0x42616a)=>{_0x276f73['isEnabled']='pending'===_0x42616a,'accepted'===_0x42616a&&(_0x276f73['label']=us(this['locale'],'AI_REVIEW_MODE_CHECK_STATUS_ACCEPTED'),_0x276f73['icon']=_0x4dbbde);}),_0x276f73;}['_createDismissButtonView'](){const _0x148431=new Nt(this['locale']);return _0x148431['set']({'label':us(this['locale'],'AI_REVIEW_MODE_DISMISS_CHANGE'),'withText':!0x0}),_0x148431['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x3e2311=>{this['fire']('dismissChange',{'id':this['changeId']}),_0x3e2311['stopPropagation']();})},'attributes':{'class':[As,this['bindTemplate']['if']('status','ck-hidden',_0x17d221=>'pending'!==_0x17d221&&'rejected'!==_0x17d221),this['bindTemplate']['if']('status','ck-ai_review__check-run-result-dismiss-button',_0xc9f72f=>'pending'===_0xc9f72f),this['bindTemplate']['if']('status','ck-ai_review__check-run-result-status-button',_0xa79c6d=>'rejected'===_0xa79c6d)]}}),this['on']('change:status',(_0x54531f,_0x5f1071,_0x263bdd)=>{_0x148431['isEnabled']='pending'===_0x263bdd,'rejected'===_0x263bdd&&(_0x148431['label']=us(this['locale'],'AI_REVIEW_MODE_CHECK_STATUS_REJECTED'),_0x148431['icon']=_0x2d333c);}),_0x148431;}['_createInfoButtonView'](){const _0x133119=new Nt(this['locale']);return _0x133119['set']({'label':us(this['locale'],'AI_REVIEW_MODE_LEARN_MORE'),'icon':_0x1b9c2f,'tooltip':!0x0,'isToggleable':!0x0,'role':'menuitemcheckbox','class':As+'\x20ck-ai_review__check-run-result-info-button\x20ck-hidden'}),_0x133119['bind']('isOn')['to'](this,'isInfoToggleOn',_0x586831=>_0x586831),_0x133119['on']('execute',()=>{this['isInfoToggleOn']=!this['isInfoToggleOn'];}),_0x133119;}['_createOutdatedButtonView'](){const _0xfe095f=new Nt(this['locale']);return _0xfe095f['set']({'label':us(this['locale'],'AI_REVIEW_MODE_CHECK_STATUS_OUTDATED'),'icon':st,'withText':!0x0,'isEnabled':!0x1}),_0xfe095f['extendTemplate']({'attributes':{'class':[As,'ck-ai_review__check-run-result-status-button',this['bindTemplate']['if']('status','ck-hidden',_0x528782=>'outdated'!==_0x528782)],'disabled':'disabled'}}),_0xfe095f;}}class ao extends Xt{['resultItemView'];['_pinnedRectIndex']=void 0x0;['_pinnedTargetElement']=void 0x0;['_pinnedTargetChangeId']=void 0x0;constructor(_0x236b93,_0x168a7d){super(_0x236b93),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']()),_0x168a7d['add'](this);}['render'](){super['render'](),this['_setupClickOutsideHandler']();}['updateContent'](_0x2e0b3c){this['resultItemView']['changeId']=_0x2e0b3c['id'],this['resultItemView']['resultResponseView']['element']['innerHTML']=_0x2e0b3c['contentDiffed'];}['showBalloon'](_0x5dd60b,_0x326770,_0x4960b1,_0x445441,_0x3d30ce,_0x5da104){const _0x18ad18=_0x326770();if(!_0x18ad18)return;this['updateContent'](_0x5dd60b),this['show']();const _0x271b7f=Array['from'](_0x18ad18['getClientRects']())['reverse'](),_0x57ad90=this['_getPointedRectIndexFromEvent'](_0x4960b1,_0x271b7f),_0x186820=_0x271b7f[_0x57ad90??0x0];'click'===_0x445441?(this['isDiffActive']=!0x0,this['pin']({'target':()=>this['_getBestRectPositionOnClick'](_0x326770(),_0x57ad90,_0x5dd60b['id'],_0x3d30ce,_0x5da104)||_0x186820})):'hover'===_0x445441&&(this['isDiffActive']=!0x1,this['pin']({'target':()=>this['_getBestRectPositionOnHover'](_0x326770(),_0x57ad90,_0x5dd60b['id'])||_0x186820}));}['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 _0x5a4d2d=[this['element']];return this['_pinnedTargetElement']&&_0x5a4d2d['push'](this['_pinnedTargetElement']),_0x5a4d2d;},'callback':()=>{this['hide'](),this['unpin'](),this['deactivateChange'](),this['_pinnedTargetElement']=void 0x0,this['_pinnedRectIndex']=void 0x0,this['_pinnedTargetChangeId']=void 0x0;}});}['_createContentView'](){const _0x4982b2=new vt();return this['resultItemView']=new ro(this['locale'],''),this['resultItemView']['resultResponseView']['extendTemplate']({'attributes':{'class':['ck-content']}}),this['resultItemView']['delegate']('acceptChange','dismissChange')['to'](this),_0x4982b2['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']]}]}),_0x4982b2;}['_getBestRectPositionOnClick'](_0x52bbc2,_0x23fb76,_0x884b36,_0x40b4b4,_0x172f9a){if(!_0x52bbc2)return null;const _0x1be6e8=this['position']['replace']('arrow_',''),_0x2f3660=Array['from'](_0x52bbc2['getClientRects']());let _0x10e4e4,_0x104551=_0x2f3660['reverse']();return void 0x0!==_0x23fb76&&this['_isPinnedRectVisible'](_0x104551[_0x23fb76],_0x40b4b4,_0x172f9a)?(_0x10e4e4=_0x104551[_0x23fb76],this['_pinnedRectIndex']=_0x23fb76):this['_isPinnedRectVisible'](_0x104551[0x0],_0x40b4b4,_0x172f9a)&&void 0x0===_0x23fb76?_0x10e4e4=_0x104551[0x0]:(_0x104551='s'==_0x1be6e8[0x0]?[..._0x2f3660]['reverse']():_0x2f3660,_0x104551['forEach'](_0x2077fd=>{this['_isPinnedRectVisible'](_0x2077fd,_0x40b4b4,_0x172f9a)&&(_0x10e4e4=_0x2077fd);})),this['_pinnedTargetChangeId']=_0x884b36,this['_pinnedTargetElement']=_0x52bbc2,_0x10e4e4||_0x52bbc2['getBoundingClientRect']();}['_getBestRectPositionOnHover'](_0x5cc9f6,_0x3ea581,_0x5e45ec){if(!_0x5cc9f6)return null;const _0x19d128=Array['from'](_0x5cc9f6['getClientRects']())['reverse']();if(void 0x0===this['_pinnedRectIndex']&&void 0x0!==_0x3ea581&&this['_pinnedTargetChangeId']!==_0x5e45ec)return this['_pinnedRectIndex']=_0x3ea581,this['_pinnedTargetElement']=_0x5cc9f6,this['_pinnedTargetChangeId']=_0x5e45ec,_0x19d128[_0x3ea581];if(void 0x0!==this['_pinnedRectIndex']&&this['_pinnedTargetChangeId']===_0x5e45ec){if(_0x5cc9f6!==this['_pinnedTargetElement'])return Array['from'](this['_pinnedTargetElement']['getClientRects']())['reverse']()[this['_pinnedRectIndex']];return _0x19d128[this['_pinnedRectIndex']];}return void 0x0!==_0x3ea581&&this['_pinnedTargetChangeId']!==_0x5e45ec?(this['_pinnedRectIndex']=_0x3ea581,this['_pinnedTargetElement']=_0x5cc9f6,this['_pinnedTargetChangeId']=_0x5e45ec,_0x19d128[_0x3ea581]):_0x5cc9f6['getBoundingClientRect']();}['_getPointedRectIndexFromEvent'](_0x5441a9,_0x28d009){if(_0x5441a9)for(let _0x50b18f=0x0;_0x50b18f<_0x28d009['length'];_0x50b18f++){const _0xae8d84=_0x28d009[_0x50b18f];if(_0x5441a9['clientX']>=_0xae8d84['left']-0x3&&_0x5441a9['clientX']<=_0xae8d84['right']+0x3&&_0x5441a9['clientY']>=_0xae8d84['top']-0x3&&_0x5441a9['clientY']<=_0xae8d84['bottom']+0x3)return _0x50b18f;}}['_isPinnedRectVisible'](_0x21ba99,_0x17ac35,_0x271a22){const _0x2eed84=new dt(_0x21ba99),_0x74f5a0=_0x17ac35||document['documentElement'],_0x5b81d2=_0x2eed84['getIntersection'](Rt(_0x271a22)),_0x38a895=new dt(_0x74f5a0)['getIntersection'](_0x2eed84);return!!(_0x5b81d2&&_0x38a895&&_0x2eed84['width']>0x0);}}const oo=['getReviewCheckList','runReviewCheck','abortReviewStream','toggleDiff','acceptAllChanges','leaveReviewCoreResultList','activateChange','deactivateChange','acceptChange','dismissChange','learnMore','finishReview','retryReview'];class ho extends _0x20e290{['_mainView'];['_balloonSuggestionView'];['_bodyCollection'];static get['requires'](){return[cs];}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x40d43c){super(_0x40d43c),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 _0x427933=this['context']['plugins']['get']('AITabs');this['registerTab'](_0x427933);}['destroy'](){this['_bodyCollection']['detachFromDom'](),super['destroy']();}['setAvailableChecks'](_0x28c848){if(!this['_mainView']['reviewCheckListView']['hasChecks']()){const _0x5ebe74=!this['context']['config']['get']('ai.models.showModelSelector');this['_mainView']['reviewCheckListView']['setChecks'](_0x28c848,_0x5ebe74);}this['_mainView']['showReviewCheckListView']();}['showReviewCheckList'](){this['fire']('getReviewCheckList');}['showCheckRunResults'](_0x5b3929){_0x5b3929&&('error-general'!==_0x5b3929['status']?'error-chunk'!==_0x5b3929['status']?this['_mainView']['showReviewCheckResultsView']():this['showChunkErrorView']():this['showGeneralResultsErrorView']());}['showCheckRunResult'](_0x550f06){this['_mainView']['addCheckRunResult'](_0x550f06);}['showGeneralResultsErrorView'](){this['_mainView']['showGeneralResultsErrorView']();}['showGeneralReviewCoreErrorView'](_0x525739){this['_mainView']['showGeneralReviewCoreErrorView'](_0x525739??us(this['context']['locale'],'AI_REVIEW_INITIALIZATION_ERROR_MESSAGE'));}['showChunkErrorView'](){this['_mainView']['showChunkErrorView']();}['setCheckResultTitle'](_0x2a03ef,_0x5880d6){this['_mainView']['reviewCheckResultsView']['setTitle'](_0x2a03ef,_0x5880d6);}['setActiveStateInResults'](_0x5cf605){this['_mainView']['reviewCheckResultsView']['getResults']()['forEach'](_0x172eae=>{_0x172eae['id']===_0x5cf605&&_0x172eae['setItemAsActive']();});}['resetActiveStateInResults'](){this['_mainView']['reviewCheckResultsView']['getResults']()['forEach'](_0x2ab6db=>_0x2ab6db['setItemAsInactive']());}['updateChangeState'](_0x44f1fe,_0x1195e1){'accepted'===_0x1195e1||'rejected'===_0x1195e1||'outdated'===_0x1195e1?this['_mainView']['reviewCheckResultsView']['hideResult'](_0x44f1fe,_0x1195e1):this['_mainView']['reviewCheckResultsView']['showResult'](_0x44f1fe,_0x1195e1);}['showReviewCompletedView'](){this['_mainView']['showReviewCompletedView']();}['showActionsWhenResultIsReady'](){this['_mainView']['showActionsWhenResultIsReady']();}['showNoChangesView'](){this['_mainView']['showNoChangesView']();}['hideActionsWhenResultIsReady'](){this['_mainView']['hideActionsWhenResultIsReady']();}['showChangeBalloon'](_0x3fd80e,_0x261ee6,_0x4229af,_0x35fed2,_0x35f164,_0x4cee93){this['_balloonSuggestionView']['showBalloon'](_0x3fd80e,_0x261ee6,_0x4229af,_0x35fed2,_0x35f164,_0x4cee93);}['hideChangeBalloon'](){this['_balloonSuggestionView']['hideBalloon']();}['hideDiffInBalloon'](){this['_balloonSuggestionView']['hideDiffInBalloon']();}['showDiffInBalloon'](){this['_balloonSuggestionView']['showDiffInBalloon']();}['getChangeElement'](_0x20c49f){const _0xc1362=this['_mainView']['reviewCheckResultsView']['getResults']()['find'](_0x233e0f=>_0x233e0f['id']===_0x20c49f);return _0xc1362?_0xc1362['element']:null;}['deactivateChange'](){this['_balloonSuggestionView']['deactivateChange']();}}class co extends vt{constructor(_0x4b7b58){super(_0x4b7b58),this['set']('isVisible',!0x1),this['set']('errorMessage','');const _0x2eb28f=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai_review__general-error-container',_0x2eb28f['if']('isVisible','ck-hidden',_0xc6dce9=>!_0xc6dce9)]},'children':[{'tag':'p','attributes':{'class':'ck\x20ck-ai-notification\x20ck-ai-notification_error'},'children':[{'text':_0x2eb28f['to']('errorMessage')}]}]});}}class lo extends vt{['reviewCoreHeader'];['generalErrorView'];['reviewCheckListView'];['reviewCheckResultsView'];['reviewCompletedView'];constructor(_0x5a03ba,_0x5c457f){super(_0x5a03ba),this['reviewCoreHeader']=_0x5c457f['header'],this['generalErrorView']=new co(_0x5a03ba),this['reviewCheckListView']=_0x5c457f['list'],this['reviewCheckListView']['delegate'](...oo)['to'](this),this['reviewCheckResultsView']=_0x5c457f['results'],this['reviewCheckResultsView']['delegate'](...oo)['to'](this),this['reviewCompletedView']=_0x5c457f['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'](_0x3c7ca){this['reviewCheckResultsView']['addResult'](_0x3c7ca),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'](_0x4c5d02){this['generalErrorView']['set']('isVisible',!0x0),this['generalErrorView']['errorMessage']=_0x4c5d02;}['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(_0x29c539,_0x1c754e){super(_0x1c754e),this['set']({'label':_0x29c539,'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(_0x4572f7,_0x74b2f8){super(_0x4572f7),this['_contents']=_0x74b2f8,this['_resultViews']=new _0x2ebc1e(),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(_0x4572f7),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 _0x40d3d1=this['_createCombinedSkeletonLoader'](),_0x12b5cb=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-run',_0x12b5cb['if']('isLoading','ck-ai_review__check-run_loading',_0x59f3a1=>_0x59f3a1),_0x12b5cb['if']('isResultReady','ck-ai_review__check-run_ready',_0xf5cdbc=>_0xf5cdbc),_0x12b5cb['if']('isVisible','ck-hidden',_0x4d522c=>!_0x4d522c)]},'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',_0x52a522=>_0x52a522)]},'children':this['_resultViews']},_0x40d3d1]},this['reviewDisclaimer']]});}['clearResults'](){this['_resultViews']['clear']();}['getResults'](){return this['_resultViews'];}['addResult'](_0x107fc3){const _0x5be749=new ro(this['locale'],_0x107fc3['id']);_0x5be749['delegate']('acceptChange','dismissChange','activateChange','deactivateChange')['to'](this),this['_resultViews']['add'](_0x5be749),_0x5be749['resultResponseView']['element']['innerHTML']=_0x107fc3['contentDiffed'];}['hideResult'](_0x3d1467,_0xf2be64){if('pending'===_0xf2be64)return;const _0x29f72a=this['_resultViews']['find'](_0x409a8a=>_0x409a8a['id']===_0x3d1467);_0x29f72a&&(_0x29f72a['status']=_0xf2be64,_0x29f72a['element']?.['classList']['add']('ck-ai_review__check-run-result_grayout'));}['showResult'](_0x3bd16c,_0x5c4274){if('pending'!==_0x5c4274)return;const _0x55a392=this['_resultViews']['find'](_0x3e8971=>_0x3e8971['id']===_0x3bd16c);_0x55a392&&(_0x55a392['status']=_0x5c4274,_0x55a392['element']?.['classList']['remove']('ck-ai_review__check-run-result_grayout'));}['setTitle'](_0x47e15d,_0x301aec){this['headerTitle']=_0x47e15d,this['headerSubtitle']=_0x301aec||'';}['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 _0x4eb417=new vt(this['locale']),_0x1681b6=[];for(let _0x44182a=0x0;_0x44182a<0x10;_0x44182a++){const _0x7711ea=this['_createSkeletonLoader']();_0x7711ea['extendTemplate']({'attributes':{'class':['ck-ai_review__check-run-skeleton-item']}}),_0x1681b6['push'](_0x7711ea);}return _0x4eb417['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-run-skeleton-container',this['bindTemplate']['if']('isLoading','ck-hidden',_0x264f65=>!_0x264f65)]},'children':_0x1681b6}),_0x4eb417;}['_createErrorView'](){const _0x4ecd04=new vt(this['locale']),_0x597fc1=new Nt(this['locale']),t=this['locale']['t'];return _0x4ecd04['delegate']('retryReview')['to'](this),_0x597fc1['set']({'label':t('Try\x20again'),'withText':!0x0,'class':_s+'\x20ck-ai_review__check-run-error-retry-button'}),_0x597fc1['on']('execute',()=>{this['fire']('retryReview');}),_0x4ecd04['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-run-error-container',this['bindTemplate']['if']('showErrorMessage','ck-hidden',_0x4aa2b5=>!_0x4aa2b5),this['bindTemplate']['if']('errorType','ck-ai_review__check-run-error-container_border-bottom',_0x4a622a=>'chunk'===_0x4a622a)]},'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',_0x3651aa=>'chunk'===_0x3651aa)]},'children':[{'tag':'p','attributes':{'class':['ck-ai-notification__content',this['bindTemplate']['if']('errorType','ck-hidden',_0x332b03=>'general'!==_0x332b03)]},'children':[{'text':this['_contents']['generalErrorText']}]},{'tag':'p','attributes':{'class':['ck-ai-notification__content',this['bindTemplate']['if']('errorType','ck-hidden',_0x1c436c=>'chunk'!==_0x1c436c)]},'children':[{'text':us(this['locale'],'AI_REVIEW_MODE_CHUNK_ERROR_MESSAGE')}]}]},_0x597fc1]}),_0x4ecd04;}['_createCancelButtonView'](){const _0x430202=new Nt(this['locale']);return _0x430202['set']({'label':us(this['locale'],'AI_REVIEW_MODE_STOP_GENERATING'),'withText':!0x0,'class':[_s+'\x20ck-ai-button-stop-generating'],'icon':_0x39f907}),_0x430202['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isResultReady','ck-hidden',_0x869210=>_0x869210),this['bindTemplate']['if']('isCompleted','ck-hidden',_0x2d9bf2=>_0x2d9bf2)]}}),_0x430202['on']('execute',()=>{this['fire']('abortReviewStream');}),_0x430202;}['_createToggleDiffButtonView'](){const _0x2beab0=new Nt(this['locale']);_0x2beab0['set']({'tooltip':!0x0,'isToggleable':!0x0,'role':'menuitemcheckbox'}),_0x2beab0['bind']('isEnabled')['to'](this,'isError',_0x41843f=>!_0x41843f),_0x2beab0['extendTemplate']({'attributes':{'class':[_s,'ck-ai_review__check-run-toggle-diff-button',this['bindTemplate']['if']('isResultReady','ck-hidden',_0x39a23d=>!_0x39a23d),this['bindTemplate']['if']('isCompleted','ck-hidden',_0xdc21eb=>_0xdc21eb)]}});const _0x10cd5e=us(this['locale'],'AI_REVIEW_MODE_HIDE_CHANGES'),_0x4080f4=us(this['locale'],'AI_REVIEW_MODE_SHOW_CHANGES');return _0x2beab0['bind']('isOn')['to'](this,'isToggleDiffOn',_0x3f653c=>_0x3f653c),_0x2beab0['bind']('icon')['to'](this,'isToggleDiffOn',_0x27b950=>_0x27b950?nt:rt),_0x2beab0['bind']('label')['to'](this,'isToggleDiffOn',_0x2de4e1=>_0x2de4e1?_0x10cd5e:_0x4080f4),_0x2beab0['on']('execute',()=>{this['isToggleDiffOn']=!this['isToggleDiffOn'],this['fire']('toggleDiff',{'on':this['isToggleDiffOn']});}),_0x2beab0;}['_createAcceptAllButtonView'](){const _0xe828e=new Nt(this['locale']);return _0xe828e['set']({'label':us(this['locale'],'AI_REVIEW_MODE_ACCEPT_ALL'),'withText':!0x0}),_0xe828e['bind']('isEnabled')['to'](this,'isError',_0x260eb8=>!_0x260eb8),_0xe828e['extendTemplate']({'attributes':{'class':[ds,'ck-ai_review__check-run-accept-all-button',this['bindTemplate']['if']('isResultReady','ck-hidden',_0xd3efd8=>!_0xd3efd8),this['bindTemplate']['if']('isCompleted','ck-hidden',_0x2c8dbd=>_0x2c8dbd)]}}),_0xe828e['on']('execute',()=>{this['fire']('acceptAllChanges');}),_0xe828e;}['_createExitReviewButtonView'](){const _0x24da6a=new Nt(this['locale']);return _0x24da6a['set']({'label':us(this['locale'],'AI_REVIEW_MODE_EXIT_REVIEW'),'withText':!0x0}),_0x24da6a['extendTemplate']({'attributes':{'class':[As,'ck-ai_review__check-run-exit-button',this['bindTemplate']['if']('isResultReady','ck-hidden',_0x1c92d5=>!_0x1c92d5),this['bindTemplate']['if']('isCompleted','ck-hidden',_0x4d7707=>_0x4d7707)]}}),_0x24da6a['on']('execute',()=>{this['fire']('leaveReviewCoreResultList');}),_0x24da6a;}['_createResultHeaderView'](){const _0x49eb4f=new vt(this['locale']),_0x265121=this['_createTitleView']();return _0x49eb4f['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-run-results-header',this['bindTemplate']['if']('isCompleted','ck-ai_review__review-completed-header',_0x1ec5c0=>_0x1ec5c0)]},'children':[_0x265121,{'tag':'div','attributes':{'class':['ck-ai_review__check-run-results-header-buttons']},'children':[this['_cancelButtonView'],this['_acceptAllButtonView'],this['_exitReviewButtonView'],this['_toggleDiffButtonView'],this['_finishReviewButtonView']]}]}),_0x49eb4f;}['_createTitleView'](){const _0xc048a4=new vt(this['locale']),_0x16cebd=new vn();return _0x16cebd['bind']('isVisible')['to'](this,'isResultReady',_0x232f8d=>!_0x232f8d),_0xc048a4['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-run-results-header-title-wrapper']},'children':[_0x16cebd,{'tag':'div','attributes':{'class':['ck-ai_review__check-run-results-header-title-content',this['bindTemplate']['if']('isCompleted','ck-hidden',_0x55c834=>_0x55c834)]},'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',_0x2223ee=>!_0x2223ee)]},'children':[{'text':us(this['locale'],'AI_REVIEW_MODE_FINISH_REVIEW_HEADER_TITLE')}]}]}),_0xc048a4;}['_createFinishReviewButtonView'](){const _0x30d174=new uo(us(this['locale'],'AI_REVIEW_MODE_FINISH_REVIEW_BUTTON_LABEL'),this['locale']);return _0x30d174['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isCompleted','ck-hidden',_0x437c63=>!_0x437c63)]}}),_0x30d174['delegate']('finishReview')['to'](this),_0x30d174;}}class Ao extends Ht{['_resultsHeader'];['_finishReviewButtonView'];constructor(_0x1cf681,_0xf18e70){super(_0x1cf681),this['_finishReviewButtonView']=this['_createFinishReviewButtonView'](_0xf18e70['buttonText']),this['_resultsHeader']=this['_createResultHeaderView'](_0xf18e70['headerText']);const _0x13c582=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__review-completed',_0x13c582['if']('isVisible','ck-hidden',_0x1b9dfe=>!_0x1b9dfe)]},'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':_0xf18e70['emptyResultsText']}]}]}]});}['_createFinishReviewButtonView'](_0x5b6c78){const _0x25c3e0=new uo(_0x5b6c78,this['locale']);return _0x25c3e0['delegate']('finishReview')['to'](this),_0x25c3e0;}['_createResultHeaderView'](_0x1c5b7a){const _0x1661d0=new vt(this['locale']);return _0x1661d0['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':_0x1c5b7a}]},{'tag':'div','attributes':{'class':['ck-ai_review__review-completed-header-buttons']},'children':[this['_finishReviewButtonView']]}]}),_0x1661d0;}}class go extends vt{['_dropdownView'];['_defaultValue'];['_defaultLabel'];constructor(_0x459d7e,_0x5d7333){super(_0x459d7e),this['_defaultValue']=_0x5d7333['default']||(_0x5d7333['data']['length']>0x0?_0x5d7333['data'][0x0]['id']:''),this['_defaultLabel']=_0x5d7333['data']['find'](_0x1f7666=>_0x1f7666['id']===this['_defaultValue'])?.['label']||'',this['set']('formValue',''),this['_dropdownView']=Gt(this['locale']);const _0x5e3b8f=this['_prepareListOptions'](_0x5d7333['data']);jt(this['_dropdownView'],_0x5e3b8f,{'role':'menu','ariaLabel':_0x5d7333['label']}),this['_dropdownView']['buttonView']['set']({'label':this['_defaultLabel'],'withText':!0x0}),this['_dropdownView']['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x4a3c29=>{_0x4a3c29['stopPropagation']();})}}),this['listenTo'](this['_dropdownView'],'execute',_0x565357=>{this['formValue']=_0x565357['source']['model']['id'],this['_dropdownView']['buttonView']['label']=_0x565357['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'](_0x499ed0=[]){const _0x5589a6=new _t();this['resetToDefault']();for(const _0x29b14f of _0x499ed0){const _0x45d9ea=new Jt({'label':_0x29b14f['label'],'withText':!0x0,'role':'menuitemradio','id':_0x29b14f['id'],'model':_0x29b14f});_0x45d9ea['bind']('isOn')['to'](this,'formValue',_0xff41a5=>_0xff41a5===_0x45d9ea['id']);const _0x28552a={'type':'button','model':_0x45d9ea};_0x5589a6['add'](_0x28552a);}return _0x5589a6;}}class Io extends Ht{['_formItem']=null;constructor(_0x51acfc,_0xd5935e,_0x45f7e5){super(_0x51acfc),this['argsKey']=_0xd5935e?.['argsKey'];if('dropdown'===_0xd5935e['formType'])this['_formItem']=new go(this['locale'],_0xd5935e);this['set']('value',''),this['bind']('value')['to'](this['_formItem'],'formValue');const _0x33a47b=new _0x1542dd(this['locale'],{'children':[this['_formItem']],'class':[_0x45f7e5?'ck-form__row_with-submit':'']});_0x45f7e5&&_0x33a47b['children']['add'](_0x45f7e5),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai_review__form-item','ck-reset_all']},'children':[_0x33a47b]});}['resetToDefault'](){this['_formItem']['resetToDefault']();}}class Eo extends _0x24ce98{['keystrokes'];static ['MIN_ROWS']=0x1;static ['MAX_ROWS']=0xc;constructor(_0xc8ad5f){super(_0xc8ad5f),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 _0x2ebc1e();['submitButtonView'];['cancelButtonView'];['promptInputView'];['actionsFooterView'];['_modelSelectionDropdown'];['_modelNameView'];['_modelSelectionDropdownItems'];['_check'];['_defaultValue'];['_defaultLabel'];constructor(_0x2f020c,_0x2a9c8b,_0x31386e=!0x1){super(_0x2f020c),this['_check']=_0x2a9c8b,this['set']('prompt',''),this['set']('modelId',''),this['set']('modelDisplayMode','selector'),this['set']('activeModelName',null),this['_defaultValue']=_0x2a9c8b['defaultModel']?_0x2a9c8b['defaultModel']['id']:'',this['_defaultLabel']=_0x2a9c8b['defaultModel']?_0x2a9c8b['defaultModel']['name']:'',this['submitButtonView']=this['_createSubmitButtonView'](),this['cancelButtonView']=this['_createCancelButtonView'](),(this['promptInputView']=new te(this['locale'],()=>new Eo(_0x2f020c)),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'](_0x31386e),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 _0x1542dd(this['locale'],{'children':[this['promptInputView']]}),new _0x1542dd(this['locale'],{'children':[this['actionsFooterView']]})]}),this['promptInputView']['fieldView']['keystrokes']['set']('Enter',(_0x548dd8,_0x1c3447)=>{this['_isValid']()?(this['fire']('runReviewCheck',{'id':'custom','args':{'prompt':this['prompt'],'model':this['modelId']},'isCustom':!0x0}),_0x1c3447()):_0x1c3447();}),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'](_0x2170dc=>{this['_focusables']['add'](_0x2170dc),this['focusTracker']['add'](_0x2170dc['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 _0x48cfaf of this['_getFormValidators']()){const _0x30cecc=_0x48cfaf();if(_0x30cecc)return this['promptInputView']['errorText']=_0x30cecc,!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 _0x4a40ae=new Nt(this['locale']),t=this['locale']['t'];return _0x4a40ae['set']({'label':t('Submit'),'withText':!0x0,'class':ds}),_0x4a40ae['on']('execute',()=>{this['_isValid']()&&this['fire']('runReviewCheck',{'id':'custom','args':{'prompt':this['prompt'],'model':this['modelId']},'isCustom':!0x0});}),_0x4a40ae;}['_createCancelButtonView'](){const _0xc4d874=new Nt(this['locale']),t=this['locale']['t'];return _0xc4d874['set']({'label':t('Cancel'),'withText':!0x0,'class':As}),_0xc4d874['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x405310=>{_0x405310['stopPropagation']();})}}),_0xc4d874['on']('execute',()=>{this['resetToDefault'](),this['fire']('closeCustomCheck');}),_0xc4d874;}['_setModelList'](_0x1c2cb8){this['_modelSelectionDropdownItems']['clear']();const _0x123421=this['_check']['models'];if(_0x1c2cb8)this['set']('modelDisplayMode','hidden');else{const _0x132356=0x1===_0x123421['length'];this['set']('modelDisplayMode',_0x132356?'name':'selector');}if(this['resetToDefault'](),_0x123421?.['length']){0x1===_0x123421['length']&&this['set']('activeModelName',_0x123421[0x0]['name']||_0x123421[0x0]['id']);for(const _0x41ff34 of _0x123421){const _0x561150=new Jt({'label':_0x41ff34['name'],'withText':!0x0,'role':'menuitemradio','id':_0x41ff34['id'],'model':_0x41ff34});_0x561150['bind']('isOn')['to'](this,'modelId',_0x1491ac=>_0x1491ac===_0x41ff34['id']),this['_modelSelectionDropdownItems']['add']({'type':'button','model':_0x561150,'labelView':new mo(this['locale'],_0x41ff34)});}}}['_createModelSelectionDropdown'](){const _0x2147ea=Gt(this['locale']);return _0x2147ea['set']({'panelPosition':'se','class':'ck-ai_review__check-list-item-model-dropdown'}),_0x2147ea['buttonView']['set']({'label':this['_defaultLabel'],'withText':!0x0,'tooltip':!0x0,'class':As}),_0x2147ea['buttonView']['bind']('isVisible')['to'](this,'modelDisplayMode',_0x2d173b=>'selector'===_0x2d173b),this['listenTo'](_0x2147ea,'execute',_0x25309f=>{this['modelId']=_0x25309f['source']['model']['id'],_0x2147ea['buttonView']['label']=_0x25309f['source']['label'];}),_0x2147ea;}['_createModelNameView'](){const _0x5de4fc=new To(this['locale']);return _0x5de4fc['bind']('text')['to'](this,'activeModelName',_0x10956a=>_0x10956a??''),_0x5de4fc['bind']('isVisible')['to'](this,'modelDisplayMode',_0x2da6ac=>'name'===_0x2da6ac),_0x5de4fc;}['_createActionsFooterView'](){const _0x1d490f=new vt(this['locale']);return _0x1d490f['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']]}]}),_0x1d490f;}}class To extends vt{constructor(_0x54c6f0){super(_0x54c6f0),this['set']('text',void 0x0),this['set']('isVisible',!0x0);const _0x12471b=this['bindTemplate'];this['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai_review__check-list-item-model-name',_0x12471b['if']('isVisible','ck-hidden',_0xfb7211=>!_0xfb7211)]},'children':[{'text':_0x12471b['to']('text')}]});}}class mo extends Mt{constructor(_0x442735,_0x3cb3f5){super();const _0x4276ad=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-button__label'],'style':_0x4276ad['to']('style'),'id':_0x4276ad['to']('id')},'children':[{'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-model-dropdown-name']},'children':[{'tag':'span','children':[{'text':_0x4276ad['to']('text')}]}]},{'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-model-dropdown-description']},'children':[{'tag':'span','children':[_0x3cb3f5['description']||'']}]}]});}}class Co extends Ht{['_formItemsCollection']=new _0x2ebc1e();['_customCheckView']=null;['_hideModels']=!0x1;constructor(_0x2374d8,_0x39c50b,_0x27c8be,_0x1e6c82=!0x1){super(_0x2374d8),this['_hideModels']=_0x1e6c82,this['set']('isParametrizedViewOpen',!0x1),this['set']('isListItemRendered',!0x1),this['set']('isItemParametrized',_0x39c50b['isParameterized']);const _0x351b44=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',_0x1d1d98=>_0x1d1d98),this['bindTemplate']['if']('isListItemRendered','ck-ai_review__check-list-item_rendered',_0x34e93e=>_0x34e93e)],'style':{'--ck-ai-review-check-list-item-index':_0x27c8be}},'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':_0x39c50b['title']}]},_0x351b44]},{'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-description']},'children':_0x39c50b['description']?[{'text':_0x39c50b['description']}]:[]}]}]},..._0x39c50b['isParameterized']?[this['_createParameterizedView'](_0x39c50b)]:[],...'custom'===_0x39c50b['id']?[this['_createCustomView'](_0x39c50b,this['_hideModels'])]:[]]}),this['on']('click',()=>{_0x39c50b['isParameterized']?this['isParametrizedViewOpen']=!0x0:this['fire']('runReviewCheck',{'id':_0x39c50b['id'],'args':_0x39c50b['useArgs']?_0x39c50b['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'](_0x444a34=>{_0x444a34['resetToDefault']();}),this['_customCheckView']&&this['_customCheckView']['resetToDefault']();}['_createIconView'](){const _0x4c71f6=new xt();return _0x4c71f6['content']=at,_0x4c71f6['extendTemplate']({'attributes':{'class':['ck-ai_review__check-list-item-title-icon']}}),_0x4c71f6;}['_createParameterizedView'](_0x13f523){const _0x3607ca=new vt(),_0x35d7b7=this['_createFormView'](_0x13f523);return _0x3607ca['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-parameterized',this['bindTemplate']['if']('isParametrizedViewOpen','ck-hidden',_0x2e82cb=>!_0x2e82cb)]},'children':[_0x35d7b7]}),_0x3607ca;}['_createFormView'](_0x174717){const _0x5e90e3=new vt(),_0x57c711=Array['isArray'](_0x174717['options'])?_0x174717['options']:[],_0x17e226=new Nt(this['locale']),t=this['locale']['t'];_0x17e226['set']({'label':t('Submit'),'withText':!0x0,'class':ds}),_0x17e226['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x2d6300=>{_0x2d6300['stopPropagation']();})}}),_0x17e226['on']('execute',()=>{const _0x3505bc=[],_0x2242fd={};this['_formItemsCollection']['forEach'](_0x23514a=>{_0x3505bc['push'](_0x23514a['value']),_0x174717['useArgs']&&_0x174717['options']&&(_0x2242fd[_0x23514a['argsKey']]=_0x23514a['value']);}),this['fire']('runReviewCheck',{'id':_0x174717['id'],'params':_0x3505bc['length']?_0x3505bc:void 0x0,'args':Object['keys'](_0x2242fd)['length']?_0x2242fd:void 0x0});});const _0x4ba3f6=_0x57c711['length'];return _0x57c711['forEach']((_0x3c6733,_0x501bde)=>{const _0x4e797a=_0x501bde===_0x4ba3f6-0x1;this['_formItemsCollection']['add'](new Io(this['locale'],_0x3c6733,_0x4e797a?_0x17e226:null));}),_0x5e90e3['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-parameterized-form']},'children':this['_formItemsCollection']}),_0x5e90e3;}['_createCustomView'](_0x416548,_0x3c3088=!0x1){return this['_customCheckView']=new po(this['locale'],_0x416548,_0x3c3088),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',_0x186e0b=>!_0x186e0b)]}}),this['_customCheckView']['delegate']('runReviewCheck')['to'](this),this['listenTo'](this['_customCheckView'],'closeCustomCheck',()=>{this['isParametrizedViewOpen']=!0x1;}),this['on']('change:isParametrizedViewOpen',(_0x5467b5,_0x5c1b9,_0x1ece0c)=>{_0x1ece0c||this['_customCheckView']['resetFormValidationStatus']();}),this['_customCheckView'];}}class wo extends Ht{['_checkViews'];constructor(_0x4896c0){super(_0x4896c0),this['_checkViews']=new _0x2ebc1e(),this['_setupTemplate']();}['setChecks'](_0x529adb,_0x5cea5a=!0x1){this['_checkViews']['clear']();for(const [_0x24a3bf,_0x282b2b]of _0x529adb['entries']()){const _0x292d4e=new Co(this['locale'],_0x282b2b,_0x24a3bf,_0x5cea5a);_0x292d4e['delegate']('runReviewCheck')['to'](this),this['_checkViews']['add'](_0x292d4e);}}['hasChecks'](){return this['_checkViews']['length']>0x0;}['resetAllParameterizedChecks'](){for(const _0x25e109 of this['_checkViews'])_0x25e109 instanceof Co&&_0x25e109['resetToDefault']();}['_setupTemplate'](){const _0x16199c=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-list',_0x16199c['if']('isVisible','ck-hidden',_0xb580b3=>!_0xb580b3)]},'children':this['_checkViews']});}}class fo extends ho{static get['pluginName'](){return'AIReviewModeUI';}['createMainView'](){const _0x396cf9=this['context']['locale'],_0x5efa94=new _0x4c7c2c(_0x396cf9,{'label':us(_0x396cf9,'AI_REVIEW_MODE'),'icon':_0x373b59,'class':'ck-ai-header\x20ck-ai-header_review'});return new lo(this['context']['locale'],{'header':_0x5efa94,'list':new wo(_0x396cf9),'results':new _o(_0x396cf9,{'generalErrorText':us(_0x396cf9,'AI_REVIEW_MODE_GENERAL_ERROR_MESSAGE')}),'completed':new Ao(_0x396cf9,{'headerText':us(_0x396cf9,'AI_REVIEW_MODE_FINISH_REVIEW_HEADER_TITLE'),'emptyResultsText':us(_0x396cf9,'AI_REVIEW_MODE_EMPTY_RESULTS_TEXT'),'buttonText':us(_0x396cf9,'AI_REVIEW_MODE_FINISH_REVIEW_BUTTON_LABEL')})});}['registerTab'](){const _0x537af6=this['context']['plugins']['get']('AITabs');_0x537af6['view']['on']('activateTab',(_0x4fc924,_0x5b4587)=>{'reviewMode'===_0x5b4587?this['fire']('getReviewCheckList'):this['fire']('leaveReview');}),_0x537af6['view']['addTab']({'id':'reviewMode','buttonLabel':us(this['context']['locale'],'AI_REVIEW_MODE'),'buttonIcon':_0x373b59,'order':0x0,'content':this['_mainView']});}}const So='review-';class bo extends _0x20e290{static get['requires'](){return[_0x46bc33,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(_0x46cbef){super(_0x46cbef),this['_domEmitter']=new(Ot())(),this['_eventEmitter']=new(pt())();}get['emitter'](){return this['_eventEmitter'];}['afterInit'](){const _0x2959e2=Xs(this['context']);_0x2959e2['conversion']['for']('editingDowncast')['markerToElement']({'model':So+'insert','view':(_0x2797a9,{writer:_0x3ccd5c})=>{const _0x25a4a5=this['_markers']['get'](_0x2797a9['markerName']),_0x24c51c={'class':'ck-ai_review-marker_add'+(this['_activeMarkers']['has'](_0x25a4a5?.['id']||'')?'\x20ck-ai_review__change_active':''),'data-marker-id':_0x2797a9['markerName']};return _0x3ccd5c['createUIElement']('span',_0x24c51c,function(_0x1f118b){const _0x1588b3=this['toDomElement'](_0x1f118b);return _0x1588b3['innerHTML']=_0x25a4a5?.['content']?.['asString']||'',_0x1588b3;});}}),_0x2959e2['conversion']['for']('editingDowncast')['markerToHighlight']({'model':So+'remove-only','view':_0x32865a=>{const _0x4b73e3=this['_markers']['get'](_0x32865a['markerName']),_0x4c4fa8=['ck-ai_review-marker_strikethrough'];return this['_activeMarkers']['has'](_0x4b73e3?.['id']||'')&&_0x4c4fa8['push']('ck-ai_review__change_active'),{'classes':_0x4c4fa8,'attributes':{'data-marker-id':_0x32865a['markerName']}};}}),_0x2959e2['conversion']['for']('editingDowncast')['markerToHighlight']({'model':So+'remove-context','view':_0x5c31c3=>{const _0x4bb9f3=this['_markers']['get'](_0x5c31c3['markerName']),_0x4d11f3=['ck-ai_review-marker_underline'];return this['_activeMarkers']['has'](_0x4bb9f3?.['id']||'')&&_0x4d11f3['push']('ck-ai_review__change_active'),{'classes':_0x4d11f3,'attributes':{'data-marker-id':_0x5c31c3['markerName']}};}}),_0x2959e2['conversion']['for']('editingDowncast')['markerToHighlight']({'model':So+'remove-text','view':_0xea0535=>{const _0x24c914=this['_markers']['get'](_0xea0535['markerName']),_0x357329=['ck-ai_review-marker_hide'];return this['_activeMarkers']['has'](_0x24c914?.['id']||'')&&_0x357329['push']('ck-ai_review__change_active'),{'classes':_0x357329,'attributes':{'data-marker-id':_0xea0535['markerName']}};}}),_0x2959e2['conversion']['for']('dataDowncast')['markerToElement']({'model':So+'suggestion-context','view':(_0x3b045a,{writer:_0xd88acf})=>_0xd88acf['createRawElement']('span',{'class':'ck-ai_review-marker_context-'+(_0x3b045a['isOpening']?'start':'end')})}),_0x2959e2['conversion']['for']('downcast')['attributeToAttribute']({'model':_0x57a89f,'view':_0x567c05});const _0x3fe13e=_0x2959e2['ui']['getEditableElement']()||document['body'];this['_domEmitter']['listenTo'](_0x3fe13e,'mouseup',(_0x5a8f22,_0x5e6803)=>{const _0x45e2ba=_0x5e6803['target'],_0x4363a2=this['_findMarkerElement'](_0x45e2ba);if(!_0x4363a2)return;const _0x36b2ee=_0x4363a2['getAttribute']('data-marker-id'),_0x3dc89d=_0x36b2ee['split'](':')['pop']()?.['split']('_')[0x0];this['_eventEmitter']['fire']('changeMarkerClicked',{'markerId':_0x36b2ee,'changeId':_0x3dc89d,'markerElement':()=>this['_findMarkerElementById'](_0x36b2ee),'domEvent':_0x5e6803});},{'usePassive':!0x0,'priority':'highest'}),this['_domEmitter']['listenTo'](_0x3fe13e,'mouseover',(_0x458584,_0x1242fd)=>{const _0x16957e=_0x1242fd['target'],_0x373e6a=_0x1242fd['relatedTarget'];let _0x18bc08=this['_findMarkerElement'](_0x16957e);if(!_0x18bc08&&_0x373e6a&&(_0x18bc08=this['_findMarkerElement'](_0x373e6a)),!_0x18bc08)return;const _0x524ac7=_0x18bc08['getAttribute']('data-marker-id'),_0x291a6e=_0x524ac7['split'](':')['pop']()?.['split']('_')[0x0];this['_eventEmitter']['fire']('changeMarkerHovered',{'changeId':_0x291a6e,'markerElement':()=>this['_findMarkerElementById'](_0x524ac7),'domEvent':_0x1242fd});}),this['_domEmitter']['listenTo'](document,'mouseover',_0x39a6a1((_0x45c178,_0x21c3b0)=>{const _0x1fdd0c=_0x21c3b0['target'];if(this['_findMarkerElement'](_0x1fdd0c))return;_0x1fdd0c['closest']('.ck-reset.ck-ai_review-balloon-panel-suggestion')||this['_eventEmitter']['fire']('changeMarkerBlurred');},0xc8)),_0x2959e2['model']['document']['registerPostFixer'](_0x3ab674=>this['_validateMarkers'](_0x2959e2,_0x3ab674)),_0x2959e2['model']['document']['on']('change',()=>this['_handleMarkerChanges'](_0x2959e2));}['getDocumentData'](){const _0x1e6fe9=this['context']['plugins']['get']('AIEditing'),_0x3d97df=Xs(this['context']),_0x1b54d3=_0x3d97df['model'],_0x23f4ab=new _0x2b97ae();for(const _0x2ab14b of _0x1b54d3['document']['getRoot']()['getChildren']()){const _0x9a2e5c=_0x2ab14b['_clone'](!0x0);_0x23f4ab['_appendChild'](_0x9a2e5c);}for(const _0x2593c4 of _0x1b54d3['markers'])_0x23f4ab['markers']['set'](_0x2593c4['name'],this['_changeRangeOwnerDocument'](_0x2593c4['getRange']()['clone'](),_0x23f4ab));const _0x3af67a=new _0x227fe4({'ignoreElementEnd':!0x0,'startPosition':_0x1b54d3['createPositionAt'](_0x23f4ab,0x0)}),_0x2ef2b4=new Set(),_0x3b1b10=new Map();for(const {item:_0xf79aba}of _0x3af67a){if(!_0xf79aba['is']('$textProxy'))continue;const _0x19d8d4=_0xf79aba['parent'];if(_0x19d8d4&&_0x19d8d4['is']('element')){const _0x3aa089=this['_upsertDataId'](_0x19d8d4,()=>_0x1e6fe9['_nextDataId'](_0x2ef2b4));_0x2ef2b4['add'](_0x3aa089);for(const _0x431d68 of _0x19d8d4['getChildren']())_0x431d68['is']('element')&&_0x2ef2b4['add'](this['_upsertDataId'](_0x431d68,()=>_0x1e6fe9['_nextDataId'](_0x2ef2b4)));let _0x48ed7f=_0x19d8d4;for(;_0x48ed7f['parent']&&!_0x48ed7f['parent']['is']('documentFragment');)_0x48ed7f=_0x48ed7f['parent'],_0x48ed7f['hasAttribute'](_0x57a89f)&&_0x48ed7f['_removeAttribute'](_0x57a89f);_0x3b1b10['set'](_0x3aa089,{'path':_0x19d8d4['getPath'](),'getContent':this['_createGetContentUsingDataIdFn'](_0x48ed7f['_clone'](!0x0),_0x3aa089,_0x3d97df['data'])}),_0x3af67a['jumpTo'](_0x1b54d3['createPositionAfter'](_0x19d8d4));}}return{'content':_0x3d97df['data']['processor']['toData'](_0x3d97df['data']['toView'](_0x23f4ab)),'version':_0x3d97df['model']['document']['version'],'elements':_0x3b1b10};}['diffContent'](_0x57a950,_0x3b7398,_0x3a6a91=!0x1){const _0x452a4c=[],_0xc2d11c=Xs(this['context']),_0x5e1336=_0xc2d11c['data']['parse'](_0x3b7398,'$documentFragment'),_0x301ccd=_0xc2d11c['data']['parse'](_0x57a950,'$documentFragment'),_0x4409b7=_0xc2d11c['model']['createPositionAt'](_0x301ccd,0x0);if(this['_haveSingleTopLevelElement'](_0x5e1336)){if(!this['_hasSameTopLevelElement'](_0x301ccd,_0x5e1336))return _0x452a4c;}else{const _0xb3c8cc=_0xc2d11c['model']['schema'];if(!this['_haveOnlyInlineContent'](_0x301ccd,_0xb3c8cc)||!this['_haveOnlyInlineContent'](_0x5e1336,_0xb3c8cc))return _0x452a4c;}const _0x41e012=this['context']['plugins']['get']('DocumentCompare')['getDiff'](_0x57a950,_0x3b7398,{'anchor':_0x4409b7,'markDeletions':!0x0})['getOperations']()['filter'](_0x570f91=>'insert'===_0x570f91['type']||'marker'===_0x570f91['type']&&_0x570f91['name']['startsWith']('$markedRemove')),_0x2768e8=this['_groupAdjacentOperations'](_0x41e012),_0x5361d3=[];if(_0x3a6a91){if(_0x2768e8['length']){const _0x2a779=_0x2768e8[0x0]['operations'][0x0],_0x5536c7='insert'===_0x2a779['type']?_0x2a779['position']:_0x2a779['newRange']['start'],_0x3f5cc1=this['_getPositionLimitingRange'](_0x5536c7,_0xc2d11c,'inside'),_0x32ef54=_0x3f5cc1?_0x5e1336['getChild'](0x0)['getChildren']():_0x5e1336['getChildren'](),_0x2c3b60=_0x3f5cc1||_0xc2d11c['model']['createRangeIn'](_0x301ccd),_0x2fca66=[new _0x1a3635('$markedRemove:synthetic'+ot(),null,_0x2c3b60,_0xc2d11c['model']['document']['model']['markers'],!0x0,_0xc2d11c['model']['document']['version']+0x1),new _0x1c2b0b(_0x2c3b60['end'],_0x32ef54,_0xc2d11c['model']['document']['version']+0x2)];_0x5361d3['push']({'operations':_0x2fca66,'operationsIsolated':_0x2fca66,'groupOffset':0x0});}}else _0x5361d3['push'](..._0x2768e8);let _0xb4ecc6=0x0;return _0xc2d11c['model']['change'](_0x1f9667=>{for(let _0x4a3348=0x0;_0x4a3348<_0x5361d3['length'];_0x4a3348++){const _0x568a81=_0x5361d3[_0x4a3348],_0x3dd192=_0x1f9667['createDocumentFragment']();for(const _0x4c5d45 of _0x301ccd['getChildren']())_0x1f9667['append'](_0x4c5d45['_clone'](!0x0),_0x3dd192);for(const _0x465482 of _0x568a81['operationsIsolated'])if('insert'===_0x465482['type']){const _0x37754c=_0x465482;_0x37754c['baseVersion']=null,_0x37754c['isDocumentOperation']=!0x1,this['_changeOperationOwnerDocument'](_0x37754c,_0x3dd192),_0x1f9667['batch']['addOperation'](_0x465482),_0xc2d11c['model']['applyOperation'](_0x465482);const _0x2f3857='suggestion:insertion:id:authorId:'+_0xb4ecc6++,_0x61cc1f=_0xc2d11c['model']['createRange'](_0x37754c['position'],_0x37754c['position']['getShiftedBy'](_0x37754c['howMany']));_0x3dd192['markers']['set'](_0x2f3857,_0x61cc1f);}else{if('marker'===_0x465482['type']&&_0x465482['name']['startsWith']('$markedRemove')){const _0x5882e8=_0x465482,_0x2c8cdd='suggestion:deletion:id:authorId:'+_0xb4ecc6++;this['_changeOperationOwnerDocument'](_0x5882e8,_0x3dd192),_0x3dd192['markers']['set'](_0x2c8cdd,_0x5882e8['newRange']);}}if(_0x3a6a91)_0x452a4c['push']({..._0x568a81,'context':this['_createGetContentFn'](_0x301ccd,_0xc2d11c['data']),'content':this['_createGetContentFn'](_0x301ccd,_0xc2d11c['data'])});else{const _0xc68731=this['_getChangeContext'](this['_changePositionOwnerDocument'](this['_getOperationStart'](_0x568a81['operationsIsolated'][0x0]),_0x3dd192),this['_changePositionOwnerDocument'](this['_getOperationEnd'](_0x568a81['operationsIsolated'][_0x568a81['operationsIsolated']['length']-0x1]),_0x3dd192));_0x3dd192['markers']['set'](So+'suggestion-context',new _0x1857bd(_0xc68731['start'],_0xc68731['end'])),_0x452a4c['push']({..._0x568a81,'context':this['_createGetContextFn'](_0x3dd192,_0xc2d11c['data'],{'ellipsisBefore':_0xc68731['hasContentBefore'],'ellipsisAfter':_0xc68731['hasContentAfter']}),'content':this['_createGetContentFn'](_0x3dd192,_0xc2d11c['data'])});}}}),_0x452a4c;}['markChangePositionInEditorContent'](_0x38f348,_0x97721f){if(!_0x38f348['length'])return;const _0x554263=_0x38f348[0x0]['parent']['id'],_0x1bb4b4=_0x97721f['elements']['get'](_0x554263);if(!_0x1bb4b4)return void console['warn']('No\x20element\x20found\x20for\x20ID:\x20'+_0x554263);const _0xc035a0=_0x1bb4b4['path'],_0x2d7828=Xs(this['context']),_0x4c8a88=_0x2d7828['model']['document']['history']['getOperations'](_0x97721f['version']),_0x195c18=[];for(const _0x262044 of _0x38f348){const _0x185b29=_0x262044['operationsIsolated']['map'](_0x48add8=>this['_translateOperationToEditorContent'](_0x48add8,_0xc035a0,_0x2d7828['model']['document']['getRoots']()[0x0]));if(!_0x185b29||!_0x185b29['length'])continue;const _0x1587c5=_0x185b29['every'](_0x3e0ed1=>'marker'===_0x3e0ed1['type']&&_0x3e0ed1['name']['startsWith']('$markedRemove')),_0x4ec203={'document':_0x2d7828['model']['document'],'useRelations':!0x1,'padWithNoOps':!0x1},_0x4122b8=_0x1225df(_0x185b29,_0x4c8a88,_0x4ec203)['operationsA'];for(const _0x52983e of _0x4122b8)if('insert'===_0x52983e['type']){const _0x10a380=_0x52983e,_0xa77b2b=_0x10a380['nodes'];_0x2d7828['model']['change'](_0x3a3eac=>{const _0x3f7d18=_0x3a3eac['createDocumentFragment']();for(const _0x3b1b7f of _0xa77b2b)_0x3a3eac['append'](_0x3b1b7f['_clone'](!0x0),_0x3f7d18);_0x195c18['push']({'start':_0x10a380['position'],'end':_0x10a380['position'],'type':'insert','groupId':_0x262044['id'],'content':{'asString':this['_createGetContentFn'](_0x3f7d18,_0x2d7828['data'])(),'asFragment':_0x3f7d18}});});}else{if('marker'===_0x52983e['type']&&_0x52983e['name']['startsWith']('$markedRemove')){const _0x189832=_0x52983e;let _0x42d204='remove-text';if(_0x1587c5){const _0xb3a856=this['_findAdjacentContextDistance'](_0x189832['newRange']['start'],'backward',_0x2d7828['model']['schema']),_0x56b9c3=this['_findAdjacentContextDistance'](_0x189832['newRange']['end'],'forward',_0x2d7828['model']['schema']);if(_0xb3a856||_0x56b9c3){const _0x2e033a=_0x189832['newRange']['start']['getShiftedBy'](-_0xb3a856),_0x5281da=_0x189832['newRange']['end']['getShiftedBy'](_0x56b9c3);_0x195c18['push']({'start':_0x2e033a,'end':_0x5281da,'groupId':_0x262044['id'],'type':'remove-context'});}else _0x42d204='remove-only';}_0x195c18['push']({'start':_0x189832['newRange']['start'],'end':_0x189832['newRange']['end'],'groupId':_0x262044['id'],'type':_0x42d204});}}}this['_insertMarkers'](_0x195c18);}['clearAllMarkers'](){const _0x345597=Xs(this['context']);_0x345597['model']['change'](_0x3f9468=>{for(const _0x5e8069 of this['_markers']['keys']())_0x345597['model']['markers']['get'](_0x5e8069)&&_0x3f9468['removeMarker'](_0x5e8069);}),this['_markers']['clear'](),this['_activeMarkers']['clear']();}['switchToReadOnly'](){Xs(this['context'])['enableReadOnlyMode']('ai-review');}['switchToEdit'](){Xs(this['context'])['disableReadOnlyMode']('ai-review');}['applyChange'](_0x5ca36d){const _0x209334=Xs(this['context']),_0x54e1ee=_0x209334['model'],_0x27ce21=_0x5ca36d['map'](_0x519670=>this['_getMarkersDataForGroup'](_0x519670))['flat']();_0x54e1ee['change'](_0x302846=>{for(const _0x3bffc3 of _0x27ce21){const _0x43822a=_0x209334['model']['markers']['get'](_0x3bffc3['id']);if(_0x43822a){if('insert'===_0x3bffc3['type']){if(!_0x3bffc3['content'])continue;_0x54e1ee['insertContent'](_0x3bffc3['content']['asFragment']||null,_0x43822a['getRange']()['start']);}else'remove-text'!==_0x3bffc3['type']&&'remove-only'!==_0x3bffc3['type']||_0x54e1ee['deleteContent'](_0x54e1ee['createSelection'](_0x43822a['getRange']()));_0x302846['removeMarker'](_0x3bffc3['id']),this['_markers']['delete'](_0x3bffc3['id']);}}});}['rejectChange'](_0x306aab){const _0x3e6957=Xs(this['context']),_0x541568=this['_getMarkersDataForGroup'](_0x306aab);_0x3e6957['model']['change'](_0x2c013a=>{for(const _0x5c9051 of _0x541568)_0x2c013a['removeMarker'](_0x5c9051['id']),this['_markers']['delete'](_0x5c9051['id']);});}['getEditor'](){return Xs(this['context']);}['getMarkerElementForChange'](_0x1a9d0c){const _0x3387fc=Array['from'](this['_markers']['values']())['filter'](_0x268a8c=>_0x268a8c['groupId']===_0x1a9d0c);if(!_0x3387fc['length'])return null;const _0x461dc6=0x1===_0x3387fc['length']?_0x3387fc[0x0]:this['_sortMarkers'](_0x3387fc)[0x0],_0x5ef71c=Xs(this['context'])['model']['markers']['get'](_0x461dc6['id']);if(!_0x5ef71c)return null;return{'modelRange':_0x5ef71c['getRange'](),'getElement':()=>this['_findMarkerElementById'](_0x461dc6['id'])};}['getContentElementForChange'](_0x1429f9){const _0x22450a=Array['from'](this['_markers']['values']())['filter'](_0x4dffea=>_0x4dffea['groupId']===_0x1429f9);if(!_0x22450a['length'])return null;const _0x312f77=0x1===_0x22450a['length']?_0x22450a[0x0]:this['_sortMarkers'](_0x22450a)[0x0],_0x5252e0=Xs(this['context']),_0x57a390=_0x5252e0['model']['markers']['get'](_0x312f77['id']);if(!_0x57a390)return null;const _0x357354=_0x57a390['getRange'](),_0x1c3962=_0x5252e0['editing']['view']['getDomRoot']();if(!_0x1c3962||!_0x357354)return null;let _0x54e4a2=_0x357354['start']['parent'];for(;_0x54e4a2['parent']&&'$root'!==_0x54e4a2['parent']['name'];)_0x54e4a2=_0x54e4a2['parent'];if(!_0x54e4a2||!_0x54e4a2['name'])return null;const _0x22c088=_0x1c3962['querySelector']('[data-marker-id=\x22'+_0x312f77['id']+'\x22]');if(!_0x22c088)return null;let _0x4f19cd=null;_0x5252e0['model']['change'](_0x57b7a8=>{_0x4f19cd=_0x57b7a8['createDocumentFragment'](),_0x57b7a8['append'](_0x54e4a2['_clone'](!0x0),_0x4f19cd);});const _0x5e5750=_0x5252e0['data']['toView'](_0x4f19cd)['getChild'](0x0);return _0x22c088['closest'](_0x5e5750['name']);}['reactivateMarkers'](_0x1b3390){const _0x43322e=this['_getMarkersDataForGroup'](_0x1b3390);if(!_0x43322e['length'])return;const _0x3a313d=Array['from'](this['_activeMarkers'])['sort'](),_0x263801=Array['from'](new Set(_0x43322e['map'](_0x56fc0f=>_0x56fc0f['id'])))['sort']();_0x3a313d['join']('|')!==_0x263801['join']('|')&&(this['setAllMarkersAsInactive'](),this['setMarkersInElementAsActive'](_0x1b3390));}['setMarkersInElementAsActive'](_0x3b6479){const _0x1362d0=this['_getMarkersDataForGroup'](_0x3b6479);if(!_0x1362d0['length'])return;const _0x11a9fe=Xs(this['context']),_0x35bfbe=new Set(_0x1362d0['map'](_0xe4796b=>_0xe4796b['id'])),_0x5df90e=Array['from'](_0x35bfbe['values']())['map'](_0x13766a=>_0x11a9fe['model']['markers']['get'](_0x13766a))['filter'](_0x29eff8=>!!_0x29eff8);_0x35bfbe['forEach'](_0x2a1153=>{this['_activeMarkers']['add'](_0x2a1153);}),_0x11a9fe['model']['change'](()=>{_0x5df90e['forEach'](_0x5a2a74=>{_0x11a9fe['editing']['reconvertMarker'](_0x5a2a74);});});}['setAllMarkersAsInactive'](){const _0x407224=Array['from'](this['_activeMarkers']);if(!_0x407224['length'])return;this['_activeMarkers']['clear']();const _0x558f13=Xs(this['context']),_0x46367e=_0x407224['map'](_0x3a0269=>_0x558f13['model']['markers']['get'](_0x3a0269))['filter'](_0x44e0c4=>!!_0x44e0c4);_0x558f13['model']['change'](()=>{_0x46367e['forEach'](_0x36b7e9=>{_0x558f13['editing']['reconvertMarker'](_0x36b7e9);});});}['_getPositionLimitingRange'](_0x22dc12,_0x6d9a2e,_0x584f5d='outside'){if(!_0x22dc12)return null;let _0x43bbaf=_0x22dc12['parent'];for(;_0x43bbaf&&_0x43bbaf['parent']&&'$root'!==_0x43bbaf['parent']['name']&&!_0x6d9a2e['model']['schema']['isLimit'](_0x43bbaf)&&!_0x6d9a2e['model']['schema']['isBlock'](_0x43bbaf);)_0x43bbaf=_0x43bbaf['parent'];if(!_0x43bbaf||!_0x43bbaf['name']||'$root'===_0x43bbaf['name'])return null;let _0xbff37e=null;return _0x6d9a2e['model']['change'](_0x27b59d=>{_0xbff37e='inside'===_0x584f5d?_0x27b59d['createRangeIn'](_0x43bbaf):_0x27b59d['createRangeOn'](_0x43bbaf);}),_0xbff37e;}['_validateMarkers'](_0x1dbad0,_0x538918){const _0x32aab7=Array['from'](this['_markers']['keys']()),_0x1971cf=new Map();for(const _0x499ee0 of _0x32aab7){const _0x14632b=_0x1dbad0['model']['markers']['get'](_0x499ee0);if(!_0x14632b)continue;const _0x4dacdb=_0x14632b['getStart']()['path'][0x0];_0x1971cf['has'](_0x4dacdb)||_0x1971cf['set'](_0x4dacdb,[]),_0x1971cf['get'](_0x4dacdb)['push'](_0x14632b);}const _0x458eea=new Set();for(const _0x2d68e1 of _0x1dbad0['model']['document']['differ']['getChanges']()){let _0x2864ca=-0x1,_0x1c147d=null;if('insert'===_0x2d68e1['type'])_0x1c147d=new _0x1857bd(_0x2d68e1['position'],_0x2d68e1['position']['getShiftedBy'](_0x2d68e1['length'])),_0x2864ca=_0x2d68e1['position']['path'][0x0];else{if('remove'!==_0x2d68e1['type'])continue;_0x1c147d=new _0x1857bd(_0x2d68e1['position']),_0x2864ca=_0x2d68e1['position']['path'][0x0];}const _0x1e19de=_0x1971cf['get'](_0x2864ca)||[];if(_0x1e19de['length']){for(const _0x4850c4 of _0x1e19de)if(_0x1c147d['root']['rootName']===_0x4850c4['getRange']()['root']['rootName']&&('insert'!==_0x2d68e1['type']||!_0x1c147d['containsRange'](_0x4850c4['getRange']()))&&(_0x1c147d['isIntersecting'](_0x4850c4['getRange']())||_0x1c147d['start']['isTouching'](_0x4850c4['getRange']()['end'])||_0x1c147d['end']['isTouching'](_0x4850c4['getRange']()['start']))){const _0x1a610c=this['_parseMarkerName'](_0x4850c4['name']);Array['from'](this['_markers']['values']())['filter'](_0x88596b=>_0x88596b['groupId']===_0x1a610c['groupId'])['forEach'](_0x29e4c7=>_0x458eea['add'](_0x29e4c7['id']));}}}if(_0x458eea['size']){for(const _0x3f45ad of _0x458eea)_0x538918['removeMarker'](_0x3f45ad);return!0x0;}return!0x1;}['_handleMarkerChanges'](_0x10e23d){for(const {name:_0x2de437,data:_0x145b8b}of _0x10e23d['model']['document']['differ']['getChangedMarkers']()){if(!_0x2de437['startsWith'](So))continue;const _0x1f3364=_0x145b8b['oldRange'],_0x4e5ad2=_0x145b8b['newRange'],_0x77cb9e=_0x1f3364&&'$graveyard'===_0x1f3364['root']['rootName'],_0x4f2b48=_0x4e5ad2&&'$graveyard'===_0x4e5ad2['root']['rootName'];if(_0x77cb9e&&_0x4f2b48)continue;const _0x271075=this['_parseMarkerName'](_0x2de437);this['_markers']['get'](_0x2de437)&&(_0x4f2b48||!_0x4e5ad2?this['_eventEmitter']['fire']('changeMarkerRemoved',{'markerId':_0x2de437,'changeId':_0x271075['groupId']}):_0x77cb9e&&_0x4e5ad2&&this['_eventEmitter']['fire']('changeMarkerRestored',{'markerId':_0x2de437,'changeId':_0x271075['groupId']}));}}['_parseMarkerName'](_0x2578bf){const _0x1aa603=_0x2578bf['split'](':'),_0x895b9d=(_0x1aa603[0x1]||'')['split']('_');return{'prefix':_0x1aa603[0x0],'groupId':_0x895b9d[0x0],'suffix':_0x895b9d[0x1]};}['_translateOperationToEditorContent'](_0x4cc56d,_0x52b29e,_0x58675f){if('insert'===_0x4cc56d['type']){const _0x4e6498=_0x4cc56d;return new _0x1c2b0b(this['_changePosition'](_0x52b29e['concat'](_0x4e6498['position']['offset']),_0x58675f),_0x4e6498['nodes'],_0x4e6498['baseVersion']);}if('marker'===_0x4cc56d['type']&&_0x4cc56d['name']['startsWith']('$markedRemove')){const _0x3cb517=_0x4cc56d;return new _0x1a3635(_0x3cb517['name'],_0x3cb517['oldRange'],this['_changeRange'](_0x3cb517['newRange'],_0x52b29e['concat'](_0x3cb517['newRange']['start']['offset']),_0x52b29e['concat'](_0x3cb517['newRange']['end']['offset']),_0x58675f),_0x3cb517['_markers'],_0x3cb517['affectsData'],_0x3cb517['baseVersion']);}return _0x4cc56d;}['_groupAdjacentOperations'](_0x2eb739){if(!_0x2eb739['length'])return[];const _0x3f87b8=[];let _0x1f84a0=0x0,_0xc01f1=0x0,_0x5d16b1=[];for(let _0x203f27=0x0;_0x203f27<=_0x2eb739['length'];_0x203f27++){const _0xea6847=_0x2eb739[_0x203f27],_0x5db0b5=_0x2eb739[_0x203f27-0x1];!_0xea6847||_0x5db0b5&&!this['_getOperationEnd'](_0x5db0b5)['isTouching'](this['_getOperationStart'](_0xea6847))?(_0x3f87b8['push']({'operations':_0x5d16b1,'operationsIsolated':_0x5d16b1['map'](_0x204002=>this['_shiftOperation'](_0x204002['clone'](),-_0xc01f1)),'groupOffset':_0x1f84a0}),_0x5d16b1=_0xea6847?[_0xea6847]:[],_0xc01f1+=_0x1f84a0,_0x1f84a0=0x0):_0x5d16b1['push'](_0xea6847),_0xea6847&&'insert'===_0xea6847['type']&&(_0x1f84a0+=_0xea6847['howMany']);}return _0x3f87b8;}['_findAdjacentContextDistance'](_0x23d547,_0x404c66,_0x20f0c3,_0x20a400=0x1){const _0x272a1f=new _0x227fe4({'startPosition':_0x23d547,'direction':_0x404c66});let _0x22ff7a=0x0;for(let _0x3263b5=0x0;_0x3263b5<_0x20a400;_0x3263b5++){let _0x5544ac=0x0,_0x21d6d3=!0x1,_0x4e04b7='forward'===_0x404c66?/^\W*\w+/:/\w+\W*$/;for(const {item:_0x521a5e}of _0x272a1f)if(_0x521a5e['is']('$textProxy')){const _0x5e17c9=_0x4e04b7['exec'](_0x521a5e['data']);if(_0x5e17c9&&_0x5e17c9['length']){if(_0x5544ac+='forward'===_0x404c66?_0x5e17c9['index']+_0x5e17c9[0x0]['length']:_0x521a5e['data']['length']-_0x5e17c9['index'],_0x5e17c9[0x0]['length']!==_0x521a5e['data']['length'])break;_0x21d6d3=!0x0,_0x4e04b7='forward'===_0x404c66?/^\w+/:/\w+$/;}else{if(_0x21d6d3)break;_0x5544ac+=_0x521a5e['offsetSize'];}}else{if(_0x521a5e['is']('element')){_0x20f0c3['isInline'](_0x521a5e)&&!_0x21d6d3&&(_0x5544ac+=0x1);break;}}_0x22ff7a+=_0x5544ac,_0x272a1f['jumpTo'](_0x23d547['getShiftedBy']('forward'===_0x404c66?_0x22ff7a:-_0x22ff7a));}return _0x22ff7a;}['_getChangeContext'](_0x523619,_0x473b77){const _0x35556f=Xs(this['context'])['model']['schema'],_0x5e6d51=this['_findAdjacentContextDistance'](_0x523619,'backward',_0x35556f,0x6),_0x17baef=this['_findAdjacentContextDistance'](_0x473b77,'forward',_0x35556f,0x6),_0x31fdb1=_0x523619['getShiftedBy'](-_0x5e6d51),_0x280f66=_0x473b77['getShiftedBy'](_0x17baef);return{'start':_0x31fdb1,'end':_0x280f66,'hasContentBefore':!_0x31fdb1['isAtStart'],'hasContentAfter':!_0x280f66['isAtEnd']};}['_insertMarkers'](_0x1d2c0e){const _0x13b8bc=this['context']['plugins']['get']('AIEditing'),_0x549392=new Set();Xs(this['context'])['model']['change'](_0x1e0d13=>{for(const _0x1f6811 of _0x1d2c0e){const _0x2ef28b=''+So+_0x1f6811['type']+':'+_0x1f6811['groupId']+'_'+_0x13b8bc['_nextDataId'](_0x549392);this['_markers']['set'](_0x2ef28b,{'id':_0x2ef28b,'groupId':_0x1f6811['groupId'],'type':_0x1f6811['type'],'content':_0x1f6811['content']}),_0x1e0d13['addMarker'](_0x2ef28b,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x1e0d13['createRange'](_0x1f6811['start'],_0x1f6811['end'])});}});}['_createGetContextFn'](_0x2615e4,_0x272bc6,_0x3b4fed){let _0x101b71='';return()=>{if(!_0x101b71){const _0x184002=_0x272bc6['toView'](_0x2615e4,{'showSuggestionHighlights':!0x0});let _0x292005=_0x184002['getChild'](0x0);if(_0x292005['is']('containerElement')||(_0x292005=_0x184002),!_0x292005)return'';let _0x2a732b=!0x1;const _0x5f4f73=[];for(const _0x52d4eb of _0x292005['getChildren']())_0x52d4eb['is']('element','span')&&_0x52d4eb['hasClass']('ck-ai_review-marker_context-end')&&(_0x2a732b=!0x1),_0x2a732b&&_0x5f4f73['push'](_0x52d4eb),_0x52d4eb['is']('element','span')&&_0x52d4eb['hasClass']('ck-ai_review-marker_context-start')&&(_0x2a732b=!0x0);_0x292005['_removeChildren'](0x0,_0x292005['childCount']),_0x3b4fed?.['ellipsisBefore']&&_0x292005['_appendChild']('…'),_0x292005['_appendChild'](_0x5f4f73),_0x3b4fed?.['ellipsisAfter']&&_0x292005['_appendChild']('…');const _0x4b5d19=_0x272bc6['htmlProcessor']['domConverter']['viewToDom'](_0x184002),_0x5b94e7=_0x272bc6['htmlProcessor']['htmlWriter']['getHtml'](_0x4b5d19);_0x101b71=_0x5b94e7;}return _0x101b71;};}['_createGetContentFn'](_0x57cc17,_0x1243a8){let _0x5f3001='';return()=>(_0x5f3001||(_0x5f3001=_0x1243a8['stringify'](_0x57cc17,{'showSuggestionHighlights':!0x0})),_0x5f3001);}['_createGetContentUsingDataIdFn'](_0x2aa49c,_0x36d072,_0x3cdf3d){let _0x1e8d55='';return()=>{if(!_0x1e8d55){const _0x49e1d3=_0x3cdf3d['toView'](new _0x2b97ae(_0x2aa49c)),_0x5488b3=_0x3cdf3d['htmlProcessor']['domConverter']['viewToDom'](_0x49e1d3)['querySelector']('[data-id=\x22'+_0x36d072+'\x22]');_0x1e8d55=_0x5488b3?.['outerHTML']||'';}return _0x1e8d55;};}['_findMarkerElement'](_0x41ba0b,_0x43299a=0x5){let _0x49abcc=_0x41ba0b,_0x7b339c=null;for(let _0x21d9e4=0x0;_0x21d9e4<_0x43299a&&_0x49abcc;_0x21d9e4++){if(!_0x49abcc['className']){_0x49abcc=_0x49abcc['parentElement'];continue;}if(!(''+_0x49abcc['className'])['includes']('ck-ai_review-marker_')){_0x49abcc=_0x49abcc['parentElement'];continue;}if(!_0x49abcc['getAttribute']('data-marker-id'))break;_0x7b339c=_0x49abcc;break;}return _0x7b339c;}['_findMarkerElementById'](_0x18f15e){const _0x43344e=Xs(this['context']),_0x388d72=_0x43344e['model']['markers']['get'](_0x18f15e);return _0x388d72?_0x4e32d2(_0x43344e['editing'],_0x388d72):null;}['_getMarkersDataForGroup'](_0x78119a){return Array['from'](this['_markers']['values']())['filter'](_0x222eea=>_0x222eea['groupId']===_0x78119a);}['_getOperationStart'](_0x1ea09b){return'insert'===_0x1ea09b['type']?_0x1ea09b['position']:_0x1ea09b['newRange']['start'];}['_getOperationEnd'](_0x7f31a4,_0x33bc1a=!0x1){return'insert'===_0x7f31a4['type']?_0x33bc1a?_0x7f31a4['position']:_0x7f31a4['position']['getShiftedBy'](_0x7f31a4['howMany']):_0x7f31a4['newRange']['end'];}['_shiftOperation'](_0x1d5a67,_0x2bc40b){return'insert'===_0x1d5a67['type']?_0x1d5a67['position']=_0x1d5a67['position']['getShiftedBy'](_0x2bc40b):'marker'===_0x1d5a67['type']&&_0x1d5a67['newRange']&&(_0x1d5a67['newRange']=new _0x1857bd(_0x1d5a67['newRange']['start']['getShiftedBy'](_0x2bc40b),_0x1d5a67['newRange']['end']['getShiftedBy'](_0x2bc40b))),_0x1d5a67;}['_changeOperationOwnerDocument'](_0x3fa7fc,_0x2cd78b){'insert'===_0x3fa7fc['type']?_0x3fa7fc['position']=this['_changePositionOwnerDocument'](_0x3fa7fc['position'],_0x2cd78b):'marker'===_0x3fa7fc['type']&&_0x3fa7fc['newRange']&&(_0x3fa7fc['newRange']=this['_changeRangeOwnerDocument'](_0x3fa7fc['newRange'],_0x2cd78b));}['_changePositionOwnerDocument'](_0x8159a1,_0xca358d){return new _0x392b93(_0xca358d,_0x8159a1['path']);}['_changeRangeOwnerDocument'](_0x3a08dd,_0x263395){return new _0x1857bd(this['_changePositionOwnerDocument'](_0x3a08dd['start'],_0x263395),this['_changePositionOwnerDocument'](_0x3a08dd['end'],_0x263395));}['_changePosition'](_0x5a8734,_0x876d64){return new _0x392b93(_0x876d64,[..._0x5a8734]);}['_changeRange'](_0x3de157,_0x211c6e,_0x37a6b4,_0x5e4697){return new _0x1857bd(this['_changePosition'](_0x211c6e,_0x5e4697),this['_changePosition'](_0x37a6b4,_0x5e4697));}['_sortMarkers'](_0x11f8c1){const _0x4653f0=_0x5713a2=>{switch(_0x5713a2){case'insert':return 0x0;case'remove-context':return 0x1;case'remove-only':return 0x2;case'remove-text':return 0x3;}};return _0x11f8c1['sort']((_0x1512c2,_0x2f9588)=>_0x4653f0(_0x1512c2['type'])-_0x4653f0(_0x2f9588['type']));}['_hasSameTopLevelElement'](_0x10593f,_0x5b961f){const _0xbf241c=_0x10593f['getChild'](0x0),_0x3b8875=_0x5b961f['getChild'](0x0);return!(!_0xbf241c||!_0x3b8875)&&((!_0xbf241c['is']('element')||!_0x3b8875['is']('element')||_0xbf241c['name']===_0x3b8875['name'])&&!(_0xbf241c['is']('element')&&!_0x3b8875['is']('element')||!_0xbf241c['is']('element')&&_0x3b8875['is']('element')));}['_haveSingleTopLevelElement'](_0x551af5){return 0x1===_0x551af5['childCount'];}['_haveOnlyInlineContent'](_0x42f706,_0x506319){for(const _0x28525f of _0x42f706['getChildren']())if(_0x28525f['is']('element')&&!_0x506319['isInline'](_0x28525f))return!0x1;return!0x0;}['_upsertDataId'](_0x4bbe11,_0x800ff3){let _0x45f1a7=_0x4bbe11['getAttribute'](_0x57a89f);return _0x45f1a7||(_0x45f1a7=_0x800ff3(),_0x4bbe11['_setAttribute'](_0x57a89f,_0x45f1a7)),_0x45f1a7;}}class Ro extends pt(){['id'];['contentNew'];['contentInitial'];['documentVersion'];constructor({id:_0xe00a92,contentNew:_0x20ea4e,contentInitial:_0x102ae0,documentVersion:_0x5a047e}){super(),this['id']=_0xe00a92,this['contentNew']=_0x20ea4e,this['contentInitial']=_0x102ae0,this['documentVersion']=_0x5a047e;}}class Oo extends ct(){['id'];['parent'];['_data'];['_editorOperations']=[];constructor(_0x1332bb,_0x2cf3ef,_0xe50a18){super(),this['id']=_0x1332bb,this['parent']=_0xe50a18,this['_data']=_0x2cf3ef,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(_0x528b06,_0x949401,_0x21a3ff,_0x49b030,_0x53a31b){super(),this['_sourceCheck']=_0x949401,this['_documentData']=_0x528b06,this['_aiConnector']=_0x21a3ff,this['_reviewParams']=_0x49b030,this['_reviewArgs']=_0x53a31b,this['on']('change:status',(_0x3e7018,_0x3ca6e8,_0xd8bec2)=>{'aborted'==_0xd8bec2&&(this['_wasAborted']=!0x0),this['fire']('reviewCheckRunUpdated',{'status':_0xd8bec2,'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'](_0x186e77=>'pending'===_0x186e77['status']);}get['currentError'](){return this['_currentError'];}['updateDocumentData'](_0x526bd3){this['_documentData']=_0x526bd3;}async['start'](){this['status']='loading',this['_currentError']=void 0x0;try{this['_activeRequest']=this['_createApiRequest']();const _0x1361a5=await this['_activeRequest']['getStream']();this['status']='data';for await(const _0x4a59cc of _0x1361a5)'unmodified'!==_0x4a59cc['data']['operation']&&('error'!==_0x4a59cc['data']['operation']?'review-metadata'!==_0x4a59cc['event']?this['_addReviewCheckResult'](_0x4a59cc['data']['dataId'],_0x4a59cc['data']['textDelta']):this['callId']=_0x4a59cc['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(_0x3f8030){this['_currentError']=_0x3f8030,_0x3f8030 instanceof Error&&_0x3f8030['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'](_0x4b8ddb,_0x168c14){const _0x5c5392=this['_results']['get'](_0x4b8ddb);if(!_0x5c5392)return;if(0x0===_0x168c14['length'])return;const _0x205cbd=[];_0x168c14['forEach']((_0x35ab72,_0x38998b)=>{const _0x2222a4=new Oo(_0x5c5392['id']+'-'+_0x38998b,_0x35ab72,_0x5c5392);_0x2222a4['on']('change:status',()=>{this['fire']('reviewCheckResultChangeStatusUpdated',{'change':_0x2222a4,'status':_0x2222a4['status']});}),_0x2222a4['on']('change:isActivated',()=>{_0x2222a4['isActivated']?this['fire']('reviewCheckResultActivated',{'change':_0x2222a4}):this['fire']('reviewCheckResultDeactivated',{'change':_0x2222a4});}),this['_changes']['push'](_0x2222a4),_0x205cbd['push'](_0x2222a4);}),this['fire']('reviewCheckResultReady',{'changes':_0x205cbd,'result':_0x5c5392,'source':this});}['abort'](){this['_activeRequest']&&(this['_activeRequest']['abortController']['abort'](),this['_activeRequest']=null,this['status']='aborted');}['isChangeActive'](_0x21d727){const _0x57d9a1=this['_changes']['find'](_0x45ba21=>_0x45ba21['id']===_0x21d727);return!(!_0x57d9a1||'pending'!==_0x57d9a1['status']);}['isAnyChangeActivated'](){return this['_changes']['some'](_0x5d7829=>!0x0===_0x5d7829['isActivated']);}['getActiveChanges'](){return this['_changes']['filter'](_0x42702a=>'pending'===_0x42702a['status']);}['getChangeById'](_0x276339){return this['_changes']['find'](_0x13eaf2=>_0x13eaf2['id']===_0x276339);}['markAllChangesAsAccepted'](){for(const _0x12b94a of this['_changes'])'pending'===_0x12b94a['status']&&(_0x12b94a['status']='accepted');this['_checkIfFinished']();}['markChangeAsAccepted'](_0x5c18c4){const _0x15ffa4=this['_changes']['find'](_0x4c1121=>_0x4c1121['id']===_0x5c18c4);_0x15ffa4&&'pending'===_0x15ffa4['status']&&(_0x15ffa4['status']='accepted'),this['_checkIfFinished']();}['markChangeAsRejected'](_0x5414a4){const _0x57f5c3=this['_changes']['find'](_0x2caeaf=>_0x2caeaf['id']===_0x5414a4);_0x57f5c3&&'pending'===_0x57f5c3['status']&&(_0x57f5c3['status']='rejected'),this['_checkIfFinished']();}['markChangeAsOutdated'](_0x2c145a){const _0x4c8c56=this['_changes']['find'](_0x2993c7=>_0x2993c7['id']===_0x2c145a);_0x4c8c56&&'pending'===_0x4c8c56['status']&&(_0x4c8c56['status']='outdated'),this['_checkIfFinished']();}['markChangeAsPending'](_0x29bcd4){const _0x3049c5=this['_changes']['find'](_0x5b4fe1=>_0x5b4fe1['id']===_0x29bcd4);_0x3049c5&&'outdated'===_0x3049c5['status']&&(_0x3049c5['status']='pending'),this['_checkIfFinished']();}['activateChange'](_0x23d48d){this['_changes']['filter'](_0x41a55f=>_0x41a55f['isActivated']&&_0x41a55f['id']!==_0x23d48d)['forEach'](_0x544ea7=>{_0x544ea7['isActivated']=!0x1;});const _0x4b2574=this['_changes']['find'](_0x1ddc43=>_0x1ddc43['id']===_0x23d48d);_0x4b2574&&'pending'===_0x4b2574['status']&&(_0x4b2574['isActivated']=!0x0);}['deactivateChange'](){this['_changes']['filter'](_0x26413f=>_0x26413f['isActivated'])['forEach'](_0x2d005b=>{_0x2d005b['isActivated']=!0x1;});}['forceReadyState'](){this['status']='ready';}async['sendRating'](_0xfd0695){if('initialized'===this['status']||'loading'===this['status']||'data'===this['status']||this['_wasAborted'])return;if(!this['callId']||0x0===this['_changes']['length'])return;let _0x5c79ac;if(_0xfd0695){const _0x41757c=this['_changes']['find'](_0x44e1cb=>_0x44e1cb['id']===_0xfd0695);if(_0x41757c&&_0x41757c['isRated'])return;_0x41757c&&(_0x5c79ac=_0x41757c['parent']['id'],_0x41757c['isRated']=!0x0);}const _0x3dbb9c={'positiveCount':this['_changes']['filter'](_0x13380f=>'accepted'===_0x13380f['status'])['length'],'totalCount':this['_changes']['length']};this['_sendRatingRequest'](_0x3dbb9c,this['callId'],_0x5c79ac);}['_addReviewCheckResult'](_0x2b4282,_0x5408d3){const _0x5a7b0f=this['_documentData']['elements']['get'](_0x2b4282);if(!_0x5a7b0f)return;const _0xd0fb1f=_0x5a7b0f['getContent']();if(_0xd0fb1f===_0x5408d3)return;const _0x1ecead=new Ro({'id':_0x2b4282,'contentInitial':_0xd0fb1f,'contentNew':_0x5408d3,'documentVersion':this['_documentData']['version']});this['_results']['set'](_0x1ecead['id'],_0x1ecead),this['fire']('reviewCheckResultAdded',{'result':_0x1ecead,'source':this});}['_checkIfFinished'](){'finished'===this['status']&&(this['_changes']['filter'](_0x348de8=>'pending'===_0x348de8['status'])['length']>0x0&&(this['status']='ready')),'ready'===this['status']&&(0x0===this['_changes']['filter'](_0x4d0961=>'pending'===_0x4d0961['status'])['length']&&(this['status']='finished'));}}class No extends ko{get['subTitle'](){if(!this['_reviewParams']||0x0===this['_reviewParams']['length'])return'';const _0x29bb15=[];if(this['_reviewParams']['length']>0x0&&this['_sourceCheck']['options'])for(let _0x18a186=0x0;_0x18a186<this['_reviewParams']['length'];_0x18a186++){if(!this['_reviewParams'][_0x18a186]||!this['_sourceCheck']['options'][_0x18a186])continue;const _0x1a841c=this['_sourceCheck']['options'][_0x18a186],_0x29db60=_0x1a841c['data']?.['find'](_0x244901=>_0x244901['id']===this['_reviewParams'][_0x18a186]);_0x29db60&&_0x29bb15['push'](_0x29db60['label']);}return _0x29bb15['join'](',\x20');}get['reviewName'](){return this['_composeReviewName']();}['_createApiRequest'](){return this['_aiConnector']['callSystemReview']({'reviewName':this['_composeReviewName'](),'content':this['_documentData']['content'],'args':this['_reviewArgs']});}['_sendRatingRequest'](_0x4d2d5a,_0x44ed72,_0x2a4174){return this['_aiConnector']['upsertAIReviewRating'](this['reviewName'],_0x44ed72,_0x4d2d5a,_0x2a4174);}['_composeReviewName'](){return!this['_reviewParams']||0x0===this['_reviewParams']['length']||this['_sourceCheck']['useArgs']?this['_sourceCheck']['apiId']:[this['_sourceCheck']['apiId'],...this['_reviewParams']]['join']('-');}}class vo extends _0x20e290{['_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(_0x1ba17c,_0x25803a)=>{const _0x550b18=this['_aiReviewCheckList']['getCheckById'](_0x25803a['id']);if(_0x550b18){this['_onReviewCheckRun'](_0x25803a),this['_aiReviewCoreEditing']['switchToReadOnly'](),this['_currentReviewCheckRun']=this['_createReviewCheckRun'](_0x25803a,_0x550b18),this['_aiReviewCoreUi']['setCheckResultTitle'](this['_currentReviewCheckRun']['title'],this['_currentReviewCheckRun']['subTitle']),this['_currentReviewCheckRun']['on']('reviewCheckRunUpdated',(_0x320e9b,_0x260b85)=>{switch(_0x260b85['status']){case'data':case'loading':this['_aiReviewCoreUi']['showCheckRunResults'](_0x260b85);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'!==_0x260b85['status']&&'error-chunk'!==_0x260b85['status']&&'error-general'!==_0x260b85['status']||this['_currentReviewCheckRun']?.['sendRating']();}),this['_currentReviewCheckRun']['on']('reviewCheckResultAdded',(_0x23c8d7,_0x4a6d2c)=>{if(!this['_currentReviewCheckRun'])throw new ht('ai-review-mode-no-current-check-run',this);const _0x1337af=this['_diffContent'](_0x4a6d2c['result']['contentInitial'],_0x4a6d2c['result']['contentNew']);_0x4a6d2c['source']['addResultChanges'](_0x4a6d2c['result']['id'],_0x1337af);}),this['_currentReviewCheckRun']['on']('reviewCheckResultReady',(_0x404753,_0x589410)=>{for(const _0x53c56b of _0x589410['changes'])this['_aiReviewCoreUi']['showCheckRunResult'](_0x53c56b);this['_markChangePositionInEditorContent'](_0x589410['changes'],_0x589410['source']['documentData']);}),this['_currentReviewCheckRun']['on']('reviewCheckResultChangeStatusUpdated',(_0x28be79,_0x34e9c5)=>{this['_aiReviewCoreUi']['updateChangeState'](_0x34e9c5['change']['id'],_0x34e9c5['status']);}),this['_currentReviewCheckRun']['on']('reviewCheckResultActivated',(_0x2fe285,_0x5cd45a)=>{this['_onReviewCheckResultActivated'](_0x5cd45a);}),this['_currentReviewCheckRun']['on']('reviewCheckResultDeactivated',()=>{this['_onReviewCheckResultDeactivated']();});try{await this['_currentReviewCheckRun']['start']();}catch(_0x41f705){_0x41f705 instanceof Error&&_0x41f705['message']['includes']('ai-request-aborted')||(_0x41f705 instanceof ht?this['_logError'](_0x41f705):this['_logError'](new ht('ai-review-mode-check-run-failed',this,void 0x0,_0x41f705)));}}else this['_logError'](new ht('ai-review-mode-source-check-not-found',this,{'checkId':_0x25803a['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 _0x52e343=this['_currentReviewCheckRun']['getActiveChanges']();if(!_0x52e343['length'])return;this['_aiReviewCoreEditing']['applyChange'](_0x52e343['map'](_0x46353b=>_0x46353b['id']));const _0x20911e=this['_currentReviewCheckRun'];_0x20911e['markAllChangesAsAccepted'](),_0x20911e['sendRating']();}),this['listenTo'](this['_aiReviewCoreUi'],'acceptChange',(_0x3592f9,_0x5ddbfa)=>{this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['isChangeActive'](_0x5ddbfa['id'])&&(this['_aiReviewCoreEditing']['applyChange']([_0x5ddbfa['id']]),this['_currentReviewCheckRun']['markChangeAsAccepted'](_0x5ddbfa['id']),this['_aiReviewCoreUi']['hideChangeBalloon'](),this['_currentReviewCheckRun']['sendRating'](_0x5ddbfa['id']));}),this['listenTo'](this['_aiReviewCoreUi'],'dismissChange',(_0x8d261f,_0x4cc918)=>{this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['isChangeActive'](_0x4cc918['id'])&&(this['_aiReviewCoreEditing']['rejectChange'](_0x4cc918['id']),this['_currentReviewCheckRun']['markChangeAsRejected'](_0x4cc918['id']),this['_aiReviewCoreUi']['hideChangeBalloon'](),this['_currentReviewCheckRun']['sendRating'](_0x4cc918['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',(_0x526817,_0x1d7d68)=>{this['_onActivateChange'](_0x1d7d68);}),this['listenTo'](this['_aiReviewCoreUi'],'deactivateChange',(_0x3957b7,_0x19ad23)=>{this['_onDeactivateChange'](_0x19ad23);}),this['listenTo'](this['_aiReviewCoreEditing']['emitter'],'changeMarkerClicked',(_0x94385a,_0x44e2cb)=>{this['_onChangeMarkerClicked'](_0x94385a,_0x44e2cb);}),this['listenTo'](this['_aiReviewCoreEditing']['emitter'],'changeMarkerHovered',(_0x4bc44f,_0x30d7bd)=>{this['_onChangeMarkerHovered'](_0x4bc44f,_0x30d7bd);}),this['listenTo'](this['_aiReviewCoreEditing']['emitter'],'changeMarkerBlurred',()=>{this['_onChangeMarkerBlurred']();}),this['listenTo'](this['_aiReviewCoreEditing']['emitter'],'changeMarkerRemoved',(_0xe873f,_0x5ab177)=>{this['_onChangeMarkerRemoved'](_0xe873f,_0x5ab177);}),this['listenTo'](this['_aiReviewCoreEditing']['emitter'],'changeMarkerRestored',(_0x4a35de,_0x4cf947)=>{this['_onChangeMarkerRestored'](_0x4a35de,_0x4cf947);});}['_createReviewCheckRun'](_0x5a2810,_0x12e0cc){return new No(this['_aiReviewCoreEditing']['getDocumentData'](),_0x12e0cc,this['_aiConnector'],_0x5a2810['params'],_0x5a2810['args']);}['_onChangeMarkerRemoved'](_0x1f8c58,_0x5327eb){this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['markChangeAsOutdated'](_0x5327eb['changeId']);}['_onChangeMarkerRestored'](_0x51f4bf,_0xc3d334){this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['markChangeAsPending'](_0xc3d334['changeId']);}['_onCheckRunFinished'](){this['_aiReviewCoreUi']['showReviewCompletedView']();}['_initRequiredPlugins'](){this['_aiConnector']=this['context']['plugins']['get']('AIConnector');}['_onReviewRunLeave'](_0xfcdff0=!0x1){this['_currentReviewCheckRun']&&(this['_currentReviewCheckRun']['hasModifications']||this['_currentReviewCheckRun']['sendRating'](),this['_currentReviewCheckRun']['stopListening'](),this['_currentReviewCheckRun']['abort'](),this['_currentReviewCheckRun']=void 0x0),_0xfcdff0&&this['_aiReviewCoreUi']['showReviewCheckList'](),this['_aiReviewCoreEditing']['clearAllMarkers'](),this['_aiReviewCoreEditing']['switchToEdit'](),this['_changeActivationSource']=null;const _0x1e2cc8=this['_aiReviewCoreEditing']['getEditor']();_0x1e2cc8&&_0x1e2cc8['editing']['view']['change'](_0x1fec63=>{const _0x59137f=_0x1e2cc8['editing']['view']['document']['getRoot']();_0x1fec63['removeClass']('ck-ai_review-diff',_0x59137f),_0x1fec63['removeClass']('ck-ai_review-highlights',_0x59137f),_0x1fec63['removeClass']('ck-ai-translate-mode-content',_0x59137f);});}['_getTranslationWithDefault'](_0xadca33,_0x475efc){const _0x44cc8e=us(this['context']['locale'],_0xadca33);return _0x44cc8e===_0xadca33?_0x475efc:_0x44cc8e;}['_logError'](_0x527608,_0x103cdc=!0x1){mt(_0x527608['message']),_0x103cdc||(_0x527608['message']['startsWith']('ai-review-mode-models-unable-to-retrieve')?this['_aiReviewCoreUi']['showGeneralReviewCoreErrorView']():this['_aiReviewCoreUi']['showGeneralResultsErrorView']());}['_scrollToChange'](_0x5bed56){if('content'===this['_changeActivationSource']){const _0x2700cf=this['_aiReviewCoreUi']['getChangeElement'](_0x5bed56);_0x2700cf&&ft(_0x2700cf['closest']('.ck-ai_review__check-run-result')||_0x2700cf);}else{if('panel'===this['_changeActivationSource']){const _0x457fd4=this['_getChangeContentElement'](_0x5bed56);if(!_0x457fd4)return;Ct({'target':_0x457fd4,'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(_0x1cc882){this['id']=_0x1cc882['id'],this['commandId']=_0x1cc882['commandId'],this['title']=_0x1cc882['title'],this['description']=_0x1cc882['description'],this['isParameterized']=_0x1cc882['isParameterized'],this['useArgs']=_0x1cc882['useArgs'],this['options']=_0x1cc882['options'],this['args']=_0x1cc882['args'];}}class Lo extends ct(){['_checks']=[];['setupChecks'](_0x457afc){this['_checks']=_0x457afc['map'](_0x5052eb=>new xo(_0x5052eb));}get['checks'](){return this['_checks'];}['getCheckById'](_0x21d7f8){return this['checks']['find'](_0x901950=>_0x901950['id']===_0x21d7f8);}['removeCheckById'](_0x138506){this['_checks']=this['_checks']['filter'](_0x1942d3=>_0x1942d3['id']!==_0x138506);}}class Do extends xo{['_models']=[];['_defaultModel']=null;constructor(_0x323839,_0x10887f,_0x1b9277){super(_0x323839),this['_models']=_0x10887f,this['_defaultModel']=_0x1b9277;}get['models'](){return this['_models'];}get['defaultModel'](){return this['_defaultModel'];}}class Po extends xo{['isExtra']=!0x0;['prompt'];['model'];['_defaultModel']=null;constructor(_0x23266e,_0x23bbf0,_0x46e273){super(_0x23266e),this['prompt']=_0x23266e['prompt'],this['model']=_0x23266e['model'],this['model']?this['_defaultModel']=_0x23bbf0['find'](_0x13336b=>_0x13336b['id']===this['model'])||null:this['_defaultModel']=_0x46e273;}get['defaultModel'](){return this['_defaultModel'];}}class Ho extends Lo{['_allModels']=[];['_recommendedModels']=[];['_defaultModel']=null;constructor(_0x21efdd,_0x247fde,_0x3346a7){super(),this['_allModels']=_0x21efdd,this['_recommendedModels']=_0x247fde,this['_defaultModel']=_0x3346a7;}['setupChecks'](_0x4a9eee){this['_checks']=_0x4a9eee['map'](_0x18398d=>!0x0===_0x18398d['isExtra']?new Po(_0x18398d,this['_allModels'],this['_defaultModel']):'custom'===_0x18398d['id']?new Do(_0x18398d,this['_recommendedModels'],this['_defaultModel']):new xo(_0x18398d));}}class Mo extends ko{['_prompt'];['_model'];constructor(_0x528cf3,_0x377210,_0x1f7c4a,_0x2c7f1f,_0x3055e3){super(_0x1f7c4a,_0x2c7f1f,_0x3055e3),this['_prompt']=_0x528cf3,this['_model']=_0x377210;}get['subTitle'](){return this['_prompt'];}['_createApiRequest'](){return this['_aiConnector']['callCustomReview']({'content':this['_documentData']['content'],'prompt':this['_prompt'],'model':this['_model']});}['_sendRatingRequest'](_0x59c368,_0xb2ce64,_0x354795){return this['_aiConnector']['upsertCustomAIReviewRating'](_0xb2ce64,_0x59c368,_0x354795);}}class Uo extends Mo{get['subTitle'](){return'';}set['prompt'](_0x41c015){this['_prompt']=_0x41c015;}set['model'](_0x4620a1){this['_model']=_0x4620a1;}}class Vo extends vo{static get['pluginName'](){return'AIReviewModeController';}['_isDiffOn']=!0x1;['_hasDefaultAvailableCommands']=!0x1;constructor(_0x5d9782){super(_0x5d9782),this['_hasDefaultAvailableCommands']=!this['context']['config']['get']('ai.review.availableCommands'),this['context']['config']['define']('ai.review.availableCommands',yo['map'](_0x16df72=>_0x16df72['id'])),this['context']['config']['define']('ai.review.extraCommands',[]);}async['init'](){await super['init'](),this['listenTo'](this['_aiReviewCoreUi'],'toggleDiff',(_0x2c7373,_0x212da3)=>{this['_isDiffOn']=_0x212da3['on'],this['_onDiffChange'](this['_isDiffOn']);});}['_initRequiredPlugins'](){super['_initRequiredPlugins'](),this['_aiReviewCoreUi']=this['context']['plugins']['get']('AIReviewModeUI'),this['_aiReviewCoreEditing']=this['context']['plugins']['get']('AIReviewCoreEditing');}['_createReviewCheckRun'](_0x3d2aec,_0x487686){return _0x3d2aec['isCustom']?new Mo(_0x3d2aec['args']['prompt'],_0x3d2aec['args']['model'],this['_aiReviewCoreEditing']['getDocumentData'](),_0x487686,this['_aiConnector']):_0x487686['isExtra']?new Uo(_0x487686['prompt'],_0x487686['defaultModel']['id'],this['_aiReviewCoreEditing']['getDocumentData'](),_0x487686,this['_aiConnector']):new No(this['_aiReviewCoreEditing']['getDocumentData'](),_0x487686,this['_aiConnector'],_0x3d2aec['params'],_0x3d2aec['args']);}['_onReviewCheckResultActivated'](_0xc7d4f){this['_aiReviewCoreUi']['setActiveStateInResults'](_0xc7d4f['change']['id']),this['_scrollToChange'](_0xc7d4f['change']['id']);const _0x5c6c6e=this['_aiReviewCoreEditing']['getMarkerElementForChange'](_0xc7d4f['change']['id']);if(!_0x5c6c6e)return;const _0x43e6e5=this['_aiReviewCoreEditing']['getEditor']();this['_aiReviewCoreUi']['showChangeBalloon'](_0xc7d4f['change'],()=>_0x5c6c6e['getElement'](),void 0x0,'click',_0x43e6e5?.['editing']?.['view']?.['getDomRoot'](),_0x43e6e5?.['ui']?.['viewportOffset']),this['_aiReviewCoreEditing']['setMarkersInElementAsActive'](_0xc7d4f['change']['id']);}['_onReviewCheckResultDeactivated'](){this['_aiReviewCoreUi']['resetActiveStateInResults'](),this['_aiReviewCoreUi']['hideChangeBalloon'](),this['_aiReviewCoreEditing']['setAllMarkersAsInactive']();}['_onActivateChange'](_0x4e8b12){this['_currentReviewCheckRun']&&'click'===_0x4e8b12['uiInteraction']&&(this['_changeActivationSource']='panel',this['_currentReviewCheckRun']['activateChange'](_0x4e8b12['id']));}['_onDeactivateChange'](_0x16c5f1){this['_currentReviewCheckRun']&&'balloon'===_0x16c5f1['origin']&&this['_currentReviewCheckRun']['deactivateChange']();}['_onChangeMarkerClicked'](_0x5caffc,_0xfc6e3d){if(!this['_currentReviewCheckRun'])return;this['_changeActivationSource']='content',this['_currentReviewCheckRun']['activateChange'](_0xfc6e3d['changeId']);const _0x3b5ddd=this['_currentReviewCheckRun']['getChangeById'](_0xfc6e3d['changeId']);if(!_0x3b5ddd)return;const _0x4bbbb9=this['_aiReviewCoreEditing']['getEditor']();this['_aiReviewCoreUi']['showChangeBalloon'](_0x3b5ddd,_0xfc6e3d['markerElement'],_0xfc6e3d['domEvent'],'click',_0x4bbbb9?.['editing']?.['view']?.['getDomRoot'](),_0x4bbbb9?.['ui']?.['viewportOffset']);}['_onChangeMarkerHovered'](_0xb3f65c,_0x3c7285){if(!this['_currentReviewCheckRun'])return;if(this['_currentReviewCheckRun']['isAnyChangeActivated']())return;const _0x492721=this['_currentReviewCheckRun']['getChangeById'](_0x3c7285['changeId']);if(!_0x492721)return;const _0x30f116=this['_aiReviewCoreEditing']['getEditor']();this['_aiReviewCoreUi']['showChangeBalloon'](_0x492721,_0x3c7285['markerElement'],_0x3c7285['domEvent'],'hover',_0x30f116?.['editing']?.['view']?.['getDomRoot'](),_0x30f116?.['ui']?.['viewportOffset']);}['_onChangeMarkerBlurred'](){if(!this['_currentReviewCheckRun'])return;this['_currentReviewCheckRun']['isAnyChangeActivated']()||this['_aiReviewCoreUi']['hideChangeBalloon']();}['_getChangeContentElement'](_0x5b86d7){const _0x1575f6=this['_aiReviewCoreEditing']['getMarkerElementForChange'](_0x5b86d7);return _0x1575f6?_0x1575f6['getElement']():null;}['_markChangePositionInEditorContent'](_0x536792,_0x51b0be){this['_aiReviewCoreEditing']['markChangePositionInEditorContent'](_0x536792,_0x51b0be);}['_diffContent'](_0x44c539,_0xc1600e){return this['_aiReviewCoreEditing']['diffContent'](_0x44c539,_0xc1600e);}['_onReviewCheckRun'](){this['_onDiffChange'](this['_isDiffOn']);}['_onDiffChange'](_0x28051d){const _0x1ec250=this['_aiReviewCoreEditing']['getEditor']();_0x28051d?this['_aiReviewCoreUi']['hideDiffInBalloon']():this['_aiReviewCoreUi']['showDiffInBalloon'](),_0x1ec250&&_0x1ec250['editing']['view']['change'](_0x2dcf61=>{const _0x543787=_0x1ec250['editing']['view']['document']['getRoot']();for(const _0x3fdf00 of _0x543787['getClassNames']())_0x3fdf00['startsWith']('ck-ai_review-')&&_0x2dcf61['removeClass'](_0x3fdf00,_0x543787);_0x2dcf61['addClass'](_0x28051d?'ck-ai_review-diff':'ck-ai_review-highlights',_0x543787);});}async['_getChecksList'](){const _0x3ac54f=[...yo,...this['_getExtraChecks']()],_0x535086=this['context']['config']['get']('ai.review.availableCommands')||[];this['_logErrorForNonExistentChecks'](_0x535086,_0x3ac54f);let _0x1e10a8=_0x3ac54f;this['_hasDefaultAvailableCommands']||(_0x1e10a8=_0x535086['map'](_0x4f5331=>_0x3ac54f['find'](_0x3d2697=>_0x3d2697['id']===_0x4f5331))['filter'](_0x1ff7e3=>!!_0x1ff7e3)),_0x1e10a8=_0x1e10a8['map'](_0x801add=>_0x801add['isExtra']?_0x801add:this['_translateReviewCheck'](_0x801add));const _0x5d431e=_0x1e10a8['some'](_0x8a5252=>_0x8a5252['isExtra']||'custom'===_0x8a5252['id']);let _0x55fb57=[],_0x4add07=[],_0x2794e2=null;if(_0x5d431e){const _0x4d39f4=await this['_getModels']();_0x55fb57=_0x4d39f4['all'],_0x4add07=_0x4d39f4['recommended'],_0x2794e2=_0x4d39f4['default'];}const _0x3d98b0=new Ho(_0x55fb57,_0x4add07,_0x2794e2);return _0x3d98b0['setupChecks'](_0x1e10a8),_0x5d431e&&this['_filterChecksWithMissingModel'](_0x3d98b0),_0x3d98b0;}['_getExtraChecks'](){return(this['context']['config']['get']('ai.review.extraCommands')||[])['map'](_0x1fb5dc=>({'id':_0x1fb5dc['id'],'commandId':_0x1fb5dc['id'],'title':_0x1fb5dc['label'],'description':_0x1fb5dc['description'],'isParameterized':!0x1,'isExtra':!0x0,'prompt':_0x1fb5dc['prompt'],'model':_0x1fb5dc['model']}));}['_logErrorForNonExistentChecks'](_0x332732,_0x137f53){const _0x34818e=_0x332732['filter'](_0x1d06fa=>!_0x137f53['some'](_0x5d5d98=>_0x5d5d98['id']===_0x1d06fa));_0x34818e['length']&&this['_logError'](new ht('ai-review-mode-non-existent-commands-used',this,{'commandIds':_0x34818e['join'](',\x20')}),!0x0);}async['_getModels'](){try{const _0xb15b15=new qs({'connector':this['_aiConnector'],'config':this['context']['config']['get']('ai.models'),'locale':this['context']['locale']});return{'all':await _0xb15b15['getAll'](),'recommended':await _0xb15b15['getAvailableModels'](),'default':await _0xb15b15['getDefault']()};}catch(_0x549372){return this['_logError'](new ht('ai-review-mode-models-unable-to-retrieve',this,void 0x0,_0x549372)),{'all':[],'recommended':[],'default':null};}}['_translateReviewCheck'](_0x470b13){const _0x3c4e14='AI_REVIEW_CHECK_'+_0x470b13['id']['toUpperCase']()['replaceAll']('-','_'),_0x570be8={..._0x470b13,'title':this['_getTranslationWithDefault'](_0x3c4e14+'_TITLE',_0x470b13['title']),'description':this['_getTranslationWithDefault'](_0x3c4e14+'_DESCRIPTION',_0x470b13['description'])};return _0x470b13['options']&&(_0x570be8['options']=_0x470b13['options']['map'](_0x52979d=>({..._0x52979d,'label':this['_getTranslationWithDefault'](_0x3c4e14+'_OPTIONS_LABEL',_0x52979d['label']||''),'data':_0x52979d['data']?_0x52979d['data']['map'](_0x425463=>({..._0x425463,'label':this['_getTranslationWithDefault'](_0x3c4e14+'_OPTIONS_DATA_'+_0x425463['id']['toUpperCase'](),_0x425463['label'])})):void 0x0}))),_0x570be8;}['_filterChecksWithMissingModel'](_0x5e126d){const _0x582db0=[];_0x5e126d['checks']['forEach'](_0x3cdee4=>{(_0x3cdee4 instanceof Po&&!_0x3cdee4['defaultModel']||_0x3cdee4 instanceof Do&&!_0x3cdee4['models']['length'])&&_0x582db0['push'](_0x3cdee4['id']);}),_0x582db0['length']&&_0x582db0['forEach'](_0xb3e02c=>{_0x5e126d['removeCheckById'](_0xb3e02c),this['_logError'](new ht('ai-review-mode-command-unavailable-due-to-missing-model',this,{'commandId':_0xb3e02c}),!0x0);});}}class Bo extends _0x20e290{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'](_0x4b0dda){this['_checks']=_0x4b0dda['map'](_0x580bbe=>new Go(_0x580bbe));}}class Ko extends No{['_title'];constructor(_0x287d11,_0x58003d,_0xd0ca1e,_0x36996c,_0x17eca1,_0x21aafc){super(_0x287d11,_0x58003d,_0xd0ca1e,_0x17eca1,_0x21aafc),this['_title']=_0x36996c;}get['title'](){return this['_title'];}get['subTitle'](){return this['_sourceCheck']['title'];}}class Wo extends vo{static get['pluginName'](){return'AITranslateController';}constructor(_0x19c3b3){super(_0x19c3b3),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'](_0x1de79a,_0x32183d){return new Ko(this['_aiReviewCoreEditing']['getDocumentData'](),_0x32183d,this['_aiConnector'],us(this['context']['locale'],'AI_REVIEW_CHECK_TRANSLATE_TITLE'),_0x1de79a['params'],_0x1de79a['args']);}['_onReviewCheckResultActivated'](_0x31a0cb){this['_aiReviewCoreUi']['setActiveStateInResults'](_0x31a0cb['change']['id']),this['_aiReviewCoreEditing']['setMarkersInElementAsActive'](_0x31a0cb['change']['id']);}['_onReviewCheckResultDeactivated'](){this['_aiReviewCoreEditing']['setAllMarkersAsInactive'](),this['_aiReviewCoreUi']['resetActiveStateInResults']();}['_onActivateChange'](_0x5625b2){this['_currentReviewCheckRun']&&('hover'===_0x5625b2['uiInteraction']&&(this['_changeActivationSource']='panel',this['_currentReviewCheckRun']['activateChange'](_0x5625b2['id'])),'click'===_0x5625b2['uiInteraction']&&this['_scrollToChange'](_0x5625b2['id']));}['_onDeactivateChange'](_0x59c8e9){this['_currentReviewCheckRun']&&'panel'===_0x59c8e9['origin']&&this['_currentReviewCheckRun']['deactivateChange']();}['_onChangeMarkerClicked'](_0x370dcf,_0x3754e2){this['_currentReviewCheckRun']&&(this['_changeActivationSource']='content',this['_currentReviewCheckRun']['activateChange'](_0x3754e2['changeId']),this['_scrollToChange'](_0x3754e2['changeId']));}['_onChangeMarkerHovered'](_0x59d84d,_0x550539){this['_currentReviewCheckRun']&&(this['_changeActivationSource']='content',this['_currentReviewCheckRun']['activateChange'](_0x550539['changeId']),this['_aiReviewCoreEditing']['reactivateMarkers'](_0x550539['changeId']));}['_onChangeMarkerBlurred'](){this['_currentReviewCheckRun']&&'content'===this['_changeActivationSource']&&(this['_currentReviewCheckRun']['deactivateChange'](),this['_aiReviewCoreEditing']['setAllMarkersAsInactive']());}['_getChangeContentElement'](_0x463985){return this['_aiReviewCoreEditing']['getContentElementForChange'](_0x463985);}['_markChangePositionInEditorContent'](_0x4e7aa6,_0x167e56){this['_aiReviewCoreEditing']['markChangePositionInEditorContent'](_0x4e7aa6,_0x167e56);}['_diffContent'](_0x1e0c7e,_0xc0334c){return this['_aiReviewCoreEditing']['diffContent'](_0x1e0c7e,_0xc0334c,!0x0);}['_onReviewCheckRun'](){const _0x20daec=this['_aiReviewCoreEditing']['getEditor']();_0x20daec&&_0x20daec['editing']['view']['change'](_0x1d4884=>{const _0x1c922f=_0x20daec['editing']['view']['document']['getRoot']();for(const _0x1e4193 of _0x1c922f['getClassNames']())(_0x1e4193['startsWith']('ck-ai-review-')||'ck-ai-translate-'===_0x1e4193)&&_0x1d4884['removeClass'](_0x1e4193,_0x1c922f);_0x1d4884['addClass']('ck-ai-translate-mode-content',_0x1c922f);});}async['_getChecksList'](){const _0x479f91=[],_0x498d60=this['context']['config']['get']('ai.translate.languages')||[];for(const _0xadeacc of _0x498d60)_0x479f91['push']({'title':_0xadeacc['label'],'id':_0xadeacc['id'],'commandId':_0xadeacc['id'],'description':'','isParameterized':!0x1,'useArgs':!0x0,'args':{'language':_0xadeacc['id']}});const _0x25b929=new Fo();return _0x25b929['setupChecks'](this['_translateChecks'](_0x479f91)),_0x25b929;}['_translateChecks'](_0x51c3dc){return _0x51c3dc['map'](_0x340332=>{const _0x2703b7='AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_'+_0x340332['title']['toUpperCase']()['replaceAll']('-','_');return{..._0x340332,'title':this['_getTranslationWithDefault'](_0x2703b7,_0x340332['title'])};});}}class Yo extends _o{constructor(_0xf4c1b3,_0x1bcfc9){super(_0xf4c1b3,_0x1bcfc9),this['on']('set:isLoading',(_0xc8a866,_0xa4860,_0x1fde9c)=>{_0x1fde9c&&(this['headerTitle']=us(this['locale'],'AI_TRANSLATE_CHECK_RESULTS_LOADING_TITLE'));}),this['on']('set:isResultReady',(_0xe861b5,_0x47e3f3,_0xfd478)=>{_0xfd478&&(this['headerTitle']=us(this['locale'],'AI_TRANSLATE_CHECK_RESULTS_READY_TITLE'));});}['_createAcceptAllButtonView'](){const _0x44a3f0=super['_createAcceptAllButtonView']();return _0x44a3f0['set']('label',us(this['locale'],'AI_TRANSLATE_ACCEPT_ALL')),_0x44a3f0;}['_createExitReviewButtonView'](){const _0x4ff8b9=super['_createExitReviewButtonView']();return _0x4ff8b9['set']('label',us(this['locale'],'AI_CHAT_HISTORY_CANCEL')),_0x4ff8b9;}}class $o extends wo{['_setupTemplate'](){const _0x80b35f=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-translate__check-list-wrapper',_0x80b35f['if']('isVisible','ck-hidden',_0x2fdd6b=>!_0x2fdd6b)]},'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',_0x80b35f['if']('isVisible','ck-hidden',_0xaad2cf=>!_0xaad2cf)]},'children':this['_checkViews']}]});}}class qo extends ho{static get['pluginName'](){return'AITranslateUI';}['createMainView'](){const _0x18a67a=this['context']['locale'],_0x2d777f=new _0x4c7c2c(_0x18a67a,{'label':us(_0x18a67a,'AI_REVIEW_CHECK_TRANSLATE_TITLE'),'icon':_0x3ec8c7,'class':'ck-ai-header\x20ck-ai-header_review-translate'}),_0x2269ae=new lo(_0x18a67a,{'header':_0x2d777f,'list':new $o(_0x18a67a),'results':new Yo(_0x18a67a,{'generalErrorText':us(_0x18a67a,'AI_TRANSLATE_GENERAL_ERROR_MESSAGE')}),'completed':new Ao(_0x18a67a,{'headerText':us(_0x18a67a,'AI_TRANSLATE_FINISH_HEADER_TITLE'),'emptyResultsText':us(_0x18a67a,'AI_TRANSLATE_EMPTY_RESULTS_TEXT'),'buttonText':us(_0x18a67a,'AI_TRANSLATE_FINISH_BUTTON_LABEL')})});return _0x2269ae['extendTemplate']({'attributes':{'class':'ck-ai-translate-mode'}}),_0x2269ae;}['registerTab'](){const _0x24e270=this['context']['plugins']['get']('AITabs');_0x24e270['view']['on']('activateTab',(_0x385e48,_0x5205a6)=>{'translate'===_0x5205a6?this['fire']('getReviewCheckList'):this['fire']('leaveReview');}),_0x24e270['view']['addTab']({'id':'translate','buttonLabel':us(this['context']['locale'],'AI_REVIEW_CHECK_TRANSLATE_TITLE'),'buttonIcon':_0x3ec8c7,'order':0x0,'content':this['_mainView']});}}class Qo extends _0x20e290{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 _0x3e16f7,Command as _0x1e6161,ContextPlugin as _0x4c3ee6,Editor as _0xe5e2fa}from'@ckeditor/ckeditor5-core/dist/index.js';import{IconCopy as _0x28e3cb,IconCheck as _0x389cff,IconError as _0x2bc3b3,IconSubmit as _0x1e545f,IconAIHistory as _0x2581c0,IconMagicWand as _0x490c4e,IconRobotPencil as _0x21ce39,IconMaximize as _0x29d93e,IconMinimize as _0x359180,IconShowChangesOn as _0x4ca6e6,IconShowChangesOff as _0x142490,IconDocument as _0x14afda,IconBoxWithCross as _0x4fa465,IconBoxWithCheck as _0x2d1e5c,IconBoxWithMarker as _0x2631af,IconInfo as _0x101fdf,IconWeb as _0x581afe,IconClose as _0x27e1ae,IconSelection as _0x2077ea,IconFileUpload as _0xf290e5,IconLink as _0x56a18a,IconBulb as _0x5c8cae,IconAI as _0x556fcc,IconPreviousArrow as _0xf8587c,IconDocumentOutline as _0x14798d,IconLoupe as _0x1e98bc,IconCancel as _0x117eb5,IconPaperClip as _0x504bdc,IconBrowseFiles as _0x209963,IconDropdownArrow as _0x54e08c,IconStop as _0x2f6727,IconAIChat as _0x2150e3,IconPlus as _0x570dd7,IconPin as _0x21152c,IconThreeHorizontalDots as _0x51f94b,IconAIReview as _0x216df5,IconAITranslate as _0x20d810,IconAIAskAI as _0x5314b2,IconThumbUp as _0x57d1a1,IconThumbDown as _0x5a6142,IconChevronDown as _0x15bb9d,IconChevronUp as _0x37ec3a,IconAIQuickActions as _0x304454,IconAIChatCommands as _0x4a1749,IconAIImproveWriting as _0x391ba8,IconAIContinueWriting as _0x484490,IconAIGrammarCheck as _0x467b86,IconAIAdjustLength as _0x50b8c6,IconAIChangeTone as _0x7cf5b3,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 _0x218843,FormHeaderView as _0x314748,HighlightedTextView as _0x25931f,ViewCollection as _0x54c5cf,FileDialogButtonView as _0x3d4235,InputTextView as _0x4f8412,SearchTextView as _0x20c15f,ListItemButtonView as _0x15de4d,ButtonLabelWithHighlightView as _0x4795a9,DropdownMenuPanelPositioningFunctions as _0x5d471b,BalloonToolbar as _0x46732f,FormRowView as _0x48770c,TextareaView as _0x4a81d5}from'@ckeditor/ckeditor5-ui/dist/index.js';import{ClipboardPipeline as _0x1b60e8,ClipboardMarkersUtils as _0x13085c}from'@ckeditor/ckeditor5-clipboard/dist/index.js';import{ViewDocumentDomEventData as _0x5c2c71,ViewDataTransfer as _0x390edf,ViewUpcastWriter as _0x7040c9,Matcher as _0x347f39,_DetachOperation as _0x2a791f,_insertIntoModelNodeList as _0x4b1c53,_removeFromModelNodeList as _0x178cab,ModelRange as _0x5258a6,transformOperationSets as _0x54e22b,ViewDowncastWriter as _0x1e54b4,ModelDocumentFragment as _0x29280d,ModelPosition as _0x55a2cf,ModelTreeWalker as _0x1a643c,MarkerOperation as _0x38a9e1,InsertOperation as _0x37092c}from'@ckeditor/ckeditor5-engine/dist/index.js';import{unescape as _0x1c4492,escape as _0xeac408,cloneDeep as _0xec0f6,escapeRegExp as _0x5517e5,debounce as _0x576441}from'es-toolkit/compat';import{BedrockRuntimeClient as _0x3b763a,InvokeModelWithResponseStreamCommand as _0x4dc0a3,InvokeModelCommand as _0x4bfb5a}from'@aws-sdk/client-bedrock-runtime';import{createParser as _0x4994b5}from'eventsource-parser';import{CloudServices as _0x271a82}from'@ckeditor/ckeditor5-cloud-services/dist/index.js';import{parseDocument as _0x47e8d7}from'htmlparser2';import{isTag as _0x17c0c2,findOne as _0x6acb98,getParent as _0x1e3861,findAll as _0x1478d3,removeElement as _0x28c1a9,replaceElement as _0x46a82a,prepend as _0xec914b,prependChild as _0x2418d7,appendChild as _0x525206,append as _0x21518e,find as _0x39fcff,isComment as _0x1832fa,getChildren as ti,textContent as _0x4db584}from'domutils';import _0x5f5c12 from'dom-serializer';import{Document as _0x11db27,Element as _0x3c2cca,Text as _0x598728,cloneNode as _0x5d6329,isDocument as _0x17c511,isText as _0x11018c,NodeWithChildren as _0x6dd3bb}from'domhandler';import{MarkdownGfmMdToHtmlDefaultPlugins as _0x23a25,MarkdownGfmMdToHtml as _0x1fd6c4}from'@ckeditor/ckeditor5-markdown-gfm/dist/index.js';import _0x22aed0 from'rehype-sanitize';import{fixElementSuggestionRange as _0x4b85e0,DocumentCompare as _0x2da15a,DATA_ID_MODEL_ATTRIBUTE as _0x34b0f5,ConfirmMixin as _0x28e9e9,LateFocusDropdownButtonView as _0x3d7cd2,getAllMarkersDomElementsSorted as _0x63d217,SuggestionsConversion as _0x891dae,DATA_ID_VIEW_ATTRIBUTE as _0x5440fe,getMarkerDomElement as _0x80cae6}from'@ckeditor/ckeditor5-collaboration-core/dist/index.js';import _0x2a04c8 from'morphdom';import{diffArrays as _0x5260b4}from'diff';const Si='_ungrouppedCommands';function bi(_0x57f58a,_0x2cf2c6){const _0x38d849=(0x0,_0x2cf2c6['t'])('Other');return _0x57f58a['length']?'groupId'in _0x57f58a[0x0]?_0x57f58a:[{'groupId':Si,'groupLabel':_0x38d849,'order':0x1/0x0,'commands':_0x57f58a}]:[{'groupId':Si,'groupLabel':_0x38d849,'order':0x1/0x0,'commands':[]}];}const Ri=globalThis['DataTransfer'],Oi='ai-ui';class ki extends _0x3e16f7{static get['pluginName'](){return'AIAssistantEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const {editor:_0x2bb769}=this,_0x51a4d7=['ck-fake-ai-selection'];_0x2bb769['config']['get']('ai.assistant.useTheme')&&_0x51a4d7['push']('ck-ai-assistant-ui_theme'),_0x2bb769['conversion']['for']('editingDowncast')['markerToHighlight']({'model':Oi,'view':{'classes':_0x51a4d7,'priority':0xc}}),_0x2bb769['conversion']['for']('editingDowncast')['markerToElement']({'model':Oi,'view':(_0x48e890,{writer:_0x42b23d})=>{if(!_0x48e890['markerRange']['isCollapsed'])return null;const _0x5d7c02=_0x42b23d['createUIElement']('span');return _0x42b23d['addClass'](['ck-fake-ai-selection','ck-fake-ai-selection_collapsed'],_0x5d7c02),_0x5d7c02;}});}['afterInit'](){!async function(_0x3b2f2d){const _0x13ee3a=_0x3288b2([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]),_0x48132b=0x3dffc4e1,_0x43b689=0x3df84019^_0x48132b,_0x26b4a4=window[_0x3288b2([0x44,0x61,0x74,0x65])][_0x3288b2([0x6e,0x6f,0x77])](),_0x5b9ed3=_0x3b2f2d[_0x3288b2([0x65,0x64,0x69,0x74,0x6f,0x72])],_0x1906ec=new window[(_0x3288b2([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x43f755=>{_0x5b9ed3[_0x3288b2([0x6f,0x6e,0x63,0x65])](_0x3288b2([0x72,0x65,0x61,0x64,0x79]),_0x43f755);}),_0x4b0f1c={[_0x3288b2([0x6b,0x74,0x79])]:_0x3288b2([0x45,0x43]),[_0x3288b2([0x75,0x73,0x65])]:_0x3288b2([0x73,0x69,0x67]),[_0x3288b2([0x63,0x72,0x76])]:_0x3288b2([0x50,0x2d,0x32,0x35,0x36]),[_0x3288b2([0x78])]:_0x3288b2([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]),[_0x3288b2([0x79])]:_0x3288b2([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]),[_0x3288b2([0x61,0x6c,0x67])]:_0x3288b2([0x45,0x53,0x32,0x35,0x36])},_0x31cfcd=_0x5b9ed3[_0x3288b2([0x63,0x6f,0x6e,0x66,0x69,0x67])][_0x3288b2([0x67,0x65,0x74])](_0x3288b2([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79]));async function _0x27a128(){let _0x5e9fcf,_0x411c06=null,_0x1101a5=null;try{if(_0x31cfcd==_0x3288b2([0x47,0x50,0x4c]))return _0x3288b2([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]);if(_0x5e9fcf=_0x3151fc(),!_0x5e9fcf)return _0x3288b2([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);return _0x5e9fcf[_0x3288b2([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])]&&(_0x1101a5=_0x29194b(_0x5e9fcf[_0x3288b2([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])],_0x5e9fcf[_0x3288b2([0x6a,0x74,0x69])])),await _0x2409ca()?_0x36c5e0()?_0x460630()?_0x3288b2([0x45,0x78,0x70,0x69,0x72,0x65,0x64]):_0x53330d()?(_0x5e9fcf[_0x3288b2([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])]==_0x3288b2([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e])&&(_0x411c06=_0x535b10(_0x3288b2([0x45,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e,0x4c,0x69,0x6d,0x69,0x74]))),await _0x3a4983()):_0x3288b2([0x44,0x6f,0x6d,0x61,0x69,0x6e,0x4c,0x69,0x6d,0x69,0x74]):_0x3288b2([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]):_0x3288b2([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}catch{return _0x3288b2([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}function _0x460630(){const _0x46c4f9=[_0x3288b2([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e]),_0x3288b2([0x74,0x72,0x69,0x61,0x6c])][_0x3288b2([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x5e9fcf[_0x3288b2([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])])?_0x26b4a4/0x3e8:0xe10*_0x43b689;return _0x5e9fcf[_0x3288b2([0x65,0x78,0x70])]<_0x46c4f9;}function _0x36c5e0(){const _0x55dcc1=_0x5e9fcf[_0x3288b2([0x66,0x65,0x61,0x74,0x75,0x72,0x65,0x73])];return!!_0x55dcc1&&(!!_0x55dcc1[_0x3288b2([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x3288b2([0x2a]))||!!_0x55dcc1[_0x3288b2([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x3288b2([0x41,0x49])));}function _0x53330d(){const _0x3e4a9a=_0x5e9fcf[_0x3288b2([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x64,0x48,0x6f,0x73,0x74,0x73])];if(!_0x3e4a9a||0x0==_0x3e4a9a[_0x3288b2([0x6c,0x65,0x6e,0x67,0x74,0x68])])return!0x0;const {hostname:_0x1d7427}=new URL(window[_0x3288b2([0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e])]['href']);if(_0x3e4a9a[_0x3288b2([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x1d7427))return!0x0;const _0x49a3e0=_0x1d7427[_0x3288b2([0x73,0x70,0x6c,0x69,0x74])](_0x3288b2([0x2e]));return _0x3e4a9a[_0x3288b2([0x66,0x69,0x6c,0x74,0x65,0x72])](_0x182067=>_0x182067[_0x3288b2([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x3288b2([0x2a])))[_0x3288b2([0x6d,0x61,0x70])](_0x65369c=>_0x65369c[_0x3288b2([0x73,0x70,0x6c,0x69,0x74])](_0x3288b2([0x2e])))[_0x3288b2([0x66,0x69,0x6c,0x74,0x65,0x72])](_0x51407e=>_0x51407e[_0x3288b2([0x6c,0x65,0x6e,0x67,0x74,0x68])]<=_0x49a3e0[_0x3288b2([0x6c,0x65,0x6e,0x67,0x74,0x68])])[_0x3288b2([0x6d,0x61,0x70])](_0x12a9aa=>Array(_0x49a3e0[_0x3288b2([0x6c,0x65,0x6e,0x67,0x74,0x68])]-_0x12a9aa[_0x3288b2([0x6c,0x65,0x6e,0x67,0x74,0x68])])[_0x3288b2([0x66,0x69,0x6c,0x6c])](_0x12a9aa[0x0]===_0x3288b2([0x2a])?_0x3288b2([0x2a]):'')[_0x3288b2([0x63,0x6f,0x6e,0x63,0x61,0x74])](_0x12a9aa))[_0x3288b2([0x73,0x6f,0x6d,0x65])](_0x353921=>_0x49a3e0[_0x3288b2([0x65,0x76,0x65,0x72,0x79])]((_0x4a697d,_0x7fc5bf)=>_0x353921[_0x7fc5bf]===_0x4a697d||_0x353921[_0x7fc5bf]===_0x3288b2([0x2a])));}function _0x3a4983(){return _0x411c06&&_0x1101a5?new window[(_0x3288b2([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0x476b9a,_0x16d456)=>{_0x411c06[_0x3288b2([0x74,0x68,0x65,0x6e])](_0x476b9a,_0x16d456),_0x1101a5[_0x3288b2([0x74,0x68,0x65,0x6e])](_0x530813=>{_0x530813!=_0x3288b2([0x56,0x61,0x6c,0x69,0x64])&&_0x476b9a(_0x530813);},_0x16d456);}):_0x411c06||_0x1101a5||_0x3288b2([0x56,0x61,0x6c,0x69,0x64]);}}function _0x29194b(_0x333ecd,_0x3b473b){return new window[(_0x3288b2([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x4cdedc=>{if(_0x21c4ec())return _0x4cdedc(_0x3288b2([0x56,0x61,0x6c,0x69,0x64]));_0x507181(),_0x5b9ed3[_0x3288b2([0x64,0x65,0x63,0x6f,0x72,0x61,0x74,0x65])](_0x3288b2([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]));let _0x294143=!0x1;const _0x5565d6=ot();function _0x142b2e(_0x40adf2){return!!_0x40adf2&&(typeof _0x40adf2===_0x3288b2([0x6f,0x62,0x6a,0x65,0x63,0x74])||typeof _0x40adf2===_0x3288b2([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]))&&typeof _0x40adf2[_0x3288b2([0x74,0x68,0x65,0x6e])]===_0x3288b2([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e])&&typeof _0x40adf2[_0x3288b2([0x63,0x61,0x74,0x63,0x68])]===_0x3288b2([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]);}function _0x10d2f5(_0x3ffb6e){_0x134bea(_0x3ffb6e)[_0x3288b2([0x74,0x68,0x65,0x6e])](_0x4175c7=>{if(!_0x4175c7||_0x4175c7[_0x3288b2([0x73,0x74,0x61,0x74,0x75,0x73])]!=_0x3288b2([0x6f,0x6b]))return _0x3288b2([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]);return _0xc8be0e(_0x12affe(_0x5565d6+_0x3b473b))!=_0x4175c7[_0x3288b2([0x76,0x65,0x72,0x69,0x66,0x69,0x63,0x61,0x74,0x69,0x6f,0x6e])]?_0x3288b2([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]):_0x3288b2([0x56,0x61,0x6c,0x69,0x64]);})[_0x3288b2([0x74,0x68,0x65,0x6e])](_0x5d7385=>(_0xa10e03(),_0x5d7385),()=>{const _0x11ef8d=_0x2a5bee();return null==_0x11ef8d?(_0xa10e03(),_0x3288b2([0x56,0x61,0x6c,0x69,0x64])):_0x3288b2(_0x26b4a4-_0x11ef8d>(0x19f340e1^_0x48132b)?[0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]:[0x56,0x61,0x6c,0x69,0x64]);})[_0x3288b2([0x74,0x68,0x65,0x6e])](_0x4cdedc)[_0x3288b2([0x63,0x61,0x74,0x63,0x68])](()=>{_0x4cdedc(_0x3288b2([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});const _0x3773bb=0x3dc92a61^_0x48132b;function _0xa10e03(){const _0x578036=_0x3288b2([0x6c,0x6c,0x63,0x74,0x2d])+_0xc8be0e(_0x12affe(_0x333ecd)),_0x1d38f2=_0x28332a(_0xc8be0e(window[_0x3288b2([0x4d,0x61,0x74,0x68])][_0x3288b2([0x63,0x65,0x69,0x6c])](_0x26b4a4/_0x3773bb)));window[_0x3288b2([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0x3288b2([0x73,0x65,0x74,0x49,0x74,0x65,0x6d])](_0x578036,_0x1d38f2);}function _0x2a5bee(){const _0x22a0c2=_0x3288b2([0x6c,0x6c,0x63,0x74,0x2d])+_0xc8be0e(_0x12affe(_0x333ecd)),_0x3abbb1=window[_0x3288b2([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0x3288b2([0x67,0x65,0x74,0x49,0x74,0x65,0x6d])](_0x22a0c2);return _0x3abbb1?window[_0x3288b2([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x28332a(_0x3abbb1),0x10)*_0x3773bb:null;}function _0x134bea(_0x44c884){return new window[(_0x3288b2([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0x36811e,_0x54e5f2)=>{_0x44c884[_0x3288b2([0x74,0x68,0x65,0x6e])](_0x36811e,_0x54e5f2),window[_0x3288b2([0x73,0x65,0x74,0x54,0x69,0x6d,0x65,0x6f,0x75,0x74])](_0x54e5f2,0x3dfe1021^_0x48132b);});}}_0x5b9ed3[_0x3288b2([0x6f,0x6e])](_0x3288b2([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),(_0x62e64c,_0x4ecf05)=>{if(_0x4ecf05[0x0]!=_0x333ecd)return _0x4cdedc(_0x3288b2([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));_0x4ecf05[0x1]={..._0x4ecf05[0x1],[_0x3288b2([0x72,0x65,0x71,0x75,0x65,0x73,0x74,0x49,0x64])]:_0x5565d6};},{[_0x3288b2([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0x3288b2([0x68,0x69,0x67,0x68])}),_0x5b9ed3[_0x3288b2([0x6f,0x6e])](_0x3288b2([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),_0x2788d5=>{_0x142b2e(_0x2788d5[_0x3288b2([0x72,0x65,0x74,0x75,0x72,0x6e])])&&(_0x294143=!0x0,_0x10d2f5(_0x2788d5[_0x3288b2([0x72,0x65,0x74,0x75,0x72,0x6e])]));},{[_0x3288b2([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0x3288b2([0x6c,0x6f,0x77])}),_0x1906ec[_0x3288b2([0x74,0x68,0x65,0x6e])](()=>{_0x294143||_0x4cdedc(_0x3288b2([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});});function _0x21c4ec(){return _0x5b9ed3[_0x3288b2([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0x3288b2([0x76,0x69,0x65,0x77])][_0x3288b2([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]==_0x3288b2([0x61,0x75,0x74,0x6f]);}function _0x507181(){_0x5b9ed3[_0x3288b2([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0x3288b2([0x76,0x69,0x65,0x77])][_0x3288b2([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]=_0x3288b2([0x61,0x75,0x74,0x6f]);}}function _0x535b10(_0x77a08f){const _0x261b75=[new window[(_0x3288b2([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x29e184=>setTimeout(_0x29e184,0x3df6fa2d^_0x48132b)),_0x1906ec[_0x3288b2([0x74,0x68,0x65,0x6e])](()=>new window[(_0x3288b2([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x267e57=>{let _0x26f0b1=0x0;_0x5b9ed3[_0x3288b2([0x6d,0x6f,0x64,0x65,0x6c])][_0x3288b2([0x6f,0x6e])](_0x3288b2([0x61,0x70,0x70,0x6c,0x79,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e]),(_0x24084c,_0x43a0ea)=>{_0x43a0ea[0x0][_0x3288b2([0x69,0x73,0x44,0x6f,0x63,0x75,0x6d,0x65,0x6e,0x74,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e])]&&_0x26f0b1++,_0x26f0b1==(0x3dffc109^_0x48132b)&&(_0x267e57(),_0x24084c[_0x3288b2([0x6f,0x66,0x66])]());});}))];return window[_0x3288b2([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65])][_0x3288b2([0x72,0x61,0x63,0x65])](_0x261b75)[_0x3288b2([0x74,0x68,0x65,0x6e])](()=>_0x77a08f);}async function _0x46c071(){await _0x1906ec,_0x5b9ed3[_0x3288b2([0x6d,0x6f,0x64,0x65,0x6c])][_0x3288b2([0x63,0x68,0x61,0x6e,0x67,0x65])]=_0xf71819,_0x5b9ed3[_0x3288b2([0x6d,0x6f,0x64,0x65,0x6c])][_0x3288b2([0x65,0x6e,0x71,0x75,0x65,0x75,0x65,0x43,0x68,0x61,0x6e,0x67,0x65])]=_0xf71819,_0x5b9ed3[_0x3288b2([0x65,0x6e,0x61,0x62,0x6c,0x65,0x52,0x65,0x61,0x64,0x4f,0x6e,0x6c,0x79,0x4d,0x6f,0x64,0x65])](_0x3288b2([0x6d,0x6f,0x64,0x65,0x6c]));}function _0x452296(_0x2cce67){const _0x2463dc=_0x197ca6();_0x5b9ed3[_0x2463dc]=_0x3288b2([0x61,0x69,0x4c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79])+_0x2cce67,_0x2cce67!=_0x3288b2([0x56,0x61,0x6c,0x69,0x64])&&_0x46c071();}function _0x197ca6(){const _0x27b786=window[_0x3288b2([0x53,0x74,0x72,0x69,0x6e,0x67])](window[_0x3288b2([0x70,0x65,0x72,0x66,0x6f,0x72,0x6d,0x61,0x6e,0x63,0x65])][_0x3288b2([0x6e,0x6f,0x77])]())[_0x3288b2([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](_0x3288b2([0x2e]),'');let _0x3da988=_0x3288b2([0x6e]);for(let _0x706460=0x0;_0x706460<_0x27b786[_0x3288b2([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0x706460+=0x2){let _0x537cd1=window[_0x3288b2([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x27b786[_0x3288b2([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0x706460,_0x706460+0x2));_0x537cd1>=_0x13ee3a[_0x3288b2([0x6c,0x65,0x6e,0x67,0x74,0x68])]&&(_0x537cd1-=_0x13ee3a[_0x3288b2([0x6c,0x65,0x6e,0x67,0x74,0x68])]),_0x3da988+=_0x13ee3a[_0x537cd1];}return _0x3da988;}function _0x3151fc(){const _0x308108=_0x31cfcd[_0x3288b2([0x73,0x70,0x6c,0x69,0x74])](_0x3288b2([0x2e]));if(0x3!=_0x308108[_0x3288b2([0x6c,0x65,0x6e,0x67,0x74,0x68])])return null;return _0x5004f9(_0x308108[0x1]);function _0x5004f9(_0x366177){const _0x4d786b=_0x55ffd9(_0x366177);return _0x4d786b&&_0x55b626()?_0x4d786b:null;function _0x55b626(){const _0x2b37c2=_0x4d786b[_0x3288b2([0x6a,0x74,0x69])],_0x503a45=window[_0x3288b2([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x2b37c2[_0x3288b2([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0x2b37c2[_0x3288b2([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8),0x10),_0x448560={..._0x4d786b,[_0x3288b2([0x6a,0x74,0x69])]:_0x2b37c2[_0x3288b2([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](0x0,_0x2b37c2[_0x3288b2([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8)};return delete _0x448560[_0x3288b2([0x76,0x63])],_0x12affe(_0x448560)==_0x503a45;}}}async function _0x2409ca(){let _0x10fda4=!0x0;try{const _0x17711b=_0x31cfcd[_0x3288b2([0x73,0x70,0x6c,0x69,0x74])](_0x3288b2([0x2e])),[_0x12843d,_0xe2a1b1,_0x847b35]=_0x17711b;return _0x3271d1(_0x12843d),await _0x1ec20e(_0x12843d,_0xe2a1b1,_0x847b35),_0x10fda4;}catch{return!0x1;}function _0x3271d1(_0x5c56c6){const _0x705c77=_0x55ffd9(_0x5c56c6);_0x705c77&&_0x705c77[_0x3288b2([0x61,0x6c,0x67])]==_0x3288b2([0x45,0x53,0x32,0x35,0x36])||(_0x10fda4=!0x1);}async function _0x1ec20e(_0x3b7942,_0x1077fd,_0x5a6174){const _0x30f01c=window[_0x3288b2([0x55,0x69,0x6e,0x74,0x38,0x41,0x72,0x72,0x61,0x79])][_0x3288b2([0x66,0x72,0x6f,0x6d])](_0x241932(_0x5a6174),_0x49433c=>_0x49433c[_0x3288b2([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](0x0)),_0x223e26=new window[(_0x3288b2([0x54,0x65,0x78,0x74,0x45,0x6e,0x63,0x6f,0x64,0x65,0x72]))]()[_0x3288b2([0x65,0x6e,0x63,0x6f,0x64,0x65])](_0x3b7942+_0x3288b2([0x2e])+_0x1077fd),_0x31d190=window[_0x3288b2([0x63,0x72,0x79,0x70,0x74,0x6f])][_0x3288b2([0x73,0x75,0x62,0x74,0x6c,0x65])];if(!_0x31d190)return;const _0x1ba338=await _0x31d190[_0x3288b2([0x69,0x6d,0x70,0x6f,0x72,0x74,0x4b,0x65,0x79])](_0x3288b2([0x6a,0x77,0x6b]),_0x4b0f1c,{[_0x3288b2([0x6e,0x61,0x6d,0x65])]:_0x3288b2([0x45,0x43,0x44,0x53,0x41]),[_0x3288b2([0x6e,0x61,0x6d,0x65,0x64,0x43,0x75,0x72,0x76,0x65])]:_0x3288b2([0x50,0x2d,0x32,0x35,0x36])},!0x1,[_0x3288b2([0x76,0x65,0x72,0x69,0x66,0x79])]);await _0x31d190[_0x3288b2([0x76,0x65,0x72,0x69,0x66,0x79])]({[_0x3288b2([0x6e,0x61,0x6d,0x65])]:_0x3288b2([0x45,0x43,0x44,0x53,0x41]),[_0x3288b2([0x68,0x61,0x73,0x68])]:{[_0x3288b2([0x6e,0x61,0x6d,0x65])]:_0x3288b2([0x53,0x48,0x41,0x2d,0x32,0x35,0x36])}},_0x1ba338,_0x30f01c,_0x223e26)||(_0x10fda4=!0x1);}}function _0x55ffd9(_0x380cfa){return _0x380cfa[_0x3288b2([0x73,0x74,0x61,0x72,0x74,0x73,0x57,0x69,0x74,0x68])](_0x3288b2([0x65,0x79]))?JSON[_0x3288b2([0x70,0x61,0x72,0x73,0x65])](_0x241932(_0x380cfa)):null;}function _0x241932(_0x4ab8b7){return window[_0x3288b2([0x61,0x74,0x6f,0x62])](_0x4ab8b7[_0x3288b2([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/-/g,_0x3288b2([0x2b]))[_0x3288b2([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/_/g,_0x3288b2([0x2f])));}function _0x12affe(_0x30b86e){let _0x169c26=0x1505;function _0x24cccf(_0xad6923){for(let _0x5a6e23=0x0;_0x5a6e23<_0xad6923[_0x3288b2([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0x5a6e23++){const _0x5eda18=_0xad6923[_0x3288b2([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](_0x5a6e23);_0x169c26=(_0x169c26<<0x5)+_0x169c26+_0x5eda18,_0x169c26&=_0x169c26;}}function _0x16888e(_0x376942){Array[_0x3288b2([0x69,0x73,0x41,0x72,0x72,0x61,0x79])](_0x376942)?_0x376942[_0x3288b2([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](_0x16888e):_0x376942&&typeof _0x376942==_0x3288b2([0x6f,0x62,0x6a,0x65,0x63,0x74])?Object[_0x3288b2([0x65,0x6e,0x74,0x72,0x69,0x65,0x73])](_0x376942)[_0x3288b2([0x73,0x6f,0x72,0x74])]()[_0x3288b2([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](([_0x5d715b,_0x2288e5])=>{_0x24cccf(_0x5d715b),_0x16888e(_0x2288e5);}):_0x24cccf(window[_0x3288b2([0x53,0x74,0x72,0x69,0x6e,0x67])](_0x376942));}return _0x16888e(_0x30b86e),_0x169c26>>>0x0;}function _0xc8be0e(_0x5256e1){return _0x5256e1[_0x3288b2([0x74,0x6f,0x53,0x74,0x72,0x69,0x6e,0x67])](0x10)[_0x3288b2([0x70,0x61,0x64,0x53,0x74,0x61,0x72,0x74])](0x8,_0x3288b2([0x30]));}function _0x28332a(_0x428c32){return _0x428c32[_0x3288b2([0x73,0x70,0x6c,0x69,0x74])]('')[_0x3288b2([0x72,0x65,0x76,0x65,0x72,0x73,0x65])]()[_0x3288b2([0x6a,0x6f,0x69,0x6e])]('');}function _0xf71819(){}function _0x3288b2(_0x44c316){return _0x44c316['map'](_0x32cf6f=>String['fromCharCode'](_0x32cf6f))['join']('');}_0x452296(await _0x27a128());}(this);}['showFakeVisualSelection'](){const _0x90df94=this['editor']['model'];_0x90df94['change'](_0x1cf9af=>{const _0x5c9161=_0x90df94['document']['selection']['getRanges']();let _0x49b612=0x0;for(const _0x317759 of _0x5c9161){const _0x6c6609=Oi+':'+_0x49b612;if(_0x90df94['markers']['has'](_0x6c6609))_0x1cf9af['updateMarker'](_0x6c6609,{'range':_0x317759});else{if(_0x317759['start']['isAtEnd']){const _0x2d58a6=_0x317759['start']['getLastMatchingPosition'](({item:_0x2549f7})=>!_0x90df94['schema']['isContent'](_0x2549f7),{'boundaries':_0x317759});_0x1cf9af['addMarker'](_0x6c6609,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x1cf9af['createRange'](_0x2d58a6,_0x317759['end'])});}else _0x1cf9af['addMarker'](_0x6c6609,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x317759});}_0x49b612++;}});}['hideFakeVisualSelection'](){const _0x2a8b25=this['editor']['model'],_0x396498=Array['from'](this['editor']['model']['markers']['getMarkersGroup'](Oi));_0x396498['length']&&_0x2a8b25['change'](_0x4779af=>{_0x396498['forEach'](_0x4f473d=>{_0x4779af['removeMarker'](_0x4f473d);});});}['insertContent'](_0x45849a,_0x4ece09){const _0x355343=this['_getAISelection'](),_0x2474bd=_0x4ece09||_0x355343['getFirstRange']();this['editor']['model']['canEditAt'](_0x2474bd)&&this['editor']['model']['change'](_0x2dbea4=>{this['hideFakeVisualSelection'](),_0x4ece09||this['_resetContentOfSelectedTableCells'](_0x2dbea4,_0x355343),this['_pasteHTMLUsingClipboard']({'insertAt':_0x2474bd,'writer':_0x2dbea4,'html':_0x45849a});});}['insertContentBelow'](_0xf5c12c){const {model:_0x42b530}=this['editor'],_0x446c51=this['_getAISelection']();_0x42b530['change'](()=>{const _0x57a5a1=this['_prepareTableInsertBelowPosition'](_0xf5c12c,_0x446c51)||this['_getDefaultInsertBelowPosition'](_0x446c51);this['insertContent'](_0xf5c12c,_0x57a5a1);});}['_getAISelection'](){const _0x139787=this['editor']['model'],_0x3b574c=Array['from'](_0x139787['markers']['getMarkersGroup'](Oi))['map'](_0x488396=>_0x488396['getRange']());return _0x139787['createSelection'](_0x3b574c);}['_pasteHTMLUsingClipboard']({writer:_0x128bc3,html:_0x2dd1be,insertAt:_0x128b39}){const {view:_0xbc23fd}=this['editor']['editing'],_0x398efa=this['editor']['plugins']['get'](_0x1b60e8),_0x3f5cec=new Ri();_0x3f5cec['setData']('text/html',_0x2dd1be);const _0xa722f8=new ClipboardEvent('paste',{'clipboardData':_0x3f5cec}),_0x56f9a4=new _0x5c2c71(_0xbc23fd,_0xa722f8,{'dataTransfer':new _0x390edf(_0x3f5cec)});_0x128bc3['setSelection'](_0x128b39);const _0x244d6d=(_0x395f93,_0x2c1754)=>{_0x2c1754['resultRange']&&_0x128bc3['setSelection'](_0x2c1754['resultRange']);};_0x398efa['once']('contentInsertion',_0x244d6d,{'priority':'lowest'}),_0xbc23fd['document']['fire']('paste',_0x56f9a4),_0x398efa['off']('contentInsertion',_0x244d6d);}['_getDefaultInsertBelowPosition'](_0x5660e9){const {model:_0xb9f50e}=this['editor'],_0x284b5f=Array['from'](_0x5660e9['getSelectedBlocks']());return _0x284b5f['length']?_0xb9f50e['createPositionAfter'](_0x284b5f['pop']()):_0x5660e9['getLastPosition']();}['_prepareTableInsertBelowPosition'](_0x1e7ba9,_0xd9acff){const {model:_0xe2d690,plugins:_0x46b828}=this['editor'];if(_0x46b828['has']('TableUtils')){const _0x433feb=_0x46b828['get']('TableUtils')['getSelectedTableCells'](_0xd9acff);if(_0x433feb['length']){const _0x1e2639=this['_getTableRowCountFromContent'](_0x1e7ba9),_0x1e3ffe=this['_createEmptyTableRows'](_0x433feb,_0x1e2639);return _0xe2d690['createPositionAt'](_0x1e3ffe,0x0);}}return null;}['_getTableRowCountFromContent'](_0x46774a){const _0x2ca288=this['editor']['plugins']['get']('TableUtils'),_0x43b09e=this['editor']['data']['parse'](_0x46774a),_0x78248b=Array['from'](_0x43b09e['getChildren']())['filter'](_0x5f20e3=>_0x5f20e3['is']('element','table'));let _0x57dbe8=0x0;return _0x78248b['forEach'](_0x10bed3=>{_0x57dbe8+=_0x2ca288['getRows'](_0x10bed3);}),_0x57dbe8;}['_createEmptyTableRows'](_0x4fc456,_0x50cfc9){const _0x319ee2=this['editor']['plugins']['get']('TableUtils'),_0x29dcdf=_0x319ee2['getRowIndexes'](_0x4fc456),_0x10a058=_0x319ee2['getColumnIndexes'](_0x4fc456),_0x4f7910=_0x29dcdf['last']+0x1,_0xc4248b=_0x10a058['first'],_0xedae6=_0x4fc456[0x0]['findAncestor']('table');for(let _0x2dd331=0x0;_0x2dd331<_0x50cfc9;_0x2dd331++)_0x319ee2['insertRows'](_0xedae6,{'at':_0x4f7910});return _0xedae6['getChild'](_0x4f7910)['getChild'](_0xc4248b);}['_resetContentOfSelectedTableCells'](_0x309054,_0x314076){const {plugins:_0x32fa24}=this['editor'],{model:_0x5024d2}=_0x309054;if(!_0x32fa24['has']('TableUtils'))return;_0x32fa24['get']('TableUtils')['getSelectedTableCells'](_0x314076)['length']&&_0x5024d2['deleteContent'](_0x314076);}}class Ni extends _0x3e16f7{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(_0x42c788){super(_0x42c788),this['name']='AIRequestError';}}function yi(_0x2f030a,_0x625622,_0x3845ed){const t=_0x2f030a['t'];switch(_0x625622){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',_0x3845ed);case'Error\x20during\x20AI\x20content\x20generation:\x20%0':return t('Error\x20during\x20AI\x20content\x20generation:\x20%0',_0x3845ed);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'},_0x3845ed);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 _0x625622;}}class xi extends _0x1e6161{['_commandDefinitions'];constructor(_0x37ac65,_0x163e41){super(_0x37ac65),this['_commandDefinitions']=_0x163e41,this['set']('enabledCommandsIds',[]),this['on']('change:_hasContext',(_0x3b8cf1,_0x34b381,_0x11b6fa)=>{this['isEnabled']&&(this['enabledCommandsIds']=Li(this['_commandDefinitions'],_0x11b6fa));}),this['set']('_hasContext',!0x1),this['on']('change:isEnabled',(_0x354234,_0x299c07,_0x155399)=>{this['enabledCommandsIds']=_0x155399?Li(this['_commandDefinitions'],this['_hasContext']):[];});}['refresh'](){const _0x55afbd=this['editor']['model'];this['_hasContext']=function(_0x488822){const _0xc9ba46=_0x488822['document']['selection'];return _0xc9ba46['isCollapsed']?0x0!==[..._0xc9ba46['getSelectedBlocks']()]['length']&&![..._0xc9ba46['getSelectedBlocks']()][0x0]['isEmpty']:!!_0x488822['hasContent'](_0xc9ba46['getFirstRange']());}(_0x55afbd);const _0x4d174a=_0x55afbd['document']['selection'],_0x44871e=this['editor']['config']['get']('ai.assistant.disabledElements');for(const _0xc556d6 of _0x4d174a['getRanges']())for(const _0x24b810 of _0xc556d6['getItems']())if(_0x24b810['is']('element')&&_0x44871e['includes'](_0x24b810['name']))return void(this['isEnabled']=!0x1);this['isEnabled']=!0x0;}['execute'](_0x190dae='',_0x4f4b52='',_0xd50a34='custom'){this['editor']['plugins']['get'](Xi)['showUI'](_0x190dae,_0x4f4b52,_0xd50a34);}}function Li(_0x5cf325,_0x3982d8){const _0xe1a558=new Set();for(const _0x1a9744 of _0x5cf325['values']())(_0x3982d8||!0x1===_0x1a9744['requiresContent'])&&_0xe1a558['add'](_0x1a9744['id']);return Array['from'](_0xe1a558);}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(_0x1ecc4e,_0x406f84,_0x3a468a){super(),this['editor']=_0x1ecc4e,this['textAdapter']=_0x406f84,this['_sanitizationContainer']=document['createElement']('div'),this['_domParser']=new DOMParser(),this['_xmlSerializer']=new XMLSerializer(),this['view']=_0x3a468a,this['set']({'initialContext':'','currentContext':'','currentResponse':'','previousContext':void 0x0,'previousQuery':void 0x0,'previousLabel':void 0x0,'isProcessing':!0x1}),this['on']('set:currentContext',(_0x598aae,_0x165667,_0x23e3af)=>{this['view']['value']=this['_sanitizeHTML'](_0x23e3af);}),this['listenTo'](this['view'],'submitPrompt',(_0x48581,_0x175030)=>{const _0x50cce9=this['currentContext']||this['initialContext'];this['_handleQuery'](_0x175030,_0x50cce9,'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:_0x14ba0,query:_0x33b74d,htmlContent:_0x39bbdd,label:_0xca3927,mainActionLabel:_0x5efd09}){this['view']['prompt']=_0xca3927,this['view']['mainAction']=_0x5efd09,this['initialContext']=_0x39bbdd,_0x33b74d&&(this['view']['isRendered']?this['_handleQuery'](_0x33b74d,_0x39bbdd,_0x14ba0,_0xca3927):this['view']['once']('render',()=>{this['_handleQuery'](_0x33b74d,_0x39bbdd,_0x14ba0,_0xca3927);}));}['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'](_0x3957cd,_0x54b067,_0x32cf4e,_0x2f0210){return this['isProcessing']=!0x0,this['view']['startProcessing'](),this['previousContext']=_0x54b067,this['previousQuery']=_0x3957cd,this['previousLabel']=_0x2f0210||_0x3957cd,this['previousActionId']=_0x32cf4e,new Promise(_0x3bac15=>{this['textAdapter']['makeRequest']({'query':_0x3957cd,'context':_0x54b067,'onData':_0x322a82=>{this['currentResponse']=_0x322a82,this['currentContext']=this['_parseAndNormalizeContent'](this['currentResponse']);},'actionId':_0x32cf4e})['then'](()=>{!this['currentContext']&&this['currentResponse']&&(this['currentContext']=this['_parseAndNormalizeContent'](this['currentResponse'],!0x0));})['catch'](_0x11cbb5=>{_0x11cbb5 instanceof vi?this['view']['handleError'](_0x11cbb5['message']):this['view']['handleError'](),_0x3bac15();})['finally'](()=>{this['stopProcessing'](),_0x3bac15();});});}['_parseAndNormalizeContent'](_0x327302,_0x4b401d=!0x1){const _0x4ee48e=Di['exec'](_0x327302);_0x327302=_0x4ee48e?_0x327302['substring'](_0x4ee48e[0x1]['length']):_0x327302['length']<0x64&&!_0x4b401d?'':this['_stripMarkdownSyntax'](_0x327302);const _0x2b7c6f=this['_domParser']['parseFromString'](_0x327302,'text/html');if(_0x4ee48e){const _0x9451cf=Array['from'](_0x2b7c6f['body']['childNodes']);_0x9451cf['reverse']();for(const _0x555804 of _0x9451cf){if(_0x555804['nodeType']==Node['ELEMENT_NODE'])break;_0x555804['remove']();}}const _0x5297a8=this['editor']['data']['processor']['toView'](this['_xmlSerializer']['serializeToString'](_0x2b7c6f['body']));this['_isH1TagSupportEnabled']()||this['_normalizeResponseHeadings'](_0x5297a8);const _0x19d4ae=this['editor']['config']['get']('ai.assistant.preserveComments'),_0x5c4d04=this['editor']['data']['toModel'](_0x5297a8);return _0x19d4ae||_0x5c4d04['markers']['clear'](),this['editor']['data']['stringify'](_0x5c4d04);}['_normalizeResponseHeadings'](_0x543579){const _0x16d308=new _0x7040c9(this['editor']['editing']['view']['document']),_0x2654d0=new _0x347f39({'name':/^h[1-5]$/}),_0x562b9f=[];let _0x211141=!0x1;for(const _0xae7264 of _0x543579)_0xae7264['is']('element')&&_0x2654d0['match'](_0xae7264)&&(_0x562b9f['push'](_0xae7264),'h1'==_0xae7264['name']&&(_0x211141=!0x0));if(_0x211141){for(const _0x58f22f of _0x562b9f)_0x16d308['rename']('h'+(parseInt(_0x58f22f['name'][0x1])+0x1),_0x58f22f);}}['_isH1TagSupportEnabled'](){const {data:_0x193135,editing:_0x4d4666}=this['editor'],_0x539c12=_0x193135['htmlProcessor']['toView']('<h1></h1>'),_0x4201d5=_0x193135['toView'](_0x193135['toModel'](_0x539c12));return!!_0x4d4666['view']['domConverter']['viewToDom'](_0x4201d5)['querySelector']('h1');}['_sanitizeHTML'](_0x2955e8){return this['editor']['editing']['view']['domConverter']['setContentOf'](this['_sanitizationContainer'],_0x2955e8),this['_sanitizationContainer']['innerHTML'];}['_stripMarkdownSyntax'](_0x3db1eb){const _0x3f190e=_0x3db1eb['trim']();return _0x3f190e['startsWith']('```html')?_0x3f190e['endsWith']('```')?_0x3f190e['substring'](0x7,_0x3f190e['length']-0x3):_0x3f190e['substring'](0x7):_0x3db1eb;}}const Hi={'REPLACE':'replace','INSERT':'insert'};class Mi extends kt{constructor(_0x210dd6){super(_0x210dd6),this['set']('isVisible',!0x1),this['set']('mainAction',Hi['REPLACE']),this['replaceButton']=this['_createButton']('','ck-button-action'),this['replaceButton']['bind']('label')['to'](this,'mainAction',_0x5266e5=>yi(_0x210dd6,'AI_'+_0x5266e5['toUpperCase']()+'_CONTENT')),this['insertButton']=this['_createButton'](yi(_0x210dd6,'Insert\x20below')),this['tryAgainButton']=this['_createButton'](yi(_0x210dd6,'Try\x20again')),this['stopButton']=this['_createButton'](yi(_0x210dd6,'Stop'));const _0x2cddcc=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':['ck-ai-form__toolbar',_0x2cddcc['if']('isVisible','ck-hidden',_0x424bb3=>!_0x424bb3)]}}),this['items']['addMany']([this['replaceButton'],this['insertButton'],this['tryAgainButton'],this['stopButton']]);}['_createButton'](_0x2305de,_0x165c97){const _0x1b69cd=new Nt(this['locale']);return _0x1b69cd['set']({'label':_0x2305de,'class':_0x165c97||'','isVisible':!0x0,'withText':!0x0}),_0x1b69cd;}}class Ui extends vt{['contentFieldView'];['copyButtonView'];constructor(_0x5155d3,_0x3b4ba3=''){super(_0x5155d3),this['set']({'value':null,'isVisible':!0x1,'isProcessing':!0x1});const _0x11450a=this['bindTemplate'];this['contentFieldView']=new Vi(_0x5155d3,_0x3b4ba3),this['copyButtonView']=this['_createCopyButton'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area-wrapper',_0x11450a['if']('isVisible','ck-hidden',_0x39e343=>!_0x39e343)],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area',_0x11450a['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 _0x73fc75=!0x1;this['on']('change:value',(_0x22b032,_0x19f389,_0x5d50dc)=>{const _0x1ff8b1=!this['contentFieldView']['element']['querySelector']('.ck-ai-form__loader');this['contentFieldView']['setContent'](_0x5d50dc),this['isProcessing']&&_0x1ff8b1&&!_0x73fc75&&this['element']['scrollTo']({'top':this['element']['scrollHeight'],'behavior':'smooth'});}),this['on']('change:isProcessing',(_0x4aad76,_0x53824f,_0x27356e)=>{_0x73fc75=!0x1,_0x27356e?(this['value']=null,this['contentFieldView']['appendLoader']()):this['value']||this['contentFieldView']['setContent']('');}),this['listenTo'](this['element'],'wheel',()=>{_0x73fc75=!0x0;}),this['listenTo'](this['element'],'mousedown',()=>{_0x73fc75=!0x0;});}['focus'](){this['element']['focus']();}['_createCopyButton'](){const _0x5ad71b=this['locale'],_0x3e7e8c=new Nt(this['locale']),_0x479751='ck-ai-form__copy-button';return _0x3e7e8c['set']({'label':yi(_0x5ad71b,'Copy'),'icon':_0x28e3cb,'class':_0x479751,'tooltip':!0x0}),_0x3e7e8c['bind']('isVisible')['to'](this,'value',_0x48808c=>!!_0x48808c),_0x3e7e8c['bind']('isEnabled')['to'](this,'isProcessing',_0x1c9af8=>!_0x1c9af8),_0x3e7e8c['on']('execute',()=>{this['_copyHTMLToClipboard'](this['contentFieldView']['element']),_0x3e7e8c['icon']=_0x389cff,_0x3e7e8c['class']=_0x479751+'\x20ck-ai-form__copy-button--copied',this['focus'](),setTimeout(()=>{_0x3e7e8c['icon']=_0x28e3cb,_0x3e7e8c['class']=_0x479751;},0x3e8);}),_0x3e7e8c;}['_copyHTMLToClipboard'](_0x2084c3){const {window:_0x33f436,document:_0xf4e490}=lt;if(_0x33f436['ClipboardItem']){const {Blob:_0x16fd59,ClipboardItem:_0x355f50}=_0x33f436,_0x33dd08=[new _0x355f50({'text/html':new _0x16fd59([_0x2084c3['innerHTML']],{'type':'text/html'}),'text/plain':new _0x16fd59([_0x2084c3['textContent']||''],{'type':'text/plain'})})];navigator['clipboard']['write'](_0x33dd08);}else{const _0x56cc43=_0xf4e490['createElement']('div');_0x56cc43['style']['position']='absolute',_0x56cc43['style']['left']='-9999px',_0x56cc43['innerHTML']='<span>[</span>'+_0x2084c3['innerHTML']+'<span>]</span>',_0xf4e490['body']['appendChild'](_0x56cc43);const _0x589768=_0xf4e490['createRange']();_0x589768['setStartAfter'](_0x56cc43['firstElementChild']),_0x589768['setEndBefore'](_0x56cc43['lastElementChild']);const _0x4abb9e=_0x33f436['getSelection']();_0x4abb9e['removeAllRanges'](),_0x4abb9e['addRange'](_0x589768),_0xf4e490['execCommand']('copy'),_0x56cc43['remove']();}}}class Vi extends vt{constructor(_0x4ceb78,_0x8abc26=''){super(_0x4ceb78),this['loaderView']=this['_createLoader'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-content',_0x8abc26,'ck-reset_all-excluded','ck-ai-form__content-field']}});}['setContent'](_0x580aa3){this['element']['innerHTML']=_0x580aa3;}['appendLoader'](){this['element']['appendChild'](this['loaderView']['element']);}['_createLoader'](){const _0x578910=new vt(),_0x3e67a1=this['locale'],_0x330ef4=new yt();return _0x330ef4['isVisible']=!0x0,_0x578910['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__loader']},'children':[_0x330ef4,{'text':yi(_0x3e67a1,'AI\x20is\x20writing...')}]}),_0x578910['render'](),_0x578910;}}class Bi extends vt{constructor(_0xdc3a0b,_0x1e6d66=''){super(_0xdc3a0b);const _0x17e43a=new xt(),_0x50a559=this['bindTemplate'];this['set']('text',_0x1e6d66),_0x17e43a['content']=_0x2bc3b3,this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__error']},'children':[_0x17e43a,{'text':_0x50a559['to']('text')}]});}}class Gi extends Lt{['submitButtonView'];['showHistoryButtonView'];constructor(_0x41a803,_0x1ceb43){super(_0x41a803,_0x1ceb43),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',(_0x16a31b,_0x56f913)=>{_0x16a31b['target']==this['queryView']['fieldView']['element']&&(this['submit'](),_0x56f913());});}['_createSubmitButton'](){const _0x3878e5=new Nt(this['locale']),_0x46ee05=this['locale'];return _0x3878e5['set']({'icon':_0x1e545f,'label':yi(_0x46ee05,'Submit'),'isVisible':!0x0,'tooltip':!0x0,'class':'ck-ai-form__submit'}),_0x3878e5['on']('execute',()=>{this['submit']();}),_0x3878e5['bind']('isEnabled')['to'](this['queryView']['fieldView'],'isEmpty',this,'isEnabled',(_0x80921e,_0x447352)=>!_0x80921e&&_0x447352),_0x3878e5;}['_createShowHistoryButton'](){const _0x243e04=new Nt(this['locale']),_0x3ee0e6=this['resultsView'],_0x1cf0b8=this['locale'];_0x243e04['set']({'label':yi(_0x1cf0b8,'History'),'withText':!0x1,'icon':_0x2581c0,'tooltip':!0x0,'tooltipPosition':'sw','class':'ck-ai-form__toggle-history'}),_0x243e04['bind']('isOn')['to'](_0x3ee0e6,'isVisible'),_0x243e04['bind']('isEnabled')['to'](this,'isEnabled'),_0x243e04['on']('execute',()=>{_0x3ee0e6['isVisible']=!_0x3ee0e6['isVisible'],_0x3ee0e6['isVisible']?this['filteredView']['focus']():this['focus']();});const _0x1e1817=()=>{lt['window']['requestAnimationFrame'](()=>{if(ut(this['element'])){const _0x15b91d=new dt(this['queryView']['fieldView']['element']),_0x253e0a=_0x15b91d['width'],_0x48085c='rtl'===_0x1cf0b8['uiLanguageDirection']?'left':'right';_0x15b91d['excludeScrollbarsAndBorders'](),_0x243e04['element']['style'][_0x48085c]=_0x253e0a-_0x15b91d['width']+0x1+'px';}});};return this['queryView']['fieldView']['on']('update',_0x1e1817),this['on']('render',_0x1e1817),_0x243e04;}['submit'](){const _0x24d539=this['queryView']['fieldView']['element']['value'];this['fire']('submit',_0x24d539);}['focus'](_0x16dfac){-0x1===_0x16dfac?this['focusCycler']['focusLast']():this['focusCycler']['focusFirst']();}}class Fi extends Dt{['historyGroupView'];['clearHistoryButton'];constructor(_0x4cc0ba){super(_0x4cc0ba),this['clearHistoryButton']=this['_createClearHistoryButton'](),this['historyGroupView']=new Pt(),this['historyGroupView']['children']['add'](this['clearHistoryButton'],0x1),this['historyGroupView']['label']=yi(_0x4cc0ba,'Prompt\x20history'),this['historyGroupView']['items']['delegate']('execute')['to'](this),this['items']['add'](this['historyGroupView']);}['filter'](){let _0x5abbd2=0x0;for(const _0x19f7ad of this['items'])_0x5abbd2+=_0x19f7ad['items']['length'];return{'resultsCount':_0x5abbd2,'totalItemsCount':_0x5abbd2};}['_createClearHistoryButton'](){const _0xc4c659=this['locale'],_0x3f7f0f=new Nt(this['locale']);return _0x3f7f0f['set']({'label':'('+yi(_0xc4c659,'Clear')+')','withText':!0x0}),_0x3f7f0f['on']('execute',()=>this['fire']('clearHistory')),_0x3f7f0f;}}class Ki extends Ht{constructor(_0x2eab4f){super();const _0x279f66=new Mt(),_0x20ad6d=new Nt(this['locale'],_0x279f66);this['children']['add'](_0x20ad6d),_0x20ad6d['set']({'label':_0x2eab4f['prompt'],'withText':!0x0}),_0x20ad6d['on']('execute',()=>{this['fire']('execute',{'value':_0x1c4492(_0x2eab4f['prompt'])});});}}const Wi='CKEditor/AIFormView/PromptHistory';class Yi extends _t{constructor(){super(),this['_loadFromSessionStorage'](),this['on']('add',(_0x5561e5,_0x551230)=>{const _0x5656d=$i(_0x551230['prompt']);for(const _0x409de4 of this)if(_0x409de4!=_0x551230&&$i(_0x409de4['prompt'])===_0x5656d){this['remove'](_0x409de4);break;}this['length']>0x14&&this['remove'](this['last']),this['_saveToSessionStorage']();}),this['on']('remove',()=>{this['_saveToSessionStorage']();});}['_loadFromSessionStorage'](){const _0x187065=sessionStorage['getItem'](Wi)||'[]';this['addMany'](JSON['parse'](_0x187065));}['_saveToSessionStorage'](){sessionStorage['setItem'](Wi,JSON['stringify'](this['map'](_0xe7c940=>_0xe7c940)));}}function $i(_0x2c077d){return _0x2c077d['toLowerCase']()['trim']();}class qi extends vt{['focusTracker'];['keystrokes'];['contentArea'];['toolbar'];['promptView'];['errorView'];['_focusables'];['focusCycler'];['_promptHistory'];constructor(_0x54f0c7,_0x348ff2,_0x447856=''){super(_0x54f0c7),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(_0x54f0c7),this['contentArea']=new Ui(_0x54f0c7,_0x447856),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 _0x5637f5=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form',_0x348ff2],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-form-content']},'children':[{'tag':'div','attributes':{'class':[_0x5637f5['if']('isError','ck-hidden',_0x3a9ea1=>!_0x3a9ea1)]},'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'](_0x30f1f4=0x1){-0x1===_0x30f1f4?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 _0x19ab55=this['locale'],_0x5e1ac3=new Gi(_0x19ab55,{'queryView':{'label':yi(_0x19ab55,'Ask\x20AI\x20to\x20edit\x20or\x20generate'),'creator':Vt,'showIcon':!0x1,'showResetButton':!0x1},'infoView':{'text':{'noSearchableItems':{'primary':yi(_0x19ab55,'Empty\x20history'),'secondary':yi(_0x19ab55,'Ask\x20AI\x20and\x20your\x20prompts\x20will\x20be\x20listed\x20here\x20for\x20you\x20to\x20use\x20later.')}}},'filteredView':this['_createHistoryView'](),'queryMinChars':0x1/0x0,'resetOnBlur':!0x1});return _0x5e1ac3['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',(_0x2fae80,_0x50a75a)=>_0x2fae80&&!_0x50a75a),this['listenTo'](_0x5e1ac3,'submit',(_0x5481c6,_0x1d59d0)=>{this['prompt']=_0x1d59d0;const _0x58b12e=_0xeac408(_0x1d59d0);this['fire']('submitPrompt',_0x58b12e),_0x1d59d0['trim']()&&this['_promptHistory']['add']({'prompt':_0x58b12e},0x0);},{'priority':'high'}),_0x5e1ac3;}['_createHistoryView'](){const _0x26e058=new Fi(this['locale']);return _0x26e058['historyGroupView']['items']['bindTo'](this['_promptHistory'])['as'](Ki),_0x26e058['on']('clearHistory',()=>{this['_promptHistory']['clear'](),this['promptView']['search'](''),this['promptView']['focus']();}),_0x26e058;}['_createToolbar'](){const _0x3e080b=new Mi(this['locale']);return _0x3e080b['replaceButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',this,'value',(_0xbc34a0,_0x23579a,_0xbb3fde)=>_0xbc34a0&&!_0x23579a&&!!_0xbb3fde),_0x3e080b['replaceButton']['delegate']('execute')['to'](this,'replaceContent'),_0x3e080b['insertButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',this,'value',(_0x16ec69,_0x123ece,_0x25beec)=>_0x16ec69&&!_0x123ece&&!!_0x25beec),_0x3e080b['insertButton']['delegate']('execute')['to'](this,'insertContentBelow'),_0x3e080b['tryAgainButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',(_0x59e9d3,_0x402d70)=>_0x59e9d3&&!_0x402d70),_0x3e080b['tryAgainButton']['delegate']('execute')['to'](this,'tryAgainEvent'),_0x3e080b['stopButton']['bind']('isEnabled')['to'](this,'isProcessing'),_0x3e080b['stopButton']['delegate']('execute')['to'](this,'stopProcessing'),_0x3e080b;}['startProcessing'](){this['value']='',this['isError']=!0x1,this['isProcessing']=!0x0,this['contentArea']['isVisible']=!0x0,this['toolbar']['isVisible']=!0x0,this['contentArea']['focus']();}['finishProcessing'](){const _0x36aa88=this['locale'];this['isProcessing']=!0x1,this['prompt']='',this['promptView']['reset'](),this['value']&&(this['promptView']['queryView']['label']=yi(_0x36aa88,'Ask\x20AI\x20to\x20improve\x20generated\x20text'));}['handleError'](_0x563d49){const _0x518e00=this['locale'];this['finishProcessing'](),this['isError']=!0x0,this['errorView']['text']=_0x563d49||yi(_0x518e00,'AI_ERROR_FAILED'),this['value']||(this['contentArea']['isVisible']=!0x1);}}const Qi=globalThis['DataTransfer'];class Xi extends _0x3e16f7{['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[_0x13085c,ki,Ni,Bt];}constructor(_0x48af40){super(_0x48af40),_0x48af40['config']['define']('ai.assistant.disabledElements',['media','rawHtml','tableOfContents']),_0x48af40['config']['define']('ai.assistant.contentAreaCssClass',''),_0x48af40['config']['define']('ai.assistant.useTheme',!0x0),this['_uiCssClasses']='ck-ai-assistant-ui'+(_0x48af40['config']['get']('ai.assistant.useTheme')?'\x20ck-ai-assistant-ui_theme':'');}['init'](){const {editor:_0x33f67f}=this;this['_aiAdapter']=_0x33f67f['plugins']['get'](Ni),this['_dialog']=_0x33f67f['plugins']['get'](Bt),this['_formView']=null,this['_commandDefinitions']=this['_getResolvedCommandsDefinitions']();const _0x3fdc80=new xi(_0x33f67f,Array['from'](this['_commandDefinitions']['values']()));_0x33f67f['commands']['add']('showAIAssistant',_0x3fdc80),_0x33f67f['ui']['componentFactory']['add']('aiCommands',_0x48cd7b=>{const _0x332418=Gt(_0x48cd7b);return _0x332418['set']({'class':'ck-ai-commands-dropdown\x20'+this['_uiCssClasses']}),_0x332418['buttonView']['set']({'label':yi(_0x48cd7b,'AI\x20Commands'),'icon':_0x490c4e,'tooltip':!0x0}),_0x332418['on']('execute',_0x10ad86=>this['_onExecute'](_0x10ad86['source']['id'])),Ft(_0x332418,_0x33f67f['ui']['view']['body'],function(_0x276b32){const _0x2c4df8=bi(_0x276b32['config']['get']('ai.assistant.commands'),_0x276b32['locale']),_0x4d0ce4=ji(_0x276b32,_0x2c4df8)['filter'](_0x535d0f=>_0x535d0f['commands']['length']);if(0x1===_0x4d0ce4['length'])return ji(_0x276b32,_0x4d0ce4[0x0]['commands'])['map'](_0x5b15b6=>({'id':_0x5b15b6['id'],'label':_0x5b15b6['label']}));return _0x4d0ce4['map'](_0x3ae20a=>{const {groupId:_0x49fa89,groupLabel:_0x19daaa,commands:_0x3545c2}=_0x3ae20a,_0x7b3f8c=ji(_0x276b32,_0x3545c2)['map'](_0x264c68=>({'id':_0x264c68['id'],'label':_0x264c68['label']}));return{'id':_0x49fa89,'menu':_0x19daaa||_0x49fa89,'children':_0x7b3f8c};});}(_0x33f67f),{'ariaLabel':yi(_0x48cd7b,'AI\x20Commands')}),_0x332418['menuView']['menuPanelClass']='ck-ai-commands-dropdown\x20'+this['_uiCssClasses'],_0x3fdc80['on']('change:enabledCommandsIds',_0xacc01a),_0x332418['menuView']['once']('render',_0xacc01a),_0x332418;function _0xacc01a(){_0x332418['isEnabled']=_0x3fdc80['enabledCommandsIds']['length']>0x0;for(const _0x119624 of _0x332418['menuView']['buttons'])_0x119624['isEnabled']=_0x3fdc80['enabledCommandsIds']['includes'](_0x119624['id']);}}),_0x33f67f['ui']['componentFactory']['add']('menuBar:aiCommands',_0x2afb61=>{const _0xa19db3=new Kt(_0x2afb61);_0xa19db3['buttonView']['set']({'label':yi(_0x2afb61,'AI\x20Commands'),'icon':_0x490c4e}),_0xa19db3['bind']('isEnabled')['to'](_0x3fdc80,'enabledCommandsIds',_0x2eee86=>_0x2eee86['length']>0x0);const _0x4497ef=bi(_0x33f67f['config']['get']('ai.assistant.commands'),_0x2afb61);return this['_populateMenuBarMenu'](_0x3fdc80,_0xa19db3,_0x4497ef,_0xb4e5f7=>this['_onExecute'](_0xb4e5f7)),_0xa19db3;}),_0x33f67f['ui']['componentFactory']['add']('aiAssistant',()=>{const _0x348cfd=this['_createAIAssistantUIButton'](Nt);return _0x348cfd['set']({'tooltip':!0x0,'class':'ck-ai-assistant-button\x20'+this['_uiCssClasses']}),_0x348cfd;}),_0x33f67f['ui']['componentFactory']['add']('menuBar:aiAssistant',()=>{const _0x4b7962=this['_createAIAssistantUIButton'](Wt);return _0x4b7962['set']({'role':'menuitemcheckbox'}),_0x4b7962;}),this['licenseKey']=this['editor']['config']['get']('licenseKey');const _0x17c53b=this['editor'];this['_licenseKeyCheckInterval']=setInterval(()=>{let _0x4b6fc8;for(const _0x2a375b in _0x17c53b){const _0x2b4b38=_0x2a375b,_0x510f2c=_0x17c53b[_0x2b4b38];if('aiLicenseKeyValid'==_0x510f2c||'aiLicenseKeyInvalid'==_0x510f2c||'aiLicenseKeyExpired'==_0x510f2c||'aiLicenseKeyDomainLimit'==_0x510f2c||'aiLicenseKeyNotAllowed'==_0x510f2c||'aiLicenseKeyEvaluationLimit'==_0x510f2c||'aiLicenseKeyUsageLimit'==_0x510f2c){delete _0x17c53b[_0x2b4b38],_0x4b6fc8=_0x510f2c,clearInterval(this['_licenseKeyCheckInterval']),this['_licenseKeyCheckInterval']=void 0x0;break;}}'aiLicenseKeyInvalid'==_0x4b6fc8&&_0x17c53b['_showLicenseError']('invalid'),'aiLicenseKeyExpired'==_0x4b6fc8&&_0x17c53b['_showLicenseError']('expired'),'aiLicenseKeyDomainLimit'==_0x4b6fc8&&_0x17c53b['_showLicenseError']('domainLimit'),'aiLicenseKeyNotAllowed'==_0x4b6fc8&&_0x17c53b['_showLicenseError']('featureNotAllowed','AIAssistant'),'aiLicenseKeyEvaluationLimit'==_0x4b6fc8&&_0x17c53b['_showLicenseError']('evaluationLimit'),'aiLicenseKeyUsageLimit'==_0x4b6fc8&&_0x17c53b['_showLicenseError']('usageLimit');},0x3e8);}['destroy'](){super['destroy'](),this['_licenseKeyCheckInterval']&&clearInterval(this['_licenseKeyCheckInterval']);}['showUI'](_0x479c94='',_0x57cb24='',_0x232b44='custom'){const _0xeeee25=this['editor'],_0xe71584=_0xeeee25['editing']['view'],_0x1e4d23=_0xeeee25['plugins']['get'](ki),_0x5467c9=_0xeeee25['plugins']['get'](_0x13085c);_0x1e4d23['showFakeVisualSelection']();const _0x20b476=new Qi(),_0x1a58ae=new ClipboardEvent('copy',{'clipboardData':_0x20b476}),_0x47fb63=new _0x390edf(_0x20b476),_0x5244d6=new _0x5c2c71(_0xe71584,_0x1a58ae,{'dataTransfer':_0x47fb63});_0x5467c9['_forceMarkersCopy']('comment',()=>{_0xe71584['document']['fire']('copy',_0x5244d6);}),this['_formView']||(this['_initView'](),this['_aiAssistantController']=new Pi(_0xeeee25,this['_aiAdapter']['textAdapter'],this['_formView']));let _0x564dde=_0x47fb63['getData']('text/html');const _0x5a5ee2=_0xeeee25['model']['document']['selection'],_0x282913=Array['from'](_0x5a5ee2['getRanges']());0x1===_0x282913['length']&&_0x282913[0x0]['isFlat']&&!_0x5a5ee2['getSelectedElement']()&&''!==_0x564dde['replace'](/&nbsp;/g,'')['trim']()&&(_0x564dde='<p>'+_0x564dde+'</p>'),this['_aiAssistantController']['updateView']({'actionId':_0x232b44,'query':_0x479c94,'htmlContent':_0x564dde,'label':_0x57cb24,'mainActionLabel':Hi[_0xeeee25['model']['document']['selection']['isCollapsed']?'INSERT':'REPLACE']}),'aiAssistant'!==this['_dialog']['id']?this['_dialog']['show']({'id':'aiAssistant','icon':_0x21ce39,'title':yi(this['editor']['locale'],'AI\x20Assistant'),'content':this['_formView'],'position':Yt['EDITOR_TOP_SIDE'],'onShow':()=>{this['_formView']['focus']();},'onHide':()=>{this['_aiAssistantController']['reset'](),_0x1e4d23['hideFakeVisualSelection']();}}):this['_dialog']['view']['wasMoved']||this['_dialog']['view']['updatePosition']();}['hideUI'](){this['_dialog']['hide']();}['_getResolvedCommandsDefinitions'](){const _0x5b88f0=new Map(),_0x177b2c=bi(this['editor']['config']['get']('ai.assistant.commands'),this['editor']['locale']);for(const _0x1c3df5 of _0x177b2c)for(const _0x39fc0d of _0x1c3df5['commands'])_0x5b88f0['set'](_0x39fc0d['id'],{..._0x39fc0d,'groupId':_0x1c3df5['groupId'],'groupLabel':_0x1c3df5['groupLabel']||_0x1c3df5['groupId']});return _0x5b88f0;}['_createAIAssistantUIButton'](_0x5c8a0){const _0x52deff=this['editor'],_0x5e05ed=_0x52deff['commands']['get']('showAIAssistant'),_0x293e20=new _0x5c8a0(_0x52deff['locale']);return _0x293e20['set']({'label':yi(_0x52deff['locale'],'AI\x20Assistant'),'icon':_0x21ce39,'isToggleable':!0x0}),_0x293e20['bind']('isEnabled')['to'](_0x5e05ed),_0x293e20['bind']('isOn')['to'](this['_dialog'],'id',_0x1507b3=>'aiAssistant'===_0x1507b3),this['listenTo'](_0x293e20,'execute',()=>{_0x293e20['isOn']?this['hideUI']():_0x5e05ed['execute']();}),_0x293e20;}['_initView'](){const _0x1700f3=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',()=>{_0x1700f3['insertContent'](this['_aiAssistantController']['currentContext']),this['hideUI']();}),this['listenTo'](this['_formView'],'insertContentBelow',()=>{_0x1700f3['insertContentBelow'](this['_aiAssistantController']['currentContext']),this['hideUI']();}),this['_initAriaAiStatusChangeAnnouncements']();}['_initAriaAiStatusChangeAnnouncements'](){const {locale:_0x367f7c,ui:{ariaLiveAnnouncer:_0x154976}}=this['editor'];this['_formView']['contentArea']['on']('change:isProcessing',(_0x2aa719,_0x306787,_0x245f1c)=>{const _0x42a525=this['_aiAssistantController']['currentContext'];_0x245f1c?_0x154976['announce'](yi(_0x367f7c,'AI\x20is\x20writing')):_0x42a525&&_0x154976['announce'](yi(_0x367f7c,'Generated\x20content:\x20%0',_0x42a525),{'politeness':'polite','isUnsafeHTML':!0x0});}),this['_formView']['on']('change:isError',(_0x5964ba,_0x42b430,_0x12b8db)=>{if(_0x12b8db){const _0x2f97b2=this['_formView']['errorView']['text'];_0x154976['announce'](yi(_0x367f7c,'Error\x20during\x20AI\x20content\x20generation:\x20%0',_0x2f97b2));}});}['_onExecute'](_0x4e61ce){const _0x3ba96b=this['_commandDefinitions']['get'](_0x4e61ce),_0x238683=this['editor'],_0x575364=_0x238683['model']['document']['selection'],_0x3cc412=_0x238683['commands']['get']('showAIAssistant'),_0x27ac8d=_0x238683['plugins']['get'](ki),_0x351767=''+(_0x3ba96b['groupId']!==Si?_0x3ba96b['groupLabel']+':\x20':'')+_0x3ba96b['label'];if(!0x1!==_0x3ba96b['requiresContent']&&_0x575364['isCollapsed']){const _0x380fbe=It(_0x575364['getSelectedBlocks']())||_0x238683['model']['schema']['getLimitElement'](_0x575364);_0x238683['model']['change'](_0x10cb70=>{_0x10cb70['setSelection'](_0x380fbe,'in');});}_0x27ac8d['showFakeVisualSelection'](),_0x3cc412['execute'](_0x3ba96b['prompt'],_0x351767,'command:'+_0x4e61ce);}['_populateMenuBarMenu'](_0x1a3155,_0xd87e2d,_0x587604,_0x22adf9){const _0x11fc00=this['editor'],_0x48eb66=_0x11fc00['locale'],_0x1e86b1=new $t(_0x48eb66),_0x5d355a=ji(_0x11fc00,_0x587604)['filter'](_0x15c0d9=>_0x15c0d9['commands']['length']);0x1===_0x5d355a['length']?this['_getMenuBarGroupButtons']({'command':_0x1a3155,'commands':_0x5d355a[0x0]['commands'],'parentMenuView':_0xd87e2d,'onExecute':_0x22adf9})['forEach'](_0x13c209=>_0x1e86b1['items']['add'](_0x13c209)):_0x5d355a['forEach'](({groupId:_0xd0ba88,groupLabel:_0x20e4e9,commands:_0x3ac34c})=>{const _0x2147e3=new qt(_0x48eb66,_0xd87e2d),_0x9b5b23=new Kt(_0x48eb66),_0x84905e=new $t(_0x48eb66),_0x355ed4=this['_getMenuBarGroupButtons']({'command':_0x1a3155,'commands':_0x3ac34c,'parentMenuView':_0x9b5b23,'onExecute':_0x22adf9});_0x9b5b23['buttonView']['set']({'label':_0x20e4e9||_0xd0ba88}),_0x9b5b23['delegate']('execute')['to'](_0xd87e2d),_0x84905e['items']['addMany'](_0x355ed4),_0x9b5b23['panelView']['children']['add'](_0x84905e),_0x2147e3['children']['add'](_0x9b5b23),_0x1e86b1['items']['add'](_0x2147e3);}),_0xd87e2d['panelView']['children']['add'](_0x1e86b1);}['_getMenuBarGroupButtons']({command:_0x3467fb,commands:_0x193dd6,parentMenuView:_0x36fe61,onExecute:_0x38bd5b}){const _0x4b65c5=this['editor'],_0x3da9c6=_0x4b65c5['locale'];return ji(_0x4b65c5,_0x193dd6)['map'](_0x47c409=>{const _0x54919e=new qt(_0x3da9c6,_0x36fe61),_0x411607=new Wt(_0x3da9c6);return _0x411607['set']({'label':_0x47c409['label']}),_0x411607['delegate']('execute')['to'](_0x36fe61),_0x411607['on']('execute',()=>_0x38bd5b(_0x47c409['id'])),_0x411607['bind']('isEnabled')['to'](_0x3467fb,'enabledCommandsIds',_0x42d316=>_0x42d316['includes'](_0x47c409['id'])),_0x54919e['children']['add'](_0x411607),_0x54919e;});}}function zi(_0x1d1d0f,_0x48442f){return void 0x0!==_0x1d1d0f['order']&&void 0x0===_0x48442f['order']?0x1:void 0x0===_0x1d1d0f['order']&&void 0x0!==_0x48442f['order']?-0x1:void 0x0!==_0x1d1d0f['order']&&void 0x0!==_0x48442f['order']?_0x1d1d0f['order']-_0x48442f['order']:0x0;}function ji(_0x3a7586,_0x1ee302){_0x1ee302['sort'](zi);const _0x430fe8={},_0x4b92d1=[];for(const _0x1b42d4 of _0x1ee302)if(void 0x0!==_0x1b42d4['order']){if(_0x1b42d4['order']in _0x430fe8)throw new ht('ai-commands-config-order-collision',_0x3a7586,{'conflictingDefinitions':[_0x1b42d4,_0x430fe8[_0x1b42d4['order']]]});_0x430fe8[_0x1b42d4['order']]=_0x1b42d4,_0x4b92d1['splice'](_0x1b42d4['order'],0x0,_0x1b42d4);}else _0x4b92d1['push'](_0x1b42d4);return _0x4b92d1;}class Ji extends _0x3e16f7{static get['requires'](){return[Xi,ki];}static get['pluginName'](){return'AIAssistant';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x31c41d){super(_0x31c41d);const _0x193dac=_0x31c41d['config'],_0x29c535=_0x31c41d['locale'];_0x193dac['define']('ai.assistant.preserveComments',!0x0),_0x193dac['define']('ai.assistant.commands',Zi(_0x29c535)),_0x193dac['define']('ai.assistant.extraCommandGroups',[]),_0x193dac['define']('ai.assistant.removeCommands',[]);let _0x14f301=bi(_0x193dac['get']('ai.assistant.commands'),_0x29c535);const _0x545e62=_0x193dac['get']('ai.assistant.extraCommandGroups'),_0xe7f9b3=_0x193dac['get']('ai.assistant.removeCommands');_0x545e62['forEach'](_0x2a087f=>{const _0x34b41a=_0x14f301['find'](_0x5b3be5=>_0x5b3be5['groupId']===_0x2a087f['groupId']);_0x34b41a?_0x34b41a['commands']=_0x34b41a['commands']['concat'](_0x2a087f['commands']):_0x14f301['push'](_0x2a087f);}),_0x14f301=_0x14f301['filter'](_0x5242b4=>!_0xe7f9b3['includes'](_0x5242b4['groupId'])),_0x14f301['forEach'](_0x7d6418=>{_0x7d6418['commands']=_0x7d6418['commands']['filter'](_0x5bd9d9=>!_0xe7f9b3['includes'](_0x5bd9d9['id']));}),_0x193dac['set']('ai.assistant.commands',_0x14f301);}}function Zi(_0x39a5a3){return[{'groupId':'editOrReview','groupLabel':yi(_0x39a5a3,'Edit\x20or\x20review'),'commands':[{'id':'improveWriting','label':yi(_0x39a5a3,'Improve\x20writing'),'prompt':'Fix\x20spelling\x20mistakes,\x20use\x20proper\x20grammar\x20and\x20apply\x20good\x20writing\x20practices.\x20Do\x20not\x20lose\x20the\x20original\x20meaning.'},{'id':'makeShorter','label':yi(_0x39a5a3,'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(_0x39a5a3,'Make\x20longer'),'prompt':'Improve\x20this\x20content\x20by\x20using\x20descriptive\x20language\x20and\x20inserting\x20more\x20information\x20and\x20more\x20detailed\x20explanations.'},{'id':'simplifyLanguage','label':yi(_0x39a5a3,'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(_0x39a5a3,'Generate\x20from\x20selection'),'commands':[{'id':'summarize','label':yi(_0x39a5a3,'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(_0x39a5a3,'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(_0x39a5a3,'Change\x20tone'),'commands':[{'id':'professional','label':yi(_0x39a5a3,'Professional'),'prompt':'Improve\x20using\x20polished,\x20formal,\x20and\x20respectful\x20language\x20to\x20convey\x20professional\x20expertise\x20and\x20competence.'},{'id':'casual','label':yi(_0x39a5a3,'Casual'),'prompt':'Improve\x20using\x20casual,\x20informal\x20language\x20to\x20convey\x20a\x20casual\x20conversation\x20with\x20a\x20real\x20person.'},{'id':'direct','label':yi(_0x39a5a3,'Direct'),'prompt':'Improve\x20using\x20direct\x20language,\x20using\x20only\x20the\x20essential\x20information.'},{'id':'confident','label':yi(_0x39a5a3,'Confident'),'prompt':'Improve\x20using\x20compelling,\x20optimistic\x20language\x20to\x20convey\x20confidence\x20in\x20the\x20writing.'},{'id':'friendly','label':yi(_0x39a5a3,'Friendly'),'prompt':'Improve\x20using\x20friendly,\x20comforting\x20language,\x20to\x20convey\x20understanding\x20and\x20empathy.'}]},{'groupId':'changeStyle','groupLabel':yi(_0x39a5a3,'Change\x20style'),'commands':[{'id':'business','label':yi(_0x39a5a3,'Business'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20business\x20professional\x20with\x20formal\x20language.'},{'id':'legal','label':yi(_0x39a5a3,'Legal'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20legal\x20professional\x20using\x20valid\x20legal\x20terminology.'},{'id':'journalism','label':yi(_0x39a5a3,'Journalism'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20journalist\x20using\x20engaging\x20language\x20to\x20convey\x20the\x20importance\x20of\x20the\x20information.'},{'id':'poetic','label':yi(_0x39a5a3,'Poetic'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20poem\x20using\x20poetic\x20techniques\x20without\x20losing\x20the\x20original\x20meaning.'}]},{'groupId':'translate','groupLabel':yi(_0x39a5a3,'Translate'),'commands':[{'id':'translateEnglish','label':yi(_0x39a5a3,'English'),'prompt':'Translate\x20the\x20content\x20to\x20English\x20language.'},{'id':'translateSpanish','label':yi(_0x39a5a3,'Spanish'),'prompt':'Translate\x20the\x20content\x20to\x20Spanish\x20language.'},{'id':'translatePortuguese','label':yi(_0x39a5a3,'Portuguese'),'prompt':'Translate\x20the\x20content\x20to\x20Portuguese\x20language.'},{'id':'translateGerman','label':yi(_0x39a5a3,'German'),'prompt':'Translate\x20the\x20content\x20to\x20German\x20language.'},{'id':'translateFrench','label':yi(_0x39a5a3,'French'),'prompt':'Translate\x20the\x20content\x20to\x20French\x20language.'},{'id':'translateChinese','label':yi(_0x39a5a3,'Simplified\x20Chinese'),'prompt':'Translate\x20the\x20content\x20to\x20Simplified\x20Chinese\x20language.'},{'id':'translateHindi','label':yi(_0x39a5a3,'Hindi'),'prompt':'Translate\x20the\x20content\x20to\x20Hindi\x20language.'},{'id':'translateArabic','label':yi(_0x39a5a3,'Arabic'),'prompt':'Translate\x20the\x20content\x20to\x20Arabic\x20language.'}]}];}class ts extends _0x3e16f7{['abortController'];static get['requires'](){return[Ni];}constructor(_0x9980d4){super(_0x9980d4),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'](_0x228d9f){return this['sendRequest'](_0x228d9f)['catch'](_0x2ee1f5=>{if(_0x2ee1f5 instanceof vi)return Promise['reject'](_0x2ee1f5);if('AbortError'==_0x2ee1f5['name'])return Promise['resolve']();throw console['error'](_0x2ee1f5),new ht('aitextadapter-send-request-failed',null);});}async['_prepareRequestHeaders'](_0x305731,_0x450f06){const _0x335676=this['editor']['locale'],_0x5eb82b={'Content-Type':'application/json'};if('object'==typeof _0x305731)Object['assign'](_0x5eb82b,_0x305731);else{if(_0x305731)try{const _0x146489=await _0x305731(_0x450f06);Object['assign'](_0x5eb82b,_0x146489);}catch{return Promise['reject'](new vi(yi(_0x335676,'AI_ERROR_GET_HEADERS')));}}return _0x5eb82b;}async['_prepareRequestParameters'](_0x5165f1,_0x1789e9){const _0xe824ef=this['editor']['locale'];if('object'==typeof _0x5165f1)return _0x5165f1;try{return await _0x5165f1(_0x1789e9);}catch{return Promise['reject'](new vi(yi(_0xe824ef,'AI_ERROR_GET_PARAMETERS')));}}}class es extends ts{['_apiUrl'];['_requestHeaders'];['_requestParameters'];static get['pluginName'](){return'OpenAITextAdapter';}constructor(_0x4e61ea){super(_0x4e61ea),_0x4e61ea['config']['define']('ai.assistant.adapter.openAI.apiUrl','https://api.openai.com/v1/chat/completions'),_0x4e61ea['config']['get']('ai.assistant.adapter.openAI.requestParameters')||_0x4e61ea['config']['define']('ai.assistant.adapter.openAI.requestParameters',{'model':'gpt-4o','temperature':0x1,'top_p':0x1,'stream':!0x0}),this['_apiUrl']=_0x4e61ea['config']['get']('ai.assistant.adapter.openAI.apiUrl'),this['_requestHeaders']=_0x4e61ea['config']['get']('ai.assistant.adapter.openAI.requestHeaders')||{},this['_requestParameters']=_0x4e61ea['config']['get']('ai.assistant.adapter.openAI.requestParameters');}async['sendRequest']({query:_0x55b41d,context:_0x1c46bb,onData:_0x24baeb,actionId:_0x56f4eb}){const _0x4f20af=this['editor']['locale'],_0x52b4c1=await this['prepareMessages'](_0x55b41d,_0x1c46bb,_0x56f4eb),_0x7478ed=await this['_prepareRequestHeaders'](this['_requestHeaders'],_0x56f4eb),_0x1c2694=await this['_prepareRequestParameters'](this['_requestParameters'],_0x56f4eb),_0xe37a2b={'messages':_0x52b4c1,..._0x1c2694},_0x47d1a8={'method':'POST','headers':_0x7478ed,'body':JSON['stringify'](_0xe37a2b),'signal':this['abortController']['signal']},_0x5a8317=await fetch(this['_apiUrl'],_0x47d1a8);if(_0x5a8317['ok'])return _0x1c2694['stream']?await this['_readStreamableResponse'](_0x5a8317,_0x24baeb):await this['_readStaticResponse'](_0x5a8317,_0x24baeb),Promise['resolve']();{const _0x456534=await _0x5a8317['text']();return _0x456534['includes']('context_length_exceeded')?Promise['reject'](new vi(yi(_0x4f20af,'AI_ERROR_CONTEXT_LENGTH'))):_0x456534['includes']('Moderation')?Promise['reject'](new vi(yi(_0x4f20af,'AI_ERROR_MODERATION'))):Promise['reject'](new Error(_0x456534));}}async['prepareMessages'](_0x119e07,_0x348c14,_0x2b81f5){let _0x5adc86,_0x3eb14b;return _0x348c14?(_0x5adc86='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.',_0x3eb14b='Instruction:\x0a'+_0x119e07+'\x0aYou\x20must\x20keep\x20the\x20text\x20formatting.\x0a\x0aContent:\x0a'+_0x348c14):(_0x5adc86='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.',_0x3eb14b=_0x119e07),[{'role':'system','content':_0x5adc86},{'role':'user','content':_0x3eb14b}];}async['_readStreamableResponse'](_0x16cf61,_0x33c19e){const _0x29b213=_0x16cf61['body']['getReader'](),_0x547b42=new TextDecoder();let _0x2913d2='',_0x17da74='',_0x424a8f='',_0x37e3f0=!0x1;for(;!_0x37e3f0;){const {done:_0x430311,value:_0x3db9bd}=await _0x29b213['read'](),_0x397d14=_0x2913d2+_0x547b42['decode'](_0x3db9bd);let _0x212be2='';_0x37e3f0=_0x430311;try{_0x212be2=this['_cleanUpData'](_0x397d14),_0x2913d2='';}catch{_0x2913d2=_0x397d14;continue;}_0x17da74+=_0x212be2,!_0x37e3f0&&this['_isBufferIncomplete'](_0x17da74)||_0x17da74&&(_0x424a8f+=_0x17da74,_0x17da74='',_0x33c19e(_0x424a8f));}return Promise['resolve']();}async['_readStaticResponse'](_0x1ab3a6,_0x224c31){return _0x224c31((await _0x1ab3a6['json']())['choices'][0x0]['message']['content']),Promise['resolve']();}['_isBufferIncomplete'](_0x26da8b){const _0xd4a1b9=_0x26da8b['split']('<')['length']!==_0x26da8b['split']('>')['length'],_0x47cda4=_0x26da8b['length']<0x1e;return _0xd4a1b9&&_0x47cda4;}['_cleanUpData'](_0x8ded5a){return _0x8ded5a['split'](/\n(?![^{]*\})/g)['map'](_0x2702f1=>_0x2702f1['replace']('data:\x20',''))['filter'](_0x1ff6c7=>_0x1ff6c7&&_0x1ff6c7['length']>0x0&&'[DONE]'!==_0x1ff6c7)['map'](_0x15f810=>{const {choices:_0x340569}=JSON['parse'](_0x15f810);if(_0x340569[0x0]?.['delta']?.['content'])return _0x340569[0x0]['delta']['content'];})['filter'](_0x1b7d38=>_0x1b7d38)['join']('');}}class is extends ts{['_apiUrl'];['_requestHeaders'];['_bedrockClientConfig'];['_requestParameters'];static get['pluginName'](){return'AWSTextAdapter';}constructor(_0x36168b){super(_0x36168b),_0x36168b['config']['get']('ai.assistant.adapter.aws.requestParameters')||_0x36168b['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']=_0x36168b['config']['get']('ai.assistant.adapter.aws.apiUrl'),this['_bedrockClientConfig']=_0x36168b['config']['get']('ai.assistant.adapter.aws.bedrockClientConfig'),this['_requestHeaders']=_0x36168b['config']['get']('ai.assistant.adapter.aws.requestHeaders'),this['_requestParameters']=_0x36168b['config']['get']('ai.assistant.adapter.aws.requestParameters');}async['sendRequest']({query:_0x12bc4e,context:_0x5a678f,onData:_0x517b6f,actionId:_0xa5dabe}){const {model:_0x1186b4,stream:_0x190f1e,..._0x98edc1}=await this['_prepareRequestParameters'](this['_requestParameters'],_0xa5dabe),_0x48e95c={'prompt':await this['preparePrompt'](_0x12bc4e,_0x5a678f,_0x1186b4,_0xa5dabe),..._0x98edc1};this['_apiUrl']?await this['_processProxyRequest'](_0x48e95c,_0x1186b4,_0x190f1e,_0x517b6f,_0xa5dabe):await this['_processAWSRequest'](_0x48e95c,_0x1186b4,_0x190f1e,_0x517b6f);}async['preparePrompt'](_0x2d89b3,_0x11da5b,_0x23cfbf,_0x3eb275){let _0x4ff4e2,_0x59f0f6;return _0x11da5b?(_0x4ff4e2='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.',_0x59f0f6='Instruction:\x0a'+_0x2d89b3+'\x0aYou\x20must\x20keep\x20the\x20text\x20formatting.\x0a\x0aContent:\x0a'+_0x11da5b):(_0x4ff4e2='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.',_0x59f0f6=_0x2d89b3),'meta.llama'==this['getModelFamily'](_0x23cfbf)?'<<SYS>>\x0a'+_0x4ff4e2+'\x0a<</SYS>>\x0a[INST]\x0a'+_0x59f0f6+'\x0a[/INST]':'Human:\x0a'+_0x4ff4e2+'\x0a'+_0x59f0f6+'\x0a\x0aAssistant:';}['getModelFamily'](_0x157309){if(/^anthropic\.claude/['test'](_0x157309))return'anthropic.claude';if(/^ai21\.j2/['test'](_0x157309))return'ai21.j2';if(/^cohere\.command/['test'](_0x157309))return'cohere.command';if(/^meta\.llama/['test'](_0x157309))return'meta.llama';throw new vi(yi(this['editor']['locale'],'AI_ERROR_UNSUPPORTED_MODEL',_0x157309));}async['_processProxyRequest'](_0x2d8104,_0x2a4973,_0x50c036,_0x1b5ef8,_0x1f279e){const _0x23acff={'method':'POST','headers':await this['_prepareRequestHeaders'](this['_requestHeaders'],_0x1f279e),'body':JSON['stringify']({..._0x2d8104,'model':_0x2a4973,'stream':_0x50c036}),'signal':this['abortController']['signal']},_0x204f84=await fetch(this['_apiUrl'],_0x23acff);_0x50c036?await this['_readStreamableResponse'](_0x204f84,_0x2a4973,_0x1b5ef8):await this['_readStaticResponse'](_0x204f84,_0x2a4973,_0x1b5ef8);}async['_processAWSRequest'](_0x16cd9d,_0x27e31f,_0x265619,_0x3fa38f){const _0x4c3dbf=new _0x3b763a(this['_bedrockClientConfig']),_0x54ccbd={'body':JSON['stringify'](_0x16cd9d),'contentType':'application/json','accept':'application/json','modelId':_0x27e31f};let _0x36a292;if(_0x265619){const _0x2be9b4=new _0x4dc0a3(_0x54ccbd);_0x36a292=await _0x4c3dbf['send'](_0x2be9b4,{'abortSignal':this['abortController']['signal']}),await this['_readAsyncIterableResponse'](_0x36a292,_0x27e31f,_0x3fa38f);}else{const _0x4fe11c=new _0x4bfb5a(_0x54ccbd);_0x36a292=await _0x4c3dbf['send'](_0x4fe11c,{'abortSignal':this['abortController']['signal']}),await this['_readStaticResponse'](_0x36a292,_0x27e31f,_0x3fa38f);}}async['_readAsyncIterableResponse'](_0x2d63c4,_0x2fc1f5,_0x221111){const _0x7cd1dd=_0x2d63c4['body'],_0x394906=new TextDecoder('utf-8');let _0x32c96f='';for await(const _0x201e1e of _0x7cd1dd)if(_0x201e1e['chunk']){const _0x278c77=_0x394906['decode'](_0x201e1e['chunk']['bytes']),_0x246a23=JSON['parse'](_0x278c77);_0x32c96f+=this['_getGeneratedText'](_0x246a23,_0x2fc1f5),_0x221111(_0x32c96f);}return Promise['resolve']();}async['_readStreamableResponse'](_0x232c4e,_0x575560,_0x17b36b){const _0x1fee7a=_0x232c4e['body'],_0x1632af=new TextDecoder('utf-8'),_0x34a563=_0x1fee7a['getReader']();let _0x4ed493='',_0x288b64='',_0x1cc42d=!0x1;for(;!_0x1cc42d;){const {done:_0x16ff17,value:_0x55348f}=await _0x34a563['read']();if(_0x1cc42d=_0x16ff17,_0x1cc42d)break;const _0xcd0540=(_0x4ed493+_0x1632af['decode'](_0x55348f))['split']('\x0a')['map'](_0x574c8e=>{try{return _0x4ed493='',JSON['parse'](_0x574c8e);}catch{return _0x4ed493=_0x574c8e,null;}})['filter'](_0x2ec5b1=>null!==_0x2ec5b1);_0xcd0540['length']&&(_0x288b64+=_0xcd0540['map'](_0x31099a=>this['_getGeneratedText'](_0x31099a,_0x575560))['join'](''),_0x17b36b(_0x288b64));}return Promise['resolve']();}async['_readStaticResponse'](_0x57c945,_0x1990e8,_0x331e6e){let _0x7695b3;return _0x7695b3=_0x57c945 instanceof Response?await _0x57c945['json']():JSON['parse'](new TextDecoder('utf-8')['decode'](_0x57c945['body'])),(_0x331e6e(this['_getGeneratedText'](_0x7695b3,_0x1990e8)),Promise['resolve']());}['_getGeneratedText'](_0x4417f5,_0x41cb6e){switch(this['getModelFamily'](_0x41cb6e)){case'anthropic.claude':return _0x4417f5['completion'];case'ai21.j2':return _0x4417f5['completions'][0x0]['data']['text'];case'cohere.command':return _0x4417f5['generations'][0x0]['text'];case'meta.llama':return _0x4417f5['generation'];}}}class ss extends Nt{constructor(_0x29d248,_0x264c23={}){super(_0x29d248),this['isToggleable']=!0x0,this['set']('side',_0x264c23['side']||'top');const _0x5137a0=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':['ck-tab-button',...Et(_0x264c23['class']||[]),_0x5137a0['to']('side',_0x24c6aa=>'ck-tab-button_'+_0x24c6aa),_0x5137a0['to']('class')]}});}['show'](){this['set']('isVisible',!0x0);}['hide'](){this['set']('isVisible',!0x1);}}class ns extends vt{['children'];constructor(_0x3762d8,_0x25db2a={}){super(_0x3762d8);const _0x2f7073=this['bindTemplate'];this['set']('isVisible',!0x1),this['set']('class',''),this['children']=this['createCollection'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck-tab-panel',...Et(_0x25db2a['class']||[]),_0x2f7073['to']('class'),_0x2f7073['if']('isVisible','ck-hidden',_0x543bb3=>!_0x543bb3)]},'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(_0x32ee56,_0x230f1e={}){super(_0x32ee56),this['set']('class',void 0x0),this['set']('activeTab',null),this['set']('side',_0x230f1e['side']||'top'),this['set']('isMaximized',!0x1);const _0x3a9126=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset','ck-tabs',...Et(_0x230f1e['class']||[]),_0x3a9126['to']('side',_0x24355e=>'ck-tabs_'+_0x24355e),_0x3a9126['to']('class'),_0x3a9126['to']('isMaximized',_0x323e1e=>_0x323e1e?'ck-ai-tabs_maximized':'')],'tabindex':'0'},'children':[{'tag':'div','attributes':{'class':['ck','ck-tabs__buttons-container',_0x3a9126['to']('side',_0x204118=>'ck-tabs__buttons-container_'+_0x204118)]},'children':this['buttonViews']},{'tag':'div','attributes':{'class':['ck','ck-tabs__panels-container',_0x3a9126['to']('side',_0x585d1b=>'ck-tabs__panels-container_'+_0x585d1b)]},'children':this['panelViews']},...Et(_0x230f1e['children']||[])]});}['getTabIds'](){return[...this['_tabs']['keys']()];}['getTab'](_0x32174d){const _0x9c7300=this['_tabs']['get'](_0x32174d);return _0x9c7300||null;}['addTab'](_0x2fd8a9){const _0x5a338d=this['_setupButton']({'id':_0x2fd8a9['id'],'label':_0x2fd8a9['buttonLabel'],'icon':_0x2fd8a9['buttonIcon'],'order':_0x2fd8a9['order']}),_0xde299=new ns(this['locale']);return _0xde299['render'](),_0x2fd8a9['content']&&_0xde299['children']['add'](_0x2fd8a9['content']),this['panelViews']['add'](_0xde299),this['_tabs']['set'](_0x2fd8a9['id'],{'button':_0x5a338d,'panel':_0xde299,'order':void 0x0!==_0x2fd8a9['order']?_0x2fd8a9['order']:null}),this['fire']('addTab:'+_0x2fd8a9['id'],{'id':_0x2fd8a9['id'],'button':_0x5a338d,'panel':_0xde299}),null===this['activeTab']?this['activateTab'](_0x2fd8a9['id']):this['_hidePanel'](_0x2fd8a9['id']),{'button':_0x5a338d,'panel':_0xde299};}['activateTab'](_0x112640){if(null!==_0x112640&&!this['getTab'](_0x112640))throw new ht('ui-tabsview-tab-not-found',{'tabs':this,'tabId':_0x112640});this['activeTab']!==_0x112640&&(this['activeTab']&&this['_hidePanel'](this['activeTab']),this['activeTab']=_0x112640,_0x112640&&this['_showPanel'](_0x112640),this['fire']('activateTab:'+_0x112640,_0x112640));}['showTab'](_0x4be10f){if(!this['getTab'](_0x4be10f))throw new ht('ui-tabsview-tab-not-found',{'tabs':this,'tabId':_0x4be10f});this['_showPanel'](_0x4be10f),this['_showButton'](_0x4be10f),this['fire']('show:'+_0x4be10f,_0x4be10f);}['hideTab'](_0x5aeaf4){if(!this['getTab'](_0x5aeaf4))throw new ht('ui-tabsview-tab-not-found',{'tabs':this,'tabId':_0x5aeaf4});const _0x29ec28=this['activeTab'];this['_hidePanel'](_0x5aeaf4),this['_hideButton'](_0x5aeaf4);const _0xd7e337=this['getTabIds']();_0x29ec28===_0x5aeaf4&&_0xd7e337['length']>0x1&&this['activateTab'](_0xd7e337['find'](_0x39b28d=>_0x39b28d!==_0x5aeaf4)),this['fire']('hide:'+_0x5aeaf4,_0x5aeaf4);}['_getPanel'](_0x509832){const _0x1caa71=this['_tabs']['get'](_0x509832);return _0x1caa71?_0x1caa71['panel']:null;}['_showPanel'](_0x3c1263){null!==this['activeTab']&&this['activeTab']!==_0x3c1263||this['_getPanel'](_0x3c1263)['show']();}['_hidePanel'](_0x4f0043){const _0x526ec0=this['_getPanel'](_0x4f0043);_0x526ec0['isVisible']&&(this['activeTab']===_0x4f0043&&(this['activeTab']=null),_0x526ec0['hide']());}['_getButton'](_0x3a30b0){const _0x523866=this['_tabs']['get'](_0x3a30b0);return _0x523866?_0x523866['button']:null;}['_showButton'](_0x1939eb){this['_getButton'](_0x1939eb)['show']();}['_hideButton'](_0x23bfdf){this['_getButton'](_0x23bfdf)['hide']();}['_setupButton'](_0x220586){const _0x30f8e9=new ss(this['locale'],{'side':this['side']}),_0x1acc5b=this['buttonViews'];if(_0x30f8e9['set']({'label':_0x220586['label'],'icon':_0x220586['icon'],'tooltip':!0x0,'withText':!0x0}),_0x30f8e9['bind']('isOn')['to'](this,'activeTab',_0x293ee6=>_0x293ee6===_0x220586['id']),_0x30f8e9['bind']('side')['to'](this,'side'),_0x220586['order']){const _0x25ff5c=[...this['_tabs']]['reduce']((_0x7cd9f6,_0x201a6e)=>{const _0x336d2c=_0x201a6e[0x0],{order:_0x4b11d1}=_0x201a6e[0x1];return!_0x4b11d1||_0x4b11d1>_0x220586['order']?_0x7cd9f6:_0x4b11d1>=_0x7cd9f6['order']?{'id':_0x336d2c,'order':_0x4b11d1}:_0x7cd9f6;},{'id':'','order':0x0}),_0x54b903=_0x1acc5b['getIndex'](this['_getButton'](_0x25ff5c['id']));_0x1acc5b['add'](_0x30f8e9,_0x54b903+0x1);}else _0x1acc5b['add'](_0x30f8e9);return _0x30f8e9['on']('execute',()=>{this['activateTab'](_0x220586['id']);}),_0x30f8e9;}}const as=['overlay','sidebar','custom'],os=['left','right'];class hs extends rs{constructor(_0xa529df,_0x5ac12d={}){super(_0xa529df,_0x5ac12d),this['set']('type',_0x5ac12d['type']||'sidebar'),this['set']('side',_0x5ac12d['side']||'right'),this['set']('isVisible',_0x5ac12d['visibleByDefault']??!0x0);const _0x2b0052=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':['ck-ai-tabs',_0x2b0052['if']('type','ck-ai-tabs__overlay',_0x19d668=>'overlay'===_0x19d668),_0x2b0052['if']('type','ck-ai-tabs__sidebar',_0x265462=>'sidebar'===_0x265462),_0x2b0052['if']('isVisible','ck-hidden',_0x244b96=>!_0x244b96)]}}),this['buttonViews']['on']('add',(_0x3fda7c,_0x884f7a)=>{_0x884f7a['set']('withText',!0x1);});}}class cs extends _0x4c3ee6{['view'];['container']=null;['showResizeButton']=!0x0;static get['pluginName'](){return'AITabs';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x4500b4){super(_0x4500b4);const _0x59bd4a=this['context']['config']['get']('ai.container');if(this['set']('side','right'),!_0x59bd4a)throw new ht('ai-tabs-configuration-not-found');if(void 0x0!==_0x59bd4a['showResizeButton']&&(this['showResizeButton']=_0x59bd4a['showResizeButton']),'sidebar'!==_0x59bd4a['type']&&'overlay'!==_0x59bd4a['type']||_0x59bd4a['side']&&(this['side']=_0x59bd4a['side']),'sidebar'===_0x59bd4a['type']){if(this['container']=_0x59bd4a['element'],this['set']('type','sidebar'),!this['container'])throw new ht('ai-tabs-sidebar-container-element-not-found');}else'overlay'===_0x59bd4a['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===_0x59bd4a['visibleByDefault']||_0x59bd4a['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 _0xe5e2fa&&this['context']['ui']['focusTracker']['add'](this['view']['element']);}['switchType'](_0x5975c5){if(_0x5975c5&&this['type']!==_0x5975c5){if(!as['includes'](_0x5975c5))throw new ht('ai-tabs-unsupported-ui-type');this['type']=_0x5975c5;}}['switchSide'](_0x45b813){if(_0x45b813&&this['side']!==_0x45b813){if(!os['includes'](_0x45b813))throw new ht('ai-tabs-unsupported-ui-side');this['side']=_0x45b813;}}['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 _0x4c3ee6{['_apiUrl'];['_token'];['_decoder'];['_responseCache'];static get['requires'](){return[_0x271a82];}static get['pluginName'](){return'AIConnector';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x15b350){super(_0x15b350),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 _0x55fb72=this['context']['plugins']['get'](_0x271a82);if(!_0x55fb72['token'])throw new ht('ai-missing-token',this);this['_token']=_0x55fb72['token'];}['startConversation'](_0xa5b389,_0x5783de){const _0xf9c737=this['_sendApiRequest']('/conversations','POST',{'id':_0xa5b389,'group':_0x5783de});return{'getConversation':async()=>(await _0xf9c737['request'])['json'](),'abortController':_0xf9c737['abortController']};}['queryAssistant']({message:_0x23b4a7,conversationId:_0x18395d,parts:_0xcbc636,capabilities:_0x467cb9,model:_0x37e066,attributes:_0x2c4fc3}){const _0x1e50b7={'prompt':_0x23b4a7,'content':_0xcbc636,'model':_0x37e066,..._0x467cb9&&{'capabilities':_0x467cb9},..._0x2c4fc3&&{'attributes':_0x2c4fc3}},_0xc8829f=this['_sendApiRequest']('/conversations/'+_0x18395d+'/messages','POST',_0x1e50b7);return{'getStream':async()=>{const _0x2ffca5=(await _0xc8829f['request'])['body'];return this['_getStreamReader'](_0x2ffca5);},'abortController':_0xc8829f['abortController']};}['executeCustomAction']({content:_0x3d62f3,message:_0x2f344d,model:_0x4d574d,outputFormat:_0x26bea0}){const _0x5d38de={'content':[{'type':'text','content':_0x3d62f3}],'prompt':_0x2f344d,'model':_0x4d574d,'outputFormat':_0x26bea0},_0x475897=this['_sendApiRequest']('/actions/custom/calls','POST',_0x5d38de);return{'getStream':async()=>{const _0x5b7457=(await _0x475897['request'])['body'];return this['_getStreamReader'](_0x5b7457);},'abortController':_0x475897['abortController']};}['executeAction']({actionName:_0x10ee85,content:_0x2d80ee,args:_0x37c2e0}){const _0x9e6143={'content':[{'type':'text','content':_0x2d80ee}],'args':_0x37c2e0},_0x3187fd=this['_sendApiRequest']('/actions/system/'+_0x10ee85+'/calls','POST',_0x9e6143);return{'getStream':async()=>{const _0xd15f3=(await _0x3187fd['request'])['body'];return this['_getStreamReader'](_0xd15f3);},'abortController':_0x3187fd['abortController']};}['uploadFile'](_0x39a63a,_0x1875b6,_0x2ef07c){const _0x4d8e1c=new FormData();_0x4d8e1c['append']('file',_0x1875b6,_0x1875b6['name']),_0x2ef07c&&_0x4d8e1c['append']('attributes',JSON['stringify'](_0x2ef07c));const _0x218826=this['_sendApiRequest']('/conversations/'+_0x39a63a+'/files','POST',_0x4d8e1c);return{'getId':async()=>(await _0x218826['request'])['json'](),'abortController':_0x218826['abortController']};}['fetchDocument'](_0x3f6ee1,_0x3331e7){const _0x1b20aa=this['_sendApiRequest']('/conversations/'+_0x3f6ee1+'/documents/'+_0x3331e7,'GET');return{'getDocument':async()=>(await _0x1b20aa['request'])['json'](),'abortController':_0x1b20aa['abortController']};}['uploadDocument'](_0x2b18f5,_0x5b1b59,_0x195599){const _0x4980bb={'content':_0x5b1b59};_0x195599&&(_0x4980bb['attributes']=_0x195599);const _0x1fb341=this['_sendApiRequest']('/conversations/'+_0x2b18f5+'/documents','POST',_0x4980bb);return{'getId':async()=>(await _0x1fb341['request'])['json'](),'abortController':_0x1fb341['abortController']};}['fetchConversations'](_0x1af48b,_0x1b15c6={}){const _0x1980bb=new URLSearchParams();_0x1980bb['append']('group',_0x1af48b),_0x1980bb['append']('excludeEmpty',!0x1!==_0x1b15c6['excludeEmpty']?'true':'false'),_0x1980bb['append']('limit',_0x1b15c6['limit']?_0x1b15c6['limit']['toString']():'100'),_0x1980bb['append']('sortBy',_0x1b15c6['sortBy']?_0x1b15c6['sortBy']:'createdAt'),_0x1980bb['append']('order',_0x1b15c6['order']?_0x1b15c6['order']:'desc');const _0x1f559e=this['_sendApiRequest']('/conversations?'+_0x1980bb['toString'](),'GET');return{'getConversations':async()=>{const _0x52bdd4=await _0x1f559e['request'];return(await _0x52bdd4['json']())['items'];},'abortController':_0x1f559e['abortController']};}['deleteConversation'](_0x1b9641){const _0x39c638=this['_sendApiRequest']('/conversations/'+_0x1b9641,'DELETE');return{'execute':async()=>{await _0x39c638['request'];},'abortController':_0x39c638['abortController']};}['updateConversation'](_0x5a9090,_0x549a2c){const _0x11d5bc=this['_sendApiRequest']('/conversations/'+_0x5a9090,'PATCH',_0x549a2c);return{'getResult':async()=>(await _0x11d5bc['request'],_0x549a2c),'abortController':_0x11d5bc['abortController']};}['fetchConversation'](_0x1556d8){const _0x42d12b=this['_sendApiRequest']('/conversations/'+_0x1556d8,'GET');return{'getConversation':async()=>(await _0x42d12b['request'])['json'](),'abortController':_0x42d12b['abortController']};}['fetchConversationMessages'](_0x2256aa){const _0x40fb10=this['_sendApiRequest']('/conversations/'+_0x2256aa+'/messages','GET');return{'getMessages':async()=>{const _0x183524=await _0x40fb10['request'];return(await _0x183524['json']())['items'];},'abortController':_0x40fb10['abortController']};}['uploadUrl'](_0x34333b,_0x5c1220,_0x59977a){const _0x51c716=this['_sendApiRequest']('/conversations/'+_0x34333b+'/web-resources','POST',{'url':_0x5c1220,'attributes':_0x59977a});return{'getId':async()=>(await _0x51c716['request'])['json'](),'abortController':_0x51c716['abortController']};}['getModels'](_0x4c4923='en'){const _0x52f8d6=new URLSearchParams();_0x52f8d6['append']('language',_0x4c4923);const _0x36521e='/models/1?'+_0x52f8d6['toString'](),_0x3ec89d=this['_sendApiRequest'](_0x36521e,'GET',void 0x0,!0x0);return{'list':async()=>await(await _0x3ec89d['request'])['json'](),'abortController':_0x3ec89d['abortController']};}['deleteFile'](_0x90ebca,_0x48b32f){const _0xb85c01=this['_sendApiRequest']('/conversations/'+_0x90ebca+'/files/'+_0x48b32f,'DELETE');return{'execute':async()=>{await _0xb85c01['request'];},'abortController':_0xb85c01['abortController']};}['deleteDocument'](_0x581e13,_0x1bdaed){const _0x4967b2=this['_sendApiRequest']('/conversations/'+_0x581e13+'/documents/'+_0x1bdaed,'DELETE');return{'execute':async()=>{await _0x4967b2['request'];},'abortController':_0x4967b2['abortController']};}['deleteWebResource'](_0x4d10da,_0x45134a){const _0x4db5c5=this['_sendApiRequest']('/conversations/'+_0x4d10da+'/web-resources/'+_0x45134a,'DELETE');return{'execute':async()=>{await _0x4db5c5['request'];},'abortController':_0x4db5c5['abortController']};}['callSystemReview']({reviewName:_0x4f8b8f,content:_0x533f6c,args:_0x4f6511}){const _0x1af686=this['_sendApiRequest']('/reviews/system/'+_0x4f8b8f+'/calls','POST',{'content':[{'type':'text','content':_0x533f6c}],'args':_0x4f6511});return{'getStream':async()=>{const _0x2d9046=(await _0x1af686['request'])['body'];return this['_getStreamReader'](_0x2d9046);},'abortController':_0x1af686['abortController']};}['callCustomReview']({content:_0x49acf9,prompt:_0x30f8fa,model:_0x12b86e}){const _0x6c268d=this['_sendApiRequest']('/reviews/custom/calls','POST',{'content':[{'type':'text','content':_0x49acf9}],'prompt':_0x30f8fa,'model':_0x12b86e});return{'getStream':async()=>{const _0x33dc6c=(await _0x6c268d['request'])['body'];return this['_getStreamReader'](_0x33dc6c);},'abortController':_0x6c268d['abortController']};}['upsertAIChatRating'](_0x59951f,_0x5e557f,_0x1086ed){const _0x2782c9=this['_sendApiRequest']('/conversations/'+_0x59951f+'/messages/'+_0x5e557f+'/ratings','PUT',{'positiveCount':_0x1086ed['positiveCount'],'totalCount':_0x1086ed['totalCount'],'modificationId':_0x1086ed['modificationId']});return{'execute':async()=>{await _0x2782c9['request'];},'abortController':_0x2782c9['abortController']};}['upsertAIActionRating'](_0x2a4509,_0x15e921,_0x104218){const _0x5303b3=this['_sendApiRequest']('/actions/system/'+_0x2a4509+'/calls/'+_0x15e921+'/ratings','PUT',{'positiveCount':_0x104218['positiveCount'],'totalCount':_0x104218['totalCount']});return{'execute':async()=>{await _0x5303b3['request'];},'abortController':_0x5303b3['abortController']};}['upsertCustomAIActionRating'](_0x184cbe,_0x1ec556){const _0x566ea3=this['_sendApiRequest']('/actions/custom/calls/'+_0x184cbe+'/ratings','PUT',{'positiveCount':_0x1ec556['positiveCount'],'totalCount':_0x1ec556['totalCount']});return{'execute':async()=>{await _0x566ea3['request'];},'abortController':_0x566ea3['abortController']};}['upsertAIReviewRating'](_0x452d01,_0x59ab23,_0x5b9044,_0x19a77a){const _0x55accd=this['_sendApiRequest']('/reviews/system/'+_0x452d01+'/calls/'+_0x59ab23+'/ratings','PUT',{'positiveCount':_0x5b9044['positiveCount'],'totalCount':_0x5b9044['totalCount'],'dataId':_0x19a77a});return{'execute':async()=>{await _0x55accd['request'];},'abortController':_0x55accd['abortController']};}['upsertCustomAIReviewRating'](_0x38e5fc,_0x7e6b42,_0x1297f8){const _0x58afd8=this['_sendApiRequest']('/reviews/custom/calls/'+_0x38e5fc+'/ratings','PUT',{'positiveCount':_0x7e6b42['positiveCount'],'totalCount':_0x7e6b42['totalCount'],'dataId':_0x1297f8});return{'execute':async()=>{await _0x58afd8['request'];},'abortController':_0x58afd8['abortController']};}['_sendApiRequest'](_0x5611ed,_0x127847,_0x458974,_0xe8d66d=!0x1){const _0x412e24=new AbortController(),_0x50e6aa=_0xe8d66d?_0x127847+':'+_0x5611ed:null;if(_0x50e6aa){const _0x1fc555=this['_responseCache']['get'](_0x50e6aa);if(_0x1fc555)return{'request':_0x1fc555['then'](_0x133617=>_0x133617['clone']()),'abortController':_0x412e24};}const _0x28c39e=_0x458974 instanceof FormData,_0x40549a={'Authorization':'Bearer\x20'+this['_token']?.['value']};_0x458974&&!_0x28c39e&&(_0x40549a['Content-Type']='application/json');const _0xecd22a={'method':_0x127847,'headers':_0x40549a,'signal':_0x412e24['signal']};_0x458974&&(_0xecd22a['body']=_0x28c39e?_0x458974:JSON['stringify'](_0x458974));const _0x4ebb35=fetch(''+this['_apiUrl']+_0x5611ed,_0xecd22a)['catch'](_0x418fb5=>{_0x50e6aa&&this['_responseCache']['delete'](_0x50e6aa),this['_handleError'](_0x418fb5);})['then'](_0x4535f2=>_0x4535f2['ok']?_0x4535f2:_0x4535f2['json']()['then'](_0x480f82=>{throw _0x50e6aa&&this['_responseCache']['delete'](_0x50e6aa),{'url':this['_apiUrl'],'path':_0x5611ed,'method':_0x127847,'body':_0x458974,'status':(_0x4535f2||{})['status'],'statusText':(_0x4535f2||{})['statusText'],'code':_0x480f82['code'],'message':_0x480f82['message'],'traceId':_0x480f82['traceId']};}));return _0x50e6aa&&this['_responseCache']['set'](_0x50e6aa,_0x4ebb35['then'](_0x3004ad=>_0x3004ad['clone']())),{'request':_0x4ebb35,'abortController':_0x412e24};}async*['_getStreamReader'](_0x3ec73a){const _0xfe6990=[],_0x541b06=_0x3ec73a['getReader'](),_0x2d7de0=_0x4994b5({'onError':_0x5db8cb=>{this['_handleError'](_0x5db8cb);},'onEvent':_0x133504=>{_0x133504['data']=JSON['parse'](_0x133504['data']),_0xfe6990['push'](_0x133504);}});try{let _0x3c3e39=!0x1;for(;!_0x3c3e39;){const {done:_0x51417e,value:_0x1679a7}=await _0x541b06['read']();_0x51417e&&(_0x3c3e39=!0x0),_0x2d7de0['feed'](this['_decoder']['decode'](_0x1679a7,{'stream':!0x0})),yield*_0xfe6990,_0xfe6990['length']=0x0;}}catch(_0x150827){this['_handleError'](_0x150827);}finally{_0x541b06['releaseLock'](),_0x2d7de0['reset']();}}['_handleError'](_0x1cfc54){if(_0x1cfc54 instanceof ht)throw _0x1cfc54;if(_0x1cfc54 instanceof Error&&'AbortError'===_0x1cfc54['name'])throw new ht('ai-request-aborted',this,{'originalError':_0x1cfc54});throw new ht('ai-request-failed',this,{'originalError':_0x1cfc54});}}function us(_0xe9c5f0,_0x450f5a,_0x46d9ff){const t=_0xe9c5f0['t'];switch(_0x450f5a){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'},_0x46d9ff);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.'},_0x46d9ff);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.'},_0x46d9ff);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.'},_0x46d9ff);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'},_0x46d9ff);case'AI_CHAT_SUGGESTION_ACTION_SUGGEST':return t({'id':'AI_CHAT_SUGGESTION_ACTION_SUGGEST','string':'Suggest'},_0x46d9ff);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'},_0x46d9ff);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.'},_0x46d9ff);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.'},_0x46d9ff);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.'},_0x46d9ff);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.'},_0x46d9ff);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'},_0x46d9ff);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.'},_0x46d9ff);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 _0x450f5a;}}const ds='ck-ai-button-primary',_s='ck-ai-button-secondary',As='ck-ai-button-tertiary';function gs(_0x32d757,_0x100c4a){const _0xeead37=new Nt(_0x32d757),_0x2f1af6=us(_0x32d757,'AI_TABS_LABEL_MINIMIZE'),_0x42a6c8=us(_0x32d757,'AI_TABS_LABEL_MAXIMIZE');return _0xeead37['set']({'withText':!0x1,'icon':_0x29d93e,'tooltip':!0x0,'class':'ck-ai-tabs__resize\x20'+As}),_0xeead37['bind']('label')['to'](_0x100c4a,'isMaximized',_0x5008dd=>_0x5008dd?_0x2f1af6:_0x42a6c8),_0xeead37['bind']('icon')['to'](_0x100c4a,'isMaximized',_0x5d6b1c=>_0x5d6b1c?_0x359180:_0x29d93e),_0xeead37['bind']('isOn')['to'](_0x100c4a,'isMaximized'),_0xeead37['on']('execute',()=>{_0x100c4a['fire']('resizeTabs');}),_0xeead37;}function Is(_0x4df193){return _0x47e8d7(_0x4df193);}function Es(_0x2cf9f5){return _0x5f5c12(_0x2cf9f5);}function ps(_0x15e5eb,_0x2f1744,_0x3560b1){const _0x278571=null!==_0x2f1744?_0x1c80d7=>_0x1c80d7['attribs'][_0x15e5eb]===_0x2f1744:_0x261872=>Boolean(_0x261872['attribs'][_0x15e5eb]);return _0x6acb98(_0x2d2dc4=>_0x17c0c2(_0x2d2dc4)&&_0x278571(_0x2d2dc4),_0x3560b1);}function Ts(_0x7bcbd6,_0x5c305d,_0x4773f5){const _0x4df4bd=null!==_0x5c305d?_0x2ed625=>_0x2ed625['attribs'][_0x7bcbd6]===_0x5c305d:_0x5c82df=>Boolean(_0x5c82df['attribs'][_0x7bcbd6]);return _0x1478d3(_0x144fb9=>_0x17c0c2(_0x144fb9)&&_0x4df4bd(_0x144fb9),_0x4773f5);}function ms(_0x5f08c4,_0x2979d9){return _0x5f08c4&&_0x17c0c2(_0x5f08c4)?_0x5f08c4['attribs'][_0x2979d9]:null;}function Cs(_0xf71a7d,_0x5a49ed,_0x3cc3e1){_0x17c0c2(_0xf71a7d)&&(null===_0x3cc3e1?delete _0xf71a7d['attribs'][_0x5a49ed]:_0xf71a7d['attribs'][_0x5a49ed]=_0x3cc3e1);}function ws(_0x3e4ce7,_0x451b1a,_0x3a63cb){const _0x415e09=_0x451b1a['cloneNode'](!0x0);'beforebegin'===_0x3a63cb?_0xec914b(_0x3e4ce7,_0x415e09):'afterbegin'===_0x3a63cb?_0x2418d7(_0x3e4ce7,_0x415e09):'beforeend'===_0x3a63cb?_0x525206(_0x3e4ce7,_0x415e09):'afterend'===_0x3a63cb&&_0x21518e(_0x3e4ce7,_0x415e09);}function fs(_0x54d4a6){const _0xf3e0a4=[];let _0x37914d=_0x54d4a6;for(;_0x37914d;)_0x37914d=_0x1e3861(_0x37914d),_0x37914d&&_0xf3e0a4['push'](_0x37914d);return _0xf3e0a4;}function Ss(_0x1d18ed){return _0x1d18ed['replace'](/^\s+/gm,'')['replace'](/\s+$/gm,'')['replace'](/\n*/g,'')['replace'](/\s+/g,'\x20')['replace'](/>\s*</g,'><');}function bs(_0x2f4149){let _0x908bd1=0x0;for(;_0x2f4149['parentNode'];)_0x2f4149=_0x2f4149['parentNode'],_0x908bd1++;return _0x908bd1;}function Rs(_0x33b7d3){const _0xd7c999=[];let _0x1e0648=_0x33b7d3['nextSibling'];for(;_0x1e0648;)_0xd7c999['push'](_0x1e0648),_0x1e0648=_0x1e0648['nextSibling'];_0xd7c999['forEach'](_0x1beb5e=>{_0x28c1a9(_0x1beb5e);});}class Os extends/* #__PURE__ -- @preserve */
25
+ ct(){['_m2html'];constructor(){super();const _0x5e0912=Object['entries'](_0x23a25),_0x5d877b=_0x5e0912['findIndex'](([_0x3301e6])=>'rehypeDomRaw'===_0x3301e6);if(-0x1===_0x5d877b)throw new ht('ai-response-parser-unable-to-set-up-parser');_0x5e0912['splice'](_0x5d877b+0x1,0x0,['rehypeSanitize',_0x22aed0]),this['_m2html']=new _0x1fd6c4({'plugins':Object['fromEntries'](_0x5e0912)});}['convertMarkdownToHTML'](_0x356526){const _0x2fd530=this['_m2html']['parse'](_0x356526);return this['parseAndNormalizeHTML'](_0x2fd530);}['parseAndNormalizeHTML'](_0x124aac){return this['_parseHTML'](_0x124aac);}['_parseHTML'](_0x58118d){const _0x1c0f4b=Is('<dummy>'+_0x58118d['replace'](/^\t+/gm,'\x20')['replace'](/\n*/g,'')['replace'](/\s+/g,'\x20')['replace'](/<[^>]*?$/g,'')+'</dummy>');return _0x1c0f4b['children']=_0x1c0f4b['children'][0x0]['children'],_0x1c0f4b;}}class ks extends/* #__PURE__ -- @preserve */
26
+ ct(){['_generateUid'];['_touchedNodesState']={'newIds':[],'modifiedIds':[],'removedIds':[],'invalidIds':[],'lastTouchedId':null};['_existingDataIds']=new Set();constructor(_0x27ae0a){super(),this['_generateUid']=_0x27ae0a||ot;}['merge'](_0x2aeb1f,_0x11e6f8,_0x5b88a0){const _0x2732ad=_0x2aeb1f['cloneNode'](!0x0);if(0x0===_0x11e6f8['childNodes']['length']){const _0x2a7aec=[];return Ts('data-id','new-element',_0x2732ad)['forEach'](_0x42a0ba=>{const _0x4828ec=this['_generateUid']();Cs(_0x42a0ba,'data-id',_0x4828ec),_0x2a7aec['push'](_0x4828ec);}),this['_removeSpecialComments'](_0x2732ad),{'parsedContent':_0x2732ad,'newNodeIds':_0x2a7aec,'modifiedNodeIds':[],'removedNodeIds':[]};}_0x5b88a0&&_0x5b88a0['markUnstableElements']&&this['_markLastTagElementUnstable'](_0x2732ad),this['_touchedNodesState']['newIds']=[],this['_touchedNodesState']['modifiedIds']=[],this['_touchedNodesState']['removedIds']=[],this['_touchedNodesState']['invalidIds']=[],this['_touchedNodesState']['lastTouchedId']=null,this['_existingDataIds']=new Set(Ts('data-id',null,_0x11e6f8)['map'](_0x468ef4=>ms(_0x468ef4,'data-id'))['filter'](_0x27238f=>!!_0x27238f));let _0x55631b=-0x1,_0x268034=!0x1;const _0x2430c1=_0x2732ad['childNodes'],_0x5572fd=Array['from'](_0x2430c1)['filter'](_0x30bafd=>!(0x3===_0x30bafd['nodeType']&&''===Es(_0x30bafd)['trim']())),_0x2f9f33=_0x5572fd['length'];for(let _0x42b77d=0x0;_0x42b77d<_0x2f9f33;_0x42b77d++){const _0x52a52e=_0x5572fd[_0x42b77d],_0x2193c5=_0x5572fd[_0x42b77d+0x1];if(this['_isNewNode'](_0x52a52e)){if(-0x1===_0x55631b&&(_0x55631b=_0x42b77d),this['_markWrappedElements'](_0x52a52e),!this['_isNewNode'](_0x2193c5)){const [_0x39cc67,_0x2cca99]=this['_findReferenceNode'](_0x52a52e,_0x268034,_0x11e6f8);if(_0x39cc67){const _0x32b679=Array['from'](_0x5572fd)['slice'](_0x55631b,_0x42b77d+0x1);this['_insertNodes'](_0x39cc67,_0x32b679,_0x2cca99),_0x55631b=-0x1;}}}else{if(this['_isExistingContentComment'](_0x52a52e))_0x268034=!0x0;else{if(this['_isExistingNode'](_0x52a52e)){const _0x1c68c9=ms(_0x52a52e,'data-id');if(_0x1c68c9&&this['_existingDataIds']['has'](_0x1c68c9)){const _0x26765a=ps('data-id',_0x1c68c9,_0x11e6f8);this['_replaceNode'](_0x26765a,_0x52a52e);}if(this['_touchedNodesState']['removedIds']['includes'](_0x1c68c9)){const _0x354549=this['_touchedNodesState']['removedIds']['indexOf'](_0x1c68c9);this['_touchedNodesState']['removedIds']['splice'](_0x354549,0x1);}}else{if(this['_isDelNode'](_0x52a52e)){const _0x3aa9af=ms(_0x52a52e,'data-id');this['_touchedNodesState']['modifiedIds']['includes'](_0x3aa9af)||this['_storeDeletedElementIds'](_0x52a52e);}}}}}for(const _0x407a8a of this['_touchedNodesState']['removedIds']){const _0x4215b6=ps('data-id',_0x407a8a,_0x11e6f8);if(_0x4215b6){if(_0x5b88a0&&_0x5b88a0['replaceRemovedWith']){this['_touchedNodesState']['lastTouchedId']=_0x407a8a;const _0xb9a1d2=_0x5b88a0['replaceRemovedWith']['cloneNode'](!0x0);Cs(_0xb9a1d2,'data-id',_0x407a8a),Cs(_0xb9a1d2,'data-removed','true'),_0x46a82a(_0x4215b6,_0xb9a1d2);}else _0x28c1a9(_0x4215b6);}}if(Ts('data-wrapped-id',null,_0x11e6f8)['forEach'](_0x47cbe6=>{const _0x4502ad=ps('data-id',ms(_0x47cbe6,'data-wrapped-id'),_0x11e6f8);var _0x5284bf,_0x5e6b84;_0x4502ad&&(_0x5e6b84=_0x47cbe6,_0x28c1a9(_0x5284bf=_0x4502ad),_0x46a82a(_0x5e6b84,_0x5284bf));}),Ts('data-id','new-element',_0x11e6f8)['forEach'](_0xfca70f=>{const _0x9e220c=this['_getUid'](_0xfca70f);Cs(_0xfca70f,'data-id',_0x9e220c),this['_touchedNodesState']['newIds']['push'](_0x9e220c);}),this['_removeSpecialComments'](_0x11e6f8),_0x5b88a0&&_0x5b88a0['markUnstableElements']&&this['_markUnstableElements'](_0x11e6f8,_0x5b88a0['markUnstableElementsDepth']||0x0),_0x5b88a0&&_0x5b88a0['cutAfterLastChange']&&this['_touchedNodesState']['lastTouchedId']){let _0x29f798=ps('data-id',this['_touchedNodesState']['lastTouchedId'],_0x11e6f8);for(;_0x29f798;)Rs(_0x29f798),_0x29f798=_0x29f798['parentNode'];}return{'parsedContent':_0x11e6f8,'newNodeIds':this['_touchedNodesState']['newIds'],'modifiedNodeIds':this['_touchedNodesState']['modifiedIds'],'removedNodeIds':this['_touchedNodesState']['removedIds']};}['_insertNodes'](_0x137d6e,_0x70a1a7,_0x593588){for(const _0x1d2fd6 of _0x70a1a7){const _0x55c27f=this['_getUid'](_0x1d2fd6);Cs(_0x1d2fd6,'data-id',_0x55c27f),this['_touchedNodesState']['newIds']['push'](_0x55c27f),this['_touchedNodesState']['lastTouchedId']=_0x55c27f;}const _0x58b0a4='afterbegin'===_0x593588||'afterend'===_0x593588?_0x70a1a7['reverse']():_0x70a1a7;for(const _0x2a21f9 of _0x58b0a4)ws(_0x137d6e,_0x2a21f9,_0x593588);}['_replaceNode'](_0x4fb466,_0xe2536e){if(!_0x4fb466)return;if(_0x3b3c0d=_0xe2536e,Ss(Es(_0x4fb466))===Ss(Es(_0x3b3c0d)))return;var _0x3b3c0d;const _0x59c98b=this['_getUid'](_0x4fb466);Cs(_0xe2536e,'data-id',_0x59c98b),this['_touchedNodesState']['modifiedIds']['push'](_0x59c98b),this['_touchedNodesState']['lastTouchedId']=_0x59c98b,_0x46a82a(_0x4fb466,_0xe2536e['cloneNode'](!0x0));}['_findReferenceNode'](_0x167324,_0x3de19b,_0x1f7bc3){const _0x58fed0=this['_findPrevElementWithDataId'](_0x167324,!0x1);if(_0x58fed0){const _0xaa33e3=this['_getNodeDataId'](_0x58fed0),_0x575bab=ps('data-id',_0xaa33e3,_0x1f7bc3);if(_0x575bab)return[_0x575bab,'afterend'];this['_touchedNodesState']['invalidIds']['push'](_0xaa33e3);}const _0x53ce23=this['_findNextElementWithDataId'](_0x167324,!0x1);if(_0x53ce23){const _0x1f2e1e=this['_getNodeDataId'](_0x53ce23),_0x39e225=ps('data-id',_0x1f2e1e,_0x1f7bc3);if(_0x39e225)return[_0x39e225,'beforebegin'];this['_touchedNodesState']['invalidIds']['push'](_0x1f2e1e);}return _0x3de19b?_0x167324['nextSibling']?this['_findFallbackReferenceNode'](_0x167324,_0x1f7bc3):[_0x1f7bc3['childNodes'][_0x1f7bc3['childNodes']['length']-0x1],'afterend']:[_0x1f7bc3['childNodes'][0x0],'beforebegin'];}['_findFallbackReferenceNode'](_0x5ad4f5,_0x5e6961){const _0x3701fe=[],_0x468dbd=this['_findPrevElementWithDataId'](_0x5ad4f5,!0x0);if(_0x468dbd){const _0x2acca2=ps('data-id',this['_getNodeDataId'](_0x468dbd),_0x5e6961);_0x2acca2&&_0x3701fe['push']([_0x2acca2,'afterend']);}const _0x4b7a29=this['_findNextElementWithDataId'](_0x5ad4f5,!0x0);if(_0x4b7a29){const _0xea8701=ps('data-id',this['_getNodeDataId'](_0x4b7a29),_0x5e6961);_0xea8701&&_0x3701fe['push']([_0xea8701,'beforebegin']);}if(_0x3701fe['length']>0x1)return bs(_0x3701fe[0x0][0x0])<=bs(_0x3701fe[0x1][0x0])?_0x3701fe[0x0]:_0x3701fe[0x1];return 0x1===_0x3701fe['length']?_0x3701fe[0x0]:[_0x5e6961['lastChild'],'afterend'];}['_findNextElementWithDataId'](_0x3a0387,_0x49da10){let _0x1ea092=_0x3a0387['nextSibling'],_0x5b9a7b=null,_0x2f46a1=!0x1;for(;_0x1ea092;){if(_0x1832fa(_0x1ea092)){if(this['_isDelNode'](_0x1ea092)&&(_0x5b9a7b=_0x1ea092),this['_isExistingContentComment'](_0x1ea092)&&_0x49da10&&!_0x2f46a1){_0x2f46a1=!0x0,_0x1ea092=_0x1ea092['nextSibling'];continue;}break;}const _0x1cb08b=ms(_0x1ea092,'data-id');if(_0x1cb08b&&'new-element'!==_0x1cb08b&&this['_existingDataIds']['has'](_0x1cb08b)){_0x5b9a7b=_0x1ea092;break;}_0x1ea092=_0x1ea092['nextSibling'];}return _0x5b9a7b;}['_findPrevElementWithDataId'](_0x38d328,_0x44273c){let _0xf98b4e=_0x38d328['previousSibling'],_0x30e470=null,_0x815d78=!0x1;for(;_0xf98b4e;){if(_0x1832fa(_0xf98b4e)){if(this['_isDelNode'](_0xf98b4e)&&(_0x30e470=_0xf98b4e),this['_isExistingContentComment'](_0xf98b4e)&&_0x44273c&&!_0x815d78){_0x815d78=!0x0,_0xf98b4e=_0xf98b4e['previousSibling'];continue;}break;}const _0x1d050e=ms(_0xf98b4e,'data-id');if(_0x1d050e&&'new-element'!==_0x1d050e&&this['_existingDataIds']['has'](_0x1d050e)){_0x30e470=_0xf98b4e;break;}_0xf98b4e=_0xf98b4e['previousSibling'];}return _0x30e470;}['_markWrappedElements'](_0x1b8145){_0x17c0c2(_0x1b8145)&&Ts('data-id',null,_0x1b8145)['forEach'](_0x26b707=>{this['_isExistingNode'](_0x26b707)&&!this['_hasWrappedParent'](_0x26b707)&&(Cs(_0x26b707,'data-wrapped-id',ms(_0x26b707,'data-id')),Cs(_0x26b707,'data-id',null));});}['_getNodeDataId'](_0x1eb3ba){if(!_0x1eb3ba)return null;if(_0x17c0c2(_0x1eb3ba))return ms(_0x1eb3ba,'data-id');if(_0x1832fa(_0x1eb3ba)){const _0x3b6afd=Es(_0x1eb3ba)['match'](/removed[\s*-]data-id="([^"]+)"/);if(_0x3b6afd&&_0x3b6afd[0x1])return _0x3b6afd[0x1];}return null;}['_storeDeletedElementIds'](_0x238f8d){if(_0x1832fa(_0x238f8d)){const _0x35ee9=Es(_0x238f8d)['match'](/removed[\s*-]data-id="([^"]+)"/);_0x35ee9&&_0x35ee9[0x1]&&this['_touchedNodesState']['removedIds']['push'](_0x35ee9[0x1]);}}['_getUid'](_0xfbbe50){return this['_isExistingNode'](_0xfbbe50)?ms(_0xfbbe50,'data-id'):this['_generateUid']();}['_removeSpecialComments'](_0x52e07f){(function(_0x45667b){return _0x39fcff(_0x224f3e=>_0x1832fa(_0x224f3e),_0x45667b,!0x0,0x1/0x0);}(_0x52e07f)['filter'](_0xe8e27a=>this['_isDelNode'](_0xe8e27a)||this['_isExistingContentComment'](_0xe8e27a))['forEach'](_0x1bb839=>{_0x28c1a9(_0x1bb839);}));}['_markLastTagElementUnstable'](_0x47a0c){const _0x5d9642=_0x47a0c['childNodes'],_0x18e820=_0x5d9642[_0x5d9642['length']-0x1];_0x18e820&&_0x17c0c2(_0x18e820)&&Cs(_0x18e820,'data-unstable','true');}['_markUnstableElements'](_0x3db58a,_0x3a5b21){const _0x329d75=ps('data-unstable','true',_0x3db58a);if(!_0x329d75)return;const _0x3a3bdf=fs(_0x329d75)['slice'](0x0,-0x1),_0x19fd96=_0x3a3bdf['length'];let _0x349053=_0x329d75;if(_0x19fd96>_0x3a5b21){let _0x1a828a=_0x19fd96,_0x21d75b=null;for(;_0x1a828a>_0x3a5b21&&_0x1a828a>=0x0;)_0x1a828a--,_0x21d75b=_0x3a3bdf[_0x1a828a];_0x21d75b&&(_0x349053=_0x21d75b,Cs(_0x329d75,'data-unstable',null),Cs(_0x21d75b,'data-unstable','true'));}else{if(_0x19fd96<_0x3a5b21){let _0x208bfb=_0x19fd96,_0x36a181=_0x329d75;for(;_0x208bfb<_0x3a5b21;){const _0x2860ba=_0x36a181['childNodes']['filter'](_0x2d244c=>_0x17c0c2(_0x2d244c));if(0x0===_0x2860ba['length'])break;_0x208bfb++,_0x36a181=_0x2860ba[_0x2860ba['length']-0x1];}_0x36a181&&(_0x349053=_0x36a181,Cs(_0x329d75,'data-unstable',null),Cs(_0x36a181,'data-unstable','true'));}}let _0x516408=_0x349053;for(;_0x516408;){for(;_0x516408['nextSibling'];)_0x516408=_0x516408['nextSibling'],_0x17c0c2(_0x516408)&&Cs(_0x516408,'data-unstable','true');_0x516408=_0x516408['parentNode'];}}['_isNewNode'](_0x4e4e48){return Boolean('new-element'===ms(_0x4e4e48,'data-id'));}['_isExistingNode'](_0x4dd428){return Boolean((ms(_0x4dd428,'data-id')||'')['length']>0x0&&'new-element'!==ms(_0x4dd428,'data-id'));}['_isDelNode'](_0x365c97){return!!_0x365c97&&Boolean(_0x1832fa(_0x365c97)&&Es(_0x365c97)['match'](/removed[\s*-]data-id="[^"]+"/));}['_hasWrappedParent'](_0x527786){let _0x44b2e6=_0x527786['parentNode'];for(;_0x44b2e6;){if(ms(_0x44b2e6,'data-wrapped-id'))return!0x0;_0x44b2e6=_0x44b2e6['parentNode'];}return!0x1;}['_isExistingContentComment'](_0x3ab666){return Boolean(_0x1832fa(_0x3ab666)&&Es(_0x3ab666)['match'](/\s*existing[\s*-](content|document)\s*/g));}}function Ns({editor:_0x43af1f,changeGroups:_0x1c9f0f,documentContextContent:_0x28186a,showDiff:_0x3d7356,trimUnchanged:_0x3ddf8e=!0x0}){return _0x1c9f0f['map'](_0x5f0e7d=>{const _0x5aeb23=new _0x11db27([]),_0xe4e464=new _0x11db27([]);for(const _0x5e50ad of _0x5f0e7d['changes'])if(_0x3d7356&&'removed'==_0x5e50ad['type']||_0xe4e464['children']['push'](_0x5e50ad['node']['cloneNode'](!0x0)),'new'!=_0x5e50ad['type']&&(_0x3d7356||'removed'!=_0x5e50ad['type'])){const _0x4eecc8=_0x6acb98(_0x3a1f12=>ms(_0x3a1f12,'data-id')==_0x5e50ad['id'],_0x28186a,!0x0);_0x4eecc8&&_0x5aeb23['children']['push'](_0x4eecc8['cloneNode'](!0x0));}const {content:_0x914573,hasChanges:_0x46d771}=function(_0x584e5d,_0x297438,_0x5a5d4e,_0x53e4cf,_0x306e2c=!0x0){const _0x26c77a=_0x584e5d['plugins']['get']('DocumentCompare'),_0x4a3c50=Es(_0x297438),_0x53fd62=Es(_0x5a5d4e),_0x50754e=_0x584e5d['data']['parse'](_0x4a3c50,'$root'),_0x2eb836=_0x584e5d['model']['createPositionAt'](_0x50754e,0x0),_0x3d061d=_0x26c77a['getDiff'](_0x4a3c50,_0x53fd62,{'anchor':_0x2eb836,'markDeletions':_0x53e4cf}),_0x1523d9=_0x3d061d['getOperations']();if(0x0==_0x1523d9['length'])return{'content':_0x297438['cloneNode'](!0x0),'hasChanges':!0x1};_0x53e4cf?function(_0x40866c,_0x3ca569,_0x2f26de){if(0x0==_0x40866c['length'])return;const _0x3bb184=_0x2f26de['plugins']['get']('DocumentCompare'),_0x5426d1=_0x2f26de['plugins']['get']('SuggestionsConversion');_0x2f26de['model']['change'](_0x369f95=>{const _0x57a751=new Set();for(let _0x13b51b=0x0;_0x13b51b<_0x40866c['length'];_0x13b51b++){const _0x41fdfe=_0x40866c[_0x13b51b];if(_0x41fdfe['baseVersion']=null,_0x41fdfe['isDocumentOperation']=!0x1,_0x3bb184['isMarkedRemoveOperation'](_0x41fdfe)){const _0x140bf5=_0x4b85e0(_0x41fdfe['newRange'],_0x2f26de['model']),_0x2d6d74='suggestion:deletion:'+ot()+':$aiSuggestion';_0x3ca569['markers']['set'](_0x2d6d74,_0x140bf5);}else switch(_0x41fdfe['type']){case'rename':{if(_0x41fdfe['oldName']==_0x41fdfe['newName'])break;_0x369f95['batch']['addOperation'](_0x41fdfe),_0x2f26de['model']['applyOperation'](_0x41fdfe);const _0x21d281='$elementName',_0x3d8e1a=_0x41fdfe['position'],_0x720cd=_0x2f26de['model']['createRange'](_0x3d8e1a,_0x2f26de['model']['createPositionAt'](_0x3d8e1a['nodeAfter'],'end')),_0x26275c='suggestion:attribute:'+_0x21d281+':'+ot()+':$aiSuggestion';_0x3ca569['markers']['set'](_0x26275c,_0x720cd);break;}case'addAttribute':case'removeAttribute':case'changeAttribute':{if(_0x41fdfe['oldValue']==_0x41fdfe['newValue'])break;_0x369f95['batch']['addOperation'](_0x41fdfe),_0x2f26de['model']['applyOperation'](_0x41fdfe);const _0x1765fd=_0x41fdfe['key'];if(!_0x5426d1['isRegisteredAttribute'](_0x1765fd))break;const _0x3c1eeb=_0x4b85e0(_0x41fdfe['range'],_0x2f26de['model']),_0x338efc='suggestion:attribute:'+_0x1765fd+':'+ot()+':$aiSuggestion';_0x3ca569['markers']['set'](_0x338efc,_0x3c1eeb);break;}case'insert':{_0x369f95['batch']['addOperation'](_0x41fdfe),_0x2f26de['model']['applyOperation'](_0x41fdfe);if(_0x40866c[_0x13b51b+0x1]&&'move'==_0x40866c[_0x13b51b+0x1]['type']){vs(_0x3ca569,_0x41fdfe);break;}const _0x2aca40=_0x41fdfe['position'],_0x3b3c52=_0x41fdfe['howMany'],_0x118602=_0x4b85e0(_0x2f26de['model']['createRange'](_0x2aca40,_0x2aca40['getShiftedBy'](_0x3b3c52)),_0x2f26de['model']),_0x78b2b5='suggestion:insertion:'+ot()+':$aiSuggestion';_0x3ca569['markers']['set'](_0x78b2b5,_0x118602);break;}case'split':{_0x369f95['batch']['addOperation'](_0x41fdfe),_0x2f26de['model']['applyOperation'](_0x41fdfe);const _0x2a861c=_0x41fdfe['splitPosition'],_0x40aebd=_0x41fdfe['moveTargetPosition'],_0x40738d=_0x2f26de['model']['createRange'](_0x2a861c,_0x40aebd),_0x43beb4='suggestion:insertion:'+ot()+':$aiSuggestion';_0x3ca569['markers']['set'](_0x43beb4,_0x40738d);break;}case'move':{_0x369f95['batch']['addOperation'](_0x41fdfe),_0x2f26de['model']['applyOperation'](_0x41fdfe),_0x40866c[_0x13b51b-0x1]&&'insert'==_0x40866c[_0x13b51b-0x1]['type']&&vs(_0x3ca569,_0x41fdfe);const _0x31ffd4=_0x41fdfe['getMovedRangeStart'](),_0x1f4beb=_0x41fdfe['howMany'];for(let _0x16f49b=0x0;_0x16f49b<_0x1f4beb;_0x16f49b++){const _0x338439=_0x31ffd4['getShiftedBy'](_0x16f49b)['nodeAfter'];_0x57a751['add'](_0x338439);}break;}case'remove':{const _0x434472=_0x41fdfe['sourcePosition'],_0x2d33bb=_0x41fdfe['howMany'],_0x20eb9d=new _0x2a791f(_0x434472,_0x2d33bb);_0x369f95['batch']['addOperation'](_0x20eb9d),_0x2f26de['model']['applyOperation'](_0x20eb9d);break;}}}for(const _0xd57a26 of _0x57a751){const _0x149879=_0x2f26de['model']['createRangeOn'](_0xd57a26),_0x19bc8e='suggestion:formatBlock:$fakeWrap:'+ot()+':$aiSuggestion';_0x3ca569['markers']['set'](_0x19bc8e,_0x4b85e0(_0x149879,_0x2f26de['model']));}});}(_0x1523d9,_0x50754e,_0x584e5d):_0x584e5d['model']['change'](_0x46329d=>{for(const _0x388462 of _0x1523d9)if('remove'==_0x388462['type']){const _0x422d33=_0x388462['sourcePosition'],_0x387fa7=_0x388462['howMany'],_0x56e182=new _0x2a791f(_0x422d33,_0x387fa7);_0x46329d['batch']['addOperation'](_0x56e182),_0x584e5d['model']['applyOperation'](_0x56e182);}else{if('marker'==_0x388462['type']){const _0x3df601=_0x388462['name'],_0x3eeb00=_0x388462['newRange'];null!==_0x3eeb00?_0x50754e['markers']['set'](_0x3df601,_0x3eeb00):_0x50754e['markers']['delete'](_0x3df601);}else _0x388462['baseVersion']=null,_0x388462['isDocumentOperation']=!0x1,_0x46329d['batch']['addOperation'](_0x388462),_0x584e5d['model']['applyOperation'](_0x388462);}});if(_0x306e2c){const _0x5f3aba=ys(_0x584e5d,_0x1523d9,_0x50754e);xs(_0x584e5d['model'],_0x5f3aba),function(_0x4970f9,_0x4d49cd){const _0xbd3ca0=_0x4d49cd['getFirstRange']()['start'];let _0x59bbd4=_0x4d49cd['getFirstRange']()['end'];const _0x29b46d=_0xbd3ca0['root'];(_0x59bbd4['textNode']||_0x59bbd4['nodeAfter']&&_0x59bbd4['nodeAfter']['is']('$text'))&&(_0x4b1c53(_0x59bbd4,'...'),_0x59bbd4=_0x59bbd4['getShiftedBy'](0x3)),(_0xbd3ca0['textNode']||_0xbd3ca0['nodeBefore']&&_0xbd3ca0['nodeBefore']['is']('$text'))&&(_0x4b1c53(_0xbd3ca0,'...'),function(_0x497b1e,_0xb38581,_0xf75a09){for(let [_0x42eebd,_0x4aec03]of _0x497b1e['markers']){const _0x3a0b0b=_0x4aec03['_getTransformedByInsertion'](_0xb38581,_0xf75a09,!0x1);_0x4aec03=_0x3a0b0b[0x0],_0x497b1e['markers']['set'](_0x42eebd,_0x4aec03);}}(_0x29b46d,_0xbd3ca0,0x3),_0xbd3ca0['parent']==_0x59bbd4['parent']&&(_0x59bbd4=_0x59bbd4['getShiftedBy'](0x3)));const _0x3ae4ec=_0x4970f9['createRange'](_0x4970f9['createPositionAt'](_0x29b46d,0x0),_0xbd3ca0),_0x3dfb27=_0x4970f9['createRange'](_0x59bbd4,_0x4970f9['createPositionAt'](_0x29b46d,'end')),_0x3cc2e0=[..._0x3ae4ec['getMinimalFlatRanges'](),..._0x3dfb27['getMinimalFlatRanges']()];_0x3cc2e0['reverse']();for(const _0x3addc0 of _0x3cc2e0)_0x178cab(_0x3addc0),Ds(_0x29b46d,_0x3addc0);}(_0x584e5d['model'],_0x5f3aba);}const _0x3d50d3=_0x584e5d['data']['stringify'](_0x50754e,{'showSuggestionHighlights':!0x0});return{'content':Is(_0x3d50d3),'hasChanges':!0x0};}(_0x43af1f,_0x5aeb23,_0xe4e464,_0x3d7356,_0x3ddf8e);return{'type':_0x5f0e7d['changes'][0x0]['type'],'index':_0x5f0e7d['index'],'content':_0x914573,'hasChanges':_0x46d771};});}function vs(_0x4709ce,_0xd9fc7a){for(const [_0x3ae0bb,_0x16006f]of _0x4709ce['markers']){const _0x36bc4a=_0x5258a6['_createFromRanges'](_0x16006f['getTransformedByOperation'](_0xd9fc7a));_0x4709ce['markers']['set'](_0x3ae0bb,_0x36bc4a);}}function ys(_0x291587,_0x7e3900,_0x28f286){const _0x5414a3=_0x291587['plugins']['get']('DocumentCompare');let _0x1631a3=_0x291587['model']['createPositionAt'](_0x28f286,Number['POSITIVE_INFINITY']),_0x4db981=_0x291587['model']['createPositionAt'](_0x28f286,0x0);for(const _0x455c5c of _0x7e3900){let _0x4d3b7a,_0x393702;if(_0x5414a3['isMarkedRemoveOperation'](_0x455c5c))_0x4d3b7a=_0x455c5c['newRange']['start'],_0x393702=_0x455c5c['newRange']['end'];else switch(_0x1631a3=_0x1631a3['getTransformedByOperation'](_0x455c5c),_0x4db981=_0x4db981['getTransformedByOperation'](_0x455c5c),_0x455c5c['type']){case'rename':_0x4d3b7a=_0x455c5c['position'],_0x393702=_0x4d3b7a['getShiftedBy'](0x1);break;case'addAttribute':case'removeAttribute':case'changeAttribute':_0x4d3b7a=_0x455c5c['range']['start'],_0x393702=_0x455c5c['range']['end'];break;case'insert':_0x4d3b7a=_0x455c5c['position'],_0x393702=_0x4d3b7a['getShiftedBy'](_0x455c5c['howMany']);break;case'split':_0x4d3b7a=_0x455c5c['splitPosition'],_0x393702=_0x455c5c['moveTargetPosition'];break;case'merge':{const _0x2feaff=_0x455c5c['targetPosition']['path']['slice'](0x0,-0x1);_0x4d3b7a=_0x291587['model']['createPositionFromPath'](_0x28f286,_0x2feaff),_0x393702=_0x4d3b7a['getShiftedBy'](0x1);break;}case'remove':{const _0x593187=_0x455c5c['howMany'],_0x5928b0=_0x455c5c['sourcePosition']['_getTransformedByInsertion'](_0x455c5c['targetPosition'],_0x593187),_0x5b5022=_0x455c5c['getMovedRangeStart']();'remove'==_0x455c5c['type']?(_0x4d3b7a=_0x5928b0,_0x393702=_0x5928b0):(_0x4d3b7a=_0x5b5022,_0x393702=_0x5b5022['getShiftedBy'](_0x593187));break;}}_0x4d3b7a&&_0x4d3b7a['isBefore'](_0x1631a3)&&(_0x1631a3=_0x4d3b7a['clone'](),_0x1631a3['stickiness']='toNone'),_0x393702&&_0x393702['isAfter'](_0x4db981)&&(_0x4db981=_0x393702['clone'](),_0x4db981['stickiness']='toNone');}return _0x291587['model']['createSelection'](_0x291587['model']['createRange'](_0x1631a3,_0x4db981));}function xs(_0x4476a3,_0x196ca4){Ls(_0x4476a3,_0x196ca4,'forward');const _0x26c98b=_0x196ca4['getFirstRange']();_0x196ca4['setTo']([]),_0x196ca4['setTo'](_0x26c98b,{'backward':!0x0}),Ls(_0x4476a3,_0x196ca4,'backward');}function Ls(_0x58e8bf,_0x3f19ab,_0x4b4b44){let _0x2a2d67=0x14;for(;_0x2a2d67;){_0x58e8bf['modifySelection'](_0x3f19ab,{'unit':'word','direction':_0x4b4b44}),_0x2a2d67--;const _0x56e7e0=_0x3f19ab['focus']['forward'==_0x4b4b44?'nodeBefore':'nodeAfter'];if(_0x56e7e0&&_0x56e7e0['is']('element')&&_0x58e8bf['schema']['isBlock'](_0x56e7e0)&&_0x58e8bf['schema']['isObject'](_0x56e7e0))break;}}function Ds(_0x332f1a,_0x5760ea){for(const [_0x15bf9a,_0x4bc52b]of _0x332f1a['markers']){const _0x1c7b30=_0x4bc52b['_getTransformedByDeletion'](_0x5760ea['start'],_0x5760ea['end']['offset']-_0x5760ea['start']['offset']);null!=_0x1c7b30?_0x332f1a['markers']['set'](_0x15bf9a,_0x1c7b30):_0x332f1a['markers']['delete'](_0x15bf9a);}}class Ps extends ct(){['id'];['interactionId'];['type'];['sources']=[];['parsedContent']=new _0x11db27([]);['parsedMergedContent']=new _0x11db27([]);['changeGroups']=[];['areActionsDisabled']=!0x1;['documentContextContent'];['aiResponseParser'];['aiResponseApplier'];['editor'];['cachedSuggestionContentParts']={'withDiff':[],'withoutDiff':[]};constructor({type:_0x39ce20,content:_0x410966='',isDone:_0x3f1b5b=!0x1,interactionId:_0x1a0b71,areActionsDisabled:_0x82665d,documentContextContent:_0x393639,editor:_0x300b52,id:_0x3733dd}){super(),this['id']=_0x3733dd||ot(),this['interactionId']=_0x1a0b71,this['type']=_0x39ce20,this['areActionsDisabled']=!!_0x82665d,this['editor']=_0x300b52,this['aiResponseParser']=new Os(),this['aiResponseApplier']=new ks(),this['documentContextContent']=Is(_0x393639||''),this['set']('isDone',_0x3f1b5b),this['on']('change:content',()=>{this['onContentChange']();}),this['set']('content',_0x410966);}['appendContent'](_0x4f950b){this['set']('content',this['content']+_0x4f950b);}['done'](){this['isDone']||(this['set']('isDone',!0x0),this['onContentChange']());}['destroy'](){this['stopListening']();}['setChangeGroupState'](_0x4a4478,_0x21c139){this['changeGroups'][_0x4a4478]['state']=_0x21c139,this['fire']('replyChangeGroupStateUpdated',{'reply':this,'index':_0x4a4478,'state':_0x21c139});}['getContentParts']({showDiff:_0x52c2fb,groupIndex:_0xb97802}){if(!this['editor'])throw new ht('ai-get-editor-from-context-no-editor',null,{'aiReply':this});const _0x437b73=this['_getCachedContentParts'](_0x52c2fb,_0xb97802);if(_0x437b73)return _0x437b73;let _0x58ded3=[];if(void 0x0===_0xb97802)_0x58ded3=this['changeGroups'];else{const _0x18cb4d=this['changeGroups']['find'](({index:_0x57bbd8})=>_0x57bbd8===_0xb97802);if(!_0x18cb4d)throw new ht('ai-reply-get-content-parts-group-not-found',null,{'aiReply':this,'groupIndex':_0xb97802});_0x58ded3=[_0x18cb4d];}const _0x35a295=Ns({'editor':this['editor'],'showDiff':_0x52c2fb,'changeGroups':_0x58ded3,'documentContextContent':this['documentContextContent']});return this['_setCachedContentParts'](_0x52c2fb,_0x35a295),_0x35a295;}['_getCachedContentParts'](_0x3e1e82,_0x3c7ac2){const _0x471440=_0x3e1e82?'withDiff':'withoutDiff';if(!this['cachedSuggestionContentParts'][_0x471440]['length'])return null;const _0x1b8c30=this['cachedSuggestionContentParts'][_0x471440];if(void 0x0===_0x3c7ac2)return _0x1b8c30['length']>0x0&&_0x1b8c30['length']!==this['changeGroups']['length']?(this['_setCachedContentParts'](_0x3e1e82,null),null):_0xec0f6(_0x1b8c30);{const _0x57253f=_0x1b8c30['find'](({index:_0x41c95b})=>_0x41c95b===_0x3c7ac2);if(_0x57253f)return[_0xec0f6(_0x57253f)];}return null;}['_setCachedContentParts'](_0x1ed2cb,_0x3016e4){const _0x2ef276=_0x1ed2cb?'withDiff':'withoutDiff';_0x3016e4?_0x3016e4['forEach'](_0x25ee06=>{const _0x290861=this['cachedSuggestionContentParts'][_0x2ef276],_0xd719ba=_0x290861['find'](({index:_0x2cfd1b})=>_0x2cfd1b===_0x25ee06['index']);if(_0xd719ba){const _0x442f7b=_0x290861['indexOf'](_0xd719ba);_0x290861['splice'](_0x442f7b,0x1,_0x25ee06);}else _0x290861['push'](_0x25ee06);}):this['cachedSuggestionContentParts'][_0x2ef276]['length']=0x0;}['onContentChange'](){if('modification'===this['type']){this['parsedContent']=this['aiResponseParser']['parseAndNormalizeHTML'](this['content']);const _0x10cdd2=this['changeGroups'];this['updateChangeGroups']();const _0x13f166=this['_getDifferentChangeGroups'](_0x10cdd2,this['changeGroups']);(_0x13f166['length']||this['isDone'])&&(this['fire']('replyContentUpdated',this,_0x13f166),this['cachedSuggestionContentParts']['withDiff']['length']=this['cachedSuggestionContentParts']['withoutDiff']['length']=0x0);}else this['parsedContent']=this['aiResponseParser']['convertMarkdownToHTML'](this['content']),this['fire']('replyContentUpdated',this);}['_getDifferentChangeGroups'](_0x314c6f,_0x31e97b){const _0x16b889=[];for(const _0x470dbf of _0x31e97b){const _0x4af49e=_0x314c6f[_0x470dbf['index']];_0x4af49e?_0x4af49e['changes']['length']!==_0x470dbf['changes']['length']?_0x16b889['push'](_0x470dbf):_0x4af49e['changes']['forEach']((_0x3400c4,_0x424ed0)=>{const _0x33106d=_0x470dbf['changes'][_0x424ed0];_0x3400c4['id']!==_0x33106d['id']&&_0x16b889['push'](_0x470dbf);}):_0x16b889['push'](_0x470dbf);}return _0x16b889;}['updateChangeGroups'](){const _0x55de35=new _0x3c2cca('p',{},[new _0x3c2cca('span',{'style':'color:\x20#808080;\x20font-style:\x20italic'},[new _0x598728(us(this['editor']['locale'],'AI_SUGGESTION_CONTENT_PART_REMOVED'))])]),_0x4ec70e=this['aiResponseApplier']['merge'](this['parsedContent'],this['documentContextContent']['cloneNode'](!0x0),{'markUnstableElements':!this['isDone'],'replaceRemovedWith':_0x55de35,'cutAfterLastChange':!this['isDone']});if(!_0x4ec70e['modifiedNodeIds']['length']&&!this['isDone'])return;this['parsedMergedContent']=_0x4ec70e['parsedContent'];let _0x476375=[];if(_0x1478d3(_0x5cb840=>{const _0x48303a=ms(_0x5cb840,'data-id');if(!_0x48303a||!_0x12a8e6(_0x48303a))return!0x1;const _0x452a3f=[_0x5cb840,...fs(_0x5cb840)]['at'](-0x2);if(_0x5cb840!=_0x452a3f){const _0x1d8403=ms(_0x452a3f,'data-id');_0x12a8e6(_0x1d8403)||(_0x476375['push']({'node':_0x452a3f,'id':_0x1d8403,'type':'modified'}),_0x4ec70e['modifiedNodeIds']['push'](_0x1d8403));}else _0x4ec70e['modifiedNodeIds']['includes'](_0x48303a)?_0x476375['push']({'node':_0x5cb840,'type':'modified','id':_0x48303a}):_0x4ec70e['newNodeIds']['includes'](_0x48303a)?_0x476375['push']({'node':_0x5cb840,'type':'new','id':_0x48303a,'anchorId':ms(_0x5cb840['previousSibling'],'data-id')}):_0x476375['push']({'node':_0x5cb840,'type':'removed','id':_0x48303a});return!0x0;},this['parsedMergedContent']),_0x476375=_0x476375['filter'](({node:_0x28f921})=>[...fs(_0x28f921),_0x28f921]['every'](_0x6844d0=>!ms(_0x6844d0,'data-unstable'))),0x0==_0x476375['length'])return;const _0x4b152d=[[_0x476375[0x0]]];for(let _0xfa1fba=0x1;_0xfa1fba<_0x476375['length'];_0xfa1fba++){const _0x510689=_0x4b152d[_0x4b152d['length']-0x1],_0x5bd75f=_0x510689[_0x510689['length']-0x1];_0x476375[_0xfa1fba]['node']['previousSibling']==_0x5bd75f['node']&&'modified'!=_0x476375[_0xfa1fba]['type']&&'modified'!=_0x5bd75f['type']?_0x510689['push'](_0x476375[_0xfa1fba]):_0x4b152d['push']([_0x476375[_0xfa1fba]]);}for(const _0xb68e4c of _0x4b152d){const _0xd97111=_0xb68e4c[0x0],_0x64df8=_0xb68e4c[_0xb68e4c['length']-0x1],_0x3577c6=_0x4f805f(_0xd97111['node']['previousSibling']);_0x3577c6&&_0xb68e4c['unshift'](_0x3577c6);const _0x4877ba=_0x4f805f(_0x64df8['node']['nextSibling']);_0x4877ba&&_0xb68e4c['push'](_0x4877ba);}function _0x12a8e6(_0x23a632){return _0x4ec70e['modifiedNodeIds']['includes'](_0x23a632)||_0x4ec70e['newNodeIds']['includes'](_0x23a632)||_0x4ec70e['removedNodeIds']['includes'](_0x23a632);}function _0x4f805f(_0x1c5352){if(_0x1c5352&&ms(_0x1c5352,'data-id')&&!ms(_0x1c5352,'data-unstable')){const _0x31c8c3=ms(_0x1c5352,'data-id');if(!_0x12a8e6(_0x31c8c3))return{'node':_0x1c5352,'type':'context','id':_0x31c8c3};}return null;}this['changeGroups']=_0x4b152d['map']((_0x5c47c3,_0x1e85f6)=>({'changes':_0x5c47c3,'state':'pending','index':_0x1e85f6}));}}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:_0x3d185d,editor:_0x58a682}){super(),this['id']=ot(),this['connector']=_0x3d185d,this['isStopped']=!0x0,this['editor']=_0x58a682;}async['start'](){const _0x167c3b=[];let _0x7ea65a,_0x513dfb,_0x293fc1;this['isStopped']=!0x1;try{this['currentRequest']=await this['sendRequest'](),this['fire']('interactionStarted',this);const _0x158a3a=await this['currentRequest']['getStream']();for await(const _0x380529 of _0x158a3a){if(this['isStopped'])return;if('error'==_0x380529['event'])return void this['fire']('error',{'error':new ht('ai-chat-interaction-error',this)});switch(_0x380529['event']){case'message-metadata':this['messageId']=_0x380529['data']['messageId'];break;case'action-metadata':this['actionCallId']=_0x380529['data']['callId'];break;case'conversation-title':this['setConversationTitle'](_0x380529['data']['conversationTitle'],!0x0);break;case'source':_0x167c3b['push'](_0x380529['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'](),_0x7ea65a='modification-delta'==_0x380529['event']?'modification':'text',_0x513dfb='modification-delta'==_0x380529['event']?_0x380529['data']['id']:void 0x0,this['currentReply']&&this['currentReply']['type']!=_0x7ea65a&&(this['currentReply']['done'](),this['currentReply']=void 0x0),this['currentReply']||(this['currentReply']=this['createReply']({'type':_0x7ea65a,'interactionId':this['id'],'id':_0x513dfb}),'modification'==_0x7ea65a&&(this['currentReply']['sources']=_0x167c3b['splice'](0x0))),this['currentReply']['appendContent'](_0x380529['data']['textDelta']);break;case'mcp-tool-result':_0x293fc1=JSON['parse'](_0x380529['data']['result']),this['_handleToolResultData']({'toolName':_0x380529['data']['toolName'],'data':_0x293fc1['data'],'attributes':_0x293fc1['attributes']});break;case'mcp-tool-notification':this['_handleToolNotificationData']({'toolName':_0x380529['data']['toolName'],'data':_0x380529['data']['data']});}}}finally{this['isStopped']||(this['currentReply']&&_0x167c3b['length']>0x0&&(this['currentReply']['sources']=_0x167c3b['splice'](0x0)),this['_finalizeInteraction'](),this['fire']('interactionFinished',this));}}['stop'](){this['isStopped']||(this['_finalizeInteraction'](),this['fire']('interactionStopped',this));}['getReply'](_0x441353){return this['replies']['find'](_0x5b9aa3=>_0x5b9aa3['id']===_0x441353);}['destroy'](){this['isDestroyed']||(this['stop'](),this['replies']['forEach'](_0x334f1e=>_0x334f1e['destroy']()),this['replies']=[],this['isDestroyed']=!0x0,this['fire']('interactionDestroyed',this),this['stopListening']());}['createReply'](_0x8ca629){const _0x5034d5=new Ps({'editor':this['editor'],'documentContextContent':this['getDocumentContext']()?.['content'],..._0x8ca629});return this['replies']['push'](_0x5034d5),_0x5034d5['delegate'](...Hs)['to'](this),this['fire']('replyCreated',_0x5034d5),_0x5034d5;}['setConversationTitle'](_0x59226d,_0x418ccc=!0x1){this['fire']('setConversationTitle',_0x59226d,_0x418ccc);}['resetWebSearchState'](){this['_isWebSearching']&&(this['_isWebSearching']=!0x1,this['fire']('webSearchFinished',this));}['resetReasoningState'](){this['_isReasoning']&&(this['_isReasoning']=!0x1,this['fire']('reasoningFinished',this));}['_handleToolResultData'](_0xda9df5){this['fire']('toolDataReceived',{'type':'result','toolName':_0xda9df5['toolName'],'data':structuredClone(_0xda9df5['data']||{}),'attributes':structuredClone(_0xda9df5['attributes']||{})},this);}['_handleToolNotificationData'](_0x1ab5ee){this['fire']('toolDataReceived',{'type':'notification','toolName':_0x1ab5ee['toolName'],'data':structuredClone(_0x1ab5ee['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(_0xee4639){return _0xee4639['TOOL']='mcp-tool-context',_0xee4639['FILE']='file',_0xee4639['DOCUMENT']='document',_0xee4639['URL']='web-resource',_0xee4639['TEXT']='text',_0xee4639['SELECTION']='selection',_0xee4639;}({}),Vs=function(_0x9aed6d){return _0x9aed6d['TEXT']='text',_0x9aed6d['MARKDOWN']='markdown',_0x9aed6d['HTML']='html',_0x9aed6d;}({});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:_0x2f30a3,config:_0x60585,ownerId:_0x54375b}){super(),this['_connector']=_0x2f30a3,this['_config']=_0x60585,this['_ownerId']=_0x54375b;}['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'](_0x1361d4){const _0x1abc27=await this['_createContextItemFromContent'](_0x1361d4);return this['_addToConversationContextItem'](_0x1abc27),'current-document'===_0x1abc27['uiId']&&this['_toggleAddCurrentDocumentOptionVisibility'](),_0x1abc27;}async['_createContextItemFromContent'](_0x4aa216){if(_0x4aa216['type']===Us['DOCUMENT']){const _0x5e0747=await this['_connector']['fetchDocument'](this['_ownerId'],_0x4aa216['id'])['getDocument']();return{'id':'current-document','uiId':'current-document','label':'Current\x20document','type':_0x4aa216['type'],'content':_0x5e0747['content'],'hidden':this['_conversationContextItems']['has']('current-document'),'version':_0x5e0747['attributes']?.['version'],'sessionId':_0x5e0747['attributes']?.['sessionId']};}if(_0x4aa216['type']===Us['TOOL'])return{'id':_0x4aa216['id'],'uiId':_0x4aa216['id'],'label':_0x4aa216['data']?.['label']||_0x4aa216['id'],'type':Us['TOOL'],'mcpServerName':_0x4aa216['mcpServerName'],'toolName':_0x4aa216['toolName'],'data':_0x4aa216['data']||{}};return{'id':_0x4aa216['id'],'uiId':_0x4aa216['id'],'label':_0x4aa216['attributes']?.['label']||_0x4aa216['name']||_0x4aa216['url']||_0x4aa216['id'],'type':_0x4aa216['type'],..._0x4aa216?.['attributes']?.['resourceId']?{'resourceId':_0x4aa216['attributes']?.['resourceId']}:{}};}['getSentContextItems'](){return new Map(this['_conversationContextItems']);}['removeFromContext'](_0x56134f){const _0x20acf5=this['_pendingContextItems']['get'](_0x56134f);_0x20acf5?.['isReadOnly']||this['_removeContextItem'](_0x56134f);}['clearPendingContextItems'](){if(0x0===this['_pendingContextItems']['size'])return;for(const _0x38b6a1 of this['_pendingContextItems']['values']())this['_removeContextItem'](_0x38b6a1['uiId']);const _0x4e34bc=this['_conversationContextItems']['get']('current-document')||this['_pendingContextItems']['get']('current-document');_0x4e34bc&&this['_addContextItem']({..._0x4e34bc,'isReadOnly':!0x0,'hidden':!0x0});}['addToConversationContext'](_0x413320){for(const _0x51de17 of _0x413320['values']())this['_addToConversationContextItem'](_0x51de17);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'](_0x2bd092){return Array['from'](_0x2bd092['values']())['map'](_0x257de8=>this['_mapContextItemToRequestData'](_0x257de8))['filter'](_0x39c65d=>null!==_0x39c65d);}async['addFilesToContext'](_0x21a46a,_0x5877c3,_0x22a75e=Us['FILE']){const _0x4df513='files-'+ot();this['_startUploadOperation'](_0x4df513);try{await Promise['all'](_0x21a46a['map'](async _0x2cdb13=>{const _0x824e6a='file-'+ot(),_0x123ff6=_0xeac408(_0x2cdb13['name']);try{this['_addContextItem']({'type':_0x22a75e,'label':_0x5877c3?.['label']||_0x123ff6,'uiId':_0x824e6a,'resourceId':_0x5877c3?.['resourceId']},!0x0);const _0x29172b=this['_connector']['uploadFile'](this['_ownerId'],_0x2cdb13,_0x5877c3);this['_ongoingUploads']['set'](_0x824e6a,_0x29172b['abortController']);const {id:_0x28ab37}=await _0x29172b['getId']();this['_ongoingUploads']['delete'](_0x824e6a),this['_finishContextItemLoading']({'type':_0x22a75e,'id':_0x28ab37,'label':_0x5877c3?.['label']||_0x123ff6,'uiId':_0x824e6a,'resourceId':_0x5877c3?.['resourceId']},!0x1);}catch(_0x48ebd1){this['_ongoingUploads']['delete'](_0x824e6a);if(!(_0x48ebd1 instanceof ht&&_0x48ebd1['message']['startsWith']('ai-request-aborted'))){const _0x9e1197=Bs['get'](_0x48ebd1['code'])||'ai-chat-file-upload-failed',_0xd4d3b9=new ht(_0x9e1197,null,{'fileName':_0x123ff6,..._0x48ebd1});_0xd4d3b9['stack']=_0x48ebd1['stack'],this['fire']('error',{'error':_0xd4d3b9});}this['_removeContextItem'](_0x824e6a);}}));}finally{this['_finishUploadOperation'](_0x4df513);}}['addCurrentDocumentToContext'](_0x34e0e8){if(this['isCurrentDocumentInContext']()||!this['_addContextOptionsState']['document']['enabled'])return;const _0x2da2b7={'type':Us['DOCUMENT'],'uiId':'current-document','label':_0x34e0e8,'isReadOnly':this['_conversationContextItems']['has']('current-document'),'hidden':this['_conversationContextItems']['has']('current-document')};this['_addContextItem'](_0x2da2b7);}async['updateCurrentDocument'](_0xbb63ef,_0x19b858,_0x11053e,_0x4d4219){const _0x393a85=this['_pendingContextItems']['get']('current-document');if(_0x393a85&&_0xbb63ef){_0x393a85['selection']=_0x4d4219?_0x4d4219['map'](_0x383648=>({'start':_0x383648['start'],'end':_0x383648['end']})):[];try{if(_0x393a85['version']===_0x19b858)return;const {id:_0x277dfe}=await this['_connector']['uploadDocument'](this['_ownerId'],_0xbb63ef,{'version':_0x19b858,'sessionId':_0x11053e})['getId']();_0x393a85['id']=_0x277dfe,_0x393a85['content']=_0xbb63ef,_0x393a85['version']=_0x19b858,_0x393a85['sessionId']=_0x11053e;}catch(_0x3bad24){const _0x37a46f=new ht('ai-chat-document-upload-failed',null);_0x37a46f['stack']=_0x3bad24['stack'],this['fire']('error',{'error':_0x37a46f});}}}['addSelectionToContext'](_0x320da9){this['_addContextItem']({'type':Us['SELECTION'],'label':_0x320da9,'uiId':'selection','content':_0x320da9});}['removeSelectionFromContext'](){this['_removeContextItem']('selection');}async['addUrlToContext'](_0x43cb65,_0x345b41){const _0xc5065='url-'+ot();this['_startUploadOperation'](_0xc5065);const _0x276250='url-'+ot();try{this['_addContextItem']({'type':Us['URL'],'label':_0x345b41?.['label']||_0x43cb65,'uiId':_0x276250,'resourceId':_0x345b41?.['resourceId']},!0x0);const _0x19299e=this['_connector']['uploadUrl'](this['_ownerId'],_0x43cb65,_0x345b41);this['_ongoingUploads']['set'](_0x276250,_0x19299e['abortController']);const {id:_0x204f35}=await _0x19299e['getId']();this['_ongoingUploads']['delete'](_0x276250),this['_finishContextItemLoading']({'type':Us['URL'],'id':_0x204f35,'label':_0x345b41?.['label']||_0x43cb65,'uiId':_0x276250,'resourceId':_0x345b41?.['resourceId']},!0x1);}catch(_0xd4908f){this['_ongoingUploads']['delete'](_0x276250),(_0xd4908f['message']['startsWith']('ai-request-aborted')||this['fire']('error',{'error':new ht('ai-chat-url-upload-failed',this,{'url':_0x43cb65,'originalError':_0xd4908f}),'url':_0x43cb65}),this['_removeContextItem'](_0x276250));}finally{this['_finishUploadOperation'](_0xc5065);}}['addToolItemToContext'](_0x26996d){_0x26996d['id']=_0x26996d['id']??ot()['substring'](0x0,0x15),this['_pendingContextItems']['set'](_0x26996d['uiId'],_0x26996d),this['fire']('contextItemAdded',{'contextItem':_0x26996d,'isLoading':!0x1});}async['loadSourceResources'](_0x3aa430,_0x517913,_0x5f4246){const _0x4415c8=this['_addContextOptionsState']['sources']['find'](_0x4f01cc=>_0x4f01cc['id']===_0x3aa430);if(!_0x4415c8)return this['fire']('error',{'error':new ht('ai-chat-source-not-found',this,{'sourceId':_0x3aa430}),'sourceId':_0x3aa430}),[];try{const _0x531ee5=(await _0x4415c8['getResources'](_0x517913))['map'](_0x29cee7=>{const _0x5d1000=this['_isResourceInContext'](_0x29cee7['id']);return{..._0x29cee7,'isInContext':_0x5d1000};});return _0x4415c8['resources']=_0x531ee5,this['fire']('sourceResourcesLoaded',{'sourceId':_0x3aa430,'source':_0x4415c8,'resources':_0x531ee5,'uid':_0x5f4246}),_0x531ee5;}catch(_0x35e9d4){return this['fire']('error',{'error':new ht('ai-chat-source-resources-load-failed',this,{'sourceId':_0x3aa430,'originalError':_0x35e9d4}),'sourceId':_0x3aa430,'sourceLabel':_0x4415c8['label']}),[];}}async['addResourceToContext'](_0x205ccb,_0x4c08e4){if(this['_isResourceInContext'](_0x4c08e4['id']))return;let _0x4afd3f=_0x4c08e4['data'];if(!_0x4afd3f&&_0x205ccb['getData'])try{_0x4afd3f=await _0x205ccb['getData'](_0x4c08e4['id']);}catch(_0x3887ad){return void this['fire']('error',{'error':new ht('ai-chat-resource-load-failed',this,{'resourceId':_0x4c08e4['id'],'sourceId':_0x205ccb['id'],'originalError':_0x3887ad}),'resourceId':_0x4c08e4['id'],'sourceId':_0x205ccb['id']});}if(_0x4afd3f)switch(_0x4c08e4['type']){case Us['URL']:if('string'!=typeof _0x4afd3f)return void this['fire']('error',{'error':new ht('ai-chat-context-invalid-data',this,{'resourceId':_0x4c08e4['id'],'sourceId':_0x205ccb['id'],'expectedType':'string','actualType':typeof _0x4afd3f}),'resourceId':_0x4c08e4['id'],'sourceId':_0x205ccb['id']});await this['addUrlToContext'](_0x4afd3f,{'label':_0x4c08e4['label'],'resourceId':_0x4c08e4['id']});break;case Us['FILE']:if(!(_0x4afd3f instanceof File))return void this['fire']('error',{'error':new ht('ai-chat-context-invalid-data',this,{'resourceId':_0x4c08e4['id'],'sourceId':_0x205ccb['id'],'expectedType':'File','actualType':typeof _0x4afd3f}),'resourceId':_0x4c08e4['id'],'sourceId':_0x205ccb['id']});await this['addFilesToContext']([_0x4afd3f],{'label':_0x4c08e4['label'],'resourceId':_0x4c08e4['id']});break;case Us['TEXT']:if('object'!=typeof _0x4afd3f||!('content'in _0x4afd3f)||!('type'in _0x4afd3f))return void this['fire']('error',{'error':new ht('ai-chat-context-invalid-data',this,{'resourceId':_0x4c08e4['id'],'sourceId':_0x205ccb['id'],'expectedType':'object\x20with\x20content\x20and\x20type\x20properties','actualType':typeof _0x4afd3f}),'resourceId':_0x4c08e4['id'],'sourceId':_0x205ccb['id']});_0x4afd3f=Fs['_convertTextResourceToFile'](_0x4afd3f,_0x4c08e4['label']),await this['addFilesToContext']([_0x4afd3f],{'label':_0x4c08e4['label'],'resourceId':_0x4c08e4['id']},Us['TEXT']);break;case Us['TOOL']:break;default:this['fire']('error',{'error':new ht('ai-chat-context-unsupported-type',this,{'resourceId':_0x4c08e4['id'],'sourceId':_0x205ccb['id'],'resourceType':_0x4c08e4['type']}),'resourceId':_0x4c08e4['id'],'sourceId':_0x205ccb['id']});}else this['fire']('error',{'error':new ht('ai-chat-resource-no-data',this,{'resourceId':_0x4c08e4['id'],'sourceId':_0x205ccb['id']}),'resourceId':_0x4c08e4['id'],'sourceId':_0x205ccb['id']});}static['_convertTextResourceToFile'](_0x267bbe,_0x4034af){switch(_0x267bbe['type']){case Vs['MARKDOWN']:return new File([_0x267bbe['content']],_0x4034af,{'type':'text/markdown'});case Vs['HTML']:return new File([_0x267bbe['content']],_0x4034af,{'type':'text/html'});default:return new File([_0x267bbe['content']],_0x4034af,{'type':'text/plain'});}}static['_mapContextItemToRequestData'](_0x405f99){switch(_0x405f99['type']){case Us['FILE']:return{'type':Us['FILE'],'id':_0x405f99['id']};case Us['URL']:return{'type':Us['URL'],'id':_0x405f99['id']};case Us['DOCUMENT']:return{'type':Us['DOCUMENT'],'id':_0x405f99['id'],..._0x405f99['selection']?.['length']&&{'selection':_0x405f99['selection']}};case Us['TEXT']:return{'type':Us['FILE'],'id':_0x405f99['id']};case Us['TOOL']:{const _0x4a4e7c=_0x405f99;return{'type':Us['TOOL'],'mcpServerName':_0x4a4e7c['mcpServerName'],'toolName':_0x4a4e7c['toolName'],'data':_0x4a4e7c['data'],'id':_0x4a4e7c['id']};}default:return null;}}['_addContextItem'](_0x130bdb,_0x2f3dd5=!0x1){if(this['_pendingContextItems']['set'](_0x130bdb['uiId'],_0x130bdb),_0x130bdb['hidden']||this['fire']('contextItemAdded',{'contextItem':_0x130bdb,'isLoading':_0x2f3dd5}),'current-document'===_0x130bdb['uiId']&&this['_toggleAddCurrentDocumentOptionVisibility'](),_0x130bdb['resourceId']){const _0x5d67ef=this['_findSourceIdsByResourceId'](_0x130bdb['resourceId']);_0x5d67ef&&_0x5d67ef['forEach'](_0x2e550a=>{this['_updateResourceInContextState'](_0x2e550a,_0x130bdb['resourceId'],!0x0);});}}['_removeContextItem'](_0x13f077){const _0x8af86a=this['_pendingContextItems']['get'](_0x13f077),_0xf71614=this['_ongoingUploads']['get'](_0x13f077);if(_0xf71614&&(_0xf71614['abort'](),this['_ongoingUploads']['delete'](_0x13f077)),_0x8af86a?.['resourceId']){const _0x2a1d90=this['_findSourceIdsByResourceId'](_0x8af86a['resourceId']);_0x2a1d90&&_0x2a1d90['forEach'](_0x47601e=>{this['_updateResourceInContextState'](_0x47601e,_0x8af86a['resourceId'],!0x1);});}this['_pendingContextItems']['delete'](_0x13f077),this['fire']('contextItemRemoved',{'uiId':_0x13f077,'type':_0x8af86a?.['type']}),'current-document'===_0x13f077&&this['_toggleAddCurrentDocumentOptionVisibility']();}['_finishContextItemLoading'](_0x20f6b6,_0x18a6d0){if(this['_pendingContextItems']['has'](_0x20f6b6['uiId'])&&(this['_pendingContextItems']['set'](_0x20f6b6['uiId'],_0x20f6b6),this['fire']('contextItemLoadingEnded',{'contextItem':_0x20f6b6,'isLoading':_0x18a6d0}),_0x20f6b6['resourceId'])){const _0x1c90ad=this['_findSourceIdsByResourceId'](_0x20f6b6['resourceId']);_0x1c90ad&&_0x1c90ad['forEach'](_0x64fba3=>{this['_updateResourceInContextState'](_0x64fba3,_0x20f6b6['resourceId'],!0x0);});}}['_addToConversationContextItem'](_0x4ab538){this['_conversationContextItems']['set'](_0x4ab538['uiId'],_0x4ab538);}['_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'](_0x41ed99=>({..._0x41ed99,'enabled':!0x0}))??[]},this['fire']('addContextOptionsChanged',{'options':this['_addContextOptionsState']});}['_getCustomSourcesInitialState'](){return this['_config']?.['sources']?.['map'](_0x4d00fc=>({..._0x4d00fc,'resources':[]}))??[];}['_toggleAddCurrentDocumentOptionVisibility'](){const _0x2802ca=this['isCurrentDocumentInContext']()||this['isCurrentDocumentInConversation']();this['_addContextOptionsState']['document']['isHidden']=_0x2802ca,this['fire']('addContextOptionsChanged',{'options':this['_addContextOptionsState']});}['_isResourceInContext'](_0x641d0a){for(const _0x291032 of this['_pendingContextItems']['values']())if(_0x291032['resourceId']===_0x641d0a)return!0x0;for(const _0x4d1445 of this['_conversationContextItems']['values']())if(_0x4d1445['resourceId']===_0x641d0a)return!0x0;return!0x1;}['_findSourceIdsByResourceId'](_0x3ad5e4){const _0x3e6407=[];for(const _0x5dcbe8 of this['_addContextOptionsState']['sources']){_0x5dcbe8['resources']['find'](_0x2aff7f=>_0x2aff7f['id']===_0x3ad5e4)&&_0x3e6407['push'](_0x5dcbe8['id']);}return 0x0===_0x3e6407['length']?null:_0x3e6407;}['_updateResourceInContextState'](_0xea515d,_0x26c12b,_0x53c2e1){const _0x19f61f=this['_addContextOptionsState']['sources']['find'](_0xe5c18f=>_0xe5c18f['id']===_0xea515d);if(!_0x19f61f)return;const _0x14bfeb=_0x19f61f['resources']['find'](_0x4031d1=>_0x4031d1['id']===_0x26c12b);_0x14bfeb&&(_0x14bfeb['isInContext']=_0x53c2e1,this['fire']('resourceStateChanged',{'sourceId':_0xea515d,'resourceId':_0x26c12b,'isInContext':_0x53c2e1}));}['_startUploadOperation'](_0x542df7){this['_ongoingUploadOperations']['set'](_0x542df7,!0x0),this['_ongoingUploadOperations']['size']&&this['fire']('uploadProgressChanged',{'isUploadInProgress':!0x0});}['_finishUploadOperation'](_0x26c47e){this['_ongoingUploadOperations']['delete'](_0x26c47e),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'](_0x5a16a5){const _0x4e58ab={};return _0x5a16a5&&_0x5a16a5['isWebSearchEnabled']&&(_0x4e58ab['webSearch']={}),_0x5a16a5&&_0x5a16a5['isReasoningEnabled']&&(_0x4e58ab['reasoning']={}),_0x4e58ab;}['toggleWebSearch'](){this['setWebSearch'](!this['_isWebSearchEnabled']);}['toggleReasoning'](){this['setReasoning'](!this['_isReasoningEnabled']);}['setWebSearch'](_0x18c8eb){_0x18c8eb!==this['_isWebSearchEnabled']&&(this['_isWebSearchEnabled']=_0x18c8eb,this['fire']('capabilitiesUpdated',this['getCapabilitiesConfig']()));}['setReasoning'](_0x107e4a){_0x107e4a!==this['_isReasoningEnabled']&&(this['_isReasoningEnabled']=_0x107e4a,this['fire']('capabilitiesUpdated',this['getCapabilitiesConfig']()));}}class Ys extends Ms{['userMessage'];['conversationId'];['contextItems']=new Map();['capabilities'];['model'];['attributes'];constructor(_0x710825){super(_0x710825),this['conversationId']=_0x710825['conversationId'],this['contextItems']=_0x710825['contextItems'],this['capabilities']=_0x710825['capabilities'],this['userMessage']=_0x710825['userMessage'],this['model']=_0x710825['model'],this['attributes']=_0x710825['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(_0x13fb85){super(),this['options']=_0x13fb85,this['connector']=_0x13fb85['connector'],this['chatModels']=_0x13fb85['chatModels'],this['id']=_0x13fb85['conversationId'],this['isFromHistory']=_0x13fb85['isFromHistory'];}async['init'](_0x135396){try{this['chatContext']=new Fs({'connector':this['connector'],'config':_0x135396,'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 _0x44079b=await this['chatModels']['getAvailableModels']();this['fire']('conversationInitialized',{'availableModels':_0x44079b});const _0xc8f276=await this['chatModels']['getModel'](this['options']['selectedModelId']);_0xc8f276&&await this['setModel'](_0xc8f276);}catch(_0x56cd82){const _0x4539a7=new ht('ai-chat-conversation-init-failed',null,{'message':_0x56cd82['message']||_0x56cd82});_0x4539a7['stack']=_0x56cd82['stack'],this['fire']('error',{'error':_0x4539a7});}}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:_0xb3af81}=await this['connector']['startConversation'](this['id'],this['options']['group'])['getConversation']();this['id']=_0xb3af81,this['isStarted']=!0x0,this['fire']('conversationStarted',{'conversationId':this['id'],'selectedModel':this['selectedModel']});}catch(_0x179342){const _0x1ab771=new ht('ai-chat-conversation-start-failed',null,{'message':_0x179342['message'],'conversationId':this['id']});throw _0x1ab771['stack']=_0x179342['stack'],this['fire']('error',{'error':_0x1ab771}),_0x1ab771;}}async['load'](_0x2884c8,_0x23a2a3){try{const _0x289e42=await this['connector']['fetchConversation'](_0x2884c8)['getConversation'](),_0x228ff2=await this['connector']['fetchConversationMessages'](_0x2884c8)['getMessages'](),_0x1c0bca=_0x228ff2[0x0]['model'];this['isStarted']=!0x0,this['id']=_0x289e42['id'],'title'in _0x289e42?this['fire']('setConversationTitle',_0x289e42['title'],!0x0):this['fire']('setConversationTitle','',!0x0);const _0x561525=(await this['chatModels']['getAll']())['find'](_0x50a58b=>_0x50a58b['id']['toLowerCase']()===_0x1c0bca['toLowerCase']());return this['selectedModel']=_0x561525,this['fire']('modelSelected',{'selectedModel':_0x561525,'isDisabled':!0x0}),await this['_processMessagesToInteractions'](_0x228ff2,_0x23a2a3,_0x1c0bca),this['currentInteraction']=void 0x0,this;}catch(_0x1c55d8){const _0x357298=new ht('ai-chat-conversation-init-from-id-failed',null,{'message':_0x1c55d8['message'],'conversationId':_0x2884c8});throw _0x357298['stack']=_0x1c55d8['stack'],this['fire']('error',{'error':_0x357298}),_0x357298;}}async['_processMessagesToInteractions'](_0x2cd6bd,_0xeac169,_0x4c03cf){let _0x5c5606;for(const _0x709bcb of _0x2cd6bd)if('user'===_0x709bcb['role']){const _0x87b2e1=await this['_extractContextItems'](_0x709bcb),_0x5a3645={'isReasoningEnabled':Object['hasOwn'](_0x709bcb['capabilities'],'reasoning'),'isWebSearchEnabled':Object['hasOwn'](_0x709bcb['capabilities'],'webSearch')};_0x5c5606=this['createInteraction']({'userMessage':_0x709bcb['prompt'],'contextItems':_0x87b2e1,'capabilities':_0x5a3645,'modelId':_0x4c03cf,'attributes':_0x709bcb['attributes']}),this['currentInteraction']=_0x5c5606,this['chatContext']['addToConversationContext'](this['currentInteraction']['contextItems']);}else{if('assistant'===_0x709bcb['role']&&_0x5c5606){const _0x11aab8=[];for(const _0x1000ce of _0x709bcb['content'])switch(_0x1000ce['type']){case'text':case'modification':{const _0x425ada=_0x5c5606['getDocumentContext']()?.['sessionId']!==_0xeac169;_0x5c5606['currentReply']=_0x5c5606['createReply']({'type':_0x1000ce['type'],'isDone':!0x0,'interactionId':_0x5c5606['id'],'areActionsDisabled':_0x425ada}),_0x5c5606['currentReply']['appendContent'](_0x1000ce['content']),_0x11aab8['length']>0x0&&(_0x5c5606['currentReply']['sources']=_0x11aab8['splice'](0x0));break;}case'url':_0x11aab8['push'](_0x1000ce);break;case'mcp-tool-result':{const {data:_0x34e5e7,attributes:_0x2b9e1b}=JSON['parse'](_0x1000ce['content']);_0x5c5606['_handleToolResultData']({'toolName':_0x1000ce['toolName'],'data':_0x34e5e7,'attributes':_0x2b9e1b});break;}}}}}async['_extractContextItems'](_0x245cb7){const _0x150f33=new Map();if(!_0x245cb7['content'])return _0x150f33;for(const _0x30b37a of _0x245cb7['content']){const _0x443f31=await this['chatContext']['populateFromMessage'](_0x30b37a);_0x443f31&&_0x150f33['set'](_0x443f31['id'],_0x443f31);}return _0x150f33;}async['handleUserInteraction']({userMessage:_0x5d316c,attributes:_0x423aa1}){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 _0x2b8389=this['chatContext']['getPendingContextItems'](),_0x1e0f48=this['chatCapabilities']['getCapabilitiesConfig'](),_0x47805c=this['selectedModel']['id'];this['currentInteraction']=this['createInteraction']({'userMessage':_0x5d316c,'contextItems':_0x2b8389,'capabilities':_0x1e0f48,'modelId':_0x47805c,'attributes':_0x423aa1}),await this['currentInteraction']['start'](),this['chatContext']['addToConversationContext'](this['currentInteraction']['contextItems']);}catch(_0x1e6586){if(_0x1e6586 instanceof ht)this['fire']('error',{'interactionId':this['currentInteraction']?this['currentInteraction']['id']:void 0x0,'error':_0x1e6586});else{const _0x343bc5=Bs['get'](_0x1e6586['code'])||'ai-chat-handle-user-interaction-start-failed';this['fire']('error',{'interactionId':this['currentInteraction']?this['currentInteraction']['id']:void 0x0,'error':new ht(_0x343bc5,null,{'error':_0x1e6586})});}}finally{this['currentInteraction']?.['stop'](),this['currentInteraction']=void 0x0;}}['createInteraction']({userMessage:_0x2f74fc,contextItems:_0x2be3e2,capabilities:_0x27834e,modelId:_0x2e474e,attributes:_0x239496}){const _0x2a0f44=new Ys({'userMessage':_0x2f74fc,'contextItems':_0x2be3e2,'capabilities':_0x27834e,'conversationId':this['id'],'connector':this['connector'],'editor':this['options']['getEditor']&&this['options']['getEditor'](),'model':_0x2e474e,'attributes':_0x239496});return _0x2a0f44['delegate'](...Hs)['to'](this),this['interactions']['push'](_0x2a0f44),this['fire']('interactionCreated',_0x2a0f44),_0x2a0f44;}['getInteraction'](_0x53ad1f){return this['interactions']['find'](_0x4ccf43=>_0x4ccf43['id']===_0x53ad1f);}['removeInteraction'](_0x1193f9){const _0x1fa7e1=this['getInteraction'](_0x1193f9);_0x1fa7e1&&(_0x1fa7e1['destroy'](),this['interactions']['splice'](this['interactions']['indexOf'](_0x1fa7e1),0x1));}get['lastInteraction'](){return this['interactions'][this['interactions']['length']-0x1];}['addCurrentDocumentToContext'](_0x45003c){this['chatContext']['addCurrentDocumentToContext'](_0x45003c);}async['updateCurrentDocumentInContext']({content:_0x254d60,version:_0x25006a,sessionId:_0x105787,selections:_0x2fff01}){await this['chatContext']['updateCurrentDocument'](_0x254d60,_0x25006a,_0x105787,_0x2fff01);}['getCurrentDocumentContext'](){return this['currentInteraction']?.['getDocumentContext']()?.['content']||'';}['addSelectionToContext'](_0x176ce5){this['chatContext']['addSelectionToContext'](_0x176ce5);}['removeSelectionFromContext'](){this['chatContext']['removeSelectionFromContext']();}['addFilesToContext'](_0x213143){this['chatContext']['addFilesToContext'](_0x213143);}['addUrlToContext'](_0x52b996){this['chatContext']['addUrlToContext'](_0x52b996);}['addToolItemToContext'](_0x58419e){this['chatContext']['addToolItemToContext'](_0x58419e);}['addResourceToContext'](_0x3bc372,_0x593804){this['chatContext']['addResourceToContext'](_0x3bc372,_0x593804);}['loadSourceResources'](_0x1c7584,_0x14104b,_0x55adbe){return this['chatContext']['loadSourceResources'](_0x1c7584,_0x14104b,_0x55adbe);}['removeFromContext'](_0x4dbbec){this['chatContext']['removeFromContext'](_0x4dbbec);}['setWebSearch'](_0xb845c4){this['chatCapabilities']['setWebSearch'](_0xb845c4);}['toggleWebSearch'](){this['chatCapabilities']['toggleWebSearch']();}['setReasoning'](_0x4c87df){this['chatCapabilities']['setReasoning'](_0x4c87df);}['toggleReasoning'](){this['chatCapabilities']['toggleReasoning']();}['isCurrentDocumentInContext'](){return this['chatContext']['isCurrentDocumentInContext']();}['isCurrentDocumentInConversation'](){return this['chatContext']['isCurrentDocumentInConversation']();}['isSelectionInContext'](){return this['chatContext']['isSelectionInContext']();}async['setModel'](_0x46dfac){_0x46dfac?!0x1===await this['chatModels']['isAvailable'](_0x46dfac)&&(Tt('ai-chat-conversation-set-model-not-available',{'conversation':this,'model':_0x46dfac}),_0x46dfac=(await this['chatModels']['getAvailableModels']())[0x0]):(Tt('ai-chat-conversation-set-model-null',{'conversation':this}),_0x46dfac=(await this['chatModels']['getAvailableModels']())[0x0]),_0x46dfac['id']!==this['selectedModel']?.['id']&&(this['selectedModel']=_0x46dfac,this['chatCapabilities']['reset'](),this['fire']('modelSelected',{'selectedModel':_0x46dfac}));}}class qs extends pt(){['_connector'];['_config'];['_locale'];['_modelList']=[];['_modelsRequest']=null;constructor({connector:_0x4a5e47,config:_0x489754,locale:_0x215659}){super(),this['_connector']=_0x4a5e47,this['_config']=_0x489754,this['_locale']=_0x215659;}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 _0x5d4723=await this['getAll']();let _0x276c05;return _0x276c05=this['_availableModels']?this['_filterModels'](_0x5d4723,this['_availableModels']):_0x5d4723['filter'](_0x5d64b3=>_0x5d64b3['recommended']),_0x276c05;}async['getModel'](_0x570be3){const _0x1cd637=await this['getAll']();if(!_0x1cd637['length'])return null;if(_0x570be3){const _0xef23af=this['_getModelById'](_0x1cd637,_0x570be3);if(_0xef23af)return _0xef23af;Tt('ai-chat-model-id-unrecognized',{'modelId':_0x570be3,'fallBackModelId':this['_defaultModelId']});}return this['getDefault']();}async['getDefault'](){const _0x4b0569=await this['getAvailableModels']();if(!_0x4b0569['length'])return null;if(this['_defaultModelId']){const _0x176bcd=this['_getModelById'](_0x4b0569,this['_defaultModelId']);if(_0x176bcd)return _0x176bcd;Tt('ai-chat-default-model-id-unrecognized',{'defaultModelId':this['_defaultModelId'],'fallBackModelId':_0x4b0569[0x0]['id']});}return _0x4b0569[0x0];}async['isAvailable'](_0x387a74){return(await this['getAvailableModels']())['some'](_0xb1e17e=>_0xb1e17e['name']===_0x387a74['name']&&_0xb1e17e['provider']===_0x387a74['provider']);}async['_retrieveModels'](){if(!this['_modelList']['length'])try{const _0x1db0ee=this['_locale']['uiLanguage']||'en',_0x5c80d4=this['_connector']['getModels'](_0x1db0ee),_0x54f614=await _0x5c80d4['list']();this['_modelList']=_0x54f614['items']['map'](_0x5c549d=>Qs(_0x5c549d)?{..._0x5c549d,'name':us(this['_locale'],'AI_MODEL_NAME_AUTO')}:_0x5c549d);}catch(_0x36465e){throw mt('ai-models-unable-to-retrieve',{'error':_0x36465e}),_0x36465e;}return[...this['_modelList']];}['_filterModels'](_0x27f40c,_0x5304cf){let _0x54f5d5;if(_0x5304cf){_0x54f5d5=[];const _0x30d609=new Set(),_0x35874f='string'==typeof _0x5304cf?[_0x5304cf['toLocaleLowerCase']()]:_0x5304cf['map'](_0x507df2=>_0x507df2['toLocaleLowerCase']());for(const _0xc4c9ff of _0x35874f)for(const _0x3e65ae of _0x27f40c)!_0x30d609['has'](_0x3e65ae['id'])&&this['_isMatchingFilter'](_0x3e65ae,_0xc4c9ff)&&(_0x54f5d5['push'](_0x3e65ae),_0x30d609['add'](_0x3e65ae['id']));}else _0x54f5d5=_0x27f40c;return _0x54f5d5;}['_isMatchingFilter'](_0x277c7b,_0x432782){const _0x3d77f6=_0x277c7b['id']['toLocaleLowerCase'](),_0x40ddf0=_0x277c7b['name']['toLocaleLowerCase'](),_0x48bf0a=_0x277c7b['provider']['toLocaleLowerCase']();return _0x3d77f6===_0x432782||_0x40ddf0===_0x432782||Qs(_0x277c7b)&&'auto'===_0x432782||_0x48bf0a===_0x432782||_0x3d77f6['startsWith'](_0x432782);}['_getModelById'](_0x30c54d,_0x3e723e){return _0x30c54d['find'](_0x39cdae=>Qs(_0x39cdae)&&'auto'===_0x3e723e?_0x39cdae:_0x39cdae['id']===_0x3e723e)||null;}}function Qs(_0x48e5ac){return _0x48e5ac['id']['startsWith']('agent');}function Xs(_0x56aab3){if(_0x56aab3 instanceof _0xe5e2fa)return _0x56aab3;if(_0x56aab3?.['editors']&&_0x56aab3['editors']['get'](0x0))return _0x56aab3['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.'),_0x56aab3['editors']['get'](0x0);throw new ht('ai-get-editor-from-context-no-editor');}function zs({editor:_0x565d50,interaction:_0x13c1ed,reply:_0x3e9c3a,groups:_0x17e5c4,transform:_0x5326b9,documentCompare:_0x191f24,documentCompareOptions:_0x862c18}){const _0x141a82=_0x13c1ed['getDocumentContext']();if(!_0x141a82)return[];const _0x20fb08=_0x141a82['content'],_0x4830e4=_0x141a82['version'],_0x5e9c39=_0x3e9c3a['documentContextContent']['cloneNode'](!0x0);for(const {changes:_0x4823c5}of _0x17e5c4){const _0x4c02e4=_0x4823c5['filter'](_0x547e36=>'new'!=_0x547e36['type'])['map'](_0x2cc2c3=>ps('data-id',_0x2cc2c3['id'],_0x5e9c39)),_0x8e6742=_0x4823c5['filter'](_0x40afde=>'removed'!=_0x40afde['type'])['map'](_0x263136=>_0x263136['node']['cloneNode'](!0x0));let _0x3a2635=null;if(_0x4c02e4['length']){_0x3a2635=_0x4c02e4[0x0]['previousSibling'];for(let _0xb31feb=0x0;_0xb31feb<_0x4c02e4['length'];_0xb31feb++)_0x28c1a9(_0x4c02e4[_0xb31feb]);}if(_0x8e6742['length']){_0x3a2635||(_0x4823c5[0x0]['anchorId']?_0x3a2635=ps('data-id',_0x4823c5[0x0]['anchorId'],_0x5e9c39):(_0x3a2635=_0x8e6742['shift'](),_0x2418d7(_0x5e9c39,_0x3a2635)));for(let _0xad0e3d=0x0;_0xad0e3d<_0x8e6742['length'];_0xad0e3d++)_0x21518e(_0x3a2635,_0x8e6742[_0xad0e3d]),_0x3a2635=_0x8e6742[_0xad0e3d];}}const _0x554c30=Es(_0x5e9c39),_0x1633f2=_0x191f24['getDiff'](_0x20fb08,_0x554c30,_0x862c18)['getOperations']();if(_0x5326b9){const _0x112642=_0x565d50['model']['document']['history']['getOperations'](_0x4830e4),_0x589075={'document':_0x565d50['model']['document'],'useRelations':!0x1,'padWithNoOps':!0x1};return _0x54e22b(_0x1633f2,_0x112642,_0x589075)['operationsA'];}return _0x1633f2;}function js(_0x75f46,_0x175823){if('marker'!=_0x175823['type'])return;const _0x2387ff=_0x75f46['model']['markers']['get'](_0x175823['name']);_0x2387ff&&(_0x175823['oldRange']=_0x2387ff['getRange']());}class Js extends _0x4c3ee6{['activeConversation'];['_aiEditing'];['_aiConnector'];['_aiChatUi'];['_aiChatModels'];['_aiChatBalloon'];['_batchToChanges']=new Map();['_currentPreviewedChangeGroup']=null;['_bodyCollection'];static get['requires'](){return[ls,_0x2da15a];}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 _0x5bf103=this['context']['plugins']['get']('AITabs');this['listenTo'](this['_aiChatUi'],'startConversation',()=>{this['_startConversationSafely']();}),this['listenTo'](this['_aiChatUi'],'sendUserMessage',(_0x3f2c81,_0x510f19)=>{this['_handleUIUserMessage']({'message':_0x510f19});}),this['listenTo'](_0x5bf103,'resizedTabs',(_0x1f2182,_0x36910d)=>{this['_setIsMaximized'](_0x36910d);}),this['listenTo'](this['_aiChatUi'],'resizeTabs',()=>{_0x5bf103['resize']();}),this['listenTo'](_0x5bf103['view'],'change:activeTab',(_0x3e70a9,_0x3ada42,_0x3fcf1c)=>{'chat'!==_0x3fcf1c&&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',(_0x378dde,_0x573e38)=>{this['activeConversation']?.['addFilesToContext'](Array['from'](_0x573e38));}),this['listenTo'](this['_aiChatUi'],'addUrlToContext',(_0x59abc6,_0x308b18)=>{this['activeConversation']?.['addUrlToContext'](_0x308b18);}),this['listenTo'](this['_aiChatUi'],'executeCustomItemCallback',(_0x29bc40,_0x5de62e)=>{_0x5de62e['callback'](this['context']);}),this['listenTo'](this['_aiChatUi'],'addResourceToContext',(_0x255b64,_0x51ef0e)=>{this['activeConversation']?.['addResourceToContext'](_0x51ef0e['source'],_0x51ef0e['resource']);}),this['listenTo'](this['_aiChatUi'],'removeContextItem',(_0x16f469,_0x20dad1)=>{this['_removeFromContext'](_0x20dad1);}),this['listenTo'](this['_aiChatUi'],'loadSourceResources',(_0x3ee486,_0x48f6ef)=>{this['activeConversation']?.['loadSourceResources'](_0x48f6ef['sourceId'],_0x48f6ef['query'],_0x48f6ef['uid']);}),this['listenTo'](this['_aiChatUi'],'toggleWebSearch',()=>{this['_toggleWebSearch']();}),this['listenTo'](this['_aiChatUi'],'toggleReasoning',()=>{this['_toggleReasoning']();}),this['listenTo'](this['_aiChatUi'],'selectModel',(_0x3514e6,_0x514cc3)=>{this['activeConversation']?.['setModel'](_0x514cc3);}),this['listenTo'](this['_aiChatUi'],'like',(_0x59b4d9,{replyId:_0x4b2ca6})=>{console['log']('Liked\x20response',_0x4b2ca6);}),this['listenTo'](this['_aiChatUi'],'dislike',(_0x29d23b,{replyId:_0x51d6bd})=>{console['log']('Disliked\x20response',_0x51d6bd);}),this['listenTo'](this['_aiChatUi'],'insertSuggestion',(_0x334143,_0x239aa9)=>{this['_insertSuggestion'](_0x239aa9);}),this['listenTo'](this['_aiChatUi'],'showChangeInText',(_0x2b2ff4,{replyId:_0x2af393,partIndex:_0x18ef0e})=>{this['_aiChatBalloonShowDiff']=this['_aiChatUi']['showDiff'],this['_openBalloonFor'](_0x2af393,_0x18ef0e);}),this['listenTo'](this['_aiChatUi'],'mouseOverSuggestion',(_0x3fee49,{replyId:_0x288518,partIndex:_0x52c036})=>{const _0x61a843=this['_getDocumentRangeForReplyChanges'](_0x288518,_0x52c036);_0x61a843&&'$graveyard'!=_0x61a843['range']['root']['rootName']&&this['_aiEditing']['showFakeVisualSelection']({'ranges':[_0x61a843['range']],'id':'change-area','priority':0xa});}),this['listenTo'](this['_aiChatUi'],'mouseLeaveSuggestion',()=>{this['_aiEditing']['hideFakeVisualSelection']('change-area');}),this['listenTo'](this['_aiChatUi'],'applySuggestion',(_0x493c73,_0x3c21a1)=>{this['_aiEditing']['hideFakeVisualSelection']('change-area'),this['_applySuggestion'](_0x3c21a1);}),this['listenTo'](this['_aiChatUi'],'toggleSuggestionDisplayMode',async(_0xc64c21,{replyId:_0x171565,showDiff:_0x19d635})=>{const {reply:_0x677f7b}=this['getInteractionAndReplyById'](_0x171565),_0x29af40=_0x677f7b['getContentParts']({'showDiff':_0x19d635});await this['_aiChatUi']['updateFeedItemAIReplySuggestionContent']({'id':_0x677f7b['id'],'parts':_0x29af40,'renderingStrategy':'static'});}),this['listenTo'](this['_aiChatUi'],'rejectSuggestion',(_0x5a6e49,{replyId:_0x388145,partIndex:_0x36d341})=>{this['_rejectSuggestion']({'replyId':_0x388145,'partIndex':_0x36d341}),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:_0x38fcf5,partIndex:_0x3e7782}=this['_currentPreviewedChangeGroup'];this['_aiChatBalloonShowDiff']=!this['_aiChatBalloonShowDiff'];const {reply:_0x335018}=this['getInteractionAndReplyById'](_0x38fcf5),_0x2fb7c7=_0x335018['getContentParts']({'showDiff':this['_aiChatBalloonShowDiff'],'groupIndex':_0x3e7782});this['_aiChatBalloon']['updateContent']({'part':_0x2fb7c7[0x0],'renderingStrategy':'static','keepErrors':!0x0});}),this['listenTo'](this['_aiChatBalloon'],'applySuggestion',()=>{const {replyId:_0x5d02b8,partIndex:_0x23c63f}=this['_currentPreviewedChangeGroup'];this['_applySuggestion']({'replyId':_0x5d02b8,'partIndex':_0x23c63f}),this['_aiChatBalloon']['setState']('accepted');}),this['listenTo'](this['_aiChatBalloon'],'insertSuggestion',()=>{const {replyId:_0x5adf08,partIndex:_0x1fe359}=this['_currentPreviewedChangeGroup'];this['_insertSuggestion']({'replyId':_0x5adf08,'partIndex':_0x1fe359}),this['_aiChatBalloon']['setState']('accepted');}),this['listenTo'](this['_aiChatBalloon'],'rejectSuggestion',()=>{const {replyId:_0x12a90e,partIndex:_0x1c98fe}=this['_currentPreviewedChangeGroup'];this['_rejectSuggestion']({'replyId':_0x12a90e,'partIndex':_0x1c98fe}),this['_aiChatBalloon']['setState']('rejected');}),this['listenTo'](this['_aiChatBalloon'],'showNext',()=>{const {replyId:_0x1e4fc5,partIndex:_0x4a4714}=this['_currentPreviewedChangeGroup'],_0x3746d4=this['_getPresentableSiblingContentPartIndex'](_0x1e4fc5,_0x4a4714,'next');null!==_0x3746d4&&this['_openBalloonFor'](_0x1e4fc5,_0x3746d4);}),this['listenTo'](this['_aiChatBalloon'],'showPrevious',()=>{const {replyId:_0x48bd9c,partIndex:_0x9c98d1}=this['_currentPreviewedChangeGroup'],_0xcb6007=this['_getPresentableSiblingContentPartIndex'](_0x48bd9c,_0x9c98d1,'previous');null!==_0xcb6007&&this['_openBalloonFor'](_0x48bd9c,_0xcb6007);}),this['listenTo'](this['_aiChatBalloon'],'dialogClosed',(_0x495c96,{id:_0x51dc83})=>{if('aiChatBalloon'!==_0x51dc83)return;const {replyId:_0x386169,partIndex:_0xc9d2c7}=this['_currentPreviewedChangeGroup'];this['_currentPreviewedChangeGroup']=null,this['_aiChatUi']['setFeedItemAIReplySuggestionPartActive']({'id':_0x386169,'index':_0xc9d2c7,'isActive':!0x1});}));}async['afterInit'](){this['context']instanceof _0xe5e2fa?this['_integrateEditor'](this['context']):this['listenTo'](this['context']['editors'],'add',(_0x251afb,_0x2d0fa0)=>{_0x2d0fa0['on']('ready',()=>{this['_integrateEditor'](_0x2d0fa0);});});const _0x1aae98=this['context']['config']['get']('ai.chat.initialConversation');let _0x454875=_0x1aae98;if('lastCreated'!=_0x1aae98||(_0x454875=await this['_getLastCreatedConversationId'](),_0x454875))return'new'==_0x454875?this['_startConversationSafely']():this['loadConversation'](_0x454875);}async['destroy'](){return await this['_stopLastInteraction'](),this['_bodyCollection']['detachFromDom'](),super['destroy']();}async['loadConversation'](_0x408e43){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'](_0x408e43)['getConversation'](),await this['_startConversationSafely'](_0x408e43),this['_updateConversationTitle']('\x20'),await this['activeConversation']['load'](_0x408e43,this['_aiEditing']['sessionId']),this['activeConversation']['isCurrentDocumentInConversation']()&&this['addCurrentDocumentToChatContext']();}catch(_0x49e270){this['_aiChatUi']['addFeedItemError']({'errorMessage':us(this['context']['locale'],'AI_CHAT_UNABLE_TO_LOAD_CONVERSATION'),'id':_0x408e43}),this['_logError'](new ht('ai-chat-conversation-not-found',this,{'error':_0x49e270}));}finally{this['_aiChatUi']['startAutoScroll'](),this['_aiChatUi']['setFeedItemRenderingStrategy']('streaming'),this['_aiChatUi']['toggleLoadingSkeleton'](!0x1);}}['registerToolDataCallback'](_0x20d54f){let _0x4a1e64=null,_0x4468f7=null;this['on']('toolDataReceived',(_0x3ae816,_0x35310b,_0x15de39)=>{_0x15de39['id']!==_0x4a1e64&&(_0x4a1e64=_0x15de39['id'],_0x4468f7=this['_getAIChatFeedAPI'](_0x15de39)),_0x20d54f(_0x35310b,_0x4468f7);});}['addCurrentDocumentToChatContext'](){this['activeConversation']?.['addCurrentDocumentToContext'](us(this['context']['locale'],'AI_CHAT_CONTEXT_CURRENT_DOCUMENT'));}async['addSelectionToChatContext'](){const _0x398721=this['_aiEditing']['getSelectionText']();this['activeConversation']?.['addSelectionToContext'](_0x398721),this['addCurrentDocumentToChatContext']();}['removeSelectionFromChatContext'](){this['activeConversation']?.['removeSelectionFromContext']();}['focusPromptInput'](){this['_aiChatUi']['focusPromptInput']();}async['startConversation'](){await this['_startConversationSafely']();}async['sendMessage'](_0x5d08a7){await this['_handleUIUserMessage'](_0x5d08a7);}['getGroupId'](){const _0x259fff=this['context']['config']['get']('collaboration.channelId');if(!_0x259fff)throw new ht('ai-chat-missing-channel-id',this);return _0x259fff;}['_handleRemovedConversation'](_0x2e61bd){this['activeConversation']['id']===_0x2e61bd&&this['_startConversationSafely']();}['_insertSuggestion'](_0xaa28d1){const _0xa8812a=Xs(this['context']);if(!_0xa8812a['plugins']['has']('TrackChanges'))throw new ht('ai-no-track-changes',null);const _0x58c77d=this['context']['plugins']['get']('DocumentCompare'),{reply:_0x23ac3f,interaction:_0x2d8938}=this['getInteractionAndReplyById'](_0xaa28d1['replyId']),_0xc43cfa=this['_getDocumentRangeForReplyChanges'](_0xaa28d1['replyId'],_0xaa28d1['partIndex']),_0x225888=void 0x0!==_0xaa28d1['partIndex']?[_0x23ac3f['changeGroups'][_0xaa28d1['partIndex']]]:_0x23ac3f['changeGroups']['filter'](_0x1362d9=>'pending'==_0x1362d9['state']),_0x2b9c5c=_0x225888['map'](_0x4d9aa3=>_0x23ac3f['changeGroups']['indexOf'](_0x4d9aa3));if(!_0xc43cfa||'$graveyard'==_0xc43cfa['range']['root']['rootName'])return void _0x2b9c5c['forEach'](_0x24a9c5=>_0x23ac3f['setChangeGroupState'](_0x24a9c5,'outdated'));_0x2b9c5c['forEach'](_0x3678c3=>_0x23ac3f['setChangeGroupState'](_0x3678c3,'accepted'));const _0x2f358d=zs({'editor':_0xa8812a,'reply':_0x23ac3f,'interaction':_0x2d8938,'groups':_0x225888,'transform':!0x0,'documentCompare':_0x58c77d,'documentCompareOptions':{'anchor':'main','markDeletions':!0x0}});let _0x47bf2d;_0xc43cfa&&this['_scrollToSuggestionRange'](_0xc43cfa['range']),_0xa8812a['model']['change'](_0xa144b8=>{_0x47bf2d=_0xa144b8['batch'],_0xa8812a['plugins']['get']('TrackChangesEditing')['_applyOperationsAsSuggestions'](_0x2f358d),this['_aiEditing']['hideFakeVisualSelection']('change-area');}),this['_batchToChanges']['set'](_0x47bf2d,{'interactionId':_0x2d8938['id'],'replyId':_0x23ac3f['id'],'indexes':_0x2b9c5c['slice']()}),this['_updateRatings'](_0x23ac3f);}['_applySuggestion'](_0x53f99a){const _0x3133d6=Xs(this['context']),_0x190c64=this['context']['plugins']['get'](_0x2da15a),{reply:_0x3de9cd,interaction:_0x42247d}=this['getInteractionAndReplyById'](_0x53f99a['replyId']),_0xdec28d=this['_getDocumentRangeForReplyChanges'](_0x53f99a['replyId'],_0x53f99a['partIndex']),_0x26d312=void 0x0!==_0x53f99a['partIndex']?[_0x3de9cd['changeGroups'][_0x53f99a['partIndex']]]:_0x3de9cd['changeGroups']['filter'](_0xe4c0ca=>'pending'==_0xe4c0ca['state']),_0x4fa820=_0x26d312['map'](_0x24047c=>_0x3de9cd['changeGroups']['indexOf'](_0x24047c));if(!_0xdec28d||'$graveyard'==_0xdec28d['range']['root']['rootName'])return void _0x4fa820['forEach'](_0x57e2ad=>_0x3de9cd['setChangeGroupState'](_0x57e2ad,'outdated'));_0x4fa820['forEach'](_0xe74d99=>_0x3de9cd['setChangeGroupState'](_0xe74d99,'accepted'));const _0x3260f2=zs({'editor':_0x3133d6,'reply':_0x3de9cd,'interaction':_0x42247d,'groups':_0x26d312,'transform':!0x0,'documentCompare':_0x190c64,'documentCompareOptions':{'anchor':'main','markDeletions':!0x1}});let _0x5a65c9;_0xdec28d&&this['_scrollToSuggestionRange'](_0xdec28d['range']),_0x3133d6['model']['change'](_0x3f3923=>{_0x5a65c9=_0x3f3923['batch'];for(const _0x115554 of _0x3260f2)_0x115554['baseVersion']=_0x3133d6['model']['document']['version'],js(_0x3133d6,_0x115554),_0x3f3923['batch']['addOperation'](_0x115554),_0x3133d6['model']['applyOperation'](_0x115554);}),this['_batchToChanges']['set'](_0x5a65c9,{'interactionId':_0x42247d['id'],'replyId':_0x3de9cd['id'],'indexes':_0x4fa820['slice']()}),this['_updateRatings'](_0x3de9cd);}['_rejectSuggestion'](_0x34cf26){const {reply:_0x33466a}=this['getInteractionAndReplyById'](_0x34cf26['replyId']);_0x33466a['setChangeGroupState'](_0x34cf26['partIndex'],'rejected');}['_openBalloonFor'](_0x564e28,_0x578f1b){if(!this['_aiChatBalloon'])return;const {reply:_0x8ea326}=this['getInteractionAndReplyById'](_0x564e28),_0x53329e=_0x8ea326['getContentParts']({'showDiff':this['_aiChatBalloonShowDiff']});let _0x212afe,_0x1c3289;if(void 0x0!==_0x578f1b?(_0x1c3289=_0x53329e['find'](_0x5a04bf=>_0x5a04bf['index']==_0x578f1b),_0x212afe=_0x1c3289?.['index']):(_0x1c3289=_0x53329e[0x0],_0x212afe=_0x1c3289['index']),this['_currentPreviewedChangeGroup']?.['replyId']==_0x564e28&&this['_currentPreviewedChangeGroup']?.['partIndex']==_0x212afe)return;const _0x4f36af=this['_getUserPresentableContentPartDocumentRange'](_0x564e28,_0x8ea326,_0x1c3289);if(!_0x4f36af)return void this['_aiChatBalloon']['close']();this['_currentPreviewedChangeGroup']={'replyId':_0x564e28,'partIndex':_0x212afe},this['_scrollToSuggestionRange'](_0x4f36af,!0x0);const _0x4ff2e4=this['_getPresentableSiblingContentPartIndex'](_0x564e28,_0x212afe,'next');this['_aiChatBalloon']['updateContent']({'part':_0x1c3289,'renderingStrategy':'static'}),this['_aiChatBalloon']['open']({'index':_0x212afe,'title':us(this['context']['locale'],'AI_BALLOON_HEADER_TITLE',(_0x212afe+0x1)['toString']()),'showRotator':null!==_0x4ff2e4,'ranges':[_0x4f36af],'areActionsDisabled':_0x8ea326['areActionsDisabled']}),this['_aiChatBalloon']['setState']('pending'),this['_aiChatUi']['scrollFeedToSuggestion'](_0x564e28,_0x212afe),this['_aiChatUi']['setFeedItemAIReplySuggestionPartActive']({'id':_0x564e28,'index':_0x212afe,'isActive':!0x0});}['_getPresentableSiblingContentPartIndex'](_0x3d3f26,_0x84c658,_0x319d44){const {reply:_0x514753}=this['getInteractionAndReplyById'](_0x3d3f26),_0x419f07=_0x514753['getContentParts']({'showDiff':this['_aiChatBalloonShowDiff']});if(0x1==_0x419f07['length'])return null;const _0x5a450e=_0x419f07['findIndex'](_0x1ca8ad=>_0x1ca8ad['index']==_0x84c658),_0x2c987d='next'==_0x319d44?0x1:-0x1;let _0x3682a4=_0x419f07['at']((_0x5a450e+_0x2c987d)%_0x419f07['length'])['index'],_0x494873=_0x419f07[_0x3682a4];for(;!this['_getUserPresentableContentPartDocumentRange'](_0x3d3f26,_0x514753,_0x494873);){if(_0x3682a4=_0x419f07['at']((_0x3682a4+_0x2c987d)%_0x419f07['length'])['index'],_0x3682a4===_0x5a450e)return null;_0x494873=_0x419f07[_0x3682a4];}return _0x3682a4;}['_getUserPresentableContentPartDocumentRange'](_0x595261,_0x57a7cd,_0x15ad23){const _0x268b1e=_0x57a7cd['changeGroups'];if(!_0x15ad23['hasChanges'])return null;const _0x34246e=_0x268b1e['find'](_0x1fc95a=>_0x1fc95a['index']==_0x15ad23['index']);if('pending'!==_0x34246e?.['state'])return null;const _0x255a8c=this['_getDocumentRangeForReplyChanges'](_0x595261,_0x15ad23['index']);if(!_0x255a8c)return null;const {range:_0x481a2e,currentIndex:_0x15b81b}=_0x255a8c;return'$graveyard'==_0x481a2e['root']['rootName']?(_0x57a7cd['setChangeGroupState'](_0x15b81b,'outdated'),null):_0x255a8c['range'];}['_getDocumentRangeForReplyChanges'](_0x5d2254,_0x18be17){const _0x2f9a27=Xs(this['context']),{reply:_0x57852,interaction:_0x57bc08}=this['getInteractionAndReplyById'](_0x5d2254),_0x12a310=_0x57852['changeGroups']['filter'](_0x3485c2=>'pending'==_0x3485c2['state']),_0x42760b=_0x12a310['map'](_0x598ea2=>_0x57852['changeGroups']['indexOf'](_0x598ea2));void 0x0===_0x18be17&&(_0x18be17=_0x42760b[0x0]);const _0x4899bc=_0x42760b['indexOf'](_0x18be17);if(-0x1==_0x4899bc)return null;const _0x8de67d=_0x12a310[_0x4899bc],_0x32e31c=new _0x11db27([]),_0x3ea7ed=new _0x11db27([]);for(const _0x13160f of _0x8de67d['changes'])if('removed'!=_0x13160f['type']&&_0x3ea7ed['children']['push'](_0x13160f['node']['cloneNode'](!0x0)),'new'!=_0x13160f['type']){const _0x394aa9=_0x6acb98(_0x424a38=>ms(_0x424a38,'data-id')==_0x13160f['id'],_0x57852['documentContextContent'],!0x0);_0x32e31c['children']['push'](_0x394aa9['cloneNode'](!0x0));}if(0x0==_0x32e31c['children']['length']){if(_0x8de67d['changes'][0x0]['anchorId']){const _0x30f566=ps('data-id',_0x8de67d['changes'][0x0]['anchorId'],_0x57852['documentContextContent']);_0x32e31c['children']['unshift'](_0x30f566['cloneNode'](!0x0)),_0x3ea7ed['children']['unshift'](_0x30f566['cloneNode'](!0x0)),_0x30f566['nextSibling']&&(_0x32e31c['children']['push'](_0x30f566['nextSibling']['cloneNode'](!0x0)),_0x3ea7ed['children']['push'](_0x30f566['nextSibling']['cloneNode'](!0x0)));}else{const _0x1a8be7=_0x57852['documentContextContent']['children'][0x0];if(!_0x1a8be7)return null;_0x32e31c['children']['push'](_0x1a8be7['cloneNode'](!0x0)),_0x3ea7ed['children']['push'](_0x1a8be7['cloneNode'](!0x0));}}const _0x5da615=_0x57bc08['getDocumentContext'](),_0x2e00c6=_0x2f9a27['data']['parse'](_0x5da615['content']),_0x1f163b=Es(_0x32e31c),_0x4405d4=_0x2f9a27['data']['parse'](_0x1f163b),_0x5f467c=_0x2f9a27['data']['parse'](_0x1f163b),_0x16f0a8=_0x2f9a27['model']['createPositionAt'](_0x4405d4,0x0),_0x312da2=Es(_0x3ea7ed),_0x4e40cc={'anchor':_0x16f0a8,'markDeletions':!0x1},_0x203b93=_0x2f9a27['plugins']['get'](_0x2da15a)['getDiff'](_0x1f163b,_0x312da2,_0x4e40cc)['getOperations']();if(!_0x203b93['length'])return null;_0x2f9a27['model']['change'](_0x1eaa5e=>{for(const _0x1dd6bd of _0x203b93)if('remove'==_0x1dd6bd['type']){const _0x32cdc9=_0x1dd6bd['sourcePosition'],_0x402ad9=_0x1dd6bd['howMany'],_0x32cafd=new _0x2a791f(_0x32cdc9,_0x402ad9);_0x1eaa5e['batch']['addOperation'](_0x32cafd),_0x2f9a27['model']['applyOperation'](_0x32cafd);}else'marker'!==_0x1dd6bd['type']&&(_0x1dd6bd['baseVersion']=null,_0x1dd6bd['isDocumentOperation']=!0x1,_0x1eaa5e['batch']['addOperation'](_0x1dd6bd),_0x2f9a27['model']['applyOperation'](_0x1dd6bd));});const _0x54fae9=ys(_0x2f9a27,_0x203b93,_0x4405d4);xs(_0x2f9a27['model'],_0x54fae9);const _0x53300f=_0x54fae9['getFirstRange']()['start']['path']['slice'](),_0xfc6a60=_0x54fae9['getFirstRange']()['end']['path']['slice'](),_0x1548a4=[];let _0x251985=_0x4405d4,_0x1e24be=_0x5f467c;for(let _0x23b8ea=0x0;_0x23b8ea<_0xfc6a60['length'];_0x23b8ea++){const _0xe5685c=_0x251985['maxOffset']-_0xfc6a60[_0x23b8ea];_0x1548a4[_0x23b8ea]=_0x1e24be['maxOffset']-_0xe5685c,_0x251985=_0x251985['getChildAtOffset'](_0xfc6a60[_0x23b8ea]),_0x1e24be=_0x1e24be['getChildAtOffset'](_0x1548a4[_0x23b8ea]);}const _0x227dfc=_0x2f9a27['model']['createRange'](_0x2f9a27['model']['createPositionFromPath'](_0x5f467c,_0x53300f),_0x2f9a27['model']['createPositionFromPath'](_0x5f467c,_0x1548a4)),_0x388c6d=_0x5f467c['getChild'](0x0)['getAttribute'](_0x34b0f5),_0x3b19a6=Array['from'](_0x2e00c6['getChildren']())['find'](_0x5d4a27=>_0x5d4a27['getAttribute'](_0x34b0f5)==_0x388c6d)['getPath'](),_0x186b53=_0x227dfc['start']['path']['slice'](),_0x21aa51=_0x227dfc['end']['path']['slice']();_0x186b53[0x0]=_0x3b19a6[0x0]+_0x186b53[0x0],_0x21aa51[0x0]=_0x3b19a6[0x0]+_0x21aa51[0x0];let _0x4266dc=_0x2f9a27['model']['createRange'](_0x2f9a27['model']['createPositionFromPath'](_0x2f9a27['model']['document']['getRoot'](),_0x186b53),_0x2f9a27['model']['createPositionFromPath'](_0x2f9a27['model']['document']['getRoot'](),_0x21aa51));const _0xcc854b=_0x2f9a27['model']['document']['history']['getOperations'](_0x5da615['version']);for(const _0x113744 of _0xcc854b)_0x4266dc=_0x5258a6['_createFromRanges'](_0x4266dc['getTransformedByOperation'](_0x113744));return{'range':_0x4266dc,'currentIndex':_0x18be17};}['_integrateEditor'](_0xc74a61){if(_0xc74a61['plugins']['has']('Undo')){const _0x1e36ef=_0xc74a61['commands']['get']('undo'),_0xd73efc=_0xc74a61['commands']['get']('redo');this['listenTo'](_0x1e36ef,'revert',(_0x52b364,_0x419196,_0x3dc2f5)=>{const _0x263974=this['_batchToChanges']['get'](_0x419196);if(!_0x263974)return;const _0x29bc63=this['activeConversation']['getInteraction'](_0x263974['interactionId'])['getReply'](_0x263974['replyId']);_0x263974['indexes']['forEach'](_0xe5c059=>_0x29bc63['setChangeGroupState'](_0xe5c059,'pending')),this['_batchToChanges']['delete'](_0x419196),this['_batchToChanges']['set'](_0x3dc2f5,_0x263974);}),this['listenTo'](_0xd73efc,'revert',(_0x451dd3,_0x497e78,_0x227151)=>{const _0x3af3c1=this['_batchToChanges']['get'](_0x497e78);if(!_0x3af3c1)return;const _0x1e1375=this['activeConversation']['getInteraction'](_0x3af3c1['interactionId'])['getReply'](_0x3af3c1['replyId']);_0x3af3c1['indexes']['forEach'](_0x545516=>_0x1e1375['setChangeGroupState'](_0x545516,'accepted')),this['_batchToChanges']['delete'](_0x497e78),this['_batchToChanges']['set'](_0x227151,_0x3af3c1);});}const _0x5eb2f1=_0xc74a61['config']['get']('ai.chat.context');_0x5eb2f1['alwaysAddSelection']&&_0x5eb2f1['document']['enabled']&&this['listenTo'](_0xc74a61['model']['document']['selection'],'change:range',(_0x59cbf4,_0x1701ae)=>{if(!_0x1701ae['directChange'])return;'chat'===_0xc74a61['plugins']['get']('AITabs')['view']['activeTab']&&(_0xc74a61['model']['hasContent'](_0xc74a61['model']['document']['selection'])?this['addSelectionToChatContext']():this['removeSelectionFromChatContext']());});}async['_getLastCreatedConversationId'](){const _0x4acb2d=this['_aiConnector']['fetchConversations'](this['getGroupId'](),{'limit':0x1,'sortBy':'createdAt'});try{const _0x1c1be3=await _0x4acb2d['getConversations']();return _0x1c1be3['length']?_0x1c1be3[0x0]['id']:'new';}catch(_0x3247c6){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':_0x3247c6})),this['_aiChatUi']['toggleLoadingSkeleton'](!0x1),this['_aiChatUi']['disableControls'](),null;}}async['_startConversationSafely'](_0x46f714){try{this['_aiChatUi']['enableControls'](),await this['_handleStartConversation'](_0x46f714);}catch(_0x3aa5ff){this['_aiChatUi']['addFeedItemError']({'errorMessage':us(this['context']['locale'],'AI_CHAT_UNABLE_TO_START_CONVERSATION'),'id':_0x46f714||ot()}),console['error'](_0x3aa5ff),this['activeConversation']=void 0x0,this['_aiChatUi']['disableControls']();}}async['_handleStartConversation'](_0x355c00){let _0xe0b855;this['context']['plugins']['has']('AIChatBalloon')&&this['context']['plugins']['get']('AIChatBalloon')['close'](),_0x355c00||!this['activeConversation']?_0xe0b855=this['context']['config']['get']('ai.models.defaultModelId'):this['_aiChatUi']['isModelAvailable']&&(_0xe0b855=this['activeConversation']['selectedModel']['id']),await this['_stopLastInteraction']();const _0x54b0d9=this['getGroupId'](),_0xb32b=_0x355c00||ot();this['activeConversation']=new $s({'connector':this['_aiConnector'],'chatModels':this['_aiChatModels'],'selectedModelId':_0xe0b855,'conversationId':_0xb32b,'group':_0x54b0d9,'getEditor':()=>Xs(this['context']),'isFromHistory':!!_0x355c00}),this['activeConversation']['delegate']('toolDataReceived','interactionStarted')['to'](this),this['activeConversation']['delegate']('toolDataReceived','interactionCreated','replyCreated')['to'](this),this['on']('interactionCreated',(_0x5e32d8,_0x4cd532)=>{this['_aiChatUi']['addFeedItemUserMessage'](_0x4cd532);}),this['on']('replyCreated',(_0x5c78a1,_0x3c06fa)=>{this['_addFeedItemReply'](_0x3c06fa);}),this['activeConversation']['on']('conversationInitialized',(_0x3b6ca1,_0x431a06)=>{this['_aiChatUi']['createConversation'](_0x431a06),this['_aiChatUi']['resetMessageInput'](),this['_aiChatUi']['clearPendingContextUI'](),this['_aiChatUi']['clearConversationContextUI'](),_0x355c00||(this['_aiChatUi']['resetConversationTitle'](),this['addCurrentDocumentToChatContext']());}),this['activeConversation']['on']('uploadProgressChanged',(_0x3eed61,_0x58184c)=>{this['_aiChatUi']['setIsUploadInProgress'](_0x58184c['isUploadInProgress']);}),this['activeConversation']['on']('webSearchStarted',()=>{const _0x1f9c21=this['_aiChatUi']['prepareLoadingMessage']({'isWebSearchEnabled':!0x0,'isReasoningEnabled':!0x1});this['_aiChatUi']['setLoadingMessage'](_0x1f9c21);}),this['activeConversation']['on']('reasoningStarted',()=>{const _0x5b2f72=this['_aiChatUi']['prepareLoadingMessage']({'isWebSearchEnabled':!0x1,'isReasoningEnabled':!0x0});this['_aiChatUi']['setLoadingMessage'](_0x5b2f72);}),this['activeConversation']['on']('webSearchFinished',(_0x3a6669,_0x3e3d54)=>{this['_aiChatUi']['addFeedInteractionHeader'](_0x3e3d54,{'isWebSearchEnabled':!0x0,'isReasoningEnabled':!0x1});}),this['activeConversation']['on']('reasoningFinished',(_0x39fb96,_0x1b0522)=>{this['_aiChatUi']['addFeedInteractionHeader'](_0x1b0522,{'isWebSearchEnabled':!0x1,'isReasoningEnabled':!0x0});}),this['activeConversation']['on']('interactionStarted',()=>{this['_aiChatUi']['startInteraction']();}),this['activeConversation']['on']('interactionFinished',async()=>{await this['_aiChatUi']['finishInteraction']();}),this['activeConversation']['on']('interactionDestroyed',(_0x217ceb,_0x4729d2)=>{this['_aiChatUi']['removeFeedInteraction'](_0x4729d2['id']);}),this['activeConversation']['on']('setConversationTitle',(_0x3433ad,_0x1f7f01,_0x5b4d3a)=>{this['_updateConversationTitle'](_0x1f7f01,_0x5b4d3a);}),this['activeConversation']['on']('replyContentUpdated',async(_0x1f6d42,_0x4681e7)=>{await this['_updateReplyContent']({'reply':_0x4681e7});}),this['activeConversation']['on']('replyChangeGroupStateUpdated',(_0x18cdbc,{reply:_0x3e370a,index:_0x4851b2,state:_0x2aa633})=>{this['_aiChatUi']['updateFeedItemAIReplySuggestionPartState']({'id':_0x3e370a['id'],'index':_0x4851b2,'state':_0x2aa633}),this['_currentPreviewedChangeGroup']?.['replyId']['includes'](_0x3e370a['id'])&&this['_currentPreviewedChangeGroup']?.['partIndex']==_0x4851b2&&this['_aiChatBalloon']?.['setState'](_0x2aa633);}),this['activeConversation']['on']('contextItemAdded',(_0x5002ba,_0x10976c)=>{if(this['_aiChatUi']['addContextItem'](_0x10976c['contextItem'],_0x10976c['isLoading']),'selection'===_0x10976c['contextItem']['type']){const _0x5ce215=[...Xs(this['context'])['model']['document']['selection']['getRanges']()];this['_aiEditing']['showFakeVisualSelection']({'ranges':_0x5ce215,'id':'context','priority':0x1});}}),this['activeConversation']['on']('contextItemRemoved',(_0x26c172,_0x57d78b)=>{this['_aiChatUi']['removeContextItem'](_0x57d78b['uiId']),'current-document'==_0x57d78b['uiId']&&this['removeSelectionFromChatContext'](),'selection'===_0x57d78b['type']&&this['_aiEditing']['hideFakeVisualSelection']('context');}),this['activeConversation']['on']('contextItemLoadingEnded',(_0x2e1a91,_0x293604)=>{this['_aiChatUi']['setContextItemLoading'](_0x293604['contextItem']['uiId'],_0x293604['isLoading']);}),this['activeConversation']['on']('contextSent',(_0x2c98ca,_0x4e6811)=>{this['_aiChatUi']['setConversationContext'](_0x4e6811['contextItems']);}),this['activeConversation']['on']('addContextOptionsChanged',(_0x276111,_0x3ba5d3)=>{this['_aiChatUi']['setAddContextOptions'](_0x3ba5d3['options']);}),this['activeConversation']['on']('sourceResourcesLoaded',(_0x334bef,_0x11bd14)=>{this['_aiChatUi']['populateSourceResourceBalloon'](_0x11bd14['sourceId'],_0x11bd14['source'],_0x11bd14['resources'],_0x11bd14['uid']);}),this['activeConversation']['on']('resourceStateChanged',(_0x517369,_0x33f553)=>{this['_aiChatUi']['updateResourceState'](_0x33f553['sourceId'],_0x33f553['resourceId'],_0x33f553['isInContext']);}),this['activeConversation']['on']('capabilitiesUpdated',(_0x2eda50,_0x406234)=>{this['_aiChatUi']['updateCapabilities'](_0x406234);}),this['activeConversation']['on']('modelSelected',async(_0x5d830e,_0x43eb3b)=>{const _0x529fed=(await this['_aiChatModels']['getAll']())['find'](_0x218f83=>_0x218f83['id']===_0x43eb3b['selectedModel']?.['id'])||null;this['_aiChatUi']['setSelectedModel'](_0x529fed,_0x43eb3b['isDisabled']);}),this['activeConversation']['on']('error',(_0x2a42a7,{error:_0xe83bbc,interactionId:_0x1258fa,fileName:_0x2f2f8b,url:_0x919c03,sourceId:_0x11296d,sourceLabel:_0x25bba8})=>{const _0x4ce227=_0x1258fa?_0x1258fa+':'+ot():ot();_0xe83bbc['message']['startsWith']('ai-request-aborted')?this['_aiChatUi']['addFeedItemStaticMessage']({'staticMessage':us(this['context']['locale'],'AI_CHAT_ABORTED_MESSAGE'),'id':_0x4ce227}):_0xe83bbc['message']['startsWith']('ai-chat-conversation-init-failed')||_0xe83bbc['message']['startsWith']('ai-chat-conversation-start-failed')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':us(this['context']['locale'],'AI_CHAT_UNABLE_TO_START_CONVERSATION'),'id':_0x4ce227}),this['_logError'](_0xe83bbc)):_0xe83bbc['message']['startsWith']('ai-chat-file-upload-failed')?this['_aiChatUi']['addFeedItemError']({'errorMessage':us(this['context']['locale'],'AI_CHAT_CONTEXT_UNABLE_TO_UPLOAD_FILE',_0x2f2f8b),'id':_0x4ce227}):_0xe83bbc['message']['startsWith']('ai-chat-url-upload-failed')?this['_aiChatUi']['addFeedItemError']({'errorMessage':us(this['context']['locale'],'AI_CHAT_CONTEXT_UNABLE_TO_UPLOAD_URL',_0x919c03),'id':_0x4ce227}):_0xe83bbc['message']['startsWith']('ai-chat-context-invalid-data')?this['_aiChatUi']['addFeedItemError']({'errorMessage':us(this['context']['locale'],'AI_CHAT_CONTEXT_INVALID_DATA'),'id':_0x4ce227}):_0xe83bbc['message']['startsWith']('ai-chat-context-unsupported-type')?this['_aiChatUi']['addFeedItemError']({'errorMessage':us(this['context']['locale'],'AI_CHAT_CONTEXT_UNSUPPORTED_TYPE'),'id':_0x4ce227}):_0xe83bbc['message']['startsWith']('ai-chat-source-resources-load-failed')?(_0x11296d&&this['_aiChatUi']['closeSourceResourceBalloon'](_0x11296d),this['_aiChatUi']['addFeedItemError']({'errorMessage':us(this['context']['locale'],'AI_CHAT_CONTEXT_UNABLE_TO_LOAD_RESOURCES',_0x25bba8||'source'),'id':_0x4ce227}),this['_logError'](_0xe83bbc)):_0xe83bbc['message']['startsWith']('ai-chat-resource-load-failed')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':us(this['context']['locale'],'AI_CHAT_RESOURCE_LOAD_FAILED'),'id':_0x4ce227}),this['_logError'](_0xe83bbc)):_0xe83bbc['message']['startsWith']('ai-chat-invalid-request')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':us(this['context']['locale'],'AI_CHAT_INVALID_REQUEST'),'id':_0x4ce227}),this['_logError'](_0xe83bbc)):_0xe83bbc['message']['startsWith']('ai-chat-context-unsupported-file-type')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':us(this['context']['locale'],'AI_CHAT_CONTEXT_UNSUPPORTED_FILE_TYPE'),'id':_0x4ce227}),this['_logError'](_0xe83bbc)):_0xe83bbc['message']['startsWith']('ai-chat-context-file-too-large')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':us(this['context']['locale'],'AI_CHAT_CONTEXT_FILE_TOO_LARGE'),'id':_0x4ce227}),this['_logError'](_0xe83bbc)):_0xe83bbc['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':_0x4ce227}),this['_logError'](_0xe83bbc)):_0xe83bbc['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':_0x4ce227}),this['_logError'](_0xe83bbc)):(this['_aiChatUi']['addFeedItemError']({'errorMessage':us(this['context']['locale'],'AI_CHAT_GENERIC_ERROR'),'id':_0x4ce227}),this['_logError'](_0xe83bbc));}),await this['activeConversation']['init'](this['context']['config']['get']('ai.chat.context')),_0x355c00||await this['activeConversation']['start']();}async['_handleUIUserMessage']({message:_0x215bea,attributes:_0x11ebf0}){if(!this['activeConversation'])throw new ht('ai-chat-controller-no-active-conversation');if(this['activeConversation']['isCurrentDocumentInContext']()){const _0x34ba21=await this['_aiEditing']['getDocumentData']();await this['activeConversation']['updateCurrentDocumentInContext'](_0x34ba21);}this['activeConversation']['id']&&this['activeConversation']['isStarted']&&await this['activeConversation']['handleUserInteraction']({'userMessage':_0x215bea,'attributes':_0x11ebf0});}['_setIsMaximized'](_0x292ede){this['_aiChatUi']['setIsMaximized'](_0x292ede);}['_logError'](_0x3d4fd3){mt(_0x3d4fd3['message']);}['_removeFromContext'](_0x9599b4){this['activeConversation']?.['removeFromContext'](_0x9599b4);}['_toggleWebSearch'](){this['activeConversation']?.['toggleWebSearch']();}['_toggleReasoning'](){this['activeConversation']?.['toggleReasoning']();}['getInteractionAndReplyById'](_0x25f6da){const [_0x33e3a6,_0x346320]=_0x25f6da['split'](':'),_0x21cecc=this['activeConversation']['getInteraction'](_0x33e3a6),_0x5761ac=_0x21cecc['getReply'](_0x346320);return{'interaction':_0x21cecc,'reply':_0x5761ac};}['_scrollToSuggestionRange'](_0x458c76,_0x572710=!0x1){const _0x157444=Xs(this['context']),_0x3cdb4a={'target':_0x157444['editing']['view']['domConverter']['viewRangeToDom'](_0x157444['editing']['mapper']['toViewRange'](_0x458c76)),'viewportOffset':{'top':0x96,'left':0x0,'bottom':0x32,'right':0x0},'ancestorOffset':0x14,'alignToTop':_0x572710};_0x572710&&(_0x3cdb4a['alignToTop']=!0x0),Ct(_0x3cdb4a);}['_updateConversationTitle'](_0x384108,_0x50a172=!0x1){this['_aiChatUi']['setConversationTitle'](_0x384108||us(this['context']['locale'],'AI_CHAT_UNTITLED_CONVERSATION'),_0x50a172);}['_addFeedItemReply'](_0x1a91be){'text'===_0x1a91be['type']?this['_aiChatUi']['addFeedItemAIReply'](_0x1a91be):this['_aiChatUi']['addFeedItemAISuggestion'](_0x1a91be);}async['_updateReplyContent']({reply:_0x1e2ca3,renderingStrategy:_0x20aed2}){const {id:_0x249fd4,interactionId:_0x44f846,isDone:_0x31ca8e,type:_0x2cde83,parsedContent:_0xe9cc86}=_0x1e2ca3,_0x5053e2=_0x44f846+':'+_0x249fd4;if('modification'===_0x2cde83){const _0x8dae61=_0x1e2ca3['getContentParts']({'showDiff':this['_aiChatUi']['showDiff']});await this['_aiChatUi']['updateFeedItemAIReplySuggestionContent']({'id':_0x5053e2,'parts':_0x8dae61,'renderingStrategy':_0x20aed2,'isDone':_0x31ca8e});}else'text'===_0x2cde83&&await this['_aiChatUi']['updateFeedItemAIReplyContent']({'id':_0x5053e2,'parsedContent':_0xe9cc86,'renderingStrategy':_0x20aed2,'isDone':_0x31ca8e});_0x31ca8e&&_0x1e2ca3['sources']['length']>0x0&&this['_aiChatUi']['updateFeedItemAIReplySources'](_0x5053e2,_0x1e2ca3['sources']);}async['_stopLastInteraction'](){const _0x391a23=this['activeConversation']?.['lastInteraction'];_0x391a23&&(_0x391a23['stop'](),this['_aiChatUi']['stopInteraction'](_0x391a23));}async['_flushLastInteractionUI'](){const _0x55c440=this['activeConversation']?.['lastInteraction'];if(_0x55c440){for await(const _0x3de31e of _0x55c440['replies'])this['_aiChatUi']['hasFeedItem'](_0x3de31e['id'])||this['_addFeedItemReply'](_0x3de31e),await this['_updateReplyContent']({'reply':_0x3de31e,'renderingStrategy':'static'});}}['_updateRatings'](_0x374692){const _0x5910ab={'positiveCount':_0x374692['changeGroups']['filter'](_0x20db4a=>'accepted'===_0x20db4a['state'])['length'],'totalCount':_0x374692['changeGroups']['length'],'modificationId':_0x374692['id']},_0x2e7d48=this['activeConversation']['getInteraction'](_0x374692['interactionId'])['messageId'];_0x2e7d48&&this['_aiConnector']['upsertAIChatRating'](this['activeConversation']['id'],_0x2e7d48,_0x5910ab);}['_getAIChatFeedAPI'](_0x9478b0){const _0x2915cb=this['_aiChatUi'],_0x25f5c6=()=>{_0x9478b0['resetWebSearchState'](),_0x9478b0['resetReasoningState'](),_0x2915cb['clearLoadingMessage']();},_0x4fae41=()=>{_0x9478b0['currentReply']&&(_0x9478b0['currentReply']['done'](),_0x9478b0['currentReply']=void 0x0);};return{'insertTextReply':(_0x3b0bb5,_0x3e4fb6)=>{_0x4fae41(),_0x25f5c6();const _0x432a3f=_0x9478b0['currentReply']=_0x9478b0['createReply']({'type':'text','interactionId':_0x9478b0['id'],'content':_0x3b0bb5,'id':_0x3e4fb6||ot()});return _0x4fae41(),_0x432a3f;},'insertCustomElement':async(_0x5bfcd1,_0x40149a)=>(_0x4fae41(),_0x25f5c6(),_0x2915cb['addFeedItemCustomElement'](_0x5bfcd1,_0x40149a||ot())),'setLoadingMessage':_0x21dfc1=>{_0x2915cb['setLoadingMessage'](_0x21dfc1);},'clearLoadingMessage':()=>{_0x2915cb['clearLoadingMessage']();}};}}const Zs='ai-selection';class tn extends _0x4c3ee6{constructor(_0x40a4df){super(_0x40a4df),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 _0x35edd1=Xs(this['context']),_0x203b4b=_0x35edd1['plugins']['has']('RealTimeCollaborationClient')&&_0x35edd1['plugins']['get']('RealTimeCollaborationClient')['sessionId'];this['_sessionId']=_0x203b4b||ot();}return this['_sessionId'];}async['getDocumentData'](){const _0x4c9042=Xs(this['context']),_0x559dfa=_0x4c9042['model'],_0x3922a8=_0x4c9042['data']['toView'](_0x559dfa['document']['getRoot'](),{'convertAiChatSelectionMarker':!0x0}),_0x16c9bf=new _0x1e54b4(_0x4c9042['editing']['view']['document']);this['_setDataIdsOnChildren'](_0x3922a8,_0x16c9bf);let _0x34cea4=await this['_getDocumentDataStringFromView'](_0x3922a8);const _0x348906=this['_getMarkersInDocumentOrder'](),_0x4d633d=[];for(const _0x5bee06 of _0x348906){const _0x53bf8e='<'+_0x5bee06['name']+':start></'+_0x5bee06['name']+':start>',_0x80c962=_0x34cea4['indexOf'](_0x53bf8e);_0x34cea4=_0x34cea4['substring'](0x0,_0x80c962)+_0x34cea4['substring'](_0x80c962+_0x53bf8e['length']);const _0xb047fa='<'+_0x5bee06['name']+':end></'+_0x5bee06['name']+':end>',_0x186deb=_0x34cea4['indexOf'](_0xb047fa);_0x34cea4=_0x34cea4['substring'](0x0,_0x186deb)+_0x34cea4['substring'](_0x186deb+_0xb047fa['length']),_0x4d633d['push']({'markerName':_0x5bee06['name'],'start':_0x80c962,'end':_0x186deb,'htmlFragment':_0x34cea4['substring'](_0x80c962,_0x186deb)});}return{'content':_0x34cea4,'version':_0x4c9042['model']['document']['version'],'sessionId':this['sessionId'],'selections':_0x4d633d};}async['afterInit'](){this['context']instanceof _0xe5e2fa?this['_integrateEditor'](this['context']):this['listenTo'](this['context']['editors'],'add',(_0x126541,_0x355fe4)=>{_0x355fe4['on']('ready',()=>{this['_integrateEditor'](_0x355fe4);});});}['_setOutputDataProcessor'](_0x25f08d){this['_outputDataProcessor']=_0x25f08d;}async['_getDocumentDataStringFromView'](_0x181f78){let _0x504ca9;const _0x2aeb84=Xs(this['context']);if(this['_outputDataProcessor']){const _0x3e4f3c=_0x2aeb84['data']['processor']['domConverter']['viewToDom'](_0x181f78),_0x1ba4a4=await this['_outputDataProcessor'](_0x3e4f3c);_0x504ca9=_0x2aeb84['data']['processor']['htmlWriter']['getHtml'](_0x1ba4a4);}else _0x504ca9=_0x2aeb84['data']['processor']['toData'](_0x181f78);return _0x504ca9;}['_integrateEditor'](_0x472ad6){_0x472ad6['conversion']['for']('editingDowncast')['markerToHighlight']({'model':Zs,'view':({markerName:_0x3adf62})=>({'classes':['ck-ai-assistant-ui_theme','ck-fake-ai-selection','ck-fake-ai-selection-'+_0x3adf62['split'](':')[0x1]],'priority':0xc})}),_0x472ad6['conversion']['for']('dataDowncast')['markerToElement']({'model':Zs,'view':(_0x4d477a,{writer:_0x588b6f,options:_0x4bbb1c})=>_0x4bbb1c['convertAiChatSelectionMarker']?_0x588b6f['createUIElement'](_0x4d477a['markerName']+':'+(_0x4d477a['isOpening']?'start':'end')):null});}['showFakeVisualSelection'](_0xa1e462){const _0x173958=this['_fakeSelections'][0x0]||null;this['_addFakeSelection'](_0xa1e462);const _0x33aa1b=this['_fakeSelections'][0x0]||null;this['_refreshFakeSelection'](_0x173958,_0x33aa1b);}['hideFakeVisualSelection'](_0x3b3353){const _0x3c141a=this['_fakeSelections'][0x0]||null;this['_removeFakeSelectionById'](_0x3b3353);const _0x25d3c6=this['_fakeSelections'][0x0]||null;this['_refreshFakeSelection'](_0x3c141a,_0x25d3c6);}async['modelToDataWithIds'](_0x2d9b9b){const _0x2571a4=Xs(this['context']),_0x3b4faa=_0x2571a4['data']['toView'](_0x2d9b9b),_0x475ef4=new _0x1e54b4(_0x2571a4['editing']['view']['document']);return this['_setDataIdsOnChildren'](_0x3b4faa,_0x475ef4),this['_getDocumentDataStringFromView'](_0x3b4faa);}['_setDataIdsOnChildren'](_0x3a9acc,_0x4cc470){let _0x5dcdd4=!0x1;const _0x161a5b=new Set();for(const _0x3a7e79 of _0x3a9acc['getChildren']()){if(!_0x3a7e79['is']('view:element'))continue;const _0x43f800=_0x3a7e79['is']('view:containerElement'),_0xb8e259=_0x3a7e79['is']('view:emptyElement'),_0x4e5335=this['_setDataIdsOnChildren'](_0x3a7e79,_0x4cc470);if(_0x3a7e79['hasAttribute']('data-id')){_0x5dcdd4=!0x0,_0x161a5b['add'](_0x3a7e79['getAttribute']('data-id'));continue;}(_0x43f800||_0xb8e259||_0x4e5335)&&(_0x4cc470['setAttribute']('data-id',this['_nextDataId'](_0x161a5b),_0x3a7e79),_0x5dcdd4=!0x0);}return _0x5dcdd4;}['_nextDataId'](_0x325519){let _0x59d753;do{_0x59d753='';for(let _0x4197c4=0x0;_0x4197c4<0x4;_0x4197c4++)_0x59d753+=String['fromCharCode'](0x61+Math['floor'](0x1a*Math['random']()));}while(_0x325519['has'](_0x59d753));return _0x325519['add'](_0x59d753),_0x59d753;}['getSelectionText'](){const {model:_0x42e12a}=Xs(this['context']),_0x4681b7=_0x42e12a['document']['selection'],_0x434c8c=[],_0x1dc264=Array['from'](_0x4681b7['getRanges']());_0x1dc264['sort']((_0x43ee91,_0x288bc4)=>_0x43ee91['start']['isBefore'](_0x288bc4['start'])?-0x1:0x1);for(const _0x174aa6 of _0x1dc264)for(const _0x13adf6 of _0x174aa6['getItems']())_0x13adf6['is']('$textProxy')?_0x434c8c['push'](_0x13adf6['data']):_0x13adf6['is']('element')&&_0x434c8c['length']>0x0&&'\x20'!==_0x434c8c[_0x434c8c['length']-0x1]&&_0x434c8c['push']('\x20');return _0x434c8c['length']?'\x22'+_0x434c8c['join']('')['trim']()+'\x22':us(this['context']['locale'],'AI_CHAT_CONTEXT_DOCUMENT_SELECTION_LABEL');}['_removeFakeSelectionById'](_0x497daf){for(let _0x52f2dc=0x0;_0x52f2dc<this['_fakeSelections']['length'];_0x52f2dc++)if(this['_fakeSelections'][_0x52f2dc]['id']==_0x497daf)return void this['_fakeSelections']['splice'](_0x52f2dc,0x1);}['_addFakeSelection'](_0x2d6bb9){this['_removeFakeSelectionById'](_0x2d6bb9['id']),wt(this['_fakeSelections'],_0x2d6bb9);}['_refreshFakeSelection'](_0x59ac8b,_0x48219f){if(_0x59ac8b==_0x48219f)return;const _0x16beb3=Xs(this['context']),_0x34bf0b=_0x16beb3['model'];_0x34bf0b['change'](_0x5bde7d=>{if(_0x59ac8b){const _0x270a72=_0x16beb3['model']['markers']['getMarkersGroup'](Zs);for(const _0x12eb79 of _0x270a72)_0x5bde7d['removeMarker'](_0x12eb79);}if(_0x48219f)for(let _0x2154b5=0x0;_0x2154b5<_0x48219f['ranges']['length'];_0x2154b5++){let _0x56e03c=_0x48219f['ranges'][_0x2154b5];const _0x4020c9=Zs+':'+_0x48219f['id']+':'+_0x2154b5;if(_0x56e03c['start']['isAtEnd']){const _0x5239d3=_0x56e03c['start']['getLastMatchingPosition'](({item:_0x437516})=>!_0x34bf0b['schema']['isContent'](_0x437516),{'boundaries':_0x56e03c});_0x56e03c=_0x5bde7d['createRange'](_0x5239d3,_0x56e03c['end']);}_0x5bde7d['addMarker'](_0x4020c9,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x56e03c});}});}['_getMarkersInDocumentOrder'](){const _0x8f3bf=Xs(this['context'])['model'];return Array['from'](_0x8f3bf['markers']['getMarkersGroup'](Zs))['sort']((_0x4c0da0,_0x4e238e)=>_0x4c0da0['getStart']()['isBefore'](_0x4e238e['getStart']())?-0x1:_0x4c0da0['getStart']()['isAfter'](_0x4e238e['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(_0xfda727){this['options']={'delay':_0xfda727['delay']??0x14,'textNodeStyle':_0xfda727['textNodeStyle'],'onStreamUpdate':_0xfda727['onStreamUpdate']||(()=>{})};}async['stream']({document:_0x41fd73,targetElement:_0xc1a440,abortSignal:_0x23063a}){this['isStreaming']&&this['stop'](),_0x23063a?.['addEventListener']('abort',this['stop']['bind'](this)),this['document']=_0x5d6329(_0x41fd73,!0x0),this['nodesList']=this['getParsedDocumentNodeList'](),this['isStreaming']=!0x0,this['currentIndex']>this['nodesList']['length']&&(this['currentIndex']=this['nodesList']['length']);for(let _0x521d94=0x0;_0x521d94<this['currentIndex'];_0x521d94++)this['nodesList'][_0x521d94]['shouldBeStreamed']=!0x0;do{const _0x11db2f=Date['now'](),_0x30bed8=this['nodesList'][this['currentIndex']],_0x1bb295=_0x11db2f-this['lastUpdateTime'];if(_0x30bed8){_0x30bed8['shouldBeStreamed']=!0x0;let _0x22a603=_0x30bed8['parent'];for(;_0x22a603;)_0x22a603['shouldBeStreamed']=!0x0,_0x22a603=_0x22a603['parent'];}if(_0x1bb295<this['options']['delay'])try{const {promise:_0x2a0202,abortController:_0x1ae09a}=hn(this['options']['delay']-_0x1bb295);this['timeoutAbortController']=_0x1ae09a,await _0x2a0202;}catch(_0x44c587){return;}_0x2a04c8(_0xc1a440,'<'+_0xc1a440['tagName']+'>'+this['renderNode'](this['document'])+'</'+_0xc1a440['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:_0x240298}){Array['from'](_0x240298['querySelectorAll']('span[data-ck-html-streamer-word-chunk]'))['reverse']()['forEach'](_0x1d5bfa=>{_0x1d5bfa['replaceWith'](_0x1d5bfa['childNodes'][0x0]);});}['stop'](){this['isStreaming']=!0x1,this['timeoutAbortController']&&(this['timeoutAbortController']['abort'](),this['timeoutAbortController']=null);}['renderNode'](_0x13b44f){let _0x3bf75a='';if(function(_0xbd69d8){return _0x17c511(_0xbd69d8);}(_0x13b44f)){for(const _0x45141b of _0x13b44f['children'])_0x3bf75a+=this['renderNode'](_0x45141b);}else{if(on(_0x13b44f)){if(!_0x13b44f['shouldBeStreamed'])return'';const _0x5d196b=_0x13b44f,_0x410428=Object['entries'](_0x5d196b['attribs'])['map'](([_0x17ab9c,_0x2b76d0])=>_0x17ab9c+'=\x22'+_0x2b76d0+'\x22')['join']('\x20');_0x3bf75a+='<'+_0x5d196b['tagName']+(_0x410428?'\x20'+_0x410428:'')+'>';for(const _0x453f2f of ti(_0x5d196b))_0x3bf75a+=this['renderNode'](_0x453f2f);_0x3bf75a+='</'+_0x5d196b['tagName']+'>';}else{if(!an(_0x13b44f))return'';if(!_0x13b44f['shouldBeStreamed'])return'';!function(_0x35f291){if(!_0x35f291['parent']||!on(_0x35f291['parent']))return!0x1;if(!rn['includes'](_0x35f291['parent']['tagName']))return!0x1;return!_0x4db584(_0x35f291)['match'](/^\s*[<>]\s*$/);}(_0x13b44f)?_0x3bf75a+=_0x5f5c12(_0x13b44f):_0x3bf75a+=_0x5f5c12(new _0x3c2cca('span',{'data-ck-html-streamer-word-chunk':'','style':this['options']['textNodeStyle']},[_0x13b44f]));}}return _0x3bf75a;}['getParsedDocumentNodeList'](){const _0x1783b6=[];return function(_0x164252,_0x381218){const _0x359ef9=_0x450d3b=>{if(_0x381218(_0x450d3b),_0x450d3b instanceof _0x6dd3bb)for(let _0x4e7ccf=0x0;_0x4e7ccf<_0x450d3b['children']['length'];_0x4e7ccf++){const _0x2c0b25=_0x450d3b['children'][_0x4e7ccf];_0x359ef9(_0x2c0b25);}};for(let _0x2ffe38=0x0;_0x2ffe38<_0x164252['children']['length'];_0x2ffe38++)_0x359ef9(_0x164252['children'][_0x2ffe38]);}(this['document'],_0x55d072=>{if(an(_0x55d072)){const _0x4e8222=this['splitTextNodeIntoWordNodes'](_0x55d072);_0x4e8222['length']&&_0x1783b6['push'](..._0x4e8222);}_0x55d072['isWordSplitSource']||_0x55d072['isWordSplitResult']||_0x1783b6['push'](_0x55d072);}),_0x1783b6;}['splitTextNodeIntoWordNodes'](_0x363412){if(_0x363412['isWordSplitSource']||_0x363412['isWordSplitResult'])return[];const _0x239ead=_0x4db584(_0x363412)['match'](/(?:\s*\S+\s*)/g),_0x4516bb=[];if(_0x239ead&&_0x239ead['length']>0x1){for(const _0x642944 of _0x239ead){const _0x4d7aa8=new _0x598728(_0x642944);_0x4d7aa8['isWordSplitResult']=!0x0,_0xec914b(_0x363412,_0x4d7aa8),_0x4516bb['push'](_0x4d7aa8);}_0x363412['isWordSplitSource']=!0x0,_0x28c1a9(_0x363412);}return _0x4516bb;}}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(_0x683d30){return _0x11018c(_0x683d30);}function on(_0x205351){return _0x17c0c2(_0x205351);}function hn(_0x3f0290){const _0x54ed95=new AbortController();return{'promise':new Promise((_0x691a04,_0x5854d8)=>{const _0x3caf3f=setTimeout(_0x691a04,_0x3f0290);_0x54ed95['signal']['addEventListener']('abort',()=>{clearTimeout(_0x3caf3f),_0x5854d8();});}),'abortController':_0x54ed95};}class cn extends vt{['options'];['content']='';['htmlStreamer'];['children'];constructor(_0x164ade){super();const _0x36e30e=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']=_0x164ade,this['children']=this['createCollection'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed__item',_0x36e30e['if']('isDone','ck-ai-chat__feed__item_done'),_0x36e30e['if']('isVisible','ck-hidden',_0x35a50c=>!_0x35a50c),'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'](_0x57c1b0=>{_0x57c1b0['removeAttribute']('data-id');}),this['isDone']=!0x0;}async['streamIntoElement'](_0x4117aa,_0x553c4b,_0x14e45c){await this['htmlStreamer']['stream']({'document':_0x4117aa,'targetElement':_0x553c4b,'abortSignal':_0x14e45c});}}class ln extends vt{['showChangesToggleView'];constructor(_0x3b3576,_0x1206a1){super(_0x3b3576),this['set']('isShowChangesToggleVisible',!0x0),this['showChangesToggleView']=new un(_0x3b3576),this['showChangesToggleView']['set']({'class':'ck-ai-suggestion__header__show-changes-toggle\x20ck-ai-chat-controls-button\x20'+As,'label':us(_0x3b3576,'AI_SUGGESTION_BUTTON_SHOW_CHANGES'),'withText':!0x0}),this['showChangesToggleView']['isOn']=_0x1206a1['showDiff'],this['showChangesToggleView']['bind']('isVisible')['to'](this,'isShowChangesToggleVisible'),this['showChangesToggleView']['bind']('icon')['to'](this['showChangesToggleView'],'isOn',_0x4a1e25=>_0x4a1e25?_0x4ca6e6:_0x142490),this['showChangesToggleView']['on']('execute',()=>{this['showChangesToggleView']['isOn']=!this['showChangesToggleView']['isOn'],this['fire']('toggleShowChanges',{'isOn':this['showChangesToggleView']['isOn']});});const _0x2cb329=new xt();_0x2cb329['content']=_0x14afda,this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__header',!0x1===_0x1206a1['showHeader']?'ck-hidden':null]['filter'](Boolean)},'children':[_0x2cb329,{'tag':'span','children':[us(_0x3b3576,'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':_0x2d1e5c,'rejected':_0x4fa465,'outdated':_0x4fa465};class _n extends vt{['stateIconView'];constructor(_0x325c67){super(_0x325c67);const _0x97170c=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',_0x97170c['to']('state',_0x109a35=>'ck-ai-suggestion__content-part-state_'+_0x109a35),_0x97170c['if']('isVisible','ck-hidden',_0x64931=>!_0x64931)]},'children':[{'tag':'span','attributes':{'class':['ck-ai-suggestion__content-part-state__label']},'children':[{'text':_0x97170c['to']('state',_0x4c8dc1=>{switch(_0x4c8dc1){case'accepted':return us(_0x325c67,'AI_SUGGESTION_CONTENT_PART_STATE_ACCEPTED');case'rejected':return us(_0x325c67,'AI_SUGGESTION_CONTENT_PART_STATE_REJECTED');case'outdated':return us(_0x325c67,'AI_SUGGESTION_CONTENT_PART_STATE_OUTDATED');}})}]},this['stateIconView']]});}['setState'](_0x1306ec){this['state']=_0x1306ec;}}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(_0x3cb1d5,_0xd48a35,_0x2bbe2a){super(_0x3cb1d5);const _0xd3e2e5=Boolean(_0x2bbe2a);this['set']('isEnabled',!_0xd3e2e5),this['set']('isVisible',!0x0),this['class']='ck-ai-suggestion-content-part-toolbar';const _0x7fbecc=[];if(_0xd3e2e5){const _0x326107=new Nt(_0x3cb1d5);_0x326107['set']({'label':us(_0x3cb1d5,'AI_SUGGESTION_DISABLED_TOOLTIP_MESSAGE'),'tooltip':!0x0,'tooltipPosition':'n','withText':!0x1,'icon':_0x101fdf}),_0x7fbecc['push'](_0x326107);}else{_0xd48a35['includes']('applySuggestion')&&(this['_applyButton']=new Nt(_0x3cb1d5),this['_applyButton']['set']({'label':us(_0x3cb1d5,'AI_SUGGESTION_CONTENT_PART_APPLY'),'tooltip':!0x0,'tooltipPosition':'n','withText':!0x1,'icon':_0x2d1e5c}),this['_applyButton']['bind']('isEnabled')['to'](this),this['_applyButton']['on']('execute',()=>{this['fire']('applySuggestion');}),_0x7fbecc['push'](this['_applyButton'])),_0xd48a35['includes']('insertSuggestion')&&(this['_suggestButton']=new Nt(_0x3cb1d5),this['_suggestButton']['set']({'label':us(_0x3cb1d5,'AI_SUGGESTION_CONTENT_PART_ADD_SUGGESTION'),'tooltip':!0x0,'tooltipPosition':'n','withText':!0x1,'icon':_0x2631af}),this['_suggestButton']['bind']('isEnabled')['to'](this),this['_suggestButton']['on']('execute',()=>{this['fire']('insertSuggestion');}),_0x7fbecc['push'](this['_suggestButton']));const _0x3a551e=new Nt(_0x3cb1d5);_0x3a551e['set']({'label':us(_0x3cb1d5,'AI_SUGGESTION_CONTENT_PART_REJECT'),'tooltip':!0x0,'tooltipPosition':'n','withText':!0x1,'icon':_0x4fa465}),_0x3a551e['bind']('isEnabled')['to'](this),_0x3a551e['on']('execute',()=>{this['fire']('rejectSuggestion');}),_0x7fbecc['push'](_0x3a551e);}this['items']['addMany'](_0x7fbecc);const _0x12dea8=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':[_0x12dea8['if']('isVisible','ck-hidden',_0xb53c09=>!_0xb53c09)]}});}['setButtonsVisibility']({showApplyButton:_0x426f26,showSuggestButton:_0x3c1de5}){this['_applyButton']&&(this['_applyButton']['isVisible']=_0x426f26),this['_suggestButton']&&(this['_suggestButton']['isVisible']=_0x3c1de5);}}class In extends vt{['toolbarView'];['stateView'];['titleLabelView'];['children'];constructor(_0x389294,{part:_0x5c886c,uiIndex:_0x38f005,availableActions:_0x42d887,areActionsDisabled:_0x15f0f9}){super(_0x389294),this['set']('isEnabled',!0x0),this['set']('state','pending'),this['toolbarView']=new gn(_0x389294,_0x42d887,_0x15f0f9),this['toolbarView']['on']('rejectSuggestion',()=>{this['fire']('rejectSuggestion',{'index':_0x5c886c['index']});}),this['toolbarView']['on']('insertSuggestion',()=>{this['fire']('insertSuggestion',{'index':_0x5c886c['index']});}),this['toolbarView']['on']('applySuggestion',()=>{this['fire']('applySuggestion',{'index':_0x5c886c['index']});}),this['toolbarView']['bind']('isEnabled')['to'](this),this['stateView']=new _n(_0x389294),this['titleLabelView']=new En(_0x389294,_0x38f005),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',(_0x44b0af,_0x5bccac,_0x2eff1d,_0x1d211f)=>{'pending'===_0x1d211f?this['children']['remove'](this['toolbarView']):this['children']['remove'](this['stateView']),'pending'===_0x2eff1d?this['children']['add'](this['toolbarView']):(this['stateView']['setState'](_0x2eff1d),this['children']['add'](this['stateView']));});}}class En extends vt{constructor(_0x550cd4,_0x132b4c){super(_0x550cd4),this['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai-suggestion__body__content-part__title__label']},'children':[us(_0x550cd4,'AI_SUGGESTION_CONTENT_PART_TITLE',_0x132b4c['toString']())]});}}class pn extends vt{['htmlStreamer'];constructor(_0x2bed87){super(_0x2bed87),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:_0xdc7d98,renderingStrategy:_0x16a2e1,abortSignal:_0x624201}){'streaming'===_0x16a2e1?await this['htmlStreamer']['stream']({'document':_0xdc7d98['content'],'targetElement':this['element'],'abortSignal':_0x624201}):this['element']['innerHTML']=Es(_0xdc7d98['content']);}['clear'](){this['htmlStreamer']['reset'](),this['element']['innerHTML']='';}}class Tn extends vt{['_children'];['_headerView'];['_streamableContentView'];constructor(_0x5f1a9d,{part:_0x2e2be3,uiIndex:_0x23b0ae,areActionsDisabled:_0x43bf00,availableActions:_0x5671f5}){super(_0x5f1a9d);const _0x2dd1a1=this['bindTemplate'];this['set']('state','pending'),this['set']('isDone',!0x1),this['set']('isVisible',!0x1),this['set']('isActive',!0x1),this['set']('isEnabled',!0x1);const _0x29cf92=()=>{this['isEnabled']=this['isDone']&&'pending'==this['state']&&!_0x43bf00;};this['on']('change:state',_0x29cf92),this['on']('change:isDone',_0x29cf92),_0x29cf92(),this['_children']=this['createCollection'](),this['_headerView']=new In(_0x5f1a9d,{'part':_0x2e2be3,'uiIndex':_0x23b0ae,'availableActions':_0x5671f5,'areActionsDisabled':_0x43bf00}),this['_headerView']['bind']('isEnabled','state')['to'](this),this['_headerView']['delegate'](...en)['to'](this),this['_streamableContentView']=new pn(_0x5f1a9d),this['_children']['addMany']([this['_headerView'],this['_streamableContentView']]),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__body__content-part',_0x2dd1a1['to']('state',_0x149438=>'ck-ai-suggestion__body__content-part_'+_0x149438),_0x2dd1a1['if']('isEnabled','ck-ai-suggestion__body__content-part_enabled'),_0x2dd1a1['if']('isActive','ck-ai-suggestion__body__content-part_active'),_0x2dd1a1['if']('isVisible','ck-hidden',_0x321e67=>!_0x321e67)]},'children':this['_children'],'on':{'mouseenter':_0x2dd1a1['to'](()=>{this['isEnabled']&&this['fire']('mouseOverSuggestion',{'index':_0x2e2be3['index']});}),'mouseleave':_0x2dd1a1['to'](()=>{this['isEnabled']&&this['fire']('mouseLeaveSuggestion',{'index':_0x2e2be3['index']});}),'click':_0x2dd1a1['to'](_0x23d93d=>{const _0x59a50f=_0x23d93d['target'];this['isEnabled']&&!this['_headerView']['toolbarView']['element']['contains'](_0x59a50f)&&this['fire']('showChangeInText',{'index':_0x2e2be3['index']});})}});}async['updateContent']({part:_0x530b3c,renderingStrategy:_0x431b30,showUnchangedParts:_0x3dd068=!0x1,abortSignal:_0x1cd97f}){this['partDefinition']=_0x530b3c,this['isVisible']=this['partDefinition']['hasChanges']||_0x3dd068,this['isVisible']&&await this['_streamableContentView']['update']({'part':_0x530b3c,'renderingStrategy':_0x431b30,'abortSignal':_0x1cd97f});}['markAsDone'](){this['isDone']=!0x0;}}class mn extends pt(){['queue']=[];['isProcessing']=!0x1;['_abortController'];async['enqueue'](_0x8912f4){const _0x4c76b3=this['createTask'](_0x8912f4);return this['queue']['push'](_0x4c76b3),this['_processQueue'](),_0x4c76b3['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(_0x3092dc=>{this['once']('_queueEmpty',()=>{_0x3092dc();});}):Promise['resolve']();}async['_processQueue'](){if(!this['isProcessing']){this['_abortController']=new AbortController(),this['isProcessing']=!0x0;try{for(;this['queue']['length']&&this['isProcessing'];){const _0xf7d899=this['queue']['shift']();try{await _0xf7d899['callback'](this['_abortController']['signal']),_0xf7d899['resolve']();}catch(_0x47cdd5){_0xf7d899['reject'](_0x47cdd5);}}}finally{this['isProcessing']=!0x1,this['_abortController']=void 0x0;}this['fire']('_queueEmpty');}}['createTask'](_0x2f6bf7){let _0x1d3f35,_0x562e8d;const _0x4ce4e5=new Promise((_0x118bc4,_0x4612fc)=>{_0x1d3f35=_0x118bc4,_0x562e8d=_0x4612fc;});return{'callback':_0x2f6bf7,'resolve':_0x1d3f35,'reject':_0x562e8d,'completePromise':_0x4ce4e5};}}class Cn extends cn{constructor(_0x18fb41){super(_0x18fb41),this['extendTemplate']({'attributes':{'class':['ck-ai-notification','warning'===_0x18fb41['level']?'ck-ai-notification_warning':'ck-ai-notification_error']}});}['render'](){super['render'](),this['setContent'](this['options']['initialContent']),this['markAsDone']();}['setContent'](_0x36bd19){this['element']['innerHTML']=_0x36bd19;}}const wn=['applySuggestion','insertSuggestion'];class fn extends vt{['_applyChangesButton'];['_insertSuggestionsButton'];['children'];constructor(_0x3bcb97,_0x83a11c=[...wn],_0x284a25){super(_0x3bcb97);const _0xa8f82a=this['bindTemplate'],_0x3c1826=Boolean(_0x284a25);if(this['set']('isEnabled',!_0x3c1826),this['set']('isVisible',!0x1),this['set']('isTrackChangesOn',!0x1),this['children']=this['createCollection'](),_0x3c1826){const _0x4436c4=new Nt(_0x3bcb97);_0x4436c4['set']({'label':us(_0x3bcb97,'AI_SUGGESTION_DISABLED_TOOLTIP_MESSAGE'),'tooltip':!0x0,'tooltipPosition':'n','withText':!0x1,'icon':_0x101fdf});const _0x34a7a9=new vt(_0x3bcb97);_0x34a7a9['setTemplate']({'tag':'div','attributes':{'class':'ck-ai-chat__feed__suggestion__actions__info'},'children':[{'tag':'p','children':[us(_0x3bcb97,'AI_SUGGESTION_DISABLED_FEED_MESSAGE'),_0x4436c4]}]}),this['children']['add'](_0x34a7a9);}else this['_applyChangesButton']=new Nt(_0x3bcb97),this['_applyChangesButton']['set']({'label':us(_0x3bcb97,'AI_CHAT_SUGGESTION_ACTION_APPLY_ALL'),'withText':!0x0,'type':'button','isVisible':_0x83a11c['includes']('applySuggestion'),'class':ds}),this['_insertSuggestionsButton']=new Nt(_0x3bcb97),this['_insertSuggestionsButton']['set']({'label':us(_0x3bcb97,'AI_CHAT_SUGGESTION_ACTION_SUGGEST_ALL'),'withText':!0x0,'type':'button','isVisible':_0x83a11c['includes']('insertSuggestion'),'class':_s}),this['_insertSuggestionsButton']['on']('execute',()=>{this['fire']('insertSuggestion');}),this['_applyChangesButton']['on']('execute',()=>{this['fire']('applySuggestion');}),[this['_applyChangesButton'],this['_insertSuggestionsButton']]['forEach'](_0xfefecf=>{_0xfefecf['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',_0xa8f82a['if']('isVisible','ck-hidden',_0x560713=>!_0x560713)]},'children':this['children']}),this['on']('change:isTrackChangesOn',()=>{this['_applyChangesButton']&&(this['_applyChangesButton']['isVisible']=!this['isTrackChangesOn']);});}['updateVisibility'](_0x37cacb){this['isVisible']=_0x37cacb;}['_switchButtonLabelsPlurality'](_0x3cd61c){this['_applyChangesButton']&&this['_insertSuggestionsButton']&&(_0x3cd61c?(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(_0x484ff2,_0x40200f){super(_0x484ff2),this['bodyCollection']=_0x40200f,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',_0x4fb778=>!_0x4fb778)]},'children':this['children']});const _0x15cbcf=new vt(this['locale']),_0x289009=new xt();_0x289009['content']=_0x581afe,_0x15cbcf['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-web-sources__header']},'children':[_0x289009,{'tag':'span','children':[{'text':us(this['locale'],'AI_CHAT_SOURCES_HEADER')}]}]}),this['children']['add'](_0x15cbcf),this['_setupBalloonPanel'](_0x484ff2);}['addSource'](_0x52448b){this['children']['add'](new bn(this['locale'],_0x52448b,this['balloonPanelView']));}['_setupBalloonPanel'](_0x1ccbb1){this['balloonPanelView']=new Xt(_0x1ccbb1),this['balloonPanelView']['extendTemplate']({'attributes':{'class':['ck-ai-web-source__tooltip-balloon']}}),this['bodyCollection']['add'](this['balloonPanelView']);}}class bn extends Nt{['balloonPanelView'];['source'];constructor(_0x548334,_0x1ffb38,_0x1adf30){super(_0x548334),this['source']=_0x1ffb38,this['balloonPanelView']=_0x1adf30,this['set']({'label':_0x1ffb38['title'],'class':['ck\x20ck-ai-web-source'],'withText':!0x0});const _0x4df464=this['bindTemplate'];if(this['extendTemplate']({'on':{'click':_0x4df464['to'](()=>{window['open'](_0x1ffb38['url'],'_blank');}),'mouseenter':_0x4df464['to'](()=>{this['_showTooltip']();}),'mouseleave':_0x4df464['to'](()=>{this['_hideTooltip']();})}}),_0x1ffb38['favicon']){const _0x1974cb=new vt(_0x548334);_0x1974cb['setTemplate']({'tag':'img','attributes':{'src':_0x1ffb38['favicon']||_0x581afe,'alt':_0x1ffb38['title'],'class':['ck-ai-web-source__image']}}),this['children']['add'](_0x1974cb);}else this['set']('icon',_0x581afe);}['_createTooltipContentView'](_0x4f8105,_0x19e548){const _0x1c2fd3=new vt(_0x4f8105),_0x879d74=[];let _0x4ea0e6;_0x19e548?.['favicon']?(_0x4ea0e6=new vt(_0x4f8105),_0x4ea0e6['setTemplate']({'tag':'img','attributes':{'src':_0x19e548['favicon'],'alt':_0x19e548['title'],'class':['ck-ai-web-source__tooltip-image']}})):(_0x4ea0e6=new xt(),_0x4ea0e6['content']=_0x581afe,_0x4ea0e6['extendTemplate']({'attributes':{'alt':_0x19e548['title'],'class':['ck-ai-web-source__tooltip-image']}})),_0x879d74['push'](_0x4ea0e6);const _0x30cd60=new vt(_0x4f8105);_0x30cd60['setTemplate']({'tag':'a','attributes':{'class':['ck-ai-web-source__tooltip-url'],'href':_0x19e548['url']},'children':[{'text':new URL(_0x19e548['url'])?.['hostname']}]}),_0x879d74['push'](_0x30cd60);const _0x3a98a6=new vt(_0x4f8105);_0x3a98a6['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-web-source__tooltip-row']},'children':_0x879d74});const _0x5b5d8d=new vt(_0x4f8105);return _0x5b5d8d['setTemplate']({'tag':'span','attributes':{'class':['ck-ai-web-source__tooltip-row','ck-ai-web-source__tooltip-title']},'children':[{'text':_0x19e548['title']['length']>0x190?_0x19e548['title']['substring'](0x0,0x190)+'...':_0x19e548['title']}]}),_0x1c2fd3['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-web-source__tooltip']},'children':[_0x3a98a6,_0x5b5d8d]}),_0x1c2fd3;}['_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 _0x597c4b=this['_createTooltipContentView'](this['locale'],this['source']);this['balloonPanelView']['content']['add'](_0x597c4b);}}class Rn extends vt{['_actionsView'];['_sourcesView'];['_children'];['_areActionsDisabled'];['_showUnchangedParts'];['_updateContentPartsPromiseQueue'];['_emptyPartsWarningView'];['_availableActions'];['_cachedContentParts']=[];constructor(_0x57e900,_0x449c94){super(_0x57e900);const {areActionsDisabled:_0xe16fd9,showUnchangedParts:_0x480f06,availableActions:_0x34f718}=_0x449c94;this['_areActionsDisabled']=_0xe16fd9,this['_showUnchangedParts']=_0x480f06,this['_availableActions']=_0x34f718,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(_0x57e900,'AI_SUGGESTION_EMPTY_PART_WARNING'),'level':'warning'}),this['_emptyPartsWarningView']['isVisible']=!0x1,this['_actionsView']=new fn(_0x57e900,_0x449c94['availableActions'],this['_areActionsDisabled']),this['_actionsView']['bind']('isTrackChangesOn')['to'](this),this['_sourcesView']=new Sn(this['locale'],_0x449c94['bodyCollection']),_0x449c94['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:_0x568e2f,renderingStrategy:_0x1d6532,abortSignal:_0x549c9f}){this['_children']['length']?_0x568e2f['forEach'](_0x16b57e=>{const _0x246d53=this['_cachedContentParts']['findIndex'](_0x1e40d5=>_0x1e40d5['index']==_0x16b57e['index']);-0x1===_0x246d53?this['_cachedContentParts']['push'](_0x16b57e):this['_cachedContentParts'][_0x246d53]=_0x16b57e;}):this['_cachedContentParts']=_0x568e2f;const _0x231fc0=this['_showUnchangedParts']?_0x568e2f:_0x568e2f['filter'](_0x464e4b=>_0x464e4b['hasChanges']);this['_actionsView']['_switchButtonLabelsPlurality'](_0x231fc0['length']>0x1);for(const _0x3f5152 of _0x231fc0)this['_updateContentPartsPromiseQueue']['enqueue'](async _0x56d760=>{let _0x5bb985=this['getPartView'](_0x3f5152['index']);_0x5bb985||(_0x5bb985=new Tn(this['locale'],{'part':_0x3f5152,'uiIndex':this['_children']['length']+0x1,'areActionsDisabled':this['_areActionsDisabled'],'availableActions':this['_availableActions']}),_0x5bb985['delegate'](...en)['to'](this),this['_children']['add'](_0x5bb985),this['hasPendingParts']=!0x0),await _0x5bb985['updateContent']({'part':_0x3f5152,'renderingStrategy':_0x1d6532,'showUnchangedParts':this['_showUnchangedParts'],'abortSignal':_0x56d760}),_0x5bb985['markAsDone']();});return _0x549c9f?.['addEventListener']('abort',()=>{this['_updateContentPartsPromiseQueue']['abort']();}),this['_updateContentPartsPromiseQueue']['queueEmptyPromise'];}['updatePartState'](_0x109efa,_0x3beebe){const _0x49c2a9=this['getPartView'](_0x109efa);_0x49c2a9&&(_0x49c2a9['state']=_0x3beebe),this['hasPendingParts']='pending'==_0x3beebe||Array['from'](this['_children'])['some'](_0x3bad51=>'pending'==_0x3bad51['state']);}['setPartActive'](_0x188755,_0x539852){if(!0x1===_0x188755){for(const _0x5a3c79 of this['_children'])_0x5a3c79['isActive']=!0x1;}else{const _0x324f52=this['getPartView'](_0x188755);_0x324f52&&(_0x324f52['isActive']=_0x539852);}}['updateSources'](_0xaad90d){_0xaad90d['forEach'](_0x4f8bb2=>this['_sourcesView']['addSource'](_0x4f8bb2)),this['_sourcesView']['isVisible']=!0x0;}['getPartView'](_0x4ca7ff){return this['_children']['find'](_0x5e3a7a=>_0x5e3a7a['partDefinition']['index']==_0x4ca7ff)??null;}['markAsDone'](){if(!this['_showUnchangedParts']){const _0x522f51=!this['_cachedContentParts']['find'](({hasChanges:_0x4b5678})=>_0x4b5678),_0xef9c99=!!this['_cachedContentParts']['find'](({hasChanges:_0x51862b})=>!_0x51862b);this['_emptyPartsWarningView']['isVisible']=0x0==this['_children']['length']||_0xef9c99,_0x522f51?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'](_0x4ce296=>_0x4ce296['markAsDone']()),this['_actionsView']['updateVisibility'](this['hasNonEmptyParts']);}get['hasNonEmptyParts'](){return this['_children']['filter'](_0x46c2ca=>_0x46c2ca['partDefinition']['hasChanges'])['length']>0x0;}}class On extends vt{['bodyView'];['children'];['headerView'];constructor(_0x1f3b31,_0x21358e,_0x1d522c){super(_0x1f3b31);const {showDiff:_0x1719f8,areActionsDisabled:_0x26ee0a,showUnchangedParts:_0x1f4b92,availableActions:_0xd728c3}=_0x21358e;this['set']('isTrackChangesOn',!0x1),this['set']('areChangesVisible',!0x1),this['children']=this['createCollection'](),this['headerView']=new ln(_0x1f3b31,{'showDiff':_0x1719f8}),this['headerView']['on']('toggleShowChanges',(_0x4a4b47,_0x42564f)=>{this['areChangesVisible']=_0x42564f['isOn'],this['fire']('toggleSuggestionDisplayMode',{'showDiff':_0x42564f['isOn']});}),this['children']['add'](this['headerView']),this['bodyView']=new Rn(_0x1f3b31,{'areActionsDisabled':_0x26ee0a,'showUnchangedParts':!!_0x1f4b92,'availableActions':_0xd728c3,'bodyCollection':_0x1d522c}),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'](_0x4485f8){await this['bodyView']['updateContentParts'](_0x4485f8);}['updateSources'](_0x3ce910){this['bodyView']['updateSources'](_0x3ce910);}['markAsDone'](){this['bodyView']['markAsDone'](),this['headerView']&&(this['headerView']['isShowChangesToggleVisible']=this['bodyView']['hasNonEmptyParts']);}}class kn extends cn{['containerView'];constructor(_0x548df2,_0x396dc5,_0x2ae71d){super(_0x396dc5),this['set']('isTrackChangesOn',!0x1),this['containerView']=new On(_0x548df2,{'showDiff':_0x396dc5['showDiff'],'areActionsDisabled':_0x396dc5['areActionsDisabled'],'availableActions':_0x396dc5['availableActions']},_0x2ae71d),this['containerView']['on']('toggleSuggestionDisplayMode',(_0x473571,_0x34a214)=>{this['fire']('toggleSuggestionDisplayMode',{'replyId':this['options']['id'],'showDiff':_0x34a214['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',(_0x2feba1,{index:_0x69374f})=>{this['fire']('showChangeInText',{'replyId':this['options']['id'],'partIndex':_0x69374f});}),this['containerView']['on']('applySuggestion',(_0x113ba8,{index:_0x1eb9ce}={})=>{this['fire']('applySuggestion',{'replyId':this['options']['id'],'partIndex':_0x1eb9ce});}),this['containerView']['on']('insertSuggestion',(_0x37670d,{index:_0x4a3e8d}={})=>{this['fire']('insertSuggestion',{'replyId':this['options']['id'],'partIndex':_0x4a3e8d});}),this['containerView']['on']('rejectSuggestion',(_0x48cd35,{index:_0x2c920f})=>{this['fire']('rejectSuggestion',{'replyId':this['options']['id'],'partIndex':_0x2c920f});}),this['containerView']['on']('mouseOverSuggestion',(_0x132b37,{index:_0x5d0e02})=>{this['fire']('mouseOverSuggestion',{'replyId':this['options']['id'],'partIndex':_0x5d0e02});}),this['containerView']['on']('mouseLeaveSuggestion',(_0x35fd56,{index:_0xc6de14})=>{this['fire']('mouseLeaveSuggestion',{'replyId':this['options']['id'],'partIndex':_0xc6de14});}),this['children']['addMany']([this['containerView']]),this['extendTemplate']({'attributes':{'class':['ck-ai-chat__feed__ai-suggestion']}});}async['updateContent'](_0x5c6474){await this['containerView']['updateContent'](_0x5c6474);}['updatePartState'](_0x2e840d,_0x1a7302){this['containerView']['bodyView']['updatePartState'](_0x2e840d,_0x1a7302);}['setPartActive'](_0x5d6205,_0x2a0da7){!0x1===_0x5d6205?this['containerView']['bodyView']['setPartActive'](!0x1):this['containerView']['bodyView']['setPartActive'](_0x5d6205,_0x2a0da7);}['updateSources'](_0x57bd43){this['containerView']['updateSources'](_0x57bd43);}['getPartView'](_0x53fa0b){return this['containerView']['bodyView']['getPartView'](_0x53fa0b);}['markAsDone'](){super['markAsDone'](),this['containerView']['markAsDone']();}}class Nn extends cn{['replyContainer'];['_bodyCollection'];constructor(_0x3d96bc,_0x5e004e,_0x51fde0){super(_0x5e004e),this['_bodyCollection']=_0x51fde0,this['locale']=_0x3d96bc,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:_0x3067fe,renderingStrategy:_0xf782b7,abortSignal:_0x115903}){'streaming'===_0xf782b7?await this['streamIntoElement'](_0x3067fe,this['replyContainer']['element'],_0x115903):this['replyContainer']['element']['innerHTML']=_0x5f5c12(_0x3067fe);}['updateSources'](_0x59cd55){const _0x2ade9e=new Sn(this['locale'],this['_bodyCollection']);_0x2ade9e['children']['addMany'](_0x59cd55['map'](_0x1544e2=>new bn(this['locale'],_0x1544e2,_0x2ade9e['balloonPanelView']))),_0x2ade9e['isVisible']=!0x0,this['children']['add'](_0x2ade9e);}}class vn extends yt{constructor(_0x500b56=void 0x0){super();const _0x46af5b=_0x500b56?'ck-ai-spinner_'+_0x500b56:'';this['extendTemplate']({'tag':'span','attributes':{'class':['ck-ai-spinner',_0x46af5b]}});}}const yn={'file':_0xf290e5,'document':_0x14afda,'web-resource':_0x56a18a,'text':_0xf290e5,'selection':_0x2077ea,'mcp-tool-context':_0x14afda},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(_0x40e735,_0x5ec6b8,_0x417c4a,_0x454ea0,_0x50f052=!0x1){super(_0x40e735),this['_isAnimationOnEnterEnabled']=_0x454ea0,this['_initializeProperties'](_0x5ec6b8,_0x417c4a,_0x50f052),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'](_0x32f722,_0x5d9d82,_0x3ef163){this['set']('label',_0x32f722['label']),this['set']('tooltip',!0x0),this['set']('itemType',_0x32f722['type']),this['set']('id',_0x32f722['uiId']),this['set']('readonly',_0x5d9d82),this['set']('isLoading',_0x3ef163);}['_setupTemplate'](){const _0x5af1c4=this['_createIconView'](),_0x25bd77=this['_createRemoveButton'](),_0x654356=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':this['_createTemplateAttributes'](_0x654356),'children':this['_createTemplateChildren'](_0x5af1c4,_0x25bd77,_0x654356)});}['_createTemplateAttributes'](_0x145166){return{'class':[xn,_0x145166['if']('itemType',Dn,_0x2f7c35=>'document'==_0x2f7c35),_0x145166['if']('itemType',Ln,_0x2ee8f3=>'selection'==_0x2ee8f3)],'data-cke-tooltip-text':_0x145166['to']('label',Bn),'data-cke-tooltip-position':Un,'data-cke-tooltip-class':Mn};}['_createTemplateChildren'](_0x38cda7,_0x1eb94c,_0x57bc89){const _0x465b8f=this['_createLabelElement'](_0x57bc89),_0x1fcbf4=this['_createLoaderIcon']();return this['readonly']?[_0x38cda7,_0x465b8f]:[_0x38cda7,_0x1fcbf4,_0x465b8f,_0x1eb94c];}['_createLabelElement'](_0x4690f2){return{'tag':'span','attributes':{'class':Pn},'children':[{'text':_0x4690f2['to']('label')}]};}['_createRemoveButton'](){const _0x5cf692=new Nt(this['locale']);return _0x5cf692['set']({'label':us(this['locale'],'AI_CHAT_CONTEXT_REMOVE_FROM_CONTEXT'),'icon':_0x27e1ae}),this['_setupRemoveButtonEvent'](_0x5cf692),_0x5cf692;}['_setupRemoveButtonEvent'](_0x3718ca){_0x3718ca['on']('execute',()=>{this['fire']('removeContextItemChip',this['id']);});}['_createIconView'](){const _0x287ce4=this['bindTemplate'],_0x5e6cc2=new xt();return _0x5e6cc2['content']=yn[this['itemType']],_0x5e6cc2['extendTemplate']({'attributes':{'class':[Hn,_0x287ce4['if']('isLoading','ck-hidden',_0x14a0b8=>_0x14a0b8)]}}),_0x5e6cc2;}['_handleAnimationEndOnce'](_0x2b0997,_0x33fa9b){if(!_0x2b0997)return;const _0x3636ea=()=>{_0x33fa9b(),_0x2b0997['removeEventListener']('animationend',_0x3636ea),_0x2b0997['removeEventListener']('webkitAnimationEnd',_0x3636ea);};_0x2b0997['addEventListener']('animationend',_0x3636ea),_0x2b0997['addEventListener']('webkitAnimationEnd',_0x3636ea);}['_createLoaderIcon'](){const _0x1c18a3=new vn('small');return _0x1c18a3['bind']('isVisible')['to'](this,'isLoading',_0x4549b5=>_0x4549b5),_0x1c18a3;}}function Bn(_0xe276a7){if(!_0xe276a7)return _0xe276a7;if(_0xe276a7['length']<=0x78)return _0xe276a7;const _0x211e4b=_0xe276a7['slice'](0x0,0x78),_0x3eab5c=_0x211e4b['lastIndexOf']('\x20');return(_0x3eab5c>0x0?_0x211e4b['slice'](0x0,_0x3eab5c):_0x211e4b)+'…';}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(_0x10d1c9,_0x5707d2,_0x2a40fc,_0x17f4a3,_0x3fa9d7){this['_locale']=_0x10d1c9,this['_visibleChips']=_0x5707d2,this['_config']={...Gn,..._0x2a40fc,'cssClasses':{'controlsButton':'','calculationContainer':'ck-calculation-container',..._0x2a40fc['cssClasses']}},this['_overflowChips']=new _t(),this['_bodyCollection']=_0x17f4a3,this['_parentView']=_0x3fa9d7||null;}['setContainerElement'](_0x294fc1){this['_intersectionObserver']&&(this['_intersectionObserver']['disconnect'](),this['_intersectionObserver']=null),this['_containerElement']=_0x294fc1,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 _0x3dc222=[...this['_visibleChips'],...this['_overflowChips']],_0x24b734=this['_createCalculationContainer'](),_0x16787a=this['_calculateOverflowInContainer'](_0x24b734,_0x3dc222),_0x5e4ba3=_0x24b734['_ancestorsToRestore'];_0x5e4ba3&&this['_restoreAncestorVisibility'](_0x5e4ba3),_0x24b734['remove'](),this['_applyOverflowResults'](_0x3dc222,_0x16787a);}['_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 _0x127548=new Nt(this['_locale']);_0x127548['set']({'label':'','withText':!0x0,'isToggleable':!0x0});const _0xb73e71=[this['_config']['cssClasses']['showMoreButton']];return this['_config']['cssClasses']['controlsButton']&&_0xb73e71['push'](this['_config']['cssClasses']['controlsButton']),_0x127548['extendTemplate']({'attributes':{'class':_0xb73e71}}),_0x127548;}['_createShowMoreBalloonPanelView'](){const _0x2828cd=new Xt(this['_locale']);return _0x2828cd['extendTemplate']({'attributes':{'class':this['_config']['cssClasses']['showMoreBalloon']}}),this['_bodyCollection']['add'](_0x2828cd),_0x2828cd;}['_updateBalloonContent'](){if(this['_showMoreBalloonPanelView']&&(this['_showMoreBalloonPanelView']['content']['clear'](),this['_overflowChips']['length']>0x0)){this['_overflowChips']['forEach'](_0xb7dc0b=>{_0xb7dc0b['disableAnimationOnEnter']();});const _0x41be6a=new vt(this['_locale']);_0x41be6a['setTemplate']({'tag':'div','attributes':{'class':this['_config']['cssClasses']['overflowContainer']},'children':this['_overflowChips']}),this['_showMoreBalloonPanelView']['content']['add'](_0x41be6a);}}['_handleShowMoreButtonClick'](){this['_showMoreButtonView']['isOn']?this['hideBalloonPanel']():this['showBalloonPanel']();}['_updateShowMoreButtonVisibility'](){const _0x22dd4a=this['_overflowChips']['length']>0x0;this['_showMoreButtonView']?.['element']&&(this['_showMoreButtonView']['element']['style']['display']=_0x22dd4a?'':'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'](_0x5afa40){const _0x27cd0d=this['_containerElement']?.['tagName']['toLowerCase']()||'div',_0x635243=this['_containerElement']?.['classList'];if(_0x635243){const _0x50fc22=_0x635243[0x0]||'',_0x4edf39=_0x5afa40['querySelector']('.'+_0x50fc22),_0x45b6be=_0x5afa40['querySelector'](_0x27cd0d);return _0x4edf39||_0x45b6be||_0x5afa40;}return _0x5afa40['querySelector'](_0x27cd0d)||_0x5afa40;}['_calculateContainerWidth'](){const _0x34e6bb=this['_parentView']?.['element']||this['_containerElement'];if(!_0x34e6bb)return Fn;const _0x1c07de=window['getComputedStyle'](_0x34e6bb)['width'];if('auto'===_0x1c07de||'0px'===_0x1c07de||!_0x1c07de){const _0x266cfb=_0x34e6bb['parentElement'];if(_0x266cfb){const _0x4e1b74=window['getComputedStyle'](_0x266cfb);return'auto'!==_0x4e1b74['width']?_0x4e1b74['width']:Fn;}return Fn;}return _0x1c07de;}['_applyCalculationStyles'](_0x859f48,_0x3122dc){this['_config']['cssClasses']['calculationContainer']&&_0x859f48['classList']['add'](this['_config']['cssClasses']['calculationContainer']),_0x859f48['style']['width']=_0x3122dc,_0x859f48['style']['position']='absolute',_0x859f48['style']['top']='-9999px',_0x859f48['style']['left']='-9999px',_0x859f48['style']['opacity']='0',_0x859f48['style']['pointerEvents']='none',_0x859f48['style']['zIndex']='-1',_0x859f48['style']['visibility']='visible\x20!important',_0x859f48['style']['display']='block\x20!important',_0x859f48['style']['boxSizing']='border-box';}['_restoreAncestorVisibility'](_0x1451a4){_0x1451a4['forEach'](({element:_0x26aaad,originalDisplay:_0x892359,originalVisibility:_0x505e08})=>{_0x26aaad['style']['display']=_0x892359,_0x26aaad['style']['visibility']=_0x505e08;});}['_makeAncestorsVisible'](_0x5ddcac){const _0x10522a=[];let _0xbcc546=_0x5ddcac;for(;_0xbcc546&&_0xbcc546!==document['body'];){const _0x36b51d=window['getComputedStyle'](_0xbcc546);'none'!==_0x36b51d['display']&&'hidden'!==_0x36b51d['visibility']||(_0x10522a['push']({'element':_0xbcc546,'originalDisplay':_0xbcc546['style']['display'],'originalVisibility':_0xbcc546['style']['visibility']}),_0xbcc546['style']['display']='block',_0xbcc546['style']['visibility']='visible'),_0xbcc546=_0xbcc546['parentElement'];}return _0x10522a;}['_createContainerElements'](){let _0x966827,_0x2f69ef;return this['_parentView']?.['element']?(_0x966827=this['_parentView']['element']['cloneNode'](!0x0),_0x2f69ef=this['_findTargetContainer'](_0x966827)):(_0x966827=document['createElement']('div'),_0x2f69ef=_0x966827),{'calculationContainer':_0x966827,'targetContainer':_0x2f69ef};}['_createCalculationContainer'](){const {calculationContainer:_0x4abba5,targetContainer:_0xea1f7e}=this['_createContainerElements'](),_0xc8d1c=this['_calculateContainerWidth']();this['_applyCalculationStyles'](_0x4abba5,_0xc8d1c);const _0x4c196a=this['_parentView']?.['element']||this['_containerElement'],_0x734e50=_0x4c196a?.['parentElement'];_0x734e50?_0x734e50['appendChild'](_0x4abba5):document['body']['appendChild'](_0x4abba5),_0x4abba5['_targetContainer']=_0xea1f7e;const _0x1b6d21=this['_makeAncestorsVisible'](_0x734e50||null);return _0x4abba5['offsetWidth'],_0x4abba5['_ancestorsToRestore']=_0x1b6d21,_0x4abba5;}['_calculateOverflowInContainer'](_0x13456b,_0x1e39fb){const _0x32d051=_0x13456b['_targetContainer']||_0x13456b,_0x3b08c4=[],{rowCount:_0x56ecbf}=this['_renderChipsAndCountRows'](_0x32d051,_0x1e39fb);if(_0x56ecbf<=this['_config']['maxVisibleRows'])return _0x3b08c4;const _0x5d2220=_0x1e39fb['slice']();for(;_0x5d2220['length']>0x0;){if(this['_testButtonFit'](_0x13456b,_0x32d051,_0x5d2220)){const _0x213725=_0x1e39fb['filter'](_0x59059e=>!_0x5d2220['includes'](_0x59059e));_0x3b08c4['push'](..._0x213725);break;}if(!_0x5d2220['pop']())break;}return _0x3b08c4;}['_renderChipsAndCountRows'](_0x525a9c,_0x3c34a2){_0x525a9c['innerHTML']='',_0x3c34a2['forEach'](_0x261329=>{if(_0x261329['element']){const _0x1ef387=_0x261329['element']['cloneNode'](!0x0);_0x525a9c['appendChild'](_0x1ef387);}}),_0x525a9c['offsetWidth'];const _0x44a36a=_0x525a9c['children'],_0x50711b=[];return Array['from'](_0x44a36a)['forEach'](_0x4a480e=>{const _0x132a4b=_0x4a480e['getBoundingClientRect']()['top'];_0x50711b['some'](_0x44fc33=>Math['abs'](_0x44fc33-_0x132a4b)<this['_config']['rowDetectionTolerance'])||_0x50711b['push'](_0x132a4b);}),{'rowCount':_0x50711b['length']};}['_createMockButton'](){const _0x1e4e53=document['createElement']('button');return _0x1e4e53['className']=this['_config']['cssClasses']['showMoreButton'],this['_config']['cssClasses']['controlsButton']&&_0x1e4e53['classList']['add'](this['_config']['cssClasses']['controlsButton']),_0x1e4e53['textContent']='+\x201',_0x1e4e53;}['_testButtonFit'](_0x46b1d7,_0x1667f2,_0x40fc30){this['_renderChipsAndCountRows'](_0x1667f2,_0x40fc30);const _0x54db7d=this['_createMockButton']();_0x46b1d7['appendChild'](_0x54db7d),_0x46b1d7['offsetWidth'];const _0x68ad15=[..._0x1667f2['children'],_0x54db7d],_0x12a8e0=[];_0x68ad15['forEach'](_0x417cdd=>{const _0x3a1665=_0x417cdd['getBoundingClientRect']()['top'];_0x12a8e0['some'](_0x55235b=>Math['abs'](_0x55235b-_0x3a1665)<this['_config']['rowDetectionTolerance'])||_0x12a8e0['push'](_0x3a1665);});const _0x42af5c=_0x12a8e0['length'];return _0x54db7d['remove'](),_0x42af5c<=this['_config']['maxVisibleRows'];}['_distributeChips'](_0x706680,_0x39e011){this['_visibleChips']['clear'](),this['_overflowChips']['clear'](),_0x706680['forEach'](_0x9bdca8=>{_0x39e011['includes'](_0x9bdca8)?this['_overflowChips']['add'](_0x9bdca8):this['_visibleChips']['add'](_0x9bdca8);});}['_updateOverflowUI'](_0xc84252){if(_0xc84252>0x0&&!this['_showMoreButtonView']&&this['_createShowMoreButton'](),_0xc84252>0x0&&this['_showMoreButtonView']){const _0x4bdb9c=''+this['_config']['showMoreLabelPrefix']+(_0xc84252<0x63?_0xc84252:'99');this['_showMoreButtonView']['label']=_0x4bdb9c;}this['_updateBalloonContent'](),this['_updateShowMoreButtonVisibility'](),this['_repinBalloonPanel']();}['_applyOverflowResults'](_0x33b441,_0x3aee48){this['_distributeChips'](_0x33b441,_0x3aee48),this['_updateOverflowUI'](_0x3aee48['length']);}['_setupVisibilityObserver'](){this['_containerElement']&&'undefined'!=typeof IntersectionObserver&&(this['_intersectionObserver']=new IntersectionObserver(_0x5c87ef=>{_0x5c87ef[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 _0x343a05=this['_containerElement']['getBoundingClientRect']();if(0x0===_0x343a05['width']||0x0===_0x343a05['height'])return!0x1;const _0x6a8354=window['innerHeight']||document['documentElement']['clientHeight'],_0x5db4bd=window['innerWidth']||document['documentElement']['clientWidth'],_0x259bc9=0xc8;return _0x343a05['bottom']>=-0xc8&&_0x343a05['top']<=_0x6a8354+_0x259bc9&&_0x343a05['right']>=-0xc8&&_0x343a05['left']<=_0x5db4bd+_0x259bc9;}}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(_0x32661f,_0x5cf5c7,_0x2c6357){super(_0x32661f),this['_bodyCollection']=_0x2c6357,this['_createContextChips'](_0x5cf5c7);const _0xbb64f6={'cssClasses':{'showMoreButton':Qn+'\x20'+As,'showMoreBalloon':Xn,'overflowContainer':$n,'controlsButton':qn}};this['_overflowManager']=new Kn(_0x32661f,this['_contextChips'],_0xbb64f6,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 _0x4ae7af=this['element']['querySelector']('.'+Yn);_0x4ae7af&&(this['_overflowManager']['setContainerElement'](_0x4ae7af),this['_overflowManager']['reorganizeChips']());}['destroy'](){super['destroy'](),this['_overflowManager']['destroy']();}['_createContextChips'](_0x20c87f){for(const _0x448a6c of _0x20c87f){const _0xb597e7=new Vn(this['locale'],_0x448a6c,!0x0,!0x1);this['_contextChips']['add'](_0xb597e7);}}}class jn extends cn{['_contextChipsView']=null;['_locale'];['_bodyCollection'];['_messageContentView'];constructor(_0x444bb1,_0x4a7c1e,_0x2d0845){super(_0x4a7c1e),this['_locale']=_0x444bb1,this['_bodyCollection']=_0x2d0845,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'](_0x3ada64=>!_0x3ada64['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(_0x57e69b,_0x52d1b2){super(_0x52d1b2);const {isWebSearchEnabled:_0xf9f063,isReasoningEnabled:_0x3e74b2}=_0x52d1b2['capabilities'],_0x4263b1=[];let _0x45fe02='';_0xf9f063&&_0x3e74b2?(_0x45fe02=us(_0x57e69b,'AI_CHAT_FEED_REPLY_ITEM_USED_WEB_SEARCH_REASONING'),_0x4263b1['push'](Zn(_0x581afe)),_0x4263b1['push'](Zn(_0x5c8cae))):_0xf9f063?(_0x45fe02=us(_0x57e69b,'AI_CHAT_FEED_REPLY_ITEM_USED_WEB_SEARCH'),_0x4263b1['push'](Zn(_0x581afe))):_0x3e74b2&&(_0x45fe02=us(_0x57e69b,'AI_CHAT_FEED_REPLY_ITEM_USED_REASONING'),_0x4263b1['push'](Zn(_0x5c8cae))),this['extendTemplate']({'attributes':{'class':['ck-ai-chat__feed__interaction-header',_0x45fe02?'':'ck-hidden']}});const _0x37dad9=new vt();_0x37dad9['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed__interaction-header__capabilities']},'children':[..._0x4263b1,{'tag':'span','attributes':{'class':['ck-ai-chat__feed__interaction-header__capabilities__text']},'children':[_0x45fe02]}]}),this['children']['add'](_0x37dad9),this['capabilities']=_0x52d1b2['capabilities'];}}function Zn(_0x1640d7){const _0x2eb077=new xt();return _0x2eb077['content']=_0x1640d7,_0x2eb077;}const tr=['wheel','touchstart','pointerdown','keydown'],er=['ArrowUp','ArrowDown','PageUp','PageDown','Home','End','\x20'];class ir{['element'];['animationFrameId'];['isRunning'];['abortController'];['isUserPaused'];constructor(_0x2b0d04){this['element']=_0x2b0d04,this['animationFrameId']=null,this['isRunning']=!0x1,this['abortController']=new AbortController(),this['isUserPaused']=!0x1;for(const _0x2f194d of tr){const _0x46acbe='keydown'!==_0x2f194d;this['element']['addEventListener'](_0x2f194d,this['_onUserEvent']['bind'](this),{'passive':_0x46acbe,'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'](_0xa10867){if(this['isRunning']){if('keydown'===_0xa10867['type']){const _0x3e3b2b=_0xa10867['key'];if(!er['includes'](_0x3e3b2b))return;}_0xa10867 instanceof WheelEvent?_0xa10867['deltaY']<0x0?this['isUserPaused']=!0x0:this['isUserPaused']=!this['_isAtBottom']():this['isUserPaused']=!0x0;}}['_isAtBottom'](){const {scrollTop:_0x5b83bf,scrollHeight:_0x383b1c,clientHeight:_0x1c0f0c}=this['element'];return _0x383b1c-_0x5b83bf-_0x1c0f0c<=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(_0x180324,_0x43ce45){super(_0x180324),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-skeleton']},'children':this['_createSkeletonItems'](_0x43ce45)});}['_createSkeletonItems'](_0xcffbc3){const _0x2a2b15=['ck','ck-ai-skeleton__item'];return _0xcffbc3['map'](_0x483d34=>{let _0x2b8c68='';switch(_0x483d34['attributes']['align']){case'right':_0x2b8c68='margin-left:\x20auto;\x20margin-right:\x200;\x20text-align:\x20right;';break;case'center':_0x2b8c68='margin-left:\x20auto;\x20margin-right:\x20auto;\x20text-align:\x20center;';break;case'left':_0x2b8c68='margin-left:\x200;\x20margin-right:\x20auto;\x20text-align:\x20left;';}return{'tag':_0x483d34['tag'],'attributes':{'class':[..._0x2a2b15,_0x483d34['attributes']['class']?_0x483d34['attributes']['class']:''],'style':'width:\x20'+_0x483d34['attributes']['width']+';\x20height:\x20'+_0x483d34['attributes']['height']+';'+_0x2b8c68}};});}}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(_0x19da8f,_0x326a86,_0x8b6500,_0x2a4535){return new Array(_0x19da8f)['fill'](null)['map'](()=>({'tag':'div','attributes':{'width':_0x326a86,'height':_0x8b6500,'align':_0x2a4535}}));}class ar extends cn{constructor(_0x4f6d9e){super(_0x4f6d9e),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(_0x46a1e0,_0x42ac11){super(_0x46a1e0),this['_bodyCollection']=_0x42ac11,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'](_0x4a489e,_0x2c7812){let _0x5f51f1;return'ai-reply'===_0x4a489e?_0x5f51f1=new Nn(this['locale'],_0x2c7812,this['_bodyCollection']):'ai-suggestion-reply'===_0x4a489e?(_0x5f51f1=new kn(this['locale'],_0x2c7812,this['_bodyCollection']),_0x5f51f1['bind']('isTrackChangesOn')['to'](this)):_0x5f51f1='user-message'===_0x4a489e?new jn(this['locale'],_0x2c7812,this['_bodyCollection']):'interaction-header'===_0x4a489e?new Jn(this['locale'],_0x2c7812):'custom-element'===_0x4a489e?new ar(_0x2c7812):new Cn(_0x2c7812),this['children']['add'](_0x5f51f1),_0x5f51f1;}async['updateReplyItem']({id:_0x467e27,parsedContent:_0x9ce7d6,renderingStrategy:_0x490aad,abortSignal:_0xa527b6}){const _0x5cc7d8=this['getItemById'](_0x467e27);if(!(_0x5cc7d8 instanceof Nn))throw new ht('ai-chat-feed-view-item-not-a-reply-item',null,{'itemView':_0x5cc7d8,'id':_0x467e27,'parsedContent':_0x9ce7d6});await _0x5cc7d8['updateContent']({'parsedContent':_0x9ce7d6,'renderingStrategy':_0x490aad,'abortSignal':_0xa527b6});}async['updateWebSources'](_0x2119cd,_0x3e87e4){const _0x278250=this['getItemById'](_0x2119cd);if(_0x278250 instanceof kn)_0x278250['updateSources'](_0x3e87e4);else{if(!(_0x278250 instanceof Nn))throw new ht('ai-chat-feed-view-item-not-a-suggestion-or-reply-item',null,{'itemView':_0x278250,'id':_0x2119cd,'sources':_0x3e87e4});_0x278250['updateSources'](_0x3e87e4);}}async['updateSuggestionItem']({id:_0x1aec12,parts:_0x5adde5,renderingStrategy:_0x491a8f,abortSignal:_0x30545a}){const _0x153642=this['getItemById'](_0x1aec12);if(!(_0x153642 instanceof kn))throw new ht('ai-chat-feed-view-item-not-a-suggestion-item',null,{'itemView':_0x153642,'id':_0x1aec12,'parts':_0x5adde5});await _0x153642['updateContent']({'parts':_0x5adde5,'renderingStrategy':_0x491a8f,'abortSignal':_0x30545a});}['updateSuggestionPartState']({id:_0x12bb85,index:_0x2ec6e0,state:_0x424267}){const _0x39553e=this['getItemById'](_0x12bb85);if(!(_0x39553e instanceof kn))throw new ht('ai-chat-feed-view-item-not-a-suggestion-item',this,{'id':_0x12bb85});_0x39553e['updatePartState'](_0x2ec6e0,_0x424267);}['setSuggestionPartActive']({id:_0x196573,index:_0x197c21,isActive:_0x465985}){const _0x475669=this['getItemById'](_0x196573);if(!(_0x475669 instanceof kn))throw new ht('ai-chat-feed-view-item-not-a-suggestion-item',this,{'id':_0x196573});this['children']['filter'](_0x657e33=>_0x657e33 instanceof kn)['forEach'](_0x52c1ba=>{_0x52c1ba['setPartActive'](!0x1);}),_0x475669['setPartActive'](_0x197c21,_0x465985);}['markItemAsDone'](_0x26befa){this['getItemById'](_0x26befa)['markAsDone']();}['getItemIds'](){return this['children']['map'](_0x8c10d6=>_0x8c10d6['options']['id']);}['removeItem'](_0x4827b9){this['children']['remove'](this['getItemById'](_0x4827b9));}['hasItem'](_0xa1c257){return!!this['children']['find'](_0x2a41dc=>_0x2a41dc['options']['id']['includes'](_0xa1c257));}['scrollToSuggestion'](_0xbc6992,_0x4b7e45){const _0xdff1de=this['getItemById'](_0xbc6992);if(!(_0xdff1de instanceof kn))return void Tt('ck-ai-chat-feed-view-scroll-to-suggestion-invalid-item',{'replyId':_0xbc6992,'partIndex':_0x4b7e45});const _0x376c80=_0xdff1de['getPartView'](_0x4b7e45);_0x376c80?ft(_0x376c80['element'],0x14,this['element']['parentElement'],!0x0,!0x0):Tt('ck-ai-chat-feed-view-scroll-to-suggestion-part-view-not-found',{'replyId':_0xbc6992,'partIndex':_0x4b7e45});}['_setupTemplate'](){this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed']},'children':this['_createTemplateChildren']()});}['_createTemplateChildren'](){const _0x10cb08=this['_createSkeletonLoader']();return[this['_createFeedItems'](),_0x10cb08,this['_createFeedLoader']()];}['_createSkeletonLoader'](){const _0x4e17a5=new sr(this['locale'],nr['aiFeed']);return _0x4e17a5['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isLoadingSkeletonVisible','ck-hidden',_0x1a74d9=>!_0x1a74d9)]}}),_0x4e17a5;}['_createFeedItems'](){const _0x2adf27=new vt(this['locale']);return _0x2adf27['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed__items',this['bindTemplate']['if']('isLoadingSkeletonVisible','ck-hidden')]},'children':this['children']}),_0x2adf27;}['_createFeedLoader'](){const _0x41da52=new vt(this['locale']);return _0x41da52['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__loader',this['bindTemplate']['if']('isPending','ck-hidden',_0x3c2f18=>!_0x3c2f18)]},'children':this['_createLoaderChildren']()}),_0x41da52;}['_createLoaderChildren'](){const _0x36c0de=new vn();return _0x36c0de['isVisible']=!0x0,[_0x36c0de,{'tag':'span','attributes':{'class':['ck','ck-ai-chat__loader-text']},'children':[{'text':this['bindTemplate']['to']('loadingMessage')}]}];}['getItemById'](_0x4ac310){const _0x4f0393=this['children']['find'](_0x55152f=>_0x55152f['options']['id']['includes'](_0x4ac310));if(!_0x4f0393)throw new ht('ai-chat-feed-view-item-not-found',this,{'id':_0x4ac310});return _0x4f0393;}['setLoadingMessage'](_0x65196c){this['set']('loadingMessage',_0x65196c);}['toggleLoadingSkeleton'](_0x5832c9){this['set']('isLoadingSkeletonVisible',_0x5832c9);}['startAutoScroll'](){this['scrollManager']['start']();}['stopAutoScroll'](){this['scrollManager']['stop']();}}class hr extends Dt{['filter'](){let _0x5e9571=0x0;for(const _0x3ecc4f of this['items'])_0x5e9571+=_0x3ecc4f['items']['length'];return{'resultsCount':_0x5e9571,'totalItemsCount':_0x5e9571};}}const cr='ck-ai-chat__prompt-input_highlighted';class lr extends Lt{['submitButtonView'];static ['MIN_ROWS']=0x1;static ['MAX_ROWS']=0xc;['_addContextButtonView'];['_queryViewResizeObserver'];constructor(_0x36977e,_0x5a17a5){super(_0x36977e,{'queryView':{'label':'','creator':Vt,'showIcon':!0x1,'showResetButton':!0x1},'filteredView':new hr(_0x36977e),'queryMinChars':0x1/0x0,'resetOnBlur':!0x1}),this['set']('isEmpty',!0x0),this['set']('isUploadInProgress',!0x1),this['_addContextButtonView']=_0x5a17a5,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',(_0xca4c03,_0x403459)=>!_0xca4c03&&!_0x403459),this['focusableChildren']['add'](this['submitButtonView']);}['render'](){super['render'](),this['queryView']['fieldWrapperChildren']['add'](this['submitButtonView']),this['keystrokes']['set']('enter',(_0x2c4210,_0x2f5aa9)=>{this['isUploadInProgress']||this['isEmpty']||_0x2c4210['target']==this['queryView']['fieldView']['element']&&(this['submit'](),_0x2f5aa9());}),this['queryView']['fieldView']['on']('update',()=>{this['isEmpty']=''===this['queryView']['fieldView']['element']['value']?.['trim']();});}['destroy'](){super['destroy'](),this['_queryViewResizeObserver']&&this['_queryViewResizeObserver']['destroy']();}['submit'](){const _0x469118=this['queryView']['fieldView']['element']['value']?.['trim']();if(!_0x469118)return this['queryView']['errorText']=us(this['locale'],'AI_CHAT_PROMPT_EMPTY_ERROR'),void(this['queryView']['fieldView']['hasError']=!0x0);this['queryView']['fieldView']['hasError']=!0x1;const _0x57d059=_0xeac408(_0x469118);this['fire']('sendUserMessage',_0x57d059),this['queryView']['fieldView']['reset']();}['setPlaceholderText'](_0x438472){this['queryView']['fieldView']['set']('placeholder',_0x438472);}['focus'](_0x48e84a=!0x1){super['focus'](),_0x48e84a&&(this['element']['classList']['contains'](cr)||(this['element']['classList']['add'](cr),setTimeout(()=>{this['element']['classList']['remove'](cr);},0x320)));}['_createSubmitButton'](){const _0x31a3ba=new Nt(this['locale']);return _0x31a3ba['set']({'icon':_0x1e545f,'label':us(this['locale'],'AI_CHAT_LABEL_SUBMIT'),'isVisible':!0x0,'tooltip':!0x0,'class':'ck-ai-chat__prompt-submit-button\x20'+ds,'isEnabled':!0x1}),_0x31a3ba['on']('execute',()=>{this['submit']();}),_0x31a3ba;}['setIsUploadInProgress'](_0x51c93b){this['isUploadInProgress']=_0x51c93b;}['_setUpAddContextButtonPositioning'](){const _0x403d52=this['locale'],_0x48d8d8=()=>{lt['window']['requestAnimationFrame'](()=>{if(ut(this['element'])){const _0x313b67=new dt(this['queryView']['fieldView']['element']),_0x43c570=new dt(this['_addContextButtonView']['element']),_0x5550f1=_0x313b67['width'],_0x4baff3='rtl'===_0x403d52['uiLanguageDirection']?'right':'left';_0x313b67['excludeScrollbarsAndBorders']();const _0x154d0f=_0x5550f1-_0x313b67['width']+0x1;this['_addContextButtonView']['element']['style'][_0x4baff3]='calc('+(_0x5550f1-_0x43c570['width']-_0x154d0f)+'px\x20-\x20var(--ck-spacing-tiny))';}});};this['queryView']['fieldView']['on']('update',_0x48d8d8),this['on']('render',()=>{_0x48d8d8(),this['_queryViewResizeObserver']=new St(this['queryView']['fieldView']['element'],()=>{_0x48d8d8();});});}}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(_0x4a1ccc){super(_0x4a1ccc),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',_0x4ab8ba=>'selector'===_0x4ab8ba),this['_modelSelectionDropdown']['buttonView']['bind']('tooltip')['to'](this,'modelSelectorEnabled',_0x30a1fa=>_0x30a1fa?this['_modelSelectionDropdown']['buttonView']['label']:us(this['locale'],'AI_CHAT_MODEL_SELECTOR_DISABLED_TOOLTIP')),this['_modelSelectionDropdown']['bind']('isEnabled')['to'](this,'modelSelectorEnabled',_0xa52c95=>_0xa52c95),this['_webSearchButton']['bind']('isOn')['to'](this,'webSearchActive',_0x15110b=>_0x15110b),this['_webSearchButton']['bind']('tooltip')['to'](this,'webSearchActive',_0x37764d=>us(this['locale'],_0x37764d?'AI_CHAT_DISABLE_WEB_SEARCH':'AI_CHAT_ENABLE_WEB_SEARCH')),this['_reasoningButton']['bind']('isOn')['to'](this,'reasoningActive',_0x4f1812=>_0x4f1812),this['_reasoningButton']['bind']('tooltip')['to'](this,'reasoningActive',_0x100352=>us(this['locale'],_0x100352?'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'](_0x576ca9,_0xa7dc2e){if(_0xa7dc2e)this['set']('modelDisplayMode','hidden');else{const _0x347358=0x1===_0x576ca9['length'];this['set']('modelDisplayMode',_0x347358?'name':'selector');}if(this['_modelSelectionDropdownItems']['clear'](),_0x576ca9?.['length'])for(const _0x3e3cfc of _0x576ca9){const _0x33671b=new Jt({'label':_0x3e3cfc['name'],'withText':!0x0,'role':'menuitemradio','id':_0x3e3cfc['id'],'model':_0x3e3cfc});_0x33671b['bind']('isOn')['to'](this,'activeModelId',_0x36559f=>_0x36559f===_0x3e3cfc['id']),this['_modelSelectionDropdownItems']['add']({'type':'button','model':_0x33671b,'labelView':new mr(this['locale'],_0x3e3cfc)});}}['setWebSearch'](_0x1a6f1f){this['set']('webSearchActive',_0x1a6f1f);}['setReasoning'](_0x306742){this['set']('reasoningActive',_0x306742);}['setModel'](_0x5d8652){if(!_0x5d8652)return;this['activeModelId']=_0x5d8652['id'],this['activeModelName']=_0x5d8652['name']||_0x5d8652['id'],this['_modelSelectionDropdown']['buttonView']['set']('label',_0x5d8652['name']),this['_modelSelectionDropdown']['buttonView']['set']('tooltip',_0x5d8652['name']);const _0x1e3cc1=_0x5d8652['capabilities']['webSearch']?.['enabled']??!0x1;this['set']('webSearchActive',!0x1),this['_webSearchButton']['set']('isOn',!0x1),this['_webSearchButton']['set']('isEnabled',_0x1e3cc1),this['_webSearchButton']['set']('isVisible',_0x1e3cc1);const _0x29d75f=_0x5d8652['capabilities']['reasoning']?.['enabled']??!0x1;this['set']('reasoningActive',!0x1),this['_reasoningButton']['set']('isOn',!0x1),this['_reasoningButton']['set']('isEnabled',_0x29d75f),this['_reasoningButton']['set']('isVisible',_0x29d75f);}['enableModelSelector'](){this['set']('modelSelectorEnabled',!0x0);}['disableModelSelector'](_0x4d01af){this['set']('modelSelectorEnabled',!0x1),_0x4d01af&&this['set']('modelDisplayMode','hidden');}['_createWebSearchButton'](){const _0x202756=new Nt();return _0x202756['set']({'label':us(this['locale'],'AI_CHAT_SEARCH_WEB'),'icon':_0x581afe,'class':dr+'\x20'+As,'isToggleable':!0x0,'tooltipPosition':pr}),_0x202756['on']('execute',()=>{this['fire']('toggleWebSearch');}),_0x202756;}['_createReasoningButton'](){const _0x275cb8=new Nt();return _0x275cb8['set']({'label':us(this['locale'],'AI_CHAT_REASONING'),'icon':_0x5c8cae,'class':dr+'\x20'+As,'isToggleable':!0x0,'tooltipPosition':pr}),_0x275cb8['on']('execute',()=>{this['fire']('toggleReasoning');}),_0x275cb8;}['_createCommandsButton'](){const _0x273549=new Nt();return _0x273549['set']({'label':us(this['locale'],'AI_CHAT_COMMANDS'),'icon':_0x556fcc,'withText':!0x0,'class':dr+'\x20'+As,'isToggleable':!0x0,'tooltip':us(this['locale'],'AI_CHAT_COMMANDS'),'tooltipPosition':pr}),_0x273549['extendTemplate']({'attributes':{'class':[_r]}}),_0x273549['on']('execute',()=>{console['log']('Commands\x20are\x20not\x20implemented\x20yet.'),alert('Commands\x20are\x20not\x20implemented\x20yet.');}),_0x273549;}['_createModelSelectionDropdown'](){const _0x4da78c=Gt(this['locale']);return _0x4da78c['set']({'panelPosition':'ne','class':[Ar]}),_0x4da78c['buttonView']['set']({'label':us(this['locale'],'AI_CHAT_MODEL_SELECTOR_ENABLED_TOOLTIP'),'withText':!0x0,'tooltip':!0x0,'tooltipPosition':pr,'class':As}),this['listenTo'](_0x4da78c,'execute',_0x30ade3=>{this['fire']('selectModel',_0x30ade3['source']['model']);}),_0x4da78c;}['_createModelNameView'](){const _0x14cb0f=new Cr(this['locale']);return _0x14cb0f['bind']('text')['to'](this,'activeModelName',_0x285dbc=>_0x285dbc??''),_0x14cb0f['bind']('isVisible')['to'](this,'modelDisplayMode',_0x500710=>'name'===_0x500710),_0x14cb0f;}}let mr=class extends Mt{constructor(_0x7be454,_0x4c5162){super();const _0x23bf56=this['bindTemplate'],_0x51235c=this['createCollection']();this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-button__label'],'style':_0x23bf56['to']('style'),'id':_0x23bf56['to']('id')},'children':[{'tag':'div','attributes':{'class':[gr]},'children':[{'text':_0x23bf56['to']('text')}]},{'tag':'div','attributes':{'class':[Ir]},'children':[{'tag':'span','children':[{'text':_0x4c5162['description']}]}]},{'tag':'div','attributes':{'class':[Er]},'children':_0x51235c}]}),_0x51235c['addMany'](this['_getCapabilityParts'](_0x7be454,_0x581afe,'AI_CHAT_SEARCH_WEB',_0x4c5162['capabilities']['webSearch']?.['enabled']??!0x1)),_0x51235c['addMany'](this['_getCapabilityParts'](_0x7be454,_0x5c8cae,'AI_CHAT_REASONING',_0x4c5162['capabilities']['reasoning']?.['enabled']??!0x1));}['_getCapabilityParts'](_0x4930c0,_0x4e70ef,_0xa20fa1,_0x4413cb){const _0x1b7add=new xt();_0x1b7add['content']=_0x4e70ef;const _0x15447b=new vt(_0x4930c0);_0x15447b['setTemplate']({'tag':'span','children':[{'text':us(_0x4930c0,_0xa20fa1)+':\x20'}]});const _0x4acca9=new vt(_0x4930c0);return _0x4acca9['setTemplate']({'tag':'span','children':[{'text':us(_0x4930c0,_0x4413cb?'AI_CHAT_CAPABILITIES_YES':'AI_CHAT_CAPABILITIES_NO')}]}),[_0x1b7add,_0x15447b,_0x4acca9];}},Cr=class extends vt{constructor(_0x44e028){super(_0x44e028),this['set']('text',void 0x0),this['set']('isVisible',!0x0);const _0xa35ca9=this['bindTemplate'];this['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai-chat-controls__model-name',_0xa35ca9['if']('isVisible','ck-hidden',_0xcdda74=>!_0xcdda74)]},'children':[{'text':_0xa35ca9['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(_0x1622e4){super(_0x1622e4),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'](_0x3ce0a4=>{this['focusTracker']['add'](_0x3ce0a4['element']),this['keystrokes']['listenTo'](_0x3ce0a4['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'](_0x18fa45){this['urlInputField']['errorText']=_0x18fa45,this['_updateConfirmButtonState'](),this['fire']('refreshBalloon');}['clearError'](){this['urlInputField']['errorText']=null,this['_updateConfirmButtonState']();}['_createBackButton'](){const _0x245c4d=new Nt(this['locale']);return _0x245c4d['set']({'icon':_0xf8587c,'tooltip':us(this['locale'],'AI_CHAT_CONTEXT_URL_BACK_TO_CONTEXT'),'tooltipPosition':'n','class':['ck-button-icon\x20ck-button-back']}),this['on']('change:withBackButton',(_0x205b62,_0x1c008a,_0x786e14)=>{_0x245c4d['set']({'class':['ck-button-icon\x20ck-button-back'+(_0x786e14?'':'\x20ck-hidden')]});}),_0x245c4d;}['_createUrlInputField'](){const _0x591df8=new te(this['locale'],_0x218843);return _0x591df8['set']({'label':us(this['locale'],'AI_CHAT_CONTEXT_URL_LABEL'),'class':'ck-labeled-field-view_empty'}),_0x591df8['fieldView']['set']({'placeholder':us(this['locale'],'AI_CHAT_CONTEXT_URL_PLACEHOLDER')}),_0x591df8;}['_createConfirmButton'](){const _0x1157ad=new Nt(this['locale']);return _0x1157ad['set']({'icon':_0x389cff,'tooltip':us(this['locale'],'AI_CHAT_CONTEXT_URL_ADD_URL'),'tooltipPosition':'n','class':'ck-button-icon','type':'submit','isEnabled':!0x1}),_0x1157ad;}['_setupTemplate'](){const _0x1d18ea=new _0x314748(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'});_0x1d18ea['children']['add'](this['backButton'],0x0),this['setTemplate']({'tag':'form','attributes':{'class':wr,'tabindex':'-1'},'children':[_0x1d18ea,{'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',_0x2e4448=>{_0x2e4448['stop'](),this['_handleSubmit']();});}['_setupKeystrokes'](){this['keystrokes']['set']('esc',(_0x30aba8,_0xdc22d1)=>{this['clear'](),this['fire']('cancel'),_0xdc22d1();});}['_handleSubmit'](){const _0x1e0886=this['getValue']()['trim']();_0x1e0886?this['_isValidUrl'](_0x1e0886)?(this['clearError'](),this['fire']('submitUrl',_0x1e0886)):this['setError'](us(this['locale'],'AI_CHAT_CONTEXT_URL_INVALID_ERROR')):this['setError'](us(this['locale'],'AI_CHAT_CONTEXT_URL_EMPTY_ERROR'));}['_updateConfirmButtonState'](){const _0x3bd961=this['getValue']()['trim'](),_0x128d08=!!this['urlInputField']['errorText'];this['confirmButton']['isEnabled']=_0x3bd961['length']>0x0&&!_0x128d08;}['_isValidUrl'](_0x5b6297){try{return!!new URL(_0x5b6297);}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(_0x321fbd,_0x8296ae){super(_0x321fbd),this['resource']=_0x8296ae,this['set']('isInContext',!!_0x8296ae['isInContext']),this['_titleView']=this['_createTitleView'](),this['_iconView']=this['_createIconView'](),this['_setupTemplate']();}['render'](){super['render']();}['getResourceIcon'](_0x5ef790){if(_0x5ef790['isInContext'])return _0x389cff;switch(_0x5ef790['type']){case Us['DOCUMENT']:return _0x14afda;case Us['URL']:return _0x56a18a;case Us['FILE']:case Us['TEXT']:return _0xf290e5;default:return _0x14798d;}}['highlightText'](_0x2eaaf2){if(!_0x2eaaf2||''===_0x2eaaf2['trim']())return void this['_titleView']['highlightText'](null);const _0x314bf6=new RegExp(_0x5517e5(_0x2eaaf2),'gi');this['_titleView']['highlightText'](_0x314bf6);}['updateResourceState'](_0x168c93){this['resource']['isInContext']=_0x168c93,this['isInContext']=_0x168c93,this['_updateIcon']();}['_createTitleView'](){const _0x1499eb=new _0x25931f();return _0x1499eb['text']=this['resource']['label'],_0x1499eb['extendTemplate']({'tag':'span','attributes':{'class':[Or]}}),_0x1499eb;}['_createIconView'](){const _0x3dcaa=new xt();return _0x3dcaa['content']=this['getResourceIcon'](this['resource']),_0x3dcaa;}['_setupTemplate'](){const _0x537241=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':[br,_0x537241['if']('isVisible','ck-hidden',_0x4257b5=>!_0x4257b5),_0x537241['if']('isInContext',Rr)]},'children':[{'tag':'div','attributes':{'class':[kr]},'children':[this['_iconView']]},this['_titleView']],'on':{'click':_0x537241['to']('execute')}});}['_updateIcon'](){this['_iconView']['content']=this['getResourceIcon'](this['resource']);}}const vr='ck-ai-chat-resources__list';class yr extends Dt{['_source'];constructor(_0x4d3930,_0x574cad){super(_0x4d3930),this['_source']=_0x574cad,this['extendTemplate']({'attributes':{'class':[vr]}});}['setResources'](_0x5a9475,_0x1a1cf4){this['items']['clear']();let _0x41a9bd=_0x5a9475;if(this['_source']['useDefaultFiltering']&&_0x1a1cf4&&''!==_0x1a1cf4['trim']()){const _0x50513b=new RegExp(_0x1a1cf4['replace'](/[.*+?^${}()|[\]\\]/g,'\x5c$&'),'gi');_0x41a9bd=_0x5a9475['filter'](_0x129b9d=>_0x50513b['test'](_0x129b9d['label']));}for(const _0x551cb9 of _0x41a9bd){const _0x558efa=new Nr(this['locale'],_0x551cb9);_0x558efa['on']('execute',()=>{this['_handleResourceSelection'](this['_source'],_0x551cb9);}),this['items']['add'](_0x558efa);}this['_source']['useDefaultFiltering']&&this['highlightText'](_0x1a1cf4);}['highlightText'](_0x3861b6){this['_source']['useDefaultFiltering']&&this['items']['forEach'](_0x5223d8=>{_0x5223d8['highlightText'](_0x3861b6);});}['updateResourceState'](_0x3c1dac,_0xfae900){for(const _0x5d1230 of this['items']){const _0x579f3c=_0x5d1230;_0x579f3c['resource']['id']===_0x3c1dac&&_0x579f3c['updateResourceState'](_0xfae900);}}['_handleResourceSelection'](_0x22c2d6,_0xa338fc){this['fire']('addResourceToContext',{'source':_0x22c2d6,'resource':_0xa338fc});}}class xr extends te{['iconView'];['resetButtonView'];['_viewConfig'];constructor(_0x36f2f0){const t=_0x36f2f0['t'],_0x231626={'showResetButton':!0x0,'showIcon':!0x0,'creator':_0x218843,'label':us(_0x36f2f0,'AI_CHAT_SEARCH_RESOURCES')};super(_0x36f2f0,_0x231626['creator']),this['label']=_0x231626['label'],this['_viewConfig']=_0x231626,this['_viewConfig']['showIcon']&&this['_setupSearchIcon'](),this['_viewConfig']['showResetButton']&&this['_setupResetButton'](_0x36f2f0,t),this['_setupEventListeners']();}['reset'](){this['fieldView']['reset'](),this['_viewConfig']['showResetButton']&&this['resetButtonView']&&(this['resetButtonView']['isVisible']=!0x1),this['search']('');}['search'](_0x3f25e1){this['fire']('search',_0x3f25e1);}['getQuery'](){return this['fieldView']['element']?.['value']||'';}['_setupSearchIcon'](){this['iconView']=new xt(),this['iconView']['content']=_0x1e98bc,this['fieldWrapperChildren']['add'](this['iconView'],0x0),this['extendTemplate']({'attributes':{'class':'ck-search__query_with-icon'}});}['_setupResetButton'](_0x10221c,t){this['resetButtonView']=new Nt(_0x10221c),this['resetButtonView']['set']({'label':t('Clear'),'icon':_0x117eb5,'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',_0x26ab7c=>!_0x26ab7c),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(_0x505727,_0x5db820){super(_0x505727),this['_source']=_0x5db820['source'],this['_searchInputVisibleFrom']=_0x5db820['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 _0x54c5cf([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 _0x31f7b0=new vt(this['locale']);return _0x31f7b0['setTemplate']({'tag':'div','attributes':{'class':'ck\x20ck-search'},'children':[this['_searchView']]}),this['_searchView']['on']('search',(_0x55019e,_0x2b8928)=>{this['loadResources'](_0x2b8928),this['_source']['useDefaultFiltering']&&this['_resourcesListView']['highlightText'](_0x2b8928);}),_0x31f7b0;}['_createResourcesListView'](){const _0x45ef3f=new yr(this['locale'],this['_source']);return _0x45ef3f['delegate']('addResourceToContext')['to'](this),_0x45ef3f['extendTemplate']({'attributes':{'class':this['bindTemplate']['if']('isLoading','ck-hidden')}}),_0x45ef3f;}['_createSkeletonView'](){const _0x1fa662=new sr(this['locale'],nr['aiChatResources']);return _0x1fa662['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isLoading','ck-hidden',_0x166b3c=>!_0x166b3c)]}}),_0x1fa662;}['render'](){super['render'](),this['loadResources']('');}['loadResources'](_0x3b1abe){const _0x5504fc=ot();this['_latestLoadResourcesUid']=_0x5504fc,this['fire']('loadSourceResources',{'sourceId':this['_source']['id'],'query':_0x3b1abe,'uid':_0x5504fc}),this['isLoading']=!0x0;}['setResources'](_0x603fa6,_0x43bd7b){if(_0x43bd7b&&_0x43bd7b!==this['_latestLoadResourcesUid'])return;const _0x42fa0d=this['_source']['useDefaultFiltering']?this['_searchView']['getQuery']():'';this['_resourcesListView']['setResources'](_0x603fa6,_0x42fa0d),_0x603fa6['length']>=this['_searchInputVisibleFrom']&&!this['children']['has'](this['_searchSection'])&&this['children']['add'](this['_searchSection'],0x0),requestAnimationFrame(()=>{this['isLoading']=!0x1;});}['updateResourceState'](_0x4e1e64,_0x407013){this['_resourcesListView']['updateResourceState'](_0x4e1e64,_0x407013);}}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(_0x567f7a,_0x3c3b98,_0x4b2e0c){this['_locale']=_0x567f7a,this['_bodyCollection']=_0x3c3b98,this['_config']=_0x4b2e0c;}['showSourceResourcesBalloon']({source:_0xb6a94d,withBackButton:_0x23c8ac}){let _0x5cef36=this['_sourceResourceBalloons']['get'](_0xb6a94d['id']);_0x5cef36||(_0x5cef36=this['_createSourceResourceBalloonPanel'](),this['_sourceResourceBalloons']['set'](_0xb6a94d['id'],_0x5cef36),this['_setupSingleResourceBalloonClickOutsideHandler'](_0x5cef36)),this['_addSourceResourceContent']({'balloonPanel':_0x5cef36,'source':_0xb6a94d,'withBackButton':_0x23c8ac}),_0x5cef36['show']();const _0x24ab9f=this['_config']['getTargetElement']();_0x24ab9f&&_0x5cef36['pin']({'target':_0x24ab9f,'limiter':this['_config']['getLimiterElement']()});}['populateSourceResourceBalloon'](_0x514506,_0x3b3b2f,_0x2a2b65){const _0x27fc10=this['_sourceResourceBalloons']['get'](_0x514506);if(!_0x27fc10)return;const _0x3cfb35=this['_getResourcesViewFromBalloon'](_0x27fc10);_0x3cfb35&&(_0x3cfb35['setResources'](_0x3b3b2f,_0x2a2b65),_0x3cfb35['once']('change:isLoading',()=>{_0x27fc10['pin']({'target':this['_config']['getTargetElement'](),'limiter':this['_config']['getLimiterElement']()});}));}['closeSourceResourceBalloon'](_0x5efa70){const _0x1a97ac=this['_sourceResourceBalloons']['get'](_0x5efa70);_0x1a97ac&&requestAnimationFrame(()=>{_0x1a97ac['hide'](),this['_sourceResourceBalloons']['delete'](_0x5efa70),this['_config']['onBalloonClosed']();});}['isAnyResourceBalloonVisible'](){for(const _0x252112 of this['_sourceResourceBalloons']['values']())if(_0x252112['isVisible'])return!0x0;return!0x1;}['updateResourceState'](_0x587fbf,_0x50e6bb,_0x590de1){const _0x5be5aa=this['_sourceResourceBalloons']['get'](_0x587fbf);if(!_0x5be5aa||!_0x5be5aa['isVisible'])return;const _0x431804=this['_config']['getTargetElement']();if(!_0x431804)return;_0x5be5aa['pin']({'target':_0x431804,'limiter':this['_config']['getLimiterElement']()});const _0x31ec5c=this['_getResourcesViewFromBalloon'](_0x5be5aa);_0x31ec5c&&_0x31ec5c['updateResourceState'](_0x50e6bb,_0x590de1);}['destroy'](){for(const _0x1962be of this['_sourceResourceBalloons']['values']())_0x1962be['destroy']();this['_sourceResourceBalloons']['clear']();}['_createSourceResourceBalloonPanel'](){const _0xe00325=new Xt(this['_locale']);return _0xe00325['extendTemplate']({'attributes':{'class':Dr}}),this['_bodyCollection']['add'](_0xe00325),_0xe00325;}['_addSourceResourceContent']({balloonPanel:_0x578233,source:_0x233726,withBackButton:_0x2ff351}){_0x578233['content']['clear']();const _0x473fdc=this['_createBalloonHeader']({'balloonPanel':_0x578233,'source':_0x233726,'withBackButton':_0x2ff351});_0x578233['content']['add'](_0x473fdc);const _0x3485bf=this['_createBalloonResourcesView'](_0x233726);_0x578233['content']['add'](_0x3485bf);}['_createBalloonHeader']({balloonPanel:_0x2b62e2,source:_0x3932b5,withBackButton:_0x3cb22c}){const _0x429727=new _0x314748(this['_locale'],{'label':_0x3932b5['label'],'class':Hr});return _0x3cb22c&&_0x429727['children']['add'](this['_createBackButton'](_0x2b62e2),0x0),_0x429727;}['_createBackButton'](_0x301efe){const _0x3a0732=new Nt(this['_locale']);return _0x3a0732['set']({'icon':_0xf8587c,'tooltip':us(this['_locale'],'AI_CHAT_CONTEXT_URL_BACK_TO_CONTEXT'),'tooltipPosition':'n','class':Pr}),_0x3a0732['on']('execute',()=>{_0x301efe['hide'](),this['_config']['onBackToContext']();}),_0x3a0732;}['_createBalloonResourcesView'](_0x22cf9f){const _0x55d0d8=new Lr(this['_locale'],{'source':_0x22cf9f,'searchInputVisibleFrom':this['_config']['searchInputVisibleFrom']});return _0x55d0d8['on']('loadSourceResources',(_0x4aa7fe,_0x891b39)=>{this['_config']['onLoadSourceResources'](_0x891b39);}),_0x55d0d8['on']('addResourceToContext',(_0x3130d1,_0x5782d9)=>{this['_config']['onResourceSelected'](_0x5782d9['source'],_0x5782d9['resource']),this['closeSourceResourceBalloon'](_0x22cf9f['id']);}),_0x55d0d8;}['_getResourcesViewFromBalloon'](_0x167a1d){const _0x3997ee=_0x167a1d['content']['get'](0x1);return _0x3997ee instanceof Lr?_0x3997ee:null;}['_setupSingleResourceBalloonClickOutsideHandler'](_0x181d6e){zt({'emitter':_0x181d6e,'contextElements':[_0x181d6e['element']],'callback':()=>{_0x181d6e['hide'](),this['_config']['onBalloonClosed']();},'activator':()=>_0x181d6e['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(_0x4aef40,_0x151253){super(_0x4aef40),this['bodyCollection']=_0x151253['bodyCollection'],this['_currentContextsChips']=this['createCollection'](),this['_conversationContextsChips']=this['createCollection'](),this['addContextButtonView']=this['_createAddContextButtonView'](_0x4aef40),this['_addContextBalloonPanelView']=this['_createAddContextBalloonPanelView'](_0x4aef40),this['_urlBalloonPanelView']=this['_createUrlBalloonPanelView'](_0x4aef40),this['_resourcesBalloonView']=this['_createResourcesBalloonView'](_0x4aef40,_0x151253);const _0x1f0405={'cssClasses':{'showMoreButton':Qr+'\x20'+As,'showMoreBalloon':Xr,'overflowContainer':qr,'controlsButton':$r}};this['_overflowManager']=new Kn(_0x4aef40,this['_currentContextsChips'],_0x1f0405,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'](_0x49f1b9,_0x2fe34f){const _0x48b1d9=this['_createContextButton'](_0x49f1b9,'current',!0x0,_0x2fe34f);this['_addContextToCollection'](_0x48b1d9,this['_currentContextsChips']),this['_overflowManager']['reorganizeChips']();}['removeContextItem'](_0x5e42f1){this['_removeContextFromCollection'](_0x5e42f1,this['_currentContextsChips']),this['_removeContextFromCollection'](_0x5e42f1,this['_overflowManager']['overflowChips']),this['_overflowManager']['reorganizeChips']();}['setContextItemLoading'](_0x4d1081,_0x5cb7da){let _0x5216c9=this['_currentContextsChips']['find'](_0x3dc993=>_0x3dc993['id']===_0x4d1081);_0x5216c9||(_0x5216c9=this['_overflowManager']['overflowChips']['find'](_0x5442b5=>_0x5442b5['id']===_0x4d1081)),_0x5216c9&&(_0x5216c9['isLoading']=_0x5cb7da);}['setConversationContext'](_0x5352ca){this['_conversationContextsChips']['clear']();for(const _0x569db4 of _0x5352ca){const _0x527079=this['_createContextButton'](_0x569db4,'conversation',!0x1,!0x1);this['_addContextToCollection'](_0x527079,this['_conversationContextsChips']);}}['clearCurrentContextItems'](){this['_currentContextsChips']['clear'](),this['_overflowManager']['clear']();}['clearConversationContextItems'](){this['_conversationContextsChips']['clear']();}['updateResourceState'](_0x430b7b,_0x443d2e,_0x2de432){this['_resourcesBalloonView']['updateResourceState'](_0x430b7b,_0x443d2e,_0x2de432);}['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:_0x512e50,withBackButton:_0x39228a}){this['_resourcesBalloonView']['showSourceResourcesBalloon']({'source':_0x512e50,'withBackButton':_0x39228a}),this['addContextButtonView']['isOn']=!0x0;}['populateSourceResourceBalloon'](_0x12cbe7,_0x3bd5b7,_0x43fb18,_0x41db9a){this['_resourcesBalloonView']['populateSourceResourceBalloon'](_0x12cbe7,_0x43fb18,_0x41db9a);}['closeSourceResourceBalloon'](_0x43bdb8){this['_resourcesBalloonView']['closeSourceResourceBalloon'](_0x43bdb8),this['addContextButtonView']['isOn']=!0x1;}['setAddContextOptions'](_0x1c2ad8){this['_setBalloonPanelContent'](this['_addContextBalloonPanelView'],this['locale'],_0x1c2ad8),this['_setAddContextButtonEnabled'](_0x1c2ad8);}['_setAddContextButtonEnabled'](_0x1db744){const _0x45da8c=!_0x1db744['document']['isHidden']&&_0x1db744['document']['enabled'],_0x13e1bc=_0x1db744['urls']['enabled'],_0x3afad3=_0x1db744['files']['enabled'],_0x127a27=_0x1db744['sources']['length']>0x0,_0x3cb8f9=_0x1db744['customItems']&&_0x1db744['customItems']['length']>0x0;this['addContextButtonView']['isEnabled']=_0x45da8c||_0x13e1bc||_0x3afad3||_0x127a27||_0x3cb8f9;}['_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'](_0x1ed3dd){const _0x3bbd1d=new Nt(_0x1ed3dd);return _0x3bbd1d['set']({'label':us(_0x1ed3dd,'AI_CHAT_CONTEXT_ADD_CONTEXT'),'class':$r+'\x20'+Fr+'\x20'+As,'icon':_0x504bdc,'isToggleable':!0x0,'tooltip':!0x0,'tooltipPosition':'sw'}),_0x3bbd1d;}['_createAddContextBalloonPanelView'](_0x24b2d0){return this['_createBaseBalloonPanel'](_0x24b2d0,Gr);}['_createUrlBalloonPanelView'](_0x26484b){const _0x584a90=this['_createBaseBalloonPanel'](_0x26484b,Kr);return this['_addUrlContent'](_0x584a90,_0x26484b),_0x584a90;}['_createResourcesBalloonView'](_0x5e926f,_0x40dba3){const _0x59e2d3={'searchInputVisibleFrom':_0x40dba3['searchInputVisibleFrom'],'onBackToContext':()=>{this['showAddContextBalloonPanel'](),this['_addContextBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':jr});},'onResourceSelected':(_0x29467c,_0x54bc7f)=>{this['fire']('addResourceToContext',{'source':_0x29467c,'resource':_0x54bc7f});},'onLoadSourceResources':_0xb49865=>{this['fire']('loadSourceResources',_0xb49865);},'onBalloonClosed':()=>{this['addContextButtonView']['isOn']=!0x1;},'getLimiterElement':()=>this['_getLimiterElement'](),'getTargetElement':()=>this['addContextButtonView']['element']};return new Mr(_0x5e926f,_0x40dba3['bodyCollection'],_0x59e2d3);}['_getLimiterElement'](){return this['element']?.['closest']('.'+zr)||document['body'];}['_createBaseBalloonPanel'](_0x196523,_0x32ace8){const _0x1a0120=new Xt(_0x196523);return _0x1a0120['extendTemplate']({'attributes':{'class':_0x32ace8}}),this['bodyCollection']['add'](_0x1a0120),_0x1a0120;}['_setBalloonPanelContent'](_0x4a9996,_0x3ebd68,_0x57989c){if(_0x4a9996['content']['clear'](),!_0x57989c['document']['isHidden']&&_0x57989c['document']['enabled']){const _0x6ad52b=this['_createBalloonButton'](_0x3ebd68,{'label':us(_0x3ebd68,'AI_CHAT_CONTEXT_CURRENT_DOCUMENT'),'icon':_0x14afda});_0x6ad52b['on']('execute',()=>{this['fire']('addDocumentToContext'),this['hideAddContextBalloonPanel']();}),_0x4a9996['content']['add'](_0x6ad52b);}if(_0x57989c['urls']['enabled']){const _0x5b6f24=this['_createBalloonButton'](_0x3ebd68,{'label':us(_0x3ebd68,'AI_CHAT_CONTEXT_URL_LABEL'),'icon':_0x56a18a});_0x5b6f24['on']('execute',()=>{this['hideAddContextBalloonPanel'](),this['showUrlBalloonPanel'](),this['_urlBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':jr}),this['_urlInputView']['focus']();}),_0x4a9996['content']['add'](_0x5b6f24);}if(_0x57989c['files']['enabled']){const _0x12905e=new _0x3d4235(_0x3ebd68);_0x12905e['set']({'label':us(_0x3ebd68,'AI_CHAT_CONTEXT_FILE_LABEL'),'icon':_0x209963,'withText':!0x0,'tooltip':!0x0,'class':Wr,'allowMultipleFiles':!0x0}),_0x12905e['on']('execute',()=>{this['hideAddContextBalloonPanel']();}),_0x12905e['on']('done',(_0x5eea82,_0x1987ac)=>{this['fire']('addFileToContext',_0x1987ac);}),_0x12905e['tooltip']=!0x0,_0x4a9996['content']['add'](_0x12905e);}for(const _0x47da6b of _0x57989c['sources']){const _0x418ed6=this['_createBalloonButton'](_0x3ebd68,{'label':_0x47da6b['label'],'icon':_0x47da6b['icon']||_0x14798d,'type':'source'});_0x4a9996['content']['add'](_0x418ed6),_0x418ed6['on']('execute',()=>{this['hideAddContextBalloonPanel'](),this['_showSourceResourcesBalloon']({'source':_0x47da6b,'withBackButton':!this['_hasExactlyOneSource']});});}for(const _0x29818e of _0x57989c['customItems']||[]){const _0x1f4d8b=this['_createBalloonButton'](_0x3ebd68,{'label':_0x29818e['label'],'icon':_0x29818e['icon']||_0x14798d,'type':'customItem'});_0x4a9996['content']['add'](_0x1f4d8b),_0x1f4d8b['on']('execute',()=>{this['hideAddContextBalloonPanel'](),this['fire']('executeCustomItemCallback',_0x29818e);});}this['_hasExactlyOneSource']=0x1===_0x4a9996['content']['length'],this['_urlInputView']['withBackButton']=!this['_hasExactlyOneSource'];}['_addUrlContent'](_0x53288d,_0x5da5b2){this['_urlInputView']=new Sr(_0x5da5b2),this['_urlInputView']['on']('submitUrl',(_0x404db5,_0x4c0091)=>{this['_handleUrlSubmit'](_0x4c0091);}),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});}),_0x53288d['content']['add'](this['_urlInputView']);}['_createBalloonButton'](_0x2dec79,_0x5f1c08){const _0x59b48e='source'===_0x5f1c08['type']?new Zr(_0x2dec79):new Nt(_0x2dec79);return _0x59b48e['set']({'label':_0x5f1c08['label'],'icon':_0x5f1c08['icon'],'withText':!0x0,'tooltip':!0x0,'tooltipPosition':'sw','class':Wr}),_0x59b48e;}['_setupAllBalloonClickOutsideHandlers'](){this['_setupAddContextBalloonClickOutsideHandler'](),this['_setupUrlBalloonClickOutsideHandler']();}['_setupUrlBalloonClickOutsideHandler'](){zt({'emitter':this['_urlBalloonPanelView'],'contextElements':[this['_urlBalloonPanelView']['element']],'callback':()=>{this['hideUrlBalloonPanel']();},'activator':()=>this['_urlBalloonPanelView']['isVisible']});}['_toggleAddContextBalloon'](_0x5ab6f5){const _0x2ce005=this['_addContextBalloonConfig'];_0x2ce005['buttonView']['isOn']=_0x5ab6f5,_0x5ab6f5?_0x2ce005['balloonView']['show']():_0x2ce005['balloonView']['hide']();}['_setupAddContextBalloonClickOutsideHandler'](){const {balloonView:_0xf11abf,buttonView:_0x273048,hideMethod:_0xcff5e2}=this['_addContextBalloonConfig'];zt({'emitter':_0xf11abf,'contextElements':[_0xf11abf['element'],_0x273048['element']],'callback':()=>{_0xcff5e2();},'activator':()=>_0x273048['isOn']&&!this['_urlBalloonPanelView']['isVisible']&&!this['_resourcesBalloonView']['isAnyResourceBalloonVisible']()});}['_createContextButton'](_0x1a77ce,_0x295fb3,_0x518297=!0x1,_0x5792e8=!0x1){const _0x423ea9='conversation'===_0x295fb3||!0x0===_0x1a77ce['isReadOnly'],_0x25e57d=new Vn(this['locale'],_0x1a77ce,_0x423ea9,_0x518297,_0x5792e8);return _0x423ea9||_0x25e57d['on']('removeContextItemChip',()=>{this['fire']('removeContextItem',_0x25e57d['id']);}),_0x25e57d;}['_addContextToCollection'](_0x52b08c,_0x171ea2){_0x171ea2['add'](_0x52b08c,0x0);}['_removeContextFromCollection'](_0xd21a5,_0x197c69){const _0x148cf5=_0x197c69['find'](_0x6e5239=>_0x6e5239['id']===_0xd21a5);_0x148cf5&&_0x197c69['remove'](_0x148cf5);}['_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'](_0x2e16d7){this['_urlInputView']['clear'](),this['hideUrlBalloonPanel'](),this['fire']('addUrlToContext',_0x2e16d7);}}class Zr extends Nt{['arrowView'];constructor(_0x442f63){super(_0x442f63),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 _0x4948ce=new xt();return _0x4948ce['content']=_0x54e08c,_0x4948ce['extendTemplate']({'attributes':{'class':Yr+'__arrow'}}),_0x4948ce;}}class ta extends vt{['_cancelButtonView'];['_loaderView'];constructor(_0x16e24e){super(_0x16e24e),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 _0x245de1=new Nt(this['locale']);return _0x245de1['set']({'label':us(this['locale'],'AI_CHAT_STOP_GENERATING'),'withText':!0x0,'class':_s+'\x20ck-ai-button-stop-generating','icon':_0x2f6727}),_0x245de1['on']('execute',()=>{this['fire']('abortPromptStream');}),_0x245de1;}['_createLoaderView'](){const _0x583291=new vt(this['locale']);return _0x583291['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')}]}),_0x583291;}}class ea extends vt{['_contextPanelView'];['_promptInputView'];['_promptCapabilitiesView'];['_loaderView'];['_modelUnavailableMessageView'];['_shouldRestorePromptInputFocus'];constructor(_0x551027,_0x16a93b){super(_0x551027),this['_contextPanelView']=this['_createContextPanelView'](_0x551027,{'bodyCollection':_0x16a93b['bodyCollection'],'searchInputVisibleFrom':_0x16a93b['contextResourcesSearchInputVisibleFrom']}),this['_promptInputView']=this['_createPromptInputView'](_0x551027),this['_promptCapabilitiesView']=this['_createPromptCapabilitiesView'](_0x551027),this['_loaderView']=this['_createLoaderView'](_0x551027),this['_modelUnavailableMessageView']=this['_createModelUnavailableMessageView'](_0x551027),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 _0x146cc9=this['bindTemplate'];this['setTemplate']({'tag':'form','attributes':{'class':['ck','ck-ai-chat-controls',_0x146cc9['if']('isDisabled','ck-ai-chat-controls-disabled')]},'children':[{'tag':'div','attributes':{'class':[_0x146cc9['if']('isLoading','ck-hidden',_0x854dd6=>_0x854dd6||!this['isModelAvailable']),_0x146cc9['if']('isModelAvailable','ck-hidden',_0x59d51e=>!_0x59d51e||this['isLoading'])]},'children':[this['_contextPanelView'],this['_promptInputView'],this['_promptCapabilitiesView']]},{'tag':'div','attributes':{'class':[_0x146cc9['if']('isLoading','ck-hidden',_0x54180d=>!_0x54180d)]},'children':[this['_loaderView']]},{'tag':'div','attributes':{'class':[_0x146cc9['if']('isModelAvailable','ck-hidden',_0x12c453=>_0x12c453)]},'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'](_0x2a189a,_0x4c796f){return new Jr(_0x2a189a,_0x4c796f);}['_createPromptInputView'](_0x550b69){return new lr(_0x550b69,this['_contextPanelView']['addContextButtonView']);}['_createPromptCapabilitiesView'](_0x5e9410){return new Tr(_0x5e9410);}['_createLoaderView'](_0x2e0c74){return new ta(_0x2e0c74);}['_createModelUnavailableMessageView'](_0x11e817){const _0x48a1d7=new ia(_0x11e817);return _0x48a1d7['delegate']('startConversation')['to'](this),_0x48a1d7;}['_handlePromptInputFocus'](_0x2f1e3a,_0x289e21,_0xbba11d){_0xbba11d?this['_shouldRestorePromptInputFocus']=!0x0:this['_shouldRestorePromptInputFocus']&&this['_promptInputView']['focus']();}['addContextItem'](_0x565d0d,_0x5e3a00){this['_contextPanelView']['addContextItem'](_0x565d0d,_0x5e3a00);}['removeContextItem'](_0x21d47b){this['_contextPanelView']['removeContextItem'](_0x21d47b);}['setContextItemLoading'](_0x150b8a,_0x3b466e){this['_contextPanelView']['setContextItemLoading'](_0x150b8a,_0x3b466e);}['setIsUploadInProgress'](_0x4e4636){this['_promptInputView']['setIsUploadInProgress'](_0x4e4636);}['setConversationContext'](_0x3c67a6){this['_contextPanelView']['setConversationContext'](_0x3c67a6);}['clearPendingContextUI'](){this['_contextPanelView']['clearCurrentContextItems']();}['clearConversationContextUI'](){this['_contextPanelView']['clearConversationContextItems']();}['updateResourceState'](_0x1ad332,_0x44959d,_0x28cb25){this['_contextPanelView']['updateResourceState'](_0x1ad332,_0x44959d,_0x28cb25);}['setWebSearch'](_0x1a78fc){this['_promptCapabilitiesView']['setWebSearch'](_0x1a78fc);}['setReasoning'](_0x1f4807){this['_promptCapabilitiesView']['setReasoning'](_0x1f4807);}['resetMessageInput'](){this['_promptInputView']['reset']();}['setAddContextOptions'](_0x21ebf8){this['_contextPanelView']['setAddContextOptions'](_0x21ebf8);}['setInputPlaceholder'](_0x5d31e1){this['_promptInputView']['setPlaceholderText'](_0x5d31e1);}['setModelList'](_0x2dfd65,_0x587c41){this['_promptCapabilitiesView']['setModelList'](_0x2dfd65,_0x587c41);}['setModel'](_0x5ae461){_0x5ae461?(this['isModelAvailable']=!0x0,this['_promptCapabilitiesView']['setModel'](_0x5ae461)):this['isModelAvailable']=!0x1;}['enableModelSelector'](){this['_promptCapabilitiesView']['enableModelSelector']();}['disableModelSelector'](_0x30fd46){this['_promptCapabilitiesView']['disableModelSelector'](_0x30fd46);}['populateSourceResourceBalloon'](_0x3475b1,_0x45a494,_0x525453,_0x56ca70){this['_contextPanelView']['populateSourceResourceBalloon'](_0x3475b1,_0x45a494,_0x525453,_0x56ca70);}['closeSourceResourceBalloon'](_0x4d2aee){this['_contextPanelView']['closeSourceResourceBalloon'](_0x4d2aee);}['focusPromptInput'](_0x2bf635=!0x1){this['_promptInputView']['focus'](_0x2bf635);}['setPromptInputValue'](_0x3b2046){this['_promptInputView']['queryView']['fieldView']['reset'](),this['_promptInputView']['queryView']['fieldView']['value']=_0x3b2046;}}class ia extends vt{constructor(_0x2d0b8c){super(_0x2d0b8c);const _0x299d1d=new Nt(_0x2d0b8c);_0x299d1d['set']({'label':us(this['locale'],'AI_CHAT_MODEL_UNAVAILABLE_MESSAGE_BUTTON'),'withText':!0x0,'class':['ck-ai-chat-controls__start-new-chat-button'],'tooltip':''}),_0x299d1d['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'},_0x299d1d]}]});}}class sa extends _0x314748{['conversationStartButton'];['resizeButton'];constructor(_0x4de7fc,_0x52fa66){super(_0x4de7fc,{'label':us(_0x4de7fc,'AI_CHAT_HEADING'),'class':'ck-ai-header\x20ck-ai-header_chat','icon':_0x2150e3}),this['set']('isMaximized',!0x1),this['conversationStartButton']=this['_createStartConversationButton'](_0x4de7fc),this['children']['add'](this['conversationStartButton']),_0x52fa66&&(this['resizeButton']=gs(_0x4de7fc,this),this['children']['add'](this['resizeButton']));}['_createStartConversationButton'](_0x22a681){const _0x578b91=new Nt(_0x22a681);return _0x578b91['set']({'label':us(this['locale'],'AI_CHAT_LABEL_NEW_CHAT'),'withText':!0x0,'icon':_0x570dd7,'class':'ck-ai-chat__start-conversation\x20'+_s}),_0x578b91['on']('execute',()=>{this['fire']('startConversation');}),_0x578b91;}}class na extends vt{constructor(_0x42ce72){super(_0x42ce72),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-disclaimer']},'children':[{'tag':'p','attributes':{'class':['ck','ck-ai-disclaimer__content']},'children':[{'text':us(_0x42ce72,'AI_DISCLAIMER_TEXT')}]}]});}}class ra extends vt{['chatHeader'];['chatFeed'];['chatControls'];['chatDisclaimer'];['_bodyCollection'];constructor(_0x409f09,_0x170d5f){super(_0x409f09),this['_bodyCollection']=new Qt(_0x409f09),this['_bodyCollection']['attachToDom'](),this['chatHeader']=new sa(_0x409f09,_0x170d5f['showResizeButton']),this['chatHeader']['delegate'](...sn)['to'](this),this['chatFeed']=new or(_0x409f09,this['_bodyCollection']),this['chatFeed']['delegate'](...sn)['to'](this),this['chatControls']=new ea(_0x409f09,{'bodyCollection':this['_bodyCollection'],'contextResourcesSearchInputVisibleFrom':_0x170d5f['contextResourcesSearchInputVisibleFrom']}),this['chatControls']['delegate'](...sn)['to'](this),this['chatDisclaimer']=new na(_0x409f09),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset_all','ck-ai-chat','ck-rounded-corners'],'dir':_0x409f09['uiLanguageDirection']},'children':[this['chatHeader'],this['chatFeed'],this['chatControls'],this['chatDisclaimer']]});}['populateSourceResourceBalloon'](_0xda8c6d,_0x1f00ba,_0x45e5d1,_0x4f9a88){this['chatControls']['populateSourceResourceBalloon'](_0xda8c6d,_0x1f00ba,_0x45e5d1,_0x4f9a88);}['closeSourceResourceBalloon'](_0x2dbe17){this['chatControls']['closeSourceResourceBalloon'](_0x2dbe17);}['destroy'](){this['_bodyCollection']['detachFromDom'](),super['destroy']();}}class aa extends _0x4c3ee6{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(_0x2a9632){super(_0x2a9632);const _0x173596=this['context']['plugins']['get']('AITabs');this['set']('isBusy',!0x1),this['_promiseQueue']=new mn(),this['_view']=new ra(this['context']['locale'],{'showResizeButton':_0x173596['showResizeButton'],'contextResourcesSearchInputVisibleFrom':this['context']['config']['get']('ai.chat.context.searchInputVisibleFrom')}),this['_view']['delegate'](...sn)['to'](this),this['_view']['on']('toggleSuggestionDisplayMode',(_0x45d122,{showDiff:_0x319319})=>{this['showDiff']=_0x319319;}),_0x173596['view']['addTab']({'id':'chat','buttonLabel':us(this['context']['locale'],'AI_CHAT_HEADING'),'buttonIcon':_0x2150e3,'order':0x0,'content':this['_view']}),this['_view']['chatControls']['bind']('isLoading')['to'](this,'isBusy',_0x385c43=>_0x385c43),this['_view']['chatFeed']['bind']('isPending')['to'](this,'isBusy',_0x576327=>_0x576327),this['_view']['chatControls']['setInputPlaceholder'](this['_getInputPlaceholder']()),this['bind']('isModelAvailable')['to'](this['_view']['chatControls'],'isModelAvailable');}['destroy'](){super['destroy'](),this['_titleAnimationInterval']&&clearInterval(this['_titleAnimationInterval']);}['createConversation'](_0x3cdd75){const _0x28184d=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'](_0x3cdd75['availableModels'],!this['context']['config']['get']('ai.models.showModelSelector')),this['addFeedItemStaticMessage']({'id':'conversation-start','staticMessage':_0x28184d}),this['fire']('conversationCreated');}async['addFeedItemStaticMessage']({id:_0x4a94e4,staticMessage:_0x94fa5b}){return this['_promiseQueue']['enqueue'](async()=>{this['_view']['chatFeed']['addItem']('ai-reply',{'id':_0x4a94e4,'initialContent':'<p>'+_0x94fa5b+'</p>'});});}async['addFeedItemUserMessage'](_0x11c86d){const _0x281460=_0x11c86d['attributes']?.['displayedPrompt']||_0x11c86d['userMessage'];return this['_promiseQueue']['enqueue'](async()=>{this['_view']['chatFeed']['addItem']('user-message',{'contextItems':Array['from'](_0x11c86d['contextItems']['values']()),'initialContent':'<p>'+_0x281460+'</p>','id':_0x11c86d['id']});});}async['addFeedItemError']({errorMessage:_0x386cc4,id:_0x575479}){return this['_promiseQueue']['enqueue'](async()=>{this['_view']['chatFeed']['addItem']('error-message',{'initialContent':'<p>'+_0x386cc4+'</p>','id':_0x575479});});}async['addFeedItemAIReply'](_0x597d26){return this['_promiseQueue']['enqueue'](async()=>{this['_view']['chatFeed']['addItem']('ai-reply',{'id':_0x597d26['interactionId']+':'+_0x597d26['id']}),this['clearLoadingMessage']();});}async['addFeedItemAISuggestion'](_0x3ccbb1){const _0x1deacd=Xs(this['context']);let _0x2a1f22=_0x1deacd['config']['get']('ai.availableReplyActions')||[...wn];if(_0x1deacd['plugins']['has']('TrackChanges')){if(!this['_isTrackChangesCommandValueBound']){this['_isTrackChangesCommandValueBound']=!0x0;const _0x2fac93=_0x1deacd['commands']['get']('trackChanges');this['_view']['chatFeed']['bind']('isTrackChangesOn')['to'](_0x2fac93,'value');}}else _0x2a1f22=_0x2a1f22['filter'](_0x1d4c9a=>'insertSuggestion'!=_0x1d4c9a);return this['_promiseQueue']['enqueue'](async()=>{this['_view']['chatFeed']['addItem']('ai-suggestion-reply',{'id':_0x3ccbb1['interactionId']+':'+_0x3ccbb1['id'],'areActionsDisabled':_0x3ccbb1['areActionsDisabled'],'showDiff':this['showDiff'],'availableActions':_0x2a1f22}),this['clearLoadingMessage']();});}async['addFeedInteractionHeader'](_0x58a62d,_0x1364e9){return this['_promiseQueue']['enqueue'](async()=>{const _0x40e11f=this['_view']['chatFeed']['children']['last'];if(_0x40e11f instanceof Jn)return this['_view']['chatFeed']['children']['remove'](_0x40e11f),void this['_view']['chatFeed']['addItem']('interaction-header',{'id':_0x58a62d['id'],'capabilities':{'isWebSearchEnabled':_0x40e11f['capabilities']['isWebSearchEnabled']||_0x1364e9['isWebSearchEnabled'],'isReasoningEnabled':_0x40e11f['capabilities']['isReasoningEnabled']||_0x1364e9['isReasoningEnabled']}});this['_view']['chatFeed']['addItem']('interaction-header',{'id':_0x58a62d['id'],'capabilities':_0x1364e9});});}async['addFeedItemCustomElement'](_0x58f5cc,_0x59866c){let _0x2b75ca;return await this['_promiseQueue']['enqueue'](async()=>{_0x2b75ca=this['_view']['chatFeed']['addItem']('custom-element',{'content':_0x58f5cc,'id':_0x59866c});}),_0x2b75ca;}['removeFeedItem'](_0xf1980a){this['_view']['chatFeed']['removeItem'](_0xf1980a);}['hasFeedItem'](_0x59b296){return this['_view']['chatFeed']['hasItem'](_0x59b296);}['updateFeedInteractionHeader'](_0x5a8347){const _0x1e0c04=this['_view']['chatFeed']['children']['find'](_0x27a436=>_0x27a436['options']['id']==_0x5a8347['id']&&_0x27a436 instanceof Jn);_0x1e0c04&&_0x1e0c04['set']('isVisible',_0x5a8347['isVisible']);}async['updateFeedItemAIReplyContent'](_0x487344){const _0x41e45d=_0x487344['renderingStrategy']||this['feedItemRenderingStrategy'];return this['_promiseQueue']['enqueue'](async _0x406a8f=>{await this['_view']['chatFeed']['updateReplyItem']({..._0x487344,'abortSignal':_0x406a8f,'renderingStrategy':_0x41e45d}),_0x487344['isDone']&&this['markFeedItemAsDone'](_0x487344['id']);});}['updateFeedItemAIReplySources'](_0x1ee22c,_0x2466a5){this['_view']['chatFeed']['updateWebSources'](_0x1ee22c,_0x2466a5);}async['updateFeedItemAIReplySuggestionContent'](_0x39015b){const _0x2ddbcf=_0x39015b['renderingStrategy']||this['feedItemRenderingStrategy'];return this['_promiseQueue']['enqueue'](async _0x44acb9=>{await this['_view']['chatFeed']['updateSuggestionItem']({..._0x39015b,'abortSignal':_0x44acb9,'renderingStrategy':_0x2ddbcf}),_0x39015b['isDone']&&this['markFeedItemAsDone'](_0x39015b['id']);});}['updateFeedItemAIReplySuggestionPartState'](_0x4e7166){this['_view']['chatFeed']['updateSuggestionPartState'](_0x4e7166);}['setFeedItemAIReplySuggestionPartActive'](_0xf800dd){this['_view']['chatFeed']['setSuggestionPartActive'](_0xf800dd);}['markFeedItemAsDone'](_0x3f5c79){this['_view']['chatFeed']['markItemAsDone'](_0x3f5c79);}['removeFeedInteraction'](_0x16e444){this['_view']['chatFeed']['getItemIds']()['filter'](_0x3d562e=>_0x3d562e['startsWith'](_0x16e444))['forEach'](_0x5cdc2a=>this['_view']['chatFeed']['removeItem'](_0x5cdc2a));}['startInteraction'](){const _0x415057=this['prepareLoadingMessage']({'isWebSearchEnabled':!0x1,'isReasoningEnabled':!0x1});this['setLoadingMessage'](_0x415057),this['_view']['chatControls']['disableModelSelector'](!this['context']['config']['get']('ai.models.showModelSelector')),this['isBusy']=!0x0,this['_view']['chatFeed']['startAutoScroll']();}['stopInteraction'](_0xed3555){this['_promiseQueue']['abort'](),this['_view']['chatFeed']['getItemIds']()['filter'](_0x2ae743=>_0x2ae743['startsWith'](_0xed3555['id']))['forEach'](_0x49e9d5=>this['markFeedItemAsDone'](_0x49e9d5)),this['isBusy']=!0x1,this['_view']['chatFeed']['stopAutoScroll']();}async['finishInteraction'](){return this['_promiseQueue']['queueEmptyPromise']['then'](()=>{this['isBusy']=!0x1,this['_view']['chatFeed']['stopAutoScroll']();});}['addContextItem'](_0x55ab84,_0x255280){this['_view']['chatControls']['addContextItem'](_0x55ab84,_0x255280);}['removeContextItem'](_0x3658d8){this['_view']['chatControls']['removeContextItem'](_0x3658d8);}['setContextItemLoading'](_0x208600,_0x1fa424){this['_view']['chatControls']['setContextItemLoading'](_0x208600,_0x1fa424);}['setIsUploadInProgress'](_0x10f7d9){this['_view']['chatControls']['setIsUploadInProgress'](_0x10f7d9);}['setConversationContext'](_0x1543fe){this['_view']['chatControls']['setConversationContext'](_0x1543fe);}['clearPendingContextUI'](){this['_view']['chatControls']['clearPendingContextUI']();}['clearConversationContextUI'](){this['_view']['chatControls']['clearConversationContextUI']();}['updateResourceState'](_0x25be07,_0x3566cb,_0x4f4a6a){this['_view']['chatControls']['updateResourceState'](_0x25be07,_0x3566cb,_0x4f4a6a);}['resetMessageInput'](){this['_view']['chatControls']['resetMessageInput'](),this['_view']['chatControls']['setInputPlaceholder'](this['_getInputPlaceholder']());}['setAddContextOptions'](_0xb00571){this['_view']['chatControls']['setAddContextOptions'](_0xb00571);}['updateCapabilities'](_0x46add2){this['_view']['chatControls']['setWebSearch'](_0x46add2['isWebSearchEnabled']),this['_view']['chatControls']['setReasoning'](_0x46add2['isReasoningEnabled']),this['_view']['chatControls']['setInputPlaceholder'](this['_getInputPlaceholder'](_0x46add2));}['setSelectedModel'](_0x567fdf,_0x32d30a){this['_view']['chatControls']['setModel'](_0x567fdf),_0x32d30a&&this['_view']['chatControls']['disableModelSelector'](!0x1);}['setFeedItemRenderingStrategy'](_0x35fa5e){this['feedItemRenderingStrategy']=_0x35fa5e;}['toggleLoadingSkeleton'](_0x4cb7ef){this['_view']['chatFeed']['toggleLoadingSkeleton'](_0x4cb7ef);}['resetConversationTitle'](){this['setConversationTitle'](us(this['context']['locale'],'AI_CHAT_HEADING'));}['setConversationTitle'](_0x247f79,_0xd745b6=!0x1){if(_0xd745b6&&!bt()&&_0x247f79['length'])return this['_view']['chatHeader']['label']='',void this['_animateConversationTitle'](_0x247f79);this['_view']['chatHeader']['label']=_0x247f79;}['setLoadingMessage'](_0x218393){this['_view']['chatFeed']['setLoadingMessage'](_0x218393);}['clearLoadingMessage'](){this['_view']['chatFeed']['setLoadingMessage']('');}['_animateConversationTitle'](_0x4e6ddc){let _0x3a807e=0x0;clearInterval(this['_titleAnimationInterval']),this['_titleAnimationInterval']=setInterval(()=>{this['_view']['chatHeader']['label']=this['_view']['chatHeader']['label']+_0x4e6ddc[_0x3a807e],_0x3a807e++,_0x3a807e===_0x4e6ddc['length']&&clearInterval(this['_titleAnimationInterval']);},0x1e);}['setIsMaximized'](_0x14c389){this['_view']['chatHeader']['isMaximized']=_0x14c389;}['prepareLoadingMessage'](_0x43812d){return _0x43812d['isWebSearchEnabled']&&_0x43812d['isReasoningEnabled']?us(this['context']['locale'],'AI_CHAT_FEED_LOADING_MESSAGE_WEBSEARCH_REASONING'):_0x43812d['isWebSearchEnabled']?us(this['context']['locale'],'AI_CHAT_FEED_LOADING_MESSAGE_WEBSEARCH'):_0x43812d['isReasoningEnabled']?us(this['context']['locale'],'AI_CHAT_FEED_LOADING_MESSAGE_REASONING'):us(this['context']['locale'],'AI_CHAT_FEED_LOADING_MESSAGE_REGULAR');}['_getInputPlaceholder'](_0x543398){return _0x543398?_0x543398['isWebSearchEnabled']&&_0x543398['isReasoningEnabled']?us(this['context']['locale'],'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_WEBSEARCH_REASONING'):_0x543398['isWebSearchEnabled']?us(this['context']['locale'],'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_WEBSEARCH'):_0x543398['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'](_0x3563de,_0x59174f,_0x5081fa,_0x5365d1){this['_view']['populateSourceResourceBalloon'](_0x3563de,_0x59174f,_0x5081fa,_0x5365d1);}['closeSourceResourceBalloon'](_0xa456bc){this['_view']['closeSourceResourceBalloon'](_0xa456bc);}['setPromptInputValue'](_0x117c54){this['_view']['chatControls']['setPromptInputValue'](_0x117c54);}['focusPromptInput'](_0x410258=!0x1){this['_view']['chatControls']['focusPromptInput'](_0x410258);}['scrollFeedToSuggestion'](_0x385d17,_0x2db65d){this['_view']['chatFeed']['scrollToSuggestion'](_0x385d17,_0x2db65d);}['startAutoScroll'](){this['_view']['chatFeed']['startAutoScroll']();}['disableControls'](){this['_view']['chatControls']['isDisabled']=!0x0;}['enableControls'](){this['_view']['chatControls']['isDisabled']=!0x1;}}class oa extends Dt{['sections'];constructor(_0x32ec9b,_0x59cc0f){super(_0x32ec9b),this['sections']=_0x59cc0f,this['items']['addMany'](this['sections']),this['extendTemplate']({'attributes':{'class':['ck-ai-chat-history__sections']}});}['filter'](_0x4aa513){let _0x1638da=0x0,_0x28741e=0x0;for(const _0x3cb8bd of this['sections']){const {resultsCount:_0x29b4af,totalItemsCount:_0x58bc83}=_0x3cb8bd['filter'](_0x4aa513);_0x1638da+=_0x29b4af,_0x28741e+=_0x58bc83;}return{'resultsCount':_0x1638da,'totalItemsCount':_0x28741e};}}class ha extends Ht{['title'];['itemsViews'];['_itemsListView'];constructor(_0x5ef278,{title:_0x531e7d,items:_0x47f924}){super(_0x5ef278);const _0x3b5e39=this['bindTemplate'];this['set']('isVisible',!0x0),this['title']=_0x531e7d,this['itemsViews']=_0x47f924;const _0x4db5d6=new vt(_0x5ef278);_0x4db5d6['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-chat-history__section-title']},'children':[this['title']]}),this['_itemsListView']=new Dt(_0x5ef278),this['_itemsListView']['items']['addMany'](this['itemsViews']),this['setTemplate']({'tag':'li','attributes':{'class':['ck-ai-chat-history__section',_0x3b5e39['if']('isVisible','ck-hidden',_0x4edde0=>!_0x4edde0)]},'children':[_0x4db5d6,this['_itemsListView']]});}['filter'](_0x1ac258){const _0x82d930=this['itemsViews']['length'];let _0x55b379=0x0;for(const _0x11053a of this['itemsViews']){if(_0x1ac258){const _0x43b08f=_0x11053a['isMatching'](_0x1ac258);_0x11053a['isVisible']=!!_0x43b08f,_0x11053a['highlightText'](_0x1ac258);}else _0x11053a['isVisible']=!0x0,_0x11053a['highlightText'](null);_0x11053a['isVisible']&&_0x55b379++;}return this['isVisible']=_0x55b379>0x0,{'resultsCount':_0x55b379,'totalItemsCount':_0x82d930};}['getItem'](_0x408075){return this['itemsViews']['find'](_0x492010=>_0x492010['id']===_0x408075);}['removeItem'](_0x1aec5f){const _0x5b8549=this['itemsViews']['indexOf'](_0x1aec5f);-0x1!==_0x5b8549&&(this['itemsViews']['splice'](_0x5b8549,0x1),this['_itemsListView']['items']['remove'](_0x1aec5f));}}class ca extends/* #__PURE__ -- @preserve */
27
+ _0x28e9e9(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(_0x3898cf,_0x253cf8){super(_0x3898cf);const _0x11e47b=this['bindTemplate'];this['set']('isEdit',!0x1),this['set']('isVisible',!0x0),this['set']('pinned',!!_0x253cf8['pinned']),this['set']('loadingState',null),this['id']=_0x253cf8['id'];const {title:_0x2e6eaf,createdAt:_0x13d094,active:_0x4cfa3b=!0x1}=_0x253cf8;this['_titleView']=new _0x25931f(),this['_titleView']['text']=_0x2e6eaf,this['_titleView']['extendTemplate']({'attributes':{'class':['ck-ai-chat-history__item-title']}});const _0x477582=this['_createCheckView'](),_0x2be933=this['_createPinButtonView'](_0x3898cf),_0x518c3e=this['_createMenuDropdownView'](),_0x2f93b9=this['_createEditInputView'](_0x3898cf,_0x2e6eaf),_0x32e772=this['_createAcceptEditButtonView'](_0x3898cf,_0x2f93b9),_0x539379=this['_createCancelEditButtonView'](_0x3898cf,_0x2f93b9);this['actions']=this['createCollection'](),this['mainContent']=this['createCollection'](),this['mainContent']['add'](this['_titleView']),this['actions']['add'](_0x2be933),this['actions']['add'](_0x518c3e),this['on']('change:isEdit',(_0x4576ef,_0x3ba9af,_0x1b56f9)=>{this['actions']['clear'](),this['mainContent']['clear'](),_0x1b56f9?(this['actions']['add'](_0x32e772),this['actions']['add'](_0x539379),this['mainContent']['add'](_0x2f93b9),_0x2f93b9['element']['focus']()):(this['actions']['add'](_0x2be933),this['actions']['add'](_0x518c3e),this['mainContent']['add'](this['_titleView']));}),this['setTemplate']({'tag':'li','attributes':{'class':['ck-ai-chat-history__item',_0x4cfa3b?'ck-ai-chat-history__item--active':'',_0x11e47b['if']('isVisible','ck-hidden',_0x28afb1=>!_0x28afb1),_0x11e47b['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',_0x11e47b['if']('loadingState','ck-hidden',_0x56eea2=>!!_0x56eea2)]},'children':_0x4cfa3b?[_0x477582]:[]},{'tag':'div','attributes':{'class':['ck-ai-loader',_0x11e47b['if']('loadingState','ck-hidden',_0x3e3e09=>!_0x3e3e09)]},'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',_0x11e47b['if']('loadingState','ck-hidden',_0x3b216d=>!!_0x3b216d)]},'children':this['mainContent']},{'tag':'div','attributes':{'class':['ck-ai-loader__text',_0x11e47b['if']('loadingState','ck-hidden',_0xf2af0f=>!_0xf2af0f)]},'children':[{'text':_0x11e47b['to']('loadingState',_0x53dbec=>_0x53dbec?us(this['locale'],ca['LOADING_LABELS'][_0x53dbec]):'')}]}]},{'tag':'span','attributes':{'class':['ck-ai-chat-history__item-date']},'children':[_0x13d094]}]},{'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'](_0x161e8a){this['_titleView']['text']=_0xeac408(_0x161e8a);}['updateLoadingState'](_0x2c4a9f,_0xf81baf){this['set']('loadingState',_0xf81baf?_0x2c4a9f:null);}['_createCheckView'](){const _0x4988e0=new xt();return _0x4988e0['set']({'content':_0x389cff}),_0x4988e0;}['_createPinButtonView'](_0x33677f){const _0x4b656c=new Nt(_0x33677f);return _0x4b656c['set']({'label':us(_0x33677f,'AI_CHAT_HISTORY_PIN_BUTTON'),'icon':_0x21152c,'withText':!0x1,'tooltip':!0x0}),_0x4b656c['bind']('isOn')['to'](this,'pinned'),_0x4b656c['on']('execute',()=>{const _0x5e6c1a=!this['pinned'];this['fire']('setConversationPinned',{'id':this['id'],'pinned':_0x5e6c1a});}),_0x4b656c;}['_createMenuDropdownView'](){const _0x1b5662=Gt(this['locale'],_0x3d7cd2),_0x12c7db=_0x1b5662['panelView']['children'];_0x1b5662['buttonView']['set']({'label':us(this['locale'],'AI_CHAT_HISTORY_SHOW_MORE_ITEMS'),'icon':_0x51f94b}),_0x1b5662['panelPosition']='sw';const _0xbbb69b=new Nt(this['locale']);_0xbbb69b['label']=us(this['locale'],'AI_CHAT_HISTORY_EDIT_NAME'),_0xbbb69b['withText']=!0x0,_0xbbb69b['on']('execute',()=>{this['isEdit']=!0x0;});const _0x3591ba=new Nt(this['locale']);_0x3591ba['label']=us(this['locale'],'AI_CHAT_HISTORY_REMOVE'),_0x3591ba['withText']=!0x0,_0x3591ba['on']('execute',()=>{this['showConfirm'](us(this['locale'],'AI_CHAT_HISTORY_REMOVE_CONFIRM'),this['element'])['then'](()=>{this['fire']('removeConversation',{'id':this['id']});});});const _0x2e4ed8=new Dt(this['locale']),_0x3e176d=new Ht(this['locale']);_0x3e176d['children']['add'](_0xbbb69b);const _0x4dc869=new Ht(this['locale']);return _0x4dc869['children']['add'](_0x3591ba),_0x2e4ed8['items']['addMany']([_0x3e176d,_0x4dc869]),_0x12c7db['add'](_0x2e4ed8),_0x1b5662;}['_createEditInputView'](_0x31c752,_0x30134d){const _0x3b91c4=new _0x4f8412(_0x31c752),_0xf143f4=_0x3b91c4['bindTemplate'];return _0x3b91c4['value']=_0x30134d,_0x3b91c4['extendTemplate']({'on':{'keydown':_0xf143f4['to'](_0x3e62c7=>{'Enter'==_0x3e62c7['key']&&this['_commitEditInputValue'](_0x3b91c4);})}}),_0x3b91c4;}['_createAcceptEditButtonView'](_0x4855b5,_0x54cd3d){const _0x4d9b32=new Nt(_0x4855b5);return _0x4d9b32['set']({'icon':_0x389cff,'withText':!0x1,'tooltip':us(_0x4855b5,'AI_CHAT_HISTORY_ACCEPT')}),_0x4d9b32['extendTemplate']({'attributes':{'class':['ck-confirm-view-submit']}}),_0x4d9b32['on']('execute',()=>{this['_commitEditInputValue'](_0x54cd3d);}),_0x4d9b32;}['_commitEditInputValue'](_0x5bfd50){const _0xb35a34=_0x5bfd50['element']['value']||'';this['_titleView']['text']=_0xb35a34,this['isEdit']=!0x1,this['fire']('editConversationTitle',{'id':this['id'],'title':_0xb35a34});}['_createCancelEditButtonView'](_0x32b06d,_0x5f48a9){const _0x4cb0b4=new Nt(_0x32b06d);return _0x4cb0b4['set']({'icon':_0x117eb5,'withText':!0x1,'tooltip':us(_0x32b06d,'AI_CHAT_HISTORY_CANCEL')}),_0x4cb0b4['extendTemplate']({'attributes':{'class':['ck-confirm-view-cancel']}}),_0x4cb0b4['on']('execute',()=>{this['isEdit']=!0x1,_0x5f48a9['value']=this['_titleView']['text']||'',this['fire']('edit:cancel');}),_0x4cb0b4;}['_createSpinnerView'](){const _0x3aa262=new vn('tiny');return _0x3aa262['isVisible']=!0x0,_0x3aa262;}['isMatching'](_0x13eb61){return this['_titleView']&&'string'==typeof this['_titleView']['text']&&this['_titleView']['text']['match'](_0x13eb61)?{'title':!0x0}:null;}['highlightText'](_0x415655){this['_titleView']['highlightText'](_0x415655);}}class la extends vt{['searchView'];['mainErrorView'];['skeletonView'];['emptyView'];['sectionsView'];['resizeButton'];constructor(_0x13e19a,_0x396f21){super(_0x13e19a),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 _0x1d5f7f=new _0x314748(_0x13e19a,{'label':us(_0x13e19a,'AI_CHAT_HISTORY_HEADING'),'icon':_0x2581c0,'class':'ck-ai-header\x20ck-ai-header_history'});_0x396f21&&(this['resizeButton']=gs(_0x13e19a,this),_0x1d5f7f['children']['add'](this['resizeButton'])),this['sectionsView']=new oa(_0x13e19a,[]),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',_0x456274=>!_0x456274)]}}),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':[_0x1d5f7f,{'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 _0x54b404=new _0x20c15f(this['locale'],{'filteredView':this['sectionsView'],'queryView':{'label':us(this['locale'],'AI_CHAT_HISTORY_SEARCH_LABEL')},'infoView':{'text':{'notFound':{'primary':_0x1781be=>us(this['locale'],'AI_CHAT_HISTORY_SEARCH_NOT_FOUND_PRIMARY',_0x1781be),'secondary':us(this['locale'],'AI_CHAT_HISTORY_SEARCH_NOT_FOUND_SECONDARY')}}}}),_0x2cb02e=this['_createErrorView']();return _0x2cb02e['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('errorMessage','ck-hidden',_0x2ec8d8=>!_0x2ec8d8)]}}),_0x54b404['on']('render',()=>{_0x54b404['children']['add'](_0x2cb02e,0x1);}),_0x54b404['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isSearchViewVisible','ck-hidden',_0xab4bcb=>!_0xab4bcb)]}}),_0x54b404;}['_createSkeletonView'](){const _0xac50d6=new sr(this['locale'],nr['aiHistory']);return _0xac50d6['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isLoading','ck-hidden',_0x3be578=>!_0x3be578)]}}),_0xac50d6;}['_createErrorView'](){const _0x97facb=new vt(this['locale']),_0x4e9400=new Nt(this['locale']);_0x4e9400['set']({'withText':!0x1,'icon':_0x117eb5,'class':'ck-ai-notification_error__dismiss-button'}),_0x4e9400['bind']('isVisible')['to'](this,'hasItems',_0x5a1121=>!!_0x5a1121),_0x4e9400['on']('execute',()=>{this['errorMessage']='';});const _0x21e92c=this['bindTemplate'];return _0x97facb['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-notification','ck-ai-notification_error']},'children':[{'tag':'p','children':[{'text':_0x21e92c['to']('errorMessage')}]},_0x4e9400]}),_0x97facb;}['_createEmptyStateView'](){const _0x1f36f3=new Nt(this['locale']);_0x1f36f3['set']({'label':us(this['locale'],'AI_CHAT_LABEL_NEW_CHAT'),'withText':!0x0,'icon':_0x570dd7,'class':'ck-ai-chat__start-conversation\x20'+_s}),_0x1f36f3['on']('execute',()=>{this['fire']('openChat');});const _0x2bb5f1=new vt(this['locale']);return _0x2bb5f1['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-chat-history__empty',this['bindTemplate']['if']('isEmptyViewVisible','ck-hidden',_0x43b0ef=>!_0x43b0ef)]},'children':[{'tag':'p','attributes':{'class':['ck-ai-chat-history__empty-message']},'children':[us(this['locale'],'AI_CHAT_HISTORY_EMPTY_MESSAGE')]},_0x1f36f3]}),_0x2bb5f1;}['_createListItemViews'](_0x228e4d,_0x5e18dd){const _0x23641a=[];for(const _0x5685f4 of _0x228e4d){const _0x4a27b0=new ca(_0x5e18dd,_0x5685f4);_0x4a27b0['delegate'](...ua)['to'](this),_0x23641a['push'](_0x4a27b0);}return _0x23641a;}['updateHistoryItemsWithCategories'](_0x19c829){const _0x2881dd=this['locale']||'en',_0x1ea7c4=[];for(const _0x1c1d3e of _0x19c829){const _0x553044=this['_createListItemViews'](_0x1c1d3e['items'],_0x2881dd);_0x1ea7c4['push'](new ha(_0x2881dd,{'title':_0x1c1d3e['title'],'items':_0x553044}));}this['sectionsView']['sections']=_0x1ea7c4,this['sectionsView']['items']['clear'](),this['sectionsView']['items']['addMany'](_0x1ea7c4),this['hasItems']=_0x19c829['some'](_0x561bea=>_0x561bea['items']['length']>0x0),this['_refreshSearch']();}['removeHistoryItem'](_0x394cf9){for(const _0x54bf2a of this['sectionsView']['sections']){const _0x5b0e67=_0x54bf2a['getItem'](_0x394cf9);if(_0x5b0e67){if(_0x54bf2a['removeItem'](_0x5b0e67),0x0===_0x54bf2a['itemsViews']['length']){const _0x5b6391=this['sectionsView']['sections']['indexOf'](_0x54bf2a);-0x1!==_0x5b6391&&(this['sectionsView']['sections']['splice'](_0x5b6391,0x1),this['sectionsView']['items']['remove'](_0x54bf2a));}this['hasItems']=this['sectionsView']['sections']['length']>0x0,this['_refreshSearch']();break;}}}['updateItemTitle'](_0x1bdbd8,_0x488666){for(const _0x5142b4 of this['sectionsView']['sections']){const _0x3d78fa=_0x5142b4['getItem'](_0x1bdbd8);if(_0x3d78fa){_0x3d78fa['updateTitle'](_0x488666);break;}}}['updateItemLoadingState'](_0x2dcada,_0x124053,_0xe0bec5){for(const _0x7eba4c of this['sectionsView']['sections']){const _0xba7e82=_0x7eba4c['getItem'](_0x2dcada);if(_0xba7e82){_0xba7e82['updateLoadingState'](_0x124053,_0xe0bec5);break;}}}['_refreshSearch'](){if(this['hasItems']){const _0xa3b0f9=this['searchView']['queryView']['fieldView']?.['element']?.['value']||'';this['searchView']['search'](_0xa3b0f9);}}}const ua=['showConversationHistory','removeConversation','editConversationTitle','setConversationPinned','selectConversation','openChat','resizeTabs'];class da extends _0x4c3ee6{static get['requires'](){return[cs];}['_historyView'];static get['pluginName'](){return'AIChatHistoryUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x3338c1){super(_0x3338c1);const _0x10ddc1=this['context']['plugins']['get']('AITabs');this['_historyView']=new la(this['context']['locale'],_0x10ddc1['showResizeButton']),this['_historyView']['delegate'](...ua)['to'](this),_0x10ddc1['view']['addTab']({'id':'history','buttonLabel':us(this['context']['locale'],'AI_CHAT_HISTORY_HEADING'),'buttonIcon':_0x2581c0,'order':0x0,'content':this['_historyView']});}['removeHistoryItem'](_0x381b01){this['_historyView']['removeHistoryItem'](_0x381b01);}['updateItems'](_0x267f94){this['_historyView']['updateHistoryItemsWithCategories'](_0x267f94);}['updateItemTitle'](_0x4cf231,_0x3542a8){this['_historyView']['updateItemTitle'](_0x4cf231,_0x3542a8);}['updateItemLoadingState'](_0x3f420a,_0x2ccfb9,_0x2d08bf){this['_historyView']['updateItemLoadingState'](_0x3f420a,_0x2ccfb9,_0x2d08bf);}['setLoadingSkeleton'](_0x1efe01){this['_historyView']['isLoading']=_0x1efe01;}['showError'](_0x20f8cd){this['_historyView']['errorMessage']=_0x20f8cd;}['hideError'](){this['_historyView']['errorMessage']='';}['setIsMaximized'](_0x13a1a9){this['_historyView']['isMaximized']=_0x13a1a9;}}class _a extends ct(){['id'];['createdAt'];constructor({id:_0x491240,title:_0x4cf19c,createdAt:_0x5dadc7,updatedAt:_0x3f4da9,pinned:_0x4a9c26}){super(),this['id']=_0x491240,this['createdAt']=new Date(_0x5dadc7),this['set']('title',_0x4cf19c),this['set']('updatedAt',_0x3f4da9?new Date(_0x3f4da9):null),this['set']('pinned',_0x4a9c26||!0x1);}['updateTitle'](_0x2a3dd4){this['set']('title',_0xeac408(_0x2a3dd4)),this['updatedAt']=new Date();}['updatePinned'](_0x2b9560){this['set']('pinned',_0x2b9560),this['updatedAt']=new Date();}}class Aa extends pt(){['items']=[];['connector'];['group'];constructor({connector:_0x3dac9e,group:_0x286b35}){super(),this['connector']=_0x3dac9e,this['group']=_0x286b35;}async['init'](){try{const _0x2f514f=this['connector']['fetchConversations'](this['group']),_0x57eb75=await _0x2f514f['getConversations']();this['loadItems'](_0x57eb75);}catch(_0x42fe96){this['fire']('error',{'error':_0x42fe96,'operation':'init'});}}['addItem'](_0x78035a){this['items']['push'](_0x78035a);}async['removeItem'](_0x1e8c0c){const _0x44b192=this['items']['findIndex'](_0x28d334=>_0x28d334['id']===_0x1e8c0c);if(-0x1===_0x44b192)return!0x1;try{return await this['connector']['deleteConversation'](_0x1e8c0c)['execute'](),this['items']['splice'](_0x44b192,0x1),this['fire']('itemRemoved',{'itemId':_0x1e8c0c}),!0x0;}catch(_0x3bdd9d){return this['fire']('error',{'error':_0x3bdd9d,'operation':'removeItem','itemId':_0x1e8c0c}),!0x1;}}['getItem'](_0x5137c1){return this['items']['find'](_0x2c73d0=>_0x2c73d0['id']===_0x5137c1);}async['updateItemTitle'](_0x4212f4,_0x42e057){const _0x3a318b=this['getItem'](_0x4212f4);if(!_0x3a318b)return!0x1;try{return await this['connector']['updateConversation'](_0x4212f4,{'title':_0x42e057})['getResult'](),_0x3a318b['updateTitle'](_0x42e057),this['fire']('itemUpdated',{'itemId':_0x4212f4,'updates':{'title':_0x42e057}}),!0x0;}catch(_0x4dc7dd){return this['fire']('error',{'error':_0x4dc7dd,'operation':'updateItemTitle','itemId':_0x4212f4}),!0x1;}}async['updateItemPinned'](_0x30317d,_0x45a5a4){const _0x337d98=this['getItem'](_0x30317d);if(!_0x337d98)return!0x1;try{return await this['connector']['updateConversation'](_0x30317d,{'pinned':_0x45a5a4})['getResult'](),_0x337d98['updatePinned'](_0x45a5a4),this['fire']('itemUpdated',{'itemId':_0x30317d,'updates':{'pinned':_0x45a5a4}}),!0x0;}catch(_0x3d50fb){return this['fire']('error',{'error':_0x3d50fb,'operation':'updateItemPinned','itemId':_0x30317d}),!0x1;}}['loadItems'](_0x48527a){try{this['items']=[],_0x48527a['map'](_0x140da8=>{this['addItem'](new _a(_0x140da8));}),this['fire']('itemsLoaded',{'items':[...this['items']]});}catch(_0xa5da7a){this['fire']('error',{'error':_0xa5da7a,'operation':'loadItems'});}}['getItems'](_0x4d3203={}){const _0x4e5e30=void 0x0!==_0x4d3203['pinned']&&_0x4d3203['pinned'],_0x1e63e2=_0x4d3203['from']?new Date(_0x4d3203['from']['getFullYear'](),_0x4d3203['from']['getMonth'](),_0x4d3203['from']['getDate']()):null,_0xe9f481=_0x4d3203['to']?new Date(_0x4d3203['to']['getFullYear'](),_0x4d3203['to']['getMonth'](),_0x4d3203['to']['getDate']()):null;return this['items']['filter'](_0x51ec4d=>{if(_0x51ec4d['pinned']!==_0x4e5e30)return!0x1;if(_0xe9f481){const _0x541753=new Date(_0x51ec4d['createdAt']['getFullYear'](),_0x51ec4d['createdAt']['getMonth'](),_0x51ec4d['createdAt']['getDate']());return _0x1e63e2?_0x1e63e2['getTime']()===_0xe9f481['getTime']()?_0x541753['getTime']()===_0x1e63e2['getTime']():_0x541753<_0xe9f481&&_0x541753>=_0x1e63e2:_0x541753<_0xe9f481;}return!0x0;});}}class ga extends _0x4c3ee6{['_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 _0x3f663d=this['context']['plugins']['get'](cs);try{const _0x3bfc95=this['_aiChatController']['getGroupId']();this['history']=new Aa({'connector':this['_aiConnector'],'group':_0x3bfc95}),this['listenTo'](this['_aiChatHistoryUi'],'removeConversation',(_0x1b203d,_0x5d6f8e)=>{this['_setItemLoading'](_0x5d6f8e['id'],'remove'),this['_handleRemove'](_0x5d6f8e['id']);}),this['listenTo'](this['_aiChatHistoryUi'],'editConversationTitle',(_0x1386b4,_0x421c15)=>{this['_setItemLoading'](_0x421c15['id'],'rename'),this['_handleEditTitle'](_0x421c15['id'],_0x421c15['title']);}),this['listenTo'](this['history'],'itemUpdated',(_0x23db74,_0x3ed223)=>{void 0x0!==_0x3ed223['updates']['title']&&this['_aiChatHistoryUi']['updateItemTitle'](_0x3ed223['itemId'],_0x3ed223['updates']['title']),void 0x0!==_0x3ed223['updates']['pinned']&&this['_updateHistoryItemsUI'](),this['_clearItemLoading'](_0x3ed223['itemId']);}),this['listenTo'](this['history'],'itemRemoved',(_0x1b19d7,_0x58d370)=>{this['_aiChatController']['_handleRemovedConversation'](_0x58d370['itemId']),this['_aiChatHistoryUi']['removeHistoryItem'](_0x58d370['itemId']),this['_clearItemLoading'](_0x58d370['itemId']);}),this['listenTo'](this['history'],'itemsLoaded',()=>{this['_updateHistoryItemsUI']();}),this['listenTo'](this['history'],'error',(_0x2ccb19,_0x11a352)=>{this['_handleHistoryErrorUI'](_0x11a352['error'],_0x11a352['operation'],_0x11a352['itemId']);}),this['listenTo'](this['_aiChatHistoryUi'],'selectConversation',(_0x3ffae9,_0x3d3f47)=>{this['_handleSelectConversation'](_0x3d3f47['id']);}),this['listenTo'](this['_aiChatHistoryUi'],'setConversationPinned',(_0x399e52,_0x17fd61)=>{const _0x39c711=_0x17fd61['pinned']?'pin':'unpin';this['_setItemLoading'](_0x17fd61['id'],_0x39c711),this['_handleTogglePin'](_0x17fd61['id'],_0x17fd61['pinned']);}),this['listenTo'](this['_aiChatHistoryUi'],'openChat',()=>{_0x3f663d['view']['activateTab']('chat');}),this['listenTo'](this['_aiChatController'],'change:activeConversation',()=>{this['_updateHistoryItemsUI']();}),_0x3f663d['view']['on']('activateTab:history',()=>{this['_showConversationHistory']();}),this['listenTo'](_0x3f663d,'resizedTabs',(_0x171d7a,_0x495f90)=>{this['_setIsMaximized'](_0x495f90);}),this['listenTo'](this['_aiChatHistoryUi'],'resizeTabs',()=>{_0x3f663d['resize']();});}catch(_0x40d970){this['_handleHistoryErrorUI'](_0x40d970,'init');}}async['_handleEditTitle'](_0x300481,_0x283638){await this['history']['updateItemTitle'](_0x300481,_0x283638);}async['_handleTogglePin'](_0x42d122,_0x189296){await this['history']['updateItemPinned'](_0x42d122,_0x189296);}async['_handleRemove'](_0x47cac8){await this['history']['removeItem'](_0x47cac8);}async['_handleSelectConversation'](_0x1b57f5){await this['_aiChatController']['loadConversation'](_0x1b57f5);}async['_showConversationHistory'](){this['_aiChatHistoryUi']['showError'](''),this['_aiChatHistoryUi']['setLoadingSkeleton'](!0x0),await this['history']['init'](),this['_aiChatHistoryUi']['setLoadingSkeleton'](!0x1);}['_updateHistoryItemsUI'](){const _0x1f4f6a=this['_aiChatController']['activeConversation']?.['id'],_0x4e42bd=this['_getCategorizedItems']()['map'](_0x29cdc8=>({'title':_0x29cdc8['title'],'items':_0x29cdc8['items']['map'](_0x3ab451=>({'id':_0x3ab451['id'],'title':_0x3ab451['title']||us(this['context']['locale'],'AI_CHAT_UNTITLED_CONVERSATION'),'createdAt':new Date(_0x3ab451['createdAt'])['toLocaleDateString'](),'active':_0x3ab451['id']===_0x1f4f6a,'pinned':_0x3ab451['pinned']}))}));this['_aiChatHistoryUi']['updateItems'](_0x4e42bd);}['_setItemLoading'](_0x526be2,_0x288267){this['_aiChatHistoryUi']['updateItemLoadingState'](_0x526be2,_0x288267,!0x0);}['_clearItemLoading'](_0x59f4ff){this['_aiChatHistoryUi']['updateItemLoadingState'](_0x59f4ff,null,!0x1);}['_handleHistoryErrorUI'](_0x3eaa0d,_0x58f45e,_0x32c1b7){const _0x353984=this['_generateErrorMessage'](_0x58f45e,_0x32c1b7);this['_aiChatHistoryUi']['showError'](_0x353984),_0x32c1b7&&this['_clearItemLoading'](_0x32c1b7),this['_aiChatHistoryUi']['setLoadingSkeleton'](!0x1);}['_generateErrorMessage'](_0x3f914c,_0x34c571){const _0xba9c5c=_0x34c571?this['history']['getItem'](_0x34c571):null,_0x21678d=_0xba9c5c?.['title']||us(this['context']['locale'],'AI_CHAT_UNTITLED_CONVERSATION');switch(_0x3f914c){case'updateItemTitle':return us(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_UPDATE_TITLE',_0x21678d);case'updateItemPinned':{const _0xf53bd9=us(this['context']['locale'],_0xba9c5c?.['pinned']?'AI_CHAT_HISTORY_UNPIN_ACTION':'AI_CHAT_HISTORY_PIN_ACTION');return us(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_UPDATE_PINNED',[_0xf53bd9,_0x21678d]);}case'removeItem':return us(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_REMOVE_ITEM',_0x21678d);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 _0x1d52f3=new Date(),_0x3c881e=new Date(_0x1d52f3['getFullYear'](),_0x1d52f3['getMonth'](),_0x1d52f3['getDate']()),_0x175cef=new Date(_0x3c881e);_0x175cef['setDate'](_0x175cef['getDate']()-0x1);const _0x4f492c=new Date(_0x3c881e);_0x4f492c['setDate'](_0x4f492c['getDate']()-0xe);const _0x23f26a=this['history']['getItems']({'pinned':!0x0}),_0x27309f=this['history']['getItems']({'from':_0x3c881e,'to':_0x3c881e}),_0x2c4332=this['history']['getItems']({'from':_0x175cef,'to':_0x175cef}),_0x4ff7a4=this['history']['getItems']({'from':_0x4f492c,'to':_0x175cef}),_0x663144=this['history']['getItems']({'to':_0x4f492c}),_0x53cac8=[];return _0x23f26a['length']>0x0&&_0x53cac8['push']({'title':us(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_PINNED'),'items':_0x23f26a}),_0x27309f['length']>0x0&&_0x53cac8['push']({'title':us(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_TODAY'),'items':_0x27309f}),_0x2c4332['length']>0x0&&_0x53cac8['push']({'title':us(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_YESTERDAY'),'items':_0x2c4332}),_0x4ff7a4['length']>0x0&&_0x53cac8['push']({'title':us(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_LAST_14_DAYS'),'items':_0x4ff7a4}),_0x663144['length']>0x0&&_0x53cac8['push']({'title':us(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_LATER'),'items':_0x663144}),_0x53cac8;}['_setIsMaximized'](_0x1aa8f1){this['_aiChatHistoryUi']['setIsMaximized'](_0x1aa8f1);}}class Ia extends _0x4c3ee6{static get['requires'](){return[ga,da];}static get['pluginName'](){return'AIChatHistory';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}class Ea extends _0x4c3ee6{static get['requires'](){return[Js,tn,aa,Ia];}static get['pluginName'](){return'AIChat';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x25eedd){super(_0x25eedd),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(_0x376ec1,_0x4eb657){super(_0x376ec1);const {id:_0x3126d5,type:_0x318d2f,icon:_0x575627}=_0x4eb657;this['id']=_0x3126d5,this['set']({'label':_0x4eb657['label'],'withText':!0x0,'class':'ck-ai-chat-shortcut'}),this['extendTemplate']({'attributes':{'data-cke-ai-shortcut-id':_0x4eb657['id']}}),_0x575627?this['icon']=_0x575627:'chat'===_0x318d2f?this['icon']=_0x2150e3:'review'===_0x318d2f?this['icon']=_0x216df5:'translate'===_0x318d2f&&(this['icon']=_0x20d810);}}class Ta extends vt{['listView'];constructor(_0xfa55ba,_0x29dd56){super(_0xfa55ba);const _0x4cb86a=_0x29dd56['map'](_0x29c3fd=>{const _0x1d7c4c=new Ht(this['locale']),_0x1556ee=new pa(this['locale'],_0x29c3fd);return _0x1d7c4c['children']['add'](_0x1556ee),_0x1556ee['delegate']('execute')['to'](this),_0x1d7c4c;});this['listView']=new Dt(this['locale']),this['listView']['items']['addMany'](_0x4cb86a),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat-shortcuts']},'children':[this['listView']]});}}const ma='chat-shortcuts';var Ca=function(_0x29d39f){return _0x29d39f['CHAT']='chat',_0x29d39f['REVIEW']='review',_0x29d39f['TRANSLATE']='translate',_0x29d39f;}({});class wa extends _0x4c3ee6{['_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 _0x213d7e=this['context']['plugins']['get']('AIChatController');this['_shortcuts']['length']&&(this['_validateShortcuts'](),this['_aiChatUI']['on']('conversationCreated',()=>{_0x213d7e['activeConversation']['isFromHistory']||this['_injectShortcuts']();}),this['listenTo'](_0x213d7e,'interactionStarted',()=>{this['_removeShortcuts']();}));}['_validateShortcuts'](){const _0x55919f=Object['values'](Ca);this['_shortcuts']['forEach'](_0x31faaa=>{let _0x36fe2a=!0x0;if(_0x31faaa['id']&&_0x31faaa['label']&&_0x55919f['includes'](_0x31faaa['type'])?'chat'===_0x31faaa['type']&&(_0x36fe2a='string'==typeof _0x31faaa['prompt']):_0x36fe2a=!0x1,!_0x36fe2a)throw new ht('ai-chat-shortcuts-invalid-config',this['context'],{'shortcut':_0x31faaa});});}['_injectShortcuts'](){const _0x19cbd9=this['context']['plugins']['get'](aa);this['_shortcutsView']=new Ta(this['context']['locale'],this['_shortcuts']),this['_shortcutsView']['render'](),_0x19cbd9['addFeedItemCustomElement'](this['_shortcutsView']['element'],ma),this['_shortcutsView']['on']('execute',_0x3b12a8=>{const _0xf5c93=_0x3b12a8['source']['id'];this['_executeShortcut'](_0xf5c93);});}['_removeShortcuts'](){const _0x4d75ad=this['context']['plugins']['get'](aa);_0x4d75ad['hasFeedItem'](ma)&&_0x4d75ad['removeFeedItem'](ma),this['_shortcutsView']?.['destroy']();}['_executeShortcut'](_0x593c2e){const _0x2e3933=this['_shortcuts']['find'](_0x5c13f3=>_0x5c13f3['id']===_0x593c2e),_0x3a12a2=_0x2e3933['type'];'chat'===_0x3a12a2?this['_runChatShortcut'](_0x2e3933):'review'===_0x3a12a2?_0x2e3933['commandId']?this['_runReviewShortcut'](_0x2e3933):this['_switchTab']('reviewMode'):'translate'===_0x3a12a2&&(_0x2e3933['language']?this['_runTranslateShortcut'](_0x2e3933):this['_switchTab']('translate'));}['_switchTab'](_0x330ec7){if(!this['context']['plugins']['has']('AITabs'))throw new ht('ai-chat-shortcuts-ai-tabs-not-found',this['context'],{'tabName':_0x330ec7});this['context']['plugins']['get']('AITabs')['view']['activateTab'](_0x330ec7);}async['_runChatShortcut']({prompt:_0x479a34,draftMode:_0x4eb3f8,useWebSearch:_0x78b2e7=!0x1,useReasoning:_0x21ad98=!0x1,model:_0x201637}){const _0x4a1a66=this['context']['plugins']['get']('AIChatController'),_0x1ed1a4=_0x4a1a66['activeConversation'];let _0x2f7ae7;_0x2f7ae7=_0x201637?await _0x1ed1a4['chatModels']['getModel'](_0x201637):await _0x1ed1a4['chatModels']['getDefault'](),_0x2f7ae7&&await _0x1ed1a4['setModel'](_0x2f7ae7),_0x1ed1a4['setWebSearch'](_0x78b2e7),_0x1ed1a4['setReasoning'](_0x21ad98),_0x4a1a66['addCurrentDocumentToChatContext'](),_0x4eb3f8?(this['_aiChatUI']['setPromptInputValue'](_0x479a34),this['_aiChatUI']['focusPromptInput'](!0x0)):_0x4a1a66['sendMessage']({'message':_0x479a34});}['_runReviewShortcut']({commandId:_0x533cb6,model:_0x4b8d86,prompt:_0x4b7282,params:_0xe55c4a}){if(!this['context']['plugins']['has']('AIReviewModeUI'))throw new ht('ai-chat-shortcuts-review-mode-not-found',this['context']);this['_switchTab']('reviewMode');const _0x47d92f={'id':_0x533cb6,'isCustom':'custom'===_0x533cb6};_0x4b8d86&&_0x4b7282&&(_0x47d92f['args']={'model':_0x4b8d86,'prompt':_0x4b7282}),_0xe55c4a&&(_0x47d92f['params']=_0xe55c4a),this['context']['plugins']['get']('AIReviewModeUI')['fire']('runReviewCheck',_0x47d92f);}['_runTranslateShortcut']({language:_0x1e7943}){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':_0x1e7943,'args':{'language':_0x1e7943}});}}class fa extends _0x1e6161{constructor(_0x180412){super(_0x180412);const _0x11d138=_0x180412['plugins']['get']('AITabs')['view'];this['bind']('value')['to'](_0x11d138,'isVisible'),this['isEnabled']=!0x0;}['execute'](){const _0x55d11c=this['editor']['plugins']['get']('AITabs')['view'];_0x55d11c['isVisible']=!_0x55d11c['isVisible'];}}class Sa extends _0x3e16f7{static get['requires'](){return[cs];}static get['pluginName'](){return'AIToggleButtonUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const _0x2abeaa=this['editor'];_0x2abeaa['commands']['add']('toggleAi',new fa(_0x2abeaa)),_0x2abeaa['ui']['componentFactory']['add']('toggleAi',()=>{const _0x3c0873=this['_createAIUIButton'](Nt);return _0x3c0873['set']({'tooltip':!0x0,'class':'ck-ai-toggle-button'}),_0x3c0873;}),_0x2abeaa['ui']['componentFactory']['add']('menuBar:toggleAi',()=>{const _0x5104ca=this['_createAIUIButton'](Wt);return _0x5104ca['set']({'role':'menuitemcheckbox'}),_0x5104ca;});}['_createAIUIButton'](_0x1481a9){const _0x2de784=this['editor'],_0x4c7ac1=_0x2de784['commands']['get']('toggleAi'),_0x50f8a0=new _0x1481a9(_0x2de784['locale']);return _0x50f8a0['set']({'label':us(_0x2de784['locale'],'AI_TOGGLE_BUTTON_LABEL'),'icon':_0x5314b2,'isToggleable':!0x0}),_0x50f8a0['bind']('isEnabled')['to'](_0x4c7ac1),_0x50f8a0['bind']('isOn')['to'](_0x4c7ac1,'value',_0x379abb=>!!_0x379abb),this['listenTo'](_0x50f8a0,'execute',()=>{_0x4c7ac1['execute']();}),_0x50f8a0;}}const ba=['applySuggestion','insertSuggestion','showNext','showPrevious'];class Ra extends vt{['_errorView'];constructor(_0x2853d8){super(_0x2853d8),this['set']('_errorMessage',''),this['set']('_isErrorVisible',!0x1);}['showBlockingError'](_0x3e0085){this['showError'](_0x3e0085);}['showError'](_0x3b5a1f){this['_errorView']||(this['_errorView']=this['_createErrorView']()),this['_errorMessage']=_0x3b5a1f,this['_isErrorVisible']=!0x0;}['hideError'](){this['_isErrorVisible']=!0x1;}['_createErrorView'](){const _0x460628=new vt(this['locale']),_0x267ecb=new vt(this['locale']);return _0x267ecb['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai-suggestion__error-text']},'children':[{'text':this['bindTemplate']['to']('_errorMessage')}]}),_0x460628['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__error','ck-ai-balloon-error',this['bindTemplate']['if']('_isErrorVisible','ck-hidden',_0x3f4acf=>!_0x3f4acf)]},'children':[_0x267ecb]}),_0x460628;}}const Oa=0xa;class ka extends _0x4c3ee6{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'](_0x224135){const {id:_0x2fb17a}=this['_currentConfig']??{};this['_currentConfig']=_0x224135;const {id:_0x2b1b36}=this['_currentConfig'];this['isOpen']&&_0x2fb17a===_0x2b1b36?this['_updateDialog']():this['_showDialog']();}['close'](){const _0x279891=Xs(this['context'])['plugins']['get']('Dialog');_0x279891['isOpen']&&this['_currentConfig']&&_0x279891['id']===this['_currentConfig']['id']&&_0x279891['hide']();}['_updateDialog'](){const _0x32ea01=Xs(this['context'])['plugins']['get']('Dialog'),{icon:_0x40d831,title:_0x38502c}=this['_currentConfig'];_0x32ea01['view']?.['headerView']&&(_0x32ea01['view']['headerView']['label']=_0x38502c,_0x32ea01['view']['headerView']['iconView']&&_0x40d831&&(_0x32ea01['view']['headerView']['iconView']['content']=_0x40d831)),this['_isUpdatingMarkers']=!0x0,this['_showFakeVisualSelection'](),this['_isUpdatingMarkers']=!0x1,_0x32ea01['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 _0x23c4ee=Xs(this['context'])['plugins']['get']('Dialog'),{id:_0x17a132,title:_0x2934b3,icon:_0x36a6a0,class:_0x3608f0,mainView:_0x181bfc}=this['_currentConfig'];_0x181bfc['delegate'](...ba)['to'](this),_0x23c4ee['show']({'title':_0x2934b3,'icon':_0x36a6a0,'hasCloseButton':!0x0,'id':_0x17a132,'position':this['_calculateDialogPosition']['bind'](this),'className':'ck-ai-balloon\x20'+(_0x3608f0||''),'content':_0x181bfc,'onShow':_0x54ea3f=>{this['_showFakeVisualSelection'](),this['_setupFakeVisualSelectionMarkerRemovalListener']();const _0x568f94=this['_getSelectionElements']();_0x568f94&&_0x568f94[0x0]&&Ct({'target':_0x568f94[0x0],'ancestorOffset':0x14,'alignToTop':!0x0,'viewportOffset':{'top':0x14,'bottom':0x14,'left':0x0,'right':0x0}}),this['isOpen']=!0x0,_0x54ea3f['once']('hide',()=>{this['fire']('beforeDialogClosed',{'id':_0x17a132});},{'priority':'high'});},'onHide':()=>{this['_hideFakeVisualSelection'](),this['_cleanupFakeVisualSelectionMarkerRemovalListener'](),this['fire']('dialogClosed',{'id':_0x17a132}),this['isOpen']=!0x1;}});}['_calculateDialogPosition'](_0x168940,_0x5a86ac){if(!_0x5a86ac)return null;const _0x2ea683=this['_getSelectionElements']();if(!_0x2ea683||0x0===_0x2ea683['length'])return{'left':Math['round'](_0x5a86ac['left']+_0x5a86ac['width']/0x2-_0x168940['width']/0x2),'top':Math['round'](_0x5a86ac['top']+_0x5a86ac['height']/0x2-_0x168940['height']/0x2)};const _0x30e2a5=Math['round'](_0x5a86ac['left']+_0x5a86ac['width']/0x2-_0x168940['width']/0x2),_0x40ef8f=_0x2ea683['map'](_0x4710b8=>new dt(_0x4710b8)),_0x411cc2=_0x168940['height'];return{'left':_0x30e2a5,'top':this['_calculateOptimalTopPosition'](_0x40ef8f,_0x411cc2,_0x5a86ac)};}['_calculateOptimalTopPosition'](_0x51261e,_0x288222,_0x109337){const _0x5c6bbf=new dt(lt['window']),_0x607b33=_0x51261e['map'](_0x50dd5f=>_0x50dd5f['getVisible']())['filter'](_0x1b7209=>_0x1b7209),_0x778b5b=dt['getBoundingRect'](_0x607b33);if(!_0x778b5b)return Math['round'](_0x109337['top']+_0x109337['height']/0x2);const _0x27970f=_0x5c6bbf['getIntersection'](_0x778b5b);if(!_0x27970f)return Math['round'](_0x109337['top']+_0x109337['height']/0x2);const _0x1af4c2=_0x109337['getVisible'](),_0x4fc244=_0x1af4c2&&_0x778b5b['height']>_0x1af4c2['height'],_0x5f24d8=_0x27970f['top'],_0x1148bd=_0x27970f['bottom'];if(_0x4fc244){const _0x55e81c=(_0x1af4c2||_0x5c6bbf)['height']/0x2-_0x288222/0x2,_0x5592d0=_0x5f24d8-Oa-_0x109337['top'],_0x1eef08=_0x109337['bottom']-_0x1148bd-Oa;return _0x5592d0>=_0x288222?Math['max'](Oa,_0x5f24d8-_0x288222-Oa):_0x1eef08>=_0x288222?_0x1148bd+Oa:Math['max'](Oa,_0x55e81c);}const _0x4159ef=_0x5f24d8-_0x288222,_0x44dde7=_0x109337['bottom']-_0x1148bd-Oa,_0x38d919=_0x5f24d8-Oa-_0x109337['top'];let _0x3fb1ef;if(_0x44dde7>=_0x288222)_0x3fb1ef=_0x1148bd+Oa;else{if(_0x38d919>=_0x288222)_0x3fb1ef=_0x4159ef-Oa;else _0x3fb1ef=_0x5f24d8+_0x778b5b['height']/0x2-_0x288222/0x2;}return _0x3fb1ef;}['_setupFakeVisualSelectionMarkerRemovalListener'](){const _0x37f641=Xs(this['context']);this['listenTo'](_0x37f641['model']['document'],'change',()=>{if(!this['_isUpdatingMarkers']){for(const {name:_0x5a2bde,data:{newRange:_0xbefa4c}}of _0x37f641['model']['document']['differ']['getChangedMarkers']())if(_0x5a2bde['startsWith'](Zs+':')&&(_0xbefa4c&&(_0xbefa4c['start']['isEqual'](_0xbefa4c['end'])||'$graveyard'==_0xbefa4c['root']['rootName'])||null==_0xbefa4c)){const _0x45dfd3=us(this['context']['locale'],'AI_BALLOON_SELECTION_REMOVED_ERROR');this['_currentConfig']['mainView']['showBlockingError'](_0x45dfd3),this['fire']('selectionRemoved');}}});}['_cleanupFakeVisualSelectionMarkerRemovalListener'](){const _0x3785e0=Xs(this['context']);this['_currentConfig']['mainView']['hideError'](),this['stopListening'](_0x3785e0['model']['document']);}['_getSelectionElements'](){const _0x1e7e7f=Xs(this['context']);return _0x63d217(_0x1e7e7f['editing'],[..._0x1e7e7f['model']['markers']['getMarkersGroup']('ai-selection'),..._0x1e7e7f['model']['markers']['getMarkersGroup']('ai-balloon-selection')]);}}class Na extends kt{['copyButton'];['likeButton'];['dislikeButton'];['showChangesButton'];['_config'];constructor(_0x40c8f5,_0x1aebd8={}){super(_0x40c8f5),this['set']('isEnabled',!0x0),this['set']('isShowChangesOn',!0x1),this['_config']={'showCopy':!0x1,'showLike':!0x1,'showDislike':!0x1,..._0x1aebd8};const _0x3093e4=!(this['_config']['showCopy']||this['_config']['showChanges']||this['_config']['showLike']||this['_config']['showDislike']||this['_config']['customView']?.['length']);this['class']=_0x3093e4?'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'](_0x4f6d00){this['showChangesButton']['isEnabled']=_0x4f6d00;}['_setupRatingButtons'](){this['likeButton']=new Nt(this['locale']),this['likeButton']['set']({'icon':_0x57d1a1,'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':_0x5a6142,'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':_0x28e3cb,'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 _0x4841db=new xt();_0x4841db['set']({'content':_0x389cff}),_0x4841db['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'](_0x4841db);}['_setupShowChangesButton'](){this['showChangesButton']=new Nt(this['locale']),this['showChangesButton']['set']({'icon':_0x142490,'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',_0x3b85a7=>_0x3b85a7?_0x4ca6e6:_0x142490),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(_0x3edfc5,_0x5a018a){super(_0x3edfc5);const _0x559fd0=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']=_0x5a018a,this['nextButtonView']=this['_createNextButtonView'](),this['previousButtonView']=this['_createPreviousButtonView'](),this['_streamableContentView']=new pn(_0x3edfc5),this['_partToolbarView']=new gn(_0x3edfc5,_0x5a018a['availableActions']),this['_partToolbarView']['delegate']('applySuggestion','insertSuggestion','rejectSuggestion')['to'](this),this['_togglePartToolbarButtonsVisibility'](_0x5a018a),this['_stateView']=new _n(_0x3edfc5),this['_stateView']['isVisible']=!0x1,this['_miniToolbarView']=new Na(_0x3edfc5,{'showChanges':'full'}),this['_miniToolbarView']['bind']('isShowChangesOn')['to'](this,'showDiff'),this['_miniToolbarView']['on']('toggleShowChanges',()=>{this['fire']('toggleSuggestionDisplayMode');}),this['_toolbarContainerView']=new ya(_0x3edfc5,[this['_partToolbarView'],this['_stateView'],this['_miniToolbarView']]),this['children']=this['createCollection']([this['_streamableContentView'],this['_toolbarContainerView']]),this['on']('change:_state',(_0x1fcc76,_0x28a9fc,_0x1dad08,_0x577c51)=>{let _0x3fdb2a,_0x13eb09;'pending'===_0x577c51?(_0x3fdb2a=this['_partToolbarView'],_0x13eb09=this['_stateView']):(_0x3fdb2a=this['_stateView'],_0x13eb09=this['_partToolbarView']),this['_stateView']['setState'](_0x1dad08),_0x3fdb2a['isVisible']=!0x1,_0x13eb09['isVisible']=!0x0;}),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat-balloon-main',_0x559fd0['to']('_state',_0x34d8f6=>'ck-ai-chat-balloon-main_state_'+_0x34d8f6)]},'children':this['children']}),this['on']('change:isTrackChangesOn',()=>{this['_togglePartToolbarButtonsVisibility'](_0x5a018a);});}['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'](_0x3e091b){_0x3e091b?.['keepErrors']||this['hideError'](),await this['_streamableContentView']['update'](_0x3e091b);}['setState'](_0x209bfc){this['_state']=_0x209bfc;}['showError'](_0xef27c8){super['showError'](_0xef27c8),this['children']['has'](this['_errorView'])||this['children']['add'](this['_errorView'],0x0);}['hideError'](){this['_isErrorVisible']&&(super['hideError'](),this['togglePartToolbarEnabled'](!0x0));}['showBlockingError'](_0x47af30){super['showBlockingError'](_0x47af30),this['togglePartToolbarEnabled'](!0x1);}['toggleRotatorButtonsVisibility'](_0x5e01e5){this['nextButtonView']['isVisible']=this['previousButtonView']['isVisible']=_0x5e01e5;}['togglePartToolbarEnabled'](_0x517b0f){this['_partToolbarView']['isEnabled']=_0x517b0f;}['_togglePartToolbarButtonsVisibility']({showApplyButton:_0x1b5892,showSuggestButton:_0x4bb297}){_0x1b5892=_0x1b5892&&!this['isTrackChangesOn']&&this['_config']['availableActions']['includes']('applySuggestion'),_0x4bb297=_0x4bb297&&this['_config']['availableActions']['includes']('insertSuggestion'),this['_partToolbarView']['setButtonsVisibility']({'showApplyButton':_0x1b5892,'showSuggestButton':_0x4bb297});}['_createNextButtonView'](){const _0x1dddbe=new Nt(this['locale']);return _0x1dddbe['set']({'icon':_0x15bb9d,'label':us(this['locale'],'AI_BALLOON_NEXT_LABEL'),'isVisible':!0x0}),_0x1dddbe['on']('execute',()=>{this['fire']('showNext');}),_0x1dddbe;}['_createPreviousButtonView'](){const _0x1a5b16=new Nt(this['locale']);return _0x1a5b16['set']({'icon':_0x37ec3a,'label':us(this['locale'],'AI_BALLOON_PREVIOUS_LABEL'),'isVisible':!0x0}),_0x1a5b16['on']('execute',()=>{this['fire']('showPrevious');}),_0x1a5b16;}}class ya extends vt{constructor(_0x379779,_0x24a812){super(_0x379779),this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-chat-balloon__toolbar-container']},'children':_0x24a812});}}class xa extends _0x3e16f7{static get['requires'](){return[Bt,ka];}static get['pluginName'](){return'AIChatBalloon';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['_chatBalloonView'];constructor(_0xc763a0){super(_0xc763a0),this['set']('showDiff',!0x1);}['open'](_0x47ebc8){const _0x2e690b=this['editor'];this['_chatBalloonView']||(this['_chatBalloonView']=this['_createChatBalloonView']()),_0x2e690b['plugins']['get']('AIBalloon')['open']({..._0x47ebc8,'id':'aiChatBalloon','class':'ck-ai-chat-balloon','mainView':this['_chatBalloonView']}),this['_toggleRotatorButtonsInDialogHeader'](_0x47ebc8['showRotator']),this['_chatBalloonView']['togglePartToolbarEnabled'](!_0x47ebc8['areActionsDisabled']),this['_restoreDefaultViewFocus']();}['close'](){this['editor']['plugins']['get']('AIBalloon')['close']();}['updateContent'](_0x160983){return this['_chatBalloonView']||(this['_chatBalloonView']=this['_createChatBalloonView']()),this['_chatBalloonView']['updateContent'](_0x160983);}['setState'](_0x4ccb3f){this['_chatBalloonView']&&this['_chatBalloonView']['setState'](_0x4ccb3f);}['_createChatBalloonView'](){const _0x51a6cd=this['editor'],_0x96b9e1=_0x51a6cd['plugins']['get']('AIBalloon'),_0x4f0476=_0x51a6cd['commands']['get']('trackChanges');let _0x2131c8=_0x51a6cd['config']['get']('ai.availableReplyActions')||[...wn];_0x51a6cd['plugins']['has']('TrackChanges')||(_0x2131c8=_0x2131c8['filter'](_0x39fe35=>'insertSuggestion'!=_0x39fe35));const _0x48b435=new va(_0x51a6cd['locale'],{'availableActions':_0x2131c8,'showApplyButton':!0x0,'showSuggestButton':!!_0x4f0476});return _0x48b435['bind']('showDiff')['to'](this),_0x48b435['delegate'](...en)['to'](this),_0x48b435['delegate']('showPrevious','showNext')['to'](this),_0x96b9e1['delegate']('dialogClosed')['to'](this),_0x48b435['on']('applySuggestion',this['_restoreDefaultViewFocus']['bind'](this)),_0x48b435['on']('insertSuggestion',this['_restoreDefaultViewFocus']['bind'](this)),_0x48b435['on']('rejectSuggestion',this['_restoreDefaultViewFocus']['bind'](this)),_0x4f0476&&_0x48b435['bind']('isTrackChangesOn')['to'](_0x4f0476,'value'),_0x48b435['render'](),_0x48b435;}['_toggleRotatorButtonsInDialogHeader'](_0x1ee3ff){const _0x867dd9=this['editor'],_0x5e11a3=_0x867dd9['plugins']['get']('Dialog')['view']['headerView']['children'];this['_chatBalloonView']['toggleRotatorButtonsVisibility'](_0x1ee3ff),_0x5e11a3['has'](this['_chatBalloonView']['previousButtonView'])||(_0x5e11a3['addMany']([this['_chatBalloonView']['previousButtonView'],this['_chatBalloonView']['nextButtonView']],0x0),_0x867dd9['plugins']['get']('AIBalloon')['once']('beforeDialogClosed',()=>{_0x5e11a3['remove'](this['_chatBalloonView']['previousButtonView']),_0x5e11a3['remove'](this['_chatBalloonView']['nextButtonView']);}));}['_restoreDefaultViewFocus'](){this['_chatBalloonView']['focus']();}}class La extends _0x3e16f7{static get['requires'](){return[Sa,xa,_0x891dae];}static get['pluginName'](){return'AIEditorIntegration';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}function Da(_0x286ad9){const {editor:_0x146aef,action:_0x12c64b,withText:_0x261c32=!0x1,withIcon:_0x3ad57c=!0x0,isInDropdown:_0x4f1300=!0x0,shouldPreventFocus:_0x3c9112=!0x1}=_0x286ad9;return()=>{const _0x49878f=_0x146aef['locale'],_0x2f58dd=new Nt(_0x49878f),_0x39c6db=_0x2f58dd['bindTemplate'];_0x4f1300&&_0x2f58dd['extendTemplate']({'on':{'mouseenter':_0x39c6db['to'](()=>{_0x3c9112&&_0x3c9112()||_0x2f58dd['focus']();})}});const _0x48eb89=_0x12c64b['icon']??_0x12c64b['parent']?.['icon'];return _0x2f58dd['set']({'label':_0x12c64b['label'],'withText':_0x261c32,'role':'menuitem','icon':_0x3ad57c?_0x48eb89??_0x304454:void 0x0,'tooltip':!_0x261c32,'class':'ck-ai-quick-actions-button','isEnabled':_0x12c64b['isEnabled']}),_0x2f58dd['on']('execute',()=>{_0x146aef['editing']['view']['focus'](),_0x146aef['commands']['execute']('aiQuickAction',_0x12c64b);}),_0x2f58dd;};}class Pa extends _0x15de4d{['arrowView'];constructor(_0x14b222,_0xaf6421){super(_0x14b222,_0xaf6421);const _0x140df4=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',_0xb1ee56=>String(_0xb1ee56)),'data-cke-tooltip-disabled':_0x140df4['to']('isOn')},'on':{'mouseenter':_0x140df4['to']('mouseenter')}});}['render'](){super['render'](),this['children']['add'](this['arrowView']);}['_createArrowView'](){const _0x2278e5=new xt();return _0x2278e5['content']=_0x54e08c,_0x2278e5['extendTemplate']({'attributes':{'class':'ck-dropdown-menu-list__nested-menu__button__arrow'}}),_0x2278e5;}}class Ha extends Dt{['_allListItems'];['_allSearchableItems'];constructor(_0xdd6938,_0x5e250f,_0x1df92f){super(_0xdd6938),this['_allListItems']=_0x5e250f,this['_allSearchableItems']=_0x1df92f;}['filter'](_0x598958){if(!_0x598958)return this['items']['clear'](),this['items']['addMany'](this['_allListItems']),this['_clearHighlight'](),{'resultsCount':this['_allListItems']['length'],'totalItemsCount':this['_allListItems']['length']};const _0x23dc1a=_0x598958['source']['toLowerCase']()['trim'](),_0x414068=this['_allSearchableItems']['filter'](_0x3539be=>(_0x3539be['groupLabel']?_0x3539be['label']+'\x20('+_0x3539be['groupLabel']+')':_0x3539be['label'])['toLowerCase']()['includes'](_0x23dc1a));return this['items']['clear'](),this['items']['addMany'](_0x414068['sort']((_0x21a620,_0x4f0f25)=>{const _0x50363c=_0x21a620['groupLabel'],_0x239fc4=_0x4f0f25['groupLabel'];return _0x50363c||_0x239fc4?_0x50363c?0x1:-0x1:0x0;})['map'](_0x1450f9=>_0x1450f9['item'])),this['_highlightQuery'](_0x23dc1a,_0x414068),{'resultsCount':_0x414068['length'],'totalItemsCount':this['_allSearchableItems']['length']};}['_highlightQuery'](_0x421e46,_0x247d20){if(!_0x421e46)return;const _0x5bec8a=new RegExp(_0x5517e5(_0x421e46),'gi');_0x247d20['forEach'](_0x45893c=>{_0x45893c['highlightViews']&&_0x45893c['highlightViews']['forEach'](_0x340260=>{'function'==typeof _0x340260['highlightText']&&_0x340260['highlightText'](_0x5bec8a);});});}['_clearHighlight'](){this['_allSearchableItems']['forEach'](_0xe77a41=>{_0xe77a41['highlightViews']&&_0xe77a41['highlightViews']['forEach'](_0x5093d8=>{'function'==typeof _0x5093d8['highlightText']&&_0x5093d8['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(_0x269578,_0x66780e,_0x3d04fa,_0x4be9de,_0x5d4cb0=!0x1){const _0x1ab426=_0x269578['locale'];super(_0x1ab426),this['_bodyCollection']=_0x4be9de,this['_hasSearch']=_0x5d4cb0;const _0x39269d=this['_createListItems'](_0x269578,_0x66780e,_0x3d04fa);this['optionsListView']=new Ha(_0x1ab426,_0x39269d,this['_allSearchableItems']),this['optionsListView']['role']=Ma,this['optionsListView']['items']['addMany'](_0x39269d),this['focusTracker']=new At(),this['keystrokes']=new gt(),_0x5d4cb0&&(this['_searchTextView']=this['_createSearchTextView']()),this['_focusables']=_0x39269d,this['focusCycler']=new Ut({'focusables':this['_focusables'],'focusTracker':this['focusTracker'],'keystrokeHandler':this['keystrokes']}),_0x5d4cb0&&this['_searchTextView']&&this['focusCycler']['chain'](this['_searchTextView']['focusCycler']);const _0x3009cb=_0x5d4cb0&&this['_searchTextView']?[this['_searchTextView']]:[this['optionsListView']];this['children']=new _0x54c5cf(_0x3009cb),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset_all','ck-ai-quick-actions','ck-rounded-corners'],'dir':_0x1ab426['uiLanguageDirection']},'children':this['children']});}['_createSearchTextView'](){return new _0x20c15f(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 _0x425f12=this['_searchTextView']['queryView']['fieldView']['element']['ownerDocument']?.['activeElement'];return this['_searchTextView']['queryView']['fieldView']['element']['contains'](_0x425f12);}['_createListItems'](_0x50fb86,_0x433f1d,_0x261e52){const _0x3597a1=new _0x54c5cf();return _0x433f1d['forEach'](_0x169388=>{if('actions'in _0x169388){const {listItem:_0xce260b}=this['_createActionGroupButton'](_0x50fb86,_0x169388,_0x261e52);_0x3597a1['add'](_0xce260b),_0x169388['actions']['forEach'](_0x29f055=>{this['_createActionButton'](_0x50fb86,_0x29f055,_0x169388['label'],_0x169388['icon']);const {listItem:_0xf5ba7,highlightViews:_0x5defba}=this['_createSearchResultActionButton'](_0x50fb86,_0x29f055,_0x169388['label'],_0x169388['icon']);this['_allSearchableItems']['push']({'item':_0xf5ba7,'label':_0x29f055['label'],'groupLabel':_0x169388['label'],'highlightViews':_0x5defba});});}else{const {listItem:_0xbf13c9}=this['_createActionButton'](_0x50fb86,_0x169388);_0x3597a1['add'](_0xbf13c9);const _0x303fb9=_0xbf13c9['children']['first'];if(_0x303fb9){const {listItem:_0x185847,highlightViews:_0x479aa9}=this['_createSearchResultActionButton'](_0x50fb86,_0x169388);this['_allSearchableItems']['push']({'item':_0x185847,'label':_0x303fb9['label']||'','highlightViews':_0x479aa9});}}}),_0x3597a1;}['_createActionButton'](_0x2de630,_0x1cffdb,_0x45ffb3,_0x10e735){const _0x2b9c34=new Ht(this['locale']);if(_0x45ffb3&&_0x10e735){const _0x3624a3=new Nt(this['locale']),_0x5492ea=_0x3624a3['bindTemplate'],_0x3c55b3=new _0x25931f();_0x3c55b3['text']=_0x1cffdb['label'];const _0x386736=new _0x25931f();_0x386736['text']=_0x45ffb3;const _0xc7bc4a=new xt();_0xc7bc4a['content']=_0x10e735,_0xc7bc4a['extendTemplate']({'attributes':{'class':'ck-ai-quick-actions-button__group-icon'}});const _0xd98cac=new vt(this['locale']);_0xd98cac['setTemplate']({'tag':'span','attributes':{'class':'ck-ai-quick-actions-button_with-group__open-paren'},'children':[{'text':'\x20('}]});const _0x39a9dc=new vt(this['locale']);return _0x39a9dc['setTemplate']({'tag':'span','attributes':{'class':'ck-ai-quick-actions-button_with-group__close-paren'},'children':[{'text':')'}]}),_0x3624a3['set']({'label':_0x1cffdb['label']+'\x20('+_0x45ffb3+')','withText':!0x0,'role':'menuitem','class':'ck-ai-quick-actions-button\x20ck-ai-quick-actions-button_with-group','tooltip':!0x1}),_0x3624a3['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':[_0x3c55b3,_0xd98cac,_0xc7bc4a,_0x386736,_0x39a9dc],'on':{'mouseenter':_0x5492ea['to'](()=>{this['_isSearchFocused']()||_0x3624a3['focus']();}),'click':_0x5492ea['to'](()=>{_0x3624a3['fire']('execute');})}}),_0x3624a3['on']('execute',()=>{_0x2de630['editing']['view']['focus'](),_0x2de630['commands']['execute']('aiQuickAction',_0x1cffdb);}),_0x2b9c34['children']['add'](_0x3624a3),{'listItem':_0x2b9c34,'highlightViews':[_0x3c55b3,_0x386736]};}{const _0x3c8269=new _0x4795a9(),_0x2790f5=new Nt(this['locale'],_0x3c8269),_0x452bd4=_0x2790f5['bindTemplate'],_0x28bf27=_0x1cffdb['icon']??_0x1cffdb['parent']?.['icon'],_0x55ae01=void 0x0!==_0x1cffdb['icon'];return _0x2790f5['set']({'label':_0x1cffdb['label'],'withText':!0x0,'role':'menuitem','icon':_0x55ae01?_0x28bf27??_0x304454:void 0x0,'tooltip':!0x1,'class':'ck-ai-quick-actions-button'}),_0x2790f5['extendTemplate']({'on':{'mouseenter':_0x452bd4['to'](()=>{this['_isSearchFocused']()||_0x2790f5['focus']();})}}),_0x2790f5['on']('execute',()=>{_0x2de630['editing']['view']['focus'](),_0x2de630['commands']['execute']('aiQuickAction',_0x1cffdb);}),_0x2b9c34['children']['add'](_0x2790f5),{'listItem':_0x2b9c34,'highlightViews':[_0x3c8269]};}}['_createSearchResultActionButton'](_0x56f3c8,_0x2eb787,_0x17eef1,_0x419768){return _0x17eef1&&_0x419768?this['_createSearchResultGroupedActionButton'](_0x56f3c8,_0x2eb787,_0x17eef1,_0x419768):this['_createSearchResultIndividualActionButton'](_0x56f3c8,_0x2eb787);}['_createSearchResultGroupedActionButton'](_0x362a77,_0x30bb9f,_0xdbef84,_0x4957ff){const _0x551f83=new Ht(this['locale']),_0x3fa2d8=new Nt(this['locale']),_0x5b4c66=_0x3fa2d8['bindTemplate'],{view:_0x3c7a43,highlightView:_0x72a8e7}=this['_createSearchResultGroupRow'](_0xdbef84,_0x4957ff),{view:_0xbd0507,highlightView:_0x1f28ed}=this['_createSearchResultActionRow'](_0x30bb9f['label']),_0x242ee9=this['_createSearchResultContentView'](_0x3c7a43,_0xbd0507);return _0x3fa2d8['set']({'label':_0x30bb9f['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}),_0x3fa2d8['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':[_0x242ee9],'on':{'mouseenter':_0x5b4c66['to'](()=>{this['_isSearchFocused']()||_0x3fa2d8['focus']();}),'click':_0x5b4c66['to'](()=>{this['_handleSearchResultButtonClick'](_0x3fa2d8);})}}),this['_setupActionButtonExecution'](_0x3fa2d8,_0x362a77,_0x30bb9f),_0x551f83['children']['add'](_0x3fa2d8),{'listItem':_0x551f83,'highlightViews':[_0x72a8e7,_0x1f28ed]};}['_createSearchResultIndividualActionButton'](_0x1e1767,_0x2652cf){const _0x4d6f47=new Ht(this['locale']),_0x449630=new _0x4795a9(),_0xbae828=new Nt(this['locale'],_0x449630),_0x1fa8db=_0xbae828['bindTemplate'];return _0xbae828['set']({'label':_0x2652cf['label'],'withText':!0x0,'role':'menuitem','icon':void 0x0,'tooltip':!0x1,'class':'ck-ai-quick-actions-button\x20ck-ai-quick-actions-search-result-button'}),_0xbae828['extendTemplate']({'on':{'mouseenter':_0x1fa8db['to'](()=>{this['_isSearchFocused']()||_0xbae828['focus']();})}}),this['_setupActionButtonExecution'](_0xbae828,_0x1e1767,_0x2652cf),_0x4d6f47['children']['add'](_0xbae828),{'listItem':_0x4d6f47,'highlightViews':[_0x449630]};}['_createSearchResultGroupRow'](_0x394885,_0x4958aa){const _0x1b863d=new vt(this['locale']),_0x12ea32=new xt();_0x12ea32['content']=_0x4958aa,_0x12ea32['extendTemplate']({'attributes':{'class':'ck-ai-quick-actions-button__group-icon'}});const _0x15667a=new _0x25931f();return _0x15667a['text']=_0x394885,_0x1b863d['setTemplate']({'tag':'div','attributes':{'class':'ck-ai-quick-actions-search-result__group-row'},'children':[_0x12ea32,_0x15667a]}),{'view':_0x1b863d,'highlightView':_0x15667a};}['_createSearchResultActionRow'](_0xbd4c06){const _0x474a4b=new vt(this['locale']),_0x45c817=new _0x25931f();return _0x45c817['text']=_0xbd4c06,_0x474a4b['setTemplate']({'tag':'div','attributes':{'class':'ck-ai-quick-actions-search-result__action-row'},'children':[_0x45c817]}),{'view':_0x474a4b,'highlightView':_0x45c817};}['_createSearchResultContentView'](_0x329dfc,_0x2f8def){const _0x2f0afb=new vt(this['locale']);return _0x2f0afb['setTemplate']({'tag':'div','attributes':{'class':'ck-ai-quick-actions-search-result__content'},'children':[_0x329dfc,_0x2f8def]}),_0x2f0afb;}['_setupActionButtonExecution'](_0xbe47da,_0x41bf04,_0x515201){_0xbe47da['on']('execute',()=>{_0x41bf04['editing']['view']['focus'](),_0x41bf04['commands']['execute']('aiQuickAction',_0x515201);});}['_createActionGroupButton'](_0x2151f0,_0x4c09c0,_0x149e52){const _0x2b6617=new Ht(this['locale']),_0x3ca01d=new _0x4795a9(),_0xb8df33=new Pa(this['locale'],_0x3ca01d),_0x5ad71c=_0xb8df33['bindTemplate'],_0x56f1fa=this['_getPanelKeystroke'](_0x149e52),_0x20461c=this['_createGroupActionsList'](_0x2151f0,_0x4c09c0['actions'],_0x149e52);_0xb8df33['set']({'label':_0x4c09c0['label'],'withText':!0x0,'role':Ua,'icon':_0x4c09c0['icon']??_0x304454,'isEnabled':_0x4c09c0['actions']['some'](_0xc3cbac=>_0xc3cbac['isEnabled'])}),_0xb8df33['extendTemplate']({'on':{'mouseenter':_0x5ad71c['to'](()=>{this['_isSearchFocused']()||_0xb8df33['focus']();})}});const _0x1ffc23=new Xt(this['locale']);return _0x1ffc23['extendTemplate']({'attributes':{'class':['ck','ck-reset_all','ck-ai-quick-actions-group-panel','ck-dropdown-menu__nested-menu__panel']},'on':{'keydown':_0x5ad71c['to'](_0x2a9557=>{this['_handlePanelKeydown'](_0x2a9557,_0x56f1fa,_0xb8df33,_0x1ffc23);})}}),_0xb8df33['bind']('isOn')['to'](_0x1ffc23,'isVisible'),this['_bodyCollection']['add'](_0x1ffc23),_0x1ffc23['content']['add'](_0x20461c),this['_setupGroupMenuBehavior'](_0xb8df33,_0x1ffc23),_0x2b6617['children']['add'](_0xb8df33),{'listItem':_0x2b6617,'highlightView':_0x3ca01d};}['_createGroupActionsList'](_0x4de8ae,_0x1cc321,_0x5d87ff){const _0x159659=new Dt(this['locale']);return _0x159659['extendTemplate']({'attributes':{'class':['ck','ck-reset_all','ck-ai-quick-actions-group-list','ck-dropdown-menu-list']}}),_0x1cc321['forEach'](_0x28d377=>{const _0x3d3977=new Ht(this['locale']),_0x48377a=Da({'editor':_0x4de8ae,'action':_0x28d377,'withText':!0x0,'withIcon':!0x1,'isInDropdown':!0x0,'shouldPreventFocus':()=>this['_isSearchFocused']()})();_0x3d3977['children']['add'](_0x48377a),_0x5d87ff['focusTracker']['add'](_0x48377a),_0x159659['items']['add'](_0x3d3977);}),_0x159659;}['_setupGroupMenuBehavior'](_0x7370fb,_0x2c2f2e){const _0x27c8ee=_0x7370fb['bindTemplate'],_0x1f9b64=this['_getButtonKeystroke'](_0x7370fb);_0x7370fb['extendTemplate']({'attributes':{'class':['ck-ai-quick-actions-group-button']},'on':{'mouseenter':_0x27c8ee['to'](()=>{this['_showNestedPanel'](_0x2c2f2e,_0x7370fb);}),'mouseleave':_0x27c8ee['to'](_0xe4ba7f=>{const _0x28c1fe=_0xe4ba7f['relatedTarget'];this['_isMovingToNestedMenu'](_0x28c1fe,_0x2c2f2e)||this['_hideNestedPanel'](_0x2c2f2e);}),'keydown':_0x27c8ee['to'](_0x51d614=>{_0x51d614['key']==_0x1f9b64&&(this['_showNestedPanel'](_0x2c2f2e,_0x7370fb),_0x2c2f2e['content']['get'](0x0)['focus']());})}}),_0x2c2f2e['on']('render',()=>{_0x2c2f2e['element']?.['addEventListener']('mouseleave',_0x157b55=>{const _0x34de3c=_0x157b55['relatedTarget'];_0x7370fb['element']?.['contains'](_0x34de3c)||this['_isMovingToNestedMenu'](_0x34de3c,_0x2c2f2e)||this['_hideNestedPanel'](_0x2c2f2e);});});}['_showNestedPanel'](_0x3c1a11,_0x42b240){this['_openNestedPanels']['forEach'](_0x2260e0=>{_0x2260e0!==_0x3c1a11&&_0x2260e0['isVisible']&&_0x2260e0['hide']();}),_0x3c1a11['show'](),_0x3c1a11['pin']({'positions':[_0x5d471b['eastSouth']],'target':_0x42b240['element'],'fitInViewport':!0x0}),this['_openNestedPanels']['add'](_0x3c1a11);}['_hideNestedPanel'](_0x2b8583){_0x2b8583['hide'](),this['_openNestedPanels']['delete'](_0x2b8583);}['_hideAllNestedPanels'](){this['_openNestedPanels']['forEach'](_0x21ed72=>_0x21ed72['hide']()),this['_openNestedPanels']['clear']();}['_isMovingToNestedMenu'](_0x36dd10,_0x3974e8){if(!_0x36dd10)return!0x1;if(_0x3974e8['element']?.['contains'](_0x36dd10))return!0x0;const _0x43ec68=_0x36dd10;return _0x43ec68['closest']&&(null!==_0x43ec68['closest']('.ck-ai-quick-actions-group-panel')||null!==_0x43ec68['closest']('.ck-ai-quick-actions-group-list')||null!==_0x43ec68['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'](_0x7fb0aa){return'rtl'===_0x7fb0aa['locale']['uiLanguageDirection']?'ArrowRight':'ArrowLeft';}['_getButtonKeystroke'](_0x1bc700){return'rtl'===_0x1bc700['locale']['uiLanguageDirection']?'ArrowLeft':'ArrowRight';}['_handlePanelKeydown'](_0x33f28e,_0xa53c71,_0x3b304b,_0x425270){_0x33f28e['key']==_0xa53c71&&(_0x3b304b['focus'](),this['_hideNestedPanel'](_0x425270));}['_handleSearchResultButtonClick'](_0xe959ba){_0xe959ba['fire']('execute');}}function Ba(_0x49ddcf){const {editor:_0x34ecce,content:_0xfb298c,buttonDefinition:_0x48fbec,bodyCollection:_0x4a571f,hasSearch:_0x388428=!0x1}=_0x49ddcf;return()=>{const _0x3bd557=_0x34ecce['locale'],_0x4e99e0=Gt(_0x3bd557);_0x4e99e0['buttonView']['set']({'icon':_0x48fbec['icon']??_0x304454,'label':_0x48fbec['label'],'tooltip':!0x0}),_0x4e99e0['set']({'class':'ck-ai-quick-actions-dropdown'});const _0x30ac93=new Va(_0x34ecce,_0xfb298c,_0x4e99e0,_0x4a571f,_0x388428);return _0x4e99e0['panelView']['children']['add'](_0x30ac93),_0x388428&&_0x4e99e0['on']('change:isOpen',(_0x29394b,_0x20f92e,_0x5610fc)=>{if(_0x5610fc){if(_0x34ecce['plugins']['has']('AIEditing')){const _0x16b9d7=_0x34ecce['plugins']['get'](tn),_0x39f767=_0x34ecce['model']['document']['selection'],_0x32d89b=Array['from'](_0x39f767['getRanges']());_0x32d89b['length']>0x0&&_0x16b9d7['showFakeVisualSelection']({'ranges':_0x32d89b,'id':'quick-action','priority':0x14});}}else _0x34ecce['plugins']['has']('AIEditing')&&_0x34ecce['plugins']['get'](tn)['hideFakeVisualSelection']('quick-action'),_0x30ac93['resetSearch']();}),_0x4e99e0;};}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(_0x2e4e53){return _0x2e4e53['chat']='AIChat',_0x2e4e53['action']='AIActions',_0x2e4e53;}({});class Ya extends _0x3e16f7{static get['requires'](){return[_0x46732f,ls];}static get['pluginName'](){return'AIQuickActionsUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}async['init'](){const _0x570909=await this['_getDefaultAndCustomActions']();this['_prepareQuickActionsDefinition'](_0x570909),this['_initializeQuickActionsComponentsAndCommands']();}static['getDefaultQuickActions'](_0x533eb9){return function(_0x5ba20e){const _0x27fd3f=new Intl['DisplayNames'](['en'],{'type':'language'})['of'](_0x5ba20e['uiLanguage']),_0x573277=_0x27fd3f||'English',_0x36c145=[{'id':'ask-ai','label':us(_0x5ba20e,'AI_QUICK_ACTIONS_ASK_AI'),'type':no['CHAT'],'icon':_0x4a1749},{'id':'chat-commands','label':us(_0x5ba20e,'AI_QUICK_ACTIONS_CHAT_COMMANDS'),'icon':_0x4a1749,'actions':[{'id':'explain','label':us(_0x5ba20e,'AI_QUICK_ACTIONS_EXPLAIN'),'displayedPrompt':us(_0x5ba20e,'AI_QUICK_ACTIONS_EXPLAIN'),'prompt':Ga['replace']('%0',_0x573277),'type':no['CHAT']},{'id':'summarize','label':us(_0x5ba20e,'AI_QUICK_ACTIONS_SUMMARIZE'),'displayedPrompt':us(_0x5ba20e,'AI_QUICK_ACTIONS_SUMMARIZE'),'prompt':Fa['replace']('%0',_0x573277),'type':no['CHAT']},{'id':'highlight-key-points','label':us(_0x5ba20e,'AI_QUICK_ACTIONS_HIGHLIGHT_KEY_POINTS'),'displayedPrompt':us(_0x5ba20e,'AI_QUICK_ACTIONS_HIGHLIGHT_KEY_POINTS'),'prompt':Ka['replace']('%0',_0x573277),'type':no['CHAT']}]},{'id':'improve-writing','label':us(_0x5ba20e,'AI_QUICK_ACTIONS_IMPROVE_WRITING'),'type':no['ACTION'],'icon':_0x391ba8},{'id':'continue','label':us(_0x5ba20e,'AI_QUICK_ACTIONS_CONTINUE_WRITING'),'type':no['ACTION'],'icon':_0x484490},{'id':'fix-grammar','label':us(_0x5ba20e,'AI_QUICK_ACTIONS_FIX_GRAMMAR_SPELLING'),'type':no['ACTION'],'icon':_0x467b86},{'id':'adjust-length','label':us(_0x5ba20e,'AI_QUICK_ACTIONS_ADJUST_LENGTH'),'icon':_0x50b8c6,'actions':[{'id':'make-shorter','label':us(_0x5ba20e,'AI_QUICK_ACTIONS_MAKE_SHORTER'),'type':no['ACTION']},{'id':'make-longer','label':us(_0x5ba20e,'AI_QUICK_ACTIONS_MAKE_LONGER'),'type':no['ACTION']}]},{'id':'change-tone','label':us(_0x5ba20e,'AI_QUICK_ACTIONS_CHANGE_TONE'),'icon':_0x7cf5b3,'actions':[{'id':'make-tone-casual','label':us(_0x5ba20e,'AI_QUICK_ACTIONS_MORE_CASUAL'),'type':no['ACTION']},{'id':'make-tone-direct','label':us(_0x5ba20e,'AI_QUICK_ACTIONS_MORE_DIRECT'),'type':no['ACTION']},{'id':'make-tone-friendly','label':us(_0x5ba20e,'AI_QUICK_ACTIONS_MORE_FRIENDLY'),'type':no['ACTION']},{'id':'make-tone-confident','label':us(_0x5ba20e,'AI_QUICK_ACTIONS_MORE_CONFIDENT'),'type':no['ACTION']},{'id':'make-tone-professional','label':us(_0x5ba20e,'AI_QUICK_ACTIONS_MORE_PROFESSIONAL'),'type':no['ACTION']}]},{'id':'translate','label':us(_0x5ba20e,'AI_QUICK_ACTIONS_TRANSLATE'),'icon':_0x20d810,'actions':[{'id':'translate-to-english','label':us(_0x5ba20e,'AI_QUICK_ACTIONS_TRANSLATE_ENGLISH'),'type':no['ACTION'],'actionName':'translate','args':{'language':'english'}},{'id':'translate-to-chinese','label':us(_0x5ba20e,'AI_QUICK_ACTIONS_TRANSLATE_CHINESE'),'type':no['ACTION'],'actionName':'translate','args':{'language':'chinese'}},{'id':'translate-to-spanish','label':us(_0x5ba20e,'AI_QUICK_ACTIONS_TRANSLATE_SPANISH'),'type':no['ACTION'],'actionName':'translate','args':{'language':'spanish'}},{'id':'translate-to-german','label':us(_0x5ba20e,'AI_QUICK_ACTIONS_TRANSLATE_GERMAN'),'type':no['ACTION'],'actionName':'translate','args':{'language':'german'}},{'id':'translate-to-french','label':us(_0x5ba20e,'AI_QUICK_ACTIONS_TRANSLATE_FRENCH'),'type':no['ACTION'],'actionName':'translate','args':{'language':'french'}},{'id':'translate-to-japanese','label':us(_0x5ba20e,'AI_QUICK_ACTIONS_TRANSLATE_JAPANESE'),'type':no['ACTION'],'actionName':'translate','args':{'language':'japanese'}},{'id':'translate-to-portuguese','label':us(_0x5ba20e,'AI_QUICK_ACTIONS_TRANSLATE_PORTUGUESE'),'type':no['ACTION'],'actionName':'translate','args':{'language':'portuguese'}},{'id':'translate-to-korean','label':us(_0x5ba20e,'AI_QUICK_ACTIONS_TRANSLATE_KOREAN'),'type':no['ACTION'],'actionName':'translate','args':{'language':'korean'}},{'id':'translate-to-italian','label':us(_0x5ba20e,'AI_QUICK_ACTIONS_TRANSLATE_ITALIAN'),'type':no['ACTION'],'actionName':'translate','args':{'language':'italian'}},{'id':'translate-to-russian','label':us(_0x5ba20e,'AI_QUICK_ACTIONS_TRANSLATE_RUSSIAN'),'type':no['ACTION'],'actionName':'translate','args':{'language':'russian'}}]},{'id':'other','label':us(_0x5ba20e,'AI_QUICK_ACTIONS_OTHER'),'icon':tt,'actions':[]}];return _0x36c145;}(_0x533eb9);}async['_getDefaultAndCustomActions'](){const _0x513a60=Ya['getDefaultQuickActions'](this['editor']['locale']),_0x1773ce=this['editor']['config']['get']('ai.quickActions.extraCommands')||[];let _0x31e712=[];try{_0x31e712=await new qs({'connector':this['editor']['plugins']['get']('AIConnector'),'locale':this['editor']['locale']})['getAll']();}catch(_0x497786){const _0x491d02=new ht('ai-quick-actions-models-unable-to-retrieve',this,{'error':_0x497786});mt(_0x491d02['message']);}finally{const _0x1ece3a=_0x1773ce['map'](_0x5aa3a4=>({..._0x5aa3a4,'type':'chat'===_0x5aa3a4['type']?no['CHAT']:no['ACTION'],'icon':void 0x0}));_0x513a60['find'](_0xe5d417=>'other'===_0xe5d417['id'])['actions']['push'](..._0x1ece3a),_0x513a60['forEach'](_0x3be7a0=>{if('actions'in _0x3be7a0)_0x3be7a0['actions']['forEach'](_0x1fe6e3=>{if(_0x1fe6e3['isEnabled']=!!_0x31e712['find'](_0x161714=>_0x161714['id']===_0x1fe6e3['model'])||void 0x0===_0x1fe6e3['model'],!_0x1fe6e3['isEnabled']){const _0x383492=new ht('ai-quick-actions-unavailable-model',this,{'actionId':_0x1fe6e3['id'],'modelId':_0x1fe6e3['model']});mt(_0x383492['message']);}});else{if(_0x3be7a0['isEnabled']=!!_0x31e712['find'](_0x56a7f2=>_0x56a7f2['id']===_0x3be7a0['model'])||void 0x0===_0x3be7a0['model'],!_0x3be7a0['isEnabled']){const _0x1aea4c=new ht('ai-quick-actions-unavailable-model',this,{'actionId':_0x3be7a0['id'],'modelId':_0x3be7a0['model']});mt(_0x1aea4c['message']);}}});}return _0x513a60;}['_initializeQuickActionsComponentsAndCommands'](){const _0x55004a=new Qt(this['editor']['locale']);_0x55004a['attachToDom'](),this['_initializeQuickActionsDropdown'](_0x55004a),this['_initializeQuickActionsMenuBar'](),this['_initializeQuickActionsComponents'](_0x55004a);}['_initializeQuickActionsDropdown'](_0x5eb317){const _0x4ddd50=this['editor']['config']['get']('ai.quickActions.isSearchEnabled')??!0x0;this['editor']['ui']['componentFactory']['add']('aiQuickActions',Ba({'editor':this['editor'],'content':this['_quickActionsDefinition'],'buttonDefinition':{'icon':_0x304454,'label':us(this['editor']['locale'],'AI_QUICK_ACTIONS_HEADING')},'bodyCollection':_0x5eb317,'hasSearch':_0x4ddd50}));}['_prepareQuickActionsDefinition'](_0x2fce85){this['_quickActionsDefinition']=_0x2fce85['map'](_0x5a1573=>{if('actions'in _0x5a1573){const _0x255b6a=_0x5a1573;return{..._0x255b6a,'actions':_0x255b6a['actions']['map'](_0x221938=>{const {actions:_0x15f3f2,..._0x1630f9}=_0x255b6a;return{..._0x221938,'parent':_0x1630f9};})['filter'](_0x4be3b3=>this['_shouldIncludeAction'](_0x4be3b3))};}return _0x5a1573;})['filter'](_0x4226c3=>'actions'in _0x4226c3?_0x4226c3['actions']['length']>0x0:this['_shouldIncludeAction'](_0x4226c3));}['_shouldIncludeAction'](_0x24036a){const _0x439389=this['editor']['config']['get']('ai.quickActions.removeCommands')||[];return this['editor']['plugins']['has'](Wa[_0x24036a['type']])&&!_0x439389['includes'](_0x24036a['id'])&&!(_0x24036a['type']===no['CHAT']&&!0x1===this['editor']['config']['get']('ai.chat.context.document.enabled'));}['_initializeQuickActionsComponents'](_0x485d4a){this['_quickActionsDefinition']['forEach'](_0x3b579b=>{if('actions'in _0x3b579b){const _0x4fa1d8=Ba({'editor':this['editor'],'content':_0x3b579b['actions'],'buttonDefinition':_0x3b579b,'bodyCollection':_0x485d4a});this['editor']['ui']['componentFactory']['add'](_0x3b579b['id'],_0x4fa1d8),_0x3b579b['actions']['forEach'](_0x951da6=>{const _0x5ebce0=Da({'editor':this['editor'],'action':_0x951da6});this['editor']['ui']['componentFactory']['add'](_0x951da6['id'],_0x5ebce0);});}else{const _0x21201a=Da({'editor':this['editor'],'action':_0x3b579b,'withText':!0x1,'withIcon':!0x0,'isInDropdown':!0x1});this['editor']['ui']['componentFactory']['add'](_0x3b579b['id'],_0x21201a);}});}['_initializeQuickActionsMenuBar'](){this['editor']['ui']['componentFactory']['add']('menuBar:aiQuickActions',_0x2899b2=>{const _0xc472fc=new Kt(_0x2899b2),_0x38c9c5=us(_0x2899b2,'AI_QUICK_ACTIONS_HEADING');_0xc472fc['buttonView']['set']({'label':_0x38c9c5,'icon':_0x304454});const _0x3c3fa1=new $t(_0x2899b2);_0x3c3fa1['set']({'ariaLabel':_0x38c9c5,'role':'menu'}),this['_quickActionsDefinition']['forEach'](_0x3f6921=>{if('actions'in _0x3f6921){const _0x80ba5=_0x3f6921,_0x4038ac=new qt(_0x2899b2,_0xc472fc),_0x4c7e4c=new Kt(_0x2899b2),_0x5568a6=new $t(_0x2899b2);_0x4c7e4c['buttonView']['set']({'label':_0x80ba5['label'],'icon':_0x80ba5['icon']}),_0x80ba5['actions']['forEach'](_0x4d459e=>{const _0x49b607=new qt(_0x2899b2,_0x4c7e4c),_0x5c7511=new Wt(_0x2899b2);_0x5c7511['set']({'label':_0x4d459e['label'],'icon':_0x4d459e['icon'],'role':'menuitem','isEnabled':_0x4d459e['isEnabled']}),_0x5c7511['on']('execute',()=>{this['_executeQuickAction'](_0x4d459e);}),_0x5c7511['delegate']('execute')['to'](_0x4c7e4c),_0x49b607['children']['add'](_0x5c7511),_0x5568a6['items']['add'](_0x49b607);}),_0x4c7e4c['panelView']['children']['add'](_0x5568a6),_0x4038ac['children']['add'](_0x4c7e4c),_0x3c3fa1['items']['add'](_0x4038ac);}else{const _0x58a4d3=_0x3f6921,_0x3ad2ca=new qt(_0x2899b2,_0xc472fc),_0x2c4fe1=new Wt(_0x2899b2);_0x2c4fe1['set']({'label':_0x58a4d3['label'],'icon':_0x58a4d3['icon'],'role':'menuitem','isEnabled':_0x58a4d3['isEnabled']}),_0x2c4fe1['on']('execute',()=>{this['_executeQuickAction'](_0x58a4d3);}),_0x2c4fe1['delegate']('execute')['to'](_0xc472fc),_0x3ad2ca['children']['add'](_0x2c4fe1),_0x3c3fa1['items']['add'](_0x3ad2ca);}});const _0x531180=Object['values'](Wa)['some'](_0x4f4152=>this['editor']['plugins']['has'](_0x4f4152));return _0xc472fc['set']({'isEnabled':_0x531180}),_0xc472fc['panelView']['children']['add'](_0x3c3fa1),_0xc472fc;});}['_executeQuickAction'](_0x403434){const _0x430da3=this['editor'];_0x430da3['editing']['view']['focus'](),_0x430da3['commands']['execute']('aiQuickAction',_0x403434);const _0x2de049=_0x430da3['ui']['view']['menuBarView'];_0x2de049&&_0x2de049['close']&&_0x2de049['close']();}}class $a extends _0x1e6161{['execute'](_0x429cd5){switch(this['_expandSelectionIfCollapsed'](),_0x429cd5['type']){case no['CHAT']:if(!this['editor']['plugins']['has']('AIChat')){const _0x22b311=us(this['editor']['locale'],'AI_QUICK_ACTIONS_PLUGIN_NOT_FOUND','AIChat');throw new ht('ai-quick-actions-plugin-not-found',this['editor'],{'errorMessage':_0x22b311});}this['_handleAIChatAction'](_0x429cd5);break;case no['ACTION']:if(!this['editor']['plugins']['has']('AIActions')){const _0x27c76d=us(this['editor']['locale'],'AI_QUICK_ACTIONS_PLUGIN_NOT_FOUND','AIActions');throw new ht('ai-quick-actions-plugin-not-found',this['editor'],{'errorMessage':_0x27c76d});}this['_handleAIActionsAction'](_0x429cd5);}}async['_handleAIChatAction'](_0x226150){const _0x13863c=this['editor']['plugins']['get']('AIChatController'),_0x45265f=this['editor']['plugins']['get']('AITabs')['view'];if(_0x45265f['isVisible']||(_0x45265f['isVisible']=!0x0),'chat'!==_0x45265f['activeTab']&&_0x45265f['activateTab']('chat'),'ask-ai'===_0x226150['id'])_0x13863c['removeSelectionFromChatContext'](),_0x13863c['addSelectionToChatContext'](),_0x13863c['focusPromptInput']();else await _0x13863c['startConversation'](),_0x13863c['removeSelectionFromChatContext'](),_0x13863c['addSelectionToChatContext'](),_0x13863c['focusPromptInput'](),await _0x13863c['sendMessage']({'message':_0x226150['prompt']||_0x226150['displayedPrompt']||_0x226150['label'],'attributes':{'quickActionData':{'id':_0x226150['id']},'displayedPrompt':_0x226150['displayedPrompt']}});}['_expandSelectionIfCollapsed'](){const _0x878a89=this['editor'],_0x4c9d3d=_0x878a89['model']['document']['selection'];if(!_0x4c9d3d['isCollapsed'])return;const _0x2dbf26=It(_0x4c9d3d['getSelectedBlocks']())||_0x878a89['model']['schema']['getLimitElement'](_0x4c9d3d);_0x878a89['model']['change'](_0x4d7f97=>{_0x4d7f97['setSelection'](_0x2dbf26,'in');});}['_handleAIActionsActionLabel'](_0x975d73){return _0x975d73['parent']?.['label']&&'other'!==_0x975d73['parent']?.['id']?_0x975d73['parent']['label']+':\x20'+_0x975d73['label']:_0x975d73['label'];}async['_handleAIActionsAction'](_0x426486){const _0x17f4cf=this['editor']['plugins']['get']('AIActions'),_0x3e73ad=_0x426486['prompt']?{'userMessage':_0x426486['prompt'],'model':_0x426486['model']}:{'actionName':_0x426486['actionName']||_0x426486['id'],'args':_0x426486['args']},_0x5e1f6f=this['_handleAIActionsActionLabel'](_0x426486);await _0x17f4cf['executeAction'](_0x3e73ad,_0x5e1f6f,_0x426486['icon']);}}class qa extends _0x3e16f7{static get['pluginName'](){return'AIQuickActionsEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const _0x4543fd=this['editor'],_0x620bda=new $a(this['editor']);if(_0x4543fd['commands']['add']('aiQuickAction',_0x620bda),_0x4543fd['plugins']['has']('AIChat')){const _0x2fbc75=this['editor']['plugins']['get']('AIChatController');_0x4543fd['model']['document']['selection']['on']('change:range',(_0x517252,_0x1f1d9f)=>{_0x1f1d9f['directChange']&&_0x2fbc75['removeSelectionFromChatContext']();});}}}class Qa extends Ps{['updateChangeGroups'](){if(this['parsedMergedContent']=this['parsedContent']['cloneNode'](!0x0),0x0==this['parsedMergedContent']['childNodes']['length'])return void(this['changeGroups']=[]);const _0x124574=this['documentContextContent']['children']['map'](_0x4dfc53=>({'node':_0x4dfc53,'id':ms(_0x4dfc53,'data-id')})),_0x471426=this['parsedMergedContent']['children']['map'](_0x16c84f=>({'node':_0x16c84f,'id':ms(_0x16c84f,'data-id')||ot()})),_0x4a53c3=_0x5260b4(_0x124574,_0x471426,{'comparator':(_0x257147,_0x4220c6)=>_0x257147['id']==_0x4220c6['id'],'oneChangePerToken':!0x0});if(!this['isDone']){for(;_0x4a53c3['length']&&_0x4a53c3[_0x4a53c3['length']-0x1]['removed'];)_0x4a53c3['pop']();}const _0x21ffb7=_0x4a53c3['map'](_0x2be3f7=>{const _0x10d795=_0x2be3f7['added']?'new':_0x2be3f7['removed']?'removed':'modified';return{'node':_0x2be3f7['value'][0x0]['node'],'type':_0x10d795,'id':_0x2be3f7['value'][0x0]['id']};});this['changeGroups']=[{'changes':_0x21ffb7,'state':'pending','index':0x0}];}['_getDifferentChangeGroups'](_0x28f3ca,_0x12a15f){return _0x12a15f;}}class Xa extends Ms{['content'];['version'];['actionName'];['args'];['userMessage'];['model'];['hasError']=!0x1;constructor(_0x3f386e){super(_0x3f386e),this['content']=_0x3f386e['content'],this['version']=_0x3f386e['version'],this['actionName']=_0x3f386e['actionName'],this['args']=_0x3f386e['args'],this['userMessage']=_0x3f386e['userMessage'],this['model']=_0x3f386e['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'](_0x331674){const _0x10e130=new Qa({'editor':this['editor'],'documentContextContent':this['content'],..._0x331674});return this['replies']['push'](_0x10e130),_0x10e130['delegate'](...Hs)['to'](this),this['fire']('replyCreated',_0x10e130),_0x10e130;}}class za extends kt{constructor(_0x8319fb,_0x99ee0a=!0x0,_0x2c6bce=!0x0){super(_0x8319fb),this['set']('isEnabled',!0x1),_0x99ee0a&&(this['applyButton']=this['_createButton'](us(_0x8319fb,'AI_BALLOON_APPLY_BUTTON'),ds),this['applyButton']['bind']('isEnabled')['to'](this),this['items']['add'](this['applyButton'])),_0x2c6bce&&(this['suggestButton']=this['_createButton'](us(_0x8319fb,'AI_BALLOON_SUGGEST_BUTTON'),_0x99ee0a?_s:ds),this['suggestButton']['bind']('isEnabled')['to'](this),this['items']['add'](this['suggestButton'])),this['setButtonsVisibility']({'showApplyButton':_0x99ee0a,'showSuggestButton':_0x2c6bce}),this['extendTemplate']({'attributes':{'class':['ck-ai-balloon__toolbar']}});}['setButtonsVisibility']({showApplyButton:_0x2bc2bf,showSuggestButton:_0x24a416}){this['applyButton']&&(this['applyButton']['isVisible']=_0x2bc2bf),this['suggestButton']&&(this['suggestButton']['isVisible']=_0x24a416);}['_createButton'](_0x1cd128,_0x1145a4){const _0x381de4=new Nt(this['locale']);return _0x381de4['set']({'label':_0x1cd128,'class':_0x1145a4,'isVisible':!0x0,'withText':!0x0}),_0x381de4;}}class ja extends vt{constructor(_0x1a65de){super(_0x1a65de),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(_0x1a65de,'AI_DISCLAIMER_TEXT')}]}]});}}class Ja extends vt{constructor(_0x1cc3d8){super(_0x1cc3d8),this['set']('isVisible',!0x0);const _0x558872=new vn('small');_0x558872['isVisible']=!0x0;const _0x37c539=new vt(this['locale']);_0x37c539['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',_0x1a0000=>!_0x1a0000)]},'children':[_0x558872,_0x37c539]});}}class Za extends Ra{['focusCycler'];['_config'];['_contentWrapper'];['_streamableContentView'];['_toolbarView'];['_miniToolbarView'];['_loaderView'];['_disclaimerView'];['_focusTracker'];['_keystrokes'];['_dialogContent'];['_focusables'];['_scrollManager'];['_navigationPreviousButton'];['_navigationNextButton'];['_navigationTryAgainButton'];['_navigationCounter'];constructor(_0x6eb68a,_0x30cd3a){super(_0x6eb68a),this['set']('isBusy',!0x1),this['set']('isTrackChangesOn',!0x1),this['set']('_isLoading',!0x1),this['set']('_hasError',!0x1),this['_config']=_0x30cd3a,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 _0x54c5cf(),this['_addContentWrapper'](_0x30cd3a),this['_addDisclaimerView'](),this['_addToolbar'](_0x30cd3a),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'](_0x30cd3a);});}['render'](){super['render']();for(const _0x4373f6 of this['_focusables'])this['_focusTracker']['add'](_0x4373f6['element']);this['_keystrokes']['listenTo'](this['element']),this['_initializeScrollManager']();}['destroy'](){super['destroy'](),this['_scrollManager']&&this['_scrollManager']['destroy']();}['focus'](_0x570ec7){-0x1===_0x570ec7?this['focusCycler']['focusLast']():this['focusCycler']['focusFirst']();}['setIsLoading'](_0x6a6162){this['_isLoading']=_0x6a6162;}['setErrorState'](){this['_hasError']=!0x0,this['_miniToolbarView']['toggleShowChangesEnabled'](!0x1);}['clearErrorState'](){this['_hasError']=!0x1,this['_miniToolbarView']['toggleShowChangesEnabled'](!0x0);}['showError'](_0x27788e){super['showError'](_0x27788e),this['_dialogContent']['has'](this['_errorView'])||this['_dialogContent']['add'](this['_errorView'],0x0);}['hideError'](){super['hideError'](),this['clearErrorState']();}['showBlockingError'](_0x3c71e5){super['showBlockingError'](_0x3c71e5),this['setErrorState']();}['addMiniToolbarItem'](_0x342f36){this['_miniToolbarView']['items']['has'](_0x342f36)||this['_miniToolbarView']['items']['add'](_0x342f36);}['removeMiniToolbarItem'](_0xfa40ac){this['_miniToolbarView']['items']['has'](_0xfa40ac)&&this['_miniToolbarView']['items']['remove'](_0xfa40ac);}['showLoader'](){this['_loaderView']&&(this['_isLoading']=!0x0);}['hideLoader'](){this['_loaderView']&&(this['_isLoading']=!0x1);}['_toggleToolbarButtonsVisibility']({showApplyButton:_0x89e58e,showSuggestButton:_0x4a3e45}){_0x89e58e=_0x89e58e&&!this['isTrackChangesOn']&&this['_config']['availableActions']['includes']('applySuggestion'),_0x4a3e45=_0x4a3e45&&this['_config']['availableActions']['includes']('insertSuggestion'),this['_toolbarView']['setButtonsVisibility']({'showApplyButton':_0x89e58e,'showSuggestButton':_0x4a3e45});}async['updateContent'](_0x4d6768){await this['_streamableContentView']['update'](_0x4d6768);}['clearContent'](){this['_streamableContentView']['clear']();}['_addContentWrapper'](_0x51858a){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'](_0x51858a['miniToolbarConfig'])]}),this['_dialogContent']['add'](this['_contentWrapper']);}['_addDisclaimerView'](){this['_disclaimerView']=new ja(this['locale']),this['_dialogContent']['add'](this['_disclaimerView']);}['_addToolbar']({showApplyButton:_0x109f32,showSuggestButton:_0x402c36}){this['_toolbarView']=new za(this['locale'],_0x109f32,_0x402c36),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',(_0x4fedda,_0xa53ab3,_0x9e68eb)=>!(_0x4fedda||_0xa53ab3||_0x9e68eb)),this['_toggleToolbarButtonsVisibility']({'showApplyButton':_0x109f32,'showSuggestButton':_0x402c36}),this['_dialogContent']['add'](this['_toolbarView']);}['_createMiniToolbar'](_0x5c4a0b){return this['_miniToolbarView']=new Na(this['locale'],_0x5c4a0b),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',(_0x52e789,_0x16f9a1)=>!(_0x52e789||_0x16f9a1)),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 _0x1735c1=new Nt(this['locale']),_0x27c9cb=new Nt(this['locale']),_0x3dc7ae=new to(this['locale']),_0x45b742=new Nt(this['locale']);_0x1735c1['set']({'icon':et,'label':us(this['locale'],'AI_ACTIONS_TRY_AGAIN'),'tooltip':!0x0,'class':'ck-ai-custom-action-button\x20'+As}),_0x27c9cb['set']({'icon':_0xf8587c,'tooltip':us(this['locale'],'AI_ACTIONS_PREVIOUS_INTERACTION'),'class':'ck-ai-navigation-button\x20ck-ai-previous-button\x20'+As}),_0x45b742['set']({'icon':it,'tooltip':us(this['locale'],'AI_ACTIONS_NEXT_INTERACTION'),'class':'ck-ai-navigation-button\x20ck-ai-next-button\x20'+As}),_0x1735c1['bind']('isEnabled')['to'](this,'isBusy',_0x145f7f=>!_0x145f7f),_0x1735c1['on']('execute',()=>{this['fire']('tryAgain');}),_0x27c9cb['bind']('isEnabled')['to'](this,'isBusy',_0x2c7903=>!_0x2c7903),_0x27c9cb['on']('execute',()=>{this['fire']('showPrevious');}),_0x45b742['bind']('isEnabled')['to'](this,'isBusy',_0x40dfde=>!_0x40dfde),_0x45b742['on']('execute',()=>{this['fire']('showNext');}),this['_navigationPreviousButton']=_0x27c9cb,this['_navigationCounter']=_0x3dc7ae,this['_navigationNextButton']=_0x45b742,this['_navigationTryAgainButton']=_0x1735c1;}['updateMiniToolbarButtons'](_0x45b54e,_0x3d7c3b){this['_navigationPreviousButton']||this['_setupMiniToolbarButtons']();const _0x3abfd5=_0x45b54e>0x1;if(this['addMiniToolbarItem'](this['_navigationTryAgainButton']),_0x3abfd5){this['addMiniToolbarItem'](this['_navigationPreviousButton']),this['addMiniToolbarItem'](this['_navigationCounter']),this['addMiniToolbarItem'](this['_navigationNextButton']);const _0x2bdef8=_0x45b54e-_0x3d7c3b;this['_navigationCounter']['setInteractionCount'](_0x2bdef8+'/'+_0x45b54e),this['_navigationPreviousButton']['isEnabled']=_0x3d7c3b<_0x45b54e-0x1,this['_navigationNextButton']['isEnabled']=_0x3d7c3b>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'](_0x55e226){this['_isLoading']=_0x55e226;}['resetShowChangesButton'](){this['_miniToolbarView']['isShowChangesOn']=!0x1;}['_initializeScrollManager'](){const _0x24d315=this['_getScrollableElement']();_0x24d315&&!this['_scrollManager']&&(this['_scrollManager']=new ir(_0x24d315));}['_getScrollableElement'](){return this['_streamableContentView']['element'];}}class to extends vt{constructor(_0x170232){super(_0x170232);const _0x14a0b3=this['bindTemplate'];this['set']('interactionCount','1/1'),this['setTemplate']({'tag':'span','attributes':{'class':['ck-ai-interaction-counter']},'children':[{'text':_0x14a0b3['to']('interactionCount')}]});}['setInteractionCount'](_0x2b01f3){this['set']('interactionCount',_0x2b01f3);}}class eo extends _0x3e16f7{static get['requires'](){return[ls,Bt,tn,ka,_0x2da15a];}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(_0x118475){super(_0x118475),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'](_0x5b6dfe,_0x4db054,_0x363774){if(this['_stopInteraction'](),this['editor']['plugins']['has']('TableSelection')){if(this['editor']['plugins']['get']('TableSelection')['getSelectedTableCells']()){const {modelFragment:_0x320ad9,anchorData:_0x4d4be3}=this['_getExecuteDataInTable']();return this['_executeAction'](_0x5b6dfe,_0x320ad9,_0x4d4be3,_0x4db054,_0x363774);}}const {modelFragment:_0x3c8fc4,anchorData:_0x5054f1}=this['_getExecuteDataRegular']();return this['_executeAction'](_0x5b6dfe,_0x3c8fc4,_0x5054f1,_0x4db054,_0x363774);}async['destroy'](){return this['_stopInteraction'](),this['_bodyCollection']['detachFromDom'](),super['destroy']();}['_createActionsBalloonView'](){const _0x13c2b1=this['editor']['plugins']['has']('TrackChanges');let _0x3ce626=this['editor']['config']['get']('ai.availableReplyActions')||[...wn];_0x13c2b1||(_0x3ce626=_0x3ce626['filter'](_0x4d717e=>'insertSuggestion'!=_0x4d717e));const _0x50930a=this['editor']['commands']['get']('trackChanges'),_0x3d2de5=new Za(this['editor']['locale'],{'showApplyButton':!0x0,'showSuggestButton':_0x13c2b1,'miniToolbarConfig':{'showChanges':'icon'},'availableActions':_0x3ce626});return _0x3d2de5['bind']('isBusy')['to'](this),_0x50930a&&_0x3d2de5['bind']('isTrackChangesOn')['to'](_0x50930a,'value'),_0x3d2de5['on']('tryAgain',()=>{this['_refreshInteraction']();}),_0x3d2de5['on']('showPrevious',()=>{this['_navigateToPrevious']();}),_0x3d2de5['on']('showNext',()=>{this['_navigateToNext']();}),_0x3d2de5;}['_getExecuteDataRegular'](){const _0x3ace22=this['editor']['model']['document']['selection'];if(_0x3ace22['isCollapsed']){const _0xc7b3a6=It(_0x3ace22['getSelectedBlocks']())||this['editor']['model']['schema']['getLimitElement'](_0x3ace22);this['editor']['model']['change'](_0x32d8e5=>{_0x32d8e5['setSelection'](_0xc7b3a6,'in');});}const _0xceec0b=_0x3ace22['getFirstRange'](),_0xd5763b=this['_wrapWithCommonAncestors'](this['editor']['model']['getSelectedContent'](_0x3ace22),_0xceec0b['start'],_0xceec0b['end']);this['_copyMarkersToFragment'](_0xd5763b,_0x3ace22,{'isTableSelection':!0x1});const _0x527c9d=_0x3ace22['getFirstRange']()['start'],_0x4dc031=new Map();let _0xc42d5=_0xd5763b;for(let _0x2665aa=0x0;_0x2665aa<_0x527c9d['path']['length'];_0x2665aa++)_0x4dc031['set'](_0xc42d5,_0x527c9d['path'][_0x2665aa]),_0xc42d5=_0xc42d5['getChild'](0x0);return{'modelFragment':_0xd5763b,'anchorData':_0x4dc031};}['_getExecuteDataInTable'](){const _0x215a38=this['editor']['model']['document']['selection'],_0x4e703a=this['editor']['plugins']['get']('TableSelection')['getSelectionAsFragment'](),_0xd85df=_0x215a38['getFirstRange']()['start']['parent']['parent'],_0x39d144=this['editor']['model']['createRange'](this['editor']['model']['createPositionBefore'](_0xd85df),this['editor']['model']['createPositionAfter'](_0xd85df)),_0xd153a1=this['_wrapWithCommonAncestors'](_0x4e703a,_0x39d144['start'],_0x39d144['end']);this['_copyMarkersToFragment'](_0xd153a1,_0x215a38,{'isTableSelection':!0x0});const _0x373997=_0x215a38['getFirstRange']()['start'],_0x59358e=new Map();let _0x36bff1=_0xd153a1;for(let _0x12917e=0x0;_0x12917e<_0x373997['path']['length'];_0x12917e++)if(_0x59358e['set'](_0x36bff1,_0x373997['path'][_0x12917e]),_0x12917e<_0x373997['path']['length']-0x1)_0x36bff1=_0x36bff1['getChild'](0x0);else{let _0x35a15c=_0x36bff1['nextSibling'];for(;_0x35a15c;)_0x59358e['set'](_0x35a15c,_0x373997['path'][_0x12917e]),_0x35a15c=_0x35a15c['nextSibling'];}return{'modelFragment':_0xd153a1,'anchorData':_0x59358e};}async['_executeAction'](_0x164f70,_0x1d91b5,_0x3cac3b,_0x11f940,_0x5bc28f){const _0x4c8855=this['editor']['plugins']['get'](tn),_0x4895ae=this['editor']['plugins']['get'](ka),_0x25e25b=this['editor']['model']['document']['selection'],_0xcd1032=await _0x4c8855['modelToDataWithIds'](_0x1d91b5),_0x27e5c3=this['editor']['model']['document']['version'],_0x3860d2=[..._0x25e25b['getRanges']()];return this['_actionsBalloonView']||(this['_actionsBalloonView']=this['_createActionsBalloonView']()),this['_clearInteractionHistory'](),this['_clearErrorState'](),this['_balloonShowDiff']=!0x1,this['_actionsBalloonView']['resetShowChangesButton'](),this['_actionsBalloonView']['clearContent'](),_0x4895ae['open']({'index':0x3e8*Math['random']()%0x3e8,'title':_0x11f940,'icon':_0x5bc28f||_0x304454,'mainView':this['_actionsBalloonView'],'class':'ck-ai-actions-balloon','ranges':_0x3860d2,'id':'aiActionsBalloon'}),this['_setLoadingState'](),this['stopListening'](this['_actionsBalloonView']),this['stopListening'](_0x4895ae),this['_interactionParams']={'action':_0x164f70,'content':_0xcd1032,'version':_0x27e5c3,'aiBalloon':_0x4895ae,'modelFragment':_0x1d91b5,'anchorData':_0x3cac3b},this['_setupApplyListeners'](),this['listenTo'](_0x4895ae,'selectionRemoved',()=>{this['_stopInteraction'](),this['_actionsBalloonView']['disableMiniToolbarButtons']();}),this['listenTo'](_0x4895ae,'dialogClosed',(_0x276802,{id:_0x164067})=>{if('aiActionsBalloon'===_0x164067){if(this['_interaction']&&this['_interaction']['replies']['length']>0x0){const _0x590827=this['_interaction']['replies'][this['_interaction']['replies']['length']-0x1],_0x2d6416=_0x590827['changeGroups'][0x0];_0x2d6416&&'pending'===_0x2d6416['state']&&_0x590827['setChangeGroupState'](0x0,'rejected');}this['_stopInteraction'](),this['_clearInteractionHistory'](),this['stopListening'](this['_actionsBalloonView']),this['stopListening'](_0x4895ae);}}),this['_createInteraction'](_0xcd1032,_0x27e5c3,_0x4895ae,_0x164f70);}['_setupApplyListeners'](){if(!this['_interactionParams'])return;const {modelFragment:_0x49b972,anchorData:_0x476440}=this['_interactionParams'];this['listenTo'](this['_actionsBalloonView'],'applySuggestion',()=>{this['_applyChanges'](_0x49b972,_0x476440,!0x1);}),this['listenTo'](this['_actionsBalloonView'],'insertSuggestion',()=>{this['_applyChanges'](_0x49b972,_0x476440,!0x0);});}['_wrapWithCommonAncestors'](_0x5645cc,_0x401c4d,_0x53a9f3){const _0x53c116=this['editor']['model']['createRange'](_0x401c4d,_0x53a9f3)['getCommonAncestor'](),_0x24f316=_0x53c116['is']('documentFragment')?[]:_0x53c116['getAncestors']({'includeSelf':!0x0})['slice'](0x1);if(_0x24f316['length']){const _0x4f3c39=_0x24f316['map'](_0x1196b4=>_0x1196b4['_clone'](!0x1));for(let _0x39e4c3=0x1;_0x39e4c3<_0x4f3c39['length'];_0x39e4c3++)_0x4f3c39[_0x39e4c3-0x1]['_appendChild'](_0x4f3c39[_0x39e4c3]);return _0x4f3c39[_0x4f3c39['length']-0x1]['_appendChild'](_0x5645cc),new _0x29280d(_0x4f3c39[0x0]);}return _0x5645cc;}['_copyMarkersToFragment'](_0x428252,_0x132309,_0x170dcb={'isTableSelection':!0x1}){const _0x31f88d=this['editor']['model'],_0xddc8b8=Array['from'](_0x132309['getRanges']()),_0x362601=_0x132309['getFirstRange']()['start'];for(const _0x337caa of _0x31f88d['markers']){if(_0x337caa['name']['startsWith'](Zs)||!_0x337caa['affectsData'])continue;const _0x9bb3a4=_0x337caa['getRange']();if(!_0xddc8b8['some'](_0x87973f=>_0x87973f['containsRange'](_0x9bb3a4,!0x0)))continue;const _0x453e6b=this['_regularCalculateMarkerPath'](_0x9bb3a4['start'],_0x362601,_0x170dcb['isTableSelection']),_0x47f8ab=this['_regularCalculateMarkerPath'](_0x9bb3a4['end'],_0x362601,_0x170dcb['isTableSelection']),_0x292523=_0x31f88d['createPositionFromPath'](_0x428252,_0x453e6b),_0x8113d1=_0x31f88d['createPositionFromPath'](_0x428252,_0x47f8ab);if(!_0x292523['isEqual'](_0x8113d1)){const _0x3287f3=_0x31f88d['createRange'](_0x292523,_0x8113d1);_0x428252['markers']['set'](_0x337caa['name'],_0x3287f3);}}}['_regularCalculateMarkerPath'](_0x10afe5,_0x48c3c8,_0x5ddffe=!0x1){const _0x2c479f=[..._0x10afe5['path']['slice']()];for(let _0x5822bf=0x0;_0x5822bf<Math['max'](_0x48c3c8['path']['length'],_0x10afe5['path']['length']);_0x5822bf++){const _0x50267c=_0x48c3c8['path'][_0x5822bf]||0x0,_0xa86222=(_0x10afe5['path'][_0x5822bf]||0x0)-_0x50267c;if(_0x2c479f[_0x5822bf]=_0xa86222,0x0!==_0xa86222&&!_0x5ddffe)break;}return _0x2c479f;}async['_createInteraction'](_0x442a41,_0x160a21,_0x258ddf,_0x528c87){const _0x21d791=this['editor'];this['_interactionParams']||(this['_interactionParams']={'action':_0x528c87,'content':_0x442a41,'version':_0x160a21,'aiBalloon':_0x258ddf,'modelFragment':this['editor']['model']['getSelectedContent'](this['editor']['model']['document']['selection']),'anchorData':new Map()});const _0x2f026d=new Xa({'connector':this['_aiConnector'],'editor':_0x21d791,'content':_0x442a41,'version':_0x160a21,..._0x528c87});this['_interactions']['push'](_0x2f026d);const _0x54d0a0=(_0x68e69,_0xc86ac2=!0x1,_0x25b091='streaming')=>this['_promiseQueue']['enqueue'](async _0x4bf838=>{try{const _0x4ce1c9=Ns({'editor':_0x21d791,'changeGroups':_0x68e69['changeGroups'],'documentContextContent':_0x68e69['documentContextContent'],'showDiff':_0xc86ac2,'trimUnchanged':!0x1});_0x4ce1c9['length']&&await this['_actionsBalloonView']['updateContent']({'part':_0x4ce1c9[0x0],'renderingStrategy':_0x25b091,'abortSignal':_0x4bf838});}catch(_0xd07f25){if(this['_isAbortError'](_0xd07f25))return;throw _0xd07f25;}});this['_interaction']['on']('replyCreated',(_0xaaaf16,_0x1a795d)=>{this['_actionsBalloonView']['hideLoader'](),this['_actionsBalloonView']['startAutoScroll'](),_0x54d0a0(_0x1a795d)['catch'](_0x4b0253=>{this['_isAbortError'](_0x4b0253)||(console['error']('Error\x20updating\x20content\x20in\x20replyCreated:',_0x4b0253),this['_setErrorState'](_0x2f026d));});}),this['_interaction']['on']('replyContentUpdated',(_0x44562d,_0x2f4996)=>{_0x54d0a0(_0x2f4996)['catch'](_0x5558be=>{this['_isAbortError'](_0x5558be)||(console['error']('Error\x20updating\x20content\x20in\x20replyContentUpdated:',_0x5558be),this['_setErrorState'](_0x2f026d));});}),this['_interaction']['on']('interactionFinished',async()=>{try{await this['_clearLoadingState'](),this['_actionsBalloonView']['updateMiniToolbarButtons'](this['_interactions']['length'],this['_currentInteractionIndex']),await this['_promiseQueue']['queueEmptyPromise'];}catch(_0x45eb60){this['_isAbortError'](_0x45eb60)||(console['error']('Error\x20clearing\x20loading\x20state\x20in\x20interactionFinished:',_0x45eb60),this['_setErrorState'](_0x2f026d));}finally{this['_actionsBalloonView']['stopAutoScroll']();}}),this['listenTo'](this['_actionsBalloonView'],'toggleSuggestionDisplayMode',async(_0x46673b,{showDiff:_0x107b4f})=>{try{this['_balloonShowDiff']=_0x107b4f;const _0x4acf61=this['_interaction']['replies'][this['_interaction']['replies']['length']-0x1];_0x4acf61&&await _0x54d0a0(_0x4acf61,_0x107b4f,'static');}catch(_0x15a8e){this['_isAbortError'](_0x15a8e)||(console['error']('Error\x20updating\x20content\x20in\x20toggleSuggestionDisplayMode:',_0x15a8e),this['_setErrorState'](_0x2f026d));}}),this['_interaction']['on']('replyChangeGroupStateUpdated',(_0x30444e,{reply:_0x4123b0})=>{const _0x53afde={'positiveCount':_0x4123b0['changeGroups']['filter'](_0x1d07ff=>'accepted'===_0x1d07ff['state'])['length'],'totalCount':_0x4123b0['changeGroups']['length']},_0x527b27=this['_interaction']['actionCallId'],_0x1e3757=this['_interaction']['actionName'];_0x1e3757?this['_aiConnector']['upsertAIActionRating'](_0x1e3757,_0x527b27,_0x53afde):this['_aiConnector']['upsertCustomAIActionRating'](_0x527b27,_0x53afde);}),this['_setLoadingState']();try{const _0x58c138=await this['_interaction']['start']();return this['_actionsBalloonView']['updateMiniToolbarButtons'](this['_interactions']['length'],this['_currentInteractionIndex']),_0x58c138;}catch(_0x13c39a){if(this['_isAbortError'](_0x13c39a))return;this['_actionsBalloonView']['hideLoader'](),this['_setErrorState'](_0x2f026d);}}['_applyChanges'](_0x391af1,_0x522d25,_0x484175){const _0x185401=this['editor'];if(_0x484175&&!_0x185401['plugins']['has']('TrackChanges'))throw new ht('ai-no-track-changes',null);const _0x18add0=this['editor']['plugins']['get'](_0x2da15a),_0x2374a5=this['_interactions'][this['_interactions']['length']-0x1-this['_currentInteractionIndex']];if(!_0x2374a5||!_0x2374a5['replies']['length'])return;const _0x42c91d=_0x2374a5['replies'][_0x2374a5['replies']['length']-0x1],_0x564631=_0x42c91d['changeGroups'];_0x42c91d['setChangeGroupState'](0x0,'accepted');let _0x521883=zs({'editor':_0x185401,'reply':_0x42c91d,'interaction':_0x2374a5,'groups':_0x564631,'transform':!0x1,'documentCompare':_0x18add0,'documentCompareOptions':{'anchor':_0x185401['model']['createPositionAt'](_0x391af1,0x0),'markDeletions':_0x484175}});_0x521883=this['_filterOperationsOutsideRange'](_0x521883,_0x522d25);for(const _0x3356ee of _0x521883)this['_anchorOperation'](_0x522d25,_0x3356ee,_0x185401['model']['document']['getRoot']());const _0x450a9f=_0x2374a5['getDocumentContext']()['version'],_0x361608=_0x185401['model']['document']['history']['getOperations'](_0x450a9f),_0x3fc930={'document':_0x185401['model']['document'],'useRelations':!0x1,'padWithNoOps':!0x1},_0x345455=_0x54e22b(_0x521883,_0x361608,_0x3fc930)['operationsA'];_0x185401['model']['change'](_0x3f2327=>{if(_0x3f2327['setSelection'](_0x185401['model']['document']['selection']['focus']),_0x484175)_0x185401['plugins']['get']('TrackChangesEditing')['_applyOperationsAsSuggestions'](_0x345455);else{for(const _0x5091cc of _0x345455)_0x5091cc['baseVersion']=_0x185401['model']['document']['version'],js(_0x185401,_0x5091cc),_0x3f2327['batch']['addOperation'](_0x5091cc),_0x185401['model']['applyOperation'](_0x5091cc);}}),this['editor']['plugins']['get']('AIBalloon')['close']();}['_filterOperationsOutsideRange'](_0x5709ad,_0x5478d0){return _0x5709ad['filter'](_0x4c9f2c=>{if('rename'==_0x4c9f2c['type']){const _0x3c2d1d=_0x4c9f2c['position']['nodeAfter'];return!_0x5478d0['has'](_0x3c2d1d);}if(_0x4c9f2c['type']['indexOf']('Attribute')>-0x1){const _0x473915=_0x4c9f2c['range']['start']['nodeAfter'];return!_0x5478d0['has'](_0x473915);}return!0x0;});}['_anchorOperation'](_0x54feda,_0x16b179,_0x20c40f){const _0x4193cc=_0x16b179['clone']();for(const _0x49b85f in _0x16b179){const _0x158f1d=_0x16b179[_0x49b85f];_0x158f1d instanceof _0x5258a6?_0x16b179[_0x49b85f]=new _0x5258a6(_0x17e365(_0x158f1d['start']),_0x17e365(_0x158f1d['end'])):_0x158f1d instanceof _0x55a2cf&&(_0x16b179[_0x49b85f]=_0x17e365(_0x158f1d));}if(['insert','move','remove','reinsert','split','merge']['includes'](_0x4193cc['type'])){if(_0x4193cc['isDocumentOperation']=!0x1,_0x4193cc['baseVersion']=null,'remove'==_0x4193cc['type']){const _0x46dc4e=_0x4193cc['sourcePosition'],_0x573537=_0x4193cc['howMany'];new _0x2a791f(_0x46dc4e,_0x573537)['_execute']();}else _0x4193cc['_execute']();}function _0x17e365(_0x2da06f){if('$graveyard'==_0x2da06f['root']['rootName'])return _0x2da06f;const _0x462ed5=[];let _0x53a89d=_0x2da06f['root'];for(let _0x3bfca8=0x0;_0x3bfca8<_0x2da06f['path']['length'];_0x3bfca8++){const _0x224193=_0x54feda['get'](_0x53a89d)||0x0;_0x462ed5[_0x3bfca8]=_0x2da06f['path'][_0x3bfca8]+_0x224193,_0x53a89d=_0x53a89d['getChildAtOffset'](_0x2da06f['path'][_0x3bfca8]);}return new _0x55a2cf(_0x20c40f,_0x462ed5,_0x2da06f['stickiness']);}}['_refreshInteraction'](){if(!this['_interactionParams'])return;this['_interactions']['length']>0x0&&this['_stopInteraction'](),this['_currentInteractionIndex']=0x0,this['_balloonShowDiff']=!0x1;const {action:_0x2bb8b5,content:_0x6a174f,version:_0x30bb80,aiBalloon:_0x2a260e}=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'](_0x6a174f,_0x30bb80,_0x2a260e,_0x2bb8b5)['catch'](_0x192b6a=>{this['_isAbortError'](_0x192b6a)||console['error']('Error\x20refreshing\x20interaction:',_0x192b6a);});}['_isAbortError'](_0x4cbdb4){return!!_0x4cbdb4['message']&&_0x4cbdb4['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 _0x49c06f=this['_interactions']['length'];this['_currentInteractionIndex']<_0x49c06f-0x1&&this['_displayInteractionAtIndex'](this['_currentInteractionIndex']+0x1);}['_navigateToNext'](){this['_currentInteractionIndex']>0x0&&this['_displayInteractionAtIndex'](this['_currentInteractionIndex']-0x1);}async['_displayInteractionAtIndex'](_0x148d96){if(!this['_interactionParams'])return;this['_currentInteractionIndex']=_0x148d96;const _0x20511d=this['_interactions'][this['_interactions']['length']-0x1-this['_currentInteractionIndex']];if(!_0x20511d)return;if(_0x20511d['hasError'])return this['_setErrorState'](_0x20511d),void this['_actionsBalloonView']['updateMiniToolbarButtons'](this['_interactions']['length'],this['_currentInteractionIndex']);if(!_0x20511d['replies']['length'])return;this['_actionsBalloonView']['hideError'](),this['_interactionParams']&&this['_clearErrorState']();const _0x52d0bd=_0x20511d['replies'][_0x20511d['replies']['length']-0x1];if(_0x52d0bd){const _0x42c3f3=this['editor'];try{const _0x5ce7ce=Ns({'editor':_0x42c3f3,'changeGroups':_0x52d0bd['changeGroups'],'documentContextContent':_0x52d0bd['documentContextContent'],'showDiff':this['_balloonShowDiff'],'trimUnchanged':!0x1});await new Promise(_0x5bc4fd=>setTimeout(_0x5bc4fd,0x32)),await this['_actionsBalloonView']['updateContent']({'part':_0x5ce7ce[0x0],'renderingStrategy':'static','abortSignal':new AbortController()['signal']});}catch(_0x323246){this['_isAbortError'](_0x323246)||console['error']('Error\x20updating\x20content\x20during\x20navigation:',_0x323246);}}this['_actionsBalloonView']['updateMiniToolbarButtons'](this['_interactions']['length'],this['_currentInteractionIndex']);}['_setLoadingState'](){this['_actionsBalloonView']['setIsLoading'](!0x0),this['isBusy']=!0x0;}async['_setErrorState'](_0xe6388f){const _0x4f383a=us(this['editor']['locale'],'AI_ACTIONS_GENERIC_ERROR');this['_actionsBalloonView']['showError'](_0x4f383a),_0xe6388f['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(_0x1edc71){return _0x1edc71['CONTINUE']='continue',_0x1edc71['FIX_GRAMMAR']='fix-grammar',_0x1edc71['IMPROVE_WRITING']='improve-writing',_0x1edc71['MAKE_LONGER']='make-longer',_0x1edc71['MAKE_SHORTER']='make-shorter',_0x1edc71['MAKE_TONE_CASUAL']='make-tone-casual',_0x1edc71['MAKE_TONE_FORMAL']='make-tone-formal',_0x1edc71['TRANSLATE']='translate',_0x1edc71;}({});class so extends _0x3e16f7{static get['requires'](){return[Ya,qa,eo];}static get['pluginName'](){return'AIQuickActions';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x13bab1){super(_0x13bab1),_0x13bab1['config']['define']('ai.quickActions',{'extraCommands':[],'removeCommands':[],'isSearchEnabled':!0x0});}}var no=function(_0x144e68){return _0x144e68['CHAT']='chat',_0x144e68['ACTION']='action',_0x144e68;}({});class ro extends vt{['resultResponseView'];['acceptButtonView'];['dismissButtonView'];['infoButtonView'];['outdatedButtonView'];constructor(_0xf46785,_0x421952){super(_0xf46785),this['id']=_0x421952,this['set']('status','pending'),this['set']('changeId',_0x421952),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',(_0x5cdee7,_0x579673)=>{_0x579673&&_0x579673['target']&&'A'===_0x579673['target']['tagName']&&_0x579673['preventDefault'](),this['fire']('activateChange',{'id':_0x421952,'source':this,'uiInteraction':'click'});}),this['on']('mouseover',()=>{this['fire']('activateChange',{'id':_0x421952,'source':this,'uiInteraction':'hover'});}),this['on']('mouseout',()=>{this['fire']('deactivateChange',{'origin':'panel','id':_0x421952,'source':this});});}['setItemAsActive'](){this['isActive']=!0x0;}['setItemAsInactive'](){this['isActive']=!0x1;}['_createResultResponseView'](){const _0x166429=new vt(this['locale']);return _0x166429['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',_0x2462a8=>!_0x2462a8)]}}),_0x166429;}['_createAcceptButtonView'](){const _0x5c7612=new Nt(this['locale']);return _0x5c7612['set']({'label':us(this['locale'],'AI_REVIEW_MODE_ACCEPT_CHANGE'),'withText':!0x0}),_0x5c7612['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x2e11d6=>{this['fire']('acceptChange',{'id':this['changeId']}),_0x2e11d6['stopPropagation']();})},'attributes':{'class':[_s,'ck-ai_review__check-run-result-accept-button',this['bindTemplate']['if']('status','ck-hidden',_0x168912=>'pending'!==_0x168912&&'accepted'!==_0x168912),this['bindTemplate']['if']('status','ck-ai_review__check-run-result-accept-button',_0x354af2=>'pending'===_0x354af2),this['bindTemplate']['if']('status','ck-ai_review__check-run-result-status-button',_0x2489b0=>'accepted'===_0x2489b0)]}}),this['on']('change:status',(_0x15199c,_0x4d2152,_0x2a5de7)=>{_0x5c7612['isEnabled']='pending'===_0x2a5de7,'accepted'===_0x2a5de7&&(_0x5c7612['label']=us(this['locale'],'AI_REVIEW_MODE_CHECK_STATUS_ACCEPTED'),_0x5c7612['icon']=_0x389cff);}),_0x5c7612;}['_createDismissButtonView'](){const _0x35cfd9=new Nt(this['locale']);return _0x35cfd9['set']({'label':us(this['locale'],'AI_REVIEW_MODE_DISMISS_CHANGE'),'withText':!0x0}),_0x35cfd9['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x27b490=>{this['fire']('dismissChange',{'id':this['changeId']}),_0x27b490['stopPropagation']();})},'attributes':{'class':[As,this['bindTemplate']['if']('status','ck-hidden',_0x58b70d=>'pending'!==_0x58b70d&&'rejected'!==_0x58b70d),this['bindTemplate']['if']('status','ck-ai_review__check-run-result-dismiss-button',_0x312b59=>'pending'===_0x312b59),this['bindTemplate']['if']('status','ck-ai_review__check-run-result-status-button',_0x32fbae=>'rejected'===_0x32fbae)]}}),this['on']('change:status',(_0x51a232,_0x1a2ea7,_0x463b67)=>{_0x35cfd9['isEnabled']='pending'===_0x463b67,'rejected'===_0x463b67&&(_0x35cfd9['label']=us(this['locale'],'AI_REVIEW_MODE_CHECK_STATUS_REJECTED'),_0x35cfd9['icon']=_0x117eb5);}),_0x35cfd9;}['_createInfoButtonView'](){const _0x186567=new Nt(this['locale']);return _0x186567['set']({'label':us(this['locale'],'AI_REVIEW_MODE_LEARN_MORE'),'icon':_0x101fdf,'tooltip':!0x0,'isToggleable':!0x0,'role':'menuitemcheckbox','class':As+'\x20ck-ai_review__check-run-result-info-button\x20ck-hidden'}),_0x186567['bind']('isOn')['to'](this,'isInfoToggleOn',_0x1ddc2f=>_0x1ddc2f),_0x186567['on']('execute',()=>{this['isInfoToggleOn']=!this['isInfoToggleOn'];}),_0x186567;}['_createOutdatedButtonView'](){const _0x2dcc47=new Nt(this['locale']);return _0x2dcc47['set']({'label':us(this['locale'],'AI_REVIEW_MODE_CHECK_STATUS_OUTDATED'),'icon':st,'withText':!0x0,'isEnabled':!0x1}),_0x2dcc47['extendTemplate']({'attributes':{'class':[As,'ck-ai_review__check-run-result-status-button',this['bindTemplate']['if']('status','ck-hidden',_0x23d0a0=>'outdated'!==_0x23d0a0)],'disabled':'disabled'}}),_0x2dcc47;}}class ao extends Xt{['resultItemView'];['_pinnedRectIndex']=void 0x0;['_pinnedTargetElement']=void 0x0;['_pinnedTargetChangeId']=void 0x0;constructor(_0x4aeb99,_0xd6a6e9){super(_0x4aeb99),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']()),_0xd6a6e9['add'](this);}['render'](){super['render'](),this['_setupClickOutsideHandler']();}['updateContent'](_0x14d1aa){this['resultItemView']['changeId']=_0x14d1aa['id'],this['resultItemView']['resultResponseView']['element']['innerHTML']=_0x14d1aa['contentDiffed'];}['showBalloon'](_0x36036a,_0x73f1fd,_0x4c75a4,_0x37affc,_0x4004b4,_0x249425){const _0x4e62c8=_0x73f1fd();if(!_0x4e62c8)return;this['updateContent'](_0x36036a),this['show']();const _0x4f2272=Array['from'](_0x4e62c8['getClientRects']())['reverse'](),_0x16f86a=this['_getPointedRectIndexFromEvent'](_0x4c75a4,_0x4f2272),_0x4122aa=_0x4f2272[_0x16f86a??0x0];'click'===_0x37affc?(this['isDiffActive']=!0x0,this['pin']({'target':()=>this['_getBestRectPositionOnClick'](_0x73f1fd(),_0x16f86a,_0x36036a['id'],_0x4004b4,_0x249425)||_0x4122aa})):'hover'===_0x37affc&&(this['isDiffActive']=!0x1,this['pin']({'target':()=>this['_getBestRectPositionOnHover'](_0x73f1fd(),_0x16f86a,_0x36036a['id'])||_0x4122aa}));}['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 _0x436dbd=[this['element']];return this['_pinnedTargetElement']&&_0x436dbd['push'](this['_pinnedTargetElement']),_0x436dbd;},'callback':()=>{this['hide'](),this['unpin'](),this['deactivateChange'](),this['_pinnedTargetElement']=void 0x0,this['_pinnedRectIndex']=void 0x0,this['_pinnedTargetChangeId']=void 0x0;}});}['_createContentView'](){const _0xdb2145=new vt();return this['resultItemView']=new ro(this['locale'],''),this['resultItemView']['resultResponseView']['extendTemplate']({'attributes':{'class':['ck-content']}}),this['resultItemView']['delegate']('acceptChange','dismissChange')['to'](this),_0xdb2145['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']]}]}),_0xdb2145;}['_getBestRectPositionOnClick'](_0x239912,_0xe070fd,_0x12a215,_0x369ed5,_0x14da43){if(!_0x239912)return null;const _0x2e9ab3=this['position']['replace']('arrow_',''),_0x7348fb=Array['from'](_0x239912['getClientRects']());let _0x11b5d9,_0x517154=_0x7348fb['reverse']();return void 0x0!==_0xe070fd&&this['_isPinnedRectVisible'](_0x517154[_0xe070fd],_0x369ed5,_0x14da43)?(_0x11b5d9=_0x517154[_0xe070fd],this['_pinnedRectIndex']=_0xe070fd):this['_isPinnedRectVisible'](_0x517154[0x0],_0x369ed5,_0x14da43)&&void 0x0===_0xe070fd?_0x11b5d9=_0x517154[0x0]:(_0x517154='s'==_0x2e9ab3[0x0]?[..._0x7348fb]['reverse']():_0x7348fb,_0x517154['forEach'](_0x487628=>{this['_isPinnedRectVisible'](_0x487628,_0x369ed5,_0x14da43)&&(_0x11b5d9=_0x487628);})),this['_pinnedTargetChangeId']=_0x12a215,this['_pinnedTargetElement']=_0x239912,_0x11b5d9||_0x239912['getBoundingClientRect']();}['_getBestRectPositionOnHover'](_0x67e068,_0x94a900,_0x3722ec){if(!_0x67e068)return null;const _0x2efd2f=Array['from'](_0x67e068['getClientRects']())['reverse']();if(void 0x0===this['_pinnedRectIndex']&&void 0x0!==_0x94a900&&this['_pinnedTargetChangeId']!==_0x3722ec)return this['_pinnedRectIndex']=_0x94a900,this['_pinnedTargetElement']=_0x67e068,this['_pinnedTargetChangeId']=_0x3722ec,_0x2efd2f[_0x94a900];if(void 0x0!==this['_pinnedRectIndex']&&this['_pinnedTargetChangeId']===_0x3722ec){if(_0x67e068!==this['_pinnedTargetElement'])return Array['from'](this['_pinnedTargetElement']['getClientRects']())['reverse']()[this['_pinnedRectIndex']];return _0x2efd2f[this['_pinnedRectIndex']];}return void 0x0!==_0x94a900&&this['_pinnedTargetChangeId']!==_0x3722ec?(this['_pinnedRectIndex']=_0x94a900,this['_pinnedTargetElement']=_0x67e068,this['_pinnedTargetChangeId']=_0x3722ec,_0x2efd2f[_0x94a900]):_0x67e068['getBoundingClientRect']();}['_getPointedRectIndexFromEvent'](_0x353405,_0x374a78){if(_0x353405)for(let _0x148c12=0x0;_0x148c12<_0x374a78['length'];_0x148c12++){const _0x50439d=_0x374a78[_0x148c12];if(_0x353405['clientX']>=_0x50439d['left']-0x3&&_0x353405['clientX']<=_0x50439d['right']+0x3&&_0x353405['clientY']>=_0x50439d['top']-0x3&&_0x353405['clientY']<=_0x50439d['bottom']+0x3)return _0x148c12;}}['_isPinnedRectVisible'](_0x36300b,_0x113a63,_0xb0343f){const _0x3d4734=new dt(_0x36300b),_0x6cc02e=_0x113a63||document['documentElement'],_0xd604cd=_0x3d4734['getIntersection'](Rt(_0xb0343f)),_0x4ac5d9=new dt(_0x6cc02e)['getIntersection'](_0x3d4734);return!!(_0xd604cd&&_0x4ac5d9&&_0x3d4734['width']>0x0);}}const oo=['getReviewCheckList','runReviewCheck','abortReviewStream','toggleDiff','acceptAllChanges','leaveReviewCoreResultList','activateChange','deactivateChange','acceptChange','dismissChange','learnMore','finishReview','retryReview'];class ho extends _0x4c3ee6{['_mainView'];['_balloonSuggestionView'];['_bodyCollection'];static get['requires'](){return[cs];}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x214ab3){super(_0x214ab3),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 _0x561113=this['context']['plugins']['get']('AITabs');this['registerTab'](_0x561113);}['destroy'](){this['_bodyCollection']['detachFromDom'](),super['destroy']();}['setAvailableChecks'](_0x5de826){if(!this['_mainView']['reviewCheckListView']['hasChecks']()){const _0x42638d=!this['context']['config']['get']('ai.models.showModelSelector');this['_mainView']['reviewCheckListView']['setChecks'](_0x5de826,_0x42638d);}this['_mainView']['showReviewCheckListView']();}['showReviewCheckList'](){this['fire']('getReviewCheckList');}['showCheckRunResults'](_0x4a4e72){_0x4a4e72&&('error-general'!==_0x4a4e72['status']?'error-chunk'!==_0x4a4e72['status']?this['_mainView']['showReviewCheckResultsView']():this['showChunkErrorView']():this['showGeneralResultsErrorView']());}['showCheckRunResult'](_0x59d790){this['_mainView']['addCheckRunResult'](_0x59d790);}['showGeneralResultsErrorView'](){this['_mainView']['showGeneralResultsErrorView']();}['showGeneralReviewCoreErrorView'](_0x2e8742){this['_mainView']['showGeneralReviewCoreErrorView'](_0x2e8742??us(this['context']['locale'],'AI_REVIEW_INITIALIZATION_ERROR_MESSAGE'));}['showChunkErrorView'](){this['_mainView']['showChunkErrorView']();}['setCheckResultTitle'](_0x3b78d3,_0xde70f1){this['_mainView']['reviewCheckResultsView']['setTitle'](_0x3b78d3,_0xde70f1);}['setActiveStateInResults'](_0x4f2c8d){this['_mainView']['reviewCheckResultsView']['getResults']()['forEach'](_0x289623=>{_0x289623['id']===_0x4f2c8d&&_0x289623['setItemAsActive']();});}['resetActiveStateInResults'](){this['_mainView']['reviewCheckResultsView']['getResults']()['forEach'](_0x50ac9a=>_0x50ac9a['setItemAsInactive']());}['updateChangeState'](_0x2f80d6,_0x426394){'accepted'===_0x426394||'rejected'===_0x426394||'outdated'===_0x426394?this['_mainView']['reviewCheckResultsView']['hideResult'](_0x2f80d6,_0x426394):this['_mainView']['reviewCheckResultsView']['showResult'](_0x2f80d6,_0x426394);}['showReviewCompletedView'](){this['_mainView']['showReviewCompletedView']();}['showActionsWhenResultIsReady'](){this['_mainView']['showActionsWhenResultIsReady']();}['showNoChangesView'](){this['_mainView']['showNoChangesView']();}['hideActionsWhenResultIsReady'](){this['_mainView']['hideActionsWhenResultIsReady']();}['showChangeBalloon'](_0x2c070a,_0x160976,_0x1d1819,_0x1946de,_0x12d350,_0x1276d2){this['_balloonSuggestionView']['showBalloon'](_0x2c070a,_0x160976,_0x1d1819,_0x1946de,_0x12d350,_0x1276d2);}['hideChangeBalloon'](){this['_balloonSuggestionView']['hideBalloon']();}['hideDiffInBalloon'](){this['_balloonSuggestionView']['hideDiffInBalloon']();}['showDiffInBalloon'](){this['_balloonSuggestionView']['showDiffInBalloon']();}['getChangeElement'](_0x175fd2){const _0x2ad964=this['_mainView']['reviewCheckResultsView']['getResults']()['find'](_0x94b8ec=>_0x94b8ec['id']===_0x175fd2);return _0x2ad964?_0x2ad964['element']:null;}['deactivateChange'](){this['_balloonSuggestionView']['deactivateChange']();}}class co extends vt{constructor(_0x324633){super(_0x324633),this['set']('isVisible',!0x1),this['set']('errorMessage','');const _0x5f5077=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai_review__general-error-container',_0x5f5077['if']('isVisible','ck-hidden',_0x294d02=>!_0x294d02)]},'children':[{'tag':'p','attributes':{'class':'ck\x20ck-ai-notification\x20ck-ai-notification_error'},'children':[{'text':_0x5f5077['to']('errorMessage')}]}]});}}class lo extends vt{['reviewCoreHeader'];['generalErrorView'];['reviewCheckListView'];['reviewCheckResultsView'];['reviewCompletedView'];constructor(_0x14f5ab,_0x321c19){super(_0x14f5ab),this['reviewCoreHeader']=_0x321c19['header'],this['generalErrorView']=new co(_0x14f5ab),this['reviewCheckListView']=_0x321c19['list'],this['reviewCheckListView']['delegate'](...oo)['to'](this),this['reviewCheckResultsView']=_0x321c19['results'],this['reviewCheckResultsView']['delegate'](...oo)['to'](this),this['reviewCompletedView']=_0x321c19['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'](_0x33d86f){this['reviewCheckResultsView']['addResult'](_0x33d86f),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'](_0x1f1b48){this['generalErrorView']['set']('isVisible',!0x0),this['generalErrorView']['errorMessage']=_0x1f1b48;}['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(_0x4640c8,_0x588404){super(_0x588404),this['set']({'label':_0x4640c8,'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(_0x294f4a,_0x54249f){super(_0x294f4a),this['_contents']=_0x54249f,this['_resultViews']=new _0x54c5cf(),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(_0x294f4a),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 _0x1a3b30=this['_createCombinedSkeletonLoader'](),_0x2055bf=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-run',_0x2055bf['if']('isLoading','ck-ai_review__check-run_loading',_0x5a6617=>_0x5a6617),_0x2055bf['if']('isResultReady','ck-ai_review__check-run_ready',_0x54d209=>_0x54d209),_0x2055bf['if']('isVisible','ck-hidden',_0x2e9826=>!_0x2e9826)]},'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',_0x1d34f0=>_0x1d34f0)]},'children':this['_resultViews']},_0x1a3b30]},this['reviewDisclaimer']]});}['clearResults'](){this['_resultViews']['clear']();}['getResults'](){return this['_resultViews'];}['addResult'](_0x544ce){const _0x51ae25=new ro(this['locale'],_0x544ce['id']);_0x51ae25['delegate']('acceptChange','dismissChange','activateChange','deactivateChange')['to'](this),this['_resultViews']['add'](_0x51ae25),_0x51ae25['resultResponseView']['element']['innerHTML']=_0x544ce['contentDiffed'];}['hideResult'](_0x5b85f6,_0x3c97bd){if('pending'===_0x3c97bd)return;const _0x3448b1=this['_resultViews']['find'](_0x3e39f6=>_0x3e39f6['id']===_0x5b85f6);_0x3448b1&&(_0x3448b1['status']=_0x3c97bd,_0x3448b1['element']?.['classList']['add']('ck-ai_review__check-run-result_grayout'));}['showResult'](_0x22bf21,_0x4b35ff){if('pending'!==_0x4b35ff)return;const _0x3e61e5=this['_resultViews']['find'](_0x22e8ba=>_0x22e8ba['id']===_0x22bf21);_0x3e61e5&&(_0x3e61e5['status']=_0x4b35ff,_0x3e61e5['element']?.['classList']['remove']('ck-ai_review__check-run-result_grayout'));}['setTitle'](_0xe1651f,_0x27a72c){this['headerTitle']=_0xe1651f,this['headerSubtitle']=_0x27a72c||'';}['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 _0x2c8867=new vt(this['locale']),_0x1b15dd=[];for(let _0x5384df=0x0;_0x5384df<0x10;_0x5384df++){const _0x1ad0a3=this['_createSkeletonLoader']();_0x1ad0a3['extendTemplate']({'attributes':{'class':['ck-ai_review__check-run-skeleton-item']}}),_0x1b15dd['push'](_0x1ad0a3);}return _0x2c8867['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-run-skeleton-container',this['bindTemplate']['if']('isLoading','ck-hidden',_0xc02420=>!_0xc02420)]},'children':_0x1b15dd}),_0x2c8867;}['_createErrorView'](){const _0x5affe1=new vt(this['locale']),_0x4ddd5a=new Nt(this['locale']),t=this['locale']['t'];return _0x5affe1['delegate']('retryReview')['to'](this),_0x4ddd5a['set']({'label':t('Try\x20again'),'withText':!0x0,'class':_s+'\x20ck-ai_review__check-run-error-retry-button'}),_0x4ddd5a['on']('execute',()=>{this['fire']('retryReview');}),_0x5affe1['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-run-error-container',this['bindTemplate']['if']('showErrorMessage','ck-hidden',_0x41b5e7=>!_0x41b5e7),this['bindTemplate']['if']('errorType','ck-ai_review__check-run-error-container_border-bottom',_0x12e4d7=>'chunk'===_0x12e4d7)]},'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',_0x39737c=>'chunk'===_0x39737c)]},'children':[{'tag':'p','attributes':{'class':['ck-ai-notification__content',this['bindTemplate']['if']('errorType','ck-hidden',_0x557295=>'general'!==_0x557295)]},'children':[{'text':this['_contents']['generalErrorText']}]},{'tag':'p','attributes':{'class':['ck-ai-notification__content',this['bindTemplate']['if']('errorType','ck-hidden',_0x2ebd71=>'chunk'!==_0x2ebd71)]},'children':[{'text':us(this['locale'],'AI_REVIEW_MODE_CHUNK_ERROR_MESSAGE')}]}]},_0x4ddd5a]}),_0x5affe1;}['_createCancelButtonView'](){const _0x5192e0=new Nt(this['locale']);return _0x5192e0['set']({'label':us(this['locale'],'AI_REVIEW_MODE_STOP_GENERATING'),'withText':!0x0,'class':[_s+'\x20ck-ai-button-stop-generating'],'icon':_0x2f6727}),_0x5192e0['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isResultReady','ck-hidden',_0x359d4a=>_0x359d4a),this['bindTemplate']['if']('isCompleted','ck-hidden',_0x3d12a7=>_0x3d12a7)]}}),_0x5192e0['on']('execute',()=>{this['fire']('abortReviewStream');}),_0x5192e0;}['_createToggleDiffButtonView'](){const _0x4a3520=new Nt(this['locale']);_0x4a3520['set']({'tooltip':!0x0,'isToggleable':!0x0,'role':'menuitemcheckbox'}),_0x4a3520['bind']('isEnabled')['to'](this,'isError',_0x4afc19=>!_0x4afc19),_0x4a3520['extendTemplate']({'attributes':{'class':[_s,'ck-ai_review__check-run-toggle-diff-button',this['bindTemplate']['if']('isResultReady','ck-hidden',_0x56caad=>!_0x56caad),this['bindTemplate']['if']('isCompleted','ck-hidden',_0x1c28b5=>_0x1c28b5)]}});const _0x1388da=us(this['locale'],'AI_REVIEW_MODE_HIDE_CHANGES'),_0x21ff1f=us(this['locale'],'AI_REVIEW_MODE_SHOW_CHANGES');return _0x4a3520['bind']('isOn')['to'](this,'isToggleDiffOn',_0xfd92bc=>_0xfd92bc),_0x4a3520['bind']('icon')['to'](this,'isToggleDiffOn',_0x4ba4db=>_0x4ba4db?nt:rt),_0x4a3520['bind']('label')['to'](this,'isToggleDiffOn',_0x3f90b4=>_0x3f90b4?_0x1388da:_0x21ff1f),_0x4a3520['on']('execute',()=>{this['isToggleDiffOn']=!this['isToggleDiffOn'],this['fire']('toggleDiff',{'on':this['isToggleDiffOn']});}),_0x4a3520;}['_createAcceptAllButtonView'](){const _0x1d8c57=new Nt(this['locale']);return _0x1d8c57['set']({'label':us(this['locale'],'AI_REVIEW_MODE_ACCEPT_ALL'),'withText':!0x0}),_0x1d8c57['bind']('isEnabled')['to'](this,'isError',_0x1020f0=>!_0x1020f0),_0x1d8c57['extendTemplate']({'attributes':{'class':[ds,'ck-ai_review__check-run-accept-all-button',this['bindTemplate']['if']('isResultReady','ck-hidden',_0x4dbcf0=>!_0x4dbcf0),this['bindTemplate']['if']('isCompleted','ck-hidden',_0x552cd9=>_0x552cd9)]}}),_0x1d8c57['on']('execute',()=>{this['fire']('acceptAllChanges');}),_0x1d8c57;}['_createExitReviewButtonView'](){const _0x1d38d3=new Nt(this['locale']);return _0x1d38d3['set']({'label':us(this['locale'],'AI_REVIEW_MODE_EXIT_REVIEW'),'withText':!0x0}),_0x1d38d3['extendTemplate']({'attributes':{'class':[As,'ck-ai_review__check-run-exit-button',this['bindTemplate']['if']('isResultReady','ck-hidden',_0x53b5ec=>!_0x53b5ec),this['bindTemplate']['if']('isCompleted','ck-hidden',_0x564f4c=>_0x564f4c)]}}),_0x1d38d3['on']('execute',()=>{this['fire']('leaveReviewCoreResultList');}),_0x1d38d3;}['_createResultHeaderView'](){const _0x581140=new vt(this['locale']),_0x5d5268=this['_createTitleView']();return _0x581140['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-run-results-header',this['bindTemplate']['if']('isCompleted','ck-ai_review__review-completed-header',_0x5d3fb7=>_0x5d3fb7)]},'children':[_0x5d5268,{'tag':'div','attributes':{'class':['ck-ai_review__check-run-results-header-buttons']},'children':[this['_cancelButtonView'],this['_acceptAllButtonView'],this['_exitReviewButtonView'],this['_toggleDiffButtonView'],this['_finishReviewButtonView']]}]}),_0x581140;}['_createTitleView'](){const _0x5ccdce=new vt(this['locale']),_0x20e833=new vn();return _0x20e833['bind']('isVisible')['to'](this,'isResultReady',_0x3030d7=>!_0x3030d7),_0x5ccdce['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-run-results-header-title-wrapper']},'children':[_0x20e833,{'tag':'div','attributes':{'class':['ck-ai_review__check-run-results-header-title-content',this['bindTemplate']['if']('isCompleted','ck-hidden',_0x30b9de=>_0x30b9de)]},'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',_0x26feea=>!_0x26feea)]},'children':[{'text':us(this['locale'],'AI_REVIEW_MODE_FINISH_REVIEW_HEADER_TITLE')}]}]}),_0x5ccdce;}['_createFinishReviewButtonView'](){const _0x543d58=new uo(us(this['locale'],'AI_REVIEW_MODE_FINISH_REVIEW_BUTTON_LABEL'),this['locale']);return _0x543d58['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isCompleted','ck-hidden',_0x5c4d4a=>!_0x5c4d4a)]}}),_0x543d58['delegate']('finishReview')['to'](this),_0x543d58;}}class Ao extends Ht{['_resultsHeader'];['_finishReviewButtonView'];constructor(_0x3adc00,_0x37bee2){super(_0x3adc00),this['_finishReviewButtonView']=this['_createFinishReviewButtonView'](_0x37bee2['buttonText']),this['_resultsHeader']=this['_createResultHeaderView'](_0x37bee2['headerText']);const _0x3947f0=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__review-completed',_0x3947f0['if']('isVisible','ck-hidden',_0x243fe6=>!_0x243fe6)]},'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':_0x37bee2['emptyResultsText']}]}]}]});}['_createFinishReviewButtonView'](_0x3e21ca){const _0x1ee8d7=new uo(_0x3e21ca,this['locale']);return _0x1ee8d7['delegate']('finishReview')['to'](this),_0x1ee8d7;}['_createResultHeaderView'](_0x18948a){const _0x558f37=new vt(this['locale']);return _0x558f37['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':_0x18948a}]},{'tag':'div','attributes':{'class':['ck-ai_review__review-completed-header-buttons']},'children':[this['_finishReviewButtonView']]}]}),_0x558f37;}}class go extends vt{['_dropdownView'];['_defaultValue'];['_defaultLabel'];constructor(_0x207a57,_0x5d533c){super(_0x207a57),this['_defaultValue']=_0x5d533c['default']||(_0x5d533c['data']['length']>0x0?_0x5d533c['data'][0x0]['id']:''),this['_defaultLabel']=_0x5d533c['data']['find'](_0x22955f=>_0x22955f['id']===this['_defaultValue'])?.['label']||'',this['set']('formValue',''),this['_dropdownView']=Gt(this['locale']);const _0x5ca5d3=this['_prepareListOptions'](_0x5d533c['data']);jt(this['_dropdownView'],_0x5ca5d3,{'role':'menu','ariaLabel':_0x5d533c['label']}),this['_dropdownView']['buttonView']['set']({'label':this['_defaultLabel'],'withText':!0x0}),this['_dropdownView']['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x460b3d=>{_0x460b3d['stopPropagation']();})}}),this['listenTo'](this['_dropdownView'],'execute',_0x20d7ae=>{this['formValue']=_0x20d7ae['source']['model']['id'],this['_dropdownView']['buttonView']['label']=_0x20d7ae['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'](_0x340432=[]){const _0x5edd59=new _t();this['resetToDefault']();for(const _0x5a16d4 of _0x340432){const _0x1e0fde=new Jt({'label':_0x5a16d4['label'],'withText':!0x0,'role':'menuitemradio','id':_0x5a16d4['id'],'model':_0x5a16d4});_0x1e0fde['bind']('isOn')['to'](this,'formValue',_0x18138e=>_0x18138e===_0x1e0fde['id']);const _0x41ddf8={'type':'button','model':_0x1e0fde};_0x5edd59['add'](_0x41ddf8);}return _0x5edd59;}}class Io extends Ht{['_formItem']=null;constructor(_0x407f75,_0x4cc0bc,_0x1717f4){super(_0x407f75),this['argsKey']=_0x4cc0bc?.['argsKey'];if('dropdown'===_0x4cc0bc['formType'])this['_formItem']=new go(this['locale'],_0x4cc0bc);this['set']('value',''),this['bind']('value')['to'](this['_formItem'],'formValue');const _0x123672=new _0x48770c(this['locale'],{'children':[this['_formItem']],'class':[_0x1717f4?'ck-form__row_with-submit':'']});_0x1717f4&&_0x123672['children']['add'](_0x1717f4),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai_review__form-item','ck-reset_all']},'children':[_0x123672]});}['resetToDefault'](){this['_formItem']['resetToDefault']();}}class Eo extends _0x4a81d5{['keystrokes'];static ['MIN_ROWS']=0x1;static ['MAX_ROWS']=0xc;constructor(_0x1172b6){super(_0x1172b6),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 _0x54c5cf();['submitButtonView'];['cancelButtonView'];['promptInputView'];['actionsFooterView'];['_modelSelectionDropdown'];['_modelNameView'];['_modelSelectionDropdownItems'];['_check'];['_defaultValue'];['_defaultLabel'];constructor(_0x111477,_0x4df280,_0x3cf3c8=!0x1){super(_0x111477),this['_check']=_0x4df280,this['set']('prompt',''),this['set']('modelId',''),this['set']('modelDisplayMode','selector'),this['set']('activeModelName',null),this['_defaultValue']=_0x4df280['defaultModel']?_0x4df280['defaultModel']['id']:'',this['_defaultLabel']=_0x4df280['defaultModel']?_0x4df280['defaultModel']['name']:'',this['submitButtonView']=this['_createSubmitButtonView'](),this['cancelButtonView']=this['_createCancelButtonView'](),(this['promptInputView']=new te(this['locale'],()=>new Eo(_0x111477)),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'](_0x3cf3c8),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 _0x48770c(this['locale'],{'children':[this['promptInputView']]}),new _0x48770c(this['locale'],{'children':[this['actionsFooterView']]})]}),this['promptInputView']['fieldView']['keystrokes']['set']('Enter',(_0x5e6d52,_0x50b3c6)=>{this['_isValid']()?(this['fire']('runReviewCheck',{'id':'custom','args':{'prompt':this['prompt'],'model':this['modelId']},'isCustom':!0x0}),_0x50b3c6()):_0x50b3c6();}),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'](_0x2491ce=>{this['_focusables']['add'](_0x2491ce),this['focusTracker']['add'](_0x2491ce['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 _0x3dddca of this['_getFormValidators']()){const _0x35529c=_0x3dddca();if(_0x35529c)return this['promptInputView']['errorText']=_0x35529c,!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 _0xa9aee6=new Nt(this['locale']),t=this['locale']['t'];return _0xa9aee6['set']({'label':t('Submit'),'withText':!0x0,'class':ds}),_0xa9aee6['on']('execute',()=>{this['_isValid']()&&this['fire']('runReviewCheck',{'id':'custom','args':{'prompt':this['prompt'],'model':this['modelId']},'isCustom':!0x0});}),_0xa9aee6;}['_createCancelButtonView'](){const _0xd226a6=new Nt(this['locale']),t=this['locale']['t'];return _0xd226a6['set']({'label':t('Cancel'),'withText':!0x0,'class':As}),_0xd226a6['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x2e3a3f=>{_0x2e3a3f['stopPropagation']();})}}),_0xd226a6['on']('execute',()=>{this['resetToDefault'](),this['fire']('closeCustomCheck');}),_0xd226a6;}['_setModelList'](_0x1fa84a){this['_modelSelectionDropdownItems']['clear']();const _0x3a1800=this['_check']['models'];if(_0x1fa84a)this['set']('modelDisplayMode','hidden');else{const _0x5ded85=0x1===_0x3a1800['length'];this['set']('modelDisplayMode',_0x5ded85?'name':'selector');}if(this['resetToDefault'](),_0x3a1800?.['length']){0x1===_0x3a1800['length']&&this['set']('activeModelName',_0x3a1800[0x0]['name']||_0x3a1800[0x0]['id']);for(const _0xa1a838 of _0x3a1800){const _0x3a75e7=new Jt({'label':_0xa1a838['name'],'withText':!0x0,'role':'menuitemradio','id':_0xa1a838['id'],'model':_0xa1a838});_0x3a75e7['bind']('isOn')['to'](this,'modelId',_0x2f73d3=>_0x2f73d3===_0xa1a838['id']),this['_modelSelectionDropdownItems']['add']({'type':'button','model':_0x3a75e7,'labelView':new mo(this['locale'],_0xa1a838)});}}}['_createModelSelectionDropdown'](){const _0x52b8d2=Gt(this['locale']);return _0x52b8d2['set']({'panelPosition':'se','class':'ck-ai_review__check-list-item-model-dropdown'}),_0x52b8d2['buttonView']['set']({'label':this['_defaultLabel'],'withText':!0x0,'tooltip':!0x0,'class':As}),_0x52b8d2['buttonView']['bind']('isVisible')['to'](this,'modelDisplayMode',_0x3f9548=>'selector'===_0x3f9548),this['listenTo'](_0x52b8d2,'execute',_0xc2424c=>{this['modelId']=_0xc2424c['source']['model']['id'],_0x52b8d2['buttonView']['label']=_0xc2424c['source']['label'];}),_0x52b8d2;}['_createModelNameView'](){const _0x28ceb9=new To(this['locale']);return _0x28ceb9['bind']('text')['to'](this,'activeModelName',_0x41dabc=>_0x41dabc??''),_0x28ceb9['bind']('isVisible')['to'](this,'modelDisplayMode',_0x230b1e=>'name'===_0x230b1e),_0x28ceb9;}['_createActionsFooterView'](){const _0x394e5e=new vt(this['locale']);return _0x394e5e['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']]}]}),_0x394e5e;}}class To extends vt{constructor(_0x14b596){super(_0x14b596),this['set']('text',void 0x0),this['set']('isVisible',!0x0);const _0x5fb449=this['bindTemplate'];this['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai_review__check-list-item-model-name',_0x5fb449['if']('isVisible','ck-hidden',_0x80639e=>!_0x80639e)]},'children':[{'text':_0x5fb449['to']('text')}]});}}class mo extends Mt{constructor(_0x2cab5d,_0x1a1f7e){super();const _0x28b7d4=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-button__label'],'style':_0x28b7d4['to']('style'),'id':_0x28b7d4['to']('id')},'children':[{'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-model-dropdown-name']},'children':[{'tag':'span','children':[{'text':_0x28b7d4['to']('text')}]}]},{'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-model-dropdown-description']},'children':[{'tag':'span','children':[_0x1a1f7e['description']||'']}]}]});}}class Co extends Ht{['_formItemsCollection']=new _0x54c5cf();['_customCheckView']=null;['_hideModels']=!0x1;constructor(_0x2a3cdf,_0x2b2045,_0x456f07,_0x2e6764=!0x1){super(_0x2a3cdf),this['_hideModels']=_0x2e6764,this['set']('isParametrizedViewOpen',!0x1),this['set']('isListItemRendered',!0x1),this['set']('isItemParametrized',_0x2b2045['isParameterized']);const _0x29a150=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',_0x51a375=>_0x51a375),this['bindTemplate']['if']('isListItemRendered','ck-ai_review__check-list-item_rendered',_0x2ddd57=>_0x2ddd57)],'style':{'--ck-ai-review-check-list-item-index':_0x456f07}},'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':_0x2b2045['title']}]},_0x29a150]},{'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-description']},'children':_0x2b2045['description']?[{'text':_0x2b2045['description']}]:[]}]}]},..._0x2b2045['isParameterized']?[this['_createParameterizedView'](_0x2b2045)]:[],...'custom'===_0x2b2045['id']?[this['_createCustomView'](_0x2b2045,this['_hideModels'])]:[]]}),this['on']('click',()=>{_0x2b2045['isParameterized']?this['isParametrizedViewOpen']=!0x0:this['fire']('runReviewCheck',{'id':_0x2b2045['id'],'args':_0x2b2045['useArgs']?_0x2b2045['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'](_0x1238dd=>{_0x1238dd['resetToDefault']();}),this['_customCheckView']&&this['_customCheckView']['resetToDefault']();}['_createIconView'](){const _0x4d5e6b=new xt();return _0x4d5e6b['content']=at,_0x4d5e6b['extendTemplate']({'attributes':{'class':['ck-ai_review__check-list-item-title-icon']}}),_0x4d5e6b;}['_createParameterizedView'](_0x11fc95){const _0x2dd4ec=new vt(),_0x5125e9=this['_createFormView'](_0x11fc95);return _0x2dd4ec['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-parameterized',this['bindTemplate']['if']('isParametrizedViewOpen','ck-hidden',_0x3cc9cd=>!_0x3cc9cd)]},'children':[_0x5125e9]}),_0x2dd4ec;}['_createFormView'](_0x5dd7c8){const _0x572c0b=new vt(),_0x67dbfd=Array['isArray'](_0x5dd7c8['options'])?_0x5dd7c8['options']:[],_0x2ac066=new Nt(this['locale']),t=this['locale']['t'];_0x2ac066['set']({'label':t('Submit'),'withText':!0x0,'class':ds}),_0x2ac066['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x295050=>{_0x295050['stopPropagation']();})}}),_0x2ac066['on']('execute',()=>{const _0x3e04f0=[],_0x5f3288={};this['_formItemsCollection']['forEach'](_0x395747=>{_0x3e04f0['push'](_0x395747['value']),_0x5dd7c8['useArgs']&&_0x5dd7c8['options']&&(_0x5f3288[_0x395747['argsKey']]=_0x395747['value']);}),this['fire']('runReviewCheck',{'id':_0x5dd7c8['id'],'params':_0x3e04f0['length']?_0x3e04f0:void 0x0,'args':Object['keys'](_0x5f3288)['length']?_0x5f3288:void 0x0});});const _0x2a1bc8=_0x67dbfd['length'];return _0x67dbfd['forEach']((_0x162500,_0x561b17)=>{const _0x452bc9=_0x561b17===_0x2a1bc8-0x1;this['_formItemsCollection']['add'](new Io(this['locale'],_0x162500,_0x452bc9?_0x2ac066:null));}),_0x572c0b['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-list-item-parameterized-form']},'children':this['_formItemsCollection']}),_0x572c0b;}['_createCustomView'](_0x481122,_0x16580e=!0x1){return this['_customCheckView']=new po(this['locale'],_0x481122,_0x16580e),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',_0x370132=>!_0x370132)]}}),this['_customCheckView']['delegate']('runReviewCheck')['to'](this),this['listenTo'](this['_customCheckView'],'closeCustomCheck',()=>{this['isParametrizedViewOpen']=!0x1;}),this['on']('change:isParametrizedViewOpen',(_0x1f5a38,_0x5f40f3,_0x80c816)=>{_0x80c816||this['_customCheckView']['resetFormValidationStatus']();}),this['_customCheckView'];}}class wo extends Ht{['_checkViews'];constructor(_0xa5e782){super(_0xa5e782),this['_checkViews']=new _0x54c5cf(),this['_setupTemplate']();}['setChecks'](_0x3d7740,_0xc401bc=!0x1){this['_checkViews']['clear']();for(const [_0x5aa9c7,_0x17a2cd]of _0x3d7740['entries']()){const _0x131dfc=new Co(this['locale'],_0x17a2cd,_0x5aa9c7,_0xc401bc);_0x131dfc['delegate']('runReviewCheck')['to'](this),this['_checkViews']['add'](_0x131dfc);}}['hasChecks'](){return this['_checkViews']['length']>0x0;}['resetAllParameterizedChecks'](){for(const _0x4e6a87 of this['_checkViews'])_0x4e6a87 instanceof Co&&_0x4e6a87['resetToDefault']();}['_setupTemplate'](){const _0x4b45a5=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai_review__check-list',_0x4b45a5['if']('isVisible','ck-hidden',_0x3e66b8=>!_0x3e66b8)]},'children':this['_checkViews']});}}class fo extends ho{static get['pluginName'](){return'AIReviewModeUI';}['createMainView'](){const _0x53dd5f=this['context']['locale'],_0x39fc=new _0x314748(_0x53dd5f,{'label':us(_0x53dd5f,'AI_REVIEW_MODE'),'icon':_0x216df5,'class':'ck-ai-header\x20ck-ai-header_review'});return new lo(this['context']['locale'],{'header':_0x39fc,'list':new wo(_0x53dd5f),'results':new _o(_0x53dd5f,{'generalErrorText':us(_0x53dd5f,'AI_REVIEW_MODE_GENERAL_ERROR_MESSAGE')}),'completed':new Ao(_0x53dd5f,{'headerText':us(_0x53dd5f,'AI_REVIEW_MODE_FINISH_REVIEW_HEADER_TITLE'),'emptyResultsText':us(_0x53dd5f,'AI_REVIEW_MODE_EMPTY_RESULTS_TEXT'),'buttonText':us(_0x53dd5f,'AI_REVIEW_MODE_FINISH_REVIEW_BUTTON_LABEL')})});}['registerTab'](){const _0x32c8d8=this['context']['plugins']['get']('AITabs');_0x32c8d8['view']['on']('activateTab',(_0x2eb6fd,_0x11df19)=>{'reviewMode'===_0x11df19?this['fire']('getReviewCheckList'):this['fire']('leaveReview');}),_0x32c8d8['view']['addTab']({'id':'reviewMode','buttonLabel':us(this['context']['locale'],'AI_REVIEW_MODE'),'buttonIcon':_0x216df5,'order':0x0,'content':this['_mainView']});}}const So='review-';class bo extends _0x4c3ee6{static get['requires'](){return[_0x2da15a,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(_0x46c02f){super(_0x46c02f),this['_domEmitter']=new(Ot())(),this['_eventEmitter']=new(pt())();}get['emitter'](){return this['_eventEmitter'];}['afterInit'](){const _0x4ccaf0=Xs(this['context']);_0x4ccaf0['conversion']['for']('editingDowncast')['markerToElement']({'model':So+'insert','view':(_0x5169bb,{writer:_0x5a5c97})=>{const _0x2f21a3=this['_markers']['get'](_0x5169bb['markerName']),_0xc6e298={'class':'ck-ai_review-marker_add'+(this['_activeMarkers']['has'](_0x2f21a3?.['id']||'')?'\x20ck-ai_review__change_active':''),'data-marker-id':_0x5169bb['markerName']};return _0x5a5c97['createUIElement']('span',_0xc6e298,function(_0x441dd8){const _0x5d6349=this['toDomElement'](_0x441dd8);return _0x5d6349['innerHTML']=_0x2f21a3?.['content']?.['asString']||'',_0x5d6349;});}}),_0x4ccaf0['conversion']['for']('editingDowncast')['markerToHighlight']({'model':So+'remove-only','view':_0x12b1af=>{const _0x27c231=this['_markers']['get'](_0x12b1af['markerName']),_0x141bb8=['ck-ai_review-marker_strikethrough'];return this['_activeMarkers']['has'](_0x27c231?.['id']||'')&&_0x141bb8['push']('ck-ai_review__change_active'),{'classes':_0x141bb8,'attributes':{'data-marker-id':_0x12b1af['markerName']}};}}),_0x4ccaf0['conversion']['for']('editingDowncast')['markerToHighlight']({'model':So+'remove-context','view':_0x4445da=>{const _0x109407=this['_markers']['get'](_0x4445da['markerName']),_0x50f94b=['ck-ai_review-marker_underline'];return this['_activeMarkers']['has'](_0x109407?.['id']||'')&&_0x50f94b['push']('ck-ai_review__change_active'),{'classes':_0x50f94b,'attributes':{'data-marker-id':_0x4445da['markerName']}};}}),_0x4ccaf0['conversion']['for']('editingDowncast')['markerToHighlight']({'model':So+'remove-text','view':_0x449437=>{const _0x226324=this['_markers']['get'](_0x449437['markerName']),_0x4ea76c=['ck-ai_review-marker_hide'];return this['_activeMarkers']['has'](_0x226324?.['id']||'')&&_0x4ea76c['push']('ck-ai_review__change_active'),{'classes':_0x4ea76c,'attributes':{'data-marker-id':_0x449437['markerName']}};}}),_0x4ccaf0['conversion']['for']('dataDowncast')['markerToElement']({'model':So+'suggestion-context','view':(_0x28710e,{writer:_0x3dee11})=>_0x3dee11['createRawElement']('span',{'class':'ck-ai_review-marker_context-'+(_0x28710e['isOpening']?'start':'end')})}),_0x4ccaf0['conversion']['for']('downcast')['attributeToAttribute']({'model':_0x34b0f5,'view':_0x5440fe});const _0x16151c=_0x4ccaf0['ui']['getEditableElement']()||document['body'];this['_domEmitter']['listenTo'](_0x16151c,'mouseup',(_0xdd8ca1,_0x5cb78b)=>{const _0x2083bd=_0x5cb78b['target'],_0x1a3591=this['_findMarkerElement'](_0x2083bd);if(!_0x1a3591)return;const _0x5aa80d=_0x1a3591['getAttribute']('data-marker-id'),_0x19abc7=_0x5aa80d['split'](':')['pop']()?.['split']('_')[0x0];this['_eventEmitter']['fire']('changeMarkerClicked',{'markerId':_0x5aa80d,'changeId':_0x19abc7,'markerElement':()=>this['_findMarkerElementById'](_0x5aa80d),'domEvent':_0x5cb78b});},{'usePassive':!0x0,'priority':'highest'}),this['_domEmitter']['listenTo'](_0x16151c,'mouseover',(_0x54ba37,_0xdb71ea)=>{const _0x259098=_0xdb71ea['target'],_0x231f37=_0xdb71ea['relatedTarget'];let _0x65d7ec=this['_findMarkerElement'](_0x259098);if(!_0x65d7ec&&_0x231f37&&(_0x65d7ec=this['_findMarkerElement'](_0x231f37)),!_0x65d7ec)return;const _0x29c09f=_0x65d7ec['getAttribute']('data-marker-id'),_0x542c94=_0x29c09f['split'](':')['pop']()?.['split']('_')[0x0];this['_eventEmitter']['fire']('changeMarkerHovered',{'changeId':_0x542c94,'markerElement':()=>this['_findMarkerElementById'](_0x29c09f),'domEvent':_0xdb71ea});}),this['_domEmitter']['listenTo'](document,'mouseover',_0x576441((_0x155dd6,_0x3c206c)=>{const _0x5808f5=_0x3c206c['target'];if(this['_findMarkerElement'](_0x5808f5))return;_0x5808f5['closest']('.ck-reset.ck-ai_review-balloon-panel-suggestion')||this['_eventEmitter']['fire']('changeMarkerBlurred');},0xc8)),_0x4ccaf0['model']['document']['registerPostFixer'](_0x3c8ff8=>this['_validateMarkers'](_0x4ccaf0,_0x3c8ff8)),_0x4ccaf0['model']['document']['on']('change',()=>this['_handleMarkerChanges'](_0x4ccaf0));}['getDocumentData'](){const _0x29179e=this['context']['plugins']['get']('AIEditing'),_0x3f8940=Xs(this['context']),_0x5ce5df=_0x3f8940['model'],_0x166421=new _0x29280d();for(const _0x145a03 of _0x5ce5df['document']['getRoot']()['getChildren']()){const _0x240180=_0x145a03['_clone'](!0x0);_0x166421['_appendChild'](_0x240180);}for(const _0x40dd20 of _0x5ce5df['markers'])_0x166421['markers']['set'](_0x40dd20['name'],this['_changeRangeOwnerDocument'](_0x40dd20['getRange']()['clone'](),_0x166421));const _0x5d3a37=new _0x1a643c({'ignoreElementEnd':!0x0,'startPosition':_0x5ce5df['createPositionAt'](_0x166421,0x0)}),_0x231840=new Set(),_0x4cb19b=new Map();for(const {item:_0x18c63d}of _0x5d3a37){if(!_0x18c63d['is']('$textProxy'))continue;const _0x41eeca=_0x18c63d['parent'];if(_0x41eeca&&_0x41eeca['is']('element')){const _0x571c5b=this['_upsertDataId'](_0x41eeca,()=>_0x29179e['_nextDataId'](_0x231840));_0x231840['add'](_0x571c5b);for(const _0x293e29 of _0x41eeca['getChildren']())_0x293e29['is']('element')&&_0x231840['add'](this['_upsertDataId'](_0x293e29,()=>_0x29179e['_nextDataId'](_0x231840)));let _0x3204b7=_0x41eeca;for(;_0x3204b7['parent']&&!_0x3204b7['parent']['is']('documentFragment');)_0x3204b7=_0x3204b7['parent'],_0x3204b7['hasAttribute'](_0x34b0f5)&&_0x3204b7['_removeAttribute'](_0x34b0f5);_0x4cb19b['set'](_0x571c5b,{'path':_0x41eeca['getPath'](),'getContent':this['_createGetContentUsingDataIdFn'](_0x3204b7['_clone'](!0x0),_0x571c5b,_0x3f8940['data'])}),_0x5d3a37['jumpTo'](_0x5ce5df['createPositionAfter'](_0x41eeca));}}return{'content':_0x3f8940['data']['processor']['toData'](_0x3f8940['data']['toView'](_0x166421)),'version':_0x3f8940['model']['document']['version'],'elements':_0x4cb19b};}['diffContent'](_0x10d3bc,_0x39b64b,_0x318ec4=!0x1){const _0x3e9c2a=[],_0x228663=Xs(this['context']),_0x4a551e=_0x228663['data']['parse'](_0x39b64b,'$documentFragment'),_0x492d2e=_0x228663['data']['parse'](_0x10d3bc,'$documentFragment'),_0x5b5242=_0x228663['model']['createPositionAt'](_0x492d2e,0x0);if(this['_haveSingleTopLevelElement'](_0x4a551e)){if(!this['_hasSameTopLevelElement'](_0x492d2e,_0x4a551e))return _0x3e9c2a;}else{const _0x41526f=_0x228663['model']['schema'];if(!this['_haveOnlyInlineContent'](_0x492d2e,_0x41526f)||!this['_haveOnlyInlineContent'](_0x4a551e,_0x41526f))return _0x3e9c2a;}const _0x4b13eb=this['context']['plugins']['get']('DocumentCompare')['getDiff'](_0x10d3bc,_0x39b64b,{'anchor':_0x5b5242,'markDeletions':!0x0})['getOperations']()['filter'](_0x3f93c1=>'insert'===_0x3f93c1['type']||'marker'===_0x3f93c1['type']&&_0x3f93c1['name']['startsWith']('$markedRemove')),_0x399da0=this['_groupAdjacentOperations'](_0x4b13eb),_0x2ede3b=[];if(_0x318ec4){if(_0x399da0['length']){const _0x325739=_0x399da0[0x0]['operations'][0x0],_0x224462='insert'===_0x325739['type']?_0x325739['position']:_0x325739['newRange']['start'],_0x1d2749=this['_getPositionLimitingRange'](_0x224462,_0x228663,'inside'),_0x2c0c8c=_0x1d2749?_0x4a551e['getChild'](0x0)['getChildren']():_0x4a551e['getChildren'](),_0xfc88ad=_0x1d2749||_0x228663['model']['createRangeIn'](_0x492d2e),_0x17e72d=[new _0x38a9e1('$markedRemove:synthetic'+ot(),null,_0xfc88ad,_0x228663['model']['document']['model']['markers'],!0x0,_0x228663['model']['document']['version']+0x1),new _0x37092c(_0xfc88ad['end'],_0x2c0c8c,_0x228663['model']['document']['version']+0x2)];_0x2ede3b['push']({'operations':_0x17e72d,'operationsIsolated':_0x17e72d,'groupOffset':0x0});}}else _0x2ede3b['push'](..._0x399da0);let _0x35bc8f=0x0;return _0x228663['model']['change'](_0x4821b3=>{for(let _0x5eb5dc=0x0;_0x5eb5dc<_0x2ede3b['length'];_0x5eb5dc++){const _0x88a38b=_0x2ede3b[_0x5eb5dc],_0x3bf847=_0x4821b3['createDocumentFragment']();for(const _0x40b187 of _0x492d2e['getChildren']())_0x4821b3['append'](_0x40b187['_clone'](!0x0),_0x3bf847);for(const _0xd7511a of _0x88a38b['operationsIsolated'])if('insert'===_0xd7511a['type']){const _0x1dd67c=_0xd7511a;_0x1dd67c['baseVersion']=null,_0x1dd67c['isDocumentOperation']=!0x1,this['_changeOperationOwnerDocument'](_0x1dd67c,_0x3bf847),_0x4821b3['batch']['addOperation'](_0xd7511a),_0x228663['model']['applyOperation'](_0xd7511a);const _0x591e94='suggestion:insertion:id:authorId:'+_0x35bc8f++,_0x3d759d=_0x228663['model']['createRange'](_0x1dd67c['position'],_0x1dd67c['position']['getShiftedBy'](_0x1dd67c['howMany']));_0x3bf847['markers']['set'](_0x591e94,_0x3d759d);}else{if('marker'===_0xd7511a['type']&&_0xd7511a['name']['startsWith']('$markedRemove')){const _0x4a5d1b=_0xd7511a,_0x4d01fb='suggestion:deletion:id:authorId:'+_0x35bc8f++;this['_changeOperationOwnerDocument'](_0x4a5d1b,_0x3bf847),_0x3bf847['markers']['set'](_0x4d01fb,_0x4a5d1b['newRange']);}}if(_0x318ec4)_0x3e9c2a['push']({..._0x88a38b,'context':this['_createGetContentFn'](_0x492d2e,_0x228663['data']),'content':this['_createGetContentFn'](_0x492d2e,_0x228663['data'])});else{const _0x47507e=this['_getChangeContext'](this['_changePositionOwnerDocument'](this['_getOperationStart'](_0x88a38b['operationsIsolated'][0x0]),_0x3bf847),this['_changePositionOwnerDocument'](this['_getOperationEnd'](_0x88a38b['operationsIsolated'][_0x88a38b['operationsIsolated']['length']-0x1]),_0x3bf847));_0x3bf847['markers']['set'](So+'suggestion-context',new _0x5258a6(_0x47507e['start'],_0x47507e['end'])),_0x3e9c2a['push']({..._0x88a38b,'context':this['_createGetContextFn'](_0x3bf847,_0x228663['data'],{'ellipsisBefore':_0x47507e['hasContentBefore'],'ellipsisAfter':_0x47507e['hasContentAfter']}),'content':this['_createGetContentFn'](_0x3bf847,_0x228663['data'])});}}}),_0x3e9c2a;}['markChangePositionInEditorContent'](_0x588002,_0x4d2af9){if(!_0x588002['length'])return;const _0x19ca1a=_0x588002[0x0]['parent']['id'],_0x1d7e36=_0x4d2af9['elements']['get'](_0x19ca1a);if(!_0x1d7e36)return void console['warn']('No\x20element\x20found\x20for\x20ID:\x20'+_0x19ca1a);const _0x4bb292=_0x1d7e36['path'],_0x19effe=Xs(this['context']),_0x86b3f6=_0x19effe['model']['document']['history']['getOperations'](_0x4d2af9['version']),_0x40fe41=[];for(const _0x4b866e of _0x588002){const _0x53b127=_0x4b866e['operationsIsolated']['map'](_0x5926f8=>this['_translateOperationToEditorContent'](_0x5926f8,_0x4bb292,_0x19effe['model']['document']['getRoots']()[0x0]));if(!_0x53b127||!_0x53b127['length'])continue;const _0x5c2396=_0x53b127['every'](_0x4c769a=>'marker'===_0x4c769a['type']&&_0x4c769a['name']['startsWith']('$markedRemove')),_0x526d7a={'document':_0x19effe['model']['document'],'useRelations':!0x1,'padWithNoOps':!0x1},_0x56c38b=_0x54e22b(_0x53b127,_0x86b3f6,_0x526d7a)['operationsA'];for(const _0x1956f9 of _0x56c38b)if('insert'===_0x1956f9['type']){const _0x5ee6e6=_0x1956f9,_0xe34ffa=_0x5ee6e6['nodes'];_0x19effe['model']['change'](_0x16fcfa=>{const _0x40029d=_0x16fcfa['createDocumentFragment']();for(const _0x327d32 of _0xe34ffa)_0x16fcfa['append'](_0x327d32['_clone'](!0x0),_0x40029d);_0x40fe41['push']({'start':_0x5ee6e6['position'],'end':_0x5ee6e6['position'],'type':'insert','groupId':_0x4b866e['id'],'content':{'asString':this['_createGetContentFn'](_0x40029d,_0x19effe['data'])(),'asFragment':_0x40029d}});});}else{if('marker'===_0x1956f9['type']&&_0x1956f9['name']['startsWith']('$markedRemove')){const _0x34447d=_0x1956f9;let _0x147be3='remove-text';if(_0x5c2396){const _0x17ce3d=this['_findAdjacentContextDistance'](_0x34447d['newRange']['start'],'backward',_0x19effe['model']['schema']),_0x5ed6cb=this['_findAdjacentContextDistance'](_0x34447d['newRange']['end'],'forward',_0x19effe['model']['schema']);if(_0x17ce3d||_0x5ed6cb){const _0x54494a=_0x34447d['newRange']['start']['getShiftedBy'](-_0x17ce3d),_0x2d0716=_0x34447d['newRange']['end']['getShiftedBy'](_0x5ed6cb);_0x40fe41['push']({'start':_0x54494a,'end':_0x2d0716,'groupId':_0x4b866e['id'],'type':'remove-context'});}else _0x147be3='remove-only';}_0x40fe41['push']({'start':_0x34447d['newRange']['start'],'end':_0x34447d['newRange']['end'],'groupId':_0x4b866e['id'],'type':_0x147be3});}}}this['_insertMarkers'](_0x40fe41);}['clearAllMarkers'](){const _0x194929=Xs(this['context']);_0x194929['model']['change'](_0x4da56f=>{for(const _0xb7c6ad of this['_markers']['keys']())_0x194929['model']['markers']['get'](_0xb7c6ad)&&_0x4da56f['removeMarker'](_0xb7c6ad);}),this['_markers']['clear'](),this['_activeMarkers']['clear']();}['switchToReadOnly'](){Xs(this['context'])['enableReadOnlyMode']('ai-review');}['switchToEdit'](){Xs(this['context'])['disableReadOnlyMode']('ai-review');}['applyChange'](_0x5b0bc3){const _0x46a911=Xs(this['context']),_0x5d0abd=_0x46a911['model'],_0x550421=_0x5b0bc3['map'](_0x67d0dc=>this['_getMarkersDataForGroup'](_0x67d0dc))['flat']();_0x5d0abd['change'](_0x7bd545=>{for(const _0x3919a6 of _0x550421){const _0x5e9153=_0x46a911['model']['markers']['get'](_0x3919a6['id']);if(_0x5e9153){if('insert'===_0x3919a6['type']){if(!_0x3919a6['content'])continue;_0x5d0abd['insertContent'](_0x3919a6['content']['asFragment']||null,_0x5e9153['getRange']()['start']);}else'remove-text'!==_0x3919a6['type']&&'remove-only'!==_0x3919a6['type']||_0x5d0abd['deleteContent'](_0x5d0abd['createSelection'](_0x5e9153['getRange']()));_0x7bd545['removeMarker'](_0x3919a6['id']),this['_markers']['delete'](_0x3919a6['id']);}}});}['rejectChange'](_0x42a1bd){const _0x444c19=Xs(this['context']),_0x558ca1=this['_getMarkersDataForGroup'](_0x42a1bd);_0x444c19['model']['change'](_0x56aafb=>{for(const _0x5715bd of _0x558ca1)_0x56aafb['removeMarker'](_0x5715bd['id']),this['_markers']['delete'](_0x5715bd['id']);});}['getEditor'](){return Xs(this['context']);}['getMarkerElementForChange'](_0x14787a){const _0x126349=Array['from'](this['_markers']['values']())['filter'](_0x5f00ab=>_0x5f00ab['groupId']===_0x14787a);if(!_0x126349['length'])return null;const _0x3d6ebe=0x1===_0x126349['length']?_0x126349[0x0]:this['_sortMarkers'](_0x126349)[0x0],_0x352502=Xs(this['context'])['model']['markers']['get'](_0x3d6ebe['id']);if(!_0x352502)return null;return{'modelRange':_0x352502['getRange'](),'getElement':()=>this['_findMarkerElementById'](_0x3d6ebe['id'])};}['getContentElementForChange'](_0xffb55d){const _0x1f61e8=Array['from'](this['_markers']['values']())['filter'](_0x267438=>_0x267438['groupId']===_0xffb55d);if(!_0x1f61e8['length'])return null;const _0x631a9c=0x1===_0x1f61e8['length']?_0x1f61e8[0x0]:this['_sortMarkers'](_0x1f61e8)[0x0],_0x1524c0=Xs(this['context']),_0x1c4ee5=_0x1524c0['model']['markers']['get'](_0x631a9c['id']);if(!_0x1c4ee5)return null;const _0x3a4369=_0x1c4ee5['getRange'](),_0x388bb2=_0x1524c0['editing']['view']['getDomRoot']();if(!_0x388bb2||!_0x3a4369)return null;let _0x3d9202=_0x3a4369['start']['parent'];for(;_0x3d9202['parent']&&'$root'!==_0x3d9202['parent']['name'];)_0x3d9202=_0x3d9202['parent'];if(!_0x3d9202||!_0x3d9202['name'])return null;const _0x1b60a4=_0x388bb2['querySelector']('[data-marker-id=\x22'+_0x631a9c['id']+'\x22]');if(!_0x1b60a4)return null;let _0x538801=null;_0x1524c0['model']['change'](_0xe5975c=>{_0x538801=_0xe5975c['createDocumentFragment'](),_0xe5975c['append'](_0x3d9202['_clone'](!0x0),_0x538801);});const _0x5c5d67=_0x1524c0['data']['toView'](_0x538801)['getChild'](0x0);return _0x1b60a4['closest'](_0x5c5d67['name']);}['reactivateMarkers'](_0x1b82f5){const _0x4dd23b=this['_getMarkersDataForGroup'](_0x1b82f5);if(!_0x4dd23b['length'])return;const _0x30ce93=Array['from'](this['_activeMarkers'])['sort'](),_0x18f36c=Array['from'](new Set(_0x4dd23b['map'](_0x1c6cc3=>_0x1c6cc3['id'])))['sort']();_0x30ce93['join']('|')!==_0x18f36c['join']('|')&&(this['setAllMarkersAsInactive'](),this['setMarkersInElementAsActive'](_0x1b82f5));}['setMarkersInElementAsActive'](_0x4302ac){const _0x990f1f=this['_getMarkersDataForGroup'](_0x4302ac);if(!_0x990f1f['length'])return;const _0xc6ce81=Xs(this['context']),_0xb2fcd5=new Set(_0x990f1f['map'](_0x52f745=>_0x52f745['id'])),_0x52c68f=Array['from'](_0xb2fcd5['values']())['map'](_0x3fabcf=>_0xc6ce81['model']['markers']['get'](_0x3fabcf))['filter'](_0x4d3af8=>!!_0x4d3af8);_0xb2fcd5['forEach'](_0x19d45a=>{this['_activeMarkers']['add'](_0x19d45a);}),_0xc6ce81['model']['change'](()=>{_0x52c68f['forEach'](_0x404afb=>{_0xc6ce81['editing']['reconvertMarker'](_0x404afb);});});}['setAllMarkersAsInactive'](){const _0x26adc5=Array['from'](this['_activeMarkers']);if(!_0x26adc5['length'])return;this['_activeMarkers']['clear']();const _0x582ad9=Xs(this['context']),_0x149eed=_0x26adc5['map'](_0x46a77a=>_0x582ad9['model']['markers']['get'](_0x46a77a))['filter'](_0x4026ce=>!!_0x4026ce);_0x582ad9['model']['change'](()=>{_0x149eed['forEach'](_0x622786=>{_0x582ad9['editing']['reconvertMarker'](_0x622786);});});}['_getPositionLimitingRange'](_0x40a3c2,_0x3fd4c7,_0x37ed16='outside'){if(!_0x40a3c2)return null;let _0x3dc849=_0x40a3c2['parent'];for(;_0x3dc849&&_0x3dc849['parent']&&'$root'!==_0x3dc849['parent']['name']&&!_0x3fd4c7['model']['schema']['isLimit'](_0x3dc849)&&!_0x3fd4c7['model']['schema']['isBlock'](_0x3dc849);)_0x3dc849=_0x3dc849['parent'];if(!_0x3dc849||!_0x3dc849['name']||'$root'===_0x3dc849['name'])return null;let _0x5a8281=null;return _0x3fd4c7['model']['change'](_0x3c4374=>{_0x5a8281='inside'===_0x37ed16?_0x3c4374['createRangeIn'](_0x3dc849):_0x3c4374['createRangeOn'](_0x3dc849);}),_0x5a8281;}['_validateMarkers'](_0x21a15c,_0x5ebfc6){const _0x253d63=Array['from'](this['_markers']['keys']()),_0x2abfba=new Map();for(const _0x365b1d of _0x253d63){const _0x1fcaa7=_0x21a15c['model']['markers']['get'](_0x365b1d);if(!_0x1fcaa7)continue;const _0x3dca60=_0x1fcaa7['getStart']()['path'][0x0];_0x2abfba['has'](_0x3dca60)||_0x2abfba['set'](_0x3dca60,[]),_0x2abfba['get'](_0x3dca60)['push'](_0x1fcaa7);}const _0x5c48f3=new Set();for(const _0x5a491a of _0x21a15c['model']['document']['differ']['getChanges']()){let _0x474cad=-0x1,_0x28c533=null;if('insert'===_0x5a491a['type'])_0x28c533=new _0x5258a6(_0x5a491a['position'],_0x5a491a['position']['getShiftedBy'](_0x5a491a['length'])),_0x474cad=_0x5a491a['position']['path'][0x0];else{if('remove'!==_0x5a491a['type'])continue;_0x28c533=new _0x5258a6(_0x5a491a['position']),_0x474cad=_0x5a491a['position']['path'][0x0];}const _0x57c3da=_0x2abfba['get'](_0x474cad)||[];if(_0x57c3da['length']){for(const _0x2cc04a of _0x57c3da)if(_0x28c533['root']['rootName']===_0x2cc04a['getRange']()['root']['rootName']&&('insert'!==_0x5a491a['type']||!_0x28c533['containsRange'](_0x2cc04a['getRange']()))&&(_0x28c533['isIntersecting'](_0x2cc04a['getRange']())||_0x28c533['start']['isTouching'](_0x2cc04a['getRange']()['end'])||_0x28c533['end']['isTouching'](_0x2cc04a['getRange']()['start']))){const _0x47bfe5=this['_parseMarkerName'](_0x2cc04a['name']);Array['from'](this['_markers']['values']())['filter'](_0x43dad1=>_0x43dad1['groupId']===_0x47bfe5['groupId'])['forEach'](_0x5f7739=>_0x5c48f3['add'](_0x5f7739['id']));}}}if(_0x5c48f3['size']){for(const _0x525bee of _0x5c48f3)_0x5ebfc6['removeMarker'](_0x525bee);return!0x0;}return!0x1;}['_handleMarkerChanges'](_0x4fa8d8){for(const {name:_0x41980d,data:_0x474039}of _0x4fa8d8['model']['document']['differ']['getChangedMarkers']()){if(!_0x41980d['startsWith'](So))continue;const _0x517713=_0x474039['oldRange'],_0x38044e=_0x474039['newRange'],_0x29d0b8=_0x517713&&'$graveyard'===_0x517713['root']['rootName'],_0x4650b2=_0x38044e&&'$graveyard'===_0x38044e['root']['rootName'];if(_0x29d0b8&&_0x4650b2)continue;const _0xb7d58f=this['_parseMarkerName'](_0x41980d);this['_markers']['get'](_0x41980d)&&(_0x4650b2||!_0x38044e?this['_eventEmitter']['fire']('changeMarkerRemoved',{'markerId':_0x41980d,'changeId':_0xb7d58f['groupId']}):_0x29d0b8&&_0x38044e&&this['_eventEmitter']['fire']('changeMarkerRestored',{'markerId':_0x41980d,'changeId':_0xb7d58f['groupId']}));}}['_parseMarkerName'](_0x499469){const _0x435a74=_0x499469['split'](':'),_0x3de29f=(_0x435a74[0x1]||'')['split']('_');return{'prefix':_0x435a74[0x0],'groupId':_0x3de29f[0x0],'suffix':_0x3de29f[0x1]};}['_translateOperationToEditorContent'](_0x135ced,_0x1b286d,_0x470fb3){if('insert'===_0x135ced['type']){const _0x2c6079=_0x135ced;return new _0x37092c(this['_changePosition'](_0x1b286d['concat'](_0x2c6079['position']['offset']),_0x470fb3),_0x2c6079['nodes'],_0x2c6079['baseVersion']);}if('marker'===_0x135ced['type']&&_0x135ced['name']['startsWith']('$markedRemove')){const _0x132b65=_0x135ced;return new _0x38a9e1(_0x132b65['name'],_0x132b65['oldRange'],this['_changeRange'](_0x132b65['newRange'],_0x1b286d['concat'](_0x132b65['newRange']['start']['offset']),_0x1b286d['concat'](_0x132b65['newRange']['end']['offset']),_0x470fb3),_0x132b65['_markers'],_0x132b65['affectsData'],_0x132b65['baseVersion']);}return _0x135ced;}['_groupAdjacentOperations'](_0x5e1447){if(!_0x5e1447['length'])return[];const _0x570740=[];let _0x1af982=0x0,_0x40d8e1=0x0,_0x3df4f3=[];for(let _0x50dd42=0x0;_0x50dd42<=_0x5e1447['length'];_0x50dd42++){const _0x59e9a4=_0x5e1447[_0x50dd42],_0x357414=_0x5e1447[_0x50dd42-0x1];!_0x59e9a4||_0x357414&&!this['_getOperationEnd'](_0x357414)['isTouching'](this['_getOperationStart'](_0x59e9a4))?(_0x570740['push']({'operations':_0x3df4f3,'operationsIsolated':_0x3df4f3['map'](_0x4ec322=>this['_shiftOperation'](_0x4ec322['clone'](),-_0x40d8e1)),'groupOffset':_0x1af982}),_0x3df4f3=_0x59e9a4?[_0x59e9a4]:[],_0x40d8e1+=_0x1af982,_0x1af982=0x0):_0x3df4f3['push'](_0x59e9a4),_0x59e9a4&&'insert'===_0x59e9a4['type']&&(_0x1af982+=_0x59e9a4['howMany']);}return _0x570740;}['_findAdjacentContextDistance'](_0x1b3ee4,_0x219836,_0x48a8d3,_0x1975b0=0x1){const _0x503bc6=new _0x1a643c({'startPosition':_0x1b3ee4,'direction':_0x219836});let _0x165eb2=0x0;for(let _0x5af521=0x0;_0x5af521<_0x1975b0;_0x5af521++){let _0xfb26f9=0x0,_0x592033=!0x1,_0x40135f='forward'===_0x219836?/^\W*\w+/:/\w+\W*$/;for(const {item:_0x46d906}of _0x503bc6)if(_0x46d906['is']('$textProxy')){const _0x426396=_0x40135f['exec'](_0x46d906['data']);if(_0x426396&&_0x426396['length']){if(_0xfb26f9+='forward'===_0x219836?_0x426396['index']+_0x426396[0x0]['length']:_0x46d906['data']['length']-_0x426396['index'],_0x426396[0x0]['length']!==_0x46d906['data']['length'])break;_0x592033=!0x0,_0x40135f='forward'===_0x219836?/^\w+/:/\w+$/;}else{if(_0x592033)break;_0xfb26f9+=_0x46d906['offsetSize'];}}else{if(_0x46d906['is']('element')){_0x48a8d3['isInline'](_0x46d906)&&!_0x592033&&(_0xfb26f9+=0x1);break;}}_0x165eb2+=_0xfb26f9,_0x503bc6['jumpTo'](_0x1b3ee4['getShiftedBy']('forward'===_0x219836?_0x165eb2:-_0x165eb2));}return _0x165eb2;}['_getChangeContext'](_0x1a6ff0,_0x2e6393){const _0x292f33=Xs(this['context'])['model']['schema'],_0x49679f=this['_findAdjacentContextDistance'](_0x1a6ff0,'backward',_0x292f33,0x6),_0x2fae05=this['_findAdjacentContextDistance'](_0x2e6393,'forward',_0x292f33,0x6),_0x340a9e=_0x1a6ff0['getShiftedBy'](-_0x49679f),_0x585771=_0x2e6393['getShiftedBy'](_0x2fae05);return{'start':_0x340a9e,'end':_0x585771,'hasContentBefore':!_0x340a9e['isAtStart'],'hasContentAfter':!_0x585771['isAtEnd']};}['_insertMarkers'](_0x370832){const _0x5642a7=this['context']['plugins']['get']('AIEditing'),_0x16706c=new Set();Xs(this['context'])['model']['change'](_0x25699f=>{for(const _0x17c8f1 of _0x370832){const _0x5de0d3=''+So+_0x17c8f1['type']+':'+_0x17c8f1['groupId']+'_'+_0x5642a7['_nextDataId'](_0x16706c);this['_markers']['set'](_0x5de0d3,{'id':_0x5de0d3,'groupId':_0x17c8f1['groupId'],'type':_0x17c8f1['type'],'content':_0x17c8f1['content']}),_0x25699f['addMarker'](_0x5de0d3,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x25699f['createRange'](_0x17c8f1['start'],_0x17c8f1['end'])});}});}['_createGetContextFn'](_0x20c151,_0x272aa2,_0x68360d){let _0x484bb3='';return()=>{if(!_0x484bb3){const _0x35edec=_0x272aa2['toView'](_0x20c151,{'showSuggestionHighlights':!0x0});let _0x3feec8=_0x35edec['getChild'](0x0);if(_0x3feec8['is']('containerElement')||(_0x3feec8=_0x35edec),!_0x3feec8)return'';let _0x5c6671=!0x1;const _0x426890=[];for(const _0x39985e of _0x3feec8['getChildren']())_0x39985e['is']('element','span')&&_0x39985e['hasClass']('ck-ai_review-marker_context-end')&&(_0x5c6671=!0x1),_0x5c6671&&_0x426890['push'](_0x39985e),_0x39985e['is']('element','span')&&_0x39985e['hasClass']('ck-ai_review-marker_context-start')&&(_0x5c6671=!0x0);_0x3feec8['_removeChildren'](0x0,_0x3feec8['childCount']),_0x68360d?.['ellipsisBefore']&&_0x3feec8['_appendChild']('…'),_0x3feec8['_appendChild'](_0x426890),_0x68360d?.['ellipsisAfter']&&_0x3feec8['_appendChild']('…');const _0x593e08=_0x272aa2['htmlProcessor']['domConverter']['viewToDom'](_0x35edec),_0x496fca=_0x272aa2['htmlProcessor']['htmlWriter']['getHtml'](_0x593e08);_0x484bb3=_0x496fca;}return _0x484bb3;};}['_createGetContentFn'](_0x414c4d,_0x56299e){let _0x4d3a38='';return()=>(_0x4d3a38||(_0x4d3a38=_0x56299e['stringify'](_0x414c4d,{'showSuggestionHighlights':!0x0})),_0x4d3a38);}['_createGetContentUsingDataIdFn'](_0x288808,_0x575f19,_0x3680ea){let _0x38b2f0='';return()=>{if(!_0x38b2f0){const _0x49ba8c=_0x3680ea['toView'](new _0x29280d(_0x288808)),_0x1aec8f=_0x3680ea['htmlProcessor']['domConverter']['viewToDom'](_0x49ba8c)['querySelector']('[data-id=\x22'+_0x575f19+'\x22]');_0x38b2f0=_0x1aec8f?.['outerHTML']||'';}return _0x38b2f0;};}['_findMarkerElement'](_0x811d8c,_0x1f360f=0x5){let _0x9e9666=_0x811d8c,_0x4b5cb2=null;for(let _0xae3cbd=0x0;_0xae3cbd<_0x1f360f&&_0x9e9666;_0xae3cbd++){if(!_0x9e9666['className']){_0x9e9666=_0x9e9666['parentElement'];continue;}if(!(''+_0x9e9666['className'])['includes']('ck-ai_review-marker_')){_0x9e9666=_0x9e9666['parentElement'];continue;}if(!_0x9e9666['getAttribute']('data-marker-id'))break;_0x4b5cb2=_0x9e9666;break;}return _0x4b5cb2;}['_findMarkerElementById'](_0x1e8551){const _0x3840ef=Xs(this['context']),_0x5c85f1=_0x3840ef['model']['markers']['get'](_0x1e8551);return _0x5c85f1?_0x80cae6(_0x3840ef['editing'],_0x5c85f1):null;}['_getMarkersDataForGroup'](_0xff5685){return Array['from'](this['_markers']['values']())['filter'](_0x5e0746=>_0x5e0746['groupId']===_0xff5685);}['_getOperationStart'](_0x1de606){return'insert'===_0x1de606['type']?_0x1de606['position']:_0x1de606['newRange']['start'];}['_getOperationEnd'](_0x1fb839,_0x21e1ac=!0x1){return'insert'===_0x1fb839['type']?_0x21e1ac?_0x1fb839['position']:_0x1fb839['position']['getShiftedBy'](_0x1fb839['howMany']):_0x1fb839['newRange']['end'];}['_shiftOperation'](_0x248806,_0xa434f5){return'insert'===_0x248806['type']?_0x248806['position']=_0x248806['position']['getShiftedBy'](_0xa434f5):'marker'===_0x248806['type']&&_0x248806['newRange']&&(_0x248806['newRange']=new _0x5258a6(_0x248806['newRange']['start']['getShiftedBy'](_0xa434f5),_0x248806['newRange']['end']['getShiftedBy'](_0xa434f5))),_0x248806;}['_changeOperationOwnerDocument'](_0x47c59d,_0x134cd4){'insert'===_0x47c59d['type']?_0x47c59d['position']=this['_changePositionOwnerDocument'](_0x47c59d['position'],_0x134cd4):'marker'===_0x47c59d['type']&&_0x47c59d['newRange']&&(_0x47c59d['newRange']=this['_changeRangeOwnerDocument'](_0x47c59d['newRange'],_0x134cd4));}['_changePositionOwnerDocument'](_0x16ea69,_0x51f1bb){return new _0x55a2cf(_0x51f1bb,_0x16ea69['path']);}['_changeRangeOwnerDocument'](_0x37c212,_0x33b704){return new _0x5258a6(this['_changePositionOwnerDocument'](_0x37c212['start'],_0x33b704),this['_changePositionOwnerDocument'](_0x37c212['end'],_0x33b704));}['_changePosition'](_0x205e1f,_0x10fd93){return new _0x55a2cf(_0x10fd93,[..._0x205e1f]);}['_changeRange'](_0x15893f,_0x404ecc,_0x23d545,_0x1c74ff){return new _0x5258a6(this['_changePosition'](_0x404ecc,_0x1c74ff),this['_changePosition'](_0x23d545,_0x1c74ff));}['_sortMarkers'](_0x437e16){const _0x1cbd30=_0x18cea4=>{switch(_0x18cea4){case'insert':return 0x0;case'remove-context':return 0x1;case'remove-only':return 0x2;case'remove-text':return 0x3;}};return _0x437e16['sort']((_0xf7e03a,_0x1ea4ca)=>_0x1cbd30(_0xf7e03a['type'])-_0x1cbd30(_0x1ea4ca['type']));}['_hasSameTopLevelElement'](_0xb4a7a6,_0x396f75){const _0x5bd62f=_0xb4a7a6['getChild'](0x0),_0x2c17fd=_0x396f75['getChild'](0x0);return!(!_0x5bd62f||!_0x2c17fd)&&((!_0x5bd62f['is']('element')||!_0x2c17fd['is']('element')||_0x5bd62f['name']===_0x2c17fd['name'])&&!(_0x5bd62f['is']('element')&&!_0x2c17fd['is']('element')||!_0x5bd62f['is']('element')&&_0x2c17fd['is']('element')));}['_haveSingleTopLevelElement'](_0x4a6ce9){return 0x1===_0x4a6ce9['childCount'];}['_haveOnlyInlineContent'](_0x471606,_0x529eb7){for(const _0x79148f of _0x471606['getChildren']())if(_0x79148f['is']('element')&&!_0x529eb7['isInline'](_0x79148f))return!0x1;return!0x0;}['_upsertDataId'](_0x5ecf0f,_0x19c108){let _0x557fd0=_0x5ecf0f['getAttribute'](_0x34b0f5);return _0x557fd0||(_0x557fd0=_0x19c108(),_0x5ecf0f['_setAttribute'](_0x34b0f5,_0x557fd0)),_0x557fd0;}}class Ro extends pt(){['id'];['contentNew'];['contentInitial'];['documentVersion'];constructor({id:_0x151368,contentNew:_0x5eb31d,contentInitial:_0x4c6992,documentVersion:_0x458fce}){super(),this['id']=_0x151368,this['contentNew']=_0x5eb31d,this['contentInitial']=_0x4c6992,this['documentVersion']=_0x458fce;}}class Oo extends ct(){['id'];['parent'];['_data'];['_editorOperations']=[];constructor(_0x4af07f,_0x2ae2e0,_0x14b068){super(),this['id']=_0x4af07f,this['parent']=_0x14b068,this['_data']=_0x2ae2e0,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(_0x54cd47,_0x8281a4,_0x1c5870,_0x26fabd,_0x181137){super(),this['_sourceCheck']=_0x8281a4,this['_documentData']=_0x54cd47,this['_aiConnector']=_0x1c5870,this['_reviewParams']=_0x26fabd,this['_reviewArgs']=_0x181137,this['on']('change:status',(_0x4d73ec,_0x566290,_0x5702e6)=>{'aborted'==_0x5702e6&&(this['_wasAborted']=!0x0),this['fire']('reviewCheckRunUpdated',{'status':_0x5702e6,'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'](_0x2864f6=>'pending'===_0x2864f6['status']);}get['currentError'](){return this['_currentError'];}['updateDocumentData'](_0x56774d){this['_documentData']=_0x56774d;}async['start'](){this['status']='loading',this['_currentError']=void 0x0;try{this['_activeRequest']=this['_createApiRequest']();const _0x4d9ad9=await this['_activeRequest']['getStream']();this['status']='data';for await(const _0x48b98b of _0x4d9ad9)'unmodified'!==_0x48b98b['data']['operation']&&('error'!==_0x48b98b['data']['operation']?'review-metadata'!==_0x48b98b['event']?this['_addReviewCheckResult'](_0x48b98b['data']['dataId'],_0x48b98b['data']['textDelta']):this['callId']=_0x48b98b['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(_0xe66ea9){this['_currentError']=_0xe66ea9,_0xe66ea9 instanceof Error&&_0xe66ea9['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'](_0xa158b5,_0x1e8c35){const _0x28805b=this['_results']['get'](_0xa158b5);if(!_0x28805b)return;if(0x0===_0x1e8c35['length'])return;const _0x2e762a=[];_0x1e8c35['forEach']((_0x1ad46c,_0x4ef7b1)=>{const _0x5cd900=new Oo(_0x28805b['id']+'-'+_0x4ef7b1,_0x1ad46c,_0x28805b);_0x5cd900['on']('change:status',()=>{this['fire']('reviewCheckResultChangeStatusUpdated',{'change':_0x5cd900,'status':_0x5cd900['status']});}),_0x5cd900['on']('change:isActivated',()=>{_0x5cd900['isActivated']?this['fire']('reviewCheckResultActivated',{'change':_0x5cd900}):this['fire']('reviewCheckResultDeactivated',{'change':_0x5cd900});}),this['_changes']['push'](_0x5cd900),_0x2e762a['push'](_0x5cd900);}),this['fire']('reviewCheckResultReady',{'changes':_0x2e762a,'result':_0x28805b,'source':this});}['abort'](){this['_activeRequest']&&(this['_activeRequest']['abortController']['abort'](),this['_activeRequest']=null,this['status']='aborted');}['isChangeActive'](_0x307d5d){const _0xba6a36=this['_changes']['find'](_0x2f44b8=>_0x2f44b8['id']===_0x307d5d);return!(!_0xba6a36||'pending'!==_0xba6a36['status']);}['isAnyChangeActivated'](){return this['_changes']['some'](_0x2d201f=>!0x0===_0x2d201f['isActivated']);}['getActiveChanges'](){return this['_changes']['filter'](_0x14a4ee=>'pending'===_0x14a4ee['status']);}['getChangeById'](_0x12e982){return this['_changes']['find'](_0x3904b9=>_0x3904b9['id']===_0x12e982);}['markAllChangesAsAccepted'](){for(const _0x29ab9f of this['_changes'])'pending'===_0x29ab9f['status']&&(_0x29ab9f['status']='accepted');this['_checkIfFinished']();}['markChangeAsAccepted'](_0x5e14bf){const _0x3cfdab=this['_changes']['find'](_0x464145=>_0x464145['id']===_0x5e14bf);_0x3cfdab&&'pending'===_0x3cfdab['status']&&(_0x3cfdab['status']='accepted'),this['_checkIfFinished']();}['markChangeAsRejected'](_0x26e4e7){const _0x4c2ef0=this['_changes']['find'](_0xb5916f=>_0xb5916f['id']===_0x26e4e7);_0x4c2ef0&&'pending'===_0x4c2ef0['status']&&(_0x4c2ef0['status']='rejected'),this['_checkIfFinished']();}['markChangeAsOutdated'](_0x51f85f){const _0x18a2c2=this['_changes']['find'](_0x3dc9cd=>_0x3dc9cd['id']===_0x51f85f);_0x18a2c2&&'pending'===_0x18a2c2['status']&&(_0x18a2c2['status']='outdated'),this['_checkIfFinished']();}['markChangeAsPending'](_0x4ce401){const _0x16113c=this['_changes']['find'](_0x452e40=>_0x452e40['id']===_0x4ce401);_0x16113c&&'outdated'===_0x16113c['status']&&(_0x16113c['status']='pending'),this['_checkIfFinished']();}['activateChange'](_0x114230){this['_changes']['filter'](_0x42d2b5=>_0x42d2b5['isActivated']&&_0x42d2b5['id']!==_0x114230)['forEach'](_0x256097=>{_0x256097['isActivated']=!0x1;});const _0x2c5548=this['_changes']['find'](_0x3326a3=>_0x3326a3['id']===_0x114230);_0x2c5548&&'pending'===_0x2c5548['status']&&(_0x2c5548['isActivated']=!0x0);}['deactivateChange'](){this['_changes']['filter'](_0x4c7fdb=>_0x4c7fdb['isActivated'])['forEach'](_0x21d4f0=>{_0x21d4f0['isActivated']=!0x1;});}['forceReadyState'](){this['status']='ready';}async['sendRating'](_0xfe2978){if('initialized'===this['status']||'loading'===this['status']||'data'===this['status']||this['_wasAborted'])return;if(!this['callId']||0x0===this['_changes']['length'])return;let _0x426287;if(_0xfe2978){const _0x419cb6=this['_changes']['find'](_0x3bad55=>_0x3bad55['id']===_0xfe2978);if(_0x419cb6&&_0x419cb6['isRated'])return;_0x419cb6&&(_0x426287=_0x419cb6['parent']['id'],_0x419cb6['isRated']=!0x0);}const _0x516121={'positiveCount':this['_changes']['filter'](_0x2b8297=>'accepted'===_0x2b8297['status'])['length'],'totalCount':this['_changes']['length']};this['_sendRatingRequest'](_0x516121,this['callId'],_0x426287);}['_addReviewCheckResult'](_0x4a9c6b,_0x530c25){const _0x300fc8=this['_documentData']['elements']['get'](_0x4a9c6b);if(!_0x300fc8)return;const _0x57cf94=_0x300fc8['getContent']();if(_0x57cf94===_0x530c25)return;const _0x5ea31e=new Ro({'id':_0x4a9c6b,'contentInitial':_0x57cf94,'contentNew':_0x530c25,'documentVersion':this['_documentData']['version']});this['_results']['set'](_0x5ea31e['id'],_0x5ea31e),this['fire']('reviewCheckResultAdded',{'result':_0x5ea31e,'source':this});}['_checkIfFinished'](){'finished'===this['status']&&(this['_changes']['filter'](_0x39c1c6=>'pending'===_0x39c1c6['status'])['length']>0x0&&(this['status']='ready')),'ready'===this['status']&&(0x0===this['_changes']['filter'](_0x31cf08=>'pending'===_0x31cf08['status'])['length']&&(this['status']='finished'));}}class No extends ko{get['subTitle'](){if(!this['_reviewParams']||0x0===this['_reviewParams']['length'])return'';const _0x5a4b53=[];if(this['_reviewParams']['length']>0x0&&this['_sourceCheck']['options'])for(let _0x2d2e59=0x0;_0x2d2e59<this['_reviewParams']['length'];_0x2d2e59++){if(!this['_reviewParams'][_0x2d2e59]||!this['_sourceCheck']['options'][_0x2d2e59])continue;const _0x2bc698=this['_sourceCheck']['options'][_0x2d2e59],_0x4fc98c=_0x2bc698['data']?.['find'](_0xf161de=>_0xf161de['id']===this['_reviewParams'][_0x2d2e59]);_0x4fc98c&&_0x5a4b53['push'](_0x4fc98c['label']);}return _0x5a4b53['join'](',\x20');}get['reviewName'](){return this['_composeReviewName']();}['_createApiRequest'](){return this['_aiConnector']['callSystemReview']({'reviewName':this['_composeReviewName'](),'content':this['_documentData']['content'],'args':this['_reviewArgs']});}['_sendRatingRequest'](_0x3e0b85,_0xaa799b,_0x55927a){return this['_aiConnector']['upsertAIReviewRating'](this['reviewName'],_0xaa799b,_0x3e0b85,_0x55927a);}['_composeReviewName'](){return!this['_reviewParams']||0x0===this['_reviewParams']['length']||this['_sourceCheck']['useArgs']?this['_sourceCheck']['apiId']:[this['_sourceCheck']['apiId'],...this['_reviewParams']]['join']('-');}}class vo extends _0x4c3ee6{['_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(_0x14e1be,_0x4faea1)=>{const _0x5c57b3=this['_aiReviewCheckList']['getCheckById'](_0x4faea1['id']);if(_0x5c57b3){this['_onReviewCheckRun'](_0x4faea1),this['_aiReviewCoreEditing']['switchToReadOnly'](),this['_currentReviewCheckRun']=this['_createReviewCheckRun'](_0x4faea1,_0x5c57b3),this['_aiReviewCoreUi']['setCheckResultTitle'](this['_currentReviewCheckRun']['title'],this['_currentReviewCheckRun']['subTitle']),this['_currentReviewCheckRun']['on']('reviewCheckRunUpdated',(_0x14c65a,_0x153fcc)=>{switch(_0x153fcc['status']){case'data':case'loading':this['_aiReviewCoreUi']['showCheckRunResults'](_0x153fcc);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'!==_0x153fcc['status']&&'error-chunk'!==_0x153fcc['status']&&'error-general'!==_0x153fcc['status']||this['_currentReviewCheckRun']?.['sendRating']();}),this['_currentReviewCheckRun']['on']('reviewCheckResultAdded',(_0x1989f9,_0x41c4a3)=>{if(!this['_currentReviewCheckRun'])throw new ht('ai-review-mode-no-current-check-run',this);const _0x319524=this['_diffContent'](_0x41c4a3['result']['contentInitial'],_0x41c4a3['result']['contentNew']);_0x41c4a3['source']['addResultChanges'](_0x41c4a3['result']['id'],_0x319524);}),this['_currentReviewCheckRun']['on']('reviewCheckResultReady',(_0x409f9b,_0x2be395)=>{for(const _0x95e4ec of _0x2be395['changes'])this['_aiReviewCoreUi']['showCheckRunResult'](_0x95e4ec);this['_markChangePositionInEditorContent'](_0x2be395['changes'],_0x2be395['source']['documentData']);}),this['_currentReviewCheckRun']['on']('reviewCheckResultChangeStatusUpdated',(_0x5b1867,_0x14c7d2)=>{this['_aiReviewCoreUi']['updateChangeState'](_0x14c7d2['change']['id'],_0x14c7d2['status']);}),this['_currentReviewCheckRun']['on']('reviewCheckResultActivated',(_0x9d7610,_0x5668e2)=>{this['_onReviewCheckResultActivated'](_0x5668e2);}),this['_currentReviewCheckRun']['on']('reviewCheckResultDeactivated',()=>{this['_onReviewCheckResultDeactivated']();});try{await this['_currentReviewCheckRun']['start']();}catch(_0x12c1a5){_0x12c1a5 instanceof Error&&_0x12c1a5['message']['includes']('ai-request-aborted')||(_0x12c1a5 instanceof ht?this['_logError'](_0x12c1a5):this['_logError'](new ht('ai-review-mode-check-run-failed',this,void 0x0,_0x12c1a5)));}}else this['_logError'](new ht('ai-review-mode-source-check-not-found',this,{'checkId':_0x4faea1['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 _0x59039e=this['_currentReviewCheckRun']['getActiveChanges']();if(!_0x59039e['length'])return;this['_aiReviewCoreEditing']['applyChange'](_0x59039e['map'](_0x34950a=>_0x34950a['id']));const _0xa4658d=this['_currentReviewCheckRun'];_0xa4658d['markAllChangesAsAccepted'](),_0xa4658d['sendRating']();}),this['listenTo'](this['_aiReviewCoreUi'],'acceptChange',(_0x2139e9,_0xd1eaee)=>{this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['isChangeActive'](_0xd1eaee['id'])&&(this['_aiReviewCoreEditing']['applyChange']([_0xd1eaee['id']]),this['_currentReviewCheckRun']['markChangeAsAccepted'](_0xd1eaee['id']),this['_aiReviewCoreUi']['hideChangeBalloon'](),this['_currentReviewCheckRun']['sendRating'](_0xd1eaee['id']));}),this['listenTo'](this['_aiReviewCoreUi'],'dismissChange',(_0x3954bb,_0xfd67f2)=>{this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['isChangeActive'](_0xfd67f2['id'])&&(this['_aiReviewCoreEditing']['rejectChange'](_0xfd67f2['id']),this['_currentReviewCheckRun']['markChangeAsRejected'](_0xfd67f2['id']),this['_aiReviewCoreUi']['hideChangeBalloon'](),this['_currentReviewCheckRun']['sendRating'](_0xfd67f2['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',(_0x52a33c,_0x20c730)=>{this['_onActivateChange'](_0x20c730);}),this['listenTo'](this['_aiReviewCoreUi'],'deactivateChange',(_0x1993b2,_0x43f74a)=>{this['_onDeactivateChange'](_0x43f74a);}),this['listenTo'](this['_aiReviewCoreEditing']['emitter'],'changeMarkerClicked',(_0xafc7e6,_0x788112)=>{this['_onChangeMarkerClicked'](_0xafc7e6,_0x788112);}),this['listenTo'](this['_aiReviewCoreEditing']['emitter'],'changeMarkerHovered',(_0x25b431,_0x1947c8)=>{this['_onChangeMarkerHovered'](_0x25b431,_0x1947c8);}),this['listenTo'](this['_aiReviewCoreEditing']['emitter'],'changeMarkerBlurred',()=>{this['_onChangeMarkerBlurred']();}),this['listenTo'](this['_aiReviewCoreEditing']['emitter'],'changeMarkerRemoved',(_0x4b8b38,_0x388d5b)=>{this['_onChangeMarkerRemoved'](_0x4b8b38,_0x388d5b);}),this['listenTo'](this['_aiReviewCoreEditing']['emitter'],'changeMarkerRestored',(_0x5ddab2,_0x11867e)=>{this['_onChangeMarkerRestored'](_0x5ddab2,_0x11867e);});}['_createReviewCheckRun'](_0x2d45ea,_0x59e770){return new No(this['_aiReviewCoreEditing']['getDocumentData'](),_0x59e770,this['_aiConnector'],_0x2d45ea['params'],_0x2d45ea['args']);}['_onChangeMarkerRemoved'](_0x470e03,_0x4a8a97){this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['markChangeAsOutdated'](_0x4a8a97['changeId']);}['_onChangeMarkerRestored'](_0x5c5e3f,_0x35737a){this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['markChangeAsPending'](_0x35737a['changeId']);}['_onCheckRunFinished'](){this['_aiReviewCoreUi']['showReviewCompletedView']();}['_initRequiredPlugins'](){this['_aiConnector']=this['context']['plugins']['get']('AIConnector');}['_onReviewRunLeave'](_0x505a70=!0x1){this['_currentReviewCheckRun']&&(this['_currentReviewCheckRun']['hasModifications']||this['_currentReviewCheckRun']['sendRating'](),this['_currentReviewCheckRun']['stopListening'](),this['_currentReviewCheckRun']['abort'](),this['_currentReviewCheckRun']=void 0x0),_0x505a70&&this['_aiReviewCoreUi']['showReviewCheckList'](),this['_aiReviewCoreEditing']['clearAllMarkers'](),this['_aiReviewCoreEditing']['switchToEdit'](),this['_changeActivationSource']=null;const _0x2e70d0=this['_aiReviewCoreEditing']['getEditor']();_0x2e70d0&&_0x2e70d0['editing']['view']['change'](_0x4219b1=>{const _0x286dd7=_0x2e70d0['editing']['view']['document']['getRoot']();_0x4219b1['removeClass']('ck-ai_review-diff',_0x286dd7),_0x4219b1['removeClass']('ck-ai_review-highlights',_0x286dd7),_0x4219b1['removeClass']('ck-ai-translate-mode-content',_0x286dd7);});}['_getTranslationWithDefault'](_0x4c437b,_0x14af4a){const _0x208cb8=us(this['context']['locale'],_0x4c437b);return _0x208cb8===_0x4c437b?_0x14af4a:_0x208cb8;}['_logError'](_0xf31fdb,_0x481c4d=!0x1){mt(_0xf31fdb['message']),_0x481c4d||(_0xf31fdb['message']['startsWith']('ai-review-mode-models-unable-to-retrieve')?this['_aiReviewCoreUi']['showGeneralReviewCoreErrorView']():this['_aiReviewCoreUi']['showGeneralResultsErrorView']());}['_scrollToChange'](_0x145331){if('content'===this['_changeActivationSource']){const _0x255e15=this['_aiReviewCoreUi']['getChangeElement'](_0x145331);_0x255e15&&ft(_0x255e15['closest']('.ck-ai_review__check-run-result')||_0x255e15);}else{if('panel'===this['_changeActivationSource']){const _0x496b2b=this['_getChangeContentElement'](_0x145331);if(!_0x496b2b)return;Ct({'target':_0x496b2b,'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(_0x81a872){this['id']=_0x81a872['id'],this['commandId']=_0x81a872['commandId'],this['title']=_0x81a872['title'],this['description']=_0x81a872['description'],this['isParameterized']=_0x81a872['isParameterized'],this['useArgs']=_0x81a872['useArgs'],this['options']=_0x81a872['options'],this['args']=_0x81a872['args'];}}class Lo extends ct(){['_checks']=[];['setupChecks'](_0x12d95d){this['_checks']=_0x12d95d['map'](_0x546cd8=>new xo(_0x546cd8));}get['checks'](){return this['_checks'];}['getCheckById'](_0x145265){return this['checks']['find'](_0x2fffcd=>_0x2fffcd['id']===_0x145265);}['removeCheckById'](_0x52fcad){this['_checks']=this['_checks']['filter'](_0x2b7997=>_0x2b7997['id']!==_0x52fcad);}}class Do extends xo{['_models']=[];['_defaultModel']=null;constructor(_0x2903cb,_0x2d0c45,_0x1554e3){super(_0x2903cb),this['_models']=_0x2d0c45,this['_defaultModel']=_0x1554e3;}get['models'](){return this['_models'];}get['defaultModel'](){return this['_defaultModel'];}}class Po extends xo{['isExtra']=!0x0;['prompt'];['model'];['_defaultModel']=null;constructor(_0x1fd27c,_0x4d3619,_0x1bce21){super(_0x1fd27c),this['prompt']=_0x1fd27c['prompt'],this['model']=_0x1fd27c['model'],this['model']?this['_defaultModel']=_0x4d3619['find'](_0x23032a=>_0x23032a['id']===this['model'])||null:this['_defaultModel']=_0x1bce21;}get['defaultModel'](){return this['_defaultModel'];}}class Ho extends Lo{['_allModels']=[];['_recommendedModels']=[];['_defaultModel']=null;constructor(_0x2db34c,_0x113baa,_0x5f55d2){super(),this['_allModels']=_0x2db34c,this['_recommendedModels']=_0x113baa,this['_defaultModel']=_0x5f55d2;}['setupChecks'](_0x291dce){this['_checks']=_0x291dce['map'](_0x5e5ba9=>!0x0===_0x5e5ba9['isExtra']?new Po(_0x5e5ba9,this['_allModels'],this['_defaultModel']):'custom'===_0x5e5ba9['id']?new Do(_0x5e5ba9,this['_recommendedModels'],this['_defaultModel']):new xo(_0x5e5ba9));}}class Mo extends ko{['_prompt'];['_model'];constructor(_0x29f0a7,_0x29309a,_0x45f084,_0x197dbe,_0x4e6a81){super(_0x45f084,_0x197dbe,_0x4e6a81),this['_prompt']=_0x29f0a7,this['_model']=_0x29309a;}get['subTitle'](){return this['_prompt'];}['_createApiRequest'](){return this['_aiConnector']['callCustomReview']({'content':this['_documentData']['content'],'prompt':this['_prompt'],'model':this['_model']});}['_sendRatingRequest'](_0x567f1d,_0x2a9fe4,_0x1e9fc4){return this['_aiConnector']['upsertCustomAIReviewRating'](_0x2a9fe4,_0x567f1d,_0x1e9fc4);}}class Uo extends Mo{get['subTitle'](){return'';}set['prompt'](_0x2cf405){this['_prompt']=_0x2cf405;}set['model'](_0x2d77d0){this['_model']=_0x2d77d0;}}class Vo extends vo{static get['pluginName'](){return'AIReviewModeController';}['_isDiffOn']=!0x1;['_hasDefaultAvailableCommands']=!0x1;constructor(_0x305970){super(_0x305970),this['_hasDefaultAvailableCommands']=!this['context']['config']['get']('ai.review.availableCommands'),this['context']['config']['define']('ai.review.availableCommands',yo['map'](_0x5ca951=>_0x5ca951['id'])),this['context']['config']['define']('ai.review.extraCommands',[]);}async['init'](){await super['init'](),this['listenTo'](this['_aiReviewCoreUi'],'toggleDiff',(_0x2d8260,_0x225006)=>{this['_isDiffOn']=_0x225006['on'],this['_onDiffChange'](this['_isDiffOn']);});}['_initRequiredPlugins'](){super['_initRequiredPlugins'](),this['_aiReviewCoreUi']=this['context']['plugins']['get']('AIReviewModeUI'),this['_aiReviewCoreEditing']=this['context']['plugins']['get']('AIReviewCoreEditing');}['_createReviewCheckRun'](_0x43164c,_0x2baeae){return _0x43164c['isCustom']?new Mo(_0x43164c['args']['prompt'],_0x43164c['args']['model'],this['_aiReviewCoreEditing']['getDocumentData'](),_0x2baeae,this['_aiConnector']):_0x2baeae['isExtra']?new Uo(_0x2baeae['prompt'],_0x2baeae['defaultModel']['id'],this['_aiReviewCoreEditing']['getDocumentData'](),_0x2baeae,this['_aiConnector']):new No(this['_aiReviewCoreEditing']['getDocumentData'](),_0x2baeae,this['_aiConnector'],_0x43164c['params'],_0x43164c['args']);}['_onReviewCheckResultActivated'](_0x560010){this['_aiReviewCoreUi']['setActiveStateInResults'](_0x560010['change']['id']),this['_scrollToChange'](_0x560010['change']['id']);const _0x1b3f62=this['_aiReviewCoreEditing']['getMarkerElementForChange'](_0x560010['change']['id']);if(!_0x1b3f62)return;const _0x39118b=this['_aiReviewCoreEditing']['getEditor']();this['_aiReviewCoreUi']['showChangeBalloon'](_0x560010['change'],()=>_0x1b3f62['getElement'](),void 0x0,'click',_0x39118b?.['editing']?.['view']?.['getDomRoot'](),_0x39118b?.['ui']?.['viewportOffset']),this['_aiReviewCoreEditing']['setMarkersInElementAsActive'](_0x560010['change']['id']);}['_onReviewCheckResultDeactivated'](){this['_aiReviewCoreUi']['resetActiveStateInResults'](),this['_aiReviewCoreUi']['hideChangeBalloon'](),this['_aiReviewCoreEditing']['setAllMarkersAsInactive']();}['_onActivateChange'](_0x502b8e){this['_currentReviewCheckRun']&&'click'===_0x502b8e['uiInteraction']&&(this['_changeActivationSource']='panel',this['_currentReviewCheckRun']['activateChange'](_0x502b8e['id']));}['_onDeactivateChange'](_0x44225c){this['_currentReviewCheckRun']&&'balloon'===_0x44225c['origin']&&this['_currentReviewCheckRun']['deactivateChange']();}['_onChangeMarkerClicked'](_0x5ef865,_0x3e018c){if(!this['_currentReviewCheckRun'])return;this['_changeActivationSource']='content',this['_currentReviewCheckRun']['activateChange'](_0x3e018c['changeId']);const _0x5f261b=this['_currentReviewCheckRun']['getChangeById'](_0x3e018c['changeId']);if(!_0x5f261b)return;const _0x4b6bc2=this['_aiReviewCoreEditing']['getEditor']();this['_aiReviewCoreUi']['showChangeBalloon'](_0x5f261b,_0x3e018c['markerElement'],_0x3e018c['domEvent'],'click',_0x4b6bc2?.['editing']?.['view']?.['getDomRoot'](),_0x4b6bc2?.['ui']?.['viewportOffset']);}['_onChangeMarkerHovered'](_0x57b7f7,_0x20f4f3){if(!this['_currentReviewCheckRun'])return;if(this['_currentReviewCheckRun']['isAnyChangeActivated']())return;const _0x312610=this['_currentReviewCheckRun']['getChangeById'](_0x20f4f3['changeId']);if(!_0x312610)return;const _0x38ef2a=this['_aiReviewCoreEditing']['getEditor']();this['_aiReviewCoreUi']['showChangeBalloon'](_0x312610,_0x20f4f3['markerElement'],_0x20f4f3['domEvent'],'hover',_0x38ef2a?.['editing']?.['view']?.['getDomRoot'](),_0x38ef2a?.['ui']?.['viewportOffset']);}['_onChangeMarkerBlurred'](){if(!this['_currentReviewCheckRun'])return;this['_currentReviewCheckRun']['isAnyChangeActivated']()||this['_aiReviewCoreUi']['hideChangeBalloon']();}['_getChangeContentElement'](_0x278368){const _0x383bd6=this['_aiReviewCoreEditing']['getMarkerElementForChange'](_0x278368);return _0x383bd6?_0x383bd6['getElement']():null;}['_markChangePositionInEditorContent'](_0x421ba1,_0x599f47){this['_aiReviewCoreEditing']['markChangePositionInEditorContent'](_0x421ba1,_0x599f47);}['_diffContent'](_0x3525b4,_0x3328f7){return this['_aiReviewCoreEditing']['diffContent'](_0x3525b4,_0x3328f7);}['_onReviewCheckRun'](){this['_onDiffChange'](this['_isDiffOn']);}['_onDiffChange'](_0xc3bee0){const _0x4fb2f1=this['_aiReviewCoreEditing']['getEditor']();_0xc3bee0?this['_aiReviewCoreUi']['hideDiffInBalloon']():this['_aiReviewCoreUi']['showDiffInBalloon'](),_0x4fb2f1&&_0x4fb2f1['editing']['view']['change'](_0x3d966c=>{const _0x48b03e=_0x4fb2f1['editing']['view']['document']['getRoot']();for(const _0x340e98 of _0x48b03e['getClassNames']())_0x340e98['startsWith']('ck-ai_review-')&&_0x3d966c['removeClass'](_0x340e98,_0x48b03e);_0x3d966c['addClass'](_0xc3bee0?'ck-ai_review-diff':'ck-ai_review-highlights',_0x48b03e);});}async['_getChecksList'](){const _0x541ef4=[...yo,...this['_getExtraChecks']()],_0x3de90a=this['context']['config']['get']('ai.review.availableCommands')||[];this['_logErrorForNonExistentChecks'](_0x3de90a,_0x541ef4);let _0x8481c2=_0x541ef4;this['_hasDefaultAvailableCommands']||(_0x8481c2=_0x3de90a['map'](_0x2445cd=>_0x541ef4['find'](_0x33f857=>_0x33f857['id']===_0x2445cd))['filter'](_0x7a174=>!!_0x7a174)),_0x8481c2=_0x8481c2['map'](_0x23eda5=>_0x23eda5['isExtra']?_0x23eda5:this['_translateReviewCheck'](_0x23eda5));const _0x2c9872=_0x8481c2['some'](_0x6aa976=>_0x6aa976['isExtra']||'custom'===_0x6aa976['id']);let _0x3de99f=[],_0xaa849=[],_0x332b0d=null;if(_0x2c9872){const _0x3c428f=await this['_getModels']();_0x3de99f=_0x3c428f['all'],_0xaa849=_0x3c428f['recommended'],_0x332b0d=_0x3c428f['default'];}const _0x57c9fd=new Ho(_0x3de99f,_0xaa849,_0x332b0d);return _0x57c9fd['setupChecks'](_0x8481c2),_0x2c9872&&this['_filterChecksWithMissingModel'](_0x57c9fd),_0x57c9fd;}['_getExtraChecks'](){return(this['context']['config']['get']('ai.review.extraCommands')||[])['map'](_0x35cb5a=>({'id':_0x35cb5a['id'],'commandId':_0x35cb5a['id'],'title':_0x35cb5a['label'],'description':_0x35cb5a['description'],'isParameterized':!0x1,'isExtra':!0x0,'prompt':_0x35cb5a['prompt'],'model':_0x35cb5a['model']}));}['_logErrorForNonExistentChecks'](_0x516e02,_0x3a3a27){const _0xdf9a29=_0x516e02['filter'](_0xa08c5c=>!_0x3a3a27['some'](_0xb3bbc4=>_0xb3bbc4['id']===_0xa08c5c));_0xdf9a29['length']&&this['_logError'](new ht('ai-review-mode-non-existent-commands-used',this,{'commandIds':_0xdf9a29['join'](',\x20')}),!0x0);}async['_getModels'](){try{const _0x529bd5=new qs({'connector':this['_aiConnector'],'config':this['context']['config']['get']('ai.models'),'locale':this['context']['locale']});return{'all':await _0x529bd5['getAll'](),'recommended':await _0x529bd5['getAvailableModels'](),'default':await _0x529bd5['getDefault']()};}catch(_0x3951ab){return this['_logError'](new ht('ai-review-mode-models-unable-to-retrieve',this,void 0x0,_0x3951ab)),{'all':[],'recommended':[],'default':null};}}['_translateReviewCheck'](_0x53085f){const _0x3da454='AI_REVIEW_CHECK_'+_0x53085f['id']['toUpperCase']()['replaceAll']('-','_'),_0xc47258={..._0x53085f,'title':this['_getTranslationWithDefault'](_0x3da454+'_TITLE',_0x53085f['title']),'description':this['_getTranslationWithDefault'](_0x3da454+'_DESCRIPTION',_0x53085f['description'])};return _0x53085f['options']&&(_0xc47258['options']=_0x53085f['options']['map'](_0x4728a3=>({..._0x4728a3,'label':this['_getTranslationWithDefault'](_0x3da454+'_OPTIONS_LABEL',_0x4728a3['label']||''),'data':_0x4728a3['data']?_0x4728a3['data']['map'](_0xafd734=>({..._0xafd734,'label':this['_getTranslationWithDefault'](_0x3da454+'_OPTIONS_DATA_'+_0xafd734['id']['toUpperCase'](),_0xafd734['label'])})):void 0x0}))),_0xc47258;}['_filterChecksWithMissingModel'](_0x5f4696){const _0xa84fec=[];_0x5f4696['checks']['forEach'](_0x58cdc=>{(_0x58cdc instanceof Po&&!_0x58cdc['defaultModel']||_0x58cdc instanceof Do&&!_0x58cdc['models']['length'])&&_0xa84fec['push'](_0x58cdc['id']);}),_0xa84fec['length']&&_0xa84fec['forEach'](_0xd2c85a=>{_0x5f4696['removeCheckById'](_0xd2c85a),this['_logError'](new ht('ai-review-mode-command-unavailable-due-to-missing-model',this,{'commandId':_0xd2c85a}),!0x0);});}}class Bo extends _0x4c3ee6{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'](_0x307d33){this['_checks']=_0x307d33['map'](_0x44310a=>new Go(_0x44310a));}}class Ko extends No{['_title'];constructor(_0x6180a1,_0x3cff88,_0x5b6a4b,_0x2c5b0,_0x465158,_0x29aa46){super(_0x6180a1,_0x3cff88,_0x5b6a4b,_0x465158,_0x29aa46),this['_title']=_0x2c5b0;}get['title'](){return this['_title'];}get['subTitle'](){return this['_sourceCheck']['title'];}}class Wo extends vo{static get['pluginName'](){return'AITranslateController';}constructor(_0x2c8f96){super(_0x2c8f96),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'](_0x517a66,_0xd49314){return new Ko(this['_aiReviewCoreEditing']['getDocumentData'](),_0xd49314,this['_aiConnector'],us(this['context']['locale'],'AI_REVIEW_CHECK_TRANSLATE_TITLE'),_0x517a66['params'],_0x517a66['args']);}['_onReviewCheckResultActivated'](_0x2a82e1){this['_aiReviewCoreUi']['setActiveStateInResults'](_0x2a82e1['change']['id']),this['_aiReviewCoreEditing']['setMarkersInElementAsActive'](_0x2a82e1['change']['id']);}['_onReviewCheckResultDeactivated'](){this['_aiReviewCoreEditing']['setAllMarkersAsInactive'](),this['_aiReviewCoreUi']['resetActiveStateInResults']();}['_onActivateChange'](_0x454498){this['_currentReviewCheckRun']&&('hover'===_0x454498['uiInteraction']&&(this['_changeActivationSource']='panel',this['_currentReviewCheckRun']['activateChange'](_0x454498['id'])),'click'===_0x454498['uiInteraction']&&this['_scrollToChange'](_0x454498['id']));}['_onDeactivateChange'](_0x11fe36){this['_currentReviewCheckRun']&&'panel'===_0x11fe36['origin']&&this['_currentReviewCheckRun']['deactivateChange']();}['_onChangeMarkerClicked'](_0x5142c8,_0x317fa9){this['_currentReviewCheckRun']&&(this['_changeActivationSource']='content',this['_currentReviewCheckRun']['activateChange'](_0x317fa9['changeId']),this['_scrollToChange'](_0x317fa9['changeId']));}['_onChangeMarkerHovered'](_0x535f8a,_0x4b54bf){this['_currentReviewCheckRun']&&(this['_changeActivationSource']='content',this['_currentReviewCheckRun']['activateChange'](_0x4b54bf['changeId']),this['_aiReviewCoreEditing']['reactivateMarkers'](_0x4b54bf['changeId']));}['_onChangeMarkerBlurred'](){this['_currentReviewCheckRun']&&'content'===this['_changeActivationSource']&&(this['_currentReviewCheckRun']['deactivateChange'](),this['_aiReviewCoreEditing']['setAllMarkersAsInactive']());}['_getChangeContentElement'](_0x2e8bfb){return this['_aiReviewCoreEditing']['getContentElementForChange'](_0x2e8bfb);}['_markChangePositionInEditorContent'](_0x36e8c0,_0x5d7da3){this['_aiReviewCoreEditing']['markChangePositionInEditorContent'](_0x36e8c0,_0x5d7da3);}['_diffContent'](_0x39f03f,_0x1e10e5){return this['_aiReviewCoreEditing']['diffContent'](_0x39f03f,_0x1e10e5,!0x0);}['_onReviewCheckRun'](){const _0x59fe59=this['_aiReviewCoreEditing']['getEditor']();_0x59fe59&&_0x59fe59['editing']['view']['change'](_0x5274eb=>{const _0x400e6b=_0x59fe59['editing']['view']['document']['getRoot']();for(const _0x389043 of _0x400e6b['getClassNames']())(_0x389043['startsWith']('ck-ai-review-')||'ck-ai-translate-'===_0x389043)&&_0x5274eb['removeClass'](_0x389043,_0x400e6b);_0x5274eb['addClass']('ck-ai-translate-mode-content',_0x400e6b);});}async['_getChecksList'](){const _0x4de8dd=[],_0x19a0e5=this['context']['config']['get']('ai.translate.languages')||[];for(const _0x2fc734 of _0x19a0e5)_0x4de8dd['push']({'title':_0x2fc734['label'],'id':_0x2fc734['id'],'commandId':_0x2fc734['id'],'description':'','isParameterized':!0x1,'useArgs':!0x0,'args':{'language':_0x2fc734['id']}});const _0x50b87b=new Fo();return _0x50b87b['setupChecks'](this['_translateChecks'](_0x4de8dd)),_0x50b87b;}['_translateChecks'](_0x494fc7){return _0x494fc7['map'](_0xfd8a51=>{const _0x53a812='AI_REVIEW_CHECK_TRANSLATE_OPTIONS_DATA_'+_0xfd8a51['title']['toUpperCase']()['replaceAll']('-','_');return{..._0xfd8a51,'title':this['_getTranslationWithDefault'](_0x53a812,_0xfd8a51['title'])};});}}class Yo extends _o{constructor(_0x4af5f5,_0x43712b){super(_0x4af5f5,_0x43712b),this['on']('set:isLoading',(_0x1ed64a,_0x428a89,_0xd2b8d2)=>{_0xd2b8d2&&(this['headerTitle']=us(this['locale'],'AI_TRANSLATE_CHECK_RESULTS_LOADING_TITLE'));}),this['on']('set:isResultReady',(_0x1115f5,_0x80bb75,_0x73c555)=>{_0x73c555&&(this['headerTitle']=us(this['locale'],'AI_TRANSLATE_CHECK_RESULTS_READY_TITLE'));});}['_createAcceptAllButtonView'](){const _0x1320b9=super['_createAcceptAllButtonView']();return _0x1320b9['set']('label',us(this['locale'],'AI_TRANSLATE_ACCEPT_ALL')),_0x1320b9;}['_createExitReviewButtonView'](){const _0x2fd99a=super['_createExitReviewButtonView']();return _0x2fd99a['set']('label',us(this['locale'],'AI_CHAT_HISTORY_CANCEL')),_0x2fd99a;}}class $o extends wo{['_setupTemplate'](){const _0xb42397=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-translate__check-list-wrapper',_0xb42397['if']('isVisible','ck-hidden',_0x34ea5b=>!_0x34ea5b)]},'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',_0xb42397['if']('isVisible','ck-hidden',_0x590739=>!_0x590739)]},'children':this['_checkViews']}]});}}class qo extends ho{static get['pluginName'](){return'AITranslateUI';}['createMainView'](){const _0x128768=this['context']['locale'],_0x559126=new _0x314748(_0x128768,{'label':us(_0x128768,'AI_REVIEW_CHECK_TRANSLATE_TITLE'),'icon':_0x20d810,'class':'ck-ai-header\x20ck-ai-header_review-translate'}),_0x58777f=new lo(_0x128768,{'header':_0x559126,'list':new $o(_0x128768),'results':new Yo(_0x128768,{'generalErrorText':us(_0x128768,'AI_TRANSLATE_GENERAL_ERROR_MESSAGE')}),'completed':new Ao(_0x128768,{'headerText':us(_0x128768,'AI_TRANSLATE_FINISH_HEADER_TITLE'),'emptyResultsText':us(_0x128768,'AI_TRANSLATE_EMPTY_RESULTS_TEXT'),'buttonText':us(_0x128768,'AI_TRANSLATE_FINISH_BUTTON_LABEL')})});return _0x58777f['extendTemplate']({'attributes':{'class':'ck-ai-translate-mode'}}),_0x58777f;}['registerTab'](){const _0xfacd9f=this['context']['plugins']['get']('AITabs');_0xfacd9f['view']['on']('activateTab',(_0x3ee05f,_0x5ecf93)=>{'translate'===_0x5ecf93?this['fire']('getReviewCheckList'):this['fire']('leaveReview');}),_0xfacd9f['view']['addTab']({'id':'translate','buttonLabel':us(this['context']['locale'],'AI_REVIEW_CHECK_TRANSLATE_TITLE'),'buttonIcon':_0x20d810,'order':0x0,'content':this['_mainView']});}}class Qo extends _0x4c3ee6{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};