@ckeditor/ckeditor5-ai 47.0.0-alpha.4 → 47.0.0-alpha.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/ai.js +1 -1
- package/ckeditor5-metadata.json +14 -0
- package/dist/index-editor.css +27 -3
- package/dist/index.css +28 -3
- package/dist/index.js +4 -4
- package/dist/translations/af.js +1 -1
- package/dist/translations/af.umd.js +1 -1
- package/dist/translations/ar.js +1 -1
- package/dist/translations/ar.umd.js +1 -1
- package/dist/translations/ast.js +1 -1
- package/dist/translations/ast.umd.js +1 -1
- package/dist/translations/az.js +1 -1
- package/dist/translations/az.umd.js +1 -1
- package/dist/translations/be.js +1 -1
- package/dist/translations/be.umd.js +1 -1
- package/dist/translations/bg.js +1 -1
- package/dist/translations/bg.umd.js +1 -1
- package/dist/translations/bn.js +1 -1
- package/dist/translations/bn.umd.js +1 -1
- package/dist/translations/bs.js +1 -1
- package/dist/translations/bs.umd.js +1 -1
- package/dist/translations/ca.js +1 -1
- package/dist/translations/ca.umd.js +1 -1
- package/dist/translations/cs.js +1 -1
- package/dist/translations/cs.umd.js +1 -1
- package/dist/translations/da.js +1 -1
- package/dist/translations/da.umd.js +1 -1
- package/dist/translations/de-ch.js +1 -1
- package/dist/translations/de-ch.umd.js +1 -1
- package/dist/translations/de.js +1 -1
- package/dist/translations/de.umd.js +1 -1
- package/dist/translations/el.js +1 -1
- package/dist/translations/el.umd.js +1 -1
- package/dist/translations/en-au.js +1 -1
- package/dist/translations/en-au.umd.js +1 -1
- package/dist/translations/en-gb.js +1 -1
- package/dist/translations/en-gb.umd.js +1 -1
- package/dist/translations/en.js +1 -1
- package/dist/translations/en.umd.js +1 -1
- package/dist/translations/eo.js +1 -1
- package/dist/translations/eo.umd.js +1 -1
- package/dist/translations/es-co.js +1 -1
- package/dist/translations/es-co.umd.js +1 -1
- package/dist/translations/es.js +1 -1
- package/dist/translations/es.umd.js +1 -1
- package/dist/translations/et.js +1 -1
- package/dist/translations/et.umd.js +1 -1
- package/dist/translations/eu.js +1 -1
- package/dist/translations/eu.umd.js +1 -1
- package/dist/translations/fa.js +1 -1
- package/dist/translations/fa.umd.js +1 -1
- package/dist/translations/fi.js +1 -1
- package/dist/translations/fi.umd.js +1 -1
- package/dist/translations/fr.js +1 -1
- package/dist/translations/fr.umd.js +1 -1
- package/dist/translations/gl.js +1 -1
- package/dist/translations/gl.umd.js +1 -1
- package/dist/translations/gu.js +1 -1
- package/dist/translations/gu.umd.js +1 -1
- package/dist/translations/he.js +1 -1
- package/dist/translations/he.umd.js +1 -1
- package/dist/translations/hi.js +1 -1
- package/dist/translations/hi.umd.js +1 -1
- package/dist/translations/hr.js +1 -1
- package/dist/translations/hr.umd.js +1 -1
- package/dist/translations/hu.js +1 -1
- package/dist/translations/hu.umd.js +1 -1
- package/dist/translations/hy.js +1 -1
- package/dist/translations/hy.umd.js +1 -1
- package/dist/translations/id.js +1 -1
- package/dist/translations/id.umd.js +1 -1
- package/dist/translations/it.js +1 -1
- package/dist/translations/it.umd.js +1 -1
- package/dist/translations/ja.js +1 -1
- package/dist/translations/ja.umd.js +1 -1
- package/dist/translations/jv.js +1 -1
- package/dist/translations/jv.umd.js +1 -1
- package/dist/translations/kk.js +1 -1
- package/dist/translations/kk.umd.js +1 -1
- package/dist/translations/km.js +1 -1
- package/dist/translations/km.umd.js +1 -1
- package/dist/translations/kn.js +1 -1
- package/dist/translations/kn.umd.js +1 -1
- package/dist/translations/ko.js +1 -1
- package/dist/translations/ko.umd.js +1 -1
- package/dist/translations/ku.js +1 -1
- package/dist/translations/ku.umd.js +1 -1
- package/dist/translations/lt.js +1 -1
- package/dist/translations/lt.umd.js +1 -1
- package/dist/translations/lv.js +1 -1
- package/dist/translations/lv.umd.js +1 -1
- package/dist/translations/ms.js +1 -1
- package/dist/translations/ms.umd.js +1 -1
- package/dist/translations/nb.js +1 -1
- package/dist/translations/nb.umd.js +1 -1
- package/dist/translations/ne.js +1 -1
- package/dist/translations/ne.umd.js +1 -1
- package/dist/translations/nl.js +1 -1
- package/dist/translations/nl.umd.js +1 -1
- package/dist/translations/no.js +1 -1
- package/dist/translations/no.umd.js +1 -1
- package/dist/translations/oc.js +1 -1
- package/dist/translations/oc.umd.js +1 -1
- package/dist/translations/pl.js +1 -1
- package/dist/translations/pl.umd.js +1 -1
- package/dist/translations/pt-br.js +1 -1
- package/dist/translations/pt-br.umd.js +1 -1
- package/dist/translations/pt.js +1 -1
- package/dist/translations/pt.umd.js +1 -1
- package/dist/translations/ro.js +1 -1
- package/dist/translations/ro.umd.js +1 -1
- package/dist/translations/ru.js +1 -1
- package/dist/translations/ru.umd.js +1 -1
- package/dist/translations/si.js +1 -1
- package/dist/translations/si.umd.js +1 -1
- package/dist/translations/sk.js +1 -1
- package/dist/translations/sk.umd.js +1 -1
- package/dist/translations/sl.js +1 -1
- package/dist/translations/sl.umd.js +1 -1
- package/dist/translations/sq.js +1 -1
- package/dist/translations/sq.umd.js +1 -1
- package/dist/translations/sr-latn.js +1 -1
- package/dist/translations/sr-latn.umd.js +1 -1
- package/dist/translations/sr.js +1 -1
- package/dist/translations/sr.umd.js +1 -1
- package/dist/translations/sv.js +1 -1
- package/dist/translations/sv.umd.js +1 -1
- package/dist/translations/th.js +1 -1
- package/dist/translations/th.umd.js +1 -1
- package/dist/translations/ti.js +1 -1
- package/dist/translations/ti.umd.js +1 -1
- package/dist/translations/tk.js +1 -1
- package/dist/translations/tk.umd.js +1 -1
- package/dist/translations/tr.js +1 -1
- package/dist/translations/tr.umd.js +1 -1
- package/dist/translations/tt.js +1 -1
- package/dist/translations/tt.umd.js +1 -1
- package/dist/translations/ug.js +1 -1
- package/dist/translations/ug.umd.js +1 -1
- package/dist/translations/uk.js +1 -1
- package/dist/translations/uk.umd.js +1 -1
- package/dist/translations/ur.js +1 -1
- package/dist/translations/ur.umd.js +1 -1
- package/dist/translations/uz.js +1 -1
- package/dist/translations/uz.umd.js +1 -1
- package/dist/translations/vi.js +1 -1
- package/dist/translations/vi.umd.js +1 -1
- package/dist/translations/zh-cn.js +1 -1
- package/dist/translations/zh-cn.umd.js +1 -1
- package/dist/translations/zh.js +1 -1
- package/dist/translations/zh.umd.js +1 -1
- package/lang/contexts.json +1 -0
- package/package.json +15 -15
- package/src/aiactions/aiactions.js +1 -1
- package/src/aiactions/model/aiactionsinteraction.js +1 -1
- package/src/aiactions/model/aiactionsreply.js +1 -1
- package/src/aiassistant/adapters/aiadapter.js +1 -1
- package/src/aiassistant/adapters/aitextadapter.js +1 -1
- package/src/aiassistant/adapters/awstextadapter.js +1 -1
- package/src/aiassistant/adapters/openaitextadapter.js +1 -1
- package/src/aiassistant/aiassistant.js +1 -1
- package/src/aiassistant/aiassistantediting.js +1 -1
- package/src/aiassistant/aiassistantui.js +1 -1
- package/src/aiassistant/legacyerrors.js +1 -1
- package/src/aiassistant/ui/aiassistantcontroller.js +2 -2
- package/src/aiassistant/ui/form/aiformcontentarea.js +1 -1
- package/src/aiassistant/ui/form/aiformerrorview.js +1 -1
- package/src/aiassistant/ui/form/aiformpromptview.js +1 -1
- package/src/aiassistant/ui/form/aiformtoolbarview.js +1 -1
- package/src/aiassistant/ui/form/aiformview.js +1 -1
- package/src/aiassistant/ui/form/aihistorylistitemview.js +1 -1
- package/src/aiassistant/ui/form/aihistorylistview.js +1 -1
- package/src/aiassistant/ui/form/prompthistory.js +1 -1
- package/src/aiassistant/ui/showaiassistantcommand.js +1 -1
- package/src/aiassistant/utils/common-translations.js +1 -1
- package/src/aiassistant/utils/normalizecommandsconfig.js +1 -1
- package/src/aiballoon/aiballoon.js +1 -1
- package/src/aiballoon/ui/aiballoondisclaimerview.js +1 -1
- package/src/aiballoon/ui/aiballoontoolbarview.js +1 -1
- package/src/aiballoon/ui/aiballoonview.js +1 -1
- package/src/aichat/aichat.js +1 -1
- package/src/aichat/aichatcontroller.d.ts +4 -0
- package/src/aichat/aichatcontroller.js +1 -1
- package/src/aichat/aichatui.d.ts +2 -0
- package/src/aichat/aichatui.js +1 -1
- package/src/aichat/model/aichatcontext.js +1 -1
- package/src/aichat/model/aichatconversation.js +1 -1
- package/src/aichat/model/aichatinteraction.js +1 -1
- package/src/aichat/model/aichatmodels.js +1 -1
- package/src/aichat/ui/aichatcontrolsview.d.ts +6 -0
- package/src/aichat/ui/aichatcontrolsview.js +1 -1
- package/src/aichat/ui/aichatfeedview.js +1 -1
- package/src/aichat/ui/aichatheaderview.js +1 -1
- package/src/aichat/ui/aichatview.js +1 -1
- package/src/aichat/ui/controls/aichatchipsoverflowmanager.js +1 -1
- package/src/aichat/ui/controls/aichatcontextitembuttonview.js +1 -1
- package/src/aichat/ui/controls/aichatcontextpanelurlinputview.js +1 -1
- package/src/aichat/ui/controls/aichatcontextpanelview.js +1 -1
- package/src/aichat/ui/controls/aichatcontrolsloaderview.js +1 -1
- package/src/aichat/ui/controls/aichatpromptcapabilitiesview.js +1 -1
- package/src/aichat/ui/controls/aichatpromptinputview.js +1 -1
- package/src/aichat/ui/controls/aichatpromptsuggestionslistview.js +1 -1
- package/src/aichat/ui/controls/resources/aichatresourcelistitemview.js +1 -1
- package/src/aichat/ui/controls/resources/aichatresourcesballoonview.js +1 -1
- package/src/aichat/ui/controls/resources/aichatresourceslistview.js +1 -1
- package/src/aichat/ui/controls/resources/aichatresourcessearchinputview.js +1 -1
- package/src/aichat/ui/controls/resources/aichatresourcesview.js +1 -1
- package/src/aichat/ui/feed/aichatfeedcontextchipsview.js +1 -1
- package/src/aichat/ui/feed/aichatfeederroritemview.js +1 -1
- package/src/aichat/ui/feed/aichatfeedinteractionheaderview.js +1 -1
- package/src/aichat/ui/feed/aichatfeeditemview.js +1 -1
- package/src/aichat/ui/feed/aichatfeedreplyitemview.js +1 -1
- package/src/aichat/ui/feed/aichatfeedsuggestionitemactionsview.js +1 -1
- package/src/aichat/ui/feed/aichatfeedsuggestionitemview.js +1 -1
- package/src/aichat/ui/feed/aichatfeedusermessageitem.js +1 -1
- package/src/aichat/utils/eventnames.js +1 -1
- package/src/aichat/utils/promisequeue.js +1 -1
- package/src/aichat/utils/scrollmanager.js +1 -1
- package/src/aichathistory/aichathistory.js +1 -1
- package/src/aichathistory/aichathistorycontroller.js +1 -1
- package/src/aichathistory/aichathistoryui.js +1 -1
- package/src/aichathistory/model/aichathistoryconversations.js +1 -1
- package/src/aichathistory/model/aichathistoryitem.js +1 -1
- package/src/aichathistory/ui/aichathistorylistitemview.js +1 -1
- package/src/aichathistory/ui/aichathistorylistview.js +1 -1
- package/src/aichathistory/ui/aichathistorysectionlistview.js +1 -1
- package/src/aichathistory/ui/aichathistoryview.js +1 -1
- package/src/aicore/aiconnector.js +1 -1
- package/src/aicore/aiediting.js +1 -1
- package/src/aicore/model/aicapabilities.js +1 -1
- package/src/aicore/model/aicontext.js +1 -1
- package/src/aicore/model/aiinteraction.js +1 -1
- package/src/aicore/model/aireply.js +1 -1
- package/src/aicore/pipeline/airesponseapplier.js +2 -2
- package/src/aicore/pipeline/airesponseparser.js +2 -2
- package/src/aicore/ui/aidisclaimerview.js +1 -1
- package/src/aicore/ui/aiskeleton.js +1 -1
- package/src/aicore/ui/aispinner.js +1 -1
- package/src/aicore/ui/suggestioncontainer/aiminitoolbarview.js +1 -1
- package/src/aicore/ui/suggestioncontainer/aisuggestionbodyview.js +1 -1
- package/src/aicore/ui/suggestioncontainer/aisuggestioncontainerview.js +1 -1
- package/src/aicore/ui/suggestioncontainer/aisuggestioncontentpartview.js +1 -1
- package/src/aicore/ui/suggestioncontainer/aisuggestionheaderview.js +1 -1
- package/src/aicore/utils/common-translations.js +1 -1
- package/src/aicore/utils/createresizebutton.js +1 -1
- package/src/aicore/utils/documentposition.js +1 -1
- package/src/aicore/utils/documentrange.js +1 -1
- package/src/aicore/utils/eventnames.js +1 -1
- package/src/aicore/utils/geteditorfromcontext.js +1 -1
- package/src/aicore/utils/getoperationsfromreply.js +1 -1
- package/src/aicore/utils/getsuggestionpartsfromreply.js +1 -1
- package/src/aicore/utils/htmlparser.js +1 -1
- package/src/aicore/utils/htmlstreamer.js +1 -1
- package/src/aieditorintegration/aieditorintegration.d.ts +35 -0
- package/src/aieditorintegration/aieditorintegration.js +23 -0
- package/src/aieditorintegration/aitogglebutton/aitogglebuttonui.d.ts +38 -0
- package/src/aieditorintegration/aitogglebutton/aitogglebuttonui.js +23 -0
- package/src/aieditorintegration/aitogglebutton/toggleaicommand.d.ts +16 -0
- package/src/aieditorintegration/aitogglebutton/toggleaicommand.js +23 -0
- package/src/aiquickactions/aiquickactions.js +1 -1
- package/src/aiquickactions/aiquickactionscommand.js +1 -1
- package/src/aiquickactions/aiquickactionsediting.js +1 -1
- package/src/aiquickactions/aiquickactionsui.js +1 -1
- package/src/aiquickactions/ui/aiquickactionsbuttoncreator.js +1 -1
- package/src/aiquickactions/ui/aiquickactionsdropdowncontentview.js +1 -1
- package/src/aiquickactions/ui/aiquickactionsdropdowncreator.js +1 -1
- package/src/aiquickactions/utils/common-translations.js +1 -1
- package/src/aireviewmode/aireviewcheckdefinitions.js +1 -1
- package/src/aireviewmode/aireviewmode.js +1 -1
- package/src/aireviewmode/aireviewmodecontroller.js +1 -1
- package/src/aireviewmode/aireviewmodeediting.js +1 -1
- package/src/aireviewmode/aireviewmodeui.js +1 -1
- package/src/aireviewmode/model/aireviewcheck.js +1 -1
- package/src/aireviewmode/model/aireviewcheckcustom.js +1 -1
- package/src/aireviewmode/model/aireviewchecklist.js +1 -1
- package/src/aireviewmode/model/aireviewcheckresult.js +1 -1
- package/src/aireviewmode/model/aireviewcheckresultchange.js +1 -1
- package/src/aireviewmode/model/aireviewcheckrun.js +1 -1
- package/src/aireviewmode/model/aireviewcustomcheckrun.js +1 -1
- package/src/aireviewmode/model/aireviewmodels.js +1 -1
- package/src/aireviewmode/model/aireviewsystemcheckrun.js +1 -1
- package/src/aireviewmode/ui/aireviemodepromptinputview.js +1 -1
- package/src/aireviewmode/ui/aireviewmodeballoonsuggestionview.js +1 -1
- package/src/aireviewmode/ui/aireviewmodechecklistitemresultview.js +1 -1
- package/src/aireviewmode/ui/aireviewmodecustomcheckview.js +1 -1
- package/src/aireviewmode/ui/aireviewmodereviewchecklistview.js +1 -1
- package/src/aireviewmode/ui/aireviewmodereviewcheckresultsview.js +1 -1
- package/src/aireviewmode/ui/aireviewmodereviewcommandlistitemview.js +1 -1
- package/src/aireviewmode/ui/aireviewmodereviewcompletedview.js +1 -1
- package/src/aireviewmode/ui/aireviewmodeview.js +1 -1
- package/src/aireviewmode/ui/form/aireviewmodeformamanager.js +1 -1
- package/src/aireviewmode/ui/form/aireviewmodeformdropdown.js +1 -1
- package/src/aireviewmode/ui/form/aireviewmodeformmanager.js +1 -1
- package/src/aitabs/aitabs.js +1 -1
- package/src/aitabs/aitabsmainview.d.ts +6 -0
- package/src/aitabs/aitabsmainview.js +1 -1
- package/src/aitabs/tabs/aitabsview.js +1 -1
- package/src/aitabs/tabs/tabbuttonview.js +1 -1
- package/src/aitabs/tabs/tabpanelview.js +1 -1
- package/src/augmentation.d.ts +6 -0
- package/src/index.d.ts +3 -0
- package/src/index.js +1 -1
- package/theme/aichat/aichat-controls.css +6 -0
- package/theme/aichat/aichat.css +2 -0
- package/theme/aichat/aisuggestioncontainer.css +8 -2
- package/theme/aireviewmode/aireviewmode-check-list.css +10 -1
- package/theme/aireviewmode/aireviewmode-check-run-result.css +5 -0
package/dist/index.js
CHANGED
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
*
|
|
21
21
|
*
|
|
22
22
|
*/
|
|
23
|
-
import{Plugin as _0x5167f5,Command as Nt,ContextPlugin as _0x3cc6c1,Editor as ot}from'@ckeditor/ckeditor5-core/dist/index.js';import{IconCopy as _0x5c22c5,IconCheck as _0x51abb4,IconError as _0x333771,IconSubmit as _0x3720ea,IconAIHistory as Ht,IconMagicWand as _0x51694e,IconRobotPencil as _0x34d34b,IconMaximize as _0x26c8fc,IconMinimize as _0x3107c9,IconShowChangesOn as _0x2dcfa2,IconShowChangesOff as _0x1e2b2a,IconDocument as _0x27a8d2,IconThreeStars as _0x471065,IconDocumentWithLoupe as _0x4da215,IconAddComment as _0x16c946,IconRemove as _0x1cbe16,IconDocumentWithCheckmark as _0x47e913,IconDocumentWithCross as _0x755f8,IconLoupe as _0x72e60a,IconCancel as _0x309cee,IconStop as _0x3e1e42,IconAIChat as St,IconPlus as _0x4c6d08,IconPin as _0x1c289e,IconThreeHorizontalDots as _0x197fc5,IconChevronRight as _0x59adba,IconInfo as _0x124747,IconEye as _0x27b625,IconEyeCrossedOut as _0xd52587,IconAIReview as _0xf283a1}from'@ckeditor/ckeditor5-icons/dist/index.js';import{uid as _0x48375a,CKEditorError as _0xa14e6e,ObservableMixin as _0x536028,global as _0x3c96fa,isVisible as _0x4f30a4,Rect as _0x317c72,Collection as _0x6ba718,FocusTracker as _0x13c01a,KeystrokeHandler as _0x3c58a3,first as _0x4cdc37,toArray as _0x49bfd5,EmitterMixin as _0x5a5836,logWarning as _0x49365e,logError as nt,scrollViewportToShowTarget as rt,ResizeObserver as _0x7c9171,_isMotionReduced as At,scrollAncestorsToShowTarget as _0x2c6f03,DomEmitterMixin as te}from'@ckeditor/ckeditor5-utils/dist/index.js';import{ToolbarView as _0x440716,ButtonView as _0xa24b3c,View as _0xebef92,SpinnerView as _0x5a1254,IconView as _0x23cd9a,AutocompleteView as _0x103d7a,ListView as _0x3dc816,ListItemGroupView as _0x4d5bae,ListItemView as _0x22bc08,ButtonLabelView as _0x5babd6,FocusCycler as _0x532b63,createLabeledTextarea as _0x3d9c16,Dialog as _0x83bc2d,createDropdown as _0x115dce,addMenuToDropdown as _0x38ea29,MenuBarMenuView as _0x48a6ad,MenuBarMenuListItemButtonView as _0x20e330,DialogViewPosition as _0x48055e,MenuBarMenuListView as _0x165f8d,MenuBarMenuListItemView as _0x5c0d95,ViewCollection as _0x18aaa9,UIModel as _0x26f53f,SplitButtonView as _0x48f61c,BalloonPanelView as _0x5b9e88,BodyCollection as zt,clickOutsideHandler as _0x16cb96,ListItemButtonView as _0x270bf4,addListToDropdown as _0xc359d8,submitHandler as _0x1d3586,LabeledFieldView as th,createLabeledInputText as _0x3ad8f1,FormHeaderView as _0x247e71,HighlightedTextView as _0x357569,FileDialogButtonView as _0x1e8d98,InputTextView as _0x4d3ca2,SearchTextView as _0x39ca44,DropdownMenuButtonView as _0x4f934c,DropdownMenuPanelPositioningFunctions as _0x350094,BalloonToolbar as Wt,FormRowView as _0x4cab66,TextareaView as _0x5454a2}from'@ckeditor/ckeditor5-ui/dist/index.js';import{ClipboardPipeline as _0x305769,ClipboardMarkersUtils as _0x5023f9}from'@ckeditor/ckeditor5-clipboard/dist/index.js';import{ViewDocumentDomEventData as _0x50a248,ViewDataTransfer as _0xd9a4a2,ViewUpcastWriter as _0x45ce4d,Matcher as _0x5d48c1,ViewDowncastWriter as kt,transformOperationSets as _0x59901f,_DetachOperation as _0x3d4b6d,_insertIntoModelNodeList as _0x53727c,_removeFromModelNodeList as _0x2cbe1c,ModelRange as _0x4f7a9a,ModelDocumentFragment as _0x91360f,ModelPosition as _0x31d1c1,ModelTreeWalker as Zt,InsertOperation as $t,MarkerOperation as Bt}from'@ckeditor/ckeditor5-engine/dist/index.js';import{unescape as _0x4747cb,escape as _0x5453ce,escapeRegExp as _0x46cb0c}from'es-toolkit/compat';import{BedrockRuntimeClient as _0x252a89,InvokeModelWithResponseStreamCommand as _0x2549c7,InvokeModelCommand as _0x46fffb}from'@aws-sdk/client-bedrock-runtime';import{createParser as wt}from'eventsource-parser';import{parseDocument as _0x2adc66}from'htmlparser2';import{isTag as _0x42e156,findOne as mt,getParent as _0x4f9327,findAll as _0x28a1af,removeElement as _0x46c496,replaceElement as _0x255b5e,prepend as _0x2860b0,prependChild as to,appendChild as _0x5a361c,append as _0x71c555,find as _0x3846b4,isComment as _0x31922d,getChildren as tn,textContent as _0x4355c4}from'domutils';import _0x4b9a76 from'dom-serializer';import{Document as _t,Element as _0x3bc3e5,Text as _0x29195d,cloneNode as _0xaa8b9b,isDocument as _0x10fded,isText as _0x243b0e,NodeWithChildren as _0x41c9a6}from'domhandler';import{MarkdownGfmMdToHtml as _0x174684}from'@ckeditor/ckeditor5-markdown-gfm/dist/index.js';import{getAllMarkersDomElementsSorted as tt,DocumentCompare as _0x1cdca3,DATA_ID_MODEL_ATTRIBUTE as gt}from'@ckeditor/ckeditor5-collaboration-core/dist/index.js';import{IconThumbUp as _0x580cd9,IconThumbDown as _0x397d88,IconCopy as _0x4df34d,IconCheck as _0x474c30,IconShowChangesOff as _0x1bba44,IconShowChangesOn as _0x13580e,IconWeb as _0x490596,IconNextArrow as _0x4b1bfd,IconPreviousArrow as _0x1df48d,IconAI as yt,IconClose as _0xcb8165,IconSelection as _0x2f906c,IconFileUpload as _0x4a15c3,IconLink as _0x5d9ba5,IconDocument as _0xacaacc,IconBulb as _0x5d9036,IconDocumentOutline as _0x543968,IconPaperClip as _0x3de6a5,IconBrowseFiles as _0x368e82,IconDropdownArrow as _0x5dbd42,IconAIQuickActions as _0x51a38c,IconAIAskAI as Ut,IconAIChatCommands as Kt,IconAIImproveWriting as Dt,IconAIContinueWriting as Mt,IconAIGrammarCheck as Lt,IconAIAdjustLength as Qt,IconAIChangeTone as bt,IconAITranslate as qt,IconAIOther as Yt,IconRefresh as _0x167f4a}from'@ckeditor/ckeditor5-icons/dist/index.js';import _0x4f2268 from'morphdom';import{ConfirmMixin as _0x490755,LateFocusDropdownButtonView as _0x2fd5ab,DocumentCompare as _0x4d3a88,DATA_ID_VIEW_ATTRIBUTE as _0x439c4a,DATA_ID_MODEL_ATTRIBUTE as _0x355718}from'ckeditor5-collaboration/dist/index.js';import{diffArrays as _0x3eba85}from'diff';const H='_ungrouppedCommands';function S(_0x1f8546,_0x1f5e1f){const _0x423177=(0x0,_0x1f5e1f['t'])('Other');return _0x1f8546['length']?'groupId'in _0x1f8546[0x0]?_0x1f8546:[{'groupId':H,'groupLabel':_0x423177,'order':0x1/0x0,'commands':_0x1f8546}]:[{'groupId':H,'groupLabel':_0x423177,'order':0x1/0x0,'commands':[]}];}const Un=globalThis['DataTransfer'],j='ai-ui';class I extends _0x5167f5{static get['pluginName'](){return'AIAssistantEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const {editor:_0x153fb9}=this,_0x1e8eba=['ck-fake-ai-selection'];_0x153fb9['config']['get']('ai.assistant.useTheme')&&_0x1e8eba['push']('ck-ai-assistant-ui_theme'),_0x153fb9['conversion']['for']('editingDowncast')['markerToHighlight']({'model':j,'view':{'classes':_0x1e8eba,'priority':0xc}}),_0x153fb9['conversion']['for']('editingDowncast')['markerToElement']({'model':j,'view':(_0xc8b523,{writer:_0x658b40})=>{if(!_0xc8b523['markerRange']['isCollapsed'])return null;const _0x2ead44=_0x658b40['createUIElement']('span');return _0x658b40['addClass'](['ck-fake-ai-selection','ck-fake-ai-selection_collapsed'],_0x2ead44),_0x2ead44;}});}['afterInit'](){!async function(_0x53feb0){const _0x7772ba=_0x326e5a([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]),_0x8a0bc0=0x3dffc4e1,_0xbd8ce7=0x3df8b049^_0x8a0bc0,_0x3fb970=window[_0x326e5a([0x44,0x61,0x74,0x65])][_0x326e5a([0x6e,0x6f,0x77])](),_0x2b060c=_0x53feb0[_0x326e5a([0x65,0x64,0x69,0x74,0x6f,0x72])],_0x3f7956=new window[(_0x326e5a([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x45e548=>{_0x2b060c[_0x326e5a([0x6f,0x6e,0x63,0x65])](_0x326e5a([0x72,0x65,0x61,0x64,0x79]),_0x45e548);}),_0x4eb030={[_0x326e5a([0x6b,0x74,0x79])]:_0x326e5a([0x45,0x43]),[_0x326e5a([0x75,0x73,0x65])]:_0x326e5a([0x73,0x69,0x67]),[_0x326e5a([0x63,0x72,0x76])]:_0x326e5a([0x50,0x2d,0x32,0x35,0x36]),[_0x326e5a([0x78])]:_0x326e5a([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]),[_0x326e5a([0x79])]:_0x326e5a([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]),[_0x326e5a([0x61,0x6c,0x67])]:_0x326e5a([0x45,0x53,0x32,0x35,0x36])},_0x556056=_0x2b060c[_0x326e5a([0x63,0x6f,0x6e,0x66,0x69,0x67])][_0x326e5a([0x67,0x65,0x74])](_0x326e5a([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79]));async function _0x13b058(){let _0x51de81,_0x895e3b=null,_0x2f5097=null;try{if(_0x556056==_0x326e5a([0x47,0x50,0x4c]))return _0x326e5a([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]);if(_0x51de81=_0x2869d5(),!_0x51de81)return _0x326e5a([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);return _0x51de81[_0x326e5a([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])]&&(_0x2f5097=_0x477dd1(_0x51de81[_0x326e5a([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])],_0x51de81[_0x326e5a([0x6a,0x74,0x69])])),await _0x44adfe()?_0x88bb97()?_0x4720d4()?_0x326e5a([0x45,0x78,0x70,0x69,0x72,0x65,0x64]):_0x5b4465()?(_0x51de81[_0x326e5a([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])]==_0x326e5a([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e])&&(_0x895e3b=_0x1a036b(_0x326e5a([0x45,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e,0x4c,0x69,0x6d,0x69,0x74]))),_0x51de81[_0x326e5a([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])]==_0x326e5a([0x74,0x72,0x69,0x61,0x6c])&&(_0x895e3b=_0x1a036b(_0x326e5a([0x54,0x72,0x69,0x61,0x6c,0x4c,0x69,0x6d,0x69,0x74]))),await _0x235e5b()):_0x326e5a([0x44,0x6f,0x6d,0x61,0x69,0x6e,0x4c,0x69,0x6d,0x69,0x74]):_0x326e5a([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]):_0x326e5a([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}catch{return _0x326e5a([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}function _0x4720d4(){const _0x5f2bc5=[_0x326e5a([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e]),_0x326e5a([0x74,0x72,0x69,0x61,0x6c])][_0x326e5a([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x51de81[_0x326e5a([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])])?_0x3fb970/0x3e8:0xe10*_0xbd8ce7;return _0x51de81[_0x326e5a([0x65,0x78,0x70])]<_0x5f2bc5;}function _0x88bb97(){const _0x287b83=_0x51de81[_0x326e5a([0x66,0x65,0x61,0x74,0x75,0x72,0x65,0x73])];return!!_0x287b83&&(!!_0x287b83[_0x326e5a([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x326e5a([0x2a]))||!!_0x287b83[_0x326e5a([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x326e5a([0x41,0x49])));}function _0x5b4465(){const _0xf66850=_0x51de81[_0x326e5a([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x64,0x48,0x6f,0x73,0x74,0x73])];if(!_0xf66850||0x0==_0xf66850[_0x326e5a([0x6c,0x65,0x6e,0x67,0x74,0x68])])return!0x0;const {hostname:_0x4c67dd}=new URL(window[_0x326e5a([0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e])]['href']);if(_0xf66850[_0x326e5a([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x4c67dd))return!0x0;const _0x1d6c2e=_0x4c67dd[_0x326e5a([0x73,0x70,0x6c,0x69,0x74])](_0x326e5a([0x2e]));return _0xf66850[_0x326e5a([0x66,0x69,0x6c,0x74,0x65,0x72])](_0x258ad1=>_0x258ad1[_0x326e5a([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x326e5a([0x2a])))[_0x326e5a([0x6d,0x61,0x70])](_0x566689=>_0x566689[_0x326e5a([0x73,0x70,0x6c,0x69,0x74])](_0x326e5a([0x2e])))[_0x326e5a([0x66,0x69,0x6c,0x74,0x65,0x72])](_0x5b1851=>_0x5b1851[_0x326e5a([0x6c,0x65,0x6e,0x67,0x74,0x68])]<=_0x1d6c2e[_0x326e5a([0x6c,0x65,0x6e,0x67,0x74,0x68])])[_0x326e5a([0x6d,0x61,0x70])](_0x130dfa=>Array(_0x1d6c2e[_0x326e5a([0x6c,0x65,0x6e,0x67,0x74,0x68])]-_0x130dfa[_0x326e5a([0x6c,0x65,0x6e,0x67,0x74,0x68])])[_0x326e5a([0x66,0x69,0x6c,0x6c])](_0x130dfa[0x0]===_0x326e5a([0x2a])?_0x326e5a([0x2a]):'')[_0x326e5a([0x63,0x6f,0x6e,0x63,0x61,0x74])](_0x130dfa))[_0x326e5a([0x73,0x6f,0x6d,0x65])](_0x217ccf=>_0x1d6c2e[_0x326e5a([0x65,0x76,0x65,0x72,0x79])]((_0x18e11c,_0x355d03)=>_0x217ccf[_0x355d03]===_0x18e11c||_0x217ccf[_0x355d03]===_0x326e5a([0x2a])));}function _0x235e5b(){return _0x895e3b&&_0x2f5097?new window[(_0x326e5a([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0x38fb6,_0xa7eb1c)=>{_0x895e3b[_0x326e5a([0x74,0x68,0x65,0x6e])](_0x38fb6,_0xa7eb1c),_0x2f5097[_0x326e5a([0x74,0x68,0x65,0x6e])](_0x1e9b1b=>{_0x1e9b1b!=_0x326e5a([0x56,0x61,0x6c,0x69,0x64])&&_0x38fb6(_0x1e9b1b);},_0xa7eb1c);}):_0x895e3b||_0x2f5097||_0x326e5a([0x56,0x61,0x6c,0x69,0x64]);}}function _0x477dd1(_0x5e3311,_0x5530e3){return new window[(_0x326e5a([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x5e72f3=>{if(_0x33088b())return _0x5e72f3(_0x326e5a([0x56,0x61,0x6c,0x69,0x64]));_0x4c53e4(),_0x2b060c[_0x326e5a([0x64,0x65,0x63,0x6f,0x72,0x61,0x74,0x65])](_0x326e5a([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]));let _0xd918c8=!0x1;const _0x872c4f=_0x48375a();function _0x38e6d8(_0x12b1a){return!!_0x12b1a&&(typeof _0x12b1a===_0x326e5a([0x6f,0x62,0x6a,0x65,0x63,0x74])||typeof _0x12b1a===_0x326e5a([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]))&&typeof _0x12b1a[_0x326e5a([0x74,0x68,0x65,0x6e])]===_0x326e5a([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e])&&typeof _0x12b1a[_0x326e5a([0x63,0x61,0x74,0x63,0x68])]===_0x326e5a([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]);}function _0x1a2b5a(_0x3a321c){_0x2cdb88(_0x3a321c)[_0x326e5a([0x74,0x68,0x65,0x6e])](_0x20bf91=>{if(!_0x20bf91||_0x20bf91[_0x326e5a([0x73,0x74,0x61,0x74,0x75,0x73])]!=_0x326e5a([0x6f,0x6b]))return _0x326e5a([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]);return _0x27bfcb(_0x976f97(_0x872c4f+_0x5530e3))!=_0x20bf91[_0x326e5a([0x76,0x65,0x72,0x69,0x66,0x69,0x63,0x61,0x74,0x69,0x6f,0x6e])]?_0x326e5a([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]):_0x326e5a([0x56,0x61,0x6c,0x69,0x64]);})[_0x326e5a([0x74,0x68,0x65,0x6e])](_0x16f6e5=>(_0x1c5546(),_0x16f6e5),()=>{const _0x1cbf1f=_0x52ac98();return null==_0x1cbf1f?(_0x1c5546(),_0x326e5a([0x56,0x61,0x6c,0x69,0x64])):_0x326e5a(_0x3fb970-_0x1cbf1f>(0x19f340e1^_0x8a0bc0)?[0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]:[0x56,0x61,0x6c,0x69,0x64]);})[_0x326e5a([0x74,0x68,0x65,0x6e])](_0x5e72f3)[_0x326e5a([0x63,0x61,0x74,0x63,0x68])](()=>{_0x5e72f3(_0x326e5a([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});const _0x513318=0x3dc92a61^_0x8a0bc0;function _0x1c5546(){const _0x29ef1a=_0x326e5a([0x6c,0x6c,0x63,0x74,0x2d])+_0x27bfcb(_0x976f97(_0x5e3311)),_0xa4664a=_0x594155(_0x27bfcb(window[_0x326e5a([0x4d,0x61,0x74,0x68])][_0x326e5a([0x63,0x65,0x69,0x6c])](_0x3fb970/_0x513318)));window[_0x326e5a([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0x326e5a([0x73,0x65,0x74,0x49,0x74,0x65,0x6d])](_0x29ef1a,_0xa4664a);}function _0x52ac98(){const _0x4b4f13=_0x326e5a([0x6c,0x6c,0x63,0x74,0x2d])+_0x27bfcb(_0x976f97(_0x5e3311)),_0x2004d9=window[_0x326e5a([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0x326e5a([0x67,0x65,0x74,0x49,0x74,0x65,0x6d])](_0x4b4f13);return _0x2004d9?window[_0x326e5a([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x594155(_0x2004d9),0x10)*_0x513318:null;}function _0x2cdb88(_0x2aaa88){return new window[(_0x326e5a([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0x50073a,_0x234c15)=>{_0x2aaa88[_0x326e5a([0x74,0x68,0x65,0x6e])](_0x50073a,_0x234c15),window[_0x326e5a([0x73,0x65,0x74,0x54,0x69,0x6d,0x65,0x6f,0x75,0x74])](_0x234c15,0x3dfe1021^_0x8a0bc0);});}}_0x2b060c[_0x326e5a([0x6f,0x6e])](_0x326e5a([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),(_0x1ab3d4,_0x3c4a7d)=>{if(_0x3c4a7d[0x0]!=_0x5e3311)return _0x5e72f3(_0x326e5a([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));_0x3c4a7d[0x1]={..._0x3c4a7d[0x1],[_0x326e5a([0x72,0x65,0x71,0x75,0x65,0x73,0x74,0x49,0x64])]:_0x872c4f};},{[_0x326e5a([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0x326e5a([0x68,0x69,0x67,0x68])}),_0x2b060c[_0x326e5a([0x6f,0x6e])](_0x326e5a([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),_0x34be89=>{_0x38e6d8(_0x34be89[_0x326e5a([0x72,0x65,0x74,0x75,0x72,0x6e])])&&(_0xd918c8=!0x0,_0x1a2b5a(_0x34be89[_0x326e5a([0x72,0x65,0x74,0x75,0x72,0x6e])]));},{[_0x326e5a([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0x326e5a([0x6c,0x6f,0x77])}),_0x3f7956[_0x326e5a([0x74,0x68,0x65,0x6e])](()=>{_0xd918c8||_0x5e72f3(_0x326e5a([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});});function _0x33088b(){return _0x2b060c[_0x326e5a([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0x326e5a([0x76,0x69,0x65,0x77])][_0x326e5a([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]==_0x326e5a([0x61,0x75,0x74,0x6f]);}function _0x4c53e4(){_0x2b060c[_0x326e5a([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0x326e5a([0x76,0x69,0x65,0x77])][_0x326e5a([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]=_0x326e5a([0x61,0x75,0x74,0x6f]);}}function _0x1a036b(_0x4e8211){const _0xf41d2c=[new window[(_0x326e5a([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x542118=>setTimeout(_0x542118,0x3df6fa2d^_0x8a0bc0)),_0x3f7956[_0x326e5a([0x74,0x68,0x65,0x6e])](()=>new window[(_0x326e5a([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x4697c1=>{let _0x122133=0x0;_0x2b060c[_0x326e5a([0x6d,0x6f,0x64,0x65,0x6c])][_0x326e5a([0x6f,0x6e])](_0x326e5a([0x61,0x70,0x70,0x6c,0x79,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e]),(_0x4e6c46,_0x2b12a0)=>{_0x2b12a0[0x0][_0x326e5a([0x69,0x73,0x44,0x6f,0x63,0x75,0x6d,0x65,0x6e,0x74,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e])]&&_0x122133++,_0x122133==(0x3dffc519^_0x8a0bc0)&&(_0x4697c1(),_0x4e6c46[_0x326e5a([0x6f,0x66,0x66])]());});}))];return window[_0x326e5a([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65])][_0x326e5a([0x72,0x61,0x63,0x65])](_0xf41d2c)[_0x326e5a([0x74,0x68,0x65,0x6e])](()=>_0x4e8211);}async function _0x1ff29a(){await _0x3f7956,_0x2b060c[_0x326e5a([0x6d,0x6f,0x64,0x65,0x6c])][_0x326e5a([0x63,0x68,0x61,0x6e,0x67,0x65])]=_0x3c2cf5,_0x2b060c[_0x326e5a([0x6d,0x6f,0x64,0x65,0x6c])][_0x326e5a([0x65,0x6e,0x71,0x75,0x65,0x75,0x65,0x43,0x68,0x61,0x6e,0x67,0x65])]=_0x3c2cf5,_0x2b060c[_0x326e5a([0x65,0x6e,0x61,0x62,0x6c,0x65,0x52,0x65,0x61,0x64,0x4f,0x6e,0x6c,0x79,0x4d,0x6f,0x64,0x65])](_0x326e5a([0x6d,0x6f,0x64,0x65,0x6c]));}function _0x3c9d59(_0x10ccb9){const _0x1bb4fc=_0x1c0d70();_0x2b060c[_0x1bb4fc]=_0x326e5a([0x61,0x69,0x4c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79])+_0x10ccb9,_0x10ccb9!=_0x326e5a([0x56,0x61,0x6c,0x69,0x64])&&_0x1ff29a();}function _0x1c0d70(){const _0xeef2ef=window[_0x326e5a([0x53,0x74,0x72,0x69,0x6e,0x67])](window[_0x326e5a([0x70,0x65,0x72,0x66,0x6f,0x72,0x6d,0x61,0x6e,0x63,0x65])][_0x326e5a([0x6e,0x6f,0x77])]())[_0x326e5a([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](_0x326e5a([0x2e]),'');let _0x32eb0c=_0x326e5a([0x6e]);for(let _0x20e9f7=0x0;_0x20e9f7<_0xeef2ef[_0x326e5a([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0x20e9f7+=0x2){let _0x2bb73c=window[_0x326e5a([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0xeef2ef[_0x326e5a([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0x20e9f7,_0x20e9f7+0x2));_0x2bb73c>=_0x7772ba[_0x326e5a([0x6c,0x65,0x6e,0x67,0x74,0x68])]&&(_0x2bb73c-=_0x7772ba[_0x326e5a([0x6c,0x65,0x6e,0x67,0x74,0x68])]),_0x32eb0c+=_0x7772ba[_0x2bb73c];}return _0x32eb0c;}function _0x2869d5(){const _0x528f3d=_0x556056[_0x326e5a([0x73,0x70,0x6c,0x69,0x74])](_0x326e5a([0x2e]));if(0x3!=_0x528f3d[_0x326e5a([0x6c,0x65,0x6e,0x67,0x74,0x68])])return null;return _0x4ee464(_0x528f3d[0x1]);function _0x4ee464(_0x5814f7){const _0x55ce25=_0x299563(_0x5814f7);return _0x55ce25&&_0x496994()?_0x55ce25:null;function _0x496994(){const _0x2e91ef=_0x55ce25[_0x326e5a([0x6a,0x74,0x69])],_0x2f119c=window[_0x326e5a([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x2e91ef[_0x326e5a([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0x2e91ef[_0x326e5a([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8),0x10),_0x46eeef={..._0x55ce25,[_0x326e5a([0x6a,0x74,0x69])]:_0x2e91ef[_0x326e5a([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](0x0,_0x2e91ef[_0x326e5a([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8)};return delete _0x46eeef[_0x326e5a([0x76,0x63])],_0x976f97(_0x46eeef)==_0x2f119c;}}}async function _0x44adfe(){let _0x34be15=!0x0;try{const _0x2b1f7e=_0x556056[_0x326e5a([0x73,0x70,0x6c,0x69,0x74])](_0x326e5a([0x2e])),[_0x34fe31,_0x17321e,_0x3f2502]=_0x2b1f7e;return _0x40b3ad(_0x34fe31),await _0x312a6f(_0x34fe31,_0x17321e,_0x3f2502),_0x34be15;}catch{return!0x1;}function _0x40b3ad(_0x45d4f3){const _0x330442=_0x299563(_0x45d4f3);_0x330442&&_0x330442[_0x326e5a([0x61,0x6c,0x67])]==_0x326e5a([0x45,0x53,0x32,0x35,0x36])||(_0x34be15=!0x1);}async function _0x312a6f(_0x11e38b,_0xd6f533,_0x1bc3e4){const _0x13185f=window[_0x326e5a([0x55,0x69,0x6e,0x74,0x38,0x41,0x72,0x72,0x61,0x79])][_0x326e5a([0x66,0x72,0x6f,0x6d])](_0x22e9e6(_0x1bc3e4),_0x32fb38=>_0x32fb38[_0x326e5a([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](0x0)),_0x4398f4=new window[(_0x326e5a([0x54,0x65,0x78,0x74,0x45,0x6e,0x63,0x6f,0x64,0x65,0x72]))]()[_0x326e5a([0x65,0x6e,0x63,0x6f,0x64,0x65])](_0x11e38b+_0x326e5a([0x2e])+_0xd6f533),_0x39c5de=window[_0x326e5a([0x63,0x72,0x79,0x70,0x74,0x6f])][_0x326e5a([0x73,0x75,0x62,0x74,0x6c,0x65])];if(!_0x39c5de)return;const _0x58492c=await _0x39c5de[_0x326e5a([0x69,0x6d,0x70,0x6f,0x72,0x74,0x4b,0x65,0x79])](_0x326e5a([0x6a,0x77,0x6b]),_0x4eb030,{[_0x326e5a([0x6e,0x61,0x6d,0x65])]:_0x326e5a([0x45,0x43,0x44,0x53,0x41]),[_0x326e5a([0x6e,0x61,0x6d,0x65,0x64,0x43,0x75,0x72,0x76,0x65])]:_0x326e5a([0x50,0x2d,0x32,0x35,0x36])},!0x1,[_0x326e5a([0x76,0x65,0x72,0x69,0x66,0x79])]);await _0x39c5de[_0x326e5a([0x76,0x65,0x72,0x69,0x66,0x79])]({[_0x326e5a([0x6e,0x61,0x6d,0x65])]:_0x326e5a([0x45,0x43,0x44,0x53,0x41]),[_0x326e5a([0x68,0x61,0x73,0x68])]:{[_0x326e5a([0x6e,0x61,0x6d,0x65])]:_0x326e5a([0x53,0x48,0x41,0x2d,0x32,0x35,0x36])}},_0x58492c,_0x13185f,_0x4398f4)||(_0x34be15=!0x1);}}function _0x299563(_0x5d7013){return _0x5d7013[_0x326e5a([0x73,0x74,0x61,0x72,0x74,0x73,0x57,0x69,0x74,0x68])](_0x326e5a([0x65,0x79]))?JSON[_0x326e5a([0x70,0x61,0x72,0x73,0x65])](_0x22e9e6(_0x5d7013)):null;}function _0x22e9e6(_0x7518a9){return window[_0x326e5a([0x61,0x74,0x6f,0x62])](_0x7518a9[_0x326e5a([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/-/g,_0x326e5a([0x2b]))[_0x326e5a([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/_/g,_0x326e5a([0x2f])));}function _0x976f97(_0x122032){let _0x580b33=0x1505;function _0x4f5a3b(_0x3a0f40){for(let _0x5a01cc=0x0;_0x5a01cc<_0x3a0f40[_0x326e5a([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0x5a01cc++){const _0x37ec92=_0x3a0f40[_0x326e5a([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](_0x5a01cc);_0x580b33=(_0x580b33<<0x5)+_0x580b33+_0x37ec92,_0x580b33&=_0x580b33;}}function _0x53c961(_0x77ec5e){Array[_0x326e5a([0x69,0x73,0x41,0x72,0x72,0x61,0x79])](_0x77ec5e)?_0x77ec5e[_0x326e5a([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](_0x53c961):_0x77ec5e&&typeof _0x77ec5e==_0x326e5a([0x6f,0x62,0x6a,0x65,0x63,0x74])?Object[_0x326e5a([0x65,0x6e,0x74,0x72,0x69,0x65,0x73])](_0x77ec5e)[_0x326e5a([0x73,0x6f,0x72,0x74])]()[_0x326e5a([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](([_0x902a52,_0x40c1ea])=>{_0x4f5a3b(_0x902a52),_0x53c961(_0x40c1ea);}):_0x4f5a3b(window[_0x326e5a([0x53,0x74,0x72,0x69,0x6e,0x67])](_0x77ec5e));}return _0x53c961(_0x122032),_0x580b33>>>0x0;}function _0x27bfcb(_0x5722d1){return _0x5722d1[_0x326e5a([0x74,0x6f,0x53,0x74,0x72,0x69,0x6e,0x67])](0x10)[_0x326e5a([0x70,0x61,0x64,0x53,0x74,0x61,0x72,0x74])](0x8,_0x326e5a([0x30]));}function _0x594155(_0x491997){return _0x491997[_0x326e5a([0x73,0x70,0x6c,0x69,0x74])]('')[_0x326e5a([0x72,0x65,0x76,0x65,0x72,0x73,0x65])]()[_0x326e5a([0x6a,0x6f,0x69,0x6e])]('');}function _0x3c2cf5(){}function _0x326e5a(_0x223c75){return _0x223c75['map'](_0x21f757=>String['fromCharCode'](_0x21f757))['join']('');}_0x3c9d59(await _0x13b058());}(this);}['showFakeVisualSelection'](){const _0x1d0969=this['editor']['model'];_0x1d0969['change'](_0x3c2a1d=>{const _0xd28d93=_0x1d0969['document']['selection']['getRanges']();let _0x2256f3=0x0;for(const _0x40da8b of _0xd28d93){const _0x38bcb1=j+':'+_0x2256f3;if(_0x1d0969['markers']['has'](_0x38bcb1))_0x3c2a1d['updateMarker'](_0x38bcb1,{'range':_0x40da8b});else{if(_0x40da8b['start']['isAtEnd']){const _0x41cc7e=_0x40da8b['start']['getLastMatchingPosition'](({item:_0x243b67})=>!_0x1d0969['schema']['isContent'](_0x243b67),{'boundaries':_0x40da8b});_0x3c2a1d['addMarker'](_0x38bcb1,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x3c2a1d['createRange'](_0x41cc7e,_0x40da8b['end'])});}else _0x3c2a1d['addMarker'](_0x38bcb1,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x40da8b});}_0x2256f3++;}});}['hideFakeVisualSelection'](){const _0x4396ee=this['editor']['model'],_0x20389a=Array['from'](this['editor']['model']['markers']['getMarkersGroup'](j));_0x20389a['length']&&_0x4396ee['change'](_0x1483ea=>{_0x20389a['forEach'](_0x122430=>{_0x1483ea['removeMarker'](_0x122430);});});}['insertContent'](_0x2bae96,_0x1360e6){const _0x477b8c=this['_getAISelection'](),_0x1e9852=_0x1360e6||_0x477b8c['getFirstRange']();this['editor']['model']['canEditAt'](_0x1e9852)&&this['editor']['model']['change'](_0x48f544=>{this['hideFakeVisualSelection'](),_0x1360e6||this['_resetContentOfSelectedTableCells'](_0x48f544,_0x477b8c),this['_pasteHTMLUsingClipboard']({'insertAt':_0x1e9852,'writer':_0x48f544,'html':_0x2bae96});});}['insertContentBelow'](_0x48e5a1){const {model:_0x1b8121}=this['editor'],_0x2729a2=this['_getAISelection']();_0x1b8121['change'](()=>{const _0x238fc0=this['_prepareTableInsertBelowPosition'](_0x48e5a1,_0x2729a2)||this['_getDefaultInsertBelowPosition'](_0x2729a2);this['insertContent'](_0x48e5a1,_0x238fc0);});}['_getAISelection'](){const _0x5f683e=this['editor']['model'],_0x2684ab=Array['from'](_0x5f683e['markers']['getMarkersGroup'](j))['map'](_0x3ded5f=>_0x3ded5f['getRange']());return _0x5f683e['createSelection'](_0x2684ab);}['_pasteHTMLUsingClipboard']({writer:_0x23887e,html:_0x477753,insertAt:_0x1da66e}){const {view:_0x7a296d}=this['editor']['editing'],_0x3e1505=this['editor']['plugins']['get'](_0x305769),_0xcfa017=new Un();_0xcfa017['setData']('text/html',_0x477753);const _0x5d9c0f=new ClipboardEvent('paste',{'clipboardData':_0xcfa017}),_0x4f5c54=new _0x50a248(_0x7a296d,_0x5d9c0f,{'dataTransfer':new _0xd9a4a2(_0xcfa017)});_0x23887e['setSelection'](_0x1da66e);const _0x77d3a2=(_0x31cde0,_0xdf81dc)=>{_0xdf81dc['resultRange']&&_0x23887e['setSelection'](_0xdf81dc['resultRange']);};_0x3e1505['once']('contentInsertion',_0x77d3a2,{'priority':'lowest'}),_0x7a296d['document']['fire']('paste',_0x4f5c54),_0x3e1505['off']('contentInsertion',_0x77d3a2);}['_getDefaultInsertBelowPosition'](_0x457905){const {model:_0x34892e}=this['editor'],_0x1a11b5=Array['from'](_0x457905['getSelectedBlocks']());return _0x1a11b5['length']?_0x34892e['createPositionAfter'](_0x1a11b5['pop']()):_0x457905['getLastPosition']();}['_prepareTableInsertBelowPosition'](_0x2fc286,_0x55b6e5){const {model:_0x3f800e,plugins:_0x59e720}=this['editor'];if(_0x59e720['has']('TableUtils')){const _0x4aa5e8=_0x59e720['get']('TableUtils')['getSelectedTableCells'](_0x55b6e5);if(_0x4aa5e8['length']){const _0xd21ada=this['_getTableRowCountFromContent'](_0x2fc286),_0x2def07=this['_createEmptyTableRows'](_0x4aa5e8,_0xd21ada);return _0x3f800e['createPositionAt'](_0x2def07,0x0);}}return null;}['_getTableRowCountFromContent'](_0x1b6bd2){const _0x5b8a78=this['editor']['plugins']['get']('TableUtils'),_0x23226b=this['editor']['data']['parse'](_0x1b6bd2),_0xd85388=Array['from'](_0x23226b['getChildren']())['filter'](_0x3c84f2=>_0x3c84f2['is']('element','table'));let _0x1ec325=0x0;return _0xd85388['forEach'](_0x3e9402=>{_0x1ec325+=_0x5b8a78['getRows'](_0x3e9402);}),_0x1ec325;}['_createEmptyTableRows'](_0x204e72,_0x3bbb20){const _0x5bece5=this['editor']['plugins']['get']('TableUtils'),_0x4ed6c5=_0x5bece5['getRowIndexes'](_0x204e72),_0x51269c=_0x5bece5['getColumnIndexes'](_0x204e72),_0x2a0199=_0x4ed6c5['last']+0x1,_0x1c121f=_0x51269c['first'],_0x1efc3a=_0x204e72[0x0]['findAncestor']('table');for(let _0xbab867=0x0;_0xbab867<_0x3bbb20;_0xbab867++)_0x5bece5['insertRows'](_0x1efc3a,{'at':_0x2a0199});return _0x1efc3a['getChild'](_0x2a0199)['getChild'](_0x1c121f);}['_resetContentOfSelectedTableCells'](_0x1069f8,_0x43aec6){const {plugins:_0x2b33a7}=this['editor'],{model:_0x25abab}=_0x1069f8;if(!_0x2b33a7['has']('TableUtils'))return;_0x2b33a7['get']('TableUtils')['getSelectedTableCells'](_0x43aec6)['length']&&_0x25abab['deleteContent'](_0x43aec6);}}class q extends _0x5167f5{static get['pluginName'](){return'AIAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['afterInit'](){if(!this['textAdapter'])throw new _0xa14e6e('aiadapter-text-adapter-not-set',null);}}class tr extends Error{constructor(_0x59de75){super(_0x59de75),this['name']='AIRequestError';}}function Vn(_0x988276,_0xe2a852,_0x5a7cc9){const t=_0x988276['t'];switch(_0xe2a852){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',_0x5a7cc9);case'Error\x20during\x20AI\x20content\x20generation:\x20%0':return t('Error\x20during\x20AI\x20content\x20generation:\x20%0',_0x5a7cc9);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'},_0x5a7cc9);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 _0xe2a852;}}class G extends Nt{['_commandDefinitions'];constructor(_0x1d9440,_0x28e877){super(_0x1d9440),this['_commandDefinitions']=_0x28e877,this['set']('enabledCommandsIds',[]),this['on']('change:_hasContext',(_0x1a5af6,_0x70826d,_0x1970ba)=>{this['isEnabled']&&(this['enabledCommandsIds']=ns(this['_commandDefinitions'],_0x1970ba));}),this['set']('_hasContext',!0x1),this['on']('change:isEnabled',(_0x590e4b,_0x24a37a,_0x56b173)=>{this['enabledCommandsIds']=_0x56b173?ns(this['_commandDefinitions'],this['_hasContext']):[];});}['refresh'](){const _0xbf2d6d=this['editor']['model'];this['_hasContext']=function(_0x3f1130){const _0x2fa0f9=_0x3f1130['document']['selection'];return _0x2fa0f9['isCollapsed']?0x0!==[..._0x2fa0f9['getSelectedBlocks']()]['length']&&![..._0x2fa0f9['getSelectedBlocks']()][0x0]['isEmpty']:!!_0x3f1130['hasContent'](_0x2fa0f9['getFirstRange']());}(_0xbf2d6d);const _0x3f4e29=_0xbf2d6d['document']['selection'],_0x127dbf=this['editor']['config']['get']('ai.assistant.disabledElements');for(const _0x1d1780 of _0x3f4e29['getRanges']())for(const _0x11fc03 of _0x1d1780['getItems']())if(_0x11fc03['is']('element')&&_0x127dbf['includes'](_0x11fc03['name']))return void(this['isEnabled']=!0x1);this['isEnabled']=!0x0;}['execute'](_0x4b26e6='',_0x59539d='',_0x2478d8='custom'){this['editor']['plugins']['get'](v)['showUI'](_0x4b26e6,_0x59539d,_0x2478d8);}}function ns(_0x1e7c43,_0x484966){const _0x10b9ca=new Set();for(const _0x132262 of _0x1e7c43['values']())(_0x484966||!0x1===_0x132262['requiresContent'])&&_0x10b9ca['add'](_0x132262['id']);return Array['from'](_0x10b9ca);}const hs=new RegExp(/^(.*?)<[a-zA-Z][a-zA-Z0-9_\-.]*[ >]/,'is');class z extends/* #__PURE__ -- @preserve */
|
|
24
|
-
_0x536028(){['editor'];['textAdapter'];['view'];['_sanitizationContainer'];['_domParser'];['_xmlSerializer'];constructor(_0x188377,_0xd73bd2,_0x15f365){super(),this['editor']=_0x188377,this['textAdapter']=_0xd73bd2,this['_sanitizationContainer']=document['createElement']('div'),this['_domParser']=new DOMParser(),this['_xmlSerializer']=new XMLSerializer(),this['view']=_0x15f365,this['set']({'initialContext':'','currentContext':'','currentResponse':'','previousContext':void 0x0,'previousQuery':void 0x0,'previousLabel':void 0x0,'isProcessing':!0x1}),this['on']('set:currentContext',(_0x3d36d1,_0x33c764,_0x222cb0)=>{this['view']['value']=this['_sanitizeHTML'](_0x222cb0);}),this['listenTo'](this['view'],'submitPrompt',(_0x2bdbe8,_0x598425)=>{const _0x4af7ab=this['currentContext']||this['initialContext'];this['_handleQuery'](_0x598425,_0x4af7ab,'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:_0x26c369,query:_0x52ae6b,htmlContent:_0x5a1873,label:_0x2c17f5,mainActionLabel:_0xbfa695}){this['view']['prompt']=_0x2c17f5,this['view']['mainAction']=_0xbfa695,this['initialContext']=_0x5a1873,_0x52ae6b&&(this['view']['isRendered']?this['_handleQuery'](_0x52ae6b,_0x5a1873,_0x26c369,_0x2c17f5):this['view']['once']('render',()=>{this['_handleQuery'](_0x52ae6b,_0x5a1873,_0x26c369,_0x2c17f5);}));}['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'](_0x506c7d,_0x2c49c2,_0x1633c6,_0x356037){return this['isProcessing']=!0x0,this['view']['startProcessing'](),this['previousContext']=_0x2c49c2,this['previousQuery']=_0x506c7d,this['previousLabel']=_0x356037||_0x506c7d,this['previousActionId']=_0x1633c6,new Promise(_0x331163=>{this['textAdapter']['makeRequest']({'query':_0x506c7d,'context':_0x2c49c2,'onData':_0x3513b3=>{this['currentResponse']=_0x3513b3,this['currentContext']=this['_parseAndNormalizeContent'](this['currentResponse']);},'actionId':_0x1633c6})['then'](()=>{!this['currentContext']&&this['currentResponse']&&(this['currentContext']=this['_parseAndNormalizeContent'](this['currentResponse'],!0x0));})['catch'](_0x2ff5bd=>{_0x2ff5bd instanceof tr?this['view']['handleError'](_0x2ff5bd['message']):this['view']['handleError'](),_0x331163();})['finally'](()=>{this['stopProcessing'](),_0x331163();});});}['_parseAndNormalizeContent'](_0x477c5a,_0x4915ff=!0x1){const _0x42c5bc=hs['exec'](_0x477c5a);_0x477c5a=_0x42c5bc?_0x477c5a['substring'](_0x42c5bc[0x1]['length']):_0x477c5a['length']<0x64&&!_0x4915ff?'':this['_stripMarkdownSyntax'](_0x477c5a);const _0x4edf67=this['_domParser']['parseFromString'](_0x477c5a,'text/html');if(_0x42c5bc){const _0x1bf481=Array['from'](_0x4edf67['body']['childNodes']);_0x1bf481['reverse']();for(const _0xc9338a of _0x1bf481){if(_0xc9338a['nodeType']==Node['ELEMENT_NODE'])break;_0xc9338a['remove']();}}const _0x2c9526=this['editor']['data']['processor']['toView'](this['_xmlSerializer']['serializeToString'](_0x4edf67['body']));this['_isH1TagSupportEnabled']()||this['_normalizeResponseHeadings'](_0x2c9526);const _0x4240b8=this['editor']['config']['get']('ai.assistant.preserveComments'),_0x8ed198=this['editor']['data']['toModel'](_0x2c9526);return _0x4240b8||_0x8ed198['markers']['clear'](),this['editor']['data']['stringify'](_0x8ed198);}['_normalizeResponseHeadings'](_0x309846){const _0x14a100=new _0x45ce4d(this['editor']['editing']['view']['document']),_0x3131c8=new _0x5d48c1({'name':/^h[1-5]$/}),_0x1746e8=[];let _0x10d57d=!0x1;for(const _0x39619d of _0x309846)_0x39619d['is']('element')&&_0x3131c8['match'](_0x39619d)&&(_0x1746e8['push'](_0x39619d),'h1'==_0x39619d['name']&&(_0x10d57d=!0x0));if(_0x10d57d){for(const _0x4ca22a of _0x1746e8)_0x14a100['rename']('h'+(parseInt(_0x4ca22a['name'][0x1])+0x1),_0x4ca22a);}}['_isH1TagSupportEnabled'](){const {data:_0x1ae86d,editing:_0x4038ac}=this['editor'],_0x5b89f5=_0x1ae86d['htmlProcessor']['toView']('<h1></h1>'),_0x3a3c4e=_0x1ae86d['toView'](_0x1ae86d['toModel'](_0x5b89f5));return!!_0x4038ac['view']['domConverter']['viewToDom'](_0x3a3c4e)['querySelector']('h1');}['_sanitizeHTML'](_0x19d3ce){return this['editor']['editing']['view']['domConverter']['setContentOf'](this['_sanitizationContainer'],_0x19d3ce),this['_sanitizationContainer']['innerHTML'];}['_stripMarkdownSyntax'](_0x10f15f){const _0x1c524a=_0x10f15f['trim']();return _0x1c524a['startsWith']('```html')?_0x1c524a['endsWith']('```')?_0x1c524a['substring'](0x7,_0x1c524a['length']-0x3):_0x1c524a['substring'](0x7):_0x10f15f;}}const F={'REPLACE':'replace','INSERT':'insert'};class wr extends _0x440716{constructor(_0x170c5d){super(_0x170c5d),this['set']('isVisible',!0x1),this['set']('mainAction',F['REPLACE']),this['replaceButton']=this['_createButton']('','ck-button-action'),this['replaceButton']['bind']('label')['to'](this,'mainAction',_0x4f5624=>Vn(_0x170c5d,'AI_'+_0x4f5624['toUpperCase']()+'_CONTENT')),this['insertButton']=this['_createButton'](Vn(_0x170c5d,'Insert\x20below')),this['tryAgainButton']=this['_createButton'](Vn(_0x170c5d,'Try\x20again')),this['stopButton']=this['_createButton'](Vn(_0x170c5d,'Stop'));const _0x496d57=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':['ck-ai-form__toolbar',_0x496d57['if']('isVisible','ck-hidden',_0x12cd3d=>!_0x12cd3d)]}}),this['items']['addMany']([this['replaceButton'],this['insertButton'],this['tryAgainButton'],this['stopButton']]);}['_createButton'](_0x1bb41d,_0x1973ca){const _0x1bac2b=new _0xa24b3c(this['locale']);return _0x1bac2b['set']({'label':_0x1bb41d,'class':_0x1973ca||'','isVisible':!0x0,'withText':!0x0}),_0x1bac2b;}}class yr extends _0xebef92{['contentFieldView'];['copyButtonView'];constructor(_0x22aac9,_0xb6e47c=''){super(_0x22aac9),this['set']({'value':null,'isVisible':!0x1,'isProcessing':!0x1});const _0x5f532b=this['bindTemplate'];this['contentFieldView']=new Gn(_0x22aac9,_0xb6e47c),this['copyButtonView']=this['_createCopyButton'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area-wrapper',_0x5f532b['if']('isVisible','ck-hidden',_0x5af500=>!_0x5af500)],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area',_0x5f532b['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 _0x1029e2=!0x1;this['on']('change:value',(_0xf3653d,_0x33667e,_0x29ef12)=>{const _0xc8a26=!this['contentFieldView']['element']['querySelector']('.ck-ai-form__loader');this['contentFieldView']['setContent'](_0x29ef12),this['isProcessing']&&_0xc8a26&&!_0x1029e2&&this['element']['scrollTo']({'top':this['element']['scrollHeight'],'behavior':'smooth'});}),this['on']('change:isProcessing',(_0x1f9d1a,_0x385007,_0xbd9ae5)=>{_0x1029e2=!0x1,_0xbd9ae5?(this['value']=null,this['contentFieldView']['appendLoader']()):this['value']||this['contentFieldView']['setContent']('');}),this['listenTo'](this['element'],'wheel',()=>{_0x1029e2=!0x0;}),this['listenTo'](this['element'],'mousedown',()=>{_0x1029e2=!0x0;});}['focus'](){this['element']['focus']();}['_createCopyButton'](){const _0x4b483f=this['locale'],_0x6862d2=new _0xa24b3c(this['locale']),_0xcd3b85='ck-ai-form__copy-button';return _0x6862d2['set']({'label':Vn(_0x4b483f,'Copy'),'icon':_0x5c22c5,'class':_0xcd3b85,'tooltip':!0x0}),_0x6862d2['bind']('isVisible')['to'](this,'value',_0x2e6529=>!!_0x2e6529),_0x6862d2['bind']('isEnabled')['to'](this,'isProcessing',_0x9ea038=>!_0x9ea038),_0x6862d2['on']('execute',()=>{this['_copyHTMLToClipboard'](this['contentFieldView']['element']),_0x6862d2['icon']=_0x51abb4,_0x6862d2['class']=_0xcd3b85+'\x20ck-ai-form__copy-button--copied',this['focus'](),setTimeout(()=>{_0x6862d2['icon']=_0x5c22c5,_0x6862d2['class']=_0xcd3b85;},0x3e8);}),_0x6862d2;}['_copyHTMLToClipboard'](_0x2af38a){const {window:_0x19d71b,document:_0xfa9337}=_0x3c96fa;if(_0x19d71b['ClipboardItem']){const {Blob:_0x203410,ClipboardItem:_0x139672}=_0x19d71b,_0x3a5e69=[new _0x139672({'text/html':new _0x203410([_0x2af38a['innerHTML']],{'type':'text/html'}),'text/plain':new _0x203410([_0x2af38a['textContent']||''],{'type':'text/plain'})})];navigator['clipboard']['write'](_0x3a5e69);}else{const _0x2ae7de=_0xfa9337['createElement']('div');_0x2ae7de['style']['position']='absolute',_0x2ae7de['style']['left']='-9999px',_0x2ae7de['innerHTML']='<span>[</span>'+_0x2af38a['innerHTML']+'<span>]</span>',_0xfa9337['body']['appendChild'](_0x2ae7de);const _0x182bb1=_0xfa9337['createRange']();_0x182bb1['setStartAfter'](_0x2ae7de['firstElementChild']),_0x182bb1['setEndBefore'](_0x2ae7de['lastElementChild']);const _0x3b870f=_0x19d71b['getSelection']();_0x3b870f['removeAllRanges'](),_0x3b870f['addRange'](_0x182bb1),_0xfa9337['execCommand']('copy'),_0x2ae7de['remove']();}}}class Gn extends _0xebef92{constructor(_0x15ca55,_0x305d87=''){super(_0x15ca55),this['loaderView']=this['_createLoader'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-content',_0x305d87,'ck-reset_all-excluded','ck-ai-form__content-field']}});}['setContent'](_0x3a5cb2){this['element']['innerHTML']=_0x3a5cb2;}['appendLoader'](){this['element']['appendChild'](this['loaderView']['element']);}['_createLoader'](){const _0x511b72=new _0xebef92(),_0x47dfaa=this['locale'],_0x94737d=new _0x5a1254();return _0x94737d['isVisible']=!0x0,_0x511b72['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__loader']},'children':[_0x94737d,{'text':Vn(_0x47dfaa,'AI\x20is\x20writing...')}]}),_0x511b72['render'](),_0x511b72;}}class gr extends _0xebef92{constructor(_0x50d774,_0x41d470=''){super(_0x50d774);const _0x509dd2=new _0x23cd9a(),_0x5d875c=this['bindTemplate'];this['set']('text',_0x41d470),_0x509dd2['content']=_0x333771,this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__error']},'children':[_0x509dd2,{'text':_0x5d875c['to']('text')}]});}}class Er extends _0x103d7a{['submitButtonView'];['showHistoryButtonView'];constructor(_0x46d95f,_0xdc59be){super(_0x46d95f,_0xdc59be),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',(_0x56296f,_0x3cb70d)=>{_0x56296f['target']==this['queryView']['fieldView']['element']&&(this['submit'](),_0x3cb70d());});}['_createSubmitButton'](){const _0x1358b4=new _0xa24b3c(this['locale']),_0x5b758c=this['locale'];return _0x1358b4['set']({'icon':_0x3720ea,'label':Vn(_0x5b758c,'Submit'),'isVisible':!0x0,'tooltip':!0x0,'class':'ck-ai-form__submit'}),_0x1358b4['on']('execute',()=>{this['submit']();}),_0x1358b4['bind']('isEnabled')['to'](this['queryView']['fieldView'],'isEmpty',this,'isEnabled',(_0x3f8661,_0x3b311e)=>!_0x3f8661&&_0x3b311e),_0x1358b4;}['_createShowHistoryButton'](){const _0x27f4f7=new _0xa24b3c(this['locale']),_0x4c9668=this['resultsView'],_0x13971a=this['locale'];_0x27f4f7['set']({'label':Vn(_0x13971a,'History'),'withText':!0x1,'icon':Ht,'tooltip':!0x0,'tooltipPosition':'sw','class':'ck-ai-form__toggle-history'}),_0x27f4f7['bind']('isOn')['to'](_0x4c9668,'isVisible'),_0x27f4f7['bind']('isEnabled')['to'](this,'isEnabled'),_0x27f4f7['on']('execute',()=>{_0x4c9668['isVisible']=!_0x4c9668['isVisible'],_0x4c9668['isVisible']?this['filteredView']['focus']():this['focus']();});const _0xd2aca3=()=>{_0x3c96fa['window']['requestAnimationFrame'](()=>{if(_0x4f30a4(this['element'])){const _0x5681ee=new _0x317c72(this['queryView']['fieldView']['element']),_0x5b7cbd=_0x5681ee['width'],_0x3e81b7='rtl'===_0x13971a['uiLanguageDirection']?'left':'right';_0x5681ee['excludeScrollbarsAndBorders'](),_0x27f4f7['element']['style'][_0x3e81b7]=_0x5b7cbd-_0x5681ee['width']+0x1+'px';}});};return this['queryView']['fieldView']['on']('update',_0xd2aca3),this['on']('render',_0xd2aca3),_0x27f4f7;}['submit'](){const _0x6f91c0=this['queryView']['fieldView']['element']['value'];this['fire']('submit',_0x6f91c0);}['focus'](_0x551972){-0x1===_0x551972?this['focusCycler']['focusLast']():this['focusCycler']['focusFirst']();}}class vr extends _0x3dc816{['historyGroupView'];['clearHistoryButton'];constructor(_0x5a915b){super(_0x5a915b),this['clearHistoryButton']=this['_createClearHistoryButton'](),this['historyGroupView']=new _0x4d5bae(),this['historyGroupView']['children']['add'](this['clearHistoryButton'],0x1),this['historyGroupView']['label']=Vn(_0x5a915b,'Prompt\x20history'),this['historyGroupView']['items']['delegate']('execute')['to'](this),this['items']['add'](this['historyGroupView']);}['filter'](){let _0x39fb0b=0x0;for(const _0x2f2c87 of this['items'])_0x39fb0b+=_0x2f2c87['items']['length'];return{'resultsCount':_0x39fb0b,'totalItemsCount':_0x39fb0b};}['_createClearHistoryButton'](){const _0x593489=this['locale'],_0x251847=new _0xa24b3c(this['locale']);return _0x251847['set']({'label':'('+Vn(_0x593489,'Clear')+')','withText':!0x0}),_0x251847['on']('execute',()=>this['fire']('clearHistory')),_0x251847;}}class Ar extends _0x22bc08{constructor(_0x1f752f){super();const _0x3e8442=new _0x5babd6(),_0x406abc=new _0xa24b3c(this['locale'],_0x3e8442);this['children']['add'](_0x406abc),_0x406abc['set']({'label':_0x1f752f['prompt'],'withText':!0x0}),_0x406abc['on']('execute',()=>{this['fire']('execute',{'value':_0x4747cb(_0x1f752f['prompt'])});});}}const no='CKEditor/AIFormView/PromptHistory';class Pr extends _0x6ba718{constructor(){super(),this['_loadFromSessionStorage'](),this['on']('add',(_0x531843,_0x28bd8c)=>{const _0x5e6eea=co(_0x28bd8c['prompt']);for(const _0x57f30f of this)if(_0x57f30f!=_0x28bd8c&&co(_0x57f30f['prompt'])===_0x5e6eea){this['remove'](_0x57f30f);break;}this['length']>0x14&&this['remove'](this['last']),this['_saveToSessionStorage']();}),this['on']('remove',()=>{this['_saveToSessionStorage']();});}['_loadFromSessionStorage'](){const _0x48c5bd=sessionStorage['getItem'](no)||'[]';this['addMany'](JSON['parse'](_0x48c5bd));}['_saveToSessionStorage'](){sessionStorage['setItem'](no,JSON['stringify'](this['map'](_0xba06c9=>_0xba06c9)));}}function co(_0x3f9409){return _0x3f9409['toLowerCase']()['trim']();}class R extends _0xebef92{['focusTracker'];['keystrokes'];['contentArea'];['toolbar'];['promptView'];['errorView'];['_focusables'];['focusCycler'];['_promptHistory'];constructor(_0x425fbf,_0x52d08e,_0x35b581=''){super(_0x425fbf),this['set']('isEnabled',!0x0),this['set']('isProcessing',!0x1),this['set']('prompt',''),this['set']('value',''),this['set']('isError',!0x1),this['set']('mainAction',F['REPLACE']),this['_promptHistory']=new Pr(),this['errorView']=new gr(_0x425fbf),this['contentArea']=new yr(_0x425fbf,_0x35b581),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 _0x13c01a(),this['keystrokes']=new _0x3c58a3(),this['_focusables']=this['createCollection']([this['contentArea'],this['contentArea']['copyButtonView'],this['toolbar'],this['promptView']]),this['focusCycler']=new _0x532b63({'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 _0x360d4a=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form',_0x52d08e],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-form-content']},'children':[{'tag':'div','attributes':{'class':[_0x360d4a['if']('isError','ck-hidden',_0x2156e1=>!_0x2156e1)]},'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'](_0x1c5ab8=0x1){-0x1===_0x1c5ab8?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 _0x4bab59=this['locale'],_0x5f47e1=new Er(_0x4bab59,{'queryView':{'label':Vn(_0x4bab59,'Ask\x20AI\x20to\x20edit\x20or\x20generate'),'creator':_0x3d9c16,'showIcon':!0x1,'showResetButton':!0x1},'infoView':{'text':{'noSearchableItems':{'primary':Vn(_0x4bab59,'Empty\x20history'),'secondary':Vn(_0x4bab59,'Ask\x20AI\x20and\x20your\x20prompts\x20will\x20be\x20listed\x20here\x20for\x20you\x20to\x20use\x20later.')}}},'filteredView':this['_createHistoryView'](),'queryMinChars':0x1/0x0,'resetOnBlur':!0x1});return _0x5f47e1['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',(_0x45b3a5,_0x5625ca)=>_0x45b3a5&&!_0x5625ca),this['listenTo'](_0x5f47e1,'submit',(_0x5727f1,_0x5f06aa)=>{this['prompt']=_0x5f06aa;const _0x38f454=_0x5453ce(_0x5f06aa);this['fire']('submitPrompt',_0x38f454),_0x5f06aa['trim']()&&this['_promptHistory']['add']({'prompt':_0x38f454},0x0);},{'priority':'high'}),_0x5f47e1;}['_createHistoryView'](){const _0xc81b97=new vr(this['locale']);return _0xc81b97['historyGroupView']['items']['bindTo'](this['_promptHistory'])['as'](Ar),_0xc81b97['on']('clearHistory',()=>{this['_promptHistory']['clear'](),this['promptView']['search'](''),this['promptView']['focus']();}),_0xc81b97;}['_createToolbar'](){const _0x1edae0=new wr(this['locale']);return _0x1edae0['replaceButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',this,'value',(_0x3d28d4,_0x25eaa5,_0x590d86)=>_0x3d28d4&&!_0x25eaa5&&!!_0x590d86),_0x1edae0['replaceButton']['delegate']('execute')['to'](this,'replaceContent'),_0x1edae0['insertButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',this,'value',(_0x4c59c6,_0x12e3dc,_0x1dd9af)=>_0x4c59c6&&!_0x12e3dc&&!!_0x1dd9af),_0x1edae0['insertButton']['delegate']('execute')['to'](this,'insertContentBelow'),_0x1edae0['tryAgainButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',(_0x2a3366,_0x5bd0cf)=>_0x2a3366&&!_0x5bd0cf),_0x1edae0['tryAgainButton']['delegate']('execute')['to'](this,'tryAgainEvent'),_0x1edae0['stopButton']['bind']('isEnabled')['to'](this,'isProcessing'),_0x1edae0['stopButton']['delegate']('execute')['to'](this,'stopProcessing'),_0x1edae0;}['startProcessing'](){this['value']='',this['isError']=!0x1,this['isProcessing']=!0x0,this['contentArea']['isVisible']=!0x0,this['toolbar']['isVisible']=!0x0,this['contentArea']['focus']();}['finishProcessing'](){const _0x119bff=this['locale'];this['isProcessing']=!0x1,this['prompt']='',this['promptView']['reset'](),this['value']&&(this['promptView']['queryView']['label']=Vn(_0x119bff,'Ask\x20AI\x20to\x20improve\x20generated\x20text'));}['handleError'](_0x54eff9){const _0x179d61=this['locale'];this['finishProcessing'](),this['isError']=!0x0,this['errorView']['text']=_0x54eff9||Vn(_0x179d61,'AI_ERROR_FAILED'),this['value']||(this['contentArea']['isVisible']=!0x1);}}const O=globalThis['DataTransfer'];class v extends _0x5167f5{['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[_0x5023f9,I,q,_0x83bc2d];}constructor(_0x5e7cf8){super(_0x5e7cf8),_0x5e7cf8['config']['define']('ai.assistant.disabledElements',['media','rawHtml','tableOfContents']),_0x5e7cf8['config']['define']('ai.assistant.contentAreaCssClass',''),_0x5e7cf8['config']['define']('ai.assistant.useTheme',!0x0),this['_uiCssClasses']='ck-ai-assistant-ui'+(_0x5e7cf8['config']['get']('ai.assistant.useTheme')?'\x20ck-ai-assistant-ui_theme':'');}['init'](){const {editor:_0x39543d}=this;this['_aiAdapter']=_0x39543d['plugins']['get'](q),this['_dialog']=_0x39543d['plugins']['get'](_0x83bc2d),this['_formView']=null,this['_commandDefinitions']=this['_getResolvedCommandsDefinitions']();const _0x326803=new G(_0x39543d,Array['from'](this['_commandDefinitions']['values']()));_0x39543d['commands']['add']('showAIAssistant',_0x326803),_0x39543d['ui']['componentFactory']['add']('aiCommands',_0x23ea5f=>{const _0x247e1f=_0x115dce(_0x23ea5f);return _0x247e1f['set']({'class':'ck-ai-commands-dropdown\x20'+this['_uiCssClasses']}),_0x247e1f['buttonView']['set']({'label':Vn(_0x23ea5f,'AI\x20Commands'),'icon':_0x51694e,'tooltip':!0x0}),_0x247e1f['on']('execute',_0x4fdd5d=>this['_onExecute'](_0x4fdd5d['source']['id'])),_0x38ea29(_0x247e1f,_0x39543d['ui']['view']['body'],function(_0x4647df){const _0x39463f=S(_0x4647df['config']['get']('ai.assistant.commands'),_0x4647df['locale']),_0x109530=W(_0x4647df,_0x39463f)['filter'](_0x165d05=>_0x165d05['commands']['length']);if(0x1===_0x109530['length'])return W(_0x4647df,_0x109530[0x0]['commands'])['map'](_0x4088e4=>({'id':_0x4088e4['id'],'label':_0x4088e4['label']}));return _0x109530['map'](_0x3b27d9=>{const {groupId:_0x1359f9,groupLabel:_0x2d38af,commands:_0x5358ea}=_0x3b27d9,_0x3f4916=W(_0x4647df,_0x5358ea)['map'](_0x18f54c=>({'id':_0x18f54c['id'],'label':_0x18f54c['label']}));return{'id':_0x1359f9,'menu':_0x2d38af||_0x1359f9,'children':_0x3f4916};});}(_0x39543d),{'ariaLabel':Vn(_0x23ea5f,'AI\x20Commands')}),_0x247e1f['menuView']['menuPanelClass']='ck-ai-commands-dropdown\x20'+this['_uiCssClasses'],_0x326803['on']('change:enabledCommandsIds',_0x105c49),_0x247e1f['menuView']['once']('render',_0x105c49),_0x247e1f;function _0x105c49(){_0x247e1f['isEnabled']=_0x326803['enabledCommandsIds']['length']>0x0;for(const _0x4ea743 of _0x247e1f['menuView']['buttons'])_0x4ea743['isEnabled']=_0x326803['enabledCommandsIds']['includes'](_0x4ea743['id']);}}),_0x39543d['ui']['componentFactory']['add']('menuBar:aiCommands',_0x2d2f01=>{const _0x43bdd9=new _0x48a6ad(_0x2d2f01);_0x43bdd9['buttonView']['set']({'label':Vn(_0x2d2f01,'AI\x20Commands'),'icon':_0x51694e}),_0x43bdd9['bind']('isEnabled')['to'](_0x326803,'enabledCommandsIds',_0x245cfb=>_0x245cfb['length']>0x0);const _0x24c088=S(_0x39543d['config']['get']('ai.assistant.commands'),_0x2d2f01);return this['_populateMenuBarMenu'](_0x326803,_0x43bdd9,_0x24c088,_0x1c6b29=>this['_onExecute'](_0x1c6b29)),_0x43bdd9;}),_0x39543d['ui']['componentFactory']['add']('aiAssistant',()=>{const _0x28c5fb=this['_createAIAssistantUIButton'](_0xa24b3c);return _0x28c5fb['set']({'tooltip':!0x0,'class':'ck-ai-assistant-button\x20'+this['_uiCssClasses']}),_0x28c5fb;}),_0x39543d['ui']['componentFactory']['add']('menuBar:aiAssistant',()=>{const _0x328348=this['_createAIAssistantUIButton'](_0x20e330);return _0x328348['set']({'role':'menuitemcheckbox'}),_0x328348;}),this['licenseKey']=this['editor']['config']['get']('licenseKey');const _0x517770=this['editor'];this['_licenseKeyCheckInterval']=setInterval(()=>{let _0x543207;for(const _0x504f9e in _0x517770){const _0x19b5a6=_0x504f9e,_0x18d229=_0x517770[_0x19b5a6];if('aiLicenseKeyValid'==_0x18d229||'aiLicenseKeyInvalid'==_0x18d229||'aiLicenseKeyExpired'==_0x18d229||'aiLicenseKeyDomainLimit'==_0x18d229||'aiLicenseKeyNotAllowed'==_0x18d229||'aiLicenseKeyEvaluationLimit'==_0x18d229||'aiLicenseKeyTrialLimit'==_0x18d229||'aiLicenseKeyUsageLimit'==_0x18d229){delete _0x517770[_0x19b5a6],_0x543207=_0x18d229,clearInterval(this['_licenseKeyCheckInterval']),this['_licenseKeyCheckInterval']=void 0x0;break;}}'aiLicenseKeyInvalid'==_0x543207&&_0x517770['_showLicenseError']('invalid'),'aiLicenseKeyExpired'==_0x543207&&_0x517770['_showLicenseError']('expired'),'aiLicenseKeyDomainLimit'==_0x543207&&_0x517770['_showLicenseError']('domainLimit'),'aiLicenseKeyNotAllowed'==_0x543207&&_0x517770['_showLicenseError']('featureNotAllowed','AIAssistant'),'aiLicenseKeyEvaluationLimit'==_0x543207&&_0x517770['_showLicenseError']('evaluationLimit'),'aiLicenseKeyTrialLimit'==_0x543207&&_0x517770['_showLicenseError']('trialLimit'),'aiLicenseKeyUsageLimit'==_0x543207&&_0x517770['_showLicenseError']('usageLimit');},0x3e8);}['destroy'](){super['destroy'](),this['_licenseKeyCheckInterval']&&clearInterval(this['_licenseKeyCheckInterval']);}['showUI'](_0x56ee1c='',_0x4c6a74='',_0x39f21a='custom'){const _0x3d3e82=this['editor'],_0x56ac0b=_0x3d3e82['editing']['view'],_0x1a766f=_0x3d3e82['plugins']['get'](I),_0x485b05=_0x3d3e82['plugins']['get'](_0x5023f9);_0x1a766f['showFakeVisualSelection']();const _0x1b437c=new O(),_0x2d292a=new ClipboardEvent('copy',{'clipboardData':_0x1b437c}),_0x1ed029=new _0xd9a4a2(_0x1b437c),_0x10a1e5=new _0x50a248(_0x56ac0b,_0x2d292a,{'dataTransfer':_0x1ed029});_0x485b05['_forceMarkersCopy']('comment',()=>{_0x56ac0b['document']['fire']('copy',_0x10a1e5);}),this['_formView']||(this['_initView'](),this['_aiAssistantController']=new z(_0x3d3e82,this['_aiAdapter']['textAdapter'],this['_formView']));let _0x1c0108=_0x1ed029['getData']('text/html');const _0x364f47=_0x3d3e82['model']['document']['selection'],_0x1abc52=Array['from'](_0x364f47['getRanges']());0x1===_0x1abc52['length']&&_0x1abc52[0x0]['isFlat']&&!_0x364f47['getSelectedElement']()&&''!==_0x1c0108['replace'](/ /g,'')['trim']()&&(_0x1c0108='<p>'+_0x1c0108+'</p>'),this['_aiAssistantController']['updateView']({'actionId':_0x39f21a,'query':_0x56ee1c,'htmlContent':_0x1c0108,'label':_0x4c6a74,'mainActionLabel':F[_0x3d3e82['model']['document']['selection']['isCollapsed']?'INSERT':'REPLACE']}),'aiAssistant'!==this['_dialog']['id']?this['_dialog']['show']({'id':'aiAssistant','icon':_0x34d34b,'title':Vn(this['editor']['locale'],'AI\x20Assistant'),'content':this['_formView'],'position':_0x48055e['EDITOR_TOP_SIDE'],'onShow':()=>{this['_formView']['focus']();},'onHide':()=>{this['_aiAssistantController']['reset'](),_0x1a766f['hideFakeVisualSelection']();}}):this['_dialog']['view']['wasMoved']||this['_dialog']['view']['updatePosition']();}['hideUI'](){this['_dialog']['hide']();}['_getResolvedCommandsDefinitions'](){const _0x49fac3=new Map(),_0x1d2801=S(this['editor']['config']['get']('ai.assistant.commands'),this['editor']['locale']);for(const _0x24fd6d of _0x1d2801)for(const _0xb08669 of _0x24fd6d['commands'])_0x49fac3['set'](_0xb08669['id'],{..._0xb08669,'groupId':_0x24fd6d['groupId'],'groupLabel':_0x24fd6d['groupLabel']||_0x24fd6d['groupId']});return _0x49fac3;}['_createAIAssistantUIButton'](_0x39dc3f){const _0x37b65e=this['editor'],_0x8191da=_0x37b65e['commands']['get']('showAIAssistant'),_0x2f2b1f=new _0x39dc3f(_0x37b65e['locale']);return _0x2f2b1f['set']({'label':Vn(_0x37b65e['locale'],'AI\x20Assistant'),'icon':_0x34d34b,'isToggleable':!0x0}),_0x2f2b1f['bind']('isEnabled')['to'](_0x8191da),_0x2f2b1f['bind']('isOn')['to'](this['_dialog'],'id',_0x4a944d=>'aiAssistant'===_0x4a944d),this['listenTo'](_0x2f2b1f,'execute',()=>{_0x2f2b1f['isOn']?this['hideUI']():_0x8191da['execute']();}),_0x2f2b1f;}['_initView'](){const _0x20cded=this['editor']['plugins']['get'](I);this['_formView']=new R(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',()=>{_0x20cded['insertContent'](this['_aiAssistantController']['currentContext']),this['hideUI']();}),this['listenTo'](this['_formView'],'insertContentBelow',()=>{_0x20cded['insertContentBelow'](this['_aiAssistantController']['currentContext']),this['hideUI']();}),this['_initAriaAiStatusChangeAnnouncements']();}['_initAriaAiStatusChangeAnnouncements'](){const {locale:_0x1e64e9,ui:{ariaLiveAnnouncer:_0x2e0c66}}=this['editor'];this['_formView']['contentArea']['on']('change:isProcessing',(_0x14cb3b,_0x2e00e0,_0x25e709)=>{const _0x202fee=this['_aiAssistantController']['currentContext'];_0x25e709?_0x2e0c66['announce'](Vn(_0x1e64e9,'AI\x20is\x20writing')):_0x202fee&&_0x2e0c66['announce'](Vn(_0x1e64e9,'Generated\x20content:\x20%0',_0x202fee),{'politeness':'polite','isUnsafeHTML':!0x0});}),this['_formView']['on']('change:isError',(_0x415a72,_0x510bba,_0x8b1844)=>{if(_0x8b1844){const _0x3b32f8=this['_formView']['errorView']['text'];_0x2e0c66['announce'](Vn(_0x1e64e9,'Error\x20during\x20AI\x20content\x20generation:\x20%0',_0x3b32f8));}});}['_onExecute'](_0x485452){const _0xc79ed=this['_commandDefinitions']['get'](_0x485452),_0x2b1f91=this['editor'],_0x4caf09=_0x2b1f91['model']['document']['selection'],_0xbfdd40=_0x2b1f91['commands']['get']('showAIAssistant'),_0xee7ad6=_0x2b1f91['plugins']['get'](I),_0x55aeff=''+(_0xc79ed['groupId']!==H?_0xc79ed['groupLabel']+':\x20':'')+_0xc79ed['label'];if(!0x1!==_0xc79ed['requiresContent']&&_0x4caf09['isCollapsed']){const _0x5c3d32=_0x4cdc37(_0x4caf09['getSelectedBlocks']())||_0x2b1f91['model']['schema']['getLimitElement'](_0x4caf09);_0x2b1f91['model']['change'](_0x11ce70=>{_0x11ce70['setSelection'](_0x5c3d32,'in');});}_0xee7ad6['showFakeVisualSelection'](),_0xbfdd40['execute'](_0xc79ed['prompt'],_0x55aeff,'command:'+_0x485452);}['_populateMenuBarMenu'](_0x54e244,_0x5e85c0,_0x1ab01,_0x15a31d){const _0x48242a=this['editor'],_0x486398=_0x48242a['locale'],_0x55463e=new _0x165f8d(_0x486398),_0x1362e4=W(_0x48242a,_0x1ab01)['filter'](_0x1e896f=>_0x1e896f['commands']['length']);0x1===_0x1362e4['length']?this['_getMenuBarGroupButtons']({'command':_0x54e244,'commands':_0x1362e4[0x0]['commands'],'parentMenuView':_0x5e85c0,'onExecute':_0x15a31d})['forEach'](_0x342439=>_0x55463e['items']['add'](_0x342439)):_0x1362e4['forEach'](({groupId:_0x5ae12f,groupLabel:_0x35373b,commands:_0x5b3877})=>{const _0x2eeac7=new _0x5c0d95(_0x486398,_0x5e85c0),_0x5788a7=new _0x48a6ad(_0x486398),_0x1e7f88=new _0x165f8d(_0x486398),_0xdcd62a=this['_getMenuBarGroupButtons']({'command':_0x54e244,'commands':_0x5b3877,'parentMenuView':_0x5788a7,'onExecute':_0x15a31d});_0x5788a7['buttonView']['set']({'label':_0x35373b||_0x5ae12f}),_0x5788a7['delegate']('execute')['to'](_0x5e85c0),_0x1e7f88['items']['addMany'](_0xdcd62a),_0x5788a7['panelView']['children']['add'](_0x1e7f88),_0x2eeac7['children']['add'](_0x5788a7),_0x55463e['items']['add'](_0x2eeac7);}),_0x5e85c0['panelView']['children']['add'](_0x55463e);}['_getMenuBarGroupButtons']({command:_0x455a96,commands:_0x74f110,parentMenuView:_0x23c254,onExecute:_0x4e0ecb}){const _0x20abf7=this['editor'],_0x54c351=_0x20abf7['locale'];return W(_0x20abf7,_0x74f110)['map'](_0x4ab874=>{const _0x1805c1=new _0x5c0d95(_0x54c351,_0x23c254),_0x1edd22=new _0x20e330(_0x54c351);return _0x1edd22['set']({'label':_0x4ab874['label']}),_0x1edd22['delegate']('execute')['to'](_0x23c254),_0x1edd22['on']('execute',()=>_0x4e0ecb(_0x4ab874['id'])),_0x1edd22['bind']('isEnabled')['to'](_0x455a96,'enabledCommandsIds',_0x5837b0=>_0x5837b0['includes'](_0x4ab874['id'])),_0x1805c1['children']['add'](_0x1edd22),_0x1805c1;});}}function Q(_0x5854f9,_0x47d6bb){return void 0x0!==_0x5854f9['order']&&void 0x0===_0x47d6bb['order']?0x1:void 0x0===_0x5854f9['order']&&void 0x0!==_0x47d6bb['order']?-0x1:void 0x0!==_0x5854f9['order']&&void 0x0!==_0x47d6bb['order']?_0x5854f9['order']-_0x47d6bb['order']:0x0;}function W(_0x122659,_0x31c19a){_0x31c19a['sort'](Q);const _0x53c0ed={},_0xb08665=[];for(const _0xdcbd23 of _0x31c19a)if(void 0x0!==_0xdcbd23['order']){if(_0xdcbd23['order']in _0x53c0ed)throw new _0xa14e6e('ai-commands-config-order-collision',_0x122659,{'conflictingDefinitions':[_0xdcbd23,_0x53c0ed[_0xdcbd23['order']]]});_0x53c0ed[_0xdcbd23['order']]=_0xdcbd23,_0xb08665['splice'](_0xdcbd23['order'],0x0,_0xdcbd23);}else _0xb08665['push'](_0xdcbd23);return _0xb08665;}class Bn extends _0x5167f5{static get['requires'](){return[v,I];}static get['pluginName'](){return'AIAssistant';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x3900ad){super(_0x3900ad);const _0x43dbb9=_0x3900ad['config'],_0xf3b3f1=_0x3900ad['locale'];_0x43dbb9['define']('ai.assistant.preserveComments',!0x0),_0x43dbb9['define']('ai.assistant.commands',Kn(_0xf3b3f1)),_0x43dbb9['define']('ai.assistant.extraCommandGroups',[]),_0x43dbb9['define']('ai.assistant.removeCommands',[]);let _0xfe03e9=S(_0x43dbb9['get']('ai.assistant.commands'),_0xf3b3f1);const _0x4e8c64=_0x43dbb9['get']('ai.assistant.extraCommandGroups'),_0x46a242=_0x43dbb9['get']('ai.assistant.removeCommands');_0x4e8c64['forEach'](_0x5e3eb8=>{const _0x334b37=_0xfe03e9['find'](_0x468677=>_0x468677['groupId']===_0x5e3eb8['groupId']);_0x334b37?_0x334b37['commands']=_0x334b37['commands']['concat'](_0x5e3eb8['commands']):_0xfe03e9['push'](_0x5e3eb8);}),_0xfe03e9=_0xfe03e9['filter'](_0xcd310b=>!_0x46a242['includes'](_0xcd310b['groupId'])),_0xfe03e9['forEach'](_0xb23b7f=>{_0xb23b7f['commands']=_0xb23b7f['commands']['filter'](_0x4b0899=>!_0x46a242['includes'](_0x4b0899['id']));}),_0x43dbb9['set']('ai.assistant.commands',_0xfe03e9);}}function Kn(_0x2c088c){return[{'groupId':'editOrReview','groupLabel':Vn(_0x2c088c,'Edit\x20or\x20review'),'commands':[{'id':'improveWriting','label':Vn(_0x2c088c,'Improve\x20writing'),'prompt':'Fix\x20spelling\x20mistakes,\x20use\x20proper\x20grammar\x20and\x20apply\x20good\x20writing\x20practices.\x20Do\x20not\x20lose\x20the\x20original\x20meaning.'},{'id':'makeShorter','label':Vn(_0x2c088c,'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':Vn(_0x2c088c,'Make\x20longer'),'prompt':'Improve\x20this\x20content\x20by\x20using\x20descriptive\x20language\x20and\x20inserting\x20more\x20information\x20and\x20more\x20detailed\x20explanations.'},{'id':'simplifyLanguage','label':Vn(_0x2c088c,'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':Vn(_0x2c088c,'Generate\x20from\x20selection'),'commands':[{'id':'summarize','label':Vn(_0x2c088c,'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':Vn(_0x2c088c,'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':Vn(_0x2c088c,'Change\x20tone'),'commands':[{'id':'professional','label':Vn(_0x2c088c,'Professional'),'prompt':'Improve\x20using\x20polished,\x20formal,\x20and\x20respectful\x20language\x20to\x20convey\x20professional\x20expertise\x20and\x20competence.'},{'id':'casual','label':Vn(_0x2c088c,'Casual'),'prompt':'Improve\x20using\x20casual,\x20informal\x20language\x20to\x20convey\x20a\x20casual\x20conversation\x20with\x20a\x20real\x20person.'},{'id':'direct','label':Vn(_0x2c088c,'Direct'),'prompt':'Improve\x20using\x20direct\x20language,\x20using\x20only\x20the\x20essential\x20information.'},{'id':'confident','label':Vn(_0x2c088c,'Confident'),'prompt':'Improve\x20using\x20compelling,\x20optimistic\x20language\x20to\x20convey\x20confidence\x20in\x20the\x20writing.'},{'id':'friendly','label':Vn(_0x2c088c,'Friendly'),'prompt':'Improve\x20using\x20friendly,\x20comforting\x20language,\x20to\x20convey\x20understanding\x20and\x20empathy.'}]},{'groupId':'changeStyle','groupLabel':Vn(_0x2c088c,'Change\x20style'),'commands':[{'id':'business','label':Vn(_0x2c088c,'Business'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20business\x20professional\x20with\x20formal\x20language.'},{'id':'legal','label':Vn(_0x2c088c,'Legal'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20legal\x20professional\x20using\x20valid\x20legal\x20terminology.'},{'id':'journalism','label':Vn(_0x2c088c,'Journalism'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20journalist\x20using\x20engaging\x20language\x20to\x20convey\x20the\x20importance\x20of\x20the\x20information.'},{'id':'poetic','label':Vn(_0x2c088c,'Poetic'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20poem\x20using\x20poetic\x20techniques\x20without\x20losing\x20the\x20original\x20meaning.'}]},{'groupId':'translate','groupLabel':Vn(_0x2c088c,'Translate'),'commands':[{'id':'translateEnglish','label':Vn(_0x2c088c,'English'),'prompt':'Translate\x20the\x20content\x20to\x20English\x20language.'},{'id':'translateSpanish','label':Vn(_0x2c088c,'Spanish'),'prompt':'Translate\x20the\x20content\x20to\x20Spanish\x20language.'},{'id':'translatePortuguese','label':Vn(_0x2c088c,'Portuguese'),'prompt':'Translate\x20the\x20content\x20to\x20Portuguese\x20language.'},{'id':'translateGerman','label':Vn(_0x2c088c,'German'),'prompt':'Translate\x20the\x20content\x20to\x20German\x20language.'},{'id':'translateFrench','label':Vn(_0x2c088c,'French'),'prompt':'Translate\x20the\x20content\x20to\x20French\x20language.'},{'id':'translateChinese','label':Vn(_0x2c088c,'Simplified\x20Chinese'),'prompt':'Translate\x20the\x20content\x20to\x20Simplified\x20Chinese\x20language.'},{'id':'translateHindi','label':Vn(_0x2c088c,'Hindi'),'prompt':'Translate\x20the\x20content\x20to\x20Hindi\x20language.'},{'id':'translateArabic','label':Vn(_0x2c088c,'Arabic'),'prompt':'Translate\x20the\x20content\x20to\x20Arabic\x20language.'}]}];}class we extends _0x5167f5{['abortController'];static get['requires'](){return[q];}constructor(_0x4412c3){super(_0x4412c3),this['abortController']=new AbortController();}['init'](){this['editor']['plugins']['get'](q)['textAdapter']=this;}['abort'](){this['abortController']['signal']['aborted']||(this['abortController']['abort'](),this['abortController']=new AbortController());}async['makeRequest'](_0xeb7a8c){return this['sendRequest'](_0xeb7a8c)['catch'](_0x5d2048=>{if(_0x5d2048 instanceof tr)return Promise['reject'](_0x5d2048);if('AbortError'==_0x5d2048['name'])return Promise['resolve']();throw console['error'](_0x5d2048),new _0xa14e6e('aitextadapter-send-request-failed',null);});}async['_prepareRequestHeaders'](_0x3eda5b,_0x1cf09d){const _0x14ca04=this['editor']['locale'],_0x37ca71={'Content-Type':'application/json'};if('object'==typeof _0x3eda5b)Object['assign'](_0x37ca71,_0x3eda5b);else{if(_0x3eda5b)try{const _0x4e62e7=await _0x3eda5b(_0x1cf09d);Object['assign'](_0x37ca71,_0x4e62e7);}catch{return Promise['reject'](new tr(Vn(_0x14ca04,'AI_ERROR_GET_HEADERS')));}}return _0x37ca71;}async['_prepareRequestParameters'](_0x28e3d5,_0x4031fb){const _0x1f2a44=this['editor']['locale'];if('object'==typeof _0x28e3d5)return _0x28e3d5;try{return await _0x28e3d5(_0x4031fb);}catch{return Promise['reject'](new tr(Vn(_0x1f2a44,'AI_ERROR_GET_PARAMETERS')));}}}class Wn extends we{['_apiUrl'];['_requestHeaders'];['_requestParameters'];static get['pluginName'](){return'OpenAITextAdapter';}constructor(_0x4ff833){super(_0x4ff833),_0x4ff833['config']['define']('ai.assistant.adapter.openAI.apiUrl','https://api.openai.com/v1/chat/completions'),_0x4ff833['config']['get']('ai.assistant.adapter.openAI.requestParameters')||_0x4ff833['config']['define']('ai.assistant.adapter.openAI.requestParameters',{'model':'gpt-4o','temperature':0x1,'top_p':0x1,'stream':!0x0}),this['_apiUrl']=_0x4ff833['config']['get']('ai.assistant.adapter.openAI.apiUrl'),this['_requestHeaders']=_0x4ff833['config']['get']('ai.assistant.adapter.openAI.requestHeaders')||{},this['_requestParameters']=_0x4ff833['config']['get']('ai.assistant.adapter.openAI.requestParameters');}async['sendRequest']({query:_0x37dd4b,context:_0x59157b,onData:_0x14556e,actionId:_0x295bd4}){const _0x489562=this['editor']['locale'],_0x1672dd=await this['prepareMessages'](_0x37dd4b,_0x59157b,_0x295bd4),_0x23475a=await this['_prepareRequestHeaders'](this['_requestHeaders'],_0x295bd4),_0x11c872=await this['_prepareRequestParameters'](this['_requestParameters'],_0x295bd4),_0x50f5eb={'messages':_0x1672dd,..._0x11c872},_0x53b917={'method':'POST','headers':_0x23475a,'body':JSON['stringify'](_0x50f5eb),'signal':this['abortController']['signal']},_0x3918b2=await fetch(this['_apiUrl'],_0x53b917);if(_0x3918b2['ok'])return _0x11c872['stream']?await this['_readStreamableResponse'](_0x3918b2,_0x14556e):await this['_readStaticResponse'](_0x3918b2,_0x14556e),Promise['resolve']();{const _0x153265=await _0x3918b2['text']();return _0x153265['includes']('context_length_exceeded')?Promise['reject'](new tr(Vn(_0x489562,'AI_ERROR_CONTEXT_LENGTH'))):_0x153265['includes']('Moderation')?Promise['reject'](new tr(Vn(_0x489562,'AI_ERROR_MODERATION'))):Promise['reject'](new Error(_0x153265));}}async['prepareMessages'](_0x5a3bc7,_0x4725ff,_0x44d5e6){let _0xc1a69b,_0x982991;return _0x4725ff?(_0xc1a69b='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.',_0x982991='Instruction:\x0a'+_0x5a3bc7+'\x0aYou\x20must\x20keep\x20the\x20text\x20formatting.\x0a\x0aContent:\x0a'+_0x4725ff):(_0xc1a69b='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.',_0x982991=_0x5a3bc7),[{'role':'system','content':_0xc1a69b},{'role':'user','content':_0x982991}];}async['_readStreamableResponse'](_0x2d8ad4,_0x2c9e74){const _0x4353e2=_0x2d8ad4['body']['getReader'](),_0x538180=new TextDecoder();let _0xf76471='',_0x288e8e='',_0x19c2b6='',_0x5570c7=!0x1;for(;!_0x5570c7;){const {done:_0x17f999,value:_0x384fa2}=await _0x4353e2['read'](),_0x2d0709=_0xf76471+_0x538180['decode'](_0x384fa2);let _0x4b540='';_0x5570c7=_0x17f999;try{_0x4b540=this['_cleanUpData'](_0x2d0709),_0xf76471='';}catch{_0xf76471=_0x2d0709;continue;}_0x288e8e+=_0x4b540,!_0x5570c7&&this['_isBufferIncomplete'](_0x288e8e)||_0x288e8e&&(_0x19c2b6+=_0x288e8e,_0x288e8e='',_0x2c9e74(_0x19c2b6));}return Promise['resolve']();}async['_readStaticResponse'](_0x102940,_0x466896){return _0x466896((await _0x102940['json']())['choices'][0x0]['message']['content']),Promise['resolve']();}['_isBufferIncomplete'](_0x5b9c95){const _0x4e6437=_0x5b9c95['split']('<')['length']!==_0x5b9c95['split']('>')['length'],_0x2dd2e3=_0x5b9c95['length']<0x1e;return _0x4e6437&&_0x2dd2e3;}['_cleanUpData'](_0xafdfff){return _0xafdfff['split'](/\n(?![^{]*\})/g)['map'](_0x100391=>_0x100391['replace']('data:\x20',''))['filter'](_0x2866f5=>_0x2866f5&&_0x2866f5['length']>0x0&&'[DONE]'!==_0x2866f5)['map'](_0x2a3de7=>{const {choices:_0x1d1e30}=JSON['parse'](_0x2a3de7);if(_0x1d1e30[0x0]?.['delta']?.['content'])return _0x1d1e30[0x0]['delta']['content'];})['filter'](_0x5e83ac=>_0x5e83ac)['join']('');}}class Fn extends we{['_apiUrl'];['_requestHeaders'];['_bedrockClientConfig'];['_requestParameters'];static get['pluginName'](){return'AWSTextAdapter';}constructor(_0x2d54ce){super(_0x2d54ce),_0x2d54ce['config']['get']('ai.assistant.adapter.aws.requestParameters')||_0x2d54ce['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']=_0x2d54ce['config']['get']('ai.assistant.adapter.aws.apiUrl'),this['_bedrockClientConfig']=_0x2d54ce['config']['get']('ai.assistant.adapter.aws.bedrockClientConfig'),this['_requestHeaders']=_0x2d54ce['config']['get']('ai.assistant.adapter.aws.requestHeaders'),this['_requestParameters']=_0x2d54ce['config']['get']('ai.assistant.adapter.aws.requestParameters');}async['sendRequest']({query:_0x4b4a31,context:_0x595473,onData:_0x447dd4,actionId:_0x2c8519}){const {model:_0x4a2cb0,stream:_0xc644c2,..._0x1c369e}=await this['_prepareRequestParameters'](this['_requestParameters'],_0x2c8519),_0x12a125={'prompt':await this['preparePrompt'](_0x4b4a31,_0x595473,_0x4a2cb0,_0x2c8519),..._0x1c369e};this['_apiUrl']?await this['_processProxyRequest'](_0x12a125,_0x4a2cb0,_0xc644c2,_0x447dd4,_0x2c8519):await this['_processAWSRequest'](_0x12a125,_0x4a2cb0,_0xc644c2,_0x447dd4);}async['preparePrompt'](_0x5ea6d4,_0x6fa892,_0x415207,_0x296f2e){let _0x3b8749,_0x2631e9;return _0x6fa892?(_0x3b8749='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.',_0x2631e9='Instruction:\x0a'+_0x5ea6d4+'\x0aYou\x20must\x20keep\x20the\x20text\x20formatting.\x0a\x0aContent:\x0a'+_0x6fa892):(_0x3b8749='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.',_0x2631e9=_0x5ea6d4),'meta.llama'==this['getModelFamily'](_0x415207)?'<<SYS>>\x0a'+_0x3b8749+'\x0a<</SYS>>\x0a[INST]\x0a'+_0x2631e9+'\x0a[/INST]':'Human:\x0a'+_0x3b8749+'\x0a'+_0x2631e9+'\x0a\x0aAssistant:';}['getModelFamily'](_0x2d3f47){if(/^anthropic\.claude/['test'](_0x2d3f47))return'anthropic.claude';if(/^ai21\.j2/['test'](_0x2d3f47))return'ai21.j2';if(/^cohere\.command/['test'](_0x2d3f47))return'cohere.command';if(/^meta\.llama/['test'](_0x2d3f47))return'meta.llama';throw new tr(Vn(this['editor']['locale'],'AI_ERROR_UNSUPPORTED_MODEL',_0x2d3f47));}async['_processProxyRequest'](_0x1cf8f5,_0xf8e0df,_0x43d3f2,_0x19a82a,_0x347f98){const _0x55432b={'method':'POST','headers':await this['_prepareRequestHeaders'](this['_requestHeaders'],_0x347f98),'body':JSON['stringify']({..._0x1cf8f5,'model':_0xf8e0df,'stream':_0x43d3f2}),'signal':this['abortController']['signal']},_0x4dc782=await fetch(this['_apiUrl'],_0x55432b);_0x43d3f2?await this['_readStreamableResponse'](_0x4dc782,_0xf8e0df,_0x19a82a):await this['_readStaticResponse'](_0x4dc782,_0xf8e0df,_0x19a82a);}async['_processAWSRequest'](_0x47a6af,_0x4081d2,_0x28b4e,_0xee42d8){const _0x344dd1=new _0x252a89(this['_bedrockClientConfig']),_0x4a97ef={'body':JSON['stringify'](_0x47a6af),'contentType':'application/json','accept':'application/json','modelId':_0x4081d2};let _0x4c6d89;if(_0x28b4e){const _0x420ec8=new _0x2549c7(_0x4a97ef);_0x4c6d89=await _0x344dd1['send'](_0x420ec8,{'abortSignal':this['abortController']['signal']}),await this['_readAsyncIterableResponse'](_0x4c6d89,_0x4081d2,_0xee42d8);}else{const _0x169235=new _0x46fffb(_0x4a97ef);_0x4c6d89=await _0x344dd1['send'](_0x169235,{'abortSignal':this['abortController']['signal']}),await this['_readStaticResponse'](_0x4c6d89,_0x4081d2,_0xee42d8);}}async['_readAsyncIterableResponse'](_0x583bb9,_0xbd0bbb,_0x1b4046){const _0xcc5667=_0x583bb9['body'],_0xda55cb=new TextDecoder('utf-8');let _0x61b258='';for await(const _0x339392 of _0xcc5667)if(_0x339392['chunk']){const _0x22ab3d=_0xda55cb['decode'](_0x339392['chunk']['bytes']),_0x537016=JSON['parse'](_0x22ab3d);_0x61b258+=this['_getGeneratedText'](_0x537016,_0xbd0bbb),_0x1b4046(_0x61b258);}return Promise['resolve']();}async['_readStreamableResponse'](_0x4dba4c,_0x3c6ae9,_0xbb85c6){const _0x4bb6f2=_0x4dba4c['body'],_0x2b5044=new TextDecoder('utf-8'),_0x1d6816=_0x4bb6f2['getReader']();let _0x32a318='',_0x28a5e9='',_0x48cc87=!0x1;for(;!_0x48cc87;){const {done:_0x446af1,value:_0x88137f}=await _0x1d6816['read']();if(_0x48cc87=_0x446af1,_0x48cc87)break;const _0x16754b=(_0x32a318+_0x2b5044['decode'](_0x88137f))['split']('\x0a')['map'](_0x4df390=>{try{return _0x32a318='',JSON['parse'](_0x4df390);}catch{return _0x32a318=_0x4df390,null;}})['filter'](_0x3e57e7=>null!==_0x3e57e7);_0x16754b['length']&&(_0x28a5e9+=_0x16754b['map'](_0x53e4f6=>this['_getGeneratedText'](_0x53e4f6,_0x3c6ae9))['join'](''),_0xbb85c6(_0x28a5e9));}return Promise['resolve']();}async['_readStaticResponse'](_0x238ae8,_0x271d2c,_0x43749a){let _0x3638b3;return _0x3638b3=_0x238ae8 instanceof Response?await _0x238ae8['json']():JSON['parse'](new TextDecoder('utf-8')['decode'](_0x238ae8['body'])),(_0x43749a(this['_getGeneratedText'](_0x3638b3,_0x271d2c)),Promise['resolve']());}['_getGeneratedText'](_0x43ba40,_0xb6fa6b){switch(this['getModelFamily'](_0xb6fa6b)){case'anthropic.claude':return _0x43ba40['completion'];case'ai21.j2':return _0x43ba40['completions'][0x0]['data']['text'];case'cohere.command':return _0x43ba40['generations'][0x0]['text'];case'meta.llama':return _0x43ba40['generation'];}}}class Qs extends _0xa24b3c{constructor(_0x16717c,_0x31d601={}){super(_0x16717c),this['isToggleable']=!0x0,this['set']('side',_0x31d601['side']||'top');const _0x468368=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':['ck-tab-button',..._0x49bfd5(_0x31d601['class']||[]),_0x468368['to']('side',_0x25abde=>'ck-tab-button_'+_0x25abde),_0x468368['to']('class')]}});}['show'](){this['set']('isVisible',!0x0);}['hide'](){this['set']('isVisible',!0x1);}}class Us extends _0xebef92{['children'];constructor(_0x130f74,_0x557a4e={}){super(_0x130f74);const _0x417967=this['bindTemplate'];this['set']('isVisible',!0x1),this['children']=this['createCollection'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck-tab-panel',..._0x49bfd5(_0x557a4e['class']||[]),_0x417967['to']('class'),_0x417967['if']('isVisible','ck-hidden',_0x3eaeaa=>!_0x3eaeaa)]},'children':this['children']});}['show'](){this['set']('isVisible',!0x0);}['hide'](){this['set']('isVisible',!0x1);}}class ts extends _0xebef92{['buttonViews']=this['createCollection']();['panelViews']=this['createCollection']();['_tabs']=new Map();constructor(_0x45eaa9,_0x394446={}){super(_0x45eaa9),this['set']('class',void 0x0),this['set']('activeTab',null),this['set']('side',_0x394446['side']||'top'),this['set']('isMaximized',!0x1);const _0x49a8d5=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset','ck-tabs',..._0x49bfd5(_0x394446['class']||[]),_0x49a8d5['to']('side',_0x2085c7=>'ck-tabs_'+_0x2085c7),_0x49a8d5['to']('class'),_0x49a8d5['to']('isMaximized',_0xec3253=>_0xec3253?'ck-ai-tabs_maximized':'')],'tabindex':'0'},'children':[{'tag':'div','attributes':{'class':['ck','ck-tabs__buttons-container',_0x49a8d5['to']('side',_0x14c196=>'ck-tabs__buttons-container_'+_0x14c196)]},'children':this['buttonViews']},{'tag':'div','attributes':{'class':['ck','ck-tabs__panels-container',_0x49a8d5['to']('side',_0x3c403a=>'ck-tabs__panels-container_'+_0x3c403a)]},'children':this['panelViews']},..._0x49bfd5(_0x394446['children']||[])]});}['getTabIds'](){return[...this['_tabs']['keys']()];}['getTab'](_0x2d395a){const _0x5c913d=this['_tabs']['get'](_0x2d395a);return _0x5c913d||null;}['addTab'](_0x54578f){const _0x2cd8bd=this['_setupButton']({'id':_0x54578f['id'],'label':_0x54578f['buttonLabel'],'icon':_0x54578f['buttonIcon'],'order':_0x54578f['order']}),_0x18b11a=new Us(this['locale']);return _0x18b11a['render'](),_0x54578f['content']&&_0x18b11a['children']['add'](_0x54578f['content']),this['panelViews']['add'](_0x18b11a),this['_tabs']['set'](_0x54578f['id'],{'button':_0x2cd8bd,'panel':_0x18b11a,'order':void 0x0!==_0x54578f['order']?_0x54578f['order']:null}),this['fire']('addTab:'+_0x54578f['id'],{'id':_0x54578f['id'],'button':_0x2cd8bd,'panel':_0x18b11a}),null===this['activeTab']?this['activateTab'](_0x54578f['id']):this['_hidePanel'](_0x54578f['id']),{'button':_0x2cd8bd,'panel':_0x18b11a};}['activateTab'](_0x190335){if(null!==_0x190335&&!this['getTab'](_0x190335))throw new _0xa14e6e('ui-tabsview-tab-not-found',{'tabs':this,'tabId':_0x190335});this['activeTab']!==_0x190335&&(this['activeTab']&&this['_hidePanel'](this['activeTab']),this['activeTab']=_0x190335,_0x190335&&this['_showPanel'](_0x190335),this['fire']('activateTab:'+_0x190335,_0x190335));}['showTab'](_0xd12bea){if(!this['getTab'](_0xd12bea))throw new _0xa14e6e('ui-tabsview-tab-not-found',{'tabs':this,'tabId':_0xd12bea});this['_showPanel'](_0xd12bea),this['_showButton'](_0xd12bea),this['fire']('show:'+_0xd12bea,_0xd12bea);}['hideTab'](_0x2c85c6){if(!this['getTab'](_0x2c85c6))throw new _0xa14e6e('ui-tabsview-tab-not-found',{'tabs':this,'tabId':_0x2c85c6});const _0x13b1eb=this['activeTab'];this['_hidePanel'](_0x2c85c6),this['_hideButton'](_0x2c85c6);const _0x60eb32=this['getTabIds']();_0x13b1eb===_0x2c85c6&&_0x60eb32['length']>0x1&&this['activateTab'](_0x60eb32['find'](_0x5f5143=>_0x5f5143!==_0x2c85c6)),this['fire']('hide:'+_0x2c85c6,_0x2c85c6);}['_getPanel'](_0x2a409d){const _0x2c419a=this['_tabs']['get'](_0x2a409d);return _0x2c419a?_0x2c419a['panel']:null;}['_showPanel'](_0x27f4ef){null!==this['activeTab']&&this['activeTab']!==_0x27f4ef||this['_getPanel'](_0x27f4ef)['show']();}['_hidePanel'](_0x4cbe62){const _0x1ebc4d=this['_getPanel'](_0x4cbe62);_0x1ebc4d['isVisible']&&(this['activeTab']===_0x4cbe62&&(this['activeTab']=null),_0x1ebc4d['hide']());}['_getButton'](_0x5c25fb){const _0x441b74=this['_tabs']['get'](_0x5c25fb);return _0x441b74?_0x441b74['button']:null;}['_showButton'](_0x4a9431){this['_getButton'](_0x4a9431)['show']();}['_hideButton'](_0x1628f2){this['_getButton'](_0x1628f2)['hide']();}['_setupButton'](_0x2cba48){const _0x5580e4=new Qs(this['locale'],{'side':this['side']}),_0x5bb1b5=this['buttonViews'];if(_0x5580e4['set']({'label':_0x2cba48['label'],'icon':_0x2cba48['icon'],'tooltip':!0x0,'withText':!0x0}),_0x5580e4['bind']('isOn')['to'](this,'activeTab',_0x37f6b0=>_0x37f6b0===_0x2cba48['id']),_0x5580e4['bind']('side')['to'](this,'side'),_0x2cba48['order']){const _0x383838=[...this['_tabs']]['reduce']((_0x2d18e2,_0x1c97ee)=>{const _0x33a9e0=_0x1c97ee[0x0],{order:_0x2219a1}=_0x1c97ee[0x1];return!_0x2219a1||_0x2219a1>_0x2cba48['order']?_0x2d18e2:_0x2219a1>=_0x2d18e2['order']?{'id':_0x33a9e0,'order':_0x2219a1}:_0x2d18e2;},{'id':'','order':0x0}),_0xef9cf3=_0x5bb1b5['getIndex'](this['_getButton'](_0x383838['id']));_0x5bb1b5['add'](_0x5580e4,_0xef9cf3+0x1);}else _0x5bb1b5['add'](_0x5580e4);return _0x5580e4['on']('execute',()=>{this['activateTab'](_0x2cba48['id']);}),_0x5580e4;}}const di=['overlay','sidebar','custom'],ui=['left','right'];class ai extends ts{constructor(_0x1a283a,_0x55ed86={}){super(_0x1a283a,_0x55ed86),this['set']('type',_0x55ed86['type']||'sidebar'),this['set']('side',_0x55ed86['side']||'right');const _0x3c48f9=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':['ck-ai-tabs',_0x3c48f9['if']('type','ck-ai-tabs__overlay',_0x5c89d0=>'overlay'===_0x5c89d0),_0x3c48f9['if']('type','ck-ai-tabs__sidebar',_0x4b7862=>'sidebar'===_0x4b7862)]}}),this['buttonViews']['on']('add',(_0x12d18e,_0x1e52f0)=>{_0x1e52f0['set']('withText',!0x1);});}}class ht extends _0x3cc6c1{['view'];['container']=null;['showResizeButton']=!0x0;static get['pluginName'](){return'AITabs';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x2163af){super(_0x2163af);const _0x16beae=this['context']['config']['get']('ai.container');if(this['set']('side','right'),!_0x16beae)throw new _0xa14e6e('ai-tabs-configuration-not-found');if(void 0x0!==_0x16beae['showResizeButton']&&(this['showResizeButton']=_0x16beae['showResizeButton']),'sidebar'!==_0x16beae['type']&&'overlay'!==_0x16beae['type']||_0x16beae['side']&&(this['side']=_0x16beae['side']),'sidebar'===_0x16beae['type']){if(this['container']=_0x16beae['element'],this['set']('type','sidebar'),!this['container'])throw new _0xa14e6e('ai-tabs-sidebar-container-element-not-found');}else'overlay'===_0x16beae['type']?(this['container']=document['body'],this['set']('type','overlay')):(this['container']=null,this['set']('type','custom'));this['view']=new ai(this['context']['locale'],{'side':this['side'],'type':this['type']}),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 ot&&this['context']['ui']['focusTracker']['add'](this['view']['element']);}['switchType'](_0x588653){if(_0x588653&&this['type']!==_0x588653){if(!di['includes'](_0x588653))throw new _0xa14e6e('ai-tabs-unsupported-ui-type');this['type']=_0x588653;}}['switchSide'](_0x48ccef){if(_0x48ccef&&this['side']!==_0x48ccef){if(!ui['includes'](_0x48ccef))throw new _0xa14e6e('ai-tabs-unsupported-ui-side');this['side']=_0x48ccef;}}['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']();}}function Yn(_0x451b8c,_0x447d30,_0x16e9cd){const t=_0x451b8c['t'];switch(_0x447d30){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'},_0x16e9cd);case'AI_SUGGESTION_CONTENT_PART_REJECTED':return t({'id':'AI_SUGGESTION_CONTENT_PART_REJECTED','string':'Change\x20was\x20rejected'});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_SHOW_IN_THE_TEXT':return t({'id':'AI_SUGGESTION_CONTENT_PART_SHOW_IN_THE_TEXT','string':'Preview'});case'AI_SUGGESTION_CONTENT_PART_ADD_AS_SUGGESTION':return t({'id':'AI_SUGGESTION_CONTENT_PART_ADD_AS_SUGGESTION','string':'Insert\x20as\x20suggestion'});case'AI_SUGGESTION_CONTENT_PART_DELETE':return t({'id':'AI_SUGGESTION_CONTENT_PART_DELETE','string':'Reject'});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\x27m\x20your\x20AI\x20assistant.\x20Think\x20of\x20me\x20as\x20your\x20writing\x20buddy,\x20reviewer,\x20or\x20research\x20partner.\x20I\x20can\x20suggest\x20changes\x20to\x20your\x20document,\x20help\x20generate\x20ideas,\x20offer\x20feedback,\x20discuss\x20attached\x20files,\x20and\x20much\x20more!'});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_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.'},_0x16e9cd);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.'},_0x16e9cd);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_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.'},_0x16e9cd);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_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_SHOW_CHANGE_IN_TEXT':return t({'id':'AI_CHAT_SUGGESTION_ACTION_SHOW_CHANGE_IN_TEXT','string':'Preview','plural':'Preview'},_0x16e9cd);case'AI_CHAT_SUGGESTION_ACTION_SHOW_CHANGE_IN_TEXT_TOOLTIP':return t({'id':'AI_CHAT_SUGGESTION_ACTION_SHOW_CHANGE_IN_TEXT_TOOLTIP','string':'Show\x20change\x20in\x20the\x20document','plural':'Show\x20changes\x20in\x20the\x20document'},_0x16e9cd);case'AI_CHAT_SUGGESTION_ACTION_INSERT_SUGGESTION':return t({'id':'AI_CHAT_SUGGESTION_ACTION_INSERT_SUGGESTION','string':'Suggest','plural':'Suggest'},_0x16e9cd);case'AI_CHAT_SUGGESTION_ACTION_INSERT_SUGGESTION_TOOLTIP':return t({'id':'AI_CHAT_SUGGESTION_ACTION_INSERT_SUGGESTION_TOOLTIP','string':'Insert\x20change\x20as\x20suggestion','plural':'Insert\x20changes\x20as\x20suggestions'},_0x16e9cd);case'AI_CHAT_SUGGESTION_ACTION_APPLY_LABEL':return t({'id':'AI_CHAT_SUGGESTION_ACTION_APPLY_LABEL','string':'Apply','plural':'Apply\x20all'},_0x16e9cd);case'AI_CHAT_SUGGESTION_ACTION_APPLY_TOOLTIP':return t({'id':'AI_CHAT_SUGGESTION_ACTION_APPLY_TOOLTIP','string':'Apply\x20changes\x20immediately','plural':'Apply\x20all\x20changes\x20immediately'},_0x16e9cd);case'AI_CHAT_SUGGESTION_MORE_OPTIONS_TOOLTIP':return t({'id':'AI_CHAT_SUGGESTION_MORE_OPTIONS_TOOLTIP','string':'More\x20options'},_0x16e9cd);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_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.'},_0x16e9cd);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.'},_0x16e9cd);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.'},_0x16e9cd);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.'},_0x16e9cd);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'},_0x16e9cd);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_TOOLTIP':return t({'id':'AI_BALLOON_NEXT_TOOLTIP','string':'Next'});case'AI_BALLOON_PREVIOUS_TOOLTIP':return t({'id':'AI_BALLOON_PREVIOUS_TOOLTIP','string':'Previous'});case'AI_SUGGESTION_NO_PARTS_WARNING':return t({'id':'AI_SUGGESTION_NO_PARTS_WARNING','string':'The\x20suggestion\x20can’t\x20be\x20applied\x20to\x20the\x20editor\x20because\x20the\x20system\x20can’t\x20display\x20it\x20correctly..'});case'AI_SUGGESTION_EMPTY_PART_WARNING':return t({'id':'AI_SUGGESTION_EMPTY_PART_WARNING','string':'Some\x20suggestions\x20can’t\x20be\x20applied\x20to\x20the\x20editor\x20because\x20the\x20system\x20can’t\x20display\x20them\x20correctly.'});case'AI_ACTIONS_TRY_AGAIN':return t({'id':'AI_ACTIONS_TRY_AGAIN','string':'Retry'});case'AI_MODEL_DESCRIPTION_AGENT-1':return t({'id':'AI_MODEL_DESCRIPTION_AGENT-1','string':'Automatically\x20selects\x20best\x20model\x20for\x20speed,\x20quality,\x20and\x20cost.'});case'AI_MODEL_DESCRIPTION_GPT-5':return t({'id':'AI_MODEL_DESCRIPTION_GPT-5','string':'OpenAI\x27s\x20flagship\x20model\x20for\x20advanced\x20reasoning,\x20creativity,\x20and\x20complex\x20tasks'});case'AI_MODEL_DESCRIPTION_GPT-5-MINI':return t({'id':'AI_MODEL_DESCRIPTION_GPT-5-MINI','string':'A\x20lightweight\x20version\x20of\x20GPT-5\x20-\x20faster,\x20more\x20cost-efficient'});case'AI_MODEL_DESCRIPTION_GPT-4.1':return t({'id':'AI_MODEL_DESCRIPTION_GPT-4.1','string':'OpenAI\x27s\x20model\x20for\x20reliable\x20reasoning,\x20speed,\x20and\x20versatility'});case'AI_MODEL_DESCRIPTION_GPT-4.1-MINI':return t({'id':'AI_MODEL_DESCRIPTION_GPT-4.1-MINI','string':'A\x20lighter\x20variant\x20of\x20GPT-4.1\x20that\x20balances\x20speed\x20and\x20cost\x20while\x20maintaining\x20solid\x20accuracy'});case'AI_MODEL_DESCRIPTION_CLAUDE-3-5-HAIKU':return t({'id':'AI_MODEL_DESCRIPTION_CLAUDE-3-5-HAIKU','string':'Anthropic\x27s\x20fast,\x20cost-efficient\x20model\x20for\x20simpler\x20tasks'});case'AI_MODEL_DESCRIPTION_CLAUDE-4-SONNET':return t({'id':'AI_MODEL_DESCRIPTION_CLAUDE-4-SONNET','string':'Advanced\x20model\x20with\x20strong\x20reasoning\x20and\x20reliability\x20for\x20complex\x20tasks'});case'AI_MODEL_DESCRIPTION_GEMINI-2-5-PRO':return t({'id':'AI_MODEL_DESCRIPTION_GEMINI-2-5-PRO','string':'Google\x27s\x20advanced\x20model\x20for\x20versatile\x20problem-solving\x20and\x20research'});case'AI_MODEL_DESCRIPTION_GEMINI-2-5-FLASH':return t({'id':'AI_MODEL_DESCRIPTION_GEMINI-2-5-FLASH','string':'Lightweight\x20Gemini\x20model\x20for\x20fast,\x20cost-efficient\x20interactions'});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_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_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'});default:return _0x447d30;}}class e extends _0x3cc6c1{['_apiUrl'];['_token'];['_decoder'];static get['requires'](){return['CloudServices'];}static get['pluginName'](){return'AIConnector';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x33a3b9){super(_0x33a3b9),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();}['init'](){const _0x4eba0c=this['context']['plugins']['get']('CloudServices');if(!_0x4eba0c['token'])throw new _0xa14e6e('ai-missing-token',this);this['_token']=_0x4eba0c['token'];}['startConversation'](_0x3b2c7f,_0x1da09b){const _0x40ecf8=this['_sendApiRequest']('/conversations','POST',{'id':_0x3b2c7f,'group':_0x1da09b});return{'getConversation':async()=>(await _0x40ecf8['request'])['json'](),'abortController':_0x40ecf8['abortController']};}['queryAssistant']({message:_0x20c94d,conversationId:_0x2e95d7,parts:_0x4b2815,capabilities:_0x3a3f74,model:_0x46e989,quickActionData:_0x2e9ece}){const _0x17cad8={..._0x2e9ece&&{'quickActionData':_0x2e9ece}},_0x41c3b3={'prompt':_0x20c94d,'content':_0x4b2815,'model':_0x46e989,..._0x3a3f74&&{'capabilities':_0x3a3f74},...Object['keys'](_0x17cad8)['length']>0x0&&{'attributes':_0x17cad8}},_0x553e15=this['_sendApiRequest']('/conversations/'+_0x2e95d7+'/messages','POST',_0x41c3b3);return{'getStream':async()=>{const _0x4d4dd6=(await _0x553e15['request'])['body'];return this['_getStreamReader'](_0x4d4dd6);},'abortController':_0x553e15['abortController']};}['executeCustomAction']({content:_0x18e39d,message:_0x4930ec,model:_0x3ee93c,outputFormat:_0x6078d0}){const _0x23b040={'content':[{'type':'text','content':_0x18e39d}],'prompt':_0x4930ec,'model':_0x3ee93c,'outputFormat':_0x6078d0},_0x4a5101=this['_sendApiRequest']('/actions/custom/calls','POST',_0x23b040);return{'getStream':async()=>{const _0x10143e=(await _0x4a5101['request'])['body'];return this['_getStreamReader'](_0x10143e);},'abortController':_0x4a5101['abortController']};}['executeAction']({actionName:_0x465240,content:_0x1cb853,args:_0x51cbcd}){const _0x44d10e={'content':[{'type':'text','content':_0x1cb853}],'args':_0x51cbcd},_0x23afd1=this['_sendApiRequest']('/actions/system/'+_0x465240+'/calls','POST',_0x44d10e);return{'getStream':async()=>{const _0x162401=(await _0x23afd1['request'])['body'];return this['_getStreamReader'](_0x162401);},'abortController':_0x23afd1['abortController']};}['uploadFile'](_0x5e8dc8,_0x4131bd,_0x43afb6){const _0x49eb6b=new FormData();_0x49eb6b['append']('file',_0x4131bd,_0x4131bd['name']),_0x43afb6&&_0x49eb6b['append']('attributes',JSON['stringify'](_0x43afb6));const _0x4581fb=this['_sendApiRequest']('/conversations/'+_0x5e8dc8+'/files','POST',_0x49eb6b);return{'getId':async()=>(await _0x4581fb['request'])['json'](),'abortController':_0x4581fb['abortController']};}['fetchDocument'](_0x47b982,_0x1bf608){const _0x3efbad=this['_sendApiRequest']('/conversations/'+_0x47b982+'/documents/'+_0x1bf608,'GET');return{'getDocument':async()=>(await _0x3efbad['request'])['json'](),'abortController':_0x3efbad['abortController']};}['uploadDocument'](_0x2b21be,_0x2f4ff3,_0x5cf3cd){const _0x225797={'content':_0x2f4ff3};_0x5cf3cd&&(_0x225797['attributes']=_0x5cf3cd);const _0x23e241=this['_sendApiRequest']('/conversations/'+_0x2b21be+'/documents','POST',_0x225797);return{'getId':async()=>(await _0x23e241['request'])['json'](),'abortController':_0x23e241['abortController']};}['fetchConversations'](_0x5e04c1,_0x49d567){const _0x3a76c0=new URLSearchParams();_0x3a76c0['append']('excludeEmpty','true'),_0x3a76c0['append']('limit','100'),_0x3a76c0['append']('group',_0x5e04c1),_0x49d567&&_0x3a76c0['append']('search',_0x49d567);const _0x46011a=this['_sendApiRequest']('/conversations?'+_0x3a76c0['toString'](),'GET');return{'getConversations':async()=>{const _0x4e816c=await _0x46011a['request'];return(await _0x4e816c['json']())['items'];},'abortController':_0x46011a['abortController']};}['deleteConversation'](_0x590594){const _0x49b73f=this['_sendApiRequest']('/conversations/'+_0x590594,'DELETE');return{'execute':async()=>{await _0x49b73f['request'];},'abortController':_0x49b73f['abortController']};}['updateConversation'](_0x52278f,_0x4b3440){const _0x3be933=this['_sendApiRequest']('/conversations/'+_0x52278f,'PATCH',_0x4b3440);return{'getResult':async()=>(await _0x3be933['request'],_0x4b3440),'abortController':_0x3be933['abortController']};}['fetchConversation'](_0x6a151f){const _0x34c25a=this['_sendApiRequest']('/conversations/'+_0x6a151f,'GET');return{'getConversation':async()=>(await _0x34c25a['request'])['json'](),'abortController':_0x34c25a['abortController']};}['fetchConversationMessages'](_0x990f1){const _0x2ca119=this['_sendApiRequest']('/conversations/'+_0x990f1+'/messages','GET');return{'getMessages':async()=>{const _0x2c3654=await _0x2ca119['request'];return(await _0x2c3654['json']())['items'];},'abortController':_0x2ca119['abortController']};}['uploadUrl'](_0x1faf77,_0x77219,_0x2c2238){const _0x36bc68=this['_sendApiRequest']('/conversations/'+_0x1faf77+'/web-resources','POST',{'url':_0x77219,'attributes':_0x2c2238});return{'getId':async()=>(await _0x36bc68['request'])['json'](),'abortController':_0x36bc68['abortController']};}['getModels'](){const _0x3cdc40=this['_sendApiRequest']('/models/1','GET');return{'list':async()=>{const _0xdbd2ba=await(await _0x3cdc40['request'])['json'](),_0x6d801b=_0xdbd2ba['items']['map'](_0x16ec51=>({..._0x16ec51,'description':Yn(this['context']['locale'],'AI_MODEL_DESCRIPTION_'+_0x16ec51['id']['toUpperCase']())}));return{..._0xdbd2ba,'items':_0x6d801b};},'abortController':_0x3cdc40['abortController']};}['deleteFile'](_0x1a7fd5,_0x1923cc){const _0x5f5bfa=this['_sendApiRequest']('/conversations/'+_0x1a7fd5+'/files/'+_0x1923cc,'DELETE');return{'execute':async()=>{await _0x5f5bfa['request'];},'abortController':_0x5f5bfa['abortController']};}['deleteDocument'](_0x27ae1c,_0x3d325d){const _0x4a5b3e=this['_sendApiRequest']('/conversations/'+_0x27ae1c+'/documents/'+_0x3d325d,'DELETE');return{'execute':async()=>{await _0x4a5b3e['request'];},'abortController':_0x4a5b3e['abortController']};}['deleteWebResource'](_0x100d4c,_0x9641b2){const _0x210da3=this['_sendApiRequest']('/conversations/'+_0x100d4c+'/web-resources/'+_0x9641b2,'DELETE');return{'execute':async()=>{await _0x210da3['request'];},'abortController':_0x210da3['abortController']};}['callSystemReview']({reviewName:_0x3fb2e9,content:_0x42f834,args:_0x257535}){const _0x555360=this['_sendApiRequest']('/reviews/system/'+_0x3fb2e9+'/calls','POST',{'content':[{'type':'text','content':_0x42f834}],'args':_0x257535});return{'getStream':async()=>{const _0xe301d4=(await _0x555360['request'])['body'];return this['_getStreamReader'](_0xe301d4);},'abortController':_0x555360['abortController']};}['callCustomReview']({content:_0x41a6b6,prompt:_0x312aa6,model:_0x7d8441}){const _0x1aafd1=this['_sendApiRequest']('/reviews/custom/calls','POST',{'content':[{'type':'text','content':_0x41a6b6}],'prompt':_0x312aa6,'model':_0x7d8441});return{'getStream':async()=>{const _0x4660f1=(await _0x1aafd1['request'])['body'];return this['_getStreamReader'](_0x4660f1);},'abortController':_0x1aafd1['abortController']};}['_sendApiRequest'](_0x14c671,_0x4f01cb,_0x125bec){const _0x3dcbf7=new AbortController(),_0x2142c8=_0x125bec instanceof FormData,_0x5a1109={'Authorization':'Bearer\x20'+this['_token']?.['value']};_0x125bec&&!_0x2142c8&&(_0x5a1109['Content-Type']='application/json');const _0x57edc8={'method':_0x4f01cb,'headers':_0x5a1109,'signal':_0x3dcbf7['signal']};return _0x125bec&&(_0x57edc8['body']=_0x2142c8?_0x125bec:JSON['stringify'](_0x125bec)),{'request':fetch(''+this['_apiUrl']+_0x14c671,_0x57edc8)['catch'](_0x3eac26=>{this['_handleError'](_0x3eac26);})['then'](_0x5e5ed8=>{if(!_0x5e5ed8['ok'])throw new _0xa14e6e('ai-request-failed',this);return _0x5e5ed8;}),'abortController':_0x3dcbf7};}async*['_getStreamReader'](_0x4249ed){const _0x112275=[],_0xfcec49=_0x4249ed['getReader'](),_0x3a1fde=wt({'onError':_0x18c574=>{this['_handleError'](_0x18c574);},'onEvent':_0x566ce0=>{_0x566ce0['data']=JSON['parse'](_0x566ce0['data']),_0x112275['push'](_0x566ce0);}});try{let _0x243584=!0x1;for(;!_0x243584;){const {done:_0x3e45b8,value:_0x291d40}=await _0xfcec49['read']();_0x3e45b8&&(_0x243584=!0x0),_0x3a1fde['feed'](this['_decoder']['decode'](_0x291d40,{'stream':!0x0})),yield*_0x112275,_0x112275['length']=0x0;}}catch(_0x505839){this['_handleError'](_0x505839);}finally{_0xfcec49['releaseLock'](),_0x3a1fde['reset']();}}['_handleError'](_0x5797c7){if(_0x5797c7 instanceof _0xa14e6e)throw _0x5797c7;if(_0x5797c7 instanceof Error&&'AbortError'===_0x5797c7['name'])throw new _0xa14e6e('ai-request-aborted',this,{'originalError':_0x5797c7});throw new _0xa14e6e('ai-request-failed',this,{'originalError':_0x5797c7});}}function As(_0x268e7c,_0xd79cb2){const _0x236255=new _0xa24b3c(_0x268e7c),_0x4c2b5f=Yn(_0x268e7c,'AI_TABS_LABEL_MINIMIZE'),_0x3197bd=Yn(_0x268e7c,'AI_TABS_LABEL_MAXIMIZE');return _0x236255['set']({'withText':!0x1,'icon':_0x26c8fc,'tooltip':!0x0,'class':'ck-ai-tabs__resize\x20ck-ai-button-tertiary-text'}),_0x236255['bind']('label')['to'](_0xd79cb2,'isMaximized',_0x342211=>_0x342211?_0x4c2b5f:_0x3197bd),_0x236255['bind']('icon')['to'](_0xd79cb2,'isMaximized',_0x23e215=>_0x23e215?_0x3107c9:_0x26c8fc),_0x236255['bind']('isOn')['to'](_0xd79cb2,'isMaximized'),_0x236255['on']('execute',()=>{_0xd79cb2['fire']('resizeTabs');}),_0x236255;}function Oe(_0x222e18){return _0x2adc66(_0x222e18);}function Ct(_0x200755){return _0x4b9a76(_0x200755);}function It(_0x32270c,_0xc0e205,_0x5796f9){const _0x584f2e=null!==_0xc0e205?_0x1f2283=>_0x1f2283['attribs'][_0x32270c]===_0xc0e205:_0x23df0b=>Boolean(_0x23df0b['attribs'][_0x32270c]);return mt(_0x5dd458=>_0x42e156(_0x5dd458)&&_0x584f2e(_0x5dd458),_0x5796f9);}function ze(_0x265f5d,_0x4c557c,_0xdf8239){const _0xe3e02b=null!==_0x4c557c?_0xd5e61=>_0xd5e61['attribs'][_0x265f5d]===_0x4c557c:_0x4b31e3=>Boolean(_0x4b31e3['attribs'][_0x265f5d]);return _0x28a1af(_0x2ee3d8=>_0x42e156(_0x2ee3d8)&&_0xe3e02b(_0x2ee3d8),_0xdf8239);}function ft(_0x4e03d0,_0xeb93f2){return _0x4e03d0&&_0x42e156(_0x4e03d0)?_0x4e03d0['attribs'][_0xeb93f2]:null;}function $e(_0x536662,_0x21cbf6,_0x3c61d7){_0x42e156(_0x536662)&&(null===_0x3c61d7?delete _0x536662['attribs'][_0x21cbf6]:_0x536662['attribs'][_0x21cbf6]=_0x3c61d7);}function Ke(_0x2574d9,_0x5258f3,_0x3b78d8){const _0x181768=_0x5258f3['cloneNode'](!0x0);'beforebegin'===_0x3b78d8?_0x2860b0(_0x2574d9,_0x181768):'afterbegin'===_0x3b78d8?to(_0x2574d9,_0x181768):'beforeend'===_0x3b78d8?_0x5a361c(_0x2574d9,_0x181768):'afterend'===_0x3b78d8&&_0x71c555(_0x2574d9,_0x181768);}function Ge(_0x526a6c){const _0x43d724=[];let _0x146421=_0x526a6c;for(;_0x146421;)_0x146421=_0x4f9327(_0x146421),_0x146421&&_0x43d724['push'](_0x146421);return _0x43d724;}function $n(_0x56fb9d){return _0x56fb9d['replace'](/^\s+/gm,'')['replace'](/\s+$/gm,'')['replace'](/\n*/g,'')['replace'](/\s+/g,'\x20')['replace'](/>\s*</g,'><');}function Pi(_0x8a4ef3){let _0x5c023d=0x0;for(;_0x8a4ef3['parentNode'];)_0x8a4ef3=_0x8a4ef3['parentNode'],_0x5c023d++;return _0x5c023d;}function Gi(_0x3e153d){const _0x4f1f49=[];let _0x172c1e=_0x3e153d['nextSibling'];for(;_0x172c1e;)_0x4f1f49['push'](_0x172c1e),_0x172c1e=_0x172c1e['nextSibling'];_0x4f1f49['forEach'](_0x290c52=>{_0x46c496(_0x290c52);});}class We extends/* #__PURE__ -- @preserve */
|
|
25
|
-
|
|
26
|
-
_0x536028(){['_generateUid'];['_touchedNodesState']={'newIds':[],'modifiedIds':[],'removedIds':[],'invalidIds':[],'lastTouchedId':null};['_existingDataIds']=new Set();constructor(_0x5e01fa){super(),this['_generateUid']=_0x5e01fa||_0x48375a;}['merge'](_0x33589d,_0x532a57,_0x29a574){const _0x2398dc=_0x33589d['cloneNode'](!0x0);if(0x0===_0x532a57['childNodes']['length']){const _0x35856b=[];return ze('data-id','new-element',_0x2398dc)['forEach'](_0x4de793=>{const _0x14af96=this['_generateUid']();$e(_0x4de793,'data-id',_0x14af96),_0x35856b['push'](_0x14af96);}),this['_removeSpecialComments'](_0x2398dc),{'parsedContent':_0x2398dc,'newNodeIds':_0x35856b,'modifiedNodeIds':[],'removedNodeIds':[]};}_0x29a574&&_0x29a574['markUnstableElements']&&this['_markLastTagElementUnstable'](_0x2398dc),this['_touchedNodesState']['newIds']=[],this['_touchedNodesState']['modifiedIds']=[],this['_touchedNodesState']['removedIds']=[],this['_touchedNodesState']['invalidIds']=[],this['_touchedNodesState']['lastTouchedId']=null,this['_existingDataIds']=new Set(ze('data-id',null,_0x532a57)['map'](_0x485122=>ft(_0x485122,'data-id'))['filter'](_0x53e00e=>!!_0x53e00e));let _0xd0c4d5=-0x1,_0x26da28=!0x1;const _0xacd0b1=_0x2398dc['childNodes'],_0x23ac75=Array['from'](_0xacd0b1)['filter'](_0x2d50cf=>!(0x3===_0x2d50cf['nodeType']&&''===Ct(_0x2d50cf)['trim']())),_0x16736a=_0x23ac75['length'];for(let _0x291003=0x0;_0x291003<_0x16736a;_0x291003++){const _0x33b480=_0x23ac75[_0x291003],_0xeb8e0c=_0x23ac75[_0x291003+0x1];if(this['_isNewNode'](_0x33b480)){if(-0x1===_0xd0c4d5&&(_0xd0c4d5=_0x291003),this['_markWrappedElements'](_0x33b480),!this['_isNewNode'](_0xeb8e0c)){const [_0xbf016d,_0x114de2]=this['_findReferenceNode'](_0x33b480,_0x26da28,_0x532a57);if(_0xbf016d){const _0x35b7e9=Array['from'](_0x23ac75)['slice'](_0xd0c4d5,_0x291003+0x1);this['_insertNodes'](_0xbf016d,_0x35b7e9,_0x114de2),_0xd0c4d5=-0x1;}}}else{if(this['_isExistingContentComment'](_0x33b480))_0x26da28=!0x0;else{if(this['_isExistingNode'](_0x33b480)){const _0x54ace3=ft(_0x33b480,'data-id');if(_0x54ace3&&this['_existingDataIds']['has'](_0x54ace3)){const _0x453a37=It('data-id',_0x54ace3,_0x532a57);this['_replaceNode'](_0x453a37,_0x33b480);}if(this['_touchedNodesState']['removedIds']['includes'](_0x54ace3)){const _0x380261=this['_touchedNodesState']['removedIds']['indexOf'](_0x54ace3);this['_touchedNodesState']['removedIds']['splice'](_0x380261,0x1);}}else{if(this['_isDelNode'](_0x33b480)){const _0x23fd35=ft(_0x33b480,'data-id');this['_touchedNodesState']['modifiedIds']['includes'](_0x23fd35)||this['_storeDeletedElementIds'](_0x33b480);}}}}}for(const _0x2a5764 of this['_touchedNodesState']['removedIds']){const _0x2603ca=It('data-id',_0x2a5764,_0x532a57);if(_0x2603ca){if(_0x29a574&&_0x29a574['replaceRemovedWith']){this['_touchedNodesState']['lastTouchedId']=_0x2a5764;const _0x25737e=_0x29a574['replaceRemovedWith']['cloneNode'](!0x0);$e(_0x25737e,'data-id',_0x2a5764),$e(_0x25737e,'data-removed','true'),_0x255b5e(_0x2603ca,_0x25737e);}else _0x46c496(_0x2603ca);}}if(ze('data-wrapped-id',null,_0x532a57)['forEach'](_0x517ac2=>{const _0x4a42d7=It('data-id',ft(_0x517ac2,'data-wrapped-id'),_0x532a57);var _0x20a56e,_0x3f18a8;_0x4a42d7&&(_0x3f18a8=_0x517ac2,_0x46c496(_0x20a56e=_0x4a42d7),_0x255b5e(_0x3f18a8,_0x20a56e));}),ze('data-id','new-element',_0x532a57)['forEach'](_0x15a486=>{const _0x2a8596=this['_getUid'](_0x15a486);$e(_0x15a486,'data-id',_0x2a8596),this['_touchedNodesState']['newIds']['push'](_0x2a8596);}),this['_removeSpecialComments'](_0x532a57),_0x29a574&&_0x29a574['markUnstableElements']&&this['_markUnstableElements'](_0x532a57,_0x29a574['markUnstableElementsDepth']||0x0),_0x29a574&&_0x29a574['cutAfterLastChange']&&this['_touchedNodesState']['lastTouchedId']){let _0x296141=It('data-id',this['_touchedNodesState']['lastTouchedId'],_0x532a57);for(;_0x296141;)Gi(_0x296141),_0x296141=_0x296141['parentNode'];}return{'parsedContent':_0x532a57,'newNodeIds':this['_touchedNodesState']['newIds'],'modifiedNodeIds':this['_touchedNodesState']['modifiedIds'],'removedNodeIds':this['_touchedNodesState']['removedIds']};}['_insertNodes'](_0x4fc7cd,_0xda2a73,_0x5ae855){for(const _0x215c2f of _0xda2a73){const _0x26f049=this['_getUid'](_0x215c2f);$e(_0x215c2f,'data-id',_0x26f049),this['_touchedNodesState']['newIds']['push'](_0x26f049),this['_touchedNodesState']['lastTouchedId']=_0x26f049;}const _0x297dc6='afterbegin'===_0x5ae855||'afterend'===_0x5ae855?_0xda2a73['reverse']():_0xda2a73;for(const _0x29ba3d of _0x297dc6)Ke(_0x4fc7cd,_0x29ba3d,_0x5ae855);}['_replaceNode'](_0x4e0c61,_0xe6a854){if(!_0x4e0c61)return;if(_0x1502b1=_0xe6a854,$n(Ct(_0x4e0c61))===$n(Ct(_0x1502b1)))return;var _0x1502b1;const _0x8e0ff=this['_getUid'](_0x4e0c61);$e(_0xe6a854,'data-id',_0x8e0ff),this['_touchedNodesState']['modifiedIds']['push'](_0x8e0ff),this['_touchedNodesState']['lastTouchedId']=_0x8e0ff,_0x255b5e(_0x4e0c61,_0xe6a854['cloneNode'](!0x0));}['_findReferenceNode'](_0xe3fa1,_0x46e85a,_0x1bdddb){const _0x1dccc4=this['_findPrevElementWithDataId'](_0xe3fa1,!0x1);if(_0x1dccc4){const _0x5e2703=this['_getNodeDataId'](_0x1dccc4),_0x1fa39d=It('data-id',_0x5e2703,_0x1bdddb);if(_0x1fa39d)return[_0x1fa39d,'afterend'];this['_touchedNodesState']['invalidIds']['push'](_0x5e2703);}const _0x2b5355=this['_findNextElementWithDataId'](_0xe3fa1,!0x1);if(_0x2b5355){const _0x327573=this['_getNodeDataId'](_0x2b5355),_0x19e13f=It('data-id',_0x327573,_0x1bdddb);if(_0x19e13f)return[_0x19e13f,'beforebegin'];this['_touchedNodesState']['invalidIds']['push'](_0x327573);}return _0x46e85a?_0xe3fa1['nextSibling']?this['_findFallbackReferenceNode'](_0xe3fa1,_0x1bdddb):[_0x1bdddb['childNodes'][_0x1bdddb['childNodes']['length']-0x1],'afterend']:[_0x1bdddb['childNodes'][0x0],'beforebegin'];}['_findFallbackReferenceNode'](_0x3f502a,_0x39c971){const _0x466787=[],_0x1123bb=this['_findPrevElementWithDataId'](_0x3f502a,!0x0);if(_0x1123bb){const _0x54dba5=It('data-id',this['_getNodeDataId'](_0x1123bb),_0x39c971);_0x54dba5&&_0x466787['push']([_0x54dba5,'afterend']);}const _0x556e65=this['_findNextElementWithDataId'](_0x3f502a,!0x0);if(_0x556e65){const _0x5c8691=It('data-id',this['_getNodeDataId'](_0x556e65),_0x39c971);_0x5c8691&&_0x466787['push']([_0x5c8691,'beforebegin']);}if(_0x466787['length']>0x1)return Pi(_0x466787[0x0][0x0])<=Pi(_0x466787[0x1][0x0])?_0x466787[0x0]:_0x466787[0x1];return 0x1===_0x466787['length']?_0x466787[0x0]:[_0x39c971['lastChild'],'afterend'];}['_findNextElementWithDataId'](_0x38ea9d,_0x24aeaf){let _0x52fc8f=_0x38ea9d['nextSibling'],_0x36802d=null,_0x2fbd00=!0x1;for(;_0x52fc8f;){if(_0x31922d(_0x52fc8f)){if(this['_isDelNode'](_0x52fc8f)&&(_0x36802d=_0x52fc8f),this['_isExistingContentComment'](_0x52fc8f)&&_0x24aeaf&&!_0x2fbd00){_0x2fbd00=!0x0,_0x52fc8f=_0x52fc8f['nextSibling'];continue;}break;}const _0x481c52=ft(_0x52fc8f,'data-id');if(_0x481c52&&'new-element'!==_0x481c52&&this['_existingDataIds']['has'](_0x481c52)){_0x36802d=_0x52fc8f;break;}_0x52fc8f=_0x52fc8f['nextSibling'];}return _0x36802d;}['_findPrevElementWithDataId'](_0x31d568,_0x186801){let _0x18e272=_0x31d568['previousSibling'],_0x16d338=null,_0x185e05=!0x1;for(;_0x18e272;){if(_0x31922d(_0x18e272)){if(this['_isDelNode'](_0x18e272)&&(_0x16d338=_0x18e272),this['_isExistingContentComment'](_0x18e272)&&_0x186801&&!_0x185e05){_0x185e05=!0x0,_0x18e272=_0x18e272['previousSibling'];continue;}break;}const _0x46fc7f=ft(_0x18e272,'data-id');if(_0x46fc7f&&'new-element'!==_0x46fc7f&&this['_existingDataIds']['has'](_0x46fc7f)){_0x16d338=_0x18e272;break;}_0x18e272=_0x18e272['previousSibling'];}return _0x16d338;}['_markWrappedElements'](_0x177e2f){_0x42e156(_0x177e2f)&&ze('data-id',null,_0x177e2f)['forEach'](_0x5bea32=>{this['_isExistingNode'](_0x5bea32)&&!this['_hasWrappedParent'](_0x5bea32)&&($e(_0x5bea32,'data-wrapped-id',ft(_0x5bea32,'data-id')),$e(_0x5bea32,'data-id',null));});}['_getNodeDataId'](_0x13b18e){if(!_0x13b18e)return null;if(_0x42e156(_0x13b18e))return ft(_0x13b18e,'data-id');if(_0x31922d(_0x13b18e)){const _0x5e0b36=Ct(_0x13b18e)['match'](/removed[\s*-]data-id="([^"]+)"/);if(_0x5e0b36&&_0x5e0b36[0x1])return _0x5e0b36[0x1];}return null;}['_storeDeletedElementIds'](_0x22ac2d){if(_0x31922d(_0x22ac2d)){const _0x24aaac=Ct(_0x22ac2d)['match'](/removed[\s*-]data-id="([^"]+)"/);_0x24aaac&&_0x24aaac[0x1]&&this['_touchedNodesState']['removedIds']['push'](_0x24aaac[0x1]);}}['_getUid'](_0x5b6ae5){return this['_isExistingNode'](_0x5b6ae5)?ft(_0x5b6ae5,'data-id'):this['_generateUid']();}['_removeSpecialComments'](_0x3ce8d4){(function(_0x52923a){return _0x3846b4(_0x5e2390=>_0x31922d(_0x5e2390),_0x52923a,!0x0,0x1/0x0);}(_0x3ce8d4)['filter'](_0x2bb23b=>this['_isDelNode'](_0x2bb23b)||this['_isExistingContentComment'](_0x2bb23b))['forEach'](_0x3b8e20=>{_0x46c496(_0x3b8e20);}));}['_markLastTagElementUnstable'](_0x2fbeae){const _0x38f0ab=_0x2fbeae['childNodes'],_0x5aca1f=_0x38f0ab[_0x38f0ab['length']-0x1];_0x5aca1f&&_0x42e156(_0x5aca1f)&&$e(_0x5aca1f,'data-unstable','true');}['_markUnstableElements'](_0x1aca72,_0x230d0c){const _0x2a8bca=It('data-unstable','true',_0x1aca72);if(!_0x2a8bca)return;const _0x135d18=Ge(_0x2a8bca)['slice'](0x0,-0x1),_0x59a2b6=_0x135d18['length'];let _0x1f3700=_0x2a8bca;if(_0x59a2b6>_0x230d0c){let _0x30f27b=_0x59a2b6,_0xbdf4c5=null;for(;_0x30f27b>_0x230d0c&&_0x30f27b>=0x0;)_0x30f27b--,_0xbdf4c5=_0x135d18[_0x30f27b];_0xbdf4c5&&(_0x1f3700=_0xbdf4c5,$e(_0x2a8bca,'data-unstable',null),$e(_0xbdf4c5,'data-unstable','true'));}else{if(_0x59a2b6<_0x230d0c){let _0x2850fd=_0x59a2b6,_0x3130f9=_0x2a8bca;for(;_0x2850fd<_0x230d0c;){const _0x9cad20=_0x3130f9['childNodes']['filter'](_0x1f9eb9=>_0x42e156(_0x1f9eb9));if(0x0===_0x9cad20['length'])break;_0x2850fd++,_0x3130f9=_0x9cad20[_0x9cad20['length']-0x1];}_0x3130f9&&(_0x1f3700=_0x3130f9,$e(_0x2a8bca,'data-unstable',null),$e(_0x3130f9,'data-unstable','true'));}}let _0x1d56d2=_0x1f3700;for(;_0x1d56d2;){for(;_0x1d56d2['nextSibling'];)_0x1d56d2=_0x1d56d2['nextSibling'],_0x42e156(_0x1d56d2)&&$e(_0x1d56d2,'data-unstable','true');_0x1d56d2=_0x1d56d2['parentNode'];}}['_isNewNode'](_0x2ab386){return Boolean('new-element'===ft(_0x2ab386,'data-id'));}['_isExistingNode'](_0x15d81e){return Boolean((ft(_0x15d81e,'data-id')||'')['length']>0x0&&'new-element'!==ft(_0x15d81e,'data-id'));}['_isDelNode'](_0x28aea8){return!!_0x28aea8&&Boolean(_0x31922d(_0x28aea8)&&Ct(_0x28aea8)['match'](/removed[\s*-]data-id="[^"]+"/));}['_hasWrappedParent'](_0x3916d1){let _0x36ddc4=_0x3916d1['parentNode'];for(;_0x36ddc4;){if(ft(_0x36ddc4,'data-wrapped-id'))return!0x0;_0x36ddc4=_0x36ddc4['parentNode'];}return!0x1;}['_isExistingContentComment'](_0x14e075){return Boolean(_0x31922d(_0x14e075)&&Ct(_0x14e075)['match'](/\s*existing[\s*-](content|document)\s*/g));}}const qn=['modification-delta','text-delta'],Qn=['reasoning'];class pe extends _0x536028(){['id'];['interactionId'];['type'];['sources']=[];['parsedContent']=new _t([]);['parsedMergedContent']=new _t([]);['changeGroups']=[];['areActionsDisabled']=!0x1;['documentContextContent'];['aiResponseParser'];['aiResponseApplier'];['editor'];constructor({type:_0x909245,content:_0x455deb='',isDone:_0x136220=!0x1,interactionId:_0x4d4f96,areActionsDisabled:_0x32b6fe,documentContextContent:_0x575bff,editor:_0x198163}){super(),this['id']=_0x48375a(),this['interactionId']=_0x4d4f96,this['type']=_0x909245,this['areActionsDisabled']=!!_0x32b6fe,this['editor']=_0x198163,this['aiResponseParser']=new We(),this['aiResponseApplier']=new qe(),this['documentContextContent']=Oe(_0x575bff||''),this['set']('isDone',_0x136220),this['on']('change:content',()=>{this['onContentChange']();}),this['set']('content',_0x455deb);}['appendContent'](_0x5576a7){this['set']('content',this['content']+_0x5576a7);}['done'](){this['isDone']||(this['set']('isDone',!0x0),this['onContentChange']());}['destroy'](){this['stopListening']();}['setChangeGroupState'](_0x493084,_0x34e592){this['changeGroups'][_0x493084]['state']=_0x34e592,this['fire']('replyChangeGroupStateUpdated',{'reply':this,'index':_0x493084,'state':_0x34e592});}['onContentChange'](){if('modification-delta'===this['type']){this['parsedContent']=this['aiResponseParser']['parseAndNormalizeHTML'](this['content']);const _0x26fd07=this['changeGroups'];this['updateChangeGroups']();const _0x4963b5=this['_getDifferentChangeGroups'](_0x26fd07,this['changeGroups']);(_0x4963b5['length']||this['isDone'])&&this['fire']('replyContentUpdated',this,_0x4963b5);}else this['parsedContent']=this['aiResponseParser']['convertMarkdownToHTML'](this['content']),this['fire']('replyContentUpdated',this);}['_getDifferentChangeGroups'](_0x2b7a0a,_0x223803){const _0x4a70d5=[];for(const _0x3ac396 of _0x223803){const _0x3801a3=_0x2b7a0a[_0x3ac396['index']];_0x3801a3?_0x3801a3['changes']['length']!==_0x3ac396['changes']['length']?_0x4a70d5['push'](_0x3ac396):_0x3801a3['changes']['forEach']((_0x366a34,_0x348986)=>{const _0xf48e24=_0x3ac396['changes'][_0x348986];_0x366a34['id']!==_0xf48e24['id']&&_0x4a70d5['push'](_0x3ac396);}):_0x4a70d5['push'](_0x3ac396);}return _0x4a70d5;}['updateChangeGroups'](){const _0x540a21=new _0x3bc3e5('p',{},[new _0x3bc3e5('span',{'style':'color:\x20#808080;\x20font-style:\x20italic'},[new _0x29195d('Removed\x20content.\x20Use\x20\x22Show\x20changes\x22\x20to\x20learn\x20more.')])]),_0x5ca0d8=this['aiResponseApplier']['merge'](this['parsedContent'],this['documentContextContent']['cloneNode'](!0x0),{'markUnstableElements':!this['isDone'],'replaceRemovedWith':_0x540a21,'cutAfterLastChange':!this['isDone']});if(!_0x5ca0d8['modifiedNodeIds']['length']&&!this['isDone'])return;this['parsedMergedContent']=_0x5ca0d8['parsedContent'];let _0x16d8f7=[];if(_0x28a1af(_0x502ab2=>{const _0x1604ee=ft(_0x502ab2,'data-id');if(!_0x1604ee||!_0xebb9fd(_0x1604ee))return!0x1;const _0x90a049=[_0x502ab2,...Ge(_0x502ab2)]['at'](-0x2);if(_0x502ab2!=_0x90a049){const _0x4f1052=ft(_0x90a049,'data-id');_0xebb9fd(_0x4f1052)||(_0x16d8f7['push']({'node':_0x90a049,'id':_0x4f1052,'type':'modified'}),_0x5ca0d8['modifiedNodeIds']['push'](_0x4f1052));}else _0x5ca0d8['modifiedNodeIds']['includes'](_0x1604ee)?_0x16d8f7['push']({'node':_0x502ab2,'type':'modified','id':_0x1604ee}):_0x5ca0d8['newNodeIds']['includes'](_0x1604ee)?_0x16d8f7['push']({'node':_0x502ab2,'type':'new','id':_0x1604ee,'anchorId':ft(_0x502ab2['previousSibling'],'data-id')}):_0x16d8f7['push']({'node':_0x502ab2,'type':'removed','id':_0x1604ee});return!0x0;},this['parsedMergedContent']),_0x16d8f7=_0x16d8f7['filter'](({node:_0x48551e})=>[...Ge(_0x48551e),_0x48551e]['every'](_0x3b1a2a=>!ft(_0x3b1a2a,'data-unstable'))),0x0==_0x16d8f7['length'])return;const _0x16d923=[[_0x16d8f7[0x0]]];for(let _0x46b705=0x1;_0x46b705<_0x16d8f7['length'];_0x46b705++){const _0x4f1577=_0x16d923[_0x16d923['length']-0x1],_0x3e8668=_0x4f1577[_0x4f1577['length']-0x1];_0x16d8f7[_0x46b705]['node']['previousSibling']==_0x3e8668['node']&&'modified'!=_0x16d8f7[_0x46b705]['type']&&'modified'!=_0x3e8668['type']?_0x4f1577['push'](_0x16d8f7[_0x46b705]):_0x16d923['push']([_0x16d8f7[_0x46b705]]);}for(const _0x3d90a8 of _0x16d923){const _0x27f4bb=_0x3d90a8[0x0],_0x11cd9c=_0x3d90a8[_0x3d90a8['length']-0x1],_0xbbb1e9=_0x36b1a7(_0x27f4bb['node']['previousSibling']);_0xbbb1e9&&_0x3d90a8['unshift'](_0xbbb1e9);const _0x5a61b0=_0x36b1a7(_0x11cd9c['node']['nextSibling']);_0x5a61b0&&_0x3d90a8['push'](_0x5a61b0);}function _0xebb9fd(_0x3fd6c2){return _0x5ca0d8['modifiedNodeIds']['includes'](_0x3fd6c2)||_0x5ca0d8['newNodeIds']['includes'](_0x3fd6c2)||_0x5ca0d8['removedNodeIds']['includes'](_0x3fd6c2);}function _0x36b1a7(_0x4a35d3){if(_0x4a35d3&&ft(_0x4a35d3,'data-id')&&!ft(_0x4a35d3,'data-unstable')){const _0x4cf71a=ft(_0x4a35d3,'data-id');if(!_0xebb9fd(_0x4cf71a))return{'node':_0x4a35d3,'type':'context','id':_0x4cf71a};}return null;}this['changeGroups']=_0x16d923['map']((_0x5b3c81,_0x56a722)=>({'changes':_0x5b3c81,'state':'pending','index':_0x56a722}));}}function Fi(_0x349202){return Object['values'](qn)['includes'](_0x349202);}function Di(_0x22ffd2){return Qn['includes'](_0x22ffd2);}function Ui(_0x5a0212){return'conversation-title'===_0x5a0212;}function qi(_0x907d){return'source'===_0x907d;}const ue=['interactionCreated','interactionStarted','interactionStopped','interactionFinished','interactionDestroyed','replyCreated','replyContentUpdated','replyChangeGroupStateUpdated','setConversationTitle','error'];class me extends _0x5a5836(){['id'];['replies']=[];['currentReply'];['currentRequest'];['connector'];['isStopped']=!0x1;['isDestroyed']=!0x1;['editor'];constructor({connector:_0x322aa2,editor:_0xf1d62e}){super(),this['id']=_0x48375a(),this['connector']=_0x322aa2,this['isStopped']=!0x0,this['editor']=_0xf1d62e;}async['start'](){let _0x37b2bc;this['isStopped']=!0x1;try{this['currentRequest']=await this['sendRequest'](),this['fire']('interactionStarted',this);const _0x2dd14f=await this['currentRequest']['getStream'](),_0xe1dae1=[];for await(const _0x64f507 of _0x2dd14f){if(this['isStopped'])return;if('error'===_0x64f507['event'])return void this['fire']('error',{'error':new _0xa14e6e('ai-chat-interaction-error',this)});Ui(_0x64f507['event'])&&this['setConversationTitle'](_0x64f507['data']['conversationTitle'],!0x0),qi(_0x64f507['event'])?_0xe1dae1['push'](_0x64f507['data']['source']):Fi(_0x64f507['event'])?(_0x64f507['event']!==_0x37b2bc&&(this['currentReply']&&this['currentReply']['done'](),this['currentReply']=this['createReply']({'type':_0x64f507['event'],'interactionId':this['id']}),_0xe1dae1['length']>0x0&&(this['currentReply']['sources']=_0xe1dae1['splice'](0x0)),_0x37b2bc=_0x64f507['event']),this['currentReply']['appendContent'](_0x64f507['data']['textDelta'])):Di(_0x64f507['event'])||_0x49365e('ai-interaction-invalid-event-type',{'chunk':_0x64f507});}}finally{this['isStopped']||(this['_finalizeInteraction'](),this['fire']('interactionFinished',this));}}['stop'](){this['isStopped']||(this['_finalizeInteraction'](),this['fire']('interactionStopped',this));}['getReply'](_0x3bc134){return this['replies']['find'](_0x3992cf=>_0x3992cf['id']===_0x3bc134);}['destroy'](){this['isDestroyed']||(this['stop'](),this['replies']['forEach'](_0x2b26cc=>_0x2b26cc['destroy']()),this['replies']=[],this['isDestroyed']=!0x0,this['fire']('interactionDestroyed',this),this['stopListening']());}['createReply'](_0x54ae98){const _0x58fbef=new pe({'editor':this['editor'],'documentContextContent':this['getDocumentContext']()?.['content'],..._0x54ae98});return this['replies']['push'](_0x58fbef),_0x58fbef['delegate'](...ue)['to'](this),this['fire']('replyCreated',_0x58fbef),_0x58fbef;}['setConversationTitle'](_0x10383a,_0x2486e3=!0x1){this['fire']('setConversationTitle',_0x10383a,_0x2486e3);}['_finalizeInteraction'](){this['isStopped']=!0x0,this['currentRequest']&&this['currentRequest']['abortController']['abort'](),this['currentReply']&&this['currentReply']['done'](),this['currentRequest']=this['currentReply']=void 0x0;}}var de=function(_0x14fb0d){return _0x14fb0d['FILE']='file',_0x14fb0d['DOCUMENT']='document',_0x14fb0d['URL']='web-resource',_0x14fb0d['TEXT']='text',_0x14fb0d['SELECTION']='selection',_0x14fb0d;}({}),Ie=function(_0x2c4e83){return _0x2c4e83['TEXT']='text',_0x2c4e83['MARKDOWN']='markdown',_0x2c4e83['HTML']='html',_0x2c4e83;}({});const wi=['contextItemAdded','contextItemRemoved','contextItemLoadingEnded','contextSent','error','addContextOptionsChanged','sourceResourcesLoaded','resourceStateChanged','uploadProgressChanged'];class mi extends _0x536028(){['_connector'];['_config'];['_ownerId'];constructor({connector:_0x3c407a,config:_0x21317f,ownerId:_0x2e5648}){super(),this['_connector']=_0x3c407a,this['_config']=_0x21317f,this['_ownerId']=_0x2e5648;}['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'](_0x82f75c){const _0x51f212=await this['_createContextItemFromContent'](_0x82f75c);return this['_addToConversationContextItem'](_0x51f212),'current-document'===_0x51f212['uiId']&&this['_toggleAddCurrentDocumentOptionVisibility'](),_0x51f212;}async['_createContextItemFromContent'](_0x336a57){if(_0x336a57['type']===de['DOCUMENT']){const _0x157a2c=await this['_connector']['fetchDocument'](this['_ownerId'],_0x336a57['id'])['getDocument']();return{'id':'current-document','uiId':'current-document','label':'Current\x20document','type':_0x336a57['type'],'content':_0x157a2c['content'],'hidden':this['_conversationContextItems']['has']('current-document'),'version':_0x157a2c['attributes']?.['version'],'sessionId':_0x157a2c['attributes']?.['sessionId']};}return{'id':_0x336a57['id'],'uiId':_0x336a57['id'],'label':_0x336a57['attributes']?.['label']||_0x336a57['name']||_0x336a57['url']||_0x336a57['id'],'type':_0x336a57['type'],..._0x336a57?.['attributes']?.['resourceId']?{'resourceId':_0x336a57['attributes']?.['resourceId']}:{}};}['getSentContextItems'](){return new Map(this['_conversationContextItems']);}['removeFromContext'](_0x32d170){const _0x583cbd=this['_pendingContextItems']['get'](_0x32d170);_0x583cbd?.['isReadOnly']||this['_removeContextItem'](_0x32d170);}['clearPendingContextItems'](){if(0x0===this['_pendingContextItems']['size'])return;for(const _0x4f4dc1 of this['_pendingContextItems']['values']())this['_removeContextItem'](_0x4f4dc1['uiId']);const _0x1c410d=this['_conversationContextItems']['get']('current-document')||this['_pendingContextItems']['get']('current-document');_0x1c410d&&this['_addContextItem']({..._0x1c410d,'isReadOnly':!0x0,'hidden':!0x0});}['addToConversationContext'](_0x36a180){for(const _0x3b4437 of _0x36a180['values']())this['_addToConversationContextItem'](_0x3b4437);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'](_0x491b77){return Array['from'](_0x491b77['values']())['map'](_0x412010=>this['_mapContextItemToRequestData'](_0x412010))['filter'](_0x41a695=>null!==_0x41a695);}async['addFilesToContext'](_0x2bf5c1,_0x49cedc,_0x341fad=de['FILE']){const _0x11c91d='files-'+_0x48375a();this['_startUploadOperation'](_0x11c91d);try{await Promise['all'](_0x2bf5c1['map'](async _0x56d4cd=>{const _0x345192='file-'+_0x48375a(),_0x49a375=_0x5453ce(_0x56d4cd['name']);try{this['_addContextItem']({'type':_0x341fad,'label':_0x49cedc?.['label']||_0x49a375,'uiId':_0x345192,'resourceId':_0x49cedc?.['resourceId']},!0x0);const _0x3d1b77=this['_connector']['uploadFile'](this['_ownerId'],_0x56d4cd,_0x49cedc);this['_ongoingUploads']['set'](_0x345192,_0x3d1b77['abortController']);const {id:_0x4ade05}=await _0x3d1b77['getId']();this['_ongoingUploads']['delete'](_0x345192),this['_finishContextItemLoading']({'type':_0x341fad,'id':_0x4ade05,'label':_0x49cedc?.['label']||_0x49a375,'uiId':_0x345192,'resourceId':_0x49cedc?.['resourceId']},!0x1);}catch(_0x398eed){this['_ongoingUploads']['delete'](_0x345192);if(!_0x398eed['message']['startsWith']('ai-request-aborted')){const _0x2a851a=new _0xa14e6e('ai-chat-file-upload-failed',null,{'fileName':_0x49a375});_0x2a851a['stack']=_0x398eed['stack'],this['fire']('error',{'error':_0x2a851a,'fileName':_0x49a375});}this['_removeContextItem'](_0x345192);}}));}finally{this['_finishUploadOperation'](_0x11c91d);}}['addCurrentDocumentToContext'](_0x25b11d){if(this['isCurrentDocumentInContext']())return;const _0x198982={'type':de['DOCUMENT'],'uiId':'current-document','label':_0x25b11d,'isReadOnly':this['_conversationContextItems']['has']('current-document'),'hidden':this['_conversationContextItems']['has']('current-document')};this['_addContextItem'](_0x198982);}async['updateCurrentDocument'](_0x22af1a,_0x4c8b83,_0x517d8f,_0x5b2833){const _0x161097=this['_pendingContextItems']['get']('current-document');if(_0x161097&&_0x22af1a){_0x161097['selection']=_0x5b2833?_0x5b2833['map'](_0x5e1089=>({'start':_0x5e1089['start'],'end':_0x5e1089['end']})):[];try{if(_0x161097['version']===_0x4c8b83)return;const {id:_0x161793}=await this['_connector']['uploadDocument'](this['_ownerId'],_0x22af1a,{'version':_0x4c8b83,'sessionId':_0x517d8f})['getId']();_0x161097['id']=_0x161793,_0x161097['content']=_0x22af1a,_0x161097['version']=_0x4c8b83,_0x161097['sessionId']=_0x517d8f;}catch(_0x806aae){const _0x3f72ae=new _0xa14e6e('ai-chat-document-upload-failed',null);_0x3f72ae['stack']=_0x806aae['stack'],this['fire']('error',{'error':_0x3f72ae});}}}['addSelectionToContext'](_0x3766ee){this['_addContextItem']({'type':de['SELECTION'],'label':_0x3766ee,'uiId':'selection','content':_0x3766ee});}['removeSelectionFromContext'](){this['_removeContextItem']('selection');}async['addUrlToContext'](_0x305329,_0x11be06){const _0x38e4fd='url-'+_0x48375a();this['_startUploadOperation'](_0x38e4fd);const _0x546510='url-'+_0x48375a();try{this['_addContextItem']({'type':de['URL'],'label':_0x11be06?.['label']||_0x305329,'uiId':_0x546510,'resourceId':_0x11be06?.['resourceId']},!0x0);const _0x376e5e=this['_connector']['uploadUrl'](this['_ownerId'],_0x305329,_0x11be06);this['_ongoingUploads']['set'](_0x546510,_0x376e5e['abortController']);const {id:_0x528280}=await _0x376e5e['getId']();this['_ongoingUploads']['delete'](_0x546510),this['_finishContextItemLoading']({'type':de['URL'],'id':_0x528280,'label':_0x11be06?.['label']||_0x305329,'uiId':_0x546510,'resourceId':_0x11be06?.['resourceId']},!0x1);}catch(_0x63b7d9){this['_ongoingUploads']['delete'](_0x546510),(_0x63b7d9['message']['startsWith']('ai-request-aborted')||this['fire']('error',{'error':new _0xa14e6e('ai-chat-url-upload-failed',this,{'url':_0x305329,'originalError':_0x63b7d9}),'url':_0x305329}),this['_removeContextItem'](_0x546510));}finally{this['_finishUploadOperation'](_0x38e4fd);}}async['loadSourceResources'](_0x424e63,_0x7bbfa0,_0x19cd12){const _0x5c5967=this['_addContextOptionsState']['sources']['find'](_0x4acaee=>_0x4acaee['id']===_0x424e63);if(!_0x5c5967)return this['fire']('error',{'error':new _0xa14e6e('ai-chat-source-not-found',this,{'sourceId':_0x424e63}),'sourceId':_0x424e63}),[];try{const _0x17273d=(await _0x5c5967['getResources'](_0x7bbfa0))['map'](_0x165538=>{const _0x1f9e96=this['_isResourceInContext'](_0x165538['id']);return{..._0x165538,'isInContext':_0x1f9e96};});return _0x5c5967['resources']=_0x17273d,this['fire']('sourceResourcesLoaded',{'sourceId':_0x424e63,'source':_0x5c5967,'resources':_0x17273d,'uid':_0x19cd12}),_0x17273d;}catch(_0x4b8d51){return this['fire']('error',{'error':new _0xa14e6e('ai-chat-source-resources-load-failed',this,{'sourceId':_0x424e63,'originalError':_0x4b8d51}),'sourceId':_0x424e63,'sourceLabel':_0x5c5967['label']}),[];}}async['addResourceToContext'](_0x49cb97,_0xf5ae6){if(this['_isResourceInContext'](_0xf5ae6['id']))return;let _0x5a2f1e=_0xf5ae6['data'];if(!_0x5a2f1e&&_0x49cb97['getData'])try{_0x5a2f1e=await _0x49cb97['getData'](_0xf5ae6['id']);}catch(_0x321159){return void this['fire']('error',{'error':new _0xa14e6e('ai-chat-resource-load-failed',this,{'resourceId':_0xf5ae6['id'],'sourceId':_0x49cb97['id'],'originalError':_0x321159}),'resourceId':_0xf5ae6['id'],'sourceId':_0x49cb97['id']});}if(_0x5a2f1e)switch(_0xf5ae6['type']){case de['URL']:if('string'!=typeof _0x5a2f1e)return void this['fire']('error',{'error':new _0xa14e6e('ai-chat-context-invalid-data',this,{'resourceId':_0xf5ae6['id'],'sourceId':_0x49cb97['id'],'expectedType':'string','actualType':typeof _0x5a2f1e}),'resourceId':_0xf5ae6['id'],'sourceId':_0x49cb97['id']});await this['addUrlToContext'](_0x5a2f1e,{'label':_0xf5ae6['label'],'resourceId':_0xf5ae6['id']});break;case de['FILE']:if(!(_0x5a2f1e instanceof File))return void this['fire']('error',{'error':new _0xa14e6e('ai-chat-context-invalid-data',this,{'resourceId':_0xf5ae6['id'],'sourceId':_0x49cb97['id'],'expectedType':'File','actualType':typeof _0x5a2f1e}),'resourceId':_0xf5ae6['id'],'sourceId':_0x49cb97['id']});await this['addFilesToContext']([_0x5a2f1e],{'label':_0xf5ae6['label'],'resourceId':_0xf5ae6['id']});break;case de['TEXT']:if('object'!=typeof _0x5a2f1e||!('content'in _0x5a2f1e)||!('type'in _0x5a2f1e))return void this['fire']('error',{'error':new _0xa14e6e('ai-chat-context-invalid-data',this,{'resourceId':_0xf5ae6['id'],'sourceId':_0x49cb97['id'],'expectedType':'object\x20with\x20content\x20and\x20type\x20properties','actualType':typeof _0x5a2f1e}),'resourceId':_0xf5ae6['id'],'sourceId':_0x49cb97['id']});_0x5a2f1e=mi['_convertTextResourceToFile'](_0x5a2f1e,_0xf5ae6['label']),await this['addFilesToContext']([_0x5a2f1e],{'label':_0xf5ae6['label'],'resourceId':_0xf5ae6['id']},de['TEXT']);break;default:this['fire']('error',{'error':new _0xa14e6e('ai-chat-context-unsupported-type',this,{'resourceId':_0xf5ae6['id'],'sourceId':_0x49cb97['id'],'resourceType':_0xf5ae6['type']}),'resourceId':_0xf5ae6['id'],'sourceId':_0x49cb97['id']});}else this['fire']('error',{'error':new _0xa14e6e('ai-chat-resource-no-data',this,{'resourceId':_0xf5ae6['id'],'sourceId':_0x49cb97['id']}),'resourceId':_0xf5ae6['id'],'sourceId':_0x49cb97['id']});}static['_convertTextResourceToFile'](_0x46dab8,_0x33b060){switch(_0x46dab8['type']){case Ie['MARKDOWN']:return new File([_0x46dab8['content']],_0x33b060,{'type':'text/markdown'});case Ie['HTML']:return new File([_0x46dab8['content']],_0x33b060,{'type':'text/html'});default:return new File([_0x46dab8['content']],_0x33b060,{'type':'text/plain'});}}static['_mapContextItemToRequestData'](_0x24783c){switch(_0x24783c['type']){case de['FILE']:return{'type':de['FILE'],'id':_0x24783c['id']};case de['URL']:return{'type':de['URL'],'id':_0x24783c['id']};case de['DOCUMENT']:return{'type':de['DOCUMENT'],'id':_0x24783c['id'],..._0x24783c['selection']?.['length']&&{'selection':_0x24783c['selection']}};case de['TEXT']:return{'type':de['FILE'],'id':_0x24783c['id']};default:return null;}}['_addContextItem'](_0x20c16f,_0x52cc1b=!0x1){if(this['_pendingContextItems']['set'](_0x20c16f['uiId'],_0x20c16f),_0x20c16f['hidden']||this['fire']('contextItemAdded',{'contextItem':_0x20c16f,'isLoading':_0x52cc1b}),'current-document'===_0x20c16f['uiId']&&this['_toggleAddCurrentDocumentOptionVisibility'](),_0x20c16f['resourceId']){const _0x2527bc=this['_findSourceIdsByResourceId'](_0x20c16f['resourceId']);_0x2527bc&&_0x2527bc['forEach'](_0x1a735a=>{this['_updateResourceInContextState'](_0x1a735a,_0x20c16f['resourceId'],!0x0);});}}['_removeContextItem'](_0x153aa9){const _0x498e52=this['_pendingContextItems']['get'](_0x153aa9),_0x420c57=this['_ongoingUploads']['get'](_0x153aa9);if(_0x420c57&&(_0x420c57['abort'](),this['_ongoingUploads']['delete'](_0x153aa9)),_0x498e52?.['resourceId']){const _0x457ad2=this['_findSourceIdsByResourceId'](_0x498e52['resourceId']);_0x457ad2&&_0x457ad2['forEach'](_0xe8f5f5=>{this['_updateResourceInContextState'](_0xe8f5f5,_0x498e52['resourceId'],!0x1);});}this['_pendingContextItems']['delete'](_0x153aa9),this['fire']('contextItemRemoved',{'uiId':_0x153aa9,'type':_0x498e52?.['type']}),'current-document'===_0x153aa9&&this['_toggleAddCurrentDocumentOptionVisibility']();}['_finishContextItemLoading'](_0x3e9361,_0x40d4ec){if(this['_pendingContextItems']['has'](_0x3e9361['uiId'])&&(this['_pendingContextItems']['set'](_0x3e9361['uiId'],_0x3e9361),this['fire']('contextItemLoadingEnded',{'contextItem':_0x3e9361,'isLoading':_0x40d4ec}),_0x3e9361['resourceId'])){const _0x411ad9=this['_findSourceIdsByResourceId'](_0x3e9361['resourceId']);_0x411ad9&&_0x411ad9['forEach'](_0x4b22b9=>{this['_updateResourceInContextState'](_0x4b22b9,_0x3e9361['resourceId'],!0x0);});}}['_addToConversationContextItem'](_0x3e8da2){this['_conversationContextItems']['set'](_0x3e8da2['uiId'],_0x3e8da2);}['_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']()},this['fire']('addContextOptionsChanged',{'options':this['_addContextOptionsState']});}['_getCustomSourcesInitialState'](){return this['_config']?.['sources']?.['map'](_0x2b9e8e=>({..._0x2b9e8e,'resources':[]}))??[];}['_toggleAddCurrentDocumentOptionVisibility'](){const _0x5c59b2=this['isCurrentDocumentInContext']()||this['isCurrentDocumentInConversation']();this['_addContextOptionsState']['document']['isHidden']=_0x5c59b2,this['fire']('addContextOptionsChanged',{'options':this['_addContextOptionsState']});}['_isResourceInContext'](_0x4f4a9c){for(const _0x53743f of this['_pendingContextItems']['values']())if(_0x53743f['resourceId']===_0x4f4a9c)return!0x0;for(const _0x47e7c4 of this['_conversationContextItems']['values']())if(_0x47e7c4['resourceId']===_0x4f4a9c)return!0x0;return!0x1;}['_findSourceIdsByResourceId'](_0x46e721){const _0x357faf=[];for(const _0x228f8f of this['_addContextOptionsState']['sources']){_0x228f8f['resources']['find'](_0x35100a=>_0x35100a['id']===_0x46e721)&&_0x357faf['push'](_0x228f8f['id']);}return 0x0===_0x357faf['length']?null:_0x357faf;}['_updateResourceInContextState'](_0x110ffc,_0xd14827,_0x4d3650){const _0x2713fb=this['_addContextOptionsState']['sources']['find'](_0x2afb2f=>_0x2afb2f['id']===_0x110ffc);if(!_0x2713fb)return;const _0x306d4a=_0x2713fb['resources']['find'](_0x14d857=>_0x14d857['id']===_0xd14827);_0x306d4a&&(_0x306d4a['isInContext']=_0x4d3650,this['fire']('resourceStateChanged',{'sourceId':_0x110ffc,'resourceId':_0xd14827,'isInContext':_0x4d3650}));}['_startUploadOperation'](_0x3b11e6){this['_ongoingUploadOperations']['set'](_0x3b11e6,!0x0),this['_ongoingUploadOperations']['size']&&this['fire']('uploadProgressChanged',{'isUploadInProgress':!0x0});}['_finishUploadOperation'](_0xf7eabb){this['_ongoingUploadOperations']['delete'](_0xf7eabb),0x0===this['_ongoingUploadOperations']['size']&&this['fire']('uploadProgressChanged',{'isUploadInProgress':!0x1});}}const Ii=['capabilitiesUpdated'];class vi extends _0x5a5836(){['_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'](_0x4bfb19){const _0x239e0e={};return _0x4bfb19&&_0x4bfb19['isWebSearchEnabled']&&(_0x239e0e['webSearch']={}),_0x4bfb19&&_0x4bfb19['isReasoningEnabled']&&(_0x239e0e['reasoning']={}),_0x239e0e;}['toggleWebSearch'](){this['setWebSearch'](!this['_isWebSearchEnabled']);}['toggleReasoning'](){this['setReasoning'](!this['_isReasoningEnabled']);}['setWebSearch'](_0x45ed4b){_0x45ed4b!==this['_isWebSearchEnabled']&&(this['_isWebSearchEnabled']=_0x45ed4b,this['fire']('capabilitiesUpdated',this['getCapabilitiesConfig']()));}['setReasoning'](_0x1d1a1b){_0x1d1a1b!==this['_isReasoningEnabled']&&(this['_isReasoningEnabled']=_0x1d1a1b,this['fire']('capabilitiesUpdated',this['getCapabilitiesConfig']()));}}class fi extends me{['userMessage'];['conversationId'];['contextItems']=new Map();['model'];['quickActionData'];constructor(_0x43f1d5){super(_0x43f1d5),this['conversationId']=_0x43f1d5['conversationId'],this['contextItems']=_0x43f1d5['contextItems'],this['capabilities']=_0x43f1d5['capabilities'],this['userMessage']=_0x43f1d5['userMessage'],this['model']=_0x43f1d5['model'],this['quickActionData']=_0x43f1d5['quickActionData'];}async['sendRequest'](){return this['connector']['queryAssistant']({'message':this['userMessage'],'conversationId':this['conversationId'],'parts':mi['mapContextItemsToRequestData'](this['contextItems']),'capabilities':vi['getCapabilitiesRequestData'](this['capabilities']),'model':this['model'],'quickActionData':this['quickActionData']});}['getDocumentContext'](){return this['contextItems']['get']('current-document');}}class ct extends _0x5a5836(){['id'];['isStarted']=!0x1;['interactions']=[];['currentInteraction'];['selectedModel'];['connector'];['options'];constructor(_0x1a5826){super(),this['options']=_0x1a5826,this['connector']=_0x1a5826['connector'],this['chatModels']=_0x1a5826['chatModels'],this['id']=_0x1a5826['conversationId'];}async['init'](_0x2b34b1){try{this['chatContext']=new mi({'connector':this['connector'],'config':_0x2b34b1,'ownerId':this['id']}),this['chatContext']['delegate'](...wi)['to'](this),this['chatContext']['init'](),this['chatCapabilities']=new vi(),this['chatCapabilities']['delegate'](...Ii)['to'](this),this['chatCapabilities']['init']();const _0x226f05=await this['chatModels']['getAll']();this['fire']('conversationInitialized',{'availableModels':_0x226f05});const _0x47c3da=await this['chatModels']['getDefault'](this['options']['defaultModelId']);_0x47c3da&&await this['setModel'](_0x47c3da);}catch(_0x429563){const _0x4aacd6=new _0xa14e6e('ai-chat-conversation-init-failed',null,{'message':_0x429563['message']});_0x4aacd6['stack']=_0x429563['stack'],this['fire']('error',{'error':_0x4aacd6});}}async['start'](){if(this['isStarted'])throw new _0xa14e6e('ai-chat-conversation-already-started',null,{'conversation':this});if(!this['selectedModel'])throw new _0xa14e6e('ai-chat-conversation-start-no-model-selected',null,{'conversation':this});try{const {id:_0x13691a}=await this['connector']['startConversation'](this['id'],this['options']['group'])['getConversation']();this['id']=_0x13691a,this['isStarted']=!0x0,this['fire']('conversationStarted',{'conversationId':this['id'],'selectedModel':this['selectedModel']});}catch(_0x3641c7){const _0x29a0a6=new _0xa14e6e('ai-chat-conversation-start-failed',null,{'message':_0x3641c7['message']});_0x29a0a6['stack']=_0x3641c7['stack'],this['fire']('error',{'error':_0x29a0a6});}}async['load'](_0xbd3752,_0x331940){try{const _0xec63c4=await this['connector']['fetchConversation'](_0xbd3752)['getConversation'](),_0x202b2d=await this['connector']['fetchConversationMessages'](_0xbd3752)['getMessages'](),_0x56a7b8=_0x202b2d[0x0]['model'];this['isStarted']=!0x0,this['id']=_0xec63c4['id'],'title'in _0xec63c4?this['fire']('setConversationTitle',_0xec63c4['title'],!0x0):this['fire']('setConversationTitle','',!0x0);const _0x2feec3=(await this['chatModels']['getAll']())['find'](_0x33ce14=>_0x33ce14['id']['toLowerCase']()===_0x56a7b8['toLowerCase']());return this['selectedModel']=_0x2feec3,this['fire']('modelSelected',{'selectedModel':_0x2feec3,'isDisabled':!0x0}),await this['_processMessagesToInteractions'](_0x202b2d,_0x331940,_0x56a7b8),this['currentInteraction']=void 0x0,this;}catch(_0x50dc5c){const _0x9e02b5=new _0xa14e6e('ai-chat-conversation-init-from-id-failed',null,{'message':_0x50dc5c['message'],'conversationId':_0xbd3752});throw _0x9e02b5['stack']=_0x50dc5c['stack'],this['fire']('error',{'error':_0x9e02b5}),_0x9e02b5;}}async['_processMessagesToInteractions'](_0x17ef35,_0x2518af,_0x88b47b){let _0x5a961d;for(const _0x3aaf2d of _0x17ef35)if('user'===_0x3aaf2d['role']){const _0x192b60=await this['_extractContextItems'](_0x3aaf2d),_0x29ea40={'isReasoningEnabled':Object['hasOwn'](_0x3aaf2d['capabilities'],'reasoning'),'isWebSearchEnabled':Object['hasOwn'](_0x3aaf2d['capabilities'],'webSearch')};_0x5a961d=this['createInteraction']({'userMessage':_0x3aaf2d['prompt'],'contextItems':_0x192b60,'capabilities':_0x29ea40,'modelId':_0x88b47b,'quickActionData':_0x3aaf2d['attributes']?.['quickActionData']}),this['currentInteraction']=_0x5a961d,this['chatContext']['addToConversationContext'](this['currentInteraction']['contextItems']);}else{if('assistant'===_0x3aaf2d['role']&&_0x5a961d)for(const _0x37c2be of _0x3aaf2d['content']){const _0x2c4a52='text'===_0x37c2be['type']?'text-delta':'modification-delta',_0x52d1fa=_0x5a961d['getDocumentContext']()?.['sessionId']!==_0x2518af;_0x5a961d['currentReply']=_0x5a961d['createReply']({'type':_0x2c4a52,'isDone':!0x0,'interactionId':_0x5a961d['id'],'areActionsDisabled':_0x52d1fa}),_0x5a961d['currentReply']['appendContent'](_0x37c2be['content']);}}}async['_extractContextItems'](_0xc6df03){const _0x5845d9=new Map();if(!_0xc6df03['content'])return _0x5845d9;for(const _0xe8429c of _0xc6df03['content']){const _0x26a7b3=await this['chatContext']['populateFromMessage'](_0xe8429c);_0x26a7b3&&_0x5845d9['set'](_0x26a7b3['id'],_0x26a7b3);}return _0x5845d9;}async['handleUserInteraction']({userMessage:_0x73e857,quickActionData:_0x3e6526}){if(!this['isStarted'])throw new _0xa14e6e('ai-chat-handle-user-conversation-not-initialized',null,{'conversation':this});if(this['currentInteraction'])throw new _0xa14e6e('ai-chat-handle-user-interaction-already-in-progress',null,{'conversation':this});try{const _0x126bc6=this['chatContext']['getPendingContextItems'](),_0x3fab79=this['chatCapabilities']['getCapabilitiesConfig'](),_0x317ec7=this['selectedModel']['id'];this['currentInteraction']=this['createInteraction']({'userMessage':_0x73e857,'contextItems':_0x126bc6,'capabilities':_0x3fab79,'modelId':_0x317ec7,'quickActionData':_0x3e6526}),await this['currentInteraction']['start'](),this['chatContext']['addToConversationContext'](this['currentInteraction']['contextItems']);}catch(_0x42e9ad){this['fire']('error',{'interactionId':this['currentInteraction']?this['currentInteraction']['id']:void 0x0,'error':_0x42e9ad});}finally{this['currentInteraction']?.['stop'](),this['currentInteraction']=void 0x0;}}['createInteraction']({userMessage:_0x2f84ad,contextItems:_0x51b912,capabilities:_0x2d711e,modelId:_0x381a0f,quickActionData:_0x2e9441}){const _0x59da33=new fi({'userMessage':_0x2f84ad,'contextItems':_0x51b912,'capabilities':_0x2d711e,'conversationId':this['id'],'connector':this['connector'],'editor':this['options']['getEditor']&&this['options']['getEditor'](),'model':_0x381a0f,'quickActionData':_0x2e9441});return _0x59da33['delegate'](...ue)['to'](this),this['interactions']['push'](_0x59da33),this['fire']('interactionCreated',_0x59da33),_0x59da33;}['getInteraction'](_0x47cce2){return this['interactions']['find'](_0xc0bf30=>_0xc0bf30['id']===_0x47cce2);}['removeInteraction'](_0x2f48ae){const _0x500a1f=this['getInteraction'](_0x2f48ae);_0x500a1f&&(_0x500a1f['destroy'](),this['interactions']['splice'](this['interactions']['indexOf'](_0x500a1f),0x1));}get['lastInteraction'](){return this['interactions'][this['interactions']['length']-0x1];}['addCurrentDocumentToContext'](_0x180bad){this['chatContext']['addCurrentDocumentToContext'](_0x180bad);}async['updateCurrentDocumentInContext']({content:_0x575461,version:_0x447857,sessionId:_0x3f137b,selections:_0x58cc4e}){await this['chatContext']['updateCurrentDocument'](_0x575461,_0x447857,_0x3f137b,_0x58cc4e);}['getCurrentDocumentContext'](){return this['currentInteraction']?.['getDocumentContext']()?.['content']||'';}['addSelectionToContext'](_0x4fd54c){this['chatContext']['addSelectionToContext'](_0x4fd54c);}['removeSelectionFromContext'](){this['chatContext']['removeSelectionFromContext']();}['addFilesToContext'](_0x5a8f51){this['chatContext']['addFilesToContext'](_0x5a8f51);}['addUrlToContext'](_0x32f474){this['chatContext']['addUrlToContext'](_0x32f474);}['addResourceToContext'](_0x5ce8ee,_0x137443){this['chatContext']['addResourceToContext'](_0x5ce8ee,_0x137443);}['loadSourceResources'](_0x43faaa,_0x377dfe,_0x5a43d2){return this['chatContext']['loadSourceResources'](_0x43faaa,_0x377dfe,_0x5a43d2);}['removeFromContext'](_0x52d9c1){this['chatContext']['removeFromContext'](_0x52d9c1);}['toggleWebSearch'](){this['chatCapabilities']['toggleWebSearch']();}['toggleReasoning'](){this['chatCapabilities']['toggleReasoning']();}['isCurrentDocumentInContext'](){return this['chatContext']['isCurrentDocumentInContext']();}['isCurrentDocumentInConversation'](){return this['chatContext']['isCurrentDocumentInConversation']();}['isSelectionInContext'](){return this['chatContext']['isSelectionInContext']();}async['setModel'](_0x252347){if(!_0x252347)throw new _0xa14e6e('ai-chat-conversation-set-model-null',null,{'conversation':this});if(!0x1===await this['chatModels']['isAvailable'](_0x252347))throw new _0xa14e6e('ai-chat-conversation-set-model-not-available',null,{'conversation':this,'model':_0x252347});_0x252347['id']!==this['selectedModel']?.['id']&&(this['selectedModel']=_0x252347,this['chatCapabilities']['reset'](),this['fire']('modelSelected',{'selectedModel':_0x252347}));}}function it(_0x35e776){if(_0x35e776 instanceof ot)return _0x35e776;if(_0x35e776?.['editors']&&_0x35e776['editors']['get'](0x0))return _0x35e776['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.'),_0x35e776['editors']['get'](0x0);throw new _0xa14e6e('ai-get-editor-from-context-no-editor');}const dt='ai-selection';class a extends _0x3cc6c1{['_displayedFakeSelectionId']=null;['_displayedFakeSelectionLocked']=!0x1;['_sessionId'];static get['pluginName'](){return'AIEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}get['sessionId'](){if(!this['_sessionId']){const _0x37f22f=it(this['context']),_0x324827=_0x37f22f['plugins']['has']('RealTimeCollaborationClient')&&_0x37f22f['plugins']['get']('RealTimeCollaborationClient')['sessionId'];this['_sessionId']=_0x324827||_0x48375a();}return this['_sessionId'];}['getDocumentData'](){const _0x278c1b=it(this['context']),_0x2f095a=_0x278c1b['model'],_0x33c16f=_0x278c1b['data']['toView'](_0x2f095a['document']['getRoot'](),{'convertAiChatSelectionMarker':!0x0}),_0x3ab656=new kt(_0x278c1b['editing']['view']['document']);this['_setDataIdsOnChildren'](_0x33c16f,_0x3ab656);let _0x2ab1db=_0x278c1b['data']['processor']['toData'](_0x33c16f);const _0x122349=this['_getMarkersInDocumentOrder'](),_0x4f9e4d=[];for(const _0x84255a of _0x122349){const _0x273fff='<'+_0x84255a['name']+':start></'+_0x84255a['name']+':start>',_0x3ac191=_0x2ab1db['indexOf'](_0x273fff);_0x2ab1db=_0x2ab1db['substring'](0x0,_0x3ac191)+_0x2ab1db['substring'](_0x3ac191+_0x273fff['length']);const _0x4879c1='<'+_0x84255a['name']+':end></'+_0x84255a['name']+':end>',_0x4a0b98=_0x2ab1db['indexOf'](_0x4879c1);_0x2ab1db=_0x2ab1db['substring'](0x0,_0x4a0b98)+_0x2ab1db['substring'](_0x4a0b98+_0x4879c1['length']),_0x4f9e4d['push']({'markerName':_0x84255a['name'],'start':_0x3ac191,'end':_0x4a0b98,'htmlFragment':_0x2ab1db['substring'](_0x3ac191,_0x4a0b98)});}return{'content':_0x2ab1db,'version':_0x278c1b['model']['document']['version'],'sessionId':this['sessionId'],'selections':_0x4f9e4d};}async['afterInit'](){this['context']instanceof ot?this['_integrateEditor'](this['context']):this['listenTo'](this['context']['editors'],'add',(_0x498782,_0x2d03f1)=>{_0x2d03f1['on']('ready',()=>{this['_integrateEditor'](_0x2d03f1);});});}['_integrateEditor'](_0x39f525){_0x39f525['conversion']['for']('editingDowncast')['markerToHighlight']({'model':dt,'view':{'classes':['ck-fake-ai-selection','ck-ai-assistant-ui_theme'],'priority':0xc}}),_0x39f525['conversion']['for']('dataDowncast')['markerToElement']({'model':dt,'view':(_0x5b7eb4,{writer:_0x577094,options:_0x5bc19d})=>_0x5bc19d['convertAiChatSelectionMarker']?_0x577094['createUIElement'](_0x5b7eb4['markerName']+':'+(_0x5b7eb4['isOpening']?'start':'end')):null});}['showFakeVisualSelection'](_0x2ef3c5,_0x3034b0,_0x2f68ad=!0x1,_0x5446d4=!0x1){if(this['_displayedFakeSelectionLocked']&&!_0x5446d4)return!0x1;this['_displayedFakeSelectionId']&&this['hideFakeVisualSelection'](this['_displayedFakeSelectionId']),this['_displayedFakeSelectionId']=_0x3034b0,this['_displayedFakeSelectionLocked']=_0x2f68ad;const _0x36cd7a=it(this['context'])['model'];return _0x36cd7a['change'](_0x1f0d2d=>{let _0x415e1b=0x0;for(let _0x5656df of _0x2ef3c5){const _0x302066=dt+':'+_0x415e1b;if(_0x5656df['start']['isAtEnd']){const _0x7b646=_0x5656df['start']['getLastMatchingPosition'](({item:_0x119d6d})=>!_0x36cd7a['schema']['isContent'](_0x119d6d),{'boundaries':_0x5656df});_0x5656df=_0x1f0d2d['createRange'](_0x7b646,_0x5656df['end']);}_0x1f0d2d['addMarker'](_0x302066,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x5656df}),_0x415e1b++;}}),window['getSelection']()?.['removeAllRanges'](),!0x0;}['hideFakeVisualSelection'](_0x3ce130){if(this['_displayedFakeSelectionId']!=_0x3ce130)return!0x1;this['_displayedFakeSelectionId']=null,this['_displayedFakeSelectionLocked']=!0x1;const _0x49ce88=it(this['context']),_0x2fd399=_0x49ce88['model']['markers']['getMarkersGroup'](dt);return _0x49ce88['model']['change'](_0x5c5722=>{for(const _0x21c427 of _0x2fd399)_0x5c5722['removeMarker'](_0x21c427);}),!0x0;}['modelToViewWithIds'](_0x279285){const _0x35317d=it(this['context']),_0x2062d1=_0x35317d['data']['toView'](_0x279285),_0xc7ee85=new kt(_0x35317d['editing']['view']['document']);return this['_setDataIdsOnChildren'](_0x2062d1,_0xc7ee85),_0x2062d1;}['_setDataIdsOnChildren'](_0x2922e5,_0x3a217f){let _0x49d661=!0x1;const _0xe31070=new Set();for(const _0x5ea6bd of _0x2922e5['getChildren']()){const _0x46f922=_0x5ea6bd['is']('emptyElement')||_0x5ea6bd['is']('containerElement');if(!_0x5ea6bd['is']('element'))continue;(this['_setDataIdsOnChildren'](_0x5ea6bd,_0x3a217f)||_0x46f922)&&(_0x3a217f['setAttribute']('data-id',this['_nextDataId'](_0xe31070),_0x5ea6bd),_0x49d661=!0x0);}return _0x49d661;}['_nextDataId'](_0x32bd8f){let _0x58149e;do{_0x58149e='';for(let _0x524746=0x0;_0x524746<0x4;_0x524746++)_0x58149e+=String['fromCharCode'](0x61+Math['floor'](0x1a*Math['random']()));}while(_0x32bd8f['has'](_0x58149e));return _0x32bd8f['add'](_0x58149e),_0x58149e;}['getSelectionText'](){const {model:_0x37dbea}=it(this['context']),_0x4d5863=_0x37dbea['document']['selection'],_0xf1bf0f=_0x37dbea['getSelectedContent'](_0x4d5863),_0xf5b02f=[],_0x31126f=_0x37dbea['createRangeIn'](_0xf1bf0f)['getWalker']();for(const {item:_0x33b00e}of _0x31126f)_0x33b00e['is']('$textProxy')?_0xf5b02f['push'](_0x33b00e['data']):_0x33b00e['is']('element')&&_0xf5b02f['length']>0x0&&'\x20'!==_0xf5b02f[_0xf5b02f['length']-0x1]&&_0xf5b02f['push']('\x20');return'\x22'+_0xf5b02f['join']('')['trim']()+'\x22';}['_getMarkersInDocumentOrder'](){const _0x95c3b0=it(this['context'])['model'];return Array['from'](_0x95c3b0['markers']['getMarkersGroup'](dt))['sort']((_0x10116e,_0x52e615)=>_0x10116e['getStart']()['isBefore'](_0x52e615['getStart']())?-0x1:_0x10116e['getStart']()['isAfter'](_0x52e615['getStart']())?0x1:0x0);}}class lt extends _0x5a5836(){['_modelList']=[];['_connector'];constructor({connector:_0x4aae29}){super(),this['_connector']=_0x4aae29;}async['getAll'](){if(!this['_modelList']['length']){const _0x3d6923=this['_connector']['getModels'](),_0x445c89=(await _0x3d6923['list']())['items']['sort']((_0x49f505,_0x46584e)=>{const _0x3e2803=Object['values'](_0x49f505['capabilities'])['filter'](_0x3a25cb=>_0x3a25cb['enabled'])['length'];return Object['values'](_0x46584e['capabilities'])['filter'](_0x4d310c=>_0x4d310c['enabled'])['length']-_0x3e2803;});this['_modelList']=_0x445c89;}return this['_modelList'];}async['getDefault'](_0x5d298f){const _0x681b08=await this['getAll']();if(!_0x681b08['length'])return null;if(_0x5d298f){const _0x51fca1=_0x681b08['find'](_0x35a2dc=>_0x35a2dc['id']===_0x5d298f);if(_0x51fca1)return _0x51fca1;_0x49365e('ai-chat-default-model-id-unrecognized',{'defaultModelId':_0x5d298f,'fallBackModelId':_0x681b08[0x0]['id']});}return _0x681b08[0x0];}async['isAvailable'](_0x57683f){return(await this['getAll']())['some'](_0x1b0c91=>_0x1b0c91['name']===_0x57683f['name']&&_0x1b0c91['provider']===_0x57683f['provider']);}}function w({editor:_0xf5b04e,interaction:_0x280503,reply:_0x5f2cb5,groups:_0x581d5d,transform:_0x2d5244,documentCompare:_0x1d917c,documentCompareOptions:_0x5d13fe}){const _0x321e81=_0x280503['getDocumentContext']();if(!_0x321e81)return[];const _0x17916b=_0x321e81['content'],_0x285e47=_0x321e81['version'],_0x4b241c=_0x5f2cb5['documentContextContent']['cloneNode'](!0x0);for(const {changes:_0x16589b}of _0x581d5d){const _0xea9960=_0x16589b['filter'](_0x318d0e=>'new'!=_0x318d0e['type'])['map'](_0xb0e332=>It('data-id',_0xb0e332['id'],_0x4b241c)),_0x14e328=_0x16589b['filter'](_0x498687=>'removed'!=_0x498687['type'])['map'](_0x3f47d0=>_0x3f47d0['node']['cloneNode'](!0x0));let _0x16f842=null;if(_0xea9960['length']){_0x16f842=_0xea9960[0x0]['previousSibling'];for(let _0x50b0fe=0x0;_0x50b0fe<_0xea9960['length'];_0x50b0fe++)_0x46c496(_0xea9960[_0x50b0fe]);}if(_0x14e328['length']){_0x16f842||(_0x16589b[0x0]['anchorId']?_0x16f842=It('data-id',_0x16589b[0x0]['anchorId'],_0x4b241c):(_0x16f842=_0x14e328['shift'](),to(_0x4b241c,_0x16f842)));for(let _0x4e0f0f=0x0;_0x4e0f0f<_0x14e328['length'];_0x4e0f0f++)_0x71c555(_0x16f842,_0x14e328[_0x4e0f0f]),_0x16f842=_0x14e328[_0x4e0f0f];}}const _0x450076=Ct(_0x4b241c),_0x8e895a=_0x1d917c['getDiff'](_0x17916b,_0x450076,_0x5d13fe)['getOperations']();if(_0x2d5244){const _0x16159c=_0xf5b04e['model']['document']['history']['getOperations'](_0x285e47),_0x38e52a={'document':_0xf5b04e['model']['document'],'useRelations':!0x1,'padWithNoOps':!0x1};return _0x59901f(_0x8e895a,_0x16159c,_0x38e52a)['operationsA'];}return _0x8e895a;}function p({editor:_0x428e05,changeGroups:_0x543d63,documentContextContent:_0x4e1169,showDiff:_0xff546a,trimUnchanged:_0x208f5d=!0x0}){return _0x543d63['map'](_0x4b0d3d=>{const _0x162f69=new _t([]),_0x54871b=new _t([]);for(const _0x553354 of _0x4b0d3d['changes'])if(_0xff546a&&'removed'==_0x553354['type']||_0x54871b['children']['push'](_0x553354['node']['cloneNode'](!0x0)),'new'!=_0x553354['type']&&(_0xff546a||'removed'!=_0x553354['type'])){const _0x28a971=mt(_0x66ea63=>ft(_0x66ea63,'data-id')==_0x553354['id'],_0x4e1169,!0x0);_0x28a971&&_0x162f69['children']['push'](_0x28a971['cloneNode'](!0x0));}const {content:_0x15dd83,hasChanges:_0x3f02f6}=function(_0xd9bffd,_0x55dfc2,_0x324aaf,_0x9a14d,_0x1693c6=!0x0){const _0x3b75d5=_0xd9bffd['plugins']['get']('DocumentCompare'),_0x6b28a4=_0xd9bffd['plugins']['get']('TrackChangesEditing'),_0x3c9efc=Ct(_0x55dfc2),_0x2304c4=Ct(_0x324aaf),_0x4d1bb6=_0xd9bffd['data']['parse'](_0x3c9efc,'$root'),_0x48e679=_0xd9bffd['model']['createPositionAt'](_0x4d1bb6,0x0),_0x50486d=_0x3b75d5['getDiff'](_0x3c9efc,_0x2304c4,{'anchor':_0x48e679,'markDeletions':_0x9a14d}),_0x4dbcd1=_0x50486d['getOperations']();if(0x0==_0x4dbcd1['length'])return{'content':_0x55dfc2['cloneNode'](!0x0),'hasChanges':!0x1};_0x9a14d?_0x6b28a4['_applyOperationsAsSuggestions'](_0x4dbcd1):_0xd9bffd['model']['change'](_0x1e5ba2=>{for(const _0x35da83 of _0x4dbcd1)if('remove'==_0x35da83['type']){const _0x2f658e=_0x35da83['sourcePosition'],_0x2e61a8=_0x35da83['howMany'],_0x37bfd3=new _0x3d4b6d(_0x2f658e,_0x2e61a8);_0x1e5ba2['batch']['addOperation'](_0x37bfd3),_0xd9bffd['model']['applyOperation'](_0x37bfd3);}else _0x35da83['baseVersion']=null,_0x35da83['isDocumentOperation']=!0x1,_0x1e5ba2['batch']['addOperation'](_0x35da83),_0xd9bffd['model']['applyOperation'](_0x35da83);});if(_0x1693c6){const _0x1eca49=ut(_0xd9bffd,_0x4dbcd1,_0x4d1bb6);pt(_0xd9bffd['model'],_0x1eca49),function(_0x482231,_0x5a2b1f){const _0x5b6124=_0x5a2b1f['getFirstRange']()['start'];let _0x2fc30f=_0x5a2b1f['getFirstRange']()['end'];const _0x258a47=_0x5b6124['root'];(_0x2fc30f['textNode']||_0x2fc30f['nodeAfter']&&_0x2fc30f['nodeAfter']['is']('$text'))&&(_0x53727c(_0x2fc30f,'...'),_0x2fc30f=_0x2fc30f['getShiftedBy'](0x3)),(_0x5b6124['textNode']||_0x5b6124['nodeBefore']&&_0x5b6124['nodeBefore']['is']('$text'))&&(_0x53727c(_0x5b6124,'...'),function(_0x4f98f7,_0x4212c7,_0x2e33ee){for(let [_0x335f24,_0x319660]of _0x4f98f7['markers']){const _0x4a0bc6=_0x319660['_getTransformedByInsertion'](_0x4212c7,_0x2e33ee,!0x1);_0x319660=_0x4a0bc6[0x0],_0x4f98f7['markers']['set'](_0x335f24,_0x319660);}}(_0x258a47,_0x5b6124,0x3),_0x5b6124['parent']==_0x2fc30f['parent']&&(_0x2fc30f=_0x2fc30f['getShiftedBy'](0x3)));const _0x1beacd=_0x482231['createRange'](_0x482231['createPositionAt'](_0x258a47,0x0),_0x5b6124),_0xdbfa46=_0x482231['createRange'](_0x2fc30f,_0x482231['createPositionAt'](_0x258a47,'end')),_0x4b9b43=[..._0x1beacd['getMinimalFlatRanges'](),..._0xdbfa46['getMinimalFlatRanges']()];_0x4b9b43['reverse']();for(const _0x486255 of _0x4b9b43)_0x2cbe1c(_0x486255),Xn(_0x258a47,_0x486255);}(_0xd9bffd['model'],_0x1eca49);}const _0x29cff1=_0xd9bffd['data']['stringify'](_0x4d1bb6,{'showSuggestionHighlights':!0x0});return{'content':Oe(_0x29cff1),'hasChanges':!0x0};}(_0x428e05,_0x162f69,_0x54871b,_0xff546a,_0x208f5d);return{'type':_0x4b0d3d['changes'][0x0]['type'],'index':_0x4b0d3d['index'],'content':_0x15dd83,'hasChanges':_0x3f02f6};});}function ut(_0x5cf00e,_0x555cc7,_0x308c2c){const _0x25c7ee=_0x5cf00e['plugins']['get']('DocumentCompare');let _0x48ca53=_0x5cf00e['model']['createPositionAt'](_0x308c2c,Number['POSITIVE_INFINITY']),_0x21b2f0=_0x5cf00e['model']['createPositionAt'](_0x308c2c,0x0);for(const _0x56f299 of _0x555cc7){let _0x21a2b9,_0x9381b1;if(_0x25c7ee['isMarkedRemoveOperation'](_0x56f299))_0x21a2b9=_0x56f299['newRange']['start'],_0x9381b1=_0x56f299['newRange']['end'];else switch(_0x56f299['type']){case'rename':_0x21a2b9=_0x56f299['position'],_0x9381b1=_0x21a2b9['getShiftedBy'](0x1);break;case'addAttribute':case'removeAttribute':case'changeAttribute':_0x21a2b9=_0x56f299['range']['start'],_0x9381b1=_0x56f299['range']['end'];break;case'insert':_0x21a2b9=_0x56f299['position'],_0x9381b1=_0x21a2b9['getShiftedBy'](_0x56f299['howMany']);break;case'split':_0x21a2b9=_0x56f299['splitPosition'],_0x9381b1=_0x56f299['moveTargetPosition'];break;case'merge':{const _0x51800e=_0x56f299['targetPosition']['path']['slice'](-0x1);_0x21a2b9=_0x5cf00e['model']['createPositionFromPath'](_0x308c2c,_0x51800e),_0x9381b1=_0x21a2b9['getShiftedBy'](0x1);break;}case'remove':{const _0x13f4a3=_0x56f299['howMany'],_0x2604ac=_0x56f299['sourcePosition']['_getTransformedByInsertion'](_0x56f299['targetPosition'],_0x13f4a3),_0x26ae84=_0x56f299['getMovedRangeStart']();'remove'==_0x56f299['type']?(_0x21a2b9=_0x2604ac,_0x9381b1=_0x2604ac):(_0x21a2b9=_0x26ae84,_0x9381b1=_0x26ae84['getShiftedBy'](_0x13f4a3));break;}}_0x21a2b9&&_0x21a2b9['isBefore'](_0x48ca53)&&(_0x48ca53=_0x21a2b9),_0x9381b1&&_0x9381b1['isAfter'](_0x21b2f0)&&(_0x21b2f0=_0x9381b1);}return _0x5cf00e['model']['createSelection'](_0x5cf00e['model']['createRange'](_0x48ca53,_0x21b2f0));}function pt(_0x53e62d,_0xc35d35){fn(_0x53e62d,_0xc35d35,'forward');const _0x14be02=_0xc35d35['getFirstRange']();_0xc35d35['setTo']([]),_0xc35d35['setTo'](_0x14be02,{'backward':!0x0}),fn(_0x53e62d,_0xc35d35,'backward');}function fn(_0x22ee6f,_0x3f6300,_0x16cf1f){let _0x2b918b=0x14;for(;_0x2b918b;){_0x22ee6f['modifySelection'](_0x3f6300,{'unit':'word','direction':_0x16cf1f}),_0x2b918b--;const _0x2835db=_0x3f6300['focus']['forward'==_0x16cf1f?'nodeBefore':'nodeAfter'];if(_0x2835db&&_0x2835db['is']('element')&&_0x22ee6f['schema']['isBlock'](_0x2835db)&&_0x22ee6f['schema']['isObject'](_0x2835db))break;}}function Xn(_0x3d4683,_0x46e7d9){for(let [_0x360aba,_0x29192d]of _0x3d4683['markers'])_0x29192d=_0x29192d['_getTransformedByDeletion'](_0x46e7d9['start'],_0x46e7d9['end']['offset']-_0x46e7d9['start']['offset']),_0x3d4683['markers']['set'](_0x360aba,_0x29192d);}class rh extends _0x440716{['copyButton'];['likeButton'];['dislikeButton'];['showChangesButton'];['_config'];constructor(_0x4367fc,_0x3b66bf={},_0x4e8cbd){super(_0x4367fc),this['set']('isLoading',!0x1),this['_config']={'showCopy':!0x1,'showLike':!0x1,'showDislike':!0x1,..._0x3b66bf};const _0x3c367f=!(this['_config']['showCopy']||this['_config']['showChanges']||this['_config']['showLike']||this['_config']['showDislike']||this['_config']['customView']?.['length']);this['class']=_0x3c367f?'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'](_0x4e8cbd),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']);}['_setupRatingButtons'](){this['likeButton']=new _0xa24b3c(this['locale']),this['likeButton']['set']({'icon':_0x580cd9,'label':Yn(this['locale'],'AI_MINI_TOOLBAR_LIKE'),'tooltip':!0x0}),this['likeButton']['bind']('isEnabled')['to'](this,'isLoading',_0x3f4f99=>!_0x3f4f99),this['likeButton']['on']('execute',()=>{this['fire']('like');}),this['dislikeButton']=new _0xa24b3c(this['locale']),this['dislikeButton']['set']({'icon':_0x397d88,'label':Yn(this['locale'],'AI_MINI_TOOLBAR_DISLIKE'),'tooltip':!0x0}),this['dislikeButton']['bind']('isEnabled')['to'](this,'isLoading',_0x3da276=>!_0x3da276),this['dislikeButton']['on']('execute',()=>{this['fire']('dislike');});}['_setupCopyButton'](){this['copyButton']=new _0xa24b3c(this['locale']),this['copyButton']['set']({'icon':_0x4df34d,'label':Yn(this['locale'],'AI_MINI_TOOLBAR_COPY'),'class':'ck-ai-mini-toolbar-copy-button','tooltip':!0x0}),this['copyButton']['bind']('isEnabled')['to'](this,'isLoading',_0x10f249=>!_0x10f249);const _0x250fca=new _0x23cd9a();_0x250fca['set']({'content':_0x474c30}),_0x250fca['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',setTimeout(()=>{this['copyButton']['class']='ck-ai-mini-toolbar-copy-button';},0x7d0);}),this['copyButton']['children']['add'](_0x250fca);}['_setupShowChangesButton'](_0x35c8b3){this['showChangesButton']=new _0xa24b3c(this['locale']),this['showChangesButton']['set']({'icon':_0x1bba44,'label':Yn(this['locale'],'AI_SUGGESTION_BUTTON_SHOW_CHANGES'),'withText':'full'==this['_config']['showChanges'],'isOn':_0x35c8b3}),this['showChangesButton']['bind']('isEnabled')['to'](this,'isLoading',_0x4a21b8=>!_0x4a21b8),this['showChangesButton']['on']('execute',()=>{const _0x3441ad=!this['showChangesButton']['isOn'];this['showChangesButton']['set']({'isOn':_0x3441ad,'icon':_0x3441ad?_0x13580e:_0x1bba44}),this['fire']('toggleShowChanges',_0x3441ad);});}}class dh extends _0xebef92{['showChangesToggleView'];constructor(_0x4b343f,_0x3b3758){super(_0x4b343f),this['set']('isShowChangesToggleVisible',!0x0),this['showChangesToggleView']=new zn(_0x4b343f),this['showChangesToggleView']['set']({'class':'ck-ai-suggestion__header__show-changes-toggle','label':Yn(_0x4b343f,'AI_SUGGESTION_BUTTON_SHOW_CHANGES'),'withText':!0x0}),this['showChangesToggleView']['isOn']=_0x3b3758['showDiff'],this['showChangesToggleView']['bind']('isVisible')['to'](this,'isShowChangesToggleVisible'),this['showChangesToggleView']['bind']('icon')['to'](this['showChangesToggleView'],'isOn',_0x491037=>_0x491037?_0x2dcfa2:_0x1e2b2a),this['showChangesToggleView']['on']('execute',()=>{this['showChangesToggleView']['isOn']=!this['showChangesToggleView']['isOn'],this['fire']('toggleShowChanges',{'isOn':this['showChangesToggleView']['isOn']});});const _0x5f1396=new _0x23cd9a();_0x5f1396['content']=_0x27a8d2,this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__header',!0x1===_0x3b3758['showHeader']?'ck-hidden':null]['filter'](Boolean)},'children':[_0x5f1396,{'tag':'span','children':[Yn(_0x4b343f,'AI_SUGGESTION_HEADER_TITLE')]},this['showChangesToggleView']]});}}class zn extends _0xa24b3c{['render'](){super['render'](),this['children']['remove'](this['iconView']),this['children']['add'](this['iconView']);}}class ta{['options'];['isStreaming']=!0x1;['document']=null;['nodesList']=[];['currentIndex']=0x0;['timeoutAbortController']=null;constructor(_0x3d30d4){this['options']={'delay':_0x3d30d4['delay']??0x14,'textNodeStyle':_0x3d30d4['textNodeStyle'],'onStreamUpdate':_0x3d30d4['onStreamUpdate']||(()=>{})};}async['stream']({document:_0x15d51d,targetElement:_0x67c53f,abortSignal:_0x4a7b06}){this['isStreaming']&&this['stop'](),_0x4a7b06?.['addEventListener']('abort',this['stop']['bind'](this)),this['document']=_0xaa8b9b(_0x15d51d,!0x0),this['nodesList']=this['getParsedDocumentNodeList'](),this['isStreaming']=!0x0,this['currentIndex']>this['nodesList']['length']&&(_0x49365e('html-streamer-current-index-out-of-bounds',{'currentIndex':this['currentIndex'],'nodeList':this['nodesList']}),this['currentIndex']=this['nodesList']['length']);for(let _0xe4b09d=0x0;_0xe4b09d<this['currentIndex'];_0xe4b09d++)this['nodesList'][_0xe4b09d]['shouldBeStreamed']=!0x0;let _0x67421b=0x0;for(let _0x43b7f8=this['currentIndex'];_0x43b7f8<this['nodesList']['length'];_0x43b7f8++){const _0x5c5ee1=Date['now'](),_0x1ffbd4=this['nodesList'][_0x43b7f8],_0x179476=_0x5c5ee1-_0x67421b;_0x1ffbd4['shouldBeStreamed']=!0x0;let _0x533a68=_0x1ffbd4['parent'];for(;_0x533a68;)_0x533a68['shouldBeStreamed']=!0x0,_0x533a68=_0x533a68['parent'];if(_0x179476<this['options']['delay'])try{const {promise:_0x9773a3,abortController:_0x3200c4}=mr(this['options']['delay']-_0x179476);this['timeoutAbortController']=_0x3200c4,await _0x9773a3;}catch(_0x338d35){return;}_0x4f2268(_0x67c53f,'<'+_0x67c53f['tagName']+'>'+this['renderNode'](this['document'])+'</'+_0x67c53f['tagName']+'>',{'childrenOnly':!0x0}),this['options']['onStreamUpdate']&&this['options']['onStreamUpdate'](),this['currentIndex']=_0x43b7f8,_0x67421b=Date['now']();}this['isStreaming']=!0x1;}['cleanUpAnimations']({targetElement:_0x32cf71}){Array['from'](_0x32cf71['querySelectorAll']('span[data-ck-html-streamer-word-chunk]'))['reverse']()['forEach'](_0x3cd965=>{_0x3cd965['replaceWith'](_0x3cd965['childNodes'][0x0]);});}['stop'](){this['isStreaming']=!0x1,this['timeoutAbortController']&&(this['timeoutAbortController']['abort'](),this['timeoutAbortController']=null);}['renderNode'](_0x27de93){let _0x344d65='';if(function(_0x592315){return _0x10fded(_0x592315);}(_0x27de93)){for(const _0x43047d of _0x27de93['children'])_0x344d65+=this['renderNode'](_0x43047d);}else{if(ar(_0x27de93)){if(!_0x27de93['shouldBeStreamed'])return'';const _0x129c17=_0x27de93,_0x2bf79c=Object['entries'](_0x129c17['attribs'])['map'](([_0x4e3184,_0x2680b9])=>_0x4e3184+'=\x22'+_0x2680b9+'\x22')['join']('\x20');_0x344d65+='<'+_0x129c17['tagName']+(_0x2bf79c?'\x20'+_0x2bf79c:'')+'>';for(const _0x5ecb10 of tn(_0x129c17))_0x344d65+=this['renderNode'](_0x5ecb10);_0x344d65+='</'+_0x129c17['tagName']+'>';}else{if(!cr(_0x27de93))return'';if(!_0x27de93['shouldBeStreamed'])return'';!function(_0x236b41){if(!_0x236b41['parent']||!ar(_0x236b41['parent']))return!0x1;if(!hr['includes'](_0x236b41['parent']['tagName']))return!0x1;return!_0x4355c4(_0x236b41)['match'](/^\s*[<>]\s*$/);}(_0x27de93)?_0x344d65+=_0x4b9a76(_0x27de93):_0x344d65+=_0x4b9a76(new _0x3bc3e5('span',{'data-ck-html-streamer-word-chunk':'','style':this['options']['textNodeStyle']},[_0x27de93]));}}return _0x344d65;}['getParsedDocumentNodeList'](){const _0x47553c=[];return function(_0xe96bb0,_0x49cdfb){const _0x5b848b=_0xb449c9=>{if(_0x49cdfb(_0xb449c9),_0xb449c9 instanceof _0x41c9a6)for(let _0x862e0a=0x0;_0x862e0a<_0xb449c9['children']['length'];_0x862e0a++){const _0x1613d7=_0xb449c9['children'][_0x862e0a];_0x5b848b(_0x1613d7);}};for(let _0x170045=0x0;_0x170045<_0xe96bb0['children']['length'];_0x170045++)_0x5b848b(_0xe96bb0['children'][_0x170045]);}(this['document'],_0x1b0905=>{if(cr(_0x1b0905)){const _0x1d2ebb=this['splitTextNodeIntoWordNodes'](_0x1b0905);_0x1d2ebb['length']&&_0x47553c['push'](..._0x1d2ebb);}_0x1b0905['isWordSplitSource']||_0x1b0905['isWordSplitResult']||_0x47553c['push'](_0x1b0905);}),_0x47553c;}['splitTextNodeIntoWordNodes'](_0x3d62d4){if(_0x3d62d4['isWordSplitSource']||_0x3d62d4['isWordSplitResult'])return[];const _0x3a7cc8=_0x4355c4(_0x3d62d4)['match'](/(?:\s*\S+\s*)/g),_0xbec746=[];if(_0x3a7cc8&&_0x3a7cc8['length']>0x1){for(const _0x13146f of _0x3a7cc8){const _0x298b2b=new _0x29195d(_0x13146f);_0x298b2b['isWordSplitResult']=!0x0,_0x2860b0(_0x3d62d4,_0x298b2b),_0xbec746['push'](_0x298b2b);}_0x3d62d4['isWordSplitSource']=!0x0,_0x46c496(_0x3d62d4);}return _0xbec746;}}const hr=['p','li','td','th','span','h1','h2','h3','h4','h5','h6','b','strong','i','em','mark','del','ins','sup','sub','a','code','div'];function cr(_0x57f3cd){return _0x243b0e(_0x57f3cd);}function ar(_0x5f2003){return _0x42e156(_0x5f2003);}function mr(_0x2f68dc){const _0x55abec=new AbortController();return{'promise':new Promise((_0x4bf6c7,_0x4832c7)=>{const _0x3c0129=setTimeout(_0x4bf6c7,_0x2f68dc);_0x55abec['signal']['addEventListener']('abort',()=>{clearTimeout(_0x3c0129),_0x4832c7();});}),'abortController':_0x55abec};}const Ee=['showChangeInText','insertSuggestion','applySuggestion','rejectSuggestion','mouseOverSuggestion','mouseLeaveSuggestion','toggleSuggestionDisplayMode','like','dislike'];class Nr extends _0xebef92{['htmlStreamer'];['children'];['headerView'];['contentView'];constructor(_0x2b276b,{part:_0x18701a,areActionsDisabled:_0x45b79e}){super(_0x2b276b),this['set']('partDefinition',_0x18701a),this['set']('state','pending'),this['set']('isVisible',!0x1),this['bind']('isEnabled')['to'](this,'state',_0x4c711b=>'pending'==_0x4c711b&&!_0x45b79e),this['children']=this['createCollection'](),this['htmlStreamer']=new ta({'textNodeStyle':'animation:\x20ck-html-streamer-fade-in\x20.5s','delay':0x14}),this['headerView']=new yn(_0x2b276b,_0x18701a),this['headerView']['bind']('partDefinition')['to'](this),this['headerView']['bind']('isEnabled')['to'](this),this['headerView']['bind']('state')['to'](this),this['headerView']['delegate'](...Ee)['to'](this);const _0x889b2=this['bindTemplate'];this['contentView']=new _0xebef92(),this['contentView']['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__body__content-part__content']}}),this['children']['addMany']([this['contentView']]),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__body__content-part',_0x889b2['to']('state',_0x545d85=>'ck-ai-suggestion__body__content-part_'+_0x545d85),_0x889b2['to']('isEnabled',_0x5cb49d=>_0x5cb49d?'ck-ai-suggestion__body__content-part_active':void 0x0),_0x889b2['if']('isVisible','ck-hidden',_0x337ff2=>!_0x337ff2)]},'children':this['children'],'on':{'mouseenter':_0x889b2['to'](()=>{this['isEnabled']&&this['fire']('mouseOverSuggestion',{'index':_0x18701a['index']});}),'mouseleave':_0x889b2['to'](()=>{this['isEnabled']&&this['fire']('mouseLeaveSuggestion',{'index':_0x18701a['index']});})}});}async['updateContent']({part:_0x5ce837,renderingStrategy:_0x2942b2,showUnchangedParts:_0x2197da=!0x1,abortSignal:_0x39056a}){this['partDefinition']=_0x5ce837,this['isVisible']=this['partDefinition']['hasChanges']||_0x2197da,this['isVisible']&&('streaming'===_0x2942b2?await this['htmlStreamer']['stream']({'document':this['partDefinition']['content'],'targetElement':this['contentView']['element'],'abortSignal':_0x39056a}):this['contentView']['element']['innerHTML']=Ct(this['partDefinition']['content']));}['toggleHeader'](_0x3ec87c){_0x3ec87c?this['children']['has'](this['headerView'])||this['children']['add'](this['headerView'],0x0):this['children']['has'](this['headerView'])&&this['children']['remove'](this['headerView']);}}class yn extends _0xebef92{['children'];['_toolbarView'];['_iconStateAccepted'];['_iconStateRejected'];constructor(_0x18f2f7,_0xdddf5c){super(_0x18f2f7),this['set']('partDefinition',_0xdddf5c),this['set']('isEnabled',!0x0),this['set']('state','pending');const _0x50452d=new _0x23cd9a();_0x50452d['content']=_0x471065,_0x50452d['extendTemplate']({'attributes':{'class':['ck-ai-suggestion__body__content-part__icon-title']}});const _0x2680f1=new _0xa24b3c(_0x18f2f7);_0x2680f1['set']({'label':Yn(_0x18f2f7,'AI_SUGGESTION_CONTENT_PART_SHOW_IN_THE_TEXT'),'tooltip':!0x0,'withText':!0x1,'icon':_0x4da215}),_0x2680f1['bind']('isEnabled')['to'](this),_0x2680f1['on']('execute',()=>{this['fire']('showChangeInText',{'index':_0xdddf5c['index']});});const _0x571f2b=new _0xa24b3c(_0x18f2f7);_0x571f2b['set']({'label':Yn(_0x18f2f7,'AI_SUGGESTION_CONTENT_PART_ADD_AS_SUGGESTION'),'tooltip':!0x0,'withText':!0x1,'icon':_0x16c946}),_0x571f2b['bind']('isEnabled')['to'](this),_0x571f2b['on']('execute',()=>{this['fire']('insertSuggestion',{'index':_0xdddf5c['index']});});const _0x4ca98e=new _0xa24b3c(_0x18f2f7);_0x4ca98e['set']({'label':Yn(_0x18f2f7,'AI_SUGGESTION_CONTENT_PART_DELETE'),'tooltip':!0x0,'withText':!0x1,'icon':_0x1cbe16}),_0x4ca98e['on']('execute',()=>{this['fire']('rejectSuggestion',{'index':_0xdddf5c['index']});}),_0x4ca98e['bind']('isEnabled')['to'](this),this['_toolbarView']=new _0x440716(_0x18f2f7),this['_toolbarView']['items']['addMany']([_0x2680f1,_0x571f2b,_0x4ca98e]),this['_iconStateAccepted']=new _0x23cd9a(),this['_iconStateAccepted']['content']=_0x47e913,this['_iconStateAccepted']['extendTemplate']({'attributes':{'class':['ck-ai-suggestion__body__content-part__icon-accepted'],'data-cke-tooltip-text':Yn(_0x18f2f7,'AI_SUGGESTION_CONTENT_PART_ALREADY_APPLIED'),'data-cke-tooltip-position':'n'}}),this['_iconStateRejected']=new _0x23cd9a(),this['_iconStateRejected']['content']=_0x755f8,this['_iconStateRejected']['extendTemplate']({'attributes':{'class':['ck-ai-suggestion__body__content-part__icon-rejected'],'data-cke-tooltip-text':Yn(_0x18f2f7,'AI_SUGGESTION_CONTENT_PART_REJECTED'),'data-cke-tooltip-position':'n'}});const _0x2b0a19=new _0xebef92(_0x18f2f7);_0x2b0a19['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai-suggestion__body__content-part__title__label']},'children':[Yn(_0x18f2f7,'AI_SUGGESTION_CONTENT_PART_TITLE',(_0xdddf5c['index']+0x1)['toString']())]}),this['children']=this['createCollection'](),this['children']['addMany']([_0x50452d,_0x2b0a19,this['_toolbarView']]),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__body__content-part__title']},'children':this['children']}),this['on']('change:state',(_0x5c3479,_0x4b35df,_0x182bc8,_0x4c9c5a)=>{switch(_0x4c9c5a){case'pending':this['children']['remove'](this['_toolbarView']);break;case'accepted':this['children']['remove'](this['_iconStateAccepted']);break;case'rejected':this['children']['remove'](this['_iconStateRejected']);}switch(_0x182bc8){case'pending':this['children']['add'](this['_toolbarView']);break;case'accepted':this['children']['add'](this['_iconStateAccepted']);break;case'rejected':this['children']['add'](this['_iconStateRejected']);}});}}class g extends _0x5a5836(){['queue']=[];['isProcessing']=!0x1;['_abortController'];async['enqueue'](_0x2d1f65){const _0x31b7fa=this['createTask'](_0x2d1f65);return this['queue']['push'](_0x31b7fa),this['_processQueue'](),_0x31b7fa['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(_0x193d6c=>{this['once']('_queueEmpty',()=>{_0x193d6c();});}):Promise['resolve']();}async['_processQueue'](){if(!this['isProcessing']){this['_abortController']=new AbortController(),this['isProcessing']=!0x0;try{for(;this['queue']['length']&&this['isProcessing'];){const _0x50cf7b=this['queue']['shift']();try{await _0x50cf7b['callback'](this['_abortController']['signal']),_0x50cf7b['resolve']();}catch(_0x429005){_0x50cf7b['reject'](_0x429005);}}}finally{this['isProcessing']=!0x1,this['_abortController']=void 0x0;}this['fire']('_queueEmpty');}}['createTask'](_0x4e0db9){let _0x406d76,_0x3bbf9a;const _0x5ab199=new Promise((_0x46c827,_0x586f1b)=>{_0x406d76=_0x46c827,_0x3bbf9a=_0x586f1b;});return{'callback':_0x4e0db9,'resolve':_0x406d76,'reject':_0x3bbf9a,'completePromise':_0x5ab199};}}class Cr extends _0xebef92{['options'];['content']='';['htmlStreamer'];['children'];constructor(_0x5798bb){super();const _0x51bd06=this['bindTemplate'];this['set']('isDone',!0x1),this['set']('isVisible',!0x0),this['htmlStreamer']=new ta({'textNodeStyle':'animation:\x20ck-html-streamer-fade-in\x20.5s','delay':0x14}),this['options']=_0x5798bb,this['children']=this['createCollection'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed__item',_0x51bd06['if']('isDone','ck-ai-chat__feed__item_done'),_0x51bd06['if']('isVisible','ck-hidden',_0x566d0b=>!_0x566d0b),'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'](_0x27a97f=>{_0x27a97f['removeAttribute']('data-id');}),this['isDone']=!0x0;}async['streamIntoElement'](_0x85a31a,_0x336883,_0x5708ed){await this['htmlStreamer']['stream']({'document':_0x85a31a,'targetElement':_0x336883,'abortSignal':_0x5708ed});}}class Te extends Cr{constructor(_0x4eddbf){super(_0x4eddbf),this['extendTemplate']({'attributes':{'class':['ck-ai-chat-error','warning'===_0x4eddbf['level']?'ck-ai-chat-error_warning':'']}});}['render'](){super['render'](),this['setContent'](this['options']['initialContent']),this['markAsDone']();}['setContent'](_0x2b8811){this['element']['innerHTML']=_0x2b8811;}}class lh extends _0xebef92{['_children'];['_areActionsDisabled'];['_showUnchangedParts'];['_updateContentPartsPromiseQueue'];['_emptyPartsWarningView'];constructor(_0x3e7d4b,{areActionsDisabled:_0x2748f9,showUnchangedParts:_0x12758b}){super(_0x3e7d4b),this['_areActionsDisabled']=_0x2748f9,this['_showUnchangedParts']=_0x12758b,this['set']('hasPendingParts',!0x1),this['_children']=this['createCollection'](),this['_updateContentPartsPromiseQueue']=new g(),this['_emptyPartsWarningView']=new Te({'id':'empty-parts-warning','initialContent':Yn(_0x3e7d4b,'AI_SUGGESTION_EMPTY_PART_WARNING'),'level':'warning'}),this['_emptyPartsWarningView']['isVisible']=!0x1,this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset_all-excluded','ck-ai-suggestion__body','ck-content']},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__body__content-parts']},'children':this['_children']},this['_emptyPartsWarningView']]});}get['partsCount'](){return this['_children']['length'];}async['updateContentParts']({parts:_0x33fbac,renderingStrategy:_0x125d86,abortSignal:_0x2dddaf}){for(const _0x16a34d of _0x33fbac)this['_updateContentPartsPromiseQueue']['enqueue'](async _0x479bea=>{let _0x4eda24=this['_children']['find'](_0x222e7e=>_0x222e7e['partDefinition']['index']==_0x16a34d['index']);_0x4eda24||(_0x4eda24=new Nr(this['locale'],{'part':_0x16a34d,'areActionsDisabled':this['_areActionsDisabled']}),_0x4eda24['delegate'](...Ee)['to'](this),this['_children']['add'](_0x4eda24),this['hasPendingParts']=!0x0),0x2===this['_children']['length']&&this['_children']['first']['toggleHeader'](!0x0),_0x4eda24['toggleHeader'](this['_children']['length']>0x1),await _0x4eda24['updateContent']({'part':_0x16a34d,'renderingStrategy':_0x125d86,'showUnchangedParts':this['_showUnchangedParts'],'abortSignal':_0x479bea});});return _0x2dddaf?.['addEventListener']('abort',()=>{this['_updateContentPartsPromiseQueue']['abort']();}),this['_updateContentPartsPromiseQueue']['queueEmptyPromise'];}['updatePartState'](_0x36b8a8,_0x1a59cc){this['_children']['get'](_0x36b8a8)['state']=_0x1a59cc,this['hasPendingParts']='pending'==_0x1a59cc||Array['from'](this['_children'])['some'](_0x534278=>'pending'==_0x534278['state']);}['getPartView'](_0x49ad5c){return this['_children']['get'](_0x49ad5c);}['markAsDone'](){if(!this['_showUnchangedParts']){const _0x5c4935=!this['_children']['find'](_0x142e4a=>_0x142e4a['partDefinition']['hasChanges']),_0x4331fb=!!this['_children']['find'](_0x26f41c=>!_0x26f41c['partDefinition']['hasChanges']);this['_emptyPartsWarningView']['isVisible']=_0x4331fb,_0x5c4935?this['_emptyPartsWarningView']['setContent'](Yn(this['locale'],'AI_SUGGESTION_NO_PARTS_WARNING')):this['_emptyPartsWarningView']['setContent'](Yn(this['locale'],'AI_SUGGESTION_EMPTY_PART_WARNING'));}}get['hasNonEmptyParts'](){return!!this['_children']['find'](_0x27084b=>_0x27084b['partDefinition']['hasChanges']);}}class De extends _0x5a1254{constructor(_0x3aacf7=void 0x0){super();const _0x329533=_0x3aacf7?'ck-ai-spinner_'+_0x3aacf7:'';this['extendTemplate']({'tag':'span','attributes':{'class':['ck-ai-spinner',_0x329533]}});}}class o extends _0xebef92{['bodyView'];['children'];['headerView'];['miniToolbarView'];['loaderView'];['sourcesView'];constructor(_0x523032,{showDiff:_0x289664,areActionsDisabled:_0x2292bd,miniToolbarConfig:_0x1310e6,hideHeader:_0x3feb98,showLoader:_0x30d262,showUnchangedParts:_0x3aceb0}){super(_0x523032),this['set']('areChangesVisible',!0x1),this['set']('isLoaderVisible',!!_0x30d262),this['set']('isLoading',!0x1),this['children']=this['createCollection'](),_0x3feb98||(this['headerView']=new dh(_0x523032,{'showDiff':_0x289664}),this['headerView']['on']('toggleShowChanges',(_0x39083c,_0x3fa64b)=>{this['areChangesVisible']=_0x3fa64b['isOn'],this['fire']('toggleSuggestionDisplayMode',{'showDiff':_0x3fa64b['isOn']});}),this['children']['add'](this['headerView'])),this['bodyView']=new lh(_0x523032,{'areActionsDisabled':_0x2292bd,'showUnchangedParts':!!_0x3aceb0}),this['bodyView']['delegate'](...Ee)['to'](this),this['bodyView']['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isLoaderVisible','ck-hidden')]}}),this['miniToolbarView']=new rh(_0x523032,_0x1310e6,_0x289664),this['miniToolbarView']['delegate'](...Ee)['to'](this),this['miniToolbarView']['on']('toggleShowChanges',(_0x1f1e5b,_0x421523)=>{this['areChangesVisible']=_0x421523,this['fire']('toggleSuggestionDisplayMode',{'showDiff':_0x421523});}),this['miniToolbarView']['bind']('isLoading')['to'](this),this['children']['add'](this['bodyView']),this['children']['add'](this['miniToolbarView']),this['sourcesView']=new jr(this['locale']),this['children']['add'](this['sourcesView']),_0x30d262&&(this['loaderView']=this['_createLoaderView'](),this['children']['add'](this['loaderView'])),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__container','ck-rounded-corners']},'children':this['children']});}async['updateContent'](_0x122656){await this['bodyView']['updateContentParts'](_0x122656);}['updateSources'](_0x469a7){this['sourcesView']['children']['addMany'](_0x469a7['map'](_0x10a273=>new Sr(this['locale'],_0x10a273))),this['sourcesView']['isVisible']=!0x0;}['showLoader'](){this['loaderView']&&(this['isLoaderVisible']=!0x0);}['hideLoader'](){this['loaderView']&&(this['isLoaderVisible']=!0x1);}['markAsDone'](){this['bodyView']['markAsDone'](),this['headerView']&&(this['headerView']['isShowChangesToggleVisible']=this['bodyView']['hasNonEmptyParts']);}['setLoading'](){this['isLoading']=!0x0;}['clearLoading'](){this['isLoading']=!0x1;}['_createLoaderView'](){const _0x5aa898=new _0xebef92(this['locale']),_0x1f44e6=new De('small');_0x1f44e6['isVisible']=!0x0;const _0x472cfc=new _0xebef92(this['locale']);return _0x472cfc['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai-suggestion__loader-text']},'children':[Yn(this['locale'],'AI_CHAT_IS_WRITING')]}),_0x5aa898['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__loader',this['bindTemplate']['if']('isLoaderVisible','ck-hidden',_0x30487d=>!_0x30487d)]},'children':[_0x1f44e6,_0x472cfc]}),_0x5aa898;}}class jr extends _0xebef92{['children'];constructor(_0x5858cc){super(_0x5858cc),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',_0x26a508=>!_0x26a508)]},'children':this['children']});const _0x48c2f0=new _0xebef92(this['locale']),_0xa7cbd3=new _0x23cd9a();_0xa7cbd3['content']=_0x490596,_0x48c2f0['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-web-sources__header']},'children':[_0xa7cbd3,{'tag':'span','children':[{'text':Yn(this['locale'],'AI_CHAT_SOURCES_HEADER')}]}]}),this['children']['add'](_0x48c2f0);}}class Sr extends _0xa24b3c{constructor(_0x34fdf7,_0x278d09){super(_0x34fdf7),this['set']({'label':_0x278d09['title'],'tooltip':_0x278d09['title'],'class':['ck\x20ck-ai-web-source'],'withText':!0x0});const _0x462a45=this['bindTemplate'];if(this['extendTemplate']({'on':{'click':_0x462a45['to'](()=>{window['open'](_0x278d09['url'],'_blank');})}}),_0x278d09['favicon']){const _0x180884=new _0xebef92(_0x34fdf7);_0x180884['setTemplate']({'tag':'img','attributes':{'src':_0x278d09['favicon']||_0x490596,'alt':_0x278d09['title'],'class':['ck-ai-web-source__image']}}),this['children']['add'](_0x180884);}else this['set']('icon',_0x490596);}}class ls extends _0x440716{constructor(_0x409b3d,_0x3019d7=!0x0,_0x1c474a=!0x0){super(_0x409b3d),this['set']('isLoading',!0x1),_0x3019d7&&(this['applyButton']=this['_createButton'](Yn(_0x409b3d,'AI_BALLOON_APPLY_BUTTON'),'ck-ai-button-primary'),this['applyButton']['bind']('isEnabled')['to'](this,'isLoading',_0x340d64=>!_0x340d64),this['items']['add'](this['applyButton'])),_0x1c474a&&(this['suggestButton']=this['_createButton'](Yn(_0x409b3d,'AI_BALLOON_SUGGEST_BUTTON'),'ck-ai-button-secondary'),this['suggestButton']['bind']('isEnabled')['to'](this,'isLoading',_0x40a47d=>!_0x40a47d),this['items']['add'](this['suggestButton'])),this['extendTemplate']({'attributes':{'class':['ck-ai-balloon__toolbar']}});}['_createButton'](_0x4201de,_0x5193bf){const _0x43092e=new _0xa24b3c(this['locale']);return _0x43092e['set']({'label':_0x4201de,'class':_0x5193bf||'','isVisible':!0x0,'withText':!0x0}),_0x43092e;}}class ds extends _0xebef92{constructor(_0x3083e9){super(_0x3083e9),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-balloon__disclaimer']},'children':[{'tag':'p','attributes':{'class':['ck','ck-ai-balloon__disclaimer-content']},'children':[{'text':Yn(_0x3083e9,'AI_DISCLAIMER_TEXT')}]}]});}}const Y=['applySuggestion','insertSuggestion','showNext','showPrevious'];class Z extends _0xebef92{['focusTracker'];['keystrokes'];['focusCycler'];['_focusables'];constructor(_0x5c7910,_0x5485a3){super(_0x5c7910),this['set']('isLoading',!0x1),this['focusTracker']=new _0x13c01a(),this['keystrokes']=new _0x3c58a3(),this['_focusables']=this['createCollection'](),this['focusCycler']=new _0x532b63({'focusables':this['_focusables'],'focusTracker':this['focusTracker'],'keystrokeHandler':this['keystrokes'],'actions':{'focusPrevious':'shift\x20+\x20tab','focusNext':'tab'}}),this['_dialogContent']=new _0x18aaa9(),this['_addContentView'](_0x5485a3['mainView']),this['_addDisclaimerView'](),this['_addToolbar'](_0x5485a3['showApplyButton'],_0x5485a3['showSuggestButton']),this['toolbar']['bind']('isLoading')['to'](this),this['_focusables']['clear'](),this['_focusables']['addMany']([this['toolbar']]),this['setTemplate']({'tag':'div','attributes':{'class':'ai-balloon-content'},'children':this['_dialogContent']});}['render'](){super['render']();for(const _0xd7aa65 of this['_focusables'])this['focusTracker']['add'](_0xd7aa65['element']);this['keystrokes']['listenTo'](this['element']);}['focus'](_0x5359de){-0x1===_0x5359de?this['focusCycler']['focusLast']():this['focusCycler']['focusFirst']();}['setLoading'](){this['isLoading']=!0x0;}['clearLoading'](){this['isLoading']=!0x1;}['setupRotator'](_0x5256a9){const _0x344783=this['_createNextButtonView'](),_0x11e037=this['_createPreviousButtonView']();_0x5256a9['view']['headerView']['children']['add'](_0x344783,0x2),_0x5256a9['view']['headerView']['children']['add'](_0x11e037,0x0),this['_focusables']['addMany']([_0x344783,_0x11e037]),this['focusTracker']['add'](_0x344783['element']),this['focusTracker']['add'](_0x11e037['element']);}['_addContentView'](_0x4821a7){this['_mainView']=_0x4821a7,this['_dialogContent']['add'](this['_mainView']);}['_addDisclaimerView'](){this['disclaimerView']=new ds(this['locale']),this['_dialogContent']['add'](this['disclaimerView']);}['_addToolbar'](_0x3368e7=!0x0,_0x5a3a45=!0x0){this['toolbar']=new ls(this['locale'],_0x3368e7,_0x5a3a45),this['toolbar']['applyButton']?.['on']('execute',()=>{this['fire']('applySuggestion');}),this['toolbar']['suggestButton']?.['on']('execute',()=>{this['fire']('insertSuggestion');}),this['_dialogContent']['add'](this['toolbar']);}['_createNextButtonView'](){const _0x498a11=new _0xa24b3c(this['locale']);return _0x498a11['set']({'icon':_0x4b1bfd,'tooltip':Yn(this['locale'],'AI_BALLOON_NEXT_TOOLTIP')}),_0x498a11['on']('execute',()=>{this['fire']('showNext');}),_0x498a11;}['_createPreviousButtonView'](){const _0x4ed57d=new _0xa24b3c(this['locale']);return _0x4ed57d['set']({'icon':_0x1df48d,'tooltip':Yn(this['locale'],'AI_BALLOON_PREVIOUS_TOOLTIP')}),_0x4ed57d['on']('execute',()=>{this['fire']('showPrevious');}),_0x4ed57d;}}class m extends _0x3cc6c1{static get['requires'](){return[e,a];}static get['pluginName'](){return'AIBalloon';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['isOpen']=!0x1;['_config'];['open'](_0x4ed8a7){const _0x443820=it(this['context']);this['_config']=_0x4ed8a7,this['balloonView']=new Z(_0x443820['locale'],_0x4ed8a7),this['balloonView']['delegate'](...Y)['to'](this),this['_showDialog'](_0x4ed8a7);}['close'](){it(this['context'])['plugins']['get']('Dialog')['hide']();}['_setupVisualSelection'](_0x506663,_0x108793){this['context']['plugins']['get'](a)['showFakeVisualSelection'](_0x506663,'ai-balloon-'+_0x108793,!0x0,!0x0);}['_showDialog'](_0x5d7911){const _0x1b92b9=it(this['context']);this['_setupVisualSelection'](_0x5d7911['ranges'],_0x5d7911['index']),_0x1b92b9['plugins']['get']('Dialog')['show']({'title':_0x5d7911['title'],'icon':_0x5d7911['icon'],'hasCloseButton':!0x0,'id':'aiBalloon','position':this['_calculateDialogPosition']['bind'](this),'className':'ai-balloon'+(_0x5d7911['showRotator']?'\x20ai-balloon-rotator':''),'content':this['balloonView'],'onShow':_0xad0914=>{_0x5d7911['showRotator']&&this['balloonView']['setupRotator'](_0xad0914),this['isOpen']=!0x0;},'onHide':()=>{this['context']['plugins']['get']('AIEditing')['hideFakeVisualSelection']('ai-balloon-'+_0x5d7911['index']),this['fire']('dialogClosed'),this['isOpen']=!0x1;}});}['_calculateDialogPosition'](_0x21b589,_0x4494c6){const _0xe44a7a=it(this['context']);if(!_0x4494c6)return{'left':0x0,'top':0x0};const _0x2f025e=tt(_0xe44a7a['editing'],[..._0xe44a7a['model']['markers']['getMarkersGroup']('ai-selection'),..._0xe44a7a['model']['markers']['getMarkersGroup']('ai-balloon-selection')]);if(!_0x2f025e||0x0===_0x2f025e['length'])return{'left':Math['round'](_0x4494c6['left']+_0x4494c6['width']/0x2-_0x21b589['width']/0x2),'top':Math['round'](_0x4494c6['top']+_0x4494c6['height']/0x2-_0x21b589['height']/0x2)};const _0x5d01f6=Math['round'](_0x4494c6['left']+_0x4494c6['width']/0x2-_0x21b589['width']/0x2),_0x4aeba0=_0x2f025e[0x0]['getBoundingClientRect'](),_0x22f581=_0x2f025e[_0x2f025e['length']-0x1]['getBoundingClientRect'](),_0x2e847e=_0x21b589['height'],_0x823077=this['_config']['showRotator']?0x8:0x0;return{'left':_0x5d01f6,'top':this['_calculateOptimalTopPosition'](_0x4aeba0,_0x22f581,_0x2e847e,_0x823077)};}['_calculateOptimalTopPosition'](_0x3f6e48,_0x8dc32c,_0x3bd2c8,_0x5e3df7=0x0){const _0x4d5a36=_0x8dc32c['top']+_0x8dc32c['height'],_0x7bfd36=_0x3f6e48['top']-_0x3bd2c8-_0x5e3df7,_0x340613=window['innerHeight']-_0x4d5a36-0xa,_0x36b19d=_0x3f6e48['top']-_0x5e3df7-0xa;let _0x23d496;if(_0x340613>=_0x3bd2c8)_0x23d496=_0x4d5a36+0xa;else{if(_0x36b19d>=_0x3bd2c8)_0x23d496=_0x7bfd36-0xa;else _0x23d496=_0x3f6e48['top']+(_0x8dc32c['top']+_0x8dc32c['height'])/0x2-(_0x3bd2c8+_0x5e3df7)/0x2;}return _0x23d496;}}class et extends _0x3cc6c1{['_aiEditing'];['_aiConnector'];['_aiChatUi'];['_aiChatModels'];['_batchToChanges']=new Map();['_previewedChangeGroup']=null;['_balloonShowDiff']=!0x1;static get['requires'](){return[e,m,_0x1cdca3];}static get['pluginName'](){return'AIChatController';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){this['_aiConnector']=this['context']['plugins']['get']('AIConnector'),this['_aiChatUi']=this['context']['plugins']['get']('AIChatUI'),this['_aiEditing']=this['context']['plugins']['get']('AIEditing'),this['_aiChatModels']=new lt({'connector':this['_aiConnector']});const _0x1879c7=this['context']['plugins']['get']('AITabs');this['listenTo'](this['_aiChatUi'],'startConversation',()=>{this['_handleStartConversation']();}),this['listenTo'](this['_aiChatUi'],'sendUserMessage',(_0x51f787,_0x4c1673)=>{this['_handleUIUserMessage']({'userMessage':_0x4c1673});}),this['listenTo'](_0x1879c7,'resizedTabs',(_0x3941ae,_0x214c45)=>{this['_setIsMaximized'](_0x214c45);}),this['listenTo'](this['_aiChatUi'],'resizeTabs',()=>{_0x1879c7['resize']();}),this['listenTo'](this['_aiChatUi'],'abortPromptStream',async()=>{await this['_stopLastInteraction'](),await this['_flushLastInteractionUI']();}),this['listenTo'](this['_aiChatUi'],'addDocumentToContext',()=>{this['activeConversation']?.['addCurrentDocumentToContext'](Yn(this['context']['locale'],'AI_CHAT_CONTEXT_CURRENT_DOCUMENT'));}),this['listenTo'](this['_aiChatUi'],'addFileToContext',(_0x6adf68,_0x20555f)=>{this['activeConversation']?.['addFilesToContext'](Array['from'](_0x20555f));}),this['listenTo'](this['_aiChatUi'],'addUrlToContext',(_0x4a2dd8,_0x2fb372)=>{this['activeConversation']?.['addUrlToContext'](_0x2fb372);}),this['listenTo'](this['_aiChatUi'],'addResourceToContext',(_0x4e0be0,_0x4084ae)=>{this['activeConversation']?.['addResourceToContext'](_0x4084ae['source'],_0x4084ae['resource']);}),this['listenTo'](this['_aiChatUi'],'removeContextItem',(_0x4411f9,_0x2f4d26)=>{this['_removeFromContext'](_0x2f4d26);}),this['listenTo'](this['_aiChatUi'],'loadSourceResources',(_0x16515b,_0x1cd281)=>{this['activeConversation']?.['loadSourceResources'](_0x1cd281['sourceId'],_0x1cd281['query'],_0x1cd281['uid']);}),this['listenTo'](this['_aiChatUi'],'toggleWebSearch',()=>{this['_toggleWebSearch']();}),this['listenTo'](this['_aiChatUi'],'toggleReasoning',()=>{this['_toggleReasoning']();}),this['listenTo'](this['_aiChatUi'],'selectModel',(_0x3e4dd0,_0x59c52e)=>{this['activeConversation']?.['setModel'](_0x59c52e);}),this['listenTo'](this['_aiChatUi'],'like',(_0x3ce288,{replyId:_0x585b86})=>{console['log']('Liked\x20response',_0x585b86);}),this['listenTo'](this['_aiChatUi'],'dislike',(_0x32ce59,{replyId:_0x58a967})=>{console['log']('Disliked\x20response',_0x58a967);}),this['listenTo'](this['_aiChatUi'],'insertSuggestion',(_0x2743bf,_0x47125d)=>{this['context']['plugins']['get'](m)['close'](),this['_insertSuggestion'](_0x47125d);}),this['listenTo'](this['_aiChatUi'],'showChangeInText',(_0x397452,{replyId:_0x41e7fa,partIndex:_0x359770})=>{this['_balloonShowDiff']=this['_aiChatUi']['showDiff'],this['_openBalloonFor'](_0x41e7fa,_0x359770);}),this['listenTo'](this['_aiChatUi'],'mouseOverSuggestion',(_0x1f2376,{replyId:_0x57f6d9,partIndex:_0xd569b7})=>{const _0x199e92=this['_getDocumentRangeForReplyChanges'](_0x57f6d9,_0xd569b7);_0x199e92&&'$graveyard'!=_0x199e92['range']['root']['rootName']&&this['_aiEditing']['showFakeVisualSelection']([_0x199e92['range']],'ai-chat-controller-mouse-over');}),this['listenTo'](this['_aiChatUi'],'mouseLeaveSuggestion',()=>{this['_aiEditing']['hideFakeVisualSelection']('ai-chat-controller-mouse-over');}),this['listenTo'](this['_aiChatUi'],'applySuggestion',(_0xbcb77f,_0x564c70)=>{this['context']['plugins']['get'](m)['close'](),this['_applySuggestion'](_0x564c70);}),this['listenTo'](this['_aiChatUi'],'toggleSuggestionDisplayMode',async(_0xd8b49f,_0x9d016c)=>{const {reply:_0x285700}=this['getInteractionAndReplyById'](_0x9d016c['replyId']),_0xa73143=p({'editor':it(this['context']),'changeGroups':_0x285700['changeGroups'],'documentContextContent':_0x285700['documentContextContent'],'showDiff':_0x9d016c['showDiff']});await this['_aiChatUi']['updateFeedItemAIReplySuggestionContent']({'id':_0x285700['id'],'parts':_0xa73143,'renderingStrategy':'static'});}),this['listenTo'](this['_aiChatUi'],'rejectSuggestion',(_0x17a768,{replyId:_0x290046,partIndex:_0x5c8251})=>{this['_previewedChangeGroup']?.['replyId']==_0x290046&&this['_previewedChangeGroup']?.['partIndex']==_0x5c8251&&this['context']['plugins']['get'](m)['close']();const {reply:_0x4885cc}=this['getInteractionAndReplyById'](_0x290046);_0x4885cc['setChangeGroupState'](_0x5c8251,'rejected'),this['_aiEditing']['hideFakeVisualSelection']('ai-chat-controller-mouse-over');});}async['afterInit'](){this['context']instanceof ot?this['_integrateEditor'](this['context']):this['listenTo'](this['context']['editors'],'add',(_0x50c3c9,_0x38245e)=>{_0x38245e['on']('ready',()=>{this['_integrateEditor'](_0x38245e);});}),await this['_handleStartConversation']();}['_insertSuggestion'](_0x38cc20){const _0xb66ab5=it(this['context']);if(!_0xb66ab5['plugins']['has']('TrackChangesEditing'))return;const _0x2dbae3=this['context']['plugins']['get']('DocumentCompare'),{reply:_0x4aab30,interaction:_0x4faf39}=this['getInteractionAndReplyById'](_0x38cc20['replyId']),_0x4b5dce=this['_getDocumentRangeForReplyChanges'](_0x38cc20['replyId'],_0x38cc20['partIndex']),_0x1bfb7a=void 0x0!==_0x38cc20['partIndex']?[_0x4aab30['changeGroups'][_0x38cc20['partIndex']]]:_0x4aab30['changeGroups']['filter'](_0x290596=>'pending'==_0x290596['state']),_0x425c6e=_0x1bfb7a['map'](_0x22afb6=>_0x4aab30['changeGroups']['indexOf'](_0x22afb6));_0x425c6e['forEach'](_0x168e35=>_0x4aab30['setChangeGroupState'](_0x168e35,'accepted'));const _0x3dcc76=w({'editor':_0xb66ab5,'reply':_0x4aab30,'interaction':_0x4faf39,'groups':_0x1bfb7a,'transform':!0x0,'documentCompare':_0x2dbae3,'documentCompareOptions':{'anchor':'main','markDeletions':!0x0}});let _0x9c824b;_0x4b5dce&&this['_scrollToSuggestionRange'](_0x4b5dce['range']),_0xb66ab5['model']['change'](_0x5145b0=>{_0x9c824b=_0x5145b0['batch'],_0xb66ab5['plugins']['get']('TrackChangesEditing')['_applyOperationsAsSuggestions'](_0x3dcc76),this['_aiEditing']['hideFakeVisualSelection']('ai-chat-controller-mouse-over');}),this['_batchToChanges']['set'](_0x9c824b,{'interactionId':_0x4faf39['id'],'replyId':_0x4aab30['id'],'indexes':_0x425c6e['slice']()});}['_applySuggestion'](_0x4d325f){const _0x5c5050=it(this['context']),_0x2a29a0=this['context']['plugins']['get'](_0x1cdca3),{reply:_0x1086b1,interaction:_0x74dc5d}=this['getInteractionAndReplyById'](_0x4d325f['replyId']),_0x12ba02=this['_getDocumentRangeForReplyChanges'](_0x4d325f['replyId'],_0x4d325f['partIndex']),_0x22856f=void 0x0!==_0x4d325f['partIndex']?[_0x1086b1['changeGroups'][_0x4d325f['partIndex']]]:_0x1086b1['changeGroups']['filter'](_0x18d077=>'pending'==_0x18d077['state']),_0x3807c3=_0x22856f['map'](_0x333352=>_0x1086b1['changeGroups']['indexOf'](_0x333352));_0x3807c3['forEach'](_0x4aef70=>_0x1086b1['setChangeGroupState'](_0x4aef70,'accepted'));const _0xf3a229=w({'editor':_0x5c5050,'reply':_0x1086b1,'interaction':_0x74dc5d,'groups':_0x22856f,'transform':!0x0,'documentCompare':_0x2a29a0,'documentCompareOptions':{'anchor':'main','markDeletions':!0x1}});let _0x38cc4d;_0x12ba02&&this['_scrollToSuggestionRange'](_0x12ba02['range']),_0x5c5050['model']['change'](_0x1dbe2e=>{_0x38cc4d=_0x1dbe2e['batch'];for(const _0x46a13c of _0xf3a229)_0x46a13c['baseVersion']=_0x5c5050['model']['document']['version'],_0x1dbe2e['batch']['addOperation'](_0x46a13c),_0x5c5050['model']['applyOperation'](_0x46a13c);}),this['_batchToChanges']['set'](_0x38cc4d,{'interactionId':_0x74dc5d['id'],'replyId':_0x1086b1['id'],'indexes':_0x3807c3['slice']()});}['_openBalloonFor'](_0x282571,_0x46e83b){const _0x508faa=it(this['context']),_0x3b8ff2=this['_getDocumentRangeForReplyChanges'](_0x282571,_0x46e83b),_0x471e63=this['context']['plugins']['get'](m);if(!_0x3b8ff2)return void _0x471e63['close']();const {range:_0x2e2248,currentIndex:_0x5e32cb,previousIndex:_0x1db311,nextIndex:_0x432987}=_0x3b8ff2;if(this['_previewedChangeGroup']?.['replyId']==_0x282571&&this['_previewedChangeGroup']?.['partIndex']==_0x5e32cb)return;this['_previewedChangeGroup']={'replyId':_0x282571,'partIndex':_0x5e32cb};const _0x93a485=new o(_0x508faa['locale'],{'showDiff':this['_balloonShowDiff'],'areActionsDisabled':!0x1,'miniToolbarConfig':{'showChanges':'full'},'hideHeader':!0x0}),{reply:_0x991d44}=this['getInteractionAndReplyById'](_0x282571),_0x468594=p({'editor':_0x508faa,'changeGroups':[_0x991d44['changeGroups'][_0x5e32cb]],'documentContextContent':_0x991d44['documentContextContent'],'showDiff':this['_balloonShowDiff']});_0x93a485['updateContent']({'parts':_0x468594,'renderingStrategy':'static'});const _0x3b9a34=_0x5e32cb!==_0x1db311;this['_scrollToSuggestionRange'](_0x2e2248,!0x0),_0x471e63['open']({'index':_0x5e32cb,'title':Yn(this['context']['locale'],'AI_BALLOON_HEADER_TITLE',(_0x5e32cb+0x1)['toString']()),'icon':yt,'mainView':_0x93a485,'showRotator':_0x3b9a34,'showApplyButton':!0x0,'showSuggestButton':!0x0,'ranges':[_0x2e2248]}),this['_aiChatUi']['scrollFeedToSuggestion'](_0x282571,_0x5e32cb),this['listenTo'](_0x93a485,'toggleSuggestionDisplayMode',(_0x31d3a6,{showDiff:_0x25099a})=>{this['_balloonShowDiff']=_0x25099a;const {reply:_0x406632}=this['getInteractionAndReplyById'](_0x282571),_0x858f6e=p({'editor':_0x508faa,'changeGroups':[_0x406632['changeGroups'][_0x5e32cb]],'documentContextContent':_0x406632['documentContextContent'],'showDiff':_0x25099a});_0x93a485['updateContent']({'parts':_0x858f6e,'renderingStrategy':'static'});}),this['listenTo'](_0x471e63,'applySuggestion',()=>{this['_applySuggestion']({'replyId':_0x282571,'partIndex':_0x5e32cb}),_0x3b9a34?this['_openBalloonFor'](_0x282571,_0x432987):_0x471e63['close']();}),this['listenTo'](_0x471e63,'insertSuggestion',()=>{this['_insertSuggestion']({'replyId':_0x282571,'partIndex':_0x5e32cb}),_0x3b9a34?this['_openBalloonFor'](_0x282571,_0x432987):_0x471e63['close']();}),_0x3b9a34&&(this['listenTo'](_0x471e63,'showNext',()=>{this['_openBalloonFor'](_0x282571,_0x432987);}),this['listenTo'](_0x471e63,'showPrevious',()=>{this['_openBalloonFor'](_0x282571,_0x1db311);})),this['listenTo'](_0x471e63,'dialogClosed',()=>{this['stopListening'](_0x471e63),this['stopListening'](_0x93a485),this['_previewedChangeGroup']=null;});}['_getDocumentRangeForReplyChanges'](_0x137ea8,_0x2358fb){const _0x15ee52=it(this['context']),{reply:_0xc9bb10,interaction:_0x5d5188}=this['getInteractionAndReplyById'](_0x137ea8),_0x3cb51c=_0xc9bb10['changeGroups']['filter'](_0x4abd6d=>'pending'==_0x4abd6d['state']),_0x1ab7ec=_0x3cb51c['map'](_0x3254e2=>_0xc9bb10['changeGroups']['indexOf'](_0x3254e2));void 0x0===_0x2358fb&&(_0x2358fb=_0x1ab7ec[0x0]);const _0x4d82e3=_0x1ab7ec['indexOf'](_0x2358fb);if(-0x1==_0x4d82e3)return null;const _0x42f07d=0x0==_0x4d82e3?_0x1ab7ec[_0x1ab7ec['length']-0x1]:_0x1ab7ec[_0x4d82e3-0x1],_0x392fad=_0x4d82e3==_0x1ab7ec['length']-0x1?_0x1ab7ec[0x0]:_0x1ab7ec[_0x4d82e3+0x1],_0x5e40eb=_0x3cb51c[_0x4d82e3],_0x21ae04=new _t([]),_0x54a7f1=new _t([]);for(const _0x4ffb26 of _0x5e40eb['changes'])if('removed'!=_0x4ffb26['type']&&_0x54a7f1['children']['push'](_0x4ffb26['node']['cloneNode'](!0x0)),'new'!=_0x4ffb26['type']){const _0x2ac182=mt(_0x487b91=>ft(_0x487b91,'data-id')==_0x4ffb26['id'],_0xc9bb10['documentContextContent'],!0x0);_0x21ae04['children']['push'](_0x2ac182['cloneNode'](!0x0));}if(0x0==_0x21ae04['children']['length']){if(_0x5e40eb['changes'][0x0]['anchorId']){const _0x2bf8e6=It('data-id',_0x5e40eb['changes'][0x0]['anchorId'],_0xc9bb10['documentContextContent']);_0x21ae04['children']['unshift'](_0x2bf8e6['cloneNode'](!0x0)),_0x54a7f1['children']['unshift'](_0x2bf8e6['cloneNode'](!0x0)),_0x2bf8e6['nextSibling']&&(_0x21ae04['children']['push'](_0x2bf8e6['nextSibling']['cloneNode'](!0x0)),_0x54a7f1['children']['push'](_0x2bf8e6['nextSibling']['cloneNode'](!0x0)));}else{const _0x526028=_0xc9bb10['documentContextContent']['children'][0x0];if(!_0x526028)return null;_0x21ae04['children']['push'](_0x526028['cloneNode'](!0x0)),_0x54a7f1['children']['push'](_0x526028['cloneNode'](!0x0));}}const _0x5e75f2=_0x5d5188['getDocumentContext'](),_0x3fd70e=_0x15ee52['data']['parse'](_0x5e75f2['content']),_0x54c771=Ct(_0x21ae04),_0x3d206f=_0x15ee52['data']['parse'](_0x54c771),_0x3dca61=_0x15ee52['data']['parse'](_0x54c771),_0x4a9c1e=_0x15ee52['model']['createPositionAt'](_0x3d206f,0x0),_0x106613=Ct(_0x54a7f1),_0xa0a861={'anchor':_0x4a9c1e,'markDeletions':!0x1},_0x3e088d=_0x15ee52['plugins']['get'](_0x1cdca3)['getDiff'](_0x54c771,_0x106613,_0xa0a861)['getOperations']();if(!_0x3e088d['length'])return null;_0x15ee52['model']['change'](_0x2a1495=>{for(const _0x176271 of _0x3e088d)if('remove'==_0x176271['type']){const _0x4393af=_0x176271['sourcePosition'],_0x4f3864=_0x176271['howMany'],_0x1e5203=new _0x3d4b6d(_0x4393af,_0x4f3864);_0x2a1495['batch']['addOperation'](_0x1e5203),_0x15ee52['model']['applyOperation'](_0x1e5203);}else _0x176271['baseVersion']=null,_0x176271['isDocumentOperation']=!0x1,_0x2a1495['batch']['addOperation'](_0x176271),_0x15ee52['model']['applyOperation'](_0x176271);});const _0x519922=ut(_0x15ee52,_0x3e088d,_0x3d206f);pt(_0x15ee52['model'],_0x519922);const _0x3538c0=_0x519922['getFirstRange']()['start']['path']['slice'](),_0x494ba5=_0x519922['getFirstRange']()['end']['path']['slice'](),_0x4adde0=[];let _0x1d685c=_0x3d206f,_0xa1202f=_0x3dca61;for(let _0xfb54d7=0x0;_0xfb54d7<_0x494ba5['length'];_0xfb54d7++){const _0x490f1e=_0x1d685c['maxOffset']-_0x494ba5[_0xfb54d7];_0x4adde0[_0xfb54d7]=_0xa1202f['maxOffset']-_0x490f1e,_0x1d685c=_0x1d685c['getChildAtOffset'](_0x494ba5[_0xfb54d7]),_0xa1202f=_0xa1202f['getChildAtOffset'](_0x4adde0[_0xfb54d7]);}const _0x256b44=_0x15ee52['model']['createRange'](_0x15ee52['model']['createPositionFromPath'](_0x3dca61,_0x3538c0),_0x15ee52['model']['createPositionFromPath'](_0x3dca61,_0x4adde0)),_0x5b3f01=_0x3dca61['getChild'](0x0)['getAttribute'](gt),_0x483b3c=Array['from'](_0x3fd70e['getChildren']())['find'](_0x4b4abd=>_0x4b4abd['getAttribute'](gt)==_0x5b3f01)['getPath'](),_0x1849b2=_0x256b44['start']['path']['slice'](),_0x5e5b3d=_0x256b44['end']['path']['slice']();_0x1849b2[0x0]=_0x483b3c[0x0]+_0x1849b2[0x0],_0x5e5b3d[0x0]=_0x483b3c[0x0]+_0x5e5b3d[0x0];let _0x353ca9=_0x15ee52['model']['createRange'](_0x15ee52['model']['createPositionFromPath'](_0x15ee52['model']['document']['getRoot'](),_0x1849b2),_0x15ee52['model']['createPositionFromPath'](_0x15ee52['model']['document']['getRoot'](),_0x5e5b3d));const _0x248be9=_0x15ee52['model']['document']['history']['getOperations'](_0x5e75f2['version']);for(const _0x5d3862 of _0x248be9)_0x353ca9=_0x4f7a9a['_createFromRanges'](_0x353ca9['getTransformedByOperation'](_0x5d3862));return{'range':_0x353ca9,'previousIndex':_0x42f07d,'nextIndex':_0x392fad,'currentIndex':_0x2358fb};}['_integrateEditor'](_0x58d91b){if(!_0x58d91b['plugins']['has']('Undo'))return;const _0x22defa=_0x58d91b['commands']['get']('undo'),_0x541648=_0x58d91b['commands']['get']('redo');this['listenTo'](_0x22defa,'revert',(_0x3d5e40,_0x10a331,_0x54ed0c)=>{const _0x289b3a=this['_batchToChanges']['get'](_0x10a331);if(!_0x289b3a)return;const _0x251eb6=this['activeConversation']['getInteraction'](_0x289b3a['interactionId'])['getReply'](_0x289b3a['replyId']);_0x289b3a['indexes']['forEach'](_0x599bdb=>_0x251eb6['setChangeGroupState'](_0x599bdb,'pending')),this['_batchToChanges']['delete'](_0x10a331),this['_batchToChanges']['set'](_0x54ed0c,_0x289b3a);}),this['listenTo'](_0x541648,'revert',(_0x3508f1,_0x28810b,_0x169f79)=>{const _0x45d4e3=this['_batchToChanges']['get'](_0x28810b);if(!_0x45d4e3)return;const _0x130d62=this['activeConversation']['getInteraction'](_0x45d4e3['interactionId'])['getReply'](_0x45d4e3['replyId']);_0x45d4e3['indexes']['forEach'](_0x5dbb2b=>_0x130d62['setChangeGroupState'](_0x5dbb2b,'accepted')),this['_batchToChanges']['delete'](_0x28810b),this['_batchToChanges']['set'](_0x169f79,_0x45d4e3);});}async['loadConversation'](_0x46d068){this['context']['plugins']['get'](m)['close'](),this['_aiChatUi']['setFeedItemRenderingStrategy']('static'),this['_aiChatUi']['toggleLoadingSkeleton'](!0x0),await this['_stopLastInteraction']();try{const _0xaf0ee9=this['context']['plugins']['get'](ht);this['updateConversationTitle']('\x20'),_0xaf0ee9['view']['activateTab']('chat'),await this['_handleStartConversation'](_0x46d068);const {sessionId:_0xb91478}=this['_aiEditing']['getDocumentData']();await this['activeConversation']['load'](_0x46d068,_0xb91478),this['activeConversation']['isCurrentDocumentInConversation']()&&this['activeConversation']['addCurrentDocumentToContext'](Yn(this['context']['locale'],'AI_CHAT_CONTEXT_CURRENT_DOCUMENT'));}catch(_0x4368ac){console['error']('Failed\x20to\x20load\x20conversation',_0x4368ac);}finally{this['_aiChatUi']['setFeedItemRenderingStrategy']('streaming'),this['_aiChatUi']['toggleLoadingSkeleton'](!0x1);}}['handleRemovedConversation'](_0x49adb7){this['activeConversation']['id']===_0x49adb7&&this['_handleStartConversation']();}async['addSelectionToChatContext'](){const _0x4ccd29=this['_aiEditing']['getSelectionText']();this['activeConversation']?.['addSelectionToContext'](_0x4ccd29),this['activeConversation']?.['addCurrentDocumentToContext'](Yn(this['context']['locale'],'AI_CHAT_CONTEXT_CURRENT_DOCUMENT'));}['removeSelectionFromChatContext'](){this['activeConversation']?.['removeSelectionFromContext']();}['focusPromptInput'](){this['_aiChatUi']['focusPromptInput']();}async['startConversation'](){await this['_handleStartConversation']();}async['sendMessage']({message:_0x45b06a,quickActionData:_0x52822a}){await this['_handleUIUserMessage']({'userMessage':_0x45b06a,'quickActionData':_0x52822a});}['getGroupId'](){const _0x3992e9=this['context']['config']['get']('collaboration.channelId');if(!_0x3992e9)throw new _0xa14e6e('ai-chat-missing-channel-id',this);return _0x3992e9;}async['_handleStartConversation'](_0x2f10e4){const _0x365f13=this['context']['plugins']['get'](m);let _0x47a6fb;_0x365f13['isOpen']&&_0x365f13['close'](),_0x47a6fb=_0x2f10e4||!this['activeConversation']?this['context']['config']['get']('ai.chat.models.defaultModelId'):this['activeConversation']['selectedModel']['id'],await this['_stopLastInteraction']();const _0x38f5b2=this['getGroupId'](),_0x46923c=_0x2f10e4||_0x48375a();this['activeConversation']=new ct({'connector':this['_aiConnector'],'chatModels':this['_aiChatModels'],'defaultModelId':_0x47a6fb,'conversationId':_0x46923c,'group':_0x38f5b2,'getEditor':()=>it(this['context'])}),this['activeConversation']['on']('conversationInitialized',(_0x49ca6d,_0xcfbfcf)=>{_0xcfbfcf['availableModels']=this['_filterModels'](_0xcfbfcf['availableModels'],this['context']['config']['get']('ai.chat.models.displayedModels')),this['_aiChatUi']['createConversation'](_0xcfbfcf),this['_aiChatUi']['resetMessageInput'](),this['_aiChatUi']['clearPendingContextUI'](),this['_aiChatUi']['clearConversationContextUI'](),_0x2f10e4||(this['_aiChatUi']['resetConversationTitle'](),this['activeConversation']?.['addCurrentDocumentToContext'](Yn(this['context']['locale'],'AI_CHAT_CONTEXT_CURRENT_DOCUMENT')));}),this['activeConversation']['on']('uploadProgressChanged',(_0x1f95f9,_0x2080f7)=>{this['_aiChatUi']['setIsUploadInProgress'](_0x2080f7['isUploadInProgress']);}),this['activeConversation']['on']('interactionCreated',(_0x407e4f,_0x4e7758)=>{this['_aiChatUi']['addFeedItemUserMessage'](_0x4e7758),this['_aiChatUi']['addFeedInteractionHeader'](_0x4e7758);}),this['activeConversation']['on']('interactionStarted',(_0xef5cdc,_0x5e3b0e)=>{this['_aiChatUi']['startInteraction'](_0x5e3b0e);}),this['activeConversation']['on']('interactionFinished',async()=>{await this['_aiChatUi']['finishInteraction']();}),this['activeConversation']['on']('interactionDestroyed',(_0x212dcc,_0x5c760f)=>{this['_aiChatUi']['removeFeedInteraction'](_0x5c760f['id']);}),this['activeConversation']['on']('setConversationTitle',(_0x112429,_0x4c0f02,_0x10414c)=>{this['updateConversationTitle'](_0x4c0f02,_0x10414c);}),this['activeConversation']['on']('replyCreated',(_0x47b3b0,_0x14f80b)=>{this['_aiChatUi']['updateFeedInteractionHeader']({'isVisible':!0x0,'id':_0x14f80b['interactionId']}),'text-delta'===_0x14f80b['type']?this['_aiChatUi']['addFeedItemAIReply'](_0x14f80b):this['_aiChatUi']['addFeedItemAISuggestion'](_0x14f80b);}),this['activeConversation']['on']('replyContentUpdated',async(_0x2ae52c,_0x1b9b3b,_0x93144d)=>{await this['_updateReplyContent']({'reply':_0x1b9b3b,'changeGroups':_0x93144d});}),this['activeConversation']['on']('replyChangeGroupStateUpdated',(_0x48a4db,{reply:_0x28a175,index:_0x38aa5c,state:_0x1917a8})=>{this['_aiChatUi']['updateFeedItemAIReplySuggestionPartState']({'id':_0x28a175['id'],'index':_0x38aa5c,'state':_0x1917a8});}),this['activeConversation']['on']('contextItemAdded',(_0x4487cc,_0x2d2c4a)=>{if(this['_aiChatUi']['addContextItem'](_0x2d2c4a['contextItem'],_0x2d2c4a['isLoading']),'selection'===_0x2d2c4a['contextItem']['type']){const _0x51ba9c=[...it(this['context'])['model']['document']['selection']['getRanges']()];this['_aiEditing']['showFakeVisualSelection'](_0x51ba9c,'ai-conversation-'+this['activeConversation']?.['id']);}}),this['activeConversation']['on']('contextItemRemoved',(_0x348b9b,_0x40f4b9)=>{this['_aiChatUi']['removeContextItem'](_0x40f4b9['uiId']),'current-document'==_0x40f4b9['uiId']&&this['removeSelectionFromChatContext'](),'selection'===_0x40f4b9['type']&&this['_aiEditing']['hideFakeVisualSelection']('ai-conversation-'+this['activeConversation']?.['id']);}),this['activeConversation']['on']('contextItemLoadingEnded',(_0x2e4664,_0xa92be8)=>{this['_aiChatUi']['setContextItemLoading'](_0xa92be8['contextItem']['uiId'],_0xa92be8['isLoading']);}),this['activeConversation']['on']('contextSent',(_0x58684a,_0x22befe)=>{this['_aiChatUi']['setConversationContext'](_0x22befe['contextItems']);}),this['activeConversation']['on']('addContextOptionsChanged',(_0x2dba76,_0x32e389)=>{this['_aiChatUi']['setAddContextOptions'](_0x32e389['options']);}),this['activeConversation']['on']('sourceResourcesLoaded',(_0x9dac44,_0x38a20f)=>{this['_aiChatUi']['populateSourceResourceBalloon'](_0x38a20f['sourceId'],_0x38a20f['source'],_0x38a20f['resources'],_0x38a20f['uid']);}),this['activeConversation']['on']('resourceStateChanged',(_0x46084e,_0x2c9806)=>{this['_aiChatUi']['updateResourceState'](_0x2c9806['sourceId'],_0x2c9806['resourceId'],_0x2c9806['isInContext']);}),this['activeConversation']['on']('capabilitiesUpdated',(_0xb4029f,_0x4fc57e)=>{this['_aiChatUi']['updateCapabilities'](_0x4fc57e);}),this['activeConversation']['on']('modelSelected',(_0x4bba4c,_0x1f393a)=>{this['_aiChatUi']['setSelectedModel'](_0x1f393a['selectedModel'],_0x1f393a['isDisabled']);}),this['activeConversation']['on']('error',(_0x581e5d,{error:_0x13a8f6,interactionId:_0x4d43f1,fileName:_0x276b79,url:_0x4657b7,sourceId:_0x5340de,sourceLabel:_0x1dc823})=>{const _0x47a9a0=_0x4d43f1?_0x4d43f1+':'+_0x48375a():_0x48375a();_0x13a8f6['message']['startsWith']('ai-request-aborted')?this['_aiChatUi']['addFeedItemStaticMessage']({'staticMessage':Yn(this['context']['locale'],'AI_CHAT_ABORTED_MESSAGE'),'id':_0x47a9a0}):_0x13a8f6['message']['startsWith']('ai-chat-conversation-init-failed')||_0x13a8f6['message']['startsWith']('ai-chat-conversation-start-failed')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':Yn(this['context']['locale'],'AI_CHAT_UNABLE_TO_START_CONVERSATION'),'id':_0x47a9a0}),this['_logError'](_0x13a8f6)):_0x13a8f6['message']['startsWith']('ai-chat-file-upload-failed')?this['_aiChatUi']['addFeedItemError']({'errorMessage':Yn(this['context']['locale'],'AI_CHAT_CONTEXT_UNABLE_TO_UPLOAD_FILE',_0x276b79),'id':_0x47a9a0}):_0x13a8f6['message']['startsWith']('ai-chat-url-upload-failed')?this['_aiChatUi']['addFeedItemError']({'errorMessage':Yn(this['context']['locale'],'AI_CHAT_CONTEXT_UNABLE_TO_UPLOAD_URL',_0x4657b7),'id':_0x47a9a0}):_0x13a8f6['message']['startsWith']('ai-chat-context-invalid-data')?this['_aiChatUi']['addFeedItemError']({'errorMessage':Yn(this['context']['locale'],'AI_CHAT_CONTEXT_INVALID_DATA'),'id':_0x47a9a0}):_0x13a8f6['message']['startsWith']('ai-chat-context-unsupported-type')?this['_aiChatUi']['addFeedItemError']({'errorMessage':Yn(this['context']['locale'],'AI_CHAT_CONTEXT_UNSUPPORTED_TYPE'),'id':_0x47a9a0}):_0x13a8f6['message']['startsWith']('ai-chat-source-resources-load-failed')?(_0x5340de&&this['_aiChatUi']['closeSourceResourceBalloon'](_0x5340de),this['_aiChatUi']['addFeedItemError']({'errorMessage':Yn(this['context']['locale'],'AI_CHAT_CONTEXT_UNABLE_TO_LOAD_RESOURCES',_0x1dc823||'source'),'id':_0x47a9a0}),this['_logError'](_0x13a8f6)):_0x13a8f6['message']['startsWith']('ai-chat-resource-load-failed')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':Yn(this['context']['locale'],'AI_CHAT_RESOURCE_LOAD_FAILED'),'id':_0x47a9a0}),this['_logError'](_0x13a8f6)):(this['_aiChatUi']['addFeedItemError']({'errorMessage':Yn(this['context']['locale'],'AI_CHAT_GENERIC_ERROR'),'id':_0x47a9a0}),this['_logError'](_0x13a8f6));}),await this['activeConversation']['init'](this['context']['config']['get']('ai.chat.context')),_0x2f10e4||await this['activeConversation']['start']();}async['_handleUIUserMessage']({userMessage:_0x2c5a55,quickActionData:_0x215cca}){if(!this['activeConversation'])throw new _0xa14e6e('ai-chat-controller-no-active-conversation');this['activeConversation']['isCurrentDocumentInContext']()&&await this['activeConversation']['updateCurrentDocumentInContext'](this['_aiEditing']['getDocumentData']()),this['activeConversation']['id']&&this['activeConversation']['isStarted']&&await this['activeConversation']['handleUserInteraction']({'userMessage':_0x2c5a55,'quickActionData':_0x215cca}),this['_removeAISelectionMarkers']();}['_removeAISelectionMarkers'](){const _0x4dd4f3=it(this['context'])['model'],_0x3220f6=Array['from'](_0x4dd4f3['markers']['getMarkersGroup'](dt));_0x4dd4f3['change'](_0x36fd84=>{_0x3220f6['forEach'](_0x130eee=>_0x36fd84['removeMarker'](_0x130eee));});}['_showConversationHistory'](){console['log']('Showing\x20conversation\x20history...');}['_setIsMaximized'](_0x36e5d5){this['_aiChatUi']['setIsMaximized'](_0x36e5d5);}['_logError'](_0x88b352){nt(_0x88b352['message']);}['_removeFromContext'](_0x34c1d4){this['activeConversation']?.['removeFromContext'](_0x34c1d4);}['_toggleWebSearch'](){this['activeConversation']?.['toggleWebSearch']();}['_toggleReasoning'](){this['activeConversation']?.['toggleReasoning']();}['getInteractionAndReplyById'](_0x54d6cf){const [_0x22a143,_0x412d0b]=_0x54d6cf['split'](':'),_0x3931f6=this['activeConversation']['getInteraction'](_0x22a143),_0x31f84a=_0x3931f6['getReply'](_0x412d0b);return{'interaction':_0x3931f6,'reply':_0x31f84a};}['_scrollToSuggestionRange'](_0xa1e1d5,_0x38ef75=!0x1){const _0x368510=it(this['context']),_0x1448c8={'target':_0x368510['editing']['view']['domConverter']['viewRangeToDom'](_0x368510['editing']['mapper']['toViewRange'](_0xa1e1d5)),'viewportOffset':{'top':0x96,'left':0x0,'bottom':0x32,'right':0x0},'ancestorOffset':0x14,'alignToTop':_0x38ef75};_0x38ef75&&(_0x1448c8['alignToTop']=!0x0),rt(_0x1448c8);}['updateConversationTitle'](_0x3d27d3,_0x39a05a=!0x1){this['_aiChatUi']['setConversationTitle'](_0x3d27d3||Yn(this['context']['locale'],'AI_CHAT_UNTITLED_CONVERSATION'),_0x39a05a);}['_filterModels'](_0x445bcf,_0x3919b4){let _0x40395f;if(_0x3919b4){_0x40395f=[];const _0x5cfe31='string'==typeof _0x3919b4?[_0x3919b4['toLocaleLowerCase']()]:_0x3919b4['map'](_0x41ced5=>_0x41ced5['toLocaleLowerCase']());for(const _0x516dbb of _0x5cfe31)for(const _0x10c8b2 of _0x445bcf)(_0x10c8b2['id']['toLocaleLowerCase']()===_0x516dbb||_0x10c8b2['name']['toLocaleLowerCase']()===_0x516dbb||_0x10c8b2['provider']['toLocaleLowerCase']()===_0x516dbb||_0x10c8b2['id']['toLocaleLowerCase']()['startsWith'](_0x516dbb))&&_0x40395f['push'](_0x10c8b2);}else _0x40395f=_0x445bcf;return _0x40395f;}async['_updateReplyContent']({reply:_0x3ba86f,changeGroups:_0x1e4a30,renderingStrategy:_0x576dd8}){const {id:_0x256c6d,isDone:_0x54201f,type:_0x21252c,parsedContent:_0x390014}=_0x3ba86f;if('modification-delta'===_0x21252c){const _0x1fc476=p({'editor':it(this['context']),'showDiff':this['_aiChatUi']['showDiff'],'changeGroups':_0x1e4a30,'documentContextContent':_0x3ba86f['documentContextContent']});await this['_aiChatUi']['updateFeedItemAIReplySuggestionContent']({'id':_0x256c6d,'parts':_0x1fc476,'renderingStrategy':_0x576dd8,'isDone':_0x54201f});}else'text-delta'===_0x21252c&&await this['_aiChatUi']['updateFeedItemAIReplyContent']({'id':_0x256c6d,'parsedContent':_0x390014,'renderingStrategy':_0x576dd8,'isDone':_0x54201f});_0x54201f&&_0x3ba86f['sources']['length']>0x0&&this['_aiChatUi']['updateFeedItemAIReplySources'](_0x256c6d,_0x3ba86f['sources']);}async['_stopLastInteraction'](){const _0x2d015f=this['activeConversation']?.['lastInteraction'];_0x2d015f&&(_0x2d015f['stop'](),this['_aiChatUi']['stopInteraction'](_0x2d015f));}async['_flushLastInteractionUI'](){const _0x372d95=this['activeConversation']?.['lastInteraction'];if(_0x372d95){for await(const _0x3d18c8 of _0x372d95['replies'])await this['_updateReplyContent']({'reply':_0x3d18c8,'changeGroups':_0x3d18c8['changeGroups'],'renderingStrategy':'static'});}}}const Pt=[...Ee,'startConversation','resizeTabs','sendUserMessage','abortPromptStream','addDocumentToContext','addFileToContext','addUrlToContext','addResourceToContext','removeContextItem','loadSourceResources','toggleWebSearch','toggleReasoning','selectModel'];class nh extends _0xebef92{['actionsDropdown'];['children'];['showChangeInTextModel'];['insertSuggestionModel'];constructor(_0x173ebe){super(_0x173ebe);const _0x206a07=this['bindTemplate'];this['set']('isEnabled',!0x0),this['set']('isVisible',!0x0),this['showChangeInTextModel']=new _0x26f53f({'label':Yn(_0x173ebe,'AI_CHAT_SUGGESTION_ACTION_SHOW_CHANGE_IN_TEXT'),'icon':_0x4da215,'withText':!0x0,'type':'button','actionName':'showChangeInText'}),this['insertSuggestionModel']=new _0x26f53f({'label':Yn(_0x173ebe,'AI_CHAT_SUGGESTION_ACTION_INSERT_SUGGESTION'),'icon':_0x16c946,'withText':!0x0,'type':'button','actionName':'insertSuggestion'}),this['actionsDropdown']=new qo(_0x173ebe,{'listItemModels':[this['showChangeInTextModel'],this['insertSuggestionModel']]}),this['actionsDropdown']['on']('execute',()=>{this['fire']('applySuggestion');}),this['actionsDropdown']['on']('showChangeInText',()=>{this['fire']('showChangeInText');}),this['actionsDropdown']['on']('insertSuggestion',()=>{this['fire']('insertSuggestion');}),this['actionsDropdown']['set']({'label':'Apply','tooltip':Yn(this['locale'],'AI_CHAT_SUGGESTION_ACTION_APPLY_TOOLTIP'),'withText':!0x0,'class':'ck-ai-chat__feed__ai-suggestion__actions','balloonPanelClass':'ck-ai-chat__feed__ai-suggestion__actions__balloon'}),this['actionsDropdown']['bind']('isEnabled')['to'](this),this['children']=this['createCollection']([this['actionsDropdown']]),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed__ai-suggestion__actions',_0x206a07['if']('isVisible','ck-hidden',_0x53c823=>!_0x53c823)]},'children':[this['actionsDropdown']]});}['updateLabels'](_0x5420dc){const _0x547121=this['locale'];this['actionsDropdown']['set']({'label':Yn(_0x547121,'AI_CHAT_SUGGESTION_ACTION_APPLY_LABEL',_0x5420dc),'tooltip':Yn(_0x547121,'AI_CHAT_SUGGESTION_ACTION_APPLY_TOOLTIP',_0x5420dc)}),this['showChangeInTextModel']['label']=Yn(_0x547121,'AI_CHAT_SUGGESTION_ACTION_SHOW_CHANGE_IN_TEXT',_0x5420dc),this['insertSuggestionModel']['label']=Yn(_0x547121,'AI_CHAT_SUGGESTION_ACTION_INSERT_SUGGESTION',_0x5420dc);}}class qo extends _0x48f61c{['bodyCollection'];['balloonPanelView'];['listView'];['keystrokeHandler'];constructor(_0x4a5cd5,_0x365e35){super(_0x4a5cd5),this['balloonPanelView']=new _0x5b9e88(this['locale']),this['bodyCollection']=new zt(this['locale']),this['bodyCollection']['attachToDom'](),this['set']('balloonPanelClass',''),this['balloonPanelView']['bind']('class')['to'](this,'balloonPanelClass'),this['listView']=this['_setUpList'](_0x365e35['listItemModels']),this['bodyCollection']['add'](this['balloonPanelView']),this['balloonPanelView']['content']['add'](this['listView']),this['arrowView']['unbind']('tooltip'),this['arrowView']['set']('tooltip',Yn(this['locale'],'AI_CHAT_SUGGESTION_MORE_OPTIONS_TOOLTIP')),this['_setUpKeystrokes'](),this['on']('execute',()=>{this['balloonPanelView']['hide'](),this['arrowView']['focus']();}),this['on']('open',()=>{this['balloonPanelView']['isVisible']?(this['balloonPanelView']['hide'](),this['arrowView']['focus']()):(this['balloonPanelView']['pin']({'target':this['element'],'positions':['ltr'===this['locale']['uiLanguageDirection']?zo:Jo]}),this['listView']['focus']());}),_0x16cb96({'emitter':this['balloonPanelView'],'callback':()=>{this['balloonPanelView']['hide']();},'activator':()=>this['balloonPanelView']['isVisible'],'contextElements':()=>[this['element'],this['balloonPanelView']['element']]});}['_setUpList'](_0x2acc65){const _0x269526=this['locale'],_0x1dd3c5=new _0x3dc816(_0x269526);for(const _0x206512 of _0x2acc65){const _0x46aaaa=new _0x22bc08(_0x269526),_0x4eb9ae=new _0x270bf4(_0x269526);_0x4eb9ae['bind'](...Object['keys'](_0x206512))['to'](_0x206512),_0x4eb9ae['delegate']('execute')['to'](_0x1dd3c5),_0x46aaaa['children']['add'](_0x4eb9ae),_0x1dd3c5['items']['add'](_0x46aaaa);}return _0x1dd3c5['items']['delegate']('execute')['to'](this),_0x1dd3c5['on']('execute',_0x55f7ca=>{const _0x622d07=_0x55f7ca['source'];this['fire'](_0x622d07['actionName']),this['balloonPanelView']['hide'](),this['arrowView']['focus']();}),_0x1dd3c5;}['_setUpKeystrokes'](){this['keystrokeHandler']=new _0x3c58a3(),this['keystrokeHandler']['listenTo'](this['balloonPanelView']['element']),this['keystrokeHandler']['set']('esc',(_0x215034,_0x226ec6)=>{this['balloonPanelView']['hide'](),this['arrowView']['focus'](),_0x226ec6();});}['destroy'](){super['destroy'](),this['keystrokeHandler']['destroy'](),this['balloonPanelView']['destroy'](),this['bodyCollection']['detachFromDom']();}}function zo(_0x21296a){return{'top':_0x21296a['bottom'],'left':_0x21296a['left'],'name':'arrowless','config':{'withArrow':!0x1}};}function Jo(_0xf8c768,_0x5082d6){return{'top':_0xf8c768['bottom'],'left':_0xf8c768['left']-(_0x5082d6['width']-_0xf8c768['width']),'name':'arrowless','config':{'withArrow':!0x1}};}class ke extends Cr{['containerView'];['actionsView'];constructor(_0x4a536c,_0x5629b0){super(_0x5629b0),this['containerView']=new o(_0x4a536c,{'showDiff':_0x5629b0['showDiff'],'areActionsDisabled':_0x5629b0['areActionsDisabled']}),this['containerView']['on']('toggleSuggestionDisplayMode',(_0x40b6c7,_0x520f45)=>{this['fire']('toggleSuggestionDisplayMode',{'replyId':this['options']['id'],'showDiff':_0x520f45['showDiff']});}),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',(_0x4e4146,{index:_0x1e2f7f})=>{this['fire']('showChangeInText',{'replyId':this['options']['id'],'partIndex':_0x1e2f7f});}),this['containerView']['on']('insertSuggestion',(_0x8c32c,{index:_0x79f550})=>{this['fire']('insertSuggestion',{'replyId':this['options']['id'],'partIndex':_0x79f550});}),this['containerView']['on']('rejectSuggestion',(_0x34b142,{index:_0x3e1f16})=>{this['fire']('rejectSuggestion',{'replyId':this['options']['id'],'partIndex':_0x3e1f16});}),this['containerView']['on']('mouseOverSuggestion',(_0x438bdb,{index:_0x2d6fa8})=>{this['fire']('mouseOverSuggestion',{'replyId':this['options']['id'],'partIndex':_0x2d6fa8});}),this['containerView']['on']('mouseLeaveSuggestion',(_0x5e15d1,{index:_0x6a471b})=>{this['fire']('mouseLeaveSuggestion',{'replyId':this['options']['id'],'partIndex':_0x6a471b});}),this['actionsView']=new nh(_0x4a536c),this['actionsView']['on']('showChangeInText',()=>{this['fire']('showChangeInText',{'replyId':this['options']['id']});}),this['actionsView']['on']('insertSuggestion',()=>{this['fire']('insertSuggestion',{'replyId':this['options']['id']});}),this['actionsView']['on']('applySuggestion',()=>{this['fire']('applySuggestion',{'replyId':this['options']['id']});}),_0x5629b0['areActionsDisabled']?this['actionsView']['isEnabled']=!0x1:this['actionsView']['bind']('isEnabled')['to'](this['containerView']['bodyView'],'hasPendingParts'),this['children']['addMany']([this['containerView'],this['actionsView']]),this['extendTemplate']({'attributes':{'class':['ck-ai-chat__feed__ai-suggestion']}});}async['updateContent'](_0x4504d0){await this['containerView']['updateContent'](_0x4504d0),this['actionsView']['updateLabels'](this['containerView']['bodyView']['partsCount']);}['updatePartState'](_0x301189,_0x85ce81){this['containerView']['bodyView']['updatePartState'](_0x301189,_0x85ce81);}['updateSources'](_0x186c29){this['containerView']['updateSources'](_0x186c29);}['getPartView'](_0x1a17a4){return this['containerView']['bodyView']['getPartView'](_0x1a17a4);}['markAsDone'](){super['markAsDone'](),this['containerView']['markAsDone'](),this['actionsView']['isVisible']=this['containerView']['bodyView']['hasNonEmptyParts'];}}class je extends Cr{['replyContainer'];constructor(_0x49d010,_0xaaaaa2){super(_0xaaaaa2),this['locale']=_0x49d010,this['extendTemplate']({'attributes':{'class':['ck-ai-chat__feed__ai-reply']}}),this['replyContainer']=new _0xebef92(),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':Oe(this['options']['initialContent']),'renderingStrategy':'static'}),this['markAsDone']());}async['updateContent']({parsedContent:_0x230cc3,renderingStrategy:_0x2774ab,abortSignal:_0x53e210}){'streaming'===_0x2774ab?await this['streamIntoElement'](_0x230cc3,this['replyContainer']['element'],_0x53e210):this['replyContainer']['element']['innerHTML']=_0x4b9a76(_0x230cc3);}['updateSources'](_0x568583){const _0x7ee9f8=new jr(this['locale']);_0x7ee9f8['children']['addMany'](_0x568583['map'](_0x782232=>new Sr(this['locale'],_0x782232))),_0x7ee9f8['isVisible']=!0x0,this['children']['add'](_0x7ee9f8);}}const kn={'file':_0x4a15c3,'document':_0xacaacc,'web-resource':_0x5d9ba5,'text':_0x4a15c3,'selection':_0x2f906c},jn='ck-ai-chat-context-chip',Jn='ck-ai-chat-context-chip_wide',Zn='ck-ai-chat-context-chip_document',Dr='ck-ai-chat-context-chip__label',Gr='ck-ai-chat-context-chip__type-icon',Kr='ck-ai-chat-context-controls__chip-tooltip',Cn='n';class xo extends _0xa24b3c{constructor(_0x3aad38,_0x1b3dfe,_0x112abe,_0x18f028,_0x4cbd6b=!0x1){super(_0x3aad38),this['_isAnimationOnEnterEnabled']=_0x18f028,this['_initializeProperties'](_0x1b3dfe,_0x112abe,_0x4cbd6b),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'](_0x131096,_0x15725f,_0x4c1b39){this['set']('label',_0x131096['label']),this['set']('tooltip',!0x0),this['set']('itemType',_0x131096['type']),this['set']('id',_0x131096['uiId']),this['set']('readonly',_0x15725f),this['set']('isLoading',_0x4c1b39);}['_setupTemplate'](){const _0x21c63d=this['_createIconView'](),_0x5c7985=this['_createRemoveButton'](),_0x57feab=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':this['_createTemplateAttributes'](_0x57feab),'children':this['_createTemplateChildren'](_0x21c63d,_0x5c7985,_0x57feab)});}['_createTemplateAttributes'](_0xe20d2d){return{'class':[jn,_0xe20d2d['if']('itemType',Zn,_0x59176e=>'document'==_0x59176e),_0xe20d2d['if']('itemType',Jn,_0x9adc8d=>'selection'==_0x9adc8d)],'data-cke-tooltip-text':_0xe20d2d['to']('label',In),'data-cke-tooltip-position':Cn,'data-cke-tooltip-class':Kr};}['_createTemplateChildren'](_0x3c3229,_0x54f682,_0x47b858){const _0x4c3c8c=this['_createLabelElement'](_0x47b858),_0x49919d=this['_createLoaderIcon']();return this['readonly']?[_0x3c3229,_0x4c3c8c]:[_0x3c3229,_0x49919d,_0x4c3c8c,_0x54f682];}['_createLabelElement'](_0xaaa537){return{'tag':'span','attributes':{'class':Dr},'children':[{'text':_0xaaa537['to']('label')}]};}['_createRemoveButton'](){const _0x132a41=new _0xa24b3c(this['locale']);return _0x132a41['set']({'label':Yn(this['locale'],'AI_CHAT_CONTEXT_REMOVE_FROM_CONTEXT'),'icon':_0xcb8165}),this['_setupRemoveButtonEvent'](_0x132a41),_0x132a41;}['_setupRemoveButtonEvent'](_0x4fa9b9){_0x4fa9b9['on']('execute',()=>{this['fire']('removeContextItemChip',this['id']);});}['_createIconView'](){const _0x413033=this['bindTemplate'],_0x5df559=new _0x23cd9a();return _0x5df559['content']=kn[this['itemType']],_0x5df559['extendTemplate']({'attributes':{'class':[Gr,_0x413033['if']('isLoading','ck-hidden',_0x331651=>_0x331651)]}}),_0x5df559;}['_handleAnimationEndOnce'](_0x26b2e2,_0x238664){if(!_0x26b2e2)return;const _0x3aec63=()=>{_0x238664(),_0x26b2e2['removeEventListener']('animationend',_0x3aec63),_0x26b2e2['removeEventListener']('webkitAnimationEnd',_0x3aec63);};_0x26b2e2['addEventListener']('animationend',_0x3aec63),_0x26b2e2['addEventListener']('webkitAnimationEnd',_0x3aec63);}['_createLoaderIcon'](){const _0xf8a183=new De('small');return _0xf8a183['bind']('isVisible')['to'](this,'isLoading',_0x1dfdfd=>_0x1dfdfd),_0xf8a183;}}function In(_0x52152a){if(!_0x52152a)return _0x52152a;if(_0x52152a['length']<=0x78)return _0x52152a;const _0x36882e=_0x52152a['slice'](0x0,0x78),_0x3c27b7=_0x36882e['lastIndexOf']('\x20');return(_0x3c27b7>0x0?_0x36882e['slice'](0x0,_0x3c27b7):_0x36882e)+'…';}const hn={'maxVisibleRows':0x2,'rowDetectionTolerance':0x5,'showMoreLabelPrefix':'+\x20','viewportOffset':{'top':0x64,'bottom':0xa}},ln='300px';class wo{['_locale'];['_config'];['_visibleChips'];['_overflowChips'];['_showMoreButtonView']=null;['_showMoreBalloonPanelView']=null;['_containerElement']=null;['_bodyCollection'];['_parentView']=null;['_intersectionObserver']=null;['_pendingCalculation']=!0x1;constructor(_0x546b0b,_0x3ac82b,_0x137efc,_0x1dc935,_0x3134ee){this['_locale']=_0x546b0b,this['_visibleChips']=_0x3ac82b,this['_config']={...hn,..._0x137efc,'cssClasses':{'controlsButton':'','calculationContainer':'ck-calculation-container',..._0x137efc['cssClasses']}},this['_overflowChips']=new _0x6ba718(),this['_bodyCollection']=_0x1dc935,this['_parentView']=_0x3134ee||null;}['setContainerElement'](_0x219b64){this['_intersectionObserver']&&(this['_intersectionObserver']['disconnect'](),this['_intersectionObserver']=null),this['_containerElement']=_0x219b64,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 _0x5847a4=[...this['_visibleChips'],...this['_overflowChips']],_0x4cdd65=this['_createCalculationContainer'](),_0x2f2488=this['_calculateOverflowInContainer'](_0x4cdd65,_0x5847a4),_0x1731f0=_0x4cdd65['_ancestorsToRestore'];_0x1731f0&&this['_restoreAncestorVisibility'](_0x1731f0),_0x4cdd65['remove'](),this['_applyOverflowResults'](_0x5847a4,_0x2f2488);}['_createShowMoreButton'](){this['_showMoreButtonView']=this['_createShowMoreButtonView'](),this['_showMoreBalloonPanelView']=this['_createShowMoreBalloonPanelView'](),this['_showMoreButtonView']['render'](),this['_containerElement']['appendChild'](this['_showMoreButtonView']['element']),this['_showMoreButtonView']['on']('execute',()=>{this['_handleShowMoreButtonClick']();}),_0x16cb96({'emitter':this['_showMoreBalloonPanelView'],'contextElements':[this['_showMoreBalloonPanelView']['element'],this['_showMoreButtonView']['element']],'callback':()=>this['hideBalloonPanel'](),'activator':()=>this['_showMoreButtonView']['isOn']});}['_createShowMoreButtonView'](){const _0x22e4c3=new _0xa24b3c(this['_locale']);_0x22e4c3['set']({'label':'','withText':!0x0,'isToggleable':!0x0});const _0x4c193d=[this['_config']['cssClasses']['showMoreButton']];return this['_config']['cssClasses']['controlsButton']&&_0x4c193d['push'](this['_config']['cssClasses']['controlsButton']),_0x22e4c3['extendTemplate']({'attributes':{'class':_0x4c193d}}),_0x22e4c3;}['_createShowMoreBalloonPanelView'](){const _0x220319=new _0x5b9e88(this['_locale']);return _0x220319['extendTemplate']({'attributes':{'class':this['_config']['cssClasses']['showMoreBalloon']}}),this['_bodyCollection']['add'](_0x220319),_0x220319;}['_updateBalloonContent'](){if(this['_showMoreBalloonPanelView']&&(this['_showMoreBalloonPanelView']['content']['clear'](),this['_overflowChips']['length']>0x0)){this['_overflowChips']['forEach'](_0x99ac7a=>{_0x99ac7a['disableAnimationOnEnter']();});const _0x24ed63=new _0xebef92(this['_locale']);_0x24ed63['setTemplate']({'tag':'div','attributes':{'class':this['_config']['cssClasses']['overflowContainer']},'children':this['_overflowChips']}),this['_showMoreBalloonPanelView']['content']['add'](_0x24ed63);}}['_handleShowMoreButtonClick'](){this['_showMoreButtonView']['isOn']?this['hideBalloonPanel']():this['showBalloonPanel']();}['_updateShowMoreButtonVisibility'](){const _0x1fed6a=this['_overflowChips']['length']>0x0;this['_showMoreButtonView']?.['element']&&(this['_showMoreButtonView']['element']['style']['display']=_0x1fed6a?'':'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'](_0x131be3){const _0x30acac=this['_containerElement']?.['tagName']['toLowerCase']()||'div',_0x64c5fe=this['_containerElement']?.['classList'];if(_0x64c5fe){const _0x5aa938=_0x64c5fe[0x0]||'',_0x2b735a=_0x131be3['querySelector']('.'+_0x5aa938),_0x38c8b2=_0x131be3['querySelector'](_0x30acac);return _0x2b735a||_0x38c8b2||_0x131be3;}return _0x131be3['querySelector'](_0x30acac)||_0x131be3;}['_calculateContainerWidth'](){const _0x533c97=this['_parentView']?.['element']||this['_containerElement'];if(!_0x533c97)return ln;const _0x1b5480=window['getComputedStyle'](_0x533c97)['width'];if('auto'===_0x1b5480||'0px'===_0x1b5480||!_0x1b5480){const _0x280425=_0x533c97['parentElement'];if(_0x280425){const _0xfdcb70=window['getComputedStyle'](_0x280425);return'auto'!==_0xfdcb70['width']?_0xfdcb70['width']:ln;}return ln;}return _0x1b5480;}['_applyCalculationStyles'](_0x2b80c1,_0x2075ed){this['_config']['cssClasses']['calculationContainer']&&_0x2b80c1['classList']['add'](this['_config']['cssClasses']['calculationContainer']),_0x2b80c1['style']['width']=_0x2075ed,_0x2b80c1['style']['position']='absolute',_0x2b80c1['style']['top']='-9999px',_0x2b80c1['style']['left']='-9999px',_0x2b80c1['style']['opacity']='0',_0x2b80c1['style']['pointerEvents']='none',_0x2b80c1['style']['zIndex']='-1',_0x2b80c1['style']['visibility']='visible\x20!important',_0x2b80c1['style']['display']='block\x20!important',_0x2b80c1['style']['boxSizing']='border-box';}['_restoreAncestorVisibility'](_0x351e67){_0x351e67['forEach'](({element:_0x279352,originalDisplay:_0x3fab1d,originalVisibility:_0x4d687c})=>{_0x279352['style']['display']=_0x3fab1d,_0x279352['style']['visibility']=_0x4d687c;});}['_makeAncestorsVisible'](_0x4e16fb){const _0x290b61=[];let _0x49452e=_0x4e16fb;for(;_0x49452e&&_0x49452e!==document['body'];){const _0x102fe6=window['getComputedStyle'](_0x49452e);'none'!==_0x102fe6['display']&&'hidden'!==_0x102fe6['visibility']||(_0x290b61['push']({'element':_0x49452e,'originalDisplay':_0x49452e['style']['display'],'originalVisibility':_0x49452e['style']['visibility']}),_0x49452e['style']['display']='block',_0x49452e['style']['visibility']='visible'),_0x49452e=_0x49452e['parentElement'];}return _0x290b61;}['_createContainerElements'](){let _0x21f5ba,_0x2b1b94;return this['_parentView']?.['element']?(_0x21f5ba=this['_parentView']['element']['cloneNode'](!0x0),_0x2b1b94=this['_findTargetContainer'](_0x21f5ba)):(_0x21f5ba=document['createElement']('div'),_0x2b1b94=_0x21f5ba),{'calculationContainer':_0x21f5ba,'targetContainer':_0x2b1b94};}['_createCalculationContainer'](){const {calculationContainer:_0x7004ba,targetContainer:_0x3b97ce}=this['_createContainerElements'](),_0x195254=this['_calculateContainerWidth']();this['_applyCalculationStyles'](_0x7004ba,_0x195254);const _0x478526=this['_parentView']?.['element']||this['_containerElement'],_0x323ed2=_0x478526?.['parentElement'];_0x323ed2?_0x323ed2['appendChild'](_0x7004ba):document['body']['appendChild'](_0x7004ba),_0x7004ba['_targetContainer']=_0x3b97ce;const _0x26614f=this['_makeAncestorsVisible'](_0x323ed2||null);return _0x7004ba['offsetWidth'],_0x7004ba['_ancestorsToRestore']=_0x26614f,_0x7004ba;}['_calculateOverflowInContainer'](_0x5588c6,_0x13d329){const _0x5ae9c4=_0x5588c6['_targetContainer']||_0x5588c6,_0x5581fd=[],{rowCount:_0x12cde0}=this['_renderChipsAndCountRows'](_0x5ae9c4,_0x13d329);if(_0x12cde0<=this['_config']['maxVisibleRows'])return _0x5581fd;const _0x1e46c5=_0x13d329['slice']();for(;_0x1e46c5['length']>0x0;){if(this['_testButtonFit'](_0x5588c6,_0x5ae9c4,_0x1e46c5)){const _0x49a452=_0x13d329['filter'](_0x3623d9=>!_0x1e46c5['includes'](_0x3623d9));_0x5581fd['push'](..._0x49a452);break;}if(!_0x1e46c5['pop']())break;}return _0x5581fd;}['_renderChipsAndCountRows'](_0x4c9eed,_0x2abaeb){_0x4c9eed['innerHTML']='',_0x2abaeb['forEach'](_0x1a7615=>{if(_0x1a7615['element']){const _0x31468c=_0x1a7615['element']['cloneNode'](!0x0);_0x4c9eed['appendChild'](_0x31468c);}}),_0x4c9eed['offsetWidth'];const _0x51b742=_0x4c9eed['children'],_0x431dec=[];return Array['from'](_0x51b742)['forEach'](_0xbb0620=>{const _0x22a6f8=_0xbb0620['getBoundingClientRect']()['top'];_0x431dec['some'](_0x16588a=>Math['abs'](_0x16588a-_0x22a6f8)<this['_config']['rowDetectionTolerance'])||_0x431dec['push'](_0x22a6f8);}),{'rowCount':_0x431dec['length']};}['_createMockButton'](){const _0x360db2=document['createElement']('button');return _0x360db2['className']=this['_config']['cssClasses']['showMoreButton'],this['_config']['cssClasses']['controlsButton']&&_0x360db2['classList']['add'](this['_config']['cssClasses']['controlsButton']),_0x360db2['textContent']='+\x201',_0x360db2;}['_testButtonFit'](_0x2ac5d0,_0x3e6bf3,_0x3f7f4a){this['_renderChipsAndCountRows'](_0x3e6bf3,_0x3f7f4a);const _0x58bd65=this['_createMockButton']();_0x2ac5d0['appendChild'](_0x58bd65),_0x2ac5d0['offsetWidth'];const _0x3e409a=[..._0x3e6bf3['children'],_0x58bd65],_0x32f1f5=[];_0x3e409a['forEach'](_0xff75b3=>{const _0x34ff47=_0xff75b3['getBoundingClientRect']()['top'];_0x32f1f5['some'](_0x19458f=>Math['abs'](_0x19458f-_0x34ff47)<this['_config']['rowDetectionTolerance'])||_0x32f1f5['push'](_0x34ff47);});const _0x3b49f7=_0x32f1f5['length'];return _0x58bd65['remove'](),_0x3b49f7<=this['_config']['maxVisibleRows'];}['_distributeChips'](_0x51a3d3,_0x3b912b){this['_visibleChips']['clear'](),this['_overflowChips']['clear'](),_0x51a3d3['forEach'](_0x5bc6ef=>{_0x3b912b['includes'](_0x5bc6ef)?this['_overflowChips']['add'](_0x5bc6ef):this['_visibleChips']['add'](_0x5bc6ef);});}['_updateOverflowUI'](_0x126ad1){if(_0x126ad1>0x0&&!this['_showMoreButtonView']&&this['_createShowMoreButton'](),_0x126ad1>0x0&&this['_showMoreButtonView']){const _0x5087d3=''+this['_config']['showMoreLabelPrefix']+(_0x126ad1<0x63?_0x126ad1:'99');this['_showMoreButtonView']['label']=_0x5087d3;}this['_updateBalloonContent'](),this['_updateShowMoreButtonVisibility'](),this['_repinBalloonPanel']();}['_applyOverflowResults'](_0x3c557e,_0x3c5ac5){this['_distributeChips'](_0x3c557e,_0x3c5ac5),this['_updateOverflowUI'](_0x3c5ac5['length']);}['_setupVisibilityObserver'](){this['_containerElement']&&'undefined'!=typeof IntersectionObserver&&(this['_intersectionObserver']=new IntersectionObserver(_0x2881bb=>{_0x2881bb[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 _0x21738b=this['_containerElement']['getBoundingClientRect']();if(0x0===_0x21738b['width']||0x0===_0x21738b['height'])return!0x1;const _0x175e3a=window['innerHeight']||document['documentElement']['clientHeight'],_0x3ea7cc=window['innerWidth']||document['documentElement']['clientWidth'],_0x104f25=0xc8;return _0x21738b['bottom']>=-0xc8&&_0x21738b['top']<=_0x175e3a+_0x104f25&&_0x21738b['right']>=-0xc8&&_0x21738b['left']<=_0x3ea7cc+_0x104f25;}}const Wr='ck-ai-chat__feed__context-chips',Yr='ck-ai-chat-context-chips-wrapper',$r='ck-ai-chat-context-chips-wrapper-balloon',Qr='ck-ai-chat-controls-button',Xr='ck-ai-chat-controls_context_show-more-button',Jr='ck-ai-chat-context-controls__show-more-balloon-panel';class ah extends _0xebef92{['_contextChips']=this['createCollection']();['_overflowManager'];['_bodyCollection'];constructor(_0x159db1,_0x27db8c,_0x265219){super(_0x159db1),this['_bodyCollection']=_0x265219,this['_createContextChips'](_0x27db8c);const _0x3671e4={'cssClasses':{'showMoreButton':Xr,'showMoreBalloon':Jr,'overflowContainer':$r,'controlsButton':Qr}};this['_overflowManager']=new wo(_0x159db1,this['_contextChips'],_0x3671e4,this['_bodyCollection'],this),this['setTemplate']({'tag':'div','attributes':{'class':[Wr,'ck','ck-reset_all']},'children':[{'tag':'div','attributes':{'class':Yr},'children':this['_contextChips']}]});}['render'](){super['render']();const _0x98158d=this['element']['querySelector']('.'+Yr);_0x98158d&&(this['_overflowManager']['setContainerElement'](_0x98158d),this['_overflowManager']['reorganizeChips']());}['destroy'](){super['destroy'](),this['_overflowManager']['destroy']();}['_createContextChips'](_0x3c7a81){for(const _0x272cc8 of _0x3c7a81){const _0x5ca702=new xo(this['locale'],_0x272cc8,!0x0,!0x1);this['_contextChips']['add'](_0x5ca702);}}}class Le extends Cr{['_contextChipsView']=null;['_locale'];['_bodyCollection'];['_messageContentView'];constructor(_0x421fd2,_0xb86857,_0x149671){super(_0xb86857),this['_locale']=_0x421fd2,this['_bodyCollection']=_0x149671,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 ah(this['_locale'],this['options']['contextItems']['filter'](_0x3b8c83=>!_0x3b8c83['hidden']),this['_bodyCollection']),this['_contextChipsView']['extendTemplate']({'attributes':{'class':'ck-ai-chat__feed__context-chips'}}),this['children']['add'](this['_contextChipsView']));}['_createMessageContentView'](){this['_messageContentView']=new _0xebef92(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 Rt extends Cr{constructor(_0x108a64,_0x34a84){super(_0x34a84);const {isWebSearchEnabled:_0x255e40,isReasoningEnabled:_0x4cb0f8}=_0x34a84['capabilities'],_0x137078=[];let _0x4f4ebc='';_0x255e40&&_0x4cb0f8?(_0x4f4ebc=Yn(_0x108a64,'AI_CHAT_FEED_REPLY_ITEM_USED_WEB_SEARCH_REASONING'),_0x137078['push'](e_(_0x490596)),_0x137078['push'](e_(_0x5d9036))):_0x255e40?(_0x4f4ebc=Yn(_0x108a64,'AI_CHAT_FEED_REPLY_ITEM_USED_WEB_SEARCH'),_0x137078['push'](e_(_0x490596))):_0x4cb0f8&&(_0x4f4ebc=Yn(_0x108a64,'AI_CHAT_FEED_REPLY_ITEM_USED_REASONING'),_0x137078['push'](e_(_0x5d9036))),this['extendTemplate']({'attributes':{'class':['ck-ai-chat__feed__interaction-header',_0x4f4ebc?'':'ck-hidden']}});const _0x2cd6e0=new _0xebef92();_0x2cd6e0['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed__interaction-header__capabilities']},'children':[..._0x137078,{'tag':'span','attributes':{'class':['ck-ai-chat__feed__interaction-header__capabilities__text']},'children':[_0x4f4ebc]}]}),this['children']['add'](_0x2cd6e0);}}function e_(_0x21fe22){const _0x2bec94=new _0x23cd9a();return _0x2bec94['content']=_0x21fe22,_0x2bec94;}const ps=['wheel','touchstart','pointerdown','keydown'],ws=['ArrowUp','ArrowDown','PageUp','PageDown','Home','End','\x20'];class Ae{['element'];['animationFrameId'];['isRunning'];['abortController'];['isUserPaused'];constructor(_0x260034){this['element']=_0x260034,this['animationFrameId']=null,this['isRunning']=!0x1,this['abortController']=new AbortController(),this['isUserPaused']=!0x1;for(const _0x13b707 of ps){const _0x4c3ae6='keydown'!==_0x13b707;this['element']['addEventListener'](_0x13b707,this['_onUserEvent']['bind'](this),{'passive':_0x4c3ae6,'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'](_0x31f664){if(this['isRunning']){if('keydown'===_0x31f664['type']){const _0x4df50b=_0x31f664['key'];if(!ws['includes'](_0x4df50b))return;}_0x31f664 instanceof WheelEvent?_0x31f664['deltaY']<0x0?this['isUserPaused']=!0x0:this['isUserPaused']=!this['_isAtBottom']():this['isUserPaused']=!0x0;}}['_isAtBottom'](){const {scrollTop:_0x223c09,scrollHeight:_0x267b04,clientHeight:_0x124fbf}=this['element'];return _0x267b04-_0x223c09-_0x124fbf<=0x5;}['_rafUpdate'](){this['isRunning']&&(this['isUserPaused']||this['element']['scrollTo']({'top':this['element']['scrollHeight'],'behavior':'auto'}),this['animationFrameId']=requestAnimationFrame(this['_rafUpdate']['bind'](this)));}}class Fe extends _0xebef92{constructor(_0x307ff3,_0x5e195e){super(_0x307ff3),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-skeleton']},'children':this['_createSkeletonItems'](_0x5e195e)});}['_createSkeletonItems'](_0x87bd05){const _0x18b8ea=['ck','ck-ai-skeleton__item'];return _0x87bd05['map'](_0x57eccb=>{let _0x1549c4='';switch(_0x57eccb['attributes']['align']){case'right':_0x1549c4='margin-left:\x20auto;\x20margin-right:\x200;\x20text-align:\x20right;';break;case'center':_0x1549c4='margin-left:\x20auto;\x20margin-right:\x20auto;\x20text-align:\x20center;';break;case'left':_0x1549c4='margin-left:\x200;\x20margin-right:\x20auto;\x20text-align:\x20left;';}return{'tag':_0x57eccb['tag'],'attributes':{'class':[..._0x18b8ea,_0x57eccb['attributes']['class']?_0x57eccb['attributes']['class']:''],'style':'width:\x20'+_0x57eccb['attributes']['width']+';\x20height:\x20'+_0x57eccb['attributes']['height']+';'+_0x1549c4}};});}}const Be={'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':$i(0x5,'100%','44px','right'),'aiChatResources':$i(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 $i(_0x4af3d9,_0x1113eb,_0x3f7eb4,_0x15afd7){return new Array(_0x4af3d9)['fill'](null)['map'](()=>({'tag':'div','attributes':{'width':_0x1113eb,'height':_0x3f7eb4,'align':_0x15afd7}}));}class pi extends _0xebef92{['children'];['scrollManager'];['_bodyCollection'];constructor(_0x436699,_0x47444b){super(_0x436699),this['_bodyCollection']=_0x47444b,this['set']('isPending',!0x1),this['set']('loadingMessage',''),this['set']('isLoadingSkeletonVisible',!0x1),this['children']=this['createCollection'](),this['children']['delegate'](...Pt)['to'](this),this['_setupTemplate']();}['render'](){super['render'](),this['scrollManager']=new Ae(this['element']);}['destroy'](){super['destroy'](),this['scrollManager']['destroy']();}['clear'](){this['children']['clear']();}['addItem'](_0x584545,_0x4f55ff){let _0x487c5d;_0x487c5d='ai-reply'===_0x584545?new je(this['locale'],_0x4f55ff):'ai-suggestion-reply'===_0x584545?new ke(this['locale'],_0x4f55ff):'user-message'===_0x584545?new Le(this['locale'],_0x4f55ff,this['_bodyCollection']):'interaction-header'===_0x584545?new Rt(this['locale'],_0x4f55ff):new Te(_0x4f55ff),this['children']['add'](_0x487c5d);}async['updateReplyItem']({id:_0x5df67e,parsedContent:_0x17dbe3,renderingStrategy:_0x3c0034,abortSignal:_0x1f9c7a}){const _0xf802a4=this['getItemById'](_0x5df67e);if(!(_0xf802a4 instanceof je))throw new _0xa14e6e('ai-chat-feed-view-item-not-a-reply-item',null,{'itemView':_0xf802a4,'id':_0x5df67e,'parsedContent':_0x17dbe3});await _0xf802a4['updateContent']({'parsedContent':_0x17dbe3,'renderingStrategy':_0x3c0034,'abortSignal':_0x1f9c7a});}async['updateWebSources'](_0x181aac,_0xe89492){const _0x2951be=this['getItemById'](_0x181aac);if(_0x2951be instanceof ke)_0x2951be['updateSources'](_0xe89492);else{if(!(_0x2951be instanceof je))throw new _0xa14e6e('ai-chat-feed-view-item-not-a-suggestion-or-reply-item',null,{'itemView':_0x2951be,'id':_0x181aac,'sources':_0xe89492});_0x2951be['updateSources'](_0xe89492);}}async['updateSuggestionItem']({id:_0x1f8f7b,parts:_0x107d0d,renderingStrategy:_0x1cddb6,abortSignal:_0x553616}){const _0xc7da01=this['getItemById'](_0x1f8f7b);if(!(_0xc7da01 instanceof ke))throw new _0xa14e6e('ai-chat-feed-view-item-not-a-suggestion-item',null,{'itemView':_0xc7da01,'id':_0x1f8f7b,'parts':_0x107d0d});await _0xc7da01['updateContent']({'parts':_0x107d0d,'renderingStrategy':_0x1cddb6,'abortSignal':_0x553616});}['updateSuggestionPartState']({id:_0x3bbdda,index:_0x5315dd,state:_0xc17ef6}){const _0x344599=this['getItemById'](_0x3bbdda);if(!(_0x344599 instanceof ke))throw new _0xa14e6e('ai-chat-feed-view-item-not-a-suggestion-item',this,{'id':_0x3bbdda});_0x344599['updatePartState'](_0x5315dd,_0xc17ef6);}['markItemAsDone'](_0x176dac){this['getItemById'](_0x176dac)['markAsDone']();}['getItemIds'](){return this['children']['map'](_0x3793be=>_0x3793be['options']['id']);}['removeItem'](_0x171b18){this['children']['remove'](this['getItemById'](_0x171b18));}['scrollToSuggestion'](_0x1f57ed,_0x11c57a){const _0x5e1a8d=this['getItemById'](_0x1f57ed);if(!(_0x5e1a8d instanceof ke))return void _0x49365e('ck-ai-chat-feed-view-scroll-to-suggestion-invalid-item',{'replyId':_0x1f57ed,'partIndex':_0x11c57a});const _0x5db860=_0x5e1a8d['getPartView'](_0x11c57a);_0x5db860?rt({'target':_0x5db860['element'],'ancestorOffset':0x14,'alignToTop':!0x0,'forceScroll':!0x0}):_0x49365e('ck-ai-chat-feed-view-scroll-to-suggestion-part-view-not-found',{'replyId':_0x1f57ed,'partIndex':_0x11c57a});}['_setupTemplate'](){this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed']},'children':this['_createTemplateChildren']()});}['_createTemplateChildren'](){const _0x1c8720=this['_createSkeletonLoader']();return[this['_createFeedItems'](),_0x1c8720,this['_createFeedLoader']()];}['_createSkeletonLoader'](){const _0x48cd0a=new Fe(this['locale'],Be['aiFeed']);return _0x48cd0a['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isLoadingSkeletonVisible','ck-hidden',_0x2c726d=>!_0x2c726d)]}}),_0x48cd0a;}['_createFeedItems'](){const _0x2afeab=new _0xebef92(this['locale']);return _0x2afeab['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed__items',this['bindTemplate']['if']('isLoadingSkeletonVisible','ck-hidden')]},'children':this['children']}),_0x2afeab;}['_createFeedLoader'](){const _0x269e71=new _0xebef92(this['locale']);return _0x269e71['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__loader',this['bindTemplate']['if']('isPending','ck-hidden',_0x47e5a5=>!_0x47e5a5)]},'children':this['_createLoaderChildren']()}),_0x269e71;}['_createLoaderChildren'](){const _0xa668b1=new De();return _0xa668b1['isVisible']=!0x0,[_0xa668b1,{'tag':'span','attributes':{'class':['ck','ck-ai-chat__loader-text']},'children':[{'text':this['bindTemplate']['to']('loadingMessage')}]}];}['getItemById'](_0x3e86dd){const _0x3a2b03=this['children']['find'](_0x43341f=>_0x43341f['options']['id']['includes'](_0x3e86dd));if(!_0x3a2b03)throw new _0xa14e6e('ai-chat-feed-view-item-not-found',this,{'id':_0x3e86dd});return _0x3a2b03;}['setLoadingMessage'](_0x2f7409){this['set']('loadingMessage',_0x2f7409);}['toggleLoadingSkeleton'](_0x37152b){this['set']('isLoadingSkeletonVisible',_0x37152b);}['startAutoScroll'](){this['scrollManager']['start']();}['stopAutoScroll'](){this['scrollManager']['stop']();}}class Ir extends _0x3dc816{['filter'](){let _0x31c87d=0x0;for(const _0x192c4b of this['items'])_0x31c87d+=_0x192c4b['items']['length'];return{'resultsCount':_0x31c87d,'totalItemsCount':_0x31c87d};}}class Ce extends _0x103d7a{['submitButtonView'];static ['MIN_ROWS']=0x1;static ['MAX_ROWS']=0xc;['_addContextButtonView'];['_queryViewResizeObserver'];constructor(_0x2e6577,_0x216816){super(_0x2e6577,{'queryView':{'label':'','creator':_0x3d9c16,'showIcon':!0x1,'showResetButton':!0x1},'filteredView':new Ir(_0x2e6577),'queryMinChars':0x1/0x0,'resetOnBlur':!0x1}),this['set']('isEmpty',!0x0),this['set']('isUploadInProgress',!0x1),this['_addContextButtonView']=_0x216816,this['_queryViewResizeObserver']=null,this['queryView']['fieldView']['minRows']=Ce['MIN_ROWS'],this['queryView']['fieldView']['maxRows']=Ce['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',(_0x1acfef,_0x315130)=>!_0x1acfef&&!_0x315130),this['focusableChildren']['add'](this['submitButtonView']);}['render'](){super['render'](),this['queryView']['fieldWrapperChildren']['add'](this['submitButtonView']),this['keystrokes']['set']('enter',(_0x128454,_0x2fafd2)=>{this['isUploadInProgress']||this['isEmpty']||_0x128454['target']==this['queryView']['fieldView']['element']&&(this['submit'](),_0x2fafd2());}),this['queryView']['fieldView']['on']('update',()=>{this['isEmpty']=''===this['queryView']['fieldView']['element']['value']?.['trim']();});}['destroy'](){super['destroy'](),this['_queryViewResizeObserver']&&this['_queryViewResizeObserver']['destroy']();}['submit'](){const _0x3223a4=this['queryView']['fieldView']['element']['value']?.['trim']();if(!_0x3223a4)return this['queryView']['errorText']=Yn(this['locale'],'AI_CHAT_PROMPT_EMPTY_ERROR'),void(this['queryView']['fieldView']['hasError']=!0x0);this['queryView']['fieldView']['hasError']=!0x1;const _0x494606=_0x5453ce(_0x3223a4);this['fire']('sendUserMessage',_0x494606),this['queryView']['fieldView']['reset']();}['setPlaceholderText'](_0x2489f8){this['queryView']['fieldView']['set']('placeholder',_0x2489f8);}['_createSubmitButton'](){const _0x47cb67=new _0xa24b3c(this['locale']);return _0x47cb67['set']({'icon':_0x3720ea,'label':Yn(this['locale'],'AI_CHAT_LABEL_SUBMIT'),'isVisible':!0x0,'tooltip':!0x0,'class':'ck-ai-chat__prompt-submit-button','isEnabled':!0x1}),_0x47cb67['on']('execute',()=>{this['submit']();}),_0x47cb67;}['setIsUploadInProgress'](_0x404f0a){this['isUploadInProgress']=_0x404f0a;}['_setUpAddContextButtonPositioning'](){const _0x5c8169=this['locale'],_0x1f6744=()=>{_0x3c96fa['window']['requestAnimationFrame'](()=>{if(_0x4f30a4(this['element'])){const _0x30950b=new _0x317c72(this['queryView']['fieldView']['element']),_0x2c5d86=new _0x317c72(this['_addContextButtonView']['element']),_0x17f414=_0x30950b['width'],_0x13e510='rtl'===_0x5c8169['uiLanguageDirection']?'right':'left';_0x30950b['excludeScrollbarsAndBorders']();const _0x492e1a=_0x17f414-_0x30950b['width']+0x1;this['_addContextButtonView']['element']['style'][_0x13e510]='calc('+(_0x17f414-_0x2c5d86['width']-_0x492e1a)+'px\x20-\x20var(--ck-spacing-tiny))';}});};this['queryView']['fieldView']['on']('update',_0x1f6744),this['on']('render',()=>{_0x1f6744(),this['_queryViewResizeObserver']=new _0x7c9171(this['queryView']['fieldView']['element'],()=>{_0x1f6744();});});}}const Zr='ck-ai-chat__prompt-capabilities',ea='ck-ai-chat-controls-button',ia='ck-ai-chat-controls-button--commands',sa='ck-ai-chat-controls__model-selection',na='ck-ai-chat-controls__model-selection__item-name',ra='ck-ai-chat-controls__model-selection__item-description',oa='ck-ai-chat-controls__model-selection__item-capabilities',aa='n';class Pe extends _0xebef92{['_webSearchButton'];['_reasoningButton'];['_commandsButton'];['_modelSelectionDropdown'];['_modelSelectionDropdownItems'];['_modelNameView'];constructor(_0xf065db){super(_0xf065db),this['set']('webSearchActive',!0x1),this['set']('reasoningActive',!0x1),this['set']('modelSelectorVisible',!0x0),this['set']('modelSelectorEnabled',!0x0),this['set']('activeModelId',''),this['set']('activeModelName',''),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,'modelSelectorVisible',_0x4c7409=>_0x4c7409),this['_modelSelectionDropdown']['buttonView']['bind']('tooltip')['to'](this,'modelSelectorEnabled',_0x414a0a=>_0x414a0a?this['_modelSelectionDropdown']['buttonView']['label']:Yn(this['locale'],'AI_CHAT_MODEL_SELECTOR_DISABLED_TOOLTIP')),this['_modelSelectionDropdown']['bind']('isEnabled')['to'](this,'modelSelectorEnabled',_0x2323b5=>_0x2323b5),this['_webSearchButton']['bind']('isOn')['to'](this,'webSearchActive',_0x122fa1=>_0x122fa1),this['_webSearchButton']['bind']('withText')['to'](this,'modelSelectorVisible',_0x5aae71=>!_0x5aae71),this['_webSearchButton']['bind']('tooltip')['to'](this,'webSearchActive',_0x1361dd=>Yn(this['locale'],_0x1361dd?'AI_CHAT_DISABLE_WEB_SEARCH':'AI_CHAT_ENABLE_WEB_SEARCH')),this['_reasoningButton']['bind']('isOn')['to'](this,'reasoningActive',_0x248b00=>_0x248b00),this['_reasoningButton']['bind']('withText')['to'](this,'modelSelectorVisible',_0x1ab799=>!_0x1ab799),this['_reasoningButton']['bind']('tooltip')['to'](this,'reasoningActive',_0x2ad74b=>Yn(this['locale'],_0x2ad74b?'AI_CHAT_DISABLE_REASONING':'AI_CHAT_ENABLE_REASONING')),this['setTemplate']({'tag':'div','attributes':{'class':[Zr]},'children':[this['_modelSelectionDropdown'],this['_modelNameView'],this['_webSearchButton'],this['_reasoningButton'],this['_commandsButton']]}),this['_modelSelectionDropdownItems']=new _0x6ba718(),_0xc359d8(this['_modelSelectionDropdown'],this['_modelSelectionDropdownItems']);}['setModelList'](_0x4d1b4f,_0x52c5e7){if(this['set']('modelSelectorVisible',!(_0x52c5e7&&_0x4d1b4f['length']<=0x1)),this['_modelSelectionDropdownItems']['clear'](),_0x4d1b4f?.['length'])for(const _0x4bd786 of _0x4d1b4f){const _0x5a88df=new _0x26f53f({'label':_0x4bd786['name'],'withText':!0x0,'role':'menuitemradio','id':_0x4bd786['id'],'model':_0x4bd786});_0x5a88df['bind']('isOn')['to'](this,'activeModelId',_0x2120cc=>_0x2120cc===_0x4bd786['id']),this['_modelSelectionDropdownItems']['add']({'type':'button','model':_0x5a88df,'labelView':new ha(this['locale'],_0x4bd786)});}}['setWebSearch'](_0x256442){this['set']('webSearchActive',_0x256442);}['setReasoning'](_0x2f0274){this['set']('reasoningActive',_0x2f0274);}['setModel'](_0x2b2eaa){if(!_0x2b2eaa)return;this['activeModelId']=_0x2b2eaa['id'],this['activeModelName']=_0x2b2eaa['name']||_0x2b2eaa['id'],this['_modelSelectionDropdown']['buttonView']['set']('label',_0x2b2eaa['name']),this['_modelSelectionDropdown']['buttonView']['set']('tooltip',_0x2b2eaa['name']);const _0x5539db=_0x2b2eaa['capabilities']['webSearch']?.['enabled']??!0x1;this['set']('webSearchActive',!0x1),this['_webSearchButton']['set']('isOn',!0x1),this['_webSearchButton']['set']('isEnabled',_0x5539db),this['_webSearchButton']['set']('isVisible',_0x5539db);const _0x4adb21=_0x2b2eaa['capabilities']['reasoning']?.['enabled']??!0x1;this['set']('reasoningActive',!0x1),this['_reasoningButton']['set']('isOn',!0x1),this['_reasoningButton']['set']('isEnabled',_0x4adb21),this['_reasoningButton']['set']('isVisible',_0x4adb21);}['enableModelSelector'](){this['set']('modelSelectorEnabled',!0x0),this['set']('modelSelectorVisible',!0x0);}['disableModelSelector'](_0x4f8ff0){this['set']('modelSelectorEnabled',!0x1),_0x4f8ff0&&this['set']('modelSelectorVisible',!0x1);}['_createWebSearchButton'](){const _0x6983d4=new _0xa24b3c();return _0x6983d4['set']({'label':Yn(this['locale'],'AI_CHAT_SEARCH_WEB'),'icon':_0x490596,'class':ea,'isToggleable':!0x0,'tooltipPosition':aa}),_0x6983d4['on']('execute',()=>{this['fire']('toggleWebSearch');}),_0x6983d4;}['_createReasoningButton'](){const _0x12e269=new _0xa24b3c();return _0x12e269['set']({'label':Yn(this['locale'],'AI_CHAT_REASONING'),'icon':_0x5d9036,'class':ea,'isToggleable':!0x0,'tooltipPosition':aa}),_0x12e269['on']('execute',()=>{this['fire']('toggleReasoning');}),_0x12e269;}['_createCommandsButton'](){const _0x8f5396=new _0xa24b3c();return _0x8f5396['set']({'label':Yn(this['locale'],'AI_CHAT_COMMANDS'),'icon':yt,'withText':!0x0,'class':ea,'isToggleable':!0x0,'tooltip':Yn(this['locale'],'AI_CHAT_COMMANDS'),'tooltipPosition':aa}),_0x8f5396['extendTemplate']({'attributes':{'class':[ia]}}),_0x8f5396['on']('execute',()=>{console['log']('Commands\x20are\x20not\x20implemented\x20yet.'),alert('Commands\x20are\x20not\x20implemented\x20yet.');}),_0x8f5396;}['_createModelSelectionDropdown'](){const _0x3a60f0=_0x115dce(this['locale']);return _0x3a60f0['set']({'panelPosition':'ne','class':[sa]}),_0x3a60f0['buttonView']['set']({'label':Yn(this['locale'],'AI_CHAT_MODEL_SELECTOR_ENABLED_TOOLTIP'),'withText':!0x0,'tooltip':!0x0,'tooltipPosition':aa}),this['listenTo'](_0x3a60f0,'execute',_0x272dfd=>{this['fire']('selectModel',_0x272dfd['source']['model']);}),_0x3a60f0;}['_createModelNameView'](){const _0x2f3136=new Go(this['locale']);return _0x2f3136['bind']('text')['to'](this,'activeModelName',_0x255f4b=>_0x255f4b??''),_0x2f3136['bind']('isVisible')['to'](this,'modelSelectorVisible',this,'activeModelName',(_0x46b653,_0xb41efe)=>!_0x46b653&&!_0xb41efe?.['toLowerCase']()['startsWith']('agent')),_0x2f3136;}}let ha=class extends _0x5babd6{constructor(_0x2f7a00,_0x40a2b7){super();const _0x39accf=this['bindTemplate'],_0x134822=this['createCollection']();this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-button__label'],'style':_0x39accf['to']('style'),'id':_0x39accf['to']('id')},'children':[{'tag':'div','attributes':{'class':[na]},'children':[{'text':_0x39accf['to']('text')}]},{'tag':'div','attributes':{'class':[ra]},'children':[{'tag':'span','children':[{'text':_0x40a2b7['description']}]}]},{'tag':'div','attributes':{'class':[oa]},'children':_0x134822}]}),_0x134822['addMany'](this['_getCapabilityParts'](_0x2f7a00,_0x490596,'AI_CHAT_SEARCH_WEB',_0x40a2b7['capabilities']['webSearch']?.['enabled']??!0x1)),_0x134822['addMany'](this['_getCapabilityParts'](_0x2f7a00,_0x5d9036,'AI_CHAT_REASONING',_0x40a2b7['capabilities']['reasoning']?.['enabled']??!0x1));}['_getCapabilityParts'](_0xefdf2f,_0x2fe479,_0x1f33ce,_0x4ba67a){const _0x2d298f=new _0x23cd9a();_0x2d298f['content']=_0x2fe479;const _0x4bc300=new _0xebef92(_0xefdf2f);_0x4bc300['setTemplate']({'tag':'span','children':[{'text':Yn(_0xefdf2f,_0x1f33ce)+':\x20'}]});const _0xfbe432=new _0xebef92(_0xefdf2f);return _0xfbe432['setTemplate']({'tag':'span','children':[{'text':Yn(_0xefdf2f,_0x4ba67a?'AI_CHAT_CAPABILITIES_YES':'AI_CHAT_CAPABILITIES_NO')}]}),[_0x2d298f,_0x4bc300,_0xfbe432];}};class Go extends _0xebef92{constructor(_0x521aa6){super(_0x521aa6),this['set']('text',void 0x0),this['set']('isVisible',!0x0);const _0x33a81c=this['bindTemplate'];this['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai-chat-controls__model-name',_0x33a81c['if']('isVisible','ck-hidden',_0x29f972=>!_0x29f972)]},'children':[{'text':_0x33a81c['to']('text')}]});}}const ca='ck-ai-chat-context-controls__url-form',la='ck-ai-chat-context-controls__url-input-section';class mo extends _0xebef92{['focusTracker'];['keystrokes'];['_focusables'];['focusCycler'];['urlInputField'];['backButton'];['confirmButton'];constructor(_0x28c637){super(_0x28c637),this['focusTracker']=new _0x13c01a(),this['keystrokes']=new _0x3c58a3(),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 _0x532b63({'focusables':this['_focusables'],'focusTracker':this['focusTracker'],'keystrokeHandler':this['keystrokes'],'actions':{'focusPrevious':'shift+tab','focusNext':'tab'}}),this['_setupTemplate'](),this['_setupEventHandlers'](),this['_setupKeystrokes']();}['render'](){super['render'](),this['_focusables']['forEach'](_0x5554dc=>{this['focusTracker']['add'](_0x5554dc['element']),this['keystrokes']['listenTo'](_0x5554dc['element']);}),_0x1d3586({'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'](_0x5dc24d){this['urlInputField']['errorText']=_0x5dc24d,this['_updateConfirmButtonState'](),this['fire']('refreshBalloon');}['clearError'](){this['urlInputField']['errorText']=null,this['_updateConfirmButtonState']();}['_createBackButton'](){const _0xf3b1b9=new _0xa24b3c(this['locale']);return _0xf3b1b9['set']({'icon':_0x1df48d,'tooltip':Yn(this['locale'],'AI_CHAT_CONTEXT_URL_BACK_TO_CONTEXT'),'tooltipPosition':'n','class':'ck-button-icon\x20ck-button-back'}),_0xf3b1b9;}['_createUrlInputField'](){const _0x59465f=new th(this['locale'],_0x3ad8f1);return _0x59465f['set']({'label':Yn(this['locale'],'AI_CHAT_CONTEXT_URL_LABEL'),'class':'ck-labeled-field-view_empty'}),_0x59465f['fieldView']['set']({'placeholder':Yn(this['locale'],'AI_CHAT_CONTEXT_URL_PLACEHOLDER')}),_0x59465f;}['_createConfirmButton'](){const _0x43dfbb=new _0xa24b3c(this['locale']);return _0x43dfbb['set']({'icon':_0x474c30,'tooltip':Yn(this['locale'],'AI_CHAT_CONTEXT_URL_ADD_URL'),'tooltipPosition':'n','class':'ck-button-icon','type':'submit','isEnabled':!0x1}),_0x43dfbb;}['_setupTemplate'](){const _0x219fd3=new _0x247e71(this['locale'],{'label':Yn(this['locale'],'AI_CHAT_CONTEXT_URL_ADD_URL'),'class':'ck-ai-header\x20ck-ai-header_small\x20ck-ai-header_context-url'});_0x219fd3['children']['add'](this['backButton'],0x0),this['setTemplate']({'tag':'form','attributes':{'class':ca,'tabindex':'-1'},'children':[_0x219fd3,{'tag':'div','attributes':{'class':la},'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',_0x260513=>{_0x260513['stop'](),this['_handleSubmit']();});}['_setupKeystrokes'](){this['keystrokes']['set']('esc',(_0x54fa65,_0x28a1a1)=>{this['clear'](),this['fire']('cancel'),_0x28a1a1();});}['_handleSubmit'](){const _0x41439f=this['getValue']()['trim']();_0x41439f?this['_isValidUrl'](_0x41439f)?(this['clearError'](),this['fire']('submitUrl',_0x41439f)):this['setError'](Yn(this['locale'],'AI_CHAT_CONTEXT_URL_INVALID_ERROR')):this['setError'](Yn(this['locale'],'AI_CHAT_CONTEXT_URL_EMPTY_ERROR'));}['_updateConfirmButtonState'](){const _0x4476c8=this['getValue']()['trim'](),_0xef798=!!this['urlInputField']['errorText'];this['confirmButton']['isEnabled']=_0x4476c8['length']>0x0&&!_0xef798;}['_isValidUrl'](_0x5b6dc2){try{return!!new URL(_0x5b6dc2);}catch{return!0x1;}}}const da='ck-ai-chat-resources__item',ua='ck-ai-chat-resources__item--in-context',_a='ck-ai-chat-resources__item-title',Ia='ck-ai-chat-resources__item__icon';class tc extends _0x22bc08{['resource'];['_titleView'];['_iconView'];constructor(_0x29a031,_0x528234){super(_0x29a031),this['resource']=_0x528234,this['set']('isInContext',!!_0x528234['isInContext']),this['_titleView']=this['_createTitleView'](),this['_iconView']=this['_createIconView'](),this['_setupTemplate']();}['render'](){super['render']();}['getResourceIcon'](_0x536a2f){if(_0x536a2f['isInContext'])return _0x474c30;switch(_0x536a2f['type']){case de['DOCUMENT']:return _0xacaacc;case de['URL']:return _0x5d9ba5;case de['FILE']:case de['TEXT']:return _0x4a15c3;default:return _0x543968;}}['highlightText'](_0x529414){if(!_0x529414||''===_0x529414['trim']())return void this['_titleView']['highlightText'](null);const _0x106ecb=new RegExp(_0x46cb0c(_0x529414),'gi');this['_titleView']['highlightText'](_0x106ecb);}['updateResourceState'](_0x5cb64a){this['resource']['isInContext']=_0x5cb64a,this['isInContext']=_0x5cb64a,this['_updateIcon']();}['_createTitleView'](){const _0x5653bf=new _0x357569();return _0x5653bf['text']=this['resource']['label'],_0x5653bf['extendTemplate']({'tag':'span','attributes':{'class':[_a]}}),_0x5653bf;}['_createIconView'](){const _0xde837d=new _0x23cd9a();return _0xde837d['content']=this['getResourceIcon'](this['resource']),_0xde837d;}['_setupTemplate'](){const _0x2247be=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':[da,_0x2247be['if']('isVisible','ck-hidden',_0x38165e=>!_0x38165e),_0x2247be['if']('isInContext',ua)]},'children':[{'tag':'div','attributes':{'class':[Ia]},'children':[this['_iconView']]},this['_titleView']],'on':{'click':_0x2247be['to']('execute')}});}['_updateIcon'](){this['_iconView']['content']=this['getResourceIcon'](this['resource']);}}const Aa='ck-ai-chat-resources__list';class Ur extends _0x3dc816{['_source'];constructor(_0x17e0c0,_0x5ca222){super(_0x17e0c0),this['_source']=_0x5ca222,this['extendTemplate']({'attributes':{'class':[Aa]}});}['setResources'](_0x3a2404,_0x40a29d){this['items']['clear']();let _0x465653=_0x3a2404;if(this['_source']['useDefaultFiltering']&&_0x40a29d&&''!==_0x40a29d['trim']()){const _0x5cbcad=new RegExp(_0x40a29d['replace'](/[.*+?^${}()|[\]\\]/g,'\x5c$&'),'gi');_0x465653=_0x3a2404['filter'](_0x4ad0a4=>_0x5cbcad['test'](_0x4ad0a4['label']));}for(const _0x57aeef of _0x465653){const _0x4be634=new tc(this['locale'],_0x57aeef);_0x4be634['on']('execute',()=>{this['_handleResourceSelection'](this['_source'],_0x57aeef);}),this['items']['add'](_0x4be634);}this['_source']['useDefaultFiltering']&&this['highlightText'](_0x40a29d);}['highlightText'](_0x53fbf9){this['_source']['useDefaultFiltering']&&this['items']['forEach'](_0x1d113e=>{_0x1d113e['highlightText'](_0x53fbf9);});}['updateResourceState'](_0x3f1454,_0x377174){for(const _0x5d0faf of this['items']){const _0x59e619=_0x5d0faf;_0x59e619['resource']['id']===_0x3f1454&&_0x59e619['updateResourceState'](_0x377174);}}['_handleResourceSelection'](_0x4998ba,_0x1c2750){this['fire']('addResourceToContext',{'source':_0x4998ba,'resource':_0x1c2750});}}class zr extends th{['iconView'];['resetButtonView'];['_viewConfig'];constructor(_0x33580e){const t=_0x33580e['t'],_0x186e0a={'showResetButton':!0x0,'showIcon':!0x0,'creator':_0x3ad8f1,'label':Yn(_0x33580e,'AI_CHAT_SEARCH_RESOURCES')};super(_0x33580e,_0x186e0a['creator']),this['label']=_0x186e0a['label'],this['_viewConfig']=_0x186e0a,this['_viewConfig']['showIcon']&&this['_setupSearchIcon'](),this['_viewConfig']['showResetButton']&&this['_setupResetButton'](_0x33580e,t),this['_setupEventListeners']();}['reset'](){this['fieldView']['reset'](),this['_viewConfig']['showResetButton']&&this['resetButtonView']&&(this['resetButtonView']['isVisible']=!0x1),this['search']('');}['search'](_0x4dfdca){this['fire']('search',_0x4dfdca);}['getQuery'](){return this['fieldView']['element']?.['value']||'';}['_setupSearchIcon'](){this['iconView']=new _0x23cd9a(),this['iconView']['content']=_0x72e60a,this['fieldWrapperChildren']['add'](this['iconView'],0x0),this['extendTemplate']({'attributes':{'class':'ck-search__query_with-icon'}});}['_setupResetButton'](_0x43863a,t){this['resetButtonView']=new _0xa24b3c(_0x43863a),this['resetButtonView']['set']({'label':t('Clear'),'icon':_0x309cee,'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',_0x4ce0e4=>!_0x4ce0e4),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 Br extends _0xebef92{['_searchView'];['_resourcesListView'];['_skeletonLoader'];['_source'];['children'];['_latestLoadResourcesUid']=null;constructor(_0x32b5b3,_0x20ade4){super(_0x32b5b3),this['_source']=_0x20ade4,this['set']('isLoading',!0x0),this['_searchView']=this['_createSearchView']();const _0x37119a=this['_createSearchSection']();this['_resourcesListView']=this['_createResourcesListView'](),this['_skeletonLoader']=this['_createSkeletonView'](),this['children']=new _0x18aaa9([_0x37119a,this['_skeletonLoader'],this['_resourcesListView']]),this['setTemplate']({'tag':'div','attributes':{'class':'ck-ai-chat-resources'},'children':this['children']});}['_createSearchView'](){return new zr(this['locale']);}['_createSearchSection'](){const _0x17c05d=new _0xebef92(this['locale']);return _0x17c05d['setTemplate']({'tag':'div','attributes':{'class':'ck\x20ck-search'},'children':[this['_searchView']]}),this['_searchView']['on']('search',(_0x5467da,_0x412e82)=>{this['loadResources'](_0x412e82),this['_source']['useDefaultFiltering']&&this['_resourcesListView']['highlightText'](_0x412e82);}),_0x17c05d;}['_createResourcesListView'](){const _0xa42cdd=new Ur(this['locale'],this['_source']);return _0xa42cdd['delegate']('addResourceToContext')['to'](this),_0xa42cdd['extendTemplate']({'attributes':{'class':this['bindTemplate']['if']('isLoading','ck-hidden')}}),_0xa42cdd;}['_createSkeletonView'](){const _0x26cd07=new Fe(this['locale'],Be['aiChatResources']);return _0x26cd07['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isLoading','ck-hidden',_0x384b03=>!_0x384b03)]}}),_0x26cd07;}['render'](){super['render'](),this['loadResources']('');}['loadResources'](_0x2a6d32){const _0x12cbe5=_0x48375a();this['_latestLoadResourcesUid']=_0x12cbe5,this['fire']('loadSourceResources',{'sourceId':this['_source']['id'],'query':_0x2a6d32,'uid':_0x12cbe5}),this['isLoading']=!0x0;}['setResources'](_0x37ce19,_0x5ddc84){if(_0x5ddc84&&_0x5ddc84!==this['_latestLoadResourcesUid'])return;const _0x3d2e9f=this['_source']['useDefaultFiltering']?this['_searchView']['getQuery']():'';this['_resourcesListView']['setResources'](_0x37ce19,_0x3d2e9f),requestAnimationFrame(()=>{this['isLoading']=!0x1;});}['updateResourceState'](_0x1830da,_0x3467e1){this['_resourcesListView']['updateResourceState'](_0x1830da,_0x3467e1);}}const ga='ck-ai-chat-context-controls__source-balloon-panel',ma='ck-button-icon\x20ck-button-back',pa='ck-ai-header\x20ck-ai-header_small\x20ck-ai-header_source';class po{['_sourceResourceBalloons']=new Map();['_bodyCollection'];['_locale'];['_config'];constructor(_0x572ea7,_0x313a13,_0x2f036e){this['_locale']=_0x572ea7,this['_bodyCollection']=_0x313a13,this['_config']=_0x2f036e;}['showSourceResourcesBalloon'](_0x5576be){let _0xce06a6=this['_sourceResourceBalloons']['get'](_0x5576be['id']);_0xce06a6||(_0xce06a6=this['_createSourceResourceBalloonPanel'](),this['_sourceResourceBalloons']['set'](_0x5576be['id'],_0xce06a6),this['_setupSingleResourceBalloonClickOutsideHandler'](_0xce06a6)),this['_addSourceResourceContent'](_0xce06a6,_0x5576be),_0xce06a6['show']();const _0x97a9c8=this['_config']['getTargetElement']();_0x97a9c8&&_0xce06a6['pin']({'target':_0x97a9c8,'limiter':this['_config']['getLimiterElement']()});}['populateSourceResourceBalloon'](_0x2b2864,_0x1c5a27,_0x29db08){const _0xb1f957=this['_sourceResourceBalloons']['get'](_0x2b2864);if(!_0xb1f957)return;const _0x4735ec=this['_getResourcesViewFromBalloon'](_0xb1f957);_0x4735ec&&_0x4735ec['setResources'](_0x1c5a27,_0x29db08);}['closeSourceResourceBalloon'](_0x339207){const _0x129930=this['_sourceResourceBalloons']['get'](_0x339207);_0x129930&&requestAnimationFrame(()=>{_0x129930['hide'](),this['_sourceResourceBalloons']['delete'](_0x339207),this['_config']['onBalloonClosed']();});}['isAnyResourceBalloonVisible'](){for(const _0x9560bb of this['_sourceResourceBalloons']['values']())if(_0x9560bb['isVisible'])return!0x0;return!0x1;}['updateResourceState'](_0x1ea23f,_0x3db3e2,_0x41a863){const _0x14d974=this['_sourceResourceBalloons']['get'](_0x1ea23f);if(!_0x14d974||!_0x14d974['isVisible'])return;const _0x3d3e72=this['_config']['getTargetElement']();if(!_0x3d3e72)return;_0x14d974['pin']({'target':_0x3d3e72,'limiter':this['_config']['getLimiterElement']()});const _0x30a1da=this['_getResourcesViewFromBalloon'](_0x14d974);_0x30a1da&&_0x30a1da['updateResourceState'](_0x3db3e2,_0x41a863);}['destroy'](){for(const _0x2e5f28 of this['_sourceResourceBalloons']['values']())_0x2e5f28['destroy']();this['_sourceResourceBalloons']['clear']();}['_createSourceResourceBalloonPanel'](){const _0xb6f949=new _0x5b9e88(this['_locale']);return _0xb6f949['extendTemplate']({'attributes':{'class':ga}}),this['_bodyCollection']['add'](_0xb6f949),_0xb6f949;}['_addSourceResourceContent'](_0x2f05d8,_0x61ffaf){_0x2f05d8['content']['clear']();const _0x54e272=this['_createBalloonHeader'](_0x2f05d8,_0x61ffaf);_0x2f05d8['content']['add'](_0x54e272);const _0x366f99=this['_createBalloonResourcesView'](_0x61ffaf);_0x2f05d8['content']['add'](_0x366f99);}['_createBalloonHeader'](_0x3fde4c,_0x116572){const _0x39312f=this['_createBackButton'](_0x3fde4c),_0x300731=new _0x247e71(this['_locale'],{'label':_0x116572['label'],'class':pa});return _0x300731['children']['add'](_0x39312f,0x0),_0x300731;}['_createBackButton'](_0x2a435e){const _0x1863a9=new _0xa24b3c(this['_locale']);return _0x1863a9['set']({'icon':_0x1df48d,'tooltip':Yn(this['_locale'],'AI_CHAT_CONTEXT_URL_BACK_TO_CONTEXT'),'tooltipPosition':'n','class':ma}),_0x1863a9['on']('execute',()=>{_0x2a435e['hide'](),this['_config']['onBackToContext']();}),_0x1863a9;}['_createBalloonResourcesView'](_0x5a33e2){const _0x2a2aa6=new Br(this['_locale'],_0x5a33e2);return _0x2a2aa6['on']('loadSourceResources',(_0x990697,_0x311570)=>{this['_config']['onLoadSourceResources'](_0x311570);}),_0x2a2aa6['on']('addResourceToContext',(_0x2cdac0,_0x858811)=>{this['_config']['onResourceSelected'](_0x858811['source'],_0x858811['resource']),this['closeSourceResourceBalloon'](_0x5a33e2['id']);}),_0x2a2aa6;}['_getResourcesViewFromBalloon'](_0x2cb30c){const _0x4cc44c=_0x2cb30c['content']['get'](0x1);return _0x4cc44c instanceof Br?_0x4cc44c:null;}['_setupSingleResourceBalloonClickOutsideHandler'](_0x4e759f){_0x16cb96({'emitter':_0x4e759f,'contextElements':[_0x4e759f['element']],'callback':()=>{_0x4e759f['hide'](),this['_config']['onBalloonClosed']();},'activator':()=>_0x4e759f['isVisible']});}}const Ve=['addDocumentToContext','addFileToContext','addUrlToContext','addResourceToContext','removeContextItem','loadSourceResources'],Bo='ck-ai-chat-context-controls',bo='ck-ai-chat-context-controls__pending-contexts',To='ck-ai-chat-context-controls__add-context-balloon-panel',Ao='ck-ai-chat-context-controls__add-context-button',ko='ck-ai-chat-context-controls__url-balloon-panel',Eo='ck-ai-chat-context-controls__balloon-button',vo='ck-ai-chat-context-controls__balloon-button-source',go='ck-ai-chat-controls-button',Vo='ck-ai-chat-context-chips-wrapper-balloon',fo='ck-ai-chat-controls_context_show-more-button',Io='ck-ai-chat-context-controls__show-more-balloon-panel',Po='ck-ai-chat',Ro=[_0x5b9e88['defaultPositions']['northArrowSouthWest'],_0x5b9e88['defaultPositions']['northArrowSouth'],_0x5b9e88['defaultPositions']['northArrowSouthEast'],_0x5b9e88['defaultPositions']['southArrowNorthWest'],_0x5b9e88['defaultPositions']['southArrowNorth'],_0x5b9e88['defaultPositions']['southArrowNorthEast']];class ve extends _0xebef92{['addContextButtonView'];['_currentContextsChips']=this['createCollection']();['_conversationContextsChips']=this['createCollection']();['_overflowManager'];['_addContextBalloonPanelView'];['_urlBalloonPanelView'];['_urlInputView'];['_resourcesBalloonView'];['_addContextBalloonConfig'];['bodyCollection'];constructor(_0x3ca508,_0x1f0334){super(_0x3ca508),this['bodyCollection']=_0x1f0334,this['_currentContextsChips']=this['createCollection'](),this['_conversationContextsChips']=this['createCollection'](),this['addContextButtonView']=this['_createAddContextButtonView'](_0x3ca508),this['_addContextBalloonPanelView']=this['_createAddContextBalloonPanelView'](_0x3ca508),this['_urlBalloonPanelView']=this['_createUrlBalloonPanelView'](_0x3ca508),this['_resourcesBalloonView']=this['_createResourcesBalloonView'](_0x3ca508,_0x1f0334);const _0x586e58={'cssClasses':{'showMoreButton':fo,'showMoreBalloon':Io,'overflowContainer':Vo,'controlsButton':go}};this['_overflowManager']=new wo(_0x3ca508,this['_currentContextsChips'],_0x586e58,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'](_0x13076c,_0x213125){const _0x4e228a=this['_createContextButton'](_0x13076c,'current',!0x0,_0x213125);this['_addContextToCollection'](_0x4e228a,this['_currentContextsChips']),this['_overflowManager']['reorganizeChips']();}['removeContextItem'](_0x124639){this['_removeContextFromCollection'](_0x124639,this['_currentContextsChips']),this['_removeContextFromCollection'](_0x124639,this['_overflowManager']['overflowChips']),this['_overflowManager']['reorganizeChips']();}['setContextItemLoading'](_0x30fe60,_0x1b7621){let _0x3289ea=this['_currentContextsChips']['find'](_0x2e3d4c=>_0x2e3d4c['id']===_0x30fe60);_0x3289ea||(_0x3289ea=this['_overflowManager']['overflowChips']['find'](_0x4aee33=>_0x4aee33['id']===_0x30fe60)),_0x3289ea&&(_0x3289ea['isLoading']=_0x1b7621);}['setConversationContext'](_0x50c80d){this['_conversationContextsChips']['clear']();for(const _0x257f62 of _0x50c80d){const _0x17ea32=this['_createContextButton'](_0x257f62,'conversation',!0x1,!0x1);this['_addContextToCollection'](_0x17ea32,this['_conversationContextsChips']);}}['clearCurrentContextItems'](){this['_currentContextsChips']['clear'](),this['_overflowManager']['clear']();}['clearConversationContextItems'](){this['_conversationContextsChips']['clear']();}['updateResourceState'](_0x43e7dc,_0x3b021e,_0x5471a0){this['_resourcesBalloonView']['updateResourceState'](_0x43e7dc,_0x3b021e,_0x5471a0);}['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'](_0x1eee57){this['_resourcesBalloonView']['showSourceResourcesBalloon'](_0x1eee57),this['addContextButtonView']['isOn']=!0x0;}['populateSourceResourceBalloon'](_0xcfa2f,_0x3a3dcc,_0x1be262,_0x51be58){this['_resourcesBalloonView']['populateSourceResourceBalloon'](_0xcfa2f,_0x1be262,_0x51be58);}['closeSourceResourceBalloon'](_0x41830c){this['_resourcesBalloonView']['closeSourceResourceBalloon'](_0x41830c),this['addContextButtonView']['isOn']=!0x1;}['setAddContextOptions'](_0x5d2fa2){this['_setBalloonPanelContent'](this['_addContextBalloonPanelView'],this['locale'],_0x5d2fa2),this['_setAddContextButtonEnabled'](_0x5d2fa2);}['_setAddContextButtonEnabled'](_0x258968){const _0x458f4d=!_0x258968['document']['isHidden']&&_0x258968['document']['enabled'],_0x2abda9=_0x258968['urls']['enabled'],_0x3e569a=_0x258968['files']['enabled'];this['addContextButtonView']['isEnabled']=_0x458f4d||_0x2abda9||_0x3e569a;}['_setupTemplate'](){this['setTemplate']({'tag':'div','attributes':{'class':[Bo,'ck-reset_all-excluded']},'children':[{'tag':'div','attributes':{'class':bo},'children':this['_currentContextsChips']}]});}['_bindEventHandlers'](){this['addContextButtonView']['on']('execute',()=>{this['_handleAddContextButtonClick']();});}['_createAddContextButtonView'](_0x176433){const _0x2f366c=new _0xa24b3c(_0x176433);return _0x2f366c['set']({'label':Yn(_0x176433,'AI_CHAT_CONTEXT_ADD_CONTEXT'),'class':go+'\x20'+Ao,'icon':_0x3de6a5,'isToggleable':!0x0,'tooltip':!0x0,'tooltipPosition':'sw'}),_0x2f366c;}['_createAddContextBalloonPanelView'](_0xf84eac){return this['_createBaseBalloonPanel'](_0xf84eac,To);}['_createUrlBalloonPanelView'](_0xdc593c){const _0x47987b=this['_createBaseBalloonPanel'](_0xdc593c,ko);return this['_addUrlContent'](_0x47987b,_0xdc593c),_0x47987b;}['_createResourcesBalloonView'](_0x55ff25,_0xb8a655){return new po(_0x55ff25,_0xb8a655,{'onBackToContext':()=>{this['showAddContextBalloonPanel'](),this['_addContextBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':Ro});},'onResourceSelected':(_0x59d6ab,_0x2879d9)=>{this['fire']('addResourceToContext',{'source':_0x59d6ab,'resource':_0x2879d9});},'onLoadSourceResources':_0x134cea=>{this['fire']('loadSourceResources',_0x134cea);},'onBalloonClosed':()=>{this['addContextButtonView']['isOn']=!0x1;},'getLimiterElement':()=>this['_getLimiterElement'](),'getTargetElement':()=>this['addContextButtonView']['element']});}['_getLimiterElement'](){return this['element']?.['closest']('.'+Po)||document['body'];}['_createBaseBalloonPanel'](_0x3679ee,_0x4225b0){const _0xae76ba=new _0x5b9e88(_0x3679ee);return _0xae76ba['extendTemplate']({'attributes':{'class':_0x4225b0}}),this['bodyCollection']['add'](_0xae76ba),_0xae76ba;}['_setBalloonPanelContent'](_0xcd919e,_0x177461,_0x2004c6){if(_0xcd919e['content']['clear'](),!_0x2004c6['document']['isHidden']&&_0x2004c6['document']['enabled']){const _0x113283=this['_createBalloonButton'](_0x177461,{'label':Yn(_0x177461,'AI_CHAT_CONTEXT_CURRENT_DOCUMENT'),'icon':_0xacaacc});_0x113283['on']('execute',()=>{this['fire']('addDocumentToContext'),this['hideAddContextBalloonPanel']();}),_0xcd919e['content']['add'](_0x113283);}if(_0x2004c6['urls']['enabled']){const _0x2f8a3c=this['_createBalloonButton'](_0x177461,{'label':Yn(_0x177461,'AI_CHAT_CONTEXT_URL_LABEL'),'icon':_0x5d9ba5});_0x2f8a3c['on']('execute',()=>{this['hideAddContextBalloonPanel'](),this['showUrlBalloonPanel'](),this['_urlBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':Ro}),this['_urlInputView']['focus']();}),_0xcd919e['content']['add'](_0x2f8a3c);}if(_0x2004c6['files']['enabled']){const _0x521526=new _0x1e8d98(_0x177461);_0x521526['set']({'label':Yn(_0x177461,'AI_CHAT_CONTEXT_FILE_LABEL'),'icon':_0x368e82,'withText':!0x0,'tooltip':!0x0,'class':Eo,'allowMultipleFiles':!0x0}),_0x521526['on']('done',(_0x6370fe,_0x95546)=>{this['fire']('addFileToContext',_0x95546),this['hideAddContextBalloonPanel']();}),_0x521526['tooltip']=!0x0,_0xcd919e['content']['add'](_0x521526);}for(const _0x23e53a of _0x2004c6['sources']){const _0x5b3a82=this['_createBalloonButton'](_0x177461,{'label':_0x23e53a['label'],'icon':_0x23e53a['icon']||_0x543968,'type':'source'});_0xcd919e['content']['add'](_0x5b3a82),_0x5b3a82['on']('execute',()=>{this['hideAddContextBalloonPanel'](),this['_showSourceResourcesBalloon'](_0x23e53a);});}}['_addUrlContent'](_0x121c81,_0x595e3e){this['_urlInputView']=new mo(_0x595e3e),this['_urlInputView']['on']('submitUrl',(_0x1459bb,_0x577889)=>{this['_handleUrlSubmit'](_0x577889);}),this['_urlInputView']['on']('cancel',()=>{this['hideUrlBalloonPanel'](),this['showAddContextBalloonPanel'](),this['_addContextBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':Ro});}),this['_urlInputView']['on']('refreshBalloon',()=>{this['_urlBalloonPanelView']['isVisible']&&this['_urlBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':Ro});}),_0x121c81['content']['add'](this['_urlInputView']);}['_createBalloonButton'](_0x2694a7,_0x59468c){const _0x4647b1='source'===_0x59468c['type']?new Ta(_0x2694a7):new _0xa24b3c(_0x2694a7);return _0x4647b1['set']({'label':_0x59468c['label'],'icon':_0x59468c['icon'],'withText':!0x0,'tooltip':!0x0,'tooltipPosition':'sw','class':Eo}),_0x4647b1;}['_setupAllBalloonClickOutsideHandlers'](){this['_setupAddContextBalloonClickOutsideHandler'](),this['_setupUrlBalloonClickOutsideHandler']();}['_setupUrlBalloonClickOutsideHandler'](){_0x16cb96({'emitter':this['_urlBalloonPanelView'],'contextElements':[this['_urlBalloonPanelView']['element']],'callback':()=>{this['hideUrlBalloonPanel']();},'activator':()=>this['_urlBalloonPanelView']['isVisible']});}['_toggleAddContextBalloon'](_0x3f7cab){const _0x20336b=this['_addContextBalloonConfig'];_0x20336b['buttonView']['isOn']=_0x3f7cab,_0x3f7cab?_0x20336b['balloonView']['show']():_0x20336b['balloonView']['hide']();}['_setupAddContextBalloonClickOutsideHandler'](){const {balloonView:_0x201f5f,buttonView:_0x322295,hideMethod:_0x346c1f}=this['_addContextBalloonConfig'];_0x16cb96({'emitter':_0x201f5f,'contextElements':[_0x201f5f['element'],_0x322295['element']],'callback':()=>{_0x346c1f();},'activator':()=>_0x322295['isOn']&&!this['_urlBalloonPanelView']['isVisible']&&!this['_resourcesBalloonView']['isAnyResourceBalloonVisible']()});}['_createContextButton'](_0x201d0d,_0x552b6c,_0x3c0052=!0x1,_0xdabdd9=!0x1){const _0x43db7c='conversation'===_0x552b6c||!0x0===_0x201d0d['isReadOnly'],_0x2b75e6=new xo(this['locale'],_0x201d0d,_0x43db7c,_0x3c0052,_0xdabdd9);return _0x43db7c||_0x2b75e6['on']('removeContextItemChip',()=>{this['fire']('removeContextItem',_0x2b75e6['id']);}),_0x2b75e6;}['_addContextToCollection'](_0x3b0333,_0x33931b){_0x33931b['add'](_0x3b0333,0x0);}['_removeContextFromCollection'](_0x8bcce2,_0x436da8){const _0x229732=_0x436da8['find'](_0x43017c=>_0x43017c['id']===_0x8bcce2);_0x229732&&_0x436da8['remove'](_0x229732);}['_handleAddContextButtonClick'](){this['addContextButtonView']['isOn']?this['hideAddContextBalloonPanel']():(this['showAddContextBalloonPanel'](),this['_addContextBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':Ro}));}['_handleUrlSubmit'](_0x5e9996){this['_urlInputView']['clear'](),this['hideUrlBalloonPanel'](),this['fire']('addUrlToContext',_0x5e9996);}}class Ta extends _0xa24b3c{['arrowView'];constructor(_0xe33458){super(_0xe33458),this['set']({'withText':!0x0,'role':'menuitem'}),this['arrowView']=this['_createArrowView'](),this['extendTemplate']({'attributes':{'class':[vo]}});}['render'](){super['render'](),this['children']['add'](this['arrowView']);}['_createArrowView'](){const _0x141f23=new _0x23cd9a();return _0x141f23['content']=_0x5dbd42,_0x141f23['extendTemplate']({'attributes':{'class':vo+'__arrow'}}),_0x141f23;}}class Me extends _0xebef92{['_cancelButtonView'];['_loaderView'];constructor(_0x222ffe){super(_0x222ffe),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 _0x3aeaf2=new _0xa24b3c(this['locale']);return _0x3aeaf2['set']({'label':Yn(this['locale'],'AI_CHAT_STOP_GENERATING'),'withText':!0x0,'class':'ai-chat-controls-loader__cancel-button','icon':_0x3e1e42}),_0x3aeaf2['on']('execute',()=>{this['fire']('abortPromptStream');}),_0x3aeaf2;}['_createLoaderView'](){const _0x3e60f4=new _0xebef92(this['locale']);return _0x3e60f4['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':Yn(this['locale'],'AI_CHAT_IS_WRITING')}]}),_0x3e60f4;}}class ji extends _0xebef92{['_contextPanelView'];['_promptInputView'];['_promptCapabilitiesView'];['_loaderView'];['_shouldRestorePromptInputFocus'];constructor(_0x4af378,_0x386270){super(_0x4af378),this['_contextPanelView']=this['_createContextPanelView'](_0x4af378,_0x386270),this['_promptInputView']=this['_createPromptInputView'](_0x4af378),this['_promptCapabilitiesView']=this['_createPromptCapabilitiesView'](_0x4af378),this['_loaderView']=this['_createLoaderView'](_0x4af378),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'](...Ve)['to'](this);const _0x1f5de7=this['bindTemplate'];this['setTemplate']({'tag':'form','attributes':{'class':['ck','ck-ai-chat-controls']},'children':[{'tag':'div','attributes':{'class':[_0x1f5de7['if']('isLoading','ck-hidden')]},'children':[this['_contextPanelView'],this['_promptInputView'],this['_promptCapabilitiesView']]},{'tag':'div','attributes':{'class':[_0x1f5de7['if']('isLoading','ck-hidden',_0x55c566=>!_0x55c566)]},'children':[this['_loaderView']]}]}),_0x16cb96({'emitter':this['_promptInputView'],'activator':()=>this['isLoading'],'contextElements':()=>[this['element']],'callback':()=>{this['_shouldRestorePromptInputFocus']=!0x1;}}),this['on']('change:isLoading',this['_handlePromptInputFocus'],{'priority':'low'});}['_createContextPanelView'](_0xdb415b,_0xe04d32){return new ve(_0xdb415b,_0xe04d32);}['_createPromptInputView'](_0x5badaa){return new Ce(_0x5badaa,this['_contextPanelView']['addContextButtonView']);}['_createPromptCapabilitiesView'](_0x14b2ac){return new Pe(_0x14b2ac);}['_createLoaderView'](_0x1fbfc7){return new Me(_0x1fbfc7);}['_handlePromptInputFocus'](_0x2bb1f8,_0x58b3e3,_0xf2cbae){_0xf2cbae?this['_shouldRestorePromptInputFocus']=!0x0:this['_shouldRestorePromptInputFocus']&&this['_promptInputView']['focus']();}['addContextItem'](_0x490736,_0x336aba){this['_contextPanelView']['addContextItem'](_0x490736,_0x336aba);}['removeContextItem'](_0x35ea0d){this['_contextPanelView']['removeContextItem'](_0x35ea0d);}['setContextItemLoading'](_0x3e8387,_0x460836){this['_contextPanelView']['setContextItemLoading'](_0x3e8387,_0x460836);}['setIsUploadInProgress'](_0x399646){this['_promptInputView']['setIsUploadInProgress'](_0x399646);}['setConversationContext'](_0x1e9aee){this['_contextPanelView']['setConversationContext'](_0x1e9aee);}['clearPendingContextUI'](){this['_contextPanelView']['clearCurrentContextItems']();}['clearConversationContextUI'](){this['_contextPanelView']['clearConversationContextItems']();}['updateResourceState'](_0x32a0c1,_0x433097,_0x113d2e){this['_contextPanelView']['updateResourceState'](_0x32a0c1,_0x433097,_0x113d2e);}['setWebSearch'](_0x114301){this['_promptCapabilitiesView']['setWebSearch'](_0x114301);}['setReasoning'](_0x2f58fc){this['_promptCapabilitiesView']['setReasoning'](_0x2f58fc);}['resetMessageInput'](){this['_promptInputView']['reset']();}['setAddContextOptions'](_0x4e9de0){this['_contextPanelView']['setAddContextOptions'](_0x4e9de0);}['setInputPlaceholder'](_0x4c0680){this['_promptInputView']['setPlaceholderText'](_0x4c0680);}['setModelList'](_0xf73d4,_0x407240){this['_promptCapabilitiesView']['setModelList'](_0xf73d4,_0x407240);}['setModel'](_0x36fcd2){this['_promptCapabilitiesView']['setModel'](_0x36fcd2);}['enableModelSelector'](){this['_promptCapabilitiesView']['enableModelSelector']();}['disableModelSelector'](_0x51b632){this['_promptCapabilitiesView']['disableModelSelector'](_0x51b632);}['populateSourceResourceBalloon'](_0x1a00e7,_0x307a9f,_0xa4b72,_0x10d451){this['_contextPanelView']['populateSourceResourceBalloon'](_0x1a00e7,_0x307a9f,_0xa4b72,_0x10d451);}['closeSourceResourceBalloon'](_0x8cbb83){this['_contextPanelView']['closeSourceResourceBalloon'](_0x8cbb83);}['focusPromptInput'](){this['_promptInputView']['focus']();}}class ki extends _0x247e71{['conversationStartButton'];['resizeButton'];constructor(_0x3e8b39,_0x7bbb42){super(_0x3e8b39,{'label':Yn(_0x3e8b39,'AI_CHAT_HEADING'),'class':'ck-ai-header\x20ck-ai-header_chat','icon':St}),this['set']('isMaximized',!0x1),this['conversationStartButton']=this['_createStartConversationButton'](_0x3e8b39),this['children']['add'](this['conversationStartButton']),_0x7bbb42&&(this['resizeButton']=As(_0x3e8b39,this),this['children']['add'](this['resizeButton']));}['_createStartConversationButton'](_0x26de96){const _0x4b44e2=new _0xa24b3c(_0x26de96);return _0x4b44e2['set']({'label':Yn(this['locale'],'AI_CHAT_LABEL_NEW_CHAT'),'withText':!0x0,'icon':_0x4c6d08,'class':'ck-ai-chat__start-conversation'}),_0x4b44e2['on']('execute',()=>{this['fire']('startConversation');}),_0x4b44e2;}}class Ci extends _0xebef92{constructor(_0x57fa32){super(_0x57fa32),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-disclaimer']},'children':[{'tag':'p','attributes':{'class':['ck','ck-ai-disclaimer__content']},'children':[{'text':Yn(_0x57fa32,'AI_DISCLAIMER_TEXT')}]}]});}}class Et extends _0xebef92{['chatHeader'];['chatFeed'];['chatControls'];['chatDisclaimer'];['_bodyCollection'];constructor(_0x27947a,_0x1aee65){super(_0x27947a),this['_bodyCollection']=new zt(_0x27947a),this['_bodyCollection']['attachToDom'](),this['chatHeader']=new ki(_0x27947a,_0x1aee65),this['chatHeader']['delegate'](...Pt)['to'](this),this['chatFeed']=new pi(_0x27947a,this['_bodyCollection']),this['chatFeed']['delegate'](...Pt)['to'](this),this['chatControls']=new ji(_0x27947a,this['_bodyCollection']),this['chatControls']['delegate'](...Pt)['to'](this),this['chatDisclaimer']=new Ci(_0x27947a),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset_all','ck-ai-chat','ck-rounded-corners'],'dir':_0x27947a['uiLanguageDirection']},'children':[this['chatHeader'],this['chatFeed'],this['chatControls'],this['chatDisclaimer']]});}['populateSourceResourceBalloon'](_0xfa62,_0x54e13c,_0x205a4b,_0x3db178){this['chatControls']['populateSourceResourceBalloon'](_0xfa62,_0x54e13c,_0x205a4b,_0x3db178);}['closeSourceResourceBalloon'](_0x5d9dd5){this['chatControls']['closeSourceResourceBalloon'](_0x5d9dd5);}['destroy'](){this['_bodyCollection']['detachFromDom'](),super['destroy']();}}class at extends _0x3cc6c1{static get['requires'](){return[ht];}['_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;constructor(_0x444508){super(_0x444508);const _0x2f275e=this['context']['plugins']['get']('AITabs');this['set']('isBusy',!0x1),this['_promiseQueue']=new g(),this['_view']=new Et(this['context']['locale'],_0x2f275e['showResizeButton']),this['_view']['delegate'](...Pt)['to'](this),this['_view']['on']('toggleSuggestionDisplayMode',(_0x3e2bda,{showDiff:_0x48c6c8})=>{this['showDiff']=_0x48c6c8;}),_0x2f275e['view']['addTab']({'id':'chat','buttonLabel':Yn(this['context']['locale'],'AI_CHAT_HEADING'),'buttonIcon':St,'order':0x0,'content':this['_view']}),this['_view']['chatControls']['bind']('isLoading')['to'](this,'isBusy',_0x5c851f=>_0x5c851f),this['_view']['chatFeed']['bind']('isPending')['to'](this,'isBusy',_0x20cfdb=>_0x20cfdb),this['_view']['chatControls']['setInputPlaceholder'](this['_getInputPlaceholder']());}['destroy'](){super['destroy'](),this['_titleAnimationInterval']&&clearInterval(this['_titleAnimationInterval']);}['createConversation'](_0x5f065f){this['_view']['chatFeed']['clear'](),this['_view']['chatControls']['enableModelSelector'](),this['_view']['chatControls']['setModelList'](_0x5f065f['availableModels'],!this['context']['config']['get']('ai.chat.models.modelSelectorAlwaysVisible')),this['addFeedItemStaticMessage']({'id':'conversation-start','staticMessage':Yn(this['context']['locale'],'AI_CHAT_WELCOME_MESSAGE')});}['addFeedItemStaticMessage']({id:_0xdad7b6,staticMessage:_0x1ec204}){this['_view']['chatFeed']['addItem']('ai-reply',{'id':_0xdad7b6,'initialContent':'<p>'+_0x1ec204+'</p>'});}['addFeedItemUserMessage'](_0xb79122){const _0x23c563=_0xb79122['quickActionData']?.['displayedPrompt']||_0xb79122['userMessage'];this['_view']['chatFeed']['addItem']('user-message',{'contextItems':Array['from'](_0xb79122['contextItems']['values']()),'initialContent':'<p>'+_0x23c563+'</p>','id':_0xb79122['id']});}['addFeedItemError']({errorMessage:_0x55659c,id:_0x2c4a7d}){this['_view']['chatFeed']['addItem']('error-message',{'initialContent':'<p>'+_0x55659c+'</p>','id':_0x2c4a7d});}['addFeedItemAIReply'](_0xbe71e1){return this['_promiseQueue']['enqueue'](async()=>{this['_view']['chatFeed']['addItem']('ai-reply',{'id':_0xbe71e1['interactionId']+':'+_0xbe71e1['id']}),this['_view']['chatFeed']['setLoadingMessage']('');});}async['addFeedItemAISuggestion'](_0x4cd2d3){return this['_promiseQueue']['enqueue'](async()=>{this['_view']['chatFeed']['addItem']('ai-suggestion-reply',{'id':_0x4cd2d3['interactionId']+':'+_0x4cd2d3['id'],'areActionsDisabled':_0x4cd2d3['areActionsDisabled'],'showDiff':this['showDiff']}),this['_view']['chatFeed']['setLoadingMessage']('');});}['addFeedInteractionHeader'](_0x3c0dc6){this['_view']['chatFeed']['addItem']('interaction-header',{'id':_0x3c0dc6['id'],'capabilities':_0x3c0dc6['capabilities']});}['updateFeedInteractionHeader'](_0x175ecd){const _0xa34a13=this['_view']['chatFeed']['children']['find'](_0x45c972=>_0x45c972['options']['id']==_0x175ecd['id']&&_0x45c972 instanceof Rt);_0xa34a13&&_0xa34a13['set']('isVisible',_0x175ecd['isVisible']);}async['updateFeedItemAIReplyContent'](_0x5ae319){const _0x3a6375=_0x5ae319['renderingStrategy']||this['feedItemRenderingStrategy'];return this['_promiseQueue']['enqueue'](async _0x4e4884=>{await this['_view']['chatFeed']['updateReplyItem']({..._0x5ae319,'abortSignal':_0x4e4884,'renderingStrategy':_0x3a6375}),_0x5ae319['isDone']&&this['markFeedItemAsDone'](_0x5ae319['id']);});}['updateFeedItemAIReplySources'](_0x10cdac,_0x47e326){this['_view']['chatFeed']['updateWebSources'](_0x10cdac,_0x47e326);}async['updateFeedItemAIReplySuggestionContent'](_0x6fd023){const _0x3fbf72=_0x6fd023['renderingStrategy']||this['feedItemRenderingStrategy'];return this['_promiseQueue']['enqueue'](async _0x2885ae=>{await this['_view']['chatFeed']['updateSuggestionItem']({..._0x6fd023,'abortSignal':_0x2885ae,'renderingStrategy':_0x3fbf72}),_0x6fd023['isDone']&&this['markFeedItemAsDone'](_0x6fd023['id']);});}['updateFeedItemAIReplySuggestionPartState'](_0x21eadf){this['_view']['chatFeed']['updateSuggestionPartState'](_0x21eadf);}['markFeedItemAsDone'](_0x47fdda){this['_view']['chatFeed']['markItemAsDone'](_0x47fdda);}['removeFeedInteraction'](_0x5be6cf){this['_view']['chatFeed']['getItemIds']()['filter'](_0x541274=>_0x541274['startsWith'](_0x5be6cf))['forEach'](_0x441d1f=>this['_view']['chatFeed']['removeItem'](_0x441d1f));}['startInteraction'](_0x3937c4){this['_view']['chatFeed']['setLoadingMessage'](this['_getLoadingMessage'](_0x3937c4)),this['_view']['chatControls']['disableModelSelector'](!this['context']['config']['get']('ai.chat.models.modelSelectorAlwaysVisible')),this['isBusy']=!0x0,this['_view']['chatFeed']['startAutoScroll']();}['stopInteraction'](_0x178f02){this['_promiseQueue']['abort'](),this['_view']['chatFeed']['getItemIds']()['filter'](_0x5d6c71=>_0x5d6c71['startsWith'](_0x178f02['id']))['forEach'](_0x92cd41=>this['markFeedItemAsDone'](_0x92cd41)),this['isBusy']=!0x1,this['_view']['chatFeed']['stopAutoScroll']();}async['finishInteraction'](){return this['_promiseQueue']['queueEmptyPromise']['then'](()=>{this['isBusy']=!0x1,this['_view']['chatFeed']['stopAutoScroll']();});}['addContextItem'](_0x3909ec,_0x23ac94){this['_view']['chatControls']['addContextItem'](_0x3909ec,_0x23ac94);}['removeContextItem'](_0xd4c929){this['_view']['chatControls']['removeContextItem'](_0xd4c929);}['setContextItemLoading'](_0x1bdf0a,_0x250765){this['_view']['chatControls']['setContextItemLoading'](_0x1bdf0a,_0x250765);}['setIsUploadInProgress'](_0x5a1a6c){this['_view']['chatControls']['setIsUploadInProgress'](_0x5a1a6c);}['setConversationContext'](_0x34806a){this['_view']['chatControls']['setConversationContext'](_0x34806a);}['clearPendingContextUI'](){this['_view']['chatControls']['clearPendingContextUI']();}['clearConversationContextUI'](){this['_view']['chatControls']['clearConversationContextUI']();}['updateResourceState'](_0x2edcc3,_0x16e8d3,_0x44f696){this['_view']['chatControls']['updateResourceState'](_0x2edcc3,_0x16e8d3,_0x44f696);}['resetMessageInput'](){this['_view']['chatControls']['resetMessageInput'](),this['_view']['chatControls']['setInputPlaceholder'](this['_getInputPlaceholder']());}['setAddContextOptions'](_0x5d9b3c){this['_view']['chatControls']['setAddContextOptions'](_0x5d9b3c);}['updateCapabilities'](_0x260e5b){this['_view']['chatControls']['setWebSearch'](_0x260e5b['isWebSearchEnabled']),this['_view']['chatControls']['setReasoning'](_0x260e5b['isReasoningEnabled']),this['_view']['chatControls']['setInputPlaceholder'](this['_getInputPlaceholder'](_0x260e5b));}['setSelectedModel'](_0x6bdfba,_0x48bd55){this['_view']['chatControls']['setModel'](_0x6bdfba),_0x48bd55&&this['_view']['chatControls']['disableModelSelector'](!0x1);}['setFeedItemRenderingStrategy'](_0x289d1b){this['feedItemRenderingStrategy']=_0x289d1b;}['toggleLoadingSkeleton'](_0x7d0ded){this['_view']['chatFeed']['toggleLoadingSkeleton'](_0x7d0ded);}['resetConversationTitle'](){this['setConversationTitle'](Yn(this['context']['locale'],'AI_CHAT_HEADING'));}['setConversationTitle'](_0x4be7c9,_0x1edebc=!0x1){if(_0x1edebc&&!At()&&_0x4be7c9['length'])return this['_view']['chatHeader']['label']='',void this['_animateConversationTitle'](_0x4be7c9);this['_view']['chatHeader']['label']=_0x4be7c9;}['_animateConversationTitle'](_0x5d308e){let _0xfbe243=0x0;clearInterval(this['_titleAnimationInterval']),this['_titleAnimationInterval']=setInterval(()=>{this['_view']['chatHeader']['label']=this['_view']['chatHeader']['label']+_0x5d308e[_0xfbe243],_0xfbe243++,_0xfbe243===_0x5d308e['length']&&clearInterval(this['_titleAnimationInterval']);},0x1e);}['setIsMaximized'](_0x8fd9ae){this['_view']['chatHeader']['isMaximized']=_0x8fd9ae;}['_getLoadingMessage'](_0xe29648){const _0x4e26f7=_0xe29648['capabilities'];return _0x4e26f7['isWebSearchEnabled']&&_0x4e26f7['isReasoningEnabled']?Yn(this['context']['locale'],'AI_CHAT_FEED_LOADING_MESSAGE_WEBSEARCH_REASONING'):_0x4e26f7['isWebSearchEnabled']?Yn(this['context']['locale'],'AI_CHAT_FEED_LOADING_MESSAGE_WEBSEARCH'):_0x4e26f7['isReasoningEnabled']?Yn(this['context']['locale'],'AI_CHAT_FEED_LOADING_MESSAGE_REASONING'):Yn(this['context']['locale'],'AI_CHAT_FEED_LOADING_MESSAGE_REGULAR');}['_getInputPlaceholder'](_0x231327){return _0x231327?_0x231327['isWebSearchEnabled']&&_0x231327['isReasoningEnabled']?Yn(this['context']['locale'],'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_WEBSEARCH_REASONING'):_0x231327['isWebSearchEnabled']?Yn(this['context']['locale'],'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_WEBSEARCH'):_0x231327['isReasoningEnabled']?Yn(this['context']['locale'],'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_REASONING'):Yn(this['context']['locale'],'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_REGULAR'):Yn(this['context']['locale'],'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_REGULAR');}['populateSourceResourceBalloon'](_0x1f222f,_0x4801c8,_0x68962d,_0x2a236a){this['_view']['populateSourceResourceBalloon'](_0x1f222f,_0x4801c8,_0x68962d,_0x2a236a);}['closeSourceResourceBalloon'](_0x6224fe){this['_view']['closeSourceResourceBalloon'](_0x6224fe);}['focusPromptInput'](){this['_view']['chatControls']['focusPromptInput']();}['scrollFeedToSuggestion'](_0x991a9d,_0x1f72e7){this['_view']['chatFeed']['scrollToSuggestion'](_0x991a9d,_0x1f72e7);}}class xi extends _0x3dc816{['sections'];constructor(_0x14cc59,_0x5e9bf2){super(_0x14cc59),this['sections']=_0x5e9bf2,this['items']['addMany'](this['sections']),this['extendTemplate']({'attributes':{'class':['ck-ai-chat-history__sections']}});}['filter'](_0x3c01b7){let _0x49ca36=0x0,_0x298787=0x0;for(const _0x4ef193 of this['sections']){const {resultsCount:_0x2b8f23,totalItemsCount:_0x210902}=_0x4ef193['filter'](_0x3c01b7);_0x49ca36+=_0x2b8f23,_0x298787+=_0x210902;}return{'resultsCount':_0x49ca36,'totalItemsCount':_0x298787};}}class Yi extends _0x22bc08{['title'];['itemsViews'];['_itemsListView'];constructor(_0x3db1f8,{title:_0x40190c,items:_0xdc2beb}){super(_0x3db1f8);const _0x4377a4=this['bindTemplate'];this['set']('isVisible',!0x0),this['title']=_0x40190c,this['itemsViews']=_0xdc2beb;const _0x36fd75=new _0xebef92(_0x3db1f8);_0x36fd75['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-chat-history__section-title']},'children':[this['title']]}),this['_itemsListView']=new _0x3dc816(_0x3db1f8),this['_itemsListView']['items']['addMany'](this['itemsViews']),this['setTemplate']({'tag':'li','attributes':{'class':['ck-ai-chat-history__section',_0x4377a4['if']('isVisible','ck-hidden',_0x3584ee=>!_0x3584ee)]},'children':[_0x36fd75,this['_itemsListView']]});}['filter'](_0x200c75){const _0x634245=this['itemsViews']['length'];let _0x9c2cb5=0x0;for(const _0xda8b2e of this['itemsViews']){if(_0x200c75){const _0xe67a1a=_0xda8b2e['isMatching'](_0x200c75);_0xda8b2e['isVisible']=!!_0xe67a1a,_0xda8b2e['highlightText'](_0x200c75);}else _0xda8b2e['isVisible']=!0x0,_0xda8b2e['highlightText'](null);_0xda8b2e['isVisible']&&_0x9c2cb5++;}return this['isVisible']=_0x9c2cb5>0x0,{'resultsCount':_0x9c2cb5,'totalItemsCount':_0x634245};}['getItem'](_0xa7636b){return this['itemsViews']['find'](_0x4df61c=>_0x4df61c['id']===_0xa7636b);}['removeItem'](_0x50628e){const _0x415ff0=this['itemsViews']['indexOf'](_0x50628e);-0x1!==_0x415ff0&&(this['itemsViews']['splice'](_0x415ff0,0x1),this['_itemsListView']['items']['remove'](_0x50628e));}}class Mi extends _0x490755(_0x22bc08){['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(_0x439cee,_0x3c879e){super(_0x439cee);const _0xc384a4=this['bindTemplate'];this['set']('isEdit',!0x1),this['set']('isVisible',!0x0),this['set']('pinned',!!_0x3c879e['pinned']),this['set']('loadingState',null),this['id']=_0x3c879e['id'];const {title:_0xb7fcb6,createdAt:_0x2440cb,active:_0x3cf975=!0x1}=_0x3c879e;this['_titleView']=new _0x357569(),this['_titleView']['text']=_0xb7fcb6,this['_titleView']['extendTemplate']({'attributes':{'class':['ck-ai-chat-history__item-title']}});const _0x4f6b9c=this['_createCheckView'](),_0x2ce0ce=this['_createPinButtonView'](_0x439cee),_0x4f4007=this['_createMenuDropdownView'](),_0x4015bb=this['_createEditInputView'](_0x439cee,_0xb7fcb6),_0xaff07=this['_createAcceptEditButtonView'](_0x439cee,_0x4015bb),_0x101310=this['_createCancelEditButtonView'](_0x439cee,_0x4015bb);this['actions']=this['createCollection'](),this['mainContent']=this['createCollection'](),this['mainContent']['add'](this['_titleView']),this['actions']['add'](_0x2ce0ce),this['actions']['add'](_0x4f4007),this['on']('change:isEdit',(_0x51739c,_0x4c6442,_0x55b4a4)=>{this['actions']['clear'](),this['mainContent']['clear'](),_0x55b4a4?(this['actions']['add'](_0xaff07),this['actions']['add'](_0x101310),this['mainContent']['add'](_0x4015bb),_0x4015bb['element']['focus']()):(this['actions']['add'](_0x2ce0ce),this['actions']['add'](_0x4f4007),this['mainContent']['add'](this['_titleView']));}),this['setTemplate']({'tag':'li','attributes':{'class':['ck-ai-chat-history__item',_0x3cf975?'ck-ai-chat-history__item--active':'',_0xc384a4['if']('isVisible','ck-hidden',_0xf31e7=>!_0xf31e7),_0xc384a4['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',_0xc384a4['if']('loadingState','ck-hidden',_0x4c8b6b=>!!_0x4c8b6b)]},'children':_0x3cf975?[_0x4f6b9c]:[]},{'tag':'div','attributes':{'class':['ck-ai-loader',_0xc384a4['if']('loadingState','ck-hidden',_0x53ad6a=>!_0x53ad6a)]},'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',_0xc384a4['if']('loadingState','ck-hidden',_0x48146f=>!!_0x48146f)]},'children':this['mainContent']},{'tag':'div','attributes':{'class':['ck-ai-loader__text',_0xc384a4['if']('loadingState','ck-hidden',_0x1f76ae=>!_0x1f76ae)]},'children':[{'text':_0xc384a4['to']('loadingState',_0x290182=>_0x290182?Yn(this['locale'],Mi['LOADING_LABELS'][_0x290182]):'')}]}]},{'tag':'span','attributes':{'class':['ck-ai-chat-history__item-date']},'children':[_0x2440cb]}]},{'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'](_0x25face){this['_titleView']['text']=_0x5453ce(_0x25face);}['updateLoadingState'](_0x577f29,_0x5bc202){this['set']('loadingState',_0x5bc202?_0x577f29:null);}['_createCheckView'](){const _0x9ebccc=new _0x23cd9a();return _0x9ebccc['set']({'content':_0x51abb4}),_0x9ebccc;}['_createPinButtonView'](_0x5c9138){const _0x4bfb36=new _0xa24b3c(_0x5c9138);return _0x4bfb36['set']({'label':Yn(_0x5c9138,'AI_CHAT_HISTORY_PIN_BUTTON'),'icon':_0x1c289e,'withText':!0x1,'tooltip':!0x0}),_0x4bfb36['bind']('isOn')['to'](this,'pinned'),_0x4bfb36['on']('execute',()=>{const _0x556406=!this['pinned'];this['fire']('setConversationPinned',{'id':this['id'],'pinned':_0x556406});}),_0x4bfb36;}['_createMenuDropdownView'](){const _0x2917b2=_0x115dce(this['locale'],_0x2fd5ab),_0x536e29=_0x2917b2['panelView']['children'];_0x2917b2['buttonView']['set']({'label':Yn(this['locale'],'AI_CHAT_HISTORY_SHOW_MORE_ITEMS'),'icon':_0x197fc5}),_0x2917b2['panelPosition']='sw';const _0x49a23a=new _0xa24b3c(this['locale']);_0x49a23a['label']=Yn(this['locale'],'AI_CHAT_HISTORY_EDIT_NAME'),_0x49a23a['withText']=!0x0,_0x49a23a['on']('execute',()=>{this['isEdit']=!0x0;});const _0x25513b=new _0xa24b3c(this['locale']);_0x25513b['label']=Yn(this['locale'],'AI_CHAT_HISTORY_REMOVE'),_0x25513b['withText']=!0x0,_0x25513b['on']('execute',()=>{this['showConfirm'](Yn(this['locale'],'AI_CHAT_HISTORY_REMOVE_CONFIRM'),this['element'])['then'](()=>{this['fire']('removeConversation',{'id':this['id']});});});const _0x35592c=new _0x3dc816(this['locale']),_0x46d6bc=new _0x22bc08(this['locale']);_0x46d6bc['children']['add'](_0x49a23a);const _0x2a9b3f=new _0x22bc08(this['locale']);return _0x2a9b3f['children']['add'](_0x25513b),_0x35592c['items']['addMany']([_0x46d6bc,_0x2a9b3f]),_0x536e29['add'](_0x35592c),_0x2917b2;}['_createEditInputView'](_0x54c338,_0x519a6e){const _0x170adc=new _0x4d3ca2(_0x54c338),_0x1c94c8=_0x170adc['bindTemplate'];return _0x170adc['value']=_0x519a6e,_0x170adc['extendTemplate']({'on':{'keydown':_0x1c94c8['to'](_0x290ba2=>{'Enter'==_0x290ba2['key']&&this['_commitEditInputValue'](_0x170adc);})}}),_0x170adc;}['_createAcceptEditButtonView'](_0x3b0e81,_0x5573a1){const _0x55f328=new _0xa24b3c(_0x3b0e81);return _0x55f328['set']({'icon':_0x51abb4,'withText':!0x1,'tooltip':Yn(_0x3b0e81,'AI_CHAT_HISTORY_ACCEPT')}),_0x55f328['extendTemplate']({'attributes':{'class':['ck-confirm-view-submit']}}),_0x55f328['on']('execute',()=>{this['_commitEditInputValue'](_0x5573a1);}),_0x55f328;}['_commitEditInputValue'](_0x578994){const _0x206e70=_0x578994['element']['value']||'';this['_titleView']['text']=_0x206e70,this['isEdit']=!0x1,this['fire']('editConversationTitle',{'id':this['id'],'title':_0x206e70});}['_createCancelEditButtonView'](_0x2769dd,_0x193d5a){const _0x48147d=new _0xa24b3c(_0x2769dd);return _0x48147d['set']({'icon':_0x309cee,'withText':!0x1,'tooltip':Yn(_0x2769dd,'AI_CHAT_HISTORY_CANCEL')}),_0x48147d['extendTemplate']({'attributes':{'class':['ck-confirm-view-cancel']}}),_0x48147d['on']('execute',()=>{this['isEdit']=!0x1,_0x193d5a['value']=this['_titleView']['text']||'',this['fire']('edit:cancel');}),_0x48147d;}['_createSpinnerView'](){const _0x2c14f2=new De('tiny');return _0x2c14f2['isVisible']=!0x0,_0x2c14f2;}['isMatching'](_0x332b67){return this['_titleView']&&'string'==typeof this['_titleView']['text']&&this['_titleView']['text']['match'](_0x332b67)?{'title':!0x0}:null;}['highlightText'](_0x2e6642){this['_titleView']['highlightText'](_0x2e6642);}}class vt extends _0xebef92{['searchView'];['errorView'];['skeletonView'];['emptyView'];['sectionsView'];['resizeButton'];constructor(_0x234925,_0x336df7){super(_0x234925),this['set']('hasItems',!0x1),this['set']('isLoading',!0x0),this['set']('errorMessage',''),this['set']('isMaximized',!0x1),this['set']('isSearchViewVisible',!0x1),this['set']('isEmptyViewVisible',!0x1);const _0x12e0f7=new _0x247e71(_0x234925,{'label':Yn(_0x234925,'AI_CHAT_HISTORY_HEADING'),'icon':Ht,'class':'ck-ai-header\x20ck-ai-header_history'});_0x336df7&&(this['resizeButton']=As(_0x234925,this),_0x12e0f7['children']['add'](this['resizeButton'])),this['sectionsView']=new xi(_0x234925,[]),this['sectionsView']['delegate'](...Li)['to'](this),this['errorView']=this['_createErrorView'](),this['skeletonView']=this['_createSkeletonView'](),this['emptyView']=this['_createEmptyStateView'](),this['searchView']=this['_createSearchView'](),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':[_0x12e0f7,{'tag':'div','attributes':{'class':['ck-ai-chat-history__content']},'children':[this['skeletonView'],this['errorView'],this['emptyView'],this['searchView']]}]});}['_updateViewVisibility'](){this['isSearchViewVisible']=!this['isLoading']&&this['hasItems']&&!this['errorMessage'],this['isEmptyViewVisible']=!this['isLoading']&&!this['hasItems']&&!this['errorMessage'];}['_createSearchView'](){const _0x50953a=new _0x39ca44(this['locale'],{'filteredView':this['sectionsView'],'queryView':{'label':Yn(this['locale'],'AI_CHAT_HISTORY_SEARCH_LABEL')},'infoView':{'text':{'notFound':{'primary':_0x11e59a=>Yn(this['locale'],'AI_CHAT_HISTORY_SEARCH_NOT_FOUND_PRIMARY',_0x11e59a),'secondary':Yn(this['locale'],'AI_CHAT_HISTORY_SEARCH_NOT_FOUND_SECONDARY')}}}});return _0x50953a['on']('render',()=>{this['searchView']['children']['add'](this['errorView'],0x1);}),_0x50953a['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isSearchViewVisible','ck-hidden',_0x202e9f=>!_0x202e9f)]}}),_0x50953a;}['_createSkeletonView'](){const _0x505b80=new Fe(this['locale'],Be['aiHistory']);return _0x505b80['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isLoading','ck-hidden',_0x247009=>!_0x247009)]}}),_0x505b80;}['_createErrorView'](){const _0x45b1bc=new _0xebef92(this['locale']),_0x296641=new _0xa24b3c(this['locale']);return _0x296641['set']({'withText':!0x1,'icon':_0x309cee,'class':'ck-ai-chat-error__dismiss-button'}),_0x296641['bind']('isVisible')['to'](this,'hasItems',_0x489bcb=>!!_0x489bcb),_0x296641['on']('execute',()=>{this['errorMessage']='';}),_0x45b1bc['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat-error',this['bindTemplate']['if']('errorMessage','ck-hidden',_0x21958a=>!_0x21958a)]},'children':[{'tag':'p','children':[{'text':this['bindTemplate']['to']('errorMessage')}]},_0x296641]}),_0x45b1bc;}['_createEmptyStateView'](){const _0x2f1f74=new _0xa24b3c(this['locale']);_0x2f1f74['set']({'withText':!0x0,'label':Yn(this['locale'],'AI_CHAT_HISTORY_GO_TO_CHAT_BUTTON'),'class':'ck-ai-chat-history__open-chat-button'}),_0x2f1f74['on']('execute',()=>{this['fire']('openChat');});const _0x441da7=new _0xebef92(this['locale']);return _0x441da7['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-chat-history__empty',this['bindTemplate']['if']('isEmptyViewVisible','ck-hidden',_0x1b0680=>!_0x1b0680)]},'children':[{'tag':'p','attributes':{'class':['ck-ai-chat-history__empty-message']},'children':[Yn(this['locale'],'AI_CHAT_HISTORY_EMPTY_MESSAGE')]},_0x2f1f74]}),_0x441da7;}['_createListItemViews'](_0x58f346,_0x17f1b4){const _0x105c25=[];for(const _0x5f262e of _0x58f346){const _0xb3187e=new Mi(_0x17f1b4,_0x5f262e);_0xb3187e['delegate'](...Li)['to'](this),_0x105c25['push'](_0xb3187e);}return _0x105c25;}['updateHistoryItemsWithCategories'](_0xf8b9db){const _0x3c2138=this['locale']||'en',_0x1b394e=[];for(const _0x4d443a of _0xf8b9db){const _0x55b146=this['_createListItemViews'](_0x4d443a['items'],_0x3c2138);_0x1b394e['push'](new Yi(_0x3c2138,{'title':_0x4d443a['title'],'items':_0x55b146}));}this['sectionsView']['sections']=_0x1b394e,this['sectionsView']['items']['clear'](),this['sectionsView']['items']['addMany'](_0x1b394e),this['hasItems']=_0xf8b9db['some'](_0x36b0cb=>_0x36b0cb['items']['length']>0x0),this['_refreshSearch']();}['removeHistoryItem'](_0x12e75d){for(const _0x52eeae of this['sectionsView']['sections']){const _0x4417b5=_0x52eeae['getItem'](_0x12e75d);if(_0x4417b5){if(_0x52eeae['removeItem'](_0x4417b5),0x0===_0x52eeae['itemsViews']['length']){const _0x5f1878=this['sectionsView']['sections']['indexOf'](_0x52eeae);-0x1!==_0x5f1878&&(this['sectionsView']['sections']['splice'](_0x5f1878,0x1),this['sectionsView']['items']['remove'](_0x52eeae));}this['hasItems']=this['sectionsView']['sections']['length']>0x0,this['_refreshSearch']();break;}}}['updateItemTitle'](_0x411640,_0x4ced7c){for(const _0x55daf0 of this['sectionsView']['sections']){const _0x1ecfcb=_0x55daf0['getItem'](_0x411640);if(_0x1ecfcb){_0x1ecfcb['updateTitle'](_0x4ced7c);break;}}}['updateItemLoadingState'](_0x57e66b,_0x8f2ffe,_0x3dc491){for(const _0x33055a of this['sectionsView']['sections']){const _0x37618a=_0x33055a['getItem'](_0x57e66b);if(_0x37618a){_0x37618a['updateLoadingState'](_0x8f2ffe,_0x3dc491);break;}}}['_refreshSearch'](){if(this['hasItems']){const _0x1a7f60=this['searchView']['queryView']['fieldView']?.['element']?.['value']||'';this['searchView']['search'](_0x1a7f60);}}}const Li=['showConversationHistory','removeConversation','editConversationTitle','setConversationPinned','selectConversation','openChat','resizeTabs'];class xt extends _0x3cc6c1{static get['requires'](){return[ht];}['_historyView'];static get['pluginName'](){return'AIChatHistoryUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x261d84){super(_0x261d84);const _0x3f7f07=this['context']['plugins']['get']('AITabs');this['_historyView']=new vt(this['context']['locale'],_0x3f7f07['showResizeButton']),this['_historyView']['delegate'](...Li)['to'](this),_0x3f7f07['view']['addTab']({'id':'history','buttonLabel':Yn(this['context']['locale'],'AI_CHAT_HISTORY_HEADING'),'buttonIcon':Ht,'order':0x0,'content':this['_historyView']});}['removeHistoryItem'](_0x461f4f){this['_historyView']['removeHistoryItem'](_0x461f4f);}['updateItems'](_0x1bd16d){this['_historyView']['updateHistoryItemsWithCategories'](_0x1bd16d);}['updateItemTitle'](_0x2809e2,_0x49138a){this['_historyView']['updateItemTitle'](_0x2809e2,_0x49138a);}['updateItemLoadingState'](_0x323917,_0x5b9366,_0x4ad944){this['_historyView']['updateItemLoadingState'](_0x323917,_0x5b9366,_0x4ad944);}['setLoadingSkeleton'](_0x1137e4){this['_historyView']['isLoading']=_0x1137e4;}['showError'](_0x201e11){this['_historyView']['errorMessage']=_0x201e11;}['hideError'](){this['_historyView']['errorMessage']='';}['setIsMaximized'](_0x2af792){this['_historyView']['isMaximized']=_0x2af792;}}class Ue extends _0x536028(){['id'];['createdAt'];constructor({id:_0xe7c679,title:_0x81874,createdAt:_0xd1d39d,updatedAt:_0xa24aad,pinned:_0x39ffc7}){super(),this['id']=_0xe7c679,this['createdAt']=new Date(_0xd1d39d),this['set']('title',_0x81874),this['set']('updatedAt',_0xa24aad?new Date(_0xa24aad):null),this['set']('pinned',_0x39ffc7||!0x1);}['updateTitle'](_0x3c509e){this['set']('title',_0x5453ce(_0x3c509e)),this['updatedAt']=new Date();}['updatePinned'](_0x43726c){this['set']('pinned',_0x43726c),this['updatedAt']=new Date();}}class Tt extends _0x5a5836(){['items']=[];['connector'];['group'];constructor({connector:_0x34833f,group:_0x59a2dc}){super(),this['connector']=_0x34833f,this['group']=_0x59a2dc;}async['init'](){try{const _0x2cec34=this['connector']['fetchConversations'](this['group']),_0x179ef6=await _0x2cec34['getConversations']();this['loadItems'](_0x179ef6);}catch(_0x177d53){this['fire']('error',{'error':_0x177d53,'operation':'init'});}}['addItem'](_0x1c0620){this['items']['push'](_0x1c0620);}async['removeItem'](_0xb47440){const _0x1a2cc9=this['items']['findIndex'](_0x110ba2=>_0x110ba2['id']===_0xb47440);if(-0x1===_0x1a2cc9)return!0x1;try{return await this['connector']['deleteConversation'](_0xb47440)['execute'](),this['items']['splice'](_0x1a2cc9,0x1),this['fire']('itemRemoved',{'itemId':_0xb47440}),!0x0;}catch(_0x51c2a7){return this['fire']('error',{'error':_0x51c2a7,'operation':'removeItem','itemId':_0xb47440}),!0x1;}}['getItem'](_0x2de069){return this['items']['find'](_0x378990=>_0x378990['id']===_0x2de069);}async['updateItemTitle'](_0x54153f,_0x2dbf33){const _0x23bd0b=this['getItem'](_0x54153f);if(!_0x23bd0b)return!0x1;try{return await this['connector']['updateConversation'](_0x54153f,{'title':_0x2dbf33})['getResult'](),_0x23bd0b['updateTitle'](_0x2dbf33),this['fire']('itemUpdated',{'itemId':_0x54153f,'updates':{'title':_0x2dbf33}}),!0x0;}catch(_0x4c767c){return this['fire']('error',{'error':_0x4c767c,'operation':'updateItemTitle','itemId':_0x54153f}),!0x1;}}async['updateItemPinned'](_0x49d2ed,_0x2ad511){const _0x324e63=this['getItem'](_0x49d2ed);if(!_0x324e63)return!0x1;try{return await this['connector']['updateConversation'](_0x49d2ed,{'pinned':_0x2ad511})['getResult'](),_0x324e63['updatePinned'](_0x2ad511),this['fire']('itemUpdated',{'itemId':_0x49d2ed,'updates':{'pinned':_0x2ad511}}),!0x0;}catch(_0x228ee7){return this['fire']('error',{'error':_0x228ee7,'operation':'updateItemPinned','itemId':_0x49d2ed}),!0x1;}}['loadItems'](_0xaa8cef){try{this['items']=[],_0xaa8cef['map'](_0x5b96aa=>{this['addItem'](new Ue(_0x5b96aa));}),this['fire']('itemsLoaded',{'items':[...this['items']]});}catch(_0x46157f){this['fire']('error',{'error':_0x46157f,'operation':'loadItems'});}}['getItems'](_0x15d636={}){const _0x2cd244=void 0x0!==_0x15d636['pinned']&&_0x15d636['pinned'],_0x1bc27a=_0x15d636['from']?new Date(_0x15d636['from']['getFullYear'](),_0x15d636['from']['getMonth'](),_0x15d636['from']['getDate']()):null,_0x293de7=_0x15d636['to']?new Date(_0x15d636['to']['getFullYear'](),_0x15d636['to']['getMonth'](),_0x15d636['to']['getDate']()):null;return this['items']['filter'](_0x4f072c=>{if(_0x4f072c['pinned']!==_0x2cd244)return!0x1;if(_0x293de7){const _0x200852=new Date(_0x4f072c['createdAt']['getFullYear'](),_0x4f072c['createdAt']['getMonth'](),_0x4f072c['createdAt']['getDate']());return _0x1bc27a?_0x1bc27a['getTime']()===_0x293de7['getTime']()?_0x200852['getTime']()===_0x1bc27a['getTime']():_0x200852<_0x293de7&&_0x200852>=_0x1bc27a:_0x200852<_0x293de7;}return!0x0;});}}class jt extends _0x3cc6c1{['_aiConnector'];['_aiChatHistoryUi'];['_aiChatController'];static get['requires'](){return[e,et,xt,ht];}static get['pluginName'](){return'AIChatHistoryController';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){this['_aiConnector']=this['context']['plugins']['get'](e),this['_aiChatHistoryUi']=this['context']['plugins']['get'](xt),this['_aiChatController']=this['context']['plugins']['get'](et);const _0x31e896=this['context']['plugins']['get'](ht),_0x4b0621=this['_aiChatController']['getGroupId']();this['history']=new Tt({'connector':this['_aiConnector'],'group':_0x4b0621}),this['listenTo'](this['_aiChatHistoryUi'],'removeConversation',(_0x2d15c8,_0x334d23)=>{this['_setItemLoading'](_0x334d23['id'],'remove'),this['_handleRemove'](_0x334d23['id']);}),this['listenTo'](this['_aiChatHistoryUi'],'editConversationTitle',(_0x3d6cfc,_0x479c28)=>{this['_setItemLoading'](_0x479c28['id'],'rename'),this['_handleEditTitle'](_0x479c28['id'],_0x479c28['title']);}),this['listenTo'](this['history'],'itemUpdated',(_0x385107,_0xdfed44)=>{void 0x0!==_0xdfed44['updates']['title']&&this['_aiChatHistoryUi']['updateItemTitle'](_0xdfed44['itemId'],_0xdfed44['updates']['title']),void 0x0!==_0xdfed44['updates']['pinned']&&this['_updateHistoryItemsUI'](),this['_clearItemLoading'](_0xdfed44['itemId']);}),this['listenTo'](this['history'],'itemRemoved',(_0x45f6d6,_0x1c718b)=>{this['_aiChatController']['handleRemovedConversation'](_0x1c718b['itemId']),this['_aiChatHistoryUi']['removeHistoryItem'](_0x1c718b['itemId']),this['_clearItemLoading'](_0x1c718b['itemId']);}),this['listenTo'](this['history'],'itemsLoaded',()=>{this['_updateHistoryItemsUI']();}),this['listenTo'](this['history'],'error',(_0x3ba192,_0x39e31a)=>{this['_handleHistoryErrorUI'](_0x39e31a['error'],_0x39e31a['operation'],_0x39e31a['itemId']);}),this['listenTo'](this['_aiChatHistoryUi'],'selectConversation',(_0x5556fd,_0x2f9095)=>{this['_handleSelectConversation'](_0x2f9095['id']);}),this['listenTo'](this['_aiChatHistoryUi'],'setConversationPinned',(_0x308d85,_0x2793df)=>{const _0x4712b6=_0x2793df['pinned']?'pin':'unpin';this['_setItemLoading'](_0x2793df['id'],_0x4712b6),this['_handleTogglePin'](_0x2793df['id'],_0x2793df['pinned']);}),this['listenTo'](this['_aiChatHistoryUi'],'openChat',()=>{_0x31e896['view']['activateTab']('chat');}),this['listenTo'](this['_aiChatController'],'change:activeConversation',()=>{this['_updateHistoryItemsUI']();}),_0x31e896['view']['on']('activateTab:history',()=>{this['_showConversationHistory']();}),this['listenTo'](_0x31e896,'resizedTabs',(_0x4cc5aa,_0x5698ff)=>{this['_setIsMaximized'](_0x5698ff);}),this['listenTo'](this['_aiChatHistoryUi'],'resizeTabs',()=>{_0x31e896['resize']();});}async['_handleEditTitle'](_0x2ebfd5,_0x228a4c){await this['history']['updateItemTitle'](_0x2ebfd5,_0x228a4c);}async['_handleTogglePin'](_0x2bc97b,_0x24adcd){await this['history']['updateItemPinned'](_0x2bc97b,_0x24adcd);}async['_handleRemove'](_0x1fff98){await this['history']['removeItem'](_0x1fff98);}async['_handleSelectConversation'](_0x95c445){await this['_aiChatController']['loadConversation'](_0x95c445);}async['_showConversationHistory'](){this['_aiChatHistoryUi']['showError'](''),this['_aiChatHistoryUi']['setLoadingSkeleton'](!0x0),await this['history']['init'](),this['_aiChatHistoryUi']['setLoadingSkeleton'](!0x1);}['_updateHistoryItemsUI'](){const _0x12ff5a=this['_aiChatController']['activeConversation']?.['id'],_0x159ab6=this['_getCategorizedItems']()['map'](_0x5e017a=>({'title':_0x5e017a['title'],'items':_0x5e017a['items']['map'](_0x1f3fe1=>({'id':_0x1f3fe1['id'],'title':_0x1f3fe1['title']||Yn(this['context']['locale'],'AI_CHAT_UNTITLED_CONVERSATION'),'createdAt':new Date(_0x1f3fe1['createdAt'])['toLocaleDateString'](),'active':_0x1f3fe1['id']===_0x12ff5a,'pinned':_0x1f3fe1['pinned']}))}));this['_aiChatHistoryUi']['updateItems'](_0x159ab6);}['_setItemLoading'](_0x3b73f6,_0x3f7b01){this['_aiChatHistoryUi']['updateItemLoadingState'](_0x3b73f6,_0x3f7b01,!0x0);}['_clearItemLoading'](_0x3c0def){this['_aiChatHistoryUi']['updateItemLoadingState'](_0x3c0def,null,!0x1);}['_handleHistoryErrorUI'](_0x3f5d12,_0x113eb8,_0x251543){const _0x247393=this['_generateErrorMessage'](_0x113eb8,_0x251543);this['_aiChatHistoryUi']['showError'](_0x247393),_0x251543&&this['_clearItemLoading'](_0x251543),this['_aiChatHistoryUi']['setLoadingSkeleton'](!0x1);}['_generateErrorMessage'](_0x385f48,_0x584318){const _0x58b7a7=_0x584318?this['history']['getItem'](_0x584318):null,_0x4a561a=_0x58b7a7?.['title']||Yn(this['context']['locale'],'AI_CHAT_UNTITLED_CONVERSATION');switch(_0x385f48){case'updateItemTitle':return Yn(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_UPDATE_TITLE',_0x4a561a);case'updateItemPinned':{const _0x51464d=Yn(this['context']['locale'],_0x58b7a7?.['pinned']?'AI_CHAT_HISTORY_UNPIN_ACTION':'AI_CHAT_HISTORY_PIN_ACTION');return Yn(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_UPDATE_PINNED',[_0x51464d,_0x4a561a]);}case'removeItem':return Yn(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_REMOVE_ITEM',_0x4a561a);case'init':case'loadItems':return Yn(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_LOAD_ITEMS');default:return Yn(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_GENERIC');}}['_getCategorizedItems'](){const _0x1457b7=new Date(),_0x4a9028=new Date(_0x1457b7['getFullYear'](),_0x1457b7['getMonth'](),_0x1457b7['getDate']()),_0x3288b1=new Date(_0x4a9028);_0x3288b1['setDate'](_0x3288b1['getDate']()-0x1);const _0x4099a1=new Date(_0x4a9028);_0x4099a1['setDate'](_0x4099a1['getDate']()-0xe);const _0x169ca9=this['history']['getItems']({'pinned':!0x0}),_0x1baa19=this['history']['getItems']({'from':_0x4a9028,'to':_0x4a9028}),_0x49fdbd=this['history']['getItems']({'from':_0x3288b1,'to':_0x3288b1}),_0x1cc9e3=this['history']['getItems']({'from':_0x4099a1,'to':_0x3288b1}),_0x5d37bd=this['history']['getItems']({'to':_0x4099a1}),_0x5c6aa3=[];return _0x169ca9['length']>0x0&&_0x5c6aa3['push']({'title':Yn(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_PINNED'),'items':_0x169ca9}),_0x1baa19['length']>0x0&&_0x5c6aa3['push']({'title':Yn(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_TODAY'),'items':_0x1baa19}),_0x49fdbd['length']>0x0&&_0x5c6aa3['push']({'title':Yn(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_YESTERDAY'),'items':_0x49fdbd}),_0x1cc9e3['length']>0x0&&_0x5c6aa3['push']({'title':Yn(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_LAST_14_DAYS'),'items':_0x1cc9e3}),_0x5d37bd['length']>0x0&&_0x5c6aa3['push']({'title':Yn(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_LATER'),'items':_0x5d37bd}),_0x5c6aa3;}['_setIsMaximized'](_0x2cad29){this['_aiChatHistoryUi']['setIsMaximized'](_0x2cad29);}}class st extends _0x3cc6c1{static get['requires'](){return[jt,xt];}static get['pluginName'](){return'AIChatHistory';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}class Ea extends _0x3cc6c1{static get['requires'](){return[et,a,at,st];}static get['pluginName'](){return'AIChat';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x44563a){super(_0x44563a);const _0x218e7a=_0x44563a['config'];_0x218e7a['define']('ai.chat.context',{'document':{'enabled':!0x0},'urls':{'enabled':!0x0},'files':{'enabled':!0x0},'sources':[]}),_0x218e7a['define']('ai.chat.models',{'defaultModelId':void 0x0,'modelSelectorAlwaysVisible':!0x0,'displayedModels':void 0x0});}async['addSelectionToChatContext'](){await this['context']['plugins']['get'](et)['addSelectionToChatContext']();}async['startConversation'](){await this['context']['plugins']['get'](et)['startConversation']();}async['sendMessage']({message:_0x4bafeb,quickActionData:_0x5c4ff7}){await this['context']['plugins']['get'](et)['sendMessage']({'message':_0x4bafeb,'quickActionData':_0x5c4ff7});}['removeSelectionFromChatContext'](){this['context']['plugins']['get'](et)['removeSelectionFromChatContext']();}['focusPromptInput'](){this['context']['plugins']['get'](et)['focusPromptInput']();}}function f(_0x13d303,_0x3a7e2a,_0x39fb9b){const t=_0x13d303['t'];switch(_0x3a7e2a){case'AI_QUICK_ACTIONS_HEADING':return t({'id':'AI_QUICK_ACTIONS_HEADING','string':'AI\x20Quick\x20Actions'});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_PLUGIN_NOT_FOUND':return t({'id':'AI_QUICK_ACTIONS_PLUGIN_NOT_FOUND','string':'%0\x20plugin\x20is\x20required\x20but\x20not\x20found.'},_0x39fb9b);case'AI_QUICK_ACTIONS_OTHER':return t({'id':'AI_QUICK_ACTIONS_OTHER','string':'Other'});default:return _0x3a7e2a;}}function Ft(_0x448256,_0x3668fc,_0x3f09cb=!0x1,_0x3f0cf1=!0x0){return()=>{const _0x568db7=_0x448256['locale'],_0x1a3427=new _0xa24b3c(_0x568db7),_0x1eff1e=_0x1a3427['bindTemplate'];_0x1a3427['extendTemplate']({'on':{'mouseenter':_0x1eff1e['to'](()=>{_0x1a3427['focus']();})}});const _0x3c0add=_0x3668fc['icon']??_0x3668fc['parent']?.['icon'];return _0x1a3427['set']({'label':_0x3668fc['displayedPrompt'],'withText':_0x3f09cb,'role':'menuitem','icon':_0x3f0cf1?_0x3c0add??_0x51a38c:void 0x0,'tooltip':!_0x3f09cb}),_0x1a3427['on']('execute',()=>{_0x448256['editing']['view']['focus'](),_0x448256['commands']['execute']('aiQuickAction',_0x3668fc);}),_0x1a3427;};}const qs='menu',ys='menuitem';class io extends _0xebef92{['_bodyCollection'];['optionsListView'];['focusTracker'];['keystrokes'];['_focusables'];['focusCycler'];['_openNestedPanels']=new Set();constructor(_0x5e56ab,_0x45059b,_0xc4697b,_0x3a3479){const _0x24b1c1=_0x5e56ab['locale'];super(_0x24b1c1),this['_bodyCollection']=_0x3a3479;const _0x1e1e3f=this['_createListItems'](_0x5e56ab,_0x45059b,_0xc4697b);this['optionsListView']=new _0x3dc816(_0x24b1c1),this['optionsListView']['role']=qs,this['optionsListView']['items']['addMany'](_0x1e1e3f),this['focusTracker']=new _0x13c01a(),this['keystrokes']=new _0x3c58a3(),this['_focusables']=_0x1e1e3f,this['focusCycler']=new _0x532b63({'focusables':this['_focusables'],'focusTracker':this['focusTracker'],'keystrokeHandler':this['keystrokes']}),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset_all','ck-ai-quick-actions','ck-rounded-corners'],'dir':_0x24b1c1['uiLanguageDirection']},'children':[this['optionsListView']]});}['_createListItems'](_0x27bd05,_0x34259d,_0x5c525f){const _0x32d640=new _0x18aaa9();return _0x34259d['forEach'](_0x29a7fe=>{'actions'in _0x29a7fe?_0x32d640['add'](this['_createActionGroupButton'](_0x27bd05,_0x29a7fe,_0x5c525f)):_0x32d640['add'](this['_createActionButton'](_0x27bd05,_0x29a7fe));}),_0x32d640;}['_createActionButton'](_0x13688b,_0x3b3a20){const _0x2a3a7d=new _0x22bc08(this['locale']),_0x5ade2b=Ft(_0x13688b,_0x3b3a20,!0x0)();return _0x2a3a7d['children']['add'](_0x5ade2b),_0x2a3a7d;}['_createActionGroupButton'](_0x8c282a,_0x52ce0f,_0x3bde61){const _0x496baf=new _0x22bc08(this['locale']),_0x179ffb=new _0x4f934c(this['locale']),_0x13dfc4=_0x179ffb['bindTemplate'],_0x5978f9='rtl'===_0x3bde61['locale']['uiLanguageDirection']?'ArrowRight':'ArrowLeft',_0x3fc087=this['_createGroupActionsList'](_0x8c282a,_0x52ce0f['actions'],_0x3bde61);_0x179ffb['set']({'label':_0x52ce0f['label'],'withText':!0x0,'role':ys,'icon':_0x52ce0f['icon']??_0x51a38c}),_0x179ffb['extendTemplate']({'on':{'mouseenter':_0x13dfc4['to'](()=>{_0x179ffb['focus']();})}});const _0x201eaf=new _0x5b9e88(this['locale']);return _0x201eaf['extendTemplate']({'attributes':{'class':['ck','ck-reset_all','ck-ai-quick-actions-group-panel','ck-dropdown-menu__nested-menu__panel']},'on':{'keydown':_0x13dfc4['to'](_0x2ad165=>{_0x2ad165['key']==_0x5978f9&&(_0x179ffb['focus'](),this['_hideNestedPanel'](_0x201eaf));})}}),_0x179ffb['bind']('isOn')['to'](_0x201eaf,'isVisible'),this['_bodyCollection']['add'](_0x201eaf),_0x201eaf['content']['add'](_0x3fc087),this['_setupGroupMenuBehavior'](_0x179ffb,_0x201eaf),_0x496baf['children']['add'](_0x179ffb),_0x496baf;}['_createGroupActionsList'](_0x843136,_0x146b47,_0x4ff3cc){const _0xce426c=new _0x3dc816(this['locale']);return _0xce426c['extendTemplate']({'attributes':{'class':['ck','ck-reset_all','ck-ai-quick-actions-group-list','ck-dropdown-menu-list']}}),_0x146b47['forEach'](_0x487283=>{const _0xa1b850=new _0x22bc08(this['locale']),_0x4112e7=Ft(_0x843136,_0x487283,!0x0,!0x1)();_0xa1b850['children']['add'](_0x4112e7),_0x4ff3cc['focusTracker']['add'](_0x4112e7),_0xce426c['items']['add'](_0xa1b850);}),_0xce426c;}['_setupGroupMenuBehavior'](_0x30917c,_0x125e7c){const _0x1e6505=_0x30917c['bindTemplate'],_0x57a79d='rtl'===_0x30917c['locale']['uiLanguageDirection']?'ArrowLeft':'ArrowRight';_0x30917c['extendTemplate']({'attributes':{'class':['ck-ai-quick-actions-group-button']},'on':{'mouseenter':_0x1e6505['to'](()=>{this['_showNestedPanel'](_0x125e7c,_0x30917c);}),'mouseleave':_0x1e6505['to'](_0x1298c1=>{const _0x1da193=_0x1298c1['relatedTarget'];this['_isMovingToNestedMenu'](_0x1da193,_0x125e7c)||this['_hideNestedPanel'](_0x125e7c);}),'keydown':_0x1e6505['to'](_0x4cbea1=>{_0x4cbea1['key']==_0x57a79d&&(this['_showNestedPanel'](_0x125e7c,_0x30917c),_0x125e7c['content']['get'](0x0)['focus']());})}}),_0x125e7c['on']('render',()=>{_0x125e7c['element']?.['addEventListener']('mouseleave',_0x51284e=>{const _0x5a010c=_0x51284e['relatedTarget'];_0x30917c['element']?.['contains'](_0x5a010c)||this['_isMovingToNestedMenu'](_0x5a010c,_0x125e7c)||this['_hideNestedPanel'](_0x125e7c);});});}['_showNestedPanel'](_0x4e11a5,_0x4dfa78){this['_openNestedPanels']['forEach'](_0x52ded3=>{_0x52ded3!==_0x4e11a5&&_0x52ded3['isVisible']&&_0x52ded3['hide']();}),_0x4e11a5['show'](),_0x4e11a5['pin']({'positions':[_0x350094['eastSouth']],'target':_0x4dfa78['element'],'fitInViewport':!0x0}),this['_openNestedPanels']['add'](_0x4e11a5);}['_hideNestedPanel'](_0x908f3e){_0x908f3e['hide'](),this['_openNestedPanels']['delete'](_0x908f3e);}['_hideAllNestedPanels'](){this['_openNestedPanels']['forEach'](_0x28adad=>_0x28adad['hide']()),this['_openNestedPanels']['clear']();}['_isMovingToNestedMenu'](_0x44ed38,_0x4bfa05){if(!_0x44ed38)return!0x1;if(_0x4bfa05['element']?.['contains'](_0x44ed38))return!0x0;const _0x5afb8a=_0x44ed38;return _0x5afb8a['closest']&&(null!==_0x5afb8a['closest']('.ck-ai-quick-actions-group-panel')||null!==_0x5afb8a['closest']('.ck-ai-quick-actions-group-list')||null!==_0x5afb8a['closest']('.ck-ai-quick-actions-group-button'));}['destroy'](){this['_hideAllNestedPanels'](),this['_bodyCollection']['detachFromDom'](),super['destroy']();}['focus'](){this['optionsListView']['focus']();}}function Gt(_0x72de75,_0x3a3a26,_0x3234ac,_0x127185){return()=>{const _0x2340ef=_0x72de75['locale'],_0x474ab5=_0x115dce(_0x2340ef);_0x474ab5['buttonView']['set']({'icon':_0x3234ac['icon']??_0x51a38c,'label':_0x3234ac['label'],'tooltip':!0x0}),_0x474ab5['set']({'class':'ck-ai-quick-actions-dropdown'});const _0x2ec7bc=new io(_0x72de75,_0x3a3a26,_0x474ab5,_0x127185);return _0x474ab5['panelView']['children']['add'](_0x2ec7bc),_0x474ab5;};}const Jt='<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>',Vt='<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>',Xt='<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 Ot=function(_0x5d0564){return _0x5d0564['CHAT']='CHAT',_0x5d0564['ACTION']='ACTION',_0x5d0564['REVIEW']='REVIEW',_0x5d0564;}({}),Ca=function(_0x11cf26){return _0x11cf26['CHAT']='AIChat',_0x11cf26['ACTION']='AIActions',_0x11cf26['REVIEW']='AIReviewMode',_0x11cf26;}({});class ii extends _0x5167f5{static get['requires'](){return[Wt];}static get['pluginName'](){return'AIQuickActionsUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){this['_prepareQuickActionsDefinition'](this['_getDefaultAndCustomActions']()),this['_initializeQuickActionsComponentsAndCommands']();}static['getDefaultQuickActions'](_0x53897d){return function(_0x4c628a){const _0x19703e=new Intl['DisplayNames'](['en'],{'type':'language'})['of'](_0x4c628a['uiLanguage']),_0x172679=_0x19703e||'English',_0x307627=[{'id':'ask-ai','displayedPrompt':f(_0x4c628a,'AI_QUICK_ACTIONS_ASK_AI'),'type':'CHAT','icon':Ut},{'id':'chat-commands','label':f(_0x4c628a,'AI_QUICK_ACTIONS_CHAT_COMMANDS'),'icon':Kt,'actions':[{'id':'explain','displayedPrompt':f(_0x4c628a,'AI_QUICK_ACTIONS_EXPLAIN'),'prompt':Jt['replace']('%0',_0x172679),'type':'CHAT'},{'id':'summarize','displayedPrompt':f(_0x4c628a,'AI_QUICK_ACTIONS_SUMMARIZE'),'prompt':Vt['replace']('%0',_0x172679),'type':'CHAT'},{'id':'highlight-key-points','displayedPrompt':f(_0x4c628a,'AI_QUICK_ACTIONS_HIGHLIGHT_KEY_POINTS'),'prompt':Xt['replace']('%0',_0x172679),'type':'CHAT'}]},{'id':'improve-writing','displayedPrompt':f(_0x4c628a,'AI_QUICK_ACTIONS_IMPROVE_WRITING'),'type':'ACTION','icon':Dt},{'id':'continue','displayedPrompt':f(_0x4c628a,'AI_QUICK_ACTIONS_CONTINUE_WRITING'),'type':'ACTION','icon':Mt},{'id':'fix-grammar','displayedPrompt':f(_0x4c628a,'AI_QUICK_ACTIONS_FIX_GRAMMAR_SPELLING'),'type':'ACTION','icon':Lt},{'id':'adjust-length','label':f(_0x4c628a,'AI_QUICK_ACTIONS_ADJUST_LENGTH'),'icon':Qt,'actions':[{'id':'make-shorter','displayedPrompt':f(_0x4c628a,'AI_QUICK_ACTIONS_MAKE_SHORTER'),'type':'ACTION'},{'id':'make-longer','displayedPrompt':f(_0x4c628a,'AI_QUICK_ACTIONS_MAKE_LONGER'),'type':'ACTION'}]},{'id':'change-tone','label':f(_0x4c628a,'AI_QUICK_ACTIONS_CHANGE_TONE'),'icon':bt,'actions':[{'id':'make-tone-casual','displayedPrompt':f(_0x4c628a,'AI_QUICK_ACTIONS_MORE_CASUAL'),'type':'ACTION'},{'id':'make-tone-direct','displayedPrompt':f(_0x4c628a,'AI_QUICK_ACTIONS_MORE_DIRECT'),'type':'ACTION'},{'id':'make-tone-friendly','displayedPrompt':f(_0x4c628a,'AI_QUICK_ACTIONS_MORE_FRIENDLY'),'type':'ACTION'},{'id':'make-tone-confident','displayedPrompt':f(_0x4c628a,'AI_QUICK_ACTIONS_MORE_CONFIDENT'),'type':'ACTION'},{'id':'make-tone-professional','displayedPrompt':f(_0x4c628a,'AI_QUICK_ACTIONS_MORE_PROFESSIONAL'),'type':'ACTION'}]},{'id':'translate','label':f(_0x4c628a,'AI_QUICK_ACTIONS_TRANSLATE'),'icon':qt,'actions':[{'id':'translate-to-english','displayedPrompt':f(_0x4c628a,'AI_QUICK_ACTIONS_TRANSLATE_ENGLISH'),'type':'ACTION','actionName':'translate','args':{'language':'english'}},{'id':'translate-to-chinese','displayedPrompt':f(_0x4c628a,'AI_QUICK_ACTIONS_TRANSLATE_CHINESE'),'type':'ACTION','actionName':'translate','args':{'language':'chinese'}},{'id':'translate-to-french','displayedPrompt':f(_0x4c628a,'AI_QUICK_ACTIONS_TRANSLATE_FRENCH'),'type':'ACTION','actionName':'translate','args':{'language':'french'}},{'id':'translate-to-japanese','displayedPrompt':f(_0x4c628a,'AI_QUICK_ACTIONS_TRANSLATE_JAPANESE'),'type':'ACTION','actionName':'translate','args':{'language':'japanese'}},{'id':'translate-to-portuguese','displayedPrompt':f(_0x4c628a,'AI_QUICK_ACTIONS_TRANSLATE_PORTUGUESE'),'type':'ACTION','actionName':'translate','args':{'language':'portuguese'}},{'id':'translate-to-korean','displayedPrompt':f(_0x4c628a,'AI_QUICK_ACTIONS_TRANSLATE_KOREAN'),'type':'ACTION','actionName':'translate','args':{'language':'korean'}},{'id':'translate-to-italian','displayedPrompt':f(_0x4c628a,'AI_QUICK_ACTIONS_TRANSLATE_ITALIAN'),'type':'ACTION','actionName':'translate','args':{'language':'italian'}},{'id':'translate-to-russian','displayedPrompt':f(_0x4c628a,'AI_QUICK_ACTIONS_TRANSLATE_RUSSIAN'),'type':'ACTION','actionName':'translate','args':{'language':'russian'}}]},{'id':'other','label':f(_0x4c628a,'AI_QUICK_ACTIONS_OTHER'),'icon':Yt,'actions':[]}];return _0x307627;}(_0x53897d);}['_getDefaultAndCustomActions'](){const _0x55f88f=ii['getDefaultQuickActions'](this['editor']['locale']),_0x428605=(this['editor']['config']['get']('ai.quickActions.extraCommands')||[])['map'](_0x197be5=>({..._0x197be5,'icon':void 0x0}));return _0x55f88f['find'](_0x4475d3=>'other'===_0x4475d3['id'])['actions']['push'](..._0x428605),_0x55f88f;}['_initializeQuickActionsComponentsAndCommands'](){const _0xcb80cd=new zt(this['editor']['locale']);_0xcb80cd['attachToDom'](),this['_initializeQuickActionsDropdown'](_0xcb80cd),this['_initializeQuickActionsComponents'](_0xcb80cd);}['_initializeQuickActionsDropdown'](_0x5e98f1){this['editor']['ui']['componentFactory']['add']('aiQuickActions',Gt(this['editor'],this['_quickActionsDefinition'],{'icon':_0x51a38c,'label':f(this['editor']['locale'],'AI_QUICK_ACTIONS_HEADING')},_0x5e98f1));}['_prepareQuickActionsDefinition'](_0x191bd6){this['_quickActionsDefinition']=_0x191bd6['map'](_0x498cef=>{if('actions'in _0x498cef){const _0x2b4e93=_0x498cef;return{..._0x2b4e93,'actions':_0x2b4e93['actions']['map'](_0x15c014=>{const {actions:_0x18dfd4,..._0x59893a}=_0x2b4e93;return{..._0x15c014,'parent':_0x59893a};})['filter'](_0x44a098=>this['_shouldIncludeAction'](_0x44a098))};}return _0x498cef;})['filter'](_0xff4a47=>'actions'in _0xff4a47?_0xff4a47['actions']['length']>0x0:this['_shouldIncludeAction'](_0xff4a47));}['_shouldIncludeAction'](_0x5e21e4){const _0x6fc884=this['editor']['config']['get']('ai.quickActions.removeCommands')||[];return this['editor']['plugins']['has'](Ca[_0x5e21e4['type']])&&!_0x6fc884['includes'](_0x5e21e4['id']);}['_initializeQuickActionsComponents'](_0x1f889f){this['_quickActionsDefinition']['forEach'](_0x234549=>{if('actions'in _0x234549){const _0x295132=Gt(this['editor'],_0x234549['actions'],_0x234549,_0x1f889f);this['editor']['ui']['componentFactory']['add'](_0x234549['id'],_0x295132),_0x234549['actions']['forEach'](_0x323c8e=>{const _0x4bf693=Ft(this['editor'],_0x323c8e);this['editor']['ui']['componentFactory']['add'](_0x323c8e['id'],_0x4bf693);});}else{const _0x5bcd92=Ft(this['editor'],_0x234549);this['editor']['ui']['componentFactory']['add'](_0x234549['id'],_0x5bcd92);}});}}class ci extends Nt{['execute'](_0x5c5c5f){switch(_0x5c5c5f['type']){case Ot['CHAT']:if(!this['editor']['plugins']['has']('AIChat')){const _0x257560=f(this['editor']['locale'],'AI_QUICK_ACTIONS_PLUGIN_NOT_FOUND','AIChat');throw new _0xa14e6e('ai-quick-actions-plugin-not-found',this['editor'],{'errorMessage':_0x257560});}this['_handleAIChatAction'](_0x5c5c5f);break;case Ot['ACTION']:if(!this['editor']['plugins']['has']('AIActions')){const _0x4bb745=f(this['editor']['locale'],'AI_QUICK_ACTIONS_PLUGIN_NOT_FOUND','AIActions');throw new _0xa14e6e('ai-quick-actions-plugin-not-found',this['editor'],{'errorMessage':_0x4bb745});}this['_handleAIActionsAction'](_0x5c5c5f);break;case Ot['REVIEW']:if(!this['editor']['plugins']['has']('AIReviewMode')){const _0x163d57=f(this['editor']['locale'],'AI_QUICK_ACTIONS_PLUGIN_NOT_FOUND','AIReviewMode');throw new _0xa14e6e('ai-quick-actions-plugin-not-found',this['editor'],{'errorMessage':_0x163d57});}this['_handleAIReviewAction'](_0x5c5c5f);}}async['_handleAIChatAction'](_0x5359fb){const _0xf020cc=this['editor']['plugins']['get']('AIChat'),_0x3a9337=this['editor']['plugins']['get']('AIChatController');if(this['editor']['plugins']['get']('AITabs')['view']['activateTab']('chat'),'ask-ai'===_0x5359fb['id'])_0x3a9337['removeSelectionFromChatContext'](),this['_expandSelectionIfCollapsed'](),await _0xf020cc['addSelectionToChatContext'](),_0xf020cc['focusPromptInput']();else await _0xf020cc['startConversation'](),await _0xf020cc['addSelectionToChatContext'](),await _0xf020cc['sendMessage']({'message':_0x5359fb['prompt']||_0x5359fb['displayedPrompt'],'quickActionData':{'id':_0x5359fb['id'],'displayedPrompt':_0x5359fb['displayedPrompt']}});}['_expandSelectionIfCollapsed'](){const _0x479603=this['editor'],_0x2a8ef3=_0x479603['model']['document']['selection'];if(!_0x2a8ef3['isCollapsed'])return;const _0x5bc1f7=_0x4cdc37(_0x2a8ef3['getSelectedBlocks']())||_0x479603['model']['schema']['getLimitElement'](_0x2a8ef3);_0x479603['model']['change'](_0x34c12c=>{_0x34c12c['setSelection'](_0x5bc1f7,'in');});}['_handleAIActionsActionLabel'](_0x2cc385){return _0x2cc385['parent']?.['label']&&'other'!==_0x2cc385['parent']?.['id']?_0x2cc385['parent']['label']+':\x20'+_0x2cc385['displayedPrompt']:_0x2cc385['displayedPrompt'];}async['_handleAIActionsAction'](_0x39bba3){const _0x20f8f6=this['editor']['plugins']['get']('AIActions'),_0xd4bb54=_0x39bba3['prompt']?{'userMessage':_0x39bba3['prompt'],'model':_0x39bba3['model']}:{'actionName':_0x39bba3['actionName']||_0x39bba3['id'],'args':_0x39bba3['args']},_0x3018cf=this['_handleAIActionsActionLabel'](_0x39bba3);await _0x20f8f6['executeAction'](_0xd4bb54,_0x3018cf,_0x39bba3['icon']);}async['_handleAIReviewAction'](_0x20ae46){console['log']('handleAIReviewAction',_0x20ae46);}}class ti extends _0x5167f5{static get['pluginName'](){return'AIQuickActionsEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const _0x2e1b11=this['editor'],_0x3723cb=new ci(this['editor']);if(_0x2e1b11['commands']['add']('aiQuickAction',_0x3723cb),_0x2e1b11['plugins']['has']('AIChat')){const _0x4481eb=this['editor']['plugins']['get']('AIChat');_0x2e1b11['model']['document']['selection']['on']('change:range',(_0x3ac259,_0x325cf3)=>{_0x325cf3['directChange']&&_0x4481eb['removeSelectionFromChatContext']();});}}}class wa extends _0x5167f5{static get['requires'](){return[ii,ti];}static get['pluginName'](){return'AIQuickActions';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x4b9e8f){super(_0x4b9e8f),_0x4b9e8f['config']['define']('ai.quickActions',{'extraCommands':[],'removeCommands':[]});}}class le extends pe{['updateChangeGroups'](){if(this['parsedMergedContent']=this['parsedContent']['cloneNode'](!0x0),0x0==this['parsedMergedContent']['childNodes']['length'])return void(this['changeGroups']=[]);const _0x3e6db2=this['documentContextContent']['children']['map'](_0xe9e84b=>({'node':_0xe9e84b,'id':ft(_0xe9e84b,'data-id')})),_0x1d623f=this['parsedMergedContent']['children']['map'](_0x42131e=>({'node':_0x42131e,'id':ft(_0x42131e,'data-id')||_0x48375a()})),_0x54d44b=_0x3eba85(_0x3e6db2,_0x1d623f,{'comparator':(_0x158daa,_0x19dbe5)=>_0x158daa['id']==_0x19dbe5['id'],'oneChangePerToken':!0x0});if(!this['isDone']){for(;_0x54d44b['length']&&_0x54d44b[_0x54d44b['length']-0x1]['removed'];)_0x54d44b['pop']();}const _0x62131a=_0x54d44b['map'](_0x2991cb=>{const _0x8e58fd=_0x2991cb['added']?'new':_0x2991cb['removed']?'removed':'modified';return{'node':_0x2991cb['value'][0x0]['node'],'type':_0x8e58fd,'id':_0x2991cb['value'][0x0]['id']};});this['changeGroups']=[{'changes':_0x62131a,'state':'pending','index':0x0}];}['_getDifferentChangeGroups'](_0x17fa3b,_0x4a8f00){return _0x4a8f00;}}class c extends me{['content'];['version'];['actionName'];['args'];['userMessage'];['model'];constructor(_0x12897c){super(_0x12897c),this['content']=_0x12897c['content'],this['version']=_0x12897c['version'],this['actionName']=_0x12897c['actionName'],this['args']=_0x12897c['args'],this['userMessage']=_0x12897c['userMessage'],this['model']=_0x12897c['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':de['TEXT'],'content':this['content'],'version':this['version'],'label':'Current\x20document','uiId':'current-document'};}['createReply'](_0x4a960a){const _0x438ac6=new le({'editor':this['editor'],'documentContextContent':this['content'],..._0x4a960a});return this['replies']['push'](_0x438ac6),_0x438ac6['delegate'](...ue)['to'](this),this['fire']('replyCreated',_0x438ac6),_0x438ac6;}}class fa extends _0x5167f5{static get['requires'](){return[e,_0x83bc2d,a,m,_0x1cdca3];}static get['pluginName'](){return'AIActions';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['_aiConnector'];['_previousInteractions']=[];['_currentInteractionParams'];['_balloonShowDiff']=!0x1;['_customViews']=new _0x18aaa9();['_promiseQueue'];constructor(_0x403f24){super(_0x403f24),this['_aiConnector']=this['editor']['plugins']['get']('AIConnector'),this['set']('isBusy',!0x1),this['_promiseQueue']=new g(),this['_setupCustomViews']();}['stopInteraction'](){this['_stopInteraction']();}get['previousInteractions'](){return this['_previousInteractions'];}async['executeAction'](_0x4f22c5,_0xbe2ab6,_0x199462){if(this['editor']['plugins']['has']('TableSelection')){if(this['editor']['plugins']['get']('TableSelection')['getSelectedTableCells']()){const {modelFragment:_0x3309c7,anchorData:_0x2ce105}=this['_getExecuteDataInTable']();return this['_executeAction'](_0x4f22c5,_0x3309c7,_0x2ce105,_0xbe2ab6,_0x199462);}}const {modelFragment:_0x32225c,anchorData:_0x2fe44a}=this['_getExecuteDataRegular']();return this['_executeAction'](_0x4f22c5,_0x32225c,_0x2fe44a,_0xbe2ab6,_0x199462);}['_getExecuteDataRegular'](){const _0x48d7b4=this['editor']['model']['document']['selection'];if(_0x48d7b4['isCollapsed']){const _0x24d6d4=_0x4cdc37(_0x48d7b4['getSelectedBlocks']())||this['editor']['model']['schema']['getLimitElement'](_0x48d7b4);this['editor']['model']['change'](_0x27090f=>{_0x27090f['setSelection'](_0x24d6d4,'in');});}const _0x2e9554=_0x48d7b4['getFirstRange'](),_0x5c26af=this['_wrapWithCommonAncestors'](this['editor']['model']['getSelectedContent'](_0x48d7b4),_0x2e9554['start'],_0x2e9554['end']),_0x410055=_0x48d7b4['getFirstRange']()['start'],_0x2a2a88=new Map();let _0x4efc2c=_0x5c26af;for(let _0x24e57b=0x0;_0x24e57b<_0x410055['path']['length'];_0x24e57b++)_0x2a2a88['set'](_0x4efc2c,_0x410055['path'][_0x24e57b]),_0x4efc2c=_0x4efc2c['getChild'](0x0);return{'modelFragment':_0x5c26af,'anchorData':_0x2a2a88};}['_getExecuteDataInTable'](){const _0x55345e=this['editor']['model']['document']['selection'],_0x39b483=this['editor']['plugins']['get']('TableSelection')['getSelectionAsFragment'](),_0x4f6cb9=_0x55345e['getFirstRange']()['start']['parent']['parent'],_0x171cc4=this['_wrapWithCommonAncestors'](_0x39b483,this['editor']['model']['createPositionBefore'](_0x4f6cb9),this['editor']['model']['createPositionAfter'](_0x4f6cb9)),_0x2ba754=_0x55345e['getFirstRange']()['start'],_0x34689a=new Map();let _0x2094bd=_0x171cc4;for(let _0x2343ae=0x0;_0x2343ae<_0x2ba754['path']['length'];_0x2343ae++)if(_0x34689a['set'](_0x2094bd,_0x2ba754['path'][_0x2343ae]),_0x2343ae<_0x2ba754['path']['length']-0x1)_0x2094bd=_0x2094bd['getChild'](0x0);else{let _0x1532e6=_0x2094bd['nextSibling'];for(;_0x1532e6;)_0x34689a['set'](_0x1532e6,_0x2ba754['path'][_0x2343ae]),_0x1532e6=_0x1532e6['nextSibling'];}return{'modelFragment':_0x171cc4,'anchorData':_0x34689a};}['_executeAction'](_0x1a6d61,_0xccf5e6,_0x5a4000,_0x3b3e47,_0x343c03){const _0x32ff32=this['editor']['plugins']['get'](a),_0x463db8=this['editor']['plugins']['get'](m),_0x33e17b=this['editor']['model']['document']['selection'],_0x50239c=_0x32ff32['modelToViewWithIds'](_0xccf5e6),_0x500d08=this['editor']['data']['processor']['toData'](_0x50239c),_0x38124f=this['editor']['model']['document']['version'],_0x4d55ae=[..._0x33e17b['getRanges']()],_0x2154e5=new o(this['editor']['locale'],{'showDiff':!0x1,'areActionsDisabled':!0x1,'hideHeader':!0x0,'showLoader':!0x0,'miniToolbarConfig':{'showChanges':'icon','customView':this['_customViews']},'showUnchangedParts':!0x0});return _0x463db8['open']({'index':0x3e8*Math['random']()%0x3e8,'title':_0x3b3e47,'icon':_0x343c03||_0x51a38c,'mainView':_0x2154e5,'showRotator':!0x1,'showApplyButton':!0x0,'showSuggestButton':!0x0,'ranges':_0x4d55ae}),this['_setLoadingState'](_0x2154e5,_0x463db8),this['listenTo'](_0x463db8,'applySuggestion',()=>{this['_applyChanges'](_0xccf5e6,_0x5a4000,!0x1);}),this['listenTo'](_0x463db8,'insertSuggestion',()=>{this['_applyChanges'](_0xccf5e6,_0x5a4000,!0x0);}),this['listenTo'](_0x463db8,'dialogClosed',()=>{this['_stopInteraction'](),this['_clearInteractionHistory'](),this['stopListening'](_0x463db8);}),this['_createInteraction'](_0x500d08,_0x38124f,_0x2154e5,_0x463db8,_0x1a6d61);}['_wrapWithCommonAncestors'](_0x203888,_0x19efb5,_0x246f98){const _0x134e66=this['editor']['model']['createRange'](_0x19efb5,_0x246f98)['getCommonAncestor'](),_0x2e4aa0=_0x134e66['is']('documentFragment')?[]:_0x134e66['getAncestors']({'includeSelf':!0x0})['slice'](0x1);if(_0x2e4aa0['length']){const _0x53be71=_0x2e4aa0['map'](_0x535076=>_0x535076['_clone'](!0x1));for(let _0x1a5b04=0x1;_0x1a5b04<_0x53be71['length'];_0x1a5b04++)_0x53be71[_0x1a5b04-0x1]['_appendChild'](_0x53be71[_0x1a5b04]);return _0x53be71[_0x53be71['length']-0x1]['_appendChild'](_0x203888),new _0x91360f(_0x53be71[0x0]);}return _0x203888;}async['_createInteraction'](_0xcc39c2,_0x3b9a4d,_0x248a25,_0x2fe549,_0x4f1f32){const _0x386f48=this['editor'];this['_currentInteractionParams']={'action':_0x4f1f32,'content':_0xcc39c2,'version':_0x3b9a4d,'mainView':_0x248a25,'aiBalloon':_0x2fe549},this['_interaction']=new c({'connector':this['_aiConnector'],'editor':_0x386f48,'content':_0xcc39c2,'version':_0x3b9a4d,..._0x4f1f32});const _0x2577eb=(_0x3b74e5,_0x218455,_0xddcf2c=!0x1,_0x5613e4='streaming')=>this['_promiseQueue']['enqueue'](async _0x33ae87=>{try{const _0x4fa36a=p({'editor':_0x386f48,'changeGroups':_0x3b74e5['changeGroups'],'documentContextContent':_0x3b74e5['documentContextContent'],'showDiff':_0xddcf2c,'trimUnchanged':!0x1});await _0x218455['updateContent']({'parts':_0x4fa36a,'renderingStrategy':_0x5613e4,'abortSignal':_0x33ae87});}catch(_0x1766c5){if(this['_isAbortError'](_0x1766c5))return;throw _0x1766c5;}});this['_interaction']['on']('replyCreated',(_0x33fc68,_0x149387)=>{_0x248a25['hideLoader'](),_0x2577eb(_0x149387,_0x248a25)['catch'](_0xae3967=>{this['_isAbortError'](_0xae3967)||console['error']('Error\x20updating\x20content\x20in\x20replyCreated:',_0xae3967);});}),this['_interaction']['on']('replyContentUpdated',(_0x47b060,_0x1fa27b)=>{_0x2577eb(_0x1fa27b,_0x248a25)['catch'](_0x36a207=>{this['_isAbortError'](_0x36a207)||console['error']('Error\x20updating\x20content\x20in\x20replyContentUpdated:',_0x36a207);});}),this['_interaction']['on']('interactionFinished',async()=>{try{await this['_clearLoadingState'](_0x248a25,_0x2fe549);}catch(_0x43ae89){this['_isAbortError'](_0x43ae89)||console['error']('Error\x20clearing\x20loading\x20state\x20in\x20interactionFinished:',_0x43ae89);}}),this['listenTo'](_0x248a25,'toggleSuggestionDisplayMode',(_0x10e224,{showDiff:_0x2a277e})=>{this['_balloonShowDiff']=_0x2a277e;const _0x41a719=this['_interaction']['replies'][this['_interaction']['replies']['length']-0x1];_0x41a719&&_0x2577eb(_0x41a719,_0x248a25,_0x2a277e,'static')['catch'](_0x7759d0=>{this['_isAbortError'](_0x7759d0)||console['error']('Error\x20updating\x20content\x20in\x20toggleSuggestionDisplayMode:',_0x7759d0);});}),this['_setLoadingState'](_0x248a25,_0x2fe549);try{return await this['_interaction']['start']();}catch(_0xcc6f34){if(this['_isAbortError'](_0xcc6f34))return;throw _0xcc6f34;}}['_applyChanges'](_0x1af4eb,_0x6d7b4a,_0x41020e){const _0x325d04=this['editor'],_0x12f0e5=this['editor']['plugins']['get'](_0x1cdca3),_0x537a85=this['_interaction'],_0x809dae=this['_interaction']['replies'][this['_interaction']['replies']['length']-0x1],_0x8ba3ee=_0x809dae['changeGroups'];let _0x59b61a=w({'editor':_0x325d04,'reply':_0x809dae,'interaction':_0x537a85,'groups':_0x8ba3ee,'transform':!0x1,'documentCompare':_0x12f0e5,'documentCompareOptions':{'anchor':_0x325d04['model']['createPositionAt'](_0x1af4eb,0x0),'markDeletions':_0x41020e}});_0x59b61a=this['_filterOperationsOutsideRange'](_0x59b61a,_0x6d7b4a);for(const _0x434bc2 of _0x59b61a)this['_anchorOperation'](_0x6d7b4a,_0x434bc2,_0x325d04['model']['document']['getRoot']());const _0x59d89f=_0x537a85['getDocumentContext']()['version'],_0x28dcd5=_0x325d04['model']['document']['history']['getOperations'](_0x59d89f),_0x591a44={'document':_0x325d04['model']['document'],'useRelations':!0x1,'padWithNoOps':!0x1},_0x42a9b4=_0x59901f(_0x59b61a,_0x28dcd5,_0x591a44)['operationsA'];_0x325d04['model']['change'](_0x5dc1cf=>{if(_0x5dc1cf['setSelection'](_0x325d04['model']['document']['selection']['focus']),_0x41020e)_0x325d04['plugins']['get']('TrackChangesEditing')['_applyOperationsAsSuggestions'](_0x42a9b4);else{for(const _0x20bdfb of _0x42a9b4)_0x20bdfb['baseVersion']=_0x325d04['model']['document']['version'],_0x5dc1cf['batch']['addOperation'](_0x20bdfb),_0x325d04['model']['applyOperation'](_0x20bdfb);}}),this['editor']['plugins']['get']('AIBalloon')['close']();}['_filterOperationsOutsideRange'](_0x26a0a0,_0x199d16){return _0x26a0a0['filter'](_0x14a0cf=>{if('rename'==_0x14a0cf['type']){const _0x53209f=_0x14a0cf['position']['nodeAfter'];return!_0x199d16['has'](_0x53209f);}if(_0x14a0cf['type']['indexOf']('Attribute')>-0x1){const _0x29f2a0=_0x14a0cf['range']['start']['nodeAfter'];return!_0x199d16['has'](_0x29f2a0);}return!0x0;});}['_anchorOperation'](_0x4923b7,_0x3a55fb,_0x1bf5bd){const _0x324bc8=_0x3a55fb['clone']();for(const _0x5ed168 in _0x3a55fb){const _0x275e50=_0x3a55fb[_0x5ed168];_0x275e50 instanceof _0x4f7a9a?_0x3a55fb[_0x5ed168]=new _0x4f7a9a(_0x3ac803(_0x275e50['start']),_0x3ac803(_0x275e50['end'])):_0x275e50 instanceof _0x31d1c1&&(_0x3a55fb[_0x5ed168]=_0x3ac803(_0x275e50));}if(['insert','move','remove','reinsert','split','merge']['includes'](_0x324bc8['type'])){if(_0x324bc8['isDocumentOperation']=!0x1,_0x324bc8['baseVersion']=null,'remove'==_0x324bc8['type']){const _0x51db0a=_0x324bc8['sourcePosition'],_0x406633=_0x324bc8['howMany'];new _0x3d4b6d(_0x51db0a,_0x406633)['_execute']();}else _0x324bc8['_execute']();}function _0x3ac803(_0x3c3d77){if('$graveyard'==_0x3c3d77['root']['rootName'])return _0x3c3d77;const _0xa4b2b1=[];let _0x2a2fb6=_0x3c3d77['root'];for(let _0x28eae3=0x0;_0x28eae3<_0x3c3d77['path']['length'];_0x28eae3++){const _0x1135fc=_0x4923b7['get'](_0x2a2fb6)||0x0;_0xa4b2b1[_0x28eae3]=_0x3c3d77['path'][_0x28eae3]+_0x1135fc,_0x2a2fb6=_0x2a2fb6['getChildAtOffset'](_0x3c3d77['path'][_0x28eae3]);}return new _0x31d1c1(_0x1bf5bd,_0xa4b2b1,_0x3c3d77['stickiness']);}}['_refreshInteraction'](){if(!this['_currentInteractionParams'])return void console['warn']('No\x20current\x20interaction\x20to\x20refresh');this['_interaction']&&(this['_previousInteractions']['push'](this['_interaction']),this['_stopInteraction']());const {action:_0x4eb67c,content:_0x427b29,version:_0x43fb02,mainView:_0x4d78c2,aiBalloon:_0x563240}=this['_currentInteractionParams'];this['_clearSuggestionContent'](_0x4d78c2),_0x4d78c2['showLoader'](),this['_createInteraction'](_0x427b29,_0x43fb02,_0x4d78c2,_0x563240,_0x4eb67c)['catch'](_0x5e5939=>{this['_isAbortError'](_0x5e5939)||console['error']('Error\x20refreshing\x20interaction:',_0x5e5939);});}['_clearSuggestionContent'](_0x1580ca){const _0x45348c=_0x1580ca['bodyView']['_children'];for(;_0x45348c['length']>0x0;)_0x45348c['remove'](_0x45348c['first']);_0x1580ca['bodyView']['hasPendingParts']=!0x1;}['_isAbortError'](_0x199366){return!!_0x199366['message']&&_0x199366['message']['startsWith']('ai-request-aborted');}['_clearInteractionHistory'](){this['_previousInteractions']=[],this['_currentInteractionParams']=void 0x0;}['_stopInteraction'](){this['_interaction']&&this['_interaction']['stop'](),this['_promiseQueue']['abort'](),this['isBusy']=!0x1;}['_setupCustomViews'](){const _0x37751e=new _0xa24b3c(this['editor']['locale']);_0x37751e['set']({'icon':_0x167f4a,'label':Yn(this['editor']['locale'],'AI_ACTIONS_TRY_AGAIN'),'tooltip':!0x0,'class':'ck-ai-custom-action-button'}),_0x37751e['bind']('isEnabled')['to'](this,'isBusy',_0x18b3af=>!_0x18b3af),_0x37751e['on']('execute',()=>{this['_refreshInteraction']();}),this['_customViews']['add'](_0x37751e);}['_setLoadingState'](_0x2731f0,_0x41b12c){_0x2731f0['setLoading'](),_0x41b12c['balloonView']['setLoading'](),this['isBusy']=!0x0;}async['_clearLoadingState'](_0x5ed432,_0x421fba){await this['_promiseQueue']['queueEmptyPromise'],this['isBusy']=!0x1,_0x5ed432['clearLoading'](),_0x421fba['balloonView']['clearLoading']();}}class vs{['id'];['title'];['description'];['isParameterized'];['useArgs'];['options'];constructor({id:_0x29b1ab,title:_0x1b291f,description:_0x9f49b,isParameterized:_0x13be29,useArgs:_0x4f8013,options:_0x4ebb49}){this['id']=_0x29b1ab,this['title']=_0x1b291f,this['description']=_0x9f49b,this['isParameterized']=_0x13be29,this['useArgs']=_0x4f8013,this['options']=_0x4ebb49;}}class kr extends vs{['_models']=[];get['models'](){return this['_models'];}set['models'](_0xd3df43){this['_models']=_0xd3df43;}}class si extends _0x536028(){['_checks'];constructor(_0x416d88){super(),this['_checks']=this['_mapCheckDefinitions'](_0x416d88);}get['checks'](){return this['_checks'];}['getCheckById'](_0x5d3218){return this['checks']['find'](_0x30442b=>_0x30442b['id']===_0x5d3218);}['_mapCheckDefinitions'](_0x45179f){return _0x45179f['map'](_0x49b67a=>'custom'===_0x49b67a['id']?new kr(_0x49b67a):new vs(_0x49b67a));}}class Cs extends _0x5a5836(){['id'];['contentNew'];['contentInitial'];['documentVersion'];constructor({id:_0xe38838,contentNew:_0x58fa4b,contentInitial:_0x5869af,documentVersion:_0xa0a68e}){super(),this['id']=_0xe38838,this['contentNew']=_0x58fa4b,this['contentInitial']=_0x5869af,this['documentVersion']=_0xa0a68e;}}class Rs extends _0x536028(){['id'];['parent'];['_data'];['_editorOperations']=[];constructor(_0x3f2953,_0x47c461,_0x46fc77){super(),this['id']=_0x3f2953,this['parent']=_0x46fc77,this['_data']=_0x47c461,this['set']('isActivated',!0x1),this['set']('status','active');}get['contentDiffed'](){return this['_data']['context']();}get['operations'](){return this['_data']['operations'];}get['operationsIsolated'](){return this['_data']['operationsIsolated'];}}class pr extends _0x536028(){['id']=_0x48375a();['_results']=new Map();['_changes']=[];['_documentData'];['_sourceCheck'];['_aiConnector'];['_reviewParams'];['_reviewArgs'];['_activeRequest']=null;['_currentError'];constructor(_0x4df1b8,_0xf90043,_0x493dbd,_0x596076,_0x1938b4){super(),this['_documentData']=_0x4df1b8,this['_sourceCheck']=_0xf90043,this['_aiConnector']=_0x493dbd,this['_reviewParams']=_0x596076,this['_reviewArgs']=_0x1938b4,this['on']('change:status',(_0x3416f7,_0xf57d2b,_0x2dc98e)=>{this['fire']('reviewCheckRunUpdated',{'status':_0x2dc98e,'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'];}async['start'](){this['status']='loading',this['_currentError']=void 0x0;try{this['_activeRequest']=this['_createApiRequest']();const _0x538153=await this['_activeRequest']['getStream']();this['status']='data';for await(const _0x476bd3 of _0x538153)'unmodified'!==_0x476bd3['data']['operation']&&('error'!==_0x476bd3['data']['operation']?this['_addReviewCheckResult'](_0x476bd3['data']['dataId'],_0x476bd3['data']['textDelta']):this['status']='error-chunk');'error-chunk'!==this['status']&&(0x0===this['_results']['size']?this['status']='unmodified':this['status']='ready');}catch(_0x33a088){this['_currentError']=_0x33a088,_0x33a088 instanceof Error&&_0x33a088['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'](_0x344518,_0x232181){const _0x5208a2=this['_results']['get'](_0x344518);if(!_0x5208a2)return;const _0x3c726f=[];_0x232181['forEach']((_0x27b6d8,_0x414f94)=>{const _0x4e6591=new Rs(_0x5208a2['id']+'-'+_0x414f94,_0x27b6d8,_0x5208a2);_0x4e6591['on']('change:status',()=>{'accepted'===_0x4e6591['status']?this['fire']('reviewCheckResultAccepted',{'change':_0x4e6591}):'rejected'===_0x4e6591['status']&&this['fire']('reviewCheckResultRejected',{'change':_0x4e6591});}),_0x4e6591['on']('change:isActivated',()=>{_0x4e6591['isActivated']?this['fire']('reviewCheckResultActivated',{'change':_0x4e6591}):this['fire']('reviewCheckResultDeactivated',{'change':_0x4e6591});}),this['_changes']['push'](_0x4e6591),_0x3c726f['push'](_0x4e6591);}),this['fire']('reviewCheckResultReady',{'changes':_0x3c726f,'result':_0x5208a2,'source':this});}['abort'](){this['_activeRequest']&&(this['_activeRequest']['abortController']['abort'](),this['_activeRequest']=null,this['status']='aborted');}['isChangeActive'](_0x20bcfc){const _0x2a5400=this['_changes']['find'](_0x298059=>_0x298059['id']===_0x20bcfc);return!(!_0x2a5400||'active'!==_0x2a5400['status']);}['getActiveChanges'](){return this['_changes']['filter'](_0x566d62=>'active'===_0x566d62['status']);}['markAllChangesAsAccepted'](){for(const _0x5e3e7c of this['_changes'])'active'===_0x5e3e7c['status']&&(_0x5e3e7c['status']='accepted');this['_checkIfFinished']();}['markChangeAsAccepted'](_0xb789e9){const _0x2ee00e=this['_changes']['find'](_0xfa6bb6=>_0xfa6bb6['id']===_0xb789e9);_0x2ee00e&&'active'===_0x2ee00e['status']&&(_0x2ee00e['status']='accepted'),this['_checkIfFinished']();}['markChangeAsRejected'](_0x2949aa){const _0x50eac7=this['_changes']['find'](_0x121477=>_0x121477['id']===_0x2949aa);_0x50eac7&&'active'===_0x50eac7['status']&&(_0x50eac7['status']='rejected'),this['_checkIfFinished']();}['activateChange'](_0x39defd){this['_changes']['filter'](_0x5daffb=>_0x5daffb['isActivated']&&_0x5daffb['id']!==_0x39defd)['forEach'](_0x1a1bd2=>{_0x1a1bd2['isActivated']=!0x1;});const _0x1e6ca4=this['_changes']['find'](_0x50492f=>_0x50492f['id']===_0x39defd);_0x1e6ca4&&(_0x1e6ca4['isActivated']=!0x0);}['deactivateChange'](){this['_changes']['filter'](_0x18a127=>_0x18a127['isActivated'])['forEach'](_0x56d367=>{_0x56d367['isActivated']=!0x1;});}['forceReadyState'](){this['status']='ready';}['_addReviewCheckResult'](_0x4f57d5,_0x171525){const _0x3889e3=this['_documentData']['elements']['get'](_0x4f57d5);if(!_0x3889e3)return;const _0x390a0c=_0x3889e3['getContent']();if(_0x390a0c===_0x171525)return;const _0x5f3828=new Cs({'id':_0x4f57d5,'contentInitial':_0x390a0c,'contentNew':_0x171525,'documentVersion':this['_documentData']['version']});this['_results']['set'](_0x5f3828['id'],_0x5f3828),this['fire']('reviewCheckResultAdded',{'result':_0x5f3828,'source':this});}['_checkIfFinished'](){if('ready'!==this['status'])return;0x0===this['_changes']['filter'](_0x5232f5=>'active'===_0x5232f5['status'])['length']&&(this['status']='finished');}['_createApiRequest'](){throw new Error('Not\x20implemented.');}}class hi extends pr{get['title'](){if(!this['_reviewParams']||0x0===this['_reviewParams']['length']||this['_sourceCheck']['useArgs'])return this['_sourceCheck']['title'];const _0x4e13c4=[];if(this['_reviewParams']['length']>0x0&&this['_sourceCheck']['options'])for(let _0x17c399=0x0;_0x17c399<this['_reviewParams']['length'];_0x17c399++){if(!this['_reviewParams'][_0x17c399]||!this['_sourceCheck']['options'][_0x17c399])continue;const _0x349892=this['_sourceCheck']['options'][_0x17c399],_0x1ced38=_0x349892['data']?.['find'](_0x13cc76=>_0x13cc76['id']===this['_reviewParams'][_0x17c399]);_0x1ced38&&_0x4e13c4['push'](_0x1ced38['label']);}return this['_sourceCheck']['title']+':\x20'+_0x4e13c4['join'](',\x20');}['_createApiRequest'](){return this['_aiConnector']['callSystemReview']({'reviewName':this['_composeReviewName'](),'content':this['_documentData']['content'],'args':this['_reviewArgs']});}['_composeReviewName'](){return!this['_reviewParams']||0x0===this['_reviewParams']['length']||this['_sourceCheck']['useArgs']?this['_sourceCheck']['id']:[this['_sourceCheck']['id'],...this['_reviewParams']]['join']('-');}}class ri extends pr{['_prompt'];['_model'];constructor(_0x3f37a3,_0x5aa0fc,_0x3fa106,_0x29ff08,_0x1b58fb){super(_0x3fa106,_0x29ff08,_0x1b58fb),this['_prompt']=_0x3f37a3,this['_model']=_0x5aa0fc;}get['title'](){return this['_prompt'];}['_createApiRequest'](){return this['_aiConnector']['callCustomReview']({'content':this['_documentData']['content'],'prompt':this['_prompt'],'model':this['_model']});}}class oi extends _0x5a5836(){['_modelList']=[];['_connector'];constructor({connector:_0x2f99f9}){super(),this['_connector']=_0x2f99f9;}async['getAll'](){if(!this['_modelList']['length'])try{const _0x56f807=this['_connector']['getModels'](),_0x90904d=await _0x56f807['list']();this['_modelList']=_0x90904d['items'];}catch{}return this['_modelList'];}}const ni=[{'id':'custom','title':'Custom\x20command','description':'Type\x20a\x20custom\x20command\x20to\x20review\x20the\x20content\x20exactly\x20as\x20you\x20need.','isParameterized':!0x0},{'id':'correctness','title':'Correctness','description':'Ensure\x20the\x20text\x20is\x20factually\x20accurate\x20and\x20free\x20of\x20errors.','isParameterized':!0x1},{'id':'clarity','title':'Clarity','description':'Improve\x20the\x20clarity\x20and\x20readability\x20of\x20the\x20text.','isParameterized':!0x1},{'id':'readability','title':'Readability','description':'Enhance\x20the\x20overall\x20readability\x20of\x20the\x20text.','isParameterized':!0x1},{'id':'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':'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'}]}]},{'id':'translate','title':'Translate','description':'Translate\x20the\x20text\x20into\x20another\x20language.','isParameterized':!0x0,'useArgs':!0x0,'options':[{'formType':'dropdown','label':'Select\x20language','argsKey':'language','data':[{'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'}]}]}];class ee extends _0x3cc6c1{['_aiConnector'];['_aiReviewModeUi'];['_aiReviewModeEditing'];['_aiReviewCheckList'];['_currentReviewCheckRun'];['_isDiffOn']=!0x1;['_changeActivationSource']=null;static get['requires'](){return[e];}static get['pluginName'](){return'AIReviewModeController';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}async['init'](){this['_aiConnector']=this['context']['plugins']['get']('AIConnector'),this['_aiReviewModeUi']=this['context']['plugins']['get']('AIReviewModeUI'),this['_aiReviewModeEditing']=this['context']['plugins']['get']('AIReviewModeEditing');const _0x322146=this['context']['config']['get']('ai.reviewMode.translations');if(_0x322146){for(const _0xb36c4a of ni)'translate'===_0xb36c4a['id']&&(_0xb36c4a['options'][0x0]['data']=_0x322146);}const _0x5387cc=this['_translateReviewChecks'](ni);this['_aiReviewCheckList']=new si(_0x5387cc);const _0x1dc17c=this['_aiReviewCheckList']['checks']['find'](_0x3603dc=>'custom'===_0x3603dc['id']);if(_0x1dc17c){const _0x4867bb=await new oi({'connector':this['_aiConnector']})['getAll']();_0x1dc17c['models']=_0x4867bb['map'](_0x351178=>({..._0x351178,'description':this['_getTranslationWithDefault']('AI_MODEL_DESCRIPTION_'+_0x351178['id']['toUpperCase'](),_0x351178['description'])}));}this['listenTo'](this['_aiReviewModeUi'],'getReviewCheckList',()=>{this['_aiReviewModeUi']['setAvailableChecks'](this['_aiReviewCheckList']['checks']);}),this['listenTo'](this['_aiReviewModeUi'],'runReviewCheck',async(_0x250fbe,_0x5eddea)=>{const _0x4e76a6=this['_aiReviewCheckList']['getCheckById'](_0x5eddea['id']);if(_0x4e76a6){this['_onDiffChange'](this['_isDiffOn']),_0x5eddea['isCustom']?this['_currentReviewCheckRun']=new ri(_0x5eddea['args']['prompt'],_0x5eddea['args']['model'],this['_aiReviewModeEditing']['getDocumentData'](),_0x4e76a6,this['_aiConnector']):this['_currentReviewCheckRun']=new hi(this['_aiReviewModeEditing']['getDocumentData'](),_0x4e76a6,this['_aiConnector'],_0x5eddea['params'],_0x5eddea['args']),this['_aiReviewModeUi']['setCheckResultTitle'](this['_currentReviewCheckRun']['title']),this['_currentReviewCheckRun']['on']('reviewCheckRunUpdated',(_0x2a215f,_0x5760d3)=>{'data'===_0x5760d3['status']||'loading'===_0x5760d3['status']?(this['_aiReviewModeEditing']['switchToReadOnly'](),this['_aiReviewModeUi']['showCheckRunResults'](_0x5760d3)):'finished'===_0x5760d3['status']?this['_aiReviewModeUi']['showReviewCompletedView']():'ready'===_0x5760d3['status']?this['_aiReviewModeUi']['showActionsWhenResultIsReady']():'unmodified'===_0x5760d3['status']?this['_aiReviewModeUi']['showNoChangesView']():'error-general'===_0x5760d3['status']?this['_aiReviewModeUi']['showGeneralErrorView']():'error-chunk'===_0x5760d3['status']?this['_aiReviewModeUi']['showChunkErrorView']():'aborted'===_0x5760d3['status']&&(this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['processedResultsCount']>0x0?setTimeout(()=>{this['_currentReviewCheckRun']?.['forceReadyState']();},0x0):this['_onReviewModeRunLeave'](!0x0));}),this['_currentReviewCheckRun']['on']('reviewCheckResultAdded',(_0x376c97,_0x19020b)=>{if(!this['_currentReviewCheckRun'])throw new _0xa14e6e('aireviewmode-no-current-check-run',this);const _0x5088b4=this['_aiReviewModeEditing']['diffContent'](_0x19020b['result']['contentInitial'],_0x19020b['result']['contentNew']);_0x19020b['source']['addResultChanges'](_0x19020b['result']['id'],_0x5088b4);}),this['_currentReviewCheckRun']['on']('reviewCheckResultReady',(_0x547f2e,_0x122237)=>{for(const _0x1767bd of _0x122237['changes'])this['_aiReviewModeUi']['showCheckRunResult'](_0x1767bd);this['_aiReviewModeEditing']['markChangePositionInEditorContent'](_0x122237['changes'],_0x122237['source']['documentData']);}),this['_currentReviewCheckRun']['on']('reviewCheckResultAccepted',(_0x54e6de,_0x31f080)=>{this['_aiReviewModeUi']['updateChangeState'](_0x31f080['change']['id'],'accepted');}),this['_currentReviewCheckRun']['on']('reviewCheckResultRejected',(_0xb7ce8a,_0x92b04c)=>{this['_aiReviewModeUi']['updateChangeState'](_0x92b04c['change']['id'],'rejected');}),this['_currentReviewCheckRun']['on']('reviewCheckResultActivated',(_0x9dd13c,_0x577b60)=>{this['_aiReviewModeUi']['setActiveStateInResults'](_0x577b60['change']['id']);const _0xd55c71=this['_aiReviewModeEditing']['getMarkerElementForChange'](_0x577b60['change']['id']);if(_0xd55c71){if('content'===this['_changeActivationSource']){const _0x3d7642=this['_aiReviewModeUi']['getChangeElement'](_0x577b60['change']['id']);_0x3d7642&&_0x2c6f03(_0x3d7642['closest']('.ck-ai-review-mode__check-run-result')||_0x3d7642);}else{if('panel'===this['_changeActivationSource']){const _0x1e22d5={'target':_0xd55c71['domElement'],'viewportOffset':{'top':0x55,'left':0x0,'bottom':0x0,'right':0x0},'ancestorOffset':0x14,'alignToTop':!0x0};rt(_0x1e22d5);}}this['_aiReviewModeUi']['showChangeBalloon'](_0x577b60['change'],_0xd55c71['domElement']);}}),this['_currentReviewCheckRun']['on']('reviewCheckResultDeactivated',()=>{this['_aiReviewModeUi']['resetActiveStateInResults']();});try{await this['_currentReviewCheckRun']['start']();}catch(_0x1a74cf){_0x1a74cf instanceof Error&&_0x1a74cf['message']['includes']('ai-request-aborted')||(_0x1a74cf instanceof _0xa14e6e?this['_logError'](_0x1a74cf):this['_logError'](new _0xa14e6e('aireviewmode-check-run-failed',this,{'error':_0x1a74cf})));}}else this['_logError'](new _0xa14e6e('aireviewmode-source-check-not-found',this,{'checkId':_0x5eddea['id']}));}),this['listenTo'](this['_aiReviewModeUi'],'leaveReviewMode',()=>{this['_onReviewModeRunLeave']();}),this['listenTo'](this['_aiReviewModeUi'],'leaveReviewModeResultList',()=>{this['_onReviewModeRunLeave'](!0x0);}),this['listenTo'](this['_aiReviewModeUi'],'abortReviewStream',()=>{this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['abort']();}),this['listenTo'](this['_aiReviewModeUi'],'finishReview',()=>{this['_onReviewModeRunLeave'](!0x0);}),this['listenTo'](this['_aiReviewModeUi'],'acceptAllChanges',()=>{if(!this['_currentReviewCheckRun'])return;const _0x9ea327=this['_currentReviewCheckRun']['getActiveChanges']();_0x9ea327['length']&&(this['_aiReviewModeEditing']['applyChange'](_0x9ea327['map'](_0x55f96c=>_0x55f96c['id'])),this['_currentReviewCheckRun']['markAllChangesAsAccepted']());}),this['listenTo'](this['_aiReviewModeUi'],'acceptChange',(_0x312e7d,_0x4c868d)=>{this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['isChangeActive'](_0x4c868d['id'])&&(this['_aiReviewModeEditing']['applyChange']([_0x4c868d['id']]),this['_currentReviewCheckRun']['markChangeAsAccepted'](_0x4c868d['id']),this['_aiReviewModeUi']['hideChangeBalloon']());}),this['listenTo'](this['_aiReviewModeUi'],'dismissChange',(_0x1827e0,_0x48268a)=>{this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['isChangeActive'](_0x48268a['id'])&&(this['_aiReviewModeEditing']['rejectChange'](_0x48268a['id']),this['_currentReviewCheckRun']['markChangeAsRejected'](_0x48268a['id']),this['_aiReviewModeUi']['hideChangeBalloon']());}),this['listenTo'](this['_aiReviewModeUi'],'toggleDiff',(_0x3a4670,_0x41c8e9)=>{this['_isDiffOn']=_0x41c8e9['on'],this['_onDiffChange'](this['_isDiffOn']);}),this['listenTo'](this['_aiReviewModeUi'],'retryReview',async()=>{this['_currentReviewCheckRun']&&await this['_currentReviewCheckRun']['restart']();}),this['listenTo'](this['_aiReviewModeUi'],'activateChange',(_0x3d33a1,_0x1730c5)=>{this['_currentReviewCheckRun']&&(this['_changeActivationSource']='panel',this['_currentReviewCheckRun']['activateChange'](_0x1730c5['id']));}),this['listenTo'](this['_aiReviewModeUi'],'deactivateChange',()=>{this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['deactivateChange']();}),this['listenTo'](this['_aiReviewModeEditing']['emitter'],'changeMarkerClick',(_0x2d7e08,_0x41541a)=>{this['_currentReviewCheckRun']&&(this['_changeActivationSource']='content',this['_currentReviewCheckRun']['activateChange'](_0x41541a['changeId']));});}['_onReviewModeRunLeave'](_0x43348b=!0x1){this['_currentReviewCheckRun']&&(this['_currentReviewCheckRun']['abort'](),this['_currentReviewCheckRun']['stopListening'](),this['_currentReviewCheckRun']=void 0x0),_0x43348b&&this['_aiReviewModeUi']['showReviewCheckList'](),this['_aiReviewModeEditing']['clearAllMarkers'](),this['_aiReviewModeEditing']['switchToEdit'](),this['_changeActivationSource']=null;const _0x1c27d8=this['_aiReviewModeEditing']['getContentElement']();_0x1c27d8&&(_0x1c27d8['classList']['remove']('ck-ai-review-mode-diff'),_0x1c27d8['classList']['remove']('ck-ai-review-mode-highlights'));}['_onDiffChange'](_0x255ab1){const _0x236118=this['_aiReviewModeEditing']['getContentElement']();_0x236118&&(_0x236118['classList']['remove']('ck-ai-review-mode-diff'),_0x236118['classList']['remove']('ck-ai-review-mode-highlights'),_0x236118['classList']['add'](_0x255ab1?'ck-ai-review-mode-diff':'ck-ai-review-mode-highlights'));}['_translateReviewChecks'](_0x3c8b0c){return _0x3c8b0c['map'](_0xf08466=>{const _0x821f16='AI_REVIEW_CHECK_'+_0xf08466['id']['toUpperCase']()['replaceAll']('-','_'),_0x430a10={..._0xf08466,'title':this['_getTranslationWithDefault'](_0x821f16+'_TITLE',_0xf08466['title']),'description':this['_getTranslationWithDefault'](_0x821f16+'_DESCRIPTION',_0xf08466['description'])};return _0xf08466['options']&&(_0x430a10['options']=_0xf08466['options']['map'](_0x5c9e80=>({..._0x5c9e80,'label':this['_getTranslationWithDefault'](_0x821f16+'_OPTIONS_LABEL',_0x5c9e80['label']||''),'data':_0x5c9e80['data']?_0x5c9e80['data']['map'](_0x39b411=>({..._0x39b411,'label':this['_getTranslationWithDefault'](_0x821f16+'_OPTIONS_DATA_'+_0x39b411['id']['toUpperCase'](),_0x39b411['label'])})):void 0x0}))),_0x430a10;});}['_getTranslationWithDefault'](_0x371f35,_0x35d227){const _0x2f4d65=Yn(this['context']['locale'],_0x371f35);return _0x2f4d65===_0x371f35?_0x35d227:_0x2f4d65;}['_logError'](_0x44cfa2){nt(_0x44cfa2['message']),this['_aiReviewModeUi']['showGeneralErrorView']();}}class Mr extends _0xebef92{['_dropdownView'];['_defaultValue'];['_defaultLabel'];constructor(_0x47bc34,_0x492708){super(_0x47bc34),this['_defaultValue']=_0x492708['default']||(_0x492708['data']['length']>0x0?_0x492708['data'][0x0]['id']:''),this['_defaultLabel']=_0x492708['data']['find'](_0x5cd78d=>_0x5cd78d['id']===this['_defaultValue'])?.['label']||'',this['set']('formValue',''),this['_dropdownView']=_0x115dce(this['locale']);const _0xfeaf89=this['_prepareListOptions'](_0x492708['data']);_0xc359d8(this['_dropdownView'],_0xfeaf89,{'role':'menu','ariaLabel':_0x492708['label']}),this['_dropdownView']['buttonView']['set']({'label':this['_defaultLabel'],'withText':!0x0}),this['_dropdownView']['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x26878f=>{_0x26878f['stopPropagation']();})}}),this['listenTo'](this['_dropdownView'],'execute',_0x4b8bc6=>{this['formValue']=_0x4b8bc6['source']['model']['id'],this['_dropdownView']['buttonView']['label']=_0x4b8bc6['source']['model']['label'];}),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset_all','ck-ai-review-mode__check-list-item-parameterized-form-element','ck-ai-review-mode__check-list-item-parameterized-form-element_dropdown']},'children':[this['_dropdownView']]});}['resetToDefault'](){this['formValue']=this['_defaultValue'],this['_dropdownView']['buttonView']['label']=this['_defaultLabel'];}['_prepareListOptions'](_0x4ea9c2=[]){const _0x577576=new _0x6ba718();this['resetToDefault']();for(const _0x32f5e3 of _0x4ea9c2){const _0x30c12c=new _0x26f53f({'label':_0x32f5e3['label'],'withText':!0x0,'role':'menuitemradio','id':_0x32f5e3['id'],'model':_0x32f5e3});_0x30c12c['bind']('isOn')['to'](this,'formValue',_0x3233f7=>_0x3233f7===_0x30c12c['id']);const _0x581700={'type':'button','model':_0x30c12c};_0x577576['add'](_0x581700);}return _0x577576;}}class Fs extends _0x22bc08{['_formItem']=null;constructor(_0x48364d,_0x1c5456,_0x3948f7){super(_0x48364d),this['argsKey']=_0x1c5456?.['argsKey'];if('dropdown'===_0x1c5456['formType'])this['_formItem']=new Mr(this['locale'],_0x1c5456);this['set']('value',''),this['bind']('value')['to'](this['_formItem'],'formValue');const _0xc6619=new _0x4cab66(this['locale'],{'children':[this['_formItem']],'class':[_0x3948f7?'ck-form__row_with-submit':'']});_0x3948f7&&_0xc6619['children']['add'](_0x3948f7),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-review-mode__form-item','ck-reset_all']},'children':[_0xc6619]});}['resetToDefault'](){this['_formItem']['resetToDefault']();}}class js extends _0x5454a2{static ['MIN_ROWS']=0x1;static ['MAX_ROWS']=0xc;constructor(_0x53f3a8){super(_0x53f3a8),this['set']('isEmpty',!0x0),this['minRows']=js['MIN_ROWS'],this['maxRows']=js['MAX_ROWS'],this['extendTemplate']({'attributes':{'id':'ai-review-mode-prompt-input','class':['ck','ck-review-mode__prompt-input']}}),this['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x18a746=>{_0x18a746['stopPropagation']();})}});}['render'](){super['render'](),this['on']('update',()=>{this['isEmpty']=''===this['element']['value']?.['trim']();});}['setPlaceholderText'](_0x57b60b){this['set']('placeholder',_0x57b60b);}}class Gs extends _0xebef92{['submitButtonView'];['cancelButtonView'];['promptInputView'];['_modelSelectionDropdown'];['_modelSelectionDropdownItems'];['_check'];['_defaultValue'];['_defaultLabel'];constructor(_0x511d4f,_0x6beb16){super(_0x511d4f),this['_check']=_0x6beb16,this['set']('prompt',''),this['set']('modelId',''),this['_defaultValue']=_0x6beb16['models']&&_0x6beb16['models']['length']>0x0?_0x6beb16['models'][0x0]['id']:'',this['_defaultLabel']=_0x6beb16['models']&&_0x6beb16['models']['length']>0x0?_0x6beb16['models'][0x0]['name']:'',this['submitButtonView']=this['_createSubmitButtonView'](),this['cancelButtonView']=this['_createCancelButtonView'](),this['promptInputView']=new js(_0x511d4f),this['promptInputView']['bind']('value')['to'](this,'prompt'),this['promptInputView']['on']('input',()=>{this['prompt']=this['promptInputView']['element']['value'];}),this['_modelSelectionDropdown']=this['_createModelSelectionDropdown'](),this['_modelSelectionDropdownItems']=new _0x6ba718(),this['_setModelList'](),_0xc359d8(this['_modelSelectionDropdown'],this['_modelSelectionDropdownItems']);const _0x1388c5=new _0xebef92(_0x511d4f);_0x1388c5['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-review-mode__check-list-item-custom-actions-footer']},'children':[this['_modelSelectionDropdown'],{'tag':'div','attributes':{'class':['ck-ai-review-mode__check-list-item-parameterized-custom-actions-buttons']},'children':[this['cancelButtonView'],this['submitButtonView']]}]}),this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-review-mode__check-list-item-custom-actions']},'children':[new _0x4cab66(this['locale'],{'children':[this['promptInputView']]}),new _0x4cab66(this['locale'],{'children':[_0x1388c5]})]});}['resetToDefault'](){this['prompt']='',this['modelId']=this['_defaultValue'],this['_modelSelectionDropdown']['buttonView']['label']=this['_defaultLabel'];}['_createSubmitButtonView'](){const _0xe05f25=new _0xa24b3c(this['locale']),t=this['locale']['t'];return _0xe05f25['set']({'label':t('Submit'),'withText':!0x0,'class':'ck-ai-button-primary'}),_0xe05f25['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x6108e3=>{_0x6108e3['stopPropagation']();})}}),_0xe05f25['on']('execute',()=>{this['fire']('runReviewCheck',{'id':'custom','args':{'prompt':this['prompt'],'model':this['modelId']},'isCustom':!0x0});}),_0xe05f25;}['_createCancelButtonView'](){const _0x102628=new _0xa24b3c(this['locale']),t=this['locale']['t'];return _0x102628['set']({'label':t('Cancel'),'withText':!0x0,'class':'ck-ai-button-tertiary-filled'}),_0x102628['on']('execute',()=>{this['resetToDefault']();}),_0x102628;}['_setModelList'](){this['_modelSelectionDropdownItems']['clear']();const _0x241b2a=this['_check']['models'];if(this['resetToDefault'](),_0x241b2a?.['length'])for(const _0x38e0a0 of _0x241b2a){const _0xafa878=new _0x26f53f({'label':_0x38e0a0['name'],'withText':!0x0,'role':'menuitemradio','id':_0x38e0a0['id'],'model':_0x38e0a0});_0xafa878['bind']('isOn')['to'](this,'modelId',_0x5c7078=>_0x5c7078===_0x38e0a0['id']),this['_modelSelectionDropdownItems']['add']({'type':'button','model':_0xafa878,'labelView':new Ms(this['locale'],_0x38e0a0)});}}['_createModelSelectionDropdown'](){const _0x38291d=_0x115dce(this['locale']);return _0x38291d['set']({'panelPosition':'se','class':'ck-ai-review-mode__check-list-item-model-dropdown'}),_0x38291d['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x4449f0=>{_0x4449f0['stopPropagation']();})}}),_0x38291d['buttonView']['set']({'label':this['_defaultLabel'],'withText':!0x0,'tooltip':!0x0}),this['listenTo'](_0x38291d,'execute',_0x3dd820=>{this['modelId']=_0x3dd820['source']['model']['id'],_0x38291d['buttonView']['label']=_0x3dd820['source']['label'];}),_0x38291d;}}class Ms extends _0x5babd6{constructor(_0x1e6d4b,_0x2d9075){super();const _0x4523a6=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-button__label'],'style':_0x4523a6['to']('style'),'id':_0x4523a6['to']('id')},'children':[{'tag':'div','attributes':{'class':['ck-ai-review-mode__check-list-item-model-dropdown-name']},'children':[{'text':_0x4523a6['to']('text')}]},{'tag':'div','attributes':{'class':['ck-ai-review-mode__check-list-item-model-dropdown-description']},'children':[{'tag':'span','children':[{'text':_0x2d9075['description']}]}]}]});}}class zs extends _0x22bc08{['_formItemsCollection']=new _0x18aaa9();['_customCheckView']=null;constructor(_0x24a728,_0x1c6b7e,_0x394fd7){super(_0x24a728),this['set']('isParametrizedViewOpen',!0x1),this['set']('isListItemRendered',!0x1),this['set']('isItemParametrized',_0x1c6b7e['isParameterized']);const _0x57e901=this['_createIconView']();this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-review-mode__check-list-item',this['bindTemplate']['if']('isParametrizedViewOpen','ck-ai-review-mode__check-list-item_selected',_0x5c98c7=>_0x5c98c7),this['bindTemplate']['if']('isListItemRendered','ck-ai-review-mode__check-list-item_rendered',_0x111016=>_0x111016)],'style':{'--ck-ai-check-list-item-index':_0x394fd7}},'on':{'click':this['bindTemplate']['to']('click')},'children':[{'tag':'div','attributes':{'class':['ck-ai-review-mode__check-list-item-content']},'children':[{'tag':'div','attributes':{'class':['ck-ai-review-mode__check-list-item-main-content']},'children':[{'tag':'div','attributes':{'class':['ck-ai-review-mode__check-list-item-title']},'children':[{'tag':'span','attributes':{'class':['ck-ai-review-mode__check-list-item-title-text']},'children':[{'text':_0x1c6b7e['title']}]},_0x57e901]},{'tag':'div','attributes':{'class':['ck-ai-review-mode__check-list-item-description']},'children':[{'text':_0x1c6b7e['description']}]}]}]},..._0x1c6b7e['isParameterized']?[this['_createParameterizedView'](_0x1c6b7e)]:[],...'custom'===_0x1c6b7e['id']?[this['_createCustomView'](_0x1c6b7e)]:[]]}),this['on']('click',()=>{_0x1c6b7e['isParameterized']?this['isParametrizedViewOpen']=!0x0:this['fire']('runReviewCheck',{'id':_0x1c6b7e['id']});}),requestAnimationFrame(()=>{this['isListItemRendered']=!0x0;});}['render'](){super['render'](),this['isItemParametrized']&&_0x16cb96({'emitter':this,'activator':()=>!0x0===this['isParametrizedViewOpen'],'contextElements':[this['element']],'callback':()=>{this['isParametrizedViewOpen']=!0x1;}});}['resetToDefault'](){this['isParametrizedViewOpen']=!0x1,this['_formItemsCollection']['forEach'](_0x40466e=>{_0x40466e['resetToDefault']();}),this['_customCheckView']&&this['_customCheckView']['resetToDefault']();}['_createIconView'](){const _0x32f0d8=new _0x23cd9a();return _0x32f0d8['content']=_0x59adba,_0x32f0d8['extendTemplate']({'attributes':{'class':['ck-ai-review-mode__check-list-item-title-icon']}}),_0x32f0d8;}['_createParameterizedView'](_0x7baeb){const _0x1370e0=new _0xebef92(),_0x4d6da8=this['_createFormView'](_0x7baeb);return _0x1370e0['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-review-mode__check-list-item-parameterized',this['bindTemplate']['if']('isParametrizedViewOpen','ck-hidden',_0x27c9d9=>!_0x27c9d9)]},'children':[_0x4d6da8]}),_0x1370e0;}['_createFormView'](_0x501fb9){const _0x251165=new _0xebef92(),_0x1ca0de=Array['isArray'](_0x501fb9['options'])?_0x501fb9['options']:[],_0x2ae3f3=new _0xa24b3c(this['locale']),t=this['locale']['t'];_0x2ae3f3['set']({'label':t('Submit'),'withText':!0x0,'class':'ck-ai-button-primary'}),_0x2ae3f3['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x33289a=>{_0x33289a['stopPropagation']();})}}),_0x2ae3f3['on']('execute',()=>{const _0x538545=[],_0x16f5ee={};this['_formItemsCollection']['forEach'](_0x3f4bfd=>{_0x538545['push'](_0x3f4bfd['value']),_0x501fb9['useArgs']&&_0x501fb9['options']&&(_0x16f5ee[_0x3f4bfd['argsKey']]=_0x3f4bfd['value']);}),this['fire']('runReviewCheck',{'id':_0x501fb9['id'],'params':_0x538545['length']?_0x538545:void 0x0,'args':Object['keys'](_0x16f5ee)['length']?_0x16f5ee:void 0x0});});const _0x5a617e=_0x1ca0de['length'];return _0x1ca0de['forEach']((_0x434b51,_0x538cd3)=>{const _0x29f8d9=_0x538cd3===_0x5a617e-0x1;this['_formItemsCollection']['add'](new Fs(this['locale'],_0x434b51,_0x29f8d9?_0x2ae3f3:null));}),_0x251165['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-review-mode__check-list-item-parameterized-form']},'children':this['_formItemsCollection']}),_0x251165;}['_createCustomView'](_0x285b3f){return this['_customCheckView']=new Gs(this['locale'],_0x285b3f),this['_customCheckView']['extendTemplate']({'attributes':{'class':['ck-ai-review-mode__check-list-item-parameterized','ck-ai-review-mode__check-list-item-parameterized_custom',this['bindTemplate']['if']('isParametrizedViewOpen','ck-hidden',_0x1fd8d3=>!_0x1fd8d3)]}}),this['_customCheckView']['delegate']('runReviewCheck')['to'](this),this['_customCheckView'];}}class Hs extends _0x22bc08{['_checkViews'];constructor(_0x4c1cf9){super(_0x4c1cf9),this['_checkViews']=new _0x18aaa9();const _0x1d46a6=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-review-mode__check-list',_0x1d46a6['if']('isVisible','ck-hidden',_0x1610e6=>!_0x1610e6)]},'children':this['_checkViews']});}['setChecks'](_0x1ff742){this['_checkViews']['clear']();for(const [_0x1fe2c3,_0x4f3b68]of _0x1ff742['entries']()){const _0x2f7ce0=new zs(this['locale'],_0x4f3b68,_0x1fe2c3);_0x2f7ce0['delegate']('runReviewCheck')['to'](this),this['_checkViews']['add'](_0x2f7ce0);}}['hasChecks'](){return this['_checkViews']['length']>0x0;}['resetAllParameterizedChecks'](){for(const _0x576021 of this['_checkViews'])_0x576021 instanceof zs&&_0x576021['resetToDefault']();}}class xs extends _0xebef92{['resultResponseView'];['acceptButtonView'];['dismissButtonView'];['infoButtonView'];constructor(_0x22d690,_0x39fa15){super(_0x22d690),this['id']=_0x39fa15,this['set']('changeId',_0x39fa15),this['resultResponseView']=this['_createResultResponseView'](),this['acceptButtonView']=this['_createAcceptButtonView'](),this['dismissButtonView']=this['_createDismissButtonView'](),this['infoButtonView']=this['_createInfoButtonView'](),this['set']('isInfoToggleOn',!0x1),this['set']('isActive',!0x1),this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-review-mode__check-run-result',this['bindTemplate']['if']('isActive','ck-ai-review-mode__check-run-result_active')]},'on':{'click':this['bindTemplate']['to']('click')},'children':[this['resultResponseView'],{'tag':'div','attributes':{'class':['ck-ai-review-mode__check-run-result-footer']},'children':[{'tag':'div','attributes':{'class':['ck-ai-review-mode__check-run-result-action-buttons']},'children':[this['acceptButtonView'],this['dismissButtonView']]},this['infoButtonView']]}]}),this['on']('click',()=>{this['fire']('activateChange',{'id':_0x39fa15,'source':this});});}['setItemAsActive'](){this['isActive']=!0x0;}['setItemAsInactive'](){this['isActive']=!0x1;}['_createResultResponseView'](){const _0x19b0f0=new _0xebef92(this['locale']);return _0x19b0f0['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-content','ck-ai-review-mode__check-run-result-response']}}),_0x19b0f0;}['_createAcceptButtonView'](){const _0x2ed3e0=new _0xa24b3c(this['locale']);return _0x2ed3e0['set']({'label':Yn(this['locale'],'AI_REVIEW_MODE_ACCEPT_CHANGE'),'withText':!0x0,'class':'ck-ai-button-secondary\x20ck-ai-review-mode__check-run-result-accept-button'}),_0x2ed3e0['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x3f002e=>{this['fire']('acceptChange',{'id':this['changeId']}),_0x3f002e['stopPropagation']();})}}),_0x2ed3e0;}['_createDismissButtonView'](){const _0x4070a6=new _0xa24b3c(this['locale']);return _0x4070a6['set']({'label':Yn(this['locale'],'AI_REVIEW_MODE_DISMISS_CHANGE'),'withText':!0x0,'class':'ck-ai-button-tertiary-filled\x20ck-ai-review-mode__check-run-result-dismiss-button'}),_0x4070a6['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x58d515=>{this['fire']('dismissChange',{'id':this['changeId']}),_0x58d515['stopPropagation']();})}}),_0x4070a6;}['_createInfoButtonView'](){const _0x37f259=new _0xa24b3c(this['locale']);return _0x37f259['set']({'label':Yn(this['locale'],'AI_REVIEW_MODE_LEARN_MORE'),'icon':_0x124747,'tooltip':!0x0,'isToggleable':!0x0,'role':'menuitemcheckbox','class':'ck-ai-button-tertiary-filled\x20ck-ai-review-mode__check-run-result-info-button\x20ck-hidden'}),_0x37f259['bind']('isOn')['to'](this,'isInfoToggleOn',_0xccd8c4=>_0xccd8c4),_0x37f259['on']('execute',()=>{console['log']('Toggle\x20info\x20view'),this['isInfoToggleOn']=!this['isInfoToggleOn'];}),_0x37f259;}}class Js extends _0x22bc08{['_resultViews'];['resultsHeader'];['reviewDisclaimer'];['_cancelButtonView'];['_acceptAllButtonView'];['_exitReviewButtonView'];['_toggleDiffButtonView'];['_errorMessageView'];constructor(_0x5c1d22){super(_0x5c1d22),this['_resultViews']=new _0x18aaa9(),this['_cancelButtonView']=this['_createCancelButtonView'](),this['_acceptAllButtonView']=this['_createAcceptAllButtonView'](),this['_exitReviewButtonView']=this['_createExitReviewButtonView'](),this['_toggleDiffButtonView']=this['_createToggleDiffButtonView'](),this['resultsHeader']=this['_createResultHeaderView'](),this['_errorMessageView']=this['_createErrorView'](),this['reviewDisclaimer']=new Ci(_0x5c1d22),this['set']('isLoading',!0x1),this['set']('isToggleDiffOn',!0x1),this['set']('isResultReady',!0x1),this['set']('headerTitle',''),this['set']('isError',!0x1),this['set']('showErrorMessage',!0x1),this['set']('errorType','general');const _0x4222ed=this['_createCombinedSkeletonLoader'](),_0x57c11c=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-review-mode__check-run',_0x57c11c['if']('isVisible','ck-hidden',_0x75679=>!_0x75679)]},'children':[this['resultsHeader'],{'tag':'div','attributes':{'class':['ck-ai-review-mode__check-run-results-wrapper']},'children':[this['_errorMessageView'],{'tag':'div','attributes':{'class':['ck-ai-review-mode__check-run-results-container',this['bindTemplate']['if']('isLoading','ck-hidden',_0x10cf94=>_0x10cf94)]},'children':this['_resultViews']},_0x4222ed]},this['reviewDisclaimer']]});}['clearResults'](){this['_resultViews']['clear']();}['getResults'](){return this['_resultViews'];}['addResult'](_0x70fb8c){const _0x55652c=new xs(this['locale'],_0x70fb8c['id']);_0x55652c['delegate']('acceptChange','dismissChange','activateChange')['to'](this),this['_resultViews']['add'](_0x55652c),_0x55652c['resultResponseView']['element']['innerHTML']=_0x70fb8c['contentDiffed'];}['hideResult'](_0x530e43){const _0x26f362=this['_resultViews']['find'](_0x3fc6fd=>_0x3fc6fd['id']===_0x530e43);_0x26f362&&(_0x26f362['element']?.['classList']['add']('ck-ai-review-mode__check-run-result_removing'),_0x26f362['element']?.['addEventListener']('animationend',()=>{this['_resultViews']['remove'](_0x26f362),_0x26f362['destroy']();},{'once':!0x0}));}['setTitle'](_0x5891d1){this['headerTitle']=_0x5891d1;}['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 Fe(this['locale'],Be['aiReviewChecks']);}['_createCombinedSkeletonLoader'](){const _0x17aac7=new _0xebef92(this['locale']),_0x4ec4ef=[];for(let _0x8bebd0=0x0;_0x8bebd0<0x10;_0x8bebd0++){const _0x4ac225=this['_createSkeletonLoader']();_0x4ac225['extendTemplate']({'attributes':{'class':['ck-ai-review-mode__check-run-skeleton-item']}}),_0x4ec4ef['push'](_0x4ac225);}return _0x17aac7['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-review-mode__check-run-skeleton-container',this['bindTemplate']['if']('isLoading','ck-hidden',_0xbc6401=>!_0xbc6401)]},'children':_0x4ec4ef}),_0x17aac7;}['_createErrorView'](){const _0x475b0d=new _0xebef92(this['locale']),_0xea2a3b=new _0xa24b3c(this['locale']),t=this['locale']['t'];return _0x475b0d['delegate']('retryReview')['to'](this),_0xea2a3b['set']({'label':t('Try\x20again'),'withText':!0x0,'class':'ck-ai-button-secondary\x20ck-ai-review-mode__check-run-error-retry-button'}),_0xea2a3b['on']('execute',()=>{this['fire']('retryReview');}),_0x475b0d['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-review-mode__check-run-error-container',this['bindTemplate']['if']('showErrorMessage','ck-hidden',_0x1e6641=>!_0x1e6641),this['bindTemplate']['if']('errorType','ck-ai-review-mode__check-run-error-container_border-bottom',_0x128641=>'chunk'===_0x128641)]},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-chat-error','ck-ai-chat-error_full-width','ck-ai-review-mode__check-run-error-message',this['bindTemplate']['if']('errorType','ck-ai-chat-error_warning',_0x5d34c0=>'chunk'===_0x5d34c0)]},'children':[{'tag':'p','attributes':{'class':['ck-ai-chat-error__content',this['bindTemplate']['if']('errorType','ck-hidden',_0x2abbb8=>'general'!==_0x2abbb8)]},'children':[{'text':Yn(this['locale'],'AI_REVIEW_MODE_GENERAL_ERROR_MESSAGE')}]},{'tag':'p','attributes':{'class':['ck-ai-chat-error__content',this['bindTemplate']['if']('errorType','ck-hidden',_0x1db747=>'chunk'!==_0x1db747)]},'children':[{'text':Yn(this['locale'],'AI_REVIEW_MODE_CHUNK_ERROR_MESSAGE')}]}]},_0xea2a3b]}),_0x475b0d;}['_createCancelButtonView'](){const _0x302956=new _0xa24b3c(this['locale']);return _0x302956['set']({'label':Yn(this['locale'],'AI_REVIEW_MODE_STOP_GENERATING'),'withText':!0x0,'class':['ai-chat-controls-loader__cancel-button'],'icon':_0x3e1e42}),_0x302956['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isResultReady','ck-hidden',_0x10a22f=>_0x10a22f)]}}),_0x302956['on']('execute',()=>{this['fire']('abortReviewStream');}),_0x302956;}['_createToggleDiffButtonView'](){const _0x27fa87=new _0xa24b3c(this['locale']);_0x27fa87['set']({'tooltip':!0x0,'isToggleable':!0x0,'role':'menuitemcheckbox'}),_0x27fa87['bind']('isEnabled')['to'](this,'isError',_0x6309f2=>!_0x6309f2),_0x27fa87['extendTemplate']({'attributes':{'class':['ck-ai-button-secondary','ck-ai-review-mode__check-run-toggle-diff-button',this['bindTemplate']['if']('isResultReady','ck-hidden',_0x27149f=>!_0x27149f)]}});const _0x71957c=Yn(this['locale'],'AI_REVIEW_MODE_HIDE_CHANGES'),_0x1d3731=Yn(this['locale'],'AI_REVIEW_MODE_SHOW_CHANGES');return _0x27fa87['bind']('isOn')['to'](this,'isToggleDiffOn',_0x1b2652=>_0x1b2652),_0x27fa87['bind']('icon')['to'](this,'isToggleDiffOn',_0x5eec7e=>_0x5eec7e?_0x27b625:_0xd52587),_0x27fa87['bind']('label')['to'](this,'isToggleDiffOn',_0xa4bc59=>_0xa4bc59?_0x71957c:_0x1d3731),_0x27fa87['on']('execute',()=>{this['isToggleDiffOn']=!this['isToggleDiffOn'],this['fire']('toggleDiff',{'on':this['isToggleDiffOn']});}),_0x27fa87;}['_createAcceptAllButtonView'](){const _0xd5586d=new _0xa24b3c(this['locale']);return _0xd5586d['set']({'label':Yn(this['locale'],'AI_REVIEW_MODE_ACCEPT_ALL'),'withText':!0x0}),_0xd5586d['bind']('isEnabled')['to'](this,'isError',_0x26cd81=>!_0x26cd81),_0xd5586d['extendTemplate']({'attributes':{'class':['ck-ai-button-primary','ck-ai-review-mode__check-run-accept-all-button',this['bindTemplate']['if']('isResultReady','ck-hidden',_0xe8e954=>!_0xe8e954)]}}),_0xd5586d['on']('execute',()=>{this['fire']('acceptAllChanges');}),_0xd5586d;}['_createExitReviewButtonView'](){const _0x56a1cb=new _0xa24b3c(this['locale']);return _0x56a1cb['set']({'label':Yn(this['locale'],'AI_REVIEW_MODE_EXIT_REVIEW'),'withText':!0x0}),_0x56a1cb['extendTemplate']({'attributes':{'class':['ck-ai-button-tertiary-filled','ck-ai-review-mode__check-run-exit-button',this['bindTemplate']['if']('isResultReady','ck-hidden',_0x42cd15=>!_0x42cd15)]}}),_0x56a1cb['on']('execute',()=>{this['fire']('leaveReviewModeResultList');}),_0x56a1cb;}['_createResultHeaderView'](){const _0x3ce3f9=new _0xebef92(this['locale']),_0x1e68a5=new De();return _0x1e68a5['bind']('isVisible')['to'](this,'isResultReady',_0x52a542=>!_0x52a542),_0x3ce3f9['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-review-mode__check-run-results-header']},'children':[{'tag':'span','attributes':{'class':['ck-ai-review-mode__check-run-results-header-title']},'children':[{'text':this['bindTemplate']['to']('headerTitle')}]},{'tag':'div','attributes':{'class':['ck-ai-review-mode__check-run-results-header-buttons']},'children':[_0x1e68a5,this['_cancelButtonView'],this['_acceptAllButtonView'],this['_exitReviewButtonView'],this['_toggleDiffButtonView']]}]}),_0x3ce3f9;}}class Ks extends _0x22bc08{['resultsHeader'];['_finishReviewButtonView'];constructor(_0x3432f9){super(_0x3432f9),this['_finishReviewButtonView']=this['_createFinishReviewButtonView'](),this['resultsHeader']=this['_createResultHeaderView'](),this['set']('viewType','completed');const _0x52ac68=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-review-mode__review-completed',_0x52ac68['if']('isVisible','ck-hidden',_0x5cf1c6=>!_0x5cf1c6)]},'children':[this['resultsHeader'],{'tag':'div','attributes':{'class':['ck-ai-review-mode__review-completed-content']},'children':[{'tag':'span','attributes':{'class':['ck-ai-review-mode__review-completed-content-icon']},'children':[{'text':'🎉'}]},{'tag':'p','attributes':{'class':['ck-ai-review-mode__review-completed-content-text']},'children':[{'text':_0x52ac68['to']('viewType',_0x4a633e=>Yn(_0x3432f9,'completed'===_0x4a633e?'AI_REVIEW_MODE_COMPLETED_TEXT':'AI_REVIEW_MODE_EMPTY_RESULTS_TEXT'))}]}]}]});}['_createFinishReviewButtonView'](){const _0x65cbfe=new _0xa24b3c(this['locale']);return _0x65cbfe['set']({'label':Yn(this['locale'],'AI_REVIEW_MODE_FINISH_REVIEW_BUTTON_LABEL'),'withText':!0x0,'class':'ck-ai-button-primary'}),_0x65cbfe['on']('execute',()=>{this['fire']('finishReview');}),_0x65cbfe;}['_createResultHeaderView'](){const _0x2c5937=new _0xebef92(this['locale']);return _0x2c5937['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-review-mode__review-completed-header']},'children':[{'tag':'span','attributes':{'class':['ck-ai-review-mode__review-completed-header-title']},'children':[{'text':Yn(this['locale'],'AI_REVIEW_MODE_FINISH_REVIEW_HEADER_TITLE')}]},{'tag':'div','attributes':{'class':['ck-ai-review-mode__review-completed-header-buttons']},'children':[this['_finishReviewButtonView']]}]}),_0x2c5937;}}class ae extends _0xebef92{['reviewModeHeader'];['reviewCheckListView'];['reviewCheckResultsView'];['reviewCompletedView'];constructor(_0x67e2e0){super(_0x67e2e0),this['reviewModeHeader']=new _0x247e71(_0x67e2e0,{'label':Yn(_0x67e2e0,'AI_REVIEW_MODE'),'icon':_0xf283a1,'class':'ck-ai-header\x20ck-ai-header_review-mode'}),this['reviewCheckListView']=new Hs(_0x67e2e0),this['reviewCheckListView']['delegate'](...Ns)['to'](this),this['reviewCheckResultsView']=new Js(_0x67e2e0),this['reviewCheckResultsView']['delegate'](...Ns)['to'](this),this['reviewCompletedView']=new Ks(_0x67e2e0),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-mode','ck-rounded-corners'],'dir':'ltr'},'children':[this['reviewModeHeader'],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);}['addCheckRunResult'](_0x5552a9){this['reviewCheckResultsView']['addResult'](_0x5552a9),this['reviewCheckResultsView']['set']('isLoading',!0x1);}['showReviewCompletedView'](){this['reviewCheckListView']['set']('isVisible',!0x1),this['reviewCheckResultsView']['set']('isVisible',!0x1),this['reviewCompletedView']['set']('viewType','completed'),this['reviewCompletedView']['set']('isVisible',!0x0);}['showActionsWhenResultIsReady'](){this['reviewCheckResultsView']['isResultReady']=!0x0;}['showNoChangesView'](){this['reviewCheckListView']['set']('isVisible',!0x1),this['reviewCheckResultsView']['set']('isVisible',!0x1),this['reviewCompletedView']['set']('viewType','unmodified'),this['reviewCompletedView']['set']('isVisible',!0x0);}['hideActionsWhenResultIsReady'](){this['reviewCheckResultsView']['isResultReady']=!0x1;}['showGeneralErrorView'](){this['reviewCheckResultsView']['set']('isLoading',!0x1),this['showActionsWhenResultIsReady'](),this['reviewCheckResultsView']['showGeneralErrorMessage']();}['showChunkErrorView'](){this['reviewCheckResultsView']['set']('isLoading',!0x1),this['showActionsWhenResultIsReady'](),this['reviewCheckResultsView']['showChunkErrorMessage']();}}class ce extends _0x5b9e88{['resultItemView'];constructor(_0x30a44d,_0x325736){super(_0x30a44d),this['set']({'isVisible':!0x1,'position':'se','class':null,'top':0x0,'left':0x0}),this['extendTemplate']({'tag':'div','attributes':{'class':['ck-reset'],'tabindex':'-1'}}),this['content']['add'](this['_createContentView']()),_0x325736['add'](this),_0x16cb96({'emitter':this,'activator':()=>this['isVisible'],'contextElements':[this['element']],'callback':()=>{this['hideBalloon'](),this['deactivateChange']();}});}['updateContent'](_0x30b01d){this['resultItemView']['changeId']=_0x30b01d['id'],this['resultItemView']['resultResponseView']['element']['innerHTML']=_0x30b01d['contentDiffed'];}['showBalloon'](_0x188907,_0x306619){this['updateContent'](_0x188907),this['show'](),this['pin']({'target':_0x306619});}['hideBalloon'](){this['hide'](),this['unpin']();}['deactivateChange'](){this['fire']('deactivateChange');}['_createContentView'](){const _0x2cbcb7=new _0xebef92();return this['resultItemView']=new xs(this['locale'],''),this['resultItemView']['resultResponseView']['extendTemplate']({'attributes':{'class':['ck-content']}}),this['resultItemView']['delegate']('acceptChange','dismissChange')['to'](this),_0x2cbcb7['setTemplate']({'tag':'div','attributes':{'class':['ck-reset','ck-ai-review-mode-balloon-panel-suggestion']},'children':[{'tag':'p','attributes':{'class':['ck-ai-review-mode__suggestion-text']},'children':[this['resultItemView']]}]}),_0x2cbcb7;}}const Ns=['getReviewCheckList','runReviewCheck','abortReviewStream','toggleDiff','acceptAllChanges','leaveReviewModeResultList','activateChange','acceptChange','dismissChange','learnMore','finishReview','retryReview'];class ie extends _0x3cc6c1{['_reviewModeView'];['_reviewModeBalloonSuggestionItemView'];['_bodyCollection'];static get['requires'](){return[ht];}static get['pluginName'](){return'AIReviewModeUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0xa4aad1){super(_0xa4aad1),this['_bodyCollection']=new zt(this['context']['locale']),this['_bodyCollection']['attachToDom'](),this['_reviewModeView']=new ae(this['context']['locale']),this['_reviewModeView']['delegate'](...Ns)['to'](this),this['_reviewModeBalloonSuggestionItemView']=new ce(this['context']['locale'],this['_bodyCollection']),this['_reviewModeBalloonSuggestionItemView']['delegate']('acceptChange','dismissChange','deactivateChange')['to'](this);}['init'](){const _0x18fa26=this['context']['plugins']['get']('AITabs');_0x18fa26['view']['on']('activateTab',(_0x4ace6c,_0x589ef7)=>{'reviewMode'===_0x589ef7?this['fire']('getReviewCheckList'):this['fire']('leaveReviewMode');}),_0x18fa26['view']['addTab']({'id':'reviewMode','buttonLabel':Yn(this['context']['locale'],'AI_REVIEW_MODE'),'buttonIcon':_0xf283a1,'order':0x0,'content':this['_reviewModeView']});}['destroy'](){this['_bodyCollection']['detachFromDom'](),super['destroy']();}['setAvailableChecks'](_0x454153){this['_reviewModeView']['reviewCheckListView']['hasChecks']()||this['_reviewModeView']['reviewCheckListView']['setChecks'](_0x454153),this['_reviewModeView']['showReviewCheckListView']();}['showReviewCheckList'](){this['fire']('getReviewCheckList');}['showCheckRunResults'](_0xcfd9c9){_0xcfd9c9&&('error-general'!==_0xcfd9c9['status']?'error-chunk'!==_0xcfd9c9['status']?this['_reviewModeView']['showReviewCheckResultsView']():this['showChunkErrorView']():this['showGeneralErrorView']());}['showCheckRunResult'](_0x21d2c1){this['_reviewModeView']['addCheckRunResult'](_0x21d2c1);}['showGeneralErrorView'](){this['_reviewModeView']['showGeneralErrorView']();}['showChunkErrorView'](){this['_reviewModeView']['showChunkErrorView']();}['setCheckResultTitle'](_0x39c8e2){this['_reviewModeView']['reviewCheckResultsView']['setTitle'](_0x39c8e2);}['setActiveStateInResults'](_0x4acedb){this['_reviewModeView']['reviewCheckResultsView']['getResults']()['forEach'](_0x547924=>{_0x547924['id']===_0x4acedb&&_0x547924['setItemAsActive']();});}['resetActiveStateInResults'](){this['_reviewModeView']['reviewCheckResultsView']['getResults']()['forEach'](_0x4d6302=>_0x4d6302['setItemAsInactive']());}['updateChangeState'](_0x3223e5,_0x24afa1){'accepted'!==_0x24afa1&&'rejected'!==_0x24afa1||this['_reviewModeView']['reviewCheckResultsView']['hideResult'](_0x3223e5);}['showReviewCompletedView'](){this['_reviewModeView']['showReviewCompletedView']();}['showActionsWhenResultIsReady'](){this['_reviewModeView']['showActionsWhenResultIsReady']();}['showNoChangesView'](){this['_reviewModeView']['showNoChangesView']();}['hideActionsWhenResultIsReady'](){this['_reviewModeView']['hideActionsWhenResultIsReady']();}['showChangeBalloon'](_0xce74c2,_0x3233bf){this['_reviewModeBalloonSuggestionItemView']['showBalloon'](_0xce74c2,_0x3233bf);}['hideChangeBalloon'](){this['_reviewModeBalloonSuggestionItemView']['hideBalloon']();}['getChangeElement'](_0x3eabb6){const _0x4cc2f4=this['_reviewModeView']['reviewCheckResultsView']['getResults']()['find'](_0x261cbf=>_0x261cbf['id']===_0x3eabb6);return _0x4cc2f4?_0x4cc2f4['element']:null;}['deactivateChange'](){this['_reviewModeBalloonSuggestionItemView']['deactivateChange']();}}const se='reviewmode-';class re extends _0x3cc6c1{static get['pluginName'](){return'AIReviewModeEditing';}static get['requires'](){return[_0x4d3a88,a];}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['_markers']=new Map();['_domEmitter'];['_eventEmitter'];constructor(_0x5ebff7){super(_0x5ebff7),this['_domEmitter']=new(te())(),this['_eventEmitter']=new(_0x5a5836())();}get['emitter'](){return this['_eventEmitter'];}['afterInit'](){const _0x1a91da=it(this['context']);_0x1a91da['conversion']['for']('editingDowncast')['markerToElement']({'model':se+'insert','view':(_0x1590fa,{writer:_0x105373})=>{const _0x1c0471=this['_markers']['get'](_0x1590fa['markerName']),_0x534341={'class':'ck-ai_review-mode-marker_add','data-marker-id':_0x1590fa['markerName']};return _0x105373['createUIElement']('span',_0x534341,function(_0x4d88a0){const _0x2094e9=this['toDomElement'](_0x4d88a0);return _0x2094e9['innerHTML']=_0x1c0471?.['text']||'',_0x2094e9;});}}),_0x1a91da['conversion']['for']('editingDowncast')['markerToHighlight']({'model':se+'remove-only','view':_0x1d6fb9=>({'classes':'ck-ai_review-mode-marker_strikethrough','attributes':{'data-marker-id':_0x1d6fb9['markerName']}})}),_0x1a91da['conversion']['for']('editingDowncast')['markerToHighlight']({'model':se+'remove-context','view':_0x9e8c80=>({'classes':'ck-ai_review-mode-marker_underline','attributes':{'data-marker-id':_0x9e8c80['markerName']}})}),_0x1a91da['conversion']['for']('editingDowncast')['markerToHighlight']({'model':se+'remove-text','view':_0xaa8207=>({'classes':'ck-ai_review-mode-marker_hide','attributes':{'data-marker-id':_0xaa8207['markerName']}})}),_0x1a91da['conversion']['for']('dataDowncast')['markerToElement']({'model':se+'suggestion-context','view':(_0x4fb003,{writer:_0x5237b4})=>_0x5237b4['createRawElement']('span',{'class':'ck-ai_review-mode-marker_context-'+(_0x4fb003['isOpening']?'start':'end')})}),_0x1a91da['conversion']['for']('downcast')['attributeToAttribute']({'model':_0x355718,'view':_0x439c4a}),this['_domEmitter']['listenTo'](document,'click',(_0x187d78,_0x289077)=>{const _0x51b983=_0x289077['target'],_0x4869c7=this['_findMarkerElement'](_0x51b983);if(!_0x4869c7)return;const _0x5210ac=_0x4869c7['getAttribute']('data-marker-id'),_0x4ce24a=_0x5210ac['split'](':')['pop']()?.['split']('_')[0x0];this['_eventEmitter']['fire']('changeMarkerClick',{'markerId':_0x5210ac,'changeId':_0x4ce24a});});}['getDocumentData'](){const _0x4897ce=this['context']['plugins']['get']('AIEditing'),_0x63c267=it(this['context']),_0xf4e7ae=_0x63c267['model'],_0x12a91b=new _0x91360f();for(const _0x299061 of _0xf4e7ae['document']['getRoot']()['getChildren']()){const _0x116144=_0x299061['_clone'](!0x0);_0x12a91b['_appendChild'](_0x116144);}for(const _0x1f9061 of _0xf4e7ae['markers'])_0x12a91b['markers']['set'](_0x1f9061['name'],this['_changeRangeOwnerDocument'](_0x1f9061['getRange']()['clone'](),_0x12a91b));const _0x7e536f=new Zt({'ignoreElementEnd':!0x0,'startPosition':_0xf4e7ae['createPositionAt'](_0x12a91b,0x0)}),_0x2e21f3=new Set(),_0xc3adb=new Map();for(const {item:_0x1f2947}of _0x7e536f){if(!_0x1f2947['is']('$textProxy'))continue;const _0x46449d=_0x1f2947['parent'];if((!_0x46449d||!_0x46449d['is']('element','caption'))&&(_0x46449d&&_0x46449d['is']('element'))){let _0x4d7d5c=_0x46449d['getAttribute'](_0x355718);_0x4d7d5c||(_0x4d7d5c=_0x4897ce['_nextDataId'](_0x2e21f3),_0x46449d['_setAttribute'](_0x355718,_0x4d7d5c)),_0x2e21f3['add'](_0x4d7d5c);const _0x3e7363=this['_getTopElement'](_0x46449d);_0xc3adb['set'](_0x4d7d5c,{'path':_0x46449d['getPath'](),'getContent':this['_createGetContentUsingDataIdFn'](_0x3e7363['_clone'](!0x0),_0x4d7d5c,_0x63c267['data'])}),_0x7e536f['jumpTo'](_0xf4e7ae['createPositionAfter'](_0x46449d));}}return{'content':_0x63c267['data']['processor']['toData'](_0x63c267['data']['toView'](_0x12a91b)),'version':_0x63c267['model']['document']['version'],'elements':_0xc3adb};}['diffContent'](_0x1509ac,_0x2ac7f3){const _0x5e9f56=it(this['context']),_0x2b8c39=_0x5e9f56['data']['parse'](_0x1509ac,'$documentFragment'),_0x4f05bf=_0x5e9f56['model']['createPositionAt'](_0x2b8c39,0x0),_0x590350=this['context']['plugins']['get']('DocumentCompare')['getDiff'](_0x1509ac,_0x2ac7f3,{'anchor':_0x4f05bf,'markDeletions':!0x0})['getOperations']()['filter'](_0x50ba3e=>'insert'===_0x50ba3e['type']||'marker'===_0x50ba3e['type']&&_0x50ba3e['name']['startsWith']('$markedRemove')),_0xcdd79b=this['_groupAdjacentOperations'](_0x590350),_0x3c94dd=[];let _0x399609=0x0;return _0x5e9f56['model']['change'](_0x81b3e6=>{for(let _0x430d46=0x0;_0x430d46<_0xcdd79b['length'];_0x430d46++){const _0x2b6d48=_0xcdd79b[_0x430d46],_0x4ef399=_0x81b3e6['createDocumentFragment']();for(const _0x3c2069 of _0x2b8c39['getChildren']())_0x81b3e6['append'](_0x3c2069['_clone'](!0x0),_0x4ef399);for(const _0x551616 of _0x2b6d48['operationsIsolated'])if('insert'===_0x551616['type']){const _0x3a4e95=_0x551616;_0x3a4e95['baseVersion']=null,_0x3a4e95['isDocumentOperation']=!0x1,this['_changeOperationOwnerDocument'](_0x3a4e95,_0x4ef399),_0x81b3e6['batch']['addOperation'](_0x551616),_0x5e9f56['model']['applyOperation'](_0x551616);const _0x21a35f='suggestion:insertion:id:authorId:'+_0x399609++,_0x554484=_0x5e9f56['model']['createRange'](_0x3a4e95['position'],_0x3a4e95['position']['getShiftedBy'](_0x3a4e95['howMany']));_0x4ef399['markers']['set'](_0x21a35f,_0x554484);}else{if('marker'===_0x551616['type']&&_0x551616['name']['startsWith']('$markedRemove')){const _0x3fa845=_0x551616,_0x329136='suggestion:deletion:id:authorId:'+_0x399609++;this['_changeOperationOwnerDocument'](_0x3fa845,_0x4ef399),_0x4ef399['markers']['set'](_0x329136,_0x3fa845['newRange']);}}const _0x35beea=this['_getChangeContext'](this['_changePositionOwnerDocument'](this['_getOperationStart'](_0x2b6d48['operationsIsolated'][0x0]),_0x4ef399),this['_changePositionOwnerDocument'](this['_getOperationEnd'](_0x2b6d48['operationsIsolated'][_0x2b6d48['operationsIsolated']['length']-0x1]),_0x4ef399));_0x4ef399['markers']['set'](se+'suggestion-context',new _0x4f7a9a(_0x35beea['start'],_0x35beea['end'])),_0x3c94dd['push']({..._0x2b6d48,'context':this['_createGetContextFn'](_0x4ef399,_0x5e9f56['data'],{'ellipsisBefore':_0x35beea['hasContentBefore'],'ellipsisAfter':_0x35beea['hasContentAfter']}),'content':this['_createGetContentFn'](_0x4ef399,_0x5e9f56['data'])});}}),_0x3c94dd;}['markChangePositionInEditorContent'](_0x3a7792,_0x3e77f7){const _0x7b7ba5=_0x3a7792[0x0]['parent']['id'],_0x34df6e=_0x3e77f7['elements']['get'](_0x7b7ba5);if(!_0x34df6e)return void console['warn']('No\x20element\x20found\x20for\x20ID:\x20'+_0x7b7ba5);const _0x3832f1=_0x34df6e['path'],_0x44e674=it(this['context']),_0x21bfd8=_0x44e674['model']['document']['history']['getOperations'](_0x3e77f7['version']),_0x4f83da=[];for(const _0x253c33 of _0x3a7792){const _0x4c51c1=_0x253c33['operationsIsolated']['map'](_0xe17b5a=>this['_translateOperationToEditorContent'](_0xe17b5a,_0x3832f1,_0x44e674['model']['document']['getRoots']()[0x0]));if(!_0x4c51c1||!_0x4c51c1['length'])continue;const _0xaec853=_0x4c51c1['every'](_0x434e0b=>'marker'===_0x434e0b['type']&&_0x434e0b['name']['startsWith']('$markedRemove')),_0x46a864={'document':_0x44e674['model']['document'],'useRelations':!0x1,'padWithNoOps':!0x1},_0x1f8b6a=_0x59901f(_0x4c51c1,_0x21bfd8,_0x46a864)['operationsA'];for(const _0x5b7666 of _0x1f8b6a)if('insert'===_0x5b7666['type']){const _0x1d60f4=_0x5b7666,_0x5e7c7d=_0x1d60f4['nodes'];let _0x4cdc6b='';for(const _0x2d3a5b of _0x5e7c7d)_0x2d3a5b&&_0x2d3a5b['is']('model:$text')&&(_0x4cdc6b+=_0x2d3a5b['data']);_0x4f83da['push']({'start':_0x1d60f4['position'],'end':_0x1d60f4['position'],'type':'insert','groupId':_0x253c33['id'],'text':_0x4cdc6b});}else{if('marker'===_0x5b7666['type']&&_0x5b7666['name']['startsWith']('$markedRemove')){const _0x559fb9=_0x5b7666;let _0x3b0b97='remove-text';if(_0xaec853){const _0x268647=this['_findAdjacentContextDistance'](_0x559fb9['newRange']['start'],'backward',_0x44e674['model']['schema']),_0x574c7a=this['_findAdjacentContextDistance'](_0x559fb9['newRange']['end'],'forward',_0x44e674['model']['schema']);if(_0x268647||_0x574c7a){const _0x57c51c=_0x559fb9['newRange']['start']['getShiftedBy'](-_0x268647),_0x2079be=_0x559fb9['newRange']['end']['getShiftedBy'](_0x574c7a);_0x4f83da['push']({'start':_0x57c51c,'end':_0x2079be,'groupId':_0x253c33['id'],'type':'remove-context'});}else _0x3b0b97='remove-only';}_0x4f83da['push']({'start':_0x559fb9['newRange']['start'],'end':_0x559fb9['newRange']['end'],'groupId':_0x253c33['id'],'type':_0x3b0b97});}}}this['_insertMarkers'](_0x4f83da);}['clearAllMarkers'](){it(this['context'])['model']['change'](_0x20e2d1=>{for(const _0xc5809c of this['_markers']['keys']())_0x20e2d1['removeMarker'](_0xc5809c);}),this['_markers']['clear']();}['switchToReadOnly'](){it(this['context'])['enableReadOnlyMode']('ai-review-mode');}['switchToEdit'](){it(this['context'])['disableReadOnlyMode']('ai-review-mode');}['applyChange'](_0x3ef40f){const _0x1075ee=it(this['context']),_0xe0a9c3=_0x1075ee['model'],_0x455e35=_0x3ef40f['map'](_0x263822=>this['_getMarkersDataForGroup'](_0x263822))['flat']();_0xe0a9c3['change'](_0x4105e5=>{for(const _0x4655ec of _0x455e35){const _0x30dcd6=_0x1075ee['model']['markers']['get'](_0x4655ec['id']);_0x30dcd6&&('insert'===_0x4655ec['type']?_0xe0a9c3['insertContent'](_0x4105e5['createText'](_0x4655ec['text']||''),_0x30dcd6['getRange']()['start']):'remove-text'!==_0x4655ec['type']&&'remove-only'!==_0x4655ec['type']||_0xe0a9c3['deleteContent'](_0xe0a9c3['createSelection'](_0x30dcd6['getRange']())),_0x4105e5['removeMarker'](_0x4655ec['id']),this['_markers']['delete'](_0x4655ec['id']));}});}['rejectChange'](_0x36ec68){const _0x27b38d=it(this['context']),_0x1d5c06=this['_getMarkersDataForGroup'](_0x36ec68);_0x27b38d['model']['change'](_0x1450fb=>{for(const _0x6029fb of _0x1d5c06)_0x1450fb['removeMarker'](_0x6029fb['id']),this['_markers']['delete'](_0x6029fb['id']);});}['getContentElement'](){const _0x32edac=it(this['context']);return _0x32edac&&_0x32edac['ui']&&_0x32edac['ui']['element']?_0x32edac['ui']['element']:null;}['getMarkerElementForChange'](_0x5a6efc){const _0x15dc09=Array['from'](this['_markers']['values']())['filter'](_0x3a925d=>_0x3a925d['groupId']===_0x5a6efc);if(!_0x15dc09['length'])return null;const _0x2fa2c4=0x1===_0x15dc09['length']?_0x15dc09[0x0]:this['_sortMarkers'](_0x15dc09)[0x0],_0x18df60=it(this['context']),_0x48a52e=_0x18df60['model']['markers']['get'](_0x2fa2c4['id']);if(!_0x48a52e)return null;const _0x3e7d83=_0x48a52e['getRange'](),_0x2efa0e=_0x18df60['editing']['view']['getDomRoot']();if(!_0x2efa0e||!_0x3e7d83)return null;const _0x3a1b5a=_0x2efa0e['querySelector']('[data-marker-id=\x22'+_0x2fa2c4['id']+'\x22]');return _0x3a1b5a?{'modelRange':_0x3e7d83,'domElement':_0x3a1b5a}:null;}['_translateOperationToEditorContent'](_0xd5c5d1,_0x24b417,_0x2cf09c){if('insert'===_0xd5c5d1['type']){const _0x566522=_0xd5c5d1;return new $t(this['_changePosition'](_0x566522['position'],_0x24b417['concat'](_0x566522['position']['offset']),_0x2cf09c),_0x566522['nodes'],_0x566522['baseVersion']);}if('marker'===_0xd5c5d1['type']&&_0xd5c5d1['name']['startsWith']('$markedRemove')){const _0x47cfad=_0xd5c5d1;return new Bt(_0x47cfad['name'],_0x47cfad['oldRange'],this['_changeRange'](_0x47cfad['newRange'],_0x24b417['concat'](_0x47cfad['newRange']['start']['offset']),_0x24b417['concat'](_0x47cfad['newRange']['end']['offset']),_0x2cf09c),_0x47cfad['_markers'],_0x47cfad['affectsData'],_0x47cfad['baseVersion']);}return _0xd5c5d1;}['_groupAdjacentOperations'](_0x2b6ba3){if(!_0x2b6ba3['length'])return[];const _0x7c1653=[];let _0x2e1de0=0x0,_0x39c94e=0x0,_0xa9899a=[];for(let _0x1a1edf=0x0;_0x1a1edf<=_0x2b6ba3['length'];_0x1a1edf++){const _0x94f356=_0x2b6ba3[_0x1a1edf],_0x38db24=_0x2b6ba3[_0x1a1edf-0x1];!_0x94f356||_0x38db24&&!this['_getOperationEnd'](_0x38db24)['isTouching'](this['_getOperationStart'](_0x94f356))?(_0x7c1653['push']({'operations':_0xa9899a,'operationsIsolated':_0xa9899a['map'](_0x750a3a=>this['_shiftOperation'](_0x750a3a['clone'](),-_0x39c94e)),'groupOffset':_0x2e1de0}),_0xa9899a=_0x94f356?[_0x94f356]:[],_0x39c94e+=_0x2e1de0,_0x2e1de0=0x0):_0xa9899a['push'](_0x94f356),_0x94f356&&'insert'===_0x94f356['type']&&(_0x2e1de0+=_0x94f356['howMany']);}return _0x7c1653;}['_findAdjacentContextDistance'](_0x17840e,_0x307656,_0x38e197,_0x139fab=0x1){const _0x5cf751=new Zt({'startPosition':_0x17840e,'direction':_0x307656});let _0x51cd1f=0x0;for(let _0x5cfd8d=0x0;_0x5cfd8d<_0x139fab;_0x5cfd8d++){let _0x333a5b=0x0,_0x407b9=!0x1,_0xa64db2='forward'===_0x307656?/^\W*\w+/:/\w+\W*$/;for(const {item:_0x19a5ea}of _0x5cf751)if(_0x19a5ea['is']('$textProxy')){const _0x1021a2=_0xa64db2['exec'](_0x19a5ea['data']);if(_0x1021a2&&_0x1021a2['length']){if(_0x333a5b+='forward'===_0x307656?_0x1021a2['index']+_0x1021a2[0x0]['length']:_0x19a5ea['data']['length']-_0x1021a2['index'],_0x1021a2[0x0]['length']!==_0x19a5ea['data']['length'])break;_0x407b9=!0x0,_0xa64db2='forward'===_0x307656?/^\w+/:/\w+$/;}else{if(_0x407b9)break;_0x333a5b+=_0x19a5ea['offsetSize'];}}else{if(_0x19a5ea['is']('element')){_0x38e197['isInline'](_0x19a5ea)&&!_0x407b9&&(_0x333a5b+=0x1);break;}}_0x51cd1f+=_0x333a5b,_0x5cf751['jumpTo'](_0x17840e['getShiftedBy']('forward'===_0x307656?_0x51cd1f:-_0x51cd1f));}return _0x51cd1f;}['_getChangeContext'](_0x96a1c5,_0x57320d){const _0x45ec72=it(this['context'])['model']['schema'],_0x32ccfd=this['_findAdjacentContextDistance'](_0x96a1c5,'backward',_0x45ec72,0x6),_0x4dc811=this['_findAdjacentContextDistance'](_0x57320d,'forward',_0x45ec72,0x6),_0x3e8850=_0x96a1c5['getShiftedBy'](-_0x32ccfd),_0x17e6e6=_0x57320d['getShiftedBy'](_0x4dc811);return{'start':_0x3e8850,'end':_0x17e6e6,'hasContentBefore':!_0x3e8850['isAtStart'],'hasContentAfter':!_0x17e6e6['isAtEnd']};}['_insertMarkers'](_0x416cd8){const _0x265195=this['context']['plugins']['get']('AIEditing'),_0x13ad85=new Set();it(this['context'])['model']['change'](_0x4bc19d=>{for(const _0x40826a of _0x416cd8){const _0x5b2810=''+se+_0x40826a['type']+':'+_0x40826a['groupId']+'_'+_0x265195['_nextDataId'](_0x13ad85);this['_markers']['set'](_0x5b2810,{'id':_0x5b2810,'groupId':_0x40826a['groupId'],'type':_0x40826a['type'],'text':_0x40826a['text']}),_0x4bc19d['addMarker'](_0x5b2810,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x4bc19d['createRange'](_0x40826a['start'],_0x40826a['end'])});}});}['_createGetContextFn'](_0x785d18,_0x1b68e0,_0x3ea4c2){let _0x248984='';return()=>{if(!_0x248984){const _0x415638=_0x1b68e0['toView'](_0x785d18,{'showSuggestionHighlights':!0x0}),_0x29ce98=_0x415638['getChild'](0x0);if(!_0x29ce98)return'';let _0x167e33=!0x1;const _0x2d31a6=[];for(const _0x2d627e of _0x29ce98['getChildren']())_0x2d627e['is']('element','span')&&_0x2d627e['hasClass']('ck-ai_review-mode-marker_context-end')&&(_0x167e33=!0x1),_0x167e33&&_0x2d31a6['push'](_0x2d627e),_0x2d627e['is']('element','span')&&_0x2d627e['hasClass']('ck-ai_review-mode-marker_context-start')&&(_0x167e33=!0x0);_0x29ce98['_removeChildren'](0x0,_0x29ce98['childCount']),_0x3ea4c2?.['ellipsisBefore']&&_0x29ce98['_appendChild']('…'),_0x29ce98['_appendChild'](_0x2d31a6),_0x3ea4c2?.['ellipsisAfter']&&_0x29ce98['_appendChild']('…');const _0x3f2a2d=_0x1b68e0['htmlProcessor']['domConverter']['viewToDom'](_0x415638),_0x3724a1=_0x1b68e0['htmlProcessor']['htmlWriter']['getHtml'](_0x3f2a2d);_0x248984=_0x3724a1;}return _0x248984;};}['_createGetContentFn'](_0x331bed,_0x55a0af){let _0x3b91d9='';return()=>(_0x3b91d9||(_0x3b91d9=_0x55a0af['stringify'](_0x331bed,{'showSuggestionHighlights':!0x0})),_0x3b91d9);}['_createGetContentUsingDataIdFn'](_0x1380ff,_0x7bf63e,_0x55d9cd){let _0x1bca61='';return()=>{if(!_0x1bca61){const _0x57652c=_0x55d9cd['toView'](new _0x91360f(_0x1380ff)),_0x54a3cf=_0x55d9cd['htmlProcessor']['domConverter']['viewToDom'](_0x57652c)['querySelector']('[data-id=\x22'+_0x7bf63e+'\x22]');_0x1bca61=_0x54a3cf?.['outerHTML']||'';}return _0x1bca61;};}['_findMarkerElement'](_0x21cbdb,_0x5939f8=0x5){let _0x70f8fa=_0x21cbdb,_0x3c4f27=null;for(let _0x339da7=0x0;_0x339da7<_0x5939f8&&_0x70f8fa;_0x339da7++){if(!_0x70f8fa['className']){_0x70f8fa=_0x70f8fa['parentElement'];continue;}if(!(''+_0x70f8fa['className'])['includes']('ck-ai_review-mode-marker_')){_0x70f8fa=_0x70f8fa['parentElement'];continue;}if(!_0x70f8fa['getAttribute']('data-marker-id'))break;_0x3c4f27=_0x70f8fa;break;}return _0x3c4f27;}['_getMarkersDataForGroup'](_0x132683){return Array['from'](this['_markers']['values']())['filter'](_0x5d3d6f=>_0x5d3d6f['groupId']===_0x132683);}['_getOperationStart'](_0x4fe67f){return'insert'===_0x4fe67f['type']?_0x4fe67f['position']:_0x4fe67f['newRange']['start'];}['_getOperationEnd'](_0x84aeb,_0x3d1d75=!0x1){return'insert'===_0x84aeb['type']?_0x3d1d75?_0x84aeb['position']:_0x84aeb['position']['getShiftedBy'](_0x84aeb['howMany']):_0x84aeb['newRange']['end'];}['_shiftOperation'](_0x446ee4,_0x11a45a){return'insert'===_0x446ee4['type']?_0x446ee4['position']=_0x446ee4['position']['getShiftedBy'](_0x11a45a):'marker'===_0x446ee4['type']&&_0x446ee4['newRange']&&(_0x446ee4['newRange']=new _0x4f7a9a(_0x446ee4['newRange']['start']['getShiftedBy'](_0x11a45a),_0x446ee4['newRange']['end']['getShiftedBy'](_0x11a45a))),_0x446ee4;}['_changeOperationOwnerDocument'](_0x391d40,_0x3354e6){'insert'===_0x391d40['type']?_0x391d40['position']=this['_changePositionOwnerDocument'](_0x391d40['position'],_0x3354e6):'marker'===_0x391d40['type']&&_0x391d40['newRange']&&(_0x391d40['newRange']=this['_changeRangeOwnerDocument'](_0x391d40['newRange'],_0x3354e6));}['_changePositionOwnerDocument'](_0xad4461,_0xfa45b2){return new _0x31d1c1(_0xfa45b2,_0xad4461['path']);}['_changeRangeOwnerDocument'](_0x278688,_0xb8ed29){return new _0x4f7a9a(this['_changePositionOwnerDocument'](_0x278688['start'],_0xb8ed29),this['_changePositionOwnerDocument'](_0x278688['end'],_0xb8ed29));}['_changePosition'](_0x1920c1,_0x3356cf,_0x3008fe){return new _0x31d1c1(_0x3008fe,[..._0x3356cf]);}['_changeRange'](_0xcf1532,_0x2d0068,_0x59430e,_0x1cbe07){return new _0x4f7a9a(this['_changePosition'](_0xcf1532['start'],_0x2d0068,_0x1cbe07),this['_changePosition'](_0xcf1532['end'],_0x59430e,_0x1cbe07));}['_getTopElement'](_0x2f779f){let _0xc32d7b=_0x2f779f;for(;_0xc32d7b['parent']&&!_0xc32d7b['parent']['is']('documentFragment');)_0xc32d7b=_0xc32d7b['parent'];return _0xc32d7b;}['_sortMarkers'](_0x2a2573){const _0x495816=_0x206e92=>{switch(_0x206e92){case'insert':return 0x1;case'remove-context':return 0x2;case'remove-only':return 0x3;case'remove-text':return 0x4;}};return _0x2a2573['sort']((_0x24ff16,_0x168b25)=>_0x495816(_0x24ff16['type'])-_0x495816(_0x168b25['type']));}}class Sa extends _0x3cc6c1{static get['requires'](){return[ee,ie,re];}static get['pluginName'](){return'AIReviewMode';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}export{fa as AIActions,q as AIAdapter,Bn as AIAssistant,v as AIAssistantUI,m as AIBalloon,Ea as AIChat,et as AIChatController,st as AIChatHistory,jt as AIChatHistoryController,xt as AIChatHistoryUI,at as AIChatUI,e as AIConnector,a as AIEditing,Ot as AIQuickActionType,wa as AIQuickActions,ii as AIQuickActionsUI,tr as AIRequestError,vs as AIReviewCheck,Cs as AIReviewCheckResult,pr as AIReviewCheckRun,Sa as AIReviewMode,ee as AIReviewModeController,re as AIReviewModeEditing,ie as AIReviewModeUI,ht as AITabs,we as AITextAdapter,Fn as AWSTextAdapter,Wn as OpenAITextAdapter,G as ShowAIAssistantCommand,As as createResizeButton,Kn as getDefaultAICommands};
|
|
23
|
+
import{Plugin as _0x3eae20,Command as Nt,ContextPlugin as _0x56fd8d,Editor as ot}from'@ckeditor/ckeditor5-core/dist/index.js';import{IconCopy as _0x5626d4,IconCheck as _0x1e00d1,IconError as _0x5c16ba,IconSubmit as _0x42e7a3,IconAIHistory as Ht,IconMagicWand as _0x19ff10,IconRobotPencil as _0x4b01ab,IconMaximize as _0x3f6bd3,IconMinimize as _0x4b1253,IconShowChangesOn as _0x3f1054,IconShowChangesOff as _0x4c488e,IconDocument as _0x1599ff,IconThreeStars as _0x3aabf7,IconDocumentWithLoupe as _0x309a77,IconAddComment as _0x250c16,IconRemove as _0x194afd,IconDocumentWithCheckmark as _0xf033eb,IconDocumentWithCross as _0x55ba2b,IconLoupe as _0x17dd57,IconCancel as _0x1ebd11,IconStop as _0x4d6423,IconAIChat as St,IconPlus as _0x2d1cb5,IconPin as _0x304968,IconThreeHorizontalDots as _0x3deff4,IconChevronRight as _0x4f716d,IconInfo as _0x40e4ed,IconEye as _0x29ce6f,IconEyeCrossedOut as _0x3fb5f1,IconAIReview as _0x5b0b4c}from'@ckeditor/ckeditor5-icons/dist/index.js';import{uid as _0x2ef42f,CKEditorError as _0x58ed45,ObservableMixin as ts,global as _0x51d4c0,isVisible as _0x51c3da,Rect as _0x33ad0b,Collection as _0x12a2d7,FocusTracker as _0xc5fc70,KeystrokeHandler as _0x464bf0,first as _0x2f52df,toArray as _0x23c6c8,EmitterMixin as _0x5f2b03,logWarning as _0x2f4ad6,logError as nt,scrollViewportToShowTarget as rt,ResizeObserver as _0xf70da3,_isMotionReduced as At,scrollAncestorsToShowTarget as _0x43a20c,DomEmitterMixin as _0x34a258}from'@ckeditor/ckeditor5-utils/dist/index.js';import{ToolbarView as _0x4b6a32,ButtonView as _0x23128a,View as _0x4118d8,SpinnerView as _0x45ab1d,IconView as _0x2745c1,AutocompleteView as _0x590135,ListView as _0x1626c8,ListItemGroupView as _0x2ae154,ListItemView as _0x470a68,ButtonLabelView as _0x55f519,FocusCycler as _0x53ec2a,createLabeledTextarea as _0x247c44,Dialog as _0x31f025,createDropdown as _0x820be6,addMenuToDropdown as _0x2d2cd2,MenuBarMenuView as _0x94a373,MenuBarMenuListItemButtonView as _0x2ec6d8,DialogViewPosition as _0x26373f,MenuBarMenuListView as _0x118ddd,MenuBarMenuListItemView as _0x5d9250,ViewCollection as _0x260fed,UIModel as _0x18995b,SplitButtonView as _0x49b785,BalloonPanelView as _0xef9d9e,BodyCollection as Wt,clickOutsideHandler as _0x28f439,ListItemButtonView as _0xc86c,addListToDropdown as _0x3b3006,submitHandler as _0x2e5d32,LabeledFieldView as th,createLabeledInputText as _0x1f7057,FormHeaderView as _0x58dd82,HighlightedTextView as _0x39fe79,FileDialogButtonView as _0x1bc2a3,InputTextView as _0x84805a,SearchTextView as _0x313f7a,DropdownMenuButtonView as _0x46204d,DropdownMenuPanelPositioningFunctions as _0x4f453b,BalloonToolbar as Jt,FormRowView as _0x3e9b6c,TextareaView as _0x12ea37}from'@ckeditor/ckeditor5-ui/dist/index.js';import{ClipboardPipeline as _0x255d3e,ClipboardMarkersUtils as _0x178047}from'@ckeditor/ckeditor5-clipboard/dist/index.js';import{ViewDocumentDomEventData as _0x298922,ViewDataTransfer as _0x458c16,ViewUpcastWriter as _0x49c143,Matcher as _0x333f05,ViewDowncastWriter as kt,transformOperationSets as it,_DetachOperation as tt,_insertIntoModelNodeList as _0x44e0c4,_removeFromModelNodeList as _0x5a755a,ModelRange as _0x4924b2,ModelDocumentFragment as _0xc93263,ModelPosition as _0x2aa0a3,ModelTreeWalker as te,InsertOperation as $t,MarkerOperation as Bt}from'@ckeditor/ckeditor5-engine/dist/index.js';import{unescape as _0x423060,escape as _0x397c0d,escapeRegExp as _0x523bea}from'es-toolkit/compat';import{BedrockRuntimeClient as _0xd75fae,InvokeModelWithResponseStreamCommand as _0x27c897,InvokeModelCommand as _0x44f0aa}from'@aws-sdk/client-bedrock-runtime';import{createParser as wt}from'eventsource-parser';import{parseDocument as _0x1fc7d8}from'htmlparser2';import{isTag as _0x37924d,findOne as mt,getParent as _0x540c06,findAll as _0x1906cd,removeElement as _0x55d0bd,replaceElement as _0x17ba01,prepend as _0xd8f6c8,prependChild as to,appendChild as _0x12bd4b,append as _0x106cca,find as _0x20425e,isComment as _0x386a1a,getChildren as _0x2d621f,textContent as _0x2b2a77}from'domutils';import _0x4e6e9a from'dom-serializer';import{Document as _t,Element as _0x4542ca,Text as _0x528111,cloneNode as _0x81e0af,isDocument as _0x171f27,isText as tn,NodeWithChildren as _0x14643b}from'domhandler';import{MarkdownGfmMdToHtml as _0xf7ea17}from'@ckeditor/ckeditor5-markdown-gfm/dist/index.js';import{getAllMarkersDomElementsSorted as _0xd604ec,DocumentCompare as _0x104527,DATA_ID_MODEL_ATTRIBUTE as gt}from'@ckeditor/ckeditor5-collaboration-core/dist/index.js';import{IconThumbUp as _0x1c18b1,IconThumbDown as _0x4a35e4,IconCopy as _0x320ca7,IconCheck as _0xfb4387,IconShowChangesOff as _0x5f7b66,IconShowChangesOn as _0x145b7b,IconWeb as _0xdddffb,IconNextArrow as _0x517bb3,IconPreviousArrow as _0x460602,IconAI as yt,IconClose as _0x20d698,IconSelection as _0x2be13e,IconFileUpload as _0x14f1fb,IconLink as _0x65f42,IconDocument as _0xe98777,IconBulb as _0x1014d8,IconDocumentOutline as _0x15b331,IconPaperClip as _0x1478c1,IconBrowseFiles as _0x4be9f6,IconDropdownArrow as _0x2c91df,IconAIAskAI as Ut,IconAIQuickActions as _0xb3bd09,IconAIChatCommands as Mt,IconAIImproveWriting as Yt,IconAIContinueWriting as Lt,IconAIGrammarCheck as Dt,IconAIAdjustLength as Qt,IconAIChangeTone as Kt,IconAITranslate as Gt,IconAIOther as qt,IconRefresh as _0x4bcc0e}from'@ckeditor/ckeditor5-icons/dist/index.js';import _0xb058cb from'morphdom';import{ConfirmMixin as _0x39c2c3,LateFocusDropdownButtonView as _0x36597b,DocumentCompare as _0x722e36,DATA_ID_VIEW_ATTRIBUTE as _0x702168,DATA_ID_MODEL_ATTRIBUTE as _0x4b206b}from'ckeditor5-collaboration/dist/index.js';import{diffArrays as _0x546d51}from'diff';const K='_ungrouppedCommands';function o(_0x3044e9,_0x53b8e5){const _0x47a70e=(0x0,_0x53b8e5['t'])('Other');return _0x3044e9['length']?'groupId'in _0x3044e9[0x0]?_0x3044e9:[{'groupId':K,'groupLabel':_0x47a70e,'order':0x1/0x0,'commands':_0x3044e9}]:[{'groupId':K,'groupLabel':_0x47a70e,'order':0x1/0x0,'commands':[]}];}const Un=globalThis['DataTransfer'],w='ai-ui';class a extends _0x3eae20{static get['pluginName'](){return'AIAssistantEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const {editor:_0x407a60}=this,_0x504e55=['ck-fake-ai-selection'];_0x407a60['config']['get']('ai.assistant.useTheme')&&_0x504e55['push']('ck-ai-assistant-ui_theme'),_0x407a60['conversion']['for']('editingDowncast')['markerToHighlight']({'model':w,'view':{'classes':_0x504e55,'priority':0xc}}),_0x407a60['conversion']['for']('editingDowncast')['markerToElement']({'model':w,'view':(_0x22ab11,{writer:_0x2d2424})=>{if(!_0x22ab11['markerRange']['isCollapsed'])return null;const _0x2e33db=_0x2d2424['createUIElement']('span');return _0x2d2424['addClass'](['ck-fake-ai-selection','ck-fake-ai-selection_collapsed'],_0x2e33db),_0x2e33db;}});}['afterInit'](){!async function(_0xc3115b){const _0x128b2e=_0x191d3d([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]),_0x459b55=0x3dffc4e1,_0xfb68bc=0x3df8b021^_0x459b55,_0x2c84e3=window[_0x191d3d([0x44,0x61,0x74,0x65])][_0x191d3d([0x6e,0x6f,0x77])](),_0x1eac47=_0xc3115b[_0x191d3d([0x65,0x64,0x69,0x74,0x6f,0x72])],_0x27644a=new window[(_0x191d3d([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x168b21=>{_0x1eac47[_0x191d3d([0x6f,0x6e,0x63,0x65])](_0x191d3d([0x72,0x65,0x61,0x64,0x79]),_0x168b21);}),_0x440144={[_0x191d3d([0x6b,0x74,0x79])]:_0x191d3d([0x45,0x43]),[_0x191d3d([0x75,0x73,0x65])]:_0x191d3d([0x73,0x69,0x67]),[_0x191d3d([0x63,0x72,0x76])]:_0x191d3d([0x50,0x2d,0x32,0x35,0x36]),[_0x191d3d([0x78])]:_0x191d3d([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]),[_0x191d3d([0x79])]:_0x191d3d([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]),[_0x191d3d([0x61,0x6c,0x67])]:_0x191d3d([0x45,0x53,0x32,0x35,0x36])},_0x3d1bde=_0x1eac47[_0x191d3d([0x63,0x6f,0x6e,0x66,0x69,0x67])][_0x191d3d([0x67,0x65,0x74])](_0x191d3d([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79]));async function _0x3a246c(){let _0x94af36,_0x528132=null,_0x39bde3=null;try{if(_0x3d1bde==_0x191d3d([0x47,0x50,0x4c]))return _0x191d3d([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]);if(_0x94af36=_0x16212f(),!_0x94af36)return _0x191d3d([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);return _0x94af36[_0x191d3d([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])]&&(_0x39bde3=_0x5bbc00(_0x94af36[_0x191d3d([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])],_0x94af36[_0x191d3d([0x6a,0x74,0x69])])),await _0x5945b7()?_0x2fad24()?_0x14de6d()?_0x191d3d([0x45,0x78,0x70,0x69,0x72,0x65,0x64]):_0x3fc745()?(_0x94af36[_0x191d3d([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])]==_0x191d3d([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e])&&(_0x528132=_0x2ae622(_0x191d3d([0x45,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e,0x4c,0x69,0x6d,0x69,0x74]))),_0x94af36[_0x191d3d([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])]==_0x191d3d([0x74,0x72,0x69,0x61,0x6c])&&(_0x528132=_0x2ae622(_0x191d3d([0x54,0x72,0x69,0x61,0x6c,0x4c,0x69,0x6d,0x69,0x74]))),await _0xf67435()):_0x191d3d([0x44,0x6f,0x6d,0x61,0x69,0x6e,0x4c,0x69,0x6d,0x69,0x74]):_0x191d3d([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]):_0x191d3d([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}catch{return _0x191d3d([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}function _0x14de6d(){const _0x5c6159=[_0x191d3d([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e]),_0x191d3d([0x74,0x72,0x69,0x61,0x6c])][_0x191d3d([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x94af36[_0x191d3d([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])])?_0x2c84e3/0x3e8:0xe10*_0xfb68bc;return _0x94af36[_0x191d3d([0x65,0x78,0x70])]<_0x5c6159;}function _0x2fad24(){const _0x5db8dc=_0x94af36[_0x191d3d([0x66,0x65,0x61,0x74,0x75,0x72,0x65,0x73])];return!!_0x5db8dc&&(!!_0x5db8dc[_0x191d3d([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x191d3d([0x2a]))||!!_0x5db8dc[_0x191d3d([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x191d3d([0x41,0x49])));}function _0x3fc745(){const _0x3a549d=_0x94af36[_0x191d3d([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x64,0x48,0x6f,0x73,0x74,0x73])];if(!_0x3a549d||0x0==_0x3a549d[_0x191d3d([0x6c,0x65,0x6e,0x67,0x74,0x68])])return!0x0;const {hostname:_0x36170d}=new URL(window[_0x191d3d([0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e])]['href']);if(_0x3a549d[_0x191d3d([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x36170d))return!0x0;const _0x419fc7=_0x36170d[_0x191d3d([0x73,0x70,0x6c,0x69,0x74])](_0x191d3d([0x2e]));return _0x3a549d[_0x191d3d([0x66,0x69,0x6c,0x74,0x65,0x72])](_0x2269b7=>_0x2269b7[_0x191d3d([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x191d3d([0x2a])))[_0x191d3d([0x6d,0x61,0x70])](_0x5e5d5b=>_0x5e5d5b[_0x191d3d([0x73,0x70,0x6c,0x69,0x74])](_0x191d3d([0x2e])))[_0x191d3d([0x66,0x69,0x6c,0x74,0x65,0x72])](_0x183dcc=>_0x183dcc[_0x191d3d([0x6c,0x65,0x6e,0x67,0x74,0x68])]<=_0x419fc7[_0x191d3d([0x6c,0x65,0x6e,0x67,0x74,0x68])])[_0x191d3d([0x6d,0x61,0x70])](_0x311689=>Array(_0x419fc7[_0x191d3d([0x6c,0x65,0x6e,0x67,0x74,0x68])]-_0x311689[_0x191d3d([0x6c,0x65,0x6e,0x67,0x74,0x68])])[_0x191d3d([0x66,0x69,0x6c,0x6c])](_0x311689[0x0]===_0x191d3d([0x2a])?_0x191d3d([0x2a]):'')[_0x191d3d([0x63,0x6f,0x6e,0x63,0x61,0x74])](_0x311689))[_0x191d3d([0x73,0x6f,0x6d,0x65])](_0x180627=>_0x419fc7[_0x191d3d([0x65,0x76,0x65,0x72,0x79])]((_0x10cf79,_0x2620e4)=>_0x180627[_0x2620e4]===_0x10cf79||_0x180627[_0x2620e4]===_0x191d3d([0x2a])));}function _0xf67435(){return _0x528132&&_0x39bde3?new window[(_0x191d3d([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0x63f58,_0x3e9696)=>{_0x528132[_0x191d3d([0x74,0x68,0x65,0x6e])](_0x63f58,_0x3e9696),_0x39bde3[_0x191d3d([0x74,0x68,0x65,0x6e])](_0x17df87=>{_0x17df87!=_0x191d3d([0x56,0x61,0x6c,0x69,0x64])&&_0x63f58(_0x17df87);},_0x3e9696);}):_0x528132||_0x39bde3||_0x191d3d([0x56,0x61,0x6c,0x69,0x64]);}}function _0x5bbc00(_0x59f579,_0x2db3a8){return new window[(_0x191d3d([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x36d8ef=>{if(_0x236883())return _0x36d8ef(_0x191d3d([0x56,0x61,0x6c,0x69,0x64]));_0x441543(),_0x1eac47[_0x191d3d([0x64,0x65,0x63,0x6f,0x72,0x61,0x74,0x65])](_0x191d3d([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]));let _0x4dc981=!0x1;const _0x566db7=_0x2ef42f();function _0x1b9ca5(_0x2637ee){return!!_0x2637ee&&(typeof _0x2637ee===_0x191d3d([0x6f,0x62,0x6a,0x65,0x63,0x74])||typeof _0x2637ee===_0x191d3d([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]))&&typeof _0x2637ee[_0x191d3d([0x74,0x68,0x65,0x6e])]===_0x191d3d([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e])&&typeof _0x2637ee[_0x191d3d([0x63,0x61,0x74,0x63,0x68])]===_0x191d3d([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]);}function _0x26cae1(_0x270dc6){_0xa8b6e6(_0x270dc6)[_0x191d3d([0x74,0x68,0x65,0x6e])](_0x4fbbf0=>{if(!_0x4fbbf0||_0x4fbbf0[_0x191d3d([0x73,0x74,0x61,0x74,0x75,0x73])]!=_0x191d3d([0x6f,0x6b]))return _0x191d3d([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]);return _0x29ad3c(_0x5c491b(_0x566db7+_0x2db3a8))!=_0x4fbbf0[_0x191d3d([0x76,0x65,0x72,0x69,0x66,0x69,0x63,0x61,0x74,0x69,0x6f,0x6e])]?_0x191d3d([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]):_0x191d3d([0x56,0x61,0x6c,0x69,0x64]);})[_0x191d3d([0x74,0x68,0x65,0x6e])](_0x164b80=>(_0x287647(),_0x164b80),()=>{const _0x1cd438=_0x26d209();return null==_0x1cd438?(_0x287647(),_0x191d3d([0x56,0x61,0x6c,0x69,0x64])):_0x191d3d(_0x2c84e3-_0x1cd438>(0x19f340e1^_0x459b55)?[0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]:[0x56,0x61,0x6c,0x69,0x64]);})[_0x191d3d([0x74,0x68,0x65,0x6e])](_0x36d8ef)[_0x191d3d([0x63,0x61,0x74,0x63,0x68])](()=>{_0x36d8ef(_0x191d3d([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});const _0x316b7e=0x3dc92a61^_0x459b55;function _0x287647(){const _0x917a89=_0x191d3d([0x6c,0x6c,0x63,0x74,0x2d])+_0x29ad3c(_0x5c491b(_0x59f579)),_0x416bc0=_0x3bed32(_0x29ad3c(window[_0x191d3d([0x4d,0x61,0x74,0x68])][_0x191d3d([0x63,0x65,0x69,0x6c])](_0x2c84e3/_0x316b7e)));window[_0x191d3d([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0x191d3d([0x73,0x65,0x74,0x49,0x74,0x65,0x6d])](_0x917a89,_0x416bc0);}function _0x26d209(){const _0x51b888=_0x191d3d([0x6c,0x6c,0x63,0x74,0x2d])+_0x29ad3c(_0x5c491b(_0x59f579)),_0x458e44=window[_0x191d3d([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0x191d3d([0x67,0x65,0x74,0x49,0x74,0x65,0x6d])](_0x51b888);return _0x458e44?window[_0x191d3d([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x3bed32(_0x458e44),0x10)*_0x316b7e:null;}function _0xa8b6e6(_0x7c8196){return new window[(_0x191d3d([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0x2446b6,_0xece941)=>{_0x7c8196[_0x191d3d([0x74,0x68,0x65,0x6e])](_0x2446b6,_0xece941),window[_0x191d3d([0x73,0x65,0x74,0x54,0x69,0x6d,0x65,0x6f,0x75,0x74])](_0xece941,0x3dfe1021^_0x459b55);});}}_0x1eac47[_0x191d3d([0x6f,0x6e])](_0x191d3d([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),(_0x1e4520,_0x2a2ede)=>{if(_0x2a2ede[0x0]!=_0x59f579)return _0x36d8ef(_0x191d3d([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));_0x2a2ede[0x1]={..._0x2a2ede[0x1],[_0x191d3d([0x72,0x65,0x71,0x75,0x65,0x73,0x74,0x49,0x64])]:_0x566db7};},{[_0x191d3d([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0x191d3d([0x68,0x69,0x67,0x68])}),_0x1eac47[_0x191d3d([0x6f,0x6e])](_0x191d3d([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),_0x542210=>{_0x1b9ca5(_0x542210[_0x191d3d([0x72,0x65,0x74,0x75,0x72,0x6e])])&&(_0x4dc981=!0x0,_0x26cae1(_0x542210[_0x191d3d([0x72,0x65,0x74,0x75,0x72,0x6e])]));},{[_0x191d3d([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0x191d3d([0x6c,0x6f,0x77])}),_0x27644a[_0x191d3d([0x74,0x68,0x65,0x6e])](()=>{_0x4dc981||_0x36d8ef(_0x191d3d([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});});function _0x236883(){return _0x1eac47[_0x191d3d([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0x191d3d([0x76,0x69,0x65,0x77])][_0x191d3d([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]==_0x191d3d([0x61,0x75,0x74,0x6f]);}function _0x441543(){_0x1eac47[_0x191d3d([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0x191d3d([0x76,0x69,0x65,0x77])][_0x191d3d([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]=_0x191d3d([0x61,0x75,0x74,0x6f]);}}function _0x2ae622(_0x234779){const _0x3df3c2=[new window[(_0x191d3d([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x4bcab5=>setTimeout(_0x4bcab5,0x3df6fa2d^_0x459b55)),_0x27644a[_0x191d3d([0x74,0x68,0x65,0x6e])](()=>new window[(_0x191d3d([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x32a698=>{let _0x1e3385=0x0;_0x1eac47[_0x191d3d([0x6d,0x6f,0x64,0x65,0x6c])][_0x191d3d([0x6f,0x6e])](_0x191d3d([0x61,0x70,0x70,0x6c,0x79,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e]),(_0x3725ca,_0x322236)=>{_0x322236[0x0][_0x191d3d([0x69,0x73,0x44,0x6f,0x63,0x75,0x6d,0x65,0x6e,0x74,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e])]&&_0x1e3385++,_0x1e3385==(0x3dffc519^_0x459b55)&&(_0x32a698(),_0x3725ca[_0x191d3d([0x6f,0x66,0x66])]());});}))];return window[_0x191d3d([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65])][_0x191d3d([0x72,0x61,0x63,0x65])](_0x3df3c2)[_0x191d3d([0x74,0x68,0x65,0x6e])](()=>_0x234779);}async function _0x1d6ea2(){await _0x27644a,_0x1eac47[_0x191d3d([0x6d,0x6f,0x64,0x65,0x6c])][_0x191d3d([0x63,0x68,0x61,0x6e,0x67,0x65])]=_0x994312,_0x1eac47[_0x191d3d([0x6d,0x6f,0x64,0x65,0x6c])][_0x191d3d([0x65,0x6e,0x71,0x75,0x65,0x75,0x65,0x43,0x68,0x61,0x6e,0x67,0x65])]=_0x994312,_0x1eac47[_0x191d3d([0x65,0x6e,0x61,0x62,0x6c,0x65,0x52,0x65,0x61,0x64,0x4f,0x6e,0x6c,0x79,0x4d,0x6f,0x64,0x65])](_0x191d3d([0x6d,0x6f,0x64,0x65,0x6c]));}function _0x4f81c3(_0x26c04d){const _0x8022b=_0x270cdd();_0x1eac47[_0x8022b]=_0x191d3d([0x61,0x69,0x4c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79])+_0x26c04d,_0x26c04d!=_0x191d3d([0x56,0x61,0x6c,0x69,0x64])&&_0x1d6ea2();}function _0x270cdd(){const _0x1d4902=window[_0x191d3d([0x53,0x74,0x72,0x69,0x6e,0x67])](window[_0x191d3d([0x70,0x65,0x72,0x66,0x6f,0x72,0x6d,0x61,0x6e,0x63,0x65])][_0x191d3d([0x6e,0x6f,0x77])]())[_0x191d3d([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](_0x191d3d([0x2e]),'');let _0x3457a0=_0x191d3d([0x6e]);for(let _0xc29ef1=0x0;_0xc29ef1<_0x1d4902[_0x191d3d([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0xc29ef1+=0x2){let _0x37fddf=window[_0x191d3d([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x1d4902[_0x191d3d([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0xc29ef1,_0xc29ef1+0x2));_0x37fddf>=_0x128b2e[_0x191d3d([0x6c,0x65,0x6e,0x67,0x74,0x68])]&&(_0x37fddf-=_0x128b2e[_0x191d3d([0x6c,0x65,0x6e,0x67,0x74,0x68])]),_0x3457a0+=_0x128b2e[_0x37fddf];}return _0x3457a0;}function _0x16212f(){const _0x5f7891=_0x3d1bde[_0x191d3d([0x73,0x70,0x6c,0x69,0x74])](_0x191d3d([0x2e]));if(0x3!=_0x5f7891[_0x191d3d([0x6c,0x65,0x6e,0x67,0x74,0x68])])return null;return _0x4a6aa4(_0x5f7891[0x1]);function _0x4a6aa4(_0x1c48fe){const _0x4d9dd1=_0x24a02a(_0x1c48fe);return _0x4d9dd1&&_0x18a60a()?_0x4d9dd1:null;function _0x18a60a(){const _0x10877a=_0x4d9dd1[_0x191d3d([0x6a,0x74,0x69])],_0x182f52=window[_0x191d3d([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x10877a[_0x191d3d([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0x10877a[_0x191d3d([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8),0x10),_0x445795={..._0x4d9dd1,[_0x191d3d([0x6a,0x74,0x69])]:_0x10877a[_0x191d3d([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](0x0,_0x10877a[_0x191d3d([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8)};return delete _0x445795[_0x191d3d([0x76,0x63])],_0x5c491b(_0x445795)==_0x182f52;}}}async function _0x5945b7(){let _0x42603b=!0x0;try{const _0x4bbb02=_0x3d1bde[_0x191d3d([0x73,0x70,0x6c,0x69,0x74])](_0x191d3d([0x2e])),[_0xf8cf8d,_0x35e5bd,_0x1b75e2]=_0x4bbb02;return _0x9298c6(_0xf8cf8d),await _0x53f764(_0xf8cf8d,_0x35e5bd,_0x1b75e2),_0x42603b;}catch{return!0x1;}function _0x9298c6(_0x2d0fc4){const _0x4b2889=_0x24a02a(_0x2d0fc4);_0x4b2889&&_0x4b2889[_0x191d3d([0x61,0x6c,0x67])]==_0x191d3d([0x45,0x53,0x32,0x35,0x36])||(_0x42603b=!0x1);}async function _0x53f764(_0x55f328,_0x49d5e2,_0x544e29){const _0x28cc7e=window[_0x191d3d([0x55,0x69,0x6e,0x74,0x38,0x41,0x72,0x72,0x61,0x79])][_0x191d3d([0x66,0x72,0x6f,0x6d])](_0x216215(_0x544e29),_0x5923ca=>_0x5923ca[_0x191d3d([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](0x0)),_0x32024f=new window[(_0x191d3d([0x54,0x65,0x78,0x74,0x45,0x6e,0x63,0x6f,0x64,0x65,0x72]))]()[_0x191d3d([0x65,0x6e,0x63,0x6f,0x64,0x65])](_0x55f328+_0x191d3d([0x2e])+_0x49d5e2),_0x34ee9a=window[_0x191d3d([0x63,0x72,0x79,0x70,0x74,0x6f])][_0x191d3d([0x73,0x75,0x62,0x74,0x6c,0x65])];if(!_0x34ee9a)return;const _0x23d8a0=await _0x34ee9a[_0x191d3d([0x69,0x6d,0x70,0x6f,0x72,0x74,0x4b,0x65,0x79])](_0x191d3d([0x6a,0x77,0x6b]),_0x440144,{[_0x191d3d([0x6e,0x61,0x6d,0x65])]:_0x191d3d([0x45,0x43,0x44,0x53,0x41]),[_0x191d3d([0x6e,0x61,0x6d,0x65,0x64,0x43,0x75,0x72,0x76,0x65])]:_0x191d3d([0x50,0x2d,0x32,0x35,0x36])},!0x1,[_0x191d3d([0x76,0x65,0x72,0x69,0x66,0x79])]);await _0x34ee9a[_0x191d3d([0x76,0x65,0x72,0x69,0x66,0x79])]({[_0x191d3d([0x6e,0x61,0x6d,0x65])]:_0x191d3d([0x45,0x43,0x44,0x53,0x41]),[_0x191d3d([0x68,0x61,0x73,0x68])]:{[_0x191d3d([0x6e,0x61,0x6d,0x65])]:_0x191d3d([0x53,0x48,0x41,0x2d,0x32,0x35,0x36])}},_0x23d8a0,_0x28cc7e,_0x32024f)||(_0x42603b=!0x1);}}function _0x24a02a(_0x1acbd5){return _0x1acbd5[_0x191d3d([0x73,0x74,0x61,0x72,0x74,0x73,0x57,0x69,0x74,0x68])](_0x191d3d([0x65,0x79]))?JSON[_0x191d3d([0x70,0x61,0x72,0x73,0x65])](_0x216215(_0x1acbd5)):null;}function _0x216215(_0x45fe09){return window[_0x191d3d([0x61,0x74,0x6f,0x62])](_0x45fe09[_0x191d3d([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/-/g,_0x191d3d([0x2b]))[_0x191d3d([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/_/g,_0x191d3d([0x2f])));}function _0x5c491b(_0x5713d2){let _0x2df7fa=0x1505;function _0x3eecc3(_0x47a349){for(let _0x1a44f8=0x0;_0x1a44f8<_0x47a349[_0x191d3d([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0x1a44f8++){const _0x42a6d3=_0x47a349[_0x191d3d([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](_0x1a44f8);_0x2df7fa=(_0x2df7fa<<0x5)+_0x2df7fa+_0x42a6d3,_0x2df7fa&=_0x2df7fa;}}function _0x814c0(_0xf86113){Array[_0x191d3d([0x69,0x73,0x41,0x72,0x72,0x61,0x79])](_0xf86113)?_0xf86113[_0x191d3d([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](_0x814c0):_0xf86113&&typeof _0xf86113==_0x191d3d([0x6f,0x62,0x6a,0x65,0x63,0x74])?Object[_0x191d3d([0x65,0x6e,0x74,0x72,0x69,0x65,0x73])](_0xf86113)[_0x191d3d([0x73,0x6f,0x72,0x74])]()[_0x191d3d([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](([_0x535788,_0x7c4d88])=>{_0x3eecc3(_0x535788),_0x814c0(_0x7c4d88);}):_0x3eecc3(window[_0x191d3d([0x53,0x74,0x72,0x69,0x6e,0x67])](_0xf86113));}return _0x814c0(_0x5713d2),_0x2df7fa>>>0x0;}function _0x29ad3c(_0x2b3d73){return _0x2b3d73[_0x191d3d([0x74,0x6f,0x53,0x74,0x72,0x69,0x6e,0x67])](0x10)[_0x191d3d([0x70,0x61,0x64,0x53,0x74,0x61,0x72,0x74])](0x8,_0x191d3d([0x30]));}function _0x3bed32(_0x2c2a1d){return _0x2c2a1d[_0x191d3d([0x73,0x70,0x6c,0x69,0x74])]('')[_0x191d3d([0x72,0x65,0x76,0x65,0x72,0x73,0x65])]()[_0x191d3d([0x6a,0x6f,0x69,0x6e])]('');}function _0x994312(){}function _0x191d3d(_0x1fa7ca){return _0x1fa7ca['map'](_0x3069b7=>String['fromCharCode'](_0x3069b7))['join']('');}_0x4f81c3(await _0x3a246c());}(this);}['showFakeVisualSelection'](){const _0x5d6b0a=this['editor']['model'];_0x5d6b0a['change'](_0x39a160=>{const _0x13ac4e=_0x5d6b0a['document']['selection']['getRanges']();let _0x4f8511=0x0;for(const _0x3b74cd of _0x13ac4e){const _0xd2634f=w+':'+_0x4f8511;if(_0x5d6b0a['markers']['has'](_0xd2634f))_0x39a160['updateMarker'](_0xd2634f,{'range':_0x3b74cd});else{if(_0x3b74cd['start']['isAtEnd']){const _0x44c346=_0x3b74cd['start']['getLastMatchingPosition'](({item:_0x525f57})=>!_0x5d6b0a['schema']['isContent'](_0x525f57),{'boundaries':_0x3b74cd});_0x39a160['addMarker'](_0xd2634f,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x39a160['createRange'](_0x44c346,_0x3b74cd['end'])});}else _0x39a160['addMarker'](_0xd2634f,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x3b74cd});}_0x4f8511++;}});}['hideFakeVisualSelection'](){const _0x311bae=this['editor']['model'],_0x12939b=Array['from'](this['editor']['model']['markers']['getMarkersGroup'](w));_0x12939b['length']&&_0x311bae['change'](_0x7c623d=>{_0x12939b['forEach'](_0x4f2400=>{_0x7c623d['removeMarker'](_0x4f2400);});});}['insertContent'](_0x1f764f,_0x48ea1f){const _0x5ec81d=this['_getAISelection'](),_0x3098f1=_0x48ea1f||_0x5ec81d['getFirstRange']();this['editor']['model']['canEditAt'](_0x3098f1)&&this['editor']['model']['change'](_0x4ed360=>{this['hideFakeVisualSelection'](),_0x48ea1f||this['_resetContentOfSelectedTableCells'](_0x4ed360,_0x5ec81d),this['_pasteHTMLUsingClipboard']({'insertAt':_0x3098f1,'writer':_0x4ed360,'html':_0x1f764f});});}['insertContentBelow'](_0x2765d7){const {model:_0x50acb0}=this['editor'],_0x2d3620=this['_getAISelection']();_0x50acb0['change'](()=>{const _0x443c85=this['_prepareTableInsertBelowPosition'](_0x2765d7,_0x2d3620)||this['_getDefaultInsertBelowPosition'](_0x2d3620);this['insertContent'](_0x2765d7,_0x443c85);});}['_getAISelection'](){const _0x10d575=this['editor']['model'],_0x167cc1=Array['from'](_0x10d575['markers']['getMarkersGroup'](w))['map'](_0xb8042e=>_0xb8042e['getRange']());return _0x10d575['createSelection'](_0x167cc1);}['_pasteHTMLUsingClipboard']({writer:_0x276caf,html:_0x1caa00,insertAt:_0x212d5b}){const {view:_0x972946}=this['editor']['editing'],_0x3237c8=this['editor']['plugins']['get'](_0x255d3e),_0x5a123e=new Un();_0x5a123e['setData']('text/html',_0x1caa00);const _0x2714c6=new ClipboardEvent('paste',{'clipboardData':_0x5a123e}),_0x57f600=new _0x298922(_0x972946,_0x2714c6,{'dataTransfer':new _0x458c16(_0x5a123e)});_0x276caf['setSelection'](_0x212d5b);const _0x18a476=(_0x8a1b0a,_0x40800e)=>{_0x40800e['resultRange']&&_0x276caf['setSelection'](_0x40800e['resultRange']);};_0x3237c8['once']('contentInsertion',_0x18a476,{'priority':'lowest'}),_0x972946['document']['fire']('paste',_0x57f600),_0x3237c8['off']('contentInsertion',_0x18a476);}['_getDefaultInsertBelowPosition'](_0x3a1bd3){const {model:_0x1bcdbe}=this['editor'],_0x274ec7=Array['from'](_0x3a1bd3['getSelectedBlocks']());return _0x274ec7['length']?_0x1bcdbe['createPositionAfter'](_0x274ec7['pop']()):_0x3a1bd3['getLastPosition']();}['_prepareTableInsertBelowPosition'](_0x18ca68,_0x570907){const {model:_0x33643b,plugins:_0x253dcd}=this['editor'];if(_0x253dcd['has']('TableUtils')){const _0x676507=_0x253dcd['get']('TableUtils')['getSelectedTableCells'](_0x570907);if(_0x676507['length']){const _0x22381d=this['_getTableRowCountFromContent'](_0x18ca68),_0x2cfca0=this['_createEmptyTableRows'](_0x676507,_0x22381d);return _0x33643b['createPositionAt'](_0x2cfca0,0x0);}}return null;}['_getTableRowCountFromContent'](_0x5caccb){const _0x4482b7=this['editor']['plugins']['get']('TableUtils'),_0x27c81e=this['editor']['data']['parse'](_0x5caccb),_0x1a7a05=Array['from'](_0x27c81e['getChildren']())['filter'](_0x1c5503=>_0x1c5503['is']('element','table'));let _0x4f16d0=0x0;return _0x1a7a05['forEach'](_0x3e34b0=>{_0x4f16d0+=_0x4482b7['getRows'](_0x3e34b0);}),_0x4f16d0;}['_createEmptyTableRows'](_0x356e33,_0x1d2635){const _0x1bc090=this['editor']['plugins']['get']('TableUtils'),_0x2be72f=_0x1bc090['getRowIndexes'](_0x356e33),_0x376f64=_0x1bc090['getColumnIndexes'](_0x356e33),_0x30803a=_0x2be72f['last']+0x1,_0x41acd7=_0x376f64['first'],_0x286d65=_0x356e33[0x0]['findAncestor']('table');for(let _0x46e888=0x0;_0x46e888<_0x1d2635;_0x46e888++)_0x1bc090['insertRows'](_0x286d65,{'at':_0x30803a});return _0x286d65['getChild'](_0x30803a)['getChild'](_0x41acd7);}['_resetContentOfSelectedTableCells'](_0x420625,_0x49eecd){const {plugins:_0x128aa3}=this['editor'],{model:_0xfd169e}=_0x420625;if(!_0x128aa3['has']('TableUtils'))return;_0x128aa3['get']('TableUtils')['getSelectedTableCells'](_0x49eecd)['length']&&_0xfd169e['deleteContent'](_0x49eecd);}}class x extends _0x3eae20{static get['pluginName'](){return'AIAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['afterInit'](){if(!this['textAdapter'])throw new _0x58ed45('aiadapter-text-adapter-not-set',null);}}class tr extends Error{constructor(_0x4f8702){super(_0x4f8702),this['name']='AIRequestError';}}function Vn(_0x5b462a,_0x474b21,_0x4fc644){const t=_0x5b462a['t'];switch(_0x474b21){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',_0x4fc644);case'Error\x20during\x20AI\x20content\x20generation:\x20%0':return t('Error\x20during\x20AI\x20content\x20generation:\x20%0',_0x4fc644);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'},_0x4fc644);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 _0x474b21;}}class E extends Nt{['_commandDefinitions'];constructor(_0x5b9cac,_0x241b05){super(_0x5b9cac),this['_commandDefinitions']=_0x241b05,this['set']('enabledCommandsIds',[]),this['on']('change:_hasContext',(_0x33fb5d,_0x5996d2,_0x424517)=>{this['isEnabled']&&(this['enabledCommandsIds']=ns(this['_commandDefinitions'],_0x424517));}),this['set']('_hasContext',!0x1),this['on']('change:isEnabled',(_0x5b41ee,_0x8c23cd,_0x4990c3)=>{this['enabledCommandsIds']=_0x4990c3?ns(this['_commandDefinitions'],this['_hasContext']):[];});}['refresh'](){const _0x5affef=this['editor']['model'];this['_hasContext']=function(_0x506c24){const _0x3ebb6b=_0x506c24['document']['selection'];return _0x3ebb6b['isCollapsed']?0x0!==[..._0x3ebb6b['getSelectedBlocks']()]['length']&&![..._0x3ebb6b['getSelectedBlocks']()][0x0]['isEmpty']:!!_0x506c24['hasContent'](_0x3ebb6b['getFirstRange']());}(_0x5affef);const _0xaf2234=_0x5affef['document']['selection'],_0x3431f8=this['editor']['config']['get']('ai.assistant.disabledElements');for(const _0x19dd8b of _0xaf2234['getRanges']())for(const _0x11dd79 of _0x19dd8b['getItems']())if(_0x11dd79['is']('element')&&_0x3431f8['includes'](_0x11dd79['name']))return void(this['isEnabled']=!0x1);this['isEnabled']=!0x0;}['execute'](_0x177d9b='',_0x51814a='',_0x3d4b91='custom'){this['editor']['plugins']['get'](n)['showUI'](_0x177d9b,_0x51814a,_0x3d4b91);}}function ns(_0x5e069a,_0x411f52){const _0x335a52=new Set();for(const _0x1baf24 of _0x5e069a['values']())(_0x411f52||!0x1===_0x1baf24['requiresContent'])&&_0x335a52['add'](_0x1baf24['id']);return Array['from'](_0x335a52);}const hs=new RegExp(/^(.*?)<[a-zA-Z][a-zA-Z0-9_\-.]*[ >]/,'is');class j extends/* #__PURE__ -- @preserve */
|
|
24
|
+
ts(){['editor'];['textAdapter'];['view'];['_sanitizationContainer'];['_domParser'];['_xmlSerializer'];constructor(_0x21469d,_0x18a602,_0x31d375){super(),this['editor']=_0x21469d,this['textAdapter']=_0x18a602,this['_sanitizationContainer']=document['createElement']('div'),this['_domParser']=new DOMParser(),this['_xmlSerializer']=new XMLSerializer(),this['view']=_0x31d375,this['set']({'initialContext':'','currentContext':'','currentResponse':'','previousContext':void 0x0,'previousQuery':void 0x0,'previousLabel':void 0x0,'isProcessing':!0x1}),this['on']('set:currentContext',(_0x40a184,_0x1f2621,_0x469fd1)=>{this['view']['value']=this['_sanitizeHTML'](_0x469fd1);}),this['listenTo'](this['view'],'submitPrompt',(_0x364e44,_0x31eae5)=>{const _0x59844e=this['currentContext']||this['initialContext'];this['_handleQuery'](_0x31eae5,_0x59844e,'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:_0x5c3a9e,query:_0x116189,htmlContent:_0x5269cc,label:_0x402cc6,mainActionLabel:_0x10ad6e}){this['view']['prompt']=_0x402cc6,this['view']['mainAction']=_0x10ad6e,this['initialContext']=_0x5269cc,_0x116189&&(this['view']['isRendered']?this['_handleQuery'](_0x116189,_0x5269cc,_0x5c3a9e,_0x402cc6):this['view']['once']('render',()=>{this['_handleQuery'](_0x116189,_0x5269cc,_0x5c3a9e,_0x402cc6);}));}['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'](_0x1975ba,_0x656eeb,_0x23001d,_0x501a62){return this['isProcessing']=!0x0,this['view']['startProcessing'](),this['previousContext']=_0x656eeb,this['previousQuery']=_0x1975ba,this['previousLabel']=_0x501a62||_0x1975ba,this['previousActionId']=_0x23001d,new Promise(_0x1b4cf4=>{this['textAdapter']['makeRequest']({'query':_0x1975ba,'context':_0x656eeb,'onData':_0x1363bf=>{this['currentResponse']=_0x1363bf,this['currentContext']=this['_parseAndNormalizeContent'](this['currentResponse']);},'actionId':_0x23001d})['then'](()=>{!this['currentContext']&&this['currentResponse']&&(this['currentContext']=this['_parseAndNormalizeContent'](this['currentResponse'],!0x0));})['catch'](_0x40caff=>{_0x40caff instanceof tr?this['view']['handleError'](_0x40caff['message']):this['view']['handleError'](),_0x1b4cf4();})['finally'](()=>{this['stopProcessing'](),_0x1b4cf4();});});}['_parseAndNormalizeContent'](_0x48917e,_0x50e72d=!0x1){const _0x2e9b98=hs['exec'](_0x48917e);_0x48917e=_0x2e9b98?_0x48917e['substring'](_0x2e9b98[0x1]['length']):_0x48917e['length']<0x64&&!_0x50e72d?'':this['_stripMarkdownSyntax'](_0x48917e);const _0x4a6c72=this['_domParser']['parseFromString'](_0x48917e,'text/html');if(_0x2e9b98){const _0x6b9f0=Array['from'](_0x4a6c72['body']['childNodes']);_0x6b9f0['reverse']();for(const _0x1a15f6 of _0x6b9f0){if(_0x1a15f6['nodeType']==Node['ELEMENT_NODE'])break;_0x1a15f6['remove']();}}const _0x447304=this['editor']['data']['processor']['toView'](this['_xmlSerializer']['serializeToString'](_0x4a6c72['body']));this['_isH1TagSupportEnabled']()||this['_normalizeResponseHeadings'](_0x447304);const _0x2ee592=this['editor']['config']['get']('ai.assistant.preserveComments'),_0x264a68=this['editor']['data']['toModel'](_0x447304);return _0x2ee592||_0x264a68['markers']['clear'](),this['editor']['data']['stringify'](_0x264a68);}['_normalizeResponseHeadings'](_0x423dc9){const _0x462bbd=new _0x49c143(this['editor']['editing']['view']['document']),_0x3beb97=new _0x333f05({'name':/^h[1-5]$/}),_0x2c1fd3=[];let _0x39c822=!0x1;for(const _0x57be3b of _0x423dc9)_0x57be3b['is']('element')&&_0x3beb97['match'](_0x57be3b)&&(_0x2c1fd3['push'](_0x57be3b),'h1'==_0x57be3b['name']&&(_0x39c822=!0x0));if(_0x39c822){for(const _0x267066 of _0x2c1fd3)_0x462bbd['rename']('h'+(parseInt(_0x267066['name'][0x1])+0x1),_0x267066);}}['_isH1TagSupportEnabled'](){const {data:_0x3e0b0d,editing:_0x4dc687}=this['editor'],_0xe47bfe=_0x3e0b0d['htmlProcessor']['toView']('<h1></h1>'),_0x161a47=_0x3e0b0d['toView'](_0x3e0b0d['toModel'](_0xe47bfe));return!!_0x4dc687['view']['domConverter']['viewToDom'](_0x161a47)['querySelector']('h1');}['_sanitizeHTML'](_0x4e7a02){return this['editor']['editing']['view']['domConverter']['setContentOf'](this['_sanitizationContainer'],_0x4e7a02),this['_sanitizationContainer']['innerHTML'];}['_stripMarkdownSyntax'](_0x100506){const _0x1cbb52=_0x100506['trim']();return _0x1cbb52['startsWith']('```html')?_0x1cbb52['endsWith']('```')?_0x1cbb52['substring'](0x7,_0x1cbb52['length']-0x3):_0x1cbb52['substring'](0x7):_0x100506;}}const _={'REPLACE':'replace','INSERT':'insert'};class wr extends _0x4b6a32{constructor(_0x375da6){super(_0x375da6),this['set']('isVisible',!0x1),this['set']('mainAction',_['REPLACE']),this['replaceButton']=this['_createButton']('','ck-button-action'),this['replaceButton']['bind']('label')['to'](this,'mainAction',_0x4f7626=>Vn(_0x375da6,'AI_'+_0x4f7626['toUpperCase']()+'_CONTENT')),this['insertButton']=this['_createButton'](Vn(_0x375da6,'Insert\x20below')),this['tryAgainButton']=this['_createButton'](Vn(_0x375da6,'Try\x20again')),this['stopButton']=this['_createButton'](Vn(_0x375da6,'Stop'));const _0x109b0d=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':['ck-ai-form__toolbar',_0x109b0d['if']('isVisible','ck-hidden',_0x27e712=>!_0x27e712)]}}),this['items']['addMany']([this['replaceButton'],this['insertButton'],this['tryAgainButton'],this['stopButton']]);}['_createButton'](_0x2d7f19,_0x485fed){const _0x5e4c45=new _0x23128a(this['locale']);return _0x5e4c45['set']({'label':_0x2d7f19,'class':_0x485fed||'','isVisible':!0x0,'withText':!0x0}),_0x5e4c45;}}class yr extends _0x4118d8{['contentFieldView'];['copyButtonView'];constructor(_0x38a453,_0x58e6e2=''){super(_0x38a453),this['set']({'value':null,'isVisible':!0x1,'isProcessing':!0x1});const _0x3d1c0f=this['bindTemplate'];this['contentFieldView']=new Bn(_0x38a453,_0x58e6e2),this['copyButtonView']=this['_createCopyButton'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area-wrapper',_0x3d1c0f['if']('isVisible','ck-hidden',_0x2879d7=>!_0x2879d7)],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area',_0x3d1c0f['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 _0xcfb3fb=!0x1;this['on']('change:value',(_0x27cb98,_0x2ae434,_0x2f82a6)=>{const _0x1e62cb=!this['contentFieldView']['element']['querySelector']('.ck-ai-form__loader');this['contentFieldView']['setContent'](_0x2f82a6),this['isProcessing']&&_0x1e62cb&&!_0xcfb3fb&&this['element']['scrollTo']({'top':this['element']['scrollHeight'],'behavior':'smooth'});}),this['on']('change:isProcessing',(_0x5bff99,_0x54a2c5,_0x535e68)=>{_0xcfb3fb=!0x1,_0x535e68?(this['value']=null,this['contentFieldView']['appendLoader']()):this['value']||this['contentFieldView']['setContent']('');}),this['listenTo'](this['element'],'wheel',()=>{_0xcfb3fb=!0x0;}),this['listenTo'](this['element'],'mousedown',()=>{_0xcfb3fb=!0x0;});}['focus'](){this['element']['focus']();}['_createCopyButton'](){const _0x16428a=this['locale'],_0x2f92a9=new _0x23128a(this['locale']),_0x40921f='ck-ai-form__copy-button';return _0x2f92a9['set']({'label':Vn(_0x16428a,'Copy'),'icon':_0x5626d4,'class':_0x40921f,'tooltip':!0x0}),_0x2f92a9['bind']('isVisible')['to'](this,'value',_0x1552da=>!!_0x1552da),_0x2f92a9['bind']('isEnabled')['to'](this,'isProcessing',_0x183e26=>!_0x183e26),_0x2f92a9['on']('execute',()=>{this['_copyHTMLToClipboard'](this['contentFieldView']['element']),_0x2f92a9['icon']=_0x1e00d1,_0x2f92a9['class']=_0x40921f+'\x20ck-ai-form__copy-button--copied',this['focus'](),setTimeout(()=>{_0x2f92a9['icon']=_0x5626d4,_0x2f92a9['class']=_0x40921f;},0x3e8);}),_0x2f92a9;}['_copyHTMLToClipboard'](_0x2369c7){const {window:_0x4943d6,document:_0x5518a9}=_0x51d4c0;if(_0x4943d6['ClipboardItem']){const {Blob:_0x43844c,ClipboardItem:_0xf93daa}=_0x4943d6,_0x1a13b2=[new _0xf93daa({'text/html':new _0x43844c([_0x2369c7['innerHTML']],{'type':'text/html'}),'text/plain':new _0x43844c([_0x2369c7['textContent']||''],{'type':'text/plain'})})];navigator['clipboard']['write'](_0x1a13b2);}else{const _0x5436c0=_0x5518a9['createElement']('div');_0x5436c0['style']['position']='absolute',_0x5436c0['style']['left']='-9999px',_0x5436c0['innerHTML']='<span>[</span>'+_0x2369c7['innerHTML']+'<span>]</span>',_0x5518a9['body']['appendChild'](_0x5436c0);const _0x46a95e=_0x5518a9['createRange']();_0x46a95e['setStartAfter'](_0x5436c0['firstElementChild']),_0x46a95e['setEndBefore'](_0x5436c0['lastElementChild']);const _0x18a360=_0x4943d6['getSelection']();_0x18a360['removeAllRanges'](),_0x18a360['addRange'](_0x46a95e),_0x5518a9['execCommand']('copy'),_0x5436c0['remove']();}}}class Bn extends _0x4118d8{constructor(_0xb6ad53,_0x17d950=''){super(_0xb6ad53),this['loaderView']=this['_createLoader'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-content',_0x17d950,'ck-reset_all-excluded','ck-ai-form__content-field']}});}['setContent'](_0x12a6c2){this['element']['innerHTML']=_0x12a6c2;}['appendLoader'](){this['element']['appendChild'](this['loaderView']['element']);}['_createLoader'](){const _0x359b06=new _0x4118d8(),_0x3407e1=this['locale'],_0x321f1b=new _0x45ab1d();return _0x321f1b['isVisible']=!0x0,_0x359b06['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__loader']},'children':[_0x321f1b,{'text':Vn(_0x3407e1,'AI\x20is\x20writing...')}]}),_0x359b06['render'](),_0x359b06;}}class gr extends _0x4118d8{constructor(_0x5e8232,_0x53dcc0=''){super(_0x5e8232);const _0x3d7b72=new _0x2745c1(),_0xec4c9b=this['bindTemplate'];this['set']('text',_0x53dcc0),_0x3d7b72['content']=_0x5c16ba,this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__error']},'children':[_0x3d7b72,{'text':_0xec4c9b['to']('text')}]});}}class Er extends _0x590135{['submitButtonView'];['showHistoryButtonView'];constructor(_0x40ca7f,_0x200bab){super(_0x40ca7f,_0x200bab),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',(_0x482c1f,_0x1e4d27)=>{_0x482c1f['target']==this['queryView']['fieldView']['element']&&(this['submit'](),_0x1e4d27());});}['_createSubmitButton'](){const _0x56c366=new _0x23128a(this['locale']),_0x242f5f=this['locale'];return _0x56c366['set']({'icon':_0x42e7a3,'label':Vn(_0x242f5f,'Submit'),'isVisible':!0x0,'tooltip':!0x0,'class':'ck-ai-form__submit'}),_0x56c366['on']('execute',()=>{this['submit']();}),_0x56c366['bind']('isEnabled')['to'](this['queryView']['fieldView'],'isEmpty',this,'isEnabled',(_0x382188,_0x4167f6)=>!_0x382188&&_0x4167f6),_0x56c366;}['_createShowHistoryButton'](){const _0x152707=new _0x23128a(this['locale']),_0x4f6204=this['resultsView'],_0x303b02=this['locale'];_0x152707['set']({'label':Vn(_0x303b02,'History'),'withText':!0x1,'icon':Ht,'tooltip':!0x0,'tooltipPosition':'sw','class':'ck-ai-form__toggle-history'}),_0x152707['bind']('isOn')['to'](_0x4f6204,'isVisible'),_0x152707['bind']('isEnabled')['to'](this,'isEnabled'),_0x152707['on']('execute',()=>{_0x4f6204['isVisible']=!_0x4f6204['isVisible'],_0x4f6204['isVisible']?this['filteredView']['focus']():this['focus']();});const _0x378236=()=>{_0x51d4c0['window']['requestAnimationFrame'](()=>{if(_0x51c3da(this['element'])){const _0x401781=new _0x33ad0b(this['queryView']['fieldView']['element']),_0x5c137e=_0x401781['width'],_0x18af94='rtl'===_0x303b02['uiLanguageDirection']?'left':'right';_0x401781['excludeScrollbarsAndBorders'](),_0x152707['element']['style'][_0x18af94]=_0x5c137e-_0x401781['width']+0x1+'px';}});};return this['queryView']['fieldView']['on']('update',_0x378236),this['on']('render',_0x378236),_0x152707;}['submit'](){const _0xe75eb9=this['queryView']['fieldView']['element']['value'];this['fire']('submit',_0xe75eb9);}['focus'](_0x4459e7){-0x1===_0x4459e7?this['focusCycler']['focusLast']():this['focusCycler']['focusFirst']();}}class vr extends _0x1626c8{['historyGroupView'];['clearHistoryButton'];constructor(_0x176155){super(_0x176155),this['clearHistoryButton']=this['_createClearHistoryButton'](),this['historyGroupView']=new _0x2ae154(),this['historyGroupView']['children']['add'](this['clearHistoryButton'],0x1),this['historyGroupView']['label']=Vn(_0x176155,'Prompt\x20history'),this['historyGroupView']['items']['delegate']('execute')['to'](this),this['items']['add'](this['historyGroupView']);}['filter'](){let _0x1f90d6=0x0;for(const _0x5a686b of this['items'])_0x1f90d6+=_0x5a686b['items']['length'];return{'resultsCount':_0x1f90d6,'totalItemsCount':_0x1f90d6};}['_createClearHistoryButton'](){const _0xd4ee04=this['locale'],_0x5c32f3=new _0x23128a(this['locale']);return _0x5c32f3['set']({'label':'('+Vn(_0xd4ee04,'Clear')+')','withText':!0x0}),_0x5c32f3['on']('execute',()=>this['fire']('clearHistory')),_0x5c32f3;}}class Ar extends _0x470a68{constructor(_0x5c0d75){super();const _0x9727af=new _0x55f519(),_0x2826bd=new _0x23128a(this['locale'],_0x9727af);this['children']['add'](_0x2826bd),_0x2826bd['set']({'label':_0x5c0d75['prompt'],'withText':!0x0}),_0x2826bd['on']('execute',()=>{this['fire']('execute',{'value':_0x423060(_0x5c0d75['prompt'])});});}}const no='CKEditor/AIFormView/PromptHistory';class Pr extends _0x12a2d7{constructor(){super(),this['_loadFromSessionStorage'](),this['on']('add',(_0xaeac90,_0x433c40)=>{const _0x3059cb=ao(_0x433c40['prompt']);for(const _0x5183e7 of this)if(_0x5183e7!=_0x433c40&&ao(_0x5183e7['prompt'])===_0x3059cb){this['remove'](_0x5183e7);break;}this['length']>0x14&&this['remove'](this['last']),this['_saveToSessionStorage']();}),this['on']('remove',()=>{this['_saveToSessionStorage']();});}['_loadFromSessionStorage'](){const _0x2c7fdb=sessionStorage['getItem'](no)||'[]';this['addMany'](JSON['parse'](_0x2c7fdb));}['_saveToSessionStorage'](){sessionStorage['setItem'](no,JSON['stringify'](this['map'](_0xe34161=>_0xe34161)));}}function ao(_0x22e2c9){return _0x22e2c9['toLowerCase']()['trim']();}class k extends _0x4118d8{['focusTracker'];['keystrokes'];['contentArea'];['toolbar'];['promptView'];['errorView'];['_focusables'];['focusCycler'];['_promptHistory'];constructor(_0x4559ef,_0x8e56e2,_0x429b5b=''){super(_0x4559ef),this['set']('isEnabled',!0x0),this['set']('isProcessing',!0x1),this['set']('prompt',''),this['set']('value',''),this['set']('isError',!0x1),this['set']('mainAction',_['REPLACE']),this['_promptHistory']=new Pr(),this['errorView']=new gr(_0x4559ef),this['contentArea']=new yr(_0x4559ef,_0x429b5b),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 _0xc5fc70(),this['keystrokes']=new _0x464bf0(),this['_focusables']=this['createCollection']([this['contentArea'],this['contentArea']['copyButtonView'],this['toolbar'],this['promptView']]),this['focusCycler']=new _0x53ec2a({'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 _0x12136a=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form',_0x8e56e2],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-form-content']},'children':[{'tag':'div','attributes':{'class':[_0x12136a['if']('isError','ck-hidden',_0x402590=>!_0x402590)]},'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'](_0x33ede2=0x1){-0x1===_0x33ede2?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 _0x44ea0b=this['locale'],_0x3f735f=new Er(_0x44ea0b,{'queryView':{'label':Vn(_0x44ea0b,'Ask\x20AI\x20to\x20edit\x20or\x20generate'),'creator':_0x247c44,'showIcon':!0x1,'showResetButton':!0x1},'infoView':{'text':{'noSearchableItems':{'primary':Vn(_0x44ea0b,'Empty\x20history'),'secondary':Vn(_0x44ea0b,'Ask\x20AI\x20and\x20your\x20prompts\x20will\x20be\x20listed\x20here\x20for\x20you\x20to\x20use\x20later.')}}},'filteredView':this['_createHistoryView'](),'queryMinChars':0x1/0x0,'resetOnBlur':!0x1});return _0x3f735f['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',(_0x1dc367,_0x4f9b2f)=>_0x1dc367&&!_0x4f9b2f),this['listenTo'](_0x3f735f,'submit',(_0x21b1e5,_0x45889e)=>{this['prompt']=_0x45889e;const _0x3aafdd=_0x397c0d(_0x45889e);this['fire']('submitPrompt',_0x3aafdd),_0x45889e['trim']()&&this['_promptHistory']['add']({'prompt':_0x3aafdd},0x0);},{'priority':'high'}),_0x3f735f;}['_createHistoryView'](){const _0x3d4d56=new vr(this['locale']);return _0x3d4d56['historyGroupView']['items']['bindTo'](this['_promptHistory'])['as'](Ar),_0x3d4d56['on']('clearHistory',()=>{this['_promptHistory']['clear'](),this['promptView']['search'](''),this['promptView']['focus']();}),_0x3d4d56;}['_createToolbar'](){const _0x29a0f2=new wr(this['locale']);return _0x29a0f2['replaceButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',this,'value',(_0x3a1ca6,_0x326371,_0x21350d)=>_0x3a1ca6&&!_0x326371&&!!_0x21350d),_0x29a0f2['replaceButton']['delegate']('execute')['to'](this,'replaceContent'),_0x29a0f2['insertButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',this,'value',(_0xa6ef66,_0x4b555c,_0x21cbba)=>_0xa6ef66&&!_0x4b555c&&!!_0x21cbba),_0x29a0f2['insertButton']['delegate']('execute')['to'](this,'insertContentBelow'),_0x29a0f2['tryAgainButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',(_0x3e7e05,_0x32c172)=>_0x3e7e05&&!_0x32c172),_0x29a0f2['tryAgainButton']['delegate']('execute')['to'](this,'tryAgainEvent'),_0x29a0f2['stopButton']['bind']('isEnabled')['to'](this,'isProcessing'),_0x29a0f2['stopButton']['delegate']('execute')['to'](this,'stopProcessing'),_0x29a0f2;}['startProcessing'](){this['value']='',this['isError']=!0x1,this['isProcessing']=!0x0,this['contentArea']['isVisible']=!0x0,this['toolbar']['isVisible']=!0x0,this['contentArea']['focus']();}['finishProcessing'](){const _0x3658d0=this['locale'];this['isProcessing']=!0x1,this['prompt']='',this['promptView']['reset'](),this['value']&&(this['promptView']['queryView']['label']=Vn(_0x3658d0,'Ask\x20AI\x20to\x20improve\x20generated\x20text'));}['handleError'](_0x176eb7){const _0x51a349=this['locale'];this['finishProcessing'](),this['isError']=!0x0,this['errorView']['text']=_0x176eb7||Vn(_0x51a349,'AI_ERROR_FAILED'),this['value']||(this['contentArea']['isVisible']=!0x1);}}const l=globalThis['DataTransfer'];class n extends _0x3eae20{['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[_0x178047,a,x,_0x31f025];}constructor(_0x59d0cb){super(_0x59d0cb),_0x59d0cb['config']['define']('ai.assistant.disabledElements',['media','rawHtml','tableOfContents']),_0x59d0cb['config']['define']('ai.assistant.contentAreaCssClass',''),_0x59d0cb['config']['define']('ai.assistant.useTheme',!0x0),this['_uiCssClasses']='ck-ai-assistant-ui'+(_0x59d0cb['config']['get']('ai.assistant.useTheme')?'\x20ck-ai-assistant-ui_theme':'');}['init'](){const {editor:_0x5e0b4c}=this;this['_aiAdapter']=_0x5e0b4c['plugins']['get'](x),this['_dialog']=_0x5e0b4c['plugins']['get'](_0x31f025),this['_formView']=null,this['_commandDefinitions']=this['_getResolvedCommandsDefinitions']();const _0x2a6225=new E(_0x5e0b4c,Array['from'](this['_commandDefinitions']['values']()));_0x5e0b4c['commands']['add']('showAIAssistant',_0x2a6225),_0x5e0b4c['ui']['componentFactory']['add']('aiCommands',_0x2e72a8=>{const _0x1c71a9=_0x820be6(_0x2e72a8);return _0x1c71a9['set']({'class':'ck-ai-commands-dropdown\x20'+this['_uiCssClasses']}),_0x1c71a9['buttonView']['set']({'label':Vn(_0x2e72a8,'AI\x20Commands'),'icon':_0x19ff10,'tooltip':!0x0}),_0x1c71a9['on']('execute',_0x5bffdd=>this['_onExecute'](_0x5bffdd['source']['id'])),_0x2d2cd2(_0x1c71a9,_0x5e0b4c['ui']['view']['body'],function(_0x1aaf60){const _0x41340b=o(_0x1aaf60['config']['get']('ai.assistant.commands'),_0x1aaf60['locale']),_0x18160c=U(_0x1aaf60,_0x41340b)['filter'](_0x11914b=>_0x11914b['commands']['length']);if(0x1===_0x18160c['length'])return U(_0x1aaf60,_0x18160c[0x0]['commands'])['map'](_0x3d68b4=>({'id':_0x3d68b4['id'],'label':_0x3d68b4['label']}));return _0x18160c['map'](_0xdf5cea=>{const {groupId:_0x2b8263,groupLabel:_0x1b1920,commands:_0x2bbde8}=_0xdf5cea,_0x119726=U(_0x1aaf60,_0x2bbde8)['map'](_0x5c1868=>({'id':_0x5c1868['id'],'label':_0x5c1868['label']}));return{'id':_0x2b8263,'menu':_0x1b1920||_0x2b8263,'children':_0x119726};});}(_0x5e0b4c),{'ariaLabel':Vn(_0x2e72a8,'AI\x20Commands')}),_0x1c71a9['menuView']['menuPanelClass']='ck-ai-commands-dropdown\x20'+this['_uiCssClasses'],_0x2a6225['on']('change:enabledCommandsIds',_0x4db144),_0x1c71a9['menuView']['once']('render',_0x4db144),_0x1c71a9;function _0x4db144(){_0x1c71a9['isEnabled']=_0x2a6225['enabledCommandsIds']['length']>0x0;for(const _0x52e47e of _0x1c71a9['menuView']['buttons'])_0x52e47e['isEnabled']=_0x2a6225['enabledCommandsIds']['includes'](_0x52e47e['id']);}}),_0x5e0b4c['ui']['componentFactory']['add']('menuBar:aiCommands',_0x3abb71=>{const _0x22581b=new _0x94a373(_0x3abb71);_0x22581b['buttonView']['set']({'label':Vn(_0x3abb71,'AI\x20Commands'),'icon':_0x19ff10}),_0x22581b['bind']('isEnabled')['to'](_0x2a6225,'enabledCommandsIds',_0x558ffd=>_0x558ffd['length']>0x0);const _0x5c6844=o(_0x5e0b4c['config']['get']('ai.assistant.commands'),_0x3abb71);return this['_populateMenuBarMenu'](_0x2a6225,_0x22581b,_0x5c6844,_0x4c0a6e=>this['_onExecute'](_0x4c0a6e)),_0x22581b;}),_0x5e0b4c['ui']['componentFactory']['add']('aiAssistant',()=>{const _0x39105b=this['_createAIAssistantUIButton'](_0x23128a);return _0x39105b['set']({'tooltip':!0x0,'class':'ck-ai-assistant-button\x20'+this['_uiCssClasses']}),_0x39105b;}),_0x5e0b4c['ui']['componentFactory']['add']('menuBar:aiAssistant',()=>{const _0x1ad822=this['_createAIAssistantUIButton'](_0x2ec6d8);return _0x1ad822['set']({'role':'menuitemcheckbox'}),_0x1ad822;}),this['licenseKey']=this['editor']['config']['get']('licenseKey');const _0x17cdfd=this['editor'];this['_licenseKeyCheckInterval']=setInterval(()=>{let _0x1feb62;for(const _0xc1bf2 in _0x17cdfd){const _0x432dcc=_0xc1bf2,_0x128bd6=_0x17cdfd[_0x432dcc];if('aiLicenseKeyValid'==_0x128bd6||'aiLicenseKeyInvalid'==_0x128bd6||'aiLicenseKeyExpired'==_0x128bd6||'aiLicenseKeyDomainLimit'==_0x128bd6||'aiLicenseKeyNotAllowed'==_0x128bd6||'aiLicenseKeyEvaluationLimit'==_0x128bd6||'aiLicenseKeyTrialLimit'==_0x128bd6||'aiLicenseKeyUsageLimit'==_0x128bd6){delete _0x17cdfd[_0x432dcc],_0x1feb62=_0x128bd6,clearInterval(this['_licenseKeyCheckInterval']),this['_licenseKeyCheckInterval']=void 0x0;break;}}'aiLicenseKeyInvalid'==_0x1feb62&&_0x17cdfd['_showLicenseError']('invalid'),'aiLicenseKeyExpired'==_0x1feb62&&_0x17cdfd['_showLicenseError']('expired'),'aiLicenseKeyDomainLimit'==_0x1feb62&&_0x17cdfd['_showLicenseError']('domainLimit'),'aiLicenseKeyNotAllowed'==_0x1feb62&&_0x17cdfd['_showLicenseError']('featureNotAllowed','AIAssistant'),'aiLicenseKeyEvaluationLimit'==_0x1feb62&&_0x17cdfd['_showLicenseError']('evaluationLimit'),'aiLicenseKeyTrialLimit'==_0x1feb62&&_0x17cdfd['_showLicenseError']('trialLimit'),'aiLicenseKeyUsageLimit'==_0x1feb62&&_0x17cdfd['_showLicenseError']('usageLimit');},0x3e8);}['destroy'](){super['destroy'](),this['_licenseKeyCheckInterval']&&clearInterval(this['_licenseKeyCheckInterval']);}['showUI'](_0x4fc062='',_0x5e4570='',_0x56a225='custom'){const _0x54f872=this['editor'],_0x1172e3=_0x54f872['editing']['view'],_0x5d36d4=_0x54f872['plugins']['get'](a),_0x8b5b5d=_0x54f872['plugins']['get'](_0x178047);_0x5d36d4['showFakeVisualSelection']();const _0x402dbf=new l(),_0x3e265f=new ClipboardEvent('copy',{'clipboardData':_0x402dbf}),_0x1aee38=new _0x458c16(_0x402dbf),_0x3ec900=new _0x298922(_0x1172e3,_0x3e265f,{'dataTransfer':_0x1aee38});_0x8b5b5d['_forceMarkersCopy']('comment',()=>{_0x1172e3['document']['fire']('copy',_0x3ec900);}),this['_formView']||(this['_initView'](),this['_aiAssistantController']=new j(_0x54f872,this['_aiAdapter']['textAdapter'],this['_formView']));let _0x3a3740=_0x1aee38['getData']('text/html');const _0x3fa315=_0x54f872['model']['document']['selection'],_0x1c94c9=Array['from'](_0x3fa315['getRanges']());0x1===_0x1c94c9['length']&&_0x1c94c9[0x0]['isFlat']&&!_0x3fa315['getSelectedElement']()&&''!==_0x3a3740['replace'](/ /g,'')['trim']()&&(_0x3a3740='<p>'+_0x3a3740+'</p>'),this['_aiAssistantController']['updateView']({'actionId':_0x56a225,'query':_0x4fc062,'htmlContent':_0x3a3740,'label':_0x5e4570,'mainActionLabel':_[_0x54f872['model']['document']['selection']['isCollapsed']?'INSERT':'REPLACE']}),'aiAssistant'!==this['_dialog']['id']?this['_dialog']['show']({'id':'aiAssistant','icon':_0x4b01ab,'title':Vn(this['editor']['locale'],'AI\x20Assistant'),'content':this['_formView'],'position':_0x26373f['EDITOR_TOP_SIDE'],'onShow':()=>{this['_formView']['focus']();},'onHide':()=>{this['_aiAssistantController']['reset'](),_0x5d36d4['hideFakeVisualSelection']();}}):this['_dialog']['view']['wasMoved']||this['_dialog']['view']['updatePosition']();}['hideUI'](){this['_dialog']['hide']();}['_getResolvedCommandsDefinitions'](){const _0x5d34ac=new Map(),_0x3420b1=o(this['editor']['config']['get']('ai.assistant.commands'),this['editor']['locale']);for(const _0x19c550 of _0x3420b1)for(const _0x33436d of _0x19c550['commands'])_0x5d34ac['set'](_0x33436d['id'],{..._0x33436d,'groupId':_0x19c550['groupId'],'groupLabel':_0x19c550['groupLabel']||_0x19c550['groupId']});return _0x5d34ac;}['_createAIAssistantUIButton'](_0x196663){const _0x15c563=this['editor'],_0x800c5d=_0x15c563['commands']['get']('showAIAssistant'),_0x10ffe2=new _0x196663(_0x15c563['locale']);return _0x10ffe2['set']({'label':Vn(_0x15c563['locale'],'AI\x20Assistant'),'icon':_0x4b01ab,'isToggleable':!0x0}),_0x10ffe2['bind']('isEnabled')['to'](_0x800c5d),_0x10ffe2['bind']('isOn')['to'](this['_dialog'],'id',_0x5ba7f5=>'aiAssistant'===_0x5ba7f5),this['listenTo'](_0x10ffe2,'execute',()=>{_0x10ffe2['isOn']?this['hideUI']():_0x800c5d['execute']();}),_0x10ffe2;}['_initView'](){const _0x29acf8=this['editor']['plugins']['get'](a);this['_formView']=new k(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',()=>{_0x29acf8['insertContent'](this['_aiAssistantController']['currentContext']),this['hideUI']();}),this['listenTo'](this['_formView'],'insertContentBelow',()=>{_0x29acf8['insertContentBelow'](this['_aiAssistantController']['currentContext']),this['hideUI']();}),this['_initAriaAiStatusChangeAnnouncements']();}['_initAriaAiStatusChangeAnnouncements'](){const {locale:_0x3e8236,ui:{ariaLiveAnnouncer:_0x2f8476}}=this['editor'];this['_formView']['contentArea']['on']('change:isProcessing',(_0x2837b5,_0x70641d,_0x46dc63)=>{const _0x1165a5=this['_aiAssistantController']['currentContext'];_0x46dc63?_0x2f8476['announce'](Vn(_0x3e8236,'AI\x20is\x20writing')):_0x1165a5&&_0x2f8476['announce'](Vn(_0x3e8236,'Generated\x20content:\x20%0',_0x1165a5),{'politeness':'polite','isUnsafeHTML':!0x0});}),this['_formView']['on']('change:isError',(_0x2fc7ae,_0x4b2fe7,_0x4ba3b9)=>{if(_0x4ba3b9){const _0x12f495=this['_formView']['errorView']['text'];_0x2f8476['announce'](Vn(_0x3e8236,'Error\x20during\x20AI\x20content\x20generation:\x20%0',_0x12f495));}});}['_onExecute'](_0x100681){const _0x1b26b1=this['_commandDefinitions']['get'](_0x100681),_0xbf2726=this['editor'],_0x401f19=_0xbf2726['model']['document']['selection'],_0xfcbbaa=_0xbf2726['commands']['get']('showAIAssistant'),_0x5a4e02=_0xbf2726['plugins']['get'](a),_0x19d23b=''+(_0x1b26b1['groupId']!==K?_0x1b26b1['groupLabel']+':\x20':'')+_0x1b26b1['label'];if(!0x1!==_0x1b26b1['requiresContent']&&_0x401f19['isCollapsed']){const _0xf4815b=_0x2f52df(_0x401f19['getSelectedBlocks']())||_0xbf2726['model']['schema']['getLimitElement'](_0x401f19);_0xbf2726['model']['change'](_0x10b61a=>{_0x10b61a['setSelection'](_0xf4815b,'in');});}_0x5a4e02['showFakeVisualSelection'](),_0xfcbbaa['execute'](_0x1b26b1['prompt'],_0x19d23b,'command:'+_0x100681);}['_populateMenuBarMenu'](_0x4f4da1,_0x503515,_0x1f80f2,_0x3b3b0b){const _0x27d0f0=this['editor'],_0xdc6a3e=_0x27d0f0['locale'],_0x5b15d6=new _0x118ddd(_0xdc6a3e),_0x2a07c7=U(_0x27d0f0,_0x1f80f2)['filter'](_0x3fa520=>_0x3fa520['commands']['length']);0x1===_0x2a07c7['length']?this['_getMenuBarGroupButtons']({'command':_0x4f4da1,'commands':_0x2a07c7[0x0]['commands'],'parentMenuView':_0x503515,'onExecute':_0x3b3b0b})['forEach'](_0x41b8a0=>_0x5b15d6['items']['add'](_0x41b8a0)):_0x2a07c7['forEach'](({groupId:_0x466c85,groupLabel:_0x1b5b7a,commands:_0x391aa8})=>{const _0xd6b2b4=new _0x5d9250(_0xdc6a3e,_0x503515),_0x2850b4=new _0x94a373(_0xdc6a3e),_0x503677=new _0x118ddd(_0xdc6a3e),_0x5c4bb8=this['_getMenuBarGroupButtons']({'command':_0x4f4da1,'commands':_0x391aa8,'parentMenuView':_0x2850b4,'onExecute':_0x3b3b0b});_0x2850b4['buttonView']['set']({'label':_0x1b5b7a||_0x466c85}),_0x2850b4['delegate']('execute')['to'](_0x503515),_0x503677['items']['addMany'](_0x5c4bb8),_0x2850b4['panelView']['children']['add'](_0x503677),_0xd6b2b4['children']['add'](_0x2850b4),_0x5b15d6['items']['add'](_0xd6b2b4);}),_0x503515['panelView']['children']['add'](_0x5b15d6);}['_getMenuBarGroupButtons']({command:_0x1c7876,commands:_0x561d20,parentMenuView:_0x4cf6c6,onExecute:_0x4c406c}){const _0x27fc3e=this['editor'],_0x1f9689=_0x27fc3e['locale'];return U(_0x27fc3e,_0x561d20)['map'](_0xbd5c02=>{const _0x26aa42=new _0x5d9250(_0x1f9689,_0x4cf6c6),_0x2986f9=new _0x2ec6d8(_0x1f9689);return _0x2986f9['set']({'label':_0xbd5c02['label']}),_0x2986f9['delegate']('execute')['to'](_0x4cf6c6),_0x2986f9['on']('execute',()=>_0x4c406c(_0xbd5c02['id'])),_0x2986f9['bind']('isEnabled')['to'](_0x1c7876,'enabledCommandsIds',_0x194ec3=>_0x194ec3['includes'](_0xbd5c02['id'])),_0x26aa42['children']['add'](_0x2986f9),_0x26aa42;});}}function T(_0x189273,_0x183285){return void 0x0!==_0x189273['order']&&void 0x0===_0x183285['order']?0x1:void 0x0===_0x189273['order']&&void 0x0!==_0x183285['order']?-0x1:void 0x0!==_0x189273['order']&&void 0x0!==_0x183285['order']?_0x189273['order']-_0x183285['order']:0x0;}function U(_0x38f0cf,_0x4db264){_0x4db264['sort'](T);const _0x5eb738={},_0x47b61d=[];for(const _0x53aefb of _0x4db264)if(void 0x0!==_0x53aefb['order']){if(_0x53aefb['order']in _0x5eb738)throw new _0x58ed45('ai-commands-config-order-collision',_0x38f0cf,{'conflictingDefinitions':[_0x53aefb,_0x5eb738[_0x53aefb['order']]]});_0x5eb738[_0x53aefb['order']]=_0x53aefb,_0x47b61d['splice'](_0x53aefb['order'],0x0,_0x53aefb);}else _0x47b61d['push'](_0x53aefb);return _0x47b61d;}class Kn extends _0x3eae20{static get['requires'](){return[n,a];}static get['pluginName'](){return'AIAssistant';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x543750){super(_0x543750);const _0x32eaab=_0x543750['config'],_0x2684f6=_0x543750['locale'];_0x32eaab['define']('ai.assistant.preserveComments',!0x0),_0x32eaab['define']('ai.assistant.commands',Wn(_0x2684f6)),_0x32eaab['define']('ai.assistant.extraCommandGroups',[]),_0x32eaab['define']('ai.assistant.removeCommands',[]);let _0x593223=o(_0x32eaab['get']('ai.assistant.commands'),_0x2684f6);const _0x373831=_0x32eaab['get']('ai.assistant.extraCommandGroups'),_0x317b1e=_0x32eaab['get']('ai.assistant.removeCommands');_0x373831['forEach'](_0x2d8d9a=>{const _0x14cfde=_0x593223['find'](_0x4968db=>_0x4968db['groupId']===_0x2d8d9a['groupId']);_0x14cfde?_0x14cfde['commands']=_0x14cfde['commands']['concat'](_0x2d8d9a['commands']):_0x593223['push'](_0x2d8d9a);}),_0x593223=_0x593223['filter'](_0x593890=>!_0x317b1e['includes'](_0x593890['groupId'])),_0x593223['forEach'](_0x47eea4=>{_0x47eea4['commands']=_0x47eea4['commands']['filter'](_0x6fd202=>!_0x317b1e['includes'](_0x6fd202['id']));}),_0x32eaab['set']('ai.assistant.commands',_0x593223);}}function Wn(_0x110e48){return[{'groupId':'editOrReview','groupLabel':Vn(_0x110e48,'Edit\x20or\x20review'),'commands':[{'id':'improveWriting','label':Vn(_0x110e48,'Improve\x20writing'),'prompt':'Fix\x20spelling\x20mistakes,\x20use\x20proper\x20grammar\x20and\x20apply\x20good\x20writing\x20practices.\x20Do\x20not\x20lose\x20the\x20original\x20meaning.'},{'id':'makeShorter','label':Vn(_0x110e48,'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':Vn(_0x110e48,'Make\x20longer'),'prompt':'Improve\x20this\x20content\x20by\x20using\x20descriptive\x20language\x20and\x20inserting\x20more\x20information\x20and\x20more\x20detailed\x20explanations.'},{'id':'simplifyLanguage','label':Vn(_0x110e48,'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':Vn(_0x110e48,'Generate\x20from\x20selection'),'commands':[{'id':'summarize','label':Vn(_0x110e48,'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':Vn(_0x110e48,'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':Vn(_0x110e48,'Change\x20tone'),'commands':[{'id':'professional','label':Vn(_0x110e48,'Professional'),'prompt':'Improve\x20using\x20polished,\x20formal,\x20and\x20respectful\x20language\x20to\x20convey\x20professional\x20expertise\x20and\x20competence.'},{'id':'casual','label':Vn(_0x110e48,'Casual'),'prompt':'Improve\x20using\x20casual,\x20informal\x20language\x20to\x20convey\x20a\x20casual\x20conversation\x20with\x20a\x20real\x20person.'},{'id':'direct','label':Vn(_0x110e48,'Direct'),'prompt':'Improve\x20using\x20direct\x20language,\x20using\x20only\x20the\x20essential\x20information.'},{'id':'confident','label':Vn(_0x110e48,'Confident'),'prompt':'Improve\x20using\x20compelling,\x20optimistic\x20language\x20to\x20convey\x20confidence\x20in\x20the\x20writing.'},{'id':'friendly','label':Vn(_0x110e48,'Friendly'),'prompt':'Improve\x20using\x20friendly,\x20comforting\x20language,\x20to\x20convey\x20understanding\x20and\x20empathy.'}]},{'groupId':'changeStyle','groupLabel':Vn(_0x110e48,'Change\x20style'),'commands':[{'id':'business','label':Vn(_0x110e48,'Business'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20business\x20professional\x20with\x20formal\x20language.'},{'id':'legal','label':Vn(_0x110e48,'Legal'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20legal\x20professional\x20using\x20valid\x20legal\x20terminology.'},{'id':'journalism','label':Vn(_0x110e48,'Journalism'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20journalist\x20using\x20engaging\x20language\x20to\x20convey\x20the\x20importance\x20of\x20the\x20information.'},{'id':'poetic','label':Vn(_0x110e48,'Poetic'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20poem\x20using\x20poetic\x20techniques\x20without\x20losing\x20the\x20original\x20meaning.'}]},{'groupId':'translate','groupLabel':Vn(_0x110e48,'Translate'),'commands':[{'id':'translateEnglish','label':Vn(_0x110e48,'English'),'prompt':'Translate\x20the\x20content\x20to\x20English\x20language.'},{'id':'translateSpanish','label':Vn(_0x110e48,'Spanish'),'prompt':'Translate\x20the\x20content\x20to\x20Spanish\x20language.'},{'id':'translatePortuguese','label':Vn(_0x110e48,'Portuguese'),'prompt':'Translate\x20the\x20content\x20to\x20Portuguese\x20language.'},{'id':'translateGerman','label':Vn(_0x110e48,'German'),'prompt':'Translate\x20the\x20content\x20to\x20German\x20language.'},{'id':'translateFrench','label':Vn(_0x110e48,'French'),'prompt':'Translate\x20the\x20content\x20to\x20French\x20language.'},{'id':'translateChinese','label':Vn(_0x110e48,'Simplified\x20Chinese'),'prompt':'Translate\x20the\x20content\x20to\x20Simplified\x20Chinese\x20language.'},{'id':'translateHindi','label':Vn(_0x110e48,'Hindi'),'prompt':'Translate\x20the\x20content\x20to\x20Hindi\x20language.'},{'id':'translateArabic','label':Vn(_0x110e48,'Arabic'),'prompt':'Translate\x20the\x20content\x20to\x20Arabic\x20language.'}]}];}class de extends _0x3eae20{['abortController'];static get['requires'](){return[x];}constructor(_0x1ffc59){super(_0x1ffc59),this['abortController']=new AbortController();}['init'](){this['editor']['plugins']['get'](x)['textAdapter']=this;}['abort'](){this['abortController']['signal']['aborted']||(this['abortController']['abort'](),this['abortController']=new AbortController());}async['makeRequest'](_0x539d28){return this['sendRequest'](_0x539d28)['catch'](_0x351249=>{if(_0x351249 instanceof tr)return Promise['reject'](_0x351249);if('AbortError'==_0x351249['name'])return Promise['resolve']();throw console['error'](_0x351249),new _0x58ed45('aitextadapter-send-request-failed',null);});}async['_prepareRequestHeaders'](_0x318a19,_0x4034f1){const _0x43c407=this['editor']['locale'],_0x391f7b={'Content-Type':'application/json'};if('object'==typeof _0x318a19)Object['assign'](_0x391f7b,_0x318a19);else{if(_0x318a19)try{const _0x59717d=await _0x318a19(_0x4034f1);Object['assign'](_0x391f7b,_0x59717d);}catch{return Promise['reject'](new tr(Vn(_0x43c407,'AI_ERROR_GET_HEADERS')));}}return _0x391f7b;}async['_prepareRequestParameters'](_0x4272cb,_0x5bc292){const _0x417736=this['editor']['locale'];if('object'==typeof _0x4272cb)return _0x4272cb;try{return await _0x4272cb(_0x5bc292);}catch{return Promise['reject'](new tr(Vn(_0x417736,'AI_ERROR_GET_PARAMETERS')));}}}class Fn extends de{['_apiUrl'];['_requestHeaders'];['_requestParameters'];static get['pluginName'](){return'OpenAITextAdapter';}constructor(_0x1e86fb){super(_0x1e86fb),_0x1e86fb['config']['define']('ai.assistant.adapter.openAI.apiUrl','https://api.openai.com/v1/chat/completions'),_0x1e86fb['config']['get']('ai.assistant.adapter.openAI.requestParameters')||_0x1e86fb['config']['define']('ai.assistant.adapter.openAI.requestParameters',{'model':'gpt-4o','temperature':0x1,'top_p':0x1,'stream':!0x0}),this['_apiUrl']=_0x1e86fb['config']['get']('ai.assistant.adapter.openAI.apiUrl'),this['_requestHeaders']=_0x1e86fb['config']['get']('ai.assistant.adapter.openAI.requestHeaders')||{},this['_requestParameters']=_0x1e86fb['config']['get']('ai.assistant.adapter.openAI.requestParameters');}async['sendRequest']({query:_0x26ff6e,context:_0x24de53,onData:_0x2c249e,actionId:_0x17ec8d}){const _0x592207=this['editor']['locale'],_0x5ecc52=await this['prepareMessages'](_0x26ff6e,_0x24de53,_0x17ec8d),_0x6c252b=await this['_prepareRequestHeaders'](this['_requestHeaders'],_0x17ec8d),_0x1ecd1b=await this['_prepareRequestParameters'](this['_requestParameters'],_0x17ec8d),_0x55f69c={'messages':_0x5ecc52,..._0x1ecd1b},_0x5db48b={'method':'POST','headers':_0x6c252b,'body':JSON['stringify'](_0x55f69c),'signal':this['abortController']['signal']},_0x47e76e=await fetch(this['_apiUrl'],_0x5db48b);if(_0x47e76e['ok'])return _0x1ecd1b['stream']?await this['_readStreamableResponse'](_0x47e76e,_0x2c249e):await this['_readStaticResponse'](_0x47e76e,_0x2c249e),Promise['resolve']();{const _0x5617ec=await _0x47e76e['text']();return _0x5617ec['includes']('context_length_exceeded')?Promise['reject'](new tr(Vn(_0x592207,'AI_ERROR_CONTEXT_LENGTH'))):_0x5617ec['includes']('Moderation')?Promise['reject'](new tr(Vn(_0x592207,'AI_ERROR_MODERATION'))):Promise['reject'](new Error(_0x5617ec));}}async['prepareMessages'](_0x3f6c70,_0x10057f,_0x44531e){let _0xbaa24d,_0x1b4a4e;return _0x10057f?(_0xbaa24d='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.',_0x1b4a4e='Instruction:\x0a'+_0x3f6c70+'\x0aYou\x20must\x20keep\x20the\x20text\x20formatting.\x0a\x0aContent:\x0a'+_0x10057f):(_0xbaa24d='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.',_0x1b4a4e=_0x3f6c70),[{'role':'system','content':_0xbaa24d},{'role':'user','content':_0x1b4a4e}];}async['_readStreamableResponse'](_0x1344cd,_0x3824c1){const _0x532d28=_0x1344cd['body']['getReader'](),_0x1d9778=new TextDecoder();let _0x5cd7b6='',_0x5d0cc4='',_0xfd0e65='',_0x368f7c=!0x1;for(;!_0x368f7c;){const {done:_0x30fc6c,value:_0xda914c}=await _0x532d28['read'](),_0x4943fb=_0x5cd7b6+_0x1d9778['decode'](_0xda914c);let _0x336e9c='';_0x368f7c=_0x30fc6c;try{_0x336e9c=this['_cleanUpData'](_0x4943fb),_0x5cd7b6='';}catch{_0x5cd7b6=_0x4943fb;continue;}_0x5d0cc4+=_0x336e9c,!_0x368f7c&&this['_isBufferIncomplete'](_0x5d0cc4)||_0x5d0cc4&&(_0xfd0e65+=_0x5d0cc4,_0x5d0cc4='',_0x3824c1(_0xfd0e65));}return Promise['resolve']();}async['_readStaticResponse'](_0xa519dc,_0xd896da){return _0xd896da((await _0xa519dc['json']())['choices'][0x0]['message']['content']),Promise['resolve']();}['_isBufferIncomplete'](_0xcc0a9e){const _0x3fb48f=_0xcc0a9e['split']('<')['length']!==_0xcc0a9e['split']('>')['length'],_0x235765=_0xcc0a9e['length']<0x1e;return _0x3fb48f&&_0x235765;}['_cleanUpData'](_0x1762c8){return _0x1762c8['split'](/\n(?![^{]*\})/g)['map'](_0x4da2ae=>_0x4da2ae['replace']('data:\x20',''))['filter'](_0x55560d=>_0x55560d&&_0x55560d['length']>0x0&&'[DONE]'!==_0x55560d)['map'](_0x3e2558=>{const {choices:_0x1f292e}=JSON['parse'](_0x3e2558);if(_0x1f292e[0x0]?.['delta']?.['content'])return _0x1f292e[0x0]['delta']['content'];})['filter'](_0x4eb02a=>_0x4eb02a)['join']('');}}class Yn extends de{['_apiUrl'];['_requestHeaders'];['_bedrockClientConfig'];['_requestParameters'];static get['pluginName'](){return'AWSTextAdapter';}constructor(_0x157075){super(_0x157075),_0x157075['config']['get']('ai.assistant.adapter.aws.requestParameters')||_0x157075['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']=_0x157075['config']['get']('ai.assistant.adapter.aws.apiUrl'),this['_bedrockClientConfig']=_0x157075['config']['get']('ai.assistant.adapter.aws.bedrockClientConfig'),this['_requestHeaders']=_0x157075['config']['get']('ai.assistant.adapter.aws.requestHeaders'),this['_requestParameters']=_0x157075['config']['get']('ai.assistant.adapter.aws.requestParameters');}async['sendRequest']({query:_0x5de59e,context:_0x9c8d1c,onData:_0x1ee236,actionId:_0x53afe8}){const {model:_0x4d1ca1,stream:_0x4efeb2,..._0x42b311}=await this['_prepareRequestParameters'](this['_requestParameters'],_0x53afe8),_0x33b28={'prompt':await this['preparePrompt'](_0x5de59e,_0x9c8d1c,_0x4d1ca1,_0x53afe8),..._0x42b311};this['_apiUrl']?await this['_processProxyRequest'](_0x33b28,_0x4d1ca1,_0x4efeb2,_0x1ee236,_0x53afe8):await this['_processAWSRequest'](_0x33b28,_0x4d1ca1,_0x4efeb2,_0x1ee236);}async['preparePrompt'](_0x3ca53f,_0x2dd18b,_0x2f0d12,_0x90a909){let _0x3f5378,_0x533f1d;return _0x2dd18b?(_0x3f5378='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.',_0x533f1d='Instruction:\x0a'+_0x3ca53f+'\x0aYou\x20must\x20keep\x20the\x20text\x20formatting.\x0a\x0aContent:\x0a'+_0x2dd18b):(_0x3f5378='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.',_0x533f1d=_0x3ca53f),'meta.llama'==this['getModelFamily'](_0x2f0d12)?'<<SYS>>\x0a'+_0x3f5378+'\x0a<</SYS>>\x0a[INST]\x0a'+_0x533f1d+'\x0a[/INST]':'Human:\x0a'+_0x3f5378+'\x0a'+_0x533f1d+'\x0a\x0aAssistant:';}['getModelFamily'](_0x3b28a6){if(/^anthropic\.claude/['test'](_0x3b28a6))return'anthropic.claude';if(/^ai21\.j2/['test'](_0x3b28a6))return'ai21.j2';if(/^cohere\.command/['test'](_0x3b28a6))return'cohere.command';if(/^meta\.llama/['test'](_0x3b28a6))return'meta.llama';throw new tr(Vn(this['editor']['locale'],'AI_ERROR_UNSUPPORTED_MODEL',_0x3b28a6));}async['_processProxyRequest'](_0x3da72e,_0x37d0c8,_0x821fad,_0x59cf65,_0x10bb9e){const _0x37fe1f={'method':'POST','headers':await this['_prepareRequestHeaders'](this['_requestHeaders'],_0x10bb9e),'body':JSON['stringify']({..._0x3da72e,'model':_0x37d0c8,'stream':_0x821fad}),'signal':this['abortController']['signal']},_0x4edb85=await fetch(this['_apiUrl'],_0x37fe1f);_0x821fad?await this['_readStreamableResponse'](_0x4edb85,_0x37d0c8,_0x59cf65):await this['_readStaticResponse'](_0x4edb85,_0x37d0c8,_0x59cf65);}async['_processAWSRequest'](_0x411c63,_0x269c38,_0x42216c,_0x40aa3f){const _0x109a3c=new _0xd75fae(this['_bedrockClientConfig']),_0x11c688={'body':JSON['stringify'](_0x411c63),'contentType':'application/json','accept':'application/json','modelId':_0x269c38};let _0x41964e;if(_0x42216c){const _0x4d930a=new _0x27c897(_0x11c688);_0x41964e=await _0x109a3c['send'](_0x4d930a,{'abortSignal':this['abortController']['signal']}),await this['_readAsyncIterableResponse'](_0x41964e,_0x269c38,_0x40aa3f);}else{const _0x318c70=new _0x44f0aa(_0x11c688);_0x41964e=await _0x109a3c['send'](_0x318c70,{'abortSignal':this['abortController']['signal']}),await this['_readStaticResponse'](_0x41964e,_0x269c38,_0x40aa3f);}}async['_readAsyncIterableResponse'](_0x10be97,_0x57cead,_0x2ca9b6){const _0x361758=_0x10be97['body'],_0x4bc1be=new TextDecoder('utf-8');let _0x24e9f9='';for await(const _0x3a6e33 of _0x361758)if(_0x3a6e33['chunk']){const _0x232c24=_0x4bc1be['decode'](_0x3a6e33['chunk']['bytes']),_0x183e07=JSON['parse'](_0x232c24);_0x24e9f9+=this['_getGeneratedText'](_0x183e07,_0x57cead),_0x2ca9b6(_0x24e9f9);}return Promise['resolve']();}async['_readStreamableResponse'](_0x155c4e,_0x2d16c2,_0x1853c8){const _0x1e7669=_0x155c4e['body'],_0x175830=new TextDecoder('utf-8'),_0x46c877=_0x1e7669['getReader']();let _0x482e5f='',_0x1c7b13='',_0x388b73=!0x1;for(;!_0x388b73;){const {done:_0x4655f0,value:_0x5b4ee1}=await _0x46c877['read']();if(_0x388b73=_0x4655f0,_0x388b73)break;const _0x119964=(_0x482e5f+_0x175830['decode'](_0x5b4ee1))['split']('\x0a')['map'](_0x47eee1=>{try{return _0x482e5f='',JSON['parse'](_0x47eee1);}catch{return _0x482e5f=_0x47eee1,null;}})['filter'](_0x11b29e=>null!==_0x11b29e);_0x119964['length']&&(_0x1c7b13+=_0x119964['map'](_0x43c7e8=>this['_getGeneratedText'](_0x43c7e8,_0x2d16c2))['join'](''),_0x1853c8(_0x1c7b13));}return Promise['resolve']();}async['_readStaticResponse'](_0xb05109,_0x704a94,_0x134517){let _0x40b9ed;return _0x40b9ed=_0xb05109 instanceof Response?await _0xb05109['json']():JSON['parse'](new TextDecoder('utf-8')['decode'](_0xb05109['body'])),(_0x134517(this['_getGeneratedText'](_0x40b9ed,_0x704a94)),Promise['resolve']());}['_getGeneratedText'](_0x54dd5e,_0x771c0b){switch(this['getModelFamily'](_0x771c0b)){case'anthropic.claude':return _0x54dd5e['completion'];case'ai21.j2':return _0x54dd5e['completions'][0x0]['data']['text'];case'cohere.command':return _0x54dd5e['generations'][0x0]['text'];case'meta.llama':return _0x54dd5e['generation'];}}}class Qs extends _0x23128a{constructor(_0x73ac47,_0x469f1f={}){super(_0x73ac47),this['isToggleable']=!0x0,this['set']('side',_0x469f1f['side']||'top');const _0x3a0032=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':['ck-tab-button',..._0x23c6c8(_0x469f1f['class']||[]),_0x3a0032['to']('side',_0x5449f2=>'ck-tab-button_'+_0x5449f2),_0x3a0032['to']('class')]}});}['show'](){this['set']('isVisible',!0x0);}['hide'](){this['set']('isVisible',!0x1);}}class Us extends _0x4118d8{['children'];constructor(_0x57eda4,_0x2be81e={}){super(_0x57eda4);const _0x47574c=this['bindTemplate'];this['set']('isVisible',!0x1),this['children']=this['createCollection'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck-tab-panel',..._0x23c6c8(_0x2be81e['class']||[]),_0x47574c['to']('class'),_0x47574c['if']('isVisible','ck-hidden',_0x18572f=>!_0x18572f)]},'children':this['children']});}['show'](){this['set']('isVisible',!0x0);}['hide'](){this['set']('isVisible',!0x1);}}class ss extends _0x4118d8{['buttonViews']=this['createCollection']();['panelViews']=this['createCollection']();['_tabs']=new Map();constructor(_0xf139c9,_0x5e8a87={}){super(_0xf139c9),this['set']('class',void 0x0),this['set']('activeTab',null),this['set']('side',_0x5e8a87['side']||'top'),this['set']('isMaximized',!0x1);const _0x3e0a7e=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset','ck-tabs',..._0x23c6c8(_0x5e8a87['class']||[]),_0x3e0a7e['to']('side',_0x4ef2f1=>'ck-tabs_'+_0x4ef2f1),_0x3e0a7e['to']('class'),_0x3e0a7e['to']('isMaximized',_0x2691f1=>_0x2691f1?'ck-ai-tabs_maximized':'')],'tabindex':'0'},'children':[{'tag':'div','attributes':{'class':['ck','ck-tabs__buttons-container',_0x3e0a7e['to']('side',_0x10d6a7=>'ck-tabs__buttons-container_'+_0x10d6a7)]},'children':this['buttonViews']},{'tag':'div','attributes':{'class':['ck','ck-tabs__panels-container',_0x3e0a7e['to']('side',_0x242ebf=>'ck-tabs__panels-container_'+_0x242ebf)]},'children':this['panelViews']},..._0x23c6c8(_0x5e8a87['children']||[])]});}['getTabIds'](){return[...this['_tabs']['keys']()];}['getTab'](_0x586ad7){const _0x2a2bd2=this['_tabs']['get'](_0x586ad7);return _0x2a2bd2||null;}['addTab'](_0x5deba6){const _0x31a1d3=this['_setupButton']({'id':_0x5deba6['id'],'label':_0x5deba6['buttonLabel'],'icon':_0x5deba6['buttonIcon'],'order':_0x5deba6['order']}),_0x300a14=new Us(this['locale']);return _0x300a14['render'](),_0x5deba6['content']&&_0x300a14['children']['add'](_0x5deba6['content']),this['panelViews']['add'](_0x300a14),this['_tabs']['set'](_0x5deba6['id'],{'button':_0x31a1d3,'panel':_0x300a14,'order':void 0x0!==_0x5deba6['order']?_0x5deba6['order']:null}),this['fire']('addTab:'+_0x5deba6['id'],{'id':_0x5deba6['id'],'button':_0x31a1d3,'panel':_0x300a14}),null===this['activeTab']?this['activateTab'](_0x5deba6['id']):this['_hidePanel'](_0x5deba6['id']),{'button':_0x31a1d3,'panel':_0x300a14};}['activateTab'](_0x3da7e5){if(null!==_0x3da7e5&&!this['getTab'](_0x3da7e5))throw new _0x58ed45('ui-tabsview-tab-not-found',{'tabs':this,'tabId':_0x3da7e5});this['activeTab']!==_0x3da7e5&&(this['activeTab']&&this['_hidePanel'](this['activeTab']),this['activeTab']=_0x3da7e5,_0x3da7e5&&this['_showPanel'](_0x3da7e5),this['fire']('activateTab:'+_0x3da7e5,_0x3da7e5));}['showTab'](_0x405160){if(!this['getTab'](_0x405160))throw new _0x58ed45('ui-tabsview-tab-not-found',{'tabs':this,'tabId':_0x405160});this['_showPanel'](_0x405160),this['_showButton'](_0x405160),this['fire']('show:'+_0x405160,_0x405160);}['hideTab'](_0x297cf1){if(!this['getTab'](_0x297cf1))throw new _0x58ed45('ui-tabsview-tab-not-found',{'tabs':this,'tabId':_0x297cf1});const _0x751e6b=this['activeTab'];this['_hidePanel'](_0x297cf1),this['_hideButton'](_0x297cf1);const _0x773133=this['getTabIds']();_0x751e6b===_0x297cf1&&_0x773133['length']>0x1&&this['activateTab'](_0x773133['find'](_0x2e3ed6=>_0x2e3ed6!==_0x297cf1)),this['fire']('hide:'+_0x297cf1,_0x297cf1);}['_getPanel'](_0x390dee){const _0x697aed=this['_tabs']['get'](_0x390dee);return _0x697aed?_0x697aed['panel']:null;}['_showPanel'](_0x49821e){null!==this['activeTab']&&this['activeTab']!==_0x49821e||this['_getPanel'](_0x49821e)['show']();}['_hidePanel'](_0x55d6b4){const _0x1d1f59=this['_getPanel'](_0x55d6b4);_0x1d1f59['isVisible']&&(this['activeTab']===_0x55d6b4&&(this['activeTab']=null),_0x1d1f59['hide']());}['_getButton'](_0x1d3072){const _0x20a763=this['_tabs']['get'](_0x1d3072);return _0x20a763?_0x20a763['button']:null;}['_showButton'](_0x6589de){this['_getButton'](_0x6589de)['show']();}['_hideButton'](_0xe857aa){this['_getButton'](_0xe857aa)['hide']();}['_setupButton'](_0x17b5a9){const _0x335cb8=new Qs(this['locale'],{'side':this['side']}),_0x31f871=this['buttonViews'];if(_0x335cb8['set']({'label':_0x17b5a9['label'],'icon':_0x17b5a9['icon'],'tooltip':!0x0,'withText':!0x0}),_0x335cb8['bind']('isOn')['to'](this,'activeTab',_0x1023ec=>_0x1023ec===_0x17b5a9['id']),_0x335cb8['bind']('side')['to'](this,'side'),_0x17b5a9['order']){const _0x5558c0=[...this['_tabs']]['reduce']((_0x220876,_0x348ee1)=>{const _0x20e2ab=_0x348ee1[0x0],{order:_0x28076a}=_0x348ee1[0x1];return!_0x28076a||_0x28076a>_0x17b5a9['order']?_0x220876:_0x28076a>=_0x220876['order']?{'id':_0x20e2ab,'order':_0x28076a}:_0x220876;},{'id':'','order':0x0}),_0x27415e=_0x31f871['getIndex'](this['_getButton'](_0x5558c0['id']));_0x31f871['add'](_0x335cb8,_0x27415e+0x1);}else _0x31f871['add'](_0x335cb8);return _0x335cb8['on']('execute',()=>{this['activateTab'](_0x17b5a9['id']);}),_0x335cb8;}}const di=['overlay','sidebar','custom'],ui=['left','right'];class ai extends ss{constructor(_0x478084,_0x1eef26={}){super(_0x478084,_0x1eef26),this['set']('type',_0x1eef26['type']||'sidebar'),this['set']('side',_0x1eef26['side']||'right'),this['set']('isVisible',!0x0);const _0x36912b=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':['ck-ai-tabs',_0x36912b['if']('type','ck-ai-tabs__overlay',_0x24e12f=>'overlay'===_0x24e12f),_0x36912b['if']('type','ck-ai-tabs__sidebar',_0x1958fc=>'sidebar'===_0x1958fc),_0x36912b['if']('isVisible','ck-hidden',_0x50e424=>!_0x50e424)]}}),this['buttonViews']['on']('add',(_0x230b5c,_0x5dafa1)=>{_0x5dafa1['set']('withText',!0x1);});}}class ht extends _0x56fd8d{['view'];['container']=null;['showResizeButton']=!0x0;static get['pluginName'](){return'AITabs';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x3cb61a){super(_0x3cb61a);const _0x399c57=this['context']['config']['get']('ai.container');if(this['set']('side','right'),!_0x399c57)throw new _0x58ed45('ai-tabs-configuration-not-found');if(void 0x0!==_0x399c57['showResizeButton']&&(this['showResizeButton']=_0x399c57['showResizeButton']),'sidebar'!==_0x399c57['type']&&'overlay'!==_0x399c57['type']||_0x399c57['side']&&(this['side']=_0x399c57['side']),'sidebar'===_0x399c57['type']){if(this['container']=_0x399c57['element'],this['set']('type','sidebar'),!this['container'])throw new _0x58ed45('ai-tabs-sidebar-container-element-not-found');}else'overlay'===_0x399c57['type']?(this['container']=document['body'],this['set']('type','overlay')):(this['container']=null,this['set']('type','custom'));this['view']=new ai(this['context']['locale'],{'side':this['side'],'type':this['type']}),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 ot&&this['context']['ui']['focusTracker']['add'](this['view']['element']);}['switchType'](_0x123afa){if(_0x123afa&&this['type']!==_0x123afa){if(!di['includes'](_0x123afa))throw new _0x58ed45('ai-tabs-unsupported-ui-type');this['type']=_0x123afa;}}['switchSide'](_0x3568ad){if(_0x3568ad&&this['side']!==_0x3568ad){if(!ui['includes'](_0x3568ad))throw new _0x58ed45('ai-tabs-unsupported-ui-side');this['side']=_0x3568ad;}}['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']();}}function $n(_0xc67190,_0x28fd07,_0x8b0f93){const t=_0xc67190['t'];switch(_0x28fd07){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'},_0x8b0f93);case'AI_SUGGESTION_CONTENT_PART_REJECTED':return t({'id':'AI_SUGGESTION_CONTENT_PART_REJECTED','string':'Change\x20was\x20rejected'});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_SHOW_IN_THE_TEXT':return t({'id':'AI_SUGGESTION_CONTENT_PART_SHOW_IN_THE_TEXT','string':'Preview'});case'AI_SUGGESTION_CONTENT_PART_ADD_AS_SUGGESTION':return t({'id':'AI_SUGGESTION_CONTENT_PART_ADD_AS_SUGGESTION','string':'Insert\x20as\x20suggestion'});case'AI_SUGGESTION_CONTENT_PART_DELETE':return t({'id':'AI_SUGGESTION_CONTENT_PART_DELETE','string':'Reject'});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\x27m\x20your\x20AI\x20assistant.\x20Think\x20of\x20me\x20as\x20your\x20writing\x20buddy,\x20reviewer,\x20or\x20research\x20partner.\x20I\x20can\x20suggest\x20changes\x20to\x20your\x20document,\x20help\x20generate\x20ideas,\x20offer\x20feedback,\x20discuss\x20attached\x20files,\x20and\x20much\x20more!'});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_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.'},_0x8b0f93);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.'},_0x8b0f93);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_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.'},_0x8b0f93);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_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_SHOW_CHANGE_IN_TEXT':return t({'id':'AI_CHAT_SUGGESTION_ACTION_SHOW_CHANGE_IN_TEXT','string':'Preview','plural':'Preview'},_0x8b0f93);case'AI_CHAT_SUGGESTION_ACTION_SHOW_CHANGE_IN_TEXT_TOOLTIP':return t({'id':'AI_CHAT_SUGGESTION_ACTION_SHOW_CHANGE_IN_TEXT_TOOLTIP','string':'Show\x20change\x20in\x20the\x20document','plural':'Show\x20changes\x20in\x20the\x20document'},_0x8b0f93);case'AI_CHAT_SUGGESTION_ACTION_INSERT_SUGGESTION':return t({'id':'AI_CHAT_SUGGESTION_ACTION_INSERT_SUGGESTION','string':'Suggest','plural':'Suggest'},_0x8b0f93);case'AI_CHAT_SUGGESTION_ACTION_INSERT_SUGGESTION_TOOLTIP':return t({'id':'AI_CHAT_SUGGESTION_ACTION_INSERT_SUGGESTION_TOOLTIP','string':'Insert\x20change\x20as\x20suggestion','plural':'Insert\x20changes\x20as\x20suggestions'},_0x8b0f93);case'AI_CHAT_SUGGESTION_ACTION_APPLY_LABEL':return t({'id':'AI_CHAT_SUGGESTION_ACTION_APPLY_LABEL','string':'Apply','plural':'Apply\x20all'},_0x8b0f93);case'AI_CHAT_SUGGESTION_ACTION_APPLY_TOOLTIP':return t({'id':'AI_CHAT_SUGGESTION_ACTION_APPLY_TOOLTIP','string':'Apply\x20changes\x20immediately','plural':'Apply\x20all\x20changes\x20immediately'},_0x8b0f93);case'AI_CHAT_SUGGESTION_MORE_OPTIONS_TOOLTIP':return t({'id':'AI_CHAT_SUGGESTION_MORE_OPTIONS_TOOLTIP','string':'More\x20options'},_0x8b0f93);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_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.'},_0x8b0f93);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.'},_0x8b0f93);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.'},_0x8b0f93);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.'},_0x8b0f93);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'},_0x8b0f93);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_TOOLTIP':return t({'id':'AI_BALLOON_NEXT_TOOLTIP','string':'Next'});case'AI_BALLOON_PREVIOUS_TOOLTIP':return t({'id':'AI_BALLOON_PREVIOUS_TOOLTIP','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_MODEL_DESCRIPTION_AGENT-1':return t({'id':'AI_MODEL_DESCRIPTION_AGENT-1','string':'Automatically\x20selects\x20best\x20model\x20for\x20speed,\x20quality,\x20and\x20cost.'});case'AI_MODEL_DESCRIPTION_GPT-5':return t({'id':'AI_MODEL_DESCRIPTION_GPT-5','string':'OpenAI\x27s\x20flagship\x20model\x20for\x20advanced\x20reasoning,\x20creativity,\x20and\x20complex\x20tasks'});case'AI_MODEL_DESCRIPTION_GPT-5-MINI':return t({'id':'AI_MODEL_DESCRIPTION_GPT-5-MINI','string':'A\x20lightweight\x20version\x20of\x20GPT-5\x20-\x20faster,\x20more\x20cost-efficient'});case'AI_MODEL_DESCRIPTION_GPT-4.1':return t({'id':'AI_MODEL_DESCRIPTION_GPT-4.1','string':'OpenAI\x27s\x20model\x20for\x20reliable\x20reasoning,\x20speed,\x20and\x20versatility'});case'AI_MODEL_DESCRIPTION_GPT-4.1-MINI':return t({'id':'AI_MODEL_DESCRIPTION_GPT-4.1-MINI','string':'A\x20lighter\x20variant\x20of\x20GPT-4.1\x20that\x20balances\x20speed\x20and\x20cost\x20while\x20maintaining\x20solid\x20accuracy'});case'AI_MODEL_DESCRIPTION_CLAUDE-3-5-HAIKU':return t({'id':'AI_MODEL_DESCRIPTION_CLAUDE-3-5-HAIKU','string':'Anthropic\x27s\x20fast,\x20cost-efficient\x20model\x20for\x20simpler\x20tasks'});case'AI_MODEL_DESCRIPTION_CLAUDE-4-SONNET':return t({'id':'AI_MODEL_DESCRIPTION_CLAUDE-4-SONNET','string':'Advanced\x20model\x20with\x20strong\x20reasoning\x20and\x20reliability\x20for\x20complex\x20tasks'});case'AI_MODEL_DESCRIPTION_GEMINI-2-5-PRO':return t({'id':'AI_MODEL_DESCRIPTION_GEMINI-2-5-PRO','string':'Google\x27s\x20advanced\x20model\x20for\x20versatile\x20problem-solving\x20and\x20research'});case'AI_MODEL_DESCRIPTION_GEMINI-2-5-FLASH':return t({'id':'AI_MODEL_DESCRIPTION_GEMINI-2-5-FLASH','string':'Lightweight\x20Gemini\x20model\x20for\x20fast,\x20cost-efficient\x20interactions'});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_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_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_TOGGLE_BUTTON_LABEL':return t({'id':'AI_TOGGLE_BUTTON_LABEL','string':'AI'});default:return _0x28fd07;}}class N extends _0x56fd8d{['_apiUrl'];['_token'];['_decoder'];static get['requires'](){return['CloudServices'];}static get['pluginName'](){return'AIConnector';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x11f1f9){super(_0x11f1f9),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();}['init'](){const _0x466601=this['context']['plugins']['get']('CloudServices');if(!_0x466601['token'])throw new _0x58ed45('ai-missing-token',this);this['_token']=_0x466601['token'];}['startConversation'](_0x3a4de5,_0x3af2d5){const _0x25f29c=this['_sendApiRequest']('/conversations','POST',{'id':_0x3a4de5,'group':_0x3af2d5});return{'getConversation':async()=>(await _0x25f29c['request'])['json'](),'abortController':_0x25f29c['abortController']};}['queryAssistant']({message:_0x5c063c,conversationId:_0x18e791,parts:_0x2d9904,capabilities:_0x5cc221,model:_0x5e66db,quickActionData:_0x4d239a}){const _0x1e9268={..._0x4d239a&&{'quickActionData':_0x4d239a}},_0x545ef2={'prompt':_0x5c063c,'content':_0x2d9904,'model':_0x5e66db,..._0x5cc221&&{'capabilities':_0x5cc221},...Object['keys'](_0x1e9268)['length']>0x0&&{'attributes':_0x1e9268}},_0xbbb221=this['_sendApiRequest']('/conversations/'+_0x18e791+'/messages','POST',_0x545ef2);return{'getStream':async()=>{const _0x12f566=(await _0xbbb221['request'])['body'];return this['_getStreamReader'](_0x12f566);},'abortController':_0xbbb221['abortController']};}['executeCustomAction']({content:_0x171811,message:_0x592008,model:_0x15cae6,outputFormat:_0x276879}){const _0xcfc3ab={'content':[{'type':'text','content':_0x171811}],'prompt':_0x592008,'model':_0x15cae6,'outputFormat':_0x276879},_0x1b0a23=this['_sendApiRequest']('/actions/custom/calls','POST',_0xcfc3ab);return{'getStream':async()=>{const _0x30f29a=(await _0x1b0a23['request'])['body'];return this['_getStreamReader'](_0x30f29a);},'abortController':_0x1b0a23['abortController']};}['executeAction']({actionName:_0xc4ca66,content:_0x589caa,args:_0x858840}){const _0x1a3902={'content':[{'type':'text','content':_0x589caa}],'args':_0x858840},_0x4afa2b=this['_sendApiRequest']('/actions/system/'+_0xc4ca66+'/calls','POST',_0x1a3902);return{'getStream':async()=>{const _0x3ce89f=(await _0x4afa2b['request'])['body'];return this['_getStreamReader'](_0x3ce89f);},'abortController':_0x4afa2b['abortController']};}['uploadFile'](_0x30d8b5,_0x1e3aaf,_0x591262){const _0x373e1c=new FormData();_0x373e1c['append']('file',_0x1e3aaf,_0x1e3aaf['name']),_0x591262&&_0x373e1c['append']('attributes',JSON['stringify'](_0x591262));const _0x4895ed=this['_sendApiRequest']('/conversations/'+_0x30d8b5+'/files','POST',_0x373e1c);return{'getId':async()=>(await _0x4895ed['request'])['json'](),'abortController':_0x4895ed['abortController']};}['fetchDocument'](_0x27f928,_0x4fb37e){const _0x99167a=this['_sendApiRequest']('/conversations/'+_0x27f928+'/documents/'+_0x4fb37e,'GET');return{'getDocument':async()=>(await _0x99167a['request'])['json'](),'abortController':_0x99167a['abortController']};}['uploadDocument'](_0x123dcf,_0x2ff09d,_0x224f47){const _0x3b9e0b={'content':_0x2ff09d};_0x224f47&&(_0x3b9e0b['attributes']=_0x224f47);const _0x37e225=this['_sendApiRequest']('/conversations/'+_0x123dcf+'/documents','POST',_0x3b9e0b);return{'getId':async()=>(await _0x37e225['request'])['json'](),'abortController':_0x37e225['abortController']};}['fetchConversations'](_0x3852e6,_0x43ca31){const _0x4e5c47=new URLSearchParams();_0x4e5c47['append']('excludeEmpty','true'),_0x4e5c47['append']('limit','100'),_0x4e5c47['append']('group',_0x3852e6),_0x43ca31&&_0x4e5c47['append']('search',_0x43ca31);const _0x49f9da=this['_sendApiRequest']('/conversations?'+_0x4e5c47['toString'](),'GET');return{'getConversations':async()=>{const _0x4ebb5a=await _0x49f9da['request'];return(await _0x4ebb5a['json']())['items'];},'abortController':_0x49f9da['abortController']};}['deleteConversation'](_0xe4eaf5){const _0x1ffca3=this['_sendApiRequest']('/conversations/'+_0xe4eaf5,'DELETE');return{'execute':async()=>{await _0x1ffca3['request'];},'abortController':_0x1ffca3['abortController']};}['updateConversation'](_0x5dbad0,_0x1ddf31){const _0x142c21=this['_sendApiRequest']('/conversations/'+_0x5dbad0,'PATCH',_0x1ddf31);return{'getResult':async()=>(await _0x142c21['request'],_0x1ddf31),'abortController':_0x142c21['abortController']};}['fetchConversation'](_0x55cf4f){const _0x7c2e3b=this['_sendApiRequest']('/conversations/'+_0x55cf4f,'GET');return{'getConversation':async()=>(await _0x7c2e3b['request'])['json'](),'abortController':_0x7c2e3b['abortController']};}['fetchConversationMessages'](_0x173e32){const _0x525e7a=this['_sendApiRequest']('/conversations/'+_0x173e32+'/messages','GET');return{'getMessages':async()=>{const _0x2d0270=await _0x525e7a['request'];return(await _0x2d0270['json']())['items'];},'abortController':_0x525e7a['abortController']};}['uploadUrl'](_0x4eea7d,_0x34bb64,_0x4e452e){const _0x5cb774=this['_sendApiRequest']('/conversations/'+_0x4eea7d+'/web-resources','POST',{'url':_0x34bb64,'attributes':_0x4e452e});return{'getId':async()=>(await _0x5cb774['request'])['json'](),'abortController':_0x5cb774['abortController']};}['getModels'](){const _0x10dbea=this['_sendApiRequest']('/models/1','GET');return{'list':async()=>{const _0x54d26b=await(await _0x10dbea['request'])['json'](),_0xd7f777=_0x54d26b['items']['map'](_0x464ae=>({..._0x464ae,'description':$n(this['context']['locale'],'AI_MODEL_DESCRIPTION_'+_0x464ae['id']['toUpperCase']())}));return{..._0x54d26b,'items':_0xd7f777};},'abortController':_0x10dbea['abortController']};}['deleteFile'](_0x5af591,_0x47101d){const _0x1ecd2f=this['_sendApiRequest']('/conversations/'+_0x5af591+'/files/'+_0x47101d,'DELETE');return{'execute':async()=>{await _0x1ecd2f['request'];},'abortController':_0x1ecd2f['abortController']};}['deleteDocument'](_0x223776,_0x173146){const _0x340651=this['_sendApiRequest']('/conversations/'+_0x223776+'/documents/'+_0x173146,'DELETE');return{'execute':async()=>{await _0x340651['request'];},'abortController':_0x340651['abortController']};}['deleteWebResource'](_0x22d76d,_0x1f0986){const _0x52424b=this['_sendApiRequest']('/conversations/'+_0x22d76d+'/web-resources/'+_0x1f0986,'DELETE');return{'execute':async()=>{await _0x52424b['request'];},'abortController':_0x52424b['abortController']};}['callSystemReview']({reviewName:_0x567df3,content:_0x26b322,args:_0x20e211}){const _0x4cb993=this['_sendApiRequest']('/reviews/system/'+_0x567df3+'/calls','POST',{'content':[{'type':'text','content':_0x26b322}],'args':_0x20e211});return{'getStream':async()=>{const _0x45f38d=(await _0x4cb993['request'])['body'];return this['_getStreamReader'](_0x45f38d);},'abortController':_0x4cb993['abortController']};}['callCustomReview']({content:_0x310ce6,prompt:_0xd57046,model:_0x16732c}){const _0x30275e=this['_sendApiRequest']('/reviews/custom/calls','POST',{'content':[{'type':'text','content':_0x310ce6}],'prompt':_0xd57046,'model':_0x16732c});return{'getStream':async()=>{const _0x3b3cb5=(await _0x30275e['request'])['body'];return this['_getStreamReader'](_0x3b3cb5);},'abortController':_0x30275e['abortController']};}['_sendApiRequest'](_0x29218b,_0x527afb,_0x37df96){const _0x14e712=new AbortController(),_0x2082af=_0x37df96 instanceof FormData,_0x41b634={'Authorization':'Bearer\x20'+this['_token']?.['value']};_0x37df96&&!_0x2082af&&(_0x41b634['Content-Type']='application/json');const _0x20bdd5={'method':_0x527afb,'headers':_0x41b634,'signal':_0x14e712['signal']};return _0x37df96&&(_0x20bdd5['body']=_0x2082af?_0x37df96:JSON['stringify'](_0x37df96)),{'request':fetch(''+this['_apiUrl']+_0x29218b,_0x20bdd5)['catch'](_0x58d380=>{this['_handleError'](_0x58d380);})['then'](_0x244f67=>{if(!_0x244f67['ok'])throw new _0x58ed45('ai-request-failed',this,{'url':this['_apiUrl'],'path':_0x29218b,'method':_0x527afb,'body':_0x37df96,'status':(_0x244f67||{})['status'],'statusText':(_0x244f67||{})['statusText']});return _0x244f67;}),'abortController':_0x14e712};}async*['_getStreamReader'](_0xa497fc){const _0x9f4717=[],_0x28b170=_0xa497fc['getReader'](),_0x2161c8=wt({'onError':_0x44393b=>{this['_handleError'](_0x44393b);},'onEvent':_0x13e7af=>{_0x13e7af['data']=JSON['parse'](_0x13e7af['data']),_0x9f4717['push'](_0x13e7af);}});try{let _0x2965aa=!0x1;for(;!_0x2965aa;){const {done:_0x55d6b9,value:_0x1b5965}=await _0x28b170['read']();_0x55d6b9&&(_0x2965aa=!0x0),_0x2161c8['feed'](this['_decoder']['decode'](_0x1b5965,{'stream':!0x0})),yield*_0x9f4717,_0x9f4717['length']=0x0;}}catch(_0x5cffa4){this['_handleError'](_0x5cffa4);}finally{_0x28b170['releaseLock'](),_0x2161c8['reset']();}}['_handleError'](_0x312007){if(_0x312007 instanceof _0x58ed45)throw _0x312007;if(_0x312007 instanceof Error&&'AbortError'===_0x312007['name'])throw new _0x58ed45('ai-request-aborted',this,{'originalError':_0x312007});throw new _0x58ed45('ai-request-failed',this,{'originalError':_0x312007});}}function As(_0x174fb2,_0x28e80e){const _0x4683dd=new _0x23128a(_0x174fb2),_0x5259b0=$n(_0x174fb2,'AI_TABS_LABEL_MINIMIZE'),_0x31d916=$n(_0x174fb2,'AI_TABS_LABEL_MAXIMIZE');return _0x4683dd['set']({'withText':!0x1,'icon':_0x3f6bd3,'tooltip':!0x0,'class':'ck-ai-tabs__resize\x20ck-ai-button-tertiary-text'}),_0x4683dd['bind']('label')['to'](_0x28e80e,'isMaximized',_0x1d91f0=>_0x1d91f0?_0x5259b0:_0x31d916),_0x4683dd['bind']('icon')['to'](_0x28e80e,'isMaximized',_0x5248da=>_0x5248da?_0x4b1253:_0x3f6bd3),_0x4683dd['bind']('isOn')['to'](_0x28e80e,'isMaximized'),_0x4683dd['on']('execute',()=>{_0x28e80e['fire']('resizeTabs');}),_0x4683dd;}function Ne(_0x2b5a20){return _0x1fc7d8(_0x2b5a20);}function Ct(_0x5366a3){return _0x4e6e9a(_0x5366a3);}function It(_0x2c7484,_0x472800,_0x363b92){const _0x27db22=null!==_0x472800?_0xceca70=>_0xceca70['attribs'][_0x2c7484]===_0x472800:_0x3e1a90=>Boolean(_0x3e1a90['attribs'][_0x2c7484]);return mt(_0x51ba47=>_0x37924d(_0x51ba47)&&_0x27db22(_0x51ba47),_0x363b92);}function He(_0x3b7bc7,_0x406c46,_0x31f5e0){const _0x43574e=null!==_0x406c46?_0x24200a=>_0x24200a['attribs'][_0x3b7bc7]===_0x406c46:_0x41fdff=>Boolean(_0x41fdff['attribs'][_0x3b7bc7]);return _0x1906cd(_0x5de19=>_0x37924d(_0x5de19)&&_0x43574e(_0x5de19),_0x31f5e0);}function ft(_0x5b7020,_0x206d78){return _0x5b7020&&_0x37924d(_0x5b7020)?_0x5b7020['attribs'][_0x206d78]:null;}function Bi(_0x2070ca,_0x9c699d,_0x2af8ba){_0x37924d(_0x2070ca)&&(null===_0x2af8ba?delete _0x2070ca['attribs'][_0x9c699d]:_0x2070ca['attribs'][_0x9c699d]=_0x2af8ba);}function Qe(_0x5ecf2b,_0x277886,_0x1569fe){const _0x11e041=_0x277886['cloneNode'](!0x0);'beforebegin'===_0x1569fe?_0xd8f6c8(_0x5ecf2b,_0x11e041):'afterbegin'===_0x1569fe?to(_0x5ecf2b,_0x11e041):'beforeend'===_0x1569fe?_0x12bd4b(_0x5ecf2b,_0x11e041):'afterend'===_0x1569fe&&_0x106cca(_0x5ecf2b,_0x11e041);}function Ge(_0x48a3c3){const _0x6640cd=[];let _0x45d1f2=_0x48a3c3;for(;_0x45d1f2;)_0x45d1f2=_0x540c06(_0x45d1f2),_0x45d1f2&&_0x6640cd['push'](_0x45d1f2);return _0x6640cd;}function qn(_0x4e4c4f){return _0x4e4c4f['replace'](/^\s+/gm,'')['replace'](/\s+$/gm,'')['replace'](/\n*/g,'')['replace'](/\s+/g,'\x20')['replace'](/>\s*</g,'><');}function zi(_0x101f40){let _0x3ea756=0x0;for(;_0x101f40['parentNode'];)_0x101f40=_0x101f40['parentNode'],_0x3ea756++;return _0x3ea756;}function Ji(_0x480dca){const _0x53d2a5=[];let _0x63a1c7=_0x480dca['nextSibling'];for(;_0x63a1c7;)_0x53d2a5['push'](_0x63a1c7),_0x63a1c7=_0x63a1c7['nextSibling'];_0x53d2a5['forEach'](_0x366079=>{_0x55d0bd(_0x366079);});}class qe extends/* #__PURE__ -- @preserve */
|
|
25
|
+
ts(){['_m2html'];constructor(){super(),this['_m2html']=new _0xf7ea17();}['convertMarkdownToHTML'](_0x330023){const _0x5ec289=this['_m2html']['parse'](_0x330023);return this['parseAndNormalizeHTML'](_0x5ec289);}['parseAndNormalizeHTML'](_0x4fbbbb){return this['_parseHTML'](_0x4fbbbb);}['_parseHTML'](_0x20d043){const _0x4b202a=Ne('<dummy>'+_0x20d043['replace'](/^\t+/gm,'\x20')['replace'](/\n*/g,'')['replace'](/\s+/g,'\x20')['replace'](/<[^>]*?$/g,'')+'</dummy>');return _0x4b202a['children']=_0x4b202a['children'][0x0]['children'],_0x4b202a;}}class ze extends/* #__PURE__ -- @preserve */
|
|
26
|
+
ts(){['_generateUid'];['_touchedNodesState']={'newIds':[],'modifiedIds':[],'removedIds':[],'invalidIds':[],'lastTouchedId':null};['_existingDataIds']=new Set();constructor(_0x23d129){super(),this['_generateUid']=_0x23d129||_0x2ef42f;}['merge'](_0x4e5540,_0xd34650,_0x1fe27d){const _0x1a38e6=_0x4e5540['cloneNode'](!0x0);if(0x0===_0xd34650['childNodes']['length']){const _0x3c6eb5=[];return He('data-id','new-element',_0x1a38e6)['forEach'](_0x583654=>{const _0x5f55c8=this['_generateUid']();Bi(_0x583654,'data-id',_0x5f55c8),_0x3c6eb5['push'](_0x5f55c8);}),this['_removeSpecialComments'](_0x1a38e6),{'parsedContent':_0x1a38e6,'newNodeIds':_0x3c6eb5,'modifiedNodeIds':[],'removedNodeIds':[]};}_0x1fe27d&&_0x1fe27d['markUnstableElements']&&this['_markLastTagElementUnstable'](_0x1a38e6),this['_touchedNodesState']['newIds']=[],this['_touchedNodesState']['modifiedIds']=[],this['_touchedNodesState']['removedIds']=[],this['_touchedNodesState']['invalidIds']=[],this['_touchedNodesState']['lastTouchedId']=null,this['_existingDataIds']=new Set(He('data-id',null,_0xd34650)['map'](_0x22f6ca=>ft(_0x22f6ca,'data-id'))['filter'](_0x1fe9b7=>!!_0x1fe9b7));let _0x2c6166=-0x1,_0x23da8f=!0x1;const _0x1ef5ad=_0x1a38e6['childNodes'],_0x26b455=Array['from'](_0x1ef5ad)['filter'](_0x1da3ba=>!(0x3===_0x1da3ba['nodeType']&&''===Ct(_0x1da3ba)['trim']())),_0x37bc1c=_0x26b455['length'];for(let _0x259330=0x0;_0x259330<_0x37bc1c;_0x259330++){const _0x2acd04=_0x26b455[_0x259330],_0x15d8e8=_0x26b455[_0x259330+0x1];if(this['_isNewNode'](_0x2acd04)){if(-0x1===_0x2c6166&&(_0x2c6166=_0x259330),this['_markWrappedElements'](_0x2acd04),!this['_isNewNode'](_0x15d8e8)){const [_0x9f94c7,_0x476b49]=this['_findReferenceNode'](_0x2acd04,_0x23da8f,_0xd34650);if(_0x9f94c7){const _0xc99009=Array['from'](_0x26b455)['slice'](_0x2c6166,_0x259330+0x1);this['_insertNodes'](_0x9f94c7,_0xc99009,_0x476b49),_0x2c6166=-0x1;}}}else{if(this['_isExistingContentComment'](_0x2acd04))_0x23da8f=!0x0;else{if(this['_isExistingNode'](_0x2acd04)){const _0x328345=ft(_0x2acd04,'data-id');if(_0x328345&&this['_existingDataIds']['has'](_0x328345)){const _0x584bee=It('data-id',_0x328345,_0xd34650);this['_replaceNode'](_0x584bee,_0x2acd04);}if(this['_touchedNodesState']['removedIds']['includes'](_0x328345)){const _0x3729b5=this['_touchedNodesState']['removedIds']['indexOf'](_0x328345);this['_touchedNodesState']['removedIds']['splice'](_0x3729b5,0x1);}}else{if(this['_isDelNode'](_0x2acd04)){const _0x1944af=ft(_0x2acd04,'data-id');this['_touchedNodesState']['modifiedIds']['includes'](_0x1944af)||this['_storeDeletedElementIds'](_0x2acd04);}}}}}for(const _0x98fc2 of this['_touchedNodesState']['removedIds']){const _0x547ec9=It('data-id',_0x98fc2,_0xd34650);if(_0x547ec9){if(_0x1fe27d&&_0x1fe27d['replaceRemovedWith']){this['_touchedNodesState']['lastTouchedId']=_0x98fc2;const _0xf05c2f=_0x1fe27d['replaceRemovedWith']['cloneNode'](!0x0);Bi(_0xf05c2f,'data-id',_0x98fc2),Bi(_0xf05c2f,'data-removed','true'),_0x17ba01(_0x547ec9,_0xf05c2f);}else _0x55d0bd(_0x547ec9);}}if(He('data-wrapped-id',null,_0xd34650)['forEach'](_0x29e39d=>{const _0x2b22d9=It('data-id',ft(_0x29e39d,'data-wrapped-id'),_0xd34650);var _0x353137,_0x54698a;_0x2b22d9&&(_0x54698a=_0x29e39d,_0x55d0bd(_0x353137=_0x2b22d9),_0x17ba01(_0x54698a,_0x353137));}),He('data-id','new-element',_0xd34650)['forEach'](_0x552b27=>{const _0x2cc883=this['_getUid'](_0x552b27);Bi(_0x552b27,'data-id',_0x2cc883),this['_touchedNodesState']['newIds']['push'](_0x2cc883);}),this['_removeSpecialComments'](_0xd34650),_0x1fe27d&&_0x1fe27d['markUnstableElements']&&this['_markUnstableElements'](_0xd34650,_0x1fe27d['markUnstableElementsDepth']||0x0),_0x1fe27d&&_0x1fe27d['cutAfterLastChange']&&this['_touchedNodesState']['lastTouchedId']){let _0x1de626=It('data-id',this['_touchedNodesState']['lastTouchedId'],_0xd34650);for(;_0x1de626;)Ji(_0x1de626),_0x1de626=_0x1de626['parentNode'];}return{'parsedContent':_0xd34650,'newNodeIds':this['_touchedNodesState']['newIds'],'modifiedNodeIds':this['_touchedNodesState']['modifiedIds'],'removedNodeIds':this['_touchedNodesState']['removedIds']};}['_insertNodes'](_0x49f537,_0x5db23a,_0x58569b){for(const _0x2a6e47 of _0x5db23a){const _0x149fc8=this['_getUid'](_0x2a6e47);Bi(_0x2a6e47,'data-id',_0x149fc8),this['_touchedNodesState']['newIds']['push'](_0x149fc8),this['_touchedNodesState']['lastTouchedId']=_0x149fc8;}const _0x3c9b8b='afterbegin'===_0x58569b||'afterend'===_0x58569b?_0x5db23a['reverse']():_0x5db23a;for(const _0xebebf5 of _0x3c9b8b)Qe(_0x49f537,_0xebebf5,_0x58569b);}['_replaceNode'](_0x4cb3d9,_0xabed33){if(!_0x4cb3d9)return;if(_0x541e41=_0xabed33,qn(Ct(_0x4cb3d9))===qn(Ct(_0x541e41)))return;var _0x541e41;const _0x4e6a49=this['_getUid'](_0x4cb3d9);Bi(_0xabed33,'data-id',_0x4e6a49),this['_touchedNodesState']['modifiedIds']['push'](_0x4e6a49),this['_touchedNodesState']['lastTouchedId']=_0x4e6a49,_0x17ba01(_0x4cb3d9,_0xabed33['cloneNode'](!0x0));}['_findReferenceNode'](_0x4fc266,_0x4636b9,_0x3d405d){const _0x365e08=this['_findPrevElementWithDataId'](_0x4fc266,!0x1);if(_0x365e08){const _0x4bd34c=this['_getNodeDataId'](_0x365e08),_0x20111b=It('data-id',_0x4bd34c,_0x3d405d);if(_0x20111b)return[_0x20111b,'afterend'];this['_touchedNodesState']['invalidIds']['push'](_0x4bd34c);}const _0x49198b=this['_findNextElementWithDataId'](_0x4fc266,!0x1);if(_0x49198b){const _0x2ab107=this['_getNodeDataId'](_0x49198b),_0x4d0022=It('data-id',_0x2ab107,_0x3d405d);if(_0x4d0022)return[_0x4d0022,'beforebegin'];this['_touchedNodesState']['invalidIds']['push'](_0x2ab107);}return _0x4636b9?_0x4fc266['nextSibling']?this['_findFallbackReferenceNode'](_0x4fc266,_0x3d405d):[_0x3d405d['childNodes'][_0x3d405d['childNodes']['length']-0x1],'afterend']:[_0x3d405d['childNodes'][0x0],'beforebegin'];}['_findFallbackReferenceNode'](_0x893344,_0x3028a6){const _0x574338=[],_0x3cbb9a=this['_findPrevElementWithDataId'](_0x893344,!0x0);if(_0x3cbb9a){const _0x2ae957=It('data-id',this['_getNodeDataId'](_0x3cbb9a),_0x3028a6);_0x2ae957&&_0x574338['push']([_0x2ae957,'afterend']);}const _0x4ecf91=this['_findNextElementWithDataId'](_0x893344,!0x0);if(_0x4ecf91){const _0x52832c=It('data-id',this['_getNodeDataId'](_0x4ecf91),_0x3028a6);_0x52832c&&_0x574338['push']([_0x52832c,'beforebegin']);}if(_0x574338['length']>0x1)return zi(_0x574338[0x0][0x0])<=zi(_0x574338[0x1][0x0])?_0x574338[0x0]:_0x574338[0x1];return 0x1===_0x574338['length']?_0x574338[0x0]:[_0x3028a6['lastChild'],'afterend'];}['_findNextElementWithDataId'](_0x595192,_0xfa5797){let _0x34044c=_0x595192['nextSibling'],_0x412142=null,_0x35becd=!0x1;for(;_0x34044c;){if(_0x386a1a(_0x34044c)){if(this['_isDelNode'](_0x34044c)&&(_0x412142=_0x34044c),this['_isExistingContentComment'](_0x34044c)&&_0xfa5797&&!_0x35becd){_0x35becd=!0x0,_0x34044c=_0x34044c['nextSibling'];continue;}break;}const _0x28afaf=ft(_0x34044c,'data-id');if(_0x28afaf&&'new-element'!==_0x28afaf&&this['_existingDataIds']['has'](_0x28afaf)){_0x412142=_0x34044c;break;}_0x34044c=_0x34044c['nextSibling'];}return _0x412142;}['_findPrevElementWithDataId'](_0x1778e4,_0x2c3102){let _0x2cacef=_0x1778e4['previousSibling'],_0x4a71e5=null,_0x5ce113=!0x1;for(;_0x2cacef;){if(_0x386a1a(_0x2cacef)){if(this['_isDelNode'](_0x2cacef)&&(_0x4a71e5=_0x2cacef),this['_isExistingContentComment'](_0x2cacef)&&_0x2c3102&&!_0x5ce113){_0x5ce113=!0x0,_0x2cacef=_0x2cacef['previousSibling'];continue;}break;}const _0x220e73=ft(_0x2cacef,'data-id');if(_0x220e73&&'new-element'!==_0x220e73&&this['_existingDataIds']['has'](_0x220e73)){_0x4a71e5=_0x2cacef;break;}_0x2cacef=_0x2cacef['previousSibling'];}return _0x4a71e5;}['_markWrappedElements'](_0x41c8e5){_0x37924d(_0x41c8e5)&&He('data-id',null,_0x41c8e5)['forEach'](_0x133683=>{this['_isExistingNode'](_0x133683)&&!this['_hasWrappedParent'](_0x133683)&&(Bi(_0x133683,'data-wrapped-id',ft(_0x133683,'data-id')),Bi(_0x133683,'data-id',null));});}['_getNodeDataId'](_0x57be3f){if(!_0x57be3f)return null;if(_0x37924d(_0x57be3f))return ft(_0x57be3f,'data-id');if(_0x386a1a(_0x57be3f)){const _0x2ba748=Ct(_0x57be3f)['match'](/removed[\s*-]data-id="([^"]+)"/);if(_0x2ba748&&_0x2ba748[0x1])return _0x2ba748[0x1];}return null;}['_storeDeletedElementIds'](_0x16cdfd){if(_0x386a1a(_0x16cdfd)){const _0x4ccfcf=Ct(_0x16cdfd)['match'](/removed[\s*-]data-id="([^"]+)"/);_0x4ccfcf&&_0x4ccfcf[0x1]&&this['_touchedNodesState']['removedIds']['push'](_0x4ccfcf[0x1]);}}['_getUid'](_0x2683b0){return this['_isExistingNode'](_0x2683b0)?ft(_0x2683b0,'data-id'):this['_generateUid']();}['_removeSpecialComments'](_0x210ad6){(function(_0x47d909){return _0x20425e(_0x18e4f9=>_0x386a1a(_0x18e4f9),_0x47d909,!0x0,0x1/0x0);}(_0x210ad6)['filter'](_0x3bd4ad=>this['_isDelNode'](_0x3bd4ad)||this['_isExistingContentComment'](_0x3bd4ad))['forEach'](_0x26e262=>{_0x55d0bd(_0x26e262);}));}['_markLastTagElementUnstable'](_0x7e6e87){const _0x5ddfc9=_0x7e6e87['childNodes'],_0x4d64d9=_0x5ddfc9[_0x5ddfc9['length']-0x1];_0x4d64d9&&_0x37924d(_0x4d64d9)&&Bi(_0x4d64d9,'data-unstable','true');}['_markUnstableElements'](_0x27b55d,_0x3ebe37){const _0x18c59f=It('data-unstable','true',_0x27b55d);if(!_0x18c59f)return;const _0x50d5b5=Ge(_0x18c59f)['slice'](0x0,-0x1),_0x2fd901=_0x50d5b5['length'];let _0x55b0d5=_0x18c59f;if(_0x2fd901>_0x3ebe37){let _0x2836d6=_0x2fd901,_0x418402=null;for(;_0x2836d6>_0x3ebe37&&_0x2836d6>=0x0;)_0x2836d6--,_0x418402=_0x50d5b5[_0x2836d6];_0x418402&&(_0x55b0d5=_0x418402,Bi(_0x18c59f,'data-unstable',null),Bi(_0x418402,'data-unstable','true'));}else{if(_0x2fd901<_0x3ebe37){let _0x3eaad4=_0x2fd901,_0x46513f=_0x18c59f;for(;_0x3eaad4<_0x3ebe37;){const _0x44bcf7=_0x46513f['childNodes']['filter'](_0x2cc2fe=>_0x37924d(_0x2cc2fe));if(0x0===_0x44bcf7['length'])break;_0x3eaad4++,_0x46513f=_0x44bcf7[_0x44bcf7['length']-0x1];}_0x46513f&&(_0x55b0d5=_0x46513f,Bi(_0x18c59f,'data-unstable',null),Bi(_0x46513f,'data-unstable','true'));}}let _0x5c96b8=_0x55b0d5;for(;_0x5c96b8;){for(;_0x5c96b8['nextSibling'];)_0x5c96b8=_0x5c96b8['nextSibling'],_0x37924d(_0x5c96b8)&&Bi(_0x5c96b8,'data-unstable','true');_0x5c96b8=_0x5c96b8['parentNode'];}}['_isNewNode'](_0x593024){return Boolean('new-element'===ft(_0x593024,'data-id'));}['_isExistingNode'](_0x674abf){return Boolean((ft(_0x674abf,'data-id')||'')['length']>0x0&&'new-element'!==ft(_0x674abf,'data-id'));}['_isDelNode'](_0x5bf000){return!!_0x5bf000&&Boolean(_0x386a1a(_0x5bf000)&&Ct(_0x5bf000)['match'](/removed[\s*-]data-id="[^"]+"/));}['_hasWrappedParent'](_0x1978bc){let _0x366a19=_0x1978bc['parentNode'];for(;_0x366a19;){if(ft(_0x366a19,'data-wrapped-id'))return!0x0;_0x366a19=_0x366a19['parentNode'];}return!0x1;}['_isExistingContentComment'](_0x4d1782){return Boolean(_0x386a1a(_0x4d1782)&&Ct(_0x4d1782)['match'](/\s*existing[\s*-](content|document)\s*/g));}}const Qn=['modification-delta','text-delta'],Xn=['reasoning'];class fe extends ts(){['id'];['interactionId'];['type'];['sources']=[];['parsedContent']=new _t([]);['parsedMergedContent']=new _t([]);['changeGroups']=[];['areActionsDisabled']=!0x1;['documentContextContent'];['aiResponseParser'];['aiResponseApplier'];['editor'];constructor({type:_0x4d6ab8,content:_0x40b90f='',isDone:_0x24d7eb=!0x1,interactionId:_0x1f8efc,areActionsDisabled:_0x17f8e8,documentContextContent:_0x45d616,editor:_0x41d477}){super(),this['id']=_0x2ef42f(),this['interactionId']=_0x1f8efc,this['type']=_0x4d6ab8,this['areActionsDisabled']=!!_0x17f8e8,this['editor']=_0x41d477,this['aiResponseParser']=new qe(),this['aiResponseApplier']=new ze(),this['documentContextContent']=Ne(_0x45d616||''),this['set']('isDone',_0x24d7eb),this['on']('change:content',()=>{this['onContentChange']();}),this['set']('content',_0x40b90f);}['appendContent'](_0x1383d3){this['set']('content',this['content']+_0x1383d3);}['done'](){this['isDone']||(this['set']('isDone',!0x0),this['onContentChange']());}['destroy'](){this['stopListening']();}['setChangeGroupState'](_0x5a2b22,_0x37e078){this['changeGroups'][_0x5a2b22]['state']=_0x37e078,this['fire']('replyChangeGroupStateUpdated',{'reply':this,'index':_0x5a2b22,'state':_0x37e078});}['onContentChange'](){if('modification-delta'===this['type']){this['parsedContent']=this['aiResponseParser']['parseAndNormalizeHTML'](this['content']);const _0x2cab84=this['changeGroups'];this['updateChangeGroups']();const _0x3c3292=this['_getDifferentChangeGroups'](_0x2cab84,this['changeGroups']);(_0x3c3292['length']||this['isDone'])&&this['fire']('replyContentUpdated',this,_0x3c3292);}else this['parsedContent']=this['aiResponseParser']['convertMarkdownToHTML'](this['content']),this['fire']('replyContentUpdated',this);}['_getDifferentChangeGroups'](_0x51e180,_0x24b406){const _0x35a418=[];for(const _0x43cc27 of _0x24b406){const _0x2b7dff=_0x51e180[_0x43cc27['index']];_0x2b7dff?_0x2b7dff['changes']['length']!==_0x43cc27['changes']['length']?_0x35a418['push'](_0x43cc27):_0x2b7dff['changes']['forEach']((_0x2c0fdb,_0x3a762f)=>{const _0x6c8b11=_0x43cc27['changes'][_0x3a762f];_0x2c0fdb['id']!==_0x6c8b11['id']&&_0x35a418['push'](_0x43cc27);}):_0x35a418['push'](_0x43cc27);}return _0x35a418;}['updateChangeGroups'](){const _0x2b42a9=new _0x4542ca('p',{},[new _0x4542ca('span',{'style':'color:\x20#808080;\x20font-style:\x20italic'},[new _0x528111('Removed\x20content.\x20Use\x20\x22Show\x20changes\x22\x20to\x20learn\x20more.')])]),_0x1657db=this['aiResponseApplier']['merge'](this['parsedContent'],this['documentContextContent']['cloneNode'](!0x0),{'markUnstableElements':!this['isDone'],'replaceRemovedWith':_0x2b42a9,'cutAfterLastChange':!this['isDone']});if(!_0x1657db['modifiedNodeIds']['length']&&!this['isDone'])return;this['parsedMergedContent']=_0x1657db['parsedContent'];let _0x487261=[];if(_0x1906cd(_0x41e30e=>{const _0x25df5c=ft(_0x41e30e,'data-id');if(!_0x25df5c||!_0x144276(_0x25df5c))return!0x1;const _0xe82db6=[_0x41e30e,...Ge(_0x41e30e)]['at'](-0x2);if(_0x41e30e!=_0xe82db6){const _0x3543ca=ft(_0xe82db6,'data-id');_0x144276(_0x3543ca)||(_0x487261['push']({'node':_0xe82db6,'id':_0x3543ca,'type':'modified'}),_0x1657db['modifiedNodeIds']['push'](_0x3543ca));}else _0x1657db['modifiedNodeIds']['includes'](_0x25df5c)?_0x487261['push']({'node':_0x41e30e,'type':'modified','id':_0x25df5c}):_0x1657db['newNodeIds']['includes'](_0x25df5c)?_0x487261['push']({'node':_0x41e30e,'type':'new','id':_0x25df5c,'anchorId':ft(_0x41e30e['previousSibling'],'data-id')}):_0x487261['push']({'node':_0x41e30e,'type':'removed','id':_0x25df5c});return!0x0;},this['parsedMergedContent']),_0x487261=_0x487261['filter'](({node:_0x1dce31})=>[...Ge(_0x1dce31),_0x1dce31]['every'](_0x477223=>!ft(_0x477223,'data-unstable'))),0x0==_0x487261['length'])return;const _0x3c4253=[[_0x487261[0x0]]];for(let _0xfea6cb=0x1;_0xfea6cb<_0x487261['length'];_0xfea6cb++){const _0x5aab44=_0x3c4253[_0x3c4253['length']-0x1],_0x26af5e=_0x5aab44[_0x5aab44['length']-0x1];_0x487261[_0xfea6cb]['node']['previousSibling']==_0x26af5e['node']&&'modified'!=_0x487261[_0xfea6cb]['type']&&'modified'!=_0x26af5e['type']?_0x5aab44['push'](_0x487261[_0xfea6cb]):_0x3c4253['push']([_0x487261[_0xfea6cb]]);}for(const _0x3514d5 of _0x3c4253){const _0x588c28=_0x3514d5[0x0],_0x273329=_0x3514d5[_0x3514d5['length']-0x1],_0x5bf51a=_0x4790d6(_0x588c28['node']['previousSibling']);_0x5bf51a&&_0x3514d5['unshift'](_0x5bf51a);const _0xb79928=_0x4790d6(_0x273329['node']['nextSibling']);_0xb79928&&_0x3514d5['push'](_0xb79928);}function _0x144276(_0x90e9b){return _0x1657db['modifiedNodeIds']['includes'](_0x90e9b)||_0x1657db['newNodeIds']['includes'](_0x90e9b)||_0x1657db['removedNodeIds']['includes'](_0x90e9b);}function _0x4790d6(_0x303691){if(_0x303691&&ft(_0x303691,'data-id')&&!ft(_0x303691,'data-unstable')){const _0x106c63=ft(_0x303691,'data-id');if(!_0x144276(_0x106c63))return{'node':_0x303691,'type':'context','id':_0x106c63};}return null;}this['changeGroups']=_0x3c4253['map']((_0x5c128f,_0x575bfc)=>({'changes':_0x5c128f,'state':'pending','index':_0x575bfc}));}}function Fi(_0x5d3a86){return Object['values'](Qn)['includes'](_0x5d3a86);}function Di(_0x570fb2){return Xn['includes'](_0x570fb2);}function Ui(_0x5c605c){return'conversation-title'===_0x5c605c;}function qi(_0x573ebc){return'source'===_0x573ebc;}const xe=['interactionCreated','interactionStarted','interactionStopped','interactionFinished','interactionDestroyed','replyCreated','replyContentUpdated','replyChangeGroupStateUpdated','setConversationTitle','error'];class ge extends _0x5f2b03(){['id'];['replies']=[];['currentReply'];['currentRequest'];['connector'];['isStopped']=!0x1;['isDestroyed']=!0x1;['editor'];constructor({connector:_0x1ff84a,editor:_0x550ee7}){super(),this['id']=_0x2ef42f(),this['connector']=_0x1ff84a,this['isStopped']=!0x0,this['editor']=_0x550ee7;}async['start'](){let _0xb73037;this['isStopped']=!0x1;try{this['currentRequest']=await this['sendRequest'](),this['fire']('interactionStarted',this);const _0x3021a1=await this['currentRequest']['getStream'](),_0x489331=[];for await(const _0x43298f of _0x3021a1){if(this['isStopped'])return;if('error'===_0x43298f['event'])return void this['fire']('error',{'error':new _0x58ed45('ai-chat-interaction-error',this)});Ui(_0x43298f['event'])&&this['setConversationTitle'](_0x43298f['data']['conversationTitle'],!0x0),qi(_0x43298f['event'])?_0x489331['push'](_0x43298f['data']['source']):Fi(_0x43298f['event'])?(_0x43298f['event']!==_0xb73037&&(this['currentReply']&&this['currentReply']['done'](),this['currentReply']=this['createReply']({'type':_0x43298f['event'],'interactionId':this['id']}),_0x489331['length']>0x0&&(this['currentReply']['sources']=_0x489331['splice'](0x0)),_0xb73037=_0x43298f['event']),this['currentReply']['appendContent'](_0x43298f['data']['textDelta'])):Di(_0x43298f['event'])||_0x2f4ad6('ai-interaction-invalid-event-type',{'chunk':_0x43298f});}}finally{this['isStopped']||(this['_finalizeInteraction'](),this['fire']('interactionFinished',this));}}['stop'](){this['isStopped']||(this['_finalizeInteraction'](),this['fire']('interactionStopped',this));}['getReply'](_0xf113d9){return this['replies']['find'](_0x19c91b=>_0x19c91b['id']===_0xf113d9);}['destroy'](){this['isDestroyed']||(this['stop'](),this['replies']['forEach'](_0x53b13c=>_0x53b13c['destroy']()),this['replies']=[],this['isDestroyed']=!0x0,this['fire']('interactionDestroyed',this),this['stopListening']());}['createReply'](_0x506a25){const _0x4f43bc=new fe({'editor':this['editor'],'documentContextContent':this['getDocumentContext']()?.['content'],..._0x506a25});return this['replies']['push'](_0x4f43bc),_0x4f43bc['delegate'](...xe)['to'](this),this['fire']('replyCreated',_0x4f43bc),_0x4f43bc;}['setConversationTitle'](_0x16d9dc,_0xc84fef=!0x1){this['fire']('setConversationTitle',_0x16d9dc,_0xc84fef);}['_finalizeInteraction'](){this['isStopped']=!0x0,this['currentRequest']&&this['currentRequest']['abortController']['abort'](),this['currentReply']&&this['currentReply']['done'](),this['currentRequest']=this['currentReply']=void 0x0;}}var ye=function(_0x4819e3){return _0x4819e3['FILE']='file',_0x4819e3['DOCUMENT']='document',_0x4819e3['URL']='web-resource',_0x4819e3['TEXT']='text',_0x4819e3['SELECTION']='selection',_0x4819e3;}({}),Ie=function(_0x6ff243){return _0x6ff243['TEXT']='text',_0x6ff243['MARKDOWN']='markdown',_0x6ff243['HTML']='html',_0x6ff243;}({});const wi=['contextItemAdded','contextItemRemoved','contextItemLoadingEnded','contextSent','error','addContextOptionsChanged','sourceResourcesLoaded','resourceStateChanged','uploadProgressChanged'];class mi extends ts(){['_connector'];['_config'];['_ownerId'];constructor({connector:_0xefbd32,config:_0x217ee7,ownerId:_0x53a7e0}){super(),this['_connector']=_0xefbd32,this['_config']=_0x217ee7,this['_ownerId']=_0x53a7e0;}['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'](_0x4eb3e9){const _0x3a0c0d=await this['_createContextItemFromContent'](_0x4eb3e9);return this['_addToConversationContextItem'](_0x3a0c0d),'current-document'===_0x3a0c0d['uiId']&&this['_toggleAddCurrentDocumentOptionVisibility'](),_0x3a0c0d;}async['_createContextItemFromContent'](_0x326f6d){if(_0x326f6d['type']===ye['DOCUMENT']){const _0x4d9189=await this['_connector']['fetchDocument'](this['_ownerId'],_0x326f6d['id'])['getDocument']();return{'id':'current-document','uiId':'current-document','label':'Current\x20document','type':_0x326f6d['type'],'content':_0x4d9189['content'],'hidden':this['_conversationContextItems']['has']('current-document'),'version':_0x4d9189['attributes']?.['version'],'sessionId':_0x4d9189['attributes']?.['sessionId']};}return{'id':_0x326f6d['id'],'uiId':_0x326f6d['id'],'label':_0x326f6d['attributes']?.['label']||_0x326f6d['name']||_0x326f6d['url']||_0x326f6d['id'],'type':_0x326f6d['type'],..._0x326f6d?.['attributes']?.['resourceId']?{'resourceId':_0x326f6d['attributes']?.['resourceId']}:{}};}['getSentContextItems'](){return new Map(this['_conversationContextItems']);}['removeFromContext'](_0x23e9dd){const _0x285c6f=this['_pendingContextItems']['get'](_0x23e9dd);_0x285c6f?.['isReadOnly']||this['_removeContextItem'](_0x23e9dd);}['clearPendingContextItems'](){if(0x0===this['_pendingContextItems']['size'])return;for(const _0x1ba498 of this['_pendingContextItems']['values']())this['_removeContextItem'](_0x1ba498['uiId']);const _0x56af16=this['_conversationContextItems']['get']('current-document')||this['_pendingContextItems']['get']('current-document');_0x56af16&&this['_addContextItem']({..._0x56af16,'isReadOnly':!0x0,'hidden':!0x0});}['addToConversationContext'](_0x19961a){for(const _0x1035cc of _0x19961a['values']())this['_addToConversationContextItem'](_0x1035cc);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'](_0x3aa77a){return Array['from'](_0x3aa77a['values']())['map'](_0x1a0e29=>this['_mapContextItemToRequestData'](_0x1a0e29))['filter'](_0x2f7304=>null!==_0x2f7304);}async['addFilesToContext'](_0x427d67,_0x15491d,_0x15a3c6=ye['FILE']){const _0x22cf4f='files-'+_0x2ef42f();this['_startUploadOperation'](_0x22cf4f);try{await Promise['all'](_0x427d67['map'](async _0xb673b6=>{const _0x5dc8a1='file-'+_0x2ef42f(),_0x42d7a5=_0x397c0d(_0xb673b6['name']);try{this['_addContextItem']({'type':_0x15a3c6,'label':_0x15491d?.['label']||_0x42d7a5,'uiId':_0x5dc8a1,'resourceId':_0x15491d?.['resourceId']},!0x0);const _0x15663f=this['_connector']['uploadFile'](this['_ownerId'],_0xb673b6,_0x15491d);this['_ongoingUploads']['set'](_0x5dc8a1,_0x15663f['abortController']);const {id:_0x701f01}=await _0x15663f['getId']();this['_ongoingUploads']['delete'](_0x5dc8a1),this['_finishContextItemLoading']({'type':_0x15a3c6,'id':_0x701f01,'label':_0x15491d?.['label']||_0x42d7a5,'uiId':_0x5dc8a1,'resourceId':_0x15491d?.['resourceId']},!0x1);}catch(_0x31c698){this['_ongoingUploads']['delete'](_0x5dc8a1);if(!_0x31c698['message']['startsWith']('ai-request-aborted')){const _0x1e7a7d=new _0x58ed45('ai-chat-file-upload-failed',null,{'fileName':_0x42d7a5});_0x1e7a7d['stack']=_0x31c698['stack'],this['fire']('error',{'error':_0x1e7a7d,'fileName':_0x42d7a5});}this['_removeContextItem'](_0x5dc8a1);}}));}finally{this['_finishUploadOperation'](_0x22cf4f);}}['addCurrentDocumentToContext'](_0x189641){if(this['isCurrentDocumentInContext']())return;const _0x14c67e={'type':ye['DOCUMENT'],'uiId':'current-document','label':_0x189641,'isReadOnly':this['_conversationContextItems']['has']('current-document'),'hidden':this['_conversationContextItems']['has']('current-document')};this['_addContextItem'](_0x14c67e);}async['updateCurrentDocument'](_0x455654,_0x7511c,_0x5f5b4c,_0x7a39fc){const _0x378008=this['_pendingContextItems']['get']('current-document');if(_0x378008&&_0x455654){_0x378008['selection']=_0x7a39fc?_0x7a39fc['map'](_0x107538=>({'start':_0x107538['start'],'end':_0x107538['end']})):[];try{if(_0x378008['version']===_0x7511c)return;const {id:_0x17e027}=await this['_connector']['uploadDocument'](this['_ownerId'],_0x455654,{'version':_0x7511c,'sessionId':_0x5f5b4c})['getId']();_0x378008['id']=_0x17e027,_0x378008['content']=_0x455654,_0x378008['version']=_0x7511c,_0x378008['sessionId']=_0x5f5b4c;}catch(_0x4be03e){const _0x4f467a=new _0x58ed45('ai-chat-document-upload-failed',null);_0x4f467a['stack']=_0x4be03e['stack'],this['fire']('error',{'error':_0x4f467a});}}}['addSelectionToContext'](_0x508512){this['_addContextItem']({'type':ye['SELECTION'],'label':_0x508512,'uiId':'selection','content':_0x508512});}['removeSelectionFromContext'](){this['_removeContextItem']('selection');}async['addUrlToContext'](_0x2fc0ba,_0x277c){const _0x56bac4='url-'+_0x2ef42f();this['_startUploadOperation'](_0x56bac4);const _0x210554='url-'+_0x2ef42f();try{this['_addContextItem']({'type':ye['URL'],'label':_0x277c?.['label']||_0x2fc0ba,'uiId':_0x210554,'resourceId':_0x277c?.['resourceId']},!0x0);const _0x4794b9=this['_connector']['uploadUrl'](this['_ownerId'],_0x2fc0ba,_0x277c);this['_ongoingUploads']['set'](_0x210554,_0x4794b9['abortController']);const {id:_0x3bcd62}=await _0x4794b9['getId']();this['_ongoingUploads']['delete'](_0x210554),this['_finishContextItemLoading']({'type':ye['URL'],'id':_0x3bcd62,'label':_0x277c?.['label']||_0x2fc0ba,'uiId':_0x210554,'resourceId':_0x277c?.['resourceId']},!0x1);}catch(_0x169c6d){this['_ongoingUploads']['delete'](_0x210554),(_0x169c6d['message']['startsWith']('ai-request-aborted')||this['fire']('error',{'error':new _0x58ed45('ai-chat-url-upload-failed',this,{'url':_0x2fc0ba,'originalError':_0x169c6d}),'url':_0x2fc0ba}),this['_removeContextItem'](_0x210554));}finally{this['_finishUploadOperation'](_0x56bac4);}}async['loadSourceResources'](_0x2db03b,_0x37b1f8,_0x1143e6){const _0x45083f=this['_addContextOptionsState']['sources']['find'](_0x3d77c1=>_0x3d77c1['id']===_0x2db03b);if(!_0x45083f)return this['fire']('error',{'error':new _0x58ed45('ai-chat-source-not-found',this,{'sourceId':_0x2db03b}),'sourceId':_0x2db03b}),[];try{const _0x16165d=(await _0x45083f['getResources'](_0x37b1f8))['map'](_0x389bfe=>{const _0x4f0578=this['_isResourceInContext'](_0x389bfe['id']);return{..._0x389bfe,'isInContext':_0x4f0578};});return _0x45083f['resources']=_0x16165d,this['fire']('sourceResourcesLoaded',{'sourceId':_0x2db03b,'source':_0x45083f,'resources':_0x16165d,'uid':_0x1143e6}),_0x16165d;}catch(_0x1e9292){return this['fire']('error',{'error':new _0x58ed45('ai-chat-source-resources-load-failed',this,{'sourceId':_0x2db03b,'originalError':_0x1e9292}),'sourceId':_0x2db03b,'sourceLabel':_0x45083f['label']}),[];}}async['addResourceToContext'](_0x1735c9,_0x1b3bd9){if(this['_isResourceInContext'](_0x1b3bd9['id']))return;let _0xbad703=_0x1b3bd9['data'];if(!_0xbad703&&_0x1735c9['getData'])try{_0xbad703=await _0x1735c9['getData'](_0x1b3bd9['id']);}catch(_0x4d634a){return void this['fire']('error',{'error':new _0x58ed45('ai-chat-resource-load-failed',this,{'resourceId':_0x1b3bd9['id'],'sourceId':_0x1735c9['id'],'originalError':_0x4d634a}),'resourceId':_0x1b3bd9['id'],'sourceId':_0x1735c9['id']});}if(_0xbad703)switch(_0x1b3bd9['type']){case ye['URL']:if('string'!=typeof _0xbad703)return void this['fire']('error',{'error':new _0x58ed45('ai-chat-context-invalid-data',this,{'resourceId':_0x1b3bd9['id'],'sourceId':_0x1735c9['id'],'expectedType':'string','actualType':typeof _0xbad703}),'resourceId':_0x1b3bd9['id'],'sourceId':_0x1735c9['id']});await this['addUrlToContext'](_0xbad703,{'label':_0x1b3bd9['label'],'resourceId':_0x1b3bd9['id']});break;case ye['FILE']:if(!(_0xbad703 instanceof File))return void this['fire']('error',{'error':new _0x58ed45('ai-chat-context-invalid-data',this,{'resourceId':_0x1b3bd9['id'],'sourceId':_0x1735c9['id'],'expectedType':'File','actualType':typeof _0xbad703}),'resourceId':_0x1b3bd9['id'],'sourceId':_0x1735c9['id']});await this['addFilesToContext']([_0xbad703],{'label':_0x1b3bd9['label'],'resourceId':_0x1b3bd9['id']});break;case ye['TEXT']:if('object'!=typeof _0xbad703||!('content'in _0xbad703)||!('type'in _0xbad703))return void this['fire']('error',{'error':new _0x58ed45('ai-chat-context-invalid-data',this,{'resourceId':_0x1b3bd9['id'],'sourceId':_0x1735c9['id'],'expectedType':'object\x20with\x20content\x20and\x20type\x20properties','actualType':typeof _0xbad703}),'resourceId':_0x1b3bd9['id'],'sourceId':_0x1735c9['id']});_0xbad703=mi['_convertTextResourceToFile'](_0xbad703,_0x1b3bd9['label']),await this['addFilesToContext']([_0xbad703],{'label':_0x1b3bd9['label'],'resourceId':_0x1b3bd9['id']},ye['TEXT']);break;default:this['fire']('error',{'error':new _0x58ed45('ai-chat-context-unsupported-type',this,{'resourceId':_0x1b3bd9['id'],'sourceId':_0x1735c9['id'],'resourceType':_0x1b3bd9['type']}),'resourceId':_0x1b3bd9['id'],'sourceId':_0x1735c9['id']});}else this['fire']('error',{'error':new _0x58ed45('ai-chat-resource-no-data',this,{'resourceId':_0x1b3bd9['id'],'sourceId':_0x1735c9['id']}),'resourceId':_0x1b3bd9['id'],'sourceId':_0x1735c9['id']});}static['_convertTextResourceToFile'](_0x5c0793,_0x158cc3){switch(_0x5c0793['type']){case Ie['MARKDOWN']:return new File([_0x5c0793['content']],_0x158cc3,{'type':'text/markdown'});case Ie['HTML']:return new File([_0x5c0793['content']],_0x158cc3,{'type':'text/html'});default:return new File([_0x5c0793['content']],_0x158cc3,{'type':'text/plain'});}}static['_mapContextItemToRequestData'](_0x134715){switch(_0x134715['type']){case ye['FILE']:return{'type':ye['FILE'],'id':_0x134715['id']};case ye['URL']:return{'type':ye['URL'],'id':_0x134715['id']};case ye['DOCUMENT']:return{'type':ye['DOCUMENT'],'id':_0x134715['id'],..._0x134715['selection']?.['length']&&{'selection':_0x134715['selection']}};case ye['TEXT']:return{'type':ye['FILE'],'id':_0x134715['id']};default:return null;}}['_addContextItem'](_0x1cfc87,_0x4c3ee1=!0x1){if(this['_pendingContextItems']['set'](_0x1cfc87['uiId'],_0x1cfc87),_0x1cfc87['hidden']||this['fire']('contextItemAdded',{'contextItem':_0x1cfc87,'isLoading':_0x4c3ee1}),'current-document'===_0x1cfc87['uiId']&&this['_toggleAddCurrentDocumentOptionVisibility'](),_0x1cfc87['resourceId']){const _0x53a4ee=this['_findSourceIdsByResourceId'](_0x1cfc87['resourceId']);_0x53a4ee&&_0x53a4ee['forEach'](_0x125307=>{this['_updateResourceInContextState'](_0x125307,_0x1cfc87['resourceId'],!0x0);});}}['_removeContextItem'](_0xb58d55){const _0x301a96=this['_pendingContextItems']['get'](_0xb58d55),_0xacd96d=this['_ongoingUploads']['get'](_0xb58d55);if(_0xacd96d&&(_0xacd96d['abort'](),this['_ongoingUploads']['delete'](_0xb58d55)),_0x301a96?.['resourceId']){const _0x47dfb8=this['_findSourceIdsByResourceId'](_0x301a96['resourceId']);_0x47dfb8&&_0x47dfb8['forEach'](_0x19c0ac=>{this['_updateResourceInContextState'](_0x19c0ac,_0x301a96['resourceId'],!0x1);});}this['_pendingContextItems']['delete'](_0xb58d55),this['fire']('contextItemRemoved',{'uiId':_0xb58d55,'type':_0x301a96?.['type']}),'current-document'===_0xb58d55&&this['_toggleAddCurrentDocumentOptionVisibility']();}['_finishContextItemLoading'](_0x3dd672,_0x45b870){if(this['_pendingContextItems']['has'](_0x3dd672['uiId'])&&(this['_pendingContextItems']['set'](_0x3dd672['uiId'],_0x3dd672),this['fire']('contextItemLoadingEnded',{'contextItem':_0x3dd672,'isLoading':_0x45b870}),_0x3dd672['resourceId'])){const _0xfd4934=this['_findSourceIdsByResourceId'](_0x3dd672['resourceId']);_0xfd4934&&_0xfd4934['forEach'](_0x372357=>{this['_updateResourceInContextState'](_0x372357,_0x3dd672['resourceId'],!0x0);});}}['_addToConversationContextItem'](_0x1aa291){this['_conversationContextItems']['set'](_0x1aa291['uiId'],_0x1aa291);}['_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']()},this['fire']('addContextOptionsChanged',{'options':this['_addContextOptionsState']});}['_getCustomSourcesInitialState'](){return this['_config']?.['sources']?.['map'](_0x267b92=>({..._0x267b92,'resources':[]}))??[];}['_toggleAddCurrentDocumentOptionVisibility'](){const _0x1f8802=this['isCurrentDocumentInContext']()||this['isCurrentDocumentInConversation']();this['_addContextOptionsState']['document']['isHidden']=_0x1f8802,this['fire']('addContextOptionsChanged',{'options':this['_addContextOptionsState']});}['_isResourceInContext'](_0xff98f){for(const _0x40e166 of this['_pendingContextItems']['values']())if(_0x40e166['resourceId']===_0xff98f)return!0x0;for(const _0x5df618 of this['_conversationContextItems']['values']())if(_0x5df618['resourceId']===_0xff98f)return!0x0;return!0x1;}['_findSourceIdsByResourceId'](_0xf548f6){const _0xdb7b66=[];for(const _0x376b4f of this['_addContextOptionsState']['sources']){_0x376b4f['resources']['find'](_0x4ae6f3=>_0x4ae6f3['id']===_0xf548f6)&&_0xdb7b66['push'](_0x376b4f['id']);}return 0x0===_0xdb7b66['length']?null:_0xdb7b66;}['_updateResourceInContextState'](_0x538c32,_0x3e4fce,_0x34aae8){const _0x4feb9=this['_addContextOptionsState']['sources']['find'](_0x44d014=>_0x44d014['id']===_0x538c32);if(!_0x4feb9)return;const _0x3b4f4f=_0x4feb9['resources']['find'](_0x18d4f8=>_0x18d4f8['id']===_0x3e4fce);_0x3b4f4f&&(_0x3b4f4f['isInContext']=_0x34aae8,this['fire']('resourceStateChanged',{'sourceId':_0x538c32,'resourceId':_0x3e4fce,'isInContext':_0x34aae8}));}['_startUploadOperation'](_0x1930dc){this['_ongoingUploadOperations']['set'](_0x1930dc,!0x0),this['_ongoingUploadOperations']['size']&&this['fire']('uploadProgressChanged',{'isUploadInProgress':!0x0});}['_finishUploadOperation'](_0x53d56e){this['_ongoingUploadOperations']['delete'](_0x53d56e),0x0===this['_ongoingUploadOperations']['size']&&this['fire']('uploadProgressChanged',{'isUploadInProgress':!0x1});}}const Ii=['capabilitiesUpdated'];class vi extends _0x5f2b03(){['_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'](_0x1b0d5f){const _0x576445={};return _0x1b0d5f&&_0x1b0d5f['isWebSearchEnabled']&&(_0x576445['webSearch']={}),_0x1b0d5f&&_0x1b0d5f['isReasoningEnabled']&&(_0x576445['reasoning']={}),_0x576445;}['toggleWebSearch'](){this['setWebSearch'](!this['_isWebSearchEnabled']);}['toggleReasoning'](){this['setReasoning'](!this['_isReasoningEnabled']);}['setWebSearch'](_0xdf8cf6){_0xdf8cf6!==this['_isWebSearchEnabled']&&(this['_isWebSearchEnabled']=_0xdf8cf6,this['fire']('capabilitiesUpdated',this['getCapabilitiesConfig']()));}['setReasoning'](_0x1e49aa){_0x1e49aa!==this['_isReasoningEnabled']&&(this['_isReasoningEnabled']=_0x1e49aa,this['fire']('capabilitiesUpdated',this['getCapabilitiesConfig']()));}}class fi extends ge{['userMessage'];['conversationId'];['contextItems']=new Map();['model'];['quickActionData'];constructor(_0x2c1341){super(_0x2c1341),this['conversationId']=_0x2c1341['conversationId'],this['contextItems']=_0x2c1341['contextItems'],this['capabilities']=_0x2c1341['capabilities'],this['userMessage']=_0x2c1341['userMessage'],this['model']=_0x2c1341['model'],this['quickActionData']=_0x2c1341['quickActionData'];}async['sendRequest'](){return this['connector']['queryAssistant']({'message':this['userMessage'],'conversationId':this['conversationId'],'parts':mi['mapContextItemsToRequestData'](this['contextItems']),'capabilities':vi['getCapabilitiesRequestData'](this['capabilities']),'model':this['model'],'quickActionData':this['quickActionData']});}['getDocumentContext'](){return this['contextItems']['get']('current-document');}}class ct extends _0x5f2b03(){['id'];['isStarted']=!0x1;['interactions']=[];['currentInteraction'];['selectedModel'];['connector'];['options'];constructor(_0x28335){super(),this['options']=_0x28335,this['connector']=_0x28335['connector'],this['chatModels']=_0x28335['chatModels'],this['id']=_0x28335['conversationId'];}async['init'](_0x42d69f){try{this['chatContext']=new mi({'connector':this['connector'],'config':_0x42d69f,'ownerId':this['id']}),this['chatContext']['delegate'](...wi)['to'](this),this['chatContext']['init'](),this['chatCapabilities']=new vi(),this['chatCapabilities']['delegate'](...Ii)['to'](this),this['chatCapabilities']['init']();const _0x4b7855=await this['chatModels']['getAll']();this['fire']('conversationInitialized',{'availableModels':_0x4b7855});const _0x399b02=await this['chatModels']['getDefault'](this['options']['defaultModelId']);_0x399b02&&await this['setModel'](_0x399b02);}catch(_0x59c381){const _0x4bf62d=new _0x58ed45('ai-chat-conversation-init-failed',null,{'message':_0x59c381['message']});_0x4bf62d['stack']=_0x59c381['stack'],this['fire']('error',{'error':_0x4bf62d});}}async['start'](){if(this['isStarted'])throw new _0x58ed45('ai-chat-conversation-already-started',null,{'conversation':this});if(!this['selectedModel'])throw new _0x58ed45('ai-chat-conversation-start-no-model-selected',null,{'conversation':this});try{const {id:_0xe4c0f1}=await this['connector']['startConversation'](this['id'],this['options']['group'])['getConversation']();this['id']=_0xe4c0f1,this['isStarted']=!0x0,this['fire']('conversationStarted',{'conversationId':this['id'],'selectedModel':this['selectedModel']});}catch(_0x4341c9){const _0x1e36dc=new _0x58ed45('ai-chat-conversation-start-failed',null,{'message':_0x4341c9['message']});_0x1e36dc['stack']=_0x4341c9['stack'],this['fire']('error',{'error':_0x1e36dc});}}async['load'](_0x37cc49,_0x21fae1){try{const _0x4a6139=await this['connector']['fetchConversation'](_0x37cc49)['getConversation'](),_0x3de825=await this['connector']['fetchConversationMessages'](_0x37cc49)['getMessages'](),_0x211165=_0x3de825[0x0]['model'];this['isStarted']=!0x0,this['id']=_0x4a6139['id'],'title'in _0x4a6139?this['fire']('setConversationTitle',_0x4a6139['title'],!0x0):this['fire']('setConversationTitle','',!0x0);const _0x447e5a=(await this['chatModels']['getAll']())['find'](_0xf65a08=>_0xf65a08['id']['toLowerCase']()===_0x211165['toLowerCase']());return this['selectedModel']=_0x447e5a,this['fire']('modelSelected',{'selectedModel':_0x447e5a,'isDisabled':!0x0}),await this['_processMessagesToInteractions'](_0x3de825,_0x21fae1,_0x211165),this['currentInteraction']=void 0x0,this;}catch(_0x3b75e4){const _0x1187fd=new _0x58ed45('ai-chat-conversation-init-from-id-failed',null,{'message':_0x3b75e4['message'],'conversationId':_0x37cc49});throw _0x1187fd['stack']=_0x3b75e4['stack'],this['fire']('error',{'error':_0x1187fd}),_0x1187fd;}}async['_processMessagesToInteractions'](_0xd51276,_0x598b14,_0x3f9e1b){let _0x108ba0;for(const _0xdc706e of _0xd51276)if('user'===_0xdc706e['role']){const _0x46c7ea=await this['_extractContextItems'](_0xdc706e),_0xb58dc9={'isReasoningEnabled':Object['hasOwn'](_0xdc706e['capabilities'],'reasoning'),'isWebSearchEnabled':Object['hasOwn'](_0xdc706e['capabilities'],'webSearch')};_0x108ba0=this['createInteraction']({'userMessage':_0xdc706e['prompt'],'contextItems':_0x46c7ea,'capabilities':_0xb58dc9,'modelId':_0x3f9e1b,'quickActionData':_0xdc706e['attributes']?.['quickActionData']}),this['currentInteraction']=_0x108ba0,this['chatContext']['addToConversationContext'](this['currentInteraction']['contextItems']);}else{if('assistant'===_0xdc706e['role']&&_0x108ba0)for(const _0x1c621e of _0xdc706e['content']){const _0x436952='text'===_0x1c621e['type']?'text-delta':'modification-delta',_0x73aba0=_0x108ba0['getDocumentContext']()?.['sessionId']!==_0x598b14;_0x108ba0['currentReply']=_0x108ba0['createReply']({'type':_0x436952,'isDone':!0x0,'interactionId':_0x108ba0['id'],'areActionsDisabled':_0x73aba0}),_0x108ba0['currentReply']['appendContent'](_0x1c621e['content']);}}}async['_extractContextItems'](_0x49f2f9){const _0x266358=new Map();if(!_0x49f2f9['content'])return _0x266358;for(const _0x13e7aa of _0x49f2f9['content']){const _0x2ebddf=await this['chatContext']['populateFromMessage'](_0x13e7aa);_0x2ebddf&&_0x266358['set'](_0x2ebddf['id'],_0x2ebddf);}return _0x266358;}async['handleUserInteraction']({userMessage:_0x269a1e,quickActionData:_0x3894e8}){if(!this['isStarted'])throw new _0x58ed45('ai-chat-handle-user-conversation-not-initialized',null,{'conversation':this});if(this['currentInteraction'])throw new _0x58ed45('ai-chat-handle-user-interaction-already-in-progress',null,{'conversation':this});try{const _0x3a8997=this['chatContext']['getPendingContextItems'](),_0x392506=this['chatCapabilities']['getCapabilitiesConfig'](),_0x45e5a7=this['selectedModel']['id'];this['currentInteraction']=this['createInteraction']({'userMessage':_0x269a1e,'contextItems':_0x3a8997,'capabilities':_0x392506,'modelId':_0x45e5a7,'quickActionData':_0x3894e8}),await this['currentInteraction']['start'](),this['chatContext']['addToConversationContext'](this['currentInteraction']['contextItems']);}catch(_0x18413b){this['fire']('error',{'interactionId':this['currentInteraction']?this['currentInteraction']['id']:void 0x0,'error':_0x18413b});}finally{this['currentInteraction']?.['stop'](),this['currentInteraction']=void 0x0;}}['createInteraction']({userMessage:_0x5cb861,contextItems:_0x4bd3e1,capabilities:_0x462691,modelId:_0x3e2423,quickActionData:_0x8e57ad}){const _0xad1deb=new fi({'userMessage':_0x5cb861,'contextItems':_0x4bd3e1,'capabilities':_0x462691,'conversationId':this['id'],'connector':this['connector'],'editor':this['options']['getEditor']&&this['options']['getEditor'](),'model':_0x3e2423,'quickActionData':_0x8e57ad});return _0xad1deb['delegate'](...xe)['to'](this),this['interactions']['push'](_0xad1deb),this['fire']('interactionCreated',_0xad1deb),_0xad1deb;}['getInteraction'](_0xbefc2e){return this['interactions']['find'](_0x15b6f2=>_0x15b6f2['id']===_0xbefc2e);}['removeInteraction'](_0xb3554d){const _0xb53169=this['getInteraction'](_0xb3554d);_0xb53169&&(_0xb53169['destroy'](),this['interactions']['splice'](this['interactions']['indexOf'](_0xb53169),0x1));}get['lastInteraction'](){return this['interactions'][this['interactions']['length']-0x1];}['addCurrentDocumentToContext'](_0x5cf5be){this['chatContext']['addCurrentDocumentToContext'](_0x5cf5be);}async['updateCurrentDocumentInContext']({content:_0xd734ae,version:_0x583ede,sessionId:_0x2fb816,selections:_0x4b4c47}){await this['chatContext']['updateCurrentDocument'](_0xd734ae,_0x583ede,_0x2fb816,_0x4b4c47);}['getCurrentDocumentContext'](){return this['currentInteraction']?.['getDocumentContext']()?.['content']||'';}['addSelectionToContext'](_0x4acdff){this['chatContext']['addSelectionToContext'](_0x4acdff);}['removeSelectionFromContext'](){this['chatContext']['removeSelectionFromContext']();}['addFilesToContext'](_0x1c8cbd){this['chatContext']['addFilesToContext'](_0x1c8cbd);}['addUrlToContext'](_0x28e4e2){this['chatContext']['addUrlToContext'](_0x28e4e2);}['addResourceToContext'](_0x2bdcf3,_0x197cc6){this['chatContext']['addResourceToContext'](_0x2bdcf3,_0x197cc6);}['loadSourceResources'](_0x184a5a,_0x4b46b9,_0x13974e){return this['chatContext']['loadSourceResources'](_0x184a5a,_0x4b46b9,_0x13974e);}['removeFromContext'](_0x530d07){this['chatContext']['removeFromContext'](_0x530d07);}['toggleWebSearch'](){this['chatCapabilities']['toggleWebSearch']();}['toggleReasoning'](){this['chatCapabilities']['toggleReasoning']();}['isCurrentDocumentInContext'](){return this['chatContext']['isCurrentDocumentInContext']();}['isCurrentDocumentInConversation'](){return this['chatContext']['isCurrentDocumentInConversation']();}['isSelectionInContext'](){return this['chatContext']['isSelectionInContext']();}async['setModel'](_0x37e9cf){if(!_0x37e9cf)throw new _0x58ed45('ai-chat-conversation-set-model-null',null,{'conversation':this});if(!0x1===await this['chatModels']['isAvailable'](_0x37e9cf))throw new _0x58ed45('ai-chat-conversation-set-model-not-available',null,{'conversation':this,'model':_0x37e9cf});_0x37e9cf['id']!==this['selectedModel']?.['id']&&(this['selectedModel']=_0x37e9cf,this['chatCapabilities']['reset'](),this['fire']('modelSelected',{'selectedModel':_0x37e9cf}));}}function V(_0x165911){if(_0x165911 instanceof ot)return _0x165911;if(_0x165911?.['editors']&&_0x165911['editors']['get'](0x0))return _0x165911['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.'),_0x165911['editors']['get'](0x0);throw new _0x58ed45('ai-get-editor-from-context-no-editor');}const dt='ai-selection';class O extends _0x56fd8d{['_displayedFakeSelectionId']=null;['_displayedFakeSelectionLocked']=!0x1;['_sessionId'];static get['pluginName'](){return'AIEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}get['sessionId'](){if(!this['_sessionId']){const _0x49b3fd=V(this['context']),_0x1501ae=_0x49b3fd['plugins']['has']('RealTimeCollaborationClient')&&_0x49b3fd['plugins']['get']('RealTimeCollaborationClient')['sessionId'];this['_sessionId']=_0x1501ae||_0x2ef42f();}return this['_sessionId'];}['getDocumentData'](){const _0x562178=V(this['context']),_0x24cfee=_0x562178['model'],_0x43d149=_0x562178['data']['toView'](_0x24cfee['document']['getRoot'](),{'convertAiChatSelectionMarker':!0x0}),_0xc35a4f=new kt(_0x562178['editing']['view']['document']);this['_setDataIdsOnChildren'](_0x43d149,_0xc35a4f);let _0x56aebe=_0x562178['data']['processor']['toData'](_0x43d149);const _0x1f3263=this['_getMarkersInDocumentOrder'](),_0x5e83a2=[];for(const _0x2301cc of _0x1f3263){const _0x4f2245='<'+_0x2301cc['name']+':start></'+_0x2301cc['name']+':start>',_0x5be2b7=_0x56aebe['indexOf'](_0x4f2245);_0x56aebe=_0x56aebe['substring'](0x0,_0x5be2b7)+_0x56aebe['substring'](_0x5be2b7+_0x4f2245['length']);const _0x2a3cd8='<'+_0x2301cc['name']+':end></'+_0x2301cc['name']+':end>',_0x5d535d=_0x56aebe['indexOf'](_0x2a3cd8);_0x56aebe=_0x56aebe['substring'](0x0,_0x5d535d)+_0x56aebe['substring'](_0x5d535d+_0x2a3cd8['length']),_0x5e83a2['push']({'markerName':_0x2301cc['name'],'start':_0x5be2b7,'end':_0x5d535d,'htmlFragment':_0x56aebe['substring'](_0x5be2b7,_0x5d535d)});}return{'content':_0x56aebe,'version':_0x562178['model']['document']['version'],'sessionId':this['sessionId'],'selections':_0x5e83a2};}async['afterInit'](){this['context']instanceof ot?this['_integrateEditor'](this['context']):this['listenTo'](this['context']['editors'],'add',(_0x2fa52b,_0x18d9cf)=>{_0x18d9cf['on']('ready',()=>{this['_integrateEditor'](_0x18d9cf);});});}['_integrateEditor'](_0x37dfc2){_0x37dfc2['conversion']['for']('editingDowncast')['markerToHighlight']({'model':dt,'view':{'classes':['ck-fake-ai-selection','ck-ai-assistant-ui_theme'],'priority':0xc}}),_0x37dfc2['conversion']['for']('dataDowncast')['markerToElement']({'model':dt,'view':(_0x37266e,{writer:_0x273bb1,options:_0x3d84e8})=>_0x3d84e8['convertAiChatSelectionMarker']?_0x273bb1['createUIElement'](_0x37266e['markerName']+':'+(_0x37266e['isOpening']?'start':'end')):null});}['showFakeVisualSelection'](_0x172e81,_0x9834ba,_0xc09944=!0x1,_0x4e6def=!0x1){if(this['_displayedFakeSelectionLocked']&&!_0x4e6def)return!0x1;this['_displayedFakeSelectionId']&&this['hideFakeVisualSelection'](this['_displayedFakeSelectionId']),this['_displayedFakeSelectionId']=_0x9834ba,this['_displayedFakeSelectionLocked']=_0xc09944;const _0x4e05aa=V(this['context'])['model'];return _0x4e05aa['change'](_0x261997=>{let _0x2147a2=0x0;for(let _0x3dc419 of _0x172e81){const _0x19ed8b=dt+':'+_0x2147a2;if(_0x3dc419['start']['isAtEnd']){const _0x39553f=_0x3dc419['start']['getLastMatchingPosition'](({item:_0xc3ea91})=>!_0x4e05aa['schema']['isContent'](_0xc3ea91),{'boundaries':_0x3dc419});_0x3dc419=_0x261997['createRange'](_0x39553f,_0x3dc419['end']);}_0x261997['addMarker'](_0x19ed8b,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x3dc419}),_0x2147a2++;}}),window['getSelection']()?.['removeAllRanges'](),!0x0;}['hideFakeVisualSelection'](_0x2f35cc){if(this['_displayedFakeSelectionId']!=_0x2f35cc)return!0x1;this['_displayedFakeSelectionId']=null,this['_displayedFakeSelectionLocked']=!0x1;const _0x430219=V(this['context']),_0x4c014c=_0x430219['model']['markers']['getMarkersGroup'](dt);return _0x430219['model']['change'](_0x19d4b9=>{for(const _0x45082e of _0x4c014c)_0x19d4b9['removeMarker'](_0x45082e);}),!0x0;}['modelToViewWithIds'](_0x3dae75){const _0x360df7=V(this['context']),_0x31c5a8=_0x360df7['data']['toView'](_0x3dae75),_0x38b29e=new kt(_0x360df7['editing']['view']['document']);return this['_setDataIdsOnChildren'](_0x31c5a8,_0x38b29e),_0x31c5a8;}['_setDataIdsOnChildren'](_0x13ba67,_0x2d1f50){let _0xde09b8=!0x1;const _0x515d6d=new Set();for(const _0x3796e4 of _0x13ba67['getChildren']()){const _0x49d7dc=_0x3796e4['is']('emptyElement')||_0x3796e4['is']('containerElement');if(!_0x3796e4['is']('element'))continue;(this['_setDataIdsOnChildren'](_0x3796e4,_0x2d1f50)||_0x49d7dc)&&(_0x2d1f50['setAttribute']('data-id',this['_nextDataId'](_0x515d6d),_0x3796e4),_0xde09b8=!0x0);}return _0xde09b8;}['_nextDataId'](_0x2f2378){let _0x59d1e4;do{_0x59d1e4='';for(let _0x1c862f=0x0;_0x1c862f<0x4;_0x1c862f++)_0x59d1e4+=String['fromCharCode'](0x61+Math['floor'](0x1a*Math['random']()));}while(_0x2f2378['has'](_0x59d1e4));return _0x2f2378['add'](_0x59d1e4),_0x59d1e4;}['getSelectionText'](){const {model:_0x5a7b8c}=V(this['context']),_0x369673=_0x5a7b8c['document']['selection'],_0x542c8e=_0x5a7b8c['getSelectedContent'](_0x369673),_0x4dad02=[],_0x572f68=_0x5a7b8c['createRangeIn'](_0x542c8e)['getWalker']();for(const {item:_0x25ac28}of _0x572f68)_0x25ac28['is']('$textProxy')?_0x4dad02['push'](_0x25ac28['data']):_0x25ac28['is']('element')&&_0x4dad02['length']>0x0&&'\x20'!==_0x4dad02[_0x4dad02['length']-0x1]&&_0x4dad02['push']('\x20');return'\x22'+_0x4dad02['join']('')['trim']()+'\x22';}['_getMarkersInDocumentOrder'](){const _0x59b598=V(this['context'])['model'];return Array['from'](_0x59b598['markers']['getMarkersGroup'](dt))['sort']((_0x711727,_0x20718c)=>_0x711727['getStart']()['isBefore'](_0x20718c['getStart']())?-0x1:_0x711727['getStart']()['isAfter'](_0x20718c['getStart']())?0x1:0x0);}}class lt extends _0x5f2b03(){['_modelList']=[];['_connector'];constructor({connector:_0x2b24cf}){super(),this['_connector']=_0x2b24cf;}async['getAll'](){if(!this['_modelList']['length']){const _0x2ace30=this['_connector']['getModels'](),_0x4a6aa7=(await _0x2ace30['list']())['items']['sort']((_0x1bcff4,_0x12dc7a)=>{const _0x2c5c85=Object['values'](_0x1bcff4['capabilities'])['filter'](_0x14c81e=>_0x14c81e['enabled'])['length'];return Object['values'](_0x12dc7a['capabilities'])['filter'](_0x970367=>_0x970367['enabled'])['length']-_0x2c5c85;});this['_modelList']=_0x4a6aa7;}return this['_modelList'];}async['getDefault'](_0x2a86f4){const _0x2c0a37=await this['getAll']();if(!_0x2c0a37['length'])return null;if(_0x2a86f4){const _0x57014a=_0x2c0a37['find'](_0x28d782=>_0x28d782['id']===_0x2a86f4);if(_0x57014a)return _0x57014a;_0x2f4ad6('ai-chat-default-model-id-unrecognized',{'defaultModelId':_0x2a86f4,'fallBackModelId':_0x2c0a37[0x0]['id']});}return _0x2c0a37[0x0];}async['isAvailable'](_0x231a6a){return(await this['getAll']())['some'](_0x49fd21=>_0x49fd21['name']===_0x231a6a['name']&&_0x49fd21['provider']===_0x231a6a['provider']);}}function z({editor:_0x2b2254,interaction:_0x928887,reply:_0x4c5ebe,groups:_0x50c9c7,transform:_0x478927,documentCompare:_0x1acd0f,documentCompareOptions:_0x56ecd7}){const _0x468ecf=_0x928887['getDocumentContext']();if(!_0x468ecf)return[];const _0x283fd8=_0x468ecf['content'],_0x2ede71=_0x468ecf['version'],_0x461203=_0x4c5ebe['documentContextContent']['cloneNode'](!0x0);for(const {changes:_0x4868a3}of _0x50c9c7){const _0x3d608c=_0x4868a3['filter'](_0x2aeccb=>'new'!=_0x2aeccb['type'])['map'](_0x5629f2=>It('data-id',_0x5629f2['id'],_0x461203)),_0x238d67=_0x4868a3['filter'](_0x321efe=>'removed'!=_0x321efe['type'])['map'](_0x545746=>_0x545746['node']['cloneNode'](!0x0));let _0x34b82c=null;if(_0x3d608c['length']){_0x34b82c=_0x3d608c[0x0]['previousSibling'];for(let _0x47b822=0x0;_0x47b822<_0x3d608c['length'];_0x47b822++)_0x55d0bd(_0x3d608c[_0x47b822]);}if(_0x238d67['length']){_0x34b82c||(_0x4868a3[0x0]['anchorId']?_0x34b82c=It('data-id',_0x4868a3[0x0]['anchorId'],_0x461203):(_0x34b82c=_0x238d67['shift'](),to(_0x461203,_0x34b82c)));for(let _0x346f58=0x0;_0x346f58<_0x238d67['length'];_0x346f58++)_0x106cca(_0x34b82c,_0x238d67[_0x346f58]),_0x34b82c=_0x238d67[_0x346f58];}}const _0x56ec39=Ct(_0x461203),_0x5d43a4=_0x1acd0f['getDiff'](_0x283fd8,_0x56ec39,_0x56ecd7)['getOperations']();if(_0x478927){const _0x44c9bd=_0x2b2254['model']['document']['history']['getOperations'](_0x2ede71),_0x1ec523={'document':_0x2b2254['model']['document'],'useRelations':!0x1,'padWithNoOps':!0x1};return it(_0x5d43a4,_0x44c9bd,_0x1ec523)['operationsA'];}return _0x5d43a4;}function Y({editor:_0x52764b,changeGroups:_0x280061,documentContextContent:_0x503edc,showDiff:_0x416518,trimUnchanged:_0x3000d5=!0x0}){return _0x280061['map'](_0x15cc18=>{const _0x1d936f=new _t([]),_0x29301e=new _t([]);for(const _0x344e8c of _0x15cc18['changes'])if(_0x416518&&'removed'==_0x344e8c['type']||_0x29301e['children']['push'](_0x344e8c['node']['cloneNode'](!0x0)),'new'!=_0x344e8c['type']&&(_0x416518||'removed'!=_0x344e8c['type'])){const _0x27c4af=mt(_0x53faad=>ft(_0x53faad,'data-id')==_0x344e8c['id'],_0x503edc,!0x0);_0x27c4af&&_0x1d936f['children']['push'](_0x27c4af['cloneNode'](!0x0));}const {content:_0xe4a5c0,hasChanges:_0x5f53fe}=function(_0x21dee0,_0x4f66a1,_0x20bd01,_0x24c9bd,_0x1a07d8=!0x0){const _0x37af23=_0x21dee0['plugins']['get']('DocumentCompare'),_0xe022d5=_0x21dee0['plugins']['get']('TrackChangesEditing'),_0x5e84dc=Ct(_0x4f66a1),_0x404367=Ct(_0x20bd01),_0xe4a4eb=_0x21dee0['data']['parse'](_0x5e84dc,'$root'),_0x50cb86=_0x21dee0['model']['createPositionAt'](_0xe4a4eb,0x0),_0x352dfc=_0x37af23['getDiff'](_0x5e84dc,_0x404367,{'anchor':_0x50cb86,'markDeletions':_0x24c9bd}),_0x3e61e6=_0x352dfc['getOperations']();if(0x0==_0x3e61e6['length'])return{'content':_0x4f66a1['cloneNode'](!0x0),'hasChanges':!0x1};_0x24c9bd?_0xe022d5['_applyOperationsAsSuggestions'](_0x3e61e6):_0x21dee0['model']['change'](_0x32b656=>{for(const _0x2aa636 of _0x3e61e6)if('remove'==_0x2aa636['type']){const _0x2adc3a=_0x2aa636['sourcePosition'],_0x3cc343=_0x2aa636['howMany'],_0x44c299=new tt(_0x2adc3a,_0x3cc343);_0x32b656['batch']['addOperation'](_0x44c299),_0x21dee0['model']['applyOperation'](_0x44c299);}else _0x2aa636['baseVersion']=null,_0x2aa636['isDocumentOperation']=!0x1,_0x32b656['batch']['addOperation'](_0x2aa636),_0x21dee0['model']['applyOperation'](_0x2aa636);});if(_0x1a07d8){const _0x1732ca=ut(_0x21dee0,_0x3e61e6,_0xe4a4eb);pt(_0x21dee0['model'],_0x1732ca),function(_0x4e1b99,_0x2452c1){const _0x2139cc=_0x2452c1['getFirstRange']()['start'];let _0x8f9525=_0x2452c1['getFirstRange']()['end'];const _0x42c889=_0x2139cc['root'];(_0x8f9525['textNode']||_0x8f9525['nodeAfter']&&_0x8f9525['nodeAfter']['is']('$text'))&&(_0x44e0c4(_0x8f9525,'...'),_0x8f9525=_0x8f9525['getShiftedBy'](0x3)),(_0x2139cc['textNode']||_0x2139cc['nodeBefore']&&_0x2139cc['nodeBefore']['is']('$text'))&&(_0x44e0c4(_0x2139cc,'...'),function(_0x21d89c,_0x451711,_0x35f7cc){for(let [_0x4a3988,_0x58ca0e]of _0x21d89c['markers']){const _0xca1e4e=_0x58ca0e['_getTransformedByInsertion'](_0x451711,_0x35f7cc,!0x1);_0x58ca0e=_0xca1e4e[0x0],_0x21d89c['markers']['set'](_0x4a3988,_0x58ca0e);}}(_0x42c889,_0x2139cc,0x3),_0x2139cc['parent']==_0x8f9525['parent']&&(_0x8f9525=_0x8f9525['getShiftedBy'](0x3)));const _0x4613c1=_0x4e1b99['createRange'](_0x4e1b99['createPositionAt'](_0x42c889,0x0),_0x2139cc),_0x5ae957=_0x4e1b99['createRange'](_0x8f9525,_0x4e1b99['createPositionAt'](_0x42c889,'end')),_0x43e38a=[..._0x4613c1['getMinimalFlatRanges'](),..._0x5ae957['getMinimalFlatRanges']()];_0x43e38a['reverse']();for(const _0x647272 of _0x43e38a)_0x5a755a(_0x647272),zn(_0x42c889,_0x647272);}(_0x21dee0['model'],_0x1732ca);}const _0x1e7213=_0x21dee0['data']['stringify'](_0xe4a4eb,{'showSuggestionHighlights':!0x0});return{'content':Ne(_0x1e7213),'hasChanges':!0x0};}(_0x52764b,_0x1d936f,_0x29301e,_0x416518,_0x3000d5);return{'type':_0x15cc18['changes'][0x0]['type'],'index':_0x15cc18['index'],'content':_0xe4a5c0,'hasChanges':_0x5f53fe};});}function ut(_0x27208d,_0x371752,_0x48a34d){const _0x3a3e26=_0x27208d['plugins']['get']('DocumentCompare');let _0x551b01=_0x27208d['model']['createPositionAt'](_0x48a34d,Number['POSITIVE_INFINITY']),_0x33402c=_0x27208d['model']['createPositionAt'](_0x48a34d,0x0);for(const _0x371588 of _0x371752){let _0x2f5baf,_0x5f340c;if(_0x3a3e26['isMarkedRemoveOperation'](_0x371588))_0x2f5baf=_0x371588['newRange']['start'],_0x5f340c=_0x371588['newRange']['end'];else switch(_0x371588['type']){case'rename':_0x2f5baf=_0x371588['position'],_0x5f340c=_0x2f5baf['getShiftedBy'](0x1);break;case'addAttribute':case'removeAttribute':case'changeAttribute':_0x2f5baf=_0x371588['range']['start'],_0x5f340c=_0x371588['range']['end'];break;case'insert':_0x2f5baf=_0x371588['position'],_0x5f340c=_0x2f5baf['getShiftedBy'](_0x371588['howMany']);break;case'split':_0x2f5baf=_0x371588['splitPosition'],_0x5f340c=_0x371588['moveTargetPosition'];break;case'merge':{const _0x2d6450=_0x371588['targetPosition']['path']['slice'](-0x1);_0x2f5baf=_0x27208d['model']['createPositionFromPath'](_0x48a34d,_0x2d6450),_0x5f340c=_0x2f5baf['getShiftedBy'](0x1);break;}case'remove':{const _0xe2e2cb=_0x371588['howMany'],_0x200c22=_0x371588['sourcePosition']['_getTransformedByInsertion'](_0x371588['targetPosition'],_0xe2e2cb),_0x37963a=_0x371588['getMovedRangeStart']();'remove'==_0x371588['type']?(_0x2f5baf=_0x200c22,_0x5f340c=_0x200c22):(_0x2f5baf=_0x37963a,_0x5f340c=_0x37963a['getShiftedBy'](_0xe2e2cb));break;}}_0x2f5baf&&_0x2f5baf['isBefore'](_0x551b01)&&(_0x551b01=_0x2f5baf),_0x5f340c&&_0x5f340c['isAfter'](_0x33402c)&&(_0x33402c=_0x5f340c);}return _0x27208d['model']['createSelection'](_0x27208d['model']['createRange'](_0x551b01,_0x33402c));}function pt(_0xfbab51,_0x46f327){fn(_0xfbab51,_0x46f327,'forward');const _0x44e139=_0x46f327['getFirstRange']();_0x46f327['setTo']([]),_0x46f327['setTo'](_0x44e139,{'backward':!0x0}),fn(_0xfbab51,_0x46f327,'backward');}function fn(_0xe037cf,_0x5da01d,_0x53ec3a){let _0x5cf295=0x14;for(;_0x5cf295;){_0xe037cf['modifySelection'](_0x5da01d,{'unit':'word','direction':_0x53ec3a}),_0x5cf295--;const _0x1363cc=_0x5da01d['focus']['forward'==_0x53ec3a?'nodeBefore':'nodeAfter'];if(_0x1363cc&&_0x1363cc['is']('element')&&_0xe037cf['schema']['isBlock'](_0x1363cc)&&_0xe037cf['schema']['isObject'](_0x1363cc))break;}}function zn(_0x3863a4,_0x5162ec){for(let [_0xf9b979,_0x5f3e85]of _0x3863a4['markers'])_0x5f3e85=_0x5f3e85['_getTransformedByDeletion'](_0x5162ec['start'],_0x5162ec['end']['offset']-_0x5162ec['start']['offset']),_0x3863a4['markers']['set'](_0xf9b979,_0x5f3e85);}class rh extends _0x4b6a32{['copyButton'];['likeButton'];['dislikeButton'];['showChangesButton'];['_config'];constructor(_0x52bcf4,_0x480621={},_0x3ca861){super(_0x52bcf4),this['set']('isLoading',!0x1),this['_config']={'showCopy':!0x1,'showLike':!0x1,'showDislike':!0x1,..._0x480621};const _0x5826d2=!(this['_config']['showCopy']||this['_config']['showChanges']||this['_config']['showLike']||this['_config']['showDislike']||this['_config']['customView']?.['length']);this['class']=_0x5826d2?'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'](_0x3ca861),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']);}['_setupRatingButtons'](){this['likeButton']=new _0x23128a(this['locale']),this['likeButton']['set']({'icon':_0x1c18b1,'label':$n(this['locale'],'AI_MINI_TOOLBAR_LIKE'),'tooltip':!0x0}),this['likeButton']['bind']('isEnabled')['to'](this,'isLoading',_0x12f16d=>!_0x12f16d),this['likeButton']['on']('execute',()=>{this['fire']('like');}),this['dislikeButton']=new _0x23128a(this['locale']),this['dislikeButton']['set']({'icon':_0x4a35e4,'label':$n(this['locale'],'AI_MINI_TOOLBAR_DISLIKE'),'tooltip':!0x0}),this['dislikeButton']['bind']('isEnabled')['to'](this,'isLoading',_0xf5de55=>!_0xf5de55),this['dislikeButton']['on']('execute',()=>{this['fire']('dislike');});}['_setupCopyButton'](){this['copyButton']=new _0x23128a(this['locale']),this['copyButton']['set']({'icon':_0x320ca7,'label':$n(this['locale'],'AI_MINI_TOOLBAR_COPY'),'class':'ck-ai-mini-toolbar-copy-button','tooltip':!0x0}),this['copyButton']['bind']('isEnabled')['to'](this,'isLoading',_0x39860d=>!_0x39860d);const _0x149374=new _0x2745c1();_0x149374['set']({'content':_0xfb4387}),_0x149374['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',setTimeout(()=>{this['copyButton']['class']='ck-ai-mini-toolbar-copy-button';},0x7d0);}),this['copyButton']['children']['add'](_0x149374);}['_setupShowChangesButton'](_0x75f27c){this['showChangesButton']=new _0x23128a(this['locale']),this['showChangesButton']['set']({'icon':_0x5f7b66,'label':$n(this['locale'],'AI_SUGGESTION_BUTTON_SHOW_CHANGES'),'withText':'full'==this['_config']['showChanges'],'isOn':_0x75f27c}),this['showChangesButton']['bind']('isEnabled')['to'](this,'isLoading',_0x4e3197=>!_0x4e3197),this['showChangesButton']['on']('execute',()=>{const _0x41c6f0=!this['showChangesButton']['isOn'];this['showChangesButton']['set']({'isOn':_0x41c6f0,'icon':_0x41c6f0?_0x145b7b:_0x5f7b66}),this['fire']('toggleShowChanges',_0x41c6f0);});}}class dh extends _0x4118d8{['showChangesToggleView'];constructor(_0x3b4d5a,_0x1012de){super(_0x3b4d5a),this['set']('isShowChangesToggleVisible',!0x0),this['showChangesToggleView']=new jn(_0x3b4d5a),this['showChangesToggleView']['set']({'class':'ck-ai-suggestion__header__show-changes-toggle','label':$n(_0x3b4d5a,'AI_SUGGESTION_BUTTON_SHOW_CHANGES'),'withText':!0x0}),this['showChangesToggleView']['isOn']=_0x1012de['showDiff'],this['showChangesToggleView']['bind']('isVisible')['to'](this,'isShowChangesToggleVisible'),this['showChangesToggleView']['bind']('icon')['to'](this['showChangesToggleView'],'isOn',_0x1bf0c1=>_0x1bf0c1?_0x3f1054:_0x4c488e),this['showChangesToggleView']['on']('execute',()=>{this['showChangesToggleView']['isOn']=!this['showChangesToggleView']['isOn'],this['fire']('toggleShowChanges',{'isOn':this['showChangesToggleView']['isOn']});});const _0x592f2d=new _0x2745c1();_0x592f2d['content']=_0x1599ff,this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__header',!0x1===_0x1012de['showHeader']?'ck-hidden':null]['filter'](Boolean)},'children':[_0x592f2d,{'tag':'span','children':[$n(_0x3b4d5a,'AI_SUGGESTION_HEADER_TITLE')]},this['showChangesToggleView']]});}}class jn extends _0x23128a{['render'](){super['render'](),this['children']['remove'](this['iconView']),this['children']['add'](this['iconView']);}}class ta{['options'];['isStreaming']=!0x1;['document']=null;['nodesList']=[];['currentIndex']=0x0;['timeoutAbortController']=null;constructor(_0x246513){this['options']={'delay':_0x246513['delay']??0x14,'textNodeStyle':_0x246513['textNodeStyle'],'onStreamUpdate':_0x246513['onStreamUpdate']||(()=>{})};}async['stream']({document:_0x47bff7,targetElement:_0x42cbdd,abortSignal:_0x375cc3}){this['isStreaming']&&this['stop'](),_0x375cc3?.['addEventListener']('abort',this['stop']['bind'](this)),this['document']=_0x81e0af(_0x47bff7,!0x0),this['nodesList']=this['getParsedDocumentNodeList'](),this['isStreaming']=!0x0,this['currentIndex']>this['nodesList']['length']&&(_0x2f4ad6('html-streamer-current-index-out-of-bounds',{'currentIndex':this['currentIndex'],'nodeList':this['nodesList']}),this['currentIndex']=this['nodesList']['length']);for(let _0x5d16c3=0x0;_0x5d16c3<this['currentIndex'];_0x5d16c3++)this['nodesList'][_0x5d16c3]['shouldBeStreamed']=!0x0;let _0x30dc8b=0x0;for(let _0x52e032=this['currentIndex'];_0x52e032<this['nodesList']['length'];_0x52e032++){const _0xfac86e=Date['now'](),_0x1c511e=this['nodesList'][_0x52e032],_0x2ba487=_0xfac86e-_0x30dc8b;_0x1c511e['shouldBeStreamed']=!0x0;let _0x5a9314=_0x1c511e['parent'];for(;_0x5a9314;)_0x5a9314['shouldBeStreamed']=!0x0,_0x5a9314=_0x5a9314['parent'];if(_0x2ba487<this['options']['delay'])try{const {promise:_0x9da901,abortController:_0x4cc63a}=mr(this['options']['delay']-_0x2ba487);this['timeoutAbortController']=_0x4cc63a,await _0x9da901;}catch(_0x378624){return;}_0xb058cb(_0x42cbdd,'<'+_0x42cbdd['tagName']+'>'+this['renderNode'](this['document'])+'</'+_0x42cbdd['tagName']+'>',{'childrenOnly':!0x0}),this['options']['onStreamUpdate']&&this['options']['onStreamUpdate'](),this['currentIndex']=_0x52e032,_0x30dc8b=Date['now']();}this['isStreaming']=!0x1;}['cleanUpAnimations']({targetElement:_0x44c584}){Array['from'](_0x44c584['querySelectorAll']('span[data-ck-html-streamer-word-chunk]'))['reverse']()['forEach'](_0xd14b9=>{_0xd14b9['replaceWith'](_0xd14b9['childNodes'][0x0]);});}['stop'](){this['isStreaming']=!0x1,this['timeoutAbortController']&&(this['timeoutAbortController']['abort'](),this['timeoutAbortController']=null);}['renderNode'](_0x172a3d){let _0x553a43='';if(function(_0xb5b7e9){return _0x171f27(_0xb5b7e9);}(_0x172a3d)){for(const _0x1d4b90 of _0x172a3d['children'])_0x553a43+=this['renderNode'](_0x1d4b90);}else{if(ar(_0x172a3d)){if(!_0x172a3d['shouldBeStreamed'])return'';const _0x28c74c=_0x172a3d,_0x36f86e=Object['entries'](_0x28c74c['attribs'])['map'](([_0x20afc7,_0x30ecfd])=>_0x20afc7+'=\x22'+_0x30ecfd+'\x22')['join']('\x20');_0x553a43+='<'+_0x28c74c['tagName']+(_0x36f86e?'\x20'+_0x36f86e:'')+'>';for(const _0x2834f3 of _0x2d621f(_0x28c74c))_0x553a43+=this['renderNode'](_0x2834f3);_0x553a43+='</'+_0x28c74c['tagName']+'>';}else{if(!cr(_0x172a3d))return'';if(!_0x172a3d['shouldBeStreamed'])return'';!function(_0x380292){if(!_0x380292['parent']||!ar(_0x380292['parent']))return!0x1;if(!hr['includes'](_0x380292['parent']['tagName']))return!0x1;return!_0x2b2a77(_0x380292)['match'](/^\s*[<>]\s*$/);}(_0x172a3d)?_0x553a43+=_0x4e6e9a(_0x172a3d):_0x553a43+=_0x4e6e9a(new _0x4542ca('span',{'data-ck-html-streamer-word-chunk':'','style':this['options']['textNodeStyle']},[_0x172a3d]));}}return _0x553a43;}['getParsedDocumentNodeList'](){const _0x570b1a=[];return function(_0x1cf158,_0x4abc02){const _0x3ec100=_0x4c0344=>{if(_0x4abc02(_0x4c0344),_0x4c0344 instanceof _0x14643b)for(let _0x20f06d=0x0;_0x20f06d<_0x4c0344['children']['length'];_0x20f06d++){const _0x5f300c=_0x4c0344['children'][_0x20f06d];_0x3ec100(_0x5f300c);}};for(let _0x5a306d=0x0;_0x5a306d<_0x1cf158['children']['length'];_0x5a306d++)_0x3ec100(_0x1cf158['children'][_0x5a306d]);}(this['document'],_0x3799ce=>{if(cr(_0x3799ce)){const _0x2a3add=this['splitTextNodeIntoWordNodes'](_0x3799ce);_0x2a3add['length']&&_0x570b1a['push'](..._0x2a3add);}_0x3799ce['isWordSplitSource']||_0x3799ce['isWordSplitResult']||_0x570b1a['push'](_0x3799ce);}),_0x570b1a;}['splitTextNodeIntoWordNodes'](_0x39c7c3){if(_0x39c7c3['isWordSplitSource']||_0x39c7c3['isWordSplitResult'])return[];const _0x2451c6=_0x2b2a77(_0x39c7c3)['match'](/(?:\s*\S+\s*)/g),_0x374b9b=[];if(_0x2451c6&&_0x2451c6['length']>0x1){for(const _0x56d27a of _0x2451c6){const _0x445958=new _0x528111(_0x56d27a);_0x445958['isWordSplitResult']=!0x0,_0xd8f6c8(_0x39c7c3,_0x445958),_0x374b9b['push'](_0x445958);}_0x39c7c3['isWordSplitSource']=!0x0,_0x55d0bd(_0x39c7c3);}return _0x374b9b;}}const hr=['p','li','td','th','span','h1','h2','h3','h4','h5','h6','b','strong','i','em','mark','del','ins','sup','sub','a','code','div'];function cr(_0xc8b71f){return tn(_0xc8b71f);}function ar(_0x5babb5){return _0x37924d(_0x5babb5);}function mr(_0x452f2a){const _0x299832=new AbortController();return{'promise':new Promise((_0x23b057,_0x56d5cb)=>{const _0x5f7394=setTimeout(_0x23b057,_0x452f2a);_0x299832['signal']['addEventListener']('abort',()=>{clearTimeout(_0x5f7394),_0x56d5cb();});}),'abortController':_0x299832};}const Ee=['showChangeInText','insertSuggestion','applySuggestion','rejectSuggestion','mouseOverSuggestion','mouseLeaveSuggestion','toggleSuggestionDisplayMode','like','dislike'];class Nr extends _0x4118d8{['htmlStreamer'];['children'];['headerView'];['contentView'];constructor(_0x38c548,{part:_0x366776,areActionsDisabled:_0x2242ed}){super(_0x38c548),this['set']('partDefinition',_0x366776),this['set']('state','pending'),this['set']('isVisible',!0x1),this['bind']('isEnabled')['to'](this,'state',_0x2f7dfd=>'pending'==_0x2f7dfd&&!_0x2242ed),this['children']=this['createCollection'](),this['htmlStreamer']=new ta({'textNodeStyle':'animation:\x20ck-html-streamer-fade-in\x20.5s','delay':0x14}),this['headerView']=new Gn(_0x38c548,_0x366776),this['headerView']['bind']('partDefinition')['to'](this),this['headerView']['bind']('isEnabled')['to'](this),this['headerView']['bind']('state')['to'](this),this['headerView']['delegate'](...Ee)['to'](this);const _0x2d22e5=this['bindTemplate'];this['contentView']=new _0x4118d8(),this['contentView']['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__body__content-part__content']}}),this['children']['addMany']([this['contentView']]),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__body__content-part',_0x2d22e5['to']('state',_0x4fe03e=>'ck-ai-suggestion__body__content-part_'+_0x4fe03e),_0x2d22e5['to']('isEnabled',_0x15724e=>_0x15724e?'ck-ai-suggestion__body__content-part_active':void 0x0),_0x2d22e5['if']('isVisible','ck-hidden',_0x389825=>!_0x389825)]},'children':this['children'],'on':{'mouseenter':_0x2d22e5['to'](()=>{this['isEnabled']&&this['fire']('mouseOverSuggestion',{'index':_0x366776['index']});}),'mouseleave':_0x2d22e5['to'](()=>{this['isEnabled']&&this['fire']('mouseLeaveSuggestion',{'index':_0x366776['index']});})}});}async['updateContent']({part:_0x57349c,renderingStrategy:_0x3b1a93,showUnchangedParts:_0x4340c5=!0x1,abortSignal:_0x434323}){this['partDefinition']=_0x57349c,this['isVisible']=this['partDefinition']['hasChanges']||_0x4340c5,this['isVisible']&&('streaming'===_0x3b1a93?await this['htmlStreamer']['stream']({'document':this['partDefinition']['content'],'targetElement':this['contentView']['element'],'abortSignal':_0x434323}):this['contentView']['element']['innerHTML']=Ct(this['partDefinition']['content']));}['toggleHeader'](_0x4acbcb){_0x4acbcb?this['children']['has'](this['headerView'])||this['children']['add'](this['headerView'],0x0):this['children']['has'](this['headerView'])&&this['children']['remove'](this['headerView']);}}class Gn extends _0x4118d8{['children'];['_toolbarView'];['_iconStateAccepted'];['_iconStateRejected'];constructor(_0x51543d,_0x333f2e){super(_0x51543d),this['set']('partDefinition',_0x333f2e),this['set']('isEnabled',!0x0),this['set']('state','pending');const _0xb42acd=new _0x2745c1();_0xb42acd['content']=_0x3aabf7,_0xb42acd['extendTemplate']({'attributes':{'class':['ck-ai-suggestion__body__content-part__icon-title']}});const _0x31ecc9=new _0x23128a(_0x51543d);_0x31ecc9['set']({'label':$n(_0x51543d,'AI_SUGGESTION_CONTENT_PART_SHOW_IN_THE_TEXT'),'tooltip':!0x0,'withText':!0x1,'icon':_0x309a77}),_0x31ecc9['bind']('isEnabled')['to'](this),_0x31ecc9['on']('execute',()=>{this['fire']('showChangeInText',{'index':_0x333f2e['index']});});const _0x4e5934=new _0x23128a(_0x51543d);_0x4e5934['set']({'label':$n(_0x51543d,'AI_SUGGESTION_CONTENT_PART_ADD_AS_SUGGESTION'),'tooltip':!0x0,'withText':!0x1,'icon':_0x250c16}),_0x4e5934['bind']('isEnabled')['to'](this),_0x4e5934['on']('execute',()=>{this['fire']('insertSuggestion',{'index':_0x333f2e['index']});});const _0x33abab=new _0x23128a(_0x51543d);_0x33abab['set']({'label':$n(_0x51543d,'AI_SUGGESTION_CONTENT_PART_DELETE'),'tooltip':!0x0,'withText':!0x1,'icon':_0x194afd}),_0x33abab['on']('execute',()=>{this['fire']('rejectSuggestion',{'index':_0x333f2e['index']});}),_0x33abab['bind']('isEnabled')['to'](this),this['_toolbarView']=new _0x4b6a32(_0x51543d),this['_toolbarView']['items']['addMany']([_0x31ecc9,_0x4e5934,_0x33abab]),this['_iconStateAccepted']=new _0x2745c1(),this['_iconStateAccepted']['content']=_0xf033eb,this['_iconStateAccepted']['extendTemplate']({'attributes':{'class':['ck-ai-suggestion__body__content-part__icon-accepted'],'data-cke-tooltip-text':$n(_0x51543d,'AI_SUGGESTION_CONTENT_PART_ALREADY_APPLIED'),'data-cke-tooltip-position':'n'}}),this['_iconStateRejected']=new _0x2745c1(),this['_iconStateRejected']['content']=_0x55ba2b,this['_iconStateRejected']['extendTemplate']({'attributes':{'class':['ck-ai-suggestion__body__content-part__icon-rejected'],'data-cke-tooltip-text':$n(_0x51543d,'AI_SUGGESTION_CONTENT_PART_REJECTED'),'data-cke-tooltip-position':'n'}});const _0x5bc5ee=new _0x4118d8(_0x51543d);_0x5bc5ee['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai-suggestion__body__content-part__title__label']},'children':[$n(_0x51543d,'AI_SUGGESTION_CONTENT_PART_TITLE',(_0x333f2e['index']+0x1)['toString']())]}),this['children']=this['createCollection'](),this['children']['addMany']([_0xb42acd,_0x5bc5ee,this['_toolbarView']]),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__body__content-part__title']},'children':this['children']}),this['on']('change:state',(_0x14ea2e,_0x343e95,_0x2dbfef,_0x1626d7)=>{switch(_0x1626d7){case'pending':this['children']['remove'](this['_toolbarView']);break;case'accepted':this['children']['remove'](this['_iconStateAccepted']);break;case'rejected':this['children']['remove'](this['_iconStateRejected']);}switch(_0x2dbfef){case'pending':this['children']['add'](this['_toolbarView']);break;case'accepted':this['children']['add'](this['_iconStateAccepted']);break;case'rejected':this['children']['add'](this['_iconStateRejected']);}});}}class Q extends _0x5f2b03(){['queue']=[];['isProcessing']=!0x1;['_abortController'];async['enqueue'](_0x4e47ff){const _0x204060=this['createTask'](_0x4e47ff);return this['queue']['push'](_0x204060),this['_processQueue'](),_0x204060['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(_0x2ffe96=>{this['once']('_queueEmpty',()=>{_0x2ffe96();});}):Promise['resolve']();}async['_processQueue'](){if(!this['isProcessing']){this['_abortController']=new AbortController(),this['isProcessing']=!0x0;try{for(;this['queue']['length']&&this['isProcessing'];){const _0x5c20b7=this['queue']['shift']();try{await _0x5c20b7['callback'](this['_abortController']['signal']),_0x5c20b7['resolve']();}catch(_0x572e68){_0x5c20b7['reject'](_0x572e68);}}}finally{this['isProcessing']=!0x1,this['_abortController']=void 0x0;}this['fire']('_queueEmpty');}}['createTask'](_0x384f08){let _0x24148d,_0x5b3d73;const _0x15a0d2=new Promise((_0x280c91,_0x796eb6)=>{_0x24148d=_0x280c91,_0x5b3d73=_0x796eb6;});return{'callback':_0x384f08,'resolve':_0x24148d,'reject':_0x5b3d73,'completePromise':_0x15a0d2};}}class Cr extends _0x4118d8{['options'];['content']='';['htmlStreamer'];['children'];constructor(_0x2c761a){super();const _0x4a01d9=this['bindTemplate'];this['set']('isDone',!0x1),this['set']('isVisible',!0x0),this['htmlStreamer']=new ta({'textNodeStyle':'animation:\x20ck-html-streamer-fade-in\x20.5s','delay':0x14}),this['options']=_0x2c761a,this['children']=this['createCollection'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed__item',_0x4a01d9['if']('isDone','ck-ai-chat__feed__item_done'),_0x4a01d9['if']('isVisible','ck-hidden',_0x26fccc=>!_0x26fccc),'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'](_0x32e0c1=>{_0x32e0c1['removeAttribute']('data-id');}),this['isDone']=!0x0;}async['streamIntoElement'](_0x224040,_0x33e316,_0x514148){await this['htmlStreamer']['stream']({'document':_0x224040,'targetElement':_0x33e316,'abortSignal':_0x514148});}}class Ae extends Cr{constructor(_0x5aaa16){super(_0x5aaa16),this['extendTemplate']({'attributes':{'class':['ck-ai-chat-error','warning'===_0x5aaa16['level']?'ck-ai-chat-error_warning':'']}});}['render'](){super['render'](),this['setContent'](this['options']['initialContent']),this['markAsDone']();}['setContent'](_0x36181d){this['element']['innerHTML']=_0x36181d;}}class gh extends _0x4118d8{['_children'];['_areActionsDisabled'];['_showUnchangedParts'];['_updateContentPartsPromiseQueue'];['_emptyPartsWarningView'];constructor(_0x22fd8a,{areActionsDisabled:_0x5b3243,showUnchangedParts:_0x5e4d5e}){super(_0x22fd8a),this['_areActionsDisabled']=_0x5b3243,this['_showUnchangedParts']=_0x5e4d5e,this['set']('hasPendingParts',!0x1),this['_children']=this['createCollection'](),this['_updateContentPartsPromiseQueue']=new Q(),this['_emptyPartsWarningView']=new Ae({'id':'empty-parts-warning','initialContent':$n(_0x22fd8a,'AI_SUGGESTION_EMPTY_PART_WARNING'),'level':'warning'}),this['_emptyPartsWarningView']['isVisible']=!0x1,this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset_all-excluded','ck-ai-suggestion__body','ck-content']},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__body__content-parts']},'children':this['_children']},this['_emptyPartsWarningView']]});}get['partsCount'](){return this['_children']['length'];}async['updateContentParts']({parts:_0x4026a6,renderingStrategy:_0xcb2079,abortSignal:_0x323ecf}){for(const _0x4eedfa of _0x4026a6)this['_updateContentPartsPromiseQueue']['enqueue'](async _0x417b85=>{let _0x57a843=this['_children']['find'](_0x42b045=>_0x42b045['partDefinition']['index']==_0x4eedfa['index']);_0x57a843||(_0x57a843=new Nr(this['locale'],{'part':_0x4eedfa,'areActionsDisabled':this['_areActionsDisabled']}),_0x57a843['delegate'](...Ee)['to'](this),this['_children']['add'](_0x57a843),this['hasPendingParts']=!0x0),0x2===this['_children']['length']&&this['_children']['first']['toggleHeader'](!0x0),_0x57a843['toggleHeader'](this['_children']['length']>0x1),await _0x57a843['updateContent']({'part':_0x4eedfa,'renderingStrategy':_0xcb2079,'showUnchangedParts':this['_showUnchangedParts'],'abortSignal':_0x417b85});});return _0x323ecf?.['addEventListener']('abort',()=>{this['_updateContentPartsPromiseQueue']['abort']();}),this['_updateContentPartsPromiseQueue']['queueEmptyPromise'];}['updatePartState'](_0x5ceb49,_0x10d005){this['_children']['get'](_0x5ceb49)['state']=_0x10d005,this['hasPendingParts']='pending'==_0x10d005||Array['from'](this['_children'])['some'](_0x4f9e77=>'pending'==_0x4f9e77['state']);}['getPartView'](_0x23457e){return this['_children']['get'](_0x23457e);}['markAsDone'](){if(!this['_showUnchangedParts']){const _0x3d030d=!this['_children']['find'](_0x507904=>_0x507904['partDefinition']['hasChanges']),_0x31c0b9=!!this['_children']['find'](_0x199775=>!_0x199775['partDefinition']['hasChanges']);this['_emptyPartsWarningView']['isVisible']=_0x31c0b9,_0x3d030d?this['_emptyPartsWarningView']['setContent']($n(this['locale'],'AI_SUGGESTION_NO_PARTS_WARNING')):this['_emptyPartsWarningView']['setContent']($n(this['locale'],'AI_SUGGESTION_EMPTY_PART_WARNING'));}}get['hasNonEmptyParts'](){return!!this['_children']['find'](_0x2cf031=>_0x2cf031['partDefinition']['hasChanges']);}}class Oe extends _0x45ab1d{constructor(_0x495843=void 0x0){super();const _0x4e7d5b=_0x495843?'ck-ai-spinner_'+_0x495843:'';this['extendTemplate']({'tag':'span','attributes':{'class':['ck-ai-spinner',_0x4e7d5b]}});}}class F extends _0x4118d8{['bodyView'];['children'];['headerView'];['miniToolbarView'];['loaderView'];['sourcesView'];constructor(_0x8a9c11,{showDiff:_0x925f55,areActionsDisabled:_0x241d11,miniToolbarConfig:_0x3366c1,hideHeader:_0x430b1f,showLoader:_0x43a1d1,showUnchangedParts:_0x432a7f}){super(_0x8a9c11),this['set']('areChangesVisible',!0x1),this['set']('isLoaderVisible',!!_0x43a1d1),this['set']('isLoading',!0x1),this['children']=this['createCollection'](),_0x430b1f||(this['headerView']=new dh(_0x8a9c11,{'showDiff':_0x925f55}),this['headerView']['on']('toggleShowChanges',(_0x4be278,_0x4e060d)=>{this['areChangesVisible']=_0x4e060d['isOn'],this['fire']('toggleSuggestionDisplayMode',{'showDiff':_0x4e060d['isOn']});}),this['children']['add'](this['headerView'])),this['bodyView']=new gh(_0x8a9c11,{'areActionsDisabled':_0x241d11,'showUnchangedParts':!!_0x432a7f}),this['bodyView']['delegate'](...Ee)['to'](this),this['bodyView']['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isLoaderVisible','ck-hidden')]}}),this['miniToolbarView']=new rh(_0x8a9c11,_0x3366c1,_0x925f55),this['miniToolbarView']['delegate'](...Ee)['to'](this),this['miniToolbarView']['on']('toggleShowChanges',(_0x542d85,_0x1e9f96)=>{this['areChangesVisible']=_0x1e9f96,this['fire']('toggleSuggestionDisplayMode',{'showDiff':_0x1e9f96});}),this['miniToolbarView']['bind']('isLoading')['to'](this),this['children']['add'](this['bodyView']),this['children']['add'](this['miniToolbarView']),this['sourcesView']=new jr(this['locale']),this['children']['add'](this['sourcesView']),_0x43a1d1&&(this['loaderView']=this['_createLoaderView'](),this['children']['add'](this['loaderView'])),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__container','ck-rounded-corners']},'children':this['children']});}async['updateContent'](_0x43d9ec){await this['bodyView']['updateContentParts'](_0x43d9ec);}['updateSources'](_0x2b19cf){this['sourcesView']['children']['addMany'](_0x2b19cf['map'](_0x4c3649=>new Sr(this['locale'],_0x4c3649))),this['sourcesView']['isVisible']=!0x0;}['showLoader'](){this['loaderView']&&(this['isLoaderVisible']=!0x0);}['hideLoader'](){this['loaderView']&&(this['isLoaderVisible']=!0x1);}['markAsDone'](){this['bodyView']['markAsDone'](),this['headerView']&&(this['headerView']['isShowChangesToggleVisible']=this['bodyView']['hasNonEmptyParts']);}['setLoading'](){this['isLoading']=!0x0;}['clearLoading'](){this['isLoading']=!0x1;}['_createLoaderView'](){const _0x225f66=new _0x4118d8(this['locale']),_0x196955=new Oe('small');_0x196955['isVisible']=!0x0;const _0x2aa4dd=new _0x4118d8(this['locale']);return _0x2aa4dd['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai-suggestion__loader-text']},'children':[$n(this['locale'],'AI_CHAT_IS_WRITING')]}),_0x225f66['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-suggestion__loader',this['bindTemplate']['if']('isLoaderVisible','ck-hidden',_0x1106d0=>!_0x1106d0)]},'children':[_0x196955,_0x2aa4dd]}),_0x225f66;}}class jr extends _0x4118d8{['children'];constructor(_0x4b9089){super(_0x4b9089),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',_0x5bfeeb=>!_0x5bfeeb)]},'children':this['children']});const _0x157bb7=new _0x4118d8(this['locale']),_0x3fc496=new _0x2745c1();_0x3fc496['content']=_0xdddffb,_0x157bb7['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-web-sources__header']},'children':[_0x3fc496,{'tag':'span','children':[{'text':$n(this['locale'],'AI_CHAT_SOURCES_HEADER')}]}]}),this['children']['add'](_0x157bb7);}}class Sr extends _0x23128a{constructor(_0x150d7f,_0x1b10e8){super(_0x150d7f),this['set']({'label':_0x1b10e8['title'],'tooltip':_0x1b10e8['title'],'class':['ck\x20ck-ai-web-source'],'withText':!0x0});const _0xe97552=this['bindTemplate'];if(this['extendTemplate']({'on':{'click':_0xe97552['to'](()=>{window['open'](_0x1b10e8['url'],'_blank');})}}),_0x1b10e8['favicon']){const _0x4aed1f=new _0x4118d8(_0x150d7f);_0x4aed1f['setTemplate']({'tag':'img','attributes':{'src':_0x1b10e8['favicon']||_0xdddffb,'alt':_0x1b10e8['title'],'class':['ck-ai-web-source__image']}}),this['children']['add'](_0x4aed1f);}else this['set']('icon',_0xdddffb);}}class ls extends _0x4b6a32{constructor(_0x3f8593,_0x169424=!0x0,_0x827b99=!0x0){super(_0x3f8593),this['set']('isLoading',!0x1),_0x169424&&(this['applyButton']=this['_createButton']($n(_0x3f8593,'AI_BALLOON_APPLY_BUTTON'),'ck-ai-button-primary'),this['applyButton']['bind']('isEnabled')['to'](this,'isLoading',_0x7f5d28=>!_0x7f5d28),this['items']['add'](this['applyButton'])),_0x827b99&&(this['suggestButton']=this['_createButton']($n(_0x3f8593,'AI_BALLOON_SUGGEST_BUTTON'),'ck-ai-button-secondary'),this['suggestButton']['bind']('isEnabled')['to'](this,'isLoading',_0x45a2ea=>!_0x45a2ea),this['items']['add'](this['suggestButton'])),this['extendTemplate']({'attributes':{'class':['ck-ai-balloon__toolbar']}});}['_createButton'](_0x9b9fe4,_0x15d740){const _0x2eb258=new _0x23128a(this['locale']);return _0x2eb258['set']({'label':_0x9b9fe4,'class':_0x15d740||'','isVisible':!0x0,'withText':!0x0}),_0x2eb258;}}class ds extends _0x4118d8{constructor(_0x3422d9){super(_0x3422d9),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-balloon__disclaimer']},'children':[{'tag':'p','attributes':{'class':['ck','ck-ai-balloon__disclaimer-content']},'children':[{'text':$n(_0x3422d9,'AI_DISCLAIMER_TEXT')}]}]});}}const P=['applySuggestion','insertSuggestion','showNext','showPrevious'];class D extends _0x4118d8{['focusTracker'];['keystrokes'];['focusCycler'];['_focusables'];constructor(_0x54788c,_0x2393d8){super(_0x54788c),this['set']('isLoading',!0x1),this['focusTracker']=new _0xc5fc70(),this['keystrokes']=new _0x464bf0(),this['_focusables']=this['createCollection'](),this['focusCycler']=new _0x53ec2a({'focusables':this['_focusables'],'focusTracker':this['focusTracker'],'keystrokeHandler':this['keystrokes'],'actions':{'focusPrevious':'shift\x20+\x20tab','focusNext':'tab'}}),this['_dialogContent']=new _0x260fed(),this['_addContentView'](_0x2393d8['mainView']),this['_addDisclaimerView'](),this['_addToolbar'](_0x2393d8['showApplyButton'],_0x2393d8['showSuggestButton']),this['toolbar']['bind']('isLoading')['to'](this),this['_focusables']['clear'](),this['_focusables']['addMany']([this['toolbar']]),this['setTemplate']({'tag':'div','attributes':{'class':'ai-balloon-content'},'children':this['_dialogContent']});}['render'](){super['render']();for(const _0x2fe1fb of this['_focusables'])this['focusTracker']['add'](_0x2fe1fb['element']);this['keystrokes']['listenTo'](this['element']);}['focus'](_0x4a3e9e){-0x1===_0x4a3e9e?this['focusCycler']['focusLast']():this['focusCycler']['focusFirst']();}['setLoading'](){this['isLoading']=!0x0;}['clearLoading'](){this['isLoading']=!0x1;}['setupRotator'](_0x442c31){const _0x3a7623=this['_createNextButtonView'](),_0x4d1f3c=this['_createPreviousButtonView']();_0x442c31['view']['headerView']['children']['add'](_0x3a7623,0x2),_0x442c31['view']['headerView']['children']['add'](_0x4d1f3c,0x0),this['_focusables']['addMany']([_0x3a7623,_0x4d1f3c]),this['focusTracker']['add'](_0x3a7623['element']),this['focusTracker']['add'](_0x4d1f3c['element']);}['_addContentView'](_0x1d02ec){this['_mainView']=_0x1d02ec,this['_dialogContent']['add'](this['_mainView']);}['_addDisclaimerView'](){this['disclaimerView']=new ds(this['locale']),this['_dialogContent']['add'](this['disclaimerView']);}['_addToolbar'](_0x5a38f1=!0x0,_0x2bc494=!0x0){this['toolbar']=new ls(this['locale'],_0x5a38f1,_0x2bc494),this['toolbar']['applyButton']?.['on']('execute',()=>{this['fire']('applySuggestion');}),this['toolbar']['suggestButton']?.['on']('execute',()=>{this['fire']('insertSuggestion');}),this['_dialogContent']['add'](this['toolbar']);}['_createNextButtonView'](){const _0x28a518=new _0x23128a(this['locale']);return _0x28a518['set']({'icon':_0x517bb3,'tooltip':$n(this['locale'],'AI_BALLOON_NEXT_TOOLTIP')}),_0x28a518['on']('execute',()=>{this['fire']('showNext');}),_0x28a518;}['_createPreviousButtonView'](){const _0x41d6db=new _0x23128a(this['locale']);return _0x41d6db['set']({'icon':_0x460602,'tooltip':$n(this['locale'],'AI_BALLOON_PREVIOUS_TOOLTIP')}),_0x41d6db['on']('execute',()=>{this['fire']('showPrevious');}),_0x41d6db;}}class W extends _0x56fd8d{static get['requires'](){return[N,O];}static get['pluginName'](){return'AIBalloon';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['isOpen']=!0x1;['_config'];['open'](_0x15e4cf){const _0x40282b=V(this['context']);this['_config']=_0x15e4cf,this['balloonView']=new D(_0x40282b['locale'],_0x15e4cf),this['balloonView']['delegate'](...P)['to'](this),this['_showDialog'](_0x15e4cf);}['close'](){V(this['context'])['plugins']['get']('Dialog')['hide']();}['_setupVisualSelection'](_0x43fc43,_0x49dec7){this['context']['plugins']['get'](O)['showFakeVisualSelection'](_0x43fc43,'ai-balloon-'+_0x49dec7,!0x0,!0x0);}['_showDialog'](_0x55d1a9){const _0xf49bcb=V(this['context']);this['_setupVisualSelection'](_0x55d1a9['ranges'],_0x55d1a9['index']),_0xf49bcb['plugins']['get']('Dialog')['show']({'title':_0x55d1a9['title'],'icon':_0x55d1a9['icon'],'hasCloseButton':!0x0,'id':'aiBalloon','position':this['_calculateDialogPosition']['bind'](this),'className':'ai-balloon'+(_0x55d1a9['showRotator']?'\x20ai-balloon-rotator':''),'content':this['balloonView'],'onShow':_0x5db4e6=>{_0x55d1a9['showRotator']&&this['balloonView']['setupRotator'](_0x5db4e6),this['isOpen']=!0x0;},'onHide':()=>{this['context']['plugins']['get']('AIEditing')['hideFakeVisualSelection']('ai-balloon-'+_0x55d1a9['index']),this['fire']('dialogClosed'),this['isOpen']=!0x1;}});}['_calculateDialogPosition'](_0x1778fd,_0x1dd4b2){const _0x1cee3d=V(this['context']);if(!_0x1dd4b2)return null;const _0x143204=_0xd604ec(_0x1cee3d['editing'],[..._0x1cee3d['model']['markers']['getMarkersGroup']('ai-selection'),..._0x1cee3d['model']['markers']['getMarkersGroup']('ai-balloon-selection')]);if(!_0x143204||0x0===_0x143204['length'])return{'left':Math['round'](_0x1dd4b2['left']+_0x1dd4b2['width']/0x2-_0x1778fd['width']/0x2),'top':Math['round'](_0x1dd4b2['top']+_0x1dd4b2['height']/0x2-_0x1778fd['height']/0x2)};const _0x334ac9=Math['round'](_0x1dd4b2['left']+_0x1dd4b2['width']/0x2-_0x1778fd['width']/0x2),_0x4b9a7d=_0x143204[0x0]['getBoundingClientRect'](),_0x56c61c=_0x143204[_0x143204['length']-0x1]['getBoundingClientRect'](),_0x31eaa6=_0x1778fd['height'],_0xd2047d=this['_config']['showRotator']?0x8:0x0;return{'left':_0x334ac9,'top':this['_calculateOptimalTopPosition'](_0x4b9a7d,_0x56c61c,_0x31eaa6,_0xd2047d)};}['_calculateOptimalTopPosition'](_0x39bf84,_0xae79c5,_0x5644a3,_0x3a0d7a=0x0){const _0x2f35a7=_0xae79c5['top']+_0xae79c5['height'],_0x38c607=_0x39bf84['top']-_0x5644a3-_0x3a0d7a,_0x227765=window['innerHeight']-_0x2f35a7-0xa,_0x56b250=_0x39bf84['top']-_0x3a0d7a-0xa;let _0x3ed079;if(_0x227765>=_0x5644a3)_0x3ed079=_0x2f35a7+0xa;else{if(_0x56b250>=_0x5644a3)_0x3ed079=_0x38c607-0xa;else _0x3ed079=_0x39bf84['top']+(_0xae79c5['top']+_0xae79c5['height'])/0x2-(_0x5644a3+_0x3a0d7a)/0x2;}return _0x3ed079;}}class et extends _0x56fd8d{['_aiEditing'];['_aiConnector'];['_aiChatUi'];['_aiChatModels'];['_batchToChanges']=new Map();['_previewedChangeGroup']=null;['_balloonShowDiff']=!0x1;static get['requires'](){return[N,W,_0x104527];}static get['pluginName'](){return'AIChatController';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){this['_aiConnector']=this['context']['plugins']['get']('AIConnector'),this['_aiChatUi']=this['context']['plugins']['get']('AIChatUI'),this['_aiEditing']=this['context']['plugins']['get']('AIEditing'),this['_aiChatModels']=new lt({'connector':this['_aiConnector']});const _0x1ca18a=this['context']['plugins']['get']('AITabs');this['listenTo'](this['_aiChatUi'],'startConversation',()=>{this['_startConversationSafely']();}),this['listenTo'](this['_aiChatUi'],'sendUserMessage',(_0x4e60f7,_0x286bd0)=>{this['_handleUIUserMessage']({'userMessage':_0x286bd0});}),this['listenTo'](_0x1ca18a,'resizedTabs',(_0x4a9255,_0x34ae92)=>{this['_setIsMaximized'](_0x34ae92);}),this['listenTo'](this['_aiChatUi'],'resizeTabs',()=>{_0x1ca18a['resize']();}),this['listenTo'](this['_aiChatUi'],'abortPromptStream',async()=>{await this['_stopLastInteraction'](),await this['_flushLastInteractionUI']();}),this['listenTo'](this['_aiChatUi'],'addDocumentToContext',()=>{this['activeConversation']?.['addCurrentDocumentToContext']($n(this['context']['locale'],'AI_CHAT_CONTEXT_CURRENT_DOCUMENT'));}),this['listenTo'](this['_aiChatUi'],'addFileToContext',(_0x4d77bd,_0x3f87a6)=>{this['activeConversation']?.['addFilesToContext'](Array['from'](_0x3f87a6));}),this['listenTo'](this['_aiChatUi'],'addUrlToContext',(_0xe0d873,_0x562047)=>{this['activeConversation']?.['addUrlToContext'](_0x562047);}),this['listenTo'](this['_aiChatUi'],'addResourceToContext',(_0x14a680,_0xe3ad2)=>{this['activeConversation']?.['addResourceToContext'](_0xe3ad2['source'],_0xe3ad2['resource']);}),this['listenTo'](this['_aiChatUi'],'removeContextItem',(_0x8fa665,_0x1089cf)=>{this['_removeFromContext'](_0x1089cf);}),this['listenTo'](this['_aiChatUi'],'loadSourceResources',(_0x22dd26,_0x4e7cbc)=>{this['activeConversation']?.['loadSourceResources'](_0x4e7cbc['sourceId'],_0x4e7cbc['query'],_0x4e7cbc['uid']);}),this['listenTo'](this['_aiChatUi'],'toggleWebSearch',()=>{this['_toggleWebSearch']();}),this['listenTo'](this['_aiChatUi'],'toggleReasoning',()=>{this['_toggleReasoning']();}),this['listenTo'](this['_aiChatUi'],'selectModel',(_0x527cd5,_0x50f0ed)=>{this['activeConversation']?.['setModel'](_0x50f0ed);}),this['listenTo'](this['_aiChatUi'],'like',(_0x22f21f,{replyId:_0x4cb12b})=>{console['log']('Liked\x20response',_0x4cb12b);}),this['listenTo'](this['_aiChatUi'],'dislike',(_0x14e8d2,{replyId:_0x2b72bc})=>{console['log']('Disliked\x20response',_0x2b72bc);}),this['listenTo'](this['_aiChatUi'],'insertSuggestion',(_0x474de6,_0x3617cf)=>{this['context']['plugins']['get'](W)['close'](),this['_insertSuggestion'](_0x3617cf);}),this['listenTo'](this['_aiChatUi'],'showChangeInText',(_0x52cbaa,{replyId:_0x2d8881,partIndex:_0x2119de})=>{this['_balloonShowDiff']=this['_aiChatUi']['showDiff'],this['_openBalloonFor'](_0x2d8881,_0x2119de);}),this['listenTo'](this['_aiChatUi'],'mouseOverSuggestion',(_0x35578a,{replyId:_0x3db9c2,partIndex:_0x45ec90})=>{const _0x4dc029=this['_getDocumentRangeForReplyChanges'](_0x3db9c2,_0x45ec90);_0x4dc029&&'$graveyard'!=_0x4dc029['range']['root']['rootName']&&this['_aiEditing']['showFakeVisualSelection']([_0x4dc029['range']],'ai-chat-controller-mouse-over');}),this['listenTo'](this['_aiChatUi'],'mouseLeaveSuggestion',()=>{this['_aiEditing']['hideFakeVisualSelection']('ai-chat-controller-mouse-over');}),this['listenTo'](this['_aiChatUi'],'applySuggestion',(_0x268547,_0xff954)=>{this['context']['plugins']['get'](W)['close'](),this['_applySuggestion'](_0xff954);}),this['listenTo'](this['_aiChatUi'],'toggleSuggestionDisplayMode',async(_0xdd8dd7,_0x14b918)=>{const {reply:_0x23c79d}=this['getInteractionAndReplyById'](_0x14b918['replyId']),_0x34b2bb=Y({'editor':V(this['context']),'changeGroups':_0x23c79d['changeGroups'],'documentContextContent':_0x23c79d['documentContextContent'],'showDiff':_0x14b918['showDiff']});await this['_aiChatUi']['updateFeedItemAIReplySuggestionContent']({'id':_0x23c79d['id'],'parts':_0x34b2bb,'renderingStrategy':'static'});}),this['listenTo'](this['_aiChatUi'],'rejectSuggestion',(_0x1e696e,{replyId:_0x16e7ac,partIndex:_0x28a092})=>{this['_previewedChangeGroup']?.['replyId']==_0x16e7ac&&this['_previewedChangeGroup']?.['partIndex']==_0x28a092&&this['context']['plugins']['get'](W)['close']();const {reply:_0x9f0d54}=this['getInteractionAndReplyById'](_0x16e7ac);_0x9f0d54['setChangeGroupState'](_0x28a092,'rejected'),this['_aiEditing']['hideFakeVisualSelection']('ai-chat-controller-mouse-over');});}async['afterInit'](){this['context']instanceof ot?this['_integrateEditor'](this['context']):this['listenTo'](this['context']['editors'],'add',(_0x1c5780,_0x3acbf4)=>{_0x3acbf4['on']('ready',()=>{this['_integrateEditor'](_0x3acbf4);});}),await this['_startConversationSafely']();}['_insertSuggestion'](_0x4613a3){const _0xb7b72=V(this['context']);if(!_0xb7b72['plugins']['has']('TrackChangesEditing'))return;const _0x2b8bf8=this['context']['plugins']['get']('DocumentCompare'),{reply:_0x18a75d,interaction:_0x632ccf}=this['getInteractionAndReplyById'](_0x4613a3['replyId']),_0x53df9e=this['_getDocumentRangeForReplyChanges'](_0x4613a3['replyId'],_0x4613a3['partIndex']),_0x13f8d3=void 0x0!==_0x4613a3['partIndex']?[_0x18a75d['changeGroups'][_0x4613a3['partIndex']]]:_0x18a75d['changeGroups']['filter'](_0x2ae9c7=>'pending'==_0x2ae9c7['state']),_0x189510=_0x13f8d3['map'](_0x3507e4=>_0x18a75d['changeGroups']['indexOf'](_0x3507e4));_0x189510['forEach'](_0x752c5a=>_0x18a75d['setChangeGroupState'](_0x752c5a,'accepted'));const _0x24f57c=z({'editor':_0xb7b72,'reply':_0x18a75d,'interaction':_0x632ccf,'groups':_0x13f8d3,'transform':!0x0,'documentCompare':_0x2b8bf8,'documentCompareOptions':{'anchor':'main','markDeletions':!0x0}});let _0xc2bd26;_0x53df9e&&this['_scrollToSuggestionRange'](_0x53df9e['range']),_0xb7b72['model']['change'](_0x4d11ce=>{_0xc2bd26=_0x4d11ce['batch'],_0xb7b72['plugins']['get']('TrackChangesEditing')['_applyOperationsAsSuggestions'](_0x24f57c),this['_aiEditing']['hideFakeVisualSelection']('ai-chat-controller-mouse-over');}),this['_batchToChanges']['set'](_0xc2bd26,{'interactionId':_0x632ccf['id'],'replyId':_0x18a75d['id'],'indexes':_0x189510['slice']()});}['_applySuggestion'](_0x36b75d){const _0x19c65e=V(this['context']),_0x2cd8fc=this['context']['plugins']['get'](_0x104527),{reply:_0x37cc35,interaction:_0x2e1370}=this['getInteractionAndReplyById'](_0x36b75d['replyId']),_0x5d1aeb=this['_getDocumentRangeForReplyChanges'](_0x36b75d['replyId'],_0x36b75d['partIndex']),_0x3518f9=void 0x0!==_0x36b75d['partIndex']?[_0x37cc35['changeGroups'][_0x36b75d['partIndex']]]:_0x37cc35['changeGroups']['filter'](_0x2168b6=>'pending'==_0x2168b6['state']),_0x1e3428=_0x3518f9['map'](_0xf9837f=>_0x37cc35['changeGroups']['indexOf'](_0xf9837f));_0x1e3428['forEach'](_0x2a497f=>_0x37cc35['setChangeGroupState'](_0x2a497f,'accepted'));const _0x39bc93=z({'editor':_0x19c65e,'reply':_0x37cc35,'interaction':_0x2e1370,'groups':_0x3518f9,'transform':!0x0,'documentCompare':_0x2cd8fc,'documentCompareOptions':{'anchor':'main','markDeletions':!0x1}});let _0x6e3f87;_0x5d1aeb&&this['_scrollToSuggestionRange'](_0x5d1aeb['range']),_0x19c65e['model']['change'](_0x2c1ee4=>{_0x6e3f87=_0x2c1ee4['batch'];for(const _0xe79940 of _0x39bc93)_0xe79940['baseVersion']=_0x19c65e['model']['document']['version'],_0x2c1ee4['batch']['addOperation'](_0xe79940),_0x19c65e['model']['applyOperation'](_0xe79940);}),this['_batchToChanges']['set'](_0x6e3f87,{'interactionId':_0x2e1370['id'],'replyId':_0x37cc35['id'],'indexes':_0x1e3428['slice']()});}['_openBalloonFor'](_0x4b7951,_0x2ec31a){const _0x254f97=V(this['context']),_0x3b0a04=this['_getDocumentRangeForReplyChanges'](_0x4b7951,_0x2ec31a),_0x5d7017=this['context']['plugins']['get'](W);if(!_0x3b0a04)return void _0x5d7017['close']();const {range:_0x413c30,currentIndex:_0xa63c94,previousIndex:_0x34181f,nextIndex:_0x5a6481}=_0x3b0a04;if(this['_previewedChangeGroup']?.['replyId']==_0x4b7951&&this['_previewedChangeGroup']?.['partIndex']==_0xa63c94)return;this['_previewedChangeGroup']={'replyId':_0x4b7951,'partIndex':_0xa63c94};const _0x329ac0=new F(_0x254f97['locale'],{'showDiff':this['_balloonShowDiff'],'areActionsDisabled':!0x1,'miniToolbarConfig':{'showChanges':'full'},'hideHeader':!0x0}),{reply:_0x57faba}=this['getInteractionAndReplyById'](_0x4b7951),_0x4788c9=Y({'editor':_0x254f97,'changeGroups':[_0x57faba['changeGroups'][_0xa63c94]],'documentContextContent':_0x57faba['documentContextContent'],'showDiff':this['_balloonShowDiff']});_0x329ac0['updateContent']({'parts':_0x4788c9,'renderingStrategy':'static'});const _0x21dde2=_0xa63c94!==_0x34181f;this['_scrollToSuggestionRange'](_0x413c30,!0x0),_0x5d7017['open']({'index':_0xa63c94,'title':$n(this['context']['locale'],'AI_BALLOON_HEADER_TITLE',(_0xa63c94+0x1)['toString']()),'icon':yt,'mainView':_0x329ac0,'showRotator':_0x21dde2,'showApplyButton':!0x0,'showSuggestButton':!0x0,'ranges':[_0x413c30]}),this['_aiChatUi']['scrollFeedToSuggestion'](_0x4b7951,_0xa63c94),this['listenTo'](_0x329ac0,'toggleSuggestionDisplayMode',(_0x232ea7,{showDiff:_0x40e88a})=>{this['_balloonShowDiff']=_0x40e88a;const {reply:_0xc88d15}=this['getInteractionAndReplyById'](_0x4b7951),_0x406426=Y({'editor':_0x254f97,'changeGroups':[_0xc88d15['changeGroups'][_0xa63c94]],'documentContextContent':_0xc88d15['documentContextContent'],'showDiff':_0x40e88a});_0x329ac0['updateContent']({'parts':_0x406426,'renderingStrategy':'static'});}),this['listenTo'](_0x5d7017,'applySuggestion',()=>{this['_applySuggestion']({'replyId':_0x4b7951,'partIndex':_0xa63c94}),_0x21dde2?this['_openBalloonFor'](_0x4b7951,_0x5a6481):_0x5d7017['close']();}),this['listenTo'](_0x5d7017,'insertSuggestion',()=>{this['_insertSuggestion']({'replyId':_0x4b7951,'partIndex':_0xa63c94}),_0x21dde2?this['_openBalloonFor'](_0x4b7951,_0x5a6481):_0x5d7017['close']();}),_0x21dde2&&(this['listenTo'](_0x5d7017,'showNext',()=>{this['_openBalloonFor'](_0x4b7951,_0x5a6481);}),this['listenTo'](_0x5d7017,'showPrevious',()=>{this['_openBalloonFor'](_0x4b7951,_0x34181f);})),this['listenTo'](_0x5d7017,'dialogClosed',()=>{this['stopListening'](_0x5d7017),this['stopListening'](_0x329ac0),this['_previewedChangeGroup']=null;});}['_getDocumentRangeForReplyChanges'](_0x5755fd,_0x820692){const _0x5001d8=V(this['context']),{reply:_0x2225c6,interaction:_0x5a89f4}=this['getInteractionAndReplyById'](_0x5755fd),_0x24877b=_0x2225c6['changeGroups']['filter'](_0x5b4a41=>'pending'==_0x5b4a41['state']),_0x700e52=_0x24877b['map'](_0x18e87e=>_0x2225c6['changeGroups']['indexOf'](_0x18e87e));void 0x0===_0x820692&&(_0x820692=_0x700e52[0x0]);const _0x3b01b1=_0x700e52['indexOf'](_0x820692);if(-0x1==_0x3b01b1)return null;const _0x14a590=0x0==_0x3b01b1?_0x700e52[_0x700e52['length']-0x1]:_0x700e52[_0x3b01b1-0x1],_0x27c0a3=_0x3b01b1==_0x700e52['length']-0x1?_0x700e52[0x0]:_0x700e52[_0x3b01b1+0x1],_0x16fe6f=_0x24877b[_0x3b01b1],_0x6a4a51=new _t([]),_0x2f1af5=new _t([]);for(const _0x15940d of _0x16fe6f['changes'])if('removed'!=_0x15940d['type']&&_0x2f1af5['children']['push'](_0x15940d['node']['cloneNode'](!0x0)),'new'!=_0x15940d['type']){const _0x5effc2=mt(_0x2f3399=>ft(_0x2f3399,'data-id')==_0x15940d['id'],_0x2225c6['documentContextContent'],!0x0);_0x6a4a51['children']['push'](_0x5effc2['cloneNode'](!0x0));}if(0x0==_0x6a4a51['children']['length']){if(_0x16fe6f['changes'][0x0]['anchorId']){const _0x4f831d=It('data-id',_0x16fe6f['changes'][0x0]['anchorId'],_0x2225c6['documentContextContent']);_0x6a4a51['children']['unshift'](_0x4f831d['cloneNode'](!0x0)),_0x2f1af5['children']['unshift'](_0x4f831d['cloneNode'](!0x0)),_0x4f831d['nextSibling']&&(_0x6a4a51['children']['push'](_0x4f831d['nextSibling']['cloneNode'](!0x0)),_0x2f1af5['children']['push'](_0x4f831d['nextSibling']['cloneNode'](!0x0)));}else{const _0x378878=_0x2225c6['documentContextContent']['children'][0x0];if(!_0x378878)return null;_0x6a4a51['children']['push'](_0x378878['cloneNode'](!0x0)),_0x2f1af5['children']['push'](_0x378878['cloneNode'](!0x0));}}const _0x4cf963=_0x5a89f4['getDocumentContext'](),_0x5d8df1=_0x5001d8['data']['parse'](_0x4cf963['content']),_0x228529=Ct(_0x6a4a51),_0x14615b=_0x5001d8['data']['parse'](_0x228529),_0x2d8347=_0x5001d8['data']['parse'](_0x228529),_0x47eddf=_0x5001d8['model']['createPositionAt'](_0x14615b,0x0),_0xfd8e19=Ct(_0x2f1af5),_0xa7ca6c={'anchor':_0x47eddf,'markDeletions':!0x1},_0x3e99ba=_0x5001d8['plugins']['get'](_0x104527)['getDiff'](_0x228529,_0xfd8e19,_0xa7ca6c)['getOperations']();if(!_0x3e99ba['length'])return null;_0x5001d8['model']['change'](_0x5a107d=>{for(const _0x51c0b4 of _0x3e99ba)if('remove'==_0x51c0b4['type']){const _0x349519=_0x51c0b4['sourcePosition'],_0x15dc25=_0x51c0b4['howMany'],_0x48b78c=new tt(_0x349519,_0x15dc25);_0x5a107d['batch']['addOperation'](_0x48b78c),_0x5001d8['model']['applyOperation'](_0x48b78c);}else _0x51c0b4['baseVersion']=null,_0x51c0b4['isDocumentOperation']=!0x1,_0x5a107d['batch']['addOperation'](_0x51c0b4),_0x5001d8['model']['applyOperation'](_0x51c0b4);});const _0x594272=ut(_0x5001d8,_0x3e99ba,_0x14615b);pt(_0x5001d8['model'],_0x594272);const _0x3c3d38=_0x594272['getFirstRange']()['start']['path']['slice'](),_0x23ece1=_0x594272['getFirstRange']()['end']['path']['slice'](),_0x896ce1=[];let _0x196a16=_0x14615b,_0x2bd3ec=_0x2d8347;for(let _0x2d8ebb=0x0;_0x2d8ebb<_0x23ece1['length'];_0x2d8ebb++){const _0x5c9682=_0x196a16['maxOffset']-_0x23ece1[_0x2d8ebb];_0x896ce1[_0x2d8ebb]=_0x2bd3ec['maxOffset']-_0x5c9682,_0x196a16=_0x196a16['getChildAtOffset'](_0x23ece1[_0x2d8ebb]),_0x2bd3ec=_0x2bd3ec['getChildAtOffset'](_0x896ce1[_0x2d8ebb]);}const _0x152715=_0x5001d8['model']['createRange'](_0x5001d8['model']['createPositionFromPath'](_0x2d8347,_0x3c3d38),_0x5001d8['model']['createPositionFromPath'](_0x2d8347,_0x896ce1)),_0x4dd146=_0x2d8347['getChild'](0x0)['getAttribute'](gt),_0x2e49ec=Array['from'](_0x5d8df1['getChildren']())['find'](_0x12c9fe=>_0x12c9fe['getAttribute'](gt)==_0x4dd146)['getPath'](),_0x1195a6=_0x152715['start']['path']['slice'](),_0x2058f5=_0x152715['end']['path']['slice']();_0x1195a6[0x0]=_0x2e49ec[0x0]+_0x1195a6[0x0],_0x2058f5[0x0]=_0x2e49ec[0x0]+_0x2058f5[0x0];let _0x1f3c04=_0x5001d8['model']['createRange'](_0x5001d8['model']['createPositionFromPath'](_0x5001d8['model']['document']['getRoot'](),_0x1195a6),_0x5001d8['model']['createPositionFromPath'](_0x5001d8['model']['document']['getRoot'](),_0x2058f5));const _0x540ceb=_0x5001d8['model']['document']['history']['getOperations'](_0x4cf963['version']);for(const _0x2c42b1 of _0x540ceb)_0x1f3c04=_0x4924b2['_createFromRanges'](_0x1f3c04['getTransformedByOperation'](_0x2c42b1));return{'range':_0x1f3c04,'previousIndex':_0x14a590,'nextIndex':_0x27c0a3,'currentIndex':_0x820692};}['_integrateEditor'](_0x1f461d){if(!_0x1f461d['plugins']['has']('Undo'))return;const _0x205461=_0x1f461d['commands']['get']('undo'),_0x2858db=_0x1f461d['commands']['get']('redo');this['listenTo'](_0x205461,'revert',(_0x269e1f,_0x288cdf,_0x5df660)=>{const _0x5ca92b=this['_batchToChanges']['get'](_0x288cdf);if(!_0x5ca92b)return;const _0x2783c7=this['activeConversation']['getInteraction'](_0x5ca92b['interactionId'])['getReply'](_0x5ca92b['replyId']);_0x5ca92b['indexes']['forEach'](_0x3e44dc=>_0x2783c7['setChangeGroupState'](_0x3e44dc,'pending')),this['_batchToChanges']['delete'](_0x288cdf),this['_batchToChanges']['set'](_0x5df660,_0x5ca92b);}),this['listenTo'](_0x2858db,'revert',(_0x24a49f,_0x10783c,_0x3e1a55)=>{const _0x55681a=this['_batchToChanges']['get'](_0x10783c);if(!_0x55681a)return;const _0x45e530=this['activeConversation']['getInteraction'](_0x55681a['interactionId'])['getReply'](_0x55681a['replyId']);_0x55681a['indexes']['forEach'](_0x20b2ef=>_0x45e530['setChangeGroupState'](_0x20b2ef,'accepted')),this['_batchToChanges']['delete'](_0x10783c),this['_batchToChanges']['set'](_0x3e1a55,_0x55681a);});}async['loadConversation'](_0x444ffd){this['context']['plugins']['get'](W)['close'](),this['_aiChatUi']['setFeedItemRenderingStrategy']('static'),this['_aiChatUi']['toggleLoadingSkeleton'](!0x0),await this['_stopLastInteraction']();try{const _0x509a52=this['context']['plugins']['get'](ht);this['updateConversationTitle']('\x20'),_0x509a52['view']['activateTab']('chat'),await this['_startConversationSafely'](_0x444ffd);const {sessionId:_0x3ad75c}=this['_aiEditing']['getDocumentData']();await this['activeConversation']['load'](_0x444ffd,_0x3ad75c),this['activeConversation']['isCurrentDocumentInConversation']()&&this['activeConversation']['addCurrentDocumentToContext']($n(this['context']['locale'],'AI_CHAT_CONTEXT_CURRENT_DOCUMENT'));}catch(_0x490e59){console['error']('Failed\x20to\x20load\x20conversation',_0x490e59);}finally{this['_aiChatUi']['setFeedItemRenderingStrategy']('streaming'),this['_aiChatUi']['toggleLoadingSkeleton'](!0x1);}}['handleRemovedConversation'](_0x228955){this['activeConversation']['id']===_0x228955&&this['_startConversationSafely']();}async['addSelectionToChatContext'](){const _0x4c23ce=this['_aiEditing']['getSelectionText']();this['activeConversation']?.['addSelectionToContext'](_0x4c23ce),this['activeConversation']?.['addCurrentDocumentToContext']($n(this['context']['locale'],'AI_CHAT_CONTEXT_CURRENT_DOCUMENT'));}['removeSelectionFromChatContext'](){this['activeConversation']?.['removeSelectionFromContext']();}['focusPromptInput'](){this['_aiChatUi']['focusPromptInput']();}async['startConversation'](){await this['_startConversationSafely']();}async['sendMessage']({message:_0x34a531,quickActionData:_0x1b8126}){await this['_handleUIUserMessage']({'userMessage':_0x34a531,'quickActionData':_0x1b8126});}['getGroupId'](){const _0x27deb0=this['context']['config']['get']('collaboration.channelId');if(!_0x27deb0)throw new _0x58ed45('ai-chat-missing-channel-id',this);return _0x27deb0;}async['_startConversationSafely'](_0x3d89f9){try{this['_aiChatUi']['enableControls'](),await this['_handleStartConversation'](_0x3d89f9);}catch(_0x6e8f3d){nt('ai-chat-conversation-start-failed',_0x6e8f3d),this['activeConversation']=void 0x0,this['_aiChatUi']['disableControls']();}}async['_handleStartConversation'](_0x2190c7){const _0x177de7=this['context']['plugins']['get'](W);let _0x282806;_0x177de7['isOpen']&&_0x177de7['close'](),_0x282806=_0x2190c7||!this['activeConversation']?this['context']['config']['get']('ai.chat.models.defaultModelId'):this['activeConversation']['selectedModel']['id'],await this['_stopLastInteraction']();const _0x1c613a=this['getGroupId'](),_0x59d82c=_0x2190c7||_0x2ef42f();this['activeConversation']=new ct({'connector':this['_aiConnector'],'chatModels':this['_aiChatModels'],'defaultModelId':_0x282806,'conversationId':_0x59d82c,'group':_0x1c613a,'getEditor':()=>V(this['context'])}),this['activeConversation']['on']('conversationInitialized',(_0x153fba,_0x378012)=>{_0x378012['availableModels']=this['_filterModels'](_0x378012['availableModels'],this['context']['config']['get']('ai.chat.models.displayedModels')),this['_aiChatUi']['createConversation'](_0x378012),this['_aiChatUi']['resetMessageInput'](),this['_aiChatUi']['clearPendingContextUI'](),this['_aiChatUi']['clearConversationContextUI'](),_0x2190c7||(this['_aiChatUi']['resetConversationTitle'](),this['activeConversation']?.['addCurrentDocumentToContext']($n(this['context']['locale'],'AI_CHAT_CONTEXT_CURRENT_DOCUMENT')));}),this['activeConversation']['on']('uploadProgressChanged',(_0x3552b4,_0xdf3611)=>{this['_aiChatUi']['setIsUploadInProgress'](_0xdf3611['isUploadInProgress']);}),this['activeConversation']['on']('interactionCreated',(_0x3746c0,_0x3b3d49)=>{this['_aiChatUi']['addFeedItemUserMessage'](_0x3b3d49),this['_aiChatUi']['addFeedInteractionHeader'](_0x3b3d49);}),this['activeConversation']['on']('interactionStarted',(_0x17fb3e,_0x3472ef)=>{this['_aiChatUi']['startInteraction'](_0x3472ef);}),this['activeConversation']['on']('interactionFinished',async()=>{await this['_aiChatUi']['finishInteraction']();}),this['activeConversation']['on']('interactionDestroyed',(_0x28a579,_0x1d27fd)=>{this['_aiChatUi']['removeFeedInteraction'](_0x1d27fd['id']);}),this['activeConversation']['on']('setConversationTitle',(_0x4d6755,_0x154847,_0x3bf66d)=>{this['updateConversationTitle'](_0x154847,_0x3bf66d);}),this['activeConversation']['on']('replyCreated',(_0x23685f,_0x3a20e6)=>{this['_aiChatUi']['updateFeedInteractionHeader']({'isVisible':!0x0,'id':_0x3a20e6['interactionId']}),'text-delta'===_0x3a20e6['type']?this['_aiChatUi']['addFeedItemAIReply'](_0x3a20e6):this['_aiChatUi']['addFeedItemAISuggestion'](_0x3a20e6);}),this['activeConversation']['on']('replyContentUpdated',async(_0x2f9ed9,_0x2e239e,_0x124160)=>{await this['_updateReplyContent']({'reply':_0x2e239e,'changeGroups':_0x124160});}),this['activeConversation']['on']('replyChangeGroupStateUpdated',(_0x330ebc,{reply:_0x19ed57,index:_0x599bbf,state:_0x45a32a})=>{this['_aiChatUi']['updateFeedItemAIReplySuggestionPartState']({'id':_0x19ed57['id'],'index':_0x599bbf,'state':_0x45a32a});}),this['activeConversation']['on']('contextItemAdded',(_0x4c975c,_0x40083e)=>{if(this['_aiChatUi']['addContextItem'](_0x40083e['contextItem'],_0x40083e['isLoading']),'selection'===_0x40083e['contextItem']['type']){const _0x870cb=[...V(this['context'])['model']['document']['selection']['getRanges']()];this['_aiEditing']['showFakeVisualSelection'](_0x870cb,'ai-conversation-'+this['activeConversation']?.['id']);}}),this['activeConversation']['on']('contextItemRemoved',(_0xdc909a,_0x4a7c32)=>{this['_aiChatUi']['removeContextItem'](_0x4a7c32['uiId']),'current-document'==_0x4a7c32['uiId']&&this['removeSelectionFromChatContext'](),'selection'===_0x4a7c32['type']&&this['_aiEditing']['hideFakeVisualSelection']('ai-conversation-'+this['activeConversation']?.['id']);}),this['activeConversation']['on']('contextItemLoadingEnded',(_0x19190c,_0x1f3d38)=>{this['_aiChatUi']['setContextItemLoading'](_0x1f3d38['contextItem']['uiId'],_0x1f3d38['isLoading']);}),this['activeConversation']['on']('contextSent',(_0x24be06,_0x41e56e)=>{this['_aiChatUi']['setConversationContext'](_0x41e56e['contextItems']);}),this['activeConversation']['on']('addContextOptionsChanged',(_0x4e48a2,_0x15ba9e)=>{this['_aiChatUi']['setAddContextOptions'](_0x15ba9e['options']);}),this['activeConversation']['on']('sourceResourcesLoaded',(_0x5ebd4e,_0x52a9dc)=>{this['_aiChatUi']['populateSourceResourceBalloon'](_0x52a9dc['sourceId'],_0x52a9dc['source'],_0x52a9dc['resources'],_0x52a9dc['uid']);}),this['activeConversation']['on']('resourceStateChanged',(_0xfcc9b7,_0x35fc06)=>{this['_aiChatUi']['updateResourceState'](_0x35fc06['sourceId'],_0x35fc06['resourceId'],_0x35fc06['isInContext']);}),this['activeConversation']['on']('capabilitiesUpdated',(_0x12c566,_0x4fa038)=>{this['_aiChatUi']['updateCapabilities'](_0x4fa038);}),this['activeConversation']['on']('modelSelected',(_0xf8cbb0,_0xef132)=>{this['_aiChatUi']['setSelectedModel'](_0xef132['selectedModel'],_0xef132['isDisabled']);}),this['activeConversation']['on']('error',(_0x15c694,{error:_0x510c85,interactionId:_0x2b7cc2,fileName:_0xfb2c1b,url:_0x52ddf3,sourceId:_0x5ca251,sourceLabel:_0x3af0ba})=>{const _0x1aa9bc=_0x2b7cc2?_0x2b7cc2+':'+_0x2ef42f():_0x2ef42f();_0x510c85['message']['startsWith']('ai-request-aborted')?this['_aiChatUi']['addFeedItemStaticMessage']({'staticMessage':$n(this['context']['locale'],'AI_CHAT_ABORTED_MESSAGE'),'id':_0x1aa9bc}):_0x510c85['message']['startsWith']('ai-chat-conversation-init-failed')||_0x510c85['message']['startsWith']('ai-chat-conversation-start-failed')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':$n(this['context']['locale'],'AI_CHAT_UNABLE_TO_START_CONVERSATION'),'id':_0x1aa9bc}),this['_logError'](_0x510c85)):_0x510c85['message']['startsWith']('ai-chat-file-upload-failed')?this['_aiChatUi']['addFeedItemError']({'errorMessage':$n(this['context']['locale'],'AI_CHAT_CONTEXT_UNABLE_TO_UPLOAD_FILE',_0xfb2c1b),'id':_0x1aa9bc}):_0x510c85['message']['startsWith']('ai-chat-url-upload-failed')?this['_aiChatUi']['addFeedItemError']({'errorMessage':$n(this['context']['locale'],'AI_CHAT_CONTEXT_UNABLE_TO_UPLOAD_URL',_0x52ddf3),'id':_0x1aa9bc}):_0x510c85['message']['startsWith']('ai-chat-context-invalid-data')?this['_aiChatUi']['addFeedItemError']({'errorMessage':$n(this['context']['locale'],'AI_CHAT_CONTEXT_INVALID_DATA'),'id':_0x1aa9bc}):_0x510c85['message']['startsWith']('ai-chat-context-unsupported-type')?this['_aiChatUi']['addFeedItemError']({'errorMessage':$n(this['context']['locale'],'AI_CHAT_CONTEXT_UNSUPPORTED_TYPE'),'id':_0x1aa9bc}):_0x510c85['message']['startsWith']('ai-chat-source-resources-load-failed')?(_0x5ca251&&this['_aiChatUi']['closeSourceResourceBalloon'](_0x5ca251),this['_aiChatUi']['addFeedItemError']({'errorMessage':$n(this['context']['locale'],'AI_CHAT_CONTEXT_UNABLE_TO_LOAD_RESOURCES',_0x3af0ba||'source'),'id':_0x1aa9bc}),this['_logError'](_0x510c85)):_0x510c85['message']['startsWith']('ai-chat-resource-load-failed')?(this['_aiChatUi']['addFeedItemError']({'errorMessage':$n(this['context']['locale'],'AI_CHAT_RESOURCE_LOAD_FAILED'),'id':_0x1aa9bc}),this['_logError'](_0x510c85)):(this['_aiChatUi']['addFeedItemError']({'errorMessage':$n(this['context']['locale'],'AI_CHAT_GENERIC_ERROR'),'id':_0x1aa9bc}),this['_logError'](_0x510c85));}),await this['activeConversation']['init'](this['context']['config']['get']('ai.chat.context')),_0x2190c7||await this['activeConversation']['start']();}async['_handleUIUserMessage']({userMessage:_0x4b1108,quickActionData:_0x2f23df}){if(!this['activeConversation'])throw new _0x58ed45('ai-chat-controller-no-active-conversation');this['activeConversation']['isCurrentDocumentInContext']()&&await this['activeConversation']['updateCurrentDocumentInContext'](this['_aiEditing']['getDocumentData']()),this['activeConversation']['id']&&this['activeConversation']['isStarted']&&await this['activeConversation']['handleUserInteraction']({'userMessage':_0x4b1108,'quickActionData':_0x2f23df}),this['_removeAISelectionMarkers']();}['_removeAISelectionMarkers'](){const _0x1fb1a5=V(this['context'])['model'],_0x5e6c7c=Array['from'](_0x1fb1a5['markers']['getMarkersGroup'](dt));_0x1fb1a5['change'](_0x530c2b=>{_0x5e6c7c['forEach'](_0xdaaf5d=>_0x530c2b['removeMarker'](_0xdaaf5d));});}['_showConversationHistory'](){console['log']('Showing\x20conversation\x20history...');}['_setIsMaximized'](_0x5e2785){this['_aiChatUi']['setIsMaximized'](_0x5e2785);}['_logError'](_0x5c65c7){nt(_0x5c65c7['message']);}['_removeFromContext'](_0x47861f){this['activeConversation']?.['removeFromContext'](_0x47861f);}['_toggleWebSearch'](){this['activeConversation']?.['toggleWebSearch']();}['_toggleReasoning'](){this['activeConversation']?.['toggleReasoning']();}['getInteractionAndReplyById'](_0x25808e){const [_0x35fa29,_0x3cba6e]=_0x25808e['split'](':'),_0x1d4d43=this['activeConversation']['getInteraction'](_0x35fa29),_0x19f89a=_0x1d4d43['getReply'](_0x3cba6e);return{'interaction':_0x1d4d43,'reply':_0x19f89a};}['_scrollToSuggestionRange'](_0x4e1350,_0x1f1303=!0x1){const _0x49e4c3=V(this['context']),_0x2f2580={'target':_0x49e4c3['editing']['view']['domConverter']['viewRangeToDom'](_0x49e4c3['editing']['mapper']['toViewRange'](_0x4e1350)),'viewportOffset':{'top':0x96,'left':0x0,'bottom':0x32,'right':0x0},'ancestorOffset':0x14,'alignToTop':_0x1f1303};_0x1f1303&&(_0x2f2580['alignToTop']=!0x0),rt(_0x2f2580);}['updateConversationTitle'](_0x41f63a,_0x51a128=!0x1){this['_aiChatUi']['setConversationTitle'](_0x41f63a||$n(this['context']['locale'],'AI_CHAT_UNTITLED_CONVERSATION'),_0x51a128);}['_filterModels'](_0x595fc3,_0x4b9582){let _0x47dfc6;if(_0x4b9582){_0x47dfc6=[];const _0x3624b3='string'==typeof _0x4b9582?[_0x4b9582['toLocaleLowerCase']()]:_0x4b9582['map'](_0x35a7d6=>_0x35a7d6['toLocaleLowerCase']());for(const _0x72af6c of _0x3624b3)for(const _0x5ad1c9 of _0x595fc3)(_0x5ad1c9['id']['toLocaleLowerCase']()===_0x72af6c||_0x5ad1c9['name']['toLocaleLowerCase']()===_0x72af6c||_0x5ad1c9['provider']['toLocaleLowerCase']()===_0x72af6c||_0x5ad1c9['id']['toLocaleLowerCase']()['startsWith'](_0x72af6c))&&_0x47dfc6['push'](_0x5ad1c9);}else _0x47dfc6=_0x595fc3;return _0x47dfc6;}async['_updateReplyContent']({reply:_0x291ac1,changeGroups:_0x59c3fb,renderingStrategy:_0x226de9}){const {id:_0x827c70,isDone:_0x4d0561,type:_0x3c4b2c,parsedContent:_0x6eec1d}=_0x291ac1;if('modification-delta'===_0x3c4b2c){const _0x39654b=Y({'editor':V(this['context']),'showDiff':this['_aiChatUi']['showDiff'],'changeGroups':_0x59c3fb,'documentContextContent':_0x291ac1['documentContextContent']});await this['_aiChatUi']['updateFeedItemAIReplySuggestionContent']({'id':_0x827c70,'parts':_0x39654b,'renderingStrategy':_0x226de9,'isDone':_0x4d0561});}else'text-delta'===_0x3c4b2c&&await this['_aiChatUi']['updateFeedItemAIReplyContent']({'id':_0x827c70,'parsedContent':_0x6eec1d,'renderingStrategy':_0x226de9,'isDone':_0x4d0561});_0x4d0561&&_0x291ac1['sources']['length']>0x0&&this['_aiChatUi']['updateFeedItemAIReplySources'](_0x827c70,_0x291ac1['sources']);}async['_stopLastInteraction'](){const _0x5c7cf4=this['activeConversation']?.['lastInteraction'];_0x5c7cf4&&(_0x5c7cf4['stop'](),this['_aiChatUi']['stopInteraction'](_0x5c7cf4));}async['_flushLastInteractionUI'](){const _0x100894=this['activeConversation']?.['lastInteraction'];if(_0x100894){for await(const _0x313fe7 of _0x100894['replies'])await this['_updateReplyContent']({'reply':_0x313fe7,'changeGroups':_0x313fe7['changeGroups'],'renderingStrategy':'static'});}}}const Pt=[...Ee,'startConversation','resizeTabs','sendUserMessage','abortPromptStream','addDocumentToContext','addFileToContext','addUrlToContext','addResourceToContext','removeContextItem','loadSourceResources','toggleWebSearch','toggleReasoning','selectModel'];class nh extends _0x4118d8{['actionsDropdown'];['children'];['showChangeInTextModel'];['insertSuggestionModel'];constructor(_0x21b938){super(_0x21b938);const _0x1f19f5=this['bindTemplate'];this['set']('isEnabled',!0x0),this['set']('isVisible',!0x0),this['showChangeInTextModel']=new _0x18995b({'label':$n(_0x21b938,'AI_CHAT_SUGGESTION_ACTION_SHOW_CHANGE_IN_TEXT'),'icon':_0x309a77,'withText':!0x0,'type':'button','actionName':'showChangeInText'}),this['insertSuggestionModel']=new _0x18995b({'label':$n(_0x21b938,'AI_CHAT_SUGGESTION_ACTION_INSERT_SUGGESTION'),'icon':_0x250c16,'withText':!0x0,'type':'button','actionName':'insertSuggestion'}),this['actionsDropdown']=new zo(_0x21b938,{'listItemModels':[this['showChangeInTextModel'],this['insertSuggestionModel']]}),this['actionsDropdown']['on']('execute',()=>{this['fire']('applySuggestion');}),this['actionsDropdown']['on']('showChangeInText',()=>{this['fire']('showChangeInText');}),this['actionsDropdown']['on']('insertSuggestion',()=>{this['fire']('insertSuggestion');}),this['actionsDropdown']['set']({'label':'Apply','tooltip':$n(this['locale'],'AI_CHAT_SUGGESTION_ACTION_APPLY_TOOLTIP'),'withText':!0x0,'class':'ck-ai-chat__feed__ai-suggestion__actions','balloonPanelClass':'ck-ai-chat__feed__ai-suggestion__actions__balloon'}),this['actionsDropdown']['bind']('isEnabled')['to'](this),this['children']=this['createCollection']([this['actionsDropdown']]),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed__ai-suggestion__actions',_0x1f19f5['if']('isVisible','ck-hidden',_0x3b45f=>!_0x3b45f)]},'children':[this['actionsDropdown']]});}['updateLabels'](_0x104131){const _0x562153=this['locale'];this['actionsDropdown']['set']({'label':$n(_0x562153,'AI_CHAT_SUGGESTION_ACTION_APPLY_LABEL',_0x104131),'tooltip':$n(_0x562153,'AI_CHAT_SUGGESTION_ACTION_APPLY_TOOLTIP',_0x104131)}),this['showChangeInTextModel']['label']=$n(_0x562153,'AI_CHAT_SUGGESTION_ACTION_SHOW_CHANGE_IN_TEXT',_0x104131),this['insertSuggestionModel']['label']=$n(_0x562153,'AI_CHAT_SUGGESTION_ACTION_INSERT_SUGGESTION',_0x104131);}}class zo extends _0x49b785{['bodyCollection'];['balloonPanelView'];['listView'];['keystrokeHandler'];constructor(_0x4de240,_0x1f9821){super(_0x4de240),this['balloonPanelView']=new _0xef9d9e(this['locale']),this['bodyCollection']=new Wt(this['locale']),this['bodyCollection']['attachToDom'](),this['set']('balloonPanelClass',''),this['balloonPanelView']['bind']('class')['to'](this,'balloonPanelClass'),this['listView']=this['_setUpList'](_0x1f9821['listItemModels']),this['bodyCollection']['add'](this['balloonPanelView']),this['balloonPanelView']['content']['add'](this['listView']),this['arrowView']['unbind']('tooltip'),this['arrowView']['set']('tooltip',$n(this['locale'],'AI_CHAT_SUGGESTION_MORE_OPTIONS_TOOLTIP')),this['_setUpKeystrokes'](),this['on']('execute',()=>{this['balloonPanelView']['hide'](),this['arrowView']['focus']();}),this['on']('open',()=>{this['balloonPanelView']['isVisible']?(this['balloonPanelView']['hide'](),this['arrowView']['focus']()):(this['balloonPanelView']['pin']({'target':this['element'],'positions':['ltr'===this['locale']['uiLanguageDirection']?Jo:Qo]}),this['listView']['focus']());}),_0x28f439({'emitter':this['balloonPanelView'],'callback':()=>{this['balloonPanelView']['hide']();},'activator':()=>this['balloonPanelView']['isVisible'],'contextElements':()=>[this['element'],this['balloonPanelView']['element']]});}['_setUpList'](_0x31aae2){const _0x558b9e=this['locale'],_0x2cb150=new _0x1626c8(_0x558b9e);for(const _0x1fe7a3 of _0x31aae2){const _0xad19b1=new _0x470a68(_0x558b9e),_0x53c575=new _0xc86c(_0x558b9e);_0x53c575['bind'](...Object['keys'](_0x1fe7a3))['to'](_0x1fe7a3),_0x53c575['delegate']('execute')['to'](_0x2cb150),_0xad19b1['children']['add'](_0x53c575),_0x2cb150['items']['add'](_0xad19b1);}return _0x2cb150['items']['delegate']('execute')['to'](this),_0x2cb150['on']('execute',_0x50661e=>{const _0x5272ee=_0x50661e['source'];this['fire'](_0x5272ee['actionName']),this['balloonPanelView']['hide'](),this['arrowView']['focus']();}),_0x2cb150;}['_setUpKeystrokes'](){this['keystrokeHandler']=new _0x464bf0(),this['keystrokeHandler']['listenTo'](this['balloonPanelView']['element']),this['keystrokeHandler']['set']('esc',(_0xd0fc08,_0x3af1f2)=>{this['balloonPanelView']['hide'](),this['arrowView']['focus'](),_0x3af1f2();});}['destroy'](){super['destroy'](),this['keystrokeHandler']['destroy'](),this['balloonPanelView']['destroy'](),this['bodyCollection']['detachFromDom']();}}function Jo(_0x4a9b20){return{'top':_0x4a9b20['bottom'],'left':_0x4a9b20['left'],'name':'arrowless','config':{'withArrow':!0x1}};}function Qo(_0x16b3ca,_0x54680d){return{'top':_0x16b3ca['bottom'],'left':_0x16b3ca['left']-(_0x54680d['width']-_0x16b3ca['width']),'name':'arrowless','config':{'withArrow':!0x1}};}class Le extends Cr{['containerView'];['actionsView'];constructor(_0x5a83a0,_0x6494aa){super(_0x6494aa),this['containerView']=new F(_0x5a83a0,{'showDiff':_0x6494aa['showDiff'],'areActionsDisabled':_0x6494aa['areActionsDisabled']}),this['containerView']['on']('toggleSuggestionDisplayMode',(_0x221ba3,_0x278ccc)=>{this['fire']('toggleSuggestionDisplayMode',{'replyId':this['options']['id'],'showDiff':_0x278ccc['showDiff']});}),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',(_0x2005aa,{index:_0x170a56})=>{this['fire']('showChangeInText',{'replyId':this['options']['id'],'partIndex':_0x170a56});}),this['containerView']['on']('insertSuggestion',(_0x2c1bdd,{index:_0x401a25})=>{this['fire']('insertSuggestion',{'replyId':this['options']['id'],'partIndex':_0x401a25});}),this['containerView']['on']('rejectSuggestion',(_0x1d6850,{index:_0x1bfd4a})=>{this['fire']('rejectSuggestion',{'replyId':this['options']['id'],'partIndex':_0x1bfd4a});}),this['containerView']['on']('mouseOverSuggestion',(_0x1579a8,{index:_0x4c3dda})=>{this['fire']('mouseOverSuggestion',{'replyId':this['options']['id'],'partIndex':_0x4c3dda});}),this['containerView']['on']('mouseLeaveSuggestion',(_0x35951a,{index:_0x115f15})=>{this['fire']('mouseLeaveSuggestion',{'replyId':this['options']['id'],'partIndex':_0x115f15});}),this['actionsView']=new nh(_0x5a83a0),this['actionsView']['on']('showChangeInText',()=>{this['fire']('showChangeInText',{'replyId':this['options']['id']});}),this['actionsView']['on']('insertSuggestion',()=>{this['fire']('insertSuggestion',{'replyId':this['options']['id']});}),this['actionsView']['on']('applySuggestion',()=>{this['fire']('applySuggestion',{'replyId':this['options']['id']});}),_0x6494aa['areActionsDisabled']?this['actionsView']['isEnabled']=!0x1:this['actionsView']['bind']('isEnabled')['to'](this['containerView']['bodyView'],'hasPendingParts'),this['children']['addMany']([this['containerView'],this['actionsView']]),this['extendTemplate']({'attributes':{'class':['ck-ai-chat__feed__ai-suggestion']}});}async['updateContent'](_0x39df44){await this['containerView']['updateContent'](_0x39df44),this['actionsView']['updateLabels'](this['containerView']['bodyView']['partsCount']);}['updatePartState'](_0x337585,_0x2002aa){this['containerView']['bodyView']['updatePartState'](_0x337585,_0x2002aa);}['updateSources'](_0x2c0620){this['containerView']['updateSources'](_0x2c0620);}['getPartView'](_0x3f0a45){return this['containerView']['bodyView']['getPartView'](_0x3f0a45);}['markAsDone'](){super['markAsDone'](),this['containerView']['markAsDone'](),this['actionsView']['isVisible']=this['containerView']['bodyView']['hasNonEmptyParts'];}}class Me extends Cr{['replyContainer'];constructor(_0x1ceac7,_0x2a7ff2){super(_0x2a7ff2),this['locale']=_0x1ceac7,this['extendTemplate']({'attributes':{'class':['ck-ai-chat__feed__ai-reply']}}),this['replyContainer']=new _0x4118d8(),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':Ne(this['options']['initialContent']),'renderingStrategy':'static'}),this['markAsDone']());}async['updateContent']({parsedContent:_0x307085,renderingStrategy:_0x3aa4ea,abortSignal:_0x3ba98f}){'streaming'===_0x3aa4ea?await this['streamIntoElement'](_0x307085,this['replyContainer']['element'],_0x3ba98f):this['replyContainer']['element']['innerHTML']=_0x4e6e9a(_0x307085);}['updateSources'](_0x1f1dc5){const _0x3bdb89=new jr(this['locale']);_0x3bdb89['children']['addMany'](_0x1f1dc5['map'](_0xfaf21=>new Sr(this['locale'],_0xfaf21))),_0x3bdb89['isVisible']=!0x0,this['children']['add'](_0x3bdb89);}}const xn={'file':_0x14f1fb,'document':_0xe98777,'web-resource':_0x65f42,'text':_0x14f1fb,'selection':_0x2be13e},Jn='ck-ai-chat-context-chip',Zn='ck-ai-chat-context-chip_wide',Dr='ck-ai-chat-context-chip_document',Gr='ck-ai-chat-context-chip__label',Kr='ck-ai-chat-context-chip__type-icon',Wr='ck-ai-chat-context-controls__chip-tooltip',In='n';class mo extends _0x23128a{constructor(_0x2df06e,_0x89a41a,_0x3104c2,_0x22e0c7,_0x28d841=!0x1){super(_0x2df06e),this['_isAnimationOnEnterEnabled']=_0x22e0c7,this['_initializeProperties'](_0x89a41a,_0x3104c2,_0x28d841),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'](_0x3e81ea,_0x58645b,_0x4f00c2){this['set']('label',_0x3e81ea['label']),this['set']('tooltip',!0x0),this['set']('itemType',_0x3e81ea['type']),this['set']('id',_0x3e81ea['uiId']),this['set']('readonly',_0x58645b),this['set']('isLoading',_0x4f00c2);}['_setupTemplate'](){const _0x51acaf=this['_createIconView'](),_0x33b926=this['_createRemoveButton'](),_0x336465=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':this['_createTemplateAttributes'](_0x336465),'children':this['_createTemplateChildren'](_0x51acaf,_0x33b926,_0x336465)});}['_createTemplateAttributes'](_0xc2eeaa){return{'class':[Jn,_0xc2eeaa['if']('itemType',Dr,_0x52762b=>'document'==_0x52762b),_0xc2eeaa['if']('itemType',Zn,_0x2c5d39=>'selection'==_0x2c5d39)],'data-cke-tooltip-text':_0xc2eeaa['to']('label',On),'data-cke-tooltip-position':In,'data-cke-tooltip-class':Wr};}['_createTemplateChildren'](_0x380dfd,_0x8e4fd3,_0x2fc930){const _0x9f4e3=this['_createLabelElement'](_0x2fc930),_0x3f6ee6=this['_createLoaderIcon']();return this['readonly']?[_0x380dfd,_0x9f4e3]:[_0x380dfd,_0x3f6ee6,_0x9f4e3,_0x8e4fd3];}['_createLabelElement'](_0x576fa1){return{'tag':'span','attributes':{'class':Gr},'children':[{'text':_0x576fa1['to']('label')}]};}['_createRemoveButton'](){const _0x1e6ac5=new _0x23128a(this['locale']);return _0x1e6ac5['set']({'label':$n(this['locale'],'AI_CHAT_CONTEXT_REMOVE_FROM_CONTEXT'),'icon':_0x20d698}),this['_setupRemoveButtonEvent'](_0x1e6ac5),_0x1e6ac5;}['_setupRemoveButtonEvent'](_0x410200){_0x410200['on']('execute',()=>{this['fire']('removeContextItemChip',this['id']);});}['_createIconView'](){const _0x3611fb=this['bindTemplate'],_0x43edb3=new _0x2745c1();return _0x43edb3['content']=xn[this['itemType']],_0x43edb3['extendTemplate']({'attributes':{'class':[Kr,_0x3611fb['if']('isLoading','ck-hidden',_0x4e995b=>_0x4e995b)]}}),_0x43edb3;}['_handleAnimationEndOnce'](_0x4163cc,_0x295bbc){if(!_0x4163cc)return;const _0x5020e8=()=>{_0x295bbc(),_0x4163cc['removeEventListener']('animationend',_0x5020e8),_0x4163cc['removeEventListener']('webkitAnimationEnd',_0x5020e8);};_0x4163cc['addEventListener']('animationend',_0x5020e8),_0x4163cc['addEventListener']('webkitAnimationEnd',_0x5020e8);}['_createLoaderIcon'](){const _0x282c62=new Oe('small');return _0x282c62['bind']('isVisible')['to'](this,'isLoading',_0x505f8e=>_0x505f8e),_0x282c62;}}function On(_0x1a9531){if(!_0x1a9531)return _0x1a9531;if(_0x1a9531['length']<=0x78)return _0x1a9531;const _0x5ccf06=_0x1a9531['slice'](0x0,0x78),_0x15a71a=_0x5ccf06['lastIndexOf']('\x20');return(_0x15a71a>0x0?_0x5ccf06['slice'](0x0,_0x15a71a):_0x5ccf06)+'…';}const hn={'maxVisibleRows':0x2,'rowDetectionTolerance':0x5,'showMoreLabelPrefix':'+\x20','viewportOffset':{'top':0x64,'bottom':0xa}},un='300px';class po{['_locale'];['_config'];['_visibleChips'];['_overflowChips'];['_showMoreButtonView']=null;['_showMoreBalloonPanelView']=null;['_containerElement']=null;['_bodyCollection'];['_parentView']=null;['_intersectionObserver']=null;['_pendingCalculation']=!0x1;constructor(_0x36ed7d,_0x4e422d,_0x48a0d8,_0x5db174,_0x4c8a95){this['_locale']=_0x36ed7d,this['_visibleChips']=_0x4e422d,this['_config']={...hn,..._0x48a0d8,'cssClasses':{'controlsButton':'','calculationContainer':'ck-calculation-container',..._0x48a0d8['cssClasses']}},this['_overflowChips']=new _0x12a2d7(),this['_bodyCollection']=_0x5db174,this['_parentView']=_0x4c8a95||null;}['setContainerElement'](_0x58045e){this['_intersectionObserver']&&(this['_intersectionObserver']['disconnect'](),this['_intersectionObserver']=null),this['_containerElement']=_0x58045e,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 _0x2a3321=[...this['_visibleChips'],...this['_overflowChips']],_0x246b8a=this['_createCalculationContainer'](),_0x571d5a=this['_calculateOverflowInContainer'](_0x246b8a,_0x2a3321),_0x32b984=_0x246b8a['_ancestorsToRestore'];_0x32b984&&this['_restoreAncestorVisibility'](_0x32b984),_0x246b8a['remove'](),this['_applyOverflowResults'](_0x2a3321,_0x571d5a);}['_createShowMoreButton'](){this['_showMoreButtonView']=this['_createShowMoreButtonView'](),this['_showMoreBalloonPanelView']=this['_createShowMoreBalloonPanelView'](),this['_showMoreButtonView']['render'](),this['_containerElement']['appendChild'](this['_showMoreButtonView']['element']),this['_showMoreButtonView']['on']('execute',()=>{this['_handleShowMoreButtonClick']();}),_0x28f439({'emitter':this['_showMoreBalloonPanelView'],'contextElements':[this['_showMoreBalloonPanelView']['element'],this['_showMoreButtonView']['element']],'callback':()=>this['hideBalloonPanel'](),'activator':()=>this['_showMoreButtonView']['isOn']});}['_createShowMoreButtonView'](){const _0x4b3072=new _0x23128a(this['_locale']);_0x4b3072['set']({'label':'','withText':!0x0,'isToggleable':!0x0});const _0x440e21=[this['_config']['cssClasses']['showMoreButton']];return this['_config']['cssClasses']['controlsButton']&&_0x440e21['push'](this['_config']['cssClasses']['controlsButton']),_0x4b3072['extendTemplate']({'attributes':{'class':_0x440e21}}),_0x4b3072;}['_createShowMoreBalloonPanelView'](){const _0x119cd3=new _0xef9d9e(this['_locale']);return _0x119cd3['extendTemplate']({'attributes':{'class':this['_config']['cssClasses']['showMoreBalloon']}}),this['_bodyCollection']['add'](_0x119cd3),_0x119cd3;}['_updateBalloonContent'](){if(this['_showMoreBalloonPanelView']&&(this['_showMoreBalloonPanelView']['content']['clear'](),this['_overflowChips']['length']>0x0)){this['_overflowChips']['forEach'](_0xb75680=>{_0xb75680['disableAnimationOnEnter']();});const _0x564856=new _0x4118d8(this['_locale']);_0x564856['setTemplate']({'tag':'div','attributes':{'class':this['_config']['cssClasses']['overflowContainer']},'children':this['_overflowChips']}),this['_showMoreBalloonPanelView']['content']['add'](_0x564856);}}['_handleShowMoreButtonClick'](){this['_showMoreButtonView']['isOn']?this['hideBalloonPanel']():this['showBalloonPanel']();}['_updateShowMoreButtonVisibility'](){const _0x1f70ca=this['_overflowChips']['length']>0x0;this['_showMoreButtonView']?.['element']&&(this['_showMoreButtonView']['element']['style']['display']=_0x1f70ca?'':'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'](_0x537118){const _0x29e5b2=this['_containerElement']?.['tagName']['toLowerCase']()||'div',_0x5a29a3=this['_containerElement']?.['classList'];if(_0x5a29a3){const _0x15938d=_0x5a29a3[0x0]||'',_0x68d583=_0x537118['querySelector']('.'+_0x15938d),_0xd86b84=_0x537118['querySelector'](_0x29e5b2);return _0x68d583||_0xd86b84||_0x537118;}return _0x537118['querySelector'](_0x29e5b2)||_0x537118;}['_calculateContainerWidth'](){const _0x12df19=this['_parentView']?.['element']||this['_containerElement'];if(!_0x12df19)return un;const _0x3488e8=window['getComputedStyle'](_0x12df19)['width'];if('auto'===_0x3488e8||'0px'===_0x3488e8||!_0x3488e8){const _0x2ef6e1=_0x12df19['parentElement'];if(_0x2ef6e1){const _0x29a1d8=window['getComputedStyle'](_0x2ef6e1);return'auto'!==_0x29a1d8['width']?_0x29a1d8['width']:un;}return un;}return _0x3488e8;}['_applyCalculationStyles'](_0x2916c6,_0x497b3a){this['_config']['cssClasses']['calculationContainer']&&_0x2916c6['classList']['add'](this['_config']['cssClasses']['calculationContainer']),_0x2916c6['style']['width']=_0x497b3a,_0x2916c6['style']['position']='absolute',_0x2916c6['style']['top']='-9999px',_0x2916c6['style']['left']='-9999px',_0x2916c6['style']['opacity']='0',_0x2916c6['style']['pointerEvents']='none',_0x2916c6['style']['zIndex']='-1',_0x2916c6['style']['visibility']='visible\x20!important',_0x2916c6['style']['display']='block\x20!important',_0x2916c6['style']['boxSizing']='border-box';}['_restoreAncestorVisibility'](_0x5bf338){_0x5bf338['forEach'](({element:_0x30e407,originalDisplay:_0x5a0c2f,originalVisibility:_0x16700c})=>{_0x30e407['style']['display']=_0x5a0c2f,_0x30e407['style']['visibility']=_0x16700c;});}['_makeAncestorsVisible'](_0x582f74){const _0x2e953f=[];let _0x3c4e0a=_0x582f74;for(;_0x3c4e0a&&_0x3c4e0a!==document['body'];){const _0x821dc8=window['getComputedStyle'](_0x3c4e0a);'none'!==_0x821dc8['display']&&'hidden'!==_0x821dc8['visibility']||(_0x2e953f['push']({'element':_0x3c4e0a,'originalDisplay':_0x3c4e0a['style']['display'],'originalVisibility':_0x3c4e0a['style']['visibility']}),_0x3c4e0a['style']['display']='block',_0x3c4e0a['style']['visibility']='visible'),_0x3c4e0a=_0x3c4e0a['parentElement'];}return _0x2e953f;}['_createContainerElements'](){let _0x119f93,_0x3f6a4f;return this['_parentView']?.['element']?(_0x119f93=this['_parentView']['element']['cloneNode'](!0x0),_0x3f6a4f=this['_findTargetContainer'](_0x119f93)):(_0x119f93=document['createElement']('div'),_0x3f6a4f=_0x119f93),{'calculationContainer':_0x119f93,'targetContainer':_0x3f6a4f};}['_createCalculationContainer'](){const {calculationContainer:_0x4a4129,targetContainer:_0x14f0c2}=this['_createContainerElements'](),_0x2ba0b9=this['_calculateContainerWidth']();this['_applyCalculationStyles'](_0x4a4129,_0x2ba0b9);const _0x2e055c=this['_parentView']?.['element']||this['_containerElement'],_0x2e32cb=_0x2e055c?.['parentElement'];_0x2e32cb?_0x2e32cb['appendChild'](_0x4a4129):document['body']['appendChild'](_0x4a4129),_0x4a4129['_targetContainer']=_0x14f0c2;const _0x4328d7=this['_makeAncestorsVisible'](_0x2e32cb||null);return _0x4a4129['offsetWidth'],_0x4a4129['_ancestorsToRestore']=_0x4328d7,_0x4a4129;}['_calculateOverflowInContainer'](_0x5db466,_0x5c9e91){const _0x3b3a95=_0x5db466['_targetContainer']||_0x5db466,_0x459d2f=[],{rowCount:_0x571549}=this['_renderChipsAndCountRows'](_0x3b3a95,_0x5c9e91);if(_0x571549<=this['_config']['maxVisibleRows'])return _0x459d2f;const _0x432e65=_0x5c9e91['slice']();for(;_0x432e65['length']>0x0;){if(this['_testButtonFit'](_0x5db466,_0x3b3a95,_0x432e65)){const _0x3a2028=_0x5c9e91['filter'](_0x28a88a=>!_0x432e65['includes'](_0x28a88a));_0x459d2f['push'](..._0x3a2028);break;}if(!_0x432e65['pop']())break;}return _0x459d2f;}['_renderChipsAndCountRows'](_0xdc0e4d,_0x1c098d){_0xdc0e4d['innerHTML']='',_0x1c098d['forEach'](_0x2800d2=>{if(_0x2800d2['element']){const _0x326ea0=_0x2800d2['element']['cloneNode'](!0x0);_0xdc0e4d['appendChild'](_0x326ea0);}}),_0xdc0e4d['offsetWidth'];const _0x27bfde=_0xdc0e4d['children'],_0x4177a8=[];return Array['from'](_0x27bfde)['forEach'](_0x5714e3=>{const _0x3b9426=_0x5714e3['getBoundingClientRect']()['top'];_0x4177a8['some'](_0x208286=>Math['abs'](_0x208286-_0x3b9426)<this['_config']['rowDetectionTolerance'])||_0x4177a8['push'](_0x3b9426);}),{'rowCount':_0x4177a8['length']};}['_createMockButton'](){const _0x303c22=document['createElement']('button');return _0x303c22['className']=this['_config']['cssClasses']['showMoreButton'],this['_config']['cssClasses']['controlsButton']&&_0x303c22['classList']['add'](this['_config']['cssClasses']['controlsButton']),_0x303c22['textContent']='+\x201',_0x303c22;}['_testButtonFit'](_0x195083,_0x34e63c,_0x4656c9){this['_renderChipsAndCountRows'](_0x34e63c,_0x4656c9);const _0x5126f3=this['_createMockButton']();_0x195083['appendChild'](_0x5126f3),_0x195083['offsetWidth'];const _0x3fc323=[..._0x34e63c['children'],_0x5126f3],_0xb5f837=[];_0x3fc323['forEach'](_0x29014e=>{const _0x322eca=_0x29014e['getBoundingClientRect']()['top'];_0xb5f837['some'](_0x1b26d7=>Math['abs'](_0x1b26d7-_0x322eca)<this['_config']['rowDetectionTolerance'])||_0xb5f837['push'](_0x322eca);});const _0x3a0f80=_0xb5f837['length'];return _0x5126f3['remove'](),_0x3a0f80<=this['_config']['maxVisibleRows'];}['_distributeChips'](_0x336caf,_0x2eff55){this['_visibleChips']['clear'](),this['_overflowChips']['clear'](),_0x336caf['forEach'](_0x4dcdc0=>{_0x2eff55['includes'](_0x4dcdc0)?this['_overflowChips']['add'](_0x4dcdc0):this['_visibleChips']['add'](_0x4dcdc0);});}['_updateOverflowUI'](_0x4cb1dd){if(_0x4cb1dd>0x0&&!this['_showMoreButtonView']&&this['_createShowMoreButton'](),_0x4cb1dd>0x0&&this['_showMoreButtonView']){const _0x16f933=''+this['_config']['showMoreLabelPrefix']+(_0x4cb1dd<0x63?_0x4cb1dd:'99');this['_showMoreButtonView']['label']=_0x16f933;}this['_updateBalloonContent'](),this['_updateShowMoreButtonVisibility'](),this['_repinBalloonPanel']();}['_applyOverflowResults'](_0xde37dd,_0x5b32d4){this['_distributeChips'](_0xde37dd,_0x5b32d4),this['_updateOverflowUI'](_0x5b32d4['length']);}['_setupVisibilityObserver'](){this['_containerElement']&&'undefined'!=typeof IntersectionObserver&&(this['_intersectionObserver']=new IntersectionObserver(_0x1abffe=>{_0x1abffe[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 _0x3ab510=this['_containerElement']['getBoundingClientRect']();if(0x0===_0x3ab510['width']||0x0===_0x3ab510['height'])return!0x1;const _0x199679=window['innerHeight']||document['documentElement']['clientHeight'],_0xd609ef=window['innerWidth']||document['documentElement']['clientWidth'],_0x1e1ac8=0xc8;return _0x3ab510['bottom']>=-0xc8&&_0x3ab510['top']<=_0x199679+_0x1e1ac8&&_0x3ab510['right']>=-0xc8&&_0x3ab510['left']<=_0xd609ef+_0x1e1ac8;}}const Yr='ck-ai-chat__feed__context-chips',$r='ck-ai-chat-context-chips-wrapper',Qr='ck-ai-chat-context-chips-wrapper-balloon',Xr='ck-ai-chat-controls-button',Jr='ck-ai-chat-controls_context_show-more-button',Zr='ck-ai-chat-context-controls__show-more-balloon-panel';class ah extends _0x4118d8{['_contextChips']=this['createCollection']();['_overflowManager'];['_bodyCollection'];constructor(_0x573c8d,_0x2d9ad1,_0x36b9b4){super(_0x573c8d),this['_bodyCollection']=_0x36b9b4,this['_createContextChips'](_0x2d9ad1);const _0x7b3f82={'cssClasses':{'showMoreButton':Jr,'showMoreBalloon':Zr,'overflowContainer':Qr,'controlsButton':Xr}};this['_overflowManager']=new po(_0x573c8d,this['_contextChips'],_0x7b3f82,this['_bodyCollection'],this),this['setTemplate']({'tag':'div','attributes':{'class':[Yr,'ck','ck-reset_all']},'children':[{'tag':'div','attributes':{'class':$r},'children':this['_contextChips']}]});}['render'](){super['render']();const _0x585914=this['element']['querySelector']('.'+$r);_0x585914&&(this['_overflowManager']['setContainerElement'](_0x585914),this['_overflowManager']['reorganizeChips']());}['destroy'](){super['destroy'](),this['_overflowManager']['destroy']();}['_createContextChips'](_0x533f8a){for(const _0x3ee7cd of _0x533f8a){const _0x4bf52a=new mo(this['locale'],_0x3ee7cd,!0x0,!0x1);this['_contextChips']['add'](_0x4bf52a);}}}class Te extends Cr{['_contextChipsView']=null;['_locale'];['_bodyCollection'];['_messageContentView'];constructor(_0x55bc0b,_0x456b30,_0x1bf73b){super(_0x456b30),this['_locale']=_0x55bc0b,this['_bodyCollection']=_0x1bf73b,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 ah(this['_locale'],this['options']['contextItems']['filter'](_0x5841df=>!_0x5841df['hidden']),this['_bodyCollection']),this['_contextChipsView']['extendTemplate']({'attributes':{'class':'ck-ai-chat__feed__context-chips'}}),this['children']['add'](this['_contextChipsView']));}['_createMessageContentView'](){this['_messageContentView']=new _0x4118d8(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 Rt extends Cr{constructor(_0x5a2c73,_0x429e84){super(_0x429e84);const {isWebSearchEnabled:_0x48b283,isReasoningEnabled:_0x236855}=_0x429e84['capabilities'],_0x378ecd=[];let _0x598c37='';_0x48b283&&_0x236855?(_0x598c37=$n(_0x5a2c73,'AI_CHAT_FEED_REPLY_ITEM_USED_WEB_SEARCH_REASONING'),_0x378ecd['push'](e_(_0xdddffb)),_0x378ecd['push'](e_(_0x1014d8))):_0x48b283?(_0x598c37=$n(_0x5a2c73,'AI_CHAT_FEED_REPLY_ITEM_USED_WEB_SEARCH'),_0x378ecd['push'](e_(_0xdddffb))):_0x236855&&(_0x598c37=$n(_0x5a2c73,'AI_CHAT_FEED_REPLY_ITEM_USED_REASONING'),_0x378ecd['push'](e_(_0x1014d8))),this['extendTemplate']({'attributes':{'class':['ck-ai-chat__feed__interaction-header',_0x598c37?'':'ck-hidden']}});const _0x9b5167=new _0x4118d8();_0x9b5167['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed__interaction-header__capabilities']},'children':[..._0x378ecd,{'tag':'span','attributes':{'class':['ck-ai-chat__feed__interaction-header__capabilities__text']},'children':[_0x598c37]}]}),this['children']['add'](_0x9b5167);}}function e_(_0x16ba8b){const _0x4fcb43=new _0x2745c1();return _0x4fcb43['content']=_0x16ba8b,_0x4fcb43;}const ps=['wheel','touchstart','pointerdown','keydown'],ws=['ArrowUp','ArrowDown','PageUp','PageDown','Home','End','\x20'];class Fe{['element'];['animationFrameId'];['isRunning'];['abortController'];['isUserPaused'];constructor(_0x389333){this['element']=_0x389333,this['animationFrameId']=null,this['isRunning']=!0x1,this['abortController']=new AbortController(),this['isUserPaused']=!0x1;for(const _0x310d60 of ps){const _0x5314dd='keydown'!==_0x310d60;this['element']['addEventListener'](_0x310d60,this['_onUserEvent']['bind'](this),{'passive':_0x5314dd,'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'](_0x5899c1){if(this['isRunning']){if('keydown'===_0x5899c1['type']){const _0x30aab1=_0x5899c1['key'];if(!ws['includes'](_0x30aab1))return;}_0x5899c1 instanceof WheelEvent?_0x5899c1['deltaY']<0x0?this['isUserPaused']=!0x0:this['isUserPaused']=!this['_isAtBottom']():this['isUserPaused']=!0x0;}}['_isAtBottom'](){const {scrollTop:_0x3faa2a,scrollHeight:_0xc1db5,clientHeight:_0x4e4d87}=this['element'];return _0xc1db5-_0x3faa2a-_0x4e4d87<=0x5;}['_rafUpdate'](){this['isRunning']&&(this['isUserPaused']||this['element']['scrollTo']({'top':this['element']['scrollHeight'],'behavior':'auto'}),this['animationFrameId']=requestAnimationFrame(this['_rafUpdate']['bind'](this)));}}class Be extends _0x4118d8{constructor(_0x4453e3,_0x219028){super(_0x4453e3),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-skeleton']},'children':this['_createSkeletonItems'](_0x219028)});}['_createSkeletonItems'](_0x4a93a4){const _0x3ce2b7=['ck','ck-ai-skeleton__item'];return _0x4a93a4['map'](_0xa1ef36=>{let _0xcd7b0e='';switch(_0xa1ef36['attributes']['align']){case'right':_0xcd7b0e='margin-left:\x20auto;\x20margin-right:\x200;\x20text-align:\x20right;';break;case'center':_0xcd7b0e='margin-left:\x20auto;\x20margin-right:\x20auto;\x20text-align:\x20center;';break;case'left':_0xcd7b0e='margin-left:\x200;\x20margin-right:\x20auto;\x20text-align:\x20left;';}return{'tag':_0xa1ef36['tag'],'attributes':{'class':[..._0x3ce2b7,_0xa1ef36['attributes']['class']?_0xa1ef36['attributes']['class']:''],'style':'width:\x20'+_0xa1ef36['attributes']['width']+';\x20height:\x20'+_0xa1ef36['attributes']['height']+';'+_0xcd7b0e}};});}}const De={'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':$i(0x5,'100%','44px','right'),'aiChatResources':$i(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 $i(_0x304ffd,_0x55d89c,_0x1055d6,_0x3cd287){return new Array(_0x304ffd)['fill'](null)['map'](()=>({'tag':'div','attributes':{'width':_0x55d89c,'height':_0x1055d6,'align':_0x3cd287}}));}class pi extends _0x4118d8{['children'];['scrollManager'];['_bodyCollection'];constructor(_0x5012ba,_0x47434b){super(_0x5012ba),this['_bodyCollection']=_0x47434b,this['set']('isPending',!0x1),this['set']('loadingMessage',''),this['set']('isLoadingSkeletonVisible',!0x1),this['children']=this['createCollection'](),this['children']['delegate'](...Pt)['to'](this),this['_setupTemplate']();}['render'](){super['render'](),this['scrollManager']=new Fe(this['element']);}['destroy'](){super['destroy'](),this['scrollManager']['destroy']();}['clear'](){this['children']['clear']();}['addItem'](_0x585917,_0x24588f){let _0x2965c4;_0x2965c4='ai-reply'===_0x585917?new Me(this['locale'],_0x24588f):'ai-suggestion-reply'===_0x585917?new Le(this['locale'],_0x24588f):'user-message'===_0x585917?new Te(this['locale'],_0x24588f,this['_bodyCollection']):'interaction-header'===_0x585917?new Rt(this['locale'],_0x24588f):new Ae(_0x24588f),this['children']['add'](_0x2965c4);}async['updateReplyItem']({id:_0x58f841,parsedContent:_0x51105d,renderingStrategy:_0x1380f1,abortSignal:_0x23eff9}){const _0x3882a3=this['getItemById'](_0x58f841);if(!(_0x3882a3 instanceof Me))throw new _0x58ed45('ai-chat-feed-view-item-not-a-reply-item',null,{'itemView':_0x3882a3,'id':_0x58f841,'parsedContent':_0x51105d});await _0x3882a3['updateContent']({'parsedContent':_0x51105d,'renderingStrategy':_0x1380f1,'abortSignal':_0x23eff9});}async['updateWebSources'](_0x418f85,_0x5015bf){const _0x4546f8=this['getItemById'](_0x418f85);if(_0x4546f8 instanceof Le)_0x4546f8['updateSources'](_0x5015bf);else{if(!(_0x4546f8 instanceof Me))throw new _0x58ed45('ai-chat-feed-view-item-not-a-suggestion-or-reply-item',null,{'itemView':_0x4546f8,'id':_0x418f85,'sources':_0x5015bf});_0x4546f8['updateSources'](_0x5015bf);}}async['updateSuggestionItem']({id:_0x33767c,parts:_0x52ab34,renderingStrategy:_0x5557b0,abortSignal:_0x5335b7}){const _0x513e6d=this['getItemById'](_0x33767c);if(!(_0x513e6d instanceof Le))throw new _0x58ed45('ai-chat-feed-view-item-not-a-suggestion-item',null,{'itemView':_0x513e6d,'id':_0x33767c,'parts':_0x52ab34});await _0x513e6d['updateContent']({'parts':_0x52ab34,'renderingStrategy':_0x5557b0,'abortSignal':_0x5335b7});}['updateSuggestionPartState']({id:_0x24a226,index:_0x41ea07,state:_0x4a765b}){const _0x15a341=this['getItemById'](_0x24a226);if(!(_0x15a341 instanceof Le))throw new _0x58ed45('ai-chat-feed-view-item-not-a-suggestion-item',this,{'id':_0x24a226});_0x15a341['updatePartState'](_0x41ea07,_0x4a765b);}['markItemAsDone'](_0x460466){this['getItemById'](_0x460466)['markAsDone']();}['getItemIds'](){return this['children']['map'](_0x5721e0=>_0x5721e0['options']['id']);}['removeItem'](_0x185aff){this['children']['remove'](this['getItemById'](_0x185aff));}['scrollToSuggestion'](_0x148f98,_0x46bff6){const _0x5c1263=this['getItemById'](_0x148f98);if(!(_0x5c1263 instanceof Le))return void _0x2f4ad6('ck-ai-chat-feed-view-scroll-to-suggestion-invalid-item',{'replyId':_0x148f98,'partIndex':_0x46bff6});const _0x5a5e84=_0x5c1263['getPartView'](_0x46bff6);_0x5a5e84?rt({'target':_0x5a5e84['element'],'ancestorOffset':0x14,'alignToTop':!0x0,'forceScroll':!0x0}):_0x2f4ad6('ck-ai-chat-feed-view-scroll-to-suggestion-part-view-not-found',{'replyId':_0x148f98,'partIndex':_0x46bff6});}['_setupTemplate'](){this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed']},'children':this['_createTemplateChildren']()});}['_createTemplateChildren'](){const _0x4374b4=this['_createSkeletonLoader']();return[this['_createFeedItems'](),_0x4374b4,this['_createFeedLoader']()];}['_createSkeletonLoader'](){const _0x484542=new Be(this['locale'],De['aiFeed']);return _0x484542['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isLoadingSkeletonVisible','ck-hidden',_0x2f2f61=>!_0x2f2f61)]}}),_0x484542;}['_createFeedItems'](){const _0x41c739=new _0x4118d8(this['locale']);return _0x41c739['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__feed__items',this['bindTemplate']['if']('isLoadingSkeletonVisible','ck-hidden')]},'children':this['children']}),_0x41c739;}['_createFeedLoader'](){const _0x2b3aa9=new _0x4118d8(this['locale']);return _0x2b3aa9['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat__loader',this['bindTemplate']['if']('isPending','ck-hidden',_0x44768f=>!_0x44768f)]},'children':this['_createLoaderChildren']()}),_0x2b3aa9;}['_createLoaderChildren'](){const _0x4188c3=new Oe();return _0x4188c3['isVisible']=!0x0,[_0x4188c3,{'tag':'span','attributes':{'class':['ck','ck-ai-chat__loader-text']},'children':[{'text':this['bindTemplate']['to']('loadingMessage')}]}];}['getItemById'](_0x1e5668){const _0x15b35c=this['children']['find'](_0x4ac3e5=>_0x4ac3e5['options']['id']['includes'](_0x1e5668));if(!_0x15b35c)throw new _0x58ed45('ai-chat-feed-view-item-not-found',this,{'id':_0x1e5668});return _0x15b35c;}['setLoadingMessage'](_0x6f2d63){this['set']('loadingMessage',_0x6f2d63);}['toggleLoadingSkeleton'](_0x397476){this['set']('isLoadingSkeletonVisible',_0x397476);}['startAutoScroll'](){this['scrollManager']['start']();}['stopAutoScroll'](){this['scrollManager']['stop']();}}class Ir extends _0x1626c8{['filter'](){let _0x5f8b75=0x0;for(const _0x2cfb8d of this['items'])_0x5f8b75+=_0x2cfb8d['items']['length'];return{'resultsCount':_0x5f8b75,'totalItemsCount':_0x5f8b75};}}class ve extends _0x590135{['submitButtonView'];static ['MIN_ROWS']=0x1;static ['MAX_ROWS']=0xc;['_addContextButtonView'];['_queryViewResizeObserver'];constructor(_0x38228a,_0x5be83f){super(_0x38228a,{'queryView':{'label':'','creator':_0x247c44,'showIcon':!0x1,'showResetButton':!0x1},'filteredView':new Ir(_0x38228a),'queryMinChars':0x1/0x0,'resetOnBlur':!0x1}),this['set']('isEmpty',!0x0),this['set']('isUploadInProgress',!0x1),this['_addContextButtonView']=_0x5be83f,this['_queryViewResizeObserver']=null,this['queryView']['fieldView']['minRows']=ve['MIN_ROWS'],this['queryView']['fieldView']['maxRows']=ve['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',(_0x2ee890,_0xf782a5)=>!_0x2ee890&&!_0xf782a5),this['focusableChildren']['add'](this['submitButtonView']);}['render'](){super['render'](),this['queryView']['fieldWrapperChildren']['add'](this['submitButtonView']),this['keystrokes']['set']('enter',(_0x2aeb80,_0x37a9ce)=>{this['isUploadInProgress']||this['isEmpty']||_0x2aeb80['target']==this['queryView']['fieldView']['element']&&(this['submit'](),_0x37a9ce());}),this['queryView']['fieldView']['on']('update',()=>{this['isEmpty']=''===this['queryView']['fieldView']['element']['value']?.['trim']();});}['destroy'](){super['destroy'](),this['_queryViewResizeObserver']&&this['_queryViewResizeObserver']['destroy']();}['submit'](){const _0x512c25=this['queryView']['fieldView']['element']['value']?.['trim']();if(!_0x512c25)return this['queryView']['errorText']=$n(this['locale'],'AI_CHAT_PROMPT_EMPTY_ERROR'),void(this['queryView']['fieldView']['hasError']=!0x0);this['queryView']['fieldView']['hasError']=!0x1;const _0xaaac10=_0x397c0d(_0x512c25);this['fire']('sendUserMessage',_0xaaac10),this['queryView']['fieldView']['reset']();}['setPlaceholderText'](_0x2dfeb0){this['queryView']['fieldView']['set']('placeholder',_0x2dfeb0);}['_createSubmitButton'](){const _0x189ee8=new _0x23128a(this['locale']);return _0x189ee8['set']({'icon':_0x42e7a3,'label':$n(this['locale'],'AI_CHAT_LABEL_SUBMIT'),'isVisible':!0x0,'tooltip':!0x0,'class':'ck-ai-chat__prompt-submit-button','isEnabled':!0x1}),_0x189ee8['on']('execute',()=>{this['submit']();}),_0x189ee8;}['setIsUploadInProgress'](_0xe9de23){this['isUploadInProgress']=_0xe9de23;}['_setUpAddContextButtonPositioning'](){const _0x27bc91=this['locale'],_0xf61bbf=()=>{_0x51d4c0['window']['requestAnimationFrame'](()=>{if(_0x51c3da(this['element'])){const _0x4f473=new _0x33ad0b(this['queryView']['fieldView']['element']),_0x39ecfa=new _0x33ad0b(this['_addContextButtonView']['element']),_0x3f6805=_0x4f473['width'],_0x1fa81a='rtl'===_0x27bc91['uiLanguageDirection']?'right':'left';_0x4f473['excludeScrollbarsAndBorders']();const _0x495a2a=_0x3f6805-_0x4f473['width']+0x1;this['_addContextButtonView']['element']['style'][_0x1fa81a]='calc('+(_0x3f6805-_0x39ecfa['width']-_0x495a2a)+'px\x20-\x20var(--ck-spacing-tiny))';}});};this['queryView']['fieldView']['on']('update',_0xf61bbf),this['on']('render',()=>{_0xf61bbf(),this['_queryViewResizeObserver']=new _0xf70da3(this['queryView']['fieldView']['element'],()=>{_0xf61bbf();});});}}const ea='ck-ai-chat__prompt-capabilities',ia='ck-ai-chat-controls-button',sa='ck-ai-chat-controls-button--commands',na='ck-ai-chat-controls__model-selection',ra='ck-ai-chat-controls__model-selection__item-name',oa='ck-ai-chat-controls__model-selection__item-description',aa='ck-ai-chat-controls__model-selection__item-capabilities',ha='n';class _e extends _0x4118d8{['_webSearchButton'];['_reasoningButton'];['_commandsButton'];['_modelSelectionDropdown'];['_modelSelectionDropdownItems'];['_modelNameView'];constructor(_0x5a4a21){super(_0x5a4a21),this['set']('webSearchActive',!0x1),this['set']('reasoningActive',!0x1),this['set']('modelSelectorVisible',!0x0),this['set']('modelSelectorEnabled',!0x0),this['set']('activeModelId',''),this['set']('activeModelName',''),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,'modelSelectorVisible',_0x38effc=>_0x38effc),this['_modelSelectionDropdown']['buttonView']['bind']('tooltip')['to'](this,'modelSelectorEnabled',_0x549860=>_0x549860?this['_modelSelectionDropdown']['buttonView']['label']:$n(this['locale'],'AI_CHAT_MODEL_SELECTOR_DISABLED_TOOLTIP')),this['_modelSelectionDropdown']['bind']('isEnabled')['to'](this,'modelSelectorEnabled',_0x2f0485=>_0x2f0485),this['_webSearchButton']['bind']('isOn')['to'](this,'webSearchActive',_0x1b834f=>_0x1b834f),this['_webSearchButton']['bind']('withText')['to'](this,'modelSelectorVisible',_0x1fe402=>!_0x1fe402),this['_webSearchButton']['bind']('tooltip')['to'](this,'webSearchActive',_0x300302=>$n(this['locale'],_0x300302?'AI_CHAT_DISABLE_WEB_SEARCH':'AI_CHAT_ENABLE_WEB_SEARCH')),this['_reasoningButton']['bind']('isOn')['to'](this,'reasoningActive',_0x327251=>_0x327251),this['_reasoningButton']['bind']('withText')['to'](this,'modelSelectorVisible',_0x546a10=>!_0x546a10),this['_reasoningButton']['bind']('tooltip')['to'](this,'reasoningActive',_0x5c1712=>$n(this['locale'],_0x5c1712?'AI_CHAT_DISABLE_REASONING':'AI_CHAT_ENABLE_REASONING')),this['setTemplate']({'tag':'div','attributes':{'class':[ea]},'children':[this['_modelSelectionDropdown'],this['_modelNameView'],this['_webSearchButton'],this['_reasoningButton'],this['_commandsButton']]}),this['_modelSelectionDropdownItems']=new _0x12a2d7(),_0x3b3006(this['_modelSelectionDropdown'],this['_modelSelectionDropdownItems']);}['setModelList'](_0xd3dc9a,_0x54d642){if(this['set']('modelSelectorVisible',!(_0x54d642&&_0xd3dc9a['length']<=0x1)),this['_modelSelectionDropdownItems']['clear'](),_0xd3dc9a?.['length'])for(const _0x287899 of _0xd3dc9a){const _0x1347c7=new _0x18995b({'label':_0x287899['name'],'withText':!0x0,'role':'menuitemradio','id':_0x287899['id'],'model':_0x287899});_0x1347c7['bind']('isOn')['to'](this,'activeModelId',_0x1164ff=>_0x1164ff===_0x287899['id']),this['_modelSelectionDropdownItems']['add']({'type':'button','model':_0x1347c7,'labelView':new ca(this['locale'],_0x287899)});}}['setWebSearch'](_0x57b0e0){this['set']('webSearchActive',_0x57b0e0);}['setReasoning'](_0x35e06d){this['set']('reasoningActive',_0x35e06d);}['setModel'](_0x56a13a){if(!_0x56a13a)return;this['activeModelId']=_0x56a13a['id'],this['activeModelName']=_0x56a13a['name']||_0x56a13a['id'],this['_modelSelectionDropdown']['buttonView']['set']('label',_0x56a13a['name']),this['_modelSelectionDropdown']['buttonView']['set']('tooltip',_0x56a13a['name']);const _0x37e65a=_0x56a13a['capabilities']['webSearch']?.['enabled']??!0x1;this['set']('webSearchActive',!0x1),this['_webSearchButton']['set']('isOn',!0x1),this['_webSearchButton']['set']('isEnabled',_0x37e65a),this['_webSearchButton']['set']('isVisible',_0x37e65a);const _0xda7499=_0x56a13a['capabilities']['reasoning']?.['enabled']??!0x1;this['set']('reasoningActive',!0x1),this['_reasoningButton']['set']('isOn',!0x1),this['_reasoningButton']['set']('isEnabled',_0xda7499),this['_reasoningButton']['set']('isVisible',_0xda7499);}['enableModelSelector'](){this['set']('modelSelectorEnabled',!0x0),this['set']('modelSelectorVisible',!0x0);}['disableModelSelector'](_0x393919){this['set']('modelSelectorEnabled',!0x1),_0x393919&&this['set']('modelSelectorVisible',!0x1);}['_createWebSearchButton'](){const _0x26c16a=new _0x23128a();return _0x26c16a['set']({'label':$n(this['locale'],'AI_CHAT_SEARCH_WEB'),'icon':_0xdddffb,'class':ia,'isToggleable':!0x0,'tooltipPosition':ha}),_0x26c16a['on']('execute',()=>{this['fire']('toggleWebSearch');}),_0x26c16a;}['_createReasoningButton'](){const _0x9ff3dc=new _0x23128a();return _0x9ff3dc['set']({'label':$n(this['locale'],'AI_CHAT_REASONING'),'icon':_0x1014d8,'class':ia,'isToggleable':!0x0,'tooltipPosition':ha}),_0x9ff3dc['on']('execute',()=>{this['fire']('toggleReasoning');}),_0x9ff3dc;}['_createCommandsButton'](){const _0x47613a=new _0x23128a();return _0x47613a['set']({'label':$n(this['locale'],'AI_CHAT_COMMANDS'),'icon':yt,'withText':!0x0,'class':ia,'isToggleable':!0x0,'tooltip':$n(this['locale'],'AI_CHAT_COMMANDS'),'tooltipPosition':ha}),_0x47613a['extendTemplate']({'attributes':{'class':[sa]}}),_0x47613a['on']('execute',()=>{console['log']('Commands\x20are\x20not\x20implemented\x20yet.'),alert('Commands\x20are\x20not\x20implemented\x20yet.');}),_0x47613a;}['_createModelSelectionDropdown'](){const _0x565a3a=_0x820be6(this['locale']);return _0x565a3a['set']({'panelPosition':'ne','class':[na]}),_0x565a3a['buttonView']['set']({'label':$n(this['locale'],'AI_CHAT_MODEL_SELECTOR_ENABLED_TOOLTIP'),'withText':!0x0,'tooltip':!0x0,'tooltipPosition':ha}),this['listenTo'](_0x565a3a,'execute',_0x4e2ef4=>{this['fire']('selectModel',_0x4e2ef4['source']['model']);}),_0x565a3a;}['_createModelNameView'](){const _0x1a4c95=new jo(this['locale']);return _0x1a4c95['bind']('text')['to'](this,'activeModelName',_0xeb3980=>_0xeb3980??''),_0x1a4c95['bind']('isVisible')['to'](this,'modelSelectorVisible',this,'activeModelName',(_0x5257c7,_0x3e022a)=>!_0x5257c7&&!_0x3e022a?.['toLowerCase']()['startsWith']('agent')),_0x1a4c95;}}let ca=class extends _0x55f519{constructor(_0x2cc3ce,_0x5eaed7){super();const _0x1a45c4=this['bindTemplate'],_0x1c2df7=this['createCollection']();this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-button__label'],'style':_0x1a45c4['to']('style'),'id':_0x1a45c4['to']('id')},'children':[{'tag':'div','attributes':{'class':[ra]},'children':[{'text':_0x1a45c4['to']('text')}]},{'tag':'div','attributes':{'class':[oa]},'children':[{'tag':'span','children':[{'text':_0x5eaed7['description']}]}]},{'tag':'div','attributes':{'class':[aa]},'children':_0x1c2df7}]}),_0x1c2df7['addMany'](this['_getCapabilityParts'](_0x2cc3ce,_0xdddffb,'AI_CHAT_SEARCH_WEB',_0x5eaed7['capabilities']['webSearch']?.['enabled']??!0x1)),_0x1c2df7['addMany'](this['_getCapabilityParts'](_0x2cc3ce,_0x1014d8,'AI_CHAT_REASONING',_0x5eaed7['capabilities']['reasoning']?.['enabled']??!0x1));}['_getCapabilityParts'](_0x38ac1e,_0x5a23b7,_0x285287,_0xdef812){const _0x2d390e=new _0x2745c1();_0x2d390e['content']=_0x5a23b7;const _0x5b02c0=new _0x4118d8(_0x38ac1e);_0x5b02c0['setTemplate']({'tag':'span','children':[{'text':$n(_0x38ac1e,_0x285287)+':\x20'}]});const _0x3199a4=new _0x4118d8(_0x38ac1e);return _0x3199a4['setTemplate']({'tag':'span','children':[{'text':$n(_0x38ac1e,_0xdef812?'AI_CHAT_CAPABILITIES_YES':'AI_CHAT_CAPABILITIES_NO')}]}),[_0x2d390e,_0x5b02c0,_0x3199a4];}};class jo extends _0x4118d8{constructor(_0x26d001){super(_0x26d001),this['set']('text',void 0x0),this['set']('isVisible',!0x0);const _0x5dc0d0=this['bindTemplate'];this['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-ai-chat-controls__model-name',_0x5dc0d0['if']('isVisible','ck-hidden',_0x651839=>!_0x651839)]},'children':[{'text':_0x5dc0d0['to']('text')}]});}}const la='ck-ai-chat-context-controls__url-form',da='ck-ai-chat-context-controls__url-input-section';class wo extends _0x4118d8{['focusTracker'];['keystrokes'];['_focusables'];['focusCycler'];['urlInputField'];['backButton'];['confirmButton'];constructor(_0x4d2291){super(_0x4d2291),this['focusTracker']=new _0xc5fc70(),this['keystrokes']=new _0x464bf0(),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 _0x53ec2a({'focusables':this['_focusables'],'focusTracker':this['focusTracker'],'keystrokeHandler':this['keystrokes'],'actions':{'focusPrevious':'shift+tab','focusNext':'tab'}}),this['_setupTemplate'](),this['_setupEventHandlers'](),this['_setupKeystrokes']();}['render'](){super['render'](),this['_focusables']['forEach'](_0x564e29=>{this['focusTracker']['add'](_0x564e29['element']),this['keystrokes']['listenTo'](_0x564e29['element']);}),_0x2e5d32({'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'](_0x4b1699){this['urlInputField']['errorText']=_0x4b1699,this['_updateConfirmButtonState'](),this['fire']('refreshBalloon');}['clearError'](){this['urlInputField']['errorText']=null,this['_updateConfirmButtonState']();}['_createBackButton'](){const _0xfeefb5=new _0x23128a(this['locale']);return _0xfeefb5['set']({'icon':_0x460602,'tooltip':$n(this['locale'],'AI_CHAT_CONTEXT_URL_BACK_TO_CONTEXT'),'tooltipPosition':'n','class':'ck-button-icon\x20ck-button-back'}),_0xfeefb5;}['_createUrlInputField'](){const _0x175abf=new th(this['locale'],_0x1f7057);return _0x175abf['set']({'label':$n(this['locale'],'AI_CHAT_CONTEXT_URL_LABEL'),'class':'ck-labeled-field-view_empty'}),_0x175abf['fieldView']['set']({'placeholder':$n(this['locale'],'AI_CHAT_CONTEXT_URL_PLACEHOLDER')}),_0x175abf;}['_createConfirmButton'](){const _0xce7cf7=new _0x23128a(this['locale']);return _0xce7cf7['set']({'icon':_0xfb4387,'tooltip':$n(this['locale'],'AI_CHAT_CONTEXT_URL_ADD_URL'),'tooltipPosition':'n','class':'ck-button-icon','type':'submit','isEnabled':!0x1}),_0xce7cf7;}['_setupTemplate'](){const _0x16a1dd=new _0x58dd82(this['locale'],{'label':$n(this['locale'],'AI_CHAT_CONTEXT_URL_ADD_URL'),'class':'ck-ai-header\x20ck-ai-header_small\x20ck-ai-header_context-url'});_0x16a1dd['children']['add'](this['backButton'],0x0),this['setTemplate']({'tag':'form','attributes':{'class':la,'tabindex':'-1'},'children':[_0x16a1dd,{'tag':'div','attributes':{'class':da},'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',_0xbe7e6b=>{_0xbe7e6b['stop'](),this['_handleSubmit']();});}['_setupKeystrokes'](){this['keystrokes']['set']('esc',(_0x40f4bf,_0x5e798b)=>{this['clear'](),this['fire']('cancel'),_0x5e798b();});}['_handleSubmit'](){const _0x19991e=this['getValue']()['trim']();_0x19991e?this['_isValidUrl'](_0x19991e)?(this['clearError'](),this['fire']('submitUrl',_0x19991e)):this['setError']($n(this['locale'],'AI_CHAT_CONTEXT_URL_INVALID_ERROR')):this['setError']($n(this['locale'],'AI_CHAT_CONTEXT_URL_EMPTY_ERROR'));}['_updateConfirmButtonState'](){const _0x309a3a=this['getValue']()['trim'](),_0x7eed79=!!this['urlInputField']['errorText'];this['confirmButton']['isEnabled']=_0x309a3a['length']>0x0&&!_0x7eed79;}['_isValidUrl'](_0x5899fa){try{return!!new URL(_0x5899fa);}catch{return!0x1;}}}const ua='ck-ai-chat-resources__item',_a='ck-ai-chat-resources__item--in-context',Ia='ck-ai-chat-resources__item-title',Aa='ck-ai-chat-resources__item__icon';class tc extends _0x470a68{['resource'];['_titleView'];['_iconView'];constructor(_0x33758d,_0x2e023b){super(_0x33758d),this['resource']=_0x2e023b,this['set']('isInContext',!!_0x2e023b['isInContext']),this['_titleView']=this['_createTitleView'](),this['_iconView']=this['_createIconView'](),this['_setupTemplate']();}['render'](){super['render']();}['getResourceIcon'](_0x3587f0){if(_0x3587f0['isInContext'])return _0xfb4387;switch(_0x3587f0['type']){case ye['DOCUMENT']:return _0xe98777;case ye['URL']:return _0x65f42;case ye['FILE']:case ye['TEXT']:return _0x14f1fb;default:return _0x15b331;}}['highlightText'](_0x2978c3){if(!_0x2978c3||''===_0x2978c3['trim']())return void this['_titleView']['highlightText'](null);const _0x4c8b58=new RegExp(_0x523bea(_0x2978c3),'gi');this['_titleView']['highlightText'](_0x4c8b58);}['updateResourceState'](_0x4576f5){this['resource']['isInContext']=_0x4576f5,this['isInContext']=_0x4576f5,this['_updateIcon']();}['_createTitleView'](){const _0x3931f6=new _0x39fe79();return _0x3931f6['text']=this['resource']['label'],_0x3931f6['extendTemplate']({'tag':'span','attributes':{'class':[Ia]}}),_0x3931f6;}['_createIconView'](){const _0x1d39e3=new _0x2745c1();return _0x1d39e3['content']=this['getResourceIcon'](this['resource']),_0x1d39e3;}['_setupTemplate'](){const _0xb7bcad=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':[ua,_0xb7bcad['if']('isVisible','ck-hidden',_0x2be2a0=>!_0x2be2a0),_0xb7bcad['if']('isInContext',_a)]},'children':[{'tag':'div','attributes':{'class':[Aa]},'children':[this['_iconView']]},this['_titleView']],'on':{'click':_0xb7bcad['to']('execute')}});}['_updateIcon'](){this['_iconView']['content']=this['getResourceIcon'](this['resource']);}}const ga='ck-ai-chat-resources__list';class Ur extends _0x1626c8{['_source'];constructor(_0x3ddca2,_0x2668c7){super(_0x3ddca2),this['_source']=_0x2668c7,this['extendTemplate']({'attributes':{'class':[ga]}});}['setResources'](_0x42e04f,_0x188cb6){this['items']['clear']();let _0x3e0d22=_0x42e04f;if(this['_source']['useDefaultFiltering']&&_0x188cb6&&''!==_0x188cb6['trim']()){const _0x522949=new RegExp(_0x188cb6['replace'](/[.*+?^${}()|[\]\\]/g,'\x5c$&'),'gi');_0x3e0d22=_0x42e04f['filter'](_0x40609e=>_0x522949['test'](_0x40609e['label']));}for(const _0x1eb773 of _0x3e0d22){const _0x343210=new tc(this['locale'],_0x1eb773);_0x343210['on']('execute',()=>{this['_handleResourceSelection'](this['_source'],_0x1eb773);}),this['items']['add'](_0x343210);}this['_source']['useDefaultFiltering']&&this['highlightText'](_0x188cb6);}['highlightText'](_0x1d3552){this['_source']['useDefaultFiltering']&&this['items']['forEach'](_0xd4cb02=>{_0xd4cb02['highlightText'](_0x1d3552);});}['updateResourceState'](_0x4b4153,_0x188b77){for(const _0x11da16 of this['items']){const _0x1eedd1=_0x11da16;_0x1eedd1['resource']['id']===_0x4b4153&&_0x1eedd1['updateResourceState'](_0x188b77);}}['_handleResourceSelection'](_0x94f4b9,_0x2f63a2){this['fire']('addResourceToContext',{'source':_0x94f4b9,'resource':_0x2f63a2});}}class zr extends th{['iconView'];['resetButtonView'];['_viewConfig'];constructor(_0x2e04e8){const t=_0x2e04e8['t'],_0x32c117={'showResetButton':!0x0,'showIcon':!0x0,'creator':_0x1f7057,'label':$n(_0x2e04e8,'AI_CHAT_SEARCH_RESOURCES')};super(_0x2e04e8,_0x32c117['creator']),this['label']=_0x32c117['label'],this['_viewConfig']=_0x32c117,this['_viewConfig']['showIcon']&&this['_setupSearchIcon'](),this['_viewConfig']['showResetButton']&&this['_setupResetButton'](_0x2e04e8,t),this['_setupEventListeners']();}['reset'](){this['fieldView']['reset'](),this['_viewConfig']['showResetButton']&&this['resetButtonView']&&(this['resetButtonView']['isVisible']=!0x1),this['search']('');}['search'](_0x3176db){this['fire']('search',_0x3176db);}['getQuery'](){return this['fieldView']['element']?.['value']||'';}['_setupSearchIcon'](){this['iconView']=new _0x2745c1(),this['iconView']['content']=_0x17dd57,this['fieldWrapperChildren']['add'](this['iconView'],0x0),this['extendTemplate']({'attributes':{'class':'ck-search__query_with-icon'}});}['_setupResetButton'](_0x2c838e,t){this['resetButtonView']=new _0x23128a(_0x2c838e),this['resetButtonView']['set']({'label':t('Clear'),'icon':_0x1ebd11,'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',_0x94a589=>!_0x94a589),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 Br extends _0x4118d8{['_searchView'];['_resourcesListView'];['_skeletonLoader'];['_source'];['children'];['_latestLoadResourcesUid']=null;constructor(_0x16b856,_0x142caa){super(_0x16b856),this['_source']=_0x142caa,this['set']('isLoading',!0x0),this['_searchView']=this['_createSearchView']();const _0x59caa9=this['_createSearchSection']();this['_resourcesListView']=this['_createResourcesListView'](),this['_skeletonLoader']=this['_createSkeletonView'](),this['children']=new _0x260fed([_0x59caa9,this['_skeletonLoader'],this['_resourcesListView']]),this['setTemplate']({'tag':'div','attributes':{'class':'ck-ai-chat-resources'},'children':this['children']});}['_createSearchView'](){return new zr(this['locale']);}['_createSearchSection'](){const _0x31a1ff=new _0x4118d8(this['locale']);return _0x31a1ff['setTemplate']({'tag':'div','attributes':{'class':'ck\x20ck-search'},'children':[this['_searchView']]}),this['_searchView']['on']('search',(_0x37ea3a,_0x4daf5e)=>{this['loadResources'](_0x4daf5e),this['_source']['useDefaultFiltering']&&this['_resourcesListView']['highlightText'](_0x4daf5e);}),_0x31a1ff;}['_createResourcesListView'](){const _0x5211ed=new Ur(this['locale'],this['_source']);return _0x5211ed['delegate']('addResourceToContext')['to'](this),_0x5211ed['extendTemplate']({'attributes':{'class':this['bindTemplate']['if']('isLoading','ck-hidden')}}),_0x5211ed;}['_createSkeletonView'](){const _0x3b27aa=new Be(this['locale'],De['aiChatResources']);return _0x3b27aa['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isLoading','ck-hidden',_0x210932=>!_0x210932)]}}),_0x3b27aa;}['render'](){super['render'](),this['loadResources']('');}['loadResources'](_0x3ff914){const _0x102bad=_0x2ef42f();this['_latestLoadResourcesUid']=_0x102bad,this['fire']('loadSourceResources',{'sourceId':this['_source']['id'],'query':_0x3ff914,'uid':_0x102bad}),this['isLoading']=!0x0;}['setResources'](_0x2f005e,_0x14a142){if(_0x14a142&&_0x14a142!==this['_latestLoadResourcesUid'])return;const _0x23ce9f=this['_source']['useDefaultFiltering']?this['_searchView']['getQuery']():'';this['_resourcesListView']['setResources'](_0x2f005e,_0x23ce9f),requestAnimationFrame(()=>{this['isLoading']=!0x1;});}['updateResourceState'](_0x4fca58,_0x23aac1){this['_resourcesListView']['updateResourceState'](_0x4fca58,_0x23aac1);}}const ma='ck-ai-chat-context-controls__source-balloon-panel',pa='ck-button-icon\x20ck-button-back',Ta='ck-ai-header\x20ck-ai-header_small\x20ck-ai-header_source';class Bo{['_sourceResourceBalloons']=new Map();['_bodyCollection'];['_locale'];['_config'];constructor(_0x22d622,_0x324142,_0x11888d){this['_locale']=_0x22d622,this['_bodyCollection']=_0x324142,this['_config']=_0x11888d;}['showSourceResourcesBalloon'](_0x1c88ab){let _0x5daddf=this['_sourceResourceBalloons']['get'](_0x1c88ab['id']);_0x5daddf||(_0x5daddf=this['_createSourceResourceBalloonPanel'](),this['_sourceResourceBalloons']['set'](_0x1c88ab['id'],_0x5daddf),this['_setupSingleResourceBalloonClickOutsideHandler'](_0x5daddf)),this['_addSourceResourceContent'](_0x5daddf,_0x1c88ab),_0x5daddf['show']();const _0x4a244a=this['_config']['getTargetElement']();_0x4a244a&&_0x5daddf['pin']({'target':_0x4a244a,'limiter':this['_config']['getLimiterElement']()});}['populateSourceResourceBalloon'](_0x3c4591,_0x4f79b3,_0x387991){const _0xa3b31f=this['_sourceResourceBalloons']['get'](_0x3c4591);if(!_0xa3b31f)return;const _0xb8bf4c=this['_getResourcesViewFromBalloon'](_0xa3b31f);_0xb8bf4c&&_0xb8bf4c['setResources'](_0x4f79b3,_0x387991);}['closeSourceResourceBalloon'](_0x75359b){const _0x23db44=this['_sourceResourceBalloons']['get'](_0x75359b);_0x23db44&&requestAnimationFrame(()=>{_0x23db44['hide'](),this['_sourceResourceBalloons']['delete'](_0x75359b),this['_config']['onBalloonClosed']();});}['isAnyResourceBalloonVisible'](){for(const _0x25069a of this['_sourceResourceBalloons']['values']())if(_0x25069a['isVisible'])return!0x0;return!0x1;}['updateResourceState'](_0x34af37,_0x56f44,_0xba400b){const _0x44190a=this['_sourceResourceBalloons']['get'](_0x34af37);if(!_0x44190a||!_0x44190a['isVisible'])return;const _0x2b230d=this['_config']['getTargetElement']();if(!_0x2b230d)return;_0x44190a['pin']({'target':_0x2b230d,'limiter':this['_config']['getLimiterElement']()});const _0x14237b=this['_getResourcesViewFromBalloon'](_0x44190a);_0x14237b&&_0x14237b['updateResourceState'](_0x56f44,_0xba400b);}['destroy'](){for(const _0x86d470 of this['_sourceResourceBalloons']['values']())_0x86d470['destroy']();this['_sourceResourceBalloons']['clear']();}['_createSourceResourceBalloonPanel'](){const _0x2259ab=new _0xef9d9e(this['_locale']);return _0x2259ab['extendTemplate']({'attributes':{'class':ma}}),this['_bodyCollection']['add'](_0x2259ab),_0x2259ab;}['_addSourceResourceContent'](_0x4ead78,_0x2c3e87){_0x4ead78['content']['clear']();const _0x434de=this['_createBalloonHeader'](_0x4ead78,_0x2c3e87);_0x4ead78['content']['add'](_0x434de);const _0x3b27df=this['_createBalloonResourcesView'](_0x2c3e87);_0x4ead78['content']['add'](_0x3b27df);}['_createBalloonHeader'](_0x4e69d3,_0x20ca8e){const _0x45e8fd=this['_createBackButton'](_0x4e69d3),_0x3f09c9=new _0x58dd82(this['_locale'],{'label':_0x20ca8e['label'],'class':Ta});return _0x3f09c9['children']['add'](_0x45e8fd,0x0),_0x3f09c9;}['_createBackButton'](_0xeac943){const _0x57e0d1=new _0x23128a(this['_locale']);return _0x57e0d1['set']({'icon':_0x460602,'tooltip':$n(this['_locale'],'AI_CHAT_CONTEXT_URL_BACK_TO_CONTEXT'),'tooltipPosition':'n','class':pa}),_0x57e0d1['on']('execute',()=>{_0xeac943['hide'](),this['_config']['onBackToContext']();}),_0x57e0d1;}['_createBalloonResourcesView'](_0x2f2773){const _0x2107be=new Br(this['_locale'],_0x2f2773);return _0x2107be['on']('loadSourceResources',(_0x3a516b,_0x24663b)=>{this['_config']['onLoadSourceResources'](_0x24663b);}),_0x2107be['on']('addResourceToContext',(_0x507f87,_0x4fdf5)=>{this['_config']['onResourceSelected'](_0x4fdf5['source'],_0x4fdf5['resource']),this['closeSourceResourceBalloon'](_0x2f2773['id']);}),_0x2107be;}['_getResourcesViewFromBalloon'](_0x3e6074){const _0x363504=_0x3e6074['content']['get'](0x1);return _0x363504 instanceof Br?_0x363504:null;}['_setupSingleResourceBalloonClickOutsideHandler'](_0xe1dfe0){_0x28f439({'emitter':_0xe1dfe0,'contextElements':[_0xe1dfe0['element']],'callback':()=>{_0xe1dfe0['hide'](),this['_config']['onBalloonClosed']();},'activator':()=>_0xe1dfe0['isVisible']});}}const Se=['addDocumentToContext','addFileToContext','addUrlToContext','addResourceToContext','removeContextItem','loadSourceResources'],bo='ck-ai-chat-context-controls',To='ck-ai-chat-context-controls__pending-contexts',Ao='ck-ai-chat-context-controls__add-context-balloon-panel',ko='ck-ai-chat-context-controls__add-context-button',Eo='ck-ai-chat-context-controls__url-balloon-panel',vo='ck-ai-chat-context-controls__balloon-button',go='ck-ai-chat-context-controls__balloon-button-source',Vo='ck-ai-chat-controls-button',fo='ck-ai-chat-context-chips-wrapper-balloon',Io='ck-ai-chat-controls_context_show-more-button',Po='ck-ai-chat-context-controls__show-more-balloon-panel',Ro='ck-ai-chat',So=[_0xef9d9e['defaultPositions']['northArrowSouthWest'],_0xef9d9e['defaultPositions']['northArrowSouth'],_0xef9d9e['defaultPositions']['northArrowSouthEast'],_0xef9d9e['defaultPositions']['southArrowNorthWest'],_0xef9d9e['defaultPositions']['southArrowNorth'],_0xef9d9e['defaultPositions']['southArrowNorthEast']];class Ve extends _0x4118d8{['addContextButtonView'];['_currentContextsChips']=this['createCollection']();['_conversationContextsChips']=this['createCollection']();['_overflowManager'];['_addContextBalloonPanelView'];['_urlBalloonPanelView'];['_urlInputView'];['_resourcesBalloonView'];['_addContextBalloonConfig'];['bodyCollection'];constructor(_0x3db99b,_0x150131){super(_0x3db99b),this['bodyCollection']=_0x150131,this['_currentContextsChips']=this['createCollection'](),this['_conversationContextsChips']=this['createCollection'](),this['addContextButtonView']=this['_createAddContextButtonView'](_0x3db99b),this['_addContextBalloonPanelView']=this['_createAddContextBalloonPanelView'](_0x3db99b),this['_urlBalloonPanelView']=this['_createUrlBalloonPanelView'](_0x3db99b),this['_resourcesBalloonView']=this['_createResourcesBalloonView'](_0x3db99b,_0x150131);const _0x3c21da={'cssClasses':{'showMoreButton':Io,'showMoreBalloon':Po,'overflowContainer':fo,'controlsButton':Vo}};this['_overflowManager']=new po(_0x3db99b,this['_currentContextsChips'],_0x3c21da,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'](_0x553b5b,_0x114a51){const _0x2642e3=this['_createContextButton'](_0x553b5b,'current',!0x0,_0x114a51);this['_addContextToCollection'](_0x2642e3,this['_currentContextsChips']),this['_overflowManager']['reorganizeChips']();}['removeContextItem'](_0x598a93){this['_removeContextFromCollection'](_0x598a93,this['_currentContextsChips']),this['_removeContextFromCollection'](_0x598a93,this['_overflowManager']['overflowChips']),this['_overflowManager']['reorganizeChips']();}['setContextItemLoading'](_0x540820,_0x1ea093){let _0x4d586d=this['_currentContextsChips']['find'](_0x429802=>_0x429802['id']===_0x540820);_0x4d586d||(_0x4d586d=this['_overflowManager']['overflowChips']['find'](_0x82d9c8=>_0x82d9c8['id']===_0x540820)),_0x4d586d&&(_0x4d586d['isLoading']=_0x1ea093);}['setConversationContext'](_0x47794e){this['_conversationContextsChips']['clear']();for(const _0x2e8816 of _0x47794e){const _0x3189d2=this['_createContextButton'](_0x2e8816,'conversation',!0x1,!0x1);this['_addContextToCollection'](_0x3189d2,this['_conversationContextsChips']);}}['clearCurrentContextItems'](){this['_currentContextsChips']['clear'](),this['_overflowManager']['clear']();}['clearConversationContextItems'](){this['_conversationContextsChips']['clear']();}['updateResourceState'](_0x1d01b6,_0x29896e,_0x12ead8){this['_resourcesBalloonView']['updateResourceState'](_0x1d01b6,_0x29896e,_0x12ead8);}['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'](_0x46741a){this['_resourcesBalloonView']['showSourceResourcesBalloon'](_0x46741a),this['addContextButtonView']['isOn']=!0x0;}['populateSourceResourceBalloon'](_0x5b7a23,_0x52f78f,_0x57cba3,_0x4ec4f6){this['_resourcesBalloonView']['populateSourceResourceBalloon'](_0x5b7a23,_0x57cba3,_0x4ec4f6);}['closeSourceResourceBalloon'](_0x372e72){this['_resourcesBalloonView']['closeSourceResourceBalloon'](_0x372e72),this['addContextButtonView']['isOn']=!0x1;}['setAddContextOptions'](_0x4d2f50){this['_setBalloonPanelContent'](this['_addContextBalloonPanelView'],this['locale'],_0x4d2f50),this['_setAddContextButtonEnabled'](_0x4d2f50);}['_setAddContextButtonEnabled'](_0x2dc19c){const _0x2f42bd=!_0x2dc19c['document']['isHidden']&&_0x2dc19c['document']['enabled'],_0x1ab9dd=_0x2dc19c['urls']['enabled'],_0x376135=_0x2dc19c['files']['enabled'];this['addContextButtonView']['isEnabled']=_0x2f42bd||_0x1ab9dd||_0x376135;}['_setupTemplate'](){this['setTemplate']({'tag':'div','attributes':{'class':[bo,'ck-reset_all-excluded']},'children':[{'tag':'div','attributes':{'class':To},'children':this['_currentContextsChips']}]});}['_bindEventHandlers'](){this['addContextButtonView']['on']('execute',()=>{this['_handleAddContextButtonClick']();});}['_createAddContextButtonView'](_0x2a4f63){const _0x394d10=new _0x23128a(_0x2a4f63);return _0x394d10['set']({'label':$n(_0x2a4f63,'AI_CHAT_CONTEXT_ADD_CONTEXT'),'class':Vo+'\x20'+ko,'icon':_0x1478c1,'isToggleable':!0x0,'tooltip':!0x0,'tooltipPosition':'sw'}),_0x394d10;}['_createAddContextBalloonPanelView'](_0x3714dd){return this['_createBaseBalloonPanel'](_0x3714dd,Ao);}['_createUrlBalloonPanelView'](_0x2902d1){const _0x1f3298=this['_createBaseBalloonPanel'](_0x2902d1,Eo);return this['_addUrlContent'](_0x1f3298,_0x2902d1),_0x1f3298;}['_createResourcesBalloonView'](_0x4d9b20,_0x8a29ee){return new Bo(_0x4d9b20,_0x8a29ee,{'onBackToContext':()=>{this['showAddContextBalloonPanel'](),this['_addContextBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':So});},'onResourceSelected':(_0x2a4faf,_0x520eee)=>{this['fire']('addResourceToContext',{'source':_0x2a4faf,'resource':_0x520eee});},'onLoadSourceResources':_0x1643ae=>{this['fire']('loadSourceResources',_0x1643ae);},'onBalloonClosed':()=>{this['addContextButtonView']['isOn']=!0x1;},'getLimiterElement':()=>this['_getLimiterElement'](),'getTargetElement':()=>this['addContextButtonView']['element']});}['_getLimiterElement'](){return this['element']?.['closest']('.'+Ro)||document['body'];}['_createBaseBalloonPanel'](_0x420f8d,_0x414cdd){const _0x4e2669=new _0xef9d9e(_0x420f8d);return _0x4e2669['extendTemplate']({'attributes':{'class':_0x414cdd}}),this['bodyCollection']['add'](_0x4e2669),_0x4e2669;}['_setBalloonPanelContent'](_0x5e8df5,_0x1e8c3e,_0x2c3b33){if(_0x5e8df5['content']['clear'](),!_0x2c3b33['document']['isHidden']&&_0x2c3b33['document']['enabled']){const _0x5179f9=this['_createBalloonButton'](_0x1e8c3e,{'label':$n(_0x1e8c3e,'AI_CHAT_CONTEXT_CURRENT_DOCUMENT'),'icon':_0xe98777});_0x5179f9['on']('execute',()=>{this['fire']('addDocumentToContext'),this['hideAddContextBalloonPanel']();}),_0x5e8df5['content']['add'](_0x5179f9);}if(_0x2c3b33['urls']['enabled']){const _0x36a27d=this['_createBalloonButton'](_0x1e8c3e,{'label':$n(_0x1e8c3e,'AI_CHAT_CONTEXT_URL_LABEL'),'icon':_0x65f42});_0x36a27d['on']('execute',()=>{this['hideAddContextBalloonPanel'](),this['showUrlBalloonPanel'](),this['_urlBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':So}),this['_urlInputView']['focus']();}),_0x5e8df5['content']['add'](_0x36a27d);}if(_0x2c3b33['files']['enabled']){const _0xd327ee=new _0x1bc2a3(_0x1e8c3e);_0xd327ee['set']({'label':$n(_0x1e8c3e,'AI_CHAT_CONTEXT_FILE_LABEL'),'icon':_0x4be9f6,'withText':!0x0,'tooltip':!0x0,'class':vo,'allowMultipleFiles':!0x0}),_0xd327ee['on']('done',(_0x77e1f9,_0x81dd98)=>{this['fire']('addFileToContext',_0x81dd98),this['hideAddContextBalloonPanel']();}),_0xd327ee['tooltip']=!0x0,_0x5e8df5['content']['add'](_0xd327ee);}for(const _0x245274 of _0x2c3b33['sources']){const _0x4fb1d1=this['_createBalloonButton'](_0x1e8c3e,{'label':_0x245274['label'],'icon':_0x245274['icon']||_0x15b331,'type':'source'});_0x5e8df5['content']['add'](_0x4fb1d1),_0x4fb1d1['on']('execute',()=>{this['hideAddContextBalloonPanel'](),this['_showSourceResourcesBalloon'](_0x245274);});}}['_addUrlContent'](_0x2162ba,_0x5d2639){this['_urlInputView']=new wo(_0x5d2639),this['_urlInputView']['on']('submitUrl',(_0x8c4f98,_0x423f5c)=>{this['_handleUrlSubmit'](_0x423f5c);}),this['_urlInputView']['on']('cancel',()=>{this['hideUrlBalloonPanel'](),this['showAddContextBalloonPanel'](),this['_addContextBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':So});}),this['_urlInputView']['on']('refreshBalloon',()=>{this['_urlBalloonPanelView']['isVisible']&&this['_urlBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':So});}),_0x2162ba['content']['add'](this['_urlInputView']);}['_createBalloonButton'](_0x268f31,_0x3b38e5){const _0x41ae4f='source'===_0x3b38e5['type']?new Ea(_0x268f31):new _0x23128a(_0x268f31);return _0x41ae4f['set']({'label':_0x3b38e5['label'],'icon':_0x3b38e5['icon'],'withText':!0x0,'tooltip':!0x0,'tooltipPosition':'sw','class':vo}),_0x41ae4f;}['_setupAllBalloonClickOutsideHandlers'](){this['_setupAddContextBalloonClickOutsideHandler'](),this['_setupUrlBalloonClickOutsideHandler']();}['_setupUrlBalloonClickOutsideHandler'](){_0x28f439({'emitter':this['_urlBalloonPanelView'],'contextElements':[this['_urlBalloonPanelView']['element']],'callback':()=>{this['hideUrlBalloonPanel']();},'activator':()=>this['_urlBalloonPanelView']['isVisible']});}['_toggleAddContextBalloon'](_0x44f456){const _0x3732f1=this['_addContextBalloonConfig'];_0x3732f1['buttonView']['isOn']=_0x44f456,_0x44f456?_0x3732f1['balloonView']['show']():_0x3732f1['balloonView']['hide']();}['_setupAddContextBalloonClickOutsideHandler'](){const {balloonView:_0x2a3291,buttonView:_0x1198e0,hideMethod:_0x1af27f}=this['_addContextBalloonConfig'];_0x28f439({'emitter':_0x2a3291,'contextElements':[_0x2a3291['element'],_0x1198e0['element']],'callback':()=>{_0x1af27f();},'activator':()=>_0x1198e0['isOn']&&!this['_urlBalloonPanelView']['isVisible']&&!this['_resourcesBalloonView']['isAnyResourceBalloonVisible']()});}['_createContextButton'](_0x3b3383,_0x6b310d,_0x17ce5a=!0x1,_0x3da1aa=!0x1){const _0xa0758c='conversation'===_0x6b310d||!0x0===_0x3b3383['isReadOnly'],_0x345717=new mo(this['locale'],_0x3b3383,_0xa0758c,_0x17ce5a,_0x3da1aa);return _0xa0758c||_0x345717['on']('removeContextItemChip',()=>{this['fire']('removeContextItem',_0x345717['id']);}),_0x345717;}['_addContextToCollection'](_0x45f878,_0x239a22){_0x239a22['add'](_0x45f878,0x0);}['_removeContextFromCollection'](_0x59cd74,_0x42bbea){const _0x17b12c=_0x42bbea['find'](_0x4581c6=>_0x4581c6['id']===_0x59cd74);_0x17b12c&&_0x42bbea['remove'](_0x17b12c);}['_handleAddContextButtonClick'](){this['addContextButtonView']['isOn']?this['hideAddContextBalloonPanel']():(this['showAddContextBalloonPanel'](),this['_addContextBalloonPanelView']['pin']({'target':this['addContextButtonView']['element'],'limiter':this['_getLimiterElement'](),'positions':So}));}['_handleUrlSubmit'](_0x268b21){this['_urlInputView']['clear'](),this['hideUrlBalloonPanel'](),this['fire']('addUrlToContext',_0x268b21);}}class Ea extends _0x23128a{['arrowView'];constructor(_0x5ee2a8){super(_0x5ee2a8),this['set']({'withText':!0x0,'role':'menuitem'}),this['arrowView']=this['_createArrowView'](),this['extendTemplate']({'attributes':{'class':[go]}});}['render'](){super['render'](),this['children']['add'](this['arrowView']);}['_createArrowView'](){const _0x3cd280=new _0x2745c1();return _0x3cd280['content']=_0x2c91df,_0x3cd280['extendTemplate']({'attributes':{'class':go+'__arrow'}}),_0x3cd280;}}class ke extends _0x4118d8{['_cancelButtonView'];['_loaderView'];constructor(_0x3600ba){super(_0x3600ba),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 _0x5c8252=new _0x23128a(this['locale']);return _0x5c8252['set']({'label':$n(this['locale'],'AI_CHAT_STOP_GENERATING'),'withText':!0x0,'class':'ai-chat-controls-loader__cancel-button','icon':_0x4d6423}),_0x5c8252['on']('execute',()=>{this['fire']('abortPromptStream');}),_0x5c8252;}['_createLoaderView'](){const _0x3a88b8=new _0x4118d8(this['locale']);return _0x3a88b8['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':$n(this['locale'],'AI_CHAT_IS_WRITING')}]}),_0x3a88b8;}}class ji extends _0x4118d8{['_contextPanelView'];['_promptInputView'];['_promptCapabilitiesView'];['_loaderView'];['_shouldRestorePromptInputFocus'];constructor(_0x1531db,_0x532e2a){super(_0x1531db),this['_contextPanelView']=this['_createContextPanelView'](_0x1531db,_0x532e2a),this['_promptInputView']=this['_createPromptInputView'](_0x1531db),this['_promptCapabilitiesView']=this['_createPromptCapabilitiesView'](_0x1531db),this['_loaderView']=this['_createLoaderView'](_0x1531db),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'](...Se)['to'](this),this['set']('isDisabled',!0x1);const _0x5dd4af=this['bindTemplate'];this['setTemplate']({'tag':'form','attributes':{'class':['ck','ck-ai-chat-controls',_0x5dd4af['if']('isDisabled','ck-ai-chat-controls-disabled')]},'children':[{'tag':'div','attributes':{'class':[_0x5dd4af['if']('isLoading','ck-hidden')]},'children':[this['_contextPanelView'],this['_promptInputView'],this['_promptCapabilitiesView']]},{'tag':'div','attributes':{'class':[_0x5dd4af['if']('isLoading','ck-hidden',_0x3df649=>!_0x3df649)]},'children':[this['_loaderView']]}]}),_0x28f439({'emitter':this['_promptInputView'],'activator':()=>this['isLoading'],'contextElements':()=>[this['element']],'callback':()=>{this['_shouldRestorePromptInputFocus']=!0x1;}}),this['on']('change:isLoading',this['_handlePromptInputFocus'],{'priority':'low'});}['_createContextPanelView'](_0x3168da,_0x510431){return new Ve(_0x3168da,_0x510431);}['_createPromptInputView'](_0x231911){return new ve(_0x231911,this['_contextPanelView']['addContextButtonView']);}['_createPromptCapabilitiesView'](_0x27b5b0){return new _e(_0x27b5b0);}['_createLoaderView'](_0x140cae){return new ke(_0x140cae);}['_handlePromptInputFocus'](_0x11c898,_0x326ba2,_0x29cf9d){_0x29cf9d?this['_shouldRestorePromptInputFocus']=!0x0:this['_shouldRestorePromptInputFocus']&&this['_promptInputView']['focus']();}['addContextItem'](_0x27a5c9,_0x13306a){this['_contextPanelView']['addContextItem'](_0x27a5c9,_0x13306a);}['removeContextItem'](_0x55d5b9){this['_contextPanelView']['removeContextItem'](_0x55d5b9);}['setContextItemLoading'](_0x251248,_0x58be09){this['_contextPanelView']['setContextItemLoading'](_0x251248,_0x58be09);}['setIsUploadInProgress'](_0x2854cf){this['_promptInputView']['setIsUploadInProgress'](_0x2854cf);}['setConversationContext'](_0x24c613){this['_contextPanelView']['setConversationContext'](_0x24c613);}['clearPendingContextUI'](){this['_contextPanelView']['clearCurrentContextItems']();}['clearConversationContextUI'](){this['_contextPanelView']['clearConversationContextItems']();}['updateResourceState'](_0x57056d,_0xa582b6,_0x4aa8bd){this['_contextPanelView']['updateResourceState'](_0x57056d,_0xa582b6,_0x4aa8bd);}['setWebSearch'](_0x4ea01e){this['_promptCapabilitiesView']['setWebSearch'](_0x4ea01e);}['setReasoning'](_0x5371b8){this['_promptCapabilitiesView']['setReasoning'](_0x5371b8);}['resetMessageInput'](){this['_promptInputView']['reset']();}['setAddContextOptions'](_0x583445){this['_contextPanelView']['setAddContextOptions'](_0x583445);}['setInputPlaceholder'](_0x129c43){this['_promptInputView']['setPlaceholderText'](_0x129c43);}['setModelList'](_0x2dc142,_0x3ff4bd){this['_promptCapabilitiesView']['setModelList'](_0x2dc142,_0x3ff4bd);}['setModel'](_0x27e153){this['_promptCapabilitiesView']['setModel'](_0x27e153);}['enableModelSelector'](){this['_promptCapabilitiesView']['enableModelSelector']();}['disableModelSelector'](_0x3ee4bd){this['_promptCapabilitiesView']['disableModelSelector'](_0x3ee4bd);}['populateSourceResourceBalloon'](_0x680875,_0x1d08d5,_0x9daad9,_0x320eee){this['_contextPanelView']['populateSourceResourceBalloon'](_0x680875,_0x1d08d5,_0x9daad9,_0x320eee);}['closeSourceResourceBalloon'](_0x5e3f34){this['_contextPanelView']['closeSourceResourceBalloon'](_0x5e3f34);}['focusPromptInput'](){this['_promptInputView']['focus']();}}class ki extends _0x58dd82{['conversationStartButton'];['resizeButton'];constructor(_0x16b19b,_0x34d311){super(_0x16b19b,{'label':$n(_0x16b19b,'AI_CHAT_HEADING'),'class':'ck-ai-header\x20ck-ai-header_chat','icon':St}),this['set']('isMaximized',!0x1),this['conversationStartButton']=this['_createStartConversationButton'](_0x16b19b),this['children']['add'](this['conversationStartButton']),_0x34d311&&(this['resizeButton']=As(_0x16b19b,this),this['children']['add'](this['resizeButton']));}['_createStartConversationButton'](_0x218967){const _0x5a0e50=new _0x23128a(_0x218967);return _0x5a0e50['set']({'label':$n(this['locale'],'AI_CHAT_LABEL_NEW_CHAT'),'withText':!0x0,'icon':_0x2d1cb5,'class':'ck-ai-chat__start-conversation'}),_0x5a0e50['on']('execute',()=>{this['fire']('startConversation');}),_0x5a0e50;}}class Ci extends _0x4118d8{constructor(_0x318e81){super(_0x318e81),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-disclaimer']},'children':[{'tag':'p','attributes':{'class':['ck','ck-ai-disclaimer__content']},'children':[{'text':$n(_0x318e81,'AI_DISCLAIMER_TEXT')}]}]});}}class Et extends _0x4118d8{['chatHeader'];['chatFeed'];['chatControls'];['chatDisclaimer'];['_bodyCollection'];constructor(_0xfc9b54,_0x2b2fd4){super(_0xfc9b54),this['_bodyCollection']=new Wt(_0xfc9b54),this['_bodyCollection']['attachToDom'](),this['chatHeader']=new ki(_0xfc9b54,_0x2b2fd4),this['chatHeader']['delegate'](...Pt)['to'](this),this['chatFeed']=new pi(_0xfc9b54,this['_bodyCollection']),this['chatFeed']['delegate'](...Pt)['to'](this),this['chatControls']=new ji(_0xfc9b54,this['_bodyCollection']),this['chatControls']['delegate'](...Pt)['to'](this),this['chatDisclaimer']=new Ci(_0xfc9b54),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset_all','ck-ai-chat','ck-rounded-corners'],'dir':_0xfc9b54['uiLanguageDirection']},'children':[this['chatHeader'],this['chatFeed'],this['chatControls'],this['chatDisclaimer']]});}['populateSourceResourceBalloon'](_0x270467,_0x11a4d3,_0x2d7d37,_0x1396d5){this['chatControls']['populateSourceResourceBalloon'](_0x270467,_0x11a4d3,_0x2d7d37,_0x1396d5);}['closeSourceResourceBalloon'](_0x417348){this['chatControls']['closeSourceResourceBalloon'](_0x417348);}['destroy'](){this['_bodyCollection']['detachFromDom'](),super['destroy']();}}class at extends _0x56fd8d{static get['requires'](){return[ht];}['_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;constructor(_0x1144cd){super(_0x1144cd);const _0x40b64c=this['context']['plugins']['get']('AITabs');this['set']('isBusy',!0x1),this['_promiseQueue']=new Q(),this['_view']=new Et(this['context']['locale'],_0x40b64c['showResizeButton']),this['_view']['delegate'](...Pt)['to'](this),this['_view']['on']('toggleSuggestionDisplayMode',(_0x2aa72a,{showDiff:_0x343794})=>{this['showDiff']=_0x343794;}),_0x40b64c['view']['addTab']({'id':'chat','buttonLabel':$n(this['context']['locale'],'AI_CHAT_HEADING'),'buttonIcon':St,'order':0x0,'content':this['_view']}),this['_view']['chatControls']['bind']('isLoading')['to'](this,'isBusy',_0x10e64d=>_0x10e64d),this['_view']['chatFeed']['bind']('isPending')['to'](this,'isBusy',_0x23b89b=>_0x23b89b),this['_view']['chatControls']['setInputPlaceholder'](this['_getInputPlaceholder']());}['destroy'](){super['destroy'](),this['_titleAnimationInterval']&&clearInterval(this['_titleAnimationInterval']);}['createConversation'](_0x50f145){this['_view']['chatFeed']['clear'](),this['_view']['chatControls']['enableModelSelector'](),this['_view']['chatControls']['setModelList'](_0x50f145['availableModels'],!this['context']['config']['get']('ai.chat.models.modelSelectorAlwaysVisible')),this['addFeedItemStaticMessage']({'id':'conversation-start','staticMessage':$n(this['context']['locale'],'AI_CHAT_WELCOME_MESSAGE')});}['addFeedItemStaticMessage']({id:_0x1e28f6,staticMessage:_0x17320b}){this['_view']['chatFeed']['addItem']('ai-reply',{'id':_0x1e28f6,'initialContent':'<p>'+_0x17320b+'</p>'});}['addFeedItemUserMessage'](_0x566788){const _0x497569=_0x566788['quickActionData']?.['displayedPrompt']||_0x566788['userMessage'];this['_view']['chatFeed']['addItem']('user-message',{'contextItems':Array['from'](_0x566788['contextItems']['values']()),'initialContent':'<p>'+_0x497569+'</p>','id':_0x566788['id']});}['addFeedItemError']({errorMessage:_0x5bfb6b,id:_0x159e96}){this['_view']['chatFeed']['addItem']('error-message',{'initialContent':'<p>'+_0x5bfb6b+'</p>','id':_0x159e96});}['addFeedItemAIReply'](_0x46d9d7){return this['_promiseQueue']['enqueue'](async()=>{this['_view']['chatFeed']['addItem']('ai-reply',{'id':_0x46d9d7['interactionId']+':'+_0x46d9d7['id']}),this['_view']['chatFeed']['setLoadingMessage']('');});}async['addFeedItemAISuggestion'](_0x15d608){return this['_promiseQueue']['enqueue'](async()=>{this['_view']['chatFeed']['addItem']('ai-suggestion-reply',{'id':_0x15d608['interactionId']+':'+_0x15d608['id'],'areActionsDisabled':_0x15d608['areActionsDisabled'],'showDiff':this['showDiff']}),this['_view']['chatFeed']['setLoadingMessage']('');});}['addFeedInteractionHeader'](_0x8ea31a){this['_view']['chatFeed']['addItem']('interaction-header',{'id':_0x8ea31a['id'],'capabilities':_0x8ea31a['capabilities']});}['updateFeedInteractionHeader'](_0x18d166){const _0x2ec7a4=this['_view']['chatFeed']['children']['find'](_0x3cc0e5=>_0x3cc0e5['options']['id']==_0x18d166['id']&&_0x3cc0e5 instanceof Rt);_0x2ec7a4&&_0x2ec7a4['set']('isVisible',_0x18d166['isVisible']);}async['updateFeedItemAIReplyContent'](_0x3ecc2c){const _0x24bdf3=_0x3ecc2c['renderingStrategy']||this['feedItemRenderingStrategy'];return this['_promiseQueue']['enqueue'](async _0x33dcca=>{await this['_view']['chatFeed']['updateReplyItem']({..._0x3ecc2c,'abortSignal':_0x33dcca,'renderingStrategy':_0x24bdf3}),_0x3ecc2c['isDone']&&this['markFeedItemAsDone'](_0x3ecc2c['id']);});}['updateFeedItemAIReplySources'](_0x2a41fd,_0x348889){this['_view']['chatFeed']['updateWebSources'](_0x2a41fd,_0x348889);}async['updateFeedItemAIReplySuggestionContent'](_0x4537e0){const _0x170c47=_0x4537e0['renderingStrategy']||this['feedItemRenderingStrategy'];return this['_promiseQueue']['enqueue'](async _0x451a5f=>{await this['_view']['chatFeed']['updateSuggestionItem']({..._0x4537e0,'abortSignal':_0x451a5f,'renderingStrategy':_0x170c47}),_0x4537e0['isDone']&&this['markFeedItemAsDone'](_0x4537e0['id']);});}['updateFeedItemAIReplySuggestionPartState'](_0xd3e1aa){this['_view']['chatFeed']['updateSuggestionPartState'](_0xd3e1aa);}['markFeedItemAsDone'](_0x34ae42){this['_view']['chatFeed']['markItemAsDone'](_0x34ae42);}['removeFeedInteraction'](_0x46da1c){this['_view']['chatFeed']['getItemIds']()['filter'](_0xc23297=>_0xc23297['startsWith'](_0x46da1c))['forEach'](_0x18ee3e=>this['_view']['chatFeed']['removeItem'](_0x18ee3e));}['startInteraction'](_0x2b997c){this['_view']['chatFeed']['setLoadingMessage'](this['_getLoadingMessage'](_0x2b997c)),this['_view']['chatControls']['disableModelSelector'](!this['context']['config']['get']('ai.chat.models.modelSelectorAlwaysVisible')),this['isBusy']=!0x0,this['_view']['chatFeed']['startAutoScroll']();}['stopInteraction'](_0x57b18e){this['_promiseQueue']['abort'](),this['_view']['chatFeed']['getItemIds']()['filter'](_0x204f6a=>_0x204f6a['startsWith'](_0x57b18e['id']))['forEach'](_0x4418c7=>this['markFeedItemAsDone'](_0x4418c7)),this['isBusy']=!0x1,this['_view']['chatFeed']['stopAutoScroll']();}async['finishInteraction'](){return this['_promiseQueue']['queueEmptyPromise']['then'](()=>{this['isBusy']=!0x1,this['_view']['chatFeed']['stopAutoScroll']();});}['addContextItem'](_0x3dd642,_0x5d8466){this['_view']['chatControls']['addContextItem'](_0x3dd642,_0x5d8466);}['removeContextItem'](_0x428205){this['_view']['chatControls']['removeContextItem'](_0x428205);}['setContextItemLoading'](_0x511129,_0x106492){this['_view']['chatControls']['setContextItemLoading'](_0x511129,_0x106492);}['setIsUploadInProgress'](_0x345b5b){this['_view']['chatControls']['setIsUploadInProgress'](_0x345b5b);}['setConversationContext'](_0x2a5566){this['_view']['chatControls']['setConversationContext'](_0x2a5566);}['clearPendingContextUI'](){this['_view']['chatControls']['clearPendingContextUI']();}['clearConversationContextUI'](){this['_view']['chatControls']['clearConversationContextUI']();}['updateResourceState'](_0x4369c7,_0x34263f,_0x5b6295){this['_view']['chatControls']['updateResourceState'](_0x4369c7,_0x34263f,_0x5b6295);}['resetMessageInput'](){this['_view']['chatControls']['resetMessageInput'](),this['_view']['chatControls']['setInputPlaceholder'](this['_getInputPlaceholder']());}['setAddContextOptions'](_0x18f34e){this['_view']['chatControls']['setAddContextOptions'](_0x18f34e);}['updateCapabilities'](_0x3b0d0c){this['_view']['chatControls']['setWebSearch'](_0x3b0d0c['isWebSearchEnabled']),this['_view']['chatControls']['setReasoning'](_0x3b0d0c['isReasoningEnabled']),this['_view']['chatControls']['setInputPlaceholder'](this['_getInputPlaceholder'](_0x3b0d0c));}['setSelectedModel'](_0x808839,_0x370050){this['_view']['chatControls']['setModel'](_0x808839),_0x370050&&this['_view']['chatControls']['disableModelSelector'](!0x1);}['setFeedItemRenderingStrategy'](_0x148bb7){this['feedItemRenderingStrategy']=_0x148bb7;}['toggleLoadingSkeleton'](_0x555502){this['_view']['chatFeed']['toggleLoadingSkeleton'](_0x555502);}['resetConversationTitle'](){this['setConversationTitle']($n(this['context']['locale'],'AI_CHAT_HEADING'));}['setConversationTitle'](_0x32477e,_0x2dddcc=!0x1){if(_0x2dddcc&&!At()&&_0x32477e['length'])return this['_view']['chatHeader']['label']='',void this['_animateConversationTitle'](_0x32477e);this['_view']['chatHeader']['label']=_0x32477e;}['_animateConversationTitle'](_0x4affe){let _0x3cef12=0x0;clearInterval(this['_titleAnimationInterval']),this['_titleAnimationInterval']=setInterval(()=>{this['_view']['chatHeader']['label']=this['_view']['chatHeader']['label']+_0x4affe[_0x3cef12],_0x3cef12++,_0x3cef12===_0x4affe['length']&&clearInterval(this['_titleAnimationInterval']);},0x1e);}['setIsMaximized'](_0x303e26){this['_view']['chatHeader']['isMaximized']=_0x303e26;}['_getLoadingMessage'](_0x12b2cb){const _0xf54308=_0x12b2cb['capabilities'];return _0xf54308['isWebSearchEnabled']&&_0xf54308['isReasoningEnabled']?$n(this['context']['locale'],'AI_CHAT_FEED_LOADING_MESSAGE_WEBSEARCH_REASONING'):_0xf54308['isWebSearchEnabled']?$n(this['context']['locale'],'AI_CHAT_FEED_LOADING_MESSAGE_WEBSEARCH'):_0xf54308['isReasoningEnabled']?$n(this['context']['locale'],'AI_CHAT_FEED_LOADING_MESSAGE_REASONING'):$n(this['context']['locale'],'AI_CHAT_FEED_LOADING_MESSAGE_REGULAR');}['_getInputPlaceholder'](_0x2dbf97){return _0x2dbf97?_0x2dbf97['isWebSearchEnabled']&&_0x2dbf97['isReasoningEnabled']?$n(this['context']['locale'],'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_WEBSEARCH_REASONING'):_0x2dbf97['isWebSearchEnabled']?$n(this['context']['locale'],'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_WEBSEARCH'):_0x2dbf97['isReasoningEnabled']?$n(this['context']['locale'],'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_REASONING'):$n(this['context']['locale'],'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_REGULAR'):$n(this['context']['locale'],'AI_CHAT_PROMPT_INPUT_PLACEHOLDER_REGULAR');}['populateSourceResourceBalloon'](_0x46be60,_0x543009,_0x40e61b,_0x13da0e){this['_view']['populateSourceResourceBalloon'](_0x46be60,_0x543009,_0x40e61b,_0x13da0e);}['closeSourceResourceBalloon'](_0x1ed9c7){this['_view']['closeSourceResourceBalloon'](_0x1ed9c7);}['focusPromptInput'](){this['_view']['chatControls']['focusPromptInput']();}['scrollFeedToSuggestion'](_0xfe5082,_0xc4a49d){this['_view']['chatFeed']['scrollToSuggestion'](_0xfe5082,_0xc4a49d);}['disableControls'](){this['_view']['chatControls']['isDisabled']=!0x0;}['enableControls'](){this['_view']['chatControls']['isDisabled']=!0x1;}}class xi extends _0x1626c8{['sections'];constructor(_0xed797e,_0x181cf5){super(_0xed797e),this['sections']=_0x181cf5,this['items']['addMany'](this['sections']),this['extendTemplate']({'attributes':{'class':['ck-ai-chat-history__sections']}});}['filter'](_0x1bcca7){let _0x47f58a=0x0,_0x4c23e1=0x0;for(const _0x55a5ce of this['sections']){const {resultsCount:_0x4cdf6b,totalItemsCount:_0x388b11}=_0x55a5ce['filter'](_0x1bcca7);_0x47f58a+=_0x4cdf6b,_0x4c23e1+=_0x388b11;}return{'resultsCount':_0x47f58a,'totalItemsCount':_0x4c23e1};}}class Yi extends _0x470a68{['title'];['itemsViews'];['_itemsListView'];constructor(_0x3020cd,{title:_0x4fa155,items:_0x570751}){super(_0x3020cd);const _0x52a7c6=this['bindTemplate'];this['set']('isVisible',!0x0),this['title']=_0x4fa155,this['itemsViews']=_0x570751;const _0x4679cf=new _0x4118d8(_0x3020cd);_0x4679cf['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-chat-history__section-title']},'children':[this['title']]}),this['_itemsListView']=new _0x1626c8(_0x3020cd),this['_itemsListView']['items']['addMany'](this['itemsViews']),this['setTemplate']({'tag':'li','attributes':{'class':['ck-ai-chat-history__section',_0x52a7c6['if']('isVisible','ck-hidden',_0x28c129=>!_0x28c129)]},'children':[_0x4679cf,this['_itemsListView']]});}['filter'](_0x3bb15b){const _0x13d400=this['itemsViews']['length'];let _0x526185=0x0;for(const _0xb0df14 of this['itemsViews']){if(_0x3bb15b){const _0x4ebfb8=_0xb0df14['isMatching'](_0x3bb15b);_0xb0df14['isVisible']=!!_0x4ebfb8,_0xb0df14['highlightText'](_0x3bb15b);}else _0xb0df14['isVisible']=!0x0,_0xb0df14['highlightText'](null);_0xb0df14['isVisible']&&_0x526185++;}return this['isVisible']=_0x526185>0x0,{'resultsCount':_0x526185,'totalItemsCount':_0x13d400};}['getItem'](_0x3a5822){return this['itemsViews']['find'](_0x55f127=>_0x55f127['id']===_0x3a5822);}['removeItem'](_0x5094cb){const _0x206833=this['itemsViews']['indexOf'](_0x5094cb);-0x1!==_0x206833&&(this['itemsViews']['splice'](_0x206833,0x1),this['_itemsListView']['items']['remove'](_0x5094cb));}}class Mi extends _0x39c2c3(_0x470a68){['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(_0x2f986f,_0x567fa6){super(_0x2f986f);const _0x33be33=this['bindTemplate'];this['set']('isEdit',!0x1),this['set']('isVisible',!0x0),this['set']('pinned',!!_0x567fa6['pinned']),this['set']('loadingState',null),this['id']=_0x567fa6['id'];const {title:_0x54c64b,createdAt:_0x37322d,active:_0x25df55=!0x1}=_0x567fa6;this['_titleView']=new _0x39fe79(),this['_titleView']['text']=_0x54c64b,this['_titleView']['extendTemplate']({'attributes':{'class':['ck-ai-chat-history__item-title']}});const _0x584ffc=this['_createCheckView'](),_0xf15833=this['_createPinButtonView'](_0x2f986f),_0x2fa56b=this['_createMenuDropdownView'](),_0x213fc0=this['_createEditInputView'](_0x2f986f,_0x54c64b),_0x5ba5bc=this['_createAcceptEditButtonView'](_0x2f986f,_0x213fc0),_0x1da571=this['_createCancelEditButtonView'](_0x2f986f,_0x213fc0);this['actions']=this['createCollection'](),this['mainContent']=this['createCollection'](),this['mainContent']['add'](this['_titleView']),this['actions']['add'](_0xf15833),this['actions']['add'](_0x2fa56b),this['on']('change:isEdit',(_0x33a466,_0x723fd8,_0x5b26d8)=>{this['actions']['clear'](),this['mainContent']['clear'](),_0x5b26d8?(this['actions']['add'](_0x5ba5bc),this['actions']['add'](_0x1da571),this['mainContent']['add'](_0x213fc0),_0x213fc0['element']['focus']()):(this['actions']['add'](_0xf15833),this['actions']['add'](_0x2fa56b),this['mainContent']['add'](this['_titleView']));}),this['setTemplate']({'tag':'li','attributes':{'class':['ck-ai-chat-history__item',_0x25df55?'ck-ai-chat-history__item--active':'',_0x33be33['if']('isVisible','ck-hidden',_0xb9082=>!_0xb9082),_0x33be33['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',_0x33be33['if']('loadingState','ck-hidden',_0x30a191=>!!_0x30a191)]},'children':_0x25df55?[_0x584ffc]:[]},{'tag':'div','attributes':{'class':['ck-ai-loader',_0x33be33['if']('loadingState','ck-hidden',_0x4d49e5=>!_0x4d49e5)]},'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',_0x33be33['if']('loadingState','ck-hidden',_0x51b5b3=>!!_0x51b5b3)]},'children':this['mainContent']},{'tag':'div','attributes':{'class':['ck-ai-loader__text',_0x33be33['if']('loadingState','ck-hidden',_0x3eb606=>!_0x3eb606)]},'children':[{'text':_0x33be33['to']('loadingState',_0x287dbe=>_0x287dbe?$n(this['locale'],Mi['LOADING_LABELS'][_0x287dbe]):'')}]}]},{'tag':'span','attributes':{'class':['ck-ai-chat-history__item-date']},'children':[_0x37322d]}]},{'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'](_0x3bd0d6){this['_titleView']['text']=_0x397c0d(_0x3bd0d6);}['updateLoadingState'](_0xf62612,_0x2cee01){this['set']('loadingState',_0x2cee01?_0xf62612:null);}['_createCheckView'](){const _0x5b4530=new _0x2745c1();return _0x5b4530['set']({'content':_0x1e00d1}),_0x5b4530;}['_createPinButtonView'](_0x1aa37c){const _0x3c179f=new _0x23128a(_0x1aa37c);return _0x3c179f['set']({'label':$n(_0x1aa37c,'AI_CHAT_HISTORY_PIN_BUTTON'),'icon':_0x304968,'withText':!0x1,'tooltip':!0x0}),_0x3c179f['bind']('isOn')['to'](this,'pinned'),_0x3c179f['on']('execute',()=>{const _0x53cfcc=!this['pinned'];this['fire']('setConversationPinned',{'id':this['id'],'pinned':_0x53cfcc});}),_0x3c179f;}['_createMenuDropdownView'](){const _0x5e96bb=_0x820be6(this['locale'],_0x36597b),_0x2d6e41=_0x5e96bb['panelView']['children'];_0x5e96bb['buttonView']['set']({'label':$n(this['locale'],'AI_CHAT_HISTORY_SHOW_MORE_ITEMS'),'icon':_0x3deff4}),_0x5e96bb['panelPosition']='sw';const _0xbc8f2=new _0x23128a(this['locale']);_0xbc8f2['label']=$n(this['locale'],'AI_CHAT_HISTORY_EDIT_NAME'),_0xbc8f2['withText']=!0x0,_0xbc8f2['on']('execute',()=>{this['isEdit']=!0x0;});const _0x466a17=new _0x23128a(this['locale']);_0x466a17['label']=$n(this['locale'],'AI_CHAT_HISTORY_REMOVE'),_0x466a17['withText']=!0x0,_0x466a17['on']('execute',()=>{this['showConfirm']($n(this['locale'],'AI_CHAT_HISTORY_REMOVE_CONFIRM'),this['element'])['then'](()=>{this['fire']('removeConversation',{'id':this['id']});});});const _0x5e626b=new _0x1626c8(this['locale']),_0x363a1b=new _0x470a68(this['locale']);_0x363a1b['children']['add'](_0xbc8f2);const _0x36fa9b=new _0x470a68(this['locale']);return _0x36fa9b['children']['add'](_0x466a17),_0x5e626b['items']['addMany']([_0x363a1b,_0x36fa9b]),_0x2d6e41['add'](_0x5e626b),_0x5e96bb;}['_createEditInputView'](_0x565750,_0x97bb04){const _0x2df568=new _0x84805a(_0x565750),_0x5b3e14=_0x2df568['bindTemplate'];return _0x2df568['value']=_0x97bb04,_0x2df568['extendTemplate']({'on':{'keydown':_0x5b3e14['to'](_0x341c8c=>{'Enter'==_0x341c8c['key']&&this['_commitEditInputValue'](_0x2df568);})}}),_0x2df568;}['_createAcceptEditButtonView'](_0x4f1e56,_0x16d3c8){const _0x546b00=new _0x23128a(_0x4f1e56);return _0x546b00['set']({'icon':_0x1e00d1,'withText':!0x1,'tooltip':$n(_0x4f1e56,'AI_CHAT_HISTORY_ACCEPT')}),_0x546b00['extendTemplate']({'attributes':{'class':['ck-confirm-view-submit']}}),_0x546b00['on']('execute',()=>{this['_commitEditInputValue'](_0x16d3c8);}),_0x546b00;}['_commitEditInputValue'](_0x45714d){const _0x22e69c=_0x45714d['element']['value']||'';this['_titleView']['text']=_0x22e69c,this['isEdit']=!0x1,this['fire']('editConversationTitle',{'id':this['id'],'title':_0x22e69c});}['_createCancelEditButtonView'](_0x24821a,_0x3cfa19){const _0x23be41=new _0x23128a(_0x24821a);return _0x23be41['set']({'icon':_0x1ebd11,'withText':!0x1,'tooltip':$n(_0x24821a,'AI_CHAT_HISTORY_CANCEL')}),_0x23be41['extendTemplate']({'attributes':{'class':['ck-confirm-view-cancel']}}),_0x23be41['on']('execute',()=>{this['isEdit']=!0x1,_0x3cfa19['value']=this['_titleView']['text']||'',this['fire']('edit:cancel');}),_0x23be41;}['_createSpinnerView'](){const _0x48ab2b=new Oe('tiny');return _0x48ab2b['isVisible']=!0x0,_0x48ab2b;}['isMatching'](_0x1f762c){return this['_titleView']&&'string'==typeof this['_titleView']['text']&&this['_titleView']['text']['match'](_0x1f762c)?{'title':!0x0}:null;}['highlightText'](_0x29e6c5){this['_titleView']['highlightText'](_0x29e6c5);}}class vt extends _0x4118d8{['searchView'];['errorView'];['skeletonView'];['emptyView'];['sectionsView'];['resizeButton'];constructor(_0x5b699d,_0x509e3a){super(_0x5b699d),this['set']('hasItems',!0x1),this['set']('isLoading',!0x0),this['set']('errorMessage',''),this['set']('isMaximized',!0x1),this['set']('isSearchViewVisible',!0x1),this['set']('isEmptyViewVisible',!0x1);const _0x24b84e=new _0x58dd82(_0x5b699d,{'label':$n(_0x5b699d,'AI_CHAT_HISTORY_HEADING'),'icon':Ht,'class':'ck-ai-header\x20ck-ai-header_history'});_0x509e3a&&(this['resizeButton']=As(_0x5b699d,this),_0x24b84e['children']['add'](this['resizeButton'])),this['sectionsView']=new xi(_0x5b699d,[]),this['sectionsView']['delegate'](...Li)['to'](this),this['errorView']=this['_createErrorView'](),this['skeletonView']=this['_createSkeletonView'](),this['emptyView']=this['_createEmptyStateView'](),this['searchView']=this['_createSearchView'](),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':[_0x24b84e,{'tag':'div','attributes':{'class':['ck-ai-chat-history__content']},'children':[this['skeletonView'],this['errorView'],this['emptyView'],this['searchView']]}]});}['_updateViewVisibility'](){this['isSearchViewVisible']=!this['isLoading']&&this['hasItems']&&!this['errorMessage'],this['isEmptyViewVisible']=!this['isLoading']&&!this['hasItems']&&!this['errorMessage'];}['_createSearchView'](){const _0x4b1027=new _0x313f7a(this['locale'],{'filteredView':this['sectionsView'],'queryView':{'label':$n(this['locale'],'AI_CHAT_HISTORY_SEARCH_LABEL')},'infoView':{'text':{'notFound':{'primary':_0x50c98d=>$n(this['locale'],'AI_CHAT_HISTORY_SEARCH_NOT_FOUND_PRIMARY',_0x50c98d),'secondary':$n(this['locale'],'AI_CHAT_HISTORY_SEARCH_NOT_FOUND_SECONDARY')}}}});return _0x4b1027['on']('render',()=>{this['searchView']['children']['add'](this['errorView'],0x1);}),_0x4b1027['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isSearchViewVisible','ck-hidden',_0x219c08=>!_0x219c08)]}}),_0x4b1027;}['_createSkeletonView'](){const _0x47b092=new Be(this['locale'],De['aiHistory']);return _0x47b092['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isLoading','ck-hidden',_0x13b805=>!_0x13b805)]}}),_0x47b092;}['_createErrorView'](){const _0x1f02b6=new _0x4118d8(this['locale']),_0x1a4770=new _0x23128a(this['locale']);return _0x1a4770['set']({'withText':!0x1,'icon':_0x1ebd11,'class':'ck-ai-chat-error__dismiss-button'}),_0x1a4770['bind']('isVisible')['to'](this,'hasItems',_0x4083da=>!!_0x4083da),_0x1a4770['on']('execute',()=>{this['errorMessage']='';}),_0x1f02b6['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-chat-error',this['bindTemplate']['if']('errorMessage','ck-hidden',_0x34aede=>!_0x34aede)]},'children':[{'tag':'p','children':[{'text':this['bindTemplate']['to']('errorMessage')}]},_0x1a4770]}),_0x1f02b6;}['_createEmptyStateView'](){const _0xdcb072=new _0x23128a(this['locale']);_0xdcb072['set']({'withText':!0x0,'label':$n(this['locale'],'AI_CHAT_HISTORY_GO_TO_CHAT_BUTTON'),'class':'ck-ai-chat-history__open-chat-button'}),_0xdcb072['on']('execute',()=>{this['fire']('openChat');});const _0x22a0d6=new _0x4118d8(this['locale']);return _0x22a0d6['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-chat-history__empty',this['bindTemplate']['if']('isEmptyViewVisible','ck-hidden',_0x7faa4e=>!_0x7faa4e)]},'children':[{'tag':'p','attributes':{'class':['ck-ai-chat-history__empty-message']},'children':[$n(this['locale'],'AI_CHAT_HISTORY_EMPTY_MESSAGE')]},_0xdcb072]}),_0x22a0d6;}['_createListItemViews'](_0x395074,_0x1cfdff){const _0x4eb0c6=[];for(const _0x52f2a2 of _0x395074){const _0x317f72=new Mi(_0x1cfdff,_0x52f2a2);_0x317f72['delegate'](...Li)['to'](this),_0x4eb0c6['push'](_0x317f72);}return _0x4eb0c6;}['updateHistoryItemsWithCategories'](_0x39df63){const _0x53264e=this['locale']||'en',_0x3dc370=[];for(const _0xcb37f4 of _0x39df63){const _0xfb494=this['_createListItemViews'](_0xcb37f4['items'],_0x53264e);_0x3dc370['push'](new Yi(_0x53264e,{'title':_0xcb37f4['title'],'items':_0xfb494}));}this['sectionsView']['sections']=_0x3dc370,this['sectionsView']['items']['clear'](),this['sectionsView']['items']['addMany'](_0x3dc370),this['hasItems']=_0x39df63['some'](_0x185b6a=>_0x185b6a['items']['length']>0x0),this['_refreshSearch']();}['removeHistoryItem'](_0x91304b){for(const _0x1ec5da of this['sectionsView']['sections']){const _0x4e249e=_0x1ec5da['getItem'](_0x91304b);if(_0x4e249e){if(_0x1ec5da['removeItem'](_0x4e249e),0x0===_0x1ec5da['itemsViews']['length']){const _0x11d0c1=this['sectionsView']['sections']['indexOf'](_0x1ec5da);-0x1!==_0x11d0c1&&(this['sectionsView']['sections']['splice'](_0x11d0c1,0x1),this['sectionsView']['items']['remove'](_0x1ec5da));}this['hasItems']=this['sectionsView']['sections']['length']>0x0,this['_refreshSearch']();break;}}}['updateItemTitle'](_0x7e7f13,_0x3cdb1c){for(const _0x27fc12 of this['sectionsView']['sections']){const _0x517cf3=_0x27fc12['getItem'](_0x7e7f13);if(_0x517cf3){_0x517cf3['updateTitle'](_0x3cdb1c);break;}}}['updateItemLoadingState'](_0x129b31,_0x2b1f03,_0x59f652){for(const _0x143521 of this['sectionsView']['sections']){const _0x20e666=_0x143521['getItem'](_0x129b31);if(_0x20e666){_0x20e666['updateLoadingState'](_0x2b1f03,_0x59f652);break;}}}['_refreshSearch'](){if(this['hasItems']){const _0x199b25=this['searchView']['queryView']['fieldView']?.['element']?.['value']||'';this['searchView']['search'](_0x199b25);}}}const Li=['showConversationHistory','removeConversation','editConversationTitle','setConversationPinned','selectConversation','openChat','resizeTabs'];class xt extends _0x56fd8d{static get['requires'](){return[ht];}['_historyView'];static get['pluginName'](){return'AIChatHistoryUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x10ec1e){super(_0x10ec1e);const _0x46c2c6=this['context']['plugins']['get']('AITabs');this['_historyView']=new vt(this['context']['locale'],_0x46c2c6['showResizeButton']),this['_historyView']['delegate'](...Li)['to'](this),_0x46c2c6['view']['addTab']({'id':'history','buttonLabel':$n(this['context']['locale'],'AI_CHAT_HISTORY_HEADING'),'buttonIcon':Ht,'order':0x0,'content':this['_historyView']});}['removeHistoryItem'](_0x2f7f86){this['_historyView']['removeHistoryItem'](_0x2f7f86);}['updateItems'](_0x498c5e){this['_historyView']['updateHistoryItemsWithCategories'](_0x498c5e);}['updateItemTitle'](_0x4f32cc,_0x133684){this['_historyView']['updateItemTitle'](_0x4f32cc,_0x133684);}['updateItemLoadingState'](_0x2be393,_0xe7c50e,_0x4d3668){this['_historyView']['updateItemLoadingState'](_0x2be393,_0xe7c50e,_0x4d3668);}['setLoadingSkeleton'](_0x129b04){this['_historyView']['isLoading']=_0x129b04;}['showError'](_0x230946){this['_historyView']['errorMessage']=_0x230946;}['hideError'](){this['_historyView']['errorMessage']='';}['setIsMaximized'](_0x3de817){this['_historyView']['isMaximized']=_0x3de817;}}class Ue extends ts(){['id'];['createdAt'];constructor({id:_0x1653d2,title:_0x256c57,createdAt:_0x1818a3,updatedAt:_0x50395a,pinned:_0x534769}){super(),this['id']=_0x1653d2,this['createdAt']=new Date(_0x1818a3),this['set']('title',_0x256c57),this['set']('updatedAt',_0x50395a?new Date(_0x50395a):null),this['set']('pinned',_0x534769||!0x1);}['updateTitle'](_0x48d4b1){this['set']('title',_0x397c0d(_0x48d4b1)),this['updatedAt']=new Date();}['updatePinned'](_0x1703d1){this['set']('pinned',_0x1703d1),this['updatedAt']=new Date();}}class Tt extends _0x5f2b03(){['items']=[];['connector'];['group'];constructor({connector:_0x385d2c,group:_0x5c70d4}){super(),this['connector']=_0x385d2c,this['group']=_0x5c70d4;}async['init'](){try{const _0x9418d0=this['connector']['fetchConversations'](this['group']),_0x55b879=await _0x9418d0['getConversations']();this['loadItems'](_0x55b879);}catch(_0x3154d9){this['fire']('error',{'error':_0x3154d9,'operation':'init'});}}['addItem'](_0x57711c){this['items']['push'](_0x57711c);}async['removeItem'](_0xb0606f){const _0x505589=this['items']['findIndex'](_0x379ef8=>_0x379ef8['id']===_0xb0606f);if(-0x1===_0x505589)return!0x1;try{return await this['connector']['deleteConversation'](_0xb0606f)['execute'](),this['items']['splice'](_0x505589,0x1),this['fire']('itemRemoved',{'itemId':_0xb0606f}),!0x0;}catch(_0x591566){return this['fire']('error',{'error':_0x591566,'operation':'removeItem','itemId':_0xb0606f}),!0x1;}}['getItem'](_0xd72d58){return this['items']['find'](_0x514694=>_0x514694['id']===_0xd72d58);}async['updateItemTitle'](_0xafa82f,_0x48bd1a){const _0x174d61=this['getItem'](_0xafa82f);if(!_0x174d61)return!0x1;try{return await this['connector']['updateConversation'](_0xafa82f,{'title':_0x48bd1a})['getResult'](),_0x174d61['updateTitle'](_0x48bd1a),this['fire']('itemUpdated',{'itemId':_0xafa82f,'updates':{'title':_0x48bd1a}}),!0x0;}catch(_0x6f92a9){return this['fire']('error',{'error':_0x6f92a9,'operation':'updateItemTitle','itemId':_0xafa82f}),!0x1;}}async['updateItemPinned'](_0x2bdfdb,_0x5ebf73){const _0x3e96bd=this['getItem'](_0x2bdfdb);if(!_0x3e96bd)return!0x1;try{return await this['connector']['updateConversation'](_0x2bdfdb,{'pinned':_0x5ebf73})['getResult'](),_0x3e96bd['updatePinned'](_0x5ebf73),this['fire']('itemUpdated',{'itemId':_0x2bdfdb,'updates':{'pinned':_0x5ebf73}}),!0x0;}catch(_0x230be0){return this['fire']('error',{'error':_0x230be0,'operation':'updateItemPinned','itemId':_0x2bdfdb}),!0x1;}}['loadItems'](_0x16137b){try{this['items']=[],_0x16137b['map'](_0x3d9b80=>{this['addItem'](new Ue(_0x3d9b80));}),this['fire']('itemsLoaded',{'items':[...this['items']]});}catch(_0x3f8c83){this['fire']('error',{'error':_0x3f8c83,'operation':'loadItems'});}}['getItems'](_0x19aab8={}){const _0x30b051=void 0x0!==_0x19aab8['pinned']&&_0x19aab8['pinned'],_0x5979ee=_0x19aab8['from']?new Date(_0x19aab8['from']['getFullYear'](),_0x19aab8['from']['getMonth'](),_0x19aab8['from']['getDate']()):null,_0x25dc17=_0x19aab8['to']?new Date(_0x19aab8['to']['getFullYear'](),_0x19aab8['to']['getMonth'](),_0x19aab8['to']['getDate']()):null;return this['items']['filter'](_0x39f3b3=>{if(_0x39f3b3['pinned']!==_0x30b051)return!0x1;if(_0x25dc17){const _0x32ba13=new Date(_0x39f3b3['createdAt']['getFullYear'](),_0x39f3b3['createdAt']['getMonth'](),_0x39f3b3['createdAt']['getDate']());return _0x5979ee?_0x5979ee['getTime']()===_0x25dc17['getTime']()?_0x32ba13['getTime']()===_0x5979ee['getTime']():_0x32ba13<_0x25dc17&&_0x32ba13>=_0x5979ee:_0x32ba13<_0x25dc17;}return!0x0;});}}class jt extends _0x56fd8d{['_aiConnector'];['_aiChatHistoryUi'];['_aiChatController'];static get['requires'](){return[N,et,xt,ht];}static get['pluginName'](){return'AIChatHistoryController';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){this['_aiConnector']=this['context']['plugins']['get'](N),this['_aiChatHistoryUi']=this['context']['plugins']['get'](xt),this['_aiChatController']=this['context']['plugins']['get'](et);const _0x49f07b=this['context']['plugins']['get'](ht),_0x175ef4=this['_aiChatController']['getGroupId']();this['history']=new Tt({'connector':this['_aiConnector'],'group':_0x175ef4}),this['listenTo'](this['_aiChatHistoryUi'],'removeConversation',(_0xd2e5ff,_0x225a19)=>{this['_setItemLoading'](_0x225a19['id'],'remove'),this['_handleRemove'](_0x225a19['id']);}),this['listenTo'](this['_aiChatHistoryUi'],'editConversationTitle',(_0x53d4ca,_0x2073b3)=>{this['_setItemLoading'](_0x2073b3['id'],'rename'),this['_handleEditTitle'](_0x2073b3['id'],_0x2073b3['title']);}),this['listenTo'](this['history'],'itemUpdated',(_0x2be00a,_0xdf0672)=>{void 0x0!==_0xdf0672['updates']['title']&&this['_aiChatHistoryUi']['updateItemTitle'](_0xdf0672['itemId'],_0xdf0672['updates']['title']),void 0x0!==_0xdf0672['updates']['pinned']&&this['_updateHistoryItemsUI'](),this['_clearItemLoading'](_0xdf0672['itemId']);}),this['listenTo'](this['history'],'itemRemoved',(_0xa5d6d5,_0x2f8a4d)=>{this['_aiChatController']['handleRemovedConversation'](_0x2f8a4d['itemId']),this['_aiChatHistoryUi']['removeHistoryItem'](_0x2f8a4d['itemId']),this['_clearItemLoading'](_0x2f8a4d['itemId']);}),this['listenTo'](this['history'],'itemsLoaded',()=>{this['_updateHistoryItemsUI']();}),this['listenTo'](this['history'],'error',(_0x2d2a3f,_0x25c258)=>{this['_handleHistoryErrorUI'](_0x25c258['error'],_0x25c258['operation'],_0x25c258['itemId']);}),this['listenTo'](this['_aiChatHistoryUi'],'selectConversation',(_0x39cc9e,_0x1bdc74)=>{this['_handleSelectConversation'](_0x1bdc74['id']);}),this['listenTo'](this['_aiChatHistoryUi'],'setConversationPinned',(_0x1f1e67,_0x40641e)=>{const _0x4a89d2=_0x40641e['pinned']?'pin':'unpin';this['_setItemLoading'](_0x40641e['id'],_0x4a89d2),this['_handleTogglePin'](_0x40641e['id'],_0x40641e['pinned']);}),this['listenTo'](this['_aiChatHistoryUi'],'openChat',()=>{_0x49f07b['view']['activateTab']('chat');}),this['listenTo'](this['_aiChatController'],'change:activeConversation',()=>{this['_updateHistoryItemsUI']();}),_0x49f07b['view']['on']('activateTab:history',()=>{this['_showConversationHistory']();}),this['listenTo'](_0x49f07b,'resizedTabs',(_0x41e50f,_0x2cbcf7)=>{this['_setIsMaximized'](_0x2cbcf7);}),this['listenTo'](this['_aiChatHistoryUi'],'resizeTabs',()=>{_0x49f07b['resize']();});}async['_handleEditTitle'](_0x5249c7,_0x51888d){await this['history']['updateItemTitle'](_0x5249c7,_0x51888d);}async['_handleTogglePin'](_0x4deb65,_0x551b12){await this['history']['updateItemPinned'](_0x4deb65,_0x551b12);}async['_handleRemove'](_0x48e374){await this['history']['removeItem'](_0x48e374);}async['_handleSelectConversation'](_0x5187bd){await this['_aiChatController']['loadConversation'](_0x5187bd);}async['_showConversationHistory'](){this['_aiChatHistoryUi']['showError'](''),this['_aiChatHistoryUi']['setLoadingSkeleton'](!0x0),await this['history']['init'](),this['_aiChatHistoryUi']['setLoadingSkeleton'](!0x1);}['_updateHistoryItemsUI'](){const _0x7d02ff=this['_aiChatController']['activeConversation']?.['id'],_0x100381=this['_getCategorizedItems']()['map'](_0x58e024=>({'title':_0x58e024['title'],'items':_0x58e024['items']['map'](_0x3afaae=>({'id':_0x3afaae['id'],'title':_0x3afaae['title']||$n(this['context']['locale'],'AI_CHAT_UNTITLED_CONVERSATION'),'createdAt':new Date(_0x3afaae['createdAt'])['toLocaleDateString'](),'active':_0x3afaae['id']===_0x7d02ff,'pinned':_0x3afaae['pinned']}))}));this['_aiChatHistoryUi']['updateItems'](_0x100381);}['_setItemLoading'](_0x4205c1,_0x16ff1a){this['_aiChatHistoryUi']['updateItemLoadingState'](_0x4205c1,_0x16ff1a,!0x0);}['_clearItemLoading'](_0x51a0e7){this['_aiChatHistoryUi']['updateItemLoadingState'](_0x51a0e7,null,!0x1);}['_handleHistoryErrorUI'](_0x59c251,_0xa28080,_0xa9605e){const _0x4b51fc=this['_generateErrorMessage'](_0xa28080,_0xa9605e);this['_aiChatHistoryUi']['showError'](_0x4b51fc),_0xa9605e&&this['_clearItemLoading'](_0xa9605e),this['_aiChatHistoryUi']['setLoadingSkeleton'](!0x1);}['_generateErrorMessage'](_0x312faa,_0x4175e7){const _0x825558=_0x4175e7?this['history']['getItem'](_0x4175e7):null,_0x2597be=_0x825558?.['title']||$n(this['context']['locale'],'AI_CHAT_UNTITLED_CONVERSATION');switch(_0x312faa){case'updateItemTitle':return $n(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_UPDATE_TITLE',_0x2597be);case'updateItemPinned':{const _0x320c76=$n(this['context']['locale'],_0x825558?.['pinned']?'AI_CHAT_HISTORY_UNPIN_ACTION':'AI_CHAT_HISTORY_PIN_ACTION');return $n(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_UPDATE_PINNED',[_0x320c76,_0x2597be]);}case'removeItem':return $n(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_REMOVE_ITEM',_0x2597be);case'init':case'loadItems':return $n(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_LOAD_ITEMS');default:return $n(this['context']['locale'],'AI_CHAT_HISTORY_ERROR_GENERIC');}}['_getCategorizedItems'](){const _0x1f8b5a=new Date(),_0xab23db=new Date(_0x1f8b5a['getFullYear'](),_0x1f8b5a['getMonth'](),_0x1f8b5a['getDate']()),_0x1d1431=new Date(_0xab23db);_0x1d1431['setDate'](_0x1d1431['getDate']()-0x1);const _0x13b0ba=new Date(_0xab23db);_0x13b0ba['setDate'](_0x13b0ba['getDate']()-0xe);const _0x340b13=this['history']['getItems']({'pinned':!0x0}),_0xecbe31=this['history']['getItems']({'from':_0xab23db,'to':_0xab23db}),_0x188576=this['history']['getItems']({'from':_0x1d1431,'to':_0x1d1431}),_0x5bce10=this['history']['getItems']({'from':_0x13b0ba,'to':_0x1d1431}),_0x629890=this['history']['getItems']({'to':_0x13b0ba}),_0x54ae90=[];return _0x340b13['length']>0x0&&_0x54ae90['push']({'title':$n(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_PINNED'),'items':_0x340b13}),_0xecbe31['length']>0x0&&_0x54ae90['push']({'title':$n(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_TODAY'),'items':_0xecbe31}),_0x188576['length']>0x0&&_0x54ae90['push']({'title':$n(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_YESTERDAY'),'items':_0x188576}),_0x5bce10['length']>0x0&&_0x54ae90['push']({'title':$n(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_LAST_14_DAYS'),'items':_0x5bce10}),_0x629890['length']>0x0&&_0x54ae90['push']({'title':$n(this['context']['locale'],'AI_CHAT_HISTORY_CATEGORY_LATER'),'items':_0x629890}),_0x54ae90;}['_setIsMaximized'](_0x3b8f38){this['_aiChatHistoryUi']['setIsMaximized'](_0x3b8f38);}}class st extends _0x56fd8d{static get['requires'](){return[jt,xt];}static get['pluginName'](){return'AIChatHistory';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}class Ca extends _0x56fd8d{static get['requires'](){return[et,O,at,st];}static get['pluginName'](){return'AIChat';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x263eb8){super(_0x263eb8);const _0x3bd85a=_0x263eb8['config'];_0x3bd85a['define']('ai.chat.context',{'document':{'enabled':!0x0},'urls':{'enabled':!0x0},'files':{'enabled':!0x0},'sources':[]}),_0x3bd85a['define']('ai.chat.models',{'defaultModelId':void 0x0,'modelSelectorAlwaysVisible':!0x0,'displayedModels':void 0x0});}async['addSelectionToChatContext'](){await this['context']['plugins']['get'](et)['addSelectionToChatContext']();}async['startConversation'](){await this['context']['plugins']['get'](et)['startConversation']();}async['sendMessage']({message:_0x36598c,quickActionData:_0x8e6d78}){await this['context']['plugins']['get'](et)['sendMessage']({'message':_0x36598c,'quickActionData':_0x8e6d78});}['removeSelectionFromChatContext'](){this['context']['plugins']['get'](et)['removeSelectionFromChatContext']();}['focusPromptInput'](){this['context']['plugins']['get'](et)['focusPromptInput']();}}class eo extends Nt{constructor(_0x1b4818){super(_0x1b4818);const _0x5cd0c1=_0x1b4818['plugins']['get']('AITabs')['view'];this['bind']('value')['to'](_0x5cd0c1,'isVisible'),this['isEnabled']=!0x0;}['execute'](){const _0x8ecade=this['editor']['plugins']['get']('AITabs')['view'];_0x8ecade['isVisible']=!_0x8ecade['isVisible'];}}class bt extends _0x3eae20{static get['requires'](){return[ht];}static get['pluginName'](){return'AIToggleButtonUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const _0x15a042=this['editor'];_0x15a042['commands']['add']('toggleAi',new eo(_0x15a042)),_0x15a042['ui']['componentFactory']['add']('toggleAi',()=>{const _0x2837f4=this['_createAIUIButton'](_0x23128a);return _0x2837f4['set']({'tooltip':!0x0,'class':'ck-ai-toggle-button'}),_0x2837f4;}),_0x15a042['ui']['componentFactory']['add']('menuBar:toggleAi',()=>{const _0x237545=this['_createAIUIButton'](_0x2ec6d8);return _0x237545['set']({'role':'menuitemcheckbox'}),_0x237545;});}['_createAIUIButton'](_0x1f7b65){const _0x5bf3ff=this['editor'],_0x1503d6=_0x5bf3ff['commands']['get']('toggleAi'),_0x56f950=new _0x1f7b65(_0x5bf3ff['locale']);return _0x56f950['set']({'label':$n(_0x5bf3ff['locale'],'AI_TOGGLE_BUTTON_LABEL'),'icon':Ut,'isToggleable':!0x0}),_0x56f950['bind']('isEnabled')['to'](_0x1503d6),_0x56f950['bind']('isOn')['to'](_0x1503d6,'value',_0x25220a=>!!_0x25220a),this['listenTo'](_0x56f950,'execute',()=>{_0x1503d6['execute']();}),_0x56f950;}}class wa extends _0x3eae20{static get['requires'](){return[bt];}static get['pluginName'](){return'AIEditorIntegration';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}function i(_0x1a31d1,_0x2517a1,_0x4f1c8f){const t=_0x1a31d1['t'];switch(_0x2517a1){case'AI_QUICK_ACTIONS_HEADING':return t({'id':'AI_QUICK_ACTIONS_HEADING','string':'AI\x20Quick\x20Actions'});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_PLUGIN_NOT_FOUND':return t({'id':'AI_QUICK_ACTIONS_PLUGIN_NOT_FOUND','string':'%0\x20plugin\x20is\x20required\x20but\x20not\x20found.'},_0x4f1c8f);case'AI_QUICK_ACTIONS_OTHER':return t({'id':'AI_QUICK_ACTIONS_OTHER','string':'Other'});default:return _0x2517a1;}}function zt(_0x3dbd14,_0x4e6011,_0xbd7e5e=!0x1,_0x5938a4=!0x0){return()=>{const _0x1ba9a6=_0x3dbd14['locale'],_0x145df3=new _0x23128a(_0x1ba9a6),_0x5d75ae=_0x145df3['bindTemplate'];_0x145df3['extendTemplate']({'on':{'mouseenter':_0x5d75ae['to'](()=>{_0x145df3['focus']();})}});const _0x37a7b9=_0x4e6011['icon']??_0x4e6011['parent']?.['icon'];return _0x145df3['set']({'label':_0x4e6011['displayedPrompt'],'withText':_0xbd7e5e,'role':'menuitem','icon':_0x5938a4?_0x37a7b9??_0xb3bd09:void 0x0,'tooltip':!_0xbd7e5e}),_0x145df3['on']('execute',()=>{_0x3dbd14['editing']['view']['focus'](),_0x3dbd14['commands']['execute']('aiQuickAction',_0x4e6011);}),_0x145df3;};}const qs='menu',ys='menuitem';class io extends _0x4118d8{['_bodyCollection'];['optionsListView'];['focusTracker'];['keystrokes'];['_focusables'];['focusCycler'];['_openNestedPanels']=new Set();constructor(_0x460205,_0x21ba0d,_0x157e9c,_0x2efbc4){const _0x28c608=_0x460205['locale'];super(_0x28c608),this['_bodyCollection']=_0x2efbc4;const _0x16e428=this['_createListItems'](_0x460205,_0x21ba0d,_0x157e9c);this['optionsListView']=new _0x1626c8(_0x28c608),this['optionsListView']['role']=qs,this['optionsListView']['items']['addMany'](_0x16e428),this['focusTracker']=new _0xc5fc70(),this['keystrokes']=new _0x464bf0(),this['_focusables']=_0x16e428,this['focusCycler']=new _0x53ec2a({'focusables':this['_focusables'],'focusTracker':this['focusTracker'],'keystrokeHandler':this['keystrokes']}),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset_all','ck-ai-quick-actions','ck-rounded-corners'],'dir':_0x28c608['uiLanguageDirection']},'children':[this['optionsListView']]});}['_createListItems'](_0x59a5b7,_0x46e450,_0x15903e){const _0x363cc2=new _0x260fed();return _0x46e450['forEach'](_0x80c5b9=>{'actions'in _0x80c5b9?_0x363cc2['add'](this['_createActionGroupButton'](_0x59a5b7,_0x80c5b9,_0x15903e)):_0x363cc2['add'](this['_createActionButton'](_0x59a5b7,_0x80c5b9));}),_0x363cc2;}['_createActionButton'](_0xe97638,_0x237fbc){const _0x2e1b9a=new _0x470a68(this['locale']),_0x2fd8a3=zt(_0xe97638,_0x237fbc,!0x0)();return _0x2e1b9a['children']['add'](_0x2fd8a3),_0x2e1b9a;}['_createActionGroupButton'](_0x59d07b,_0x220340,_0xb8f6e7){const _0xf4df5=new _0x470a68(this['locale']),_0x2a288d=new _0x46204d(this['locale']),_0x1830e7=_0x2a288d['bindTemplate'],_0x52face='rtl'===_0xb8f6e7['locale']['uiLanguageDirection']?'ArrowRight':'ArrowLeft',_0x2e4c0c=this['_createGroupActionsList'](_0x59d07b,_0x220340['actions'],_0xb8f6e7);_0x2a288d['set']({'label':_0x220340['label'],'withText':!0x0,'role':ys,'icon':_0x220340['icon']??_0xb3bd09}),_0x2a288d['extendTemplate']({'on':{'mouseenter':_0x1830e7['to'](()=>{_0x2a288d['focus']();})}});const _0x29a2f1=new _0xef9d9e(this['locale']);return _0x29a2f1['extendTemplate']({'attributes':{'class':['ck','ck-reset_all','ck-ai-quick-actions-group-panel','ck-dropdown-menu__nested-menu__panel']},'on':{'keydown':_0x1830e7['to'](_0x2e3bff=>{_0x2e3bff['key']==_0x52face&&(_0x2a288d['focus'](),this['_hideNestedPanel'](_0x29a2f1));})}}),_0x2a288d['bind']('isOn')['to'](_0x29a2f1,'isVisible'),this['_bodyCollection']['add'](_0x29a2f1),_0x29a2f1['content']['add'](_0x2e4c0c),this['_setupGroupMenuBehavior'](_0x2a288d,_0x29a2f1),_0xf4df5['children']['add'](_0x2a288d),_0xf4df5;}['_createGroupActionsList'](_0x56743c,_0x5a0a35,_0x1ae8c1){const _0x372c15=new _0x1626c8(this['locale']);return _0x372c15['extendTemplate']({'attributes':{'class':['ck','ck-reset_all','ck-ai-quick-actions-group-list','ck-dropdown-menu-list']}}),_0x5a0a35['forEach'](_0x26ee5b=>{const _0x7bd289=new _0x470a68(this['locale']),_0x985c9d=zt(_0x56743c,_0x26ee5b,!0x0,!0x1)();_0x7bd289['children']['add'](_0x985c9d),_0x1ae8c1['focusTracker']['add'](_0x985c9d),_0x372c15['items']['add'](_0x7bd289);}),_0x372c15;}['_setupGroupMenuBehavior'](_0xcf67bd,_0x54b971){const _0x4c4ed4=_0xcf67bd['bindTemplate'],_0x565cd5='rtl'===_0xcf67bd['locale']['uiLanguageDirection']?'ArrowLeft':'ArrowRight';_0xcf67bd['extendTemplate']({'attributes':{'class':['ck-ai-quick-actions-group-button']},'on':{'mouseenter':_0x4c4ed4['to'](()=>{this['_showNestedPanel'](_0x54b971,_0xcf67bd);}),'mouseleave':_0x4c4ed4['to'](_0x18eaa0=>{const _0xc8679b=_0x18eaa0['relatedTarget'];this['_isMovingToNestedMenu'](_0xc8679b,_0x54b971)||this['_hideNestedPanel'](_0x54b971);}),'keydown':_0x4c4ed4['to'](_0x46bffd=>{_0x46bffd['key']==_0x565cd5&&(this['_showNestedPanel'](_0x54b971,_0xcf67bd),_0x54b971['content']['get'](0x0)['focus']());})}}),_0x54b971['on']('render',()=>{_0x54b971['element']?.['addEventListener']('mouseleave',_0x1ad9da=>{const _0x43b6e6=_0x1ad9da['relatedTarget'];_0xcf67bd['element']?.['contains'](_0x43b6e6)||this['_isMovingToNestedMenu'](_0x43b6e6,_0x54b971)||this['_hideNestedPanel'](_0x54b971);});});}['_showNestedPanel'](_0x3195ea,_0x35eefd){this['_openNestedPanels']['forEach'](_0x4d9084=>{_0x4d9084!==_0x3195ea&&_0x4d9084['isVisible']&&_0x4d9084['hide']();}),_0x3195ea['show'](),_0x3195ea['pin']({'positions':[_0x4f453b['eastSouth']],'target':_0x35eefd['element'],'fitInViewport':!0x0}),this['_openNestedPanels']['add'](_0x3195ea);}['_hideNestedPanel'](_0x43da9c){_0x43da9c['hide'](),this['_openNestedPanels']['delete'](_0x43da9c);}['_hideAllNestedPanels'](){this['_openNestedPanels']['forEach'](_0x1f3c6b=>_0x1f3c6b['hide']()),this['_openNestedPanels']['clear']();}['_isMovingToNestedMenu'](_0xd546cd,_0x3c015b){if(!_0xd546cd)return!0x1;if(_0x3c015b['element']?.['contains'](_0xd546cd))return!0x0;const _0x28e9b2=_0xd546cd;return _0x28e9b2['closest']&&(null!==_0x28e9b2['closest']('.ck-ai-quick-actions-group-panel')||null!==_0x28e9b2['closest']('.ck-ai-quick-actions-group-list')||null!==_0x28e9b2['closest']('.ck-ai-quick-actions-group-button'));}['destroy'](){this['_hideAllNestedPanels'](),this['_bodyCollection']['detachFromDom'](),super['destroy']();}['focus'](){this['optionsListView']['focus']();}}function Ft(_0x251a0c,_0x44ca33,_0x14534a,_0x2cf91b){return()=>{const _0x1c309d=_0x251a0c['locale'],_0x463ad3=_0x820be6(_0x1c309d);_0x463ad3['buttonView']['set']({'icon':_0x14534a['icon']??_0xb3bd09,'label':_0x14534a['label'],'tooltip':!0x0}),_0x463ad3['set']({'class':'ck-ai-quick-actions-dropdown'});const _0x572ca9=new io(_0x251a0c,_0x44ca33,_0x463ad3,_0x2cf91b);return _0x463ad3['panelView']['children']['add'](_0x572ca9),_0x463ad3;};}const Vt='<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>',Xt='<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>',Zt='<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 Ot=function(_0x3f6e55){return _0x3f6e55['CHAT']='CHAT',_0x3f6e55['ACTION']='ACTION',_0x3f6e55['REVIEW']='REVIEW',_0x3f6e55;}({}),fa=function(_0x1f8c24){return _0x1f8c24['CHAT']='AIChat',_0x1f8c24['ACTION']='AIActions',_0x1f8c24['REVIEW']='AIReviewMode',_0x1f8c24;}({});class ii extends _0x3eae20{static get['requires'](){return[Jt];}static get['pluginName'](){return'AIQuickActionsUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){this['_prepareQuickActionsDefinition'](this['_getDefaultAndCustomActions']()),this['_initializeQuickActionsComponentsAndCommands']();}static['getDefaultQuickActions'](_0x1dfedb){return function(_0x4ea62b){const _0x4b2e64=new Intl['DisplayNames'](['en'],{'type':'language'})['of'](_0x4ea62b['uiLanguage']),_0x72d36c=_0x4b2e64||'English',_0x15adab=[{'id':'ask-ai','displayedPrompt':i(_0x4ea62b,'AI_QUICK_ACTIONS_ASK_AI'),'type':'CHAT','icon':Ut},{'id':'chat-commands','label':i(_0x4ea62b,'AI_QUICK_ACTIONS_CHAT_COMMANDS'),'icon':Mt,'actions':[{'id':'explain','displayedPrompt':i(_0x4ea62b,'AI_QUICK_ACTIONS_EXPLAIN'),'prompt':Vt['replace']('%0',_0x72d36c),'type':'CHAT'},{'id':'summarize','displayedPrompt':i(_0x4ea62b,'AI_QUICK_ACTIONS_SUMMARIZE'),'prompt':Xt['replace']('%0',_0x72d36c),'type':'CHAT'},{'id':'highlight-key-points','displayedPrompt':i(_0x4ea62b,'AI_QUICK_ACTIONS_HIGHLIGHT_KEY_POINTS'),'prompt':Zt['replace']('%0',_0x72d36c),'type':'CHAT'}]},{'id':'improve-writing','displayedPrompt':i(_0x4ea62b,'AI_QUICK_ACTIONS_IMPROVE_WRITING'),'type':'ACTION','icon':Yt},{'id':'continue','displayedPrompt':i(_0x4ea62b,'AI_QUICK_ACTIONS_CONTINUE_WRITING'),'type':'ACTION','icon':Lt},{'id':'fix-grammar','displayedPrompt':i(_0x4ea62b,'AI_QUICK_ACTIONS_FIX_GRAMMAR_SPELLING'),'type':'ACTION','icon':Dt},{'id':'adjust-length','label':i(_0x4ea62b,'AI_QUICK_ACTIONS_ADJUST_LENGTH'),'icon':Qt,'actions':[{'id':'make-shorter','displayedPrompt':i(_0x4ea62b,'AI_QUICK_ACTIONS_MAKE_SHORTER'),'type':'ACTION'},{'id':'make-longer','displayedPrompt':i(_0x4ea62b,'AI_QUICK_ACTIONS_MAKE_LONGER'),'type':'ACTION'}]},{'id':'change-tone','label':i(_0x4ea62b,'AI_QUICK_ACTIONS_CHANGE_TONE'),'icon':Kt,'actions':[{'id':'make-tone-casual','displayedPrompt':i(_0x4ea62b,'AI_QUICK_ACTIONS_MORE_CASUAL'),'type':'ACTION'},{'id':'make-tone-direct','displayedPrompt':i(_0x4ea62b,'AI_QUICK_ACTIONS_MORE_DIRECT'),'type':'ACTION'},{'id':'make-tone-friendly','displayedPrompt':i(_0x4ea62b,'AI_QUICK_ACTIONS_MORE_FRIENDLY'),'type':'ACTION'},{'id':'make-tone-confident','displayedPrompt':i(_0x4ea62b,'AI_QUICK_ACTIONS_MORE_CONFIDENT'),'type':'ACTION'},{'id':'make-tone-professional','displayedPrompt':i(_0x4ea62b,'AI_QUICK_ACTIONS_MORE_PROFESSIONAL'),'type':'ACTION'}]},{'id':'translate','label':i(_0x4ea62b,'AI_QUICK_ACTIONS_TRANSLATE'),'icon':Gt,'actions':[{'id':'translate-to-english','displayedPrompt':i(_0x4ea62b,'AI_QUICK_ACTIONS_TRANSLATE_ENGLISH'),'type':'ACTION','actionName':'translate','args':{'language':'english'}},{'id':'translate-to-chinese','displayedPrompt':i(_0x4ea62b,'AI_QUICK_ACTIONS_TRANSLATE_CHINESE'),'type':'ACTION','actionName':'translate','args':{'language':'chinese'}},{'id':'translate-to-french','displayedPrompt':i(_0x4ea62b,'AI_QUICK_ACTIONS_TRANSLATE_FRENCH'),'type':'ACTION','actionName':'translate','args':{'language':'french'}},{'id':'translate-to-japanese','displayedPrompt':i(_0x4ea62b,'AI_QUICK_ACTIONS_TRANSLATE_JAPANESE'),'type':'ACTION','actionName':'translate','args':{'language':'japanese'}},{'id':'translate-to-portuguese','displayedPrompt':i(_0x4ea62b,'AI_QUICK_ACTIONS_TRANSLATE_PORTUGUESE'),'type':'ACTION','actionName':'translate','args':{'language':'portuguese'}},{'id':'translate-to-korean','displayedPrompt':i(_0x4ea62b,'AI_QUICK_ACTIONS_TRANSLATE_KOREAN'),'type':'ACTION','actionName':'translate','args':{'language':'korean'}},{'id':'translate-to-italian','displayedPrompt':i(_0x4ea62b,'AI_QUICK_ACTIONS_TRANSLATE_ITALIAN'),'type':'ACTION','actionName':'translate','args':{'language':'italian'}},{'id':'translate-to-russian','displayedPrompt':i(_0x4ea62b,'AI_QUICK_ACTIONS_TRANSLATE_RUSSIAN'),'type':'ACTION','actionName':'translate','args':{'language':'russian'}}]},{'id':'other','label':i(_0x4ea62b,'AI_QUICK_ACTIONS_OTHER'),'icon':qt,'actions':[]}];return _0x15adab;}(_0x1dfedb);}['_getDefaultAndCustomActions'](){const _0x457c5d=ii['getDefaultQuickActions'](this['editor']['locale']),_0x4e48bf=(this['editor']['config']['get']('ai.quickActions.extraCommands')||[])['map'](_0x354691=>({..._0x354691,'icon':void 0x0}));return _0x457c5d['find'](_0x40390e=>'other'===_0x40390e['id'])['actions']['push'](..._0x4e48bf),_0x457c5d;}['_initializeQuickActionsComponentsAndCommands'](){const _0x33e6ad=new Wt(this['editor']['locale']);_0x33e6ad['attachToDom'](),this['_initializeQuickActionsDropdown'](_0x33e6ad),this['_initializeQuickActionsComponents'](_0x33e6ad);}['_initializeQuickActionsDropdown'](_0x46b3fd){this['editor']['ui']['componentFactory']['add']('aiQuickActions',Ft(this['editor'],this['_quickActionsDefinition'],{'icon':_0xb3bd09,'label':i(this['editor']['locale'],'AI_QUICK_ACTIONS_HEADING')},_0x46b3fd));}['_prepareQuickActionsDefinition'](_0x61d1e3){this['_quickActionsDefinition']=_0x61d1e3['map'](_0x1852c4=>{if('actions'in _0x1852c4){const _0x1fa70c=_0x1852c4;return{..._0x1fa70c,'actions':_0x1fa70c['actions']['map'](_0x425af6=>{const {actions:_0x1d2144,..._0x42a8b8}=_0x1fa70c;return{..._0x425af6,'parent':_0x42a8b8};})['filter'](_0x569d91=>this['_shouldIncludeAction'](_0x569d91))};}return _0x1852c4;})['filter'](_0x549236=>'actions'in _0x549236?_0x549236['actions']['length']>0x0:this['_shouldIncludeAction'](_0x549236));}['_shouldIncludeAction'](_0x4d1bfb){const _0xed1c0d=this['editor']['config']['get']('ai.quickActions.removeCommands')||[];return this['editor']['plugins']['has'](fa[_0x4d1bfb['type']])&&!_0xed1c0d['includes'](_0x4d1bfb['id']);}['_initializeQuickActionsComponents'](_0x295e9c){this['_quickActionsDefinition']['forEach'](_0x1c4f5c=>{if('actions'in _0x1c4f5c){const _0x2fa621=Ft(this['editor'],_0x1c4f5c['actions'],_0x1c4f5c,_0x295e9c);this['editor']['ui']['componentFactory']['add'](_0x1c4f5c['id'],_0x2fa621),_0x1c4f5c['actions']['forEach'](_0x1f5b03=>{const _0x39ab40=zt(this['editor'],_0x1f5b03);this['editor']['ui']['componentFactory']['add'](_0x1f5b03['id'],_0x39ab40);});}else{const _0x5f48d3=zt(this['editor'],_0x1c4f5c);this['editor']['ui']['componentFactory']['add'](_0x1c4f5c['id'],_0x5f48d3);}});}}class ci extends Nt{['execute'](_0x363600){switch(_0x363600['type']){case Ot['CHAT']:if(!this['editor']['plugins']['has']('AIChat')){const _0x4967c0=i(this['editor']['locale'],'AI_QUICK_ACTIONS_PLUGIN_NOT_FOUND','AIChat');throw new _0x58ed45('ai-quick-actions-plugin-not-found',this['editor'],{'errorMessage':_0x4967c0});}this['_handleAIChatAction'](_0x363600);break;case Ot['ACTION']:if(!this['editor']['plugins']['has']('AIActions')){const _0x6be855=i(this['editor']['locale'],'AI_QUICK_ACTIONS_PLUGIN_NOT_FOUND','AIActions');throw new _0x58ed45('ai-quick-actions-plugin-not-found',this['editor'],{'errorMessage':_0x6be855});}this['_handleAIActionsAction'](_0x363600);break;case Ot['REVIEW']:if(!this['editor']['plugins']['has']('AIReviewMode')){const _0x3922ea=i(this['editor']['locale'],'AI_QUICK_ACTIONS_PLUGIN_NOT_FOUND','AIReviewMode');throw new _0x58ed45('ai-quick-actions-plugin-not-found',this['editor'],{'errorMessage':_0x3922ea});}this['_handleAIReviewAction'](_0x363600);}}async['_handleAIChatAction'](_0x4777cd){const _0x22c362=this['editor']['plugins']['get']('AIChat'),_0x2c0fae=this['editor']['plugins']['get']('AIChatController');if(this['editor']['plugins']['get']('AITabs')['view']['activateTab']('chat'),'ask-ai'===_0x4777cd['id'])_0x2c0fae['removeSelectionFromChatContext'](),this['_expandSelectionIfCollapsed'](),await _0x22c362['addSelectionToChatContext'](),_0x22c362['focusPromptInput']();else await _0x22c362['startConversation'](),await _0x22c362['addSelectionToChatContext'](),await _0x22c362['sendMessage']({'message':_0x4777cd['prompt']||_0x4777cd['displayedPrompt'],'quickActionData':{'id':_0x4777cd['id'],'displayedPrompt':_0x4777cd['displayedPrompt']}});}['_expandSelectionIfCollapsed'](){const _0x459378=this['editor'],_0x37927b=_0x459378['model']['document']['selection'];if(!_0x37927b['isCollapsed'])return;const _0x412cb8=_0x2f52df(_0x37927b['getSelectedBlocks']())||_0x459378['model']['schema']['getLimitElement'](_0x37927b);_0x459378['model']['change'](_0xc21a93=>{_0xc21a93['setSelection'](_0x412cb8,'in');});}['_handleAIActionsActionLabel'](_0xbcce11){return _0xbcce11['parent']?.['label']&&'other'!==_0xbcce11['parent']?.['id']?_0xbcce11['parent']['label']+':\x20'+_0xbcce11['displayedPrompt']:_0xbcce11['displayedPrompt'];}async['_handleAIActionsAction'](_0x52b23f){const _0x2df690=this['editor']['plugins']['get']('AIActions'),_0x4da539=_0x52b23f['prompt']?{'userMessage':_0x52b23f['prompt'],'model':_0x52b23f['model']}:{'actionName':_0x52b23f['actionName']||_0x52b23f['id'],'args':_0x52b23f['args']},_0x350d16=this['_handleAIActionsActionLabel'](_0x52b23f);await _0x2df690['executeAction'](_0x4da539,_0x350d16,_0x52b23f['icon']);}async['_handleAIReviewAction'](_0x59d17e){console['log']('handleAIReviewAction',_0x59d17e);}}class ti extends _0x3eae20{static get['pluginName'](){return'AIQuickActionsEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const _0x7899b2=this['editor'],_0x488f4d=new ci(this['editor']);if(_0x7899b2['commands']['add']('aiQuickAction',_0x488f4d),_0x7899b2['plugins']['has']('AIChat')){const _0x3e8995=this['editor']['plugins']['get']('AIChat');_0x7899b2['model']['document']['selection']['on']('change:range',(_0x4ec4b1,_0x22e181)=>{_0x22e181['directChange']&&_0x3e8995['removeSelectionFromChatContext']();});}}}class Oa extends _0x3eae20{static get['requires'](){return[ii,ti];}static get['pluginName'](){return'AIQuickActions';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x3340b8){super(_0x3340b8),_0x3340b8['config']['define']('ai.quickActions',{'extraCommands':[],'removeCommands':[]});}}class Ce extends fe{['updateChangeGroups'](){if(this['parsedMergedContent']=this['parsedContent']['cloneNode'](!0x0),0x0==this['parsedMergedContent']['childNodes']['length'])return void(this['changeGroups']=[]);const _0x2ecc87=this['documentContextContent']['children']['map'](_0x325d3d=>({'node':_0x325d3d,'id':ft(_0x325d3d,'data-id')})),_0x5d27b0=this['parsedMergedContent']['children']['map'](_0x9e0f54=>({'node':_0x9e0f54,'id':ft(_0x9e0f54,'data-id')||_0x2ef42f()})),_0x1374e8=_0x546d51(_0x2ecc87,_0x5d27b0,{'comparator':(_0x262b55,_0x2e37ad)=>_0x262b55['id']==_0x2e37ad['id'],'oneChangePerToken':!0x0});if(!this['isDone']){for(;_0x1374e8['length']&&_0x1374e8[_0x1374e8['length']-0x1]['removed'];)_0x1374e8['pop']();}const _0x4a4fec=_0x1374e8['map'](_0x5c606e=>{const _0x557eeb=_0x5c606e['added']?'new':_0x5c606e['removed']?'removed':'modified';return{'node':_0x5c606e['value'][0x0]['node'],'type':_0x557eeb,'id':_0x5c606e['value'][0x0]['id']};});this['changeGroups']=[{'changes':_0x4a4fec,'state':'pending','index':0x0}];}['_getDifferentChangeGroups'](_0x4a3ba0,_0x1b6582){return _0x1b6582;}}class q extends ge{['content'];['version'];['actionName'];['args'];['userMessage'];['model'];constructor(_0x574ec9){super(_0x574ec9),this['content']=_0x574ec9['content'],this['version']=_0x574ec9['version'],this['actionName']=_0x574ec9['actionName'],this['args']=_0x574ec9['args'],this['userMessage']=_0x574ec9['userMessage'],this['model']=_0x574ec9['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':ye['TEXT'],'content':this['content'],'version':this['version'],'label':'Current\x20document','uiId':'current-document'};}['createReply'](_0x385945){const _0x2a7923=new Ce({'editor':this['editor'],'documentContextContent':this['content'],..._0x385945});return this['replies']['push'](_0x2a7923),_0x2a7923['delegate'](...xe)['to'](this),this['fire']('replyCreated',_0x2a7923),_0x2a7923;}}class Sa extends _0x3eae20{static get['requires'](){return[N,_0x31f025,O,W,_0x104527];}static get['pluginName'](){return'AIActions';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['_aiConnector'];['_previousInteractions']=[];['_currentInteractionParams'];['_balloonShowDiff']=!0x1;['_customViews']=new _0x260fed();['_promiseQueue'];constructor(_0x127a6b){super(_0x127a6b),this['_aiConnector']=this['editor']['plugins']['get']('AIConnector'),this['set']('isBusy',!0x1),this['_promiseQueue']=new Q(),this['_setupCustomViews']();}['stopInteraction'](){this['_stopInteraction']();}get['previousInteractions'](){return this['_previousInteractions'];}async['executeAction'](_0x4e60ee,_0x58008e,_0x2f3195){if(this['editor']['plugins']['has']('TableSelection')){if(this['editor']['plugins']['get']('TableSelection')['getSelectedTableCells']()){const {modelFragment:_0x53a7af,anchorData:_0x49b2d2}=this['_getExecuteDataInTable']();return this['_executeAction'](_0x4e60ee,_0x53a7af,_0x49b2d2,_0x58008e,_0x2f3195);}}const {modelFragment:_0x2b25cf,anchorData:_0x207ea3}=this['_getExecuteDataRegular']();return this['_executeAction'](_0x4e60ee,_0x2b25cf,_0x207ea3,_0x58008e,_0x2f3195);}['_getExecuteDataRegular'](){const _0xb0cedf=this['editor']['model']['document']['selection'];if(_0xb0cedf['isCollapsed']){const _0x55b33b=_0x2f52df(_0xb0cedf['getSelectedBlocks']())||this['editor']['model']['schema']['getLimitElement'](_0xb0cedf);this['editor']['model']['change'](_0x1dc8c8=>{_0x1dc8c8['setSelection'](_0x55b33b,'in');});}const _0x4e9300=_0xb0cedf['getFirstRange'](),_0x45d3a9=this['_wrapWithCommonAncestors'](this['editor']['model']['getSelectedContent'](_0xb0cedf),_0x4e9300['start'],_0x4e9300['end']),_0x22d4ff=_0xb0cedf['getFirstRange']()['start'],_0x1893b=new Map();let _0x4b3a8f=_0x45d3a9;for(let _0x288ee9=0x0;_0x288ee9<_0x22d4ff['path']['length'];_0x288ee9++)_0x1893b['set'](_0x4b3a8f,_0x22d4ff['path'][_0x288ee9]),_0x4b3a8f=_0x4b3a8f['getChild'](0x0);return{'modelFragment':_0x45d3a9,'anchorData':_0x1893b};}['_getExecuteDataInTable'](){const _0x1c6243=this['editor']['model']['document']['selection'],_0x16e320=this['editor']['plugins']['get']('TableSelection')['getSelectionAsFragment'](),_0x1605e7=_0x1c6243['getFirstRange']()['start']['parent']['parent'],_0x3b5f08=this['_wrapWithCommonAncestors'](_0x16e320,this['editor']['model']['createPositionBefore'](_0x1605e7),this['editor']['model']['createPositionAfter'](_0x1605e7)),_0x1b56f5=_0x1c6243['getFirstRange']()['start'],_0x3d3c51=new Map();let _0x9ff11a=_0x3b5f08;for(let _0x2e8d92=0x0;_0x2e8d92<_0x1b56f5['path']['length'];_0x2e8d92++)if(_0x3d3c51['set'](_0x9ff11a,_0x1b56f5['path'][_0x2e8d92]),_0x2e8d92<_0x1b56f5['path']['length']-0x1)_0x9ff11a=_0x9ff11a['getChild'](0x0);else{let _0x4a10f0=_0x9ff11a['nextSibling'];for(;_0x4a10f0;)_0x3d3c51['set'](_0x4a10f0,_0x1b56f5['path'][_0x2e8d92]),_0x4a10f0=_0x4a10f0['nextSibling'];}return{'modelFragment':_0x3b5f08,'anchorData':_0x3d3c51};}['_executeAction'](_0x3d620b,_0x153b8c,_0xfb169c,_0x11a670,_0x146518){const _0x278543=this['editor']['plugins']['get'](O),_0x31fa41=this['editor']['plugins']['get'](W),_0x587f57=this['editor']['model']['document']['selection'],_0x2b97eb=_0x278543['modelToViewWithIds'](_0x153b8c),_0x1ed90a=this['editor']['data']['processor']['toData'](_0x2b97eb),_0x29c14c=this['editor']['model']['document']['version'],_0x5c701a=[..._0x587f57['getRanges']()],_0x18ce4e=new F(this['editor']['locale'],{'showDiff':!0x1,'areActionsDisabled':!0x1,'hideHeader':!0x0,'showLoader':!0x0,'miniToolbarConfig':{'showChanges':'icon','customView':this['_customViews']},'showUnchangedParts':!0x0});return _0x31fa41['open']({'index':0x3e8*Math['random']()%0x3e8,'title':_0x11a670,'icon':_0x146518||_0xb3bd09,'mainView':_0x18ce4e,'showRotator':!0x1,'showApplyButton':!0x0,'showSuggestButton':!0x0,'ranges':_0x5c701a}),this['_setLoadingState'](_0x18ce4e,_0x31fa41),this['listenTo'](_0x31fa41,'applySuggestion',()=>{this['_applyChanges'](_0x153b8c,_0xfb169c,!0x1);}),this['listenTo'](_0x31fa41,'insertSuggestion',()=>{this['_applyChanges'](_0x153b8c,_0xfb169c,!0x0);}),this['listenTo'](_0x31fa41,'dialogClosed',()=>{this['_stopInteraction'](),this['_clearInteractionHistory'](),this['stopListening'](_0x31fa41);}),this['_createInteraction'](_0x1ed90a,_0x29c14c,_0x18ce4e,_0x31fa41,_0x3d620b);}['_wrapWithCommonAncestors'](_0x36e392,_0x486ef1,_0x34e938){const _0x3f2832=this['editor']['model']['createRange'](_0x486ef1,_0x34e938)['getCommonAncestor'](),_0x70b574=_0x3f2832['is']('documentFragment')?[]:_0x3f2832['getAncestors']({'includeSelf':!0x0})['slice'](0x1);if(_0x70b574['length']){const _0x2d6ad8=_0x70b574['map'](_0x32daa3=>_0x32daa3['_clone'](!0x1));for(let _0x27b1df=0x1;_0x27b1df<_0x2d6ad8['length'];_0x27b1df++)_0x2d6ad8[_0x27b1df-0x1]['_appendChild'](_0x2d6ad8[_0x27b1df]);return _0x2d6ad8[_0x2d6ad8['length']-0x1]['_appendChild'](_0x36e392),new _0xc93263(_0x2d6ad8[0x0]);}return _0x36e392;}async['_createInteraction'](_0x2132b0,_0x2fdeec,_0x4db83b,_0x2455b2,_0xa6939a){const _0x29f811=this['editor'];this['_currentInteractionParams']={'action':_0xa6939a,'content':_0x2132b0,'version':_0x2fdeec,'mainView':_0x4db83b,'aiBalloon':_0x2455b2},this['_interaction']=new q({'connector':this['_aiConnector'],'editor':_0x29f811,'content':_0x2132b0,'version':_0x2fdeec,..._0xa6939a});const _0x17e87d=(_0x57a31f,_0x10293e,_0x2e147e=!0x1,_0xa8639c='streaming')=>this['_promiseQueue']['enqueue'](async _0x14af1b=>{try{const _0x484855=Y({'editor':_0x29f811,'changeGroups':_0x57a31f['changeGroups'],'documentContextContent':_0x57a31f['documentContextContent'],'showDiff':_0x2e147e,'trimUnchanged':!0x1});await _0x10293e['updateContent']({'parts':_0x484855,'renderingStrategy':_0xa8639c,'abortSignal':_0x14af1b});}catch(_0x503731){if(this['_isAbortError'](_0x503731))return;throw _0x503731;}});this['_interaction']['on']('replyCreated',(_0x53a3b0,_0x3776f4)=>{_0x4db83b['hideLoader'](),_0x17e87d(_0x3776f4,_0x4db83b)['catch'](_0x1dfbcf=>{this['_isAbortError'](_0x1dfbcf)||console['error']('Error\x20updating\x20content\x20in\x20replyCreated:',_0x1dfbcf);});}),this['_interaction']['on']('replyContentUpdated',(_0x46a9da,_0xd7f48d)=>{_0x17e87d(_0xd7f48d,_0x4db83b)['catch'](_0x2bcbfa=>{this['_isAbortError'](_0x2bcbfa)||console['error']('Error\x20updating\x20content\x20in\x20replyContentUpdated:',_0x2bcbfa);});}),this['_interaction']['on']('interactionFinished',async()=>{try{await this['_clearLoadingState'](_0x4db83b,_0x2455b2);}catch(_0x596b29){this['_isAbortError'](_0x596b29)||console['error']('Error\x20clearing\x20loading\x20state\x20in\x20interactionFinished:',_0x596b29);}}),this['listenTo'](_0x4db83b,'toggleSuggestionDisplayMode',(_0x975cec,{showDiff:_0x1aa462})=>{this['_balloonShowDiff']=_0x1aa462;const _0x568bc6=this['_interaction']['replies'][this['_interaction']['replies']['length']-0x1];_0x568bc6&&_0x17e87d(_0x568bc6,_0x4db83b,_0x1aa462,'static')['catch'](_0x589b67=>{this['_isAbortError'](_0x589b67)||console['error']('Error\x20updating\x20content\x20in\x20toggleSuggestionDisplayMode:',_0x589b67);});}),this['_setLoadingState'](_0x4db83b,_0x2455b2);try{return await this['_interaction']['start']();}catch(_0xceb030){if(this['_isAbortError'](_0xceb030))return;throw _0xceb030;}}['_applyChanges'](_0x406e32,_0x30fe01,_0x1c2b9){const _0x5e93cb=this['editor'],_0x2dc914=this['editor']['plugins']['get'](_0x104527),_0x316bc4=this['_interaction'],_0x4c3dee=this['_interaction']['replies'][this['_interaction']['replies']['length']-0x1],_0x416970=_0x4c3dee['changeGroups'];let _0x491143=z({'editor':_0x5e93cb,'reply':_0x4c3dee,'interaction':_0x316bc4,'groups':_0x416970,'transform':!0x1,'documentCompare':_0x2dc914,'documentCompareOptions':{'anchor':_0x5e93cb['model']['createPositionAt'](_0x406e32,0x0),'markDeletions':_0x1c2b9}});_0x491143=this['_filterOperationsOutsideRange'](_0x491143,_0x30fe01);for(const _0x2def72 of _0x491143)this['_anchorOperation'](_0x30fe01,_0x2def72,_0x5e93cb['model']['document']['getRoot']());const _0x57095e=_0x316bc4['getDocumentContext']()['version'],_0x1d63ff=_0x5e93cb['model']['document']['history']['getOperations'](_0x57095e),_0x1d0847={'document':_0x5e93cb['model']['document'],'useRelations':!0x1,'padWithNoOps':!0x1},_0x18c5f2=it(_0x491143,_0x1d63ff,_0x1d0847)['operationsA'];_0x5e93cb['model']['change'](_0x569304=>{if(_0x569304['setSelection'](_0x5e93cb['model']['document']['selection']['focus']),_0x1c2b9)_0x5e93cb['plugins']['get']('TrackChangesEditing')['_applyOperationsAsSuggestions'](_0x18c5f2);else{for(const _0x31e89f of _0x18c5f2)_0x31e89f['baseVersion']=_0x5e93cb['model']['document']['version'],_0x569304['batch']['addOperation'](_0x31e89f),_0x5e93cb['model']['applyOperation'](_0x31e89f);}}),this['editor']['plugins']['get']('AIBalloon')['close']();}['_filterOperationsOutsideRange'](_0x2d332e,_0x2924c6){return _0x2d332e['filter'](_0xf4f901=>{if('rename'==_0xf4f901['type']){const _0x2f802d=_0xf4f901['position']['nodeAfter'];return!_0x2924c6['has'](_0x2f802d);}if(_0xf4f901['type']['indexOf']('Attribute')>-0x1){const _0x223b18=_0xf4f901['range']['start']['nodeAfter'];return!_0x2924c6['has'](_0x223b18);}return!0x0;});}['_anchorOperation'](_0x428962,_0x4692eb,_0x2dc353){const _0xf3151=_0x4692eb['clone']();for(const _0x5a1528 in _0x4692eb){const _0x13977b=_0x4692eb[_0x5a1528];_0x13977b instanceof _0x4924b2?_0x4692eb[_0x5a1528]=new _0x4924b2(_0x24c885(_0x13977b['start']),_0x24c885(_0x13977b['end'])):_0x13977b instanceof _0x2aa0a3&&(_0x4692eb[_0x5a1528]=_0x24c885(_0x13977b));}if(['insert','move','remove','reinsert','split','merge']['includes'](_0xf3151['type'])){if(_0xf3151['isDocumentOperation']=!0x1,_0xf3151['baseVersion']=null,'remove'==_0xf3151['type']){const _0x38c307=_0xf3151['sourcePosition'],_0x58527b=_0xf3151['howMany'];new tt(_0x38c307,_0x58527b)['_execute']();}else _0xf3151['_execute']();}function _0x24c885(_0x2f3b79){if('$graveyard'==_0x2f3b79['root']['rootName'])return _0x2f3b79;const _0x3b7130=[];let _0x31486a=_0x2f3b79['root'];for(let _0x1fd25c=0x0;_0x1fd25c<_0x2f3b79['path']['length'];_0x1fd25c++){const _0x1b23f9=_0x428962['get'](_0x31486a)||0x0;_0x3b7130[_0x1fd25c]=_0x2f3b79['path'][_0x1fd25c]+_0x1b23f9,_0x31486a=_0x31486a['getChildAtOffset'](_0x2f3b79['path'][_0x1fd25c]);}return new _0x2aa0a3(_0x2dc353,_0x3b7130,_0x2f3b79['stickiness']);}}['_refreshInteraction'](){if(!this['_currentInteractionParams'])return void console['warn']('No\x20current\x20interaction\x20to\x20refresh');this['_interaction']&&(this['_previousInteractions']['push'](this['_interaction']),this['_stopInteraction']());const {action:_0x21edf6,content:_0x3d118e,version:_0x55fa74,mainView:_0x3b8066,aiBalloon:_0x5e7f43}=this['_currentInteractionParams'];this['_clearSuggestionContent'](_0x3b8066),_0x3b8066['showLoader'](),this['_createInteraction'](_0x3d118e,_0x55fa74,_0x3b8066,_0x5e7f43,_0x21edf6)['catch'](_0xad0d1b=>{this['_isAbortError'](_0xad0d1b)||console['error']('Error\x20refreshing\x20interaction:',_0xad0d1b);});}['_clearSuggestionContent'](_0x52cd2a){const _0xb6d5bf=_0x52cd2a['bodyView']['_children'];for(;_0xb6d5bf['length']>0x0;)_0xb6d5bf['remove'](_0xb6d5bf['first']);_0x52cd2a['bodyView']['hasPendingParts']=!0x1;}['_isAbortError'](_0x364405){return!!_0x364405['message']&&_0x364405['message']['startsWith']('ai-request-aborted');}['_clearInteractionHistory'](){this['_previousInteractions']=[],this['_currentInteractionParams']=void 0x0;}['_stopInteraction'](){this['_interaction']&&this['_interaction']['stop'](),this['_promiseQueue']['abort'](),this['isBusy']=!0x1;}['_setupCustomViews'](){const _0x25d0e9=new _0x23128a(this['editor']['locale']);_0x25d0e9['set']({'icon':_0x4bcc0e,'label':$n(this['editor']['locale'],'AI_ACTIONS_TRY_AGAIN'),'tooltip':!0x0,'class':'ck-ai-custom-action-button'}),_0x25d0e9['bind']('isEnabled')['to'](this,'isBusy',_0x4a0af9=>!_0x4a0af9),_0x25d0e9['on']('execute',()=>{this['_refreshInteraction']();}),this['_customViews']['add'](_0x25d0e9);}['_setLoadingState'](_0x273a87,_0x4f04d4){_0x273a87['setLoading'](),_0x4f04d4['balloonView']['setLoading'](),this['isBusy']=!0x0;}async['_clearLoadingState'](_0x269bb4,_0x46aa73){await this['_promiseQueue']['queueEmptyPromise'],this['isBusy']=!0x1,_0x269bb4['clearLoading'](),_0x46aa73['balloonView']['clearLoading']();}}class vs{['id'];['title'];['description'];['isParameterized'];['useArgs'];['options'];constructor({id:_0x51bce7,title:_0x406bdd,description:_0x143908,isParameterized:_0x2c1721,useArgs:_0x39f55c,options:_0x36d769}){this['id']=_0x51bce7,this['title']=_0x406bdd,this['description']=_0x143908,this['isParameterized']=_0x2c1721,this['useArgs']=_0x39f55c,this['options']=_0x36d769;}}class kr extends vs{['_models']=[];get['models'](){return this['_models'];}set['models'](_0x9cd5c4){this['_models']=_0x9cd5c4;}}class si extends ts(){['_checks'];constructor(_0x2d9075){super(),this['_checks']=this['_mapCheckDefinitions'](_0x2d9075);}get['checks'](){return this['_checks'];}['getCheckById'](_0x18e9fd){return this['checks']['find'](_0x4d6f7f=>_0x4d6f7f['id']===_0x18e9fd);}['_mapCheckDefinitions'](_0xab8cb){return _0xab8cb['map'](_0x2790e1=>'custom'===_0x2790e1['id']?new kr(_0x2790e1):new vs(_0x2790e1));}}class Cs extends _0x5f2b03(){['id'];['contentNew'];['contentInitial'];['documentVersion'];constructor({id:_0x5651d4,contentNew:_0x5cc5e9,contentInitial:_0x244224,documentVersion:_0x111305}){super(),this['id']=_0x5651d4,this['contentNew']=_0x5cc5e9,this['contentInitial']=_0x244224,this['documentVersion']=_0x111305;}}class Rs extends ts(){['id'];['parent'];['_data'];['_editorOperations']=[];constructor(_0x5cc467,_0x5b8667,_0x4cd449){super(),this['id']=_0x5cc467,this['parent']=_0x4cd449,this['_data']=_0x5b8667,this['set']('isActivated',!0x1),this['set']('status','active');}get['contentDiffed'](){return this['_data']['context']();}get['operations'](){return this['_data']['operations'];}get['operationsIsolated'](){return this['_data']['operationsIsolated'];}}class pr extends ts(){['id']=_0x2ef42f();['_results']=new Map();['_changes']=[];['_documentData'];['_sourceCheck'];['_aiConnector'];['_reviewParams'];['_reviewArgs'];['_activeRequest']=null;['_currentError'];constructor(_0x4d0618,_0xdc241,_0x3b36e5,_0xbfc62a,_0x5afb3d){super(),this['_documentData']=_0x4d0618,this['_sourceCheck']=_0xdc241,this['_aiConnector']=_0x3b36e5,this['_reviewParams']=_0xbfc62a,this['_reviewArgs']=_0x5afb3d,this['on']('change:status',(_0x58a7a3,_0x3a7e17,_0x256241)=>{this['fire']('reviewCheckRunUpdated',{'status':_0x256241,'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'];}async['start'](){this['status']='loading',this['_currentError']=void 0x0;try{this['_activeRequest']=this['_createApiRequest']();const _0x50e75e=await this['_activeRequest']['getStream']();this['status']='data';for await(const _0x2abb82 of _0x50e75e)'unmodified'!==_0x2abb82['data']['operation']&&('error'!==_0x2abb82['data']['operation']?this['_addReviewCheckResult'](_0x2abb82['data']['dataId'],_0x2abb82['data']['textDelta']):this['status']='error-chunk');'error-chunk'!==this['status']&&(0x0===this['_results']['size']?this['status']='unmodified':this['status']='ready');}catch(_0x306a05){this['_currentError']=_0x306a05,_0x306a05 instanceof Error&&_0x306a05['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'](_0x3d6657,_0x4dc08a){const _0x178f60=this['_results']['get'](_0x3d6657);if(!_0x178f60)return;const _0x3d858d=[];_0x4dc08a['forEach']((_0xf4eb9b,_0x3b5614)=>{const _0x1229a5=new Rs(_0x178f60['id']+'-'+_0x3b5614,_0xf4eb9b,_0x178f60);_0x1229a5['on']('change:status',()=>{'accepted'===_0x1229a5['status']?this['fire']('reviewCheckResultAccepted',{'change':_0x1229a5}):'rejected'===_0x1229a5['status']&&this['fire']('reviewCheckResultRejected',{'change':_0x1229a5});}),_0x1229a5['on']('change:isActivated',()=>{_0x1229a5['isActivated']?this['fire']('reviewCheckResultActivated',{'change':_0x1229a5}):this['fire']('reviewCheckResultDeactivated',{'change':_0x1229a5});}),this['_changes']['push'](_0x1229a5),_0x3d858d['push'](_0x1229a5);}),this['fire']('reviewCheckResultReady',{'changes':_0x3d858d,'result':_0x178f60,'source':this});}['abort'](){this['_activeRequest']&&(this['_activeRequest']['abortController']['abort'](),this['_activeRequest']=null,this['status']='aborted');}['isChangeActive'](_0x33d9c5){const _0x28ebe8=this['_changes']['find'](_0x386fd6=>_0x386fd6['id']===_0x33d9c5);return!(!_0x28ebe8||'active'!==_0x28ebe8['status']);}['getActiveChanges'](){return this['_changes']['filter'](_0xd15eec=>'active'===_0xd15eec['status']);}['markAllChangesAsAccepted'](){for(const _0x3e8ec2 of this['_changes'])'active'===_0x3e8ec2['status']&&(_0x3e8ec2['status']='accepted');this['_checkIfFinished']();}['markChangeAsAccepted'](_0x2feb58){const _0x352ea7=this['_changes']['find'](_0xe781e6=>_0xe781e6['id']===_0x2feb58);_0x352ea7&&'active'===_0x352ea7['status']&&(_0x352ea7['status']='accepted'),this['_checkIfFinished']();}['markChangeAsRejected'](_0x18a8f2){const _0x2f627c=this['_changes']['find'](_0x488aad=>_0x488aad['id']===_0x18a8f2);_0x2f627c&&'active'===_0x2f627c['status']&&(_0x2f627c['status']='rejected'),this['_checkIfFinished']();}['activateChange'](_0x494943){this['_changes']['filter'](_0x12b07c=>_0x12b07c['isActivated']&&_0x12b07c['id']!==_0x494943)['forEach'](_0x404307=>{_0x404307['isActivated']=!0x1;});const _0x503fb2=this['_changes']['find'](_0x500978=>_0x500978['id']===_0x494943);_0x503fb2&&(_0x503fb2['isActivated']=!0x0);}['deactivateChange'](){this['_changes']['filter'](_0xc27290=>_0xc27290['isActivated'])['forEach'](_0x13b60a=>{_0x13b60a['isActivated']=!0x1;});}['forceReadyState'](){this['status']='ready';}['_addReviewCheckResult'](_0x4308a5,_0xb1e10f){const _0x425366=this['_documentData']['elements']['get'](_0x4308a5);if(!_0x425366)return;const _0x398011=_0x425366['getContent']();if(_0x398011===_0xb1e10f)return;const _0x356805=new Cs({'id':_0x4308a5,'contentInitial':_0x398011,'contentNew':_0xb1e10f,'documentVersion':this['_documentData']['version']});this['_results']['set'](_0x356805['id'],_0x356805),this['fire']('reviewCheckResultAdded',{'result':_0x356805,'source':this});}['_checkIfFinished'](){if('ready'!==this['status'])return;0x0===this['_changes']['filter'](_0x280403=>'active'===_0x280403['status'])['length']&&(this['status']='finished');}['_createApiRequest'](){throw new Error('Not\x20implemented.');}}class hi extends pr{get['title'](){if(!this['_reviewParams']||0x0===this['_reviewParams']['length']||this['_sourceCheck']['useArgs'])return this['_sourceCheck']['title'];const _0x3ce511=[];if(this['_reviewParams']['length']>0x0&&this['_sourceCheck']['options'])for(let _0x35a7c8=0x0;_0x35a7c8<this['_reviewParams']['length'];_0x35a7c8++){if(!this['_reviewParams'][_0x35a7c8]||!this['_sourceCheck']['options'][_0x35a7c8])continue;const _0x13e7ce=this['_sourceCheck']['options'][_0x35a7c8],_0x6350fb=_0x13e7ce['data']?.['find'](_0x187b32=>_0x187b32['id']===this['_reviewParams'][_0x35a7c8]);_0x6350fb&&_0x3ce511['push'](_0x6350fb['label']);}return this['_sourceCheck']['title']+':\x20'+_0x3ce511['join'](',\x20');}['_createApiRequest'](){return this['_aiConnector']['callSystemReview']({'reviewName':this['_composeReviewName'](),'content':this['_documentData']['content'],'args':this['_reviewArgs']});}['_composeReviewName'](){return!this['_reviewParams']||0x0===this['_reviewParams']['length']||this['_sourceCheck']['useArgs']?this['_sourceCheck']['id']:[this['_sourceCheck']['id'],...this['_reviewParams']]['join']('-');}}class ri extends pr{['_prompt'];['_model'];constructor(_0x235a9b,_0x57447c,_0x50980b,_0x35b4c2,_0x1bfb8a){super(_0x50980b,_0x35b4c2,_0x1bfb8a),this['_prompt']=_0x235a9b,this['_model']=_0x57447c;}get['title'](){return this['_prompt'];}['_createApiRequest'](){return this['_aiConnector']['callCustomReview']({'content':this['_documentData']['content'],'prompt':this['_prompt'],'model':this['_model']});}}class oi extends _0x5f2b03(){['_modelList']=[];['_connector'];constructor({connector:_0x575f29}){super(),this['_connector']=_0x575f29;}async['getAll'](){if(!this['_modelList']['length'])try{const _0x2d1653=this['_connector']['getModels'](),_0x540b29=await _0x2d1653['list']();this['_modelList']=_0x540b29['items'];}catch{}return this['_modelList'];}}const ni=[{'id':'custom','title':'Custom\x20command','description':'Type\x20a\x20custom\x20command\x20to\x20review\x20the\x20content\x20exactly\x20as\x20you\x20need.','isParameterized':!0x0},{'id':'correctness','title':'Correctness','description':'Ensure\x20the\x20text\x20is\x20factually\x20accurate\x20and\x20free\x20of\x20errors.','isParameterized':!0x1},{'id':'clarity','title':'Clarity','description':'Improve\x20the\x20clarity\x20and\x20readability\x20of\x20the\x20text.','isParameterized':!0x1},{'id':'readability','title':'Readability','description':'Enhance\x20the\x20overall\x20readability\x20of\x20the\x20text.','isParameterized':!0x1},{'id':'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':'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'}]}]},{'id':'translate','title':'Translate','description':'Translate\x20the\x20text\x20into\x20another\x20language.','isParameterized':!0x0,'useArgs':!0x0,'options':[{'formType':'dropdown','label':'Select\x20language','argsKey':'language','data':[{'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'}]}]}];class ee extends _0x56fd8d{['_aiConnector'];['_aiReviewModeUi'];['_aiReviewModeEditing'];['_aiReviewCheckList'];['_currentReviewCheckRun'];['_isDiffOn']=!0x1;['_changeActivationSource']=null;static get['requires'](){return[N];}static get['pluginName'](){return'AIReviewModeController';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}async['init'](){this['_aiConnector']=this['context']['plugins']['get']('AIConnector'),this['_aiReviewModeUi']=this['context']['plugins']['get']('AIReviewModeUI'),this['_aiReviewModeEditing']=this['context']['plugins']['get']('AIReviewModeEditing');const _0xe569da=this['context']['config']['get']('ai.reviewMode.translations');if(_0xe569da){for(const _0x3369b1 of ni)'translate'===_0x3369b1['id']&&(_0x3369b1['options'][0x0]['data']=_0xe569da);}const _0x2d6f5b=this['_translateReviewChecks'](ni);this['_aiReviewCheckList']=new si(_0x2d6f5b);const _0x11f226=this['_aiReviewCheckList']['checks']['find'](_0x536eff=>'custom'===_0x536eff['id']);if(_0x11f226){const _0x174db8=await new oi({'connector':this['_aiConnector']})['getAll']();_0x11f226['models']=_0x174db8['map'](_0x5f3074=>({..._0x5f3074,'description':this['_getTranslationWithDefault']('AI_MODEL_DESCRIPTION_'+_0x5f3074['id']['toUpperCase'](),_0x5f3074['description'])}));}this['listenTo'](this['_aiReviewModeUi'],'getReviewCheckList',()=>{this['_aiReviewModeUi']['setAvailableChecks'](this['_aiReviewCheckList']['checks']);}),this['listenTo'](this['_aiReviewModeUi'],'runReviewCheck',async(_0x545ac1,_0x40dbba)=>{const _0x2fe994=this['_aiReviewCheckList']['getCheckById'](_0x40dbba['id']);if(_0x2fe994){this['_onDiffChange'](this['_isDiffOn']),_0x40dbba['isCustom']?this['_currentReviewCheckRun']=new ri(_0x40dbba['args']['prompt'],_0x40dbba['args']['model'],this['_aiReviewModeEditing']['getDocumentData'](),_0x2fe994,this['_aiConnector']):this['_currentReviewCheckRun']=new hi(this['_aiReviewModeEditing']['getDocumentData'](),_0x2fe994,this['_aiConnector'],_0x40dbba['params'],_0x40dbba['args']),this['_aiReviewModeUi']['setCheckResultTitle'](this['_currentReviewCheckRun']['title']),this['_currentReviewCheckRun']['on']('reviewCheckRunUpdated',(_0x2d1b48,_0x5b9c7f)=>{'data'===_0x5b9c7f['status']||'loading'===_0x5b9c7f['status']?(this['_aiReviewModeEditing']['switchToReadOnly'](),this['_aiReviewModeUi']['showCheckRunResults'](_0x5b9c7f)):'finished'===_0x5b9c7f['status']?this['_aiReviewModeUi']['showReviewCompletedView']():'ready'===_0x5b9c7f['status']?this['_aiReviewModeUi']['showActionsWhenResultIsReady']():'unmodified'===_0x5b9c7f['status']?this['_aiReviewModeUi']['showNoChangesView']():'error-general'===_0x5b9c7f['status']?this['_aiReviewModeUi']['showGeneralErrorView']():'error-chunk'===_0x5b9c7f['status']?this['_aiReviewModeUi']['showChunkErrorView']():'aborted'===_0x5b9c7f['status']&&(this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['processedResultsCount']>0x0?setTimeout(()=>{this['_currentReviewCheckRun']?.['forceReadyState']();},0x0):this['_onReviewModeRunLeave'](!0x0));}),this['_currentReviewCheckRun']['on']('reviewCheckResultAdded',(_0x52ec99,_0x4b868f)=>{if(!this['_currentReviewCheckRun'])throw new _0x58ed45('aireviewmode-no-current-check-run',this);const _0xf459dc=this['_aiReviewModeEditing']['diffContent'](_0x4b868f['result']['contentInitial'],_0x4b868f['result']['contentNew']);_0x4b868f['source']['addResultChanges'](_0x4b868f['result']['id'],_0xf459dc);}),this['_currentReviewCheckRun']['on']('reviewCheckResultReady',(_0x1a6c2f,_0x1d75a5)=>{for(const _0x7ad3db of _0x1d75a5['changes'])this['_aiReviewModeUi']['showCheckRunResult'](_0x7ad3db);this['_aiReviewModeEditing']['markChangePositionInEditorContent'](_0x1d75a5['changes'],_0x1d75a5['source']['documentData']);}),this['_currentReviewCheckRun']['on']('reviewCheckResultAccepted',(_0x327706,_0x3d402f)=>{this['_aiReviewModeUi']['updateChangeState'](_0x3d402f['change']['id'],'accepted');}),this['_currentReviewCheckRun']['on']('reviewCheckResultRejected',(_0x3d6912,_0x530348)=>{this['_aiReviewModeUi']['updateChangeState'](_0x530348['change']['id'],'rejected');}),this['_currentReviewCheckRun']['on']('reviewCheckResultActivated',(_0x4db517,_0x3c92f6)=>{this['_aiReviewModeUi']['setActiveStateInResults'](_0x3c92f6['change']['id']);const _0x50f645=this['_aiReviewModeEditing']['getMarkerElementForChange'](_0x3c92f6['change']['id']);if(_0x50f645){if('content'===this['_changeActivationSource']){const _0x9d1106=this['_aiReviewModeUi']['getChangeElement'](_0x3c92f6['change']['id']);_0x9d1106&&_0x43a20c(_0x9d1106['closest']('.ck-ai-review-mode__check-run-result')||_0x9d1106);}else{if('panel'===this['_changeActivationSource']){const _0x31c49d={'target':_0x50f645['domElement'],'viewportOffset':{'top':0x55,'left':0x0,'bottom':0x0,'right':0x0},'ancestorOffset':0x14,'alignToTop':!0x0};rt(_0x31c49d);}}this['_aiReviewModeUi']['showChangeBalloon'](_0x3c92f6['change'],_0x50f645['domElement']);}}),this['_currentReviewCheckRun']['on']('reviewCheckResultDeactivated',()=>{this['_aiReviewModeUi']['resetActiveStateInResults']();});try{await this['_currentReviewCheckRun']['start']();}catch(_0x325e8b){_0x325e8b instanceof Error&&_0x325e8b['message']['includes']('ai-request-aborted')||(_0x325e8b instanceof _0x58ed45?this['_logError'](_0x325e8b):this['_logError'](new _0x58ed45('aireviewmode-check-run-failed',this,{'error':_0x325e8b})));}}else this['_logError'](new _0x58ed45('aireviewmode-source-check-not-found',this,{'checkId':_0x40dbba['id']}));}),this['listenTo'](this['_aiReviewModeUi'],'leaveReviewMode',()=>{this['_onReviewModeRunLeave']();}),this['listenTo'](this['_aiReviewModeUi'],'leaveReviewModeResultList',()=>{this['_onReviewModeRunLeave'](!0x0);}),this['listenTo'](this['_aiReviewModeUi'],'abortReviewStream',()=>{this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['abort']();}),this['listenTo'](this['_aiReviewModeUi'],'finishReview',()=>{this['_onReviewModeRunLeave'](!0x0);}),this['listenTo'](this['_aiReviewModeUi'],'acceptAllChanges',()=>{if(!this['_currentReviewCheckRun'])return;const _0x19b115=this['_currentReviewCheckRun']['getActiveChanges']();_0x19b115['length']&&(this['_aiReviewModeEditing']['applyChange'](_0x19b115['map'](_0x1c201f=>_0x1c201f['id'])),this['_currentReviewCheckRun']['markAllChangesAsAccepted']());}),this['listenTo'](this['_aiReviewModeUi'],'acceptChange',(_0x542df2,_0x122598)=>{this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['isChangeActive'](_0x122598['id'])&&(this['_aiReviewModeEditing']['applyChange']([_0x122598['id']]),this['_currentReviewCheckRun']['markChangeAsAccepted'](_0x122598['id']),this['_aiReviewModeUi']['hideChangeBalloon']());}),this['listenTo'](this['_aiReviewModeUi'],'dismissChange',(_0x3fa5d9,_0x1762eb)=>{this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['isChangeActive'](_0x1762eb['id'])&&(this['_aiReviewModeEditing']['rejectChange'](_0x1762eb['id']),this['_currentReviewCheckRun']['markChangeAsRejected'](_0x1762eb['id']),this['_aiReviewModeUi']['hideChangeBalloon']());}),this['listenTo'](this['_aiReviewModeUi'],'toggleDiff',(_0x2b78fd,_0xc90f3a)=>{this['_isDiffOn']=_0xc90f3a['on'],this['_onDiffChange'](this['_isDiffOn']);}),this['listenTo'](this['_aiReviewModeUi'],'retryReview',async()=>{this['_currentReviewCheckRun']&&await this['_currentReviewCheckRun']['restart']();}),this['listenTo'](this['_aiReviewModeUi'],'activateChange',(_0x24d082,_0x555808)=>{this['_currentReviewCheckRun']&&(this['_changeActivationSource']='panel',this['_currentReviewCheckRun']['activateChange'](_0x555808['id']));}),this['listenTo'](this['_aiReviewModeUi'],'deactivateChange',()=>{this['_currentReviewCheckRun']&&this['_currentReviewCheckRun']['deactivateChange']();}),this['listenTo'](this['_aiReviewModeEditing']['emitter'],'changeMarkerClick',(_0x249c45,_0xa82c9e)=>{this['_currentReviewCheckRun']&&(this['_changeActivationSource']='content',this['_currentReviewCheckRun']['activateChange'](_0xa82c9e['changeId']));});}['_onReviewModeRunLeave'](_0x4bcd83=!0x1){this['_currentReviewCheckRun']&&(this['_currentReviewCheckRun']['abort'](),this['_currentReviewCheckRun']['stopListening'](),this['_currentReviewCheckRun']=void 0x0),_0x4bcd83&&this['_aiReviewModeUi']['showReviewCheckList'](),this['_aiReviewModeEditing']['clearAllMarkers'](),this['_aiReviewModeEditing']['switchToEdit'](),this['_changeActivationSource']=null;const _0x389c26=this['_aiReviewModeEditing']['getContentElement']();_0x389c26&&(_0x389c26['classList']['remove']('ck-ai-review-mode-diff'),_0x389c26['classList']['remove']('ck-ai-review-mode-highlights'));}['_onDiffChange'](_0x1e484e){const _0x543453=this['_aiReviewModeEditing']['getContentElement']();_0x543453&&(_0x543453['classList']['remove']('ck-ai-review-mode-diff'),_0x543453['classList']['remove']('ck-ai-review-mode-highlights'),_0x543453['classList']['add'](_0x1e484e?'ck-ai-review-mode-diff':'ck-ai-review-mode-highlights'));}['_translateReviewChecks'](_0x19ea99){return _0x19ea99['map'](_0x3a1fb6=>{const _0x5f40f1='AI_REVIEW_CHECK_'+_0x3a1fb6['id']['toUpperCase']()['replaceAll']('-','_'),_0x3d756a={..._0x3a1fb6,'title':this['_getTranslationWithDefault'](_0x5f40f1+'_TITLE',_0x3a1fb6['title']),'description':this['_getTranslationWithDefault'](_0x5f40f1+'_DESCRIPTION',_0x3a1fb6['description'])};return _0x3a1fb6['options']&&(_0x3d756a['options']=_0x3a1fb6['options']['map'](_0x2131d2=>({..._0x2131d2,'label':this['_getTranslationWithDefault'](_0x5f40f1+'_OPTIONS_LABEL',_0x2131d2['label']||''),'data':_0x2131d2['data']?_0x2131d2['data']['map'](_0x291727=>({..._0x291727,'label':this['_getTranslationWithDefault'](_0x5f40f1+'_OPTIONS_DATA_'+_0x291727['id']['toUpperCase'](),_0x291727['label'])})):void 0x0}))),_0x3d756a;});}['_getTranslationWithDefault'](_0x335f34,_0x377747){const _0x1618ba=$n(this['context']['locale'],_0x335f34);return _0x1618ba===_0x335f34?_0x377747:_0x1618ba;}['_logError'](_0x5988d7){nt(_0x5988d7['message']),this['_aiReviewModeUi']['showGeneralErrorView']();}}class Mr extends _0x4118d8{['_dropdownView'];['_defaultValue'];['_defaultLabel'];constructor(_0x5bba5c,_0x1455a6){super(_0x5bba5c),this['_defaultValue']=_0x1455a6['default']||(_0x1455a6['data']['length']>0x0?_0x1455a6['data'][0x0]['id']:''),this['_defaultLabel']=_0x1455a6['data']['find'](_0x4b9ea8=>_0x4b9ea8['id']===this['_defaultValue'])?.['label']||'',this['set']('formValue',''),this['_dropdownView']=_0x820be6(this['locale']);const _0x1f0e25=this['_prepareListOptions'](_0x1455a6['data']);_0x3b3006(this['_dropdownView'],_0x1f0e25,{'role':'menu','ariaLabel':_0x1455a6['label']}),this['_dropdownView']['buttonView']['set']({'label':this['_defaultLabel'],'withText':!0x0}),this['_dropdownView']['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x149739=>{_0x149739['stopPropagation']();})}}),this['listenTo'](this['_dropdownView'],'execute',_0x1a7220=>{this['formValue']=_0x1a7220['source']['model']['id'],this['_dropdownView']['buttonView']['label']=_0x1a7220['source']['model']['label'];}),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset_all','ck-ai-review-mode__check-list-item-parameterized-form-element','ck-ai-review-mode__check-list-item-parameterized-form-element_dropdown']},'children':[this['_dropdownView']]});}['resetToDefault'](){this['formValue']=this['_defaultValue'],this['_dropdownView']['buttonView']['label']=this['_defaultLabel'];}['_prepareListOptions'](_0x1e0f38=[]){const _0x3e75f8=new _0x12a2d7();this['resetToDefault']();for(const _0x1e7863 of _0x1e0f38){const _0x4366cc=new _0x18995b({'label':_0x1e7863['label'],'withText':!0x0,'role':'menuitemradio','id':_0x1e7863['id'],'model':_0x1e7863});_0x4366cc['bind']('isOn')['to'](this,'formValue',_0x59a4f8=>_0x59a4f8===_0x4366cc['id']);const _0x7676bc={'type':'button','model':_0x4366cc};_0x3e75f8['add'](_0x7676bc);}return _0x3e75f8;}}class Fs extends _0x470a68{['_formItem']=null;constructor(_0x5ee4cb,_0xcae2af,_0x1f3752){super(_0x5ee4cb),this['argsKey']=_0xcae2af?.['argsKey'];if('dropdown'===_0xcae2af['formType'])this['_formItem']=new Mr(this['locale'],_0xcae2af);this['set']('value',''),this['bind']('value')['to'](this['_formItem'],'formValue');const _0x4990cb=new _0x3e9b6c(this['locale'],{'children':[this['_formItem']],'class':[_0x1f3752?'ck-form__row_with-submit':'']});_0x1f3752&&_0x4990cb['children']['add'](_0x1f3752),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-review-mode__form-item','ck-reset_all']},'children':[_0x4990cb]});}['resetToDefault'](){this['_formItem']['resetToDefault']();}}class js extends _0x12ea37{static ['MIN_ROWS']=0x1;static ['MAX_ROWS']=0xc;constructor(_0x2bebda){super(_0x2bebda),this['set']('isEmpty',!0x0),this['minRows']=js['MIN_ROWS'],this['maxRows']=js['MAX_ROWS'],this['extendTemplate']({'attributes':{'id':'ai-review-mode-prompt-input','class':['ck','ck-review-mode__prompt-input']}}),this['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x146cc7=>{_0x146cc7['stopPropagation']();})}});}['render'](){super['render'](),this['on']('update',()=>{this['isEmpty']=''===this['element']['value']?.['trim']();});}['setPlaceholderText'](_0x426961){this['set']('placeholder',_0x426961);}}class Gs extends _0x4118d8{['submitButtonView'];['cancelButtonView'];['promptInputView'];['_modelSelectionDropdown'];['_modelSelectionDropdownItems'];['_check'];['_defaultValue'];['_defaultLabel'];constructor(_0xc9aff7,_0x4ba673){super(_0xc9aff7),this['_check']=_0x4ba673,this['set']('prompt',''),this['set']('modelId',''),this['_defaultValue']=_0x4ba673['models']&&_0x4ba673['models']['length']>0x0?_0x4ba673['models'][0x0]['id']:'',this['_defaultLabel']=_0x4ba673['models']&&_0x4ba673['models']['length']>0x0?_0x4ba673['models'][0x0]['name']:'',this['submitButtonView']=this['_createSubmitButtonView'](),this['cancelButtonView']=this['_createCancelButtonView'](),this['promptInputView']=new js(_0xc9aff7),this['promptInputView']['bind']('value')['to'](this,'prompt'),this['promptInputView']['on']('input',()=>{this['prompt']=this['promptInputView']['element']['value'];}),this['_modelSelectionDropdown']=this['_createModelSelectionDropdown'](),this['_modelSelectionDropdownItems']=new _0x12a2d7(),this['_setModelList'](),_0x3b3006(this['_modelSelectionDropdown'],this['_modelSelectionDropdownItems']);const _0x2fc5fb=new _0x4118d8(_0xc9aff7);_0x2fc5fb['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-review-mode__check-list-item-custom-actions-footer']},'children':[this['_modelSelectionDropdown'],{'tag':'div','attributes':{'class':['ck-ai-review-mode__check-list-item-parameterized-custom-actions-buttons']},'children':[this['cancelButtonView'],this['submitButtonView']]}]}),this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-review-mode__check-list-item-custom-actions']},'children':[new _0x3e9b6c(this['locale'],{'children':[this['promptInputView']]}),new _0x3e9b6c(this['locale'],{'children':[_0x2fc5fb]})]});}['resetToDefault'](){this['prompt']='',this['modelId']=this['_defaultValue'],this['_modelSelectionDropdown']['buttonView']['label']=this['_defaultLabel'];}['_createSubmitButtonView'](){const _0x3ee05e=new _0x23128a(this['locale']),t=this['locale']['t'];return _0x3ee05e['set']({'label':t('Submit'),'withText':!0x0,'class':'ck-ai-button-primary'}),_0x3ee05e['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x6d550e=>{_0x6d550e['stopPropagation']();})}}),_0x3ee05e['on']('execute',()=>{this['fire']('runReviewCheck',{'id':'custom','args':{'prompt':this['prompt'],'model':this['modelId']},'isCustom':!0x0});}),_0x3ee05e;}['_createCancelButtonView'](){const _0x56724e=new _0x23128a(this['locale']),t=this['locale']['t'];return _0x56724e['set']({'label':t('Cancel'),'withText':!0x0,'class':'ck-ai-button-tertiary-filled'}),_0x56724e['on']('execute',()=>{this['resetToDefault']();}),_0x56724e;}['_setModelList'](){this['_modelSelectionDropdownItems']['clear']();const _0xdab78c=this['_check']['models'];if(this['resetToDefault'](),_0xdab78c?.['length'])for(const _0x1e2686 of _0xdab78c){const _0xbb30f5=new _0x18995b({'label':_0x1e2686['name'],'withText':!0x0,'role':'menuitemradio','id':_0x1e2686['id'],'model':_0x1e2686});_0xbb30f5['bind']('isOn')['to'](this,'modelId',_0x2ac073=>_0x2ac073===_0x1e2686['id']),this['_modelSelectionDropdownItems']['add']({'type':'button','model':_0xbb30f5,'labelView':new Ms(this['locale'],_0x1e2686)});}}['_createModelSelectionDropdown'](){const _0x23e776=_0x820be6(this['locale']);return _0x23e776['set']({'panelPosition':'se','class':'ck-ai-review-mode__check-list-item-model-dropdown'}),_0x23e776['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x2d8ee0=>{_0x2d8ee0['stopPropagation']();})}}),_0x23e776['buttonView']['set']({'label':this['_defaultLabel'],'withText':!0x0,'tooltip':!0x0}),this['listenTo'](_0x23e776,'execute',_0x28c621=>{this['modelId']=_0x28c621['source']['model']['id'],_0x23e776['buttonView']['label']=_0x28c621['source']['label'];}),_0x23e776;}}class Ms extends _0x55f519{constructor(_0x1b6c91,_0xf87bd1){super();const _0x4e05cd=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-button__label'],'style':_0x4e05cd['to']('style'),'id':_0x4e05cd['to']('id')},'children':[{'tag':'div','attributes':{'class':['ck-ai-review-mode__check-list-item-model-dropdown-name']},'children':[{'text':_0x4e05cd['to']('text')}]},{'tag':'div','attributes':{'class':['ck-ai-review-mode__check-list-item-model-dropdown-description']},'children':[{'tag':'span','children':[{'text':_0xf87bd1['description']}]}]}]});}}class zs extends _0x470a68{['_formItemsCollection']=new _0x260fed();['_customCheckView']=null;constructor(_0x46d190,_0x33d79f,_0x298aa7){super(_0x46d190),this['set']('isParametrizedViewOpen',!0x1),this['set']('isListItemRendered',!0x1),this['set']('isItemParametrized',_0x33d79f['isParameterized']);const _0x21cca2=this['_createIconView']();this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-review-mode__check-list-item',this['bindTemplate']['if']('isParametrizedViewOpen','ck-ai-review-mode__check-list-item_selected',_0x301c57=>_0x301c57),this['bindTemplate']['if']('isListItemRendered','ck-ai-review-mode__check-list-item_rendered',_0x5610e0=>_0x5610e0)],'style':{'--ck-ai-check-list-item-index':_0x298aa7}},'on':{'click':this['bindTemplate']['to']('click')},'children':[{'tag':'div','attributes':{'class':['ck-ai-review-mode__check-list-item-content']},'children':[{'tag':'div','attributes':{'class':['ck-ai-review-mode__check-list-item-main-content']},'children':[{'tag':'div','attributes':{'class':['ck-ai-review-mode__check-list-item-title']},'children':[{'tag':'span','attributes':{'class':['ck-ai-review-mode__check-list-item-title-text']},'children':[{'text':_0x33d79f['title']}]},_0x21cca2]},{'tag':'div','attributes':{'class':['ck-ai-review-mode__check-list-item-description']},'children':[{'text':_0x33d79f['description']}]}]}]},..._0x33d79f['isParameterized']?[this['_createParameterizedView'](_0x33d79f)]:[],...'custom'===_0x33d79f['id']?[this['_createCustomView'](_0x33d79f)]:[]]}),this['on']('click',()=>{_0x33d79f['isParameterized']?this['isParametrizedViewOpen']=!0x0:this['fire']('runReviewCheck',{'id':_0x33d79f['id']});}),requestAnimationFrame(()=>{this['isListItemRendered']=!0x0;});}['render'](){super['render'](),this['isItemParametrized']&&_0x28f439({'emitter':this,'activator':()=>!0x0===this['isParametrizedViewOpen'],'contextElements':[this['element']],'callback':()=>{this['isParametrizedViewOpen']=!0x1;}});}['resetToDefault'](){this['isParametrizedViewOpen']=!0x1,this['_formItemsCollection']['forEach'](_0x24b7fd=>{_0x24b7fd['resetToDefault']();}),this['_customCheckView']&&this['_customCheckView']['resetToDefault']();}['_createIconView'](){const _0x30a753=new _0x2745c1();return _0x30a753['content']=_0x4f716d,_0x30a753['extendTemplate']({'attributes':{'class':['ck-ai-review-mode__check-list-item-title-icon']}}),_0x30a753;}['_createParameterizedView'](_0x12dcba){const _0x2e5038=new _0x4118d8(),_0x4e60f4=this['_createFormView'](_0x12dcba);return _0x2e5038['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-review-mode__check-list-item-parameterized',this['bindTemplate']['if']('isParametrizedViewOpen','ck-hidden',_0x277366=>!_0x277366)]},'children':[_0x4e60f4]}),_0x2e5038;}['_createFormView'](_0x49f6e7){const _0x1c9969=new _0x4118d8(),_0x4dbf1a=Array['isArray'](_0x49f6e7['options'])?_0x49f6e7['options']:[],_0x2fdb5b=new _0x23128a(this['locale']),t=this['locale']['t'];_0x2fdb5b['set']({'label':t('Submit'),'withText':!0x0,'class':'ck-ai-button-primary'}),_0x2fdb5b['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x3b4460=>{_0x3b4460['stopPropagation']();})}}),_0x2fdb5b['on']('execute',()=>{const _0x2fa0ee=[],_0xe89d24={};this['_formItemsCollection']['forEach'](_0x324ba0=>{_0x2fa0ee['push'](_0x324ba0['value']),_0x49f6e7['useArgs']&&_0x49f6e7['options']&&(_0xe89d24[_0x324ba0['argsKey']]=_0x324ba0['value']);}),this['fire']('runReviewCheck',{'id':_0x49f6e7['id'],'params':_0x2fa0ee['length']?_0x2fa0ee:void 0x0,'args':Object['keys'](_0xe89d24)['length']?_0xe89d24:void 0x0});});const _0x3367d7=_0x4dbf1a['length'];return _0x4dbf1a['forEach']((_0x46873f,_0x4c77e5)=>{const _0x4dfec4=_0x4c77e5===_0x3367d7-0x1;this['_formItemsCollection']['add'](new Fs(this['locale'],_0x46873f,_0x4dfec4?_0x2fdb5b:null));}),_0x1c9969['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-review-mode__check-list-item-parameterized-form']},'children':this['_formItemsCollection']}),_0x1c9969;}['_createCustomView'](_0x4ad7da){return this['_customCheckView']=new Gs(this['locale'],_0x4ad7da),this['_customCheckView']['extendTemplate']({'attributes':{'class':['ck-ai-review-mode__check-list-item-parameterized','ck-ai-review-mode__check-list-item-parameterized_custom',this['bindTemplate']['if']('isParametrizedViewOpen','ck-hidden',_0x207a01=>!_0x207a01)]}}),this['_customCheckView']['delegate']('runReviewCheck')['to'](this),this['_customCheckView'];}}class Hs extends _0x470a68{['_checkViews'];constructor(_0x1682e0){super(_0x1682e0),this['_checkViews']=new _0x260fed();const _0x3f3381=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-review-mode__check-list',_0x3f3381['if']('isVisible','ck-hidden',_0x2311ef=>!_0x2311ef)]},'children':this['_checkViews']});}['setChecks'](_0x18c5c4){this['_checkViews']['clear']();for(const [_0x26907d,_0x37983c]of _0x18c5c4['entries']()){const _0x4b0fff=new zs(this['locale'],_0x37983c,_0x26907d);_0x4b0fff['delegate']('runReviewCheck')['to'](this),this['_checkViews']['add'](_0x4b0fff);}}['hasChecks'](){return this['_checkViews']['length']>0x0;}['resetAllParameterizedChecks'](){for(const _0x19d67b of this['_checkViews'])_0x19d67b instanceof zs&&_0x19d67b['resetToDefault']();}}class xs extends _0x4118d8{['resultResponseView'];['acceptButtonView'];['dismissButtonView'];['infoButtonView'];constructor(_0x3b4325,_0x108f7e){super(_0x3b4325),this['id']=_0x108f7e,this['set']('changeId',_0x108f7e),this['resultResponseView']=this['_createResultResponseView'](),this['acceptButtonView']=this['_createAcceptButtonView'](),this['dismissButtonView']=this['_createDismissButtonView'](),this['infoButtonView']=this['_createInfoButtonView'](),this['set']('isInfoToggleOn',!0x1),this['set']('isActive',!0x1),this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-review-mode__check-run-result',this['bindTemplate']['if']('isActive','ck-ai-review-mode__check-run-result_active')]},'on':{'click':this['bindTemplate']['to']('click')},'children':[this['resultResponseView'],{'tag':'div','attributes':{'class':['ck-ai-review-mode__check-run-result-footer']},'children':[{'tag':'div','attributes':{'class':['ck-ai-review-mode__check-run-result-action-buttons']},'children':[this['acceptButtonView'],this['dismissButtonView']]},this['infoButtonView']]}]}),this['on']('click',()=>{this['fire']('activateChange',{'id':_0x108f7e,'source':this});});}['setItemAsActive'](){this['isActive']=!0x0;}['setItemAsInactive'](){this['isActive']=!0x1;}['_createResultResponseView'](){const _0x2fda0a=new _0x4118d8(this['locale']);return _0x2fda0a['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-content','ck-ai-review-mode__check-run-result-response']}}),_0x2fda0a;}['_createAcceptButtonView'](){const _0x2324cb=new _0x23128a(this['locale']);return _0x2324cb['set']({'label':$n(this['locale'],'AI_REVIEW_MODE_ACCEPT_CHANGE'),'withText':!0x0,'class':'ck-ai-button-secondary\x20ck-ai-review-mode__check-run-result-accept-button'}),_0x2324cb['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x2003ea=>{this['fire']('acceptChange',{'id':this['changeId']}),_0x2003ea['stopPropagation']();})}}),_0x2324cb;}['_createDismissButtonView'](){const _0x7645da=new _0x23128a(this['locale']);return _0x7645da['set']({'label':$n(this['locale'],'AI_REVIEW_MODE_DISMISS_CHANGE'),'withText':!0x0,'class':'ck-ai-button-tertiary-filled\x20ck-ai-review-mode__check-run-result-dismiss-button'}),_0x7645da['extendTemplate']({'on':{'click':this['bindTemplate']['to'](_0x1b188d=>{this['fire']('dismissChange',{'id':this['changeId']}),_0x1b188d['stopPropagation']();})}}),_0x7645da;}['_createInfoButtonView'](){const _0x2f52d0=new _0x23128a(this['locale']);return _0x2f52d0['set']({'label':$n(this['locale'],'AI_REVIEW_MODE_LEARN_MORE'),'icon':_0x40e4ed,'tooltip':!0x0,'isToggleable':!0x0,'role':'menuitemcheckbox','class':'ck-ai-button-tertiary-filled\x20ck-ai-review-mode__check-run-result-info-button\x20ck-hidden'}),_0x2f52d0['bind']('isOn')['to'](this,'isInfoToggleOn',_0x40e33f=>_0x40e33f),_0x2f52d0['on']('execute',()=>{console['log']('Toggle\x20info\x20view'),this['isInfoToggleOn']=!this['isInfoToggleOn'];}),_0x2f52d0;}}class Js extends _0x470a68{['_resultViews'];['resultsHeader'];['reviewDisclaimer'];['_cancelButtonView'];['_acceptAllButtonView'];['_exitReviewButtonView'];['_toggleDiffButtonView'];['_errorMessageView'];constructor(_0x5b4637){super(_0x5b4637),this['_resultViews']=new _0x260fed(),this['_cancelButtonView']=this['_createCancelButtonView'](),this['_acceptAllButtonView']=this['_createAcceptAllButtonView'](),this['_exitReviewButtonView']=this['_createExitReviewButtonView'](),this['_toggleDiffButtonView']=this['_createToggleDiffButtonView'](),this['resultsHeader']=this['_createResultHeaderView'](),this['_errorMessageView']=this['_createErrorView'](),this['reviewDisclaimer']=new Ci(_0x5b4637),this['set']('isLoading',!0x1),this['set']('isToggleDiffOn',!0x1),this['set']('isResultReady',!0x1),this['set']('headerTitle',''),this['set']('isError',!0x1),this['set']('showErrorMessage',!0x1),this['set']('errorType','general');const _0x636796=this['_createCombinedSkeletonLoader'](),_0x313867=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-review-mode__check-run',_0x313867['if']('isVisible','ck-hidden',_0x40e3af=>!_0x40e3af)]},'children':[this['resultsHeader'],{'tag':'div','attributes':{'class':['ck-ai-review-mode__check-run-results-wrapper']},'children':[this['_errorMessageView'],{'tag':'div','attributes':{'class':['ck-ai-review-mode__check-run-results-container',this['bindTemplate']['if']('isLoading','ck-hidden',_0x17e1e2=>_0x17e1e2)]},'children':this['_resultViews']},_0x636796]},this['reviewDisclaimer']]});}['clearResults'](){this['_resultViews']['clear']();}['getResults'](){return this['_resultViews'];}['addResult'](_0x65db37){const _0x42f601=new xs(this['locale'],_0x65db37['id']);_0x42f601['delegate']('acceptChange','dismissChange','activateChange')['to'](this),this['_resultViews']['add'](_0x42f601),_0x42f601['resultResponseView']['element']['innerHTML']=_0x65db37['contentDiffed'];}['hideResult'](_0x629d12){const _0x214384=this['_resultViews']['find'](_0x25d8af=>_0x25d8af['id']===_0x629d12);_0x214384&&(_0x214384['element']?.['classList']['add']('ck-ai-review-mode__check-run-result_removing'),_0x214384['element']?.['addEventListener']('animationend',()=>{this['_resultViews']['remove'](_0x214384),_0x214384['destroy']();},{'once':!0x0}));}['setTitle'](_0x311690){this['headerTitle']=_0x311690;}['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 Be(this['locale'],De['aiReviewChecks']);}['_createCombinedSkeletonLoader'](){const _0x429fe3=new _0x4118d8(this['locale']),_0x54fc06=[];for(let _0x1baef5=0x0;_0x1baef5<0x10;_0x1baef5++){const _0x2255f6=this['_createSkeletonLoader']();_0x2255f6['extendTemplate']({'attributes':{'class':['ck-ai-review-mode__check-run-skeleton-item']}}),_0x54fc06['push'](_0x2255f6);}return _0x429fe3['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-review-mode__check-run-skeleton-container',this['bindTemplate']['if']('isLoading','ck-hidden',_0xef1848=>!_0xef1848)]},'children':_0x54fc06}),_0x429fe3;}['_createErrorView'](){const _0x5d20db=new _0x4118d8(this['locale']),_0x233d92=new _0x23128a(this['locale']),t=this['locale']['t'];return _0x5d20db['delegate']('retryReview')['to'](this),_0x233d92['set']({'label':t('Try\x20again'),'withText':!0x0,'class':'ck-ai-button-secondary\x20ck-ai-review-mode__check-run-error-retry-button'}),_0x233d92['on']('execute',()=>{this['fire']('retryReview');}),_0x5d20db['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-review-mode__check-run-error-container',this['bindTemplate']['if']('showErrorMessage','ck-hidden',_0x31c5a5=>!_0x31c5a5),this['bindTemplate']['if']('errorType','ck-ai-review-mode__check-run-error-container_border-bottom',_0x490704=>'chunk'===_0x490704)]},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-chat-error','ck-ai-chat-error_full-width','ck-ai-review-mode__check-run-error-message',this['bindTemplate']['if']('errorType','ck-ai-chat-error_warning',_0x2f78ed=>'chunk'===_0x2f78ed)]},'children':[{'tag':'p','attributes':{'class':['ck-ai-chat-error__content',this['bindTemplate']['if']('errorType','ck-hidden',_0x2cbf4f=>'general'!==_0x2cbf4f)]},'children':[{'text':$n(this['locale'],'AI_REVIEW_MODE_GENERAL_ERROR_MESSAGE')}]},{'tag':'p','attributes':{'class':['ck-ai-chat-error__content',this['bindTemplate']['if']('errorType','ck-hidden',_0x56453e=>'chunk'!==_0x56453e)]},'children':[{'text':$n(this['locale'],'AI_REVIEW_MODE_CHUNK_ERROR_MESSAGE')}]}]},_0x233d92]}),_0x5d20db;}['_createCancelButtonView'](){const _0x15c723=new _0x23128a(this['locale']);return _0x15c723['set']({'label':$n(this['locale'],'AI_REVIEW_MODE_STOP_GENERATING'),'withText':!0x0,'class':['ai-chat-controls-loader__cancel-button'],'icon':_0x4d6423}),_0x15c723['extendTemplate']({'attributes':{'class':[this['bindTemplate']['if']('isResultReady','ck-hidden',_0x3f8905=>_0x3f8905)]}}),_0x15c723['on']('execute',()=>{this['fire']('abortReviewStream');}),_0x15c723;}['_createToggleDiffButtonView'](){const _0x4b4891=new _0x23128a(this['locale']);_0x4b4891['set']({'tooltip':!0x0,'isToggleable':!0x0,'role':'menuitemcheckbox'}),_0x4b4891['bind']('isEnabled')['to'](this,'isError',_0x5c1895=>!_0x5c1895),_0x4b4891['extendTemplate']({'attributes':{'class':['ck-ai-button-secondary','ck-ai-review-mode__check-run-toggle-diff-button',this['bindTemplate']['if']('isResultReady','ck-hidden',_0x37e239=>!_0x37e239)]}});const _0x42ffea=$n(this['locale'],'AI_REVIEW_MODE_HIDE_CHANGES'),_0x5b0358=$n(this['locale'],'AI_REVIEW_MODE_SHOW_CHANGES');return _0x4b4891['bind']('isOn')['to'](this,'isToggleDiffOn',_0x18f07e=>_0x18f07e),_0x4b4891['bind']('icon')['to'](this,'isToggleDiffOn',_0x34b296=>_0x34b296?_0x29ce6f:_0x3fb5f1),_0x4b4891['bind']('label')['to'](this,'isToggleDiffOn',_0x5972d3=>_0x5972d3?_0x42ffea:_0x5b0358),_0x4b4891['on']('execute',()=>{this['isToggleDiffOn']=!this['isToggleDiffOn'],this['fire']('toggleDiff',{'on':this['isToggleDiffOn']});}),_0x4b4891;}['_createAcceptAllButtonView'](){const _0x2cb9e8=new _0x23128a(this['locale']);return _0x2cb9e8['set']({'label':$n(this['locale'],'AI_REVIEW_MODE_ACCEPT_ALL'),'withText':!0x0}),_0x2cb9e8['bind']('isEnabled')['to'](this,'isError',_0x4bdfb5=>!_0x4bdfb5),_0x2cb9e8['extendTemplate']({'attributes':{'class':['ck-ai-button-primary','ck-ai-review-mode__check-run-accept-all-button',this['bindTemplate']['if']('isResultReady','ck-hidden',_0x3bb9f4=>!_0x3bb9f4)]}}),_0x2cb9e8['on']('execute',()=>{this['fire']('acceptAllChanges');}),_0x2cb9e8;}['_createExitReviewButtonView'](){const _0x5ab84f=new _0x23128a(this['locale']);return _0x5ab84f['set']({'label':$n(this['locale'],'AI_REVIEW_MODE_EXIT_REVIEW'),'withText':!0x0}),_0x5ab84f['extendTemplate']({'attributes':{'class':['ck-ai-button-tertiary-filled','ck-ai-review-mode__check-run-exit-button',this['bindTemplate']['if']('isResultReady','ck-hidden',_0x2b1089=>!_0x2b1089)]}}),_0x5ab84f['on']('execute',()=>{this['fire']('leaveReviewModeResultList');}),_0x5ab84f;}['_createResultHeaderView'](){const _0x379c33=new _0x4118d8(this['locale']),_0x16b813=new Oe();return _0x16b813['bind']('isVisible')['to'](this,'isResultReady',_0x564494=>!_0x564494),_0x379c33['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-review-mode__check-run-results-header']},'children':[{'tag':'span','attributes':{'class':['ck-ai-review-mode__check-run-results-header-title']},'children':[{'text':this['bindTemplate']['to']('headerTitle')}]},{'tag':'div','attributes':{'class':['ck-ai-review-mode__check-run-results-header-buttons']},'children':[_0x16b813,this['_cancelButtonView'],this['_acceptAllButtonView'],this['_exitReviewButtonView'],this['_toggleDiffButtonView']]}]}),_0x379c33;}}class Ks extends _0x470a68{['resultsHeader'];['_finishReviewButtonView'];constructor(_0x45dd03){super(_0x45dd03),this['_finishReviewButtonView']=this['_createFinishReviewButtonView'](),this['resultsHeader']=this['_createResultHeaderView'](),this['set']('viewType','completed');const _0x5c8224=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-review-mode__review-completed',_0x5c8224['if']('isVisible','ck-hidden',_0x44444c=>!_0x44444c)]},'children':[this['resultsHeader'],{'tag':'div','attributes':{'class':['ck-ai-review-mode__review-completed-content']},'children':[{'tag':'span','attributes':{'class':['ck-ai-review-mode__review-completed-content-icon']},'children':[{'text':'🎉'}]},{'tag':'p','attributes':{'class':['ck-ai-review-mode__review-completed-content-text']},'children':[{'text':_0x5c8224['to']('viewType',_0x2b6599=>$n(_0x45dd03,'completed'===_0x2b6599?'AI_REVIEW_MODE_COMPLETED_TEXT':'AI_REVIEW_MODE_EMPTY_RESULTS_TEXT'))}]}]}]});}['_createFinishReviewButtonView'](){const _0x43818b=new _0x23128a(this['locale']);return _0x43818b['set']({'label':$n(this['locale'],'AI_REVIEW_MODE_FINISH_REVIEW_BUTTON_LABEL'),'withText':!0x0,'class':'ck-ai-button-primary'}),_0x43818b['on']('execute',()=>{this['fire']('finishReview');}),_0x43818b;}['_createResultHeaderView'](){const _0x31c2da=new _0x4118d8(this['locale']);return _0x31c2da['setTemplate']({'tag':'div','attributes':{'class':['ck-ai-review-mode__review-completed-header']},'children':[{'tag':'span','attributes':{'class':['ck-ai-review-mode__review-completed-header-title']},'children':[{'text':$n(this['locale'],'AI_REVIEW_MODE_FINISH_REVIEW_HEADER_TITLE')}]},{'tag':'div','attributes':{'class':['ck-ai-review-mode__review-completed-header-buttons']},'children':[this['_finishReviewButtonView']]}]}),_0x31c2da;}}class ce extends _0x4118d8{['reviewModeHeader'];['reviewCheckListView'];['reviewCheckResultsView'];['reviewCompletedView'];constructor(_0x3e1c1b){super(_0x3e1c1b),this['reviewModeHeader']=new _0x58dd82(_0x3e1c1b,{'label':$n(_0x3e1c1b,'AI_REVIEW_MODE'),'icon':_0x5b0b4c,'class':'ck-ai-header\x20ck-ai-header_review-mode'}),this['reviewCheckListView']=new Hs(_0x3e1c1b),this['reviewCheckListView']['delegate'](...Ns)['to'](this),this['reviewCheckResultsView']=new Js(_0x3e1c1b),this['reviewCheckResultsView']['delegate'](...Ns)['to'](this),this['reviewCompletedView']=new Ks(_0x3e1c1b),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-mode','ck-rounded-corners'],'dir':'ltr'},'children':[this['reviewModeHeader'],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);}['addCheckRunResult'](_0x59612f){this['reviewCheckResultsView']['addResult'](_0x59612f),this['reviewCheckResultsView']['set']('isLoading',!0x1);}['showReviewCompletedView'](){this['reviewCheckListView']['set']('isVisible',!0x1),this['reviewCheckResultsView']['set']('isVisible',!0x1),this['reviewCompletedView']['set']('viewType','completed'),this['reviewCompletedView']['set']('isVisible',!0x0);}['showActionsWhenResultIsReady'](){this['reviewCheckResultsView']['isResultReady']=!0x0;}['showNoChangesView'](){this['reviewCheckListView']['set']('isVisible',!0x1),this['reviewCheckResultsView']['set']('isVisible',!0x1),this['reviewCompletedView']['set']('viewType','unmodified'),this['reviewCompletedView']['set']('isVisible',!0x0);}['hideActionsWhenResultIsReady'](){this['reviewCheckResultsView']['isResultReady']=!0x1;}['showGeneralErrorView'](){this['reviewCheckResultsView']['set']('isLoading',!0x1),this['showActionsWhenResultIsReady'](),this['reviewCheckResultsView']['showGeneralErrorMessage']();}['showChunkErrorView'](){this['reviewCheckResultsView']['set']('isLoading',!0x1),this['showActionsWhenResultIsReady'](),this['reviewCheckResultsView']['showChunkErrorMessage']();}}class le extends _0xef9d9e{['resultItemView'];constructor(_0x4efaab,_0xf1cb8d){super(_0x4efaab),this['set']({'isVisible':!0x1,'position':'se','class':null,'top':0x0,'left':0x0}),this['extendTemplate']({'tag':'div','attributes':{'class':['ck-reset'],'tabindex':'-1'}}),this['content']['add'](this['_createContentView']()),_0xf1cb8d['add'](this),_0x28f439({'emitter':this,'activator':()=>this['isVisible'],'contextElements':[this['element']],'callback':()=>{this['hideBalloon'](),this['deactivateChange']();}});}['updateContent'](_0x5e5268){this['resultItemView']['changeId']=_0x5e5268['id'],this['resultItemView']['resultResponseView']['element']['innerHTML']=_0x5e5268['contentDiffed'];}['showBalloon'](_0x441550,_0x27f6d1){this['updateContent'](_0x441550),this['show'](),this['pin']({'target':_0x27f6d1});}['hideBalloon'](){this['hide'](),this['unpin']();}['deactivateChange'](){this['fire']('deactivateChange');}['_createContentView'](){const _0x576f48=new _0x4118d8();return this['resultItemView']=new xs(this['locale'],''),this['resultItemView']['resultResponseView']['extendTemplate']({'attributes':{'class':['ck-content']}}),this['resultItemView']['delegate']('acceptChange','dismissChange')['to'](this),_0x576f48['setTemplate']({'tag':'div','attributes':{'class':['ck-reset','ck-ai-review-mode-balloon-panel-suggestion']},'children':[{'tag':'p','attributes':{'class':['ck-ai-review-mode__suggestion-text']},'children':[this['resultItemView']]}]}),_0x576f48;}}const Ns=['getReviewCheckList','runReviewCheck','abortReviewStream','toggleDiff','acceptAllChanges','leaveReviewModeResultList','activateChange','acceptChange','dismissChange','learnMore','finishReview','retryReview'];class ie extends _0x56fd8d{['_reviewModeView'];['_reviewModeBalloonSuggestionItemView'];['_bodyCollection'];static get['requires'](){return[ht];}static get['pluginName'](){return'AIReviewModeUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x152425){super(_0x152425),this['_bodyCollection']=new Wt(this['context']['locale']),this['_bodyCollection']['attachToDom'](),this['_reviewModeView']=new ce(this['context']['locale']),this['_reviewModeView']['delegate'](...Ns)['to'](this),this['_reviewModeBalloonSuggestionItemView']=new le(this['context']['locale'],this['_bodyCollection']),this['_reviewModeBalloonSuggestionItemView']['delegate']('acceptChange','dismissChange','deactivateChange')['to'](this);}['init'](){const _0x482863=this['context']['plugins']['get']('AITabs');_0x482863['view']['on']('activateTab',(_0x2d569a,_0x36c699)=>{'reviewMode'===_0x36c699?this['fire']('getReviewCheckList'):this['fire']('leaveReviewMode');}),_0x482863['view']['addTab']({'id':'reviewMode','buttonLabel':$n(this['context']['locale'],'AI_REVIEW_MODE'),'buttonIcon':_0x5b0b4c,'order':0x0,'content':this['_reviewModeView']});}['destroy'](){this['_bodyCollection']['detachFromDom'](),super['destroy']();}['setAvailableChecks'](_0x40a71d){this['_reviewModeView']['reviewCheckListView']['hasChecks']()||this['_reviewModeView']['reviewCheckListView']['setChecks'](_0x40a71d),this['_reviewModeView']['showReviewCheckListView']();}['showReviewCheckList'](){this['fire']('getReviewCheckList');}['showCheckRunResults'](_0x4afcd1){_0x4afcd1&&('error-general'!==_0x4afcd1['status']?'error-chunk'!==_0x4afcd1['status']?this['_reviewModeView']['showReviewCheckResultsView']():this['showChunkErrorView']():this['showGeneralErrorView']());}['showCheckRunResult'](_0x3de5b6){this['_reviewModeView']['addCheckRunResult'](_0x3de5b6);}['showGeneralErrorView'](){this['_reviewModeView']['showGeneralErrorView']();}['showChunkErrorView'](){this['_reviewModeView']['showChunkErrorView']();}['setCheckResultTitle'](_0x520e82){this['_reviewModeView']['reviewCheckResultsView']['setTitle'](_0x520e82);}['setActiveStateInResults'](_0x1ebf4a){this['_reviewModeView']['reviewCheckResultsView']['getResults']()['forEach'](_0x58c014=>{_0x58c014['id']===_0x1ebf4a&&_0x58c014['setItemAsActive']();});}['resetActiveStateInResults'](){this['_reviewModeView']['reviewCheckResultsView']['getResults']()['forEach'](_0x31a447=>_0x31a447['setItemAsInactive']());}['updateChangeState'](_0x140ed0,_0x25039d){'accepted'!==_0x25039d&&'rejected'!==_0x25039d||this['_reviewModeView']['reviewCheckResultsView']['hideResult'](_0x140ed0);}['showReviewCompletedView'](){this['_reviewModeView']['showReviewCompletedView']();}['showActionsWhenResultIsReady'](){this['_reviewModeView']['showActionsWhenResultIsReady']();}['showNoChangesView'](){this['_reviewModeView']['showNoChangesView']();}['hideActionsWhenResultIsReady'](){this['_reviewModeView']['hideActionsWhenResultIsReady']();}['showChangeBalloon'](_0x3f514f,_0x42db5c){this['_reviewModeBalloonSuggestionItemView']['showBalloon'](_0x3f514f,_0x42db5c);}['hideChangeBalloon'](){this['_reviewModeBalloonSuggestionItemView']['hideBalloon']();}['getChangeElement'](_0x4a3ef4){const _0x428949=this['_reviewModeView']['reviewCheckResultsView']['getResults']()['find'](_0x2ec3c7=>_0x2ec3c7['id']===_0x4a3ef4);return _0x428949?_0x428949['element']:null;}['deactivateChange'](){this['_reviewModeBalloonSuggestionItemView']['deactivateChange']();}}const ae='reviewmode-';class re extends _0x56fd8d{static get['pluginName'](){return'AIReviewModeEditing';}static get['requires'](){return[_0x722e36,O];}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['_markers']=new Map();['_domEmitter'];['_eventEmitter'];constructor(_0x5bffb9){super(_0x5bffb9),this['_domEmitter']=new(_0x34a258())(),this['_eventEmitter']=new(_0x5f2b03())();}get['emitter'](){return this['_eventEmitter'];}['afterInit'](){const _0x1011a3=V(this['context']);_0x1011a3['conversion']['for']('editingDowncast')['markerToElement']({'model':ae+'insert','view':(_0x3dfef5,{writer:_0x5eacbb})=>{const _0x1ba143=this['_markers']['get'](_0x3dfef5['markerName']),_0x1c333e={'class':'ck-ai_review-mode-marker_add','data-marker-id':_0x3dfef5['markerName']};return _0x5eacbb['createUIElement']('span',_0x1c333e,function(_0x4a3917){const _0x1eab7b=this['toDomElement'](_0x4a3917);return _0x1eab7b['innerHTML']=_0x1ba143?.['text']||'',_0x1eab7b;});}}),_0x1011a3['conversion']['for']('editingDowncast')['markerToHighlight']({'model':ae+'remove-only','view':_0x5c0c1a=>({'classes':'ck-ai_review-mode-marker_strikethrough','attributes':{'data-marker-id':_0x5c0c1a['markerName']}})}),_0x1011a3['conversion']['for']('editingDowncast')['markerToHighlight']({'model':ae+'remove-context','view':_0x852f9d=>({'classes':'ck-ai_review-mode-marker_underline','attributes':{'data-marker-id':_0x852f9d['markerName']}})}),_0x1011a3['conversion']['for']('editingDowncast')['markerToHighlight']({'model':ae+'remove-text','view':_0x570761=>({'classes':'ck-ai_review-mode-marker_hide','attributes':{'data-marker-id':_0x570761['markerName']}})}),_0x1011a3['conversion']['for']('dataDowncast')['markerToElement']({'model':ae+'suggestion-context','view':(_0x40c320,{writer:_0x5adc3c})=>_0x5adc3c['createRawElement']('span',{'class':'ck-ai_review-mode-marker_context-'+(_0x40c320['isOpening']?'start':'end')})}),_0x1011a3['conversion']['for']('downcast')['attributeToAttribute']({'model':_0x4b206b,'view':_0x702168}),this['_domEmitter']['listenTo'](document,'click',(_0x24916c,_0x4eb4d4)=>{const _0x12d4e3=_0x4eb4d4['target'],_0x399b53=this['_findMarkerElement'](_0x12d4e3);if(!_0x399b53)return;const _0x5b77dc=_0x399b53['getAttribute']('data-marker-id'),_0x4300d9=_0x5b77dc['split'](':')['pop']()?.['split']('_')[0x0];this['_eventEmitter']['fire']('changeMarkerClick',{'markerId':_0x5b77dc,'changeId':_0x4300d9});});}['getDocumentData'](){const _0x34aea7=this['context']['plugins']['get']('AIEditing'),_0xba3a63=V(this['context']),_0x4f0d1d=_0xba3a63['model'],_0x1d178b=new _0xc93263();for(const _0x375418 of _0x4f0d1d['document']['getRoot']()['getChildren']()){const _0x217f83=_0x375418['_clone'](!0x0);_0x1d178b['_appendChild'](_0x217f83);}for(const _0x4f5aa4 of _0x4f0d1d['markers'])_0x1d178b['markers']['set'](_0x4f5aa4['name'],this['_changeRangeOwnerDocument'](_0x4f5aa4['getRange']()['clone'](),_0x1d178b));const _0x1da37c=new te({'ignoreElementEnd':!0x0,'startPosition':_0x4f0d1d['createPositionAt'](_0x1d178b,0x0)}),_0x10e636=new Set(),_0x5b3702=new Map();for(const {item:_0xa2120c}of _0x1da37c){if(!_0xa2120c['is']('$textProxy'))continue;const _0x3dffbe=_0xa2120c['parent'];if((!_0x3dffbe||!_0x3dffbe['is']('element','caption'))&&(_0x3dffbe&&_0x3dffbe['is']('element'))){let _0x36d16d=_0x3dffbe['getAttribute'](_0x4b206b);_0x36d16d||(_0x36d16d=_0x34aea7['_nextDataId'](_0x10e636),_0x3dffbe['_setAttribute'](_0x4b206b,_0x36d16d)),_0x10e636['add'](_0x36d16d);const _0x5f24d4=this['_getTopElement'](_0x3dffbe);_0x5b3702['set'](_0x36d16d,{'path':_0x3dffbe['getPath'](),'getContent':this['_createGetContentUsingDataIdFn'](_0x5f24d4['_clone'](!0x0),_0x36d16d,_0xba3a63['data'])}),_0x1da37c['jumpTo'](_0x4f0d1d['createPositionAfter'](_0x3dffbe));}}return{'content':_0xba3a63['data']['processor']['toData'](_0xba3a63['data']['toView'](_0x1d178b)),'version':_0xba3a63['model']['document']['version'],'elements':_0x5b3702};}['diffContent'](_0x10be9e,_0x29a69a){const _0x51ce91=V(this['context']),_0x5d2fb0=_0x51ce91['data']['parse'](_0x10be9e,'$documentFragment'),_0x1dcead=_0x51ce91['model']['createPositionAt'](_0x5d2fb0,0x0),_0x4e33c1=this['context']['plugins']['get']('DocumentCompare')['getDiff'](_0x10be9e,_0x29a69a,{'anchor':_0x1dcead,'markDeletions':!0x0})['getOperations']()['filter'](_0x4d1611=>'insert'===_0x4d1611['type']||'marker'===_0x4d1611['type']&&_0x4d1611['name']['startsWith']('$markedRemove')),_0x26887e=this['_groupAdjacentOperations'](_0x4e33c1),_0x19990c=[];let _0x4f533b=0x0;return _0x51ce91['model']['change'](_0x322fbb=>{for(let _0x1a61e6=0x0;_0x1a61e6<_0x26887e['length'];_0x1a61e6++){const _0x4e8944=_0x26887e[_0x1a61e6],_0x23f8b3=_0x322fbb['createDocumentFragment']();for(const _0x2dc96b of _0x5d2fb0['getChildren']())_0x322fbb['append'](_0x2dc96b['_clone'](!0x0),_0x23f8b3);for(const _0x4fa9e2 of _0x4e8944['operationsIsolated'])if('insert'===_0x4fa9e2['type']){const _0x4c6d52=_0x4fa9e2;_0x4c6d52['baseVersion']=null,_0x4c6d52['isDocumentOperation']=!0x1,this['_changeOperationOwnerDocument'](_0x4c6d52,_0x23f8b3),_0x322fbb['batch']['addOperation'](_0x4fa9e2),_0x51ce91['model']['applyOperation'](_0x4fa9e2);const _0x4d450b='suggestion:insertion:id:authorId:'+_0x4f533b++,_0x4c3ff0=_0x51ce91['model']['createRange'](_0x4c6d52['position'],_0x4c6d52['position']['getShiftedBy'](_0x4c6d52['howMany']));_0x23f8b3['markers']['set'](_0x4d450b,_0x4c3ff0);}else{if('marker'===_0x4fa9e2['type']&&_0x4fa9e2['name']['startsWith']('$markedRemove')){const _0x2efc4e=_0x4fa9e2,_0x321fe8='suggestion:deletion:id:authorId:'+_0x4f533b++;this['_changeOperationOwnerDocument'](_0x2efc4e,_0x23f8b3),_0x23f8b3['markers']['set'](_0x321fe8,_0x2efc4e['newRange']);}}const _0x5e122f=this['_getChangeContext'](this['_changePositionOwnerDocument'](this['_getOperationStart'](_0x4e8944['operationsIsolated'][0x0]),_0x23f8b3),this['_changePositionOwnerDocument'](this['_getOperationEnd'](_0x4e8944['operationsIsolated'][_0x4e8944['operationsIsolated']['length']-0x1]),_0x23f8b3));_0x23f8b3['markers']['set'](ae+'suggestion-context',new _0x4924b2(_0x5e122f['start'],_0x5e122f['end'])),_0x19990c['push']({..._0x4e8944,'context':this['_createGetContextFn'](_0x23f8b3,_0x51ce91['data'],{'ellipsisBefore':_0x5e122f['hasContentBefore'],'ellipsisAfter':_0x5e122f['hasContentAfter']}),'content':this['_createGetContentFn'](_0x23f8b3,_0x51ce91['data'])});}}),_0x19990c;}['markChangePositionInEditorContent'](_0x663ded,_0x4ae05b){const _0x262637=_0x663ded[0x0]['parent']['id'],_0x5de9e5=_0x4ae05b['elements']['get'](_0x262637);if(!_0x5de9e5)return void console['warn']('No\x20element\x20found\x20for\x20ID:\x20'+_0x262637);const _0xffc770=_0x5de9e5['path'],_0x3e1101=V(this['context']),_0x40e8d9=_0x3e1101['model']['document']['history']['getOperations'](_0x4ae05b['version']),_0x1469b0=[];for(const _0x228ce4 of _0x663ded){const _0x1bb2ce=_0x228ce4['operationsIsolated']['map'](_0x132896=>this['_translateOperationToEditorContent'](_0x132896,_0xffc770,_0x3e1101['model']['document']['getRoots']()[0x0]));if(!_0x1bb2ce||!_0x1bb2ce['length'])continue;const _0x5cc57d=_0x1bb2ce['every'](_0xa29573=>'marker'===_0xa29573['type']&&_0xa29573['name']['startsWith']('$markedRemove')),_0xe5b723={'document':_0x3e1101['model']['document'],'useRelations':!0x1,'padWithNoOps':!0x1},_0x4aabbf=it(_0x1bb2ce,_0x40e8d9,_0xe5b723)['operationsA'];for(const _0x43ac67 of _0x4aabbf)if('insert'===_0x43ac67['type']){const _0x86534a=_0x43ac67,_0x53ab1d=_0x86534a['nodes'];let _0x5135a0='';for(const _0x2fd9f0 of _0x53ab1d)_0x2fd9f0&&_0x2fd9f0['is']('model:$text')&&(_0x5135a0+=_0x2fd9f0['data']);_0x1469b0['push']({'start':_0x86534a['position'],'end':_0x86534a['position'],'type':'insert','groupId':_0x228ce4['id'],'text':_0x5135a0});}else{if('marker'===_0x43ac67['type']&&_0x43ac67['name']['startsWith']('$markedRemove')){const _0xb7dcc2=_0x43ac67;let _0x31ab9a='remove-text';if(_0x5cc57d){const _0xff30b0=this['_findAdjacentContextDistance'](_0xb7dcc2['newRange']['start'],'backward',_0x3e1101['model']['schema']),_0x4ad8b2=this['_findAdjacentContextDistance'](_0xb7dcc2['newRange']['end'],'forward',_0x3e1101['model']['schema']);if(_0xff30b0||_0x4ad8b2){const _0x2a82e8=_0xb7dcc2['newRange']['start']['getShiftedBy'](-_0xff30b0),_0x1e2108=_0xb7dcc2['newRange']['end']['getShiftedBy'](_0x4ad8b2);_0x1469b0['push']({'start':_0x2a82e8,'end':_0x1e2108,'groupId':_0x228ce4['id'],'type':'remove-context'});}else _0x31ab9a='remove-only';}_0x1469b0['push']({'start':_0xb7dcc2['newRange']['start'],'end':_0xb7dcc2['newRange']['end'],'groupId':_0x228ce4['id'],'type':_0x31ab9a});}}}this['_insertMarkers'](_0x1469b0);}['clearAllMarkers'](){V(this['context'])['model']['change'](_0xfdb85f=>{for(const _0x50f67a of this['_markers']['keys']())_0xfdb85f['removeMarker'](_0x50f67a);}),this['_markers']['clear']();}['switchToReadOnly'](){V(this['context'])['enableReadOnlyMode']('ai-review-mode');}['switchToEdit'](){V(this['context'])['disableReadOnlyMode']('ai-review-mode');}['applyChange'](_0x533e3f){const _0x490fce=V(this['context']),_0x56a902=_0x490fce['model'],_0x2710be=_0x533e3f['map'](_0x393d33=>this['_getMarkersDataForGroup'](_0x393d33))['flat']();_0x56a902['change'](_0x34dd43=>{for(const _0x44e88b of _0x2710be){const _0x5279dc=_0x490fce['model']['markers']['get'](_0x44e88b['id']);_0x5279dc&&('insert'===_0x44e88b['type']?_0x56a902['insertContent'](_0x34dd43['createText'](_0x44e88b['text']||''),_0x5279dc['getRange']()['start']):'remove-text'!==_0x44e88b['type']&&'remove-only'!==_0x44e88b['type']||_0x56a902['deleteContent'](_0x56a902['createSelection'](_0x5279dc['getRange']())),_0x34dd43['removeMarker'](_0x44e88b['id']),this['_markers']['delete'](_0x44e88b['id']));}});}['rejectChange'](_0xdd4f26){const _0x27389d=V(this['context']),_0xf1ab01=this['_getMarkersDataForGroup'](_0xdd4f26);_0x27389d['model']['change'](_0x61ad77=>{for(const _0x3b7e2 of _0xf1ab01)_0x61ad77['removeMarker'](_0x3b7e2['id']),this['_markers']['delete'](_0x3b7e2['id']);});}['getContentElement'](){const _0x45b19f=V(this['context']);return _0x45b19f&&_0x45b19f['ui']&&_0x45b19f['ui']['element']?_0x45b19f['ui']['element']:null;}['getMarkerElementForChange'](_0x3afd64){const _0x4288dc=Array['from'](this['_markers']['values']())['filter'](_0x2f00b9=>_0x2f00b9['groupId']===_0x3afd64);if(!_0x4288dc['length'])return null;const _0x5ec846=0x1===_0x4288dc['length']?_0x4288dc[0x0]:this['_sortMarkers'](_0x4288dc)[0x0],_0x21016a=V(this['context']),_0x19ef97=_0x21016a['model']['markers']['get'](_0x5ec846['id']);if(!_0x19ef97)return null;const _0xd1f9a3=_0x19ef97['getRange'](),_0x255a77=_0x21016a['editing']['view']['getDomRoot']();if(!_0x255a77||!_0xd1f9a3)return null;const _0x195f56=_0x255a77['querySelector']('[data-marker-id=\x22'+_0x5ec846['id']+'\x22]');return _0x195f56?{'modelRange':_0xd1f9a3,'domElement':_0x195f56}:null;}['_translateOperationToEditorContent'](_0x6519f8,_0x5b8df8,_0x19e856){if('insert'===_0x6519f8['type']){const _0x4429ce=_0x6519f8;return new $t(this['_changePosition'](_0x4429ce['position'],_0x5b8df8['concat'](_0x4429ce['position']['offset']),_0x19e856),_0x4429ce['nodes'],_0x4429ce['baseVersion']);}if('marker'===_0x6519f8['type']&&_0x6519f8['name']['startsWith']('$markedRemove')){const _0x28cc42=_0x6519f8;return new Bt(_0x28cc42['name'],_0x28cc42['oldRange'],this['_changeRange'](_0x28cc42['newRange'],_0x5b8df8['concat'](_0x28cc42['newRange']['start']['offset']),_0x5b8df8['concat'](_0x28cc42['newRange']['end']['offset']),_0x19e856),_0x28cc42['_markers'],_0x28cc42['affectsData'],_0x28cc42['baseVersion']);}return _0x6519f8;}['_groupAdjacentOperations'](_0x317c22){if(!_0x317c22['length'])return[];const _0x247922=[];let _0x1abe4f=0x0,_0x2cdb76=0x0,_0x2fd22d=[];for(let _0xa33a78=0x0;_0xa33a78<=_0x317c22['length'];_0xa33a78++){const _0x20b106=_0x317c22[_0xa33a78],_0x1259ce=_0x317c22[_0xa33a78-0x1];!_0x20b106||_0x1259ce&&!this['_getOperationEnd'](_0x1259ce)['isTouching'](this['_getOperationStart'](_0x20b106))?(_0x247922['push']({'operations':_0x2fd22d,'operationsIsolated':_0x2fd22d['map'](_0xbf6586=>this['_shiftOperation'](_0xbf6586['clone'](),-_0x2cdb76)),'groupOffset':_0x1abe4f}),_0x2fd22d=_0x20b106?[_0x20b106]:[],_0x2cdb76+=_0x1abe4f,_0x1abe4f=0x0):_0x2fd22d['push'](_0x20b106),_0x20b106&&'insert'===_0x20b106['type']&&(_0x1abe4f+=_0x20b106['howMany']);}return _0x247922;}['_findAdjacentContextDistance'](_0x574a4c,_0x2b3151,_0x446de1,_0x1ef65f=0x1){const _0x272ff7=new te({'startPosition':_0x574a4c,'direction':_0x2b3151});let _0x57d302=0x0;for(let _0x238852=0x0;_0x238852<_0x1ef65f;_0x238852++){let _0x488619=0x0,_0x950f04=!0x1,_0x30e3b7='forward'===_0x2b3151?/^\W*\w+/:/\w+\W*$/;for(const {item:_0x4a4dd2}of _0x272ff7)if(_0x4a4dd2['is']('$textProxy')){const _0x531543=_0x30e3b7['exec'](_0x4a4dd2['data']);if(_0x531543&&_0x531543['length']){if(_0x488619+='forward'===_0x2b3151?_0x531543['index']+_0x531543[0x0]['length']:_0x4a4dd2['data']['length']-_0x531543['index'],_0x531543[0x0]['length']!==_0x4a4dd2['data']['length'])break;_0x950f04=!0x0,_0x30e3b7='forward'===_0x2b3151?/^\w+/:/\w+$/;}else{if(_0x950f04)break;_0x488619+=_0x4a4dd2['offsetSize'];}}else{if(_0x4a4dd2['is']('element')){_0x446de1['isInline'](_0x4a4dd2)&&!_0x950f04&&(_0x488619+=0x1);break;}}_0x57d302+=_0x488619,_0x272ff7['jumpTo'](_0x574a4c['getShiftedBy']('forward'===_0x2b3151?_0x57d302:-_0x57d302));}return _0x57d302;}['_getChangeContext'](_0x5beb77,_0x4c41ca){const _0x4325bc=V(this['context'])['model']['schema'],_0xbfc557=this['_findAdjacentContextDistance'](_0x5beb77,'backward',_0x4325bc,0x6),_0x487ecc=this['_findAdjacentContextDistance'](_0x4c41ca,'forward',_0x4325bc,0x6),_0x5e1d21=_0x5beb77['getShiftedBy'](-_0xbfc557),_0x38c142=_0x4c41ca['getShiftedBy'](_0x487ecc);return{'start':_0x5e1d21,'end':_0x38c142,'hasContentBefore':!_0x5e1d21['isAtStart'],'hasContentAfter':!_0x38c142['isAtEnd']};}['_insertMarkers'](_0x56dd5a){const _0x2abf51=this['context']['plugins']['get']('AIEditing'),_0x40fa00=new Set();V(this['context'])['model']['change'](_0x6eec13=>{for(const _0x35a707 of _0x56dd5a){const _0x342836=''+ae+_0x35a707['type']+':'+_0x35a707['groupId']+'_'+_0x2abf51['_nextDataId'](_0x40fa00);this['_markers']['set'](_0x342836,{'id':_0x342836,'groupId':_0x35a707['groupId'],'type':_0x35a707['type'],'text':_0x35a707['text']}),_0x6eec13['addMarker'](_0x342836,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x6eec13['createRange'](_0x35a707['start'],_0x35a707['end'])});}});}['_createGetContextFn'](_0x50d308,_0x2ddeab,_0x5183d2){let _0x3647cd='';return()=>{if(!_0x3647cd){const _0x100c22=_0x2ddeab['toView'](_0x50d308,{'showSuggestionHighlights':!0x0}),_0x5332bb=_0x100c22['getChild'](0x0);if(!_0x5332bb)return'';let _0x2f72f5=!0x1;const _0x838cfb=[];for(const _0xf0b074 of _0x5332bb['getChildren']())_0xf0b074['is']('element','span')&&_0xf0b074['hasClass']('ck-ai_review-mode-marker_context-end')&&(_0x2f72f5=!0x1),_0x2f72f5&&_0x838cfb['push'](_0xf0b074),_0xf0b074['is']('element','span')&&_0xf0b074['hasClass']('ck-ai_review-mode-marker_context-start')&&(_0x2f72f5=!0x0);_0x5332bb['_removeChildren'](0x0,_0x5332bb['childCount']),_0x5183d2?.['ellipsisBefore']&&_0x5332bb['_appendChild']('…'),_0x5332bb['_appendChild'](_0x838cfb),_0x5183d2?.['ellipsisAfter']&&_0x5332bb['_appendChild']('…');const _0x2e28d5=_0x2ddeab['htmlProcessor']['domConverter']['viewToDom'](_0x100c22),_0xa3d414=_0x2ddeab['htmlProcessor']['htmlWriter']['getHtml'](_0x2e28d5);_0x3647cd=_0xa3d414;}return _0x3647cd;};}['_createGetContentFn'](_0x256e86,_0x232f77){let _0x397396='';return()=>(_0x397396||(_0x397396=_0x232f77['stringify'](_0x256e86,{'showSuggestionHighlights':!0x0})),_0x397396);}['_createGetContentUsingDataIdFn'](_0x126392,_0x244663,_0xc70f16){let _0x378dd4='';return()=>{if(!_0x378dd4){const _0xbbdf2e=_0xc70f16['toView'](new _0xc93263(_0x126392)),_0x36f144=_0xc70f16['htmlProcessor']['domConverter']['viewToDom'](_0xbbdf2e)['querySelector']('[data-id=\x22'+_0x244663+'\x22]');_0x378dd4=_0x36f144?.['outerHTML']||'';}return _0x378dd4;};}['_findMarkerElement'](_0x4b9b8e,_0x4f1c63=0x5){let _0x5c0743=_0x4b9b8e,_0x3cf053=null;for(let _0x26f811=0x0;_0x26f811<_0x4f1c63&&_0x5c0743;_0x26f811++){if(!_0x5c0743['className']){_0x5c0743=_0x5c0743['parentElement'];continue;}if(!(''+_0x5c0743['className'])['includes']('ck-ai_review-mode-marker_')){_0x5c0743=_0x5c0743['parentElement'];continue;}if(!_0x5c0743['getAttribute']('data-marker-id'))break;_0x3cf053=_0x5c0743;break;}return _0x3cf053;}['_getMarkersDataForGroup'](_0x38d8c0){return Array['from'](this['_markers']['values']())['filter'](_0x88ffa5=>_0x88ffa5['groupId']===_0x38d8c0);}['_getOperationStart'](_0x58e6ac){return'insert'===_0x58e6ac['type']?_0x58e6ac['position']:_0x58e6ac['newRange']['start'];}['_getOperationEnd'](_0x35c386,_0x5c5035=!0x1){return'insert'===_0x35c386['type']?_0x5c5035?_0x35c386['position']:_0x35c386['position']['getShiftedBy'](_0x35c386['howMany']):_0x35c386['newRange']['end'];}['_shiftOperation'](_0x451acd,_0x23c4ef){return'insert'===_0x451acd['type']?_0x451acd['position']=_0x451acd['position']['getShiftedBy'](_0x23c4ef):'marker'===_0x451acd['type']&&_0x451acd['newRange']&&(_0x451acd['newRange']=new _0x4924b2(_0x451acd['newRange']['start']['getShiftedBy'](_0x23c4ef),_0x451acd['newRange']['end']['getShiftedBy'](_0x23c4ef))),_0x451acd;}['_changeOperationOwnerDocument'](_0x60c86e,_0x385492){'insert'===_0x60c86e['type']?_0x60c86e['position']=this['_changePositionOwnerDocument'](_0x60c86e['position'],_0x385492):'marker'===_0x60c86e['type']&&_0x60c86e['newRange']&&(_0x60c86e['newRange']=this['_changeRangeOwnerDocument'](_0x60c86e['newRange'],_0x385492));}['_changePositionOwnerDocument'](_0x35d226,_0x4377da){return new _0x2aa0a3(_0x4377da,_0x35d226['path']);}['_changeRangeOwnerDocument'](_0x5ab348,_0x30461c){return new _0x4924b2(this['_changePositionOwnerDocument'](_0x5ab348['start'],_0x30461c),this['_changePositionOwnerDocument'](_0x5ab348['end'],_0x30461c));}['_changePosition'](_0x193453,_0x22399d,_0x2b7331){return new _0x2aa0a3(_0x2b7331,[..._0x22399d]);}['_changeRange'](_0x39a880,_0x5d964f,_0x8ec761,_0x543ab1){return new _0x4924b2(this['_changePosition'](_0x39a880['start'],_0x5d964f,_0x543ab1),this['_changePosition'](_0x39a880['end'],_0x8ec761,_0x543ab1));}['_getTopElement'](_0x493ff4){let _0x532689=_0x493ff4;for(;_0x532689['parent']&&!_0x532689['parent']['is']('documentFragment');)_0x532689=_0x532689['parent'];return _0x532689;}['_sortMarkers'](_0x44f48b){const _0x736c9=_0x590b3f=>{switch(_0x590b3f){case'insert':return 0x1;case'remove-context':return 0x2;case'remove-only':return 0x3;case'remove-text':return 0x4;}};return _0x44f48b['sort']((_0x5d6041,_0x57890f)=>_0x736c9(_0x5d6041['type'])-_0x736c9(_0x57890f['type']));}}class Ra extends _0x56fd8d{static get['requires'](){return[ee,ie,re];}static get['pluginName'](){return'AIReviewMode';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}export{Sa as AIActions,x as AIAdapter,Kn as AIAssistant,n as AIAssistantUI,W as AIBalloon,Ca as AIChat,et as AIChatController,st as AIChatHistory,jt as AIChatHistoryController,xt as AIChatHistoryUI,at as AIChatUI,N as AIConnector,O as AIEditing,wa as AIEditorIntegration,Ot as AIQuickActionType,Oa as AIQuickActions,ii as AIQuickActionsUI,tr as AIRequestError,vs as AIReviewCheck,Cs as AIReviewCheckResult,pr as AIReviewCheckRun,Ra as AIReviewMode,ee as AIReviewModeController,re as AIReviewModeEditing,ie as AIReviewModeUI,ht as AITabs,de as AITextAdapter,bt as AIToggleButtonUI,Yn as AWSTextAdapter,Fn as OpenAITextAdapter,E as ShowAIAssistantCommand,eo as ToggleAICommand,As as createResizeButton,Wn as getDefaultAICommands};
|